diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..6098c20 --- /dev/null +++ b/.clang-format @@ -0,0 +1,18 @@ +--- +BasedOnStyle: WebKit +AlignTrailingComments: true +AllowShortBlocksOnASingleLine: true +AllowShortCaseLabelsOnASingleLine: true +AllowShortFunctionsOnASingleLine: true +AllowShortIfStatementsOnASingleLine: true +ColumnLimit: 0 +IndentWidth: 4 +SortIncludes: false +MaxEmptyLinesToKeep: 2 +IndentCaseLabels: true +AlignConsecutiveMacros: true +WhitespaceSensitiveMacros: ['QUOTE'] +IfMacros: ['IFX', 'IFXORNAT', 'IFX2', 'IFXA', 'IFX_PENDOR0', 'IFXX', 'IFX2X', 'IFXN', 'UFLAG_IF', 'PASS2IF', 'IF_UNALIGNED', 'IF_ALIGNED'] +UseTab: Never +IndentPPDirectives: None +--- diff --git a/CMakeLists.txt b/CMakeLists.txt index 5708a7b..3bddfad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,10 +15,13 @@ option(ODROIDN2 "Set to ON if targeting an Odroid-N2 device" ${ODROIDN2}) option(TEGRAX1 "Set to ON if targeting an Tegra X1 based device" ${TEGRAX1}) option(TEGRA_T194 "Set to ON if targeting an Tegra Xavier based device" ${TEGRA_T194}) option(TEGRA_T234 "Set to ON if targeting an Tegra Orin based device" ${TEGRA_T234}) +option(NVIDIA_GB10 "Set to ON if targeting a DGX Spark(GB10) based device" ${NVIDIA_GB10}) option(PHYTIUM "Set to ON if targeting an Phytium (D2000 or FT2000/4) based device" ${PHYTIUM}) -option(SD845 "Set to ON if targeting a Snapragon 845 based device" ${SD845}) -option(SD888 "Set to ON if targeting a Snapragon 888 based device" ${SD888}) -option(SD8G2 "Set to ON if targeting a Snapragon 8 Gen 2 based device" ${SD8G2}) +option(SD845 "Set to ON if targeting a Snapdragon 845 based device" ${SD845}) +option(SD865 "Set to ON if targeting a Snapdragon 865 based device" ${SD865}) +option(SD888 "Set to ON if targeting a Snapdragon 888 based device" ${SD888}) +option(SD8G2 "Set to ON if targeting a Snapdragon 8 Gen 2 based device" ${SD8G2}) +option(SDORYON1 "Set to ON if targeting a Snapdragon Oryon 1 (X1E80100/X1E78100) based device" ${SDORYON1}) option(ADLINK "Set to ON if targeting an ADLink AmpereAltra based device" ${ADLINK}) option(M1 "Set to ON if targeting a AppleM1 running on Asahi computer" ${M1}) option(LARCH64 "Set to ON if targeting an Loongarch64 based device" ${LARCH64}) @@ -28,26 +31,48 @@ option(LX2160A "Set to ON if targeting an LX2160A based device" ${LX2160A}) option(ARM64 "Set to ON if targeting a generic ARM64 based device" ${ARM64}) option(ANDROID "Set to ON if targeting an Android device" ${ANDROID}) option(TERMUX "Set to ON if targeting an Android device with Termux" ${TERMUX}) +option(WINLATOR_GLIBC "Set to ON if targeting an Android device with Winlator Glibc" ${WINLATOR_GLIBC}) option(USE_CCACHE "Set to ON to use ccache if present in the system" ${USE_CCACHE}) -option(HAVE_TRACE "Set to ON to have Trace ability (needs ZydisInfo library)" ${HAVE_TRACE}) -option(SAVE_MEM "Set to ON to build dynarec with some slower memory saving optimisations" ${SAVE_MEM}) +option(HAVE_TRACE "Set to ON to have Trace ability (needs libzydis-dev)" ${HAVE_TRACE}) +option(ZYDIS3 "Set to ON if you have trace and an old libzydis v3.x" ${ZYDIS3}) +option(SAVE_MEM "Set to ON to build dynarec with some slower memory saving optimizations" ${SAVE_MEM}) option(NOLOADADDR "Set to ON to avoid fixing the load address of Box64" OFF) option(NOGIT "Set to ON if not building from a git clone repo (like when building from a zip download from github)" ${NOGIT}) option(BAD_SIGNAL "Set to ON to activate the workaround for incoherent si_info on SIGSEGV" ${BAD_SIGNAL}) +option(BAD_PKILL "Set to ON to activate the workaround for incoherent pthread_kill" ${BAD_PKILL}) option(SW64 "Set ON if targeting an SW64 based device" ${SW64}) option(CI "Set to ON if running in CI" ${CI}) option(WITH_MOLD "Set to ON to use with mold" ${WITH_MOLD}) +option(BOX32 "Set to ON to add Linux 32bits support (experimental, do not use)" ${BOX32}) +option(BOX32_BINFMT "Also setup binfmt integration for box32" ${BOX32_BINFMT}) +option(LARCH64_ABI_1 "Set to ON if building for Loongarch64 ABI 1.0 system" ${LARCH64_ABI_1}) +option(GDBJIT "Set to ON to enable GDB JIT support" ${GDBJIT}) +option(WOW64 "Set to ON if you want a WOW64 PE build in addition") if(TERMUX) set(TERMUX_PATH "/data/data/com.termux/files") set(ANDROID ON CACHE BOOL "") endif() + +# Hack: limit the optimization level to -O1 for some platforms +if(TERMUX OR ANDROID) + set(CMAKE_C_FLAGS_RELEASE "-O1") + set(CMAKE_CXX_FLAGS_RELEASE "-O1") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O1 -g") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -g") +endif() + if(LARCH64) set(LD80BITS OFF CACHE BOOL "") set(NOALIGN OFF CACHE BOOL "") set(ARM_DYNAREC OFF CACHE BOOL "") set(RV64_DYNAREC OFF CACHE BOOL "") set(LARCH64_DYNAREC ON CACHE BOOL "") + set(BAD_PKILL ON CACHE BOOL "") + if(LARCH64_ABI_1) + message(STATUS "Build for Loongarch64 ABI 1.0 system") + add_definitions(-DLA64_ABI_1) + endif() endif() if(RV64) set(LD80BITS OFF CACHE BOOL "") @@ -63,7 +88,7 @@ if(PPC64LE) set(RV64_DYNAREC OFF CACHE BOOL "") set(LARCH64_DYNAREC OFF CACHE BOOL "") endif() -if(RK3399 OR RK3588 OR ODROIDN2 OR RPI3ARM64 OR RPI4ARM64 OR RPI5ARM64 OR RK3326 OR TEGRAX1 OR TEGRA_T194 OR TEGRA_T234 OR PHYTIUM OR SD845 OR SD888 OR SD8G2 OR LX2160A OR M1 OR ARM64 OR ADLINK) +if(RK3399 OR RK3588 OR ODROIDN2 OR RPI3ARM64 OR RPI4ARM64 OR RPI5ARM64 OR RK3326 OR TEGRAX1 OR TEGRA_T194 OR TEGRA_T234 OR NVIDIA_GB10 OR PHYTIUM OR SD845 OR SD865 OR SD888 OR SD8G2 OR SDORYON1 OR LX2160A OR M1 OR ARM64 OR ADLINK) set(LD80BITS OFF CACHE BOOL "") set(NOALIGN OFF CACHE BOOL "") set(ARM_DYNAREC ON CACHE BOOL "") @@ -81,10 +106,16 @@ if(SW64) set(NOALIGN OFF CACHE BOOL "") endif() if(ANDROID) - set(NOLOADADDR ON CACHE BOOL "") + set(TERMUX_PATH "/data/data/com.termux/files") + #set(NOLOADADDR ON CACHE BOOL "") #no need to force this setting it seems now set(BAD_SIGNAL ON CACHE BOOL "") endif() +if(GDBJIT) + message(STATUS "Build with GDBJIT support") + add_definitions(-DGDBJIT) +endif() + option(LD80BITS "Set to ON if host device have 80bits long double (i.e. i386)" ${LD80BITS}) option(NOALIGN "Set to ON if host device doesn't need re-align (i.e. i386)" ${NOALIGN}) option(ARM_DYNAREC "Set to ON to use ARM Dynamic Recompilation" ${ARM_DYNAREC}) @@ -124,92 +155,105 @@ endif() if(RPI3ARM64) add_definitions(-DRPI) add_definitions(-DRPI3ARM64) - add_definitions(-pipe -march=armv8-a+crc -mtune=cortex-a53) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+crc -mtune=cortex-a53") + set(CFLAGS -pipe -march=armv8-a+crc -mtune=cortex-a53) elseif(RPI4ARM64) add_definitions(-DRPI) add_definitions(-DRPI4ARM64) - add_definitions(-pipe -march=armv8-a+crc -mtune=cortex-a72) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+crc -mtune=cortex-a72") + set(CFLAGS -pipe -march=armv8-a+crc -mtune=cortex-a72) elseif(RPI5ARM64) add_definitions(-DRPI) add_definitions(-DRPI5ARM64) - add_definitions(-pipe -march=armv8.2-a+crc+crypto+fp16+rcpc+dotprod -mtune=cortex-a76) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8.2-a+crc+crypto+fp16+rcpc+dotprod -mtune=cortex-a76") + set(CFLAGS -pipe -march=armv8.2-a+crc+crypto+fp16+rcpc+dotprod -mtune=cortex-a76) elseif(RK3326) add_definitions(-DRK3326) - add_definitions(-pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a35+crypto) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a35+crypto") + set(CFLAGS -pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a35+crypto) elseif(RK3399) add_definitions(-DRK3399) - add_definitions(-pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a72.cortex-a53+crypto) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a72.cortex-a53+crypto") + set(CFLAGS -pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a72.cortex-a53+crypto) elseif(RK3588) add_definitions(-DRK3588) - add_definitions(-pipe -mcpu=cortex-a76.cortex-a55+crypto) add_definitions(-DBAD_SIGNAL) - set(CMAKE_ASM_FLAGS "-pipe -mcpu=cortex-a76.cortex-a55+crypto") + set(CFLAGS -pipe -mcpu=cortex-a76.cortex-a55+crypto) elseif(ODROIDN2) add_definitions(-DODROIDN2) - add_definitions(-march=armv8-a+crc+simd+crypto -mcpu=cortex-a73.cortex-a53+crypto) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a73.cortex-a53+crypto") + set(CFLAGS -march=armv8-a+crc+simd+crypto -mcpu=cortex-a73.cortex-a53+crypto) elseif(TEGRAX1) add_definitions(-DTEGRAX1) - add_definitions(-pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a57+crypto) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a57+crypto") + set(CFLAGS -pipe -march=armv8-a+crc+simd+crypto -mcpu=cortex-a57+crypto) elseif(TEGRA_T194) add_definitions(-DTEGRA_T194) - add_definitions(-pipe -march=armv8.2-a+fp16+simd+crypto+predres -mcpu=cortex-a76+crypto -mtune=cortex-a76) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8.2-a+fp16+simd+crypto+predres -mcpu=cortex-a76+crypto -mtune=cortex-a76") + set(CFLAGS -pipe -march=armv8.2-a+fp16+simd+crypto+predres -mcpu=cortex-a76+crypto -mtune=cortex-a76) elseif(TEGRA_T234) add_definitions(-DTEGRA_T234) - add_definitions(-pipe -march=armv8.2-a+fp16+simd+crypto+predres -mcpu=cortex-a78ae+crypto -mtune=cortex-a78ae) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8.2-a+fp16+simd+crypto+predres -mcpu=cortex-a78ae+crypto -mtune=cortex-a78ae") + set(CFLAGS -pipe -march=armv8.2-a+fp16+simd+crypto+predres -mcpu=cortex-a78ae+crypto -mtune=cortex-a78ae) +elseif(NVIDIA_GB10) + add_definitions(-DNVIDIA_GB10) + set(CFLAGS -pipe -mcpu=gb10 -mtune=gb10) elseif(PHYTIUM) add_definitions(-DPHYTIUM) - add_definitions(-pipe -march=armv8.1-a+crc+simd+crypto) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8.1-a+crc+simd+crypto+aes") + set(CFLAGS -pipe -march=armv8.1-a+crc+simd+crypto) elseif(SD845) add_definitions(-DSD845) - add_definitions(-pipe -march=armv8.2-a+simd+crypto -mtune=cortex-a75.cortex-a55) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8.2-a+simd+crypto -mtune=cortex-a75.cortex-a55") + set(CFLAGS -pipe -march=armv8.2-a+simd+crypto -mtune=cortex-a75.cortex-a55) +elseif(SD865) + add_definitions(-DSD865) + #note that cortex-a77.cortex-a55 is not supported, so fall back to a76 instead + set(CFLAGS -pipe -march=armv8.2-a+simd+crypto -mtune=cortex-a76.cortex-a55) elseif(SD888) add_definitions(-DSD888) - add_definitions(-pipe -march=armv8.4-a+simd+crypto) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8.4-a+simd+crypto") + set(CFLAGS -pipe -march=armv8.4-a+simd+crypto) elseif(SD8G2) add_definitions(-DSD8G2) - add_definitions(-pipe -march=armv9-a+i8mm+sm4+sha3+rcpc+crypto+nosve+nosve2) - set(CMAKE_ASM_FLAGS "-pipe -march=armv9-a+i8mm+sm4+sha3+rcpc+crypto+nosve+nosve2") + set(CFLAGS -pipe -march=armv9-a+i8mm+sm4+sha3+rcpc+crypto+nosve+nosve2) +elseif(SDORYON1) + add_definitions(-DSDORYON1) + # NOTE + # + # 1. + # GCC 14 and Clang 19 support oryon-1 as a -mcpu/-mtune argument, + # however it seems like fedora (the system I tested this on) does not work. + # see https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/AArch64-Options.html if you're interested + # + # 2. + # gcc/gcc/config/aarch64/aarch64-cores.def:157 defines oryon1 as + # AARCH64_CORE("oryon-1", oryon1, cortexa57, V8_6A, (CRYPTO, SM4, SHA3, F16), cortexa72, 0x51, 0x001, -1) + # where + # * the 3rd positional argument is represented as the "scheduler" + # * the 6th positional argument is represented as the "cost" + # I've chosen the a57 because I don't know if I should choose the a72 + set(CFLAGS -pipe -march=armv8.6-a+crypto+sm4+sha3+fp16 -mtune=cortex-a57) elseif(ADLINK) add_definitions(-DADLINK) - add_definitions(-pipe -mcpu=neoverse-n1 -fuse-ld=gold -fuse-linker-plugin) - set(CMAKE_ASM_FLAGS "-pipe -mcpu=neoverse-n1") + set(CFLAGS -pipe -mcpu=neoverse-n1 -fuse-ld=gold -fuse-linker-plugin) elseif(M1) add_definitions(-DM1) - add_definitions(-pipe -march=armv8.5-a+simd+crypto) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8.5-a+simd+crypto") + set(CFLAGS -pipe -march=armv8.5-a+simd+crypto) elseif(LARCH64) add_definitions(-DLA64) - add_definitions(-pipe -march=loongarch64) - set(CMAKE_ASM_FLAGS "-pipe -march=loongarch64") + add_definitions(-DBAD_PKILL) + set(CFLAGS -pipe -march=loongarch64) + set(ASMFLAGS -pipe -march=loongarch64) elseif(RV64) add_definitions(-DRV64) - add_definitions(-pipe -march=rv64gc) - set(CMAKE_ASM_FLAGS "-pipe -march=rv64gc") + set(CFLAGS -pipe -march=rv64gc) + set(ASMFLAGS -pipe -march=rv64gc) elseif(PPC64LE) add_definitions(-DPPC64LE) elseif(LX2160A) add_definitions(-DLX2160A) - add_definitions(-pipe -march=armv8-a+crypto+crc -mcpu=cortex-a72+crypto) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+crypto+crc -mcpu=cortex-a72+crypto") + set(CFLAGS -pipe -march=armv8-a+crypto+crc -mcpu=cortex-a72+crypto) elseif(SW64) add_definitions(-DSW64) elseif(ARM64) #add_definitions(-pipe -march=native) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+simd") -elseif(ARM_DYNAREC) - set(CMAKE_ASM_FLAGS "-pipe -march=armv8-a+crc+simd+crypto") +endif() +if(ARM_DYNAREC) + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "9.0") + set(ASMFLAGS -pipe -march=armv8.2-a+crc+simd+crypto) + else() + #putting a random cpu that have 8.2 architecture so assembly can be build. the use of the feature are conditionnal anyway + set(ASMFLAGS -pipe -mcpu=cortex-a76) + endif() endif() if(ANDROID) add_definitions(-DANDROID) @@ -217,9 +261,15 @@ endif() if(TERMUX) add_definitions(-DTERMUX) endif() +if(WINLATOR_GLIBC) + add_definitions(-DWINLATOR_GLIBC) +endif() if(BAD_SIGNAL) add_definitions(-DBAD_SIGNAL) endif() +if(BAD_PKILL) + add_definitions(-DBAD_PKILL) +endif() if(SAVE_MEM) add_definitions(-DSAVE_MEM) endif() @@ -228,13 +278,20 @@ if(STATICBUILD) add_definitions(-DSTATICBUILD) add_definitions(-Wno-deprecated-declarations) #by-design, deprecated function can be used set(BUILD_SHARED_LIBS OFF) - set(CMAKE_EXE_LINKER_FLAGS "-static") + set(CMAKE_EXE_LINKER_FLAGS -static) set(HAVE_TRACE OFF) endif() +if(BOX32) + add_definitions(-DBOX32) + add_definitions(-Wno-address-of-packed-member) #32bits might generated unaligned pointers +endif() if(NOGIT) add_definitions(-DNOGIT) endif() +if(CI) + add_definitions(-Wno-pointer-type-mismatch) +endif() if(HAVE_TRACE) set(BOX64 box64) @@ -257,6 +314,10 @@ if(HAVE_TRACE) add_definitions(-DHAVE_TRACE) endif() +if(ZYDIS3) + add_definitions(-DZYDIS3) +endif() + if(ARM_DYNAREC) add_definitions(-DDYNAREC) add_definitions(-DARM64) @@ -298,6 +359,11 @@ include_directories( "${BOX64_ROOT}/src" "${BOX64_ROOT}/src/wrapped/generated" ) +if(BOX32) + include_directories( + "${BOX64_ROOT}/src/wrapped32/generated" + ) +endif() # git_head.h is a generated file set_source_files_properties( @@ -305,8 +371,23 @@ set_source_files_properties( PROPERTIES GENERATED TRUE HEADER_FILE_ONLY TRUE) +set(OS_LINUX_SRC + "${BOX64_ROOT}/src/os/backtrace.c" + "${BOX64_ROOT}/src/os/emit_signals_linux.c" + "${BOX64_ROOT}/src/os/hostext_common.c" + "${BOX64_ROOT}/src/os/hostext_linux.c" + "${BOX64_ROOT}/src/os/freq_linux.c" + "${BOX64_ROOT}/src/os/os_linux.c" + "${BOX64_ROOT}/src/os/perfmap.c" + "${BOX64_ROOT}/src/os/symbolfuncs_linux.c" + "${BOX64_ROOT}/src/os/random_linux.c" + "${BOX64_ROOT}/src/os/my_cpuid.c" + "${BOX64_ROOT}/src/os/sysinfo.c" +) + set(ELFLOADER_SRC "${BOX64_ROOT}/src/main.c" + "${BOX64_ROOT}/src/test.c" "${BOX64_ROOT}/src/core.c" "${BOX64_ROOT}/src/box64context.c" "${BOX64_ROOT}/src/build_info.c" @@ -314,19 +395,21 @@ set(ELFLOADER_SRC "${BOX64_ROOT}/src/custommmap.c" "${BOX64_ROOT}/src/dynarec/dynarec.c" "${BOX64_ROOT}/src/elfs/elfloader.c" + "${BOX64_ROOT}/src/elfs/elfhacks.c" "${BOX64_ROOT}/src/elfs/elfparser.c" "${BOX64_ROOT}/src/elfs/elfhash.c" "${BOX64_ROOT}/src/elfs/elfload_dump.c" "${BOX64_ROOT}/src/elfs/elfdwarf_private.c" + "${BOX64_ROOT}/src/emu/entrypoint.c" "${BOX64_ROOT}/src/emu/x64compstrings.c" "${BOX64_ROOT}/src/emu/x64emu.c" + "${BOX64_ROOT}/src/emu/x64printer.c" "${BOX64_ROOT}/src/emu/x64int3.c" "${BOX64_ROOT}/src/emu/x87emu_private.c" "${BOX64_ROOT}/src/emu/x64primop.c" "${BOX64_ROOT}/src/emu/x64run_private.c" "${BOX64_ROOT}/src/emu/x64shaext.c" "${BOX64_ROOT}/src/emu/x64syscall.c" - "${BOX64_ROOT}/src/emu/x86syscall.c" "${BOX64_ROOT}/src/emu/x64tls.c" "${BOX64_ROOT}/src/emu/x64trace.c" "${BOX64_ROOT}/src/librarian/librarian.c" @@ -336,17 +419,21 @@ set(ELFLOADER_SRC "${BOX64_ROOT}/src/libtools/auxval.c" "${BOX64_ROOT}/src/libtools/myalign.c" "${BOX64_ROOT}/src/libtools/signals.c" + "${BOX64_ROOT}/src/libtools/decopcode.c" "${BOX64_ROOT}/src/libtools/threads.c" "${BOX64_ROOT}/src/tools/bitutils.c" "${BOX64_ROOT}/src/tools/box64stack.c" "${BOX64_ROOT}/src/tools/bridge.c" + "${BOX64_ROOT}/src/tools/alternate.c" "${BOX64_ROOT}/src/tools/callback.c" - "${BOX64_ROOT}/src/tools/my_cpuid.c" + "${BOX64_ROOT}/src/tools/cleanup.c" + "${BOX64_ROOT}/src/tools/gdbjit.c" "${BOX64_ROOT}/src/tools/fileutils.c" "${BOX64_ROOT}/src/tools/pathcoll.c" "${BOX64_ROOT}/src/tools/rbtree.c" - "${BOX64_ROOT}/src/tools/rcfile.c" + "${BOX64_ROOT}/src/tools/env.c" "${BOX64_ROOT}/src/tools/wine_tools.c" + "${BOX64_ROOT}/src/tools/pe_tools.c" "${BOX64_ROOT}/src/wrapped/generated/wrapper.c" ) if(NOT STATICBUILD) @@ -359,31 +446,59 @@ if(NOT STATICBUILD) "${BOX64_ROOT}/src/librarian/globalsymbols.c" ) endif() +if(BOX32) + list(APPEND ELFLOADER_SRC + "${BOX64_ROOT}/src/box32.c" + "${BOX64_ROOT}/src/elfs/elfhash32.c" + "${BOX64_ROOT}/src/elfs/elfloader32.c" + "${BOX64_ROOT}/src/elfs/elfparser32.c" + "${BOX64_ROOT}/src/elfs/elfload_dump32.c" + "${BOX64_ROOT}/src/tools/box32stack.c" + "${BOX64_ROOT}/src/emu/x86int3.c" + "${BOX64_ROOT}/src/librarian/globalsymbols32.c" + "${BOX64_ROOT}/src/libtools/box32_inputevent.c" + "${BOX64_ROOT}/src/libtools/myalign32.c" + "${BOX64_ROOT}/src/libtools/myalign64_32.c" + "${BOX64_ROOT}/src/libtools/myalignxcb32.c" + "${BOX64_ROOT}/src/libtools/signal32.c" + "${BOX64_ROOT}/src/libtools/threads32.c" + "${BOX64_ROOT}/src/libtools/libc_net32.c" + "${BOX64_ROOT}/src/libtools/sdl1align32.c" + "${BOX64_ROOT}/src/libtools/sdl2align32.c" + "${BOX64_ROOT}/src/libtools/my_x11_conv.c" + "${BOX64_ROOT}/src/libtools/my_x11_xevent.c" + "${BOX64_ROOT}/src/emu/x86syscall_32.c" + "${BOX64_ROOT}/src/wrapped32/generated/wrapper32.c" + "${BOX64_ROOT}/src/wrapped32/generated/converter32.c" + ) +else() + list(APPEND ELFLOADER_SRC + "${BOX64_ROOT}/src/emu/x86syscall.c" + ) +endif() if(NOT ANDROID) list(APPEND ELFLOADER_SRC "${BOX64_ROOT}/src/libtools/obstack.c" ) endif() +if(NOT STATICBUILD AND NOT ANDROID) + list(APPEND ELFLOADER_SRC + "${BOX64_ROOT}/src/libtools/libdl.c" + "${BOX64_ROOT}/src/libtools/vulkanoverlay.c" + ) +endif() + set(INTERPRETER "${BOX64_ROOT}/src/emu/x64run.c" "${BOX64_ROOT}/src/emu/x64run0f.c" - "${BOX64_ROOT}/src/emu/x64run64.c" "${BOX64_ROOT}/src/emu/x64run66.c" "${BOX64_ROOT}/src/emu/x64run660f.c" "${BOX64_ROOT}/src/emu/x64run66f20f.c" "${BOX64_ROOT}/src/emu/x64run66f30f.c" - "${BOX64_ROOT}/src/emu/x64run6664.c" "${BOX64_ROOT}/src/emu/x64run66d9.c" "${BOX64_ROOT}/src/emu/x64run66dd.c" "${BOX64_ROOT}/src/emu/x64run66f0.c" - "${BOX64_ROOT}/src/emu/x64run67.c" - "${BOX64_ROOT}/src/emu/x64run67avx.c" - "${BOX64_ROOT}/src/emu/x64run67_32.c" - "${BOX64_ROOT}/src/emu/x64run6764_32.c" - "${BOX64_ROOT}/src/emu/x64run670f.c" - "${BOX64_ROOT}/src/emu/x64run6766.c" - "${BOX64_ROOT}/src/emu/x64run67660f.c" "${BOX64_ROOT}/src/emu/x64rund8.c" "${BOX64_ROOT}/src/emu/x64rund9.c" "${BOX64_ROOT}/src/emu/x64runda.c" @@ -412,7 +527,7 @@ set(INTERPRETER if(STATICBUILD) set(WRAPPEDS "${BOX64_ROOT}/src/wrapped/wrappedldlinux.c" - "${BOX64_ROOT}/src/wrapped/wrappedlibbsd.c" + #"${BOX64_ROOT}/src/wrapped/wrappedlibbsd.c" "${BOX64_ROOT}/src/wrapped/wrappedlibc.c" "${BOX64_ROOT}/src/wrapped/wrappedlibcmusl.c" "${BOX64_ROOT}/src/wrapped/wrappedlibdl.c" @@ -431,8 +546,11 @@ set(WRAPPEDS "${BOX64_ROOT}/src/wrapped/wrappedatomic.c" "${BOX64_ROOT}/src/wrapped/wrappedatspi.c" "${BOX64_ROOT}/src/wrapped/wrappedayatanaappindicator3.c" + "${BOX64_ROOT}/src/wrapped/wrappedavahiclient.c" + "${BOX64_ROOT}/src/wrapped/wrappedavahicommon.c" "${BOX64_ROOT}/src/wrapped/wrappedbz2.c" "${BOX64_ROOT}/src/wrapped/wrappedcap.c" + "${BOX64_ROOT}/src/wrapped/wrappedcuda.c" "${BOX64_ROOT}/src/wrapped/wrappedcairo.c" "${BOX64_ROOT}/src/wrapped/wrappedcairogobject.c" "${BOX64_ROOT}/src/wrapped/wrappedcrashhandler.c" @@ -486,17 +604,24 @@ set(WRAPPEDS "${BOX64_ROOT}/src/wrapped/wrappedgthread2.c" "${BOX64_ROOT}/src/wrapped/wrappedgtk3.c" "${BOX64_ROOT}/src/wrapped/wrappedgtkx112.c" + "${BOX64_ROOT}/src/wrapped/wrappedharfbuzzsubset.c" "${BOX64_ROOT}/src/wrapped/wrappedkrb5.c" "${BOX64_ROOT}/src/wrapped/wrappedlcms2.c" "${BOX64_ROOT}/src/wrapped/wrappedldlinux.c" "${BOX64_ROOT}/src/wrapped/wrappedlibasound.c" + "${BOX64_ROOT}/src/wrapped/wrappedlibavcodec58.c" + "${BOX64_ROOT}/src/wrapped/wrappedlibavformat58.c" + "${BOX64_ROOT}/src/wrapped/wrappedlibavutil56.c" + "${BOX64_ROOT}/src/wrapped/wrappedlibblas.c" "${BOX64_ROOT}/src/wrapped/wrappedlibbsd.c" "${BOX64_ROOT}/src/wrapped/wrappedlibc.c" "${BOX64_ROOT}/src/wrapped/wrappedlibcmusl.c" "${BOX64_ROOT}/src/wrapped/wrappedlibcrypt.c" "${BOX64_ROOT}/src/wrapped/wrappedlibcups.c" + "${BOX64_ROOT}/src/wrapped/wrappedlibcupsimage.c" "${BOX64_ROOT}/src/wrapped/wrappedlibdl.c" "${BOX64_ROOT}/src/wrapped/wrappedlibdrm.c" + "${BOX64_ROOT}/src/wrapped/wrappedlibdrmamdgpu.c" "${BOX64_ROOT}/src/wrapped/wrappedlibegl.c" "${BOX64_ROOT}/src/wrapped/wrappedlibform.c" "${BOX64_ROOT}/src/wrapped/wrappedlibformw.c" @@ -505,9 +630,12 @@ set(WRAPPEDS "${BOX64_ROOT}/src/wrapped/wrappedlibgl.c" "${BOX64_ROOT}/src/wrapped/wrappedlibglu.c" "${BOX64_ROOT}/src/wrapped/wrappedlibglx.c" + "${BOX64_ROOT}/src/wrapped/wrappedlibglxnvidia.c" + "${BOX64_ROOT}/src/wrapped/wrappedlibgpgme.c" "${BOX64_ROOT}/src/wrapped/wrappedlibharfbuzz.c" "${BOX64_ROOT}/src/wrapped/wrappedlibibus.c" "${BOX64_ROOT}/src/wrapped/wrappedlibice.c" + "${BOX64_ROOT}/src/wrapped/wrappedliblapack.c" "${BOX64_ROOT}/src/wrapped/wrappedlibm.c" "${BOX64_ROOT}/src/wrapped/wrappedlibncurses.c" "${BOX64_ROOT}/src/wrapped/wrappedlibncurses6.c" @@ -518,6 +646,7 @@ set(WRAPPEDS "${BOX64_ROOT}/src/wrapped/wrappedlibpanel.c" "${BOX64_ROOT}/src/wrapped/wrappedlibpci.c" "${BOX64_ROOT}/src/wrapped/wrappedlibpcre.c" + "${BOX64_ROOT}/src/wrapped/wrappedlibpcre216.c" "${BOX64_ROOT}/src/wrapped/wrappedlibpthread.c" "${BOX64_ROOT}/src/wrapped/wrappedlibresolv.c" "${BOX64_ROOT}/src/wrapped/wrappedlibrt.c" @@ -538,6 +667,7 @@ set(WRAPPEDS "${BOX64_ROOT}/src/wrapped/wrappedlibx11.c" "${BOX64_ROOT}/src/wrapped/wrappedlibx11xcb.c" "${BOX64_ROOT}/src/wrapped/wrappedlibxau.c" + "${BOX64_ROOT}/src/wrapped/wrappedlibxaw.c" "${BOX64_ROOT}/src/wrapped/wrappedlibxcb.c" "${BOX64_ROOT}/src/wrapped/wrappedlibxcbcursor.c" "${BOX64_ROOT}/src/wrapped/wrappedlibxcbdri2.c" @@ -550,6 +680,7 @@ set(WRAPPEDS "${BOX64_ROOT}/src/wrapped/wrappedlibxcbrandr.c" "${BOX64_ROOT}/src/wrapped/wrappedlibxcbrender.c" "${BOX64_ROOT}/src/wrapped/wrappedlibxcbrenderutil.c" + "${BOX64_ROOT}/src/wrapped/wrappedlibxcbres.c" "${BOX64_ROOT}/src/wrapped/wrappedlibxcbshape.c" "${BOX64_ROOT}/src/wrapped/wrappedlibxcbshm.c" "${BOX64_ROOT}/src/wrapped/wrappedlibxcbsync.c" @@ -584,12 +715,14 @@ set(WRAPPEDS "${BOX64_ROOT}/src/wrapped/wrappednspr4.c" "${BOX64_ROOT}/src/wrapped/wrappednss3.c" "${BOX64_ROOT}/src/wrapped/wrappednssutil3.c" + "${BOX64_ROOT}/src/wrapped/wrappednvml.c" "${BOX64_ROOT}/src/wrapped/wrappedopenal.c" "${BOX64_ROOT}/src/wrapped/wrappedopencl.c" "${BOX64_ROOT}/src/wrapped/wrappedpango.c" "${BOX64_ROOT}/src/wrapped/wrappedpangocairo.c" "${BOX64_ROOT}/src/wrapped/wrappedpangoft2.c" "${BOX64_ROOT}/src/wrapped/wrappedpam.c" + "${BOX64_ROOT}/src/wrapped/wrappedpcap.c" "${BOX64_ROOT}/src/wrapped/wrappedplc4.c" "${BOX64_ROOT}/src/wrapped/wrappedplds4.c" "${BOX64_ROOT}/src/wrapped/wrappedpng16.c" @@ -649,6 +782,10 @@ set(WRAPPEDS "${BOX64_ROOT}/src/wrapped/wrappedicui18n73.c" "${BOX64_ROOT}/src/wrapped/wrappedicuuc74.c" "${BOX64_ROOT}/src/wrapped/wrappedicui18n74.c" + "${BOX64_ROOT}/src/wrapped/wrappedicuuc75.c" + "${BOX64_ROOT}/src/wrapped/wrappedicui18n75.c" + "${BOX64_ROOT}/src/wrapped/wrappedicuuc76.c" + "${BOX64_ROOT}/src/wrapped/wrappedicui18n76.c" "${BOX64_ROOT}/src/wrapped/wrappedidn2.c" "${BOX64_ROOT}/src/wrapped/wrappedanl.c" "${BOX64_ROOT}/src/wrapped/wrappedpsl5.c" @@ -659,6 +796,9 @@ set(WRAPPEDS "${BOX64_ROOT}/src/wrapped/wrappedlibunistring2.c" "${BOX64_ROOT}/src/wrapped/wrappedlibhogweed6.c" "${BOX64_ROOT}/src/wrapped/wrappedlibsqlite3.c" + "${BOX64_ROOT}/src/wrapped/wrappedlibtiff5.c" + "${BOX64_ROOT}/src/wrapped/wrappedbrotlidec.c" + "${BOX64_ROOT}/src/wrapped/wrappedzstd.c" ) endif() if(ANDROID) @@ -692,7 +832,7 @@ if(NOT CI) OUTPUT "${BOX64_ROOT}/src/wrapped/generated/functions_list.txt" COMMAND "${PYTHON_EXECUTABLE}" "${BOX64_ROOT}/rebuild_wrappers.py" "${BOX64_ROOT}" - "PANDORA" "HAVE_LD80BITS" "NOALIGN" "HAVE_TRACE" "ANDROID" "TERMUX" "STATICBUILD" "--" + "PANDORA" "HAVE_LD80BITS" "NOALIGN" "HAVE_TRACE" "ANDROID" "TERMUX" "STATICBUILD" "LA64" "--" ${WRAPPEDS_HEAD} MAIN_DEPENDENCY "${BOX64_ROOT}/rebuild_wrappers.py" DEPENDS ${WRAPPEDS} ${WRAPPEDS_HEAD} @@ -711,11 +851,108 @@ endif () add_custom_target(WRAPPERS DEPENDS "${BOX64_ROOT}/src/wrapped/generated/functions_list.txt") #add_custom_target(PRINTER DEPENDS "${BOX64_ROOT}/src/dynarec/last_run.txt") +if(BOX32) + if(STATICBUILD) + set(WRAPPEDS32 + "${BOX64_ROOT}/src/wrapped32/wrappedldlinux.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibc.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibdl.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibm.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibpthread.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibrt.c" + ) + else() + set(WRAPPEDS32 + "${BOX64_ROOT}/src/wrapped32/wrappedldlinux.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibc.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibdl.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibm.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibpthread.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibrt.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibresolv.c" + "${BOX64_ROOT}/src/wrapped32/wrappedcrashhandler.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibgl.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibglu.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibglxnvidia.c" + "${BOX64_ROOT}/src/wrapped32/wrappedsdl1.c" + "${BOX64_ROOT}/src/wrapped32/wrappedsdl2.c" + "${BOX64_ROOT}/src/wrapped32/wrappedsdl2image.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibasound.c" + "${BOX64_ROOT}/src/wrapped32/wrappedopenal.c" + "${BOX64_ROOT}/src/wrapped32/wrappedfreetype.c" + "${BOX64_ROOT}/src/wrapped32/wrappedfontconfig.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibx11.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibxdamage.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibxext.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibxfixes.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibxrender.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibxi.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibxcomposite.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibxcursor.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibxrandr.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibxss.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibxxf86vm.c" + "${BOX64_ROOT}/src/wrapped32/wrappedxinerama.c" + "${BOX64_ROOT}/src/wrapped32/wrappedexpat.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibx11xcb.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibxcb.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibxcbres.c" + "${BOX64_ROOT}/src/wrapped32/wrappedudev0.c" + "${BOX64_ROOT}/src/wrapped32/wrappedudev1.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibuuid.c" + "${BOX64_ROOT}/src/wrapped32/wrappedgnutls.c" + "${BOX64_ROOT}/src/wrapped32/wrappedtcmallocminimal.c" + "${BOX64_ROOT}/src/wrapped32/wrappedcairo.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibdrm.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibvdpau.c" + "${BOX64_ROOT}/src/wrapped32/wrappednsl.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibcups.c" + "${BOX64_ROOT}/src/wrapped32/wrappedgbm.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibegl.c" + "${BOX64_ROOT}/src/wrapped32/wrappedlibglx.c" + "${BOX64_ROOT}/src/wrapped32/wrappedselinux.c" + "${BOX64_ROOT}/src/wrapped32/wrappedblkid.c" + "${BOX64_ROOT}/src/wrapped32/wrappedmount.c" + "${BOX64_ROOT}/src/wrapped32/wrappeddbus.c" + "${BOX64_ROOT}/src/wrapped32/wrappedcurl.c" + ) + endif() + string(REPLACE ".c" "_private.h" MODROOT ${BOX64_ROOT}) + #set(WRAPPEDS32_HEAD "${BOX64_ROOT}/src/wrapped/wrappedd3dadapter9_genvate.h") + foreach(A ${WRAPPEDS32}) + string(REPLACE ".c" "_private.h" C ${A}) + string(REPLACE "${MODROOT}" "${BOX64_ROOT}" B ${C}) + set(WRAPPEDS32_HEAD ${WRAPPEDS32_HEAD} ${B}) + set_source_files_properties(${A} PROPERTIES OBJECT_DEPENDS ${B}) + endforeach() + + set(WRAPPER32 "${BOX64_ROOT}/src/wrapped32/generated/wrapper32.c" "${BOX64_ROOT}/src/wrapped32/generated/wrapper32.h") + + if(NOT CI) + add_custom_command( + OUTPUT "${BOX64_ROOT}/src/wrapped32/generated/functions_list.txt" + COMMAND "${PYTHON_EXECUTABLE}" "${BOX64_ROOT}/rebuild_wrappers_32.py" + "${BOX64_ROOT}" + "PANDORA" "HAVE_LD80BITS" "NOALIGN" "HAVE_TRACE" "ANDROID" "TERMUX" "WINLATOR_GLIBC" "STATICBUILD" "--" + ${WRAPPEDS32_HEAD} + MAIN_DEPENDENCY "${BOX64_ROOT}/rebuild_wrappers_32.py" + DEPENDS ${WRAPPEDS32} ${WRAPPEDS32_HEAD} + BYPRODUCTS ${WRAPPER32} + ) + endif() + + add_custom_target(WRAPPERS32 DEPENDS "${BOX64_ROOT}/src/wrapped32/generated/functions_list.txt") +else() + set(WRAPPEDS32) +endif() + + if(DYNAREC) set(DYNAREC_SRC "${BOX64_ROOT}/src/dynarec/dynablock.c" "${BOX64_ROOT}/src/dynarec/dynarec_native.c" "${BOX64_ROOT}/src/dynarec/dynarec_native_functions.c" + "${BOX64_ROOT}/src/dynarec/dynacache_reloc.c" "${BOX64_ROOT}/src/emu/x64test.c" ) endif() @@ -725,10 +962,15 @@ if(ARM_DYNAREC) ${DYNAREC_SRC} "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_functions.c" + "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_arch.c" "${BOX64_ROOT}/src/dynarec/arm64/arm64_immenc.c" "${BOX64_ROOT}/src/dynarec/arm64/arm64_printer.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_jmpnext.c" - + "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_consts.c" + "${BOX64_ROOT}/src/dynarec/arm64/updateflags_arm64.c" + ) + set(DYNAREC_ASM + ${DYNAREC_ASM} "${BOX64_ROOT}/src/dynarec/arm64/arm64_prolog.S" "${BOX64_ROOT}/src/dynarec/arm64/arm64_epilog.S" "${BOX64_ROOT}/src/dynarec/arm64/arm64_next.S" @@ -743,13 +985,7 @@ if(ARM_DYNAREC) "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_emit_shift.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_00.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_0f.c" - "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_64.c" - #"${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_65.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_66.c" - "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_67.c" - "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_67_32.c" - "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_67_avx.c" - "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_6764_32.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_d8.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_d9.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_da.c" @@ -762,7 +998,6 @@ if(ARM_DYNAREC) "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_660f.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_66f20f.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_66f30f.c" - "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_6664.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_66f0.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_f20f.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_f30f.c" @@ -776,6 +1011,9 @@ if(ARM_DYNAREC) "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_avx_66_0f3a.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_avx_f2_0f38.c" "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_avx_f2_0f3a.c" + "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_avx_f3_0f38.c" + + "${BOX64_ROOT}/src/dynarec/arm64/updateflags_arm64_pass.c" ) endif() @@ -784,10 +1022,13 @@ if(RV64_DYNAREC) ${DYNAREC_SRC} "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_functions.c" + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_arch.c" "${BOX64_ROOT}/src/dynarec/rv64/rv64_printer.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_jmpnext.c" - "${BOX64_ROOT}/src/rv64detect.c" - + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_consts.c" + ) + set(DYNAREC_ASM + ${DYNAREC_ASM} "${BOX64_ROOT}/src/dynarec/rv64/rv64_prolog.S" "${BOX64_ROOT}/src/dynarec/rv64/rv64_epilog.S" "${BOX64_ROOT}/src/dynarec/rv64/rv64_next.S" @@ -806,11 +1047,8 @@ if(RV64_DYNAREC) "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_00_2.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_00_3.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_0f.c" - "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_64.c" - #"${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_65.c" + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_0f_vector.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_66.c" - "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_67.c" - "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_67_32.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_d8.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_d9.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_da.c" @@ -821,13 +1059,22 @@ if(RV64_DYNAREC) "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_df.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_f0.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_660f.c" + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_660f38.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_660f_vector.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_66f20f.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_66f30f.c" - "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_6664.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_66f0.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_f20f.c" + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_f20f_vector.c" "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_f30f.c" + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_f30f_vector.c" + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_avx.c" + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_avx_0f.c" + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_avx_66_0f.c" + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_avx_66_0f38.c" + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_avx_66_0f3a.c" + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_avx_f2_0f.c" + "${BOX64_ROOT}/src/dynarec/rv64/dynarec_rv64_avx_f3_0f.c" ) endif() @@ -838,7 +1085,10 @@ if(LARCH64_DYNAREC) "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_functions.c" "${BOX64_ROOT}/src/dynarec/la64/la64_printer.c" "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_jmpnext.c" - + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_consts.c" + ) + set(DYNAREC_ASM + ${DYNAREC_ASM} "${BOX64_ROOT}/src/dynarec/la64/la64_prolog.S" "${BOX64_ROOT}/src/dynarec/la64/la64_epilog.S" "${BOX64_ROOT}/src/dynarec/la64/la64_next.S" @@ -853,40 +1103,79 @@ if(LARCH64_DYNAREC) "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_emit_logic.c" "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_00.c" "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_0f.c" - "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_64.c" "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_66.c" - "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_6664.c" - "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_67.c" - "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_f30f.c" "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_660f.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_66f0.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_66f20f.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_66f30f.c" "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_f0.c" "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_f20f.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_f30f.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_avx.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_avx_0f.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_avx_0f38.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_avx_66_0f.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_avx_66_0f38.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_avx_66_0f3a.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_avx_f2_0f.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_avx_f2_0f38.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_avx_f2_0f3a.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_avx_f3_0f.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_avx_f3_0f38.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_d8.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_d9.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_da.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_db.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_dc.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_dd.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_de.c" + "${BOX64_ROOT}/src/dynarec/la64/dynarec_la64_df.c" ) endif() + +if(GDBJIT) +set(GDBJITREADER "${BOX64_ROOT}/gdbjit/reader.c") +endif() + if(DYNAREC) set(DYNAREC_PASS "${BOX64_ROOT}/src/wrapped/generated/wrapper.h" ${DYNAREC_PASS} "${BOX64_ROOT}/src/dynarec/dynarec_native_pass.c" ) + if(BOX32) + list(APPEND DYNAREC_PASS + "${BOX64_ROOT}/src/wrapped32/generated/wrapper32.h" + ) + endif() - add_library(dynarec_native OBJECT ${DYNAREC_SRC}) + set_source_files_properties(${DYNAREC_PASS} PROPERTIES COMPILE_OPTIONS "${CFLAGS}") + set_source_files_properties(${DYNAREC_ASM} PROPERTIES COMPILE_OPTIONS "${ASMFLAGS}") + set_source_files_properties(${INTERPRETER} PROPERTIES COMPILE_OPTIONS "${CFLAGS}") + + add_library(dynarec_native OBJECT ${DYNAREC_SRC} ${DYNAREC_ASM}) add_library(native_pass0 OBJECT ${DYNAREC_PASS}) - set_target_properties(native_pass0 PROPERTIES COMPILE_FLAGS "-DSTEP=0") + set_target_properties(native_pass0 PROPERTIES COMPILE_DEFINITIONS "STEP=0") add_library(native_pass1 OBJECT ${DYNAREC_PASS}) - set_target_properties(native_pass1 PROPERTIES COMPILE_FLAGS "-DSTEP=1") + set_target_properties(native_pass1 PROPERTIES COMPILE_DEFINITIONS "STEP=1") add_library(native_pass2 OBJECT ${DYNAREC_PASS}) - set_target_properties(native_pass2 PROPERTIES COMPILE_FLAGS "-DSTEP=2") + set_target_properties(native_pass2 PROPERTIES COMPILE_DEFINITIONS "STEP=2") add_library(native_pass3 OBJECT ${DYNAREC_PASS}) - set_target_properties(native_pass3 PROPERTIES COMPILE_FLAGS "-DSTEP=3") + set_target_properties(native_pass3 PROPERTIES COMPILE_DEFINITIONS "STEP=3") add_library(test_interpreter OBJECT ${INTERPRETER}) - set_target_properties(test_interpreter PROPERTIES COMPILE_FLAGS "-DTEST_INTERPRETER") + set_target_properties(test_interpreter PROPERTIES COMPILE_DEFINITIONS "TEST_INTERPRETER") add_dependencies(native_pass0 WRAPPERS) add_dependencies(native_pass1 WRAPPERS) add_dependencies(native_pass2 WRAPPERS) add_dependencies(native_pass3 WRAPPERS) + if(BOX32) + add_dependencies(native_pass0 WRAPPERS32) + add_dependencies(native_pass1 WRAPPERS32) + add_dependencies(native_pass2 WRAPPERS32) + add_dependencies(native_pass3 WRAPPERS32) + endif() add_library(dynarec STATIC $ @@ -896,33 +1185,52 @@ if(DYNAREC) $ $ ) + + if(GDBJIT) + add_library(box64gdbjitreader SHARED ${GDBJITREADER}) + endif() endif() +set_source_files_properties(${OS_LINUX_SRC} ${ELFLOADER_SRC} ${INTERPRETER} ${WRAPPEDS} ${WRAPPEDS32} PROPERTIES COMPILE_OPTIONS "${CFLAGS}") + # creates git_head.h if(DYNAREC) add_custom_command( OUTPUT "${BOX64_ROOT}/src/git_head.h" COMMAND sh -c "echo \\\#define GITREV \\\"$(git rev-parse --short HEAD)\\\">\"${BOX64_ROOT}/src/git_head.h\"" - DEPENDS dynarec ${ELFLOADER_SRC} ${INTERPRETER} ${WRAPPEDS} + DEPENDS ${DYNAREC_SRC} ${DYNAREC_ASM} ${DYNAREC_PASS} ${ELFLOADER_SRC} ${INTERPRETER} ${WRAPPEDS} ${WRAPPEDS32} ${WRAPPEDS_HEAD} ${WRAPPEDS32_HEAD} VERBATIM) else() add_custom_command( OUTPUT "${BOX64_ROOT}/src/git_head.h" COMMAND sh -c "echo \\\#define GITREV \\\"$(git rev-parse --short HEAD)\\\">\"${BOX64_ROOT}/src/git_head.h\"" - DEPENDS ${ELFLOADER_SRC} ${INTERPRETER} ${WRAPPEDS} + DEPENDS ${ELFLOADER_SRC} ${INTERPRETER} ${WRAPPEDS} ${WRAPPEDS32} ${WRAPPEDS_HEAD} ${WRAPPEDS32_HEAD} VERBATIM) endif() +add_custom_target(generate_git_head_target + DEPENDS "${BOX64_ROOT}/src/git_head.h" +) +add_custom_target(functions_list DEPENDS "${BOX64_ROOT}/src/wrapped/generated/functions_list.txt" "${BOX64_ROOT}/src/wrapped32/generated/functions_list.txt") +add_dependencies(generate_git_head_target functions_list) + add_library(interpreter OBJECT ${INTERPRETER}) -add_executable(${BOX64} ${ELFLOADER_SRC} ${WRAPPEDS} "${BOX64_ROOT}/src/git_head.h") +add_library(mainobj OBJECT ${OS_LINUX_SRC} ${ELFLOADER_SRC} ${WRAPPEDS} ${WRAPPEDS32}) +add_dependencies(mainobj generate_git_head_target) + +add_executable(${BOX64}) +target_link_libraries(${BOX64} mainobj) set_target_properties(${BOX64} PROPERTIES ENABLE_EXPORTS ON) add_dependencies(${BOX64} WRAPPERS) +if(BOX32) + add_dependencies(${BOX64} WRAPPERS32) +endif() #add_dependencies(${BOX64} PRINTER) #target_link_libraries(${BOX64} c m dl rt pthread resolv) if(STATICBUILD) #set_target_properties(${BOX64} PROPERTIES LINK_FLAGS "-fuse-ld=gold -static -Wl,--no-relax -Wl,--allow-multiple-definition -ldl -lrt -lpthread -lresolv -lc -lutil -lm -Wl,-defsym,_DYNAMIC=0 -pthread") - target_link_libraries(${BOX64} c m dl pthread resolv util bsd c) + target_link_libraries(${BOX64} c m dl pthread resolv util c) else() if(ANDROID) if(TERMUX) @@ -931,7 +1239,8 @@ else() target_link_libraries(${BOX64} c m dl) endif() else() - set_target_properties(${BOX64} PROPERTIES LINK_FLAGS "-Wl,--no-as-needed -lc -lm -ldl -lrt -lpthread -lresolv -lutil -Wl,--as-needed -pthread") + set_property(TARGET ${BOX64} APPEND_STRING PROPERTY LINK_FLAGS "-Wl,--no-as-needed -lc -lm -ldl -lrt -lpthread -lresolv -lutil -Wl,--as-needed -pthread ") + target_link_libraries(${BOX64} c m dl pthread resolv util c) endif() endif() if(DYNAREC) @@ -942,15 +1251,18 @@ target_link_libraries(${BOX64} interpreter) if(${CMAKE_VERSION} VERSION_LESS "3.13") if(NOT NOLOADADDR) if(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR WITH_MOLD) - set_target_properties(${BOX64} PROPERTIES LINK_FLAGS "-Wl,--image-base=${BOX64_ELF_ADDRESS}") + set_property(TARGET ${BOX64} APPEND_STRING PROPERTY LINK_FLAGS "-no-pie -Wl,--image-base=${BOX64_ELF_ADDRESS} ") else() - set_target_properties(${BOX64} PROPERTIES LINK_FLAGS "-Wl,-Ttext-segment,${BOX64_ELF_ADDRESS}") + set_property(TARGET ${BOX64} APPEND_STRING PROPERTY LINK_FLAGS "-Wl,-Ttext-segment,${BOX64_ELF_ADDRESS} ") endif() endif() else() # If symbols are missing, try this: target_link_options(${BOX64} PUBLIC -rdynamic) if(NOT NOLOADADDR) if(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR WITH_MOLD) + if(WITH_MOLD) # --image-base requires -no-pie in mold! + set_property(TARGET ${BOX64} APPEND_STRING PROPERTY LINK_FLAGS "-no-pie -lm ") + endif() target_link_options(${BOX64} PUBLIC LINKER:--image-base=${BOX64_ELF_ADDRESS}) else() target_link_options(${BOX64} PUBLIC LINKER:-Ttext-segment,${BOX64_ELF_ADDRESS}) @@ -969,42 +1281,57 @@ endif() if(NOT _x86 AND NOT _x86_64) if(NOT TERMUX) - install(TARGETS ${BOX64} - RUNTIME DESTINATION bin) + install(TARGETS ${BOX64} RUNTIME DESTINATION bin) + if(NOT NO_LIB_INSTALL) + install(PROGRAMS ${CMAKE_SOURCE_DIR}/tests/box64-bash DESTINATION bin) + endif() else() - install(TARGETS ${BOX64} - RUNTIME DESTINATION ${TERMUX_PATH}/usr/bin) + install(TARGETS ${BOX64} RUNTIME DESTINATION ${TERMUX_PATH}/usr/bin) + if(NOT NO_LIB_INSTALL) + install(PROGRAMS ${CMAKE_SOURCE_DIR}/tests/box64-bash DESTINATION ${TERMUX_PATH}/usr/bin) + endif() + endif() + if (GDBJIT) + install(TARGETS box64gdbjitreader RUNTIME DESTINATION lib) endif() if(NOT NO_CONF_INSTALL) configure_file(system/box64.conf.cmake system/box64.conf) if(NOT TERMUX) - install(FILES ${CMAKE_BINARY_DIR}/system/box64.conf DESTINATION /etc/binfmt.d/) - install(FILES ${CMAKE_SOURCE_DIR}/system/box64.box64rc DESTINATION /etc/) - else() - install(FILES ${CMAKE_BINARY_DIR}/system/box64.conf DESTINATION ${TERMUX_PATH}/usr/etc/binfmt.d/) - install(FILES ${CMAKE_SOURCE_DIR}/system/box64.box64rc DESTINATION ${TERMUX_PATH}/usr/etc/) + install(FILES ${CMAKE_BINARY_DIR}/system/box64.conf DESTINATION /etc/binfmt.d/) + install(FILES ${CMAKE_SOURCE_DIR}/system/box64.box64rc DESTINATION /etc/) + if(BOX32_BINFMT) + configure_file(system/box32.conf.cmake system/box32.conf) + install(FILES ${CMAKE_BINARY_DIR}/system/box32.conf DESTINATION /etc/binfmt.d/) + endif() + else() + install(FILES ${CMAKE_BINARY_DIR}/system/box64.conf DESTINATION ${TERMUX_PATH}/usr/etc/binfmt.d/) + install(FILES ${CMAKE_SOURCE_DIR}/system/box64.box64rc DESTINATION ${TERMUX_PATH}/usr/etc/) + if(BOX32_BINFMT) + configure_file(system/box32.conf.cmake system/box32.conf) + install(FILES ${CMAKE_BINARY_DIR}/system/box32.conf DESTINATION ${TERMUX_PATH}/usr/etc/binfmt.d/) + endif() endif() endif() - set(INSTALL_PATH "/usr/lib/x86_64-linux-gnu/") + set(INSTALL_PATH "/usr/lib/box64-x86_64-linux-gnu/") if(NOT NO_LIB_INSTALL) - if(NOT TERMUX) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libstdc++.so.5 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libstdc++.so.6 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libgcc_s.so.1 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libpng12.so.0 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libcrypto.so.1.1 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libcrypto.so.1.0.0 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libssl.so.1.1 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libssl.so.1.0.0 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libunwind.so.8 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedx509.so.1 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedx509.so.0 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedtls.so.14 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedtls.so.12 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedcrypto.so.7 DESTINATION ${INSTALL_PATH}) - install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedcrypto.so.3 DESTINATION ${INSTALL_PATH}) - else() + if(NOT TERMUX AND NOT ANDROID) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libstdc++.so.5 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libstdc++.so.6 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libgcc_s.so.1 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libpng12.so.0 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libcrypto.so.1.1 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libcrypto.so.1.0.0 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libssl.so.1.1 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libssl.so.1.0.0 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libunwind.so.8 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedx509.so.1 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedx509.so.0 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedtls.so.14 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedtls.so.12 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedcrypto.so.7 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedcrypto.so.3 DESTINATION ${INSTALL_PATH}) + elseif(TERMUX) install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libstdc++.so.5 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libstdc++.so.6 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libgcc_s.so.1 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) @@ -1020,8 +1347,36 @@ if(NOT _x86 AND NOT _x86_64) install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedtls.so.12 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedcrypto.so.7 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) install(FILES ${CMAKE_SOURCE_DIR}/x64lib/libmbedcrypto.so.3 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + elseif(ANDROID) + install(FILES ${CMAKE_SOURCE_DIR}/x64android/libc++_shared.so DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) endif() endif() + if(BOX32) + set(INSTALL_PATH "/usr/lib/box64-i386-linux-gnu/") + if(NOT NO_LIB_INSTALL) + if(NOT TERMUX AND NOT ANDROID) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libstdc++.so.5 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libstdc++.so.6 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libgcc_s.so.1 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libpng12.so.0 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libunwind.so.8 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libcrypto.so.1.0.0 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libssl.so.1.0.0 DESTINATION ${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libz.so.1 DESTINATION ${INSTALL_PATH}) + elseif(TERMUX) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libstdc++.so.5 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libstdc++.so.6 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libgcc_s.so.1 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libpng12.so.0 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libunwind.so.8 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libcrypto.so.1.0.0 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libssl.so.1.0.0 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + install(FILES ${CMAKE_SOURCE_DIR}/x86lib/libz.so.1 DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + elseif(ANDROID) + install(FILES ${CMAKE_SOURCE_DIR}/x86android/libc++_shared.so DESTINATION ${TERMUX_PATH}${INSTALL_PATH}) + endif() + endif() + endif() endif() if(NOT TARGET uninstall) @@ -1034,6 +1389,28 @@ if(NOT TARGET uninstall) COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) endif() +string(REPLACE ";" "," DYNAREC_ASM_STR "${DYNAREC_ASM}") +string(REPLACE ";" "," DYNAREC_PASS_STR "${DYNAREC_PASS}") +string(REPLACE ";" "," INTERPRETER_STR "${INTERPRETER}") + +if(WOW64 AND ARM_DYNAREC) + include(ExternalProject) + ExternalProject_Add( + wowbox64 + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/wine/wow64" + CMAKE_ARGS + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/wine/toolchain_mingw.cmake + -DDYNAREC_PASS_STR=${DYNAREC_PASS_STR} + -DDYNAREC_ASM_STR=${DYNAREC_ASM_STR} + -DINTERPRETER_STR=${INTERPRETER_STR} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + INSTALL_COMMAND "" + TEST_COMMAND "" + BUILD_ALWAYS ON + ) + add_dependencies(wowbox64 generate_git_head_target) +endif() + set(CPACK_GENERATOR "DEB") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "ptitSeb") set(CPACK_PACKAGE_CONTACT "ptitSeb@box86.org") @@ -1065,7 +1442,7 @@ if(_aarch64) else() set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64") endif() -elseif(__riscv64) +elseif(_riscv64) set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "riscv64") elseif(_x86_64) set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "x86_64") @@ -1129,11 +1506,13 @@ add_test(fork ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref09.txt -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) -add_test(cppThreads ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} +add_test(cppThreads_nocosim ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test10 -D TEST_OUTPUT=tmpfile10.txt -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref10.txt -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) +set_tests_properties(cppThreads_nocosim PROPERTIES ENVIRONMENT "BOX64_LD_LIBRARY_PATH=${CMAKE_SOURCE_DIR}/x64lib") + add_test(tlsData ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test11 -D TEST_OUTPUT=tmpfile11.txt -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref11.txt @@ -1188,7 +1567,7 @@ add_test(irelative_reloc ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${ -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref20.txt -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) -add_test(longjumpInSignals ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} +add_test(longjumpInSignals_nocosim ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test21 -D TEST_OUTPUT=tmpfile21.txt -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref21.txt -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) @@ -1243,6 +1622,25 @@ add_test(avx_intrinsics ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${B set_tests_properties(avx_intrinsics PROPERTIES ENVIRONMENT "BOX64_DYNAREC_FASTNAN=0;BOX64_DYNAREC_FASTROUND=0;BOX64_AVX=2") +add_test(fpu_rounding ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test31 -D TEST_OUTPUT=tmpfile31.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref31.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + +set_tests_properties(fpu_rounding PROPERTIES ENVIRONMENT "BOX64_DYNAREC_FASTROUND=0") + +add_test(x87pc ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test32 -D TEST_OUTPUT=tmpfile32.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref32.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + +set_tests_properties(x87pc PROPERTIES ENVIRONMENT "BOX64_DYNAREC_X87DOUBLE=2") + +add_test(Boundary ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test33 -D TEST_OUTPUT=tmpfile33.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref33.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + else() add_test(bootSyscall ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} @@ -1275,10 +1673,10 @@ add_test(threadsStart ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref06.txt -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) -#add_test(trig ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} -# -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test07_android -D TEST_OUTPUT=tmpfile07.txt -# -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref07.txt -# -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) +add_test(trig ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test07_android -D TEST_OUTPUT=tmpfile07.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref07.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) add_test(pi ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test08_android -D TEST_OUTPUT=tmpfile08.txt @@ -1330,10 +1728,10 @@ add_test(irelative_reloc ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${ -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref20.txt -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) -add_test(longjumpInSignals ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} - -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test21_android -D TEST_OUTPUT=tmpfile21.txt - -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref21.txt - -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) +# add_test(longjumpInSignals_nocosim ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} +# -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test21_android -D TEST_OUTPUT=tmpfile21.txt +# -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref21.txt +# -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) add_test(x87 ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test22_android -D TEST_OUTPUT=tmpfile22.txt @@ -1410,3 +1808,138 @@ foreach(file ${extension_tests}) -P ${CMAKE_SOURCE_DIR}/runTest.cmake) endforeach() endif() + +if(BOX32) + add_test(NAME bootSyscall_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test01 -D TEST_OUTPUT=tmpfile32_01.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref01.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME bootSyscallC_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test02 -D TEST_OUTPUT=tmpfile32_02.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref02.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME printf_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test03 -D TEST_OUTPUT=tmpfile32_03.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref03.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME args_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test04 -D TEST_ARGS2=yeah -D TEST_OUTPUT=tmpfile32_04.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref04.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME maths1_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test05 -D TEST_ARGS2=7 -D TEST_OUTPUT=tmpfile32_05.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref05.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME threadsStart_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test06 -D TEST_OUTPUT=tmpfile32_06.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref06.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME trig_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test07 -D TEST_OUTPUT=tmpfile32_07.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref07.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME pi_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test08 -D TEST_OUTPUT=tmpfile32_08.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref08.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME fork_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test09 -D TEST_OUTPUT=tmpfile32_09.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref09.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME cppThreads_32bits_nocosim COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test10 -D TEST_OUTPUT=tmpfile32_10.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref10.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + set_tests_properties(cppThreads_32bits_nocosim PROPERTIES ENVIRONMENT "BOX64_LD_LIBRARY_PATH=${CMAKE_SOURCE_DIR}/x86lib") + + add_test(NAME tlsData_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test11 -D TEST_OUTPUT=tmpfile32_11.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref11.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME fpu_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test12 -D TEST_OUTPUT=tmpfile32_12.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref12.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME contexts_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test13 -D TEST_OUTPUT=tmpfile32_13.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref13.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + if(NOT LD80BITS) + add_test(NAME conditionalThreads_32bits_nocosim COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test14 -D TEST_OUTPUT=tmpfile32_14.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref14.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + endif() + + add_test(NAME linkingIndirectNoversion_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test15 -D TEST_OUTPUT=tmpfile32_15.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref15.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME linkingIndirectVersion_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test16 -D TEST_OUTPUT=tmpfile32_16.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref16.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME sse_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test17 -D TEST_OUTPUT=tmpfile32_17.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref17.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + set_tests_properties(sse_32bits PROPERTIES ENVIRONMENT "BOX64_DYNAREC_FASTNAN=0;BOX64_DYNAREC_FASTROUND=0") + + add_test(NAME longjumpInSignals_32bits_nocosim COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test18 -D TEST_OUTPUT=tmpfile32_18.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref18.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME x87_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test19 -D TEST_OUTPUT=tmpfile32_19.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref19.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + set_tests_properties(x87_32bits PROPERTIES ENVIRONMENT "BOX64_DYNAREC_FASTROUND=0") + + add_test(NAME idiv_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test20 -D TEST_OUTPUT=tmpfile32_20.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref20.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + add_test(NAME multiple_dlopen_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test21 -D TEST_OUTPUT=tmpfile32_21.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref21.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + file(GLOB extension_tests "${CMAKE_SOURCE_DIR}/tests32/extensions/*.c") + foreach(file ${extension_tests}) + get_filename_component(testname "${file}" NAME_WE) + add_test(NAME "${testname}_32bits" COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/extensions/${testname} -D TEST_OUTPUT=tmpfile32_-${testname}.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/extensions/${testname}.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake) + endforeach() + + #add_test(NAME sse_optimized_32bits COMMAND ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + # -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test17_o2 -D TEST_OUTPUT=tmpfile32_17_o2.txt + # -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref17_o2.txt + # -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) + + #set_tests_properties(sse_optimized_32bits PROPERTIES ENVIRONMENT "BOX64_DYNAREC_FASTNAN=0;BOX64_DYNAREC_FASTROUND=0") + + add_test(bswap_32bits ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} + -D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests32/test23 -D TEST_OUTPUT=tmpfile32_23.txt + -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests32/ref23.txt + -P ${CMAKE_SOURCE_DIR}/runTest.cmake ) +endif() diff --git a/README.md b/README.md index 0cc7480..59debee 100644 --- a/README.md +++ b/README.md @@ -1,112 +1,96 @@ ![Official logo](docs/img/Box64Logo.png "Official Logo") -Linux Userspace x86_64 Emulator with a twist +# Box64: Linux Userspace x86-64 Emulator with a Twist -[View changelog](https://github.com/ptitSeb/box64/blob/main/docs/CHANGELOG.md) | [中文](https://github.com/ptitSeb/box64/blob/main/README_CN.md) | [Українська](https://github.com/ptitSeb/box64/blob/main/README_UK.md) | [Report an error](https://github.com/ptitSeb/box64/issues/new) +[Website](https://box86.org/) | [Changelog](https://github.com/ptitSeb/box64/blob/main/docs/CHANGELOG.md) | [中文](https://github.com/ptitSeb/box64/blob/main/README_CN.md) | [Українська](https://github.com/ptitSeb/box64/blob/main/README_UK.md) | [Report an Error](https://github.com/ptitSeb/box64/issues/new) -![build](https://app.travis-ci.com/ptitSeb/box64.svg?branch=main) ![stars](https://img.shields.io/github/stars/ptitSeb/box64) ![forks](https://img.shields.io/github/forks/ptitSeb/box64) ![contributors](https://img.shields.io/github/contributors/ptitSeb/box64) ![prs](https://img.shields.io/github/issues-pr/ptitSeb/box64) ![issues](https://img.shields.io/github/issues/ptitSeb/box64) +![Build Status](https://github.com/ptitSeb/box64/actions/workflows/release.yml/badge.svg) ![Stars](https://img.shields.io/github/stars/ptitSeb/box64) ![Forks](https://img.shields.io/github/forks/ptitSeb/box64) ![Contributors](https://img.shields.io/github/contributors/ptitSeb/box64) ![Pull Requests](https://img.shields.io/github/issues-pr/ptitSeb/box64) ![Issues](https://img.shields.io/github/issues/ptitSeb/box64) ----- +--- -Box64 lets you run x86_64 Linux programs (such as games) on non-x86_64 Linux systems, like ARM (host system needs to be 64-bit little-endian). +**Check out our game compatibility list at [https://box86.org/app/](https://box86.org/app/), please help us [improve it](https://github.com/ptitSeb/box86-compatibility-list/issues)!** -You can find many Box64 videos on the [MicroLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ), [Pi Labs](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g) or [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA) YouTube channels. +--- -Since Box64 uses the native versions of some "system" libraries, like libc, libm, SDL, and OpenGL, it's easy to integrate and use with most applications, and performance can be surprisingly high in many cases. Take a look at thoses bench analysis for an example [here](https://box86.org/index.php/2021/06/game-performances/). +Box64 enables running x86_64 Linux programs, including games, on non-x86_64 Linux systems such as Arm (64-bit little-endian host system required). -Box64 integrates with DynaRec (dynamic recompiler) for the ARM64 and RV64 platform, providing a speed boost between 5 to 10 times faster than using only the interpreter. Some high level information on how DynaRec works can be found [here](https://box86.org/2021/07/inner-workings-a-high%e2%80%91level-view-of-box86-and-a-low%e2%80%91level-view-of-the-dynarec/). +Box64 leverages native system libraries (libc, libm, SDL, OpenGL), offering ease of integration and surprising performance in many applications. For performance benchmarks, check [this analysis](https://box86.org/index.php/2021/06/game-performances/). -Some x64 internal opcodes use parts of "Realmode X86 Emulator Library", see [x64primop.c](src/emu/x64primop.c) for copyright details +With DynaRec for Arm, RISC-V and LoongArch platforms, Box64 achieves a speed boost 5-10x faster than the interpreter alone. For a deeper look at DynaRec, see [Inner workings](https://box86.org/2021/07/inner-workings-a-high%e2%80%91level-view-of-box86-and-a-low%e2%80%91level-view-of-the-dynarec/). - +Box64 Icon -Logo and Icon made by @grayduck, thanks! +_Logo and icon by @grayduck - Thank you!_ ----- +--- -Usage ----- +## Usage -There are a few environment variables to control the behaviour of Box64. +- `$ box64 ./program [args]` to run Linux x86_64 programs. +- `$ box64 -k` to kill all the emulated processes. +- `$ box64-bash` to have an x86_64 bash environment. +- Want to use wine? see [Wine Documentation](docs/WINE.md). -See [here](docs/USAGE.md) for all the environment variables and what they do. +Box64 also offers environment variables and rcfile to control its behavior. For details, see [Usage Documentation](docs/USAGE.md). -Note: Box64's Dynarec uses a mechanism with Memory Protection and a SegFault signal handler to handle JIT code. In simpler terms, if you want to use GDB to debug a running program that use JIT'd code (like mono/Unity3D), you will still have many "normal" segfaults triggering. It is suggested to use something like `handle SIGSEGV nostop` in GDB to not stop at each segfault, and maybe put a breakpoint inside `my_memprotectionhandler` in `signals.c` if you want to trap SegFaults. +--- ----- +## Compiling and Installation -Compiling/Installation ----- -> Compilation instructions can be found [here](https://github.com/ptitSeb/box64/blob/main/docs/COMPILE.md) \ -> Instructions for installing Wine for Box64 can be found [here](https://github.com/ptitSeb/box64/blob/main/docs/X64WINE.md) +- [Compilation Instructions](https://github.com/ptitSeb/box64/blob/main/docs/COMPILE.md) +- [Bundle x86 Libraries](https://github.com/ptitSeb/box64/blob/main/docs/BUNDLE-X86-LIBS.md) +- [Wine Installation for Box64](https://github.com/ptitSeb/box64/blob/main/docs/WINE.md) ----- +--- -Version history/Change log ----- +## Version History -The change log is available [here](docs/CHANGELOG.md). +See the [Changelog](docs/CHANGELOG.md) for version updates. ----- - -Notes about 32-bit platforms ----- +--- -Because Box64 works by directly translating function calls from x86_64 to host system, the host system (the one Box64 is running on) needs to have 64-bit libraries. Box64 doesn't include any 64-bit <-> 32-bit translation. +## Platform Compatibility Notes -So understand that box64 will only run 64-bit linux binaries. For 32-bit binaries, you need box86 (with all the multiarch or proot trickery it implies on a 64-bit OS). -Note that many installer (mojo setup based) will fall back to "x86" when detecting ARM64 OS, and so will try to use box86 for the setup, even if an x86_64 version exist. You can hack your way around with a fake "uname" that return "x86_64" when the argument is "-m" - -An alternative solution is to use Wine with new WoW64, but you will be limited to 32bits windows apps and games. - ----- +Box64 requires 64-bit libraries on the host system, as it directly translates x86_64 function calls. For 32-bit binaries, use Box86 or Box32. -Notes about Box64 configuration ----- +**Notes** -Box64 now have configurations files. There are 2 files loaded. `/etc/box64.box64rc` and `~/.box64rc`. Both files have the same syntax, and is basicaly an ini files. Section in square brakets define the process name, and the rest is the env. var. to set. Looke at [Usage](https://github.com/ptitSeb/box64/blob/main/docs/USAGE.md) for detail on what parameters can be put. Box64 comes with a default file that should be installed for better stability. The file in in `system/box64.box64rc` and should be installed to `/etc/box64.box64rc` If, for some reason, you don't want to install that file here, at least copy it to `~/.box64rc` or some game may not function correctly. -Note that the priority is: `~/.box64rc` > `/etc/box64.box64rc` > command line -So, your settings in `~/.box64rc` may override the setting from your command line... +1. Box32 is still experimental. +2. Some shell scripts (such as the GOG game installer) may rely on `uname -m` to determine the current architecture. Please run them as `box64 script.sh` to allow Box64 to take over. ----- +--- -Notes about Unity game emulation ----- +## Configuration -Running Unity games should just work, but you should also note that many Unity3D games require OpenGL 3+ which can be tricky to provide on ARM SBC (single-board computers). Also many newer Unity3D (like KSP) games use the BC7 compressed textures, which is not supported on many ARM integrated GPU. -Hint: on Pi4 and Pi5 use `MESA_GL_VERSION_OVERRIDE=3.2`, with `BOX64_DYNAREC_STRONGMEM=1` to prevent freezes and enable strong memory mode, and use Panfrost `PAN_MESA_DEBUG=gl3` to use higher profile if the game starts then quits before showing anything. +Box64 has configuration files located in `/etc/box64.box64rc` and `~/.box64rc`, both formatted as `.ini` files. If you don’t want to use the default `/etc/box64.box64rc` file, copy it to `~/.box64rc` to ensure compatibility. ----- +Settings priority: `~/.box64rc` > `/etc/box64.box64rc` > Command line. -Notes about GTK programs ----- +For more information, check [Usage Documentation](docs/USAGE.md). -GTK libraries are now wrapped on box64, both gtk2 and gtk3. +--- ----- +## Additional Platform-Specific Notes -Notes about Steam ----- +### Unity Game Emulation -Note that Steam is a hybrid 32-bit / 64-bit. You NEED box86 to run Steam, as the client app is a 32-bit binary. It also uses a 64-bit local server binaries, and that steamwebhelper process is now mandatory, even on the "small mode". And that process will eat lots of memory. So machine with less the 6Gb of RAM will need a swapfile to use Steam. +- Many Unity games require OpenGL 3+, which may be challenging on ARM/RISC-V SBCs. +- **Tip for Pi4 and Pi5 Users**: Set `MESA_GL_VERSION_OVERRIDE=3.2` with `BOX64_DYNAREC_STRONGMEM=1` to prevent freezes and enable strong memory mode. +- **Using Panfrost**: For better compatibility on ARM, enable `PAN_MESA_DEBUG=gl3` to force higher OpenGL profiles. This can help if a game starts but quits unexpectedly before showing any content. ----- +### Steam -Notes about Wine ----- +See [Steam Documentation](docs/STEAM.md). -Wine64 is supported on box64. Proton too. Be aware that 64-bit Wine also includes 32-bit components, to be able to run 32-bit Windows programs. The 32-bit apps will need box86 and will not run without it. On a system where both box64 and box86 are present and working, a wine 64-bit setup can run both 32-bit and 64-bit Windows programs (just use `wine` and `wine64` respectively). -Note that the new 32-bit PE in 64-bit processes that the Wine team is currently implementing in Wine 7.+ is now supported. It's called "new WoW64" and it's working fine on box64, allowing the use of 32bits windows program on 64bits only system. +### Wine ----- +Box64 supports Wine64 and Proton. For 32-bit components, Box86 is required. Systems with both Box64 and Box86 can run 32- and 64-bit Windows programs. -Notes about Vulkan ----- +**Note**: You can use Wine WOW64 build to run x86 Windows programs in Box64-only environments, this is still experimental, but it works in most cases. -Box64 wraps Vulkan libraries, but note that it as mostly been tested with an AMD RX550 card and on the Freedreno driver, so some extensions may be missing depending on your graphics card. +For more information, check [Wine Documentation](docs/WINE.md). ---- - Final word ---- @@ -114,7 +98,7 @@ I want to thank everyone who has contributed to box64 development. There are many ways to contribute: code contribution, financial, hardware and advertisement! So, in no particular order, I want to thank: * For their major code contribution: rajdakin, mogery, ksco, xctan - * For their major financial contribution: [Playtron](https://playtron.one), FlyingFathead, stormchaser3000, dennis1248, sll00, [libre-computer-project](https://libre.computer/), [CubeCoders Limited](http://cubecoders.com/) + * For their major financial contribution: [Playtron](https://playtron.one), tohodakilla, FlyingFathead, stormchaser3000, dennis1248, sll00, [libre-computer-project](https://libre.computer/), [CubeCoders Limited](http://cubecoders.com/) * For hardware contribution and LoongArch migration: [xiaoji](https://www.linuxgame.cn/), Deepin Beijing Develop Team * For their hardware contribution: [ADLINK](https://www.adlinktech.com/Products/Computer_on_Modules/COM-HPC-Server-Carrier-and-Starter-Kit/Ampere_Altra_Developer_Platform?lang=en) with [Ampere](https://amperecomputing.com/home/edge), [SOPHGO](https://www.sophon.ai/), [Radxa](https://rockpi.org/), [StarFive](https://rvspace.org/), [Pine64](https://www.pine64.org/), [AYN](https://www.ayntec.com/), [AYANEO](https://ayaneo.com/), [jiangcuo](https://github.com/jiangcuo) * For their continuous advertisements for the box64 project: salva ([microLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)), [PILab](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g)/[TwisterOS](https://twisteros.com/) team, [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA), [NicoD](https://www.youtube.com/channel/UCpv7NFr0-9AB5xoklh3Snhg), ekianjo ([Boilingsteam](https://boilingsteam.com/)) @@ -122,3 +106,4 @@ So, in no particular order, I want to thank: And I also thank the many other people who participated even once in this project. (If you use Box64 in your project, please don't forget to mention it!) + diff --git a/README_CN.md b/README_CN.md index e9719c4..8acca4e 100644 --- a/README_CN.md +++ b/README_CN.md @@ -1,97 +1,94 @@ -# box64 +![图标](docs/img/Box64Logo.png "图标") -![Official logo](docs/img/Box64Logo.png "Official Logo") -Linux 上用户空间的 x86_64 应用模拟器(支持运行原生库) +# Box64:Linux 用户空间 x86-64 模拟器(支持原生库) ----- -![box64 build status](https://app.travis-ci.com/ptitSeb/box64.svg?branch=main) +[官网](https://box86.org/) | [更新日志](https://github.com/ptitSeb/box64/blob/main/docs/CHANGELOG.md) | [English](https://github.com/ptitSeb/box64/blob/main/README.md) | [Українська](https://github.com/ptitSeb/box64/blob/main/README_UK.md) | [Report an Error](https://github.com/ptitSeb/box64/issues/new) -[English](docs/README.md) | [Українська](https://github.com/ptitSeb/box64/blob/main/README_UK.md) +![Build Status](https://app.travis-ci.com/ptitSeb/box64.svg?branch=main) ![Stars](https://img.shields.io/github/stars/ptitSeb/box64) ![Forks](https://img.shields.io/github/forks/ptitSeb/box64) ![Contributors](https://img.shields.io/github/contributors/ptitSeb/box64) ![Pull Requests](https://img.shields.io/github/issues-pr/ptitSeb/box64) ![Issues](https://img.shields.io/github/issues/ptitSeb/box64) -Box64 可以在非 x86_64 Linux 系统(比如 ARM64)上运行 x86_64 Linux 程序(比如游戏),注意主机系统需要是 64 位小端。 +--- -您可以在 [MicroLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)、[Pi Labs](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g) 和 [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA) YouTube 频道上找到许多 Box64 视频。 +**请查看我们的游戏兼容性列表:[https://box86.org/app/](https://box86.org/app/),并请帮助我们[改进它](https://github.com/ptitSeb/box86-compatibility-list/issues)!** -由于 Box64 使用一些“系统”库的原生版本,如 libc、libm、SDL 和 OpenGL 等,因此很容易与大多数应用程序集成和使用,并且在许多情况下性能会相当不错。可以在[这里](https://box86.org/index.php/2021/06/game-performances/)查看一些性能测试的样例。 +--- -Box64 集成了适用于 ARM64 和 RV64 平台的 DynaRec(动态重编译器),速度可以比纯解释模式快 5 到 10 倍。可以在[这里](https://box86.org/2021/07/inner-workings-a-high%E2%80%91level-view-of-box86-and-a-low%E2%80%91level-view-of-the-dynarec/)找到有关 DynaRec 工作原理的一些信息。 +Box64 可以在非 x86_64 Linux 主机系统(比如 Arm)上运行 x86_64 Linux 程序(比如游戏),目前仅支持 64 位小端主机系统。 -一些 x64 内部操作码使用 “Realmode X86 Emulator Library” 的部分内容,有关版权详细信息,请参见 [x64primop.c](../src/emu/x64primop.c)。 +Box64 可以使用本机原生的系统库(libc、libm、SDL、OpenGL),有着易于集成的特性和令人惊讶的性能。如需性能基准测试,请查看[此分析](https://box86.org/index.php/2021/06/game-performances/)。 - +借助适用于 Arm,RISC-V 以及龙架构平台的 DynaRec,Box64 的速度比单独使用解释器快 5-10 倍。如需深入了解 DynaRec,请参考[此文章](https://box86.org/2021/07/inner-workings-a-high%e2%80%91level-view-of-box86-and-a-low%e2%80%91level-view-of-the-dynarec/)。 -LOGO 由 @grayduck 制作,感谢! +Box64 Icon ----- +_Logo 由 @grayduck 制作,感谢!_ -使用方法 ----- +--- -有若干环境变量可以控制 Box64 的行为。 +## 使用方法 -可在[这里](docs/USAGE.md)查看所有环境变量及其作用。 +- `$ box64 ./program [args]` 运行 Linux x86_64 程序。 +- `$ box64 -k` 杀死所有模拟的进程。 +- `$ box64-bash` 进入 x86_64 bash 环境。 +- 想要使用 wine?请参阅 [Wine 使用说明](docs/WINE.md)。 -注意:Box64 的 Dynarec 使用具有内存保护和段错误信号处理的机制来执行 JIT 代码。所以,如果想使用 GDB 调试使用 JIT 代码的程序(如 Mono/Unity3D),这会触发许多“正常”的段错误。建议在 GDB 中使用类似 `handle SIGSEGV nostop` 来防止它每个段错误处停止。如果你想捕获段错误,可以在 `signals.c` 的 `my_memprotectionhandler` 中设置断点。 +Box64 还提供了环境变量和 Rc 文件来控制其行为。有关详细信息请参阅[使用文档](docs/USAGE.md)。 ----- +--- -编译/安装 ----- +## 编译和安装 -编译说明可以在[这里](docs/COMPILE.md)查看。 +- [编译说明](https://github.com/ptitSeb/box64/blob/main/docs/COMPILE.md) +- [安装 Wine](https://github.com/ptitSeb/box64/blob/main/docs/WINE.md) ----- +--- -版本历史 ----- +## 版本历史 -版本日志在[这里](docs/CHANGELOG.md)。 +请参阅[变更日志](docs/CHANGELOG.md)了解版本更新说明。 ----- +--- -32位平台的注意事项 ----- +## 平台兼容性说明 -因为 Box64 的工作原理是直接将函数调用从 x86_64 转换为主机系统,所以主机系统(运行 Box64 的系统)需要有 64 位库。Box64 不包含任何 64 位 <-> 32 位的转换。 +Box64 直接转换 x86_64 函数调用到本机原生库,因此需要主机系统上的 64 位库。对于 32 位二进制文​​件,请使用 Box86 或 Box32。 -所以 box64 只能运行 64 位的 Linux 二进制。对于 32 位二进制则需要使用 box86 来运行(它在 64 位操作系统上使用了 multiarch 和 proot 等技巧来实现运行)。请注意,许多(基于 mojo 的)安装程序在检测到 ARM64 操作系统时将回退到 “x86”,因此即使存在 x86_64 版本,也会尝试使用 box86。这时你可以使用一个假的 `uname` ,并使它在运行参数为 `-m` 时返回 `x86_64`。 +**注意事项** ----- +1. Box32 仍然是实验性质。 +2. 某些 Shell 脚本(比如 GOG 游戏安装脚本)可能会依赖 `uname -m` 判断当前架构,请使用 `box64 script.sh` 的方式运行以便让 Box64 接管。 -关于 Unity 游戏模拟的注意事项 ----- +--- -运行 Unity 游戏应该没什么问题,但还应该注意,许多 Unity3D 游戏需要 OpenGL 3+,这在 ARM SBC 上可能会比较棘手。同时许多较新的 Unity3D游戏(如 KSP)也使用 BC7 压缩纹理,很多 ARM 的集成显卡并不支持。 +## 配置 -> 提示:如果游戏开始后没有显示任何东西就退出了,在 Pi4 上可以使用 `MESA_GL_VERSION_OVERRIDE=3.2`,在 Panfrost 上则可以使用 `PAN_MESA_DEBUG=gl3` 来使用更高的配置。 +Box64 的配置文件位于 `/etc/box64.box64rc` 和 `~/.box64rc`,均为 `.ini` 格式的文件。如果您不想使用默认的 `/etc/box64.box64rc` 文件,请将其复制到 `~/.box64rc` 以确保兼容性。 ----- +配置项的优先级:`~/.box64rc` > `/etc/box64.box64rc` > 命令行。 -关于GTK程序的注意事项 ----- +更多信息,请参阅[使用文档](docs/USAGE.md)。 -box64 封装了 GTK,包括 gtk2 和 gtk3。 +--- ----- +## 特定平台的其他说明 -关于 Steam 的注意事项 ----- +### Unity 游戏 +- 许多 Unity 游戏需要 OpenGL 3+,这对 ARM/RISC-V SBC 来说可能具有挑战性。 +- **对 Pi4 和 Pi5 用户的提示**:设置 `MESA_GL_VERSION_OVERRIDE=3.2` 和 `BOX64_DYNAREC_STRONGMEM=1` 以防止卡死并启用强内存模式。 +- **Panfrost**:为了在 ARM 上实现更好的兼容性,启用 `PAN_MESA_DEBUG=gl3` 以强制更高的 OpenGL Profile。如果游戏可以启动但在显示任何内容之前意外退出,这个设置可能会有所帮助。 -请注意,Steam 是 32/64 位混合的应用,所以你需要 box86 才能运行,因为客户端应用程序是 32 位的。它还使用 64 位本地服务器,它的 steamwebhelper 无法被关闭(即使是在最小模式)而且会吃掉大量的内存。对于内存小于 6 GB 的机型,你将会需要创建 swapfile 来运行 Steam。 +### Steam ----- +Box64 支持 Linux Steam 和 Windows Steam,更多细节请参考[Steam 文档](docs/STEAM.md)。 -关于 Wine 的注意事项 ----- +> 由于 Linux Steam 客户端应用是 32 位的,需要使用 Box86 或 Box32,但其本地服务器是 64 位的二进制文件。对于内存少于 6GB 的系统,可能需要使用交换文件以获得最佳性能。 -box64 支持 Wine64,Proton 应该也能运行。请注意,64 位 Wine 包含有 32 位组件,以便能够运行 32 位 Windows 程序。32 位应用程序需要 box86,否则无法运行。在 box64 和 box86 都存在并工作的系统上,64 位的 Wine 可以同时运行 32 位和 64 位 Windows 程序(分别使用 `wine` 和 `wine64`)。请注意,目前在 Wine 7.+ 中实现的 Wine 时间在 64 位进程中的新 32bit PE 尚不支持。我测试了 Wine 7.5 64 位可以正常工作,但是更新的版本可能还不行。 +### Wine ----- +Box64 支持 Wine64 和 Proton。对于 32 位组件,需要 Box86。配备 Box64 和 Box86 的系统可以运行 32 位和 64 位的 Windows 程序。 -关于 Vulkan 注意事项 ----- +**提示**:您可以使用 Wine WOW64 版本在仅限 Box64 的环境中运行 x86 Windows 程序,这项支持仍处于实验阶段,但在大多数情况下都可以工作。 -Box64 封装了 Vulkan 库,但请注意,它仅在 RX550 显卡上进行过测试,因此根据您的显卡,某些扩展可能会丢失。 +有关更多信息,请参阅 [Wine 使用说明](docs/WINE.md)。 ---- @@ -103,7 +100,7 @@ Box64 封装了 Vulkan 库,但请注意,它仅在 RX550 显卡上进行过 以下感谢不分先后: * 代码贡献:rajdakin, mogery, ksco, xctan - * 财务帮助:[Playtron](https://playtron.one), FlyingFathead, stormchaser3000, dennis1248, sll00, [libre-computer-project](https://libre.computer/) + * 财务支持:[Playtron](https://playtron.one), tohodakilla, FlyingFathead, stormchaser3000, dennis1248, sll00, [libre-computer-project](https://libre.computer/), [CubeCoders Limited](http://cubecoders.com/) * 硬件捐赠和 LoongArch 迁移:[xiaoji](https://www.linuxgame.cn/), Deepin Beijing Develop Team * 硬件捐赠:[ADLINK](https://www.adlinktech.com/Products/Computer_on_Modules/COM-HPC-Server-Carrier-and-Starter-Kit/Ampere_Altra_Developer_Platform?lang=en) with [Ampere](https://amperecomputing.com/home/edge), [SOPHGO](https://www.sophon.ai/), [Radxa](https://rockpi.org/), [StarFive](https://rvspace.org/), [Pine64](https://www.pine64.org/), [AYN](https://www.ayntec.com/), [AYANEO](https://ayaneo.com/), [jiangcuo](https://github.com/jiangcuo) * 为本项目持续的宣传:salva ([microLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)), [PILab](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g)/[TwisterOS](https://twisteros.com/) team, [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA), [NicoD](https://www.youtube.com/channel/UCpv7NFr0-9AB5xoklh3Snhg), ekianjo ([Boilingsteam](https://boilingsteam.com/)) diff --git a/README_UK.md b/README_UK.md index 2c549e1..f5c6a92 100644 --- a/README_UK.md +++ b/README_UK.md @@ -1,8 +1,10 @@ +> Внимание: Этот документ устарел. Пожалуйста, помогите нам его перевести. + ![Official logo](docs/img/Box64Logo.png "Official Logo") Емулятор простіра користувача x86_64 із родзинкою -[Дивитись журнал змін](https://github.com/ptitSeb/box64/blob/main/docs/CHANGELOG.md) | [中文](https://github.com/ptitSeb/box64/blob/main/README_CN.md) | [Українська](https://github.com/ptitSeb/box64/blob/main/README_UK.md) | [Повідомити про помилку](https://github.com/ptitSeb/box64/issues/new) +[Дивитись журнал змін](https://github.com/ptitSeb/box64/blob/main/docs/CHANGELOG.md) | [中文](https://github.com/ptitSeb/box64/blob/main/README_CN.md) | [English](https://github.com/ptitSeb/box64/blob/main/README.md) | [Повідомити про помилку](https://github.com/ptitSeb/box64/issues/new) ![build](https://app.travis-ci.com/ptitSeb/box64.svg?branch=main) ![stars](https://img.shields.io/github/stars/ptitSeb/box64) ![forks](https://img.shields.io/github/forks/ptitSeb/box64) ![contributors](https://img.shields.io/github/contributors/ptitSeb/box64) ![prs](https://img.shields.io/github/issues-pr/ptitSeb/box64) ![issues](https://img.shields.io/github/issues/ptitSeb/box64) @@ -10,8 +12,6 @@ Box64 дозволяє запускати x86_64 Linux програми (наприклад, ігри) на системах Linux відмінних від x86_64, наприклад ARM (хост-система має мати 64-розрядний порядок редагування). -Ви можете знайти багато відео про Box64 в YouTube каналах [MicroLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ), [Pi Labs](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g) або [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA) - Оскільки Box64 використовує рідні версії деяких «системних» бібліотек, таких як libc, libm, SDL і OpenGL, його легко інтегрувати та використовувати з більшістю програм, а продуктивність у багатьох випадках може бути напрочуд високою. Подивіться на цей стендовий аналіз для прикладу [тут](https://box86.org/index.php/2021/06/game-performances/). Box64 інтегрується з DynaRec (динамічний рекомпілятор) для платформ ARM64 і RV64 забезпечуючи підвищення швидкості в 5-10 разів, ніж використання лише інтерпретатора. Деякі високорівневі відомості про те, як працює DynaRec, можна знайти [тут](https://box86.org/2021/07/inner-workings-a-high%e2%80%91level-view-of-box86-and-a-low%e2%80%91level-view-of-the-dynarec/). @@ -37,10 +37,9 @@ Box64 інтегрується з DynaRec (динамічний рекомпіл Компіляція/Встановлення ---- > Інструкцію зі складання Box64 можна знайти [тут](docs/COMPILE.md).\ -> Інструкцію з встановлення Wine для Box64 можна знайти [тут](docs/X64WINE.md). +> Інструкцію з встановлення Wine для Box64 можна знайти [тут](docs/WINE.md). ---- - Історія версій/Журнал змін ---- @@ -68,7 +67,7 @@ Box64 інтегрується з DynaRec (динамічний рекомпіл ---- Запуск ігор Unity має працювати, але ви також повинні зауважити, що для багатьох ігор Unity3D потрібен OpenGL 3+, який може бути складно забезпечити на ARM SBC (одноплатних комп’ютерах). Крім того, багато нових ігор Unity3D (наприклад, KSP) використовують стиснуті текстури BC7, які не підтримуються багатьма інтегрованими GPU ARM. -Підказка: в Pi4 використовуйте `MESA_GL_VERSION_OVERRIDE=3.2`, а в Panfrost — `PAN_MESA_DEBUG=gl3`, щоб використовувати вищий профіль, якщо гра запускається, а потім завершується, перш ніж щось показує. +Підказка: на Pi4 і Pi5 використовуйте `MESA_GL_VERSION_OVERRIDE=3.2` з `BOX64_DYNAREC_STRONGMEM=1`, щоб запобігти зависанням і ввімкнути режим сильної пам’яті, і використовуйте Panfrost `PAN_MESA_DEBUG=gl3`, щоб використовувати вищий профіль, якщо гра починається, а потім завершується, перш ніж щось показати. ---- @@ -108,7 +107,7 @@ Box64 використовує бібліотеки Vulkan, але зауваж Є багато способів зробити внесок: внесок коду, фінансовий внесок, апаратне забезпечення та реклама! Отже, без особливого порядку, я хочу подякувати: * За основний внесок у код: rajdakin, mogery, ksco, xctan -* За великий фінансовий внесок: [Playtron](https://playtron.one), FlyingFathead, stormchaser3000, dennis1248, sll00, [libre-computer-project](https://libre.computer/) +* За великий фінансовий внесок: [Playtron](https://playtron.one), tohodakilla, FlyingFathead, stormchaser3000, dennis1248, sll00, [libre-computer-project](https://libre.computer/) * За апаратне забезпечення та міграцію LoongArch: [xiaoji](https://www.linuxgame.cn/), команда розробників Deepin Beijing * За внесок у апаратне забезпечення: [ADLINK](https://www.adlinktech.com/Products/Computer_on_Modules/COM-HPC-Server-Carrier-and-Starter-Kit/Ampere_Altra_Developer_Platform?lang=en) with [Ampere](https://amperecomputing.com/home/edge), [SOPHGO](https://www.sophon.ai/), [Radxa](https://rockpi.org/), [StarFive](https://rvspace.org/), [Pine64](https://www.pine64.org/), [AYN](https://www.ayntec.com/), [AYANEO](https://ayaneo.com/), [jiangcuo](https://github.com/jiangcuo) * За безперервну рекламу Box64: salva ([microLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)), [PILab](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g)/Команда [TwisterOS](https://twisteros.com/), [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA), [NicoD](https://www.youtube.com/channel/UCpv7NFr0-9AB5xoklh3Snhg), ekianjo ([Boilingsteam](https://boilingsteam.com/)) diff --git a/box64-bundle-x86-libs.csv b/box64-bundle-x86-libs.csv new file mode 100644 index 0000000..0c96cfe --- /dev/null +++ b/box64-bundle-x86-libs.csv @@ -0,0 +1,82 @@ +https://archive.debian.org/debian/pool/main/c/curl/libcurl3-gnutls_7.74.0-1.3+deb11u7~bpo11+1_amd64.deb,d5ae55e3a9838d12358530cd03218cc0d18127a84e9cfc73bdf79dacd40b25e4 +https://archive.debian.org/debian/pool/main/c/curl/libcurl3-gnutls_7.74.0-1.3+deb11u7~bpo11+1_i386.deb,625e5189304d4d3bfb27cb821e257816c5ce761b1696b5da5ca4fa1035c48463 +https://archive.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.2l-1~bpo8+1_amd64.deb,6e85968afe1a6643f4e82e1cc168f848c5967a131bb1c7392f11974953db0e67 +https://archive.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.2l-1~bpo8+1_i386.deb,4e8b924286a064c257ca50b8ecd44fe71226443daef62b6836010590e2157329 +https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/34/Everything/x86_64/os/Packages/l/libunwind-1.4.0-5.fc34.i686.rpm,eb518e9d073c36fd29862c7afd00a8a7cb186074a0e162983f18fb6c9dc71d2c +https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/34/Everything/x86_64/os/Packages/l/libunwind-1.4.0-5.fc34.x86_64.rpm,0f44e37e4eb472508e0dba8505ebbb04c2c1390c6a43970a6af80aad886037e3 +https://archives.fedoraproject.org/pub/archive/fedora/linux/updates/34/Everything/x86_64/Packages/h/hidapi-0.11.2-2.fc34.i686.rpm,386040fc502e2f02b4b072e0cd90c034dc0a30831fbd2ddb116d17c080b6f9a4 +https://archives.fedoraproject.org/pub/archive/fedora/linux/updates/34/Everything/x86_64/Packages/h/hidapi-0.11.2-2.fc34.x86_64.rpm,2a13461c7d5fcf72ffd682b3eb04833aea8306d61c3b8bdeb42a5081d96d5478 +https://archives.fedoraproject.org/pub/archive/fedora/linux/updates/40/Everything/x86_64/Packages/s/SDL3-3.2.12-1.fc40.i686.rpm,4a3bce6e6358ddd05ed2941e7b8fcc4c8cc02df20741d3f0f9295facbc687769 +https://archives.fedoraproject.org/pub/archive/fedora/linux/updates/40/Everything/x86_64/Packages/s/SDL3-3.2.12-1.fc40.x86_64.rpm,9524803ef42d80dc1b15190d5bb5925200995d5a6152eca04471383ff891af17 +https://cdn.getsol.us/repo/shannon/libj/libjpeg-turbo/libjpeg-turbo-3.0.3-21-1-x86_64.eopkg,c92f19d446b4c2450306f13b1a908f2552400da09301996fe349fee243d964d2 +https://cdn.getsol.us/repo/shannon/libj/libjpeg-turbo/libjpeg-turbo-32bit-3.0.3-21-1-x86_64.eopkg,5624990281f6520026aa2252c711f02d4916099aeac63accc83bd2135b9d3220 +https://repo.almalinux.org/almalinux/8.10/BaseOS/x86_64/os/Packages/nettle-3.4.1-7.el8.i686.rpm,13bc8758355c3ec885f414e0e86efad29a7fe82c0999cdb3754d666949c06cc5 +https://repo.almalinux.org/almalinux/8.10/BaseOS/x86_64/os/Packages/nettle-3.4.1-7.el8.x86_64.rpm,fb4aaa22b2e2f2fc0c451b87ac464e8746d240397d64e79f6bfd38f4e9128a5a +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/compat-openssl11-1.1.1k-4.el9_0.i686.rpm,6b9d8e1b34dcc5a5cb1196d746022b04677b7f9a105508392446508c6ae9b4cc +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/compat-openssl11-1.1.1k-4.el9_0.x86_64.rpm,102eb4355d2dfc8093ed59dd2ebc6bf8616965524faf7e886212fd542f4c1b4b +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/fribidi-1.0.10-6.el9.2.i686.rpm,75f808f0f5f93aceb4e477aa5f302edbed07a605a0644f0ea929d4ea609e36a0 +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/fribidi-1.0.10-6.el9.2.x86_64.rpm,b4763ca410f8479b2775efb55ba09e6722948af7526180a56309e3e090c27010 +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libepoxy-1.5.5-4.el9.i686.rpm,fe35e8de9b68c8d7e7b6b525580fc36cf9c86412cdb2b022dc01f95801771981 +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libepoxy-1.5.5-4.el9.x86_64.rpm,b6d1e7f1c832882ceb05187cbc2d8fe1f459bcd88c7160487ee6f734e1a5d017 +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libICE-1.0.10-8.el9.i686.rpm,d9c44bb34c990fdcc6987feefacfc9e1e7997ca25f1e0a59c9adc9c16f2266d1 +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libICE-1.0.10-8.el9.x86_64.rpm,d0b867203384942985c3c4ad6fc9ec0000fcc9965408451a6cdef8df06a3833c +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libogg-1.3.4-6.el9.i686.rpm,9e4ff6fa0251c5357ae8f648b3e396d0043d5b3f2fb28d23325f5bd592c67aee +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libogg-1.3.4-6.el9.x86_64.rpm,83b4b333e335654674032d1cda4d7deb328b5a409f95e3952c3dc482b684fd8f +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libsigc%2B%2B20-2.10.7-2.el9.i686.rpm,7c33f4c18cbd51dc0a7c9ae0190b1a27d0540ce2fd92ced4776dde66162d1a88 +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libsigc%2B%2B20-2.10.7-2.el9.x86_64.rpm,8600132b9e4efadfe23d3125e90287f5a7114165fd9ecb064d9930fcca446ef2 +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libSM-1.2.3-10.el9.i686.rpm,ec68b3def828ba442248f3cff495f42c4af3dd58f38c8daad07dfddc109d999a +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libSM-1.2.3-10.el9.x86_64.rpm,d00318843a50138829b470a97b8db1a00723b10bca23c16a8386d9ab670e4c64 +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libtheora-1.1.1-31.el9.i686.rpm,2155c688b516ab359d0c47be6d73e51d3c65f199ed5591f7bb7ce6d5d9799977 +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libtheora-1.1.1-31.el9.x86_64.rpm,25ab4a8ad997b450b4a34a777f5a0678eea72ca1665944a7a461ac63de4b25bf +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libvorbis-1.3.7-5.el9.i686.rpm,e38c5185fea611330ea253db020315dd564507bf95c48a81dbe7db186ce4214b +https://vault.almalinux.org/9.5/AppStream/x86_64/os/Packages/libvorbis-1.3.7-5.el9.x86_64.rpm,3c340337a073975636d198a282503f32a54bf85fb5345522a2c22e530b8d6c9e +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/bluez-libs-5.72-2.el9.i686.rpm,af1aba8e6fa5ccf33032d58a3acc59368c07d532293396db205fb9a4bc1241ae +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/bluez-libs-5.72-2.el9.x86_64.rpm,49c273813b4616240acdae8dae893192658c7541482f9bbb2c46dfe19b61877d +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/glibc-2.34-125.el9_5.8.alma.1.i686.rpm,28bc1088e39483d145849e8804c5a0f2524faeb4f76631ae46c41100f40e08b9 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/glibc-2.34-125.el9_5.8.alma.1.x86_64.rpm,1848b9ced2dfec6c206791b23a5a8a6356939c5ed0492fc91c86bf1d3a255c1d +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/gmp-6.2.0-13.el9.i686.rpm,fe352f7d197ebdf2c92bbd6e548f9f6b7ac9e69e7a9d6c9861a6274482e79d73 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/gmp-6.2.0-13.el9.x86_64.rpm,babe0b1385e723476a216d5f4b72453e031c3d683b19344786c2bddf7203cb04 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/gnutls-3.8.3-4.el9_4.i686.rpm,64cf0b0136d3f9b80b07ce2d4b8ce6a4ab86617e8ef9baf560bdfa5edef825ea +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/gnutls-3.8.3-4.el9_4.x86_64.rpm,16c48c504fe62f8e19cac7c6442d3e08bba487f610c2f533116dac32357cda86 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/harfbuzz-2.7.4-10.el9.i686.rpm,5157daf2ab0a03b403d37c60b150b8f0f866754714f81e3d96368e06a16339ce +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/harfbuzz-2.7.4-10.el9.x86_64.rpm,1f81073019abe4176d4496723a89b55a349c31f507e96397a0b3efa7cea0ff61 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libblkid-2.37.4-20.el9.i686.rpm,f9e62d2768c31948b53268b7de51bd1c7342cdf39a328a0d89d933b4aa0c5dd1 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libblkid-2.37.4-20.el9.x86_64.rpm,ed02d978a36488b38bad62af21d4045367c1f0b00d00c90ded01e2fc8e190536 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libbrotli-1.0.9-7.el9_5.i686.rpm,d18c20fccbb9497222059d475161a55c0c6279344f214fe551b8b0f87d3c054a +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libbrotli-1.0.9-7.el9_5.x86_64.rpm,77906ae44bcd42a9f6646d814874768e8befaabf413133d44f71a95ac6c6d68c +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libffi-3.4.2-8.el9.i686.rpm,70daa216ed2a6540e41c455efc95d2b5671db164137f854bceae07e348f58645 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libffi-3.4.2-8.el9.x86_64.rpm,1cf2d122e5c423681394c1bc599ee2281d2eafff5a3749842bc93c37db4bed5e +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libgcc-11.5.0-2.el9.alma.1.i686.rpm,fed64dfadf74bd132ac2675f625ec601ca9d7ae9d05b8d7ff492a204260d0174 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libgcc-11.5.0-5.el9_5.alma.1.x86_64.rpm,7bd3ec130e1712442121b61b27164386006b9bfa6f0fa188316ecb35575a768f +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libgomp-11.5.0-2.el9.alma.1.i686.rpm,686ac26afe2073a3607f26fd1592a8ccd9b78f6eec6e872528634b43c4e04dd7 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libgomp-11.5.0-2.el9.alma.1.x86_64.rpm,9a2bdc6807b22ffb6294b30dcc13e20198abe5facaeefcf1bfacec3e1013e3c2 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libgpg-error-1.42-5.el9.i686.rpm,23f828674bc30752687452dacf4a25ca8c25ef0d25e3e6953d0714b5b33cef08 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libgpg-error-1.42-5.el9.x86_64.rpm,f28fabeb02add41b8156c394427da9dbf99882d8c42055367f872130ee424c97 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libidn2-2.3.0-7.el9.i686.rpm,4458e2d416b5e6714ec664c4f88791eee7d1e707026a5854d948a6159911465b +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libidn2-2.3.0-7.el9.x86_64.rpm,c3ff43237c05258ee0dd77c28540fc8d0d824f1567b115ddfd555b78d2ee0e7a +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libnsl-2.34-125.el9_5.8.alma.1.i686.rpm,7f4d1552b6036c49028db959f82fc0bc30773cd7ed0a62c3906da0e2388f4dc5 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libnsl-2.34-125.el9_5.8.alma.1.x86_64.rpm,7d0e521ab087807ee71d79da66a2829b827bf5080bb5d080dfab108e31cf218b +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libpng-1.6.37-12.el9.i686.rpm,66bf967e84f0d8e7a0059f2b7dda33482ff5e4fe088d0e3bc86dc54e6c7c97be +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libpng-1.6.37-12.el9.x86_64.rpm,ebb3e927dfafa0b199e00e2bef4c10c85fc82a70c359faf9aeb599eda70bfa5e +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libstdc%2B%2B-11.5.0-5.el9_5.alma.1.i686.rpm,05fd29569c312a661374aa69e28ed5cad20812822070a3138265c92a446e2c80 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libstdc%2B%2B-11.5.0-5.el9_5.alma.1.x86_64.rpm,7efb1ded0ec2763589dd3bc6a9d52fa9f898cc1f3db6e8761e1d223ce4506424 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libtasn1-4.16.0-8.el9_1.i686.rpm,9cbd11277e89bd0d4a80900bee01ca71b0c582c9cb5744f5035135b2ed907c85 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libtasn1-4.16.0-8.el9_1.x86_64.rpm,2dd3a1ad2785df642cb03dfed6dfbeec929ff8b14e52e61272ca7e89f86ba3cd +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libunistring-0.9.10-15.el9.i686.rpm,792600a879fbd94ce4bf249713b0cb3a166c147cfad397e8a15e6b4f01c75997 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libunistring-0.9.10-15.el9.x86_64.rpm,d2f86fbee729a4900a433a6c52a3cb95d9b52b1d79c9e719ee3ef509813eb6d9 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libzstd-1.5.1-2.el9.i686.rpm,e98f253d6f5f9acf2ded628cd98f50a54a031e354bf7bb2efc3fe39f9899fe49 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/libzstd-1.5.1-2.el9.x86_64.rpm,2e5215e225cec2db43d92c3b3380812a6f8684e881ed415670299e1e0fe7d1ce +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/lz4-libs-1.9.3-5.el9.i686.rpm,c308ba7380a3b5c5337c919150f0234342b64c1ea696d6207c2b790b82ba4669 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/lz4-libs-1.9.3-5.el9.x86_64.rpm,439e701491af6a957ac4d7dc69cccee1a945333f19d8bfcbd896b5119af01aab +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/ncurses-libs-6.2-10.20210508.el9.i686.rpm,285db6dc6f610f75ef6863dcb0a383eae394c2b33bff283189cb49ac7fae4c58 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/ncurses-libs-6.2-10.20210508.el9.x86_64.rpm,d06b0e491481a345faf21a69666cbdc302d19b54fb29ae1aa78fa6b205f9e604 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/nettle-3.9.1-1.el9.i686.rpm,e5610fe3b25cfca1616440e1a8a7489fd37b0852f182fdda87ab8e196d981970 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/nettle-3.9.1-1.el9.x86_64.rpm,9786b6610d17aa495fb640ba6d046bf73704915b82d12e6d8339090ff4891de5 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/p11-kit-0.25.3-3.el9_5.i686.rpm,abe4ab924b405c236eaf3fa067fed50ac66d15d0ef42c782a745788c1a9c5b91 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/p11-kit-0.25.3-3.el9_5.x86_64.rpm,0e1bd97e697a9fa3b4e508b945cf352b73b06e4e8218c14ac5fb912b0022c646 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/pam-1.5.1-22.el9_5.i686.rpm,f2ae4441fc667cdcb930e7a2cfe90f7342e7d1c8848d6d18cb350ba68e025862 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/pam-1.5.1-22.el9_5.x86_64.rpm,15bfe177d3c10982c75e81d7b274883a9fb53322011c8d829667c983ee419b18 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/pciutils-libs-3.7.0-5.el9.i686.rpm,2cf468da5ecf307cc325c9a5da0a288aafd25dec0951af2b4d0954a77bdf900d +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/pciutils-libs-3.7.0-5.el9.x86_64.rpm,308bd897d8f9a36020d70edc79089a3595b22b149200d67c37e2d4e6147a9f75 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/sqlite-libs-3.34.1-7.el9_3.i686.rpm,dc6946a8344b8f4f476fef9479d1786c86fdcd045e988ab5d85fef7780e1fae4 +https://vault.almalinux.org/9.5/BaseOS/x86_64/os/Packages/sqlite-libs-3.34.1-7.el9_3.x86_64.rpm,e7f87444f24a03b37caa02942082b6d4283067ecbbd3f7798f882d22b55713cf diff --git a/box64-bundle-x86-libs.sh b/box64-bundle-x86-libs.sh new file mode 100755 index 0000000..bf9bf24 --- /dev/null +++ b/box64-bundle-x86-libs.sh @@ -0,0 +1,128 @@ +#!/bin/sh + +set -ex + +trap cleanup_exit INT TERM EXIT + +cleanup_exit() +{ + echo "Running cleanup_exit..." + rm -rf /tmp/box64-bundle.* +} + +# we must have few tools +awk=$(which awk) || { echo "E: You must have awk" && exit 1; } +cpio=$(which cpio) || { echo "E: You must have cpio" && exit 1; } +curl=$(which curl) || { echo "E: You must have curl" && exit 1; } +curl_cmd="${curl} --connect-timeout 5 --retry 5 --retry-delay 1 --create-dirs -fsSLo" +rpm2cpio=$(which rpm2cpio) || { echo "E: You must have rpm2cpio" && exit 1; } +sha256sum=$(which sha256sum) || { echo "E: You must have sha256sum" && exit 1; } +unzip=$(which unzip) || { echo "E: You must have unzip" && exit 1; } + +current_dir=$(pwd) +dir_tmp="$(mktemp -d /tmp/box64-bundle.XXXXXX)" + +# download the packages +while IFS= read -r line; do + # shellcheck disable=SC2016 + pkg_url=$(echo "${line}" | ${awk} -F',' '{print$(NF-1)}') + # shellcheck disable=SC2016 + pkg_checksum=$(echo "${line}" | ${awk} -F',' '{print$(NF)}') + # shellcheck disable=SC2016 + pkg_name=$(echo "${pkg_url}" | ${awk} -F'/' '{print$(NF)}') + ${curl_cmd} "${dir_tmp}/bundle-pkgs/${pkg_name}" "${pkg_url}" + checksum="$(${sha256sum} "${dir_tmp}/bundle-pkgs/${pkg_name}" | awk '{print $1}')" + if [ "${pkg_checksum}" != "${checksum}" ]; then + echo "E: Invalid checksum for ${pkg_name}" + echo "Expected: ${pkg_checksum}" + echo "Computed: ${checksum}" + exit 1 + fi +done < box64-bundle-x86-libs.csv + +# generate the bundle packages archive +tar -C "${dir_tmp}"/bundle-pkgs -czvf "${current_dir}"/box64-bundle-x86-pkgs.tar.gz . + +# extract the packages +cd "${dir_tmp}"/bundle-pkgs +for file in *.deb *.eopkg *.rpm *.xbps; do + # handle the case of no files, e.g. xbps + [ -e "${dir_tmp}"/bundle-pkgs/"${file}" ] || break + # shellcheck disable=SC2016 + extension=$(echo "${file}" | ${awk} -F'.' '{print$(NF)}') + mkdir -p "${dir_tmp}"/bundle-libs + cd "${dir_tmp}"/bundle-libs + case "${extension}" in + deb) + echo "I: DEB (Debian) package detected (${file})" + ar x "${dir_tmp}"/bundle-pkgs/"${file}" + tar -xf data.tar* + ;; + eopkg) + echo "I: EOPKG (Solus Linux) package detected (${file})" + ${unzip} -o "${dir_tmp}"/bundle-pkgs/"${file}" + tar -xf install.tar.xz + ;; + rpm) + echo "I: RPM (Fedora) detected (${file})" + ${rpm2cpio} "${dir_tmp}"/bundle-pkgs/"${file}" | ${cpio} -idmv + ;; + xbps) + echo "I: XBPS (Void Linux) package detected (${file})" + tar -xf "${dir_tmp}"/bundle-pkgs/"${file}" + ;; + esac +done + +# reorganize the files +cd "${dir_tmp}"/bundle-libs +mkdir -p "${dir_tmp}"/bundle-libs/box64-i386-linux-gnu +mv lib/*.so* usr/lib/*.so* usr/lib/i386-linux-gnu/*.so* usr/lib32/*.so* \ + "${dir_tmp}"/bundle-libs/box64-i386-linux-gnu +mkdir -p "${dir_tmp}"/bundle-libs/box64-x86_64-linux-gnu +mv lib64/*.so* usr/lib/x86_64-linux-gnu/*.so* usr/lib64/*.so* \ + "${dir_tmp}"/bundle-libs/box64-x86_64-linux-gnu +rm -f ./*.tar.* debian-binary files.xml metadata.xml +rm -rf ./lib* etc run sbin usr var +mkdir -p usr/lib +mv box64-*-linux-gnu usr/lib + +# remove libraries that cannot be emulated +# https://github.com/ptitSeb/box64/blob/v0.3.8/src/librarian/library.c#L433 +set -- libc libpthread librt libGL libX11 libasound libdl libm libbsd libutil \ + libresolv libXxf86vm libXinerama libXrandr libXext libXfixes libXcursor \ + libXrender libXft libXi libXss libXpm libXau libXdmcp libX11-xcb libxcb \ + libxcb-xfixes libxcb-shape libxcb-shm libxcb-randr libxcb-image \ + libxcb-keysyms libxcb-xtest libxcb-glx libxcb-dri2 libxcb-dri3 libXtst libXt \ + libXcomposite libXdamage libXmu libxkbcommon libxkbcommon-x11 \ + libpulse-simple libpulse libvulkan ld-linux-x86-64 crashhandler \ + libtcmalloc_minimal libanl ld-linux libthread_db +for file in "$@"; do + rm -f "${dir_tmp}"/bundle-libs/usr/lib/box64-*-linux-gnu/"${file}".so* +done + +# check broken symlinks +if find "${dir_tmp}"/bundle-libs -type l ! -exec test -e {} \; -print | grep bundle-libs; then + echo "E: Broken symlinks found" + exit 1 +fi + +# create shared libraries (.so) symlinks +# if multiple libraries of the same name exist, it will symlink the oldest version +# e.g. libcurl-gnutls soname with versioned symbols (CURL_GNUTLS_3, CURL_GNUTLS_4) +# libcurl-gnutls.so -> libcurl-gnutls.so.3 +# libcurl-gnutls.so.3 -> libcurl-gnutls.so.4 +# libcurl-gnutls.so.4 -> libcurl-gnutls.so.4.7.0 +# libcurl-gnutls.so.4.7.0 +for dir_lib in "${dir_tmp}"/bundle-libs/usr/lib/box64-*-linux-gnu; do + cd "${dir_lib}" + for lib in lib*.so*; do + lib_base="$(echo "${lib}" | awk -F'.' '{print $1"."$2}')" + if ! ls "${dir_lib}/${lib_base}" 2> /dev/null; then + ln -s "${lib}" "${lib_base}" + fi + done +done + +# generate the bundle libraries archive +tar -C "${dir_tmp}"/bundle-libs -czvf "${current_dir}"/box64-bundle-x86-libs.tar.gz . diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index 4c07dc7..adad518 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -7,15 +7,15 @@ string(REGEX REPLACE "\n" ";" files "${files}") foreach(file ${files}) message(STATUS "Uninstalling $ENV{DESTDIR}${file}") if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + execute_process( + COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}" + RESULT_VARIABLE rm_retval OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval + ERROR_VARIABLE rm_out + OUTPUT_STRIP_TRAILING_WHITESPACE ) if(NOT "${rm_retval}" STREQUAL 0) message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") - endif(NOT "${rm_retval}" STREQUAL 0) - else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - message(STATUS "File $ENV{DESTDIR}${file} does not exist.") - endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + endif() + endif() endforeach(file) diff --git a/debian/box64-rk3399.docs b/debian/box64-rk3399.docs new file mode 100644 index 0000000..f6832bf --- /dev/null +++ b/debian/box64-rk3399.docs @@ -0,0 +1,6 @@ +README.md +docs/BUNDLE-X86-LIBS.md +docs/CHANGELOG.md +docs/COMPILE.md +docs/USAGE.md +docs/WINE.md diff --git a/debian/box64-rk3399.examples b/debian/box64-rk3399.examples new file mode 100644 index 0000000..e55dfb0 --- /dev/null +++ b/debian/box64-rk3399.examples @@ -0,0 +1,2 @@ +box64-bundle-x86-libs.sh +install_steam.sh diff --git a/debian/box64-rk3399.install b/debian/box64-rk3399.install new file mode 100644 index 0000000..2a99bce --- /dev/null +++ b/debian/box64-rk3399.install @@ -0,0 +1,4 @@ +debian/tmp.RK3399/etc/binfmt.d/box32.conf /usr/lib/binfmt.d +debian/tmp.RK3399/etc/binfmt.d/box64.conf /usr/lib/binfmt.d +debian/tmp.RK3399/etc/box64.box64rc /etc +debian/tmp.RK3399/usr/bin/box64 /usr/bin diff --git a/debian/box64-rk3399.manpages b/debian/box64-rk3399.manpages new file mode 100644 index 0000000..ea03297 --- /dev/null +++ b/debian/box64-rk3399.manpages @@ -0,0 +1 @@ +docs/box64.1 diff --git a/debian/box64-rk3588.docs b/debian/box64-rk3588.docs index f5d0050..f6832bf 100644 --- a/debian/box64-rk3588.docs +++ b/debian/box64-rk3588.docs @@ -1,3 +1,6 @@ README.md +docs/BUNDLE-X86-LIBS.md +docs/CHANGELOG.md +docs/COMPILE.md docs/USAGE.md -docs/X64WINE.md +docs/WINE.md diff --git a/debian/box64-rk3588.examples b/debian/box64-rk3588.examples new file mode 100644 index 0000000..e55dfb0 --- /dev/null +++ b/debian/box64-rk3588.examples @@ -0,0 +1,2 @@ +box64-bundle-x86-libs.sh +install_steam.sh diff --git a/debian/box64-rk3588.install b/debian/box64-rk3588.install index 2feec4f..73e39ec 100644 --- a/debian/box64-rk3588.install +++ b/debian/box64-rk3588.install @@ -1,3 +1,4 @@ -debian/tmp.RK3588/etc/box64.box64rc /etc +debian/tmp.RK3588/etc/binfmt.d/box32.conf /usr/lib/binfmt.d debian/tmp.RK3588/etc/binfmt.d/box64.conf /usr/lib/binfmt.d +debian/tmp.RK3588/etc/box64.box64rc /etc debian/tmp.RK3588/usr/bin/box64 /usr/bin diff --git a/debian/box64-rpi3.docs b/debian/box64-rpi3.docs new file mode 100644 index 0000000..f6832bf --- /dev/null +++ b/debian/box64-rpi3.docs @@ -0,0 +1,6 @@ +README.md +docs/BUNDLE-X86-LIBS.md +docs/CHANGELOG.md +docs/COMPILE.md +docs/USAGE.md +docs/WINE.md diff --git a/debian/box64-rpi3.examples b/debian/box64-rpi3.examples new file mode 100644 index 0000000..e55dfb0 --- /dev/null +++ b/debian/box64-rpi3.examples @@ -0,0 +1,2 @@ +box64-bundle-x86-libs.sh +install_steam.sh diff --git a/debian/box64-rpi3.install b/debian/box64-rpi3.install new file mode 100644 index 0000000..1e8fc05 --- /dev/null +++ b/debian/box64-rpi3.install @@ -0,0 +1,4 @@ +debian/tmp.RPI3ARM64/etc/binfmt.d/box32.conf /usr/lib/binfmt.d +debian/tmp.RPI3ARM64/etc/binfmt.d/box64.conf /usr/lib/binfmt.d +debian/tmp.RPI3ARM64/etc/box64.box64rc /etc +debian/tmp.RPI3ARM64/usr/bin/box64 /usr/bin diff --git a/debian/box64-rpi3.manpages b/debian/box64-rpi3.manpages new file mode 100644 index 0000000..ea03297 --- /dev/null +++ b/debian/box64-rpi3.manpages @@ -0,0 +1 @@ +docs/box64.1 diff --git a/debian/box64-rpi4.docs b/debian/box64-rpi4.docs index f5d0050..f6832bf 100644 --- a/debian/box64-rpi4.docs +++ b/debian/box64-rpi4.docs @@ -1,3 +1,6 @@ README.md +docs/BUNDLE-X86-LIBS.md +docs/CHANGELOG.md +docs/COMPILE.md docs/USAGE.md -docs/X64WINE.md +docs/WINE.md diff --git a/debian/box64-rpi4.examples b/debian/box64-rpi4.examples new file mode 100644 index 0000000..e55dfb0 --- /dev/null +++ b/debian/box64-rpi4.examples @@ -0,0 +1,2 @@ +box64-bundle-x86-libs.sh +install_steam.sh diff --git a/debian/box64-rpi4.install b/debian/box64-rpi4.install index e42b04a..d9595b9 100644 --- a/debian/box64-rpi4.install +++ b/debian/box64-rpi4.install @@ -1,3 +1,4 @@ -debian/tmp.RPI4ARM64/etc/box64.box64rc /etc +debian/tmp.RPI4ARM64/etc/binfmt.d/box32.conf /usr/lib/binfmt.d debian/tmp.RPI4ARM64/etc/binfmt.d/box64.conf /usr/lib/binfmt.d +debian/tmp.RPI4ARM64/etc/box64.box64rc /etc debian/tmp.RPI4ARM64/usr/bin/box64 /usr/bin diff --git a/debian/box64-rpi5.docs b/debian/box64-rpi5.docs new file mode 100644 index 0000000..f6832bf --- /dev/null +++ b/debian/box64-rpi5.docs @@ -0,0 +1,6 @@ +README.md +docs/BUNDLE-X86-LIBS.md +docs/CHANGELOG.md +docs/COMPILE.md +docs/USAGE.md +docs/WINE.md diff --git a/debian/box64-rpi5.examples b/debian/box64-rpi5.examples new file mode 100644 index 0000000..e55dfb0 --- /dev/null +++ b/debian/box64-rpi5.examples @@ -0,0 +1,2 @@ +box64-bundle-x86-libs.sh +install_steam.sh diff --git a/debian/box64-rpi5.install b/debian/box64-rpi5.install new file mode 100644 index 0000000..6b705bb --- /dev/null +++ b/debian/box64-rpi5.install @@ -0,0 +1,4 @@ +debian/tmp.RPI5ARM64/etc/binfmt.d/box32.conf /usr/lib/binfmt.d +debian/tmp.RPI5ARM64/etc/binfmt.d/box64.conf /usr/lib/binfmt.d +debian/tmp.RPI5ARM64/etc/box64.box64rc /etc +debian/tmp.RPI5ARM64/usr/bin/box64 /usr/bin diff --git a/debian/box64-rpi5.manpages b/debian/box64-rpi5.manpages new file mode 100644 index 0000000..ea03297 --- /dev/null +++ b/debian/box64-rpi5.manpages @@ -0,0 +1 @@ +docs/box64.1 diff --git a/debian/box64.docs b/debian/box64.docs index 0a74f14..f6832bf 100644 --- a/debian/box64.docs +++ b/debian/box64.docs @@ -1,5 +1,6 @@ README.md +docs/BUNDLE-X86-LIBS.md docs/CHANGELOG.md docs/COMPILE.md docs/USAGE.md -docs/X64WINE.md +docs/WINE.md diff --git a/debian/box64.examples b/debian/box64.examples new file mode 100644 index 0000000..e55dfb0 --- /dev/null +++ b/debian/box64.examples @@ -0,0 +1,2 @@ +box64-bundle-x86-libs.sh +install_steam.sh diff --git a/debian/box64.install b/debian/box64.install index e1a0ae8..28a84a2 100755 --- a/debian/box64.install +++ b/debian/box64.install @@ -2,9 +2,16 @@ [arm64] debian/tmp.ARM_DYNAREC/usr/bin/box64 /usr/bin [arm64] debian/tmp.ARM_DYNAREC/etc/box64.box64rc /etc [arm64] debian/tmp.ARM_DYNAREC/etc/binfmt.d/box64.conf /usr/lib/binfmt.d +[arm64] debian/tmp.ARM_DYNAREC/etc/binfmt.d/box32.conf /usr/lib/binfmt.d [ppc64el] debian/tmp.PPC64LE/usr/bin/box64 /usr/bin [ppc64el] debian/tmp.PPC64LE/etc/box64.box64rc /etc [ppc64el] debian/tmp.PPC64LE/etc/binfmt.d/box64.conf /usr/lib/binfmt.d +[ppc64el] debian/tmp.PPC64LE/etc/binfmt.d/box32.conf /usr/lib/binfmt.d [riscv64] debian/tmp.RV64/usr/bin/box64 /usr/bin [riscv64] debian/tmp.RV64/etc/box64.box64rc /etc [riscv64] debian/tmp.RV64/etc/binfmt.d/box64.conf /usr/lib/binfmt.d +[riscv64] debian/tmp.RV64/etc/binfmt.d/box32.conf /usr/lib/binfmt.d +[loong64] debian/tmp.LARCH64/usr/bin/box64 /usr/bin +[loong64] debian/tmp.LARCH64/etc/box64.box64rc /etc +[loong64] debian/tmp.LARCH64/etc/binfmt.d/box64.conf /usr/lib/binfmt.d +[loong64] debian/tmp.LARCH64/etc/binfmt.d/box32.conf /usr/lib/binfmt.d diff --git a/debian/changelog b/debian/changelog index f946c55..6053ba4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,38 @@ +box64 (0.4.0+dfsg-0deepin1) unstable; urgency=medium + + * New upstream version 0.4.0 + + -- Chang Yang Fri, 06 Feb 2026 10:09:08 +0800 + +box64 (0.3.8+dfsg-1) unstable; urgency=medium + + * New upstream version 0.3.8 + * debian/copyright: exclude tests/misc/gclosure and tests/test32 + * debian/copyright: exclude auto-generated documentation + * debian/*.examples: install install_steam.sh as an example script + * debian/*.install: install box32.conf into /usr/lib/binfmt.d + * debian/*.examples: install box64-bundle-x86-libs.sh as an example script + * debian/*.docs: fix X64WINE.md->WINE.md and add BUNDLE-X86-LIBS.md + * debian/control,debian/tests/control: wrap-and-sort -astb + * add patch to fix typos + * debian/rules: build docs/USAGE.md and docs/box64.pod + + -- Johannes Schauer Marin Rodrigues Sun, 19 Oct 2025 03:29:45 +0200 + +box64 (0.3.4+dfsg-1) unstable; urgency=medium + + [ Johannes Schauer Marin Rodrigues ] + * debian/control: add Vcs-* headers. + Thanks to Otto Kekäläinen + * debian/copyright: exclude new binaries + * drop patches + * debian/rules: build box32 + + [ Otto Kekäläinen ] + * Update git repository layout to follow DEP14 and DEP18 + + -- Johannes Schauer Marin Rodrigues Thu, 24 Apr 2025 11:54:47 +0200 + box64 (0.3.0+dfsg-1) unstable; urgency=medium * New upstream version 0.3.0+dfsg diff --git a/debian/control b/debian/control index c66dafc..ba2afcc 100644 --- a/debian/control +++ b/debian/control @@ -3,25 +3,30 @@ Section: utils Priority: optional Maintainer: Johannes Schauer Marin Rodrigues Build-Depends: - cmake, debhelper-compat (= 13), dh-exec, + cmake, ninja-build, python3:native, Standards-Version: 4.6.2 Homepage: https://github.com/ptitSeb/box64 +Vcs-Browser: https://salsa.debian.org/debian/box64 +Vcs-Git: https://salsa.debian.org/debian/box64.git Rules-Requires-Root: no Package: box64 -Architecture: arm64 ppc64el riscv64 +Architecture: arm64 ppc64el riscv64 loong64 Depends: libgcc-s1:amd64 | libgcc-s1-amd64-cross, libstdc++6:amd64 | libstdc++6-amd64-cross, ${misc:Depends}, ${shlibs:Depends}, Conflicts: + box64-rk3399, box64-rk3588, + box64-rpi3, box64-rpi4, + box64-rpi5, Description: run amd64 binaries on arm64 without emulating library calls Using DynaRec on arm64, box64 will dynamically recompile x64_64 code to aarch64 but will also translate calls to foreign library functions to @@ -33,6 +38,27 @@ Description: run amd64 binaries on arm64 without emulating library calls This package contains the generic executable without optimization for a specific platform. +Package: box64-rk3399 +Architecture: arm64 +Depends: + libgcc-s1:amd64 | libgcc-s1-amd64-cross, + libstdc++6:amd64 | libstdc++6-amd64-cross, + ${misc:Depends}, + ${shlibs:Depends}, +Conflicts: + box64, + box64-rk3588, + box64-rpi3, + box64-rpi4, + box64-rpi5, +Description: run amd64 binaries on RK3399 without emulating library calls + Using DynaRec on arm64, box64 will dynamically recompile x64_64 code to + aarch64 but will also translate calls to foreign library functions to + native library calls. This usually makes amd64 executables run via + box64 much faster than emulating amd64 on arm64 via qemu which will + emulate everything down to the C library. For example OpenArena emulated + with box64 will be at about 85% of its native speed. + Package: box64-rk3588 Architecture: arm64 Depends: @@ -42,7 +68,10 @@ Depends: ${shlibs:Depends}, Conflicts: box64, + box64-rk3399, + box64-rpi3, box64-rpi4, + box64-rpi5, Description: run amd64 binaries on RK3588 without emulating library calls Using DynaRec on arm64, box64 will dynamically recompile x64_64 code to aarch64 but will also translate calls to foreign library functions to @@ -54,6 +83,27 @@ Description: run amd64 binaries on RK3588 without emulating library calls This package is optimized with -mcpu=cortex-a76.cortex-a55+crypto and built with workaround for incoherent si_info on SIGSEGV. +Package: box64-rpi3 +Architecture: arm64 +Depends: + libgcc-s1:amd64 | libgcc-s1-amd64-cross, + libstdc++6:amd64 | libstdc++6-amd64-cross, + ${misc:Depends}, + ${shlibs:Depends}, +Conflicts: + box64, + box64-rk3399, + box64-rk3588, + box64-rpi4, + box64-rpi5, +Description: run amd64 binaries on RPI5 without emulating library calls + Using DynaRec on arm64, box64 will dynamically recompile x64_64 code to + aarch64 but will also translate calls to foreign library functions to + native library calls. This usually makes amd64 executables run via + box64 much faster than emulating amd64 on arm64 via qemu which will + emulate everything down to the C library. For example OpenArena emulated + with box64 will be at about 85% of its native speed. + Package: box64-rpi4 Architecture: arm64 Depends: @@ -63,7 +113,10 @@ Depends: ${shlibs:Depends}, Conflicts: box64, + box64-rk3399, box64-rk3588, + box64-rpi3, + box64-rpi5, Description: run amd64 binaries on RPI4 without emulating library calls Using DynaRec on arm64, box64 will dynamically recompile x64_64 code to aarch64 but will also translate calls to foreign library functions to @@ -73,3 +126,24 @@ Description: run amd64 binaries on RPI4 without emulating library calls with box64 will be at about 85% of its native speed. . This package is optimized with -march=armv8-a+crc -mtune=cortex-a72. + +Package: box64-rpi5 +Architecture: arm64 +Depends: + libgcc-s1:amd64 | libgcc-s1-amd64-cross, + libstdc++6:amd64 | libstdc++6-amd64-cross, + ${misc:Depends}, + ${shlibs:Depends}, +Conflicts: + box64, + box64-rk3399, + box64-rk3588, + box64-rpi3, + box64-rpi4, +Description: run amd64 binaries on RPI5 without emulating library calls + Using DynaRec on arm64, box64 will dynamically recompile x64_64 code to + aarch64 but will also translate calls to foreign library functions to + native library calls. This usually makes amd64 executables run via + box64 much faster than emulating amd64 on arm64 via qemu which will + emulate everything down to the C library. For example OpenArena emulated + with box64 will be at about 85% of its native speed. diff --git a/debian/copyright b/debian/copyright index 23f5213..c7ccd09 100644 --- a/debian/copyright +++ b/debian/copyright @@ -6,15 +6,18 @@ Files-Excluded: .github .gitignore .travis.yml - LLVMprivateGenerator debian + docs/box64.pod + docs/USAGE.md pkgbuilds src/wrapped/generated - tests/benchfloat_android - tests/extensions/mmx_android - tests/bash tests/benchfloat + tests/benchfloat_android + tests/box64-bash tests/extensions/mmx + tests/extensions/mmx_android + tests/misc/gclosure + tests/misc/gvariant tests/test01 tests/test01_android tests/test02 @@ -54,6 +57,7 @@ Files-Excluded: tests/test20 tests/test20_android tests/test21 + tests/test21_alt tests/test21_android tests/test22 tests/test22_android @@ -72,7 +76,51 @@ Files-Excluded: tests/test29 tests/test29_android tests/test30 + tests/test31 + tests/test32 + tests32/bash + tests32/benchfloat + tests32/extensions/mmx + tests32/test01 + tests32/test02 + tests32/test03 + tests32/test04 + tests32/test05 + tests32/test06 + tests32/test07 + tests32/test08 + tests32/test09 + tests32/test10 + tests32/test11 + tests32/test12 + tests32/test13 + tests32/test14 + tests32/test15 + tests32/test15_dv1.so + tests32/test15_v1.so + tests32/test15_v2.so + tests32/test16 + tests32/test16_dv1.so + tests32/test16_v1.so + tests32/test16_v2.so + tests32/test17 + tests32/test17_o2 + tests32/test18 + tests32/test19 + tests32/test20 + tests32/test21 + tests32/test21_v1.so + tests32/test21_v2.so + tests32/test22 + tests32/test23 + tests32/test24 + tests32/test25 + tests32/test26 + x64android x64lib + x86android + x86lib + Files: * Copyright: © 2022 Sebastien Chevalier diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..fd76e48 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,52 @@ +[DEFAULT] +# DEP14 format +debian-branch = debian/latest +upstream-branch = upstream/latest + +# Always use pristine tar +pristine-tar = True + +# Configure the upstream tag format below, so that 'gbp import-orig' will run +# correctly, and link tarball import branch ('upstream/latest') with the +# equivalent upstream release tag, showing a complete audit trail of what +# upstream released and what was imported into Debian. +upstream-vcs-tag = v%(version%~%.)s + +# Note: if the versionmangle in d/watch forces +dfsg on tags, try giving +# upstream version manually, e.g.: +# gbp import-orig --uscan --upstream-vcs-tag=v0.3.0 + +# If upstream publishes tarball signatures, git-buildpackage will by default +# import and use the them. Change this to 'on' to make 'gbp import-orig' abort +# if the signature is not found or is not valid. +# +# Note: box64 does not yet sign their tarball releases at +# https://github.com/ptitSeb/box64/releases +#upstream-signatures = on + +# Ensure the Debian maintainer signs git tags automatically +sign-tags = True + +# Ease dropping / adding patches +patch-numbers = False + +# Group debian/changelog entries with the same "[ Author ]" instead of making +# multiple ones for the same author +multimaint-merge = True + +# Ensure a human always reviews all the debian/changelog entries +spawn-editor = always + +# No need to confirm package name or version at any time, git-buildpackage +# always gets it right +interactive = False + +# Ensure we always target Debian on Debian branches +dch-opt = --vendor=debian + +# If this package ever needs to be maintained for Ubuntu, remember to override +# the branch, tag and commit messages +#debian-branch = ubuntu/24.04-noble +#debian-tag = ubuntu/%(version)s +#debian-tag-msg = %(pkg)s Ubuntu release %(version)s +#dch-opt = --vendor=ubuntu diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 5299247..0000000 --- a/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -spelling.patch diff --git a/debian/patches/spelling.patch b/debian/patches/spelling.patch deleted file mode 100644 index afd20f8..0000000 --- a/debian/patches/spelling.patch +++ /dev/null @@ -1,465 +0,0 @@ -From 0ff8846d7f56aa4d536c2f74893c75d961b44d4c Mon Sep 17 00:00:00 2001 -From: Johannes Schauer Marin Rodrigues -Date: Wed, 10 Jul 2024 10:49:28 +0200 -Subject: [PATCH] fix some spelling - ---- - docs/USAGE.md | 14 +++++------ - docs/box64.pod | 14 +++++------ - src/core.c | 4 +-- - src/custommem.c | 2 +- - src/dynarec/arm64/dynarec_arm64_00.c | 2 +- - src/dynarec/arm64/dynarec_arm64_66.c | 2 +- - src/dynarec/arm64/dynarec_arm64_d9.c | 2 +- - src/dynarec/arm64/dynarec_arm64_functions.c | 4 +-- - src/dynarec/arm64/dynarec_arm64_functions.h | 2 +- - src/dynarec/arm64/dynarec_arm64_helper.h | 28 ++++++++++----------- - src/dynarec/dynarec_native_functions.c | 2 +- - src/dynarec/dynarec_native_functions.h | 2 +- - src/dynarec/rv64/dynarec_rv64_00_2.c | 2 +- - src/dynarec/rv64/dynarec_rv64_66.c | 2 +- - src/emu/x64syscall.c | 4 +-- - src/libtools/signals.c | 2 +- - src/tools/rcfile.c | 2 +- - 17 files changed, 45 insertions(+), 45 deletions(-) - -diff --git a/docs/USAGE.md b/docs/USAGE.md -index bdac4b15..3b98b973 100644 ---- a/docs/USAGE.md -+++ b/docs/USAGE.md -@@ -143,7 +143,7 @@ Enables/Disables trace for generated code. - * 1 : Enable trace for generated code (like regular Trace, this will slow down the program a lot and generate huge logs). - - #### BOX64_NODYNAREC * --Forbid dynablock creation in the interval specified (helpfull for debugging behaviour difference between Dynarec and Interpreter) -+Forbid dynablock creation in the interval specified (helpful for debugging behaviour difference between Dynarec and Interpreter) - * 0xXXXXXXXX-0xYYYYYYYY : define the interval where dynablock cannot start (inclusive-exclusive) - - #### BOX64_DYNAREC_TEST * -@@ -214,7 +214,7 @@ Detect libjvm and apply conservative settings. Obsolete, use BOX64_JVM instead. - * 1 : Detect libjvm, and apply BIGBLOCK=0 STRONGMEM=1 SSE42=0 if detected (Default) - - #### BOX64_DYNAREC_WAIT * --Behavior with FillBlock is not availble (FillBlock build Dynarec blocks and is not multithreaded) -+Behavior with FillBlock is not available (FillBlock build Dynarec blocks and is not multithreaded) - * 0 : Dynarec will not wait for FillBlock to ready and use Interpreter instead (might speedup a bit massive multithread or JIT programs) - * 1 : Dynarec will wait for FillBlock to be ready (Default) - -@@ -270,12 +270,12 @@ Need a workaround for SDL_GetJoystickGUIDInfo function for wrapped SDL2 - - #### BOX64_LD_PRELOAD - * XXXX[:YYYYY] force loading XXXX (and YYYY...) libraries with the binary -- PreLoaded libs can be emulated or native, and are treated the same way as if they were comming from the binary -+ PreLoaded libs can be emulated or native, and are treated the same way as if they were coming from the binary - - #### BOX64_EMULATED_LIBS * - * XXXX[:YYYYY] force lib XXXX (and YYYY...) to be emulated (and not wrapped) - Some games uses an old version of some libraries, with an ABI incompatible with native version. --Note that LittleInferno for example is auto detected, and libvorbis.so.0 is automatical added to emulated libs, and same for Don't Starve (and Together / Server variant) that use an old SDL2 too -+Note that LittleInferno for example is auto detected, and libvorbis.so.0 is automatically added to emulated libs, and same for Don't Starve (and Together / Server variant) that use an old SDL2 too - - #### BOX64_ALLOWMISSINGLIBS * - Allow Box64 to continue even if a library is missing. -@@ -289,13 +289,13 @@ Box64 will use wrapped libs even if the lib is specified with absolute path - - #### BOX64_PREFER_EMULATED * - Box64 will prefer emulated libs first (execpt for glibc, alsa, pulse, GL, vulkan and X11 -- * 0 : Native libs are prefered (Default.) -- * 1 : Emulated libs are prefered (Default for program running inside pressure-vessel) -+ * 0 : Native libs are preferred (Default.) -+ * 1 : Emulated libs are preferred (Default for program running inside pressure-vessel) - - #### BOX64_CRASHHANDLER * - Box64 will use a dummy crashhandler.so library - * 0 : Use Emulated crashhandler.so library if needed -- * 1 : Use an internal dummy (completly empty) crashhandler.so library (defaut) -+ * 1 : Use an internal dummy (completely empty) crashhandler.so library (default) - - #### BOX64_MALLOC_HACK * - How Box64 will handle hooking of malloc operators -diff --git a/docs/box64.pod b/docs/box64.pod -index 7a99dc5b..d946dfcd 100644 ---- a/docs/box64.pod -+++ b/docs/box64.pod -@@ -77,7 +77,7 @@ When set to 1, don't prints the banner including version and build. - =item B=I[:I:...] - - Force loading libraries with the binary. PreLoaded libs can be emulated or --native, and are treated the same way as if they were comming from the binary. -+native, and are treated the same way as if they were coming from the binary. - - =item B=I - -@@ -263,7 +263,7 @@ down the program a lot and generate huge logs. - - =item B=I<0xXXXXXXXX-0xYYYYYYYY> - --Forbid dynablock creation in the interval specified (helpfull for debugging -+Forbid dynablock creation in the interval specified (helpful for debugging - behaviour difference between Dynarec and Interpreter) - - =item B=I<0|1> -@@ -343,7 +343,7 @@ Detect MonoBleedingEdge and apply conservative settings - - =item B=I<0|1> - --Behavior with FillBlock is not availble (FillBlock build Dynarec blocks and is not multithreaded) -+Behavior with FillBlock is not available (FillBlock build Dynarec blocks and is not multithreaded) - - * 0 : Dynarec will not wait for FillBlock to ready and use Interpreter instead (might speedup a bit massive multithread or JIT programs) - * 1 : Dynarec will wait for FillBlock to be ready (Default) -@@ -388,7 +388,7 @@ You can also use B - Force lib XXXX (and YYYY...) to be emulated (and not wrapped) Some games uses - an old version of some libraries, with an ABI incompatible with native version. - Note that LittleInferno for example is auto detected, and libvorbis.so.0 is --automatical added to emulated libs, and same for Don't Starve (and Together / -+automatically added to emulated libs, and same for Don't Starve (and Together / - Server variant) that use an old SDL2 too - - =item B=I<0|1> -@@ -410,15 +410,15 @@ Box64 will use wrapped libs even if the lib is specified with absolute path - Box64 will prefer emulated libs first (execpt for glibc, alsa, pulse, GL, - vulkan and X11 - -- * 0 : Native libs are prefered (Default.) -- * 1 : Emulated libs are prefered (Default for program running inside pressure-vessel) -+ * 0 : Native libs are preferred (Default.) -+ * 1 : Emulated libs are preferred (Default for program running inside pressure-vessel) - - =item B=I<0|1> - - Box64 will use a dummy crashhandler.so library - - * 0 : Use Emulated crashhandler.so library if needed -- * 1 : Use an internal dummy (completly empty) crashhandler.so library (defaut) -+ * 1 : Use an internal dummy (completely empty) crashhandler.so library (default) - - =item B=I<0|1|2> - -diff --git a/src/core.c b/src/core.c -index 9ea4632b..1a9262c4 100644 ---- a/src/core.c -+++ b/src/core.c -@@ -1423,7 +1423,7 @@ void LoadEnvVars(box64context_t *context) - if(getenv("BOX64_SYNC_ROUNDING")) { - if (strcmp(getenv("BOX64_SYNC_ROUNDING"), "1")==0) { - box64_sync_rounding = 1; -- printf_log(LOG_INFO, "BOX64: Rouding mode with be synced with fesetround/fegetround\n"); -+ printf_log(LOG_INFO, "BOX64: Rounding mode will be synced with fesetround/fegetround\n"); - } - } - if(getenv("BOX64_PREFER_WRAPPED")) { -@@ -1672,7 +1672,7 @@ static void add_argv(const char* what) { - if(!strcmp(my_context->argv[i], what)) - there = 1; - if(!there) { -- printf_log(LOG_INFO, "Inserting \"%s\" to the argments\n", what); -+ printf_log(LOG_INFO, "Inserting \"%s\" to the arguments\n", what); - my_context->argv = (char**)box_realloc(my_context->argv, (my_context->argc+1)*sizeof(char*)); - my_context->argv[my_context->argc] = box_strdup(what); - my_context->argc++; -diff --git a/src/custommem.c b/src/custommem.c -index 28a0fdee..c8f8db66 100644 ---- a/src/custommem.c -+++ b/src/custommem.c -@@ -304,7 +304,7 @@ int printBlockCoherent(int i) - m = n; - } - if(m!=last) { -- printf_log(LOG_NONE, "Last block %p is behond expexted block %p for block %d\n", m, last, i); -+ printf_log(LOG_NONE, "Last block %p is beyond expected block %p for block %d\n", m, last, i); - ret = 0; - } - -diff --git a/src/dynarec/arm64/dynarec_arm64_00.c b/src/dynarec/arm64/dynarec_arm64_00.c -index cd279330..5a638072 100644 ---- a/src/dynarec/arm64/dynarec_arm64_00.c -+++ b/src/dynarec/arm64/dynarec_arm64_00.c -@@ -1498,7 +1498,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin - SET_DFNONE(x1); - if(box64_wine) { // should this be done all the time? - TBZ_NEXT(xFlags, F_TF); -- // go to epilog, TF should trigger at end of next opcode, so using Interpretor only -+ // go to epilog, TF should trigger at end of next opcode, so using Interpreter only - jump_to_epilog(dyn, addr, 0, ninst); - } - break; -diff --git a/src/dynarec/arm64/dynarec_arm64_66.c b/src/dynarec/arm64/dynarec_arm64_66.c -index 12efb37b..0689651e 100644 ---- a/src/dynarec/arm64/dynarec_arm64_66.c -+++ b/src/dynarec/arm64/dynarec_arm64_66.c -@@ -728,7 +728,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin - SET_DFNONE(x1); - if(box64_wine) { // should this be done all the time? - TBZ_NEXT(xFlags, F_TF); -- // go to epilog, TF should trigger at end of next opcode, so using Interpretor only -+ // go to epilog, TF should trigger at end of next opcode, so using Interpreter only - jump_to_epilog(dyn, addr, 0, ninst); - } - break; -diff --git a/src/dynarec/arm64/dynarec_arm64_d9.c b/src/dynarec/arm64/dynarec_arm64_d9.c -index 53c3ad6e..9c8610be 100644 ---- a/src/dynarec/arm64/dynarec_arm64_d9.c -+++ b/src/dynarec/arm64/dynarec_arm64_d9.c -@@ -294,7 +294,7 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin - CALL(native_ftan, -1); - x87_unstackcount(dyn, ninst, x1, i1); - if(PK(0)==0xdd && PK(1)==0xd8) { -- MESSAGE(LOG_DUMP, "Optimized next DD D8 fstp st0, st0, not emiting 1\n"); -+ MESSAGE(LOG_DUMP, "Optimized next DD D8 fstp st0, st0, not emitting 1\n"); - u8 = F8; - u8 = F8; - } else { -diff --git a/src/dynarec/arm64/dynarec_arm64_functions.c b/src/dynarec/arm64/dynarec_arm64_functions.c -index 8fd0929e..ee1104e9 100644 ---- a/src/dynarec/arm64/dynarec_arm64_functions.c -+++ b/src/dynarec/arm64/dynarec_arm64_functions.c -@@ -598,7 +598,7 @@ void neoncacheUnwind(neoncache_t* cache) - - #define F8 *(uint8_t*)(addr++) - #define F32S64 (uint64_t)(int64_t)*(int32_t*)(addr+=4, addr-4) --// Get if ED will have the correct parity. Not emiting anything. Parity is 2 for DWORD or 3 for QWORD -+// Get if ED will have the correct parity. Not emitting anything. Parity is 2 for DWORD or 3 for QWORD - int getedparity(dynarec_arm_t* dyn, int ninst, uintptr_t addr, uint8_t nextop, int parity, int delta) - { - (void)dyn; (void)ninst; -@@ -794,4 +794,4 @@ void fpu_reset_ninst(dynarec_native_t* dyn, int ninst) - int fpu_is_st_freed(dynarec_native_t* dyn, int ninst, int st) - { - return (dyn->n.tags&(0b11<<(st*2)))?1:0; --} -\ No newline at end of file -+} -diff --git a/src/dynarec/arm64/dynarec_arm64_functions.h b/src/dynarec/arm64/dynarec_arm64_functions.h -index b6c95904..e87da74c 100644 ---- a/src/dynarec/arm64/dynarec_arm64_functions.h -+++ b/src/dynarec/arm64/dynarec_arm64_functions.h -@@ -58,7 +58,7 @@ int fpuCacheNeedsTransform(dynarec_arm_t* dyn, int ninst); - // Undo the changes of a neoncache to get the status before the instruction - void neoncacheUnwind(neoncache_t* cache); - --// Get if ED will have the correct parity. Not emiting anything. Parity is 2 for DWORD or 3 for QWORD -+// Get if ED will have the correct parity. Not emitting anything. Parity is 2 for DWORD or 3 for QWORD - int getedparity(dynarec_native_t* dyn, int ninst, uintptr_t addr, uint8_t nextop, int parity, int delta); - - const char* getCacheName(int t, int n); -diff --git a/src/dynarec/arm64/dynarec_arm64_helper.h b/src/dynarec/arm64/dynarec_arm64_helper.h -index 769082c3..dbc3c29f 100644 ---- a/src/dynarec/arm64/dynarec_arm64_helper.h -+++ b/src/dynarec/arm64/dynarec_arm64_helper.h -@@ -459,7 +459,7 @@ - #define GETVX_empty(a) \ - a = sse_get_reg_empty(dyn, ninst, x1, vex.v) - --// Get empty VX, and non-writen EX -+// Get empty VX, and non-written EX - #define GETVX_empty_EX(vx, ex, D) \ - GETEX_Y(ex, 0, D); \ - GETVX_empty(vx) -@@ -484,29 +484,29 @@ - b = ymm_get_reg(dyn, ninst, x1, vex.v, w2, gd, k1, k2); \ - a = ymm_get_reg_empty(dyn, ninst, x1, gd, vex.v, k1, k2) - --// Get empty GX, and non-writen VX and EX -+// Get empty GX, and non-written VX and EX - #define GETGX_empty_VXEX(gx, vx, ex, D) \ - GETVX(vx, 0); \ - GETEX_Y(ex, 0, D); \ - GETGX_empty(gx) - --// Get empty GX, and non-writen EX -+// Get empty GX, and non-written EX - #define GETGX_empty_EX(gx, ex, D) \ - GETEX_Y(ex, 0, D); \ - GETGX_empty(gx) - --// Get empty GX, and non-writen VX -+// Get empty GX, and non-written VX - #define GETGX_empty_VX(gx, vx) \ - GETVX(vx, 0); \ - GETGX_empty(gx) - --// Get EX and and non-writen VX and GX -+// Get EX and and non-written VX and GX - #define GETGXVXEX(gx, vx, ex, D) \ - GETVX(vx, 0); \ - GETEX_Y(ex, 1, D); \ - GETGX(gx, 0) - --// Get GX and and non-writen VX and EX -+// Get GX and and non-written VX and EX - #define GETGX_VXEX(gx, vx, ex, D) \ - GETVX(vx, 0); \ - GETEX_Y(ex, 0, D); \ -@@ -517,7 +517,7 @@ - GETGX(gx, 0); \ - GETEX_empty_Y(ex, D); - --// Get empty GY, and non-writen VY and EY -+// Get empty GY, and non-written VY and EY - #define GETGY_empty_VYEY(gy, vy, ey) \ - vy = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); \ - if(MODREG) \ -@@ -526,7 +526,7 @@ - VLDR128_U12(ey, ed, fixedaddress+16); \ - gy = ymm_get_reg_empty(dyn, ninst, x1, gd, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1) - --// Get EY and non-writen VY and GY -+// Get EY and non-written VY and GY - #define GETGYVYEY(gy, vy, ey) \ - vy = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); \ - if(MODREG) \ -@@ -535,7 +535,7 @@ - VLDR128_U12(ey, ed, fixedaddress+16); \ - gy = ymm_get_reg(dyn, ninst, x1, gd, 0, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1) - --// Get GY and non-writen VY and EY -+// Get GY and non-written VY and EY - #define GETGY_VYEY(gy, vy, ey) \ - vy = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); \ - if(MODREG) \ -@@ -544,14 +544,14 @@ - VLDR128_U12(ey, ed, fixedaddress+16); \ - gy = ymm_get_reg(dyn, ninst, x1, gd, 1, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1) - --// Get empty EY and non-writen VY and GY -+// Get empty EY and non-written VY and GY - #define GETGYVYEY_empty(gy, vy, ey) \ - vy = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); \ - gy = ymm_get_reg(dyn, ninst, x1, gd, 0, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); \ - if(MODREG) \ - ey = ymm_get_reg_empty(dyn, ninst, x1, (nextop&7)+(rex.b<<3), gd, vex.v, -1) - --// Get EY and non-writen GY -+// Get EY and non-written GY - #define GETGYEY(gy, ey) \ - if(MODREG) \ - ey = ymm_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1, gd, -1, -1); \ -@@ -573,13 +573,13 @@ - else \ - VLDR128_U12(ey, ed, fixedaddress+16); \ - --// Get empty EY and non-writen GY -+// Get empty EY and non-written GY - #define GETGYEY_empty(gy, ey) \ - gy = ymm_get_reg(dyn, ninst, x1, gd, 0, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1, -1); \ - if(MODREG) \ - ey = ymm_get_reg_empty(dyn, ninst, x1, (nextop&7)+(rex.b<<3), gd, -1, -1) - --// Get empty GY, and non-writen EY -+// Get empty GY, and non-written EY - #define GETGY_empty_EY(gy, ey) \ - if(MODREG) \ - ey = ymm_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0, gd, -1, -1); \ -@@ -587,7 +587,7 @@ - VLDR128_U12(ey, ed, fixedaddress+16); \ - gy = ymm_get_reg_empty(dyn, ninst, x1, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1, -1) - --// Get empty VY, and non-writen EY -+// Get empty VY, and non-written EY - #define GETVY_empty_EY(vy, ey) \ - if(MODREG) \ - ey = ymm_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0, vex.v, -1, -1); \ -diff --git a/src/dynarec/dynarec_native_functions.c b/src/dynarec/dynarec_native_functions.c -index 219fd413..6a118dfa 100644 ---- a/src/dynarec/dynarec_native_functions.c -+++ b/src/dynarec/dynarec_native_functions.c -@@ -584,7 +584,7 @@ uintptr_t fakeed(dynarec_native_t* dyn, uintptr_t addr, int ninst, uint8_t nexto - } - return addr; - } --// return Ib on a mod/rm opcode without emiting anything -+// return Ib on a mod/rm opcode without emitting anything - uint8_t geted_ib(dynarec_native_t* dyn, uintptr_t addr, int ninst, uint8_t nextop) - { - addr = fakeed(dyn, addr, ninst, nextop); -diff --git a/src/dynarec/dynarec_native_functions.h b/src/dynarec/dynarec_native_functions.h -index 1072a201..e9cff961 100644 ---- a/src/dynarec/dynarec_native_functions.h -+++ b/src/dynarec/dynarec_native_functions.h -@@ -68,7 +68,7 @@ int getNominalPred(dynarec_native_t* dyn, int ninst); - - // Do the GETED, but don't emit anything... - uintptr_t fakeed(dynarec_native_t* dyn, uintptr_t addr, int ninst, uint8_t nextop); --// return Ib on a mod/rm opcode without emiting anything -+// return Ib on a mod/rm opcode without emitting anything - uint8_t geted_ib(dynarec_native_t* dyn, uintptr_t addr, int ninst, uint8_t nextop); - - // Is what pointed at addr a native call? And if yes, to what function? -diff --git a/src/dynarec/rv64/dynarec_rv64_00_2.c b/src/dynarec/rv64/dynarec_rv64_00_2.c -index 1232a973..7bf4a342 100644 ---- a/src/dynarec/rv64/dynarec_rv64_00_2.c -+++ b/src/dynarec/rv64/dynarec_rv64_00_2.c -@@ -529,7 +529,7 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int - if(box64_wine) { // should this be done all the time? - ANDI(x1, xFlags, 1 << F_TF); - CBZ_NEXT(x1); -- // go to epilog, TF should trigger at end of next opcode, so using Interpretor only -+ // go to epilog, TF should trigger at end of next opcode, so using Interpreter only - jump_to_epilog(dyn, addr, 0, ninst); - } - break; -diff --git a/src/dynarec/rv64/dynarec_rv64_66.c b/src/dynarec/rv64/dynarec_rv64_66.c -index b0e45569..e786da98 100644 ---- a/src/dynarec/rv64/dynarec_rv64_66.c -+++ b/src/dynarec/rv64/dynarec_rv64_66.c -@@ -701,7 +701,7 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni - if (box64_wine) { // should this be done all the time? - ANDI(x1, xFlags, 1 << F_TF); - CBZ_NEXT(x1); -- // go to epilog, TF should trigger at end of next opcode, so using Interpretor only -+ // go to epilog, TF should trigger at end of next opcode, so using Interpreter only - jump_to_epilog(dyn, addr, 0, ninst); - } - break; -diff --git a/src/emu/x64syscall.c b/src/emu/x64syscall.c -index 9e30045e..85eebe70 100644 ---- a/src/emu/x64syscall.c -+++ b/src/emu/x64syscall.c -@@ -776,7 +776,7 @@ void EXPORT x64Syscall(x64emu_t *emu) - sigset_t * set = (sigset_t *)R_RSI; - if(sigismember(set, SIGSEGV)) { - sigdelset(set, SIGSEGV); -- printf_log(LOG_INFO, "Warning, signalfd on SIGSEGV unsuported\n"); -+ printf_log(LOG_INFO, "Warning, signalfd on SIGSEGV unsupported\n"); - } - S_RAX = signalfd(S_EDI, set, 0); - if(S_RAX==-1) -@@ -1060,7 +1060,7 @@ long EXPORT my_syscall(x64emu_t *emu) - sigset_t * set = (sigset_t *)R_RDX; - if(sigismember(set, SIGSEGV)) { - sigdelset(set, SIGSEGV); -- printf_log(LOG_INFO, "Warning, signalfd on SIGSEGV unsuported\n"); -+ printf_log(LOG_INFO, "Warning, signalfd on SIGSEGV unsupported\n"); - } - return signalfd(S_ESI, set, 0); - } -diff --git a/src/libtools/signals.c b/src/libtools/signals.c -index 3bb2bc0c..64b8b2f0 100644 ---- a/src/libtools/signals.c -+++ b/src/libtools/signals.c -@@ -1954,7 +1954,7 @@ EXPORT sighandler_t my_signal(x64emu_t* emu, int signum, sighandler_t handler) - return signal(signum, handler); - } - EXPORT sighandler_t my___sysv_signal(x64emu_t* emu, int signum, sighandler_t handler) __attribute__((alias("my_signal"))); --EXPORT sighandler_t my_sysv_signal(x64emu_t* emu, int signum, sighandler_t handler) __attribute__((alias("my_signal"))); // not completly exact -+EXPORT sighandler_t my_sysv_signal(x64emu_t* emu, int signum, sighandler_t handler) __attribute__((alias("my_signal"))); // not completely exact - - int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x64_sigaction_t *oldact) - { -diff --git a/src/tools/rcfile.c b/src/tools/rcfile.c -index 26f3aabb..2a281923 100644 ---- a/src/tools/rcfile.c -+++ b/src/tools/rcfile.c -@@ -566,7 +566,7 @@ void ApplyParams(const char* name) - my_reserveHighMem(); - if(param->is_new_avx_present) { - if(!new_avx) { -- printf_log(LOG_INFO, "Hidding AVX extension\n"); -+ printf_log(LOG_INFO, "Hiding AVX extension\n"); - box64_avx = 0; box64_avx2 = 0; - } else if(new_avx==1) { - printf_log(LOG_INFO, "Exposing AVX extension\n"); --- -2.39.2 - diff --git a/debian/rules b/debian/rules index 13706b4..879f9ca 100755 --- a/debian/rules +++ b/debian/rules @@ -13,17 +13,21 @@ include /usr/share/dpkg/pkg-info.mk ifeq ($(DEB_HOST_ARCH),amd64) PLATFORMS=NOALIGN else ifeq ($(DEB_HOST_ARCH),arm64) -PLATFORMS=ARM_DYNAREC RPI4ARM64 RK3588 +PLATFORMS=ARM_DYNAREC RPI3ARM64 RPI4ARM64 RPI5ARM64 RK3588 RK3399 else ifeq ($(DEB_HOST_ARCH),ppc64el) PLATFORMS=PPC64LE else ifeq ($(DEB_HOST_ARCH),riscv64) PLATFORMS=RV64 +else ifeq ($(DEB_HOST_ARCH),loong64) +PLATFORMS=LARCH64 endif override_dh_auto_configure: - set -exu; for p in $(PLATFORMS); do dh_auto_configure --builddirectory=build.$${p} -- -D$${p}=1 -DNOGIT=1 -DNO_LIB_INSTALL=1; done + set -exu; for p in $(PLATFORMS); do dh_auto_configure --builddirectory=build.$${p} -- -D$${p}=1 -DNOGIT=1 -DNO_LIB_INSTALL=1 -DBOX32=1 -DBOX32_BINFMT=1; done override_dh_auto_build: + # build docs/USAGE.md and docs/box64.pod + env --chdir=docs/gen python3 ./gen.py pod2man --center "Manual" --release "box64 $(DEB_VERSION_UPSTREAM)" docs/box64.pod > docs/box64.1 mkdir -p src/wrapped/generated set -exu; for p in $(PLATFORMS); do dh_auto_build --builddirectory=build.$${p}; done @@ -33,7 +37,7 @@ override_dh_auto_install: override_dh_auto_clean: set -exu; for p in $(PLATFORMS); do dh_auto_clean --builddirectory=build.$${p}; done - rm -f docs/box64.1 + rm -f docs/box64.1 docs/USAGE.md docs/box64.pod # https://github.com/ptitSeb/box64/issues/648 override_dh_auto_test: diff --git a/debian/tests/control b/debian/tests/control index 430bd18..9b551e8 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,3 +1,6 @@ Test-Command: box64 --version -Depends: box64 -Restrictions: allow-stderr, superficial +Depends: + box64, +Restrictions: + allow-stderr, + superficial, diff --git a/docs/BUNDLE-X86-LIBS.md b/docs/BUNDLE-X86-LIBS.md new file mode 100644 index 0000000..11a1df9 --- /dev/null +++ b/docs/BUNDLE-X86-LIBS.md @@ -0,0 +1,78 @@ +# Bundling x86 Libraries + +The script `box64-bundle-x86-libs.sh` is provided to download, extract, and re-bundle x86_64 and x86 libraries for use with Box64/Box32 and Box86. These libraries improve Box emulation. This bundle provides a much smaller size compared to using a full root file system of an operating system. + +## Usage + +### Administrator + +Install required dependencies for the bundle script. + +- Arch Linux + ``` + sudo pacman -S -y -u + sudo pacman -S binutils coreutils curl rpm-tools tar zstd + ``` +- Debian + ``` + sudo apt-get update + sudo apt-get install binutils coreutils curl rpm2cpio tar zstd + ``` +- Fedora + ``` + sudo dnf install binutils coreutils curl tar zstd + ``` + +Run `box64-bundle-x86-libs.sh`. This will create two archives: +- `box64-bundle-x86-libs.tar.gz` = All of the extracted library files in the directory structure of `usr/lib/box64-i386-linux-gnu` and `usr/lib/box64-x86_64-linux-gnu`. +- `box64-bundle-x86-pkgs.tar.gz` = All of the Linux distribution packages used to extract the library files. This is only created for preservation purposes and is otherwise unused. + +Extract the library archive. Box will automatically search these paths for library files to emulate. + +``` +sudo tar --extract --no-same-owner --file box64-bundle-x86-libs.tar.gz --directory / +``` + +### Developer + +Add new packages to the `box64-bundle-x86-libs.csv` file in the format of `,`. + +Supported packages: +- DEB (Debian) +- EOPKG (Solus) +- RPM (Fedora) +- XBPS (Void Linux) + +Preference of operating system packages that provide a library: +1. RPMs from AlmaLinux 9 provide 10 years of updates. +2. DEBs from Debian 11 provide 5 years of updates. +3. EOPKG from Solus provide old variants of obscure 32-bit libraries. +4. XBPS from Void Linux provide updated variants of obscure 32-bit libraries. +5. Other (whereever a library is packaged) + +Some essential library files will never be emulated (only wrapped) and should not be bundled. This includes glibc, OpenGL, Vulkan, and X11/Xorg libraries. The full list can be found [in the library source code](https://github.com/ptitSeb/box64/blob/v0.3.6/src/librarian/library.c#L433). Other libraries with lots of dependencies, such as GTK, require all dependencies to be installed for emulation to work. This becomes dependency hell and should be avoided. + +For finding package names that contian a specific library file, use the [pkgs.org website](https://pkgs.org/). Otherwise, use one of these package manager commands on a x86_64 Linux distribution: +- DEB + - `apt-file ` +- EOPKG + - Does not support file search. Use pkgs.org instead. +- RPM + - `dnf provides "*/*"` +- XBPS + - `xbps-query --repository --ownedby ` + +Once the package name is found, find the exact URL for downloading it. +- DEB = Explore "main" and "contrib". Search for packages with the name "deb11" in it. Use the "amd64.deb" and "i386.deb" packages. + - https://archive.debian.org/debian/pool/ +- EOPKG = Use the "`--x86_64.eopkg`" and "`32bit---x86_64.eopkg`" packages. + - https://cdn.getsol.us/repo/shannon/ +- RPM = Navigate to the "`.`" version directory first. Then explore "AppStream" and "BaseOS". Use the "x86_64.rpm" and "i686.rpm" packages. + - https://repo.almalinux.org/almalinux/ + - Enterprise Linux (EL) distributions, such as AlamaLinux, sometimes are missing 32-bit packages. Use the Fedora 34 [update](https://archives.fedoraproject.org/pub/archive/fedora/linux/updates/34/Everything/x86_64/Packages/) and [release](https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/34/Everything/x86_64/os/Packages/) archives for compatible packages with EL 9. +- XBPS = There are too many files in the repository to display on a web browser. Use pkgs.org instead to find the exact URL for downloading it. + - https://repo-default.voidlinux.org/current/ + +Download the package and then find the checksum with the `sha256sum` command. + +Major Linux distributions such as AlmaLinux and Debian provide archives of packages. Most rolling distributions such as Solus and Void Linux do not (one exception is Arch Linux which has the [Arch Linux Archive (ALA)](https://wiki.archlinux.org/title/Arch_Linux_Archive)). In those cases, use the [Internet Archive](https://web.archive.org/) to archive any rolling release package used by Box by using the "Save Page Now" feature. If the error "Save Page Now browser crashed" appears, it can be safely ignored. The archive will still have been saved. diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 72ffb15..424dc43 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,3 +1,217 @@ +v0.4.0 +====== + +Highlights: +* This version added many important refactors: the opcode prefix decoder for Dynarec, libGL and Vulkan, the FSGSBASE support, making segments handling easier and faster. + => Improved compatibility accross all architecture, allowing more DRM protected game to run + => the prefix refactor helped removed lots of redundant source file, simplifying maintenance + => BOX32 is getting more and more stable, even if still not 100% ok. But Steam is more stable than before, runs on all architecture. And some gameoverlay UI works, on OpenGL games. gameoverlay (and fossilize) support for Vulkan is planned for later. + +Version summary: + +* Added new BOX64_ARCH to have settings specific to one of the supported cpu architecture (arm64, rv64, la64) +* Added BAD_PKILL build option, to workaround missing non-mandatory behaviour of pthread_kill (needed on LA64) +* Improved the handling of invalid opcodes +* Refactored handling of Selector, Segments and TLS data +* Added FSGSBASE cpu extension +* Added support for IFUNC relocation type to ElfLoader (64bits & 32bits) +* Refactored some internal behaviour to get better Interpreter only build +* Added BOX64_STEAM_VULKAN to have Vulkan renderer option injected when steamwebhelper is called +* Introduce BOX64_PYTHON3 to force using an X64 version of python (and use that on arm64 steam) +* Fixed signal handling when using Wine v10.19+ +* Added some cache to customMalloc / customFree internal functions +* Some refactor on the cpuid helper function +* Wrapping: most Wayland listener for wider compatibility +* Wrapping: refactored libGL & libVulkan wrapping +* Wrapping: more wrapped functions, reworked some existing one with wrapperhelper +* Wrapping: Added a few more wrapped libs +* Wrapping: Better handling of RTLD_NEXT in dlsym function call +* Wrapping: Reworked wrapping of pthread_one (on Box32 too) +* Wrapping: a few new syscall implemented +* Wrapping: Make BOX64_EMULATED_LIBS to also affect gstreamer hacked loading of plugins +* Wrapping: BOX32: more wrapped function and some fixes to existing ones +* Wrapping: BOX32: a few new syscall implemented +* Interpreter: Added LOCK prefix to the generic opcode prefix handling +* Interpreter: A few fixes to existing opcodes +* Interpreter: Added F3 0F 40..4F opcodes +* Dynarec: Refactored HotPages Detection & Handling +* Dynarec: Introduced DYNAREC_PURGE to allow purging of old (unused?) Dynarec block and save memory +* Dynarec: Refactored prefix decoding, similar to the Interpreter +* Dynarec: ARM64: Added detection of loops and preload of xmm/ymm regs before entering +* Dynarec: ARM64: Refactored the handling of deferred flags +* Dynarec: ARM64: A few optimisation in some existing opcodes +* DYnarec: ARM64: Some fixes to existing opcodes +* Dynarec: LA64: Added x87 opcodes +* Dynarec: LA64: Added a few missing LOCK prefixed opcodes +* Dynarec: LA64: Added some more shift/roll opcodes +* Dynarec: LA64: Added support for native CRC opcodes +* Dynarec: LA64: Many fixes to some AVX opcodes +* Dynarec: LA64: Various fixes to some opcodes +* Dynarec: LA64: Addes a few 66 prefixed opcodes +* Dynarec: LA64: Added some "simple wrapper" support (allowing direct call of wrapped functions) +* Dynarec: LA64: Added some more native flags optimisations +* Dynarec: LA64: optimized REP MOVSB +* Dynarec: RV64: Fixed/Fine tunning flags on existing opcodes +* Dynarec: RV64: Various fixes to some opcodes + +v0.3.8 +====== + +Highlights: + +* This version introduce DynaCache, a disk cache for the generated native code. It's not enabled by default for now (but it will use cache file if present by default). It can dramaticaly speedup the load of program (try with linux factorio for example). This version also improve in the volatile metadata handling. There is a massive compatiblity improvment for box32 and on all dynarec in general too. And few more function wrapping... + + => DynaCache for faster loading of program, and avoid runtime hicups + => Batter box32 compatibility (much less "Out of Memory" error) + => Unity3D games on Wayland are working now + => Volatile Metadata fully supported and handled, making games like Starfield to just work. + => More work on AVX support for RV64 & LA64. LA64 almost there, while RV64 has Scalar only support (no hardware vector support yet for AVX) + +Version summary: + +* Improved and fixed memory tracking +* Improved volatile metadata handling, and some light refactor on StrongMem emulation +* Improved handling of TF flag +* DynaCache: Introducing a way to cache on disk native generated code for faster startup time on subsequent release +* DynaCache: Support for all 3 backends ARM64, RV64 & LA64 +* Interpreter: refactor opcodes decoding to have prefixes handled in a generic way +* Interpreter: many small fixes +* Dynarec: some optimisations in the jump table, to remove one memory fetch on each jump +* Dynarec: create infrastructure to be able to change easily the reg mapping +* Dynarec: optimised defered flag handling to limit cases where UpdateFlags is needed +* Dynarec: Introduced BOX64_DYNAREC_NOHOTPAGE to disable detection of hotpages +* Dynarec: ARM64: A few more opcode added +* Dynarec: ARM64: Some small fixes and better handling of undefined behavior in opcodes, as well as undefined opcodes +* Dynarec: ARM64: Implemented a Dynarec version of UpdateFlags, for improved performances +* Dynarec; ARM64: Fixes/Improved SSE_FLUSHTO0 support +* Dynarec: LA64: Added support for AVX (& friends) opcodes. Still need some debugging so AVX still disabled by default on LA64 +* Dynarec: LA64: Changed register mapping to be closer to the x86_64 ABI +* Dynarec: LA64: RV64: Added limited support to SSE_FLUSHTO0 +* Dynarec: RV64: Many fixes and improvments for MMX opcodes +* Dynarec: RV64: many Scalar version of AVX opcodes added +* Dynarec: Many fixes to various OpCodes, on all 3 backends +* WowBox64: Added minimal runtime, improved overall stability +* BOX32: Wrapper: many new functions added, plus many fixes +* BOX32: Improved memory hadnling, using 32bits personality and other tunning to get more reliable 32bits memory allocations +* BOX64: Wrapper: some more wrapped functions added, including wayland (for Unity games on Wayland) and vulkan (more extensions) +* BOX64: Wrapper: improved handling of some VarArg wrapped functions on non-ARM64 backend +* RCFILE: Fixed MAXCPU not working properly with Wine programs +* RCFILE: Generic Setup profile refined, and more games profile added +* Trace: Added support for current libZydis + +v0.3.6 +====== + +Highlights: + +* This version introduces wowbox64.dll for Hangover; the ability to use the Volatile Metadata of Windows executables for x64 wine; and some better x87/SSE/AVX handling + + => WowBox64 can be built directly from Box64 repo, and can be found in the CI artifacts also + => it also supports a subset of BOX64_XXXX settings, which can be set from command line or via a setting file ".box64rc" in the Wine prefix home + => Volatile Metadata, when present, allows only applying strong memory ordering when needed, as marked by the compiler, giving overall better performances + => The precision control bit of x87 is now handled, allowing some older games to run correctly + => More work has been done in the handling of precise NaN and Round handling in SSE & AVX opcodes + +Version summary: + +* Added/fixed some Syscalls, helping Go programs +* Wrapper: more functions added, and some fixes too. Vulkan is 1.4 now, among other things +* Wrapper: Added a few more wrapped libs (like some avcodec and friends) +* Improve internal memory allocator (with a dedicated allocator for small memory allocations), and fixed some issues around it +* Improve internal mmaped file tracking +* Box32: Some small refactoring around memory management and internal memory allocations +* Box32: More functions wrapped +* Box32: More libraries wrapped +* ARM64: Added support for Atomic extension in many internal functions (not related to Dynarec). +* ARM64: Added support for CRC2 extension for internal CRC functions +* Interp: A few fixes to some opcodes, and better NAN handling on some selected SSE/AVX opcodes +* Interp: Added a few opcodes with exotic prefixes +* Dynarec: Introcude BOX64_DYNAREC_ROUND=2 to handle x87 precision control bit (ARM64 and RV64, LA64 still doesn't handle x87 yet) +* Dynarec: Some small optimizations on Strongmem emulation, making it more efficient +* Dynarec: Some speed optimizations on code that do SMC and waiting slot +* Dynarec: Added CALLRET=2 to improve call/ret optimization compatibility with SMC code +* Dynarec: ARM64: Various optimizations and fixes on some opcodes, especially AVX ones +* Dynarec: ARM64: Added missing FASTNAN=0 handling on some SSE/AVX opcodes +* Dynarec: ARM64: Added some exotic prefixed opcodes +* Dynarec: ARM64: Avoid purging XMM/YMM register on intra-block loop if possible +* Dynarec: RV64: Many fixes and improvments around x87 emulation +* Dynarec: RV64: Added some more missing opcodes, especially some LOCK prefixed ones and many MMX ones +* Dynarec: RV64: Various fixes on some existing opcodes +* Dynarec: RV64: Improved nativeflags handling, allowing for more cases to use it +* Dynarec: LA64: Added some more opcodes and MMX handling +* Dynarec: LA64: Various fixes to some existing opcodes +* Android: Improved signal handling, structure alignment, and transformation +* WowBox64: Created the dll, with RcFile, Env. Var. handling and log printout (both ARM64 Dynarec and Interpreter available) +* Cosim: Various fixes and improvements to limit false negatives and improve readability of logs +* RcFile: A few fixes for some values that would be ignored + +v0.3.4 +====== +* This version is Faster and more compatible: + => The RV64 backend got faster and more stable, with lots of RVV 1.0 / xThreadVector support to emulate SSE/SSE2+ opcode (no AVX yet) + => On ARM64, Box64 now support more DRM types than before. + => BOX32 can run steam now. At least on ARM64 backend, it's still not working on RV64 and LA64 for now. +* Added support to emulate Windows Syscall (needs Proton and a 48bits address space for now) +* Added BOX64_DYNAREC_DIRTY to have a faster (but less safe) way to handle code that write in it's current page +* Added a few rarely used opcodes +* Added experimental support for GDBJIT, that allow an x86/x86_64 program to be debugged on ARM/RV64/LA64 platform with x86 regs and opcode view (might generate a lot of file tho) +* Added support for Perf tools in a similar way if GDBJIT, to have an x86 fine view of the performances +* Reworked undefined flags for common operations, to be similar to real CPU +* Reworked cpuid handling, adding BOX64_CPUTYPE support to select Intel/AMD emulation (no 3DNow! support on AMD for now) +* Reworked ucontext link to be closer to the real thing (and make it more simple) +* Improved memory traking, file descriptor backed memory map, and detect wine loaded dll +* Introduced settings per library and dll (mostly for Dynarec) +* Wrapper: More functions addes, and some fixes too +* BOX32: Many fixes around pthreads wrapping +* BOX32: More functions wrapped. +* BOX32: More libraies wrapped. +* BOX32: Some reworks on how high memory (higher than 32bits) is masked, and can be used for Dynarec blocks. +* Dynarec: The usual batch of fixes, improvments and opcodes additions on all 3 supported backend +* Dynarec: Some fixes to NativeFlags handling, both on ARM64 and RV64 +* Dynarec: Added optimized REP MOVSB (expected for default CPUTYPE=0, according to new cpuid return) +* Dynarec: LA64: more opcoded addes, using hardware extensions like AES +* Dynarec: RV64: More work on using RVV 1.0 and xTheadVector extension to emulate SSE/SSE2+ opcodes +* Dynarec: RV64: Added informations on flags when building blocks, to be used when a signal happens to rebuild a x86 context more accurate +* Dynarec: ARM64: Reworked undefined flags for common operations, to be similar to real CPU +* Dynarec: ARM64: Added informations on flags and xmm/ymm/x87 register when building blocks, to be used when a signal happens to rebuild a x86 context 100% accurate +* TRACE: Reworked how trace for wrapped function call is printed. +* TRACE: Reworked logs to prefix each line with a (optionaly colored) BOX32 or BOX64 +* COSIM: Some rework on cosim to limit false negative, especialy when handling x87 operations +* LA64: Added limited support for ABI 1.0 +* CI: github CI now also generate MiceWine .rat archive, along with Winlator .wcp archive and regular linux builds. +* RCFile: Added many new games profiles (both for speed improvment or for compatibilty) + +v0.3.2 +====== +* Introduced Box32 to run 32bits apps on 64bits OS + => Box32 is a build option for Box64, and is disabled by default + => Optionnal binfmt integration available for Box32 + => Wrapped some basics libs, including graphics and sounds so a few games already works + => Work In Progress, many issues remain to be fixed, but some Linux games are playable +* Introduced Native Flags. Can be controled with BOX64_DYNAREC_NATIVEFLAGS, but enabled by default + => Available on the 3 Dynarec backend, with different implementations + => ARM64 Dynarec build have all AVX/AVX2 extensions enabled by default + +> Can lead to large speedup on certain cases +* Improved Strong Memory Model emulation, with better default options and a more efficiant emulation +* Dynarec: RV64: using RVV (and XThreadVector) to implement SSEx opcodes, with some massive speedup when used! +* Some bugfix and improvment in the Signal handler and internal memory tracking +* Improvment to TRAP signal generation and Handling +* Improved CPUID opcodes again, and the various virtual file in /proc that represent those data +* Improved some x87 operations, like long double handling and infinity comparisons... +* Dynarec: ARM64 fixes to a few opcodes +* Dynarec: RV64 fixes to many opcodes +* Dynarec: LA64 fixes to a few opcodes +* Dynarec: RV64 fixes and improvments on LOCK prefixes opcodes +* Dynarec: Many optimisation on some individual opcodes, an all 3 backends +* WRAPPING: More libs and functions wrapped. Some wrapping fixes too +* WREPPING: New wrapperhelper to help coding new wrapping & fixing/enhancing existing one +* ElfLoader: Improved object fetching +* New build profile for SD865 and ORYON +* Changed the installation folder of x86 libs to avoid conflict with linux distro +* Added a few syscalls +* Some more Vulkan extensions wrapped +* More work on build system, and github CI (generating WCP archive), with some fixes on the Android version (still not 100% operational) + v0.3.0 ====== * AVX and AVX2 implemented, along with BMI1, BMI2, ADX, FMA, F16C and RDANDR extension! diff --git a/docs/COMPILE.md b/docs/COMPILE.md index 6e16eb8..6691459 100644 --- a/docs/COMPILE.md +++ b/docs/COMPILE.md @@ -1,14 +1,16 @@ Compiling/Installing ---- -If you don't want to compile box64 yourself and prefer to use third-party pre-build version, go to the [end of the document](#pre-build-packages) for alternatives. +If you don't want to compile box64 yourself and prefer to use third-party pre-build version, go to the [end of the document](#pre-built-packages) for alternatives. You can also generate your own package using the [instructions below](https://github.com/ptitSeb/box64/blob/main/docs/COMPILE.md#debian-packaging). +Additional installation steps may be necessary when copying only the box64 executable file without running make install in cross-build environments. See [Cross-Compiling](https://github.com/ptitSeb/box64/blob/main/docs/COMPILE.md#Cross-Compiling) + ## Per-platform compiling instructions ----- -### The general approach is: +### The general approach + ``` git clone https://github.com/ptitSeb/box64 cd box64 @@ -20,10 +22,30 @@ If it's the first install, you also need: ``` sudo systemctl restart systemd-binfmt ``` -- You can use `make -j1`, `make -j2` to prevent running out of memory -- You can also add `-DBAD_SIGNAL=ON` to the cmake command if you are on Linux Kernel mixed with Android, like on RK3588. +- You can use `make -j1`, `make -j2` with less jobs to prevent running out of memory +- You can also add `-DBAD_SIGNAL=ON` to the cmake command if you are on a Linux Kernel mixed with Android, like on RK3588. + +### Note about Box32 + +If you want to build Box64 with the Box32 option, you will need to add `-DBOX32=ON` to the cmake command. That will enable 32bits process to be run with Box64. +If you also want binfmt integration on 32bits binaries, you also need to add `-DBOX32_BINFMT=ON` to the cmake command. + +### Note about WowBox64 + +A highly experimantal subproject named WowBox64 has been added as a build option, add `-DWOW64=ON` to the cmake command to enable it. +It will build alongside the regular Box64, and produce a `wowbox64.dll` file in `build/wowbox64-prefix/src/wowbox64-build/` directory. + +### Note about binfmt_misc on Android + +[binfmt_misc](https://en.wikipedia.org/wiki/Binfmt_misc) is a capability of the Linux kernel which allows arbitrary executable file formats to be recognized and passed to certain user space applications such as Box64 usually used with systemd but systems like Android can't run/use systemd so you will need to register Box64 manually, this will also work inside a CHRoot. +``` +sudo mount -t binfmt_misc none /proc/sys/fs/binfmt_misc +sudo echo ':box64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/box64:' | sudo tee /proc/sys/fs/binfmt_misc/register +``` + + +#### Example of generic ARM64 build for linux platforms -#### For Instance, if you want to build box64 for Generic ARM64 Linux platforms, it would look like this: ``` git clone https://github.com/ptitSeb/box64 cd box64 @@ -32,25 +54,37 @@ make -j4 sudo make install sudo systemctl restart systemd-binfmt ``` + +#### Example of generic ARM64 build for linux platforms with full box32 integration + +``` +git clone https://github.com/ptitSeb/box64 +cd box64 +mkdir build; cd build; cmake .. -D ARM_DYNAREC=ON -D CMAKE_BUILD_TYPE=RelWithDebInfo -D BOX32=ON -D BOX32_BINFMT=ON +make -j4 +sudo make install +sudo systemctl restart systemd-binfmt +``` + ---- #### for RK3399 -Using a 64bit OS: +On a 64bit OS: ``` -D RK3399=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo ``` #### for RK3588 / RK3588S -Using a 64bit OS: +On a 64bit OS: ``` -D RK3588=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo ``` #### for Raspberry Pi 3 -Warning, you need a 64bit OS: +On a 64bit OS: If building on the Pi, you will also need a large swap (3 GB+) [optionally reduce GPU memory to a minimum (e.g. 16 MB) using `raspi-config` @@ -66,7 +100,7 @@ Still, this can be faster if your build is attended. #### for Raspberry Pi 4 -Warning, you need a 64bit OS: +On a 64bit OS: ``` -D RPI4ARM64=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo @@ -80,7 +114,7 @@ Warning, you need a 64bit OS: #### for TEGRA X1 -Using a 64bit OS: +On a 64bit OS: ``` -D TEGRAX1=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo @@ -88,7 +122,7 @@ Using a 64bit OS: #### for Jetson Xavier/T194 -Using a 64bit OS: +On a 64bit OS: ``` -D TEGRA_T194=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo @@ -96,16 +130,32 @@ Using a 64bit OS: #### for Jetson Orin/T234 -Using a 64bit OS: +On a 64bit OS: -Caution: please use gcc-11 or higher, older gcc dosen't know cortex-a78ae +Note: use gcc-11 or higher, older gcc doesn't know cortex-a78ae ``` -D TEGRA_T234=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo ``` +#### for DGX Spark/GB10 based devices + +On a 64bit OS: + +Note: Requires GCC 15.2.0 or higher. Older GCC versions do not support gb10, cortex-a725, or cortex-x925. + +For GCC 14 or older, you can use the following march equivalent: +``` +-march=armv9.2-a+crc+sve2-aes+sve2-bitperm+sve2-sha3+sve2-sm4+memtag+profile +``` + +With GCC 15.2.0 or higher: +``` +-D NVIDIA_GB10=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo +``` + #### for ODROID N2/N2+ -Using a 64bit OS: +On a 64bit OS: ``` -D ODROIDN2=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo @@ -113,7 +163,7 @@ Using a 64bit OS: #### for Snapdragon -Using a 64bit OS: +On a 64bit OS: ``` -D SD845=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo @@ -125,18 +175,18 @@ or -D SD888=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo ``` -Depending how recent your Snapdragon is +Depending on how recent your Snapdragon is #### for Phytium -Using a 64bit OS: +On a 64bit OS: ``` -D PHYTIUM=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo ``` #### for ADLink machines -Using a 64bit OS: +On a 64bit OS: ``` -D ADLINK=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo ``` @@ -151,7 +201,7 @@ Only test on Asahi with Fedora, using the default "16K page" kernel #### for LoongArch -Using a 64bit OS: +On a 64bit OS: ``` -D LARCH64=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo @@ -159,7 +209,7 @@ Using a 64bit OS: #### for RISC-V -Using a 64bit OS: +On a 64bit OS: ``` -D RV64=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo @@ -167,7 +217,7 @@ Using a 64bit OS: #### for PowerPC 64 LE -Using a 64bit OS: +On a 64bit OS: ``` -D PPC64LE=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo @@ -175,7 +225,7 @@ Using a 64bit OS: #### for LX2160A -Using a 64bit OS: +On a 64bit OS: ``` -D LX2160A=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo @@ -183,7 +233,7 @@ Using a 64bit OS: #### for Termux -You must have ARM64 Device for build box64. +You must have ARM64 machine to build box64. ##### in CHRoot/PRoot @@ -193,15 +243,16 @@ You must have ARM64 Device for build box64. ##### in Termux (Native) -NOTE: BUILDING BOX64 IN TERMUX NATIVE IS EXPERIMENTAL AND DOESN'T GONNA RUN LINUX BINARIES IN NATIVE TERMUX BOX64!!! +Note: Box64 in native termux is experimental and won't run linux binaries! -You also needed have `libandroid-sysv-semaphore` and `libandroid-spawn` libraries: +You also need `libandroid-sysv-semaphore` and `libandroid-spawn` libraries. ``` -D TERMUX=1 -DCMAKE_C_COMPILER=clang -D CMAKE_BUILD_TYPE=RelWithDebInfo ``` #### for x86_64 Linux + ``` -D LD80BITS=1 -D NOALIGN=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo ``` @@ -211,62 +262,64 @@ If you encounter some linking errors, try using `NOLOADADDR=ON` (`cmake -D NOLOA ### Use ccmake -Alternatively, you can **use the curses-bases ccmake (or any other gui frontend for cmake)** to select wich platform to use interactively. +Alternatively, you can **use the curses-based ccmake (or any other gui frontend for cmake)** to select which platform to use interactively. ### Customize your build -#### Use ccache if you have it +#### Use ccache when present -Add `-DUSE_CCACHE=1` if you have ccache (it's better if you plan to touch the sources) +Add `-DUSE_CCACHE=1` option if you have ccache and plan to touch the sources. -#### To have some debug info +#### Include debug information -The `-DCMAKE_BUILD_TYPE=RelWithDebInfo` argument makes a build that is both optimized for speed, and has debug information embedded. That way, if you have a crash or try to analyse performance, you'll have some symbols. +Add `-DCMAKE_BUILD_TYPE=RelWithDebInfo` option for an optimized build with debug information embedded. That way, if you want to debug a crash or analyze performance, you have symbols. -#### To have a Trace Enabled build +#### Build with trace -To have a trace enabled build (***the interpreter will be slightly slower***), add `-DHAVE_TRACE=1`. But you will need to have the [Zydis library](https://github.com/zyantific/zydis) in your `LD_LIBRARY_PATH` or in the system library folders at runtime. Use version v3.2.1, as later version changed the API and will no longer work with box64 +To have a trace enabled build (***the interpreter will be slightly slower***), add `-DHAVE_TRACE=1`. You will need the [Zydis library](https://github.com/zyantific/zydis) devel package installed (`apt install libzydis-dev` on Debian for example). -#### To have ARM Dynarec +#### Build DynaRec -Dynarec is only available on ARM (for the meantime), Activate it by using `-DARM_DYNAREC=1`. +Add `-D ARM_DYNAREC=ON` option to enable DynaRec on ARM machines. +Add `-D RV64_DYNAREC=ON` option to enable DynaRec on RV64 machines. +Add `-D LARCH64_DYNAREC=ON` option to enable DynaRec on LARCH64 machines. -#### To have a build using less memory +#### Save memory at run time -You can use `-DSAVE_MEM` to have a build that will try to save some memory. It's, for now, only increasing the jumptable from 4 level to 5 levels. The added granularity avoid wasting space, but the 1 level more to the jumptable means there is on read from memory more when jumping between blocks. +You can use `-DSAVE_MEM` to have a build that will try to save some memory. For now, it only increases the jumptable from 4 levels to 5. The added granularity avoids wasting space, but adds one more read from memory when jumping between blocks. -#### Not building from a git clone +#### Build outside of a git repo -If you are not building from a git clone (for example, downloading a release source code zip from github), you need to use `-DNOGIT=1` from cmake to be able to build (box64 uses git SHA1 to show last commit in version number). +Box64 uses git SHA1 to show last commit in version number, use `-DNOGIT=1` option when building outside of a git repo (for example, downloading a release source code zip from github). #### Use faster linker -You need to add `-DWITH_MOLD=1` if GNU ld is extremely slow. Then run `mold -run make -j4` to build (make sure [Mold](https://github.com/rui314/mold) is installed). +Add `-DWITH_MOLD=1` option when GNU ld is extremely slow. Then run `mold -run make -j4` to build (make sure [Mold](https://github.com/rui314/mold) is installed). #### Build a statically linked box64 -You can now build box64 staticaly linked, with `-DSTATICBUILD`. This is to use inside an x86_64 chroot. Note that this version of box64 will have just the minimum of wrapped libs. So only libc, libm and libpthread basically are wrapped. Other libs (like libGL or libvulkan, SDL2, etc...) will not be wrapped and x86_64 version will be used. It's designed to be used in docker image, or in headless server. -Also, the Static Build is highly experimental, but feedback are always welcomed. +You can now build box64 statically linked, with `-DSTATICBUILD` to use inside of a x86_64 chroot. Note that this version of box64 will only have the minimal wrapped libs, such as libc, libm and libpthread. Other libs (like libGL or libvulkan, SDL2, etc...) will use x86_64 versions. A static build is intended to be used in a docker image, or in a headless server. It is highly experimental, but feedback is always welcome. ---- ## Testing ----- + A few tests are included with box64. They can be launched using the `ctest` command. -The tests are very basic and only tests some functionality for now. +The tests are very basic and only test some functionality for now. ---- ## Debian Packaging ----- -Box64 can also be packaged into a .deb file ***using the source code zip from the releases page*** with `DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -us -uc -nc`. Configure any additional cmake options you might want in `debian/rules`. -## Pre-build packages ----- +Box64 can also be packaged into a .deb file ***using the source code zip from the releases page*** with `DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -us -uc -nc`. Configure any additional cmake options you want in `debian/rules`. + +## Pre-built packages + ### Debian-based Linux + You can use the [Pi-Apps-Coders apt repository](https://github.com/Pi-Apps-Coders/box64-debs) to install precompiled box64 debs, updated every 24 hours. ``` @@ -296,3 +349,47 @@ Signed-By: /usr/share/keyrings/box64-archive-keyring.gpg" | sudo tee /etc/apt/so sudo apt update sudo apt install box64-generic-arm -y ``` + +## Cross-Compiling +---- +### Set Up the Cross-Compiler +For example, to compile Box64 for RISC-V on an x86 machine, you can get prebuilt GNU toolchain from the [riscv-gnu-toolchain](https://github.com/riscv-collab/riscv-gnu-toolchain/releases) + +### Run CMake with Cross-Compilation Options +Follow the per-platform compilation instructions to configure the CMake options for your target architecture. +In particular, you must specify the cross-compiler. For example: +``` +-DCMAKE_C_COMPILER=riscv64-unknown-linux-gnu-gcc # Or whichever cross-compiler you use +``` + +Be aware of potential glibc capability errors when choosing a cross-compiler. +To avoid this, run `ldd --version` on your target machine to check its glibc version. + +### Running tests with QEMU (optional) +To do a quick check, run: +``` +qemu-riscv64 -L path/to/your/riscv64/sysroot box64 --help +``` +You can run `dirname $(find -name libc.so.6)` to determine whether sysroot is provided by the prebuilt GNU toolchain or not. + +To run CTest-based tests under QEMU: +``` +ctest -j$(nproc) +``` + +### Installing on the Target Machine +After successfully cross-compiling, copy the box64 executable to your RISC-V device. Note that simply copying the binary does not automatically install Box64’s shared libraries. Because `make install` does not run on the target during cross-compilation, libraries required for emulation may be missing. + +To resolve this, copy the shared libraries folder from the Box64 repository (`x64lib` or `x86lib`) to your target device, then rename it and place it in the appropriate library search path (e.g., `/usr/lib`). + +For `x86_64`: +```shell +$ mv x64lib box64-x86_64-linux-gnu +$ mv box64-x86_64-linux-gnu /usr/lib +``` +For `i386`: +```shell +$ mv x86lib box64-i386-linux-gnu +$ mv box64-i386-linux-gnu /usr/lib +``` + diff --git a/docs/STEAM.md b/docs/STEAM.md new file mode 100644 index 0000000..00dc828 --- /dev/null +++ b/docs/STEAM.md @@ -0,0 +1,19 @@ +# The guide on running Steam with Box64 + +Steam works with Box64, both Linux version and Windows version. Systems with less than 6GB RAM may need a swap file for optimal performance. + +## Install and run Linux Steam + +Linux Steam requires Box86 or Box32 and it's binfmt enabled, check [Compilation Instructions](COMPILE.md) for details. + +```bash +# This file can be found in the project root directory +./install_steam.sh + +# And then, just run +steam +``` + +## Install and run Windows Steam + +It's simple, just download it from Steam website and install it like other Windows applications. diff --git a/docs/USAGE.md b/docs/USAGE.md index bdac4b1..6b27705 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -1,389 +1,873 @@ - -Usage ----- - -There are many environment variables to control Box64 behaviour. -Env. var with * can also be put inside box64rc files. -Box64 look for 2 places for rcfile: `/etc/box64.box64rc` and `~/.box64rc` -The second takes precedence to the first, on an APP level -(that means if an [MYAPP] my appears in both file, only the settings in `~/.box64rc` will be applied) - -#### BOX64_LOG * -Controls the Verbosity level of the logs - * 0: NONE : No message (except some fatal error). (Default.) - * 1: INFO : Show some minimum log (Example: librairies not found) - * 2: DEBUG : Details a lot of stuff (Example: relocations or functions called). - * 3: DUMP : All DEBUG plus DUMP of all ELF Info. - -#### BOX64_ROLLING_LOG * -Show last few wrapped function call when a Signal is caught - * 0: No last function call printed (Default.) - * 1: Last 16 wrapped functions calls printed when a signal is printed. Incompatible with BOX64_LOG>1 (may need BOX64_SHOWSEGV=1 also) - * N: Last N wrapped functions calls printed when a signal is printed. Incompatible with BOX64_LOG>1 (may need BOX64_SHOWSEGV=1 also) - -#### BOX64_NOBANNER -Disables Box64 printing its version and build - * 0 : Enable printing its banner. (Default.) - * 1 : Disable printing its banner. - -#### BOX64_LD_LIBRARY_PATH * -Path to look for x86_64 libraries. Default is current folder and `lib` in current folder. -Also, `/usr/lib/x86_64-linux-gnu` and `/lib/x86_64-linux-gnu` are added if they exist. - -#### BOX64_PATH * -Path to look for x86_64 executable. Default is current folder and `bin` in current folder. - -#### BOX64_DLSYM_ERROR * -Enables/Disables the logging of `dlsym` errors. - * 0 : Don't log `dlsym` errors. (Default.) - * 1 : Log dlsym errors. - -#### BOX64_TRACE_FILE * -Send all log and trace to a file instead of `stdout` -Also, if name contains `%pid` then this is replaced by the actual PID of box64 instance -End the filename with `+` to have thetrace appended instead of overwritten -Use `stderr` to use this instead of default `stdout` - -#### BOX64_TRACE * -Only on build with trace enabled. Trace allow the logging of all instruction executed, along with register dump - * 0 : No trace. (Default.) - * 1 : Trace enabled. Trace start after the initialisation of all depending libraries is done. - * symbolname : Trace only `symbolname` (trace is disable if the symbol is not found). - * 0xXXXXXXX-0xYYYYYYY : Trace only between the 2 addresses. - -#### BOX64_TRACE_INIT * -Use BOX64_TRACE_INIT instead of BOX64_TRACE to start trace before the initialisation of libraries and the running program - * 0 : No trace. (Default.) - * 1 : Trace enabled. The trace start with the initialisation of all depending libraries is done. - -#### BOX64_TRACE_START * -Only on builds with trace enabled. - * NNNNNNN : Start trace only after NNNNNNNN opcode execute (number is an `uint64_t`). - -#### BOX64_TRACE_XMM * -Only on builds with trace enabled. - * 0 : The XMM (i.e. SSE/SSE2) register will not be logged with the general and x86 registers. (Default.) - * 1 : Dump the XMM registers. - -#### BOX64_TRACE_EMM * -Only on builds with trace enabled. - * 0 : The EMM (i.e. MMX) register will not be logged with the general and x86 registers. (Default.) - * 1 : Dump the EMM registers. - -#### BOX64_TRACE_COLOR * -Only on builds with trace enabled. - * 0 : The general registers will always be the default white color. (Default.) - * 1 : The general registers will change color in the dumps when they changed value. - -#### BOX64_LOAD_ADDR * -Try to load at 0xXXXXXX main binary (if binary is a PIE) - * 0xXXXXXXXX : The load address . (Only active on PIE programs.) - -#### BOX64_NOSIGSEGV * -Disable handling of SigSEGV. (Very useful for debugging.) - * 0 : Let the x86 program set sighandler for SEGV (Default.) - * 1 : Disable the handling of SigSEGV. - -#### BOX64_NOSIGILL * -Disable handling of SigILL (to ease debugging mainly). - * 0 : Let x86 program set sighandler for Illegal Instruction - * 1 : Disables the handling of SigILL - -#### BOX64_SHOWSEGV * -Show Segfault signal even if a signal handler is present - * 0 : Don"t force show the SIGSEGV analysis (Default.) - * 1 : Show SIGSEGV detail, even if a signal handler is present - -#### BOX64_SHOWBT * -Show some Backtrace (Nativ e and Emulated) whgen a signal (SEGV, ILL or BUS) is caught - * 0 : Don"t show backtraces (Default.) - * 1 : Show Backtrace detail (for native, box64 is rename as the x86_64 binary run) - -#### BOX64_X11THREADS * -Call XInitThreads when loading X11. (This is mostly for old Loki games with the Loki_Compat library.) - * 0 : Don't force call XInitThreads. (Default.) - * 1 : Call XInitThreads as soon as libX11 is loaded. - -#### BOX64_MMAP32 * -Will use 32bits address in priority for external MMAP (when 32bits process are detected) - * 0 : Use regular mmap (default, except for Snapdragron build) - * 1 : Use 32bits address space mmap in priority for external mmap as soon a 32bits process are detected (default for SnapDragon and TegraX1 build) - -#### BOX64_IGNOREINT3 * -What to do when a CC INT3 opcode is encounter in the code being run - * 0 : Trigger a TRAP signal if a handler is present - * 1 : Just skip silently the opcode - -#### BOX64_X11GLX * -Force libX11's GLX extension to be present. -* 0 : Do not force libX11's GLX extension to be present. -* 1 : GLX will always be present when using XQueryExtension. (Default.) - -#### BOX64_DYNAREC_DUMP * -Enables/disables Box64's Dynarec's dump. - * 0 : Disable Dynarec's blocks dump. (Default.) - * 1 : Enable Dynarec's blocks dump. - * 2 : Enable Dynarec's blocks dump with some colors. - -#### BOX64_DYNAREC_LOG * -Set the level of DynaRec's logs. - * 0 : NONE : No Logs for DynaRec. (Default.) - * 1 :INFO : Minimum Dynarec Logs (only unimplemented OpCode). - * 2 : DEBUG : Debug Logs for Dynarec (with details on block created / executed). - * 3 : VERBOSE : All of the above plus more. - -#### BOX64_DYNAREC * -Enables/Disables Box64's Dynarec. - * 0 : Disables Dynarec. - * 1 : Enable Dynarec. (Default.) - -#### BOX64_DYNAREC_TRACE * -Enables/Disables trace for generated code. - * 0 : Disable trace for generated code. (Default.) - * 1 : Enable trace for generated code (like regular Trace, this will slow down the program a lot and generate huge logs). - -#### BOX64_NODYNAREC * -Forbid dynablock creation in the interval specified (helpfull for debugging behaviour difference between Dynarec and Interpreter) - * 0xXXXXXXXX-0xYYYYYYYY : define the interval where dynablock cannot start (inclusive-exclusive) - -#### BOX64_DYNAREC_TEST * -Dynarec will compare it's execution with the interpreter (super slow, only for testing) - * 0 : No comparison. (Default.) - * 1 : Each opcode runs on interepter and on Dynarec, and regs and memory are compared and print if different. - * 2 : Thread-safe tests, extremely slow. - * 0xXXXXXXXX-0xYYYYYYYY : define the interval where dynarec is tested (inclusive-exclusive) - -#### BOX64_DYNAREC_BIGBLOCK * -Enables/Disables Box64's Dynarec building BigBlock. - * 0 : Don't try to build block as big as possible (can help program using lots of thread and a JIT, like C#/Unity) (Default when libmonobdwgc-2.0.so is loaded) - * 1 : Build Dynarec block as big as possible (Default.) - * 2 : Build Dynarec block bigger (don't stop when block overlaps, but only for blocks in elf memory) - * 3 : Build Dynarec block bigger (don't stop when block overlaps, for all type of memory) - -#### BOX64_DYNAREC_FORWARD * -Define Box64's Dynarec max allowed forward value when building Block. - * 0 : No forward value. When current block end, don't try to go further even if there are previous forward jumps - * XXX : Allow up to XXXX bytes of gap when building a Block after the block end to next forward jump (Default: 128) - -#### BOX64_DYNAREC_STRONGMEM * -Enable/Disable simulation of Strong Memory model -* 0 : Don't try anything special (Default.) -* 1 : Enable some Memory Barrier when writting to memory (on some MOV opcode) to simulate Strong Memory Model while trying to limit performance impact (Default when libmonobdwgc-2.0.so is loaded) -* 2 : All 1. plus a memory barrier on every write to memory using MOV -* 3 : All 2. plus Memory Barrier when reading from memory and on some SSE/SSE2 opcodes too - -#### BOX64_DYNAREC_X87DOUBLE * -Force the use of Double for x87 emulation -* 0 : Try to use float when possible for x87 emulation (default, faster) -* 1 : Only use Double for x87 emulation (slower, may be needed for some specific games, like Crysis) - -#### BOX64_DYNAREC_FASTNAN * -Enable/Disable generation of -NAN -* 0 : Generate -NAN like on x86 -* 1 : Don't do anything special with NAN, to go as fast as possible (default, faster) - -#### BOX64_DYNAREC_FASTROUND * -Enable/Disable generation of precise x86 rounding -* 0 : Generate float/double -> int rounding like on x86 -* 1 : Don't do anything special with edge case Rounding, to go as fast as possible (no INF/NAN/Overflow -> MIN_INT conversion) (default, faster) - -#### BOX64_DYNAREC_SAFEFLAGS * -Handling of flags on CALL/RET opcodes -* 0 : Treat CALL/RET as if it never needs any flags (faster but not advised) -* 1 : most of RET will need flags, most of CALLS will not (Default) -* 2 : All CALL/RET will need flags (slower, but might be needed. Automatically enabled for Vara.exe) - -#### BOX64_DYNAREC_CALLRET * -Optimisation of CALL/RET opcodes (not compatible with jit/dynarec/smc) -* 0 : Don't optimize CALL/RET, use Jump Table for boths (Default) -* 1 : Try to optimized CALL/RET, skipping the use of the JumpTable when possible - -#### BOX64_DYNAREC_ALIGNED_ATOMICS * -Generated code for aligned atomics only -* 0 : The code generated can handle unaligned atomics (Default) -* 1 : Generated code only for aligned atomics (faster and less code generated, but will SEGBUS if LOCK prefix is unsed on unaligned data) - -#### BOX64_DYNAREC_BLEEDING_EDGE * -Detect MonoBleedingEdge and apply conservative settings -* 0 : Don't detect MonoBleedingEdge -* 1 : Detect MonoBleedingEdge, and apply BIGBLOCK=0 STRONGMEM=1 if detected (Default) - -#### BOX64_DYNAREC_JVM * -Detect libjvm and apply conservative settings. Obsolete, use BOX64_JVM instead. -* 0 : Don't detect libjvm -* 1 : Detect libjvm, and apply BIGBLOCK=0 STRONGMEM=1 SSE42=0 if detected (Default) - -#### BOX64_DYNAREC_WAIT * -Behavior with FillBlock is not availble (FillBlock build Dynarec blocks and is not multithreaded) -* 0 : Dynarec will not wait for FillBlock to ready and use Interpreter instead (might speedup a bit massive multithread or JIT programs) -* 1 : Dynarec will wait for FillBlock to be ready (Default) - -#### BOX64_DYNAREC_MISSING * -Dynarec print the missing opcodes -* 0 : not print the missing opcode (Default, unless DYNAREC_LOG>=1 or DYNAREC_DUMP>=1 is used) -* 1 : Will print the missing opcodes - -#### BOX64_SSE_FLUSHTO0 * -Handling of SSE Flush to 0 flags -* 0 : Just track the flag (Default) -* 1 : Direct apply of SSE Flush to 0 flag - -#### BOX64_X87_NO80BITS * -Handling of x87 80bits long double -* 0 : Try to handle 80bits long double as precise as possible (Default) -* 1 : Handle them as double - -#### BOX64_MAXCPU -Maximum CPU Core exposed -* 0 : Don't cap the number of cpu core exposed (Default) -* XXX : Cap the maximum CPU Core exposed to XXX (usefull with wine64 or GridAutosport for example) - -#### BOX64_SYNC_ROUNDING * -Box64 will sync rounding mode with fesetround/fegetround. -* 0 : Disable rounding mode syncing. (Default.) -* 1 : Enable rounding mode syncing. - -#### BOX64_LIBCEF * -Detect libcef and apply malloc_hack settings -* 0 : Don't detect libcef -* 1 : Detect libcef, and apply MALLOC_HACK=2 if detected (Default) - -#### BOX64_JVM * -Detect libjvm and apply conservative settings -* 0 : Don't detect libjvm -* 1 : Detect libjvm, and apply BIGBLOCK=0 STRONGMEM=1 SSE42=0 if detected (Default) - -#### BOX64_UNITYPLAYER * -Detect UnityPlayer.dll and apply strongmem settings -* 0 : Don't detect UnityPlayer.dll -* 1 : Detect UnityPlayer.dll, and apply BOX64_DYNAREC_STRONGMEM=1 if detected (Default) - -#### BOX64_SDL2_JGUID * -Need a workaround for SDL_GetJoystickGUIDInfo function for wrapped SDL2 -* 0 : Don't use any workaround -* 1 : Use a workaround for program that use the private SDL_GetJoystickGUIDInfo function with 1 missing argument - -#### BOX64_LIBGL * - * libXXXX set the name for libGL (defaults to libGL.so.1). - * /PATH/TO/libGLXXX : Sets the name and path for libGL - You can also use SDL_VIDEO_GL_DRIVER - -#### BOX64_LD_PRELOAD - * XXXX[:YYYYY] force loading XXXX (and YYYY...) libraries with the binary - PreLoaded libs can be emulated or native, and are treated the same way as if they were comming from the binary - -#### BOX64_EMULATED_LIBS * - * XXXX[:YYYYY] force lib XXXX (and YYYY...) to be emulated (and not wrapped) -Some games uses an old version of some libraries, with an ABI incompatible with native version. -Note that LittleInferno for example is auto detected, and libvorbis.so.0 is automatical added to emulated libs, and same for Don't Starve (and Together / Server variant) that use an old SDL2 too - -#### BOX64_ALLOWMISSINGLIBS * -Allow Box64 to continue even if a library is missing. - * 0 : Box64 will stop if a library cannot be loaded. (Default.) - * 1 : Continue even if a needed library cannot be loaded. Unadvised, this will, in most cases, crash later on. - -#### BOX64_PREFER_WRAPPED * -Box64 will use wrapped libs even if the lib is specified with absolute path - * 0 : Try to use emulated libs when they are defined with absolute path (Default.) - * 1 : Use Wrapped native libs even if path is absolute - -#### BOX64_PREFER_EMULATED * -Box64 will prefer emulated libs first (execpt for glibc, alsa, pulse, GL, vulkan and X11 - * 0 : Native libs are prefered (Default.) - * 1 : Emulated libs are prefered (Default for program running inside pressure-vessel) - -#### BOX64_CRASHHANDLER * -Box64 will use a dummy crashhandler.so library - * 0 : Use Emulated crashhandler.so library if needed - * 1 : Use an internal dummy (completly empty) crashhandler.so library (defaut) - -#### BOX64_MALLOC_HACK * -How Box64 will handle hooking of malloc operators - * 0 : Don't allow malloc operator to be redirected, rewriting code to use regular function (Default) - * 1 : Allow malloc operator to be redirected (not advised) - * 2 : Like 0, but track special mmap / free (some redirected functions were inlined and cannot be redirected) - -#### BOX64_NOPULSE * -Disables the load of pulseaudio libraries. - * 0 : Load pulseaudio libraries if found. (Default.) - * 1 : Disables the load of pulse audio libraries (libpulse and libpulse-simple), both the native library and the x86 library - -#### BOX64_NOGTK * -Disables the loading of wrapped GTK libraries. - * 0 : Load wrapped GTK libraries if found. (Default.) - * 1 : Disables loading wrapped GTK libraries. - -#### BOX64_NOVULKAN * -Disables the load of vulkan libraries. - * 0 : Load vulkan libraries if found. - * 1 : Disables the load of vulkan libraries, both the native and the i386 version (can be useful on Pi4, where the vulkan driver is not quite there yet.) - -#### BOX64_SSE42 * -Expose or not SSE 4.2 capabilites - * 0 : Do not expose SSE 4.2 capabilites (default when libjvm is detected) - * 1 : Expose SSE 4.2 capabilites (Default.) - -#### BOX64_FUTEX_WAITV * -Use of the new fuext_waitc syscall - * 0 : Do not try to use it, return unsupported (Default for BAD_SIGNAL build) - * 1 : let program use the syscall if the host system support it (Default for other build) - -#### BOX64_BASH * -Define x86_64 bash to launch script - * yyyy - Will use yyyy as x86_64 bash to launch script. yyyy needs to be a full path to a valid x86_64 version of bash - -#### BOX64_ENV * - * XXX=yyyy - will add XXX=yyyy env. var. - -#### BOX64_ENV1 * - * XXX=yyyy - will add XXX=yyyy env. var. and continue with BOX86_ENV2 ... until var doesn't exist - -#### BOX64_RESERVE_HIGH * -* 0 : Don't try to pe-reserve high memory (beyond 47bits) (Default) -* 1 : Try to reserve (without allocating it) memory beyond 47bits (seems unstable) - -#### BOX64_JITGDB * - * 0 : Just print the Segfault message on segfault (default) - * 1 : Launch `gdb` when a segfault, bus error or illegal instruction signal is trapped, attached to the offending process and go in an endless loop, waiting. - When in gdb, you need to find the correct thread yourself (the one with `my_box64signalhandler` in is stack) - then probably need to `finish` 1 or 2 functions (inside `usleep(..)`) and then you'll be in `my_box64signalhandler`, - just before the printf of the Segfault message. Then simply - `set waiting=0` to exit the infinite loop. - * 2 : Launch `gdbserver` when a segfault, bus error or illegal instruction signal is trapped, attached to the offending process, and go in an endless loop, waiting. - Use `gdb /PATH/TO/box64` and then `target remote 127.0.0.1:1234` to connect to the gdbserver (or use actual IP if not on the machine). After that, the procedure is the same as with ` BOX64_JITGDB=1`. - This mode can be usefullwhen programs redirect all console output to a file (like Unity3D Games) - * 3 : Launch `lldb` when a segfault, bus error or illegal instruction signal is trapped, attached to the offending process and go in an endless loop, waiting. - -#### BOX64_NORCFILES -If the env var exist, no rc files (like /etc/box64.box64rc and ~/.box64rc) will be loaded - -#### BOX64_RCFILE -If the env var is set and file exists, this variable will be used as path to the box64rc file instead of default paths (BOX64_RCFILE is loaded first, default paths are not loaded) - ----- - -Those variables are only valid inside a rcfile: ----- - -#### BOX64_NOSANDBOX - * 0 : Nothing special - * 1 : Added "--no-sandbox" to command line arguments (usefull for chrome based programs) - -#### BOX64_INPROCESSGPU - * 0 : Nothing special - * 1 : Added "--in-process-gpu" to command line arguments (usefull for chrome based programs) - -#### BOX64_CEFDISABLEGPU - * 0 : Nothing special - * 1 : Added "-cef-disable-gpu" to command line arguments (usefull for steamwebhelper/cef based programs) - -#### BOX64_CEFDISABLEGPUCOMPOSITOR - * 0 : Nothing special - * 1 : Added "-cef-disable-gpu-compositor" to command line arguments (usefull for steamwebhelper/cef based programs) - -#### BOX64_EXIT - * 0 : Nothing special - * 1 : Just exit, don't try to run the program + +Usage +---- + +There are many environment variables to control Box64's behaviour, which will be listed below by category. + +There are 2 types of Box64 builds: the Wine WOW64 build (WowBox64) and the regular Linux build. Beware only some of the environment variables are available in WowBox64. + +### Configuration files + +In addition to environment variables, if you're using the regular Linux build, Box64 also looks for 2 places for rcfile by default: the system-wide `/etc/box64.box64rc` and user-specific `~/.box64rc`. +While in WowBox64, the configuration file is checked at `%USERPROFILE%/.box64rc` only. +Settings priority follows this order (from highest to lowest): `~/.box64rc` > `/etc/box64.box64rc` > environment variables. + +Example configuration: + +``` +[factorio] +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_BIGBLOCK=2 +BOX64_DYNAREC_FORWARD=1024 +BOX64_DYNAREC_CALLRET=1 +``` + +This configuration will apply the specified settings application-wide to any executable named `factorio`. + +### Advanced usage for Linux build + +1. **Wildcard Matching** + + Asterisks (`*`) can be used for basic pattern matching in application names. For instance, `[*setup*]` will match any program containing "setup" in its name. Note this implements simple wildcard matching rather than full regex support. +2. **Custom Configuration File** + + The `BOX64_RCFILE` environment variable can specify an alternative configuration file instead of the default `/etc/box64.box64rc`. +3. **Per-File Settings** + + Sections starting with `/` apply to specific files. For example: + ``` + [/d3d9.dll] + BOX64_DYNAREC_SAFEFLAGS=0 + ``` + These settings will only affect the `d3d9.dll` file. This syntax also works for **emulated** Linux libraries, e.g., `[/libstdc++.so.6]`. + +---- + +## Performance + +### BOX64_DYNAREC + +Enable/disable the Dynamic Recompiler (a.k.a DynaRec). This option defaults to 1 if it's enabled in the build options for a supported architecture. Available in WowBox64. + + * 0: Disable DynaRec. + * 1: Enable DynaRec. + +### BOX64_DYNAREC_ALIGNED_ATOMICS + +Generate aligned atomics only (only available on Arm64 for now). Available in WowBox64. + + * 0: Generate unaligned atomics handling code. [Default] + * 1: Generate aligned atomics only, which is faster and smaller code size, but will cause SIGBUS for LOCK prefixed opcodes operating on unaligned data addresses. + +### BOX64_DYNAREC_BIGBLOCK + +Enable building bigger DynaRec code blocks for better performance. Available in WowBox64. + + * 0: Do not try to build block as big as possible, suitable for programs using lots of threads and JIT, like Unity. + * 1: Build Dynarec block as big as possible. + * 2: Build Dynarec block bigger, do not stop when block overlaps, but only for blocks in elf memory. [Default] + * 3: Build Dynarec block bigger, do not stop when block overlaps, for all type of memory, useful for wine programs. + +### BOX64_DYNAREC_CALLRET + +Optimize CALL/RET opcodes. Available in WowBox64. + + * 0: Do not optimize CALL/RET, use jump table. [Default] + * 1: Try to optimize CALL/RET, skipping the jump table when possible. + * 2: Try to optimize CALL/RET, skipping the jump table when possible, adding code to handle return to dirty/modified block. Does not work on WowBox64. + +### BOX64_DYNAREC_DF + +Enable or disable the use of deferred flags. Available in WowBox64. + + * 0: Disable the use of deferred flags. + * 1: Enable the use of deferred flags. [Default] + +### BOX64_DYNAREC_DIRTY + +Allow continue running a block that is unprotected and potentially dirty. + + * 0: Do not allow continue running a block that is unprotected and potentially dirty. [Default] + * 1: Allow continue to run a dynablock that write data in the same page as code. It can gets faster in loading time of some game but can also get unexpected crashes. + * 2: Will also, when it detect an HotPage, flag that page as NEVERCLEAN, and so it will not be write protected but Block build from that page will always be tested. It can be faster that way (but soem SMC case might not be trapped). + +### BOX64_DYNAREC_NOHOTPAGE + +Disable detection of hot page (where code is executed and data written at the same time). + + * 0: Detect hot page [Default] + * 1: Do not detect hot page + +### BOX64_DYNAREC_HOTPAGE_ALT + +Use alternative way to detect HotPages (legacy way). + + * 0: Detect hot page, using new method from v0.3.9+ [Default] + * 1: Use alternate method to detect HotPage (from v0.3.8 and earlier) + +### BOX64_DYNAREC_FASTNAN + +Enable or disable fast NaN handling. Available in WowBox64. + + * 0: Precisely emulate the -NaN generation like on x86. + * 1: Do not do anything special with -NAN generation, faster. [Default] + +### BOX64_DYNAREC_FASTROUND + +Enable or disable fast rounding. Available in WowBox64. + + * 0: Generate float/double -> int rounding and use current rounding mode for float/double computation like on x86. + * 1: Do not do anything special with edge case rounding, faster. [Default] + * 2: Generate float/double -> int rounding using current rounding mode for float/double computation like on x86, but use fast int -> float/double conversion. + +### BOX64_DYNAREC_FORWARD + +Define max allowed forward value when building block. Available in WowBox64. + + * 0: No forward value. When current block ends, do not try to go further even if there are previous forward jumps. + * 128: Allow up to 128 bytes of gap between end of the block and the next forward jump. [Default] + * XXXX: Allow up to XXXX bytes of gap between end of the block and the next forward jump. + +### BOX64_DYNAREC_NATIVEFLAGS + +Enable or disable the use of native flags. Available in WowBox64. + + * 0: Do not use native flags. + * 1: Use native flags when possible. [Default] + +### BOX64_DYNAREC_PAUSE + +Enable x86 PAUSE emulation, may help the performance of spinlocks. Available in WowBox64. + + * 0: Ignore x86 PAUSE instruction. [Default] + * 1: Use YIELD to emulate x86 PAUSE instruction. + * 2: Use WFI to emulate x86 PAUSE instruction. + * 3: Use SEVL+WFE to emulate x86 PAUSE instruction. + +### BOX64_DYNAREC_PURGE + +Purge dynablocks that haven't been executed recently, based on tick age threshold (BOX64_DYNAREC_PURGE_AGE). + + * 0: Dynarec will not purge old unused dynablocks. [Default] + * 1: Dynarec will purge old unused dynablocks based on tick age. + +### BOX64_DYNAREC_PURGE_AGE + +Tick age threshold for dynablock purging (requires BOX64_DYNAREC_PURGE=1). + + * 4096: Default age threshold. [Default] + * XXXX: Custom age threshold (range: 10-65536). + +### BOX64_DYNAREC_SAFEFLAGS + +Behaviour of flags emulation on CALL/RET opcodes and other edge cases. Available in WowBox64. + + * 0: Treat CALL/RET as if it never needs any flags. + * 1: Most of RETs will need flags, most of CALLs will not. [Default] + * 2: All CALL/RET will need flags. All edge cases are also handled. + +### BOX64_DYNAREC_STRONGMEM + +Enable the emulation of x86 strong memory model. Available in WowBox64. + + * 0: Do not try anything special. [Default] + * 1: Enable some memory barriers when writing to memory to emulate the x86 strong memory model in a limited way. + * 2: All in 1, plus memory barriers on SIMD instructions. + * 3: All in 2, plus more memory barriers on a regular basis. + +### BOX64_DYNAREC_VOLATILE_METADATA + +Use volatile metadata parsed from PE files, only valid for 64bit Windows games. + + * 0: Do not use volatile metadata. + * 1: Use volatile metadata, which will guide Box64 for better strong memory emulation. [Default] + +### BOX64_DYNAREC_WAIT + +Wait or not for the building of a DynaRec code block to be ready. Available in WowBox64. + + * 0: Do not wait and use interpreter instead, might speedup a bit on massive multithread or JIT programs. + * 1: Wait for a DynaRec code block to be ready. [Default] + +### BOX64_DYNAREC_WEAKBARRIER + +Tweak the memory barriers to reduce the performance impact by strong memory emualtion. Available in WowBox64. + + * 0: Use regular safe barrier. + * 1: Use weak barriers to have more performance boost. [Default] + * 2: All in 1, plus disabled the last write barriers. + +### BOX64_DYNACACHE + +Enable/disable the Dynamic Recompiler Cache (a.k.a DynaCache). This option defaults to 2 (to read cache if present but not generate any). DynaCache write file to home folder by default, and can grow without limit. + + * 0: Disable DynaCache. + * 1: Enable DynaCache. + * 2: Use DynaCache files if present, but do not generate new one. [Default] + +### BOX64_DYNACACHE_FOLDER + +Set the folder for DynaCache files. Default is $XDG_CACHE_HOME/box64 or $HOME/.cache/box64 if $XDG_CACHE_HOME is not set. + + * XXXX: Use folder XXXX for DynaCache files. + +### BOX64_DYNACACHE_MIN + +Minimum size, in KB, for a DynaCache to be written to disk. Default size is 350KB + + * XXXX: Set a minimum size of XXXX KB of Dynarec code to write the dynacache to disk. Will not be saved to disk else. + * 350: A size of 350 KB is the default value. [Default] + +### BOX64_MMAP32 + +Force 32-bit compatible memory mappings on 64-bit programs that run 32-bit code (like Wine WOW64), can improve performance. + + * 0: Do not force 32-bit memory mappings. + * 1: Force 32-bit memory mappings. [Default] + +### BOX64_NODYNAREC + +Forbid dynablock creation in the address range specified, helpful for debugging behaviour difference between Dynarec and Interpreter. Available in WowBox64. + + * 0xXXXXXXXX-0xYYYYYYYY: Define the range where dynablock creation is forbidden (inclusive-exclusive). + +### BOX64_DYNAREC_NOARCH + +Remove Architecture metatdata from Dynarec blocks (used on signal). Available in WowBox64. + + * 0: Generate all architecture metadata for each blocks, including x87/mmx/SSE/AVX regs tracking. Wil use some more memory. [Default] + * 1: Generate only essential metadata for each blocks (flags, alignments), saving some memory, but some encrypted software might fails. + * 2: Do not generate metadata for blocks. Saving a bit more memory but might fails on signal handling. + +### BOX64_RDTSC_1GHZ + +Use hardware counter for rdtsc if available. + + * 0: Use hardware counter for rdtsc opcode if available. [Default] + * 1: Use hardware counter for rdtsc if and only if precision is at least 1GHz. + +## Arguments + +### BOX64_ARGS + +Arguments to pass to the guest program, only valid if there is no existing arguments. + + * XXXX: Pass argument XXXX to the program. + * XXXX YYYY ZZZZ: Pass arguments XXXX, YYYY and ZZZZ to the guest program. + +### BOX64_INSERT_ARGS + +Prepend arguments to the command line. + + * XXXX: Prepend argument XXXX to the program. + * XXXX YYYY ZZZZ: Prepend arguments XXXX, YYYY and ZZZZ to the guest program. + +### BOX64_INPROCESSGPU + +Add --in-process-gpu argument to the guest program. + + * 0: Does nothing. [Default] + * 1: Add --in-process-gpu argument to the guest program. + +### BOX64_NOSANDBOX + +Add --no-sandbox argument to the guest program. + + * 0: Does nothing. [Default] + * 1: Add --no-sandbox argument to the guest program. + +## Compatibility + +### BOX64_AES + +Expose AES capabilities. Available in WowBox64. + + * 0: Do not expose AES capabilities. + * 1: Expose AES capabilities. [Default] + +### BOX64_ARCH + +Specify the architecture in rcfiles to which the current entry applies. This option only takes effect when used inside rcfiles. + + * `arm64`: Only apply current entry for AArch64. + * `la64`: Only apply current entry for LoongArch64. + * `rv64`: Only apply current entry for RISC-V. + * ``: Apply current entry for all architectures, will be replaced by more specific entries. [Default] + +### BOX64_AVX + +Expose AVX extension to CPUID and cpuinfo file. Default value is 2 on Arm64 because it's fully implemented in DynaRec, 0 otherwise. Available in WowBox64. + + * 0: Do not expose AVX capabilities. + * 1: Expose AVX, BMI1, F16C and VAES extensions to CPUID and cpuinfo file. + * 2: All in 1, plus AVX2, BMI2, FMA, ADX,VPCLMULQDQ and RDRAND extensions. + +### BOX64_BASH + +Path to the bash executable. + + * XXXX: Use bash executable at path XXXX. + +### BOX64_CPUTYPE + +Specify the CPU type to emulate. Available in WowBox64. + + * 0: Emulate a Intel CPU Model. [Default] + * 1: Emulate a AMD CPU Model. + +### BOX64_CRASHHANDLER + +Use a dummy crash handler or not. + + * 0: Use emulated crashhandler.so library if needed. + * 1: Use an internal dummy (empty) crashhandler.so library. [Default] + +### BOX64_DYNAREC_BLEEDING_EDGE + +Detect MonoBleedingEdge and apply conservative settings (Linux only). + + * 0: Do not detect MonoBleedingEdge. + * 1: Detect MonoBleedingEdge and apply BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_STRONGMEM=1 when detected. [Default] + +### BOX64_DYNAREC_DIV0 + +Enable or disable the generation of division-by-zero exception. Available in WowBox64. + + * 0: Do not generate the division-by-zero exception. [Default] + * 1: Generate the division-by-zero exception. + +### BOX64_DYNAREC_TBB + +Enable or disable libtbb detection. + + * 0: Do not detect libtbb. + * 1: Detect libtbb and apply conservative settings. [Default] + +### BOX64_DYNAREC_X87DOUBLE + +Force the use of float/double for x87 emulation. Available in WowBox64. + + * 0: Try to use float when possible for x87 emulation. [Default] + * 1: Only use Double for x87 emulation. + * 2: Check Precision Control low precision on x87 emulation. + +### BOX64_DYNAREC_INTERP_SIGNAL + +Allow the use of Dynarec in Signal Handlers. + + * 0: Allow the use of Dynarec in signal handlers. [Default] + * 1: Only use the Interpreter for signal handlers (as it was in v0.3.8 and earlier). + +### BOX64_EXIT + +Just exit, do not try to run the program. + + * 0: Does nothing. [Default] + * 1: Just exit. + +### BOX64_FIX_64BIT_INODES + +Fix 64bit inodes. + + * 0: Do not fix 64bit inodes. [Default] + * 1: Fix 64bit inodes. + +### BOX64_IGNOREINT3 + +Ignore INT3 instructions. + + * 0: Trigger a TRAP signal if a handler is present. [Default] + * 1: Skip the opcode silently. + +### BOX64_JVM + +Detect libjvm and apply conservative settings. + + * 0: Does nothing. + * 1: Detect libjvm, and apply BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_STRONGMEM=1 BOX64_SSE42=0 when detected. [Default] + +### BOX64_LIBCEF + +Detect libcef and apply BOX64_MALLOC_HACK settings. + + * 0: Does nothing. [Default] + * 1: Detect libcef, and apply BOX64_MALLOC_HACK=2 if detected. + +### BOX64_MALLOC_HACK + +Behaviour when hooking malloc operators. + + * 0: Don't allow malloc operator to be redirected, rewriting code to use regular function. [Default] + * 1: Allow malloc operator to be redirected. + * 2: Like 0, but track special mmap/free (some redirected functions are inlined and cannot be redirected). + +### BOX64_MAXCPU + +Maximum CPU cores exposed. Available in WowBox64. + + * 0: Use the actual number of CPU cores. [Default] + * XXXX: Use XXXX CPU cores. + +### BOX64_NORCFILES + +Do not load any rc files. + + * 0: Load rc files. [Default] + * 1: Do not load any rc files. + +### BOX64_PATH + +Path to look for x86_64 binaries. + + * XXXX: Add path XXXX to the binary path. + +### BOX64_PCLMULQDQ + +Expose PCLMULQDQ capabilities. Available in WowBox64. + + * 0: Do not expose PCLMULQDQ capabilities. + * 1: Expose PCLMULQDQ capabilities. [Default] + +### BOX64_PROFILE + +Predefined sets of environment variables with compatibility or performance in mind. Available in WowBox64. + + * safest: Profile with all the unsafe DynaRec optimizations disabled. + * safe: Well, less safer than safest. + * default: The default settings that most programs runs fine with a handy performance. [Default] + * fast: Enable many unsafe optimizations, but also enable strongmem emulation. + * fastest: Enable many unsafe optimizations to have a better performance. + +### BOX64_PYTHON3 + +Path to a python3 executable. + + * XXXX: Use python3 executable at path XXXX. + +### BOX64_RCFILE + +Path to the rc file to load. + + * XXXX: Load the rc file XXXX, default rc files will not be loaded. + +### BOX64_RESERVE_HIGH + +Reserve high memory area for the program, always enabled on Box32. + + * 0: Do not reserve high memory area for the program. [Default] + * 1: Reserve high memory area for the program. + +### BOX64_SDL2_JGUID + +Use a workaround for SDL_GetJoystickGUIDInfo function for wrapped SDL2. + + * 0: Does nothing. [Default] + * 1: Use a workaround for SDL_GetJoystickGUIDInfo function for wrapped SDL2. + +### BOX64_SHAEXT + +Expose SHAEXT (a.k.a. SHA_NI) capabilities. Available in WowBox64. + + * 0: Do not expose SHAEXT capabilities. + * 1: Expose SHAEXT capabilities. [Default] + +### BOX64_SSE_FLUSHTO0 + +Behaviour of SSE Flush to 0 flags. Also tracking SSE exception flags. Available in WowBox64. + + * 0: Just track the flag. [Default] + * 1: Apply SSE Flush to 0 flag directly. Also reflect SSE exception flags in Dynarec (if available) + +### BOX64_SSE42 + +Expose SSE4.2 capabilities. Available in WowBox64. + + * 0: Do not expose SSE4.2 capabilities. + * 1: Expose SSE4.2 capabilities. [Default] + +### BOX64_STEAM_VULKAN + +Force Vulkan for Linux Steam UI. + + * 0: Do nothing. [Default] + * 1: Force Vulkan for Linux Steam UI. + +### BOX64_SYNC_ROUNDING + +Synchronize rounding mode between x86 and native. + + * 0: Do not synchronize rounding mode. [Default] + * 1: Synchronize rounding mode between x86 and native. + +### BOX64_UNITYPLAYER + +Detect UnityPlayer and apply conservative settings. + + * 0: Does nothing. + * 1: Detect UnityPlayer (Windows or Linux), and apply BOX64_UNITY=1 when detected. [Default] + +### BOX64_UNITY + +Games is a Unity one. + + * 0: Does nothing. + * 1: Unity Game, use special detecting code for Windows, apply BOX64_DYNAREC_STRONGMEM=1 for Linux. [Default] + +### BOX64_X11GLX + +Force Xorg GLX extension to be present. + + * 0: Do not force Xorg GLX extension to be present. [Default] + * 1: Require Xorg GLX extension when using XQueryExtension. + +### BOX64_X11SYNC + +Force synchronized operation on X11 display. + + * 0: Do not force synchronized operation on X11 display. [Default] + * 1: Force synchronized operation on X11 display. + +### BOX64_X11THREADS + +Call XInitThreads when loading X11. This is mostly for old Loki games with the Loki_Compat library. + + * 0: Do not call XInitThreads. [Default] + * 1: Call XInitThreads as soon as libX11 is loaded. + +### BOX64_X87_NO80BITS + +Behavoiur of x87 80bits long double. Available in WowBox64. + + * 0: Try to handle 80bits long double as precise as possible. [Default] + * 1: Use 64bits double for x87. + +## Debugging + +### BOX64_DLSYM_ERROR + +Enable or disable the logging of dlsym errors. + + * 0: Disable the logging of dlsym errors. [Default] + * 1: Enable the logging of dlsym errors. + +### BOX64_DUMP + +Dump elfloader debug information. Available in WowBox64. + + * 0: Do not dump elfloader debug information. [Default] + * 1: Dump elfloader debug information. + +### BOX64_DYNAREC_DUMP + +Enable DynaRec dump. Available in WowBox64. + + * 0: Do not dump DynaRec blocks. [Default] + * 1: Dump DynaRec blocks. + * 2: Dump DynaRec blocks with some colors. + +### BOX64_DYNAREC_DUMP_RANGE + +Dump DynaRec blocks in the specified range. Available in WowBox64. + + * 0xXXXXXXXX-0xYYYYYYYY: Define the range where dynablock gets dumped (inclusive-exclusive). + +### BOX64_DYNAREC_GDBJIT + +The GDBJIT debugging support, only available on build with `-DGDBJIT=ON`, enable it with gdb command: jit-reader-load /usr/local/lib/libbox64gdbjitreader.so. + + * 0: Dynarec will not generate GDBJIT debuginfo. [Default] + * 1: Dynarec will generate GDBJIT debuginfo. + * 2: Dynarec will generate detailed GDBJIT debuginfo with internal state. + * 3: Dynarec will register detailed GDBJIT debuginfo only for dynablocks that the guest program trap into, greatly improving performance. + * 0xXXXXXXX-0xYYYYYYY: Define the range where Dynarec will generate detailed GDBJIT debuginfo with internal state. + +### BOX64_DYNAREC_LOG + +Disable or enable DynaRec logs. Available in WowBox64. + + * 0: Disable DynaRec logs. [Default] + * 1: Enable minimal DynaRec logs. + * 2: Enable debug level DynaRec logs. + * 3: Enable verbose level DynaRec logs. + +### BOX64_DYNAREC_MISSING + +Print missing opcodes. Available in WowBox64. + + * 0: Do not print the missing opcode. [Default] + * 1: Print missing opcodes. + * 2: Print the fallback to scalar opcodes, only valid on RISC-V. + +### BOX64_DYNAREC_NOHOSTEXT + +Disable optional host extensions. + + * 0: Disable nothing. [Default] + * 1: Disable all the optional extensions. + * xxx,yyy,zzz: Disable selected optional extensions, choices are Arm: `crc32,pmull,aes,atomics,sha1,sha2,uscat,flagm,flagm2,frintts,afp,rndr`, LoongArch: `lasx,lbt,frecipe,lam_bh,lamcas,scq`, and RISC-V: `zba,zbb,zbc,zbs,vector,xtheadba,xtheadbb,xtheadbs,xtheadmemidx,xtheadmempair,xtheadcondmov`. + +### BOX64_DYNAREC_PERFMAP + +Generate map file for Linux perf tool. + + * 0: Dynarec will not generate perf map. [Default] + * 1: Dynarec will generate perf map. + +### BOX64_DYNAREC_TEST + +Enable DynaRec execution comparison with the interpreter, very slow, only for testing. Available in WowBox64. + + * 0: No comparison. [Default] + * 1: Each opcode runs on interpreter and on Dynarec, regs and memory are compared and printed when they differ. + * 0xXXXXXXXX-0xYYYYYYYY: Define the range where dynarec is tested (inclusive-exclusive). + +### BOX64_DYNAREC_TEST_NODUP + +Enable deduplication of IP address where COSIM find a difference. Available in WowBox64. + + * 0: Show all addresses in error. [Default] + * 1: Show address in error only 1 time, even if dump might differs. + +### BOX64_DYNAREC_TEST_NODUMP + +Do not dump test code when BOX64_DYNAREC_DUMP is enabled. Available in WowBox64. + + * 0: Dump test code. + * 1: Do not dump test code. [Default] + +### BOX64_DYNAREC_TRACE + +Enable or disable DynaRec trace. + + * 0: Do not trace DynaRec blocks. [Default] + * 1: Trace DynaRec blocks, will slow down the program a lot and generates huge logs. + +### BOX64_JITGDB + +Launch gdb or not for SIGSEGV, SIGILL, and SIGBUS. + + * 0: Just print the message when the signal is caught. [Default] + * 1: Launch gdb when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process and go in an endless loop, waiting. Inside gdb, you need to find the correct thread yourself (the one with `my_box64signalhandler` in is stack), then probably need to `finish` 1 or 2 functions (inside `usleep(..)`) and then you'll be in `my_box64signalhandler`, just before the printf of the Segfault message. Then `set waiting=0` to exit the infinite loop. + * 2: Launch gdbserver when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process, and go in an endless loop, waiting. Use `gdb /PATH/TO/box64` and then `target remote 127.0.0.1: 1234` to connect to the gdbserver (or use actual IP if not on the machine). After that, the procedure is the same as with `BOX64_JITGDB=1`. + * 3: Launch lldb when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process and go in an endless loop, waiting. + +### BOX64_LOAD_ADDR + +Set the address where the program is loaded, only active for PIE guest programs. + + * 0xXXXXXXXX: Set the address where the program is loaded. + +### BOX64_LOG + +Enable or disable Box64 logs, default value is 0 if stdout is not terminal, 1 otherwise. Available in WowBox64. + + * 0: Disable Box64 logs. + * 1: Enable minimal Box64 logs. + * 2: Enable debug level Box64 logs. + * 3: Enable verbose level Box64 logs. + +### BOX64_NOBANNER + +Disable the Box64 banner. Available in WowBox64. + + * 0: Show the Box64 banner. + * 1: Do not show the Box64 banner. + +### BOX64_NODYNAREC_DELAY + +Remove NoDynarec range after a delay. Available in WowBox64. + + * 0: Do not remove NoDynarec range. [Default] + * 1: Remove the NoDynarec range once 2 threads have been created. + +### BOX64_NOSIGSEGV + +Disable the handling of SIGSEGV. + + * 0: Let the x86 program set sighandler for SIGSEGV. [Default] + * 1: Disable the handling of SIGSEGV. + +### BOX64_NOSIGILL + +Disable the handling of SIGILL. + + * 0: Let the x86 program set sighandler for SIGILL. [Default] + * 1: Disable the handling of SIGILL. + +### BOX64_ROLLING_LOG + +Show last few wrapped function call when a signal is caught. + + * 0: Does nothing. [Default] + * 1: Show last 16 wrapped function call when a signal is caught. + * XXXX: Show last XXXX wrapped function call when a signal is caught. + +### BOX64_SHOWBT + +Show native and emulated backtrace when a signal is caught. + + * 0: Does nothing. [Default] + * 1: Show native and emulated backtrace when a signal is caught. + +### BOX64_SHOWSEGV + +Always show SIGSEGV signal detailes. + + * 0: Does nothing. [Default] + * 1: Always show SIGSEGV signal detailes. + +### BOX64_TRACE_COLOR + +Enable or disable colored trace output. + + * 0: Disable colored trace output. [Default] + * 1: Enable colored trace output. + +### BOX64_TRACE_EMM + +Enable or disable EMM (i.e. MMX) trace output. + + * 0: Disable EMM trace output. [Default] + * 1: Enable EMM trace output. + +### BOX64_TRACE_FILE + +Send all log and trace to a file instead of `stdout`. + + * XXXX: Send all log and trace to file XXXX. + * XXXX%pid: Send all log and trace to file XXXX with pid appended. + * stderr: Send all log and trace to `stderr`. [Default] + * stdout: Send all log and trace to `stdout`. + +### BOX64_TRACE_INIT + +Same as BOX64_TRACE but starts the trace immediately. + + * 0: Disable trace output. [Default] + * 1: Enable trace output. Trace starts before the initialization of dependencies. + * symbolname: Enable trace output for `symbolname` only. Trace starts before the initialization of dependencies. + * 0xXXXXXXX-0xYYYYYYY: Enable trace output for the range of address (inclusive-exclusive). Trace starts before the initialization of dependencies. + +### BOX64_TRACE_START + +Start trace after N opcodes executed. + + * 0: Start trace immediately. [Default] + * 1: Start trace after 1 opcode executed. + * XXXX: Start trace after XXXX opcodes executed. + +### BOX64_TRACE_XMM + +Enable or disable XMM (i.e. SSE) trace output. + + * 0: Disable XMM trace output. [Default] + * 1: Enable XMM trace output. + +### BOX64_TRACE + +Only available on box64 build with trace. Adds trace of all instructions executed, along with a register dump. + + * 0: Disable trace output. [Default] + * 1: Enable trace output. + * symbolname: Enable trace output for `symbolname` only. + * 0xXXXXXXX-0xYYYYYYY: Enable trace output for the range of address (inclusive-exclusive). + +## Environment + +### BOX64_ENV + +Add an environment variable. + + * XXXX=yyyy: Add environment variable XXXX with value yyyy. + +### BOX64_ENV[1-5] + +Add an environment variable. + + * XXXX=yyyy: Add environment variable XXXX with value yyyy. + +## Libraries + +### BOX64_ADDLIBS + +Add extras to the needed libraries list, rarely needed. + + * XXXX: Add library XXXX to the needed libraries list. + * XXXX:YYYY:ZZZZ: Add library XXXX, YYYY and ZZZZ to the needed libraries list. + +### BOX64_ALLOWMISSINGLIBS + +Allow missing libraries to be ignored. + + * 0: Do not allow missing libraries. [Default] + * 1: Allow missing libraries. + +### BOX64_EMULATED_LIBS + +Force the use of emulated libraries. + + * XXXX: Force the use of emulated library XXXX. + * XXXX:YYYY:ZZZZ: Force the use of emulated libraries XXXX, YYYY and ZZZZ. + +### BOX64_LD_LIBRARY_PATH + +Path to look for x86_64 libraries. + + * XXXX: Add path XXXX to the library path. + +### BOX64_LD_PRELOAD + +Force loading libraries with the binary. + + * XXXX: Force the loading of library XXXX. + * XXXX:YYYY: Force the loading of libraries XXXX and YYYY. + +### BOX64_LIBGL + +Set the name for libGL. + + * libXXXX: Set the name for libGL to libXXXX. + * /path/to/libXXXX: Set the name and path for libGL to /path/to/libXXXX, you can also use SDL_VIDEO_GL_DRIVER. + +### BOX64_NOGTK + +Do not load wrapped GTK libraries. + + * 0: Load wrapped GTK libraries. [Default] + * 1: Do not load wrapped GTK libraries. + +### BOX64_NOPULSE + +Do not load PulseAudio libraries (both native and x86_64). + + * 0: Load PulseAudio libraries. [Default] + * 1: Do not load PulseAudio libraries. + +### BOX64_NOVULKAN + +Do not load Vulkan libraries. + + * 0: Load Vulkan libraries. [Default] + * 1: Do not load Vulkan libraries, both native and x86_64. + +### BOX64_PREFER_EMULATED + +Prefer emulated libraries over native ones. + + * 0: Prefer native libraries over emulated ones. [Default] + * 1: Prefer emulated libraries over native ones. + +### BOX64_PREFER_WRAPPED + +Prefer wrapped libs first even if the lib is specified with absolute path. + + * 0: Prefer libs with absolute path over wrapped ones. [Default] + * 1: Prefer wrapped libs first even if the lib is specified with absolute path. + +### BOX64_WRAP_EGL + +Prefer wrapped libs for EGL and GLESv2. + + * 0: Prefer emulated libs for EGL and GLESv2. [Default] + * 1: Prefer wrapped libs for EGL and GLESv2. + diff --git a/docs/WINE.md b/docs/WINE.md new file mode 100644 index 0000000..1991718 --- /dev/null +++ b/docs/WINE.md @@ -0,0 +1,55 @@ +# The guide on using Wine with Box64 + +Wine Is Not an Emulator, but Box64 is. Box64 supports Wine in multiple ways. Before continuing reading, you should have a basic understanding of Wine. + +## Wine variants + +Wine ships in multiple forms: + + +1. **x86 Wine** + + The executable architecture of **x86 Wine** is x86, and it runs x32 Windows executables. + + **x86 Wine** requires a 32-bit environment (read 32-bit Linux libraries), which is usually available on x86_64 machines because of the nature of the architecture. + + However, when you try to run it via an emulator on RISC architectures, the situation is a bit different. For Arm64, there is armhf, which is a 32-bit environment, and there is also Box86, which is made for armhf, so you can use Box86 to run **x86 Wine**. + + However, for RISC-V 64, LoongArch64, and many newer Arm64 cores, a 32-bit environment is not available. Box64 introduced a new mode called Box32, which can be enabled at compile time via a CMake option `BOX32`. It essentially emulates a 32-bit environment using the 64-bit environment, so it can be used to run **x86 Wine**. But be aware that Box32 is still highly experimental and unstable. + +2. **x86_64 Wine** + + The executable architecture of **x86_64 Wine** is x86_64, and it runs x64 Windows executables. + + It can be used with Box64. Note that **x86_64 Wine** usually ships with **x86 Wine** included. So you can use a combination of Box86 + Box64 or Box64 alone with Box32 enabled to run both x32 and x64 executables seamlessly. + +3. **x86_64 Wine WOW64** + + The executable architecture of **x86_64 Wine WOW64** is x86_64, and it runs both x32 and x64 Windows executables. + + What's great about **x86_64 Wine WOW64** is that it does not require a 32-bit environment for x32 Windows executable, as the 32-bit environment emulation is taken care of by Wine WOW64 itself. + + That means you can just use Box64 (without Box32) to run x32 Windows executables. However, the downside is that the performance of WineD3D is pretty bad for 32-bit (use DXVK!). + +4. **Arm64 Wine WOW64** + + The executable architecture of **Arm64 Wine WOW64** is Arm64, and it runs + x32, x64, Arm32, Arm64 Windows executables. + + However, to run x32 and x64 ones, a cpu.dll is required, known as the + WOW64 (for 32-bit) and Arm64EC (for 64-bit). + + Box64 now supports 32-bit WOW64 DLL. You can have it compiled by enabling the `WOW64` CMake option. And we plan to support Arm64EC in the future. + +## Wine installation + +For x86 Wines, there are plenty of places to download, to name a few: + +- https://github.com/Kron4ek/Wine-Builds (Wine \[WOW64\]) +- https://github.com/GloriousEggroll/proton-ge-custom (Proton, known as the Valve-optimized Wine) + +After the download, just add the `bin` folder to your path in any way you like; Wine should work with Box64 just fine. + +To install components like DXVK, d3dcompiler_xx, or cjkfonts, it's recommended to use Winetricks: https://github.com/Winetricks/winetricks + +For Arm64 Wines, use of Hangover is recommended: https://github.com/AndreRH/hangover. \ No newline at end of file diff --git a/docs/X64WINE.md b/docs/X64WINE.md deleted file mode 100644 index 072fa6d..0000000 --- a/docs/X64WINE.md +++ /dev/null @@ -1,177 +0,0 @@ -# Installing Wine64 -Running Wine64/Wine with Box64/Box86 allows x64/x86 Windows programs to run on 64-bit ARM Linux devices. - - Box64 needs `wine-amd64` to be installed **manually** on ARM64 (aarch64) devices. This will run 64-bit Windows programs (aka x86_64). - - Box86 needs `wine-i386` to be installed **manually** on ARM32 (armhf) devices (or on ARM64 with multiarch or chroot). This will run 32-bit Windows programs (aka x86). - - _Note that `wine:arm64` and `wine:armhf` will not work with Box64/Box86. Your device's package manager might try to install those if you ask it to install wine._ - -See installation steps below (in the [Examples](#examples) section). - -## Overview -The general procedure for installing Wine64 & Wine for Box64 & Box86 is to... - - Download all the install files for the version of Wine you wish to install - - Unzip or dpkg the install files into one folder - - Move that folder to the directory that you wish Wine to run from (often `~/wine/` by default) - - Go to `/usr/local/bin` and make symlinks or scripts that will point to your main wine binaries. - - Boot wine to create a new wineprefix. - - Download winetricks (which is just a complicated bash script), make it executable, then copy it to `/usr/local/bin`. - -## Examples -### Installing Wine64 & Wine for Box64 & Box86 on Raspberry Pi OS from WineHQ .deb files -_Links from the [WineHQ repo](https://dl.winehq.org/wine-builds/debian/dists/)_ - -This install method allows you to install different versions of Wine64/Wine. You may install any version/branch of Wine that you wish. -``` - # NOTE: Can only run on aarch64 (since box64 can only run on aarch64) - # box64 runs wine-amd64, box86 runs wine-i386. - - ### User-defined Wine version variables ################ - # - Replace the variables below with your system's info. - # - Note that we need the amd64 version for Box64 even though we're installing it on our ARM processor. - # - Note that we need the i386 version for Box86 even though we're installing it on our ARM processor. - # - Wine download links from WineHQ: https://dl.winehq.org/wine-builds/ - - local branch="devel" #example: devel, staging, or stable (wine-staging 4.5+ requires libfaudio0:i386) - local version="7.1" #example: "7.1" - local id="debian" #example: debian, ubuntu - local dist="bullseye" #example (for debian): bullseye, buster, jessie, wheezy, ${VERSION_CODENAME}, etc - local tag="-1" #example: -1 (some wine .deb files have -1 tag on the end and some don't) - - ######################################################## - - # Clean up any old wine instances - wineserver -k # stop any old wine installations from running - rm -rf ~/.cache/wine # remove any old wine-mono/wine-gecko install files - rm -rf ~/.local/share/applications/wine # remove any old program shortcuts - - # Backup any old wine installs - rm -rf ~/wine-old 2>/dev/null; mv ~/wine ~/wine-old 2>/dev/null - rm -rf ~/.wine-old 2>/dev/null; mv ~/.wine ~/.wine-old 2>/dev/null - sudo mv /usr/local/bin/wine /usr/local/bin/wine-old 2>/dev/null - sudo mv /usr/local/bin/wine64 /usr/local/bin/wine-old 2>/dev/null - sudo mv /usr/local/bin/wineboot /usr/local/bin/wineboot-old 2>/dev/null - sudo mv /usr/local/bin/winecfg /usr/local/bin/winecfg-old 2>/dev/null - sudo mv /usr/local/bin/wineserver /usr/local/bin/wineserver-old 2>/dev/null - - # Wine download links from WineHQ: https://dl.winehq.org/wine-builds/ - LNKA="https://dl.winehq.org/wine-builds/${id}/dists/${dist}/main/binary-amd64/" #amd64-wine links - DEB_A1="wine-${branch}-amd64_${version}~${dist}${tag}_amd64.deb" #wine64 main bin - DEB_A2="wine-${branch}_${version}~${dist}${tag}_amd64.deb" #wine64 support files (required for wine64 / can work alongside wine_i386 main bin) - #DEB_A3="winehq-${branch}_${version}~${dist}${tag}_amd64.deb" #shortcuts & docs - LNKB="https://dl.winehq.org/wine-builds/${id}/dists/${dist}/main/binary-i386/" #i386-wine links - DEB_B1="wine-${branch}-i386_${version}~${dist}${tag}_i386.deb" #wine_i386 main bin - DEB_B2="wine-${branch}_${version}~${dist}${tag}_i386.deb" #wine_i386 support files (required for wine_i386 if no wine64 / CONFLICTS WITH wine64 support files) - #DEB_B3="winehq-${branch}_${version}~${dist}${tag}_i386.deb" #shortcuts & docs - - # Install amd64-wine (64-bit) alongside i386-wine (32-bit) - echo -e "Downloading wine . . ." - wget -q ${LNKA}${DEB_A1} - wget -q ${LNKA}${DEB_A2} - wget -q ${LNKB}${DEB_B1} - echo -e "Extracting wine . . ." - dpkg-deb -x ${DEB_A1} wine-installer - dpkg-deb -x ${DEB_A2} wine-installer - dpkg-deb -x ${DEB_B1} wine-installer - echo -e "Installing wine . . ." - mv wine-installer/opt/wine* ~/wine - - # Download wine dependencies - # - these packages are needed for running box86/wine-i386 on a 64-bit RPiOS via multiarch - sudo dpkg --add-architecture armhf && sudo apt-get update # enable multi-arch - sudo apt-get install -y libasound2:armhf libc6:armhf libglib2.0-0:armhf libgphoto2-6:armhf libgphoto2-port12:armhf \ - libgstreamer-plugins-base1.0-0:armhf libgstreamer1.0-0:armhf libldap-2.4-2:armhf libopenal1:armhf libpcap0.8:armhf \ - libpulse0:armhf libsane1:armhf libudev1:armhf libusb-1.0-0:armhf libvkd3d1:armhf libx11-6:armhf libxext6:armhf \ - libasound2-plugins:armhf ocl-icd-libopencl1:armhf libncurses6:armhf libncurses5:armhf libcap2-bin:armhf libcups2:armhf \ - libdbus-1-3:armhf libfontconfig1:armhf libfreetype6:armhf libglu1-mesa:armhf libglu1:armhf libgnutls30:armhf \ - libgssapi-krb5-2:armhf libkrb5-3:armhf libodbc1:armhf libosmesa6:armhf libsdl2-2.0-0:armhf libv4l-0:armhf \ - libxcomposite1:armhf libxcursor1:armhf libxfixes3:armhf libxi6:armhf libxinerama1:armhf libxrandr2:armhf \ - libxrender1:armhf libxxf86vm1 libc6:armhf libcap2-bin:armhf # to run wine-i386 through box86:armhf on aarch64 - # This list found by downloading... - # wget https://dl.winehq.org/wine-builds/debian/dists/bullseye/main/binary-i386/wine-devel-i386_7.1~bullseye-1_i386.deb - # wget https://dl.winehq.org/wine-builds/debian/dists/bullseye/main/binary-i386/winehq-devel_7.1~bullseye-1_i386.deb - # wget https://dl.winehq.org/wine-builds/debian/dists/bullseye/main/binary-i386/wine-devel_7.1~bullseye-1_i386.deb - # then `dpkg-deb -I package.deb`. Read output, add `:armhf` to packages in dep list, then try installing them on Pi aarch64. - - # - these packages are needed for running box64/wine-amd64 on RPiOS (box64 only runs on 64-bit OS's) - sudo apt-get install -y libasound2:arm64 libc6:arm64 libglib2.0-0:arm64 libgphoto2-6:arm64 libgphoto2-port12:arm64 \ - libgstreamer-plugins-base1.0-0:arm64 libgstreamer1.0-0:arm64 libldap-2.4-2:arm64 libopenal1:arm64 libpcap0.8:arm64 \ - libpulse0:arm64 libsane1:arm64 libudev1:arm64 libunwind8:arm64 libusb-1.0-0:arm64 libvkd3d1:arm64 libx11-6:arm64 libxext6:arm64 \ - ocl-icd-libopencl1:arm64 libasound2-plugins:arm64 libncurses6:arm64 libncurses5:arm64 libcups2:arm64 \ - libdbus-1-3:arm64 libfontconfig1:arm64 libfreetype6:arm64 libglu1-mesa:arm64 libgnutls30:arm64 \ - libgssapi-krb5-2:arm64 libjpeg62-turbo:arm64 libkrb5-3:arm64 libodbc1:arm64 libosmesa6:arm64 libsdl2-2.0-0:arm64 libv4l-0:arm64 \ - libxcomposite1:arm64 libxcursor1:arm64 libxfixes3:arm64 libxi6:arm64 libxinerama1:arm64 libxrandr2:arm64 \ - libxrender1:arm64 libxxf86vm1:arm64 libc6:arm64 libcap2-bin:arm64 - # This list found by downloading... - # wget https://dl.winehq.org/wine-builds/debian/dists/bullseye/main/binary-amd64/wine-devel_7.1~bullseye-1_amd64.deb - # wget https://dl.winehq.org/wine-builds/debian/dists/bullseye/main/binary-amd64/wine-devel-amd64_7.1~bullseye-1_amd64.deb - # then `dpkg-deb -I package.deb`. Read output, add `:arm64` to packages in dep list, then try installing them on Pi aarch64. - - # These packages are needed for running wine-staging on RPiOS (Credits: chills340) - sudo apt install libstb0 -y - cd ~/Downloads - wget -r -l1 -np -nd -A "libfaudio0_*~bpo10+1_i386.deb" http://ftp.us.debian.org/debian/pool/main/f/faudio/ # Download libfaudio i386 no matter its version number - dpkg-deb -xv libfaudio0_*~bpo10+1_i386.deb libfaudio - sudo cp -TRv libfaudio/usr/ /usr/ - rm libfaudio0_*~bpo10+1_i386.deb # clean up - rm -rf libfaudio # clean up - - # Install symlinks - sudo ln -s ~/wine/bin/wine /usr/local/bin/wine - sudo ln -s ~/wine/bin/wine64 /usr/local/bin/wine64 - sudo ln -s ~/wine/bin/wineboot /usr/local/bin/wineboot - sudo ln -s ~/wine/bin/winecfg /usr/local/bin/winecfg - sudo ln -s ~/wine/bin/wineserver /usr/local/bin/wineserver - sudo chmod +x /usr/local/bin/wine /usr/local/bin/wine64 /usr/local/bin/wineboot /usr/local/bin/winecfg /usr/local/bin/wineserver -``` - -## Installing winetricks -Winetricks is a bash script which makes it easier to install & configure any desired Windows core system software packages which may be dependencies for certain Windows programs. You can either install it with `apt`, or manually using the steps below. - -``` -sudo apt-get install cabextract -y # winetricks needs this installed -sudo mv /usr/local/bin/winetricks /usr/local/bin/winetricks-old # Backup old winetricks -cd ~/Downloads && wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks # Download -sudo chmod +x winetricks && sudo mv winetricks /usr/local/bin/ # Install -``` - -Whenever we run winetricks, we must tell Box86 to supress its info banner, otherwise winetricks will crash. Box86's info banner can be suppressed using the `BOX86_NOBANNER=1` environment variable before invoking winetricks (example: `BOX86_NOBANNER=1 winetricks`). - -If `apt` installed a desktop menu shortcut for winetricks (or if you make your own desktop shortcut for winetricks) then you may need to edit that shortcut to include Box86's BOX86_NOBANNER=1 env var. With your favorite text editor, edit `/usr/share/applications/winetricks.desktop` and change `Exec=winetricks --gui` to `Exec=env BOX86_NOBANNER=1 winetricks --gui`. - -## Example commands -Creating a 64-bit wineprefix: -`wine64 wineboot` or `wine wineboot` (wineprefix is created in `~/.wine/`) -`WINEPREFIX="$HOME/prefix64" wine wineboot` (wineprefix is created in `~/prefix64/`) _Note: You will need to invoke `WINEPREFIX="$HOME/prefix64"` before every command to use this wineprefix._ - -Creating a 32-bit wineprefix: -`WINEARCH=win32 wine wineboot` (wineprefix is created in `~/.wine/`) - -Fore-quitting wine: -`wineserver -k` - -Running Wine Configuration: -`winecfg` - -Using winetricks: -`winetricks -q corefonts vcrun2010 dotnet20sp1` -_This command will silently install three packages in series: Windows core fonts, VC++ 2010 Runtimes, and .NET 2.0 SP1. `-q` is the "install silent/quiet" command._ - -Invoking Box86's logging features (with `BOX86_LOG=1` or similar) will cause winetricks to crash. - -For a list of all the different Windows packages & libraries that winetricks can help you install, run `winetricks list-all` - -## Other notes - -### Wineprefixes (and Wine initialization) -When you first run or boot Wine (`wine wineboot`), Wine will create a new user environment within which to install Windows software. This user environment is called a "wineprefix" (or "wine bottle") and is located (by default) in `~/.wine` (note that Linux folders with a `.` in front of them are "hidden" folders). Think of a wineprefix as Wine's virtual 'harddrive' where it installs software and saves settings. Wineprefixes are portable and deletable. For more Wine documentation, see [WineHQ](https://www.winehq.org/documentation). - -If you at any point corrupt something inside your default wineprefix, you can start "fresh" by deleting your `~/.wine` directory (with the `rm -rf ~/.wine` command) and boot wine again to create a new default wineprefix. - -### Transplanting wineprefixes -If software isn't installing in Wine with Box86, but is installing for you in Wine on a regular x86 Linux computer, you can copy a wineprefix from your x86 Linux computer to the device you're running Box86 on. This is most easily done by tarring the `~/.wine` folder on your x86 Linux computer (`tar -cvf winebottle.tar ~/.wine`), transferring the tar file to your device, then un-tarring the tar file (`tar -xf winebottle.tar`) on your device running Box86 & Wine. Tarring the wineprefix preserves any symlinks that are inside it. - -### Swapping out different versions of Wine -Some versions of Wine work better with certain software. It is best to install a version of Wine that is known to work with the software you would like to run. There are three main development branches of Wine you can pick from, referred to as wine-stable, wine-devel, and wine-staging. _Note that the wine-staging branch requires extra installation steps on Raspberry Pi._ - -Your entire Wine installation can reside within a single folder on your Linux computer. TwisterOS assumes that your Wine installation is located inside the `~/wine/` directory. The actual directory where you put your `wine` folder doesn't matter as long as you have symlinks within the `/usr/local/bin/` directory which point to the `wine` folder so that Linux can find Wine when you type `wine` into the terminal). - -You can change which version of Wine you are running simply by renaming your old `wine` and `.wine` folders to something else, then putting a new `wine` folder (containing your new version of Wine) in its place. Running `wine wineboot` again will migrate a wineprefix from an older version of Wine to be usable by the newer version of Wine you just installed. You can check which version of Wine you're running with the `wine --version` command. diff --git a/docs/box64.pod b/docs/box64.pod index 7a99dc5..c06867e 100644 --- a/docs/box64.pod +++ b/docs/box64.pod @@ -30,15 +30,13 @@ Print box64 version and quit. =back -=head1 CONFIGURATION FILE +=head1 BRIEF USAGE -B now have configurations files. There are 2 files loaded. -F and F<~/.box64rc>. Both files have the same syntax, and is -basically an ini files. Section in square brackets define the process name, and -the rest is the environment variable. B comes with a default file that -should be installed for better stability. Note that the priority is: -F<~/.bashrc> > F > command line So, your settings in -F<~/.bashrc> may override the setting from your command line. Example: +There are many environment variables to control B's behaviour. In +addition to environment variables, B also looks for 2 places for rcfile: +F and F<~/.box64rc>, in the format of .ini files. +Settings priority: F<~/.box64rc> > F > environment variables. +Example: [factorio] BOX64_DYNAREC_SAFEFLAGS=0 @@ -46,439 +44,938 @@ F<~/.bashrc> may override the setting from your command line. Example: BOX64_DYNAREC_FORWARD=1024 BOX64_DYNAREC_CALLRET=1 -=head1 VARIABLES FOR RCFILE ONLY +=head1 ENVIRONMENT VARIABLES =over 8 -=item B -When set to 1, add C<--no-sandbox> to command line arguments (useful for chrome -based programs). +=item B =I -=item B +Add extras to the needed libraries list, rarely needed. -When set to 1, add C<--in-process-gpu> to command line arguments (useful for chrome -based programs). + * XXXX : Add library XXXX to the needed libraries list. + * XXXX:YYYY:ZZZZ : Add library XXXX, YYYY and ZZZZ to the needed libraries list. -=item B=I<0|1> -When set to 1, just exit, don't try to run the program. +=item B =I<0|1> -=back +Expose AES capabilities. Available in WowBox64. -=head1 VARIABLES ONLY FOR ENVIRONMENT AND NOT RCFILE + * 0 : Do not expose AES capabilities. + * 1 : Expose AES capabilities. [Default] -=over 8 -=item B=I<0|1> +=item B =I<0|1> -When set to 1, don't prints the banner including version and build. +Allow missing libraries to be ignored. -=item B=I[:I:...] + * 0 : Do not allow missing libraries. [Default] + * 1 : Allow missing libraries. -Force loading libraries with the binary. PreLoaded libs can be emulated or -native, and are treated the same way as if they were comming from the binary. -=item B=I +=item B =I<`arm64`|`la64`|`rv64`|``> -Add an variable with value to the environment. +Specify the architecture in rcfiles to which the current entry applies. This option only takes effect when used inside rcfiles. -=item B=I B=I ... + * `arm64` : Only apply current entry for AArch64. + * `la64` : Only apply current entry for LoongArch64. + * `rv64` : Only apply current entry for RISC-V. + * `` : Apply current entry for all architectures, will be replaced by more specific entries. [Default] -Add arbitrary many variables using B, B, ... -=item B +=item B =I -No rc files (like F and F<~/.box64rc>) will be loaded. +Arguments to pass to the guest program, only valid if there is no existing arguments. -=back + * XXXX : Pass argument XXXX to the program. + * XXXX YYYY ZZZZ : Pass arguments XXXX, YYYY and ZZZZ to the guest program. -=head1 VARIABLES FOR BOTH ENVIRONMENT AND RCFILE -=over 8 +=item B =I<0|1|2> -=item B=I<0|NONE|1|INFO|2|DEBUG|3|DUMP> +Expose AVX extension to CPUID and cpuinfo file. Default value is 2 on Arm64 because it's fully implemented in DynaRec, 0 otherwise. Available in WowBox64. -Controls the Verbosity level of the logs + * 0 : Do not expose AVX capabilities. + * 1 : Expose AVX, BMI1, F16C and VAES extensions to CPUID and cpuinfo file. + * 2 : All in 1, plus AVX2, BMI2, FMA, ADX,VPCLMULQDQ and RDRAND extensions. - * 0 or NONE : No message (except some fatal error). (Default.) - * 1 or INFO : Show some minimum log (Example: libraries not found) - * 2 or DEBUG : Details a lot of stuff (Example: relocations or functions called). - * 3 or DUMP : All DEBUG plus DUMP of all ELF Info. -=item B=I<0|1|N> +=item B =I -Show last few wrapped function call when a Signal is caught. Incompatible with -B > 1 (may need B also) +Path to the bash executable. - * 0: No last function call printed (Default.) - * 1: Last 16 wrapped functions calls printed when a signal is printed. - * N: Last N wrapped functions calls printed when a signal is printed. + * XXXX : Use bash executable at path XXXX. -=item B=I -Path to look for x86_64 libraries. Default is current folder and C in -current folder. Also, F and -F are added if they exist. +=item B =I<0|1> -=item B=I +Specify the CPU type to emulate. Available in WowBox64. -Path to look for x86_64 executable. Default is current folder and C in -current folder. + * 0 : Emulate a Intel CPU Model. [Default] + * 1 : Emulate a AMD CPU Model. -=item B=I<0|1> -Enables/Disables the logging of `dlsym` errors. +=item B =I<0|1> - * 0 : Don't log `dlsym` errors. (Default.) - * 1 : Log dlsym errors. +Use a dummy crash handler or not. -=item B=I + * 0 : Use emulated crashhandler.so library if needed. + * 1 : Use an internal dummy (empty) crashhandler.so library. [Default] -Send all log and trace to a file instead of C. Also, if name contains -C<%pid> then this is replaced by the actual C of B instance. End -the filename with `+` to have thetrace appended instead of overwritten Use -C to use this instead of default C. -=item B=I<0|1|symbolname|0xXXXXXXX-0xYYYYYYY> +=item B =I<0|1> -Only on build with trace enabled. Trace allow the logging of all instruction executed, along with register dump +Enable or disable the logging of dlsym errors. - * 0 : No trace. (Default.) - * 1 : Trace enabled. Trace start after the initialisation of all depending libraries is done. - * symbolname : Trace only `symbolname` (trace is disable if the symbol is not found). - * 0xXXXXXXX-0xYYYYYYY : Trace only between the 2 addresses. + * 0 : Disable the logging of dlsym errors. [Default] + * 1 : Enable the logging of dlsym errors. -=item B=I<0|1> -Use B instead of B to start trace before the -initialization of libraries and the running program +=item B =I<0|1> - * 0 : No trace. (Default.) - * 1 : Trace enabled. The trace start with the initialisation of all depending libraries is done. +Dump elfloader debug information. Available in WowBox64. -=item B=I + * 0 : Do not dump elfloader debug information. [Default] + * 1 : Dump elfloader debug information. -Only on builds with trace enabled. Start trace only after I opcode -execute (number is an `uint64_t`). -=item B=I<0|1> +=item B =I<0|1> -Only on builds with trace enabled. +Enable/disable the Dynamic Recompiler (a.k.a DynaRec). This option defaults to 1 if it's enabled in the build options for a supported architecture. Available in WowBox64. - * 0 : The XMM (i.e. SSE/SSE2) register will not be logged with the general and x86 registers. (Default.) - * 1 : Dump the XMM registers. + * 0 : Disable DynaRec. + * 1 : Enable DynaRec. -=item B=I<0|1> -Only on builds with trace enabled. +=item B =I<0|1> - * 0 : The EMM (i.e. MMX) register will not be logged with the general and x86 registers. (Default.) - * 1 : Dump the EMM registers. +Generate aligned atomics only (only available on Arm64 for now). Available in WowBox64. -=item B=I<0|1> + * 0 : Generate unaligned atomics handling code. [Default] + * 1 : Generate aligned atomics only, which is faster and smaller code size, but will cause SIGBUS for LOCK prefixed opcodes operating on unaligned data addresses. -Only on builds with trace enabled. - * 0 : The general registers will always be the default white color. (Default.) - * 1 : The general registers will change color in the dumps when they changed value. +=item B =I<0|1|2|3> -=item B=I<0xXXXXXXXX> +Enable building bigger DynaRec code blocks for better performance. Available in WowBox64. -Try to load at C<0xXXXXXX> main binary (if binary is a PIE). + * 0 : Do not try to build block as big as possible, suitable for programs using lots of threads and JIT, like Unity. + * 1 : Build Dynarec block as big as possible. + * 2 : Build Dynarec block bigger, do not stop when block overlaps, but only for blocks in elf memory. [Default] + * 3 : Build Dynarec block bigger, do not stop when block overlaps, for all type of memory, useful for wine programs. -=item B=I<0|1> -Disable handling of SigSEGV. (Very useful for debugging.) +=item B =I<0|1> - * 0 : Let the x86 program set sighandler for SEGV (Default.) - * 1 : Disable the handling of SigSEGV. +Detect MonoBleedingEdge and apply conservative settings (Linux only). -=item B=I<0|1> + * 0 : Do not detect MonoBleedingEdge. + * 1 : Detect MonoBleedingEdge and apply BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_STRONGMEM=1 when detected. [Default] -Disable handling of SigILL (to ease debugging mainly). - * 0 : Let x86 program set sighandler for Illegal Instruction - * 1 : Disables the handling of SigILL +=item B =I<0|1|2> -=item B=I<0|1> +Optimize CALL/RET opcodes. Available in WowBox64. -Show Segfault signal even if a signal handler is present + * 0 : Do not optimize CALL/RET, use jump table. [Default] + * 1 : Try to optimize CALL/RET, skipping the jump table when possible. + * 2 : Try to optimize CALL/RET, skipping the jump table when possible, adding code to handle return to dirty/modified block. Does not work on WowBox64. - * 0 : Don"t force show the SIGSEGV analysis (Default.) - * 1 : Show SIGSEGV detail, even if a signal handler is present -=item B=I<0|1> +=item B =I<0|1> -Show some Backtrace (Nativ e and Emulated) whgen a signal (SEGV, ILL or BUS) is caught +Enable or disable the use of deferred flags. Available in WowBox64. - * 0 : Don"t show backtraces (Default.) - * 1 : Show Backtrace detail (for native, box64 is rename as the x86_64 binary run) + * 0 : Disable the use of deferred flags. + * 1 : Enable the use of deferred flags. [Default] -=item B=I<0|1> -Call XInitThreads when loading X11. (This is mostly for old Loki games with the Loki_Compat library.) +=item B =I<0|1|2> - * 0 : Don't force call XInitThreads. (Default.) - * 1 : Call XInitThreads as soon as libX11 is loaded. +Allow continue running a block that is unprotected and potentially dirty. -=item B=I<0|1> + * 0 : Do not allow continue running a block that is unprotected and potentially dirty. [Default] + * 1 : Allow continue to run a dynablock that write data in the same page as code. It can gets faster in loading time of some game but can also get unexpected crashes. + * 2 : Will also, when it detect an HotPage, flag that page as NEVERCLEAN, and so it will not be write protected but Block build from that page will always be tested. It can be faster that way (but soem SMC case might not be trapped). -Force libX11's GLX extension to be present. - * 0 : Do not force libX11's GLX extension to be present. - * 1 : GLX will always be present when using XQueryExtension. (Default.) +=item B =I<0|1> -=item B=I<0|1|2> +Disable detection of hot page (where code is executed and data written at the same time). -Enables/disables Box64's Dynarec's dump. + * 0 : Detect hot page [Default] + * 1 : Do not detect hot page - * 0 : Disable Dynarec's blocks dump. (Default.) - * 1 : Enable Dynarec's blocks dump. - * 2 : Enable Dynarec's blocks dump with some colors. -=item B=I<0|1|2|3> +=item B =I<0|1> -Set the level of DynaRec's logs. +Use alternative way to detect HotPages (legacy way). - * 0 : NONE : No Logs for DynaRec. (Default.) - * 1 :INFO : Minimum Dynarec Logs (only unimplemented OpCode). - * 2 : DEBUG : Debug Logs for Dynarec (with details on block created / executed). - * 3 : VERBOSE : All of the above plus more. + * 0 : Detect hot page, using new method from v0.3.9+ [Default] + * 1 : Use alternate method to detect HotPage (from v0.3.8 and earlier) -=item B=I<0|1> -Enables/Disables Box64's Dynarec. +=item B =I<0|1> - * 0 : Disables Dynarec. - * 1 : Enable Dynarec. (Default.) +Enable or disable the generation of division-by-zero exception. Available in WowBox64. -=item B=I<0|1> + * 0 : Do not generate the division-by-zero exception. [Default] + * 1 : Generate the division-by-zero exception. -Enables/Disables trace for generated code. Like regular Trace, this will slow -down the program a lot and generate huge logs. - * 0 : Disable trace for generated code. (Default.) - * 1 : Enable trace for generated code +=item B =I<0|1|2> -=item B=I<0xXXXXXXXX-0xYYYYYYYY> +Enable DynaRec dump. Available in WowBox64. -Forbid dynablock creation in the interval specified (helpfull for debugging -behaviour difference between Dynarec and Interpreter) + * 0 : Do not dump DynaRec blocks. [Default] + * 1 : Dump DynaRec blocks. + * 2 : Dump DynaRec blocks with some colors. -=item B=I<0|1> -Dynarec will compare it's execution with the interpreter (super slow, only for testing) +=item B =I<0xXXXXXXXX-0xYYYYYYYY> - * 0 : No comparison. (Default.) - * 1 : Each opcode runs on interepter and on Dynarec, and regs and memory are compared and print if different. - * 2 : Thread-safe tests, extremely slow. +Dump DynaRec blocks in the specified range. Available in WowBox64. -=item B=I<0|1|2|3> + * 0xXXXXXXXX-0xYYYYYYYY : Define the range where dynablock gets dumped (inclusive-exclusive). -Enables/Disables Box64's Dynarec building BigBlock. - * 0 : Don't try to build block as big as possible (can help program using lots of thread and a JIT, like C#/Unity) (Default when libmonobdwgc-2.0.so is loaded) - * 1 : Build Dynarec block as big as possible (Default.) - * 2 : Build Dynarec block bigger (don't stop when block overlaps, but only for blocks in elf memory) - * 3 : Build Dynarec block bigger (don't stop when block overlaps, for all type of memory) +=item B =I<0|1> -=item B=I<0|XXX> +Enable or disable fast NaN handling. Available in WowBox64. -Define Box64's Dynarec max allowed forward value when building Block. + * 0 : Precisely emulate the -NaN generation like on x86. + * 1 : Do not do anything special with -NAN generation, faster. [Default] - * 0 : No forward value. When current block end, don't try to go further even if there are previous forward jumps - * XXX : Allow up to XXXX bytes of gap when building a Block after the block end to next forward jump (Default: 128) - -=item B=I<0|1|2> -Enable/Disable simulation of Strong Memory model +=item B =I<0|1|2> - * 0 : Don't try anything special (Default.) - * 1 : Enable some Memory Barrier when reading from memory (on some MOV opcode) to simulate Strong Memory Model while trying to limit performance impact (Default when libmonobdwgc-2.0.so is loaded) - * 2 : Enable some Memory Barrier when reading from memory (on some MOV opcode) to simulate Strong Memory Model +Enable or disable fast rounding. Available in WowBox64. -=item B=I<0|1> + * 0 : Generate float/double -> int rounding and use current rounding mode for float/double computation like on x86. + * 1 : Do not do anything special with edge case rounding, faster. [Default] + * 2 : Generate float/double -> int rounding using current rounding mode for float/double computation like on x86, but use fast int -> float/double conversion. -Force the use of Double for x87 emulation - * 0 : Try to use float when possible for x87 emulation (default, faster) - * 1 : Only use Double for x87 emulation (slower, may be needed for some specific games, like Crysis) +=item B =I<0|128|XXXX> -=item B=I<0|1> +Define max allowed forward value when building block. Available in WowBox64. -Enable/Disable generation of -NAN + * 0 : No forward value. When current block ends, do not try to go further even if there are previous forward jumps. + * 128 : Allow up to 128 bytes of gap between end of the block and the next forward jump. [Default] + * XXXX : Allow up to XXXX bytes of gap between end of the block and the next forward jump. - * 0 : Generate -NAN like on x86 - * 1 : Don't do anything special with NAN, to go as fast as possible (default, faster) -=item B=I<0|1> +=item B =I<0|1|2|3|0xXXXXXXX-0xYYYYYYY> -Enable/Disable generation of precise x86 rounding +The GDBJIT debugging support, only available on build with `-DGDBJIT=ON`, enable it with gdb command: jit-reader-load /usr/local/lib/libbox64gdbjitreader.so. - * 0 : Generate float/double -> int rounding like on x86 - * 1 : Don't do anything special with edge case Rounding, to go as fast as possible (no INF/NAN/Overflow -> MIN_INT conversion) (default, faster) + * 0 : Dynarec will not generate GDBJIT debuginfo. [Default] + * 1 : Dynarec will generate GDBJIT debuginfo. + * 2 : Dynarec will generate detailed GDBJIT debuginfo with internal state. + * 3 : Dynarec will register detailed GDBJIT debuginfo only for dynablocks that the guest program trap into, greatly improving performance. + * 0xXXXXXXX-0xYYYYYYY : Define the range where Dynarec will generate detailed GDBJIT debuginfo with internal state. -=item B=I<0|1|2> -Handling of flags on CALL/RET opcodes +=item B =I<0|1|2|3> - * 0 : Treat CALL/RET as if it never needs any flags (faster but not advised) - * 1 : most of RET will need flags, most of CALLS will not (Default) - * 2 : All CALL/RET will need flags (slower, but might be needed. Automatically enabled for Vara.exe) +Disable or enable DynaRec logs. Available in WowBox64. -=item B=I<0|1> + * 0 : Disable DynaRec logs. [Default] + * 1 : Enable minimal DynaRec logs. + * 2 : Enable debug level DynaRec logs. + * 3 : Enable verbose level DynaRec logs. -Optimisation of CALL/RET opcodes (not compatible with jit/dynarec/smc) - * 0 : Don't optimize CALL/RET, use Jump Table for boths (Default) - * 1 : Try to optimized CALL/RET, skipping the use of the JumpTable when possible (will crash if blacks are invalidate, so probably incompatible with JIT/Dynarec) +=item B =I<0|1|2> -=item B=I<0|1> +Print missing opcodes. Available in WowBox64. -Detect MonoBleedingEdge and apply conservative settings + * 0 : Do not print the missing opcode. [Default] + * 1 : Print missing opcodes. + * 2 : Print the fallback to scalar opcodes, only valid on RISC-V. - * 0 : Don't detect MonoBleedingEdge - * 1 : Detect MonoBleedingEdge, and apply BIGBLOCK=0 STRONGMEM=1 if detected (Default) -=item B=I<0|1> +=item B =I<0|1> -Behavior with FillBlock is not availble (FillBlock build Dynarec blocks and is not multithreaded) +Enable or disable the use of native flags. Available in WowBox64. - * 0 : Dynarec will not wait for FillBlock to ready and use Interpreter instead (might speedup a bit massive multithread or JIT programs) - * 1 : Dynarec will wait for FillBlock to be ready (Default) + * 0 : Do not use native flags. + * 1 : Use native flags when possible. [Default] -=item B=I<0|1> -Handling of SSE Flush to 0 flags +=item B =I<0|1|xxx,yyy,zzz> - * 0 : Just track the flag (Default) - * 1 : Direct apply of SSE Flush to 0 flag +Disable optional host extensions. -=item B=I<0|1> + * 0 : Disable nothing. [Default] + * 1 : Disable all the optional extensions. + * xxx,yyy,zzz : Disable selected optional extensions, choices are Arm: `crc32,pmull,aes,atomics,sha1,sha2,uscat,flagm,flagm2,frintts,afp,rndr`, LoongArch: `lasx,lbt,frecipe,lam_bh,lamcas,scq`, and RISC-V: `zba,zbb,zbc,zbs,vector,xtheadba,xtheadbb,xtheadbs,xtheadmemidx,xtheadmempair,xtheadcondmov`. -Handling of x87 80bits long double - * 0 : Try to handle 80bits long double as precise as possible (Default) - * 1 : Handle them as double +=item B =I<0|1|2|3> -=item B=I<0|1> +Enable x86 PAUSE emulation, may help the performance of spinlocks. Available in WowBox64. -Box64 will sync rounding mode with fesetround/fegetround. + * 0 : Ignore x86 PAUSE instruction. [Default] + * 1 : Use YIELD to emulate x86 PAUSE instruction. + * 2 : Use WFI to emulate x86 PAUSE instruction. + * 3 : Use SEVL+WFE to emulate x86 PAUSE instruction. - * 0 : Disable rounding mode syncing. (Default.) - * 1 : Enable rounding mode syncing. -=item B=I<0|1> +=item B =I<0|1> -Detect libcef and apply malloc_hack settings +Generate map file for Linux perf tool. - * 0 : Don't detect libcef - * 1 : Detect libcef, and apply MALLOC_HACK=2 if detected (Default) + * 0 : Dynarec will not generate perf map. [Default] + * 1 : Dynarec will generate perf map. -=item B=I -You can also use B +=item B =I<0|1> - * libXXXX set the name for libGL (defaults to libGL.so.1). - * /PATH/TO/libGLXXX : Sets the name and path for libGL +Purge dynablocks that haven't been executed recently, based on tick age threshold (BOX64_DYNAREC_PURGE_AGE). -=item B=I + * 0 : Dynarec will not purge old unused dynablocks. [Default] + * 1 : Dynarec will purge old unused dynablocks based on tick age. -Force lib XXXX (and YYYY...) to be emulated (and not wrapped) Some games uses -an old version of some libraries, with an ABI incompatible with native version. -Note that LittleInferno for example is auto detected, and libvorbis.so.0 is -automatical added to emulated libs, and same for Don't Starve (and Together / -Server variant) that use an old SDL2 too -=item B=I<0|1> +=item B =I<4096|XXXX> -Allow Box64 to continue even if a library is missing. +Tick age threshold for dynablock purging (requires BOX64_DYNAREC_PURGE=1). - * 0 : Box64 will stop if a library cannot be loaded. (Default.) - * 1 : Continue even if a needed library cannot be loaded. Unadvised, this will, in most cases, crash later on. + * 4096 : Default age threshold. [Default] + * XXXX : Custom age threshold (range: 10-65536). -=item B=I<0|1> -Box64 will use wrapped libs even if the lib is specified with absolute path +=item B =I<0|1|2> - * 0 : Try to use emulated libs when they are defined with absolute path (Default.) - * 1 : Use Wrapped native libs even if path is absolute +Behaviour of flags emulation on CALL/RET opcodes and other edge cases. Available in WowBox64. -=item B=I<0|1> + * 0 : Treat CALL/RET as if it never needs any flags. + * 1 : Most of RETs will need flags, most of CALLs will not. [Default] + * 2 : All CALL/RET will need flags. All edge cases are also handled. -Box64 will prefer emulated libs first (execpt for glibc, alsa, pulse, GL, -vulkan and X11 - * 0 : Native libs are prefered (Default.) - * 1 : Emulated libs are prefered (Default for program running inside pressure-vessel) +=item B =I<0|1|2|3> -=item B=I<0|1> +Enable the emulation of x86 strong memory model. Available in WowBox64. -Box64 will use a dummy crashhandler.so library + * 0 : Do not try anything special. [Default] + * 1 : Enable some memory barriers when writing to memory to emulate the x86 strong memory model in a limited way. + * 2 : All in 1, plus memory barriers on SIMD instructions. + * 3 : All in 2, plus more memory barriers on a regular basis. - * 0 : Use Emulated crashhandler.so library if needed - * 1 : Use an internal dummy (completly empty) crashhandler.so library (defaut) -=item B=I<0|1|2> +=item B =I<0|1> -How Box64 will handle hooking of malloc operators +Enable or disable libtbb detection. - * 0 : Don't allow malloc operator to be redirected, rewriting code to use regular function (Default) - * 1 : Allow malloc operator to be redirected (not advised) - * 2 : Like 0, but track special mmap / free (some redirected functions were inlined and cannot be redirected) + * 0 : Do not detect libtbb. + * 1 : Detect libtbb and apply conservative settings. [Default] -=item B=I<0|1> -Disables the load of pulseaudio libraries. +=item B =I<0|1|0xXXXXXXXX-0xYYYYYYYY> - * 0 : Load pulseaudio libraries if found. (Default.) - * 1 : Disables the load of pulse audio libraries (libpulse and libpulse-simple), both the native library and the x86 library +Enable DynaRec execution comparison with the interpreter, very slow, only for testing. Available in WowBox64. -=item B=I<0|1> + * 0 : No comparison. [Default] + * 1 : Each opcode runs on interpreter and on Dynarec, regs and memory are compared and printed when they differ. + * 0xXXXXXXXX-0xYYYYYYYY : Define the range where dynarec is tested (inclusive-exclusive). -Disables the loading of wrapped GTK libraries. - * 0 : Load wrapped GTK libraries if found. (Default.) - * 1 : Disables loading wrapped GTK libraries. +=item B =I<0|1> -=item B=I<0|1> +Enable deduplication of IP address where COSIM find a difference. Available in WowBox64. -Disables the load of vulkan libraries. + * 0 : Show all addresses in error. [Default] + * 1 : Show address in error only 1 time, even if dump might differs. - * 0 : Load vulkan libraries if found. - * 1 : Disables the load of vulkan libraries, both the native and the i386 version (can be useful on Pi4, where the vulkan driver is not quite there yet.) -=item B=I<0|1> +=item B =I<0|1> -Use of the new fuext_waitc syscall +Do not dump test code when BOX64_DYNAREC_DUMP is enabled. Available in WowBox64. - * 0 : Do not try to use it, return unsupported (default for BAD_SIGNAL build) - * 1 : let program use the syscall if the host system support it (Default for other build) + * 0 : Dump test code. + * 1 : Do not dump test code. [Default] -=item B=I -Define x86_64 bash to launch script. Will use yyyy as x86_64 bash to launch -script. yyyy needs to be a full path to a valid x86_64 version of bash +=item B =I<0|1> -=item B=I<0|1|2> +Enable or disable DynaRec trace. - * 0 : Just print the Segfault message on segfault (default) - * 1 : Launch `gdb` when a segfault, bus error or illegal instruction signal is trapped, attached to the offending process and go in an endless loop, waiting. When in gdb, you need to find the correct thread yourself (the one with `my_box64signalhandler` in is stack) then probably need to `finish` 1 or 2 functions (inside `usleep(..)`) and then you'll be in `my_box64signalhandler`, just before the printf of the Segfault message. Then simply `set waiting=0` to exit the infinite loop. - * 2 : Launch `gdbserver` when a segfault, bus error or illegal instruction signal is trapped, attached to the offending process, and go in an endless loop, waiting. Use `gdb /PATH/TO/box64` and then `target remote 127.0.0.1:1234` to connect to the gdbserver (or use actual IP if not on the machine). After that, the procedure is the same as with ` BOX64_JITGDB=1`. This mode can be usefullwhen programs redirect all console output to a file (like Unity3D Games) + * 0 : Do not trace DynaRec blocks. [Default] + * 1 : Trace DynaRec blocks, will slow down the program a lot and generates huge logs. -=back -=head1 VARIABLES FOR ENVIRONMENT ONLY +=item B =I<0|1> -=over 8 +Use volatile metadata parsed from PE files, only valid for 64bit Windows games. + + * 0 : Do not use volatile metadata. + * 1 : Use volatile metadata, which will guide Box64 for better strong memory emulation. [Default] + + +=item B =I<0|1> + +Wait or not for the building of a DynaRec code block to be ready. Available in WowBox64. + + * 0 : Do not wait and use interpreter instead, might speedup a bit on massive multithread or JIT programs. + * 1 : Wait for a DynaRec code block to be ready. [Default] + + +=item B =I<0|1|2> + +Tweak the memory barriers to reduce the performance impact by strong memory emualtion. Available in WowBox64. + + * 0 : Use regular safe barrier. + * 1 : Use weak barriers to have more performance boost. [Default] + * 2 : All in 1, plus disabled the last write barriers. + + +=item B =I<0|1|2> + +Force the use of float/double for x87 emulation. Available in WowBox64. + + * 0 : Try to use float when possible for x87 emulation. [Default] + * 1 : Only use Double for x87 emulation. + * 2 : Check Precision Control low precision on x87 emulation. + + +=item B =I<0|1> + +Allow the use of Dynarec in Signal Handlers. + + * 0 : Allow the use of Dynarec in signal handlers. [Default] + * 1 : Only use the Interpreter for signal handlers (as it was in v0.3.8 and earlier). + + +=item B =I<0|1|2> + +Enable/disable the Dynamic Recompiler Cache (a.k.a DynaCache). This option defaults to 2 (to read cache if present but not generate any). DynaCache write file to home folder by default, and can grow without limit. + + * 0 : Disable DynaCache. + * 1 : Enable DynaCache. + * 2 : Use DynaCache files if present, but do not generate new one. [Default] + + +=item B =I + +Set the folder for DynaCache files. Default is $XDG_CACHE_HOME/box64 or $HOME/.cache/box64 if $XDG_CACHE_HOME is not set. + + * XXXX : Use folder XXXX for DynaCache files. + + +=item B =I + +Minimum size, in KB, for a DynaCache to be written to disk. Default size is 350KB + + * XXXX : Set a minimum size of XXXX KB of Dynarec code to write the dynacache to disk. Will not be saved to disk else. + * 350 : A size of 350 KB is the default value. [Default] + + +=item B =I + +Force the use of emulated libraries. + + * XXXX : Force the use of emulated library XXXX. + * XXXX:YYYY:ZZZZ : Force the use of emulated libraries XXXX, YYYY and ZZZZ. + + +=item B =I + +Add an environment variable. + + * XXXX=yyyy : Add environment variable XXXX with value yyyy. + + +=item B =I + +Add an environment variable. + + * XXXX=yyyy : Add environment variable XXXX with value yyyy. + + +=item B =I<0|1> + +Just exit, do not try to run the program. + + * 0 : Does nothing. [Default] + * 1 : Just exit. + + +=item B =I<0|1> + +Fix 64bit inodes. + + * 0 : Do not fix 64bit inodes. [Default] + * 1 : Fix 64bit inodes. + + +=item B =I<0|1> + +Ignore INT3 instructions. + + * 0 : Trigger a TRAP signal if a handler is present. [Default] + * 1 : Skip the opcode silently. + + +=item B =I + +Prepend arguments to the command line. + + * XXXX : Prepend argument XXXX to the program. + * XXXX YYYY ZZZZ : Prepend arguments XXXX, YYYY and ZZZZ to the guest program. + + +=item B =I<0|1> + +Add --in-process-gpu argument to the guest program. + + * 0 : Does nothing. [Default] + * 1 : Add --in-process-gpu argument to the guest program. + + +=item B =I<0|1|2|3> + +Launch gdb or not for SIGSEGV, SIGILL, and SIGBUS. + + * 0 : Just print the message when the signal is caught. [Default] + * 1 : Launch gdb when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process and go in an endless loop, waiting. Inside gdb, you need to find the correct thread yourself (the one with `my_box64signalhandler` in is stack), then probably need to `finish` 1 or 2 functions (inside `usleep(..)`) and then you'll be in `my_box64signalhandler`, just before the printf of the Segfault message. Then `set waiting=0` to exit the infinite loop. + * 2 : Launch gdbserver when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process, and go in an endless loop, waiting. Use `gdb /PATH/TO/box64` and then `target remote 127.0.0.1: 1234` to connect to the gdbserver (or use actual IP if not on the machine). After that, the procedure is the same as with `BOX64_JITGDB=1`. + * 3 : Launch lldb when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process and go in an endless loop, waiting. + + +=item B =I<0|1> + +Detect libjvm and apply conservative settings. + + * 0 : Does nothing. + * 1 : Detect libjvm, and apply BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_STRONGMEM=1 BOX64_SSE42=0 when detected. [Default] + + +=item B =I + +Path to look for x86_64 libraries. + + * XXXX : Add path XXXX to the library path. + + +=item B =I + +Force loading libraries with the binary. + + * XXXX : Force the loading of library XXXX. + * XXXX:YYYY : Force the loading of libraries XXXX and YYYY. + + +=item B =I<0|1> + +Detect libcef and apply BOX64_MALLOC_HACK settings. + + * 0 : Does nothing. [Default] + * 1 : Detect libcef, and apply BOX64_MALLOC_HACK=2 if detected. + + +=item B =I + +Set the name for libGL. + + * libXXXX : Set the name for libGL to libXXXX. + * /path/to/libXXXX : Set the name and path for libGL to /path/to/libXXXX, you can also use SDL_VIDEO_GL_DRIVER. + + +=item B =I<0xXXXXXXXX> + +Set the address where the program is loaded, only active for PIE guest programs. + + * 0xXXXXXXXX : Set the address where the program is loaded. + + +=item B =I<0|1|2|3> + +Enable or disable Box64 logs, default value is 0 if stdout is not terminal, 1 otherwise. Available in WowBox64. + + * 0 : Disable Box64 logs. + * 1 : Enable minimal Box64 logs. + * 2 : Enable debug level Box64 logs. + * 3 : Enable verbose level Box64 logs. + + +=item B =I<0|1|2> + +Behaviour when hooking malloc operators. + + * 0 : Don't allow malloc operator to be redirected, rewriting code to use regular function. [Default] + * 1 : Allow malloc operator to be redirected. + * 2 : Like 0, but track special mmap/free (some redirected functions are inlined and cannot be redirected). + + +=item B =I<0|XXXX> + +Maximum CPU cores exposed. Available in WowBox64. + + * 0 : Use the actual number of CPU cores. [Default] + * XXXX : Use XXXX CPU cores. + + +=item B =I<0|1> + +Force 32-bit compatible memory mappings on 64-bit programs that run 32-bit code (like Wine WOW64), can improve performance. + + * 0 : Do not force 32-bit memory mappings. + * 1 : Force 32-bit memory mappings. [Default] + + +=item B =I<0|1> + +Disable the Box64 banner. Available in WowBox64. + + * 0 : Show the Box64 banner. + * 1 : Do not show the Box64 banner. + + +=item B =I<0xXXXXXXXX-0xYYYYYYYY> + +Forbid dynablock creation in the address range specified, helpful for debugging behaviour difference between Dynarec and Interpreter. Available in WowBox64. + + * 0xXXXXXXXX-0xYYYYYYYY : Define the range where dynablock creation is forbidden (inclusive-exclusive). + + +=item B =I<0|1> + +Remove NoDynarec range after a delay. Available in WowBox64. + + * 0 : Do not remove NoDynarec range. [Default] + * 1 : Remove the NoDynarec range once 2 threads have been created. + + +=item B =I<0|1|2> + +Remove Architecture metatdata from Dynarec blocks (used on signal). Available in WowBox64. + + * 0 : Generate all architecture metadata for each blocks, including x87/mmx/SSE/AVX regs tracking. Wil use some more memory. [Default] + * 1 : Generate only essential metadata for each blocks (flags, alignments), saving some memory, but some encrypted software might fails. + * 2 : Do not generate metadata for blocks. Saving a bit more memory but might fails on signal handling. + + +=item B =I<0|1> + +Do not load wrapped GTK libraries. + + * 0 : Load wrapped GTK libraries. [Default] + * 1 : Do not load wrapped GTK libraries. + + +=item B =I<0|1> + +Do not load PulseAudio libraries (both native and x86_64). + + * 0 : Load PulseAudio libraries. [Default] + * 1 : Do not load PulseAudio libraries. + + +=item B =I<0|1> + +Do not load any rc files. + + * 0 : Load rc files. [Default] + * 1 : Do not load any rc files. + + +=item B =I<0|1> + +Add --no-sandbox argument to the guest program. + + * 0 : Does nothing. [Default] + * 1 : Add --no-sandbox argument to the guest program. + + +=item B =I<0|1> + +Disable the handling of SIGSEGV. + + * 0 : Let the x86 program set sighandler for SIGSEGV. [Default] + * 1 : Disable the handling of SIGSEGV. + + +=item B =I<0|1> + +Disable the handling of SIGILL. + + * 0 : Let the x86 program set sighandler for SIGILL. [Default] + * 1 : Disable the handling of SIGILL. + + +=item B =I<0|1> + +Do not load Vulkan libraries. + + * 0 : Load Vulkan libraries. [Default] + * 1 : Do not load Vulkan libraries, both native and x86_64. + + +=item B =I + +Path to look for x86_64 binaries. + + * XXXX : Add path XXXX to the binary path. + + +=item B =I<0|1> + +Expose PCLMULQDQ capabilities. Available in WowBox64. + + * 0 : Do not expose PCLMULQDQ capabilities. + * 1 : Expose PCLMULQDQ capabilities. [Default] + + +=item B =I<0|1> + +Prefer emulated libraries over native ones. + + * 0 : Prefer native libraries over emulated ones. [Default] + * 1 : Prefer emulated libraries over native ones. + + +=item B =I<0|1> + +Prefer wrapped libs first even if the lib is specified with absolute path. + + * 0 : Prefer libs with absolute path over wrapped ones. [Default] + * 1 : Prefer wrapped libs first even if the lib is specified with absolute path. + + +=item B =I + +Predefined sets of environment variables with compatibility or performance in mind. Available in WowBox64. + + * safest : Profile with all the unsafe DynaRec optimizations disabled. + * safe : Well, less safer than safest. + * default : The default settings that most programs runs fine with a handy performance. [Default] + * fast : Enable many unsafe optimizations, but also enable strongmem emulation. + * fastest : Enable many unsafe optimizations to have a better performance. + + +=item B =I + +Path to a python3 executable. + + * XXXX : Use python3 executable at path XXXX. + + +=item B =I + +Path to the rc file to load. + + * XXXX : Load the rc file XXXX, default rc files will not be loaded. + + +=item B =I<0|1> + +Use hardware counter for rdtsc if available. + + * 0 : Use hardware counter for rdtsc opcode if available. [Default] + * 1 : Use hardware counter for rdtsc if and only if precision is at least 1GHz. + + +=item B =I<0|1> + +Reserve high memory area for the program, always enabled on Box32. + + * 0 : Do not reserve high memory area for the program. [Default] + * 1 : Reserve high memory area for the program. + + +=item B =I<0|1|XXXX> + +Show last few wrapped function call when a signal is caught. + + * 0 : Does nothing. [Default] + * 1 : Show last 16 wrapped function call when a signal is caught. + * XXXX : Show last XXXX wrapped function call when a signal is caught. + + +=item B =I<0|1> + +Use a workaround for SDL_GetJoystickGUIDInfo function for wrapped SDL2. + + * 0 : Does nothing. [Default] + * 1 : Use a workaround for SDL_GetJoystickGUIDInfo function for wrapped SDL2. + + +=item B =I<0|1> + +Expose SHAEXT (a.k.a. SHA_NI) capabilities. Available in WowBox64. + + * 0 : Do not expose SHAEXT capabilities. + * 1 : Expose SHAEXT capabilities. [Default] + + +=item B =I<0|1> + +Show native and emulated backtrace when a signal is caught. + + * 0 : Does nothing. [Default] + * 1 : Show native and emulated backtrace when a signal is caught. + + +=item B =I<0|1> + +Always show SIGSEGV signal detailes. + + * 0 : Does nothing. [Default] + * 1 : Always show SIGSEGV signal detailes. + + +=item B =I<0|1> + +Behaviour of SSE Flush to 0 flags. Also tracking SSE exception flags. Available in WowBox64. + + * 0 : Just track the flag. [Default] + * 1 : Apply SSE Flush to 0 flag directly. Also reflect SSE exception flags in Dynarec (if available) + + +=item B =I<0|1> + +Expose SSE4.2 capabilities. Available in WowBox64. + + * 0 : Do not expose SSE4.2 capabilities. + * 1 : Expose SSE4.2 capabilities. [Default] + + +=item B =I<0|1> + +Force Vulkan for Linux Steam UI. + + * 0 : Do nothing. [Default] + * 1 : Force Vulkan for Linux Steam UI. + + +=item B =I<0|1> + +Synchronize rounding mode between x86 and native. + + * 0 : Do not synchronize rounding mode. [Default] + * 1 : Synchronize rounding mode between x86 and native. + + +=item B =I<0|1> + +Enable or disable colored trace output. + + * 0 : Disable colored trace output. [Default] + * 1 : Enable colored trace output. + + +=item B =I<0|1> + +Enable or disable EMM (i.e. MMX) trace output. + + * 0 : Disable EMM trace output. [Default] + * 1 : Enable EMM trace output. + + +=item B =I + +Send all log and trace to a file instead of `stdout`. + + * XXXX : Send all log and trace to file XXXX. + * XXXX%pid : Send all log and trace to file XXXX with pid appended. + * stderr : Send all log and trace to `stderr`. [Default] + * stdout : Send all log and trace to `stdout`. + + +=item B =I<0|1|symbolname|0xXXXXXXX-0xYYYYYYY> + +Same as BOX64_TRACE but starts the trace immediately. + + * 0 : Disable trace output. [Default] + * 1 : Enable trace output. Trace starts before the initialization of dependencies. + * symbolname : Enable trace output for `symbolname` only. Trace starts before the initialization of dependencies. + * 0xXXXXXXX-0xYYYYYYY : Enable trace output for the range of address (inclusive-exclusive). Trace starts before the initialization of dependencies. + + +=item B =I<0|1|XXXX> + +Start trace after N opcodes executed. + + * 0 : Start trace immediately. [Default] + * 1 : Start trace after 1 opcode executed. + * XXXX : Start trace after XXXX opcodes executed. + + +=item B =I<0|1> + +Enable or disable XMM (i.e. SSE) trace output. + + * 0 : Disable XMM trace output. [Default] + * 1 : Enable XMM trace output. + + +=item B =I<0|1|symbolname|0xXXXXXXX-0xYYYYYYY> + +Only available on box64 build with trace. Adds trace of all instructions executed, along with a register dump. + + * 0 : Disable trace output. [Default] + * 1 : Enable trace output. + * symbolname : Enable trace output for `symbolname` only. + * 0xXXXXXXX-0xYYYYYYY : Enable trace output for the range of address (inclusive-exclusive). + + +=item B =I<0|1> + +Detect UnityPlayer and apply conservative settings. + + * 0 : Does nothing. + * 1 : Detect UnityPlayer (Windows or Linux), and apply BOX64_UNITY=1 when detected. [Default] + + +=item B =I<0|1> + +Games is a Unity one. + + * 0 : Does nothing. + * 1 : Unity Game, use special detecting code for Windows, apply BOX64_DYNAREC_STRONGMEM=1 for Linux. [Default] + + +=item B =I<0|1> + +Prefer wrapped libs for EGL and GLESv2. + + * 0 : Prefer emulated libs for EGL and GLESv2. [Default] + * 1 : Prefer wrapped libs for EGL and GLESv2. + + +=item B =I<0|1> + +Force Xorg GLX extension to be present. + + * 0 : Do not force Xorg GLX extension to be present. [Default] + * 1 : Require Xorg GLX extension when using XQueryExtension. + + +=item B =I<0|1> + +Force synchronized operation on X11 display. + + * 0 : Do not force synchronized operation on X11 display. [Default] + * 1 : Force synchronized operation on X11 display. + + +=item B =I<0|1> + +Call XInitThreads when loading X11. This is mostly for old Loki games with the Loki_Compat library. + + * 0 : Do not call XInitThreads. [Default] + * 1 : Call XInitThreads as soon as libX11 is loaded. + + +=item B =I<0|1> + +Behavoiur of x87 80bits long double. Available in WowBox64. -=item B + * 0 : Try to handle 80bits long double as precise as possible. [Default] + * 1 : Use 64bits double for x87. -When set, B will only print its version and then exit. This option is -analogous to B used by C emulation of qemu-user. Its -purpose is the same: provide a way to soft-disable C emulation as -well as for identifying B as the registered C emulator. =back diff --git a/docs/gen/gen.py b/docs/gen/gen.py new file mode 100644 index 0000000..da81332 --- /dev/null +++ b/docs/gen/gen.py @@ -0,0 +1,330 @@ +# Usage: python gen.py + +import json +import os +import re +from collections import defaultdict + +script_dir = os.path.dirname(os.path.abspath(__file__)) +usage_file = os.path.join(script_dir, 'usage.json') + +with open(usage_file, 'r') as file: + data = json.load(file) + + with open(os.path.join(script_dir, '../USAGE.md'), 'w') as md_file: + md_file.write(""" +Usage +---- + +There are many environment variables to control Box64's behaviour, which will be listed below by category. + +There are 2 types of Box64 builds: the Wine WOW64 build (WowBox64) and the regular Linux build. Beware only some of the environment variables are available in WowBox64. + +### Configuration files + +In addition to environment variables, if you're using the regular Linux build, Box64 also looks for 2 places for rcfile by default: the system-wide `/etc/box64.box64rc` and user-specific `~/.box64rc`. +While in WowBox64, the configuration file is checked at `%USERPROFILE%/.box64rc` only. +Settings priority follows this order (from highest to lowest): `~/.box64rc` > `/etc/box64.box64rc` > environment variables. + +Example configuration: + +``` +[factorio] +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_BIGBLOCK=2 +BOX64_DYNAREC_FORWARD=1024 +BOX64_DYNAREC_CALLRET=1 +``` + +This configuration will apply the specified settings application-wide to any executable named `factorio`. + +### Advanced usage for Linux build + +1. **Wildcard Matching** + + Asterisks (`*`) can be used for basic pattern matching in application names. For instance, `[*setup*]` will match any program containing "setup" in its name. Note this implements simple wildcard matching rather than full regex support. +2. **Custom Configuration File** + + The `BOX64_RCFILE` environment variable can specify an alternative configuration file instead of the default `/etc/box64.box64rc`. +3. **Per-File Settings** + + Sections starting with `/` apply to specific files. For example: + ``` + [/d3d9.dll] + BOX64_DYNAREC_SAFEFLAGS=0 + ``` + These settings will only affect the `d3d9.dll` file. This syntax also works for **emulated** Linux libraries, e.g., `[/libstdc++.so.6]`. + +---- + +""") + + categories = defaultdict(list) + for entry in data: + categories[entry["category"]].append(entry) + + # Put "Performance" at the top, then sort the rest alphabetically + sorted_categories = sorted(categories.items(), key=lambda x: (x[0] != "Performance", x[0])) + for category, entries in sorted_categories: + md_file.write(f"## {category}\n\n") + for entry in entries: + md_file.write(f"### {entry['name']}\n\n{entry['description']}{' Available in WowBox64.' if entry['wine'] else ''}\n\n") + for option in entry['options']: + md_file.write(f" * {option['key']}: {option['description']} {'[Default]' if option['default'] else ''}\n") + md_file.write("\n") + + + with open(os.path.join(script_dir, '../box64.pod'), 'w') as pod_file: + pod_file.write("""=head1 NAME + +box64 - Linux Userspace x86_64 Emulator with a twist + +=head1 SYNOPSIS + +B [B<--help>] [B<--version>] I + +=head1 DESCRIPTION + +B lets you run x86_64 Linux programs (such as games) on non-x86_64 Linux +systems, like ARM (host system needs to be 64-bit little-endian). Since B +uses the native versions of some "system" libraries, like libc, libm, SDL, and +OpenGL, it's easy to integrate and use with most applications, and performance +can be surprisingly high in many cases. B integrates with DynaRec (dynamic +recompiler) for the ARM64 platform, providing a speed boost between 5 to 10 +times faster than using only the interpreter. + +=head1 OPTIONS + +=over 8 + +=item B<-h,--help> + +Print box64 help and quit. + +=item B<-v,--version> + +Print box64 version and quit. + +=back + +=head1 BRIEF USAGE + +There are many environment variables to control B's behaviour. In +addition to environment variables, B also looks for 2 places for rcfile: +F and F<~/.box64rc>, in the format of .ini files. +Settings priority: F<~/.box64rc> > F > environment variables. +Example: + + [factorio] + BOX64_DYNAREC_SAFEFLAGS=0 + BOX64_DYNAREC_BIGBLOCK=2 + BOX64_DYNAREC_FORWARD=1024 + BOX64_DYNAREC_CALLRET=1 + +=head1 ENVIRONMENT VARIABLES + +=over 8 + +""") + + for entry in data: + pod_file.write(f"\n=item B<{entry['name']}> =I<{ '|'.join(option['key'] for option in entry['options']) }>\n\n{entry['description']}{' Available in WowBox64.' if entry['wine'] else ''}\n\n") + for option in entry['options']: + pod_file.write(f" * {option['key']} : {option['description']} {'[Default]' if option['default'] else ''}\n") + pod_file.write("\n") + + pod_file.write(""" +=back + +=cut +""") + +#################### +# Validation +#################### + +PADDING = 30 +INCLUDE_BLANK = False + +def get_usage_entry(usage, define): + entry = list(e for e in usage if e["name"] == define) + if len(entry) == 0: + print(f"{define:<{PADDING}}: missing usage.json entry") + elif len(entry) > 1: + print(f"{define:<{PADDING}}: multiple usage entries found", len(entry)) + else: + return entry[0] + return None + +# check `default` uniqueness +for entry in data: + i = list(d["default"] for d in entry["options"]).count(True) + if i > 1: + print(f"{entry['name']:<{PADDING}}: multiple default values usage.json") + + +# regex to match env.h C code +regex = { + "INTEGER": re.compile( + r"^\s*INTEGER\((?P\w+), (?P\w+), (?P\w+), (?P\w+), (?P\w+), (?P\w+)\)" + ), + "INTEGER64": re.compile( + r"^\s*INTEGER64\((?P\w+), (?P\w+), (?P\w+), (?P\w+)\)" + ), + "BOOLEAN": re.compile( + r"^\s*BOOLEAN\((?P\w+), (?P\w+), (?P\w+), (?P\w+)\)" + ), + "ADDRESS": re.compile(r"^\s*ADDRESS\((?P\w+), (?P\w+), (?P\w+)\)"), + "STRING": re.compile(r"^\s*STRING\((?P\w+), (?P\w+), (?P\w+)\)"), +} + +env_file = os.path.join(script_dir, "../../src/include/env.h") +with open(env_file, "r") as file: + matches = {} + for line in file.readlines(): + for t, r in regex.items(): + m = r.search(line) + if m: + # filter out comments and other non useful code + if m.group("define") == "NAME": + continue + + if t not in matches: + matches[t] = {} + if (m.group("define") in matches[t]): + # multiple definitions, no default + matches[t][m.group("define")]['no_default'] = True + break + matches[t][m.group("define")] = m.groupdict() + matches[t][m.group("define")]['no_default'] = False + +for define, m in matches["INTEGER"].items(): + name = m["name"] + default = None if m["no_default"] or not m["default"].isdigit() else int(m["default"]) + min = int(m["min"]) + max = int(m["max"]) + + # Check default in valid range + if default and (default < min or default > max): + print(f"{define:<{PADDING}}: default lays outside of min/max range") + + # Check consistency with usage.json + if e := get_usage_entry(data, define): + # guess min/max values if possible + min2 = max2 = None + # blank means that the entry has an 'XXXX' entry which usually indicated that arbitrary values are valid + blank = False + default2 = None + + if int(m["wine"]) != int(e["wine"]): + print(f"{define:<{PADDING}}: wine mismatch: env.h={int(m['wine'])}, usage.json={int(e['wine'])}") + + for o in e["options"]: + if o["key"] == "XXXX": + blank = True + continue + + val = int(o["key"]) # not supposed to fail + + min2 = min2 if min2 is not None and min2 < val else val + max2 = max2 if max2 is not None and max2 > val else val + + if o["default"]: + default2 = val + + if min2 and min2 != min: + if not blank or (blank and INCLUDE_BLANK): + print( + f"{define:<{PADDING}}: min value mismatch: env.h={min}, usage.json={min2}{(' (possible false positive)' if blank else '')}" + ) + if max2 and max2 != max: + if not blank or (blank and INCLUDE_BLANK): + print( + f"{define:<{PADDING}}: max value mismatch: env.h={max}, usage.json={max2}{(' (possible false positive)' if blank else '')}" + ) + if default2 != default: + print( + f"{define:<{PADDING}}: default value mismatch: env.h={default}, usage.json={default2}" + ) + +for define, m in matches['INTEGER64'].items(): + # similar to INTEGER but without min/max + name = m["name"] + default = None if m["no_default"] or not m["default"].isdigit() else int(m["default"]) + + # Check consistency with usage.json + if e := get_usage_entry(data, define): + default2 = None + + if int(m["wine"]) != int(e["wine"]): + print(f"{define:<{PADDING}}: wine mismatch: env.h={int(m['wine'])}, usage.json={int(e['wine'])}") + + for o in e["options"]: + if o["key"] == "XXXX": + continue + + val = int(o["key"]) + + if o["default"]: + default2 = val + + if default2 != default: + print( + f"{define:<{PADDING}}: default value mismatch: env.h={default}, usage.json={default2}" + ) + +for define, m in matches["BOOLEAN"].items(): + name = m["name"] + default = None if m["no_default"] or m["default"] not in ["0", "1"] else bool(m["default"]) + + # Check consistency with usage.json + if e := get_usage_entry(data, define): + default2 = None + + if int(m["wine"]) != int(e["wine"]): + print(f"{define:<{PADDING}}: wine mismatch: env.h={int(m['wine'])}, usage.json={int(e['wine'])}") + + for o in e["options"]: + try: + val = bool(o["key"]) + except ValueError: + print(f"{define:<{PADDING}}: failed to parse boolean {o['key']}") + + if o["default"]: + default2 = val + + if default2 != default: + print( + f"{define:<{PADDING}}: default value mismatch: env.h={default}, usage.json={default2}" + ) + +# ADDRESS and STRING are not that interesting +for define, m in matches["ADDRESS"].items(): + if e := get_usage_entry(data, define): + if int(m["wine"]) != int(e["wine"]): + print(f"{define:<{PADDING}}: wine mismatch: env.h={int(m['wine'])}, usage.json={int(e['wine'])}") + +for define, m in matches["STRING"].items(): + # skip BOX64_ENV[1-5] entries, they mismatch but this is fine + if define.startswith("BOX64_ENV"): + continue + if e := get_usage_entry(data, define): + if int(m["wine"]) != int(e["wine"]): + print(f"{define:<{PADDING}}: wine mismatch: env.h={int(m['wine'])}, usage.json={int(e['wine'])}") + +# check that everything from usage.json is in env.h +for e in data: + define = e["name"] + + # skip BOX64_ENV[1-5] entries, they mismatch but this is fine + if define.startswith("BOX64_ENV"): + continue + + found = False + for t in matches: + for d in matches[t]: + if d == define: + found = True + + if not found: + print(f"{define:<{PADDING}}: missing env.h entry") diff --git a/docs/gen/usage.json b/docs/gen/usage.json new file mode 100644 index 0000000..e096387 --- /dev/null +++ b/docs/gen/usage.json @@ -0,0 +1,2178 @@ +[ + { + "name": "BOX64_ADDLIBS", + "description": "Add extras to the needed libraries list, rarely needed.", + "category": "Libraries", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Add library XXXX to the needed libraries list.", + "default": false + }, + { + "key": "XXXX:YYYY:ZZZZ", + "description": "Add library XXXX, YYYY and ZZZZ to the needed libraries list.", + "default": false + } + ] + }, + { + "name": "BOX64_AES", + "description": "Expose AES capabilities.", + "category": "Compatibility", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not expose AES capabilities.", + "default": false + }, + { + "key": "1", + "description": "Expose AES capabilities.", + "default": true + } + ] + }, + { + "name": "BOX64_ALLOWMISSINGLIBS", + "description": "Allow missing libraries to be ignored.", + "category": "Libraries", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not allow missing libraries.", + "default": true + }, + { + "key": "1", + "description": "Allow missing libraries.", + "default": false + } + ] + }, + { + "name": "BOX64_ARCH", + "description": "Specify the architecture in rcfiles to which the current entry applies. This option only takes effect when used inside rcfiles.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "`arm64`", + "description": "Only apply current entry for AArch64.", + "default": false + }, + { + "key": "`la64`", + "description": "Only apply current entry for LoongArch64.", + "default": false + }, + { + "key": "`rv64`", + "description": "Only apply current entry for RISC-V.", + "default": false + }, + { + "key": "``", + "description": "Apply current entry for all architectures, will be replaced by more specific entries.", + "default": true + } + ] + }, + { + "name": "BOX64_ARGS", + "description": "Arguments to pass to the guest program, only valid if there is no existing arguments.", + "category": "Arguments", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Pass argument XXXX to the program.", + "default": false + }, + { + "key": "XXXX YYYY ZZZZ", + "description": "Pass arguments XXXX, YYYY and ZZZZ to the guest program.", + "default": false + } + ] + }, + { + "name": "BOX64_AVX", + "description": "Expose AVX extension to CPUID and cpuinfo file. Default value is 2 on Arm64 because it's fully implemented in DynaRec, 0 otherwise.", + "category": "Compatibility", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not expose AVX capabilities.", + "default": false + }, + { + "key": "1", + "description": "Expose AVX, BMI1, F16C and VAES extensions to CPUID and cpuinfo file.", + "default": false + }, + { + "key": "2", + "description": "All in 1, plus AVX2, BMI2, FMA, ADX,VPCLMULQDQ and RDRAND extensions.", + "default": false + } + ] + }, + { + "name": "BOX64_BASH", + "description": "Path to the bash executable.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Use bash executable at path XXXX.", + "default": false + } + ] + }, + { + "name": "BOX64_CPUTYPE", + "description": "Specify the CPU type to emulate.", + "category": "Compatibility", + "wine": true, + "options": [ + { + "key": "0", + "description": "Emulate a Intel CPU Model.", + "default": true + }, + { + "key": "1", + "description": "Emulate a AMD CPU Model.", + "default": false + } + ] + }, + { + "name": "BOX64_CRASHHANDLER", + "description": "Use a dummy crash handler or not.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Use emulated crashhandler.so library if needed.", + "default": false + }, + { + "key": "1", + "description": "Use an internal dummy (empty) crashhandler.so library.", + "default": true + } + ] + }, + { + "name": "BOX64_DLSYM_ERROR", + "description": "Enable or disable the logging of dlsym errors.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Disable the logging of dlsym errors.", + "default": true + }, + { + "key": "1", + "description": "Enable the logging of dlsym errors.", + "default": false + } + ] + }, + { + "name": "BOX64_DUMP", + "description": "Dump elfloader debug information.", + "category": "Debugging", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not dump elfloader debug information.", + "default": true + }, + { + "key": "1", + "description": "Dump elfloader debug information.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC", + "description": "Enable/disable the Dynamic Recompiler (a.k.a DynaRec). This option defaults to 1 if it's enabled in the build options for a supported architecture.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Disable DynaRec.", + "default": false + }, + { + "key": "1", + "description": "Enable DynaRec.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_ALIGNED_ATOMICS", + "description": "Generate aligned atomics only (only available on Arm64 for now).", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Generate unaligned atomics handling code.", + "default": true + }, + { + "key": "1", + "description": "Generate aligned atomics only, which is faster and smaller code size, but will cause SIGBUS for LOCK prefixed opcodes operating on unaligned data addresses.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_BIGBLOCK", + "description": "Enable building bigger DynaRec code blocks for better performance.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not try to build block as big as possible, suitable for programs using lots of threads and JIT, like Unity.", + "default": false + }, + { + "key": "1", + "description": "Build Dynarec block as big as possible.", + "default": false + }, + { + "key": "2", + "description": "Build Dynarec block bigger, do not stop when block overlaps, but only for blocks in elf memory.", + "default": true + }, + { + "key": "3", + "description": "Build Dynarec block bigger, do not stop when block overlaps, for all type of memory, useful for wine programs.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_BLEEDING_EDGE", + "description": "Detect MonoBleedingEdge and apply conservative settings (Linux only).", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not detect MonoBleedingEdge.", + "default": false + }, + { + "key": "1", + "description": "Detect MonoBleedingEdge and apply BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_STRONGMEM=1 when detected.", + "default": true + } + ] + }, + { + "name": "BOX64_DYNAREC_CALLRET", + "description": "Optimize CALL/RET opcodes.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not optimize CALL/RET, use jump table.", + "default": true + }, + { + "key": "1", + "description": "Try to optimize CALL/RET, skipping the jump table when possible.", + "default": false + }, + { + "key": "2", + "description": "Try to optimize CALL/RET, skipping the jump table when possible, adding code to handle return to dirty/modified block. Does not work on WowBox64.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_DF", + "description": "Enable or disable the use of deferred flags.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Disable the use of deferred flags.", + "default": false + }, + { + "key": "1", + "description": "Enable the use of deferred flags.", + "default": true + } + ] + }, + { + "name": "BOX64_DYNAREC_DIRTY", + "description": "Allow continue running a block that is unprotected and potentially dirty.", + "category": "Performance", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not allow continue running a block that is unprotected and potentially dirty.", + "default": true + }, + { + "key": "1", + "description": "Allow continue to run a dynablock that write data in the same page as code. It can gets faster in loading time of some game but can also get unexpected crashes.", + "default": false + }, + { + "key": "2", + "description": "Will also, when it detect an HotPage, flag that page as NEVERCLEAN, and so it will not be write protected but Block build from that page will always be tested. It can be faster that way (but soem SMC case might not be trapped).", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_NOHOTPAGE", + "description": "Disable detection of hot page (where code is executed and data written at the same time).", + "category": "Performance", + "wine": false, + "options": [ + { + "key": "0", + "description": "Detect hot page", + "default": true + }, + { + "key": "1", + "description": "Do not detect hot page", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_HOTPAGE_ALT", + "description": "Use alternative way to detect HotPages (legacy way).", + "category": "Performance", + "wine": false, + "options": [ + { + "key": "0", + "description": "Detect hot page, using new method from v0.3.9+", + "default": true + }, + { + "key": "1", + "description": "Use alternate method to detect HotPage (from v0.3.8 and earlier)", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_DIV0", + "description": "Enable or disable the generation of division-by-zero exception.", + "category": "Compatibility", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not generate the division-by-zero exception.", + "default": true + }, + { + "key": "1", + "description": "Generate the division-by-zero exception.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_DUMP", + "description": "Enable DynaRec dump.", + "category": "Debugging", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not dump DynaRec blocks.", + "default": true + }, + { + "key": "1", + "description": "Dump DynaRec blocks.", + "default": false + }, + { + "key": "2", + "description": "Dump DynaRec blocks with some colors.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_DUMP_RANGE", + "description": "Dump DynaRec blocks in the specified range.", + "category": "Debugging", + "wine": true, + "options": [ + { + "key": "0xXXXXXXXX-0xYYYYYYYY", + "description": "Define the range where dynablock gets dumped (inclusive-exclusive).", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_FASTNAN", + "description": "Enable or disable fast NaN handling.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Precisely emulate the -NaN generation like on x86.", + "default": false + }, + { + "key": "1", + "description": "Do not do anything special with -NAN generation, faster.", + "default": true + } + ] + }, + { + "name": "BOX64_DYNAREC_FASTROUND", + "description": "Enable or disable fast rounding.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Generate float/double -> int rounding and use current rounding mode for float/double computation like on x86.", + "default": false + }, + { + "key": "1", + "description": "Do not do anything special with edge case rounding, faster.", + "default": true + }, + { + "key": "2", + "description": "Generate float/double -> int rounding using current rounding mode for float/double computation like on x86, but use fast int -> float/double conversion.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_FORWARD", + "description": "Define max allowed forward value when building block.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "No forward value. When current block ends, do not try to go further even if there are previous forward jumps.", + "default": false + }, + { + "key": "128", + "description": "Allow up to 128 bytes of gap between end of the block and the next forward jump.", + "default": true + }, + { + "key": "XXXX", + "description": "Allow up to XXXX bytes of gap between end of the block and the next forward jump.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_GDBJIT", + "description": "The GDBJIT debugging support, only available on build with `-DGDBJIT=ON`, enable it with gdb command: jit-reader-load /usr/local/lib/libbox64gdbjitreader.so.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Dynarec will not generate GDBJIT debuginfo.", + "default": true + }, + { + "key": "1", + "description": "Dynarec will generate GDBJIT debuginfo.", + "default": false + }, + { + "key": "2", + "description": "Dynarec will generate detailed GDBJIT debuginfo with internal state.", + "default": false + }, + { + "key": "3", + "description": "Dynarec will register detailed GDBJIT debuginfo only for dynablocks that the guest program trap into, greatly improving performance.", + "default": false + }, + { + "key": "0xXXXXXXX-0xYYYYYYY", + "description": "Define the range where Dynarec will generate detailed GDBJIT debuginfo with internal state.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_LOG", + "description": "Disable or enable DynaRec logs.", + "category": "Debugging", + "wine": true, + "options": [ + { + "key": "0", + "description": "Disable DynaRec logs.", + "default": true + }, + { + "key": "1", + "description": "Enable minimal DynaRec logs.", + "default": false + }, + { + "key": "2", + "description": "Enable debug level DynaRec logs.", + "default": false + }, + { + "key": "3", + "description": "Enable verbose level DynaRec logs.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_MISSING", + "description": "Print missing opcodes.", + "category": "Debugging", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not print the missing opcode.", + "default": true + }, + { + "key": "1", + "description": "Print missing opcodes.", + "default": false + }, + { + "key": "2", + "description": "Print the fallback to scalar opcodes, only valid on RISC-V.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_NATIVEFLAGS", + "description": "Enable or disable the use of native flags.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not use native flags.", + "default": false + }, + { + "key": "1", + "description": "Use native flags when possible.", + "default": true + } + ] + }, + { + "name": "BOX64_DYNAREC_NOHOSTEXT", + "description": "Disable optional host extensions.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Disable nothing.", + "default": true + }, + { + "key": "1", + "description": "Disable all the optional extensions.", + "default": false + }, + { + "key": "xxx,yyy,zzz", + "description": "Disable selected optional extensions, choices are Arm: `crc32,pmull,aes,atomics,sha1,sha2,uscat,flagm,flagm2,frintts,afp,rndr`, LoongArch: `lasx,lbt,frecipe,lam_bh,lamcas,scq`, and RISC-V: `zba,zbb,zbc,zbs,vector,xtheadba,xtheadbb,xtheadbs,xtheadmemidx,xtheadmempair,xtheadcondmov`.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_PAUSE", + "description": "Enable x86 PAUSE emulation, may help the performance of spinlocks.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Ignore x86 PAUSE instruction.", + "default": true + }, + { + "key": "1", + "description": "Use YIELD to emulate x86 PAUSE instruction.", + "default": false + }, + { + "key": "2", + "description": "Use WFI to emulate x86 PAUSE instruction.", + "default": false + }, + { + "key": "3", + "description": "Use SEVL+WFE to emulate x86 PAUSE instruction.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_PERFMAP", + "description": "Generate map file for Linux perf tool.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Dynarec will not generate perf map.", + "default": true + }, + { + "key": "1", + "description": "Dynarec will generate perf map.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_PURGE", + "description": "Purge dynablocks that haven't been executed recently, based on tick age threshold (BOX64_DYNAREC_PURGE_AGE).", + "category": "Performance", + "wine": false, + "options": [ + { + "key": "0", + "description": "Dynarec will not purge old unused dynablocks.", + "default": true + }, + { + "key": "1", + "description": "Dynarec will purge old unused dynablocks based on tick age.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_PURGE_AGE", + "description": "Tick age threshold for dynablock purging (requires BOX64_DYNAREC_PURGE=1).", + "category": "Performance", + "wine": false, + "options": [ + { + "key": "4096", + "description": "Default age threshold.", + "default": true + }, + { + "key": "XXXX", + "description": "Custom age threshold (range: 10-65536).", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_SAFEFLAGS", + "description": "Behaviour of flags emulation on CALL/RET opcodes and other edge cases.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Treat CALL/RET as if it never needs any flags.", + "default": false + }, + { + "key": "1", + "description": "Most of RETs will need flags, most of CALLs will not.", + "default": true + }, + { + "key": "2", + "description": "All CALL/RET will need flags. All edge cases are also handled.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_STRONGMEM", + "description": "Enable the emulation of x86 strong memory model.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not try anything special.", + "default": true + }, + { + "key": "1", + "description": "Enable some memory barriers when writing to memory to emulate the x86 strong memory model in a limited way.", + "default": false + }, + { + "key": "2", + "description": "All in 1, plus memory barriers on SIMD instructions.", + "default": false + }, + { + "key": "3", + "description": "All in 2, plus more memory barriers on a regular basis.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_TBB", + "description": "Enable or disable libtbb detection.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not detect libtbb.", + "default": false + }, + { + "key": "1", + "description": "Detect libtbb and apply conservative settings.", + "default": true + } + ] + }, + { + "name": "BOX64_DYNAREC_TEST", + "description": "Enable DynaRec execution comparison with the interpreter, very slow, only for testing.", + "category": "Debugging", + "wine": true, + "options": [ + { + "key": "0", + "description": "No comparison.", + "default": true + }, + { + "key": "1", + "description": "Each opcode runs on interpreter and on Dynarec, regs and memory are compared and printed when they differ.", + "default": false + }, + { + "key": "0xXXXXXXXX-0xYYYYYYYY", + "description": "Define the range where dynarec is tested (inclusive-exclusive).", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_TEST_NODUP", + "description": "Enable deduplication of IP address where COSIM find a difference.", + "category": "Debugging", + "wine": true, + "options": [ + { + "key": "0", + "description": "Show all addresses in error.", + "default": true + }, + { + "key": "1", + "description": "Show address in error only 1 time, even if dump might differs.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_TEST_NODUMP", + "description": "Do not dump test code when BOX64_DYNAREC_DUMP is enabled.", + "category": "Debugging", + "wine": true, + "options": [ + { + "key": "0", + "description": "Dump test code.", + "default": false + }, + { + "key": "1", + "description": "Do not dump test code.", + "default": true + } + ] + }, + { + "name": "BOX64_DYNAREC_TRACE", + "description": "Enable or disable DynaRec trace.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not trace DynaRec blocks.", + "default": true + }, + { + "key": "1", + "description": "Trace DynaRec blocks, will slow down the program a lot and generates huge logs.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_VOLATILE_METADATA", + "description": "Use volatile metadata parsed from PE files, only valid for 64bit Windows games.", + "category": "Performance", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not use volatile metadata.", + "default": false + }, + { + "key": "1", + "description": "Use volatile metadata, which will guide Box64 for better strong memory emulation.", + "default": true + } + ] + }, + { + "name": "BOX64_DYNAREC_WAIT", + "description": "Wait or not for the building of a DynaRec code block to be ready.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not wait and use interpreter instead, might speedup a bit on massive multithread or JIT programs.", + "default": false + }, + { + "key": "1", + "description": "Wait for a DynaRec code block to be ready.", + "default": true + } + ] + }, + { + "name": "BOX64_DYNAREC_WEAKBARRIER", + "description": "Tweak the memory barriers to reduce the performance impact by strong memory emualtion.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Use regular safe barrier.", + "default": false + }, + { + "key": "1", + "description": "Use weak barriers to have more performance boost.", + "default": true + }, + { + "key": "2", + "description": "All in 1, plus disabled the last write barriers.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_X87DOUBLE", + "description": "Force the use of float/double for x87 emulation.", + "category": "Compatibility", + "wine": true, + "options": [ + { + "key": "0", + "description": "Try to use float when possible for x87 emulation.", + "default": true + }, + { + "key": "1", + "description": "Only use Double for x87 emulation.", + "default": false + }, + { + "key": "2", + "description": "Check Precision Control low precision on x87 emulation.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_INTERP_SIGNAL", + "description": "Allow the use of Dynarec in Signal Handlers.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Allow the use of Dynarec in signal handlers.", + "default": true + }, + { + "key": "1", + "description": "Only use the Interpreter for signal handlers (as it was in v0.3.8 and earlier).", + "default": false + } + ] + }, + { + "name": "BOX64_DYNACACHE", + "description": "Enable/disable the Dynamic Recompiler Cache (a.k.a DynaCache). This option defaults to 2 (to read cache if present but not generate any). DynaCache write file to home folder by default, and can grow without limit.", + "category": "Performance", + "wine": false, + "options": [ + { + "key": "0", + "description": "Disable DynaCache.", + "default": false + }, + { + "key": "1", + "description": "Enable DynaCache.", + "default": false + }, + { + "key": "2", + "description": "Use DynaCache files if present, but do not generate new one.", + "default": true + } + ] + }, + { + "name": "BOX64_DYNACACHE_FOLDER", + "description": "Set the folder for DynaCache files. Default is $XDG_CACHE_HOME/box64 or $HOME/.cache/box64 if $XDG_CACHE_HOME is not set.", + "category": "Performance", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Use folder XXXX for DynaCache files.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNACACHE_MIN", + "description": "Minimum size, in KB, for a DynaCache to be written to disk. Default size is 350KB", + "category": "Performance", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Set a minimum size of XXXX KB of Dynarec code to write the dynacache to disk. Will not be saved to disk else.", + "default": false + }, + { + "key": "350", + "description": "A size of 350 KB is the default value.", + "default": true + } + ] + }, + { + "name": "BOX64_EMULATED_LIBS", + "description": "Force the use of emulated libraries.", + "category": "Libraries", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Force the use of emulated library XXXX.", + "default": false + }, + { + "key": "XXXX:YYYY:ZZZZ", + "description": "Force the use of emulated libraries XXXX, YYYY and ZZZZ.", + "default": false + } + ] + }, + { + "name": "BOX64_ENV", + "description": "Add an environment variable.", + "category": "Environment", + "wine": false, + "options": [ + { + "key": "XXXX=yyyy", + "description": "Add environment variable XXXX with value yyyy.", + "default": false + } + ] + }, + { + "name": "BOX64_ENV[1-5]", + "description": "Add an environment variable.", + "category": "Environment", + "wine": false, + "options": [ + { + "key": "XXXX=yyyy", + "description": "Add environment variable XXXX with value yyyy.", + "default": false + } + ] + }, + { + "name": "BOX64_EXIT", + "description": "Just exit, do not try to run the program.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Does nothing.", + "default": true + }, + { + "key": "1", + "description": "Just exit.", + "default": false + } + ] + }, + { + "name": "BOX64_FIX_64BIT_INODES", + "description": "Fix 64bit inodes.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not fix 64bit inodes.", + "default": true + }, + { + "key": "1", + "description": "Fix 64bit inodes.", + "default": false + } + ] + }, + { + "name": "BOX64_IGNOREINT3", + "description": "Ignore INT3 instructions.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Trigger a TRAP signal if a handler is present.", + "default": true + }, + { + "key": "1", + "description": "Skip the opcode silently.", + "default": false + } + ] + }, + { + "name": "BOX64_INSERT_ARGS", + "description": "Prepend arguments to the command line.", + "category": "Arguments", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Prepend argument XXXX to the program.", + "default": false + }, + { + "key": "XXXX YYYY ZZZZ", + "description": "Prepend arguments XXXX, YYYY and ZZZZ to the guest program.", + "default": false + } + ] + }, + { + "name": "BOX64_INPROCESSGPU", + "description": "Add --in-process-gpu argument to the guest program.", + "category": "Arguments", + "wine": false, + "options": [ + { + "key": "0", + "description": "Does nothing.", + "default": true + }, + { + "key": "1", + "description": "Add --in-process-gpu argument to the guest program.", + "default": false + } + ] + }, + { + "name": "BOX64_JITGDB", + "description": "Launch gdb or not for SIGSEGV, SIGILL, and SIGBUS.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Just print the message when the signal is caught.", + "default": true + }, + { + "key": "1", + "description": "Launch gdb when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process and go in an endless loop, waiting. Inside gdb, you need to find the correct thread yourself (the one with `my_box64signalhandler` in is stack), then probably need to `finish` 1 or 2 functions (inside `usleep(..)`) and then you'll be in `my_box64signalhandler`, just before the printf of the Segfault message. Then `set waiting=0` to exit the infinite loop.", + "default": false + }, + { + "key": "2", + "description": "Launch gdbserver when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process, and go in an endless loop, waiting. Use `gdb /PATH/TO/box64` and then `target remote 127.0.0.1: 1234` to connect to the gdbserver (or use actual IP if not on the machine). After that, the procedure is the same as with `BOX64_JITGDB=1`.", + "default": false + }, + { + "key": "3", + "description": "Launch lldb when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process and go in an endless loop, waiting.", + "default": false + } + ] + }, + { + "name": "BOX64_JVM", + "description": "Detect libjvm and apply conservative settings.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Does nothing.", + "default": false + }, + { + "key": "1", + "description": "Detect libjvm, and apply BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_STRONGMEM=1 BOX64_SSE42=0 when detected.", + "default": true + } + ] + }, + { + "name": "BOX64_LD_LIBRARY_PATH", + "description": "Path to look for x86_64 libraries.", + "category": "Libraries", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Add path XXXX to the library path.", + "default": false + } + ] + }, + { + "name": "BOX64_LD_PRELOAD", + "description": "Force loading libraries with the binary.", + "category": "Libraries", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Force the loading of library XXXX.", + "default": false + }, + { + "key": "XXXX:YYYY", + "description": "Force the loading of libraries XXXX and YYYY.", + "default": false + } + ] + }, + { + "name": "BOX64_LIBCEF", + "description": "Detect libcef and apply BOX64_MALLOC_HACK settings.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Does nothing.", + "default": true + }, + { + "key": "1", + "description": "Detect libcef, and apply BOX64_MALLOC_HACK=2 if detected.", + "default": false + } + ] + }, + { + "name": "BOX64_LIBGL", + "description": "Set the name for libGL.", + "category": "Libraries", + "wine": false, + "options": [ + { + "key": "libXXXX", + "description": "Set the name for libGL to libXXXX.", + "default": false + }, + { + "key": "/path/to/libXXXX", + "description": "Set the name and path for libGL to /path/to/libXXXX, you can also use SDL_VIDEO_GL_DRIVER.", + "default": false + } + ] + }, + { + "name": "BOX64_LOAD_ADDR", + "description": "Set the address where the program is loaded, only active for PIE guest programs.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0xXXXXXXXX", + "description": "Set the address where the program is loaded.", + "default": false + } + ] + }, + { + "name": "BOX64_LOG", + "description": "Enable or disable Box64 logs, default value is 0 if stdout is not terminal, 1 otherwise.", + "category": "Debugging", + "wine": true, + "options": [ + { + "key": "0", + "description": "Disable Box64 logs.", + "default": false + }, + { + "key": "1", + "description": "Enable minimal Box64 logs.", + "default": false + }, + { + "key": "2", + "description": "Enable debug level Box64 logs.", + "default": false + }, + { + "key": "3", + "description": "Enable verbose level Box64 logs.", + "default": false + } + ] + }, + { + "name": "BOX64_MALLOC_HACK", + "description": "Behaviour when hooking malloc operators.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Don't allow malloc operator to be redirected, rewriting code to use regular function.", + "default": true + }, + { + "key": "1", + "description": "Allow malloc operator to be redirected.", + "default": false + }, + { + "key": "2", + "description": "Like 0, but track special mmap/free (some redirected functions are inlined and cannot be redirected).", + "default": false + } + ] + }, + { + "name": "BOX64_MAXCPU", + "description": "Maximum CPU cores exposed.", + "category": "Compatibility", + "wine": true, + "options": [ + { + "key": "0", + "description": "Use the actual number of CPU cores.", + "default": true + }, + { + "key": "XXXX", + "description": "Use XXXX CPU cores.", + "default": false + } + ] + }, + { + "name": "BOX64_MMAP32", + "description": "Force 32-bit compatible memory mappings on 64-bit programs that run 32-bit code (like Wine WOW64), can improve performance.", + "category": "Performance", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not force 32-bit memory mappings.", + "default": false + }, + { + "key": "1", + "description": "Force 32-bit memory mappings.", + "default": true + } + ] + }, + { + "name": "BOX64_NOBANNER", + "description": "Disable the Box64 banner.", + "category": "Debugging", + "wine": true, + "options": [ + { + "key": "0", + "description": "Show the Box64 banner.", + "default": false + }, + { + "key": "1", + "description": "Do not show the Box64 banner.", + "default": false + } + ] + }, + { + "name": "BOX64_NODYNAREC", + "description": "Forbid dynablock creation in the address range specified, helpful for debugging behaviour difference between Dynarec and Interpreter.", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0xXXXXXXXX-0xYYYYYYYY", + "description": "Define the range where dynablock creation is forbidden (inclusive-exclusive).", + "default": false + } + ] + }, + { + "name": "BOX64_NODYNAREC_DELAY", + "description": "Remove NoDynarec range after a delay.", + "category": "Debugging", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not remove NoDynarec range.", + "default": true + }, + { + "key": "1", + "description": "Remove the NoDynarec range once 2 threads have been created.", + "default": false + } + ] + }, + { + "name": "BOX64_DYNAREC_NOARCH", + "description": "Remove Architecture metatdata from Dynarec blocks (used on signal).", + "category": "Performance", + "wine": true, + "options": [ + { + "key": "0", + "description": "Generate all architecture metadata for each blocks, including x87/mmx/SSE/AVX regs tracking. Wil use some more memory.", + "default": true + }, + { + "key": "1", + "description": "Generate only essential metadata for each blocks (flags, alignments), saving some memory, but some encrypted software might fails.", + "default": false + }, + { + "key": "2", + "description": "Do not generate metadata for blocks. Saving a bit more memory but might fails on signal handling.", + "default": false + } + ] + }, + { + "name": "BOX64_NOGTK", + "description": "Do not load wrapped GTK libraries.", + "category": "Libraries", + "wine": false, + "options": [ + { + "key": "0", + "description": "Load wrapped GTK libraries.", + "default": true + }, + { + "key": "1", + "description": "Do not load wrapped GTK libraries.", + "default": false + } + ] + }, + { + "name": "BOX64_NOPULSE", + "description": "Do not load PulseAudio libraries (both native and x86_64).", + "category": "Libraries", + "wine": false, + "options": [ + { + "key": "0", + "description": "Load PulseAudio libraries.", + "default": true + }, + { + "key": "1", + "description": "Do not load PulseAudio libraries.", + "default": false + } + ] + }, + { + "name": "BOX64_NORCFILES", + "description": "Do not load any rc files.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Load rc files.", + "default": true + }, + { + "key": "1", + "description": "Do not load any rc files.", + "default": false + } + ] + }, + { + "name": "BOX64_NOSANDBOX", + "description": "Add --no-sandbox argument to the guest program.", + "category": "Arguments", + "wine": false, + "options": [ + { + "key": "0", + "description": "Does nothing.", + "default": true + }, + { + "key": "1", + "description": "Add --no-sandbox argument to the guest program.", + "default": false + } + ] + }, + { + "name": "BOX64_NOSIGSEGV", + "description": "Disable the handling of SIGSEGV.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Let the x86 program set sighandler for SIGSEGV.", + "default": true + }, + { + "key": "1", + "description": "Disable the handling of SIGSEGV.", + "default": false + } + ] + }, + { + "name": "BOX64_NOSIGILL", + "description": "Disable the handling of SIGILL.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Let the x86 program set sighandler for SIGILL.", + "default": true + }, + { + "key": "1", + "description": "Disable the handling of SIGILL.", + "default": false + } + ] + }, + { + "name": "BOX64_NOVULKAN", + "description": "Do not load Vulkan libraries.", + "category": "Libraries", + "wine": false, + "options": [ + { + "key": "0", + "description": "Load Vulkan libraries.", + "default": true + }, + { + "key": "1", + "description": "Do not load Vulkan libraries, both native and x86_64.", + "default": false + } + ] + }, + { + "name": "BOX64_PATH", + "description": "Path to look for x86_64 binaries.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Add path XXXX to the binary path.", + "default": false + } + ] + }, + { + "name": "BOX64_PCLMULQDQ", + "description": "Expose PCLMULQDQ capabilities.", + "category": "Compatibility", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not expose PCLMULQDQ capabilities.", + "default": false + }, + { + "key": "1", + "description": "Expose PCLMULQDQ capabilities.", + "default": true + } + ] + }, + { + "name": "BOX64_PREFER_EMULATED", + "description": "Prefer emulated libraries over native ones.", + "category": "Libraries", + "wine": false, + "options": [ + { + "key": "0", + "description": "Prefer native libraries over emulated ones.", + "default": true + }, + { + "key": "1", + "description": "Prefer emulated libraries over native ones.", + "default": false + } + ] + }, + { + "name": "BOX64_PREFER_WRAPPED", + "description": "Prefer wrapped libs first even if the lib is specified with absolute path.", + "category": "Libraries", + "wine": false, + "options": [ + { + "key": "0", + "description": "Prefer libs with absolute path over wrapped ones.", + "default": true + }, + { + "key": "1", + "description": "Prefer wrapped libs first even if the lib is specified with absolute path.", + "default": false + } + ] + }, + { + "name": "BOX64_PROFILE", + "description": "Predefined sets of environment variables with compatibility or performance in mind.", + "category": "Compatibility", + "wine": true, + "options": [ + { + "key": "safest", + "description": "Profile with all the unsafe DynaRec optimizations disabled.", + "default": false + }, + { + "key": "safe", + "description": "Well, less safer than safest.", + "default": false + }, + { + "key": "default", + "description": "The default settings that most programs runs fine with a handy performance.", + "default": true + }, + { + "key": "fast", + "description": "Enable many unsafe optimizations, but also enable strongmem emulation.", + "default": false + }, + { + "key": "fastest", + "description": "Enable many unsafe optimizations to have a better performance.", + "default": false + } + ] + }, + { + "name": "BOX64_PYTHON3", + "description": "Path to a python3 executable.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Use python3 executable at path XXXX.", + "default": false + } + ] + }, + { + "name": "BOX64_RCFILE", + "description": "Path to the rc file to load.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Load the rc file XXXX, default rc files will not be loaded.", + "default": false + } + ] + }, + { + "name": "BOX64_RDTSC_1GHZ", + "description": "Use hardware counter for rdtsc if available.", + "category": "Performance", + "wine": false, + "options": [ + { + "key": "0", + "description": "Use hardware counter for rdtsc opcode if available.", + "default": true + }, + { + "key": "1", + "description": "Use hardware counter for rdtsc if and only if precision is at least 1GHz.", + "default": false + } + ] + }, + { + "name": "BOX64_RESERVE_HIGH", + "description": "Reserve high memory area for the program, always enabled on Box32.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not reserve high memory area for the program.", + "default": true + }, + { + "key": "1", + "description": "Reserve high memory area for the program.", + "default": false + } + ] + }, + { + "name": "BOX64_ROLLING_LOG", + "description": "Show last few wrapped function call when a signal is caught.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Does nothing.", + "default": true + }, + { + "key": "1", + "description": "Show last 16 wrapped function call when a signal is caught.", + "default": false + }, + { + "key": "XXXX", + "description": "Show last XXXX wrapped function call when a signal is caught.", + "default": false + } + ] + }, + { + "name": "BOX64_SDL2_JGUID", + "description": "Use a workaround for SDL_GetJoystickGUIDInfo function for wrapped SDL2.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Does nothing.", + "default": true + }, + { + "key": "1", + "description": "Use a workaround for SDL_GetJoystickGUIDInfo function for wrapped SDL2.", + "default": false + } + ] + }, + { + "name": "BOX64_SHAEXT", + "description": "Expose SHAEXT (a.k.a. SHA_NI) capabilities.", + "category": "Compatibility", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not expose SHAEXT capabilities.", + "default": false + }, + { + "key": "1", + "description": "Expose SHAEXT capabilities.", + "default": true + } + ] + }, + { + "name": "BOX64_SHOWBT", + "description": "Show native and emulated backtrace when a signal is caught.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Does nothing.", + "default": true + }, + { + "key": "1", + "description": "Show native and emulated backtrace when a signal is caught.", + "default": false + } + ] + }, + { + "name": "BOX64_SHOWSEGV", + "description": "Always show SIGSEGV signal detailes.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Does nothing.", + "default": true + }, + { + "key": "1", + "description": "Always show SIGSEGV signal detailes.", + "default": false + } + ] + }, + { + "name": "BOX64_SSE_FLUSHTO0", + "description": "Behaviour of SSE Flush to 0 flags. Also tracking SSE exception flags.", + "category": "Compatibility", + "wine": true, + "options": [ + { + "key": "0", + "description": "Just track the flag.", + "default": true + }, + { + "key": "1", + "description": "Apply SSE Flush to 0 flag directly. Also reflect SSE exception flags in Dynarec (if available)", + "default": false + } + ] + }, + { + "name": "BOX64_SSE42", + "description": "Expose SSE4.2 capabilities.", + "category": "Compatibility", + "wine": true, + "options": [ + { + "key": "0", + "description": "Do not expose SSE4.2 capabilities.", + "default": false + }, + { + "key": "1", + "description": "Expose SSE4.2 capabilities.", + "default": true + } + ] + }, + { + "name": "BOX64_STEAM_VULKAN", + "description": "Force Vulkan for Linux Steam UI.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do nothing.", + "default": true + }, + { + "key": "1", + "description": "Force Vulkan for Linux Steam UI.", + "default": false + } + ] + }, + { + "name": "BOX64_SYNC_ROUNDING", + "description": "Synchronize rounding mode between x86 and native.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not synchronize rounding mode.", + "default": true + }, + { + "key": "1", + "description": "Synchronize rounding mode between x86 and native.", + "default": false + } + ] + }, + { + "name": "BOX64_TRACE_COLOR", + "description": "Enable or disable colored trace output.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Disable colored trace output.", + "default": true + }, + { + "key": "1", + "description": "Enable colored trace output.", + "default": false + } + ] + }, + { + "name": "BOX64_TRACE_EMM", + "description": "Enable or disable EMM (i.e. MMX) trace output.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Disable EMM trace output.", + "default": true + }, + { + "key": "1", + "description": "Enable EMM trace output.", + "default": false + } + ] + }, + { + "name": "BOX64_TRACE_FILE", + "description": "Send all log and trace to a file instead of `stdout`.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "XXXX", + "description": "Send all log and trace to file XXXX.", + "default": false + }, + { + "key": "XXXX%pid", + "description": "Send all log and trace to file XXXX with pid appended.", + "default": false + }, + { + "key": "stderr", + "description": "Send all log and trace to `stderr`.", + "default": true + }, + { + "key": "stdout", + "description": "Send all log and trace to `stdout`.", + "default": false + } + ] + }, + { + "name": "BOX64_TRACE_INIT", + "description": "Same as BOX64_TRACE but starts the trace immediately.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Disable trace output.", + "default": true + }, + { + "key": "1", + "description": "Enable trace output. Trace starts before the initialization of dependencies.", + "default": false + }, + { + "key": "symbolname", + "description": "Enable trace output for `symbolname` only. Trace starts before the initialization of dependencies.", + "default": false + }, + { + "key": "0xXXXXXXX-0xYYYYYYY", + "description": "Enable trace output for the range of address (inclusive-exclusive). Trace starts before the initialization of dependencies.", + "default": false + } + ] + }, + { + "name": "BOX64_TRACE_START", + "description": "Start trace after N opcodes executed.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Start trace immediately.", + "default": true + }, + { + "key": "1", + "description": "Start trace after 1 opcode executed.", + "default": false + }, + { + "key": "XXXX", + "description": "Start trace after XXXX opcodes executed.", + "default": false + } + ] + }, + { + "name": "BOX64_TRACE_XMM", + "description": "Enable or disable XMM (i.e. SSE) trace output.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Disable XMM trace output.", + "default": true + }, + { + "key": "1", + "description": "Enable XMM trace output.", + "default": false + } + ] + }, + { + "name": "BOX64_TRACE", + "description": "Only available on box64 build with trace. Adds trace of all instructions executed, along with a register dump.", + "category": "Debugging", + "wine": false, + "options": [ + { + "key": "0", + "description": "Disable trace output.", + "default": true + }, + { + "key": "1", + "description": "Enable trace output.", + "default": false + }, + { + "key": "symbolname", + "description": "Enable trace output for `symbolname` only.", + "default": false + }, + { + "key": "0xXXXXXXX-0xYYYYYYY", + "description": "Enable trace output for the range of address (inclusive-exclusive).", + "default": false + } + ] + }, + { + "name": "BOX64_UNITYPLAYER", + "description": "Detect UnityPlayer and apply conservative settings.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Does nothing.", + "default": false + }, + { + "key": "1", + "description": "Detect UnityPlayer (Windows or Linux), and apply BOX64_UNITY=1 when detected.", + "default": true + } + ] + }, + { + "name": "BOX64_UNITY", + "description": "Games is a Unity one.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Does nothing.", + "default": false + }, + { + "key": "1", + "description": "Unity Game, use special detecting code for Windows, apply BOX64_DYNAREC_STRONGMEM=1 for Linux.", + "default": true + } + ] + }, + { + "name": "BOX64_WRAP_EGL", + "description": "Prefer wrapped libs for EGL and GLESv2.", + "category": "Libraries", + "wine": false, + "options": [ + { + "key": "0", + "description": "Prefer emulated libs for EGL and GLESv2.", + "default": true + }, + { + "key": "1", + "description": "Prefer wrapped libs for EGL and GLESv2.", + "default": false + } + ] + }, + { + "name": "BOX64_X11GLX", + "description": "Force Xorg GLX extension to be present.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not force Xorg GLX extension to be present.", + "default": true + }, + { + "key": "1", + "description": "Require Xorg GLX extension when using XQueryExtension.", + "default": false + } + ] + }, + { + "name": "BOX64_X11SYNC", + "description": "Force synchronized operation on X11 display.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not force synchronized operation on X11 display.", + "default": true + }, + { + "key": "1", + "description": "Force synchronized operation on X11 display.", + "default": false + } + ] + }, + { + "name": "BOX64_X11THREADS", + "description": "Call XInitThreads when loading X11. This is mostly for old Loki games with the Loki_Compat library.", + "category": "Compatibility", + "wine": false, + "options": [ + { + "key": "0", + "description": "Do not call XInitThreads.", + "default": true + }, + { + "key": "1", + "description": "Call XInitThreads as soon as libX11 is loaded.", + "default": false + } + ] + }, + { + "name": "BOX64_X87_NO80BITS", + "description": "Behavoiur of x87 80bits long double.", + "category": "Compatibility", + "wine": true, + "options": [ + { + "key": "0", + "description": "Try to handle 80bits long double as precise as possible.", + "default": true + }, + { + "key": "1", + "description": "Use 64bits double for x87.", + "default": false + } + ] + } +] diff --git a/external/musl/__cos.c b/external/musl/__cos.c new file mode 100644 index 0000000..46cefb3 --- /dev/null +++ b/external/musl/__cos.c @@ -0,0 +1,71 @@ +/* origin: FreeBSD /usr/src/lib/msun/src/k_cos.c */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ +/* + * __cos( x, y ) + * kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164 + * Input x is assumed to be bounded by ~pi/4 in magnitude. + * Input y is the tail of x. + * + * Algorithm + * 1. Since cos(-x) = cos(x), we need only to consider positive x. + * 2. if x < 2^-27 (hx<0x3e400000 0), return 1 with inexact if x!=0. + * 3. cos(x) is approximated by a polynomial of degree 14 on + * [0,pi/4] + * 4 14 + * cos(x) ~ 1 - x*x/2 + C1*x + ... + C6*x + * where the remez error is + * + * | 2 4 6 8 10 12 14 | -58 + * |cos(x)-(1-.5*x +C1*x +C2*x +C3*x +C4*x +C5*x +C6*x )| <= 2 + * | | + * + * 4 6 8 10 12 14 + * 4. let r = C1*x +C2*x +C3*x +C4*x +C5*x +C6*x , then + * cos(x) ~ 1 - x*x/2 + r + * since cos(x+y) ~ cos(x) - sin(x)*y + * ~ cos(x) - x*y, + * a correction term is necessary in cos(x) and hence + * cos(x+y) = 1 - (x*x/2 - (r - x*y)) + * For better accuracy, rearrange to + * cos(x+y) ~ w + (tmp + (r-x*y)) + * where w = 1 - x*x/2 and tmp is a tiny correction term + * (1 - x*x/2 == w + tmp exactly in infinite precision). + * The exactness of w + tmp in infinite precision depends on w + * and tmp having the same precision as x. If they have extra + * precision due to compiler bugs, then the extra precision is + * only good provided it is retained in all terms of the final + * expression for cos(). Retention happens in all cases tested + * under FreeBSD, so don't pessimize things by forcibly clipping + * any extra precision in w. + */ + +#include "libm.h" + +static const double +C1 = 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */ +C2 = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */ +C3 = 2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */ +C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */ +C5 = 2.08757232129817482790e-09, /* 0x3E21EE9E, 0xBDB4B1C4 */ +C6 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */ + +double __cos(double x, double y) +{ + double_t hz,z,r,w; + + z = x*x; + w = z*z; + r = z*(C1+z*(C2+z*C3)) + w*w*(C4+z*(C5+z*C6)); + hz = 0.5*z; + w = 1.0-hz; + return w + (((1.0-w)-hz) + (z*r-x*y)); +} diff --git a/external/musl/__math_divzero.c b/external/musl/__math_divzero.c new file mode 100644 index 0000000..59d2135 --- /dev/null +++ b/external/musl/__math_divzero.c @@ -0,0 +1,6 @@ +#include "libm.h" + +double __math_divzero(uint32_t sign) +{ + return fp_barrier(sign ? -1.0 : 1.0) / 0.0; +} diff --git a/external/musl/__math_invalid.c b/external/musl/__math_invalid.c new file mode 100644 index 0000000..1774049 --- /dev/null +++ b/external/musl/__math_invalid.c @@ -0,0 +1,6 @@ +#include "libm.h" + +double __math_invalid(double x) +{ + return (x - x) / (x - x); +} diff --git a/external/musl/__rem_pio2.c b/external/musl/__rem_pio2.c new file mode 100644 index 0000000..3addef6 --- /dev/null +++ b/external/musl/__rem_pio2.c @@ -0,0 +1,190 @@ +/* origin: FreeBSD /usr/src/lib/msun/src/e_rem_pio2.c */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + * Optimized by Bruce D. Evans. + */ +/* __rem_pio2(x,y) + * + * return the remainder of x rem pi/2 in y[0]+y[1] + * use __rem_pio2_large() for large x + */ + +#include "libm.h" + +#if FLT_EVAL_METHOD==0 || FLT_EVAL_METHOD==1 +#define EPS DBL_EPSILON +#elif FLT_EVAL_METHOD==2 +#define EPS LDBL_EPSILON +#endif + +/* + * invpio2: 53 bits of 2/pi + * pio2_1: first 33 bit of pi/2 + * pio2_1t: pi/2 - pio2_1 + * pio2_2: second 33 bit of pi/2 + * pio2_2t: pi/2 - (pio2_1+pio2_2) + * pio2_3: third 33 bit of pi/2 + * pio2_3t: pi/2 - (pio2_1+pio2_2+pio2_3) + */ +static const double +toint = 1.5/EPS, +pio4 = 0x1.921fb54442d18p-1, +invpio2 = 6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */ +pio2_1 = 1.57079632673412561417e+00, /* 0x3FF921FB, 0x54400000 */ +pio2_1t = 6.07710050650619224932e-11, /* 0x3DD0B461, 0x1A626331 */ +pio2_2 = 6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */ +pio2_2t = 2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */ +pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */ +pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ + +/* caller must handle the case when reduction is not needed: |x| ~<= pi/4 */ +int __rem_pio2(double x, double *y) +{ + union {double f; uint64_t i;} u = {x}; + double_t z,w,t,r,fn; + double tx[3],ty[2]; + uint32_t ix; + int sign, n, ex, ey, i; + + sign = u.i>>63; + ix = u.i>>32 & 0x7fffffff; + if (ix <= 0x400f6a7a) { /* |x| ~<= 5pi/4 */ + if ((ix & 0xfffff) == 0x921fb) /* |x| ~= pi/2 or 2pi/2 */ + goto medium; /* cancellation -- use medium case */ + if (ix <= 0x4002d97c) { /* |x| ~<= 3pi/4 */ + if (!sign) { + z = x - pio2_1; /* one round good to 85 bits */ + y[0] = z - pio2_1t; + y[1] = (z-y[0]) - pio2_1t; + return 1; + } else { + z = x + pio2_1; + y[0] = z + pio2_1t; + y[1] = (z-y[0]) + pio2_1t; + return -1; + } + } else { + if (!sign) { + z = x - 2*pio2_1; + y[0] = z - 2*pio2_1t; + y[1] = (z-y[0]) - 2*pio2_1t; + return 2; + } else { + z = x + 2*pio2_1; + y[0] = z + 2*pio2_1t; + y[1] = (z-y[0]) + 2*pio2_1t; + return -2; + } + } + } + if (ix <= 0x401c463b) { /* |x| ~<= 9pi/4 */ + if (ix <= 0x4015fdbc) { /* |x| ~<= 7pi/4 */ + if (ix == 0x4012d97c) /* |x| ~= 3pi/2 */ + goto medium; + if (!sign) { + z = x - 3*pio2_1; + y[0] = z - 3*pio2_1t; + y[1] = (z-y[0]) - 3*pio2_1t; + return 3; + } else { + z = x + 3*pio2_1; + y[0] = z + 3*pio2_1t; + y[1] = (z-y[0]) + 3*pio2_1t; + return -3; + } + } else { + if (ix == 0x401921fb) /* |x| ~= 4pi/2 */ + goto medium; + if (!sign) { + z = x - 4*pio2_1; + y[0] = z - 4*pio2_1t; + y[1] = (z-y[0]) - 4*pio2_1t; + return 4; + } else { + z = x + 4*pio2_1; + y[0] = z + 4*pio2_1t; + y[1] = (z-y[0]) + 4*pio2_1t; + return -4; + } + } + } + if (ix < 0x413921fb) { /* |x| ~< 2^20*(pi/2), medium size */ +medium: + /* rint(x/(pi/2)) */ + fn = rint(x * invpio2); + n = (int32_t)fn; + r = x - fn*pio2_1; + w = fn*pio2_1t; /* 1st round, good to 85 bits */ + /* Matters with directed rounding. */ + if (predict_false(r - w < -pio4)) { + n--; + fn--; + r = x - fn*pio2_1; + w = fn*pio2_1t; + } else if (predict_false(r - w > pio4)) { + n++; + fn++; + r = x - fn*pio2_1; + w = fn*pio2_1t; + } + y[0] = r - w; + u.f = y[0]; + ey = u.i>>52 & 0x7ff; + ex = ix>>20; + if (ex - ey > 16) { /* 2nd round, good to 118 bits */ + t = r; + w = fn*pio2_2; + r = t - w; + w = fn*pio2_2t - ((t-r)-w); + y[0] = r - w; + u.f = y[0]; + ey = u.i>>52 & 0x7ff; + if (ex - ey > 49) { /* 3rd round, good to 151 bits, covers all cases */ + t = r; + w = fn*pio2_3; + r = t - w; + w = fn*pio2_3t - ((t-r)-w); + y[0] = r - w; + } + } + y[1] = (r - y[0]) - w; + return n; + } + /* + * all other (large) arguments + */ + if (ix >= 0x7ff00000) { /* x is inf or NaN */ + y[0] = y[1] = x - x; + return 0; + } + /* set z = scalbn(|x|,-ilogb(x)+23) */ + u.f = x; + u.i &= (uint64_t)-1>>12; + u.i |= (uint64_t)(0x3ff + 23)<<52; + z = u.f; + for (i=0; i < 2; i++) { + tx[i] = (double)(int32_t)z; + z = (z-tx[i])*0x1p24; + } + tx[i] = z; + /* skip zero terms, first term is non-zero */ + while (tx[i] == 0.0) + i--; + n = __rem_pio2_large(tx,ty,(int)(ix>>20)-(0x3ff+23),i+1,1); + if (sign) { + y[0] = -ty[0]; + y[1] = -ty[1]; + return -n; + } + y[0] = ty[0]; + y[1] = ty[1]; + return n; +} diff --git a/external/musl/__rem_pio2_large.c b/external/musl/__rem_pio2_large.c new file mode 100644 index 0000000..958f28c --- /dev/null +++ b/external/musl/__rem_pio2_large.c @@ -0,0 +1,442 @@ +/* origin: FreeBSD /usr/src/lib/msun/src/k_rem_pio2.c */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ +/* + * __rem_pio2_large(x,y,e0,nx,prec) + * double x[],y[]; int e0,nx,prec; + * + * __rem_pio2_large return the last three digits of N with + * y = x - N*pi/2 + * so that |y| < pi/2. + * + * The method is to compute the integer (mod 8) and fraction parts of + * (2/pi)*x without doing the full multiplication. In general we + * skip the part of the product that are known to be a huge integer ( + * more accurately, = 0 mod 8 ). Thus the number of operations are + * independent of the exponent of the input. + * + * (2/pi) is represented by an array of 24-bit integers in ipio2[]. + * + * Input parameters: + * x[] The input value (must be positive) is broken into nx + * pieces of 24-bit integers in double precision format. + * x[i] will be the i-th 24 bit of x. The scaled exponent + * of x[0] is given in input parameter e0 (i.e., x[0]*2^e0 + * match x's up to 24 bits. + * + * Example of breaking a double positive z into x[0]+x[1]+x[2]: + * e0 = ilogb(z)-23 + * z = scalbn(z,-e0) + * for i = 0,1,2 + * x[i] = floor(z) + * z = (z-x[i])*2**24 + * + * + * y[] ouput result in an array of double precision numbers. + * The dimension of y[] is: + * 24-bit precision 1 + * 53-bit precision 2 + * 64-bit precision 2 + * 113-bit precision 3 + * The actual value is the sum of them. Thus for 113-bit + * precison, one may have to do something like: + * + * long double t,w,r_head, r_tail; + * t = (long double)y[2] + (long double)y[1]; + * w = (long double)y[0]; + * r_head = t+w; + * r_tail = w - (r_head - t); + * + * e0 The exponent of x[0]. Must be <= 16360 or you need to + * expand the ipio2 table. + * + * nx dimension of x[] + * + * prec an integer indicating the precision: + * 0 24 bits (single) + * 1 53 bits (double) + * 2 64 bits (extended) + * 3 113 bits (quad) + * + * External function: + * double scalbn(), floor(); + * + * + * Here is the description of some local variables: + * + * jk jk+1 is the initial number of terms of ipio2[] needed + * in the computation. The minimum and recommended value + * for jk is 3,4,4,6 for single, double, extended, and quad. + * jk+1 must be 2 larger than you might expect so that our + * recomputation test works. (Up to 24 bits in the integer + * part (the 24 bits of it that we compute) and 23 bits in + * the fraction part may be lost to cancelation before we + * recompute.) + * + * jz local integer variable indicating the number of + * terms of ipio2[] used. + * + * jx nx - 1 + * + * jv index for pointing to the suitable ipio2[] for the + * computation. In general, we want + * ( 2^e0*x[0] * ipio2[jv-1]*2^(-24jv) )/8 + * is an integer. Thus + * e0-3-24*jv >= 0 or (e0-3)/24 >= jv + * Hence jv = max(0,(e0-3)/24). + * + * jp jp+1 is the number of terms in PIo2[] needed, jp = jk. + * + * q[] double array with integral value, representing the + * 24-bits chunk of the product of x and 2/pi. + * + * q0 the corresponding exponent of q[0]. Note that the + * exponent for q[i] would be q0-24*i. + * + * PIo2[] double precision array, obtained by cutting pi/2 + * into 24 bits chunks. + * + * f[] ipio2[] in floating point + * + * iq[] integer array by breaking up q[] in 24-bits chunk. + * + * fq[] final product of x*(2/pi) in fq[0],..,fq[jk] + * + * ih integer. If >0 it indicates q[] is >= 0.5, hence + * it also indicates the *sign* of the result. + * + */ +/* + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "libm.h" + +static const int init_jk[] = {3,4,4,6}; /* initial value for jk */ + +/* + * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi + * + * integer array, contains the (24*i)-th to (24*i+23)-th + * bit of 2/pi after binary point. The corresponding + * floating value is + * + * ipio2[i] * 2^(-24(i+1)). + * + * NB: This table must have at least (e0-3)/24 + jk terms. + * For quad precision (e0 <= 16360, jk = 6), this is 686. + */ +static const int32_t ipio2[] = { +0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62, +0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A, +0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129, +0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41, +0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8, +0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF, +0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5, +0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08, +0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3, +0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880, +0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B, + +#if LDBL_MAX_EXP > 1024 +0x47C419, 0xC367CD, 0xDCE809, 0x2A8359, 0xC4768B, 0x961CA6, +0xDDAF44, 0xD15719, 0x053EA5, 0xFF0705, 0x3F7E33, 0xE832C2, +0xDE4F98, 0x327DBB, 0xC33D26, 0xEF6B1E, 0x5EF89F, 0x3A1F35, +0xCAF27F, 0x1D87F1, 0x21907C, 0x7C246A, 0xFA6ED5, 0x772D30, +0x433B15, 0xC614B5, 0x9D19C3, 0xC2C4AD, 0x414D2C, 0x5D000C, +0x467D86, 0x2D71E3, 0x9AC69B, 0x006233, 0x7CD2B4, 0x97A7B4, +0xD55537, 0xF63ED7, 0x1810A3, 0xFC764D, 0x2A9D64, 0xABD770, +0xF87C63, 0x57B07A, 0xE71517, 0x5649C0, 0xD9D63B, 0x3884A7, +0xCB2324, 0x778AD6, 0x23545A, 0xB91F00, 0x1B0AF1, 0xDFCE19, +0xFF319F, 0x6A1E66, 0x615799, 0x47FBAC, 0xD87F7E, 0xB76522, +0x89E832, 0x60BFE6, 0xCDC4EF, 0x09366C, 0xD43F5D, 0xD7DE16, +0xDE3B58, 0x929BDE, 0x2822D2, 0xE88628, 0x4D58E2, 0x32CAC6, +0x16E308, 0xCB7DE0, 0x50C017, 0xA71DF3, 0x5BE018, 0x34132E, +0x621283, 0x014883, 0x5B8EF5, 0x7FB0AD, 0xF2E91E, 0x434A48, +0xD36710, 0xD8DDAA, 0x425FAE, 0xCE616A, 0xA4280A, 0xB499D3, +0xF2A606, 0x7F775C, 0x83C2A3, 0x883C61, 0x78738A, 0x5A8CAF, +0xBDD76F, 0x63A62D, 0xCBBFF4, 0xEF818D, 0x67C126, 0x45CA55, +0x36D9CA, 0xD2A828, 0x8D61C2, 0x77C912, 0x142604, 0x9B4612, +0xC459C4, 0x44C5C8, 0x91B24D, 0xF31700, 0xAD43D4, 0xE54929, +0x10D5FD, 0xFCBE00, 0xCC941E, 0xEECE70, 0xF53E13, 0x80F1EC, +0xC3E7B3, 0x28F8C7, 0x940593, 0x3E71C1, 0xB3092E, 0xF3450B, +0x9C1288, 0x7B20AB, 0x9FB52E, 0xC29247, 0x2F327B, 0x6D550C, +0x90A772, 0x1FE76B, 0x96CB31, 0x4A1679, 0xE27941, 0x89DFF4, +0x9794E8, 0x84E6E2, 0x973199, 0x6BED88, 0x365F5F, 0x0EFDBB, +0xB49A48, 0x6CA467, 0x427271, 0x325D8D, 0xB8159F, 0x09E5BC, +0x25318D, 0x3974F7, 0x1C0530, 0x010C0D, 0x68084B, 0x58EE2C, +0x90AA47, 0x02E774, 0x24D6BD, 0xA67DF7, 0x72486E, 0xEF169F, +0xA6948E, 0xF691B4, 0x5153D1, 0xF20ACF, 0x339820, 0x7E4BF5, +0x6863B2, 0x5F3EDD, 0x035D40, 0x7F8985, 0x295255, 0xC06437, +0x10D86D, 0x324832, 0x754C5B, 0xD4714E, 0x6E5445, 0xC1090B, +0x69F52A, 0xD56614, 0x9D0727, 0x50045D, 0xDB3BB4, 0xC576EA, +0x17F987, 0x7D6B49, 0xBA271D, 0x296996, 0xACCCC6, 0x5414AD, +0x6AE290, 0x89D988, 0x50722C, 0xBEA404, 0x940777, 0x7030F3, +0x27FC00, 0xA871EA, 0x49C266, 0x3DE064, 0x83DD97, 0x973FA3, +0xFD9443, 0x8C860D, 0xDE4131, 0x9D3992, 0x8C70DD, 0xE7B717, +0x3BDF08, 0x2B3715, 0xA0805C, 0x93805A, 0x921110, 0xD8E80F, +0xAF806C, 0x4BFFDB, 0x0F9038, 0x761859, 0x15A562, 0xBBCB61, +0xB989C7, 0xBD4010, 0x04F2D2, 0x277549, 0xF6B6EB, 0xBB22DB, +0xAA140A, 0x2F2689, 0x768364, 0x333B09, 0x1A940E, 0xAA3A51, +0xC2A31D, 0xAEEDAF, 0x12265C, 0x4DC26D, 0x9C7A2D, 0x9756C0, +0x833F03, 0xF6F009, 0x8C402B, 0x99316D, 0x07B439, 0x15200C, +0x5BC3D8, 0xC492F5, 0x4BADC6, 0xA5CA4E, 0xCD37A7, 0x36A9E6, +0x9492AB, 0x6842DD, 0xDE6319, 0xEF8C76, 0x528B68, 0x37DBFC, +0xABA1AE, 0x3115DF, 0xA1AE00, 0xDAFB0C, 0x664D64, 0xB705ED, +0x306529, 0xBF5657, 0x3AFF47, 0xB9F96A, 0xF3BE75, 0xDF9328, +0x3080AB, 0xF68C66, 0x15CB04, 0x0622FA, 0x1DE4D9, 0xA4B33D, +0x8F1B57, 0x09CD36, 0xE9424E, 0xA4BE13, 0xB52333, 0x1AAAF0, +0xA8654F, 0xA5C1D2, 0x0F3F0B, 0xCD785B, 0x76F923, 0x048B7B, +0x721789, 0x53A6C6, 0xE26E6F, 0x00EBEF, 0x584A9B, 0xB7DAC4, +0xBA66AA, 0xCFCF76, 0x1D02D1, 0x2DF1B1, 0xC1998C, 0x77ADC3, +0xDA4886, 0xA05DF7, 0xF480C6, 0x2FF0AC, 0x9AECDD, 0xBC5C3F, +0x6DDED0, 0x1FC790, 0xB6DB2A, 0x3A25A3, 0x9AAF00, 0x9353AD, +0x0457B6, 0xB42D29, 0x7E804B, 0xA707DA, 0x0EAA76, 0xA1597B, +0x2A1216, 0x2DB7DC, 0xFDE5FA, 0xFEDB89, 0xFDBE89, 0x6C76E4, +0xFCA906, 0x70803E, 0x156E85, 0xFF87FD, 0x073E28, 0x336761, +0x86182A, 0xEABD4D, 0xAFE7B3, 0x6E6D8F, 0x396795, 0x5BBF31, +0x48D784, 0x16DF30, 0x432DC7, 0x356125, 0xCE70C9, 0xB8CB30, +0xFD6CBF, 0xA200A4, 0xE46C05, 0xA0DD5A, 0x476F21, 0xD21262, +0x845CB9, 0x496170, 0xE0566B, 0x015299, 0x375550, 0xB7D51E, +0xC4F133, 0x5F6E13, 0xE4305D, 0xA92E85, 0xC3B21D, 0x3632A1, +0xA4B708, 0xD4B1EA, 0x21F716, 0xE4698F, 0x77FF27, 0x80030C, +0x2D408D, 0xA0CD4F, 0x99A520, 0xD3A2B3, 0x0A5D2F, 0x42F9B4, +0xCBDA11, 0xD0BE7D, 0xC1DB9B, 0xBD17AB, 0x81A2CA, 0x5C6A08, +0x17552E, 0x550027, 0xF0147F, 0x8607E1, 0x640B14, 0x8D4196, +0xDEBE87, 0x2AFDDA, 0xB6256B, 0x34897B, 0xFEF305, 0x9EBFB9, +0x4F6A68, 0xA82A4A, 0x5AC44F, 0xBCF82D, 0x985AD7, 0x95C7F4, +0x8D4D0D, 0xA63A20, 0x5F57A4, 0xB13F14, 0x953880, 0x0120CC, +0x86DD71, 0xB6DEC9, 0xF560BF, 0x11654D, 0x6B0701, 0xACB08C, +0xD0C0B2, 0x485551, 0x0EFB1E, 0xC37295, 0x3B06A3, 0x3540C0, +0x7BDC06, 0xCC45E0, 0xFA294E, 0xC8CAD6, 0x41F3E8, 0xDE647C, +0xD8649B, 0x31BED9, 0xC397A4, 0xD45877, 0xC5E369, 0x13DAF0, +0x3C3ABA, 0x461846, 0x5F7555, 0xF5BDD2, 0xC6926E, 0x5D2EAC, +0xED440E, 0x423E1C, 0x87C461, 0xE9FD29, 0xF3D6E7, 0xCA7C22, +0x35916F, 0xC5E008, 0x8DD7FF, 0xE26A6E, 0xC6FDB0, 0xC10893, +0x745D7C, 0xB2AD6B, 0x9D6ECD, 0x7B723E, 0x6A11C6, 0xA9CFF7, +0xDF7329, 0xBAC9B5, 0x5100B7, 0x0DB2E2, 0x24BA74, 0x607DE5, +0x8AD874, 0x2C150D, 0x0C1881, 0x94667E, 0x162901, 0x767A9F, +0xBEFDFD, 0xEF4556, 0x367ED9, 0x13D9EC, 0xB9BA8B, 0xFC97C4, +0x27A831, 0xC36EF1, 0x36C594, 0x56A8D8, 0xB5A8B4, 0x0ECCCF, +0x2D8912, 0x34576F, 0x89562C, 0xE3CE99, 0xB920D6, 0xAA5E6B, +0x9C2A3E, 0xCC5F11, 0x4A0BFD, 0xFBF4E1, 0x6D3B8E, 0x2C86E2, +0x84D4E9, 0xA9B4FC, 0xD1EEEF, 0xC9352E, 0x61392F, 0x442138, +0xC8D91B, 0x0AFC81, 0x6A4AFB, 0xD81C2F, 0x84B453, 0x8C994E, +0xCC2254, 0xDC552A, 0xD6C6C0, 0x96190B, 0xB8701A, 0x649569, +0x605A26, 0xEE523F, 0x0F117F, 0x11B5F4, 0xF5CBFC, 0x2DBC34, +0xEEBC34, 0xCC5DE8, 0x605EDD, 0x9B8E67, 0xEF3392, 0xB817C9, +0x9B5861, 0xBC57E1, 0xC68351, 0x103ED8, 0x4871DD, 0xDD1C2D, +0xA118AF, 0x462C21, 0xD7F359, 0x987AD9, 0xC0549E, 0xFA864F, +0xFC0656, 0xAE79E5, 0x362289, 0x22AD38, 0xDC9367, 0xAAE855, +0x382682, 0x9BE7CA, 0xA40D51, 0xB13399, 0x0ED7A9, 0x480569, +0xF0B265, 0xA7887F, 0x974C88, 0x36D1F9, 0xB39221, 0x4A827B, +0x21CF98, 0xDC9F40, 0x5547DC, 0x3A74E1, 0x42EB67, 0xDF9DFE, +0x5FD45E, 0xA4677B, 0x7AACBA, 0xA2F655, 0x23882B, 0x55BA41, +0x086E59, 0x862A21, 0x834739, 0xE6E389, 0xD49EE5, 0x40FB49, +0xE956FF, 0xCA0F1C, 0x8A59C5, 0x2BFA94, 0xC5C1D3, 0xCFC50F, +0xAE5ADB, 0x86C547, 0x624385, 0x3B8621, 0x94792C, 0x876110, +0x7B4C2A, 0x1A2C80, 0x12BF43, 0x902688, 0x893C78, 0xE4C4A8, +0x7BDBE5, 0xC23AC4, 0xEAF426, 0x8A67F7, 0xBF920D, 0x2BA365, +0xB1933D, 0x0B7CBD, 0xDC51A4, 0x63DD27, 0xDDE169, 0x19949A, +0x9529A8, 0x28CE68, 0xB4ED09, 0x209F44, 0xCA984E, 0x638270, +0x237C7E, 0x32B90F, 0x8EF5A7, 0xE75614, 0x08F121, 0x2A9DB5, +0x4D7E6F, 0x5119A5, 0xABF9B5, 0xD6DF82, 0x61DD96, 0x023616, +0x9F3AC4, 0xA1A283, 0x6DED72, 0x7A8D39, 0xA9B882, 0x5C326B, +0x5B2746, 0xED3400, 0x7700D2, 0x55F4FC, 0x4D5901, 0x8071E0, +#endif +}; + +static const double PIo2[] = { + 1.57079625129699707031e+00, /* 0x3FF921FB, 0x40000000 */ + 7.54978941586159635335e-08, /* 0x3E74442D, 0x00000000 */ + 5.39030252995776476554e-15, /* 0x3CF84698, 0x80000000 */ + 3.28200341580791294123e-22, /* 0x3B78CC51, 0x60000000 */ + 1.27065575308067607349e-29, /* 0x39F01B83, 0x80000000 */ + 1.22933308981111328932e-36, /* 0x387A2520, 0x40000000 */ + 2.73370053816464559624e-44, /* 0x36E38222, 0x80000000 */ + 2.16741683877804819444e-51, /* 0x3569F31D, 0x00000000 */ +}; + +int __rem_pio2_large(double *x, double *y, int e0, int nx, int prec) +{ + int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih; + double z,fw,f[20],fq[20],q[20]; + + /* initialize jk*/ + jk = init_jk[prec]; + jp = jk; + + /* determine jx,jv,q0, note that 3>q0 */ + jx = nx-1; + jv = (e0-3)/24; if(jv<0) jv=0; + q0 = e0-24*(jv+1); + + /* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */ + j = jv-jx; m = jx+jk; + for (i=0; i<=m; i++,j++) + f[i] = j<0 ? 0.0 : (double)ipio2[j]; + + /* compute q[0],q[1],...q[jk] */ + for (i=0; i<=jk; i++) { + for (j=0,fw=0.0; j<=jx; j++) + fw += x[j]*f[jx+i-j]; + q[i] = fw; + } + + jz = jk; +recompute: + /* distill q[] into iq[] reversingly */ + for (i=0,j=jz,z=q[jz]; j>0; i++,j--) { + fw = (double)(int32_t)(0x1p-24*z); + iq[i] = (int32_t)(z - 0x1p24*fw); + z = q[j-1]+fw; + } + + /* compute n */ + z = scalbn(z,q0); /* actual value of z */ + z -= 8.0*floor(z*0.125); /* trim off integer >= 8 */ + n = (int32_t)z; + z -= (double)n; + ih = 0; + if (q0 > 0) { /* need iq[jz-1] to determine n */ + i = iq[jz-1]>>(24-q0); n += i; + iq[jz-1] -= i<<(24-q0); + ih = iq[jz-1]>>(23-q0); + } + else if (q0 == 0) ih = iq[jz-1]>>23; + else if (z >= 0.5) ih = 2; + + if (ih > 0) { /* q > 0.5 */ + n += 1; carry = 0; + for (i=0; i 0) { /* rare case: chance is 1 in 12 */ + switch(q0) { + case 1: + iq[jz-1] &= 0x7fffff; break; + case 2: + iq[jz-1] &= 0x3fffff; break; + } + } + if (ih == 2) { + z = 1.0 - z; + if (carry != 0) + z -= scalbn(1.0,q0); + } + } + + /* check if recomputation is needed */ + if (z == 0.0) { + j = 0; + for (i=jz-1; i>=jk; i--) j |= iq[i]; + if (j == 0) { /* need recomputation */ + for (k=1; iq[jk-k]==0; k++); /* k = no. of terms needed */ + + for (i=jz+1; i<=jz+k; i++) { /* add q[jz+1] to q[jz+k] */ + f[jx+i] = (double)ipio2[jv+i]; + for (j=0,fw=0.0; j<=jx; j++) + fw += x[j]*f[jx+i-j]; + q[i] = fw; + } + jz += k; + goto recompute; + } + } + + /* chop off zero terms */ + if (z == 0.0) { + jz -= 1; + q0 -= 24; + while (iq[jz] == 0) { + jz--; + q0 -= 24; + } + } else { /* break z into 24-bit if necessary */ + z = scalbn(z,-q0); + if (z >= 0x1p24) { + fw = (double)(int32_t)(0x1p-24*z); + iq[jz] = (int32_t)(z - 0x1p24*fw); + jz += 1; + q0 += 24; + iq[jz] = (int32_t)fw; + } else + iq[jz] = (int32_t)z; + } + + /* convert integer "bit" chunk to floating-point value */ + fw = scalbn(1.0,q0); + for (i=jz; i>=0; i--) { + q[i] = fw*(double)iq[i]; + fw *= 0x1p-24; + } + + /* compute PIo2[0,...,jp]*q[jz,...,0] */ + for(i=jz; i>=0; i--) { + for (fw=0.0,k=0; k<=jp && k<=jz-i; k++) + fw += PIo2[k]*q[i+k]; + fq[jz-i] = fw; + } + + /* compress fq[] into y[] */ + switch(prec) { + case 0: + fw = 0.0; + for (i=jz; i>=0; i--) + fw += fq[i]; + y[0] = ih==0 ? fw : -fw; + break; + case 1: + case 2: + fw = 0.0; + for (i=jz; i>=0; i--) + fw += fq[i]; + // TODO: drop excess precision here once double_t is used + fw = (double)fw; + y[0] = ih==0 ? fw : -fw; + fw = fq[0]-fw; + for (i=1; i<=jz; i++) + fw += fq[i]; + y[1] = ih==0 ? fw : -fw; + break; + case 3: /* painful */ + for (i=jz; i>0; i--) { + fw = fq[i-1]+fq[i]; + fq[i] += fq[i-1]-fw; + fq[i-1] = fw; + } + for (i=jz; i>1; i--) { + fw = fq[i-1]+fq[i]; + fq[i] += fq[i-1]-fw; + fq[i-1] = fw; + } + for (fw=0.0,i=jz; i>=2; i--) + fw += fq[i]; + if (ih==0) { + y[0] = fq[0]; y[1] = fq[1]; y[2] = fw; + } else { + y[0] = -fq[0]; y[1] = -fq[1]; y[2] = -fw; + } + } + return n&7; +} diff --git a/external/musl/__sin.c b/external/musl/__sin.c new file mode 100644 index 0000000..4030949 --- /dev/null +++ b/external/musl/__sin.c @@ -0,0 +1,64 @@ +/* origin: FreeBSD /usr/src/lib/msun/src/k_sin.c */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ +/* __sin( x, y, iy) + * kernel sin function on ~[-pi/4, pi/4] (except on -0), pi/4 ~ 0.7854 + * Input x is assumed to be bounded by ~pi/4 in magnitude. + * Input y is the tail of x. + * Input iy indicates whether y is 0. (if iy=0, y assume to be 0). + * + * Algorithm + * 1. Since sin(-x) = -sin(x), we need only to consider positive x. + * 2. Callers must return sin(-0) = -0 without calling here since our + * odd polynomial is not evaluated in a way that preserves -0. + * Callers may do the optimization sin(x) ~ x for tiny x. + * 3. sin(x) is approximated by a polynomial of degree 13 on + * [0,pi/4] + * 3 13 + * sin(x) ~ x + S1*x + ... + S6*x + * where + * + * |sin(x) 2 4 6 8 10 12 | -58 + * |----- - (1+S1*x +S2*x +S3*x +S4*x +S5*x +S6*x )| <= 2 + * | x | + * + * 4. sin(x+y) = sin(x) + sin'(x')*y + * ~ sin(x) + (1-x*x/2)*y + * For better accuracy, let + * 3 2 2 2 2 + * r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6)))) + * then 3 2 + * sin(x) = x + (S1*x + (x *(r-y/2)+y)) + */ + +#include "libm.h" + +static const double +S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */ +S2 = 8.33333333332248946124e-03, /* 0x3F811111, 0x1110F8A6 */ +S3 = -1.98412698298579493134e-04, /* 0xBF2A01A0, 0x19C161D5 */ +S4 = 2.75573137070700676789e-06, /* 0x3EC71DE3, 0x57B1FE7D */ +S5 = -2.50507602534068634195e-08, /* 0xBE5AE5E6, 0x8A2B9CEB */ +S6 = 1.58969099521155010221e-10; /* 0x3DE5D93A, 0x5ACFD57C */ + +double __sin(double x, double y, int iy) +{ + double_t z,r,v,w; + + z = x*x; + w = z*z; + r = S2 + z*(S3 + z*S4) + z*w*(S5 + z*S6); + v = z*x; + if (iy == 0) + return x + v*(S1 + z*r); + else + return x - ((z*(0.5*y - v*r) - y) - v*S1); +} diff --git a/external/musl/cos.c b/external/musl/cos.c new file mode 100644 index 0000000..eb5c2a4 --- /dev/null +++ b/external/musl/cos.c @@ -0,0 +1,79 @@ +/* origin: FreeBSD /usr/src/lib/msun/src/s_cos.c */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ +/* cos(x) + * Return cosine function of x. + * + * kernel function: + * __sin ... sine function on [-pi/4,pi/4] + * __cos ... cosine function on [-pi/4,pi/4] + * __rem_pio2 ... argument reduction routine + * + * Method. + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * in [-pi/4 , +pi/4], and let n = k mod 4. + * We have + * + * n sin(x) cos(x) tan(x) + * ---------------------------------------------------------- + * 0 S C T + * 1 C -S -1/T + * 2 -S -C T + * 3 -C S -1/T + * ---------------------------------------------------------- + * + * Special cases: + * Let trig be any of sin, cos, or tan. + * trig(+-INF) is NaN, with signals; + * trig(NaN) is that NaN; + * + * Accuracy: + * TRIG(x) returns trig(x) nearly rounded + */ + +#include "libm.h" + +double __cdecl cos(double x) +{ + double y[2]; + uint32_t ix; + unsigned n; + + GET_HIGH_WORD(ix, x); + ix &= 0x7fffffff; + + /* |x| ~< pi/4 */ + if (ix <= 0x3fe921fb) { + if (ix < 0x3e46a09e) { /* |x| < 2**-27 * sqrt(2) */ + /* raise inexact if x!=0 */ + FORCE_EVAL(x + 0x1p120f); + return 1.0; + } + return __cos(x, 0); + } + + /* cos(Inf or NaN) is NaN */ + if (isinf(x)) + return math_error(_DOMAIN, "cos", x, 0, x - x); + if (ix >= 0x7ff00000) + return x-x; + + /* argument reduction */ + n = __rem_pio2(x, y); + switch (n&3) { + case 0: return __cos(y[0], y[1]); + case 1: return -__sin(y[0], y[1], 1); + case 2: return -__cos(y[0], y[1]); + default: + return __sin(y[0], y[1], 1); + } +} diff --git a/external/musl/exp2.c b/external/musl/exp2.c new file mode 100644 index 0000000..47c557c --- /dev/null +++ b/external/musl/exp2.c @@ -0,0 +1,130 @@ +/* + * Double-precision 2^x function. + * + * Copyright (c) 2018, Arm Limited. + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include "libm.h" +#include "exp_data.h" + +#define N (1 << EXP_TABLE_BITS) +#define Shift __exp_data.exp2_shift +#define T __exp_data.tab +#define C1 __exp_data.exp2_poly[0] +#define C2 __exp_data.exp2_poly[1] +#define C3 __exp_data.exp2_poly[2] +#define C4 __exp_data.exp2_poly[3] +#define C5 __exp_data.exp2_poly[4] + +/* Handle cases that may overflow or underflow when computing the result that + is scale*(1+TMP) without intermediate rounding. The bit representation of + scale is in SBITS, however it has a computed exponent that may have + overflown into the sign bit so that needs to be adjusted before using it as + a double. (int32_t)KI is the k used in the argument reduction and exponent + adjustment of scale, positive k here means the result may overflow and + negative k means the result may underflow. */ +static inline double specialcase(double_t tmp, uint64_t sbits, uint64_t ki) +{ + double_t scale, y; + + if ((ki & 0x80000000) == 0) { + /* k > 0, the exponent of scale might have overflowed by 1. */ + sbits -= 1ull << 52; + scale = asdouble(sbits); + y = 2 * (scale + scale * tmp); + return eval_as_double(y); + } + /* k < 0, need special care in the subnormal range. */ + sbits += 1022ull << 52; + scale = asdouble(sbits); + y = scale + scale * tmp; + if (y < 1.0) { + /* Round y to the right precision before scaling it into the subnormal + range to avoid double rounding that can cause 0.5+E/2 ulp error where + E is the worst-case ulp error outside the subnormal range. So this + is only useful if the goal is better than 1 ulp worst-case error. */ + double_t hi, lo; + lo = scale - y + scale * tmp; + hi = 1.0 + y; + lo = 1.0 - hi + y + lo; + y = eval_as_double(hi + lo) - 1.0; + /* Avoid -0.0 with downward rounding. */ + if (WANT_ROUNDING && y == 0.0) + y = 0.0; + /* The underflow exception needs to be signaled explicitly. */ + fp_force_eval(fp_barrier(0x1p-1022) * 0x1p-1022); + } + y = 0x1p-1022 * y; + return eval_as_double(y); +} + +/* Top 12 bits of a double (sign and exponent bits). */ +static inline uint32_t top12(double x) +{ + return asuint64(x) >> 52; +} + +double __cdecl exp2(double x) +{ + uint32_t abstop; + uint64_t ki, idx, top, sbits; + double_t kd, r, r2, scale, tail, tmp; + + abstop = top12(x) & 0x7ff; + if (predict_false(abstop - top12(0x1p-54) >= top12(512.0) - top12(0x1p-54))) { + if (abstop - top12(0x1p-54) >= 0x80000000) + /* Avoid spurious underflow for tiny x. */ + /* Note: 0 is common input. */ + return WANT_ROUNDING ? 1.0 + x : 1.0; + if (abstop >= top12(1024.0)) { + if (asuint64(x) == asuint64(-INFINITY)) + return 0.0; + if (abstop >= top12(INFINITY)) + return 1.0 + x; + if (!(asuint64(x) >> 63)) { + errno = ERANGE; + return fp_barrier(DBL_MAX) * DBL_MAX; + } + else if (x <= -2147483648.0) { + fp_barrier(x + 0x1p120f); + return 0; + } + else if (asuint64(x) >= asuint64(-1075.0)) { + errno = ERANGE; + fp_barrier(x + 0x1p120f); + return 0; + } + } + if (2 * asuint64(x) > 2 * asuint64(928.0)) + /* Large x is special cased below. */ + abstop = 0; + } + + /* exp2(x) = 2^(k/N) * 2^r, with 2^r in [2^(-1/2N),2^(1/2N)]. */ + /* x = k/N + r, with int k and r in [-1/2N, 1/2N]. */ + kd = eval_as_double(x + Shift); + ki = asuint64(kd); /* k. */ + kd -= Shift; /* k/N for int k. */ + r = x - kd; + /* 2^(k/N) ~= scale * (1 + tail). */ + idx = 2 * (ki % N); + top = ki << (52 - EXP_TABLE_BITS); + tail = asdouble(T[idx]); + /* This is only a valid scale when -1023*N < k < 1024*N. */ + sbits = T[idx + 1] + top; + /* exp2(x) = 2^(k/N) * 2^r ~= scale + scale * (tail + 2^r - 1). */ + /* Evaluation is optimized assuming superscalar pipelined execution. */ + r2 = r * r; + /* Without fma the worst case error is 0.5/N ulp larger. */ + /* Worst case error is less than 0.5+0.86/N+(abs poly error * 2^53) ulp. */ + tmp = tail + r * C1 + r2 * (C2 + r * C3) + r2 * r2 * (C4 + r * C5); + if (predict_false(abstop == 0)) + return specialcase(tmp, sbits, ki); + scale = asdouble(sbits); + /* Note: tmp == 0 or |tmp| > 2^-65 and scale > 2^-928, so there + is no spurious underflow here even without fma. */ + return eval_as_double(scale + scale * tmp); +} diff --git a/external/musl/exp_data.c b/external/musl/exp_data.c new file mode 100644 index 0000000..21be014 --- /dev/null +++ b/external/musl/exp_data.c @@ -0,0 +1,182 @@ +/* + * Shared data between exp, exp2 and pow. + * + * Copyright (c) 2018, Arm Limited. + * SPDX-License-Identifier: MIT + */ + +#include "exp_data.h" + +#define N (1 << EXP_TABLE_BITS) + +const struct exp_data __exp_data = { +// N/ln2 +.invln2N = 0x1.71547652b82fep0 * N, +// -ln2/N +.negln2hiN = -0x1.62e42fefa0000p-8, +.negln2loN = -0x1.cf79abc9e3b3ap-47, +// Used for rounding when !TOINT_INTRINSICS +#if EXP_USE_TOINT_NARROW +.shift = 0x1800000000.8p0, +#else +.shift = 0x1.8p52, +#endif +// exp polynomial coefficients. +.poly = { +// abs error: 1.555*2^-66 +// ulp error: 0.509 (0.511 without fma) +// if |x| < ln2/256+eps +// abs error if |x| < ln2/256+0x1p-15: 1.09*2^-65 +// abs error if |x| < ln2/128: 1.7145*2^-56 +0x1.ffffffffffdbdp-2, +0x1.555555555543cp-3, +0x1.55555cf172b91p-5, +0x1.1111167a4d017p-7, +}, +.exp2_shift = 0x1.8p52 / N, +// exp2 polynomial coefficients. +.exp2_poly = { +// abs error: 1.2195*2^-65 +// ulp error: 0.507 (0.511 without fma) +// if |x| < 1/256 +// abs error if |x| < 1/128: 1.9941*2^-56 +0x1.62e42fefa39efp-1, +0x1.ebfbdff82c424p-3, +0x1.c6b08d70cf4b5p-5, +0x1.3b2abd24650ccp-7, +0x1.5d7e09b4e3a84p-10, +}, +// 2^(k/N) ~= H[k]*(1 + T[k]) for int k in [0,N) +// tab[2*k] = asuint64(T[k]) +// tab[2*k+1] = asuint64(H[k]) - (k << 52)/N +.tab = { +0x0, 0x3ff0000000000000, +0x3c9b3b4f1a88bf6e, 0x3feff63da9fb3335, +0xbc7160139cd8dc5d, 0x3fefec9a3e778061, +0xbc905e7a108766d1, 0x3fefe315e86e7f85, +0x3c8cd2523567f613, 0x3fefd9b0d3158574, +0xbc8bce8023f98efa, 0x3fefd06b29ddf6de, +0x3c60f74e61e6c861, 0x3fefc74518759bc8, +0x3c90a3e45b33d399, 0x3fefbe3ecac6f383, +0x3c979aa65d837b6d, 0x3fefb5586cf9890f, +0x3c8eb51a92fdeffc, 0x3fefac922b7247f7, +0x3c3ebe3d702f9cd1, 0x3fefa3ec32d3d1a2, +0xbc6a033489906e0b, 0x3fef9b66affed31b, +0xbc9556522a2fbd0e, 0x3fef9301d0125b51, +0xbc5080ef8c4eea55, 0x3fef8abdc06c31cc, +0xbc91c923b9d5f416, 0x3fef829aaea92de0, +0x3c80d3e3e95c55af, 0x3fef7a98c8a58e51, +0xbc801b15eaa59348, 0x3fef72b83c7d517b, +0xbc8f1ff055de323d, 0x3fef6af9388c8dea, +0x3c8b898c3f1353bf, 0x3fef635beb6fcb75, +0xbc96d99c7611eb26, 0x3fef5be084045cd4, +0x3c9aecf73e3a2f60, 0x3fef54873168b9aa, +0xbc8fe782cb86389d, 0x3fef4d5022fcd91d, +0x3c8a6f4144a6c38d, 0x3fef463b88628cd6, +0x3c807a05b0e4047d, 0x3fef3f49917ddc96, +0x3c968efde3a8a894, 0x3fef387a6e756238, +0x3c875e18f274487d, 0x3fef31ce4fb2a63f, +0x3c80472b981fe7f2, 0x3fef2b4565e27cdd, +0xbc96b87b3f71085e, 0x3fef24dfe1f56381, +0x3c82f7e16d09ab31, 0x3fef1e9df51fdee1, +0xbc3d219b1a6fbffa, 0x3fef187fd0dad990, +0x3c8b3782720c0ab4, 0x3fef1285a6e4030b, +0x3c6e149289cecb8f, 0x3fef0cafa93e2f56, +0x3c834d754db0abb6, 0x3fef06fe0a31b715, +0x3c864201e2ac744c, 0x3fef0170fc4cd831, +0x3c8fdd395dd3f84a, 0x3feefc08b26416ff, +0xbc86a3803b8e5b04, 0x3feef6c55f929ff1, +0xbc924aedcc4b5068, 0x3feef1a7373aa9cb, +0xbc9907f81b512d8e, 0x3feeecae6d05d866, +0xbc71d1e83e9436d2, 0x3feee7db34e59ff7, +0xbc991919b3ce1b15, 0x3feee32dc313a8e5, +0x3c859f48a72a4c6d, 0x3feedea64c123422, +0xbc9312607a28698a, 0x3feeda4504ac801c, +0xbc58a78f4817895b, 0x3feed60a21f72e2a, +0xbc7c2c9b67499a1b, 0x3feed1f5d950a897, +0x3c4363ed60c2ac11, 0x3feece086061892d, +0x3c9666093b0664ef, 0x3feeca41ed1d0057, +0x3c6ecce1daa10379, 0x3feec6a2b5c13cd0, +0x3c93ff8e3f0f1230, 0x3feec32af0d7d3de, +0x3c7690cebb7aafb0, 0x3feebfdad5362a27, +0x3c931dbdeb54e077, 0x3feebcb299fddd0d, +0xbc8f94340071a38e, 0x3feeb9b2769d2ca7, +0xbc87deccdc93a349, 0x3feeb6daa2cf6642, +0xbc78dec6bd0f385f, 0x3feeb42b569d4f82, +0xbc861246ec7b5cf6, 0x3feeb1a4ca5d920f, +0x3c93350518fdd78e, 0x3feeaf4736b527da, +0x3c7b98b72f8a9b05, 0x3feead12d497c7fd, +0x3c9063e1e21c5409, 0x3feeab07dd485429, +0x3c34c7855019c6ea, 0x3feea9268a5946b7, +0x3c9432e62b64c035, 0x3feea76f15ad2148, +0xbc8ce44a6199769f, 0x3feea5e1b976dc09, +0xbc8c33c53bef4da8, 0x3feea47eb03a5585, +0xbc845378892be9ae, 0x3feea34634ccc320, +0xbc93cedd78565858, 0x3feea23882552225, +0x3c5710aa807e1964, 0x3feea155d44ca973, +0xbc93b3efbf5e2228, 0x3feea09e667f3bcd, +0xbc6a12ad8734b982, 0x3feea012750bdabf, +0xbc6367efb86da9ee, 0x3fee9fb23c651a2f, +0xbc80dc3d54e08851, 0x3fee9f7df9519484, +0xbc781f647e5a3ecf, 0x3fee9f75e8ec5f74, +0xbc86ee4ac08b7db0, 0x3fee9f9a48a58174, +0xbc8619321e55e68a, 0x3fee9feb564267c9, +0x3c909ccb5e09d4d3, 0x3feea0694fde5d3f, +0xbc7b32dcb94da51d, 0x3feea11473eb0187, +0x3c94ecfd5467c06b, 0x3feea1ed0130c132, +0x3c65ebe1abd66c55, 0x3feea2f336cf4e62, +0xbc88a1c52fb3cf42, 0x3feea427543e1a12, +0xbc9369b6f13b3734, 0x3feea589994cce13, +0xbc805e843a19ff1e, 0x3feea71a4623c7ad, +0xbc94d450d872576e, 0x3feea8d99b4492ed, +0x3c90ad675b0e8a00, 0x3feeaac7d98a6699, +0x3c8db72fc1f0eab4, 0x3feeace5422aa0db, +0xbc65b6609cc5e7ff, 0x3feeaf3216b5448c, +0x3c7bf68359f35f44, 0x3feeb1ae99157736, +0xbc93091fa71e3d83, 0x3feeb45b0b91ffc6, +0xbc5da9b88b6c1e29, 0x3feeb737b0cdc5e5, +0xbc6c23f97c90b959, 0x3feeba44cbc8520f, +0xbc92434322f4f9aa, 0x3feebd829fde4e50, +0xbc85ca6cd7668e4b, 0x3feec0f170ca07ba, +0x3c71affc2b91ce27, 0x3feec49182a3f090, +0x3c6dd235e10a73bb, 0x3feec86319e32323, +0xbc87c50422622263, 0x3feecc667b5de565, +0x3c8b1c86e3e231d5, 0x3feed09bec4a2d33, +0xbc91bbd1d3bcbb15, 0x3feed503b23e255d, +0x3c90cc319cee31d2, 0x3feed99e1330b358, +0x3c8469846e735ab3, 0x3feede6b5579fdbf, +0xbc82dfcd978e9db4, 0x3feee36bbfd3f37a, +0x3c8c1a7792cb3387, 0x3feee89f995ad3ad, +0xbc907b8f4ad1d9fa, 0x3feeee07298db666, +0xbc55c3d956dcaeba, 0x3feef3a2b84f15fb, +0xbc90a40e3da6f640, 0x3feef9728de5593a, +0xbc68d6f438ad9334, 0x3feeff76f2fb5e47, +0xbc91eee26b588a35, 0x3fef05b030a1064a, +0x3c74ffd70a5fddcd, 0x3fef0c1e904bc1d2, +0xbc91bdfbfa9298ac, 0x3fef12c25bd71e09, +0x3c736eae30af0cb3, 0x3fef199bdd85529c, +0x3c8ee3325c9ffd94, 0x3fef20ab5fffd07a, +0x3c84e08fd10959ac, 0x3fef27f12e57d14b, +0x3c63cdaf384e1a67, 0x3fef2f6d9406e7b5, +0x3c676b2c6c921968, 0x3fef3720dcef9069, +0xbc808a1883ccb5d2, 0x3fef3f0b555dc3fa, +0xbc8fad5d3ffffa6f, 0x3fef472d4a07897c, +0xbc900dae3875a949, 0x3fef4f87080d89f2, +0x3c74a385a63d07a7, 0x3fef5818dcfba487, +0xbc82919e2040220f, 0x3fef60e316c98398, +0x3c8e5a50d5c192ac, 0x3fef69e603db3285, +0x3c843a59ac016b4b, 0x3fef7321f301b460, +0xbc82d52107b43e1f, 0x3fef7c97337b9b5f, +0xbc892ab93b470dc9, 0x3fef864614f5a129, +0x3c74b604603a88d3, 0x3fef902ee78b3ff6, +0x3c83c5ec519d7271, 0x3fef9a51fbc74c83, +0xbc8ff7128fd391f0, 0x3fefa4afa2a490da, +0xbc8dae98e223747d, 0x3fefaf482d8e67f1, +0x3c8ec3bc41aa2008, 0x3fefba1bee615a27, +0x3c842b94c3a9eb32, 0x3fefc52b376bba97, +0x3c8a64a931d185ee, 0x3fefd0765b6e4540, +0xbc8e37bae43be3ed, 0x3fefdbfdad9cbe14, +0x3c77893b4d91cd9d, 0x3fefe7c1819e90d8, +0x3c5305c14160cc89, 0x3feff3c22b8f71f1, +}, +}; diff --git a/external/musl/exp_data.h b/external/musl/exp_data.h new file mode 100644 index 0000000..3e24bac --- /dev/null +++ b/external/musl/exp_data.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2018, Arm Limited. + * SPDX-License-Identifier: MIT + */ +#ifndef _EXP_DATA_H +#define _EXP_DATA_H + +#include +#include + +#define EXP_TABLE_BITS 7 +#define EXP_POLY_ORDER 5 +#define EXP_USE_TOINT_NARROW 0 +#define EXP2_POLY_ORDER 5 +extern hidden const struct exp_data { + double invln2N; + double shift; + double negln2hiN; + double negln2loN; + double poly[4]; /* Last four coefficients. */ + double exp2_shift; + double exp2_poly[EXP2_POLY_ORDER]; + uint64_t tab[2*(1 << EXP_TABLE_BITS)]; +} __exp_data; + +#endif diff --git a/external/musl/expm1.c b/external/musl/expm1.c new file mode 100644 index 0000000..d29f73f --- /dev/null +++ b/external/musl/expm1.c @@ -0,0 +1,202 @@ +/* origin: FreeBSD /usr/src/lib/msun/src/s_expm1.c */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ +/* expm1(x) + * Returns exp(x)-1, the exponential of x minus 1. + * + * Method + * 1. Argument reduction: + * Given x, find r and integer k such that + * + * x = k*ln2 + r, |r| <= 0.5*ln2 ~ 0.34658 + * + * Here a correction term c will be computed to compensate + * the error in r when rounded to a floating-point number. + * + * 2. Approximating expm1(r) by a special rational function on + * the interval [0,0.34658]: + * Since + * r*(exp(r)+1)/(exp(r)-1) = 2+ r^2/6 - r^4/360 + ... + * we define R1(r*r) by + * r*(exp(r)+1)/(exp(r)-1) = 2+ r^2/6 * R1(r*r) + * That is, + * R1(r**2) = 6/r *((exp(r)+1)/(exp(r)-1) - 2/r) + * = 6/r * ( 1 + 2.0*(1/(exp(r)-1) - 1/r)) + * = 1 - r^2/60 + r^4/2520 - r^6/100800 + ... + * We use a special Remez algorithm on [0,0.347] to generate + * a polynomial of degree 5 in r*r to approximate R1. The + * maximum error of this polynomial approximation is bounded + * by 2**-61. In other words, + * R1(z) ~ 1.0 + Q1*z + Q2*z**2 + Q3*z**3 + Q4*z**4 + Q5*z**5 + * where Q1 = -1.6666666666666567384E-2, + * Q2 = 3.9682539681370365873E-4, + * Q3 = -9.9206344733435987357E-6, + * Q4 = 2.5051361420808517002E-7, + * Q5 = -6.2843505682382617102E-9; + * z = r*r, + * with error bounded by + * | 5 | -61 + * | 1.0+Q1*z+...+Q5*z - R1(z) | <= 2 + * | | + * + * expm1(r) = exp(r)-1 is then computed by the following + * specific way which minimize the accumulation rounding error: + * 2 3 + * r r [ 3 - (R1 + R1*r/2) ] + * expm1(r) = r + --- + --- * [--------------------] + * 2 2 [ 6 - r*(3 - R1*r/2) ] + * + * To compensate the error in the argument reduction, we use + * expm1(r+c) = expm1(r) + c + expm1(r)*c + * ~ expm1(r) + c + r*c + * Thus c+r*c will be added in as the correction terms for + * expm1(r+c). Now rearrange the term to avoid optimization + * screw up: + * ( 2 2 ) + * ({ ( r [ R1 - (3 - R1*r/2) ] ) } r ) + * expm1(r+c)~r - ({r*(--- * [--------------------]-c)-c} - --- ) + * ({ ( 2 [ 6 - r*(3 - R1*r/2) ] ) } 2 ) + * ( ) + * + * = r - E + * 3. Scale back to obtain expm1(x): + * From step 1, we have + * expm1(x) = either 2^k*[expm1(r)+1] - 1 + * = or 2^k*[expm1(r) + (1-2^-k)] + * 4. Implementation notes: + * (A). To save one multiplication, we scale the coefficient Qi + * to Qi*2^i, and replace z by (x^2)/2. + * (B). To achieve maximum accuracy, we compute expm1(x) by + * (i) if x < -56*ln2, return -1.0, (raise inexact if x!=inf) + * (ii) if k=0, return r-E + * (iii) if k=-1, return 0.5*(r-E)-0.5 + * (iv) if k=1 if r < -0.25, return 2*((r+0.5)- E) + * else return 1.0+2.0*(r-E); + * (v) if (k<-2||k>56) return 2^k(1-(E-r)) - 1 (or exp(x)-1) + * (vi) if k <= 20, return 2^k((1-2^-k)-(E-r)), else + * (vii) return 2^k(1-((E+2^-k)-r)) + * + * Special cases: + * expm1(INF) is INF, expm1(NaN) is NaN; + * expm1(-INF) is -1, and + * for finite argument, only expm1(0)=0 is exact. + * + * Accuracy: + * according to an error analysis, the error is always less than + * 1 ulp (unit in the last place). + * + * Misc. info. + * For IEEE double + * if x > 7.09782712893383973096e+02 then expm1(x) overflow + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "libm.h" + +static const double +o_threshold = 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */ +ln2_hi = 6.93147180369123816490e-01, /* 0x3fe62e42, 0xfee00000 */ +ln2_lo = 1.90821492927058770002e-10, /* 0x3dea39ef, 0x35793c76 */ +invln2 = 1.44269504088896338700e+00, /* 0x3ff71547, 0x652b82fe */ +/* Scaled Q's: Qn_here = 2**n * Qn_above, for R(2*z) where z = hxs = x*x/2: */ +Q1 = -3.33333333333331316428e-02, /* BFA11111 111110F4 */ +Q2 = 1.58730158725481460165e-03, /* 3F5A01A0 19FE5585 */ +Q3 = -7.93650757867487942473e-05, /* BF14CE19 9EAADBB7 */ +Q4 = 4.00821782732936239552e-06, /* 3ED0CFCA 86E65239 */ +Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */ + +double __cdecl expm1(double x) +{ + double_t y,hi,lo,c,t,e,hxs,hfx,r1,twopk; + union {double f; uint64_t i;} u = {x}; + uint32_t hx = u.i>>32 & 0x7fffffff; + int k, sign = u.i>>63; + + /* filter out huge and non-finite argument */ + if (hx >= 0x4043687A) { /* if |x|>=56*ln2 */ + if (isnan(x)) + return x; + if (isinf(x)) + return sign ? -1 : x; + if (sign) + return math_error(_UNDERFLOW, "exp", x, 0, -1); + if (x > o_threshold) { + return math_error(_OVERFLOW, "exp", x, 0, x * 0x1p1023); + } + } + + /* argument reduction */ + if (hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */ + if (hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */ + if (!sign) { + hi = x - ln2_hi; + lo = ln2_lo; + k = 1; + } else { + hi = x + ln2_hi; + lo = -ln2_lo; + k = -1; + } + } else { + k = invln2*x + (sign ? -0.5 : 0.5); + t = k; + hi = x - t*ln2_hi; /* t*ln2_hi is exact here */ + lo = t*ln2_lo; + } + x = hi-lo; + c = (hi-x)-lo; + } else if (hx < 0x3c900000) { /* |x| < 2**-54, return x */ + if (hx < 0x00100000) + FORCE_EVAL((float)x); + return x; + } else + k = 0; + + /* x is now in primary range */ + hfx = 0.5*x; + hxs = x*hfx; + r1 = 1.0+hxs*(Q1+hxs*(Q2+hxs*(Q3+hxs*(Q4+hxs*Q5)))); + t = 3.0-r1*hfx; + e = hxs*((r1-t)/(6.0 - x*t)); + if (k == 0) /* c is 0 */ + return x - (x*e-hxs); + e = x*(e-c) - c; + e -= hxs; + /* exp(x) ~ 2^k (x_reduced - e + 1) */ + if (k == -1) + return 0.5*(x-e) - 0.5; + if (k == 1) { + if (x < -0.25) + return -2.0*(e-(x+0.5)); + return 1.0+2.0*(x-e); + } + u.i = (uint64_t)(0x3ff + k)<<52; /* 2^k */ + twopk = u.f; + if (k < 0 || k > 56) { /* suffice to return exp(x)-1 */ + y = x - e + 1.0; + if (k == 1024) + y = y*2.0*0x1p1023; + else + y = y*twopk; + return y - 1.0; + } + u.i = (uint64_t)(0x3ff - k)<<52; /* 2^-k */ + if (k < 20) + y = (x-e+(1-u.f))*twopk; + else + y = (x-(e+u.f)+1)*twopk; + return y; +} diff --git a/external/musl/frexp.c b/external/musl/frexp.c new file mode 100644 index 0000000..5eb5114 --- /dev/null +++ b/external/musl/frexp.c @@ -0,0 +1,23 @@ +#include +#include + +double __cdecl frexp(double x, int *e) +{ + union { double d; uint64_t i; } y = { x }; + int ee = y.i>>52 & 0x7ff; + + if (!ee) { + if (x) { + x = frexp(x*0x1p64, e); + *e -= 64; + } else *e = 0; + return x; + } else if (ee == 0x7ff) { + return x; + } + + *e = ee - 0x3fe; + y.i &= 0x800fffffffffffffull; + y.i |= 0x3fe0000000000000ull; + return y.d; +} diff --git a/external/musl/internal/features.h b/external/musl/internal/features.h new file mode 100644 index 0000000..a984ae9 --- /dev/null +++ b/external/musl/internal/features.h @@ -0,0 +1,8 @@ +#ifndef FEATURES_H +#define FEATURES_H + +#define weak +#define hidden +#define weak_alias(old, new) + +#endif diff --git a/external/musl/internal/libm.h b/external/musl/internal/libm.h new file mode 100644 index 0000000..fa3ec4b --- /dev/null +++ b/external/musl/internal/libm.h @@ -0,0 +1,282 @@ +#ifndef _LIBM_H +#define _LIBM_H + +#include +#include +#include +#include +#include + +typedef float float_t; +typedef double double_t; + +hidden double math_error(int type, const char *name, double arg1, double arg2, double retval); + +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 && __BYTE_ORDER == __LITTLE_ENDIAN +union ldshape { + long double f; + struct { + uint64_t m; + uint16_t se; + } i; +}; +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 && __BYTE_ORDER == __BIG_ENDIAN +/* This is the m68k variant of 80-bit long double, and this definition only works + * on archs where the alignment requirement of uint64_t is <= 4. */ +union ldshape { + long double f; + struct { + uint16_t se; + uint16_t pad; + uint64_t m; + } i; +}; +#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 && __BYTE_ORDER == __LITTLE_ENDIAN +union ldshape { + long double f; + struct { + uint64_t lo; + uint32_t mid; + uint16_t top; + uint16_t se; + } i; + struct { + uint64_t lo; + uint64_t hi; + } i2; +}; +#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 && __BYTE_ORDER == __BIG_ENDIAN +union ldshape { + long double f; + struct { + uint16_t se; + uint16_t top; + uint32_t mid; + uint64_t lo; + } i; + struct { + uint64_t hi; + uint64_t lo; + } i2; +}; +#else +#error Unsupported long double representation +#endif + +/* Support non-nearest rounding mode. */ +#define WANT_ROUNDING 1 +/* Support signaling NaNs. */ +#define WANT_SNAN 0 + +#if WANT_SNAN +#error SNaN is unsupported +#else +#define issignalingf_inline(x) 0 +#define issignaling_inline(x) 0 +#endif + +#ifndef TOINT_INTRINSICS +#define TOINT_INTRINSICS 0 +#endif + +#if TOINT_INTRINSICS +/* Round x to nearest int in all rounding modes, ties have to be rounded + consistently with converttoint so the results match. If the result + would be outside of [-2^31, 2^31-1] then the semantics is unspecified. */ +static double_t roundtoint(double_t); + +/* Convert x to nearest int in all rounding modes, ties have to be rounded + consistently with roundtoint. If the result is not representible in an + int32_t then the semantics is unspecified. */ +static int32_t converttoint(double_t); +#endif + +/* Helps static branch prediction so hot path can be better optimized. */ +#ifdef __GNUC__ +#define predict_true(x) __builtin_expect(!!(x), 1) +#define predict_false(x) __builtin_expect(x, 0) +#else +#define predict_true(x) (x) +#define predict_false(x) (x) +#endif + +/* Evaluate an expression as the specified type. With standard excess + precision handling a type cast or assignment is enough (with + -ffloat-store an assignment is required, in old compilers argument + passing and return statement may not drop excess precision). + + If compiled without -ffloat-store or -fexcess-precision=standard, + an extra volatile qualifier here will force limiting the precision. */ + +static inline float eval_as_float(float x) +{ + volatile float y = x; + return y; +} + +static inline double eval_as_double(double x) +{ + volatile double y = x; + return y; +} + +/* fp_barrier returns its input, but limits code transformations + as if it had a side-effect (e.g. observable io) and returned + an arbitrary value. */ + +#ifndef fp_barrierf +#define fp_barrierf fp_barrierf +static inline float fp_barrierf(float x) +{ + volatile float y = x; + return y; +} +#endif + +#ifndef fp_barrier +#define fp_barrier fp_barrier +static inline double fp_barrier(double x) +{ + volatile double y = x; + return y; +} +#endif + +#ifndef fp_barrierl +#define fp_barrierl fp_barrierl +static inline long double fp_barrierl(long double x) +{ + volatile long double y = x; + return y; +} +#endif + +/* fp_force_eval ensures that the input value is computed when that's + otherwise unused. To prevent the constant folding of the input + expression, an additional fp_barrier may be needed or a compilation + mode that does so (e.g. -frounding-math in gcc). Then it can be + used to evaluate an expression for its fenv side-effects only. */ + +#ifndef fp_force_evalf +#define fp_force_evalf fp_force_evalf +static inline void fp_force_evalf(float x) +{ + volatile float y; + y = x; +} +#endif + +#ifndef fp_force_eval +#define fp_force_eval fp_force_eval +static inline void fp_force_eval(double x) +{ + volatile double y; + y = x; +} +#endif + +#ifndef fp_force_evall +#define fp_force_evall fp_force_evall +static inline void fp_force_evall(long double x) +{ + volatile long double y; + y = x; +} +#endif + +#define FORCE_EVAL(x) do { \ + if (sizeof(x) == sizeof(float)) { \ + fp_force_evalf(x); \ + } else if (sizeof(x) == sizeof(double)) { \ + fp_force_eval(x); \ + } else { \ + fp_force_evall(x); \ + } \ +} while(0) + +#define asuint(f) ((union{float _f; uint32_t _i;}){f})._i +#define asfloat(i) ((union{uint32_t _i; float _f;}){i})._f +#define asuint64(f) ((union{double _f; uint64_t _i;}){f})._i +#define asdouble(i) ((union{uint64_t _i; double _f;}){i})._f + +#define EXTRACT_WORDS(hi,lo,d) \ +do { \ + uint64_t __u = asuint64(d); \ + (hi) = __u >> 32; \ + (lo) = (uint32_t)__u; \ +} while (0) + +#define GET_HIGH_WORD(hi,d) \ +do { \ + (hi) = asuint64(d) >> 32; \ +} while (0) + +#define GET_LOW_WORD(lo,d) \ +do { \ + (lo) = (uint32_t)asuint64(d); \ +} while (0) + +#define INSERT_WORDS(d,hi,lo) \ +do { \ + (d) = asdouble(((uint64_t)(hi)<<32) | (uint32_t)(lo)); \ +} while (0) + +#define SET_HIGH_WORD(d,hi) \ + INSERT_WORDS(d, hi, (uint32_t)asuint64(d)) + +#define SET_LOW_WORD(d,lo) \ + INSERT_WORDS(d, asuint64(d)>>32, lo) + +#define GET_FLOAT_WORD(w,d) \ +do { \ + (w) = asuint(d); \ +} while (0) + +#define SET_FLOAT_WORD(d,w) \ +do { \ + (d) = asfloat(w); \ +} while (0) + +hidden int __rem_pio2_large(double*,double*,int,int,int); + +hidden int __rem_pio2(double,double*); +hidden double __sin(double,double,int); +hidden double __cos(double,double); +hidden double __tan(double,double,int); +hidden double __expo2(double,double); + +hidden int __rem_pio2f(float,double*); +hidden float __sindf(double); +hidden float __cosdf(double); +hidden float __tandf(double,int); +hidden float __expo2f(float,float); + +hidden int __rem_pio2l(long double, long double *); +hidden long double __sinl(long double, long double, int); +hidden long double __cosl(long double, long double); +hidden long double __tanl(long double, long double, int); + +hidden long double __polevll(long double, const long double *, int); +hidden long double __p1evll(long double, const long double *, int); + +extern int __signgam; +hidden double __lgamma_r(double, int *); +hidden float __lgammaf_r(float, int *); + +/* error handling functions */ +hidden float __math_xflowf(uint32_t, float); +hidden float __math_uflowf(uint32_t); +hidden float __math_oflowf(uint32_t); +hidden float __math_divzerof(uint32_t); +hidden float __math_invalidf(float); +hidden double __math_xflow(uint32_t, double); +hidden double __math_uflow(uint32_t); +hidden double __math_oflow(uint32_t); +hidden double __math_divzero(uint32_t); +hidden double __math_invalid(double); +#if LDBL_MANT_DIG != DBL_MANT_DIG +hidden long double __math_invalidl(long double); +#endif + +#endif diff --git a/external/musl/ldexp.c b/external/musl/ldexp.c new file mode 100644 index 0000000..2b49bd9 --- /dev/null +++ b/external/musl/ldexp.c @@ -0,0 +1,6 @@ +#include + +double __cdecl ldexp(double x, int n) +{ + return scalbn(x, n); +} diff --git a/external/musl/log1p.c b/external/musl/log1p.c new file mode 100644 index 0000000..e206f17 --- /dev/null +++ b/external/musl/log1p.c @@ -0,0 +1,126 @@ +/* origin: FreeBSD /usr/src/lib/msun/src/s_log1p.c */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ +/* double log1p(double x) + * Return the natural logarithm of 1+x. + * + * Method : + * 1. Argument Reduction: find k and f such that + * 1+x = 2^k * (1+f), + * where sqrt(2)/2 < 1+f < sqrt(2) . + * + * Note. If k=0, then f=x is exact. However, if k!=0, then f + * may not be representable exactly. In that case, a correction + * term is need. Let u=1+x rounded. Let c = (1+x)-u, then + * log(1+x) - log(u) ~ c/u. Thus, we proceed to compute log(u), + * and add back the correction term c/u. + * (Note: when x > 2**53, one can simply return log(x)) + * + * 2. Approximation of log(1+f): See log.c + * + * 3. Finally, log1p(x) = k*ln2 + log(1+f) + c/u. See log.c + * + * Special cases: + * log1p(x) is NaN with signal if x < -1 (including -INF) ; + * log1p(+INF) is +INF; log1p(-1) is -INF with signal; + * log1p(NaN) is that NaN with no signal. + * + * Accuracy: + * according to an error analysis, the error is always less than + * 1 ulp (unit in the last place). + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + * + * Note: Assuming log() return accurate answer, the following + * algorithm can be used to compute log1p(x) to within a few ULP: + * + * u = 1+x; + * if(u==1.0) return x ; else + * return log(u)*(x/(u-1.0)); + * + * See HP-15C Advanced Functions Handbook, p.193. + */ + +#include "libm.h" + +static const double +ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */ +ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */ +Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */ +Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */ +Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */ +Lg4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */ +Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */ +Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */ +Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ + +double __cdecl log1p(double x) +{ + union {double f; uint64_t i;} u = {x}; + double_t hfsq,f,c,s,z,R,w,t1,t2,dk; + uint32_t hx,hu; + int k; + + hx = u.i>>32; + k = 1; + if (hx < 0x3fda827a || hx>>31) { /* 1+x < sqrt(2)+ */ + if (hx >= 0xbff00000) { /* x <= -1.0 */ + if (x == -1) { + errno = ERANGE; + return x/0.0; /* log1p(-1) = -inf */ + } + errno = EDOM; + return (x-x)/0.0; /* log1p(x<-1) = NaN */ + } + if (hx<<1 < 0x3ca00000<<1) { /* |x| < 2**-53 */ + fp_barrier(x + 0x1p120f); + /* underflow if subnormal */ + if ((hx&0x7ff00000) == 0) + FORCE_EVAL((float)x); + return x; + } + if (hx <= 0xbfd2bec4) { /* sqrt(2)/2- <= 1+x < sqrt(2)+ */ + k = 0; + c = 0; + f = x; + } + } else if (hx >= 0x7ff00000) + return x; + if (k) { + u.f = 1 + x; + hu = u.i>>32; + hu += 0x3ff00000 - 0x3fe6a09e; + k = (int)(hu>>20) - 0x3ff; + /* correction term ~ log(1+x)-log(u), avoid underflow in c/u */ + if (k < 54) { + c = k >= 2 ? 1-(u.f-x) : x-(u.f-1); + c /= u.f; + } else + c = 0; + /* reduce u into [sqrt(2)/2, sqrt(2)] */ + hu = (hu&0x000fffff) + 0x3fe6a09e; + u.i = (uint64_t)hu<<32 | (u.i&0xffffffff); + f = u.f - 1; + } + hfsq = 0.5*f*f; + s = f/(2.0+f); + z = s*s; + w = z*z; + t1 = w*(Lg2+w*(Lg4+w*Lg6)); + t2 = z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); + R = t2 + t1; + dk = k; + return s*(hfsq+R) + (dk*ln2_lo+c) - hfsq + f + dk*ln2_hi; +} diff --git a/external/musl/log2.c b/external/musl/log2.c new file mode 100644 index 0000000..988d97b --- /dev/null +++ b/external/musl/log2.c @@ -0,0 +1,128 @@ +/* + * Double-precision log2(x) function. + * + * Copyright (c) 2018, Arm Limited. + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include "libm.h" +#include "log2_data.h" + +#define T __log2_data.tab +#define T2 __log2_data.tab2 +#define B __log2_data.poly1 +#define A __log2_data.poly +#define InvLn2hi __log2_data.invln2hi +#define InvLn2lo __log2_data.invln2lo +#define N (1 << LOG2_TABLE_BITS) +#define OFF 0x3fe6000000000000 + +/* Top 16 bits of a double. */ +static inline uint32_t top16(double x) +{ + return asuint64(x) >> 48; +} + +double __cdecl log2(double x) +{ + double_t z, r, r2, r4, y, invc, logc, kd, hi, lo, t1, t2, t3, p; + uint64_t ix, iz, tmp; + uint32_t top; + int k, i; + + ix = asuint64(x); + top = top16(x); +#define LO asuint64(1.0 - 0x1.5b51p-5) +#define HI asuint64(1.0 + 0x1.6ab2p-5) + if (predict_false(ix - LO < HI - LO)) { + /* Handle close to 1.0 inputs separately. */ + /* Fix sign of zero with downward rounding when x==1. */ + if (WANT_ROUNDING && predict_false(ix == asuint64(1.0))) + return 0; + r = x - 1.0; +#if __FP_FAST_FMA + hi = r * InvLn2hi; + lo = r * InvLn2lo + __builtin_fma(r, InvLn2hi, -hi); +#else + double_t rhi, rlo; + rhi = asdouble(asuint64(r) & -1ULL << 32); + rlo = r - rhi; + hi = rhi * InvLn2hi; + lo = rlo * InvLn2hi + r * InvLn2lo; +#endif + r2 = r * r; /* rounding error: 0x1p-62. */ + r4 = r2 * r2; + /* Worst-case error is less than 0.54 ULP (0.55 ULP without fma). */ + p = r2 * (B[0] + r * B[1]); + y = hi + p; + lo += hi - y + p; + lo += r4 * (B[2] + r * B[3] + r2 * (B[4] + r * B[5]) + + r4 * (B[6] + r * B[7] + r2 * (B[8] + r * B[9]))); + y += lo; + return eval_as_double(y); + } + if (predict_false(top - 0x0010 >= 0x7ff0 - 0x0010)) { + /* x < 0x1p-1022 or inf or nan. */ + if (ix * 2 == 0) { + errno = ERANGE; + return __math_divzero(1); + } + if (ix == asuint64(INFINITY)) /* log(inf) == inf. */ + return x; + if ((top & 0x7ff0) == 0x7ff0 && (ix & 0xfffffffffffffULL)) + return x; + if (top & 0x8000) { + errno = EDOM; + return __math_invalid(x); + } + /* x is subnormal, normalize it. */ + ix = asuint64(x * 0x1p52); + ix -= 52ULL << 52; + } + + /* x = 2^k z; where z is in range [OFF,2*OFF) and exact. + The range is split into N subintervals. + The ith subinterval contains z and c is near its center. */ + tmp = ix - OFF; + i = (tmp >> (52 - LOG2_TABLE_BITS)) % N; + k = (int64_t)tmp >> 52; /* arithmetic shift */ + iz = ix - (tmp & 0xfffULL << 52); + invc = T[i].invc; + logc = T[i].logc; + z = asdouble(iz); + kd = (double_t)k; + + /* log2(x) = log2(z/c) + log2(c) + k. */ + /* r ~= z/c - 1, |r| < 1/(2*N). */ +#if __FP_FAST_FMA + /* rounding error: 0x1p-55/N. */ + r = __builtin_fma(z, invc, -1.0); + t1 = r * InvLn2hi; + t2 = r * InvLn2lo + __builtin_fma(r, InvLn2hi, -t1); +#else + double_t rhi, rlo; + /* rounding error: 0x1p-55/N + 0x1p-65. */ + r = (z - T2[i].chi - T2[i].clo) * invc; + rhi = asdouble(asuint64(r) & -1ULL << 32); + rlo = r - rhi; + t1 = rhi * InvLn2hi; + t2 = rlo * InvLn2hi + r * InvLn2lo; +#endif + + /* hi + lo = r/ln2 + log2(c) + k. */ + t3 = kd + logc; + hi = t3 + t1; + lo = t3 - hi + t1 + t2; + + /* log2(r+1) = r/ln2 + r^2*poly(r). */ + /* Evaluation is optimized assuming superscalar pipelined execution. */ + r2 = r * r; /* rounding error: 0x1p-54/N^2. */ + r4 = r2 * r2; + /* Worst-case error if |y| > 0x1p-4: 0.547 ULP (0.550 ULP without fma). + ~ 0.5 + 2/N/ln2 + abs-poly-error*0x1p56 ULP (+ 0.003 ULP without fma). */ + p = A[0] + r * A[1] + r2 * (A[2] + r * A[3]) + r4 * (A[4] + r * A[5]); + y = lo + r2 * p + hi; + return eval_as_double(y); +} diff --git a/external/musl/log2_data.c b/external/musl/log2_data.c new file mode 100644 index 0000000..3dd1ca5 --- /dev/null +++ b/external/musl/log2_data.c @@ -0,0 +1,201 @@ +/* + * Data for log2. + * + * Copyright (c) 2018, Arm Limited. + * SPDX-License-Identifier: MIT + */ + +#include "log2_data.h" + +#define N (1 << LOG2_TABLE_BITS) + +const struct log2_data __log2_data = { +// First coefficient: 0x1.71547652b82fe1777d0ffda0d24p0 +.invln2hi = 0x1.7154765200000p+0, +.invln2lo = 0x1.705fc2eefa200p-33, +.poly1 = { +// relative error: 0x1.2fad8188p-63 +// in -0x1.5b51p-5 0x1.6ab2p-5 +-0x1.71547652b82fep-1, +0x1.ec709dc3a03f7p-2, +-0x1.71547652b7c3fp-2, +0x1.2776c50f05be4p-2, +-0x1.ec709dd768fe5p-3, +0x1.a61761ec4e736p-3, +-0x1.7153fbc64a79bp-3, +0x1.484d154f01b4ap-3, +-0x1.289e4a72c383cp-3, +0x1.0b32f285aee66p-3, +}, +.poly = { +// relative error: 0x1.a72c2bf8p-58 +// abs error: 0x1.67a552c8p-66 +// in -0x1.f45p-8 0x1.f45p-8 +-0x1.71547652b8339p-1, +0x1.ec709dc3a04bep-2, +-0x1.7154764702ffbp-2, +0x1.2776c50034c48p-2, +-0x1.ec7b328ea92bcp-3, +0x1.a6225e117f92ep-3, +}, +/* Algorithm: + + x = 2^k z + log2(x) = k + log2(c) + log2(z/c) + log2(z/c) = poly(z/c - 1) + +where z is in [1.6p-1; 1.6p0] which is split into N subintervals and z falls +into the ith one, then table entries are computed as + + tab[i].invc = 1/c + tab[i].logc = (double)log2(c) + tab2[i].chi = (double)c + tab2[i].clo = (double)(c - (double)c) + +where c is near the center of the subinterval and is chosen by trying +-2^29 +floating point invc candidates around 1/center and selecting one for which + + 1) the rounding error in 0x1.8p10 + logc is 0, + 2) the rounding error in z - chi - clo is < 0x1p-64 and + 3) the rounding error in (double)log2(c) is minimized (< 0x1p-68). + +Note: 1) ensures that k + logc can be computed without rounding error, 2) +ensures that z/c - 1 can be computed as (z - chi - clo)*invc with close to a +single rounding error when there is no fast fma for z*invc - 1, 3) ensures +that logc + poly(z/c - 1) has small error, however near x == 1 when +|log2(x)| < 0x1p-4, this is not enough so that is special cased. */ +.tab = { +{0x1.724286bb1acf8p+0, -0x1.1095feecdb000p-1}, +{0x1.6e1f766d2cca1p+0, -0x1.08494bd76d000p-1}, +{0x1.6a13d0e30d48ap+0, -0x1.00143aee8f800p-1}, +{0x1.661ec32d06c85p+0, -0x1.efec5360b4000p-2}, +{0x1.623fa951198f8p+0, -0x1.dfdd91ab7e000p-2}, +{0x1.5e75ba4cf026cp+0, -0x1.cffae0cc79000p-2}, +{0x1.5ac055a214fb8p+0, -0x1.c043811fda000p-2}, +{0x1.571ed0f166e1ep+0, -0x1.b0b67323ae000p-2}, +{0x1.53909590bf835p+0, -0x1.a152f5a2db000p-2}, +{0x1.5014fed61adddp+0, -0x1.9217f5af86000p-2}, +{0x1.4cab88e487bd0p+0, -0x1.8304db0719000p-2}, +{0x1.49539b4334feep+0, -0x1.74189f9a9e000p-2}, +{0x1.460cbdfafd569p+0, -0x1.6552bb5199000p-2}, +{0x1.42d664ee4b953p+0, -0x1.56b23a29b1000p-2}, +{0x1.3fb01111dd8a6p+0, -0x1.483650f5fa000p-2}, +{0x1.3c995b70c5836p+0, -0x1.39de937f6a000p-2}, +{0x1.3991c4ab6fd4ap+0, -0x1.2baa1538d6000p-2}, +{0x1.3698e0ce099b5p+0, -0x1.1d98340ca4000p-2}, +{0x1.33ae48213e7b2p+0, -0x1.0fa853a40e000p-2}, +{0x1.30d191985bdb1p+0, -0x1.01d9c32e73000p-2}, +{0x1.2e025cab271d7p+0, -0x1.e857da2fa6000p-3}, +{0x1.2b404cf13cd82p+0, -0x1.cd3c8633d8000p-3}, +{0x1.288b02c7ccb50p+0, -0x1.b26034c14a000p-3}, +{0x1.25e2263944de5p+0, -0x1.97c1c2f4fe000p-3}, +{0x1.234563d8615b1p+0, -0x1.7d6023f800000p-3}, +{0x1.20b46e33eaf38p+0, -0x1.633a71a05e000p-3}, +{0x1.1e2eefdcda3ddp+0, -0x1.494f5e9570000p-3}, +{0x1.1bb4a580b3930p+0, -0x1.2f9e424e0a000p-3}, +{0x1.19453847f2200p+0, -0x1.162595afdc000p-3}, +{0x1.16e06c0d5d73cp+0, -0x1.f9c9a75bd8000p-4}, +{0x1.1485f47b7e4c2p+0, -0x1.c7b575bf9c000p-4}, +{0x1.12358ad0085d1p+0, -0x1.960c60ff48000p-4}, +{0x1.0fef00f532227p+0, -0x1.64ce247b60000p-4}, +{0x1.0db2077d03a8fp+0, -0x1.33f78b2014000p-4}, +{0x1.0b7e6d65980d9p+0, -0x1.0387d1a42c000p-4}, +{0x1.0953efe7b408dp+0, -0x1.a6f9208b50000p-5}, +{0x1.07325cac53b83p+0, -0x1.47a954f770000p-5}, +{0x1.05197e40d1b5cp+0, -0x1.d23a8c50c0000p-6}, +{0x1.03091c1208ea2p+0, -0x1.16a2629780000p-6}, +{0x1.0101025b37e21p+0, -0x1.720f8d8e80000p-8}, +{0x1.fc07ef9caa76bp-1, 0x1.6fe53b1500000p-7}, +{0x1.f4465d3f6f184p-1, 0x1.11ccce10f8000p-5}, +{0x1.ecc079f84107fp-1, 0x1.c4dfc8c8b8000p-5}, +{0x1.e573a99975ae8p-1, 0x1.3aa321e574000p-4}, +{0x1.de5d6f0bd3de6p-1, 0x1.918a0d08b8000p-4}, +{0x1.d77b681ff38b3p-1, 0x1.e72e9da044000p-4}, +{0x1.d0cb5724de943p-1, 0x1.1dcd2507f6000p-3}, +{0x1.ca4b2dc0e7563p-1, 0x1.476ab03dea000p-3}, +{0x1.c3f8ee8d6cb51p-1, 0x1.7074377e22000p-3}, +{0x1.bdd2b4f020c4cp-1, 0x1.98ede8ba94000p-3}, +{0x1.b7d6c006015cap-1, 0x1.c0db86ad2e000p-3}, +{0x1.b20366e2e338fp-1, 0x1.e840aafcee000p-3}, +{0x1.ac57026295039p-1, 0x1.0790ab4678000p-2}, +{0x1.a6d01bc2731ddp-1, 0x1.1ac056801c000p-2}, +{0x1.a16d3bc3ff18bp-1, 0x1.2db11d4fee000p-2}, +{0x1.9c2d14967feadp-1, 0x1.406464ec58000p-2}, +{0x1.970e4f47c9902p-1, 0x1.52dbe093af000p-2}, +{0x1.920fb3982bcf2p-1, 0x1.651902050d000p-2}, +{0x1.8d30187f759f1p-1, 0x1.771d2cdeaf000p-2}, +{0x1.886e5ebb9f66dp-1, 0x1.88e9c857d9000p-2}, +{0x1.83c97b658b994p-1, 0x1.9a80155e16000p-2}, +{0x1.7f405ffc61022p-1, 0x1.abe186ed3d000p-2}, +{0x1.7ad22181415cap-1, 0x1.bd0f2aea0e000p-2}, +{0x1.767dcf99eff8cp-1, 0x1.ce0a43dbf4000p-2}, +}, +#if !__FP_FAST_FMA +.tab2 = { +{0x1.6200012b90a8ep-1, 0x1.904ab0644b605p-55}, +{0x1.66000045734a6p-1, 0x1.1ff9bea62f7a9p-57}, +{0x1.69fffc325f2c5p-1, 0x1.27ecfcb3c90bap-55}, +{0x1.6e00038b95a04p-1, 0x1.8ff8856739326p-55}, +{0x1.71fffe09994e3p-1, 0x1.afd40275f82b1p-55}, +{0x1.7600015590e1p-1, -0x1.2fd75b4238341p-56}, +{0x1.7a00012655bd5p-1, 0x1.808e67c242b76p-56}, +{0x1.7e0003259e9a6p-1, -0x1.208e426f622b7p-57}, +{0x1.81fffedb4b2d2p-1, -0x1.402461ea5c92fp-55}, +{0x1.860002dfafcc3p-1, 0x1.df7f4a2f29a1fp-57}, +{0x1.89ffff78c6b5p-1, -0x1.e0453094995fdp-55}, +{0x1.8e00039671566p-1, -0x1.a04f3bec77b45p-55}, +{0x1.91fffe2bf1745p-1, -0x1.7fa34400e203cp-56}, +{0x1.95fffcc5c9fd1p-1, -0x1.6ff8005a0695dp-56}, +{0x1.9a0003bba4767p-1, 0x1.0f8c4c4ec7e03p-56}, +{0x1.9dfffe7b92da5p-1, 0x1.e7fd9478c4602p-55}, +{0x1.a1fffd72efdafp-1, -0x1.a0c554dcdae7ep-57}, +{0x1.a5fffde04ff95p-1, 0x1.67da98ce9b26bp-55}, +{0x1.a9fffca5e8d2bp-1, -0x1.284c9b54c13dep-55}, +{0x1.adfffddad03eap-1, 0x1.812c8ea602e3cp-58}, +{0x1.b1ffff10d3d4dp-1, -0x1.efaddad27789cp-55}, +{0x1.b5fffce21165ap-1, 0x1.3cb1719c61237p-58}, +{0x1.b9fffd950e674p-1, 0x1.3f7d94194cep-56}, +{0x1.be000139ca8afp-1, 0x1.50ac4215d9bcp-56}, +{0x1.c20005b46df99p-1, 0x1.beea653e9c1c9p-57}, +{0x1.c600040b9f7aep-1, -0x1.c079f274a70d6p-56}, +{0x1.ca0006255fd8ap-1, -0x1.a0b4076e84c1fp-56}, +{0x1.cdfffd94c095dp-1, 0x1.8f933f99ab5d7p-55}, +{0x1.d1ffff975d6cfp-1, -0x1.82c08665fe1bep-58}, +{0x1.d5fffa2561c93p-1, -0x1.b04289bd295f3p-56}, +{0x1.d9fff9d228b0cp-1, 0x1.70251340fa236p-55}, +{0x1.de00065bc7e16p-1, -0x1.5011e16a4d80cp-56}, +{0x1.e200002f64791p-1, 0x1.9802f09ef62ep-55}, +{0x1.e600057d7a6d8p-1, -0x1.e0b75580cf7fap-56}, +{0x1.ea00027edc00cp-1, -0x1.c848309459811p-55}, +{0x1.ee0006cf5cb7cp-1, -0x1.f8027951576f4p-55}, +{0x1.f2000782b7dccp-1, -0x1.f81d97274538fp-55}, +{0x1.f6000260c450ap-1, -0x1.071002727ffdcp-59}, +{0x1.f9fffe88cd533p-1, -0x1.81bdce1fda8bp-58}, +{0x1.fdfffd50f8689p-1, 0x1.7f91acb918e6ep-55}, +{0x1.0200004292367p+0, 0x1.b7ff365324681p-54}, +{0x1.05fffe3e3d668p+0, 0x1.6fa08ddae957bp-55}, +{0x1.0a0000a85a757p+0, -0x1.7e2de80d3fb91p-58}, +{0x1.0e0001a5f3fccp+0, -0x1.1823305c5f014p-54}, +{0x1.11ffff8afbaf5p+0, -0x1.bfabb6680bac2p-55}, +{0x1.15fffe54d91adp+0, -0x1.d7f121737e7efp-54}, +{0x1.1a00011ac36e1p+0, 0x1.c000a0516f5ffp-54}, +{0x1.1e00019c84248p+0, -0x1.082fbe4da5dap-54}, +{0x1.220000ffe5e6ep+0, -0x1.8fdd04c9cfb43p-55}, +{0x1.26000269fd891p+0, 0x1.cfe2a7994d182p-55}, +{0x1.2a00029a6e6dap+0, -0x1.00273715e8bc5p-56}, +{0x1.2dfffe0293e39p+0, 0x1.b7c39dab2a6f9p-54}, +{0x1.31ffff7dcf082p+0, 0x1.df1336edc5254p-56}, +{0x1.35ffff05a8b6p+0, -0x1.e03564ccd31ebp-54}, +{0x1.3a0002e0eaeccp+0, 0x1.5f0e74bd3a477p-56}, +{0x1.3e000043bb236p+0, 0x1.c7dcb149d8833p-54}, +{0x1.4200002d187ffp+0, 0x1.e08afcf2d3d28p-56}, +{0x1.460000d387cb1p+0, 0x1.20837856599a6p-55}, +{0x1.4a00004569f89p+0, -0x1.9fa5c904fbcd2p-55}, +{0x1.4e000043543f3p+0, -0x1.81125ed175329p-56}, +{0x1.51fffcc027f0fp+0, 0x1.883d8847754dcp-54}, +{0x1.55ffffd87b36fp+0, -0x1.709e731d02807p-55}, +{0x1.59ffff21df7bap+0, 0x1.7f79f68727b02p-55}, +{0x1.5dfffebfc3481p+0, -0x1.180902e30e93ep-54}, +}, +#endif +}; diff --git a/external/musl/log2_data.h b/external/musl/log2_data.h new file mode 100644 index 0000000..276a786 --- /dev/null +++ b/external/musl/log2_data.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018, Arm Limited. + * SPDX-License-Identifier: MIT + */ +#ifndef _LOG2_DATA_H +#define _LOG2_DATA_H + +#include + +#define LOG2_TABLE_BITS 6 +#define LOG2_POLY_ORDER 7 +#define LOG2_POLY1_ORDER 11 +extern hidden const struct log2_data { + double invln2hi; + double invln2lo; + double poly[LOG2_POLY_ORDER - 1]; + double poly1[LOG2_POLY1_ORDER - 1]; + struct { + double invc, logc; + } tab[1 << LOG2_TABLE_BITS]; +#if !__FP_FAST_FMA + struct { + double chi, clo; + } tab2[1 << LOG2_TABLE_BITS]; +#endif +} __log2_data; + +#endif diff --git a/external/musl/scalbn.c b/external/musl/scalbn.c new file mode 100644 index 0000000..20f7116 --- /dev/null +++ b/external/musl/scalbn.c @@ -0,0 +1,34 @@ +#include +#include +#include "libm.h" + +double __cdecl scalbn(double x, int n) +{ + union {double f; uint64_t i;} u; + double_t y = x; + + if (n > 1023) { + y *= 0x1p1023; + n -= 1023; + if (n > 1023) { + y *= 0x1p1023; + n -= 1023; + if (n > 1023) + n = 1023; + } + } else if (n < -1022) { + /* make sure final n < -53 to avoid double + rounding in the subnormal range */ + y *= 0x1p-1022 * 0x1p53; + n += 1022 - 53; + if (n < -1022) { + y *= 0x1p-1022 * 0x1p53; + n += 1022 - 53; + if (n < -1022) + n = -1022; + } + } + u.i = (uint64_t)(0x3ff+n)<<52; + x = y * u.f; + return x; +} diff --git a/external/musl/sin.c b/external/musl/sin.c new file mode 100644 index 0000000..4bbc2ee --- /dev/null +++ b/external/musl/sin.c @@ -0,0 +1,80 @@ +/* origin: FreeBSD /usr/src/lib/msun/src/s_sin.c */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ +/* sin(x) + * Return sine function of x. + * + * kernel function: + * __sin ... sine function on [-pi/4,pi/4] + * __cos ... cose function on [-pi/4,pi/4] + * __rem_pio2 ... argument reduction routine + * + * Method. + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * in [-pi/4 , +pi/4], and let n = k mod 4. + * We have + * + * n sin(x) cos(x) tan(x) + * ---------------------------------------------------------- + * 0 S C T + * 1 C -S -1/T + * 2 -S -C T + * 3 -C S -1/T + * ---------------------------------------------------------- + * + * Special cases: + * Let trig be any of sin, cos, or tan. + * trig(+-INF) is NaN, with signals; + * trig(NaN) is that NaN; + * + * Accuracy: + * TRIG(x) returns trig(x) nearly rounded + */ + +#include "libm.h" + +double __cdecl sin(double x) +{ + double y[2]; + uint32_t ix; + unsigned n; + + /* High word of x. */ + GET_HIGH_WORD(ix, x); + ix &= 0x7fffffff; + + /* |x| ~< pi/4 */ + if (ix <= 0x3fe921fb) { + if (ix < 0x3e500000) { /* |x| < 2**-26 */ + /* raise inexact if x != 0 and underflow if subnormal*/ + FORCE_EVAL(ix < 0x00100000 ? x/0x1p120f : x+0x1p120f); + return x; + } + return __sin(x, 0.0, 0); + } + + /* sin(Inf or NaN) is NaN */ + if (isinf(x)) + return math_error(_DOMAIN, "sin", x, 0, x - x); + if (ix >= 0x7ff00000) + return x - x; + + /* argument reduction needed */ + n = __rem_pio2(x, y); + switch (n&3) { + case 0: return __sin(y[0], y[1], 1); + case 1: return __cos(y[0], y[1]); + case 2: return -__sin(y[0], y[1], 1); + default: + return -__cos(y[0], y[1]); + } +} diff --git a/external/musl/sincos.c b/external/musl/sincos.c new file mode 100644 index 0000000..c8d866b --- /dev/null +++ b/external/musl/sincos.c @@ -0,0 +1,69 @@ +/* origin: FreeBSD /usr/src/lib/msun/src/s_sin.c */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#define _GNU_SOURCE +#include "libm.h" + +void __cdecl sincos(double x, double *sin, double *cos) +{ + double y[2], s, c; + uint32_t ix; + unsigned n; + + GET_HIGH_WORD(ix, x); + ix &= 0x7fffffff; + + /* |x| ~< pi/4 */ + if (ix <= 0x3fe921fb) { + /* if |x| < 2**-27 * sqrt(2) */ + if (ix < 0x3e46a09e) { + /* raise inexact if x!=0 and underflow if subnormal */ + FORCE_EVAL(ix < 0x00100000 ? x/0x1p120f : x+0x1p120f); + *sin = x; + *cos = 1.0; + return; + } + *sin = __sin(x, 0.0, 0); + *cos = __cos(x, 0.0); + return; + } + + /* sincos(Inf or NaN) is NaN */ + if (ix >= 0x7ff00000) { + *sin = *cos = x - x; + return; + } + + /* argument reduction needed */ + n = __rem_pio2(x, y); + s = __sin(y[0], y[1], 1); + c = __cos(y[0], y[1]); + switch (n&3) { + case 0: + *sin = s; + *cos = c; + break; + case 1: + *sin = c; + *cos = -s; + break; + case 2: + *sin = -s; + *cos = -c; + break; + case 3: + default: + *sin = -c; + *cos = s; + break; + } +} diff --git a/external/musl/sqrt.c b/external/musl/sqrt.c new file mode 100644 index 0000000..beee70a --- /dev/null +++ b/external/musl/sqrt.c @@ -0,0 +1,158 @@ +#include +#include +#include "libm.h" +#include "sqrt_data.h" + +#define FENV_SUPPORT 1 + +/* returns a*b*2^-32 - e, with error 0 <= e < 1. */ +static inline uint32_t mul32(uint32_t a, uint32_t b) +{ + return (uint64_t)a*b >> 32; +} + +/* returns a*b*2^-64 - e, with error 0 <= e < 3. */ +static inline uint64_t mul64(uint64_t a, uint64_t b) +{ + uint64_t ahi = a>>32; + uint64_t alo = a&0xffffffff; + uint64_t bhi = b>>32; + uint64_t blo = b&0xffffffff; + return ahi*bhi + (ahi*blo >> 32) + (alo*bhi >> 32); +} + +double __cdecl sqrt(double x) +{ + uint64_t ix, top, m; + + /* special case handling. */ + ix = asuint64(x); + top = ix >> 52; + if (predict_false(top - 0x001 >= 0x7ff - 0x001)) { + /* x < 0x1p-1022 or inf or nan. */ + if (ix * 2 == 0) + return x; + if (ix == 0x7ff0000000000000) + return x; + if (ix > 0x7ff0000000000000) + return math_error(_DOMAIN, "sqrt", x, 0, (x - x) / (x - x)); + /* x is subnormal, normalize it. */ + ix = asuint64(x * 0x1p52); + top = ix >> 52; + top -= 52; + } + + /* argument reduction: + x = 4^e m; with integer e, and m in [1, 4) + m: fixed point representation [2.62] + 2^e is the exponent part of the result. */ + int even = top & 1; + m = (ix << 11) | 0x8000000000000000; + if (even) m >>= 1; + top = (top + 0x3ff) >> 1; + + /* approximate r ~ 1/sqrt(m) and s ~ sqrt(m) when m in [1,4) + + initial estimate: + 7bit table lookup (1bit exponent and 6bit significand). + + iterative approximation: + using 2 goldschmidt iterations with 32bit int arithmetics + and a final iteration with 64bit int arithmetics. + + details: + + the relative error (e = r0 sqrt(m)-1) of a linear estimate + (r0 = a m + b) is |e| < 0.085955 ~ 0x1.6p-4 at best, + a table lookup is faster and needs one less iteration + 6 bit lookup table (128b) gives |e| < 0x1.f9p-8 + 7 bit lookup table (256b) gives |e| < 0x1.fdp-9 + for single and double prec 6bit is enough but for quad + prec 7bit is needed (or modified iterations). to avoid + one more iteration >=13bit table would be needed (16k). + + a newton-raphson iteration for r is + w = r*r + u = 3 - m*w + r = r*u/2 + can use a goldschmidt iteration for s at the end or + s = m*r + + first goldschmidt iteration is + s = m*r + u = 3 - s*r + r = r*u/2 + s = s*u/2 + next goldschmidt iteration is + u = 3 - s*r + r = r*u/2 + s = s*u/2 + and at the end r is not computed only s. + + they use the same amount of operations and converge at the + same quadratic rate, i.e. if + r1 sqrt(m) - 1 = e, then + r2 sqrt(m) - 1 = -3/2 e^2 - 1/2 e^3 + the advantage of goldschmidt is that the mul for s and r + are independent (computed in parallel), however it is not + "self synchronizing": it only uses the input m in the + first iteration so rounding errors accumulate. at the end + or when switching to larger precision arithmetics rounding + errors dominate so the first iteration should be used. + + the fixed point representations are + m: 2.30 r: 0.32, s: 2.30, d: 2.30, u: 2.30, three: 2.30 + and after switching to 64 bit + m: 2.62 r: 0.64, s: 2.62, d: 2.62, u: 2.62, three: 2.62 */ + + static const uint64_t three = 0xc0000000; + uint64_t r, s, d, u, i; + + i = (ix >> 46) % 128; + r = (uint32_t)__rsqrt_tab[i] << 16; + /* |r sqrt(m) - 1| < 0x1.fdp-9 */ + s = mul32(m>>32, r); + /* |s/sqrt(m) - 1| < 0x1.fdp-9 */ + d = mul32(s, r); + u = three - d; + r = mul32(r, u) << 1; + /* |r sqrt(m) - 1| < 0x1.7bp-16 */ + s = mul32(s, u) << 1; + /* |s/sqrt(m) - 1| < 0x1.7bp-16 */ + d = mul32(s, r); + u = three - d; + r = mul32(r, u) << 1; + /* |r sqrt(m) - 1| < 0x1.3704p-29 (measured worst-case) */ + r = r << 32; + s = mul64(m, r); + d = mul64(s, r); + u = (three<<32) - d; + s = mul64(s, u); /* repr: 3.61 */ + /* -0x1p-57 < s - sqrt(m) < 0x1.8001p-61 */ + s = (s - 2) >> 9; /* repr: 12.52 */ + /* -0x1.09p-52 < s - sqrt(m) < -0x1.fffcp-63 */ + + /* s < sqrt(m) < s + 0x1.09p-52, + compute nearest rounded result: + the nearest result to 52 bits is either s or s+0x1p-52, + we can decide by comparing (2^52 s + 0.5)^2 to 2^104 m. */ + uint64_t d0, d1, d2; + double y, t; + d0 = (m << 42) - s*s; + d1 = s - d0; + d2 = d1 + s + 1; + s += d1 >> 63; + s &= 0x000fffffffffffff; + s |= top << 52; + y = asdouble(s); + if (FENV_SUPPORT) { + /* handle rounding modes and inexact exception: + only (s+1)^2 == 2^42 m case is exact otherwise + add a tiny value to cause the fenv effects. */ + uint64_t tiny = predict_false(d2==0) ? 0 : 0x0010000000000000; + tiny |= (d1^d2) & 0x8000000000000000; + t = asdouble(tiny); + y = eval_as_double(y + t); + } + return y; +} diff --git a/external/musl/sqrt_data.c b/external/musl/sqrt_data.c new file mode 100644 index 0000000..61bc22f --- /dev/null +++ b/external/musl/sqrt_data.c @@ -0,0 +1,19 @@ +#include "sqrt_data.h" +const uint16_t __rsqrt_tab[128] = { +0xb451,0xb2f0,0xb196,0xb044,0xaef9,0xadb6,0xac79,0xab43, +0xaa14,0xa8eb,0xa7c8,0xa6aa,0xa592,0xa480,0xa373,0xa26b, +0xa168,0xa06a,0x9f70,0x9e7b,0x9d8a,0x9c9d,0x9bb5,0x9ad1, +0x99f0,0x9913,0x983a,0x9765,0x9693,0x95c4,0x94f8,0x9430, +0x936b,0x92a9,0x91ea,0x912e,0x9075,0x8fbe,0x8f0a,0x8e59, +0x8daa,0x8cfe,0x8c54,0x8bac,0x8b07,0x8a64,0x89c4,0x8925, +0x8889,0x87ee,0x8756,0x86c0,0x862b,0x8599,0x8508,0x8479, +0x83ec,0x8361,0x82d8,0x8250,0x81c9,0x8145,0x80c2,0x8040, +0xff02,0xfd0e,0xfb25,0xf947,0xf773,0xf5aa,0xf3ea,0xf234, +0xf087,0xeee3,0xed47,0xebb3,0xea27,0xe8a3,0xe727,0xe5b2, +0xe443,0xe2dc,0xe17a,0xe020,0xdecb,0xdd7d,0xdc34,0xdaf1, +0xd9b3,0xd87b,0xd748,0xd61a,0xd4f1,0xd3cd,0xd2ad,0xd192, +0xd07b,0xcf69,0xce5b,0xcd51,0xcc4a,0xcb48,0xca4a,0xc94f, +0xc858,0xc764,0xc674,0xc587,0xc49d,0xc3b7,0xc2d4,0xc1f4, +0xc116,0xc03c,0xbf65,0xbe90,0xbdbe,0xbcef,0xbc23,0xbb59, +0xba91,0xb9cc,0xb90a,0xb84a,0xb78c,0xb6d0,0xb617,0xb560, +}; diff --git a/external/musl/sqrt_data.h b/external/musl/sqrt_data.h new file mode 100644 index 0000000..260c7f9 --- /dev/null +++ b/external/musl/sqrt_data.h @@ -0,0 +1,13 @@ +#ifndef _SQRT_DATA_H +#define _SQRT_DATA_H + +#include +#include + +/* if x in [1,2): i = (int)(64*x); + if x in [2,4): i = (int)(32*x-64); + __rsqrt_tab[i]*2^-16 is estimating 1/sqrt(x) with small relative error: + |__rsqrt_tab[i]*0x1p-16*sqrt(x) - 1| < -0x1.fdp-9 < 2^-8 */ +extern hidden const uint16_t __rsqrt_tab[128]; + +#endif diff --git a/external/musl/sqrtf.c b/external/musl/sqrtf.c new file mode 100644 index 0000000..45559f0 --- /dev/null +++ b/external/musl/sqrtf.c @@ -0,0 +1,83 @@ +#include +#include +#include "libm.h" +#include "sqrt_data.h" + +#define FENV_SUPPORT 1 + +static inline uint32_t mul32(uint32_t a, uint32_t b) +{ + return (uint64_t)a*b >> 32; +} + +/* see sqrt.c for more detailed comments. */ + +float __cdecl sqrtf(float x) +{ + uint32_t ix, m, m1, m0, even, ey; + + ix = asuint(x); + if (predict_false(ix - 0x00800000 >= 0x7f800000 - 0x00800000)) { + /* x < 0x1p-126 or inf or nan. */ + if (ix * 2 == 0) + return x; + if (ix == 0x7f800000) + return x; + if (ix > 0x7f800000) + return math_error(_DOMAIN, "sqrtf", x, 0, (x - x) / (x - x)); + /* x is subnormal, normalize it. */ + ix = asuint(x * 0x1p23f); + ix -= 23 << 23; + } + + /* x = 4^e m; with int e and m in [1, 4). */ + even = ix & 0x00800000; + m1 = (ix << 8) | 0x80000000; + m0 = (ix << 7) & 0x7fffffff; + m = even ? m0 : m1; + + /* 2^e is the exponent part of the return value. */ + ey = ix >> 1; + ey += 0x3f800000 >> 1; + ey &= 0x7f800000; + + /* compute r ~ 1/sqrt(m), s ~ sqrt(m) with 2 goldschmidt iterations. */ + static const uint32_t three = 0xc0000000; + uint32_t r, s, d, u, i; + i = (ix >> 17) % 128; + r = (uint32_t)__rsqrt_tab[i] << 16; + /* |r*sqrt(m) - 1| < 0x1p-8 */ + s = mul32(m, r); + /* |s/sqrt(m) - 1| < 0x1p-8 */ + d = mul32(s, r); + u = three - d; + r = mul32(r, u) << 1; + /* |r*sqrt(m) - 1| < 0x1.7bp-16 */ + s = mul32(s, u) << 1; + /* |s/sqrt(m) - 1| < 0x1.7bp-16 */ + d = mul32(s, r); + u = three - d; + s = mul32(s, u); + /* -0x1.03p-28 < s/sqrt(m) - 1 < 0x1.fp-31 */ + s = (s - 1)>>6; + /* s < sqrt(m) < s + 0x1.08p-23 */ + + /* compute nearest rounded result. */ + uint32_t d0, d1, d2; + float y, t; + d0 = (m << 16) - s*s; + d1 = s - d0; + d2 = d1 + s + 1; + s += d1 >> 31; + s &= 0x007fffff; + s |= ey; + y = asfloat(s); + if (FENV_SUPPORT) { + /* handle rounding and inexact exception. */ + uint32_t tiny = predict_false(d2==0) ? 0 : 0x01000000; + tiny |= (d1^d2) & 0x80000000; + t = asfloat(tiny); + y = eval_as_float(y + t); + } + return y; +} diff --git a/gdbjit/reader.c b/gdbjit/reader.c new file mode 100644 index 0000000..f2f944d --- /dev/null +++ b/gdbjit/reader.c @@ -0,0 +1,45 @@ +#include "gdbjit.h" +#include + +static char block_name_buffer[16]; + +static enum gdb_status read_debug_info(struct gdb_reader_funcs* self, struct gdb_symbol_callbacks* cbs, void* memory, long memory_sz) +{ + gdbjit_block_t* block = (gdbjit_block_t*)memory; + + struct gdb_object* object = cbs->object_open(cbs); + struct gdb_symtab* symtab = cbs->symtab_open(cbs, object, block->filename); + sprintf(block_name_buffer, "%x", block->x64start); + cbs->block_open(cbs, symtab, NULL, block->start, block->end, block_name_buffer); + + cbs->line_mapping_add(cbs, symtab, block->nlines, block->lines); + + cbs->symtab_close(cbs, symtab); + cbs->object_close(cbs, object); + + return GDB_SUCCESS; +} + +enum gdb_status unwind_frame(struct gdb_reader_funcs* self, struct gdb_unwind_callbacks* cbs) +{ + return GDB_SUCCESS; +} + +struct gdb_frame_id get_frame_id(struct gdb_reader_funcs* self, struct gdb_unwind_callbacks* cbs) +{ + struct gdb_frame_id frame = {0xdeadbeef, 0}; + return frame; +} + +void destroy_reader(struct gdb_reader_funcs* self) {} + +__attribute__((visibility("default"))) struct gdb_reader_funcs* gdb_init_reader(void) +{ + static struct gdb_reader_funcs funcs = {GDB_READER_INTERFACE_VERSION, NULL, read_debug_info, unwind_frame, get_frame_id, destroy_reader}; + return &funcs; +} + +__attribute__((visibility("default"))) int plugin_is_GPL_compatible (void) +{ + return 0; +} \ No newline at end of file diff --git a/install_steam.sh b/install_steam.sh new file mode 100755 index 0000000..dacf3cc --- /dev/null +++ b/install_steam.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# create necessary directories +mkdir -p ~/steam/tmp # makes both ~/steam and ~/steam/tmp in one cmd +cd ~/steam/tmp + +# download latest deb and unpack +curl -LO https://cdn.cloudflare.steamstatic.com/client/installer/steam.deb +ar x steam.deb +tar xf data.tar.xz + +# move deb contents to steam folder +mv ./usr/* .. +cd .. && rm -rf ./tmp + +# create run script +echo '#!/bin/bash +export STEAMOS=1 +export STEAM_RUNTIME=1 +export PROTON_USE_WOW64=1 +export DBUS_FATAL_WARNINGS=0 +~/steam/bin/steam $@' > steam + +# make script executable and move +chmod +x steam +sudo mv steam /usr/local/bin/ + +echo "Script complete." diff --git a/rebuild_wrappers.py b/rebuild_wrappers.py index 115e7d8..0d6ea4c 100755 --- a/rebuild_wrappers.py +++ b/rebuild_wrappers.py @@ -150,14 +150,18 @@ def __init__(self, ident: str, convname: str, valid_chars: List[str]) -> None: self.ident = ident self.name = convname self.values = valid_chars -# Free letters: B FG J QR T YZa e gh jk mno qrst z +# Free letters: B FG JK QR T YZa e gh jk mno qrst yz conventions = { - 'F': FunctionConvention('F', "System V", ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'K', 'l', 'L', 'p', 'V', 'O', 'S', 'N', 'M', 'H', 'P', 'A', 'x', 'X', 'Y', 'y', 'b']), - 'W': FunctionConvention('W', "Windows", ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'K', 'l', 'L', 'p', 'V', 'O', 'S', 'N', 'M', 'P', 'A']) + 'F': FunctionConvention('F', "System V", ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'l', 'L', 'p', 'V', 'O', 'S', 'N', 'H', 'P', 'A', 'x', 'X', 'Y', 'b']), + 'W': FunctionConvention('W', "Windows", ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'l', 'L', 'p', 'V', 'O', 'S', 'N', 'P', 'A']) } -sortedvalues = ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'K', 'l', 'L', 'p', 'V', 'O', 'S', 'N', 'M', 'H', 'P', 'A', 'x', 'X', 'Y', 'y', 'b', '0', '1'] +sortedvalues = ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'l', 'L', 'p', 'V', 'O', 'S', 'N', 'H', 'P', 'A', 'x', 'X', 'Y', 'b', '0', '1'] assert(all(all(c not in conv.values[:i] and c in sortedvalues for i, c in enumerate(conv.values)) for conv in conventions.values())) +# Some type depend on HAVE_LD80BITS; define this here so we can use it in readFiles and main +depends_on_ld: str = "DY" +assert(all(c in sortedvalues for c in depends_on_ld)) + class FunctionType(str): @staticmethod def validate(s: str, post: str) -> bool: @@ -359,7 +363,7 @@ def readFiles(files: Iterable[Filename]) -> Tuple[JumbledGlobals, JumbledRedirec gbl : JumbledGlobals = {} redirects: JumbledRedirects = {} filespec : JumbledFilesSpecific = {} - + functions: Dict[str, Filename] = {} halt_required = False # Is there a GO(*, .FE*) or similar in-batch error(s)? # First read the files inside the headers @@ -369,7 +373,7 @@ def readFiles(files: Iterable[Filename]) -> Tuple[JumbledGlobals, JumbledRedirec # typedefs is a list of all "*FE*" types for the current file # mystructs is a map of all char -> (structure C name, replacement) for structures - typedefs : JumbledTypedefs = {} + typedefs : JumbledTypedefs = {} mystructs : JumbledStructures = {} mystructuses: JumbledStructUses = {} filespec[filename[:-10]] = (typedefs, mystructs, mystructuses) @@ -401,10 +405,16 @@ def add_symbol_name(funname: Union[str, None], funsname: Dict[ClausesStr, List[s or match("sdl1ttf", "sdl2ttf") \ or match("libgl", "libegl") \ or match("libgl", "glesv2") \ + or match("libgl", "libglxnvidia") \ + or match("libglx", "libglxnvidia") \ or match("libegl", "glesv2") \ + or match("libegl", "libglxnvidia") \ + or match("glesv2", "libglxnvidia") \ + or match("softokn3", "p11kit") \ or match("libc", "tcmallocminimal") \ or match("libc", "tbbmallocproxy") \ or match("libc", "androidshmem") \ + or match("crypto", "libssl3") \ or match("tcmallocminimal", "tbbmallocproxy"): continue @@ -530,9 +540,22 @@ def add_symbol_name(funname: Union[str, None], funsname: Dict[ClausesStr, List[s if ln not in gbl[str(dependants)]: gbl[str(dependants)].append(FunctionType(ln)) + if any(c in origLine for c in depends_on_ld): + if (gotype != "GOM") and (gotype != "GOWM") and (gotype != "GOD") and (gotype != "GOWD"): + print("\033[91mError:\033[m type depends on HAVE_LD80BITS but the GO type doesn't support that ({0}:{1})" + .format(filename, line[:-1])) + halt_required = True + if (gotype == "GO2") or (gotype == "GOW2") or (gotype == "GOD") or (gotype == "GODW"): + altfun = line.split(',')[2].split(')')[0].strip() + if altfun == "": + print("\033[91mError:\033[m empty alt function ({0}:{1})".format(filename, line[:-1])) + halt_required = True + elif altfun == funname: + print("\033[91mError:\033[m alt function is the original function ({0}:{1})".format(filename, line[:-1])) + halt_required = True if origLine[2] == "E": if (gotype != "GOM") and (gotype != "GOWM"): - if (gotype != "GO2") or not (line.split(',')[2].split(')')[0].strip().startswith('my_')): + if ((gotype != "GO2") and (gotype != "GOW2")) or not (line.split(',')[2].split(')')[0].strip().startswith('my_')): print("\033[91mThis is probably not what you meant!\033[m ({0}:{1})".format(filename, line[:-1])) halt_required = True if len(origLine) > 3: @@ -822,37 +845,40 @@ def main(root: str, files: Iterable[Filename], ver: str): allowed_conv = conventions[allowed_conv_ident] # H could be allowed maybe? - allowed_simply: Dict[str, str] = {"ARM64": "v", "RV64": "v"} - allowed_regs : Dict[str, str] = {"ARM64": "cCwWiuIUlLp", "RV64": "CWuIUlLp"} - allowed_fpr : Dict[str, str] = {"ARM64": "fd", "RV64": "fd"} + allowed_simply: Dict[str, str] = {"ARM64": "v", "RV64": "v", "LA64": "v"} + allowed_regs : Dict[str, str] = {"ARM64": "cCwWiuIUlLp", "RV64": "CWIUlLp", "LA64": "CWIUlLp"} + allowed_fpr : Dict[str, str] = {"ARM64": "fd", "RV64": "fd", "LA64": "fd"} + allowed_sextw : Dict[str, str] = {"ARM64": "", "RV64": "cwiu", "LA64": "cwiu"} # Detect functions which return in an x87 register retx87_wraps: Dict[ClausesStr, List[FunctionType]] = {} - return_x87: str = "DK" + return_x87: str = "D" # Sanity checks - forbidden_simple: Dict[str, str] = {"ARM64": "EDKVOSNMHPAxXYyb", "RV64": "EcwiDKVOSNMHPAxXYyb"} + forbidden_simple: Dict[str, str] = {"ARM64": "EDVOSNHPAxXYb", "RV64": "EDVOSNHPAxXYb", "LA64": "EDVOSNHPAxXYb"} assert(all(k in allowed_simply for k in forbidden_simple)) assert(all(k in allowed_regs for k in forbidden_simple)) assert(all(k in allowed_fpr for k in forbidden_simple)) for k1 in forbidden_simple: - assert(len(allowed_simply[k1]) + len(allowed_regs[k1]) + len(allowed_fpr[k1]) + len(forbidden_simple[k1]) == len(allowed_conv.values)) + assert(len(allowed_simply[k1]) + len(allowed_regs[k1]) + len(allowed_fpr[k1]) + len(allowed_sextw[k1]) + len(forbidden_simple[k1]) == len(allowed_conv.values)) assert(all(c not in allowed_regs[k1] for c in allowed_simply[k1])) assert(all(c not in allowed_simply[k1] + allowed_regs[k1] for c in allowed_fpr[k1])) assert(all(c not in allowed_simply[k1] + allowed_regs[k1] + allowed_fpr[k1] for c in forbidden_simple[k1])) - assert(all(c in allowed_simply[k1] + allowed_regs[k1] + allowed_fpr[k1] + forbidden_simple[k1] for c in allowed_conv.values)) + assert(all(c in allowed_simply[k1] + allowed_regs[k1] + allowed_fpr[k1] + allowed_sextw[k1] + forbidden_simple[k1] for c in allowed_conv.values)) assert(all(c in allowed_conv.values for c in return_x87)) + assert(all(c in forbidden_simple[k] for c in depends_on_ld for k in forbidden_simple)) simple_wraps: Dict[str, Dict[ClausesStr, List[Tuple[FunctionType, int]]]] = { k1: {} for k1 in forbidden_simple } def check_simple(v: FunctionType) -> Dict[str, int]: - regs_count: int = 0 - fpr_count : int = 0 - - ret = {} + ret: Dict[str, int] = {} for k in forbidden_simple: + regs_count: int = 0 + fpr_count : int = 0 + sextw_mask: int = 0 + if v.get_convention() is not allowed_conv: continue if v[0] in forbidden_simple[k]: @@ -864,6 +890,9 @@ def check_simple(v: FunctionType) -> Dict[str, int]: fpr_count = fpr_count + 1 elif c in allowed_simply[k]: continue + elif c in allowed_sextw[k]: + sextw_mask |= 1 << regs_count + regs_count += 1 else: break else: @@ -871,6 +900,7 @@ def check_simple(v: FunctionType) -> Dict[str, int]: if (regs_count <= 6) and (fpr_count <= 8): # All checks passed! ret_val = 1 + fpr_count + ret_val |= sextw_mask << 4 if v[0] in allowed_fpr[k]: ret_val = -ret_val ret[k] = ret_val @@ -930,6 +960,19 @@ def check_return_x87(v: FunctionType) -> bool: return v; {rbr} + static void* io_convert_back(void* v) + {lbr} + if(!v) + return v; + if(v == stdin) + return my__IO_2_1_stdin_; + if(v == stdout) + return my__IO_2_1_stdout_; + if(v == stderr) + return my__IO_2_1_stderr_; + return v; + {rbr} + #define ST0val ST0.d int of_convert(int); @@ -966,7 +1009,6 @@ def check_return_x87(v: FunctionType) -> bool: // o = stdout // S = _IO_2_1_stdXXX_ pointer (or FILE*) // N = ... automatically sending 1 arg - // M = ... automatically sending 2 args // A = va_list // 0 = constant 0, 1 = constant 1 // x = float complex @@ -995,6 +1037,26 @@ def check_return_x87(v: FunctionType) -> bool: #ifndef __{filename}UNDEFS_H_ #define __{filename}UNDEFS_H_ + """, + "x64printer.c": """ + #include + #include + #include + #include + #include + #include "x64emu.h" + #include "x64emu_private.h" + #include "wrapper.h" + + #define PRIp "p" + #define PRIf "f" + #define PRILf "Lf" + #define PRIs "s" + + void x64Print(x64emu_t* emu, char* buff, size_t buffsz, const char* func, int tid, wrapper_t w) + {lbr} + #ifdef HAVE_TRACE + if (0) {lbr} """ } files_guard = { @@ -1017,6 +1079,14 @@ def check_return_x87(v: FunctionType) -> bool: "fnundefs.h": """ #endif // __{filename}UNDEFS_H_ + """, + "x64printer.c": """ + else + #endif // HAVE_TRACE + {lbr} + snprintf(buff, buffsz, "%04d|%p: Calling %s(0x%lX, 0x%lX, 0x%lX, ...)", tid, *(void**)(R_RSP), func, R_RDI, R_RSI, R_RDX); + {rbr} + {rbr} """ } @@ -1033,20 +1103,59 @@ def check_return_x87(v: FunctionType) -> bool: # Rewrite the wrapper.c file: # i and u should only be 32 bits td_types = { - # E v c w i I C W u U f d D K l L p V O S N M H P A x X Y y b - 'F': ["x64emu_t*", "void", "int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t", "float", "double", "long double", "double", "intptr_t", "uintptr_t", "void*", "void*", "int32_t", "void*", "...", "...", "unsigned __int128", "void*", "void*", "complexf_t", "complex_t", "complexl_t", "complex_t", "void*"], - # E v c w i I C W u U f d K l L p V O S N M P A - 'W': ["x64emu_t*", "void", "int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t", "float", "double", "double", "intptr_t", "uintptr_t", "void*", "void*", "int32_t", "void*", "...", "...", "void*", "void*"] + # E v c w i I C W u U f d D l L p V O S N H P A x X Y b + 'F': ["x64emu_t*", "void", "int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t", "float", "double", "long double", "intptr_t", "uintptr_t", "void*", "void*", "int32_t", "void*", "...", "unsigned __int128", "void*", "void*", "complexf_t", "complex_t", "complexl_t", "void*"], + # E v c w i I C W u U f d l L p V O S N P A + 'W': ["x64emu_t*", "void", "int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t", "float", "double", "intptr_t", "uintptr_t", "void*", "void*", "int32_t", "void*", "...", "void*", "void*"] + } + td_types_nold = { + 'F': {'D': "double", 'Y': "complex_t"}, + 'W': {} + } + td_types_ld = { + k: {t: td_types[k][conventions[k].values.index(t)] for t in td_types_nold[k]} for k in td_types_nold } assert(all(k in conventions for k in td_types)) + assert(all(k in conventions for k in td_types_nold)) + assert(all(t in depends_on_ld for k in td_types_nold for t in td_types_nold[k])) for k in conventions: if len(conventions[k].values) != len(td_types[k]): raise NotImplementedError("len(values) = {lenval} != len(td_types) = {lentypes}".format(lenval=len(conventions[k].values), lentypes=len(td_types[k]))) def generate_typedefs(arr: Iterable[FunctionType], file) -> None: + any_depends_on_ld = False for v in arr: - file.write("typedef " + td_types[v.get_convention().ident][v.get_convention().values.index(v[0])] + " (*" + v + "_t)" + if any(c in v for c in depends_on_ld): + any_depends_on_ld = True + continue + name = v + "_t" + v = v[:-1] if v.endswith('NN') else v # FIXME + file.write("typedef " + td_types[v.get_convention().ident][v.get_convention().values.index(v[0])] + " (*" + name + ")" + "(" + ', '.join(td_types[v.get_convention().ident][v.get_convention().values.index(t)] for t in v[2:]) + ");\n") + if any_depends_on_ld: + file.write("\n#if defined(HAVE_LD80BITS) || defined(ANDROID)\n") + for v in arr: + if all(c not in v for c in depends_on_ld): + continue + name = v + "_t" + v = v[:-1] if v.endswith('NN') else v # FIXME + file.write("typedef " + td_types[v.get_convention().ident][v.get_convention().values.index(v[0])] + " (*" + name + ")" + + "(" + ', '.join(td_types[v.get_convention().ident][v.get_convention().values.index(t)] for t in v[2:]) + ");\n") + file.write("#else // !HAVE_LD80BITS && !ANDROID\n") + for k in td_types_nold: + for t in td_types_nold[k]: + td_types[k][conventions[k].values.index(t)] = td_types_nold[k][t] + for v in arr: + if all(c not in v for c in depends_on_ld): + continue + name = v + "_t" + v = v[:-1] if v.endswith('NN') else v # FIXME + file.write("typedef " + td_types[v.get_convention().ident][v.get_convention().values.index(v[0])] + " (*" + name + ")" + + "(" + ', '.join(td_types[v.get_convention().ident][v.get_convention().values.index(t)] for t in v[2:]) + ");\n") + for k in td_types_nold: + for t in td_types_ld[k]: + td_types[k][conventions[k].values.index(t)] = td_types_ld[k][t] + file.write("#endif\n") with open(os.path.join(root, "src", "wrapped", "generated", "wrapper.c"), 'w') as file: file.write(files_header["wrapper.c"].format(lbr="{", rbr="}", version=ver)) @@ -1069,10 +1178,10 @@ def generate_typedefs(arr: Iterable[FunctionType], file) -> None: conventions['F']: [ "\n#error Invalid return type: emulator\n", # E "fn({0});", # v - "R_RAX=fn({0});", # c - "R_RAX=fn({0});", # w - "R_RAX=(int32_t)fn({0});", # i - "R_RAX=(int64_t)fn({0});", # I + "R_RAX=(uint8_t)fn({0});", # c + "R_RAX=(uint16_t)fn({0});", # w + "R_RAX=(uint32_t)fn({0});", # i + "S_RAX=(int64_t)fn({0});", # I "R_RAX=(unsigned char)fn({0});", # C "R_RAX=(unsigned short)fn({0});", # W "R_RAX=(uint32_t)fn({0});", # u @@ -1080,22 +1189,19 @@ def generate_typedefs(arr: Iterable[FunctionType], file) -> None: "emu->xmm[0].f[0]=fn({0});", # f "emu->xmm[0].d[0]=fn({0});", # d "long double ld=fn({0}); fpu_do_push(emu); ST0val = ld;", # D - "double db=fn({0}); fpu_do_push(emu); ST0val = db;", # K "R_RAX=(intptr_t)fn({0});", # l "R_RAX=(uintptr_t)fn({0});", # L "R_RAX=(uintptr_t)fn({0});", # p "\n#error Invalid return type: va_list\n", # V "\n#error Invalid return type: at_flags\n", # O - "\n#error Invalid return type: _io_file*\n", # S + "R_RAX=(uintptr_t)io_convert_back(fn({0}));", # S "\n#error Invalid return type: ... with 1 arg\n", # N - "\n#error Invalid return type: ... with 2 args\n", # M "unsigned __int128 u128 = fn({0}); R_RAX=(u128&0xFFFFFFFFFFFFFFFFL); R_RDX=(u128>>64)&0xFFFFFFFFFFFFFFFFL;", # H "\n#error Invalid return type: pointer in the stack\n", # P "\n#error Invalid return type: va_list\n", # A - 'from_complexf(emu, fn({0}));', # x - 'from_complex(emu, fn({0}));', # X - 'from_complexl(emu, fn({0}));', # Y - 'from_complexk(emu, fn({0}));', # y + "from_complexf(emu, fn({0}));", # x + "from_complex(emu, fn({0}));", # X + "from_complexl(emu, fn({0}));", # Y "\n#error Invalid return type: xcb_connection_t*\n", # b ], conventions['W']: [ @@ -1111,32 +1217,47 @@ def generate_typedefs(arr: Iterable[FunctionType], file) -> None: "R_RAX=fn({0});", # U "emu->xmm[0].f[0]=fn({0});", # f "emu->xmm[0].d[0]=fn({0});", # d - "double db=fn({0}); fpu_do_push(emu); ST0val = db;", # K "R_RAX=(intptr_t)fn({0});", # l "R_RAX=(uintptr_t)fn({0});", # L "R_RAX=(uintptr_t)fn({0});", # p "\n#error Invalid return type: va_list\n", # V "\n#error Invalid return type: at_flags\n", # O - "\n#error Invalid return type: _io_file*\n", # S + "R_RAX=io_convert_back(fn({0}));", # S "\n#error Invalid return type: ... with 1 arg\n", # N - "\n#error Invalid return type: ... with 2 args\n", # M "\n#error Invalid return type: pointer in the stack\n", # P "\n#error Invalid return type: va_list\n", # A ] } + vals_nold = { + conventions['F']: { + 'D': "double db=fn({0}); fpu_do_push(emu); ST0val = db;", + 'Y': "from_complexk(emu, fn({0}));", + }, + conventions['W']: {} + } + vals_android = { + conventions['F']: { + "D": "long double ld=fn({0}); emu->xmm[0].u128=*(__uint128_t*)&ld;", + "Y": "from_complexl(emu, fn({0}));", + }, + conventions['W']: {} + } + vals_ld = { + k: {t: vals[k][k.values.index(t)] for t in vals_nold[k]} for k in vals_nold + } # vreg: value is in a general register - # E v c w i I C W u U f d D K l L p V O S N M H P A x X Y y b - vreg = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 2, 2, 0, 1, 0, 0, 0, 0, 1] + # E v c w i I C W u U f d D l L p V O S N H P A x X Y b + vreg = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 2, 0, 1, 0, 0, 0, 1] # vxmm: value is in a XMM register - # E v c w i I C W u U f d D K l L p V O S N M H P A x X Y y b - vxmm = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0] + # E v c w i I C W u U f d D l L p V O S N H P A x X Y b + vxmm = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0] # vother: value is elsewere - # E v c w i I C W u U f d D K l L p V O S N M H P A x X Y y b - vother = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + # E v c w i I C W u U f d D l L p V O S N H P A x X Y b + vother = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # vstack: value is on the stack (or out of register) - # E v c w i I C W u U f d D K l L p V O S N M H P A x X Y y b - vstack = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 0, 1, 1, 1, 2, 2, 1, 1, 1, 2, 4, 4, 1] + # E v c w i I C W u U f d D l L p V O S N H P A x X Y b + vstack = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 2, 4, 1] arg_r = [ "", # E "", # v @@ -1151,7 +1272,6 @@ def generate_typedefs(arr: Iterable[FunctionType], file) -> None: "", # f "", # d "", # D - "", # K "(intptr_t){p}, ", # l "(uintptr_t){p}, ", # L "(void*){p}, ", # p @@ -1159,14 +1279,12 @@ def generate_typedefs(arr: Iterable[FunctionType], file) -> None: "of_convert((int32_t){p}), ", # O "io_convert((void*){p}), ", # S "(void*){p}, ", # N - "(void*){p}, ", # M - "\n#error Use pp instead\n", # H + "(unsigned __int128){p} + ((unsigned __int128){p2} << 64), ", # H "", # P "(void*){p}, ", # A - "", # x + "", # x "", # X - "", # Y - "", # y + "", # Y "aligned_xcb, ", # b ] arg_x = [ @@ -1183,7 +1301,6 @@ def generate_typedefs(arr: Iterable[FunctionType], file) -> None: "emu->xmm[{p}].f[0], ", # f "emu->xmm[{p}].d[0], ", # d "", # D - "", # K "", # l "", # L "", # p @@ -1191,14 +1308,12 @@ def generate_typedefs(arr: Iterable[FunctionType], file) -> None: "", # O "", # S "", # N - "", # M "", # H "", # P "", # A "to_complexf(emu, {p}), ", # x "to_complex(emu, {p}), ", # X - "", # Y - "", # y + "", # Y "", # b ] arg_o = [ @@ -1215,7 +1330,6 @@ def generate_typedefs(arr: Iterable[FunctionType], file) -> None: "", # f "", # d "", # D - "", # K "", # l "", # L "", # p @@ -1223,14 +1337,12 @@ def generate_typedefs(arr: Iterable[FunctionType], file) -> None: "", # O "", # S "", # N - "", # M "", # H "", # P "", # A "", # x "", # X - "", # Y - "", # y + "", # Y "", # b ] arg_s = [ @@ -1247,7 +1359,6 @@ def generate_typedefs(arr: Iterable[FunctionType], file) -> None: "*(float*)(R_RSP + {p}), ", # f "*(double*)(R_RSP + {p}), ", # d "LD2localLD((void*)(R_RSP + {p})), ", # D - "FromLD((void*)(R_RSP + {p})), ", # K "*(intptr_t*)(R_RSP + {p}), ", # l "*(uintptr_t*)(R_RSP + {p}), ", # L "*(void**)(R_RSP + {p}), ", # p @@ -1255,16 +1366,36 @@ def generate_typedefs(arr: Iterable[FunctionType], file) -> None: "of_convert(*(int32_t*)(R_RSP + {p})), ", # O "io_convert(*(void**)(R_RSP + {p})), ", # S "*(void**)(R_RSP + {p}), ", # N - "*(void**)(R_RSP + {p}),*(void**)(R_RSP + {p} + 8), ", # M "*(unsigned __int128*)(R_RSP + {p}), ", # H "*(void**)(R_RSP + {p}), ", # P "*(void**)(R_RSP + {p}), ", # A "*(complexf_t*)(R_RSP + {p}), ", # x "*(complex_t*)(R_RSP + {p}), ", # X - "to_complexl(emu, R_RSP + {p}), ", # Y - "to_complexk(emu, R_RSP + {p}), ", # y + "to_complexl(emu, R_RSP + {p}), ", # Y "aligned_xcb, ", # b ] + arg_s_nold = { + 'D': "FromLD((void*)(R_RSP + {p})), ", # K + 'Y': "to_complexk(emu, R_RSP + {p}), ", # y + } + arg_s_android = { + 'D': "*(long double*)(R_RSP + {p})], ", + 'Y': "to_complexl(emu, R_RSP + {p}), ", + } + arg_s_ld = { + t: arg_s[conventions['F'].values.index(t)] for t in arg_s_nold + } + vxmm_noandroid = vxmm[:] + vxmm_android = vxmm[:] + vxmm_android[conventions['F'].values.index('D')] = 1 + vxmm_android[conventions['F'].values.index('Y')] = 1 + arg_x_android = { + 'D': "*(long double*)&emu->xmm[{p}], ", + 'Y': "to_complexl(emu, (uintptr_t)&emu->xmm[{p}]), ", + } + arg_x_ld = { + t: arg_x[conventions['F'].values.index(t)] for t in arg_x_android + } # Asserts for k in conventions: @@ -1378,16 +1509,26 @@ def function_args_systemV(args: FunctionType, d: int = 8, r: int = 0, x: int = 0 reg_arg = ["R_RDI", "R_RSI", "R_RDX", "R_RCX", "R_R8", "R_R9"] if (r < len(reg_arg)) and (vreg[idx] > 0): ret = "" - for _ in range(vreg[idx]): - # There may be values in multiple registers + if (vreg[idx] == 2) and ("{p2}" in arg_r[idx]): if r < len(reg_arg): # Value is in a general register - ret = ret + arg_r[idx].format(p=reg_arg[r]) - r = r + 1 + ret = ret + arg_r[idx].format(p=reg_arg[r], p2=reg_arg[r+1]) + r = r + 2 else: # Remaining is in the stack ret = ret + arg_s[idx].format(p=d) d = d + 8 + else: + for _ in range(vreg[idx]): + # There may be values in multiple registers + if r < len(reg_arg): + # Value is in a general register + ret = ret + arg_r[idx].format(p=reg_arg[r]) + r = r + 1 + else: + # Remaining is in the stack + ret = ret + arg_s[idx].format(p=d) + d = d + 8 return ret + function_args_systemV(args[1:], d, r, x) elif (x < 8) and (vxmm[idx] > 0): # Value is in an XMM register @@ -1445,22 +1586,128 @@ def function_writer(f, N: FunctionType, W: str) -> None: f.write(" }\n") for k in gbls: + any_depends_on_ld = False if k != str(Clauses()): file.write("\n#if " + k + "\n") for v in gbls[k]: + if any(c in v for c in depends_on_ld): + any_depends_on_ld = True + continue if v == FunctionType("vFv"): # Suppress all warnings... file.write("void vFv(x64emu_t *emu, uintptr_t fcn) { vFv_t fn = (vFv_t)fcn; fn(); (void)emu; }\n") else: function_writer(file, v, v + "_t") + if any_depends_on_ld: + file.write("\n#if defined(ANDROID)\n") + for c in vals_android: + for t in vals_android[c]: + vals[c][c.values.index(t)] = vals_android[c][t] + for t in arg_s_android: + arg_s[conventions['F'].values.index(t)] = arg_s_android[t] + for t in arg_x_android: + arg_x[conventions['F'].values.index(t)] = arg_x_android[t] + vxmm = vxmm_android + for v in gbls[k]: + if all(c not in v for c in depends_on_ld): + continue + if v == FunctionType("vFv"): + # Suppress all warnings... + file.write("void vFv(x64emu_t *emu, uintptr_t fcn) { vFv_t fn = (vFv_t)fcn; fn(); (void)emu; }\n") + else: + function_writer(file, v, v + "_t") + file.write("#elif !defined(HAVE_LD80BITS)\n") + for c in vals_android: + for t in vals_ld[c]: + vals[c][c.values.index(t)] = vals_ld[c][t] + for c in vals_nold: + for t in vals_nold[c]: + vals[c][c.values.index(t)] = vals_nold[c][t] + for t in arg_s_android: + arg_s[conventions['F'].values.index(t)] = arg_s_ld[t] + for t in arg_s_nold: + arg_s[conventions['F'].values.index(t)] = arg_s_nold[t] + for t in arg_x_android: + arg_x[conventions['F'].values.index(t)] = arg_x_ld[t] + vxmm = vxmm_noandroid + for v in gbls[k]: + if all(c not in v for c in depends_on_ld): + continue + if v == FunctionType("vFv"): + # Suppress all warnings... + file.write("void vFv(x64emu_t *emu, uintptr_t fcn) { vFv_t fn = (vFv_t)fcn; fn(); (void)emu; }\n") + else: + function_writer(file, v, v + "_t") + for c in vals_nold: + for t in vals_nold[c]: + vals[c][c.values.index(t)] = vals_ld[c][t] + for t in arg_s_nold: + arg_s[conventions['F'].values.index(t)] = arg_s_ld[t] + file.write("#else // defined(HAVE_LD80BITS) && !defined(ANDROID)\n") + for v in gbls[k]: + if all(c not in v for c in depends_on_ld): + continue + if v == FunctionType("vFv"): + # Suppress all warnings... + file.write("void vFv(x64emu_t *emu, uintptr_t fcn) { vFv_t fn = (vFv_t)fcn; fn(); (void)emu; }\n") + else: + function_writer(file, v, v + "_t") + file.write("#endif\n") if k != str(Clauses()): file.write("#endif\n") file.write("\n") for k in redirects: + any_depends_on_ld = False if k != str(Clauses()): file.write("\n#if " + k + "\n") for vr, vf in redirects[k]: + if any(c in vr for c in depends_on_ld): + any_depends_on_ld = True + continue function_writer(file, vr, vf + "_t") + if any_depends_on_ld: + file.write("\n#if defined(ANDROID)\n") + for c in vals_android: + for t in vals_android[c]: + vals[c][c.values.index(t)] = vals_android[c][t] + for t in arg_s_android: + arg_s[conventions['F'].values.index(t)] = arg_s_android[t] + for t in arg_x_android: + arg_x[conventions['F'].values.index(t)] = arg_x_android[t] + vxmm = vxmm_android + for vr, vf in redirects[k]: + if all(c not in vr for c in depends_on_ld): + continue + function_writer(file, vr, vf + "_t") + file.write("#elif !defined(HAVE_LD80BITS)\n") + for c in vals_android: + for t in vals_ld[c]: + vals[c][c.values.index(t)] = vals_ld[c][t] + for c in vals_nold: + for t in vals_nold[c]: + vals[c][c.values.index(t)] = vals_nold[c][t] + for t in arg_s_android: + arg_s[conventions['F'].values.index(t)] = arg_s_ld[t] + for t in arg_s_nold: + arg_s[conventions['F'].values.index(t)] = arg_s_nold[t] + for t in arg_x_android: + arg_x[conventions['F'].values.index(t)] = arg_x_ld[t] + vxmm = vxmm_noandroid + for vr, vf in redirects[k]: + if all(c not in vr for c in depends_on_ld): + continue + function_writer(file, vr, vf + "_t") + for c in vals_nold: + for t in vals_nold[c]: + vals[c][c.values.index(t)] = vals_ld[c][t] + for t in arg_s_nold: + arg_s[conventions['F'].values.index(t)] = arg_s_ld[t] + file.write("#else // defined(HAVE_LD80BITS) && !defined(ANDROID)\n") + for vr, vf in redirects[k]: + if all(c not in vr for c in depends_on_ld): + continue + function_writer(file, vr, vf + "_t") + file.write("#endif\n") if k != str(Clauses()): file.write("#endif\n") @@ -1468,7 +1715,7 @@ def function_writer(f, N: FunctionType, W: str) -> None: inttext = "" file.write("\n") for k1 in simple_idxs: - file.write("#{inttext}if defined({k1})\nint isSimpleWrapper(wrapper_t fun) {{\n".format(inttext=inttext, k1=k1)) + file.write("#{inttext}if defined({k1})\nint isSimpleWrapper(wrapper_t fun) {{\n\tif (box64_is32bits) return 0;\n".format(inttext=inttext, k1=k1)) inttext = "el" for k in simple_idxs[k1]: if k != str(Clauses()): @@ -1478,9 +1725,10 @@ def function_writer(f, N: FunctionType, W: str) -> None: if k != str(Clauses()): file.write("#endif\n") file.write("\treturn 0;\n}\n") - file.write("\n#else\nint isSimpleWrapper(wrapper_t fun) {\n\treturn 0;\n}\n#endif\n") + file.write("#else\nint isSimpleWrapper(wrapper_t fun) {\n\treturn 0;\n}\n#endif\n") # Write the isRetX87Wrapper function + file.write("\nint isRetX87Wrapper32(wrapper_t fun)\n#ifndef BOX32\n{ return 0; }\n#else\n ;\n#endif\n") file.write("\nint isRetX87Wrapper(wrapper_t fun) {\n") for k in retx87_idxs: if k != str(Clauses()): @@ -1514,7 +1762,30 @@ def function_writer(f, N: FunctionType, W: str) -> None: if k != str(Clauses()): file.write("#endif\n") file.write(files_guard["wrapper.h"].format(lbr="{", rbr="}", version=ver)) - + # E v c w i I C W u U f d D l L p V O S N H P A x X Y b + formats_map = ["(error)", "(error)", "i8", "i16", "i32", "i64", "u8", "u16", "u32", "u64", "f", "f", "Lf", "i64", "u64", "p", "p", "(error)", "(error)", "(error)", "u64", "p", "p", "(error)", "(error)", "(error)", "(error)"] + + # Rewrite the x64printer.c file: + with open(os.path.join(root, "src", "emu", "x64printer.c"), 'w') as file: + file.write(files_header["x64printer.c"].format(lbr="{", rbr="}", version=ver)) + + for k in gbls: + if k != str(Clauses()): + file.write("#if {k}\n".format(k=k)) + for signature in gbls[k]: + sig = signature if signature[2] != "E" else (signature[:2]+signature[3:]) + if any(letter in sig[2:] for letter in "OSNHxXYb") or signature.endswith('FE') or signature[1] == 'W': + continue + formats = sig[2:].replace("G", "UU") + params = '' if formats == "v" else ", " + function_args_systemV(FunctionType(formats))[:-2] + formats = '' if formats == "v" else ', '.join("%\" PRI{x} \"".format(x=formats_map[FunctionType(sig).get_convention().values.index(t)]) for t in formats) + file.write(" {rbr} else if (w == {signature}) {lbr}\n".format(signature=signature, lbr="{", rbr="}")) + file.write(" snprintf(buff, buffsz, \"%04d|%p: Calling %s({formats})\", tid, *(void**)(R_RSP), func{params});\n".format(formats=formats, params=params)) + if k != str(Clauses()): + file.write("#endif\n") + file.write(" }\n") + file.write(files_guard["x64printer.c"].format(lbr="{", rbr="}", version=ver)) + # Rewrite the *types.h files: for k in conventions: td_types[k][conventions[k].values.index('A')] = "va_list" @@ -1559,11 +1830,11 @@ def function_writer(f, N: FunctionType, W: str) -> None: return 0 if __name__ == '__main__': - limit = [] + limit: List[int] = [] for i, v in enumerate(sys.argv): if v == "--": limit.append(i) Define.defines = list(map(DefineType, sys.argv[2:limit[0]])) - if main(sys.argv[1], sys.argv[limit[0]+1:], "2.4.0.21") != 0: + if main(sys.argv[1], sys.argv[limit[0]+1:], "2.5.0.24") != 0: exit(2) exit(0) diff --git a/rebuild_wrappers_32.py b/rebuild_wrappers_32.py new file mode 100755 index 0000000..6b46105 --- /dev/null +++ b/rebuild_wrappers_32.py @@ -0,0 +1,1658 @@ +#!/usr/bin/env python3 + +import os +import sys + +try: + assert(sys.version_info.major == 3) + if sys.version_info.minor >= 9: + # Python 3.9+ + from typing import Any, Generic, NewType, Optional, TypeVar, Union, final + from collections.abc import Callable, Iterable, Sequence + Dict = dict + List = list + Type = type + Tuple = tuple + elif sys.version_info.minor >= 8: + # Python [3.8, 3.9) + from typing import Any, Callable, Dict, Generic, Iterable, List, NewType, Optional, Sequence, Tuple, Type, TypeVar, Union, final + elif (sys.version_info.minor >= 5) and (sys.version_info.micro >= 2): + # Python [3.5.2, 3.8) + from typing import Any, Callable, Dict, Generic, Iterable, List, NewType, Optional, Sequence, Tuple, Type, TypeVar, Union + final = lambda fun: fun # type: ignore + elif sys.version_info.minor >= 5: + # Python [3.5, 3.5.2) + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Tuple, Type, TypeVar, Union + def NewType(_, b): return b # type: ignore + final = lambda fun: fun # type: ignore + else: + # Python < 3.5 + #print("Your Python version does not have the typing module, fallback to empty 'types'") + # Dummies + class GTDummy: + def __getitem__(self, _): + return self + Any = GTDummy() # type: ignore + Callable = GTDummy() # type: ignore + Dict = GTDummy() # type: ignore + Generic = GTDummy() # type: ignore + Iterable = GTDummy() # type: ignore + List = GTDummy() # type: ignore + def NewType(_, b): return b # type: ignore + Optional = GTDummy() # type: ignore + Sequence = GTDummy() # type: ignore + Tuple = GTDummy() # type: ignore + Type = GTDummy() # type: ignore + def TypeVar(T): return object # type: ignore + Union = GTDummy() # type: ignore + final = lambda fun: fun # type: ignore +except ImportError: + print("It seems your Python version is quite broken...") + assert(False) + +""" +Generates all files in src/wrapped/generated +=== + +TL;DR: Automagically creates type definitions (/.F.+/ functions/typedefs...). + All '//%' in the headers are used by the script. + +Reads each lines of each "_private.h" headers (plus wrappedd3dadapter9_genvate.h, derived from wrappedd3dadapter9_gen.h). +For each of them: +- If if starts with a #ifdef, #else, #ifndef, #endif, it memorizes which definition is required +- If it starts with a "GO", it will do multiple things: + - It memorizes the type used by the function (second macro argument) + - It memorizes the type it is mapped to, if needed (eg, iFvp is mapped to iFp: the first argument is dropped) + - It checks if the type given (both original and mapped to) are valid + - If the signature contains a 'E' but it is not a "GOM" command, it will throw an error* (and vice-versa) + - If the line also contains '//%', the script will parse what's attached to this comment start: + - If it is attached to a '%', the function will be skipped when generating the 'SUPER' macro in the *types.h + - *If it is attached to a 'noE' or attached to something that ends with ',noE', it will ignore functions that + don't have the emulator as an argument but are still GOM functions + To know more about the signatures, see also box86.org's article (TODO FOR NOW). +- If the line starts with a '//%S', it will memorize a structure declaration. + The structure of it is: "//%S " + NOTE: Those structure letters are "fake types" that are accepted in the macros. + +`gbl` contains the first list, `redirects` the second and + `filespec` constains file specific informations (eg, structures, typedefs required...). + +After sorting the data, it generates: + +wrapper32.c +--------- +(Private) type definitions (/.F.+_t/) +Function definitions (/.F.+/ functions, that actually execute the function given as argument) + +wrapper32.h +--------- +Generic "wrapper32_t" type definition +Function declarations (/.F._32+/ functions) + +*types32.h +-------- +Local types definition, for the original signatures +The SUPER() macro definition, used to generate and initialize the `*_my_t` library structure +(TODO: also automate this declaration/definition? It would require more metadata, + and may break sometime in the future due to the system changing...) + +*defs32.h +------- +Local `#define`s, for signature mapping + +*undefs32.h +--------- +Local `#undefine`s, for signature mapping + + +Example: +======== +In wrappedtest_private.h: + ---------------------- +//%S X TestLibStructure ppu + +GO(superfunction, pFX) +GOM(superFunction2, pFEpX) +GOM(functionWithoutE, pFppu) //%noE +GOM(functionWithoutEAndNotInTypes, pFpppu) //%%,noE +GOM(functionNotInTypes, pFEpppu) //%% + +[No output] +Generated files: +wrapper32.c: [snippet] +---------- +typedef void *(*pFppu_t)(void*, void*, uint32_t); +typedef void *(*pFpppu_t)(void*, void*, void*, uint32_t); +typedef void *(*pFEpppu_t)(x64emu_t*, void*, void*, void*, uint32_t); + +void pFppu_32(x64emu_t *emu, uintptr_t fcn) { pFppu_t *fn = (pFppu_t)fn; R_RAX=...; } +void pFpppu_32(x64emu_t *emu, uintptr_t fcn) { pFpppu_t *fn = (pFpppu_t)fn; R_RAX=...; } +void pFEpppu_32(x64emu_t *emu, uintptr_t fcn) { pFpppu_t *fn = (pFpppu_t)fn; R_RAX=...; } + +wrapper32.h: [snippet] +---------- +typedef void (*wrapper_t)(x64emu_t*, uintptr_t); + +void pFppu_32(x64emu_t *emu, uintptr_t fcn); +void pFpppu_32(x64emu_t *emu, uintptr_t fcn); +void pFEpppu_32(x64emu_t *emu, uintptr_t fcn); + +wrappedtesttypes32.h: +------------------- +typedef void *(*pFpX_32_t)(void*, TestLibStructure); +typedef void *(*pFppu_32_t)(void*, void*, uint32_t); +typedef void *(*pFpppu_32_t)(void*, void*, void*, uint32_t); + +#define SUPER() ADDED_FUNCTIONS() \\ + GO(superFunction2, pFpX) \\ + GO(functionWithoutE, pFppu) + +wrappedtestdefs32.h: +------------------ +#define pFX pFppu +#define pFpX pFpppu + +wrappedtestundefs32.h: +-------------------- +#undef pFX +#undef pFpX +""" + +# Free characters: +# FG J QR T XYZ e g jk mno q xyz01 3456789 + +T = TypeVar('T') +U = TypeVar('U') + +Filename = str + +class CustOrderedDict(Generic[T, U], Iterable[T]): + __keys__: List[T] + __actdict__: Dict[T, U] + + def __init__(self, src: Optional[Dict[T, U]] = None) -> None: + if src is None: + self.__keys__ = [] + self.__actdict__ = {} + else: + self.__keys__ = list(src.keys()) + self.__actdict__ = src + + def sort(self, key: Callable[[T], Any] = lambda x: x) -> None: + self.__keys__.sort(key=key) + + def __iter__(self): + return iter(self.__keys__) + def __contains__(self, k: T) -> bool: + return k in self.__actdict__ + def __getitem__(self, k: T) -> U: + return self.__actdict__[k] + def __setitem__(self, k: T, v: U) -> None: + if k not in self.__keys__: self.__keys__.append(k) + self.__actdict__[k] = v +class CustOrderedDictList(CustOrderedDict[T, List[U]]): + def __getitem__(self, k: T) -> List[U]: + if k not in self: self[k] = [] + return super().__getitem__(k) + +class FirstArgumentSingletonMeta(Generic[T], type): + _singletons: Dict[T, Type['FirstArgumentSingletonMeta']] + + @classmethod + def __prepare__(metacls, __name: str, __bases: Tuple[type, ...], **kwds: Any) -> Dict[str, Any]: + return { "_singletons": {} } + + def __contains__(cls, k): + return k in cls._singletons + + def getSingletons(cls): + return cls._singletons + def __getitem__(cls, k): + return cls._singletons[k] + + def __call__(cls, fstarg, *largs, **kwargs): + if fstarg not in cls._singletons: + cls._singletons[fstarg] = super().__call__(fstarg, *largs, **kwargs) + return cls._singletons[fstarg] + +DefineType = NewType('DefineType', str) +@final +class Define: + name: DefineType + inverted_: bool + + defines: List[DefineType] = [] + + def __init__(self, name: DefineType, inverted_: bool) -> None: + # All values for "name" are in defines (throw otherwise) + if name not in Define.defines: + raise KeyError(name) + + self.name = name + self.inverted_ = inverted_ + def copy(self) -> "Define": + return Define(self.name, self.inverted_) + + def value(self) -> int: + return Define.defines.index(self.name)*2 + (1 if self.inverted_ else 0) + + def invert(self) -> "Define": + """ + invert -- Transform a `defined()` into a `!defined()` and vice-versa, in place. + """ + self.inverted_ = not self.inverted_ + return self + def inverted(self) -> "Define": + """ + inverted -- Transform a `defined()` into a `!defined()` and vice-versa, out-of-place. + """ + return Define(self.name, not self.inverted_) + + def __str__(self) -> str: + if self.inverted_: + return "!defined(" + self.name + ")" + else: + return "defined(" + self.name + ")" + def __eq__(self, o) -> bool: + return isinstance(o, Define) and (self.name == o.name) and (self.inverted_ == o.inverted_) +@final +class Clause: + defines: List[Define] + + def __init__(self, defines: Union[List[Define], str] = []) -> None: + if isinstance(defines, str): + if defines == "": + self.defines = [] + else: + self.defines = list( + map( + lambda x: + Define(DefineType(x[9:-1] if x[0] == '!' else x[8:-1]), x[0] == '!') + , defines.split(" && ") + ) + ) + else: + self.defines = [d.copy() for d in defines] + def copy(self) -> "Clause": + return Clause(self.defines) + + def append(self, define: Define) -> "Clause": + if any((define2.name == define.name) and (define2.inverted_ != define.inverted_) for define2 in self.defines): + raise ValueError("Tried to append an incompatible clause") + + self.defines.append(define) + return self + def invert_last(self) -> "Clause": + self.defines[-1].invert() + return self + def pop_last(self) -> "Clause": + if len(self.defines) > 0: self.defines.pop() + return self + + def empty(self) -> bool: + return self.defines == [] + + def __str__(self) -> str: + return " && ".join(map(str, self.defines)) + def __hash__(self): + return hash(str(self)) + def __eq__(self, o) -> bool: + return isinstance(o, Clause) and (self.defines == o.defines) +ClausesStr = str +@final +class Clauses: + """ + Represent a list of clauses, aka a list of or-ed together and-ed "defined()" + conditions + """ + clauses: List[Clause] + + def __init__(self, clauses: Union[List[Clause], str] = []) -> None: + if isinstance(clauses, str): + if clauses == "()": + self.clauses = [] + elif ") || (" in clauses: + self.clauses = list(map(Clause, clauses[1:-1].split(") || ("))) + else: + self.clauses = [Clause(clauses)] + else: + self.clauses = clauses[:] + def copy(self) -> "Clauses": + return Clauses(self.clauses[:]) + + def add(self, defines: Clause) -> "Clauses": + self.clauses.append(defines) + return self + + def empty(self) -> bool: + return self.clauses == [] + + def splitdef(self) -> Sequence[int]: + """ + splitdef -- Sorting key function for #ifdefs + + All #if defined(...) are sorted first by the length of its string + representation, then by the number of clauses, then by the number of + '&&' in each clause and then by the "key" of the tested names (left to + right, inverted placed after non-inverted). + """ + + ret = [len(str(self)), len(self.clauses)] if len(self.clauses) > 0 else [-1] + for cunj in self.clauses: + ret.append(len(cunj.defines)) + for cunj in self.clauses: + for d in cunj.defines: + ret.append(d.value()) + return ret + + def reduce(self) -> None: + """ + reduce -- Reduces the number of clauses in-place + + Removes the most possible number of conditions, both by removing + conditions and by removing entire clauses. + + As a side effect, sorts itself. + """ + # Early breaks + if any(c.empty() for c in self.clauses): + self.clauses = [] + return + if len(self.clauses) == 0: + return + elif len(self.clauses) == 1: + clause = Clause() + for define in self.clauses[0].defines: + if define in clause.defines: + continue + elif define.inverted() in clause.defines: + clause = Clause(',') # This should never happen (and never happens without breaking encapsulation) + else: + clause.append(define) + clause.defines.sort(key=lambda d: Define.defines.index(d.name)) + self.clauses = [clause] + return + elif len(self.clauses) == 2: + if len(self.clauses[0].defines) == len(self.clauses[1].defines) == 1: + if self.clauses[0].defines[0].inverted() == self.clauses[1].defines[0]: + self.clauses = [] + return + + # Quine-McCluskey algorithm + # matches: list of (matches, inverted_mask) + needed: List[Tuple[int, int]] = [ + (i, 0) + for i in range(1< 0: + combined: List[Tuple[int, int]] = [] + combinable: List[bool] = [False] * len(last_combined) + while len(last_combined) > 0: + attempt = last_combined[-1] + for idx, (i, m) in enumerate(last_combined): + if idx == len(last_combined) - 1: + if not combinable[idx]: + uncombinable.append(attempt) + elif m == attempt[1]: + if (i ^ attempt[0]) & ((i ^ attempt[0]) - 1) != 0: + continue # More than 1 bit of difference + + combinable[idx] = True + combinable[len(last_combined) - 1] = True + add = (i | attempt[0], m | (i ^ attempt[0])) + if add in combined: + continue # Aleady added + combined.append(add) + last_combined.pop() + last_combined = combined + + matches: Dict[int, List[Tuple[int, int]]] = { + i: [combination for combination in uncombinable if (i | combination[1]) == combination[0]] for i, _ in needed + } + self.clauses = [] + matches_size: int = 1 + while len(matches) != 0: + match_found = True + while match_found: + match_found = False + for i in matches: + if len(matches[i]) < matches_size: + raise NotImplementedError("There seems to be an error in the algorithm") + elif len(matches[i]) == matches_size: + match_found = True + self.clauses.append( + Clause([ + Define( + n, + matches[i][0][0] & (1 << j) == 0 + ) for j, n in enumerate(Define.defines) if matches[i][0][1] & (1 << j) == 0 + ])) + self.clauses[-1].defines.sort(key=lambda d: Define.defines.index(d.name)) + to_erase: List[int] = [] + for j in matches: + if matches[i][0] in matches[j]: + to_erase.append(j) + for j in to_erase: + del matches[j] + break + matches_size = matches_size + 1 + self.clauses.sort(key=lambda c: (len(c.defines), [Define.defines.index(d.name) for d in c.defines])) + + def __str__(self) -> ClausesStr: + if len(self.clauses) == 1: + return str(self.clauses[0]) + else: + return "(" + ") || (".join(map(str, self.clauses)) + ")" + def __hash__(self): + return hash(str(self)) + def __eq__(self, o) -> bool: + return isinstance(o, Clauses) and (self.clauses == o.clauses) + +class CType(metaclass=FirstArgumentSingletonMeta): + class ReadWrite: + none: 'CType.ReadWrite' + readonly: 'CType.ReadWrite' + writeonly: 'CType.ReadWrite' + readwrite: 'CType.ReadWrite' + def __init__(self, pre: bool, post: bool) -> None: + # pre is "need to convert before the call", post is "need to convert after the call" + self.pre = pre + self.post = post + + @staticmethod + def find_next(name: str) -> Tuple[str, Optional[Tuple['CType.ReadWrite', str, str]]]: + """ + Returns (pre, (type, str, post)) + where name == pre.('r' if type is readonly, 'b' if type is writeonly else 'B').str.'_'.post + Aka, pre contains no structure; type, str is the structure characterization (b fo writeonly). + If it returns (pre, None), it is guaranteed to have no structure in pre === name. + """ + beg: Optional[int] = None + t: Optional[CType.ReadWrite] = None + depth = 0 + + for i in range(len(name)): + if (name[i] == 'r') or (name[i] == 'b') or (name[i] == 'B'): + if beg is None: + beg = i + t = CType.ReadWrite.readonly if name[i] == 'r' else \ + CType.ReadWrite.writeonly if name[i] == 'B' else CType.ReadWrite.readwrite + depth = depth + 1 + elif name[i] == '_': + if depth == 0: + raise ValueError(f"Invalid type {name}") + elif depth == 1: + assert beg is not None, "Unreachable" + assert t is not None, "Unreachable" + return name[:beg], (t, name[beg+1:i], name[i+1:]) + depth = depth - 1 + + return name, None + + def __init__(self, name_t: Tuple[str, 'CType.ReadWrite'], clause: Clause, filespec: 'FileSpec') -> None: + self.name = name_t[0] + self.type = name_t[1] + if self.type is CType.ReadWrite.none: + self.structname = self.name + self.structname2 = self.name + elif self.type is CType.ReadWrite.readonly: + self.structname = "r" + self.name + "_" + self.structname2 = "struct_" + self.name + elif self.type is CType.ReadWrite.writeonly: + self.structname = "B" + self.name + "_" + self.structname2 = "struct_" + self.name + elif self.type is CType.ReadWrite.readwrite: + self.structname = "b" + self.name + "_" + self.structname2 = "struct_" + self.name + else: + self.structname = "//" + self.name + self.structname2 = "//" + self.name + self.recursive: List[CType] = [] + self.replaced = self.name + + if len(name_t[0]) != 1: + replaced = [] + pre, tmp = CType.find_next(self.name) + while tmp is not None: + self.recursive.extend(CType((c, CType.ReadWrite.none), clause, filespec) for c in pre) + self.recursive.append(CType((tmp[1], tmp[0]), clause, filespec)) + replaced.append(pre) + pre, tmp = CType.find_next(tmp[2]) + self.recursive.extend(CType((c, CType.ReadWrite.none), clause, filespec) for c in pre) + replaced.append(pre) + self.replaced = 'B'.join(replaced) + + self.asret: Optional[str] = None + self.aspre: Optional[str] = None + self.asarg: Optional[str] = None + self.aspost: Optional[str] = None + + def describe(self, spacer=""): + nl = "" if len(self.recursive) == 0 else f"\n{spacer}+-> " + if self.type is CType.ReadWrite.none: + t = "" + elif self.type is CType.ReadWrite.readonly: + t = " (r-)" + elif self.type is CType.ReadWrite.writeonly: + t = " (-w)" + elif self.type is CType.ReadWrite.readwrite: + t = " (rw)" + else: + t = " ?!?!" + return f"{self.structname} => {self.replaced}+{len(self.recursive)}{t}{nl}" + \ + f"\n{spacer}+-> ".join(r.describe(spacer + " ") for r in self.recursive) + + def generate_converters(self) -> None: + if self.asret is not None: + return # Already done: probably a base type + + self.asret = "\n#error TODO? Cannot return custom structure\n" + self.aspre = f"struct_{self.name}_t arg_{{p}}={{{{0}}}}; " + ("" if not self.type.pre else \ + f"if (*(ptr_t*)(from_ptr((R_ESP + {{p}})))) from_{self.structname2}(&arg_{{p}}, *(ptr_t*)(from_ptr((R_ESP + {{p}})))); ") + self.asarg = "*(ptr_t*)(from_ptr((R_ESP + {p}))) ? &arg_{p} : NULL, " + self.aspost = "" if not self.type.post else \ + (" if (*(ptr_t*)(from_ptr((R_ESP + {p})))) to_" + self.structname2 + \ + "(*(ptr_t*)(from_ptr((R_ESP + {p}))), &arg_{p});") + + for rec in self.recursive: + rec.generate_converters() +class CTypeNone(CType, metaclass=FirstArgumentSingletonMeta): + def __init__(self, name: str, clause: Clause, filespec: 'FileSpec') -> None: + super().__init__((name, CType.ReadWrite.none), clause, filespec) + +CType.ReadWrite.none = CType.ReadWrite(False, False) # Uppermost type +CType.ReadWrite.readonly = CType.ReadWrite(True, False) +CType.ReadWrite.writeonly = CType.ReadWrite(False, True) +CType.ReadWrite.readwrite = CType.ReadWrite(True, True) + +class FileSpec: + class Struct: + def __init__(self, name: str, repl: str) -> None: + self.name = name + self.repl = repl + + # CONSTANT- values: original set + # CONSTANT- rvalues: valid replacement values (outside of structures) + # CONSTANT- validrepl: valid replacement values (for structures) + # structs: structure ids and additional data + values: Sequence[str] = ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'K', 'l', 'L', 'p', 'h', 'H', 'a', 'A', 'V', 'O', 'S', '2', 'P', 'N', 'M', 's', 'r', 'b', 'B', '_', 't', 'X', 'n'] + rvalues: Sequence[str] = ['E', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'K', 'l', 'L', 'p', 'h', 'H', 'a', 'A', 'V', 'O', 'S', '2', 'P', 'N', 'M', 's', 'r', 'b', 'B', '_', 't', 'X', 'n'] + validrepl: Sequence[str] = ['c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'K', 'l', 'L', 'p', 'h', 'H', 'a', 'A', 'V', 'O', 'S', '2', 'P', 'N', 'M', 's', 'r', 'b', 'B', '_'] + + def __init__(self) -> None: + self.structs: CustOrderedDict[str, FileSpec.Struct] = CustOrderedDict() + + self.typedefs: CustOrderedDictList[_BareFunctionType, Function] = CustOrderedDictList() + self.structsuses: List[FunctionType] = [] + + def registerStruct(self, id: str, name: str, repl: str) -> None: + if len(id) != 1: + # If you REALLY need it, consider opening a ticket + # Before you do, consider that everything that is a valid in a C token is valid here too + raise ValueError("Type ID \"" + id + "\" is too long!") + if id in self.rvalues: + raise ValueError("Type " + id + " is already reserved!") + if id in self.structs: + raise ValueError("Type " + id + " is already used!") + if any(c not in self.validrepl for c in repl): + raise ValueError("Invalid structure replacement value \"" + repl + "\" (note: recursive replacements are not supported)") + if repl == "": + # If you need this, please open an issue (also, this is never actually called, empty strings are removed at the calling site) + raise NotImplementedError("Invalid structure metadata supply (empty replacement)") + + self.structs[id] = FileSpec.Struct(name, repl) + +class FunctionType(metaclass=FirstArgumentSingletonMeta): + def __new__(cls, string: str, clause: Clause, filespec: FileSpec) -> 'FunctionType': + if ((string[0] not in FileSpec.values) or any(c not in FileSpec.values for c in string[2:])) \ + and ((string[0] in FileSpec.values) or (string[0] in filespec.structs)) \ + and all((c != 'v') and (c in FileSpec.values) or (c in filespec.structs) for c in string[2:]): + return super().__new__(StructFunctionType) + else: + return super().__new__(cls) + + def __init__(self, string: str, clause: Clause, filespec: FileSpec) -> None: + # Early fail + if 'VV' in string: + raise ValueError("'V' can only be at the end of the type (use 's' instead)") + + self.orig = CTypeNone(string, clause, filespec) + + self.hasemu = 'E' in self.orig.replaced and ( + (self.orig.recursive[1].structname != 'E') or ('E' in self.orig.recursive[0].name) or any('E' in ct.name for ct in self.orig.recursive[2:])) + if self.hasemu: + if ("E" in self.orig.recursive[0].name) or any("E" in ct.name for ct in self.orig.recursive[3:]): + raise NotImplementedError("x64emu_t* not as the first parameter") + if len(self.orig.replaced) < 4: + raise NotImplementedError("Type {0} too short".format(self.orig.replaced)) + chk_type = self.orig.recursive[0].structname + ''.join(map(lambda ct: ct.structname, self.orig.recursive[3:])) + else: + if len(self.orig.replaced) < 3: + raise NotImplementedError("Type {0} too short".format(self.orig.replaced)) + chk_type = self.orig.recursive[0].structname + ''.join(map(lambda ct: ct.structname, self.orig.recursive[2:])) + self.withoutE = _BareFunctionType(string[0:2] + chk_type[1:], clause, filespec, isinstance(self, StructFunctionType)) + self._bare = _BareFunctionType(self.orig.name, clause, filespec, isinstance(self, StructFunctionType)) + if len(chk_type) < 2: + raise NotImplementedError("Type {0} too short".format(string)) + + if self.orig.recursive[1].structname not in ['E', 'F']: + raise NotImplementedError("Bad middle letter {0}".format(self.orig.recursive[1].structname)) + + self.redirect = any(c not in FileSpec.values for c in chk_type) or (('v' in chk_type[1:]) and (len(chk_type) > 2)) + self.usestruct: bool = False + self.redirected: Optional[FunctionType] = None + if self.redirect: + if all(((i == 0) or (c != 'v')) and (c in FileSpec.values) or (c in filespec.structs) for i, c in enumerate(chk_type)): + # 'v' is never allowed here + self.redirect = False + self.usestruct = True + return + else: + if any(c not in FileSpec.rvalues for c in chk_type): + raise NotImplementedError("Invalid type {0}".format(string)) + + # Ok, this is acceptable: there is void + string = string[:2] + (string[2:] + .replace("v", "")) # void -> nothing + assert(len(string) >= 3) # If this raises, don't use 'vFvvvvvv' as a signature... + self.redirected = FunctionType(string, clause, filespec) + assert(not self.redirected.redirect and not self.redirected.usestruct) + + def getchar(self, c: str) -> int: + return self._bare.getchar(c) + def getcharidx(self, i: int) -> int: + return self._bare.getcharidx(i) + def splitchar(self) -> List[int]: + return self._bare.splitchar() + + def __hash__(self) -> int: + return str.__hash__(self.orig.name) + def __eq__(self, o: object): + return isinstance(o, FunctionType) and ((self.orig.name == o.orig.name) and (o is self or not isinstance(self, StructFunctionType))) +class StructFunctionType(FunctionType): + def __init__(self, string: str, clause: Clause, filespec: FileSpec) -> None: + super().__init__(string, clause, filespec) + assert(self.usestruct) + self.filespec = filespec + self.filespec.structsuses.append(self) + + self.returnsstruct = string[0] in self.filespec.structs + if self.returnsstruct: + if self.hasemu: + string = "pFEp" + string[3:] + else: + string = "pFp" + string[2:] + + for struct in self.filespec.structs: + string = string.replace(struct, self.filespec.structs[struct].repl) + self.redirected = FunctionType(string, clause, self.filespec) + +class _BareFunctionType(FunctionType): # Fake derived + def __new__(cls, *largs, **kwargs): + return object.__new__(cls) + def __init__(self, string: str, clause: Clause, filespec: FileSpec, isstruct: bool) -> None: + self.orig = CTypeNone(string, clause, filespec) + self.filespec = filespec + self.isstruct = isstruct + + def getchar(self, c: str) -> int: + if c in FileSpec.rvalues: + return FileSpec.rvalues.index(c) + else: + assert(self.isstruct) + return self.filespec.structs.__keys__.index(c) + len(FileSpec.rvalues) + def getcharidx(self, i: int) -> int: + return self.getchar(self.orig.replaced[i]) + + def splitchar(self) -> List[int]: + try: + ret = [ + len(self.orig.replaced), len(self.orig.name), self.getcharidx(0), + *map(self.getcharidx, range(2, len(self.orig.replaced))) + ] + return ret + except ValueError as e: + raise ValueError("Value is " + self.orig.replaced + ":\n" + self.orig.describe()) from e + except AssertionError as e: + raise ValueError("Value is " + self.orig.replaced + ":\n" + self.orig.describe()) from e + +# Allowed GOs: GO,GOM,GO2,GOS,GOW,GOWM,GOW2,GO2S +class Function: + def __init__(self, name: str, funtype: FunctionType, gotype: str, filespec: FileSpec, filename: Filename, line: str) -> None: + self._noE = False + + self.no_dlsym: bool = False + if "//%" in line: + additional_meta = line.split("//%")[1].split(" ")[0].strip() + + if additional_meta.endswith(",noE"): + self._noE = True + additional_meta = additional_meta[:-4] + + if additional_meta == 'noE': + assert not self._noE, "Duplicated 'noE'" + self._noE = True + elif additional_meta == '%': + self.no_dlsym = True + else: + raise NotImplementedError("Changing the function type 'on the fly' is not supported") + + funtypeerr = ValueError("Invalid function type " + gotype) + if not gotype.startswith("GO"): + raise funtypeerr + gotype = gotype[2:] + self.isweak = (len(gotype) > 0) and (gotype[0] == "W") + if self.isweak: + gotype = gotype[1:] + self.ismy = (len(gotype) > 0) and (gotype[0] == "M") + self.is2 = (len(gotype) > 0) and (gotype[0] == "2") + self.retS = (len(gotype) > 0) and (gotype[0] == "S") + if self.ismy or self.is2 or self.retS: + gotype = gotype[1:] + if self.retS: + self.ismy = True + assert((self.no_dlsym and (funtype.orig.name.startswith("pFp") or funtype.orig.name.startswith("pFEp") or funtype.orig.name.startswith("pEp") or funtype.orig.name.startswith("pEEp"))) + or (isinstance(funtype, StructFunctionType) and funtype.returnsstruct)), \ + "Maybe TODO? (Returns unregistered structure)" + self._noE = self._noE or self.no_dlsym + if isinstance(funtype, StructFunctionType) and funtype.returnsstruct and not self.retS: + gotype = "GO" + \ + ("W" if self.isweak else "") + \ + ("M" if self.ismy else "") + ("2" if self.is2 else "") + raise ValueError("Function " + name + " of type " + funtype.orig.name + \ + " needs to return a structure, but doesn't (currently " + gotype + ")") + if gotype != "": + raise funtypeerr + + self.name = name + self.type = funtype + self.filespec = filespec + assert(not isinstance(funtype, StructFunctionType) or filespec is funtype.filespec) # No reason why not, so assert() + + if self.is2: + self.fun2 = line.split(',')[2].split(')')[0].strip() + if (self.type.hasemu != self.fun2.startswith("my32_") and self.type.hasemu != self.fun2.startswith("my_")) and not self._noE: + # If this raises because of a different prefix, open a pull request + print("\033[91mThis is probably not what you meant!\033[m ({0}:{1})".format(filename, line[:-1]), file=sys.stderr) + self.invalid = True + + if (self.ismy and not self.type.hasemu and not self.is2) and not self._noE: + # Probably invalid on box86; if not so, remove/comment this whole 'if' (and also open an issue) + print("\033[94mAre you sure of this?\033[m ({0}:{1})".format(filename, line[:-1]), file=sys.stderr) + self.invalid = True + return + if self.type.hasemu and not self.ismy and not self.is2: + # Certified invalid + print("\033[91mThis is probably not what you meant!\033[m ({0}:{1})".format(filename, line[:-1]), file=sys.stderr) + self.invalid = True + return + if self._noE and not self.ismy and not self.is2: + raise ValueError("Invalid meta: 'no E' provided but function is not a GOM") + + if self.ismy or self.is2: + # Add this to the typedefs + self.filespec.typedefs[self.type.withoutE].append(self) + +JumbledFunctions = CustOrderedDictList[Clause, Function] +FilesSpecific = Dict[Filename, FileSpec] + +SortedGlobals = CustOrderedDictList[Clauses, FunctionType] +SortedRedirects = CustOrderedDictList[Clauses, FunctionType] + +def readFiles(files: Iterable[str]) -> Tuple[JumbledFunctions, JumbledFunctions, FilesSpecific]: + """ + readFiles + + This function is the one that parses the files. + """ + + gbls: JumbledFunctions = CustOrderedDictList() + redirects: JumbledFunctions = CustOrderedDictList() + filespecs: FilesSpecific = {} + + symbols: Dict[str, Filename] = {} + need_halt: bool = False + + for filepath in files: + filename: Filename = filepath.split("/")[-1] + dependants: Clause = Clause() + + filespec = FileSpec() + filespecs[filename[:-10]] = filespec + + def add_symbol_name(symname: Optional[str], weak: bool = False, symsname: Dict[str, List[Tuple[str, bool]]] = {"": []}): + # Optional arguments are evaluated only once! + nonlocal need_halt + if symname is None: + for c in symsname: + if (c != "") and (len(symsname[c]) != 0): + # Note: if this condition ever raises, check the wrapper pointed by it. + # If you find no problem, comment the error below, add a "pass" below (so python is happy) + # and open a ticket so I can fix this. + raise NotImplementedError("Some symbols are only implemented under one condition '{0}' (probably) ({1}/{2})" + .format(c, symsname[c][0][0], filename) + " [extra note in the script]") + for s, w in symsname[c]: + if w: continue # Weak symbols never conflict with others in different libraries + + if s in ( + '_init', '_fini', + '__bss_start', '__bss_start__', '__bss_end__', '_bss_end__', + '__data_start', '_edata', + '_end', '__end__'): + continue # Always allow those symbols [TODO: check if OK] + if s in symbols: + # Check for resemblances between symbols[s] and filename + # if filename.startswith(symbols[s][:-12]) or symbols[s].startswith(filename[:-12]): + # # Probably OK + # continue + # Manual incompatible libs detection + match = lambda l, r: (filename[7:-10], symbols[s][7:-10]) in [(l, r), (r, l)] + if match("gdkx112", "gdk3") \ + or match("gtkx112", "gtk3") \ + or match("libjpeg", "libjpeg62") \ + or match("libncurses", "libncurses6") \ + or match("libncurses", "libncursesw") \ + or match("libncurses6", "libncursesw") \ + or match("libtinfo6", "libtinfo") \ + or match("png12", "png16") \ + or match("sdl1", "sdl2") \ + or match("sdl1image", "sdl2image") \ + or match("sdl1mixer", "sdl2mixer") \ + or match("sdl1net", "sdl2net") \ + or match("sdl1ttf", "sdl2ttf") \ + or match("smpeg", "smpeg2") \ + or match("udev0", "udev1") \ + or match("gstinterfaces010","gstvideo")\ + or match("gstinterfaces010","gstaudio")\ + or match("gstreamer010","gstreamer") \ + or match("appindicator","appindicator3")\ + or match("libgl", "libegl") \ + or match("libgl", "libglx") \ + or match("libgl", "libglxnvidia")\ + \ + or match("libc", "tcmallocminimal") \ + or match("libc", "ldlinux") \ + : + # libc and ldlinux have some "__libc_" data symbols in common... TODO check if ok + continue + + # Note: this test is very (too) simple. If it ever raises, comment + # `need_halt = True` and open an issue. + print("The symbol {0} is declared in multiple files ({1}/{2})" + .format(s, symbols[s], filename) + " [extra note in the script]", file=sys.stderr) + need_halt = True + symbols[s] = filename + else: + symname = symname.strip() + if symname == "": + raise ValueError("This symbol name (\"\") is suspicious... ({0})".format(filename)) + + l = len(dependants.defines) + already_pst = any(s == symname for s, _ in symsname[""]) + if l == 1: + symsname.setdefault(str(dependants), []) + already_pst = already_pst or any(s == symname for s, _ in symsname[str(dependants)]) + if already_pst: + print("The symbol {0} is duplicated! ({1})".format(symname, filename), file=sys.stderr) + need_halt = True + return + if l == 1: + s = str(dependants.defines[0].inverted()) + if (s in symsname) and ((symname, weak) in symsname[s]): + symsname[s].remove((symname, weak)) + symsname[""].append((symname, weak)) + elif (s in symsname) and ((symname, not weak) in symsname[s]): + print("The symbol {0} doesn't have the same 'weakness' in different conditions! ({1})" + .format(symname, filename), file=sys.stderr) + need_halt = True + else: + symsname[str(dependants)].append((symname, weak)) + elif l == 0: + symsname[""].append((symname, weak)) + + with open(filepath, 'r') as file: + for line in file: + ln = line.strip() + + try: + # If the line is a `#' line (#ifdef LD80BITS/#ifndef LD80BITS/header) + if ln.startswith("#"): + preproc_cmd = ln[1:].strip() + if preproc_cmd.startswith("if defined(GO)"): + continue #if defined(GO) && defined(GOM)... + elif preproc_cmd.startswith("if !(defined(GO)"): + continue #if !(defined(GO) && defined(GOM)...) + elif preproc_cmd.startswith("error"): + continue #error meh! + elif preproc_cmd.startswith("include"): + continue #inherit other library + elif preproc_cmd.startswith("endif"): + dependants.pop_last() + elif preproc_cmd.startswith("ifdef"): + dependants.append(Define(DefineType(preproc_cmd[5:].strip()), False)) + elif preproc_cmd.startswith("ifndef"): + dependants.append(Define(DefineType(preproc_cmd[6:].strip()), True)) + elif preproc_cmd.startswith("else"): + dependants.invert_last() + else: + raise NotImplementedError("Unknown preprocessor directive: {0}".format(preproc_cmd.split(" ")[0])) + + # If the line is a `GO...' line (GO/GOM/GO2/...)... + elif ln.startswith("GO"): + # ... then look at the second parameter of the line + try: + gotype = ln.split("(")[0].strip() + funname = ln.split(",")[0].split("(")[1].strip() + ln = ln.split(",")[1].split(")")[0].strip() + except IndexError: + raise NotImplementedError("Invalid GO command") + + fun = Function(funname, FunctionType(ln, dependants, filespec), gotype, filespec, filename, line) + if not filename.endswith("_genvate.h"): + add_symbol_name(fun.name, fun.isweak) + + if hasattr(fun, 'invalid'): + need_halt = True + continue + + if fun.type.redirect or fun.type.usestruct: + redirects[dependants.copy()].append(fun) + else: + gbls[dependants.copy()].append(fun) + + # If the line is a structure metadata information... + elif ln.startswith("//%S"): + metadata = [e for e in ln.split() if e] + if len(metadata) != 4: + # If you need an empty replacement, please open a PR + raise NotImplementedError("Invalid structure metadata supply (too many/not enough fields)") + if metadata[0] != "//%S": + raise NotImplementedError("Invalid structure metadata supply (invalid signature)") + + filespec.registerStruct(metadata[1], metadata[2], metadata[3]) + + # If the line contains any symbol name... + elif ("GO" in ln) or ("DATA" in ln): + if filename.endswith("_genvate.h"): + continue + # Probably "//GO(..., " or "DATA(...," at least + try: + symname = ln.split('(')[1].split(',')[0].strip() + add_symbol_name(symname) + except IndexError: + # Oops, it wasn't... + pass + except Exception as e: + raise NotImplementedError("{0}:{1}".format(filename, line[:-1])) from e + + if filename.endswith("_genvate.h"): + del filespecs[filename[:-10]] + + add_symbol_name(None) + FunctionType.getSingletons().clear() + + if need_halt: + raise ValueError("Fix all previous errors before proceeding") + + return gbls, redirects, filespecs + +def sortArrays(gbl_funcs: JumbledFunctions, red_funcs: JumbledFunctions, filespecs: FilesSpecific) \ + -> Tuple[SortedGlobals, SortedRedirects]: + # First sort file specific stuff + for fn in filespecs: + filespecs[fn].typedefs.sort(key=_BareFunctionType.splitchar) + for funtype in filespecs[fn].typedefs: + filespecs[fn].typedefs[funtype].sort(key=lambda f: f.name) + + filespecs[fn].structs.sort() + filespecs[fn].structsuses.sort(key=FunctionType.splitchar) + + # Now, take all function types, and make a new table gbl_vals + # This table contains all #if conditions for when a function type needs to + # be generated. + def add_to_vals(vals: Dict[FunctionType, Clauses], t: FunctionType, clause: Clause) -> None: + vals.setdefault(t, Clauses()) + if clause in vals[t].clauses: return + vals[t].add(clause) + + gbl_vals: Dict[FunctionType, Clauses] = {} + for clause in gbl_funcs: + for f in gbl_funcs[clause]: + add_to_vals(gbl_vals, f.type, clause) + for clause in red_funcs: + for f in red_funcs[clause]: + assert(f.type.redirected is not None) + add_to_vals(gbl_vals, f.type.redirected, clause) + + # Remove duplicate/useless conditions (and sort) + for t in gbl_vals: + gbl_vals[t].reduce() + + # Now create a new gbls + # gbls will contain the final version of gbls (without duplicates, based on + # gbl_vals), meaning, a dict from clauses to function types to implement + gbls: SortedGlobals = CustOrderedDictList() + for funtype in gbl_vals: + gbls[gbl_vals[funtype]].append(funtype) + # Sort the #if clauses as defined in `splitdef` + gbls.sort(key=Clauses.splitdef) + + # Sort the function types as defined in `splitchar` + for clauses in gbls: + gbls[clauses].sort(key=FunctionType.splitchar) + + # This map will contain all additional function types that are "redirected" + # to an already defined type (with some remapping). + red_vals: Dict[FunctionType, Clauses] = {} + for clause in red_funcs: + for f in red_funcs[clause]: + if isinstance(f.type, StructFunctionType): continue + assert(f.type.redirected is not None) + add_to_vals(red_vals, f.type, clause) + + # Also do the same sorting as before (it also helps keep the order + # in the file deterministic) + for t in red_vals: + red_vals[t].reduce() + + redirects: SortedRedirects = CustOrderedDictList() + for funtype in red_vals: + redirects[red_vals[funtype]].append(funtype) + redirects.sort(key=Clauses.splitdef) + + def fail(): assert False, "value has no redirect" + for clauses in redirects: + redirects[clauses].sort(key=lambda v: fail() if v.redirected is None else v.splitchar() + v.redirected.splitchar()) + + return gbls, redirects + +def checkRun(root: str, gbls: SortedGlobals, redirects: SortedRedirects, filesspec: FilesSpecific) -> Optional[str]: + # Check if there was any new functions compared to last run + functions_list: str = "" + for clauses in gbls: + for v in gbls[clauses]: + functions_list = functions_list + "#" + str(clauses) + " " + v.orig.name + " -> " + v.orig.replaced + "\n" + for clauses in redirects: + for v in redirects[clauses]: + assert(v.redirected is not None) + functions_list = functions_list + "#" + str(clauses) + " " + v.orig.name + " -> " + v.redirected.orig.name + "\n" + for filename in sorted(filesspec.keys()): + functions_list = functions_list + filename + ":\n" + for st in filesspec[filename].structs: + struct = filesspec[filename].structs[st] + functions_list = functions_list + \ + "% " + st + " " + struct.name + " " + struct.repl + "\n" + for _bare in filesspec[filename].typedefs: + functions_list = functions_list + "- " + _bare.orig.name + ":\n" + for fn in filesspec[filename].typedefs[_bare]: + if fn.no_dlsym: continue + functions_list = functions_list + " - " + fn.name + "\n" + for funtype in filesspec[filename].structsuses: + assert(funtype.redirected is not None) + functions_list = functions_list + "% " + funtype.orig.name + " -> " + funtype.redirected.orig.name + "\n" + + # functions_list is a unique string, compare it with the last run + try: + last_run = "" + with open(os.path.join(root, "src", "wrapped32", "generated", "functions_list.txt"), 'r') as file: + last_run = file.read() + if last_run == functions_list: + # Mark as OK for CMake + with open(os.path.join(root, "src", "wrapped32", "generated", "functions_list.txt"), 'w') as file: + file.write(functions_list) + return None + except IOError: + # The file does not exist yet, first run + pass + + return functions_list + +def generate_files(root: str, files: Iterable[str], ver: str, gbls: SortedGlobals, redirects: SortedRedirects, \ + filespecs: FilesSpecific) -> None: + # Generate converters + asreturns = [ + "\n#error Invalid return type: emulator\n", # E + "fn({0});", # v + "R_EAX = fn({0});", # c + "R_EAX = fn({0});", # w + "R_EAX = fn({0});", # i + "ui64_t r; r.i = fn({0}); R_EAX = r.d[0]; R_EDX = r.d[1];", # I + "R_EAX = (unsigned char)fn({0});", # C + "R_EAX = (unsigned short)fn({0});", # W + "R_EAX = (uint32_t)fn({0});", # u + "ui64_t r; r.u = (uint64_t)fn({0}); R_EAX = r.d[0]; R_EDX = r.d[1];", # U + "float fl = fn({0}); fpu_do_push(emu); ST0val = fl;", # f + "double db = fn({0}); fpu_do_push(emu); ST0val = db;", # d + "long double ld = fn({0}); fpu_do_push(emu); ST0val = ld;", # D + "double db = fn({0}); fpu_do_push(emu); ST0val = db;", # K + "R_EAX = to_long(fn({0}));", # l + "R_EAX = to_ulong(fn({0}));", # L + "R_EAX = to_ptrv(fn({0}));", # p + "R_EAX = to_hash(fn({0}));", # h + "R_EAX = to_hash_d(fn({0}));", # H + "R_EAX = to_locale(fn({0}));", # a + "R_EAX = to_locale_d(fn({0}));", # A + "\n#error Invalid return type: va_list\n", # V + "\n#error Invalid return type: at_flags\n", # O + "R_EAX = to_ptrv(io_convert_from(fn({0})));", # S + "\n#error Invalid return type: _2uint_struct\n", # 2 + "\n#error Invalid return type: Vulkan Struct\n", # P + "\n#error Invalid return type: ... with 1 arg\n", # N + "\n#error Invalid return type: ... with 2 args\n", # M + "\n#error Invalid return type: address on the stack\n", # s + "\n#error Invalid return type: ro structure declaration\n", # r + "\n#error Invalid return type: rw structure declaration\n", # b + "\n#error Invalid return type: wo structure declaration\n", # B + "\n#error Invalid return type: end of structure declaration\n", # _ + "R_EAX = to_cstring(fn({0}));", # t + "R_EAX = to_ptrv(addDisplay(fn({0})));", # X + "\n#error Invalid return type: xcb_connection_t*\n", # n + ] + asargs = [ + "emu, ", # E + "", # v + "from_ptri(int8_t, R_ESP + {p}), ", # c + "from_ptri(int16_t, R_ESP + {p}), ", # w + "from_ptri(int32_t, R_ESP + {p}), ", # i + "from_ptri(int64_t, R_ESP + {p}), ", # I + "from_ptri(uint8_t, R_ESP + {p}), ", # C + "from_ptri(uint16_t, R_ESP + {p}), ", # W + "from_ptri(uint32_t, R_ESP + {p}), ", # u + "from_ptri(uint64_t, R_ESP + {p}), ", # U + "from_ptri(float, R_ESP + {p}), ", # f + "from_ptri(double, R_ESP + {p}), ", # d + "LD2localLD(from_ptrv(R_ESP + {p})), ", # D + "FromLD(from_ptrv(R_ESP + {p})), ", # K + "from_long(from_ptri(long_t, R_ESP + {p})), ", # l + "from_ulong(from_ptri(ulong_t, R_ESP + {p})), ", # L + "from_ptriv(R_ESP + {p}), ", # p + "from_hash(from_ptri(ptr_t, R_ESP + {p})), ", # h + "from_hash_d(from_ptri(ptr_t, R_ESP + {p})), ", # H + "from_locale(from_ptri(ptr_t, R_ESP + {p})), ", # a + "from_locale_d(from_ptri(ptr_t, R_ESP + {p})), ", # A + "from_ptrv(R_ESP + {p}), ", # V + "of_convert32(from_ptri(int32_t, R_ESP + {p})), ", # O + "io_convert32(from_ptriv(R_ESP + {p})), ", # S + "(_2uint_struct_t){{from_ptri(uint32_t, R_ESP + {p}),from_ptri(uint32_t, R_ESP + {p} + 4)}}, ", # 2 + "arg_{p}, ", # P + "from_ptriv(R_ESP + {p}), ", # N + "from_ptriv(R_ESP + {p}),from_ptriv(R_ESP + {p} + 4), ", # M + "from_ptrv(R_ESP + {p}), ", # s + "\n#error Invalid argument type: ro structure declaration\n", # r + "\n#error Invalid argument type: rw structure declaration\n", # b + "\n#error Invalid argument type: wo structure declaration\n", # B + "\n#error Invalid argument type: end of structure declaration\n", # _ + "\n#error Invalid argument type: maybe-high string\n",# t + "getDisplay(from_ptriv(R_ESP + {p})), ", # X + "aligned_xcb, ", # n + ] + if len(FileSpec.values) != len(asreturns): + raise NotImplementedError("len(values) = {lenval} != len(asreturns) = {lenvals}".format(lenval=len(FileSpec.values), lenvals=len(asreturns))) + if len(FileSpec.values) != len(asargs): + raise NotImplementedError("len(values) = {lenval} != len(asargs) = {lenarg}".format(lenval=len(FileSpec.values), lenarg=len(asargs))) + for value, asret, asarg in zip(FileSpec.values, asreturns, asargs): + for ctrw in (CType.ReadWrite.none, CType.ReadWrite.readonly, CType.ReadWrite.writeonly, CType.ReadWrite.readwrite): + if (value, CType.ReadWrite.none) not in CType: + continue # TODO: remove this and fail if one base type is missing? + CType[(value, CType.ReadWrite.none)].asret = asret + CType[(value, CType.ReadWrite.none)].aspre = "" + CType[(value, CType.ReadWrite.none)].asarg = asarg + CType[(value, CType.ReadWrite.none)].aspost = "" + if value == 'n': + CType[(value, CType.ReadWrite.none)].aspre = f"void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + {{p}})); " + CType[(value, CType.ReadWrite.none)].aspost = f" unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + {{p}}));" + for ctn in CType.getSingletons(): + CType[ctn].generate_converters() + + # Detect functions which return in an x87 register + return_x87: str = "DKdf" + if any(c not in FileSpec.values for c in return_x87): + raise NotImplementedError("Invalid character") + + # Files header and guard + files_header = { + "wrapper32.c": """ + #include + #include + #include + #include + + #include "wrapper32.h" + #include "emu/x64emu_private.h" + #include "emu/x87emu_private.h" + #include "regs.h" + #include "x64emu.h" + #include "box32.h" + #include "converter32.h" + + typedef union ui64_s {lbr} + int64_t i; + uint64_t u; + uint32_t d[2]; + {rbr} ui64_t; + + typedef struct _2uint_struct_s {lbr} + uint32_t a; + uint32_t b; + {rbr} _2uint_struct_t; + + extern void* my__IO_2_1_stderr_; + extern void* my__IO_2_1_stdin_ ; + extern void* my__IO_2_1_stdout_; + + static void* io_convert32(void* v) + {lbr} + if(!v) + return v; + if(v==my__IO_2_1_stderr_) + return stderr; + if(v==my__IO_2_1_stdin_) + return stdin; + if(v==my__IO_2_1_stdout_) + return stdout; + return v; + {rbr} + + static void* io_convert_from(void* v) + {lbr} + if(!v) + return v; + if(v==stderr) + return my__IO_2_1_stderr_; + if(v==stdin) + return my__IO_2_1_stdin_; + if(v==stdout) + return my__IO_2_1_stdout_; + return v; + {rbr} + + typedef struct my_GValue_s + {lbr} + int g_type; + union {lbr} + int v_int; + int64_t v_int64; + uint64_t v_uint64; + float v_float; + double v_double; + void* v_pointer; + {rbr} data[2]; + {rbr} my_GValue_t; + + static void alignGValue(my_GValue_t* v, void* value) + {lbr} + v->g_type = *(int*)value; + memcpy(v->data, value+4, 2*sizeof(double)); + {rbr} + static void unalignGValue(void* value, my_GValue_t* v) + {lbr} + *(int*)value = v->g_type; + memcpy(value+4, v->data, 2*sizeof(double)); + {rbr} + + void* VulkanFromx86(void* src, void** save); + void VulkanTox86(void* src, void* save); + + #define ST0val ST0.d + + int of_convert32(int); + + void* getDisplay(void*); + void* addDisplay(void*); + + void* align_xcb_connection32(void* src); + void unalign_xcb_connection32(void* src, void* dst); + + """, + "wrapper32.h": """ + #ifndef __WRAPPER32_H_ + #define __WRAPPER32_H_ + #include + #include + + typedef struct x64emu_s x64emu_t; + + // the generic wrapper pointer functions + typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc); + + // list of defined wrappers + // E = current x64emu struct + // v = void + // C = unsigned byte c = char + // W = unsigned short w = short + // u = uint32, i = int32 + // U = uint64, I = int64 + // L = unsigned long, l = signed long (long is an int with the size of a pointer) + // p = pointer + // h = hash (32<->64bits) + // H = hash (32<->64bits) that will be deleted from hashmaps + // a = locale + // A = locale that will be deleted from hashmaps + // f = float, d = double, D = long double, K = fake long double + // V = vaargs, s = address on the stack (doesn't move forward the pointer) + // O = libc O_ flags bitfield + // o = stdout + // S = _IO_2_1_stdXXX_ pointer (or FILE*) + // 2 = struct of 2 uint + // N = ... automatically sending 1 arg + // M = ... automatically sending 2 args + // P = Vulkan struct pointer + // r..._ = pointer to read-only structure + // B..._ = pointer to write-only structure + // b..._ = pointer to read-write structure + // t = char* as a return value (copies to a lower address if the return address is too high) + // X = Display* + + """, + "converter32.c": """ + #include "converter32.h" + """, + "converter32.h": """ + #ifndef __CONVERTER32_H_ + #define __CONVERTER32_H_ + """, + "fntypes32.h": """ + #ifndef __{filename}TYPES32_H_ + #define __{filename}TYPES32_H_ + + #ifndef LIBNAME + #error You should only #include this file inside a wrapped*.c file + #endif + #ifndef ADDED_FUNCTIONS + #define ADDED_FUNCTIONS() + #endif + + """, + "fndefs32.h": """ + #ifndef __{filename}DEFS32_H_ + #define __{filename}DEFS32_H_ + + """, + "fnundefs32.h": """ + #ifndef __{filename}UNDEFS32_H_ + #define __{filename}UNDEFS32_H_ + + """ + } + files_guard = { + "wrapper32.c": """ + """, + "wrapper32.h": """ + #endif // __WRAPPER32_H_ + """, + "converter32.c": """ + """, + "converter32.h": """ + #endif // __CONVERTER32_H_ + """, + "fntypes32.h": """ + #endif // __{filename}TYPES32_H_ + """, + "fndefs32.h": """ + + #endif // __{filename}DEFS32_H_ + """, + "fnundefs32.h": """ + + #endif // __{filename}UNDEFS32_H_ + """ + } + banner = "/***********************************************************" + ('*'*len(ver)) + "***\n" \ + " * File automatically generated by rebuild_wrappers_32.py (v" + ver + ") *\n" \ + " ***********************************************************" + ('*'*len(ver)) + "***/\n" + trim: Callable[[str], str] = lambda string: '\n'.join(line[2:] for line in string.splitlines())[1:] + # Yes, the for loops are inverted. This is because both dicts should have the same keys. + for fhdr in files_guard: + files_header[fhdr] = banner + trim(files_header[fhdr]) + for fhdr in files_header: + files_guard[fhdr] = trim(files_guard[fhdr]) + + # Typedefs + # E v c w i I C W u U f d D K l L p h H a A V O S 2 P N M s r b B _ t X n + tdtypes = ["x64emu_t*", "void", "int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t", "float", "double", "long double", "double", "intptr_t", "uintptr_t", "void*", "uintptr_t", "uintptr_t", "void*", "void*", "void*", "int32_t", "void*", "_2uint_struct_t", "void*", "...", "...", "void*", "\n#error _\n", "\n#error _\n", "\n#error _\n", "\n#error _\n", "char*", "void*", "void*"] + if len(FileSpec.values) != len(tdtypes): + raise NotImplementedError("len(values) = {lenval} != len(tdtypes) = {lentypes}".format(lenval=len(FileSpec.values), lentypes=len(tdtypes))) + def generate_typedefs(funs: Iterable[FunctionType], file): + for funtype in funs: + def getstr(i: int, ct: CType) -> str: + if ct.type != CType.ReadWrite.none: + return ct.structname2 + "_t*" + elif i < len(tdtypes): + return tdtypes[i] + else: + # We are in a *types.h file + assert(isinstance(funtype, _BareFunctionType) and funtype.isstruct) + return funtype.filespec.structs[funtype.filespec.structs.__keys__[i - len(tdtypes)]].name + if funtype.orig.name.endswith("Ev"): + file.write("typedef " + getstr(funtype.getcharidx(0), funtype.orig.recursive[0]) + + " (*" + funtype.orig.name + "_t)" + "(" + + getstr(funtype.getcharidx(2), funtype.orig.recursive[2]) + ");\n") + else: + file.write("typedef " + getstr(funtype.getcharidx(0), funtype.orig.recursive[0]) + + " (*" + funtype.orig.name + "_t)" + "(" + + ', '.join(getstr(funtype.getcharidx(i), funtype.orig.recursive[i]) + for i in range(2, len(funtype.orig.replaced))) + ");\n") + + # Wrappers + # E v c w i I C W u U f d D K l L p h H a A V O S 2 P N M s r b B _ t X n + deltas = [0, 4, 4, 4, 4, 8, 4, 4, 4, 8, 4, 8, 12, 12, 4, 4, 4, 4, 4, 4, 4, 1, 4, 4, 8, 4, 0, 0, 0, 1, 1, 4, 1, 4, 4, 4] + # Asserts + if len(FileSpec.values) != len(deltas): + raise NotImplementedError("len(values) = {lenval} != len(deltas) = {lendeltas}".format(lenval=len(FileSpec.values), lendeltas=len(deltas))) + + # Helper functions to write the function definitions + def function_args(args: Iterable[Tuple[CType, str]], map: Callable[[CType], str], d: int = 4) -> str: + d = 4 + ret = "" + for arg, c in args: + if d % 4 != 0: + raise ValueError("{d} is not a multiple of 4. Did you try passing a V then something else?".format(d=d)) + + try: + ret = ret + map(arg).format(p=d) + d = d + deltas[FileSpec.values.index(c)] + except KeyError as e: + raise ValueError(arg.describe()) from e + return ret + + def function_writer(f, N: FunctionType, W: str) -> None: + f.write("void {0}_32(x64emu_t *emu, uintptr_t fcn) {2} {1} fn = ({1})fcn; ".format(N.orig.name, W, "{")) + + args = (N.orig.recursive[2:], N.orig.replaced[2:]) + if len(args[0]) == 0: + raise ValueError("Failed to properly parse {0}:\n{1}\nrecursive has length {2} < 3" + .format(N.orig.name, N.orig.describe(), len(N.orig.recursive))) + if len(args[1]) == 0: + raise ValueError("Failed to properly parse {0}:\n{1}\nreplaced ({2}) has length {3} < 3" + .format(N.orig.name, N.orig.describe(), N.orig.replaced, len(N.orig.replaced))) + if len(args[0]) != len(args[1]): + raise ValueError("Failed to properly parse {0}:\n{1}\nrecursive has length {2}, replaced has length {3}" + .format(N.orig.name, N.orig.describe(), len(args[0])+2, len(args[1])+2)) + if (len(args[0]) == 2) and (args[0][0].name == 'E') and (args[0][1].name == 'v'): args = ([args[0][0]], args[1][0]) + + #if any(c in 'PG' for c in args): + # # Vulkan struct or GValue pointer, need to unwrap functions at the end + # delta = 4 + # for c in args: + # if c == 'P': + # f.write("void* save{d} = NULL; void *arg{d} = VulkanFromx86(*(void**)(R_ESP + {d}), &save{d}); ".format(d=delta)) + # if c == 'G': + # f.write("my_GValue_t arg{d}; alignGValue(&arg{d}, *(void**)(R_ESP + {d})); ".format(d=delta)) + # delta = delta + deltas[FileSpec.values.index(c)] + # f.write(vals[FileSpec.values.index(N.orig[0])].format(function_args(args)[:-2])) + # delta = 4 + # for c in args: + # if c == 'P': + # f.write(" VulkanTox86(arg{d}, save{d});".format(d=delta)) + # if c == 'G': + # f.write(" unalignGValue(*(void**)(R_ESP + {d}), &arg{d});".format(d=delta)) + # delta = delta + deltas[FileSpec.values.index(c)] + # f.write(" }\n") + #else: + # # Generic function + # f.write(vals[FileSpec.values.index(N.orig[0])].format(function_args(args)[:-2]) + " }\n") + assert 'P' not in N.orig.name, "TODO: add back Vulkan compatibility" + def assertex(v: Optional[T]) -> T: + assert v is not None, "Value is None" + return v + if N.orig.recursive[1].structname == 'E': + f.write("errno = emu->libc_err; ") + f.write(function_args(zip(args[0], args[1]), lambda ct: assertex(ct.aspre))) + f.write(assertex(N.orig.recursive[0].asret).format(function_args(zip(args[0], args[1]), lambda ct: assertex(ct.asarg))[:-2])) + f.write(function_args(zip(args[0], args[1]), lambda ct: assertex(ct.aspost))) + if N.orig.recursive[1].structname == 'E': + f.write(" emu->libc_err = errno;") + f.write(" }\n") + + # TODO: src/wrapped/generated32/converter32.c&h + # Rewrite the wrapper.c file: + with open(os.path.join(root, "src", "wrapped32", "generated", "wrapper32.c"), 'w') as file: + file.write(files_header["wrapper32.c"].format(lbr="{", rbr="}", version=ver)) + + # First part: typedefs + for clauses in gbls: + if not clauses.empty(): + file.write("\n#if " + str(clauses) + "\n") + generate_typedefs(gbls[clauses], file) + if not clauses.empty(): + file.write("#endif\n") + + file.write("\n") + + # Next part: function definitions + + for clauses in gbls: + if not clauses.empty(): + file.write("\n#if " + str(clauses) + "\n") + for funtype in gbls[clauses]: + function_writer(file, funtype, funtype.orig.name + "_t") + if not clauses.empty(): + file.write("#endif\n") + file.write("\n") + for clauses in redirects: + if not clauses.empty(): + file.write("\n#if " + str(clauses) + "\n") + for funtype in redirects[clauses]: + assert(funtype.redirected is not None) + function_writer(file, funtype, funtype.redirected.orig.name + "_t") + if not clauses.empty(): + file.write("#endif\n") + + # Write the isRetX87Wrapper function + # isRetX87Wrapper + file.write("\nint isRetX87Wrapper32(wrapper_t fun) {\n") + for clauses in gbls: + empty = True + for funtype in gbls[clauses]: + if funtype.orig.name[0] in return_x87: # TODO: put this in a function (functions would request the ABI for more info) + if empty and (not clauses.empty()): + file.write("#if " + str(clauses) + "\n") + empty = False + file.write("\tif (fun == &" + funtype.orig.name + "_32) return 1;\n") + if not empty: + file.write("#endif\n") + file.write("\treturn 0;\n}\n") + + file.write(files_guard["wrapper32.c"].format(lbr="{", rbr="}", version=ver)) + + # Rewrite the wrapper32.h file: + with open(os.path.join(root, "src", "wrapped32", "generated", "wrapper32.h"), 'w') as file: + file.write(files_header["wrapper32.h"].format(lbr="{", rbr="}", version=ver)) + for clauses in gbls: + if not clauses.empty(): + file.write("\n#if " + str(clauses) + "\n") + for funtype in gbls[clauses]: + file.write("void " + funtype.orig.name + "_32(x64emu_t *emu, uintptr_t fnc);\n") + if not clauses.empty(): + file.write("#endif\n") + file.write("\n") + for clauses in redirects: + if not clauses.empty(): + file.write("\n#if " + str(clauses) + "\n") + for funtype in redirects[clauses]: + file.write("void " + funtype.orig.name + "_32(x64emu_t *emu, uintptr_t fnc);\n") + if not clauses.empty(): + file.write("#endif\n") + file.write(files_guard["wrapper32.h"].format(lbr="{", rbr="}", version=ver)) + + for fn in filespecs: + tdtypes[FileSpec.values.index('V')] = "..." + with open(os.path.join(root, "src", "wrapped32", "generated", fn + "types32.h"), 'w') as file: + file.write(files_header["fntypes32.h"].format(lbr="{", rbr="}", version=ver, filename=fn)) + generate_typedefs(filespecs[fn].typedefs, file) + file.write("\n#define SUPER() ADDED_FUNCTIONS()") + for _bare in filespecs[fn].typedefs: + for fun in filespecs[fn].typedefs[_bare]: + if fun.no_dlsym: continue + file.write(" \\\n\tGO({0}, {1}_t)".format(fun.name, _bare.orig.name)) + file.write("\n\n") + file.write(files_guard["fntypes32.h"].format(lbr="{", rbr="}", version=ver, filename=fn)) + + with open(os.path.join(root, "src", "wrapped32", "generated", fn + "defs32.h"), 'w') as file: + file.write(files_header["fndefs32.h"].format(lbr="{", rbr="}", version=ver, filename=fn)) + for defined in filespecs[fn].structsuses: + assert defined.redirected is not None, "Unreachable?" + file.write("#define {defined} {define}\n".format(defined=defined.orig.name, define=defined.redirected.orig.name)) + file.write("#define {defined}_32 {define}_32\n".format(defined=defined.orig.name, define=defined.redirected.orig.name)) + file.write(files_guard["fndefs32.h"].format(lbr="{", rbr="}", version=ver, filename=fn)) + + with open(os.path.join(root, "src", "wrapped32", "generated", fn + "undefs32.h"), 'w') as file: + file.write(files_header["fnundefs32.h"].format(lbr="{", rbr="}", version=ver, filename=fn)) + for defined in filespecs[fn].structsuses: + file.write("#undef {defined}\n".format(defined=defined.orig.name)) + file.write("#undef {defined}_32\n".format(defined=defined.orig.name)) + file.write(files_guard["fnundefs32.h"].format(lbr="{", rbr="}", version=ver, filename=fn)) + +def main(root: str, files: Iterable[str], ver: str): + """ + main -- The main function + + root: the root path (where the CMakeLists.txt is located) + files: a list of files to parse (wrapped*.h) + ver: version number + """ + + # First read the files inside the headers + gbl_funcs, red_funcs, filespecs = readFiles(files) + + if all(not c.empty() for c in gbl_funcs) or all(not c.empty() for c in red_funcs): + print("\033[1;31mThere is suspiciously not many types...\033[m", file=sys.stderr) + print("Check the CMakeLists.txt file. If you are SURE there is nothing wrong" + " (as a random example, `set()` resets the variable...), then comment out the following return.", file=sys.stderr) + print("(Also, the program WILL crash later if you proceed.)", file=sys.stderr) + return 2 # Check what you did, not proceeding + + gbls, redirects = sortArrays(gbl_funcs, red_funcs, filespecs) + + # Check if there was any new functions + functions_list = checkRun(root, gbls, redirects, filespecs) + if functions_list is None: + print("Detected same build as last run, skipping") + return 0 + + # Now the files rebuilding part + generate_files(root, files, ver, gbls, redirects, filespecs) + + # Save the string for the next iteration, writing was successful + with open(os.path.join(root, "src", "wrapped32", "generated", "functions_list.txt"), 'w') as file: + file.write(functions_list) + + return 0 + +if __name__ == '__main__': + limit = [] + for i, v in enumerate(sys.argv): + if v == "--": + limit.append(i) + Define.defines = list(map(DefineType, sys.argv[2:limit[0]])) + if main(sys.argv[1], sys.argv[limit[0]+1:], "0.0.2.2") != 0: + exit(2) + exit(0) diff --git a/runTest.cmake b/runTest.cmake index e9a5a46..699011c 100644 --- a/runTest.cmake +++ b/runTest.cmake @@ -17,13 +17,6 @@ endif() set(ENV{BOX64_LOG} 0) set(ENV{BOX64_NOBANNER} 1) -if( EXISTS ${CMAKE_SOURCE_DIR}/x64lib ) - # we are inside box64 folder - set(ENV{LD_LIBRARY_PATH} ${CMAKE_SOURCE_DIR}/x64lib) -else() - # we are inside build folder - set(ENV{LD_LIBRARY_PATH} ${CMAKE_SOURCE_DIR}/../x64lib) -endif( EXISTS ${CMAKE_SOURCE_DIR}/x64lib ) # run the test program, capture the stdout/stderr and the result var execute_process( diff --git a/src/box32.c b/src/box32.c new file mode 100644 index 0000000..c4ad29d --- /dev/null +++ b/src/box32.c @@ -0,0 +1,342 @@ +#include +#include +#include +#include +#include + +#include "debug.h" +#include "box32.h" +#include "custommem.h" +#include "converter32.h" + +#include "khash.h" + +KHASH_MAP_INIT_INT64(to, ulong_t); +KHASH_MAP_INIT_INT(from, uintptr_t); +KHASH_MAP_INIT_STR(strings, ptr_t); + +static kh_from_t* hash_from = NULL; +static kh_to_t* hash_to = NULL; +#define HASH_MSK 0xf000000f +#define HASH_VAL 0x007fffff +#define HASH_SHIFT 4 +static uint32_t hash_cnt = 1; +static pthread_rwlock_t hash_lock = {0}; +static int hash_running = 0; +// locale +static kh_from_t* locale_from = NULL; +static kh_to_t* locale_to = NULL; +static kh_strings_t* const_strings = NULL; + + +void init_hash_helper() { + hash_from = kh_init(from); + hash_to = kh_init(to); + locale_from = kh_init(from); + locale_to = kh_init(to); + const_strings = kh_init(strings); + pthread_rwlock_init(&hash_lock, NULL); + hash_running = 1; +} +void fini_hash_helper() { + if(!hash_running) + return; + hash_running = 0; + kh_destroy(from, hash_from); + hash_from = NULL; + kh_destroy(to, hash_to); + hash_to = NULL; + hash_cnt = 1; + kh_destroy(from, locale_from); + locale_from = NULL; + kh_destroy(to, locale_to); + locale_to = NULL; + kh_destroy(strings, const_strings); //TODO: does not free memory correctly + const_strings = NULL; + pthread_rwlock_destroy(&hash_lock); +} + +// Convert from hash key to original 64bits value +uintptr_t from_hash(ulong_t l) { + // easy case first + if((l&HASH_MSK)!=HASH_MSK) { + return (uintptr_t)l; + } + if(l==0xffffffff) { + return 0xffffffffffffffffll; + } + // get value from hash table second + uintptr_t ret = 0; + if(!hash_running) { + //printf_log(LOG_INFO, "Warning, from_hash used but hash not running\n"); + return ret; + } + pthread_rwlock_rdlock(&hash_lock); + khint_t k = kh_get(from, hash_from, l); + if (k==kh_end(hash_from)) { + ret = (uintptr_t)l; + } else { + ret = kh_value(hash_from, k); + } + pthread_rwlock_unlock(&hash_lock); + return ret; +} +// same as from_hash +uintptr_t from_hash_d(ulong_t l) { + return from_hash(l); +} + +// Convert from 64bits to hash key, creating it if needed +ulong_t to_hash(uintptr_t p) { + if((p<0x100000000LL) && ((p&HASH_MSK)!=HASH_MSK)) + return (ulong_t)p; + if(p==0xffffffffffffffffll) { + return 0xffffffff; + } + ulong_t ret = 0; + if(!hash_running) { + //printf_log(LOG_INFO, "Warning, to_hash used but hash not running\n"); + return ret; + } + khint_t k; + pthread_rwlock_rdlock(&hash_lock); + k = kh_get(to, hash_to, p); + if(k==kh_end(hash_to)) { + // create a new key, but need write lock! + pthread_rwlock_unlock(&hash_lock); + pthread_rwlock_wrlock(&hash_lock); + ret = HASH_MSK | (((hash_cnt++)&HASH_VAL)<sign = LOCALE_SIGN; + dest->org = (void*)src; + //copy the 2 arrays + for(int i=0; i<13; ++i) { + dest->p0[i] = to_hashv(src->p0[i]); + } + for(int i=0; i<13; ++i) { + dest->p4[i] = to_cstring(src->p4[i]); + } + // copy the 3 ctype int (1st is short int, but int will do) + memcpy(dest->type_b, src->p1-128*sizeof(short), 384*sizeof(short)); + memcpy(dest->tolower, src->p2-128*sizeof(int), 384*sizeof(int)); + memcpy(dest->tohigher, src->p3-128*sizeof(int), 384*sizeof(int)); + dest->p1 = to_ptrv(dest->type_b)+128*sizeof(short); + dest->p2 = to_ptrv(dest->tolower)+128*sizeof(int); + dest->p3 = to_ptrv(dest->tohigher)+128*sizeof(int); +} +void free_struct_locale(const struct_locale_t *src) { + for(int i=0; i<13; ++i) { + to_hash_d((uintptr_t)src->p0[i]); + } + /*for(int i=0; i<13; ++i) { + to_hash_d((uintptr_t)src->p4[i]); + }*/ +} + +// Convert from locale key to original 64bits value +void* from_locale(ptr_t l) { + // easy case first + if(l < 0x100) { + return from_ptrv(l); + } + if(l == 0xffffffff) { + return (void*)-1; + } + // get value from hash table second + void* ret = 0; + if(!hash_running) { + //printf_log(LOG_INFO, "Warning, from_locale used but hash not running\n"); + return ret; + } + struct_locale_32_t* loc = from_ptrv(l); + if(loc->sign==LOCALE_SIGN) + return loc->org; + pthread_rwlock_rdlock(&hash_lock); + khint_t k = kh_get(from, locale_from, l); + if (k==kh_end(locale_from)) { + ret = from_ptrv(l); + } else { + ret = (void*)kh_value(locale_from, k); + } + pthread_rwlock_unlock(&hash_lock); + //from_struct_locale((struct_locale_t*)ret, l); + return ret; +} +// same as from_locale +void* from_locale_d(ptr_t l) { + return from_locale(l); +} + +// Convert from 64bits to locale key, creating it if needed +ptr_t to_locale(void* p) { + if((uintptr_t)p < 0x100) { + return to_ptrv(p); + } + if(p == (void*)-1) { + return 0xffffffff; + } + ptr_t ret = 0; + if(!hash_running) { + //printf_log(LOG_INFO, "Warning, to_locale used but hash not running\n"); + return ret; + } + khint_t k; + pthread_rwlock_rdlock(&hash_lock); + k = kh_get(to, locale_to, (uintptr_t)p); + int conv = 0; + if(k==kh_end(locale_to)) { + // create a new key, but need write lock! + pthread_rwlock_unlock(&hash_lock); + pthread_rwlock_wrlock(&hash_lock); + // a locale_t is 5 pointer! + void* m = calloc(1, sizeof(struct_locale_32_t)); // the 3 ctype value are also inside the locale struct + ret = to_ptrv(m); + // add to hash maps + int r; + k = kh_put(to, locale_to, (uintptr_t)p, &r); + kh_value(locale_to, k) = ret; + k = kh_put(from, locale_from, ret, &r); + kh_value(locale_from, k) = (uintptr_t)p; + conv = 1; + } else { + ret = kh_value(locale_to, k); + } + pthread_rwlock_unlock(&hash_lock); + if(conv) + to_struct_locale(ret, (struct_locale_t*)p); + return ret; +} + +// Convert from 64bits to hash key and delete the entry from both hash table +ptr_t to_locale_d(void* p) { + if((uintptr_t)p < 0x100) + return to_ptrv(p); + ptr_t ret = 0; + if(!hash_running) + return ret; + khint_t k; + pthread_rwlock_wrlock(&hash_lock); + k = kh_get(to, locale_to, (uintptr_t)p); + if(k==kh_end(locale_to)) { + /// should this be an assert? + } else { + ret = kh_value(locale_to, k); + // free the memory + free_struct_locale(p); + free(from_ptrv(ret)); + // delete both entries + k = kh_get(to, locale_to, (uintptr_t)p); + kh_del(to, locale_to, k); + k = kh_get(from, locale_from, ret); + kh_del(from, locale_from, k); + } + pthread_rwlock_unlock(&hash_lock); + return ret; +} + +char* from_cstring(ptr_t p) { + return (char*)from_ptrv(p); +} + +ptr_t to_cstring(char* p) { + if((uintptr_t)p<0x100000000LL) + return to_ptrv(p); + ptr_t ret = 0; + pthread_rwlock_rdlock(&hash_lock); + khint_t k = kh_get(strings, const_strings, p); + if(k==kh_end(const_strings)) { + // create a new key, but need write lock! + pthread_rwlock_unlock(&hash_lock); + pthread_rwlock_wrlock(&hash_lock); + ret = to_ptrv(box32_strdup(p)); + int r; + k = kh_put(strings, const_strings, (char*)from_ptrv(ret), &r); + kh_value(const_strings, k) = ret; + } else + ret = kh_value(const_strings, k); + pthread_rwlock_unlock(&hash_lock); + return ret; +} + +ptr_t to_cstring_d(char* p) { + if((uintptr_t)p<0x100000000LL) + return to_ptrv(p); + ptr_t ret = 0; + pthread_rwlock_wrlock(&hash_lock); + khint_t k = kh_get(strings, const_strings, p); + if(k==kh_end(const_strings)) { + // assert? + } else { + ret = kh_value(const_strings, k); + kh_del(strings, const_strings, k); + box32_free(from_ptrv(ret)); + } + pthread_rwlock_unlock(&hash_lock); + return ret; +} \ No newline at end of file diff --git a/src/box64context.c b/src/box64context.c index 5d5155f..fd396d5 100644 --- a/src/box64context.c +++ b/src/box64context.c @@ -7,6 +7,7 @@ #include #include +#include "os.h" #include "box64context.h" #include "debug.h" #include "elfloader.h" @@ -14,15 +15,18 @@ #include "threads.h" #include "x64trace.h" #include "bridge.h" +#include "alternate.h" #include "librarian.h" #include "library.h" #include "wrapper.h" #include "x64emu.h" #include "signals.h" -#include "rcfile.h" #include "gltools.h" #include "rbtree.h" -#include "dynarec.h" +#include "box64cpu.h" +#ifdef BOX32 +#include "box32.h" +#endif EXPORTDYN void initAllHelpers(box64context_t* context) @@ -31,6 +35,9 @@ void initAllHelpers(box64context_t* context) if(inited) return; my_context = context; + #ifdef BOX32 + init_hash_helper(); + #endif init_pthread_helper(); init_bridge_helper(); init_signal_helper(context); @@ -43,10 +50,12 @@ void finiAllHelpers(box64context_t* context) static int finied = 0; if(finied) return; - DeleteParams(); fini_pthread_helper(context); fini_signal_helper(); fini_bridge_helper(); + #ifdef BOX32 + fini_hash_helper(); + #endif fini_custommem_helper(context); finied = 1; } @@ -63,51 +72,8 @@ int getrand(int maxval) } -void free_tlsdatasize(void* p) -{ - if(!p) - return; - tlsdatasize_t *data = (tlsdatasize_t*)p; - box_free(data->ptr); - box_free(p); - if(my_context) - pthread_setspecific(my_context->tlskey, NULL); -} - void x64Syscall(x64emu_t *emu); - -int unlockMutex() -{ - int ret = unlockCustommemMutex(); - int i; - #ifdef USE_CUSTOM_MUTEX - uint32_t tid = (uint32_t)GetTID(); - #define GO(A, B) \ - i = (native_lock_storeifref2_d(&A, 0, tid)==tid); \ - if(i) { \ - ret|=(1<mutex_trace, 7) - #ifdef DYNAREC - GO(my_context->mutex_dyndump, 8) - #else - GO(my_context->mutex_lock, 8) - #endif - GO(my_context->mutex_tls, 9) - GO(my_context->mutex_thread, 10) - GO(my_context->mutex_bridge, 11) - #undef GO - - return ret; -} +void x86Syscall(x64emu_t *emu); void relockMutex(int locks) { @@ -128,7 +94,7 @@ void relockMutex(int locks) #undef GO } -static void init_mutexes(box64context_t* context) +void init_mutexes(box64context_t* context) { #ifndef DYNAREC pthread_mutexattr_t attr; @@ -169,28 +135,25 @@ static void atfork_child_box64context(void) init_mutexes(my_context); } +int box64_cycle_log_initialized = 0; + void freeCycleLog(box64context_t* ctx) { - if(cycle_log) { - for(int i=0; ilog_call[i]); - box_free(ctx->log_ret[i]); - } + if (BOX64ENV(rolling_log) && box64_cycle_log_initialized) { box_free(ctx->log_call); box_free(ctx->log_ret); ctx->log_call = NULL; ctx->log_ret = NULL; + box64_cycle_log_initialized = 0; } } + void initCycleLog(box64context_t* context) { - if(cycle_log) { - context->log_call = (char**)box_calloc(cycle_log, sizeof(char*)); - context->log_ret = (char**)box_calloc(cycle_log, sizeof(char*)); - for(int i=0; ilog_call[i] = (char*)box_calloc(256, 1); - context->log_ret[i] = (char*)box_calloc(128, 1); - } + if(context && BOX64ENV(rolling_log)) { + context->log_call = (char*)box_calloc(BOX64ENV(rolling_log), 256*sizeof(char)); + context->log_ret = (char*)box_calloc(BOX64ENV(rolling_log), 128*sizeof(char)); + box64_cycle_log_initialized = 1; } } @@ -209,29 +172,30 @@ box64context_t *NewBox64Context(int argc) initCycleLog(context); context->deferredInit = 1; - context->sel_serial = 1; init_custommem_helper(context); - #ifdef DYNAREC - x64test_init(); - #endif - context->maplib = NewLibrarian(context); context->local_maplib = NewLibrarian(context); context->versym = NewDictionnary(); context->system = NewBridge(); // Cannot use Bridge name as the map is not initialized yet // create vsyscall - context->vsyscall = AddBridge(context->system, vFEv, x64Syscall, 0, NULL); + context->vsyscall = AddBridge(context->system, vFEv, box64_is32bits?x86Syscall:x64Syscall, 0, NULL); // create the vsyscalls - context->vsyscalls[0] = AddVSyscall(context->system, 96); - context->vsyscalls[1] = AddVSyscall(context->system, 201); - context->vsyscalls[2] = AddVSyscall(context->system, 309); - // create the alternate to map at address - addAlternate((void*)0xffffffffff600000, (void*)context->vsyscalls[0]); - addAlternate((void*)0xffffffffff600400, (void*)context->vsyscalls[1]); - addAlternate((void*)0xffffffffff600800, (void*)context->vsyscalls[2]); + if(box64_is32bits) { + #ifdef BOX32 + addAlternate((void*)0xffffe400, from_ptrv(context->vsyscall)); + #endif + } else { + context->vsyscalls[0] = AddVSyscall(context->system, 96); + context->vsyscalls[1] = AddVSyscall(context->system, 201); + context->vsyscalls[2] = AddVSyscall(context->system, 309); + // create the alternate to map at address + addAlternate((void*)0xffffffffff600000, (void*)context->vsyscalls[0]); + addAlternate((void*)0xffffffffff600400, (void*)context->vsyscalls[1]); + addAlternate((void*)0xffffffffff600800, (void*)context->vsyscalls[2]); + } // create exit bridge context->exit_bridge = AddBridge(context->system, NULL, NULL, 0, NULL); // get handle to box64 itself @@ -246,28 +210,25 @@ box64context_t *NewBox64Context(int argc) init_mutexes(context); pthread_atfork(NULL, NULL, atfork_child_box64context); - pthread_key_create(&context->tlskey, free_tlsdatasize); - - for (int i=0; i<8; ++i) context->canary[i] = 1 + getrand(255); context->canary[getrand(4)] = 0; printf_log(LOG_DEBUG, "Setting up canary (for Stack protector) at FS:0x28, value:%08X\n", *(uint32_t*)context->canary); // init segments for(int i=0; i<16; i++) { - context->segtls[i].limit = (uintptr_t)-1LL; + context->seggdt[i].limit = (uintptr_t)-1LL; } - context->segtls[10].key_init = 0; // 0x53 selector - context->segtls[10].present = 1; - context->segtls[8].key_init = 0; // 0x43 selector - context->segtls[8].present = 1; - context->segtls[6].key_init = 0; // 0x33 selector - context->segtls[6].present = 1; - context->segtls[5].key_init = 0; // 0x2b selector - context->segtls[5].present = 1; - context->segtls[4].key_init = 0; // 0x23 selector - context->segtls[4].present = 1; - context->segtls[4].is32bits = 1; + // 0x53 selector + context->seggdt[10].present = 1; + // 0x43 selector + context->seggdt[8].present = 1; + // 0x33 selector + context->seggdt[6].present = 1; + // 0x2b selector + context->seggdt[5].present = 1; + // 0x23 selector + context->seggdt[4].present = 1; + context->seggdt[4].is32bits = 1; context->globdata = NewMapSymbols(); context->uniques = NewMapSymbols(); @@ -275,13 +236,14 @@ box64context_t *NewBox64Context(int argc) initAllHelpers(context); #ifdef DYNAREC - context->db_sizes = init_rbtree(); + context->db_sizes = rbtree_init("db_sizes"); #endif return context; } void freeALProcWrapper(box64context_t* context); +void freeCUDAProcWrapper(box64context_t* context); EXPORTDYN void FreeBox64Context(box64context_t** context) { @@ -291,7 +253,12 @@ void FreeBox64Context(box64context_t** context) if(--(*context)->forked >= 0) return; - box64context_t* ctx = *context; // local copy to do the cleanning + box64context_t* ctx = *context; // local copy to do the cleaning + + if(ctx->video_mem) { + munmap(ctx->video_mem, 0x10000); + ctx->video_mem = NULL; + } //clean_current_emuthread(); // cleaning main thread seems a bad idea if(ctx->local_maplib) @@ -345,24 +312,22 @@ void FreeBox64Context(box64context_t** context) box_free(ctx->fullpath); box_free(ctx->box64path); box_free(ctx->bashpath); + box_free(ctx->pythonpath); FreeBridge(&ctx->system); #ifndef STATICBUILD freeGLProcWrapper(ctx); freeALProcWrapper(ctx); + freeCUDAProcWrapper(ctx); + #ifdef BOX32 + #endif #endif if(ctx->stack_clone) box_free(ctx->stack_clone); - void* ptr; - if ((ptr = pthread_getspecific(ctx->tlskey)) != NULL) { - free_tlsdatasize(ptr); - } - pthread_key_delete(ctx->tlskey); - if(ctx->tlsdata) box_free(ctx->tlsdata); @@ -376,8 +341,8 @@ void FreeBox64Context(box64context_t** context) FreeMapSymbols(&ctx->uniques); #ifdef DYNAREC - //dynarec_log(LOG_INFO, "BOX64 Dynarec at exit: Max DB=%d, righter=%d\n", ctx->max_db_size, rb_get_righter(ctx->db_sizes)); - delete_rbtree(ctx->db_sizes); + //dynarec_log(LOG_INFO, "BOX64 Dynarec at exit: Max DB=%d, rightmost=%d\n", ctx->max_db_size, rb_get_rightmost(ctx->db_sizes)); + rbtree_delete(ctx->db_sizes); #endif finiAllHelpers(ctx); @@ -422,8 +387,6 @@ void RemoveElfHeader(box64context_t* ctx, elfheader_t* head) { /*if(tlsbase == -ctx->tlssize) { // not really correct, but will do for now ctx->tlssize -= GetTLSSize(head); - if(!(++ctx->sel_serial)) - ++ctx->sel_serial; }*/ } for(int i=0; ielfsize; ++i) @@ -440,12 +403,7 @@ int AddTLSPartition(box64context_t* context, int tlssize) { context->tlsdata = box_realloc(context->tlsdata, context->tlssize); memmove(context->tlsdata+tlssize, context->tlsdata, oldsize); // move to the top, using memmove as regions will probably overlap memset(context->tlsdata, 0, tlssize); // fill new space with 0 (not mandatory) - // clean GS segment for current emu - if(my_context) { - //ResetSegmentsCache(thread_get_emu()); - if(!(++context->sel_serial)) - ++context->sel_serial; - } + // clean GS segment for current emu? return -context->tlssize; // negative offset } diff --git a/src/box64version.h b/src/box64version.h index 35baf15..4ca1bb2 100644 --- a/src/box64version.h +++ b/src/box64version.h @@ -2,7 +2,7 @@ #define __BOX64_VERSION_H_ #define BOX64_MAJOR 0 -#define BOX64_MINOR 3 -#define BOX64_REVISION 0 +#define BOX64_MINOR 4 +#define BOX64_REVISION 1 #endif //__BOX64_VERSION_H_ diff --git a/src/build_info.c b/src/build_info.c index 1fd4b76..964bb9d 100644 --- a/src/build_info.c +++ b/src/build_info.c @@ -1,27 +1,25 @@ #include #include "debug.h" #include "box64version.h" -#ifdef NOGIT -#define GITREV "nogit" +#include "build_info.h" + +#if defined(DYNAREC) +#define WITH_DYNAREC_STR " with Dynarec" +#else +#define WITH_DYNAREC_STR "" +#endif + +#ifdef HAVE_TRACE +#define WITH_TRACE_STR " with trace" #else -#include "git_head.h" +#define WITH_TRACE_STR "" #endif -void PrintBox64Version() +void PrintBox64Version(int prefix) { - printf_log(LOG_NONE, "Box64%s%s v%d.%d.%d %s built on %s %s\n", - #ifdef HAVE_TRACE - " with trace", - #else - "", - #endif - #ifdef DYNAREC - " with Dynarec", - #else - "", - #endif - BOX64_MAJOR, BOX64_MINOR, BOX64_REVISION, - GITREV, + PrintfFtrace(prefix, BOX64_BUILD_INFO_STRING WITH_DYNAREC_STR WITH_TRACE_STR " built on %s %s\n", __DATE__, __TIME__); } +#undef WITH_TRACE +#undef WITH_DYNAREC diff --git a/src/build_info.h b/src/build_info.h index 18456a4..251d9e4 100644 --- a/src/build_info.h +++ b/src/build_info.h @@ -1,6 +1,43 @@ +#include "box64version.h" +#ifdef NOGIT +#define GITREV "nogit" +#else +#include "git_head.h" +#endif + #ifndef __BUILD_INFO_H__ #define __BUILD_INFO_H__ -void PrintBox64Version(void); -#endif //__BUILD_INFO_H__ \ No newline at end of file +#if defined(DYNAREC) && (defined(ARM64) || defined(RV64) || defined(LA64)) +#if defined(ARM64) +#define ARCH_STR " arm64" +#elif defined(RV64) +#define ARCH_STR " riscv64" +#elif defined(LA64) +#define ARCH_STR " loongarch64" +#endif +#else +#define ARCH_STR "" +#endif + +void PrintBox64Version(int prefix); + +#define BOX64_BUILD_INFO_STR_HELPER(x) #x +#define BOX64_BUILD_INFO_STR(x) BOX64_BUILD_INFO_STR_HELPER(x) + +#ifdef _WIN32 +#define BOX64_STR "WowBox64" +#else +#define BOX64_STR "Box64" +#endif + +#define BOX64_BUILD_INFO_STRING \ + BOX64_STR ARCH_STR \ + " v" BOX64_BUILD_INFO_STR(BOX64_MAJOR) "." BOX64_BUILD_INFO_STR(BOX64_MINOR) "." BOX64_BUILD_INFO_STR(BOX64_REVISION) " " GITREV + +#define BOX64_BUILD_INFO_STRING_SHORT \ + BOX64_STR \ + " v" BOX64_BUILD_INFO_STR(BOX64_MAJOR) "." BOX64_BUILD_INFO_STR(BOX64_MINOR) "." BOX64_BUILD_INFO_STR(BOX64_REVISION) + +#endif //__BUILD_INFO_H__ diff --git a/src/core.c b/src/core.c index 9ea4632..1ab5116 100644 --- a/src/core.c +++ b/src/core.c @@ -6,1192 +6,269 @@ #include #include #include +#include #include #include #include #include #include +#include #include -#ifdef DYNAREC -#ifdef ARM64 -#include -#include +#include +#ifdef BOX32 +#include #endif +#ifdef DYNAREC +#include +#include +#include #endif +#include "os.h" #include "build_info.h" #include "debug.h" #include "fileutils.h" #include "box64context.h" +#include "box64cpu.h" +#include "box64cpu_util.h" #include "wine_tools.h" #include "elfloader.h" #include "custommem.h" #include "box64stack.h" #include "auxval.h" -#include "x64emu.h" #include "threads.h" #include "x64trace.h" #include "librarian.h" -#include "x64run.h" #include "symbols.h" -#include "rcfile.h" #include "emu/x64run_private.h" #include "elfs/elfloader_private.h" +#include "x64emu.h" #include "library.h" #include "core.h" +#include "env.h" +#include "cleanup.h" +#include "freq.h" +#include "hostext.h" +#include "sysinfo.h" box64context_t *my_context = NULL; +extern box64env_t box64env; + int box64_quit = 0; int box64_exit_code = 0; -int box64_log = LOG_INFO; //LOG_NONE; -int box64_dump = 0; -int box64_nobanner = 0; -int box64_dynarec_log = LOG_NONE; +int box64_stdout_no_w = 0; uintptr_t box64_pagesize; -uintptr_t box64_load_addr = 0; -int box64_nosandbox = 0; -int box64_inprocessgpu = 0; -int box64_cefdisablegpu = 0; -int box64_cefdisablegpucompositor = 0; -int box64_malloc_hack = 0; -int box64_dynarec_test = 0; path_collection_t box64_addlibs = {0}; -int box64_maxcpu = 0; -int box64_maxcpu_immutable = 0; -#if defined(SD845) || defined(SD888) || defined(SD8G2) || defined(TEGRAX1) -int box64_mmap32 = 1; -#else -int box64_mmap32 = 0; -#endif -int box64_ignoreint3 = 0; +int box64_is32bits = 0; +int box64_isAddressSpace32 = 0; int box64_rdtsc = 0; -int box64_rdtsc_1ghz = 0; uint8_t box64_rdtsc_shift = 0; -#ifdef DYNAREC -int box64_dynarec = 1; -int box64_dynarec_dump = 0; -int box64_dynarec_forced = 0; -int box64_dynarec_bigblock = 1; -int box64_dynarec_forward = 128; -int box64_dynarec_strongmem = 0; -int box64_dynarec_x87double = 0; -int box64_dynarec_div0 = 0; -int box64_dynarec_fastnan = 1; -int box64_dynarec_fastround = 1; -int box64_dynarec_safeflags = 1; -int box64_dynarec_callret = 0; -int box64_dynarec_bleeding_edge = 1; -int box64_dynarec_tbb = 1; -int box64_dynarec_wait = 1; -int box64_dynarec_missing = 0; -int box64_dynarec_aligned_atomics = 0; -uintptr_t box64_nodynarec_start = 0; -uintptr_t box64_nodynarec_end = 0; -uintptr_t box64_dynarec_test_start = 0; -uintptr_t box64_dynarec_test_end = 0; -#ifdef ARM64 -int arm64_asimd = 0; -int arm64_aes = 0; -int arm64_pmull = 0; -int arm64_crc32 = 0; -int arm64_atomics = 0; -int arm64_sha1 = 0; -int arm64_sha2 = 0; -int arm64_uscat = 0; -int arm64_flagm = 0; -int arm64_flagm2 = 0; -int arm64_frintts = 0; -int arm64_afp = 0; -int arm64_rndr = 0; -#elif defined(RV64) -int rv64_zba = 0; -int rv64_zbb = 0; -int rv64_zbc = 0; -int rv64_zbs = 0; -int rv64_vector = 0; -int rv64_xtheadba = 0; -int rv64_xtheadbb = 0; -int rv64_xtheadbs = 0; -int rv64_xtheadcondmov = 0; -int rv64_xtheadmemidx = 0; -int rv64_xtheadmempair = 0; -int rv64_xtheadfmemidx = 0; -int rv64_xtheadmac = 0; -int rv64_xtheadfmv = 0; -#elif defined(LA64) -int la64_lbt = 0; -int la64_lam_bh = 0; -int la64_lamcas = 0; -int la64_scq = 0; -#endif -#else //DYNAREC -int box64_dynarec = 0; -#endif -int box64_libcef = 1; -int box64_jvm = 1; -int box64_unityplayer = 1; -int box64_sdl2_jguid = 0; -int dlsym_error = 0; -int cycle_log = 0; -#ifdef HAVE_TRACE -int trace_xmm = 0; -int trace_emm = 0; -int trace_regsdiff = 0; -uint64_t start_cnt = 0; -uintptr_t trace_start = 0, trace_end = 0; -char* trace_func = NULL; -char* trace_init = NULL; -char* box64_trace = NULL; -#ifdef DYNAREC -int box64_dynarec_trace = 0; -#endif -#endif -int box64_x11threads = 0; -int box64_x11glx = 1; -int allow_missing_libs = 0; -int box64_prefer_emulated = 0; -int box64_prefer_wrapped = 0; -int box64_sse_flushto0 = 0; -int box64_x87_no80bits = 0; -int box64_sync_rounding = 0; -int box64_sse42 = 1; -#if defined(DYNAREC) && defined(ARM64) -int box64_avx = 1; -int box64_avx2 = 1; -#else -int box64_avx = 0; -int box64_avx2 = 0; -#endif -int fix_64bit_inodes = 0; -int box64_dummy_crashhandler = 1; int box64_mapclean = 0; int box64_zoom = 0; int box64_steam = 0; -int box64_wine = 0; +int box64_steamcmd = 0; int box64_musl = 0; -int box64_nopulse = 0; -int box64_nogtk = 0; -int box64_novulkan = 0; -int box64_showsegv = 0; -int box64_showbt = 0; -int box64_isglibc234 = 0; -#ifdef BAD_SIGNAL -int box64_futex_waitv = 0; -#else -int box64_futex_waitv = 1; -#endif -char* box64_libGL = NULL; +int box64_nolibs = 0; char* box64_custom_gstreamer = NULL; +int box64_tcmalloc_minimal = 0; uintptr_t fmod_smc_start = 0; uintptr_t fmod_smc_end = 0; uint32_t default_gs = 0x53; -int jit_gdb = 0; -int box64_tcmalloc_minimal = 0; +uint32_t default_fs = 0; +int box64_isglibc234 = 0; +int box64_unittest_mode = 0; +sysinfo_t box64_sysinfo = { 0 }; + +#ifdef DYNAREC +cpu_ext_t cpuext = {0}; +#endif + +int box64_wine = 0; +const char* box64_guest_name = NULL; +const char* box64_wine_guest_name = NULL; + +#ifdef HAVE_TRACE +uintptr_t trace_start = 0, trace_end = 0; +char* trace_func = NULL; +#endif FILE* ftrace = NULL; char* ftrace_name = NULL; -int ftrace_has_pid = 0; +int ftrace_opened = 0; -void openFTrace(const char* newtrace) + +static void openFTrace(void) { - const char* t = newtrace?newtrace:getenv("BOX64_TRACE_FILE"); + const char* p = BOX64ENV(trace_file); #ifndef MAX_PATH #define MAX_PATH 4096 #endif char tmp[MAX_PATH]; char tmp2[MAX_PATH]; - const char* p = t; - int append=0; - if(p && strlen(p) && p[strlen(p)-1]=='+') { + int append = 0; + + if (ftrace_name) box_free(ftrace_name); + ftrace_name = NULL; + + if (p && strlen(p) && p[strlen(p) - 1] == '+') { strncpy(tmp2, p, sizeof(tmp2)); tmp2[strlen(p)-1]='\0'; p = tmp2; - append=1; + append = 1; } - if(p && strstr(p, "%pid")) { + + if (!p || ftrace_opened) return; + ftrace_opened = 1; + + if (strstr(p, "\%pid")) { int next = 0; do { strcpy(tmp, p); char* c = strstr(tmp, "%pid"); *c = 0; // cut char pid[16]; - if(next) - sprintf(pid, "%d-%d", getpid(), next); + if (next) + sprintf(pid, "%d-%d", GetTID(), next); else - sprintf(pid, "%d", getpid()); + sprintf(pid, "%d", GetTID()); strcat(tmp, pid); - c = strstr(p, "%pid") + strlen("%pid"); + c = strstr(p, "\%pid") + strlen("\%pid"); strcat(tmp, c); ++next; } while (FileExist(tmp, IS_FILE) && !append); p = tmp; - ftrace_has_pid = 1; } - if(ftrace_name) - free(ftrace_name); - ftrace_name = NULL; - if(p) { - if(!strcmp(p, "stderr")) + + if (!strcmp(p, "stdout")) + ftrace = stdout; + else if (!strcmp(p, "stderr")) + ftrace = stderr; + else { + if (append) + ftrace = fopen(p, "a"); + else + ftrace = fopen(p, "w"); + if (!ftrace) { ftrace = stderr; - else { - if(append) - ftrace = fopen(p, "w+"); - else - ftrace = fopen(p, "w"); - if(!ftrace) { - ftrace = stdout; - printf_log(LOG_INFO, "Cannot open trace file \"%s\" for writing (error=%s)\n", p, strerror(errno)); - } else { - ftrace_name = strdup(p); - /*fclose(ftrace); - ftrace = NULL;*/ - if(!box64_nobanner) - printf("BOX64 Trace %s to \"%s\"\n", append?"appended":"redirected", p); - PrintBox64Version(); + printf_log(LOG_INFO, "Cannot open trace file \"%s\" for writing (error=%s), fallback to stderr\n", p, strerror(errno)); + } else { + ftrace_name = box_strdup(p); + if (!BOX64ENV(nobanner)) { + fprintf(stderr, "[BOX64] Trace %s to \"%s\" (set BOX64_NOBANNER=1 to suppress this log)\n", append ? "appended" : "redirected", p); } + PrintBox64Version(0); } } } -void printf_ftrace(const char* fmt, ...) -{ - if(ftrace_name) { - int fd = fileno(ftrace); - if(fd<0 || lseek(fd, 0, SEEK_CUR)==(off_t)-1) - ftrace=fopen(ftrace_name, "w+"); - } - - va_list args; - va_start(args, fmt); - vfprintf(ftrace, fmt, args); - - fflush(ftrace); - - va_end(args); -} - -void my_child_fork() -{ - if(ftrace_has_pid) { - // open a new ftrace... - if(!ftrace_name) - fclose(ftrace); - openFTrace(NULL); - printf_log(/*LOG_DEBUG*/LOG_INFO, "Forked child of %s\n", GetLastApplyName()); - } -} - -const char* getCpuName(); -int getNCpu(); -#ifdef DYNAREC -void GatherDynarecExtensions() -{ -#ifdef ARM64 -/* -HWCAP_FP - Functionality implied by ID_AA64PFR0_EL1.FP == 0b0000. -HWCAP_ASIMD - Functionality implied by ID_AA64PFR0_EL1.AdvSIMD == 0b0000. -HWCAP_EVTSTRM - The generic timer is configured to generate events at a frequency of - approximately 10KHz. -HWCAP_AES - Functionality implied by ID_AA64ISAR0_EL1.AES == 0b0001. => AESE, AESD, AESMC, and AESIMC instructions are implemented -HWCAP_PMULL - Functionality implied by ID_AA64ISAR0_EL1.AES == 0b0010. => AESE, AESD, AESMC, and AESIMC instructions are implemented plus PMULL/PMULL2 instructions operating on 64-bit data quantities. -HWCAP_SHA1 - Functionality implied by ID_AA64ISAR0_EL1.SHA1 == 0b0001. => SHA1C, SHA1P, SHA1M, SHA1H, SHA1SU0, and SHA1SU1 instructions implemented. -HWCAP_SHA2 - Functionality implied by ID_AA64ISAR0_EL1.SHA2 == 0b0001. => SHA256H, SHA256H2, SHA256SU0 and SHA256SU1 instructions implemented. -HWCAP_CRC32 - Functionality implied by ID_AA64ISAR0_EL1.CRC32 == 0b0001. => CRC32B, CRC32H, CRC32W, CRC32X, CRC32CB, CRC32CH, CRC32CW, and CRC32CX instructions implemented. -HWCAP_ATOMICS - Functionality implied by ID_AA64ISAR0_EL1.Atomic == 0b0010. => LDADD, LDCLR, LDEOR, LDSET, LDSMAX, LDSMIN, LDUMAX, LDUMIN, CAS, CASP, and SWP instructions implemented. -HWCAP_FPHP - Functionality implied by ID_AA64PFR0_EL1.FP == 0b0001. -HWCAP_ASIMDHP - Functionality implied by ID_AA64PFR0_EL1.AdvSIMD == 0b0001. -HWCAP_CPUID - EL0 access to certain ID registers is available. - These ID registers may imply the availability of features. -HWCAP_ASIMDRDM - Functionality implied by ID_AA64ISAR0_EL1.RDM == 0b0001. => SQRDMLAH and SQRDMLSH instructions implemented. -HWCAP_JSCVT - Functionality implied by ID_AA64ISAR1_EL1.JSCVT == 0b0001. => The FJCVTZS instruction is implemented. -HWCAP_FCMA - Functionality implied by ID_AA64ISAR1_EL1.FCMA == 0b0001. => The FCMLA and FCADD instructions are implemented. -HWCAP_LRCPC - Functionality implied by ID_AA64ISAR1_EL1.LRCPC == 0b0001. => LDAPR and variants -HWCAP_DCPOP - Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0001. -HWCAP_SHA3 - Functionality implied by ID_AA64ISAR0_EL1.SHA3 == 0b0001. => EOR3, RAX1, XAR, and BCAX instructions implemented. -HWCAP_SM3 - Functionality implied by ID_AA64ISAR0_EL1.SM3 == 0b0001. => SM3SS1, SM3TT1A, SM3TT1B, SM3TT2A, SM3TT2B, SM3PARTW1, and SM3PARTW2 instructions implemented. -HWCAP_SM4 - Functionality implied by ID_AA64ISAR0_EL1.SM4 == 0b0001. => SM4E and SM4EKEY instructions implemented. -HWCAP_ASIMDDP - Functionality implied by ID_AA64ISAR0_EL1.DP == 0b0001. => UDOT and SDOT instructions implemented. -HWCAP_SHA512 - Functionality implied by ID_AA64ISAR0_EL1.SHA2 == 0b0010. => SHA512H, SHA512H2, SHA512SU0, and SHA512SU1 instructions implemented. -HWCAP_SVE - Functionality implied by ID_AA64PFR0_EL1.SVE == 0b0001. -HWCAP_ASIMDFHM - Functionality implied by ID_AA64ISAR0_EL1.FHM == 0b0001. => FMLAL and FMLSL instructions are implemented. -HWCAP_DIT - Functionality implied by ID_AA64PFR0_EL1.DIT == 0b0001. -HWCAP_USCAT - Functionality implied by ID_AA64MMFR2_EL1.AT == 0b0001. -HWCAP_ILRCPC - Functionality implied by ID_AA64ISAR1_EL1.LRCPC == 0b0010. => The LDAPUR*, STLUR*, and LDAPR* instructions are implemented. -HWCAP_FLAGM - Functionality implied by ID_AA64ISAR0_EL1.TS == 0b0001. -HWCAP_SSBS - Functionality implied by ID_AA64PFR1_EL1.SSBS == 0b0010. => AArch64 provides the PSTATE.SSBS mechanism to mark regions that are Speculative Store Bypassing Safe, and the MSR and MRS instructions to directly read and write the PSTATE.SSBS field. -HWCAP_SB - Functionality implied by ID_AA64ISAR1_EL1.SB == 0b0001. => SB instruction is implemented. -HWCAP_PACA - Functionality implied by ID_AA64ISAR1_EL1.APA == 0b0001 or - ID_AA64ISAR1_EL1.API == 0b0001. -HWCAP_PACG - Functionality implied by ID_AA64ISAR1_EL1.GPA == 0b0001 or => Generic Authentication using the QARMA algorithm is implemented. This includes the PACGA instruction. - ID_AA64ISAR1_EL1.GPI == 0b0001. -HWCAP2_DCPODP - Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0010. => DC CVAP and DC CVADP supported -HWCAP2_SVE2 - Functionality implied by ID_AA64ZFR0_EL1.SVEVer == 0b0001. -HWCAP2_SVEAES - Functionality implied by ID_AA64ZFR0_EL1.AES == 0b0001. -HWCAP2_SVEPMULL - Functionality implied by ID_AA64ZFR0_EL1.AES == 0b0010. -HWCAP2_SVEBITPERM - Functionality implied by ID_AA64ZFR0_EL1.BitPerm == 0b0001. -HWCAP2_SVESHA3 - Functionality implied by ID_AA64ZFR0_EL1.SHA3 == 0b0001. -HWCAP2_SVESM4 - Functionality implied by ID_AA64ZFR0_EL1.SM4 == 0b0001. -HWCAP2_FLAGM2 - Functionality implied by ID_AA64ISAR0_EL1.TS == 0b0010. => CFINV, RMIF, SETF16, SETF8, AXFLAG, and XAFLAG instructions are implemented. -HWCAP2_FRINT - Functionality implied by ID_AA64ISAR1_EL1.FRINTTS == 0b0001. => FRINT32Z, FRINT32X, FRINT64Z, and FRINT64X instructions are implemented. -HWCAP2_SVEI8MM - Functionality implied by ID_AA64ZFR0_EL1.I8MM == 0b0001. -HWCAP2_SVEF32MM - Functionality implied by ID_AA64ZFR0_EL1.F32MM == 0b0001. -HWCAP2_SVEF64MM - Functionality implied by ID_AA64ZFR0_EL1.F64MM == 0b0001. -HWCAP2_SVEBF16 - Functionality implied by ID_AA64ZFR0_EL1.BF16 == 0b0001 -HWCAP2_I8MM - Functionality implied by ID_AA64ISAR1_EL1.I8MM == 0b0001. => SMMLA, SUDOT, UMMLA, USMMLA, and USDOT instructions are implemented -HWCAP2_BF16 - Functionality implied by ID_AA64ISAR1_EL1.BF16 == 0b0001. => BFDOT, BFMLAL, BFMLAL2, BFMMLA, BFCVT, and BFCVT2 instructions are implemented. -HWCAP2_DGH - Functionality implied by ID_AA64ISAR1_EL1.DGH == 0b0001. => Data Gathering Hint is implemented. -HWCAP2_RNG - Functionality implied by ID_AA64ISAR0_EL1.RNDR == 0b0001. -HWCAP2_BTI - Functionality implied by ID_AA64PFR0_EL1.BT == 0b0001. -HWCAP2_MTE - Functionality implied by ID_AA64PFR1_EL1.MTE == 0b0010. => Full Memory Tagging Extension is implemented. -HWCAP2_ECV - Functionality implied by ID_AA64MMFR0_EL1.ECV == 0b0001. -HWCAP2_AFP - AFP = 0b0001 => The AArch64-FPCR.{AH, FIZ, NEP} fields are supported. (Alternate floating-point behavior) -*/ - unsigned long hwcap = real_getauxval(AT_HWCAP); - if(!hwcap) // no HWCap: provide a default... - hwcap = HWCAP_ASIMD; - // first, check all needed extensions, lif half, edsp and fastmult - if((hwcap&HWCAP_ASIMD) == 0) { - printf_log(LOG_INFO, "Missing ASMID cpu support, disabling Dynarec\n"); - box64_dynarec=0; - return; - } - if(hwcap&HWCAP_CRC32) - arm64_crc32 = 1; - if(hwcap&HWCAP_PMULL) - arm64_pmull = 1; - if(hwcap&HWCAP_AES) - arm64_aes = 1; - if(hwcap&HWCAP_ATOMICS) - arm64_atomics = 1; - #ifdef HWCAP_SHA1 - if(hwcap&HWCAP_SHA1) - arm64_sha1 = 1; - #endif - #ifdef HWCAP_SHA2 - if(hwcap&HWCAP_SHA2) - arm64_sha2 = 1; - #endif - #ifdef HWCAP_USCAT - if(hwcap&HWCAP_USCAT) - arm64_uscat = 1; - #endif - #ifdef HWCAP_FLAGM - if(hwcap&HWCAP_FLAGM) - arm64_flagm = 1; - #endif - unsigned long hwcap2 = real_getauxval(AT_HWCAP2); - #ifdef HWCAP2_FLAGM2 - if(hwcap2&HWCAP2_FLAGM2) - arm64_flagm2 = 1; - #endif - #ifdef HWCAP2_FRINT - if(hwcap2&HWCAP2_FRINT) - arm64_frintts = 1; - #endif - #ifdef HWCAP2_AFP - if(hwcap2&HWCAP2_AFP) - arm64_afp = 1; - #endif - #ifdef HWCAP2_RNG - if(hwcap2&HWCAP2_RNG) - arm64_rndr = 1; - #endif - printf_log(LOG_INFO, "Dynarec for ARM64, with extension: ASIMD"); - if(arm64_aes) - printf_log(LOG_INFO, " AES"); - if(arm64_crc32) - printf_log(LOG_INFO, " CRC32"); - if(arm64_pmull) - printf_log(LOG_INFO, " PMULL"); - if(arm64_atomics) - printf_log(LOG_INFO, " ATOMICS"); - if(arm64_sha1) - printf_log(LOG_INFO, " SHA1"); - if(arm64_sha2) - printf_log(LOG_INFO, " SHA2"); - if(arm64_uscat) - printf_log(LOG_INFO, " USCAT"); - if(arm64_flagm) - printf_log(LOG_INFO, " FLAGM"); - if(arm64_flagm2) - printf_log(LOG_INFO, " FLAGM2"); - if(arm64_frintts) - printf_log(LOG_INFO, " FRINT"); - if(arm64_afp) - printf_log(LOG_INFO, " AFP"); - if(arm64_rndr) - printf_log(LOG_INFO, " RNDR"); -#elif defined(LA64) - printf_log(LOG_INFO, "Dynarec for LoongArch "); - char* p = getenv("BOX64_DYNAREC_LA64NOEXT"); - if(p == NULL || p[0] == '0') { - uint32_t cpucfg2 = 0, idx = 2; - asm volatile("cpucfg %0, %1" : "=r"(cpucfg2) : "r"(idx)); - if ((cpucfg2 >> 6) & 0b1) { - printf_log(LOG_INFO, "with extension LSX"); - } else { - printf_log(LOG_INFO, "\nMissing LSX extension support, disabling Dynarec\n"); - box64_dynarec = 0; - return; - } - - if ((la64_lbt = (cpucfg2 >> 18) & 0b1)) - printf_log(LOG_INFO, " LBT_X86"); - if ((la64_lam_bh = (cpucfg2 >> 27) & 0b1)) - printf_log(LOG_INFO, " LAM_BH"); - if ((la64_lamcas = (cpucfg2 >> 28) & 0b1)) - printf_log(LOG_INFO, " LAMCAS"); - if ((la64_scq = (cpucfg2 >> 30) & 0b1)) - printf_log(LOG_INFO, " SCQ"); - } -#elif defined(RV64) - void RV64_Detect_Function(); - char *p = getenv("BOX64_DYNAREC_RV64NOEXT"); - if(p == NULL || p[0] == '0') - RV64_Detect_Function(); - printf_log(LOG_INFO, "Dynarec for RISC-V "); - printf_log(LOG_INFO, "With extension: I M A F D C"); - if(rv64_zba) printf_log(LOG_INFO, " Zba"); - if(rv64_zbb) printf_log(LOG_INFO, " Zbb"); - if(rv64_zbc) printf_log(LOG_INFO, " Zbc"); - if(rv64_zbs) printf_log(LOG_INFO, " Zbs"); - if(rv64_vector) printf_log(LOG_INFO, " Vector"); - if(rv64_xtheadba) printf_log(LOG_INFO, " XTheadBa"); - if(rv64_xtheadbb) printf_log(LOG_INFO, " XTheadBb"); - if(rv64_xtheadbs) printf_log(LOG_INFO, " XTheadBs"); - if(rv64_xtheadcondmov) printf_log(LOG_INFO, " XTheadCondMov"); - if(rv64_xtheadmemidx) printf_log(LOG_INFO, " XTheadMemIdx"); - if(rv64_xtheadmempair) printf_log(LOG_INFO, " XTheadMemPair"); - if(rv64_xtheadfmemidx) printf_log(LOG_INFO, " XTheadFMemIdx"); - if(rv64_xtheadmac) printf_log(LOG_INFO, " XTheadMac"); - if(rv64_xtheadfmv) printf_log(LOG_INFO, " XTheadFmv"); -#else -#error Unsupported architecture -#endif -} -#endif - void computeRDTSC() { int hardware = 0; box64_rdtsc_shift = 0; - #if defined(ARM64) || defined(RV64) + #if defined(ARM64) || defined(RV64) || defined(LA64) hardware = 1; - box64_rdtsc = 0; // allow hardxare counter + box64_rdtsc = 0; // allow hardware counter #else box64_rdtsc = 1; - printf_log(LOG_INFO, "Will use time-based emulation for rdtsc, even if hardware counter are available\n"); + printf_log(LOG_INFO, "Will use time-based emulation for RDTSC, even if hardware counters are available\n"); #endif uint64_t freq = ReadTSCFrequency(NULL); - if(freq<((box64_rdtsc_1ghz)?1000000000LL:1000000)) { + if(freq<((BOX64ENV(rdtsc_1ghz))?1000000000LL:1000000)) { box64_rdtsc = 1; - if(hardware) printf_log(LOG_INFO, "Hardware counter to slow (%d kHz), not using it\n", freq/1000); + if(hardware) printf_log(LOG_INFO, "Hardware counter is too slow (%d kHz), not using it\n", freq/1000); hardware = 0; freq = ReadTSCFrequency(NULL); } uint64_t efreq = freq; - while(efreq<2000000000 && box64_rdtsc_shift<31) { // minium 2GHz, but not too much shift + while(efreq<2000000000 && box64_rdtsc_shift<31) { // minimum 2GHz, but not too much shift ++box64_rdtsc_shift; efreq = freq<=1000000000LL; if(ghz) freq/=100000000LL; else freq/=100000; - if(ghz) printf_log(LOG_INFO, "%d.%d GHz", freq/10, freq%10); - if(!ghz && (freq>=1000)) printf_log(LOG_INFO, "%d MHz", freq/10); - if(!ghz && (freq<1000)) printf_log(LOG_INFO, "%d.%d MHz", freq/10, freq%10); + if (ghz) printf_log_prefix(0, LOG_INFO, "%d.%d GHz", freq / 10, freq % 10); + if (!ghz && (freq >= 1000)) printf_log_prefix(0, LOG_INFO, "%d MHz", freq / 10); + if (!ghz && (freq < 1000)) printf_log_prefix(0, LOG_INFO, "%d.%d MHz", freq / 10, freq % 10); if(box64_rdtsc_shift) { - printf_log(LOG_INFO, " emulating "); + printf_log_prefix(0, LOG_INFO, " emulating "); ghz = efreq>=1000000000LL; if(ghz) efreq/=100000000LL; else efreq/=100000; - if(ghz) printf_log(LOG_INFO, "%d.%d GHz", efreq/10, efreq%10); - if(!ghz && (efreq>=1000)) printf_log(LOG_INFO, "%d MHz", efreq/10); - if(!ghz && (efreq<1000)) printf_log(LOG_INFO, "%d.%d MHz", efreq/10, efreq%10); + if (ghz) printf_log_prefix(0, LOG_INFO, "%d.%d GHz", efreq / 10, efreq % 10); + if (!ghz && (efreq >= 1000)) printf_log_prefix(0, LOG_INFO, "%d MHz", efreq / 10); + if (!ghz && (efreq < 1000)) printf_log_prefix(0, LOG_INFO, "%d.%d MHz", efreq / 10, efreq % 10); } - printf_log(LOG_INFO, "\n"); + printf_log_prefix(0, LOG_INFO, "\n"); } -EXPORTDYN -void LoadLogEnv() +static void displayMiscInfo(void) { - ftrace = stdout; - box64_nobanner = isatty(fileno(stdout))?0:1; - const char *p = getenv("BOX64_NOBANNER"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_nobanner = p[0]-'0'; - } - } - // grab BOX64_TRACE_FILE envvar, and change %pid to actual pid is present in the name - openFTrace(NULL); - box64_log = ftrace_name?LOG_INFO:(isatty(fileno(stdout))?LOG_INFO:LOG_NONE); //default LOG value different if stdout is redirected or not - p = getenv("BOX64_LOG"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0'+LOG_NONE && p[0]<='0'+LOG_NEVER) { - box64_log = p[0]-'0'; - if(box64_log == LOG_NEVER) { - --box64_log; - box64_dump = 1; - } - } - } else { - if(!strcasecmp(p, "NONE")) - box64_log = LOG_NONE; - else if(!strcasecmp(p, "INFO")) - box64_log = LOG_INFO; - else if(!strcasecmp(p, "DEBUG")) - box64_log = LOG_DEBUG; - else if(!strcasecmp(p, "DUMP")) { - box64_log = LOG_DEBUG; - box64_dump = 1; - } - } - if(!box64_nobanner) - printf_log(LOG_INFO, "Debug level is %d\n", box64_log); - } + openFTrace(); + + if ((BOX64ENV(nobanner) || BOX64ENV(log)) && ftrace == stdout) + box64_stdout_no_w = 1; #if !defined(DYNAREC) && (defined(ARM64) || defined(RV64) || defined(LA64)) printf_log(LOG_INFO, "Warning: DynaRec is available on this host architecture, an interpreter-only build is probably not intended.\n"); #endif - p = getenv("BOX64_ROLLING_LOG"); - if(p) { - int cycle = 0; - if(sscanf(p, "%d", &cycle)==1) - cycle_log = cycle; - if(cycle_log==1) - cycle_log = 16; - if(cycle_log<0) - cycle_log = 0; - if(cycle_log && box64_log>LOG_INFO) { - cycle_log = 0; - printf_log(LOG_NONE, "Incompatible Rolling log and Debug Log, disabling Rolling log\n"); - } - } - if(!box64_nobanner && cycle_log) - printf_log(LOG_INFO, "Rolling log, showing last %d function call on signals\n", cycle_log); - p = getenv("BOX64_DUMP"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dump = p[0]-'0'; - } - } - if(!box64_nobanner && box64_dump) - printf_log(LOG_INFO, "Elf Dump if ON\n"); -#ifdef DYNAREC - #ifdef ARM64 - // unaligned atomic (with restriction) is supported in hardware - /*if(arm64_uscat) - box64_dynarec_aligned_atomics = 1;*/ // the unaligned support is not good enough for x86 emulation, so diabling - #endif - p = getenv("BOX64_DYNAREC_DUMP"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='2') - box64_dynarec_dump = p[0]-'0'; - } - if (box64_dynarec_dump) printf_log(LOG_INFO, "Dynarec blocks are dumped%s\n", (box64_dynarec_dump>1)?" in color":""); - } - p = getenv("BOX64_DYNAREC_LOG"); - if(p) { - if(strlen(p)==1) { - if((p[0]>='0'+LOG_NONE) && (p[0]<='0'+LOG_NEVER)) - box64_dynarec_log = p[0]-'0'; - } else { - if(!strcasecmp(p, "NONE")) - box64_dynarec_log = LOG_NONE; - else if(!strcasecmp(p, "INFO")) - box64_dynarec_log = LOG_INFO; - else if(!strcasecmp(p, "DEBUG")) - box64_dynarec_log = LOG_DEBUG; - else if(!strcasecmp(p, "VERBOSE")) - box64_dynarec_log = LOG_VERBOSE; - } - printf_log(LOG_INFO, "Dynarec log level is %d\n", box64_dynarec_log); - } - p = getenv("BOX64_DYNAREC"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dynarec = p[0]-'0'; - } - printf_log(LOG_INFO, "Dynarec is %s\n", box64_dynarec?"on":"off"); - } - p = getenv("BOX64_DYNAREC_FORCED"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dynarec_forced = p[0]-'0'; - } - if(box64_dynarec_forced) - printf_log(LOG_INFO, "Dynarec is forced on all addresses\n"); - } - p = getenv("BOX64_DYNAREC_BIGBLOCK"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='3') - box64_dynarec_bigblock = p[0]-'0'; - } - if(!box64_dynarec_bigblock) - printf_log(LOG_INFO, "Dynarec will not try to make big block\n"); - else if (box64_dynarec_bigblock>1) - printf_log(LOG_INFO, "Dynarec will try to make bigger blocks%s\n", (box64_dynarec_bigblock>2)?" even on non-elf memory":""); + char* p; +#ifdef DYNAREC + if (DetectHostCpuFeatures()) + PrintHostCpuFeatures(); + else { + printf_log(LOG_INFO, "Minimum CPU requirements not met, disabling DynaRec\n"); + SET_BOX64ENV(dynarec, 0); } - p = getenv("BOX64_DYNAREC_FORWARD"); - if(p) { - int val = -1; - if(sscanf(p, "%d", &val)==1) { - if(val>=0) - box64_dynarec_forward = val; - } - if(box64_dynarec_forward) - printf_log(LOG_INFO, "Dynarec will continue block for %d bytes on forward jump\n", box64_dynarec_forward); - else - printf_log(LOG_INFO, "Dynarec will not continue block on forward jump\n"); - } - p = getenv("BOX64_DYNAREC_STRONGMEM"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='4') - box64_dynarec_strongmem = p[0]-'0'; - } - if(box64_dynarec_strongmem) - printf_log(LOG_INFO, "Dynarec will try to emulate a strong memory model%s\n", (box64_dynarec_strongmem==1)?" with limited performance loss":((box64_dynarec_strongmem>1)?" with more performance loss":"")); - } - p = getenv("BOX64_DYNAREC_X87DOUBLE"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dynarec_x87double = p[0]-'0'; - } - if(box64_dynarec_x87double) - printf_log(LOG_INFO, "Dynarec will use only double for x87 emulation\n"); - } - p = getenv("BOX64_DYNAREC_DIV0"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dynarec_div0 = p[0]-'0'; - } - if(box64_dynarec_div0) - printf_log(LOG_INFO, "Dynarec will check for divide by 0\n"); - } - p = getenv("BOX64_DYNAREC_FASTNAN"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dynarec_fastnan = p[0]-'0'; - } - if(!box64_dynarec_fastnan) - printf_log(LOG_INFO, "Dynarec will try to normalize generated NAN\n"); - } - p = getenv("BOX64_DYNAREC_FASTROUND"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dynarec_fastround = p[0]-'0'; - } - if(!box64_dynarec_fastround) - printf_log(LOG_INFO, "Dynarec will try to generate x86 precise IEEE->int rounding\n"); - } - p = getenv("BOX64_DYNAREC_SAFEFLAGS"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='2') - box64_dynarec_safeflags = p[0]-'0'; - } - if(!box64_dynarec_safeflags) - printf_log(LOG_INFO, "Dynarec will not play it safe with x64 flags\n"); - else - printf_log(LOG_INFO, "Dynarec will play %s safe with x64 flags\n", (box64_dynarec_safeflags==1)?"moderatly":"it"); - } - p = getenv("BOX64_DYNAREC_CALLRET"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dynarec_callret = p[0]-'0'; - } - if(box64_dynarec_callret) - printf_log(LOG_INFO, "Dynarec will optimize CALL/RET\n"); - else - printf_log(LOG_INFO, "Dynarec will not optimize CALL/RET\n"); - } - p = getenv("BOX64_DYNAREC_BLEEDING_EDGE"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dynarec_bleeding_edge = p[0]-'0'; - } - if(!box64_dynarec_bleeding_edge) - printf_log(LOG_INFO, "Dynarec will not detect MonoBleedingEdge\n"); - } - p = getenv("BOX64_DYNAREC_JVM"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_jvm = p[0]-'0'; - } - if(!box64_jvm) - printf_log(LOG_INFO, "Dynarec will not detect libjvm\n"); - } - p = getenv("BOX64_DYNAREC_TBB"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dynarec_tbb = p[0]-'0'; - } - if(!box64_dynarec_tbb) - printf_log(LOG_INFO, "Dynarec will not detect libtbb\n"); - } - p = getenv("BOX64_DYNAREC_WAIT"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dynarec_wait = p[0]-'0'; - } - if(!box64_dynarec_wait) - printf_log(LOG_INFO, "Dynarec will not wait for FillBlock to ready and use Interpreter instead\n"); - } - p = getenv("BOX64_DYNAREC_ALIGNED_ATOMICS"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dynarec_aligned_atomics = p[0]-'0'; - } - if(box64_dynarec_aligned_atomics) - printf_log(LOG_INFO, "Dynarec will generate only aligned atomics code\n"); - } - p = getenv("BOX64_DYNAREC_MISSING"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_dynarec_missing = p[0]-'0'; - } - if(box64_dynarec_missing) - printf_log(LOG_INFO, "Dynarec will print missing opcodes\n"); - } - p = getenv("BOX64_NODYNAREC"); - if(p) { - if (strchr(p,'-')) { - if(sscanf(p, "%ld-%ld", &box64_nodynarec_start, &box64_nodynarec_end)!=2) { - if(sscanf(p, "0x%lX-0x%lX", &box64_nodynarec_start, &box64_nodynarec_end)!=2) - sscanf(p, "%lx-%lx", &box64_nodynarec_start, &box64_nodynarec_end); - } - printf_log(LOG_INFO, "No dynablock creation that start in the range %p - %p\n", (void*)box64_nodynarec_start, (void*)box64_nodynarec_end); - } - } - p = getenv("BOX64_DYNAREC_TEST"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='2') - box64_dynarec_test = p[0]-'0'; - box64_dynarec_test_start = 0x0; - box64_dynarec_test_end = 0x0; - } else if (strchr(p,'-')) { - if(sscanf(p, "%ld-%ld", &box64_dynarec_test_start, &box64_dynarec_test_end)!=2) { - if(sscanf(p, "0x%lX-0x%lX", &box64_dynarec_test_start, &box64_dynarec_test_end)!=2) - sscanf(p, "%lx-%lx", &box64_dynarec_test_start, &box64_dynarec_test_end); - } - if(box64_dynarec_test_end>box64_dynarec_test_start) { - box64_dynarec_test = 1; - printf_log(LOG_INFO, "Dynarec test in the range %p - %p\n", (void*)box64_nodynarec_start, (void*)box64_nodynarec_end); - } else { - box64_dynarec_test = 0; - printf_log(LOG_INFO, "Ignoring BOX64_NODYNAREC=%s (%p-%p)\n", p, (void*)box64_nodynarec_start, (void*)box64_nodynarec_end); - } - } - if(box64_dynarec_test) { - box64_dynarec_fastnan = 0; - box64_dynarec_fastround = 0; - box64_dynarec_x87double = 1; - box64_dynarec_div0 = 1; - box64_dynarec_callret = 0; - printf_log(LOG_INFO, "Dynarec will compare it's execution with the interpreter%s (%s slow, only for testing)\n", - box64_dynarec_test == 2 ? " thread-safely" : "", - box64_dynarec_test == 2 ? "extremely" : "super"); - } +#if defined(LA64) + if (box64env.avx && !cpuext.lasx) { + box64env.avx = 0; + box64env.avx2 = 0; } - #endif -#ifdef HAVE_TRACE - p = getenv("BOX64_TRACE_XMM"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - trace_xmm = p[0]-'0'; - } - } - p = getenv("BOX64_TRACE_EMM"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - trace_emm = p[0]-'0'; - } - } - p = getenv("BOX64_TRACE_COLOR"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - trace_regsdiff = p[0]-'0'; - } - } - p = getenv("BOX64_TRACE_START"); - if(p) { - char* p2; - start_cnt = strtoll(p, &p2, 10); - printf_log(LOG_INFO, "Will start trace only after %lu instructions\n", start_cnt); - } -#ifdef DYNAREC - p = getenv("BOX64_DYNAREC_TRACE"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_dynarec_trace = p[0]-'0'; - if(box64_dynarec_trace) - printf_log(LOG_INFO, "Dynarec generated code will also print a trace\n"); - } - } #endif + + printf_log(LOG_INFO, "Running on %s with %d core%s, pagesize: %zd", box64_sysinfo.cpuname, box64_sysinfo.ncpu, box64_sysinfo.ncpu > 1 ? "s" : "", box64_pagesize); + if (BOX64ENV(maxcpu)) + printf_log_prefix(0, LOG_INFO, ", emulating %d core%s\n", BOX64ENV(maxcpu), BOX64ENV(maxcpu) > 1 ? "s" : ""); + else + printf_log_prefix(0, LOG_INFO, "\n"); + computeRDTSC(); +} + +static void hookMangoHud() +{ + const char* config = getenv("MANGOHUD_CONFIG"); + const char* configfile = getenv("MANGOHUD_CONFIGFILE"); + if (config || configfile) return; + if (FileExist("/etc/MangoHud.conf", IS_FILE)) return; + const char* configdir = getenv("XDG_CONFIG_HOME"); + const char* homedir = getenv("HOME"); +#ifndef ANDROID + homedir = homedir ? homedir : getpwuid(getuid())->pw_dir; #endif - // Other BOX64 env. var. - p = getenv("BOX64_LIBCEF"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_libcef = p[0]-'0'; - } - if(!box64_libcef) - printf_log(LOG_INFO, "BOX64 will not detect libcef\n"); - } - p = getenv("BOX64_JVM"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_jvm = p[0]-'0'; - } - if(!box64_jvm) - printf_log(LOG_INFO, "BOX64 will not detect libjvm\n"); - } - p = getenv("BOX64_UNITYPLAYER"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_unityplayer = p[0]-'0'; - } - if(!box64_unityplayer) - printf_log(LOG_INFO, "BOX64 will not detect UnityPlayer.dll\n"); - } - p = getenv("BOX64_SDL2_JGUID"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='1') - box64_sdl2_jguid = p[0]-'0'; - } - if(!box64_sdl2_jguid) - printf_log(LOG_INFO, "BOX64 will workaround the use of SDL_GetJoystickGUIDInfo with 4 args instead of 5\n"); - } - p = getenv("BOX64_LOAD_ADDR"); - if(p) { - if(sscanf(p, "0x%zx", &box64_load_addr)!=1) - box64_load_addr = 0; - if(box64_load_addr) - printf_log(LOG_INFO, "Use a starting load address of %p\n", (void*)box64_load_addr); - } - p = getenv("BOX64_DLSYM_ERROR"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - dlsym_error = p[0]-'0'; - } - } - p = getenv("BOX64_X11THREADS"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_x11threads = p[0]-'0'; - } - if(box64_x11threads) - printf_log(LOG_INFO, "Try to Call XInitThreads if libX11 is loaded\n"); - } - p = getenv("BOX64_X11GLX"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_x11glx = p[0]-'0'; - } - if(box64_x11glx) - printf_log(LOG_INFO, "Hack to force libX11 GLX extension present\n"); - else - printf_log(LOG_INFO, "Disabled Hack to force libX11 GLX extension present\n"); - } - p = getenv("BOX64_LIBGL"); - if(p) - box64_libGL = box_strdup(p); - if(!box64_libGL) { - p = getenv("SDL_VIDEO_GL_DRIVER"); - if(p) - box64_libGL = box_strdup(p); - } - if(box64_libGL) { - printf_log(LOG_INFO, "BOX64 using \"%s\" as libGL.so.1\n", p); - } - p = getenv("BOX64_ALLOWMISSINGLIBS"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - allow_missing_libs = p[0]-'0'; - } - if(allow_missing_libs) - printf_log(LOG_INFO, "Allow missing needed libs\n"); - } - p = getenv("BOX64_CRASHHANDLER"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_dummy_crashhandler = p[0]-'0'; - } - if(!box64_dummy_crashhandler) - printf_log(LOG_INFO, "Don't use dummy crashhandler lib\n"); - } - p = getenv("BOX64_MALLOC_HACK"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+2) - box64_malloc_hack = p[0]-'0'; - } - if(!box64_malloc_hack) { - if(box64_malloc_hack==1) { - printf_log(LOG_INFO, "Malloc hook will not be redirected\n"); - } else - printf_log(LOG_INFO, "Malloc hook will check for mmap/free occurrences\n"); - } - } - p = getenv("BOX64_NOPULSE"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_nopulse = p[0]-'0'; - } - if(box64_nopulse) - printf_log(LOG_INFO, "Disable the use of pulseaudio libs\n"); - } - p = getenv("BOX64_NOGTK"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_nogtk = p[0]-'0'; - } - if(box64_nogtk) - printf_log(LOG_INFO, "Disable the use of wrapped gtk libs\n"); - } - p = getenv("BOX64_NOVULKAN"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_novulkan = p[0]-'0'; - } - if(box64_novulkan) - printf_log(LOG_INFO, "Disable the use of wrapped vulkan libs\n"); - } - p = getenv("BOX64_FUTEX_WAITV"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_futex_waitv = p[0]-'0'; - } - #ifdef BAD_SIGNAL - if(box64_futex_waitv) - printf_log(LOG_INFO, "Enable the use of futex waitv syscall (if available on the system\n"); - #else - if(!box64_futex_waitv) - printf_log(LOG_INFO, "Disable the use of futex waitv syscall\n"); - #endif - } - p = getenv("BOX64_SSE42"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_sse42 = p[0]-'0'; - } - if(!box64_sse42) - printf_log(LOG_INFO, "Do not expose SSE 4.2 capabilities\n"); - } - p = getenv("BOX64_AVX"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+2) - box64_avx = p[0]-'0'; - } - if(box64_avx) - printf_log(LOG_INFO, "Will expose AVX capabilities\n"); - if(box64_avx==2) { - box64_avx=1; - box64_avx2 = 1; - printf_log(LOG_INFO, "Will expose AVX2 capabilities\n"); - } - if(!box64_avx) - printf_log(LOG_INFO, "Will not expose AVX capabilities\n"); - if(!box64_avx2) - printf_log(LOG_INFO, "Will not expose AVX2 capabilities\n"); - } - p = getenv("BOX64_RDTSC_1GHZ"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_rdtsc_1ghz = p[0]-'0'; - } - if(!box64_rdtsc_1ghz) - printf_log(LOG_INFO, "Will require a hardware counter of 1GHz minimum or will fallback to software\n"); - } - p = getenv("BOX64_FIX_64BIT_INODES"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - fix_64bit_inodes = p[0]-'0'; - } - if(fix_64bit_inodes) - printf_log(LOG_INFO, "Fix 64bit inodes\n"); - } - p = getenv("BOX64_JITGDB"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+3) - jit_gdb = p[0]-'0'; - } - if(jit_gdb) - printf_log(LOG_INFO, "Launch %s on segfault\n", (jit_gdb==2)?"gdbserver":((jit_gdb==3)?"lldb":"gdb")); - } - p = getenv("BOX64_SHOWSEGV"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_showsegv = p[0]-'0'; - } - if(box64_showsegv) - printf_log(LOG_INFO, "Show Segfault signal even if a signal handler is present\n"); - } - p = getenv("BOX64_SHOWBT"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_showbt = p[0]-'0'; - } - if(box64_showbt) - printf_log(LOG_INFO, "Show a Backtrace when a Segfault signal is caught\n"); - } - p = getenv("BOX64_MAXCPU"); - if(p) { - int maxcpu = 0; - if(sscanf(p, "%d", &maxcpu)==1) - box64_maxcpu = maxcpu; - if(box64_maxcpu<0) - box64_maxcpu = 0; - if(box64_maxcpu) { - printf_log(LOG_NONE, "Will not expose more than %d cpu cores\n", box64_maxcpu); - } else { - printf_log(LOG_NONE, "Will not limit the number of cpu cores exposed\n"); - } - } - p = getenv("BOX64_MMAP32"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_mmap32 = p[0]-'0'; - } - if(box64_mmap32) - printf_log(LOG_INFO, "Will use 32bits address in priority for external MMAP (when 32bits process are detected)\n"); - else - printf_log(LOG_INFO, "Will not use 32bits address in priority for external MMAP (when 32bits process are detected)\n"); - } - p = getenv("BOX64_IGNOREINT3"); - if(p) { - if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='0'+1) - box64_ignoreint3 = p[0]-'0'; - } - if(box64_ignoreint3) - printf_log(LOG_INFO, "Will silently ignore INT3 in the code\n"); + if (!homedir) return; + + static char config_base[256]; + snprintf(config_base, sizeof(config_base), "%s%s", + configdir ? configdir : homedir, + configdir ? "" : "/.config"); + + const char* files[] = { "MangoHud.conf", "box64.conf" }; + for (int i = 0; i < 2; i++) { + static char path[512]; + snprintf(path, sizeof(path), "%s/MangoHud/%s", config_base, files[i]); + if (FileExist(path, IS_FILE)) return; } - // grab pagesize - box64_pagesize = sysconf(_SC_PAGESIZE); - if(!box64_pagesize) - box64_pagesize = 4096; -#ifdef DYNAREC - // grab cpu extensions for dynarec usage - GatherDynarecExtensions(); -#endif - // grab cpu name - int ncpu = getNCpu(); - const char* cpuname = getCpuName(); - printf_log(LOG_INFO, " PageSize:%zd Running on %s with %d Cores\n", box64_pagesize, cpuname, ncpu); - // grab and calibrate hardware counter - computeRDTSC(); + setenv("MANGOHUD_CONFIG", "legacy_layout=0,custom_text_center=" BOX64_BUILD_INFO_STRING ",gpu_stats=1,cpu_stats=1,fps=1,frame_timing=1", 0); } -EXPORTDYN -void LoadEnvPath(path_collection_t *col, const char* defpath, const char* env) +static void loadPath(path_collection_t *col, const char* defpath, const char* path) { - const char* p = getenv(env); - if(p) { - ParseList(p, col, 1); + if(path) { + ParseList(path, col, 1); } else { ParseList(defpath, col, 1); } @@ -1199,67 +276,41 @@ void LoadEnvPath(path_collection_t *col, const char* defpath, const char* env) void PrintCollection(path_collection_t* col, const char* env) { - if(LOG_INFO<=box64_log) { + if (LOG_INFO<=BOX64ENV(log)) { printf_log(LOG_INFO, "%s: ", env); for(int i=0; isize; i++) - printf_log(LOG_INFO, "%s%s", col->paths[i], (i==col->size-1)?"\n":":"); + printf_log_prefix(0, LOG_INFO, "%s%s", col->paths[i], (i==col->size-1)?"":":"); + printf_log_prefix(0, LOG_INFO, "\n"); } } EXPORTDYN int CountEnv(char** env) { - // count, but remove all BOX64_* environnement - // also remove PATH and LD_LIBRARY_PATH - // but add 2 for default BOX64_PATH and BOX64_LD_LIBRARY_PATH char** p = env; int c = 0; while(*p) { - if(strncmp(*p, "BOX64_", 6)!=0) - //if(!(strncmp(*p, "PATH=", 5)==0 || strncmp(*p, "LD_LIBRARY_PATH=", 16)==0)) - ++c; + ++c; ++p; } - return c+2; + return c; } EXPORTDYN int GatherEnv(char*** dest, char** env, char* prog) { - // Add all but BOX64_* environnement - // but add 2 for default BOX64_PATH and BOX64_LD_LIBRARY_PATH char** p = env; int idx = 0; - int path = 0; - int ld_path = 0; + int _prog = 0; while(*p) { - if(strncmp(*p, "BOX64_PATH=", 11)==0) { - (*dest)[idx++] = box_strdup(*p+6); - path = 1; - } else if(strncmp(*p, "BOX64_LD_LIBRARY_PATH=", 22)==0) { - (*dest)[idx++] = box_strdup(*p+6); - ld_path = 1; - } else if(strncmp(*p, "_=", 2)==0) { - /*int l = strlen(prog); - char tmp[l+3]; - strcpy(tmp, "_="); - strcat(tmp, prog); - (*dest)[idx++] = box_strdup(tmp);*/ - } else if(strncmp(*p, "BOX64_", 6)!=0) { + if(strncmp(*p, "_=", 2)==0) { + _prog = 1; + } else { (*dest)[idx++] = box_strdup(*p); - /*if(!(strncmp(*p, "PATH=", 5)==0 || strncmp(*p, "LD_LIBRARY_PATH=", 16)==0)) { - }*/ } ++p; } - // update the calloc of envv when adding new variables here - if(!path) { - (*dest)[idx++] = box_strdup("BOX64_PATH=.:bin"); - } - if(!ld_path) { - (*dest)[idx++] = box_strdup("BOX64_LD_LIBRARY_PATH=.:lib:lib64:x86_64:bin64:libs64"); - } // add "_=prog" at the end... - if(prog) { + if(_prog && prog) { int l = strlen(prog); char tmp[l+3]; strcpy(tmp, "_="); @@ -1267,215 +318,157 @@ int GatherEnv(char*** dest, char** env, char* prog) (*dest)[idx++] = box_strdup(tmp); } // and a final NULL - (*dest)[idx++] = 0; + (*dest)[idx++] = NULL; return 0; } void AddNewLibs(const char* list) { AppendList(&box64_addlibs, list, 0); - printf_log(LOG_INFO, "BOX64: Adding %s to the libs\n", list); -} - -void PrintFlags() { - printf("Environment Variables:\n"); - printf(" BOX64_PATH is the box64 version of PATH (default is '.:bin')\n"); - printf(" BOX64_LD_LIBRARY_PATH is the box64 version LD_LIBRARY_PATH (default is '.:lib:lib64')\n"); - printf(" BOX64_LOG with 0/1/2/3 or NONE/INFO/DEBUG/DUMP to set the printed debug info (level 3 is level 2 + BOX64_DUMP)\n"); - printf(" BOX64_DUMP with 0/1 to dump elf infos\n"); - printf(" BOX64_NOBANNER with 0/1 to enable/disable the printing of box64 version and build at start\n"); -#ifdef DYNAREC - printf(" BOX64_DYNAREC_LOG with 0/1/2/3 or NONE/INFO/DEBUG/DUMP to set the printed dynarec info\n"); - printf(" BOX64_DYNAREC with 0/1 to disable or enable Dynarec (On by default)\n"); - printf(" BOX64_NODYNAREC with address interval (0x1234-0x4567) to forbid dynablock creation in the interval specified\n"); -#endif -#ifdef HAVE_TRACE - printf(" BOX64_TRACE with 1 to enable x86_64 execution trace\n"); - printf(" or with XXXXXX-YYYYYY to enable x86_64 execution trace only between address\n"); - printf(" or with FunctionName to enable x86_64 execution trace only in one specific function\n"); - printf(" use BOX64_TRACE_INIT instead of BOX64_TRACE to start trace before init of Libs and main program\n\t (function name will probably not work then)\n"); - printf(" BOX64_TRACE_EMM with 1 to enable dump of MMX registers along with regular registers\n"); - printf(" BOX64_TRACE_XMM with 1 to enable dump of SSE registers along with regular registers\n"); - printf(" BOX64_TRACE_COLOR with 1 to enable detection of changed general register values\n"); - printf(" BOX64_TRACE_START with N to enable trace after N instructions\n"); -#ifdef DYNAREC - printf(" BOX64_DYNAREC_TRACE with 0/1 to disable or enable Trace on generated code too\n"); -#endif -#endif - printf(" BOX64_TRACE_FILE with FileName to redirect logs in a file (or stderr to use stderr instead of stdout)\n"); - printf(" BOX64_DLSYM_ERROR with 1 to log dlsym errors\n"); - printf(" BOX64_LOAD_ADDR=0xXXXXXX try to load at 0xXXXXXX main binary (if binary is a PIE)\n"); - printf(" BOX64_NOSIGSEGV=1 to disable handling of SigSEGV\n"); - printf(" BOX64_NOSIGILL=1 to disable handling of SigILL\n"); - printf(" BOX64_SHOWSEGV=1 to show Segfault signal even if a signal handler is present\n"); - printf(" BOX64_X11THREADS=1 to call XInitThreads when loading X11 (for old Loki games with Loki_Compat lib)\n"); - printf(" BOX64_LIBGL=libXXXX set the name (and optionnally full path) for libGL.so.1\n"); - printf(" BOX64_LD_PRELOAD=XXXX[:YYYYY] force loading XXXX (and YYYY...) libraries with the binary\n"); - printf(" BOX64_ALLOWMISSINGLIBS with 1 to allow one to continue even if a lib is missing (unadvised, will probably crash later)\n"); - printf(" BOX64_PREFER_EMULATED=1 to prefer emulated libs first (execpt for glibc, alsa, pulse, GL, vulkan and X11)\n"); - printf(" BOX64_PREFER_WRAPPED if box64 will use wrapped libs even if the lib is specified with absolute path\n"); - printf(" BOX64_CRASHHANDLER=0 to not use a dummy crashhandler lib\n"); - printf(" BOX64_NOPULSE=1 to disable the loading of pulseaudio libs\n"); - printf(" BOX64_NOGTK=1 to disable the loading of wrapped gtk libs\n"); - printf(" BOX64_NOVULKAN=1 to disable the loading of wrapped vulkan libs\n"); - printf(" BOX64_ENV='XXX=yyyy' will add XXX=yyyy env. var.\n"); - printf(" BOX64_ENV1='XXX=yyyy' will add XXX=yyyy env. var. and continue with BOX86_ENV2 ... until var doesn't exist\n"); - printf(" BOX64_JITGDB with 1 to launch \"gdb\" when a segfault is trapped, attached to the offending process\n"); - printf(" BOX64_MMAP32=1 to use 32bits address space mmap in priority for external mmap as soon a 32bits process are detected (default for Snapdragon build)\n"); + printf_log(LOG_INFO, "Adding %s to the libs\n", list); } void PrintHelp() { - printf("This is Box64, The Linux x86_64 emulator with a twist\n"); - printf("\nUsage is 'box64 [options] path/to/software [args]' to launch x86_64 software.\n"); - printf(" options are:\n"); - printf(" '-v'|'--version' to print box64 version and quit\n"); - printf(" '-h'|'--help' to print this and quit\n"); - printf(" '-f'|'--flags' to print box64 flags and quit\n"); + PrintfFtrace(0, "%s\n", BOX64_BUILD_INFO_STRING); + PrintfFtrace(0, "Linux userspace x86-64 emulator with a twist.\n"); + PrintfFtrace(0, "There are many environment variables to control Box64's behaviour, checkout the documentation here: https://github.com/ptitSeb/box64/blob/main/docs/USAGE.md\n\n"); + PrintfFtrace(0, "USAGE:\n"); + PrintfFtrace(0, "\tbox64 [options] path/to/x86_64/executable [args]\n"); + PrintfFtrace(0, "\tbox64-bash\n"); + PrintfFtrace(0, "OPTIONS:\n"); + PrintfFtrace(0, "\t-v, --version print box64 version and quit\n"); + PrintfFtrace(0, "\t-h, --help print this and quit\n"); + PrintfFtrace(0, "\t-k, --kill-all kill all box64 instances\n"); + PrintfFtrace(0, "\t-t, --test run a unit test\n"); + PrintfFtrace(0, "\t--dynacache-list list of DynaCache file and their validity\n"); + PrintfFtrace(0, "\t--dynacache-clean remove invalid DynaCache files\n"); } -void addNewEnvVar(const char* s) +void KillAllInstances() { - if(!s) + + struct dirent* entry; + ssize_t len; + char proc_path[PATH_MAX]; + char exe_path[PATH_MAX]; + char exe_target[PATH_MAX]; + char self_name[PATH_MAX]; + char self_name_with_deleted[PATH_MAX]; + + DIR* proc_dir = opendir("/proc"); + if (proc_dir == NULL) { + perror("opendir(/proc)"); return; - char* p = box_strdup(s); - char* e = strchr(p, '='); - if(!e) { - printf_log(LOG_INFO, "Invalid specific env. var. '%s'\n", s); - box_free(p); + } + + ssize_t self_len = readlink("/proc/self/exe", exe_path, sizeof(exe_path) - 1); + if (self_len == -1) { + perror("readlink(/proc/self/exe)"); + closedir(proc_dir); return; } - *e='\0'; - ++e; - setenv(p, e, 1); - box_free(p); + exe_path[self_len] = '\0'; + + char* base_name_self = strrchr(exe_path, '/'); + base_name_self = base_name_self ? base_name_self + 1 : exe_path; + strncpy(self_name, base_name_self, sizeof(self_name)); + self_name[sizeof(self_name) - 1] = '\0'; + + snprintf(self_name_with_deleted, sizeof(self_name_with_deleted), "%s (deleted)", self_name); + + const pid_t self = getpid(); + while ((entry = readdir(proc_dir))) { + const pid_t pid = atoi(entry->d_name); + if (!pid || pid == self) continue; + + snprintf(proc_path, sizeof(proc_path), "/proc/%s", entry->d_name); + struct stat statbuf; + if (stat(proc_path, &statbuf) == -1 || !S_ISDIR(statbuf.st_mode)) continue; + snprintf(exe_path, sizeof(exe_path), "%s/exe", proc_path); + ssize_t len = readlink(exe_path, exe_target, sizeof(exe_target) - 1); + if (len == -1) continue; + exe_target[len] = '\0'; + char* base_name = strrchr(exe_target, '/'); + base_name = base_name ? base_name + 1 : exe_target; + if (strcmp(base_name, self_name) != 0 && strcmp(base_name, self_name_with_deleted) != 0) continue; + + if (!kill(pid, SIGKILL)) { + printf_log(LOG_INFO, "Killed box64 process %d\n", pid); + } else { + printf_log(LOG_INFO, "Failed to kill box64 process %d: %s\n", pid, strerror(errno)); + } + } + closedir(proc_dir); } -EXPORTDYN -void LoadEnvVars(box64context_t *context) +static void addLibPaths(box64context_t* context) { - // Check custom env. var. and add them if needed - { - char* p = getenv("BOX64_ENV"); - if(p) - addNewEnvVar(p); - int i = 1; - char box64_env[50]; - do { - sprintf(box64_env, "BOX64_ENV%d", i); - p = getenv(box64_env); - if(p) { - addNewEnvVar(p); - ++i; - } - } while(p); - } - // check BOX64_LD_LIBRARY_PATH and load it - LoadEnvPath(&context->box64_ld_lib, ".:lib:lib64:x86_64:bin64:libs64", "BOX64_LD_LIBRARY_PATH"); - #ifndef TERMUX - if(FileExist("/lib/x86_64-linux-gnu", 0)) - AddPath("/lib/x86_64-linux-gnu", &context->box64_ld_lib, 1); - if(FileExist("/usr/lib/x86_64-linux-gnu", 0)) - AddPath("/usr/lib/x86_64-linux-gnu", &context->box64_ld_lib, 1); - if(FileExist("/usr/x86_64-linux-gnu/lib", 0)) - AddPath("/usr/x86_64-linux-gnu/lib", &context->box64_ld_lib, 1); - if(FileExist("/data/data/com.termux/files/usr/glibc/lib/x86_64-linux-gnu", 0)) - AddPath("/data/data/com.termux/files/usr/glibc/lib/x86_64-linux-gnu", &context->box64_ld_lib, 1); - #else - //TODO: Add Termux Library Path - Lily - if(FileExist("/data/data/com.termux/files/usr/lib/x86_64-linux-gnu", 0)) - AddPath("/data/data/com.termux/files/usr/lib/x86_64-linux-gnu", &context->box64_ld_lib, 1); - #endif - if(getenv("LD_LIBRARY_PATH")) - PrependList(&context->box64_ld_lib, getenv("LD_LIBRARY_PATH"), 1); // in case some of the path are for x86 world - if(getenv("BOX64_EMULATED_LIBS")) { - char* p = getenv("BOX64_EMULATED_LIBS"); + if(BOX64ENV(emulated_libs)) { + char* p = BOX64ENV(emulated_libs); ParseList(p, &context->box64_emulated_libs, 0); - if (my_context->box64_emulated_libs.size && box64_log) { + if (my_context->box64_emulated_libs.size && BOX64ENV(log)) { printf_log(LOG_INFO, "BOX64 will force the used of emulated libs for "); for (int i=0; ibox64_emulated_libs.size; ++i) - printf_log(LOG_INFO, "%s ", context->box64_emulated_libs.paths[i]); - printf_log(LOG_INFO, "\n"); - } - } - // add libssl and libcrypto (and a few other) to prefer emulated version because of multiple version exist - AddPath("libssl.so.1", &context->box64_emulated_libs, 0); - AddPath("libssl.so.1.0.0", &context->box64_emulated_libs, 0); - AddPath("libcrypto.so.1", &context->box64_emulated_libs, 0); - AddPath("libcrypto.so.1.0.0", &context->box64_emulated_libs, 0); - AddPath("libunwind.so.8", &context->box64_emulated_libs, 0); - AddPath("libpng12.so.0", &context->box64_emulated_libs, 0); - AddPath("libcurl.so.4", &context->box64_emulated_libs, 0); - AddPath("libtbbmalloc.so.2", &context->box64_emulated_libs, 0); - AddPath("libtbbmalloc_proxy.so.2", &context->box64_emulated_libs, 0); - - if(getenv("BOX64_SSE_FLUSHTO0")) { - if (strcmp(getenv("BOX64_SSE_FLUSHTO0"), "1")==0) { - box64_sse_flushto0 = 1; - printf_log(LOG_INFO, "BOX64: Direct apply of SSE Flush to 0 flag\n"); - } - } - if(getenv("BOX64_X87_NO80BITS")) { - if (strcmp(getenv("BOX64_X87_NO80BITS"), "1")==0) { - box64_x87_no80bits = 1; - printf_log(LOG_INFO, "BOX64: All 80bits x87 long double will be handle as double\n"); - } - } - if(getenv("BOX64_SYNC_ROUNDING")) { - if (strcmp(getenv("BOX64_SYNC_ROUNDING"), "1")==0) { - box64_sync_rounding = 1; - printf_log(LOG_INFO, "BOX64: Rouding mode with be synced with fesetround/fegetround\n"); - } - } - if(getenv("BOX64_PREFER_WRAPPED")) { - if (strcmp(getenv("BOX64_PREFER_WRAPPED"), "1")==0) { - box64_prefer_wrapped = 1; - printf_log(LOG_INFO, "BOX64: Prefering Wrapped libs\n"); - } - } - if(getenv("BOX64_PREFER_EMULATED")) { - if (strcmp(getenv("BOX64_PREFER_EMULATED"), "1")==0) { - box64_prefer_emulated = 1; - printf_log(LOG_INFO, "BOX64: Prefering Emulated libs\n"); + printf_log_prefix(0, LOG_INFO, "%s ", context->box64_emulated_libs.paths[i]); + printf_log_prefix(0, LOG_INFO, "\n"); } } - if(getenv("BOX64_NOSIGSEGV")) { - if (strcmp(getenv("BOX64_NOSIGSEGV"), "1")==0) { - context->no_sigsegv = 1; - printf_log(LOG_INFO, "BOX64: Disabling handling of SigSEGV\n"); - } + // Add libssl and libcrypto (and a few others) to prefer the emulated version because multiple versions exist + #define GO(A) AddPath(A, &context->box64_emulated_libs, 0); + GO("libssl.so.1"); + GO("libssl.so.1.0.0"); + GO("libcrypto.so.1"); + GO("libcrypto.so.1.0.0"); + GO("libunwind.so.8"); + GO("libpng12.so.0"); + GO("libpng16.so.16"); + GO("libcurl.so.4"); + if(getenv("BOX64_PRESSURE_VESSEL_FILES")) // use emulated gnutls in this case, it's safer + GO("libgnutls.so.30"); + GO("libtbbmalloc.so.2"); + GO("libtbbmalloc_proxy.so.2"); + GO("libicuuc.so.64"); + GO("libicui18n.so.64"); + GO("libicuuc.so.66"); + GO("libicui18n.so.66"); + GO("libicuuc.so.67"); + GO("libicui18n.so.67"); + GO("libicuuc.so.72"); + GO("libicui18n.so.72"); + GO("libicuuc.so.73"); + GO("libicui18n.so.73"); + GO("libicuuc.so.74"); + GO("libicui18n.so.74"); + GO("libicuuc.so.75"); + GO("libicui18n.so.75"); + GO("libicuuc.so.76"); + GO("libicui18n.so.76"); + #undef GO + + if(BOX64ENV(nosigsegv)) { + context->no_sigsegv = 1; } - if(getenv("BOX64_NOSIGILL")) { - if (strcmp(getenv("BOX64_NOSIGILL"), "1")==0) { - context->no_sigill = 1; - printf_log(LOG_INFO, "BOX64: Disabling handling of SigILL\n"); - } + if(BOX64ENV(nosigill)) { + context->no_sigill = 1; } - if(getenv("BOX64_ADDLIBS")) { - AddNewLibs(getenv("BOX64_ADDLIBS")); + if(BOX64ENV(addlibs)) { + AddNewLibs(BOX64ENV(addlibs)); } - // check BOX64_PATH and load it - LoadEnvPath(&context->box64_path, ".:bin", "BOX64_PATH"); + loadPath(&context->box64_path, ".:bin", BOX64ENV(path)); if(getenv("PATH")) AppendList(&context->box64_path, getenv("PATH"), 1); // in case some of the path are for x86 world +} + +static void setupZydis(box64context_t* context) +{ #ifdef HAVE_TRACE - char* p = getenv("BOX64_TRACE"); - if(p) { - if (strcmp(p, "0")) { - context->x64trace = 1; - box64_trace = p; - } + if ((BOX64ENV(trace_init) && strcmp(BOX64ENV(trace_init), "0")) || (BOX64ENV(trace) && strcmp(BOX64ENV(trace), "0"))) { + context->x64trace = 1; } - p = getenv("BOX64_TRACE_INIT"); - if(p) { - if (strcmp(p, "0")) { - context->x64trace = 1; - trace_init = p; - } - } - if(my_context->x64trace) { + if (context->x64trace) { printf_log(LOG_INFO, "Initializing Zydis lib\n"); - if(InitX64Trace(my_context)) { + if (InitX64Trace(context)) { printf_log(LOG_INFO, "Zydis init failed. No x86 trace activated\n"); context->x64trace = 0; } @@ -1483,16 +476,81 @@ void LoadEnvVars(box64context_t *context) #endif } +EXPORTDYN +void LoadLDPath(box64context_t *context) +{ + #ifdef BOX32 + if(box64_is32bits) + loadPath(&context->box64_ld_lib, ".:lib:i386:bin:libs", BOX64ENV(ld_library_path)); + else + #endif + loadPath(&context->box64_ld_lib, ".:lib:lib64:x86_64:bin64:libs64", BOX64ENV(ld_library_path)); + #ifndef TERMUX + if(box64_is32bits) { + #ifdef BOX32 + if(FileExist("/lib/i386-linux-gnu", 0)) + AddPath("/lib/i386-linux-gnu", &context->box64_ld_lib, 1); + if(FileExist("/usr/lib/i386-linux-gnu", 0)) + AddPath("/usr/lib/i386-linux-gnu", &context->box64_ld_lib, 1); + if(FileExist("/usr/i386-linux-gnu/lib", 0)) + AddPath("/usr/i386-linux-gnu/lib", &context->box64_ld_lib, 1); + if(FileExist("/usr/lib/box64-i386-linux-gnu", 0)) + AddPath("/usr/lib/box64-i386-linux-gnu", &context->box64_ld_lib, 1); + if(FileExist("/opt/box64/lib32", 0)) + AddPath("/opt/box64/lib32", &context->box64_ld_lib, 1); + if(FileExist("/data/data/com.termux/files/usr/glibc/lib/i386-linux-gnu", 0)) + AddPath("/data/data/com.termux/files/usr/glibc/lib/i386-linux-gnu", &context->box64_ld_lib, 1); + if(FileExist("/data/data/com.termux/files/usr/glibc/lib/box64-i386-linux-gnu", 0)) + AddPath("/data/data/com.termux/files/usr/glibc/lib/box64-i386-linux-gnu", &context->box64_ld_lib, 1); + if(FileExist("/data/data/com.termux/files/usr/lib/box64-i386-linux-gnu", 0)) + AddPath("/data/data/com.termux/files/usr/lib/box64-i386-linux-gnu", &context->box64_ld_lib, 1); + #endif + } else { + if(FileExist("/lib/x86_64-linux-gnu", 0)) + AddPath("/lib/x86_64-linux-gnu", &context->box64_ld_lib, 1); + if(FileExist("/usr/lib/x86_64-linux-gnu", 0)) + AddPath("/usr/lib/x86_64-linux-gnu", &context->box64_ld_lib, 1); + if(FileExist("/usr/x86_64-linux-gnu/lib", 0)) + AddPath("/usr/x86_64-linux-gnu/lib", &context->box64_ld_lib, 1); + if(FileExist("/usr/lib/box64-x86_64-linux-gnu", 0)) + AddPath("/usr/lib/box64-x86_64-linux-gnu", &context->box64_ld_lib, 1); + if(FileExist("/opt/box64/lib64", 0)) + AddPath("/opt/box64/lib64", &context->box64_ld_lib, 1); + if(FileExist("/data/data/com.termux/files/usr/glibc/lib/x86_64-linux-gnu", 0)) + AddPath("/data/data/com.termux/files/usr/glibc/lib/x86_64-linux-gnu", &context->box64_ld_lib, 1); + if(FileExist("/data/data/com.termux/files/usr/glibc/lib/box64-x86_64-linux-gnu", 0)) + AddPath("/data/data/com.termux/files/usr/glibc/lib/box64-x86_64-linux-gnu", &context->box64_ld_lib, 1); + if(FileExist("/data/data/com.termux/files/usr/lib/box64-x86_64-linux-gnu", 0)) + AddPath("/data/data/com.termux/files/usr/lib/box64-x86_64-linux-gnu", &context->box64_ld_lib, 1); + } + #else + //TODO: Add Termux Library Path - Lily + if(box64_is32bits) { + #ifdef BOX32 + if(FileExist("/data/data/com.termux/files/usr/lib/i386-linux-gnu", 0)) + AddPath("/data/data/com.termux/files/usr/lib/i386-linux-gnu", &context->box64_ld_lib, 1); + #endif + } else { + if(FileExist("/data/data/com.termux/files/usr/lib/x86_64-linux-gnu", 0)) + AddPath("/data/data/com.termux/files/usr/lib/x86_64-linux-gnu", &context->box64_ld_lib, 1); + } + #endif + if(getenv("LD_LIBRARY_PATH")) + PrependList(&context->box64_ld_lib, getenv("LD_LIBRARY_PATH"), 1); // in case some of the path are for x86 world +} + EXPORTDYN void setupTraceInit() { #ifdef HAVE_TRACE - char* p = trace_init; + char* p = BOX64ENV(trace_init); if(p) { setbuf(stdout, NULL); uintptr_t s_trace_start=0, s_trace_end=0; if (strcmp(p, "1")==0) SetTraceEmu(0, 0); + else if (strcmp(p, "0")==0) + ; else if (strchr(p,'-')) { if(sscanf(p, "%ld-%ld", &s_trace_start, &s_trace_end)!=2) { if(sscanf(p, "0x%lX-0x%lX", &s_trace_start, &s_trace_end)!=2) @@ -1501,10 +559,16 @@ void setupTraceInit() if(s_trace_start || s_trace_end) SetTraceEmu(s_trace_start, s_trace_end); } else { - if (GetGlobalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL, 0, NULL)) { - SetTraceEmu(s_trace_start, s_trace_end); - printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end); - } else if(GetLocalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL, 0, NULL)) { + int veropt = 1; + int ver = 0; + const char* vername = NULL; + int search = 0; + for(int i=0; ielfsize && !search; ++i) { + search = ElfGetSymbolStartEnd(my_context->elfs[i], &s_trace_start, &s_trace_end, p, &ver, &vername, 1, &veropt)?1:0; + if(!search) + search = ElfGetSymTabStartEnd(my_context->elfs[i], &s_trace_start, &s_trace_end, p); + } + if(search) { SetTraceEmu(s_trace_start, s_trace_end); printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end); } else { @@ -1513,10 +577,8 @@ void setupTraceInit() } } } else { - p = box64_trace; - if(p) - if (strcmp(p, "0")) - SetTraceEmu(0, 1); + if(BOX64ENV(trace) && strcmp(BOX64ENV(trace), "0")) + SetTraceEmu(0, 1); } #endif } @@ -1528,42 +590,19 @@ void setupTraceMapLib(lib_t* maplib) return; char* p = trace_func; uintptr_t s_trace_start=0, s_trace_end=0; - if(maplib) { - if (GetGlobalSymbolStartEnd(maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL, 0, NULL)) { - SetTraceEmu(s_trace_start, s_trace_end); - printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end); - box_free(trace_func); - trace_func = NULL; - return; - } else if(GetLocalSymbolStartEnd(maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL, 0, NULL)) { - SetTraceEmu(s_trace_start, s_trace_end); - printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end); - box_free(trace_func); - trace_func = NULL; - return; - } else if(GetSymTabStartEnd(maplib, p, &s_trace_start, &s_trace_end)) { - SetTraceEmu(s_trace_start, s_trace_end); - printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end); - box_free(trace_func); - trace_func = NULL; - return; - } - } - if (my_context->elfs && GetGlobalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL, 0, NULL)) { - SetTraceEmu(s_trace_start, s_trace_end); - printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end); - box_free(trace_func); - trace_func = NULL; - } else if(my_context->elfs && GetLocalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL, 0, NULL)) { + void* search = NULL; + if(GetAnySymbolStartEnd(maplib, p, &s_trace_start, &s_trace_end, 0, NULL, 1)) { SetTraceEmu(s_trace_start, s_trace_end); printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end); box_free(trace_func); trace_func = NULL; - } else if(GetSymTabStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end)) { + return; + } else if(GetSymTabStartEnd(maplib, p, &s_trace_start, &s_trace_end)) { SetTraceEmu(s_trace_start, s_trace_end); printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end); box_free(trace_func); trace_func = NULL; + return; } else { printf_log(LOG_NONE, "Warning, Symbol to trace (\"%s\") not found. Trying to set trace later\n", p); SetTraceEmu(0, 1); // disabling trace, mostly @@ -1575,12 +614,14 @@ EXPORTDYN void setupTrace() { #ifdef HAVE_TRACE - char* p = box64_trace; + char* p = BOX64ENV(trace); if(p) { setbuf(stdout, NULL); uintptr_t s_trace_start=0, s_trace_end=0; if (strcmp(p, "1")==0) SetTraceEmu(0, 0); + else if (strcmp(p, "0")==0) + ; else if (strchr(p,'-')) { if(sscanf(p, "%ld-%ld", &s_trace_start, &s_trace_end)!=2) { if(sscanf(p, "0x%lX-0x%lX", &s_trace_start, &s_trace_end)!=2) @@ -1595,10 +636,18 @@ void setupTrace() } } } else { - if (my_context->elfs && GetGlobalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL, 0, NULL)) { - SetTraceEmu(s_trace_start, s_trace_end); - printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end); - } else if(my_context->elfs && GetLocalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL, 0, NULL)) { + int search = 0; + if (my_context->elfs) { + int veropt = 1; + int ver = 0; + const char* vername = NULL; + for(int i=0; ielfsize && !search; ++i) { + search = ElfGetSymbolStartEnd(my_context->elfs[i], &s_trace_start, &s_trace_end, p, &ver, &vername, 1, &veropt)?1:0; + if(!search) + search = ElfGetSymTabStartEnd(my_context->elfs[i], &s_trace_start, &s_trace_end, p); + } + } + if(search) { SetTraceEmu(s_trace_start, s_trace_end); printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end); } else { @@ -1621,6 +670,7 @@ void endBox64() if(!my_context || box64_quit) return; + SerializeAllMapping(); // just to be safe // then call all the fini dynarec_log(LOG_DEBUG, "endBox64() called\n"); box64_quit = 1; @@ -1631,9 +681,9 @@ void endBox64() printf_log(LOG_DEBUG, "Calling atexit registered functions (exiting box64)\n"); CallAllCleanup(emu); printf_log(LOG_DEBUG, "Calling fini for all loaded elfs and unload native libs\n"); + //void closeAllDLOpened(); + //closeAllDLOpened(); // close residual dlopened libs. Disabled, seems like a bad idea, better to unload with proper dependancies RunElfFini(my_context->elfs[0], emu); - void closeAllDLOpenned(); - closeAllDLOpenned(); // close residual dlopenned libs // unload needed libs needed_libs_t* needed = my_context->elfs[0]->needed; printf_log(LOG_DEBUG, "Unloaded main elf: Will Dec RefCount of %d libs\n", needed?needed->size:0); @@ -1644,14 +694,15 @@ void endBox64() #ifndef STATICBUILD endMallocHook(); #endif + SerializeAllMapping(); // to be safe FreeBox64Context(&my_context); #ifdef DYNAREC // disable dynarec now - box64_dynarec = 0; + SET_BOX64ENV(dynarec, 0); #endif - if(box64_libGL) { - box_free(box64_libGL); - box64_libGL = NULL; + if(BOX64ENV(libgl)) { + box_free(BOX64ENV(libgl)); + SET_BOX64ENV(libgl, NULL); } if(box64_custom_gstreamer) { box_free(box64_custom_gstreamer); @@ -1672,38 +723,16 @@ static void add_argv(const char* what) { if(!strcmp(my_context->argv[i], what)) there = 1; if(!there) { - printf_log(LOG_INFO, "Inserting \"%s\" to the argments\n", what); - my_context->argv = (char**)box_realloc(my_context->argv, (my_context->argc+1)*sizeof(char*)); - my_context->argv[my_context->argc] = box_strdup(what); + // try to prepend the arg, not appending + static int where = 0; + if(!where) + where = (box64_wine)?2:1; + printf_log(LOG_INFO, "Inserting \"%s\" to the argument %d\n", what, where); + my_context->argv = (char**)box_realloc(my_context->argv, (my_context->argc+1+1)*sizeof(char*)); + memmove(my_context->argv+where+1, my_context->argv+where, (my_context->argc-where)*sizeof(char*)); + my_context->argv[where] = box_strdup(what); my_context->argc++; - } -} - -static void load_rcfiles() -{ - char* rcpath = getenv("BOX64_RCFILE"); - - if(rcpath && FileExist(rcpath, IS_FILE)) - LoadRCFile(rcpath); - #ifndef TERMUX - else if(FileExist("/etc/box64.box64rc", IS_FILE)) - LoadRCFile("/etc/box64.box64rc"); - else if(FileExist("/data/data/com.termux/files/usr/glibc/etc/box64.box64rc", IS_FILE)) - LoadRCFile("/data/data/com.termux/files/usr/glibc/etc/box64.box64rc"); - #else - else if(FileExist("/data/data/com.termux/files/usr/etc/box64.box64rc", IS_FILE)) - LoadRCFile("/data/data/com.termux/files/usr/etc/box64.box64rc"); - #endif - else - LoadRCFile(NULL); // load default rcfile - - char* p = getenv("HOME"); - if(p) { - char tmp[4096]; - strncpy(tmp, p, 4095); - strncat(tmp, "/.box64rc", 4095); - if(FileExist(tmp, IS_FILE)) - LoadRCFile(tmp); + where++; } } @@ -1712,68 +741,71 @@ void pressure_vessel(int argc, const char** argv, int nextarg, const char* prog) #endif extern char** environ; - int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elfheader_t** elfheader, int exec) { - #ifndef STATICBUILD +#ifndef STATICBUILD init_malloc_hook(); - #endif +#endif init_auxval(argc, argv, environ?environ:env); // analogue to QEMU_VERSION in qemu-user-mode emulation if(getenv("BOX64_VERSION")) { - PrintBox64Version(); + PrintBox64Version(0); exit(0); } // trying to open and load 1st arg if(argc==1) { - /*PrintBox64Version(); + /*PrintBox64Version(1); PrintHelp(); return 1;*/ - printf("BOX64: Missing operand after 'box64'\n"); + printf("[BOX64] Missing operand after 'box64'\n"); printf("See 'box64 --help' for more information.\n"); exit(0); } - if(argc>1 && !strcmp(argv[1], "/usr/bin/gdb") && getenv("BOX64_TRACE_FILE")) + if(argc>1 && !strcmp(argv[1], "/usr/bin/gdb") && BOX64ENV(trace_file)) exit(0); // uname -m is redirected to box64 -m - if(argc==2 && (!strcmp(argv[1], "-m") || !strcmp(argv[1], "-p") || !strcmp(argv[1], "-i"))) - { + if (argc == 2 && (!strcmp(argv[1], "-m") || !strcmp(argv[1], "-p") || !strcmp(argv[1], "-i"))) { printf("x86_64\n"); exit(0); } - // check BOX64_LOG debug level - LoadLogEnv(); - if(!getenv("BOX64_NORCFILES")) { - load_rcfiles(); - } - char* bashpath = NULL; - { - char* p = getenv("BOX64_BASH"); - if(p) { - if(FileIsX64ELF(p)) { - bashpath = p; - printf_log(LOG_INFO, "Using bash \"%s\"\n", bashpath); - } else { - printf_log(LOG_INFO, "The x86_64 bash \"%s\" is not an x86_64 binary.\n", p); - } - } + if (argc >= 3 && (!strcmp(argv[1], "--test") || !strcmp(argv[1], "-t"))) { + box64_unittest_mode = 1; + exit(unittest(argc, argv)); } + ftrace = stderr; + + // grab pagesize + box64_pagesize = sysconf(_SC_PAGESIZE); + if(!box64_pagesize) + box64_pagesize = 4096; + + LoadEnvVariables(); + InitializeEnvFiles(); + const char* prog = argv[1]; int nextarg = 1; // check if some options are passed while(prog && prog[0]=='-') { if(!strcmp(prog, "-v") || !strcmp(prog, "--version")) { - PrintBox64Version(); + PrintBox64Version(0); exit(0); } if(!strcmp(prog, "-h") || !strcmp(prog, "--help")) { PrintHelp(); exit(0); } - if(!strcmp(prog, "-f") || !strcmp(prog, "--flags")) { - PrintFlags(); + if (!strcmp(prog, "-k") || !strcmp(prog, "--kill-all")) { + KillAllInstances(); + exit(0); + } + if(!strcmp(prog, "--dynacache-list")) { + DynaCacheList(argv[nextarg+1]); + exit(0); + } + if(!strcmp(prog, "--dynacache-clean")) { + DynaCacheClean(); exit(0); } // other options? @@ -1781,52 +813,81 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf prog = argv[++nextarg]; break; } - printf("Warning, Unrecognized option '%s'\n", prog); + printf("Warning, unrecognized option '%s'\n", prog); prog = argv[++nextarg]; } if(!prog || nextarg==argc) { - printf("BOX64: Nothing to run\n"); + printf("[BOX64] Nothing to run\n"); exit(0); } - if(!box64_nobanner) - PrintBox64Version(); + + if (!BOX64ENV(nobanner)) PrintBox64Version(1); + + InitializeSystemInfo(); + displayMiscInfo(); + + hookMangoHud(); + + char* bashpath = NULL; + { + char* p = BOX64ENV(bash); + if(p) { + if(FileIsX64ELF(p)) { + bashpath = p; + printf_log(LOG_INFO, "Using bash \"%s\"\n", bashpath); + } else { + printf_log(LOG_INFO, "The x86_64 bash \"%s\" is not an x86_64 binary.\n", p); + } + } + } + char* pythonpath = NULL; + { + char* p = BOX64ENV(python3); + if(p) { + if(FileIsX64ELF(p)) { + pythonpath = p; + printf_log(LOG_INFO, "Using python3 \"%s\"\n", pythonpath); + } else { + printf_log(LOG_INFO, "The x86_64 python3 \"%s\" is not an x86_64 binary.\n", p); + } + } + } + // precheck, for win-preload - if(strstr(prog, "wine-preloader")==(prog+strlen(prog)-strlen("wine-preloader")) - || strstr(prog, "wine64-preloader")==(prog+strlen(prog)-strlen("wine64-preloader"))) { + const char* prog_ = strrchr(prog, '/'); + if(!prog_) prog_ = prog; else ++prog_; + if(!strcmp(prog_, "wine-preloader") || !strcmp(prog_, "wine64-preloader")) { // wine-preloader detecter, skipping it if next arg exist and is an x86 binary int x64 = (nextarg4 && !strcasecmp(argv[nextarg+1]+strlen(argv[nextarg+1])-4, ".exe")) { + // Try to get the name of the exe being run, to ApplyEnvFileEntry laters + if(argv[nextarg+1] && argv[nextarg+1][0]!='-' && strlen(argv[nextarg+1])>4 /*&& !strcasecmp(argv[nextarg+1]+strlen(argv[nextarg+1])-4, ".exe")*/) { const char* pp = strrchr(argv[nextarg+1], '/'); if(pp) - wine_prog = pp+1; + box64_wine_guest_name = pp + 1; else { pp = strrchr(argv[nextarg+1], '\\'); if(pp) - wine_prog = pp+1; + box64_wine_guest_name = pp + 1; else - wine_prog = argv[nextarg+1]; + box64_wine_guest_name = argv[nextarg + 1]; } } - if(wine_prog) printf_log(LOG_INFO, "BOX64: Detected running wine with \"%s\"\n", wine_prog); + if (box64_wine_guest_name) printf_log(LOG_INFO, "Detected running wine with \"%s\"\n", box64_wine_guest_name); } else if(strstr(prog, "ld-musl-x86_64.so.1")) { // check if ld-musl-x86_64.so.1 is used - printf_log(LOG_INFO, "BOX64: ld-musl detected. Trying to workaround and use system ld-linux\n"); + printf_log(LOG_INFO, "ld-musl detected. Trying to workaround and use system ld-linux\n"); box64_musl = 1; // skip ld-musl and go through args unti "--" is found, handling "--library-path" to add some libs to BOX64_LD_LIBRARY ++nextarg; @@ -1877,20 +941,25 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf } ++nextarg; prog = argv[nextarg]; - } - // check if this is wineserver - if(!strcmp(prog, "wineserver") || !strcmp(prog, "wineserver64") || (strlen(prog)>9 && !strcmp(prog+strlen(prog)-strlen("/wineserver"), "/wineserver"))) { + } else if(!strcmp(prog_, "steam") ) { + printf_log(LOG_INFO, "steam detected\n"); + box64_steam = 1; + } else if(!strcmp(prog_, "steamcmd")) { + printf_log(LOG_INFO, "steamcmd detected\n"); + box64_steamcmd = 1; + } else if(!strcmp(prog_, "wineserver")) { + // check if this is wineserver box64_wine = 1; } // Create a new context my_context = NewBox64Context(argc - nextarg); - // check BOX64_LD_LIBRARY_PATH and load it - LoadEnvVars(my_context); + addLibPaths(my_context); + // Append ld_list if it exist if(ld_libs_args!=-1) PrependList(&my_context->box64_ld_lib, argv[ld_libs_args], 1); - if(is_custom_gstreamer) + if(is_custom_gstreamer) //TODO: is this still needed? AddPath("libwayland-client.so.0", &my_context->box64_emulated_libs, 0); my_context->box64path = ResolveFile(argv[0], &my_context->box64_path); @@ -1898,22 +967,28 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf my_context->envc = CountEnv(environ?environ:env); printf_log(LOG_INFO, "Counted %d Env var\n", my_context->envc); // allocate extra space for new environment variables such as BOX64_PATH - my_context->envv = (char**)box_calloc(my_context->envc+4, sizeof(char*)); - GatherEnv(&my_context->envv, environ?environ:env, my_context->box64path); - if(box64_dump || box64_log<=LOG_DEBUG) { - for (int i=0; ienvc; ++i) - printf_dump(LOG_DEBUG, " Env[%02d]: %s\n", i, my_context->envv[i]); + my_context->envv = (char**)box_calloc(my_context->envc+1, sizeof(char*)); + + #ifndef STATICBUILD + // pre-check for pressure-vessel-wrap + if(!strcmp(prog_, "pressure-vessel-wrap")) { + printf_log(LOG_INFO, "pressure-vessel-wrap detected, bashpath=%s\n", my_context->bashpath?my_context->bashpath:"(nil)"); + unsetenv("BOX64_ARG0"); + if(!my_context->bashpath) + my_context->bashpath = ResolveFile("box64-bash", &my_context->box64_path); + pressure_vessel(argc, argv, nextarg+1, prog); } + #endif path_collection_t ld_preload = {0}; if(getenv("BOX64_LD_PRELOAD")) { char* p = getenv("BOX64_LD_PRELOAD"); ParseList(p, &ld_preload, 0); - if (ld_preload.size && box64_log) { + if (ld_preload.size && BOX64ENV(log)) { printf_log(LOG_INFO, "BOX64 trying to Preload "); for (int i=0; ibox64_ld_lib, "BOX64 LIB PATH"); - PrintCollection(&my_context->box64_path, "BOX64 BIN PATH"); + PrintCollection(&my_context->box64_ld_lib, "Library search path"); + PrintCollection(&my_context->box64_path, "Binary search path"); // lets build argc/argv stuff printf_log(LOG_INFO, "Looking for %s\n", prog); - my_context->argv[0] = ResolveFileSoft(prog, &my_context->box64_path); + if(strchr(prog, '/')) + my_context->argv[0] = box_strdup(prog); + else + my_context->argv[0] = ResolveFileSoft(prog, &my_context->box64_path); + // + GatherEnv(&my_context->envv, environ?environ:env, my_context->argv[0]); + if (BOX64ENV(dump) || BOX64ENV(log)<=LOG_DEBUG) { + for (int i=0; ienvc; ++i) + printf_dump(LOG_DEBUG, " Env[%02d]: %s\n", i, my_context->envv[i]); + } // check if box86 is present { my_context->box86path = box_strdup(my_context->box64path); - char* p = strrchr(my_context->box86path, '6'); // get the 6 of box64 - p[0] = '8'; p[1] = '6'; // change 64 to 86 - if(!FileExist(my_context->box86path, IS_FILE)) { + #ifndef BOX32 + if(strstr(my_context->box86path, "box64")) { + char* p = strrchr(my_context->box86path, '6'); // get the 6 of box64 + p[0] = '8'; p[1] = '6'; // change 64 to 86 + } else { + box_free(my_context->box86path); + my_context->box86path = ResolveFileSoft("box86", &my_context->box64_path); + } + if(my_context->box86path && !FileExist(my_context->box86path, IS_FILE)) { box_free(my_context->box86path); my_context->box86path = NULL; } + #endif } - const char* prgname = strrchr(prog, '/'); - if(!prgname) - prgname = prog; + box64_guest_name = strrchr(prog, '/'); + if (!box64_guest_name) + box64_guest_name = prog; else - ++prgname; + ++box64_guest_name; if(box64_wine) { #ifdef ANDROID AddPath("libdl.so", &ld_preload, 0); @@ -1963,65 +1054,116 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf #endif } // special case for zoom - if(strstr(prgname, "zoom")==prgname) { + if (strstr(box64_guest_name, "zoom") == box64_guest_name) { printf_log(LOG_INFO, "Zoom detected, Trying to use system libturbojpeg if possible\n"); box64_zoom = 1; } - // special case for bash (add BOX86_NOBANNER=1 if not there) - if(!strcmp(prgname, "bash")) { - printf_log(LOG_INFO, "bash detected, disabling banner\n"); - if (!box64_nobanner) { + // special case for bash + int setup_bash_rcfile = 0; + if (!strcmp(box64_guest_name, "bash") || !strcmp(box64_guest_name, "box64-bash")) { + printf_log(LOG_INFO, "Bash detected, disabling banner\n"); + if (!BOX64ENV(nobanner)) { setenv("BOX86_NOBANNER", "1", 0); setenv("BOX64_NOBANNER", "1", 0); } if (!bashpath) { bashpath = (char*)prog; + SET_BOX64ENV(bash, (char*)prog); setenv("BOX64_BASH", prog, 1); } + setup_bash_rcfile = 1; } + if(!bashpath) + bashpath = ResolveFile("box64-bash", &my_context->box64_path); if(bashpath) my_context->bashpath = box_strdup(bashpath); + if(pythonpath) + my_context->pythonpath = box_strdup(pythonpath); - /*if(strstr(prgname, "awesomium_process")==prgname) { - printf_log(LOG_INFO, "awesomium_process detected, forcing emulated libpng12\n"); - AddPath("libpng12.so.0", &my_context->box64_emulated_libs, 0); - }*/ - /*if(!strcmp(prgname, "gdb")) { - exit(-1); - }*/ - ApplyParams("*"); // [*] is a special setting for all process - ApplyParams(prgname); - if(box64_wine && wine_prog) { - ApplyParams(wine_prog); - wine_prog = NULL; - } - if(box64_wine) - box64_maxcpu_immutable = 1; // cannot change once wine is loaded + int applied = ApplyEnvFileEntry(box64_guest_name); + if (box64_wine && box64_wine_guest_name) { + applied |= ApplyEnvFileEntry(box64_wine_guest_name); + box64_wine_guest_name = NULL; + } + if (applied) { + printf_log(LOG_INFO, "Applied settings from rcfile\n"); + displayMiscInfo(); + PrintEnvVariables(&box64env, LOG_INFO); + } + setupZydis(my_context); for(int i=1; iargc; ++i) { my_context->argv[i] = box_strdup(argv[i+nextarg]); printf_log(LOG_INFO, "argv[%i]=\"%s\"\n", i, my_context->argv[i]); } - if(box64_nosandbox) + + // Setup custom bash rcfile iff no args are present + if (setup_bash_rcfile && my_context->argc == 1) { + add_argv("--rcfile"); + add_argv("box64-custom-bashrc-file"); // handled by my_open + } + + if(BOX64ENV(nosandbox)) { add_argv("--no-sandbox"); } - if(box64_inprocessgpu) + if(BOX64ENV(inprocessgpu)) { add_argv("--in-process-gpu"); } - if(box64_cefdisablegpu) - { - add_argv("-cef-disable-gpu"); + // add new args only if there is no args already + if(BOX64ENV(args)) { + char tmp[256]; + char* p = BOX64ENV(args); + int state = 0; + char* p2 = p; + if(my_context->argc==1 || (my_context->argc==2 && box64_wine)) + while(state>=0) { + switch(*p2) { + case 0: // end of flux + if(state && (p2!=p)) add_argv(p); + state = -1; + break; + case '"': // start/end of quotes + if(state<2) {if(!state) p=p2; state=2;} else state=1; + break; + case ' ': + if(state==1) {strncpy(tmp, p, p2-p); tmp[p2-p]='\0'; add_argv(tmp); state=0;} + break; + default: + if(state==0) {state=1; p=p2;} + break; + } + ++p2; + } } - if(box64_cefdisablegpucompositor) - { - add_argv("-cef-disable-gpu-compositor"); + if(BOX64ENV(insert_args)) { + char tmp[256]; + char* p = BOX64ENV(insert_args); + int state = 0; + char* p2 = p; + while(state>=0) { + switch(*p2) { + case 0: // end of flux + if(state && (p2!=p)) add_argv(p); + state = -1; + break; + case '"': // start/end of quotes + if(state<2) {if(!state) p=p2; state=2;} else state=1; + break; + case ' ': + if(state==1) {strncpy(tmp, p, p2-p); tmp[p2-p]='\0'; add_argv(tmp); state=0;} + break; + default: + if(state==0) {state=1; p=p2;} + break; + } + ++p2; + } } - // check if file exist if(!my_context->argv[0] || !FileExist(my_context->argv[0], IS_FILE)) { - printf_log(LOG_NONE, "Error: File is not found. (check BOX64_PATH)\n"); + printf_log(LOG_NONE, "Error: File is not found. (%s)\n", my_context->argv[0]); free_contextargv(); FreeBox64Context(&my_context); FreeCollection(&ld_preload); @@ -2036,8 +1178,10 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf } if(!(my_context->fullpath = box_realpath(my_context->argv[0], NULL))) my_context->fullpath = box_strdup(my_context->argv[0]); - if(getenv("BOX64_ARG0")) + if (getenv("BOX64_ARG0")) { my_context->argv[0] = box_strdup(getenv("BOX64_ARG0")); + unsetenv("BOX64_ARG0"); + } FILE *f = fopen(my_context->fullpath, "rb"); if(!f) { printf_log(LOG_NONE, "Error: Cannot open %s\n", my_context->fullpath); @@ -2046,10 +1190,52 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf FreeCollection(&ld_preload); return -1; } + #ifdef BOX32 + box64_is32bits = FileIsX86ELF(my_context->fullpath); + // try to switch personality, but only if not already tried + if(box64_is32bits && !box64env.nopersona32bits) { + int tried = getenv("BOX32_PERSONA32BITS")?1:0; + if(tried) { + unsetenv("BOX32_PERSONA32BITS"); + int p = personality(0xffffffff); + if(p==ADDR_LIMIT_32BIT) { + box64_isAddressSpace32 = 1; + printf_log(LOG_INFO, "Personality set to 32bits\n"); + } + } else { + if(personality(ADDR_LIMIT_32BIT)!=-1) { + int nenv = 0; + while(env[nenv]) nenv++; + // alloc + "LD_PRELOAD" if needd + last NULL ending + char** newenv = (char**)box_calloc(nenv+1+1, sizeof(char*)); + // copy strings + for (int i=0; ibox64path, (void*)argv, newenv)<0) + printf_log(LOG_NONE, "Failed to relaunch. Error is %d/%s (argv[0]=\"%s\")\n", errno, strerror(errno), argv[0]); + } + } + } + if(box64_is32bits) { + printf_log(LOG_INFO, "Using Box32 to load 32bits elf\n"); + loadProtectionFromMap(); + reserveHighMem(); + init_pthread_helper_32(); + } + #endif + LoadLDPath(my_context); + my_context->video_mem = mmap((void*)0xb0000, 0x10000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + if(my_context->video_mem != (void*)0xb0000) { + my_context->video_mem = NULL; + printf_log(LOG_INFO, "Warning, could not allocate text video memory"); + } elfheader_t *elf_header = LoadAndCheckElfHeader(f, my_context->fullpath, 1); if(!elf_header) { int x86 = my_context->box86path?FileIsX86ELF(my_context->fullpath):0; int script = my_context->bashpath?FileIsShell(my_context->fullpath):0; + int python3 = my_context->pythonpath?FileIsPython(my_context->fullpath):0; printf_log(LOG_NONE, "Error: Reading elf header of %s, Try to launch %s instead\n", my_context->fullpath, x86?"using box86":(script?"using bash":"natively")); fclose(f); FreeCollection(&ld_preload); @@ -2069,6 +1255,14 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf for(int i=0; iargc; ++i) newargv[i+2] = my_context->argv[i]; ret = execvp(newargv[0], (char * const*)newargv); + } else if (python3) { + // duplicate the array and insert 1st arg as box64, 2nd is python3 + const char** newargv = (const char**)box_calloc(my_context->argc+3, sizeof(char*)); + newargv[0] = my_context->box64path; + newargv[1] = my_context->pythonpath; + for(int i=0; iargc; ++i) + newargv[i+2] = my_context->argv[i]; + ret = execvp(newargv[0], (char * const*)newargv); } else { const char** newargv = (const char**)box_calloc(my_context->argc+1, sizeof(char*)); for(int i=0; iargc; ++i) @@ -2099,10 +1293,22 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf FreeCollection(&ld_preload); return -1; } + if (!strcmp(box64_guest_name, "heroic")) { + // check if heroic needs patching (for the 2.15.1 version) + uint8_t* address = GetBaseAddress(elf_header); + if(address[0x422f6e1]==0x72 && address[0x422f6e2]==0x44 && address[0x422f6e0]==0xF8 && address[0x422f727]==0xcc) { + printf_log(LOG_INFO, "Patched heroic!\n"); + uintptr_t page = ((uintptr_t)&address[0x422f6e1])&~(box64_pagesize-1); + int prot = getProtection(page); + mprotect((void*)page, box64_pagesize, PROT_READ|PROT_WRITE|PROT_EXEC); + address[0x422f6e1]=0x90; address[0x422f6e2]=0x90; + mprotect((void*)page, box64_pagesize, prot); + } + } if(ElfCheckIfUseTCMallocMinimal(elf_header)) { if(!box64_tcmalloc_minimal) { // need to reload with tcmalloc_minimal as a LD_PRELOAD! - printf_log(LOG_INFO, "BOX64: tcmalloc_minimal.so.4 used. Reloading box64 with the lib preladed\n"); + printf_log(LOG_INFO, "tcmalloc_minimal.so.4 used. Reloading box64 with the lib preladed\n"); // need to get a new envv variable. so first count it and check if LD_PRELOAD is there int preload=(getenv("LD_PRELOAD"))?1:0; int nenv = 0; @@ -2142,7 +1348,7 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf if(execve(newargv[0], newargv, newenv)<0) printf_log(LOG_NONE, "Failed to relaunch. Error is %d/%s\n", errno, strerror(errno)); } else { - printf_log(LOG_INFO, "BOX64: Using tcmalloc_minimal.so.4, and it's in the LD_PRELOAD command\n"); + printf_log(LOG_INFO, "Using tcmalloc_minimal.so.4, and it's in the LD_PRELOAD command\n"); } } #if defined(RPI) || defined(RK3399) || defined(RK3326) @@ -2163,8 +1369,9 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf printf_log(LOG_NONE, "Error setting process name (%s)\n", strerror(errno)); else printf_log(LOG_INFO, "Rename process to \"%s\"\n", p); - if(strcmp(prgname, p)) - ApplyParams(p); + if (strcmp(box64_guest_name, p)) { + ApplyEnvFileEntry(p); + } // and now all change the argv (so libs libs mesa find the correct program names) char* endp = (char*)argv[argc-1]; while(*endp) @@ -2178,6 +1385,8 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf my_context->orig_argc = argc; my_context->orig_argv = (char**)argv; } + box64_nolibs = (NeededLibs(elf_header)==0); + if(box64_nolibs) printf_log(LOG_INFO, "Warning, box64 is not really compatible with staticaly linked binaries. Expect crash!\n"); box64_isglibc234 = GetNeededVersionForLib(elf_header, "libc.so.6", "GLIBC_2.34"); if(box64_isglibc234) printf_log(LOG_DEBUG, "Program linked with GLIBC 2.34+\n"); @@ -2194,13 +1403,15 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf // stack setup is much more complicated then just that! SetupInitialStack(emu); // starting here, the argv[] don't need free anymore SetupX64Emu(emu, NULL); - SetRSI(emu, my_context->argc); - SetRDX(emu, (uint64_t)my_context->argv); - SetRCX(emu, (uint64_t)my_context->envv); - SetRBP(emu, 0); // Frame pointer so to "No more frame pointer" - - // child fork to handle traces - pthread_atfork(NULL, NULL, my_child_fork); + if(box64_is32bits) { + SetEAX(emu, my_context->argc); + SetEBX(emu, my_context->argv32); + } else { + SetRSI(emu, my_context->argc); + SetRDX(emu, (uint64_t)my_context->argv); + SetRCX(emu, (uint64_t)my_context->envv); + SetRBP(emu, 0); // Frame pointer so to "No more frame pointer" + } thread_set_emu(emu); @@ -2213,7 +1424,7 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf if(!ElfGetGlobalSymbolStartEnd(elf_header, &wineinfo, NULL, "wine_main_preload_info", &ver, &vername, 1, &veropt)) if(!ElfGetWeakSymbolStartEnd(elf_header, &wineinfo, NULL, "wine_main_preload_info", &ver, &vername, 1, &veropt)) ElfGetLocalSymbolStartEnd(elf_header, &wineinfo, NULL, "wine_main_preload_info", &ver, &vername, 1, &veropt); - if(!wineinfo) {printf_log(LOG_NONE, "Warning, Symbol wine_main_preload_info not found\n");} + if(!wineinfo) {printf_log(LOG_DEBUG, "Warning, Symbol wine_main_preload_info not found\n");} else { *(void**)wineinfo = get_wine_prereserve(); printf_log(LOG_DEBUG, "WINE wine_main_preload_info found and updated %p -> %p\n", get_wine_prereserve(), *(void**)wineinfo); @@ -2222,7 +1433,7 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf dynarec_wine_prereserve(); #endif } - AddMainElfToLinkmap(elf_header); + AddMainElfToLinkmap(elf_header); //TODO: LinkMap seems incorect // pre-load lib if needed if(ld_preload.size) { my_context->preload = new_neededlib(0); @@ -2259,14 +1470,13 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf setupTraceInit(); RunDeferredElfInit(emu); // update TLS of main elf - RefreshElfTLS(elf_header); + RefreshElfTLS(elf_header, emu); // do some special case check, _IO_2_1_stderr_ and friends, that are setup by libc, but it's already done here, so need to do a copy ResetSpecialCaseMainElf(elf_header); // init... setupTrace(); *emulator = emu; - return 0; } @@ -2281,11 +1491,20 @@ int emulate(x64emu_t* emu, elfheader_t* elf_header) // emulate! printf_log(LOG_DEBUG, "Start x64emu on Main\n"); // Stack is ready, with stacked: NULL env NULL argv argc - SetRIP(emu, my_context->ep); ResetFlags(emu); - Push64(emu, my_context->exit_bridge); // push to pop it just after - SetRDX(emu, Pop64(emu)); // RDX is exit function - Run(emu, 0); + #ifdef BOX32 + if(box64_is32bits) { + SetEIP(emu, my_context->ep); + Push32(emu, my_context->exit_bridge); // push to pop it just after + SetEDX(emu, Pop32(emu)); // RDX is exit function + } else + #endif + { + SetRIP(emu, my_context->ep); + Push64(emu, my_context->exit_bridge); // push to pop it just after + SetRDX(emu, Pop64(emu)); // RDX is exit function + } + DynaRun(emu); // Get EAX int ret = GetEAX(emu); printf_log(LOG_DEBUG, "Emulation finished, EAX=%d\n", ret); @@ -2297,5 +1516,11 @@ int emulate(x64emu_t* emu, elfheader_t* elf_header) } #endif +#ifdef DYNAREC + if (BOX64ENV(dynarec_perf_map) && BOX64ENV(dynarec_perf_map_fd) != -1) { + close(BOX64ENV(dynarec_perf_map_fd)); + SET_BOX64ENV(dynarec_perf_map_fd, -1); + } +#endif return ret; } diff --git a/src/custommem.c b/src/custommem.c index 28a0fde..65f994f 100644 --- a/src/custommem.c +++ b/src/custommem.c @@ -2,14 +2,11 @@ #include #include #include -#include -#include -#include #include -#include +#include "os.h" +#include "backtrace.h" #include "box64context.h" -#include "elfloader.h" #include "debug.h" #include "x64trace.h" #include "x64emu.h" @@ -17,32 +14,41 @@ #include "bridge.h" #include "library.h" #include "callback.h" -#include "wrapper.h" -#include "threads.h" #include "x64trace.h" -#include "signals.h" -#include #include "custommem.h" #include "khash.h" #include "threads.h" #include "rbtree.h" +#include "mysignal.h" +#include "mypthread.h" #ifdef DYNAREC #include "dynablock.h" #include "dynarec/dynablock_private.h" #include "dynarec/native_lock.h" #include "dynarec/dynarec_next.h" - -#define USE_MMAP +#include "freq.h" // init inside dynablocks.c static mmaplist_t *mmaplist = NULL; +static rbtree_t *rbt_dynmem = NULL; static uint64_t jmptbl_allocated = 0, jmptbl_allocated1 = 0, jmptbl_allocated2 = 0, jmptbl_allocated3 = 0; +#if JMPTABL_SHIFTMAX != 16 +#error Incorect value for jumptable shift max that should be 16 +#endif #ifdef JMPTABL_SHIFT4 +#if JMPTABL_SHIFT3 != 16 +#error Incorect value for jumptable shift3 that should be 16 +#endif static uint64_t jmptbl_allocated4 = 0; static uintptr_t**** box64_jmptbl4[1<next.size + sizeof(blockmark_t)) -#define PREV_BLOCK(b) (blockmark_t*)(((uintptr_t)(b) - (b)->prev.size) - sizeof(blockmark_t)) +#define NEXT_BLOCK(b) (blockmark_t*)((uintptr_t)(b) + (b)->next.offs) +#define PREV_BLOCK(b) (blockmark_t*)(((uintptr_t)(b) - (b)->prev.offs)) #define LAST_BLOCK(b, s) (blockmark_t*)(((uintptr_t)(b)+(s))-sizeof(blockmark_t)) +#define SIZE_BLOCK(b) ((size_t)(b).offs-sizeof(blockmark_t)) -void printBlock(blockmark_t* b, void* start) +void printBlock(blockmark_t* b, void* start, size_t sz) { - printf_log(LOG_NONE, "========== Block is:\n"); + if(!b) return; + printf_log(LOG_NONE, "========== Block is: (%p - %p)\n", b, ((void*)b)+sz); do { - printf_log(LOG_NONE, "%c%p, fill=%d, size=0x%x (prev=%d/0x%x)\n", b==start?'*':' ', b, b->next.fill, b->next.size, b->prev.fill, b->prev.size); + printf_log(LOG_NONE, "%c%p, fill=%d, size=0x%x (prev=%d/0x%x)\n", b==start?'*':' ', b, b->next.fill, SIZE_BLOCK(b->next), b->prev.fill, SIZE_BLOCK(b->prev)); b = NEXT_BLOCK(b); } while(b->next.x32); printf_log(LOG_NONE, "===================\n"); } +blockmark_t* checkPrevNextCoherent(blockmark_t* b) +{ + while(b->next.x32) { + blockmark_t* next = NEXT_BLOCK(b); + if(b->next.x32 != next->prev.x32) + return next; + b = next; + } + return NULL; +} + // get first subblock free in block. Return NULL if no block, else first subblock free (mark included), filling size -static void* getFirstBlock(void* block, size_t maxsize, size_t* size, void* start) +static blockmark_t* getFirstBlock(void* block, size_t maxsize, size_t* size, void* start) { // get start of block blockmark_t *m = (blockmark_t*)((start)?start:block); while(m->next.x32) { // while there is a subblock - if(!m->next.fill && m->next.size>=maxsize) { - *size = m->next.size; + if(!m->next.fill && SIZE_BLOCK(m->next)>=maxsize) { + *size = SIZE_BLOCK(m->next); return m; } m = NEXT_BLOCK(m); @@ -125,7 +173,7 @@ static void* getFirstBlock(void* block, size_t maxsize, size_t* size, void* star return NULL; } -static void* getNextFreeBlock(void* block) +static blockmark_t* getNextFreeBlock(void* block) { blockmark_t *m = (blockmark_t*)block; while (m->next.fill) { @@ -133,12 +181,12 @@ static void* getNextFreeBlock(void* block) }; return m; } -static void* getPrevFreeBlock(void* block) +static blockmark_t* getPrevFreeBlock(void* block) { blockmark_t *m = (blockmark_t*)block; do { m = PREV_BLOCK(m); - } while (m->next.fill); + } while (m->prev.x32 && m->next.fill); return m; } @@ -147,52 +195,69 @@ static size_t getMaxFreeBlock(void* block, size_t block_size, void* start) // get start of block if(start) { blockmark_t *m = (blockmark_t*)start; - unsigned int maxsize = 0; + size_t maxsize = 0; while(m->next.x32) { // while there is a subblock - if(!m->next.fill && m->next.size>maxsize) { - maxsize = m->next.size; + if(!m->next.fill && SIZE_BLOCK(m->next)>maxsize) { + maxsize = SIZE_BLOCK(m->next); } m = NEXT_BLOCK(m); } - return (maxsize>=sizeof(blockmark_t))?maxsize:0; + return maxsize; } else { blockmark_t *m = LAST_BLOCK(block, block_size); // start with the end - unsigned int maxsize = 0; - while(m->prev.x32) { // while there is a subblock - if(!m->prev.fill && m->prev.size>maxsize) { - maxsize = m->prev.size; - if((uintptr_t)block+maxsize>(uintptr_t)m) - return (maxsize>=sizeof(blockmark_t))?maxsize:0; // no block large enough left... + size_t maxsize = 0; + while(m->prev.x32 && (((uintptr_t)block+maxsize)<(uintptr_t)m)) { // while there is a subblock + if(!m->prev.fill && SIZE_BLOCK(m->prev)>maxsize) { + maxsize = SIZE_BLOCK(m->prev); } m = PREV_BLOCK(m); } - return (maxsize>=sizeof(blockmark_t))?maxsize:0; + return maxsize; } } -#define THRESHOLD (128-2*sizeof(blockmark_t)) +#define THRESHOLD (128-1*sizeof(blockmark_t)) + +static void* createAlignBlock(void* block, void *sub, size_t size) +{ + (void)block; + + blockmark_t *s = (blockmark_t*)sub; + blockmark_t *n = NEXT_BLOCK(s); -static void* allocBlock(void* block, void *sub, size_t size, void** pstart) + s->next.fill = 0; + size_t old_size = s->next.offs; + s->next.offs = size; + blockmark_t *m = NEXT_BLOCK(s); + m->prev.x32 = s->next.x32; + m->next.fill = 0; + m->next.offs = old_size - size; + n->prev.x32 = m->next.x32; + n = m; + return m; +} +static void* allocBlock(void* block, blockmark_t* sub, size_t size, void** pstart) { (void)block; blockmark_t *s = (blockmark_t*)sub; blockmark_t *n = NEXT_BLOCK(s); + size+=sizeof(blockmark_t); // count current blockmark s->next.fill = 1; // check if a new mark is worth it - if(s->next.size>size+2*sizeof(blockmark_t)+THRESHOLD) { - size_t old_size = s->next.size; - s->next.size = size; + if(SIZE_BLOCK(s->next)>size+2*sizeof(blockmark_t)+THRESHOLD) { + // create a new mark + size_t old_offs = s->next.offs; + s->next.offs = size; blockmark_t *m = NEXT_BLOCK(s); - m->prev.fill = 1; - m->prev.size = s->next.size; + m->prev.x32 = s->next.x32; m->next.fill = 0; - m->next.size = old_size - (size + sizeof(blockmark_t)); - n->prev.fill = 0; - n->prev.size = m->next.size; + m->next.offs = old_offs - size; + n->prev.x32 = m->next.x32; n = m; } else { + // just fill the blok n->prev.fill = 1; } @@ -202,69 +267,77 @@ static void* allocBlock(void* block, void *sub, size_t size, void** pstart) n = NEXT_BLOCK(n); *pstart = (void*)n; } - return (void*)((uintptr_t)sub + sizeof(blockmark_t)); + return sub->mark; } -static size_t freeBlock(void *block, void* sub, void** pstart) +static size_t freeBlock(void *block, size_t bsize, blockmark_t* sub, void** pstart) { blockmark_t *m = (blockmark_t*)block; - blockmark_t *s = (blockmark_t*)sub; + blockmark_t *s = sub; blockmark_t *n = NEXT_BLOCK(s); - if(block!=sub) - m = PREV_BLOCK(s); s->next.fill = 0; n->prev.fill = 0; - // check if merge with previous - if (m!=s && s->prev.x32 && !s->prev.fill) { - // remove s... - m->next.size += s->next.size + sizeof(blockmark_t); - n->prev.size = m->next.size; - s = m; - } // check if merge with next - if(n->next.x32 && !n->next.fill) { + while (n->next.x32 && !n->next.fill) { blockmark_t *n2 = NEXT_BLOCK(n); //remove n - s->next.size += n->next.size + sizeof(blockmark_t); - n2->prev.size = s->next.size; + s->next.offs += n->next.offs; + n2->prev.offs = s->next.offs; + n = n2; + } + // check if merge with previous + while (s->prev.x32 && !s->prev.fill) { + m = PREV_BLOCK(s); + // remove s... + m->next.offs += s->next.offs; + n->prev.offs = m->next.offs; + s = m; } if(pstart && (uintptr_t)*pstart>(uintptr_t)s) { *pstart = (void*)s; } // return free size at current block (might be bigger) - return s->next.size; + return SIZE_BLOCK(s->next); } // return 1 if block has been expanded to new size, 0 if not -static int expandBlock(void* block, void* sub, size_t newsize) +static int expandBlock(void* block, blockmark_t* sub, size_t newsize, void** pstart) { (void)block; - newsize = (newsize+3)&~3; - blockmark_t *s = (blockmark_t*)sub; + blockmark_t *s = sub; blockmark_t *n = NEXT_BLOCK(s); - if(s->next.size>=newsize) - // big enough, no shrinking... + int re_first = (pstart && (n==*pstart))?1:0; + // big enough, nothing to do... + if(SIZE_BLOCK(s->next)>=newsize) return 1; - if(s->next.fill) + if(n->next.fill) return 0; // next block is filled - // unsigned bitfield of this length gets "promoted" to *signed* int... - if((size_t)(s->next.size + n->next.size + sizeof(blockmark_t)) < newsize) + // check the total size of the new block (so both offset - blocklist) + if(((size_t)s->next.offs + n->next.offs - sizeof(blockmark_t)) < newsize) return 0; // free space too short - // ok, doing the alloc! - if((s->next.size+n->next.size+sizeof(blockmark_t))-newsizenext.size += n->next.size+sizeof(blockmark_t); - else - s->next.size = newsize+sizeof(blockmark_t); - blockmark_t *m = NEXT_BLOCK(s); // this is new n - m->prev.fill = 1; - m->prev.size = s->next.size; - if(n!=m) { + // ok, expanding block! + if((s->next.offs+n->next.offs)-newsizenext.offs += n->next.offs; + blockmark_t *m = NEXT_BLOCK(s); + m->prev.x32 = s->next.x32; + n = m; + } else { + // remove n and create a new mark (or, move n farther) + blockmark_t *next = NEXT_BLOCK(n);// thenext of old n + s->next.offs = newsize + sizeof(blockmark_t); + blockmark_t *m = NEXT_BLOCK(s); // this is new n + m->prev.x32 = s->next.x32; // new mark - m->prev.fill = 1; - m->prev.size = s->next.size; m->next.fill = 0; - m->next.size = (uintptr_t)n - (uintptr_t)m; - n->prev.fill = 0; - n->prev.size = m->next.size; + m->next.offs = (uintptr_t)next - (uintptr_t)m; + next->prev.x32 = m->next.x32; + n = m; + } + if(re_first) { + // get the next free block + while(n->next.fill) + n = NEXT_BLOCK(n); + *pstart = (void*)n; } return 1; } @@ -272,7 +345,18 @@ static int expandBlock(void* block, void* sub, size_t newsize) static size_t sizeBlock(void* sub) { blockmark_t *s = (blockmark_t*)sub; - return s->next.size; + return SIZE_BLOCK(s->next); +} + +static int isBlockChainCoherent(blockmark_t* m, blockmark_t* end) +{ + while(m) { + if(m>end) return 0; + if(m==end) return 1; + if(m==NEXT_BLOCK(m)) return 0; + m = NEXT_BLOCK(m); + } + return 0; } // return 1 if block is coherent, 0 if not (and printf the issues) @@ -284,6 +368,9 @@ int printBlockCoherent(int i) } int ret = 1; blockmark_t* m = (blockmark_t*)p_blocks[i].block; + if(!m) {printf_log(LOG_NONE, "Warning, block #%d is NULL\n", i); return 0;} + // check coherency of the chained list first + if(!isBlockChainCoherent(m, (blockmark_t*)(p_blocks[i].block+p_blocks[i].size-sizeof(blockmark_t)))) {printf_log(LOG_NONE, "Warning, block #%d %schained list is not coherent\n", i, p_blocks[i].is32bits?"(32bits) ":""); return 0;} // check if first is correct blockmark_t* first = getNextFreeBlock(m); if(p_blocks[i].first && p_blocks[i].first!=first) {printf_log(LOG_NONE, "First %p and stored first %p differs for block %d\n", first, p_blocks[i].first, i); ret = 0;} @@ -293,42 +380,87 @@ int printBlockCoherent(int i) // check if maxfree from first is correct maxfree = getMaxFreeBlock(m, p_blocks[i].size, p_blocks[i].first); if(maxfree != p_blocks[i].maxfree) {printf_log(LOG_NONE, "Maxfree with hint %zd and stored maxfree %zd differs for block %d\n", maxfree, p_blocks[i].maxfree, i); ret = 0;} + // check next/ prev coehrency + blockmark_t *nope = checkPrevNextCoherent(m); + if(nope) { printf_log(LOG_NONE, "Next/Prev incoherency for block %d, at %p\n", i, nope); ret = 0;} // check chain - blockmark_t* last = (blockmark_t*)(((uintptr_t)m)+p_blocks[i].size-sizeof(blockmark_t)); - while(mnext.x32) { blockmark_t* n = NEXT_BLOCK(m); if(!m->next.fill && !n->next.fill && n!=last) { - printf_log(LOG_NONE, "Chain contains 2 subsequent free blocks %p (%d) and %p (%d) for block %d\n", m, m->next.size, n, n->next.size, i); + printf_log(LOG_NONE, "Chain contains 2 subsequent free blocks %p (%zu) and %p (%zu) for block %d\n", m, SIZE_BLOCK(m->next), n, SIZE_BLOCK(n->next), i); ret = 0; } m = n; } if(m!=last) { - printf_log(LOG_NONE, "Last block %p is behond expexted block %p for block %d\n", m, last, i); + printf_log(LOG_NONE, "Last block %p is not the expected last block %p for block %d\n", m, last, i); ret = 0; } return ret; } +static char* niceSize(size_t sz) +{ + static int idx = 0; + static char rets[16][50] = {0}; + int i = idx = (idx+1)&15; + const char* units[] = {"b", "kb", "Mb", "Gb"}; + const size_t vals[] = {1, 1024, 1024*1024, 1024*1024*1024}; + int k = 0; + for(size_t j=0; jnext.x32) { - if(!m->next.fill) - fragmented_free += m->next.size; - m = NEXT_BLOCK(m); + // just silently skip blocks with 0 size, as they are not finished and so might be not coherent + if(p_blocks[i].size) { + int is32bits = p_blocks[i].is32bits; + if(box64_is32bits && !is32bits && p_blocks[i].block<(void*)0x100000000LL) printf_log(LOG_NONE, "Warning, p_block[%d] is 64bits but in 32bits address space: %p (type=%d)\n", i, p_blocks[i].block, p_blocks[i].type); + if(is32bits) ++n_blocks32; + if((p_blocks[i].type==BTYPE_LIST) && !printBlockCoherent(i)) + printBlock(p_blocks[i].block, p_blocks[i].first, p_blocks[i].size); + total += p_blocks[i].size; + if(is32bits) total32 += p_blocks[i].size; + if(p_blocks[i].type==BTYPE_LIST) { + if(max_freenext.x32) { + if(!m->next.fill) + fragmented_free += SIZE_BLOCK(m->next); + if(is32bits && !m->next.fill) + fragmented_free32 += SIZE_BLOCK(m->next); + m = NEXT_BLOCK(m); + } + } else { + if(p_blocks[i].maxfree) { + if(max_free<128) max_free=128; + if(is32bits && max_free32<128) max_free32=128; + fragmented_free += p_blocks[i].maxfree; + if(is32bits) fragmented_free32 += p_blocks[i].maxfree; + } + } } } - printf_log(LOG_NONE, "Total %d blocks, for %zd allocated memory, max_free %zd, toatal fragmented free %zd\n", n_blocks, total, max_free, fragmented_free); + printf_log(LOG_NONE, "CustomMem: Total %d blocks, for %s (0x%zx) allocated memory, max_free %s (0x%zx), total fragmented free %s (0x%zx)\n", n_blocks, niceSize(total), total, niceSize(max_free), max_free, niceSize(fragmented_free), fragmented_free); + if(box64_is32bits) + printf_log(LOG_NONE, " 32bits: Total %d blocks, for %s (0x%zx) allocated memory, max_free %s (0x%zx), total fragmented free %s (0x%zx)\n", n_blocks32, niceSize(total32), total32, niceSize(max_free32), max_free32, niceSize(fragmented_free32), fragmented_free32); } static size_t roundSize(size_t size) @@ -343,6 +475,64 @@ static size_t roundSize(size_t size) return size; } +uintptr_t blockstree_start = 0; +uintptr_t blockstree_end = 0; +int blockstree_index = 0; + +blocklist_t* findBlock(uintptr_t addr) +{ + blocklist_t* last_found_block = (last_block_index>=0 && last_block_index= (uintptr_t)last_found_block->block && addr < (uintptr_t)last_found_block->block + last_found_block->size) + return last_found_block; + if(blockstree) { + uint32_t i; + uintptr_t end; + if(rb_get_end(blockstree, addr, &i, &end)){ + // Upate cache + last_block_index = i; + return &p_blocks[i]; + } + } else { + for(int i=0; i=(uintptr_t)p_blocks[i].block) && (addr<=(uintptr_t)p_blocks[i].block+p_blocks[i].size)){ + // Upate cache + last_block_index = i; + return &p_blocks[i]; + } + } + return NULL; +} +void add_blockstree(uintptr_t start, uintptr_t end, int idx) +{ + if(!blockstree) + return; + static int reent = 0; + if(reent) { + blockstree_start = start; + blockstree_end = end; + blockstree_index = idx; + return; + } + reent = 1; + blockstree_start = blockstree_end = 0; + rb_set(blockstree, start, end, idx); + while(blockstree_start || blockstree_end) { + start = blockstree_start; + end = blockstree_end; + idx = blockstree_index; + blockstree_start = blockstree_end = 0; + rb_set(blockstree, start, end, idx); + } + reent = 0; +} + +void* box32_dynarec_mmap(size_t size, int fd, off_t offset); +#ifdef BOX32 +int isCustomAddr(void* p) +{ + return findBlock((uintptr_t)p)?1:0; +} +#endif #ifdef DYNAREC #define GET_PROT_WAIT(A, B) \ uint32_t A; \ @@ -370,42 +560,337 @@ static size_t roundSize(size_t size) static uintptr_t defered_prot_p = 0; static size_t defered_prot_sz = 0; static uint32_t defered_prot_prot = 0; +static mem_flag_t defered_prot_flags = MEM_ALLOCATED; static sigset_t critical_prot = {0}; +static void setProtection_generic(uintptr_t addr, size_t sz, uint32_t prot, mem_flag_t flags); #define LOCK_PROT() sigset_t old_sig = {0}; pthread_sigmask(SIG_BLOCK, &critical_prot, &old_sig); mutex_lock(&mutex_prot) #define LOCK_PROT_READ() sigset_t old_sig = {0}; pthread_sigmask(SIG_BLOCK, &critical_prot, &old_sig); mutex_lock(&mutex_prot) +#define LOCK_PROT_FAST() mutex_lock(&mutex_prot) #define UNLOCK_PROT() if(defered_prot_p) { \ - uintptr_t p = defered_prot_p; size_t sz = defered_prot_sz; uint32_t prot = defered_prot_prot; \ + uintptr_t p = defered_prot_p; size_t sz = defered_prot_sz; uint32_t prot = defered_prot_prot; mem_flag_t f = defered_prot_flags;\ defered_prot_p = 0; \ pthread_sigmask(SIG_SETMASK, &old_sig, NULL); \ mutex_unlock(&mutex_prot); \ - setProtection(p, sz, prot); \ + setProtection_generic(p, sz, prot, f); \ } else { \ pthread_sigmask(SIG_SETMASK, &old_sig, NULL); \ mutex_unlock(&mutex_prot); \ } #define UNLOCK_PROT_READ() mutex_unlock(&mutex_prot); pthread_sigmask(SIG_SETMASK, &old_sig, NULL) +#define UNLOCK_PROT_FAST() mutex_unlock(&mutex_prot) #ifdef TRACE_MEMSTAT static uint64_t customMalloc_allocated = 0; #endif -void* customMalloc(size_t size) +// the BTYPE_MAP is a simple bitmap based allocator: it will allocate slices of 128bytes only, from a large 128k mapping +// the bitmap itself is also allocated in that mapping, as a slice of 128bytes, at the end of the mapping (and so marked as allocated) +void* map128_customMalloc(size_t size, int is32bits) { + size = 128; + mutex_lock(&mutex_blocks); + // Try cached hint first + if(last_block_index_map128 >= 0 && last_block_index_map128 < n_blocks) { + blocklist_t* hint = &p_blocks[last_block_index_map128]; + if(hint && hint->block && (hint->type == BTYPE_MAP) && hint->maxfree && (hint->is32bits==is32bits)) { + uint8_t* map = hint->first; + for(uint32_t idx=hint->lowest; idx<(hint->size>>7); ++idx) { + if(!(idx&7) && map[idx>>3]==0xff) + idx+=7; + else if(!(map[idx>>3]&(1<<(idx&7)))) { + map[idx>>3] |= 1<<(idx&7); + hint->maxfree -= 128; + hint->lowest = idx+1; + last_block_index = last_block_index_map128; + mutex_unlock(&mutex_blocks); + return hint->block+(idx<<7); + } + } + } + } + for(int i=0; i>7); ++idx) { + if(!(idx&7) && map[idx>>3]==0xff) + idx+=7; + else if(!(map[idx>>3]&(1<<(idx&7)))) { + map[idx>>3] |= 1<<(idx&7); + p_blocks[i].maxfree -= 128; + p_blocks[i].lowest = idx+1; + last_block_index = i; + last_block_index_map128 = i; + mutex_unlock(&mutex_blocks); + return p_blocks[i].block+(idx<<7); + } + } + #ifdef TRACE_MEMSTAT + printf_log(LOG_INFO, "Warning, customme p_block[%d] MAP has maxfree=%d and lowest=%d but not free block found\n", i, p_blocks[i].maxfree, p_blocks[i].lowest); + #endif + } + } + // add a new block + int i = n_blocks++; + if(n_blocks>c_blocks) { + c_blocks += box64_is32bits?256:8; + p_blocks = (blocklist_t*)box_realloc(p_blocks, c_blocks*sizeof(blocklist_t)); + __sync_synchronize(); + } + size_t allocsize = MMAPSIZE128; + p_blocks[i].block = NULL; // incase there is a re-entrance + p_blocks[i].first = NULL; + p_blocks[i].size = 0; + if(is32bits) mutex_unlock(&mutex_blocks); // unlocking, because mmap might use it + void* p = is32bits + ? box_mmap(NULL, allocsize, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1, 0) + : (box64_is32bits ? box32_dynarec_mmap(allocsize, -1, 0) : InternalMmap(NULL, allocsize, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0)); + if(is32bits) mutex_lock(&mutex_blocks); + #ifdef TRACE_MEMSTAT + customMalloc_allocated += allocsize; + #endif + size_t mapsize = (allocsize/128)/8; + mapsize = (mapsize+127)&~127LL; + p_blocks[i].type = BTYPE_MAP; + p_blocks[i].is32bits = is32bits; + p_blocks[i].block = p; + p_blocks[i].first = p+allocsize-mapsize; + p_blocks[i].size = allocsize; + // setup marks + uint8_t* map = p_blocks[i].first; + for(size_t idx=(allocsize-mapsize)>>7; idx<(allocsize>>7); ++idx) + map[idx>>3] |= (1<<(idx&7)); + // 32bits check - ensure entire allocation fits in 32-bit space + if(is32bits && ((uintptr_t)p + allocsize > 0x100000000ULL)) { + printf_log(LOG_INFO, "Warning: failed to allocate 0x%x (0x%x) bytes in 32bits address space (block %d, addr %p)\n", size, allocsize, i, p); + // failed to allocate memory + if(BOX64ENV(showbt) || BOX64ENV(showsegv)) { + // mask size from this block + p_blocks[i].size = 0; + mutex_unlock(&mutex_blocks); + ShowNativeBT(LOG_NONE); + testAllBlocks(); + if(BOX64ENV(log)>=LOG_DEBUG) { + printf_log(LOG_NONE, "Used 32bits address space map:\n"); + uintptr_t addr = rb_get_leftmost(mapallmem); + while(addr<0x100000000LL) { + uintptr_t bend; + uint32_t val; + if(rb_get_end(mapallmem, addr, &val, &bend)) + printf_log(LOG_NONE, "\t%p - %p\n", (void*)addr, (void*)bend); + addr = bend; + } + } + p_blocks[i].size = allocsize; + } + #ifdef TRACE_MEMSTAT + printf_log(LOG_INFO, "Custommem: Failed to alloc 32bits: allocation %p-%p for 128byte MAP Alloc p_blocks[%d]\n", p, p+allocsize, i); + #endif + p_blocks[i].maxfree = allocsize - mapsize; + p_blocks[i].is32bits = 0; + errno = ENOMEM; + return NULL; + } + #ifdef TRACE_MEMSTAT + printf_log(LOG_INFO, "Custommem: allocation %p-%p for %dbits 128byte MAP Alloc p_blocks[%d]\n", p, p+allocsize, is32bits?32:64, i); + #endif + // alloc 1st block + void* ret = p_blocks[i].block; + map[0] |= 1; + p_blocks[i].lowest = 1; + p_blocks[i].maxfree = allocsize - (mapsize+128); + mutex_unlock(&mutex_blocks); + add_blockstree((uintptr_t)p, (uintptr_t)p+allocsize, i); + last_block_index = i; + last_block_index_map128 = i; + if(mapallmem) { + if(setting_prot) { + // defer the setProtection... + defered_prot_p = (uintptr_t)p; + defered_prot_sz = allocsize; + defered_prot_prot = PROT_READ|PROT_WRITE; + defered_prot_flags = MEM_ALLOCATED; + } else + setProtection((uintptr_t)p, allocsize, PROT_READ | PROT_WRITE); + } + return ret; +} +// the BTYPE_MAP64 is a simple bitmap based allocator: it will allocate slices of 64bytes only, from a large 64k mapping +// the bitmap itself is also allocated in that mapping, as a slice of 256bytes, at the end of the mapping (and so marked as allocated) +void* map64_customMalloc(size_t size, int is32bits) +{ + size = 64; (void)size; + mutex_lock(&mutex_blocks); + // Try cached hint first + if(last_block_index_map64 >= 0 && last_block_index_map64 < n_blocks) { + blocklist_t* hint = &p_blocks[last_block_index_map64]; + if (hint && hint->block && hint->type == BTYPE_MAP64 && hint->maxfree && (hint->is32bits==is32bits)) { + uint16_t* map = hint->first; + uint32_t slices = hint->size >> 6; + for (uint32_t idx = hint->lowest; idx < slices; ++idx) { + if (!(idx & 15) && map[idx >> 4] == 0xFFFF) + idx += 15; + else if (!(map[idx >> 4] & (1u << (idx & 15)))) { + map[idx >> 4] |= 1u << (idx & 15); + hint->maxfree -= 64; + hint->lowest = idx + 1; + last_block_index = last_block_index_map64; + mutex_unlock(&mutex_blocks); + return hint->block + (idx << 6); + } + } + } + } + for(int i = 0; i < n_blocks; ++i) { + if (p_blocks[i].block + && p_blocks[i].type == BTYPE_MAP64 + && p_blocks[i].maxfree + && (p_blocks[i].is32bits==is32bits) + ) { + uint16_t* map = p_blocks[i].first; + uint32_t slices = p_blocks[i].size >> 6; + for (uint32_t idx = p_blocks[i].lowest; idx < slices; ++idx) { + if (!(idx & 15) && map[idx >> 4] == 0xFFFF) + idx += 15; + else if (!(map[idx >> 4] & (1u << (idx & 15)))) { + map[idx >> 4] |= 1u << (idx & 15); + p_blocks[i].maxfree -= 64; + p_blocks[i].lowest = idx + 1; + last_block_index = i; + last_block_index_map64 = i; + mutex_unlock(&mutex_blocks); + return p_blocks[i].block + (idx << 6); + } + } + #ifdef TRACE_MEMSTAT + printf_log(LOG_INFO, + "Warning: MAP has maxfree=%d and lowest=%d but no free 64 B slice found\n", + p_blocks[i].maxfree, p_blocks[i].lowest); + #endif + } + } + int i = n_blocks++; + if (n_blocks > c_blocks) { + c_blocks += box64_is32bits ? 256 : 8; + p_blocks = (blocklist_t*)box_realloc(p_blocks, c_blocks * sizeof(blocklist_t)); + __sync_synchronize(); + } + + size_t allocsize = MMAPSIZE64; + p_blocks[i].block = NULL; // guard re-entrance + p_blocks[i].first = NULL; + p_blocks[i].size = 0; + + if(is32bits) mutex_unlock(&mutex_blocks); // unlocking, because mmap might use it + void* p = is32bits + ? box_mmap(NULL, allocsize, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1, 0) + : (box64_is32bits ? box32_dynarec_mmap(allocsize, -1, 0) : InternalMmap(NULL, allocsize, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0)); + if(is32bits) mutex_lock(&mutex_blocks); + + #ifdef TRACE_MEMSTAT + customMalloc_allocated += allocsize; + #endif + + size_t mapsize = (allocsize / 64) / 8; + mapsize = (mapsize + 255) & ~255LL; + + p_blocks[i].type = BTYPE_MAP64; + p_blocks[i].is32bits = is32bits; + p_blocks[i].block = p; + p_blocks[i].first = p+allocsize-mapsize; + p_blocks[i].size = allocsize; + + // mark the bitmap area itself as "used" + uint16_t* map = p_blocks[i].first; + for (size_t idx = (allocsize - mapsize) >> 6; idx < (allocsize >> 6); ++idx) { + map[idx >> 4] |= 1u << (idx & 15); + } + + if (is32bits && p > (void*)0xffffffffLL) { + p_blocks[i].maxfree = allocsize - mapsize; + p_blocks[i].is32bits = 0; + errno = ENOMEM; + return NULL; + } + + #ifdef TRACE_MEMSTAT + printf_log(LOG_INFO, + "Custommem: allocation %p-%p for %dbits 64bytes MAP Alloc p_blocks[%d]\n", + p, (uint8_t*)p + allocsize, + is32bits ? 32 : 64, i); + #endif + + void* ret = p_blocks[i].block; + map[0] |= 1u; + p_blocks[i].lowest = 1; + p_blocks[i].maxfree = allocsize - (mapsize + 64); + + mutex_unlock(&mutex_blocks); + add_blockstree((uintptr_t)p, (uintptr_t)p + allocsize, i); + last_block_index = i; + last_block_index_map64 = i; + + if (mapallmem) { + if (setting_prot) { + defered_prot_p = (uintptr_t)p; + defered_prot_sz = allocsize; + defered_prot_prot = PROT_READ | PROT_WRITE; + defered_prot_flags = MEM_ALLOCATED; + } else { + setProtection((uintptr_t)p, allocsize, PROT_READ | PROT_WRITE); + } + } + + return ret; +} + + +void* internal_customMalloc(size_t size, int is32bits) +{ + if(size<=64) + return map64_customMalloc(size, is32bits); + if(size<=128) + return map128_customMalloc(size, is32bits); + size_t init_size = size; size = roundSize(size); // look for free space - void* sub = NULL; + blockmark_t* sub = NULL; size_t fullsize = size+2*sizeof(blockmark_t); mutex_lock(&mutex_blocks); + // Try cached hint first + if(last_block_index_list >= 0 && last_block_index_list < n_blocks) { + blocklist_t* hint = &p_blocks[last_block_index_list]; + if(hint && hint->block && (hint->type == BTYPE_LIST) && hint->maxfree>=init_size && (hint->is32bits==is32bits)) { + size_t rsize = 0; + sub = getFirstBlock(hint->block, init_size, &rsize, hint->first); + if(sub) { + if(size>rsize) + size = init_size; + if(rsize-sizeblock, sub, size, &hint->first); + if(rsize==hint->maxfree) + hint->maxfree = getMaxFreeBlock(hint->block, hint->size, hint->first); + last_block_index = last_block_index_list; + mutex_unlock(&mutex_blocks); + return ret; + } + } + } for(int i=0; i=size) { + if(p_blocks[i].block && (p_blocks[i].type == BTYPE_LIST) && p_blocks[i].maxfree>=init_size && (p_blocks[i].is32bits==is32bits)) { size_t rsize = 0; - sub = getFirstBlock(p_blocks[i].block, size, &rsize, p_blocks[i].first); + sub = getFirstBlock(p_blocks[i].block, init_size, &rsize, p_blocks[i].first); if(sub) { + if(size>rsize) + size = init_size; if(rsize-sizec_blocks) { - c_blocks += 4; + c_blocks += box64_is32bits?256:8; p_blocks = (blocklist_t*)box_realloc(p_blocks, c_blocks*sizeof(blocklist_t)); + __sync_synchronize(); } size_t allocsize = (fullsize>MMAPSIZE)?fullsize:MMAPSIZE; - #ifdef USE_MMAP - void* p = internal_mmap(NULL, allocsize, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); - memset(p, 0, allocsize); - #else - void* p = box_calloc(1, allocsize); - #endif + allocsize = (allocsize+box64_pagesize-1)&~(box64_pagesize-1); + if(is32bits) allocsize = (allocsize+0xffffLL)&~(0xffffLL); + p_blocks[i].block = NULL; // incase there is a re-entrance + p_blocks[i].first = NULL; + p_blocks[i].size = 0; + p_blocks[i].type = BTYPE_LIST; + p_blocks[i].is32bits = is32bits; + if(is32bits) // unlocking, because mmap might use it + mutex_unlock(&mutex_blocks); + void* p = is32bits + ? box_mmap(NULL, allocsize, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1, 0) + : (box64_is32bits ? box32_dynarec_mmap(allocsize, -1, 0) : InternalMmap(NULL, allocsize, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0)); + if(is32bits) + mutex_lock(&mutex_blocks); #ifdef TRACE_MEMSTAT customMalloc_allocated += allocsize; #endif @@ -434,89 +928,646 @@ void* customMalloc(size_t size) blockmark_t* m = (blockmark_t*)p; m->prev.x32 = 0; m->next.fill = 0; - m->next.size = allocsize-2*sizeof(blockmark_t); + m->next.offs = allocsize-sizeof(blockmark_t); blockmark_t* n = NEXT_BLOCK(m); n->next.x32 = 0; - n->prev.fill = 0; - n->prev.size = m->next.size; + n->prev.x32 = m->next.x32; + // 32bits check - ensure entire allocation fits in 32-bit space + if(is32bits && ((uintptr_t)p + allocsize > 0x100000000ULL)) { + printf_log(LOG_INFO, "Warning: failed to allocate 0x%x (0x%x) bytes in 32bits address space (block %d, addr %p)\n", size, allocsize, i, p); + // failed to allocate memory + if(BOX64ENV(showbt) || BOX64ENV(showsegv)) { + // mask size from this block + p_blocks[i].size = 0; + mutex_unlock(&mutex_blocks); + ShowNativeBT(LOG_NONE); + testAllBlocks(); + if(BOX64ENV(log)>=LOG_DEBUG) { + printf_log(LOG_NONE, "Used 32bits address space map:\n"); + uintptr_t addr = rb_get_leftmost(mapallmem); + while(addr<0x100000000LL) { + uintptr_t bend; + uint32_t val; + if(rb_get_end(mapallmem, addr, &val, &bend)) + printf_log(LOG_NONE, "\t%p - %p\n", (void*)addr, (void*)bend); + addr = bend; + } + } + p_blocks[i].size = allocsize; + } + #ifdef TRACE_MEMSTAT + printf_log(LOG_INFO, "Custommem: Failed to alloc 32bits: allocation %p-%p for LIST Alloc p_blocks[%d]\n", p, p+allocsize, i); + #endif + p_blocks[i].maxfree = allocsize - sizeof(blockmark_t)*2; + p_blocks[i].is32bits = 0; + errno = ENOMEM; + return NULL; + } + #ifdef TRACE_MEMSTAT + printf_log(LOG_INFO, "Custommem: allocation %p-%p for %dbits LIST Alloc p_blocks[%d]\n", p, p+allocsize, is32bits?32:64, i); + #endif // alloc 1st block void* ret = allocBlock(p_blocks[i].block, p, size, &p_blocks[i].first); p_blocks[i].maxfree = getMaxFreeBlock(p_blocks[i].block, p_blocks[i].size, p_blocks[i].first); mutex_unlock(&mutex_blocks); + add_blockstree((uintptr_t)p, (uintptr_t)p+allocsize, i); + last_block_index = i; + last_block_index_list = i; if(mapallmem) { - // defer the setProtection... - //setProtection((uintptr_t)p, allocsize, PROT_READ | PROT_WRITE); - defered_prot_p = (uintptr_t)p; - defered_prot_sz = allocsize; - defered_prot_prot = PROT_READ|PROT_WRITE; + if(setting_prot) { + // defer the setProtection... + defered_prot_p = (uintptr_t)p; + defered_prot_sz = allocsize; + defered_prot_prot = PROT_READ|PROT_WRITE; + defered_prot_flags = MEM_ALLOCATED; + } else + setProtection((uintptr_t)p, allocsize, PROT_READ | PROT_WRITE); } return ret; } +void* customMalloc(size_t size) +{ + return internal_customMalloc(size, 0); +} +void* customMalloc32(size_t size) +{ + return internal_customMalloc(size, 1); +} + void* customCalloc(size_t n, size_t size) { size_t newsize = roundSize(n*size); - void* ret = customMalloc(newsize); - memset(ret, 0, newsize); + void* ret = internal_customMalloc(newsize, 0); + if(ret) memset(ret, 0, newsize); return ret; } -void* customRealloc(void* p, size_t size) +void* customCalloc32(size_t n, size_t size) +{ + size_t newsize = roundSize(n*size); + void* ret = internal_customMalloc(newsize, 1); + if(ret) memset(ret, 0, newsize); + return ret; +} + +void internal_customFree(void*, int); +void* internal_customRealloc(void* p, size_t size, int is32bits) { if(!p) - return customMalloc(size); - size = roundSize(size); + return internal_customMalloc(size, is32bits); + //size = roundSize(size); uintptr_t addr = (uintptr_t)p; mutex_lock(&mutex_blocks); - for(int i=0; i(uintptr_t)p_blocks[i].block) - && (addr<((uintptr_t)p_blocks[i].block+p_blocks[i].size))) { - void* sub = (void*)(addr-sizeof(blockmark_t)); - if(expandBlock(p_blocks[i].block, sub, size)) { - if(sub=p_blocks[i].first) - p_blocks[i].first = getNextFreeBlock(sub); - p_blocks[i].maxfree = getMaxFreeBlock(p_blocks[i].block, p_blocks[i].size, p_blocks[i].first); + blocklist_t* l = findBlock(addr); + if(l) { + size_t subsize; + if(l->type == BTYPE_LIST) { + blockmark_t* sub = (blockmark_t*)(addr-sizeof(blockmark_t)); + if(expandBlock(l->block, sub, size, &l->first)) { + l->maxfree = getMaxFreeBlock(l->block, l->size, l->first); mutex_unlock(&mutex_blocks); return p; } + subsize = sizeBlock(sub); + } else if(l->type == BTYPE_MAP) { + //BTYPE_MAP + if(size<=128) { + mutex_unlock(&mutex_blocks); + return p; + } + subsize = 128; + }else{ + // BTYPE_MAP64 + if(size<=64) { + mutex_unlock(&mutex_blocks); + return p; + } + subsize = 64; + } + mutex_unlock(&mutex_blocks); + void* newp = internal_customMalloc(size, is32bits); + memcpy(newp, p, subsize); + internal_customFree(p, is32bits); + return newp; + } + mutex_unlock(&mutex_blocks); + if(n_blocks) { + if(is32bits) { + return box_realloc(p, size); + } else { + printf_log(LOG_INFO, "Warning, block %p not found in p_blocks for realloc, malloc'ing again without free\n", (void*)addr); + } + } + return internal_customMalloc(size, is32bits); +} +void* customRealloc(void* p, size_t size) +{ + return internal_customRealloc(p, size, 0); +} +void* customRealloc32(void* p, size_t size) +{ + return internal_customRealloc(p, size, 1); +} + +void internal_customFree(void* p, int is32bits) +{ + if(!p || !inited) { + return; + } + uintptr_t addr = (uintptr_t)p; + mutex_lock(&mutex_blocks); + blocklist_t* l = findBlock(addr); + if(l) { + if(l->type==BTYPE_LIST) { + blockmark_t* sub = (blockmark_t*)(addr-sizeof(blockmark_t)); + size_t newfree = freeBlock(l->block, l->size, sub, &l->first); + if(l->maxfree < newfree) l->maxfree = newfree; mutex_unlock(&mutex_blocks); - void* newp = customMalloc(size); - memcpy(newp, p, sizeBlock(sub)); - customFree(p); - return newp; + return; + } else if(l->type == BTYPE_MAP) { + //BTYPE_MAP + size_t idx = (addr-(uintptr_t)l->block)>>7; + uint8_t* map = l->first; + if(map[idx>>3]&(1<<(idx&7))) { + map[idx>>3] ^= (1<<(idx&7)); + l->maxfree += 128; + } // warn if double free? + #ifdef TRACE_MEMSTAT + else printf_log(LOG_INFO, "Warning, customme free(%p) from MAP block %p, but not found as allocated\n", p, l); + #endif + if(l->lowest>idx) + l->lowest = idx; + mutex_unlock(&mutex_blocks); + return; + }else{ + //BTYPE_MAP + size_t idx = (addr-(uintptr_t)l->block)>>6; + uint16_t* map = l->first; + if(map[idx>>4]&(1<<(idx&15))) { + map[idx>>4] ^= (1<<(idx&15)); + l->maxfree += 64; + } // warn if double free? + #ifdef TRACE_MEMSTAT + else printf_log(LOG_INFO, "Warning, customme free(%p) from MAP block %p, but not found as allocated\n", p, l); + #endif + if(l->lowest>idx) + l->lowest = idx; + mutex_unlock(&mutex_blocks); + return; } } mutex_unlock(&mutex_blocks); - if(n_blocks) - dynarec_log(LOG_NONE, "Warning, block %p not found in p_blocks for realloc, malloc'ing again without free\n", (void*)addr); - return customMalloc(size); + if(n_blocks) { + if(is32bits) { + box_free(p); + } else { + printf_log(LOG_INFO, "Warning, block %p not found in p_blocks for Free\n", (void*)addr); + } + } } void customFree(void* p) +{ + internal_customFree(p, 0); +} +void customFree32(void* p) +{ + internal_customFree(p, 1); +} + +void internal_print_block(int i) +{ + if(p_blocks[i].type==BTYPE_LIST) { + blockmark_t* m = p_blocks[i].block; + size_t sz = p_blocks[i].size; + while(m) { + blockmark_t *next = NEXT_BLOCK(m); + printf_log(LOG_INFO, " block %p(%p)->%p : %d\n", m, (void*)m+sizeof(blockmark_t), next, m->next.fill); + if(next!=m) + m = next; + } + } +} + +void* internal_customMemAligned(size_t align, size_t size, int is32bits) +{ + size_t align_mask = align-1; + size_t init_size = (size+align_mask)&~align_mask; + size = roundSize(size); + if(align<8) align = 8; + if(size<=64 && align<=64) + return map64_customMalloc(size, is32bits); + if(size<=128 && align<=128) + return map128_customMalloc(size, is32bits); + // look for free space + blockmark_t* sub = NULL; + size_t fullsize = size+2*sizeof(blockmark_t); + mutex_lock(&mutex_blocks); + for(int i=0; i=size && (p_blocks[i].is32bits==is32bits)) { + size_t rsize = 0; + sub = getFirstBlock(p_blocks[i].block, init_size, &rsize, p_blocks[i].first); + uintptr_t p = (uintptr_t)sub+sizeof(blockmark_t); + uintptr_t aligned_p = (p+align_mask)&~align_mask; + uintptr_t empty_size = 0; + if(aligned_p!=p) + empty_size = aligned_p-p; + if(empty_size<=sizeof(blockmark_t)) { + empty_size += align; + aligned_p += align; + } + if(sub && (empty_size+init_size<=rsize)) { + if(size(uintptr_t)sub && (sub!=new_sub)) + p_blocks[i].first = sub; + if(rsize==p_blocks[i].maxfree) + p_blocks[i].maxfree = getMaxFreeBlock(p_blocks[i].block, p_blocks[i].size, p_blocks[i].first); + mutex_unlock(&mutex_blocks); + return ret; + } + } + } + // add a new block + int i = n_blocks++; + if(n_blocks>c_blocks) { + c_blocks += 4; + p_blocks = (blocklist_t*)box_realloc(p_blocks, c_blocks*sizeof(blocklist_t)); + __sync_synchronize(); + } + p_blocks[i].block = NULL; // incase there is a re-entrance + p_blocks[i].first = NULL; + p_blocks[i].size = 0; + p_blocks[i].type = BTYPE_LIST; + p_blocks[i].is32bits = is32bits; + fullsize += 2*align+sizeof(blockmark_t); + size_t allocsize = (fullsize>MMAPSIZE)?fullsize:MMAPSIZE; + allocsize = (allocsize+box64_pagesize-1)&~(box64_pagesize-1); + if(is32bits) + mutex_unlock(&mutex_blocks); + void* p = is32bits + ? box_mmap(NULL, allocsize, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1, 0) + : (box64_is32bits ? box32_dynarec_mmap(allocsize, -1, 0) : InternalMmap(NULL, allocsize, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0)); + if(is32bits) + mutex_lock(&mutex_blocks); +#ifdef TRACE_MEMSTAT + customMalloc_allocated += allocsize; +#endif + p_blocks[i].block = p; + p_blocks[i].first = p; + p_blocks[i].size = allocsize; + // 32bits check - ensure entire allocation fits in 32-bit space + if(is32bits && ((uintptr_t)p + allocsize > 0x100000000ULL)) { + printf_log(LOG_INFO, "Warning: failed to allocate aligned 0x%x (0x%x) bytes in 32bits address space (block %d, addr %p)\n", size, allocsize, i, p); + // failed to allocate memory + if(BOX64ENV(showbt) || BOX64ENV(showsegv)) { + // mask size from this block + p_blocks[i].size = 0; + mutex_unlock(&mutex_blocks); + ShowNativeBT(LOG_NONE); + testAllBlocks(); + if(1 || BOX64ENV(log)>=LOG_DEBUG) { + printf_log(LOG_NONE, "Used 32bits address space map:\n"); + uintptr_t addr = rb_get_leftmost(mapallmem); + while(addr<0x100000000LL) { + uintptr_t bend; + uint32_t val; + if(rb_get_end(mapallmem, addr, &val, &bend)) + printf_log(LOG_NONE, "\t%p - %p (%d)\n", (void*)addr, (void*)bend, val); + addr = bend; + } + } + p_blocks[i].size = allocsize; + } + #ifdef TRACE_MEMSTAT + printf_log(LOG_INFO, "Custommem: Failed to aligned alloc 32bits: allocation %p-%p for LIST Alloc p_blocks[%d]\n", p, p+allocsize, i); + #endif + p_blocks[i].is32bits = 0; + p_blocks[i].maxfree = allocsize - sizeof(blockmark_t)*2; + errno = ENOMEM; + return NULL; + } + #ifdef TRACE_MEMSTAT + printf_log(LOG_INFO, "Custommem: allocation %p-%p for LIST Alloc p_blocks[%d], aligned\n", p, p+allocsize, i); + #endif + // setup marks + blockmark_t* m = (blockmark_t*)p; + m->prev.x32 = 0; + m->next.fill = 0; + m->next.offs = allocsize-2*sizeof(blockmark_t); + blockmark_t* n = NEXT_BLOCK(m); + n->next.x32 = 0; + n->prev.x32 = m->next.x32; + uintptr_t aligned_p = ((uintptr_t)p+sizeof(blockmark_t)+align-1)&~(align-1); + size_t empty_size = 0; + if(aligned_p!=(uintptr_t)p+sizeof(blockmark_t)) + empty_size = aligned_p-sizeof(blockmark_t)-(uintptr_t)p; + if(empty_size<=sizeof(blockmark_t)) { + empty_size += align; + aligned_p += align; + } + sub = p; + void* new_sub = sub; + if(empty_size) + new_sub = createAlignBlock(p_blocks[i].block, sub, empty_size); + // alloc 1st block + void* ret = allocBlock(p_blocks[i].block, new_sub, size, &p_blocks[i].first); + p_blocks[i].maxfree = getMaxFreeBlock(p_blocks[i].block, p_blocks[i].size, p_blocks[i].first); + mutex_unlock(&mutex_blocks); + add_blockstree((uintptr_t)p, (uintptr_t)p+allocsize, i); + if(mapallmem) + setProtection((uintptr_t)p, allocsize, PROT_READ | PROT_WRITE); + last_block_index = i; + last_block_index_list = i; + return ret; +} +void* customMemAligned(size_t align, size_t size) +{ + return internal_customMemAligned(align, size, 0); +} +void* customMemAligned32(size_t align, size_t size) +{ + void* ret = internal_customMemAligned(align, size, 1); + if(((uintptr_t)ret)>=0x100000000LL) { + printf_log(LOG_NONE, "Error, customAligned32(0x%lx, 0x%lx) return 64bits point %p\n", align, size, ret); + ShowNativeBT(LOG_NONE); + testAllBlocks(); + } + return ret; +} + +size_t customGetUsableSize(void* p) { if(!p) - return; + return 0; uintptr_t addr = (uintptr_t)p; mutex_lock(&mutex_blocks); - for(int i=0; i(uintptr_t)p_blocks[i].block) - && (addr<((uintptr_t)p_blocks[i].block+p_blocks[i].size))) { - void* sub = (void*)(addr-sizeof(blockmark_t)); - size_t newfree = freeBlock(p_blocks[i].block, sub, &p_blocks[i].first); - if(p_blocks[i].maxfree < newfree) p_blocks[i].maxfree = newfree; + blocklist_t* l = findBlock(addr); + if(l) { + if(l->type == BTYPE_MAP) { mutex_unlock(&mutex_blocks); - return; + return 128; + } + else if(l->type == BTYPE_MAP64) { + mutex_unlock(&mutex_blocks); + return 64; } + blockmark_t* sub = (void*)(addr-sizeof(blockmark_t)); + + size_t size = SIZE_BLOCK(sub->next); + mutex_unlock(&mutex_blocks); + return size; } mutex_unlock(&mutex_blocks); - if(n_blocks) - dynarec_log(LOG_NONE, "Warning, block %p not found in p_blocks for Free\n", (void*)addr); + return 0; +} + +void* box32_dynarec_mmap(size_t size, int fd, off_t offset) +{ + #ifdef BOX32 + // find a block that was prereserve before and big enough + size = (size+box64_pagesize-1)&~(box64_pagesize-1); + uint32_t flag; + static uintptr_t cur = 0x100000000LL; + uintptr_t bend = 0; + while(bend<0x800000000000LL) { + uint32_t map_flags = MAP_FIXED | ((fd==-1)?MAP_ANONYMOUS:0) | MAP_PRIVATE; + if(rb_get_end(mapallmem, cur, &flag, &bend)) { + if(flag == MEM_RESERVED && bend-cur>=size) { + void* ret = InternalMmap((void*)cur, size, PROT_READ | PROT_WRITE | PROT_EXEC, map_flags, fd, offset); + if(ret!=MAP_FAILED) { + //rb_set(mapallmem, cur, cur+size, MEM_BOX); // mark as allocated by/for box + } else + printf_log(LOG_INFO, "Error allocating Dynarec memory: %s\n", strerror(errno)); + cur = cur+size; + return ret; + } + } + cur = bend; + } +#endif + uint32_t map_flags = ((fd==-1)?MAP_ANONYMOUS:0) | MAP_PRIVATE; + // printf_log(LOG_INFO, "Error allocating Dynarec memory: %s\n", "fallback to internal mmap"); + void* ret = InternalMmap(box64_isAddressSpace32?NULL:(void*)0x100000000ULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, map_flags, fd, offset); + //printf_log(LOG_INFO, "fallback on box32_dynarec_mmap: %p\n", ret); + return ret; } #ifdef DYNAREC -#define NCHUNK 64 typedef struct mmaplist_s { - blocklist_t chunks[NCHUNK]; - mmaplist_t* next; + blocklist_t** chunks; + int cap; + int size; + int has_new; + int dirty; } mmaplist_t; +mmaplist_t* NewMmaplist() +{ + return (mmaplist_t*)box_calloc(1, sizeof(mmaplist_t)); +} + +int MmaplistHasNew(mmaplist_t* list, int clear) +{ + if(!list) return 0; + int ret = list->has_new; + if(clear) list->has_new = 0; + return ret; +} + +int MmaplistIsDirty(mmaplist_t* list) +{ + if(!list) return 0; + return list->dirty; +} + +int MmaplistNBlocks(mmaplist_t* list) +{ + if(!list) return 0; + return list->size; +} + +void MmaplistAddNBlocks(mmaplist_t* list, int nblocks) +{ + if(!list) return; + if(nblocks<=0) return; + list->cap = list->size + nblocks; + list->chunks = box_realloc(list->chunks, list->cap*sizeof(blocklist_t**)); +} + +int RelocsHaveCancel(dynablock_t* block); +size_t MmaplistChunkGetUsedcode(blocklist_t* list) +{ + void* p = list->block; + void* end = list->block + list->size - sizeof(blockmark_t); + size_t total = 0; + while(pnext.fill) { + dynablock_t* b = *(dynablock_t**)((blockmark_t*)p)->mark; + size_t b_size = SIZE_BLOCK(((blockmark_t*)p)->next); + if(b->relocs && b->relocsize && RelocsHaveCancel(b)) + b_size = 0; + total += b_size; + } + p = NEXT_BLOCK((blockmark_t*)p); + } + return total; +} + +size_t MmaplistTotalAlloc(mmaplist_t* list) +{ + if(!list) return 0; + size_t total = 0; + for(int i=0; isize; ++i) + total += MmaplistChunkGetUsedcode(list->chunks[i]); + return total; +} + +int ApplyRelocs(dynablock_t* block, intptr_t delta_block, intptr_t delat_map, uintptr_t mapping_start); +uintptr_t RelocGetNext(); +int MmaplistAddBlock(mmaplist_t* list, int fd, off_t offset, void* orig, size_t size, intptr_t delta_map, uintptr_t mapping_start) +{ + if(!list) return -1; + if(list->cap==list->size) { + list->cap += 4; + list->chunks = box_realloc(list->chunks, list->cap*sizeof(blocklist_t**)); + } + int i = list->size++; + void* map = MAP_FAILED; + #ifdef BOX32 + if(box64_is32bits) + map = box32_dynarec_mmap(size, fd, offset); + #endif + if(map==MAP_FAILED) + map = InternalMmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, offset); + if(map==MAP_FAILED) { + printf_log(LOG_INFO, "Failed to load block %d of a maplist\n", i); + return -3; + } + #ifdef MADV_HUGEPAGE + madvise(map, size, MADV_HUGEPAGE); + #endif + setProtection_box((uintptr_t)map, size, PROT_READ | PROT_WRITE | PROT_EXEC); + list->chunks[i] = map; + intptr_t delta = map - orig; + // relocate the pointers + if(delta) { + list->chunks[i]->block = ((void*)list->chunks[i]->block) + delta; + list->chunks[i]->first += delta; + } + // relocate all allocated dynablocks + void* p = list->chunks[i]->block; + void* end = map + size - sizeof(blockmark_t); + while(pnext.fill) { + void** b = (void**)((blockmark_t*)p)->mark; + // first is the address of the dynablock itself, that needs to be adjusted + b[0] += delta; + dynablock_t* bl = b[0]; + // now reloacte the dynablocks, all that need to be adjusted! + #define GO(A) if(bl->A) bl->A = ((void*)bl->A)+delta + GO(block); + GO(actual_block); + GO(previous); + GO(instsize); + GO(arch); + GO(callrets); + GO(sep); + GO(jmpnext); + GO(table64); + GO(relocs); + #ifdef GBDJIT + GO(gdbjit_block); + #endif + #undef GO + // shift the self referece to dynablock + if(bl->block!=bl->jmpnext) { + void** db_ref = (bl->jmpnext-sizeof(void*)); + *db_ref = (*db_ref)+delta; + db_ref = (bl->jmpnext-sizeof(void*)+3*sizeof(void*)); + *db_ref = native_next; + } + // adjust x64_addr with delta_map + bl->x64_addr += delta_map; + *(uintptr_t*)(bl->jmpnext+2*sizeof(void*)) = RelocGetNext(); + if(bl->relocs && bl->relocsize) + ApplyRelocs(bl, delta, delta_map, mapping_start); + ClearCache(bl->jmpnext, 4*sizeof(void*)); + ClearCache(bl->actual_block+sizeof(void*), bl->native_size); + //add block, as dirty for now + if(!addJumpTableIfDefault64(bl->x64_addr, bl->jmpnext)) { + // cannot add blocks? + printf_log(LOG_INFO, "Warning, cannot add DynaCache Block %d to JmpTable\n", i); + } else { + for(int i=0; isep_size; ++i) { + uint32_t x64_offs = bl->sep[i].x64_offs; + uint32_t nat_offs = bl->sep[i].nat_offs; + if(addJumpTableIfDefault64(bl->x64_addr+x64_offs, (bl->dirty || bl->always_test)?bl->jmpnext:(bl->block+nat_offs))) + bl->sep[i].active = 1; + else + bl->sep[i].active = 0; + } + if(bl->x64_size) { + dynarec_log(LOG_DEBUG, "Added DynCache bl %p for %p - %p\n", bl, bl->x64_addr, bl->x64_addr+bl->x64_size); + if(bl->x64_size>my_context->max_db_size) { + my_context->max_db_size = bl->x64_size; + dynarec_log(LOG_INFO, "BOX64 Dynarec: higher max_db=%d\n", my_context->max_db_size); + } + rb_inc(my_context->db_sizes, bl->x64_size, bl->x64_size+1); + } + } + + } + p = NEXT_BLOCK((blockmark_t*)p); + } + // add new block to rbtt_dynmem + rb_set_64(rbt_dynmem, (uintptr_t)map, (uintptr_t)map+size, (uintptr_t)list->chunks[i]); + + return 0; +} + +void MmaplistFillBlocks(mmaplist_t* list, DynaCacheBlock_t* blocks) +{ + if(!list) return; + for(int i=0; isize; ++i) { + blocks[i].block = list->chunks[i]; + blocks[i].size = list->chunks[i]->size+sizeof(blocklist_t); + blocks[i].free_size = list->chunks[i]->maxfree; + } +} + +void DelMmaplist(mmaplist_t* list) +{ + if(!list) return; + for(int i=0; isize; ++i) + if(list->chunks[i]->size) { + cleanDBFromAddressRange((uintptr_t)list->chunks[i]->block, list->chunks[i]->size, 1); + rb_unset(rbt_dynmem, (uintptr_t)list->chunks[i]->block, (uintptr_t)list->chunks[i]->block+list->chunks[i]->size); + // the blocklist_t "chunk" structure is port of the memory map, so grab info before freing the memory + // also need to include back the blocklist_t that is excluded from the blocklist tracking + void* addr = list->chunks[i]->block - sizeof(blocklist_t); + size_t size = list->chunks[i]->size + sizeof(blocklist_t); + int isReserved = box64_is32bits && (uintptr_t)addr>0xffffffffLL; + InternalMunmap(addr, size); + // check if memory should be protected and alloced for box32 + if(isReserved) { + //rereserve and mark as reserved + if(InternalMmap(addr, size, 0, MAP_NORESERVE|MAP_ANONYMOUS|MAP_FIXED, -1, 0)!=MAP_FAILED) + rb_set(mapallmem, (uintptr_t)addr, (uintptr_t)addr+size, MEM_RESERVED); + } else + rb_unset(mapallmem, (uintptr_t)addr, (uintptr_t)addr+size); + } + box_free(list); +} + dynablock_t* FindDynablockFromNativeAddress(void* p) { if(!p) @@ -524,131 +1575,196 @@ dynablock_t* FindDynablockFromNativeAddress(void* p) uintptr_t addr = (uintptr_t)p; - int i= 0; - mmaplist_t* list = mmaplist; - if(!list) - return NULL; - while(list) { - if ((addr>(uintptr_t)list->chunks[i].block) - && (addr<((uintptr_t)list->chunks[i].block+list->chunks[i].size))) { - blockmark_t* sub = (blockmark_t*)list->chunks[i].block; - while((uintptr_t)subaddr) { - // found it! - // self is the field of a block - return *(dynablock_t**)((uintptr_t)sub+sizeof(blockmark_t)); - } - sub = n; + blocklist_t* bl = (blocklist_t*)rb_get_64(rbt_dynmem, addr); + if(bl) { + // browse the map allocation as a fallback + blockmark_t* sub = (blockmark_t*)bl->block; + while((uintptr_t)subaddr) { + // found it! + if(!sub->next.fill) return NULL; // empty space? + // self is the field of a block + dynablock_t** ret = (dynablock_t**)((uintptr_t)sub+sizeof(blockmark_t)); + return *ret; } - return NULL; - } - ++i; - if(i==NCHUNK) { - i = 0; - list = list->next; + sub = n; } } return NULL; } +// To measure speed at wich blocks are created, to avoid purge when lots of blocks are created in burst +static uint64_t start_time = 0; +static uint32_t start_tick = 0; +static uint64_t tick_freq = 0; +static uint64_t cur_speed = 0; + +void UpdateBlockCreationSpeed() +{ + if(!tick_freq) { + tick_freq = ReadTSCFrequency(NULL); + start_tick = my_context->tick; + start_time = ReadTSC(NULL); + } + uint64_t cur_time = ReadTSC(NULL); + // compute elapsed time is micro seconds + uint64_t elapsed_time = (cur_time-start_time)*1000000LL/tick_freq; + if(my_context->tick-start_tick>100 || elapsed_time>1000) { + // update speed each 100 blocks created or 1ms elapsed + cur_speed = (my_context->tick-start_tick)*1000000LL/elapsed_time; + start_tick = my_context->tick; + start_time = cur_time; + } +} + +int PurgeDynarecMap(mmaplist_t* list, size_t size) +{ + if(cur_speed>100) return 0; // 100 blocks / sec is a burst! + // check all blocks where tick is old enough and in_used==0, then delete them + // return 1 as soon as one block has been deleted, 0 else + // beware that tick=0 blocks means they were never executed and should not be touched + int ret = 0; + for(int i=0; isize && !ret; ++i) { + blocklist_t* bl = list->chunks[i]; + blockmark_t* p = bl->block; + blockmark_t* end = bl->block + bl->size - sizeof(blockmark_t); + + while(pnext.fill) { + dynablock_t* dynablock = *(dynablock_t**)p->mark; + int tick = native_lock_get_d(&dynablock->tick); + if(tick && dynablock->done && (my_context->tick > tick) && ((my_context->tick-tick)>=BOX64ENV(dynarec_purge_age))) { + int in_used = native_lock_get_d(&dynablock->in_used); + if(!in_used) { + // free the block, but unreference it first + //if(setJumpTableDefaultIfRef64(dynablock->x64_addr, dynablock->block)) + { + dynarec_log(LOG_INFO/*LOG_DEBUG*/, " PurgeDynablock %p\n", dynablock); + if((nnext.fill ) + n = NEXT_BLOCK(n); //because the block will be agglomerated + FreeDynablock(dynablock, 0, 1); + if((bl->maxfree>=size)) + ret = 1; + } // fail to set default jump, so skipping + } + } + } + p = n; + } + } + return ret; +} #ifdef TRACE_MEMSTAT static uint64_t dynarec_allocated = 0; #endif -uintptr_t AllocDynarecMap(size_t size) +uintptr_t AllocDynarecMap(uintptr_t x64_addr, size_t size, int is_new) { if(!size) return 0; size = roundSize(size); - mmaplist_t* list = mmaplist; + if(BOX64ENV(dynarec_purge)) { + __atomic_fetch_add(&my_context->tick, 1, __ATOMIC_RELAXED); + UpdateBlockCreationSpeed(); + } + + mmaplist_t* list = GetMmaplistByAddr(x64_addr); + if(!list) + list = mmaplist; if(!list) - list = mmaplist = (mmaplist_t*)box_calloc(1, sizeof(mmaplist_t)); + list = mmaplist = NewMmaplist(); + if(is_new) list->has_new = 1; + list->dirty = 1; // check if there is space in current open ones - int i = 0; uintptr_t sz = size + 2*sizeof(blockmark_t); - while(1) { - if(list->chunks[i].maxfree>=size) { - // looks free, try to alloc! - size_t rsize = 0; - void* sub = getFirstBlock(list->chunks[i].block, size, &rsize, list->chunks[i].first); - if(sub) { - void* ret = allocBlock(list->chunks[i].block, sub, size, NULL); - if(sub==list->chunks[i].first) - list->chunks[i].first = getNextFreeBlock(sub); - if(rsize==list->chunks[i].maxfree) - list->chunks[i].maxfree = getMaxFreeBlock(list->chunks[i].block, list->chunks[i].size, list->chunks[i].first); - return (uintptr_t)ret; + int recheck = 0; + do { + for(int i=0; isize; ++i) { + if(list->chunks[i]->maxfree>=size) { + // looks free, try to alloc! + size_t rsize = 0; + void* sub = getFirstBlock(list->chunks[i]->block, size, &rsize, list->chunks[i]->first); + if(sub) { + void* ret = allocBlock(list->chunks[i]->block, sub, size, &list->chunks[i]->first); + if(rsize==list->chunks[i]->maxfree) + list->chunks[i]->maxfree = getMaxFreeBlock(list->chunks[i]->block, list->chunks[i]->size, list->chunks[i]->first); + //rb_set_64(list->chunks[i].tree, (uintptr_t)ret, (uintptr_t)ret+size, (uintptr_t)ret); + return (uintptr_t)ret; + } } } - // check if new - if(!list->chunks[i].size) { - // alloc a new block, aversized or not, we are at the end of the list - size_t allocsize = (sz>DYNMMAPSZ)?sz:DYNMMAPSZ; - // allign sz with pagesize - allocsize = (allocsize+(box64_pagesize-1))&~(box64_pagesize-1); - #ifndef USE_MMAP - void *p = NULL; - if(!(p=box_memalign(box64_pagesize, allocsize))) { - dynarec_log(LOG_INFO, "Cannot create dynamic map of %zu bytes\n", allocsize), allocsize, strerror(errno); - return 0; - } - mprotect(p, allocsize, PROT_READ | PROT_WRITE | PROT_EXEC); - #else - void* p=MAP_FAILED; - // disabling for now. explicit hugepage needs to be enabled to be used on userspace - // with`/sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages` as the number of allowaed 2M huge page - // At least with a 2M allocation, transparent huge page should kick-in - #if 0//def MAP_HUGETLB - if(allocsize==DYNMMAPSZ) { - p = internal_mmap(NULL, allocsize, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANONYMOUS|MAP_PRIVATE|MAP_HUGETLB, -1, 0); - if(p!=MAP_FAILED) printf_log(LOG_INFO, "Allocated a dynarec memory block with HugeTLB\n"); - else printf_log(LOG_INFO, "Failled to allocated a dynarec memory block with HugeTLB (%s)\n", strerror(errno)); - } - #endif - if(p==MAP_FAILED) - p = internal_mmap(NULL, allocsize, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); - if(p==MAP_FAILED) { - dynarec_log(LOG_INFO, "Cannot create dynamic map of %zu bytes (%s)\n", allocsize, strerror(errno)); - return 0; - } - #ifdef MADV_HUGEPAGE - madvise(p, allocsize, MADV_HUGEPAGE); - #endif - #endif + // check if we can remove blocks before allocating a new one + if(BOX64ENV(dynarec_purge)) + recheck = recheck?0:PurgeDynarecMap(list, size); // don't do purge all the time, it's too time consuming + } while(recheck); + // need to add a new + if(list->size == list->cap) { + list->cap+=4; + list->chunks = box_realloc(list->chunks, list->cap*sizeof(blocklist_t**)); + } + int i = list->size++; + size_t need_sz = sz + sizeof(blocklist_t); + // alloc a new block, aversized or not, we are at the end of the list + size_t allocsize = (need_sz>(i?DYNMMAPSZ:DYNMMAPSZ0))?need_sz:(i?DYNMMAPSZ:DYNMMAPSZ0); + // allign sz with pagesize + allocsize = (allocsize+(box64_pagesize-1))&~(box64_pagesize-1); + void* p=MAP_FAILED; + #ifdef BOX32 + if(box64_is32bits) + p = box32_dynarec_mmap(allocsize, -1, 0); + #endif + // disabling for now. explicit hugepage needs to be enabled to be used on userspace + // with`/sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages` as the number of allowaed 2M huge page + // At least with a 2M allocation, transparent huge page should kick-in + #if 0//def MAP_HUGETLB + if(p==MAP_FAILED && allocsize==DYNMMAPSZ) { + p = InternalMmap(NULL, allocsize, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANONYMOUS|MAP_PRIVATE|MAP_HUGETLB, -1, 0); + if(p!=MAP_FAILED) printf_log(LOG_INFO, "Allocated a dynarec memory block with HugeTLB\n"); + else printf_log(LOG_INFO, "Failed to allocated a dynarec memory block with HugeTLB (%s)\n", strerror(errno)); + } + #endif + if(p==MAP_FAILED) + p = InternalMmap(NULL, allocsize, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); + if(p==MAP_FAILED) { + dynarec_log(LOG_INFO, "Cannot create dynamic map of %zu bytes (%s)\n", allocsize, strerror(errno)); + return 0; + } + #ifdef MADV_HUGEPAGE + madvise(p, allocsize, MADV_HUGEPAGE); + #endif #ifdef TRACE_MEMSTAT - dynarec_allocated += allocsize; + dynarec_allocated += allocsize; + printf_log(LOG_INFO, "Custommem: allocation %p-%p for Dynarec %p->chunk[%d]\n", p, p+allocsize, list, i); +#else + if(box64env.dynarec_log>LOG_INFO || box64env.dynarec_dump) + dynarec_log(LOG_NONE, "Custommem: allocation %p-%p for Dynarec %p->chunk[%d]\n", p, p+allocsize, list, i); #endif - setProtection((uintptr_t)p, allocsize, PROT_READ | PROT_WRITE | PROT_EXEC); - list->chunks[i].block = p; - list->chunks[i].first = p; - list->chunks[i].size = allocsize; - // setup marks - blockmark_t* m = (blockmark_t*)p; - m->prev.x32 = 0; - m->next.fill = 0; - m->next.size = allocsize-2*sizeof(blockmark_t); - blockmark_t* n = NEXT_BLOCK(m); - n->next.x32 = 0; - n->prev.fill = 0; - n->prev.size = m->next.size; - // alloc 1st block - void* ret = allocBlock(list->chunks[i].block, p, size, NULL); - list->chunks[i].maxfree = getMaxFreeBlock(list->chunks[i].block, list->chunks[i].size, NULL); - if(list->chunks[i].maxfree) - list->chunks[i].first = getNextFreeBlock(m); - return (uintptr_t)ret; - } - // next chunk... - ++i; - if(i==NCHUNK) { - i = 0; - if(!list->next) - list->next = (mmaplist_t*)box_calloc(1, sizeof(mmaplist_t)); - list = list->next; - } - } + setProtection_box((uintptr_t)p, allocsize, PROT_READ | PROT_WRITE | PROT_EXEC); + list->chunks[i] = p; + rb_set_64(rbt_dynmem, (uintptr_t)p, (uintptr_t)p+allocsize, (uintptr_t)list->chunks[i]); + p = p + sizeof(blocklist_t); // adjust pointer and size, to exclude blocklist_t itself + allocsize-=sizeof(blocklist_t); + list->chunks[i]->block = p; + list->chunks[i]->first = p; + list->chunks[i]->size = allocsize; + // setup marks + blockmark_t* m = (blockmark_t*)p; + m->prev.x32 = 0; + m->next.fill = 0; + m->next.offs = allocsize-sizeof(blockmark_t); + blockmark_t* n = NEXT_BLOCK(m); + n->next.x32 = 0; + n->prev.x32 = m->next.x32; + // alloc 1st block + void* ret = allocBlock(list->chunks[i]->block, p, size, &list->chunks[i]->first); + list->chunks[i]->maxfree = getMaxFreeBlock(list->chunks[i]->block, list->chunks[i]->size, list->chunks[i]->first); + if(list->chunks[i]->maxfree) + list->chunks[i]->first = getNextFreeBlock(m); + //rb_set_64(list->chunks[i].tree, (uintptr_t)ret, (uintptr_t)ret+size, (uintptr_t)ret); + return (uintptr_t)ret; } void FreeDynarecMap(uintptr_t addr) @@ -656,23 +1772,15 @@ void FreeDynarecMap(uintptr_t addr) if(!addr) return; - int i= 0; - mmaplist_t* list = mmaplist; - - while(list) { - if ((addr>(uintptr_t)list->chunks[i].block) - && (addr<((uintptr_t)list->chunks[i].block+list->chunks[i].size))) { - void* sub = (void*)(addr-sizeof(blockmark_t)); - size_t newfree = freeBlock(list->chunks[i].block, sub, &list->chunks[i].first); - if(list->chunks[i].maxfree < newfree) - list->chunks[i].maxfree = newfree; - return; - } - ++i; - if(i==NCHUNK) { - i = 0; - list = list->next; - } + + blocklist_t* bl = (blocklist_t*)rb_get_64(rbt_dynmem, addr); + + if(bl) { + void* sub = (void*)(addr-sizeof(blockmark_t)); + size_t newfree = freeBlock(bl->block, bl->size, sub, &bl->first); + if(bl->maxfree < newfree) + bl->maxfree = newfree; + return; } } @@ -726,47 +1834,40 @@ static uintptr_t getDBSize(uintptr_t addr, size_t maxsize, dynablock_t** db) void addDBFromAddressRange(uintptr_t addr, size_t size) { dynarec_log(LOG_DEBUG, "addDBFromAddressRange %p -> %p\n", (void*)addr, (void*)(addr+size-1)); - // do nothing, dynablock are allowed based on memory protection flags -} - -void cleanDBFromAddressRange(uintptr_t addr, size_t size, int destroy) -{ + // mark existing blocks as unclean, to be sure... uintptr_t start_addr = my_context?((addrmax_db_size)?0:(addr-my_context->max_db_size)):addr; - dynarec_log(LOG_DEBUG, "cleanDBFromAddressRange %p/%p -> %p %s\n", (void*)addr, (void*)start_addr, (void*)(addr+size-1), destroy?"destroy":"mark"); dynablock_t* db = NULL; uintptr_t end = addr+size; while (start_addrmax_db_size)?0:(addr-my_context->max_db_size)):addr; - dynarec_log(LOG_DEBUG, "isDBFromAddressRange %p/%p -> %p => ", (void*)addr, (void*)start_addr, (void*)(addr+size-1)); + dynarec_log(LOG_DEBUG, "cleanDBFromAddressRange %p/%p -> %p %s\n", (void*)addr, (void*)start_addr, (void*)(addr+size-1), destroy?"destroy":"mark"); dynablock_t* db = NULL; uintptr_t end = addr+size; + int ret = 0; while (start_addr>JMPTABL_START4)&JMPTABLE_MASK4; + if(box64_jmptbl4[idx4] == box64_jmptbldefault3) + return 0; + uintptr_t ****box64_jmptbl3 = box64_jmptbl4[idx4]; + #endif + idx3 = (((uintptr_t)addr)>>JMPTABL_START3)&JMPTABLE_MASK3; + if(box64_jmptbl3[idx3] == box64_jmptbldefault2) + return 0; + idx2 = (((uintptr_t)addr)>>JMPTABL_START2)&JMPTABLE_MASK2; + if(box64_jmptbl3[idx3][idx2] == box64_jmptbldefault1) + return 0; + idx1 = (((uintptr_t)addr)>>JMPTABL_START1)&JMPTABLE_MASK1; + if(box64_jmptbl3[idx3][idx2][idx1] == box64_jmptbldefault0) + return 0; + idx0 = (((uintptr_t)addr) )&JMPTABLE_MASK0; + #ifdef JMPTABL_SHIFT4 + return (native_lock_storeifref(create_jmptbl(0, idx0, idx1, idx2, idx3, idx4), native_next, jmp)==native_next)?1:0; + #else + return (native_lock_storeifref(create_jmptbl(0, idx0, idx1, idx2, idx3), native_next, jmp)==native_next)?1:0; + #endif +} void setJumpTableDefaultRef64(void* addr, void* jmp) { uintptr_t idx3, idx2, idx1, idx0; @@ -941,9 +2070,9 @@ int setJumpTableIfRef64(void* addr, void* jmp, void* ref) idx1 = (((uintptr_t)addr)>>JMPTABL_START1)&JMPTABLE_MASK1; idx0 = (((uintptr_t)addr) )&JMPTABLE_MASK0; #ifdef JMPTABL_SHIFT4 - return (native_lock_storeifref(create_jmptbl(idx0, idx1, idx2, idx3, idx4), jmp, ref)==jmp)?1:0; + return (native_lock_storeifref(create_jmptbl(0, idx0, idx1, idx2, idx3, idx4), jmp, ref)==jmp)?1:0; #else - return (native_lock_storeifref(create_jmptbl(idx0, idx1, idx2, idx3), jmp, ref)==jmp)?1:0; + return (native_lock_storeifref(create_jmptbl(0, idx0, idx1, idx2, idx3), jmp, ref)==jmp)?1:0; #endif } int isJumpTableDefault64(void* addr) @@ -976,13 +2105,19 @@ uintptr_t getJumpTable64() return (uintptr_t)box64_jmptbl3; #endif } +uintptr_t getJumpTable48() +{ + return (uintptr_t)box64_jmptbl_48; +} uintptr_t getJumpTable32() { #ifdef JMPTABL_SHIFT4 + create_jmptbl(1, 0, 0, 0, 0, 0); return (uintptr_t)box64_jmptbl4[0][0]; #else - return (uintptr_t)box64_jmptbl3[0]; + create_jmptbl(1, 0, 0, 0, 0); + return (uintptr_t)box64_jmptbl3[0][0]; #endif } @@ -997,9 +2132,9 @@ uintptr_t getJumpTableAddress64(uintptr_t addr) idx1 = ((addr)>>JMPTABL_START1)&JMPTABLE_MASK1; idx0 = ((addr) )&JMPTABLE_MASK0; #ifdef JMPTABL_SHIFT4 - return (uintptr_t)create_jmptbl(idx0, idx1, idx2, idx3, idx4); + return (uintptr_t)create_jmptbl(0, idx0, idx1, idx2, idx3, idx4); #else - return (uintptr_t)create_jmptbl(idx0, idx1, idx2, idx3); + return (uintptr_t)create_jmptbl(0, idx0, idx1, idx2, idx3); #endif } @@ -1158,8 +2293,52 @@ void unprotectDB(uintptr_t addr, size_t size, int mark) if(mark) cleanDBFromAddressRange(cur, bend-cur, 0); mprotect((void*)cur, bend-cur, prot); - } else if(prot&PROT_DYNAREC_R) + } else if(prot&PROT_DYNAREC_R) { + if(mark) + cleanDBFromAddressRange(cur, bend-cur, 0); prot &= ~PROT_CUSTOM; + } + } + if (prot != oprot) + rb_set(memprot, cur, bend, prot); + cur = bend; + } + UNLOCK_PROT(); +} +// Add the NEVERCLEAN flag for an adress range, mark all block as dirty, and lift write protection if needed +void neverprotectDB(uintptr_t addr, size_t size, int mark) +{ + dynarec_log(LOG_DEBUG, "neverprotectDB %p -> %p (mark=%d)\n", (void*)addr, (void*)(addr+size-1), mark); + + uintptr_t cur = addr&~(box64_pagesize-1); + uintptr_t end = ALIGN(addr+size); + + LOCK_PROT(); + while(cur!=end) { + uint32_t prot = 0, oprot; + uintptr_t bend = 0; + if (!rb_get_end(memprot, cur, &prot, &bend)) { + if(bend>=end) break; + else { + cur = bend; + continue; + } + } + oprot = prot; + if(bend>end) + bend = end; + if(!(prot&PROT_NEVERPROT)) { + if(prot&PROT_DYNAREC) { + prot&=~PROT_DYN; + if(mark) + cleanDBFromAddressRange(cur, bend-cur, 0); + mprotect((void*)cur, bend-cur, prot); + } else if(prot&PROT_DYNAREC_R) { + if(mark) + cleanDBFromAddressRange(cur, bend-cur, 0); + prot &= ~PROT_DYN; + } + prot |= PROT_NEVERCLEAN; } if (prot != oprot) rb_set(memprot, cur, bend, prot); @@ -1168,6 +2347,36 @@ void unprotectDB(uintptr_t addr, size_t size, int mark) UNLOCK_PROT(); } +// Remove the NEVERCLEAN flag for an adress range +void unneverprotectDB(uintptr_t addr, size_t size) +{ + dynarec_log(LOG_DEBUG, "unneverprotectDB %p -> %p\n", (void*)addr, (void*)(addr+size-1)); + + uintptr_t cur = addr&~(box64_pagesize-1); + uintptr_t end = ALIGN(addr+size); + + LOCK_PROT(); + while(cur!=end) { + uint32_t prot = 0, oprot; + uintptr_t bend = 0; + if (!rb_get_end(memprot, cur, &prot, &bend)) { + if(bend>=end) break; + else { + cur = bend; + continue; + } + } + oprot = prot; + if(bend>end) + bend = end; + prot &= ~PROT_NEVERCLEAN; + if (prot != oprot) + rb_set(memprot, cur, bend, prot); + cur = bend; + } + UNLOCK_PROT(); +} + int isprotectedDB(uintptr_t addr, size_t size) { dynarec_log(LOG_DEBUG, "isprotectedDB %p -> %p => ", (void*)addr, (void*)(addr+size-1)); @@ -1178,7 +2387,7 @@ int isprotectedDB(uintptr_t addr, size_t size) uint32_t prot; uintptr_t bend; if (!rb_get_end(memprot, addr, &prot, &bend) || !(prot&PROT_DYN)) { - dynarec_log(LOG_DEBUG, "0\n"); + dynarec_log_prefix(0, LOG_DEBUG, "0\n"); UNLOCK_PROT_READ(); return 0; } else { @@ -1186,28 +2395,171 @@ int isprotectedDB(uintptr_t addr, size_t size) } } UNLOCK_PROT_READ(); - dynarec_log(LOG_DEBUG, "1\n"); + dynarec_log_prefix(0, LOG_DEBUG, "1\n"); return 1; } -uintptr_t hotpage = 0; -int hotpage_cnt = 0; +typedef union hotpage_s { + struct { + uint64_t addr:36; + uint64_t cnt:28; + }; + uint64_t x; +} hotpage_t; +#define HOTPAGE_MAX ((1<<28)-1) +#define N_HOTPAGE 32 +#define N_HOTPAGE_ALT 8 #define HOTPAGE_MARK 64 -void SetHotPage(uintptr_t addr) +#define HOTPAGE_DIRTY 128 +#define HOTPAGE_DIRTY_ALT 1024 +static hotpage_t hotpage[N_HOTPAGE] = {0}; +void SetHotPage(int idx, uintptr_t page) +{ + hotpage_t tmp = hotpage[idx]; + tmp.addr = page; + tmp.cnt = BOX64ENV(dynarec_dirty)?(BOX64ENV(dynarec_hotpage_alt)?HOTPAGE_DIRTY_ALT:HOTPAGE_DIRTY):HOTPAGE_MARK; + //TODO: use Atomics to update hotpage? + native_lock_store_dd(hotpage+idx, tmp.x); +} +int IdxHotPage(uintptr_t page) +{ + for(int i=0; i=0x1000000000000LL) // more than 48bits + return; + if(prot&PROT_NEVERCLEAN && BOX64ENV(dynarec_dirty)==2) + return; + if(BOX64ENV(dynarec_nohotpage)) + return; + uintptr_t page = addr>>12; + if(!BOX64ENV(dynarec_hotpage_alt)) { + if(!(prot&PROT_EXEC)) + return; // needs to be an executable page + /*if(BOX64ENV(dynarec_dirty)>1) { + dynarec_log(LOG_INFO, "Detecting a Hotpage at %p, marking page as NEVERCLEAN\n", (void*)(page<<12)); + neverprotectDB(page<<12, box64_pagesize, 1); + return; + }*/ + } + // look for idx + int idx = IdxHotPage(page); + if(BOX64ENV(dynarec_hotpage_alt)) { + if(idx==-1) { IdxOldestHotPage(page); return; } + hotpage_t hp = hotpage[idx]; + /*if(hp.cnt==HOTPAGE_MAX)*/ { + if(BOX64ENV(dynarec_dirty)>1) { + dynarec_log(LOG_INFO, "Detecting a Hotpage at %p (idx=%d), marking page as NEVERCLEAN\n", (void*)(page<<12), idx); + neverprotectDB(page<<12, box64_pagesize, 1); + hp.cnt = 0; + native_lock_store_dd(hotpage+idx, hp.x); // free slot + } else { + dynarec_log(LOG_INFO, "Detecting a Hotpage at %p (idx=%d)\n", (void*)(page<<12), idx); + SetHotPage(idx, page); + } + } + } else { + if(idx!=-1 && BOX64ENV(dynarec_dirty)>1 && !hotpage[idx].cnt) { + // Re-arming, so put the page as NEVERCLEAN and stop bothering + neverprotectDB(page<<12, box64_pagesize, 1); + return; + } + if(idx==-1) idx = IdxOldestHotPage(page); + if(idx==-1) return; + dynarec_log(LOG_INFO, "Detecting a Hotpage at %p (idx=%d)\n", (void*)(page<<12), idx); + SetHotPage(idx, page); + } } int isInHotPage(uintptr_t addr) { - if(!hotpage_cnt) + if(addr>0x1000000000000LL) return 0; + if(BOX64ENV(dynarec_nohotpage)) return 0; - --hotpage_cnt; - return (addr>=hotpage) && (addr>12; + int idx = IdxHotPage(page); + if(BOX64ENV(dynarec_hotpage_alt)) { + if(idx==-1 || !hotpage[idx].cnt || (hotpage[idx].cnt==HOTPAGE_MAX)) + return 0; + //TODO: do Atomic stuffs instead + hotpage_t hp = hotpage[idx]; + --hp.cnt; + native_lock_store_dd(hotpage+idx, hp.x); + if(!hp.cnt && BOX64ENV(dynarec_dirty)==1) + CancelHotPage(hp.addr); + return 1; + } else { + int ret = ((idx==-1) || !hotpage[idx].cnt)?0:1; + // decrement all hotpage, it's a hotpage "tick" + for(int i=0; i=hotpage) && (addr0x1000000000000LL) return 0; + uintptr_t page = addr>>12; + int idx = IdxHotPage(page); + if(BOX64ENV(dynarec_hotpage_alt)) { + return (idx==-1 || !hotpage[idx].cnt || (hotpage[idx].cnt==HOTPAGE_MAX))?0:1; + } else { + return ((idx==-1) || !hotpage[idx].cnt)?0:1; + } } @@ -1219,51 +2571,82 @@ void updateProtection(uintptr_t addr, size_t size, uint32_t prot) LOCK_PROT(); uintptr_t cur = addr & ~(box64_pagesize-1); uintptr_t end = ALIGN(cur+size); - rb_set(mapallmem, cur, cur+size, 1); + //rb_set(mapallmem, cur, cur+size, MEM_ALLOCATED); while (cur < end) { uintptr_t bend; uint32_t oprot; rb_get_end(memprot, cur, &oprot, &bend); + if(bend>end) bend = end; uint32_t dyn=(oprot&PROT_DYN); - if(!(dyn&PROT_NEVERPROT)) { + uint32_t never = dyn&PROT_NEVERPROT; + if(!(never)) { if(dyn && (prot&PROT_WRITE)) { // need to remove the write protection from this block dyn = PROT_DYNAREC; - mprotect((void*)cur, bend-cur, prot&~PROT_WRITE); + int ret = mprotect((void*)cur, bend-cur, prot&~PROT_WRITE); + dynarec_log(LOG_DEBUG, " mprotect %p:%p 0x%hhx => %d\n", (void*)cur, (void*)(bend-1), prot&~PROT_WRITE, ret); } else if(dyn && !(prot&PROT_WRITE)) { dyn = PROT_DYNAREC_R; } } - if ((prot|dyn) != oprot) - rb_set(memprot, cur, bend, prot|dyn); + uint32_t new_prot = prot?(prot|dyn):(prot|never); + if (new_prot != oprot) + rb_set(memprot, cur, bend, new_prot); cur = bend; } UNLOCK_PROT(); } +static void setProtection_generic(uintptr_t addr, size_t size, uint32_t prot, mem_flag_t flag) +{ + if(!size) + return; + addr &= ~(box64_pagesize-1); + size = ALIGN(size); + if(!prot) { + LOCK_PROT(); + rb_set(mapallmem, addr, addr+size, flag); + rb_unset(memprot, addr, addr+size); + UNLOCK_PROT(); + } + else{//SetProtection + LOCK_PROT(); + ++setting_prot; + uintptr_t cur = addr & ~(box64_pagesize-1); + uintptr_t end = ALIGN(cur+size); + rb_set(mapallmem, cur, end, flag); + rb_set(memprot, cur, end, prot); + --setting_prot; + UNLOCK_PROT(); + } +} + + void setProtection(uintptr_t addr, size_t size, uint32_t prot) { size = ALIGN(size); LOCK_PROT(); + ++setting_prot; uintptr_t cur = addr & ~(box64_pagesize-1); uintptr_t end = ALIGN(cur+size); - rb_set(mapallmem, cur, end, 1); + rb_set(mapallmem, cur, end, MEM_ALLOCATED); rb_set(memprot, cur, end, prot); + --setting_prot; UNLOCK_PROT(); } void setProtection_mmap(uintptr_t addr, size_t size, uint32_t prot) { - if(!size) - return; - addr &= ~(box64_pagesize-1); - size = ALIGN(size); - LOCK_PROT(); - rb_set(mmapmem, addr, addr+size, 1); - if(!prot) - rb_set(mapallmem, addr, addr+size, 1); - UNLOCK_PROT(); - if(prot) - setProtection(addr, size, prot); + setProtection_generic(addr, size, prot, MEM_MMAP); +} + +void setProtection_box(uintptr_t addr, size_t size, uint32_t prot) +{ + setProtection_generic(addr, size, prot, MEM_BOX); +} + +void setProtection_stack(uintptr_t addr, size_t size, uint32_t prot) +{ + setProtection_generic(addr, size, prot, MEM_STACK); } void setProtection_elf(uintptr_t addr, size_t size, uint32_t prot) @@ -1271,10 +2654,11 @@ void setProtection_elf(uintptr_t addr, size_t size, uint32_t prot) size = ALIGN(size); addr &= ~(box64_pagesize-1); if(prot) - setProtection(addr, size, prot); + setProtection_generic(addr, size, prot, MEM_ELF); else { LOCK_PROT(); - rb_set(mapallmem, addr, addr+size, 1); + rb_set(mapallmem, addr, addr+size, MEM_ELF); + rb_unset(memprot, addr, addr+size); UNLOCK_PROT(); } } @@ -1297,13 +2681,22 @@ void allocProtection(uintptr_t addr, size_t size, uint32_t prot) size = ALIGN(size); addr &= ~(box64_pagesize-1); LOCK_PROT(); - rb_set(mapallmem, addr, addr+size, 1); + uint32_t val; + uintptr_t endb; + int there = rb_get_end(mapallmem, addr, &val, &endb); + // block is here or absent, no half-block handled.. + if(!there) + rb_set(mapallmem, addr, addr+size, MEM_EXTERNAL); UNLOCK_PROT(); // don't need to add precise tracking probably } +uintptr_t pbrk = 0; +uintptr_t old_brk = 0; +uintptr_t* cur_brk = NULL; void loadProtectionFromMap() { +#ifndef _WIN32 // TODO: Should this be implemented on Win32? if(box64_mapclean) return; char buf[500]; @@ -1315,9 +2708,22 @@ void loadProtectionFromMap() (void)ret; char r, w, x; uintptr_t s, e; + uintptr_t prev = 0; if(sscanf(buf, "%lx-%lx %c%c%c", &s, &e, &r, &w, &x)==5) { + uint32_t val; + uintptr_t endb; + if(prev!=s && rb_get_end(mapallmem, prev, &val, &endb)) { + if(endb>s) endb = s; + if(val==MEM_EXTERNAL) { + // free the place, it's not longer taken + rb_unset(mapallmem, prev, endb); + } + } + prev = e; int prot = ((r=='r')?PROT_READ:0)|((w=='w')?PROT_WRITE:0)|((x=='x')?PROT_EXEC:0); allocProtection(s, e-s, prot); + if(!pbrk && strstr(buf, "[heap]")) + pbrk = s; if(s>0x7fff00000000LL) have48bits = 1; } @@ -1326,12 +2732,18 @@ void loadProtectionFromMap() if(!shown48bits) { shown48bits = 1; if(have48bits) - printf_log(LOG_INFO, "BOX64: Detected 48bits at least of address space\n"); + printf_log(LOG_INFO, "Detected 48bits at least of address space\n"); else - printf_log(LOG_INFO, "BOX64: Didn't detect 48bits of address space, considering it's 39bits\n"); + printf_log(LOG_INFO, "Didn't detect 48bits of address space, considering it's 39bits\n"); + } + if(!pbrk) { + if (!box64_unittest_mode) + printf_log(LOG_INFO, "Warning, program break not found\n"); + if(cur_brk) pbrk = *cur_brk; // approximate is better than nothing } fclose(f); box64_mapclean = 1; +#endif } void freeProtection(uintptr_t addr, size_t size) @@ -1341,7 +2753,6 @@ void freeProtection(uintptr_t addr, size_t size) dynarec_log(LOG_DEBUG, "freeProtection %p:%p\n", (void*)addr, (void*)(addr+size-1)); LOCK_PROT(); rb_unset(mapallmem, addr, addr+size); - rb_unset(mmapmem, addr, addr+size); rb_unset(memprot, addr, addr+size); UNLOCK_PROT(); } @@ -1354,23 +2765,56 @@ uint32_t getProtection(uintptr_t addr) return ret; } +uint32_t getProtection_fast(uintptr_t addr) +{ + LOCK_PROT_FAST(); + uint32_t ret = rb_get(memprot, addr); + UNLOCK_PROT_FAST(); + return ret; +} + int getMmapped(uintptr_t addr) { - return rb_get(mmapmem, addr); + return (rb_get(mapallmem, addr)&MEM_ALLOCATED); // will be ok for both MEM_ALLOCATED & MEM_MMAP +} + +int memExist(uintptr_t addr) +{ + return rb_get(mapallmem, addr); } #define LOWEST (void*)0x10000 +#define WINE_LOWEST (void*)0x30000000 #define MEDIUM (void*)0x40000000 #define HIGH (void*)0x60000000 -void* find31bitBlockNearHint(void* hint, size_t size, uintptr_t mask) +void* find31bitBlockNearHint(void* hint_, size_t size, uintptr_t mask) { + // first, check if program break as changed + if(pbrk && cur_brk && *cur_brk!=old_brk) { + old_brk = *cur_brk; + setProtection(pbrk, old_brk-pbrk, PROT_READ|PROT_WRITE); + } uint32_t prot; - if(hintupper) upper = 0x100000000LL; if(!mask) mask = 0xffff; - while(bend<0xc0000000LL) { + while(cur=size) + return (void*)cur; + } + // granularity 0x10000 + cur = (bend+mask)&~mask; + } + if(hint_) + return NULL; + cur = (uintptr_t)LOWEST; + while(cur<(uintptr_t)hint) { if(!rb_get_end(mapallmem, cur, &prot, &bend)) { if(bend-cur>=size) return (void*)cur; @@ -1387,17 +2831,24 @@ void* find32bitBlock(size_t size) if(ret) return ret; ret = find31bitBlockNearHint(LOWEST, size, 0); - return ret?ret:find47bitBlock(size); + return ret; } void* find47bitBlock(size_t size) { void* ret = find47bitBlockNearHint(HIGH, size, 0); if(!ret) - ret = find32bitBlock(size); + ret = find31bitBlockNearHint(MEDIUM, size, 0); + if(!ret) + ret = find31bitBlockNearHint(LOWEST, size, 0); return ret; } void* find47bitBlockNearHint(void* hint, size_t size, uintptr_t mask) { + // first, check if program break as changed + if(pbrk && cur_brk && *cur_brk!=old_brk) { + old_brk = *cur_brk; + setProtection(pbrk, old_brk-pbrk, PROT_READ|PROT_WRITE); + } uint32_t prot; if(hint%p (%zx)\n", (void*)(0x100000000LL-65536), cur, 65536); + if(cur!=(void*)(0x100000000LL-65536)) + InternalMunmap(cur, 65536); + else + munmap(cur, 65536); + } +} +#ifdef BOX32 +void reverveHigMem32(void) +{ + loadProtectionFromMap(); + uintptr_t cur_size = 1024LL*1024*1024*1024; // start with 1TB check + void* cur; + while(cur_size>=65536) { + cur = InternalMmap(NULL, cur_size, 0, MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE, -1, 0); + if((cur==MAP_FAILED) || (cur<(void*)0x100000000LL)) { + if(cur!=MAP_FAILED) { + //printf_log(LOG_INFO, " Failed to reserve high %p (%zx)\n", cur, cur_size); + InternalMunmap(cur, cur_size); + } //else + //printf_log(LOG_INFO, " Failed to reserve %zx sized block\n", cur_size); + cur_size>>=1; + } else { + rb_set(mapallmem, (uintptr_t)cur, (uintptr_t)cur+cur_size, MEM_RESERVED); + //printf_log(LOG_INFO, "Reserved high %p (%zx)\n", cur, cur_size); + } + } + printf_log(LOG_INFO, "Memory higher than 32bits reserved\n"); + if (BOX64ENV(log)>=LOG_DEBUG) { + uintptr_t start=0x100000000LL; + uint32_t prot; + uintptr_t bend = start; + while (bend!=0xffffffffffffffffLL) { + if(rb_get_end(mapallmem, start, &prot, &bend)) { + printf_log(LOG_NONE, " Reserved: %p - %p (%u)\n", (void*)start, (void*)bend, prot); + } + start = bend; + } + } + PersonalityAddrLimit32Bit(); +} +#endif void my_reserveHighMem() { static int reserved = 0; - if(reserved || !have48bits) + if(reserved || (!have48bits && !box64_is32bits)) return; reserved = 1; - uintptr_t cur = 1ULL<<47; + #ifdef BOX32 + if(box64_is32bits) { + reverveHigMem32(); + return; + } + #endif + uintptr_t cur = box64_is32bits?(1ULL<<32):(1ULL<<47); uintptr_t bend = 0; uint32_t prot; while (bend!=0xffffffffffffffffLL) { if(!rb_get_end(mapallmem, cur, &prot, &bend)) { - void* ret = internal_mmap((void*)cur, bend-cur, 0, MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE|MAP_NORESERVE, -1, 0); - printf_log(LOG_DEBUG, "Reserve %p-%p => %p (%s)\n", (void*)cur, bend, ret, strerror(errno)); - printf_log(LOG_DEBUG, "mmap %p-%p\n", cur, bend); + // create a border at 39bits... + if(cur<(1ULL<<39) && bend>(1ULL<<39)) + bend = 1ULL<<39; + // create a border at 47bits + if(cur<(1ULL<<47) && bend>(1ULL<<47)) + bend = 1ULL<<47; + // create a border at 48bits + if(cur<(1ULL<<48) && bend>(1ULL<<48)) + bend = 1ULL<<48; + void* ret = InternalMmap((void*)cur, bend - cur, 0, MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE, -1, 0); + printf_log(LOG_DEBUG, "Reserve %p-%p => %p (%s)\n", (void*)cur, bend, ret, (ret==MAP_FAILED)?strerror(errno):"ok"); if(ret!=(void*)-1) { - rb_set(mapallmem, cur, bend, 1); + rb_set(mapallmem, cur, bend, MEM_RESERVED); } } cur = bend; @@ -1524,13 +3029,8 @@ void my_reserveHighMem() void reserveHighMem() { - char* p = getenv("BOX64_RESERVE_HIGH"); - #if 0//def ADLINK - if(p && p[0]=='0') - #else - if(!p || p[0]=='0') - #endif - return; // don't reserve by default + if(!box64_is32bits && !BOX64ENV(reserve_high)) + return; // don't reserve by default on 64bits my_reserveHighMem(); } @@ -1540,19 +3040,32 @@ void init_custommem_helper(box64context_t* ctx) if(inited) // already initialized return; inited = 1; - memprot = init_rbtree(); - sigfillset(&critical_prot); + + cur_brk = dlsym(RTLD_NEXT, "__curbrk"); init_mutexes(); + blockstree = rbtree_init("blockstree"); + // if there is some blocks already + if(n_blocks) + for(int i=0; ichunks[i].block) - #ifdef USE_MMAP - internal_munmap(head->chunks[i].block, head->chunks[i].size); - #else - box_free(head->chunks[i].block); - #endif + if(head) { + for (int i=0; isize; ++i) { + InternalMunmap(head->chunks[i]->block-sizeof(blocklist_t), head->chunks[i]->size+sizeof(blocklist_t)); } - mmaplist_t *old = head; - head = head->next; - free(old); + free(head); } - box_free(mmaplist); #ifdef JMPTABL_SHIFT4 uintptr_t**** box64_jmptbl3; @@ -1646,34 +3151,40 @@ void fini_custommem_helper(box64context_t *ctx) } customFree(box64_jmptbl3[i3][i2]); } - customFree(box64_jmptbl3[i3]); + #ifndef JMPTABL_SHIFT4 + if(i3) + #endif + customFree(box64_jmptbl3[i3]); } #ifdef JMPTABL_SHIFT4 - customFree(box64_jmptbl4[i4]); + if(i4) + customFree(box64_jmptbl4[i4]); } #endif } kh_destroy(lockaddress, lockaddress); lockaddress = NULL; + rbtree_delete(rbt_dynmem); + rbt_dynmem = NULL; #endif - delete_rbtree(memprot); + rbtree_delete(memprot); memprot = NULL; - delete_rbtree(mmapmem); - mmapmem = NULL; - delete_rbtree(mapallmem); + rbtree_delete(mapallmem); mapallmem = NULL; + rbtree_delete(blockstree); + blockstree = NULL; for(int i=0; i=start && addr<=end) + ++n; + ); + return n; +} +void getLockAddressRange(uintptr_t start, size_t size, uintptr_t addrs[]) +{ + int n = 0; + uintptr_t end = start + size -1; + uintptr_t addr; + kh_foreach_key(lockaddress, addr, + if(addr>=start && addr<=end) + addrs[n++] = addr; + ); +} #endif -void* internal_mmap(void *addr, unsigned long length, int prot, int flags, int fd, ssize_t offset) -{ - #if 1//def STATICBUILD - void* ret = (void*)syscall(__NR_mmap, addr, length, prot, flags, fd, offset); - #else - static int grab = 1; - typedef void*(*pFpLiiiL_t)(void*, unsigned long, int, int, int, size_t); - static pFpLiiiL_t libc_mmap64 = NULL; - if(grab) { - libc_mmap64 = dlsym(RTLD_NEXT, "mmap64"); +#ifndef MAP_FIXED_NOREPLACE +#define MAP_FIXED_NOREPLACE 0x200000 +#endif +#ifndef MAP_32BIT +#define MAP_32BIT 0x40 +#endif +EXPORT void* box_mmap(void *addr, size_t length, int prot, int flags, int fd, ssize_t offset) +{ + if(prot&PROT_WRITE) + prot|=PROT_READ; // PROT_READ is implicit with PROT_WRITE on i386 + int new_flags = flags; + void* old_addr = addr; + #ifndef NOALIGN + new_flags&=~MAP_32BIT; // remove MAP_32BIT + if((flags&MAP_32BIT) && !(flags&MAP_FIXED)) { + // MAP_32BIT only exist on x86_64! + addr = find31bitBlockNearHint(old_addr, length, 0); + } else if (box64_wine || 1) { // other mmap should be restricted to 47bits + if (!(flags&MAP_FIXED) && !addr) + addr = find47bitBlock(length); + } + #endif + void* ret = InternalMmap(addr, length, prot, new_flags, fd, offset); +#if !defined(NOALIGN) + if((ret!=MAP_FAILED) && (flags&MAP_32BIT) && + (((uintptr_t)ret>0xffffffffLL) || ((box64_wine) && ((uintptr_t)ret&0xffff) && (ret!=addr)))) { + int olderr = errno; + InternalMunmap(ret, length); + loadProtectionFromMap(); // reload map, because something went wrong previously + addr = find31bitBlockNearHint(old_addr, length, 0); // is this the best way? + new_flags = (addr && isBlockFree(addr, length) )? (new_flags|MAP_FIXED) : new_flags; + if((new_flags&(MAP_FIXED|MAP_FIXED_NOREPLACE))==(MAP_FIXED|MAP_FIXED_NOREPLACE)) new_flags&=~MAP_FIXED_NOREPLACE; + ret = InternalMmap(addr, length, prot, new_flags, fd, offset); + if(old_addr && ret!=old_addr && ret!=MAP_FAILED) + errno = olderr; + } else if((ret!=MAP_FAILED) && !(flags&MAP_FIXED) && ((box64_wine)) && (addr && (addr!=ret)) && + (((uintptr_t)ret>0x7fffffffffffLL) || ((uintptr_t)ret&~0xffff))) { + int olderr = errno; + InternalMunmap(ret, length); + loadProtectionFromMap(); // reload map, because something went wrong previously + addr = find47bitBlockNearHint(old_addr, length, 0); // is this the best way? + new_flags = (addr && isBlockFree(addr, length)) ? (new_flags|MAP_FIXED) : new_flags; + if((new_flags&(MAP_FIXED|MAP_FIXED_NOREPLACE))==(MAP_FIXED|MAP_FIXED_NOREPLACE)) new_flags&=~MAP_FIXED_NOREPLACE; + ret = InternalMmap(addr, length, prot, new_flags, fd, offset); + if(old_addr && ret!=old_addr && ret!=MAP_FAILED) { + errno = olderr; + if(old_addr>(void*)0x7fffffffff && !have48bits) + errno = EEXIST; + } } - void* ret = libc_mmap64(addr, length, prot, flags, fd, offset); #endif return ret; } -int internal_munmap(void* addr, unsigned long length) + +EXPORT int box_munmap(void* addr, size_t length) { - #if 1//def STATICBUILD - int ret = syscall(__NR_munmap, addr, length); - #else - static int grab = 1; - typedef int(*iFpL_t)(void*, unsigned long); - static iFpL_t libc_munmap = NULL; - if(grab) { - libc_munmap = dlsym(RTLD_NEXT, "munmap"); - } - int ret = libc_munmap(addr, length); - #endif + int ret = InternalMunmap(addr, length); return ret; } diff --git a/src/custommmap.c b/src/custommmap.c index 9317309..45e88fb 100644 --- a/src/custommmap.c +++ b/src/custommmap.c @@ -2,6 +2,8 @@ #include #include +#include "env.h" + #ifndef MAP_FAILED #define MAP_FAILED ((void *) -1) #endif @@ -13,25 +15,31 @@ #define EXPORTDYN #endif +#ifndef MAP_32BIT +#define MAP_32BIT 0x40 +#endif + typedef void x64emu_t; extern void* mapallmem; +extern int box64_is32bits; void setProtection(uintptr_t addr, size_t size, uint32_t prot); void freeProtection(uintptr_t addr, size_t size); -void* internal_mmap(void *addr, unsigned long length, int prot, int flags, int fd, ssize_t offset); -int internal_munmap(void* addr, unsigned long length); +void* InternalMmap(void* addr, unsigned long length, int prot, int flags, int fd, ssize_t offset); +int InternalMunmap(void* addr, unsigned long length); +void* box_mmap(void *addr, unsigned long length, int prot, int flags, int fd, ssize_t offset); void* my_mmap64(x64emu_t* emu, void *addr, unsigned long length, int prot, int flags, int fd, ssize_t offset); extern int running32bits; -extern int box64_mmap32; +extern box64env_t box64env; EXPORT void* mmap64(void *addr, unsigned long length, int prot, int flags, int fd, ssize_t offset) { void* ret; - if(!addr && ((running32bits && box64_mmap32) || (flags&0x40))) - ret = my_mmap64(NULL, addr, length, prot, flags | 0x40, fd, offset); + if(!addr && ((running32bits && BOX64ENV(mmap32)) || (flags&MAP_32BIT) || box64_is32bits)) + ret = box_mmap(addr, length, prot, flags | MAP_32BIT, fd, offset); else - ret = internal_mmap(addr, length, prot, flags, fd, offset); + ret = InternalMmap(addr, length, prot, flags, fd, offset); if(ret!=MAP_FAILED && mapallmem) setProtection((uintptr_t)ret, length, prot); return ret; @@ -40,7 +48,7 @@ EXPORT void* mmap(void *addr, unsigned long length, int prot, int flags, int fd, EXPORT int munmap(void* addr, unsigned long length) { - int ret = internal_munmap(addr, length); + int ret = InternalMunmap(addr, length); if(!ret && mapallmem) { freeProtection((uintptr_t)addr, length); } diff --git a/src/dynarec/arm64/arm64_emitter.h b/src/dynarec/arm64/arm64_emitter.h index 0070af3..63fcabf 100644 --- a/src/dynarec/arm64/arm64_emitter.h +++ b/src/dynarec/arm64/arm64_emitter.h @@ -5,140 +5,7 @@ */ -/* - ARM64 Linux Call Convention - -SP The Stack Pointer. -r30 LR The Link Register. -r29 FP The Frame Pointer -r19…r28 Callee-saved registers -r18 The Platform Register, if needed; otherwise a temporary register. See notes. -r17 IP1 The second intra-procedure-call temporary register (can be used by call veneers and PLT code); at other times may be used as a temporary register. -r16 IP0 The first intra-procedure-call scratch register (can be used by call veneers and PLT code); at other times may be used as a temporary register. -r9…r15 Temporary registers -r8 Indirect result location register -r0…r7 Parameter/result registers - -For SIMD: -The first eight registers, v0-v7, are used to pass argument values into a subroutine and to return result values from a function. - They may also be used to hold intermediate values within a routine (but, in general, only between subroutine calls). - -Registers v8-v15 must be preserved by a callee across subroutine calls; - the remaining registers (v0-v7, v16-v31) do not need to be preserved (or should be preserved by the caller). - Additionally, only the bottom 64 bits of each value stored in v8-v15 need to be preserved [8]; - it is the responsibility of the caller to preserve larger values. - -For SVE: -z0-z7 are used to pass scalable vector arguments to a subroutine, and to return scalable vector results from a function. - If a subroutine takes at least one argument in scalable vector registers or scalable predicate registers, - or returns results in such regisers, the subroutine must ensure that the entire contents of z8-z23 are preserved across the call. - In other cases it need only preserve the low 64 bits of z8-z15, as described in SIMD and Floating-Point registers. -p0-p3 are used to pass scalable predicate arguments to a subroutine and to return scalable predicate results from a function. - If a subroutine takes at least one argument in scalable vector registers or scalable predicate registers, - or returns results in such registers, the subroutine must ensure that p4-p15 are preserved across the call. - In other cases it need not preserve any scalable predicate register contents. - -*/ - -// x86 Register mapping -#define xRAX 10 -#define xRCX 11 -#define xRDX 12 -#define xRBX 13 -#define xRSP 14 -#define xRBP 15 -#define xRSI 16 -#define xRDI 17 -#define xR8 18 -#define xR9 19 -#define xR10 20 -#define xR11 21 -#define xR12 22 -#define xR13 23 -#define xR14 24 -#define xR15 25 -#define xFlags 26 -#define xRIP 27 -#define xSavedSP 28 -// 32bits version -#define wEAX xRAX -#define wECX xRCX -#define wEDX xRDX -#define wEBX xRBX -#define wESP xRSP -#define wEBP xRBP -#define wESI xRSI -#define wEDI xRDI -#define wR8 xR8 -#define wR9 xR9 -#define wR10 xR10 -#define wR11 xR11 -#define wR12 xR12 -#define wR13 xR13 -#define wR14 xR14 -#define wR15 xR15 -#define wFlags xFlags -// scratch registers -#define x1 1 -#define x2 2 -#define x3 3 -#define x4 4 -#define x5 5 -#define x6 6 -#define x7 7 -// 32bits version of scratch -#define w1 x1 -#define w2 x2 -#define w3 x3 -#define w4 x4 -#define w5 x5 -#define w6 x6 -#define w7 x7 -// emu is r0 -#define xEmu 0 -// ARM64 LR -#define xLR 30 -// ARM64 SP is r31 but is a special register -#define xSP 31 -// xZR regs is 31 -#define xZR 31 -#define wZR xZR - -// conditions -// Z == 1 -#define cEQ 0b0000 -// Z != 1 -#define cNE 0b0001 -// C == 1 -#define cCS 0b0010 -// C == 1 -#define cHS cCS -// C != 1 -#define cCC 0b0011 -// C != 1 -#define cLO cCC -// N == 1 -#define cMI 0b0100 -// N != 1 -#define cPL 0b0101 -// V == 1 -#define cVS 0b0110 -// V != 1 -#define cVC 0b0111 -// C == 1 && Z == 0 -#define cHI 0b1000 -// C !=1 || Z == 1 -#define cLS 0b1001 -// N == V -#define cGE 0b1010 -// N != V -#define cLT 0b1011 -// N == V && Z == 0 -#define cGT 0b1100 -// N != V || Z == 1 -#define cLE 0b1101 -// always -#define c__ 0b1110 +#include "arm64_mapping.h" int convert_bitmask(uint64_t bitmask); #define convert_bitmask_w(A) convert_bitmask(((uint64_t)(A) << 32) + (uint32_t)(A)) @@ -173,43 +40,62 @@ int convert_bitmask(uint64_t bitmask); #define MOV64xw(Rd, imm64) if(rex.w) {MOV64x(Rd, imm64);} else {MOV32w(Rd, imm64);} #define MOV64z(Rd, imm64) if(rex.is32bits) {MOV32w(Rd, imm64);} else {MOV64x(Rd, imm64);} +#define MOV64y(Rd, imm64) if(rex.is32bits || rex.is67) {MOV32w(Rd, imm64);} else {MOV64x(Rd, imm64);} // ADD / SUB #define ADDSUB_REG_gen(sf, op, S, shift, Rm, imm6, Rn, Rd) ((sf)<<31 | (op)<<30 | (S)<<29 | 0b01011<<24 | (shift)<<22 | (Rm)<<16 | (imm6)<<10 | (Rn)<<5 | (Rd)) #define ADDx_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(1, 0, 0, 0b00, Rm, 0, Rn, Rd)) -#define ADDSx_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(1, 0, 1, 0b00, Rm, 0, Rn, Rd)) +#define ADDSx_REG(Rd, Rn, Rm) FEMIT(ADDSUB_REG_gen(1, 0, 1, 0b00, Rm, 0, Rn, Rd)) #define ADDx_REG_LSL(Rd, Rn, Rm, lsl) EMIT(ADDSUB_REG_gen(1, 0, 0, 0b00, Rm, lsl, Rn, Rd)) +#define ADDx_REG_LSR(Rd, Rn, Rm, lsr) EMIT(ADDSUB_REG_gen(1, 0, 0, 0b01, Rm, lsr, Rn, Rd)) +#define ADDz_REG_LSL(Rd, Rn, Rm, lsl) EMIT(ADDSUB_REG_gen((rex.is32bits)?0:1, 0, 0, 0b00, Rm, lsl, Rn, Rd)) +#define ADDy_REG_LSL(Rd, Rn, Rm, lsl) EMIT(ADDSUB_REG_gen((rex.is32bits || rex.is67)?0:1, 0, 0, 0b00, Rm, lsl, Rn, Rd)) #define ADDw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(0, 0, 0, 0b00, Rm, 0, Rn, Rd)) -#define ADDSw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(0, 0, 1, 0b00, Rm, 0, Rn, Rd)) +#define ADDSw_REG(Rd, Rn, Rm) FEMIT(ADDSUB_REG_gen(0, 0, 1, 0b00, Rm, 0, Rn, Rd)) #define ADDw_REG_LSL(Rd, Rn, Rm, lsl) EMIT(ADDSUB_REG_gen(0, 0, 0, 0b00, Rm, lsl, Rn, Rd)) +#define ADDw_REG_LSR(Rd, Rn, Rm, lsr) EMIT(ADDSUB_REG_gen(0, 0, 0, 0b01, Rm, lsr, Rn, Rd)) +#define ADDSw_REG_LSL(Rd, Rn, Rm, lsl) FEMIT(ADDSUB_REG_gen(0, 0, 1, 0b00, Rm, lsl, Rn, Rd)) #define ADDxw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(rex.w, 0, 0, 0b00, Rm, 0, Rn, Rd)) -#define ADDz_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(rex.is32bits?0:1, 0, 0, 0b00, Rm, 0, Rn, Rd)) -#define ADDSxw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(rex.w, 0, 1, 0b00, Rm, 0, Rn, Rd)) +#define ADDz_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen((rex.is32bits)?0:1, 0, 0, 0b00, Rm, 0, Rn, Rd)) +#define ADDy_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen((rex.is32bits || rex.is67)?0:1, 0, 0, 0b00, Rm, 0, Rn, Rd)) +#define ADDSxw_REG(Rd, Rn, Rm) FEMIT(ADDSUB_REG_gen(rex.w, 0, 1, 0b00, Rm, 0, Rn, Rd)) #define ADDxw_REG_LSR(Rd, Rn, Rm, lsr) EMIT(ADDSUB_REG_gen(rex.w, 0, 0, 0b01, Rm, lsr, Rn, Rd)) #define ADDSUB_IMM_gen(sf, op, S, shift, imm12, Rn, Rd) ((sf)<<31 | (op)<<30 | (S)<<29 | 0b10001<<24 | (shift)<<22 | (imm12)<<10 | (Rn)<<5 | (Rd)) #define ADDx_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(1, 0, 0, 0b00, (imm12)&0xfff, Rn, Rd)) -#define ADDSx_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(1, 0, 1, 0b00, (imm12)&0xfff, Rn, Rd)) +#define ADDSx_U12(Rd, Rn, imm12) FEMIT(ADDSUB_IMM_gen(1, 0, 1, 0b00, (imm12)&0xfff, Rn, Rd)) #define ADDw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(0, 0, 0, 0b00, (imm12)&0xfff, Rn, Rd)) -#define ADDSw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(0, 0, 1, 0b00, (imm12)&0xfff, Rn, Rd)) +#define ADDSw_U12(Rd, Rn, imm12) FEMIT(ADDSUB_IMM_gen(0, 0, 1, 0b00, (imm12)&0xfff, Rn, Rd)) #define ADDxw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(rex.w, 0, 0, 0b00, (imm12)&0xfff, Rn, Rd)) -#define ADDSxw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(rex.w, 0, 1, 0b00, (imm12)&0xfff, Rn, Rd)) -#define ADDz_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(rex.is32bits?0:1, 0, 0, 0b00, (imm12)&0xfff, Rn, Rd)) +#define ADDSxw_U12(Rd, Rn, imm12) FEMIT(ADDSUB_IMM_gen(rex.w, 0, 1, 0b00, (imm12)&0xfff, Rn, Rd)) +#define ADDz_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen((rex.is32bits)?0:1, 0, 0, 0b00, (imm12)&0xfff, Rn, Rd)) +#define ADDy_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen((rex.is32bits || rex.is67)?0:1, 0, 0, 0b00, (imm12)&0xfff, Rn, Rd)) #define SUBx_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(1, 1, 0, 0b00, Rm, 0, Rn, Rd)) -#define SUBSx_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(1, 1, 1, 0b00, Rm, 0, Rn, Rd)) +#define SUBSx_REG(Rd, Rn, Rm) FEMIT(ADDSUB_REG_gen(1, 1, 1, 0b00, Rm, 0, Rn, Rd)) +#define SUBSx_REG_ASR(Rd, Rn, Rm, asr) FEMIT(ADDSUB_REG_gen(1, 1, 1, 0b10, Rm, asr, Rn, Rd)) #define SUBx_REG_LSL(Rd, Rn, Rm, lsl) EMIT(ADDSUB_REG_gen(1, 1, 0, 0b00, Rm, lsl, Rn, Rd)) #define SUBw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(0, 1, 0, 0b00, Rm, 0, Rn, Rd)) #define SUBw_REG_LSL(Rd, Rn, Rm, lsl) EMIT(ADDSUB_REG_gen(0, 1, 0, 0b00, Rm, lsl, Rn, Rd)) -#define SUBSw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(0, 1, 1, 0b00, Rm, 0, Rn, Rd)) -#define SUBSw_REG_LSL(Rd, Rn, Rm, lsl) EMIT(ADDSUB_REG_gen(0, 1, 1, 0b00, Rm, lsl, Rn, Rd)) +#define SUBw_REG_ASR(Rd, Rn, Rm, asr) EMIT(ADDSUB_REG_gen(0, 1, 0, 0b10, Rm, asr, Rn, Rd)) +#define SUBx_REG_ASR(Rd, Rn, Rm, asr) EMIT(ADDSUB_REG_gen(1, 1, 0, 0b10, Rm, asr, Rn, Rd)) +#define SUBSw_REG(Rd, Rn, Rm) FEMIT(ADDSUB_REG_gen(0, 1, 1, 0b00, Rm, 0, Rn, Rd)) +#define SUBSw_REG_LSL(Rd, Rn, Rm, lsl) FEMIT(ADDSUB_REG_gen(0, 1, 1, 0b00, Rm, lsl, Rn, Rd)) +#define SUBSw_REG_LSR(Rd, Rn, Rm, lsr) FEMIT(ADDSUB_REG_gen(0, 1, 1, 0b01, Rm, lsr, Rn, Rd)) +#define SUBSw_REG_ASR(Rd, Rn, Rm, asr) FEMIT(ADDSUB_REG_gen(0, 1, 1, 0b10, Rm, asr, Rn, Rd)) #define SUBxw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(rex.w, 1, 0, 0b00, Rm, 0, Rn, Rd)) #define SUBz_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(rex.is32bits?0:1, 1, 0, 0b00, Rm, 0, Rn, Rd)) -#define SUBSxw_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen(rex.w, 1, 1, 0b00, Rm, 0, Rn, Rd)) +#define SUBy_REG(Rd, Rn, Rm) EMIT(ADDSUB_REG_gen((rex.is32bits || rex.is67)?0:1, 1, 0, 0b00, Rm, 0, Rn, Rd)) +#define SUBSxw_REG(Rd, Rn, Rm) FEMIT(ADDSUB_REG_gen(rex.w, 1, 1, 0b00, Rm, 0, Rn, Rd)) +#define SUBSxw_REG_ASR(Rd, Rn, Rm, asr) FEMIT(ADDSUB_REG_gen(rex.w, 1, 1, 0b10, Rm, asr, Rn, Rd)) #define CMPSx_REG(Rn, Rm) SUBSx_REG(xZR, Rn, Rm) +#define CMPSx_REG_ASR(Rn, Rm, asr) SUBSx_REG_ASR(xZR, Rn, Rm, asr) #define CMPSw_REG(Rn, Rm) SUBSw_REG(wZR, Rn, Rm) +#define CMPSw_REG_LSR(Rn, Rm, lsr) SUBSw_REG_LSR(wZR, Rn, Rm, lsr) +#define CMPSw_REG_ASR(Rn, Rm, asr) SUBSw_REG_ASR(wZR, Rn, Rm, asr) #define CMPSxw_REG(Rn, Rm) SUBSxw_REG(xZR, Rn, Rm) +#define CMPSxw_REG_ASR(Rn, Rm, asr) SUBSxw_REG_ASR(xZR, Rn, Rm, asr) #define NEGx_REG(Rd, Rm) SUBx_REG(Rd, xZR, Rm); #define NEGw_REG(Rd, Rm) SUBw_REG(Rd, wZR, Rm); #define NEGxw_REG(Rd, Rm) SUBxw_REG(Rd, xZR, Rm); @@ -218,12 +104,13 @@ int convert_bitmask(uint64_t bitmask); #define NEGSxw_REG(Rd, Rm) SUBSxw_REG(Rd, xZR, Rm); #define SUBx_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(1, 1, 0, 0b00, (imm12)&0xfff, Rn, Rd)) -#define SUBSx_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(1, 1, 1, 0b00, (imm12)&0xfff, Rn, Rd)) +#define SUBSx_U12(Rd, Rn, imm12) FEMIT(ADDSUB_IMM_gen(1, 1, 1, 0b00, (imm12)&0xfff, Rn, Rd)) #define SUBw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(0, 1, 0, 0b00, (imm12)&0xfff, Rn, Rd)) -#define SUBSw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(0, 1, 1, 0b00, (imm12)&0xfff, Rn, Rd)) +#define SUBSw_U12(Rd, Rn, imm12) FEMIT(ADDSUB_IMM_gen(0, 1, 1, 0b00, (imm12)&0xfff, Rn, Rd)) #define SUBxw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(rex.w, 1, 0, 0b00, (imm12)&0xfff, Rn, Rd)) #define SUBz_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(rex.is32bits?0:1, 1, 0, 0b00, (imm12)&0xfff, Rn, Rd)) -#define SUBSxw_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen(rex.w, 1, 1, 0b00, (imm12)&0xfff, Rn, Rd)) +#define SUBy_U12(Rd, Rn, imm12) EMIT(ADDSUB_IMM_gen((rex.is32bits || rex.is67)?0:1, 1, 0, 0b00, (imm12)&0xfff, Rn, Rd)) +#define SUBSxw_U12(Rd, Rn, imm12) FEMIT(ADDSUB_IMM_gen(rex.w, 1, 1, 0b00, (imm12)&0xfff, Rn, Rd)) #define CMPSx_U12(Rn, imm12) SUBSx_U12(xZR, Rn, imm12) #define CMPSw_U12(Rn, imm12) SUBSw_U12(wZR, Rn, imm12) #define CMPSxw_U12(Rn, imm12) SUBSxw_U12(xZR, Rn, imm12) @@ -235,18 +122,32 @@ int convert_bitmask(uint64_t bitmask); #define SBCx_REG(Rd, Rn, Rm) EMIT(ADDSUBC_gen(1, 1, 0, Rm, Rn, Rd)) #define SBCw_REG(Rd, Rn, Rm) EMIT(ADDSUBC_gen(0, 1, 0, Rm, Rn, Rd)) #define SBCxw_REG(Rd, Rn, Rm) EMIT(ADDSUBC_gen(rex.w, 1, 0, Rm, Rn, Rd)) -#define ADCSx_REG(Rd, Rn, Rm) EMIT(ADDSUBC_gen(1, 0, 1, Rm, Rn, Rd)) -#define ADCSw_REG(Rd, Rn, Rm) EMIT(ADDSUBC_gen(0, 0, 1, Rm, Rn, Rd)) -#define ADCSxw_REG(Rd, Rn, Rm) EMIT(ADDSUBC_gen(rex.w, 0, 1, Rm, Rn, Rd)) -#define SBCSx_REG(Rd, Rn, Rm) EMIT(ADDSUBC_gen(1, 1, 1, Rm, Rn, Rd)) -#define SBCSw_REG(Rd, Rn, Rm) EMIT(ADDSUBC_gen(0, 1, 1, Rm, Rn, Rd)) -#define SBCSxw_REG(Rd, Rn, Rm) EMIT(ADDSUBC_gen(rex.w, 1, 1, Rm, Rn, Rd)) +#define ADCSx_REG(Rd, Rn, Rm) FEMIT(ADDSUBC_gen(1, 0, 1, Rm, Rn, Rd)) +#define ADCSw_REG(Rd, Rn, Rm) FEMIT(ADDSUBC_gen(0, 0, 1, Rm, Rn, Rd)) +#define ADCSxw_REG(Rd, Rn, Rm) FEMIT(ADDSUBC_gen(rex.w, 0, 1, Rm, Rn, Rd)) +#define SBCSx_REG(Rd, Rn, Rm) FEMIT(ADDSUBC_gen(1, 1, 1, Rm, Rn, Rd)) +#define SBCSw_REG(Rd, Rn, Rm) FEMIT(ADDSUBC_gen(0, 1, 1, Rm, Rn, Rd)) +#define SBCSxw_REG(Rd, Rn, Rm) FEMIT(ADDSUBC_gen(rex.w, 1, 1, Rm, Rn, Rd)) + +#define ADDSUB_ext(sf, op, S, Rm, option, imm3, Rn, Rd) ((sf)<<31 | (op)<<30 | (S)<<29 | 0b01011<<24 | 1<<21 | (Rm)<<16 | (option)<<13 | (imm3)<<10 | (Rn)<<5 | (Rd)) +#define SUBxw_UXTB(Rd, Rn, Rm) EMIT(ADDSUB_ext(rex.w, 1, 0, Rm, 0b000, 0, Rn, Rd)) +#define SUBw_UXTB(Rd, Rn, Rm) EMIT(ADDSUB_ext(0, 1, 0, Rm, 0b000, 0, Rn, Rd)) +#define SUBw_SXTB(Rd, Rn, Rm) EMIT(ADDSUB_ext(0, 1, 0, Rm, 0b100, 0, Rn, Rd)) +#define SUBw_UXTH(Rd, Rn, Rm) EMIT(ADDSUB_ext(0, 1, 0, Rm, 0b001, 0, Rn, Rd)) +#define SUBx_UXTW(Rd, Rn, Rm) EMIT(ADDSUB_ext(1, 1, 0, Rm, 0b010, 0, Rn, Rd)) +#define SUBw_SXTH(Rd, Rn, Rm) EMIT(ADDSUB_ext(0, 1, 0, Rm, 0b101, 0, Rn, Rd)) +#define SUBx_SXTW(Rd, Rn, Rm) EMIT(ADDSUB_ext(1, 1, 0, Rm, 0b110, 0, Rn, Rd)) +#define ADDz_UXTB(Rd, Rn, Rm) EMIT(ADDSUB_ext(rex.is32bits?0:1, 0, 0, Rm, 0b000, 0, Rn, Rd)) +#define ADDw_UXTH(Rd, Rn, Rm) EMIT(ADDSUB_ext(0, 0, 0, Rm, 0b001, 0, Rn, Rd)) +#define ADDx_UXTW(Rd, Rn, Rm) EMIT(ADDSUB_ext(1, 0, 0, Rm, 0b010, 0, Rn, Rd)) +#define ADDx_SXTW(Rd, Rn, Rm) EMIT(ADDSUB_ext(1, 0, 0, Rm, 0b110, 0, Rn, Rd)) +#define ADDx_REGy(Rd, Rn, Rm) do {if(rex.is32bits || rex.is67) ADDx_SXTW(Rd, Rn, Rm); else ADDx_REG(Rd, Rn, Rm); } while(0) // CCMP compare if cond is true, set nzcv if false #define CCMP_reg(sf, Rm, cond, Rn, nzcv) ((sf)<<31 | 1<<30 | 1<<29 | 0b11010010<<21 | (Rm)<<16 | (cond)<<12 | (Rn)<<5 | (nzcv)) -#define CCMPw(Wn, Wm, nzcv, cond) EMIT(CCMP_reg(0, Wm, cond, Wn, nzcv)) -#define CCMPx(Xn, Xm, nzcv, cond) EMIT(CCMP_reg(1, Xm, cond, Xn, nzcv)) -#define CCMPxw(Xn, Xm, nzcv, cond) EMIT(CCMP_reg(rex.w, Xm, cond, Xn, nzcv)) +#define CCMPw(Wn, Wm, nzcv, cond) FEMIT(CCMP_reg(0, Wm, cond, Wn, nzcv)) +#define CCMPx(Xn, Xm, nzcv, cond) FEMIT(CCMP_reg(1, Xm, cond, Xn, nzcv)) +#define CCMPxw(Xn, Xm, nzcv, cond) FEMIT(CCMP_reg(rex.w, Xm, cond, Xn, nzcv)) // ADR #define ADR_gen(immlo, immhi, Rd) ((immlo)<<29 | 0b10000<<24 | (immhi)<<5 | (Rd)) @@ -263,6 +164,7 @@ int convert_bitmask(uint64_t bitmask); #define LDRH_S9_postindex(Rt, Rn, imm9) EMIT(LDR_gen(0b01, 0b00, (imm9)&0x1ff, 0b01, Rn, Rt)) #define LDRH_S9_preindex(Rt, Rn, imm9) EMIT(LDR_gen(0b01, 0b00, (imm9)&0x1ff, 0b11, Rn, Rt)) #define LDRxw_S9_postindex(Rt, Rn, imm9) EMIT(LDR_gen(rex.w?0b11:0b10, 0b00, (imm9)&0x1ff, 0b01, Rn, Rt)) +#define LDRz_S9_preindex(Rt, Rn, imm9) EMIT(LDR_gen(rex.is32bits?0b10:0b11, 0b00, (imm9)&0x1ff, 0b11, Rn, Rt)) #define LDRS_gen(size, op1, imm9, op2, Rn, Rt) ((size)<<30 | 0b111<<27 | (op1)<<24 | 0b10<<22 | (imm9)<<12 | (op2)<<10 | (Rn)<<5 | (Rt)) #define LDRSW_S9_postindex(Rt, Rn, imm9) EMIT(LDRS_gen(0b10, 0b00, (imm9)&0x1ff, 0b01, Rn, Rt)) @@ -278,18 +180,24 @@ int convert_bitmask(uint64_t bitmask); #define LDS_gen(size, op1, imm12, Rn, Rt) ((size)<<30 | 0b111<<27 | (op1)<<24 | 0b10<<22 | (imm12)<<10 | (Rn)<<5 | (Rt)) #define LDRSW_U12(Rt, Rn, imm12) EMIT(LDS_gen(0b10, 0b01, ((uint32_t)((imm12)>>2))&0xfff, Rn, Rt)) +#define LDRSH_U12(Rt, Rn, imm12) EMIT(LDS_gen(0b01, 0b01, ((uint32_t)((imm12)>>1))&0xfff, Rn, Rt)) +#define LDRSB_U12(Rt, Rn, imm12) EMIT(LDS_gen(0b00, 0b01, ((uint32_t)(imm12))&0xfff, Rn, Rt)) #define LDR_REG_gen(size, Rm, option, S, Rn, Rt) ((size)<<30 | 0b111<<27 | 0b01<<22 | 1<<21 | (Rm)<<16 | (option)<<13 | (S)<<12 | (0b10)<<10 | (Rn)<<5 | (Rt)) #define LDRx_REG(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b11, Rm, 0b011, 0, Rn, Rt)) #define LDRx_REG_LSL3(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b11, Rm, 0b011, 1, Rn, Rt)) #define LDRx_REG_UXTW3(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b11, Rm, 0b010, 1, Rn, Rt)) +#define LDRx_REG_SXTW(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b11, Rm, 0b110, 0, Rn, Rt)) #define LDRw_REG(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b10, Rm, 0b011, 0, Rn, Rt)) #define LDRw_REG_LSL2(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b10, Rm, 0b011, 1, Rn, Rt)) +#define LDRw_REG_SXTW(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b10, Rm, 0b110, 0, Rn, Rt)) #define LDRxw_REG(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b10+rex.w, Rm, 0b011, 0, Rn, Rt)) -#define LDRz_REG(Rt, Rn, Rm) EMIT(LDR_REG_gen(rex.is32bits?0b10:0b11, Rm, 0b011, 0, Rn, Rt)) +#define LDRxw_REG_SXTW(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b10+rex.w, Rm, 0b110, 0, Rn, Rt)) #define LDRB_REG(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b00, Rm, 0b011, 0, Rn, Rt)) #define LDRB_REG_UXTW(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b00, Rm, 0b010, 0, Rn, Rt)) +#define LDRB_REG_SXTW(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b00, Rm, 0b110, 0, Rn, Rt)) #define LDRH_REG(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b01, Rm, 0b011, 0, Rn, Rt)) +#define LDRH_REG_SXTW(Rt, Rn, Rm) EMIT(LDR_REG_gen(0b01, Rm, 0b110, 0, Rn, Rt)) #define LDRS_U12_gen(size, op1, opc, imm12, Rn, Rt) ((size)<<30 | 0b111<<27 | (op1)<<24 | (opc)<<22 | (imm12)<<10 | (Rn)<<5 | (Rt)) #define LDRSHx_U12(Rt, Rn, imm12) EMIT(LDRS_U12_gen(0b01, 0b01, 0b10, ((uint32_t)(imm12>>1))&0xfff, Rn, Rt)) @@ -301,9 +209,10 @@ int convert_bitmask(uint64_t bitmask); #define LDRS_REG_gen(size, Rm, option, S, Rn, Rt) ((size)<<30 | 0b111<<27 | 0b10<<22 | 1<<21 | (Rm)<<16 | (option)<<13 | (S)<<12 | (0b10)<<10 | (Rn)<<5 | (Rt)) #define LDRSW_REG(Rt, Rn, Rm) EMIT(LDRS_REG_gen(0b10, Rm, 0b011, 0, Rn, Rt)) +#define LDRSW_REG_SXTW(Rt, Rn, Rm) EMIT(LDRS_REG_gen(0b10, Rm, 0b110, 0, Rn, Rt)) #define LDR_PC_gen(opc, imm19, Rt) ((opc)<<30 | 0b011<<27 | (imm19)<<5 | (Rt)) -#define LDRx_literal(Rt, imm19) EMIT(LDR_PC_gen(0b01, ((imm19)>>2)&0x7FFFF, Rt)) +#define LDRx_literal(Rt, imm21) EMIT(LDR_PC_gen(0b01, (((int64_t)(imm21))>>2)&0x7FFFF, Rt)) #define LDU_gen(size, opc, imm9, Rn, Rt) ((size)<<30 | 0b111<<27 | (opc)<<22 | ((imm9)&0x1ff)<<12 | (Rn)<<5 | (Rt)) #define LDURx_I9(Rt, Rn, imm9) EMIT(LDU_gen(0b11, 0b01, imm9, Rn, Rt)) @@ -371,12 +280,21 @@ int convert_bitmask(uint64_t bitmask); #define STRx_REG(Rt, Rn, Rm) EMIT(STR_REG_gen(0b11, Rm, 0b011, 0, Rn, Rt)) #define STRx_REG_LSL3(Rt, Rn, Rm) EMIT(STR_REG_gen(0b11, Rm, 0b011, 1, Rn, Rt)) #define STRx_REG_UXTW(Rt, Rn, Rm) EMIT(STR_REG_gen(0b11, Rm, 0b010, 0, Rn, Rt)) +#define STRx_REG_SXTW(Rt, Rn, Rm) EMIT(STR_REG_gen(0b11, Rm, 0b110, 0, Rn, Rt)) #define STRw_REG(Rt, Rn, Rm) EMIT(STR_REG_gen(0b10, Rm, 0b011, 0, Rn, Rt)) #define STRw_REG_LSL2(Rt, Rn, Rm) EMIT(STR_REG_gen(0b10, Rm, 0b011, 1, Rn, Rt)) +#define STRw_REG_SXTW(Rt, Rn, Rm) EMIT(STR_REG_gen(0b10, Rm, 0b110, 0, Rn, Rt)) #define STRB_REG(Rt, Rn, Rm) EMIT(STR_REG_gen(0b00, Rm, 0b011, 0, Rn, Rt)) +#define STRB_REG_SXTW(Rt, Rn, Rm) EMIT(STR_REG_gen(0b00, Rm, 0b110, 0, Rn, Rt)) +#define STRB_REGz(Rt, Rn, Rm) EMIT(STR_REG_gen(0b00, Rm, rex.is32bits?0b110:0b011, 0, Rn, Rt)) #define STRH_REG(Rt, Rn, Rm) EMIT(STR_REG_gen(0b01, Rm, 0b011, 0, Rn, Rt)) +#define STRH_REG_SXTW(Rt, Rn, Rm) EMIT(STR_REG_gen(0b01, Rm, 0b110, 0, Rn, Rt)) #define STRxw_REG(Rt, Rn, Rm) EMIT(STR_REG_gen(rex.w?0b11:0b10, Rm, 0b011, 0, Rn, Rt)) +#define STRxw_REG_SXTW(Rt, Rn, Rm) EMIT(STR_REG_gen(rex.w?0b11:0b10, Rm, 0b110, 0, Rn, Rt)) +#define STRxw_REGz(Rt, Rn, Rm) EMIT(STR_REG_gen(rex.w?0b11:0b10, Rm, rex.is32bits?0b110:0b011, 0, Rn, Rt)) #define STRz_REG(Rt, Rn, Rm) EMIT(STR_REG_gen(rex.is32bits?0b10:0b11, Rm, 0b011, 0, Rn, Rt)) +#define STRz_REG_SXTW(Rt, Rn, Rm) EMIT(STR_REG_gen(rex.is32bits?0b10:0b11, Rm, 0b110, 0, Rn, Rt)) +#define STRz_REGz(Rt, Rn, Rm) EMIT(STR_REG_gen(rex.is32bits?0b10:0b11, Rm, rex.is32bits?0b110:0b011, 0, Rn, Rt)) // LOAD/STORE PAIR #define MEMPAIR_gen(size, L, op2, imm7, Rt2, Rn, Rt) ((size)<<31 | 0b101<<27 | (op2)<<23 | (L)<<22 | (imm7)<<15 | (Rt2)<<10 | (Rn)<<5 | (Rt)) @@ -476,14 +394,24 @@ int convert_bitmask(uint64_t bitmask); // Data Memory Barrier #define DMB_gen(CRm) (0b1101010100<<22 | 0b011<<16 | 0b0011<<12 | (CRm)<<8 | 1<<7 | 0b01<<5 | 0b11111) #define DMB_ISH() EMIT(DMB_gen(0b1011)) +#define DMB_ISHLD() EMIT(DMB_gen(0b1001)) +#define DMB_ISHST() EMIT(DMB_gen(0b1010)) +#define DMB_LD() EMIT(DMB_gen(0b1101)) +#define DMB_ST() EMIT(DMB_gen(0b1110)) #define DMB_SY() EMIT(DMB_gen(0b1111)) // Data Synchronization Barrier #define DSB_gen(CRm) (0b1101010100<<22 | 0b011<<16 | 0b0011<<12 | (CRm)<<8 | 1<<7 | 0b00<<5 | 0b11111) #define DSB_ISH() EMIT(DSB_gen(0b1011)) +#define DSB_ISHLD() EMIT(DSB_gen(0b1001)) #define DSB_ISHST() EMIT(DSB_gen(0b1010)) +#define DSB_LD() EMIT(DSB_gen(0b1101)) +#define DSB_ST() EMIT(DSB_gen(0b1110)) #define DSB_SY() EMIT(DSB_gen(0b1111)) +#define DC_gen(op1, CRm, op2, Xt) (0b1101010100001<<19 | (op1)<<16 | 0b0111<<12 | (CRm)<<8 | (op2)<<5 | Xt) +#define DC_CIVAC(Xt) EMIT(DC_gen(0b011, 0b1110, 0b001, Xt)) + // Break #define BRK_gen(imm16) (0b11010100<<24 | 0b001<<21 | (((imm16)&0xffff)<<5)) #define BRK(imm16) EMIT(BRK_gen(imm16)) @@ -492,16 +420,17 @@ int convert_bitmask(uint64_t bitmask); #define BR_gen(Z, op, A, M, Rn, Rm) (0b1101011<<25 | (Z)<<24 | (op)<<21 | 0b11111<<16 | (A)<<11 | (M)<<10 | (Rn)<<5 | (Rm)) #define BR(Rn) EMIT(BR_gen(0, 0b00, 0, 0, Rn, 0)) #define BLR(Rn) EMIT(BR_gen(0, 0b01, 0, 0, Rn, 0)) +#define RET(Rn) EMIT(BR_gen(0, 0b10, 0, 0, Rn, 0)) #define CB_gen(sf, op, imm19, Rt) ((sf)<<31 | 0b011010<<25 | (op)<<24 | (imm19)<<5 | (Rt)) #define CBNZx(Rt, imm19) EMIT(CB_gen(1, 1, ((imm19)>>2)&0x7FFFF, Rt)) #define CBNZw(Rt, imm19) EMIT(CB_gen(0, 1, ((imm19)>>2)&0x7FFFF, Rt)) #define CBNZxw(Rt, imm19) EMIT(CB_gen(rex.w, 1, ((imm19)>>2)&0x7FFFF, Rt)) -#define CBNZz(Rt, imm19) EMIT(CB_gen(rex.is32bits?0:1, 1, ((imm19)>>2)&0x7FFFF, Rt)) +#define CBNZy(Rt, imm19) EMIT(CB_gen((rex.is32bits || rex.is67)?0:1, 1, ((imm19)>>2)&0x7FFFF, Rt)) #define CBZx(Rt, imm19) EMIT(CB_gen(1, 0, ((imm19)>>2)&0x7FFFF, Rt)) #define CBZw(Rt, imm19) EMIT(CB_gen(0, 0, ((imm19)>>2)&0x7FFFF, Rt)) #define CBZxw(Rt, imm19) EMIT(CB_gen(rex.w, 0, ((imm19)>>2)&0x7FFFF, Rt)) -#define CBZz(Rt, imm19) EMIT(CB_gen(rex.is32bits?0:1, 0, ((imm19)>>2)&0x7FFFF, Rt)) +#define CBZy(Rt, imm19) EMIT(CB_gen((rex.is32bits || rex.is67)?0:1, 0, ((imm19)>>2)&0x7FFFF, Rt)) #define TB_gen(b5, op, b40, imm14, Rt) ((b5)<<31 | 0b011011<<25 | (op)<<24 | (b40)<<19 | (imm14)<<5 | (Rt)) #define TBZ(Rt, bit, imm16) EMIT(TB_gen(((bit)>>5)&1, 0, (bit)&0x1f, ((imm16)>>2)&0x3FFF, Rt)) @@ -517,6 +446,10 @@ int convert_bitmask(uint64_t bitmask); #define BL(imm26) EMIT(BL_gen(((imm26)>>2)&0x3ffffff)) #define NOP EMIT(0b11010101000000110010000000011111) +#define WFE EMIT(0b11010101000000110010000001011111) +#define WFI EMIT(0b11010101000000110010000001111111) +#define YIELD EMIT(0b11010101000000110010000000111111) +#define SEVL EMIT(0b11010101000000110010000010111111) #define CSINC_gen(sf, Rm, cond, Rn, Rd) ((sf)<<31 | 0b11010100<<21 | (Rm)<<16 | (cond)<<12 | 1<<10 | (Rn)<<5 | (Rd)) #define CSINCx(Rd, Rn, Rm, cond) EMIT(CSINC_gen(1, Rm, cond, Rn, Rd)) @@ -529,7 +462,7 @@ int convert_bitmask(uint64_t bitmask); #define CSINV_gen(sf, Rm, cond, Rn, Rd) ((sf)<<31 | 1<<30 | 0b11010100<<21 | (Rm)<<16 | (cond)<<12 | (Rn)<<5 | (Rd)) #define CSINVx(Rd, Rn, Rm, cond) EMIT(CSINV_gen(1, Rm, cond, Rn, Rd)) #define CSINVw(Rd, Rn, Rm, cond) EMIT(CSINV_gen(0, Rm, cond, Rn, Rd)) -#define CSINVxw(Rd, Rn, Rm, cond) EMIT(CSINV_gen(rex.w?, Rm, cond, Rn, Rd)) +#define CSINVxw(Rd, Rn, Rm, cond) EMIT(CSINV_gen(rex.w, Rm, cond, Rn, Rd)) #define CINVx(Rd, Rn, cond) CSINVx(Rd, Rn, Rn, invertCond(cond)) #define CINVw(Rd, Rn, cond) CSINVw(Rd, Rn, Rn, invertCond(cond)) #define CINVxw(Rd, Rn, cond) CSINVxw(Rd, Rn, Rn, invertCond(cond)) @@ -556,9 +489,9 @@ int convert_bitmask(uint64_t bitmask); #define ANDx_mask(Rd, Rn, N, immr, imms) EMIT(LOGIC_gen(1, 0b00, N, immr, imms, Rn, Rd)) #define ANDw_mask(Rd, Rn, immr, imms) EMIT(LOGIC_gen(0, 0b00, 0, immr, imms, Rn, Rd)) #define ANDxw_mask(Rd, Rn, N, immr, imms) EMIT(LOGIC_gen(rex.w, 0b00, rex.w?(N):0, immr, imms, Rn, Rd)) -#define ANDSx_mask(Rd, Rn, N, immr, imms) EMIT(LOGIC_gen(1, 0b11, N, immr, imms, Rn, Rd)) -#define ANDSw_mask(Rd, Rn, immr, imms) EMIT(LOGIC_gen(0, 0b11, 0, immr, imms, Rn, Rd)) -#define ANDSxw_mask(Rd, Rn, N, immr, imms) EMIT(LOGIC_gen(rex.w, 0b11, rex.w?(N):0, immr, imms, Rn, Rd)) +#define ANDSx_mask(Rd, Rn, N, immr, imms) FEMIT(LOGIC_gen(1, 0b11, N, immr, imms, Rn, Rd)) +#define ANDSw_mask(Rd, Rn, immr, imms) FEMIT(LOGIC_gen(0, 0b11, 0, immr, imms, Rn, Rd)) +#define ANDSxw_mask(Rd, Rn, N, immr, imms) FEMIT(LOGIC_gen(rex.w, 0b11, rex.w?(N):0, immr, imms, Rn, Rd)) #define ORRx_mask(Rd, Rn, N, immr, imms) EMIT(LOGIC_gen(1, 0b01, N, immr, imms, Rn, Rd)) #define ORRw_mask(Rd, Rn, immr, imms) EMIT(LOGIC_gen(0, 0b01, 0, immr, imms, Rn, Rd)) #define ORRxw_mask(Rd, Rn, N, immr, imms) EMIT(LOGIC_gen(rex.w, 0b01, rex.w?(N):0, immr, imms, Rn, Rd)) @@ -574,9 +507,10 @@ int convert_bitmask(uint64_t bitmask); #define ANDw_REG(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(0, 0b00, 0b00, 0, Rm, 0, Rn, Rd)) #define ANDw_REG_LSR(Rd, Rn, Rm, lsr) EMIT(LOGIC_REG_gen(0, 0b00, 0b01, 0, Rm, lsr, Rn, Rd)) #define ANDxw_REG(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(rex.w, 0b00, 0b00, 0, Rm, 0, Rn, Rd)) -#define ANDSx_REG(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(1, 0b11, 0b00, 0, Rm, 0, Rn, Rd)) -#define ANDSw_REG(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(0, 0b11, 0b00, 0, Rm, 0, Rn, Rd)) -#define ANDSxw_REG(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(rex.w, 0b11, 0b00, 0, Rm, 0, Rn, Rd)) +#define ANDSx_REG(Rd, Rn, Rm) FEMIT(LOGIC_REG_gen(1, 0b11, 0b00, 0, Rm, 0, Rn, Rd)) +#define ANDSw_REG(Rd, Rn, Rm) FEMIT(LOGIC_REG_gen(0, 0b11, 0b00, 0, Rm, 0, Rn, Rd)) +#define ANDSxw_REG(Rd, Rn, Rm) FEMIT(LOGIC_REG_gen(rex.w, 0b11, 0b00, 0, Rm, 0, Rn, Rd)) +#define ANDSw_REG_LSL(Rd, Rn, Rm, lsl) FEMIT(LOGIC_REG_gen(0, 0b11, 0b00, 0, Rm, lsl, Rn, Rd)) #define ORRx_REG(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(1, 0b01, 0b00, 0, Rm, 0, Rn, Rd)) #define ORRx_REG_LSL(Rd, Rn, Rm, lsl) EMIT(LOGIC_REG_gen(1, 0b01, 0b00, 0, Rm, lsl, Rn, Rd)) #define ORRw_REG_LSL(Rd, Rn, Rm, lsl) EMIT(LOGIC_REG_gen(0, 0b01, 0b00, 0, Rm, lsl, Rn, Rd)) @@ -627,10 +561,10 @@ int convert_bitmask(uint64_t bitmask); #define BICx(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(1, 0b00, 0b00, 1, Rm, 0, Rn, Rd)) #define BICw(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(0, 0b00, 0b00, 1, Rm, 0, Rn, Rd)) #define BICw_LSL(Rd, Rn, Rm, lsl) EMIT(LOGIC_REG_gen(0, 0b00, 0b00, 1, Rm, lsl, Rn, Rd)) -#define BICSx(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(1, 0b00, 0b00, 1, Rm, 0, Rn, Rd)) -#define BICSw(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(0, 0b00, 0b00, 1, Rm, 0, Rn, Rd)) -#define BICxw(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(rex.w, 0b00, 0b00, 1, Rm, 0, Rn, Rd)) -#define BICSxw(Rd, Rn, Rm) EMIT(LOGIC_REG_gen(rex.w, 0b00, 0b00, 1, Rm, 0, Rn, Rd)) +#define BICSx(Rd, Rn, Rm) FEMIT(LOGIC_REG_gen(1, 0b11, 0b00, 1, Rm, 0, Rn, Rd)) +#define BICSw(Rd, Rn, Rm) FEMIT(LOGIC_REG_gen(0, 0b11, 0b00, 1, Rm, 0, Rn, Rd)) +#define BICxw(Rd, Rn, Rm) FEMIT(LOGIC_REG_gen(rex.w, 0b00, 0b00, 1, Rm, 0, Rn, Rd)) +#define BICSxw(Rd, Rn, Rm) FEMIT(LOGIC_REG_gen(rex.w, 0b11, 0b00, 1, Rm, 0, Rn, Rd)) #define BICx_REG BICx #define BICw_REG BICw #define BICxw_REG BICxw @@ -662,6 +596,7 @@ int convert_bitmask(uint64_t bitmask); #define BFCx(Rd, lsb, width) BFMx(Rd, xZR, ((-(lsb))%64)&0x3f, (width)-1) #define BFCw(Rd, lsb, width) BFMw(Rd, xZR, ((-(lsb))%32)&0x1f, (width)-1) #define BFCxw(Rd, lsb, width) BFMxw(Rd, xZR, rex.w?(((-(lsb))%64)&0x3f):(((-(lsb))%32)&0x1f), (width)-1) +#define BFCz(Rd, lsb, width) if(rex.is32bits) {BFCw(Rd, lsb, width);} else {BFCx(Rd, lsb, width);} // Insert lsb:width part of Rn into low part of Rd (leaving rest of Rd untouched) #define BFXILx(Rd, Rn, lsb, width) EMIT(BFM_gen(1, 0b01, 1, (lsb), (lsb)+(width)-1, Rn, Rd)) // Insert lsb:width part of Rn into low part of Rd (leaving rest of Rd untouched) @@ -688,6 +623,7 @@ int convert_bitmask(uint64_t bitmask); #define LSLx(Rd, Rn, lsl) UBFMx(Rd, Rn, ((-(lsl))%64)&63, 63-(lsl)) #define LSLw(Rd, Rn, lsl) UBFMw(Rd, Rn, ((-(lsl))%32)&31, 31-(lsl)) #define LSLxw(Rd, Rn, lsl) UBFMxw(Rd, Rn, rex.w?(((-(lsl))%64)&63):(((-(lsl))%32)&31), (rex.w?63:31)-(lsl)) +#define LSLy(Rd, Rn, lsl) do {if(rex.is32bits || rex.is67) LSLw(Rd, Rn, lsl); else LSLx(Rd, Rn, lsl);} while(0) // Take width first bits from Rn, LSL lsb and create Rd #define UBFIZx(Rd, Rn, lsb, width) UBFMx(Rd, Rn, ((-(lsb))%64)&63, width-1) // Take width first bits from Rn, LSL lsb and create Rd @@ -806,9 +742,9 @@ int convert_bitmask(uint64_t bitmask); #define MRS_gen(L, o0, op1, CRn, CRm, op2, Rt) (0b1101010100<<22 | (L)<<21 | 1<<20 | (o0)<<19 | (op1)<<16 | (CRn)<<12 | (CRm)<<8 | (op2)<<5 | (Rt)) // mrs x0, nzcv : 1101010100 1 1 1 011 0100 0010 000 00000 o0=1(op0=3), op1=0b011(3) CRn=0b0100(4) CRm=0b0010(2) op2=0 // MRS : from System register -#define MRS_nzvc(Rt) EMIT(MRS_gen(1, 1, 3, 4, 2, 0, Rt)) +#define MRS_nzcv(Rt) EMIT(MRS_gen(1, 1, 3, 4, 2, 0, Rt)) // MSR : to System register -#define MSR_nzvc(Rt) EMIT(MRS_gen(0, 1, 3, 4, 2, 0, Rt)) +#define MSR_nzcv(Rt) FEMIT(MRS_gen(0, 1, 3, 4, 2, 0, Rt)) // mrs x0, fpcr : 1101010100 1 1 1 011 0100 0100 000 00000 o0=1(op0=3), op1=0b011(3) CRn=0b0100(4) CRm=0b0100(4) op2=0 #define MRS_fpcr(Rt) EMIT(MRS_gen(1, 1, 3, 4, 4, 0, Rt)) #define MSR_fpcr(Rt) EMIT(MRS_gen(0, 1, 3, 4, 4, 0, Rt)) @@ -835,13 +771,21 @@ int convert_bitmask(uint64_t bitmask); #define FPSR_DZC 1 // NEON Invalid Operation Cumulative #define FPSR_IOC 0 +// NZCV N +#define NZCV_N 31 +// NZCV Z +#define NZCV_Z 30 +// NZCV C +#define NZCV_C 29 +// NZCV V +#define NZCV_V 28 // FCSEL #define FCSEL_scalar(type, Rm, cond, Rn, Rd) (0b11110<<24 | (type)<<22 | 1<<21 | (Rm)<<16 | (cond)<<12 | 0b11<<10 | (Rn)<<5 | (Rd)) #define FCSELS(Sd, Sn, Sm, cond) EMIT(FCSEL_scalar(0b00, Sm, cond, Sn, Sd)) #define FCSELD(Dd, Dn, Dm, cond) EMIT(FCSEL_scalar(0b01, Dm, cond, Dn, Dd)) -// VLDR +// VLDR/VSTR #define VMEM_gen(size, opc, imm12, Rn, Rt) ((size)<<30 | 0b111<<27 | 1<<26 | 0b01<<24 | (opc)<<22 | (imm12)<<10 | (Rn)<<5 | (Rt)) // imm13 must be 1-aligned #define VLDR16_U12(Ht, Rn, imm13) EMIT(VMEM_gen(0b01, 0b01, ((uint32_t)((imm13)>>1))&0xfff, Rn, Ht)) @@ -860,6 +804,15 @@ int convert_bitmask(uint64_t bitmask); // (imm13) must be 1-aligned #define VSTR16_U12(Ht, Rn, imm13) EMIT(VMEM_gen(0b01, 0b00, ((uint32_t)((imm13)>>1))&0xfff, Rn, Ht)) +//VLDP/VSTP +#define VMEMP_vector(opc, L, imm7, Rt2, Rn, Rt) ((opc)<<30 | 0b101<<27 | 1<<26 | 0b010<<23 | (L)<<22 | (imm7)<<15 | (Rt2)<<10 | (Rn)<<5 | (Rt)) +#define VLDP32_I7(Rt1, Rt2, Rn, imm9) EMIT(VMEMP_vector(0b00, 1, (((int64_t)(imm9))>>2)&0x7f, Rt2, Rn, Rt1)) +#define VLDP64_I7(Rt1, Rt2, Rn, imm10) EMIT(VMEMP_vector(0b01, 1, (((int64_t)(imm10))>>3)&0x7f, Rt2, Rn, Rt1)) +#define VLDP128_I7(Rt1, Rt2, Rn, imm11) EMIT(VMEMP_vector(0b10, 1, (((int64_t)(imm11))>>4)&0x7f, Rt2, Rn, Rt1)) +#define VSTP32_I7(Rt1, Rt2, Rn, imm9) EMIT(VMEMP_vector(0b00, 0, (((int64_t)(imm9))>>2)&0x7f, Rt2, Rn, Rt1)) +#define VSTP64_I7(Rt1, Rt2, Rn, imm10) EMIT(VMEMP_vector(0b01, 0, (((int64_t)(imm10))>>3)&0x7f, Rt2, Rn, Rt1)) +#define VSTP128_I7(Rt1, Rt2, Rn, imm11) EMIT(VMEMP_vector(0b10, 0, (((int64_t)(imm11))>>4)&0x7f, Rt2, Rn, Rt1)) + #define VMEMUR_vector(size, opc, imm9, Rn, Rt) ((size)<<30 | 0b111<<27 | 1<<26 | (opc)<<22 | (imm9)<<12 | (Rn)<<5 | (Rt)) // signed offset, no alignement! #define VLDR8_I9(Vt, Rn, imm9) EMIT(VMEMUR_vector(0b00, 0b01, (imm9)&0b111111111, Rn, Vt)) @@ -878,10 +831,12 @@ int convert_bitmask(uint64_t bitmask); #define VLD64(A, B, C) if(unscaled) {VLDR64_I9(A, B, C);} else {VLDR64_U12(A, B, C);} #define VLD32(A, B, C) if(unscaled) {VLDR32_I9(A, B, C);} else {VLDR32_U12(A, B, C);} #define VLD16(A, B, C) if(unscaled) {VLDR16_I9(A, B, C);} else {VLDR16_U12(A, B, C);} +#define VLD8(A, B, C) if(unscaled) {VLDR8_I9(A, B, C);} else {VLDR8_U12(A, B, C);} #define VST128(A, B, C) if(unscaled) {VSTR128_I9(A, B, C);} else {VSTR128_U12(A, B, C);} #define VST64(A, B, C) if(unscaled) {VSTR64_I9(A, B, C);} else {VSTR64_U12(A, B, C);} #define VST32(A, B, C) if(unscaled) {VSTR32_I9(A, B, C);} else {VSTR32_U12(A, B, C);} #define VST16(A, B, C) if(unscaled) {VSTR16_I9(A, B, C);} else {VSTR16_U12(A, B, C);} +#define VST8(A, B, C) if(unscaled) {VSTR8_I9(A, B, C);} else {VSTR8_U12(A, B, C);} #define VMEMW_gen(size, opc, imm9, op2, Rn, Rt) ((size)<<30 | 0b111<<27 | 1<<26 | (opc)<<22 | (imm9)<<12 | (op2)<<10 | 0b01<<10 | (Rn)<<5 | (Rt)) #define VLDR64_S9_postindex(Rt, Rn, imm9) EMIT(VMEMW_gen(0b11, 0b01, (imm9)&0x1ff, 0b01, Rn, Rt)) @@ -896,18 +851,24 @@ int convert_bitmask(uint64_t bitmask); #define VMEM_REG_gen(size, opc, Rm, option, S, Rn, Rt) ((size)<<30 | 0b111<<27 | 1<<26 | (opc)<<22 | 1<<21 | (Rm)<<16 | (option)<<13 | (S)<<12 | 0b10<<10 | (Rn)<<5 | (Rt)) #define VLDR32_REG(Dt, Rn, Rm) EMIT(VMEM_REG_gen(0b10, 0b01, Rm, 0b011, 0, Rn, Dt)) +#define VLDR32_REG_SXTW(Dt, Rn, Rm) EMIT(VMEM_REG_gen(0b10, 0b01, Rm, 0b110, 0, Rn, Dt)) #define VLDR32_REG_LSL2(Dt, Rn, Rm) EMIT(VMEM_REG_gen(0b10, 0b01, Rm, 0b011, 1, Rn, Dt)) #define VLDR64_REG(Dt, Rn, Rm) EMIT(VMEM_REG_gen(0b11, 0b01, Rm, 0b011, 0, Rn, Dt)) +#define VLDR64_REG_SXTW(Dt, Rn, Rm) EMIT(VMEM_REG_gen(0b11, 0b01, Rm, 0b110, 0, Rn, Dt)) #define VLDR64_REG_LSL3(Dt, Rn, Rm) EMIT(VMEM_REG_gen(0b11, 0b01, Rm, 0b011, 1, Rn, Dt)) #define VLDR128_REG(Qt, Rn, Rm) EMIT(VMEM_REG_gen(0b00, 0b11, Rm, 0b011, 0, Rn, Qt)) #define VLDR128_REG_LSL4(Qt, Rn, Rm) EMIT(VMEM_REG_gen(0b00, 0b11, Rm, 0b011, 1, Rn, Qt)) +#define VLDR128_REG_SXTW(Qt, Rn, Rm) EMIT(VMEM_REG_gen(0b00, 0b11, Rm, 0b110, 0, Rn, Qt)) #define VSTR32_REG(Dt, Rn, Rm) EMIT(VMEM_REG_gen(0b10, 0b00, Rm, 0b011, 0, Rn, Dt)) #define VSTR32_REG_LSL2(Dt, Rn, Rm) EMIT(VMEM_REG_gen(0b10, 0b00, Rm, 0b011, 1, Rn, Dt)) +#define VSTR32_REG_SXTW(Dt, Rn, Rm) EMIT(VMEM_REG_gen(0b10, 0b00, Rm, 0b110, 0, Rn, Dt)) #define VSTR64_REG(Dt, Rn, Rm) EMIT(VMEM_REG_gen(0b11, 0b00, Rm, 0b011, 0, Rn, Dt)) #define VSTR64_REG_LSL3(Dt, Rn, Rm) EMIT(VMEM_REG_gen(0b11, 0b00, Rm, 0b011, 1, Rn, Dt)) +#define VSTR64_REG_SXTW(Dt, Rn, Rm) EMIT(VMEM_REG_gen(0b11, 0b00, Rm, 0b110, 0, Rn, Dt)) #define VSTR128_REG(Qt, Rn, Rm) EMIT(VMEM_REG_gen(0b00, 0b10, Rm, 0b011, 0, Rn, Qt)) #define VSTR128_REG_LSL4(Qt, Rn, Rm) EMIT(VMEM_REG_gen(0b00, 0b10, Rm, 0b011, 1, Rn, Qt)) +#define VSTR128_REG_SXTW(Qt, Rn, Rm) EMIT(VMEM_REG_gen(0b00, 0b10, Rm, 0b110, 0, Rn, Qt)) #define VLDR_PC_gen(opc, imm19, Rt) ((opc)<<30 | 0b011<<27 | 1<<26 | (imm19)<<5 | (Rt)) #define VLDR32_literal(Vt, imm19) EMIT(VLDR_PC_gen(0b00, ((imm19)>>2)&0x7FFFF, Vt)) @@ -1095,7 +1056,9 @@ int convert_bitmask(uint64_t bitmask); #define VFMOVDQ_8(Vd, u8) EMIT(FMOV_vector_imm(1, 1, ((u8)>>5)&0b111, (u8)&0b11111, Vd)) #define FMOV_scalar_imm(type, imm8, Rd) (0b11110<<24 | (type)<<22 | 1<<21 | (imm8)<<13 | 0b100<<10 | (Rd)) +// FMOV to Sd, imm=7 :~6:6:6:6:6:6:5:4 :3:2:1:0.... #define FMOVS_8(Sd, u8) EMIT(FMOV_scalar_imm(0b00, u8, Sd)) +// FMOV to Dd, imm=7 :~6:6:6:6:6:6:6:6:6:5:4 :3:2:1:0.... #define FMOVD_8(Dd, u8) EMIT(FMOV_scalar_imm(0b01, u8, Dd)) // VMOV @@ -1251,12 +1214,12 @@ int convert_bitmask(uint64_t bitmask); #define VFRSQRTSQS(Vd, Vn, Vm) EMIT(FRSQRTS_vector(1, 0, Vm, Vn, Vd)) #define VFRSQRTSQD(Vd, Vn, Vm) EMIT(FRSQRTS_vector(1, 0, Vm, Vn, Vd)) -// CMP +// CMP . NZCV: unordere=0011, eq=0110, inf=1000, sup=0010 #define FCMP_scalar(type, Rn, Rm, opc) (0b11110<<24 | (type)<<22 | 1<<21 | (Rm)<<16 | 0b1000<<10 | (Rn)<<5 | (opc)<<3) -#define FCMPS(Sn, Sm) EMIT(FCMP_scalar(0b00, Sn, Sm, 0b00)) -#define FCMPD(Dn, Dm) EMIT(FCMP_scalar(0b01, Dn, Dm, 0b00)) -#define FCMPS_0(Sn) EMIT(FCMP_scalar(0b00, Sn, 0, 0b01)) -#define FCMPD_0(Dn) EMIT(FCMP_scalar(0b01, Dn, 0, 0b01)) +#define FCMPS(Sn, Sm) FEMIT(FCMP_scalar(0b00, Sn, Sm, 0b00)) +#define FCMPD(Dn, Dm) FEMIT(FCMP_scalar(0b01, Dn, Dm, 0b00)) +#define FCMPS_0(Sn) FEMIT(FCMP_scalar(0b00, Sn, 0, 0b01)) +#define FCMPD_0(Dn) FEMIT(FCMP_scalar(0b01, Dn, 0, 0b01)) // CVT #define FCVT_scalar(sf, type, rmode, opcode, Rn, Rd) ((sf)<<31 | 0b11110<<24 | (type)<<22 | 1<<21 | (rmode)<<19 | (opcode)<<16 | (Rn)<<5 | (Rd)) @@ -1492,6 +1455,12 @@ int convert_bitmask(uint64_t bitmask); #define VFMAXQS(Vd, Vn, Vm) EMIT(FMINMAX_vector(1, 0, 0, 0, Vm, Vn, Vd)) #define VFMINQD(Vd, Vn, Vm) EMIT(FMINMAX_vector(1, 0, 1, 1, Vm, Vn, Vd)) #define VFMAXQD(Vd, Vn, Vm) EMIT(FMINMAX_vector(1, 0, 0, 1, Vm, Vn, Vd)) +#define VFMINPS(Vd, Vn, Vm) EMIT(FMINMAX_vector(0, 1, 1, 0, Vm, Vn, Vd)) +#define VFMAXPS(Vd, Vn, Vm) EMIT(FMINMAX_vector(0, 1, 0, 0, Vm, Vn, Vd)) +#define VFMINPQS(Vd, Vn, Vm) EMIT(FMINMAX_vector(1, 1, 1, 0, Vm, Vn, Vd)) +#define VFMAXPQS(Vd, Vn, Vm) EMIT(FMINMAX_vector(1, 1, 0, 0, Vm, Vn, Vd)) +#define VFMINPQD(Vd, Vn, Vm) EMIT(FMINMAX_vector(1, 1, 1, 1, Vm, Vn, Vd)) +#define VFMAXPQD(Vd, Vn, Vm) EMIT(FMINMAX_vector(1, 1, 0, 1, Vm, Vn, Vd)) #define FMINMAX_scalar(type, Rm, op, Rn, Rd) (0b11110<<24 | (type)<<22 | 1<<21 | (Rm)<<16 | 0b01<<14 | (op)<<12 | 0b10<<10 | (Rn)<<5 | (Rd)) #define FMINS(Sd, Sn, Sm) EMIT(FMINMAX_scalar(0b00, Sm, 0b01, Sn, Sd)) @@ -1780,7 +1749,7 @@ int convert_bitmask(uint64_t bitmask); #define FCMLTS_0(Rd, Rn) EMIT(FCMP_0_scalar(0, 0, 0b10, (Rn), (Rd))) #define FCMLTD_0(Rd, Rn) EMIT(FCMP_0_scalar(0, 1, 0b10, (Rn), (Rd))) -// Scalar Float CMP +// Scalar Float CMEQ #define FCMP_op_scalar(U, E, sz, Rm, ac, Rn, Rd) (0b01<<30 | (U)<<29 | 0b11110<<24 | (E)<<23 | (sz)<<22 | 1<<21 | (Rm)<<16 | 0b1110<<12 | (ac)<<11 | 1<<10 | (Rn)<<5 | (Rd)) #define FCMEQS(Rd, Rn, Rm) EMIT(FCMP_op_scalar(0, 0, 0, (Rm), 0, (Rn), (Rd))) #define FCMEQD(Rd, Rn, Rm) EMIT(FCMP_op_scalar(0, 0, 1, (Rm), 0, (Rn), (Rd))) @@ -2073,6 +2042,10 @@ int convert_bitmask(uint64_t bitmask); #define URHADDQ_16(Vd, Vn, Vm) EMIT(RHADD_vector(1, 1, 0b01, Vm, Vn, Vd)) #define URHADDQ_32(Vd, Vn, Vm) EMIT(RHADD_vector(1, 1, 0b10, Vm, Vn, Vd)) +//SRSHR/URSHR +#define RSHR(Q, U, immh, immb, Rn, Rd) ((Q)<<30 | (U)<<29 | 0b011110<<23 | (immh)<<19 | (immb)<<16 | 1<<13 | 0<<12 | 1<<10 | (Rn)<<5 | (Rd)) +#define SRSHRQ_32(Vd, Vn, shift) EMIT(RSHR(1, 0, 0b0100 | (((32-(shift))>>3)&0b11), (32-(shift))&0b111, Vn, Vd)) + // QRDMULH Signed saturating (Rounding) Doubling Multiply returning High half #define QDMULH_vector(Q, U, size, Rm, Rn, Rd) ((Q)<<30 | (U)<<29 | 0b01110<<24 | (size)<<22 | 1<<21 | (Rm)<<16 | 0b10110<<11 | 1<<10 | (Rn)<<5 | (Rd)) #define SQRDMULH_8(Vd, Vn, Vm) EMIT(QDMULH_vector(0, 1, 0b00, Vm, Vn, Vd)) @@ -2111,6 +2084,7 @@ int convert_bitmask(uint64_t bitmask); #define LDADDAxw(Rs, Rt, Rn) EMIT(ATOMIC_gen(0b10+rex.w, 1, 0, Rs, 0b000, Rn, Rt)) #define LDADDALxw(Rs, Rt, Rn) EMIT(ATOMIC_gen(0b10+rex.w, 1, 1, Rs, 0b000, Rn, Rt)) #define LDADDLxw(Rs, Rt, Rn) EMIT(ATOMIC_gen(0b10+rex.w, 0, 1, Rs, 0b000, Rn, Rt)) +#define STADDLw(Rs, Rn) EMIT(ATOMIC_gen(0b10, 0, 1, Rs, 0b000, Rn, 0b11111)) #define STADDxw(Rs, Rn) EMIT(ATOMIC_gen(0b10+rex.w, 0, 0, Rs, 0b000, Rn, 0b11111)) #define STADDLxw(Rs, Rn) EMIT(ATOMIC_gen(0b10+rex.w, 0, 1, Rs, 0b000, Rn, 0b11111)) #define LDADDB(Rs, Rt, Rn) EMIT(ATOMIC_gen(0b00, 0, 0, Rs, 0b000, Rn, Rt)) @@ -2182,7 +2156,7 @@ int convert_bitmask(uint64_t bitmask); #define LDSETLH(Rs, Rt, Rn) EMIT(ATOMIC_gen(0b01, 0, 1, Rs, 0b011, Rn, Rt)) #define STSETH(Rs, Rn) EMIT(ATOMIC_gen(0b01, 0, 0, Rs, 0b011, Rn, 0b11111)) #define STSETLH(Rs, Rn) EMIT(ATOMIC_gen(0b01, 0, 1, Rs, 0b011, Rn, 0b11111)) -// Atomic Signel Max +// Atomic Signed Max #define LDSMAXxw(Rs, Rt, Rn) EMIT(ATOMIC_gen(0b10+rex.w, 0, 0, Rs, 0b100, Rn, Rt)) #define LDSMAXAxw(Rs, Rt, Rn) EMIT(ATOMIC_gen(0b10+rex.w, 1, 0, Rs, 0b100, Rn, Rt)) #define LDSMAXALxw(Rs, Rt, Rn) EMIT(ATOMIC_gen(0b10+rex.w, 1, 1, Rs, 0b100, Rn, Rt)) @@ -2298,23 +2272,23 @@ int convert_bitmask(uint64_t bitmask); // FLAGM extension // Invert Carry Flag -#define CFINV() EMIT(0b1101010100<<22 | 0b0100<<12 | 0b000<<5 | 0b11111) +#define CFINV() FEMIT(0b1101010100<<22 | 0b0100<<12 | 0b000<<5 | 0b11111) #define RMIF_gen(imm6, Rn, mask) (0b10111010000<<21 | (imm6)<<15 | 0b00001<<10 | (Rn)<<5 | (mask)) // Rotate right reg and use as NZCV -#define RMIF(Xn, shift, mask) EMIT(RMIF_gen(shift, Xn, mask)) +#define RMIF(Xn, shift, mask) FEMIT(RMIF_gen(shift, Xn, mask)) #define SETF_gen(sz, Rn) (0b00111010000<<21 | (sz)<<14 | 0b0010<<10 | (Rn)<<5 | 0b1101) // Set NZVc with 8bit value of reg: N=bit7, Z=[0..7]==0, V=bit8 eor bit7, C unchanged -#define SETF8(Wn) EMIT(SETF_gen(0, Wn)) +#define SETF8(Wn) FEMIT(SETF_gen(0, Wn)) // Set NZVc with 16bit value of reg: N=bit15, Z=[0..15]==0, V=bit16 eor bit15, C unchanged -#define SETF16(Wn) EMIT(SETF_gen(1, Wn)) +#define SETF16(Wn) FEMIT(SETF_gen(1, Wn)) // FLAGM2 extension // NZCV -> N=0 Z=C|V C=C&!V V=0 -#define AXFLAG() EMIT(0b1101010100<<22 | 0b0100<<12 | 0b010<<5 | 0b11111) +#define AXFLAG() FEMIT(0b1101010100<<22 | 0b0100<<12 | 0b010<<5 | 0b11111) // NZCV -> N=!C&!Z Z=Z&C C=C|Z V=!C&Z -#define XAFLAG() EMIT(0b1101010100<<22 | 0b0100<<12 | 0b001<<5 | 0b11111) +#define XAFLAG() FEMIT(0b1101010100<<22 | 0b0100<<12 | 0b001<<5 | 0b11111) // FRINTTS extension #define FRINTxx_scalar(type, op, Rn, Rd) (0b11110<<24 | (type)<<22 | 1<<21 | 0b0100<<17 | (op)<<15 | 0b10000<<10 | (Rn)<<5 | (Rd)) @@ -2390,4 +2364,14 @@ int convert_bitmask(uint64_t bitmask); //SHA256 hash update (part 2) #define SHA256H2(Vd, Vn, Vm) EMIT(SHA256H2_gen(Vm, Vn, Vd)) +// LRCPC extension + +#define LDAPR_gen(sz, Rn, Rt) ((sz)<<30 | 0b111<<27 | 1<<23 | 1<<21 | 0b11111<<16 | 1<<15 | 0b100<<12 | (Rn)<<5 | (Rt)) +#define LDAPRx(Rt, Rn) EMIT(LDAPR_gen(0b11, Rn, Rt)) +#define LDAPRw(Rt, Rn) EMIT(LDAPR_gen(0b10, Rn, Rt)) +#define LDAPRxw(Rt, Rn) EMIT(LDAPR_gen(0b10+rex.w, Rn, Rt)) +#define LDAPRz(Rt, Rn) EMIT(LDAPR_gen(rex.is32bits?0b10:0b11, Rn, Rt)) +#define LDAPRH(Rt, Rn) EMIT(LDAPR_gen(0b01, Rn, Rt)) +#define LDAPRB(Rt, Rn) EMIT(LDAPR_gen(0b00, Rn, Rt)) + #endif //__ARM64_EMITTER_H__ diff --git a/src/dynarec/arm64/arm64_epilog.S b/src/dynarec/arm64/arm64_epilog.S index 57f2320..685a3e7 100644 --- a/src/dynarec/arm64/arm64_epilog.S +++ b/src/dynarec/arm64/arm64_epilog.S @@ -19,6 +19,9 @@ arm64_epilog: stp x24, x25, [x0, (8 * 14)] stp x26, x27, [x0, (8 * 16)] // put back reg value in emu, including EIP (so x27 must be EIP now) //restore all used register +#ifdef _WIN32 + ldr x18, [x0, 3104] +#endif add sp, x28, 0 //vpop {d8-d15} ldp x19, x20, [sp, (8 * 0)] diff --git a/src/dynarec/arm64/arm64_lock.S b/src/dynarec/arm64/arm64_lock.S index e57137e..168898c 100644 --- a/src/dynarec/arm64/arm64_lock.S +++ b/src/dynarec/arm64/arm64_lock.S @@ -5,6 +5,7 @@ .text .align 4 +.extern cpuext .global arm64_lock_read_b .global arm64_lock_write_b .global arm64_lock_read_h @@ -22,6 +23,7 @@ .global arm64_lock_storeifnull .global arm64_lock_storeifnull_d .global arm64_lock_storeifref +.global arm64_lock_storeifref2 .global arm64_lock_storeifref_d .global arm64_lock_storeifref2_d .global arm64_lock_decifnot0b @@ -33,6 +35,7 @@ .global arm64_lock_get_b .global arm64_lock_get_d .global arm64_lock_get_dd +.global arm64_crc arm64_lock_read_b: dmb ish @@ -104,6 +107,10 @@ arm64_lock_write_dq: arm64_lock_xchg_dd: + adrp x3, cpuext + add x3, x3, #:lo12:cpuext + ldr w3, [x3] + tbnz w3, #0, arm64_atomic_xchg_dd dmb ish arm64_lock_xchg_dd_0: // address is x0, value is x1, return old value in x0 @@ -113,7 +120,17 @@ arm64_lock_xchg_dd_0: mov x0, x2 ret +arm64_atomic_xchg_dd: + dmb ish + // address is x0, value is x1, return old value in x0 + swpal x1, x0, [x0] + ret + arm64_lock_xchg_d: + adrp x3, cpuext + add x3, x3, #:lo12:cpuext + ldr w3, [x3] + tbnz w3, #0, arm64_atomic_xchg_d dmb ish arm64_lock_xchg_d_0: // address is x0, value is x1, return old value in x0 @@ -123,7 +140,17 @@ arm64_lock_xchg_d_0: mov w0, w2 ret +arm64_atomic_xchg_d: + dmb ish + // address is x0, value is x1, return old value in x0 + swpal w1, w0, [x0] + ret + arm64_lock_xchg_h: + adrp x3, cpuext + add x3, x3, #:lo12:cpuext + ldr w3, [x3] + tbnz w3, #0, arm64_atomic_xchg_h dmb ish arm64_lock_xchg_h_0: // address is x0, value is x1, return old value in x0 @@ -133,7 +160,17 @@ arm64_lock_xchg_h_0: mov w0, w2 ret +arm64_atomic_xchg_h: + dmb ish + // address is x0, value is x1, return old value in x0 + swpalh w1, w0, [x0] + ret + arm64_lock_xchg_b: + adrp x3, cpuext + add x3, x3, #:lo12:cpuext + ldr w3, [x3] + tbnz w3, #0, arm64_atomic_xchg_b dmb ish arm64_lock_xchg_b_0: // address is x0, value is x1, return old value in x0 @@ -143,7 +180,17 @@ arm64_lock_xchg_b_0: mov w0, w2 ret +arm64_atomic_xchg_b: + dmb ish + // address is x0, value is x1, return old value in x0 + swpalb w1, w0, [x0] + ret + arm64_lock_storeifnull: + adrp x3, cpuext + add x3, x3, #:lo12:cpuext + ldr w3, [x3] + tbnz w3, #0, arm64_atomic_storeifnull dmb ish 1: // address is x0, value is x1, x1 store to x0 only if [x0] is 0. return old [x0] value @@ -155,7 +202,20 @@ arm64_lock_storeifnull: mov x0, x2 ret +arm64_atomic_storeifnull: + dmb ish + // address is x0, value is x1, x1 store to x0 only if [x0] is 0. return old [x0] value + mov x2, xzr + casal x2, x1, [x0] + mov x0, x2 + ret + + arm64_lock_storeifnull_d: + adrp x3, cpuext + add x3, x3, #:lo12:cpuext + ldr w3, [x3] + tbnz w3, #0, arm64_atomic_storeifnull_d dmb ish 1: // address is x0, value is w1, w1 store to x0 only if [x0] is 0. return old [x0] value @@ -168,7 +228,19 @@ arm64_lock_storeifnull_d: mov w0, w2 ret +arm64_atomic_storeifnull_d: + dmb ish + // address is x0, value is w1, w1 store to x0 only if [x0] is 0. return old [x0] value + mov x2, xzr + casal w2, w1, [x0] + mov w0, w2 + ret + arm64_lock_storeifref: + adrp x3, cpuext + add x3, x3, #:lo12:cpuext + ldr w3, [x3] + tbnz w3, #0, arm64_atomic_storeifref dmb ish 1: // address is x0, value is x1, x1 store to x0 only if [x0] is x2. return new [x0] value (so x1 or old value) @@ -183,7 +255,23 @@ arm64_lock_storeifref: mov x0, x3 ret +arm64_atomic_storeifref: + dmb ish + // address is x0, value is x1, x1 store to x0 only if [x0] is x2. return new [x0] value (so x1 or old value) + mov x3, x2 + casal x2, x1, [x0] + cmp x2, x3 + mov x0, x1 + ret +2: + mov x0, x3 + ret + arm64_lock_storeifref_d: + adrp x3, cpuext + add x3, x3, #:lo12:cpuext + ldr w3, [x3] + tbnz w3, #0, arm64_atomic_storeifref_d dmb ish 1: // address is x0, value is w1, w1 store to x0 only if [x0] is w2. return new [x0] value (so x1 or old value) @@ -198,7 +286,23 @@ arm64_lock_storeifref_d: mov w0, w3 ret +arm64_atomic_storeifref_d: + dmb ish + // address is x0, value is w1, w1 store to x0 only if [x0] is w2. return new [x0] value (so w1 or old value) + mov w3, w2 + casal w2, w1, [x0] + cmp w2, w3 + mov w0, w1 + ret +2: + mov w0, w3 + ret + arm64_lock_storeifref2_d: + adrp x3, cpuext + add x3, x3, #:lo12:cpuext + ldr w3, [x3] + tbnz w3, #0, arm64_atomic_storeifref2_d dmb ish 1: // address is x0, value is w1, w1 store to x0 only if [x0] is w2. return old [x0] value @@ -211,6 +315,37 @@ arm64_lock_storeifref2_d: mov w0, w3 ret +arm64_atomic_storeifref2_d: + dmb ish + // address is x0, value is w1, w1 store to x0 only if [x0] is w2. return old [x0] value + casal w2, w1, [x0] + mov w0, w2 + ret + +arm64_lock_storeifref2: + adrp x3, cpuext + add x3, x3, #:lo12:cpuext + ldr w3, [x3] + tbnz w3, #0, arm64_atomic_storeifref2 + dmb ish +1: + // address is x0, value is x1, x1 store to x0 only if [x0] is x2. return old [x0] value + ldaxr x3, [x0] + cmp x2, x3 + bne 2f + stlxr w4, x1, [x0] + cbnz w4, 1b +2: + mov x0, x3 + ret + +arm64_atomic_storeifref2: + dmb ish + // address is x0, value is x1, x1 store to x0 only if [x0] is x2. return old [x0] value + casal x2, x1, [x0] + mov x0, x2 + ret + arm64_lock_decifnot0b: dmb ish 1: @@ -242,6 +377,10 @@ arm64_lock_decifnot0: ret arm64_lock_incif0: + adrp x3, cpuext + add x3, x3, #:lo12:cpuext + ldr w3, [x3] + tbnz w3, #0, arm64_atomic_incif0 dmb ish 1: ldaxr w1, [x0] @@ -254,6 +393,13 @@ arm64_lock_incif0: mov w0, w1 ret +arm64_atomic_incif0: + mov w1, #1 + dmb ish + swpal w1, wzr, [x0] + mov w0, w1 + ret + arm64_lock_store: str w1, [x0] dmb ish @@ -275,3 +421,24 @@ arm64_lock_get_d: arm64_lock_get_dd: ldaxr x0, [x0] ret + +arm64_crc: + //x0 is address, w1 is len + mov x2, x0 // address is x2 now + mov w0, wzr // crc is w0 +1: + cmp w1, #8 + blo 2f + ldr x3, [x2], #8 + crc32x w0, w0, x3 + subs w1, w1, #8 + bne 1b +2: + cbz w1, 4f +3: + ldrb w3, [x2], #1 + crc32b w0, w0, w3 + subs w1, w1, #1 + bne 3b +4: + ret \ No newline at end of file diff --git a/src/dynarec/arm64/arm64_lock.h b/src/dynarec/arm64/arm64_lock.h index 1c827d0..f488ddd 100644 --- a/src/dynarec/arm64/arm64_lock.h +++ b/src/dynarec/arm64/arm64_lock.h @@ -29,30 +29,43 @@ extern int arm64_lock_write_dq(uint64_t a, uint64_t b, void* addr); // Atomically exchange value at [p] with val, return old p extern uintptr_t arm64_lock_xchg_dd(void* p, uintptr_t val); +extern uintptr_t arm64_atomic_xchg_dd(void* p, uintptr_t val); // Atomically exchange value at [p] with val, return old p extern uint32_t arm64_lock_xchg_d(void* p, uint32_t val); +extern uint32_t arm64_atomic_xchg_d(void* p, uint32_t val); // Atomically exchange value at [p] with val, return old p extern uint32_t arm64_lock_xchg_h(void* p, uint32_t val); +extern uint32_t arm64_atomic_xchg_h(void* p, uint32_t val); // Atomically exchange value at [p] with val, return old p extern uint32_t arm64_lock_xchg_b(void* p, uint32_t val); +extern uint32_t arm64_atomic_xchg_b(void* p, uint32_t val); // Atomically store value to [p] only if [p] is NULL. Return old [p] value extern uint32_t arm64_lock_storeifnull_d(void*p, uint32_t val); +extern uint32_t arm64_atomic_storeifnull_d(void*p, uint32_t val); // Atomically store value to [p] only if [p] is NULL. Return old [p] value extern void* arm64_lock_storeifnull(void*p, void* val); +extern void* arm64_atomic_storeifnull(void*p, void* val); // Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old) extern void* arm64_lock_storeifref(void*p, void* val, void* ref); +extern void* arm64_atomic_storeifref(void*p, void* val, void* ref); + +// Atomically store value to [p] only if [p] is ref. Return old [p] value (so val or old) +extern void* arm64_lock_storeifref2(void*p, void* val, void* ref); +extern void* arm64_atomic_storeifref2(void*p, void* val, void* ref); // Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old) extern uint32_t arm64_lock_storeifref_d(void*p, uint32_t val, uint32_t ref); +extern uint32_t arm64_atomic_storeifref_d(void*p, uint32_t val, uint32_t ref); -// Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old) +// Atomically store value to [p] only if [p] is ref. Return old [p] value (so ref or old) extern uint32_t arm64_lock_storeifref2_d(void*p, uint32_t val, uint32_t ref); +extern uint32_t arm64_atomic_storeifref2_d(void*p, uint32_t val, uint32_t ref); // decrement atomically the byte at [p] (but only if p not 0) extern void arm64_lock_decifnot0b(void*p); diff --git a/src/dynarec/arm64/arm64_mapping.h b/src/dynarec/arm64/arm64_mapping.h new file mode 100644 index 0000000..084bb26 --- /dev/null +++ b/src/dynarec/arm64/arm64_mapping.h @@ -0,0 +1,149 @@ +#ifndef __ARM64_MAPPING_H__ +#define __ARM64_MAPPING_H__ + + +/* + ARM64 Linux Call Convention + +SP The Stack Pointer. +r30 LR The Link Register. +r29 FP The Frame Pointer +r19…r28 Callee-saved registers +r18 The Platform Register, if needed; otherwise a temporary register. See notes. +r17 IP1 The second intra-procedure-call temporary register (can be used by call veneers and PLT code); at other times may be used as a temporary register. +r16 IP0 The first intra-procedure-call scratch register (can be used by call veneers and PLT code); at other times may be used as a temporary register. +r9…r15 Temporary registers +r8 Indirect result location register +r0…r7 Parameter/result registers + +For SIMD: +The first eight registers, v0-v7, are used to pass argument values into a subroutine and to return result values from a function. + They may also be used to hold intermediate values within a routine (but, in general, only between subroutine calls). + +Registers v8-v15 must be preserved by a callee across subroutine calls; + the remaining registers (v0-v7, v16-v31) do not need to be preserved (or should be preserved by the caller). + Additionally, only the bottom 64 bits of each value stored in v8-v15 need to be preserved [8]; + it is the responsibility of the caller to preserve larger values. + +For SVE: +z0-z7 are used to pass scalable vector arguments to a subroutine, and to return scalable vector results from a function. + If a subroutine takes at least one argument in scalable vector registers or scalable predicate registers, + or returns results in such regisers, the subroutine must ensure that the entire contents of z8-z23 are preserved across the call. + In other cases it need only preserve the low 64 bits of z8-z15, as described in SIMD and Floating-Point registers. +p0-p3 are used to pass scalable predicate arguments to a subroutine and to return scalable predicate results from a function. + If a subroutine takes at least one argument in scalable vector registers or scalable predicate registers, + or returns results in such registers, the subroutine must ensure that p4-p15 are preserved across the call. + In other cases it need not preserve any scalable predicate register contents. + +*/ + +// x86 Register mapping +#define xRAX 10 +#define xRCX 11 +#define xRDX 12 +#define xRBX 13 +#define xRSP 14 +#define xRBP 15 +#define xRSI 16 +#define xRDI 17 +#define xR8 18 +#define xR9 19 +#define xR10 20 +#define xR11 21 +#define xR12 22 +#define xR13 23 +#define xR14 24 +#define xR15 25 +#define xFlags 26 +#define xRIP 27 +#define xSavedSP 28 + +// convert a x86 register to native according to the register mapping +#define TO_NAT(A) (xRAX + (A)) +#define IS_GPR(A) ((A)>=xRAX && (A)<=xRIP) + +// 32bits version +#define wEAX xRAX +#define wECX xRCX +#define wEDX xRDX +#define wEBX xRBX +#define wESP xRSP +#define wEBP xRBP +#define wESI xRSI +#define wEDI xRDI +#define wR8 xR8 +#define wR9 xR9 +#define wR10 xR10 +#define wR11 xR11 +#define wR12 xR12 +#define wR13 xR13 +#define wR14 xR14 +#define wR15 xR15 +#define wFlags xFlags +// scratch registers +#define x1 1 +#define x2 2 +#define x3 3 +#define x4 4 +#define x5 5 +#define x6 6 +#define x87pc 7 +// x87 can be a scratch, but check if it's used as x87 PC and restore if needed in that case +// 32bits version of scratch +#define w1 x1 +#define w2 x2 +#define w3 x3 +#define w4 x4 +#define w5 x5 +#define w6 x6 +#define w87pc x87pc +// emu is r0 +#define xEmu 0 +// ARM64 LR +#define xLR 30 +// ARM64 SP is r31 but is a special register +#define xSP 31 +// xZR regs is 31 +#define xZR 31 +#define wZR xZR + +// conditions +// Z == 1 +#define cEQ 0b0000 +// Z != 1 +#define cNE 0b0001 +// C == 1 +#define cCS 0b0010 +// C == 1 +#define cHS cCS +// C != 1 +#define cCC 0b0011 +// C != 1 +#define cLO cCC +// N == 1 +#define cMI 0b0100 +// N != 1 +#define cPL 0b0101 +// V == 1 +#define cVS 0b0110 +// V != 1 +#define cVC 0b0111 +// C == 1 && Z == 0 +#define cHI 0b1000 +// C !=1 || Z == 1 +#define cLS 0b1001 +// N == V +#define cGE 0b1010 +// N != V +#define cLT 0b1011 +// N == V && Z == 0 +#define cGT 0b1100 +// N != V || Z == 1 +#define cLE 0b1101 +// always +#define c__ 0b1110 + +//FCMP type of opcode produce: +// if any NAN: CV / v1 == v2: ZC / v1 < v2: N / v1 > v2: C + +#endif //__ARM64_MAPPING_H__ \ No newline at end of file diff --git a/src/dynarec/arm64/arm64_next.S b/src/dynarec/arm64/arm64_next.S index e900fbe..f0cc64e 100644 --- a/src/dynarec/arm64/arm64_next.S +++ b/src/dynarec/arm64/arm64_next.S @@ -22,6 +22,10 @@ arm64_next: stp x16, x17, [sp, (8 * 8)] stp x18, x27, [sp, (8 * 10)] // also save x27(rip) to allow change in LinkNext +#ifdef _WIN32 + ldr x18, [x0, 3104] +#endif + mov x1, x27 // xRIP, should not be needed most of the time mov x2, x30 // "from" is in lr, so put in x2 add x3, sp, 8*11 // x3 is address to change rip // call the function diff --git a/src/dynarec/arm64/arm64_printer.c b/src/dynarec/arm64/arm64_printer.c index 4581894..b57f0f3 100644 --- a/src/dynarec/arm64/arm64_printer.c +++ b/src/dynarec/arm64/arm64_printer.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "arm64_printer.h" #include "debug.h" @@ -124,6 +125,22 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "NOP"); return buff; } + if(isMask(opcode, "11010101000000110010000001011111", &a)) { + snprintf(buff, sizeof(buff), "WFE"); + return buff; + } + if(isMask(opcode, "11010101000000110010000001111111", &a)) { + snprintf(buff, sizeof(buff), "WFI"); + return buff; + } + if(isMask(opcode, "11010101000000110010000000111111", &a)) { + snprintf(buff, sizeof(buff), "YIELD"); + return buff; + } + if(isMask(opcode, "11010101000000110010000010111111", &a)) { + snprintf(buff, sizeof(buff), "SEVL"); + return buff; + } // --- LDR / STR if(isMask(opcode, "f010100011iiiiiii22222nnnnnttttt", &a)) { int offset = signExtend(imm, 7)<<(2+sf); @@ -391,9 +408,9 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) if(sf) { uint64_t noti=~(((uint64_t)imm)<<(hw*16)); if(!hw) - snprintf(buff, sizeof(buff), "MOVN %s, 0x%x\t; 0x%lx", Xt[Rd], imm, noti); + snprintf(buff, sizeof(buff), "MOVN %s, 0x%x\t; 0x%"PRIx64, Xt[Rd], imm, noti); else - snprintf(buff, sizeof(buff), "MOVN %s, 0x%x LSL %d\t; 0x%lx", Xt[Rd], imm, 16*hw, noti); + snprintf(buff, sizeof(buff), "MOVN %s, 0x%x LSL %d\t; 0x%"PRIx64, Xt[Rd], imm, 16*hw, noti); } else { uint32_t noti=~(((uint32_t)imm)<<(hw*16)); if(!hw) @@ -538,16 +555,36 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "SUBS %s, %s, %s %s %d", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], sf?Xt[Rm]:Wt[Rm], shifts[shift], imm); return buff; } + if(isMask(opcode, "f1001011001mmmmmoooiiinnnnnddddd", &a)) { + const char* shifts[2][8] = {{ "UXTB", "UXTH", "LSL", "UXTX", "SXTB", "SXTH", "SXTW", "SXTX"}, {"UXTB", "UXTH", "UXTW", "LSL", "SXTB", "SXTH", "SXTW", "SXTX" }}; + if(((sf==0 && shift==2) || (sf==1 && shift==3)) && imm==0) + snprintf(buff, sizeof(buff), "SUB %s, %s, %s", sf?XtSp[Rd]:WtSp[Rd], sf?XtSp[Rn]:WtSp[Rn], sf?XtSp[Rm]:WtSp[Rm]); + else if(shift==0) + snprintf(buff, sizeof(buff), "SUB %s, %s, %s %s", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], sf?Xt[Rm]:Wt[Rm], shifts[sf][shift]); + else + snprintf(buff, sizeof(buff), "SUB %s, %s, %s %s %d", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], sf?Xt[Rm]:Wt[Rm], shifts[sf][shift], imm); + return buff; + } + if(isMask(opcode, "f0001011001mmmmmoooiiinnnnnddddd", &a)) { + const char* shifts[2][8] = {{ "UXTB", "UXTH", "LSL", "UXTX", "SXTB", "SXTH", "SXTW", "SXTX"}, {"UXTB", "UXTH", "UXTW", "LSL", "SXTB", "SXTH", "SXTW", "SXTX" }}; + if(((sf==0 && shift==2) || (sf==1 && shift==3)) && imm==0) + snprintf(buff, sizeof(buff), "ADD %s, %s, %s", sf?XtSp[Rd]:WtSp[Rd], sf?XtSp[Rn]:WtSp[Rn], sf?XtSp[Rm]:WtSp[Rm]); + else if(shift==0) + snprintf(buff, sizeof(buff), "ADD %s, %s, %s %s", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], sf?Xt[Rm]:Wt[Rm], shifts[sf][shift]); + else + snprintf(buff, sizeof(buff), "ADD %s, %s, %s %s %d", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], sf?Xt[Rm]:Wt[Rm], shifts[sf][shift], imm); + return buff; + } // ---- LOGIC if(isMask(opcode, "f11100100Nrrrrrrssssssnnnnnddddd", &a)) { uint64_t i = DecodeBitMasks(a.N, imms, immr); if(!sf) i&=0xffffffff; if(sf==0 && a.N==1) - snprintf(buff, sizeof(buff), "invalid ANDS %s, %s, 0x%lx", Wt[Rd], Wt[Rn], i); + snprintf(buff, sizeof(buff), "invalid ANDS %s, %s, 0x%"PRIx64, Wt[Rd], Wt[Rn], i); else if(Rd==31) - snprintf(buff, sizeof(buff), "TST %s, 0x%lx", sf?Xt[Rn]:Wt[Rn], i); + snprintf(buff, sizeof(buff), "TST %s, 0x%"PRIx64, sf?Xt[Rn]:Wt[Rn], i); else - snprintf(buff, sizeof(buff), "ANDS %s, %s, 0x%lx", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], i); + snprintf(buff, sizeof(buff), "ANDS %s, %s, 0x%"PRIx64, sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], i); return buff; } if(isMask(opcode, "f1101010hh0mmmmmiiiiiinnnnnddddd", &a)) { @@ -573,13 +610,21 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "BIC %s, %s, %s, %s %d", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], sf?Xt[Rm]:Wt[Rm], shifts[shift], imm); return buff; } + if(isMask(opcode, "f1101010hh1mmmmmiiiiiinnnnnddddd", &a)) { + const char* shifts[] = { "LSL", "LSR", "ASR", "ROR" }; + if(shift==0 && imm==0) + snprintf(buff, sizeof(buff), "BICS %s, %s, %s", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], sf?Xt[Rm]:Wt[Rm]); + else + snprintf(buff, sizeof(buff), "BICS %s, %s, %s, %s %d", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], sf?Xt[Rm]:Wt[Rm], shifts[shift], imm); + return buff; + } if(isMask(opcode, "f01100100Nrrrrrrssssssnnnnnddddd", &a)) { uint64_t i = DecodeBitMasks(a.N, imms, immr); if(!sf) i&=0xffffffff; if(sf==0 && a.N==1) - snprintf(buff, sizeof(buff), "invalid ORR %s, %s, 0x%lx", Wt[Rd], Wt[Rn], i); + snprintf(buff, sizeof(buff), "invalid ORR %s, %s, 0x%"PRIx64, Wt[Rd], Wt[Rn], i); else - snprintf(buff, sizeof(buff), "ORR %s, %s, 0x%lx", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], i); + snprintf(buff, sizeof(buff), "ORR %s, %s, 0x%"PRIx64, sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], i); return buff; } if(isMask(opcode, "f0101010hh1mmmmmiiiiiinnnnnddddd", &a)) { @@ -612,9 +657,9 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) uint64_t i = DecodeBitMasks(a.N, imms, immr); if(!sf) i&=0xffffffff; if(sf==0 && a.N==1) - snprintf(buff, sizeof(buff), "invalid EOR %s, %s, 0x%lx", Wt[Rd], Wt[Rn], i); + snprintf(buff, sizeof(buff), "invalid EOR %s, %s, 0x%"PRIx64, Wt[Rd], Wt[Rn], i); else - snprintf(buff, sizeof(buff), "EOR %s, %s, 0x%lx", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], i); + snprintf(buff, sizeof(buff), "EOR %s, %s, 0x%"PRIx64, sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], i); return buff; } if(isMask(opcode, "f1001010hh0mmmmmiiiiiinnnnnddddd", &a)) { @@ -629,9 +674,9 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) uint64_t i = DecodeBitMasks(a.N, imms, immr); if(!sf) i&=0xffffffff; if(sf==0 && a.N==1) - snprintf(buff, sizeof(buff), "invalid AND %s, %s, 0x%lx", Wt[Rd], Wt[Rn], i); + snprintf(buff, sizeof(buff), "invalid AND %s, %s, 0x%"PRIx64, Wt[Rd], Wt[Rn], i); else - snprintf(buff, sizeof(buff), "AND %s, %s, 0x%lx", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], i); + snprintf(buff, sizeof(buff), "AND %s, %s, 0x%"PRIx64, sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], i); return buff; } if(isMask(opcode, "f0001010hh0mmmmmiiiiiinnnnnddddd", &a)) { @@ -719,8 +764,12 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "BFC %s, %d, %d", sf?Xt[Rd]:Wt[Rd], lsb, width); else snprintf(buff, sizeof(buff), "BFI %s, %s, %d, %d", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], lsb, width); - } else - snprintf(buff, sizeof(buff), "BFXIL %s, %s, %d, %d", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], immr, imms-immr+1); + } else { + if(Rn==31 && immr==0) + snprintf(buff, sizeof(buff), "BFC %s, %d, %d", sf?Xt[Rd]:Wt[Rd], immr, imms-immr+1); + else + snprintf(buff, sizeof(buff), "BFXIL %s, %s, %d, %d", sf?Xt[Rd]:Wt[Rd], sf?Xt[Rn]:Wt[Rn], immr, imms-immr+1); + } return buff; } // ---- BRANCH / TEST @@ -732,6 +781,13 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "BLR %s", Xt[Rn]); return buff; } + if(isMask(opcode, "1101011001011111000000nnnnn00000", &a)) { + if(Rn==30) + snprintf(buff, sizeof(buff), "RET"); + else + snprintf(buff, sizeof(buff), "RET %s", Xt[Rn]); + return buff; + } if(isMask(opcode, "01010100iiiiiiiiiiiiiiiiiii0cccc", &a)) { int offset = signExtend(imm, 19)<<2; snprintf(buff, sizeof(buff), "B.%s #+%di\t; %p", conds[cond], offset>>2, (void*)(addr + offset)); @@ -744,27 +800,22 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) } if(isMask(opcode, "f0110100iiiiiiiiiiiiiiiiiiittttt", &a)) { int offset = signExtend(imm, 19)<<2; - snprintf(buff, sizeof(buff), "CBZ %s, #%+di\t; %p", Xt[Rt], offset>>2, (void*)(addr + offset)); + snprintf(buff, sizeof(buff), "CBZ %s, #%+di\t; %p", sf?Xt[Rt]:Wt[Rt], offset>>2, (void*)(addr + offset)); return buff; } if(isMask(opcode, "f0110101iiiiiiiiiiiiiiiiiiittttt", &a)) { int offset = signExtend(imm, 19)<<2; - snprintf(buff, sizeof(buff), "CBNZ %s, #%+di\t; %p", Xt[Rt], offset>>2, (void*)(addr + offset)); - return buff; - } - if(isMask(opcode, "f0110100iiiiiiiiiiiiiiiiiiittttt", &a)) { - int offset = signExtend(imm, 19)<<2; - snprintf(buff, sizeof(buff), "CBZ %s, #%+di\t; %p", Xt[Rt], offset>>2, (void*)(addr + offset)); + snprintf(buff, sizeof(buff), "CBNZ %s, #%+di\t; %p", sf?Xt[Rt]:Wt[Rt], offset>>2, (void*)(addr + offset)); return buff; } if(isMask(opcode, "s0110110sssssiiiiiiiiiiiiiittttt", &a)) { int offset = signExtend(imm, 14)<<2; - snprintf(buff, sizeof(buff), "TBZ %s, 0x%x, #%+di\t; %p", (imms<31)?Xt[Rt]:Wt[Rt], imms, offset>>2, (void*)(addr + offset)); + snprintf(buff, sizeof(buff), "TBZ %s, %d, #%+di\t; %p", (imms<31)?Xt[Rt]:Wt[Rt], imms, offset>>2, (void*)(addr + offset)); return buff; } if(isMask(opcode, "s0110111sssssiiiiiiiiiiiiiittttt", &a)) { int offset = signExtend(imm, 14)<<2; - snprintf(buff, sizeof(buff), "TBNZ %s, 0x%x, #%+di\t; %p", (imms<31)?Xt[Rt]:Wt[Rt], imms, offset>>2, (void*)(addr + offset)); + snprintf(buff, sizeof(buff), "TBNZ %s, %d, #%+di\t; %p", (imms<31)?Xt[Rt]:Wt[Rt], imms, offset>>2, (void*)(addr + offset)); return buff; } @@ -1035,9 +1086,9 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) tmp64u |= 0xffLL<<(i*8); if(a.Q) - snprintf(buff, sizeof(buff), "MOVI V%d.2D, #0x%016lx", Rd, tmp64u); + snprintf(buff, sizeof(buff), "MOVI V%d.2D, #0x%016"PRIx64, Rd, tmp64u); else - snprintf(buff, sizeof(buff), "MOVI D%d, #0x%016lx", Rd, tmp64u); + snprintf(buff, sizeof(buff), "MOVI D%d, #0x%016"PRIx64, Rd, tmp64u); return buff; } @@ -1078,7 +1129,7 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) // ADR if(isMask(opcode, "0ss10000iiiiiiiiiiiiiiiiiiiddddd", &a)) { - snprintf(buff, sizeof(buff), "ADR, %s, %ld", Xt[Rd], signExtend((imm)<<2|(imms), 20)); + snprintf(buff, sizeof(buff), "ADR, %s, %"PRId64, Xt[Rd], signExtend((imm)<<2|(imms), 20)); return buff; } @@ -1300,6 +1351,12 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "FCMP %c%d, %c%d", s, Rn, s, Rm); return buff; } + //FCMEQ + if(isMask(opcode, "010111100f1mmmmm111001nnnnnddddd", &a)) { + char s = (sf==0)?'S':'D'; + snprintf(buff, sizeof(buff), "FCMEQ %c%d, %c%d, %c%d", s, Rd, s, Rn, s, Rm); + return buff; + } //FCMP vector if(isMask(opcode, "0QU01110cf1mmmmm111001nnnnnddddd", &a)) { char s = (sf==0)?'S':((sf==1)?'D':'?'); @@ -1316,18 +1373,18 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "F%s %c%d, %c%d, %c%d", (option==3)?"MINNM":((option==2)?"MAXNM":((!option)?"MAX":"MIN")), s, Rd, s, Rn, s, Rm); return buff; } - if(isMask(opcode, "0Q001110of1mmmmm110001nnnnnddddd", &a)) { + if(isMask(opcode, "0QU01110of1mmmmm110001nnnnnddddd", &a)) { char s = (sf==0)?'S':((sf==1)?'D':'?'); int n = (sf==0)?2:1; n *= a.Q?2:1; - snprintf(buff, sizeof(buff), "F%sNM%s V%d.%d%c, V%d.%d%c, V%d.%d%c", option?"MIN":"MAX", a.Q?"Q":"", Rd, n, s, Rn, n, s, Rm, n, s); + snprintf(buff, sizeof(buff), "F%sNM%s%s V%d.%d%c, V%d.%d%c, V%d.%d%c", option?"MIN":"MAX", a.U?"P":"", a.Q?"Q":"", Rd, n, s, Rn, n, s, Rm, n, s); return buff; } - if(isMask(opcode, "0Q001110of1mmmmm111101nnnnnddddd", &a)) { + if(isMask(opcode, "0QU01110of1mmmmm111101nnnnnddddd", &a)) { char s = (sf==0)?'S':((sf==1)?'D':'?'); int n = (sf==0)?2:1; n *= a.Q?2:1; - snprintf(buff, sizeof(buff), "F%s%s V%d.%d%c, V%d.%d%c, V%d.%d%c", option?"MIN":"MAX", a.Q?"Q":"", Rd, n, s, Rn, n, s, Rm, n, s); + snprintf(buff, sizeof(buff), "F%s%s%s V%d.%d%c, V%d.%d%c, V%d.%d%c", option?"MIN":"MAX", a.U?"P":"", a.Q?"Q":"", Rd, n, s, Rn, n, s, Rm, n, s); return buff; } // FMADD @@ -1541,6 +1598,28 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "%cRHADD V%d.%s, V%d.%s, V%d.%s", a.U?'U':'S', Rd, Vd, Rn, Vd, Rm, Vd); return buff; } + //S/URSHR + if(isMask(opcode, "0QU011110iiiiiii001001nnnnnddddd", &a)) { + int shft = 0; + int sz = 0; + const char* Y[] = {"8B", "16B", "4H", "8H", "2S", "4S", "??", "2D"}; + if(imm&0b1000000) { + sz = 3; + shft = imm&0b111111; + } else if(imm&0b100000) { + sz = 2; + shft = imm&0b1111; + } else if(imm&0b10000) { + sz = 1; + shft = imm&0b111; + } else if(imm&0b1000) { + sz = 0; + shft = imm&0b111; + } + const char* Vd = Y[(sz<<1) | a.Q]; + snprintf(buff, sizeof(buff), "%cRSHR V%d.%s, V%d.%s, #%d", a.U?'U':'S', Rd, Vd, Rn, Vd, shft); + return buff; + } //SQ(R)DMULH if(isMask(opcode, "0QU01110ff1mmmmm101101nnnnnddddd", &a)) { const char* Y[] = {"8B", "16B", "4H", "8H", "2S", "4S", "??", "???"}; @@ -1550,12 +1629,12 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) } // LD1/ST1 single structure - if(isMask(opcode, "0Q0011010L000000cc0Sffnnnnnttttt", &a)) { + if(isMask(opcode, "0Q0011010Lo00000cc0Sffnnnnnttttt", &a)) { int scale = a.c; int idx = 0; const char* Y[] = {"B", "H", "S", "D"}; switch(scale) { - case 3: scale = sf; /* rep = 1; */ break; + case 3: scale = sf; /* rep = 1; */ idx=(8*(a.Q+1))>>scale; break; case 0: idx = (a.Q<<3) | (a.S<<2) | sf; break; case 1: idx = (a.Q<<2) | (a.S<<1) | (sf>>1); break; case 2: if(!(sf&1)) @@ -1566,7 +1645,10 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) } break; } - snprintf(buff, sizeof(buff), "%s1 {V%d.%s}[%d], [%s]", a.L?"LD":"ST", Rt, Y[scale], idx, XtSp[Rn]); + if(!option && a.L && scale==3) + snprintf(buff, sizeof(buff), "LD1R {V%d.%d%s}, [%s]", Rt, idx, Y[scale], XtSp[Rn]); + else + snprintf(buff, sizeof(buff), "%s1 {V%d.%s}[%d], [%s]", a.L?"LD":"ST", Rt, Y[scale], idx, XtSp[Rn]); return buff; } // LDUR/STUR @@ -1595,6 +1677,17 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "%sR %s%d, [%s, %+d]", a.L?"LD":"ST", Y[sz], Rt, XtSp[Rn], imm); return buff; } + // LDP/STP vector + if(isMask(opcode, "ff1011010Liiiiiii22222nnnnnttttt", &a)) { + const char* Y[] = {"S", "D", "Q", "?"}; + int sz = sf; + int offset = signExtend(imm, 7)<<(2+sz); + if(!offset) + snprintf(buff, sizeof(buff), "%sP %s%d, %s%d, [%s]", a.L?"LD":"ST", Y[sz], Rt, Y[sz], Rt2, XtSp[Rn]); + else + snprintf(buff, sizeof(buff), "%sP %s%d, %s%d, [%s, %s0x%x]", a.L?"LD":"ST", Y[sz], Rt, Y[sz], Rt2, XtSp[Rn], (offset<0)?"-":"", abs(offset)); + return buff; + } // (S/U)QXT(U)N if(isMask(opcode, "0Q101110ff100001001010nnnnnddddd", &a)) { @@ -1613,6 +1706,11 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "%cQXTN%s V%d.%s, V%d.%s", a.U?'U':'S', a.Q?"2":"", Rd, Vd, Rn, Va); return buff; } + if(isMask(opcode, "01U11110ff100001010010nnnnnddddd", &a)) { + const char Z[] = {'B', 'H', 'S', 'D', '?'}; + snprintf(buff, sizeof(buff), "SQXT%sN %c%d, %c%d", a.U?"U":"", Z[sf], Rd, Z[sf+1], Rn); + return buff; + } // (S/U)SSHL(2) / (U/S)XTL(2) if(isMask(opcode, "0QU011110hhhhiii101001nnnnnddddd", &a)) { @@ -1643,6 +1741,15 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) return buff; } + // CNT + if(isMask(opcode, "0Q00111000100000010110nnnnnddddd", &a)) { + const char* Y[] = {"8B", "16B"}; + const char* Vd = Y[a.Q]; + const char* Va = Y[a.Q]; + snprintf(buff, sizeof(buff), "CNT V%d.%s, V%d.%s", Rd, Vd, Rn, Va); + return buff; + } + // DUP if(isMask(opcode, "0Q001110000iiiii000001nnnnnddddd", &a)) { const char* Y[] = {"8B", "16B", "4H", "8H", "2S", "4S", "??", "2D"}; @@ -1688,15 +1795,47 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "PMULL%s V%d.%s, V%d.%s, V%d.%s", a.Q?"2":"", Rd, Vd, Rn, Vn, Rm, Vn); return buff; } + // [S/U]MULL + if(isMask(opcode, "0QU01110ff1mmmmm110000nnnnnddddd", &a)) { + const char* Y[] = {"8B", "16B", "4H", "8H", "2S", "4S", "??", "??"}; + const char* Z[] = {"8H", "4S", "2D", "??"}; + int sz = sf; + const char* Vn = Y[(sz<<1)|a.Q]; + const char* Vd = Z[sz]; + snprintf(buff, sizeof(buff), "%cMULL%s V%d.%s, V%d.%s, V%d.%s", a.U?'U':'S', a.Q?"2":"", Rd, Vd, Rn, Vn, Rm, Vn); + return buff; + } + //XTN(2) + if(isMask(opcode, "0Q001110ff100001001010nnnnnddddd", &a)) { + const char* Y[] = {"8B", "16B", "4H", "8H", "2S", "4S", "??", "??"}; + const char* Z[] = {"8H", "4S", "2D", "??"}; + int sz = sf; + const char* Vd = Y[(sz<<1)|a.Q]; + const char* Vn = Z[sz]; + snprintf(buff, sizeof(buff), "XTN%s V%d.%s, V%d.%s", a.Q?"2":"", Rd, Vd, Rn, Vn); + return buff; + } - // DMB ISH + // DMB if(isMask(opcode, "11010101000000110011nnnn10111111", &a)) { - snprintf(buff, sizeof(buff), "DMB %s", (Rn==0b1011)?"ISH":"???"); + const char* barrier[] = { + "???", "???", "???", "???", // 0-3 + "???", "???", "???", "???", // 4-7 + "???", "ISHLD", "ISHST", "ISH", // 8-11 + "???", "LD", "ST", "SY" // 12-15 + }; + snprintf(buff, sizeof(buff), "DMB %s", barrier[Rn]); return buff; } - // DSB ISH/ISHST + // DSB if(isMask(opcode, "11010101000000110011nnnn10011111", &a)) { - snprintf(buff, sizeof(buff), "DSB %s", (Rn==0b1011)?"ISH":((Rn==0b1010)?"ISHST":"???")); + const char* barrier[] = { + "???", "???", "???", "???", // 0-3 + "???", "???", "???", "???", // 4-7 + "???", "ISHLD", "ISHST", "ISH", // 8-11 + "???", "LD", "ST", "SY" // 12-15 + }; + snprintf(buff, sizeof(buff), "DSB %s", barrier[Rn]); return buff; } @@ -1720,9 +1859,9 @@ const char* arm64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "SWP%s%s %s, %s, [%s]", a.A?"A":"", a.R?"L":"", sf?Xt[Rs]:Wt[Rs], sf?Xt[Rt]:Wt[Rt], XtSp[Rn]); return buff; } - // SWPxw + // SWP B/H if(isMask(opcode, "0f111000AR1sssss100000nnnnnttttt", &a)) { - snprintf(buff, sizeof(buff), "CAS%s%s%s %s, %s, [%s]", a.A?"A":"", a.R?"L":"", sf?"H":"B", Xt[Rs], Xt[Rt], XtSp[Rn]); + snprintf(buff, sizeof(buff), "SWP%s%s%s %s, %s, [%s]", a.A?"A":"", a.R?"L":"", sf?"H":"B", Xt[Rs], Xt[Rt], XtSp[Rn]); return buff; } // LDXXXxw diff --git a/src/dynarec/arm64/dynarec_arm64_00.c b/src/dynarec/arm64/dynarec_arm64_00.c index cd27933..876e6b6 100644 --- a/src/dynarec/arm64/dynarec_arm64_00.c +++ b/src/dynarec/arm64/dynarec_arm64_00.c @@ -2,32 +2,33 @@ #include #include #include -#include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" #include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" #include "bridge.h" -#include "emu/x64run_private.h" #include "x64trace.h" #include "dynarec_native.h" +#include "../dynablock_private.h" #include "custommem.h" - +#include "alternate.h" +#include "mysignal.h" #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" int isSimpleWrapper(wrapper_t fun); int isRetX87Wrapper(wrapper_t fun); -uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { uint8_t nextop, opcode; uint8_t gd, ed; @@ -109,7 +110,17 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_ES])); PUSH1_32(x1); } else { - DEFAULT; + INST_NAME("Illegal 06"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x07: @@ -117,19 +128,41 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("POP ES"); POP1_32(x1); STRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_ES])); - STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_ES])); } else { - DEFAULT; + INST_NAME("Illegal 07"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x08: INST_NAME("OR Eb, Gb"); SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_or8(dyn, ninst, x1, x2, x4, x5); - EBBACK; + UFLAG_IF { + GETEB(x1, 0); + GETGB(x2); + emit_or8(dyn, ninst, x1, x2, x4, x5); + EBBACK; + } else { + if(MODREG) { + GETGB(x2); + CALCEB(); + ORRx_REG_LSL(wback, wback, x2, wb2); + } else { + GETEB(x1, 0); + CALCGB(); + ORRw_REG_LSR(x1, x1, gb1, gb2); + EBBACK; + } + } break; case 0x09: INST_NAME("OR Ed, Gd"); @@ -144,10 +177,16 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("OR Gb, Eb"); SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETEB(x2, 0); - GETGB(x1); - emit_or8(dyn, ninst, x1, x2, x3, x4); - GBBACK; + UFLAG_IF { + GETEB(x2, 0); + GETGB(x1); + emit_or8(dyn, ninst, x1, x2, x3, x4); + GBBACK; + } else { + GETEB(x2, 0); + CALCGB(); + ORRx_REG_LSL(gb1, gb1, x2, gb2); + } break; case 0x0B: INST_NAME("OR Gd, Ed"); @@ -161,9 +200,19 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("OR AL, Ib"); SETFLAGS(X_ALL, SF_SET_PENDING); u8 = F8; - UXTBw(x1, xRAX); - emit_or8c(dyn, ninst, x1, u8, x3, x4); - BFIx(xRAX, x1, 0, 8); + UFLAG_IF { + UXTBw(x1, xRAX); + emit_or8c(dyn, ninst, x1, u8, x3, x4); + BFIx(xRAX, x1, 0, 8); + } else { + int mask = convert_bitmask_x(u8); + if(mask) + ORRx_mask(xRAX, xRAX, (mask>>12)&1, mask&0x3F, (mask>>6)&0x3F); + else { + MOV32w(x1, u8); + ORRx_REG(xRAX, xRAX, x1); + } + } break; case 0x0D: INST_NAME("OR EAX, Id"); @@ -178,11 +227,21 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin PUSH1_32(x1); SMWRITE(); } else { - DEFAULT; + INST_NAME("Illegal 0E"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x0F: - switch(rep) { + switch(rex.rep) { case 1: addr = dynarec64_F20F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; @@ -190,7 +249,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin addr = dynarec64_F30F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; default: - addr = dynarec64_0F(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_0F(dyn, addr, ip, ninst, rex, ok, need_epilog); } break; case 0x10: @@ -256,7 +315,17 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin PUSH1_32(x1); SMWRITE(); } else { - DEFAULT; + INST_NAME("Illegal 16"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x17: @@ -265,9 +334,18 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SMREAD(); POP1_32(x1); STRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_SS])); - STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_SS])); } else { - DEFAULT; + INST_NAME("Illegal 17"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x18: @@ -333,7 +411,17 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin PUSH1_32(x1); SMWRITE(); } else { - DEFAULT; + INST_NAME("Illegal 1E"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x1F: @@ -342,9 +430,18 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SMREAD(); POP1_32(x1); STRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_DS])); - STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_DS])); } else { - DEFAULT; + INST_NAME("Illegal 1F"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x20: @@ -386,9 +483,20 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("AND AL, Ib"); SETFLAGS(X_ALL, SF_SET_PENDING); u8 = F8; - UXTBw(x1, xRAX); - emit_and8c(dyn, ninst, x1, u8, x3, x4); - BFIx(xRAX, x1, 0, 8); + UFLAG_IF { + UXTBw(x1, xRAX); + emit_and8c(dyn, ninst, x1, u8, x3, x4); + BFIx(xRAX, x1, 0, 8); + } else { + int mask = convert_bitmask_x(0xffffffffffffff00LL | u8); + if(mask) + ANDx_mask(xRAX, xRAX, (mask>>12)&1, mask&0x3F, (mask>>6)&0x3F); + else { + u8 = ~u8; + MOV32w(x1, u8); + BICx_REG(xRAX, xRAX, x1); + } + } break; case 0x25: INST_NAME("AND EAX, Id"); @@ -399,14 +507,24 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x27: if(rex.is32bits) { INST_NAME("DAA"); - MESSAGE(LOG_DUMP, "Need Optimization DAA\n"); + MESSAGE(LOG_DUMP, "Need Optimization (DAA)\n"); READFLAGS(X_AF|X_CF); SETFLAGS(X_ALL, SF_SET_DF); UXTBx(x1, xRAX); - CALL_(daa8, x1, 0); + CALL_(const_daa8, x1, 0); BFIz(xRAX, x1, 0, 8); } else { - DEFAULT; + INST_NAME("Illegal 27"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x28: @@ -464,24 +582,47 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x2F: if(rex.is32bits) { INST_NAME("DAS"); - MESSAGE(LOG_DUMP, "Need Optimization DAS\n"); + MESSAGE(LOG_DUMP, "Need Optimization (DAS)\n"); READFLAGS(X_AF|X_CF); SETFLAGS(X_ALL, SF_SET_DF); UXTBx(x1, xRAX); - CALL_(das8, x1, 0); + CALL_(const_das8, x1, 0); BFIz(xRAX, x1, 0, 8); } else { - DEFAULT; + INST_NAME("Illegal 2F"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x30: INST_NAME("XOR Eb, Gb"); SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_xor8(dyn, ninst, x1, x2, x4, x5); - EBBACK; + UFLAG_IF { + GETEB(x1, 0); + GETGB(x2); + emit_xor8(dyn, ninst, x1, x2, x4, x5); + EBBACK; + } else { + if(MODREG) { + GETGB(x2); + CALCEB(); + EORx_REG_LSL(wback, wback, x2, wb2); + } else { + GETEB(x1, 0); + CALCGB(); + EORw_REG_LSR(x1, x1, gb1, gb2); + EBBACK; + } + } break; case 0x31: INST_NAME("XOR Ed, Gd"); @@ -496,10 +637,16 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("XOR Gb, Eb"); SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETEB(x2, 0); - GETGB(x1); - emit_xor8(dyn, ninst, x1, x2, x3, x4); - GBBACK; + UFLAG_IF { + GETEB(x2, 0); + GETGB(x1); + emit_xor8(dyn, ninst, x1, x2, x3, x4); + GBBACK; + } else { + GETEB(x2, 0); + CALCGB(); + EORx_REG_LSL(gb1, gb1, x2, gb2); + } break; case 0x33: INST_NAME("XOR Gd, Ed"); @@ -513,9 +660,19 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("XOR AL, Ib"); SETFLAGS(X_ALL, SF_SET_PENDING); u8 = F8; - UXTBw(x1, xRAX); - emit_xor8c(dyn, ninst, x1, u8, x3, x4); - BFIx(xRAX, x1, 0, 8); + UFLAG_IF { + UXTBw(x1, xRAX); + emit_xor8c(dyn, ninst, x1, u8, x3, x4); + BFIx(xRAX, x1, 0, 8); + } else { + int mask = convert_bitmask_x(u8); + if(mask) + EORx_mask(xRAX, xRAX, (mask>>12)&1, mask&0x3F, (mask>>6)&0x3F); + else { + MOV32w(x1, u8); + EORx_REG(xRAX, xRAX, x1); + } + } break; case 0x35: INST_NAME("XOR EAX, Id"); @@ -529,14 +686,24 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x37: if(rex.is32bits) { INST_NAME("AAA"); - MESSAGE(LOG_DUMP, "Need Optimization AAA\n"); + MESSAGE(LOG_DUMP, "Need Optimization (AAA)\n"); READFLAGS(X_AF); SETFLAGS(X_ALL, SF_SET_DF); UXTHx(x1, xRAX); - CALL_(aaa16, x1, 0); + CALL_(const_aaa16, x1, 0); BFIz(xRAX, x1, 0, 16); } else { - DEFAULT; + INST_NAME("Illegal 37"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x38: @@ -597,14 +764,24 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x3F: if(rex.is32bits) { INST_NAME("AAS"); - MESSAGE(LOG_DUMP, "Need Optimization AAS\n"); + MESSAGE(LOG_DUMP, "Need Optimization (AAS)\n"); READFLAGS(X_AF); SETFLAGS(X_ALL, SF_SET_DF); UXTHw(x1, xRAX); - CALL_(aas16, x1, 0); + CALL_(const_aas16, x1, 0); BFIx(xRAX, x1, 0, 16); } else { - DEFAULT; + INST_NAME("Illegal 3F"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x40: @@ -616,8 +793,8 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x46: case 0x47: INST_NAME("INC Reg (32bits)"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - gd = xRAX + (opcode&7); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); + gd = TO_NAT(opcode & 7); emit_inc32(dyn, ninst, rex, gd, x1, x2); break; case 0x48: @@ -629,8 +806,8 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x4E: case 0x4F: INST_NAME("DEC Reg (32bits)"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - gd = xRAX + (opcode&7); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); + gd = TO_NAT(opcode & 7); emit_dec32(dyn, ninst, rex, gd, x1, x2); break; case 0x50: @@ -646,8 +823,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SKIPTEST(x1); dyn->doublepush = 0; } else { - WILLWRITE(); - gd = xRAX+(opcode&0x07)+(rex.b<<3); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); u32 = PK(0); i32 = 1; rex.rex = 0; @@ -657,8 +833,8 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin u32 = PK(i32); i32++; } - if(!box64_dynarec_test && u32>=0x50 && u32<=0x57 && (dyn->size>(ninst+1) && dyn->insts[ninst+1].pred_sz==1) && gd != xRSP) { - u32= xRAX+(u32&0x07)+(rex.b<<3); + if(!BOX64ENV(dynarec_test) && u32>=0x50 && u32<=0x57 && (dyn->size>(ninst+1) && dyn->insts[ninst+1].pred_sz==1) && gd != xRSP) { + u32 = TO_NAT((u32 & 0x07) + (rex.b << 3)); if(u32==xRSP) { PUSH1z(gd); } else { @@ -692,7 +868,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin dyn->doublepop = 0; } else { SMREAD(); - gd = xRAX+(opcode&0x07)+(rex.b<<3); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); u32 = PK(0); i32 = 1; rex.rex = 0; @@ -702,9 +878,9 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin u32 = PK(i32); i32++; } - if(!box64_dynarec_test && (gd!=xRSP) && u32>=0x58 && u32<=0x5f && (dyn->size>(ninst+1) && dyn->insts[ninst+1].pred_sz==1)) { + if (!BOX64ENV(dynarec_test) && (gd != xRSP) && u32 >= 0x58 && u32 <= 0x5f && (dyn->size > (ninst + 1) && dyn->insts[ninst + 1].pred_sz == 1)) { // double pop! - u32= xRAX+(u32&0x07)+(rex.b<<3); + u32 = TO_NAT((u32 & 0x07) + (rex.b << 3)); MESSAGE(LOG_DUMP, "DOUBLE POP\n"); if(gd==u32) { ADDz_U12(xRSP, xRSP, rex.is32bits?0x4:0x8); @@ -730,7 +906,6 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x60: if(rex.is32bits) { INST_NAME("PUSHAD"); - WILLWRITE(); MOVw_REG(x1, xRSP); PUSH2_32(xRAX, xRCX); PUSH2_32(xRDX, xRBX); @@ -738,7 +913,17 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin PUSH2_32(xRSI, xRDI); SMWRITE(); } else { - DEFAULT; + INST_NAME("Illegal 60"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x61: @@ -750,30 +935,61 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin POP2_32(xRBX, xRDX); POP2_32(xRCX, xRAX); } else { - DEFAULT; + INST_NAME("Illegal 61"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x62: - if(rex.is32bits) { - // BOUND here - DEFAULT; - } else { + nextop = F8; + if(rex.is32bits && !MODREG) { INST_NAME("BOUND Gd, Ed"); - nextop = F8; - FAKEED; + addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + LDRxw_U12(x2, wback, 0); + LDRxw_U12(x3, wback, 4); + GETGD; + GETIP(ip); + CMPSw_REG(gd, x2); + B_MARK(cLT); + CMPSw_REG(gd, x3); + B_MARK(cGT); + B_NEXT_nocond; + MARK; + STORE_XEMU_CALL(xRIP); + CALL_S(const_native_br, -1); + LOAD_XEMU_CALL(xRIP); + } else { + INST_NAME("Illegal 62"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0x63: if(rex.is32bits) { // ARPL here - DEFAULT; + DEFAULT; } else { INST_NAME("MOVSXD Gd, Ed"); nextop = F8; GETGD; if(rex.w) { if(MODREG) { // reg <= reg - SXTWx(gd, xRAX+(nextop&7)+(rex.b<<3)); + SXTWx(gd, TO_NAT((nextop & 7) + (rex.b << 3))); } else { // mem <= reg SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); @@ -781,7 +997,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } } else { if(MODREG) { // reg <= reg - MOVw_REG(gd, xRAX+(nextop&7)+(rex.b<<3)); + MOVw_REG(gd, TO_NAT((nextop & 7) + (rex.b << 3))); } else { // mem <= reg SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); @@ -790,21 +1006,6 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } } break; - case 0x64: - addr = dynarec64_64(dyn, addr, ip, ninst, rex, rep, _FS, ok, need_epilog); - break; - case 0x65: - addr = dynarec64_64(dyn, addr, ip, ninst, rex, rep, _GS, ok, need_epilog); - break; - case 0x66: - addr = dynarec64_66(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); - break; - case 0x67: - if(rex.is32bits) - addr = dynarec64_67_32(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); - else - addr = dynarec64_67(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); - break; case 0x68: INST_NAME("PUSH Id"); i64 = F32S; @@ -814,15 +1015,22 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDRSW_U12(x1, x3, 0); PUSH1z(x1); } else { - WILLWRITE(); - MOV64z(x3, i64); - PUSH1z(x3); + if (!i64) { + PUSH1z(xZR); + } else { + MOV64z(x3, i64); + PUSH1z(x3); + } SMWRITE(); } break; case 0x69: INST_NAME("IMUL Gd, Ed, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + if (BOX64DRENV(dynarec_safeflags) > 1 && BOX64ENV(cputype)) { + SETFLAGS(X_OF|X_CF, SF_SET); + } else { + SETFLAGS(X_ALL, SF_SET); + } nextop = F8; GETGD; GETED(4); @@ -833,20 +1041,9 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin UFLAG_IF { SMULH(x3, ed, x4); MULx(gd, ed, x4); - IFX(X_PEND) { - UFLAG_OP1(x3); - UFLAG_RES(gd); - UFLAG_DF(x1, d_imul64); - } else { - SET_DFNONE(x1); - } - IFX(X_ZF | X_PF | X_AF | X_SF) { - MOV32w(x1, (1< 1 && BOX64ENV(cputype)) { + SETFLAGS(X_OF|X_CF, SF_SET); + } else { + SETFLAGS(X_ALL, SF_SET); + } nextop = F8; GETGD; GETED(1); @@ -912,20 +1112,9 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin UFLAG_IF { SMULH(x3, ed, x4); MULx(gd, ed, x4); - IFX(X_PEND) { - UFLAG_OP1(x3); - UFLAG_RES(gd); - UFLAG_DF(x1, d_imul64); - } else { - SET_DFNONE(x1); - } - IFX(X_ZF | X_PF | X_AF | X_SF) { - MOV32w(x1, (1<1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } GETIP(ip); STORE_XEMU_CALL(xRIP); - CALL(native_priv, -1); + CALL_S(const_native_priv, -1); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; @@ -985,10 +1174,14 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x6E: case 0x6F: INST_NAME(opcode == 0x6C ? "OUTSB" : "OUTSD"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } GETIP(ip); STORE_XEMU_CALL(xRIP); - CALL(native_priv, -1); + CALL_S(const_native_priv, -1); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; @@ -996,10 +1189,8 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; #define GO(GETFLAGS, NO, YES, F) \ - if (box64_dynarec_test == 2) { NOTEST(x1); } \ READFLAGS(F); \ i8 = F8S; \ - BARRIER(BARRIER_MAYBE); \ JUMP(addr+i8, 1); \ GETFLAGS; \ if(dyn->insts[ninst].x64.jmp_insts==-1 || \ @@ -1009,17 +1200,19 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin Bcond(NO, i32); \ if(dyn->insts[ninst].x64.jmp_insts==-1) { \ if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \ - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ + fpu_purgecache(dyn, ninst, 1, x1, x2, x3, 0); \ jump_to_next(dyn, addr+i8, 0, ninst, rex.is32bits); \ } else { \ /* inside the block, cache transform */ \ - CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ + CacheTransform(dyn, ninst, cacheupd); \ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size);\ + SKIP_SEVL(i32); \ B(i32); \ } \ } else { \ /* inside the block, no cache change */ \ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ + SKIP_SEVL(i32); \ Bcond(YES, i32); \ } @@ -1029,8 +1222,11 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x82: if(!rex.is32bits) { - DEFAULT; - return ip; + INST_NAME("Invalid 82"); + UDF(0); + *need_epilog = 1; + *ok = 0; + return addr; } // fallthru case 0x80: @@ -1047,10 +1243,22 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 1: //OR INST_NAME("OR Eb, Ib"); SETFLAGS(X_ALL, SF_SET_PENDING); - GETEB(x1, 1); - u8 = F8; - emit_or8c(dyn, ninst, x1, u8, x2, x4); - EBBACK; + UFLAG_IF2(|| !MODREG) { + GETEB(x1, 1); + u8 = F8; + emit_or8c(dyn, ninst, x1, u8, x2, x4); + EBBACK; + } else { + CALCEB(); + u8 = F8; + int mask = convert_bitmask_x(((uint32_t)u8)<>12)&1, mask&0x3F, (mask>>6)&0x3F); + else { + MOV32w(x1, ((uint32_t)u8)<>12)&1, mask&0x3F, (mask>>6)&0x3F); + else { + u8 = ~u8; + MOV32w(x1, ((uint32_t)u8)<>12)&1, mask&0x3F, (mask>>6)&0x3F); + else { + MOV32w(x1, ((uint32_t)u8)<>3)+(rex.r<<3); if(rex.rex) { gb2 = 0; - gb1 = xRAX + gd; + gb1 = TO_NAT(gd); } else { gb2 = ((gd&4)<<1); - gb1 = xRAX+(gd&3); + gb1 = TO_NAT(gd & 3); } if(gb2) { gd = x4; @@ -1308,16 +1540,15 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin if(MODREG) { ed = (nextop&7) + (rex.b<<3); if(rex.rex) { - eb1 = xRAX+ed; + eb1 = TO_NAT(ed); eb2 = 0; } else { - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx eb2 = ((ed&4)>>2); // L or H } BFIx(eb1, gd, eb2*8, 8); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, &lock, 0, 0); - WILLWRITELOCK(lock); STB(gd, ed, fixedaddress); SMWRITELOCK(lock); } @@ -1327,11 +1558,28 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop=F8; GETGD; if(MODREG) { // reg <= reg - MOVxw_REG(xRAX+(nextop&7)+(rex.b<<3), gd); + MOVxw_REG(TO_NAT((nextop & 7) + (rex.b << 3)), gd); } else { // mem <= reg - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0); - WILLWRITELOCK(lock); - STxw(gd, ed, fixedaddress); + IF_UNALIGNED(ip) { + MESSAGE(LOG_DEBUG, "\tUnaligned path"); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, &lock, 0, 0); + if(gd==wback) { + MOVx_REG(x2, wback); + wback = x2; + } + for(int i=0; i<(1<<(2+rex.w)); ++i) { + STURB_I9(gd, wback, i); + RORxw(gd, gd, 8); + } + // gd restored after that + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff << (2 + rex.w), (1 << (2 + rex.w)) - 1, rex, &lock, 0, 0); + if(!lock && BOX64ENV(unity) && !VolatileRangesContains(ip) && ((fixedaddress==0x80) || (fixedaddress==0x84) || (fixedaddress==0xc0) || (fixedaddress==0xc4))) { + DMB_ISH(); + lock = 1; + } + STxw(gd, ed, fixedaddress); + } SMWRITELOCK(lock); } break; @@ -1339,21 +1587,21 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("MOV Gb, Eb"); nextop = F8; if(rex.rex) { - gb1 = gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); + gb1 = gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); gb2=0; } else { gd = (nextop&0x38)>>3; - gb1 = xRAX+(gd&3); + gb1 = TO_NAT(gd & 3); gb2 = ((gd&4)<<1); } if(MODREG) { if(rex.rex) { - wback = xRAX+(nextop&7)+(rex.b<<3); + wback = TO_NAT((nextop & 7) + (rex.b << 3)); wb2 = 0; } else { wback = (nextop&7); wb2 = (wback>>2); - wback = xRAX+(wback&3); + wback = TO_NAT(wback & 3); } if(wb2) { UBFXw(x4, wback, wb2*8, 8); @@ -1374,38 +1622,56 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop=F8; GETGD; if(MODREG) { - MOVxw_REG(gd, xRAX+(nextop&7)+(rex.b<<3)); + MOVxw_REG(gd, TO_NAT((nextop & 7) + (rex.b << 3))); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0); + if(!lock && BOX64ENV(unity) && !VolatileRangesContains(ip) && ((fixedaddress==0x80) || (fixedaddress==0x84) || (fixedaddress==0xc0) || (fixedaddress==0xc4))) { + lock = 1; + } SMREADLOCK(lock); LDxw(gd, ed, fixedaddress); } break; case 0x8C: - INST_NAME("MOV Ed, Seg"); nextop=F8; u8 = (nextop&0x38)>>3; - if((nextop&0xC0)==0xC0) { // reg <= seg - gd = xRAX+(nextop&7)+(rex.b<<3); - LDRH_U12(gd, xEmu, offsetof(x64emu_t, segs[u8])); - UXTHw(gd, gd); - } else { // mem <= seg - LDRH_U12(x3, xEmu, offsetof(x64emu_t, segs[u8])); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); - STH(x3, wback, fixedaddress); - SMWRITE2(); + if(u8>5) { + INST_NAME("Invalid MOV Ed, Seg"); + UDF(0); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("MOV Ed, Seg"); + if (MODREG) { + gd = TO_NAT((nextop & 7) + (rex.b << 3)); + LDRH_U12(gd, xEmu, offsetof(x64emu_t, segs[u8])); + UXTHw(gd, gd); + } else { + LDRH_U12(x3, xEmu, offsetof(x64emu_t, segs[u8])); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); + STH(x3, wback, fixedaddress); + SMWRITE2(); + } } break; case 0x8D: - INST_NAME("LEA Gd, Ed"); nextop=F8; GETGD; if(MODREG) { // reg <= reg? that's an invalid operation - DEFAULT; + INST_NAME("Invalid 8D"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { // mem <= reg + INST_NAME("LEA Gd, Ed"); + rex.seg = 0; // to be safe addr = geted(dyn, addr, ninst, nextop, &ed, gd, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(gd!=ed) { // it's sometimes used as a 3 bytes NOP - MOVxw_REG(gd, ed); + if(rex.w && rex.is67) { + MOVw_REG(gd, ed); + } else { + MOVxw_REG(gd, ed); + } } else if(!rex.w && !rex.is32bits) { MOVw_REG(gd, gd); //truncate the higher 32bits as asked @@ -1413,37 +1679,55 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } break; case 0x8E: - INST_NAME("MOV Seg,Ew"); nextop = F8; u8 = (nextop&0x38)>>3; - if((nextop&0xC0)==0xC0) { - ed = xRAX+(nextop&7)+(rex.b<<3); + if((u8>5) || (u8==1)) { + INST_NAME("Invalid MOV Seg,Ed"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); - LDH(x1, wback, fixedaddress); - ed = x1; + INST_NAME("MOV Seg,Ed"); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); + LDH(x1, wback, fixedaddress); + ed = x1; + } + STRH_U12(ed, xEmu, offsetof(x64emu_t, segs[u8])); + if((u8==_FS) || (u8==_GS)) { + // refresh offset if needed + CBZw_NEXT(ed); + MOV32w(x1, u8); + CALL(const_getsegmentbase, -1); + } } - STRH_U12(ed, xEmu, offsetof(x64emu_t, segs[u8])); - STRw_U12(wZR, xEmu, offsetof(x64emu_t, segs_serial[u8])); break; case 0x8F: - INST_NAME("POP Ed"); nextop = F8; - SMREAD(); - if(MODREG) { - POP1z(xRAX+(nextop&7)+(rex.b<<3)); - } else { - POP1z(x2); // so this can handle POP [ESP] and maybe some variant too - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); - if(ed==xRSP) { - STz(x2, ed, fixedaddress); - } else { - // complicated to just allow a segfault that can be recovered correctly - SUBz_U12(xRSP, xRSP, rex.is32bits?4:8); - STz(x2, ed, fixedaddress); - ADDz_U12(xRSP, xRSP, rex.is32bits?4:8); - } + switch((nextop>>3)&7) { + case 0: + INST_NAME("POP Ed"); + SMREAD(); + if(MODREG) { + POP1z(TO_NAT((nextop & 7) + (rex.b << 3))); + } else { + POP1z(x2); // so this can handle POP [ESP] and maybe some variant too + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<(2+rex.is32bits), (1<<(2+rex.is32bits))-1, rex, NULL, 0, 0); + STz(x2, ed, fixedaddress); + SMWRITE(); + } + break; + case 3: + INST_NAME("Invalid 8F /3"); + UDF(0); + *need_epilog = 1; + *ok = 0; + break; + default: + DEFAULT; } break; case 0x90: @@ -1454,9 +1738,22 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x95: case 0x96: case 0x97: - gd = xRAX+(opcode&0x07)+(rex.b<<3); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); if(gd==xRAX) { - INST_NAME("NOP"); + if (rex.rep == 2) { + INST_NAME("PAUSE"); + switch (BOX64ENV(dynarec_pause)) { + case 1: YIELD; break; + case 2: WFI; break; + case 3: + dyn->insts[ninst].wfe = 1; + SEVL; + WFE; + break; + } + } else { + INST_NAME("NOP"); + } } else { INST_NAME("XCHG EAX, Reg"); MOVxw_REG(x2, xRAX); @@ -1478,7 +1775,23 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("CDQ"); SBFXxw(xRDX, xRAX, rex.w?63:31, 1); break; - + case 0x9A: + if(rex.is32bits) { + DEFAULT; + } else { + INST_NAME("Illegal 9A"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; + } + break; case 0x9B: INST_NAME("FWAIT"); break; @@ -1491,14 +1804,17 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("POPF"); SETFLAGS(X_ALL, SF_SET); POP1z(xFlags); - MOV32w(x1, 0x3F7FD7); + MOV32w(x1, 0x3E7FD7); ANDw_REG(xFlags, xFlags, x1); MOV32w(x1, 0x202); ORRw_REG(xFlags, xFlags, x1); - SET_DFNONE(x1); - if(box64_wine) { // should this be done all the time? + SET_DFNONE(); + if(box64_wine || 1) { // should this be done all the time? TBZ_NEXT(xFlags, F_TF); - // go to epilog, TF should trigger at end of next opcode, so using Interpretor only + // go to epilog, TF should trigger at end of next opcode, so using Interpreter only + LDRw_U12(x4, xEmu, offsetof(x64emu_t, flags)); + ORRw_mask(x4, x4, 32-FLAGS_NO_TF, 0); //mask=1<-0x1000)) { + grab_segdata(dyn, addr, ninst, x1, rex.seg); + if(u64) { + if(u64<0x1000) + fixedaddress = u64; + else if((int64_t)u64 > -256) + { fixedaddress = (int64_t)u64; unscaled = 1;} + else + SUBx_U12(x1, x1, -(int64_t)u64); + } + } else { + MOV64y(x1, u64); + if(rex.seg) { + grab_segdata(dyn, addr, ninst, x3, rex.seg); + ADDx_REGy(x1, x3, x1); + } + } + lock=(rex.seg)?0:isLockAddress(u64); SMREADLOCK(lock); - LDRB_U12(x2, x1, 0); + LDB(x2, x1, fixedaddress); BFIx(xRAX, x2, 0, 8); break; case 0xA1: INST_NAME("MOV EAX,Od"); - if(rex.is32bits) - u64 = F32; + if(rex.is32bits && rex.is67) + u64 = F16S; + else if(rex.is32bits || rex.is67) + u64 = F32S; else u64 = F64; - MOV64z(x1, u64); - lock=isLockAddress(u64); + unscaled = 0; fixedaddress = 0; + if(rex.seg && (u64<0x1000 || (int64_t)u64>-0x1000 || (u64<(0x1000<<(2+rex.w)) && !(u64&(((1<<(2+rex.w))-1)))))) { + grab_segdata(dyn, addr, ninst, x1, rex.seg); + if(u64) { + if(u64<0x100) + {fixedaddress = u64; unscaled = 1;} + else if(u64<(0x1000<<(2+rex.w)) && !(u64&(((1<<(2+rex.w))-1)))) + fixedaddress = u64; + else if(u64<0x1000) + ADDx_U12(x1, x1, u64); + else if((int64_t)u64 > -0x100) + {fixedaddress = (int64_t)u64; unscaled = 1;} + else + SUBx_U12(x1, x1, -(int64_t)u64); + } + } else { + MOV64y(x1, u64); + if(rex.seg) { + grab_segdata(dyn, addr, ninst, x3, rex.seg); + ADDx_REGy(x1, x3, x1); + } + } + lock=(rex.seg)?0:isLockAddress(u64); SMREADLOCK(lock); - LDRxw_U12(xRAX, x1, 0); + LDxw(xRAX, x1, fixedaddress); break; case 0xA2: INST_NAME("MOV Ob,AL"); - if(rex.is32bits) - u64 = F32; + if(rex.is32bits && rex.is67) + u64 = F16S; + else if(rex.is32bits || rex.is67) + u64 = F32S; else u64 = F64; - MOV64z(x1, u64); - lock=isLockAddress(u64); - WILLWRITELOCK(lock); - STRB_U12(xRAX, x1, 0); + unscaled = 0; fixedaddress = 0; + if(rex.seg && (u64<0x1000 || (int64_t)u64>-0x1000)) { + grab_segdata(dyn, addr, ninst, x1, rex.seg); + if(u64) { + if(u64<0x1000) + fixedaddress = u64; + else if((int64_t)u64 > -256) + { fixedaddress = (int64_t)u64; unscaled = 1;} + else + SUBx_U12(x1, x1, -(int64_t)u64); + } + } else { + MOV64y(x1, u64); + if(rex.seg) { + grab_segdata(dyn, addr, ninst, x3, rex.seg); + ADDx_REGy(x1, x3, x1); + } + } + lock=(rex.seg)?0:isLockAddress(u64); + STB(xRAX, x1, fixedaddress); SMWRITELOCK(lock); break; case 0xA3: INST_NAME("MOV Od,EAX"); - if(rex.is32bits) - u64 = F32; + if(rex.is32bits && rex.is67) + u64 = F16S; + else if(rex.is32bits || rex.is67) + u64 = F32S; else u64 = F64; - MOV64z(x1, u64); - lock=isLockAddress(u64); - WILLWRITELOCK(lock); - STRxw_U12(xRAX, x1, 0); + unscaled = 0; fixedaddress = 0; + if(rex.seg && (u64<0x1000 || (int64_t)u64>-0x1000 || (u64<(0x1000<<(2+rex.w)) && !(u64&(((1<<(2+rex.w))-1)))))) { + grab_segdata(dyn, addr, ninst, x1, rex.seg); + if(u64) { + if(u64<0x100) + {fixedaddress = u64; unscaled = 1;} + else if(u64<(0x1000<<(2+rex.w)) && !(u64&(((1<<(2+rex.w))-1)))) + fixedaddress = u64; + else if(u64<0x1000) + ADDx_U12(x1, x1, u64); + else if((int64_t)u64 > -0x100) + {fixedaddress = (int64_t)u64; unscaled = 1;} + else + SUBx_U12(x1, x1, -(int64_t)u64); + } + } else { + MOV64y(x1, u64); + if(rex.seg) { + grab_segdata(dyn, addr, ninst, x3, rex.seg); + ADDx_REGy(x1, x3, x1); + } + } + lock=(rex.seg)?0:isLockAddress(u64); + STxw(xRAX, x1, fixedaddress); SMWRITELOCK(lock); break; case 0xA4: SMREAD(); - if(rep) { + if(rex.rep) { INST_NAME("REP MOVSB"); CBZx_NEXT(xRCX); TBNZ_MARK2(xFlags, F_DF); + IF_UNALIGNED(ip) { + MESSAGE(LOG_DEBUG, "\tUnaligned path"); + // special optim for large RCX value on forward case only + // but because it's unaligned path, check if a byte per byt is needed, and do 4-bytes per 4-bytes only instead + if(BOX64DRENV(dynarec_safeflags)) { + SUBx_REG(x2, xRDI, xRSI); + CMPSx_U12(x2, 4); + B_MARK(cCC); + } + ORRw_REG(x1, xRSI, xRDI); + ANDw_mask(x1, x1, 0, 1); //mask = 3 + CBNZw_MARK(x1); + MARK3; + ANDx_mask(x1, xRCX, 1, 0b111110, 0b111101); // mask=0xfffffffffffffffc, so ~3LL + CBZx_MARK(x1); // xRCX<4 + LDRw_S9_postindex(x1, xRSI, 4); + STRw_S9_postindex(x1, xRDI, 4); + SUBx_U12(xRCX, xRCX, 4); + CBNZx_MARK3(xRCX); + CBZx_MARKLOCK(xRCX); + } else { + if(BOX64DRENV(dynarec_safeflags)) { + SUBx_REG(x2, xRDI, xRSI); + CMPSx_U12(x2, 8); + B_MARK(cCC); + } + // special optim for large RCX value on forward case only + MARK3; + ANDx_mask(x1, xRCX, 1, 0b111101, 0b111100); // mask=0xfffffffffffffff8, so ~7LL + CBZx_MARK(x1); // xRCX<8 + LDRx_S9_postindex(x1, xRSI, 8); + STRx_S9_postindex(x1, xRDI, 8); + SUBx_U12(xRCX, xRCX, 8); + CBNZx_MARK3(xRCX); + CBZx_MARKLOCK(xRCX); + } MARK; // Part with DF==0 LDRB_S9_postindex(x1, xRSI, 1); STRB_S9_postindex(x1, xRDI, 1); SUBx_U12(xRCX, xRCX, 1); CBNZx_MARK(xRCX); - B_NEXT_nocond; + B_MARKLOCK_nocond; MARK2; // Part with DF==1 LDRB_S9_postindex(x1, xRSI, -1); STRB_S9_postindex(x1, xRDI, -1); SUBx_U12(xRCX, xRCX, 1); CBNZx_MARK2(xRCX); + MARKLOCK; // done } else { INST_NAME("MOVSB"); @@ -1593,7 +2028,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0xA5: SMREAD(); - if(rep) { + if(rex.rep) { INST_NAME("REP MOVSD"); CBZx_NEXT(xRCX); TBNZ_MARK2(xFlags, F_DF); @@ -1620,13 +2055,16 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SMWRITE(); break; case 0xA6: - switch(rep) { + switch(rex.rep) { case 1: case 2: - if(rep==1) {INST_NAME("REPNZ CMPSB");} else {INST_NAME("REPZ CMPSB");} - MAYSETFLAGS(); + if(rex.rep==1) {INST_NAME("REPNZ CMPSB");} else {INST_NAME("REPZ CMPSB");} + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); SMREAD(); - SETFLAGS(X_ALL, SF_SET_PENDING); CBZx_NEXT(xRCX); TBNZ_MARK2(xFlags, F_DF); MARK; // Part with DF==0 @@ -1634,7 +2072,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDRB_S9_postindex(x2, xRDI, 1); SUBx_U12(xRCX, xRCX, 1); CMPSw_REG(x1, x2); - B_MARK3((rep==1)?cEQ:cNE); + B_MARK3((rex.rep==1)?cEQ:cNE); CBNZx_MARK(xRCX); B_MARK3_nocond; MARK2; // Part with DF==1 @@ -1642,7 +2080,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDRB_S9_postindex(x2, xRDI, -1); SUBx_U12(xRCX, xRCX, 1); CMPSw_REG(x1, x2); - B_MARK3((rep==1)?cEQ:cNE); + B_MARK3((rex.rep==1)?cEQ:cNE); CBNZx_MARK2(xRCX); MARK3; // end emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5); @@ -1661,12 +2099,15 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } break; case 0xA7: - switch(rep) { + switch(rex.rep) { case 1: case 2: - if(rep==1) {INST_NAME("REPNZ CMPSD");} else {INST_NAME("REPZ CMPSD");} - MAYSETFLAGS(); - SETFLAGS(X_ALL, SF_SET_PENDING); + if(rex.rep==1) {INST_NAME("REPNZ CMPSD");} else {INST_NAME("REPZ CMPSD");} + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); SMREAD(); CBZx_NEXT(xRCX); TBNZ_MARK2(xFlags, F_DF); @@ -1675,7 +2116,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDRxw_S9_postindex(x2, xRDI, rex.w?8:4); SUBx_U12(xRCX, xRCX, 1); CMPSxw_REG(x1, x2); - B_MARK3((rep==1)?cEQ:cNE); + B_MARK3((rex.rep==1)?cEQ:cNE); CBNZx_MARK(xRCX); B_MARK3_nocond; MARK2; // Part with DF==1 @@ -1683,7 +2124,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDRxw_S9_postindex(x2, xRDI, rex.w?-8:-4); SUBx_U12(xRCX, xRCX, 1); CMPSxw_REG(x1, x2); - B_MARK3((rep==1)?cEQ:cNE); + B_MARK3((rex.rep==1)?cEQ:cNE); CBNZx_MARK2(xRCX); MARK3; // end emit_cmp32(dyn, ninst, rex, x1, x2, x3, x4, x5); @@ -1713,25 +2154,53 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("TEST EAX, Id"); SETFLAGS(X_ALL, SF_SET_PENDING); i64 = F32S; - MOV64xw(x2, i64); - emit_test32(dyn, ninst, rex, xRAX, x2, x3, x4, x5); + emit_test32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5); break; case 0xAA: - WILLWRITE(); - if(rep) { + if(rex.rep) { INST_NAME("REP STOSB"); CBZx_NEXT(xRCX); TBNZ_MARK2(xFlags, F_DF); + IF_UNALIGNED(ip) { + MESSAGE(LOG_DEBUG, "\tUnaligned path"); + // special optim for large RCX value on forward case only + // but because it's unaligned path, check if a byte per byt is needed, and do 4-bytes per 4-bytes only instead + ANDw_mask(x1, xRDI, 0, 1); //mask = 3 + CBNZw_MARK(x1); + UXTBw(x3, xRAX); // prepare x3 + ORRw_REG_LSL(x3, x3, x3, 8); + ORRw_REG_LSL(x3, x3, x3, 16); // 4bytes ready + MARK3; + ANDx_mask(x1, xRCX, 1, 0b111110, 0b111101); // mask=0xfffffffffffffffc, so ~3LL + CBZx_MARK(x1); // xRCX<4 + STRw_S9_postindex(x3, xRDI, 4); + SUBx_U12(xRCX, xRCX, 4); + CBNZx_MARK3(xRCX); + CBZx_MARKLOCK(xRCX); + } else { + // special optim for large RCX value on forward case only + UXTBw(x3, xRAX); // prepare x3 + ORRw_REG_LSL(x3, x3, x3, 8); + ORRw_REG_LSL(x3, x3, x3, 16); + ORRx_REG_LSL(x3, x3, x3, 32); // 8 bytes... + MARK3; + ANDx_mask(x1, xRCX, 1, 0b111101, 0b111100); // mask=0xfffffffffffffff8, so ~7LL + CBZx_MARK(x1); // xRCX<8 + STRx_S9_postindex(x3, xRDI, 8); + SUBx_U12(xRCX, xRCX, 8); + CBNZx_MARK3(xRCX); + CBZx_MARKLOCK(xRCX); + } MARK; // Part with DF==0 STRB_S9_postindex(xRAX, xRDI, 1); SUBx_U12(xRCX, xRCX, 1); CBNZx_MARK(xRCX); - B_MARK3_nocond; + B_MARKLOCK_nocond; MARK2; // Part with DF==1 STRB_S9_postindex(xRAX, xRDI, -1); SUBx_U12(xRCX, xRCX, 1); CBNZx_MARK2(xRCX); - MARK3; + MARKLOCK; // done } else { INST_NAME("STOSB"); @@ -1742,8 +2211,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SMWRITE(); break; case 0xAB: - WILLWRITE(); - if(rep) { + if(rex.rep) { INST_NAME("REP STOSD"); CBZx_NEXT(xRCX); TBNZ_MARK2(xFlags, F_DF); @@ -1767,51 +2235,54 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SMWRITE(); break; case 0xAC: - if(rep) { + if(rex.rep) { INST_NAME("REP LODSB"); } else { INST_NAME("LODSB"); } GETDIR(x1, 1); SMREAD(); - if(rep) { + if(rex.rep) { CBZx_NEXT(xRCX); MARK; } LDRB_U12(x2, xRSI, 0); ADDx_REG(xRSI, xRSI, x1); - if(rep) { + if(rex.rep) { SUBx_U12(xRCX, xRCX, 1); CBNZx_MARK(xRCX); } BFIx(xRAX, x2, 0, 8); break; case 0xAD: - if(rep) { + if(rex.rep) { INST_NAME("REP LODSD"); } else { INST_NAME("LODSD"); } GETDIR(x1, rex.w?8:4); - if(rep) { + if(rex.rep) { CBZx_NEXT(xRCX); MARK; } LDRxw_U12(xRAX, xRSI, 0); ADDx_REG(xRSI, xRSI, x1); - if(rep) { + if(rex.rep) { SUBx_U12(xRCX, xRCX, 1); CBNZx_MARK(xRCX); } break; case 0xAE: - switch(rep) { + switch(rex.rep) { case 1: case 2: - if(rep==1) {INST_NAME("REPNZ SCASB");} else {INST_NAME("REPZ SCASB");} - MAYSETFLAGS(); + if(rex.rep==1) {INST_NAME("REPNZ SCASB");} else {INST_NAME("REPZ SCASB");} + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); SMREAD(); - SETFLAGS(X_ALL, SF_SET_PENDING); CBZx_NEXT(xRCX); UBFXw(x1, xRAX, 0, 8); TBNZ_MARK2(xFlags, F_DF); @@ -1819,14 +2290,14 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDRB_S9_postindex(x2, xRDI, 1); SUBx_U12(xRCX, xRCX, 1); CMPSw_REG(x1, x2); - B_MARK3((rep==1)?cEQ:cNE); + B_MARK3((rex.rep==1)?cEQ:cNE); CBNZx_MARK(xRCX); B_MARK3_nocond; MARK2; // Part with DF==1 LDRB_S9_postindex(x2, xRDI, -1); SUBx_U12(xRCX, xRCX, 1); CMPSw_REG(x1, x2); - B_MARK3((rep==1)?cEQ:cNE); + B_MARK3((rex.rep==1)?cEQ:cNE); CBNZx_MARK2(xRCX); MARK3; // end emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5); @@ -1843,27 +2314,30 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } break; case 0xAF: - switch(rep) { + switch(rex.rep) { case 1: case 2: - if(rep==1) {INST_NAME("REPNZ SCASD");} else {INST_NAME("REPZ SCASD");} - MAYSETFLAGS(); + if(rex.rep==1) {INST_NAME("REPNZ SCASD");} else {INST_NAME("REPZ SCASD");} + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); SMREAD(); - SETFLAGS(X_ALL, SF_SET_PENDING); CBZx_NEXT(xRCX); TBNZ_MARK2(xFlags, F_DF); MARK; // Part with DF==0 LDRxw_S9_postindex(x2, xRDI, rex.w?8:4); SUBx_U12(xRCX, xRCX, 1); CMPSxw_REG(xRAX, x2); - B_MARK3((rep==1)?cEQ:cNE); + B_MARK3((rex.rep==1)?cEQ:cNE); CBNZx_MARK(xRCX); B_MARK3_nocond; MARK2; // Part with DF==1 LDRxw_S9_postindex(x2, xRDI, rex.w?-8:-4); SUBx_U12(xRCX, xRCX, 1); CMPSxw_REG(xRAX, x2); - B_MARK3((rep==1)?cEQ:cNE); + B_MARK3((rex.rep==1)?cEQ:cNE); CBNZx_MARK2(xRCX); MARK3; // end emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5); @@ -1888,9 +2362,9 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin u8 = F8; MOV32w(x1, u8); if(rex.rex) - gb1 = xRAX+(opcode&7)+(rex.b<<3); + gb1 = TO_NAT((opcode & 7) + (rex.b << 3)); else - gb1 = xRAX+(opcode&3); + gb1 = TO_NAT(opcode & 3); BFIx(gb1, x1, 0, 8); break; case 0xB4: @@ -1901,10 +2375,10 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin u8 = F8; MOV32w(x1, u8); if(rex.rex) { - gb1 = xRAX+(opcode&7)+(rex.b<<3); + gb1 = TO_NAT((opcode & 7) + (rex.b << 3)); BFIx(gb1, x1, 0, 8); } else { - gb1 = xRAX+(opcode&3); + gb1 = TO_NAT(opcode & 3); BFIx(gb1, x1, 8, 8); } break; @@ -1917,7 +2391,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0xBE: case 0xBF: INST_NAME("MOV Reg, Id"); - gd = xRAX+(opcode&7)+(rex.b<<3); + gd = TO_NAT((opcode & 7) + (rex.b << 3)); if(rex.w) { u64 = F64; MOV64x(gd, u64); @@ -1933,7 +2407,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("ROL Eb, Ib"); u8 = geted_ib(dyn, addr, ninst, nextop)&0x1f; if(u8) { - SETFLAGS(X_CF|X_OF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETEB(x1, 1); u8 = F8&0x1f; emit_rol8c(dyn, ninst, x1, u8, x4, x5); @@ -1947,7 +2421,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("ROR Eb, Ib"); u8 = geted_ib(dyn, addr, ninst, nextop)&0x1f; if(u8) { - SETFLAGS(X_CF|X_OF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETEB(x1, 1); u8 = F8&0x1f; emit_ror8c(dyn, ninst, x1, u8, x4, x5); @@ -1962,7 +2436,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin u8 = geted_ib(dyn, addr, ninst, nextop)&0x1f; if(u8) { READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETEB(x1, 1); u8 = F8&0x1f; emit_rcl8c(dyn, ninst, x1, u8, x4, x5); @@ -1977,7 +2451,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin u8 = geted_ib(dyn, addr, ninst, nextop)&0x1f; if(u8) { READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETEB(x1, 1); u8 = F8&0x1f; emit_rcr8c(dyn, ninst, x1, u8, x4, x5); @@ -2039,7 +2513,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("ROL Ed, Ib"); u8 = geted_ib(dyn, addr, ninst, nextop)&(0x1f+(rex.w*0x20)); if(u8) { - SETFLAGS(X_CF|X_OF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETED(1); u8 = (F8)&(rex.w?0x3f:0x1f); emit_rol32c(dyn, ninst, rex, ed, u8, x3, x4); @@ -2058,7 +2532,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("ROR Ed, Ib"); u8 = geted_ib(dyn, addr, ninst, nextop)&(0x1f+(rex.w*0x20)); if(u8) { - SETFLAGS(X_CF|X_OF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETED(1); u8 = (F8)&(rex.w?0x3f:0x1f); emit_ror32c(dyn, ninst, rex, ed, u8, x3, x4); @@ -2176,23 +2650,31 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0xC2: INST_NAME("RETN"); //SETFLAGS(X_ALL, SF_SET_NODF); // Hack, set all flags (to an unknown state...) - if(box64_dynarec_safeflags) { + if(BOX64DRENV(dynarec_safeflags)) { READFLAGS(X_PEND); // lets play safe here too } - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); // using next, even if there no next + BARRIER(BARRIER_FLOAT); i32 = F16; - retn_to_epilog(dyn, ninst, rex, i32); + POP1z(xRIP); + if(i32>0xfff) { + MOV32w(w1, i32); + ADDz_REG(xRSP, xRSP, x1); + } else { + ADDz_U12(xRSP, xRSP, i32); + } + ret_to_next(dyn, ip, ninst, rex); *need_epilog = 0; *ok = 0; break; case 0xC3: INST_NAME("RET"); // SETFLAGS(X_ALL, SF_SET_NODF); // Hack, set all flags (to an unknown state...) - if(box64_dynarec_safeflags) { + if(BOX64DRENV(dynarec_safeflags)) { READFLAGS(X_PEND); // so instead, force the deferred flags, so it's not too slow, and flags are not lost } - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); // using next, even if there no next - ret_to_epilog(dyn, ninst, rex); + BARRIER(BARRIER_FLOAT); + POP1z(xRIP); + ret_to_next(dyn, ip, ninst, rex); *need_epilog = 0; *ok = 0; break; @@ -2205,7 +2687,6 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDRw_U12(gd, wback, 0); LDRH_U12(x1, wback, 4); STRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_ES])); - STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_ES])); } else { vex_t vex = {0}; vex.rex = rex; @@ -2231,7 +2712,6 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDRw_U12(gd, wback, 0); LDRH_U12(x1, wback, 4); STRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_DS])); - STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_DS])); } else { vex_t vex = {0}; vex.rex = rex; @@ -2248,51 +2728,77 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } break; case 0xC6: - INST_NAME("MOV Eb, Ib"); nextop=F8; - if(MODREG) { // reg <= u8 - u8 = F8; - if(!rex.rex) { - ed = (nextop&7); - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx - eb2 = (ed&4)>>2; // L or H - } else { - eb1 = xRAX+(nextop&7)+(rex.b<<3); - eb2 = 0; - } - MOV32w(x3, u8); - BFIx(eb1, x3, eb2*8, 8); - } else { // mem <= u8 - addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, &unscaled, 0xfff, 0, rex, &lock, 0, 1); - u8 = F8; - if(u8) { - MOV32w(x3, u8); - ed = x3; - } else - ed = xZR; - WILLWRITELOCK(lock); - STB(ed, wback, fixedaddress); - SMWRITELOCK(lock); + switch((nextop>>3)&7) { + case 0: + INST_NAME("MOV Eb, Ib"); + if(MODREG) { // reg <= u8 + u8 = F8; + if(!rex.rex) { + ed = (nextop&7); + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx + eb2 = (ed&4)>>2; // L or H + } else { + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); + eb2 = 0; + } + MOV32w(x3, u8); + BFIx(eb1, x3, eb2*8, 8); + } else { // mem <= u8 + addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, &unscaled, 0xfff, 0, rex, &lock, 0, 1); + u8 = F8; + if(u8) { + MOV32w(x3, u8); + ed = x3; + } else + ed = xZR; + STB(ed, wback, fixedaddress); + SMWRITELOCK(lock); + } + break; + default: + DEFAULT; } break; case 0xC7: - INST_NAME("MOV Ed, Id"); nextop=F8; - if(MODREG) { // reg <= i32 - i64 = F32S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV64xw(ed, i64); - } else { // mem <= i32 - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 4); - i64 = F32S; - if(i64) { - MOV64xw(x3, i64); - ed = x3; - } else - ed = xZR; - WILLWRITELOCK(lock); - STxw(ed, wback, fixedaddress); - SMWRITELOCK(lock); + switch((nextop>>3)&7) { + case 0: + INST_NAME("MOV Ed, Id"); + if(MODREG) { // reg <= i32 + i64 = F32S; + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + MOV64xw(ed, i64); + } else { // mem <= i32 + IF_UNALIGNED(ip) { + MESSAGE(LOG_DEBUG, "\tUnaligned path"); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, &lock, 0, 4); + i64 = F32S; + if(i64) { + MOV64xw(x3, i64); + ed = x3; + } else + ed = xZR; + for(int i=0; i<(1<<(2+rex.w)); ++i) { + STURB_I9(ed, wback, i); + if(ed!=xZR) + RORxw(ed, ed, 8); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 4); + i64 = F32S; + if(i64) { + MOV64xw(x3, i64); + ed = x3; + } else + ed = xZR; + STxw(ed, wback, fixedaddress); + } + SMWRITELOCK(lock); + } + break; + default: + DEFAULT; } break; case 0xC8: @@ -2300,23 +2806,22 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin u16 = F16; u8 = (F8) & 0x1f; if(u8) { - MOVx_REG(x1, xRBP); + MOVz_REG(x1, xRBP); } PUSH1z(xRBP); - MOVx_REG(xRBP, xRSP); + MOVz_REG(xRBP, xRSP); if (u8) { for (u32 = 1; u32 < u8; u32++) { - SUBx_U12(x1, x1, rex.is32bits?4:8); - LDRz_U12(x2, x1, 0); + LDRz_S9_preindex(x2, x1, rex.is32bits?-4:-8); PUSH1z(x2); } PUSH1z(xRBP); } if(u16<4096) { - SUBx_U12(xRSP, xRSP, u16); + SUBz_U12(xRSP, xRSP, u16); } else { MOV32w(x2, u16); - SUBx_REG(xRSP, xRSP, x2); + SUBz_REG(xRSP, xRSP, x2); } break; case 0xC9: @@ -2324,15 +2829,41 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin MOVz_REG(xRSP, xRBP); POP1z(xRBP); break; - + case 0xCA: + INST_NAME("FAR RETN"); + u16 = F16; + READFLAGS(X_PEND); + BARRIER(BARRIER_FLOAT); + if(rex.w) {POP2(xRIP, x3);} else {POP2_32(xRIP, x3);} + STRH_U12(x3, xEmu, offsetof(x64emu_t, segs[_CS])); + if(u16<0x1000) + ADDz_U12(xRSP, xRSP, u16); + else { + MOV32w(x1, u16); + ADDz_REG(xRSP, xRSP, x1); + } + ret_to_next(dyn, ip, ninst, rex); + *need_epilog = 0; + *ok = 0; + break; + case 0xCB: + INST_NAME("FAR RET"); + READFLAGS(X_PEND); + BARRIER(BARRIER_FLOAT); + if(rex.w) {POP2(xRIP, x3);} else {POP2_32(xRIP, x3);} + STRH_U12(x3, xEmu, offsetof(x64emu_t, segs[_CS])); + ret_to_next(dyn, ip, ninst, rex); + *need_epilog = 0; + *ok = 0; + break; case 0xCC: SETFLAGS(X_ALL, SF_SET_NODF); // Hack, set all flags (to an unknown state...) NOTEST(x1); - if(PK(0)=='S' && PK(1)=='C') { + if (IsBridgeSignature(PK(0), PK(1))) { addr+=2; //BARRIER(BARRIER_FLOAT); INST_NAME("Special Box64 instruction"); - if((PK64(0)==0)) + if(PK64(0)==0) { addr+=8; MESSAGE(LOG_DEBUG, "Exit x64 Emu\n"); @@ -2343,7 +2874,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin *ok = 0; *need_epilog = 1; } else { - MESSAGE(LOG_DUMP, "Native Call to %s\n", GetNativeName(GetNativeFnc(ip))); + MESSAGE(LOG_DUMP, "Native Call to %s\n", GetBridgeName((void*)ip) ?: GetNativeName(GetNativeFnc(ip))); x87_stackcount(dyn, ninst, x1); x87_forget(dyn, ninst, x3, x4, 0); sse_purge07cache(dyn, ninst, x3); @@ -2352,20 +2883,20 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin if(isRetX87Wrapper(*(wrapper_t*)(addr))) // return value will be on the stack, so the stack depth needs to be updated x87_purgecache(dyn, ninst, 0, x3, x1, x4); - if((box64_log<2 && !cycle_log) && tmp) { + if ((BOX64ENV(log)<2 && !BOX64ENV(rolling_log) && !BOX64ENV(dynarec_test)) && tmp) { //GETIP(ip+3+8+8); // read the 0xCC - call_n(dyn, ninst, *(void**)(addr+8), tmp); + call_n(dyn, ninst, (void*)(addr+8), tmp); + SMWRITE2(); addr+=8+8; } else { - WILLWRITE2(); GETIP(ip+1); // read the 0xCC STORE_XEMU_CALL(xRIP); + ADDx_U12(x3, xRIP, 8+8+2); // expected return address ADDx_U12(x1, xEmu, (uint32_t)offsetof(x64emu_t, ip)); // setup addr as &emu->ip - CALL_S(x64Int3, -1); + CALL_(const_int3, -1, x3); SMWRITE2(); LOAD_XEMU_CALL(xRIP); addr+=8+8; - TABLE64(x3, addr); // expected return address CMPSx_REG(xRIP, x3); B_MARK(cNE); LDRw_U12(w1, xEmu, offsetof(x64emu_t, quit)); @@ -2377,18 +2908,20 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } } else { INST_NAME("INT 3"); - if(!box64_ignoreint3) { + if(!BOX64ENV(ignoreint3)) { // check if TRAP signal is handled - TABLE64(x1, (uintptr_t)my_context); - MOV32w(x2, offsetof(box64context_t, signals[SIGTRAP])); + TABLE64C(x1, const_context); + MOV32w(x2, offsetof(box64context_t, signals[X64_SIGTRAP])); LDRx_REG(x3, x1, x2); - //LDRx_U12(x3, x1, offsetof(box64context_t, signals[SIGTRAP])); + //LDRx_U12(x3, x1, offsetof(box64context_t, signals[X64_SIGTRAP])); CMPSx_U12(x3, 0); - B_NEXT(cEQ); - GETIP(ip); + B_MARK(cEQ); + GETIP(addr); // update RIP STORE_XEMU_CALL(xRIP); - CALL(native_int3, -1); + CALL_S(const_native_int3, -1); LOAD_XEMU_CALL(xRIP); + MARK; + jump_to_epilog(dyn, addr, 0, ninst); *need_epilog = 0; *ok = 0; } @@ -2397,22 +2930,47 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0xCD: u8 = F8; - if(box64_wine && (u8==0x2D || u8==0x2C || u8==0x29)) { - INST_NAME("INT 29/2c/2d"); + NOTEST(x1); + #ifdef _WIN32 + SMEND(); + GETIP(ip); + STORE_XEMU_CALL(xRIP); + MOV32w(x1, u8); + CALL_S(const_native_int, -1); + LOAD_XEMU_CALL(xRIP); + TABLE64(x3, addr); // expected return address + CMPSx_REG(xRIP, x3); + B_MARK(cNE); + LDRw_U12(w1, xEmu, offsetof(x64emu_t, quit)); + CBZw_NEXT(w1); + MARK; + LOAD_XEMU_REM(); + jump_to_epilog(dyn, 0, xRIP, ninst); + #else + if(box64_wine && (u8==0x2E || u8==0x2D || u8==0x2C || u8==0x29)) { + INST_NAME("INT 29/2c/2d/2e"); // lets do nothing - MESSAGE(LOG_INFO, "INT 29/2c/2d Windows interruption\n"); - GETIP(ip); + MESSAGE(LOG_INFO, "INT 29/2c/2d/2e Windows interruption\n"); + GETIP(ip); // priviledged instruction, IP not updated STORE_XEMU_CALL(xRIP); MOV32w(x1, u8); - CALL(native_int, -1); + CALL_S(const_native_int, -1); LOAD_XEMU_CALL(xRIP); + LOAD_XEMU_REM(); + TABLE64(x3, addr); // expected return address + CMPSx_REG(xRIP, x3); + B_MARK(cNE); + LDRw_U12(w1, xEmu, offsetof(x64emu_t, quit)); + CBZw_NEXT(w1); + MARK; + jump_to_epilog(dyn, 0, xRIP, ninst); } else if (u8==0x80) { INST_NAME("32bits SYSCALL"); NOTEST(x1); SMEND(); GETIP(addr); STORE_XEMU_CALL(xRIP); - CALL_S(x86Syscall, -1); + CALL_S(const_x86syscall, -1); LOAD_XEMU_CALL(xRIP); TABLE64(x3, addr); // expected return address CMPSx_REG(xRIP, x3); @@ -2422,17 +2980,41 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin MARK; LOAD_XEMU_REM(); jump_to_epilog(dyn, 0, xRIP, ninst); + } else if(u8==0x03) { + INST_NAME("INT 3"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(addr); + STORE_XEMU_CALL(xRIP); + CALL_S(const_native_int3, -1); + LOAD_XEMU_CALL(xRIP); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; } else { INST_NAME("INT n"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state - GETIP(ip); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + if(rex.is32bits && u8==0x04) { + GETIP(addr); + } else { + GETIP(ip); // priviledged instruction, IP not updated + } STORE_XEMU_CALL(xRIP); - CALL(native_int, -1); + MOV32w(x1,u8); + CALL_S(const_native_int, -1); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; *ok = 0; } + #endif break; case 0xCE: if(!rex.is32bits) { @@ -2440,18 +3022,19 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } else { INST_NAME("INTO"); READFLAGS(X_OF); - GETIP(ip); + GETIP(addr); TBZ_NEXT(wFlags, F_OF); STORE_XEMU_CALL(xRIP); - CALL(native_int, -1); + MOV32w(x1,4); + CALL_S(const_native_int, -1); LOAD_XEMU_CALL(xRIP); } break; case 0xCF: INST_NAME("IRET"); - SETFLAGS(X_ALL, SF_SET_NODF); // Not a hack, EFLAGS are restored + SETFLAGS(X_ALL, SF_SET_DF); // Not a hack, EFLAGS are restored BARRIER(BARRIER_FLOAT); - iret_to_epilog(dyn, ninst, rex.w); + iret_to_next(dyn, ip, ninst, rex.is32bits, rex.w); *need_epilog = 0; *ok = 0; break; @@ -2460,14 +3043,14 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: INST_NAME("ROL Eb, 1"); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETEB(x1, 0); emit_rol8c(dyn, ninst, ed, 1, x4, x5); EBBACK; break; case 1: INST_NAME("ROR Eb, 1"); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETEB(x1, 0); emit_ror8c(dyn, ninst, ed, 1, x4, x5); EBBACK; @@ -2517,14 +3100,14 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: INST_NAME("ROL Ed, 1"); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETED(0); emit_rol32c(dyn, ninst, rex, ed, 1, x3, x4); WBACK; break; case 1: INST_NAME("ROR Ed, 1"); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETED(0); emit_ror32c(dyn, ninst, rex, ed, 1, x3, x4); WBACK; @@ -2569,103 +3152,159 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; } break; - case 0xD2: // TODO: Jump if CL is 0 + case 0xD2: nextop = F8; switch((nextop>>3)&7) { case 0: INST_NAME("ROL Eb, CL"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_OF|X_CF); + } SETFLAGS(X_OF|X_CF, SF_SUBSET); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); UFLAG_IF { - UFLAG_DF(x2, d_none); - TSTw_mask(xRCX, 0, 0b00100); //mask=0x00000001f - B_NEXT(cEQ); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); } ANDw_mask(x2, xRCX, 0, 0b00010); //mask=0x000000007 MOV32w(x4, 8); SUBx_REG(x2, x4, x2); GETEB(x1, 0); + IFX2(X_OF, && !BOX64ENV(cputype)) { + LSRw(x4, ed, 6); + EORw_REG_LSR(x4, x4, x4, 1); + BFIw(xFlags, x4, F_OF, 1); + } ORRw_REG_LSL(ed, ed, ed, 8); LSRw_REG(ed, ed, x2); EBBACK; - UFLAG_IF { // calculate flags directly - IFX(X_OF) { - CMPSw_U12(x2, 7); - B_MARK(cNE); - EORxw_REG_LSR(x3, ed, ed, 7); - BFIw(xFlags, x3, F_OF, 1); - MARK; - } - IFX(X_CF) { - BFIw(xFlags, ed, F_CF, 1); - } + IFX2(X_OF, && BOX64ENV(cputype)) { + EORxw_REG_LSR(x3, ed, ed, 7); + BFIw(xFlags, x3, F_OF, 1); + } + IFX(X_CF) { + BFIw(xFlags, ed, F_CF, 1); } break; case 1: INST_NAME("ROR Eb, CL"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_OF|X_CF); + } SETFLAGS(X_OF|X_CF, SF_SUBSET); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); UFLAG_IF { - UFLAG_DF(x2, d_none); - TSTw_mask(xRCX, 0, 0b00100); //mask=0x00000001f - B_NEXT(cEQ); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); } ANDw_mask(x2, xRCX, 0, 0b00010); //mask=0x000000007 GETEB(x1, 0); + IFX2(X_OF, && !BOX64ENV(cputype)) { + EORw_REG_LSR(x4, ed, ed, 7); + BFIw(xFlags, x4, F_OF, 1); + } ORRw_REG_LSL(ed, ed, ed, 8); LSRw_REG(ed, ed, x2); EBBACK; - UFLAG_IF { // calculate flags directly - IFX(X_OF) { - CMPSw_U12(x2, 1); - B_MARK(cNE); - LSRxw(x2, ed, 6); // x2 = d>>6 - EORw_REG_LSR(x2, x2, x2, 1); // x2 = ((d>>6) ^ ((d>>6)>>1)) - BFIw(xFlags, x2, F_OF, 1); - MARK; - } - IFX(X_CF) { - BFXILw(xFlags, ed, 7, 1); - } + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRxw(x2, ed, 6); // x2 = d>>6 + EORw_REG_LSR(x2, x2, x2, 1); // x2 = ((d>>6) ^ ((d>>6)>>1)) + BFIw(xFlags, x2, F_OF, 1); + } + IFX(X_CF) { + BFXILw(xFlags, ed, 7, 1); } break; case 2: INST_NAME("RCL Eb, CL"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - READFLAGS(X_CF); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - ANDSw_mask(x2, xRCX, 0, 0b00100); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_OF|X_CF); + } else { + READFLAGS(X_CF); + } + SETFLAGS(X_OF|X_CF, SF_SUBSET); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); + // get CL % 9 + MOV32w(x3, 0x1c72); // 0x10000 / 9 + 1 (this is precise enough in the 0..31 range) + MULw(x3, x3, x2); + LSRw(x3, x3, 16); // x3 = CL / 9 + MOV32w(x4, 9); + MSUBw(x2, x3, x4, x2); // CL mod 9 GETEB(x1, 0); - CALL_(rcl8, x1, x3); + CBZw_MARK(x2); + IFX2(X_OF, && !BOX64ENV(cputype)) { + LSRw(x5, ed, 6); + EORw_REG_LSR(x5, x5, x5, 1); + BFIw(xFlags, x5, F_OF, 1); + } + BFIw(ed, xFlags, 8, 1); // insert CF + ORRw_REG_LSL(ed, ed, ed, 9); // insert rest of ed + SUBw_REG(x2, x4, x2); + IFX(X_OF|X_CF) { + SUBw_U12(x5, x2, 1); + LSRw_REG(x5, ed, x5); // keep the new CF in x5 + } + LSRw_REG(ed, ed, x2); EBBACK; + u8 = X_CF; + if(BOX64ENV(cputype)) u8 |= X_OF; + IFX(u8) { + BFXILw(xFlags, x5, 0, 1); + } + MARK; + IFX2(X_OF, && BOX64ENV(cputype)) { + EORw_REG_LSR(x2, xFlags, ed, 7); + BFIw(xFlags, x2, F_OF, 1); + } break; case 3: INST_NAME("RCR Eb, CL"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - READFLAGS(X_CF); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - ANDSw_mask(x2, xRCX, 0, 0b00100); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_OF|X_CF); + } else { + READFLAGS(X_CF); + } + SETFLAGS(X_OF|X_CF, SF_SUBSET); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); + // get CL % 9 + MOV32w(x3, 0x1c72); // 0x10000 / 9 + 1 + MULw(x3, x3, x2); + LSRw(x3, x3, 16); // x3 = CL / 9 + MOV32w(x4, 9); + MSUBw(x2, x3, x4, x2); // CL mod 9 GETEB(x1, 0); - CALL_(rcr8, x1, x3); + CBZw_MARK(x2); + BFIw(ed, xFlags, 8, 1); // insert CF + ORRw_REG_LSL(ed, ed, ed, 9); // insert rest of ed + IFX2(X_OF, && !BOX64ENV(cputype)) { + EORw_REG_LSR(x5, xFlags, ed, 7); + BFIw(xFlags, x5, F_OF, 1); + } + IFX(X_CF) { + SUBw_U12(x4, x2, 1); + LSRw_REG(x5, ed, x4); + BFIw(xFlags, x5, F_CF, 1); + } + LSRw_REG(ed, ed, x2); EBBACK; + MARK; + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRw(x4, ed, 6); + EORw_REG_LSR(x4, x4, x4, 1); + BFIw(xFlags, x4, F_OF, 1); + } break; case 4: case 6: INST_NAME("SHL Eb, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f UFLAG_IF { - ANDSw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f - B_NEXT(cEQ); - } else { - ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); } GETEB(x1, 0); emit_shl8(dyn, ninst, x1, x2, x5, x4); @@ -2673,14 +3312,14 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 5: INST_NAME("SHR Eb, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f UFLAG_IF { - ANDSw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f - B_NEXT(cEQ); - } else { - ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); } GETEB(x1, 0); emit_shr8(dyn, ninst, x1, x2, x5, x4); @@ -2688,14 +3327,14 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 7: INST_NAME("SAR Eb, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f UFLAG_IF { - ANDSw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f - B_NEXT(cEQ); - } else { - ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); } GETSEB(x1, 0); emit_sar8(dyn, ninst, x1, x2, x5, x4); @@ -2708,202 +3347,170 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: INST_NAME("ROL Ed, CL"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_OF|X_CF); + } SETFLAGS(X_OF|X_CF, SF_SUBSET); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(rex.w) { + ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f + } else { + ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f + } UFLAG_IF { UFLAG_DF(x2, d_none); - if(rex.w) { - ANDSx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } - } else { - if(rex.w) { - ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } } - MOV64xw(x4, (rex.w?64:32)); - SUBx_REG(x3, x4, x3); GETED(0); - UFLAG_IF { - if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); + if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} + CBZw_NEXT(x3); + IFX2(X_OF, && !BOX64ENV(cputype)) { + LSRxw(x4, ed, rex.w?62:30); + EORw_REG_LSR(x4, x4, x4, 1); + BFIw(xFlags, x4, F_OF, 1); } + MOV64xw(x4, (rex.w?64:32)); + SUBx_REG(x3, x4, x3); RORxw_REG(ed, ed, x3); WBACK; - UFLAG_IF { // calculate flags directly - IFX(X_OF) { - CMPSw_U12(x3, rex.w?63:31); - B_MARK(cNE); - ADDxw_REG_LSR(x1, ed, ed, rex.w?63:31); - BFIw(xFlags, x1, F_OF, 1); - MARK; - } - IFX(X_CF) { - BFIw(xFlags, ed, F_CF, 1); - } + IFX2(X_OF, && BOX64ENV(cputype)) { + EORxw_REG_LSR(x4, ed, ed, rex.w?63:31); + BFIw(xFlags, x4, F_OF, 1); + } + IFX(X_CF) { + BFIw(xFlags, ed, F_CF, 1); } break; case 1: INST_NAME("ROR Ed, CL"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_OF|X_CF); + } SETFLAGS(X_OF|X_CF, SF_SUBSET); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); - UFLAG_IF { - UFLAG_DF(x2, d_none); - if(rex.w) { - ANDSx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } + if(rex.w) { + ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f } else { - if(rex.w) { - ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } + ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f } + SET_DFNONE(); GETED(0); - UFLAG_IF { - if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); + if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} + CBZw_NEXT(x3); + IFX2(X_OF, && !BOX64ENV(cputype)) { + EORxw_REG_LSR(x4, ed, ed, rex.w?63:31); + BFIw(xFlags, x4, F_OF, 1); } RORxw_REG(ed, ed, x3); WBACK; - UFLAG_IF { // calculate flags directly - IFX(X_OF) { - CMPSw_U12(x3, 1); - B_MARK(cNE); - LSRxw(x2, ed, rex.w?62:30); // x2 = d>>30 - EORw_REG_LSR(x2, x2, x2, 1); // x2 = ((d>>30) ^ ((d>>30)>>1)) - BFIw(xFlags, x2, F_OF, 1); - MARK; - } - IFX(X_CF) { - BFXILxw(xFlags, ed, rex.w?63:31, 1); - } + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRxw(x2, ed, rex.w?62:30); // x2 = d>>30 + EORw_REG_LSR(x2, x2, x2, 1); // x2 = ((d>>30) ^ ((d>>30)>>1)) + BFIw(xFlags, x2, F_OF, 1); + } + IFX(X_CF) { + BFXILxw(xFlags, ed, rex.w?63:31, 1); } break; case 2: INST_NAME("RCL Ed, CL"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_OF|X_CF); + } else { + READFLAGS(X_CF); + } + SETFLAGS(X_OF|X_CF, SF_SUBSET); if(rex.w) { - ANDSx_mask(x2, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f + ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f } else { - ANDSw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f } - GETEDW(x4, x1, 0); - if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); - CALL_(rex.w?((void*)rcl64):((void*)rcl32), ed, x4); + GETED(0); + UFLAG_IF { + if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} + } + CBZw_NEXT(x3); + emit_rcl32(dyn, ninst, rex, ed, x3, x5, x4, x6); WBACK; break; case 3: INST_NAME("RCR Ed, CL"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_OF|X_CF); + } else { + READFLAGS(X_CF); + } + SETFLAGS(X_OF|X_CF, SF_SUBSET); if(rex.w) { - ANDSx_mask(x2, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f + ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f } else { - ANDSw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f } - GETEDW(x4, x1, 0); - if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); - CALL_(rex.w?((void*)rcr64):((void*)rcr32), ed, x4); + GETED(0); + UFLAG_IF { + if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} + } + CBZw_NEXT(x3); + emit_rcr32(dyn, ninst, rex, ed, x3, x5, x4, x6); WBACK; break; case 4: case 6: INST_NAME("SHL Ed, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); - UFLAG_IF { - if(rex.w) { - ANDSx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); + if(rex.w) { + ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f } else { - if(rex.w) { - ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } + ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f } GETED(0); UFLAG_IF { if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); + CBZw_NEXT(x3); } emit_shl32(dyn, ninst, rex, ed, x3, x5, x4); WBACK; break; case 5: INST_NAME("SHR Ed, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); - UFLAG_IF { - if(rex.w) { - ANDSx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); + if(rex.w) { + ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f } else { - if(rex.w) { - ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } + ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f } GETED(0); UFLAG_IF { if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); + CBZw_NEXT(x3); } emit_shr32(dyn, ninst, rex, ed, x3, x5, x4); WBACK; break; case 7: INST_NAME("SAR Ed, CL"); - SETFLAGS(X_ALL, SF_PENDING); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); - UFLAG_IF { - if(rex.w) { - ANDSx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); + if(rex.w) { + ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f } else { - if(rex.w) { - ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } + ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f } GETED(0); UFLAG_IF { if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); + CBZw_NEXT(x3); } - UFLAG_OP12(ed, x3); - ASRxw_REG(ed, ed, x3); + emit_sar32(dyn, ninst, rex, ed, x3, x5, x4); WBACK; - UFLAG_RES(ed); - UFLAG_DF(x3, rex.w?d_sar64:d_sar32); break; } break; @@ -2914,10 +3521,20 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin UBFXx(x1, xRAX, 0, 8); // load AL u8 = F8; MOV32w(x2, u8); - CALL_(aam16, x1, 0); + CALL_(const_aam16, x1, 0); BFIz(xRAX, x1, 0, 16); } else { - DEFAULT; + INST_NAME("Illegal D4"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0xD5: @@ -2927,91 +3544,137 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin UBFXx(x1, xRAX, 0, 16); // load AX u8 = F8; MOV32w(x2, u8); - CALL_(aad16, x1, 0); + CALL_(const_aad16, x1, 0); BFIz(xRAX, x1, 0, 16); } else { - DEFAULT; + INST_NAME("Illegal D5"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; } break; case 0xD7: INST_NAME("XLAT"); - UXTBw(x1, xRAX); + if(rex.seg) { + grab_segdata(dyn, addr, ninst, x1, rex.seg); + ADDz_UXTB(x1, x1, xRAX); + } else { + UXTBw(x1, xRAX); + } LDRB_REG(x1, xRBX, x1); BFIx(xRAX, x1, 0, 8); break; case 0xD8: - addr = dynarec64_D8(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_D8(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xD9: - addr = dynarec64_D9(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_D9(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xDA: - addr = dynarec64_DA(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_DA(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xDB: - addr = dynarec64_DB(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_DB(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xDC: - addr = dynarec64_DC(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_DC(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xDD: - addr = dynarec64_DD(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_DD(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xDE: - addr = dynarec64_DE(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_DE(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xDF: - addr = dynarec64_DF(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_DF(dyn, addr, ip, ninst, rex, ok, need_epilog); break; - #define GO(Z) \ - BARRIER(BARRIER_MAYBE); \ + #define GO(Z, R) \ JUMP(addr+i8, 1); \ if(dyn->insts[ninst].x64.jmp_insts==-1 || \ CHECK_CACHE()) { \ /* out of the block */ \ i32 = dyn->insts[ninst].epilog-(dyn->native_size); \ - if(Z) {CBNZz(xRCX, i32);} else {CBZz(xRCX, i32);}; \ + if(Z) {CBNZy(R, i32);} else {CBZy(R, i32);}; \ if(dyn->insts[ninst].x64.jmp_insts==-1) { \ if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \ - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ + fpu_purgecache(dyn, ninst, 1, x1, x2, x3, 0); \ jump_to_next(dyn, addr+i8, 0, ninst, rex.is32bits); \ } else { \ - CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ + CacheTransform(dyn, ninst, cacheupd); \ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ + SKIP_SEVL(i32); \ Bcond(c__, i32); \ } \ } else { \ /* inside the block */ \ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ - if(Z) {CBZz(xRCX, i32);} else {CBNZz(xRCX, i32);}; \ + SKIP_SEVL(i32); \ + if(Z) {CBZy(R, i32);} else {CBNZy(R, i32);}; \ } case 0xE0: INST_NAME("LOOPNZ"); READFLAGS(X_ZF); + SMEND(); i8 = F8S; - SUBz_U12(xRCX, xRCX, 1); - TBNZ_NEXT(xFlags, F_ZF); - GO(0); + if(rex.is32bits && rex.is67) { + UXTHw(x1, xRCX); + SUBw_U12(x1, x1, 1); + BFIx(xRCX, x1, 0, 16); + TBNZ_NEXT(xFlags, F_ZF); + GO(0, x1); + } else { + SUBy_U12(xRCX, xRCX, 1); + TBNZ_NEXT(xFlags, F_ZF); + GO(0, xRCX); + } break; case 0xE1: INST_NAME("LOOPZ"); READFLAGS(X_ZF); + SMEND(); i8 = F8S; - SUBz_U12(xRCX, xRCX, 1); - TBZ_NEXT(xFlags, F_ZF); - GO(0); + if(rex.is32bits && rex.is67) { + UXTHw(x1, xRCX); + SUBw_U12(x1, x1, 1); + BFIx(xRCX, x1, 0, 16); + TBZ_NEXT(xFlags, F_ZF); + GO(0, x1); + } else { + SUBy_U12(xRCX, xRCX, 1); + TBZ_NEXT(xFlags, F_ZF); + GO(0, xRCX); + } break; case 0xE2: INST_NAME("LOOP"); i8 = F8S; - SUBz_U12(xRCX, xRCX, 1); - GO(0); + if(rex.is32bits && rex.is67) { + UXTHw(x1, xRCX); + SUBSw_U12(x1, x1, 1); + BFIx(xRCX, x1, 0, 16); + GO(0, x1); + } else { + SUBy_U12(xRCX, xRCX, 1); + GO(0, xRCX); + } break; case 0xE3: - INST_NAME("JECXZ"); + INST_NAME("JRCXZ"); i8 = F8S; - GO(1); + if(rex.is32bits && rex.is67) { + UXTHw(x1, xRCX); + GO(1, x1); + } else { + GO(1, xRCX); + } break; #undef GO case 0xE4: /* IN AL, Ib */ @@ -3019,29 +3682,37 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0xE6: /* OUT Ib, AL */ case 0xE7: /* OUT Ib, EAX */ INST_NAME(opcode==0xE4?"IN AL, Ib":(opcode==0xE5?"IN EAX, Ib":(opcode==0xE6?"OUT Ib, AL":"OUT Ib, EAX"))); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state - u8 = F8; - GETIP(ip); - STORE_XEMU_CALL(xRIP); - CALL(native_priv, -1); - LOAD_XEMU_CALL(xRIP); - jump_to_epilog(dyn, 0, xRIP, ninst); - *need_epilog = 0; - *ok = 0; + if (rex.is32bits && BOX64ENV(ignoreint3)) { + F8; + } else { + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + u8 = F8; + GETIP(ip); + STORE_XEMU_CALL(xRIP); + CALL_S(const_native_priv, -1); + LOAD_XEMU_CALL(xRIP); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + } break; case 0xE8: INST_NAME("CALL Id"); - i32 = F32S; + i32 = (rex.is32bits && rex.is66)?F16S:F32S; if(addr+i32==0) { #if STEP == 3 printf_log(LOG_INFO, "Warning, CALL to 0x0 at %p (%p)\n", (void*)addr, (void*)(addr-1)); #endif } #if STEP < 2 - if(!rex.is32bits && isNativeCall(dyn, addr+i32, &dyn->insts[ninst].natcall, &dyn->insts[ninst].retn)) + if (!rex.is32bits && !dyn->need_reloc && IsNativeCall(addr + i32, rex.is32bits, &dyn->insts[ninst].natcall, &dyn->insts[ninst].retn)) tmp = dyn->insts[ninst].pass2choice = 3; else - tmp = dyn->insts[ninst].pass2choice = 0; + tmp = dyn->insts[ninst].pass2choice = i32?0:1; #else tmp = dyn->insts[ninst].pass2choice; #endif @@ -3050,26 +3721,31 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags to "dont'care" state if(dyn->last_ip && (addr-dyn->last_ip<0x1000)) { ADDx_U12(x2, xRIP, addr-dyn->last_ip); + } else if(dyn->last_ip && (dyn->last_ip-addr<0x1000)) { + SUBx_U12(x2, xRIP, dyn->last_ip-addr); } else { - TABLE64(x2, addr); + if(dyn->need_reloc) { + TABLE64(x2, addr); + } else { + MOV64x(x2, addr); + } } - WILLWRITE2(); PUSH1(x2); - MESSAGE(LOG_DUMP, "Native Call to %s (retn=%d)\n", GetNativeName(GetNativeFnc(dyn->insts[ninst].natcall-1)), dyn->insts[ninst].retn); SKIPTEST(x1); // disable test as this hack dos 2 instructions for 1 // calling a native function SMEND(); sse_purge07cache(dyn, ninst, x3); - if((box64_log<2 && !cycle_log) && dyn->insts[ninst].natcall) { + if ((BOX64ENV(log) < 2 && !BOX64ENV(rolling_log) && !BOX64ENV(dynarec_test)) && dyn->insts[ninst].natcall) { tmp=isSimpleWrapper(*(wrapper_t*)(dyn->insts[ninst].natcall+2)); } else tmp=0; + MESSAGE(LOG_DUMP, "Native Call to %s (retn=%d, simpleWrapper=%d)\n", GetBridgeName((void*)(dyn->insts[ninst].natcall - 1)) ?: GetNativeName(GetNativeFnc(dyn->insts[ninst].natcall - 1)), dyn->insts[ninst].retn, tmp); if(dyn->insts[ninst].natcall && isRetX87Wrapper(*(wrapper_t*)(dyn->insts[ninst].natcall+2))) // return value will be on the stack, so the stack depth needs to be updated x87_purgecache(dyn, ninst, 0, x3, x1, x4); - if((box64_log<2 && !cycle_log) && dyn->insts[ninst].natcall && tmp) { + if ((BOX64ENV(log)<2 && !BOX64ENV(rolling_log)) && dyn->insts[ninst].natcall && tmp) { //GETIP(ip+3+8+8); // read the 0xCC - call_n(dyn, ninst, *(void**)(dyn->insts[ninst].natcall+2+8), tmp); + call_n(dyn, ninst, (void*)(dyn->insts[ninst].natcall+2+8), tmp); SMWRITE2(); POP1(xRIP); // pop the return address dyn->last_ip = addr; @@ -3077,10 +3753,11 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETIP_(dyn->insts[ninst].natcall); // read the 0xCC already STORE_XEMU_CALL(xRIP); ADDx_U12(x1, xEmu, (uint32_t)offsetof(x64emu_t, ip)); // setup addr as &emu->ip - CALL_S(x64Int3, -1); + CALL_S(const_int3, -1); SMWRITE2(); LOAD_XEMU_CALL(xRIP); - TABLE64(x3, dyn->insts[ninst].natcall); + // in case of dyn->need_reloc, the previous GETIP_ will end up in a TABLE64 that will generate a RELOC_CANCELBLOCK as natcall will be out of the mmap space anyway + MOV64x(x3, dyn->insts[ninst].natcall); ADDx_U12(x3, x3, 2+8+8); CMPSx_REG(xRIP, x3); B_MARK(cNE); // Not the expected address, exit dynarec block @@ -3088,9 +3765,6 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin if(dyn->insts[ninst].retn) { ADDx_U12(xRSP, xRSP, dyn->insts[ninst].retn); } - TABLE64(x3, addr); - CMPSx_REG(xRIP, x3); - B_MARK(cNE); // Not the expected address again LDRw_U12(w1, xEmu, offsetof(x64emu_t, quit)); CBZw_NEXT(w1); // not quitting, so lets continue MARK; @@ -3099,55 +3773,81 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin dyn->last_ip = addr; } break; + case 1: + // this is call to next step, so just push the return address to the stack + if(dyn->need_reloc) { + TABLE64(x2, addr); + } else { + MOV64x(x2, addr); + } + PUSH1z(x2); + break; default: - if((box64_dynarec_safeflags>1) || (ninst && dyn->insts[ninst-1].x64.set_flags)) { + if ((BOX64DRENV(dynarec_safeflags) > 1) || (ninst && dyn->insts[ninst - 1].x64.set_flags)) { READFLAGS(X_PEND); // that's suspicious } else { SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags to "dont'care" state } // regular call - /*if(box64_dynarec_callret && box64_dynarec_bigblock>1) { - BARRIER(BARRIER_FULL); - BARRIER_NEXT(BARRIER_FULL); - } else { - BARRIER(BARRIER_FLOAT); - *need_epilog = 0; - *ok = 0; - }*/ - if(rex.is32bits) { - MOV32w(x2, addr); - } else { + if(dyn->need_reloc) { TABLE64(x2, addr); + } else { + MOV64x(x2, addr); } - fpu_purgecache(dyn, ninst, 1, x1, x3, x4); + BARRIER(BARRIER_FLOAT); + //fpu_purgecache(dyn, ninst, 0, x1, x3, x4, 0); PUSH1z(x2); - if(box64_dynarec_callret) { + if (BOX64DRENV(dynarec_callret)) { SET_HASCALLRET(); // Push actual return address if(addr < (dyn->start+dyn->isize)) { // there is a next... - j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; + if(BOX64DRENV(dynarec_callret)>1) + j64 = CALLRET_GETRET(); + else + j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; ADR_S20(x4, j64); MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64>>2); } else { - MESSAGE(LOG_NONE, "\tCALLRET set return to Jmptable(%p)\n", (void*)addr); - j64 = getJumpTableAddress64(addr); - TABLE64(x4, j64); - LDRx_U12(x4, x4, 0); + if(BOX64DRENV(dynarec_callret)>1) + j64 = CALLRET_GETRET(); + else + j64 = (dyn->insts)?(GETMARK-(dyn->native_size)):0; + ADR_S20(x4, j64); + MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64>>2); } STPx_S7_preindex(x4, x2, xSP, -16); } else { *ok = 0; *need_epilog = 0; } - jump_to_next(dyn, addr+i32, 0, ninst, rex.is32bits); + if(rex.is32bits) + j64 = (uint32_t)(addr+i32); + else + j64 = addr+i32; + jump_to_next(dyn, j64, 0, ninst, rex.is32bits); + int can_continue = (addr < (dyn->start + dyn->isize)); + CALLRET_RET(can_continue); + if (BOX64DRENV(dynarec_callret) && !can_continue) { + // jumps out of current dynablock... + MARK; + j64 = getJumpTableAddress64(addr); + if(dyn->need_reloc) { + AddRelocTable64JmpTbl(dyn, ninst, addr, STEP); + TABLE64_(x4, j64); + } else { + MOV64x(x4, j64); + } + LDRx_U12(x4, x4, 0); + BR(x4); + } + CLEARIP(); break; } break; case 0xE9: case 0xEB: - BARRIER(BARRIER_MAYBE); - if (box64_dynarec_test == 2) { NOTEST(x1); } + BARRIER(BARRIER_MAYBE); // there will be a barrier if there is a jump out if(opcode==0xEB && PK(0)==0xFF) { INST_NAME("JMP ib"); MESSAGE(LOG_DEBUG, "Hack for EB FF opcode"); @@ -3155,7 +3855,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } else { if(opcode==0xE9) { INST_NAME("JMP Id"); - i32 = F32S; + i32 = (rex.is32bits && rex.is66)?F16S:F32S; } else { INST_NAME("JMP Ib"); i32 = F8S; @@ -3164,16 +3864,17 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin j64 = (uint32_t)(addr+i32); else j64 = addr+i32; - - JUMP((uintptr_t)getAlternate((void*)j64), 0); + j64 = (uintptr_t)getAlternate((void*)j64); + JUMP(j64, 0); if(dyn->insts[ninst].x64.jmp_insts==-1) { // out of the block - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); - jump_to_next(dyn, (uintptr_t)getAlternate((void*)j64), 0, ninst, rex.is32bits); + BARRIER(BARRIER_FLOAT); + jump_to_next(dyn, j64, 0, ninst, rex.is32bits); } else { // inside the block - CacheTransform(dyn, ninst, CHECK_CACHE(), x1, x2, x3); + CacheTransform(dyn, ninst, CHECK_CACHE()); tmp = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); + SKIP_SEVL(tmp); if(tmp==4) { NOP; } else { @@ -3184,33 +3885,79 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin *ok = 0; } break; - + case 0xEA: + if(rex.is32bits) { + DEFAULT; + } else { + INST_NAME("Illegal EA"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + BARRIER(BARRIER_FLOAT); + UDF(0); + *need_epilog = 1; + *ok = 0; + } + break; case 0xEC: /* IN AL, DX */ case 0xED: /* IN EAX, DX */ case 0xEE: /* OUT DX, AL */ case 0xEF: /* OUT DX, EAX */ INST_NAME(opcode==0xEC?"IN AL, DX":(opcode==0xED?"IN EAX, DX":(opcode==0xEE?"OUT DX, AL":"OUT DX, EAX"))); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + if(rex.is32bits && BOX64ENV(ignoreint3)) + {} else { + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + STORE_XEMU_CALL(xRIP); + CALL_S(const_native_priv, -1); + LOAD_XEMU_CALL(xRIP); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + } + break; + + case 0xF1: + INST_NAME("INT1"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } GETIP(ip); STORE_XEMU_CALL(xRIP); - CALL(native_priv, -1); + CALL_S(const_native_priv, -1); // is that a privileged opcodes or an int 1?? LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; *ok = 0; break; - case 0xF0: - addr = dynarec64_F0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); - break; - case 0xF4: INST_NAME("HLT"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state - GETIP(ip); - STORE_XEMU_CALL(xRIP); - CALL(native_priv, -1); - LOAD_XEMU_CALL(xRIP); + if (box64_unittest_mode) { // HLT in unittest mode is an exit + READFLAGS(X_ALL); + BARRIER(BARRIER_FLOAT); + MOV32w(x1, 1); + STRw_U12(x1, xEmu, offsetof(x64emu_t, quit)); + } else { + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + STORE_XEMU_CALL(xRIP); + CALL_S(const_native_priv, -1); + LOAD_XEMU_CALL(xRIP); + } jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; *ok = 0; @@ -3235,9 +3982,15 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 2: INST_NAME("NOT Eb"); - GETEB(x1, 0); - MVNw_REG(x1, x1); - EBBACK; + if(MODREG) { + CALCEB(); + int mask = convert_bitmask_x(0xff<>12)&1, mask&0x3F, (mask>>6)&0x3F); + } else { + GETEB(x1, 0); + MVNw_REG(x1, x1); + EBBACK; + } break; case 3: INST_NAME("NEG Eb"); @@ -3247,57 +4000,118 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin EBBACK; break; case 4: - INST_NAME("MUL AL, Ed"); - SETFLAGS(X_ALL, SF_PENDING); + INST_NAME("MUL AL, Eb"); + if (BOX64DRENV(dynarec_safeflags) && BOX64ENV(cputype)) { + SETFLAGS(X_OF|X_CF, SF_SET); + } else { + SETFLAGS(X_ALL, SF_SET); + } GETEB(x1, 0); UXTBw(x2, xRAX); MULw(x1, x2, x1); - UFLAG_RES(x1); BFIx(xRAX, x1, 0, 16); - UFLAG_DF(x1, d_mul8); + SET_DFNONE(); + IFX(X_CF|X_OF) { + CMPSw_REG_LSR(xZR, x1, 8); + CSETw(x3, cNE); + IFX(X_CF) { + BFIw(xFlags, x3, F_CF, 1); + } + IFX(X_OF) { + BFIw(xFlags, x3, F_OF, 1); + } + } + IFX2(X_AF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_AF, 1);} + IFX2(X_ZF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX2(X_SF, && !BOX64ENV(cputype)) { + LSRxw(x3, xRAX, 7); + BFIw(xFlags, x3, F_SF, 1); + } + IFX2(X_PF, && !BOX64ENV(cputype)) emit_pf(dyn, ninst, xRAX, x3); break; case 5: INST_NAME("IMUL AL, Eb"); - SETFLAGS(X_ALL, SF_PENDING); + if (BOX64DRENV(dynarec_safeflags) && BOX64ENV(cputype)) { + SETFLAGS(X_OF|X_CF, SF_SET); + } else { + SETFLAGS(X_ALL, SF_SET); + } GETSEB(x1, 0); SXTBw(x2, xRAX); MULw(x1, x2, x1); - UFLAG_RES(x1); BFIx(xRAX, x1, 0, 16); - UFLAG_DF(x1, d_imul8); + SET_DFNONE(); + IFX(X_CF|X_OF) { + SXTHw(x1, xRAX); + SXTBw(x2, x1); + CMPSw_REG(x2, x1); + CSETw(x3, cNE); + IFX(X_CF) { + BFIw(xFlags, x3, F_CF, 1); + } + IFX(X_OF) { + BFIw(xFlags, x3, F_OF, 1); + } + } + IFX2(X_AF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_AF, 1);} + IFX2(X_ZF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX2(X_SF, && !BOX64ENV(cputype)) { + LSRxw(x3, xRAX, 7); + BFIw(xFlags, x3, F_SF, 1); + } + IFX2(X_PF, && !BOX64ENV(cputype)) emit_pf(dyn, ninst, xRAX, x3); break; case 6: INST_NAME("DIV Eb"); SETFLAGS(X_ALL, SF_SET); - SET_DFNONE(x1); + FORCE_DFNONE(); GETEB(x1, 0); UXTHw(x2, xRAX); - if(box64_dynarec_div0) { + if(BOX64ENV(dynarec_div0)) { CBNZw_MARK3(ed); + MARK2; GETIP_(ip); STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); + CALL_S(const_native_div0, -1); CLEARIP(); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); MARK3; } UDIVw(x3, x2, ed); + if(BOX64ENV(dynarec_div0)) { + SUBw_UXTB(x4, x3, x3); + CBNZw_MARK2(x4); + } MSUBw(x4, x3, ed, x2); // x4 = x2 mod ed (i.e. x2 - x3*ed) BFIx(xRAX, x3, 0, 8); BFIx(xRAX, x4, 8, 8); + FORCE_DFNONE(); + IFX(X_OF) {BFCw(xFlags, F_OF, 1);} + IFX(X_CF) {BFCw(xFlags, F_CF, 1);} + IFX2(X_AF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_AF, 1);} + IFX2(X_AF, && BOX64ENV(cputype)) {ORRw_mask(xFlags, xFlags, 28, 0);} //mask=0x10 + IFX2(X_ZF, && !BOX64ENV(cputype)) {ORRw_mask(xFlags, xFlags, 26, 0);} //mask=0x40 + IFX2(X_ZF, && BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX(X_SF) {BFCw(xFlags, F_SF, 1);} + IFX2(X_PF, && !BOX64ENV(cputype)) {ORRw_mask(xFlags, xFlags, 30, 0);} //mask=0x04 + IFX2(X_PF, && BOX64ENV(cputype)) {BFCw(xFlags, F_PF, 1);} break; case 7: INST_NAME("IDIV Eb"); SKIPTEST(x1); - SETFLAGS(X_ALL, SF_SET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL, SF_SET); + } else if (BOX64ENV(cputype)) { + SETFLAGS(X_SF|X_PF|X_ZF|X_AF, SF_SUBSET); + } GETSEB(x1, 0); - if(box64_dynarec_div0) { + if(BOX64ENV(dynarec_div0)) { CBNZw_MARK3(ed); + MARK2; GETIP_(ip); STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); + CALL_S(const_native_div0, -1); CLEARIP(); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); @@ -3305,9 +4119,18 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } SXTHw(x2, xRAX); SDIVw(x3, x2, ed); + if(BOX64ENV(dynarec_div0)) { + SUBw_SXTB(x4, x3, x3); + CBNZw_MARK2(x4); + } MSUBw(x4, x3, ed, x2); // x4 = x2 mod ed (i.e. x2 - x3*ed) BFIx(xRAX, x3, 0, 8); BFIx(xRAX, x4, 8, 8); + FORCE_DFNONE(); + IFX2(X_AF, && BOX64ENV(cputype)) {ORRw_mask(xFlags, xFlags, 28, 0);} //mask=0x10 + IFX2(X_ZF, && BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX2(X_SF, && BOX64ENV(cputype)) {BFCw(xFlags, F_SF, 1);} + IFX2(X_PF, && BOX64ENV(cputype)) {BFCw(xFlags, F_PF, 1);} break; } break; @@ -3320,8 +4143,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SETFLAGS(X_ALL, SF_SET_PENDING); GETEDH(x1, 4); i64 = F32S; - MOV64xw(x2, i64); - emit_test32(dyn, ninst, rex, ed, x2, x3, x4, x5); + emit_test32c(dyn, ninst, rex, ed, i64, x3, x4, x5); break; case 2: INST_NAME("NOT Ed"); @@ -3338,7 +4160,11 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 4: INST_NAME("MUL EAX, Ed"); - SETFLAGS(X_ALL, SF_PENDING); + if (BOX64DRENV(dynarec_safeflags) && BOX64ENV(cputype)) { + SETFLAGS(X_OF|X_CF, SF_SET); + } else { + SETFLAGS(X_ALL, SF_SET); + } GETED(0); if(rex.w) { if(ed==xRDX) gd=x3; else gd=xRDX; @@ -3350,13 +4176,32 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin MOVw_REG(xRAX, xRDX); LSRx(xRDX, xRDX, 32); } - UFLAG_RES(xRAX); - UFLAG_OP1(xRDX); - UFLAG_DF(x2, rex.w?d_mul64:d_mul32); + SET_DFNONE(); + IFX(X_CF|X_OF) { + CMPSxw_U12(xRDX, 0); + CSETw(x3, cNE); + IFX(X_CF) { + BFIw(xFlags, x3, F_CF, 1); + } + IFX(X_OF) { + BFIw(xFlags, x3, F_OF, 1); + } + } + IFX2(X_AF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_AF, 1);} + IFX2(X_ZF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX2(X_SF, && !BOX64ENV(cputype)) { + LSRxw(x3, xRAX, rex.w?63:31); + BFIw(xFlags, x3, F_SF, 1); + } + IFX2(X_PF, && !BOX64ENV(cputype)) emit_pf(dyn, ninst, xRAX, x3); break; case 5: INST_NAME("IMUL EAX, Ed"); - SETFLAGS(X_ALL, SF_PENDING); + if (BOX64DRENV(dynarec_safeflags) && BOX64ENV(cputype)) { + SETFLAGS(X_OF|X_CF, SF_SET); + } else { + SETFLAGS(X_ALL, SF_SET); + } GETED(0); if(rex.w) { if(ed==xRDX) gd=x3; else gd=xRDX; @@ -3368,15 +4213,30 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin MOVw_REG(xRAX, xRDX); LSRx(xRDX, xRDX, 32); } - UFLAG_RES(xRAX); - UFLAG_OP1(xRDX); - UFLAG_DF(x2, rex.w?d_imul64:d_imul32); + SET_DFNONE(); + IFX(X_CF|X_OF) { + CMPSxw_REG_ASR(xRDX, xRAX, rex.w?63:31); + CSETw(x3, cNE); + IFX(X_CF) { + BFIw(xFlags, x3, F_CF, 1); + } + IFX(X_OF) { + BFIw(xFlags, x3, F_OF, 1); + } + } + IFX2(X_AF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_AF, 1);} + IFX2(X_ZF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX2(X_SF, && !BOX64ENV(cputype)) { + LSRxw(x3, xRAX, rex.w?63:31); + BFIw(xFlags, x3, F_SF, 1); + } + IFX2(X_PF, && !BOX64ENV(cputype)) emit_pf(dyn, ninst, xRAX, x3); break; case 6: INST_NAME("DIV Ed"); SETFLAGS(X_ALL, SF_SET); + FORCE_DFNONE(); if(!rex.w) { - SET_DFNONE(x2); GETED(0); if(ninst && (nextop==0xF0) && dyn->insts[ninst-1].x64.addr @@ -3386,14 +4246,15 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin MESSAGE(LOG_INFO, "Divide by 0 hack\n"); GETIP(ip); STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); + CALL_S(const_native_div0, -1); LOAD_XEMU_CALL(xRIP); } else { - if(box64_dynarec_div0) { + if(BOX64ENV(dynarec_div0)) { CBNZx_MARK3(ed); + MARK2; GETIP_(ip); STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); + CALL_S(const_native_div0, -1); CLEARIP(); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); @@ -3406,6 +4267,10 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin ed = x4; } UDIVx(x2, x3, ed); + if(BOX64ENV(dynarec_div0)) { + SUBx_UXTW(x5, x2, x2); + CBNZw_MARK2(x5); + } MSUBx(x4, x2, ed, xRAX); MOVw_REG(xRAX, x2); MOVw_REG(xRDX, x4); @@ -3413,15 +4278,15 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } else { if(ninst && dyn->insts[ninst-1].x64.addr - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31 - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0xD2) { - SET_DFNONE(x2); + && ((*(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31 && *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0xD2) + || (*(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x33 && *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0xD2)) + ){ GETED(0); - if(box64_dynarec_div0) { + if(BOX64ENV(dynarec_div0)) { CBNZx_MARK3(ed); GETIP_(ip); STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); + CALL_S(const_native_div0, -1); CLEARIP(); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); @@ -3432,11 +4297,11 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin MOVx_REG(xRAX, x2); } else { GETEDH(x1, 0); // get edd changed addr, so cannot be called 2 times for same op... - if(box64_dynarec_div0) { + if(BOX64ENV(dynarec_div0)) { CBNZx_MARK3(ed); GETIP_(ip); STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); + CALL_S(const_native_div0, -1); CLEARIP(); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); @@ -3444,28 +4309,41 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } CBZxw_MARK(xRDX); if(ed!=x1) {MOVx_REG(x1, ed);} - CALL(div64, -1); + CALL(const_div64, -1); B_NEXT_nocond; MARK; UDIVx(x2, xRAX, ed); MSUBx(xRDX, x2, ed, xRAX); MOVx_REG(xRAX, x2); - SET_DFNONE(x2); } } + FORCE_DFNONE(); + IFX(X_OF) {BFCw(xFlags, F_OF, 1);} + IFX(X_CF) {BFCw(xFlags, F_CF, 1);} + IFX2(X_AF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_AF, 1);} + IFX2(X_AF, && BOX64ENV(cputype)) {ORRw_mask(xFlags, xFlags, 28, 0);} //mask=0x10 + IFX2(X_ZF, && !BOX64ENV(cputype)) {ORRw_mask(xFlags, xFlags, 26, 0);} //mask=0x40 + IFX2(X_ZF, && BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX(X_SF) {BFCw(xFlags, F_SF, 1);} + IFX2(X_PF, && !BOX64ENV(cputype)) {ORRw_mask(xFlags, xFlags, 30, 0);} //mask=0x04 + IFX2(X_PF, && BOX64ENV(cputype)) {BFCw(xFlags, F_PF, 1);} break; case 7: INST_NAME("IDIV Ed"); SKIPTEST(x1); - SETFLAGS(X_ALL, SF_SET); - SET_DFNONE(x2) + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL, SF_SET); + } else if (BOX64ENV(cputype)) { + SETFLAGS(X_SF|X_PF|X_ZF|X_AF, SF_SET); + } if(!rex.w) { GETSEDw(0); - if(box64_dynarec_div0) { + if(BOX64ENV(dynarec_div0)) { CBNZx_MARK3(wb); + MARK2; GETIP_(ip); STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); + CALL_S(const_native_div0, -1); CLEARIP(); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); @@ -3474,6 +4352,10 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin MOVw_REG(x3, xRAX); ORRx_REG_LSL(x3, x3, xRDX, 32); SDIVx(x2, x3, wb); + if(BOX64ENV(dynarec_div0)) { + SUBx_SXTW(x5, x2, x2); + CBNZw_MARK2(x5); + } MSUBx(x4, x2, wb, x3); MOVw_REG(xRAX, x2); MOVw_REG(xRDX, x4); @@ -3483,26 +4365,28 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x48 && *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0x99) { GETED(0); - if(box64_dynarec_div0) { + if(BOX64ENV(dynarec_div0)) { CBNZx_MARK3(ed); + MARK2; GETIP_(ip); STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); + CALL_S(const_native_div0, -1); CLEARIP(); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); MARK3; } SDIVx(x2, xRAX, ed); + // there is no easy way to check for overflow here MSUBx(xRDX, x2, ed, xRAX); MOVx_REG(xRAX, x2); } else { - GETEDH(x1, 0); // get edd changed addr, so cannot be called 2 times for same op... - if(box64_dynarec_div0) { + GETEDH(x1, 0); // get ed changed addr, so cannot be called 2 times for same op... + if(BOX64ENV(dynarec_div0)) { CBNZx_MARK3(ed); GETIP_(ip); STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); + CALL_S(const_native_div0, -1); CLEARIP(); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); @@ -3510,48 +4394,56 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } //Need to see if RDX==0 and RAX not signed // or RDX==-1 and RAX signed - CBNZx_MARK2(xRDX); - TBZ_MARK(xRAX, 63); - MARK2; - MVNx_REG(x2, xRDX); - CBNZx_MARK3(x2); - TBNZ_MARK(xRAX, 63); - MARK3; + SUBx_REG_ASR(x2, xRDX, xRAX, 63); + CBZx_MARK(x2); if(ed!=x1) {MOVx_REG(x1, ed);} - CALL((void*)idiv64, -1); - B_NEXT_nocond; + CALL(const_idiv64, -1); + B_NEXT_nocond; // flags are done, so can jump to next directly MARK; SDIVx(x2, xRAX, ed); + // no easy way to get overflow it seems MSUBx(xRDX, x2, ed, xRAX); MOVx_REG(xRAX, x2); } } + FORCE_DFNONE(); + IFX2(X_AF, && BOX64ENV(cputype)) {ORRw_mask(xFlags, xFlags, 28, 0);} //mask=0x10 + IFX2(X_ZF, && BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX2(X_SF, && BOX64ENV(cputype)) {BFCw(xFlags, F_SF, 1);} + IFX2(X_PF, && BOX64ENV(cputype)) {BFCw(xFlags, F_PF, 1);} break; } break; case 0xF8: INST_NAME("CLC"); SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + SET_DFNONE(); BFCx(xFlags, F_CF, 1); break; case 0xF9: INST_NAME("STC"); SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + SET_DFNONE(); ORRx_mask(xFlags, xFlags, 1, 0, 0); // xFlags | 1 break; case 0xFA: /* STI */ case 0xFB: /* CLI */ INST_NAME(opcode==0xFA?"CLI":"STI"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state - GETIP(ip); - STORE_XEMU_CALL(xRIP); - CALL(native_priv, -1); - LOAD_XEMU_CALL(xRIP); - jump_to_epilog(dyn, 0, xRIP, ninst); - *need_epilog = 0; - *ok = 0; + if(rex.is32bits && BOX64ENV(ignoreint3)) + {} else { + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + STORE_XEMU_CALL(xRIP); + CALL_S(const_native_priv, -1); + LOAD_XEMU_CALL(xRIP); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + } break; case 0xFC: INST_NAME("CLD"); @@ -3567,14 +4459,14 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: INST_NAME("INC Eb"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); GETEB(x1, 0); emit_inc8(dyn, ninst, x1, x2, x4); EBBACK; break; case 1: INST_NAME("DEC Eb"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); GETEB(x1, 0); emit_dec8(dyn, ninst, x1, x2, x4); EBBACK; @@ -3588,56 +4480,66 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: // INC Ed INST_NAME("INC Ed"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); GETED(0); emit_inc32(dyn, ninst, rex, ed, x3, x4); WBACK; break; case 1: //DEC Ed INST_NAME("DEC Ed"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); GETED(0); emit_dec32(dyn, ninst, rex, ed, x3, x4); WBACK; break; case 2: // CALL Ed INST_NAME("CALL Ed"); - PASS2IF((box64_dynarec_safeflags>1) || - ((ninst && dyn->insts[ninst-1].x64.set_flags) - || ((ninst>1) && dyn->insts[ninst-2].x64.set_flags)), 1) - { + PASS2IF ((BOX64DRENV(dynarec_safeflags) > 1) || ((ninst && dyn->insts[ninst - 1].x64.set_flags) || ((ninst > 1) && dyn->insts[ninst - 2].x64.set_flags)), 1) { READFLAGS(X_PEND); // that's suspicious } else { SETFLAGS(X_ALL, SF_SET_NODF); //Hack to put flag in "don't care" state } GETEDz(0); - if(box64_dynarec_callret && box64_dynarec_bigblock>1) { + if (BOX64DRENV(dynarec_callret) && BOX64DRENV(dynarec_bigblock) > 1) { BARRIER(BARRIER_FULL); - BARRIER_NEXT(BARRIER_FULL); } else { BARRIER(BARRIER_FLOAT); *need_epilog = 0; *ok = 0; } GETIP_(addr); - if(box64_dynarec_callret) { + if (BOX64DRENV(dynarec_callret)) { SET_HASCALLRET(); // Push actual return address if(addr < (dyn->start+dyn->isize)) { // there is a next... - j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; + if(BOX64DRENV(dynarec_callret)>1) + j64 = CALLRET_GETRET(); + else + j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; ADR_S20(x4, j64); MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64>>2); } else { - MESSAGE(LOG_NONE, "\tCALLRET set return to Jmptable(%p)\n", (void*)addr); - j64 = getJumpTableAddress64(addr); - TABLE64(x4, j64); - LDRx_U12(x4, x4, 0); + j64 = (dyn->insts)?(GETMARK-(dyn->native_size)):0; + ADR_S20(x4, j64); + MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64>>2); } STPx_S7_preindex(x4, xRIP, xSP, -16); } PUSH1z(xRIP); jump_to_next(dyn, 0, ed, ninst, rex.is32bits); + int can_continue = (addr < (dyn->start + dyn->isize)); + CALLRET_RET(can_continue); + if (BOX64DRENV(dynarec_callret) && !can_continue) { + // jumps out of current dynablock... + MARK; + j64 = getJumpTableAddress64(addr); + if(dyn->need_reloc) AddRelocTable64RetEndBlock(dyn, ninst, addr, STEP); + TABLE64_(x4, j64); + LDRx_U12(x4, x4, 0); + BR(x4); + } + CLEARIP(); break; case 3: // CALL FAR Ed if(MODREG) { @@ -3651,33 +4553,48 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDxw(x1, wback, 0); ed = x1; LDH(x3, wback, rex.w?8:4); - LDH(x4, xEmu, offsetof(x64emu_t, segs[_CS])); + LDH(x5, xEmu, offsetof(x64emu_t, segs[_CS])); + if (BOX64DRENV(dynarec_callret) && BOX64DRENV(dynarec_bigblock) > 1) { + BARRIER(BARRIER_FULL); + } else { + BARRIER(BARRIER_FLOAT); + *need_epilog = 0; + *ok = 0; + } GETIP_(addr); - /* - if(box64_dynarec_callret) { + int can_continue = (addr < (dyn->start + dyn->isize)); + if (BOX64DRENV(dynarec_callret)) { SET_HASCALLRET(); - // Push actual return address - if(addr < (dyn->start+dyn->isize)) { + // Push actual return address. Note that CS will not be tested, but that should be ok? + if(can_continue) { // there is a next... - j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; + if(BOX64DRENV(dynarec_callret)>1) + j64 = CALLRET_GETRET(); + else + j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; ADR_S20(x4, j64); MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64>>2); } else { - MESSAGE(LOG_NONE, "\tCALLRET set return to Jmptable(%p)\n", (void*)addr); - j64 = getJumpTableAddress64(addr); - TABLE64(x4, j64); - LDRx_U12(x4, x4, 0); + j64 = (dyn->insts)?(GETMARK-(dyn->native_size)):0; + ADR_S20(x4, j64); + MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64>>2); } STPx_S7_preindex(x4, xRIP, xSP, -16); } - */ // not doing callret because call far will exit the dynablock anyway, to be sure to recompute CS segment - PUSH1z(x4); - PUSH1z(xRIP); + if (rex.w) PUSH2(x5, xRIP); else PUSH2_32(x5, xRIP); STH(x3, xEmu, offsetof(x64emu_t, segs[_CS])); - STW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_CS])); - jump_to_epilog(dyn, 0, ed, ninst); - *need_epilog = 0; - *ok = 0; + jump_to_next(dyn, 0, ed, ninst, rex.is32bits); + CALLRET_RET(can_continue); + if (BOX64DRENV(dynarec_callret) && !can_continue) { + // jumps out of current dynablock... + MARK; + j64 = getJumpTableAddress64(addr); + if(dyn->need_reloc) AddRelocTable64RetEndBlock(dyn, ninst, addr, STEP); + TABLE64_(x4, j64); + LDRx_U12(x4, x4, 0); + BR(x4); + } + CLEARIP(); } break; case 4: // JMP Ed @@ -3702,8 +4619,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin ed = x1; LDH(x3, wback, rex.w?8:4); STH(x3, xEmu, offsetof(x64emu_t, segs[_CS])); - STW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_CS])); - jump_to_epilog(dyn, 0, ed, ninst); + jump_to_next(dyn, 0, ed, ninst, rex.w?0:1); *need_epilog = 0; *ok = 0; } diff --git a/src/dynarec/arm64/dynarec_arm64_0f.c b/src/dynarec/arm64/dynarec_arm64_0f.c index 8502508..46303cb 100644 --- a/src/dynarec/arm64/dynarec_arm64_0f.c +++ b/src/dynarec/arm64/dynarec_arm64_0f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -16,17 +14,19 @@ #include "x64trace.h" #include "dynarec_native.h" #include "my_cpuid.h" +#include "freq.h" #include "emu/x87emu_private.h" -#include "emu/x64shaext.h" - #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" +#ifndef __WIN32 +#include "elfloader.h" +#endif -uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; (void)need_epilog; uint8_t opcode = F8; uint8_t nextop, u8; @@ -39,6 +39,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin int q0, q1; int d0, d1; int s0; + int mask; uint64_t tmp64u; int64_t j64; int64_t fixedaddress; @@ -56,12 +57,25 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin MAYUSE(s0); MAYUSE(j64); MAYUSE(cacheupd); - #if STEP > 1 - static const int8_t mask_shift8[] = { -7, -6, -5, -4, -3, -2, -1, 0 }; - #endif switch(opcode) { - + case 0x00: + nextop = F8; + switch((nextop>>3)&7) { + case 0: + INST_NAME("SLDT EW"); + if(MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + MOV32w(ed, 0); + } else { + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + STRH_U12(xZR, wback, 0); + } + break; + default: + DEFAULT; + } + break; case 0x01: // TODO:, /0 is SGDT. While 0F 01 D0 is XGETBV, etc... nextop = F8; @@ -69,8 +83,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch(nextop) { case 0xD0: INST_NAME("XGETBV"); - CMPSw_REG(xRCX, xZR); - B_MARK(cEQ); + CBZw_MARK(xRCX); UDF(0); MARK; MOV32w(xRAX, 0b111); @@ -85,14 +98,14 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0xE6: case 0xE7: INST_NAME("SMSW Ed"); - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); MOV32w(ed, (1<<0) | (1<<4)); // only PE and ET set... break; case 0xF9: INST_NAME("RDTSCP"); NOTEST(x1); if(box64_rdtsc) { - CALL_(ReadTSC, x1, x3); + CALL_(const_readtsc, x1, x3); } else { MRS_cntvct_el0(x1); } @@ -101,7 +114,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } LSRx(xRDX, x1, 32); MOVw_REG(xRAX, x1); // wipe upper part - CALL_(helper_getcpu, x1, x3); + CALL_(const_helper_getcpu, x1, x3); MOVw_REG(xRCX, x1); // IA32_TSC, 0 for now break; default: @@ -151,11 +164,18 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SMEND(); GETIP(addr); STORE_XEMU_CALL(xRIP); - CALL_S(x64Syscall, -1); + #ifndef __WIN32 + if(!box64_wine || FindElfAddress(my_context, ip)) { + CALL_S(const_x64syscall_linux, -1); + } else + #endif + { + CALL_S(const_x64syscall, -1); + } LOAD_XEMU_CALL(xRIP); TABLE64(x3, addr); // expected return address - CMPSx_REG(xRIP, x3); - B_MARK(cNE); + SUBx_REG(x3, x3, xRIP); + CBNZx_MARK(x3); LDRw_U12(w1, xEmu, offsetof(x64emu_t, quit)); CBZw_NEXT(w1); MARK; @@ -165,10 +185,14 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x09: INST_NAME("WBINVD"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } GETIP(ip); STORE_XEMU_CALL(xRIP); - CALL(native_ud, -1); + CALL_S(const_native_priv, -1); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; @@ -177,11 +201,14 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x0B: INST_NAME("UD2"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + BARRIER(BARRIER_FLOAT); GETIP(ip); - STORE_XEMU_CALL(xRIP); - CALL(native_ud, -1); - LOAD_XEMU_CALL(xRIP); + UDF(0); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; *ok = 0; @@ -190,21 +217,36 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x0D: nextop = F8; switch((nextop>>3)&7) { + case 0: + INST_NAME("PREFETCH"); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff, 7, rex, NULL, 0, 0); + PLD_L1_STREAM_U12(ed, fixedaddress); + break; case 1: INST_NAME("PREFETCHW"); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff, 7, rex, NULL, 0, 0); PST_L1_STREAM_U12(ed, fixedaddress); break; - default: //??? - DEFAULT; + case 2: + INST_NAME("PREFETCHWT1"); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff, 7, rex, NULL, 0, 0); + PST_L1_STREAM_U12(ed, fixedaddress); + break; + default: //NOP + FAKEED; + break; } break; case 0x0E: INST_NAME("femms"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } GETIP(ip); STORE_XEMU_CALL(xRIP); - CALL(native_ud, -1); + CALL_S(const_native_ud, -1); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; @@ -237,20 +279,33 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin v1 = sse_get_reg_empty(dyn, ninst, x1, ed); VMOVQ(v1, v0); } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); - VST128(v0, ed, fixedaddress); + IF_UNALIGNED(ip) { + MESSAGE(LOG_DEBUG, "\tUnaligned path"); + addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + if(wback!=x1) { + MOVx_REG(x1, wback); + wback = x1; + } + for(int i=0; i<16; ++i) { + VST1_8(v0, i, wback); + ADDx_U12(wback, wback, 1); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VST128(v0, ed, fixedaddress); + } SMWRITE2(); } break; case 0x12: nextop = F8; if(MODREG) { - INST_NAME("MOVHLPS Gx,Ex"); + INST_NAME("MOVHLPS Gx, Ex"); GETGX(v0, 1); v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); VMOVeD(v0, 0, v1, 1); } else { - INST_NAME("MOVLPS Gx,Ex"); + INST_NAME("MOVLPS Gx, Ex"); GETGX(v0, 1); SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); @@ -259,12 +314,12 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0x13: nextop = F8; - INST_NAME("MOVLPS Ex,Gx"); - GETGX(v0, 0); if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1); - VMOVeD(v1, 0, v0, 0); + INST_NAME("Illegal 0F 13"); + UDF(0); } else { + INST_NAME("MOVLPS Ex, Gx"); + GETGX(v0, 0); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); VST1_64(v0, 0, ed); // better to use VST1 than VSTR_64, to avoid NEON->VFPU transfert I assume SMWRITE2(); @@ -273,7 +328,6 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x14: INST_NAME("UNPCKLPS Gx, Ex"); nextop = F8; - SMREAD(); GETEX(q0, 0, 0); GETGX(v0, 1); VZIP1Q_32(v0, v0, q0); @@ -281,7 +335,6 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x15: INST_NAME("UNPCKHPS Gx, Ex"); nextop = F8; - SMREAD(); GETEX(q0, 0, 0); GETGX(v0, 1); VZIP2Q_32(v0, v0, q0); @@ -289,12 +342,12 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x16: nextop = F8; if(MODREG) { - INST_NAME("MOVLHPS Gx,Ex"); + INST_NAME("MOVLHPS Gx, Ex"); GETGX(v0, 1); v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); VMOVeD(v0, 1, v1, 0); } else { - INST_NAME("MOVHPS Gx,Ex"); + INST_NAME("MOVHPS Gx, Ex"); SMREAD(); GETGX(v0, 1); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); @@ -303,7 +356,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0x17: nextop = F8; - INST_NAME("MOVHPS Ex,Gx"); + INST_NAME("MOVHPS Ex, Gx"); GETGX(v0, 0); if(MODREG) { v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1); @@ -316,27 +369,27 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0x18: nextop = F8; - if((nextop&0xC0)==0xC0) { + if (MODREG) { INST_NAME("NOP (multibyte)"); } else switch((nextop>>3)&7) { case 0: - INST_NAME("PREFETCHh Ed"); + INST_NAME("PREFETCHNTA Ed"); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff, 7, rex, NULL, 0, 0); PLD_L1_STREAM_U12(ed, fixedaddress); break; case 1: - INST_NAME("PREFETCHh Ed"); + INST_NAME("PREFETCHT0 Ed"); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff, 7, rex, NULL, 0, 0); PLD_L1_KEEP_U12(ed, fixedaddress); break; case 2: - INST_NAME("PREFETCHh Ed"); + INST_NAME("PREFETCHT1 Ed"); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff, 7, rex, NULL, 0, 0); PLD_L2_KEEP_U12(ed, fixedaddress); break; case 3: - INST_NAME("PREFETCHh Ed"); + INST_NAME("PREFETCHT2 Ed"); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff, 7, rex, NULL, 0, 0); PLD_L3_KEEP_U12(ed, fixedaddress); break; @@ -346,11 +399,42 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } break; + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: case 0x1F: INST_NAME("NOP (multibyte)"); nextop = F8; FAKEED; break; + case 0x20: /* MOV REG, crX */ + case 0x21: /* MOV REG, drX */ + case 0x22: /* MOV cxR, REG */ + case 0x23: /* MOV drX, REG */ + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + nextop = F8; + GETIP(ip); + u8 = (rex.r*8)+(nextop>>3&7); + if((((opcode==0x20) || (opcode==0x22)) && ((u8==1) || (u8==5) || (u8==6) || (u8==7) || (u8>8))) || (((opcode==0x21) || (opcode==0x23) && rex.r))) { + INST_NAME("Illegal 0F 20..23"); + UDF(0); + } else { + INST_NAME(opcode==0x20?"MOV REG, crX":(opcode==0x21?"MOV REG, drX":(opcode==0x22?"MOV cxR, REG":"MOV dxR, REG"))); + STORE_XEMU_CALL(xRIP); + CALL_S(const_native_priv, -1); + LOAD_XEMU_CALL(xRIP); + } + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + break; case 0x28: INST_NAME("MOVAPS Gx,Ex"); @@ -395,15 +479,14 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VMOVeD(v0, 0, d0, 0); break; case 0x2B: - INST_NAME("MOVNTPS Ex,Gx"); nextop = F8; - GETG; - v0 = sse_get_reg(dyn, ninst, x1, gd, 0); if(MODREG) { - ed = (nextop&7)+(rex.b<<3); - v1 = sse_get_reg_empty(dyn, ninst, x1, ed); - VMOVQ(v1, v0); + INST_NAME("Illegal 0F 2B"); + UDF(0); } else { + INST_NAME("MOVNTPS Ex,Gx"); + GETG; + v0 = sse_get_reg(dyn, ninst, x1, gd, 0); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); VST128(v0, ed, fixedaddress); } @@ -412,11 +495,11 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("CVTTPS2PI Gm,Ex"); nextop = F8; GETGM(q0); - GETEX(v1, 0, 0); - if (box64_dynarec_fastround) { + GETEXSD(v1, 0, 0); + if (BOX64ENV(dynarec_fastround)) { VFCVTZSS(q0, v1); } else { - if(arm64_frintts) { + if(cpuext.frintts) { VFRINT32ZS(q0, v1); VFCVTZSS(q0, q0); } else { @@ -446,15 +529,15 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("CVTPS2PI Gm, Ex"); nextop = F8; GETGM(q0); - GETEX(v1, 0, 0); - if (box64_dynarec_fastround) { + GETEXSD(v1, 0, 0); + if (BOX64ENV(dynarec_fastround)) { u8 = sse_setround(dyn, ninst, x1, x2, x3); VFRINTIS(q0, v1); x87_restoreround(dyn, ninst, u8); VFCVTZSS(q0, q0); } else { u8 = sse_setround(dyn, ninst, x1, x2, x3); - if(arm64_frintts) { + if(cpuext.frintts) { VFRINT32XS(q0, v1); VFCVTZSS(q0, q0); } else { @@ -485,19 +568,34 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin // no special check... case 0x2F: if(opcode==0x2F) {INST_NAME("COMISS Gx, Ex");} else {INST_NAME("UCOMISS Gx, Ex");} - SETFLAGS(X_ALL, SF_SET_NODF); + SETFLAGS(X_ALL, SF_SET_DF); nextop = F8; GETGX(v0, 0); GETEXSS(s0, 0, 0); - FCMPS(v0, s0); + IFX(X_CF|X_PF|X_ZF) { + FCMPS(v0, s0); + } FCOMI(x1, x2); break; - + case 0x30: + INST_NAME("WRMSR"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + STORE_XEMU_CALL(xRIP); + CALL_S(const_native_priv, -1); + LOAD_XEMU_CALL(xRIP); + jump_to_epilog(dyn, 0, xRIP, ninst); + // continue the block + break; case 0x31: INST_NAME("RDTSC"); NOTEST(x1); if(box64_rdtsc) { - CALL_(ReadTSC, x1, x3); + CALL_(const_readtsc, x1, x3); } else { MRS_cntvct_el0(x1); } @@ -596,11 +694,11 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETEM(q1, 0); v0 = fpu_get_scratch(dyn, ninst); v1 = fpu_get_scratch(dyn, ninst); - CMGT_0_8(v0, q1); - VAND(v0, v0, q0); - CMLT_0_8(v1, q1); - VMUL_8(q0, q0, v1); - VORR(q0, q0, v0); + NEG_8(v0, q0); // get NEG + CMLT_0_8(v1, q1); // calculate mask + VBIF(v0, q0, v1); // put back positive values + CMEQ_0_8(v1, q1); // handle case where Ex is 0 + VBIC(q0, v0, v1); break; case 0x09: INST_NAME("PSIGNW Gm,Em"); @@ -609,11 +707,11 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETEM(q1, 0); v0 = fpu_get_scratch(dyn, ninst); v1 = fpu_get_scratch(dyn, ninst); - CMGT_0_16(v0, q1); - VAND(v0, v0, q0); - CMLT_0_16(v1, q1); - VMUL_16(q0, q0, v1); - VORR(q0, q0, v0); + NEG_16(v0, q0); // get NEG + CMLT_0_16(v1, q1); // calculate mask + VBIF(v0, q0, v1); // put back positive values + CMEQ_0_16(v1, q1); // handle case where Ex is 0 + VBIC(q0, v0, v1); break; case 0x0A: INST_NAME("PSIGND Gm,Em"); @@ -622,18 +720,21 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETEM(q1, 0); v0 = fpu_get_scratch(dyn, ninst); v1 = fpu_get_scratch(dyn, ninst); - CMGT_0_32(v0, q1); - VAND(v0, v0, q0); - CMLT_0_32(v1, q1); - VMUL_32(q0, q0, v1); - VORR(q0, q0, v0); + NEG_32(v0, q0); // get NEG + CMLT_0_32(v1, q1); // calculate mask + VBIF(v0, q0, v1); // put back positive values + CMEQ_0_32(v1, q1); // handle case where Ex is 0 + VBIC(q0, v0, v1); break; case 0x0B: INST_NAME("PMULHRSW Gm,Em"); nextop = F8; GETGM(q0); GETEM(q1, 0); - SQRDMULH_16(q0, q0, q1); + v0 = fpu_get_scratch(dyn, ninst); + VSMULL_16(v0, q0, q1); + SRSHRQ_32(v0, v0, 15); + XTN_16(q0, v0); break; case 0x1C: INST_NAME("PABSB Gm,Em"); @@ -664,7 +765,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETEX(q1, 0, 0); v0 = fpu_get_scratch(dyn, ninst); VEORQ(v0, v0, v0); - if(arm64_sha1) { + if(cpuext.sha1) { v1 = fpu_get_scratch(dyn, ninst); VMOVeS(v1, 0, q0, 3); SHA1H(v1, v1); @@ -688,7 +789,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0xCA: INST_NAME("SHA1MSG2 Gx, Ex"); nextop = F8; - if(arm64_sha1) { + if(cpuext.sha1) { GETGX(q0, 1); GETEX(q1, 0, 0); VEXTQ_8(q0, q0, q0, 8); @@ -724,13 +825,13 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETG; sse_forget_reg(dyn, ninst, gd); ADDx_U12(x1, xEmu, offsetof(x64emu_t, xmm[gd])); - CALL(sha1msg2, -1); + CALL(const_sha1msg2, -1); } break; case 0xCB: INST_NAME("SHA256RNDS2 Gx, Ex (, XMM0)"); nextop = F8; - if(arm64_sha2) { + if(cpuext.sha2) { GETGX(q0, 1); GETEX(q1, 0, 0); d0 = sse_get_reg(dyn, ninst, x1, 0, 0); @@ -770,13 +871,13 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin sse_forget_reg(dyn, ninst, gd); ADDx_U12(x1, xEmu, offsetof(x64emu_t, xmm[gd])); sse_reflect_reg(dyn, ninst, 0); - CALL(sha256rnds2, -1); + CALL(const_sha256rnds2, -1); } break; case 0xCC: INST_NAME("SHA256MSG1 Gx, Ex"); nextop = F8; - if(arm64_sha2) { + if(cpuext.sha2) { GETGX(q0, 1); GETEX(q1, 0, 0); SHA256SU0(q0, q1); @@ -795,13 +896,13 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETG; sse_forget_reg(dyn, ninst, gd); ADDx_U12(x1, xEmu, offsetof(x64emu_t, xmm[gd])); - CALL(sha256msg1, -1); + CALL(const_sha256msg1, -1); } break; case 0xCD: INST_NAME("SHA256MSG2 Gx, Ex"); nextop = F8; - if(arm64_sha2) { + if(cpuext.sha2) { GETGX(q0, 1); GETEX(q1, 0, 0); v0 = fpu_get_scratch(dyn, ninst); @@ -829,7 +930,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETG; sse_forget_reg(dyn, ninst, gd); ADDx_U12(x1, xEmu, offsetof(x64emu_t, xmm[gd])); - CALL(sha256msg2, -1); + CALL(const_sha256msg2, -1); } break; @@ -838,7 +939,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop=F8; GETGD; if(MODREG) { - REVxw(gd, xRAX+(nextop&7)+(rex.b<<3)); + REVxw(gd, TO_NAT((nextop & 7) + (rex.b << 3))); } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0); @@ -851,7 +952,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop=F8; GETGD; if(MODREG) { // reg <= reg - REVxw(xRAX+(nextop&7)+(rex.b<<3), gd); + REVxw(TO_NAT((nextop & 7) + (rex.b << 3)), gd); } else { // mem <= reg addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0); REVxw(x1, gd); @@ -888,7 +989,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0xCC: INST_NAME("SHA1RNDS4 Gx, Ex, Ib"); nextop = F8; - if(arm64_sha1) { + if(cpuext.sha1) { GETGX(q0, 1); GETEX(q1, 0, 1); u8 = F8&3; @@ -952,7 +1053,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin sse_forget_reg(dyn, ninst, gd); ADDx_U12(x1, xEmu, offsetof(x64emu_t, xmm[gd])); MOV32w(x3, u8); - CALL(sha1rnds4, -1); + CALL(const_sha1rnds4, -1); } break; @@ -961,52 +1062,52 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } break; - #define GO(GETFLAGS, NO, YES, F) \ - READFLAGS(F); \ - GETFLAGS; \ - nextop=F8; \ - GETGD; \ - if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - CSELxw(gd, ed, gd, YES); \ - } else { \ - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0); \ - Bcond(NO, +8); \ - LDxw(gd, ed, fixedaddress); \ - if(!rex.w) {MOVw_REG(gd, gd);} \ + #define GO(GETFLAGS, NO, YES, F) \ + READFLAGS(F); \ + GETFLAGS; \ + nextop = F8; \ + GETGD; \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + CSELxw(gd, ed, gd, YES); \ + } else { \ + addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff << (2 + rex.w), (1 << (2 + rex.w)) - 1, rex, NULL, 0, 0); \ + Bcond(NO, +8); \ + LDxw(gd, ed, fixedaddress); \ + if (!rex.w) { MOVw_REG(gd, gd); } \ } GOCOND(0x40, "CMOV", "Gd, Ed"); #undef GO case 0x50: - INST_NAME("MOVMSPKPS Gd, Ex"); + INST_NAME("MOVMSKPS Gd, Ex"); nextop = F8; GETGD; MOV32w(gd, 0); if(MODREG) { // EX is an xmm reg - GETEX(q0, 0, 0); + q0 = fpu_get_scratch(dyn, ninst); + GETEX(v0, 0, 0); + SQXTN_16(q0, v0); // reduces the 4 32bits to 4 16bits VMOVQDto(x1, q0, 0); - LSRx(x1, x1, 31); + LSRx(x1, x1, 15); BFIx(gd, x1, 0, 1); - LSRx(x1, x1, 32); + LSRx(x1, x1, 16); BFIx(gd, x1, 1, 1); - VMOVQDto(x1, q0, 1); - LSRx(x1, x1, 31); + LSRx(x1, x1, 16); BFIx(gd, x1, 2, 1); - LSRx(x1, x1, 32); + LSRx(x1, x1, 16); BFIx(gd, x1, 3, 1); } else { // EX is memory SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, (0xfff<<3)-8, 7, rex, NULL, 0, 0); - LDRx_U12(x1, ed, fixedaddress+0); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0x3f<<3, 7, rex, NULL, 1, 0); + LDPx_S7_offset(x1, x2, ed, fixedaddress); LSRx(x1, x1, 31); BFIx(gd, x1, 0, 1); LSRx(x1, x1, 32); BFIx(gd, x1, 1, 1); - LDRx_U12(x1, ed, fixedaddress+8); - LSRx(x1, x1, 31); + LSRx(x1, x2, 31); BFIx(gd, x1, 2, 1); LSRx(x1, x1, 32); BFIx(gd, x1, 3, 1); @@ -1016,32 +1117,50 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("SQRTPS Gx, Ex"); nextop = F8; GETEX(q0, 0, 0); - GETGX_empty(v0); - VFSQRTQS(v0, q0); + GETGX_empty(q1); + if(!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn, ninst); + v1 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + VFCMEQQS(v0, q0, q0); // 0 if NAN, 1 if not NAN + VFSQRTQS(q1, q0); + VFCMEQQS(v1, q1, q1); // 0 => out is NAN + VBICQ(v1, v0, v1); // forget it in any input was a NAN already + VSHLQ_32(v1, v1, 31); // only keep the sign bit + VORRQ(q1, q1, v1); // NAN -> -NAN + } else { + VFSQRTQS(q1, q0); + } break; case 0x52: INST_NAME("RSQRTPS Gx, Ex"); nextop = F8; - SKIPTEST(x1); GETEX(q0, 0, 0); GETGX_empty(q1); v0 = fpu_get_scratch(dyn, ninst); - // more precise - if(q1==q0) - v1 = fpu_get_scratch(dyn, ninst); - else - v1 = q1; - VFRSQRTEQS(v0, q0); - VFMULQS(v1, v0, q0); - VFRSQRTSQS(v1, v1, v0); - VFMULQS(q1, v1, v0); + if(!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn, ninst); + d1 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + VFCMEQQS(d0, q0, q0); // 0 if NAN, 1 if not NAN + } + VFMOVSQ_8(v0, 0b01110000); //1.0f + VFSQRTQS(q1, q0); + VFDIVQS(q1, v0, q1); + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(d1, q1, q1); // 0 => out is NAN + VBICQ(d1, d0, d1); // forget it in any input was a NAN already + VSHLQ_32(d1, d1, 31); // only keep the sign bit + VORRQ(q1, q1, d1); // NAN -> -NAN + } break; case 0x53: INST_NAME("RCPPS Gx, Ex"); nextop = F8; - SKIPTEST(x1); GETEX(q0, 0, 0); GETGX_empty(q1); + #if 0 + SKIPTEST(x1); if(q0 == q1) v1 = fpu_get_scratch(dyn, ninst); else @@ -1050,6 +1169,11 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VFRECPEQS(v0, q0); VFRECPSQS(v1, v0, q0); VFMULQS(q1, v0, v1); + #else + v0 = fpu_get_scratch(dyn, ninst); + VFMOVSQ_8(v0, 0b01110000); //1.0f + VFDIVQS(q1, v0, q0); + #endif break; case 0x54: INST_NAME("ANDPS Gx, Ex"); @@ -1090,21 +1214,47 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("ADDPS Gx, Ex"); nextop = F8; GETEX(q0, 0, 0); - GETGX(v0, 1); - VFADDQS(v0, v0, q0); + GETGX(q1, 1); + if(!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn, ninst); + v1 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + VFMAXQS(v0, q0, q1); // propagate NAN + VFCMEQQS(v0, v0, v0); // 0 if NAN, 1 if not NAN + } + VFADDQS(q1, q1, q0); + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(v1, q1, q1); // 0 => out is NAN + VBICQ(v1, v0, v1); // forget it in any input was a NAN already + VSHLQ_32(v1, v1, 31); // only keep the sign bit + VORRQ(q1, q1, v1); // NAN -> -NAN + } break; case 0x59: INST_NAME("MULPS Gx, Ex"); nextop = F8; GETEX(q0, 0, 0); - GETGX(v0, 1); - VFMULQS(v0, v0, q0); + GETGX(q1, 1); + if(!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn, ninst); + v1 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + VFMAXQS(v0, q0, q1); // propagate NAN + VFCMEQQS(v0, v0, v0); // 0 if NAN, 1 if not NAN + } + VFMULQS(q1, q1, q0); + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(v1, q1, q1); // 0 => out is NAN + VBICQ(v1, v0, v1); // forget it in any input was a NAN already + VSHLQ_32(v1, v1, 31); // only keep the sign bit + VORRQ(q1, q1, v1); // NAN -> -NAN + } break; case 0x5A: INST_NAME("CVTPS2PD Gx, Ex"); nextop = F8; - GETEX(q0, 0, 0); - GETGX(q1, 1); + GETEXSD(q0, 0, 0); + GETGX_empty(q1); FCVTL(q1, q0); break; case 0x5B: @@ -1118,8 +1268,21 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("SUBPS Gx, Ex"); nextop = F8; GETEX(q0, 0, 0); - GETGX(v0, 1); - VFSUBQS(v0, v0, q0); + GETGX(q1, 1); + if(!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn, ninst); + v1 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + VFMAXQS(v0, q0, q1); // propagate NAN + VFCMEQQS(v0, v0, v0); // 0 if NAN, 1 if not NAN + } + VFSUBQS(q1, q1, q0); + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(v1, q1, q1); // 0 => out is NAN + VBICQ(v1, v0, v1); // forget it in any input was a NAN already + VSHLQ_32(v1, v1, 31); // only keep the sign bit + VORRQ(q1, q1, v1); // NAN -> -NAN + } break; case 0x5D: INST_NAME("MINPS Gx, Ex"); @@ -1128,19 +1291,29 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETEX(v1, 0, 0); // FMIN/FMAX wll not copy the value if v0[x] is NaN // but x86 will copy if either v0[x] or v1[x] is NaN, so lets force a copy if source is NaN - VFMINQS(v0, v0, v1); - if(!box64_dynarec_fastnan && (v0!=v1)) { - q0 = fpu_get_scratch(dyn, ninst); - VFCMEQQS(q0, v0, v0); // 0 is NaN, 1 is not NaN, so MASK for NaN - VBIFQ(v0, v1, q0); // copy dest where source is NaN - } + q0 = fpu_get_scratch(dyn, ninst); + VFCMGTQS(q0, v1, v0); // 0 is NaN or v1 GT v0, so invert mask for copy + VBIFQ(v0, v1, q0); break; case 0x5E: INST_NAME("DIVPS Gx, Ex"); nextop = F8; GETEX(q0, 0, 0); - GETGX(v0, 1); - VFDIVQS(v0, v0, q0); + GETGX(q1, 1); + if(!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn, ninst); + v1 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + VFMAXQS(v0, q0, q1); // propagate NAN + VFCMEQQS(v0, v0, v0); // 0 if NAN, 1 if not NAN + } + VFDIVQS(q1, q1, q0); + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(v1, q1, q1); // 0 => out is NAN + VBICQ(v1, v0, v1); // forget it in any input was a NAN already + VSHLQ_32(v1, v1, 31); // only keep the sign bit + VORRQ(q1, q1, v1); // NAN -> -NAN + } break; case 0x5F: INST_NAME("MAXPS Gx, Ex"); @@ -1148,13 +1321,10 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETGX(v0, 1); GETEX(v1, 0, 0); // FMIN/FMAX wll not copy the value if v0[x] is NaN - // but x86 will copy if either v0[x] or v1[x] is NaN, so lets force a copy if source is NaN - VFMAXQS(v0, v0, v1); - if(!box64_dynarec_fastnan && (v0!=v1)) { - q0 = fpu_get_scratch(dyn, ninst); - VFCMEQQS(q0, v0, v0); // 0 is NaN, 1 is not NaN, so MASK for NaN - VBIFQ(v0, v1, q0); // copy dest where source is NaN - } + // but x86 will copy if either v0[x] or v1[x] is NaN, or if values are equals, so lets force a copy if source is NaN + q0 = fpu_get_scratch(dyn, ninst); + VFCMGTQS(q0, v0, v1); // 0 is NaN or v0 GT v1, so invert mask for copy + VBIFQ(v0, v1, q0); break; case 0x60: INST_NAME("PUNPCKLBW Gm,Em"); @@ -1266,7 +1436,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin gd = (nextop&0x38)>>3; v0 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, gd); if(MODREG) { - ed = xRAX + (nextop&7) + (rex.b<<3); + ed = TO_NAT((nextop & 0x07) + (rex.b << 3)); if(rex.w) { FMOVDx(v0, ed); } else { @@ -1514,8 +1684,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("MOVD Ed, Gm"); nextop = F8; GETGM(v0); - if((nextop&0xC0)==0xC0) { - ed = xRAX + (nextop&7) + (rex.b<<3); + if (MODREG) { + ed = TO_NAT((nextop & 0x07) + (rex.b << 3)); if(rex.w) { FMOVxD(ed, v0); } else { @@ -1547,11 +1717,13 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; #define GO(GETFLAGS, NO, YES, F) \ - if (box64_dynarec_test == 2) { NOTEST(x1); } \ READFLAGS(F); \ i32_ = F32S; \ - BARRIER(BARRIER_MAYBE); \ - JUMP(addr+i32_, 1); \ + if(rex.is32bits) \ + j64 = (uint32_t)(addr+i32_); \ + else \ + j64 = addr+i32_; \ + JUMP(j64, 1); \ GETFLAGS; \ if(dyn->insts[ninst].x64.jmp_insts==-1 || \ CHECK_CACHE()) { \ @@ -1560,41 +1732,43 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin Bcond(NO, i32); \ if(dyn->insts[ninst].x64.jmp_insts==-1) { \ if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \ - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ - jump_to_next(dyn, addr+i32_, 0, ninst, rex.is32bits); \ + fpu_purgecache(dyn, ninst, 1, x1, x2, x3, 0); \ + jump_to_next(dyn, j64, 0, ninst, rex.is32bits); \ } else { \ - CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ + CacheTransform(dyn, ninst, cacheupd); \ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ + SKIP_SEVL(i32); \ B(i32); \ } \ } else { \ /* inside the block */ \ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ + SKIP_SEVL(i32); \ Bcond(YES, i32); \ } GOCOND(0x80, "J", "Id"); #undef GO - #define GO(GETFLAGS, NO, YES, F) \ - READFLAGS(F); \ - GETFLAGS; \ - nextop=F8; \ - CSETw(x3, YES); \ - if(MODREG) { \ - if(rex.rex) { \ - eb1= xRAX+(nextop&7)+(rex.b<<3); \ - eb2 = 0; \ - } else { \ - ed = (nextop&7); \ - eb2 = (ed>>2)*8; \ - eb1 = xRAX+(ed&3); \ - } \ - BFIx(eb1, x3, eb2, 8); \ - } else { \ + #define GO(GETFLAGS, NO, YES, F) \ + READFLAGS(F); \ + GETFLAGS; \ + nextop = F8; \ + CSETw(x3, YES); \ + if (MODREG) { \ + if (rex.rex) { \ + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); \ + eb2 = 0; \ + } else { \ + ed = (nextop & 7); \ + eb2 = (ed >> 2) * 8; \ + eb1 = TO_NAT (ed & 3); \ + } \ + BFIx(eb1, x3, eb2, 8); \ + } else { \ addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, 0); \ - STB(x3, ed, fixedaddress); \ - SMWRITE(); \ + STB(x3, ed, fixedaddress); \ + SMWRITE(); \ } GOCOND(0x90, "SET", "Eb"); @@ -1608,63 +1782,81 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("POP FS"); POP1z(x2); STRH_U12(x2, xEmu, offsetof(x64emu_t, segs[_FS])); - STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_FS])); + CBZw_NEXT(x2); + MOV32w(x1, _FS); + CALL(const_getsegmentbase, -1); break; case 0xA2: INST_NAME("CPUID"); NOTEST(x1); + GETIP(ip); // sync RIP for easier debugging + STRx_U12(xRIP, xEmu, offsetof(x64emu_t, ip)); MOVx_REG(x1, xRAX); - CALL_(my_cpuid, -1, 0); + CALL_(const_cpuid, -1, 0); break; case 0xA3: INST_NAME("BT Ed, Gd"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } nextop = F8; GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0); - ASRx(x1, gd, 5+rex.w); // r1 = (gd>>5) - ADDx_REG_LSL(x3, wback, x1, 2+rex.w); //(&ed)+=r1*4; + ASRxw(x1, gd, 5+rex.w); // r1 = (gd>>5) + if(!rex.w && !rex.is32bits) {SXTWx(x1, x1);} + ADDy_REG_LSL(x3, wback, x1, 2+rex.w); //(&ed)+=r1*4; LDxw(x1, x3, fixedaddress); ed = x1; } - if(rex.w) { - ANDx_mask(x2, gd, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDw_mask(x2, gd, 0, 0b00100); //mask=0x00000001f + IFX(X_CF) { + if(rex.w) { + ANDx_mask(x2, gd, 1, 0, 0b00101); //mask=0x000000000000003f + } else { + ANDw_mask(x2, gd, 0, 0b00100); //mask=0x00000001f + } + LSRxw_REG(x4, ed, x2); + BFIw(xFlags, x4, F_CF, 1); } - LSRxw_REG(x4, ed, x2); - BFIw(xFlags, x4, F_CF, 1); break; case 0xA4: nextop = F8; INST_NAME("SHLD Ed, Gd, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED(1); - GETGD; - u8 = F8; - emit_shld32c(dyn, ninst, rex, ed, gd, u8, x3, x4); - WBACK; + if(geted_ib(dyn, addr, ninst, nextop)&(rex.w?63:31)) { + SETFLAGS(X_ALL, SF_SET_PENDING); + GETED(1); + GETGD; + u8 = F8&(rex.w?63:31); + emit_shld32c(dyn, ninst, rex, ed, gd, u8, x3, x4); + WBACK; + } else { + FAKEED; + if (!rex.w && !rex.is32bits && MODREG) { MOVw_REG(ed, ed); } + F8; + } break; case 0xA5: nextop = F8; INST_NAME("SHLD Ed, Gd, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); GETGD; GETED(0); if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} if(rex.w) { - ANDSx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f + ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f } else { - ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f + ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f } - B_NEXT(cEQ); + CBZw_NEXT(x3); emit_shld32(dyn, ninst, rex, ed, gd, x3, x5, x4); WBACK; break; @@ -1678,23 +1870,29 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("POP GS"); POP1z(x2); STRH_U12(x2, xEmu, offsetof(x64emu_t, segs[_GS])); - STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_GS])); + CBZw_NEXT(x2); + MOV32w(x1, _GS); + CALL(const_getsegmentbase, -1); break; case 0xAB: INST_NAME("BTS Ed, Gd"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } nextop = F8; GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0); - ASRx(x1, gd, 5+rex.w); // r1 = (gd>>5) - ADDx_REG_LSL(x3, wback, x1, 2+rex.w); //(&ed)+=r1*4; + ASRxw(x1, gd, 5+rex.w); // r1 = (gd>>5) + if(!rex.w && !rex.is32bits) {SXTWx(x1, x1);} + ADDy_REG_LSL(x3, wback, x1, 2+rex.w); //(&ed)+=r1*4; LDxw(x1, x3, fixedaddress); ed = x1; wback = x3; @@ -1712,35 +1910,43 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LSLxw_REG(x4, x4, x2); ORRxw_REG(ed, ed, x4); if(wback) { - STRxw_U12(ed, wback, fixedaddress); + STxw(ed, wback, fixedaddress); SMWRITE(); } break; case 0xAC: nextop = F8; INST_NAME("SHRD Ed, Gd, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED(1); - GETGD; - u8 = F8; - emit_shrd32c(dyn, ninst, rex, ed, gd, u8, x3, x4); - WBACK; + if(geted_ib(dyn, addr, ninst, nextop)&(rex.w?63:31)) { + SETFLAGS(X_ALL, SF_SET_PENDING); + GETED(1); + GETGD; + u8 = F8&(rex.w?63:31); + emit_shrd32c(dyn, ninst, rex, ed, gd, u8, x3, x4); + WBACK; + } else { + FAKEED; + if (!rex.w && !rex.is32bits && MODREG) { MOVw_REG(ed, ed); } + F8; + } break; case 0xAD: nextop = F8; INST_NAME("SHRD Ed, Gd, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); GETGD; GETED(0); if(!rex.w && !rex.is32bits && MODREG) {MOVw_REG(ed, ed);} if(rex.w) { - ANDSx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f + ANDx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f } else { - ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f + ANDw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f } - B_NEXT(cEQ); + CBZw_NEXT(x3); emit_shrd32(dyn, ninst, rex, ed, gd, x3, x5, x4); WBACK; break; @@ -1751,15 +1957,15 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch (nextop) { case 0xE8: INST_NAME("LFENCE"); - SMDMB(); + DMB_LD(); break; case 0xF0: INST_NAME("MFENCE"); - SMDMB(); + DMB_SY(); break; case 0xF8: INST_NAME("SFENCE"); - SMDMB(); + DMB_ST(); break; default: DEFAULT; @@ -1768,65 +1974,95 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: INST_NAME("FXSAVE Ed"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + MESSAGE(LOG_DUMP, "Need Optimization (FXSAVE)\n"); + BARRIER(BARRIER_FLOAT); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) {MOVx_REG(x1, ed);} - CALL(rex.w?((void*)fpu_fxsave64):((void*)fpu_fxsave32), -1); + CALL(rex.is32bits?const_fpu_fxsave32:const_fpu_fxsave64, -1); break; case 1: INST_NAME("FXRSTOR Ed"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + MESSAGE(LOG_DUMP, "Need Optimization (FXRSTOR)\n"); + BARRIER(BARRIER_FLOAT); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) {MOVx_REG(x1, ed);} - CALL(rex.w?((void*)fpu_fxrstor64):((void*)fpu_fxrstor32), -1); + CALL(rex.is32bits?const_fpu_fxrstor32:const_fpu_fxrstor64, -1); break; case 2: INST_NAME("LDMXCSR Md"); GETED(0); STRw_U12(ed, xEmu, offsetof(x64emu_t, mxcsr)); - if(box64_sse_flushto0) { - MRS_fpcr(x1); // get fpscr + if(BOX64ENV(sse_flushto0)) { + MRS_fpcr(x2); // get fpscr LSRw_IMM(x3, ed, 15); // get FZ bit - BFIw(x1, x3, 24, 1); // inject FZ bit + BFIw(x2, x3, 24, 1); // inject FZ bit EORw_REG_LSR(x3, x3, ed, 1); // FZ xor DAZ - BFIw(x1, x3, 1, 1); // inject AH bit - MSR_fpcr(x1); // put new fpscr + BFIw(x2, x3, 1, 1); // inject AH bit + MSR_fpcr(x2); // put new fpscr + } + if(BOX64ENV(sse_flushto0)) { + // try to sync mxcsr with fpsr on the flag side + /* mapping is + ARM <-> X86 + 0 <-> 0 // Invalid operation + 1 <-> 2 // Divide by 0 + 2 <-> 3 // Overflow + 3 <-> 4 // underflow + 4 <-> 5 // Inexact + 5 <-> 1 // denormal + */ + // doing X86 -> ARM here, 543210 => 432150 + if(ed!=x1) + MOVw_REG(x1, ed); // x1 = 543210 + UBFXw(x2, x1, 1, 5); // x2 = 54321 + BFIw(x1, x2, 2, 4); // x1 = 432110 + LSRw(x2, x2, 4); // x2 = 5 + BFIw(x1, x2, 1, 1); // x1 = 432150 + MRS_fpsr(x2); + BFIx(x2, x1, 0, 6); + MSR_fpsr(x2); } break; case 3: INST_NAME("STMXCSR Md"); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); LDRw_U12(x4, xEmu, offsetof(x64emu_t, mxcsr)); + if(BOX64ENV(sse_flushto0)) { + // sync with fpsr, with mask from mxcsr + MRS_fpsr(x1); + // doing ARM -> X86 here, 0 1 2 3 4 5 -> 0 2 3 4 5 1 + RORw(x3, x1, 2); // x3 = 10.....5432 + BFIw(x1, x3, 1, 4); // x1 = 54320 + RORw(x3, x3, 32-1); // x3 = 0.....54321 + BFIw(x1, x3, 5, 1); // x1 = 154320 + //BFXILw(x3, x4, 7, 6); // this would the mask, but let's ignore that for now + BFIw(x4, x1, 0, 6); // inject back the flags + } STW(x4, ed, fixedaddress); break; case 4: INST_NAME("XSAVE Ed"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + MESSAGE(LOG_DUMP, "Need Optimization (XSAVE)\n"); + BARRIER(BARRIER_FLOAT); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) {MOVx_REG(x1, ed);} - MOV32w(x2, rex.is32bits); - CALL((void*)fpu_xsave, -1); + MOV32w(x2, rex.w?0:1); + CALL(const_fpu_xsave, -1); break; case 5: INST_NAME("XRSTOR Ed"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + MESSAGE(LOG_DUMP, "Need Optimization (XRSTOR)\n"); + BARRIER(BARRIER_FLOAT); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) {MOVx_REG(x1, ed);} - MOV32w(x2, rex.is32bits); - CALL((void*)fpu_xrstor, -1); + MOV32w(x2, rex.w?0:1); + CALL(const_fpu_xrstor, -1); break; case 7: INST_NAME("CLFLUSH Ed"); - MESSAGE(LOG_DUMP, "Need Optimization?\n"); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - if(ed!=x1) { - MOVx_REG(x1, ed); - } - CALL_(native_clflush, -1, 0); + DC_CIVAC(ed); + SMDMB(); break; default: DEFAULT; @@ -1834,7 +2070,11 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0xAF: INST_NAME("IMUL Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + if (BOX64DRENV(dynarec_safeflags) && BOX64ENV(cputype)) { + SETFLAGS(X_OF|X_CF, SF_SET); + } else { + SETFLAGS(X_ALL, SF_SET); + } nextop = F8; GETGD; GETED(0); @@ -1843,16 +2083,9 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin UFLAG_IF { SMULH(x3, gd, ed); MULx(gd, gd, ed); - IFX(X_PEND) { - UFLAG_OP1(x3); - UFLAG_RES(gd); - UFLAG_DF(x4, d_imul64); - } else IFX(X_CF|X_OF) { - SET_DFNONE(x4); - } + SET_DFNONE(); IFX(X_CF|X_OF) { - ASRx(x4, gd, 63); - CMPSx_REG(x3, x4); + CMPSx_REG_ASR(x3, gd, 63); CSETw(x3, cNE); IFX(X_CF) { BFIw(xFlags, x3, F_CF, 1); @@ -1870,16 +2103,9 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SMULL(gd, gd, ed); LSRx(x3, gd, 32); MOVw_REG(gd, gd); - IFX(X_PEND) { - UFLAG_RES(gd); - UFLAG_OP1(x3); - UFLAG_DF(x4, d_imul32); - } else IFX(X_CF|X_OF) { - SET_DFNONE(x4); - } + SET_DFNONE(); IFX(X_CF|X_OF) { - ASRw(x4, gd, 31); - CMPSw_REG(x3, x4); + CMPSw_REG_ASR(x3, gd, 31); CSETw(x3, cNE); IFX(X_CF) { BFIw(xFlags, x3, F_CF, 1); @@ -1888,17 +2114,17 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin BFIw(xFlags, x3, F_OF, 1); } } - if(box64_dynarec_test) { - // to avoid noise during test - BFCw(xFlags, F_AF, 1); - BFCw(xFlags, F_PF, 1); - BFCw(xFlags, F_ZF, 1); - BFCw(xFlags, F_SF, 1); - } } else { MULxw(gd, gd, ed); } } + IFX2(X_AF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_AF, 1);} + IFX2(X_ZF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX2(X_SF, && !BOX64ENV(cputype)) { + LSRxw(x3, gd, rex.w?63:31); + BFIw(xFlags, x3, F_SF, 1); + } + IFX2(X_PF, && !BOX64ENV(cputype)) emit_pf(dyn, ninst, gd, x3); break; case 0xB1: @@ -1908,45 +2134,52 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop = F8; GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; - UFLAG_IF {emit_cmp32(dyn, ninst, rex, xRAX, ed, x3, x4, x5);} - MOVxw_REG(x1, ed); // save value - CMPSxw_REG(xRAX, x1); - if(rex.w) { - CSELxw(ed, gd, ed, cEQ); + UFLAG_IF { + emit_cmp32(dyn, ninst, rex, xRAX, ed, x3, x4, x5); } else { - B_MARK2(cNE); - MOVw_REG(ed, gd); - MARK2; + CMPSxw_REG(xRAX, ed); } + MOVxw_REG(x1, ed); // save value + Bcond(cNE, 4 + (rex.w ? 4 : 8)); + MOVxw_REG(ed, gd); + if (!rex.w) { B_NEXT_nocond; } } else { addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0); LDxw(x1, wback, fixedaddress); - UFLAG_IF {emit_cmp32(dyn, ninst, rex, xRAX, x1, x3, x4, x5);} - CMPSxw_REG(xRAX, x1); - B_MARK(cNE); + UFLAG_IF { + emit_cmp32(dyn, ninst, rex, xRAX, x1, x3, x4, x5); + } + SUBxw_REG(x4, xRAX, x1); + CBNZxw_MARK(x4); // EAX == Ed STxw(gd, wback, fixedaddress); + if (!rex.w) { B_NEXT_nocond; } MARK; } - MOVxw_REG(xRAX, x1); // upper part of RAX will be erase on 32bits, no mater what + MOVxw_REG(xRAX, x1); break; case 0xB3: INST_NAME("BTR Ed, Gd"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } + SET_DFNONE(); nextop = F8; GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0); - ASRx(x1, gd, 5+rex.w); // r1 = (gd>>5) - ADDx_REG_LSL(x3, wback, x1, 2+rex.w); //(&ed)+=r1*4; + ASRxw(x1, gd, 5+rex.w); // r1 = (gd>>5) + if(!rex.w && !rex.is32bits) {SXTWx(x1, x1);} + ADDy_REG_LSL(x3, wback, x1, 2+rex.w); //(&ed)+=r1*4; LDxw(x1, x3, fixedaddress); ed = x1; wback = x3; @@ -1964,7 +2197,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LSLxw_REG(x4, x4, x2); BICxw_REG(ed, ed, x4); if(wback) { - STRxw_U12(ed, wback, fixedaddress); + STxw(ed, wback, fixedaddress); SMWRITE(); } break; @@ -1975,11 +2208,11 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETGD; if(MODREG) { if(rex.rex) { - eb1 = xRAX+(nextop&7)+(rex.b<<3); + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); eb2 = 0; \ } else { ed = (nextop&7); - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx + eb1 = TO_NAT(ed&3); // Ax, Cx, Dx or Bx eb2 = (ed&4)>>2; // L or H } UBFXxw(gd, eb1, eb2*8, 8); @@ -1994,7 +2227,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop = F8; GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); UBFXxw(gd, ed, 0, 16); } else { SMREAD(); @@ -2008,11 +2241,14 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 4: INST_NAME("BT Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } gd = x2; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 1); @@ -2021,14 +2257,19 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } u8 = F8; u8&=rex.w?0x3f:0x1f; - BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) + IFX(X_CF) { + BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) + } break; case 5: INST_NAME("BTS Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { SMREAD(); @@ -2041,8 +2282,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin IFX(X_CF) { BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) } - MOV32w(x4, 1); - ORRxw_REG_LSL(ed, ed, x4, u8); + mask = convert_bitmask_xw(1LL<>12)&1, mask&0x3F, (mask>>6)&0x3F); if(wback) { STxw(ed, wback, fixedaddress); SMWRITE(); @@ -2050,10 +2291,13 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 6: INST_NAME("BTR Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { SMREAD(); @@ -2074,10 +2318,13 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 7: INST_NAME("BTC Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { SMREAD(); @@ -2090,8 +2337,8 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin IFX(X_CF) { BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) } - MOV32w(x4, 1); - EORxw_REG_LSL(ed, ed, x4, u8); + mask = convert_bitmask_xw(1LL<>12)&1, mask&0x3F, (mask>>6)&0x3F); if(wback) { STxw(ed, wback, fixedaddress); SMWRITE(); @@ -2103,18 +2350,22 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0xBB: INST_NAME("BTC Ed, Gd"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } nextop = F8; GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0); - ASRx(x1, gd, 5+rex.w); // r1 = (gd>>5) - ADDx_REG_LSL(x3, wback, x1, 2+rex.w); //(&ed)+=r1*4; + ASRxw(x1, gd, 5+rex.w); // r1 = (gd>>5) + if(!rex.w && !rex.is32bits) {SXTWx(x1, x1);} + ADDy_REG_LSL(x3, wback, x1, 2+rex.w); //(&ed)+=r1*4; LDxw(x1, x3, fixedaddress); ed = x1; wback = x3; @@ -2138,8 +2389,12 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0xBC: INST_NAME("BSF Gd, Ed"); - SETFLAGS(X_ZF, SF_SET_DF); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags) || BOX64ENV(cputype)) { + SETFLAGS(X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_ALL, SF_SET); + } + SET_DFNONE(); nextop = F8; GETED(0); GETGD; @@ -2149,14 +2404,27 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin CLZxw(gd, x1); // x2 gets leading 0 == BSF MARK; IFX(X_ZF) { - CSETw(x1, cEQ); //other flags are undefined - BFIw(xFlags, x1, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(x2, cEQ); //other flags are undefined + BFIw(xFlags, x2, F_ZF, 1); + } + } + if (BOX64DRENV(dynarec_safeflags) && !BOX64ENV(cputype)) { + IFX(X_CF) BFCw(xFlags, F_CF, 1); + IFX(X_AF) BFCw(xFlags, F_AF, 1); + IFX(X_SF) BFCw(xFlags, F_SF, 1); + IFX(X_OF) BFCw(xFlags, F_OF, 1); + IFX(X_PF) emit_pf(dyn, ninst, gd, x2); } break; case 0xBD: INST_NAME("BSR Gd, Ed"); - SETFLAGS(X_ZF, SF_SET_DF); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags) || BOX64ENV(cputype)) { + SETFLAGS(X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_ALL, SF_SET); + } + SET_DFNONE(); nextop = F8; GETED(0); GETGD; @@ -2167,8 +2435,17 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin NEGxw_REG(gd, gd); // complement MARK; IFX(X_ZF) { - CSETw(x1, cEQ); //other flags are undefined - BFIw(xFlags, x1, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(x2, cEQ); //other flags are undefined + BFIw(xFlags, x2, F_ZF, 1); + } + } + if (BOX64DRENV(dynarec_safeflags) && !BOX64ENV(cputype)) { + IFX(X_CF) BFCw(xFlags, F_CF, 1); + IFX(X_AF) BFCw(xFlags, F_AF, 1); + IFX(X_SF) BFCw(xFlags, F_SF, 1); + IFX(X_OF) BFCw(xFlags, F_OF, 1); + IFX(X_PF) emit_pf(dyn, ninst, gd, x2); } break; case 0xBE: @@ -2177,12 +2454,12 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETGD; if(MODREG) { if(rex.rex) { - wback = xRAX+(nextop&7)+(rex.b<<3); + wback = TO_NAT((nextop & 7) + (rex.b << 3)); wb2 = 0; } else { wback = (nextop&7); wb2 = (wback>>2)*8; - wback = xRAX+(wback&3); + wback = TO_NAT(wback&3); } SBFXxw(gd, wback, wb2, 8); } else { @@ -2196,7 +2473,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop = F8; GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); SXTHxw(gd, ed); } else { SMREAD(); @@ -2238,23 +2515,19 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0: VFCMEQQS(v0, v0, v1); break; // Equal case 1: VFCMGTQS(v0, v1, v0); break; // Less than case 2: VFCMGEQS(v0, v1, v0); break; // Less or equal - case 3: VFCMEQQS(v0, v0, v0); - if(v0!=v1) { - q0 = fpu_get_scratch(dyn, ninst); - VFCMEQQS(q0, v1, v1); - VANDQ(v0, v0, q0); + case 3: if(v0!=v1) { + VFMAXQS(v0, v0, v1); // propagate NAN } + VFCMEQQS(v0, v0, v0); VMVNQ(v0, v0); break; // NaN (NaN is not equal to himself) case 4: VFCMEQQS(v0, v0, v1); VMVNQ(v0, v0); break; // Not Equal (or unordered on ARM, not on X86...) case 5: VFCMGTQS(v0, v1, v0); VMVNQ(v0, v0); break; // Greater or equal or unordered case 6: VFCMGEQS(v0, v1, v0); VMVNQ(v0, v0); break; // Greater or unordered - case 7: VFCMEQQS(v0, v0, v0); - if(v0!=v1) { - q0 = fpu_get_scratch(dyn, ninst); - VFCMEQQS(q0, v1, v1); - VANDQ(v0, v0, q0); + case 7: if(v0!=v1) { + VFMAXQS(v0, v0, v1); // propagate NAN } + VFCMEQQS(v0, v0, v0); break; // not NaN } break; @@ -2263,7 +2536,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop=F8; GETGD; if(MODREG) { // reg <= reg - MOVxw_REG(xRAX+(nextop&7)+(rex.b<<3), gd); + MOVxw_REG(TO_NAT((nextop & 7) + (rex.b << 3)), gd); } else { // mem <= reg addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 0); STxw(gd, ed, fixedaddress); @@ -2275,7 +2548,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETGM(v0); if(MODREG) { u8 = (F8)&3; - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); VMOVQHfrom(v0, u8, ed); } else { addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1); @@ -2313,16 +2586,30 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VMOVeS(v0, 1, v0, 0); } else if(v0==v1 && (u8==0xe5)) { // easy special case VMOVeS(v0, 0, v0, 1); + } else if(v0==v1 && (u8==0x39)) { + VEXTQ_8(v0, v0, v0, 4); + } else if(u8==0x4E && MODREG) { + VEXTQ_8(v0, v0, v1, 8); } else { d0 = fpu_get_scratch(dyn, ninst); // first two elements from Gx - for(int i=0; i<2; ++i) { - VMOVeS(d0, i, v0, (u8>>(i*2))&3); + if((u8&0xf)==0x04) + VMOVeD(d0, 0, v0, 0); + else if((u8&0xf)==0x0e) + VMOVeD(d0, 0, v0, 1); + else + for(int i=0; i<2; ++i) { + VMOVeS(d0, i, v0, (u8>>(i*2))&3); } // second two from Ex if(MODREG) { - for(int i=2; i<4; ++i) { - VMOVeS(d0, i, v1, (u8>>(i*2))&3); + if((u8&0xf0)==0x40) + VMOVeD(d0, 1, v1, 0); + else if((u8&0xf0)==0xe0) + VMOVeD(d0, 1, v1, 1); + else + for(int i=2; i<4; ++i) { + VMOVeS(d0, i, v1, (u8>>(i*2))&3); } } else { SMREAD(); @@ -2337,73 +2624,102 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0xC7: // rep has no impact here nextop = F8; - if(MODREG) switch((nextop>>3)&7) { + if(MODREG) switch((nextop>>3)&7) { case 6: INST_NAME("RDRAND Ed"); - SETFLAGS(X_ALL, SF_SET_DF); - SET_DFNONE(x1); + SETFLAGS(X_ALL, SF_SET); + SET_DFNONE(); GETED(0); IFX(X_OF|X_SF|X_ZF|X_PF|X_AF) { MOV32w(x1, (1<>3)&7) { case 1: - INST_NAME("CMPXCHG8B Gq, Eq"); - SETFLAGS(X_ZF, SF_SUBSET); - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - LDPxw_S7_offset(x2, x3, wback, 0); - CMPSxw_REG(xRAX, x2); - CCMPxw(xRDX, x3, 0, cEQ); - B_MARK(cNE); // EAX!=ED[0] || EDX!=Ed[1] - STPxw_S7_offset(xRBX, xRCX, wback, 0); - UFLAG_IF { - MOV32w(x1, 1); - } - B_MARK3_nocond; - MARK; - MOVxw_REG(xRAX, x2); - MOVxw_REG(xRDX, x3); - UFLAG_IF { - MOV32w(x1, 0); - } - MARK3; - UFLAG_IF { - BFIw(xFlags, x1, F_ZF, 1); + if(MODREG) { + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; + } else { + if (rex.w) { + INST_NAME("CMPXCHG16B Gq, Eq"); + } else { + INST_NAME("CMPXCHG8B Gq, Eq"); + } + SETFLAGS(X_ZF, SF_SUBSET); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + if(rex.w && BOX64DRENV(dynarec_safeflags)>1) { + // unaligned memory cause a GPF + TSTx_mask(wback, 1, 0, 3); + B_MARK2(cEQ); // alligned, continue... + STORE_XEMU_CALL(xRIP); + CALL_S(const_native_gpf, -1); + LOAD_XEMU_CALL(xRIP); + MARK2; + } + LDPxw_S7_offset(x2, x3, wback, 0); + CMPSxw_REG(xRAX, x2); + CCMPxw(xRDX, x3, 0, cEQ); + B_MARK(cNE); // EAX!=ED[0] || EDX!=Ed[1] + STPxw_S7_offset(xRBX, xRCX, wback, 0); + UFLAG_IF { + IFNATIVE(NF_EQ) {} else {MOV32w(x1, 1);} + } + B_MARK3_nocond; + MARK; + MOVxw_REG(xRAX, x2); + MOVxw_REG(xRDX, x3); + UFLAG_IF { + IFNATIVE(NF_EQ) {} else {MOV32w(x1, 0);} + } + MARK3; + UFLAG_IF { + IFNATIVE(NF_EQ) {} else { + BFIw(xFlags, x1, F_ZF, 1); + } + } + SMWRITE(); } - SMWRITE(); break; case 4: INST_NAME("Unsupported XSAVEC Ed"); FAKEED; + BARRIER(BARRIER_FLOAT); + GETIP(ip); UDF(0); break; case 6: INST_NAME("RDRAND Ed"); - SETFLAGS(X_ALL, SF_SET_DF); - SET_DFNONE(x1); + SETFLAGS(X_ALL, SF_SET); + SET_DFNONE(); IFX(X_OF|X_SF|X_ZF|X_PF|X_AF) { MOV32w(x1, (1< 64bits + VMOV(q0, d1); break; case 0xF7: INST_NAME("MASKMOVQ Gm, Em"); @@ -2777,9 +3083,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin d1 = fpu_get_scratch(dyn, ninst); VSSHR_8(d1, q1, 7); // d1 = byte slection mask VLDR64_U12(d0, xRDI, 0); - VBIC(d0, d0, d1); // d0 = clear masked byte - VAND(d1, q0, d1); // d1 = masked Gm - VORR(d0, d0, d1); + VBIT(d0, q0, d1); VSTR64_U12(d0, xRDI, 0); break; case 0xF8: diff --git a/src/dynarec/arm64/dynarec_arm64_64.c b/src/dynarec/arm64/dynarec_arm64_64.c deleted file mode 100644 index 046c08d..0000000 --- a/src/dynarec/arm64/dynarec_arm64_64.c +++ /dev/null @@ -1,1275 +0,0 @@ -#include -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" -#include "custommem.h" - -#include "arm64_printer.h" -#include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" -#include "dynarec_arm64_functions.h" - -uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int seg, int* ok, int* need_epilog) -{ - (void)ip; (void)rep; (void)need_epilog; - - uint8_t opcode = F8; - uint8_t nextop; - uint8_t u8; - uint8_t gd, ed, eb1, eb2, gb1, gb2; - uint8_t wback, wb1, wb2, wb; - int64_t i64, j64; - uint64_t u64; - int v0, v1; - int q0; - int d0; - int64_t fixedaddress; - int unscaled; - MAYUSE(eb1); - MAYUSE(eb2); - MAYUSE(wb1); - MAYUSE(wb2); - MAYUSE(gb1); - MAYUSE(gb2); - MAYUSE(j64); - MAYUSE(d0); - MAYUSE(q0); - MAYUSE(v0); - MAYUSE(v1); - - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - GETREX(); - - switch(opcode) { - - case 0x01: - INST_NAME("ADD Seg:Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_add32(dyn, ninst, rex, ed, gd, x3, x5); - WBACKO(x4); - break; - case 0x03: - INST_NAME("ADD Gd, Seg:Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_add32(dyn, ninst, rex, gd, ed, x3, x4); - break; - - case 0x0B: - INST_NAME("OR Gd, Seg:Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_or32(dyn, ninst, rex, gd, ed, x3, x4); - break; - - case 0x0F: - opcode = F8; - switch(opcode) { - - case 0x10: - switch(rep) { - case 1: - INST_NAME("MOVSD Gx, Ex"); - nextop = F8; - GETG; - if(MODREG) { - ed = (nextop&7)+ (rex.b<<3); - v0 = sse_get_reg(dyn, ninst, x1, gd, 1); - d0 = sse_get_reg(dyn, ninst, x1, ed, 0); - VMOVeD(v0, 0, d0, 0); - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - v0 = sse_get_reg_empty(dyn, ninst, x1, gd); - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); - ADDx_REG(x4, x4, ed); - VLD64(v0, x4, fixedaddress); // upper part reseted - } - break; - case 2: - INST_NAME("MOVSS Gx, Ex"); - nextop = F8; - GETG; - if(MODREG) { - ed = (nextop&7)+ (rex.b<<3); - v0 = sse_get_reg(dyn, ninst, x1, gd, 1); - q0 = sse_get_reg(dyn, ninst, x1, ed, 0); - VMOVeS(v0, 0, q0, 0); - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - v0 = sse_get_reg_empty(dyn, ninst, x1, gd); - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); - ADDx_REG(x4, x4, ed); - VLD32(v0, x4, fixedaddress); - } - break; - default: - DEFAULT; - } - break; - case 0x11: - switch(rep) { - case 0: - INST_NAME("MOVUPS Ex,Gx"); - nextop = F8; - GETG; - v0 = sse_get_reg(dyn, ninst, x1, gd, 0); - if(MODREG) { - ed = (nextop&7)+(rex.b<<3); - v1 = sse_get_reg_empty(dyn, ninst, x1, ed); - VMOVQ(v1, v0); - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); - ADDx_REG(x4, x4, ed); - VST128(v0, x4, fixedaddress); - SMWRITE2(); - } - break; - case 1: - INST_NAME("MOVSD Ex, Gx"); - nextop = F8; - GETG; - v0 = sse_get_reg(dyn, ninst, x1, gd, 0); - if(MODREG) { - ed = (nextop&7)+ (rex.b<<3); - d0 = sse_get_reg(dyn, ninst, x1, ed, 1); - VMOVeD(d0, 0, v0, 0); - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); - ADDx_REG(x4, x4, ed); - VST64(v0, x4, fixedaddress); - SMWRITE2(); - } - break; - case 2: - INST_NAME("MOVSS Ex, Gx"); - nextop = F8; - GETG; - v0 = sse_get_reg(dyn, ninst, x1, gd, 0); - if(MODREG) { - ed = (nextop&7)+ (rex.b<<3); - q0 = sse_get_reg(dyn, ninst, x1, ed, 1); - VMOVeS(q0, 0, v0, 0); - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); - ADDx_REG(x4, x4, ed); - VST32(v0, x4, fixedaddress); - SMWRITE2(); - } - break; - default: - DEFAULT; - } - break; - - case 0x6F: - switch(rep) { - case 2: - INST_NAME("MOVDQU Gx,Ex");// no alignment constraint on NEON here, so same as MOVDQA - nextop = F8; - GETG; - v0 = sse_get_reg_empty(dyn, ninst, x1, gd); - if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); - VMOVQ(v0, v1); - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); - ADDx_REG(x4, x4, ed); - VLD128(v0, ed, fixedaddress); - } - break; - default: - DEFAULT; - } - break; - - - case 0xAF: - switch(rep) { - case 0: - INST_NAME("IMUL Gd, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - nextop = F8; - grab_segdata(dyn, addr, ninst, x4, seg); - GETGD; - GETEDO(x4, 0); - if(rex.w) { - // 64bits imul - UFLAG_IF { - SMULH(x3, gd, ed); - MULx(gd, gd, ed); - UFLAG_OP1(x3); - UFLAG_RES(gd); - UFLAG_DF(x3, d_imul64); - } else { - MULxw(gd, gd, ed); - } - } else { - // 32bits imul - UFLAG_IF { - SMULL(gd, gd, ed); - UFLAG_RES(gd); - LSRx(x3, gd, 32); - UFLAG_OP1(x3); - MOVw_REG(gd, gd); - UFLAG_DF(x3, d_imul32); - } else { - MULxw(gd, gd, ed); - } - } - break; - default: - DEFAULT; - } - break; - - case 0xB6: - switch(rep) { - case 0: - INST_NAME("MOVZX Gd, Eb"); - nextop = F8; - grab_segdata(dyn, addr, ninst, x4, seg); - GETGD; - if(MODREG) { - if(rex.rex) { - eb1 = xRAX+(nextop&7)+(rex.b<<3); - eb2 = 0; \ - } else { - ed = (nextop&7); - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx - eb2 = (ed&4)>>2; // L or H - } - UBFXxw(gd, eb1, eb2*8, 8); - } else { - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - LDRB_REG(gd, ed, x4); - } - break; - default: - DEFAULT; - } - break; - - default: - DEFAULT; - } - break; - - case 0x13: - INST_NAME("ADC Gd, Seg:Ed"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_adc32(dyn, ninst, rex, gd, ed, x3, x5); - break; - - case 0x21: - INST_NAME("AND Seg:Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_and32(dyn, ninst, rex, ed, gd, x3, x5); - WBACKO(x4); - break; - - case 0x23: - INST_NAME("AND Gd, Seg:Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_and32(dyn, ninst, rex, gd, ed, x3, x5); - break; - - case 0x29: - INST_NAME("SUB Seg:Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_sub32(dyn, ninst, rex, ed, gd, x3, x5); - WBACKO(x4); - break; - - case 0x2B: - INST_NAME("SUB Gd, Seg:Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_sub32(dyn, ninst, rex, gd, ed, x3, x4); - break; - - case 0x31: - INST_NAME("XOR Seg:Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_xor32(dyn, ninst, rex, ed, gd, x3, x5); - WBACKO(x4); - break; - - case 0x33: - INST_NAME("XOR Gd, Seg:Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_xor32(dyn, ninst, rex, gd, ed, x3, x4); - break; - - case 0x39: - INST_NAME("CMP Seg:Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_cmp32(dyn, ninst, rex, ed, gd, x3, x4, x5); - break; - - case 0x3B: - INST_NAME("CMP Gd, Seg:Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_cmp32(dyn, ninst, rex, gd, ed, x3, x4, x5); - break; - - case 0x63: - if(rex.is32bits) { - // ARPL here - DEFAULT; - } else { - INST_NAME("MOVSXD Gd, Ed"); - nextop = F8; - GETGD; - if(rex.w) { - if(MODREG) { // reg <= reg - SXTWx(gd, xRAX+(nextop&7)+(rex.b<<3)); - } else { // mem <= reg - grab_segdata(dyn, addr, ninst, x4, seg); - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - LDRSW_REG(gd, ed, x4); - } - } else { - if(MODREG) { // reg <= reg - MOVw_REG(gd, xRAX+(nextop&7)+(rex.b<<3)); - } else { // mem <= reg - grab_segdata(dyn, addr, ninst, x4, seg); - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - LDRw_REG(gd, ed, x4); - } - } - } - break; - case 0x64: - addr = dynarec64_64(dyn, addr, ip, ninst, rex, rep, _FS, ok, need_epilog); - break; - case 0x65: - addr = dynarec64_64(dyn, addr, ip, ninst, rex, rep, _GS, ok, need_epilog); - break; - case 0x66: - addr = dynarec64_6664(dyn, addr, ip, ninst, rex, seg, ok, need_epilog); - break; - case 0x67: - if(rex.is32bits) - addr = dynarec64_6764_32(dyn, addr, ip, ninst, rex, rep, seg, ok, need_epilog); - else { - DEFAULT; - } - break; - - case 0x70: - case 0x71: - case 0x72: - case 0x73: - case 0x74: - case 0x75: - case 0x76: - case 0x77: - case 0x78: - case 0x79: - case 0x7A: - case 0x7B: - case 0x7C: - case 0x7D: - case 0x7E: - case 0x7F: - // just use regular conditional jump - return dynarec64_00(dyn, addr-1, ip, ninst, rex, rep, ok, need_epilog); - case 0x80: - nextop = F8; - switch((nextop>>3)&7) { - case 0: //ADD - INST_NAME("ADD Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_add8c(dyn, ninst, x1, u8, x2, x4); - EBBACK; - break; - case 1: //OR - INST_NAME("OR Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_or8c(dyn, ninst, x1, u8, x2, x4); - EBBACK; - break; - case 2: //ADC - INST_NAME("ADC Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_adc8c(dyn, ninst, x1, u8, x2, x4, x5); - EBBACK; - break; - case 3: //SBB - INST_NAME("SBB Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_sbb8c(dyn, ninst, x1, u8, x2, x4, x5); - EBBACK; - break; - case 4: //AND - INST_NAME("AND Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_and8c(dyn, ninst, x1, u8, x2, x4); - EBBACK; - break; - case 5: //SUB - INST_NAME("SUB Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_sub8c(dyn, ninst, x1, u8, x2, x4, x5); - EBBACK; - break; - case 6: //XOR - INST_NAME("XOR Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_xor8c(dyn, ninst, x1, u8, x2, x4); - EBBACK; - break; - case 7: //CMP - INST_NAME("CMP Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - if(u8) { - MOV32w(x2, u8); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5); - } else { - emit_cmp8_0(dyn, ninst, x1, x3, x4); - } - break; - default: - DEFAULT; - } - break; - case 0x81: - case 0x83: - nextop = F8; - grab_segdata(dyn, addr, ninst, x6, seg); - switch((nextop>>3)&7) { - case 0: //ADD - if(opcode==0x81) {INST_NAME("ADD Ed, Id");} else {INST_NAME("ADD Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5); - WBACKO(x6); - break; - case 1: //OR - if(opcode==0x81) {INST_NAME("OR Ed, Id");} else {INST_NAME("OR Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_or32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACKO(x6); - break; - case 2: //ADC - if(opcode==0x81) {INST_NAME("ADC Ed, Id");} else {INST_NAME("ADC Ed, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - MOV64xw(x5, i64); - emit_adc32(dyn, ninst, rex, ed, x5, x3, x4); - WBACKO(x6); - break; - case 3: //SBB - if(opcode==0x81) {INST_NAME("SBB Ed, Id");} else {INST_NAME("SBB Ed, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - MOV64xw(x5, i64); - emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4); - WBACKO(x6); - break; - case 4: //AND - if(opcode==0x81) {INST_NAME("AND Ed, Id");} else {INST_NAME("AND Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_and32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACKO(x6); - break; - case 5: //SUB - if(opcode==0x81) {INST_NAME("SUB Ed, Id");} else {INST_NAME("SUB Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_sub32c(dyn, ninst, rex, ed, i64, x3, x4, x5); - WBACKO(x6); - break; - case 6: //XOR - if(opcode==0x81) {INST_NAME("XOR Ed, Id");} else {INST_NAME("XOR Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_xor32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACKO(x6); - break; - case 7: //CMP - if(opcode==0x81) {INST_NAME("CMP Ed, Id");} else {INST_NAME("CMP Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - if(i64) { - MOV64xw(x2, i64); - emit_cmp32(dyn, ninst, rex, ed, x2, x3, x4, x5); - } else - emit_cmp32_0(dyn, ninst, rex, ed, x3, x4); - break; - } - break; - case 0x8A: - INST_NAME("MOV Gb, Eb"); - nextop = F8; - if(rex.rex) { - gb1 = gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); - gb2=0; - } else { - gd = (nextop&0x38)>>3; - gb1 = xRAX+(gd&3); - gb2 = ((gd&4)<<1); - } - if(MODREG) { - if(rex.rex) { - wback = xRAX+(nextop&7)+(rex.b<<3); - wb2 = 0; - } else { - wback = (nextop&7); - wb2 = (wback>>2); - wback = xRAX+(wback&3); - } - if(wb2) { - UBFXw(x4, wback, wb2*8, 8); - ed = x4; - } else { - ed = wback; - } - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - LDRB_REG(x4, wback, x4); - ed = x4; - } - BFIx(gb1, ed, gb2, 8); - break; - case 0x89: - INST_NAME("MOV Seg:Ed, Gd"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop=F8; - GETGD; - if(MODREG) { // reg <= reg - MOVxw_REG(xRAX+(nextop&7)+(rex.b<<3), gd); - } else { // mem <= reg - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - STRxw_REG(gd, ed, x4); - SMWRITE2(); - } - break; - - case 0x8B: - INST_NAME("MOV Gd, Seg:Ed"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop=F8; - GETGD; - if(MODREG) { // reg <= reg - MOVxw_REG(gd, xRAX+(nextop&7)+(rex.b<<3)); - } else { // mem <= reg - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - LDRxw_REG(gd, ed, x4); - } - break; - - case 0x8D: - INST_NAME("LEA Gd, Ed"); - nextop=F8; - GETGD; - if(MODREG) { // reg <= reg? that's an invalid operation - DEFAULT; - } else { // mem <= reg - addr = geted(dyn, addr, ninst, nextop, &ed, gd, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - if(gd!=ed) { // it's sometimes used as a 3 bytes NOP - MOVxw_REG(gd, ed); - } - else if(!rex.w && !rex.is32bits) { - MOVw_REG(gd, gd); //truncate the higher 32bits as asked - } - } - break; - case 0x8E: - INST_NAME("MOV Seg,Ew"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - u8 = (nextop&0x38)>>3; - if((nextop&0xC0)==0xC0) { - ed = xRAX+(nextop&7)+(rex.b<<3); - } else { - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - LDRH_REG(x1, wback, x4); - ed = x1; - } - STRH_U12(ed, xEmu, offsetof(x64emu_t, segs[u8])); - STRw_U12(wZR, xEmu, offsetof(x64emu_t, segs_serial[u8])); - break; - case 0x8F: - INST_NAME("POP FS:Ed"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - if(MODREG) { - POP1z(xRAX+(nextop&7)+(rex.b<<3)); - } else { - POP1z(x2); // so this can handle POP [ESP] and maybe some variant too - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0, 0, rex, NULL, 0, 0); - if(ed==xRSP) { - STRz_REG(x2, ed, x4); - } else { - // complicated to just allow a segfault that can be recovered correctly - SUBz_U12(xRSP, xRSP, rex.is32bits?4:8); - STRz_REG(x2, ed, x4); - ADDz_U12(xRSP, xRSP, rex.is32bits?4:8); - } - } - break; - case 0x90: - INST_NAME("NOP"); - break; - - case 0xA1: - INST_NAME("MOV EAX,FS:Od"); - grab_segdata(dyn, addr, ninst, x4, seg); - if(rex.is32bits) - u64 = F32; - else - u64 = F64; - MOV64z(x1, u64); - LDRxw_REG(xRAX, x1, x4); - break; - - case 0xA3: - INST_NAME("MOV FS:Od,EAX"); - grab_segdata(dyn, addr, ninst, x4, seg); - if(rex.is32bits) - u64 = F32; - else - u64 = F64; - MOV64z(x1, u64); - STRxw_REG(xRAX, x1, x4); - SMWRITE2(); - break; - - case 0xC6: - INST_NAME("MOV Seg:Eb, Ib"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop=F8; - if(MODREG) { // reg <= u8 - u8 = F8; - if(!rex.rex) { - ed = (nextop&7); - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx - eb2 = (ed&4)>>2; // L or H - } else { - eb1 = xRAX+(nextop&7)+(rex.b<<3); - eb2 = 0; - } - MOV32w(x3, u8); - BFIx(eb1, x3, eb2*8, 8); - } else { // mem <= u8 - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1); - u8 = F8; - MOV32w(x3, u8); - STRB_REG(x3, ed, x4); - SMWRITE2(); - } - break; - case 0xC7: - INST_NAME("MOV Seg:Ed, Id"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop=F8; - if(MODREG) { // reg <= i32 - i64 = F32S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV64xw(ed, i64); - } else { // mem <= i32 - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 4); - i64 = F32S; - MOV64xw(x3, i64); - STRxw_REG(x3, ed, x4); - SMWRITE2(); - } - break; - - case 0xD1: - nextop = F8; - grab_segdata(dyn, addr, ninst, x6, seg); - switch((nextop>>3)&7) { - case 0: - INST_NAME("ROL Ed, 1"); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); - GETEDO(x6, 0); - emit_rol32c(dyn, ninst, rex, ed, 1, x3, x4); - WBACKO(x6); - break; - case 1: - INST_NAME("ROR Ed, 1"); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); - GETEDO(x6, 0); - emit_ror32c(dyn, ninst, rex, ed, 1, x3, x4); - WBACKO(x6); - break; - case 2: - INST_NAME("RCL Ed, 1"); - READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose - GETEDO(x6, 0); - emit_rcl32c(dyn, ninst, rex, ed, 1, x3, x4); - WBACKO(x6); - break; - case 3: - INST_NAME("RCR Ed, 1"); - READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose - GETEDO(x6, 0); - emit_rcr32c(dyn, ninst, rex, ed, 1, x3, x4); - WBACKO(x6); - break; - case 4: - case 6: - INST_NAME("SHL Ed, 1"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - GETEDO(x6, 0); - emit_shl32c(dyn, ninst, rex, ed, 1, x3, x4); - WBACKO(x6); - break; - case 5: - INST_NAME("SHR Ed, 1"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - GETEDO(x6, 0); - emit_shr32c(dyn, ninst, rex, ed, 1, x3, x4); - WBACKO(x6); - break; - case 7: - INST_NAME("SAR Ed, 1"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - GETEDO(x6, 0); - emit_sar32c(dyn, ninst, rex, ed, 1, x3, x4); - WBACKO(x6); - break; - } - break; - case 0xD3: - nextop = F8; - grab_segdata(dyn, addr, ninst, x6, seg); - switch((nextop>>3)&7) { - case 0: - INST_NAME("ROL Ed, CL"); - SETFLAGS(X_OF|X_CF, SF_SUBSET); - if(rex.w) { - ANDSx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } - MOV64xw(x4, (rex.w?64:32)); - SUBx_REG(x3, x4, x3); - GETEDO(x6, 0); - if(!rex.w && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); - RORxw_REG(ed, ed, x3); - WBACKO(x6); - UFLAG_IF { // calculate flags directly - CMPSw_U12(x3, rex.w?63:31); - B_MARK(cNE); - LSRxw(x4, ed, rex.w?63:31); - ADDxw_REG(x4, x4, ed); - BFIw(xFlags, x4, F_OF, 1); - MARK; - BFIw(xFlags, ed, F_CF, 1); - UFLAG_DF(x2, d_none); - } - break; - case 1: - INST_NAME("ROR Ed, CL"); - SETFLAGS(X_OF|X_CF, SF_SUBSET); - if(rex.w) { - ANDSx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } - GETEDO(x6, 0); - if(!rex.w && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); - RORxw_REG(ed, ed, x3); - WBACKO(x6); - UFLAG_IF { // calculate flags directly - CMPSw_U12(x3, 1); - B_MARK(cNE); - LSRxw(x2, ed, rex.w?62:30); // x2 = d>>30 - EORw_REG_LSR(x2, x2, x2, 1); // x2 = ((d>>30) ^ ((d>>30)>>1)) - BFIw(xFlags, x2, F_OF, 1); - MARK; - LSRxw(x2, ed, rex.w?63:31); - BFIw(xFlags, x2, F_CF, 1); - UFLAG_DF(x2, d_none); - } - break; - case 2: - INST_NAME("RCL Ed, CL"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - if(rex.w) { - ANDSx_mask(x2, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDSw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f - } - GETEDO(x6, 0); - if(wback) {ADDx_REG(x6, x6, wback); wback=x6;} - if(!rex.w && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); - CALL_(rex.w?((void*)rcl64):((void*)rcl32), ed, x6); - WBACK; - break; - case 3: - INST_NAME("RCR Ed, CL"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - if(rex.w) { - ANDSx_mask(x2, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDSw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f - } - GETEDO(x6, 0); - if(wback) {ADDx_REG(x6, x6, wback); wback=x6;} - if(!rex.w && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); - CALL_(rex.w?((void*)rcr64):((void*)rcr32), ed, x6); - WBACK; - break; - case 4: - case 6: - INST_NAME("SHL Ed, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(rex.w) { - ANDSx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } - GETEDO(x6, 0); - if(!rex.w && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); - emit_shl32(dyn, ninst, rex, ed, x3, x5, x4); - WBACKO(x6); - break; - case 5: - INST_NAME("SHR Ed, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(rex.w) { - ANDSx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } - GETEDO(x6, 0); - if(!rex.w && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); - emit_shr32(dyn, ninst, rex, ed, x3, x5, x4); - WBACKO(x6); - break; - case 7: - INST_NAME("SAR Ed, CL"); - SETFLAGS(X_ALL, SF_PENDING); - if(rex.w) { - ANDSx_mask(x3, xRCX, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDSw_mask(x3, xRCX, 0, 0b00100); //mask=0x00000001f - } - GETEDO(x6, 0); - if(!rex.w && MODREG) {MOVw_REG(ed, ed);} - B_NEXT(cEQ); - UFLAG_OP12(ed, x3); - ASRxw_REG(ed, ed, x3); - WBACKO(x6); - UFLAG_RES(ed); - UFLAG_DF(x3, rex.w?d_sar64:d_sar32); - break; - } - break; - - case 0xEB: - // just use regular inconditional jump - return dynarec64_00(dyn, addr-1, ip, ninst, rex, rep, ok, need_epilog); - - case 0xF7: - nextop = F8; - grab_segdata(dyn, addr, ninst, x6, seg); - switch((nextop>>3)&7) { - case 0: - case 1: - INST_NAME("TEST Ed, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, 4); - i64 = F32S; - MOV64xw(x2, i64); - emit_test32(dyn, ninst, rex, ed, x2, x3, x4, x5); - break; - case 2: - INST_NAME("NOT Ed"); - GETEDO(x6, 0); - MVNxw_REG(ed, ed); - WBACKO(x6); - break; - case 3: - INST_NAME("NEG Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, 0); - emit_neg32(dyn, ninst, rex, ed, x3, x4); - WBACKO(x6); - break; - case 4: - INST_NAME("MUL EAX, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - GETEDO(x6, 0); - if(rex.w) { - if(ed==xRDX) gd=x3; else gd=xRDX; - UMULH(gd, xRAX, ed); - MULx(xRAX, xRAX, ed); - if(gd!=xRDX) {MOVx_REG(xRDX, gd);} - } else { - UMULL(xRDX, xRAX, ed); //64 <- 32x32 - MOVw_REG(xRAX, xRDX); - LSRx(xRDX, xRDX, 32); - } - UFLAG_RES(xRAX); - UFLAG_OP1(xRDX); - UFLAG_DF(x2, rex.w?d_mul64:d_mul32); - break; - case 5: - INST_NAME("IMUL EAX, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - GETEDO(x6, 0); - if(rex.w) { - if(ed==xRDX) gd=x3; else gd=xRDX; - SMULH(gd, xRAX, ed); - MULx(xRAX, xRAX, ed); - if(gd!=xRDX) {MOVx_REG(xRDX, gd);} - } else { - SMULL(xRDX, xRAX, ed); //64 <- 32x32 - MOVw_REG(xRAX, xRDX); - LSRx(xRDX, xRDX, 32); - } - UFLAG_RES(xRAX); - UFLAG_OP1(xRDX); - UFLAG_DF(x2, rex.w?d_imul64:d_imul32); - break; - case 6: - INST_NAME("DIV Ed"); - SETFLAGS(X_ALL, SF_SET); - SET_DFNONE(x2); - if(!rex.w) { - GETEDO(x6, 0); - if(box64_dynarec_div0) { - CBNZx_MARK3(ed); - GETIP_(ip); - STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); - CLEARIP(); - LOAD_XEMU_CALL(xRIP); - jump_to_epilog(dyn, 0, xRIP, ninst); - MARK3; - } - MOVw_REG(x3, xRAX); - ORRx_REG_LSL(x3, x3, xRDX, 32); - if(MODREG) { - MOVw_REG(x4, ed); - ed = x4; - } - UDIVx(x2, x3, ed); - MSUBx(x4, x2, ed, xRAX); - MOVw_REG(xRAX, x2); - MOVw_REG(xRDX, x4); - } else { - if(ninst - && dyn->insts[ninst-1].x64.addr - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31 - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0xD2) { - GETEDO(x6, 0); - if(box64_dynarec_div0) { - CBNZx_MARK3(ed); - GETIP_(ip); - STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); - CLEARIP(); - LOAD_XEMU_CALL(xRIP); - jump_to_epilog(dyn, 0, xRIP, ninst); - MARK3; - } - UDIVx(x2, xRAX, ed); - MSUBx(xRDX, x2, ed, xRAX); - MOVx_REG(xRAX, x2); - } else { - GETEDO(x6, 0); - CBZxw_MARK(xRDX); - if(ed!=x1) {MOVx_REG(x1, ed);} - CALL(div64, -1); - B_NEXT_nocond; - MARK; - if(box64_dynarec_div0) { - CBNZx_MARK3(ed); - GETIP_(ip); - STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); - CLEARIP(); - LOAD_XEMU_CALL(xRIP); - jump_to_epilog(dyn, 0, xRIP, ninst); - MARK3; - } - UDIVx(x2, xRAX, ed); - MSUBx(xRDX, x2, ed, xRAX); - MOVx_REG(xRAX, x2); - } - } - break; - case 7: - INST_NAME("IDIV Ed"); - NOTEST(x1); - SETFLAGS(X_ALL, SF_SET); - SET_DFNONE(x2) - if(!rex.w) { - GETSEDOw(x6, 0); - MOVw_REG(x3, xRAX); - ORRx_REG_LSL(x3, x3, xRDX, 32); - if(box64_dynarec_div0) { - CBNZx_MARK3(wb); - GETIP_(ip); - STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); - CLEARIP(); - LOAD_XEMU_CALL(xRIP); - jump_to_epilog(dyn, 0, xRIP, ninst); - MARK3; - } - SDIVx(x2, x3, wb); - MSUBx(x4, x2, wb, x3); - MOVw_REG(xRAX, x2); - MOVw_REG(xRDX, x4); - } else { - if(ninst && dyn->insts - && dyn->insts[ninst-1].x64.addr - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x48 - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0x99) { - GETEDO(x6, 0); - if(box64_dynarec_div0) { - CBNZx_MARK3(ed); - GETIP_(ip); - STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); - CLEARIP(); - LOAD_XEMU_CALL(xRIP); - jump_to_epilog(dyn, 0, xRIP, ninst); - MARK3; - } - SDIVx(x2, xRAX, ed); - MSUBx(xRDX, x2, ed, xRAX); - MOVx_REG(xRAX, x2); - } else { - GETEDO(x6, 0); - if(box64_dynarec_div0) { - CBNZx_MARK3(ed); - GETIP_(ip); - STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); - CLEARIP(); - LOAD_XEMU_CALL(xRIP); - jump_to_epilog(dyn, 0, xRIP, ninst); - MARK3; - } - CBZxw_MARK(xRDX); - MVNx_REG(x2, xRDX); - CBZxw_MARK(x2); - if(ed!=x1) {MOVx_REG(x1, ed);} - CALL((void*)idiv64, -1); - B_NEXT_nocond; - MARK; - SDIVx(x2, xRAX, ed); - MSUBx(xRDX, x2, ed, xRAX); - MOVx_REG(xRAX, x2); - } - } - break; - } - break; - - case 0xFF: - nextop = F8; - grab_segdata(dyn, addr, ninst, x6, seg); - switch((nextop>>3)&7) { - case 0: // INC Ed - INST_NAME("INC Ed"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - GETEDO(x6, 0); - emit_inc32(dyn, ninst, rex, ed, x3, x4); - WBACKO(x6); - break; - case 1: //DEC Ed - INST_NAME("DEC Ed"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - GETEDO(x6, 0); - emit_dec32(dyn, ninst, rex, ed, x3, x4); - WBACKO(x6); - break; - case 2: // CALL Ed - INST_NAME("CALL Ed"); - PASS2IF((box64_dynarec_safeflags>1) || - ((ninst && dyn->insts[ninst-1].x64.set_flags) - || ((ninst>1) && dyn->insts[ninst-2].x64.set_flags)), 1) - { - READFLAGS(X_PEND); // that's suspicious - } else { - SETFLAGS(X_ALL, SF_SET_NODF); //Hack to put flag in "don't care" state - } - GETEDOz(x6, 0); - if(box64_dynarec_callret && box64_dynarec_bigblock>1) { - BARRIER(BARRIER_FULL); - BARRIER_NEXT(BARRIER_FULL); - } else { - BARRIER(BARRIER_FLOAT); - *need_epilog = 0; - *ok = 0; - } - GETIP_(addr); - if(box64_dynarec_callret) { - SET_HASCALLRET(); - // Push actual return address - if(addr < (dyn->start+dyn->isize)) { - // there is a next... - j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; - ADR_S20(x4, j64); - MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64>>2); - } else { - MESSAGE(LOG_NONE, "\tCALLRET set return to Jmptable(%p)\n", (void*)addr); - j64 = getJumpTableAddress64(addr); - TABLE64(x4, j64); - LDRx_U12(x4, x4, 0); - } - STPx_S7_preindex(x4, xRIP, xSP, -16); - } - PUSH1z(xRIP); - jump_to_next(dyn, 0, ed, ninst, rex.is32bits); - break; - case 4: // JMP Ed - INST_NAME("JMP Ed"); - READFLAGS(X_PEND); - BARRIER(BARRIER_FLOAT); - GETEDOz(x6, 0); - jump_to_next(dyn, 0, ed, ninst, rex.is32bits); - *need_epilog = 0; - *ok = 0; - break; - case 6: // Push Ed - INST_NAME("PUSH Ed"); - GETEDOz(x6, 0); - PUSH1z(ed); - break; - - default: - DEFAULT; - } - break; - - default: - DEFAULT; - } - return addr; -} diff --git a/src/dynarec/arm64/dynarec_arm64_66.c b/src/dynarec/arm64/dynarec_arm64_66.c index 12efb37..8d14958 100644 --- a/src/dynarec/arm64/dynarec_arm64_66.c +++ b/src/dynarec/arm64/dynarec_arm64_66.c @@ -5,14 +5,12 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" #include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" -#include "emu/x64run_private.h" #include "emu/x87emu_private.h" #include "x64trace.h" #include "dynarec_native.h" @@ -20,11 +18,11 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_arm64_functions.h" -uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { uint8_t opcode = F8; uint8_t nextop, u8; @@ -44,17 +42,8 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin MAYUSE(j64); MAYUSE(lock); - while((opcode==0x2E) || (opcode==0x36) || (opcode==0x26) || (opcode==0x66)) // ignoring CS:, SS:, ES: or multiple 0x66 - opcode = F8; - - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - GETREX(); - - if(rex.w && !(opcode==0x0f || opcode==0xf0 || opcode==0x64 || opcode==0x65)) // rex.w cancels "66", but not for 66 0f type of prefix - return dynarec64_00(dyn, addr-1, ip, ninst, rex, rep, ok, need_epilog); // addr-1, to "put back" opcode + if(rex.w && !(opcode==0x0f)) // rex.w cancels "66", but not for 66 0f type of prefix + return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); // addr-1, to "put back" opcode switch(opcode) { case 0x01: @@ -78,9 +67,9 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x05: INST_NAME("ADD AX, Iw"); SETFLAGS(X_ALL, SF_SET_PENDING); - i32 = F16; + i16 = F16; UXTHw(x1, xRAX); - MOV32w(x2, i32); + MOV32w(x2, i16); emit_add16(dyn, ninst, x1, x2, x3, x4); BFIz(xRAX, x1, 0, 16); break; @@ -93,7 +82,6 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("POP ES"); POP1_16(x1); STRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_ES])); - STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_ES])); break; case 0x09: @@ -102,7 +90,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop = F8; GETGW(x2); GETEW(x1, 0); - emit_or16(dyn, ninst, x1, x2, x4, x2); + emit_or16(dyn, ninst, x1, x2, x4, x5); EWBACK; break; case 0x0B: @@ -117,20 +105,25 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x0D: INST_NAME("OR AX, Iw"); SETFLAGS(X_ALL, SF_SET_PENDING); - i32 = F16; + i16 = F16; UXTHw(x1, xRAX); - MOV32w(x2, i32); - emit_or16(dyn, ninst, x1, x2, x3, x4); + emit_or16c(dyn, ninst, x1, i16, x3, x4); BFIz(xRAX, x1, 0, 16); break; case 0x0F: - switch(rep) { - case 0: addr = dynarec64_660F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; - case 1: addr = dynarec64_66F20F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; - case 2: addr = dynarec64_66F30F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; + switch(rex.rep) { + case 1: + addr = dynarec64_66F20F(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + case 2: + addr = dynarec64_66F30F(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + default: + addr = dynarec64_660F(dyn, addr, ip, ninst, rex, ok, need_epilog); } break; + case 0x11: INST_NAME("ADC Ew, Gw"); READFLAGS(X_CF); @@ -151,13 +144,15 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin emit_adc16(dyn, ninst, x1, x2, x4, x3); GWBACK; break; + case 0x14: + return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); case 0x15: INST_NAME("ADC AX, Iw"); READFLAGS(X_CF); SETFLAGS(X_ALL, SF_SET_PENDING); - i32 = F16; + u16 = F16; UXTHw(x1, xRAX); - MOV32w(x2, i32); + MOV32w(x2, u16); emit_adc16(dyn, ninst, x1, x2, x3, x4); BFIz(xRAX, x1, 0, 16); break; @@ -201,7 +196,6 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("POP DS"); POP1_16(x1); STRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_DS])); - STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_DS])); break; case 0x21: @@ -225,10 +219,9 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x25: INST_NAME("AND AX, Iw"); SETFLAGS(X_ALL, SF_SET_PENDING); - i32 = F16; + i16 = F16; UXTHw(x1, xRAX); - MOV32w(x2, i32); - emit_and16(dyn, ninst, x1, x2, x3, x4); + emit_and16c(dyn, ninst, x1, i16, x3, x4); BFIz(xRAX, x1, 0, 16); break; @@ -253,9 +246,9 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x2D: INST_NAME("SUB AX, Iw"); SETFLAGS(X_ALL, SF_SET_PENDING); - i32 = F16; + i16 = F16; UXTHw(x1, xRAX); - MOV32w(x2, i32); + MOV32w(x2, i16); emit_sub16(dyn, ninst, x1, x2, x3, x4); BFIz(xRAX, x1, 0, 16); break; @@ -281,10 +274,9 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x35: INST_NAME("XOR AX, Iw"); SETFLAGS(X_ALL, SF_SET_PENDING); - i32 = F16; + i16 = F16; UXTHw(x1, xRAX); - MOV32w(x2, i32); - emit_xor16(dyn, ninst, x1, x2, x3, x4); + emit_xor16c(dyn, ninst, x1, i16, x3, x4); BFIz(xRAX, x1, 0, 16); break; @@ -307,10 +299,10 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x3D: INST_NAME("CMP AX, Iw"); SETFLAGS(X_ALL, SF_SET_PENDING); - i32 = F16; + u16 = F16; UXTHw(x1, xRAX); - if(i32) { - MOV32w(x2, i32); + if(u16) { + MOV32w(x2, u16); emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5); } else { emit_cmp16_0(dyn, ninst, x1, x3, x4); @@ -326,11 +318,11 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x46: case 0x47: INST_NAME("INC Reg16 (32bits)"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - gd = xRAX + (opcode&7); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); + gd = TO_NAT (opcode&7); UXTHw(x1, gd); emit_inc16(dyn, ninst, x1, x2, x3); - BFIw(gd, x1, 0, 16); + BFIz(gd, x1, 0, 16); break; case 0x48: case 0x49: @@ -341,11 +333,11 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x4E: case 0x4F: INST_NAME("DEC Reg16 (32bits)"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - gd = xRAX + (opcode&7); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); + gd = TO_NAT (opcode&7); UXTHw(x1, gd); emit_dec16(dyn, ninst, x1, x2, x3); - BFIw(gd, x1, 0, 16); + BFIz(gd, x1, 0, 16); break; case 0x50: case 0x51: @@ -356,7 +348,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x56: case 0x57: INST_NAME("PUSH reg"); - gd = xRAX+(opcode&0x07)+(rex.b<<3); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); if (gd==xRSP) { MOVw_REG(x1, xRSP); PUSH1_16(x1); @@ -373,9 +365,9 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x5E: case 0x5F: INST_NAME("POP reg"); - gd = xRAX+(opcode&0x07)+(rex.b<<3); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); POP1_16(x1); - BFIw(gd, x1, 0, 16); + BFIz(gd, x1, 0, 16); break; case 0x60: if(rex.is32bits) { @@ -389,48 +381,40 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin PUSH1_16(xRBP); PUSH1_16(xRSI); PUSH1_16(xRDI); - } else { - DEFAULT; - } + } else + return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); break; case 0x61: if(rex.is32bits) { INST_NAME("POPA 16bits (32bits)"); POP1_16(x1); - BFIw(xRDI, x1, 0, 16); + BFIz(xRDI, x1, 0, 16); POP1_16(x1); - BFIw(xRSI, x1, 0, 16); + BFIz(xRSI, x1, 0, 16); POP1_16(x1); - BFIw(xRBP, x1, 0, 16); + BFIz(xRBP, x1, 0, 16); POP1_16(x1); // RSP ignored POP1_16(x1); - BFIw(xRBX, x1, 0, 16); + BFIz(xRBX, x1, 0, 16); POP1_16(x1); - BFIw(xRDX, x1, 0, 16); + BFIz(xRDX, x1, 0, 16); POP1_16(x1); - BFIw(xRCX, x1, 0, 16); + BFIz(xRCX, x1, 0, 16); POP1_16(x1); - BFIw(xRAX, x1, 0, 16); - } else { - DEFAULT; - } - break; - - case 0x64: - addr = dynarec64_6664(dyn, addr, ip, ninst, rex, _FS, ok, need_epilog); - break; - case 0x65: - addr = dynarec64_6664(dyn, addr, ip, ninst, rex, _GS, ok, need_epilog); - break; - case 0x66: - addr = dynarec64_66(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + BFIz(xRAX, x1, 0, 16); + } else + return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); break; case 0x68: INST_NAME("PUSH Iw"); u16 = F16; - MOV32w(x2, u16); - PUSH1_16(x2); + if (!u16) { + PUSH1_16(xZR); + } else { + MOV32w(x2, u16); + PUSH1_16(x2); + } break; case 0x69: case 0x6B: @@ -439,16 +423,80 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } else { INST_NAME("IMUL Gw,Ew,Ib"); } - SETFLAGS(X_ALL, SF_PENDING); + if (BOX64DRENV(dynarec_safeflags) > 1 && BOX64ENV(cputype)) { + SETFLAGS(X_OF|X_CF, SF_SET); + } else { + SETFLAGS(X_ALL, SF_SET); + } nextop = F8; GETSEW(x1, (opcode==0x69)?2:1); if(opcode==0x69) i32 = F16S; else i32 = F8S; MOV32w(x2, i32); MULw(x2, x2, x1); - UFLAG_RES(x2); gd=x2; GWBACK; - UFLAG_DF(x1, d_imul16); + SET_DFNONE(); + IFX(X_CF|X_OF) { + ASRw(x1, x2, 15); + CMPSw_REG_ASR(x1, x2, 31); + CSETw(x3, cNE); + IFX(X_CF) { + BFIw(xFlags, x3, F_CF, 1); + } + IFX(X_OF) { + BFIw(xFlags, x3, F_OF, 1); + } + } + IFX2(X_AF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_AF, 1);} + IFX2(X_ZF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX2(X_SF, && !BOX64ENV(cputype)) { + LSRw(x3, x2, 15); + BFIw(xFlags, x3, F_SF, 1); + } + IFX2(X_PF, && !BOX64ENV(cputype)) emit_pf(dyn, ninst, x2, x3); + break; + case 0x6A: + INST_NAME("PUSH Ib"); + i16 = F8S; + if (!i16) { + PUSH1_16(xZR); + } else { + MOV32w(x2, (uint16_t)i16); + PUSH1_16(x2); + } + break; + case 0x6C: + case 0x6E: + return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); + case 0x6D: + INST_NAME("INSW"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + STORE_XEMU_CALL(xRIP); + CALL_S(const_native_priv, -1); + LOAD_XEMU_CALL(xRIP); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + break; + case 0x6F: + INST_NAME("OUTSW"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state + } + GETIP(ip); + STORE_XEMU_CALL(xRIP); + CALL_S(const_native_priv, -1); + LOAD_XEMU_CALL(xRIP); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; break; case 0x70: @@ -468,7 +516,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x7e: case 0x7f: // just use regular conditional jump - return dynarec64_00(dyn, addr-1, ip, ninst, rex, rep, ok, need_epilog); + return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); case 0x81: case 0x83: @@ -488,8 +536,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SETFLAGS(X_ALL, SF_SET_PENDING); GETEW(x1, (opcode==0x81)?2:1); if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_or16(dyn, ninst, x1, x5, x2, x4); + emit_or16c(dyn, ninst, x1, i16, x2, x4); EWBACK; break; case 2: //ADC @@ -498,7 +545,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SETFLAGS(X_ALL, SF_SET_PENDING); GETEW(x1, (opcode==0x81)?2:1); if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); + MOVZw(x5, (uint16_t)i16); emit_adc16(dyn, ninst, x1, x5, x2, x4); EWBACK; break; @@ -508,7 +555,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SETFLAGS(X_ALL, SF_SET_PENDING); GETEW(x1, (opcode==0x81)?2:1); if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); + MOVZw(x5, (uint16_t)i16); emit_sbb16(dyn, ninst, x1, x5, x2, x4); EWBACK; break; @@ -517,8 +564,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SETFLAGS(X_ALL, SF_SET_PENDING); GETEW(x1, (opcode==0x81)?2:1); if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_and16(dyn, ninst, x1, x5, x2, x4); + emit_and16c(dyn, ninst, x1, i16, x2, x4); EWBACK; break; case 5: //SUB @@ -535,8 +581,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SETFLAGS(X_ALL, SF_SET_PENDING); GETEW(x1, (opcode==0x81)?2:1); if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_xor16(dyn, ninst, x1, x5, x2, x4); + emit_xor16c(dyn, ninst, x1, i16, x2, x4); EWBACK; break; case 7: //CMP @@ -575,12 +620,10 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETGD; addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); if(!ALIGNED_ATOMICH) { - TSTx_mask(ed, 1, 0, 0); // mask=1 - B_MARK(cNE); + TBNZ_MARK(ed, 0); } - if(arm64_atomics) { + if(cpuext.atomics) { SWPALH(gd, x1, ed); - SMDMB(); if(!ALIGNED_ATOMICH) { B_MARK2_nocond; } @@ -589,7 +632,6 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDAXRH(x1, ed); STLXRH(x3, gd, ed); CBNZx_MARKLOCK(x3); - SMDMB(); if(!ALIGNED_ATOMICH) { B_MARK2_nocond; } @@ -601,7 +643,6 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRB(x3, gd, ed); CBNZx_MARK(x3); STRH_U12(gd, ed, 0); - SMDMB(); MARK2; } BFIz(gd, x1, 0, 16); @@ -613,7 +654,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop = F8; GETGD; // don't need GETGW here if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); if(ed!=gd) { BFIz(ed, gd, 0, 16); } @@ -628,7 +669,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop = F8; GETGD; // don't need GETGW neither if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); if(ed!=gd) { BFIz(gd, ed, 0, 16); } @@ -644,41 +685,70 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop=F8; u8 = (nextop&0x38)>>3; LDRH_U12(x3, xEmu, offsetof(x64emu_t, segs[u8])); - if((nextop&0xC0)==0xC0) { // reg <= seg - BFIz(xRAX+(nextop&7)+(rex.b<<3), x3, 0, 16); - } else { // mem <= seg + if (MODREG) { + BFIz(TO_NAT((nextop & 7) + (rex.b << 3)), x3, 0, 16); + } else { addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); STH(x3, wback, fixedaddress); SMWRITE2(); } break; - + case 0x8D: + INST_NAME("LEA Gd, Ed"); + nextop=F8; + GETGD; + if(MODREG) { // reg <= reg? that's an invalid operation + DEFAULT; + } else { // mem <= reg + rex.seg = 0; + addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + BFIx(gd, ed, 0, 16); + } + break; case 0x8E: INST_NAME("MOV Seg,Ew"); nextop = F8; u8 = (nextop&0x38)>>3; - if((nextop&0xC0)==0xC0) { - ed = xRAX+(nextop&7)+(rex.b<<3); + if((u8>5) || (u8==1)) { + INST_NAME("Invalid MOV Seg,Ew"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); - LDH(x1, wback, fixedaddress); - ed = x1; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); + LDH(x1, wback, fixedaddress); + ed = x1; + } + STRH_U12(ed, xEmu, offsetof(x64emu_t, segs[u8])); + if((u8==_FS) || (u8==_GS)) { + // refresh offset if needed + CBZw_NEXT(ed); + MOV32w(x1, u8); + CALL(const_getsegmentbase, -1); + } } - STRH_U12(ed, xEmu, offsetof(x64emu_t, segs[u8])); - STRw_U12(wZR, xEmu, offsetof(x64emu_t, segs_serial[u8])); break; case 0x8F: - INST_NAME("POP Ew"); nextop = F8; - POP1_16(x1); - if((nextop&0xC0)==0xC0) { - wback = xRAX+(nextop&7)+(rex.b<<3); - BFIz(wback, x1, 0, 16); - } else { - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); - STH(x1, wback, fixedaddress); + switch((nextop>>3)&7) { + case 0: + INST_NAME("POP Ew"); + POP1_16(x1); + if (MODREG) { + wback = TO_NAT((nextop & 7) + (rex.b << 3)); + BFIz(wback, x1, 0, 16); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); + STH(x1, wback, fixedaddress); + } + break; + default: + DEFAULT; } break; case 0x90: @@ -689,7 +759,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0x95: case 0x96: case 0x97: - gd = xRAX+(opcode&0x07)+(rex.b<<3); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); if(gd==xRAX) { INST_NAME("NOP"); } else { @@ -706,13 +776,12 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0x99: INST_NAME("CWD"); - SXTHw(x1, xRAX); - BFXILx(xRDX, x1, 16, 16); + SXTHw(x1, xRAX); // sign extend ax to x1 + BFXILx(xRDX, x1, 16, 16); // insert high 16bits of x1 as low DX break; case 0x9C: INST_NAME("PUSHF"); READFLAGS(X_ALL); - WILLWRITE(); PUSH1_16(xFlags); SMWRITE(); break; @@ -720,75 +789,98 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("POPF"); SETFLAGS(X_ALL, SF_SET); SMREAD(); - POP1_16(x1); // probably not usefull... + POP1_16(x1); + MOV32w(x2, 0x7FD7); + ANDw_REG(x1, x1, x2); + ORRw_mask(x1, x1, 0b011111, 0); //mask=0x00000002 BFIw(xFlags, x1, 0, 16); - MOV32w(x1, 0x3F7FD7); - ANDw_REG(xFlags, xFlags, x1); - ORRw_mask(xFlags, xFlags, 0b011111, 0); //mask=0x00000002 - SET_DFNONE(x1); + SET_DFNONE(); if(box64_wine) { // should this be done all the time? TBZ_NEXT(xFlags, F_TF); - // go to epilog, TF should trigger at end of next opcode, so using Interpretor only + // go to epilog, TF should trigger at end of next opcode, so using Interpreter only + LDRw_U12(x4, xEmu, offsetof(x64emu_t, flags)); + ORRw_mask(x4, x4, 32-FLAGS_NO_TF, 0); //mask=1<-0x1000 || (u64<(0x1000<<1) && !(u64&1)))) { + grab_segdata(dyn, addr, ninst, x1, rex.seg); + if(u64) { + if(u64<0x100) + {fixedaddress = u64; unscaled = 1;} + else if(u64<(0x1000<<1) && !(u64&1)) + fixedaddress = u64; + else if(u64<0x1000) + ADDx_U12(x1, x1, u64); + else if((int64_t)u64 > -0x100) + {fixedaddress = (int64_t)u64; unscaled = 1;} + else + SUBx_U12(x1, x1, -(int64_t)u64); + } + } else { + MOV64y(x1, u64); + if(rex.seg) { + grab_segdata(dyn, addr, ninst, x3, rex.seg); + ADDx_REGy(x1, x3, x1); + } + } + lock=(rex.seg)?0:isLockAddress(u64); SMREADLOCK(lock); - LDRH_U12(x2, x1, 0); + LDH(x2, x1, fixedaddress); BFIz(xRAX, x2, 0, 16); break; case 0xA3: - INST_NAME("MOV Od,EAX"); - if(rex.is32bits) - u64 = F32; + INST_NAME("MOV Od,AX"); + if(rex.is32bits && rex.is67) + u64 = F16S; + else if(rex.is32bits || rex.is67) + u64 = F32S; else u64 = F64; - MOV64z(x1, u64); - if(isLockAddress(u64)) lock=1; else lock = 0; - WILLWRITELOCK(lock); - STRH_U12(xRAX, x1, 0); - SMWRITELOCK(lock); - break; - case 0xA4: - SMREAD(); - if(rep) { - INST_NAME("REP MOVSB"); - CBZx_NEXT(xRCX); - TBNZ_MARK2(xFlags, F_DF); - MARK; // Part with DF==0 - LDRB_S9_postindex(x1, xRSI, 1); - STRB_S9_postindex(x1, xRDI, 1); - SUBx_U12(xRCX, xRCX, 1); - CBNZx_MARK(xRCX); - B_NEXT_nocond; - MARK2; // Part with DF==1 - LDRB_S9_postindex(x1, xRSI, -1); - STRB_S9_postindex(x1, xRDI, -1); - SUBx_U12(xRCX, xRCX, 1); - CBNZx_MARK2(xRCX); - // done + unscaled = 0; fixedaddress = 0; + if(rex.seg && (u64<0x1000 || (int64_t)u64>-0x1000 || (u64<(0x1000<<1) && !(u64&1)))) { + grab_segdata(dyn, addr, ninst, x1, rex.seg); + if(u64) { + if(u64<0x100) + {fixedaddress = u64; unscaled = 1;} + else if(u64<(0x1000<<1) && !(u64&1)) + fixedaddress = u64; + else if(u64<0x1000) + ADDx_U12(x1, x1, u64); + else if((int64_t)u64 > -0x100) + {fixedaddress = (int64_t)u64; unscaled = 1;} + else + SUBx_U12(x1, x1, -(int64_t)u64); + } } else { - INST_NAME("MOVSB"); - GETDIR(x3, 1); - LDRB_U12(x1, xRSI, 0); - STRB_U12(x1, xRDI, 0); - ADDx_REG(xRSI, xRSI, x3); - ADDx_REG(xRDI, xRDI, x3); + MOV64y(x1, u64); + if(rex.seg) { + grab_segdata(dyn, addr, ninst, x3, rex.seg); + ADDx_REGy(x1, x3, x1); + } } - SMWRITE(); + lock=(rex.seg)?0:isLockAddress(u64); + SMREADLOCK(lock); + STH(xRAX, x1, fixedaddress); + SMWRITELOCK(lock); break; + case 0xA4: + return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); case 0xA5: SMREAD(); - if(rep) { + if(rex.rep) { INST_NAME("REP MOVSW"); CBZx_NEXT(xRCX); TBNZ_MARK2(xFlags, F_DF); @@ -817,12 +909,15 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0xA7: SMREAD(); - switch(rep) { + switch(rex.rep) { case 1: case 2: - if(rep==1) {INST_NAME("REPNZ CMPSW");} else {INST_NAME("REPZ CMPSW");} - MAYSETFLAGS(); - SETFLAGS(X_ALL, SF_SET_PENDING); + if(rex.rep==1) {INST_NAME("REPNZ CMPSW");} else {INST_NAME("REPZ CMPSW");} + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); CBZx_NEXT(xRCX); TBNZ_MARK2(xFlags, F_DF); MARK; // Part with DF==0 @@ -830,7 +925,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDRH_S9_postindex(x2, xRDI, 2); SUBx_U12(xRCX, xRCX, 1); CMPSw_REG(x1, x2); - B_MARK3((rep==1)?cEQ:cNE); + B_MARK3((rex.rep==1)?cEQ:cNE); CBNZx_MARK(xRCX); B_MARK3_nocond; MARK2; // Part with DF==1 @@ -838,7 +933,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDRH_S9_postindex(x2, xRDI, -2); SUBx_U12(xRCX, xRCX, 1); CMPSw_REG(x1, x2); - B_MARK3((rep==1)?cEQ:cNE); + B_MARK3((rex.rep==1)?cEQ:cNE); CBNZx_MARK2(xRCX); MARK3; // end emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5); @@ -860,14 +955,12 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("TEST AX,Iw"); SETFLAGS(X_ALL, SF_SET_PENDING); u16 = F16; - MOV32w(x2, u16); UBFXx(x1, xRAX, 0, 16); - emit_test16(dyn, ninst, x1, x2, x3, x4, x5); + emit_test16c(dyn, ninst, x1, u16, x3, x4, x5); break; case 0xAB: - WILLWRITE(); - if(rep) { + if(rex.rep) { INST_NAME("REP STOSW"); CBZx_NEXT(xRCX); TBNZ_MARK2(xFlags, F_DF); @@ -892,7 +985,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0xAD: - if(rep) { + if(rex.rep) { INST_NAME("REP LODSW"); CBZx_NEXT(xRCX); TBNZ_MARK2(xFlags, F_DF); @@ -918,12 +1011,15 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0xAF: - switch(rep) { + switch(rex.rep) { case 1: case 2: - if(rep==1) {INST_NAME("REPNZ SCASW");} else {INST_NAME("REPZ SCASW");} - MAYSETFLAGS(); - SETFLAGS(X_ALL, SF_SET_PENDING); + if(rex.rep==1) {INST_NAME("REPNZ SCASW");} else {INST_NAME("REPZ SCASW");} + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); CBZx_NEXT(xRCX); UXTHw(x1, xRAX); TBNZ_MARK2(xFlags, F_DF); @@ -931,14 +1027,14 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LDRH_S9_postindex(x2, xRDI, 2); SUBx_U12(xRCX, xRCX, 1); CMPSw_REG(x1, x2); - B_MARK3((rep==1)?cEQ:cNE); + B_MARK3((rex.rep==1)?cEQ:cNE); CBNZx_MARK(xRCX); B_MARK3_nocond; MARK2; // Part with DF==1 LDRH_S9_postindex(x2, xRDI, -2); SUBx_U12(xRCX, xRCX, 1); CMPSw_REG(x1, x2); - B_MARK3((rep==1)?cEQ:cNE); + B_MARK3((rex.rep==1)?cEQ:cNE); CBNZx_MARK2(xRCX); MARK3; // end emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5); @@ -965,9 +1061,12 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0xBF: INST_NAME("MOV Reg16, Iw"); u16 = F16; - MOV32w(x1, u16); - gd = xRAX+(opcode&7)+(rex.b<<3); - BFIz(gd, x1, 0, 16); + gd = TO_NAT((opcode & 7) + (rex.b << 3)); + if(u16) { + MOV32w(x1, u16); + BFIz(gd, x1, 0, 16); + } else + BFCz(gd, 0, 16); break; case 0xC1: @@ -975,9 +1074,9 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: INST_NAME("ROL Ew, Ib"); - u8 = geted_ib(dyn, addr, ninst, nextop) & 15; + u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; if (u8) { - SETFLAGS(X_CF | X_OF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETEW(x1, 1); u8 = (F8)&0x1f; emit_rol16c(dyn, ninst, x1, u8, x4, x5); @@ -989,8 +1088,8 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 1: INST_NAME("ROR Ew, Ib"); - if (geted_ib(dyn, addr, ninst, nextop) & 15) { - SETFLAGS(X_CF | X_OF, SF_SUBSET_PENDING); + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETEW(x1, 1); u8 = (F8)&0x1f; emit_ror16c(dyn, ninst, x1, u8, x4, x5); @@ -1002,11 +1101,11 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 2: INST_NAME("RCL Ew, Ib"); - if (geted_ib(dyn, addr, ninst, nextop) & 31) { + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { READFLAGS(X_CF); SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETEW(x1, 1); - u8 = F8; + u8 = (F8)&0x1f; emit_rcl16c(dyn, ninst, ed, u8, x4, x5); EWBACK; } else { @@ -1016,11 +1115,11 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 3: INST_NAME("RCR Ew, Ib"); - if (geted_ib(dyn, addr, ninst, nextop) & 31) { + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { READFLAGS(X_CF); SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETEW(x1, 1); - u8 = F8; + u8 = (F8)&0x1f; emit_rcr16c(dyn, ninst, ed, u8, x4, x5); EWBACK; } else { @@ -1072,19 +1171,32 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0xC7: - INST_NAME("MOV Ew, Iw"); nextop = F8; - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - u16 = F16; - MOV32w(x1, u16); - BFIz(ed, x1, 0, 16); - } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, &lock, 0, 2); - u16 = F16; - MOV32w(x1, u16); - STH(x1, ed, fixedaddress); - SMWRITELOCK(lock); + switch((nextop>>3)&7) { + case 0: + INST_NAME("MOV Ew, Iw"); + if(MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + u16 = F16; + if(u16) { + MOV32w(x1, u16); + BFIz(ed, x1, 0, 16); + } else + BFCz(ed, 0, 16); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, &lock, 0, 2); + u16 = F16; + if(u16) { + MOV32w(x1, u16); + STH(x1, ed, fixedaddress); + } else { + STH(xZR, ed, fixedaddress); + } + SMWRITELOCK(lock); + } + break; + default: + DEFAULT; } break; @@ -1093,14 +1205,14 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: INST_NAME("ROL Ew, 1"); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETEW(x1, 0); emit_rol16c(dyn, ninst, x1, 1, x5, x4); EWBACK; break; case 1: INST_NAME("ROR Ew, 1"); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose GETEW(x1, 0); emit_ror16c(dyn, ninst, x1, 1, x5, x4); EWBACK; @@ -1151,90 +1263,154 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: INST_NAME("ROL Ew, CL"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_OF|X_CF); + } SETFLAGS(X_OF|X_CF, SF_SUBSET); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); UFLAG_IF { - TSTw_mask(xRCX, 0, 0b00100); //mask=0x00000001f - B_NEXT(cEQ); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); } ANDw_mask(x2, xRCX, 0, 0b00011); //mask=0x00000000f MOV32w(x4, 16); SUBx_REG(x2, x4, x2); GETEW(x1, 0); + IFX2(X_OF, && !BOX64ENV(cputype)) { + LSRw(x4, ed, 14); + EORw_REG_LSR(x4, x4, x4, 1); + BFIw(xFlags, x4, F_OF, 1); + } ORRw_REG_LSL(ed, ed, ed, 16); LSRw_REG(ed, ed, x2); EWBACK; - UFLAG_IF { // calculate flags directly - CMPSw_U12(x2, 15); - B_MARK(cNE); - ADDxw_REG_LSR(x3, ed, ed, 15); - BFIw(xFlags, x3, F_OF, 1); - MARK; + IFX2(X_OF, && BOX64ENV(cputype)) { + EORxw_REG_LSR(x3, ed, ed, 15); + BFIw(xFlags, x3, F_OF, 1); + } + IFX(X_CF) { BFIw(xFlags, ed, F_CF, 1); - UFLAG_DF(x2, d_none); } break; case 1: INST_NAME("ROR Ew, CL"); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_OF|X_CF); + } SETFLAGS(X_OF|X_CF, SF_SUBSET); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); UFLAG_IF { - TSTw_mask(xRCX, 0, 0b00100); //mask=0x00000001f - B_NEXT(cEQ); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); } ANDw_mask(x2, xRCX, 0, 0b00011); //mask=0x00000000f GETEW(x1, 0); + IFX2(X_OF, && !BOX64ENV(cputype)) { + EORw_REG_LSR(x4, ed, ed, 15); + BFIw(xFlags, x4, F_OF, 1); + } ORRw_REG_LSL(ed, ed, ed, 16); LSRw_REG(ed, ed, x2); EWBACK; - UFLAG_IF { // calculate flags directly - CMPSw_U12(x2, 1); - B_MARK(cNE); - LSRxw(x2, ed, 14); // x2 = d>>14 - EORw_REG_LSR(x2, x2, x2, 1); // x2 = ((d>>14) ^ ((d>>14)>>1)) - BFIw(xFlags, x2, F_OF, 1); - MARK; + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRxw(x2, ed, 14); // x2 = d>>6 + EORw_REG_LSR(x2, x2, x2, 1); // x2 = ((d>>14) ^ ((d>>14)>>1)) + BFIw(xFlags, x2, F_OF, 1); + } + IFX(X_CF) { BFXILw(xFlags, ed, 15, 1); - UFLAG_DF(x2, d_none); } break; case 2: INST_NAME("RCL Ew, CL"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - READFLAGS(X_CF); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - ANDw_mask(x2, xRCX, 0, 0b00100); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_OF|X_CF); + } else { + READFLAGS(X_CF); + } + SETFLAGS(X_OF|X_CF, SF_SUBSET); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); + // get CL % 17 + MOV32w(x3, 0xf10); // 0x10000 / 17 + 1 (this is precise enough in the 0..31 range) + MULw(x3, x3, x2); + LSRw(x3, x3, 16); // x3 = CL / 17 + MOV32w(x4, 17); + MSUBw(x2, x3, x4, x2); // CL mod 17 GETEW(x1, 0); - CALL_(rcl16, x1, x3); + CBZw_MARK(x2); + IFX2(X_OF, && !BOX64ENV(cputype)) { + LSRw(x5, ed, 14); + EORw_REG_LSR(x5, x5, x5, 1); + BFIw(xFlags, x5, F_OF, 1); + } + BFIw(ed, xFlags, 16, 1); // insert CF + ORRx_REG_LSL(ed, ed, ed, 17); // insert rest of ed + SUBw_REG(x2, x4, x2); + IFX(X_OF|X_CF) { + SUBw_U12(x5, x2, 1); + LSRx_REG(x5, ed, x5); // keep the new CF in x5 + } + LSRx_REG(ed, ed, x2); EWBACK; + u8 = X_CF; + if(BOX64ENV(cputype)) u8 |= X_OF; + IFX(u8) { + BFXILw(xFlags, x5, 0, 1); + } + MARK; + IFX2(X_OF, && BOX64ENV(cputype)) { + EORw_REG_LSR(x2, xFlags, ed, 15); + BFIw(xFlags, x2, F_OF, 1); + } break; case 3: INST_NAME("RCR Ew, CL"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - READFLAGS(X_CF); - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - ANDw_mask(x2, xRCX, 0, 0b00100); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_OF|X_CF); + } else { + READFLAGS(X_CF); + } + SETFLAGS(X_OF|X_CF, SF_SUBSET); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); + // get CL % 17 + MOV32w(x3, 0xf10); // 0x10000 / 17 + 1 + MULw(x3, x3, x2); + LSRw(x3, x3, 16); // x3 = CL / 17 + MOV32w(x4, 17); + MSUBw(x2, x3, x4, x2); // CL mod 17 GETEW(x1, 0); - CALL_(rcr16, x1, x3); + CBZw_MARK(x2); + BFIw(ed, xFlags, 16, 1); // insert CF + ORRx_REG_LSL(ed, ed, ed, 17); // insert rest of ed + IFX2(X_OF, && !BOX64ENV(cputype)) { + EORw_REG_LSR(x5, xFlags, ed, 15); + BFIw(xFlags, x5, F_OF, 1); + } + IFX(X_CF) { + SUBw_U12(x4, x2, 1); + LSRw_REG(x5, ed, x4); + BFIw(xFlags, x5, F_CF, 1); + } + LSRx_REG(ed, ed, x2); EWBACK; + MARK; + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRw(x4, ed, 14); + EORw_REG_LSR(x4, x4, x4, 1); + BFIw(xFlags, x4, F_OF, 1); + } break; case 4: case 6: INST_NAME("SHL Ew, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f UFLAG_IF { - ANDSw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f - B_NEXT(cEQ); - } else { - ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); } GETEW(x1, 0); emit_shl16(dyn, ninst, x1, x2, x5, x4); @@ -1242,14 +1418,14 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 5: INST_NAME("SHR Ew, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f UFLAG_IF { - ANDSw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f - B_NEXT(cEQ); - } else { - ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x2); } GETEW(x1, 0); emit_shr16(dyn, ninst, x1, x2, x5, x4); @@ -1257,14 +1433,15 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 7: INST_NAME("SAR Ew, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); + ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f UFLAG_IF { - ANDSw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f - B_NEXT(cEQ); + CBZw_NEXT(x2); } else { - ANDw_mask(x2, xRCX, 0, 0b00100); //mask=0x00000001f } GETSEW(x1, 0); emit_sar16(dyn, ninst, x1, x2, x5, x4); @@ -1272,7 +1449,7 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; } break; - + case 0xD9: nextop = F8; if(MODREG) { @@ -1281,12 +1458,12 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 6: INST_NAME("FNSTENV Ed"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); // maybe only x87, not SSE? + MESSAGE(LOG_DUMP, "Need Optimization (FNSTENV16)\n"); + BARRIER(BARRIER_FLOAT); // maybe only x87, not SSE? addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) {MOVx_REG(x1, ed);} MOV32w(x2, 1); - CALL(fpu_savenv, -1); + CALL(const_fpu_savenv, -1); break; default: DEFAULT; @@ -1301,28 +1478,39 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 4: INST_NAME("FRSTOR Ed"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + MESSAGE(LOG_DUMP, "Need Optimization (FRSTOR16)\n"); + BARRIER(BARRIER_FLOAT); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) {MOVx_REG(x1, ed);} - CALL(native_frstor16, -1); + CALL(const_native_frstor16, -1); break; case 6: INST_NAME("FNSAVE Ed"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + MESSAGE(LOG_DUMP, "Need Optimization (FNSAVE16)\n"); + BARRIER(BARRIER_FLOAT); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) {MOVx_REG(x1, ed);} - CALL(native_fsave16, -1); - CALL(reset_fpu, -1); + CALL(const_native_fsave16, -1); break; default: DEFAULT; } break; - case 0xF0: - return dynarec64_66F0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + case 0xE4: /* IN AL, Ib */ + case 0xE5: /* IN AX, Ib */ + case 0xE6: /* OUT Ib, AL */ + case 0xE7: /* OUT Ib, AX */ + return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); + case 0xE8: /* CALL Imm */ + case 0xE9: /* Jmp Imm */ + case 0xEB: /* Jmp Imm8 */ + return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); + case 0xEC: /* IN AL, DX */ + case 0xED: /* IN AX, DX */ + case 0xEE: /* OUT DX, AL */ + case 0xEF: /* OUT DX, AX */ + return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); case 0xF7: nextop = F8; @@ -1333,14 +1521,19 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SETFLAGS(X_ALL, SF_SET_PENDING); GETEW(x1, 2); u16 = F16; - MOV32w(x2, u16); - emit_test16(dyn, ninst, x1, x2, x3, x4, x5); + emit_test16c(dyn, ninst, x1, u16, x3, x4, x5); break; case 2: INST_NAME("NOT Ew"); - GETEW(x1, 0); - MVNw_REG(ed, ed); - EWBACK; + if(MODREG) { + CALCEW(); + int mask = convert_bitmask_x(0xffff); + EORx_mask(wback, wback, (mask>>12)&1, mask&0x3F, (mask>>6)&0x3F); + } else { + GETEW(x1, 0); + MVNw_REG(ed, ed); + EWBACK; + } break; case 3: INST_NAME("NEG Ew"); @@ -1351,59 +1544,118 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 4: INST_NAME("MUL AX, Ew"); - SETFLAGS(X_ALL, SF_PENDING); + if (BOX64DRENV(dynarec_safeflags) && BOX64ENV(cputype)) { + SETFLAGS(X_OF|X_CF, SF_SET); + } else { + SETFLAGS(X_ALL, SF_SET); + } GETEW(x1, 0); UXTHw(x2, xRAX); MULw(x1, x2, x1); - UFLAG_RES(x1); BFIz(xRAX, x1, 0, 16); BFXILx(xRDX, x1, 16, 16); - UFLAG_DF(x1, d_mul16); + SET_DFNONE(); + IFX(X_CF|X_OF) { + CMPSw_REG_LSR(xZR, x1, 16); + CSETw(x3, cNE); + IFX(X_CF) { + BFIw(xFlags, x3, F_CF, 1); + } + IFX(X_OF) { + BFIw(xFlags, x3, F_OF, 1); + } + } + IFX2(X_AF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_AF, 1);} + IFX2(X_ZF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX2(X_SF, && !BOX64ENV(cputype)) { + LSRxw(x3, xRAX, 15); + BFIw(xFlags, x3, F_SF, 1); + } + IFX2(X_PF, && !BOX64ENV(cputype)) emit_pf(dyn, ninst, xRAX, x3); break; case 5: INST_NAME("IMUL AX, Ew"); - SETFLAGS(X_ALL, SF_PENDING); + if (BOX64DRENV(dynarec_safeflags) && BOX64ENV(cputype)) { + SETFLAGS(X_OF|X_CF, SF_SET); + } else { + SETFLAGS(X_ALL, SF_SET); + } GETSEW(x1, 0); SXTHw(x2, xRAX); MULw(x1, x2, x1); - UFLAG_RES(x1); BFIz(xRAX, x1, 0, 16); BFXILx(xRDX, x1, 16, 16); - UFLAG_DF(x1, d_imul16); + SET_DFNONE(); + IFX(X_CF|X_OF) { + ASRw(x2, x1, 15); + CMPSw_REG_ASR(x2, x1, 31); + CSETw(x3, cNE); + IFX(X_CF) { + BFIw(xFlags, x3, F_CF, 1); + } + IFX(X_OF) { + BFIw(xFlags, x3, F_OF, 1); + } + } + IFX2(X_AF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_AF, 1);} + IFX2(X_ZF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX2(X_SF, && !BOX64ENV(cputype)) { + LSRxw(x3, xRAX, 15); + BFIw(xFlags, x3, F_SF, 1); + } + IFX2(X_PF, && !BOX64ENV(cputype)) emit_pf(dyn, ninst, xRAX, x3); break; case 6: INST_NAME("DIV Ew"); SETFLAGS(X_ALL, SF_SET); - SET_DFNONE(x1); GETEW(x1, 0); UXTHw(x2, xRAX); BFIw(x2, xRDX, 16, 16); - if(box64_dynarec_div0) { + if(BOX64ENV(dynarec_div0)) { CBNZw_MARK3(ed); + MARK2; GETIP_(ip); STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); + CALL_S(const_native_div0, -1); CLEARIP(); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); MARK3; } UDIVw(x3, x2, ed); + if(BOX64ENV(dynarec_div0)) { + SUBw_UXTH(x5, x3, x3); + CBNZw_MARK2(x5); + } MSUBw(x4, x3, ed, x2); // x4 = x2 mod ed (i.e. x2 - x3*ed) BFIz(xRAX, x3, 0, 16); BFIz(xRDX, x4, 0, 16); + SET_DFNONE(); + IFX(X_OF) {BFCw(xFlags, F_OF, 1);} + IFX(X_CF) {BFCw(xFlags, F_CF, 1);} + IFX2(X_AF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_AF, 1);} + IFX2(X_AF, && BOX64ENV(cputype)) {ORRw_mask(xFlags, xFlags, 28, 0);} //mask=0x10 + IFX2(X_ZF, && !BOX64ENV(cputype)) {ORRw_mask(xFlags, xFlags, 26, 0);} //mask=0x40 + IFX2(X_ZF, && BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX(X_SF) {BFCw(xFlags, F_SF, 1);} + IFX2(X_PF, && !BOX64ENV(cputype)) {ORRw_mask(xFlags, xFlags, 30, 0);} //mask=0x04 + IFX2(X_PF, && BOX64ENV(cputype)) {BFCw(xFlags, F_PF, 1);} break; case 7: INST_NAME("IDIV Ew"); SKIPTEST(x1); - SETFLAGS(X_ALL, SF_SET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL, SF_SET); + } else if (BOX64ENV(cputype)) { + SETFLAGS(X_SF|X_PF|X_ZF|X_AF, SF_SET); + } GETSEW(x1, 0); - if(box64_dynarec_div0) { + if(BOX64ENV(dynarec_div0)) { CBNZw_MARK3(ed); + MARK2; GETIP_(ip); STORE_XEMU_CALL(xRIP); - CALL(native_div0, -1); + CALL_S(const_native_div0, -1); CLEARIP(); LOAD_XEMU_CALL(xRIP); jump_to_epilog(dyn, 0, xRIP, ninst); @@ -1412,38 +1664,40 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin UXTHw(x2, xRAX); BFIw(x2, xRDX, 16, 16); SDIVw(x3, x2, ed); + if(BOX64ENV(dynarec_div0)) { + SUBw_SXTH(x5, x3, x3); + CBNZw_MARK2(x5); + } MSUBw(x4, x3, ed, x2); // x4 = x2 mod ed (i.e. x2 - x3*ed) BFIz(xRAX, x3, 0, 16); BFIz(xRDX, x4, 0, 16); + if (!BOX64DRENV(dynarec_safeflags)) { + SET_DFNONE(); + } + IFX2(X_AF, && BOX64ENV(cputype)) {ORRw_mask(xFlags, xFlags, 28, 0);} //mask=0x10 + IFX2(X_ZF, && BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX2(X_SF, && BOX64ENV(cputype)) {BFCw(xFlags, F_SF, 1);} + IFX2(X_PF, && BOX64ENV(cputype)) {BFCw(xFlags, F_PF, 1);} break; } break; case 0xF8: - INST_NAME("CLC"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); - BFCx(xFlags, F_CF, 1); - break; case 0xF9: - INST_NAME("STC"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); - ORRx_mask(xFlags, xFlags, 1, 0, 0); // xFlags | 1 - break; + return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); case 0xFF: nextop = F8; switch((nextop>>3)&7) { case 0: INST_NAME("INC Ew"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); GETEW(x1, 0); emit_inc16(dyn, ninst, x1, x2, x4); EWBACK; break; case 1: INST_NAME("DEC Ew"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); GETEW(x1, 0); emit_dec16(dyn, ninst, x1, x2, x4); EWBACK; diff --git a/src/dynarec/arm64/dynarec_arm64_660f.c b/src/dynarec/arm64/dynarec_arm64_660f.c index a8625e2..4044d3d 100644 --- a/src/dynarec/arm64/dynarec_arm64_660f.c +++ b/src/dynarec/arm64/dynarec_arm64_660f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,8 +17,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" -#include "emu/x64compstrings.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { @@ -34,6 +31,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n uint8_t eb1, eb2; int64_t j64; uint64_t tmp64u, tmp64u2; + int mask; int v0, v1; int q0, q1; int d0, d1; @@ -48,16 +46,13 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n MAYUSE(eb2); MAYUSE(j64); #if STEP > 1 - static const int8_t mask_shift8[] = { -7, -6, -5, -4, -3, -2, -1, 0 }; - static const int8_t mask_string8[] = { 7, 6, 5, 4, 3, 2, 1, 0 }; - static const int8_t mask_string16[] = { 15, 14, 13, 12, 11, 10, 9, 8 }; static const int8_t round_round[] = { 0, 2, 1, 3}; #endif switch(opcode) { case 0x10: - INST_NAME("MOVUPD Gx,Ex"); + INST_NAME("MOVUPD Gx, Ex"); nextop = F8; GETG; if(MODREG) { @@ -88,12 +83,12 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0x12: INST_NAME("MOVLPD Gx, Eq"); nextop = F8; - GETGX(v0, 1); if(MODREG) { // access register instead of memory is bad opcode! DEFAULT; return addr; } + GETGX(v0, 1); SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); VLD1_64(v0, 0, ed); @@ -101,12 +96,12 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0x13: INST_NAME("MOVLPD Eq, Gx"); nextop = F8; - GETGX(v0, 0); if(MODREG) { // access register instead of memory is bad opcode! DEFAULT; return addr; } + GETGX(v0, 0); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); VST1_64(v0, 0, ed); SMWRITE2(); @@ -167,6 +162,13 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n SMWRITE2(); break; + case 0x18: + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: case 0x1F: INST_NAME("NOP (multibyte)"); nextop = F8; @@ -174,7 +176,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n break; case 0x28: - INST_NAME("MOVAPD Gx,Ex"); + INST_NAME("MOVAPD Gx, Ex"); nextop = F8; GETG; if(MODREG) { @@ -215,12 +217,10 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0x2B: INST_NAME("MOVNTPD Ex,Gx"); nextop = F8; - GETGX(v0, 0); if(MODREG) { - ed = (nextop&7)+(rex.b<<3); - v1 = sse_get_reg_empty(dyn, ninst, x1, ed); - VMOVQ(v1, v0); + DEFAULT; } else { + GETGX(v0, 0); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); VST128(v0, ed, fixedaddress); } @@ -230,12 +230,12 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETGM(q0); GETEX(v1, 0, 0); - if(box64_dynarec_fastround) { + if(BOX64ENV(dynarec_fastround)) { VFCVTZSQD(q0, v1); SQXTN_32(q0, q0); } else { - if(arm64_frintts) { - VFRINT32ZD(q0, q0); + if(cpuext.frintts) { + VFRINT32ZDQ(q0, v1); VFCVTZSQD(q0, q0); SQXTN_32(q0, q0); } else { @@ -266,7 +266,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETGM(q0); GETEX(v1, 0, 0); - if(box64_dynarec_fastround) { + if(BOX64ENV(dynarec_fastround)) { u8 = sse_setround(dyn, ninst, x1, x2, x3); VFRINTIDQ(q0, v1); FCVTXN(q0, q0); @@ -274,8 +274,8 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n VFCVTZSS(q0, q0); } else { u8 = sse_setround(dyn, ninst, x1, x2, x3); - if(arm64_frintts) { - VFRINT32XD(q0, q0); + if(cpuext.frintts) { + VFRINT32XDQ(q0, v1); VFCVTZSQD(q0, q0); SQXTN_32(q0, q0); } else { @@ -310,7 +310,9 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETGX(v0, 0); GETEXSD(q0, 0, 0); - FCMPD(v0, q0); + IFX(X_CF|X_PF|X_ZF) { + FCMPD(v0, q0); + } FCOMI(x1, x2); break; @@ -352,7 +354,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n SQADDQ_16(q0, q0, v0); break; case 0x04: - INST_NAME("PMADDUBSW Gx,Ex"); + INST_NAME("PMADDUBSW Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -414,11 +416,9 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n v0 = fpu_get_scratch(dyn, ninst); NEGQ_8(v0, q0); // get NEG CMLTQ_0_8(v1, q1); // calculate mask - VBICQ(q0, q0, v1); // apply not mask on dest - VANDQ(v0, v0, v1); // apply mask on src - VORRQ(q0, q0, v0); // merge + VBIFQ(v0, q0, v1); // put back positive values CMEQQ_0_8(v1, q1); // handle case where Ex is 0 - VBICQ(q0, q0, v1); + VBICQ(q0, v0, v1); break; case 0x09: INST_NAME("PSIGNW Gx, Ex"); @@ -427,13 +427,11 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETEX(q1, 0, 0); v1 = fpu_get_scratch(dyn, ninst); v0 = fpu_get_scratch(dyn, ninst); - NEGQ_16(v0, q0); // get NEG - CMLTQ_0_16(v1, q1); // calculate mask - VBICQ(q0, q0, v1); // apply not mask on dest - VANDQ(v0, v0, v1); // apply mask on src - VORRQ(q0, q0, v0); // merge - CMEQQ_0_16(v1, q1); // handle case where Ex is 0 - VBICQ(q0, q0, v1); + NEGQ_16(v0, q0); // get NEG + CMLTQ_0_16(v1, q1); // calculate mask + VBIFQ(v0, q0, v1); // put back positive values + CMEQQ_0_16(v1, q1); // handle case where Ex is 0 + VBICQ(q0, v0, v1); break; case 0x0A: INST_NAME("PSIGND Gx, Ex"); @@ -442,24 +440,29 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETEX(q1, 0, 0); v1 = fpu_get_scratch(dyn, ninst); v0 = fpu_get_scratch(dyn, ninst); - NEGQ_32(v0, q0); // get NEG - CMLTQ_0_32(v1, q1); // calculate mask - VBICQ(q0, q0, v1); // apply not mask on dest - VANDQ(v0, v0, v1); // apply mask on src - VORRQ(q0, q0, v0); // merge - CMEQQ_0_32(v1, q1); // handle case where Ex is 0 - VBICQ(q0, q0, v1); + NEGQ_32(v0, q0); // get NEG + CMLTQ_0_32(v1, q1); // calculate mask + VBIFQ(v0, q0, v1); // put back positive values + CMEQQ_0_32(v1, q1); // handle case where Ex is 0 + VBICQ(q0, v0, v1); break; case 0x0B: - INST_NAME("PMULHRSW Gx,Ex"); + INST_NAME("PMULHRSW Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); - SQRDMULHQ_16(q0, q0, q1); + v0 = fpu_get_scratch(dyn, ninst); + v1 = fpu_get_scratch(dyn, ninst); + VSMULL_16(v0, q0, q1); + VSMULL2_16(v1, q0, q1); + SRSHRQ_32(v0, v0, 15); + SRSHRQ_32(v1, v1, 15); + XTN_16(q0, v0); + XTN2_16(q0, v1); break; case 0x10: - INST_NAME("PBLENDVB Gx,Ex"); + INST_NAME("PBLENDVB Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -467,14 +470,12 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n v1 = fpu_get_scratch(dyn, ninst); if(q0!=q1) { VSSHRQ_8(v1, v0, 7); // bit[7]-> bit[7..0] - VBICQ(q0, q0, v1); - VANDQ(v1, q1, v1); - VORRQ(q0, q0, v1); + VBITQ(q0, q1, v1); } break; case 0x14: - INST_NAME("PBLENDVPS Gx,Ex"); + INST_NAME("BLENDVPS Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -482,13 +483,11 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n v1 = fpu_get_scratch(dyn, ninst); if(q0!=q1) { VSSHRQ_32(v1, v0, 31); // bit[31]-> bit[31..0] - VBICQ(q0, q0, v1); - VANDQ(v1, q1, v1); - VORRQ(q0, q0, v1); + VBITQ(q0, q1, v1); } break; case 0x15: - INST_NAME("PBLENDVPD Gx,Ex"); + INST_NAME("BLENDVPD Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -496,9 +495,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n v1 = fpu_get_scratch(dyn, ninst); if(q0!=q1) { VSSHRQ_64(v1, v0, 63); // bit[63]-> bit[63..0] - VBICQ(q0, q0, v1); - VANDQ(v1, q1, v1); - VORRQ(q0, q0, v1); + VBITQ(q0, q1, v1); } break; @@ -506,48 +503,52 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n INST_NAME("PTEST Gx, Ex"); nextop = F8; SETFLAGS(X_ALL, SF_SET); - GETGX(q0, 0); - GETEX(q1, 0, 0); - v1 = fpu_get_scratch(dyn, ninst); - IFX(X_ZF) { - VANDQ(v1, q1, q0); - CMEQQ_0_64(v1, v1); - UADDLVQ_32(v1, v1); - VMOVQDto(x1, v1, 0); - UBFXx(x1, x1, 33, 1); // bit33 will only be set if all bits are 1 - BFIw(xFlags, x1, F_ZF, 1); - } + GETGX(v0, 0); + GETEX(v1, 0, 0); + q0 = fpu_get_scratch(dyn, ninst); IFX(X_CF) { - VBICQ(v1, q1, q0); - CMEQQ_0_64(v1, v1); - UADDLVQ_32(v1, v1); - VMOVQDto(x1, v1, 0); - UBFXx(x1, x1, 33, 1); - BFIw(xFlags, x1, F_CF, 1); + VBICQ(q0, v1, v0); + CMEQQ_0_64(q0, q0); + UQXTN_32(q0, q0); + VMOVQDto(x2, q0, 0); + ADDSx_U12(xZR, x2, 1); + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_CF, 1); + } + IFX(X_ZF) { + VANDQ(q0, v0, v1); + CMEQQ_0_64(q0, q0); + UQXTN_32(q0, q0); + VMOVQDto(x2, q0, 0); + ADDSx_U12(xZR, x2, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_ZF, 1); + } } IFX(X_PF|X_AF|X_OF|X_SF) { MOV32w(x1, (1< 0 - UQXTN_16(q0, v1); + SQXTUN_16(q0, q0); if(q0==q1) { VMOVeD(q0, 1, q0, 0); } else { - SMAXQ_32(v0, v0, q1); - UQXTN2_16(q0, v0); + SQXTUN2_16(q0, q1); } break; @@ -771,7 +772,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0xDB: INST_NAME("AESIMC Gx, Ex"); // AES-NI nextop = F8; - if(arm64_aes) { + if(cpuext.aes) { GETEX(q1, 0, 0); GETGX_empty(q0); AESIMC(q0, q1); @@ -783,13 +784,13 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } sse_forget_reg(dyn, ninst, gd); MOV32w(x1, gd); - CALL(native_aesimc, -1); + CALL(const_native_aesimc, -1); } break; case 0xDC: INST_NAME("AESENC Gx, Ex"); // AES-NI nextop = F8; - if(arm64_aes) { + if(cpuext.aes) { GETEX(q1, 0, 0); GETGX(q0, 1); v0 = fpu_get_scratch(dyn, ninst); // ARM64 internal operation differs a bit from x86_64 @@ -806,7 +807,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } else d0 = -1; sse_forget_reg(dyn, ninst, gd); MOV32w(x1, gd); - CALL(native_aese, -1); + CALL(const_native_aese, -1); GETGX(q0, 1); VEORQ(q0, q0, (d0!=-1)?d0:q1); } @@ -814,7 +815,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0xDD: INST_NAME("AESENCLAST Gx, Ex"); // AES-NI nextop = F8; - if(arm64_aes) { + if(cpuext.aes) { GETEX(q1, 0, 0); GETGX(q0, 1); v0 = fpu_get_scratch(dyn, ninst); // ARM64 internal operation differs a bit from x86_64 @@ -830,7 +831,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } else d0 = -1; sse_forget_reg(dyn, ninst, gd); MOV32w(x1, gd); - CALL(native_aeselast, -1); + CALL(const_native_aeselast, -1); GETGX(q0, 1); VEORQ(q0, q0, (d0!=-1)?d0:q1); } @@ -838,7 +839,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0xDE: INST_NAME("AESDEC Gx, Ex"); // AES-NI nextop = F8; - if(arm64_aes) { + if(cpuext.aes) { GETEX(q1, 0, 0); GETGX(q0, 1); v0 = fpu_get_scratch(dyn, ninst); // ARM64 internal operation differs a bit from x86_64 @@ -855,7 +856,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } else d0 = -1; sse_forget_reg(dyn, ninst, gd); MOV32w(x1, gd); - CALL(native_aesd, -1); + CALL(const_native_aesd, -1); GETGX(q0, 1); VEORQ(q0, q0, (d0!=-1)?d0:q1); } @@ -863,7 +864,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0xDF: INST_NAME("AESDECLAST Gx, Ex"); // AES-NI nextop = F8; - if(arm64_aes) { + if(cpuext.aes) { GETEX(q1, 0, 0); GETGX(q0, 1); v0 = fpu_get_scratch(dyn, ninst); // ARM64 internal operation differs a bit from x86_64 @@ -879,7 +880,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } else d0 = -1; sse_forget_reg(dyn, ninst, gd); MOV32w(x1, gd); - CALL(native_aesdlast, -1); + CALL(const_native_aesdlast, -1); GETGX(q0, 1); VEORQ(q0, q0, (d0!=-1)?d0:q1); } @@ -887,9 +888,9 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0xF0: INST_NAME("MOVBE Gw, Ew"); nextop=F8; - gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); REV16x(x1, ed); BFIx(gd, x1, 0, 16); } else { @@ -903,16 +904,16 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0xF1: INST_NAME("MOVBE Ew, Gw"); nextop=F8; - gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); REV16x(x1, gd); BFIx(ed, x1, 0, 16); } else { - SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, (1<<1)-1, rex, NULL, 0, 0); REV16x(x1, gd); STH(x1, ed, fixedaddress); + SMWRITE(); } break; @@ -923,13 +924,27 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n SETFLAGS(X_CF, SF_SUBSET); GETED(0); GETGD; - MRS_nzvc(x3); - BFIx(x3, xFlags, 29, 1); // set C - MSR_nzvc(x3); // load CC into ARM CF + IFNATIVE_BEFORE(NF_CF) { + if(INVERTED_CARRY_BEFORE) { + if(cpuext.flagm) + CFINV(); + else { + MRS_nzcv(x3); + EORx_mask(x3, x3, 1, 35, 0); //mask=1<>2, q1, i32>>2); - i32+=4; - u8>>=4; - } else { - // 32bits - VMOVeS(q0, i32>>1, q1, i32>>1); - i32+=2; - u8>>=2; - } - } else { - // 16 bits - VMOVeH(q0, i32, q1, i32); - i32++; - u8>>=1; - } - } else { - // nope - i32++; - u8>>=1; - } - - } + q0 = fpu_get_scratch(dyn, ninst); + MOVI_64(q0, u8); + SXTL_8(q0, q0); // expand 8bits to 16bits... + VBITQ(v0, v1, q0); break; case 0x0F: INST_NAME("PALIGNR Gx, Ex, Ib"); @@ -1092,7 +1086,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETGX(q0, 0); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); u8 = F8; VMOVBto(ed, q0, (u8&15)); } else { @@ -1107,7 +1101,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETGX(q0, 0); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); u8 = F8; VMOVHto(ed, q0, (u8&7)); } else { @@ -1122,7 +1116,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETGX(q0, 0); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); u8 = F8; if(rex.w) { VMOVQDto(ed, q0, (u8&1)); @@ -1145,22 +1139,30 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETGX(q0, 0); if (MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); u8 = F8&0b11; - MOVx_REG(ed, xZR); - VMOVSto(ed, q0, u8); + VMOVSto(ed, q0, u8); // will zero extend } else { addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 1); u8 = F8&0b11; VMOVSto(x1, q0, u8); STW(x1, wback, fixedaddress); + SMWRITE2(); } break; case 0x20: INST_NAME("PINSRB Gx, ED, Ib"); nextop = F8; GETGX(q0, 1); - GETED(1); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + wback = 0; + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, 1); + LDB(x1, wback, fixedaddress); + ed = x1; + } u8 = F8; VMOVQBfrom(q0, (u8&15), ed); break; @@ -1209,7 +1211,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n u8 = F8; v0 = fpu_get_scratch(dyn, ninst); VFMULQS(v0, q0, q1); - // mask some, duplicate all, mask some + // mask some (considering masking is rare) for(int i=0; i<4; ++i) if(!(u8&(1<<(4+i)))) { VMOVQSfrom(v0, i, xZR); @@ -1223,10 +1225,31 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } break; + case 0x41: + INST_NAME("DPPD Gx, Ex, Ib"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 1); + u8 = F8; + v0 = fpu_get_scratch(dyn, ninst); + VFMULQD(v0, q0, q1); + // mask some, duplicate all, mask some + for(int i=0; i<2; ++i) + if(!(u8&(1<<(4+i)))) { + VMOVQDfrom(v0, i, xZR); + } + FADDPD(v0, v0); + VDUPQ_64(q0, v0, 0); + for(int i=0; i<2; ++i) + if(!(u8&(1<7) // no need to reflect cache as xmm0-xmm7 will be saved before the function call anyway @@ -1458,7 +1482,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n MOVw_REG(x4, xRAX); u8 = F8; MOV32w(x5, u8); - CALL(sse42_compare_string_explicit_len, x1); + CALL(const_sse42_compare_string_explicit_len, x1); } if(u8&0b1000000) { CBNZw_MARK(x1); @@ -1494,7 +1518,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } u8 = F8; MOV32w(x3, u8); - CALL(sse42_compare_string_implicit_len, x1); + CALL(const_sse42_compare_string_implicit_len, x1); q0 = sse_get_reg_empty(dyn, ninst, x2, 0); if(u8&0b1000000) { q1 = fpu_get_scratch(dyn, ninst); @@ -1504,7 +1528,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n LSRw_IMM(x1, x1, 8); VDUPQB(q1, x1); // load the high 8bits of the mask VEXTQ_8(q0, q0, q1, 8); // low and hig bits mask - TABLE64(x2, (uintptr_t)&mask_string8); + TABLE64C(x2, const_8b_7_6_5_4_3_2_1_0); VLDR64_U12(q1, x2, 0); // load shift VDUPQ_64(q1, q1, 0); USHLQ_8(q0, q0, q1); // extract 1 bit @@ -1514,7 +1538,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n break; case 0b01: VDUPQH(q0, x1); // load the 8bits of the mask - TABLE64(x2, (uintptr_t)&mask_string16); + TABLE64C(x2, const_8b_15_14_13_12_11_10_9_8); VLDR64_U12(q1, x2, 0); // load shift UXTL_8(q1, q1); // extend mask to 16bits USHLQ_16(q0, q0, q1); // extract 1 bit @@ -1548,7 +1572,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } u8 = F8; MOV32w(x3, u8); - CALL(sse42_compare_string_implicit_len, x1); + CALL(const_sse42_compare_string_implicit_len, x1); CBNZw_MARK(x1); MOV32w(xRCX, (u8&1)?8:16); B_NEXT_nocond; @@ -1583,7 +1607,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } u8 = F8; MOV32w(x4, u8); - CALL(native_aeskeygenassist, -1); + CALL(const_native_aeskeygenassist, -1); break; default: @@ -1591,20 +1615,21 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } break; - #define GO(GETFLAGS, NO, YES, F) \ - READFLAGS(F); \ - GETFLAGS; \ - nextop=F8; \ - GETGD; \ - if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); \ - LDH(x1, ed, fixedaddress); \ - ed = x1; \ - } \ - Bcond(NO, +8); \ + #define GO(GETFLAGS, NO, YES, F) \ + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); \ + READFLAGS(F); \ + GETFLAGS; \ + nextop = F8; \ + GETGD; \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff << 1, 1, rex, NULL, 0, 0); \ + LDH(x1, ed, fixedaddress); \ + ed = x1; \ + } \ + Bcond(NO, +8); \ BFIx(gd, ed, 0, 16); GOCOND(0x40, "CMOV", "Gw, Ew"); @@ -1612,7 +1637,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0x50: nextop = F8; - INST_NAME("PMOVMSKD Gd, Ex"); + INST_NAME("MOVMSKPD Gd, Ex"); GETEX(q0, 0, 0); GETGD; VMOVQDto(x1, q0, 0); @@ -1625,7 +1650,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETEX(q0, 0, 0); GETGX_empty(q1); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { v0 = fpu_get_scratch(dyn, ninst); v1 = fpu_get_scratch(dyn, ninst); // check if any input value was NAN @@ -1680,7 +1705,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETEX(q0, 0, 0); GETGX(q1, 1); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { v0 = fpu_get_scratch(dyn, ninst); v1 = fpu_get_scratch(dyn, ninst); // check if any input value was NAN @@ -1688,7 +1713,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n VFCMEQQD(v0, v0, v0); // 0 if NAN, 1 if not NAN } VFADDQD(q1, q1, q0); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { VFCMEQQD(v1, q1, q1); // 0 => out is NAN VBICQ(v1, v0, v1); // forget it in any input was a NAN already VSHLQ_64(v1, v1, 63); // only keep the sign bit @@ -1700,7 +1725,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETEX(q0, 0, 0); GETGX(q1, 1); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { v0 = fpu_get_scratch(dyn, ninst); v1 = fpu_get_scratch(dyn, ninst); // check if any input value was NAN @@ -1708,7 +1733,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n VFCMEQQD(v0, v0, v0); // 0 if NAN, 1 if not NAN } VFMULQD(q1, q1, q0); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { VFCMEQQD(v1, q1, q1); // 0 => out is NAN VBICQ(v1, v0, v1); // forget it in any input was a NAN already VSHLQ_64(v1, v1, 63); // only keep the sign bit @@ -1720,7 +1745,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETEX(v1, 0, 0); GETGX_empty(v0); - if(box64_dynarec_fastround) { + if(BOX64ENV(dynarec_fastround)==2) { FCVTXN(v0, v1); } else { u8 = sse_setround(dyn, ninst, x1, x2, x3); @@ -1733,26 +1758,36 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETEX(v1, 0, 0); GETGX_empty(v0); - if(box64_dynarec_fastround) { + if(BOX64ENV(dynarec_fastround)) { u8 = sse_setround(dyn, ninst, x1, x2, x3); VFRINTISQ(v0, v1); x87_restoreround(dyn, ninst, u8); VFCVTZSQS(v0, v0); } else { - MRS_fpsr(x5); - u8 = sse_setround(dyn, ninst, x1, x2, x3); - MOV32w(x4, 0x80000000); - d0 = fpu_get_scratch(dyn, ninst); - for(int i=0; i<4; ++i) { - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - VMOVeS(d0, 0, v1, i); - FRINTIS(d0, d0); - VFCVTZSs(d0, d0); - MRS_fpsr(x5); // get back FPSR to check the IOC bit - TBZ(x5, FPSR_IOC, 4+4); - VMOVQSfrom(d0, 0, x4); - VMOVeS(v0, i, d0, 0); + if(cpuext.frintts) { + u8 = sse_setround(dyn, ninst, x1, x2, x3); + VFRINT32XSQ(v0, v1); // handle overflow + VFCVTZSQS(v0, v0); + } else { + MRS_fpsr(x5); + u8 = sse_setround(dyn, ninst, x1, x2, x3); + MOV32w(x4, 0x80000000); + d0 = fpu_get_scratch(dyn, ninst); + for(int i=0; i<4; ++i) { + BFCw(x5, FPSR_IOC, 1); // reset IOC bit + MSR_fpsr(x5); + if(i) { + VMOVeS(d0, 0, v1, i); + FRINTIS(d0, d0); + } else { + FRINTIS(d0, v1); + } + VFCVTZSs(d0, d0); + MRS_fpsr(x5); // get back FPSR to check the IOC bit + TBZ(x5, FPSR_IOC, 4+4); + VMOVQSfrom(d0, 0, x4); + VMOVeS(v0, i, d0, 0); + } } x87_restoreround(dyn, ninst, u8); } @@ -1762,7 +1797,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETEX(q0, 0, 0); GETGX(q1, 1); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { v0 = fpu_get_scratch(dyn, ninst); v1 = fpu_get_scratch(dyn, ninst); // check if any input value was NAN @@ -1770,7 +1805,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n VFCMEQQD(v0, v0, v0); // 0 if NAN, 1 if not NAN } VFSUBQD(q1, q1, q0); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { VFCMEQQD(v1, q1, q1); // 0 => out is NAN VBICQ(v1, v0, v1); // forget it in any input was a NAN already VSHLQ_64(v1, v1, 63); // only keep the sign bit @@ -1784,21 +1819,16 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETEX(v1, 0, 0); // FMIN/FMAX wll not copy the value if v0[x] is NaN // but x86 will copy if either v0[x] or v1[x] is NaN, so lets force a copy if source is NaN - if(!box64_dynarec_fastnan && v0!=v1) { - q0 = fpu_get_scratch(dyn, ninst); - VFCMEQQD(q0, v0, v0); // 0 is NaN, 1 is not NaN, so MASK for NaN - VANDQ(v0, v0, q0); - VBICQ(q0, v1, q0); - VORRQ(v0, v0, q0); - } - VFMINQD(v0, v0, v1); + q0 = fpu_get_scratch(dyn, ninst); + VFCMGTQD(q0, v1, v0); // 0 is NaN or v1 GT v0, so invert mask for copy + VBIFQ(v0, v1, q0); break; case 0x5E: INST_NAME("DIVPD Gx, Ex"); nextop = F8; GETEX(q0, 0, 0); GETGX(q1, 1); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { v0 = fpu_get_scratch(dyn, ninst); v1 = fpu_get_scratch(dyn, ninst); // check if any input value was NAN @@ -1806,7 +1836,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n VFCMEQQD(v0, v0, v0); // 0 if NAN, 1 if not NAN } VFDIVQD(q1, q1, q0); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { VFCMEQQD(v1, q1, q1); // 0 => out is NAN VBICQ(v1, v0, v1); // forget it in any input was a NAN already VSHLQ_64(v1, v1, 63); // only keep the sign bit @@ -1819,39 +1849,34 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(v0, 1); GETEX(v1, 0, 0); // FMIN/FMAX wll not copy the value if v0[x] is NaN - // but x86 will copy if either v0[x] or v1[x] is NaN, so lets force a copy if source is NaN - if(!box64_dynarec_fastnan && v0!=v1) { - q0 = fpu_get_scratch(dyn, ninst); - VFCMEQQD(q0, v0, v0); // 0 is NaN, 1 is not NaN, so MASK for NaN - VANDQ(v0, v0, q0); - VBICQ(q0, v1, q0); - VORRQ(v0, v0, q0); - } - VFMAXQD(v0, v0, v1); + // but x86 will copy if either v0[x] or v1[x] is NaN, or if values are equals, so lets force a copy if source is NaN + q0 = fpu_get_scratch(dyn, ninst); + VFCMGTQD(q0, v0, v1); // 0 is NaN or v0 GT v1, so invert mask for copy + VBIFQ(v0, v1, q0); break; case 0x60: - INST_NAME("PUNPCKLBW Gx,Ex"); + INST_NAME("PUNPCKLBW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VZIP1Q_8(v0, v0, q0); break; case 0x61: - INST_NAME("PUNPCKLWD Gx,Ex"); + INST_NAME("PUNPCKLWD Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VZIP1Q_16(v0, v0, q0); break; case 0x62: - INST_NAME("PUNPCKLDQ Gx,Ex"); + INST_NAME("PUNPCKLDQ Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VZIP1Q_32(v0, v0, q0); break; case 0x63: - INST_NAME("PACKSSWB Gx,Ex"); + INST_NAME("PACKSSWB Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -1863,21 +1888,21 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } break; case 0x64: - INST_NAME("PCMPGTB Gx,Ex"); + INST_NAME("PCMPGTB Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); VCMGTQ_8(v0, v0, v1); break; case 0x65: - INST_NAME("PCMPGTW Gx,Ex"); + INST_NAME("PCMPGTW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); VCMGTQ_16(v0, v0, v1); break; case 0x66: - INST_NAME("PCMPGTD Gx,Ex"); + INST_NAME("PCMPGTD Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); @@ -1896,28 +1921,28 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } break; case 0x68: - INST_NAME("PUNPCKHBW Gx,Ex"); + INST_NAME("PUNPCKHBW Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); VZIP2Q_8(q0, q0, q1); break; case 0x69: - INST_NAME("PUNPCKHWD Gx,Ex"); + INST_NAME("PUNPCKHWD Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); VZIP2Q_16(q0, q0, q1); break; case 0x6A: - INST_NAME("PUNPCKHDQ Gx,Ex"); + INST_NAME("PUNPCKHDQ Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); VZIP2Q_32(q0, q0, q1); break; case 0x6B: - INST_NAME("PACKSSDW Gx,Ex"); + INST_NAME("PACKSSDW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); @@ -1929,7 +1954,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } break; case 0x6C: - INST_NAME("PUNPCKLQDQ Gx,Ex"); + INST_NAME("PUNPCKLQDQ Gx, Ex"); nextop = F8; GETGX(v0, 1); if(MODREG) { @@ -1941,7 +1966,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } break; case 0x6D: - INST_NAME("PUNPCKHQDQ Gx,Ex"); + INST_NAME("PUNPCKHQDQ Gx, Ex"); nextop = F8; GETGX(v0, 1); VMOVeD(v0, 0, v0, 1); @@ -1969,7 +1994,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } break; case 0x6F: - INST_NAME("MOVDQA Gx,Ex"); + INST_NAME("MOVDQA Gx, Ex"); nextop = F8; if(MODREG) { v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); @@ -1983,41 +2008,94 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } break; case 0x70: - INST_NAME("PSHUFD Gx,Ex,Ib"); + INST_NAME("PSHUFD Gx, Ex,Ib"); nextop = F8; - i32 = -1; if(MODREG) { - u8 = F8; v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); - GETGX_empty(v0); - if(u8==0x4E) { - if(v0==v1) { - VEXTQ_8(v0, v0, v0, 8); // Swap Up/Lower 64bits parts - } else { - VMOVeD(v0, 0, v1, 1); - VMOVeD(v0, 1, v1, 0); - } - } else if(u8==0x00) { - // duplicate lower 32bits to all spot + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1); + v1 = fpu_get_scratch(dyn, ninst); + } + u8 = F8; + GETGX_empty(v0); + switch(u8) { + case 0x4E: // Swap Up/Lower 64bits parts + if(!MODREG) + VLDR128_U12(v1, wback, 0); + VEXTQ_8(v0, v1, v1, 8); + break; + case 0x00: // duplicate lower 32bits to all spot + if(MODREG) VDUPQ_32(v0, v1, 0); - } else if(u8==0x55) { - // duplicate slot 1 to all spot + else + VLDQ1R_32(v0, wback); + break; + case 0x55: // duplicate slot 1 to all spot + if(MODREG) VDUPQ_32(v0, v1, 1); - } else if(u8==0xAA) { - // duplicate slot 2 to all spot + else { + ADDx_U12(x2, wback, 4); + VLDQ1R_32(v0, x2); + } + break; + case 0xAA: // duplicate slot 2 to all spot + if(MODREG) VDUPQ_32(v0, v1, 2); - } else if(u8==0xFF) { - // duplicate slot 3 to all spot + else { + ADDx_U12(x2, wback, 8); + VLDQ1R_32(v0, x2); + } + break; + case 0xFF: // duplicate slot 3 to all spot + if(MODREG) VDUPQ_32(v0, v1, 3); - } else if(u8==0x44) { - // duplicate slot 0/1 to all spot + else { + ADDx_U12(x2, wback, 12); + VLDQ1R_32(v0, x2); + } + break; + case 0x44: // duplicate slot 0/1 to all spot + if(MODREG) VDUPQ_64(v0, v1, 0); - } else if(u8==0xEE) { - // duplicate slot 2/3 to all spot + else + VLDQ1R_64(v0, wback); + break; + case 0xEE: // duplicate slot 2/3 to all spot + if(MODREG) VDUPQ_64(v0, v1, 1); - } else if(u8==0xB1) { - // invert 0/1 and 2/3 - VREV64Q_32(v0, v1); + else { + ADDx_U12(x2, wback, 8); + VLDQ1R_64(v0, x2); + } + break; + case 0xB1: // invert 0/1 and 2/3 + if(!MODREG) + VLDR128_U12(v1, wback, 0); + VREV64Q_32(v0, v1); + break; + case 0x39: // 0 3 2 1: ror 32 bits + if(!MODREG) + VLDR128_U12(v1, wback, 0); + VEXTQ_8(v0, v1, v1, 4); + break; + case 0x93: // 2 1 0 3: 0 3 2 1: ror 32 bits then invert low/high 64bits + if(!MODREG) + VLDR128_U12(v1, wback, 0); + VEXTQ_8(v0, v1, v1, 4); + VEXTQ_8(v0, v0, v0, 8); + break; + default: + if(!MODREG) { + i32 = -1; + for (int i=0; i<4; ++i) { + int32_t idx = (u8>>(i*2))&3; + if(idx!=i32) { + ADDx_U12(x2, wback, idx*4); + i32 = idx; + } + VLD1_32(v0, i, x2); + } } else if(v0!=v1) { VMOVeS(v0, 0, v1, (u8>>(0*2))&3); VMOVeS(v0, 1, v1, (u8>>(1*2))&3); @@ -2043,23 +2121,6 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } VTBLQ1_8(v0, v1, d0); } - } else { - GETGX_empty(v0); - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1); - u8 = F8; - if (u8) { - for (int i=0; i<4; ++i) { - int32_t idx = (u8>>(i*2))&3; - if(idx!=i32) { - ADDx_U12(x2, ed, idx*4); - i32 = idx; - } - VLD1_32(v0, i, x2); - } - } else { - VLDQ1R_32(v0, ed); - } } break; case 0x71: @@ -2214,21 +2275,21 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n break; case 0x74: - INST_NAME("PCMPEQB Gx,Ex"); + INST_NAME("PCMPEQB Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VCMEQQ_8(v0, v0, q0); break; case 0x75: - INST_NAME("PCMPEQW Gx,Ex"); + INST_NAME("PCMPEQW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VCMEQQ_16(v0, v0, q0); break; case 0x76: - INST_NAME("PCMPEQD Gx,Ex"); + INST_NAME("PCMPEQD Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); @@ -2240,18 +2301,15 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETGX(q1, 1); GETEX(q0, 0, 0); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { v0 = fpu_get_scratch(dyn, ninst); v1 = fpu_get_scratch(dyn, ninst); // check if any input value was NAN - // but need to mix low/high part - VTRNQ1_64(v0, q1, q0); - VTRNQ2_64(v1, q1, q0); - VFMAXQD(v0, v0, v1); // propagate NAN + VFMAXPQD(v0, q1, q0); // propagate NAN VFCMEQQD(v0, v0, v0); // 0 if NAN, 1 if not NAN } VFADDPQD(q1, q1, q0); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { VFCMEQQD(v1, q1, q1); // 0 => out is NAN VBICQ(v1, v0, v1); // forget it in any input was a NAN already VSHLQ_64(v1, v1, 63); // only keep the sign bit @@ -2266,7 +2324,19 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n v0 = fpu_get_scratch(dyn, ninst); VUZP1Q_64(v0, q0, q1); VUZP2Q_64(q0, q0, q1); + if(!BOX64ENV(dynarec_fastnan)) { + v1 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + VFMAXQD(v1, v0, q0); // propagate NAN + VFCMEQQD(v1, v1, v1); // 0 if NAN, 1 if not NAN + } VFSUBQD(q0, v0, q0); + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQD(v0, q0, q0); // 0 => out is NAN + VBICQ(v1, v1, v0); // forget it in any input was a NAN alreavy + VSHLQ_64(v1, v1, 63); // only keep the sign bit + VORRQ(q0, q0, v1); // NAN -> -NAN + } break; case 0x7E: INST_NAME("MOVD Ed,Gx"); @@ -2274,7 +2344,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(v0, 0); if(rex.w) { if(MODREG) { - ed = xRAX + (nextop&7) + (rex.b<<3); + ed = TO_NAT((nextop & 0x07) + (rex.b << 3)); VMOVQDto(ed, v0, 0); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); @@ -2283,7 +2353,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } } else { if(MODREG) { - ed = xRAX + (nextop&7) + (rex.b<<3); + ed = TO_NAT((nextop & 0x07) + (rex.b << 3)); VMOVSto(ed, v0, 0); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); @@ -2308,12 +2378,15 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0xA3: INST_NAME("BT Ew, Gw"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } nextop = F8; - gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); // GETGD + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); // GETGD if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<2, (1<<2)-1, rex, NULL, 0, 0); @@ -2322,33 +2395,43 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n LDH(x1, x3, fixedaddress); ed = x1; } - ANDw_mask(x2, gd, 0, 0b000011); // mask=0x0f - LSRw_REG(x1, ed, x2); - BFIw(xFlags, x1, F_CF, 1); + IFX(X_CF) { + ANDw_mask(x2, gd, 0, 0b000011); // mask=0x0f + LSRw_REG(x1, ed, x2); + BFIw(xFlags, x1, F_CF, 1); + } break; case 0xA4: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); INST_NAME("SHLD Ew, Gw, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETEW(x1, 1); - GETGW(x2); - u8 = F8; - emit_shld16c(dyn, ninst, ed, gd, u8, x4, x5); - EWBACK; + u8 = geted_ib(dyn, addr, ninst, nextop)&0x1f; + if(u8) { + SETFLAGS(X_ALL, SF_SET_PENDING); + GETEW(x1, 1); + GETGW(x2); + u8 = F8; + emit_shld16c(dyn, ninst, ed, gd, u8, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } break; case 0xA5: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); nextop = F8; INST_NAME("SHLD Ew, Gw, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); GETGW(x2); GETEW(x1, 0); + ANDw_mask(x4, xRCX, 0, 0b00100); //mask=0x00000001f UFLAG_IF { - ANDSw_mask(x4, xRCX, 0, 0b00100); //mask=0x00000001f - B_NEXT(cEQ); - } else { - ANDw_mask(x4, xRCX, 0, 0b00100); //mask=0x00000001f + CBZw_NEXT(x4); } emit_shld16(dyn, ninst, ed, gd, x4, x5, x6); EWBACK; @@ -2356,12 +2439,15 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0xAB: INST_NAME("BTS Ew, Gw"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } nextop = F8; - gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); // GETGD + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); // GETGD if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<2, (1<<2)-1, rex, NULL, 0, 0); @@ -2380,57 +2466,113 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n LSLw_REG(x1, x1, x2); ORRx_REG(ed, ed, x1); if(wback) { - STRH_U12(ed, wback, fixedaddress); + STH(ed, wback, fixedaddress); + SMWRITE(); } break; case 0xAC: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); nextop = F8; INST_NAME("SHRD Ew, Gw, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW(x1, 1); - GETGW(x2); - u8 = F8; - emit_shrd16c(dyn, ninst, ed, gd, u8, x4, x5); - EWBACK; + u8 = geted_ib(dyn, addr, ninst, nextop)&0x1f; + if(u8) { + SETFLAGS(X_ALL, SF_SET_PENDING); + GETEW(x1, 1); + GETGW(x2); + u8 = F8; + emit_shrd16c(dyn, ninst, ed, gd, u8, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } break; case 0xAD: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); nextop = F8; INST_NAME("SHRD Ew, Gw, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + if(BOX64DRENV(dynarec_safeflags)>1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET); + } else + SETFLAGS(X_ALL, SF_SET_PENDING); GETGW(x2); GETEW(x1, 0); + ANDw_mask(x4, xRCX, 0, 0b00100); //mask=0x00000001f UFLAG_IF { - ANDSw_mask(x4, xRCX, 0, 0b00100); //mask=0x00000001f - B_NEXT(cEQ); + CBZw_NEXT(x4); } else { - ANDw_mask(x4, xRCX, 0, 0b00100); //mask=0x00000001f } emit_shrd16(dyn, ninst, ed, gd, x4, x5, x6); EWBACK; break; - + case 0xAE: + nextop = F8; + if(MODREG) + switch (nextop) { + default: + DEFAULT; + } + else + switch((nextop>>3)&7) { + case 6: + INST_NAME("CLWB Ed"); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + DC_CIVAC(ed); + break; + case 7: + INST_NAME("CLFLUSHOPT Ed"); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + DC_CIVAC(ed); + break; + default: + DEFAULT; + } + break; case 0xAF: INST_NAME("IMUL Gw,Ew"); - SETFLAGS(X_ALL, SF_PENDING); + if (BOX64DRENV(dynarec_safeflags) && BOX64ENV(cputype)) { + SETFLAGS(X_OF|X_CF, SF_SET); + } else { + SETFLAGS(X_ALL, SF_SET); + } nextop = F8; GETSEW(x1, 0); GETSGW(x2); MULw(x2, x2, x1); - UFLAG_RES(x2); GWBACK; - UFLAG_DF(x1, d_imul16); + SET_DFNONE(); + IFX(X_CF|X_OF) { + ASRw(x1, x2, 15); + CMPSw_REG_ASR(x1, x2, 31); + CSETw(x3, cNE); + IFX(X_CF) { + BFIw(xFlags, x3, F_CF, 1); + } + IFX(X_OF) { + BFIw(xFlags, x3, F_OF, 1); + } + } + IFX2(X_AF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_AF, 1);} + IFX2(X_ZF, && !BOX64ENV(cputype)) {BFCw(xFlags, F_ZF, 1);} + IFX2(X_SF, && !BOX64ENV(cputype)) { + LSRxw(x3, gd, 15); + BFIw(xFlags, x3, F_SF, 1); + } + IFX2(X_PF, && !BOX64ENV(cputype)) emit_pf(dyn, ninst, gd, x3); break; case 0xB3: INST_NAME("BTR Ew, Gw"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } nextop = F8; - gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); // GETGD + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); // GETGD if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { SMREAD(); @@ -2454,15 +2596,16 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n break; case 0xB6: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); INST_NAME("MOVZX Gw, Eb"); nextop = F8; if(MODREG) { if(rex.rex) { - eb1 = xRAX+(nextop&7)+(rex.b<<3); + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); eb2 = 0; } else { ed = (nextop&7); - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx eb2 = (ed&4)>>2; // L or H } UBFXxw(x1, eb1, eb2*8, 8); @@ -2471,56 +2614,69 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, 0); LDB(x1, ed, fixedaddress); } - gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); // GETGW + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); // GETGW BFIx(gd, x1, 0, 16); // insert in Gw break; case 0xB7: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); INST_NAME("MOVZX Gw, Ew"); nextop = F8; if(MODREG) { - eb1 = xRAX+(nextop&7)+(rex.b<<3); + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); UBFXxw(x1, eb1, 0, 16); } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff>>1, 1, rex, NULL, 0, 0); LDH(x1, ed, fixedaddress); } - gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); // GETGW + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); // GETGW BFIx(gd, x1, 0, 16); // insert in Gw break; case 0xBA: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); nextop = F8; switch((nextop>>3)&7) { case 4: INST_NAME("BT Ew, Ib"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } gd = x2; GETEW(x1, 1); u8 = F8; u8&=rex.w?0x3f:0x0f; - BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) + IFX(X_CF) { + BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) + } break; case 5: INST_NAME("BTS Ew, Ib"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } GETEW(x1, 1); u8 = F8; u8&=(rex.w?0x3f:0x0f); IFX(X_CF) { BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) } - MOV32w(x4, 1); - BFIxw(ed, x4, u8, 1); + mask = convert_bitmask_xw(1<>12)&1, mask&0x3F, (mask>>6)&0x3F); EWBACK; break; case 6: INST_NAME("BTR Ew, Ib"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } GETEW(x1, 1); u8 = F8; u8&=(rex.w?0x3f:0x0f); @@ -2532,16 +2688,19 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n break; case 7: INST_NAME("BTC Ew, Ib"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } GETEW(x1, 1); u8 = F8; u8&=(rex.w?0x3f:0x0f); IFX(X_CF) { BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) } - MOV32w(x4, 1); - EORxw_REG_LSL(ed, ed, x4, u8); + mask = convert_bitmask_xw(1<>12)&1, mask&0x3F, (mask>>6)&0x3F); EWBACK; break; default: @@ -2549,13 +2708,17 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } break; case 0xBB: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); INST_NAME("BTC Ew, Gw"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } nextop = F8; - gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); // GETGD + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); // GETGD if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { SMREAD(); @@ -2575,56 +2738,97 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n LSLxw_REG(x1, x1, x2); EORx_REG(ed, ed, x1); if(wback) { - STRH_U12(ed, wback, fixedaddress); + STH(ed, wback, fixedaddress); SMWRITE(); } break; case 0xBC: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); INST_NAME("BSF Gw,Ew"); - SETFLAGS(X_ZF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags) || BOX64ENV(cputype)) { + SETFLAGS(X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_ALL, SF_SET); + } + SET_DFNONE(); nextop = F8; GETGD; GETEW(x1, 0); // Get EW - TSTw_REG(x1, x1); - B_MARK(cEQ); + IFX(X_ZF) { + TSTw_REG(x1, x1); + B_MARK(cEQ); + } else { + CBZw_MARK(x1); + } RBITw(x1, x1); // reverse - CLZw(x2, x1); // x2 gets leading 0 == BSF - BFIx(gd, x2, 0, 16); + CLZw(x1, x1); // x1 gets leading 0 + BFIx(gd, x1, 0, 16); MARK; - CSETw(x1, cEQ); //ZF not set - BFIw(xFlags, x1, F_ZF, 1); + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(x2, cEQ); //ZF not set + BFIw(xFlags, x2, F_ZF, 1); + } + } + if (BOX64DRENV(dynarec_safeflags) && !BOX64ENV(cputype)) { + IFX(X_CF) BFCw(xFlags, F_CF, 1); + IFX(X_AF) BFCw(xFlags, F_AF, 1); + IFX(X_SF) BFCw(xFlags, F_SF, 1); + IFX(X_OF) BFCw(xFlags, F_OF, 1); + IFX(X_PF) emit_pf(dyn, ninst, x1, x2); + } break; case 0xBD: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); INST_NAME("BSR Gw,Ew"); - SETFLAGS(X_ZF, SF_SUBSET); - SET_DFNONE(x1); + if (!BOX64DRENV(dynarec_safeflags) || BOX64ENV(cputype)) { + SETFLAGS(X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_ALL, SF_SET); + } + SET_DFNONE(); nextop = F8; GETGD; GETEW(x1, 0); // Get EW - TSTw_REG(x1, x1); // Don't use CBZ here, as the flag is reused later - B_MARK(cEQ); + IFX(X_ZF) { + TSTw_REG(x1, x1); // Don't use CBZ here, as the flag is reused later + B_MARK(cEQ); + } else { + CBZw_MARK(x1); + } LSLw(x1, x1, 16); // put bits on top CLZw(x2, x1); // x2 gets leading 0 SUBw_U12(x2, x2, 15); - NEGw_REG(x2, x2); // complement - BFIx(gd, x2, 0, 16); + NEGw_REG(x1, x2); // complement + BFIx(gd, x1, 0, 16); MARK; - CSETw(x1, cEQ); //ZF not set - BFIw(xFlags, x1, F_ZF, 1); + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(x2, cEQ); //ZF not set + BFIw(xFlags, x2, F_ZF, 1); + } + } + if (BOX64DRENV(dynarec_safeflags) && !BOX64ENV(cputype)) { + IFX(X_CF) BFCw(xFlags, F_CF, 1); + IFX(X_AF) BFCw(xFlags, F_AF, 1); + IFX(X_SF) BFCw(xFlags, F_SF, 1); + IFX(X_OF) BFCw(xFlags, F_OF, 1); + IFX(X_PF) emit_pf(dyn, ninst, x1, x2); + } break; case 0xBE: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); INST_NAME("MOVSX Gw, Eb"); nextop = F8; GETGD; if(MODREG) { if(rex.rex) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); eb1=ed; eb2=0; } else { ed = (nextop&7); - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx eb2 = (ed&4)>>2; // L or H } SBFXw(x1, eb1, eb2*8, 8); @@ -2635,14 +2839,30 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } BFIx(gd, x1, 0, 16); break; + case 0xBF: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); + INST_NAME("MOVSX Gw, Ew"); + nextop = F8; + GETGD; + if(MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + SXTHxw(x1, ed); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); + LDSHxw(x1, ed, fixedaddress); + } + BFIx(gd, x1, 0, 16); + break; case 0xC1: + if(rex.w) return dynarec64_00(dyn, addr-1, ip, ninst, rex, ok, need_epilog); INST_NAME("XADD Gw, Ew"); SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; GETGW(x1); GETEW(x2, 0); - BFIx(xRAX+((nextop&0x38)>>3)+(rex.r<<3), ed, 0, 16); + BFIx(TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)), ed, 0, 16); emit_add16(dyn, ninst, ed, gd, x4, x5); EWBACK; break; @@ -2657,23 +2877,19 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0: VFCMEQQD(v0, v0, v1); break; // Equal case 1: VFCMGTQD(v0, v1, v0); break; // Less than case 2: VFCMGEQD(v0, v1, v0); break; // Less or equal - case 3: VFCMEQQD(v0, v0, v0); - if(v0!=v1) { - q0 = fpu_get_scratch(dyn, ninst); - VFCMEQQD(q0, v1, v1); - VANDQ(v0, v0, q0); + case 3: if(v0!=v1) { + VFMAXQD(v0, v0, v1); // propagate NAN } + VFCMEQQD(v0, v0, v0); VMVNQ(v0, v0); break; // NaN (NaN is not equal to himself) case 4: VFCMEQQD(v0, v0, v1); VMVNQ(v0, v0); break; // Not Equal (or unordered on ARM, not on X86...) case 5: VFCMGTQD(v0, v1, v0); VMVNQ(v0, v0); break; // Greater or equal or unordered case 6: VFCMGEQD(v0, v1, v0); VMVNQ(v0, v0); break; // Greater or unordered - case 7: VFCMEQQD(v0, v0, v0); - if(v0!=v1) { - q0 = fpu_get_scratch(dyn, ninst); - VFCMEQQD(q0, v1, v1); - VANDQ(v0, v0, q0); + case 7: if(v0!=v1) { + VFMAXQD(v0, v0, v1); // propagate NAN } + VFCMEQQD(v0, v0, v0); break; // not NaN } break; @@ -2684,7 +2900,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(v0, 1); if(MODREG) { u8 = (F8)&7; - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); VMOVQHfrom(v0, u8, ed); } else { SMREAD(); @@ -2738,17 +2954,17 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0xCE: case 0xCF: /* BSWAP reg */ INST_NAME("BSWAP Reg"); - gd = xRAX+(opcode&7)+(rex.b<<3); + gd = TO_NAT((opcode & 7) + (rex.b << 3)); if(rex.w) { REV64x(gd, gd); } else { - REV16w(x1, gd); - BFIx(gd, x1, 0, 16); + // this is undefined behaviour + BFCx(gd, 0, 16); } break; case 0xD0: - INST_NAME("ADDSUBPD Gx,Ex"); + INST_NAME("ADDSUBPD Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -2758,7 +2974,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n VMOVeD(q0, 0, v0, 0); break; case 0xD1: - INST_NAME("PSRLW Gx,Ex"); + INST_NAME("PSRLW Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -2772,7 +2988,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n USHLQ_16(q0, q0, v0); // SHR x8 break; case 0xD2: - INST_NAME("PSRLD Gx,Ex"); + INST_NAME("PSRLD Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -2782,11 +2998,11 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n MOVI_32(v1, 32); UMIN_32(v0, v0, v1); // limit to 0 .. +32 values NEG_32(v0, v0); // neg to do shr - VDUPQ_16(v0, v0, 0); // only the low 8bits will be used anyway + VDUPQ_32(v0, v0, 0); // only the low 8bits will be used anyway USHLQ_32(q0, q0, v0); // SHR x4 break; case 0xD3: - INST_NAME("PSRLQ Gx,Ex"); + INST_NAME("PSRLQ Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -2796,18 +3012,18 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n MOVI_32(v1, 64); UMIN_32(v0, v0, v1); // limit to 0 .. +64 values NEG_32(v0, v0); // neg to do shr - VDUPQ_16(v0, v0, 0); // only the low 8bits will be used anyway + VDUPQ_32(v0, v0, 0); // only the low 8bits will be used anyway USHLQ_64(q0, q0, v0); break; case 0xD4: - INST_NAME("PADDQ Gx,Ex"); + INST_NAME("PADDQ Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VADDQ_64(v0, v0, q0); break; case 0xD5: - INST_NAME("PMULLW Gx,Ex"); + INST_NAME("PMULLW Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -2821,7 +3037,6 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7) + (rex.b<<3)); FMOVD(v1, v0); } else { - WILLWRITE2(); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); VST64(v0, ed, fixedaddress); SMWRITE2(); @@ -2829,26 +3044,27 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n break; case 0xD7: nextop = F8; - INST_NAME("PMOVMSKB Gd, Ex"); - v0 = fpu_get_scratch(dyn, ninst); - v1 = fpu_get_scratch(dyn, ninst); - q1 = fpu_get_scratch(dyn, ninst); - GETEX(q0, 0, 0); - GETGD; - TABLE64(x1, (uintptr_t)&mask_shift8); - VLDR64_U12(v0, x1, 0); // load shift - MOVI_8(v1, 0x80); // load mask - VAND(q1, v1, q0); - USHL_8(q1, q1, v0); // shift - UADDLV_8(q1, q1); // accumalte - VMOVBto(gd, q1, 0); - // and now the high part - VMOVeD(q1, 0, q0, 1); - VAND(q1, v1, q1); // keep highest bit - USHL_8(q1, q1, v0); // shift - UADDLV_8(q1, q1); // accumalte - VMOVBto(x1, q1, 0); - BFIx(gd, x1, 8, 8); + if(MODREG) { + INST_NAME("PMOVMSKB Gd, Ex"); + v0 = fpu_get_scratch(dyn, ninst); + v1 = fpu_get_scratch(dyn, ninst); + q1 = fpu_get_scratch(dyn, ninst); + GETEX(q0, 0, 0); + GETGD; + TABLE64_(x2, 0x0706050403020100LL); + VDUPQD(v0, x2); + VSHRQ_8(q1, q0, 7); + USHLQ_8(q1, q1, v0); // shift + UADDLV_8(v1, q1); // accumalte + VMOVBto(gd, v1, 0); + // and now the high part + VMOVeD(q1, 0, q1, 1); + UADDLV_8(q1, q1); // accumalte + VMOVBto(x2, q1, 0); + BFIw(gd, x2, 8, 8); + } else { + DEFAULT; + } break; case 0xD8: INST_NAME("PSUBUSB Gx, Ex"); @@ -2872,21 +3088,21 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n UMINQ_8(q0, q0, q1); break; case 0xDB: - INST_NAME("PAND Gx,Ex"); + INST_NAME("PAND Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VANDQ(v0, v0, q0); break; case 0xDC: - INST_NAME("PADDUSB Gx,Ex"); + INST_NAME("PADDUSB Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); UQADDQ_8(q0, q0, q1); break; case 0xDD: - INST_NAME("PADDUSW Gx,Ex"); + INST_NAME("PADDUSW Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -2900,7 +3116,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n UMAXQ_8(q0, q0, q1); break; case 0xDF: - INST_NAME("PANDN Gx,Ex"); + INST_NAME("PANDN Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); @@ -2914,7 +3130,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n URHADDQ_8(v0, v0, v1); break; case 0xE1: - INST_NAME("PSRAW Gx,Ex"); + INST_NAME("PSRAW Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -2928,7 +3144,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n SSHLQ_16(q0, q0, v0); break; case 0xE2: - INST_NAME("PSRAD Gx,Ex"); + INST_NAME("PSRAD Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -2942,14 +3158,14 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n SSHLQ_32(q0, q0, v0); break; case 0xE3: - INST_NAME("PAVGW Gx,Ex"); + INST_NAME("PAVGW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); URHADDQ_16(v0, v0, q0); break; case 0xE4: - INST_NAME("PMULHUW Gx,Ex"); + INST_NAME("PMULHUW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); @@ -2957,11 +3173,11 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n q1 = fpu_get_scratch(dyn, ninst); VUMULL_16(q0, v0, v1); VUMULL2_16(q1, v0, v1); - UQSHRN_16(v0, q0, 16); + UQSHRN_16(v0, q0, 16); // 16bits->16bits: no saturation UQSHRN2_16(v0, q1, 16); break; case 0xE5: - INST_NAME("PMULHW Gx,Ex"); + INST_NAME("PMULHW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); @@ -2977,95 +3193,98 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETEX(v1, 0, 0); GETGX_empty(v0); - if(box64_dynarec_fastround) { + if(BOX64ENV(dynarec_fastround)) { VFCVTZSQD(v0, v1); // convert double -> int64 SQXTN_32(v0, v0); // convert int64 -> int32 with saturation in lower part, RaZ high part } else { - MRS_fpsr(x5); - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - ORRw_mask(x4, xZR, 1, 0); //0x80000000 - d0 = fpu_get_scratch(dyn, ninst); - for(int i=0; i<2; ++i) { - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - if(i) { - VMOVeD(d0, 0, v1, i); - FCVTZSwD(x1, d0); - } else { - FCVTZSwD(x1, v1); + if(cpuext.frintts) { + VFRINT32ZDQ(v0, v1); // handle overflow + VFCVTZSQD(v0, v0); // convert double -> int64 + SQXTN_32(v0, v0); // convert int64 -> int32 with saturation in lower part, RaZ high part + } else { + MRS_fpsr(x5); + ORRw_mask(x4, xZR, 1, 0); //0x80000000 + d0 = fpu_get_scratch(dyn, ninst); + for(int i=0; i<2; ++i) { + BFCw(x5, FPSR_IOC, 1); // reset IOC bit + MSR_fpsr(x5); + if(i) { + VMOVeD(d0, 0, v1, i); + FCVTZSwD(x1, d0); + } else { + FCVTZSwD(x1, v1); + } + MRS_fpsr(x5); // get back FPSR to check the IOC bit + TBZ(x5, FPSR_IOC, 4+4); + MOVw_REG(x1, x4); + VMOVQSfrom(v0, i, x1); } - MRS_fpsr(x5); // get back FPSR to check the IOC bit - TBZ(x5, FPSR_IOC, 4+4); - MOVw_REG(x1, x4); - VMOVQSfrom(v0, i, x1); + VMOVQDfrom(v0, 1, xZR); } - VMOVQDfrom(v0, 1, xZR); } break; case 0xE7: INST_NAME("MOVNTDQ Ex, Gx"); nextop = F8; - GETGX(v0, 0); if(MODREG) { - v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7)+(rex.b<<3)); - VMOVQ(v1, v0); + DEFAULT; } else { + GETGX(v0, 0); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); VST128(v0, ed, fixedaddress); } break; case 0xE8: - INST_NAME("PSUBSB Gx,Ex"); + INST_NAME("PSUBSB Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); SQSUBQ_8(v0, v0, q0); break; case 0xE9: - INST_NAME("PSUBSW Gx,Ex"); + INST_NAME("PSUBSW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); SQSUBQ_16(v0, v0, q0); break; case 0xEA: - INST_NAME("PMINSW Gx,Ex"); + INST_NAME("PMINSW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); SMINQ_16(v0, v0, q0); break; case 0xEB: - INST_NAME("POR Gx,Ex"); + INST_NAME("POR Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VORRQ(v0, v0, q0); break; case 0xEC: - INST_NAME("PADDSB Gx,Ex"); + INST_NAME("PADDSB Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); SQADDQ_8(v0, v0, q0); break; case 0xED: - INST_NAME("PADDSW Gx,Ex"); + INST_NAME("PADDSW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); SQADDQ_16(v0, v0, q0); break; case 0xEE: - INST_NAME("PMAXSW Gx,Ex"); + INST_NAME("PMAXSW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); SMAXQ_16(v0, v0, q0); break; case 0xEF: - INST_NAME("PXOR Gx,Ex"); + INST_NAME("PXOR Gx, Ex"); nextop = F8; GETG; if(MODREG && ((nextop&7)+(rex.b<<3)==gd)) { @@ -3080,7 +3299,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n break; case 0xF1: - INST_NAME("PSLLW Gx,Ex"); + INST_NAME("PSLLW Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -3093,7 +3312,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n USHLQ_16(q0, q0, v0); break; case 0xF2: - INST_NAME("PSLLD Gx,Ex"); + INST_NAME("PSLLD Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -3106,7 +3325,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n USHLQ_32(q0, q0, v0); break; case 0xF3: - INST_NAME("PSLLQ Gx,Ex"); + INST_NAME("PSLLQ Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -3119,7 +3338,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n USHLQ_64(q0, q0, v0); break; case 0xF4: - INST_NAME("PMULUDQ Gx,Ex"); + INST_NAME("PMULUDQ Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); @@ -3162,7 +3381,7 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0xF7: INST_NAME("MASKMOVDQU Gx, Ex"); nextop = F8; - GETGX(q0, 1); + GETGX(q0, 0); GETEX(q1, 0, 0); v0 = fpu_get_scratch(dyn, ninst); VLDR128_U12(v0, xRDI, 0); @@ -3171,55 +3390,53 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n else v1 = q1; VSSHRQ_8(v1, q1, 7); // get the mask - VBICQ(v0, v0, v1); // mask destination - VANDQ(v1, q0, v1); // mask source - VORRQ(v1, v1, v0); // combine - VSTR128_U12(v1, xRDI, 0); // put back + VBITQ(v0, q0, v1); + VSTR128_U12(v0, xRDI, 0); // put back break; case 0xF8: - INST_NAME("PSUBB Gx,Ex"); + INST_NAME("PSUBB Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VSUBQ_8(v0, v0, q0); break; case 0xF9: - INST_NAME("PSUBW Gx,Ex"); + INST_NAME("PSUBW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VSUBQ_16(v0, v0, q0); break; case 0xFA: - INST_NAME("PSUBD Gx,Ex"); + INST_NAME("PSUBD Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VSUBQ_32(v0, v0, q0); break; case 0xFB: - INST_NAME("PSUBQ Gx,Ex"); + INST_NAME("PSUBQ Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VSUBQ_64(v0, v0, q0); break; case 0xFC: - INST_NAME("PADDB Gx,Ex"); + INST_NAME("PADDB Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VADDQ_8(v0, v0, q0); break; case 0xFD: - INST_NAME("PADDW Gx,Ex"); + INST_NAME("PADDW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VADDQ_16(v0, v0, q0); break; case 0xFE: - INST_NAME("PADDD Gx,Ex"); + INST_NAME("PADDD Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); diff --git a/src/dynarec/arm64/dynarec_arm64_6664.c b/src/dynarec/arm64/dynarec_arm64_6664.c deleted file mode 100644 index 4b33fab..0000000 --- a/src/dynarec/arm64/dynarec_arm64_6664.c +++ /dev/null @@ -1,269 +0,0 @@ -#include -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" - -#include "arm64_printer.h" -#include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" -#include "dynarec_arm64_functions.h" - -uintptr_t dynarec64_6664(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int seg, int* ok, int* need_epilog) -{ - (void)ip; (void)need_epilog; - - uint8_t opcode = F8; - uint8_t nextop; - uint8_t gd, ed, wb1, wback; - int64_t j64; - int16_t i16; - int v0, v1; - int64_t fixedaddress; - int unscaled; - MAYUSE(j64); - - GETREX(); - - /*if(rex.w && opcode!=0x0f) { // rex.w cancels "66", but not for 66 0f type of prefix - MESSAGE(LOG_DUMP, "Here!\n"); - return dynarec64_64(dyn, addr-2, ip, ninst, rex, rep, ok, need_epilog); - }*/ - - switch(opcode) { - - case 0x0F: - opcode = F8; - switch(opcode) { - case 0x2E: - // no special check... - case 0x2F: - if(opcode==0x2F) {INST_NAME("COMISD Gx, Ex");} else {INST_NAME("UCOMISD Gx, Ex");} - SETFLAGS(X_ALL, SF_SET); - nextop = F8; - GETG; - v0 = sse_get_reg(dyn, ninst, x1, gd, 0); - if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 0); - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - v1 = fpu_get_scratch(dyn, ninst); - VLDR64_REG(v1, ed, x4); - } - FCMPD(v0, v1); - FCOMI(x1, x2); - break; - - case 0x6F: - INST_NAME("MOVDQA Gx,Ex"); - nextop = F8; - if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); - GETGX_empty(v0); - VMOVQ(v0, v1); - } else { - GETGX_empty(v0); - grab_segdata(dyn, addr, ninst, x4, seg); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - SMREAD(); - VLDR128_REG(v0, ed, x4); - } - break; - - case 0x7F: - INST_NAME("MOVDQA Ex,Gx"); - nextop = F8; - GETGX(v0, 0); - if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1); - VMOVQ(v1, v0); - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - VSTR128_REG(v0, ed, x4); - SMWRITE2(); - } - break; - - case 0xD6: - INST_NAME("MOVQ Ex, Gx"); - nextop = F8; - GETG; - v0 = sse_get_reg(dyn, ninst, x1, gd, 0); - if(MODREG) { - v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7) + (rex.b<<3)); - FMOVD(v1, v0); - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - VSTR64_REG(v0, ed, x4); - SMWRITE(); - } - break; - - default: - DEFAULT; - } - break; - - case 0x83: - nextop = F8; - switch((nextop>>3)&7) { - case 0: //ADD - if(opcode==0x81) {INST_NAME("ADD Ew, Iw");} else {INST_NAME("ADD Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x1, seg); - GETEWO(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_add16(dyn, ninst, ed, x5, x2, x4); - EWBACK; - break; - case 1: //OR - if(opcode==0x81) {INST_NAME("OR Ew, Iw");} else {INST_NAME("OR Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x1, seg); - GETEWO(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_or16(dyn, ninst, x1, x5, x2, x4); - EWBACK; - break; - case 2: //ADC - if(opcode==0x81) {INST_NAME("ADC Ew, Iw");} else {INST_NAME("ADC Ew, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x1, seg); - GETEWO(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_adc16(dyn, ninst, x1, x5, x2, x4); - EWBACK; - break; - case 3: //SBB - if(opcode==0x81) {INST_NAME("SBB Ew, Iw");} else {INST_NAME("SBB Ew, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x1, seg); - GETEWO(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_sbb16(dyn, ninst, x1, x5, x2, x4); - EWBACK; - break; - case 4: //AND - if(opcode==0x81) {INST_NAME("AND Ew, Iw");} else {INST_NAME("AND Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x1, seg); - GETEWO(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_and16(dyn, ninst, x1, x5, x2, x4); - EWBACK; - break; - case 5: //SUB - if(opcode==0x81) {INST_NAME("SUB Ew, Iw");} else {INST_NAME("SUB Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x1, seg); - GETEWO(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_sub16(dyn, ninst, x1, x5, x2, x4); - EWBACK; - break; - case 6: //XOR - if(opcode==0x81) {INST_NAME("XOR Ew, Iw");} else {INST_NAME("XOR Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x1, seg); - GETEWO(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_xor16(dyn, ninst, x1, x5, x2, x4); - EWBACK; - break; - case 7: //CMP - if(opcode==0x81) {INST_NAME("CMP Ew, Iw");} else {INST_NAME("CMP Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x1, seg); - GETEWO(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - if(i16) { - MOVZw(x2, i16); - emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5); - } else - emit_cmp16_0(dyn, ninst, x1, x3, x4); - break; - } - break; - - case 0x89: - INST_NAME("MOV FS:Ew, Gw"); - nextop = F8; - GETGD; // don't need GETGW here - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - if(rex.w) { - MOVx_REG(ed, gd); - } else { - if(ed!=gd) { - BFIx(ed, gd, 0, 16); - } - } - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - if(rex.w) { - STRx_REG(gd, ed, x4); - } else { - STRH_REG(gd, ed, x4); - } - SMWRITE(); - } - break; - - case 0x8B: - INST_NAME("MOV Gd, FS:Ed"); - nextop=F8; - GETGD; - if(MODREG) { // reg <= reg - ed = xRAX+(nextop&7)+(rex.b<<3); - if(rex.w) { - MOVx_REG(gd, ed); - } else { - if(ed!=gd) { - BFIx(gd, ed, 0, 16); - } - } - } else { // mem <= reg - grab_segdata(dyn, addr, ninst, x4, seg); - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - if(rex.w) { - LDRx_REG(gd, ed, x4); - } else { - LDRH_REG(x1, ed, x4); - BFIx(gd, x1, 0, 16); - } - } - break; - - - default: - DEFAULT; - } - return addr; -} diff --git a/src/dynarec/arm64/dynarec_arm64_66f0.c b/src/dynarec/arm64/dynarec_arm64_66f0.c index c331170..98e023e 100644 --- a/src/dynarec/arm64/dynarec_arm64_66f0.c +++ b/src/dynarec/arm64/dynarec_arm64_66f0.c @@ -5,10 +5,9 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" #include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -18,19 +17,19 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_arm64_functions.h" -uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; (void)need_epilog; uint8_t opcode = F8; uint8_t nextop; uint8_t gd, ed, u8; uint8_t wback, wb1, wb2, gb1, gb2; - int32_t i32; + int16_t i16; int64_t i64, j64; int64_t fixedaddress; int unscaled; @@ -40,28 +39,21 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n MAYUSE(wb2); MAYUSE(j64); - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - GETREX(); - switch(opcode) { case 0x01: - INST_NAME("LOCK ADD Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGW(x5); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - UXTHw(x6, ed); - emit_add16(dyn, ninst, x6, x5, x3, x4); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK ADD Ew, Gw"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGW(x5); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { UFLAG_IF { LDADDALH(x5, x1, wback); emit_add16(dyn, ninst, x1, x5, x3, x4); @@ -75,23 +67,22 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n STLXRH(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; case 0x09: - INST_NAME("LOCK OR Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGW(x5); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - UXTHw(x6, ed); - emit_or16(dyn, ninst, x6, x5, x3, x4); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK OR Ew, Gw"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGW(x5); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { UFLAG_IF { LDSETALH(x5, x1, wback); emit_or16(dyn, ninst, x1, x5, x3, x4); @@ -105,7 +96,6 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n STLXRH(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; @@ -114,22 +104,20 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n switch(opcode) { case 0xB1: - INST_NAME("LOCK CMPXCHG Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; - UXTHw(x6, xRAX); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - wback = 0; - UXTHw(x1, ed); - CMPSxw_REG(x6, x1); - B_MARK(cNE); - BFIx(ed, gd, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK CMPXCHG Ew, Gw"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGD; + UXTHw(x6, xRAX); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); if(!ALIGNED_ATOMICH) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, wback, 1, 0, 3); // mask = F CMPSw_U12(x1, 0xF); B_MARK3(cGE); @@ -139,7 +127,7 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } } // Aligned version - if(arm64_atomics) { + if(cpuext.atomics) { MOVw_REG(x1, x6); CASALH(x1, gd, wback); } else { @@ -158,6 +146,8 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n MARK3; LDRH_U12(x1, wback, 0); LDAXRB(x3, wback); // dummy read, to arm the write... + SUBw_UXTB(x3, x3, x1); + CBNZw_MARK3(x3); CMPSw_REG(x6, x1); B_MARK(cNE); // EAX == Ed @@ -165,28 +155,27 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n CBNZx_MARK3(x4); STRH_U12(gd, wback, 0); } + MARK; + // Common part (and fallback for EAX != Ed) + UFLAG_IF {emit_cmp16(dyn, ninst, x6, x1, x3, x4, x5);} + BFIx(xRAX, x1, 0, 16); } - SMDMB(); - MARK; - // Common part (and fallback for EAX != Ed) - UFLAG_IF {emit_cmp16(dyn, ninst, x6, x1, x3, x4, x5);} - BFIx(xRAX, x1, 0, 16); break; case 0xC1: - INST_NAME("LOCK XADD Gw, Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); - UXTHx(x5, gd); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - BFIx(gd, ed, 0, 16); - emit_add16(dyn, ninst, x5, gd, x3, x4); - BFIx(ed, x5, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK XADD Gw, Ew"); + SETFLAGS(X_ALL, SF_SET_PENDING); + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); + UXTHx(x5, gd); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { LDADDALH(x5, x1, wback); } else { MARKLOCK; @@ -195,7 +184,6 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n STLXRH(x3, x4, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); IFX(X_ALL|X_PEND) { MOVxw_REG(x2, x1); emit_add16(dyn, ninst, x2, x5, x3, x4); @@ -210,40 +198,39 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n break; case 0x11: - INST_NAME("LOCK ADC Ew, Gw"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGW(x5); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - UXTHw(x6, ed); - emit_adc16(dyn, ninst, x6, x5, x3, x4); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK ADC Ew, Gw"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGW(x5); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); MARKLOCK; LDAXRH(x1, wback); emit_adc16(dyn, ninst, x1, x5, x3, x4); STLXRH(x3, x1, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } break; case 0x21: - INST_NAME("LOCK AND Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGW(x5); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - UXTHw(x6, ed); - emit_and16(dyn, ninst, x6, gd, x3, x4); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK AND Ew, Gw"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGW(x5); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { MVNw_REG(x3, gd); UFLAG_IF { LDCLRALH(x3, x1, wback); @@ -258,7 +245,6 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n STLXRH(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; @@ -267,25 +253,23 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; switch((nextop>>3)&7) { case 0: //ADD - if(opcode==0x81) { - INST_NAME("LOCK ADD Ew, Iw"); - } else { - INST_NAME("LOCK ADD Ew, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i32 = F16S; else i32 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV32w(x5, i32); - UXTHw(x6, ed); - emit_add16(dyn, ninst, x6, x5, x3, x4); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) { + INST_NAME("LOCK ADD Ew, Iw"); + } else { + INST_NAME("LOCK ADD Ew, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1); - if(opcode==0x81) i32 = F16S; else i32 = F8S; - MOV32w(x5, i32); + if(opcode==0x81) i16 = F16S; else i16 = F8S; + MOV32w(x5, i16); if(!ALIGNED_ATOMICH) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, wback, 1, 0, 3); // mask = F CMPSw_U12(x1, 0xF); B_MARK(cGE); @@ -294,159 +278,164 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n B_MARK(cNE); } } - if(arm64_atomics) { - LDADDALH(x5, x1, wback); + if(cpuext.atomics) { UFLAG_IF { - emit_add16(dyn, ninst, x1, x5, x3, x4); + LDADDALH(x5, x1, wback); + } else { + STADDLH(x5, wback); } } else { MARKLOCK; LDAXRH(x1, wback); - emit_add16(dyn, ninst, x1, x5, x3, x4); - STLXRH(x3, x1, wback); + ADDw_REG(x4, x1, x5); + STLXRH(x3, x4, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); if(!ALIGNED_ATOMICH) { - B_NEXT_nocond; + B_MARK2_nocond; MARK; // unaligned! also, not enough LDRH_U12(x1, wback, 0); LDAXRB(x4, wback); - BFIw(x1, x4, 0, 8); // re-inject - emit_add16(dyn, ninst, x1, x5, x3, x4); - STLXRB(x3, x1, wback); + SUBw_UXTB(x4, x4, x1); + CBNZw_MARK(x4); + ADDw_REG(x4, x1, x5); + STLXRB(x3, x4, wback); CBNZx_MARK(x3); - STRH_U12(x1, wback, 0); // put the whole value - SMDMB(); + STRH_U12(x4, wback, 0); // put the whole value + } + MARK2; + UFLAG_IF { + emit_add16(dyn, ninst, x1, x5, x3, x4); } } break; case 1: //OR - if(opcode==0x81) {INST_NAME("LOCK OR Ew, Iw");} else {INST_NAME("LOCK OR Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i32 = F16S; else i32 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV32w(x5, i32); - UXTHw(x6, ed); - emit_or16(dyn, ninst, x6, x5, x3, x4); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) {INST_NAME("LOCK OR Ew, Iw");} else {INST_NAME("LOCK OR Ew, Ib");} + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1); - if(opcode==0x81) i32 = F16S; else i32 = F8S; - MOV32w(x5, i32); - if(arm64_atomics) { + if(opcode==0x81) i16 = F16S; else i16 = F8S; + if(!i64) {MOV32w(x5, i16);} + if(cpuext.atomics) { UFLAG_IF { LDSETALH(x5, x1, wback); - emit_or16(dyn, ninst, x1, x5, x3, x4); + emit_or16c(dyn, ninst, x1, i16, x3, x4); } else { STSETLH(x5, wback); } } else { + i64 = convert_bitmask_w(i16); + if(!i64) {MOV32w(x5, i16);} MARKLOCK; LDAXRH(x1, wback); - emit_or16(dyn, ninst, x1, x5, x3, x4); + if(i64) { + emit_or16c(dyn, ninst, x1, i16, x3, x4); + } else { + emit_or16(dyn, ninst, x1, x5, x3, x4); + } STLXRH(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; case 2: //ADC - if(opcode==0x81) {INST_NAME("LOCK ADC Ew, Iw");} else {INST_NAME("LOCK ADC Ew, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i32 = F16S; else i32 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV32w(x5, i32); - UXTHw(x6, ed); - emit_adc16(dyn, ninst, x6, x5, x3, x4); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) {INST_NAME("LOCK ADC Ew, Iw");} else {INST_NAME("LOCK ADC Ew, Ib");} + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1); - if(opcode==0x81) i32 = F16S; else i32 = F8S; - MOV32w(x5, i32); + if(opcode==0x81) i16 = F16S; else i16 = F8S; + MOV32w(x5, i16); MARKLOCK; LDAXRH(x1, wback); emit_adc16(dyn, ninst, x1, x5, x3, x4); STLXRH(x3, x1, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } break; case 3: //SBB - if(opcode==0x81) {INST_NAME("LOCK SBB Ew, Iw");} else {INST_NAME("LOCK SBB Ew, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i32 = F16S; else i32 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV32w(x5, i32); - UXTHw(x6, ed); - emit_sbb16(dyn, ninst, x6, x5, x3, x4); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) {INST_NAME("LOCK SBB Ew, Iw");} else {INST_NAME("LOCK SBB Ew, Ib");} + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1); - if(opcode==0x81) i32 = F16S; else i32 = F8S; - MOV32w(x5, i32); + if(opcode==0x81) i16 = F16S; else i16 = F8S; + MOV32w(x5, i16); MARKLOCK; LDAXRH(x1, wback); emit_sbb16(dyn, ninst, x1, x5, x3, x4); STLXRH(x3, x1, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } break; case 4: //AND - if(opcode==0x81) {INST_NAME("LOCK AND Ew, Iw");} else {INST_NAME("LOCK AND Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i32 = F16S; else i32 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV32w(x5, i32); - UXTHw(x6, ed); - emit_and16(dyn, ninst, x6, x5, x3, x4); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) {INST_NAME("LOCK AND Ew, Iw");} else {INST_NAME("LOCK AND Ew, Ib");} + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1); - if(opcode==0x81) i32 = F16S; else i32 = F8S; - if(arm64_atomics) { - MOV32w(x5, ~i32); + if(opcode==0x81) i16 = F16S; else i16 = F8S; + i64 = convert_bitmask_w(i16); + if(cpuext.atomics) { + MOV32w(x5, ~i16); UFLAG_IF { LDCLRALH(x5, x1, wback); - MVNw_REG(x5, x5); - emit_and16(dyn, ninst, x1, x5, x3, x4); + if(i64) { + emit_and16c(dyn, ninst, x1, i16, x3, x4); + } else { + MVNw_REG(x5, x5); + emit_and16(dyn, ninst, x1, x5, x3, x4); + } } else { STCLRLH(x5, wback); } } else { - MOV32w(x5, i32); + if(!i64) {MOV32w(x5, i16);} MARKLOCK; LDAXRH(x1, wback); - emit_and16(dyn, ninst, x1, x5, x3, x4); + if(i64) { + emit_and16c(dyn, ninst, x1, i16, x3, x4); + } else { + emit_and16(dyn, ninst, x1, x5, x3, x4); + } STLXRH(x3, x1, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } } break; case 5: //SUB - if(opcode==0x81) {INST_NAME("LOCK SUB Ew, Iw");} else {INST_NAME("LOCK SUB Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i32 = F16S; else i32 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV32w(x5, i32); - UXTHw(x6, ed); - emit_sub16(dyn, ninst, x6, x5, x3, x4); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) {INST_NAME("LOCK SUB Ew, Iw");} else {INST_NAME("LOCK SUB Ew, Ib");} + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1); - if(opcode==0x81) i32 = F16S; else i32 = F8S; - MOV32w(x5, i32); + if(opcode==0x81) i16 = F16S; else i16 = F8S; + MOV32w(x5, i16); if(!ALIGNED_ATOMICH) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, wback, 1, 0, 3); // mask = F CMPSw_U12(x1, 0xF); B_MARK(cGE); @@ -455,80 +444,75 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n B_MARK(cNE); } } - if(arm64_atomics) { + if(cpuext.atomics) { NEGw_REG(x4, x5); UFLAG_IF { LDADDALH(x4, x1, wback); - emit_sub16(dyn, ninst, x1, x5, x3, x4); } else { STADDLH(x4, wback); } } else { MARKLOCK; LDAXRH(x1, wback); - emit_sub16(dyn, ninst, x1, x5, x3, x4); + SUBw_REG(x4, x1, x5); STLXRH(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); if(!ALIGNED_ATOMICH) { - B_NEXT_nocond; + B_MARK2_nocond; MARK; // unaligned! also, not enough LDRH_U12(x1, wback, 0); LDAXRB(x4, wback); - BFIw(x1, x4, 0, 8); // re-inject - emit_sub16(dyn, ninst, x1, x5, x3, x4); - STLXRB(x3, x1, wback); + SUBw_UXTB(x4, x4, x1); + CBNZw_MARK(x4); + SUBw_REG(x4, x1, x5); + STLXRB(x3, x4, wback); CBNZx_MARK(x3); - STRH_U12(x1, wback, 0); // put the whole value - SMDMB(); + STRH_U12(x4, wback, 0); // put the whole value + } + MARK2; + UFLAG_IF { + emit_sub16(dyn, ninst, x1, x5, x3, x4); } } break; case 6: //XOR - if(opcode==0x81) {INST_NAME("LOCK XOR Ew, Iw");} else {INST_NAME("LOCK XOR Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i32 = F16S; else i32 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV32w(x5, i32); - UXTHw(x6, ed); - emit_xor16(dyn, ninst, x6, x5, x3, x4); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) {INST_NAME("LOCK XOR Ew, Iw");} else {INST_NAME("LOCK XOR Ew, Ib");} + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1); - if(opcode==0x81) i32 = F16S; else i32 = F8S; - MOV32w(x5, i32); - if(arm64_atomics) { + if(opcode==0x81) i16 = F16S; else i16 = F8S; + i64 = convert_bitmask_w(i16); + if(cpuext.atomics) { UFLAG_IF { LDEORALH(x5, x1, wback); - emit_xor16(dyn, ninst, x1, x5, x3, x4); + emit_xor16c(dyn, ninst, x1, i16, x3, x4); } else { STEORLH(x5, wback); } } else { + if(!i64) {MOV32w(x5, i16);} MARKLOCK; LDAXRH(x1, wback); - emit_xor16(dyn, ninst, x1, x5, x3, x4); + if(i64) + emit_xor16c(dyn, ninst, x1, i16, x3, x4); + else + emit_xor16(dyn, ninst, x1, x5, x3, x4); STLXRH(x3, x1, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } } break; case 7: //CMP - if(opcode==0x81) {INST_NAME("(LOCK) CMP Ew, Iw");} else {INST_NAME("(LOCK) CMP Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW(x6, (opcode==0x81)?2:1); - (void)wb1; - // No need to LOCK, this is readonly - if(opcode==0x81) i32 = F16S; else i32 = F8S; - if(i32) { - MOV32w(x5, i32); - emit_cmp16(dyn, ninst, x6, x5, x3, x4, x6); - } else { - emit_cmp16_0(dyn, ninst, ed, x3, x4); - } + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; break; } break; @@ -538,16 +522,16 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n switch((nextop>>3)&7) { case 0: // INC Ew - INST_NAME("LOCK INC Ew"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - UXTHw(x6, ed); - emit_inc16(dyn, ninst, x6, x5, x3); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK INC Ew"); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { MOV32w(x3, 1); UFLAG_IF { LDADDALH(x3, x1, wback); @@ -562,20 +546,19 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n STLXRH(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; case 1: //DEC Ew - INST_NAME("LOCK DEC Ew"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - UXTHw(x6, ed); - emit_dec16(dyn, ninst, x6, x5, x3); - BFIx(ed, x6, 0, 16); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK DEC Ew"); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { MOV32w(x3, -1); UFLAG_IF { LDADDALH(x3, x1, wback); @@ -590,7 +573,6 @@ uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n STLXRH(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; default: diff --git a/src/dynarec/arm64/dynarec_arm64_66f20f.c b/src/dynarec/arm64/dynarec_arm64_66f20f.c index 869cf30..777f110 100644 --- a/src/dynarec/arm64/dynarec_arm64_66f20f.c +++ b/src/dynarec/arm64/dynarec_arm64_66f20f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,7 +17,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "emu/x64compstrings.h" uintptr_t dynarec64_66F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) @@ -47,12 +45,6 @@ uintptr_t dynarec64_66F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int MAYUSE(eb1); MAYUSE(eb2); MAYUSE(j64); - #if STEP > 1 - static const int8_t mask_shift8[] = { -7, -6, -5, -4, -3, -2, -1, 0 }; - static const int8_t mask_string8[] = { 7, 6, 5, 4, 3, 2, 1, 0 }; - static const int8_t mask_string16[] = { 15, 14, 13, 12, 11, 10, 9, 8 }; - static const int8_t round_round[] = { 0, 2, 1, 3}; - #endif switch(opcode) { @@ -61,11 +53,12 @@ uintptr_t dynarec64_66F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int switch(opcode) { case 0xF1: + if (rex.w) return dynarec64_F20F(dyn, addr - 2, ip, ninst, rex, ok, need_epilog); INST_NAME("CRC32 Gd, Ew"); nextop = F8; GETEW(x1, 0); GETGD; - if(arm64_crc32) { + if(cpuext.crc32) { CRC32CH(gd, gd, ed); } else { MOV32w(x2, 0x82f63b78); diff --git a/src/dynarec/arm64/dynarec_arm64_66f30f.c b/src/dynarec/arm64/dynarec_arm64_66f30f.c index 11a18eb..05ab3c5 100644 --- a/src/dynarec/arm64/dynarec_arm64_66f30f.c +++ b/src/dynarec/arm64/dynarec_arm64_66f30f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,7 +17,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "emu/x64compstrings.h" uintptr_t dynarec64_66F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) @@ -47,15 +45,111 @@ uintptr_t dynarec64_66F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int MAYUSE(eb1); MAYUSE(eb2); MAYUSE(j64); - #if STEP > 1 - static const int8_t mask_shift8[] = { -7, -6, -5, -4, -3, -2, -1, 0 }; - static const int8_t mask_string8[] = { 7, 6, 5, 4, 3, 2, 1, 0 }; - static const int8_t mask_string16[] = { 15, 14, 13, 12, 11, 10, 9, 8 }; - static const int8_t round_round[] = { 0, 2, 1, 3}; - #endif switch(opcode) { + case 0xB8: + INST_NAME("POPCNT Gw, Ew"); + SETFLAGS(X_ALL, SF_SET); + SET_DFNONE(); + nextop = F8; + GETGW(x2); + GETEW(x1, 0); + v1 = fpu_get_scratch(dyn, ninst); + VEORQ(v1, v1, v1); + VMOVQDfrom(v1, 0, ed); + CNT_8(v1, v1); + UADDLV_8(v1, v1); + VMOVHto(gd, v1, 0); + IFX(X_ALL) { + IFX(X_AF|X_PF|X_SF|X_OF|X_CF) { + MOV32w(x1, (1< -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" -#include "custommem.h" - -#include "arm64_printer.h" -#include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" -#include "dynarec_arm64_functions.h" - -#define GETGm gd = ((nextop&0x38)>>3) - -uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) -{ - (void)ip; (void)need_epilog; - - uint8_t opcode = F8; - uint8_t nextop; - uint8_t gd, ed, wback, wb, wb1, wb2, gb1, gb2, eb1, eb2; - int64_t fixedaddress; - int unscaled; - int8_t i8; - uint8_t u8; - int32_t i32; - int64_t j64, i64; - int16_t i16; - int cacheupd = 0; - int lock; - int v0, v1, s0; - MAYUSE(i32); - MAYUSE(j64); - MAYUSE(v0); - MAYUSE(v1); - MAYUSE(s0); - MAYUSE(lock); - MAYUSE(cacheupd); - - if(rex.is32bits) { - // should do a different file - DEFAULT; - return addr; - } - - GETREX(); - - while(opcode==0x67) opcode = F8; - - rep = 0; - while((opcode==0xF2) || (opcode==0xF3) || (opcode>=0x40 && opcode<=0x4F)) { - if((opcode==0xF2) || (opcode==0xF3)) - rep = opcode-0xF1; - if(opcode>=0x40 && opcode<=0x4F) - rex.rex = opcode; - opcode = F8; - } - - switch(opcode) { - case 0x00: - INST_NAME("ADD Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x1, 0); - GETGB(x2); - emit_add8(dyn, ninst, x1, x2, x4, x5); - EBBACK; - break; - case 0x01: - INST_NAME("ADD Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_add32(dyn, ninst, rex, ed, gd, x3, x4); - WBACK; - break; - case 0x02: - INST_NAME("ADD Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_add8(dyn, ninst, x1, x2, x3, x4); - GBBACK; - break; - case 0x03: - INST_NAME("ADD Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_add32(dyn, ninst, rex, gd, ed, x3, x4); - break; - case 0x04: - INST_NAME("ADD AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - u8 = F8; - UXTBw(x1, xRAX); - emit_add8c(dyn, ninst, x1, u8, x3, x4); - BFIx(xRAX, x1, 0, 8); - break; - case 0x05: - INST_NAME("ADD EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - emit_add32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5); - break; - - case 0x08: - INST_NAME("OR Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x1, 0); - GETGB(x2); - emit_or8(dyn, ninst, x1, x2, x4, x2); - EBBACK; - break; - case 0x09: - INST_NAME("OR Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_or32(dyn, ninst, rex, ed, gd, x3, x4); - WBACK; - break; - case 0x0A: - INST_NAME("OR Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_or8(dyn, ninst, x1, x2, x3, x4); - GBBACK; - break; - case 0x0B: - INST_NAME("OR Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_or32(dyn, ninst, rex, gd, ed, x3, x4); - break; - case 0x0C: - INST_NAME("OR AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - u8 = F8; - UXTBw(x1, xRAX); - emit_or8c(dyn, ninst, x1, u8, x3, x4); - BFIx(xRAX, x1, 0, 8); - break; - case 0x0D: - INST_NAME("OR EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - emit_or32c(dyn, ninst, rex, xRAX, i64, x3, x4); - break; - - case 0x0F: - opcode=F8; - switch(opcode) { - - case 0x11: - switch(rep) { - case 0: - INST_NAME("MOVUPS Ex,Gx"); - nextop = F8; - GETG; - v0 = sse_get_reg(dyn, ninst, x1, gd, 0); - if(MODREG) { - ed = (nextop&7)+(rex.b<<3); - v1 = sse_get_reg_empty(dyn, ninst, x1, ed); - VMOVQ(v1, v0); - } else { - addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); - VST128(v0, ed, fixedaddress); - SMWRITE2(); - } - break; - default: - DEFAULT; - } - break; - - case 0x2E: - // no special check... - case 0x2F: - switch(rep) { - case 0: - if(opcode==0x2F) {INST_NAME("COMISS Gx, Ex");} else {INST_NAME("UCOMISS Gx, Ex");} - SETFLAGS(X_ALL, SF_SET); - nextop = F8; - GETGX(v0, 0); - if(MODREG) { - s0 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 0); - } else { - s0 = fpu_get_scratch(dyn, ninst); - SMREAD(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); - VLD32(s0, ed, fixedaddress); - } - FCMPS(v0, s0); - FCOMI(x1, x2); - break; - default: - DEFAULT; - } - break; - - case 0x6F: - switch(rep) { - case 0: - INST_NAME("MOVQ Gm, Em"); - nextop = F8; - GETGm; - if(MODREG) { - v1 = mmx_get_reg(dyn, ninst, x1, x2, x3, nextop&7); // no rex.b on MMX - v0 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, gd); - VMOV(v0, v1); - } else { - v0 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, gd); - SMREAD(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); - VLD64(v0, ed, fixedaddress); - } - break; - case 2: - INST_NAME("MOVDQU Gx,Ex"); - nextop = F8; - if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); - GETGX_empty(v0); - VMOVQ(v0, v1); - } else { - GETGX_empty(v0); - SMREAD(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); - VLD128(v0, ed, fixedaddress); - } - break; - default: - DEFAULT; - } - break; - - case 0x7F: - switch(rep) { - case 0: - INST_NAME("MOVQ Em, Gm"); - nextop = F8; - GETGM(v0); - if(MODREG) { - v1 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, nextop&7); - VMOV(v1, v0); - } else { - addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); - VST64(v0, ed, fixedaddress); - SMWRITE(); - } - break; - default: - DEFAULT; - } - break; - - case 0xB6: - INST_NAME("MOVZX Gd, Eb"); - nextop = F8; - GETGD; - if(MODREG) { - if(rex.rex) { - eb1 = xRAX+(nextop&7)+(rex.b<<3); - eb2 = 0; - } else { - ed = (nextop&7); - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx - eb2 = (ed&4)>>2; // L or H - } - UBFXxw(gd, eb1, eb2*8, 8); - } else { - SMREAD(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, 0); - LDB(gd, ed, fixedaddress); - } - break; - case 0xB7: - INST_NAME("MOVZX Gd, Ew"); - nextop = F8; - GETGD; - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - UBFXxw(gd, ed, 0, 16); - } else { - SMREAD(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); - LDH(gd, ed, fixedaddress); - } - break; - - default: - DEFAULT; - } - break; - - case 0x10: - INST_NAME("ADC Eb, Gb"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x1, 0); - GETGB(x2); - emit_adc8(dyn, ninst, x1, x2, x4, x5); - EBBACK; - break; - case 0x11: - INST_NAME("ADC Ed, Gd"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_adc32(dyn, ninst, rex, ed, gd, x3, x4); - WBACK; - break; - case 0x12: - INST_NAME("ADC Gb, Eb"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_adc8(dyn, ninst, x1, x2, x4, x3); - GBBACK; - break; - case 0x13: - INST_NAME("ADC Gd, Ed"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_adc32(dyn, ninst, rex, gd, ed, x3, x4); - break; - case 0x14: - INST_NAME("ADC AL, Ib"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - u8 = F8; - UXTBw(x1, xRAX); - emit_adc8c(dyn, ninst, x1, u8, x3, x4, x5); - BFIx(xRAX, x1, 0, 8); - break; - case 0x15: - INST_NAME("ADC EAX, Id"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - MOV64xw(x1, i64); - emit_adc32(dyn, ninst, rex, xRAX, x1, x3, x4); - break; - - case 0x18: - INST_NAME("SBB Eb, Gb"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x1, 0); - GETGB(x2); - emit_sbb8(dyn, ninst, x1, x2, x4, x5); - EBBACK; - break; - case 0x19: - INST_NAME("SBB Ed, Gd"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_sbb32(dyn, ninst, rex, ed, gd, x3, x4); - WBACK; - break; - case 0x1A: - INST_NAME("SBB Gb, Eb"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_sbb8(dyn, ninst, x1, x2, x3, x4); - GBBACK; - break; - case 0x1B: - INST_NAME("SBB Gd, Ed"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_sbb32(dyn, ninst, rex, gd, ed, x3, x4); - break; - case 0x1C: - INST_NAME("SBB AL, Ib"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - u8 = F8; - UXTBw(x1, xRAX); - emit_sbb8c(dyn, ninst, x1, u8, x3, x4, x5); - BFIx(xRAX, x1, 0, 8); - break; - case 0x1D: - INST_NAME("SBB EAX, Id"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - MOV64xw(x2, i64); - emit_sbb32(dyn, ninst, rex, xRAX, x2, x3, x4); - break; - - case 0x20: - INST_NAME("AND Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x1, 0); - GETGB(x2); - emit_and8(dyn, ninst, x1, x2, x4, x5); - EBBACK; - break; - case 0x21: - INST_NAME("AND Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_and32(dyn, ninst, rex, ed, gd, x3, x4); - WBACK; - break; - case 0x22: - INST_NAME("AND Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_and8(dyn, ninst, x1, x2, x3, x4); - GBBACK; - break; - case 0x23: - INST_NAME("AND Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_and32(dyn, ninst, rex, gd, ed, x3, x4); - break; - case 0x24: - INST_NAME("AND AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - u8 = F8; - UXTBw(x1, xRAX); - emit_and8c(dyn, ninst, x1, u8, x3, x4); - BFIx(xRAX, x1, 0, 8); - break; - case 0x25: - INST_NAME("AND EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - emit_and32c(dyn, ninst, rex, xRAX, i64, x3, x4); - break; - - case 0x28: - INST_NAME("SUB Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x1, 0); - GETGB(x2); - emit_sub8(dyn, ninst, x1, x2, x4, x5); - EBBACK; - break; - case 0x29: - INST_NAME("SUB Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_sub32(dyn, ninst, rex, ed, gd, x3, x4); - WBACK; - break; - case 0x2A: - INST_NAME("SUB Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_sub8(dyn, ninst, x1, x2, x3, x4); - GBBACK; - break; - case 0x2B: - INST_NAME("SUB Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_sub32(dyn, ninst, rex, gd, ed, x3, x4); - break; - case 0x2C: - INST_NAME("SUB AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - u8 = F8; - UXTBw(x1, xRAX); - emit_sub8c(dyn, ninst, x1, u8, x3, x4, x5); - BFIx(xRAX, x1, 0, 8); - break; - case 0x2D: - INST_NAME("SUB EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - emit_sub32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5); - break; - - case 0x30: - INST_NAME("XOR Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x1, 0); - GETGB(x2); - emit_xor8(dyn, ninst, x1, x2, x4, x5); - EBBACK; - break; - case 0x31: - INST_NAME("XOR Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_xor32(dyn, ninst, rex, ed, gd, x3, x4); - WBACK; - break; - case 0x32: - INST_NAME("XOR Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_xor8(dyn, ninst, x1, x2, x3, x4); - GBBACK; - break; - case 0x33: - INST_NAME("XOR Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_xor32(dyn, ninst, rex, gd, ed, x3, x4); - break; - case 0x34: - INST_NAME("XOR AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - u8 = F8; - UXTBw(x1, xRAX); - emit_xor8c(dyn, ninst, x1, u8, x3, x4); - BFIx(xRAX, x1, 0, 8); - break; - case 0x35: - INST_NAME("XOR EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - emit_xor32c(dyn, ninst, rex, xRAX, i64, x3, x4); - break; - - case 0x38: - INST_NAME("CMP Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x1, 0); - GETGB(x2); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5); - break; - case 0x39: - INST_NAME("CMP Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_cmp32(dyn, ninst, rex, ed, gd, x3, x4, x5); - break; - case 0x3A: - INST_NAME("CMP Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5); - break; - case 0x3B: - INST_NAME("CMP Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_cmp32(dyn, ninst, rex, gd, ed, x3, x4, x5); - break; - case 0x3C: - INST_NAME("CMP AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - u8 = F8; - UXTBw(x1, xRAX); - if(u8) { - MOV32w(x2, u8); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5); - } else { - emit_cmp8_0(dyn, ninst, x1, x3, x4); - } - break; - case 0x3D: - INST_NAME("CMP EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - if(i64) { - MOV64xw(x2, i64); - emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5); - } else - emit_cmp32_0(dyn, ninst, rex, xRAX, x3, x4); - break; - - case 0x63: - INST_NAME("MOVSXD Gd, Ed"); - nextop = F8; - GETGD; - if(rex.w) { - if(MODREG) { // reg <= reg - SXTWx(gd, xRAX+(nextop&7)+(rex.b<<3)); - } else { // mem <= reg - SMREAD(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); - LDSW(gd, ed, fixedaddress); - } - } else { - if(MODREG) { // reg <= reg - MOVw_REG(gd, xRAX+(nextop&7)+(rex.b<<3)); - } else { // mem <= reg - SMREAD(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); - LDW(gd, ed, fixedaddress); - } - } - break; - - case 0x66: - opcode=F8; - GETREX(); - switch(opcode) { - - case 0x0F: - nextop = F8; - switch(nextop) { - case 0xD6: - INST_NAME("MOVQ Ex, Gx"); - nextop = F8; - GETGX(v0, 0); - if(MODREG) { - v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7) + (rex.b<<3)); - FMOVD(v1, v0); - } else { - WILLWRITE2(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); - VST64(v0, ed, fixedaddress); - SMWRITE2(); - } - break; - - default: - DEFAULT; - } - break; - - case 0x81: - case 0x83: - nextop = F8; - switch((nextop>>3)&7) { - case 0: //ADD - if(opcode==0x81) {INST_NAME("ADD Ew, Iw");} else {INST_NAME("ADD Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW32(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_add16(dyn, ninst, ed, x5, x2, x4); - EWBACK; - break; - case 1: //OR - if(opcode==0x81) {INST_NAME("OR Ew, Iw");} else {INST_NAME("OR Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW32(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_or16(dyn, ninst, x1, x5, x2, x4); - EWBACK; - break; - case 2: //ADC - if(opcode==0x81) {INST_NAME("ADC Ew, Iw");} else {INST_NAME("ADC Ew, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW32(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_adc16(dyn, ninst, x1, x5, x2, x4); - EWBACK; - break; - case 3: //SBB - if(opcode==0x81) {INST_NAME("SBB Ew, Iw");} else {INST_NAME("SBB Ew, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW32(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_sbb16(dyn, ninst, x1, x5, x2, x4); - EWBACK; - break; - case 4: //AND - if(opcode==0x81) {INST_NAME("AND Ew, Iw");} else {INST_NAME("AND Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW32(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_and16(dyn, ninst, x1, x5, x2, x4); - EWBACK; - break; - case 5: //SUB - if(opcode==0x81) {INST_NAME("SUB Ew, Iw");} else {INST_NAME("SUB Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW32(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_sub16(dyn, ninst, x1, x5, x2, x4); - EWBACK; - break; - case 6: //XOR - if(opcode==0x81) {INST_NAME("XOR Ew, Iw");} else {INST_NAME("XOR Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW32(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - MOVZw(x5, i16); - emit_xor16(dyn, ninst, x1, x5, x2, x4); - EWBACK; - break; - case 7: //CMP - if(opcode==0x81) {INST_NAME("CMP Ew, Iw");} else {INST_NAME("CMP Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW32(x1, (opcode==0x81)?2:1); - if(opcode==0x81) i16 = F16S; else i16 = F8S; - if(i16) { - MOVZw(x2, i16); - emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5); - } else - emit_cmp16_0(dyn, ninst, x1, x3, x4); - break; - } - break; - case 0x89: - INST_NAME("MOV Ew, Gw"); - nextop = F8; - GETGD; // don't need GETGW here - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - if(ed!=gd) { - BFIx(ed, gd, 0, 16); - } - } else { - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, &lock, 0, 0); - WILLWRITELOCK(lock); - STH(gd, ed, fixedaddress); - SMWRITELOCK(lock); - } - break; - - case 0x8D: - INST_NAME("LEA Gw, Ed"); - nextop=F8; - //GETGW(x1); - gd = x1; // no need to read - if(MODREG) { // reg <= reg? that's an invalid operation - DEFAULT; - } else { // mem <= reg - addr = geted32(dyn, addr, ninst, nextop, &ed, gd, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - if(ed!=gd) - gd = ed; - } - GWBACK; - break; - - default: - DEFAULT; - } - break; - - case 0x6B: - INST_NAME("IMUL Gd, Ed, Ib"); - SETFLAGS(X_ALL, SF_PENDING); - nextop = F8; - GETGD; - GETED32(1); - i64 = F8S; - MOV64xw(x4, i64); - if(rex.w) { - // 64bits imul - UFLAG_IF { - SMULH(x3, ed, x4); - MULx(gd, ed, x4); - UFLAG_OP1(x3); - UFLAG_RES(gd); - UFLAG_DF(x3, d_imul64); - } else { - MULxw(gd, ed, x4); - } - } else { - // 32bits imul - UFLAG_IF { - SMULL(gd, ed, x4); - UFLAG_RES(gd); - LSRx(x3, gd, 32); - UFLAG_OP1(x3); - UFLAG_DF(x3, d_imul32); - MOVw_REG(gd, gd); - } else { - MULxw(gd, ed, x4); - } - } - break; - - case 0x81: - case 0x83: - nextop = F8; - switch((nextop>>3)&7) { - case 0: //ADD - if(opcode==0x81) {INST_NAME("ADD Ed, Id");} else {INST_NAME("ADD Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5); - WBACK; - break; - case 1: //OR - if(opcode==0x81) {INST_NAME("OR Ed, Id");} else {INST_NAME("OR Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_or32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACK; - break; - case 2: //ADC - if(opcode==0x81) {INST_NAME("ADC Ed, Id");} else {INST_NAME("ADC Ed, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - MOV64xw(x5, i64); - emit_adc32(dyn, ninst, rex, ed, x5, x3, x4); - WBACK; - break; - case 3: //SBB - if(opcode==0x81) {INST_NAME("SBB Ed, Id");} else {INST_NAME("SBB Ed, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - MOV64xw(x5, i64); - emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4); - WBACK; - break; - case 4: //AND - if(opcode==0x81) {INST_NAME("AND Ed, Id");} else {INST_NAME("AND Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_and32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACK; - break; - case 5: //SUB - if(opcode==0x81) {INST_NAME("SUB Ed, Id");} else {INST_NAME("SUB Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_sub32c(dyn, ninst, rex, ed, i64, x3, x4, x5); - WBACK; - break; - case 6: //XOR - if(opcode==0x81) {INST_NAME("XOR Ed, Id");} else {INST_NAME("XOR Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_xor32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACK; - break; - case 7: //CMP - if(opcode==0x81) {INST_NAME("CMP Ed, Id");} else {INST_NAME("CMP Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - if(i64) { - MOV64xw(x2, i64); - emit_cmp32(dyn, ninst, rex, ed, x2, x3, x4, x5); - } else - emit_cmp32_0(dyn, ninst, rex, ed, x3, x4); - break; - } - break; - - case 0x88: - INST_NAME("MOV Eb, Gb"); - nextop = F8; - gd = ((nextop&0x38)>>3)+(rex.r<<3); - if(rex.rex) { - gb2 = 0; - gb1 = xRAX + gd; - } else { - gb2 = ((gd&4)<<1); - gb1 = xRAX+(gd&3); - } - if(gb2) { - gd = x4; - UBFXw(gd, gb1, gb2, 8); - } else { - gd = gb1; // no need to extract - } - if(MODREG) { - ed = (nextop&7) + (rex.b<<3); - if(rex.rex) { - eb1 = xRAX+ed; - eb2 = 0; - } else { - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx - eb2 = ((ed&4)>>2); // L or H - } - BFIx(eb1, gd, eb2*8, 8); - } else { - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, &lock, 0, 0); - WILLWRITELOCK(lock); - STB(gd, ed, fixedaddress); - SMWRITELOCK(lock); - } - break; - case 0x89: - INST_NAME("MOV Ed, Gd"); - nextop=F8; - GETGD; - if(MODREG) { // reg <= reg - MOVxw_REG(xRAX+(nextop&7)+(rex.b<<3), gd); - } else { // mem <= reg - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0); - WILLWRITELOCK(lock); - STxw(gd, ed, fixedaddress); - SMWRITELOCK(lock); - } - break; - case 0x8A: - INST_NAME("MOV Gb, Eb"); - nextop = F8; - if(rex.rex) { - gb1 = gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); - gb2=0; - } else { - gd = (nextop&0x38)>>3; - gb1 = xRAX+(gd&3); - gb2 = ((gd&4)<<1); - } - if(MODREG) { - if(rex.rex) { - wback = xRAX+(nextop&7)+(rex.b<<3); - wb2 = 0; - } else { - wback = (nextop&7); - wb2 = (wback>>2); - wback = xRAX+(wback&3); - } - if(wb2) { - UBFXw(x4, wback, wb2*8, 8); - ed = x4; - } else { - ed = wback; - } - } else { - addr = geted32(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, &lock, 0, 0); - SMREADLOCK(lock); - LDB(x4, wback, fixedaddress); - ed = x4; - } - BFIx(gb1, ed, gb2, 8); - break; - case 0x8B: - INST_NAME("MOV Gd, Ed"); - nextop=F8; - GETGD; - if(MODREG) { - MOVxw_REG(gd, xRAX+(nextop&7)+(rex.b<<3)); - } else { - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0); - SMREADLOCK(lock); - LDxw(gd, ed, fixedaddress); - } - break; - - case 0x8D: - INST_NAME("LEA Gd, Ed"); - nextop=F8; - GETGD; - if(MODREG) { // reg <= reg? that's an invalid operation - DEFAULT; - } else { // mem <= reg - addr = geted32(dyn, addr, ninst, nextop, &ed, gd, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - if(ed!=gd) { - MOVw_REG(gd, ed); - } - } - break; - - case 0xC1: - nextop = F8; - switch((nextop>>3)&7) { - case 0: - INST_NAME("ROL Ed, Ib"); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); - GETED32(1); - u8 = (F8)&(rex.w?0x3f:0x1f); - emit_rol32c(dyn, ninst, rex, ed, u8, x3, x4); - if(u8) { WBACK; } - break; - case 1: - INST_NAME("ROR Ed, Ib"); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); - GETED32(1); - u8 = (F8)&(rex.w?0x3f:0x1f); - emit_ror32c(dyn, ninst, rex, ed, u8, x3, x4); - if(u8) { WBACK; } - break; - case 2: - INST_NAME("RCL Ed, Ib"); - READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose - GETED32(1); - u8 = (F8)&(rex.w?0x3f:0x1f); - emit_rcl32c(dyn, ninst, rex, ed, u8, x3, x4); - if(u8) { WBACK; } - break; - case 3: - INST_NAME("RCR Ed, Ib"); - READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SUBSET); // removed PENDING on purpose - GETED32(1); - u8 = (F8)&(rex.w?0x3f:0x1f); - emit_rcr32c(dyn, ninst, rex, ed, u8, x3, x4); - if(u8) { WBACK; } - break; - case 4: - case 6: - INST_NAME("SHL Ed, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - GETED32(1); - u8 = (F8)&(rex.w?0x3f:0x1f); - emit_shl32c(dyn, ninst, rex, ed, u8, x3, x4); - WBACK; - break; - case 5: - INST_NAME("SHR Ed, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - GETED32(1); - u8 = (F8)&(rex.w?0x3f:0x1f); - emit_shr32c(dyn, ninst, rex, ed, u8, x3, x4); - if(u8) { - WBACK; - } - break; - case 7: - INST_NAME("SAR Ed, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - GETED32(1); - u8 = (F8)&(rex.w?0x3f:0x1f); - emit_sar32c(dyn, ninst, rex, ed, u8, x3, x4); - if(u8) { - WBACK; - } - break; - } - break; - - case 0xC4: - nextop = F8; - if(rex.is32bits && !(MODREG)) { - DEFAULT; - } else { - if(rex.is32bits) { - DEFAULT; - return addr; - } - vex_t vex = {0}; - vex.rex = rex; - u8 = nextop; - vex.m = u8&0b00011111; - vex.rex.b = (u8&0b00100000)?0:1; - vex.rex.x = (u8&0b01000000)?0:1; - vex.rex.r = (u8&0b10000000)?0:1; - u8 = F8; - vex.p = u8&0b00000011; - vex.l = (u8>>2)&1; - vex.v = ((~u8)>>3)&0b1111; - vex.rex.w = (u8>>7)&1; - addr = dynarec64_67_AVX(dyn, addr, ip, ninst, vex, ok, need_epilog); - } - break; - case 0xC5: - nextop = F8; - if(rex.is32bits && !(MODREG)) { - DEFAULT; - } else { - if(rex.is32bits) { - DEFAULT; - return addr; - } - vex_t vex = {0}; - vex.rex = rex; - u8 = nextop; - vex.p = u8&0b00000011; - vex.l = (u8>>2)&1; - vex.v = ((~u8)>>3)&0b1111; - vex.rex.r = (u8&0b10000000)?0:1; - vex.rex.b = 0; - vex.rex.x = 0; - vex.rex.w = 0; - vex.m = VEX_M_0F; - addr = dynarec64_67_AVX(dyn, addr, ip, ninst, vex, ok, need_epilog); - } - break; - case 0xC6: - INST_NAME("MOV Eb, Ib"); - nextop=F8; - if(MODREG) { // reg <= u8 - u8 = F8; - if(!rex.rex) { - ed = (nextop&7); - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx - eb2 = (ed&4)>>2; // L or H - } else { - eb1 = xRAX+(nextop&7)+(rex.b<<3); - eb2 = 0; - } - MOV32w(x3, u8); - BFIx(eb1, x3, eb2*8, 8); - } else { // mem <= u8 - addr = geted32(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, &unscaled, 0xfff, 0, rex, &lock, 0, 1); - u8 = F8; - if(u8) { - MOV32w(x3, u8); - ed = x3; - } else - ed = xZR; - WILLWRITELOCK(lock); - STB(ed, wback, fixedaddress); - SMWRITELOCK(lock); - } - break; - case 0xC7: - INST_NAME("MOV Ed, Id"); - nextop=F8; - if(MODREG) { // reg <= i32 - i64 = F32S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV64xw(ed, i64); - } else { // mem <= i32 - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 4); - i64 = F32S; - MOV64xw(x3, i64); - WILLWRITELOCK(lock); - STxw(x3, ed, fixedaddress); - SMWRITELOCK(lock); - } - break; - - - #define GO(NO, YES) \ - BARRIER(BARRIER_MAYBE); \ - JUMP(addr+i8, 1); \ - if(dyn->insts[ninst].x64.jmp_insts==-1 || \ - CHECK_CACHE()) { \ - /* out of the block */ \ - i32 = dyn->insts[ninst].epilog-(dyn->native_size); \ - Bcond(NO, i32); \ - if(dyn->insts[ninst].x64.jmp_insts==-1) { \ - if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \ - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ - jump_to_next(dyn, addr+i8, 0, ninst, rex.is32bits); \ - } else { \ - CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size);\ - B(i32); \ - } \ - } else { \ - /* inside the block */ \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ - Bcond(YES, i32); \ - } - case 0xE0: - INST_NAME("LOOPNZ (32bits)"); - READFLAGS(X_ZF); - i8 = F8S; - MOVw_REG(x1, xRCX); - SUBSw_U12(x1, x1, 1); - BFIx(xRCX, x1, 0, 32); - B_NEXT(cEQ); // ECX is 0, no LOOP - TSTw_mask(xFlags, 0b011010, 0); //mask=0x40 - GO(cNE, cEQ); - break; - case 0xE1: - INST_NAME("LOOPZ (32bits)"); - READFLAGS(X_ZF); - i8 = F8S; - MOVw_REG(x1, xRCX); - SUBSw_U12(x1, x1, 1); - BFIx(xRCX, x1, 0, 32); - B_NEXT(cEQ); // ECX is 0, no LOOP - TSTw_mask(xFlags, 0b011010, 0); //mask=0x40 - GO(cEQ, cNE); - break; - case 0xE2: - INST_NAME("LOOP (32bits)"); - i8 = F8S; - MOVw_REG(x1, xRCX); - SUBSw_U12(x1, x1, 1); - BFIx(xRCX, x1, 0, 32); - GO(cEQ, cNE); - break; - case 0xE3: - INST_NAME("JECXZ"); - i8 = F8S; - MOVw_REG(x1, xRCX); - TSTw_REG(x1, x1); - GO(cNE, cEQ); - break; - #undef GO - - case 0xE8: - return dynarec64_00(dyn, addr-1, ip, ninst, rex, rep, ok, need_epilog); // addr-1, to "put back" opcode) - - case 0xF7: - nextop = F8; - switch((nextop>>3)&7) { - case 0: - case 1: - INST_NAME("TEST Ed, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32H(x1, 4); - i64 = F32S; - MOV64xw(x2, i64); - emit_test32(dyn, ninst, rex, ed, x2, x3, x4, x5); - break; - case 2: - INST_NAME("NOT Ed"); - GETED32(0); - MVNxw_REG(ed, ed); - WBACK; - break; - case 3: - INST_NAME("NEG Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32(0); - emit_neg32(dyn, ninst, rex, ed, x3, x4); - WBACK; - break; - case 4: - INST_NAME("MUL EAX, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - GETED32(0); - if(rex.w) { - if(ed==xRDX) gd=x3; else gd=xRDX; - UMULH(gd, xRAX, ed); - MULx(xRAX, xRAX, ed); - if(gd!=xRDX) {MOVx_REG(xRDX, gd);} - } else { - UMULL(xRDX, xRAX, ed); //64 <- 32x32 - MOVw_REG(xRAX, xRDX); - LSRx(xRDX, xRDX, 32); - } - UFLAG_RES(xRAX); - UFLAG_OP1(xRDX); - UFLAG_DF(x2, rex.w?d_mul64:d_mul32); - break; - case 5: - INST_NAME("IMUL EAX, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - GETED32(0); - if(rex.w) { - if(ed==xRDX) gd=x3; else gd=xRDX; - SMULH(gd, xRAX, ed); - MULx(xRAX, xRAX, ed); - if(gd!=xRDX) {MOVx_REG(xRDX, gd);} - } else { - SMULL(xRDX, xRAX, ed); //64 <- 32x32 - MOVw_REG(xRAX, xRDX); - LSRx(xRDX, xRDX, 32); - } - UFLAG_RES(xRAX); - UFLAG_OP1(xRDX); - UFLAG_DF(x2, rex.w?d_imul64:d_imul32); - break; - case 6: - INST_NAME("DIV Ed"); - SETFLAGS(X_ALL, SF_SET); - SET_DFNONE(x2); - if(!rex.w) { - GETED32(0); - MOVw_REG(x3, xRAX); - ORRx_REG_LSL(x3, x3, xRDX, 32); - if(MODREG) { - MOVw_REG(x4, ed); - ed = x4; - } - UDIVx(x2, x3, ed); - MSUBx(x4, x2, ed, xRAX); - MOVw_REG(xRAX, x2); - MOVw_REG(xRDX, x4); - } else { - if(ninst && dyn->insts - && dyn->insts[ninst-1].x64.addr - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31 - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0xD2) { - GETED32(0); - UDIVx(x2, xRAX, ed); - MSUBx(xRDX, x2, ed, xRAX); - MOVx_REG(xRAX, x2); - } else { - GETED32H(x1, 0); // get edd changed addr, so cannot be called 2 times for same op... - CBZxw_MARK(xRDX); - if(ed!=x1) {MOVx_REG(x1, ed);} - CALL(div64, -1); - B_NEXT_nocond; - MARK; - UDIVx(x2, xRAX, ed); - MSUBx(xRDX, x2, ed, xRAX); - MOVx_REG(xRAX, x2); - } - } - break; - case 7: - INST_NAME("IDIV Ed"); - NOTEST(x1); - SETFLAGS(X_ALL, SF_SET); - SET_DFNONE(x2); - if(!rex.w) { - GETSED32w(0); - MOVw_REG(x3, xRAX); - ORRx_REG_LSL(x3, x3, xRDX, 32); - SDIVx(x2, x3, wb); - MSUBx(x4, x2, wb, x3); - MOVw_REG(xRAX, x2); - MOVw_REG(xRDX, x4); - } else { - if(ninst && dyn->insts - && dyn->insts[ninst-1].x64.addr - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x48 - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0x99) { - GETED32(0); - SDIVx(x2, xRAX, ed); - MSUBx(xRDX, x2, ed, xRAX); - MOVx_REG(xRAX, x2); - } else { - GETED32H(x1, 0); // get edd changed addr, so cannot be called 2 times for same op... - CBZxw_MARK(xRDX); - MVNx_REG(x2, xRDX); - CBZxw_MARK(x2); - if(ed!=x1) {MOVx_REG(x1, ed);} - CALL((void*)idiv64, -1); - B_NEXT_nocond; - MARK; - SDIVx(x2, xRAX, ed); - MSUBx(xRDX, x2, ed, xRAX); - MOVx_REG(xRAX, x2); - } - } - break; - } - break; - case 0xFF: - nextop = F8; - switch((nextop>>3)&7) { - case 0: // INC Ed - INST_NAME("INC Ed"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - GETED32(0); - emit_inc32(dyn, ninst, rex, ed, x3, x4); - WBACK; - break; - case 1: //DEC Ed - INST_NAME("DEC Ed"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - GETED32(0); - emit_dec32(dyn, ninst, rex, ed, x3, x4); - WBACK; - break; - case 2: // CALL Ed - INST_NAME("CALL Ed"); - PASS2IF((box64_dynarec_safeflags>1) || - ((ninst && dyn->insts[ninst-1].x64.set_flags) - || ((ninst>1) && dyn->insts[ninst-2].x64.set_flags)), 1) - { - READFLAGS(X_PEND); // that's suspicious - } else { - SETFLAGS(X_ALL, SF_SET_NODF); //Hack to put flag in "don't care" state - } - GETED32(0); - if(box64_dynarec_callret && box64_dynarec_bigblock>1) { - BARRIER(BARRIER_FULL); - BARRIER_NEXT(BARRIER_FULL); - } else { - BARRIER(BARRIER_FLOAT); - *need_epilog = 0; - *ok = 0; - } - GETIP_(addr); - if(box64_dynarec_callret) { - SET_HASCALLRET(); - // Push actual return address - if(addr < (dyn->start+dyn->isize)) { - // there is a next... - j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; - ADR_S20(x4, j64); - MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64>>2); - } else { - MESSAGE(LOG_NONE, "\tCALLRET set return to Jmptable(%p)\n", (void*)addr); - j64 = getJumpTableAddress64(addr); - TABLE64(x4, j64); - LDRx_U12(x4, x4, 0); - } - STPx_S7_preindex(x4, xRIP, xSP, -16); - } - PUSH1z(xRIP); - jump_to_next(dyn, 0, ed, ninst, rex.is32bits); - break; - default: - DEFAULT; - return addr; - } - break; - - default: - DEFAULT; - } - return addr; -} diff --git a/src/dynarec/arm64/dynarec_arm64_6764_32.c b/src/dynarec/arm64/dynarec_arm64_6764_32.c deleted file mode 100644 index 58abbf4..0000000 --- a/src/dynarec/arm64/dynarec_arm64_6764_32.c +++ /dev/null @@ -1,157 +0,0 @@ -#include -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" - -#include "arm64_printer.h" -#include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" -#include "dynarec_arm64_functions.h" - -#define GETGm gd = ((nextop&0x38)>>3) - -uintptr_t dynarec64_6764_32(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int seg, int* ok, int* need_epilog) -{ - (void)ip; (void)need_epilog; - - uint8_t opcode = F8; - uint8_t nextop; - uint8_t gd, ed, wback, wb, wb1, wb2, gb1, gb2, eb1, eb2; - int64_t fixedaddress; - int unscaled; - int8_t i8; - uint8_t u8; - int32_t i32; - int64_t j64, i64; - int cacheupd = 0; - int lock; - int v0, v1, s0; - MAYUSE(i32); - MAYUSE(j64); - MAYUSE(v0); - MAYUSE(v1); - MAYUSE(s0); - MAYUSE(lock); - MAYUSE(cacheupd); - - if(!rex.is32bits) { - // should do a different file - DEFAULT; - return addr; - } - - rep = 0; - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - switch(opcode) { - - case 0x89: - INST_NAME("MOV Seg:Ed, Gd"); - nextop=F8; - GETGD; - if(MODREG) { // reg <= reg - MOVxw_REG(xRAX+(nextop&7)+(rex.b<<3), gd); - } else { // mem <= reg - grab_segdata(dyn, addr, ninst, x4, seg); - addr = geted16(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, 0); - STRw_REG(gd, ed, x4); - } - break; - - case 0x8B: - INST_NAME("MOV Gd, Seg:Ed"); - nextop=F8; - GETGD; - if(MODREG) { // reg => reg - MOVxw_REG(gd, xRAX+(nextop&7)+(rex.b<<3)); - } else { // mem => reg - grab_segdata(dyn, addr, ninst, x4, seg); - addr = geted16(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, 0); - LDRw_REG(gd, ed, x4); - } - break; - - case 0x8F: - INST_NAME("POP Seg:Ed"); - nextop=F8; - if(MODREG) { // reg <= reg - POP1_32(x1); - MOVxw_REG(xRAX+(nextop&7)+(rex.b<<3), x1); - } else { // mem <= reg - grab_segdata(dyn, addr, ninst, x4, seg); - POP1_32(x1); - addr = geted16(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, 0); - STRw_REG(x1, ed, x4); - } - break; - - case 0xA1: - INST_NAME("MOV EAX, Seg:[Od]"); - i32 = F16; - grab_segdata(dyn, addr, ninst, x4, seg); - if(i32<4096 && !(i32&3)) { - LDRw_U12(xRAX, x4, i32); - } else if(i32<256) { - LDURw_I9(xRAX, x4, i32); - } else { - MOV32w(x1, i32); - LDRw_REG(xRAX, x4, x1); - } - break; - - case 0xA3: - INST_NAME("MOV Seg:[Od], EAX"); - i32 = F16; - grab_segdata(dyn, addr, ninst, x4, seg); - if(i32<4096 && !(i32&3)) { - STRw_U12(xRAX, x4, i32); - } else if(i32<256) { - STURw_I9(xRAX, x4, i32); - } else { - MOV32w(x1, i32); - STRw_REG(xRAX, x4, x1); - } - break; - - case 0xFF: - nextop = F8; - grab_segdata(dyn, addr, ninst, x4, seg); - switch((nextop>>3)&7) { - case 6: // Push Ed - INST_NAME("PUSH FS:Ew"); - if((nextop&0xC0)==0xC0) { // reg - DEFAULT; - } else { // mem <= i32 - SMREAD(); - addr = geted16(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0, 0, 0); - LDRw_REG(x3, ed, x4); - PUSH1_32(x3); - } - break; - default: - DEFAULT; - } - break; - - - default: - DEFAULT; - } - return addr; -} diff --git a/src/dynarec/arm64/dynarec_arm64_67_32.c b/src/dynarec/arm64/dynarec_arm64_67_32.c deleted file mode 100644 index 691c470..0000000 --- a/src/dynarec/arm64/dynarec_arm64_67_32.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" - -#include "arm64_printer.h" -#include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" -#include "dynarec_arm64_functions.h" - -#define GETGm gd = ((nextop&0x38)>>3) - -uintptr_t dynarec64_67_32(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) -{ - (void)ip; (void)need_epilog; - - uint8_t opcode = F8; - uint8_t nextop; - uint8_t gd, ed, wback, wb, wb1, wb2, gb1, gb2, eb1, eb2; - int64_t fixedaddress; - int unscaled; - int8_t i8; - uint8_t u8; - int32_t i32; - int64_t j64, i64; - int cacheupd = 0; - int lock; - int v0, v1, s0; - MAYUSE(i32); - MAYUSE(j64); - MAYUSE(v0); - MAYUSE(v1); - MAYUSE(s0); - MAYUSE(lock); - MAYUSE(cacheupd); - - if(!rex.is32bits) { - // should do a different file - DEFAULT; - return addr; - } - - rep = 0; - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - switch(opcode) { - - case 64: - addr = dynarec64_6764_32(dyn, addr, ip, ninst, rex, rep, _FS, ok, need_epilog); - break; - - #define GO(NO, YES) \ - BARRIER(BARRIER_MAYBE); \ - JUMP(addr+i8, 1); \ - if(dyn->insts[ninst].x64.jmp_insts==-1 || \ - CHECK_CACHE()) { \ - /* out of the block */ \ - i32 = dyn->insts[ninst].epilog-(dyn->native_size); \ - Bcond(NO, i32); \ - if(dyn->insts[ninst].x64.jmp_insts==-1) { \ - if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \ - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ - jump_to_next(dyn, addr+i8, 0, ninst, rex.is32bits); \ - } else { \ - CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size);\ - B(i32); \ - } \ - } else { \ - /* inside the block */ \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ - Bcond(YES, i32); \ - } - case 0xE0: - INST_NAME("LOOPNZ (16bits)"); - READFLAGS(X_ZF); - i8 = F8S; - UXTHw(x1, xRCX); - SUBSw_U12(x1, x1, 1); - BFIx(xRCX, x1, 0, 16); - B_NEXT(cEQ); // ECX is 0, no LOOP - TSTw_mask(xFlags, 0b011010, 0); //mask=0x40 - GO(cNE, cEQ); - break; - case 0xE1: - INST_NAME("LOOPZ (16bits)"); - READFLAGS(X_ZF); - i8 = F8S; - UXTHw(x1, xRCX); - SUBSw_U12(x1, x1, 1); - BFIx(xRCX, x1, 0, 16); - B_NEXT(cEQ); // ECX is 0, no LOOP - TSTw_mask(xFlags, 0b011010, 0); //mask=0x40 - GO(cEQ, cNE); - break; - case 0xE2: - INST_NAME("LOOP (16bits)"); - i8 = F8S; - UXTHw(x1, xRCX); - SUBSw_U12(x1, x1, 1); - BFIx(xRCX, x1, 0, 16); - GO(cEQ, cNE); - break; - case 0xE3: - INST_NAME("JCXZ"); - i8 = F8S; - TSTw_mask(xRCX, 0, 15); //mask=0xffff - GO(cNE, cEQ); - break; - #undef GO - - default: - DEFAULT; - } - return addr; -} diff --git a/src/dynarec/arm64/dynarec_arm64_67_avx.c b/src/dynarec/arm64/dynarec_arm64_67_avx.c deleted file mode 100644 index 1e1e592..0000000 --- a/src/dynarec/arm64/dynarec_arm64_67_avx.c +++ /dev/null @@ -1,112 +0,0 @@ -#include -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" - -#include "arm64_printer.h" -#include "dynarec_arm64_private.h" -#include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" - -static const char* avx_prefix_string(uint16_t p) -{ - switch(p) { - case VEX_P_NONE: return "0"; - case VEX_P_66: return "66"; - case VEX_P_F2: return "F2"; - case VEX_P_F3: return "F3"; - default: return "??"; - } -} -static const char* avx_map_string(uint16_t m) -{ - switch(m) { - case VEX_M_NONE: return "0"; - case VEX_M_0F: return "0F"; - case VEX_M_0F38: return "0F38"; - case VEX_M_0F3A: return "0F3A"; - default: return "??"; - } -} - -uintptr_t dynarec64_67_AVX(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) -{ - (void)ip; (void)need_epilog; - uint8_t opcode = F8; - uint8_t nextop, u8; - uint8_t gd, ed, vd; - uint8_t wback, wb1, wb2; - uint8_t eb1, eb2, gb1, gb2; - int32_t i32, i32_; - int cacheupd = 0; - int v0, v1, v2; - int q0, q1, q2; - int d0, d1, d2; - int s0; - uint64_t tmp64u; - int64_t j64; - int64_t fixedaddress; - int unscaled; - MAYUSE(wb1); - MAYUSE(wb2); - MAYUSE(eb1); - MAYUSE(eb2); - MAYUSE(gb1); - MAYUSE(gb2); - MAYUSE(q0); - MAYUSE(q1); - MAYUSE(d0); - MAYUSE(d1); - MAYUSE(s0); - MAYUSE(j64); - MAYUSE(cacheupd); - - rex_t rex = vex.rex; - - if( (vex.m==VEX_M_0F38) && (vex.p==VEX_P_F2)) { - switch(opcode) { - - case 0xF6: - INST_NAME("MULX Gd, Vd, Ed (,RDX)"); - nextop = F8; - GETGD; - GETED32(0); - GETVD; - if(rex.w) { - // 64bits mul - UMULH(x3, xRDX, ed); - MULx(vd, xRDX, ed); - MOVx_REG(gd, x3); - } else { - // 32bits mul - UMULL(x3, xRDX, ed); - MOVw_REG(vd, x3); - LSRx(gd, x3, 32); - } - break; - - default: - DEFAULT; - } - - } - else {DEFAULT;} - - if((*ok==-1) && (box64_dynarec_log>=LOG_INFO || box64_dynarec_dump || box64_dynarec_missing)) { - dynarec_log(LOG_NONE, "Dynarec unimplemented AVX opcode size %d prefix %s map %s opcode %02X ", 128< +#include +#include +#include + +#include "debug.h" +#include "dynablock.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "emu/x64run_private.h" +#include "dynarec/dynablock_private.h" +#include "dynarec_arm64_arch.h" +#include "dynarec_arm64_functions.h" +#include "dynarec_native.h" + +//order might be important, so define SUPER for the right one +#define SUPER() \ + GO(flags) \ + GO(x87) \ + GO(mmx) \ + GO(sse) \ + GO(ymm) \ + + +typedef struct arch_flags_s +{ + uint8_t defered:1; + uint8_t nf:1; + uint8_t eq:1; + uint8_t vf:1; + uint8_t cf:1; + uint8_t inv_cf:1; +} arch_flags_t; + +#define X87_ST_D 0 +#define X87_ST_F 1 +#define X87_ST_I64 2 +typedef struct arch_x87_s +{ + int8_t delta; //up to +/-7 + uint8_t x87; // 1bit is STx present + uint16_t x87_type; // 2bits per STx type + uint32_t x87_pos; //4bits per STx position (well, 3 would be enough) +} arch_x87_t; + +typedef struct arch_mmx_s +{ + uint8_t mmx; //1bit for each mmx reg present +} arch_mmx_t; + +typedef struct arch_sse_s +{ + uint16_t sse; //1bit for each sse reg present +} arch_sse_t; + +typedef struct arch_ymm_s +{ + uint16_t ymm0; // 1bit for ymm0 + uint16_t ymm; // 1bit for each ymm present + uint64_t ymm_pos; // 4bits for position of each ymm present +} arch_ymm_t; + +typedef struct arch_arch_s +{ + #define GO(A) uint16_t A:1; + SUPER() + #undef GO + uint16_t unaligned:1; + uint16_t seq:10; // how many instruction on the same values +} arch_arch_t; + +typedef struct arch_build_s +{ + #define GO(A) uint8_t A:1; + SUPER() + #undef GO + uint8_t unaligned; + #define GO(A) arch_##A##_t A##_; + SUPER() + #undef GO +} arch_build_t; + +static arch_build_t static_build[MAX_INSTS+2] = {0}; + +static int arch_build(dynarec_arm_t* dyn, int ninst, arch_build_t* arch, int noarch) +{ + memset(arch, 0, sizeof(arch_build_t)); + // flags + if(((dyn->insts[ninst].f_entry!=status_none && dyn->insts[ninst].f_entry!=status_none_pending)) || dyn->insts[ninst].need_nat_flags || dyn->insts[ninst].before_nat_flags) { + arch->flags = 1; + arch->flags_.defered = (dyn->insts[ninst].f_entry!=status_none && dyn->insts[ninst].f_entry!=status_none_pending); + uint8_t flags = dyn->insts[ninst].need_nat_flags | dyn->insts[ninst].before_nat_flags; + arch->flags_.vf = flags&NF_VF; + arch->flags_.nf = flags&NF_SF; + arch->flags_.eq = flags&NF_EQ; + arch->flags_.cf = flags&NF_CF; + if(arch->flags_.cf) + arch->flags_.inv_cf = !dyn->insts[ninst].normal_carry; + } + // opcode can handle unaligned + arch->unaligned = dyn->insts[ninst].unaligned; + if(!noarch) { + // got through all naoncache to gather regs assignments + int idx; + for(int i=0; i<32; ++i) + if(dyn->insts[ninst].n.neoncache[i].v) + switch(dyn->insts[ninst].n.neoncache[i].t) { + case NEON_CACHE_XMMW: + arch->sse = 1; + arch->sse_.sse |= 1<insts[ninst].n.neoncache[i].n; + break; + case NEON_CACHE_MM: + arch->mmx = 1; + arch->mmx_.mmx |= 1<insts[ninst].n.neoncache[i].n; + break; + case NEON_CACHE_YMMW: + arch->ymm = 1; + arch->ymm_.ymm |= 1<insts[ninst].n.neoncache[i].n; + idx = i; + if(idx>=EMM0 && idx<=EMM0+8) + idx-=EMM0; + else + idx-=SCRATCH0-8; + arch->ymm_.ymm_pos |= idx<<(dyn->insts[ninst].n.neoncache[i].n*4); + break; + case NEON_CACHE_ST_D: + arch->x87 = 1; + arch->x87_.x87 |= 1<insts[ninst].n.neoncache[i].n; + arch->x87_.x87_pos = (i-EMM0)<<(dyn->insts[ninst].n.neoncache[i].n*4); + arch->x87_.x87_type = (X87_ST_D)<<(dyn->insts[ninst].n.neoncache[i].n*2); + break; + case NEON_CACHE_ST_F: + arch->x87 = 1; + arch->x87_.x87 |= 1<insts[ninst].n.neoncache[i].n; + arch->x87_.x87_pos = (i-EMM0)<<(dyn->insts[ninst].n.neoncache[i].n*4); + arch->x87_.x87_type = (X87_ST_F)<<(dyn->insts[ninst].n.neoncache[i].n*2); + break; + case NEON_CACHE_ST_I64: + arch->x87 = 1; + arch->x87_.x87 |= 1<insts[ninst].n.neoncache[i].n; + arch->x87_.x87_pos = (i-EMM0)<<(dyn->insts[ninst].n.neoncache[i].n*4); + arch->x87_.x87_type = (X87_ST_I64)<<(dyn->insts[ninst].n.neoncache[i].n*2); + break; + case NEON_CACHE_XMMR: + case NEON_CACHE_YMMR: + default: + // doing nothing, it's just a value read in memory + break; + } + // ymm0 + if(dyn->insts[ninst].ymm0_out) { + arch->ymm = 1; + arch->ymm_.ymm0 = dyn->insts[ninst].ymm0_out; + } + // x87 top + if(dyn->insts[ninst].n.x87stack) { + arch->x87 = 1; + arch->x87_.delta = dyn->insts[ninst].n.x87stack; + } + } + return arch->flags + arch->x87 + arch->mmx + arch->sse + arch->ymm + arch->unaligned; +} + +static int sizeof_arch(arch_arch_t* arch) +{ + int sz = sizeof(arch_arch_t); + #define GO(A) if(arch->A) sz+=sizeof(arch_##A##_t); + SUPER() + #undef GO + return sz; +} + +static int sizeof_arch_build(arch_build_t* build) +{ + int sz = sizeof(arch_arch_t); + #define GO(A) if(build->A) sz+=sizeof(arch_##A##_t); + SUPER() + #undef GO + return sz; +} + +size_t get_size_arch(dynarec_arm_t* dyn) +{ + int noarch = BOX64ENV(dynarec_noarch); + if(noarch>1) return 0; + arch_build_t* previous = NULL; + size_t sz = 0; + int seq = 0; + int nseq = 0; + int last = 0; + if(!dyn->size) return 0; + for(int i=0; isize; ++i) { + arch_build_t* build = static_build+i; + last = arch_build(dyn, i, build, noarch); + if(i && (!memcmp(build, previous, sizeof(arch_build_t))) && (seq<((1<<10)-1))) { + // same sequence, increment + ++seq; + } else { + seq = 0; + ++nseq; + previous = build; + sz += sizeof_arch_build(build); + } + } + if(nseq==1 && !last) + return 0; //empty, no flags, no nothing + return sz; +} + +static void build_next(arch_arch_t* arch, arch_build_t* build) +{ + #define GO(A) arch->A = build->A; + SUPER() + #undef GO + arch->unaligned = build->unaligned; + arch->seq = 0; + void* p = ((void*)arch)+sizeof(arch_arch_t); + #define GO(A) \ + if(build->A) { \ + memcpy(p, &(build->A##_), sizeof(arch_ ##A##_t)); \ + p+=sizeof(arch_##A##_t); \ + } + SUPER() + #undef GO +} + +void* populate_arch(dynarec_arm_t* dyn, void* p, size_t tot_sz) +{ + arch_build_t* previous = NULL; + arch_arch_t* arch = p; + arch_arch_t* next = p; + int seq = 0; + size_t total = 0; + if(!tot_sz) return NULL; + for(int i=0; isize; ++i) { + arch_build_t* build = static_build+i; + if(i && (!memcmp(build, previous, sizeof(arch_build_t))) && (seq<((1<<10)-1))) { + // same sequence, increment + arch->seq = ++seq; + } else { + int sz = sizeof_arch_build(build); + if(total+sz>tot_sz) { + printf_log(LOG_INFO, "Warning: populate_arch on undersized buffer (%d+%d/%d, inst %d/%d)\n", total, sz, tot_sz, i, dyn->size); + return NULL; + } + arch = next; + build_next(arch, build); + seq = 0; + previous = build; + total += sz; + next = (arch_arch_t*)((uintptr_t)arch+sz); + } + } + return p; +} + +// NZCV N +#define NZCV_N 31 +// NZCV Z +#define NZCV_Z 30 +// NZCV C +#define NZCV_C 29 +// NZCV V +#define NZCV_V 28 + +#ifndef _WIN32 // TODO: Implemented this for Win32 +void adjust_arch(dynablock_t* db, x64emu_t* emu, ucontext_t* p, uintptr_t x64pc) +{ + if(!db->arch_size || !db->arch) + return; + int ninst = getX64AddressInst(db, x64pc); + dynarec_log(LOG_INFO, "adjust_arch(...), db=%p, x64pc=%p, nints=%d", db, (void*)x64pc, ninst); + if(ninst<0) { + dynarec_log_prefix(0, LOG_INFO, "\n"); + return; + } + if(ninst==0) { + dynarec_log_prefix(0, LOG_INFO, "\n"); + CHECK_FLAGS(emu); + return; + } + // look for state at ninst-1 + arch_arch_t* arch = db->arch; + arch_arch_t* next = arch; + #define GO(A) arch_##A##_t* A = NULL; + SUPER() + #undef GO + int i = 0; + while(i<(ninst)) { // this will look for ninst-1 state + arch = next; + dynarec_log_prefix(0, (i<(ninst-1))?LOG_DEBUG:LOG_INFO, "[ seq=%d%s%s%s%s%s ] ", arch->seq, arch->flags?" Flags":"", arch->x87?" x87":"", arch->mmx?" MMX":"", arch->sse?" SSE":"", arch->ymm?" YMM":""); + i += 1+arch->seq; + next = (arch_arch_t*)((uintptr_t)next + sizeof_arch(arch)); + } + int sz = sizeof(arch_arch_t); + #define GO(A) \ + if(arch->A) { \ + A = (arch_##A##_t*)((uintptr_t)arch + sz); \ + sz+=sizeof(arch_##A##_t); \ + } + SUPER() + #undef GO + if(flags) { + dynarec_log_prefix(0, LOG_INFO, " flags[%s-%s%s%s%s] ", flags->defered?"defered":"", flags->nf?"S":"", flags->vf?"O":"", flags->eq?"Z":"", flags->cf?(flags->inv_cf?"C(inv)":"C"):""); + if(flags->defered) { + CHECK_FLAGS(emu); + //return; + } + if(flags->nf) { + CONDITIONAL_SET_FLAG(p->uc_mcontext.pstate&(1<vf) { + CONDITIONAL_SET_FLAG(p->uc_mcontext.pstate&(1<eq) { + CONDITIONAL_SET_FLAG(p->uc_mcontext.pstate&(1<cf) { + if(flags->inv_cf) { + CONDITIONAL_SET_FLAG((p->uc_mcontext.pstate&(1<uc_mcontext.pstate&(1<uc_mcontext.__reserved; + while (ff->magic && !fpsimd) { + if(ff->magic==FPSIMD_MAGIC) + fpsimd = (struct fpsimd_context*)ff; + else + ff = (struct _aarch64_ctx*)((uintptr_t)ff + ff->size); + } + } + if(sse) { + dynarec_log_prefix(0, LOG_INFO, " sse[%x (fpsimd=%p)] ", sse->sse, fpsimd); + for(int i=0; i<16; ++i) + if(fpsimd && (sse->sse>>i)&1) { + int idx = 0; + if(i>7) { + idx = XMM8 + i - 8; + } else { + idx = XMM0 + i; + } + emu->xmm[i].u128 = fpsimd->vregs[idx]; + } + } + if(ymm) { + dynarec_log_prefix(0, LOG_INFO, " ymm[%x, pos=%x, 0=%x (fpsimd=%p)] ", ymm->ymm, ymm->ymm_pos, ymm->ymm0, fpsimd); + for(int i=0; i<16; ++i) { + if(fpsimd && (ymm->ymm>>i)&1) { + int idx = (ymm->ymm_pos>>(i*4))&0xf; + if(i>7) { + idx = SCRATCH0 + i - 8; + } else { + idx = EMM0 + i; + } + emu->ymm[i].u128 = fpsimd->vregs[idx]; + } + if(ymm->ymm0&(1<ymm[i].u128 = 0; + } + } + if(mmx) { + dynarec_log_prefix(0, LOG_INFO, " mmx[%x (fpsimd=%p)] ", mmx->mmx, fpsimd); + for(int i=0; i<8; ++i) + if(fpsimd && (mmx->mmx>>i)&1) { + int idx = EMM0 + i; + emu->mmx[i].q = fpsimd->vregs[idx]&0xffffffffffffffffLL; + } + } + if(x87) { + dynarec_log_prefix(0, LOG_INFO, " x87[%x, pos=%x, type=%x (fpsimd=%p)] ", x87->x87, x87->x87_pos, x87->x87_type, fpsimd); + emu->top -= x87->delta; + for(int i=0; i<8; ++i) { + if(x87->x87&(1<x87_pos>>(i*4))&0x0f; + int t = (x87->x87_type>>(i*2))&0x3; + switch (t) { + case X87_ST_F: + emu->x87[(emu->top+i)&7].d = *(float*)&fpsimd->vregs[idx]; + break; + case X87_ST_I64: + emu->x87[(emu->top+i)&7].d = *(int64_t*)&fpsimd->vregs[idx]; + break; + case X87_ST_D: + emu->x87[(emu->top+i)&7].d = *(double*)&fpsimd->vregs[idx]; + break; + } + } + } + } + dynarec_log_prefix(0, LOG_INFO, "\n"); +} +#endif + +int arch_unaligned(dynablock_t* db, uintptr_t x64pc) +{ + if(!db) + return 0; + if(!db->arch_size || !db->arch) + return 0; + int ninst = getX64AddressInst(db, x64pc); + if(ninst<0) { + return 0; + } + // look for state at ninst + arch_arch_t* arch = db->arch; + arch_arch_t* next = arch; + int i = -1; + while(iseq; + next = (arch_arch_t*)((uintptr_t)next + sizeof_arch(arch)); + } + return arch->unaligned; +} diff --git a/src/dynarec/arm64/dynarec_arm64_arch.h b/src/dynarec/arm64/dynarec_arm64_arch.h new file mode 100644 index 0000000..ccdd212 --- /dev/null +++ b/src/dynarec/arm64/dynarec_arm64_arch.h @@ -0,0 +1,24 @@ +#ifndef __DYNAREC_ARM_ARCH_H__ +#define __DYNAREC_ARM_ARCH_H__ + +#include + +#include "x64emu.h" +#include "box64context.h" +#include "box64cpu.h" +#include "dynarec_arm64_private.h" + +// get size of arch specific info (can be 0) +size_t get_size_arch(dynarec_arm_t* dyn); +//populate the array +void* populate_arch(dynarec_arm_t* dyn, void* p, size_t sz); +#ifndef _WIN32 +#include +//adjust flags and more +void adjust_arch(dynablock_t* db, x64emu_t* emu, ucontext_t* p, uintptr_t x64pc); +#else +#define adjust_arch(db, emu, p, x64pc) +#endif +// get if instruction can be regenerated for unaligned access +int arch_unaligned(dynablock_t* db, uintptr_t x64pc); +#endif // __DYNAREC_ARM_ARCH_H__ diff --git a/src/dynarec/arm64/dynarec_arm64_avx.c b/src/dynarec/arm64/dynarec_arm64_avx.c index ec00ddd..5f0eda1 100644 --- a/src/dynarec/arm64/dynarec_arm64_avx.c +++ b/src/dynarec/arm64/dynarec_arm64_avx.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,7 +17,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" static const char* avx_prefix_string(uint16_t p) { @@ -67,10 +65,13 @@ uintptr_t dynarec64_AVX(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ni addr = dynarec64_AVX_F2_0F38(dyn, addr, ip, ninst, vex, ok, need_epilog); else if( (vex.m==VEX_M_0F3A) && (vex.p==VEX_P_F2)) addr = dynarec64_AVX_F2_0F3A(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if( (vex.m==VEX_M_0F38) && (vex.p==VEX_P_F3)) + addr = dynarec64_AVX_F3_0F38(dyn, addr, ip, ninst, vex, ok, need_epilog); else {DEFAULT;} - if((*ok==-1) && (box64_dynarec_log>=LOG_INFO || box64_dynarec_dump || box64_dynarec_missing)) { - dynarec_log(LOG_NONE, "Dynarec unimplemented AVX opcode size %d prefix %s map %s opcode %02X ", 128<=LOG_INFO || dyn->need_dump || BOX64ENV(dynarec_missing))) + if(!dyn->size || BOX64ENV(dynarec_log)>LOG_INFO || dyn->need_dump) { + dynarec_log(LOG_NONE, " Dynarec unimplemented VEX opcode size %d prefix %s map %s opcode %02X\n", 128< 1 - static const int8_t mask_shift8[] = { -7, -6, -5, -4, -3, -2, -1, 0 }; - #endif rex_t rex = vex.rex; @@ -81,11 +76,13 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int } else { v0 = sse_get_reg_empty(dyn, ninst, x1, gd); SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VLDR128_U12(v0, ed, fixedaddress); // no alignment issue with ARMv8 NEON :) if(vex.l) { - v0 = ymm_get_reg_empty(dyn, ninst, x1, gd, -1, -1, -1); - VLDR128_U12(v0, ed, fixedaddress+16); + v1 = ymm_get_reg_empty(dyn, ninst, x1, gd, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VLDP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VLD128(v0, ed, fixedaddress); // no alignment issue with ARMv8 NEON :) } } if(!vex.l) YMM0(gd); @@ -103,13 +100,15 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int v0 = ymm_get_reg(dyn, ninst, x1, gd, 0, ed, -1, -1); v1 = ymm_get_reg_empty(dyn, ninst, x1, ed, gd, -1, -1); VMOVQ(v1, v0); - } + } else YMM0(ed); } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VSTR128_U12(v0, ed, fixedaddress); if(vex.l) { - v0 = ymm_get_reg(dyn, ninst, x1, gd, 0, ed, -1, -1); - VSTR128_U12(v0, ed, fixedaddress+16); + v1 = ymm_get_reg(dyn, ninst, x1, gd, 0, ed, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VSTP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VST128(v0, ed, fixedaddress); } SMWRITE2(); } @@ -139,17 +138,14 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x13: nextop = F8; - INST_NAME("VMOVLPS Ex, Vx, Gx"); - GETGX(v0, 0); - GETVX(v2, 0); - if(v1!=v2) - VMOVQ(v0, v2); if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1); - if(v0!=v1) VMOVeD(v1, 0, v0, 0); + INST_NAME("Illegal AVX.0F 13"); + UDF(0); } else { + INST_NAME("VMOVLPS Ex, Gx"); + GETGX(v0, 0); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - VST1_64(v0, 0, ed); // better to use VST1 than VSTR_64, to avoid NEON->VFPU transfert I assume + VST1_64(v0, 0, ed); SMWRITE2(); } break; @@ -197,15 +193,18 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int YMM0(gd); break; case 0x17: - INST_NAME("VMOVHPS Ex,Gx"); + INST_NAME("VMOVHPS Ex, Gx"); nextop = F8; GETGX(v0, 0); if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1); + ed = (nextop&7)+(rex.b<<3); + v1 = sse_get_reg(dyn, ninst, x1, ed, 1); VMOVeD(v1, 0, v0, 1); + YMM0(ed); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); VST1_64(v0, 1, ed); + SMWRITE2(); } break; @@ -225,11 +224,13 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int } else { v0 = sse_get_reg_empty(dyn, ninst, x1, gd); SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VLDR128_U12(v0, ed, fixedaddress); if(vex.l) { - GETGY_empty(v0, -1, -1, -1); - VLDR128_U12(v0, ed, fixedaddress+16); + GETGY_empty(v1, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VLDP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VLD128(v0, ed, fixedaddress); } } if(!vex.l) YMM0(gd); @@ -246,37 +247,36 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int if(vex.l) { GETGYEY_empty(v0, v1); VMOVQ(v1, v0); - } + } else YMM0(ed); } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VSTR128_U12(v0, ed, fixedaddress); if(vex.l) { - GETGY(v0, 0, -1, -1, -1); - VSTR128_U12(v0, ed, fixedaddress+16); + GETGY(v1, 0, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VSTP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VST128(v0, ed, fixedaddress); } SMWRITE2(); } break; case 0x2B: - INST_NAME("VMOVNTPS Ex, Gx"); nextop = F8; - GETG; - v0 = sse_get_reg(dyn, ninst, x1, gd, 0); if(MODREG) { - ed = (nextop&7)+(rex.b<<3); - v1 = sse_get_reg_empty(dyn, ninst, x1, ed); - VMOVQ(v1, v0); - if(vex.l) { - GETGYEY_empty(v0, v1); - VMOVQ(v1, v0); - } + INST_NAME("Illegal AVX.0F 2B"); + UDF(0); } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VSTR128_U12(v0, ed, fixedaddress); + INST_NAME("VMOVNTPS Ex, Gx"); + GETG; + v0 = sse_get_reg(dyn, ninst, x1, gd, 0); if(vex.l) { - GETGY(v0, 0, -1, -1, -1); - VSTR128_U12(v0, ed, fixedaddress+16); + GETGY(v1, 0, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VSTP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VST128(v0, ed, fixedaddress); } } break; @@ -285,16 +285,18 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int // no special check... case 0x2F: if(opcode==0x2F) {INST_NAME("VCOMISS Gx, Ex");} else {INST_NAME("VUCOMISS Gx, Ex");} - SETFLAGS(X_ALL, SF_SET_NODF); + SETFLAGS(X_ALL, SF_SET); nextop = F8; GETGX(v0, 0); GETEXSS(s0, 0, 0); - FCMPS(v0, s0); + IFX(X_CF|X_PF|X_ZF) { + FCMPS(v0, s0); + } FCOMI(x1, x2); break; case 0x50: - INST_NAME("VMOVMSPKPS Gd, Ex"); + INST_NAME("VMOVMSKPS Gd, Ex"); nextop = F8; GETGD; MOV32w(gd, 0); @@ -302,7 +304,7 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int // EX is an xmm reg q0 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETEX(v0, 0, 0); } else { GETEY(v0); } + if(!l) { GETEX_Y(v0, 0, 0); } else { GETEY(v0); } SQXTN_16(q0, v0); // reduces the 4 32bits to 4 16bits VMOVQDto(x1, q0, 0); LSRx(x1, x1, 15); @@ -317,15 +319,14 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int } else { // EX is memory SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, (0xfff<<3)-24, 7, rex, NULL, 0, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, (0x3f<<3)-16, 7, rex, NULL, 1, 0); for(int l=0; l<1+vex.l; ++l) { - LDRx_U12(x1, ed, fixedaddress+16*l); + LDPx_S7_offset(x1, x2, ed, fixedaddress+16*l); LSRx(x1, x1, 31); BFIx(gd, x1, 0+(l*4), 1); LSRx(x1, x1, 32); BFIx(gd, x1, 1+(l*4), 1); - LDRx_U12(x1, ed, fixedaddress+8+16*l); - LSRx(x1, x1, 31); + LSRx(x1, x2, 31); BFIx(gd, x1, 2+(l*4), 1); LSRx(x1, x1, 32); BFIx(gd, x1, 3+(l*4), 1); @@ -336,9 +337,23 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("VSQRTPS Gx, Ex"); nextop = F8; SKIPTEST(x1); + if(!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn, ninst); + d1 = fpu_get_scratch(dyn, ninst); + } for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETGX_empty_EX(q0, q1, 0); } else { GETGY_empty_EY(q0, q1); } - VFSQRTQS(q0, q1); + if(!l) { GETGX_empty_EX(v0, v1, 0); } else { GETGY_empty_EY(v0, v1); } + if(!BOX64ENV(dynarec_fastnan)) { + // check if any input value was NAN + VFCMEQQS(d0, v1, v1); // 0 if NAN, 1 if not NAN + VFSQRTQS(v0, v1); + VFCMEQQS(d1, v0, v0); // 0 => out is NAN + VBICQ(d1, d0, d1); // forget it in any input was a NAN already + VSHLQ_32(d1, d1, 31); // only keep the sign bit + VORRQ(v0, v0, d1); // NAN -> -NAN + } else { + VFSQRTQS(v0, v1); + } } if(!vex.l) YMM0(gd); break; @@ -440,27 +455,60 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x58: INST_NAME("VADDPS Gx, Vx, Ex"); nextop = F8; - GETGX_empty_VXEX(v0, v2, v1, 0); - VFADDQS(v0, v2, v1); - if(vex.l) { - GETGY_empty_VYEY(v0, v2, v1); + if(!BOX64ENV(dynarec_fastnan)) { + q0 = fpu_get_scratch(dyn, ninst); + q1 = fpu_get_scratch(dyn, ninst); + } + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } + if(!BOX64ENV(dynarec_fastnan)) { + // check if any input value was NAN + VFMAXQS(q0, v2, v1); // propagate NAN + VFCMEQQS(q0, q0, q0); // 0 if NAN, 1 if not NAN + } VFADDQS(v0, v2, v1); - } else YMM0(gd) + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(q1, v0, v0); // 0 => out is NAN + VBICQ(q1, q0, q1); // forget it in any input was a NAN already + VSHLQ_32(q1, q1, 31); // only keep the sign bit + VORRQ(v0, v0, q1); // NAN -> -NAN + } + } + if(!vex.l) YMM0(gd) break; case 0x59: INST_NAME("VMULPS Gx, Vx, Ex"); nextop = F8; - GETGX_empty_VXEX(v0, v2, v1, 0); - VFMULQS(v0, v2, v1); - if(vex.l) { - GETGY_empty_VYEY(v0, v2, v1); + if(!BOX64ENV(dynarec_fastnan)) { + q0 = fpu_get_scratch(dyn, ninst); + q1 = fpu_get_scratch(dyn, ninst); + } + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } + if(!BOX64ENV(dynarec_fastnan)) { + // check if any input value was NAN + VFMAXQS(q0, v2, v1); // propagate NAN + VFCMEQQS(q0, q0, q0); // 0 if NAN, 1 if not NAN + } VFMULQS(v0, v2, v1); - } else YMM0(gd) + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(q1, v0, v0); // 0 => out is NAN + VBICQ(q1, q0, q1); // forget it in any input was a NAN already + VSHLQ_32(q1, q1, 31); // only keep the sign bit + VORRQ(v0, v0, q1); // NAN -> -NAN + } + } + if(!vex.l) YMM0(gd) break; case 0x5A: INST_NAME("VCVTPS2PD Gx, Ex"); nextop = F8; - GETGX_empty_EX(v0, v1, 0); + if (vex.l) { + GETGX_empty_EX(v0, v1, 0); + } else { + GETEXSD(v1, 0, 0); + GETGX_empty(v0); + } if(vex.l) { GETGY_empty(q0, -1, -1, -1); FCVTL2(q0, v1); @@ -480,56 +528,76 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x5C: INST_NAME("VSUBPS Gx, Vx, Ex"); nextop = F8; - GETGX_empty_VXEX(v0, v2, v1, 0); - VFSUBQS(v0, v2, v1); - if(vex.l) { - GETGY_empty_VYEY(v0, v2, v1); + if(!BOX64ENV(dynarec_fastnan)) { + q0 = fpu_get_scratch(dyn, ninst); + q1 = fpu_get_scratch(dyn, ninst); + } + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } + if(!BOX64ENV(dynarec_fastnan)) { + // check if any input value was NAN + VFMAXQS(q0, v2, v1); // propagate NAN + VFCMEQQS(q0, q0, q0); // 0 if NAN, 1 if not NAN + } VFSUBQS(v0, v2, v1); - } else YMM0(gd) + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(q1, v0, v0); // 0 => out is NAN + VBICQ(q1, q0, q1); // forget it in any input was a NAN already + VSHLQ_32(q1, q1, 31); // only keep the sign bit + VORRQ(v0, v0, q1); // NAN -> -NAN + } + } + if(!vex.l) YMM0(gd) break; case 0x5D: INST_NAME("VMINPS Gx, Vx, Ex"); nextop = F8; - if(!box64_dynarec_fastnan) { - q0 = fpu_get_scratch(dyn, ninst); - } + q0 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } // FMIN/FMAX wll not copy a NaN if either is NaN // but x86 will copy src2 if either value is NaN, so lets force a copy of Src2 (Ex) if result is NaN - VFMINQS(v0, v2, v1); - if(!box64_dynarec_fastnan && (v2!=v1)) { - VFCMEQQS(q0, v0, v0); // 0 is NaN, 1 is not NaN, so MASK for NaN - VBIFQ(v0, v1, q0); // copy dest where source is NaN - } + VFCMGTQS(q0, v1, v2); // 0 if NaN or v1 GT v2, so invert mask for copy + if(v0!=v1) VBIFQ(v0, v1, q0); + if(v0!=v2) VBITQ(v0, v2, q0); } if(!vex.l) YMM0(gd); break; case 0x5E: INST_NAME("VDIVPS Gx, Vx, Ex"); nextop = F8; - GETGX_empty_VXEX(v0, v2, v1, 0); - VFDIVQS(v0, v2, v1); - if(vex.l) { - GETGY_empty_VYEY(v0, v2, v1); + if(!BOX64ENV(dynarec_fastnan)) { + q0 = fpu_get_scratch(dyn, ninst); + q1 = fpu_get_scratch(dyn, ninst); + } + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } + if(!BOX64ENV(dynarec_fastnan)) { + // check if any input value was NAN + VFMAXQS(q0, v2, v1); // propagate NAN + VFCMEQQS(q0, q0, q0); // 0 if NAN, 1 if not NAN + } VFDIVQS(v0, v2, v1); - } else YMM0(gd) + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(q1, v0, v0); // 0 => out is NAN + VBICQ(q1, q0, q1); // forget it in any input was a NAN already + VSHLQ_32(q1, q1, 31); // only keep the sign bit + VORRQ(v0, v0, q1); // NAN -> -NAN + } + } + if(!vex.l) YMM0(gd) break; case 0x5F: INST_NAME("VMAXPS Gx, Vx, Ex"); nextop = F8; - if(!box64_dynarec_fastnan) { - q0 = fpu_get_scratch(dyn, ninst); - } + q0 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } // FMIN/FMAX wll not copy a NaN if either is NaN // but x86 will copy src2 if either value is NaN, so lets force a copy of Src2 (Ex) if result is NaN - VFMAXQS(v0, v2, v1); - if(!box64_dynarec_fastnan && (v2!=v1)) { - VFCMEQQS(q0, v0, v0); // 0 is NaN, 1 is not NaN, so MASK for NaN - VBIFQ(v0, v1, q0); // copy dest where source is NaN - } + VFCMGTQS(q0, v2, v1); // 0 if NaN or v2 GT v1, so invert mask for copy + if(v0!=v1) VBIFQ(v0, v1, q0); + if(v0!=v2) VBITQ(v0, v2, q0); } if(!vex.l) YMM0(gd); break; @@ -568,19 +636,52 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("VLDMXCSR Md"); GETED(0); STRw_U12(ed, xEmu, offsetof(x64emu_t, mxcsr)); - if(box64_sse_flushto0) { - MRS_fpcr(x1); // get fpscr + if(BOX64ENV(sse_flushto0)) { + MRS_fpcr(x2); // get fpscr LSRw_IMM(x3, ed, 15); // get FZ bit - BFIw(x1, x3, 24, 1); // inject FZ bit + BFIw(x2, x3, 24, 1); // inject FZ bit EORw_REG_LSR(x3, x3, ed, 1); // FZ xor DAZ - BFIw(x1, x3, 1, 1); // inject AH bit - MSR_fpcr(x1); // put new fpscr + BFIw(x2, x3, 1, 1); // inject AH bit + MSR_fpcr(x2); // put new fpscr + } + if(BOX64ENV(sse_flushto0)) { + // try to sync mxcsr with fpsr on the flag side + /* mapping is + ARM <-> X86 + 0 <-> 0 // Invalid operation + 1 <-> 2 // Divide by 0 + 2 <-> 3 // Overflow + 3 <-> 4 // underflow + 4 <-> 5 // Inexact + 5 <-> 1 // denormal + */ + // doing X86 -> ARM here, 543210 => 432150 + if(ed!=x1) + MOVw_REG(x1, ed); // x1 = 543210 + UBFXw(x2, x1, 1, 5); // x2 = 54321 + BFIw(x1, x2, 2, 4); // x1 = 432110 + LSRw(x2, x2, 4); // x2 = 5 + BFIw(x1, x2, 1, 1); // x1 = 432150 + MRS_fpsr(x2); + BFIx(x2, x1, 0, 6); + MSR_fpsr(x2); } break; case 3: INST_NAME("VSTMXCSR Md"); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); LDRw_U12(x4, xEmu, offsetof(x64emu_t, mxcsr)); + if(BOX64ENV(sse_flushto0)) { + // sync with fpsr, with mask from mxcsr + MRS_fpsr(x1); + // doing ARM -> X86 here, 0 1 2 3 4 5 -> 0 2 3 4 5 1 + RORw(x3, x1, 2); // x3 = 10.....5432 + BFIw(x1, x3, 1, 4); // x1 = 54320 + RORw(x3, x3, 32-1); // x3 = 0.....54321 + BFIw(x1, x3, 5, 1); // x1 = 154320 + //BFXILw(x3, x4, 7, 6); // this would the mask, but let's ignore that for now + BFIw(x4, x1, 0, 6); // inject back the flags + } STW(x4, ed, fixedaddress); break; default: @@ -594,7 +695,7 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int q0 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 1); u8 = F8; } else { GETGY_empty_VYEY(v0, v2, v1); } - if(((u8&15)==3) || ((u8&15)==7) || ((u8&15)==8) || ((u8&15)==9) || ((u8&15)==10) || ((u8&15)==12) || ((u8&15)==13) || ((u8&15)==14)) { + if(((u8&15)==3) || ((u8&15)==7) || ((u8&15)==8) || ((u8&15)==9) || ((u8&15)==10) || ((u8&15)==12)) { VFMAXQS(q0, v2, v1); // propagate NAN VFCMEQQS(((u8&15)==7)?v0:q0, q0, q0); // 0 if NAN, 1 if not NAN } @@ -634,15 +735,21 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int u8 = F8; if(v2==v1 && (u8&0x3)==((u8>>2)&3) && (u8&0xf)==((u8>>4)&0xf)) { VDUPQ_32(v0, v2, u8&3); - } else if(v2==v1 && (u8==0xe0)) { // easy special case + } else if(v2==v1 && (u8==0xe0)) { // elements 3 2 0 0 VMOVQ(v0, v2); VMOVeS(v0, 1, v0, 0); - } else if(v2==v1 && (u8==0xe5)) { // easy special case + } else if(v2==v1 && (u8==0xe5)) { // elements 3 2 1 1 VMOVQ(v0, v2); VMOVeS(v0, 0, v0, 1); - } else if(MODREG && u8==0x88) { + } else if(v2==v1 && (u8==0xa0)) { // elements 2 2 0 0 + VTRNQ1_32(v0, v1, v2); + } else if(v2==v1 && (u8==0xf5)) { // elements 3 3 1 1 + VTRNQ2_32(v0, v1, v2); + } else if(v2==v1 && (u8==0xb1)) { // elements 2 3 0 1 + VREV64Q_32(v0, v1); + } else if(MODREG && u8==0x88) { // elements 2 0 2 0 VUZP1Q_32(v0, v2, v1); - } else if(MODREG && u8==0xdd) { + } else if(MODREG && u8==0xdd) { // elements 3 1 3 1 VUZP2Q_32(v0, v2, v1); } else { if((v0==v1) || (v0==v2)) { @@ -674,15 +781,21 @@ uintptr_t dynarec64_AVX_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int GETGY_empty_VY(v0, v2, 0, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); if(v2==v1 && (u8&0x3)==((u8>>2)&3) && (u8&0xf)==((u8>>4)&0xf)) { VDUPQ_32(v0, v2, u8&3); - } else if(v2==v1 && (u8==0xe0)) { + } else if(v2==v1 && (u8==0xe0)) { // elements 3 2 0 0 VMOVQ(v0, v2); VMOVeS(v0, 1, v0, 0); - } else if(v2==v1 && (u8==0xe5)) { + } else if(v2==v1 && (u8==0xe5)) { // elements 3 2 1 1 VMOVQ(v0, v2); VMOVeS(v0, 0, v0, 1); - } else if(MODREG && u8==0x88) { + } else if(v2==v1 && (u8==0xa0)) { // elements 2 2 0 0 + VTRNQ1_32(v0, v1, v2); + } else if(v2==v1 && (u8==0xf5)) { // elements 3 3 1 1 + VTRNQ2_32(v0, v1, v2); + } else if(v2==v1 && (u8==0xb1)) { // elements 2 3 0 1 + VREV64Q_32(v0, v1); + } else if(MODREG && u8==0x88) { // elements 2 0 2 0 VUZP1Q_32(v0, v2, v1); - } else if(MODREG && u8==0xdd) { + } else if(MODREG && u8==0xdd) { // elements 3 1 3 1 VUZP2Q_32(v0, v2, v1); } else { if(s0) d0 = v0; diff --git a/src/dynarec/arm64/dynarec_arm64_avx_0f38.c b/src/dynarec/arm64/dynarec_arm64_avx_0f38.c index 484c7b1..eeaff0f 100644 --- a/src/dynarec/arm64/dynarec_arm64_avx_0f38.c +++ b/src/dynarec/arm64/dynarec_arm64_avx_0f38.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -22,7 +20,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_AVX_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) { @@ -39,6 +37,7 @@ uintptr_t dynarec64_AVX_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, i int q0, q1, q2; int d0, d1, d2; int s0; + int need_tst; uint64_t tmp64u; int64_t j64; int64_t fixedaddress; @@ -68,7 +67,33 @@ uintptr_t dynarec64_AVX_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, i GETGD; GETED(0); GETVD; - BICxw(gd, ed, vd); + need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + IFXNATIVE(X_OF, NF_VF) need_tst = 1; + IFXNATIVE(X_CF, NF_CF) need_tst = 1; + if(need_tst) + BICSxw(gd, ed, vd); + else + BICxw(gd, ed, vd); + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(x1, cEQ); + BFIw(xFlags, x1, F_ZF, 1); + } + } + IFX(X_OF) { + IFNATIVE(NF_VF) {} else {BFCw(xFlags, F_OF, 1);} + } + IFX(X_CF) { + IFNATIVE(NF_CF) {} else {BFCw(xFlags, F_CF, 1);} + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + LSRxw_IMM(x1, gd, rex.w?63:31); + BFIw(xFlags, x1, F_SF, 1); + } + } break; case 0xF3: nextop = F8; @@ -84,24 +109,129 @@ uintptr_t dynarec64_AVX_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, i BFIw(xFlags, x3, F_CF, 1); } SUBxw_U12(x3, ed, 1); - IFX(X_ZF) + need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + IFXNATIVE(X_OF, NF_VF) need_tst = 1; + if(need_tst) ANDSxw_REG(vd, ed, x3); else ANDxw_REG(vd, ed, x3); IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETMw(x3, cEQ); + BFIw(xFlags, x3, F_ZF, 1); + } + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + LSRxw(x3, vd, rex.w?63:31); + BFIw(xFlags, x3, F_SF, 1); + } + } + IFX(X_OF) { + IFNATIVE(NF_VF) {} else { BFCw(xFlags, F_OF, 1); } + } + if (BOX64DRENV(dynarec_safeflags)) { + // those are UD flags + IFX(X_AF) BFCw(xFlags, F_AF, 1); + if(BOX64ENV(cputype)) { + IFX(X_PF) BFCw(xFlags, F_PF, 1); + } else { + IFX(X_PF) emit_pf(dyn, ninst, vd, x3); + } + } + break; + + case 2: + INST_NAME("BLSMSK Vd, Ed"); + SETFLAGS(X_ALL, SF_SET); + GETED(0); + GETVD; + IFX(X_CF) { + TSTxw_REG(ed, ed); CSETMw(x3, cEQ); - BFIw(xFlags, x3, F_ZF, 1); + BFIw(xFlags, x3, F_CF, 1); + } + SUBxw_U12(x3, ed, 1); + need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + IFXNATIVE(X_OF, NF_VF) need_tst = 1; + EORxw_REG(vd, ed, x3); + if(need_tst) + TSTxw_REG(vd, vd); + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETMw(x3, cEQ); + BFIw(xFlags, x3, F_ZF, 1); + } } IFX(X_SF) { - LSRxw(x3, vd, rex.w?63:31); - BFIw(xFlags, x3, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(x3, vd, rex.w?63:31); + BFIw(xFlags, x3, F_SF, 1); + } } - IFX(X_OF) BFCw(xFlags, F_OF, 1); - if(box64_dynarec_test) { + IFX(X_OF) { + IFNATIVE(NF_VF) {} else { BFCw(xFlags, F_OF, 1); } + } + if (BOX64DRENV(dynarec_safeflags)) { + // those are UD flags IFX(X_AF) BFCw(xFlags, F_AF, 1); - IFX(X_PF) BFCw(xFlags, F_PF, 1); + if(BOX64ENV(cputype)) { + IFX(X_PF) BFCw(xFlags, F_PF, 1); + } else { + IFX(X_PF) emit_pf(dyn, ninst, vd, x3); + } } break; + + case 3: + INST_NAME("BLSI Vd, Ed"); + SETFLAGS(X_ALL, SF_SET); + GETED(0); + GETVD; + IFX(X_CF) { + TSTxw_REG(ed, ed); + CSETMw(x3, cNE); + BFIw(xFlags, x3, F_CF, 1); + } + NEGxw_REG(x3, ed); + need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + IFXNATIVE(X_OF, NF_VF) need_tst = 1; + if(need_tst) + ANDSxw_REG(vd, ed, x3); + else + ANDxw_REG(vd, ed, x3); + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETMw(x3, cEQ); + BFIw(xFlags, x3, F_ZF, 1); + } + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + LSRxw(x3, vd, rex.w?63:31); + BFIw(xFlags, x3, F_SF, 1); + } + } + IFX(X_OF) { + IFNATIVE(NF_VF) {} else { BFCw(xFlags, F_OF, 1); } + } + if (BOX64DRENV(dynarec_safeflags)) { + // those are UD flags + IFX(X_AF) BFCw(xFlags, F_AF, 1); + if(BOX64ENV(cputype)) { + IFX(X_PF) BFCw(xFlags, F_PF, 1); + } else { + IFX(X_PF) emit_pf(dyn, ninst, vd, x3); + } + } + break; + default: DEFAULT; } @@ -116,27 +246,87 @@ uintptr_t dynarec64_AVX_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, i GETVD; UXTBw(x1, vd); CMPSw_U12(x1, rex.w?64:32); - CSETxw(x2, cPL); - IFX(F_CF) { + CSETMxw(x2, cPL); + IFX(X_CF) { BFIw(xFlags, x2, F_CF, 1); } MVNxw_REG(x2, x2); //prepare mask B_MARK(cPL); LSLxw_REG(x2, x2, x1); MARK; - IFX(X_ZF) { + need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + IFXNATIVE(X_OF, NF_VF) need_tst = 1; + if(need_tst) { BICSxw(gd, ed, x2); - CSETw(x3, cEQ); - BFIw(xFlags, x3, F_ZF, 1); } else BICxw(gd, ed, x2); + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(x3, cEQ); + BFIw(xFlags, x3, F_ZF, 1); + } + } IFX(X_SF) { - LSRxw(x3, gd, rex.w?63:31); - BFIw(xFlags, x3, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(x3, gd, rex.w?63:31); + BFIw(xFlags, x3, F_SF, 1); + } + } + IFX(X_OF) { + IFNATIVE(NF_VF) {} else { BFCw(xFlags, F_OF, 1); } + } + if (BOX64DRENV(dynarec_safeflags)) { + // those are UD flags + IFX(X_AF) BFCw(xFlags, F_AF, 1); + if(BOX64ENV(cputype)) { + IFX(X_PF) BFCw(xFlags, F_PF, 1); + } else { + IFX(X_PF) emit_pf(dyn, ninst, vd, x3); + } + } + break; + + case 0xF7: + INST_NAME("BEXTR Gd, Ed, Vd"); + nextop = F8; + SETFLAGS(X_ALL, SF_SET); + GETGD; + GETED(0); + GETVD; + MOV64xw(x5, 0); + UXTBw(x4, vd); // start + UBFXw(x3, vd, 8, 8); // length + TSTw_REG(x3, x3); + B_MARK(cEQ); + CMPSw_U12(x4, rex.w?64:32); + B_MARK(cGE); + LSRxw_REG(x5, ed, x4); + CMPSw_U12(x3, rex.w?64:32); + B_MARK(cGT); + MOV32w(x4, rex.w?64:32); + SUBw_REG(x4, x4, x3); + LSLxw_REG(x5, x5, x4); + LSRxw_REG(x5, x5, x4); + MARK; + MOVxw_REG(gd, x5); + IFX(X_ZF) { + TSTxw_REG(x5, x5); + IFNATIVE(NF_EQ) {} else { + CSETw(x3, cEQ); + BFIw(xFlags, x3, F_ZF, 1); + } } IFX(X_AF) BFCw(xFlags, F_AF, 1); IFX(X_PF) BFCw(xFlags, F_PF, 1); - IFX(X_OF) BFCw(xFlags, F_OF, 1); + IFX(X_CF) BFCw(xFlags, F_CF, 1); + IFX(X_OF) { + IFNATIVE(NF_VF) {} else { BFCw(xFlags, F_OF, 1); } + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { BFCw(xFlags, F_SF, 1); } + } break; default: diff --git a/src/dynarec/arm64/dynarec_arm64_avx_66_0f.c b/src/dynarec/arm64/dynarec_arm64_avx_66_0f.c index ca141f0..7fd8418 100644 --- a/src/dynarec/arm64/dynarec_arm64_avx_66_0f.c +++ b/src/dynarec/arm64/dynarec_arm64_avx_66_0f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -22,7 +20,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) { @@ -56,9 +54,6 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, MAYUSE(s0); MAYUSE(j64); MAYUSE(cacheupd); - #if STEP > 1 - static const int8_t mask_shift8[] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - #endif /* Remember to not create a new fpu_scratch after some GY/VY/EY is created, because Y can be in the scratch area and might overlap (and scratch will win) */ @@ -81,11 +76,13 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, } else { SMREAD(); v0 = sse_get_reg_empty(dyn, ninst, x1, gd); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VLDR128_U12(v0, ed, fixedaddress); if(vex.l) { - GETGY_empty(v0, -1, -1, -1); - VLDR128_U12(v0, ed, fixedaddress+16); + GETGY_empty(v1, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VLDP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VLD128(v0, ed, fixedaddress); } } if(!vex.l) YMM0(gd); @@ -96,18 +93,21 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, GETG; v0 = sse_get_reg(dyn, ninst, x1, gd, 0); if(MODREG) { - v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7)+(rex.b<<3)); + ed = (nextop&7)+(rex.b<<3); + v1 = sse_get_reg_empty(dyn, ninst, x1, ed); VMOVQ(v1, v0); if(vex.l) { GETGYEY_empty(v0, v1); VMOVQ(v1, v0); - } + } else YMM0(ed); } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VSTR128_U12(v0, ed, fixedaddress); if(vex.l) { - GETGY(v0, 0, -1, -1, -1); - VSTR128_U12(v0, ed, fixedaddress+16); + GETGY(v1, 0, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VSTP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VST128(v0, ed, fixedaddress); } SMWRITE2(); } @@ -121,14 +121,11 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, return addr; } GETGX_empty_VX(v0, v2); - if(v0==v2) { - q0 = fpu_get_scratch(dyn, ninst); - VMOVQ(q0, v2); - } SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); VLD1_64(v0, 0, ed); - VMOVeD(v0, 1, (v0==v2)?q0:v2, 1); + if(v0!=v2) + VMOVeD(v0, 1, v2, 1); YMM0(gd); break; case 0x13: @@ -171,25 +168,22 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, return addr; } GETGX_empty_VX(v0, v2); - if(v0==v2) { - q0 = fpu_get_scratch(dyn, ninst); - VMOVQ(q0, v2); - } SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); VLD1_64(v0, 1, ed); - VMOVeD(v0, 0, (v0==v2)?q0:v2, 0); + if(v0!=v2) + VMOVeD(v0, 0, v2, 0); YMM0(gd); break; case 0x17: INST_NAME("VMOVHPD Eq, Gx"); nextop = F8; - GETGX(v0, 0); if(MODREG) { // access register instead of memory is bad opcode! DEFAULT; return addr; } + GETGX(v0, 0); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); VST1_64(v0, 1, ed); SMWRITE2(); @@ -210,11 +204,13 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, } else { SMREAD(); v0 = sse_get_reg_empty(dyn, ninst, x1, gd); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VLDR128_U12(v0, ed, fixedaddress); if(vex.l) { - GETGY_empty(v0, -1, -1, -1); - VLDR128_U12(v0, ed, fixedaddress+16); + GETGY_empty(v1, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VLDP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VLD128(v0, ed, fixedaddress); } } if(!vex.l) YMM0(gd); @@ -225,18 +221,21 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, GETG; v0 = sse_get_reg(dyn, ninst, x1, gd, 0); if(MODREG) { - v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7)+(rex.b<<3)); + ed = (nextop&7)+(rex.b<<3); + v1 = sse_get_reg_empty(dyn, ninst, x1, ed); VMOVQ(v1, v0); if(vex.l) { GETGYEY_empty(v0, v1); VMOVQ(v1, v0); - } + } else YMM0(ed); } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VSTR128_U12(v0, ed, fixedaddress); if(vex.l) { - GETGY(v0, 0, -1, -1, -1); - VSTR128_U12(v0, ed, fixedaddress+16); + GETGY(v1, 0, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VSTP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VST128(v0, ed, fixedaddress); } SMWRITE2(); } @@ -246,20 +245,17 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, INST_NAME("VMOVNTPD Ex,Gx"); nextop = F8; GETG; - v0 = sse_get_reg(dyn, ninst, x1, gd, 0); if(MODREG) { - v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7)+(rex.b<<3)); - VMOVQ(v1, v0); - if(vex.l) { - GETGYEY_empty(v0, v1); - VMOVQ(v1, v0); - } + DEFAULT; } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VSTR128_U12(v0, ed, fixedaddress); + v0 = sse_get_reg(dyn, ninst, x1, gd, 0); if(vex.l) { - GETGY(v0, 0, -1, -1, -1); - VSTR128_U12(v0, ed, fixedaddress+16); + GETGY(v1, 0, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VSTP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VST128(v0, ed, fixedaddress); } } break; @@ -272,7 +268,9 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; GETGX(v0, 0); GETEXSD(q0, 0, 0); - FCMPD(v0, q0); + IFX(X_CF|X_PF|X_ZF) { + FCMPD(v0, q0); + } FCOMI(x1, x2); break; @@ -289,11 +287,33 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, GETEY(q0); VMOVQDto(x1, q0, 0); VMOVQDto(x2, q0, 1); - LSRx(x1, x1, 63); - LSRx(x2, x2, 63); - BFIx(gd, x1, 2, 1); - BFIx(gd, x2, 3, 1); + LSRx(x2, x2, 62); + BFXILx(x2, x1, 63, 1); + BFIx(gd, x2, 2, 2); + } + break; + case 0x51: + INST_NAME("VSQRTPD Gx, Ex"); + nextop = F8; + if(!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn, ninst); + d1 = fpu_get_scratch(dyn, ninst); + } + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_empty_EX(v0, v1, 0); } else { GETGY_empty_EY(v0, v1); } + if(!BOX64ENV(dynarec_fastnan)) { + // check if any input value was NAN + VFCMEQQD(d0, v1, v1); // 0 if NAN, 1 if not NAN + VFSQRTQD(v0, v1); + VFCMEQQD(d1, v0, v0); // 0 => out is NAN + VBICQ(d1, d0, d1); // forget it in any input was a NAN already + VSHLQ_64(d1, d1, 63); // only keep the sign bit + VORRQ(v0, v0, d1); // NAN -> -NAN + } else { + VFSQRTQD(v0, v1); + } } + if(!vex.l) YMM0(gd); break; case 0x54: @@ -339,19 +359,19 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x58: INST_NAME("VADDPD Gx, Vx, Ex"); nextop = F8; - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); } for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { // check if any input value was NAN VFMAXQD(q0, v2, v1); // propagate NAN VFCMEQQD(q0, q0, q0); // 0 if NAN, 1 if not NAN } VFADDQD(v0, v2, v1); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { VFCMEQQD(q1, v0, v0); // 0 => out is NAN VBICQ(q1, q0, q1); // forget it in any input was a NAN already VSHLQ_64(q1, q1, 63); // only keep the sign bit @@ -363,19 +383,19 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x59: INST_NAME("VMULPD Gx, Vx, Ex"); nextop = F8; - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); } for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { // check if any input value was NAN VFMAXQD(q0, v2, v1); // propagate NAN VFCMEQQD(q0, q0, q0); // 0 if NAN, 1 if not NAN } VFMULQD(v0, v2, v1); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { VFCMEQQD(q1, v0, v0); // 0 => out is NAN VBICQ(q1, q0, q1); // forget it in any input was a NAN already VSHLQ_64(q1, q1, 63); // only keep the sign bit @@ -387,9 +407,9 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x5A: INST_NAME("VCVTPD2PS Gx, Ex"); nextop = F8; - GETEX(v1, 0, 0); + GETEX_Y(v1, 0, 0); GETGX_empty(v0); - if(box64_dynarec_fastround) { + if(BOX64ENV(dynarec_fastround)==2) { FCVTXN(v0, v1); } else { u8 = sse_setround(dyn, ninst, x1, x2, x4); @@ -398,7 +418,7 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, } if(vex.l) { GETEY(v1); - if(box64_dynarec_fastround) { + if(BOX64ENV(dynarec_fastround)==2) { FCVTXN2(v0, v1); } else { FCVTN2(v0, v1); @@ -411,18 +431,18 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, INST_NAME("VCVTPS2DQ Gx, Ex"); nextop = F8; u8 = sse_setround(dyn, ninst, x1, x2, x6); - if(!box64_dynarec_fastround && !arm64_frintts) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { d0 = fpu_get_scratch(dyn, ninst); d1 = fpu_get_scratch(dyn, ninst); MOVI_32_lsl(d1, 0x80, 3); } for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETEX(v1, 0, 0); GETGX_empty(v0); } else { GETGY_empty_EY(v0, v1); } - if(box64_dynarec_fastround) { + if(!l) { GETGX_empty_EX(v0, v1, 0); } else { GETGY_empty_EY(v0, v1); } + if(BOX64ENV(dynarec_fastround)) { VFRINTISQ(v0, v1); VFCVTZSQS(v0, v0); } else { - if(arm64_frintts) { + if(cpuext.frintts) { VFRINT32XSQ(v0, v1); VFCVTZSQS(v0, v0); } else { @@ -430,11 +450,15 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, for(int i=0; i<4; ++i) { BFCx(x5, FPSR_IOC, 1); // reset IOC bits MSR_fpsr(x5); - VMOVeS(d0, 0, v1, i); - FRINTIS(d0, d0); + if(i) { + VMOVeS(d0, 0, v1, i); + FRINTIS(d0, d0); + } else { + FRINTIS(d0, v1); + } VFCVTZSs(d0, d0); MRS_fpsr(x5); // get back FPSR to check the IOC bit - TSTw_mask(x5, 0, 0); // mask=1 + TSTw_mask(x5, 0, 0); // mask=(1< out is NAN VBICQ(q1, q0, q1); // forget it in any input was a NAN already VSHLQ_64(q1, q1, 63); // only keep the sign bit @@ -471,36 +495,33 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x5D: INST_NAME("VMINPD Gx, Vx, Ex"); nextop = F8; - if(!box64_dynarec_fastnan) - q0 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } // FMIN/FMAX wll not copy a NaN if either is NaN // but x86 will copy src2 if either value is NaN, so lets force a copy of Src2 (Ex) if result is NaN - VFMINQD(v0, v2, v1); - if(!box64_dynarec_fastnan && (v2!=v1)) { - VFCMEQQD(q0, v0, v0); // 0 is NaN, 1 is not NaN, so MASK for NaN - VBIFQ(v0, v1, q0); // copy dest where source is NaN - } + VFCMGTQD(q0, v1, v2); // 0 if NaN or v1 GT v2, so invert mask for copy + if(v0!=v1) VBIFQ(v0, v1, q0); + if(v0!=v2) VBITQ(v0, v2, q0); } if(!vex.l) YMM0(gd); break; case 0x5E: - INST_NAME("DIVPD Gx, Ex"); + INST_NAME("VDIVPD Gx, Ex"); nextop = F8; - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); } for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { // check if any input value was NAN VFMAXQD(q0, v2, v1); // propagate NAN VFCMEQQD(q0, q0, q0); // 0 if NAN, 1 if not NAN } VFDIVQD(v0, v2, v1); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { VFCMEQQD(q1, v0, v0); // 0 => out is NAN VBICQ(q1, q0, q1); // forget it in any input was a NAN already VSHLQ_64(q1, q1, 63); // only keep the sign bit @@ -512,18 +533,14 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x5F: INST_NAME("VMAXPD Gx, Vx, Ex"); nextop = F8; - if(!box64_dynarec_fastnan) { - q0 = fpu_get_scratch(dyn, ninst); - } + q0 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } // FMIN/FMAX wll not copy a NaN if either is NaN // but x86 will copy src2 if either value is NaN, so lets force a copy of Src2 (Ex) if result is NaN - VFMAXQD(v0, v2, v1); - if(!box64_dynarec_fastnan && (v2!=v1)) { - VFCMEQQD(q0, v0, v0); // 0 is NaN, 1 is not NaN, so MASK for NaN - VBIFQ(v0, v1, q0); // copy dest where source is NaN - } + VFCMGTQD(q0, v2, v1); // 0 if NaN or v2 GT v1, so invert mask for copy + if(v0!=v1) VBIFQ(v0, v1, q0); + if(v0!=v2) VBITQ(v0, v2, q0); } if(!vex.l) YMM0(gd); break; @@ -750,8 +767,7 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, INST_NAME("VMOVDQA Gx, Ex"); nextop = F8; if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); - GETGX_empty(v0); + GETGX_empty_EX(v0, v1, 0); VMOVQ(v0, v1); if(vex.l) { GETGY_empty_EY(v0, v1); @@ -760,11 +776,13 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, } else { GETGX_empty(v0); SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VLDR128_U12(v0, ed, fixedaddress); if(vex.l) { - GETGY_empty(v0, -1, -1, -1); - VLDR128_U12(v0, ed, fixedaddress+16); + GETGY_empty(v1, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VLDP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VLD128(v0, ed, fixedaddress); } } if(!vex.l) YMM0(gd); @@ -772,58 +790,121 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x70: INST_NAME("VPSHUFD Gx, Ex, Ib"); nextop = F8; - if(MODREG) { - u8 = F8; - d0 = fpu_get_scratch(dyn, ninst); - for(int l=0; l<1+vex.l; ++l) { + for(int l=0; l<1+vex.l; ++l) { + if(MODREG) { + ed = (nextop&7)+(rex.b<<3); + if(!l) + v1 = sse_get_reg(dyn, ninst, x1, ed, 0); + else + v1 = ymm_get_reg(dyn, ninst, x1, ed, 0, gd, -1, -1); + + } else { + ed = -1; if(!l) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); - GETGX_empty(v0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1); + v1 = fpu_get_scratch(dyn, ninst); } else { - GETGY_empty_EY(v0, v1); + ADDx_U12(x1, wback, 16); + wback = x1; } - if(u8==0x4E) { - if(v0==v1) { - VEXTQ_8(v0, v0, v0, 8); - } else { - VMOVeD(v0, 0, v1, 1); - VMOVeD(v0, 1, v1, 0); + } + if(!l) { + u8 = F8; + GETGX_empty(v0); + } else { + GETGY_empty(v0, ed, -1, -1); + } + switch(u8) { + case 0x4E: // Swap Up/Lower 64bits parts + if(!MODREG) + VLDR128_U12(v1, wback, 0); + VEXTQ_8(v0, v1, v1, 8); + break; + case 0x00: // duplicate lower 32bits to all spot + if(MODREG) + VDUPQ_32(v0, v1, 0); + else + VLDQ1R_32(v0, wback); + break; + case 0x55: // duplicate slot 1 to all spot + if(MODREG) + VDUPQ_32(v0, v1, 1); + else { + ADDx_U12(x2, wback, 4); + VLDQ1R_32(v0, x2); } - } else if(u8==0x00) { - VDUPQ_32(v0, v1, 0); - } else if(u8==0x55) { - VDUPQ_32(v0, v1, 1); - } else if(u8==0xAA) { - VDUPQ_32(v0, v1, 2); - } else if(u8==0xFF) { - VDUPQ_32(v0, v1, 3); - } else if(u8==0x44) { - VDUPQ_64(v0, v1, 0); - } else if(u8==0xEE) { - VDUPQ_64(v0, v1, 1); - } else if(u8==0xB1) { + break; + case 0xAA: // duplicate slot 2 to all spot + if(MODREG) + VDUPQ_32(v0, v1, 2); + else { + ADDx_U12(x2, wback, 8); + VLDQ1R_32(v0, x2); + } + break; + case 0xFF: // duplicate slot 3 to all spot + if(MODREG) + VDUPQ_32(v0, v1, 3); + else { + ADDx_U12(x2, wback, 12); + VLDQ1R_32(v0, x2); + } + break; + case 0x44: // duplicate slot 0/1 to all spot + if(MODREG) + VDUPQ_64(v0, v1, 0); + else + VLDQ1R_64(v0, wback); + break; + case 0xEE: // duplicate slot 2/3 to all spot + if(MODREG) + VDUPQ_64(v0, v1, 1); + else { + ADDx_U12(x2, wback, 8); + VLDQ1R_64(v0, x2); + } + break; + case 0xB1: // invert 0/1 and 2/3 + if(!MODREG) + VLDR128_U12(v1, wback, 0); VREV64Q_32(v0, v1); - } else if(u8==0xFA) { - VZIP2Q_32(v0, v1, v1); - } else if(u8==0x50) { - VZIP1Q_32(v0, v1, v1); - } else if(u8==0xF5) { - VTRNQ2_32(v0, v1, v1); - } else if(u8==0xA0) { - VTRNQ1_32(v0, v1, v1); - } else if(v0!=v1) { - VMOVeS(v0, 0, v1, (u8>>(0*2))&3); - VMOVeS(v0, 1, v1, (u8>>(1*2))&3); - VMOVeS(v0, 2, v1, (u8>>(2*2))&3); - VMOVeS(v0, 3, v1, (u8>>(3*2))&3); - } else { - if(!l) { + break; + case 0x39: // 0 3 2 1: ror 32 bits + if(!MODREG) + VLDR128_U12(v1, wback, 0); + VEXTQ_8(v0, v1, v1, 4); + break; + case 0x93: // 2 1 0 3: 0 3 2 1: ror 32 bits then invert low/high 64bits + if(!MODREG) + VLDR128_U12(v1, wback, 0); + VEXTQ_8(v0, v1, v1, 4); + VEXTQ_8(v0, v0, v0, 8); + break; + default: + if(!MODREG) { + i32 = -1; + for (int i=0; i<4; ++i) { + int32_t idx = (u8>>(i*2))&3; + if(idx!=i32) { + ADDx_U12(x2, wback, idx*4); + i32 = idx; + } + VLD1_32(v0, i, x2); + } + } else if(v0!=v1) { + VMOVeS(v0, 0, v1, (u8>>(0*2))&3); + VMOVeS(v0, 1, v1, (u8>>(1*2))&3); + VMOVeS(v0, 2, v1, (u8>>(2*2))&3); + VMOVeS(v0, 3, v1, (u8>>(3*2))&3); + } else { uint64_t swp[4] = { (0)|(1<<8)|(2<<16)|(3<<24), (4)|(5<<8)|(6<<16)|(7<<24), (8)|(9<<8)|(10<<16)|(11<<24), (12)|(13<<8)|(14<<16)|(15<<24) }; + if(!l) d0 = fpu_get_scratch(dyn, ninst); tmp64u = swp[(u8>>(0*2))&3] | (swp[(u8>>(1*2))&3]<<32); MOV64x(x2, tmp64u); VMOVQDfrom(d0, 0, x2); @@ -834,35 +915,8 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, MOV64x(x3, tmp64u2); VMOVQDfrom(d0, 1, x3); } + VTBLQ1_8(v0, v1, d0); } - VTBLQ1_8(v0, v1, d0); - } - } - } else { - SMREAD(); - for(int l=0; l<1+vex.l; ++l) { - i32 = -1; - if(!l) { - GETGX_empty(v0); - addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1); - u8 = F8; - } else { - GETGY_empty(v0, -1, -1, -1); - ADDx_U12(x3, ed, 16); - ed = x3; - } - if (u8) { - for (int i=0; i<4; ++i) { - int32_t idx = (u8>>(i*2))&3; - if(idx!=i32) { - ADDx_U12(x2, ed, idx*4); - i32 = idx; - } - VLD1_32(v0, i, x2); - } - } else { - VLDQ1R_32(v0, ed); - } } } if(!vex.l) YMM0(gd); @@ -887,8 +941,7 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 4: INST_NAME("VPSRAW Vx, Ex, Ib"); for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETVX_empty_EX(v0, v1, 1); u8 = F8; } else { GETVY_empty_EY(v0, v1); } - if(u8>15) u8=15; + if(!l) { GETVX_empty_EX(v0, v1, 1); u8 = F8; if(u8>15) u8=15;} else { GETVY_empty_EY(v0, v1); } if(u8) { VSSHRQ_16(v0, v1, u8); } else if(v0!=v1) VMOVQ(v0, v1); @@ -943,10 +996,10 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, if(!l) { GETVX_empty_EX(v0, v1, 1); u8 = F8; + if(u8>31) u8=31; } else { GETVY_empty_EY(v0, v1); } - if(u8>31) u8=31; if(u8) { VSSHRQ_32(v0, v1, u8); } else if(v0!=v1) @@ -1105,22 +1158,19 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x7C: INST_NAME("VHADDPD Gx, Vx, Ex"); nextop = F8; - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); } for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { // check if any input value was NAN - // but need to mix low/high part - VTRNQ1_64(q0, v2, v1); - VTRNQ2_64(q1, v2, v1); - VFMAXQD(q0, q0, q1); // propagate NAN + VFMAXPQD(q0, v2, v1); // propagate NAN VFCMEQQD(q0, q0, q0); // 0 if NAN, 1 if not NAN } VFADDPQD(v0, v2, v1); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { VFCMEQQD(q1, v0, v0); // 0 => out is NAN VBICQ(q1, q0, q1); // forget it in any input was a NAN already VSHLQ_64(q1, q1, 63); // only keep the sign bit @@ -1129,14 +1179,39 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, } if(!vex.l) YMM0(gd); break; - + case 0x7D: + INST_NAME("VHSUBPD Gx, Vx, Ex"); + nextop = F8; + q0 = fpu_get_scratch(dyn, ninst); + if(!BOX64ENV(dynarec_fastnan)) + q1 = fpu_get_scratch(dyn, ninst); + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } + VUZP1Q_64(q0, v2, v1); + VUZP2Q_64(v0, v2, v1); + if(!BOX64ENV(dynarec_fastnan)) { + // check if any input value was NAN + // but need to mix low/high part + VFMAXQD(q1, v0, q0); // propagate NAN + VFCMEQQD(q1, q1, q1); // 0 if NAN, 1 if not NAN + } + VFSUBQD(v0, q0, v0); + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQD(q0, v0, v0); // 0 => out is NAN + VBICQ(q1, q1, q0); // forget it in any input was a NAN already + VSHLQ_64(q1, q1, 63); // only keep the sign bit + VORRQ(v0, v0, q1); // NAN -> -NAN + } + } + if(!vex.l) YMM0(gd); + break; case 0x7E: INST_NAME("VMOVD Ed,Gx"); nextop = F8; GETGX(v0, 0); if(rex.w) { if(MODREG) { - ed = xRAX + (nextop&7) + (rex.b<<3); + ed = TO_NAT((nextop & 0x07) + (rex.b << 3)); VMOVQDto(ed, v0, 0); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); @@ -1145,7 +1220,7 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, } } else { if(MODREG) { - ed = xRAX + (nextop&7) + (rex.b<<3); + ed = TO_NAT((nextop & 0x07) + (rex.b << 3)); VMOVSto(ed, v0, 0); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); @@ -1159,18 +1234,21 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; GETGX(v0, 0); if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1); + ed = (nextop&7)+(rex.b<<3); + v1 = sse_get_reg(dyn, ninst, x1, ed, 1); VMOVQ(v1, v0); if(vex.l) { GETGYEY(v0, v1); VMOVQ(v1, v0); - } + } else YMM0(ed); } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VSTR128_U12(v0, ed, fixedaddress); if(vex.l) { - GETGY(v0, 0, -1, -1, -1); - VSTR128_U12(v0, ed, fixedaddress+16); + GETGY(v1, 0, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VSTP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VST128(v0, ed, fixedaddress); } SMWRITE2(); } @@ -1182,7 +1260,7 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, q0 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 1); u8 = F8; } else { GETGY_empty_VYEY(v0, v2, v1); } - if(((u8&15)==3) || ((u8&15)==7) || ((u8&15)==8) || ((u8&15)==9) || ((u8&15)==10) || ((u8&15)==12) || ((u8&15)==13) || ((u8&15)==14)) { + if(((u8&15)==3) || ((u8&15)==7) || ((u8&15)==8) || ((u8&15)==9) || ((u8&15)==10) || ((u8&15)==12)) { VFMAXQD(q0, v2, v1); // propagate NAN VFCMEQQD(((u8&15)==7)?v0:q0, q0, q0); // 0 if NAN, 1 if not NAN } @@ -1216,7 +1294,7 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, if(v0!=v2) VMOVQ(v0, v2); if(MODREG) { u8 = (F8)&7; - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); VMOVQHfrom(v0, u8, ed); } else { SMREAD(); @@ -1231,7 +1309,7 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; GETGD; if(MODREG) { - GETEX(v0, 0, 1); + GETEX(v0, 0, 1); // no vex.l case u8 = (F8)&7; VMOVHto(gd, v0, u8); } else { @@ -1284,15 +1362,14 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); + GETEX(v1, 0, 0); MOVI_32(q1, 16); + UQXTN_32(q0, v1); + UMIN_32(q0, q0, q1); // limit to 0 .. +16 values + NEG_32(q0, q0); // neg to do shr + VDUPQ_16(q0, q0, 0); // only the low 8bits will be used anyway for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } - if(!l) { - UQXTN_32(q0, v1); - UMIN_32(q0, q0, q1); // limit to 0 .. +16 values - NEG_32(q0, q0); // neg to do shr - VDUPQ_16(q0, q0, 0); // only the low 8bits will be used anyway - } + if(!l) { GETGX_empty_VX(v0, v2); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } USHLQ_16(v0, v2, q0); // SHR x8 } if(!vex.l) YMM0(gd); @@ -1302,15 +1379,14 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); + GETEX(v1, 0, 0); MOVI_32(q1, 32); + UQXTN_32(q0, v1); + UMIN_32(q0, q0, q1); // limit to 0 .. +32 values + NEG_32(q0, q0); // neg to do shr + VDUPQ_32(q0, q0, 0); // only the low 8bits will be used anyway for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } - if(!l) { - UQXTN_32(q0, v1); - UMIN_32(q0, q0, q1); // limit to 0 .. +32 values - NEG_32(q0, q0); // neg to do shr - VDUPQ_16(q0, q0, 0); // only the low 8bits will be used anyway - } + if(!l) { GETGX_empty_VX(v0, v2); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } USHLQ_32(v0, v2, q0); // SHR x4 } if(!vex.l) YMM0(gd); @@ -1320,15 +1396,14 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); + GETEX(v1, 0, 0); MOVI_32(q1, 64); + UQXTN_32(q0, v1); + UMIN_32(q0, q0, q1); // limit to 0 .. +64 values + NEG_32(q0, q0); // neg to do shr + VDUPQ_32(q0, q0, 0); // only the low 8bits will be used anyway for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } - if(!l) { - UQXTN_32(q0, v1); - UMIN_32(q0, q0, q1); // limit to 0 .. +64 values - NEG_32(q0, q0); // neg to do shr - VDUPQ_16(q0, q0, 0); // only the low 8bits will be used anyway - } + if(!l) { GETGX_empty_VX(v0, v2); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } USHLQ_64(v0, v2, q0); } if(!vex.l) YMM0(gd); @@ -1357,46 +1432,51 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, GETG; v0 = sse_get_reg(dyn, ninst, x1, gd, 0); if(MODREG) { - v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7)+(rex.b<<3)); + ed = (nextop&7)+(rex.b<<3); + v1 = sse_get_reg_empty(dyn, ninst, x1, ed); VMOV(v1, v0); - YMM0((nextop&7)+(rex.b<<3)); + YMM0(ed); } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xfff<<3, 7, rex, NULL, 0, 0); - VSTR64_U12(v0, ed, fixedaddress); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); + VST64(v0, ed, fixedaddress); + SMWRITE2(); } break; case 0xD7: nextop = F8; - INST_NAME("VPMOVMSKB Gd, Ex"); - v0 = fpu_get_scratch(dyn, ninst); - v1 = fpu_get_scratch(dyn, ninst); - q1 = fpu_get_scratch(dyn, ninst); - GETEX_Y(q0, 0, 0); - GETGD; - TABLE64(x2, (uintptr_t)&mask_shift8); - VLDR64_U12(v0, x2, 0); // load shift - VDUPQ_64(v0, v0, 0); - VSHRQ_8(q1, q0, 7); - USHLQ_8(q1, q1, v0); // shift - UADDLV_8(v1, q1); // accumalte - VMOVBto(gd, v1, 0); - // and now the high part - VMOVeD(q1, 0, q1, 1); - UADDLV_8(q1, q1); // accumalte - VMOVBto(x2, q1, 0); - BFIw(gd, x2, 8, 8); - if(vex.l) { - GETEY(q0); + if(MODREG) { + INST_NAME("VPMOVMSKB Gd, Ex"); + v0 = fpu_get_scratch(dyn, ninst); + v1 = fpu_get_scratch(dyn, ninst); + q1 = fpu_get_scratch(dyn, ninst); + GETEX_Y(q0, 0, 0); + GETGD; + TABLE64_(x2, 0x0706050403020100LL); + VDUPQD(v0, x2); VSHRQ_8(q1, q0, 7); USHLQ_8(q1, q1, v0); // shift UADDLV_8(v1, q1); // accumalte - VMOVBto(x2, v1, 0); - BFIw(gd, x2, 16, 8); + VMOVBto(gd, v1, 0); // and now the high part VMOVeD(q1, 0, q1, 1); UADDLV_8(q1, q1); // accumalte VMOVBto(x2, q1, 0); - BFIw(gd, x2, 24, 8); + BFIw(gd, x2, 8, 8); + if(vex.l) { + GETEY(q0); + VSHRQ_8(q1, q0, 7); + USHLQ_8(q1, q1, v0); // shift + UADDLV_8(v1, q1); // accumalte + VMOVBto(x2, v1, 0); + BFIw(gd, x2, 16, 8); + // and now the high part + VMOVeD(q1, 0, q1, 1); + UADDLV_8(q1, q1); // accumalte + VMOVBto(x2, q1, 0); + BFIw(gd, x2, 24, 8); + } + } else { + DEFAULT; } break; case 0xD8: @@ -1521,15 +1601,14 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); + GETEX(v1, 0, 0); MOVI_32(q1, 15); + UQXTN_32(q0, v1); + UMIN_32(q0, q0, q1); // limit to -15 .. +15 values + NEG_16(q0, q0); + VDUPQ_16(q0, q0, 0); // only the low 8bits will be used anyway for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } - if(!l) { - UQXTN_32(q0, v1); - UMIN_32(q0, q0, q1); // limit to -15 .. +15 values - NEG_16(q0, q0); - VDUPQ_16(q0, q0, 0); // only the low 8bits will be used anyway - } + if(!l) { GETGX_empty_VX(v0, v2); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } SSHLQ_16(v0, v2, q0); } if(!vex.l) YMM0(gd); @@ -1539,15 +1618,14 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); + GETEX(v1, 0, 0); MOVI_32(q1, 31); + UQXTN_32(q0, v1); + UMIN_32(q0, q0, q1); // limit to 0 .. +31 values + NEG_32(q0, q0); + VDUPQ_32(q0, q0, 0); // only the low 8bits will be used anyway for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } - if(!l) { - UQXTN_32(q0, v1); - UMIN_32(q0, q0, q1); // limit to 0 .. +31 values - NEG_32(q0, q0); - VDUPQ_32(q0, q0, 0); // only the low 8bits will be used anyway - } + if(!l) { GETGX_empty_VX(v0, v2); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } SSHLQ_32(v0, v2, q0); } if(!vex.l) YMM0(gd); @@ -1570,7 +1648,7 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } VUMULL_16(q0, v2, v1); VUMULL2_16(q1, v2, v1); - UQSHRN_16(v0, q0, 16); + UQSHRN_16(v0, q0, 16); // 16bits->16bits: no saturation UQSHRN2_16(v0, q1, 16); } if(!vex.l) YMM0(gd); @@ -1597,39 +1675,46 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, GETEX_Y(v1, 0, 0); GETGX_empty(v0); } else { - if(box64_dynarec_fastround) + if(BOX64ENV(dynarec_fastround)) d0 = fpu_get_scratch(dyn, ninst); GETEY(v1); } - if(box64_dynarec_fastround) { + if(BOX64ENV(dynarec_fastround)) { VFCVTZSQD(l?d0:v0, v1); // convert double -> int64 if(!l) SQXTN_32(v0, v0); // convert int64 -> int32 with saturation in lower part, RaZ high part else SQXTN2_32(v0, d0); // convert int64 -> int32 with saturation in higher part } else { - if(!l) { - MRS_fpsr(x5); - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - ORRw_mask(x4, xZR, 1, 0); //0x80000000 - d0 = fpu_get_scratch(dyn, ninst); - } - for(int i=0; i<2; ++i) { - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - if(i) { - VMOVeD(d0, 0, v1, i); - FCVTZSwD(x1, d0); - } else { - FCVTZSwD(x1, v1); + if(cpuext.frintts) { + VFRINT32ZDQ(l?d0:v0, v1); // handle overflow + VFCVTZSQD(l?d0:v0, l?d0:v0); // convert double -> int64 + if(!l) + SQXTN_32(v0, v0); // convert int64 -> int32 with saturation in lower part, RaZ high part + else + SQXTN2_32(v0, d0); // convert int64 -> int32 with saturation in higher part + } else { + if(!l) { + MRS_fpsr(x5); + ORRw_mask(x4, xZR, 1, 0); //0x80000000 + d0 = fpu_get_scratch(dyn, ninst); + } + for(int i=0; i<2; ++i) { + BFCw(x5, FPSR_IOC, 1); // reset IOC bit + MSR_fpsr(x5); + if(i) { + VMOVeD(d0, 0, v1, i); + FCVTZSwD(x1, d0); + } else { + FCVTZSwD(x1, v1); + } + MRS_fpsr(x5); // get back FPSR to check the IOC bit + TSTw_mask(x5, 0, 0); // mask = 1 = FPSR_IOC + CSELx(x1, x1, x4, cEQ); + VMOVQSfrom(v0, i+l*2, x1); } - MRS_fpsr(x5); // get back FPSR to check the IOC bit - TSTw_mask(x5, 0, 0); // mask = 1 = FPSR_IOC - CSELx(x1, x1, x4, cEQ); - VMOVQSfrom(v0, i+l*2, x1); + if(!vex.l && !l) VMOVQDfrom(v0, 1, xZR); } - if(!vex.l && !l) VMOVQDfrom(v0, 1, xZR); } } YMM0(gd); @@ -1638,20 +1723,17 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, INST_NAME("VMOVNTDQ Ex,Gx"); nextop = F8; GETG; - v0 = sse_get_reg(dyn, ninst, x1, gd, 0); if(MODREG) { - v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7)+(rex.b<<3)); - VMOVQ(v1, v0); - if(vex.l) { - GETGYEY_empty(v0, v1); - VMOVQ(v1, v0); - } + DEFAULT; } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VSTR128_U12(v0, ed, fixedaddress); + v0 = sse_get_reg(dyn, ninst, x1, gd, 0); if(vex.l) { - GETGY(v0, 0, -1, -1, -1); - VSTR128_U12(v0, ed, fixedaddress+16); + GETGY(v1, 0, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VSTP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VST128(v0, ed, fixedaddress); } } break; @@ -1773,12 +1855,13 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); + GETEX(v1, 0, 0); + UQXTN_32(q0, v1); MOVI_32(q1, 16); + UMIN_32(q0, q0, q1); // limit to 0 .. +16 values + VDUPQ_16(q0, q0, 0); // only the low 8bits will be used anyway for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } - UQXTN_32(q0, v1); - UMIN_32(q0, q0, q1); // limit to 0 .. +16 values - VDUPQ_16(q0, q0, 0); // only the low 8bits will be used anyway + if(!l) { GETGX_empty_VX(v0, v2); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } USHLQ_16(v0, v2, q0); } if(!vex.l) YMM0(gd); @@ -1788,12 +1871,13 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); + GETEX(v1, 0, 0); + UQXTN_32(q0, v1); MOVI_32(q1, 32); + UMIN_32(q0, q0, q1); // limit to 0 .. +32 values + VDUPQ_32(q0, q0, 0); // only the low 8bits will be used anyway for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } - UQXTN_32(q0, v1); - UMIN_32(q0, q0, q1); // limit to 0 .. +32 values - VDUPQ_32(q0, q0, 0); // only the low 8bits will be used anyway + if(!l) { GETGX_empty_VX(v0, v2); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } USHLQ_32(v0, v2, q0); } if(!vex.l) YMM0(gd); @@ -1803,12 +1887,13 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); + GETEX(v1, 0, 0); + UQXTN_32(q0, v1); MOVI_32(q1, 64); + UMIN_32(q0, q0, q1); // limit to 0 .. +64 values + VDUPQ_64(q0, q0, 0); // only the low 8bits will be used anyway for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } - UQXTN_32(q0, v1); - UMIN_32(q0, q0, q1); // limit to 0 .. +64 values - VDUPQ_64(q0, q0, 0); // only the low 8bits will be used anyway + if(!l) { GETGX_empty_VX(v0, v2); } else { GETGY_empty_VY(v0, v2, 0, -1, -1); } USHLQ_64(v0, v2, q0); } if(!vex.l) YMM0(gd); @@ -1858,7 +1943,21 @@ uintptr_t dynarec64_AVX_66_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, } if(!vex.l) YMM0(gd); break; - + case 0xF7: + INST_NAME("VMASKMOVDQU Gx, Ex"); + nextop = F8; + GETGX(q0, 0); + GETEX(q1, 0, 0); //no vex.l case + v0 = fpu_get_scratch(dyn, ninst); + VLDR128_U12(v0, xRDI, 0); + if(MODREG) + v1 = fpu_get_scratch(dyn, ninst); // need to preserve the register + else + v1 = q1; + VSSHRQ_8(v1, q1, 7); // get the mask + VBITQ(v0, q0, v1); + VSTR128_U12(v0, xRDI, 0); // put back + break; case 0xF8: INST_NAME("VPSUBB Gx, Vx, Ex"); nextop = F8; diff --git a/src/dynarec/arm64/dynarec_arm64_avx_66_0f38.c b/src/dynarec/arm64/dynarec_arm64_avx_66_0f38.c index 7e41bec..cbbdae9 100644 --- a/src/dynarec/arm64/dynarec_arm64_avx_66_0f38.c +++ b/src/dynarec/arm64/dynarec_arm64_avx_66_0f38.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -22,7 +20,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) { @@ -94,9 +92,20 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip } if(!vex.l) YMM0(gd); break; - + case 0x03: + INST_NAME("VPHADDSW Gx, Vx, Ex"); + nextop = F8; + v0 = fpu_get_scratch(dyn, ninst); + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_empty_VXEX(q0, q2, q1, 0); } else { GETGY_empty_VYEY(q0, q2, q1); } + VUZP2Q_16(v0, q2, q1); + VUZP1Q_16(q0, q2, q1); + SQADDQ_16(q0, q0, v0); + } + if(!vex.l) YMM0(gd); + break; case 0x04: - INST_NAME("PMADDUBSW Gx, Vx, Ex"); + INST_NAME("VPMADDUBSW Gx, Vx, Ex"); nextop = F8; q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); @@ -121,7 +130,42 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip } if(!vex.l) YMM0(gd); break; - + case 0x05: + INST_NAME("VPHSUBW Gx, Vx, Ex"); + nextop = F8; + v0 = fpu_get_scratch(dyn, ninst); + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_empty_VXEX(q0, q2, q1, 0); } else { GETGY_empty_VYEY(q0, q2, q1); } + VUZP2Q_16(v0, q2, q1); + VUZP1Q_16(q0, q2, q1); + VSUBQ_16(q0, q0, v0); + } + if(!vex.l) YMM0(gd); + break; + case 0x06: + INST_NAME("VPHSUBD Gx, Vx, Ex"); + nextop = F8; + v0 = fpu_get_scratch(dyn, ninst); + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_empty_VXEX(q0, q2, q1, 0); } else { GETGY_empty_VYEY(q0, q2, q1); } + VUZP2Q_32(v0, q2, q1); + VUZP1Q_32(q0, q2, q1); + VSUBQ_32(q0, q0, v0); + } + if(!vex.l) YMM0(gd); + break; + case 0x7: + INST_NAME("VPHSUBSW Gx, Vx, Ex"); + nextop = F8; + v0 = fpu_get_scratch(dyn, ninst); + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_empty_VXEX(q0, q2, q1, 0); } else { GETGY_empty_VYEY(q0, q2, q1); } + VUZP2Q_16(v0, q2, q1); + VUZP1Q_16(q0, q2, q1); + SQSUBQ_16(q0, q0, v0); + } + if(!vex.l) YMM0(gd); + break; case 0x08: INST_NAME("VPSIGNB Gx, Vx, Ex"); nextop = F8; @@ -170,10 +214,17 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip case 0x0B: INST_NAME("VPMULHRSW Gx,Vx, Ex"); nextop = F8; + q0 = fpu_get_scratch(dyn, ninst); + q1 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } - SQRDMULHQ_16(v0, v2, v1); - } + VSMULL_16(q0, v1, v2); + VSMULL2_16(q1, v1, v2); + SRSHRQ_32(q0, q0, 15); + SRSHRQ_32(q1, q1, 15); + XTN_16(v0, q0); + XTN2_16(v0, q1); + } if(!vex.l) YMM0(gd); break; case 0x0C: @@ -201,6 +252,109 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip if(!vex.l) YMM0(gd); break; + case 0x0E: + INST_NAME("VTESTPS GX, EX"); + SETFLAGS(X_ALL, SF_SET); + nextop = F8; + GETGX(v0, 0); + GETEX_Y(v1, 0, 0); + v2 = fpu_get_scratch(dyn, ninst); + if(vex.l) { + if(!MODREG) + q1 = fpu_get_scratch(dyn, ninst); + q2 = fpu_get_scratch(dyn, ninst); + GETGY(q0, 0, MODREG?((nextop&7)+(rex.b<<3)):-1, -1, -1); + GETEY(q1); + } + IFX(X_CF) { + VBICQ(v2, v1, v0); + VSHRQ_32(v2, v2, 31); + if(vex.l) { + VBICQ(q2, q1, q0); + VSHRQ_32(q2, q2, 31); + VORRQ(v2, v2, q2); + } + CMEQQ_0_64(v2, v2); + UQXTN_32(v2, v2); + VMOVQDto(x2, v2, 0); + ADDSx_U12(xZR, x2, 1); + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_CF, 1); + } + IFX(X_ZF) { + VANDQ(v2, v0, v1); + VSHRQ_32(v2, v2, 31); + if(vex.l) { + VANDQ(q2, q0, q1); + VSHRQ_32(q2, q2, 31); + VORRQ(v2, v2, q2); + } + CMEQQ_0_64(v2, v2); + UQXTN_32(v2, v2); + VMOVQDto(x2, v2, 0); + ADDSx_U12(xZR, x2, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_ZF, 1); + } + } + IFX(X_AF|X_SF|X_OF|X_PF) { + MOV32w(x2, (1< 0 - UQXTN_16(v0, q1); + SQXTUN_16(v0, v2); if(v2==v1) { VMOVeD(v0, 1, v0, 0); } else { - SMAXQ_32(q1, v1, q0); - UQXTN2_16(v0, q1); + SQXTUN2_16(v0, v1); } } if(!vex.l) YMM0(gd); @@ -520,125 +681,201 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip case 0x2C: INST_NAME("VMASKMOVPS Gx, Vx, Ex"); nextop = F8; - GETGX_empty_VXEX(v0, v2, v1, 0); + GETVX(v2, 0); + GETGX_empty(v0); q0 = fpu_get_scratch(dyn, ninst); - // create mask VSSHRQ_32(q0, v2, 31); - VANDQ(v0, v1, q0); + if (MODREG) { + DEFAULT; + return addr; + } else { + VEORQ(v0, v0, v0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + VMOVSto(x4, q0, 0); + CBZw(x4, 4+1*4); + VLD1_32(v0, 0, ed); + ADDx_U12(x3, ed, 4); + ed = x3; + VMOVSto(x4, q0, 1); + CBZw(x4, 4+1*4); + VLD1_32(v0, 1, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 2); + CBZw(x4, 4+1*4); + VLD1_32(v0, 2, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 3); + CBZw(x4, 4+1*4); + VLD1_32(v0, 3, ed); + if(vex.l) + ADDx_U12(ed, ed, 4); + } if(vex.l) { - GETGY_empty_VYEY(v0, v2, v1); + v2 = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); + v0 = ymm_get_reg_empty(dyn, ninst, x1, gd, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); VSSHRQ_32(q0, v2, 31); - VANDQ(v0, v1, q0); + VEORQ(v0, v0, v0); + VMOVSto(x4, q0, 0); + CBZw(x4, 4+1*4); + VLD1_32(v0, 0, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 1); + CBZw(x4, 4+1*4); + VLD1_32(v0, 1, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 2); + CBZw(x4, 4+1*4); + VLD1_32(v0, 2, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 3); + CBZw(x4, 4+1*4); + VLD1_32(v0, 3, ed); } else YMM0(gd); break; case 0x2D: INST_NAME("VMASKMOVPD Gx, Vx, Ex"); nextop = F8; - GETGX_empty_VXEX(v0, v2, v1, 0); + GETVX(v2, 0); + GETGX_empty(v0); q0 = fpu_get_scratch(dyn, ninst); // create mask VSSHRQ_64(q0, v2, 63); - VANDQ(v0, v1, q0); + VEORQ(v0, v0, v0); + if (MODREG) { + DEFAULT; + return addr; + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + VMOVQDto(x4, q0, 0); + CBZx(x4, 4+1*4); + VLD1_64(v0, 0, ed); + ADDx_U12(x3, ed, 8); + ed = x3; + VMOVQDto(x4, q0, 1); + CBZx(x4, 4+1*4); + VLD1_64(v0, 1, ed); + if(vex.l) + ADDx_U12(ed, ed, 8); + } if(vex.l) { - GETGY_empty_VYEY(v0, v2, v1); + v2 = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); + v0 = ymm_get_reg_empty(dyn, ninst, x1, gd, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); VSSHRQ_64(q0, v2, 63); - VANDQ(v0, v1, q0); + VEORQ(v0, v0, v0); + VMOVQDto(x4, q0, 0); + CBZx(x4, 4+1*4); + VLD1_64(v0, 0, ed); + ADDx_U12(ed, ed, 8); + VMOVQDto(x4, q0, 1); + CBZx(x4, 4+1*4); + VLD1_64(v0, 1, ed); } else YMM0(gd); break; case 0x2E: - INST_NAME("VMASKMOVPS Ex, Gx, Vx"); + INST_NAME("VMASKMOVPS Ex, Vx, Gx"); nextop = F8; q0 = fpu_get_scratch(dyn, ninst); GETVX(v2, 0); GETGX(v0, 0); VSSHRQ_32(q0, v2, 31); if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x3, (nextop&7)+(rex.b<<3), 1); + DEFAULT; + return addr; } else { - WILLWRITE2(); - addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - unscaled = 0; - v1 = fpu_get_scratch(dyn, ninst); - // check if mask as anything, else scipt the whole read/write to avoid a SEGFAULT. + addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + // check if mask as anything, else skip the whole read/write to avoid a SEGFAULT. // TODO: let a segfault trigger and check if the mask is null instead and ignore the segfault / actually triger: needs to implement SSE reg tracking first! - SQXTN_32(v1, q0); - VMOVQDto(x4, v1, 0); - CBZx(x4, 4+3*4); - VLDR128_U12(v1, ed, fixedaddress); - } - // create mask - VBITQ(v1, v0, q0); - if(!MODREG) { - VSTR128_U12(v1, ed, fixedaddress); + VMOVSto(x4, q0, 0); + CBZw(x4, 4+1*4); + VST1_32(v0, 0, ed); + ADDx_U12(x3, ed, 4); + ed = x3; + VMOVSto(x4, q0, 1); + CBZw(x4, 4+1*4); + VST1_32(v0, 1, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 2); + CBZw(x4, 4+1*4); + VST1_32(v0, 2, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 3); + CBZw(x4, 4+1*4); + VST1_32(v0, 3, ed); + if(vex.l) + ADDx_U12(ed, ed, 4); } + if(vex.l && !is_avx_zero(dyn, ninst, vex.v)) { v2 = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); v0 = ymm_get_reg(dyn, ninst, x1, gd, 0, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); VSSHRQ_32(q0, v2, 31); - if(MODREG) - v1 = ymm_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1, gd, vex.v, -1); - else { - SQXTN_32(v1, q0); - VMOVQDto(x4, v1, 0); - CBZx(x4, 4+3*4); - VLDR128_U12(v1, ed, fixedaddress+16); - } - VBITQ(v1, v0, q0); - if(!MODREG) { - VSTR128_U12(v1, ed, fixedaddress+16); - } - } + VMOVSto(x4, q0, 0); + CBZw(x4, 4+1*4); + VST1_32(v0, 0, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 1); + CBZw(x4, 4+1*4); + VST1_32(v0, 1, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 2); + CBZw(x4, 4+1*4); + VST1_32(v0, 2, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 3); + CBZw(x4, 4+1*4); + VST1_32(v0, 3, ed); + } + SMWRITE2(); break; case 0x2F: - INST_NAME("VMASKMOVPD Ex, Gx, Vx"); + INST_NAME("VMASKMOVPD Ex, Vx, Gx"); nextop = F8; q0 = fpu_get_scratch(dyn, ninst); - q1 = fpu_get_scratch(dyn, ninst); GETVX(v2, 0); GETGX(v0, 0); VSSHRQ_64(q0, v2, 63); if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x3, (nextop&7)+(rex.b<<3), 1); + DEFAULT; + return addr; } else { - WILLWRITE2(); - addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); unscaled = 0; v1 = fpu_get_scratch(dyn, ninst); - // check if mask as anything, else scipt the whole read/write to avoid a SEGFAULT. + // check if mask as anything, else skip the whole read/write to avoid a SEGFAULT. // TODO: let a segfault trigger and check if the mask is null instead and ignore the segfault / actually triger: needs to implement SSE reg tracking first! - SQXTN_32(q1, q0); - VMOVQDto(x4, q1, 0); - CBZx(x4, 4+3*4); - VLDR128_U12(v1, ed, fixedaddress); - } - // create mask - VBITQ(v1, v0, q0); - if(!MODREG) { - VSTR128_U12(v1, ed, fixedaddress); + VMOVQDto(x4, q0, 0); + CBZx(x4, 4+1*4); + VST1_64(v0, 0, ed); + ADDx_U12(x3, ed, 8); + ed = x3; + VMOVQDto(x4, q0, 1); + CBZx(x4, 4+1*4); + VST1_64(v0, 1, ed); + if(vex.l) + ADDx_U12(ed, ed, 8); } + if(vex.l && !is_avx_zero(dyn, ninst, vex.v)) { v2 = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); v0 = ymm_get_reg(dyn, ninst, x1, gd, 0, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); VSSHRQ_64(q0, v2, 63); - if(MODREG) - v1 = ymm_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1, gd, vex.v, -1); - else { - SQXTN_32(q1, q0); - VMOVQDto(x4, q1, 0); - CBZx(x4, 4+3*4); - VLDR128_U12(v1, ed, fixedaddress+16); - } - VBITQ(v1, v0, q0); - if(!MODREG) { - VSTR128_U12(v1, ed, fixedaddress+16); - } + VMOVQDto(x4, q0, 0); + CBZx(x4, 4+1*4); + VST1_64(v0, 0, ed); + ADDx_U12(ed, ed, 8); + VMOVQDto(x4, q0, 1); + CBZx(x4, 4+1*4); + VST1_64(v0, 1, ed); } + SMWRITE2(); break; case 0x30: INST_NAME("VPMOVZXBW Gx, Ex"); nextop = F8; GETG; - if(vex.l) { GETEX(q1, 0, 0); } else { GETEX64(q1, 0, 0); YMM0(gd); } + if(vex.l) { GETEX(q1, 0, 0); } else { GETEX64(q1, 0, 0); YMM0(gd); } //no GETEY GETGX_empty(q0); if(vex.l) { GETGY_empty(v0, -1, -1, -1); @@ -652,12 +889,11 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip GETG; if(vex.l) { GETEX64(q1, 0, 0); } else { GETEX32(q1, 0, 0); YMM0(gd); } GETGX_empty(q0); + UXTL_8(q0, q1); if(vex.l) { GETGY_empty(v0, -1, -1, -1); - UXTL_8(v0, q1); - UXTL2_16(v0, v0); + UXTL2_16(v0, q0); } - UXTL_8(q0, q1); UXTL_16(q0, q0); break; case 0x32: @@ -666,21 +902,19 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip GETG; if(vex.l) { GETEX32(q1, 0, 0); } else { GETEX16(q1, 0, 0); YMM0(gd); } GETGX_empty(q0); + UXTL_8(q0, q1); + UXTL_16(q0, q0); if(vex.l) { GETGY_empty(v0, -1, -1, -1); - UXTL_8(v0, q1); - UXTL_16(v0, v0); - UXTL2_32(v0, v0); + UXTL2_32(v0, q0); } - UXTL_8(q0, q1); - UXTL_16(q0, q0); UXTL_32(q0, q0); break; case 0x33: INST_NAME("VPMOVZXWD Gx, Ex"); nextop = F8; GETG; - if(vex.l) { GETEX(q1, 0, 0); } else { GETEX64(q1, 0, 0); YMM0(gd); } + if(vex.l) { GETEX(q1, 0, 0); } else { GETEX64(q1, 0, 0); YMM0(gd); } //no GETEY GETGX_empty(q0); if(vex.l) { GETGY_empty(v0, -1, -1, -1); @@ -694,19 +928,18 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip GETG; if(vex.l) { GETEX64(q1, 0, 0); } else { GETEX32(q1, 0, 0); YMM0(gd); } GETGX_empty(q0); + UXTL_16(q0, q1); if(vex.l) { GETGY_empty(v0, -1, -1, -1); - UXTL_16(v0, q1); - UXTL2_32(v0, v0); + UXTL2_32(v0, q0); } - UXTL_16(q0, q1); UXTL_32(q0, q0); break; case 0x35: INST_NAME("VPMOVZXDQ Gx, Ex"); nextop = F8; GETG; - if(vex.l) { GETEX(q1, 0, 0); } else { GETEX64(q1, 0, 0); YMM0(gd); } + if(vex.l) { GETEX(q1, 0, 0); } else { GETEX64(q1, 0, 0); YMM0(gd); } //no GETEY GETGX_empty(q0); if(vex.l) { GETGY_empty(v0, -1, -1, -1); @@ -806,9 +1039,9 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip if(!vex.l) YMM0(gd); break; case 0x41: - INST_NAME("PHMINPOSUW Gx, Ex"); + INST_NAME("VPHMINPOSUW Gx, Ex"); nextop = F8; - GETEX(v1, 0, 0); + GETEX(v1, 0, 0); //no vex.l case GETGX_empty(v0); q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); @@ -836,7 +1069,6 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } if(!MODREG) q0 = v1; if(rex.w) { - VEORQ(q1, q1, q1); MOVI_32(q1, 64); // no 64bits vmin/vmax UQXTN_32(q0, v1); @@ -845,7 +1077,6 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip NEGQ_64(q0, q0); USHLQ_64(v0, v2, q0); } else { - VEORQ(q1, q1, q1); MOVIQ_32(q1, 32); UMINQ_32(q0, v1, q1); NEGQ_32(q0, q0); @@ -855,29 +1086,18 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip if(!vex.l) YMM0(gd); break; case 0x46: - INST_NAME("VPSRAVD/Q Gx, Vx, Ex"); + INST_NAME("VPSRAVD Gx, Vx, Ex"); nextop = F8; + if(rex.w) {DEFAULT; return addr;} if(MODREG) q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } if(!MODREG) q0 = v1; - if(rex.w) { - VEORQ(q1, q1, q1); - MOVI_32(q1, 64); - // no 64bits vmin/vmax - UQXTN_32(q0, v1); - UMIN_32(q0, q0, q1); - UXTL_32(q0, q0); - NEGQ_64(q0, q0); - SSHLQ_64(v0, v2, q0); - } else { - VEORQ(q1, q1, q1); - MOVIQ_32(q1, 32); - UMINQ_32(q0, v1, q1); - NEGQ_32(q0, q0); - SSHLQ_32(v0, v2, q0); - } + MOVIQ_32(q1, 32); + UMINQ_32(q0, v1, q1); + NEGQ_32(q0, q0); + SSHLQ_32(v0, v2, q0); } if(!vex.l) YMM0(gd); break; @@ -890,7 +1110,6 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } if(!MODREG) q0 = v1; if(rex.w) { - VEORQ(q1, q1, q1); MOVI_32(q1, 64); // no 64bits vmin/vmax UQXTN_32(q0, v1); @@ -898,7 +1117,6 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip UXTL_32(q0, q0); USHLQ_64(v0, v2, q0); } else { - VEORQ(q1, q1, q1); MOVIQ_32(q1, 32); UMINQ_32(q0, v1, q1); USHLQ_32(v0, v2, q0); @@ -949,115 +1167,191 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip break; case 0x78: - INST_NAME("VBROADCASTB Gx, Ex"); + INST_NAME("VPBROADCASTB Gx, Ex"); nextop = F8; if(MODREG) { v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); GETGX_empty(v0); VDUPQ_8(v0, v1, 0); - if(vex.l) { - GETGY_empty(v0, -1, -1, -1); - VDUPQ_8(v0, v1, 0); - } } else { GETGX_empty(v0); addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); VLDQ1R_8(v0, ed); - if(vex.l) { - GETGY_empty(v0, -1, -1, -1); - VLDQ1R_8(v0, ed); - } } - if(!vex.l) YMM0(gd); + if(vex.l) { + GETGY_empty(v1, -1, -1, -1); + VMOVQ(v1, v0); + } else YMM0(gd); break; case 0x79: - INST_NAME("VBROADCASTW Gx, Ex"); + INST_NAME("VPBROADCASTW Gx, Ex"); nextop = F8; if(MODREG) { v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); GETGX_empty(v0); VDUPQ_16(v0, v1, 0); - if(vex.l) { - GETGY_empty(v0, -1, -1, -1); - VDUPQ_16(v0, v1, 0); - } } else { GETGX_empty(v0); addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); VLDQ1R_16(v0, ed); - if(vex.l) { - GETGY_empty(v0, -1, -1, -1); - VLDQ1R_16(v0, ed); - } } - if(!vex.l) YMM0(gd); + if(vex.l) { + GETGY_empty(v1, -1, -1, -1); + VMOVQ(v1, v0); + } else YMM0(gd); break; case 0x8C: - INST_NAME("VMASKMOVD/Q Vx, Ex, Gx"); + INST_NAME("VPMASKMOVD/Q Gx, Vx, Ex"); nextop = F8; q0 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { - if(!l) { - GETGX_empty_VXEX(v0, v2, v1, 0); + if(MODREG) { + if(!l) { + GETGX_empty_VXEX(v0, v2, v1, 0); + } else { + GETGY_empty_VYEY(v0, v2, v1); + } + if(rex.w) + VSSHRQ_64(q0, v2, 63); + else + VSSHRQ_32(q0, v2, 31); + VANDQ(v0, v1, q0); } else { - GETGY_empty_VYEY(v0, v2, v1); + if(!l) { + GETGX_empty_VX(v0, v2); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + v1 = fpu_get_scratch(dyn, ninst); + } else { + GETGY_empty_VY(v0, v2, 0, -1, -1); + } + unscaled = 0; + // check if mask as anything, else skip the whole read/write to avoid a SEGFAULT. + // TODO: let a segfault trigger and check if the mask is null instead and ignore the segfault / actually triger: needs to implement SSE reg tracking first! + VEORQ(v1, v1, v1); + if(rex.w) { + VSSHRQ_64(q0, v2, 63); + VMOVQDto(x4, q0, 0); + CBZx(x4, 4+1*4); + VLD1_64(v1, 0, ed); + ADDx_U12(x3, ed, 8); + if(ed!=x3) ed=x3; + VMOVQDto(x4, q0, 1); + CBZx(x4, 4+1*4); + VLD1_64(v1, 1, ed); + if(!l && vex.l) + ADDx_U12(ed, ed, 8); + } else { + VSSHRQ_32(q0, v2, 31); + VMOVSto(x4, q0, 0); + CBZx(x4, 4+1*4); + VLD1_32(v1, 0, ed); + ADDx_U12(x3, ed, 4); + if(ed!=x3) ed=x3; + VMOVSto(x4, q0, 1); + CBZx(x4, 4+1*4); + VLD1_32(v1, 1, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 2); + CBZx(x4, 4+1*4); + VLD1_32(v1, 2, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 3); + CBZx(x4, 4+1*4); + VLD1_32(v1, 3, ed); + if(!l && vex.l) + ADDx_U12(ed, ed, 4); + } + VMOVQ(v0, v1); } - if(rex.w) - VSSHRQ_64(q0, v2, 63); - else - VSSHRQ_32(q0, v2, 31); - VANDQ(v0, v1, q0); } if(!vex.l) YMM0(gd); break; case 0x8E: - INST_NAME("VMASKMOVD/Q Ex, Vx, Gx"); + INST_NAME("VPMASKMOVD/Q Ex, Vx, Gx"); nextop = F8; q0 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { - if(!l) { - GETGX(v0, 0); GETVX(v2, 0); - if(MODREG) { + if(MODREG) { + if(!l) { + GETGX(v0, 0); GETVX(v2, 0); s0 = (nextop&7)+(rex.b<<3); v1 = sse_get_reg_empty(dyn, ninst, x1, s0); } else { + GETGY(v0, 0, vex.v, s0, -1); v2 = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, s0, -1); + v1 = ymm_get_reg_empty(dyn, ninst, x1, s0, gd, vex.v, -1); + } + if(rex.w) + VSSHRQ_64(q0, v2, 63); + else + VSSHRQ_32(q0, v2, 31); + VBITQ(v1, v0, q0); + } else { + if(!l) { + GETGX(v0, 0); GETVX(v2, 0); s0 = -1; v1 = fpu_get_scratch(dyn, ninst); - addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VLDR128_U12(v1, ed, fixedaddress); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + EORx_REG(x4, x4, x4); + } else { + GETGY(v0, 0, vex.v, s0, -1); v2 = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, s0, -1); + } + if(rex.w) + { + VSSHRQ_64(q0, v2, 63); + VMOVQDto(x4, q0, 0); + CBZx(x4, 4+1*4); + VST1_64(v0, 0, ed); + ADDx_U12(x3, ed, 8); + if(ed!=x3) ed=x3; + VMOVQDto(x4, q0, 1); + CBZx(x4, 4+1*4); + VST1_64(v0, 1, ed); + if(!l && vex.l) + ADDx_U12(ed, ed, 8); } - } else { - GETGY(v0, 0, vex.v, s0, -1); v2 = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, s0, -1); - if(MODREG) - v1 = ymm_get_reg_empty(dyn, ninst, x1, s0, gd, vex.v, -1); else - VLDR128_U12(v1, ed, fixedaddress+16); + { + VSSHRQ_32(q0, v2, 31); + VMOVSto(x4, q0, 0); + CBZx(x4, 4+1*4); + VST1_32(v0, 0, ed); + ADDx_U12(x3, ed, 4); + if(ed!=x3) ed=x3; + VMOVSto(x4, q0, 1); + CBZx(x4, 4+1*4); + VST1_32(v0, 1, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 2); + CBZx(x4, 4+1*4); + VST1_32(v0, 2, ed); + ADDx_U12(ed, ed, 4); + VMOVSto(x4, q0, 3); + CBZx(x4, 4+1*4); + VST1_32(v0, 3, ed); + if(!l && vex.l) + ADDx_U12(ed, ed, 4); + } } - if(rex.w) - VSSHRQ_64(q0, v2, 63); - else - VSSHRQ_32(q0, v2, 31); - VBITQ(v1, v0, q0); - if(!MODREG) - VSTR128_U12(v1, ed, fixedaddress+16*l); } + if(!MODREG) {SMWRITE2();} // no raz of upper ymm break; case 0x90: case 0x92: - if(opcode==0x90) {INST_NAME("VPGATHERDD Gx, VSIB, Vx");} else {INST_NAME("VGATHERDPD/VGATHERDPS Gx, VSIB, Vx");} + if(opcode==0x90) {INST_NAME("VPGATHERDD/VPGATHERDQ Gx, VSIB, Vx");} else {INST_NAME("VGATHERDPD/VGATHERDPS Gx, VSIB, Vx");} nextop = F8; if(((nextop&7)!=4) || MODREG) {UDF(0);} GETG; u8 = F8; //SIB if((u8&0x7)==0x5 && !(nextop&0xC0)) { - MOV64x(x5, F32S64); + int64_t i64 = F32S64; + MOV64x(x5, i64); eb1 = x5; } else - eb1 = xRAX + (u8&0x7)+(rex.b<<3); // base + eb1 = TO_NAT((u8 & 0x7) + (rex.b << 3)); // base eb2 = ((u8>>3)&7)+(rex.x<<3); // index if(nextop&0x40) i32 = F8S; @@ -1091,14 +1385,14 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip VMOVQDto(x4, v2, i); CBZw(x4, 4+4*4); SMOVQSto(x4, v1, i+l*2); - ADDx_REG_LSL(x4, ed, x4, wb1); + ADDz_REG_LSL(x4, ed, x4, wb1); VLD1_64(v0, i, x4); VMOVQDfrom(v2, i, xZR); } else for(int i=0; i<4; ++i) { VMOVSto(x4, v2, i); CBZw(x4, 4+4*4); SMOVQSto(x4, v1, i); - ADDx_REG_LSL(x4, ed, x4, wb1); + ADDz_REG_LSL(x4, ed, x4, wb1); VLD1_32(v0, i, x4); VMOVQSfrom(v2, i, xZR); } @@ -1107,16 +1401,17 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip break; case 0x91: case 0x93: - if(opcode==0x91) {INST_NAME("VPGATHERQD Gx, VSIB, Vx");} else {INST_NAME("VGATHERQPD/VGATHERQPS Gx, VSIB, Vx");} + if(opcode==0x91) {INST_NAME("VPGATHERQD/VPGATHERQQ Gx, VSIB, Vx");} else {INST_NAME("VGATHERQPD/VGATHERQPS Gx, VSIB, Vx");} nextop = F8; if(((nextop&7)!=4) || MODREG) {UDF(0);} GETG; u8 = F8; //SIB if((u8&0x7)==0x5 && !(nextop&0xC0)) { - MOV64x(x5, F32S64); + int64_t i64 = F32S64; + MOV64x(x5, i64); eb1 = x5; } else - eb1 = xRAX + (u8&0x7)+(rex.b<<3); // base + eb1 = TO_NAT((u8 & 0x7) + (rex.b << 3)); // base eb2 = ((u8>>3)&7)+(rex.x<<3); // index if(nextop&0x40) i32 = F8S; @@ -1145,7 +1440,7 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip VMOVSto(x4, v2, i); CBZw(x4, 4+4*4); VMOVQDto(x4, (i&2)?q1:v1, i&1); - ADDx_REG_LSL(x4, ed, x4, wb1); + ADDz_REG_LSL(x4, ed, x4, wb1); VLD1_32(v0, i, x4); VMOVQSfrom(v2, i, xZR); } @@ -1170,7 +1465,7 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip VMOVQDto(x4, v2, i); CBZw(x4, 4+4*4); VMOVQDto(x4, v1, i); - ADDx_REG_LSL(x4, ed, x4, wb1); + ADDz_REG_LSL(x4, ed, x4, wb1); VLD1_64(v0, i, x4); VMOVQDfrom(v2, i, xZR); } @@ -1197,18 +1492,30 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip nextop = F8; GETGX(v0, 1); GETVX(v2, 0); - if(rex.w) {GETEXSD(v1, 0, 0);} else {GETEXSS(v1, 0, 0);} q0 = fpu_get_scratch(dyn, ninst); if(rex.w) { + GETEXSD(v1, 0, 0); FMADD_64(q0, v2, v1, v0); VMOVeD(v0, 0, q0, 0); } else { + GETEXSS(v1, 0, 0); FMADD_32(q0, v2, v1, v0); VMOVeS(v0, 0, q0, 0); } YMM0(gd); break; - + case 0x9A: + INST_NAME("VFNMSUB132PS/D Gx, Vx, Ex"); + nextop = F8; + q0 = fpu_get_scratch(dyn, ninst); + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_VXEX(v0, v2, v1, 0); } else { GETGY_VYEY(v0, v2, v1); } + if(rex.w) VFNEGQD(q0, v2); else VFNEGQS(q0, v2); + if(rex.w) VFMLAQD(q0, v0, v1); else VFMLAQS(q0, v0, v1); + VMOVQ(v0, q0); + } + if(!vex.l) YMM0(gd); + break; case 0x9B: INST_NAME("VFMSUB132SS/D Gx, Vx, Ex"); nextop = F8; @@ -1233,7 +1540,7 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip if(!l && v0!=v2) q0 = fpu_get_scratch(dyn, ninst); if(v0!=v2) VMOVQ(q0, v2); else q0 = v2; if(rex.w) VFMLSQD(q0, v0, v1); else VFMLSQS(q0, v0, v1); - VMOVQ(v0, q0); + if(q0!=v0) VMOVQ(v0, q0); } if(!vex.l) YMM0(gd); break; @@ -1271,6 +1578,27 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip YMM0(gd); break; + case 0xA6: + INST_NAME("VFMADDSUB213PS/D Gx, Vx, Ex"); + nextop = F8; + q0 = fpu_get_scratch(dyn, ninst); + TABLE64C(x2, rex.w?const_2d_m1_1:const_4f_m1_1_m1_1); + VLDR128_U12(q0, x2, 0); + q1 = fpu_get_scratch(dyn, ninst); + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_VXEX(v0, v2, v1, 0); } else { GETGY_VYEY(v0, v2, v1); } + if(rex.w) { + VFMULQD(q1, v1, q0); + VFMLAQD(q1, v0, v2); + } else { + VFMULQS(q1, v1, q0); + VFMLAQS(q1, v0, v2); + } + VMOVQ(v0, q1); + } + if(!vex.l) YMM0(gd); + break; + case 0xA8: INST_NAME("VFMADD213PS/D Gx, Vx, Ex"); nextop = F8; @@ -1288,12 +1616,13 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip nextop = F8; GETGX(v0, 1); GETVX(v2, 0); - if(rex.w) {GETEXSD(v1, 0, 0);} else {GETEXSS(v1, 0, 0);} q0 = fpu_get_scratch(dyn, ninst); if(rex.w) { + GETEXSD(v1, 0, 0); FMADD_64(q0, v1, v0, v2); VMOVeD(v0, 0, q0, 0); } else { + GETEXSS(v1, 0, 0); FMADD_32(q0, v1, v0, v2); VMOVeS(v0, 0, q0, 0); } @@ -1404,10 +1733,30 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip INST_NAME("VFMADDSUB231PS/D Gx, Vx, Ex"); nextop = F8; q0 = fpu_get_scratch(dyn, ninst); - static float addsubps[4] = {-1.f, 1.f, -1.f, 1.f}; - static double addsubpd[2] = {-1., 1.}; - MAYUSE(addsubps); MAYUSE(addsubpd); - TABLE64(x2, (rex.w)?((uintptr_t)&addsubpd):((uintptr_t)&addsubps)); + TABLE64C(x2, rex.w?const_2d_m1_1:const_4f_m1_1_m1_1); + VLDR128_U12(q0, x2, 0); + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_VXEX(v0, v2, v1, 0); if(v0==v2 || v0==v1) q1 = fpu_get_scratch(dyn, ninst); } else { GETGY_VYEY(v0, v2, v1); } + if(v0!=v1 && v0!=v2) { + q1 = v0; + } + if(rex.w) { + VFMULQD(q1, v0, q0); + VFMLAQD(q1, v1, v2); + } else { + VFMULQS(q1, v0, q0); + VFMLAQS(q1, v1, v2); + } + if(q1!=v0) + VMOVQ(v0, q1); + } + if(!vex.l) YMM0(gd); + break; + case 0xB7: + INST_NAME("VFMSUBADD231PS/D Gx, Vx, Ex"); + nextop = F8; + q0 = fpu_get_scratch(dyn, ninst); + TABLE64C(x2, rex.w?const_2d_1_m1:const_4f_1_m1_1_m1); VLDR128_U12(q0, x2, 0); for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_VXEX(v0, v2, v1, 0); if(v0==v2 || v0==v1) q1 = fpu_get_scratch(dyn, ninst); } else { GETGY_VYEY(v0, v2, v1); } @@ -1426,7 +1775,6 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip } if(!vex.l) YMM0(gd); break; - case 0xB8: INST_NAME("VFMADD231PS/D Gx, Vx, Ex"); nextop = F8; @@ -1441,12 +1789,13 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip nextop = F8; GETGX(v0, 1); GETVX(v2, 0); - if(rex.w) {GETEXSD(v1, 0, 0);} else {GETEXSS(v1, 0, 0);} q0 = fpu_get_scratch(dyn, ninst); if(rex.w) { + GETEXSD(v1, 0, 0); FMADD_64(q0, v0, v1, v2); VMOVeD(v0, 0, q0, 0); } else { + GETEXSS(v1, 0, 0); FMADD_32(q0, v0, v1, v2); VMOVeS(v0, 0, q0, 0); } @@ -1456,9 +1805,17 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip INST_NAME("VFNMSUB231PS/D Gx, Vx, Ex"); nextop = F8; for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETGX_VXEX(v0, v2, v1, 0); } else { GETGY_VYEY(v0, v2, v1); } - if(rex.w) VFMLSQD(v0, v1, v2); else VFMLSQS(v0, v1, v2); - if(rex.w) VFNEGQD(v0, v0); else VFNEGQS(v0, v0); + if(!l) { + GETGX_VXEX(v0, v2, v1, 0); + if(v0==v1 || v0==v2) q0 = fpu_get_scratch(dyn, ninst); else q0 = v0; + } else { + GETGY_VYEY(v0, v2, v1); + if(!(v0==v1 || v0==v2)) q0 = v0; + } + // chenge to get sign of zero correct + if(rex.w) VFNEGQD(q0, v0); else VFNEGQS(q0, v0); + if(rex.w) VFMLAQD(q0, v1, v2); else VFMLAQS(q0, v1, v2); + if(q0!=v0) VMOVQ(v0, q0); } if(!vex.l) YMM0(gd); break; @@ -1513,10 +1870,27 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip if(!vex.l) YMM0(gd); break; + case 0xDB: + INST_NAME("VAESIMC Gx, Ex"); + nextop = F8; + GETGX_empty_EX(v0, v1, 0); + if(cpuext.aes) { + AESIMC(v0, v1); + } else { + if(v0!=v1) { + VMOVQ(v0, v1); + } + sse_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); + CALL(const_native_aesimc, -1); + } + YMM0(gd); + break; + case 0xDC: INST_NAME("VAESENC Gx, Vx, Ex"); // AES-NI nextop = F8; - if(arm64_aes) { + if(cpuext.aes) { d0 = fpu_get_scratch(dyn, ninst); // ARM64 internal operation differs a bit from x86_64 for(int l=0; l<1+vex.l; ++l) { if(!l) {GETGX_empty_VXEX(v0, v2, v1, 0);} else {GETGY_empty_VYEY(v0, v2, v1);} @@ -1543,21 +1917,21 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip } sse_forget_reg(dyn, ninst, gd); MOV32w(x1, gd); - CALL(native_aese, -1); - if(vex.l) {MOV32w(x1, gd); CALL(native_aese_y, -1);} + CALL(const_native_aese, -1); + if(vex.l) {MOV32w(x1, gd); CALL(const_native_aese_y, -1);} GETGX(q0, 1); VEORQ(q0, q0, (d0==-1)?q1:d0); if(vex.l) { GETGY_empty(v0, (d0==-1)?(nextop&7)+(rex.b<<3):-1, -1, -1); VEORQ(v0, v0, (d0==-1)?v1:d0); - } else YMM0(gd); + } } if(!vex.l) YMM0(gd); break; case 0xDD: INST_NAME("VAESENCLAST Gx, Vx, Ex"); // AES-NI nextop = F8; - if(arm64_aes) { + if(cpuext.aes) { d0 = fpu_get_scratch(dyn, ninst); // ARM64 internal operation differs a bit from x86_64 for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } @@ -1583,21 +1957,21 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip } sse_forget_reg(dyn, ninst, gd); MOV32w(x1, gd); - CALL(native_aeselast, -1); - if(vex.l) {MOV32w(x1, gd); CALL(native_aeselast_y, -1);} + CALL(const_native_aeselast, -1); + if(vex.l) {MOV32w(x1, gd); CALL(const_native_aeselast_y, -1);} GETGX(q0, 1); VEORQ(q0, q0, (d0==-1)?q1:d0); if(vex.l) { GETGY_empty(v0, (d0==-1)?(nextop&7)+(rex.b<<3):-1, -1, -1); VEORQ(v0, v0, (d0==-1)?v1:d0); - } else YMM0(gd); + } } if(!vex.l) YMM0(gd); break; case 0xDE: INST_NAME("VAESDEC Gx, Vx, Ex"); // AES-NI nextop = F8; - if(arm64_aes) { + if(cpuext.aes) { d0 = fpu_get_scratch(dyn, ninst); // ARM64 internal operation differs a bit from x86_64 for(int l=0; l<1+vex.l; ++l) { if(!l) {GETGX_empty_VXEX(v0, v2, v1, 0);} else {GETGY_empty_VYEY(v0, v2, v1);} @@ -1624,21 +1998,21 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip } sse_forget_reg(dyn, ninst, gd); MOV32w(x1, gd); - CALL(native_aesd, -1); - if(vex.l) {MOV32w(x1, gd); CALL(native_aesd_y, -1);} + CALL(const_native_aesd, -1); + if(vex.l) {MOV32w(x1, gd); CALL(const_native_aesd_y, -1);} GETGX(q0, 1); VEORQ(q0, q0, (d0==-1)?q1:d0); if(vex.l) { GETGY_empty(v0, (d0==-1)?(nextop&7)+(rex.b<<3):-1, -1, -1); VEORQ(v0, v0, (d0==-1)?v1:d0); - } else YMM0(gd); + } } if(!vex.l) YMM0(gd); break; case 0xDF: INST_NAME("VAESDECLAST Gx, Vx, Ex"); // AES-NI nextop = F8; - if(arm64_aes) { + if(cpuext.aes) { d0 = fpu_get_scratch(dyn, ninst); // ARM64 internal operation differs a bit from x86_64 for(int l=0; l<1+vex.l; ++l) { if(!l) {GETGX_empty_VXEX(v0, v2, v1, 0);} else {GETGY_empty_VYEY(v0, v2, v1);} @@ -1664,14 +2038,14 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip } sse_forget_reg(dyn, ninst, gd); MOV32w(x1, gd); - CALL(native_aesdlast, -1); - if(vex.l) {MOV32w(x1, gd); CALL(native_aesdlast_y, -1);} + CALL(const_native_aesdlast, -1); + if(vex.l) {MOV32w(x1, gd); CALL(const_native_aesdlast_y, -1);} GETGX(q0, 1); VEORQ(q0, q0, (d0==-1)?q1:d0); if(vex.l) { GETGY_empty(v0, (d0==-1)?(nextop&7)+(rex.b<<3):-1, -1, -1); VEORQ(v0, v0, (d0==-1)?v1:d0); - } else YMM0(gd); + } } if(!vex.l) YMM0(gd); break; diff --git a/src/dynarec/arm64/dynarec_arm64_avx_66_0f3a.c b/src/dynarec/arm64/dynarec_arm64_avx_66_0f3a.c index 69a58b5..0b6bc2a 100644 --- a/src/dynarec/arm64/dynarec_arm64_avx_66_0f3a.c +++ b/src/dynarec/arm64/dynarec_arm64_avx_66_0f3a.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -22,7 +20,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) { @@ -135,15 +133,21 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip if(!l) { GETGX_empty_EX(v0, v1, 1); u8 = F8; - if(v0==v1) {q1 = fpu_get_scratch(dyn, ninst); VMOVQ(q1, v1);} } else { GETGY_empty_EY(v0, v1); - if(v0==v1) {VMOVQ(q1, v1);} } - if(((u8>>(l*2))&1)==((u8>>(1+l*2))&1)) - VDUPQ_64(v0, (v0==v1)?q1:v1, ((u8>>(l*2))&1)); - else for(int i=0; i<2; ++i) - VMOVeD(v0, i, (v0==v1)?q1:v1, (u8>>(i+l*2))&1); + switch(((u8>>(l*2))&3)) { + case 0b00: + case 0b11: + VDUPQ_64(v0, v1, ((u8>>(l*2))&1)); + break; + case 0b10: + if(v0!=v1) VMOVQ(v0, v1); + break; + case 0b01: + VEXTQ_8(v0, v1, v1, 8); // invert 64bits values + break; + } } if(!vex.l) YMM0(gd); break; @@ -163,27 +167,27 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip u8 = F8; GETVX(v2, 0); GETGX_empty(v0); - if((v0==v2) && ((u8&0xf0)==0)) { + if((v0==v2) && ((u8&0b10110000)==0)) { q0 = fpu_get_scratch(dyn, ninst); VMOVQ(q0, v2); v2 = q0; } - if((v0==v1) && ((u8&0xf0)==0x20)) { + if((v0==v1) && ((u8&0b10110000)==0x20)) { q1 = fpu_get_scratch(dyn, ninst); VMOVQ(q1, v1); v1 = q1; } - switch(u8&0x0f) { + switch(u8&0b1011) { case 0: if(v0!=v2) VMOVQ(v0, v2); break; case 1: d2 = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, s0, -1); VMOVQ(v0, d2); break; case 2: if(MODREG) { if(v0!=v1) VMOVQ(v0, v1); } else { VLDR128_U12(v0, ed, fixedaddress); } break; case 3: if(MODREG) { d1 = ymm_get_reg(dyn, ninst, x1, s0, 0, gd, vex.v, -1); VMOVQ(v0, d1); } else { VLDR128_U12(v0, ed, fixedaddress+16); } break; default: VEORQ(v0, v0, v0); } - if((u8&0xf0)==0x10) { if((u8&0x0f)!=1) d2 = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, s0, -1); } - if(MODREG && ((u8&0xf0)==0x30)) { if((u8&0x0f)!=3) d1 = ymm_get_reg(dyn, ninst, x1, s0, 0, gd, vex.v, -1); } + if((u8&0b10110000)==0x10) { if((u8&0b1011)!=1) d2 = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, s0, -1); } + if(MODREG && ((u8&0b10110000)==0x30)) { if((u8&0b1011)!=3) d1 = ymm_get_reg(dyn, ninst, x1, s0, 0, gd, vex.v, -1); } v0 = ymm_get_reg_empty(dyn, ninst, x1, gd, vex.v, s0, -1); - switch((u8>>4)&0x0f) { + switch((u8>>4)&0b1011) { case 0: VMOVQ(v0, v2); break; case 1: if(v0!=d2) VMOVQ(v0, d2); break; case 2: if(MODREG) { if(v0!=v1) VMOVQ(v0, v1); } else { VLDR128_U12(v0, ed, fixedaddress); } break; @@ -268,17 +272,21 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip } else if(q0==q1) { for(int i=0; i<4; ++i) if(u8&(1<>4)==0b0011) { + if(((u8>>4)&0b0011)==0b0011) { VMOVeD(q0, 0, q1, 0); - } else if((u8>>4)==0b1100) { + u8&=~0b00110000; + } + if(((u8>>4)&0b1100)==0b1100) { VMOVeD(q0, 1, q1, 1); - } else for(int i=0; i<4; ++i) + u8&=~0b11000000; + } + for(int i=0; i<4; ++i) if(u8&(1<<(i+4))) { VMOVeS(q0, i, q1, i); } @@ -308,11 +320,11 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip } else YMM0(gd); break; case 0x0D: - INST_NAME("VPBLENDPD Gx, Vx, Ex, Ib"); + INST_NAME("VBLENDPD Gx, Vx, Ex, Ib"); nextop = F8; for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(q0, q2, q1, 1); u8 = F8; } else { GETGY_empty_VYEY(q0, q2, q1); } - switch(u8>>(l*2)&3) { + switch((u8>>(l*2))&3) { case 0b00: if(q0!=q2) VMOVQ(q0, q2); break; // VxVx case 0b01: if(q0!=q1) VMOVeD(q0, 0, q1, 0); if(q0!=q2) VMOVeD(q0, 1, q2, 1); break; // Ex[0]Vx[1] case 0b10: if(q0!=q2) VMOVeD(q0, 0, q2, 0); if(q0!=q1) VMOVeD(q0, 1, q1, 1); break; // Vx[0]Ex[1] @@ -331,12 +343,8 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip MOVI_64(q0, u8); SXTL_8(q0, q0); // expand 8bits to 16bits... } - if(v0==v1) { - VBIFQ(v0, v2, q0); - } else { - if(v0!=v2) VMOVQ(v0, v2); - VBITQ(v0, v1, q0); - } + if(v0!=v2) VBIFQ(v0, v2, q0); + if(v0!=v1) VBITQ(v0, v1, q0); } if(!vex.l) YMM0(gd); break; @@ -368,9 +376,8 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip nextop = F8; GETGX(v0, 0); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); } else { - SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, 1); ed = x1; } @@ -378,6 +385,7 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip VMOVBto(ed, v0, u8&0x0f); if(!MODREG) { STB(ed, wback, fixedaddress); + SMWRITE2(); } break; case 0x15: @@ -385,9 +393,8 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip nextop = F8; GETGX(v0, 0); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); } else { - SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 1); ed = x1; } @@ -395,6 +402,7 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip VMOVHto(ed, v0, u8&7); if(!MODREG) { STH(ed, wback, fixedaddress); + SMWRITE2(); } break; case 0x16: @@ -402,9 +410,8 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip nextop = F8; GETGX(v0, 0); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); } else { - SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, 1); ed = x1; } @@ -416,6 +423,7 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip } if(!MODREG) { STxw(ed, wback, fixedaddress); + SMWRITE2(); } break; case 0x17: @@ -423,9 +431,8 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip nextop = F8; GETGX(v0, 0); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); } else { - SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 1); ed = x1; } @@ -433,6 +440,7 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip VMOVSto(ed, v0, u8&3); if(!MODREG) { STW(ed, wback, fixedaddress); + SMWRITE2(); } break; case 0x18: @@ -479,18 +487,18 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip } else { addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 1); VST128(v0, ed, fixedaddress); + SMWRITE2(); } F8; // read u8, but it's been already handled break; case 0x1D: - INST_NAME("VCVTPS2PH Ex, Gx"); + INST_NAME("VCVTPS2PH Ex, Gx, Ib"); nextop = F8; GETGX(v0, 0); if(MODREG) { v1 = sse_get_reg_empty(dyn, ninst, x3, (nextop&7)+(rex.b<<3)); } else { - WILLWRITE2(); v1 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, &unscaled, 0xfff<<(3+vex.l), vex.l?15:7, rex, NULL, 0, 1); } @@ -532,13 +540,20 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip break; case 0x20: - INST_NAME("VINSERTD Gx, Vx, Ex, Ib"); + INST_NAME("VPINSRB Gx, Vx, ED, Ib"); nextop = F8; GETGX_empty_VX(v0, v2); - GETED(1); - u8 = F8; if(v0!=v2) VMOVQ(v0, v2); - VMOVQBfrom(v0, u8&0xf, ed); + if(MODREG) { + u8 = (F8)&15; + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + VMOVQBfrom(v0, u8, ed); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1); + u8 = (F8)&15; + VLD1_8(v0, u8, wback); + } YMM0(gd); break; case 0x21: @@ -574,7 +589,11 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip YMM0(gd); break; case 0x22: - INST_NAME("VINSERTD Gx, Vx, Ex, Ib"); + if (rex.w) { + INST_NAME("VPINSRQ Gx, Vx, ED, Ib"); + } else { + INST_NAME("VPINSRD Gx, Vx, ED, Ib"); + } nextop = F8; GETGX_empty_VX(v0, v2); GETED(1); @@ -593,36 +612,64 @@ uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip u8 = geted_ib(dyn, addr, ninst, nextop); q0 = fpu_get_scratch(dyn, ninst); // first mask - wb1 = 0; // mask - for(int i=0; i<4; ++i) - if(u8&(1<>4)&(1<>4)&(1<>4; + ed = (nextop&7)+(rex.b<<3); for(int l=0; l<1+vex.l; ++l) { if(!l) { q1 = sse_get_reg(dyn, ninst, x1, u8, 0); GETGX_empty_VXEX(v0, v2, v1, 1); F8; } else { - v2 = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, u8, (MODREG)?((nextop&7)+(rex.b<<3)):-1); + v2 = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, u8, (MODREG)?ed:-1); if(MODREG) - v1 = ymm_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0, gd, vex.v, u8); + v1 = ymm_get_reg(dyn, ninst, x1, ed, 0, gd, vex.v, u8); else VLDR128_U12(v1, ed, fixedaddress+16); - q1 = ymm_get_reg(dyn, ninst, x1, u8, 0, vex.v, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1); - v0 = ymm_get_reg_empty(dyn, ninst, x1, gd, vex.v, u8, (MODREG)?((nextop&7)+(rex.b<<3)):-1); + q1 = ymm_get_reg(dyn, ninst, x1, u8, 0, vex.v, gd, (MODREG)?ed:-1); + v0 = ymm_get_reg_empty(dyn, ninst, x1, gd, vex.v, u8, (MODREG)?ed:-1); } VSSHRQ_8(q0, q1, 7); // create mask - if(v0==v1) - VBIFQ(v0, v2, q0); - else { - if(v0!=v2) VMOVQ(v0, v2); - VBITQ(v0, v1, q0); - } + if(v0!=v2) VBIFQ(v0, v2, q0); + if(v0!=v1) VBITQ(v0, v1, q0); } if(!vex.l) YMM0(gd); break; + case 0xDF: + INST_NAME("VAESKEYGENASSIST Gx, Ex, Ib"); + nextop = F8; + GETG; + sse_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); // gx + if(MODREG) { + ed = (nextop&7)+(rex.b<<3); + sse_forget_reg(dyn, ninst, ed); + MOV32w(x2, ed); + MOV32w(x3, 0); //p = NULL + } else { + MOV32w(x2, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 1); + if(ed!=x3) { + MOVx_REG(x3, ed); + } + } + u8 = F8; + MOV32w(x4, u8); + CALL(const_native_aeskeygenassist, -1); + YMM0(gd); + break; + default: DEFAULT; } diff --git a/src/dynarec/arm64/dynarec_arm64_avx_f2_0f.c b/src/dynarec/arm64/dynarec_arm64_avx_f2_0f.c index 992f454..6e19d8c 100644 --- a/src/dynarec/arm64/dynarec_arm64_avx_f2_0f.c +++ b/src/dynarec/arm64/dynarec_arm64_avx_f2_0f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -22,7 +20,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) { @@ -88,7 +86,6 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, if(v1!=v2) VMOVeD(v1, 1, v2, 1); YMM0((nextop&7)+(rex.b<<3)); } else { - WILLWRITE2(); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); VST64(v0, ed, fixedaddress); SMWRITE2(); @@ -114,7 +111,7 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, if(vex.l) { GETGY_empty(v0, -1, -1, -1); ADDx_U12(x3, ed, 16); - VLDQ1R_64(v0, ed); + VLDQ1R_64(v0, x3); } } if(!vex.l) YMM0(gd); @@ -126,11 +123,17 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, GETGX_empty_VX(v0, v1); GETED(0); d1 = fpu_get_scratch(dyn, ninst); + if(BOX64ENV(dynarec_fastround)<2) { + u8 = sse_setround(dyn, ninst, x3, x4, x5); + } if(rex.w) { SCVTFDx(d1, ed); } else { SCVTFDw(d1, ed); } + if(BOX64ENV(dynarec_fastround)<2) { + x87_restoreround(dyn, ninst, u8); + } if(v0!=v1) VMOVQ(v0, v1); VMOVeD(v0, 0, d1, 0); YMM0(gd); @@ -141,13 +144,23 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; GETGD; GETEXSD(q0, 0, 0); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit MSR_fpsr(x5); } - FCVTZSxwD(gd, q0); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && cpuext.frintts) { + v0 = fpu_get_scratch(dyn, ninst); + if(rex.w) { + FRINT64ZD(v0, q0); + } else { + FRINT32ZD(v0, q0); + } + FCVTZSxwD(gd, v0); + } else { + FCVTZSxwD(gd, q0); + } + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); // get back FPSR to check the IOC bit TBZ_NEXT(x5, FPSR_IOC); if(rex.w) { @@ -162,17 +175,25 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; GETGD; GETEXSD(q0, 0, 0); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit MSR_fpsr(x5); } u8 = sse_setround(dyn, ninst, x1, x2, x3); d1 = fpu_get_scratch(dyn, ninst); - FRINTID(d1, q0); + if(!BOX64ENV(dynarec_fastround) && cpuext.frintts) { + if(rex.w) { + FRINT64XD(d1, q0); + } else { + FRINT32XD(d1, q0); + } + } else { + FRINTID(d1, q0); + } x87_restoreround(dyn, ninst, u8); FCVTZSxwD(gd, d1); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); // get back FPSR to check the IOC bit TBZ_NEXT(x5, FPSR_IOC); if(rex.w) { @@ -189,17 +210,17 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, d1 = fpu_get_scratch(dyn, ninst); GETEXSD(v1, 0, 0); GETGX_empty_VX(v0, v2); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { q0 = fpu_get_scratch(dyn, ninst); q1 = fpu_get_scratch(dyn, ninst); // check if any input value was NAN FCMEQD(q0, v1, v1); // 0 if NAN, 1 if not NAN } FSQRTD(d1, v1); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { FCMEQD(q1, d1, d1); // 0 => out is NAN VBIC(q1, q0, q1); // forget it in any input was a NAN already - VSHLQ_64(q1, q1, 63); // only keep the sign bit + SHL_64(q1, q1, 63); // only keep the sign bit VORR(d1, d1, q1); // NAN -> -NAN } if(v0!=v2) { @@ -212,28 +233,54 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x58: INST_NAME("VADDSD Gx, Vx, Ex"); nextop = F8; - d1 = fpu_get_scratch(dyn, ninst); + q2 = fpu_get_scratch(dyn, ninst); GETEXSD(v1, 0, 0); GETGX_empty_VX(v0, v2); - FADDD(d1, v2, v1); + if(!BOX64ENV(dynarec_fastnan)) { + q1 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FMAXD(q1, v0, v1); // propagate NAN + FCMEQD(q1, q1, q1); // 0 if NAN, 1 if not NAN + FADDD(q2, v1, v2); // the high part of the vector is erased... + FCMEQD(q0, q2, q2); // 0 => out is NAN + VBIC(q0, q1, q0); // forget it in any input was a NAN already + SHL_64(q0, q0, 63); // only keep the sign bit + VORR(q2, q2, q0); // NAN -> -NAN + } else { + FADDD(q2, v1, v2); // the high part of the vector is erased... + } if(v0!=v2) { VMOVQ(v0, v2); } - VMOVeD(v0, 0, d1, 0); + VMOVeD(v0, 0, q2, 0); YMM0(gd) break; case 0x59: INST_NAME("VMULSD Gx, Vx, Ex"); nextop = F8; - d1 = fpu_get_scratch(dyn, ninst); + q2 = fpu_get_scratch(dyn, ninst); GETEXSD(v1, 0, 0); GETGX_empty_VX(v0, v2); - FMULD(d1, v2, v1); + if(!BOX64ENV(dynarec_fastnan)) { + q1 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FMAXD(q1, v0, v1); // propagate NAN + FCMEQD(q1, q1, q1); // 0 if NAN, 1 if not NAN + FMULD(q2, v1, v2); // the high part of the vector is erased... + FCMEQD(q0, q2, q2); // 0 => out is NAN + VBIC(q0, q1, q0); // forget it in any input was a NAN already + SHL_64(q0, q0, 63); // only keep the sign bit + VORR(q2, q2, q0); // NAN -> -NAN + } else { + FMULD(q2, v1, v2); // the high part of the vector is erased... + } if(v0!=v2) { VMOVQ(v0, v2); } - VMOVeD(v0, 0, d1, 0); - YMM0(gd) + VMOVeD(v0, 0, q2, 0); + YMM0(gd); break; case 0x5A: INST_NAME("VCVTSD2SS Gx, Vx, Ex"); @@ -241,7 +288,13 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, d1 = fpu_get_scratch(dyn, ninst); GETEXSD(v1, 0, 0); GETGX_empty_VX(v0, v2); - FCVT_S_D(d1, v1); + if(BOX64ENV(dynarec_fastround)==2) { + FCVT_S_D(d1, v1); + } else { + u8 = sse_setround(dyn, ninst, x1, x2, x3); + FCVT_S_D(d1, v1); + x87_restoreround(dyn, ninst, u8); + } if(v0!=v2) { VMOVQ(v0, v2); } @@ -252,14 +305,27 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x5C: INST_NAME("VSUBSD Gx, Vx, Ex"); nextop = F8; - d1 = fpu_get_scratch(dyn, ninst); + q2 = fpu_get_scratch(dyn, ninst); GETEXSD(v1, 0, 0); GETGX_empty_VX(v0, v2); - FSUBD(d1, v2, v1); + if(!BOX64ENV(dynarec_fastnan)) { + q1 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FMAXD(q1, v0, v1); // propagate NAN + FCMEQD(q1, q1, q1); // 0 if NAN, 1 if not NAN + FSUBD(q2, v2, v1); // the high part of the vector is erased... + FCMEQD(q0, q2, q2); // 0 => out is NAN + VBIC(q0, q1, q0); // forget it in any input was a NAN already + SHL_64(q0, q0, 63); // only keep the sign bit + VORR(q2, q2, q0); // NAN -> -NAN + } else { + FSUBD(q2, v2, v1); // the high part of the vector is erased... + } if(v0!=v2) { VMOVQ(v0, v2); } - VMOVeD(v0, 0, d1, 0); + VMOVeD(v0, 0, q2, 0); YMM0(gd) break; case 0x5D: @@ -270,7 +336,7 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, GETGX_empty_VX(v0, v2); // VMINSD: if any input is NaN, or Ex[0] Gx[0] FCMPD(v2, v1); - FCSELD(d1, v1, v2, cCS); + FCSELD(d1, v1, v2, cCS); //CS: NAN or == or Vx > Ex if(v0!=v2) { VMOVQ(v0, v2); } @@ -280,27 +346,27 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x5E: INST_NAME("VDIVSD Gx, Vx, Ex"); nextop = F8; - d1 = fpu_get_scratch(dyn, ninst); + q2 = fpu_get_scratch(dyn, ninst); GETEXSD(v1, 0, 0); GETGX_empty_VX(v0, v2); - if(!box64_dynarec_fastnan) { - q0 = fpu_get_scratch(dyn, ninst); + if(!BOX64ENV(dynarec_fastnan)) { q1 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); // check if any input value was NAN - FMAXD(q0, v2, v1); // propagate NAN - FCMEQD(q0, q0, q0); // 0 if NAN, 1 if not NAN - } - FDIVD(d1, v2, v1); - if(!box64_dynarec_fastnan) { - FCMEQD(q1, d1, d1); // 0 => out is NAN - VBIC(q1, q0, q1); // forget it in any input was a NAN already - VSHLQ_64(q1, q1, 63); // only keep the sign bit - VORR(d1, d1, q1); // NAN -> -NAN + FMAXD(q1, v0, v1); // propagate NAN + FCMEQD(q1, q1, q1); // 0 if NAN, 1 if not NAN + FDIVD(q2, v2, v1); // the high part of the vector is erased... + FCMEQD(q0, q2, q2); // 0 => out is NAN + VBIC(q0, q1, q0); // forget it in any input was a NAN already + SHL_64(q0, q0, 63); // only keep the sign bit + VORR(q2, q2, q0); // NAN -> -NAN + } else { + FDIVD(q2, v2, v1); // the high part of the vector is erased... } if(v0!=v2) { VMOVQ(v0, v2); } - VMOVeD(v0, 0, d1, 0); + VMOVeD(v0, 0, q2, 0); YMM0(gd) break; case 0x5F: @@ -310,7 +376,7 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, GETEXSD(v1, 0, 0); GETGX_empty_VX(v0, v2); FCMPD(v1, v2); - FCSELD(d1, v1, v2, cCS); + FCSELD(d1, v1, v2, cCS); //CS: NAN or == or Ex > Vx if(v0!=v2) { VMOVQ(v0, v2); } @@ -323,7 +389,7 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; d0 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETEX(v1, 0, 1); GETGX(v0, 1); u8 = F8; } else { GETGY(v0, 1, MODREG?((nextop&7)+(rex.b<<3)):-1, -1, -1); GETEY(v1); } + if(!l) { GETEX_Y(v1, 0, 1); GETGX(v0, 1); u8 = F8; } else { GETGY(v0, 1, MODREG?((nextop&7)+(rex.b<<3)):-1, -1, -1); GETEY(v1); } if(u8==0b00000000 || u8==0b01010101 || u8==0b10101010 || u8==0b11111111) { if(v0==v1) { VMOVQ(d0, v1); @@ -355,30 +421,85 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x7C: INST_NAME("VHADDPS Gx, Vx, Ex"); nextop = F8; + if(!BOX64ENV(dynarec_fastnan)) { + q0 = fpu_get_scratch(dyn, ninst); + q1 = fpu_get_scratch(dyn, ninst); + } for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } + if(!BOX64ENV(dynarec_fastnan)) { + // check if any input value was NAN + VFMAXPQS(q0, v2, v1); // propagate NAN + VFCMEQQS(q0, q0, q0); // 0 if NAN, 1 if not NAN + } VFADDPQS(v0, v2, v1); + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(q1, v0, v0); // 0 => out is NAN + VBICQ(q1, q0, q1); // forget it in any input was a NAN already + VSHLQ_32(q1, q1, 31); // only keep the sign bit + VORRQ(v0, v0, q1); // NAN -> -NAN + } + } + if(!vex.l) YMM0(gd); + break; + case 0x7D: + INST_NAME("VHSUBPS Gx, Vx, Ex"); + nextop = F8; + q0 = fpu_get_scratch(dyn, ninst); + if(!BOX64ENV(dynarec_fastnan)) + q1 = fpu_get_scratch(dyn, ninst); + for(int l=0; l<1+vex.l; ++l) { + if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } + VUZP1Q_32(q0, v2, v1); + VUZP2Q_32(v0, v2, v1); + if(!BOX64ENV(dynarec_fastnan)) { + // check if any input value was NAN + // but need to mix low/high part + VFMAXQS(q1, v0, q0); // propagate NAN + VFCMEQQS(q1, q1, q1); // 0 if NAN, 1 if not NAN + } + VFSUBQS(v0, q0, v0); + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(q0, v0, v0); // 0 => out is NAN + VBICQ(q1, q1, q0); // forget it in any input was a NAN already + VSHLQ_32(q1, q1, 31); // only keep the sign bit + VORRQ(v0, v0, q1); // NAN -> -NAN + } } if(!vex.l) YMM0(gd); break; case 0xC2: - INST_NAME("CMPSD Gx, Ex, Ib"); + INST_NAME("VCMPSD Gx, Ex, Ib"); nextop = F8; GETEXSD(v1, 0, 1); GETGX_empty_VX(v0, v2); u8 = F8; - FCMPD(v2, v1); + if(((u8&15)!=0x0b) && ((u8&15)!=0x0f)) { + if((u8&15)>7) + FCMPD(v1, v2); + else + FCMPD(v2, v1); + } + // TODO: create a test for this one, there might be an issue with cases 9, 10 and 13 if(v0!=v2) VMOVQ(v0, v2); - switch(u8&7) { - case 0: CSETMx(x2, cEQ); break; // Equal - case 1: CSETMx(x2, cCC); break; // Less than - case 2: CSETMx(x2, cLS); break; // Less or equal - case 3: CSETMx(x2, cVS); break; // NaN - case 4: CSETMx(x2, cNE); break; // Not Equal or unordered - case 5: CSETMx(x2, cCS); break; // Greater or equal or unordered - case 6: CSETMx(x2, cHI); break; // Greater or unordered, test inverted, N!=V so unordered or less than (inverted) - case 7: CSETMx(x2, cVC); break; // not NaN + switch(u8&15) { + case 0x00: CSETMx(x2, cEQ); break; // Equal + case 0x01: CSETMx(x2, cCC); break; // Less than + case 0x02: CSETMx(x2, cLS); break; // Less or equal + case 0x03: CSETMx(x2, cVS); break; // NaN + case 0x04: CSETMx(x2, cNE); break; // Not Equal or unordered + case 0x05: CSETMx(x2, cCS); break; // Greater or equal or unordered + case 0x06: CSETMx(x2, cHI); break; // Greater or unordered + case 0x07: CSETMx(x2, cVC); break; // not NaN + case 0x08: CSETMx(x2, cEQ); CSETMx(x3, cVS); ORRx_REG(x2, x2, x3); break; // Equal or unordered + case 0x09: CSETMx(x2, cHI); break; // Less than or unordered + case 0x0a: CSETMx(x2, cCS); break; // Less or equal or unordered + case 0x0b: MOV32w(x2, 0); break; // false + case 0x0c: CSETMx(x2, cNE); CSETMx(x3, cVS); BICx(x2, x2, x3); break; // Not Equal not unordered + case 0x0d: CSETMx(x2, cLS); break; // Greater or equal not unordered + case 0x0e: CSETMx(x2, cCC); break; // Greater not unordered + case 0x0f: MOV64x(x2, 0xffffffffffffffffLL); break; // true } VMOVQDfrom(v0, 0, x2); YMM0(gd); @@ -388,15 +509,16 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, INST_NAME("VADDSUBPS Gx, Vx, Ex"); nextop = F8; q0 = fpu_get_scratch(dyn, ninst); - static float addsubps[4] = {-1.f, 1.f, -1.f, 1.f}; - MAYUSE(addsubps); - TABLE64(x2, (uintptr_t)&addsubps); + TABLE64C(x2, const_4f_m1_1_m1_1); VLDR128_U12(q0, x2, 0); for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); if(v0==v1) q1 = fpu_get_scratch(dyn, ninst); } else { GETGY_empty_VYEY(v0, v2, v1); } + if(!l) { GETGX_empty_VXEX(v0, v2, v1, 0); } else { GETGY_empty_VYEY(v0, v2, v1); } if(v0==v1) { - VFMULQS(q1, v1, q0); - VFADDQS(v0, v2, q1); + //TODO: find a better way + if(!l) q1 = fpu_get_scratch(dyn, ninst); + VMOVQ(q1, v2); + VFMLAQS(q1, v1, q0); + VMOVQ(v0, q1); } else { if(v0!=v2) VMOVQ(v0, v2); VFMLAQS(v0, v1, q0); @@ -413,12 +535,12 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, if(!l) { GETEX_Y(v1, 0, 0); GETGX_empty(v0); - if(!box64_dynarec_fastround || vex.l) + if(!BOX64ENV(dynarec_fastround) || vex.l) d0 = fpu_get_scratch(dyn, ninst); } else { GETEY(v1); } - if(box64_dynarec_fastround) { + if(BOX64ENV(dynarec_fastround)) { VFRINTIDQ(l?d0:v0, v1); VFCVTNSQD(l?d0:v0, l?d0:v0); // convert double -> int64 if(!l) @@ -426,28 +548,35 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, else SQXTN2_32(v0, d0); // convert int64 -> int32 with saturation in higher part } else { - if(!l) { - MRS_fpsr(x5); - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - ORRw_mask(x4, xZR, 1, 0); //0x80000000 - } - for(int i=0; i<2; ++i) { - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - if(i) { - VMOVeD(d0, 0, v1, i); - FRINTID(d0, d0); - } else { - FRINTID(d0, v1); + if(cpuext.frintts) { + VFRINT32XDQ(l?d0:v0, v1); // round, handling of overflow and Nan to 0x80000000 + VFCVTNSQD(l?d0:v0, l?d0:v0); // convert double -> int64 + if(!l) + SQXTN_32(v0, v0); // convert int64 -> int32 with saturation in lower part, RaZ high part + else + SQXTN2_32(v0, d0); // convert int64 -> int32 with saturation in higher part + } else { + if(!l) { + MRS_fpsr(x5); + ORRw_mask(x4, xZR, 1, 0); //0x80000000 + } + for(int i=0; i<2; ++i) { + BFCw(x5, FPSR_IOC, 1); // reset IOC bit + MSR_fpsr(x5); + if(i) { + VMOVeD(d0, 0, v1, i); + FRINTID(d0, d0); + } else { + FRINTID(d0, v1); + } + FCVTZSwD(x1, d0); + MRS_fpsr(x5); // get back FPSR to check the IOC bit + TSTw_mask(x5, 0, 0); // mask = 1 = FPSR_IOC + CSELx(x1, x1, x4, cEQ); + VMOVQSfrom(v0, i+l*2, x1); } - FCVTZSwD(x1, d0); - MRS_fpsr(x5); // get back FPSR to check the IOC bit - TSTw_mask(x5, 0, 0); // mask = 1 = FPSR_IOC - CSELx(x1, x1, x4, cEQ); - VMOVQSfrom(v0, i+l*2, x1); + if(!vex.l && !l) VMOVQDfrom(v0, 1, xZR); } - if(!vex.l && !l) VMOVQDfrom(v0, 1, xZR); } } x87_restoreround(dyn, ninst, u8); @@ -455,7 +584,7 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, break; case 0xF0: - INST_NAME("LDDQU Gx,Ex"); + INST_NAME("VLDDQU Gx,Ex"); nextop = F8; GETG; if(MODREG) { @@ -467,12 +596,16 @@ uintptr_t dynarec64_AVX_F2_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, VMOVQ(v0, v1); } } else { - v0 = sse_get_reg_empty(dyn, ninst, x1, gd); SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 7, rex, NULL, 0, 0); - VLDR128_U12(v0, ed, fixedaddress); - v0 = ymm_get_reg_empty(dyn, ninst, x1, gd, -1, -1, -1); - VLDR128_U12(v0, ed, fixedaddress+16); + v0 = sse_get_reg_empty(dyn, ninst, x1, gd); + if (vex.l) { + v1 = ymm_get_reg_empty(dyn, ninst, x1, gd, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0x3f << 4, 15, rex, NULL, 1, 0); + VLDP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff << 4, 15, rex, NULL, 0, 0); + VLD128(v0, ed, fixedaddress); + } } if(!vex.l) YMM0(gd); break; diff --git a/src/dynarec/arm64/dynarec_arm64_avx_f2_0f38.c b/src/dynarec/arm64/dynarec_arm64_avx_f2_0f38.c index 779fb21..6c84d0f 100644 --- a/src/dynarec/arm64/dynarec_arm64_avx_f2_0f38.c +++ b/src/dynarec/arm64/dynarec_arm64_avx_f2_0f38.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -22,7 +20,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_AVX_F2_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) { @@ -60,7 +58,36 @@ uintptr_t dynarec64_AVX_F2_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip rex_t rex = vex.rex; switch(opcode) { - + case 0xF5: + INST_NAME("PDEP Gd, Ed, Vd"); + nextop = F8; + GETGD; + GETED(0); + GETVD; + if(gd==ed || gd==vd) { + gb1 = gd; + gd = x4; + } else { + gb1 = 0; + } + // x3 = mask of mask, loop while not 0 + MOV32w(gd, 0); + MOV64x(x2, 1); + MOV64x(x3, 1); + MARK; + TSTxw_REG(ed, x3); + B_MARK2(cEQ); + TSTxw_REG(vd, x2); + B_MARK3(cEQ); + ORRxw_REG(gd, gd, x3); + MARK3; + LSLxw_IMM(x2, x2, 1); + MARK2; + LSLxw_IMM(x3, x3, 1); + CBNZxw_MARK(x3); + if(gb1) + MOVxw_REG(gb1, gd); + break; case 0xF6: INST_NAME("MULX Gd, Vd, Ed (,RDX)"); nextop = F8; @@ -69,13 +96,19 @@ uintptr_t dynarec64_AVX_F2_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip GETVD; if(rex.w) { // 64bits mul - UMULH(x3, xRDX, ed); - MULx(vd, xRDX, ed); - MOVx_REG(gd, x3); + if((gd==xRDX) || (gd==ed) || (gd==vd)) + gb1 = x3; + else + gb1 = gd; + UMULH(gb1, xRDX, ed); + if(gd!=vd) {MULx(vd, xRDX, ed);} + if(gb1==x3) { + MOVx_REG(gd, gb1); + } } else { // 32bits mul UMULL(x3, xRDX, ed); - MOVw_REG(vd, x3); + if(gd!=vd) {MOVw_REG(vd, x3);} LSRx(gd, x3, 32); } break; diff --git a/src/dynarec/arm64/dynarec_arm64_avx_f2_0f3a.c b/src/dynarec/arm64/dynarec_arm64_avx_f2_0f3a.c index 0fa4f01..b0fefff 100644 --- a/src/dynarec/arm64/dynarec_arm64_avx_f2_0f3a.c +++ b/src/dynarec/arm64/dynarec_arm64_avx_f2_0f3a.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -22,7 +20,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_AVX_F2_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) { diff --git a/src/dynarec/arm64/dynarec_arm64_avx_f3_0f.c b/src/dynarec/arm64/dynarec_arm64_avx_f3_0f.c index 08a0482..6ef8ad1 100644 --- a/src/dynarec/arm64/dynarec_arm64_avx_f3_0f.c +++ b/src/dynarec/arm64/dynarec_arm64_avx_f3_0f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -22,7 +20,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) { @@ -83,7 +81,7 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; GETG; if(MODREG) { - GETGXVXEX_empty(v0, v2, v1, 0); + GETGXVXEX_empty(v0, v1, v2, 0); if((v2!=v1) && (v2!=v0)) VMOVQ(v2, v1); if(v2!=v0) VMOVeS(v2, 0, v0, 0); if((v2!=v1) && (v2==v0)) { VMOVeS(v2, 1, v0, 1); VMOVeD(v2, 1, v0, 1);} @@ -108,7 +106,7 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, break; case 0x16: - INST_NAME("MOVSHDUP Gx, Ex"); + INST_NAME("VMOVSHDUP Gx, Ex"); nextop = F8; GETEX_Y(q1, 0, 0); GETGX_empty(q0); @@ -125,11 +123,17 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, d1 = fpu_get_scratch(dyn, ninst); GETGX_empty_VX(v0, v1); GETED(0); + if(BOX64ENV(dynarec_fastround)<2) { + u8 = sse_setround(dyn, ninst, x3, x4, x5); + } if(rex.w) { SCVTFSx(d1, ed); } else { SCVTFSw(d1, ed); } + if(BOX64ENV(dynarec_fastround)<2) { + x87_restoreround(dyn, ninst, u8); + } if(v0!=v1) VMOVQ(v0, v1); VMOVeS(v0, 0, d1, 0); YMM0(gd); @@ -140,13 +144,23 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; GETGD; GETEXSS(d0, 0, 0); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit MSR_fpsr(x5); } - FCVTZSxwS(gd, d0); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && cpuext.frintts) { + v0 = fpu_get_scratch(dyn, ninst); + if(rex.w) { + FRINT64ZS(v0, d0); + } else { + FRINT32ZS(v0, d0); + } + FCVTZSxwS(gd, v0); + } else { + FCVTZSxwS(gd, d0); + } + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); // get back FPSR to check the IOC bit TBZ_NEXT(x5, FPSR_IOC); if(rex.w) { @@ -161,17 +175,25 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; GETGD; GETEXSS(q0, 0, 0); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit MSR_fpsr(x5); } u8 = sse_setround(dyn, ninst, x1, x2, x3); d1 = fpu_get_scratch(dyn, ninst); - FRINTIS(d1, q0); + if(!BOX64ENV(dynarec_fastround) && cpuext.frintts) { + if(rex.w) { + FRINT64XS(d1, q0); + } else { + FRINT32XS(d1, q0); + } + } else { + FRINTIS(d1, q0); + } x87_restoreround(dyn, ninst, u8); FCVTZSxwS(gd, d1); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); // get back FPSR to check the IOC bit TBZ_NEXT(x5, FPSR_IOC); if(rex.w) { @@ -183,12 +205,24 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, break; case 0x51: - INST_NAME("SQRTSS Gx, Ex"); + INST_NAME("VSQRTSS Gx, Ex"); nextop = F8; GETEXSS(d0, 0, 0); GETGX_empty_VX(v0, v2); d1 = fpu_get_scratch(dyn, ninst); + if(!BOX64ENV(dynarec_fastnan)) { + q0 = fpu_get_scratch(dyn, ninst); + q1 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FCMEQS(q0, v1, v1); // 0 if NAN, 1 if not NAN + } FSQRTS(d1, d0); + if(!BOX64ENV(dynarec_fastnan)) { + FCMEQS(q1, d1, d1); // 0 => out is NAN + VBIC(q1, q0, q1); // forget it in any input was a NAN already + VSHL_32(q1, q1, 31); // only keep the sign bit + VORR(d1, d1, q1); // NAN -> -NAN + } if(v0!=v2) VMOVQ(v0, v2); VMOVeS(v0, 0, d1, 0); YMM0(gd); @@ -215,39 +249,72 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, VMOVeS(v0, 0, d0, 0); YMM0(gd); break; + case 0x53: + INST_NAME("VRCPSS Gx, Vx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETVX(v2, 0); + GETEXSS(v1, 0, 0); + d0 = fpu_get_scratch(dyn, ninst); + FMOVS_8(d0, 0b01110000); //1.0f + FDIVS(d0, d0, v1); + if(v0!=v2) { + VMOVQ(v0, v2); + } + VMOVeS(v0, 0, d0, 0); + YMM0(gd); + break; case 0x58: INST_NAME("VADDSS Gx, Vx, Ex"); nextop = F8; - d1 = fpu_get_scratch(dyn, ninst); + q2 = fpu_get_scratch(dyn, ninst); GETEXSS(v1, 0, 0); GETGX_empty_VX(v0, v2); + if(!BOX64ENV(dynarec_fastnan)) { + q1 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FMAXS(q1, v0, v1); // propagate NAN + FCMEQS(q1, q1, q1); // 0 if NAN, 1 if not NAN + FADDS(q2, v1, v2); // the high part of the vector is erased... + FCMEQS(q0, q2, q2); // 0 => out is NAN + VBIC(q0, q1, q0); // forget it in any input was a NAN already + VSHL_32(q0, q0, 31); // only keep the sign bit + VORR(q2, q2, q0); // NAN -> -NAN + } else { + FADDS(q2, v1, v2); // the high part of the vector is erased... + } if(v0!=v2) { - if(v0==v1) { - VMOV(d1, v1); - v1 = d1; - } VMOVQ(v0, v2); } - FADDS(d1, v0, v1); - VMOVeS(v0, 0, d1, 0); + VMOVeS(v0, 0, q2, 0); YMM0(gd) break; case 0x59: INST_NAME("VMULSS Gx, Vx, Ex"); nextop = F8; - d1 = fpu_get_scratch(dyn, ninst); + q2 = fpu_get_scratch(dyn, ninst); GETEXSS(v1, 0, 0); GETGX_empty_VX(v0, v2); + if(!BOX64ENV(dynarec_fastnan)) { + q1 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FMAXS(q1, v0, v1); // propagate NAN + FCMEQS(q1, q1, q1); // 0 if NAN, 1 if not NAN + FMULS(q2, v1, v2); // the high part of the vector is erased... + FCMEQS(q0, q2, q2); // 0 => out is NAN + VBIC(q0, q1, q0); // forget it in any input was a NAN already + VSHL_32(q0, q0, 31); // only keep the sign bit + VORR(q2, q2, q0); // NAN -> -NAN + } else { + FMULS(q2, v1, v2); // the high part of the vector is erased... + } if(v0!=v2) { - if(v0==v1) { - VMOV(d1, v1); - v1 = d1; - } VMOVQ(v0, v2); } - FMULS(d1, v0, v1); - VMOVeS(v0, 0, d1, 0); + VMOVeS(v0, 0, q2, 0); YMM0(gd) break; case 0x5A: @@ -256,41 +323,43 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, d1 = fpu_get_scratch(dyn, ninst); GETEXSS(v1, 0, 0); GETGX_empty_VX(v0, v2); - if(v0!=v2) { - if(v0==v1) { - VMOV(d1, v1); - v1 = d1; - } - VMOVQ(v0, v2); - } FCVT_D_S(d1, v1); VMOVeD(v0, 0, d1, 0); + if(v0!=v2) + VMOVeD(v0, 1, v2, 1); YMM0(gd); break; case 0x5B: INST_NAME("VCVTTPS2DQ Gx, Ex"); nextop = F8; d0 = fpu_get_scratch(dyn, ninst); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround)) { MRS_fpsr(x5); ORRw_mask(x4, xZR, 1, 0); //0x80000000 } for(int l=0; l<1+vex.l; ++l) { if(!l) { GETGX_empty_EX(v0, v1, 0); } else { GETGY_empty_EY(v0, v1); } - if(box64_dynarec_fastround) { + if(BOX64ENV(dynarec_fastround)) { VFCVTZSQS(v0, v1); } else { - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - for(int i=0; i<4; ++i) { - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - VMOVeS(d0, 0, v1, i); - VFCVTZSs(d0, d0); - MRS_fpsr(x5); // get back FPSR to check the IOC bit - TBZ(x5, FPSR_IOC, 4+4); - VMOVQSfrom(d0, 0, x4); - VMOVeS(v0, i, d0, 0); + if(cpuext.frintts) { + VFRINT32ZSQ(v0, v1); + VFCVTZSQS(v0, v0); + } else { + for(int i=0; i<4; ++i) { + BFCw(x5, FPSR_IOC, 1); // reset IOC bit + MSR_fpsr(x5); + if(i) { + VMOVeS(d0, 0, v1, i); + VFCVTZSs(d0, d0); + } else { + VFCVTZSs(d0, v1); + } + MRS_fpsr(x5); // get back FPSR to check the IOC bit + TBZ(x5, FPSR_IOC, 4+4); + VMOVQSfrom(d0, 0, x4); + VMOVeS(v0, i, d0, 0); + } } } } @@ -299,14 +368,27 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x5C: INST_NAME("VSUBSS Gx, Vx, Ex"); nextop = F8; - d1 = fpu_get_scratch(dyn, ninst); + q2 = fpu_get_scratch(dyn, ninst); GETEXSS(v1, 0, 0); GETGX_empty_VX(v0, v2); - FSUBS(d1, v2, v1); + if(!BOX64ENV(dynarec_fastnan)) { + q1 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FMAXS(q1, v0, v1); // propagate NAN + FCMEQS(q1, q1, q1); // 0 if NAN, 1 if not NAN + FSUBS(q2, v2, v1); // the high part of the vector is erased... + FCMEQS(q0, q2, q2); // 0 => out is NAN + VBIC(q0, q1, q0); // forget it in any input was a NAN already + VSHL_32(q0, q0, 31); // only keep the sign bit + VORR(q2, q2, q0); // NAN -> -NAN + } else { + FSUBS(q2, v2, v1); // the high part of the vector is erased... + } if(v0!=v2) { VMOVQ(v0, v2); } - VMOVeS(v0, 0, d1, 0); + VMOVeS(v0, 0, q2, 0); YMM0(gd) break; case 0x5D: @@ -316,7 +398,7 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, GETEXSS(v1, 0, 0); GETGX_empty_VX(v0, v2); FCMPS(v2, v1); - FCSELS(d1, v1, v2, cCS); + FCSELS(d1, v1, v2, cCS); //CS: NAN or == or Ex > Vx if(v0!=v2) { VMOVQ(v0, v2); } @@ -326,14 +408,27 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, case 0x5E: INST_NAME("VDIVSS Gx, Vx, Ex"); nextop = F8; - d1 = fpu_get_scratch(dyn, ninst); + q2 = fpu_get_scratch(dyn, ninst); GETEXSS(v1, 0, 0); GETGX_empty_VX(v0, v2); - FDIVS(d1, v2, v1); + if(!BOX64ENV(dynarec_fastnan)) { + q1 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FMAXS(q1, v0, v1); // propagate NAN + FCMEQS(q1, q1, q1); // 0 if NAN, 1 if not NAN + FDIVS(q2, v2, v1); // the high part of the vector is erased... + FCMEQS(q0, q2, q2); // 0 => out is NAN + VBIC(q0, q1, q0); // forget it in any input was a NAN already + VSHL_32(q0, q0, 31); // only keep the sign bit + VORR(q2, q2, q0); // NAN -> -NAN + } else { + FDIVS(q2, v2, v1); // the high part of the vector is erased... + } if(v0!=v2) { VMOVQ(v0, v2); } - VMOVeS(v0, 0, d1, 0); + VMOVeS(v0, 0, q2, 0); YMM0(gd) break; case 0x5F: @@ -343,7 +438,7 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, GETEXSS(v1, 0, 0); GETGX_empty_VX(v0, v2); FCMPS(v1, v2); - FCSELS(d1, v1, v2, cCS); + FCSELS(d1, v1, v2, cCS); //CS: NAN or == or Ex > Vx if(v0!=v2) { VMOVQ(v0, v2); } @@ -355,22 +450,22 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, INST_NAME("VMOVDQU Gx, Ex");// no alignment constraint on NEON here, so same as MOVDQA nextop = F8; if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); - GETGX_empty(v0); + GETGX_empty_EX(v0, v1, 0); VMOVQ(v0, v1); if(vex.l) { - v1 = ymm_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0, gd, -12, -1); - GETGY_empty(v0, (nextop&7)+(rex.b<<3), -1, -1); + GETGY_empty_EY(v0, v1); VMOVQ(v0, v1); } } else { GETGX_empty(v0); SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VLDR128_U12(v0, ed, fixedaddress); if(vex.l) { - GETGY_empty(v0, -1, -1, -1); - VLDR128_U12(v0, ed, fixedaddress+16); + GETGY_empty(v1, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VLDP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VLD128(v0, ed, fixedaddress); } } if(!vex.l) YMM0(gd); @@ -380,7 +475,7 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; d0 = fpu_get_scratch(dyn, ninst); for(int l=0; l<1+vex.l; ++l) { - if(!l) { GETEX(v1, 0, 1); GETGX(v0, 1); u8 = F8; } else { GETGY(v0, 1, MODREG?((nextop&7)+(rex.b<<3)):-1, -1, -1); GETEY(v1); } + if(!l) { GETEX_Y(v1, 0, 1); GETGX(v0, 1); u8 = F8; } else { GETGY(v0, 1, MODREG?((nextop&7)+(rex.b<<3)):-1, -1, -1); GETEY(v1); } if(u8==0b00000000 || u8==0b01010101 || u8==0b10101010 || u8==0b11111111) { VDUP_16(d0, v1, 4+(u8&3)); } else { @@ -405,7 +500,7 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, break; case 0x7E: - INST_NAME("MOVQ Gx, Ex"); + INST_NAME("VMOVQ Gx, Ex"); nextop = F8; if(MODREG) { v1 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 0); @@ -424,19 +519,38 @@ uintptr_t dynarec64_AVX_F3_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, nextop = F8; GETGX(v0, 0); if(MODREG) { - v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7) + (rex.b<<3)); + ed = (nextop&7) + (rex.b<<3); + v1 = sse_get_reg_empty(dyn, ninst, x1, ed); VMOVQ(v1, v0); if(vex.l) { - GETGY(v0, 0, (nextop&7) + (rex.b<<3), -1, -1); - v1 = ymm_get_reg_empty(dyn, ninst, x1, (nextop&7) + (rex.b<<3), gd, -1, -1); + GETGY(v0, 0, ed, -1, -1); + v1 = ymm_get_reg_empty(dyn, ninst, x1, ed, gd, -1, -1); VMOVQ(v1, v0); - } // no ymm raz here it seems + } else YMM0(ed); } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, 0); - VSTR128_U12(v0, ed, fixedaddress); - if(vex.l) { - GETGY(v0, 0, -1, -1, -1); - VSTR128_U12(v0, ed, fixedaddress+16); + IF_UNALIGNED(ip) { + MESSAGE(LOG_DEBUG, "\tUnaligned path"); + addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + for(int i=0; i<16; ++i) { + VST1_8(v0, i, i?x1:wback); + ADDx_U12(x1, i?x1:wback, 1); + } + if(vex.l) { + GETGY(v0, 0, -1, -1, -1); + for(int i=0; i<16; ++i) { + VST1_8(v0, i, x1); + ADDx_U12(x1, x1, 1); + } + } + } else { + if(vex.l) { + GETGY(v1, 0, -1, -1, -1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0x3f<<4, 15, rex, NULL, 1, 0); + VSTP128_I7(v0, v1, ed, fixedaddress); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VST128(v0, ed, fixedaddress); + } } SMWRITE2(); } diff --git a/src/dynarec/arm64/dynarec_arm64_avx_f3_0f38.c b/src/dynarec/arm64/dynarec_arm64_avx_f3_0f38.c new file mode 100644 index 0000000..4525a08 --- /dev/null +++ b/src/dynarec/arm64/dynarec_arm64_avx_f3_0f38.c @@ -0,0 +1,105 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" +#include "my_cpuid.h" +#include "emu/x87emu_private.h" +#include "emu/x64shaext.h" + +#include "arm64_printer.h" +#include "dynarec_arm64_private.h" +#include "dynarec_arm64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_F3_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u; + int64_t j64; + int64_t fixedaddress; + int unscaled; + MAYUSE(wb1); + MAYUSE(wb2); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(gb1); + MAYUSE(gb2); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(s0); + MAYUSE(j64); + MAYUSE(cacheupd); + + rex_t rex = vex.rex; + + switch(opcode) { + + case 0xF5: + INST_NAME("PEXT Gd, Ed, Vd"); + nextop = F8; + GETGD; + GETED(0); + GETVD; + if(gd==ed || gd==vd) { + gb1 = gd; + gd = x4; + } else { + gb1 = 0; + } + // x3 = mask of mask, loop while not 0 + MOV32w(gd, 0); + MOV64x(x3, 1LL<<(rex.w?63:31)); + MARK; + TSTxw_REG(ed, x3); + B_MARK2(cEQ); // mask not set + TSTxw_REG(vd, x3); + CSINCxw(gd, gd, gd, cEQ); // return gd if TRUE, else gd+1 + RORxw(gd, gd, 1); + MARK2; + LSRxw_IMM(x3, x3, 1); + CBNZxw_MARK(x3); + RBITxw(gd, gd); + if(gb1) + MOVxw_REG(gb1, gd); + break; + + case 0xF7: + INST_NAME("SARX Gd, Ed, Vd"); + nextop = F8; + GETGD; + GETED(0); + GETVD; + ANDx_mask(x3, vd, 1, 0, rex.w?5:4); // mask 0x3f/0x1f + ASRxw_REG(gd, ed, x3); + break; + + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/arm64/dynarec_arm64_consts.c b/src/dynarec/arm64/dynarec_arm64_consts.c new file mode 100644 index 0000000..efa924c --- /dev/null +++ b/src/dynarec/arm64/dynarec_arm64_consts.c @@ -0,0 +1,144 @@ +#include +#include + +#include "dynarec_arm64_consts.h" +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "emu/x87emu_private.h" +#include "emu/x64primop.h" +#include "my_cpuid.h" +#include "freq.h" +#include "debug.h" +#include "custommem.h" +#include "dynarec_arm64_functions.h" +#include "emu/x64shaext.h" +#include "emu/x87emu_private.h" +#include "emu/x64compstrings.h" +#include "x64test.h" +#include "dynarec/dynarec_next.h" +#include "random.h" + +static const int8_t mask_shift8[] = { -7, -6, -5, -4, -3, -2, -1, 0 }; +static const int8_t mask_string8[] = { 7, 6, 5, 4, 3, 2, 1, 0 }; +static const int8_t mask_string16[] = { 15, 14, 13, 12, 11, 10, 9, 8 }; +static const float addsubps[4] = {-1.f, 1.f, -1.f, 1.f}; +static const double addsubpd[2] = {-1., 1.}; +static const float subaddps[4] = {1.f, -1.f, 1.f, -1.f}; +static const double subaddpd[2] = {1., -1.}; + +#ifndef HAVE_TRACE +void PrintTrace() {} +#endif + +uintptr_t getConst(arm64_consts_t which) +{ + switch(which) { + case const_none: dynarec_log(LOG_NONE, "Warning, const none used\n"); + return 0; + case const_daa8: return (uintptr_t)daa8; + case const_das8: return (uintptr_t)das8; + case const_aaa16: return (uintptr_t)aaa16; + case const_aas16: return (uintptr_t)aas16; + case const_aam16: return (uintptr_t)aam16; + case const_aad16: return (uintptr_t)aad16; + case const_native_br: return (uintptr_t)native_br; + case const_native_ud: return (uintptr_t)native_ud; + case const_native_priv: return (uintptr_t)native_priv; + case const_native_gpf: return (uintptr_t)native_gpf; + case const_native_int3: return (uintptr_t)native_int3; + case const_native_int: return (uintptr_t)native_int; + case const_native_div0: return (uintptr_t)native_div0; + case const_native_frstor16: return (uintptr_t)native_frstor16; + case const_native_fsave16: return (uintptr_t)native_fsave16; + case const_native_fsave: return (uintptr_t)native_fsave; + case const_native_aesimc: return (uintptr_t)native_aesimc; + case const_native_aesd: return (uintptr_t)native_aesd; + case const_native_aesd_y: return (uintptr_t)native_aesd_y; + case const_native_aesdlast: return (uintptr_t)native_aesdlast; + case const_native_aesdlast_y: return (uintptr_t)native_aesdlast_y; + case const_native_aese: return (uintptr_t)native_aese; + case const_native_aese_y: return (uintptr_t)native_aese_y; + case const_native_aeselast: return (uintptr_t)native_aeselast; + case const_native_aeselast_y: return (uintptr_t)native_aeselast_y; + case const_native_aeskeygenassist: return (uintptr_t)native_aeskeygenassist; + case const_native_pclmul: return (uintptr_t)native_pclmul; + case const_native_pclmul_x: return (uintptr_t)native_pclmul_x; + case const_native_pclmul_y: return (uintptr_t)native_pclmul_y; + case const_direct_f2xm1: return (uintptr_t)direct_f2xm1; + case const_direct_fyl2x: return (uintptr_t)direct_fyl2x; + case const_direct_fyl2xp1: return (uintptr_t)direct_fyl2xp1; + case const_native_fxtract: return (uintptr_t)native_fxtract; + case const_direct_ftan: return (uintptr_t)direct_ftan; + case const_direct_fpatan: return (uintptr_t)direct_fpatan; + case const_direct_fcos: return (uintptr_t)direct_fcos; + case const_direct_fsin: return (uintptr_t)direct_fsin; + case const_native_fsincos: return (uintptr_t)native_fsincos; + case const_direct_fscale: return (uintptr_t)direct_fscale; + case const_native_fld: return (uintptr_t)native_fld; + case const_native_fstp: return (uintptr_t)native_fstp; + case const_native_frstor: return (uintptr_t)native_frstor; + case const_native_next: return (uintptr_t)native_next; + case const_int3: return (uintptr_t)EmuInt3; + case const_x86syscall: return (uintptr_t)EmuX86Syscall; + case const_x64syscall: return (uintptr_t)EmuX64Syscall; + case const_x64syscall_linux: return (uintptr_t)EmuX64Syscall_linux; + case const_rcl16: return (uintptr_t)rcl16; + case const_rcl32: return (uintptr_t)rcl32; + case const_rcl64: return (uintptr_t)rcl64; + case const_rcr16: return (uintptr_t)rcr16; + case const_rcr32: return (uintptr_t)rcr32; + case const_rcr64: return (uintptr_t)rcr64; + case const_div64: return (uintptr_t)div64; + case const_idiv64: return (uintptr_t)idiv64; + case const_random32: return (uintptr_t)get_random32; + case const_random64: return (uintptr_t)get_random64; + case const_readtsc: return (uintptr_t)ReadTSC; + case const_helper_getcpu: return (uintptr_t)helper_getcpu; + case const_cpuid: return (uintptr_t)my_cpuid; + case const_getsegmentbase: return (uintptr_t)GetSegmentBaseEmu; + case const_updateflags_arm64: return (uintptr_t)create_updateflags(); + case const_reset_fpu: return (uintptr_t)reset_fpu; + case const_sha1msg2: return (uintptr_t)sha1msg2; + case const_sha1rnds4: return (uintptr_t)sha1rnds4; + case const_sha256msg1: return (uintptr_t)sha256msg1; + case const_sha256msg2: return (uintptr_t)sha256msg2; + case const_sha256rnds2: return (uintptr_t)sha256rnds2; + case const_fpu_loadenv: return (uintptr_t)fpu_loadenv; + case const_fpu_savenv: return (uintptr_t)fpu_savenv; + case const_fpu_fxsave32: return (uintptr_t)fpu_fxsave32; + case const_fpu_fxsave64: return (uintptr_t)fpu_fxsave64; + case const_fpu_fxrstor32: return (uintptr_t)fpu_fxrstor32; + case const_fpu_fxrstor64: return (uintptr_t)fpu_fxrstor64; + case const_fpu_xsave: return (uintptr_t)fpu_xsave; + case const_fpu_xrstor: return (uintptr_t)fpu_xrstor; + case const_fpu_fbld: return (uintptr_t)fpu_fbld; + case const_fpu_fbst: return (uintptr_t)fpu_fbst; + case const_sse42_compare_string_explicit_len: return (uintptr_t)sse42_compare_string_explicit_len; + case const_sse42_compare_string_implicit_len: return (uintptr_t)sse42_compare_string_implicit_len; + case const_x64test_step: return (uintptr_t)x64test_step; + case const_printtrace: return (uintptr_t)PrintTrace; + case const_epilog: return (uintptr_t)native_epilog; + case const_jmptbl32: return getJumpTable32(); + case const_jmptbl48: return getJumpTable48(); + case const_jmptbl64: return getJumpTable64(); + case const_context: return (uintptr_t)my_context; + case const_8b_m7_m6_m5_m4_m3_m2_m1_0: return (uintptr_t)&mask_shift8; + case const_8b_7_6_5_4_3_2_1_0: return (uintptr_t)&mask_string8; + case const_8b_15_14_13_12_11_10_9_8: return (uintptr_t)&mask_string16; + case const_4f_m1_1_m1_1: return (uintptr_t)&addsubps; + case const_4f_1_m1_1_m1: return (uintptr_t)&subaddps; + case const_2d_m1_1: return (uintptr_t)&addsubpd; + case const_2d_1_m1: return (uintptr_t)&subaddpd; + + case const_last: dynarec_log(LOG_NONE, "Warning, const last used\n"); + return 0; + } + dynarec_log(LOG_NONE, "Warning, Unknown const %d used\n", which); + return 0; +} \ No newline at end of file diff --git a/src/dynarec/arm64/dynarec_arm64_consts.h b/src/dynarec/arm64/dynarec_arm64_consts.h new file mode 100644 index 0000000..bcc2c9f --- /dev/null +++ b/src/dynarec/arm64/dynarec_arm64_consts.h @@ -0,0 +1,110 @@ +#ifndef __DYNAREC_ARM64_CONSTS__ +#define __DYNAREC_ARM64_CONSTS__ +#include + +typedef enum arm64_consts_s { + const_none, + const_daa8, + const_das8, + const_aaa16, + const_aas16, + const_aam16, + const_aad16, + const_native_br, + const_native_ud, + const_native_priv, + const_native_gpf, + const_native_int3, + const_native_int, + const_native_div0, + const_native_frstor16, + const_native_fsave16, + const_native_fsave, + const_native_aesimc, + const_native_aesd, + const_native_aesd_y, + const_native_aesdlast, + const_native_aesdlast_y, + const_native_aese, + const_native_aese_y, + const_native_aeselast, + const_native_aeselast_y, + const_native_aeskeygenassist, + const_native_pclmul, + const_native_pclmul_x, + const_native_pclmul_y, + const_direct_f2xm1, + const_direct_fyl2x, + const_direct_fyl2xp1, + const_native_fxtract, + const_direct_ftan, + const_direct_fpatan, + const_direct_fcos, + const_direct_fsin, + const_native_fsincos, + const_direct_fscale, + const_native_fld, + const_native_fstp, + const_native_frstor, + const_native_next, + const_int3, + const_x86syscall, + const_x64syscall, + const_x64syscall_linux, + const_rcl16, + const_rcl32, + const_rcl64, + const_rcr16, + const_rcr32, + const_rcr64, + const_div64, + const_idiv64, + const_random32, + const_random64, + const_readtsc, + const_helper_getcpu, + const_cpuid, + const_getsegmentbase, + const_updateflags_arm64, + const_reset_fpu, + const_sha1msg2, + const_sha1rnds4, + const_sha256msg1, + const_sha256msg2, + const_sha256rnds2, + const_fpu_loadenv, + const_fpu_savenv, + const_fpu_fxsave32, + const_fpu_fxsave64, + const_fpu_fxrstor32, + const_fpu_fxrstor64, + const_fpu_xsave, + const_fpu_xrstor, + const_fpu_fbld, + const_fpu_fbst, + const_sse42_compare_string_explicit_len, + const_sse42_compare_string_implicit_len, + const_x64test_step, + const_printtrace, + const_epilog, + const_jmptbl32, + const_jmptbl48, + const_jmptbl64, + const_context, + const_8b_m7_m6_m5_m4_m3_m2_m1_0, + const_8b_7_6_5_4_3_2_1_0, + const_8b_15_14_13_12_11_10_9_8, + const_4f_m1_1_m1_1, + const_2d_m1_1, + const_4f_1_m1_1_m1, + const_2d_1_m1, + + const_last +} arm64_consts_t; + +uintptr_t getConst(arm64_consts_t which); + +// temporary define... +#define const_PrintTrace const_printtrace + +#endif //__DYNAREC_ARM64_CONSTS__ \ No newline at end of file diff --git a/src/dynarec/arm64/dynarec_arm64_d8.c b/src/dynarec/arm64/dynarec_arm64_d8.c index fc481ae..f4f57c6 100644 --- a/src/dynarec/arm64/dynarec_arm64_d8.c +++ b/src/dynarec/arm64/dynarec_arm64_d8.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,16 +17,17 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_arm64_functions.h" -uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; (void)need_epilog; uint8_t nextop = F8; uint8_t ed; + uint8_t u8; int64_t fixedaddress; int unscaled; int v1, v2; @@ -51,11 +50,16 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FADD ST0, STx"); v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FADDS(v1, v1, v2); } else { FADDD(v1, v1, v2); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xC8: case 0xC9: @@ -68,11 +72,16 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FMUL ST0, STx"); v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FMULS(v1, v1, v2); } else { FMULD(v1, v1, v2); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xD0: case 0xD1: @@ -122,11 +131,16 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FSUB ST0, STx"); v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FSUBS(v1, v1, v2); } else { FSUBD(v1, v1, v2); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xE8: case 0xE9: @@ -139,11 +153,16 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FSUBR ST0, STx"); v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FSUBS(v1, v2, v1); } else { FSUBD(v1, v2, v1); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xF0: case 0xF1: @@ -156,11 +175,16 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FDIV ST0, STx"); v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FDIVS(v1, v1, v2); } else { FDIVD(v1, v1, v2); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xF8: case 0xF9: @@ -173,11 +197,16 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FDIVR ST0, STx"); v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FDIVS(v1, v2, v1); } else { FDIVD(v1, v2, v1); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; default: DEFAULT; @@ -190,12 +219,17 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin s0 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); VLD32(s0, ed, fixedaddress); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); if(ST_IS_F(0)) { FADDS(v1, v1, s0); } else { FCVT_D_S(s0, s0); FADDD(v1, v1, s0); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 1: INST_NAME("FMUL ST0, float[ED]"); @@ -203,12 +237,17 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin s0 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); VLD32(s0, ed, fixedaddress); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); if(ST_IS_F(0)) { FMULS(v1, v1, s0); } else { FCVT_D_S(s0, s0); FMULD(v1, v1, s0); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 2: INST_NAME("FCOM ST0, float[ED]"); @@ -245,12 +284,17 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin s0 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); VLD32(s0, ed, fixedaddress); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); if(ST_IS_F(0)) { FSUBS(v1, v1, s0); } else { FCVT_D_S(s0, s0); FSUBD(v1, v1, s0); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 5: INST_NAME("FSUBR ST0, float[ED]"); @@ -258,12 +302,17 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin s0 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); VLD32(s0, ed, fixedaddress); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); if(ST_IS_F(0)) { FSUBS(v1, s0, v1); } else { FCVT_D_S(s0, s0); FSUBD(v1, s0, v1); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 6: INST_NAME("FDIV ST0, float[ED]"); @@ -271,12 +320,17 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin s0 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); VLD32(s0, ed, fixedaddress); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); if(ST_IS_F(0)) { FDIVS(v1, v1, s0); } else { FCVT_D_S(s0, s0); FDIVD(v1, v1, s0); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 7: INST_NAME("FDIVR ST0, float[ED]"); @@ -284,12 +338,17 @@ uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin s0 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); VLD32(s0, ed, fixedaddress); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); if(ST_IS_F(0)) { FDIVS(v1, s0, v1); } else { FCVT_D_S(s0, s0); FDIVD(v1, s0, v1); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; default: DEFAULT; diff --git a/src/dynarec/arm64/dynarec_arm64_d9.c b/src/dynarec/arm64/dynarec_arm64_d9.c index 53c3ad6..b5213f4 100644 --- a/src/dynarec/arm64/dynarec_arm64_d9.c +++ b/src/dynarec/arm64/dynarec_arm64_d9.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,13 +17,13 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_arm64_functions.h" -uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; (void)need_epilog; uint8_t nextop = F8; uint8_t ed; @@ -161,21 +159,21 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } else { ADDw_U12(x5, x5, i2); } - ANDw_mask(x5, x5, 0, 3); // (emu->top + i)&7 - } - // load tag - LDRH_U12(x3, xEmu, offsetof(x64emu_t, fpu_tags)); - if(i2<0) { - LSLw_IMM(x3, x3, -i2*2); - } else if(i2>0) { - ORRw_mask(x3, x3, 0b010000, 0b001111); // 0xffff0000 - LSRw_IMM(x3, x3, i2*2); + ANDw_mask(x5, x5, 0, 2); // (emu->top + i)&7 } - TSTw_mask(x3, 0, 1); // 0b11 - B_MARK3(cNE); // empty: C3,C2,C0 = 101 // load x2 with ST0 anyway, for sign extraction ADDx_REG_LSL(x1, xEmu, x5, 3); LDRx_U12(x2, x1, offsetof(x64emu_t, x87)); + // load tag + if(i2>=0) { + LDRH_U12(x3, xEmu, offsetof(x64emu_t, fpu_tags)); + if(i2>0) { + ORRw_mask(x3, x3, 0b010000, 0b001111); // 0xffff0000 + LSRw_IMM(x3, x3, i2*2); + } + TSTw_mask(x3, 0, 1); // 0b11 + B_MARK3(cNE); // empty: C3,C2,C0 = 101 + } } } else { // simply move from cache reg to x2 @@ -270,71 +268,68 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0xF0: INST_NAME("F2XM1"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - i1 = x87_stackcount(dyn, ninst, x1); - x87_forget(dyn, ninst, x1, x2, 0); - CALL(native_f2xm1, -1); - x87_unstackcount(dyn, ninst, x1, i1); + MESSAGE(LOG_DUMP, "Need Optimization (F2XM1)\n"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); + CALL_D(const_direct_f2xm1, v1, v1, -1, -1, -1); break; case 0xF1: INST_NAME("FYL2X"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - i1 = x87_stackcount(dyn, ninst, x1); - x87_forget(dyn, ninst, x1, x2, 0); - x87_forget(dyn, ninst, x1, x2, 1); - CALL(native_fyl2x, -1); - x87_unstackcount(dyn, ninst, x1, i1); + MESSAGE(LOG_DUMP, "Need Optimization (FYL2X)\n"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); + v2 = x87_get_st(dyn, ninst, x1, x2, 1, NEON_CACHE_ST_D); + CALL_D(const_direct_fyl2x, v2, v1, v2, -1, -1); X87_POP_OR_FAIL(dyn, ninst, x3); break; case 0xF2: INST_NAME("FPTAN"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - i1 = x87_stackcount(dyn, ninst, x1); - x87_forget(dyn, ninst, x1, x2, 0); - CALL(native_ftan, -1); - x87_unstackcount(dyn, ninst, x1, i1); + MESSAGE(LOG_DUMP, "Need Optimization (FPTAN)\n"); if(PK(0)==0xdd && PK(1)==0xd8) { - MESSAGE(LOG_DUMP, "Optimized next DD D8 fstp st0, st0, not emiting 1\n"); + MESSAGE(LOG_DUMP, "Optimized next DD D8 fstp st0, st0, not emitting 1\n"); u8 = F8; u8 = F8; + v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); } else { - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, NEON_CACHE_ST_F); + X87_PUSH_OR_FAIL(v2, dyn, ninst, x1, NEON_CACHE_ST_F); if(ST_IS_F(0)) { - FMOVS_8(v1, 0b01110000); + FMOVS_8(v2, 0b01110000); } else { - FMOVD_8(v1, 0b01110000); + FMOVD_8(v2, 0b01110000); } + v1 = x87_get_st(dyn, ninst, x1, x2, 1, NEON_CACHE_ST_D); } + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); + else + u8 = 0; + CALL_D(const_direct_ftan, v1, v1, -1, u8, -1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xF3: INST_NAME("FPATAN"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - i1 = x87_stackcount(dyn, ninst, x1); - x87_forget(dyn, ninst, x1, x2, 0); - x87_forget(dyn, ninst, x1, x2, 1); - CALL(native_fpatan, -1); - x87_unstackcount(dyn, ninst, x1, i1); + MESSAGE(LOG_DUMP, "Need Optimization (FPATAN)\n"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); + v2 = x87_get_st(dyn, ninst, x1, x2, 1, NEON_CACHE_ST_D); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); + else + u8 = 0; + CALL_D(const_direct_fpatan, v2, v1, v2, u8, -1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); X87_POP_OR_FAIL(dyn, ninst, x3); break; case 0xF4: INST_NAME("FXTRACT"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); + MESSAGE(LOG_DUMP, "Need Optimization (FXTRACT)\n"); X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, 0); i1 = x87_stackcount(dyn, ninst, x1); x87_forget(dyn, ninst, x1, x2, 1); - CALL(native_fxtract, -1); + CALL(const_native_fxtract, -1); x87_unstackcount(dyn, ninst, x1, i1); break; case 0xF5: INST_NAME("FPREM1"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - #if 0 - i1 = x87_stackcount(dyn, ninst, x1); - x87_forget(dyn, ninst, x1, x2, 0); - x87_forget(dyn, ninst, x1, x2, 1); - CALL(native_fprem1, -1); - x87_unstackcount(dyn, ninst, x1, i1); - #else v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); v2 = x87_get_st(dyn, ninst, x1, x2, 1, NEON_CACHE_ST_D); s0 = fpu_get_scratch(dyn, ninst); @@ -355,11 +350,10 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LSRx(x4, x4, 1); BFIw(x1, x4, 8, 1); STRw_U12(x1, xEmu, offsetof(x64emu_t, sw)); - #endif break; case 0xF6: INST_NAME("FDECSTP"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + BARRIER(BARRIER_FLOAT); LDRw_U12(x2, xEmu, offsetof(x64emu_t, top)); SUBw_U12(x2, x2, 1); ANDw_mask(x2, x2, 0, 2); //mask=7 @@ -367,7 +361,7 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0xF7: INST_NAME("FINCSTP"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + BARRIER(BARRIER_FLOAT); LDRw_U12(x2, xEmu, offsetof(x64emu_t, top)); ADDw_U12(x2, x2, 1); ANDw_mask(x2, x2, 0, 2); //mask=7 @@ -375,14 +369,6 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0xF8: INST_NAME("FPREM"); - #if 0 - MESSAGE(LOG_DUMP, "Need Optimization\n"); - i1 = x87_stackcount(dyn, ninst, x1); - x87_forget(dyn, ninst, x1, x2, 0); - x87_forget(dyn, ninst, x1, x2, 1); - CALL(native_fprem, -1); - x87_unstackcount(dyn, ninst, x1, i1); - #else v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); v2 = x87_get_st(dyn, ninst, x1, x2, 1, NEON_CACHE_ST_D); s0 = fpu_get_scratch(dyn, ninst); @@ -403,44 +389,44 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin LSRx(x4, x4, 1); BFIw(x1, x4, 8, 1); STRw_U12(x1, xEmu, offsetof(x64emu_t, sw)); - #endif break; case 0xF9: INST_NAME("FYL2XP1"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - i1 = x87_stackcount(dyn, ninst, x1); - x87_forget(dyn, ninst, x1, x2, 0); - x87_forget(dyn, ninst, x1, x2, 1); - CALL(native_fyl2xp1, -1); - x87_unstackcount(dyn, ninst, x1, i1); + MESSAGE(LOG_DUMP, "Need Optimization (FYL2XP1)\n"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); + v2 = x87_get_st(dyn, ninst, x1, x2, 1, NEON_CACHE_ST_D); + CALL_D(const_direct_fyl2xp1, v2, v1, v2, -1, -1); X87_POP_OR_FAIL(dyn, ninst, x3); break; case 0xFA: INST_NAME("FSQRT"); v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FSQRTS(v1, v1); } else { FSQRTD(v1, v1); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xFB: INST_NAME("FSINCOS"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); + MESSAGE(LOG_DUMP, "Need Optimization (FSINCOS)\n"); X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, 0); i1 = x87_stackcount(dyn, ninst, x1); x87_forget(dyn, ninst, x1, x2, 1); - CALL(native_fsincos, -1); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); + CALL_(const_native_fsincos, -1, BOX64ENV(dynarec_fastround) ? 0 : u8); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); x87_unstackcount(dyn, ninst, x1, i1); break; case 0xFC: INST_NAME("FRNDINT"); - #if 0 - MESSAGE(LOG_DUMP, "Need Optimization\n"); - // use C helper for now, nothing staightforward is available - x87_forget(dyn, ninst, x1, x2, 0); - CALL(native_frndint, -1); - #else v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); u8 = x87_setround(dyn, ninst, x1, x2, x3); if(ST_IS_F(0)) { @@ -449,32 +435,37 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin FRINTID(v1, v1); } x87_restoreround(dyn, ninst, u8); - #endif break; case 0xFD: INST_NAME("FSCALE"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - i1 = x87_stackcount(dyn, ninst, x1); - x87_forget(dyn, ninst, x1, x2, 0); - x87_forget(dyn, ninst, x1, x2, 1); - CALL(native_fscale, -1); - x87_unstackcount(dyn, ninst, x1, i1); + MESSAGE(LOG_DUMP, "Need Optimization (FSCALE)\n"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); + v2 = x87_get_st(dyn, ninst, x1, x2, 1, NEON_CACHE_ST_D); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); + CALL_D(const_direct_fscale, v1, v1, v2, -1, -1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xFE: INST_NAME("FSIN"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - i1 = x87_stackcount(dyn, ninst, x1); - x87_forget(dyn, ninst, x1, x2, 0); - CALL(native_fsin, -1); - x87_unstackcount(dyn, ninst, x1, i1); + MESSAGE(LOG_DUMP, "Need Optimization (FCOS)\n"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); + CALL_D(const_direct_fsin, v1, v1, -1, -1, -1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xFF: INST_NAME("FCOS"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - i1 = x87_stackcount(dyn, ninst, x1); - x87_forget(dyn, ninst, x1, x2, 0); - CALL(native_fcos, -1); - x87_unstackcount(dyn, ninst, x1, i1); + MESSAGE(LOG_DUMP, "Need Optimization (FCOS)\n"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); + CALL_D(const_direct_fcos, v1, v1, -1, -1, -1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; default: DEFAULT; @@ -483,7 +474,7 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: INST_NAME("FLD ST0, float[ED]"); - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, box64_dynarec_x87double?NEON_CACHE_ST_D:NEON_CACHE_ST_F); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, (BOX64ENV(dynarec_x87double)==1)?NEON_CACHE_ST_D:NEON_CACHE_ST_F); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); VLD32(v1, ed, fixedaddress); if(!ST_IS_F(0)) { @@ -497,7 +488,11 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin s0 = v1; else { s0 = fpu_get_scratch(dyn, ninst); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); FCVT_S_D(s0, v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); } addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); VST32(s0, ed, fixedaddress); @@ -507,37 +502,44 @@ uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_F); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); if(!ST_IS_F(0)) { + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); FCVT_S_D(v1, v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); } VST32(v1, ed, fixedaddress); X87_POP_OR_FAIL(dyn, ninst, x3); break; case 4: INST_NAME("FLDENV Ed"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); // maybe only x87, not SSE? + MESSAGE(LOG_DUMP, "Need Optimization (FLDENV)\n"); + BARRIER(BARRIER_FLOAT); // maybe only x87, not SSE? addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) { MOVx_REG(x1, ed); } MOV32w(x2, 0); - CALL(fpu_loadenv, -1); + CALL(const_fpu_loadenv, -1); + NATIVE_RESTORE_X87PC(); break; case 5: INST_NAME("FLDCW Ew"); GETEW(x1, 0); STRH_U12(x1, xEmu, offsetof(x64emu_t, cw)); // hopefully cw is not too far for an imm8 + if(dyn->need_x87check) + UBFXw(x87pc, x1, 8, 2); break; case 6: INST_NAME("FNSTENV Ed"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); // maybe only x87, not SSE? + MESSAGE(LOG_DUMP, "Need Optimization (FNSTENV)\n"); + BARRIER(BARRIER_FLOAT); // maybe only x87, not SSE? addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) { MOVx_REG(x1, ed); } MOV32w(x2, 0); - CALL(fpu_savenv, -1); + CALL(const_fpu_savenv, -1); break; case 7: INST_NAME("FNSTCW Ew"); diff --git a/src/dynarec/arm64/dynarec_arm64_da.c b/src/dynarec/arm64/dynarec_arm64_da.c index afb5130..26c3630 100644 --- a/src/dynarec/arm64/dynarec_arm64_da.c +++ b/src/dynarec/arm64/dynarec_arm64_da.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,16 +17,17 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_arm64_functions.h" -uintptr_t dynarec64_DA(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_DA(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { uint8_t nextop = F8; int64_t j64; uint8_t ed; uint8_t wback; + uint8_t u8; int v1, v2; int d0; int s0; @@ -148,7 +147,12 @@ uintptr_t dynarec64_DA(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VLD32(v2, ed, fixedaddress); SXTL_32(v2, v2); // i32 -> i64 SCVTFDD(v2, v2); // i64 -> double + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); FADDD(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 1: INST_NAME("FIMUL ST0, Ed"); @@ -158,7 +162,12 @@ uintptr_t dynarec64_DA(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VLD32(v2, ed, fixedaddress); SXTL_32(v2, v2); // i32 -> i64 SCVTFDD(v2, v2); // i64 -> double + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); FMULD(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 2: INST_NAME("FICOM ST0, Ed"); @@ -191,7 +200,12 @@ uintptr_t dynarec64_DA(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VLD32(v2, ed, fixedaddress); SXTL_32(v2, v2); // i32 -> i64 SCVTFDD(v2, v2); // i64 -> double + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); FSUBD(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 5: INST_NAME("FISUBR ST0, Ed"); @@ -201,7 +215,12 @@ uintptr_t dynarec64_DA(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VLD32(v2, ed, fixedaddress); SXTL_32(v2, v2); // i32 -> i64 SCVTFDD(v2, v2); // i64 -> double + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); FSUBD(v1, v2, v1); + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 6: INST_NAME("FIDIV ST0, Ed"); @@ -211,7 +230,12 @@ uintptr_t dynarec64_DA(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VLD32(v2, ed, fixedaddress); SXTL_32(v2, v2); // i32 -> i64 SCVTFDD(v2, v2); // i64 -> double + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); FDIVD(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 7: INST_NAME("FIDIVR ST0, Ed"); @@ -221,7 +245,12 @@ uintptr_t dynarec64_DA(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VLD32(v2, ed, fixedaddress); SXTL_32(v2, v2); // i32 -> i64 SCVTFDD(v2, v2); // i64 -> double + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x5, x4); FDIVD(v1, v2, v1); + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; } return addr; diff --git a/src/dynarec/arm64/dynarec_arm64_db.c b/src/dynarec/arm64/dynarec_arm64_db.c index 9dc1d67..696799a 100644 --- a/src/dynarec/arm64/dynarec_arm64_db.c +++ b/src/dynarec/arm64/dynarec_arm64_db.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,13 +17,13 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_arm64_functions.h" -uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; (void)need_epilog; uint8_t nextop = F8; uint8_t ed; @@ -127,16 +125,16 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0xE2: INST_NAME("FNCLEX"); LDRH_U12(x2, xEmu, offsetof(x64emu_t, sw)); - MOV32w(x1, 0); - BFIw(x2, x1, 0, 8); // IE .. PE, SF, ES - BFIw(x2, x1, 15, 1); // B + BFCw(x2, 0, 8); // IE .. PE, SF, ES + BFCw(x2, 15, 1); // B STRH_U12(x2, xEmu, offsetof(x64emu_t, sw)); break; case 0xE3: INST_NAME("FNINIT"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); + MESSAGE(LOG_DUMP, "Need Optimization (FNINIT)\n"); x87_purgecache(dyn, ninst, 0, x1, x2, x3); - CALL(reset_fpu, -1); + CALL(const_reset_fpu, -1); + NATIVE_RESTORE_X87PC(); break; case 0xE8: case 0xE9: @@ -150,10 +148,12 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SETFLAGS(X_ALL, SF_SET); v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - if(ST_IS_F(0)) { - FCMPS(v1, v2); - } else { - FCMPD(v1, v2); + IFX(X_CF|X_PF|X_ZF) { + if(ST_IS_F(0)) { + FCMPS(v1, v2); + } else { + FCMPD(v1, v2); + } } FCOMI(x1, x2); break; @@ -169,10 +169,12 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SETFLAGS(X_ALL, SF_SET); v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - if(ST_IS_F(0)) { - FCMPS(v1, v2); - } else { - FCMPD(v1, v2); + IFX(X_CF|X_PF|X_ZF) { + if(ST_IS_F(0)) { + FCMPS(v1, v2); + } else { + FCMPD(v1, v2); + } } FCOMI(x1, x2); break; @@ -195,20 +197,24 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); s0 = fpu_get_scratch(dyn, ninst); - if(arm64_frintts) { + if(cpuext.frintts) { FRINT32ZD(s0, v1); FCVTZSwD(x5, s0); STW(x5, wback, fixedaddress); } else { MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit + BFCw(x5, FPSR_QC, 1); // reset QC bit MSR_fpsr(x5); FRINTZD(s0, v1); VFCVTZSd(s0, s0); SQXTN_S_D(s0, s0); VST32(s0, wback, fixedaddress); MRS_fpsr(x5); // get back FPSR to check the IOC bit - TBZ_MARK3(x5, FPSR_IOC); + TBNZ_MARK2(x5, FPSR_IOC); + TBNZ_MARK2(x5, FPSR_QC); + B_MARK3_nocond; + MARK2; MOV32w(x5, 0x80000000); STW(x5, wback, fixedaddress); MARK3; @@ -221,20 +227,24 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin u8 = x87_setround(dyn, ninst, x1, x2, x4); // x1 have the modified RPSCR reg addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); s0 = fpu_get_scratch(dyn, ninst); - if(arm64_frintts) { + if(cpuext.frintts) { FRINT32XD(s0, v1); FCVTZSwD(x5, s0); STW(x5, wback, fixedaddress); } else { MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit + BFCw(x5, FPSR_QC, 1); // reset QC bit MSR_fpsr(x5); FRINTXD(s0, v1); VFCVTZSd(s0, s0); SQXTN_S_D(s0, s0); VST32(s0, wback, fixedaddress); MRS_fpsr(x5); // get back FPSR to check the IOC bit - TBZ_MARK3(x5, FPSR_IOC); + TBNZ_MARK2(x5, FPSR_IOC); + TBNZ_MARK2(x5, FPSR_QC); + B_MARK3_nocond; + MARK2; MOV32w(x5, 0x80000000); STW(x5, wback, fixedaddress); MARK3; @@ -247,20 +257,24 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin u8 = x87_setround(dyn, ninst, x1, x2, x4); // x1 have the modified RPSCR reg addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0); s0 = fpu_get_scratch(dyn, ninst); - if(arm64_frintts) { + if(cpuext.frintts) { FRINT32XD(s0, v1); FCVTZSwD(x5, s0); STW(x5, wback, fixedaddress); } else { MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit + BFCw(x5, FPSR_QC, 1); // reset QC bit MSR_fpsr(x5); FRINTXD(s0, v1); VFCVTZSd(s0, s0); SQXTN_S_D(s0, s0); VST32(s0, wback, fixedaddress); MRS_fpsr(x5); // get back FPSR to check the IOC bit - TBZ_MARK3(x5, FPSR_IOC); + TBNZ_MARK2(x5, FPSR_IOC); + TBNZ_MARK2(x5, FPSR_QC); + B_MARK3_nocond; + MARK2; MOV32w(x5, 0x80000000); STW(x5, wback, fixedaddress); MARK3; @@ -289,7 +303,7 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STRx_U12(x5, ed, 0); STRH_U12(x6, ed, 8); } else { - if(box64_x87_no80bits) { + if(BOX64ENV(x87_no80bits)) { X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, NEON_CACHE_ST_D); VLDR64_U12(v1, ed, fixedaddress); } else { @@ -298,77 +312,73 @@ uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, 0); // sync top - s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_fld, -1); + x87_reflectcount(dyn, ninst, x3, x4); + CALL(const_native_fld, -1); // go back with the top & stack counter - x87_unstackcount(dyn, ninst, x3, s0); + x87_unreflectcount(dyn, ninst, x3, x4); } } break; case 7: INST_NAME("FSTP tbyte"); - if(box64_x87_no80bits) { + if(BOX64ENV(x87_no80bits)) { v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); VST64(v1, wback, fixedaddress); } else { - #if 0 - x87_forget(dyn, ninst, x1, x3, 0); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - if(ed!=x1) { - MOVx_REG(x1, ed); + if(!BOX64ENV(dynarec_fastround)) { + x87_forget(dyn, ninst, x1, x3, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + if(ed!=x1) {MOVx_REG(x1, ed);} + x87_reflectcount(dyn, ninst, x3, x4); + CALL(const_native_fstp, -1); + x87_unreflectcount(dyn, ninst, x3, x4); + } else { + // Painfully long, straight conversion from the C code, shoud be optimized + v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + FMOVxD(x1, v1); + // do special value first + TSTx_mask(x1, 1, 0b00000, 0b111110); //0x7fffffffffffffffL + B_MARK(cNE); + // Zero + LSRx(x3, x1, 63-15); //x3 = sign+exp + MOVZw(x5, 0); // x5 = mantisse + B_MARK3_nocond; + MARK; + // get sign, in main ouput x5 for sign+exp + ANDx_mask(x5, x1, 1, 1, 0); //0x8000000000000000 + LSRx(x5, x5, 63-15); // x5 = sign + // get exp + LSRx(x3, x1, 52); // x3 = exp11 + ANDw_mask(x3, x3, 0, 0b1010); //0x7ff + ANDSx_mask(x1, x1, 1, 0, 0b110011); //0x000fffffffffffffL + LSLx_IMM(x1, x1, 11); // mantice + CMPSw_U12(x3, 0x7ff); + B_MARK2(cNE); + // NaN and Infinite + ORRw_mask(x3, x5, 0, 0b1110); //x3 = sign | 0x7fff + ORRx_mask(x5, x1, 1, 1, 0); //0x8000000000000000 + B_MARK3_nocond; + MARK2; + // regular / denormals + MOVZw(x4, 16383-1023); //BIAS80 - BIAS64 + CBZw(x3, 4+4*4); // exp11 == 0? + // normals + ADDw_REG(x3, x3, x4); // x3 = exp16 + ORRw_REG(x3, x3, x5); // x3 = sign | exp + ORRx_mask(x5, x1, 1, 1, 0); //0x8000000000000000 x5 = mantisse + B_MARK3_nocond; + // denormals + CLZx(x6, x1); + ADDw_U12(x6, x6, 1); // "one" + SUBw_REG(x3, x4, x6); // x3 = exp16 + ORRw_REG(x3, x3, x5); // x3 = sign | exp16 + LSLx_REG(x5, x1, x6); // x5 = mantisse + MARK3; + STRx_U12(x5, wback, 0); + STRH_U12(x3, wback, 8); } - CALL(native_fstp, -1); - #else - // Painfully long, straight conversion from the C code, shoud be optimized - v1 = x87_get_st(dyn, ninst, x1, x2, 0, NEON_CACHE_ST_D); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); - FMOVxD(x1, v1); - // do special value first - TSTx_mask(x1, 1, 0b00000, 0b111110); //0x7fffffffffffffffL - B_MARK(cNE); - // Zero - LSRx(x3, x1, 63-15); //x3 = sign+exp - MOVZw(x5, 0); // x5 = mantisse - B_MARK3_nocond; - MARK; - // get sign, in main ouput x5 for sign+exp - ANDx_mask(x5, x1, 1, 1, 0); //0x8000000000000000 - LSRx(x5, x5, 63-15); // x5 = sign - // get exp - LSRx(x3, x1, 52); // x3 = exp11 - ANDw_mask(x3, x3, 0, 0b1010); //0x7ff - MOV32w(x4, 0x7ff); - CMPSw_REG(x3, x4); - B_MARK2(cNE); - // NaN and Infinite - ORRw_mask(x3, x5, 0, 0b1110); //x3 = sign | 0x7fff - TSTx_mask(x1, 1, 0, 0b110011); //0x000fffffffffffffL - ORRx_mask(x5, xZR, 1, 1, 0); //0x8000000000000000 - ORRx_mask(x4, xZR, 1, 0b10, 0b01); //0xc000000000000000 - CSELx(x5, x5, x4, cEQ); // x5 = mantisse - B_MARK3_nocond; - MARK2; - // regular / denormals - ANDx_mask(x1, x1, 1, 0, 0b110011); //0x000fffffffffffffL - LSLx_IMM(x1, x1, 11); //x1 = mantisse missing "1" - MOVZw(x4, 16383-1023); //BIAS80 - BIAS64 - CBZw(x3, 4+3*4); // exp11 == 0? - // normals - ADDw_REG(x3, x3, x4); // x3 = exp16 - ORRw_REG(x3, x3, x5); // x3 = sign | exp - ORRx_mask(x5, x1, 1, 1, 0); //0x8000000000000000 x5 = mantisse - B_MARK3_nocond; - // denormals - CLZx(x6, x1); - ADDw_U12(x6, x6, 1); // "one" - SUBw_REG(x3, x4, x6); // x3 = exp16 - ORRw_REG(x3, x3, x5); // x3 = sign | exp16 - LSLx_REG(x5, x1, x6); // x5 = mantisse - MARK3; - STRx_U12(x5, wback, 0); - STRH_U12(x3, wback, 8); - #endif } X87_POP_OR_FAIL(dyn, ninst, x3); break; diff --git a/src/dynarec/arm64/dynarec_arm64_dc.c b/src/dynarec/arm64/dynarec_arm64_dc.c index 76f43bc..debc600 100644 --- a/src/dynarec/arm64/dynarec_arm64_dc.c +++ b/src/dynarec/arm64/dynarec_arm64_dc.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,16 +17,17 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_arm64_functions.h" -uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; (void)need_epilog; uint8_t nextop = F8; uint8_t wback; + uint8_t u8; int64_t fixedaddress; int unscaled; int v1, v2; @@ -49,11 +48,16 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FADD STx, ST0"); v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FADDS(v1, v1, v2); } else { FADDD(v1, v1, v2); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xC8: case 0xC9: @@ -66,11 +70,16 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FMUL STx, ST0"); v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FMULS(v1, v1, v2); } else { FMULD(v1, v1, v2); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xD0: case 0xD1: @@ -120,11 +129,16 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FSUBR STx, ST0"); v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FSUBS(v1, v2, v1); } else { FSUBD(v1, v2, v1); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xE8: case 0xE9: @@ -137,11 +151,16 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FSUB STx, ST0"); v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FSUBS(v1, v1, v2); } else { FSUBD(v1, v1, v2); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xF0: case 0xF1: @@ -154,11 +173,16 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FDIVR STx, ST0"); v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FDIVS(v1, v2, v1); } else { FDIVD(v1, v2, v1); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 0xF8: case 0xF9: @@ -171,11 +195,16 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FDIV STx, ST0"); v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FDIVS(v1, v1, v2); } else { FDIVD(v1, v1, v2); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; default: DEFAULT; @@ -188,7 +217,12 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin v2 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); VLD64(v2, wback, fixedaddress); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); FADDD(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 1: INST_NAME("FMUL ST0, double[ED]"); @@ -196,7 +230,12 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin v2 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); VLD64(v2, wback, fixedaddress); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); FMULD(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 2: INST_NAME("FCOM ST0, double[ED]"); @@ -223,7 +262,12 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin v2 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); VLD64(v2, wback, fixedaddress); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); FSUBD(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 5: INST_NAME("FSUBR ST0, double[ED]"); @@ -231,7 +275,12 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin v2 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); VLD64(v2, wback, fixedaddress); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); FSUBD(v1, v2, v1); + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 6: INST_NAME("FDIV ST0, double[ED]"); @@ -239,7 +288,12 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin v2 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); VLD64(v2, wback, fixedaddress); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); FDIVD(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; case 7: INST_NAME("FDIVR ST0, double[ED]"); @@ -247,7 +301,12 @@ uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin v2 = fpu_get_scratch(dyn, ninst); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); VLD64(v2, wback, fixedaddress); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); FDIVD(v1, v2, v1); + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); break; } return addr; diff --git a/src/dynarec/arm64/dynarec_arm64_dd.c b/src/dynarec/arm64/dynarec_arm64_dd.c index afef335..1508446 100644 --- a/src/dynarec/arm64/dynarec_arm64_dd.c +++ b/src/dynarec/arm64/dynarec_arm64_dd.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,13 +17,13 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_arm64_functions.h" -uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; (void)need_epilog; uint8_t nextop = F8; uint8_t ed; @@ -51,7 +49,6 @@ uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin case 0xC6: case 0xC7: INST_NAME("FFREE STx"); - #if 1 if((nextop&7)==0 && PK(0)==0xD9 && PK(1)==0xF7) { MESSAGE(LOG_DUMP, "Hack for FFREE ST0 / FINCSTP\n"); x87_do_pop(dyn, ninst, x1); @@ -59,12 +56,6 @@ uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SKIPTEST(x1); } else x87_free(dyn, ninst, x1, x2, x3, nextop&7); - #else - MESSAGE(LOG_DUMP, "Need Optimization\n"); - x87_purgecache(dyn, ninst, 0, x1, x2, x3); - MOV32w(x1, nextop&7); - CALL(fpu_do_free, -1); - #endif break; case 0xD0: case 0xD1: @@ -159,21 +150,22 @@ uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VST64(v1, ed, fixedaddress); } else { s0 = fpu_get_scratch(dyn, ninst); - if(arm64_frintts) { + if(cpuext.frintts) { FRINT64ZD(s0, v1); - FCVTZSxD(x2, s0); - STx(x2, ed, fixedaddress); + VFCVTZSd(s0, s0); + VST64(s0, ed, fixedaddress); } else { MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit MSR_fpsr(x5); FRINTRRD(s0, v1, 3); - FCVTZSxD(x2, s0); + VFCVTZSd(s0, s0); + VST64(s0, ed, fixedaddress); MRS_fpsr(x5); // get back FPSR to check the IOC bit TBZ_MARK3(x5, FPSR_IOC); ORRx_mask(x2, xZR, 1, 1, 0); //0x8000000000000000 - MARK3; STx(x2, ed, fixedaddress); + MARK3; } } X87_POP_OR_FAIL(dyn, ninst, x3); @@ -193,24 +185,23 @@ uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 4: INST_NAME("FRSTOR m108byte"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + MESSAGE(LOG_DUMP, "Need Optimization (FRSTOR)\n"); + BARRIER(BARRIER_FLOAT); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) {MOVx_REG(x1, ed);} - CALL(native_frstor, -1); + CALL(const_native_frstor, -1); break; case 6: INST_NAME("FNSAVE m108byte"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + MESSAGE(LOG_DUMP, "Need Optimization (FNSAVE)\n"); + BARRIER(BARRIER_FLOAT); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) {MOVx_REG(x1, ed);} - CALL(native_fsave, -1); - CALL(reset_fpu, -1); + CALL(const_native_fsave, -1); + NATIVE_RESTORE_X87PC(); break; case 7: INST_NAME("FNSTSW m2byte"); - //fpu_purgecache(dyn, ninst, 0, x1, x2, x3); addr = geted(dyn, addr, ninst, nextop, &ed, x4, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0); LDRw_U12(x2, xEmu, offsetof(x64emu_t, top)); LDRH_U12(x3, xEmu, offsetof(x64emu_t, sw)); diff --git a/src/dynarec/arm64/dynarec_arm64_de.c b/src/dynarec/arm64/dynarec_arm64_de.c index 7ea3b35..4b225c7 100644 --- a/src/dynarec/arm64/dynarec_arm64_de.c +++ b/src/dynarec/arm64/dynarec_arm64_de.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,16 +17,17 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_arm64_functions.h" -uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; (void)need_epilog; uint8_t nextop = F8; uint8_t wback; + uint8_t u8; int64_t fixedaddress; int unscaled; int v1, v2; @@ -49,11 +48,16 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FADDP STx, ST0"); v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FADDS(v1, v1, v2); } else { FADDD(v1, v1, v2); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); X87_POP_OR_FAIL(dyn, ninst, x3); break; case 0xC8: @@ -67,11 +71,16 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FMULP STx, ST0"); v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FMULS(v1, v1, v2); } else { FMULD(v1, v1, v2); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); X87_POP_OR_FAIL(dyn, ninst, x3); break; case 0xD0: @@ -117,11 +126,16 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FSUBRP STx, ST0"); v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FSUBS(v1, v2, v1); } else { FSUBD(v1, v2, v1); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); X87_POP_OR_FAIL(dyn, ninst, x3); break; case 0xE8: @@ -135,11 +149,16 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FSUBP STx, ST0"); v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FSUBS(v1, v1, v2); } else { FSUBD(v1, v1, v2); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); X87_POP_OR_FAIL(dyn, ninst, x3); break; case 0xF0: @@ -153,11 +172,16 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FDIVRP STx, ST0"); v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FDIVS(v1, v2, v1); } else { FDIVD(v1, v2, v1); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); X87_POP_OR_FAIL(dyn, ninst, x3); break; case 0xF8: @@ -171,11 +195,16 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin INST_NAME("FDIVP STx, ST0"); v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); + if(!BOX64ENV(dynarec_fastround)) + u8 = x87_setround(dyn, ninst, x1, x2, x4); if(ST_IS_F(0)) { FDIVS(v1, v1, v2); } else { FDIVD(v1, v1, v2); } + X87_CHECK_PRECISION(v1); + if(!BOX64ENV(dynarec_fastround)) + x87_restoreround(dyn, ninst, u8); X87_POP_OR_FAIL(dyn, ninst, x3); break; default: @@ -193,6 +222,7 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SXTL_32(v2, v2); SCVTFDD(v2, v2); FADDD(v1, v1, v2); + X87_CHECK_PRECISION(v1); break; case 1: INST_NAME("FIMUL ST0, word[ED]"); @@ -204,6 +234,7 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SXTL_32(v2, v2); SCVTFDD(v2, v2); FMULD(v1, v1, v2); + X87_CHECK_PRECISION(v1); break; case 2: INST_NAME("FICOM ST0, word[ED]"); @@ -240,6 +271,7 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SXTL_32(v2, v2); SCVTFDD(v2, v2); FSUBD(v1, v1, v2); + X87_CHECK_PRECISION(v1); break; case 5: INST_NAME("FISUBR ST0, word[ED]"); @@ -251,6 +283,7 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SXTL_32(v2, v2); SCVTFDD(v2, v2); FSUBD(v1, v2, v1); + X87_CHECK_PRECISION(v1); break; case 6: INST_NAME("FIDIV ST0, word[ED]"); @@ -262,6 +295,7 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SXTL_32(v2, v2); SCVTFDD(v2, v2); FDIVD(v1, v1, v2); + X87_CHECK_PRECISION(v1); break; case 7: INST_NAME("FIDIVR ST0, word[ED]"); @@ -273,6 +307,7 @@ uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SXTL_32(v2, v2); SCVTFDD(v2, v2); FDIVD(v1, v2, v1); + X87_CHECK_PRECISION(v1); break; } return addr; diff --git a/src/dynarec/arm64/dynarec_arm64_df.c b/src/dynarec/arm64/dynarec_arm64_df.c index 79c59bf..a186f9b 100644 --- a/src/dynarec/arm64/dynarec_arm64_df.c +++ b/src/dynarec/arm64/dynarec_arm64_df.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,13 +17,13 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_arm64_functions.h" -uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; (void)need_epilog; uint8_t nextop = F8; uint8_t ed, wback, u8; @@ -103,11 +101,13 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SETFLAGS(X_ALL, SF_SET); v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - if(ST_IS_F(0)) - { - FCMPS(v1, v2); - } else { - FCMPD(v1, v2); + IFX(X_CF|X_PF|X_ZF) { + if(ST_IS_F(0)) + { + FCMPS(v1, v2); + } else { + FCMPD(v1, v2); + } } FCOMI(x1, x2); X87_POP_OR_FAIL(dyn, ninst, x3); @@ -124,11 +124,13 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin SETFLAGS(X_ALL, SF_SET); v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - if(ST_IS_F(0)) - { - FCMPS(v1, v2); - } else { - FCMPD(v1, v2); + IFX(X_CF|X_PF|X_ZF) { + if(ST_IS_F(0)) + { + FCMPS(v1, v2); + } else { + FCMPD(v1, v2); + } } FCOMI(x1, x2); X87_POP_OR_FAIL(dyn, ninst, x3); @@ -175,12 +177,12 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VFCVTZSd(s0, v1); SQXTN_S_D(s0, s0); } - VMOVSto(x3, s0, 0); + SQXTN_H_S(s0, s0); + VMOVHto(x3, s0, 0); MRS_fpsr(x5); // get back FPSR to check the IOC bit TBNZ_MARK2(x5, FPSR_IOC); - SXTHw(x5, x3); // check if 16bits value is fine - SUBw_REG(x5, x5, x3); - CBZw_MARK3(x5); + TBNZ_MARK2(x5, FPSR_QC); + B_MARK3_nocond; MARK2; MOV32w(x3, 0x8000); MARK3; @@ -215,12 +217,12 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VFCVTZSd(s0, s0); SQXTN_S_D(s0, s0); } - VMOVSto(x3, s0, 0); + SQXTN_H_S(s0, s0); + VMOVHto(x3, s0, 0); MRS_fpsr(x5); // get back FPSR to check the IOC bit TBNZ_MARK2(x5, FPSR_IOC); - SXTHw(x5, x3); // check if 16bits value is fine - SUBw_REG(x5, x5, x3); - CBZw_MARK3(x5); + TBNZ_MARK2(x5, FPSR_QC); + B_MARK3_nocond; MARK2; MOV32w(x3, 0x8000); MARK3; @@ -245,6 +247,7 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin #else MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit + BFCw(x5, FPSR_QC, 1); // reset QC bit MSR_fpsr(x5); if(ST_IS_F(0)) { FRINTXS(s0, v1); @@ -254,12 +257,12 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin VFCVTZSd(s0, s0); SQXTN_S_D(s0, s0); } - VMOVSto(x3, s0, 0); + SQXTN_H_S(s0, s0); + VMOVHto(x3, s0, 0); MRS_fpsr(x5); // get back FPSR to check the IOC bit TBNZ_MARK2(x5, FPSR_IOC); - SXTHw(x5, x3); // check if 16bits value is fine - SUBw_REG(x5, x5, x3); - CBZw_MARK3(x5); + TBNZ_MARK2(x5, FPSR_QC); + B_MARK3_nocond; MARK2; MOV32w(x3, 0x8000); MARK3; @@ -274,7 +277,7 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) {MOVx_REG(x1, ed);} s0 = x87_stackcount(dyn, ninst, x3); - CALL(fpu_fbld, -1); + CALL(const_fpu_fbld, -1); x87_unstackcount(dyn, ninst, x3, s0); break; case 5: @@ -311,7 +314,7 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin x87_forget(dyn, ninst, x1, x2, 0); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); if(ed!=x1) {MOVx_REG(x1, ed);} - CALL(fpu_fbst, -1); + CALL(const_fpu_fbst, -1); x87_unstackcount(dyn, ninst, x1, i1); X87_POP_OR_FAIL(dyn, ninst, x3); break; @@ -355,16 +358,22 @@ uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin B_MARK3(c__); MARK2; } - MRS_fpsr(x5); - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - FRINTXD(s0, v1); - VFCVTZSd(s0, s0); - VST64(s0, wback, fixedaddress); - MRS_fpsr(x5); // get back FPSR to check the IOC bit - TBZ_MARK3(x5, FPSR_IOC); - ORRx_mask(x5, xZR, 1, 1, 0); //0x8000000000000000 - STx(x5, wback, fixedaddress); + if(cpuext.frintts) { + FRINT64XD(s0, v1); + VFCVTZSd(s0, s0); + VST64(s0, wback, fixedaddress); + } else { + MRS_fpsr(x5); + BFCw(x5, FPSR_IOC, 1); // reset IOC bit + MSR_fpsr(x5); + FRINTXD(s0, v1); + VFCVTZSd(s0, s0); + VST64(s0, wback, fixedaddress); + MRS_fpsr(x5); // get back FPSR to check the IOC bit + TBZ_MARK3(x5, FPSR_IOC); + ORRx_mask(x5, xZR, 1, 1, 0); //0x8000000000000000 + STx(x5, wback, fixedaddress); + } MARK3; #endif x87_restoreround(dyn, ninst, u8); diff --git a/src/dynarec/arm64/dynarec_arm64_emit_logic.c b/src/dynarec/arm64/dynarec_arm64_emit_logic.c index dcdffda..404f7d6 100644 --- a/src/dynarec/arm64/dynarec_arm64_emit_logic.c +++ b/src/dynarec/arm64/dynarec_arm64_emit_logic.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,7 +17,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" // emit OR32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_or32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) @@ -27,25 +25,43 @@ void emit_or32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, MAYUSE(s2); IFX(X_PEND) { SET_DF(s4, rex.w?d_or64:d_or32); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } ORRxw_REG(s1, s1, s2); IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_CF | X_AF | X_OF) { - MOV32w(s3, (1<>12)&1, mask&0x3F, (mask>>6)&0x3F); } else { - MOV64xw(s3, c); - ORRxw_REG(s1, s1, s3); + SET_DFNONE(); } + ORRxw_mask(s1, s1, (mask>>12)&1, mask&0x3F, (mask>>6)&0x3F); IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_CF | X_AF | X_OF) { - MOV32w(s3, (1<>12)&1, mask&0x3F, (mask>>6)&0x3F); + if(!mask) { + MVNxw_REG(s1, s1); } else { - MOV64xw(s3, c); - EORxw_REG(s1, s1, s3); + EORxw_mask(s1, s1, (mask>>12)&1, mask&0x3F, (mask>>6)&0x3F); } IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_CF | X_AF | X_OF) { - MOV32w(s3, (1<>12)&1, mask&0x3F, (mask>>6)&0x3F); - } else { - ANDxw_mask(s1, s1, (mask>>12)&1, mask&0x3F, (mask>>6)&0x3F); - } + IFX(X_ZF|X_SF|X_CF|X_OF) { + ANDSxw_mask(s1, s1, (mask>>12)&1, mask&0x3F, (mask>>6)&0x3F); } else { - MOV64xw(s3, c); - IFX(X_ALL) { - ANDSxw_REG(s1, s1, s3); - } else { - ANDxw_REG(s1, s1, s3); - } + ANDxw_mask(s1, s1, (mask>>12)&1, mask&0x3F, (mask>>6)&0x3F); } IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_CF | X_AF | X_OF) { - MOV32w(s3, (1<>6)&0x3F); } else { - MOV32w(s3, c&0xff); - ORRw_REG(s1, s1, s3); + SET_DFNONE(); } + ORRw_mask(s1, s1, mask&0x3F, (mask>>6)&0x3F); IFX(X_PEND) { STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); } @@ -288,9 +384,9 @@ void emit_xor8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) { MAYUSE(s2); IFX(X_PEND) { - SET_DF(s3, d_xor8); - } else IFX(X_ALL) { - SET_DFNONE(s3); + SET_DF(s4, d_xor8); + } else { + SET_DFNONE(); } EORx_REG(s1, s1, s2); IFX(X_PEND) { @@ -307,20 +403,20 @@ void emit_xor8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) } // emit XOR8 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch -void emit_xor8c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4) +void emit_xor8c(dynarec_arm_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4) { + int mask = convert_bitmask_w(c); + if(!mask) { + MOV32w(s3, c&0xff); + emit_xor8(dyn, ninst, s1, s3, s3, s4); + return; + } IFX(X_PEND) { SET_DF(s4, d_xor8); - } else IFX(X_ALL) { - SET_DFNONE(s4); - } - int mask = convert_bitmask_w(c); - if(mask) { - EORw_mask(s1, s1, mask&0x3F, (mask>>6)&0x3F); } else { - MOV32w(s3, c&0xff); - EORw_REG(s1, s1, s3); + SET_DFNONE(); } + EORw_mask(s1, s1, mask&0x3F, (mask>>6)&0x3F); IFX(X_PEND) { STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); } @@ -339,9 +435,9 @@ void emit_and8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) { MAYUSE(s2); IFX(X_PEND) { - SET_DF(s3, d_and8); - } else IFX(X_ALL) { - SET_DFNONE(s3); + SET_DF(s4, d_and8); + } else { + SET_DFNONE(); } IFX(X_ZF) { ANDSw_REG(s1, s1, s2); @@ -355,13 +451,19 @@ void emit_and8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) MOV32w(s3, (1<>6)&0x3F); - } else { - ANDw_mask(s1, s1, mask&0x3F, (mask>>6)&0x3F); - } + IFX(X_ZF) { + ANDSw_mask(s1, s1, mask&0x3F, (mask>>6)&0x3F); } else { - MOV32w(s3, c&0xff); - IFX(X_ZF) { - ANDSw_REG(s1, s1, s3); - } else { - ANDw_REG(s1, s1, s3); - } + ANDw_mask(s1, s1, mask&0x3F, (mask>>6)&0x3F); } IFX(X_PEND) { STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); @@ -398,28 +496,33 @@ void emit_and8c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4 MOV32w(s3, (1<=0 && c<256) { -// IFX(X_ALL) { -// ORRS_IMM8(s1, s1, c, 0); -// } else { -// ORR_IMM8(s1, s1, c, 0); -// } -// } else { -// IFX(X_PEND) {} else {MOVW(s3, c);} -// IFX(X_ALL) { -// ORRS_REG_LSL_IMM5(s1, s1, s3, 0); -// } else { -// ORR_REG_LSL_IMM5(s1, s1, s3, 0); -// } -// } -// IFX(X_PEND) { -// STR_IMM9(s1, xEmu, offsetof(x64emu_t, res)); -// } -// IFX(X_CF | X_AF | X_ZF) { -// BIC_IMM8(xFlags, xFlags, (1<>6)&0x3F); + IFX(X_PEND) { + STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX(X_CF | X_AF | X_OF) { + MOV32w(s3, (1<=0 && c<256) { -// IFX(X_ALL) { -// XORS_IMM8(s1, s1, c); -// } else { -// XOR_IMM8(s1, s1, c); -// } -// } else { -// IFX(X_PEND) {} else {MOVW(s3, c);} -// IFX(X_ALL) { -// XORS_REG_LSL_IMM5(s1, s1, s3, 0); -// } else { -// XOR_REG_LSL_IMM5(s1, s1, s3, 0); -// } -// } -// IFX(X_PEND) { -// STR_IMM9(s1, xEmu, offsetof(x64emu_t, res)); -// } -// IFX(X_CF | X_AF | X_ZF) { -// BIC_IMM8(xFlags, xFlags, (1<>6)&0x3F); + IFX(X_PEND) { + STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX(X_CF | X_AF | X_OF) { + MOV32w(s3, (1<=0 && c<256) { -// IFX(X_ALL) { -// ANDS_IMM8(s1, s1, c); -// } else { -// AND_IMM8(s1, s1, c); -// } -// } else { -// IFX(X_PEND) {} else {MOVW(s3, c);} -// IFX(X_ALL) { -// ANDS_REG_LSL_IMM5(s1, s1, s3, 0); -// } else { -// AND_REG_LSL_IMM5(s1, s1, s3, 0); -// } -// } -// IFX(X_PEND) { -// STR_IMM9(s1, xEmu, offsetof(x64emu_t, res)); -// } -// IFX(X_CF | X_AF | X_ZF) { -// BIC_IMM8(xFlags, xFlags, (1<>6)&0x3F); + } else { + ANDw_mask(s1, s1, mask&0x3F, (mask>>6)&0x3F); + } + IFX(X_PEND) { + STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX(X_CF | X_AF | X_OF) { + MOV32w(s3, (1<insts || dyn->insts[ninst].x64.gen_flags==X_PEND)) - { + if((s1==xRSP) && (BOX64DRENV(dynarec_safeflags)<2) && (!dyn->insts || (dyn->insts[ninst].x64.gen_flags==X_PEND) || (!BOX64ENV(dynarec_df) && (dyn->insts[ninst].x64.gen_flags==X_ALL)))) { // special case when doing math on ESP and only PEND is needed: ignoring it! if(c>=0 && c<0x1000) { ADDx_U12(s1, s1, c); @@ -91,8 +96,8 @@ void emit_add32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int64_t c, in STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRxw_U12(s5, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, rex.w?d_add64:d_add32b); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } IFX(X_AF) { IFX(X_PEND) {} else {MOV64xw(s5, c);} @@ -123,20 +128,28 @@ void emit_add32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int64_t c, in BFIxw(xFlags, s4, F_AF, 1); // AF: bc & 0x08 } IFX(X_ZF) { - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_CF) { - CSETw(s4, cCS); - BFIw(xFlags, s4, F_CF, 1); + IFNATIVE(NF_CF) {} else { + CSETw(s4, cCS); + BFIw(xFlags, s4, F_CF, 1); + } } IFX(X_OF) { - CSETw(s4, cVS); - BFIw(xFlags, s4, F_OF, 1); + IFNATIVE(NF_VF) {} else { + CSETw(s4, cVS); + BFIw(xFlags, s4, F_OF, 1); + } } IFX(X_SF) { - LSRxw(s3, s1, (rex.w)?63:31); - BFIx(xFlags, s3, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s3, s1, (rex.w)?63:31); + BFIx(xFlags, s3, F_SF, 1); + } } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); @@ -151,8 +164,8 @@ void emit_sub32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3 STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRxw_U12(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, rex.w?d_sub64:d_sub32); - } else IFX(X_ALL) { - SET_DFNONE(s3); + } else { + SET_DFNONE(); } IFX(X_AF) { ORNxw_REG(s3, s2, s1); // s3 = ~op1 | op2 @@ -173,21 +186,31 @@ void emit_sub32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3 BFIx(xFlags, s4, F_AF, 1); // AF: bc & 0x08 } IFX(X_ZF) { - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_CF) { // inverted carry - CSETw(s4, cCC); - BFIw(xFlags, s4, F_CF, 1); + IFNATIVE(NF_CF) { + GEN_INVERTED_CARRY(); + } else { + CSETw(s4, cCC); + BFIw(xFlags, s4, F_CF, 1); + } } IFX(X_OF) { - CSETw(s4, cVS); - BFIw(xFlags, s4, F_OF, 1); + IFNATIVE(NF_VF) {} else { + CSETw(s4, cVS); + BFIw(xFlags, s4, F_OF, 1); + } } IFX(X_SF) { - LSRxw(s3, s1, (rex.w)?63:31); - BFIx(xFlags, s3, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s3, s1, (rex.w)?63:31); + BFIx(xFlags, s3, F_SF, 1); + } } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); @@ -198,8 +221,7 @@ void emit_sub32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3 void emit_sub32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4, int s5) { MAYUSE(s5); - if(s1==xRSP && (!dyn->insts || dyn->insts[ninst].x64.gen_flags==X_PEND)) - { + if(s1==xRSP && (BOX64DRENV(dynarec_safeflags)<2) && (!dyn->insts || (dyn->insts[ninst].x64.gen_flags==X_PEND) || (!BOX64ENV(dynarec_df) && (dyn->insts[ninst].x64.gen_flags==X_ALL)))) { // special case when doing math on RSP and only PEND is needed: ignoring it! if(c>=0 && c<0x1000) { SUBxw_U12(s1, s1, c); @@ -214,8 +236,8 @@ void emit_sub32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int64_t c, in MOV64xw(s5, c); STRxw_U12(s5, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, rex.w?d_sub64:d_sub32); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } IFX(X_AF) { IFX(X_PEND) {} else {MOV64xw(s5, c);} @@ -246,21 +268,31 @@ void emit_sub32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int64_t c, in BFIw(xFlags, s4, F_AF, 1); // AF: bc & 0x08 } IFX(X_ZF) { - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_CF) { // inverted carry - CSETw(s4, cCC); - BFIw(xFlags, s4, F_CF, 1); + IFNATIVE(NF_CF) { + GEN_INVERTED_CARRY(); + } else { + CSETw(s4, cCC); + BFIw(xFlags, s4, F_CF, 1); + } } IFX(X_OF) { - CSETw(s4, cVS); - BFIw(xFlags, s4, F_OF, 1); + IFNATIVE(NF_VF) {} else { + CSETw(s4, cVS); + BFIw(xFlags, s4, F_OF, 1); + } } IFX(X_SF) { - LSRxw(s3, s1, (rex.w)?63:31); - BFIx(xFlags, s3, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s3, s1, (rex.w)?63:31); + BFIx(xFlags, s3, F_SF, 1); + } } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); @@ -274,53 +306,78 @@ void emit_add8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) IFX(X_PEND) { STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRB_U12(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s3, d_add8); - } else IFX(X_ALL) { - SET_DFNONE(s3); + SET_DF(s3, d_add8b); + } else { + SET_DFNONE(); } IFX(X_AF | X_OF) { ORRw_REG(s3, s1, s2); // s3 = op1 | op2 ANDw_REG(s4, s1, s2); // s4 = op1 & op2 } - ADDw_REG(s1, s1, s2); - IFX(X_AF|X_OF) { - BICw_REG(s3, s3, s1); // s3 = (op1 | op2) & ~ res - ORRw_REG(s3, s3, s4); // s3 = (op1 & op2) | ((op1 | op2) & ~ res) + IFX(X_CF|X_SF|X_OF|X_ZF) { + LSLw(s1, s1, 24); + ADDSw_REG_LSL(s1, s1, s2, 24); IFX(X_AF) { + BICw_REG_LSR(s3, s3, s1, 24); // s3 = (op1 | op2) & ~ res + ORRw_REG(s3, s3, s4); // s3 = (op1 & op2) | ((op1 | op2) & ~ res) LSRw(s4, s3, 3); BFIw(xFlags, s4, F_AF, 1); // AF: bc & 0x08 } + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } + } + IFX(X_CF) { + IFNATIVE(NF_CF) {} else { + CSETw(s4, cCS); + BFIw(xFlags, s4, F_CF, 1); + } + } IFX(X_OF) { - LSRw(s4, s3, 6); - EORw_REG_LSR(s4, s4, s4, 1); - BFIw(xFlags, s4, F_OF, 1); // OF: ((bc >> 6) ^ ((bc>>6)>>1)) & 1 + IFNATIVE(NF_VF) {} else { + CSETw(s4, cVS); + BFIw(xFlags, s4, F_OF, 1); + } + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + CSETw(s4, cMI); + BFIx(xFlags, s4, F_SF, 1); + } + } + LSRw(s1, s1, 24); + } else { + ADDw_REG(s1, s1, s2); + IFX(X_AF) { + BICw_REG(s3, s3, s1); // s3 = (op1 | op2) & ~ res + ORRw_REG(s3, s3, s4); // s3 = (op1 & op2) | ((op1 | op2) & ~ res) + LSRw(s4, s3, 3); + BFIw(xFlags, s4, F_AF, 1); // AF: bc & 0x08 } - } - IFX(X_CF) { - BFXILw(xFlags, s1, 8, 1); } IFX(X_PEND) { - STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); + STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); } - COMP_ZFSF(s1, 8) IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } } // emit ADD8 instruction, from s1, const c, store result in s1 using s3 and s4 as scratch -void emit_add8c(dynarec_arm_t* dyn, int ninst, int s1, int c, int s3, int s4) +void emit_add8c(dynarec_arm_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4) { IFX(X_PEND) { - MOV32w(s4, c&0xff); + MOV32w(s4, c); STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRB_U12(s4, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_add8); - } else IFX(X_ALL) { - SET_DFNONE(s3); + } else { + SET_DFNONE(); } IFX(X_AF | X_OF) { - IFX(X_PEND) {} else {MOV32w(s4, c&0xff);} + IFX(X_PEND) {} else {MOV32w(s4, c);} ORRw_REG(s3, s1, s4); // s3 = op1 | op2 ANDw_REG(s4, s1, s4); // s4 = op1 & op2 } @@ -359,8 +416,8 @@ void emit_sub8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRB_U12(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_sub8); - } else IFX(X_ALL) { - SET_DFNONE(s3); + } else { + SET_DFNONE(); } IFX(X_AF|X_OF|X_CF) { MVNw_REG(s3, s1); @@ -396,18 +453,18 @@ void emit_sub8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) } // emit SUB8 instruction, from s1, constant c, store result in s1 using s3 and s4 as scratch -void emit_sub8c(dynarec_arm_t* dyn, int ninst, int s1, int c, int s3, int s4, int s5) +void emit_sub8c(dynarec_arm_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4, int s5) { MAYUSE(s5); IFX(X_ALL|X_PEND) { - MOV32w(s5, c&0xff); + MOV32w(s5, c); } IFX(X_PEND) { STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRB_U12(s5, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_sub8); - } else IFX(X_ALL) { - SET_DFNONE(s3); + } else { + SET_DFNONE(); } IFX(X_AF|X_OF|X_CF) { MVNw_REG(s3, s1); @@ -417,7 +474,7 @@ void emit_sub8c(dynarec_arm_t* dyn, int ninst, int s1, int c, int s3, int s4, in IFX(X_ALL) { SUBw_REG(s1, s1, s5); } else { - SUBw_U12(s1, s1, c&0xff); + SUBw_U12(s1, s1, c); } IFX(X_PEND) { STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); @@ -452,43 +509,67 @@ void emit_add16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) IFX(X_PEND) { STRH_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRH_U12(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s3, d_add16); - } else IFX(X_ALL) { - SET_DFNONE(s3); + SET_DF(s3, d_add16b); + } else { + SET_DFNONE(); } - IFX(X_AF | X_OF) { + IFX(X_AF) { ORRw_REG(s3, s1, s2); // s3 = op1 | op2 ANDw_REG(s4, s1, s2); // s4 = op1 & op2 } - ADDw_REG(s1, s1, s2); - - IFX(X_AF|X_OF) { - BICw_REG(s3, s3, s1); // s3 = (op1 | op2) & ~ res - ORRw_REG(s3, s3, s4); // s3 = (op1 & op2) | ((op1 | op2) & ~ res) + IFX(X_CF|X_SF|X_OF|X_ZF) { + LSLw(s1, s1, 16); + ADDSw_REG_LSL(s1, s1, s2, 16); IFX(X_AF) { + BICw_REG_LSR(s3, s3, s1, 16); // s3 = (op1 | op2) & ~ res + ORRw_REG(s3, s3, s4); // s3 = (op1 & op2) | ((op1 | op2) & ~ res) LSRw(s4, s3, 3); BFIw(xFlags, s4, F_AF, 1); // AF: bc & 0x08 } + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } + } + IFX(X_CF) { + IFNATIVE(NF_CF) {} else { + CSETw(s4, cCS); + BFIw(xFlags, s4, F_CF, 1); + } + } IFX(X_OF) { - LSRw(s4, s3, 14); - EORw_REG_LSR(s4, s4, s4, 1); - BFIw(xFlags, s4, F_OF, 1); // OF: ((bc >> 14) ^ ((bc>>14)>>1)) & 1 + IFNATIVE(NF_VF) {} else { + CSETw(s4, cVS); + BFIw(xFlags, s4, F_OF, 1); + } + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + CSETw(s4, cMI); + BFIx(xFlags, s4, F_SF, 1); + } + } + LSRw(s1, s1, 16); + } else { + ADDw_REG(s1, s1, s2); + IFX(X_AF) { + BICw_REG(s3, s3, s1); // s3 = (op1 | op2) & ~ res + ORRw_REG(s3, s3, s4); // s3 = (op1 & op2) | ((op1 | op2) & ~ res) + LSRw(s4, s3, 3); + BFIw(xFlags, s4, F_AF, 1); // AF: bc & 0x08 } - } - IFX(X_CF) { - BFXILw(xFlags, s1, 16, 1); } IFX(X_PEND) { - STRw_U12(s1, xEmu, offsetof(x64emu_t, res)); + STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); } - COMP_ZFSF(s1, 16) IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } } // emit ADD16 instruction, from s1, const c, store result in s1 using s3 and s4 as scratch -//void emit_add16c(dynarec_arm_t* dyn, int ninst, int s1, int c, int s3, int s4) +// void emit_add16c(dynarec_arm_t* dyn, int ninst, int s1, int c, int s3, int s4) //{ // IFX(X_PEND) { // MOVW(s3, c); @@ -496,7 +577,7 @@ void emit_add16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) // STR_IMM9(s3, xEmu, offsetof(x64emu_t, op2)); // SET_DF(s4, d_add16); // } else IFX(X_ALL) { -// SET_DFNONE(s4); +// SET_DFNONE(); // } // IFX(X_AF | X_OF) { // MOV_REG(s4, s1); @@ -562,8 +643,8 @@ void emit_sub16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) STRH_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRH_U12(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_sub16); - } else IFX(X_ALL) { - SET_DFNONE(s3); + } else { + SET_DFNONE(); } IFX(X_AF|X_OF|X_CF) { ORNw_REG(s3, s2, s1); // s3 = ~op1 | op2 @@ -598,7 +679,7 @@ void emit_sub16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) } // emit SUB16 instruction, from s1, constant c, store result in s1 using s3 and s4 as scratch -//void emit_sub16c(dynarec_arm_t* dyn, int ninst, int s1, int c, int s3, int s4) +// void emit_sub16c(dynarec_arm_t* dyn, int ninst, int s1, int c, int s3, int s4) //{ // IFX(X_PEND) { // MOVW(s3, c); @@ -606,7 +687,7 @@ void emit_sub16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) // STR_IMM9(s3, xEmu, offsetof(x64emu_t, op2)); // SET_DF(s4, d_sub16); // } else IFX(X_ALL) { -// SET_DFNONE(s4); +// SET_DFNONE(); // } // IFX(X_AF|X_OF|X_CF) { // MVN_REG_LSL_IMM5(s4, s1, 0); @@ -665,12 +746,7 @@ void emit_sub16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) // emit INC32 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_inc32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4) { - IFX(X_PEND) { - STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w?d_inc64:d_inc32); - } else IFX(X_ZF|X_OF|X_AF|X_SF|X_PF) { - SET_DFNONE(s4); - } + SET_DFNONE(); IFX(X_AF) { if(rex.w) { ORRx_mask(s3, s1, 1, 0, 0); // s3 = op1 | op2 @@ -680,14 +756,11 @@ void emit_inc32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4 ANDw_mask(s4, s1, 0, 0); // s4 = op1 & op2 } } - IFX(X_ZF|X_OF) { + IFX(X_ZF|X_OF|X_SF) { ADDSxw_U12(s1, s1, 1); } else { ADDxw_U12(s1, s1, 1); } - IFX(X_PEND) { - STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); - } IFX(X_AF) { BICxw_REG(s3, s3, s1); // s3 = (op1 | op2) & ~ res ORRxw_REG(s3, s3, s4); // s3 = (op1 & op2) | ((op1 | op2) & ~ res) @@ -695,16 +768,22 @@ void emit_inc32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4 BFIxw(xFlags, s4, F_AF, 1); // AF: bc & 0x08 } IFX(X_ZF) { - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_OF) { - CSETw(s4, cVS); - BFIw(xFlags, s4, F_OF, 1); + IFNATIVE(NF_VF) {} else { + CSETw(s4, cVS); + BFIw(xFlags, s4, F_OF, 1); + } } IFX(X_SF) { - LSRxw(s3, s1, rex.w?63:31); - BFIxw(xFlags, s3, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s3, s1, rex.w?63:31); + BFIw(xFlags, s3, F_SF, 1); + } } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); @@ -714,20 +793,12 @@ void emit_inc32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4 // emit INC8 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_inc8(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) { - IFX(X_PEND) { - STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s3, d_inc8); - } else IFX(X_ZF|X_OF|X_AF|X_SF|X_PF) { - SET_DFNONE(s3); - } + SET_DFNONE(); IFX(X_AF | X_OF) { ORRw_mask(s3, s1, 0, 0); // s3 = op1 | op2 ANDw_mask(s4, s1, 0, 0); // s4 = op1 & op2 } ADDw_U12(s1, s1, 1); - IFX(X_PEND) { - STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); - } IFX(X_AF|X_OF) { BICw_REG(s3, s3, s1); // s3 = (op1 | op2) & ~ res ORRw_REG(s3, s3, s4); // s4 = (op1 & op2) | ((op1 | op2) & ~ res) @@ -750,22 +821,13 @@ void emit_inc8(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) // emit INC16 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_inc16(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) { - IFX(X_PEND) { - STRH_U12(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s3, d_inc16); - } else IFX(X_ZF|X_OF|X_AF|X_SF|X_PF) { - SET_DFNONE(s3); - } + SET_DFNONE(); IFX(X_AF | X_OF) { - MOVw_REG(s4, s1); + ORRw_mask(s3, s1, 0, 0); // s3 = op1 | op2 + ANDw_mask(s4, s1, 0, 0); // s4 = op1 & op2 } ADDw_U12(s1, s1, 1); - IFX(X_PEND) { - STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); - } IFX(X_AF|X_OF) { - ORRw_mask(s3, s4, 0, 0); // s3 = op1 | op2 - ANDw_mask(s4, s4, 0, 0); // s4 = op1 & op2 BICw_REG(s3, s3, s1); // s3 = (op1 | op2) & ~ res ORRw_REG(s3, s3, s4); // s3 = (op1 & op2) | ((op1 | op2) & ~ res) IFX(X_AF) { @@ -787,12 +849,7 @@ void emit_inc16(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) // emit DEC32 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_dec32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4) { - IFX(X_PEND) { - STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w?d_dec64:d_dec32); - } else IFX(X_ZF|X_OF|X_AF|X_SF|X_PF) { - SET_DFNONE(s4); - } + SET_DFNONE(); IFX(X_AF) { MVNxw_REG(s3, s1); if(rex.w) { @@ -803,14 +860,11 @@ void emit_dec32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4 ORRw_mask(s3, s3, 0, 0); // s3 = ~op1 | op2 } } - IFX(X_ZF|X_OF) { + IFX(X_ZF|X_OF|X_SF) { SUBSxw_U12(s1, s1, 1); } else { SUBxw_U12(s1, s1, 1); } - IFX(X_PEND) { - STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); - } IFX(X_AF) { ANDxw_REG(s3, s3, s1); // s3 = (~op1 | op2) & res ORRxw_REG(s3, s3, s4); // s4 = (~op1 & op2) | ((~op1 | op2) & ~ res) @@ -818,16 +872,22 @@ void emit_dec32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4 BFIw(xFlags, s4, F_AF, 1); // AF: bc & 0x08 } IFX(X_ZF) { - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_OF) { - CSETw(s4, cVS); - BFIw(xFlags, s4, F_OF, 1); + IFNATIVE(NF_VF) {} else { + CSETw(s4, cVS); + BFIw(xFlags, s4, F_OF, 1); + } } IFX(X_SF) { - LSRxw(s3, s1, rex.w?63:31); - BFIxw(xFlags, s3, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s3, s1, rex.w?63:31); + BFIxw(xFlags, s3, F_SF, 1); + } } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); @@ -837,12 +897,7 @@ void emit_dec32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4 // emit DEC8 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_dec8(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) { - IFX(X_PEND) { - STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s3, d_dec8); - } else IFX(X_ZF|X_OF|X_AF|X_SF|X_PF) { - SET_DFNONE(s3); - } + SET_DFNONE(); IFX(X_AF|X_OF) { MVNw_REG(s3, s1); ANDw_mask(s4, s3, 0, 0); // s4 = ~op1 & op2 @@ -853,9 +908,6 @@ void emit_dec8(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) } else { SUBw_U12(s1, s1, 1); } - IFX(X_PEND) { - STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); - } IFX(X_AF|X_OF) { ANDw_REG(s3, s3, s1); // s3 = (~op1 | op2) & res ORRw_REG(s3, s3, s4); // s3 = (~op1 & op2) | ((~op1 | op2) & res) @@ -870,8 +922,10 @@ void emit_dec8(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) } } IFX(X_ZF) { - CSETw(s3, cEQ); - BFIw(xFlags, s3, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s3, cEQ); + BFIw(xFlags, s3, F_ZF, 1); + } } IFX(X_SF) { LSRw(s3, s1, 7); @@ -885,12 +939,7 @@ void emit_dec8(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) // emit DEC16 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_dec16(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) { - IFX(X_PEND) { - STRH_U12(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s3, d_dec16); - } else IFX(X_ZF|X_OF|X_AF|X_SF|X_PF) { - SET_DFNONE(s3); - } + SET_DFNONE(); IFX(X_AF|X_OF) { MVNw_REG(s4, s1); } @@ -899,9 +948,6 @@ void emit_dec16(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) } else { SUBw_U12(s1, s1, 1); } - IFX(X_PEND) { - STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); - } IFX(X_AF|X_OF) { ORRw_mask(s3, s4, 0, 0); // s3 = ~op1 | op2 ANDw_mask(s4, s4, 0, 0); // s4 = ~op1 & op2 @@ -918,8 +964,10 @@ void emit_dec16(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) } } IFX(X_ZF) { - CSETw(s3, cEQ); - BFIw(xFlags, s3, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s3, cEQ); + BFIw(xFlags, s3, F_ZF, 1); + } } IFX(X_SF) { LSRw(s3, s1, 15); @@ -938,16 +986,29 @@ void emit_adc32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3 STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRxw_U12(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, rex.w?d_adc64:d_adc32b); - } else IFX(X_ALL) { - SET_DFNONE(s3); + } else { + SET_DFNONE(); + } + IFNATIVE_BEFORE(NF_CF) { + if(INVERTED_CARRY_BEFORE) { + if(cpuext.flagm) + CFINV(); + else { + MRS_nzcv(s3); + EORx_mask(s3, s3, 1, 35, 0); //mask=1<insts[ninst].x64.gen_flags&X_PEND)?4:0)); - BFCw(xFlags, F_OF, 1); - IFX(X_PEND) { - STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); + if(BOX64ENV(cputype)) { + IFX(X_CF | X_OF) { + MOV32w(s4, rex.w?64:32); + SUBxw_REG(s4, s4, s2); + LSRxw_REG(s4, s1, s4); + BFIw(xFlags, s4, F_CF, 1); + } + } else { + IFX(X_OF) { + LSRxw(s4, s1, rex.w?62:30); + EORw_REG_LSR(s4, s4, s4, 1); + BFIw(xFlags, s4, F_OF, 1); + } + IFX(X_CF) { + MOV32w(s4, rex.w?64:32); + SUBxw_REG(s4, s4, s2); + LSRxw_REG(s4, s1, s4); + BFIw(xFlags, s4, F_CF, 1); } - B_NEXT(cEQ); - } - IFX(X_CF | X_OF) { - MOV32w(s4, rex.w?64:32); - SUBxw_REG(s4, s4, s2); - LSRxw_REG(s4, s1, s4); - BFIw(xFlags, s4, F_CF, 1); } LSLxw_REG(s1, s1, s2); IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - TSTxw_REG(s1, s1); - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFX2(X_OF, && BOX64ENV(cputype)) { + EORxw_REG_LSR(s3, xFlags, s1, rex.w?63:31); // CF is set if OF is asked + BFIw(xFlags, s3, F_OF, 1); } + int need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + if(need_tst) TSTxw_REG(s1, s1); IFX(X_SF) { - LSRxw(s4, s1, (rex.w)?63:31); - BFIx(xFlags, s4, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s4, s1, (rex.w)?63:31); + BFIw(xFlags, s4, F_SF, 1); + } } - IFX(X_OF) { - CMPSxw_U12(s2, 1); // if s2==1 - IFX(X_SF) {} else {LSRxw(s4, s1, (rex.w)?63:31);} - EORxw_REG(s4, s4, xFlags); // CF is set if OF is asked - CSELw(s4, s4, wZR, cEQ); - BFIw(xFlags, s4, F_OF, 1); + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } - if(box64_dynarec_test) - IFX(X_AF) { + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else BFCw(xFlags, F_AF, 1); - } + } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } @@ -89,49 +98,58 @@ void emit_shl32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, i STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRxw_U12(s3, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, rex.w?d_shl64:d_shl32); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } - if(c==0) { + if(BOX64ENV(cputype)) { + IFX(X_CF|X_OF) { + LSRxw(s3, s1, (rex.w?64:32)-c); + BFIxw(xFlags, s3, F_CF, 1); + } + } else { IFX(X_OF) { - BFCw(xFlags, F_OF, 1); + LSRxw(s3, s1, rex.w?62:30); + EORw_REG_LSR(s3, s3, s3, 1); + BFIw(xFlags, s3, F_OF, 1); } - IFX(X_PEND) { - STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); + IFX(X_CF) { + LSRxw(s3, s1, (rex.w?64:32)-c); + BFIxw(xFlags, s3, F_CF, 1); } - return; - } - IFX(X_CF|X_OF) { - LSRxw(s3, s1, (rex.w?64:32)-c); - BFIxw(xFlags, s3, F_CF, 1); } LSLxw(s1, s1, c); IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } + int need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + if(need_tst) TSTxw_REG(s1, s1); IFX(X_ZF) { - TSTxw_REG(s1, s1); - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_SF) { - LSRxw(s4, s1, (rex.w)?63:31); - BFIx(xFlags, s4, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s4, s1, (rex.w)?63:31); + BFIw(xFlags, s4, F_SF, 1); + } } - IFX(X_OF) { - if(c==1) { + if(BOX64ENV(cputype)) + IFX(X_OF) { IFX(X_SF) {} else {LSRxw(s4, s1, (rex.w)?63:31);} EORxw_REG(s4, s4, xFlags); // CF is set if OF is asked BFIw(xFlags, s4, F_OF, 1); - } else { - BFCw(xFlags, F_OF, 1); } - } - if(box64_dynarec_test) - IFX(X_AF) { + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else BFCw(xFlags, F_AF, 1); - } + } IFX(X_PF) { if(c>7) { // the 0xff area will be 0, so PF is known @@ -153,37 +171,48 @@ void emit_shr32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3 STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRxw_U12(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, rex.w?d_shr64:d_shr32); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } IFX(X_CF) { SUBxw_U12(s3, s2, 1); LSRxw_REG(s3, s1, s3); BFIw(xFlags, s3, 0, 1); } - IFX(X_OF) { - CMPSxw_U12(s2, 1); // if s2==1 - Bcond(cNE, 4+2*4); - LSRxw(s4, s1, rex.w?63:31); - BFIw(xFlags, s4, F_OF, 1); + IFX2(X_OF, && !BOX64ENV(cputype)) { + LSRxw(s4, s1, rex.w?63:31); + BFIw(xFlags, s4, F_OF, 1); } LSRxw_REG(s1, s1, s2); IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRxw(s4, s1, rex.w?62:30); + BFIw(xFlags, s4, F_OF, 1); + } + int need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + if(need_tst) TSTxw_REG(s1, s1); IFX(X_ZF) { - TSTxw_REG(s1, s1); - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_SF) { - LSRxw(s4, s1, (rex.w)?63:31); - BFIx(xFlags, s4, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s4, s1, (rex.w)?63:31); + BFIx(xFlags, s4, F_SF, 1); + } } - if(box64_dynarec_test) - IFX(X_AF) { + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else BFCw(xFlags, F_AF, 1); - } + } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } @@ -199,8 +228,8 @@ void emit_shr32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, i STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRxw_U12(s3, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, rex.w?d_shr64:d_shr32); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } IFX(X_CF) { if(c==1) { @@ -210,29 +239,93 @@ void emit_shr32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, i BFIw(xFlags, s3, 0, 1); } } - IFX(X_OF) { - if(c==1) { - LSRxw(s4, s1, rex.w?63:31); - BFIw(xFlags, s4, F_OF, 1); - } + IFX2(X_OF, && !BOX64ENV(cputype)) { + LSRxw(s4, s1, rex.w?63:31); + BFIw(xFlags, s4, F_OF, 1); } LSRxw(s1, s1, c); IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRxw(s4, s1, rex.w?62:30); + BFIw(xFlags, s4, F_OF, 1); + } + int need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + if(need_tst) TSTxw_REG(s1, s1); IFX(X_ZF) { - TSTxw_REG(s1, s1); - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_SF) { - // no sign if c>0 - BFCw(xFlags, F_SF, 1); + IFNATIVE(NF_SF) {} else { + // no sign if c>0 + BFCw(xFlags, F_SF, 1); + } } - if(box64_dynarec_test) - IFX(X_AF) { + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else BFCw(xFlags, F_AF, 1); + } + IFX(X_PF) { + emit_pf(dyn, ninst, s1, s4); + } +} + +// emit SAR32 instruction, from s1 , s2, store result in s1 using s3 and s4 as scratch, s2 can be same as s3 +void emit_sar32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) +{ + MAYUSE(s2); + int64_t j64; + MAYUSE(j64); + + IFX(X_PEND) { + STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); + STRxw_U12(s2, xEmu, offsetof(x64emu_t, op2)); + SET_DF(s4, rex.w?d_sar64:d_sar32); + } else { + SET_DFNONE(); + } + IFX(X_CF) { + SUBxw_U12(s3, s2, 1); + ASRxw_REG(s3, s1, s3); + BFIw(xFlags, s3, 0, 1); + } + IFX(X_OF) { + BFCw(xFlags, F_OF, 1); + } + ASRxw_REG(s1, s1, s2); + IFX(X_PEND) { + STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); + } + int need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + if(need_tst) TSTxw_REG(s1, s1); + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + LSRxw(s4, s1, (rex.w)?63:31); + BFIx(xFlags, s4, F_SF, 1); } + } + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else + BFCw(xFlags, F_AF, 1); + } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } @@ -248,8 +341,8 @@ void emit_sar32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, i STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRxw_U12(s3, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, rex.w?d_sar64:d_sar32); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } IFX(X_CF) { ASRxw(s3, s1, c-1); @@ -259,23 +352,31 @@ void emit_sar32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, i IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } + int need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + if(need_tst) TSTxw_REG(s1, s1); IFX(X_ZF) { - TSTxw_REG(s1, s1); - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_SF) { - LSRxw(s4, s1, (rex.w)?63:31); - BFIx(xFlags, s4, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s4, s1, (rex.w)?63:31); + BFIx(xFlags, s4, F_SF, 1); + } } - IFX(X_OF) - if(c==1) { - BFCw(xFlags, F_OF, 1); + IFX(X_OF) { + BFCw(xFlags, F_OF, 1); } - if(box64_dynarec_test) - IFX(X_AF) { + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else BFCw(xFlags, F_AF, 1); - } + } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } @@ -292,31 +393,46 @@ void emit_shl8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRB_U12(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, d_shl8); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } - IFX(X_CF | X_OF) { - MOV32w(s4, 8); - SUBw_REG(s4, s4, s2); - LSRw_REG(s4, s1, s4); - BFIw(xFlags, s4, F_CF, 1); + if(BOX64ENV(cputype)) { + IFX(X_CF | X_OF) { + MOV32w(s4, 8); + SUBw_REG(s4, s4, s2); + LSRw_REG(s4, s1, s4); + BFIw(xFlags, s4, F_CF, 1); + } + } else { + IFX(X_OF) { + LSRw(s4, s1, 6); + EORw_REG_LSR(s4, s4, s4, 1); + BFIw(xFlags, s4, F_OF, 1); + } + IFX(X_CF) { + MOV32w(s4, 8); + SUBw_REG(s4, s4, s2); + LSRw_REG(s4, s1, s4); + BFIw(xFlags, s4, F_CF, 1); + } } LSLw_REG(s1, s1, s2); IFX(X_PEND) { STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); } - COMP_ZFSF(s1, 8) - IFX(X_OF) { - CMPSw_U12(s2, 1); // if s2==1 - IFX2(X_SF, && !arm64_flagm) {} else {LSRw(s3, s1, 7);} + if(BOX64ENV(cputype)) + IFX(X_OF) { + LSRw(s3, s1, 7); EORw_REG(s4, s3, xFlags); // CF is set if OF is asked - CSELw(s4, s4, wZR, cEQ); BFIw(xFlags, s4, F_OF, 1); - } - if(box64_dynarec_test) - IFX(X_AF) { - BFCw(xFlags, F_AF, 1); } + COMP_ZFSF(s1, 8) + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else + BFCw(xFlags, F_AF, 1); + } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } @@ -332,58 +448,44 @@ void emit_shl8c(dynarec_arm_t* dyn, int ninst, int s1, uint32_t c, int s3, int s STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRB_U12(s3, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, d_shl8); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } - if(c<8) { + if(BOX64ENV(cputype)) { IFX(X_CF|X_OF) { - BFXILw(xFlags, s1, 8-c, 1); - } - LSLw(s1, s1, c); - - IFX(X_PEND) { - STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); + LSRw(s3, s1, (c>8)?8:(8-c)); + BFIw(xFlags, s3, F_CF, 1); } - COMP_ZFSF(s1, 8) + } else { IFX(X_OF) { - if(c==1) { - IFX2(X_SF, && !arm64_flagm) {} else {LSRw(s3, s1, 7);} - EORw_REG(s4, s3, xFlags); // CF is set if OF is asked - BFIw(xFlags, s4, F_OF, 1); - } else { - BFCw(xFlags, F_OF, 1); - } - } - if(box64_dynarec_test) IFX(X_AF) { - BFCw(xFlags, F_AF, 1); - } - IFX(X_PF) { - emit_pf(dyn, ninst, s1, s4); + LSRw(s4, s1, 6); + EORw_REG_LSR(s4, s4, s4, 1); + BFIw(xFlags, s4, F_OF, 1); } - } else { + } + LSLw(s1, s1, c); + if(!BOX64ENV(cputype)) IFX(X_CF) { - LSLw(s3, s1, c-1); - BFXILw(xFlags, s3, 7, 1); // insert F_CF from s3[7:1] + BFXILw(xFlags, s1, 8, 1); } - MOVw_REG(s1, xZR); + + IFX(X_PEND) { + STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); + } + if(BOX64ENV(cputype)) IFX(X_OF) { - BFCw(xFlags, F_OF, 1); - } - IFX(X_SF) { - BFCw(xFlags, F_SF, 1); + EORw_REG_LSR(s4, xFlags, s1, 7); // CF is set if OF is asked + BFIw(xFlags, s4, F_OF, 1); } - if(box64_dynarec_test) IFX(X_AF) { + COMP_ZFSF(s1, 8) + IFX (X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else BFCw(xFlags, F_AF, 1); - } - IFX(X_PF | X_ZF) { - MOV32w(s3, 1); - IFX(X_ZF) { - BFIw(xFlags, s3, F_ZF, 1); - } - IFX(X_PF) { - BFIw(xFlags, s3, F_PF, 1); - } - } + } + IFX(X_PF) { + emit_pf(dyn, ninst, s1, s4); } } @@ -398,29 +500,33 @@ void emit_shr8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRB_U12(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, d_shr8); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } IFX(X_CF) { SUBw_U12(s4, s2, 1); LSRw_REG(s4, s1, s4); BFIw(xFlags, s4, 0, 1); } - IFX(X_OF) { - CMPSw_U12(s2, 1); // if s2==1 - Bcond(cNE, 4+2*4); - LSRw(s4, s1, 7); - BFIw(xFlags, s4, F_OF, 1); + IFX2(X_OF, && !BOX64ENV(cputype)) { + LSRw(s4, s1, 7); + BFIw(xFlags, s4, F_OF, 1); } LSRw_REG(s1, s1, s2); IFX(X_PEND) { STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); } + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRw(s4, s1, 6); + BFIw(xFlags, s4, F_OF, 1); + } COMP_ZFSF(s1, 8) - if(box64_dynarec_test) - IFX(X_AF) { + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else BFCw(xFlags, F_AF, 1); - } + } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } @@ -435,8 +541,8 @@ void emit_shr8c(dynarec_arm_t* dyn, int ninst, int s1, uint32_t c, int s3, int s STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRB_U12(s3, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, d_shr8); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } IFX(X_CF) { if(c==1) { @@ -446,21 +552,25 @@ void emit_shr8c(dynarec_arm_t* dyn, int ninst, int s1, uint32_t c, int s3, int s BFIw(xFlags, s3, 0, 1); } } - IFX(X_OF) { - if(c==1) { - LSRw(s4, s1, 7); - BFIw(xFlags, s4, F_OF, 1); - } + IFX2(X_OF, && !BOX64ENV(cputype)) { + LSRw(s4, s1, 7); + BFIw(xFlags, s4, F_OF, 1); } LSRw(s1, s1, c); IFX(X_PEND) { STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); } + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRw(s4, s1, 6); + BFIw(xFlags, s4, F_OF, 1); + } COMP_ZFSF(s1, 8) - if(box64_dynarec_test) - IFX(X_AF) { + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else BFCw(xFlags, F_AF, 1); - } + } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } @@ -473,8 +583,8 @@ void emit_sar8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRB_U12(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, d_sar8); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } IFX(X_CF) { SUBw_U12(s4, s2, 1); @@ -487,14 +597,14 @@ void emit_sar8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4) } COMP_ZFSF(s1, 8) IFX(X_OF) { - CMPSw_U12(s2, 1); - Bcond(cNE, 4+4); - BFCw(xFlags, F_OF, 1); + BFCw(xFlags, F_OF, 1); } - if(box64_dynarec_test) - IFX(X_AF) { + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else BFCw(xFlags, F_AF, 1); - } + } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } @@ -509,12 +619,11 @@ void emit_sar8c(dynarec_arm_t* dyn, int ninst, int s1, uint32_t c, int s3, int s STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRB_U12(s3, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, d_sar8); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } if(c<8) IFX(X_CF) { - ASRw(s3, s1, c-1); - BFIw(xFlags, s3, 0, 1); + BFXILw(xFlags, s1, c-1, 1); } ASRw(s1, s1, c); IFX(X_PEND) { @@ -522,26 +631,33 @@ void emit_sar8c(dynarec_arm_t* dyn, int ninst, int s1, uint32_t c, int s3, int s } if(c<8) { COMP_ZFSF(s1, 8) - IFX(X_OF) - if(c==1) { - BFCw(xFlags, F_OF, 1); + IFX(X_OF) { + BFCw(xFlags, F_OF, 1); } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } } else { - LSRw(s3, s1, 7); - BFIw(xFlags, s3, F_CF, 1); - BFIw(wFlags, s3, F_SF, 1); - EORw_mask(s3, s3, 0, 0); //1 - BFIw(xFlags, s3, F_ZF, 1); - MOV32w(s3, 1); - BFIw(xFlags, s3, F_PF, 1); - } - if(box64_dynarec_test) - IFX(X_AF) { - BFCw(xFlags, F_AF, 1); + IFX(X_CF|X_ZF|X_SF|X_PF) { + LSRw(s3, s1, 7); + IFX(X_CF){ BFIw(xFlags, s3, F_CF, 1); } + IFX(X_SF){ BFIw(wFlags, s3, F_SF, 1); } + IFX(X_ZF) { + EORw_mask(s3, s3, 0, 0); //1 + BFIw(xFlags, s3, F_ZF, 1); + } + IFX(X_OF){BFCw(xFlags, F_OF, 1);} + IFX(X_PF) { + ORRw_mask(xFlags, xFlags, 30, 0); //1<16)?16:(16-c)); BFIw(xFlags, s3, F_CF, 1); } - LSLw(s1, s1, c); - - IFX(X_PEND) { - STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); - } - COMP_ZFSF(s1, 16) + } else { IFX(X_OF) { - if(c==1) { - IFX2(X_SF, && !arm64_flagm) {} else {LSRw(s3, s1, 15);} - EORw_REG(s4, s3, xFlags); // CF is set if OF is asked - BFIw(xFlags, s4, F_OF, 1); - } else { - BFCw(xFlags, F_OF, 1); - } - } - if(box64_dynarec_test) IFX(X_AF) { - BFCw(xFlags, F_AF, 1); - } - IFX(X_PF) { - if(c>7) { - // the 0xff area will be 0, so PF is known - MOV32w(s3, 1); - BFIw(xFlags, s3, F_PF, 1); - } else - emit_pf(dyn, ninst, s1, s4); + LSRw(s4, s1, 14); + EORw_REG_LSR(s4, s4, s4, 1); + BFIw(xFlags, s4, F_OF, 1); } - } else { + } + LSLw(s1, s1, c); + if(!BOX64ENV(cputype)) IFX(X_CF) { - LSLw(s3, s1, c-1); - BFXILw(xFlags, s3, 15, 1); // insert F_CF from s3[15:1] + BFXILw(xFlags, s1, 16, 1); } - MOVw_REG(s1, xZR); + + IFX(X_PEND) { + STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); + } + if(BOX64ENV(cputype)) IFX(X_OF) { - BFCw(xFlags, F_OF, 1); - } - IFX(X_SF) { - BFCw(xFlags, F_SF, 1); - } - IFX(X_PF | X_ZF) { - MOV32w(s3, 1); - IFX(X_ZF) { - BFIw(xFlags, s3, F_ZF, 1); - } - IFX(X_PF) { - BFIw(xFlags, s3, F_PF, 1); - } + EORw_REG_LSR(s4, xFlags, s1, 15); // CF is set if OF is asked + BFIw(xFlags, s4, F_OF, 1); } + COMP_ZFSF(s1, 16) + IFX (X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else + BFCw(xFlags, F_AF, 1); } -} + IFX(X_PF) { + if(c>7) { + // the 0xff area will be 0, so PF is known + ORRw_mask(xFlags, xFlags, 30, 0); //1<1) { - ORRw_REG_LSL(s1, s1, s1, 9); // insert s1 again - } - LSRw_IMM(s1, s1, c); // do the rcr - IFX(X_OF) { - if(c==1) { - EORw_REG_LSR(s3, s3, s1, 7); - BFIw(xFlags, s3, F_OF, 1); + if(c) { + BFIw(s1, xFlags, 8, 1); // insert cf + IFX(X_CF) { + BFXILw(xFlags, s1, c-1, 1); } + if(c>1) { + ORRw_REG_LSL(s1, s1, s1, 9); // insert s1 again + } + LSRw_IMM(s1, s1, c); // do the rcr } - IFX(X_PEND) { - STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRw(s4, s1, 6); + EORw_REG_LSR(s4, s4, s4, 1); + BFIw(xFlags, s4, F_OF, 1); } } @@ -1067,33 +1141,36 @@ void emit_rcl16c(dynarec_arm_t* dyn, int ninst, int s1, uint32_t c, int s3, int { MAYUSE(s1); MAYUSE(s3); MAYUSE(s4); - if (!(c%17)) return; - - SET_DFNONE(s4); + if (!(c%17) && !BOX64ENV(cputype)) return; c%=17; - BFIw(s1, xFlags, 16, 1); // insert cf - IFX(X_OF|X_CF) { - if(c!=16) { - LSRw_IMM(s3, s1, 16-c); + if(c) { + BFIw(s1, xFlags, 16, 1); // insert cf + if(BOX64ENV(cputype)) { + IFX(X_OF|X_CF) { + BFXILw(xFlags, s1, 16-c, 1); + } } else { - MOVw_REG(s3, s1); + IFX(X_CF) { + BFXILw(xFlags, s1, 16-c, 1); + } } } - ORRx_REG_LSL(s1, s1, s1, 17); // insert s1 again - LSRx_IMM(s1, s1, 17-c); // do the rcl - IFX(X_PEND) { - STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); - } - IFX(X_CF) { - BFIw(xFlags, s3, F_CF, 1); - } - IFX(X_OF) { - if(c==1) { - EORw_REG_LSR(s3, s3, s1, 15); + if(!BOX64ENV(cputype)) + IFX(X_OF) { + LSRw(s3, s1, 14); + EORw_REG_LSR(s3, s3, s3, 1); BFIw(xFlags, s3, F_OF, 1); } + if(c) { + ORRx_REG_LSL(s1, s1, s1, 17); // insert s1 again + LSRx_IMM(s1, s1, 17-c); // do the rcl } + if(BOX64ENV(cputype)) + IFX(X_OF) { + EORw_REG_LSR(s3, xFlags, s1, 15); + BFIw(xFlags, s3, F_OF, 1); + } } // emit RCR16 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch @@ -1101,30 +1178,27 @@ void emit_rcr16c(dynarec_arm_t* dyn, int ninst, int s1, uint32_t c, int s3, int { MAYUSE(s1); MAYUSE(s3); MAYUSE(s4); - if (!(c%17)) return; - - SET_DFNONE(s4); + if (!(c%17) && !BOX64ENV(cputype)) return; c%=17; - BFIw(s1, xFlags, 16, 1); // insert cf - IFX(X_OF) { - MOVw_REG(s3, wFlags); - } - IFX(X_CF) { - BFXILx(xFlags, s1, c-1, 1); - } - if(c>1) { - ORRx_REG_LSL(s1, s1, s1, 17); // insert s1 again + IFX2(X_OF, && !BOX64ENV(cputype)) { + EORw_REG_LSR(s3, xFlags, s1, 15); + BFIw(xFlags, s3, F_OF, 1); } - LSRx_IMM(s1, s1, c); // do the rcr - IFX(X_OF) { - if(c==1) { - EORw_REG_LSR(s3, s3, s1, 15); - BFIw(xFlags, s3, F_OF, 1); + if(c) { + BFIw(s1, xFlags, 16, 1); // insert cf + IFX(X_CF) { + BFXILx(xFlags, s1, c-1, 1); + } + if(c>1) { + ORRx_REG_LSL(s1, s1, s1, 17); // insert s1 again } + LSRx_IMM(s1, s1, c); // do the rcr } - IFX(X_PEND) { - STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRw(s4, s1, 14); + EORw_REG_LSR(s4, s4, s4, 1); + BFIw(xFlags, s4, F_OF, 1); } } @@ -1133,11 +1207,23 @@ void emit_rcl32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, i { MAYUSE(s1); MAYUSE(s3); MAYUSE(s4); - SET_DFNONE(s4); + if(!c) return; - IFX(X_OF|X_CF) { - LSRxw_IMM(s3, s1, (rex.w?64:32)-c); + if(BOX64ENV(cputype)) { + IFX(X_OF|X_CF) { + LSRxw_IMM(s3, s1, (rex.w?64:32)-c); + } + } else { + IFX(X_CF) { + LSRxw_IMM(s3, s1, (rex.w?64:32)-c); + } } + if(!BOX64ENV(cputype)) + IFX(X_OF) { + LSRxw(s4, s1, rex.w?62:30); + EORw_REG_LSR(s4, s4, s4, 1); + BFIw(xFlags, s4, F_OF, 1); + } if(c==1) { LSLxw(s1, s1, 1); BFIxw(s1, xFlags, 0, 1); @@ -1146,17 +1232,12 @@ void emit_rcl32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, i BFIxw(s4, xFlags, c-1, 1); ORRxw_REG_LSR(s1, s4, s1, (rex.w?65:33)-c); } - IFX(X_PEND) { - STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); - } IFX(X_CF) { BFIw(xFlags, s3, F_CF, 1); } - IFX(X_OF) { - if(c==1) { - EORxw_REG_LSR(s3, s3, s1, rex.w?63:31); - BFIw(xFlags, s3, F_OF, 1); - } + IFX2(X_OF, && BOX64ENV(cputype)) { + EORxw_REG_LSR(s3, s3, s1, rex.w?63:31); + BFIw(xFlags, s3, F_OF, 1); } } // emit RCR32/RCR64 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch @@ -1164,13 +1245,11 @@ void emit_rcr32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, i { MAYUSE(s1); MAYUSE(s3); MAYUSE(s4); - SET_DFNONE(s4); + if(!c) return; - IFX(X_OF) { - if(c==1) { - EORxw_REG_LSR(s3, xFlags, s1, rex.w?63:31); - BFIw(xFlags, s3, F_OF, 1); - } + IFX2(X_OF, && !BOX64ENV(cputype)) { + EORxw_REG_LSR(s3, xFlags, s1, rex.w?63:31); + BFIw(xFlags, s3, F_OF, 1); } IFX(X_CF) { BFXILxw(s3, s1, c-1, 1); @@ -1186,57 +1265,158 @@ void emit_rcr32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, i IFX(X_CF) { BFIw(wFlags, s3, 0, 1); } - IFX(X_PEND) { - STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRxw(s4, s1, rex.w?62:30); + EORw_REG_LSR(s4, s4, s4, 1); + BFIw(xFlags, s4, F_OF, 1); + } +} + +// emit RCL32/RCL64 instruction, from s1 , shift s2 (destroyed), store result in s1 using s3 and s4 as scratch +void emit_rcl32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) +{ + MAYUSE(s1); MAYUSE(s3); MAYUSE(s4); + + if(BOX64ENV(cputype)) { + IFX(X_OF|X_CF) { + MOVZw(s4, rex.w?64:32); + SUBx_REG(s4, s4, s2); + LSRxw_REG(s3, s1, s4); + } + } else { + IFX(X_CF) { + MOVZw(s4, rex.w?64:32); + SUBx_REG(s4, s4, s2); + LSRxw_REG(s3, s1, s4); + } + } + if(!BOX64ENV(cputype)) + IFX(X_OF) { + LSRxw(s4, s1, rex.w?62:30); + EORw_REG_LSR(s4, s4, s4, 1); + BFIw(xFlags, s4, F_OF, 1); + } + SUBw_U12(s4, s2, 1); + CBNZw(s4, 4+4*3); + /*if(c==1)*/ + { + LSLxw(s1, s1, 1); + BFIxw(s1, xFlags, 0, 1); + B(4+4*9); + } + /*else*/ + { + LSLxw_REG(s4, s1, s2); + UBFXw(s5, xFlags, 0, 1); + SUBw_U12(s2, s2, 1); //s2 = c-1 now + LSLxw_REG(s5, s5, s2); + ORRxw_REG(s4, s4, s5); + MOVZw(s5, rex.w?64:32); // -1 to compensate from the c-1 is s2 + SUBw_REG(s5, s5, s2); + LSRxw_REG(s1, s1, s5); + ORRxw_REG(s1, s1, s4); + } + IFX(X_CF) { + BFIw(xFlags, s3, F_CF, 1); + } + IFX2(X_OF, && BOX64ENV(cputype)) { + EORxw_REG_LSR(s3, s3, s1, rex.w?63:31); + BFIw(xFlags, s3, F_OF, 1); + } +} +// emit RCR32/RCR64 instruction, from s1 , shift s2, store result in s1 using s3 and s4 as scratch +void emit_rcr32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) +{ + MAYUSE(s1); MAYUSE(s3); MAYUSE(s4); + + IFX2(X_OF, && !BOX64ENV(cputype)) { + EORxw_REG_LSR(s3, xFlags, s1, rex.w?63:31); + BFIw(xFlags, s3, F_OF, 1); + } + SUBw_U12(s4, s2, 1); + IFX(X_CF) { + LSRxw_REG(s3, s1, s4); + BFIw(xFlags, s3, F_res2, 1); // saving the value without reserving s3 + } + CBNZw(s4, 4+4*3); + /*if(c==1)*/ + { + LSRxw(s1, s1, 1); + BFIxw(s1, xFlags, rex.w?63:31, 1); + B(4+4*9); + } + /*else*/ + { + LSRxw_REG(s5, s1, s2); + UBFXw(s4, xFlags, 0, 1); + MOVZw(s3, (rex.w?64:32)); + SUBx_REG(s3, s3, s2); + LSLxw_REG(s4, s4, s3); + ORRxw_REG(s5, s5, s4); + ADDx_U12(s3, s3, 1); + LSLxw_REG(s1, s1, s3); + ORRxw_REG(s1, s1, s5); + } + IFX(X_CF) { + BFXILw(xFlags, xFlags, F_res2, 1); + BFCw(xFlags, F_res2, 1); + } + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRxw(s4, s1, rex.w?62:30); + EORw_REG_LSR(s4, s4, s4, 1); + BFIw(xFlags, s4, F_OF, 1); } } // emit SHRD32 instruction, from s1, fill s2 , constant c, store result in s1 using s3 and s4 as scratch void emit_shrd32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4) { - c&=(rex.w?0x3f:0x1f); IFX(X_PEND) { MOV32w(s3, c); STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRxw_U12(s3, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, rex.w?d_shrd64:d_shrd32); - } else IFX(X_ALL) { - SET_DFNONE(s4); - } - if(!c) { - IFX(X_PEND) { - STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); - } - return; + } else { + SET_DFNONE(); } IFX(X_CF) { BFXILxw(xFlags, s1, c-1, 1); // set CF } - IFX(X_OF) { - if(c==1) { - LSRxw(s4, s1, rex.w?63:31); - BFIw(xFlags, s4, F_OF, 1); // store sign for later use - } + IFX2(X_OF, && !BOX64ENV(cputype)) { + EORx_REG_LSR(s3, s2, s1, rex.w?63:31); // OF is set if sign changed + BFIw(xFlags, s3, F_OF, 1); } EXTRxw(s1, s2, s1, c); IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRxw(s4, s1, rex.w?62:30); + EORx_REG_LSR(s4, s4, s4, 1); // OF is set if sign changed + BFIw(xFlags, s4, F_OF, 1); + } + int need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + if(need_tst) TSTxw_REG(s1, s1); IFX(X_ZF) { - TSTxw_REG(s1, s1); - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_SF) { - LSRxw(s4, s1, (rex.w)?63:31); - BFIx(xFlags, s4, F_SF, 1); - } - IFX(X_OF) { - if(c==1) { - UBFXx(s3, s1, rex.w?63:31, 1); - EORw_REG_LSL(xFlags, xFlags, s3, F_OF); // OF is set if sign changed + IFNATIVE(NF_SF) {} else { + LSRxw(s4, s1, (rex.w)?63:31); + BFIx(xFlags, s4, F_SF, 1); } } + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else + BFCw(xFlags, F_AF, 1); + } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } @@ -1244,54 +1424,59 @@ void emit_shrd32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, uint void emit_shld32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4) { - c&=(rex.w?0x3f:0x1f); IFX(X_PEND) { MOV32w(s3, c); STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRxw_U12(s3, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, rex.w?d_shld64:d_shld32); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } - if(c==0) { - IFX(X_OF) { - BFCw(xFlags, F_OF, 1); + if(BOX64ENV(cputype)) { + IFX(X_CF|X_OF) { + BFXILx(xFlags, s1, (rex.w?64:32)-c, 1); } - IFX(X_PEND) { - STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); + } else { + IFX(X_CF) { + BFXILx(xFlags, s1, (rex.w?64:32)-c, 1); } - return; } - IFX(X_CF) { - LSRxw(s3, s1, (rex.w?64:32)-c); - BFIxw(xFlags, s3, F_CF, 1); - } - IFX(X_OF) { - LSRxw(s3, s1, rex.w?63:31); - BFIw(xFlags, s3, F_OF, 1); // store current sign for later use + IFX2(X_OF, && !BOX64ENV(cputype)) { + LSRxw(s3, s1, rex.w?62:30); + EORx_REG_LSR(s3, s3, s3, 1); // OF is set if sign changed + BFIw(xFlags, s3, F_OF, 1); } EXTRxw(s1, s1, s2, (rex.w?64:32)-c); IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } + IFX2(X_OF, && BOX64ENV(cputype)) { + EORx_REG_LSR(s3, xFlags, s1, rex.w?63:31); // OF is set if sign changed + BFIw(xFlags, s3, F_OF, 1); + } + int need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + if(need_tst) TSTxw_REG(s1, s1); IFX(X_ZF) { - TSTxw_REG(s1, s1); - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_SF) { - LSRxw(s4, s1, (rex.w)?63:31); - BFIx(xFlags, s4, F_SF, 1); - } - IFX(X_OF) { - if(c==1) { - UBFXx(s3, s1, rex.w?63:31, 1); - EORw_REG_LSL(xFlags, xFlags, s3, F_OF); // OF is set if sign changed - } else { - BFCw(xFlags, F_OF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s4, s1, (rex.w)?63:31); + BFIx(xFlags, s4, F_SF, 1); } } + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else + BFCw(xFlags, F_AF, 1); + } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); } @@ -1305,40 +1490,56 @@ void emit_shrd32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s STRxw_U12(s5, xEmu, offsetof(x64emu_t, op2)); // same flags computation as with shl64/shl32 SET_DF(s4, rex.w?d_shrd64:d_shrd32); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } IFX(X_CF) { SUBw_U12(s3, s5, 1); LSRxw_REG(s3, s1, s3); BFIw(xFlags, s3, F_CF, 1); } - IFX(X_OF) { - LSRxw(s4, s1, rex.w?63:31); - BFIw(xFlags, s4, F_OF, 1); // store sign fr now + IFX2(X_OF, && !BOX64ENV(cputype)) { + EORx_REG_LSR(s3, s2, s1, rex.w?63:31); // OF is set if sign changed + BFIw(xFlags, s3, F_OF, 1); + } + if(s1==s2) { + RORxw_REG(s1, s1, s5); + } else { + LSRxw_REG(s1, s1, s5); + SUBxw_U12(s3, s5, rex.w?64:32); + NEGxw_REG(s3, s3); + LSLxw_REG(s3, s2, s3); + ORRxw_REG(s1, s1, s3); } - LSRxw_REG(s3, s1, s5); - SUBxw_U12(s4, s5, rex.w?64:32); - NEGxw_REG(s4, s4); - LSLxw_REG(s4, s2, s4); - ORRxw_REG(s1, s3, s4); IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRxw(s4, s1, rex.w?62:30); + EORx_REG_LSR(s4, s4, s4, 1); // OF is set if sign changed + BFIw(xFlags, s4, F_OF, 1); + } + int need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + if(need_tst) TSTxw_REG(s1, s1); IFX(X_ZF) { - TSTxw_REG(s1, s1); - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_SF) { - LSRxw(s4, s1, (rex.w)?63:31); - BFIw(xFlags, s4, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s4, s1, (rex.w)?63:31); + BFIx(xFlags, s4, F_SF, 1); + } } - IFX(X_OF) { - CMPSw_U12(s5, 1); - Bcond(cNE, 4+2*4); - UBFXx(s3, s1, rex.w?63:31, 1); - EORw_REG_LSL(xFlags, xFlags, s3, F_OF); // OF is set if sign changed + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else + BFCw(xFlags, F_AF, 1); } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); @@ -1351,40 +1552,63 @@ void emit_shld32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s STRxw_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRxw_U12(s5, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, rex.w?d_shld64:d_shld32); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } MOV32w(s3, (rex.w?64:32)); SUBw_REG(s3, s3, s5); - IFX(X_CF) { - LSRxw_REG(s4, s1, s3); - BFIxw(xFlags, s4, F_CF, 1); + if(BOX64ENV(cputype)) { + IFX(X_CF|X_OF) { + LSRxw_REG(s4, s1, s3); + BFIxw(xFlags, s4, F_CF, 1); + } + } else { + IFX(X_CF) { + LSRxw_REG(s4, s1, s3); + BFIxw(xFlags, s4, F_CF, 1); + } } - IFX(X_OF) { - LSRxw(s4, s1, rex.w?63:31); - BFIw(xFlags, s4, F_OF, 1); // store current sign for later use + IFX2(X_OF, && !BOX64ENV(cputype)) { + LSRxw(s4, s1, rex.w?62:30); + EORx_REG_LSR(s4, s4, s4, 1); // OF is set if sign changed + BFIw(xFlags, s4, F_OF, 1); + } + if(s1==s2) { + RORxw_REG(s1, s1, s3); + } else { + LSLxw_REG(s1, s1, s5); + LSRxw_REG(s3, s2, s3); + ORRxw_REG(s1, s3, s1); } - LSLxw_REG(s4, s1, s5); - LSRxw_REG(s3, s2, s3); - ORRxw_REG(s1, s3, s4); IFX(X_PEND) { STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); } + IFX2(X_OF, && BOX64ENV(cputype)) { + EORx_REG_LSR(s3, xFlags, s1, rex.w?63:31); // OF is set if sign changed + BFIw(xFlags, s3, F_OF, 1); + } + int need_tst = 0; + IFX(X_ZF) need_tst = 1; + IFXNATIVE(X_SF, NF_SF) need_tst = 1; + if(need_tst) TSTxw_REG(s1, s1); IFX(X_ZF) { - TSTxw_REG(s1, s1); - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_SF) { - LSRxw(s4, s1, (rex.w)?63:31); - BFIx(xFlags, s4, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s4, s1, (rex.w)?63:31); + BFIx(xFlags, s4, F_SF, 1); + } } - IFX(X_OF) { - CMPSw_U12(s5, 1); - Bcond(cNE, 4+2*4); - UBFXx(s3, s1, rex.w?63:31, 1); - EORw_REG_LSL(xFlags, xFlags, s3, F_OF); // OF is set if sign changed + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else + BFCw(xFlags, F_AF, 1); } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); @@ -1400,35 +1624,35 @@ void emit_shrd16c(dynarec_arm_t* dyn, int ninst, int s1, int s2, uint32_t c, int STRH_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRH_U12(s3, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, d_shrd16); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } - if(!c) { - IFX(X_PEND) { - STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); - } - return; + IFX2(X_CF, && BOX64ENV(cputype)) { + BFXILw(xFlags, s1, c-1, 1); // set CF } ORRw_REG_LSL(s1, s1, s2, 16); // create concat first - IFX(X_CF) { + IFX2(X_CF, && !BOX64ENV(cputype)) { BFXILw(xFlags, s1, c-1, 1); // set CF } - IFX(X_OF) { - if(c==1) { - LSRw(s4, s1, 15); - BFIw(xFlags, s4, F_OF, 1); // store sign for later use - } + IFX2(X_OF, && !BOX64ENV(cputype)) { + EORw_REG_LSR(s4, s2, s1, 15); + BFIw(xFlags, s4, F_OF, 1); } RORw(s1, s1, c); IFX(X_PEND) { STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); } + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRw(s4, s1, 14); + EORx_REG_LSR(s4, s4, s4, 1); // OF is set if sign changed + BFIw(xFlags, s4, F_OF, 1); + } COMP_ZFSF(s1, 16) - IFX(X_OF) { - if(c==1) { - UBFXw(s3, s1, 15, 1); - EORw_REG_LSL(xFlags, xFlags, s3, F_OF); // OF is set if sign changed - } + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else + BFCw(xFlags, F_AF, 1); } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); @@ -1443,29 +1667,41 @@ void emit_shrd16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s5, int s3, STRH_U12(s5, xEmu, offsetof(x64emu_t, op2)); // same flags computation as with shl64/shl32 SET_DF(s4, d_shrd16); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } - ORRw_REG_LSL(s1, s1, s2, 16); // create concat first - IFX(X_CF) { + IFX2(X_CF, && BOX64ENV(cputype)) { SUBw_U12(s3, s5, 1); - LSRw_REG(s3, s1, s3); - BFIw(xFlags, s3, F_CF, 1); + LSRw_REG(s4, s1, s3); + BFIw(xFlags, s4, F_CF, 1); } - IFX(X_OF) { - LSRw(s4, s1, 15); - BFIw(xFlags, s4, F_OF, 1); // store sign fr now + ORRw_REG_LSL(s1, s1, s2, 16); // create concat first + if(!BOX64ENV(cputype)) { + IFX(X_CF) { + SUBw_U12(s3, s5, 1); + LSRw_REG(s3, s1, s3); + BFIw(xFlags, s3, F_CF, 1); + } + IFX(X_OF) { + EORw_REG_LSR(s4, s2, s1, 15); + BFIw(xFlags, s4, F_OF, 1); + } } RORw_REG(s1, s1, s5); IFX(X_PEND) { STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); } + IFX2(X_OF, && BOX64ENV(cputype)) { + LSRw(s4, s1, 14); + EORx_REG_LSR(s4, s4, s4, 1); // OF is set if sign changed + BFIw(xFlags, s4, F_OF, 1); + } COMP_ZFSF(s1, 16) - IFX(X_OF) { - CMPSw_U12(s5, 1); - Bcond(cNE, 4+2*4); - UBFXw(s3, s1, 15, 1); - EORw_REG_LSL(xFlags, xFlags, s3, F_OF); // OF is set if sign changed + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else + BFCw(xFlags, F_AF, 1); } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); @@ -1480,43 +1716,48 @@ void emit_shld16c(dynarec_arm_t* dyn, int ninst, int s1, int s2, uint32_t c, int STRH_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRH_U12(s3, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, d_shld16); - } else IFX(X_ALL) { - SET_DFNONE(s4); + } else { + SET_DFNONE(); } - if(c==0) { - IFX(X_OF) { - BFCw(xFlags, F_OF, 1); + BFIw(s1, s2, 16, 16); // create concat first + if(BOX64ENV(cputype)) { + IFX(X_CF|X_OF) { + if(c<=16) + BFXILw(xFlags, s1, 16-c, 1); + else + BFCw(xFlags, F_CF, 1); } - IFX(X_PEND) { - STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); + } else { + IFX(X_CF) { + if(c<=16) + BFXILw(xFlags, s1, 16-c, 1); + else + BFXILw(xFlags, s2, 32-c, 1); + } + IFX(X_OF) { + LSRw(s4, s1, 14); + EORw_REG_LSR(s4, s4, s4, 1); // OF is set if sign changed + BFIw(xFlags, s4, F_OF, 1); } - return; - } - ORRw_REG_LSL(s1, s1, s2, 16); // create concat first - IFX(X_CF) { - if(c<16) - LSRw(s3, s1, 16-c); - else - LSRw(s3, s2, 32-c); - BFIw(xFlags, s3, F_CF, 1); - } - IFX(X_OF) { - LSRw(s3, s1, 15); - BFIw(xFlags, s3, F_OF, 1); // store current sign for later use } RORw(s1, s1, 32-c); - + IFX2(X_OF, && BOX64ENV(cputype)) { + if(c>15) + BFIw(xFlags, xFlags, F_OF, 1); // copy CF + else { + EORw_REG_LSR(s4, xFlags, s1, 15); + BFIw(xFlags, s4, F_OF, 1); + } + } + COMP_ZFSF(s1, 16) IFX(X_PEND) { STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); } - COMP_ZFSF(s1, 16) - IFX(X_OF) { - if(c==1) { - UBFXw(s3, s1, 15, 1); - EORw_REG_LSL(xFlags, xFlags, s3, F_OF); // OF is set if sign changed - } else { - BFCw(xFlags, F_OF, 1); - } + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else + BFCw(xFlags, F_AF, 1); } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); @@ -1529,21 +1770,38 @@ void emit_shld16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s5, int s3, STRH_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRH_U12(s5, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, d_shld16); - } else IFX(X_ALL) { - SET_DFNONE(s4); - } - IFX(X_CF) { - ORRw_REG_LSL(s4, s2, s1, 16); - MOV32w(s3, 32); - SUBw_REG(s3, s3, s5); - LSRw_REG(s3, s4, s3); - BFIw(xFlags, s3, F_CF, 1); + } else { + SET_DFNONE(); } - IFX(X_OF) { - LSRw(s3, s1, 15); - BFIw(xFlags, s3, F_OF, 1); // store current sign for later use + uint8_t mask = X_CF; + if(BOX64ENV(cputype)) { + IFX(X_CF|X_OF) { + MOV32w(s3, 16); + SUBw_REG(s3, s3, s5); + LSRw_REG(s4, s1, s3); + BFIw(xFlags, s4, F_CF, 1); + } + IFX(X_OF) { + SUBw_U12(s3, s3, 1); + LSRw_REG(s3, s1, s3); + EORw_REG(s3, xFlags, s3); // OF is set if sign changed + BFIw(xFlags, s3, F_OF, 1); + } + } else { + IFX(X_CF) { + ORRw_REG_LSL(s4, s2, s1, 16); + MOV32w(s3, 32); + SUBw_REG(s3, s3, s5); + LSRw_REG(s3, s4, s3); + BFIw(xFlags, s3, F_CF, 1); + } + IFX(X_OF) { + LSRw(s4, s1, 14); + EORw_REG_LSR(s4, s4, s4, 1); // OF is set if sign changed + BFIw(xFlags, s4, F_OF, 1); + } } - ORRw_REG_LSL(s1, s1, s2, 16); // create concat first + BFIw(s1, s2, 16, 16); // create concat first MOV32w(s3, 32); SUBw_REG(s3, s3, s5); RORw_REG(s1, s1, s3); @@ -1552,11 +1810,11 @@ void emit_shld16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s5, int s3, STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); } COMP_ZFSF(s1, 16) - IFX(X_OF) { - CMPSw_U12(s5, 1); - Bcond(cNE, 4+2*4); - UBFXw(s3, s1, 15, 1); - EORw_REG_LSL(xFlags, xFlags, s3, F_OF); // OF is set if sign changed + IFX(X_AF) { + if(BOX64ENV(cputype)) + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + else + BFCw(xFlags, F_AF, 1); } IFX(X_PF) { emit_pf(dyn, ninst, s1, s4); diff --git a/src/dynarec/arm64/dynarec_arm64_emit_tests.c b/src/dynarec/arm64/dynarec_arm64_emit_tests.c index 6a78ce8..73c467e 100644 --- a/src/dynarec/arm64/dynarec_arm64_emit_tests.c +++ b/src/dynarec/arm64/dynarec_arm64_emit_tests.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,7 +17,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" // emit CMP32 instruction, from cmp s1, s2, using s3 and s4 as scratch void emit_cmp32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) @@ -30,7 +28,7 @@ void emit_cmp32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3 STRxw_U12(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, rex.w?d_cmp64:d_cmp32); } else { - SET_DFNONE(s4); + SET_DFNONE(); } IFX(X_AF) { ORNxw_REG(s3, s2, s1); // s3 = ~op1 | op2 @@ -47,21 +45,31 @@ void emit_cmp32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3 BFIx(xFlags, s4, F_AF, 1); // AF: bc & 0x08 } IFX(X_ZF) { - CSETw(s4, cEQ); - BFIw(xFlags, s4, F_ZF, 1); + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } } IFX(X_CF) { // inverted carry - CSETw(s4, cCC); - BFIw(xFlags, s4, F_CF, 1); + IFNATIVE(NF_CF) { + GEN_INVERTED_CARRY(); + } else { + CSETw(s4, cCC); + BFIw(xFlags, s4, F_CF, 1); + } } IFX(X_OF) { - CSETw(s4, cVS); - BFIw(xFlags, s4, F_OF, 1); + IFNATIVE(NF_VF) {} else { + CSETw(s4, cVS); + BFIw(xFlags, s4, F_OF, 1); + } } IFX(X_SF) { - LSRxw(s3, s5, (rex.w)?63:31); - BFIw(xFlags, s3, F_SF, 1); + IFNATIVE(NF_SF) {} else { + LSRxw(s3, s5, (rex.w)?63:31); + BFIw(xFlags, s3, F_SF, 1); + } } IFX(X_PF) { emit_pf(dyn, ninst, s5, s4); @@ -78,22 +86,37 @@ void emit_cmp32_0(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int STRxw_U12(s1, xEmu, offsetof(x64emu_t, res)); SET_DF(s4, rex.w?d_cmp64:d_cmp32); } else { - SET_DFNONE(s4); + SET_DFNONE(); } SUBSxw_U12(s3, s1, 0); // res = s1 - 0 // and now the tricky ones (and mostly unused), PF and AF // bc = (res & (~d | s)) | (~d & s) => is 0 here... - IFX(X_OF|X_AF|X_CF) { - MOV32w(s4, (1<> 14) ^ ((bc>>14)>>1)) & 1 + IFNATIVE(NF_VF) {} else { + CSETw(s4, cVS); + BFIw(xFlags, s4, F_OF, 1); + } + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + CSETw(s4, cMI); + BFIw(xFlags, s4, F_SF, 1); + } + } + IFX(X_PF|X_PEND) { + LSRw(s5, s5, 16); + } + } else { + SUBw_REG(s5, s1, s2); // res = s1 - s2 + IFX(X_AF) { + ANDw_REG(s3, s3, s5); // s3 = (~op1 | op2) & res + ORRw_REG(s3, s3, s4); // s3 = (~op1 & op2) | ((~op1 | op2) & res) + LSRw(s4, s3, 3); + BFIx(xFlags, s4, F_AF, 1); // AF: bc & 0x08 } } + IFX_PENDOR0 { + STRH_U12(s5, xEmu, offsetof(x64emu_t, res)); + } IFX(X_PF) { emit_pf(dyn, ninst, s5, s4); } @@ -152,7 +204,7 @@ void emit_cmp16_0(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) STRH_U12(s1, xEmu, offsetof(x64emu_t, res)); SET_DF(s3, d_cmp16); } else { - SET_DFNONE(s3); + SET_DFNONE(); } // bc = (res & (~d | s)) | (~d & s) = 0 IFX(X_CF | X_AF | X_OF) { @@ -171,35 +223,65 @@ void emit_cmp8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4, in IFX_PENDOR0 { STRB_U12(s1, xEmu, offsetof(x64emu_t, op1)); STRB_U12(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s4, d_cmp8); + SET_DF(s3, d_cmp8); } else { - SET_DFNONE(s4); + SET_DFNONE(); } - SUBw_REG(s5, s1, s2); // res = s1 - s2 - IFX_PENDOR0 { - STRB_U12(s5, xEmu, offsetof(x64emu_t, res)); + IFX(X_AF) { + ORNw_REG(s3, s2, s1); // s3 = ~op1 | op2 + BICw(s4, s2, s1); // s4 = ~op1 & op2 } - COMP_ZFSF(s5, 8) - // bc = (res & (~d | s)) | (~d & s) - IFX(X_CF|X_AF|X_OF) { - ORNw_REG(s4, s2, s1); // s4 = ~d | s - ANDw_REG(s4, s4, s5); // s4 = res & (~d | s) - BICw_REG(s3, s2, s1); // s3 = s & ~d - ORRw_REG(s3, s4, s3); // s3 = (res & (~d | s)) | (s & ~d) - IFX(X_CF) { - LSRw(s4, s3, 7); - BFIw(xFlags, s4, F_CF, 1); // CF : bc & 0x80 - } + IFX(X_CF|X_ZF|X_SF|X_OF) { + LSLw(s5, s1, 24); + SUBSw_REG_LSL(s5, s5, s2, 24); IFX(X_AF) { + ANDw_REG_LSR(s3, s3, s5, 24); // s3 = (~op1 | op2) & res + ORRw_REG(s3, s3, s4); // s3 = (~op1 & op2) | ((~op1 | op2) & res) LSRw(s4, s3, 3); - BFIw(xFlags, s4, F_AF, 1); // AF: bc & 0x08 + BFIx(xFlags, s4, F_AF, 1); // AF: bc & 0x08 + } + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } + } + IFX(X_CF) { + // inverted carry + IFNATIVE(NF_CF) { + GEN_INVERTED_CARRY(); + } else { + CSETw(s4, cCC); + BFIw(xFlags, s4, F_CF, 1); + } } IFX(X_OF) { - LSRw(s4, s3, 6); - EORw_REG_LSR(s4, s4, s4, 1); - BFIw(xFlags, s4, F_OF, 1); // OF: ((bc >> 6) ^ ((bc>>6)>>1)) & 1 + IFNATIVE(NF_VF) {} else { + CSETw(s4, cVS); + BFIw(xFlags, s4, F_OF, 1); + } + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + CSETw(s4, cMI); + BFIw(xFlags, s4, F_SF, 1); + } + } + IFX(X_PF|X_PEND) { + LSRw(s5, s5, 24); + } + } else { + SUBw_REG(s5, s1, s2); // res = s1 - s2 + IFX(X_AF) { + ANDw_REG(s3, s3, s5); // s3 = (~op1 | op2) & res + ORRw_REG(s3, s3, s4); // s3 = (~op1 & op2) | ((~op1 | op2) & res) + LSRw(s4, s3, 3); + BFIx(xFlags, s4, F_AF, 1); // AF: bc & 0x08 } } + IFX_PENDOR0 { + STRB_U12(s5, xEmu, offsetof(x64emu_t, res)); + } IFX(X_PF) { emit_pf(dyn, ninst, s5, s4); } @@ -214,7 +296,7 @@ void emit_cmp8_0(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4) STRB_U12(s1, xEmu, offsetof(x64emu_t, res)); SET_DF(s3, d_cmp8); } else { - SET_DFNONE(s4); + SET_DFNONE(); } // bc = (res & (~d | s)) | (~d & s) = 0 IFX(X_CF | X_AF | X_OF) { @@ -234,23 +316,85 @@ void emit_test32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s IFX_PENDOR0 { SET_DF(s3, rex.w?d_tst64:d_tst32); } else { - SET_DFNONE(s4); + SET_DFNONE(); } - IFX(X_CF | X_AF | X_OF) { - MOV32w(s3, (1<>12)&1, mask&0x3F, (mask>>6)&0x3F); + } else { + MOV64xw(s3, c); + ANDSxw_REG(s3, s1, s3); // res = s1 & s2 + } + IFX_PENDOR0 { + STRxw_U12(s3, xEmu, offsetof(x64emu_t, res)); + } + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + LSRxw(s4, s3, rex.w?63:31); + BFIw(xFlags, s4, F_SF, 1); + } } IFX(X_PF) { emit_pf(dyn, ninst, s3, s5); @@ -264,23 +408,100 @@ void emit_test16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4, IFX_PENDOR0 { SET_DF(s3, d_tst16); } else { - SET_DFNONE(s4); + SET_DFNONE(); + } + IFX(X_CF|X_ZF|X_SF|X_OF) { + LSLw(s5, s1, 16); + ANDSw_REG_LSL(s5, s5, s2, 16); + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } + } + IFX(X_CF) { + IFNATIVE(NF_CF) {} else {BFCw(xFlags, F_CF, 1);} + } + IFX(X_OF) { + IFNATIVE(NF_VF) {} else {BFCw(xFlags, F_OF, 1);} + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + CSETw(s4, cMI); + BFIw(xFlags, s4, F_SF, 1); + } + } + IFX(X_PF|X_PEND) { + LSRw(s5, s5, 16); + } + } else { + ANDw_REG(s5, s1, s2); // res = s1 & s2 } - IFX(X_CF | X_AF | X_OF) { - MOV32w(s3, (1<>6)&0x3F); + } else { + MOV32w(s3, c); + ANDSw_REG_LSL(s5, s5, s3, 16); + } + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } + } + IFX(X_CF) { + IFNATIVE(NF_CF) {} else {BFCw(xFlags, F_CF, 1);} + } + IFX(X_OF) { + IFNATIVE(NF_VF) {} else {BFCw(xFlags, F_OF, 1);} + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + CSETw(s4, cMI); + BFIw(xFlags, s4, F_SF, 1); + } + } + IFX(X_PF|X_PEND) { + LSRw(s5, s5, 16); + } + } else { + mask = convert_bitmask_w(c); + if(mask) { + ANDw_mask(s5, s1, mask&0x3F, (mask>>6)&0x3F); + } else { + MOV32w(s5, c); + ANDw_REG(s5, s1, s5); // res = s1 & s2 + } + } + IFX(X_AF) { + BFCw(xFlags, F_AF, 1); + } + IFX_PENDOR0 { + STRH_U12(s5, xEmu, offsetof(x64emu_t, res)); } IFX(X_PF) { emit_pf(dyn, ninst, s5, s4); @@ -294,23 +515,100 @@ void emit_test8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4, i IFX_PENDOR0 { SET_DF(s3, d_tst8); } else { - SET_DFNONE(s4); + SET_DFNONE(); + } + IFX(X_CF|X_ZF|X_SF|X_OF) { + LSLw(s5, s1, 24); + ANDSw_REG_LSL(s5, s5, s2, 24); + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } + } + IFX(X_CF) { + IFNATIVE(NF_CF) {} else {BFCw(xFlags, F_CF, 1);} + } + IFX(X_OF) { + IFNATIVE(NF_VF) {} else {BFCw(xFlags, F_OF, 1);} + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + CSETw(s4, cMI); + BFIw(xFlags, s4, F_SF, 1); + } + } + IFX(X_PF|X_PEND) { + LSRw(s5, s5, 24); + } + } else { + ANDw_REG(s5, s1, s2); // res = s1 & s2 } - IFX(X_CF | X_AF | X_OF) { - MOV32w(s3, (1<>6)&0x3F); + } else { + MOV32w(s3, c); + ANDSw_REG_LSL(s5, s5, s3, 24); + } + IFX(X_ZF) { + IFNATIVE(NF_EQ) {} else { + CSETw(s4, cEQ); + BFIw(xFlags, s4, F_ZF, 1); + } + } + IFX(X_CF) { + IFNATIVE(NF_CF) {} else {BFCw(xFlags, F_CF, 1);} + } + IFX(X_OF) { + IFNATIVE(NF_VF) {} else {BFCw(xFlags, F_OF, 1);} + } + IFX(X_SF) { + IFNATIVE(NF_SF) {} else { + CSETw(s4, cMI); + BFIw(xFlags, s4, F_SF, 1); + } + } + IFX(X_PF|X_PEND) { + LSRw(s5, s5, 24); + } + } else { + mask = convert_bitmask_w(c); + if(mask) { + ANDw_mask(s5, s1, mask&0x3F, (mask>>6)&0x3F); + } else { + MOV32w(s5, c); + ANDw_REG(s5, s1, s5); // res = s1 & s2 + } + } + IFX(X_AF) { + BFCw(xFlags, F_AF, 1); + } + IFX_PENDOR0 { + STRB_U12(s5, xEmu, offsetof(x64emu_t, res)); } IFX(X_PF) { emit_pf(dyn, ninst, s5, s4); diff --git a/src/dynarec/arm64/dynarec_arm64_f0.c b/src/dynarec/arm64/dynarec_arm64_f0.c index 9e1e143..7ff416e 100644 --- a/src/dynarec/arm64/dynarec_arm64_f0.c +++ b/src/dynarec/arm64/dynarec_arm64_f0.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -18,11 +16,11 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_arm64_functions.h" -uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { (void)ip; (void)need_epilog; @@ -33,7 +31,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin int32_t i32; int64_t i64, j64; int64_t fixedaddress; - int unscaled; + int unscaled, mask; MAYUSE(eb1); MAYUSE(eb2); MAYUSE(gb1); @@ -42,42 +40,23 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin MAYUSE(wb2); MAYUSE(j64); - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - while((opcode==0x36) || (opcode==0x2e) || (opcode==0x3E) || (opcode==0x26)) { - opcode = F8; - } - - - GETREX(); - SKIPTEST(x1); // DYNAREC_TEST doesn't work, by nature, on atomic opration - switch(opcode) { case 0x00: - INST_NAME("LOCK ADD Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGB(x2); - if((nextop&0xC0)==0xC0) { - if(rex.rex) { - wback = xRAX + (nextop&7) + (rex.b<<3); - wb2 = 0; - } else { - wback = (nextop&7); - wb2 = (wback>>2); - wback = xRAX+(wback&3); - } - UBFXw(x1, wback, wb2*8, 8); - emit_add8(dyn, ninst, x1, x2, x4, x3); - BFIx(wback, x1, wb2*8, 8); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK ADD Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGB(x2); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { UFLAG_IF { LDADDALB(x2, x1, wback); - emit_add8(dyn, ninst, x1, x2, x4, x5); + emit_add8(dyn, ninst, x1, x2, x4, x5); } else { STADDLB(x2, wback); } @@ -88,21 +67,22 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRB(x4, x1, wback); CBNZx_MARKLOCK(x4); } - SMDMB(); } break; case 0x01: - INST_NAME("LOCK ADD Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; - if((nextop&0xC0)==0xC0) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_add32(dyn, ninst, rex, ed, gd, x3, x4); + if(MODREG) { + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK ADD Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); if(!ALIGNED_ATOMICxw) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, wback, 1, 0, 3); // mask = F CMPSw_U12(x1, 16-(1<<(2+rex.w))); B_MARK(cGT); @@ -111,60 +91,54 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin B_MARK(cNE); } } - if(arm64_atomics) { + if(cpuext.atomics) { UFLAG_IF { LDADDALxw(gd, x1, wback); - emit_add32(dyn, ninst, rex, x1, gd, x3, x4); } else { STADDLxw(gd, wback); } - SMDMB(); } else { MARKLOCK; LDAXRxw(x1, wback); - emit_add32(dyn, ninst, rex, x1, gd, x3, x4); - STLXRxw(x3, x1, wback); + ADDxw_REG(x4, x1, gd); + STLXRxw(x3, x4, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } if(!ALIGNED_ATOMICxw) { - B_NEXT_nocond; + B_MARK2_nocond; MARK; // unaligned! also, not enough LDRxw_U12(x1, wback, 0); LDAXRB(x4, wback); - BFIxw(x1, x4, 0, 8); // re-inject - emit_add32(dyn, ninst, rex, x1, gd, x3, x4); - STLXRB(x3, x1, wback); + SUBxw_UXTB(x4, x4, x1); // substract with the byte only + CBNZw_MARK(x4); // jump if different + ADDxw_REG(x4, x1, gd); + STLXRB(x3, x4, wback); CBNZx_MARK(x3); - STRxw_U12(x1, wback, 0); // put the whole value - SMDMB(); + STRxw_U12(x4, wback, 0); // put the whole value + } + MARK2; + UFLAG_IF { + emit_add32(dyn, ninst, rex, x1, gd, x3, x4); } } break; case 0x08: - INST_NAME("LOCK OR Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGB(x2); - if((nextop&0xC0)==0xC0) { - if(rex.rex) { - wback = xRAX + (nextop&7) + (rex.b<<3); - wb2 = 0; - } else { - wback = (nextop&7); - wb2 = (wback>>2); - wback = xRAX+(wback&3); - } - UBFXw(x1, wback, wb2*8, 8); - emit_or8(dyn, ninst, x1, x2, x4, x3); - BFIx(wback, x1, wb2*8, 8); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK OR Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGB(x2); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { LDSETALB(x2, x1, wback); UFLAG_IF { - emit_or8(dyn, ninst, x1, x2, x4, x5); + emit_or8(dyn, ninst, x1, x2, x4, x5); } } else { MARKLOCK; @@ -173,23 +147,24 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRB(x4, x1, wback); CBNZx_MARKLOCK(x4); } - SMDMB(); } break; case 0x09: - INST_NAME("LOCK OR Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_or32(dyn, ninst, rex, ed, gd, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK OR Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { LDSETALxw(gd, x1, wback); UFLAG_IF { - emit_or32(dyn, ninst, rex, x1, gd, x3, x4); + emit_or32(dyn, ninst, rex, x1, gd, x3, x4); } } else { MARKLOCK; @@ -198,7 +173,6 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRxw(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; @@ -207,80 +181,66 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch(nextop) { case 0xAB: - INST_NAME("LOCK BTS Ed, Gd"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); nextop = F8; - GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - wback = 0; - if(rex.w) { - ANDx_mask(x2, gd, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDw_mask(x2, gd, 0, 0b00100); //mask=0x00000001f - } - LSRxw_REG(x4, ed, x2); - if(rex.w) { - ANDSx_mask(x4, x4, 1, 0, 0); //mask=1 + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTS Ed, Gd"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); } else { - ANDSw_mask(x4, x4, 0, 0); //mask=1 + SETFLAGS(X_CF, SF_SUBSET); } - BFIw(xFlags, x4, F_CF, 1); - MOV32w(x4, 1); - LSLxw_REG(x4, x4, x2); - ORRxw_REG(ed, ed, x4); - } else { + GETGD; // Will fetch only 1 byte, to avoid alignment issue ANDw_mask(x2, gd, 0, 0b00010); //mask=0x000000007 addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); ASRxw(x1, gd, 3); // r1 = (gd>>3) - ADDx_REG_LSL(x3, wback, x1, 0); //(&ed)+=r1; + if(!rex.w && !rex.is32bits) {SXTWx(x1, x1);} + ADDy_REG_LSL(x3, wback, x1, 0); //(&ed)+=r1; ed = x1; wback = x3; MOV32w(x5, 1); - MARKLOCK; - LDAXRB(ed, wback); - LSRw_REG(x4, ed, x2); - BFIw(xFlags, x4, F_CF, 1); - LSLw_REG(x4, x5, x2); - ORRw_REG(ed, ed, x4); - STLXRB(x4, ed, wback); - CBNZw_MARKLOCK(x4); - SMDMB(); + if(cpuext.atomics) { + LSLw_REG(x4, x5, x2); + LDSETALB(x4, x4, wback); + IFX(X_CF) { + LSRw_REG(x4, x4, x2); + BFIw(xFlags, x4, F_CF, 1); + } + } else { + MARKLOCK; + LDAXRB(ed, wback); + LSRw_REG(x4, ed, x2); + IFX(X_CF) { + BFIw(xFlags, x4, F_CF, 1); + } + LSLw_REG(x4, x5, x2); + ORRw_REG(ed, ed, x4); + STLXRB(x4, ed, wback); + CBNZw_MARKLOCK(x4); + } } break; case 0xB0: - switch(rep) { + switch(rex.rep) { case 0: - INST_NAME("LOCK CMPXCHG Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGB(x1); - UBFXx(x6, xRAX, 0, 8); if(MODREG) { - if(rex.rex) { - wback = xRAX+(nextop&7)+(rex.b<<3); - wb2 = 0; - } else { - wback = (nextop&7); - wb2 = (wback>>2)*8; - wback = xRAX+(wback&3); - } - UBFXx(x2, wback, wb2, 8); - wb1 = 0; - ed = x2; - UFLAG_IF {emit_cmp8(dyn, ninst, x6, ed, x3, x4, x5);} - CMPSxw_REG(x6, x2); - B_MARK2(cNE); - BFIx(wback, x2, wb2, 8); - MOVxw_REG(ed, gd); - MARK2; - BFIx(xRAX, x2, 0, 8); - B_NEXT_nocond; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK CMPXCHG Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGB(x1); + UBFXx(x6, xRAX, 0, 8); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { UFLAG_IF { MOVw_REG(x2, x6); CASALB(x6, gd, wback); @@ -302,7 +262,6 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin UFLAG_IF {emit_cmp8(dyn, ninst, x6, x2, x3, x4, x5);} BFIx(xRAX, x2, 0, 8); } - SMDMB(); } break; default: @@ -310,27 +269,22 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } break; case 0xB1: - switch(rep) { + switch(rex.rep) { case 0: - INST_NAME("LOCK CMPXCHG Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - wback = 0; - UFLAG_IF {emit_cmp32(dyn, ninst, rex, xRAX, ed, x3, x4, x5);} - MOVxw_REG(x1, ed); // save value - CMPSxw_REG(xRAX, x1); - B_MARK2(cNE); - MOVxw_REG(ed, gd); - MARK2; - MOVxw_REG(xRAX, x1); - B_NEXT_nocond; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK CMPXCHG Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); + UFLAG_IF { MOVxw_REG(x6, xRAX); } if(!ALIGNED_ATOMICxw) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, wback, 1, 0, 3); // mask = F CMPSw_U12(x1, 16-(1<<(2+rex.w))); B_MARK3(cGT); @@ -340,30 +294,35 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } } // Aligned version - if(arm64_atomics) { + // disabling use of atomics for now, as it seems to make (at least) + // HorizonZeroDawn and Cyberpunk2077 (both from GoG) unstable + // but why?! + if (rex.w /* RAX should NOT be zero-upped if equal */ && cpuext.atomics && 0) { UFLAG_IF { MOVxw_REG(x1, xRAX); - CASALxw(xRAX, gd, wback); - SMDMB(); - emit_cmp32(dyn, ninst, rex, x1, xRAX, x3, x4, x5); + CASALxw(x1, gd, wback); + MOVxw_REG(xRAX, x1); + if (!ALIGNED_ATOMICxw) { + B_MARK_nocond; + } } else { CASALxw(xRAX, gd, wback); - SMDMB(); - } - if(!ALIGNED_ATOMICxw) { - B_NEXT_nocond; + if (!ALIGNED_ATOMICxw) { + B_NEXT_nocond; + } } } else { MARKLOCK; LDAXRxw(x1, wback); CMPSxw_REG(xRAX, x1); - B_MARK(cNE); + Bcond(cNE, 4 + (rex.w ? 8 : 12)); // EAX == Ed STLXRxw(x4, gd, wback); CBNZx_MARKLOCK(x4); - SMDMB(); // done - if(!ALIGNED_ATOMICxw) { + if (!rex.w) { B_MARK_nocond; } + MOVxw_REG(xRAX, x1); + if (!ALIGNED_ATOMICxw) { B_MARK_nocond; } } @@ -372,19 +331,20 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin MARK3; LDRxw_U12(x1, wback, 0); LDAXRB(x3, wback); // dummy read, to arm the write... + SUBxw_UXTB(x3, x3, x1); + CBNZw_MARK3(x3); CMPSxw_REG(xRAX, x1); - B_MARK(cNE); + Bcond(cNE, 4 + (rex.w ? 12 : 16)); // EAX == Ed STLXRB(x4, gd, wback); CBNZx_MARK3(x4); STRxw_U12(gd, wback, 0); - SMDMB(); + if (!rex.w) { B_MARK_nocond; } + MOVxw_REG(xRAX, x1); } - if(!ALIGNED_ATOMICxw || !arm64_atomics) { - MARK; - // Common part (and fallback for EAX != Ed) - UFLAG_IF {emit_cmp32(dyn, ninst, rex, xRAX, x1, x3, x4, x5);} - MOVxw_REG(xRAX, x1); // upper par of RAX will be erase on 32bits, no mater what + MARK; + UFLAG_IF { + emit_cmp32(dyn, ninst, rex, x6, x1, x3, x4, x5); } } break; @@ -394,47 +354,48 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0xB3: - INST_NAME("LOCK BTR Ed, Gd"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); nextop = F8; - GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - wback = 0; - if(rex.w) { - ANDx_mask(x2, gd, 1, 0, 0b00101); //mask=0x000000000000003f - } else { - ANDw_mask(x2, gd, 0, 0b00100); //mask=0x00000001f - } - LSRxw_REG(x4, ed, x2); - if(rex.w) { - ANDx_mask(x4, x4, 1, 0, 0); //mask=1 + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTR Ed, Gd"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); } else { - ANDw_mask(x4, x4, 0, 0); //mask=1 + SETFLAGS(X_CF, SF_SUBSET); } - BFIw(xFlags, x4, F_CF, 1); - MOV32w(x4, 1); - LSLxw_REG(x4, x4, x2); - BICxw_REG(ed, ed, x4); - } else { + GETGD; // Will fetch only 1 byte, to avoid alignment issue ANDw_mask(x2, gd, 0, 0b00010); //mask=0x000000007 addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); ASRx(x1, gd, 3); // r1 = (gd>>3), there might be an issue for negative 32bits values here - ADDx_REG_LSL(x3, wback, x1, 0); //(&ed)+=r1; + if(!rex.w && !rex.is32bits) {SXTWx(x1, x1);} + ADDy_REG_LSL(x3, wback, x1, 0); //(&ed)+=r1; ed = x1; wback = x3; MOV32w(x5, 1); - MARKLOCK; - LDAXRB(ed, wback); - LSRw_REG(x4, ed, x2); - BFIw(xFlags, x4, F_CF, 1); - LSLw_REG(x4, x5, x2); - BICw_REG(ed, ed, x4); - STLXRB(x4, ed, wback); - CBNZw_MARKLOCK(x4); - SMDMB(); + if(cpuext.atomics) { + LSLw_REG(x4, x5, x2); + LDCLRALB(x4, x4, wback); + IFX(X_CF) { + LSRw_REG(x4, x4, x2); + BFIw(xFlags, x4, F_CF, 1); + } + } else { + MARKLOCK; + LDAXRB(ed, wback); + IFX(X_CF) { + LSRw_REG(x4, ed, x2); + BFIw(xFlags, x4, F_CF, 1); + } + LSLw_REG(x4, x5, x2); + BICw_REG(ed, ed, x4); + STLXRB(x4, ed, wback); + CBNZw_MARKLOCK(x4); + } } break; @@ -442,165 +403,212 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop = F8; switch((nextop>>3)&7) { case 4: - INST_NAME("LOCK BT Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); - gd = x2; - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - u8 = F8; - u8&=rex.w?0x3f:0x1f; - BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) - } else { - // Will fetch only 1 byte, to avoid alignment issue - addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - u8 = F8; - if(u8>>3) { - ADDx_U12(x3, wback, u8>>3); - wback = x3; - } - MARKLOCK; - LDAXRB(x1, wback); - ed = x1; - wback = x3; - BFXILxw(xFlags, x1, u8&7, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) - } + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; break; case 5: - INST_NAME("LOCK BTS Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - wback = 0; - u8 = F8; - u8&=(rex.w?0x3f:0x1f); - BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) - TBNZ_NEXT(xFlags, 0); // bit already set, jump to next instruction - MOV32w(x4, 1); - ORRxw_REG_LSL(ed, ed, x4, u8); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK BTS Ed, Ib"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } // Will fetch only 1 byte, to avoid alignment issue - addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1); u8 = F8; if(u8>>3) { ADDx_U12(x3, wback, u8>>3); wback = x3; } ed = x1; - MOV32w(x5, 1); - MARKLOCK; - LDAXRB(ed, wback); - BFXILw(xFlags, ed, u8&7, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) - BFIw(ed, x5, u8&7, 1); - STLXRB(x4, ed, wback); - CBNZw_MARKLOCK(x4); - SMDMB(); + if(cpuext.atomics) { + MOV32w(x4, 1<<(u8&7)); + LDSETB(x4, x4, wback); + IFX(X_CF) { + BFXILw(xFlags, x4, u8&7, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) + } + } else { + MARKLOCK; + LDAXRB(ed, wback); + IFX(X_CF) { + BFXILw(xFlags, ed, u8&7, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) + } + mask = convert_bitmask_xw(1LL<<(u8&7)); + ORRxw_mask(ed, ed, (mask>>12)&1, mask&0x3F, (mask>>6)&0x3F); + STLXRB(x4, ed, wback); + CBNZw_MARKLOCK(x4); + } } break; case 6: - INST_NAME("LOCK BTR Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - wback = 0; - u8 = F8; - u8&=(rex.w?0x3f:0x1f); - BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) - TBZ_NEXT(xFlags, 0); // bit already clear, jump to next instruction - BFCxw(ed, u8, 1); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { - addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); + INST_NAME("LOCK BTR Ed, Ib"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } + addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1); u8 = F8; if(u8>>3) { ADDx_U12(x3, wback, u8>>3); wback = x3; } ed = x1; - MARKLOCK; - LDAXRB(ed, wback); - BFXILw(xFlags, ed, u8&7, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) - BFCw(ed, u8&7, 1); - STLXRB(x4, ed, wback); - CBNZw_MARKLOCK(x4); - SMDMB(); + if(cpuext.atomics) { + MOV32w(x4, 1<<(u8&7)); + LDCLRALB(x4, x4, wback); + IFX(X_CF) { + BFXILw(xFlags, x4, u8&7, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) + } + } else { + MARKLOCK; + LDAXRB(ed, wback); + IFX(X_CF) { + BFXILw(xFlags, ed, u8&7, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) + } + BFCw(ed, u8&7, 1); + STLXRB(x4, ed, wback); + CBNZw_MARKLOCK(x4); + } } break; case 7: - INST_NAME("LOCK BTC Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(x1); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - wback = 0; - u8 = F8; - u8&=(rex.w?0x3f:0x1f); - BFXILxw(xFlags, ed, u8, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) - MOV32w(x4, 1); - EORxw_REG_LSL(ed, ed, x4, u8); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { - addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); + INST_NAME("LOCK BTC Ed, Ib"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } + addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1); u8 = F8; if(u8>>3) { ADDx_U12(x3, wback, u8>>3); wback = x3; } ed = x1; - MOV32w(x5, 1); - MARKLOCK; - LDAXRB(ed, wback); - BFXILw(xFlags, ed, u8&7, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) - EORw_REG_LSL(ed, ed, x5, u8&7); - STLXRB(x4, ed, wback); - CBNZw_MARKLOCK(x4); - SMDMB(); + if(cpuext.atomics) { + MOV32w(x4, 1<<(u8&7)); + LDEORALB(x4, x4, wback); + IFX(X_CF) { + BFXILw(xFlags, x4, u8&7, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) + } + } else { + MARKLOCK; + LDAXRB(ed, wback); + IFX(X_CF) { + BFXILw(xFlags, ed, u8&7, 1); // inject 1 bit from u8 to F_CF (i.e. pos 0) + } + mask = convert_bitmask_xw(1LL<<(u8&7)); + EORxw_mask(ed, ed, (mask>>12)&1, mask&0x3F, (mask>>6)&0x3F); + STLXRB(x4, ed, wback); + CBNZw_MARKLOCK(x4); + } } break; default: DEFAULT; } break; + case 0xBB: + nextop = F8; + if(MODREG) { + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTC Ed, Gd"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL&~X_ZF, SF_SUBSET); + } else { + SETFLAGS(X_CF, SF_SUBSET); + } + GETGD; + // Will fetch only 1 byte, to avoid alignment issue + ANDw_mask(x2, gd, 0, 0b00010); //mask=0x000000007 + addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); + ASRx(x1, gd, 3); // r1 = (gd>>3), there might be an issue for negative 32bits values here + if(!rex.w && !rex.is32bits) {SXTWx(x1, x1);} + ADDy_REG_LSL(x3, wback, x1, 0); //(&ed)+=r1; + ed = x1; + wback = x3; + MOV32w(x5, 1); + if(cpuext.atomics) { + LSLw_REG(x4, x5, x2); + LDEORALB(x4, x4, wback); + IFX(X_CF) { + LSRw_REG(x4, x4, x2); + BFIw(xFlags, x4, F_CF, 1); + } + } else { + MARKLOCK; + LDAXRB(ed, wback); + IFX(X_CF) { + LSRw_REG(x4, ed, x2); + BFIw(xFlags, x4, F_CF, 1); + } + LSLw_REG(x4, x5, x2); + EORw_REG(ed, ed, x4); + STLXRB(x4, ed, wback); + CBNZw_MARKLOCK(x4); + } + } + break; case 0xC0: - switch(rep) { + switch(rex.rep) { case 0: - INST_NAME("LOCK XADD Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGB(x1); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - GETEB(x2, 0); - gd = x2; ed = x1; // swap gd/ed - emit_add8(dyn, ninst, x1, x2, x4, x5); - GBBACK; // gb gets x2 (old ed) - EBBACK; // eb gets x1 (sum) + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK XADD Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGB(x1); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { UFLAG_IF { MOVxw_REG(x3, gd); LDADDALB(x3, gd, wback); - SMDMB(); emit_add8(dyn, ninst, x3, gd, x4, x5); } else { LDADDALB(gd, gd, wback); - SMDMB(); } GBBACK; } else { MARKLOCK; - LDAXRB(x1, wback); - ADDw_REG(x4, x1, gd); + LDAXRB(x5, wback); + ADDw_REG(x4, x5, gd); STLXRB(x3, x4, wback); CBNZx_MARKLOCK(x3); - SMDMB(); IFX(X_ALL|X_PEND) { - MOVxw_REG(x2, x1); + MOVxw_REG(x2, x5); emit_add8(dyn, ninst, x2, gd, x3, x4); } - BFIz(gb1, x1, gb2, 8); + BFIz(gb1, x5, gb2, 8); } } break; @@ -609,22 +617,21 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } break; case 0xC1: - switch(rep) { + switch(rex.rep) { case 0: - INST_NAME("LOCK XADD Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - MOVxw_REG(x1, ed); - MOVxw_REG(ed, gd); - MOVxw_REG(gd, x1); - emit_add32(dyn, ninst, rex, ed, gd, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK XADD Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); if(!ALIGNED_ATOMICxw) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, wback, 1, 0, 3); // mask = F CMPSw_U12(x1, 16-(1<<(2+rex.w))); B_MARK(cGT); @@ -633,18 +640,11 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin B_MARK(cNE); // unaligned } } - if(arm64_atomics) { + if(cpuext.atomics) { UFLAG_IF { - MOVxw_REG(x3, gd); - LDADDALxw(x3, gd, wback); - SMDMB(); - emit_add32(dyn, ninst, rex, x3, gd, x4, x5); + LDADDALxw(gd, x1, wback); } else { LDADDALxw(gd, gd, wback); - SMDMB(); - } - if(!ALIGNED_ATOMICxw) { - B_NEXT_nocond; } } else { MARKLOCK; @@ -652,28 +652,30 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin ADDxw_REG(x4, x1, gd); STLXRxw(x3, x4, wback); CBNZx_MARKLOCK(x3); - SMDMB(); - if(!ALIGNED_ATOMICxw) { - B_MARK2_nocond; - } } if(!ALIGNED_ATOMICxw) { + UFLAG_IF { + B_MARK2_nocond; + } else { + if(!cpuext.atomics) MOVxw_REG(gd, x1); + B_NEXT_nocond; + } MARK; LDRxw_U12(x1, wback, 0); LDAXRB(x4, wback); - BFIxw(x1, x4, 0, 8); + SUBxw_UXTB(x4, x4, x1); + CBNZw_MARK(x4); ADDxw_REG(x4, x1, gd); STLXRB(x3, x4, wback); CBNZx_MARK(x3); STRxw_U12(x4, wback, 0); - SMDMB(); } - if(!ALIGNED_ATOMICxw || !arm64_atomics) { - MARK2; - IFX(X_ALL|X_PEND) { - MOVxw_REG(x2, x1); - emit_add32(dyn, ninst, rex, x2, gd, x3, x4); - } + MARK2; + UFLAG_IF { + MOVxw_REG(x3, x1); + emit_add32(dyn, ninst, rex, x3, gd, x4, x5); + MOVxw_REG(gd, x1); + } else if(!cpuext.atomics || !ALIGNED_ATOMICxw) { MOVxw_REG(gd, x1); } } @@ -688,92 +690,111 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop = F8; switch((nextop>>3)&7) { case 1: - INST_NAME("LOCK CMPXCHG8B Gq, Eq"); - SETFLAGS(X_ZF, SF_SUBSET); - addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(!ALIGNED_ATOMICxw) { - if(arm64_uscat) { - if(rex.w) { - TSTx_mask(wback, 1, 0, 3); - B_MARK2(cNE); - } else { - ANDx_mask(x2, wback, 1, 0, 3); // mask = F - CMPSw_U12(x2, 8); - B_MARK2(cGT); - } + if(MODREG) { + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; + } else { + if (rex.w) { + INST_NAME("LOCK CMPXCHG16B Gq, Eq"); } else { - TSTx_mask(wback, 1, 0, 2+rex.w); // mask=7 or F - B_MARK2(cNE); // unaligned + INST_NAME("LOCK CMPXCHG8B Gq, Eq"); } - } - if(arm64_atomics) { - MOVx_REG(x2, xRAX); - MOVx_REG(x3, xRDX); - MOVx_REG(x4, xRBX); - MOVx_REG(x5, xRCX); - CASPALxw(x2, x4, wback); - UFLAG_IF { - CMPSxw_REG(x2, xRAX); - CCMPxw(x3, xRDX, 0, cEQ); - CSETw(x1, cEQ); - } - MOVx_REG(xRAX, x2); - MOVx_REG(xRDX, x3); + SETFLAGS(X_ZF, SF_SUBSET); + addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); if(!ALIGNED_ATOMICxw) { - B_MARK3_nocond; - } - } else { - MARKLOCK; - LDAXPxw(x2, x3, wback); - CMPSxw_REG(xRAX, x2); - CCMPxw(xRDX, x3, 0, cEQ); - B_MARK(cNE); // EAX!=ED[0] || EDX!=Ed[1] - STLXPxw(x4, xRBX, xRCX, wback); - CBNZx_MARKLOCK(x4); - UFLAG_IF { - MOV32w(x1, 1); - } - B_MARK3_nocond; - MARK; - STLXPxw(x4, x2, x3, wback); // write back, to be sure it was "atomic" - CBNZx_MARKLOCK(x4); - MOVxw_REG(xRAX, x2); - MOVxw_REG(xRDX, x3); - UFLAG_IF { - MOV32w(x1, 0); + if(cpuext.uscat) { + if(rex.w) { + TSTx_mask(wback, 1, 0, 3); + B_MARK2(cNE); + } else { + ANDx_mask(x2, wback, 1, 0, 3); // mask = F + CMPSw_U12(x2, 8); + B_MARK2(cGT); + } + } else { + TSTx_mask(wback, 1, 0, 2+rex.w); // mask=7 or F + B_MARK2(cNE); // unaligned + } } - if(!ALIGNED_ATOMICxw) { + if(cpuext.atomics) { + MOVx_REG(x2, xRAX); + MOVx_REG(x3, xRDX); + MOVx_REG(x4, xRBX); + MOVx_REG(x5, xRCX); + CASPALxw(x2, x4, wback); + UFLAG_IF { + CMPSxw_REG(x2, xRAX); + CCMPxw(x3, xRDX, 0, cEQ); + IFNATIVE(NF_EQ) {} else {CSETw(x1, cEQ);} + } + MOVx_REG(xRAX, x2); + MOVx_REG(xRDX, x3); + if(!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + } + } else { + MARKLOCK; + LDAXPxw(x2, x3, wback); + CMPSxw_REG(xRAX, x2); + CCMPxw(xRDX, x3, 0, cEQ); + B_MARK(cNE); // EAX!=ED[0] || EDX!=Ed[1] + STLXPxw(x4, xRBX, xRCX, wback); + CBNZx_MARKLOCK(x4); + UFLAG_IF { + IFNATIVE(NF_EQ) {} else {MOV32w(x1, 1);} + } B_MARK3_nocond; + MARK; + STLXPxw(x4, x2, x3, wback); // write back, to be sure it was "atomic" + CBNZx_MARKLOCK(x4); + MOVxw_REG(xRAX, x2); + MOVxw_REG(xRDX, x3); + UFLAG_IF { + IFNATIVE(NF_EQ) {} else {MOV32w(x1, 0);} + } + if(!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + } } - } - if(!ALIGNED_ATOMICxw) { - MARK2; - LDPxw_S7_offset(x2, x3, wback, 0); - LDAXRB(x5, wback); - CMPSxw_REG(xRAX, x2); - CCMPxw(xRDX, x3, 0, cEQ); - B_MARKSEG(cNE); // EAX!=ED[0] || EDX!=Ed[1] - STLXRB(x4, xRBX, wback); - CBNZx_MARK2(x4); - STPxw_S7_offset(xRBX, xRCX, wback, 0); - UFLAG_IF { - MOV32w(x1, 1); + if(!ALIGNED_ATOMICxw) { + MARK2; + if(rex.w && BOX64DRENV(dynarec_safeflags)>1) { + // unaligned memory cause a GPF + STORE_XEMU_CALL(xRIP); + CALL_S(const_native_gpf, -1); + LOAD_XEMU_CALL(xRIP); + } else { + LDPxw_S7_offset(x2, x3, wback, 0); + LDAXRB(x5, wback); + SUBxw_UXTB(x5, x5, x2); + CBNZw_MARK2(x5); + CMPSxw_REG(xRAX, x2); + CCMPxw(xRDX, x3, 0, cEQ); + B_MARKSEG(cNE); // EAX!=ED[0] || EDX!=Ed[1] + STLXRB(x4, xRBX, wback); + CBNZx_MARK2(x4); + STPxw_S7_offset(xRBX, xRCX, wback, 0); + UFLAG_IF { + IFNATIVE(NF_EQ) {} else {MOV32w(x1, 1);} + } + B_MARK3_nocond; + MARKSEG; + STLXRB(x4, x5, wback); //write back + CBNZx_MARK2(x4); + MOVxw_REG(xRAX, x2); + MOVxw_REG(xRDX, x3); + UFLAG_IF { + IFNATIVE(NF_EQ) {} else {MOV32w(x1, 0);} + } + } } - B_MARK3_nocond; - MARKSEG; - STLXRB(x4, x5, wback); //write back - CBNZx_MARK2(x4); - MOVxw_REG(xRAX, x2); - MOVxw_REG(xRDX, x3); + MARK3; UFLAG_IF { - MOV32w(x1, 0); + IFNATIVE(NF_EQ) {} else {BFIw(xFlags, x1, F_ZF, 1);} } } - MARK3; - SMDMB(); - UFLAG_IF { - BFIw(xFlags, x1, F_ZF, 1); - } break; default: DEFAULT; @@ -786,62 +807,87 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin break; case 0x10: INST_NAME("LOCK ADC Eb, Gb"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGB(x2); - if((nextop&0xC0)==0xC0) { - if(rex.rex) { - wback = xRAX + (nextop&7) + (rex.b<<3); - wb2 = 0; - } else { - wback = (nextop&7); - wb2 = (wback>>2); - wback = xRAX+(wback&3); - } - UBFXw(x1, wback, wb2*8, 8); - emit_adc8(dyn, ninst, x1, x2, x4, x5); - BFIx(wback, x1, wb2*8, 8); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGB(x2); addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); MARKLOCK; LDAXRB(x1, wback); emit_adc8(dyn, ninst, x1, x2, x4, x5); STLXRB(x4, x1, wback); CBNZx_MARKLOCK(x4); - SMDMB(); } break; case 0x11: - INST_NAME("LOCK ADC Ed, Gd"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_adc32(dyn, ninst, rex, ed, gd, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK ADC Ed, Gd"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); MARKLOCK; LDAXRxw(x1, wback); emit_adc32(dyn, ninst, rex, x1, gd, x4, x5); STLXRxw(x4, x1, wback); CBNZx_MARKLOCK(x4); - SMDMB(); + } + break; + case 0x20: + nextop = F8; + if(MODREG) { + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK AND Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); + GETGB(x5); + if(cpuext.atomics) { + MVNxw_REG(x1, gd); + UFLAG_IF { + LDCLRALB(x1, x1, wback); + emit_and8(dyn, ninst, x1, gd, x3, x4); + } else { + STCLRLB(x1, wback); + } + } else { + MARKLOCK; + LDAXRB(x1, wback); + emit_and8(dyn, ninst, x1, gd, x3, x4); + STLXRB(x3, x1, wback); + CBNZx_MARKLOCK(x3); + } } break; case 0x21: - INST_NAME("LOCK AND Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_and32(dyn, ninst, rex, ed, gd, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK AND Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { MVNxw_REG(x1, gd); UFLAG_IF { LDCLRALxw(x1, x1, wback); @@ -855,23 +901,24 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin emit_and32(dyn, ninst, rex, x1, gd, x3, x4); STLXRxw(x3, x1, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } } break; case 0x29: - INST_NAME("LOCK SUB Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_sub32(dyn, ninst, rex, ed, gd, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK SUB Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); if(!ALIGNED_ATOMICxw) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, wback, 1, 0, 3); // mask = F CMPSw_U12(x1, 16-(1<<(2+rex.w))); B_MARK(cGT); @@ -880,49 +927,57 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin B_MARK(cNE); } } - if(arm64_atomics) { + if(cpuext.atomics && 0) { // disabled because 0x80000000 has no negative NEGxw_REG(x1, gd); UFLAG_IF { LDADDALxw(x1, x1, wback); - emit_sub32(dyn, ninst, rex, x1, gd, x3, x4); } else { STADDLxw(x1, wback); } } else { MARKLOCK; LDAXRxw(x1, wback); - emit_sub32(dyn, ninst, rex, x1, gd, x3, x4); - STLXRxw(x3, x1, wback); + SUBxw_REG(x4, x1, gd); + STLXRxw(x3, x4, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } if(!ALIGNED_ATOMICxw) { - B_NEXT_nocond; + UFLAG_IF { + B_MARK2_nocond; + } else { + B_NEXT_nocond; + } MARK; // unaligned! also, not enough LDRxw_U12(x1, wback, 0); LDAXRB(x4, wback); - BFIxw(x1, x4, 0, 8); // re-inject - emit_sub32(dyn, ninst, rex, x1, gd, x3, x4); - STLXRB(x3, x1, wback); + SUBxw_UXTB(x4, x4, x1); + CBNZw_MARK(x4); + SUBxw_REG(x4, x1, gd); + STLXRB(x3, x4, wback); CBNZx_MARK(x3); - STRxw_U12(x1, wback, 0); // put the whole value - SMDMB(); + STRxw_U12(x4, wback, 0); // put the whole value + } + UFLAG_IF { + MARK2; + emit_sub32(dyn, ninst, rex, x1, gd, x3, x4); } } break; case 0x31: - INST_NAME("LOCK XOR Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; - if((nextop&0xC0)==0xC0) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_xor32(dyn, ninst, rex, ed, gd, x3, x4); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK XOR Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); if(!ALIGNED_ATOMICxw) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, wback, 1, 0, 3); // mask = F CMPSw_U12(x1, 16-(1<<(2+rex.w))); B_MARK(cGT); @@ -931,57 +986,54 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin B_MARK(cNE); } } - if(arm64_atomics) { + if(cpuext.atomics) { UFLAG_IF { LDEORALxw(gd, x1, wback); - emit_xor32(dyn, ninst, rex, x1, gd, x3, x4); } else { STEORLxw(gd, wback); } - SMDMB(); } else { MARKLOCK; LDAXRxw(x1, wback); - emit_xor32(dyn, ninst, rex, x1, gd, x3, x4); - STLXRxw(x3, x1, wback); + EORxw_REG(x4, x1, gd); + STLXRxw(x3, x4, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } if(!ALIGNED_ATOMICxw) { - B_NEXT_nocond; + B_MARK2_nocond; MARK; // unaligned! also, not enough LDRxw_U12(x1, wback, 0); LDAXRB(x4, wback); - BFIxw(x1, x4, 0, 8); // re-inject - emit_xor32(dyn, ninst, rex, x1, gd, x3, x4); - STLXRB(x3, x1, wback); + SUBxw_UXTB(x4, x4, x1); + CBNZw_MARK(x4); + EORxw_REG(x4, x1, gd); + STLXRB(x3, x4, wback); CBNZx_MARK(x3); - STRxw_U12(x1, wback, 0); // put the whole value - SMDMB(); + STRxw_U12(x4, wback, 0); // put the whole value + } + MARK2; + UFLAG_IF { + emit_xor32(dyn, ninst, rex, x1, gd, x3, x4); } } break; - case 0x66: - return dynarec64_66F0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); - case 0x80: nextop = F8; switch((nextop>>3)&7) { case 0: //ADD - INST_NAME("ADD Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - GETEB(x1, 1); - u8 = F8; - emit_add8c(dyn, ninst, x1, u8, x2, x4); - wb1 = 0; - EBBACK; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("ADD Eb, Ib"); + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1); u8 = F8; wb1 = 1; - if(arm64_atomics) { + if(cpuext.atomics) { MOV32w(x2, u8); UFLAG_IF { LDADDALB(x2, x1, wback); @@ -997,23 +1049,21 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRB(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; case 1: //OR - INST_NAME("OR Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - GETEB(x1, 1); - u8 = F8; - emit_or8c(dyn, ninst, x1, u8, x2, x4); - wb1 = 0; - EBBACK; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("OR Eb, Ib"); + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1); u8 = F8; wb1 = 1; - if(arm64_atomics) { + if(cpuext.atomics) { MOV32w(x2, u8); UFLAG_IF { LDSETALB(x2, x1, wback); @@ -1028,20 +1078,18 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRB(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; case 2: //ADC - INST_NAME("ADC Eb, Ib"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - GETEB(x1, 1); - u8 = F8; - emit_adc8c(dyn, ninst, x1, u8, x2, x4, x5); - wb1 = 0; - EBBACK; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("ADC Eb, Ib"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1); u8 = F8; wb1 = 1; @@ -1051,19 +1099,17 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRB(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); break; case 3: //SBB - INST_NAME("SBB Eb, Ib"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - GETEB(x1, 1); - u8 = F8; - emit_sbb8c(dyn, ninst, x1, u8, x2, x4, x5); - wb1 = 0; - EBBACK; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("SBB Eb, Ib"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1); u8 = F8; wb1 = 1; @@ -1073,22 +1119,20 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRB(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); break; case 4: //AND - INST_NAME("AND Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - GETEB(x1, 1); - u8 = F8; - emit_and8c(dyn, ninst, x1, u8, x2, x4); - wb1 = 0; - EBBACK; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("AND Eb, Ib"); + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1); u8 = F8; wb1 = 1; - if(arm64_atomics) { + if(cpuext.atomics) { MOV32w(x2, ~u8); UFLAG_IF { LDCLRALB(x2, x1, wback); @@ -1103,23 +1147,21 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRB(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; case 5: //SUB - INST_NAME("SUB Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - GETEB(x1, 1); - u8 = F8; - emit_sub8c(dyn, ninst, x1, u8, x2, x4, x5); - wb1 = 0; - EBBACK; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("SUB Eb, Ib"); + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1); u8 = F8; wb1 = 1; - if(arm64_atomics) { + if(cpuext.atomics) { MOV32w(x2, -u8); UFLAG_IF { LDADDALB(x2, x1, wback); @@ -1134,27 +1176,25 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRB(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; case 6: //XOR - INST_NAME("XOR Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - GETEB(x1, 1); - u8 = F8; - emit_xor8c(dyn, ninst, x1, u8, x2, x4); - wb1 = 0; - EBBACK; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("XOR Eb, Ib"); + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x5, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 1); u8 = F8; wb1 = 1; - if(arm64_atomics) { + if(cpuext.atomics) { MOV32w(x2, u8); UFLAG_IF { LDEORALB(x2, x1, wback); - emit_xor8(dyn, ninst, x1, x2, x3, x4); + emit_xor8(dyn, ninst, x1, x2, x3, x4); } else { STEORLB(x2, wback); } @@ -1165,20 +1205,13 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRB(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; case 7: //CMP - INST_NAME("CMP Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEB(x1, 1); - u8 = F8; - if(u8) { - MOV32w(x2, u8); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5); - } else { - emit_cmp8_0(dyn, ninst, x1, x3, x4); - } + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; break; default: DEFAULT; @@ -1189,22 +1222,25 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin nextop = F8; switch((nextop>>3)&7) { case 0: //ADD - if(opcode==0x81) { - INST_NAME("LOCK ADD Ed, Id"); - } else { - INST_NAME("LOCK ADD Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i64 = F32S; else i64 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV64xw(x5, i64); - emit_add32(dyn, ninst, rex, ed, x5, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) { + INST_NAME("LOCK ADD Ed, Id"); + } else { + INST_NAME("LOCK ADD Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1); if(opcode==0x81) i64 = F32S; else i64 = F8S; + if((i64<=-0x1000) || (i64>=0x1000)) { + MOV64xw(x5, i64); + } if(!ALIGNED_ATOMICxw) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, wback, 1, 0, 3); // mask = F CMPSw_U12(x1, 16-(1<<(2+rex.w))); B_MARK(cGT); @@ -1213,77 +1249,99 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin B_MARK(cNE); } } - if(arm64_atomics) { - MOV64xw(x3, i64); + if(cpuext.atomics) { + if((i64>-0x1000) && (i64<0x1000)) { + MOV64xw(x5, i64); + } UFLAG_IF { - LDADDALxw(x3, x1, wback); - SMDMB(); - emit_add32(dyn, ninst, rex, x1, x3, x4, x5); + LDADDALxw(x5, x1, wback); } else { - STADDLxw(x3, wback); - SMDMB(); + STADDLxw(x5, wback); } } else { MARKLOCK; LDAXRxw(x1, wback); - emit_add32c(dyn, ninst, rex, x1, i64, x3, x4, x5); - STLXRxw(x3, x1, wback); + if(i64>=0 && i64<0x1000) { + ADDxw_U12(x4, x1, i64); + } else if(i64<0 && i64>-0x1000) { + SUBxw_U12(x4, x1, -i64); + } else { + ADDxw_REG(x4, x1, x5); + } + STLXRxw(x3, x4, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } if(!ALIGNED_ATOMICxw) { - B_NEXT_nocond; + B_MARK2_nocond; MARK; // unaligned! also, not enough LDRxw_U12(x1, wback, 0); LDAXRB(x4, wback); - BFIxw(x1, x4, 0, 8); // re-inject - emit_add32c(dyn, ninst, rex, x1, i64, x3, x4, x5); - STLXRB(x3, x1, wback); + SUBxw_UXTB(x4, x4, x1); + CBNZw_MARK(x4); + if(i64>=0 && i64<0x1000) { + ADDxw_U12(x4, x1, i64); + } else if(i64<0 && i64>-0x1000) { + SUBxw_U12(x4, x1, -i64); + } else { + ADDxw_REG(x4, x1, x5); + } + STLXRB(x3, x4, wback); CBNZx_MARK(x3); - STRxw_U12(x1, wback, 0); // put the whole value - SMDMB(); + STRxw_U12(x4, wback, 0); // put the whole value + } + MARK2; + UFLAG_IF { + if((i64<=-0x1000) || (i64>=0x1000)) { + emit_add32(dyn, ninst, rex, x1, x5, x3, x4); + } else { + emit_add32c(dyn, ninst, rex, x1, i64, x3, x4, x5); + } } } break; case 1: //OR - if(opcode==0x81) {INST_NAME("LOCK OR Ed, Id");} else {INST_NAME("LOCK OR Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i64 = F32S; else i64 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV64xw(x5, i64); - emit_or32(dyn, ninst, rex, ed, x5, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) {INST_NAME("LOCK OR Ed, Id");} else {INST_NAME("LOCK OR Ed, Ib");} + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1); if(opcode==0x81) i64 = F32S; else i64 = F8S; - MOV64xw(x5, i64); - if(arm64_atomics) { - UFLAG_IF { - LDSETALxw(x5, x1, wback); - emit_or32(dyn, ninst, rex, x1, x5, x3, x4); - } else { - STSETLxw(x5, wback); - } + if(wback==xRSP && !i64) { + // this is __faststorefence + DMB_ST(); } else { - MARKLOCK; - LDAXRxw(x1, wback); - emit_or32(dyn, ninst, rex, x1, x5, x3, x4); - STLXRxw(x3, x1, wback); - CBNZx_MARKLOCK(x3); + if(cpuext.atomics) { + MOV64xw(x5, i64); + UFLAG_IF { + LDSETALxw(x5, x1, wback); + emit_or32(dyn, ninst, rex, x1, x5, x3, x4); + } else { + STSETLxw(x5, wback); + } + } else { + MARKLOCK; + LDAXRxw(x1, wback); + emit_or32c(dyn, ninst, rex, x1, i64, x3, x4); + STLXRxw(x3, x1, wback); + CBNZx_MARKLOCK(x3); + } } - SMDMB(); } break; case 2: //ADC - if(opcode==0x81) {INST_NAME("LOCK ADC Ed, Id");} else {INST_NAME("LOCK ADC Ed, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i64 = F32S; else i64 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV64xw(x5, i64); - emit_adc32(dyn, ninst, rex, ed, x5, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) {INST_NAME("LOCK ADC Ed, Id");} else {INST_NAME("LOCK ADC Ed, Ib");} + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1); if(opcode==0x81) i64 = F32S; else i64 = F8S; MOV64xw(x5, i64); @@ -1292,19 +1350,18 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin emit_adc32(dyn, ninst, rex, x1, x5, x3, x4); STLXRxw(x3, x1, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } break; case 3: //SBB - if(opcode==0x81) {INST_NAME("LOCK SBB Ed, Id");} else {INST_NAME("LOCK SBB Ed, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i64 = F32S; else i64 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV64xw(x5, i64); - emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) {INST_NAME("LOCK SBB Ed, Id");} else {INST_NAME("LOCK SBB Ed, Ib");} + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1); if(opcode==0x81) i64 = F32S; else i64 = F8S; MOV64xw(x5, i64); @@ -1313,21 +1370,20 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin emit_sbb32(dyn, ninst, rex, x1, x5, x3, x4); STLXRxw(x3, x1, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } break; case 4: //AND - if(opcode==0x81) {INST_NAME("LOCK AND Ed, Id");} else {INST_NAME("LOCK AND Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i64 = F32S; else i64 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV64xw(x5, i64); - emit_and32(dyn, ninst, rex, ed, x5, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) {INST_NAME("LOCK AND Ed, Id");} else {INST_NAME("LOCK AND Ed, Ib");} + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1); if(opcode==0x81) i64 = F32S; else i64 = F8S; - if(arm64_atomics) { + if(cpuext.atomics) { MOV64xw(x5, ~i64); UFLAG_IF { LDCLRALxw(x5, x1, wback); @@ -1337,29 +1393,30 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STCLRLxw(x5, wback); } } else { - MOV64xw(x5, i64); MARKLOCK; LDAXRxw(x1, wback); - emit_and32(dyn, ninst, rex, x1, x5, x3, x4); + emit_and32c(dyn, ninst, rex, x1, i64, x3, x4); STLXRxw(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; case 5: //SUB - if(opcode==0x81) {INST_NAME("LOCK SUB Ed, Id");} else {INST_NAME("LOCK SUB Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i64 = F32S; else i64 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV64xw(x5, i64); - emit_sub32(dyn, ninst, rex, ed, x5, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) {INST_NAME("LOCK SUB Ed, Id");} else {INST_NAME("LOCK SUB Ed, Ib");} + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1); if(opcode==0x81) i64 = F32S; else i64 = F8S; + if((i64<=-0x1000) || (i64>=0x1000)) { + MOV64xw(x5, i64); + } if(!ALIGNED_ATOMICxw) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, wback, 1, 0, 3); // mask = F CMPSw_U12(x1, 16-(1<<(2+rex.w))); B_MARK(cGT); @@ -1368,52 +1425,77 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin B_MARK(cNE); } } - if(arm64_atomics) { - MOV64xw(x5, -i64); + if(cpuext.atomics) { + if((i64>-0x1000) && (i64<0x1000)) { + MOV64xw(x5, -i64); + } else { + NEGxw_REG(x5, x5); + } UFLAG_IF { LDADDALxw(x5, x1, wback); - SMDMB(); - NEGxw_REG(x5, x5); - emit_sub32(dyn, ninst, rex, x1, x5, x3, x4); + if((i64<=-0x1000) || (i64>=0x1000)) + NEGxw_REG(x5, x5); } else { STADDLxw(x5, wback); - SMDMB(); } } else { MARKLOCK; LDAXRxw(x1, wback); - emit_sub32c(dyn, ninst, rex, x1, i64, x3, x4, x5); - STLXRxw(x3, x1, wback); + if(i64>=0 && i64<0x1000) { + SUBxw_U12(x4, x1, i64); + } else if(i64<0 && i64>-0x1000) { + ADDxw_U12(x4, x1, -i64); + } else { + SUBxw_REG(x4, x1, x5); + } + STLXRxw(x3, x4, wback); CBNZx_MARKLOCK(x3); - SMDMB(); } if(!ALIGNED_ATOMICxw) { - B_NEXT_nocond; + UFLAG_IF { + B_MARK2_nocond; + } else { + B_NEXT_nocond; + } MARK; // unaligned! also, not enough LDRxw_U12(x1, wback, 0); LDAXRB(x4, wback); - BFIxw(x1, x4, 0, 8); // re-inject - emit_sub32c(dyn, ninst, rex, x1, i64, x3, x4, x5); - STLXRB(x3, x1, wback); + SUBxw_UXTB(x4, x4, x1); + CBNZw_MARK(x4); + if(i64>=0 && i64<0x1000) { + SUBxw_U12(x4, x1, i64); + } else if(i64<0 && i64>-0x1000) { + ADDxw_U12(x4, x1, -i64); + } else { + SUBxw_REG(x4, x1, x5); + } + STLXRB(x3, x4, wback); CBNZx_MARK(x3); - STRxw_U12(x1, wback, 0); // put the whole value - SMDMB(); + STRxw_U12(x4, wback, 0); // put the whole value + } + UFLAG_IF { + MARK2; + if((i64<=-0x1000) || (i64>=0x1000)) { + emit_sub32(dyn, ninst, rex, x1, x5, x3, x4); + } else { + emit_sub32c(dyn, ninst, rex, x1, i64, x3, x4, x5); + } } } break; case 6: //XOR - if(opcode==0x81) {INST_NAME("LOCK XOR Ed, Id");} else {INST_NAME("LOCK XOR Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); if(MODREG) { - if(opcode==0x81) i64 = F32S; else i64 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV64xw(x5, i64); - emit_xor32(dyn, ninst, rex, ed, x5, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + if(opcode==0x81) {INST_NAME("LOCK XOR Ed, Id");} else {INST_NAME("LOCK XOR Ed, Ib");} + SETFLAGS(X_ALL, SF_SET_PENDING); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1); if(opcode==0x81) i64 = F32S; else i64 = F8S; - MOV64xw(x5, i64); - if(arm64_atomics) { + if(cpuext.atomics) { + MOV64xw(x5, i64); UFLAG_IF { LDEORALxw(x5, x1, wback); emit_xor32(dyn, ninst, rex, x1, x5, x3, x4); @@ -1423,52 +1505,34 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } else { MARKLOCK; LDAXRxw(x1, wback); - emit_xor32(dyn, ninst, rex, x1, x5, x3, x4); + emit_xor32c(dyn, ninst, rex, x1, i64, x3, x4); STLXRxw(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; case 7: //CMP - if(opcode==0x81) {INST_NAME("(LOCK) CMP Ed, Id");} else {INST_NAME("(LOCK) CMP Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED((opcode==0x81)?4:1); - // No need to LOCK, this is readonly - if(opcode==0x81) i64 = F32S; else i64 = F8S; - if(i64) { - MOV64xw(x5, i64); - emit_cmp32(dyn, ninst, rex, ed, x5, x3, x4, x6); - } else { - emit_cmp32_0(dyn, ninst, rex, ed, x3, x4); - } + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; break; } break; case 0x86: - INST_NAME("LOCK XCHG Eb, Gb"); - // Do the swap nextop = F8; if(MODREG) { - GETGB(x4); - if(rex.rex) { - ed = xRAX+(nextop&7)+(rex.b<<3); - eb1 = ed; - eb2 = 0; - } else { - ed = (nextop&7); - eb1 = xRAX+(ed&3); - eb2 = ((ed&4)<<1); - } - UBFXw(x1, eb1, eb2, 8); - // do the swap 14 -> ed, 1 -> gd - BFIx(gb1, x1, gb2, 8); - BFIx(eb1, x4, eb2, 8); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK XCHG Eb, Gb"); + // Do the swap GETGB(x4); addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { SWPALB(x4, x1, ed); } else { MARKLOCK; @@ -1479,23 +1543,21 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin CBNZx_MARKLOCK(x3); } BFIx(gb1, x1, gb2, 8); - SMDMB(); } break; case 0x87: - INST_NAME("LOCK XCHG Ed, Gd"); nextop = F8; if(MODREG) { - GETGD; - GETED(0); - MOVxw_REG(x1, gd); - MOVxw_REG(gd, ed); - MOVxw_REG(ed, x1); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK XCHG Ed, Gd"); GETGD; addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); if(!ALIGNED_ATOMICxw) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, ed, 1, 0, 3); // mask = F CMPSw_U12(x1, 16-(1<<(2+rex.w))); B_MARK(cGT); @@ -1504,7 +1566,7 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin B_MARK(cNE); } } - if(arm64_atomics) { + if(cpuext.atomics) { SWPALxw(gd, gd, ed); if(!ALIGNED_ATOMICxw) { B_NEXT_nocond; @@ -1521,14 +1583,15 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin if(!ALIGNED_ATOMICxw) { MARK; LDRxw_U12(x1, ed, 0); - LDAXRB(x3, ed); + LDAXRB(x4, ed); + SUBxw_UXTB(x4, x4, x1); + CBNZw_MARK(x4); STLXRB(x3, gd, ed); CBNZx_MARK(x3); STRxw_U12(gd, ed, 0); MARK2; } - SMDMB(); - if(!ALIGNED_ATOMICxw || !arm64_atomics) { + if(!ALIGNED_ATOMICxw || !cpuext.atomics) { MOVxw_REG(gd, x1); } } @@ -1539,28 +1602,58 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: case 1: - INST_NAME("LOCK TEST Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - SMDMB(); - GETEB(x1, 1); - u8 = F8; - MOV32w(x2, u8); - emit_test8(dyn, ninst, x1, x2, x3, x4, x5); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; break; case 2: - INST_NAME("LOCK NOT Eb"); if(MODREG) { - GETEB(x1, 0); - MVNw_REG(x1, x1); - EBBACK; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK NOT Eb"); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LDAXRB(x1, wback); - MVNw_REG(x1, x1); - STLXRB(x3, x1, wback); - CBNZx_MARKLOCK(x3); - SMDMB(); + if(cpuext.atomics) { + MOV32w(x1, 0xff); + STEORLB(x1, wback); + } else { + MARKLOCK; + LDAXRB(x1, wback); + MVNw_REG(x1, x1); + STLXRB(x3, x1, wback); + CBNZx_MARKLOCK(x3); + } + } + break; + default: + DEFAULT; + } + break; + case 0xF7: + nextop = F8; + switch((nextop>>3)&7) { + case 2: + if(MODREG) { + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK NOT Ed"); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); + if(cpuext.atomics) { + MOV64x(x1, ~0LL); + STEORLxw(x1, wback); + } else { + MARKLOCK; + LDAXRxw(x1, wback); + MVNw_REG(x1, x1); + STLXRxw(x3, x1, wback); + CBNZx_MARKLOCK(x3); + } } break; default: @@ -1573,16 +1666,17 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: // INC Eb - INST_NAME("LOCK INC Eb"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); if(MODREG) { - GETEB(x1, 0); - emit_inc8(dyn, ninst, x1, x2, x4); - EBBACK; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK INC Eb"); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); MARKLOCK; - if(arm64_atomics) { + if(cpuext.atomics) { MOV32w(x3, 1); UFLAG_IF { LDADDALB(x3, x1, wback); @@ -1596,19 +1690,19 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRB(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; case 1: //DEC Eb - INST_NAME("LOCK DEC Eb"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); if(MODREG) { - GETEB(x1, 0); - emit_dec8(dyn, ninst, x1, x2, x4); - EBBACK; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK DEC Eb"); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); - if(arm64_atomics) { + if(cpuext.atomics) { MOV32w(x3, -1); UFLAG_IF { LDADDALB(x3, x1, wback); @@ -1623,7 +1717,6 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin STLXRB(x3, x1, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); } break; default: @@ -1635,15 +1728,17 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin switch((nextop>>3)&7) { case 0: // INC Ed - INST_NAME("LOCK INC Ed"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_inc32(dyn, ninst, rex, ed, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK INC Ed"); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); if(!ALIGNED_ATOMICxw) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, wback, 1, 0, 3); // mask = F CMPSw_U12(x1, 16-(1<<(2+rex.w))); B_MARK(cGT); @@ -1652,46 +1747,54 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin B_MARK(cNE); // unaligned } } - if(arm64_atomics) { + if(cpuext.atomics) { MOV32w(x3, 1); UFLAG_IF { LDADDALxw(x3, x1, wback); - emit_inc32(dyn, ninst, rex, x1, x3, x4); } else { STADDLxw(x3, wback); } } else { MARKLOCK; LDAXRxw(x1, wback); - emit_inc32(dyn, ninst, rex, x1, x3, x4); - STLXRxw(x3, x1, wback); + ADDxw_U12(x4, x1, 1); + STLXRxw(x3, x4, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); if(!ALIGNED_ATOMICxw) { - B_NEXT_nocond; + UFLAG_IF { + B_MARK2_nocond; + } else { + B_NEXT_nocond; + } MARK; LDRxw_U12(x1, wback, 0); LDAXRB(x4, wback); - BFIxw(x1, x4, 0, 8); // re-inject - emit_inc32(dyn, ninst, rex, x1, x3, x4); - STLXRB(x3, x1, wback); + SUBxw_UXTB(x4, x4, x1); + CBNZw_MARK(x4); + ADDxw_U12(x4, x1, 1); + STLXRB(x3, x4, wback); CBNZw_MARK(x3); - STRxw_U12(x1, wback, 0); - SMDMB(); + STRxw_U12(x4, wback, 0); + } + UFLAG_IF { + MARK2; + emit_inc32(dyn, ninst, rex, x1, x3, x4); } } break; case 1: //DEC Ed - INST_NAME("LOCK DEC Ed"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_dec32(dyn, ninst, rex, ed, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK DEC Ed"); + SETFLAGS(X_ALL&~X_CF, SF_SUBSET); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, LOCK_LOCK, 0, 0); if(!ALIGNED_ATOMICxw) { - if(arm64_uscat) { + if(cpuext.uscat) { ANDx_mask(x1, wback, 1, 0, 3); // mask = F CMPSw_U12(x1, 16-(1<<(2+rex.w))); B_MARK(cGT); @@ -1700,38 +1803,48 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin B_MARK(cNE); // unaligned } } - if(arm64_atomics) { + if(cpuext.atomics) { MOV64xw(x3, -1); UFLAG_IF { LDADDALxw(x3, x1, wback); - emit_dec32(dyn, ninst, rex, x1, x3, x4); } else { STADDLxw(x3, wback); } } else { MARKLOCK; LDAXRxw(x1, wback); - emit_dec32(dyn, ninst, rex, x1, x3, x4); - STLXRxw(x3, x1, wback); + SUBxw_U12(x4, x1, 1); + STLXRxw(x3, x4, wback); CBNZx_MARKLOCK(x3); } - SMDMB(); if(!ALIGNED_ATOMICxw) { - B_NEXT_nocond; + UFLAG_IF { + B_MARK2_nocond; + } else { + B_NEXT_nocond; + } MARK; LDRxw_U12(x1, wback, 0); LDAXRB(x4, wback); - BFIxw(x1, x4, 0, 8); // re-inject - emit_dec32(dyn, ninst, rex, x1, x3, x4); - STLXRB(x3, x1, wback); + SUBxw_UXTB(x4, x4, x1); + CBNZw_MARK(x4); + SUBxw_U12(x4, x1, 1); + STLXRB(x3, x4, wback); CBNZw_MARK(x3); - STRxw_U12(x1, wback, 0); - SMDMB(); + STRxw_U12(x4, wback, 0); + } + UFLAG_IF { + MARK2; + emit_dec32(dyn, ninst, rex, x1, x3, x4); } } break; default: - DEFAULT; + INST_NAME("Invalid LOCK"); + UDF(0); + *need_epilog = 1; + *ok = 0; + break; } break; diff --git a/src/dynarec/arm64/dynarec_arm64_f20f.c b/src/dynarec/arm64/dynarec_arm64_f20f.c index 8c0cb3b..5676a97 100644 --- a/src/dynarec/arm64/dynarec_arm64_f20f.c +++ b/src/dynarec/arm64/dynarec_arm64_f20f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,7 +17,7 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { @@ -31,8 +29,10 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n uint8_t wback, wb1, wb2; uint8_t u8; uint64_t u64, j64; + int32_t i32, i32_; + int cacheupd = 0; int v0, v1; - int q0; + int q0, q1; int d0, d1; int64_t fixedaddress; int unscaled; @@ -40,6 +40,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n MAYUSE(d0); MAYUSE(d1); MAYUSE(q0); + MAYUSE(q1); MAYUSE(v0); MAYUSE(v1); @@ -71,7 +72,6 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n d0 = sse_get_reg(dyn, ninst, x1, ed, 1); VMOVeD(d0, 0, v0, 0); } else { - WILLWRITE2(); addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0); VST64(v0, ed, fixedaddress); SMWRITE2(); @@ -99,11 +99,17 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(v0, 1); GETED(0); d1 = fpu_get_scratch(dyn, ninst); + if(BOX64ENV(dynarec_fastround)<2) { + u8 = sse_setround(dyn, ninst, x3, x4, x5); + } if(rex.w) { SCVTFDx(d1, ed); } else { SCVTFDw(d1, ed); } + if(BOX64ENV(dynarec_fastround)<2) { + x87_restoreround(dyn, ninst, u8); + } VMOVeD(v0, 0, d1, 0); break; @@ -112,13 +118,23 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETGD; GETEXSD(q0, 0, 0); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit MSR_fpsr(x5); } - FCVTZSxwD(gd, q0); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && cpuext.frintts) { + v0 = fpu_get_scratch(dyn, ninst); + if(rex.w) { + FRINT64ZD(v0, q0); + } else { + FRINT32ZD(v0, q0); + } + FCVTZSxwD(gd, v0); + } else { + FCVTZSxwD(gd, q0); + } + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); // get back FPSR to check the IOC bit TBZ_NEXT(x5, FPSR_IOC); if(rex.w) { @@ -133,17 +149,25 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETGD; GETEXSD(q0, 0, 0); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit MSR_fpsr(x5); } u8 = sse_setround(dyn, ninst, x1, x2, x3); d1 = fpu_get_scratch(dyn, ninst); - FRINTID(d1, q0); + if(!BOX64ENV(dynarec_fastround) && cpuext.frintts) { + if(rex.w) { + FRINT64XD(d1, q0); + } else { + FRINT32XD(d1, q0); + } + } else { + FRINTID(d1, q0); + } x87_restoreround(dyn, ninst, u8); FCVTZSxwD(gd, d1); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); // get back FPSR to check the IOC bit TBZ_NEXT(x5, FPSR_IOC); if(rex.w) { @@ -163,7 +187,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETEB(x1, 0); GETGD; - if(arm64_crc32) { + if(cpuext.crc32) { CRC32CB(gd, gd, ed); } else { EORw_REG(gd, gd, ed); @@ -180,7 +204,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETED(0); GETGD; - if(arm64_crc32) { + if(cpuext.crc32) { CRC32Cxw(gd, gd, ed); } else { MOV32w(x2, 0x82f63b78); @@ -205,19 +229,23 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0x51: INST_NAME("SQRTSD Gx, Ex"); nextop = F8; - GETGX(v0, 1); + GETGX(q0, 1); d1 = fpu_get_scratch(dyn, ninst); GETEXSD(d0, 0, 0); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn, ninst); v1 = fpu_get_scratch(dyn, ninst); - FCMLTD_0(v1, d0); - SHL_64(v1, v1, 63); + // check if any input value was NAN + FCMEQD(v0, d0, d0); // 0 if NAN, 1 if not NAN FSQRTD(d1, d0); - VORR(d1, d1, v1); + FCMEQD(v1, d1, d1); // 0 => out is NAN + VBIC(v1, v0, v1); // forget it in any input was a NAN already + SHL_64(v1, v1, 63); // only keep the sign bit + VORR(d1, d1, v1); // NAN -> -NAN } else { FSQRTD(d1, d0); } - VMOVeD(v0, 0, d1, 0); + VMOVeD(q0, 0, d1, 0); break; case 0x58: @@ -226,7 +254,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(d1, 1); v1 = fpu_get_scratch(dyn, ninst); GETEXSD(d0, 0, 0); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { v0 = fpu_get_scratch(dyn, ninst); q0 = fpu_get_scratch(dyn, ninst); // check if any input value was NAN @@ -248,7 +276,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(d1, 1); v1 = fpu_get_scratch(dyn, ninst); GETEXSD(d0, 0, 0); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { v0 = fpu_get_scratch(dyn, ninst); q0 = fpu_get_scratch(dyn, ninst); // check if any input value was NAN @@ -270,7 +298,13 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(v0, 1); GETEXSD(d0, 0, 0); d1 = fpu_get_scratch(dyn, ninst); - FCVT_S_D(d1, d0); + if(BOX64ENV(dynarec_fastround)>1) { + FCVT_S_D(d1, d0); + } else { + u8 = sse_setround(dyn, ninst, x1, x2, x3); + FCVT_S_D(d1, d0); + x87_restoreround(dyn, ninst, u8); + } VMOVeS(v0, 0, d1, 0); break; @@ -280,7 +314,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(d1, 1); v1 = fpu_get_scratch(dyn, ninst); GETEXSD(d0, 0, 0); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { v0 = fpu_get_scratch(dyn, ninst); q0 = fpu_get_scratch(dyn, ninst); // check if any input value was NAN @@ -302,15 +336,9 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(v0, 1); GETEXSD(v1, 0, 0); // MINSD: if any input is NaN, or Ex[0] Gx[0] - #if 0 - d0 = fpu_get_scratch(dyn, ninst); - FMINNMD(d0, v0, v1); // NaN handling may be slightly different, is that a problem? - VMOVeD(v0, 0, d0, 0); // to not erase uper part - #else FCMPD(v0, v1); - B_NEXT(cCC); //Less than + B_NEXT(cCC); //CC invert of CS: NAN or == or Gx > Ex VMOVeD(v0, 0, v1, 0); // to not erase uper part - #endif break; case 0x5E: INST_NAME("DIVSD Gx, Ex"); @@ -318,7 +346,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(v0, 1); d1 = fpu_get_scratch(dyn, ninst); GETEXSD(v1, 0, 0); - if(!box64_dynarec_fastnan) { + if(!BOX64ENV(dynarec_fastnan)) { d0 = fpu_get_scratch(dyn, ninst); q0 = fpu_get_scratch(dyn, ninst); // check if any input value was NAN @@ -340,15 +368,9 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(v0, 1); GETEXSD(v1, 0, 0); // MAXSD: if any input is NaN, or Ex[0]>Gx[0], copy Ex[0] -> Gx[0] - #if 0 - d0 = fpu_get_scratch(dyn, ninst); - FMAXNMD(d0, v0, v1); // NaN handling may be slightly different, is that a problem? - VMOVeD(v0, 0, d0, 0); // to not erase uper part - #else - FCMPD(v0, v1); - B_NEXT(cGT); //Greater than + FCMPD(v1, v0); + B_NEXT(cCC); //CC invert of CS: NAN or == or Ex > Gx VMOVeD(v0, 0, v1, 0); // to not erase uper part - #endif break; case 0x70: @@ -387,33 +409,80 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0x7C: INST_NAME("HADDPS Gx, Ex"); nextop = F8; - GETGX(v0, 1); - if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); - } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + GETGX(q1, 1); + GETEX(q0, 0, 0); + if(!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn, ninst); v1 = fpu_get_scratch(dyn, ninst); - VLD128(v1, ed, fixedaddress); + // check if any input value was NAN + VFMAXPQS(v0, q1, q0); // propagate NAN + VFCMEQQS(v0, v0, v0); // 0 if NAN, 1 if not NAN + } + VFADDPQS(q1, q1, q0); + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(v1, q1, q1); // 0 => out is NAN + VBICQ(v1, v0, v1); // forget it in any input was a NAN already + VSHLQ_32(v1, v1, 31); // only keep the sign bit + VORRQ(q1, q1, v1); // NAN -> -NAN } - VFADDPQS(v0, v0, v1); break; case 0x7D: INST_NAME("HSUBPS Gx, Ex"); nextop = F8; GETGX(v0, 1); - if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); - } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); - v1 = fpu_get_scratch(dyn, ninst); - VLD128(v1, ed, fixedaddress); - } + GETEX(v1, 0, 0); d0 = fpu_get_scratch(dyn, ninst); VUZP1Q_32(d0, v0, v1); VUZP2Q_32(v0, v0, v1); + if(!BOX64ENV(dynarec_fastnan)) { + d1 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + VFMAXQS(d1, d0, v0); // propagate NAN + VFCMEQQS(d1, d1, d1); // 0 if NAN, 1 if not NAN + } VFSUBQS(v0, d0, v0); + if(!BOX64ENV(dynarec_fastnan)) { + VFCMEQQS(d0, v0, v0); // 0 => out is NAN + VBICQ(d1, d1, d0); // forget it in any input was a NAN already + VSHLQ_32(d1, d1, 31); // only keep the sign bit + VORRQ(v0, v0, d1); // NAN -> -NAN + } break; + #define GO(GETFLAGS, NO, YES, F) \ + READFLAGS(F); \ + i32_ = F32S; \ + if(rex.is32bits) \ + j64 = (uint32_t)(addr+i32_); \ + else \ + j64 = addr+i32_; \ + JUMP(j64, 1); \ + GETFLAGS; \ + if(dyn->insts[ninst].x64.jmp_insts==-1 || \ + CHECK_CACHE()) { \ + /* out of the block */ \ + i32 = dyn->insts[ninst].epilog-(dyn->native_size); \ + Bcond(NO, i32); \ + if(dyn->insts[ninst].x64.jmp_insts==-1) { \ + if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \ + fpu_purgecache(dyn, ninst, 1, x1, x2, x3, 0); \ + jump_to_next(dyn, j64, 0, ninst, rex.is32bits); \ + } else { \ + CacheTransform(dyn, ninst, cacheupd); \ + i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ + SKIP_SEVL(i32); \ + B(i32); \ + } \ + } else { \ + /* inside the block */ \ + i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ + SKIP_SEVL(i32); \ + Bcond(YES, i32); \ + } + + GOCOND(0x80, "J", "Id"); + #undef GO + case 0xAE: nextop = F8; switch((nextop>>3)&7) { @@ -453,9 +522,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(v0, 1); GETEX(v1, 0, 0); q0 = fpu_get_scratch(dyn, ninst); - static float addsubps[4] = {-1.f, 1.f, -1.f, 1.f}; - MAYUSE(addsubps); - TABLE64(x2, (uintptr_t)&addsubps); + TABLE64C(x2, const_4f_m1_1_m1_1); VLDR128_U12(q0, x2, 0); VFMLAQS(v0, v1, q0); break; @@ -473,7 +540,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETEX(v1, 0, 0); GETGX_empty(v0); - if(box64_dynarec_fastround) { + if(BOX64ENV(dynarec_fastround)) { u8 = sse_setround(dyn, ninst, x1, x2, x3); VFRINTIDQ(v0, v1); x87_restoreround(dyn, ninst, u8); @@ -481,28 +548,32 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n SQXTN_32(v0, v0); // convert int64 -> int32 with saturation in lower part, RaZ high part } else { u8 = sse_setround(dyn, ninst, x1, x2, x3); - MRS_fpsr(x5); - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - ORRw_mask(x4, xZR, 1, 0); //0x80000000 - d0 = fpu_get_scratch(dyn, ninst); - for(int i=0; i<2; ++i) { - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - if(i) { - VMOVeD(d0, 0, v1, i); - FRINTID(d0, d0); - } else { - FRINTID(d0, v1); + if(cpuext.frintts) { + VFRINT32XDQ(v0, v1); // round, handling of overflow and Nan to 0x80000000 + VFCVTNSQD(v0, v0); // convert double -> int64 + SQXTN_32(v0, v0); // convert int64 -> int32 with saturation in lower part, RaZ high part + } else { + MRS_fpsr(x5); + ORRw_mask(x4, xZR, 1, 0); //0x80000000 + d0 = fpu_get_scratch(dyn, ninst); + for(int i=0; i<2; ++i) { + BFCw(x5, FPSR_IOC, 1); // reset IOC bit + MSR_fpsr(x5); + if(i) { + VMOVeD(d0, 0, v1, i); + FRINTID(d0, d0); + } else { + FRINTID(d0, v1); + } + FCVTZSwD(x1, d0); + MRS_fpsr(x5); // get back FPSR to check the IOC bit + TBZ(x5, FPSR_IOC, 4+4); + MOVw_REG(x1, x4); + VMOVQSfrom(v0, i, x1); } - FCVTZSwD(x1, d0); - MRS_fpsr(x5); // get back FPSR to check the IOC bit - TBZ(x5, FPSR_IOC, 4+4); - MOVw_REG(x1, x4); - VMOVQSfrom(v0, i, x1); + VMOVQDfrom(v0, 1, xZR); } x87_restoreround(dyn, ninst, u8); - VMOVQDfrom(v0, 1, xZR); } break; @@ -517,7 +588,7 @@ uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } else { v0 = sse_get_reg_empty(dyn, ninst, x1, gd); SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 7, rex, NULL, 0, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); VLD128(v0, ed, fixedaddress); } break; diff --git a/src/dynarec/arm64/dynarec_arm64_f30f.c b/src/dynarec/arm64/dynarec_arm64_f30f.c index 2cf4024..042956b 100644 --- a/src/dynarec/arm64/dynarec_arm64_f30f.c +++ b/src/dynarec/arm64/dynarec_arm64_f30f.c @@ -5,21 +5,19 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" +#include "box64cpu.h" #include "emu/x64run_private.h" -#include "x64run.h" +#include "emu/x64emu_private.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" -#include "emu/x64run_private.h" #include "x64trace.h" #include "dynarec_native.h" #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { @@ -79,30 +77,14 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0x12: INST_NAME("MOVSLDUP Gx, Ex"); nextop = F8; - if(MODREG) { - q1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); - } else { - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); - q1 = fpu_get_scratch(dyn, ninst); - VLD128(q1, ed, fixedaddress); - } - GETGX_empty(q0); + GETGX_empty_EX(q0, q1, 0); VTRNQ1_32(q0, q1, q1); break; case 0x16: INST_NAME("MOVSHDUP Gx, Ex"); nextop = F8; - if(MODREG) { - q1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); - } else { - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); - q1 = fpu_get_scratch(dyn, ninst); - VLD128(q1, ed, fixedaddress); - } - GETGX_empty(q0); + GETGX_empty_EX(q0, q1, 0); VTRNQ2_32(q0, q1, q1); break; @@ -118,11 +100,17 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(v0, 1); GETED(0); d1 = fpu_get_scratch(dyn, ninst); + if(BOX64ENV(dynarec_fastround)<2) { + u8 = sse_setround(dyn, ninst, x3, x4, x5); + } if(rex.w) { SCVTFSx(d1, ed); } else { SCVTFSw(d1, ed); } + if(BOX64ENV(dynarec_fastround)<2) { + x87_restoreround(dyn, ninst, u8); + } VMOVeS(v0, 0, d1, 0); break; @@ -131,13 +119,23 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETGD; GETEXSS(d0, 0, 0); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit MSR_fpsr(x5); } - FCVTZSxwS(gd, d0); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && cpuext.frintts) { + v0 = fpu_get_scratch(dyn, ninst); + if(rex.w) { + FRINT64ZS(v0, d0); + } else { + FRINT32ZS(v0, d0); + } + FCVTZSxwS(gd, v0); + } else { + FCVTZSxwS(gd, d0); + } + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); // get back FPSR to check the IOC bit TBZ_NEXT(x5, FPSR_IOC); if(rex.w) { @@ -152,17 +150,25 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETGD; GETEXSS(q0, 0, 0); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit MSR_fpsr(x5); } u8 = sse_setround(dyn, ninst, x1, x2, x3); d1 = fpu_get_scratch(dyn, ninst); - FRINTIS(d1, q0); + if(!BOX64ENV(dynarec_fastround) && cpuext.frintts) { + if(rex.w) { + FRINT64XS(d1, q0); + } else { + FRINT32XS(d1, q0); + } + } else { + FRINTIS(d1, q0); + } x87_restoreround(dyn, ninst, u8); FCVTZSxwS(gd, d1); - if(!box64_dynarec_fastround) { + if(!BOX64ENV(dynarec_fastround) && !cpuext.frintts) { MRS_fpsr(x5); // get back FPSR to check the IOC bit TBZ_NEXT(x5, FPSR_IOC); if(rex.w) { @@ -184,10 +190,14 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n SETFLAGS(X_OF, SF_SUBSET); GETED(0); GETGD; - MRS_nzvc(x3); - LSRw(x4, xFlags, F_OF); - BFIx(x3, x4, 29, 1); // set C - MSR_nzvc(x3); // load CC into ARM CF + MRS_nzcv(x3); + IFNATIVE_BEFORE(NF_VF) { + LSRw(x4, x3, NZCV_V); + } else { + LSRw(x4, xFlags, F_OF); + } + BFIx(x3, x4, NZCV_C, 1); // set C + MSR_nzcv(x3); // load CC into ARM CF IFX(X_OF) { ADCSxw_REG(gd, gd, ed); CSETw(x3, cCS); @@ -202,14 +212,44 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } break; + #define GO(GETFLAGS, NO, YES, F) \ + READFLAGS(F); \ + GETFLAGS; \ + nextop = F8; \ + GETGD; \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + CSELxw(gd, ed, gd, YES); \ + } else { \ + addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff << (2 + rex.w), (1 << (2 + rex.w)) - 1, rex, NULL, 0, 0); \ + Bcond(NO, +8); \ + LDxw(gd, ed, fixedaddress); \ + if (!rex.w) { MOVw_REG(gd, gd); } \ + } + + GOCOND(0x40, "CMOV", "Gd, Ed"); + #undef GO + case 0x51: INST_NAME("SQRTSS Gx, Ex"); nextop = F8; - GETGX(v0, 1); + GETGX(q0, 1); d1 = fpu_get_scratch(dyn, ninst); GETEXSS(d0, 0, 0); - FSQRTS(d1, d0); - VMOVeS(v0, 0, d1, 0); + if(!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn, ninst); + v1 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FCMEQS(v0, d0, d0); // 0 if NAN, 1 if not NAN + FSQRTS(d1, d0); + FCMEQS(v1, d1, d1); // 0 => out is NAN + VBIC(v1, v0, v1); // forget it in any input was a NAN already + VSHL_32(v1, v1, 31); // only keep the sign bit + VORR(d1, d1, v1); // NAN -> -NAN + } else { + FSQRTS(d1, d0); + } + VMOVeS(q0, 0, d1, 0); break; case 0x52: INST_NAME("RSQRTSS Gx, Ex"); @@ -242,20 +282,46 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0x58: INST_NAME("ADDSS Gx, Ex"); nextop = F8; - GETGX(v0, 1); - d1 = fpu_get_scratch(dyn, ninst); + GETGX(d1, 1); + v1 = fpu_get_scratch(dyn, ninst); GETEXSS(d0, 0, 0); - FADDS(d1, v0, d0); // the high part of the vector is erased... - VMOVeS(v0, 0, d1, 0); + if(!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FMAXS(v0, d0, d1); // propagate NAN + FCMEQS(v0, v0, v0); // 0 if NAN, 1 if not NAN + FADDS(v1, d1, d0); // the high part of the vector is erased... + FCMEQS(q0, v1, v1); // 0 => out is NAN + VBIC(q0, v0, q0); // forget it in any input was a NAN already + VSHL_32(q0, q0, 31); // only keep the sign bit + VORR(v1, v1, q0); // NAN -> -NAN + } else { + FADDS(v1, d1, d0); // the high part of the vector is erased... + } + VMOVeS(d1, 0, v1, 0); break; case 0x59: INST_NAME("MULSS Gx, Ex"); nextop = F8; - GETGX(v0, 1); - d1 = fpu_get_scratch(dyn, ninst); + GETGX(d1, 1); + v1 = fpu_get_scratch(dyn, ninst); GETEXSS(d0, 0, 0); - FMULS(d1, v0, d0); - VMOVeS(v0, 0, d1, 0); + if(!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FMAXS(v0, d0, d1); // propagate NAN + FCMEQS(v0, v0, v0); // 0 if NAN, 1 if not NAN + FMULS(v1, d1, d0); // the high part of the vector is erased... + FCMEQS(q0, v1, v1); // 0 => out is NAN + VBIC(q0, v0, q0); // forget it in any input was a NAN already + VSHL_32(q0, q0, 31); // only keep the sign bit + VORR(v1, v1, q0); // NAN -> -NAN + } else { + FMULS(v1, d1, d0); // the high part of the vector is erased... + } + VMOVeS(d1, 0, v1, 0); break; case 0x5A: INST_NAME("CVTSS2SD Gx, Ex"); @@ -271,34 +337,67 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n nextop = F8; GETEX(v1, 0, 0) ; GETGX_empty(v0); - if(box64_dynarec_fastround) { + if(BOX64ENV(dynarec_fastround)) { VFCVTZSQS(v0, v1); } else { - MRS_fpsr(x5); - BFCw(x5, FPSR_IOC, 1); // reset IOC bit - MSR_fpsr(x5); - ORRw_mask(x4, xZR, 1, 0); //0x80000000 - d0 = fpu_get_scratch(dyn, ninst); - for(int i=0; i<4; ++i) { + if(cpuext.frintts) { + VFRINT32ZSQ(v0, v1); + VFCVTZSQS(v0, v0); + } else { + // try to transform the 4 values first, then fall back to 1 at time if needed + MRS_fpsr(x5); BFCw(x5, FPSR_IOC, 1); // reset IOC bit MSR_fpsr(x5); - VMOVeS(d0, 0, v1, i); - VFCVTZSs(d0, d0); + d0 = fpu_get_scratch(dyn, ninst); + if(v0!=v1) { + VFCVTZSQS(v0, v1); + } else { + VFCVTZSQS(d0, v1); + } MRS_fpsr(x5); // get back FPSR to check the IOC bit - TBZ(x5, FPSR_IOC, 4+4); - VMOVQSfrom(d0, 0, x4); - VMOVeS(v0, i, d0, 0); + if(v0!=v1) { + TBZ_NEXT(x5, FPSR_IOC); + } else { + TBNZ_MARK(x5, FPSR_IOC); + VMOVQ(v0, d0); + B_NEXT_nocond; + MARK; + } + ORRw_mask(x4, xZR, 1, 0); //0x80000000 + for(int i=0; i<4; ++i) { + BFCw(x5, FPSR_IOC, 1); // reset IOC bit + MSR_fpsr(x5); + VMOVeS(d0, 0, v1, i); + VFCVTZSs(d0, d0); + MRS_fpsr(x5); // get back FPSR to check the IOC bit + TBZ(x5, FPSR_IOC, 4+4); + VMOVQSfrom(d0, 0, x4); + VMOVeS(v0, i, d0, 0); + } } } break; case 0x5C: INST_NAME("SUBSS Gx, Ex"); nextop = F8; - GETGX(v0, 1); - d1 = fpu_get_scratch(dyn, ninst); + GETGX(d1, 1); + v1 = fpu_get_scratch(dyn, ninst); GETEXSS(d0, 0, 0); - FSUBS(d1, v0, d0); - VMOVeS(v0, 0, d1, 0); + if(!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FMAXS(v0, d0, d1); // propagate NAN + FCMEQS(v0, v0, v0); // 0 if NAN, 1 if not NAN + FSUBS(v1, d1, d0); // the high part of the vector is erased... + FCMEQS(q0, v1, v1); // 0 => out is NAN + VBIC(q0, v0, q0); // forget it in any input was a NAN already + VSHL_32(q0, q0, 31); // only keep the sign bit + VORR(v1, v1, q0); // NAN -> -NAN + } else { + FSUBS(v1, d1, d0); // the high part of the vector is erased... + } + VMOVeS(d1, 0, v1, 0); break; case 0x5D: INST_NAME("MINSS Gx, Ex"); @@ -306,24 +405,31 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(v0, 1); GETEXSS(v1, 0, 0); // MINSS: if any input is NaN, or Ex[0] Gx[0] - #if 0 - d0 = fpu_get_scratch(dyn, ninst); - FMINNMS(d0, v0, v1); // NaN handling may be slightly different, is that a problem? - VMOVeS(v0, 0, d0, 0); // to not erase uper part - #else FCMPS(v0, v1); - B_NEXT(cLS); //Less than or equal + B_NEXT(cCC); //CC invert of CS: NAN or == or Gx > Ex VMOVeS(v0, 0, v1, 0); // to not erase uper part - #endif break; case 0x5E: INST_NAME("DIVSS Gx, Ex"); nextop = F8; - GETGX(v0, 1); - d1 = fpu_get_scratch(dyn, ninst); + GETGX(d1, 1); + v1 = fpu_get_scratch(dyn, ninst); GETEXSS(d0, 0, 0); - FDIVS(d1, v0, d0); - VMOVeS(v0, 0, d1, 0); + if(!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn, ninst); + q0 = fpu_get_scratch(dyn, ninst); + // check if any input value was NAN + FMAXS(v0, d0, d1); // propagate NAN + FCMEQS(v0, v0, v0); // 0 if NAN, 1 if not NAN + FDIVS(v1, d1, d0); // the high part of the vector is erased... + FCMEQS(q0, v1, v1); // 0 => out is NAN + VBIC(q0, v0, q0); // forget it in any input was a NAN already + VSHL_32(q0, q0, 31); // only keep the sign bit + VORR(v1, v1, q0); // NAN -> -NAN + } else { + FDIVS(v1, d1, d0); // the high part of the vector is erased... + } + VMOVeS(d1, 0, v1, 0); break; case 0x5F: INST_NAME("MAXSS Gx, Ex"); @@ -331,23 +437,16 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n GETGX(v0, 1); GETEXSS(v1, 0, 0); // MAXSS: if any input is NaN, or Ex[0]>Gx[0], copy Ex[0] -> Gx[0] - #if 0 - d0 = fpu_get_scratch(dyn, ninst); - FMAXNMS(d0, v0, v1); // NaN handling may be slightly different, is that a problem? - VMOVeS(v0, 0, d0, 0); // to not erase uper part - #else - FCMPS(v0, v1); - B_NEXT(cGE); //Greater than or equal + FCMPS(v1, v0); + B_NEXT(cCC); //CC: invert of CS: NAN or == or Ex > Gx VMOVeS(v0, 0, v1, 0); // to not erase uper part - #endif break; case 0x6F: INST_NAME("MOVDQU Gx,Ex");// no alignment constraint on NEON here, so same as MOVDQA nextop = F8; if(MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0); - GETGX_empty(v0); + GETGX_empty_EX(v0, v1, 0); VMOVQ(v0, v1); } else { GETGX_empty(v0); @@ -404,8 +503,17 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7) + (rex.b<<3)); VMOVQ(v1, v0); } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); - VST128(v0, ed, fixedaddress); + IF_UNALIGNED(ip) { + MESSAGE(LOG_DEBUG, "\tUnaligned path"); + addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); + for(int i=0; i<16; ++i) { + VST1_8(v0, i, i?x1:wback); + ADDx_U12(x1, i?x1:wback, 1); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0); + VST128(v0, ed, fixedaddress); + } SMWRITE2(); } break; @@ -413,15 +521,37 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0xAE: nextop = F8; switch((nextop>>3)&7) { + case 0: + case 1: + if(rex.is32bits || !MODREG) { + INST_NAME("Illegal AE"); + FAKEED; + UDF(0); + } else { + if(((nextop>>3)&7)==1) {INST_NAME("RDGSBASE");} else {INST_NAME("RDFSBASE");} + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + int seg = _FS + ((nextop>>3)&7); + grab_segdata(dyn, addr, ninst, x4, seg); + MOVxw_REG(ed, x4); + } + break; case 2: - INST_NAME("(unsupported) WRFSBASE Ed"); - FAKEED; - UDF(0); - break; case 3: - INST_NAME("(unsupported) WRGSBASE Ed"); - FAKEED; - UDF(0); + if(rex.is32bits || !MODREG) { + INST_NAME("Illegal AE"); + FAKEED; + UDF(0); + } else { + if(((nextop>>3)&7)==3) {INST_NAME("WRGSBASE");} else {INST_NAME("WRFSBASE");} + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + int seg = _FS + ((nextop>>3)&7)-2; + if (!rex.w) { + MOVw_REG(x4, ed); + STRx_U12(x4, xEmu, offsetof(x64emu_t, segs_offs[seg])); + } else { + STRx_U12(ed, xEmu, offsetof(x64emu_t, segs_offs[seg])); + } + } break; case 5: INST_NAME("(unsupported) INCSSPD/INCSSPQ Ed"); @@ -441,7 +571,7 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n case 0xB8: INST_NAME("POPCNT Gd, Ed"); SETFLAGS(X_ALL, SF_SET); - SET_DFNONE(x1); + SET_DFNONE(); nextop = F8; v1 = fpu_get_scratch(dyn, ninst); GETGD; @@ -465,19 +595,35 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n } CNT_8(v1, v1); UADDLV_8(v1, v1); - VMOVQDto(gd, v1, 0); + VMOVHto(gd, v1, 0); IFX(X_ALL) { - MOV32w(x1, (1< #include #include -#include #include #include #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" #include "emu/x64run_private.h" #include "emu/x87emu_private.h" #include "x64trace.h" -#include "signals.h" #include "dynarec_native.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" #include "custommem.h" #include "bridge.h" +#include "gdbjit.h" +#include "perfmap.h" // Get a FPU scratch reg int fpu_get_scratch(dynarec_arm_t* dyn, int ninst) { int ret = SCRATCH0 + dyn->n.fpu_scratch++; - if(dyn->n.ymm_used) printf_log(LOG_INFO, "Warning, getting a scratch register after getting some YMM at inst=%d\n", ninst); + if(dyn->n.ymm_used) { + printf_log(LOG_INFO, "Warning, getting a scratch register after getting some YMM at inst=%d", ninst); + uint8_t* addr = (uint8_t*)dyn->insts[ninst].x64.addr; + printf_log_prefix(0, LOG_INFO, "(%hhX %hhX %hhX %hhX %hhX %hhX %hhX %hhX)\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], addr[6], addr[7]); + } if(dyn->n.neoncache[ret].t==NEON_CACHE_YMMR || dyn->n.neoncache[ret].t==NEON_CACHE_YMMW) { // should only happens in step 0... dyn->insts[ninst].purge_ymm |= (1<n.neoncache[ret].n); // mark as purged @@ -42,7 +45,11 @@ int fpu_get_scratch(dynarec_arm_t* dyn, int ninst) int fpu_get_double_scratch(dynarec_arm_t* dyn, int ninst) { int ret = SCRATCH0 + dyn->n.fpu_scratch; - if(dyn->n.ymm_used) printf_log(LOG_INFO, "Warning, getting a double scratch register after getting some YMM at inst=%d\n", ninst); + if(dyn->n.ymm_used) { + printf_log(LOG_INFO, "Warning, getting a double scratch register after getting some YMM at inst=%d", ninst); + uint8_t* addr = (uint8_t*)dyn->insts[ninst].x64.addr; + printf_log_prefix(0, LOG_INFO, "(%hhX %hhX %hhX %hhX %hhX %hhX %hhX %hhX)\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], addr[6], addr[7]); + } if(dyn->n.neoncache[ret].t==NEON_CACHE_YMMR || dyn->n.neoncache[ret].t==NEON_CACHE_YMMW) { // should only happens in step 0... dyn->insts[ninst].purge_ymm |= (1<n.neoncache[ret].n); // mark as purged @@ -64,6 +71,11 @@ void fpu_reset_scratch(dynarec_arm_t* dyn) dyn->n.ymm_regs = 0; dyn->n.ymm_write = 0; dyn->n.ymm_removed = 0; + dyn->n.xmm_write = 0; + dyn->n.xmm_used = 0; + dyn->n.xmm_unneeded = 0; + dyn->n.ymm_unneeded = 0; + dyn->n.xmm_removed = 0; } // Get a x87 double reg int fpu_get_reg_x87(dynarec_arm_t* dyn, int ninst, int t, int n) @@ -79,6 +91,7 @@ int fpu_get_reg_x87(dynarec_arm_t* dyn, int ninst, int t, int n) dyn->n.neoncache[i].n = n; dyn->n.neoncache[i].t = t; dyn->n.news |= (1<use_x87 = 1; return i; // return a Dx } // Free a FPU double reg @@ -95,6 +108,11 @@ void fpu_free_reg(dynarec_arm_t* dyn, int reg) else dyn->n.ymm_regs |= ((uint64_t)(reg-EMM0))<<(dyn->n.neoncache[reg].n*4); } + if(dyn->n.neoncache[reg].t==NEON_CACHE_XMMR || dyn->n.neoncache[reg].t==NEON_CACHE_XMMW) { + dyn->n.xmm_removed |= 1<n.neoncache[reg].n; + if(dyn->n.neoncache[reg].t==NEON_CACHE_XMMW) + dyn->n.xmm_write |= 1<n.neoncache[reg].n; + } if(dyn->n.neoncache[reg].t!=NEON_CACHE_ST_F && dyn->n.neoncache[reg].t!=NEON_CACHE_ST_D && dyn->n.neoncache[reg].t!=NEON_CACHE_ST_I64) dyn->n.neoncache[reg].v = 0; if(dyn->n.fpu_scratch && reg==SCRATCH0+dyn->n.fpu_scratch-1) @@ -113,6 +131,7 @@ int fpu_get_reg_emm(dynarec_arm_t* dyn, int ninst, int emm) dyn->n.neoncache[ret].t = NEON_CACHE_MM; dyn->n.neoncache[ret].n = emm; dyn->n.news |= (1<<(ret)); + dyn->use_mmx = 1; return ret; } // Get an XMM quad reg @@ -128,10 +147,12 @@ int fpu_get_reg_xmm(dynarec_arm_t* dyn, int t, int xmm) dyn->n.neoncache[i].t = t; dyn->n.neoncache[i].n = xmm; dyn->n.news |= (1<use_xmm = 1; return i; } int internal_mark_ymm(dynarec_arm_t* dyn, int t, int ymm, int reg) { + dyn->use_ymm = 1; if((dyn->n.neoncache[reg].t==NEON_CACHE_YMMR) || (dyn->n.neoncache[reg].t==NEON_CACHE_YMMW)) { if(dyn->n.neoncache[reg].n == ymm) { // already there! @@ -143,6 +164,7 @@ int internal_mark_ymm(dynarec_arm_t* dyn, int t, int ymm, int reg) // found a slot! dyn->n.neoncache[reg].t=t; dyn->n.neoncache[reg].n=ymm; + dyn->n.news |= (1<fpu_reg = 0; for (int i=0; i<32; ++i) { n->fpuused[i]=0; n->neoncache[i].v = 0; @@ -172,6 +193,8 @@ static void fpu_reset_reg_neoncache(neoncache_t* n) n->ymm_removed = 0; n->ymm_used = 0; n->ymm_write = 0; + n->xmm_removed = 0; + n->xmm_write = 0; } void fpu_reset_reg(dynarec_arm_t* dyn) @@ -285,9 +308,10 @@ static void neoncache_promote_double_combined(dynarec_arm_t* dyn, int ninst, int } else a = dyn->insts[ninst].n.combined1; int i = neoncache_get_st_f_i64_noback(dyn, ninst, a); - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_combined, ninst=%d combined%c %d i=%d (stack:%d/%d)\n", ninst, (a == dyn->insts[ninst].n.combined2)?'2':'1', a ,i, dyn->insts[ninst].n.stack_push, -dyn->insts[ninst].n.stack_pop); + //if(dyn->need_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_combined, ninst=%d combined%c %d i=%d (stack:%d/%d)\n", ninst, (a == dyn->insts[ninst].n.combined2)?'2':'1', a ,i, dyn->insts[ninst].n.stack_push, -dyn->insts[ninst].n.stack_pop); if(i>=0) { dyn->insts[ninst].n.neoncache[i].t = NEON_CACHE_ST_D; + if(dyn->insts[ninst].x87precision) dyn->need_x87check = 2; if(!dyn->insts[ninst].n.barrier) neoncache_promote_double_internal(dyn, ninst-1, maxinst, a-dyn->insts[ninst].n.stack_push); // go forward is combined is not pop'd @@ -302,19 +326,20 @@ static void neoncache_promote_double_internal(dynarec_arm_t* dyn, int ninst, int while(ninst>=0) { a+=dyn->insts[ninst].n.stack_pop; // adjust Stack depth: add pop'd ST (going backward) int i = neoncache_get_st_f_i64(dyn, ninst, a); - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_internal, ninst=%d, a=%d st=%d:%d, i=%d\n", ninst, a, dyn->insts[ninst].n.stack, dyn->insts[ninst].n.stack_next, i); + //if(dyn->need_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_internal, ninst=%d, a=%d st=%d:%d, i=%d\n", ninst, a, dyn->insts[ninst].n.stack, dyn->insts[ninst].n.stack_next, i); if(i<0) return; dyn->insts[ninst].n.neoncache[i].t = NEON_CACHE_ST_D; + if(dyn->insts[ninst].x87precision) dyn->need_x87check = 2; // check combined propagation too if(dyn->insts[ninst].n.combined1 || dyn->insts[ninst].n.combined2) { if(dyn->insts[ninst].n.swapped) { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_internal, ninst=%d swapped %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].n.combined1 ,dyn->insts[ninst].n.combined2, a, dyn->insts[ninst].n.stack); + //if(dyn->need_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_internal, ninst=%d swapped %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].n.combined1 ,dyn->insts[ninst].n.combined2, a, dyn->insts[ninst].n.stack); if (a==dyn->insts[ninst].n.combined1) a = dyn->insts[ninst].n.combined2; else if (a==dyn->insts[ninst].n.combined2) a = dyn->insts[ninst].n.combined1; } else { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_internal, ninst=%d combined %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].n.combined1 ,dyn->insts[ninst].n.combined2, a, dyn->insts[ninst].n.stack); + //if(dyn->need_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_internal, ninst=%d combined %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].n.combined1 ,dyn->insts[ninst].n.combined2, a, dyn->insts[ninst].n.stack); neoncache_promote_double_combined(dyn, ninst, maxinst, a); } } @@ -330,19 +355,20 @@ static void neoncache_promote_double_forward(dynarec_arm_t* dyn, int ninst, int while((ninst!=-1) && (ninst=0)) { a+=dyn->insts[ninst].n.stack_push; // // adjust Stack depth: add push'd ST (going forward) if((dyn->insts[ninst].n.combined1 || dyn->insts[ninst].n.combined2) && dyn->insts[ninst].n.swapped) { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_forward, ninst=%d swapped %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].n.combined1 ,dyn->insts[ninst].n.combined2, a, dyn->insts[ninst].n.stack); + //if(dyn->need_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_forward, ninst=%d swapped %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].n.combined1 ,dyn->insts[ninst].n.combined2, a, dyn->insts[ninst].n.stack); if (a==dyn->insts[ninst].n.combined1) a = dyn->insts[ninst].n.combined2; else if (a==dyn->insts[ninst].n.combined2) a = dyn->insts[ninst].n.combined1; } int i = neoncache_get_st_f_i64_noback(dyn, ninst, a); - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_forward, ninst=%d, a=%d st=%d:%d(%d/%d), i=%d\n", ninst, a, dyn->insts[ninst].n.stack, dyn->insts[ninst].n.stack_next, dyn->insts[ninst].n.stack_push, -dyn->insts[ninst].n.stack_pop, i); + //if(dyn->need_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_forward, ninst=%d, a=%d st=%d:%d(%d/%d), i=%d\n", ninst, a, dyn->insts[ninst].n.stack, dyn->insts[ninst].n.stack_next, dyn->insts[ninst].n.stack_push, -dyn->insts[ninst].n.stack_pop, i); if(i<0) return; dyn->insts[ninst].n.neoncache[i].t = NEON_CACHE_ST_D; + if(dyn->insts[ninst].x87precision) dyn->need_x87check = 2; // check combined propagation too if((dyn->insts[ninst].n.combined1 || dyn->insts[ninst].n.combined2) && !dyn->insts[ninst].n.swapped) { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_forward, ninst=%d combined %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].n.combined1 ,dyn->insts[ninst].n.combined2, a, dyn->insts[ninst].n.stack); + //if(dyn->need_dump) dynarec_log(LOG_NONE, "neoncache_promote_double_forward, ninst=%d combined %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].n.combined1 ,dyn->insts[ninst].n.combined2, a, dyn->insts[ninst].n.stack); neoncache_promote_double_combined(dyn, ninst, maxinst, a); } a-=dyn->insts[ninst].n.stack_pop; // adjust Stack depth: remove pop'd ST (going forward) @@ -358,20 +384,21 @@ static void neoncache_promote_double_forward(dynarec_arm_t* dyn, int ninst, int void neoncache_promote_double(dynarec_arm_t* dyn, int ninst, int a) { int i = neoncache_get_current_st_f_i64(dyn, a); - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double, ninst=%d a=%d st=%d i=%d\n", ninst, a, dyn->n.stack, i); + //if(dyn->need_dump) dynarec_log(LOG_NONE, "neoncache_promote_double, ninst=%d a=%d st=%d i=%d\n", ninst, a, dyn->n.stack, i); if(i<0) return; dyn->n.neoncache[i].t = NEON_CACHE_ST_D; dyn->insts[ninst].n.neoncache[i].t = NEON_CACHE_ST_D; + if(dyn->insts[ninst].x87precision) dyn->need_x87check = 2; // check combined propagation too if(dyn->n.combined1 || dyn->n.combined2) { if(dyn->n.swapped) { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double, ninst=%d swapped! %d/%d vs %d\n", ninst, dyn->n.combined1 ,dyn->n.combined2, a); + //if(dyn->need_dump) dynarec_log(LOG_NONE, "neoncache_promote_double, ninst=%d swapped! %d/%d vs %d\n", ninst, dyn->n.combined1 ,dyn->n.combined2, a); if(dyn->n.combined1 == a) a = dyn->n.combined2; else if(dyn->n.combined2 == a) a = dyn->n.combined1; } else { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "neoncache_promote_double, ninst=%d combined! %d/%d vs %d\n", ninst, dyn->n.combined1 ,dyn->n.combined2, a); + //if(dyn->need_dump) dynarec_log(LOG_NONE, "neoncache_promote_double, ninst=%d combined! %d/%d vs %d\n", ninst, dyn->n.combined1 ,dyn->n.combined2, a); if(dyn->n.combined1 == a) neoncache_promote_double(dyn, ninst, dyn->n.combined2); else if(dyn->n.combined2 == a) @@ -429,11 +456,13 @@ int fpuCacheNeedsTransform(dynarec_arm_t* dyn, int ninst) { return 1; for(int i=0; i<32 && !ret; ++i) if(dyn->insts[ninst].n.neoncache[i].v) { // there is something at ninst for i + int t = dyn->insts[ninst].n.neoncache[i].t; + int n = dyn->insts[ninst].n.neoncache[i].n; if(!( - (dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_F - || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_D - || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_ST_I64) - && dyn->insts[ninst].n.neoncache[i].ninsts[ninst].n.stack_pop)) + (t==NEON_CACHE_ST_F + || t==NEON_CACHE_ST_D + || t==NEON_CACHE_ST_I64) + && ninsts[ninst].n.stack_pop)) ret = 1; } return ret; @@ -449,15 +478,20 @@ int fpuCacheNeedsTransform(dynarec_arm_t* dyn, int ninst) { for(int i=0; i<32; ++i) { if(dyn->insts[ninst].n.neoncache[i].v) { // there is something at ninst for i + int t = dyn->insts[ninst].n.neoncache[i].t; + int n = dyn->insts[ninst].n.neoncache[i].n; if(!cache_i2.neoncache[i].v) { // but there is nothing at i2 for i + if(((t==NEON_CACHE_XMMR) || (t==NEON_CACHE_XMMW)) && (cache_i2.xmm_unneeded&(1<insts[ninst].n.neoncache[i].v!=cache_i2.neoncache[i].v) { // there is something different - if(dyn->insts[ninst].n.neoncache[i].n!=cache_i2.neoncache[i].n) { // not the same x64 reg + if(n!=cache_i2.neoncache[i].n) { // not the same x64 reg ret = 1; } - else if(dyn->insts[ninst].n.neoncache[i].t == NEON_CACHE_XMMR && cache_i2.neoncache[i].t == NEON_CACHE_XMMW) + else if((t == NEON_CACHE_XMMR) && cache_i2.neoncache[i].t == NEON_CACHE_XMMW) {/* nothing */ } - else if(dyn->insts[ninst].n.neoncache[i].t == NEON_CACHE_YMMR && cache_i2.neoncache[i].t == NEON_CACHE_YMMW) + else if((t == NEON_CACHE_YMMR) && cache_i2.neoncache[i].t == NEON_CACHE_YMMW) {/* nothing */ } else ret = 1; @@ -493,7 +527,7 @@ void neoncacheUnwind(neoncache_t* cache) } if(cache->news) { // remove the newly created neoncache - for(int i=0; i<24; ++i) + for(int i=0; i<32; ++i) if(cache->news&(1<neoncache[i].v = 0; cache->news = 0; @@ -531,7 +565,6 @@ void neoncacheUnwind(neoncache_t* cache) // And now, rebuild the x87cache info with neoncache cache->mmxcount = 0; cache->fpu_scratch = 0; - cache->fpu_reg = 0; for(int i=0; i<8; ++i) { cache->x87cache[i] = -1; cache->mmxcache[i] = -1; @@ -547,13 +580,11 @@ void neoncacheUnwind(neoncache_t* cache) case NEON_CACHE_MM: cache->mmxcache[cache->neoncache[i].n] = i; ++cache->mmxcount; - ++cache->fpu_reg; break; case NEON_CACHE_XMMR: case NEON_CACHE_XMMW: cache->ssecache[cache->neoncache[i].n].reg = i; cache->ssecache[cache->neoncache[i].n].write = (cache->neoncache[i].t==NEON_CACHE_XMMW)?1:0; - ++cache->fpu_reg; break; case NEON_CACHE_YMMR: case NEON_CACHE_YMMW: @@ -565,7 +596,6 @@ void neoncacheUnwind(neoncache_t* cache) cache->x87cache[x87reg] = cache->neoncache[i].n; cache->x87reg[x87reg] = i; ++x87reg; - ++cache->fpu_reg; break; case NEON_CACHE_SCR: cache->fpuused[i] = 0; @@ -576,7 +606,19 @@ void neoncacheUnwind(neoncache_t* cache) cache->fpuused[i] = 0; } } - // add back removed YMM + // add back removed XMM + if(cache->xmm_removed) { + for(int i=0; i<16; ++i) + if(cache->xmm_removed&(1<neoncache[reg].t = (cache->xmm_write&(1<neoncache[reg].n = i; + cache->ssecache[i].reg = reg; + cache->ssecache[i].write = (cache->xmm_write&(1<xmm_write = cache->xmm_removed = 0; + } + // add back removed YMM if(cache->ymm_removed) { for(int i=0; i<16; ++i) if(cache->ymm_removed&(1<neoncache[reg].v) - printf_log(LOG_INFO, "Warning, recreating YMM%d on non empty slot %s", i, getCacheName(cache->neoncache[reg].t, cache->neoncache[reg].n)); + //if(cache->neoncache[reg].v) // this is normal when a ymm is purged to make space for another one + // printf_log(LOG_INFO, "Warning, recreating YMM%d on non empty slot %s", i, getCacheName(cache->neoncache[reg].t, cache->neoncache[reg].n)); cache->neoncache[reg].t = (cache->ymm_write&(1<neoncache[reg].n = i; } @@ -598,7 +640,7 @@ void neoncacheUnwind(neoncache_t* cache) #define F8 *(uint8_t*)(addr++) #define F32S64 (uint64_t)(int64_t)*(int32_t*)(addr+=4, addr-4) -// Get if ED will have the correct parity. Not emiting anything. Parity is 2 for DWORD or 3 for QWORD +// Get if ED will have the correct parity. Not emitting anything. Parity is 2 for DWORD or 3 for QWORD int getedparity(dynarec_arm_t* dyn, int ninst, uintptr_t addr, uint8_t nextop, int parity, int delta) { (void)dyn; (void)ninst; @@ -657,81 +699,217 @@ const char* getCacheName(int t, int n) return buff; } +static register_mapping_t register_mappings[] = { + { "rax", "x10" }, + { "eax", "w10" }, + { "ax", "x10" }, + { "ah", "x10" }, + { "al", "x10" }, + { "rcx", "x11" }, + { "ecx", "w11" }, + { "cx", "x11" }, + { "ch", "x11" }, + { "cl", "x11" }, + { "rdx", "x12" }, + { "edx", "w12" }, + { "dx", "x12" }, + { "dh", "x12" }, + { "dl", "x12" }, + { "rbx", "x13" }, + { "ebx", "w13" }, + { "bx", "x13" }, + { "bh", "x13" }, + { "bl", "x13" }, + { "rsi", "x14" }, + { "esi", "w14" }, + { "si", "x14" }, + { "sil", "x14" }, + { "rdi", "x15" }, + { "edi", "w15" }, + { "di", "x15" }, + { "dil", "x15" }, + { "rsp", "x16" }, + { "esp", "w16" }, + { "sp", "x16" }, + { "spl", "x16" }, + { "rbp", "x17" }, + { "ebp", "w17" }, + { "bp", "x17" }, + { "bpl", "x17" }, + { "r8", "x18" }, + { "r8d", "w18" }, + { "r8w", "x18" }, + { "r8b", "x18" }, + { "r9", "x19" }, + { "r9d", "w19" }, + { "r9w", "x19" }, + { "r9b", "x19" }, + { "r10", "x20" }, + { "r10d", "w20" }, + { "r10w", "x20" }, + { "r10b", "x20" }, + { "r11", "x21" }, + { "r11d", "w21" }, + { "r11w", "x21" }, + { "r11b", "x21" }, + { "r12", "x22" }, + { "r12d", "w22" }, + { "r12w", "x22" }, + { "r12b", "x22" }, + { "r13", "x23" }, + { "r13d", "w23" }, + { "r13w", "x23" }, + { "r13b", "x23" }, + { "r14", "x24" }, + { "r14d", "w24" }, + { "r14w", "x24" }, + { "r14b", "x24" }, + { "r15", "x25" }, + { "r15d", "w25" }, + { "r15w", "x25" }, + { "r15b", "x25" }, + { "rip", "x27" }, +}; + +static const char* df_status[] = {"unknown", "set", "none_pending", "none"}; + +void printf_x64_instruction(dynarec_native_t* dyn, zydis_dec_t* dec, instruction_x64_t* inst, const char* name); void inst_name_pass3(dynarec_native_t* dyn, int ninst, const char* name, rex_t rex) { - if(box64_dynarec_dump) { - printf_x64_instruction(rex.is32bits?my_context->dec32:my_context->dec, &dyn->insts[ninst].x64, name); - dynarec_log(LOG_NONE, "%s%p: %d emitted opcodes, inst=%d, barrier=%d state=%d/%d(%d), %s=%X/%X, use=%X, need=%X/%X, sm=%d(%d/%d)", - (box64_dynarec_dump>1)?"\e[32m":"", - (void*)(dyn->native_start+dyn->insts[ninst].address), - dyn->insts[ninst].size/4, - ninst, - dyn->insts[ninst].x64.barrier, - dyn->insts[ninst].x64.state_flags, - dyn->f.pending, - dyn->f.dfnone, - dyn->insts[ninst].x64.may_set?"may":"set", - dyn->insts[ninst].x64.set_flags, - dyn->insts[ninst].x64.gen_flags, - dyn->insts[ninst].x64.use_flags, - dyn->insts[ninst].x64.need_before, - dyn->insts[ninst].x64.need_after, - dyn->smwrite, dyn->insts[ninst].will_write, dyn->insts[ninst].last_write); - if(dyn->insts[ninst].pred_sz) { - dynarec_log(LOG_NONE, ", pred="); - for(int ii=0; iiinsts[ninst].pred_sz; ++ii) - dynarec_log(LOG_NONE, "%s%d", ii?"/":"", dyn->insts[ninst].pred[ii]); + if (!dyn->need_dump && !BOX64ENV(dynarec_gdbjit) && !BOX64ENV(dynarec_perf_map)) { + /*zydis_dec_t* dec = rex.is32bits ? my_context->dec32 : my_context->dec; + if(dec && !OpcodeOK(dec, dyn->insts[ninst].x64.addr) && !strstr(name, "Illegal")) { + uint8_t* p = (uint8_t*)dyn->insts[ninst].x64.addr; + printf_log(LOG_INFO, "Warning: %p invalid opcode %02x %02x %02x %02x %02x %02x treated as valid\n", p, p[0], p[1], p[2], p[3], p[4], p[5]); + }*/ + return; + } + + static char buf[4096]; + int length = sprintf(buf, "barrier=%d state=%d/%s(%s->%s)/%d, set=%X/%X, use=%X, need=%X/%X, sm=%d(%d/%d/%d)", + dyn->insts[ninst].x64.barrier, + dyn->insts[ninst].x64.state_flags, + df_status[dyn->f], + df_status[dyn->insts[ninst].f_entry], + df_status[dyn->insts[ninst].f_exit], + dyn->insts[ninst].df_notneeded, + dyn->insts[ninst].x64.set_flags, + dyn->insts[ninst].x64.gen_flags, + dyn->insts[ninst].x64.use_flags, + dyn->insts[ninst].x64.need_before, + dyn->insts[ninst].x64.need_after, + dyn->smwrite, dyn->insts[ninst].will_write, dyn->insts[ninst].last_write, dyn->insts[ninst].lock); + if (dyn->insts[ninst].nat_flags_op) { + if (dyn->insts[ninst].nat_flags_op == NAT_FLAG_OP_TOUCH && dyn->insts[ninst].before_nat_flags) + length += sprintf(buf + length, " NF:%d/read:%x", dyn->insts[ninst].nat_flags_op, dyn->insts[ninst].before_nat_flags); + else + length += sprintf(buf + length, " NF:%d", dyn->insts[ninst].nat_flags_op); + } + if (dyn->insts[ninst].use_nat_flags || dyn->insts[ninst].set_nat_flags || dyn->insts[ninst].need_nat_flags) { + length += sprintf(buf + length, " nf:%hhx/%hhx/%hhx", dyn->insts[ninst].set_nat_flags, dyn->insts[ninst].use_nat_flags, dyn->insts[ninst].need_nat_flags); + } + if (dyn->insts[ninst].invert_carry) + length += sprintf(buf + length, " CI"); + if (dyn->insts[ninst].gen_inverted_carry) + length += sprintf(buf + length, " gic"); + if (dyn->insts[ninst].before_nat_flags & NF_CF) { + length += sprintf(buf + length, " %ccb", dyn->insts[ninst].normal_carry_before ? 'n' : 'i'); + } + if (dyn->insts[ninst].need_nat_flags & NF_CF) { + length += sprintf(buf + length, " %cc", dyn->insts[ninst].normal_carry ? 'n' : 'i'); + } + if (dyn->insts[ninst].pred_sz) { + length += sprintf(buf + length, ", pred="); + for (int ii = 0; ii < dyn->insts[ninst].pred_sz; ++ii) + length += sprintf(buf + length, "%s%d", ii ? "/" : "", dyn->insts[ninst].pred[ii]); + } + if (!dyn->insts[ninst].x64.alive) + length += sprintf(buf + length, "not executed"); + if (dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts >= 0) { + length += sprintf(buf + length, ", jmp=%d", dyn->insts[ninst].x64.jmp_insts); + } + if (dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts == -1) + length += sprintf(buf + length, ", jmp=out"); + if (dyn->insts[ninst].x64.has_callret) + length += sprintf(buf + length, ", callret"); + if (dyn->last_ip) { + length += sprintf(buf + length, ", last_ip=%p", (void*)dyn->last_ip); + } + for (int ii = 0; ii < 32; ++ii) { + switch (dyn->insts[ninst].n.neoncache[ii].t) { + case NEON_CACHE_ST_D: length += sprintf(buf + length, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; + case NEON_CACHE_ST_F: length += sprintf(buf + length, " S%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; + case NEON_CACHE_ST_I64: length += sprintf(buf + length, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; + case NEON_CACHE_MM: length += sprintf(buf + length, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; + case NEON_CACHE_XMMW: length += sprintf(buf + length, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; + case NEON_CACHE_XMMR: length += sprintf(buf + length, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; + case NEON_CACHE_YMMW: length += sprintf(buf + length, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; + case NEON_CACHE_YMMR: length += sprintf(buf + length, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; + // case NEON_CACHE_SCR: length += sprintf(buf + length, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; + case NEON_CACHE_NONE: + default: break; } - if(!dyn->insts[ninst].x64.alive) - dynarec_log(LOG_NONE, " not executed"); - if(dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts>=0) - dynarec_log(LOG_NONE, ", jmp=%d", dyn->insts[ninst].x64.jmp_insts); - if(dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts==-1) - dynarec_log(LOG_NONE, ", jmp=out"); - if(dyn->insts[ninst].x64.has_callret) - dynarec_log(LOG_NONE, ", callret"); - if(dyn->last_ip) - dynarec_log(LOG_NONE, ", last_ip=%p", (void*)dyn->last_ip); - for(int ii=0; ii<32; ++ii) { - switch(dyn->insts[ninst].n.neoncache[ii].t) { - case NEON_CACHE_ST_D: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; - case NEON_CACHE_ST_F: dynarec_log(LOG_NONE, " S%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; - case NEON_CACHE_ST_I64: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; - case NEON_CACHE_MM: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; - case NEON_CACHE_XMMW: dynarec_log(LOG_NONE, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; - case NEON_CACHE_XMMR: dynarec_log(LOG_NONE, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; - case NEON_CACHE_YMMW: dynarec_log(LOG_NONE, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; - case NEON_CACHE_YMMR: dynarec_log(LOG_NONE, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; - //case NEON_CACHE_SCR: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); break; - case NEON_CACHE_NONE: - default: break; + } + if (memcmp(dyn->insts[ninst].n.neoncache, dyn->n.neoncache, sizeof(dyn->n.neoncache))) { + length += sprintf(buf + length, " %s(Change:", (dyn->need_dump > 1) ? "\e[1;91m" : ""); + for (int ii = 0; ii < 32; ++ii) + if (dyn->insts[ninst].n.neoncache[ii].v != dyn->n.neoncache[ii].v) { + length += sprintf(buf + length, " V%d:%s", ii, getCacheName(dyn->n.neoncache[ii].t, dyn->n.neoncache[ii].n)); + length += sprintf(buf + length, "->%s", getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); } + length += sprintf(buf + length, ")%s", (dyn->need_dump > 1) ? "\e[0;32m" : ""); + } + if (dyn->insts[ninst].n.xmm_used || dyn->insts[ninst].n.xmm_unneeded) { + length += sprintf(buf + length, " xmmUsed=%04x/unneeded=%04x", dyn->insts[ninst].n.xmm_used, dyn->insts[ninst].n.xmm_unneeded); + } + if (dyn->insts[ninst].n.ymm_used || dyn->insts[ninst].n.ymm_unneeded) { + length += sprintf(buf + length, " ymmUsed=%04x/unneeded=%04x", dyn->insts[ninst].n.ymm_used, dyn->insts[ninst].n.ymm_unneeded); + } + if (dyn->ymm_zero || dyn->insts[ninst].ymm0_add || dyn->insts[ninst].ymm0_sub || dyn->insts[ninst].ymm0_out) { + length += sprintf(buf + length, " ymm0=(%04x/%04x+%04x-%04x=%04x)", dyn->ymm_zero, dyn->insts[ninst].ymm0_in, dyn->insts[ninst].ymm0_add, dyn->insts[ninst].ymm0_sub, dyn->insts[ninst].ymm0_out); + } + if (dyn->insts[ninst].purge_ymm) { + length += sprintf(buf + length, " purgeYmm=%04x", dyn->insts[ninst].purge_ymm); + } + if (dyn->insts[ninst].preload_xmmymm) { + length += sprintf(buf + length, " preload=%x/%d", dyn->insts[ninst].preload_xmmymm, dyn->insts[ninst].preload_from); + } + if (dyn->n.stack || dyn->insts[ninst].n.stack_next || dyn->insts[ninst].n.x87stack) { + length += sprintf(buf + length, " X87:%d/%d(+%d/-%d)%d", dyn->n.stack, dyn->insts[ninst].n.stack_next, dyn->insts[ninst].n.stack_push, dyn->insts[ninst].n.stack_pop, dyn->insts[ninst].n.x87stack); + } + if (dyn->insts[ninst].n.combined1 || dyn->insts[ninst].n.combined2) { + length += sprintf(buf + length, " %s:%d/%d", dyn->insts[ninst].n.swapped ? "SWP" : "CMB", dyn->insts[ninst].n.combined1, dyn->insts[ninst].n.combined2); + } + if (dyn->need_dump) { + printf_x64_instruction(dyn, rex.is32bits ? my_context->dec32 : my_context->dec, &dyn->insts[ninst].x64, name); + dynarec_log(LOG_NONE, "%s%p: %d emitted opcodes, inst=%d, %s%s\n", + (dyn->need_dump > 1) ? "\e[32m" : "", + (void*)(dyn->native_start + dyn->insts[ninst].address), dyn->insts[ninst].size / 4, ninst, buf, (dyn->need_dump > 1) ? "\e[m" : ""); + } + if (BOX64ENV(dynarec_gdbjit)) { + static char buf2[512]; + if (BOX64ENV(dynarec_gdbjit) > 1) { + sprintf(buf2, "; %d: %d opcodes, %s", ninst, dyn->insts[ninst].size / 4, buf); + dyn->gdbjit_block = GdbJITBlockAddLine(dyn->gdbjit_block, (dyn->native_start + dyn->insts[ninst].address), buf2); } - if(memcmp(dyn->insts[ninst].n.neoncache, dyn->n.neoncache, sizeof(dyn->n.neoncache))) { - dynarec_log(LOG_NONE, " %s(Change:", (box64_dynarec_dump>1)?"\e[1;91m":""); - for(int ii=0; ii<32; ++ii) if(dyn->insts[ninst].n.neoncache[ii].v!=dyn->n.neoncache[ii].v) { - dynarec_log(LOG_NONE, " V%d:%s", ii, getCacheName(dyn->n.neoncache[ii].t, dyn->n.neoncache[ii].n)); - dynarec_log(LOG_NONE, "->%s", getCacheName(dyn->insts[ninst].n.neoncache[ii].t, dyn->insts[ninst].n.neoncache[ii].n)); - } - dynarec_log(LOG_NONE, ")%s", (box64_dynarec_dump>1)?"\e[0;32m":""); + zydis_dec_t* dec = rex.is32bits ? my_context->dec32 : my_context->dec; + const char* inst_name = name; + if (dec) { + inst_name = DecodeX64Trace(dec, dyn->insts[ninst].x64.addr, 0); + x64disas_add_register_mapping_annotations(buf2, inst_name, register_mappings, sizeof(register_mappings) / sizeof(register_mappings[0])); + inst_name = buf2; } - if(dyn->insts[ninst].n.ymm_used) - dynarec_log(LOG_NONE, " ymmUsed=%04x", dyn->insts[ninst].n.ymm_used); - if(dyn->ymm_zero || dyn->insts[ninst].ymm0_add || dyn->insts[ninst].ymm0_sub || dyn->insts[ninst].ymm0_out) - dynarec_log(LOG_NONE, " ymm0=(%04x/%04x+%04x-%04x=%04x)", dyn->ymm_zero, dyn->insts[ninst].ymm0_in, dyn->insts[ninst].ymm0_add ,dyn->insts[ninst].ymm0_sub, dyn->insts[ninst].ymm0_out); - if(dyn->insts[ninst].purge_ymm) - dynarec_log(LOG_NONE, " purgeYmm=%04x", dyn->insts[ninst].purge_ymm); - if(dyn->n.stack || dyn->insts[ninst].n.stack_next || dyn->insts[ninst].n.x87stack) - dynarec_log(LOG_NONE, " X87:%d/%d(+%d/-%d)%d", dyn->n.stack, dyn->insts[ninst].n.stack_next, dyn->insts[ninst].n.stack_push, dyn->insts[ninst].n.stack_pop, dyn->insts[ninst].n.x87stack); - if(dyn->insts[ninst].n.combined1 || dyn->insts[ninst].n.combined2) - dynarec_log(LOG_NONE, " %s:%d/%d", dyn->insts[ninst].n.swapped?"SWP":"CMB", dyn->insts[ninst].n.combined1, dyn->insts[ninst].n.combined2); - dynarec_log(LOG_NONE, "%s\n", (box64_dynarec_dump>1)?"\e[m":""); + dyn->gdbjit_block = GdbJITBlockAddLine(dyn->gdbjit_block, (dyn->native_start + dyn->insts[ninst].address), inst_name); + } + if (BOX64ENV(dynarec_perf_map) && BOX64ENV(dynarec_perf_map_fd) != -1) { + writePerfMap(dyn->insts[ninst].x64.addr, dyn->native_start + dyn->insts[ninst].address, dyn->insts[ninst].size / 4, name); } + if(length>sizeof(buf)) printf_log(LOG_NONE, "Warning: buf to small in inst_name_pass3 (%d vs %zd)\n", length, sizeof(buf)); } void print_opcode(dynarec_native_t* dyn, int ninst, uint32_t opcode) { - dynarec_log(LOG_NONE, "\t%08x\t%s\n", opcode, arm64_print(opcode, (uintptr_t)dyn->block)); + dynarec_log_prefix(0, LOG_NONE, "\t%08x\t%s\n", opcode, arm64_print(opcode, (uintptr_t)dyn->block)); } static void x87_reset(neoncache_t* n) @@ -794,4 +972,564 @@ void fpu_reset_ninst(dynarec_native_t* dyn, int ninst) int fpu_is_st_freed(dynarec_native_t* dyn, int ninst, int st) { return (dyn->n.tags&(0b11<<(st*2)))?1:0; +} + + +uint8_t mark_natflag(dynarec_arm_t* dyn, int ninst, uint8_t flag, int before) +{ + if(dyn->insts[ninst].x64.set_flags && !before) { + dyn->insts[ninst].set_nat_flags |= flag; + //if(dyn->insts[ninst].x64.use_flags) { + // dyn->insts[ninst].use_nat_flags |= flag; + //} + } else { + if(before) + dyn->insts[ninst].use_nat_flags_before |= flag; + else + dyn->insts[ninst].use_nat_flags |= flag; + } + return flag; +} + +uint8_t flag2native(uint8_t flags) +{ + uint8_t ret = 0; + #ifdef ARM64 + if(flags&X_ZF) ret|=NF_EQ; + if(flags&X_SF) ret|=NF_SF; + if(flags&X_OF) ret|=NF_VF; + if(flags&X_CF) ret|=NF_CF; + #else + // no native flags on rv64 or la64 + #endif + return ret; +} + +int flagIsNative(uint8_t flags) +{ + if(flags&(X_AF|X_PF)) return 0; + return 1; +} + +static uint8_t getNativeFlagsUsed(dynarec_arm_t* dyn, int start, uint8_t flags) +{ + // propagate and check wich flags are actually used + uint8_t used_flags = 0; + int nat_flags_used = 0; + int ninst = start; + while(ninstsize) { +//printf_log(LOG_INFO, "getNativeFlagsUsed ninst:%d/%d, flags=%x, used_flags=%x(%d), nat_flags_op_before:%x, nat_flags_op:%x, need_after:%x set_nat_flags:%x nat_flags_used:%x(%x)\n", ninst, start, flags, used_flags, nat_flags_used, dyn->insts[ninst].nat_flags_op_before, dyn->insts[ninst].nat_flags_op, flag2native(dyn->insts[ninst].x64.need_after),dyn->insts[ninst].set_nat_flags, dyn->insts[ninst].use_nat_flags, dyn->insts[ninst].use_nat_flags_before); + // check if this is an opcode that generate flags but consume flags before + if(dyn->insts[ninst].nat_flags_op_before) + return 0; + // check if nat flags are used "before" + if(dyn->insts[ninst].use_nat_flags_before) { + // check if the gen flags are compatible + if(dyn->insts[ninst].use_nat_flags_before&~flags) + return 0; + nat_flags_used = 1; + used_flags|=dyn->insts[ninst].use_nat_flags_before&flags; + } + // if the opcode generate flags, return + if(dyn->insts[ninst].nat_flags_op==NAT_FLAG_OP_TOUCH && (start!=ninst)) { + if(!nat_flags_used) + return 0; + if(used_flags&~dyn->insts[ninst].set_nat_flags) { + // check partial changes that would destroy flag state + if(dyn->insts[ninst].use_nat_flags_before&flags) + return used_flags; + // check if flags are all refreshed, then it's ok + if((used_flags&dyn->insts[ninst].set_nat_flags)==used_flags) + return used_flags; + // incompatible + return 0; + } + return used_flags; + } + // check if there is a callret barrier + if(dyn->insts[ninst].x64.has_callret) + return 0; + // check if nat flags are used + if(dyn->insts[ninst].use_nat_flags) { + // check if the gen flags are compatible + if(dyn->insts[ninst].use_nat_flags&~flags) + return 0; + nat_flags_used = 1; + used_flags |= dyn->insts[ninst].use_nat_flags&flags; + } + if(ninst!=start && dyn->insts[ninst].x64.use_flags) { + // some flags not compatible with native, partial use not allowed + if(flag2native(dyn->insts[ninst].x64.use_flags)!=dyn->insts[ninst].use_nat_flags) + return 0; + // check if flags are used, but not the natives ones + //if(dyn->insts[ninst].use_nat_flags&~used_flags) + // return 0; + } + // check if flags are generated without native option + if((start!=ninst) && dyn->insts[ninst].x64.gen_flags && (flag2native(dyn->insts[ninst].x64.gen_flags&dyn->insts[ninst].x64.need_after)&used_flags)) { + if(used_flags&~flag2native(dyn->insts[ninst].x64.gen_flags&dyn->insts[ninst].x64.need_after)) + return 0; // partial covert, not supported for now (TODO: this might be fixable) + else + return nat_flags_used?used_flags:0; // full covert... End of propagation + } + // check if flags are still needed + if(!(flag2native(dyn->insts[ninst].x64.need_after)&flags)) + return nat_flags_used?used_flags:0; + // check if flags are destroyed, cancel the use then + if(dyn->insts[ninst].nat_flags_op && (start!=ninst)) + return 0; + // update used flags + //used_flags |= (flag2native(dyn->insts[ninst].x64.need_after)&flags); + + // go next + if(!dyn->insts[ninst].x64.has_next) { + // check if it's a jump to an opcode with only 1 preds, then just follow the jump + int jmp = dyn->insts[ninst].x64.jmp_insts; + if(dyn->insts[ninst].x64.jmp && (jmp!=-1) && (getNominalPred(dyn, jmp)==ninst)) + ninst = jmp; + else + return nat_flags_used?used_flags:0; + } else + ++ninst; + } + return nat_flags_used?used_flags:0; +} + +static void propagateNativeFlags(dynarec_arm_t* dyn, int start) +{ + int ninst = start; + // those are the flags generated by the opcode and used later on + uint8_t flags = dyn->insts[ninst].set_nat_flags&flag2native(dyn->insts[ninst].x64.need_after); + //check if they are actualy used before starting +//printf_log(LOG_INFO, "propagateNativeFlags called for start=%d, flags=%x, will need:%x\n", start, flags, flag2native(dyn->insts[ninst].x64.need_after)); + if(!flags) return; + // also check if some native flags are used but not genereated here + if(flag2native(dyn->insts[ninst].x64.use_flags)&~flags) return; + uint8_t used_flags = getNativeFlagsUsed(dyn, start, flags); +//printf_log(LOG_INFO, " will use:%x, carry:%d, generate inverted carry:%d\n", used_flags, used_flags&NF_CF, dyn->insts[ninst].gen_inverted_carry); + if(!used_flags) return; // the flags wont be used, so just cancel + int nc = dyn->insts[ninst].gen_inverted_carry?0:1; + int carry = used_flags&NF_CF; + // propagate + while(ninstsize) { + // check if this is an opcode that generate flags but consume flags before + if((start!=ninst) && dyn->insts[ninst].nat_flags_op==NAT_FLAG_OP_TOUCH) { + if(dyn->insts[ninst].use_nat_flags_before) { + dyn->insts[ninst].before_nat_flags |= used_flags; + if(carry) dyn->insts[ninst].normal_carry_before = nc; + } + // if the opcode generate flags, return + return; + } + // check if flags are generated without native option + if((start!=ninst) && dyn->insts[ninst].x64.gen_flags && (flag2native(dyn->insts[ninst].x64.gen_flags&dyn->insts[ninst].x64.need_after)&used_flags)) + return; + // mark the opcode + uint8_t use_flags = flag2native(dyn->insts[ninst].x64.need_before|dyn->insts[ninst].x64.need_after); + if(dyn->insts[ninst].x64.use_flags) use_flags |= flag2native(dyn->insts[ninst].x64.use_flags); // should not change anything +//printf_log(LOG_INFO, " marking ninst=%d with %x | %x&%x => %x\n", ninst, dyn->insts[ninst].need_nat_flags, used_flags, use_flags, dyn->insts[ninst].need_nat_flags | (used_flags&use_flags)); + dyn->insts[ninst].need_nat_flags |= used_flags&use_flags; + if(carry) dyn->insts[ninst].normal_carry = nc; + if(carry && dyn->insts[ninst].invert_carry) nc = 0; + // check if flags are still needed + if(!(flag2native(dyn->insts[ninst].x64.need_after)&used_flags)) + return; + // go next + if(!dyn->insts[ninst].x64.has_next) { + // check if it's a jump to an opcode with only 1 preds, then just follow the jump + int jmp = dyn->insts[ninst].x64.jmp_insts; + if(dyn->insts[ninst].x64.jmp && (jmp!=-1) && (getNominalPred(dyn, jmp)==ninst)) + ninst = jmp; + else + return; + } else + ++ninst; + } +} + +void updateNativeFlags(dynarec_native_t* dyn) +{ + if(!BOX64ENV(dynarec_nativeflags)) + return; + // forward check if native flags are used + for(int ninst=0; ninstsize; ++ninst) + if(flag2native(dyn->insts[ninst].x64.gen_flags) && (dyn->insts[ninst].nat_flags_op==NAT_FLAG_OP_TOUCH)) { + propagateNativeFlags(dyn, ninst); + } +} + +void rasNativeState(dynarec_arm_t* dyn, int ninst) +{ + dyn->insts[ninst].nat_flags_op = dyn->insts[ninst].set_nat_flags = dyn->insts[ninst].use_nat_flags = dyn->insts[ninst].need_nat_flags = 0; + dyn->insts[ninst].ymm0_in = dyn->insts[ninst].ymm0_sub = dyn->insts[ninst].ymm0_add = dyn->insts[ninst].ymm0_out = dyn->insts[ninst].purge_ymm = 0; +} + +int nativeFlagsNeedsTransform(dynarec_arm_t* dyn, int ninst) +{ + int jmp = dyn->insts[ninst].x64.jmp_insts; + if(jmp<0) + return 0; + if(!dyn->insts[ninst].x64.need_after || !dyn->insts[jmp].x64.need_before) + return 0; + if(dyn->insts[ninst].set_nat_flags) + return 0; + uint8_t flags_before = dyn->insts[ninst].need_nat_flags; + uint8_t nc_before = dyn->insts[ninst].normal_carry; + if(dyn->insts[ninst].invert_carry) + nc_before = 0; + uint8_t flags_after = dyn->insts[jmp].need_nat_flags; + uint8_t nc_after = dyn->insts[jmp].normal_carry; + if(dyn->insts[jmp].nat_flags_op==NAT_FLAG_OP_TOUCH) { + flags_after = dyn->insts[jmp].before_nat_flags; + nc_after = dyn->insts[jmp].normal_carry_before; + } + uint8_t flags_x86 = flag2native(dyn->insts[jmp].x64.need_before); + flags_x86 &= ~flags_after; + if((flags_before&NF_CF) && (flags_after&NF_CF) && (nc_before!=nc_after)) + return 1; + // all flags_after should be present and none remaining flags_x86 + if(((flags_before&flags_after)!=flags_after) || (flags_before&flags_x86)) + return 1; + return 0; +} + +void fpu_save_and_unwind(dynarec_arm_t* dyn, int ninst, neoncache_t* cache) +{ + memcpy(cache, &dyn->insts[ninst].n, sizeof(neoncache_t)); + neoncacheUnwind(&dyn->insts[ninst].n); +} +void fpu_unwind_restore(dynarec_arm_t* dyn, int ninst, neoncache_t* cache) +{ + memcpy(&dyn->insts[ninst].n, cache, sizeof(neoncache_t)); +} + +static uint32_t getXYMMMask(dynarec_arm_t* dyn, int ninst) +{ + if(ninst<0) return 0; + uint32_t ret = 0; + for (int i=0; i<32; ++i) { + switch(dyn->insts[ninst].n.neoncache[i].t) { + case NEON_CACHE_XMMR: + case NEON_CACHE_XMMW: + ret |= 1<insts[ninst].n.neoncache[i].n; + break; + case NEON_CACHE_YMMR: + case NEON_CACHE_YMMW: + ret |= 1<<(16+dyn->insts[ninst].n.neoncache[i].n); + break; + } + } + return ret; +} + +static void propagateXYMMUneeded(dynarec_arm_t* dyn, int ninst, uint16_t mask_x, uint16_t mask_y) +{ + if(!ninst) return; + ninst = getNominalPred(dyn, ninst); + while(ninst>=0) { + mask_x &= ~dyn->insts[ninst].n.xmm_used; + mask_y &= ~dyn->insts[ninst].n.ymm_used; + if(!mask_x && !mask_y) return; // used, value is needed + if(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT) return; // barrier, value is needed + mask_x &= ~dyn->insts[ninst].n.xmm_unneeded; + mask_y &= ~dyn->insts[ninst].n.ymm_unneeded; + if(!mask_x && !mask_y) return; // already handled + if(dyn->insts[ninst].x64.jmp) return; // stop when a jump is detected, that gets too complicated + dyn->insts[ninst].n.xmm_unneeded |= mask_x; // flags + dyn->insts[ninst].n.ymm_unneeded |= mask_y; // flags + ninst = getNominalPred(dyn, ninst); // continue + } +} + +void updateUneeded(dynarec_arm_t* dyn) +{ + if(!dyn->use_xmm && !dyn->use_ymm) + return; + for(int ninst=0; ninstsize; ++ninst) { + if(dyn->insts[ninst].n.xmm_unneeded || dyn->insts[ninst].n.ymm_unneeded) + propagateXYMMUneeded(dyn, ninst, dyn->insts[ninst].n.xmm_unneeded, dyn->insts[ninst].n.ymm_unneeded); + if(dyn->insts[ninst].df_notneeded) + propagate_nodf(dyn, ninst); + } + // try to add some preload of XYMM on jump were it would make sense + for(int ninst=0; ninstsize; ++ninst) + if((ninst && dyn->insts[ninst].pred_sz>1) || (!ninst && dyn->insts[ninst].pred_sz)) { + int i2 = dyn->size+1; + for(int j=0; jinsts[ninst].pred_sz; ++j) + if(dyn->insts[ninst].pred[j]!=ninst-1 && dyn->insts[ninst].pred[j]insts[ninst].pred[j]; + if(i2!=dyn->size+1 && i2>ninst) { + uint32_t used = getXYMMMask(dyn, i2); + if(used) { + int prev = getNominalPred(dyn, ninst); + if((prev==ninst-1) || !ninst) { + uint32_t dest = getXYMMMask(dyn, prev); + // removed unneeded + uint32_t unnedded = dyn->insts[ninst].n.xmm_unneeded | (dyn->insts[ninst].n.ymm_unneeded<<16); + // create the preload mask + uint32_t preload = (used & ~dest) & ~unnedded; + if(preload) + addSSEPreload(dyn, i2, ninst, preload); + } + } + } + } +} + +void tryEarlyFpuBarrier(dynarec_arm_t* dyn, int last_fpu_used, int ninst) +{ + // there is a barrier at ninst + // check if, up to last fpu_used, if there is some suspicious jump that would prevent the barrier to be put earlier + int usefull = 0; + for(int i=ninst-1; i>last_fpu_used; --i) + { + if(!dyn->insts[i].x64.has_next) + return; // break of chain, don't try to be smart for now + if(dyn->insts[i].x64.barrier&BARRIER_FLOAT) + return; // already done? + if(dyn->insts[i].x64.jmp && dyn->insts[i].x64.jmp_insts==-1) + usefull = 1; + if(dyn->insts[i].x64.jmp && dyn->insts[i].x64.jmp_insts!=-1) { + int i2 = dyn->insts[i].x64.jmp_insts; + if(i2ninst) { + // check if some xmm/ymm/x87 stack are used in landing point + if(i2>ninst) { + if(dyn->insts[i2].n.xmm_used || dyn->insts[i2].n.ymm_used || dyn->insts[i2].n.stack) + return; + } + // we will stop there, not trying to guess too much thing + if((usefull && (i+1)!=ninst)) { + if(BOX64ENV(dynarec_dump) || BOX64ENV(dynarec_log)>1) dynarec_log(LOG_NONE, "Putting early Float Barrier in %d for %d\n", i+1, ninst); + dyn->insts[i+1].x64.barrier|=BARRIER_FLOAT; + } + return; + } + usefull = 1; + } + for(int pred=0; predinsts[i].pred_sz; ++pred) { + if(dyn->insts[i].pred[pred]<=last_fpu_used) { + if(usefull && ((i+1)!=ninst)) { + if(BOX64ENV(dynarec_dump) || BOX64ENV(dynarec_log)>1) dynarec_log(LOG_NONE, "Putting early Float Barrier in %d for %d\n", i+1, ninst); + dyn->insts[i+1].x64.barrier|=BARRIER_FLOAT; + } + return; + } + } + if(dyn->insts[i].pred_sz>1) + usefull = 1; + } + if(usefull) { + if(BOX64ENV(dynarec_dump) || BOX64ENV(dynarec_log)>1) dynarec_log(LOG_NONE, "Putting early Float Barrier in %d for %d\n", last_fpu_used, ninst); + dyn->insts[last_fpu_used+1].x64.barrier|=BARRIER_FLOAT; + } +} + +void propagateFpuBarrier(dynarec_arm_t* dyn) +{ + if(!dyn->use_x87) + return; + int last_fpu_used = -1; + for(int ninst=0; ninstsize; ++ninst) { + int fpu_used = dyn->insts[ninst].n.xmm_used || dyn->insts[ninst].n.ymm_used || dyn->insts[ninst].mmx_used || dyn->insts[ninst].x87_used; + if(fpu_used) last_fpu_used = ninst; + dyn->insts[ninst].fpu_used = fpu_used; + if(dyn->insts[ninst].fpupurge && (last_fpu_used!=-1) && (last_fpu_used!=(ninst-1))) { + tryEarlyFpuBarrier(dyn, last_fpu_used, ninst); + last_fpu_used = -1; // reset the last_fpu_used... + } + } +} + + +void updateYmm0s(dynarec_arm_t* dyn, int ninst, int max_ninst_reached) +{ + if(!dyn->use_ymm) + return; + int can_incr = ninst == max_ninst_reached; // Are we the top-level call? + int ok = 1; + while ((can_incr || ok) && ninst < dyn->size) { + // if(dyn->need_dump) dynarec_log(LOG_NONE, "update ninst=%d (%d): can_incr=%d\n", ninst, max_ninst_reached, can_incr); + uint16_t new_purge_ymm, new_ymm0_in, new_ymm0_out; + + if (dyn->insts[ninst].pred_sz && dyn->insts[ninst].x64.alive) { + // The union of the empty set is empty (0), the intersection is the universe (-1) + // The first instruction is the entry point, which has a virtual pred with ymm0_out = 0 + // Similarly, float barriers reset ymm0s + uint16_t ymm0_union = 0; + uint16_t ymm0_inter = (ninst && !(dyn->insts[ninst].x64.barrier & BARRIER_FLOAT)) ? ((uint16_t)-1) : (uint16_t)0; + for (int i = 0; i < dyn->insts[ninst].pred_sz; ++i) { + int pred = dyn->insts[ninst].pred[i]; + // if(dyn->need_dump) dynarec_log(LOG_NONE, "\twith pred[%d] = %d", i, pred); + if (pred >= max_ninst_reached) { + // if(dyn->need_dump) dynarec_log(LOG_NONE, " (skipped)\n"); + continue; + } + + int pred_out = dyn->insts[pred].x64.has_callret ? 0 : dyn->insts[pred].ymm0_out; + // if(dyn->need_dump) dynarec_log(LOG_NONE, " ~> %04X\n", pred_out); + ymm0_union |= pred_out; + ymm0_inter &= pred_out; + } + // if(dyn->need_dump) dynarec_log(LOG_NONE, "\t=> %04X,%04X\n", ymm0_union, ymm0_inter); + // Notice the default values yield something coherent here (if all pred are after ninst) + new_purge_ymm = ymm0_union & ~ymm0_inter; + new_ymm0_in = ymm0_inter; + new_ymm0_out = (ymm0_inter | dyn->insts[ninst].ymm0_add) & ~dyn->insts[ninst].ymm0_sub; + + if ((dyn->insts[ninst].purge_ymm != new_purge_ymm) || (dyn->insts[ninst].ymm0_in != new_ymm0_in) || (dyn->insts[ninst].ymm0_out != new_ymm0_out)) { + // Need to update self and next(s) + dyn->insts[ninst].purge_ymm = new_purge_ymm; + dyn->insts[ninst].ymm0_in = new_ymm0_in; + dyn->insts[ninst].ymm0_out = new_ymm0_out; + + if (can_incr) { + // We always have ninst == max_ninst_reached when can_incr == 1 + ++max_ninst_reached; + } else { + // We need to stop here if the opcode has no "real" next or if we reached the ninst of the toplevel + ok = (max_ninst_reached - 1 != ninst) && dyn->insts[ninst].x64.has_next && !dyn->insts[ninst].x64.has_callret; + } + + int jmp = (dyn->insts[ninst].x64.jmp) ? dyn->insts[ninst].x64.jmp_insts : -1; + if ((jmp != -1) && (jmp < max_ninst_reached)) { + // if(dyn->need_dump) dynarec_log(LOG_NONE, "\t! jump to %d\n", jmp); + // The jump goes before the last instruction reached, update the destination + // If this is the top level call, this means the jump goes backward (jmp != ninst) + // Otherwise, since we don't update all instructions, we may miss the update (don't use jmp < ninst) + updateYmm0s(dyn, jmp, max_ninst_reached); + } + } else { + if (can_incr) { + // We always have ninst == max_ninst_reached when can_incr == 1 + ++max_ninst_reached; + + // Also update jumps to before (they are skipped otherwise) + int jmp = (dyn->insts[ninst].x64.jmp) ? dyn->insts[ninst].x64.jmp_insts : -1; + if ((jmp != -1) && (jmp < max_ninst_reached)) { + // if(dyn->need_dump) dynarec_log(LOG_NONE, "\t! jump to %d\n", jmp); + updateYmm0s(dyn, jmp, max_ninst_reached); + } + } else { + // We didn't update anything, we can leave + ok = 0; + } + } + } else if (can_incr) { + // We always have ninst == max_ninst_reached when can_incr == 1 + ++max_ninst_reached; + } else { + // We didn't update anything, we can leave + ok = 0; + } + ++ninst; + } +} + + +// AVX helpers +void avx_mark_zero(dynarec_arm_t* dyn, int ninst, int reg) +{ + dyn->ymm_zero |= (1<ymm_zero>>reg)&1; +} + +int is_avx_zero_unset(dynarec_arm_t* dyn, int ninst, int reg) +{ + if((dyn->ymm_zero>>reg)&1) { + dyn->ymm_zero &= ~(1<ymm_zero = 0; +} + +static int xmm_preload_reg(dynarec_arm_t* dyn, int ninst, int last, int xmm) +{ + return (xmm>7)?(XMM8 + xmm - 8):(XMM0 + xmm); +} + +static int ymm_preload_reg(dynarec_arm_t* dyn, int ninst, int last, int ymm) +{ + int i = -1; + // search for when it will be loaded the first time + int start = ninst; + for(int ii=0; ii<32 && i==-1; ++ii) + if(dyn->insts[last].n.neoncache[ii].n==ymm && (dyn->insts[last].n.neoncache[ii].t==NEON_CACHE_YMMR || dyn->insts[last].n.neoncache[ii].t==NEON_CACHE_YMMW)) + i = ii; + while((ninstinsts[ninst].n.neoncache[i].v || + (dyn->insts[ninst].n.neoncache[i].n==ymm + && (dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_YMMR || dyn->insts[ninst].n.neoncache[i].t==NEON_CACHE_YMMW)))) + i = -1; // nope + else + ++ninst; + } + return i; +} + +void addSSEPreload(dynarec_arm_t* dyn, int ninst, int i2, uint32_t preload) +{ + if((i2<0) || (i2>ninst) || !preload || dyn->insts[i2].preload_from) + return; + if(i2 && !dyn->insts[i2-1].x64.has_next) // need a previous opcode to set the preload, unless it's the #0 + return; + // check if there is jump out or outside this loop + for(int i=i2; iinsts[i].x64.has_next || (dyn->insts[i].x64.barrier&BARRIER_FLOAT)) + return; + // for now, unneeded stop at first jump, so this should also stop there + if(dyn->insts[i].x64.jmp/* && ((dyn->insts[i].x64.jmp_insts>ninst) || (dyn->insts[i].x64.jmp_instsinsts[i3].n.xmm_used&(1<insts[i3].n.ssecache[i].write = 0; + dyn->insts[i3].n.ssecache[i].reg = v; + dyn->insts[i3].n.neoncache[v].t = NEON_CACHE_XMMR; + dyn->insts[i3].n.neoncache[v].n = i; + ++i3; + } + } + } + if(preload&(1<<(16+i))) { + int v = ymm_preload_reg(dyn, i2?(i2-1):0, ninst, i); + if(v!=-1) { + ymm_mask |= 1<insts[i3].n.ymm_used&(1<insts[i3].n.neoncache[v].t = NEON_CACHE_YMMR; + dyn->insts[i3].n.neoncache[v].n = i; + ++i3; + } + } + } + } + } + preload = (preload&0xffff) | (ymm_mask<<16); // update ymm_mask + //TODO: should check native calls too? + dyn->insts[i2].preload_xmmymm = preload; + dyn->insts[i2].preload_from = ninst; + dyn->insts[i2].n.xmm_unneeded |= preload&0xffff; + dyn->insts[i2].n.ymm_unneeded |= ymm_mask; } \ No newline at end of file diff --git a/src/dynarec/arm64/dynarec_arm64_functions.h b/src/dynarec/arm64/dynarec_arm64_functions.h index b6c9590..3d50be0 100644 --- a/src/dynarec/arm64/dynarec_arm64_functions.h +++ b/src/dynarec/arm64/dynarec_arm64_functions.h @@ -51,14 +51,27 @@ int neoncache_combine_st(dynarec_arm_t* dyn, int ninst, int a, int b); // with // Do not allow i64 type int neoncache_no_i64(dynarec_arm_t* dyn, int ninst, int st, int a); +// transform x86 flags to native flags +uint8_t flag2native(uint8_t flags); +// mark a instruction as using/generating flags. return flag +uint8_t mark_natflag(dynarec_arm_t* dyn, int ninst, uint8_t flag, int before); +// propage the use of nativeflags or not (done between step 0 and step 1) +void updateNativeFlags(dynarec_arm_t* dyn); +// raz arm speicifc state when an opcode is unused +void rasNativeState(dynarec_arm_t* dyn, int ninst); +// check if natives flags needs some tranform to/from x86 flags +int nativeFlagsNeedsTransform(dynarec_arm_t* dyn, int ninst); // FPU Cache transformation (for loops) // Specific, need to be written by backend int fpuCacheNeedsTransform(dynarec_arm_t* dyn, int ninst); // Undo the changes of a neoncache to get the status before the instruction void neoncacheUnwind(neoncache_t* cache); +void fpu_save_and_unwind(dynarec_arm_t* dyn, int ninst, neoncache_t* cache); +void fpu_unwind_restore(dynarec_arm_t* dyn, int ninst, neoncache_t* cache); -// Get if ED will have the correct parity. Not emiting anything. Parity is 2 for DWORD or 3 for QWORD + +// Get if ED will have the correct parity. Not emitting anything. Parity is 2 for DWORD or 3 for QWORD int getedparity(dynarec_native_t* dyn, int ninst, uintptr_t addr, uint8_t nextop, int parity, int delta); const char* getCacheName(int t, int n); @@ -72,4 +85,21 @@ void fpu_reset_ninst(dynarec_native_t* dyn, int ninst); // is st freed int fpu_is_st_freed(dynarec_native_t* dyn, int ninst, int st); + +// propage FPU_BARRIER to trigger it as soon as possible (avoiding fetching an FPU reg if it's unused) +void propagateFpuBarrier(dynarec_arm_t* dyn); +// propage the uneeded flags on XMM/YMM regs (done between step 0 and step 1) +void updateUneeded(dynarec_arm_t* dyn); + +void updateYmm0s(dynarec_arm_t* dyn, int ninst, int max_ninst_reached); + +// add a preload of SSE/AVX register preload before i2, for a jump in ninst. Might not do it if there is jump in between that goes outside this ninst-i2 interval +void addSSEPreload(dynarec_arm_t* dyn, int ninst, int i2, uint32_t preload); + +// AVX helpers +void avx_mark_zero(dynarec_arm_t* dyn, int ninst, int reg); +int is_avx_zero(dynarec_arm_t* dyn, int ninst, int reg); +int is_avx_zero_unset(dynarec_arm_t* dyn, int ninst, int reg); +void avx_mark_zero_reset(dynarec_arm_t* dyn, int ninst); + #endif //__DYNAREC_ARM_FUNCTIONS_H__ diff --git a/src/dynarec/arm64/dynarec_arm64_helper.c b/src/dynarec/arm64/dynarec_arm64_helper.c index 506167b..e37bbbb 100644 --- a/src/dynarec/arm64/dynarec_arm64_helper.c +++ b/src/dynarec/arm64/dynarec_arm64_helper.c @@ -7,10 +7,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -23,25 +21,24 @@ #include "arm64_printer.h" #include "dynarec_arm64_private.h" #include "dynarec_arm64_functions.h" -#include "dynarec_arm64_helper.h" - -static uintptr_t geted_32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, int* l, int s); +#include "../dynarec_helper.h" /* setup r2 to address pointed by ED, also fixaddress is an optionnal delta in the range [-absmax, +absmax], with delta&mask==0 to be added to ed for LDR/STR */ uintptr_t geted(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, rex_t rex, int *l, int s, int delta) { MAYUSE(dyn); MAYUSE(ninst); MAYUSE(delta); - if(l==LOCK_LOCK) { /*SMDMB();*/DMB_ISH(); } + if (l == LOCK_LOCK) { + dyn->insts[ninst].lock = 1; + } + int lock = l?((l==LOCK_LOCK)?1:2):0; + if(lock==2) *l = 0; - if(rex.is32bits) - return geted_32(dyn, addr, ninst, nextop, ed, hint, fixaddress, unscaled, absmax, mask, l, s); + if(rex.is32bits && rex.is67) + return geted16(dyn, addr, ninst, nextop, ed, hint, fixaddress, unscaled, absmax, mask, rex, s); - int lock = l?((l==LOCK_LOCK)?1:2):0; if(unscaled) *unscaled = 0; - if(lock==2) - *l = 0; uint8_t ret = x2; uint8_t scratch = x2; *fixaddress = 0; @@ -49,6 +46,7 @@ uintptr_t geted(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, u if(hint>0 && hint=absmin) && (tmp<=absmax) && !(tmp&mask))) || !(unscaled && (tmp>-256) && (tmp<256)))) { - MOV64x(scratch, tmp); - ADDx_REG_LSL(ret, scratch, xRAX+sib_reg, (sib>>6)); + MOV64y(scratch, tmp); + ADDy_REG_LSL(ret, scratch, TO_NAT(sib_reg), (sib>>6)); } else { if(sib>>6) { - LSLx(ret, xRAX+sib_reg, (sib>>6)); + LSLy(ret, TO_NAT(sib_reg), (sib>>6)); } else - ret = xRAX+sib_reg; + ret = TO_NAT(sib_reg); if(unscaled && (tmp>-256) && (tmp<256)) *unscaled = 1; *fixaddress = tmp; } } else { + if(rex.seg && !(tmp && ((!((tmp>=absmin) && (tmp<=absmax) && !(tmp&mask))) || !(unscaled && (tmp>-256) && (tmp<256))))) { + grab_segdata(dyn, addr, ninst, ret, rex.seg); + seg_done = 1; + if(unscaled && (tmp>-256) && (tmp<256)) + *unscaled = 1; + *fixaddress = tmp; + } else if(rex.seg && tmp>-0x1000 && tmp<0x1000) { + grab_segdata(dyn, addr, ninst, ret, rex.seg); + if(tmp) { + if(tmp>0) ADDx_U12(ret, ret, tmp); + else SUBx_U12(ret, ret, -tmp); + } + seg_done = 1; + } else + MOV64y(ret, tmp); switch(lock) { case 1: addLockAddress(tmp); if(fixaddress) *fixaddress=tmp; break; case 2: if(isLockAddress(tmp)) *l=1; break; } - MOV64x(ret, tmp); } } else { if (sib_reg!=4) { - ADDx_REG_LSL(ret, xRAX+(sib&0x7)+(rex.b<<3), xRAX+sib_reg, (sib>>6)); + ADDy_REG_LSL(ret, TO_NAT((sib&0x7)+(rex.b<<3)), TO_NAT(sib_reg), (sib>>6)); } else { - ret = xRAX+(sib&0x7)+(rex.b<<3); + ret = TO_NAT((sib&0x7)+(rex.b<<3)); } } } else if((nextop&7)==5) { - int64_t tmp = F32S64; - if((tmp>=absmin) && (tmp<=absmax) && !(tmp&mask)) { - GETIP(addr+delta); - ret = xRIP; - *fixaddress = tmp; - } else if(unscaled && (tmp>-256) && (tmp<256)) { - GETIP(addr+delta); - ret = xRIP; - *fixaddress = tmp; - *unscaled = 1; - } else if(tmp>0 && tmp<0x1000) { - GETIP(addr+delta); - ADDx_U12(ret, xRIP, tmp); - } else if(tmp<0 && tmp>-0x1000) { - GETIP(addr+delta); - SUBx_U12(ret, xRIP, -tmp); - } else if(tmp+addr+delta<0x1000000000000LL) { // 3 opcodes to load immediate is cheap enough - MOV64x(ret, tmp+addr+delta); - } else { - MOV64x(ret, tmp); - GETIP(addr+delta); - ADDx_REG(ret, ret, xRIP); - } - switch(lock) { - case 1: addLockAddress(addr+delta+tmp); if(fixaddress) *fixaddress=addr+delta+tmp; break; - case 2: if(isLockAddress(addr+delta+tmp)) *l=1; break; - } - } else { - ret = xRAX+(nextop&7)+(rex.b<<3); - } - } else { - int64_t i64; - uint8_t sib = 0; - int sib_reg = 0; - if((nextop&7)==4) { - sib = F8; - sib_reg = ((sib>>3)&7)+(rex.x<<3); - } - if(nextop&0x80) - i64 = F32S; - else - i64 = F8S; - if(i64==0 || ((i64>=absmin) && (i64<=absmax) && !(i64&mask)) || (unscaled && (i64>-256) && (i64<256))) { - *fixaddress = i64; - if(unscaled && i64 && (i64>-256) && (i64<256)) - *unscaled = 1; - if((nextop&7)==4) { - if (sib_reg!=4) { - ADDx_REG_LSL(ret, xRAX+(sib&0x07)+(rex.b<<3), xRAX+sib_reg, (sib>>6)); - } else { - ret = xRAX+(sib&0x07)+(rex.b<<3); - } - } else - ret = xRAX+(nextop&0x07)+(rex.b<<3); - } else { - int64_t sub = (i64<0)?1:0; - if(sub) i64 = -i64; - if(i64<0x1000) { - if((nextop&7)==4) { - if (sib_reg!=4) { - ADDx_REG_LSL(scratch, xRAX+(sib&0x07)+(rex.b<<3), xRAX+sib_reg, (sib>>6)); - } else { - scratch = xRAX+(sib&0x07)+(rex.b<<3); + if(rex.is32bits) { + int tmp = F32S; + if(rex.seg && tmp>-0x1000 && tmp<0x1000) { + grab_segdata(dyn, addr, ninst, ret, rex.seg); + if(tmp) { + if(tmp>0) ADDx_U12(ret, ret, tmp); + else SUBx_U12(ret, ret, -tmp); } + seg_done = 1; } else - scratch = xRAX+(nextop&0x07)+(rex.b<<3); - if(sub) { - SUBx_U12(ret, scratch, i64); - } else { - ADDx_U12(ret, scratch, i64); - } - } else { - MOV64x(scratch, i64); - if((nextop&7)==4) { - if (sib_reg!=4) { - if(sub) { - SUBx_REG(scratch, xRAX+(sib&0x07)+(rex.b<<3), scratch); - } else { - ADDx_REG(scratch, scratch, xRAX+(sib&0x07)+(rex.b<<3)); - } - ADDx_REG_LSL(ret, scratch, xRAX+sib_reg, (sib>>6)); - } else { - PASS3(int tmp = xRAX+(sib&0x07)+(rex.b<<3)); - if(sub) { - SUBx_REG(ret, tmp, scratch); - } else { - ADDx_REG(ret, tmp, scratch); - } - } - } else { - PASS3(int tmp = xRAX+(nextop&0x07)+(rex.b<<3)); - if(sub) { - SUBx_REG(ret, tmp, scratch); - } else { - ADDx_REG(ret, tmp, scratch); - } - } - } - } - } - *ed = ret; - return addr; -} - -static uintptr_t geted_32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, int* l, int s) -{ - MAYUSE(dyn); MAYUSE(ninst); - - int lock = l?((l==LOCK_LOCK)?1:2):0; - if(unscaled) - *unscaled = 0; - if(lock==2) - *l = 0; - uint8_t ret = x2; - uint8_t scratch = x2; - *fixaddress = 0; - if(hint>0) ret = hint; - if(hint>0 && hint>3)&7; - if((sib&0x7)==5) { - int64_t tmp = F32S; - if (sib_reg!=4) { - if(tmp && ((!((tmp>=absmin) && (tmp<=absmax) && !(tmp&mask))) || !(unscaled && (tmp>-256) && (tmp<256)))) { - MOV32w(scratch, tmp); - ADDw_REG_LSL(ret, scratch, xRAX+sib_reg, (sib>>6)); - } else { - LSLw(ret, xRAX+sib_reg, (sib>>6)); - *fixaddress = tmp; - if(unscaled && (tmp>-256) && (tmp<256)) - *unscaled = 1; - } - } else { - switch(lock) { - case 1: addLockAddress((int32_t)tmp); if(fixaddress) *fixaddress=(int32_t)tmp; break; - case 2: if(isLockAddress((int32_t)tmp)) *l=1; break; - } MOV32w(ret, tmp); - } - } else { - if (sib_reg!=4) { - ADDw_REG_LSL(ret, xRAX+(sib&0x7), xRAX+sib_reg, (sib>>6)); - } else { - ret = xRAX+(sib&0x7); - } - } - } else if((nextop&7)==5) { - uint64_t tmp = F32; - MOV32w(ret, tmp); - switch(lock) { - case 1: addLockAddress(tmp); if(fixaddress) *fixaddress=tmp; break; - case 2: if(isLockAddress(tmp)) *l=1; break; - } - } else { - ret = xRAX+(nextop&7); - if(ret==hint) { - MOVw_REG(hint, ret); //to clear upper part - } - } - } else { - int64_t i32; - uint8_t sib = 0; - int sib_reg = 0; - if((nextop&7)==4) { - sib = F8; - sib_reg = (sib>>3)&7; - } - if(nextop&0x80) - i32 = F32S; - else - i32 = F8S; - if(i32==0 || ((i32>=absmin) && (i32<=absmax) && !(i32&mask)) || (unscaled && (i32>-256) && (i32<256))) { - *fixaddress = i32; - if(unscaled && i32 && (i32>-256) && (i32<256)) - *unscaled = 1; - if((nextop&7)==4) { - if (sib_reg!=4) { - ADDw_REG_LSL(ret, xRAX+(sib&0x07), xRAX+sib_reg, (sib>>6)); - } else { - ret = xRAX+(sib&0x07); - } - } else { - ret = xRAX+(nextop&0x07); - } - } else { - int64_t sub = (i32<0)?1:0; - if(sub) i32 = -i32; - if(i32<0x1000) { - if((nextop&7)==4) { - if (sib_reg!=4) { - ADDw_REG_LSL(scratch, xRAX+(sib&0x07), xRAX+sib_reg, (sib>>6)); - } else { - scratch = xRAX+(sib&0x07); - } - } else - scratch = xRAX+(nextop&0x07); - if(sub) { - SUBw_U12(ret, scratch, i32); - } else { - ADDw_U12(ret, scratch, i32); - } - } else { - MOV32w(scratch, i32); - if((nextop&7)==4) { - if (sib_reg!=4) { - if(sub) { - SUBw_REG(scratch, xRAX+(sib&0x07), scratch); - } else { - ADDw_REG(scratch, scratch, xRAX+(sib&0x07)); - } - ADDw_REG_LSL(ret, scratch, xRAX+sib_reg, (sib>>6)); - } else { - PASS3(int tmp = xRAX+(sib&0x07)); - if(sub) { - SUBw_REG(ret, tmp, scratch); - } else { - ADDw_REG(ret, tmp, scratch); - } - } - } else { - PASS3(int tmp = xRAX+(nextop&0x07)); - if(sub) { - SUBw_REG(ret, tmp, scratch); - } else { - ADDw_REG(ret, tmp, scratch); - } - } - } - } - } - *ed = ret; - return addr; -} - -/* setup r2 to address pointed by ED, also fixaddress is an optionnal delta in the range [-absmax, +absmax], with delta&mask==0 to be added to ed for LDR/STR */ -uintptr_t geted32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, rex_t rex, int* l, int s, int delta) -{ - MAYUSE(dyn); MAYUSE(ninst); MAYUSE(delta); - - int lock = l?((l==LOCK_LOCK)?1:2):0; - if(unscaled) - *unscaled = 0; - if(lock==2) - *l = 0; - uint8_t ret = x2; - uint8_t scratch = x2; - *fixaddress = 0; - if(hint>0) ret = hint; - if(hint>0 && hint>3)&7)+(rex.x<<3); - if((sib&0x7)==5) { - int64_t tmp = F32S; - if (sib_reg!=4) { - if(tmp && ((!((tmp>=absmin) && (tmp<=absmax) && !(tmp&mask))) || !(unscaled && (tmp>-256) && (tmp<256)))) { - MOV64x(scratch, tmp); - ADDw_REG_LSL(ret, scratch, xRAX+sib_reg, (sib>>6)); - } else { - LSLw(ret, xRAX+sib_reg, (sib>>6)); - *fixaddress = tmp; - if(unscaled && (tmp>-256) && (tmp<256)) - *unscaled = 1; - } - } else { + if(!rex.seg) switch(lock) { - case 1: addLockAddress(tmp); break; + case 1: addLockAddress(tmp); if(fixaddress) *fixaddress=tmp; break; case 2: if(isLockAddress(tmp)) *l=1; break; } - MOV64x(ret, tmp); - } } else { - if (sib_reg!=4) { - ADDw_REG_LSL(ret, xRAX+(sib&0x7)+(rex.b<<3), xRAX+sib_reg, (sib>>6)); + int64_t tmp = F32S64; + if((tmp>=absmin) && (tmp<=absmax) && !(tmp&mask)) { + GETIP(addr+delta); + ret = xRIP; + *fixaddress = tmp; + } else if(unscaled && (tmp>-256) && (tmp<256)) { + GETIP(addr+delta); + ret = xRIP; + *fixaddress = tmp; + *unscaled = 1; + } else if(tmp>0 && tmp<0x1000) { + GETIP(addr+delta); + ADDy_U12(ret, xRIP, tmp); + } else if(tmp<0 && tmp>-0x1000) { + GETIP(addr+delta); + SUBy_U12(ret, xRIP, -tmp); + } else if((tmp+addr+delta<0x1000000000000LL) && !dyn->need_reloc) { // 3 opcodes to load immediate is cheap enough + MOV64y(ret, tmp+addr+delta); } else { - ret = xRAX+(sib&0x7)+(rex.b<<3); + MOV64y(ret, tmp); + GETIP(addr+delta); + ADDy_REG(ret, ret, xRIP); } - } - } else if((nextop&7)==5) { - uint32_t tmp = F32; - MOV32w(ret, tmp); - GETIP(addr+delta); - ADDw_REG(ret, ret, xRIP); - switch(lock) { - case 1: addLockAddress(addr+delta+tmp); break; - case 2: if(isLockAddress(addr+delta+tmp)) *l=1; break; + if(!rex.seg) + switch(lock) { + case 1: addLockAddress(addr+delta+tmp); if(fixaddress) *fixaddress=addr+delta+tmp; break; + case 2: if(isLockAddress(addr+delta+tmp)) *l=1; break; + } } } else { - ret = xRAX+(nextop&7)+(rex.b<<3); - if(ret==hint) { - MOVw_REG(hint, ret); //to clear upper part - } + ret = TO_NAT((nextop & 7) + (rex.b << 3)); } } else { int64_t i64; @@ -400,69 +159,80 @@ uintptr_t geted32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, i64 = F8S; if(i64==0 || ((i64>=absmin) && (i64<=absmax) && !(i64&mask)) || (unscaled && (i64>-256) && (i64<256))) { *fixaddress = i64; - if(unscaled && (i64>-256) && (i64<256)) + if(unscaled && i64 && (i64>-256) && (i64<256)) *unscaled = 1; if((nextop&7)==4) { if (sib_reg!=4) { - ADDw_REG_LSL(ret, xRAX+(sib&0x07)+(rex.b<<3), xRAX+sib_reg, (sib>>6)); + ADDy_REG_LSL(ret, TO_NAT((sib&0x07)+(rex.b<<3)), TO_NAT(sib_reg), (sib>>6)); } else { - ret = xRAX+(sib&0x07)+(rex.b<<3); + ret = TO_NAT((sib&0x07)+(rex.b<<3)); } - } else { - ret = xRAX+(nextop&0x07)+(rex.b<<3); - } + } else + ret = TO_NAT((nextop & 0x07) + (rex.b << 3)); } else { int64_t sub = (i64<0)?1:0; if(sub) i64 = -i64; if(i64<0x1000) { if((nextop&7)==4) { if (sib_reg!=4) { - ADDw_REG_LSL(scratch, xRAX+(sib&0x07)+(rex.b<<3), xRAX+sib_reg, (sib>>6)); + ADDy_REG_LSL(scratch, TO_NAT((sib&0x07)+(rex.b<<3)), TO_NAT(sib_reg), (sib>>6)); } else { - scratch = xRAX+(sib&0x07)+(rex.b<<3); + scratch = TO_NAT((sib&0x07)+(rex.b<<3)); } } else - scratch = xRAX+(nextop&0x07)+(rex.b<<3); + scratch = TO_NAT((nextop & 0x07) + (rex.b << 3)); if(sub) { - SUBw_U12(ret, scratch, i64); + SUBy_U12(ret, scratch, i64); } else { - ADDw_U12(ret, scratch, i64); + ADDy_U12(ret, scratch, i64); } } else { - MOV32w(scratch, i64); + MOV64y(scratch, i64); if((nextop&7)==4) { if (sib_reg!=4) { if(sub) { - SUBw_REG(scratch, xRAX+(sib&0x07)+(rex.b<<3), scratch); + SUBy_REG(scratch, TO_NAT((sib&0x07)+(rex.b<<3)), scratch); } else { - ADDw_REG(scratch, scratch, xRAX+(sib&0x07)+(rex.b<<3)); + ADDy_REG(scratch, scratch, TO_NAT((sib&0x07)+(rex.b<<3))); } - ADDw_REG_LSL(ret, scratch, xRAX+sib_reg, (sib>>6)); + ADDy_REG_LSL(ret, scratch, TO_NAT(sib_reg), (sib>>6)); } else { - PASS3(int tmp = xRAX+(sib&0x07)+(rex.b<<3)); + PASS3(int tmp = TO_NAT(sib & 0x07) + (rex.b << 3)); if(sub) { - SUBw_REG(ret, tmp, scratch); + SUBy_REG(ret, tmp, scratch); } else { - ADDw_REG(ret, tmp, scratch); + ADDy_REG(ret, tmp, scratch); } } } else { - PASS3(int tmp = xRAX+(nextop&0x07)+(rex.b<<3)); + PASS3(int tmp = TO_NAT((nextop & 0x07) + (rex.b << 3))); if(sub) { - SUBw_REG(ret, tmp, scratch); + SUBy_REG(ret, tmp, scratch); } else { - ADDw_REG(ret, tmp, scratch); + ADDy_REG(ret, tmp, scratch); } } } } } + if(rex.is67 && IS_GPR(ret) && !rex.seg) { + MOVw_REG(hint, ret); // truncate for is67 case only (is32bits case regs are already 32bits only) + ret = hint; + } + if(rex.seg && !seg_done) { + if(scratch==ret) + scratch=ret+1; + grab_segdata(dyn, addr, ninst, scratch, rex.seg); + //seg offset is 64bits, so no truncation here + ADDx_REGy(hint, scratch, ret); + ret = hint; + } *ed = ret; return addr; } /* setup r2 to address pointed by ED, r3 as scratch also fixaddress is an optionnal delta in the range [-absmax, +absmax], with delta&mask==0 to be added to ed for LDR/STR */ -uintptr_t geted16(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, int s) +uintptr_t geted16(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, rex_t rex, int s) { MAYUSE(dyn); MAYUSE(ninst); @@ -479,9 +249,10 @@ uintptr_t geted16(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, int64_t offset = 0; int absmin = 0; if(s) absmin = -absmax; + int need_trunc = 0; if(!n && (m&7)==6) { offset = F16S; - MOVZw(ret, offset); + MOVZw(ret, offset); //that's 16bits only, not need to truncate } else { switch(n) { case 0: offset = 0; break; @@ -498,50 +269,59 @@ uintptr_t geted16(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, } switch(m&7) { case 0: //R_BX + R_SI - UXTHx(ret, xRBX); - UXTHx(scratch, xRSI); - ADDx_REG(ret, ret, scratch); + ADDw_REG(ret, xRBX, xRSI); + need_trunc = ret; break; case 1: //R_BX + R_DI - UXTHx(ret, xRBX); - UXTHx(scratch, xRDI); - ADDx_REG(ret, ret, scratch); + ADDw_REG(ret, xRBX, xRDI); + need_trunc = ret; break; case 2: //R_BP + R_SI - UXTHx(ret, xRBP); - UXTHx(scratch, xRSI); - ADDx_REG(ret, ret, scratch); + ADDw_REG(ret, xRBP, xRSI); + need_trunc = ret; break; case 3: //R_BP + R_DI - UXTHx(ret, xRBP); - UXTHx(scratch, xRDI); - ADDx_REG(ret, ret, scratch); + ADDw_REG(ret, xRBP, xRDI); + need_trunc = ret; break; case 4: //R_SI - UXTHx(ret, xRSI); + need_trunc = xRSI; break; case 5: //R_DI - UXTHx(ret, xRDI); + need_trunc = xRDI; break; case 6: //R_BP - UXTHx(ret, xRBP); + need_trunc = xRBP; break; case 7: //R_BX - UXTHx(ret, xRBX); + need_trunc = xRBX; break; } if(offset) { if(offset<0 && offset>-0x1000) { - SUBx_U12(ret, ret, -offset); + SUBw_U12(ret, need_trunc?need_trunc:ret, -offset); } else if(offset>0 && offset<0x1000) { - ADDx_U12(ret, ret, offset); + ADDw_U12(ret, need_trunc?need_trunc:ret, offset); } else { - MOV64x(scratch, offset); - ADDx_REG(ret, ret, scratch); + MOV32w(scratch, offset); + ADDw_REG(ret, need_trunc?need_trunc:ret, scratch); } + need_trunc = ret; } } + if(need_trunc) UXTHx(ret, need_trunc); + if(rex.seg) { + if(scratch==ret) + scratch=ret+1; + grab_segdata(dyn, addr, ninst, scratch, rex.seg); + //seg offset is 64bits, so no truncation here + if(IS_GPR(ret)) { + ADDx_REG(hint, ret, scratch); + ret = hint; + } else + ADDx_REG(ret, ret, scratch); + } *ed = ret; return addr; } @@ -559,187 +339,208 @@ void jump_to_epilog(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst) GETIP_(ip); } NOTEST(x2); - TABLE64(x2, (uintptr_t)arm64_epilog); + TABLE64C(x2, const_epilog); SMEND(); + CHECK_DFNONE(0); + if(dyn->have_purge) + doLeaveBlock(dyn, ninst, x4, x5, x6); BR(x2); } + +static int indirect_lookup(dynarec_arm_t* dyn, int ninst, int is32bits, int s1, int s2) +{ + MAYUSE(dyn); + if (!is32bits) { + // check higher 48bits + LSRx_IMM(s1, xRIP, 48); + intptr_t j64 = (intptr_t)dyn->jmp_next - (intptr_t)dyn->block; + CBNZw(s1, j64); + // load table + if(dyn->need_reloc) { + TABLE64C(s2, const_jmptbl48); + } else { + MOV64x(s2, getConst(const_jmptbl48)); // this is a static value, so will be a low address + } + #ifdef JMPTABL_SHIFT4 + UBFXx(s1, xRIP, JMPTABL_START3, JMPTABL_SHIFT3); + LDRx_REG_LSL3(s2, s2, s1); + #endif + UBFXx(s1, xRIP, JMPTABL_START2, JMPTABL_SHIFT2); + LDRx_REG_LSL3(s2, s2, s1); + } else { + // check higher 32bits disabled + // LSRx_IMM(s1, xRIP, 32); + // intptr_t j64 = (intptr_t)dyn->jmp_next - (intptr_t)dyn->block; + // CBNZw(s1, j64); + // load table + TABLE64C(s2, const_jmptbl32); + #ifdef JMPTABL_SHIFT4 + UBFXx(s1, xRIP, JMPTABL_START2, JMPTABL_SHIFT2); + LDRx_REG_LSL3(s2, s2, s1); + #endif + } + UBFXx(s1, xRIP, JMPTABL_START1, JMPTABL_SHIFT1); + LDRx_REG_LSL3(s2, s2, s1); + UBFXx(s1, xRIP, JMPTABL_START0, JMPTABL_SHIFT0); + LDRx_REG_LSL3(s1, s2, s1); + return s1; +} + void jump_to_next(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst, int is32bits) { - MAYUSE(dyn); MAYUSE(ninst); + MAYUSE(dyn); + MAYUSE(ninst); MESSAGE(LOG_DUMP, "Jump to next\n"); + if (is32bits) + ip &= 0xffffffffLL; + SMEND(); - if(reg) { - if(reg!=xRIP) { + CHECK_DFNONE(0); + int dest; + if (reg) { + if (reg != xRIP) { MOVx_REG(xRIP, reg); } NOTEST(x2); - uintptr_t tbl = is32bits?getJumpTable32():getJumpTable64(); - MAYUSE(tbl); - TABLE64(x3, tbl); - if(!is32bits) { - #ifdef JMPTABL_SHIFT4 - UBFXx(x2, xRIP, JMPTABL_START4, JMPTABL_SHIFT4); - LDRx_REG_LSL3(x3, x3, x2); - #endif - UBFXx(x2, xRIP, JMPTABL_START3, JMPTABL_SHIFT3); - LDRx_REG_LSL3(x3, x3, x2); - } - UBFXx(x2, xRIP, JMPTABL_START2, JMPTABL_SHIFT2); - LDRx_REG_LSL3(x3, x3, x2); - UBFXx(x2, xRIP, JMPTABL_START1, JMPTABL_SHIFT1); - LDRx_REG_LSL3(x3, x3, x2); - UBFXx(x2, xRIP, JMPTABL_START0, JMPTABL_SHIFT0); - LDRx_REG_LSL3(x2, x3, x2); + dest = indirect_lookup(dyn, ninst, is32bits, x2, x3); } else { NOTEST(x2); uintptr_t p = getJumpTableAddress64(ip); MAYUSE(p); - TABLE64(x3, p); + if(dyn->need_reloc) AddRelocTable64JmpTbl(dyn, ninst, ip, STEP); + TABLE64_(x3, p); GETIP_(ip); LDRx_U12(x2, x3, 0); + dest = x2; } if(reg!=x1) { MOVx_REG(x1, xRIP); } - CLEARIP(); + if(dyn->have_purge && !dyn->insts[ninst].x64.has_callret) + doLeaveBlock(dyn, ninst, x4, x5, x6); #ifdef HAVE_TRACE //MOVx(x3, 15); no access to PC reg + BLR(dest); // save LR... + #else + if (dyn->insts[ninst].x64.has_callret) { + BLR(dest); // save LR... + } else { + BR(dest); + } #endif - BLR(x2); // save LR... } -void ret_to_epilog(dynarec_arm_t* dyn, int ninst, rex_t rex) +void ret_to_next(dynarec_arm_t* dyn, uintptr_t ip, int ninst, rex_t rex) { MAYUSE(dyn); MAYUSE(ninst); - MESSAGE(LOG_DUMP, "Ret to epilog\n"); - POP1z(xRIP); + CHECK_DFNONE(0); MOVz_REG(x1, xRIP); SMEND(); - if(box64_dynarec_callret) { + if(BOX64DRENV(dynarec_callret)) { // pop the actual return address for ARM stack - LDPx_S7_postindex(x2, x6, xSP, 16); + LDPx_S7_postindex(xLR, x6, xSP, 16); SUBx_REG(x6, x6, xRIP); // is it the right address? + if(dyn->have_purge) + doLeaveBlock(dyn, ninst, x4, x5, x3); CBNZx(x6, 2*4); - BLR(x2); + RET(xLR); // not the correct return address, regular jump, but purge the stack first, it's unsync now... SUBx_U12(xSP, xSavedSP, 16); } - uintptr_t tbl = rex.is32bits?getJumpTable32():getJumpTable64(); - NOTEST(x2); - MOV64x(x2, tbl); - if(!rex.is32bits) { - #ifdef JMPTABL_SHIFT4 - UBFXx(x3, xRIP, JMPTABL_START4, JMPTABL_SHIFT4); - LDRx_REG_LSL3(x2, x2, x3); - #endif - UBFXx(x3, xRIP, JMPTABL_START3, JMPTABL_SHIFT3); - LDRx_REG_LSL3(x2, x2, x3); - } - UBFXx(x3, xRIP, JMPTABL_START2, JMPTABL_SHIFT2); - LDRx_REG_LSL3(x2, x2, x3); - UBFXx(x3, xRIP, JMPTABL_START1, JMPTABL_SHIFT1); - LDRx_REG_LSL3(x2, x2, x3); - UBFXx(x3, xRIP, JMPTABL_START0, JMPTABL_SHIFT0); - LDRx_REG_LSL3(x2, x2, x3); - BLR(x2); // save LR - CLEARIP(); -} - -void retn_to_epilog(dynarec_arm_t* dyn, int ninst, rex_t rex, int n) -{ - MAYUSE(dyn); MAYUSE(ninst); - MESSAGE(LOG_DUMP, "Retn to epilog\n"); - POP1z(xRIP); - if(n>0xfff) { - MOV32w(w1, n); - ADDz_REG(xRSP, xRSP, x1); - } else { - ADDz_U12(xRSP, xRSP, n); - } - MOVz_REG(x1, xRIP); - SMEND(); - if(box64_dynarec_callret) { - // pop the actual return address for ARM stack - LDPx_S7_postindex(x2, x6, xSP, 16); - SUBx_REG(x6, x6, xRIP); // is it the right address? - CBNZx(x6, 2*4); - BLR(x2); - // not the correct return address, regular jump - SUBx_U12(xSP, xSavedSP, 16); - } - uintptr_t tbl = rex.is32bits?getJumpTable32():getJumpTable64(); NOTEST(x2); - MOV64x(x2, tbl); - if(!rex.is32bits) { - #ifdef JMPTABL_SHIFT4 - UBFXx(x3, xRIP, JMPTABL_START4, JMPTABL_SHIFT4); - LDRx_REG_LSL3(x2, x2, x3); - #endif - UBFXx(x3, xRIP, JMPTABL_START3, JMPTABL_SHIFT3); - LDRx_REG_LSL3(x2, x2, x3); - } - UBFXx(x3, xRIP, JMPTABL_START2, JMPTABL_SHIFT2); - LDRx_REG_LSL3(x2, x2, x3); - UBFXx(x3, xRIP, JMPTABL_START1, JMPTABL_SHIFT1); - LDRx_REG_LSL3(x2, x2, x3); - UBFXx(x3, xRIP, JMPTABL_START0, JMPTABL_SHIFT0); - LDRx_REG_LSL3(x2, x2, x3); - BLR(x2); // save LR + int dest = indirect_lookup(dyn, ninst, rex.is32bits, x2, x3); + if(dyn->have_purge && !BOX64DRENV(dynarec_callret)) + doLeaveBlock(dyn, ninst, x4, x5, x6); + #ifdef HAVE_TRACE + BLR(dest); + #else + BR(dest); + #endif CLEARIP(); } -void iret_to_epilog(dynarec_arm_t* dyn, int ninst, int is64bits) +void iret_to_next(dynarec_arm_t* dyn, uintptr_t ip, int ninst, int is32bits, int is64bits) { + int64_t j64; //#warning TODO: is64bits MAYUSE(ninst); + MAYUSE(j64); MESSAGE(LOG_DUMP, "IRet to epilog\n"); SMEND(); - SET_DFNONE(x2); + SET_DFNONE(); // POP IP NOTEST(x2); if(is64bits) { - POP1(xRIP); + POP1(x1); POP1(x2); - POP1(xFlags); + POP1(x3); } else { - POP1_32(xRIP); + POP1_32(x1); POP1_32(x2); - POP1_32(xFlags); + POP1_32(x3); } - // x2 is CS - STRH_U12(x2, xEmu, offsetof(x64emu_t, segs[_CS])); - STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_CS])); + // segfault if CS is NULL + CBZw_MARK3(x2); // clean EFLAGS - MOV32w(x1, 0x3F7FD7); - ANDx_REG(xFlags, xFlags, x1); - ORRx_mask(xFlags, xFlags, 1, 0b111111, 0); // xFlags | 0b10 - SET_DFNONE(x1); + MOV32w(x4, 0x3E7FD7); // also mask RF, because it's not really handled + ANDx_REG(x3, x3, x4); + ORRx_mask(x3, x3, 1, 0b111111, 0); // xFlags | 0b10 + FORCE_DFNONE(); + if(is32bits) { + ANDw_mask(x4, x2, 0, 7); // mask 0xff + // check if return segment is 64bits, then restore rsp too + CMPSw_U12(x4, 0x23); + B_MARKSEG(cEQ); + } // POP RSP if(is64bits) { - POP1(x3); //rsp - POP1(x2); //ss + POP1(x4); //rsp + POP1(x5); //ss } else { - POP1_32(x3); //rsp - POP1_32(x2); //ss + POP1_32(x4); //rsp + POP1_32(x5); //ss } + // check if SS is NULL + CBZw_MARK(x5); // POP SS - STRH_U12(x2, xEmu, offsetof(x64emu_t, segs[_SS])); - STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_SS])); + STRH_U12(x5, xEmu, offsetof(x64emu_t, segs[_SS])); // set new RSP - MOVx_REG(xRSP, x3); + MOVx_REG(xRSP, x4); + MARKSEG; + // x2 is CS, x1 is IP, x3 is eFlags + STRH_U12(x2, xEmu, offsetof(x64emu_t, segs[_CS])); + MOVx_REG(xRIP, x1); + MOVw_REG(xFlags, x3); // Ret.... - MOV64x(x2, (uintptr_t)arm64_epilog); // epilog on purpose, CS might have changed! - BR(x2); + rex_t dummy = {0}; + dummy.is32bits = is32bits; + dummy.w = is64bits; + ret_to_next(dyn, ip, ninst, dummy); CLEARIP(); + MARK; + if(is64bits) + ADDx_U12(xRSP, xRSP, 8*2); + else + ADDx_U12(xRSP, xRSP, 4*2); + MARK3; + if(is64bits) + ADDx_U12(xRSP, xRSP, 8*3); + else + ADDx_U12(xRSP, xRSP, 4*3); + CALL_S(const_native_priv, -1); } -void call_c(dynarec_arm_t* dyn, int ninst, void* fnc, int reg, int ret, int saveflags, int savereg) +void call_c(dynarec_arm_t* dyn, int ninst, arm64_consts_t fnc, int reg, int ret, int saveflags, int savereg) { MAYUSE(fnc); + CHECK_DFNONE(1); + #if STEP == 0 + dyn->insts[ninst].nat_flags_op = NAT_FLAG_OP_UNUSABLE; + #endif if(savereg==0) - savereg = 7; + savereg = x87pc; if(saveflags) { STRx_U12(xFlags, xEmu, offsetof(x64emu_t, eflags)); } @@ -752,7 +553,10 @@ void call_c(dynarec_arm_t* dyn, int ninst, void* fnc, int reg, int ret, int save STPx_S7_offset(xR8, xR9, xEmu, offsetof(x64emu_t, regs[_R8])); fpu_pushcache(dyn, ninst, savereg, 0); } - TABLE64(reg, (uintptr_t)fnc); + #ifdef _WIN32 + LDRx_U12(xR8, xEmu, offsetof(x64emu_t, win64_teb)); + #endif + TABLE64C(reg, fnc); BLR(reg); if(ret>=0) { MOVx_REG(ret, xEmu); @@ -777,12 +581,65 @@ void call_c(dynarec_arm_t* dyn, int ninst, void* fnc, int reg, int ret, int save if(saveflags) { LDRx_U12(xFlags, xEmu, offsetof(x64emu_t, eflags)); } + if(savereg!=x87pc && dyn->need_x87check) { + NATIVE_RESTORE_X87PC(); + } + //SET_NODF(); +} + +void call_d(dynarec_arm_t* dyn, int ninst, arm64_consts_t fnc, int ret, int arg1, int arg2, int sav1, int sav2) +{ + MAYUSE(fnc); + CHECK_DFNONE(1); + #if STEP == 0 + dyn->insts[ninst].nat_flags_op = NAT_FLAG_OP_UNUSABLE; + #endif + STPx_S7_preindex(xEmu, x87pc, xSP, -16); + if((sav1>0) || (sav2>0)) { + STPx_S7_preindex((sav1>0)?sav1:xZR, (sav2>0)?sav2:xZR, xSP, -16); + } + STPx_S7_offset(xRAX, xRCX, xEmu, offsetof(x64emu_t, regs[_AX])); // x9..x15, x16,x17,x18 those needs to be saved by caller + STPx_S7_offset(xRDX, xRBX, xEmu, offsetof(x64emu_t, regs[_DX])); + STPx_S7_offset(xRSP, xRBP, xEmu, offsetof(x64emu_t, regs[_SP])); + STPx_S7_offset(xRSI, xRDI, xEmu, offsetof(x64emu_t, regs[_SI])); + STPx_S7_offset(xR8, xR9, xEmu, offsetof(x64emu_t, regs[_R8])); + STRx_U12(xFlags, xEmu, offsetof(x64emu_t, eflags)); + fpu_pushcache(dyn, ninst, x87pc, 0); + + #ifdef _WIN32 + LDRx_U12(xR8, xEmu, offsetof(x64emu_t, win64_teb)); + #endif + if(arg1!=-1) + FMOVD(0, arg1); + if(arg2!=-1) + FMOVD(1, arg2); + TABLE64C(x87pc, fnc); + BLR(x87pc); + if(ret!=-1) + FMOVD(ret, 0); // will not work if ret is 0..7 and XMM are used + if((sav1>0) || (sav2>0)) { + LDPx_S7_postindex((sav1>0)?sav1:xZR, (sav2>0)?sav2:xZR, xSP, 16); + } + LDPx_S7_postindex(xEmu, x87pc, xSP, 16); + #define GO(A, B) LDPx_S7_offset(x##A, x##B, xEmu, offsetof(x64emu_t, regs[_##A])) + GO(RAX, RCX); + GO(RDX, RBX); + GO(RSP, RBP); + GO(RSI, RDI); + GO(R8, R9); + #undef GO + LDRx_U12(xFlags, xEmu, offsetof(x64emu_t, eflags)); + fpu_popcache(dyn, ninst, x1, 0); // savereg will not be used //SET_NODF(); } void call_n(dynarec_arm_t* dyn, int ninst, void* fnc, int w) { MAYUSE(fnc); + CHECK_DFNONE(1); + #if STEP == 0 + dyn->insts[ninst].nat_flags_op = NAT_FLAG_OP_UNUSABLE; + #endif STRx_U12(xFlags, xEmu, offsetof(x64emu_t, eflags)); fpu_pushcache(dyn, ninst, x3, 1); // x9..x15, x16,x17,x18 those needs to be saved by caller @@ -793,12 +650,12 @@ void call_n(dynarec_arm_t* dyn, int ninst, void* fnc, int w) if(abs(w)>1) { MESSAGE(LOG_DUMP, "Getting %d XMM args\n", abs(w)-1); for(int i=0; ineed_reloc) { + // fnc is indirect, to help with relocation (but PltResolver might be an issue here) + TABLE64(16, (uintptr_t)fnc); + LDRx_U12(16, 16, 0); + } else { + TABLE64_(16, *(uintptr_t*)fnc); // using x16 as scratch regs for call address + } BLR(16); // put return value in x64 regs if(w>0) { @@ -823,6 +686,7 @@ void call_n(dynarec_arm_t* dyn, int ninst, void* fnc, int w) fpu_popcache(dyn, ninst, x3, 1); LDRx_U12(xFlags, xEmu, offsetof(x64emu_t, eflags)); + NATIVE_RESTORE_X87PC(); //SET_NODF(); } @@ -832,22 +696,7 @@ void grab_segdata(dynarec_arm_t* dyn, uintptr_t addr, int ninst, int reg, int se int64_t j64; MAYUSE(j64); MESSAGE(LOG_DUMP, "Get %s Offset\n", (segment==_FS)?"FS":"GS"); - int t1 = x1, t2 = x4; - if(reg==t1) ++t1; - if(reg==t2) ++t2; - LDRw_U12(t2, xEmu, offsetof(x64emu_t, segs_serial[segment])); LDRx_U12(reg, xEmu, offsetof(x64emu_t, segs_offs[segment])); - if(segment==_GS) { - CBNZw_MARKSEG(t2); // fast check - } else { - LDRx_U12(t1, xEmu, offsetof(x64emu_t, context)); - LDRw_U12(t1, t1, offsetof(box64context_t, sel_serial)); - SUBw_REG(t1, t1, t2); - CBZw_MARKSEG(t1); - } - MOVZw(x1, segment); - call_c(dyn, ninst, GetSegmentBaseEmu, t2, reg, 1, 0); - MARKSEG; MESSAGE(LOG_DUMP, "----%s Offset\n", (segment==_FS)?"FS":"GS"); } @@ -936,6 +785,7 @@ int neoncache_st_coherency(dynarec_arm_t* dyn, int ninst, int a, int b) // the reg returned is *2 for FLOAT int x87_do_push(dynarec_arm_t* dyn, int ninst, int s1, int t) { + dyn->insts[ninst].x87_used = 1; if(dyn->n.mmxcount) mmx_purgecache(dyn, ninst, 0, s1); dyn->n.x87stack+=1; @@ -970,6 +820,7 @@ int x87_do_push(dynarec_arm_t* dyn, int ninst, int s1, int t) } void x87_do_push_empty(dynarec_arm_t* dyn, int ninst, int s1) { + dyn->insts[ninst].x87_used = 1; if(dyn->n.mmxcount) mmx_purgecache(dyn, ninst, 0, s1); dyn->n.x87stack+=1; @@ -1019,6 +870,7 @@ static int internal_x87_dofree(dynarec_arm_t* dyn) } void x87_do_pop(dynarec_arm_t* dyn, int ninst, int s1) { + dyn->insts[ninst].x87_used = 1; if(dyn->n.mmxcount) mmx_purgecache(dyn, ninst, 0, s1); do { @@ -1101,17 +953,7 @@ void x87_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1, int s2, int for (int i=0; i<8; ++i) if(dyn->n.x87cache[i]!=-1) { int st = dyn->n.x87cache[i]+dyn->n.stack_pop; - #if STEP == 1 - if(!next) { // don't force promotion here - // pre-apply pop, because purge happens in-between - neoncache_promote_double(dyn, ninst, st); - } - #endif - #if STEP == 3 - if(!next && neoncache_get_current_st(dyn, ninst, st)!=NEON_CACHE_ST_D) { - MESSAGE(LOG_DUMP, "Warning, incoherency with purged ST%d cache\n", st); - } - #endif + // don't force promotion here ADDw_U12(s3, s2, dyn->n.x87cache[i]); // unadjusted count, as it's relative to real top ANDw_mask(s3, s3, 0, 2); //mask=7 // (emu->top + st)&7 switch(neoncache_get_current_st(dyn, ninst, st)) { @@ -1156,7 +998,41 @@ void x87_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1, int s2, int } MESSAGE(LOG_DUMP, "\t---Purge x87 Cache and Synch Stackcount\n"); } - +void x87_reflectcount(dynarec_arm_t* dyn, int ninst, int s1, int s2) +{ + // Synch top & stack counter + int a = dyn->n.x87stack; + if(a) { + MESSAGE(LOG_DUMP, "\tSync x87 Count of %d-----\n", a); + // Add x87stack to emu fpu_stack + LDRw_U12(s2, xEmu, offsetof(x64emu_t, fpu_stack)); + if(a>0) { + ADDw_U12(s2, s2, a); + } else { + SUBw_U12(s2, s2, -a); + } + STRw_U12(s2, xEmu, offsetof(x64emu_t, fpu_stack)); + // Sub x87stack to top, with and 7 + LDRw_U12(s2, xEmu, offsetof(x64emu_t, top)); + if(a>0) { + SUBw_U12(s2, s2, a); + } else { + ADDw_U12(s2, s2, -a); + } + ANDw_mask(s2, s2, 0, 2); //mask=7 + STRw_U12(s2, xEmu, offsetof(x64emu_t, top)); + // update tags + LDRH_U12(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + if(a>0) { + LSLw_IMM(s1, s1, a*2); + } else { + ORRw_mask(s1, s1, 0b010000, 0b001111); // 0xffff0000 + LSRw_IMM(s1, s1, -a*2); + } + STRH_U12(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + MESSAGE(LOG_DUMP, "\t-----Sync x87 Count\n"); + } +} static void x87_reflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3) { // Synch top & stack counter @@ -1206,7 +1082,7 @@ static void x87_reflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int if(dyn->n.x87cache[i]!=-1) { ADDw_U12(s3, s2, dyn->n.x87cache[i]); ANDw_mask(s3, s3, 0, 2); // mask=7 // (emu->top + i)&7 - if(neoncache_get_st_f(dyn, ninst, dyn->n.x87cache[i])>=0) { + if(neoncache_get_current_st_f(dyn, dyn->n.x87cache[i])>=0) { int scratch = fpu_get_scratch(dyn, ninst); FCVT_D_S(scratch, dyn->n.x87reg[i]); VSTR64_REG_LSL3(scratch, s1, s3); @@ -1216,7 +1092,7 @@ static void x87_reflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int } } -static void x87_unreflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3) +void x87_unreflectcount(dynarec_arm_t* dyn, int ninst, int s1, int s2) { // go back with the top & stack counter int a = dyn->n.x87stack; @@ -1252,6 +1128,7 @@ static void x87_unreflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, in int x87_get_current_cache(dynarec_arm_t* dyn, int ninst, int st, int t) { + dyn->insts[ninst].x87_used = 1; // search in cache first for (int i=0; i<8; ++i) { if(dyn->n.x87cache[i]==st) { @@ -1265,13 +1142,13 @@ int x87_get_current_cache(dynarec_arm_t* dyn, int ninst, int st, int t) #endif return i; } - assert(dyn->n.x87cache[i]<8); } return -1; } int x87_get_cache(dynarec_arm_t* dyn, int ninst, int populate, int s1, int s2, int st, int t) { + dyn->insts[ninst].x87_used = 1; if(dyn->n.mmxcount) mmx_purgecache(dyn, ninst, 0, s1); int ret = x87_get_current_cache(dyn, ninst, st, t); @@ -1305,21 +1182,24 @@ int x87_get_cache(dynarec_arm_t* dyn, int ninst, int populate, int s1, int s2, i } int x87_get_neoncache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int st) { + dyn->insts[ninst].x87_used = 1; for(int ii=0; ii<24; ++ii) if((dyn->n.neoncache[ii].t == NEON_CACHE_ST_F || dyn->n.neoncache[ii].t == NEON_CACHE_ST_D || dyn->n.neoncache[ii].t == NEON_CACHE_ST_I64) && dyn->n.neoncache[ii].n==st) return ii; - assert(0); + dynarec_log(LOG_NONE, "Warning: x87_get_neoncache didn't find cache for ninst=%d\n", ninst); return -1; } int x87_get_st(dynarec_arm_t* dyn, int ninst, int s1, int s2, int a, int t) { + dyn->insts[ninst].x87_used = 1; return dyn->n.x87reg[x87_get_cache(dyn, ninst, 1, s1, s2, a, t)]; } int x87_get_st_empty(dynarec_arm_t* dyn, int ninst, int s1, int s2, int a, int t) { + dyn->insts[ninst].x87_used = 1; return dyn->n.x87reg[x87_get_cache(dyn, ninst, 0, s1, s2, a, t)]; } @@ -1374,6 +1254,7 @@ void x87_forget(dynarec_arm_t* dyn, int ninst, int s1, int s2, int st) void x87_reget_st(dynarec_arm_t* dyn, int ninst, int s1, int s2, int st) { + dyn->insts[ninst].x87_used = 1; if(dyn->n.mmxcount) mmx_purgecache(dyn, ninst, 0, s1); // search in cache first @@ -1424,6 +1305,7 @@ void x87_reget_st(dynarec_arm_t* dyn, int ninst, int s1, int s2, int st) void x87_free(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int st) { + dyn->insts[ninst].x87_used = 1; int ret = -1; for (int i=0; (i<8) && (ret==-1); ++i) if(dyn->n.x87cache[i] == st) @@ -1557,6 +1439,7 @@ static int isx87Empty(dynarec_arm_t* dyn) // get neon register for a MMX reg, create the entry if needed int mmx_get_reg(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int a) { + dyn->insts[ninst].mmx_used = 1; if(!dyn->n.x87stack && isx87Empty(dyn)) x87_purgecache(dyn, ninst, 0, s1, s2, s3); if(dyn->n.mmxcache[a]!=-1) @@ -1569,6 +1452,7 @@ int mmx_get_reg(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int a) // get neon register for a MMX reg, but don't try to synch it if it needed to be created int mmx_get_reg_empty(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int a) { + dyn->insts[ninst].mmx_used = 1; if(!dyn->n.x87stack && isx87Empty(dyn)) x87_purgecache(dyn, ninst, 0, s1, s2, s3); if(dyn->n.mmxcache[a]!=-1) @@ -1615,6 +1499,7 @@ static void mmx_reflectcache(dynarec_arm_t* dyn, int ninst, int s1) // get neon register for a SSE reg, create the entry if needed int sse_get_reg(dynarec_arm_t* dyn, int ninst, int s1, int a, int forwrite) { + dyn->n.xmm_used |= 1<n.ssecache[a].v!=-1) { if(forwrite) { dyn->n.ssecache[a].write = 1; // update only if forwrite @@ -1631,11 +1516,13 @@ int sse_get_reg(dynarec_arm_t* dyn, int ninst, int s1, int a, int forwrite) // get neon register for a SSE reg, but don't try to synch it if it needed to be created int sse_get_reg_empty(dynarec_arm_t* dyn, int ninst, int s1, int a) { + dyn->n.xmm_used |= 1<n.ssecache[a].v!=-1) { dyn->n.ssecache[a].write = 1; dyn->n.neoncache[dyn->n.ssecache[a].reg].t = NEON_CACHE_XMMW; return dyn->n.ssecache[a].reg; } + dyn->n.xmm_unneeded |= 1<n.ssecache[a].reg = fpu_get_reg_xmm(dyn, NEON_CACHE_XMMW, a); dyn->n.ssecache[a].write = 1; // it will be write... return dyn->n.ssecache[a].reg; @@ -1643,6 +1530,7 @@ int sse_get_reg_empty(dynarec_arm_t* dyn, int ninst, int s1, int a) // forget neon register for a SSE reg, create the entry if needed void sse_forget_reg(dynarec_arm_t* dyn, int ninst, int a) { + dyn->n.xmm_used |= 1<n.ssecache[a].v==-1) return; if(dyn->n.neoncache[dyn->n.ssecache[a].reg].t == NEON_CACHE_XMMW) { @@ -1678,6 +1566,7 @@ void sse_purge07cache(dynarec_arm_t* dyn, int ninst, int s1) MESSAGE(LOG_DUMP, "\tPurge XMM0..7 Cache ------\n"); ++old; } + dyn->n.xmm_used |= (1<n.neoncache[dyn->n.ssecache[i].reg].t == NEON_CACHE_XMMW) { VSTR128_U12(dyn->n.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); } @@ -1690,14 +1579,15 @@ void sse_purge07cache(dynarec_arm_t* dyn, int ninst, int s1) } // purge the SSE cache only -static void sse_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1) +static void sse_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1, uint32_t unneeded) { int old = -1; for (int i=0; i<16; ++i) - if(dyn->n.ssecache[i].v!=-1) { + if(dyn->n.ssecache[i].v!=-1 && !(unneeded&(1<n.xmm_used |= (1<n.ssecache[i].write) { if (old==-1) { - MESSAGE(LOG_DUMP, "\tPurge %sSSE Cache ------\n", next?"locally ":""); + MESSAGE(LOG_DUMP, "\tPurge %sSSE Cache ------\n", next?"localy ":""); ++old; } VSTR128_U12(dyn->n.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); @@ -1726,7 +1616,7 @@ static void sse_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1) avx_mark_zero_reset(dyn, ninst); } for(int i=0; i<32; ++i) { - if(dyn->n.neoncache[i].t==NEON_CACHE_YMMW) { + if(dyn->n.neoncache[i].t==NEON_CACHE_YMMW && !(unneeded&(1<<(dyn->n.neoncache[i].n+16)))) { if (old==-1) { MESSAGE(LOG_DUMP, "\tPurge %sSSE Cache ------\n", next?"locally ":""); ++old; @@ -1735,6 +1625,8 @@ static void sse_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1) } if(!next && (dyn->n.neoncache[i].t==NEON_CACHE_YMMW || dyn->n.neoncache[i].t==NEON_CACHE_YMMR)) dyn->n.neoncache[i].v = 0; + if(next && (dyn->n.neoncache[i].t==NEON_CACHE_YMMW || dyn->n.neoncache[i].t==NEON_CACHE_YMMR)) + dyn->n.xmm_used |= (1<n.neoncache[i].n); } // All done if(old!=-1) { @@ -1744,10 +1636,14 @@ static void sse_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1) static void sse_reflectcache(dynarec_arm_t* dyn, int ninst, int s1) { - for (int i=0; i<16; ++i) - if(dyn->n.ssecache[i].v!=-1 && dyn->n.ssecache[i].write) { - VSTR128_U12(dyn->n.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + for (int i=0; i<16; ++i) { + if(dyn->n.ssecache[i].v!=-1) { + dyn->n.xmm_used |= 1<n.ssecache[i].write) { + VSTR128_U12(dyn->n.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + } } + } //AVX if(dyn->ymm_zero) { int s1_set = 0; @@ -1760,13 +1656,18 @@ static void sse_reflectcache(dynarec_arm_t* dyn, int ninst, int s1) STPx_S7_offset(xZR, xZR, s1, i*16); } } - for(int i=0; i<32; ++i) + for(int i=0; i<32; ++i) { if(dyn->n.neoncache[i].t == NEON_CACHE_YMMW) VSTR128_U12(i, xEmu, offsetof(x64emu_t, ymm[dyn->n.neoncache[i].n])); + if((dyn->n.neoncache[i].t == NEON_CACHE_YMMW) || (dyn->n.neoncache[i].t == NEON_CACHE_YMMR)) + dyn->n.xmm_used |= 1<n.neoncache[i].n; + } } void sse_reflect_reg(dynarec_arm_t* dyn, int ninst, int a) { + dyn->n.xmm_used |= 1<n.ymm_used |= 1<n.ymm_unneeded |= 1<ymm_zero&(1<ymm_zero&=~(1<insts[ninst].ymm0_add |= (1<n.ymm_unneeded |= 1<insts[ninst].fpupurge = 1; + } } static int findCacheSlot(dynarec_arm_t* dyn, int ninst, int t, int n, neoncache_t* cache) @@ -2015,7 +1920,7 @@ static void swapCache(dynarec_arm_t* dyn, int ninst, int i, int j, neoncache_t * cache->neoncache[j].v = tmp.v; } -static void loadCache(dynarec_arm_t* dyn, int ninst, int stack_cnt, int s1, int s2, int s3, int* s1_val, int* s2_val, int* s3_top, neoncache_t *cache, int i, int t, int n) +static void loadCache(dynarec_arm_t* dyn, int ninst, int stack_cnt, int s1, int s2, int s3, int* s1_val, int* s2_val, int* s3_top, neoncache_t *cache, int i, int t, int n, int i2) { if(cache->neoncache[i].v) { int quad = 0; @@ -2037,13 +1942,21 @@ static void loadCache(dynarec_arm_t* dyn, int ninst, int stack_cnt, int s1, int switch(t) { case NEON_CACHE_XMMR: case NEON_CACHE_XMMW: - MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n)); - VLDR128_U12(i, xEmu, offsetof(x64emu_t, xmm[n])); + if(dyn->insts[i2].n.xmm_unneeded&(1<insts[i2].n.ymm_unneeded&(1<neoncache[i].t = t; } -static void unloadCache(dynarec_arm_t* dyn, int ninst, int stack_cnt, int s1, int s2, int s3, int* s1_val, int* s2_val, int* s3_top, neoncache_t *cache, int i, int t, int n) +static void unloadCache(dynarec_arm_t* dyn, int ninst, int stack_cnt, int s1, int s2, int s3, int* s1_val, int* s2_val, int* s3_top, neoncache_t *cache, int i, int t, int n, int i2) { switch(t) { case NEON_CACHE_XMMR: @@ -2097,12 +2010,20 @@ static void unloadCache(dynarec_arm_t* dyn, int ninst, int stack_cnt, int s1, in MESSAGE(LOG_DUMP, "\t - ignoring %s\n", getCacheName(t, n)); break; case NEON_CACHE_XMMW: - MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n)); - VSTR128_U12(i, xEmu, offsetof(x64emu_t, xmm[n])); + if(dyn->insts[i2].n.xmm_unneeded&(1<insts[i2].n.ymm_unneeded&(1< %d\n", ninst, i2); + uint32_t unneeded = dyn->insts[i2].n.xmm_unneeded | (dyn->insts[i2].n.ymm_unneeded<<16); if((!i2) || (dyn->insts[i2].x64.barrier&BARRIER_FLOAT)) { - if(dyn->n.stack_next) { - fpu_purgecache(dyn, ninst, 1, s1, s2, s3); - MESSAGE(LOG_DUMP, "\t---- Cache Transform\n"); - return; + int need_purge = 0; + if(dyn->n.stack_next) + need_purge = 1; + for(int i=0; i<24 && !need_purge; ++i) + if(dyn->n.neoncache[i].v) + need_purge = 1; + if(need_purge) { // there is something at ninst for i + fpu_purgecache(dyn, ninst, 1, s1, s2, s3, unneeded); } - for(int i=0; i<24; ++i) - if(dyn->n.neoncache[i].v) { // there is something at ninst for i - fpu_purgecache(dyn, ninst, 1, s1, s2, s3); - MESSAGE(LOG_DUMP, "\t---- Cache Transform\n"); - return; - } MESSAGE(LOG_DUMP, "\t---- Cache Transform\n"); return; } @@ -2171,12 +2091,23 @@ static void fpuCacheTransform(dynarec_arm_t* dyn, int ninst, int s1, int s2, int neoncacheUnwind(&cache_i2); if(!cache_i2.stack) { - int purge = 1; - for (int i=0; i<24 && purge; ++i) + int purge = 0; // default to purge if there is any regs that are not needed at jump + // but first check if there is regs that can be discarded because unneeded at jump point + for(int i=0; i<32 && !purge; ++i) { + if(dyn->insts[ninst].n.neoncache[i].v) { + int t = dyn->insts[ninst].n.neoncache[i].t; + int n = dyn->insts[ninst].n.neoncache[i].n; + if(((t==NEON_CACHE_XMMR) || (t==NEON_CACHE_XMMW)) && (cache_i2.xmm_unneeded&(1<n; int s1_val = 0; int s2_val = 0; - // unload every uneeded cache + // unload every unneeded cache // ymm0 first int s3_top = 1; uint16_t to_purge = dyn->ymm_zero&~dyn->insts[i2].ymm0_in; @@ -2193,34 +2124,36 @@ static void fpuCacheTransform(dynarec_arm_t* dyn, int ninst, int s1, int s2, int MESSAGE(LOG_DUMP, "\t- YMM Zero %04x / %04x\n", dyn->ymm_zero, (dyn->insts[i2].purge_ymm|to_purge)); for(int i=0; i<16; ++i) if(is_avx_zero(dyn, ninst, i) && (dyn->insts[i2].purge_ymm|to_purge)&(1<insts[i2].n.ymm_unneeded&(1<=0 && findCacheSlot(dyn, ninst, NEON_CACHE_XMMW, i, &cache_i2)==-1) - unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, j, cache.neoncache[j].t, cache.neoncache[j].n); + unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, j, cache.neoncache[j].t, cache.neoncache[j].n, i2); } for(int i=0; i<16; ++i) { int j=findCacheSlot(dyn, ninst, NEON_CACHE_YMMW, i, &cache); if(j>=0 && findCacheSlot(dyn, ninst, NEON_CACHE_YMMW, i, &cache_i2)==-1) - unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, j, cache.neoncache[j].t, cache.neoncache[j].n); + unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, j, cache.neoncache[j].t, cache.neoncache[j].n, i2); } for(int i=0; i<8; ++i) { int j=findCacheSlot(dyn, ninst, NEON_CACHE_MM, i, &cache); if(j>=0 && findCacheSlot(dyn, ninst, NEON_CACHE_MM, i, &cache_i2)==-1) - unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, j, cache.neoncache[j].t, cache.neoncache[j].n); + unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, j, cache.neoncache[j].t, cache.neoncache[j].n, i2); } for(int i=0; i<32; ++i) { if(cache.neoncache[i].v) if(findCacheSlot(dyn, ninst, cache.neoncache[i].t, cache.neoncache[i].n, &cache_i2)==-1) - unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, i, cache.neoncache[i].t, cache.neoncache[i].n); + unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, i, cache.neoncache[i].t, cache.neoncache[i].n, i2); } // and now load/swap the missing one for(int i=0; i<32; ++i) { @@ -2228,7 +2161,7 @@ static void fpuCacheTransform(dynarec_arm_t* dyn, int ninst, int s1, int s2, int if(cache_i2.neoncache[i].v != cache.neoncache[i].v) { int j; if((j=findCacheSlot(dyn, ninst, cache_i2.neoncache[i].t, cache_i2.neoncache[i].n, &cache))==-1) - loadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, i, cache_i2.neoncache[i].t, cache_i2.neoncache[i].n); + loadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, i, cache_i2.neoncache[i].t, cache_i2.neoncache[i].n, i2); else { // it's here, lets swap if needed if(j!=i) @@ -2313,53 +2246,145 @@ static void fpuCacheTransform(dynarec_arm_t* dyn, int ninst, int s1, int s2, int } MESSAGE(LOG_DUMP, "\t---- Cache Transform\n"); } -static void flagsCacheTransform(dynarec_arm_t* dyn, int ninst, int s1) +static void flagsCacheTransform(dynarec_arm_t* dyn, int ninst) { int j64; int jmp = dyn->insts[ninst].x64.jmp_insts; if(jmp<0) return; - if(dyn->f.dfnone || (dyn->insts[jmp].f_exit.dfnone_here && !dyn->insts[jmp].x64.use_flags)) // flags are fully known, nothing we can do more + if(dyn->insts[jmp].f_exit==dyn->insts[jmp].f_entry) // flags will be fully known, nothing we can do more + return; + if(dyn->insts[jmp].df_notneeded) return; MESSAGE(LOG_DUMP, "\tFlags fetch ---- ninst=%d -> %d\n", ninst, jmp); - int go = (dyn->insts[jmp].f_entry.dfnone && !dyn->f.dfnone)?1:0; - switch (dyn->insts[jmp].f_entry.pending) { - case SF_UNKNOWN: break; - case SF_SET: - if(dyn->f.pending!=SF_SET && dyn->f.pending!=SF_SET_PENDING) - go = 1; + int go_fetch = 0; + switch(dyn->insts[jmp].f_entry) { + case status_unk: + if(dyn->insts[ninst].f_exit==status_none_pending) { + FORCE_DFNONE(); + } break; - case SF_SET_PENDING: - if(dyn->f.pending!=SF_SET - && dyn->f.pending!=SF_SET_PENDING - && dyn->f.pending!=SF_PENDING) - go = 1; + case status_set: + if(dyn->insts[ninst].f_exit==status_none_pending) { + FORCE_DFNONE(); + } + if(dyn->insts[ninst].f_exit==status_unk) + go_fetch = 1; + break; + case status_none_pending: + if(dyn->insts[ninst].f_exit!=status_none) + go_fetch = 1; break; - case SF_PENDING: - if(dyn->f.pending!=SF_SET - && dyn->f.pending!=SF_SET_PENDING - && dyn->f.pending!=SF_PENDING) - go = 1; - else if (dyn->insts[jmp].f_entry.dfnone !=dyn->f.dfnone) - go = 1; + case status_none: + if(dyn->insts[ninst].f_exit==status_none_pending) { + FORCE_DFNONE(); + } else + go_fetch = 1; break; } - if(go) { - if(dyn->f.pending!=SF_PENDING) { - LDRw_U12(s1, xEmu, offsetof(x64emu_t, df)); + if(go_fetch) { + if(dyn->f==status_unk) { + LDRw_U12(x1, xEmu, offsetof(x64emu_t, df)); j64 = (GETMARKF2)-(dyn->native_size); - CBZw(s1, j64); - } - CALL_(UpdateFlags, -1, 0); + CBZw(x1, j64); + } + if(dyn->insts[ninst].need_nat_flags) + MRS_nzcv(x6); + TABLE64C(x1, const_updateflags_arm64); + BLR(x1); + if(dyn->insts[ninst].need_nat_flags) + MSR_nzcv(x6); MARKF2; } + MESSAGE(LOG_DUMP, "\t---- Flags fetch\n"); } -void CacheTransform(dynarec_arm_t* dyn, int ninst, int cacheupd, int s1, int s2, int s3) { +static void nativeFlagsTransform(dynarec_arm_t* dyn, int ninst, int s1, int s2) +{ + int j64; + int jmp = dyn->insts[ninst].x64.jmp_insts; + if(jmp<0) + return; + uint8_t flags_before = dyn->insts[ninst].need_nat_flags; + uint8_t nc_before = dyn->insts[ninst].normal_carry; + if(dyn->insts[ninst].invert_carry) + nc_before = 0; + uint8_t flags_after = dyn->insts[jmp].need_nat_flags; + uint8_t nc_after = dyn->insts[jmp].normal_carry; + if(dyn->insts[jmp].nat_flags_op==NAT_FLAG_OP_TOUCH) { + flags_after = dyn->insts[jmp].before_nat_flags; + nc_after = dyn->insts[jmp].normal_carry_before; + } + uint8_t flags_x86 = flag2native(dyn->insts[jmp].x64.need_before); + flags_x86 &= ~flags_after; + MESSAGE(LOG_DUMP, "\tNative Flags transform ---- ninst=%d -> %d %hhx -> %hhx/%hhx\n", ninst, jmp, flags_before, flags_after, flags_x86); + // flags present in before and missing in after + if((flags_before&NF_EQ) && (flags_x86&NF_EQ)) { + CSETw(s1, cEQ); + BFIw(xFlags, s1, F_ZF, 1); + } + if((flags_before&NF_SF) && (flags_x86&NF_SF)) { + CSETw(s1, cMI); + BFIw(xFlags, s1, F_SF, 1); + } + if((flags_before&NF_VF) && (flags_x86&NF_VF)) { + CSETw(s1, cVS); + BFIw(xFlags, s1, F_OF, 1); + } + if((flags_before&NF_CF) && (flags_x86&NF_CF)) { + if(nc_before) // might need to invert carry + CSETw(s1, cCS); + else + CSETw(s1, cCC); + BFIw(xFlags, s1, F_CF, 1); + } + // flags missing and needed later + int mrs = 0; + #define GO_MRS(A) if(!mrs) {mrs=1; MRS_nzcv(s2); } + if(!(flags_before&NF_EQ) && (flags_after&NF_EQ)) { + GO_MRS(s2); + UBFXw(s1, xFlags, F_ZF, 1); + BFIx(s2, s1, NZCV_Z, 1); + } + if(!(flags_before&NF_SF) && (flags_after&NF_SF)) { + GO_MRS(s2); + UBFXw(s1, xFlags, F_SF, 1); + BFIx(s2, s1, NZCV_N, 1); + } + if(!(flags_before&NF_VF) && (flags_after&NF_VF)) { + GO_MRS(s2); + UBFXw(s1, xFlags, F_OF, 1); + BFIx(s2, s1, NZCV_V, 1); + } + if(!(flags_before&NF_CF) && (flags_after&NF_CF)) { + GO_MRS(s2); + BFIx(s2, xFlags, NZCV_C, 1); // F_CF is bit 0 + if(!nc_after) + EORx_mask(s2, s2, 1, 35, 0); //mask=1< 1 - // for STEP 2 & 3, just need to refrest with current, and undo the changes (push & swap) + // for STEP 2 & 3, just need to refresh with current, and undo the changes (push & swap) dyn->n = dyn->insts[ninst].n; dyn->ymm_zero = dyn->insts[ninst].ymm0_in; neoncacheUnwind(&dyn->n); @@ -2484,10 +2509,10 @@ void fpu_reset_cache(dynarec_arm_t* dyn, int ninst, int reset_n) dyn->ymm_zero = dyn->insts[reset_n].ymm0_out; #endif #if STEP == 0 - if(box64_dynarec_dump && dyn->n.x87stack) dynarec_log(LOG_NONE, "New x87stack=%d at ResetCache in inst %d with %d\n", dyn->n.x87stack, ninst, reset_n); + if(dyn->need_dump && dyn->n.x87stack) dynarec_log(LOG_NONE, "New x87stack=%d at ResetCache in inst %d with %d\n", dyn->n.x87stack, ninst, reset_n); #endif #if defined(HAVE_TRACE) && (STEP>2) - if(box64_dynarec_dump && 0) //disable for now, need more work + if(dyn->need_dump && 0) //disable for now, need more work if(memcmp(&dyn->n, &dyn->insts[reset_n].n, sizeof(neoncache_t))) { MESSAGE(LOG_DEBUG, "Warning, difference in neoncache: reset="); for(int i=0; i<32; ++i) @@ -2664,3 +2689,91 @@ int fpu_get_reg_ymm(dynarec_arm_t* dyn, int ninst, int t, int ymm, int k1, int k printf_log(LOG_NONE, "BOX64 Dynarec: Error, unable to free a reg for YMM %d at inst=%d on pass %d\n", ymm, ninst, STEP); return i; } + +// Get an XMM quad reg and preload it (or do nothing if not possible) +static int xmm_preload_reg(dynarec_arm_t* dyn, int ninst, int last, int xmm) +{ + dyn->n.ssecache[xmm].reg = fpu_get_reg_xmm(dyn, NEON_CACHE_XMMR, xmm); + int ret = dyn->n.ssecache[xmm].reg; + dyn->n.ssecache[xmm].write = 0; + VLDR128_U12(ret, xEmu, offsetof(x64emu_t, xmm[xmm])); + return ret; +} + +// Get an YMM quad reg and preload it (or do nothing if not possible) +static int ymm_preload_reg(dynarec_arm_t* dyn, int ninst, int last, int ymm) +{ + int i = -1; + // search for when it will be loaded the first time + for(int ii=0; ii<32 && i==-1; ++ii) + if(dyn->insts[last].n.neoncache[ii].n==ymm && (dyn->insts[last].n.neoncache[ii].t==NEON_CACHE_YMMR || dyn->insts[last].n.neoncache[ii].t==NEON_CACHE_YMMW)) + i = ii; + if(i!=-1) { + VLDR128_U12(i, xEmu, offsetof(x64emu_t, ymm[ymm])); + dyn->n.neoncache[i].t = NEON_CACHE_YMMR; + dyn->n.neoncache[i].n = ymm; + } + return i; +} + +void doPreload(dynarec_arm_t* dyn, int ninst) +{ + int n = ninst?(ninst-1):ninst; + uint32_t preload = dyn->insts[ninst].preload_xmmymm; + int from = dyn->insts[ninst].preload_from; + if(!preload) return; + // preload XMM + MESSAGE(LOG_INFO, "Preload XMM/YMM -------- %x\n", preload); + for(int i=0; i<16; ++i) { + if(preload&(1<native_size + sizeof(void*)); + LDRx_literal(s1, delta); + // now increment in_used + ADDx_U12(s1, s1, offsetof(dynablock_t, in_used)); + if(cpuext.atomics) { + MOV32w(s3, 1); + STADDLw(s3, s1); + } else { + LDAXRw(s2, s1); + ADDw_U12(s2, s2, 1); + STLXRw(s3, s2, s1); + CBNZw(s3, -3*4); + } + // set tick + LDRx_U12(s2, xEmu, offsetof(x64emu_t, context)); + LDRw_U12(s2, s2, offsetof(box64context_t, tick)); + STRw_U12(s2, s1, offsetof(dynablock_t, tick)-offsetof(dynablock_t, in_used)); + MESSAGE(LOG_INFO, "-------- doEnter\n"); +} +void doLeaveBlock(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3) +{ + MESSAGE(LOG_INFO, "doLeave --------\n"); + // get dynarec address + int delta = -(dyn->native_size + sizeof(void*)); + LDRx_literal(s1, delta); + ADDx_U12(s1, s1, offsetof(dynablock_t, in_used)); + // decrement in_used + if(cpuext.atomics) { + MOV32w(s3, -1); + STADDLw(s3, s1); + } else { + LDAXRw(s2, s1); + SUBw_U12(s2, s2, 1); + STLXRw(s3, s2, s1); + CBNZw(s3, -3*4); + } + MESSAGE(LOG_INFO, "-------- doLeave\n"); +} diff --git a/src/dynarec/arm64/dynarec_arm64_helper.h b/src/dynarec/arm64/dynarec_arm64_helper.h index 769082c..33cf4f4 100644 --- a/src/dynarec/arm64/dynarec_arm64_helper.h +++ b/src/dynarec/arm64/dynarec_arm64_helper.h @@ -4,6 +4,7 @@ // undef to get Close to SSE Float->int conversions //#define PRECISE_CVT +#ifndef STEP_PASS #if STEP == 0 #include "dynarec_arm64_pass0.h" #elif STEP == 1 @@ -13,10 +14,13 @@ #elif STEP == 3 #include "dynarec_arm64_pass3.h" #endif +#define STEP_PASS +#endif #include "debug.h" #include "arm64_emitter.h" #include "../emu/x64primop.h" +#include "dynarec_arm64_consts.h" #define F8 *(uint8_t*)(addr++) #define F8S *(int8_t*)(addr++) @@ -32,409 +36,297 @@ #define PK64(a) *(uint64_t*)(addr+a) #define PKip(a) *(uint8_t*)(ip+a) -// Strong mem emulation helpers -#define SMREAD_VAL 4 -#define SMWRITE2_MIN 1 -#define SMFIRST_MIN 1 -#define SMSEQ_MIN 2 -#define SMSEQ_MAX 3 -#if STEP == 1 -// pass 1 has the jump point available -#define SMWRITE() dyn->insts[ninst].will_write = 1; dyn->smwrite = 1 -#define SMREAD() -#define SMREADLOCK(lock) -#define SMMIGHTREAD() -#define WILLWRITE2() if(box64_dynarec_strongmem>SMWRITE2_MIN) {WILLWRITE();} -#define SMWRITE2() if(box64_dynarec_strongmem>SMWRITE2_MIN) {SMWRITE();} -#define SMWRITELOCK(lock) SMWRITE() -#define WILLWRITELOCK(lock) -#define WILLWRITE() -#define SMMIGHTWRITE() if(!MODREG) {SMWRITE();} -#define SMSTART() dyn->smwrite = 0; dyn->smread = 0; -#define SMEND() if(dyn->smwrite && (box64_dynarec_strongmem>SMFIRST_MIN)) {int i = ninst; while(i>=0 && !dyn->insts[i].will_write) --i; if(i>=0) {dyn->insts[i].last_write = 1;}} dyn->smwrite = 0 -#define SMDMB() -#else -// Sequence of Write will trigger a DMB on "last" write if strongmem is >= 1 -// Block will trigget at 1st and last if strongmem is >= SMFIRST_MIN -// Read will contribute to trigger a DMB on "first" read if strongmem is >= SMREAD_MIN -// Opcode will read -#define SMREAD() if(dyn->insts[ninst].will_write) {WILLWRITE();} else if(box64_dynarec_strongmem==SMREAD_VAL && !dyn->smread) {DSB_SY(); dyn->smread = 1;} -// Opcode will read with option forced lock -#define SMREADLOCK(lock) if((lock)) {SMWRITELOCK(lock);} else {SMREAD();} -// Opcode might read (depend on nextop) -#define SMMIGHTREAD() if(!MODREG) {SMREAD();} -// Opcode has wrote -#define SMWRITE() if((box64_dynarec_strongmem>=SMFIRST_MIN) && dyn->smwrite==0 && (box64_dynarec_strongmem!=SMREAD_VAL)) {SMDMB();} if(box64_dynarec_strongmem>SMSEQ_MIN && (box64_dynarec_strongmem!=SMREAD_VAL)) {if(++dyn->smwrite>=SMSEQ_MAX) {SMDMB(); dyn->smwrite=1;}} else dyn->smwrite=1 -// Opcode has wrote (strongmem>1 only) -#define WILLWRITE2() if(box64_dynarec_strongmem>SMWRITE2_MIN) {WILLWRITE();} -#define SMWRITE2() if(box64_dynarec_strongmem>SMWRITE2_MIN) {SMWRITE();} -// Opcode has wrote with option forced lock -#define SMWRITELOCK(lock) if(lock) {SMDMB(); dyn->smwrite=1;} else {SMWRITE();} -// Opcode has wrote with option forced lock -#define WILLWRITELOCK(lock) if(lock) {DMB_ISH();} else {WILLWRITE();} -// Opcode might have wrote (depend on nextop) -#define SMMIGHTWRITE() if(!MODREG) {SMWRITE();} -// Opcode will write (without reading) -#define WILLWRITE() if((box64_dynarec_strongmem>=SMFIRST_MIN) && dyn->smwrite==0 && (box64_dynarec_strongmem!=SMREAD_VAL)) {SMDMB();} else if(box64_dynarec_strongmem>=SMFIRST_MIN && dyn->insts[ninst].last_write && (box64_dynarec_strongmem!=SMREAD_VAL)) {SMDMB();} dyn->smwrite=1 -// Start of sequence -#define SMSTART() SMEND() -// End of sequence -#define SMEND() if(dyn->smwrite && box64_dynarec_strongmem && (box64_dynarec_strongmem!=SMREAD_VAL)) {DMB_ISH();} dyn->smwrite=0; dyn->smread=0 -// Force a Data memory barrier (for LOCK: prefix) -#define SMDMB() if(box64_dynarec_strongmem){DSB_ISH();}else{DMB_ISH();} dyn->smwrite=0; dyn->smread=0 - +#ifndef FEMIT +#define FEMIT(A) EMIT(A) +#endif +#ifndef ENDPREFIX +#define ENDPREFIX #endif //LOCK_* define #define LOCK_LOCK (int*)1 // GETGD get x64 register in gd -#define GETGD gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3) +#define GETGD gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)) // GETVD get x64 register in vd -#define GETVD vd = xRAX+vex.v +#define GETVD vd = TO_NAT(vex.v) //GETED can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI -#define GETED(D) if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \ - LDxw(x1, wback, fixedaddress); \ - ed = x1; \ - } -#define GETEDx(D) if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, D); \ - LDx(x1, wback, fixedaddress); \ - ed = x1; \ - } -#define GETEDz(D) if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<(3-rex.is32bits), rex.is32bits?3:7, rex, NULL, 0, D); \ - LDz(x1, wback, fixedaddress); \ - ed = x1; \ - } -#define GETEDw(D) if((nextop&0xC0)==0xC0) { \ - ed = xEAX+(nextop&7)+(rex.b<<3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL,0, D); \ - LDW(x1, wback, fixedaddress); \ - ed = x1; \ - } -#define GETSEDw(D) if((nextop&0xC0)==0xC0) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - SXTWx(x1, ed); \ - wb = x1; \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, D); \ - LDSW(x1, wback, fixedaddress); \ - wb = ed = x1; \ - } -#define GETED32(D) if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted32(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \ - LDxw(x1, wback, fixedaddress); \ - ed = x1; \ - } -#define GETSED32w(D) if((nextop&0xC0)==0xC0) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - SXTWx(x1, ed); \ - wb = x1; \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted32(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, D); \ - LDSW(x1, wback, fixedaddress); \ - wb = ed = x1; \ - } +#define GETED(D) \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wback = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff << (2 + rex.w), (1 << (2 + rex.w)) - 1, rex, NULL, 0, D); \ + LDxw(x1, wback, fixedaddress); \ + ed = x1; \ + } +#define GETEDx(D) \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wback = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff << 3, 7, rex, NULL, 0, D); \ + LDx(x1, wback, fixedaddress); \ + ed = x1; \ + } +#define GETEDz(D) \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wback = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff << (3 - (rex.is32bits || rex.is67)), (rex.is32bits || rex.is67) ? 3 : 7, rex, NULL, 0, D); \ + LDz(x1, wback, fixedaddress); \ + ed = x1; \ + } +#define GETEDw(D) \ + if (MODREG) { \ + ed = xEAX + (nextop & 7) + (rex.b << 3); \ + wback = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff << 2, 3, rex, NULL, 0, D); \ + LDW(x1, wback, fixedaddress); \ + ed = x1; \ + } +#define GETSEDw(D) \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + SXTWx(x1, ed); \ + wb = x1; \ + wback = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, &unscaled, 0xfff << 2, 3, rex, NULL, 0, D); \ + LDSW(x1, wback, fixedaddress); \ + wb = ed = x1; \ + } //GETEDH can use hint for ed, and r1 or r2 for wback (depending on hint). wback is 0 if ed is xEAX..xEDI -#define GETEDH(hint, D) if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, (hint==x2)?x1:x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \ - LDxw(hint, wback, fixedaddress); \ - ed = hint; \ - } -#define GETED32H(hint, D) if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted32(dyn, addr, ninst, nextop, &wback, (hint==x2)?x1:x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \ - LDxw(hint, wback, fixedaddress); \ - ed = hint; \ - } +#define GETEDH(hint, D) \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wback = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, (hint == x2) ? x1 : x2, &fixedaddress, &unscaled, 0xfff << (2 + rex.w), (1 << (2 + rex.w)) - 1, rex, NULL, 0, D); \ + LDxw(hint, wback, fixedaddress); \ + ed = hint; \ + } //GETEDW can use hint for wback and ret for ed. wback is 0 if ed is xEAX..xEDI -#define GETEDW(hint, ret, D) if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - MOVxw_REG(ret, ed); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, hint, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \ - ed = ret; \ - LDxw(ed, wback, fixedaddress); \ - } -#define GETED32W(hint, ret, D) if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - MOVxw_REG(ret, ed); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted32(dyn, addr, ninst, nextop, &wback, hint, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, NULL, 0, D); \ - ed = ret; \ - LDxw(ed, wback, fixedaddress); \ - } +#define GETEDW(hint, ret, D) \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + MOVxw_REG(ret, ed); \ + wback = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, hint, &fixedaddress, &unscaled, 0xfff << (2 + rex.w), (1 << (2 + rex.w)) - 1, rex, NULL, 0, D); \ + ed = ret; \ + LDxw(ed, wback, fixedaddress); \ + } // Write back ed in wback (if wback not 0) #define WBACK if(wback) {STxw(ed, wback, fixedaddress); SMWRITE();} // Write back ed in wback (if wback not 0) #define WBACKx if(wback) {STx(ed, wback, fixedaddress); SMWRITE();} // Write back ed in wback (if wback not 0) #define WBACKw if(wback) {STW(ed, wback, fixedaddress); SMWRITE();} -//GETEDO can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI -#define GETEDO(O, D) if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, D); \ - LDRxw_REG(x1, wback, O); \ - ed = x1; \ - } -#define WBACKO(O) if(wback) {STRxw_REG(ed, wback, O); SMWRITE2();} -//GETEDOx can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI -#define GETEDOx(O, D) if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, D); \ - LDRx_REG(x1, wback, O); \ - ed = x1; \ - } -//GETEDOz can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI -#define GETEDOz(O, D) if(MODREG) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, D); \ - LDRz_REG(x1, wback, O); \ - ed = x1; \ - } -#define GETSEDOw(O, D) if((nextop&0xC0)==0xC0) { \ - ed = xRAX+(nextop&7)+(rex.b<<3); \ - SXTWx(x1, ed); \ - wb = x1; \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, D); \ - LDRSW_REG(x1, wback, O); \ - wb = ed = x1; \ - } //FAKEELike GETED, but doesn't get anything -#define FAKEED if(!MODREG) { \ - addr = fakeed(dyn, addr, ninst, nextop); \ - } +#define FAKEED \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wback = 0; \ + } else { \ + addr = fakeed(dyn, addr, ninst, nextop); \ + } + // GETGW extract x64 register in gd, that is i -#define GETGW(i) gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); UXTHw(i, gd); gd = i; +#define GETGW(i) \ + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + UXTHw(i, gd); \ + gd = i; + // GETGW extract x64 register in gd, that is i, Signed extented -#define GETSGW(i) gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); SXTHw(i, gd); gd = i; +#define GETSGW(i) \ + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + SXTHw(i, gd); \ + gd = i; + //GETEWW will use i for ed, and can use w for wback. -#define GETEWW(w, i, D) if(MODREG) { \ - wback = xRAX+(nextop&7)+(rex.b<<3);\ - UXTHw(i, wback); \ - ed = i; \ - wb1 = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, w, &fixedaddress, &unscaled, 0xfff<<1, (1<<1)-1, rex, NULL, 0, D); \ - LDH(i, wback, fixedaddress);\ - ed = i; \ - wb1 = 1; \ - } +#define GETEWW(w, i, D) \ + if (MODREG) { \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ + UXTHw(i, wback); \ + ed = i; \ + wb1 = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, w, &fixedaddress, &unscaled, 0xfff << 1, (1 << 1) - 1, rex, NULL, 0, D); \ + LDH(i, wback, fixedaddress); \ + ed = i; \ + wb1 = 1; \ + } +//Compute wback for MDREG only, no fetching +#define CALCEW() \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ //GETEW will use i for ed, and can use r3 for wback. -#define GETEW(i, D) if(MODREG) { \ - wback = xRAX+(nextop&7)+(rex.b<<3);\ - UXTHw(i, wback); \ - ed = i; \ - wb1 = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, (1<<1)-1, rex, NULL, 0, D); \ - LDH(i, wback, fixedaddress); \ - ed = i; \ - wb1 = 1; \ - } +#define GETEW(i, D) \ + if (MODREG) { \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ + UXTHw(i, wback); \ + ed = i; \ + wb1 = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff << 1, (1 << 1) - 1, rex, NULL, 0, D); \ + LDH(i, wback, fixedaddress); \ + ed = i; \ + wb1 = 1; \ + } //GETEW will use i for ed, and can use r3 for wback. -#define GETEW32(i, D) if(MODREG) { \ - wback = xRAX+(nextop&7)+(rex.b<<3);\ - UXTHw(i, wback); \ - ed = i; \ - wb1 = 0; \ - } else { \ - SMREAD(); \ - addr = geted32(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, (1<<1)-1, rex, NULL, 0, D); \ - LDH(i, wback, fixedaddress); \ - ed = i; \ - wb1 = 1; \ - } -//GETEWO will use i for ed, i is also Offset, and can use r3 for wback. -#define GETEWO(i, D) if(MODREG) { \ - wback = xRAX+(nextop&7)+(rex.b<<3);\ - UXTHw(i, wback); \ - ed = i; \ - wb1 = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, (1<<1)-1, rex, NULL, 0, D); \ - ADDx_REG(x3, wback, i); \ - if(wback!=x3) wback = x3; \ - LDH(i, wback, fixedaddress);\ - wb1 = 1; \ - ed = i; \ - } +#define GETEW32(i, D) \ + if (MODREG) { \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ + UXTHw(i, wback); \ + ed = i; \ + wb1 = 0; \ + } else { \ + SMREAD(); \ + addr = geted32(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff << 1, (1 << 1) - 1, rex, NULL, 0, D); \ + LDH(i, wback, fixedaddress); \ + ed = i; \ + wb1 = 1; \ + } //GETSEW will use i for ed, and can use r3 for wback. This is the Signed version -#define GETSEW(i, D) if(MODREG) { \ - wback = xRAX+(nextop&7)+(rex.b<<3);\ - SXTHw(i, wback); \ - ed = i; \ - wb1 = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff<<1, (1<<1)-1, rex, NULL, 0, D); \ - LDSHw(i, wback, fixedaddress); \ - ed = i; \ - wb1 = 1; \ - } +#define GETSEW(i, D) \ + if (MODREG) { \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ + SXTHw(i, wback); \ + ed = i; \ + wb1 = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff << 1, (1 << 1) - 1, rex, NULL, 0, D); \ + LDSHw(i, wback, fixedaddress); \ + ed = i; \ + wb1 = 1; \ + } // Write ed back to original register / memory #define EWBACK EWBACKW(ed) // Write w back to original register / memory #define EWBACKW(w) if(wb1) {STH(w, wback, fixedaddress); SMWRITE();} else {BFIx(wback, w, 0, 16);} // Write back gd in correct register -#define GWBACK BFIx((xRAX+((nextop&0x38)>>3)+(rex.r<<3)), gd, 0, 16); +#define GWBACK BFIx(TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)), gd, 0, 16); +// no fetch version of GETEB for MODREG path only +#define CALCEB() \ + if (rex.rex) { \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wb2 = 0; \ + } else { \ + wback = (nextop & 7); \ + wb2 = (wback >> 2) * 8; \ + wback = TO_NAT(wback & 3); \ + } \ //GETEB will use i for ed, and can use r3 for wback. -#define GETEB(i, D) if(MODREG) { \ - if(rex.rex) { \ - wback = xRAX+(nextop&7)+(rex.b<<3); \ - wb2 = 0; \ - } else { \ - wback = (nextop&7); \ - wb2 = (wback>>2)*8; \ - wback = xRAX+(wback&3); \ - } \ - UBFXx(i, wback, wb2, 8); \ - wb1 = 0; \ - ed = i; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, D); \ - LDB(i, wback, fixedaddress);\ - wb1 = 1; \ - ed = i; \ - } -//GETEBO will use i for ed, i is also Offset, and can use r3 for wback. -#define GETEBO(i, D) if(MODREG) { \ - if(rex.rex) { \ - wback = xRAX+(nextop&7)+(rex.b<<3); \ - wb2 = 0; \ - } else { \ - wback = (nextop&7); \ - wb2 = (wback>>2)*8; \ - wback = xRAX+(wback&3); \ - } \ - UBFXx(i, wback, wb2, 8); \ - wb1 = 0; \ - ed = i; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, D); \ - ADDx_REG(x3, wback, i); \ - if(wback!=x3) wback = x3; \ - LDB(i, wback, fixedaddress);\ - wb1 = 1; \ - ed = i; \ - } +#define GETEB(i, D) \ + if (MODREG) { \ + if (rex.rex) { \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wb2 = 0; \ + } else { \ + wback = (nextop & 7); \ + wb2 = (wback >> 2) * 8; \ + wback = TO_NAT(wback & 3); \ + } \ + UBFXx(i, wback, wb2, 8); \ + wb1 = 0; \ + ed = i; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, D); \ + LDB(i, wback, fixedaddress); \ + wb1 = 1; \ + ed = i; \ + } //GETSEB sign extend EB, will use i for ed, and can use r3 for wback. -#define GETSEB(i, D) if(MODREG) { \ - if(rex.rex) { \ - wback = xRAX+(nextop&7)+(rex.b<<3); \ - wb2 = 0; \ - } else { \ - wback = (nextop&7); \ - wb2 = (wback>>2)*8; \ - wback = xRAX+(wback&3); \ - } \ - SBFXx(i, wback, wb2, 8); \ - wb1 = 0; \ - ed = i; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, D); \ - LDSBx(i, wback, fixedaddress); \ - wb1 = 1; \ - ed = i; \ - } +#define GETSEB(i, D) \ + if (MODREG) { \ + if (rex.rex) { \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wb2 = 0; \ + } else { \ + wback = (nextop & 7); \ + wb2 = (wback >> 2) * 8; \ + wback = TO_NAT(wback & 3); \ + } \ + SBFXx(i, wback, wb2, 8); \ + wb1 = 0; \ + ed = i; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, D); \ + LDSBx(i, wback, fixedaddress); \ + wb1 = 1; \ + ed = i; \ + } //GETEB will use i for ed, and can use r3 for wback. -#define GETEB32(i, D) if(MODREG) { \ - if(rex.rex) { \ - wback = xRAX+(nextop&7)+(rex.b<<3); \ - wb2 = 0; \ - } else { \ - wback = (nextop&7); \ - wb2 = (wback>>2)*8; \ - wback = xRAX+(wback&3); \ - } \ - UBFXx(i, wback, wb2, 8); \ - wb1 = 0; \ - ed = i; \ - } else { \ - SMREAD(); \ - addr = geted32(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, D); \ - LDB(i, wback, fixedaddress);\ - wb1 = 1; \ - ed = i; \ - } +#define GETEB32(i, D) \ + if (MODREG) { \ + if (rex.rex) { \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wb2 = 0; \ + } else { \ + wback = (nextop & 7); \ + wb2 = (wback >> 2) * 8; \ + wback = TO_NAT(wback & 3); \ + } \ + UBFXx(i, wback, wb2, 8); \ + wb1 = 0; \ + ed = i; \ + } else { \ + SMREAD(); \ + addr = geted32(dyn, addr, ninst, nextop, &wback, x3, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, D); \ + LDB(i, wback, fixedaddress); \ + wb1 = 1; \ + ed = i; \ + } // Write eb (ed) back to original register / memory #define EBBACK if(wb1) {STB(ed, wback, fixedaddress); SMWRITE();} else {BFIx(wback, ed, wb2, 8);} +// no fetch version of GETGB +#define CALCGB() \ + if (rex.rex) { \ + gb1 = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + gb2 = 0; \ + } else { \ + gd = (nextop & 0x38) >> 3; \ + gb2 = ((gd & 4) << 1); \ + gb1 = TO_NAT(gd & 3); \ + } \ //GETGB will use i for gd -#define GETGB(i) if(rex.rex) { \ - gb1 = xRAX+((nextop&0x38)>>3)+(rex.r<<3); \ - gb2 = 0; \ - } else { \ - gd = (nextop&0x38)>>3; \ - gb2 = ((gd&4)<<1); \ - gb1 = xRAX+(gd&3); \ - } \ - gd = i; \ - UBFXx(gd, gb1, gb2, 8); +#define GETGB(i) \ + if (rex.rex) { \ + gb1 = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + gb2 = 0; \ + } else { \ + gd = (nextop & 0x38) >> 3; \ + gb2 = ((gd & 4) << 1); \ + gb1 = TO_NAT(gd & 3); \ + } \ + gd = i; \ + UBFXx(gd, gb1, gb2, 8); //GETSGB sign extend GB, will use i for gd -#define GETSGB(i) if(rex.rex) { \ - gb1 = xRAX+((nextop&0x38)>>3)+(rex.r<<3); \ - gb2 = 0; \ - } else { \ - gd = (nextop&0x38)>>3; \ - gb2 = ((gd&4)<<1); \ - gb1 = xRAX+(gd&3); \ - } \ - gd = i; \ - SBFXx(gd, gb1, gb2, 8); +#define GETSGB(i) \ + if (rex.rex) { \ + gb1 = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + gb2 = 0; \ + } else { \ + gd = (nextop & 0x38) >> 3; \ + gb2 = ((gd & 4) << 1); \ + gb1 = TO_NAT(gd & 3); \ + } \ + gd = i; \ + SBFXx(gd, gb1, gb2, 8); // Write gb (gd) back to original register / memory #define GBBACK BFIx(gb1, gd, gb2, 8); @@ -459,7 +351,7 @@ #define GETVX_empty(a) \ a = sse_get_reg_empty(dyn, ninst, x1, vex.v) -// Get empty VX, and non-writen EX +// Get empty VX, and non-written EX #define GETVX_empty_EX(vx, ex, D) \ GETEX_Y(ex, 0, D); \ GETVX_empty(vx) @@ -484,29 +376,29 @@ b = ymm_get_reg(dyn, ninst, x1, vex.v, w2, gd, k1, k2); \ a = ymm_get_reg_empty(dyn, ninst, x1, gd, vex.v, k1, k2) -// Get empty GX, and non-writen VX and EX +// Get empty GX, and non-written VX and EX #define GETGX_empty_VXEX(gx, vx, ex, D) \ GETVX(vx, 0); \ GETEX_Y(ex, 0, D); \ GETGX_empty(gx) -// Get empty GX, and non-writen EX +// Get empty GX, and non-written EX #define GETGX_empty_EX(gx, ex, D) \ GETEX_Y(ex, 0, D); \ GETGX_empty(gx) -// Get empty GX, and non-writen VX +// Get empty GX, and non-written VX #define GETGX_empty_VX(gx, vx) \ GETVX(vx, 0); \ GETGX_empty(gx) -// Get EX and and non-writen VX and GX +// Get EX and and non-written VX and GX #define GETGXVXEX(gx, vx, ex, D) \ GETVX(vx, 0); \ GETEX_Y(ex, 1, D); \ GETGX(gx, 0) -// Get GX and and non-writen VX and EX +// Get GX and and non-written VX and EX #define GETGX_VXEX(gx, vx, ex, D) \ GETVX(vx, 0); \ GETEX_Y(ex, 0, D); \ @@ -517,7 +409,7 @@ GETGX(gx, 0); \ GETEX_empty_Y(ex, D); -// Get empty GY, and non-writen VY and EY +// Get empty GY, and non-written VY and EY #define GETGY_empty_VYEY(gy, vy, ey) \ vy = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); \ if(MODREG) \ @@ -526,7 +418,7 @@ VLDR128_U12(ey, ed, fixedaddress+16); \ gy = ymm_get_reg_empty(dyn, ninst, x1, gd, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1) -// Get EY and non-writen VY and GY +// Get EY and non-written VY and GY #define GETGYVYEY(gy, vy, ey) \ vy = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); \ if(MODREG) \ @@ -535,7 +427,7 @@ VLDR128_U12(ey, ed, fixedaddress+16); \ gy = ymm_get_reg(dyn, ninst, x1, gd, 0, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1) -// Get GY and non-writen VY and EY +// Get GY and non-written VY and EY #define GETGY_VYEY(gy, vy, ey) \ vy = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); \ if(MODREG) \ @@ -544,14 +436,14 @@ VLDR128_U12(ey, ed, fixedaddress+16); \ gy = ymm_get_reg(dyn, ninst, x1, gd, 1, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1) -// Get empty EY and non-writen VY and GY +// Get empty EY and non-written VY and GY #define GETGYVYEY_empty(gy, vy, ey) \ vy = ymm_get_reg(dyn, ninst, x1, vex.v, 0, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); \ gy = ymm_get_reg(dyn, ninst, x1, gd, 0, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1); \ if(MODREG) \ ey = ymm_get_reg_empty(dyn, ninst, x1, (nextop&7)+(rex.b<<3), gd, vex.v, -1) -// Get EY and non-writen GY +// Get EY and non-written GY #define GETGYEY(gy, ey) \ if(MODREG) \ ey = ymm_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 1, gd, -1, -1); \ @@ -573,13 +465,13 @@ else \ VLDR128_U12(ey, ed, fixedaddress+16); \ -// Get empty EY and non-writen GY +// Get empty EY and non-written GY #define GETGYEY_empty(gy, ey) \ gy = ymm_get_reg(dyn, ninst, x1, gd, 0, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1, -1); \ if(MODREG) \ ey = ymm_get_reg_empty(dyn, ninst, x1, (nextop&7)+(rex.b<<3), gd, -1, -1) -// Get empty GY, and non-writen EY +// Get empty GY, and non-written EY #define GETGY_empty_EY(gy, ey) \ if(MODREG) \ ey = ymm_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0, gd, -1, -1); \ @@ -587,7 +479,7 @@ VLDR128_U12(ey, ed, fixedaddress+16); \ gy = ymm_get_reg_empty(dyn, ninst, x1, gd, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1, -1) -// Get empty VY, and non-writen EY +// Get empty VY, and non-written EY #define GETVY_empty_EY(vy, ey) \ if(MODREG) \ ey = ymm_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0, vex.v, -1, -1); \ @@ -596,88 +488,87 @@ vy = ymm_get_reg_empty(dyn, ninst, x1, vex.v, (MODREG)?((nextop&7)+(rex.b<<3)):-1, -1, -1) // Get EX as a quad, (x3 is used) -#define GETEX_Y(a, w, D) \ - if(MODREG) { \ - a = sse_get_reg(dyn, ninst, x3, (nextop&7)+(rex.b<<3), w); \ - } else { \ - if(w) {WILLWRITE2();} else {SMREAD();} \ - addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, D); \ - unscaled = 0; \ - a = fpu_get_scratch(dyn, ninst); \ - VLDR128_U12(a, ed, fixedaddress); \ +#define GETEX_Y(a, w, D) \ + if (MODREG) { \ + a = sse_get_reg(dyn, ninst, x3, (nextop & 7) + (rex.b << 3), w); \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0xffe << 4, 15, rex, NULL, 0, D); \ + unscaled = 0; \ + a = fpu_get_scratch(dyn, ninst); \ + VLDR128_U12(a, ed, fixedaddress); \ } // Get EX as a quad, (x3 is used) #define GETEX_empty_Y(a, D) \ if(MODREG) { \ a = sse_get_reg_empty(dyn, ninst, x3, (nextop&7)+(rex.b<<3)); \ } else { \ - WILLWRITE2(); \ a = fpu_get_scratch(dyn, ninst); \ addr = geted(dyn, addr, ninst, nextop, &ed, x3, &fixedaddress, NULL, 0xffe<<4, 15, rex, NULL, 0, D); \ unscaled = 0; \ } // Get EX as a quad, (x1 is used) -#define GETEX(a, w, D) \ - if(MODREG) { \ - a = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), w); \ - } else { \ - if(w) {WILLWRITE2();} else {SMREAD();} \ - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, D); \ - a = fpu_get_scratch(dyn, ninst); \ - VLD128(a, ed, fixedaddress); \ +#define GETEX(a, w, D) \ + if (MODREG) { \ + a = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), w); \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff << 4, 15, rex, NULL, 0, D); \ + a = fpu_get_scratch(dyn, ninst); \ + VLD128(a, ed, fixedaddress); \ } // Put Back EX if it was a memory and not an emm register -#define PUTEX(a) \ - if(!MODREG) { \ - VST128(a, ed, fixedaddress); \ - SMWRITE2(); \ +#define PUTEX(a) \ + if (!MODREG) { \ + VST128(a, ed, fixedaddress); \ + SMWRITE2(); \ } // Get Ex as a double, not a quad (warning, x1 get used) -#define GETEXSD(a, w, D) \ - if(MODREG) { \ - a = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), w); \ - } else { \ - if(w) {WILLWRITE2();} else {SMREAD();} \ - a = fpu_get_scratch(dyn, ninst); \ - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, D); \ - VLD64(a, ed, fixedaddress); \ +#define GETEXSD(a, w, D) \ + if (MODREG) { \ + a = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), w); \ + } else { \ + SMREAD(); \ + a = fpu_get_scratch(dyn, ninst); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff << 3, 7, rex, NULL, 0, D); \ + VLD64(a, ed, fixedaddress); \ } // Get Ex as 64bits, not a quad (warning, x1 get used) -#define GETEX64(a, w, D) GETEXSD(a, w, D) +#define GETEX64(a, w, D) GETEXSD(a, w, D) // Get Ex as a single, not a quad (warning, x1 get used) -#define GETEXSS(a, w, D) \ - if(MODREG) { \ - a = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), w); \ - } else { \ - if(w) {WILLWRITE2();} else {SMREAD();} \ - a = fpu_get_scratch(dyn, ninst); \ - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, D); \ - VLD32(a, ed, fixedaddress); \ +#define GETEXSS(a, w, D) \ + if (MODREG) { \ + a = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), w); \ + } else { \ + SMREAD(); \ + a = fpu_get_scratch(dyn, ninst); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff << 2, 3, rex, NULL, 0, D); \ + VLD32(a, ed, fixedaddress); \ } // Get Ex as 32bits, not a quad (warning, x1 get used) #define GETEX32(a, w, D) GETEXSS(a, w, D) // Get Ex as 16bits, not a quad (warning, x1 get used) -#define GETEX16(a, w, D) \ - if(MODREG) { \ - a = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), w); \ - } else { \ - if(w) {WILLWRITE2();} else {SMREAD();} \ - a = fpu_get_scratch(dyn, ninst); \ - addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, D); \ - VLD16(a, ed, fixedaddress); \ +#define GETEX16(a, w, D) \ + if (MODREG) { \ + a = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), w); \ + } else { \ + SMREAD(); \ + a = fpu_get_scratch(dyn, ninst); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff << 1, 1, rex, NULL, 0, D); \ + VLD16(a, ed, fixedaddress); \ } // Get GM, might use x1, x2 and x3 -#define GETGM(a) \ - gd = ((nextop&0x38)>>3); \ +#define GETGM(a) \ + gd = ((nextop & 0x38) >> 3); \ a = mmx_get_reg(dyn, ninst, x1, x2, x3, gd) // Get EM, might use x1, x2 and x3 @@ -692,10 +583,10 @@ } // Put Back EM if it was a memory and not an emm register -#define PUTEM(a) \ - if(!MODREG) { \ - VST64(a, ed, fixedaddress); \ - SMWRITE2(); \ +#define PUTEM(a) \ + if (!MODREG) { \ + VST64(a, ed, fixedaddress); \ + SMWRITE2(); \ } #define YMM0(a) ymm_mark_zero(dyn, ninst, a); @@ -707,18 +598,21 @@ TSTw_mask(xFlags, 0b010110, 0); \ CNEGx(r, r, cNE) -#define ALIGNED_ATOMICxw ((fixedaddress && !(fixedaddress&(((1<<(2+rex.w))-1)))) || box64_dynarec_aligned_atomics) -#define ALIGNED_ATOMICH ((fixedaddress && !(fixedaddress&1)) || box64_dynarec_aligned_atomics) +#define ALIGNED_ATOMICxw ((fixedaddress && !(fixedaddress&(((1<<(2+rex.w))-1)))) || BOX64ENV(dynarec_aligned_atomics)) +#define ALIGNED_ATOMICH ((fixedaddress && !(fixedaddress&1)) || BOX64ENV(dynarec_aligned_atomics)) // CALL will use x7 for the call address. Return value can be put in ret (unless ret is -1) // R0 will not be pushed/popd if ret is -2 -#define CALL(F, ret) call_c(dyn, ninst, F, x7, ret, 1, 0) +#define CALL(F, ret) call_c(dyn, ninst, F, x87pc, ret, 1, 0) // CALL_ will use x7 for the call address. Return value can be put in ret (unless ret is -1) // R0 will not be pushed/popd if ret is -2 -#define CALL_(F, ret, reg) call_c(dyn, ninst, F, x7, ret, 1, reg) +#define CALL_(F, ret, reg) call_c(dyn, ninst, F, x87pc, ret, 1, reg) // CALL_S will use x7 for the call address. Return value can be put in ret (unless ret is -1) // R0 will not be pushed/popd if ret is -2. Flags are not save/restored -#define CALL_S(F, ret) call_c(dyn, ninst, F, x7, ret, 0, 0) +#define CALL_S(F, ret) call_c(dyn, ninst, F, x87pc, ret, 0, 0) +// CALL_D will use x7 for the call address. Use for function having 1 or 2 double args and returning 1 double +// All regs are saved, including xmm0-7, will move arg1/arg2 to D0, D1, return D0 to ret (unless any is -1) +#define CALL_D(F, ret, arg1, arg2, sav1, sav2) call_d(dyn, ninst, F, ret, arg1, arg2, sav1, sav2) #define MARK dyn->insts[ninst].mark = dyn->native_size #define GETMARK dyn->insts[ninst].mark @@ -736,88 +630,107 @@ #define GETMARKLOCK dyn->insts[ninst].marklock // Branch to MARK if cond (use j64) -#define B_MARK(cond) \ - j64 = GETMARK-(dyn->native_size); \ +#define B_MARK(cond) \ + j64 = GETMARK-(dyn->native_size); \ Bcond(cond, j64) // Branch to MARK unconditionnal (use j64) -#define B_MARK_nocond \ - j64 = GETMARK-(dyn->native_size); \ +#define B_MARK_nocond \ + j64 = GETMARK-(dyn->native_size); \ B(j64) // Branch to MARK if reg is 0 (use j64) -#define CBZxw_MARK(reg) \ - j64 = GETMARK-(dyn->native_size); \ +#define CBZw_MARK(reg) \ + j64 = GETMARK-(dyn->native_size); \ + CBZw(reg, j64) +// Branch to MARK if reg is 0 (use j64) +#define CBZx_MARK(reg) \ + j64 = GETMARK-(dyn->native_size); \ + CBZx(reg, j64) +// Branch to MARK if reg is 0 (use j64) +#define CBZxw_MARK(reg) \ + j64 = GETMARK-(dyn->native_size); \ CBZxw(reg, j64) // Branch to MARK if reg is not 0 (use j64) -#define CBNZx_MARK(reg) \ - j64 = GETMARK-(dyn->native_size); \ +#define CBNZx_MARK(reg) \ + j64 = GETMARK-(dyn->native_size); \ CBNZx(reg, j64) // Branch to MARK if reg is not 0 (use j64) -#define CBNZw_MARK(reg) \ - j64 = GETMARK-(dyn->native_size); \ +#define CBNZxw_MARK(reg) \ + j64 = GETMARK-(dyn->native_size); \ + CBNZxw(reg, j64) +// Branch to MARK if reg is not 0 (use j64) +#define CBNZw_MARK(reg) \ + j64 = GETMARK-(dyn->native_size); \ CBNZw(reg, j64) // Test bit N of A and branch to MARK if not set -#define TBZ_MARK(A, N) \ - j64 = GETMARK-(dyn->native_size); \ +#define TBZ_MARK(A, N) \ + j64 = GETMARK-(dyn->native_size); \ TBZ(A, N, j64) // Test bit N of A and branch to MARK if set -#define TBNZ_MARK(A, N) \ - j64 = GETMARK-(dyn->native_size); \ +#define TBNZ_MARK(A, N) \ + j64 = GETMARK-(dyn->native_size); \ TBNZ(A, N, j64) // Branch to MARK2 if cond (use j64) -#define B_MARK2(cond) \ - j64 = GETMARK2-(dyn->native_size); \ +#define B_MARK2(cond) \ + j64 = GETMARK2-(dyn->native_size); \ Bcond(cond, j64) // Branch to MARK2 unconditionnal (use j64) -#define B_MARK2_nocond \ - j64 = GETMARK2-(dyn->native_size); \ +#define B_MARK2_nocond \ + j64 = GETMARK2-(dyn->native_size); \ B(j64) // Branch to MARK2 if reg is 0 (use j64) -#define CBZx_MARK2(reg) \ - j64 = GETMARK2-(dyn->native_size); \ +#define CBZx_MARK2(reg) \ + j64 = GETMARK2-(dyn->native_size); \ CBZx(reg, j64) // Branch to MARK2 if reg is not 0 (use j64) -#define CBNZx_MARK2(reg) \ - j64 = GETMARK2-(dyn->native_size); \ +#define CBNZx_MARK2(reg) \ + j64 = GETMARK2-(dyn->native_size); \ CBNZx(reg, j64) +// Branch to MARK2 if reg is not 0 (use j64) +#define CBNZw_MARK2(reg) \ + j64 = GETMARK2-(dyn->native_size); \ + CBNZw(reg, j64) +#define CBNZxw_MARK2(reg) \ + j64 = GETMARK2-(dyn->native_size); \ + CBNZxw(reg, j64) // Test bit N of A and branch to MARK2 if set -#define TBNZ_MARK2(A, N) \ - j64 = GETMARK2-(dyn->native_size); \ +#define TBNZ_MARK2(A, N) \ + j64 = GETMARK2-(dyn->native_size); \ TBNZ(A, N, j64) // Branch to MARK3 if cond (use j64) -#define B_MARK3(cond) \ - j64 = GETMARK3-(dyn->native_size); \ +#define B_MARK3(cond) \ + j64 = GETMARK3-(dyn->native_size); \ Bcond(cond, j64) // Test bit N of A and branch to MARK3 if not set -#define TBZ_MARK2(A, N) \ - j64 = GETMARK2-(dyn->native_size); \ +#define TBZ_MARK2(A, N) \ + j64 = GETMARK2-(dyn->native_size); \ TBZ(A, N, j64) // Branch to MARK3 unconditionnal (use j64) -#define B_MARK3_nocond \ - j64 = GETMARK3-(dyn->native_size); \ +#define B_MARK3_nocond \ + j64 = GETMARK3-(dyn->native_size); \ B(j64) // Branch to MARK3 if reg is not 0 (use j64) -#define CBNZx_MARK3(reg) \ - j64 = GETMARK3-(dyn->native_size); \ +#define CBNZx_MARK3(reg) \ + j64 = GETMARK3-(dyn->native_size); \ CBNZx(reg, j64) // Branch to MARK3 if reg is not 0 (use j64) -#define CBNZw_MARK3(reg) \ - j64 = GETMARK3-(dyn->native_size); \ +#define CBNZw_MARK3(reg) \ + j64 = GETMARK3-(dyn->native_size); \ CBNZw(reg, j64) // Branch to MARK3 if reg is 0 (use j64) -#define CBZx_MARK3(reg) \ - j64 = GETMARK3-(dyn->native_size); \ +#define CBZx_MARK3(reg) \ + j64 = GETMARK3-(dyn->native_size); \ CBZx(reg, j64) // Branch to MARK3 if reg is 0 (use j64) -#define CBZw_MARK3(reg) \ - j64 = GETMARK3-(dyn->native_size); \ +#define CBZw_MARK3(reg) \ + j64 = GETMARK3-(dyn->native_size); \ CBZw(reg, j64) // Test bit N of A and branch to MARK3 if not set -#define TBZ_MARK3(A, N) \ - j64 = GETMARK3-(dyn->native_size); \ +#define TBZ_MARK3(A, N) \ + j64 = GETMARK3-(dyn->native_size); \ TBZ(A, N, j64) // Test bit N of A and branch to MARK3 if set -#define TBNZ_MARK3(A, N) \ - j64 = GETMARK3-(dyn->native_size); \ +#define TBNZ_MARK3(A, N) \ + j64 = GETMARK3-(dyn->native_size); \ TBNZ(A, N, j64) // Branch to next instruction if cond (use j64) #define B_NEXT(cond) \ @@ -835,6 +748,14 @@ #define CBZx_NEXT(reg) \ j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; \ CBZx(reg, j64) +// Branch to next instruction if reg is 0 (use j64) +#define CBZxw_NEXT(reg) \ + j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; \ + CBZxw(reg, j64) +// Branch to next instruction if reg is not 0 (use j64) +#define CBNZw_NEXT(reg) \ + j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; \ + CBNZw(reg, j64) // Branch to next instruction if reg is not 0 (use j64) #define CBNZx_NEXT(reg) \ j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; \ @@ -863,6 +784,10 @@ #define B_MARKLOCK(cond) \ j64 = GETMARKLOCK-(dyn->native_size); \ Bcond(cond, j64) +// Branch to MARKLOCK unconditional (use j64) +#define B_MARKLOCK_nocond \ + j64 = GETMARKLOCK-(dyn->native_size); \ + B(j64) // Branch to MARKLOCK if reg is not 0 (use j64) #define CBNZw_MARKLOCK(reg) \ j64 = GETMARKLOCK-(dyn->native_size); \ @@ -871,13 +796,36 @@ #define CBNZx_MARKLOCK(reg) \ j64 = GETMARKLOCK-(dyn->native_size); \ CBNZx(reg, j64) +// Branch to MARKLOCK if reg is 0 (use j64) +#define CBZx_MARKLOCK(reg) \ + j64 = GETMARKLOCK-(dyn->native_size); \ + CBZx(reg, j64) + +#ifndef IFNATIVE +#define IFNATIVE(A) if(dyn->insts[ninst].need_nat_flags&(A)) +#define IFNATIVEN(A) if((dyn->insts[ninst].need_nat_flags&(A))==(A)) +#define IFNATIVE_BEFORE(A) if(dyn->insts[ninst].before_nat_flags&(A)) +#endif +#ifndef IFX #define IFX(A) if((dyn->insts[ninst].x64.gen_flags&(A))) #define IFX2(A, B) if((dyn->insts[ninst].x64.gen_flags&(A)) B) #define IFX_PENDOR0 if((dyn->insts[ninst].x64.gen_flags&(X_PEND) || !dyn->insts[ninst].x64.gen_flags)) #define IFXX(A) if((dyn->insts[ninst].x64.gen_flags==(A))) #define IFX2X(A, B) if((dyn->insts[ninst].x64.gen_flags==(A) || dyn->insts[ninst].x64.gen_flags==(B) || dyn->insts[ninst].x64.gen_flags==((A)|(B)))) #define IFXN(A, B) if((dyn->insts[ninst].x64.gen_flags&(A) && !(dyn->insts[ninst].x64.gen_flags&(B)))) +#define IFXNATIVE(X, N) if((dyn->insts[ninst].x64.gen_flags&(X)) && (dyn->insts[ninst].need_nat_flags&(N))) +#endif +#ifndef INVERTED_CARRY +#define INVERTED_CARRY !dyn->insts[ninst].normal_carry +#define INVERTED_CARRY_BEFORE !dyn->insts[ninst].normal_carry_before +#endif +#ifndef GEN_INVERTED_CARRY +#define GEN_INVERTED_CARRY() +#endif +#ifndef INVERT_CARRY +#define INVERT_CARRY(A) if(dyn->insts[ninst].normal_carry) {if(cpuext.flagm) CFINV(); else {MRS_nzcv(A); EORx_mask(A, A, 1, 35, 0); MSR_nzcv(A);}} +#endif // Generate FCOM with s1 and s2 scratch regs (the VCMP is already done) #define FCOM(s1, s2, s3) \ @@ -894,20 +842,20 @@ STRH_U12(s3, xEmu, offsetof(x64emu_t, sw)) // Generate FCOMI with s1 and s2 scratch regs (the VCMP is already done) -#define FCOMI(s1, s2) \ - IFX(X_OF|X_AF|X_SF|X_PEND) { \ +#define FCOMI(s1, s2) \ + IFX(X_OF|X_AF|X_SF) { \ MOV32w(s2, 0b100011010101); \ BICw_REG(xFlags, xFlags, s2); \ - IFX(X_CF|X_PF|X_ZF|X_PEND) { \ + IFX(X_CF|X_PF|X_ZF) { \ MOV32w(s2, 0b01000101); \ } \ } else { \ - IFX(X_CF|X_PF|X_ZF|X_PEND) { \ + IFX(X_CF|X_PF|X_ZF) { \ MOV32w(s2, 0b01000101); \ BICw_REG(xFlags, xFlags, s2); \ } \ } \ - IFX(X_CF|X_PF|X_ZF|X_PEND) { \ + IFX(X_CF|X_PF|X_ZF) { \ CSETw(s1, cMI); /* 1 if less than, 0 else */ \ /*s2 already set */ /* unordered */ \ CSELw(s1, s2, s1, cVS); \ @@ -916,8 +864,41 @@ /* greater than leave 0 */ \ ORRw_REG(xFlags, xFlags, s1); \ } \ - SET_DFNONE(s1); \ + SET_DFNONE(); \ + +#ifndef IF_UNALIGNED +#define IF_UNALIGNED(A) if(dyn->insts[ninst].unaligned) +#endif +#ifndef IF_ALIGNED +#define IF_ALIGNED(A) if (!dyn->insts[ninst].unaligned) +#endif + +#ifndef CALLRET_RET +#define CALLRET_RET(A) do {if(BOX64DRENV(dynarec_callret)>1) {NOP;}} while(0) +#endif +#ifndef CALLRET_GETRET +#define CALLRET_GETRET() (dyn->callrets?(dyn->callrets[dyn->callret_size].offs-dyn->native_size):0) +#endif +#ifndef CALLRET_LOOP +#define CALLRET_LOOP() NOP +#endif + +#ifndef NATIVE_RESTORE_X87PC +#define NATIVE_RESTORE_X87PC() \ + if(dyn->need_x87check) { \ + LDRH_U12(x87pc, xEmu, offsetof(x64emu_t, cw)); \ + UBFXw(x87pc, x87pc, 8, 2); \ + } +#endif +#ifndef X87_CHECK_PRECISION +#define X87_CHECK_PRECISION(A) \ + if (!ST_IS_F(0) && dyn->need_x87check) { \ + CBNZw(x87pc, 4 + 8); \ + FCVT_S_D(A, A); \ + FCVT_D_S(A, A); \ + } +#endif #define STORE_REG(A) STRx_U12(x##A, xEmu, offsetof(x64emu_t, regs[_##A])) #define STP_REGS(A, B) STPx_S7_offset(x##A, x##B, xEmu, offsetof(x64emu_t, regs[_##A])) @@ -996,7 +977,7 @@ #else #define X87_PUSH_OR_FAIL(var, dyn, ninst, scratch, t) \ if ((dyn->n.x87stack==8) || (dyn->n.pushed==8)) { \ - if(box64_dynarec_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Push, stack=%d/%d on inst %d\n", dyn->n.x87stack, dyn->n.pushed, ninst); \ + if(dyn->need_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Push, stack=%d/%d on inst %d\n", dyn->n.x87stack, dyn->n.pushed, ninst); \ dyn->abort = 1; \ return addr; \ } \ @@ -1004,7 +985,7 @@ #define X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, scratch) \ if ((dyn->n.x87stack==8) || (dyn->n.pushed==8)) { \ - if(box64_dynarec_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Push, stack=%d/%d on inst %d\n", dyn->n.x87stack, dyn->n.pushed, ninst); \ + if(dyn->need_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Push, stack=%d/%d on inst %d\n", dyn->n.x87stack, dyn->n.pushed, ninst); \ dyn->abort = 1; \ return addr; \ } \ @@ -1012,65 +993,64 @@ #define X87_POP_OR_FAIL(dyn, ninst, scratch) \ if ((dyn->n.x87stack==-8) || (dyn->n.poped==8)) { \ - if(box64_dynarec_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Pop, stack=%d/%d on inst %d\n", dyn->n.x87stack, dyn->n.poped, ninst); \ + if(dyn->need_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Pop, stack=%d/%d on inst %d\n", dyn->n.x87stack, dyn->n.poped, ninst); \ dyn->abort = 1; \ return addr; \ } \ x87_do_pop(dyn, ninst, scratch) #endif -#define SET_DFNONE(S) do {dyn->f.dfnone_here=1; if(!dyn->f.dfnone) {STRw_U12(wZR, xEmu, offsetof(x64emu_t, df)); dyn->f.dfnone=1;}} while(0); -#define SET_DF(S, N) \ - if((N)!=d_none) { \ - MOVZw(S, (N)); \ - STRw_U12(S, xEmu, offsetof(x64emu_t, df)); \ - if(dyn->f.pending==SF_PENDING && dyn->insts[ninst].x64.need_after && !(dyn->insts[ninst].x64.need_after&X_PEND)) { \ - CALL_(UpdateFlags, -1, 0); \ - dyn->f.pending = SF_SET; \ - SET_NODF(); \ - } \ - dyn->f.dfnone=0; \ - } else SET_DFNONE(S) -#define SET_NODF() dyn->f.dfnone = 0 -#define SET_DFOK() dyn->f.dfnone = 1; dyn->f.dfnone_here=1 - -#ifndef MAYSETFLAGS -#define MAYSETFLAGS() do {} while (0) -#endif +#define FORCE_DFNONE() STRw_U12(wZR, xEmu, offsetof(x64emu_t, df)) +#define CHECK_DFNONE(N) do {if(dyn->f==status_none_pending) {FORCE_DFNONE(); if(N) dyn->f = status_none;}} while(0) + +#define SET_DFNONE() \ + do { \ + if (dyn->f != status_none) { \ + dyn->f = status_none_pending; \ + } \ + } while (0) + +#define SET_DF(S, N) \ + if ((N) != d_none) { \ + MOVZw(S, (N)); \ + STRw_U12(S, xEmu, offsetof(x64emu_t, df)); \ + dyn->f = status_set; \ + } else \ + SET_DFNONE() #ifndef READFLAGS #define READFLAGS(A) \ - if(((A)!=X_PEND && dyn->f.pending!=SF_SET) \ - && (dyn->f.pending!=SF_SET_PENDING)) { \ - if(dyn->f.pending!=SF_PENDING) { \ - LDRw_U12(x3, xEmu, offsetof(x64emu_t, df)); \ - j64 = (GETMARKF)-(dyn->native_size); \ - CBZw(x3, j64); \ - } \ - CALL_(UpdateFlags, -1, 0); \ - MARKF; \ - dyn->f.pending = SF_SET; \ - SET_DFOK(); \ + if((A)!=X_PEND \ + && (dyn->f==status_unk)) { \ + TABLE64C(x6, const_updateflags_arm64); \ + BLR(x6); \ + dyn->f = status_none; \ } #endif +#define GRABFLAGS(A) \ + if((A)!=X_PEND \ + && ((dyn->f==status_unk) || (dyn->f==status_set))) { \ + TABLE64C(x6, const_updateflags_arm64); \ + BLR(x6); \ + dyn->f = status_none; \ + } + #ifndef SETFLAGS -#define SETFLAGS(A, B) \ - if(dyn->f.pending!=SF_SET \ - && ((B)&SF_SUB) \ +#define SETFLAGS(A, B) do { \ + if (((B)&SF_SUB) \ && (dyn->insts[ninst].x64.gen_flags&(~(A)))) \ - READFLAGS(((dyn->insts[ninst].x64.gen_flags&X_PEND)?X_ALL:dyn->insts[ninst].x64.gen_flags)&(~(A)));\ + { GRABFLAGS(((dyn->insts[ninst].x64.gen_flags&X_PEND)?X_ALL:dyn->insts[ninst].x64.gen_flags)&(~(A))); }\ if(dyn->insts[ninst].x64.gen_flags) switch(B) { \ + case SF_SET_DF: dyn->f = status_set; break; \ + case SF_SET_NODF: break; \ case SF_SUBSET: \ - case SF_SET: dyn->f.pending = SF_SET; break; \ - case SF_SET_DF: dyn->f.pending = SF_SET; dyn->f.dfnone = 1; break; \ - case SF_SET_NODF: dyn->f.pending = SF_SET; dyn->f.dfnone = 0; break; \ - case SF_PENDING: dyn->f.pending = SF_PENDING; break; \ case SF_SUBSET_PENDING: \ + case SF_SET: \ + case SF_PENDING: \ case SF_SET_PENDING: \ - dyn->f.pending = (dyn->insts[ninst].x64.gen_flags&X_PEND)?SF_SET_PENDING:SF_SET; \ - break; \ - } else dyn->f.pending = SF_SET + SET_DFNONE(); break; \ + } else if((B)!=SF_SET_NODF) SET_DFNONE();} while(0) #endif #ifndef JUMP #define JUMP(A, C) SMEND() @@ -1078,9 +1058,6 @@ #ifndef BARRIER #define BARRIER(A) #endif -#ifndef BARRIER_NEXT -#define BARRIER_NEXT(A) -#endif #ifndef SET_HASCALLRET #define SET_HASCALLRET() #endif @@ -1088,8 +1065,13 @@ #define UFLAG_OP2(A) if(dyn->insts[ninst].x64.gen_flags) {STRxw_U12(A, xEmu, offsetof(x64emu_t, op2));} #define UFLAG_OP12(A1, A2) if(dyn->insts[ninst].x64.gen_flags) {STRxw_U12(A1, xEmu, offsetof(x64emu_t, op1));STRxw_U12(A2, xEmu, offsetof(x64emu_t, op2));} #define UFLAG_RES(A) if(dyn->insts[ninst].x64.gen_flags) {STRxw_U12(A, xEmu, offsetof(x64emu_t, res));} -#define UFLAG_DF(r, A) if(dyn->insts[ninst].x64.gen_flags) {SET_DF(r, A)} +#define UFLAG_DF(r, A) if(dyn->insts[ninst].x64.gen_flags) {SET_DF(r, A);} +#ifndef UFLAG_IF #define UFLAG_IF if(dyn->insts[ninst].x64.gen_flags) +#endif +#ifndef UFLAG_IF2 +#define UFLAG_IF2(A) if(dyn->insts[ninst].x64.gen_flags A) +#endif #ifndef DEFAULT #define DEFAULT *ok = -1; BARRIER(2) #endif @@ -1099,47 +1081,67 @@ #ifndef TABLE64 #define TABLE64(A, V) #endif +#ifndef TABLE64_ +#define TABLE64_(A, V) +#endif #ifndef FTABLE64 #define FTABLE64(A, V) #endif +#ifndef TABLE64C +#define TABLE64C(A, V) +#endif -#define ARCH_INIT() \ - dyn->smread = dyn->smwrite = 0; \ - dyn->doublepush = 0; \ +#define ARCH_INIT() \ + SMSTART(); \ + dyn->doublepush = 0; \ dyn->doublepop = 0; +#define ARCH_RESET() #if STEP < 2 -#define GETIP(A) TABLE64(0, 0) -#define GETIP_(A) TABLE64(0, 0) +#define GETIP(A) MOV64x(xRIP, A) +#define GETIP_(A) MOV64x(xRIP, A) #else // put value in the Table64 even if not using it for now to avoid difference between Step2 and Step3. Needs to be optimized later... -#define GETIP(A) \ - if(dyn->last_ip && ((A)-dyn->last_ip)<0x1000) { \ - uint64_t _delta_ip = (A)-dyn->last_ip; \ - dyn->last_ip += _delta_ip; \ - if(_delta_ip) { \ - ADDx_U12(xRIP, xRIP, _delta_ip); \ - } \ - } else { \ - dyn->last_ip = (A); \ - if(dyn->last_ip<0xffffffff) { \ - MOV64x(xRIP, dyn->last_ip); \ - } else \ - TABLE64(xRIP, dyn->last_ip); \ +#define GETIP(A) \ + if(dyn->last_ip && ((A)-dyn->last_ip)<0x1000) { \ + uint64_t _delta_ip = (A)-dyn->last_ip; \ + dyn->last_ip += _delta_ip; \ + if(_delta_ip) { \ + ADDx_U12(xRIP, xRIP, _delta_ip); \ + } \ + } else if(dyn->last_ip && (dyn->last_ip-(A))<0x1000) { \ + uint64_t _delta_ip = dyn->last_ip-(A); \ + dyn->last_ip -= _delta_ip; \ + if(_delta_ip) { \ + SUBx_U12(xRIP, xRIP, _delta_ip); \ + } \ + } else { \ + dyn->last_ip = (A); \ + if(dyn->need_reloc) { \ + TABLE64(xRIP, dyn->last_ip); \ + } else { \ + MOV64x(xRIP, dyn->last_ip); \ + } \ } -#define GETIP_(A) \ - if(dyn->last_ip && ((A)-dyn->last_ip)<0x1000) { \ - uint64_t _delta_ip = (A)-dyn->last_ip; \ - if(_delta_ip) {ADDx_U12(xRIP, xRIP, _delta_ip);}\ - } else { \ - if((A)<0xffffffff) { \ - MOV64x(xRIP, (A)); \ - } else \ - TABLE64(xRIP, (A)); \ +#define GETIP_(A) \ + if(dyn->last_ip && ((A)-dyn->last_ip)<0x1000) { \ + uint64_t _delta_ip = (A)-dyn->last_ip; \ + if(_delta_ip) {ADDx_U12(xRIP, xRIP, _delta_ip);} \ + } else if(dyn->last_ip && (dyn->last_ip-(A))<0x1000) { \ + uint64_t _delta_ip = dyn->last_ip-(A); \ + if(_delta_ip) {SUBx_U12(xRIP, xRIP, _delta_ip);} \ + } else { \ + if(dyn->need_reloc) { \ + TABLE64(xRIP, (A)); \ + } else { \ + MOV64x(xRIP, (A)); \ + } \ } #endif #define CLEARIP() dyn->last_ip=0 +#define SKIP_SEVL(val) if (dyn->insts[dyn->insts[ninst].x64.jmp_insts].wfe) val += 4; + #if STEP < 2 #define PASS2IF(A, B) if(A) #elif STEP == 2 @@ -1150,9 +1152,6 @@ #define MODREG ((nextop&0xC0)==0xC0) -void arm64_epilog(void); -void* arm64_next(x64emu_t* emu, uintptr_t addr); - #ifndef STEPNAME #define STEPNAME3(N,M) N##M #define STEPNAME2(N,M) STEPNAME3(N,M) @@ -1161,15 +1160,11 @@ void* arm64_next(x64emu_t* emu, uintptr_t addr); #define native_pass STEPNAME(native_pass) +#define updateflags_pass STEPNAME(updateflags_pass) + #define dynarec64_00 STEPNAME(dynarec64_00) #define dynarec64_0F STEPNAME(dynarec64_0F) -#define dynarec64_64 STEPNAME(dynarec64_64) -#define dynarec64_65 STEPNAME(dynarec64_65) #define dynarec64_66 STEPNAME(dynarec64_66) -#define dynarec64_67 STEPNAME(dynarec64_67) -#define dynarec64_67_32 STEPNAME(dynarec64_67_32) -#define dynarec64_67_AVX STEPNAME(dynarec64_67_AVX) -#define dynarec64_6764_32 STEPNAME(dynarec64_6764_32) #define dynarec64_D8 STEPNAME(dynarec64_D8) #define dynarec64_D9 STEPNAME(dynarec64_D9) #define dynarec64_DA STEPNAME(dynarec64_DA) @@ -1182,7 +1177,6 @@ void* arm64_next(x64emu_t* emu, uintptr_t addr); #define dynarec64_660F STEPNAME(dynarec64_660F) #define dynarec64_66F20F STEPNAME(dynarec64_66F20F) #define dynarec64_66F30F STEPNAME(dynarec64_66F30F) -#define dynarec64_6664 STEPNAME(dynarec64_6664) #define dynarec64_66F0 STEPNAME(dynarec64_66F0) #define dynarec64_F20F STEPNAME(dynarec64_F20F) #define dynarec64_F30F STEPNAME(dynarec64_F30F) @@ -1196,16 +1190,16 @@ void* arm64_next(x64emu_t* emu, uintptr_t addr); #define dynarec64_AVX_66_0F3A STEPNAME(dynarec64_AVX_66_0F3A) #define dynarec64_AVX_F2_0F38 STEPNAME(dynarec64_AVX_F2_0F38) #define dynarec64_AVX_F2_0F3A STEPNAME(dynarec64_AVX_F2_0F3A) +#define dynarec64_AVX_F3_0F38 STEPNAME(dynarec64_AVX_F3_0F38) #define geted STEPNAME(geted) -#define geted32 STEPNAME(geted32) #define geted16 STEPNAME(geted16) #define jump_to_epilog STEPNAME(jump_to_epilog) #define jump_to_next STEPNAME(jump_to_next) -#define ret_to_epilog STEPNAME(ret_to_epilog) -#define retn_to_epilog STEPNAME(retn_to_epilog) -#define iret_to_epilog STEPNAME(iret_to_epilog) +#define ret_to_next STEPNAME(ret_to_next) +#define iret_to_next STEPNAME(iret_to_next) #define call_c STEPNAME(call_c) +#define call_d STEPNAME(call_d) #define call_n STEPNAME(call_n) #define grab_segdata STEPNAME(grab_segdata) #define emit_cmp8 STEPNAME(emit_cmp8) @@ -1215,8 +1209,11 @@ void* arm64_next(x64emu_t* emu, uintptr_t addr); #define emit_cmp16_0 STEPNAME(emit_cmp16_0) #define emit_cmp32_0 STEPNAME(emit_cmp32_0) #define emit_test8 STEPNAME(emit_test8) +#define emit_test8c STEPNAME(emit_test8c) #define emit_test16 STEPNAME(emit_test16) +#define emit_test16c STEPNAME(emit_test16c) #define emit_test32 STEPNAME(emit_test32) +#define emit_test32c STEPNAME(emit_test32c) #define emit_add32 STEPNAME(emit_add32) #define emit_add32c STEPNAME(emit_add32c) #define emit_add8 STEPNAME(emit_add8) @@ -1272,6 +1269,7 @@ void* arm64_next(x64emu_t* emu, uintptr_t addr); #define emit_shl32c STEPNAME(emit_shl32c) #define emit_shr32 STEPNAME(emit_shr32) #define emit_shr32c STEPNAME(emit_shr32c) +#define emit_sar32 STEPNAME(emit_sar32) #define emit_sar32c STEPNAME(emit_sar32c) #define emit_shl8 STEPNAME(emit_shl8) #define emit_shl8c STEPNAME(emit_shl8c) @@ -1297,6 +1295,8 @@ void* arm64_next(x64emu_t* emu, uintptr_t addr); #define emit_rcr16c STEPNAME(emit_rcr16c) #define emit_rcl32c STEPNAME(emit_rcl32c) #define emit_rcr32c STEPNAME(emit_rcr32c) +#define emit_rcl32 STEPNAME(emit_rcl32) +#define emit_rcr32 STEPNAME(emit_rcr32) #define emit_shrd32c STEPNAME(emit_shrd32c) #define emit_shrd32 STEPNAME(emit_shrd32) #define emit_shld32c STEPNAME(emit_shld32c) @@ -1336,6 +1336,9 @@ void* arm64_next(x64emu_t* emu, uintptr_t addr); #define ymm_get_reg_empty STEPNAME(ymm_get_reg_empty) #define ymm_mark_zero STEPNAME(ymm_mark_zero) #define fpu_get_reg_ymm STEPNAME(fpu_get_reg_ymm) +#define doPreload STEPNAME(doPreload) +#define doEnterBlock STEPNAME(doEnterBlock) +#define doLeaveBlock STEPNAME(doLeaveBlock) #define fpu_pushcache STEPNAME(fpu_pushcache) #define fpu_popcache STEPNAME(fpu_popcache) @@ -1344,6 +1347,8 @@ void* arm64_next(x64emu_t* emu, uintptr_t addr); #define fpu_purgecache STEPNAME(fpu_purgecache) #define mmx_purgecache STEPNAME(mmx_purgecache) #define x87_purgecache STEPNAME(x87_purgecache) +#define x87_reflectcount STEPNAME(x87_reflectcount) +#define x87_unreflectcount STEPNAME(x87_unreflectcount) #define fpu_reflectcache STEPNAME(fpu_reflectcache) #define fpu_unreflectcache STEPNAME(fpu_unreflectcache) #define avx_purge_ymm STEPNAME(avx_purge_ymm) @@ -1357,19 +1362,16 @@ void* arm64_next(x64emu_t* emu, uintptr_t addr); uintptr_t geted(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, rex_t rex, int* l, int s, int delta); /* setup r2 to address pointed by */ -uintptr_t geted32(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, rex_t rex, int* l, int s, int delta); - -/* setup r2 to address pointed by */ -uintptr_t geted16(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, int s); +uintptr_t geted16(dynarec_arm_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int* unscaled, int absmax, uint32_t mask, rex_t rex, int s); // generic x64 helper void jump_to_epilog(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst); void jump_to_next(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst, int is32bits); -void ret_to_epilog(dynarec_arm_t* dyn, int ninst, rex_t rex); -void retn_to_epilog(dynarec_arm_t* dyn, int ninst, rex_t rex, int n); -void iret_to_epilog(dynarec_arm_t* dyn, int ninst, int is64bits); -void call_c(dynarec_arm_t* dyn, int ninst, void* fnc, int reg, int ret, int saveflags, int save_reg); +void ret_to_next(dynarec_arm_t* dyn, uintptr_t ip, int ninst, rex_t rex); +void iret_to_next(dynarec_arm_t* dyn, uintptr_t ip, int ninst, int is32bits, int is64bits); +void call_c(dynarec_arm_t* dyn, int ninst, arm64_consts_t fnc, int reg, int ret, int saveflags, int save_reg); +void call_d(dynarec_arm_t* dyn, int ninst, arm64_consts_t fnc, int ret, int arg1, int arg2, int sav1, int sav2); void call_n(dynarec_arm_t* dyn, int ninst, void* fnc, int w); void grab_segdata(dynarec_arm_t* dyn, uintptr_t addr, int ninst, int reg, int segment); void emit_cmp8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); @@ -1379,16 +1381,19 @@ void emit_cmp8_0(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4); void emit_cmp16_0(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4); void emit_cmp32_0(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4); void emit_test8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_test8c(dynarec_arm_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5); void emit_test16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_test16c(dynarec_arm_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5); void emit_test32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); +void emit_test32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4, int s5); void emit_add32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); void emit_add32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4, int s5); void emit_add8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_add8c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); +void emit_add8c(dynarec_arm_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4); void emit_sub32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); void emit_sub32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4, int s5); void emit_sub8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_sub8c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5); +void emit_sub8c(dynarec_arm_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4, int s5); void emit_or32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); void emit_or32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4); void emit_xor32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); @@ -1396,21 +1401,21 @@ void emit_xor32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int64_t c, in void emit_and32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); void emit_and32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4); void emit_or8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_or8c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); +void emit_or8c(dynarec_arm_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4); void emit_xor8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_xor8c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); +void emit_xor8c(dynarec_arm_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4); void emit_and8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_and8c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); +void emit_and8c(dynarec_arm_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4); void emit_add16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); //void emit_add16c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); void emit_sub16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); //void emit_sub16c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); void emit_or16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); -//void emit_or16c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); +void emit_or16c(dynarec_arm_t* dyn, int ninst, int s1, int16_t c, int s3, int s4); void emit_xor16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); -//void emit_xor16c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); +void emit_xor16c(dynarec_arm_t* dyn, int ninst, int s1, int16_t c, int s3, int s4); void emit_and16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); -//void emit_and16c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); +void emit_and16c(dynarec_arm_t* dyn, int ninst, int s1, int16_t c, int s3, int s4); void emit_inc32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4); void emit_inc16(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4); void emit_inc8(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4); @@ -1420,13 +1425,13 @@ void emit_dec8(dynarec_arm_t* dyn, int ninst, int s1, int s3, int s4); void emit_adc32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); //void emit_adc32c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); void emit_adc8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_adc8c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5); +void emit_adc8c(dynarec_arm_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4, int s5); void emit_adc16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); //void emit_adc16c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); void emit_sbb32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); //void emit_sbb32c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); void emit_sbb8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_sbb8c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5); +void emit_sbb8c(dynarec_arm_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4, int s5); void emit_sbb16(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); //void emit_sbb16c(dynarec_arm_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); void emit_neg32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4); @@ -1436,6 +1441,7 @@ void emit_shl32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3 void emit_shl32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); void emit_shr32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); void emit_shr32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); +void emit_sar32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); void emit_sar32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); void emit_shl8(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3, int s4); void emit_shl8c(dynarec_arm_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); @@ -1461,6 +1467,8 @@ void emit_rcl16c(dynarec_arm_t* dyn, int ninst, int s1, uint32_t c, int s3, int void emit_rcr16c(dynarec_arm_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); void emit_rcl32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); void emit_rcr32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); +void emit_rcl32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); +void emit_rcr32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); void emit_shrd32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4); void emit_shld32c(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4); void emit_shrd32(dynarec_arm_t* dyn, int ninst, rex_t rex, int s1, int s2, int s5, int s3, int s4); @@ -1510,15 +1518,17 @@ int sse_setround(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3); // purge ymm_zero mask according to purge_ymm void avx_purge_ymm(dynarec_arm_t* dyn, int ninst, uint16_t mask, int s1); -void CacheTransform(dynarec_arm_t* dyn, int ninst, int cacheupd, int s1, int s2, int s3); +void CacheTransform(dynarec_arm_t* dyn, int ninst, int cacheupd); void arm64_move32(dynarec_arm_t* dyn, int ninst, int reg, uint32_t val); void arm64_move64(dynarec_arm_t* dyn, int ninst, int reg, uint64_t val); #if STEP < 2 #define CHECK_CACHE() 0 +#elif STEP == 2 +#define CHECK_CACHE() (cacheupd = dyn->insts[ninst].cacheupd = CacheNeedsTransform(dyn, ninst)) #else -#define CHECK_CACHE() (cacheupd = CacheNeedsTransform(dyn, ninst)) +#define CHECK_CACHE() (cacheupd = dyn->insts[ninst].cacheupd) #endif #define neoncache_st_coherency STEPNAME(neoncache_st_coherency) @@ -1572,11 +1582,16 @@ void fpu_reset_cache(dynarec_arm_t* dyn, int ninst, int reset_n); // propagate stack state void fpu_propagate_stack(dynarec_arm_t* dyn, int ninst); // purge the FPU cache (needs 3 scratch registers) -void fpu_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1, int s2, int s3); +void fpu_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1, int s2, int s3, uint32_t unneeded); // purge MMX cache void mmx_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1); // purge x87 cache void x87_purgecache(dynarec_arm_t* dyn, int ninst, int next, int s1, int s2, int s3); +// temporarily set x87 stack count for C functions +void x87_reflectcount(dynarec_arm_t* dyn, int ninst, int s1, int s2); +// restore count after +void x87_unreflectcount(dynarec_arm_t* dyn, int ninst, int s1, int s2); +// global fpu helper void fpu_reflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3); void fpu_unreflectcache(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3); void fpu_pushcache(dynarec_arm_t* dyn, int ninst, int s1, int not07); @@ -1590,30 +1605,29 @@ int ymm_get_reg_empty(dynarec_arm_t* dyn, int ninst, int s1, int a, int k1, int void ymm_mark_zero(dynarec_arm_t* dyn, int ninst, int a); // Get an YMM upper quad reg, while keeping up to 3 other YMM reg (-1 to no keep) int fpu_get_reg_ymm(dynarec_arm_t* dyn, int ninst, int t, int ymm, int k1, int k2, int k3); - -uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_64(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int seg, int* ok, int* need_epilog); -//uintptr_t dynarec64_65(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep,int* ok, int* need_epilog); -uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_67_32(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_67_AVX(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); -uintptr_t dynarec64_6764_32(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int seg, int* ok, int* need_epilog); -uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_DA(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); +// Preload XMM/YMM regs +void doPreload(dynarec_arm_t* dyn, int ninst); +// Enter a block (atomic inrement of hot and in_used) +void doEnterBlock(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3); +// Leave a block (atomic decrement of in_used) +void doLeaveBlock(dynarec_arm_t* dyn, int ninst, int s1, int s2, int s3); + +uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_D8(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_D9(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DA(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DB(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DC(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DE(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DF(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_66F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_66F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); -uintptr_t dynarec64_6664(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int seg, int* ok, int* need_epilog); -uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); +uintptr_t dynarec64_66F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_F20F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_AVX(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); @@ -1626,6 +1640,7 @@ uintptr_t dynarec64_AVX_66_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip uintptr_t dynarec64_AVX_66_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); uintptr_t dynarec64_AVX_F2_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); uintptr_t dynarec64_AVX_F2_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_F3_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); #if STEP < 2 #define PASS2(A) @@ -1648,55 +1663,105 @@ uintptr_t dynarec64_AVX_F2_0F3A(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip #define GOCOND(B, T1, T2) \ case B+0x0: \ INST_NAME(T1 "O " T2); \ + IFNATIVE(NF_VF) { \ + GO( , cVC, cVS, X_OF) \ + } else { \ GO( TSTw_mask(xFlags, 0b010101, 0) \ , cEQ, cNE, X_OF) \ + } \ break; \ case B+0x1: \ INST_NAME(T1 "NO " T2); \ + IFNATIVE(NF_VF) { \ + GO( , cVS, cVC, X_OF) \ + } else { \ GO( TSTw_mask(xFlags, 0b010101, 0) \ , cNE, cEQ, X_OF) \ + } \ break; \ case B+0x2: \ INST_NAME(T1 "C " T2); \ + IFNATIVE(NF_CF) { \ + if(INVERTED_CARRY) { \ + GO( , cCS, cCC, X_CF) \ + } else { \ + GO( , cCC, cCS, X_CF) \ + } \ + } else { \ GO( TSTw_mask(xFlags, 0, 0) \ , cEQ, cNE, X_CF) \ + } \ break; \ case B+0x3: \ INST_NAME(T1 "NC " T2); \ + IFNATIVE(NF_CF) { \ + if(INVERTED_CARRY) { \ + GO( , cCC, cCS, X_CF) \ + } else { \ + GO( , cCS, cCC, X_CF) \ + } \ + } else { \ GO( TSTw_mask(xFlags, 0, 0) \ , cNE, cEQ, X_CF) \ + } \ break; \ case B+0x4: \ INST_NAME(T1 "Z " T2); \ + IFNATIVE(NF_EQ) { \ + GO( , cNE, cEQ, X_ZF) \ + } else { \ GO( TSTw_mask(xFlags, 0b011010, 0) \ , cEQ, cNE, X_ZF) \ + } \ break; \ case B+0x5: \ INST_NAME(T1 "NZ " T2); \ + IFNATIVE(NF_EQ) { \ + GO( , cEQ, cNE, X_ZF) \ + } else { \ GO( TSTw_mask(xFlags, 0b011010, 0) \ , cNE, cEQ, X_ZF) \ + } \ break; \ case B+0x6: \ INST_NAME(T1 "BE " T2); \ + IFNATIVEN(NF_EQ|NF_CF) { \ + INVERT_CARRY(x1); \ + GO( , cHI, cLS, X_ZF|X_CF) \ + } else { \ GO( MOV32w(x1, (1<insts[ninst+1].purge_ymm, x1) +#define PURGE_YMM() \ + do { \ + if ((ok > 0) && reset_n == -1 && dyn->insts[ninst + 1].purge_ymm) \ + avx_purge_ymm(dyn, ninst, dyn->insts[ninst + 1].purge_ymm, x1); \ + } while (0) #endif //__DYNAREC_ARM64_HELPER_H__ diff --git a/src/dynarec/arm64/dynarec_arm64_jmpnext.c b/src/dynarec/arm64/dynarec_arm64_jmpnext.c index c40dfb1..aac633e 100644 --- a/src/dynarec/arm64/dynarec_arm64_jmpnext.c +++ b/src/dynarec/arm64/dynarec_arm64_jmpnext.c @@ -2,10 +2,14 @@ #include "arm64_emitter.h" -#define EMIT(A) *block = (A); ++block +#define EMIT(A) \ + do { \ + *block = (A); \ + ++block; \ + } while (0) void CreateJmpNext(void* addr, void* next) { uint32_t* block = (uint32_t*)addr; LDRx_literal(x2, (intptr_t)next - (intptr_t)addr); BR(x2); -} \ No newline at end of file +} diff --git a/src/dynarec/arm64/dynarec_arm64_pass0.h b/src/dynarec/arm64/dynarec_arm64_pass0.h index 4cfce5a..9a312b4 100644 --- a/src/dynarec/arm64/dynarec_arm64_pass0.h +++ b/src/dynarec/arm64/dynarec_arm64_pass0.h @@ -6,19 +6,18 @@ if(ninst) dyn->insts[ninst-1].x64.size = dyn->insts[ninst].x64.addr - dyn->insts[ninst-1].x64.addr #define MESSAGE(A, ...) do {} while (0) -#define MAYSETFLAGS() dyn->insts[ninst].x64.may_set = 1 #define READFLAGS(A) \ - dyn->insts[ninst].x64.use_flags = A; dyn->f.dfnone = 1;\ - dyn->f.pending=SF_SET + dyn->insts[ninst].x64.use_flags = A; if(dyn->f!=status_none_pending) dyn->f = status_none;\ + if(!BOX64ENV(dynarec_df) && (A)&X_PEND) dyn->insts[ninst].x64.use_flags = X_ALL; \ + dyn->f = status_none #define SETFLAGS(A,B) \ dyn->insts[ninst].x64.set_flags = A; \ dyn->insts[ninst].x64.state_flags = (B)&~SF_DF; \ - dyn->f.pending=(B)&SF_SET_PENDING; \ - dyn->f.dfnone=((B)&SF_SET)?(((B)==SF_SET_NODF)?0:1):0; + dyn->f=((B)&SF_SET)?(((B)==SF_SET_NODF)?dyn->f:status_none_pending):(((B)&SF_SET_PENDING)?status_set:status_none_pending); \ + if(!BOX64ENV(dynarec_df)) {dyn->f=status_none; if((A)==SF_PENDING){printf_log(LOG_INFO, "Warning, some opcode use SF_PENDING, forcing deferedflags ON\n"); SET_BOX64ENV(dynarec_df, 1); }} #define EMIT(A) dyn->native_size+=4 #define JUMP(A, C) add_jump(dyn, ninst); add_next(dyn, (uintptr_t)A); SMEND(); dyn->insts[ninst].x64.jmp = A; dyn->insts[ninst].x64.jmp_cond = C; dyn->insts[ninst].x64.jmp_insts = 0 -#define BARRIER(A) if(A!=BARRIER_MAYBE) {fpu_purgecache(dyn, ninst, 0, x1, x2, x3); dyn->insts[ninst].x64.barrier = A;} else dyn->insts[ninst].barrier_maybe = 1 -#define BARRIER_NEXT(A) dyn->insts[ninst].x64.barrier_next = A +#define BARRIER(A) if(A!=BARRIER_MAYBE) {fpu_purgecache(dyn, ninst, 0, x1, x2, x3, 0); dyn->insts[ninst].x64.barrier = A;} else dyn->insts[ninst].barrier_maybe = 1 #define SET_HASCALLRET() dyn->insts[ninst].x64.has_callret = 1 #define NEW_INST \ ++dyn->size; \ @@ -31,20 +30,42 @@ #define INST_EPILOG \ dyn->insts[ninst].f_exit = dyn->f; \ dyn->insts[ninst].n = dyn->n; \ + if(dyn->insts[ninst].nat_flags_op==NAT_FLAG_OP_TOUCH && !dyn->insts[ninst].set_nat_flags) \ + dyn->insts[ninst].nat_flags_op=NAT_FLAG_OP_UNUSABLE; \ dyn->insts[ninst].x64.has_next = (ok>0)?1:0; -#define INST_NAME(name) -#define DEFAULT \ - --dyn->size; \ - *ok = -1; \ - if(box64_dynarec_log>=LOG_INFO || box64_dynarec_dump || box64_dynarec_missing) {\ - dynarec_log(LOG_NONE, "%p: Dynarec stopped because of %sOpcode %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", \ - (void*)ip, rex.is32bits?"x86 ":"x64 ",\ - PKip(0), \ - PKip(1), PKip(2), PKip(3), \ - PKip(4), PKip(5), PKip(6), \ - PKip(7), PKip(8), PKip(9), \ - PKip(10),PKip(11),PKip(12), \ - PKip(13),PKip(14)); \ - printFunctionAddr(ip, " => "); \ - dynarec_log(LOG_NONE, "\n"); \ +#define INST_NAME(name) +#define DEFAULT \ + --dyn->size; \ + *ok = -1; \ + if (ninst) { dyn->insts[ninst - 1].x64.size = ip - dyn->insts[ninst - 1].x64.addr; } \ + if (BOX64ENV(dynarec_log) >= LOG_INFO || dyn->need_dump || BOX64ENV(dynarec_missing) == 1) \ + if (!dyn->size || BOX64ENV(dynarec_log) > LOG_INFO || dyn->need_dump) { \ + dynarec_stopped(dyn->insts[ninst].x64.addr, rex.is32bits); \ } + + +#define FEMIT(A) dyn->insts[ninst].nat_flags_op = dyn->insts[ninst].x64.set_flags?NAT_FLAG_OP_TOUCH:NAT_FLAG_OP_UNUSABLE +#define IFNATIVE(A) if(mark_natflag(dyn, ninst, A, 0)) +#define IFNATIVEN(A) if(mark_natflag(dyn, ninst, A, 0)) +#define UFLAG_IF if(dyn->insts[ninst].x64.set_flags) +#define UFLAG_IF2(A) if(dyn->insts[ninst].x64.set_flags A) +#define IFX(A) if((dyn->insts[ninst].x64.set_flags&(A))) +#define IFX2(A, B) if((dyn->insts[ninst].x64.set_flags&(A)) B) +#define IFX_PENDOR0 if((dyn->insts[ninst].x64.set_flags&(X_PEND) || !dyn->insts[ninst].x64.set_flags)) +#define IFXX(A) if((dyn->insts[ninst].x64.set_flags==(A))) +#define IFX2X(A, B) if((dyn->insts[ninst].x64.set_flags==(A) || dyn->insts[ninst].x64.set_flags==(B) || dyn->insts[ninst].x64.set_flags==((A)|(B)))) +#define IFXN(A, B) if((dyn->insts[ninst].x64.set_flags&(A) && !(dyn->insts[ninst].x64.set_flags&(B)))) +#define IFXNATIVE(X, N) if((dyn->insts[ninst].x64.set_flags&(X)) && mark_natflag(dyn, ninst, N, 0)) +#define GEN_INVERTED_CARRY() dyn->insts[ninst].gen_inverted_carry = 1 +#define IFNATIVE_BEFORE(A) if(mark_natflag(dyn, ninst, A, 1)) +#define INVERT_CARRY(A) dyn->insts[ninst].invert_carry = 1 +#define INVERT_CARRY_BEFORE(A) dyn->insts[ninst].invert_carry_before = 1 +// mark opcode as "unaligned" possible only if the current address is not marked as already unaligned +#define IF_UNALIGNED(A) if((dyn->insts[ninst].unaligned=is_addr_unaligned(A))) +#define IF_ALIGNED(A) if(!(dyn->insts[ninst].unaligned=is_addr_unaligned(A))) + +#define NATIVE_RESTORE_X87PC() +#define X87_CHECK_PRECISION(A) \ + do { \ + if (dyn->need_x87check) dyn->insts[ninst].x87precision = 1; \ + } while (0) diff --git a/src/dynarec/arm64/dynarec_arm64_pass1.h b/src/dynarec/arm64/dynarec_arm64_pass1.h index 173f27b..0dc42f2 100644 --- a/src/dynarec/arm64/dynarec_arm64_pass1.h +++ b/src/dynarec/arm64/dynarec_arm64_pass1.h @@ -2,6 +2,12 @@ #define FINI #define MESSAGE(A, ...) do {} while (0) #define EMIT(A) do {} while (0) + +#define SETFLAGS(A,B) \ + dyn->insts[ninst].x64.set_flags = A; \ + dyn->insts[ninst].x64.state_flags = (B)&~SF_DF; \ + dyn->f=((B)&SF_SET)?(((B)==SF_SET_NODF)?dyn->f:status_none_pending):(((B)&SF_SET_PENDING)?status_set:status_none_pending); \ + if(!BOX64ENV(dynarec_df)) {dyn->f = status_none; } #define NEW_INST \ dyn->insts[ninst].f_entry = dyn->f; \ dyn->n.combined1 = dyn->n.combined2 = 0;\ @@ -11,4 +17,14 @@ dyn->insts[ninst].n = dyn->n; \ dyn->insts[ninst].f_exit = dyn->f -#define INST_NAME(name) +#define INST_NAME(name) + +#define NATIVE_RESTORE_X87PC() +#define X87_CHECK_PRECISION(A) \ + do { \ + if (dyn->need_x87check) { \ + dyn->insts[ninst].x87precision = 1; \ + if (!ST_IS_F(0)) \ + dyn->need_x87check = 2; \ + } \ + } while (0) diff --git a/src/dynarec/arm64/dynarec_arm64_pass2.h b/src/dynarec/arm64/dynarec_arm64_pass2.h index dbb129f..8fb0b14 100644 --- a/src/dynarec/arm64/dynarec_arm64_pass2.h +++ b/src/dynarec/arm64/dynarec_arm64_pass2.h @@ -2,18 +2,36 @@ #define FINI \ if(ninst) { \ dyn->insts[ninst].address = (dyn->insts[ninst-1].address+dyn->insts[ninst-1].size); \ - dyn->insts_size += 1+((dyn->insts[ninst].x64.size>(dyn->insts[ninst].size/4))?dyn->insts[ninst].x64.size:(dyn->insts[ninst].size/4))/15; \ + dyn->insts_size += 1+((dyn->insts[ninst-1].x64.size>(dyn->insts[ninst-1].size/4))?dyn->insts[ninst-1].x64.size:(dyn->insts[ninst-1].size/4))/15; \ } #define MESSAGE(A, ...) do {} while (0) #define EMIT(A) do{dyn->insts[ninst].size+=4; dyn->native_size+=4;}while(0) +#define ENDPREFIX dyn->prefixsize = dyn->native_size; dyn->insts[ninst].address = dyn->native_size; dyn->insts[ninst].size = 0 #define NEW_INST \ if(ninst) { \ dyn->insts[ninst].address = (dyn->insts[ninst-1].address+dyn->insts[ninst-1].size); \ dyn->insts_size += 1+((dyn->insts[ninst-1].x64.size>(dyn->insts[ninst-1].size/4))?dyn->insts[ninst-1].x64.size:(dyn->insts[ninst-1].size/4))/15; \ - dyn->insts[ninst].ymm0_pass2 = dyn->ymm_zero; \ + dyn->insts[ninst].ymm0_pass2 = dyn->ymm_zero; \ } #define INST_EPILOG dyn->insts[ninst].epilog = dyn->native_size; #define INST_NAME(name) -#define TABLE64(A, V) {Table64(dyn, (V), 2); EMIT(0);} -#define FTABLE64(A, V) {mmx87_regs_t v = {.d = V}; Table64(dyn, v.q, 2); EMIT(0);} +#define TABLE64(A, V) do { \ + if(dyn->need_reloc) \ + AddRelocTable64Addr(dyn, ninst, (V), 2); \ + Table64(dyn, (V), 2); EMIT(0); \ + } while(0) +#define TABLE64_(A, V) do { \ + Table64(dyn, (V), 2); EMIT(0); \ + } while(0) +#define TABLE64C(A, V) do { \ + if(dyn->need_reloc) \ + AddRelocTable64Const(dyn, ninst, (V), 2); \ + Table64(dyn, getConst(V), 2); EMIT(0); \ + } while(0) +#define FTABLE64(A, V) do { mmx87_regs_t v = {.d = V}; Table64(dyn, v.q, 2); EMIT(0); } while(0) +#define CALLRET_RET(A) do { \ + if((A) && BOX64DRENV(dynarec_callret)) { dyn->insts[ninst].size+=sizeof(void*); dyn->native_size+=sizeof(void*); ++dyn->sep_size; } \ + if(BOX64DRENV(dynarec_callret)>1) {dyn->callrets[dyn->callret_size].type = 0; dyn->callrets[dyn->callret_size++].offs = dyn->native_size; EMIT(ARCH_NOP);} \ + } while(0) +#define CALLRET_LOOP() do { dyn->callrets[dyn->callret_size].type = 1; dyn->callrets[dyn->callret_size++].offs = dyn->native_size; EMIT(ARCH_NOP); } while(0) \ No newline at end of file diff --git a/src/dynarec/arm64/dynarec_arm64_pass3.h b/src/dynarec/arm64/dynarec_arm64_pass3.h index 38bcf61..aa63a5c 100644 --- a/src/dynarec/arm64/dynarec_arm64_pass3.h +++ b/src/dynarec/arm64/dynarec_arm64_pass3.h @@ -1,24 +1,62 @@ -#define INIT +#define INIT #define FINI \ if(ninst) \ - addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst].x64.size, dyn->insts[ninst].size/4); \ + addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst-1].x64.size, dyn->insts[ninst-1].size/4); \ addInst(dyn->instsize, &dyn->insts_size, 0, 0); #define EMIT(A) \ do{ \ - if(box64_dynarec_dump) print_opcode(dyn, ninst, (uint32_t)(A)); \ + if(dyn->need_dump) print_opcode(dyn, ninst, (uint32_t)(A)); \ if((uintptr_t)dyn->blocktablestart) \ *(uint32_t*)(dyn->block) = (uint32_t)(A); \ dyn->block += 4; dyn->native_size += 4; \ dyn->insts[ninst].size2 += 4; \ }while(0) -#define MESSAGE(A, ...) if(box64_dynarec_dump) dynarec_log(LOG_NONE, __VA_ARGS__) +#define MESSAGE(A, ...) \ + do { \ + if (dyn->need_dump) dynarec_log(LOG_NONE, __VA_ARGS__); \ + } while (0) +#define ENDPREFIX dyn->insts[ninst].size2 = 0 #define NEW_INST \ if(ninst) { \ + if(dyn->insts[ninst].address!=(uintptr_t)dyn->block-(uintptr_t)dyn->native_start) dyn->abort = 1; \ addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst-1].x64.size, dyn->insts[ninst-1].size/4); \ dyn->insts[ninst].ymm0_pass3 = dyn->ymm_zero; \ } -#define INST_EPILOG +#define INST_EPILOG #define INST_NAME(name) inst_name_pass3(dyn, ninst, name, rex) -#define TABLE64(A, V) {int val64offset = Table64(dyn, (V), 3); MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); LDRx_literal(A, val64offset);} -#define FTABLE64(A, V) {mmx87_regs_t v = {.d = V}; int val64offset = Table64(dyn, v.q, 3); MESSAGE(LOG_DUMP, " FTable64: %g\n", v.d); VLDR64_literal(A, val64offset);} +#define TABLE64(A, V) do { \ + if(dyn->need_reloc) \ + AddRelocTable64Addr(dyn, ninst, (V), 3); \ + int val64offset = Table64(dyn, (V), 3); \ + MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); LDRx_literal(A, val64offset); \ + } while(0) +#define TABLE64_(A, V) { \ + int val64offset = Table64(dyn, (V), 3); \ + MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); LDRx_literal(A, val64offset); \ + } +#define TABLE64C(A, V) do { \ + if(dyn->need_reloc) \ + AddRelocTable64Const(dyn, ninst, (V), 3); \ + int val64offset = Table64(dyn, getConst(V), 3); \ + MESSAGE(LOG_DUMP, " Table64C: 0x%lx\n", (V)); LDRx_literal(A, val64offset);\ + } while(0) +#define FTABLE64(A, V) do {mmx87_regs_t v = {.d = V}; int val64offset = Table64(dyn, v.q, 3); MESSAGE(LOG_DUMP, " FTable64: %g\n", v.d); VLDR64_literal(A, val64offset);} while(0) +#define CALLRET_RET(A) \ + do { \ + if((A) && BOX64DRENV(dynarec_callret)) { \ + MESSAGE(LOG_DUMP, " Dynablock*\n"); \ + dyn->block += sizeof(void*); \ + dyn->native_size+=sizeof(void*); \ + dyn->insts[ninst].size2 += sizeof(void*); \ + dyn->sep[dyn->sep_size].x64_offs = addr - dyn->start; \ + dyn->sep[dyn->sep_size].nat_offs = dyn->native_size; \ + ++dyn->sep_size; \ + } \ + if(BOX64DRENV(dynarec_callret)>1) { \ + dyn->callrets[dyn->callret_size].type = 0; \ + dyn->callrets[dyn->callret_size++].offs = dyn->native_size; \ + EMIT(ARCH_NOP); \ + } \ + } while(0) +#define CALLRET_LOOP() do {dyn->callrets[dyn->callret_size].type = 1; dyn->callrets[dyn->callret_size++].offs = dyn->native_size; EMIT(ARCH_NOP); } while(0) diff --git a/src/dynarec/arm64/dynarec_arm64_private.h b/src/dynarec/arm64/dynarec_arm64_private.h index c1015ab..0dfc788 100644 --- a/src/dynarec/arm64/dynarec_arm64_private.h +++ b/src/dynarec/arm64/dynarec_arm64_private.h @@ -6,9 +6,24 @@ typedef struct x64emu_s x64emu_t; typedef struct dynablock_s dynablock_t; typedef struct instsize_s instsize_t; +typedef struct box64env_s box64env_t; #define BARRIER_MAYBE 8 +#define NF_EQ (1<<0) +#define NF_SF (1<<1) +#define NF_VF (1<<2) +#define NF_CF (1<<3) + +// Nothing happens to the native flags +#define NAT_FLAG_OP_NONE 0 +// Native flags are touched on this opcode +#define NAT_FLAG_OP_TOUCH 1 +// Native flags are destroyed and unusable +#define NAT_FLAG_OP_UNUSABLE 2 +// Native flags usaged are canceled here +#define NAT_FLAG_OP_CANCELED 3 + #define NEON_CACHE_NONE 0 #define NEON_CACHE_ST_D 1 #define NEON_CACHE_ST_F 2 @@ -33,6 +48,9 @@ typedef union sse_cache_s { uint8_t write:1; }; } sse_cache_t; +typedef struct callret_s callret_t; +typedef struct sep_s sep_t; + typedef struct neoncache_s { // Neon cache neon_cache_t neoncache[32]; @@ -57,18 +75,27 @@ typedef struct neoncache_s { int8_t x87stack; // cache stack counter int8_t mmxcount; // number of mmx register used (not both mmx and x87 at the same time) int8_t fpu_scratch; // scratch counter - int8_t fpu_reg; // x87/sse/mmx reg counter + uint16_t xmm_write; // 1bit of xmmXX removed write + uint16_t xmm_removed; // 1bit if xmmXX was removed + uint16_t xmm_used; // mask of the xmm regs used in this opcode uint16_t ymm_used; // mask of the ymm regs used in this opcode + uint16_t ymm_write; // 1bit of ymmXX removed write + uint16_t ymm_removed; // 1bit if ymmXX was removed + uint16_t xmm_unneeded; // 1bit for xmmXX were value is not needed + uint16_t ymm_unneeded; // 1bit for ymmXX were value is not needed uint64_t ymm_regs; // 4bits (0-15) position of 16 ymmXX regs removed - uint16_t ymm_write; // 1bits of ymmXX removed write - uint16_t ymm_removed; // 1bits if ymmXX was removed } neoncache_t; -typedef struct flagcache_s { +typedef enum flagcache_s { + status_unk = 0, // unknown deferred flags status + status_set, // deferred flags set to something (not 0) + status_none_pending, // deferred flags set to 0, but still pending the write to x64emu_t + status_none, // deferred flags set to 0, written to x64emu_t +} flagcache_t; +/*typedef struct flagcache_s { int pending; // is there a pending flags here, or to check? uint8_t dfnone; // if deferred flags is already set to df_none - uint8_t dfnone_here;// defered flags is cleared in this opcode -} flagcache_t; +} flagcache_t;*/ typedef struct instruction_arm64_s { instruction_x64_t x64; @@ -89,14 +116,38 @@ typedef struct instruction_arm64_s { uint16_t ymm0_in; // bitmap of ymm to zero at purge uint16_t ymm0_add; // the ymm0 added by the opcode uint16_t ymm0_sub; // the ymm0 removed by the opcode - uint16_t ymm0_out; // the ymmm0 at th end of the opcode + uint16_t ymm0_out; // the ymm0 at th end of the opcode uint16_t ymm0_pass2, ymm0_pass3; uint8_t barrier_maybe; - uint8_t will_write; - uint8_t last_write; + uint8_t will_write:2; // [strongmem] will write to memory + uint8_t will_read:1; // [strongmem] will read from memory + uint8_t last_write:1; // [strongmem] the last write in a SEQ + uint8_t lock:1; // [strongmem] lock semantic + uint8_t wfe:1; // opcode uses sevl + wfe + uint8_t set_nat_flags; // 0 or combinaison of native flags define + uint8_t use_nat_flags; // 0 or combinaison of native flags define + uint8_t use_nat_flags_before; // 0 or combinaison of native flags define + uint8_t nat_flags_op:4;// what happens to native flags here + uint8_t nat_flags_op_before:4;// what happens to native flags here + uint8_t before_nat_flags; // 0 or combinaison of native flags define + uint8_t need_nat_flags; + unsigned gen_inverted_carry:1; + unsigned normal_carry:1; + unsigned normal_carry_before:1; + unsigned invert_carry:1; // this opcode force an inverted carry + unsigned df_notneeded:1; + unsigned unaligned:1; // this opcode can be re-generated for unaligned special case + unsigned x87precision:1; // this opcode can handle x87pc + unsigned mmx_used:1; // no fine tracking, just a global "any reg used" + unsigned x87_used:1; // no fine tracking, just a global "any reg used" + unsigned fpu_used:1; // any xmm/ymm/x87/mmx reg used + unsigned fpupurge:1; // this opcode will purge all fpu regs flagcache_t f_exit; // flags status at end of instruction neoncache_t n; // neoncache at end of instruction (but before poping) flagcache_t f_entry; // flags status before the instruction begin + int cacheupd; + uint32_t preload_xmmymm; + int preload_from; } instruction_arm64_t; typedef struct dynarec_arm_s { @@ -104,7 +155,9 @@ typedef struct dynarec_arm_s { int32_t size; int32_t cap; uintptr_t start; // start of the block + uintptr_t end; // maximum end of the block (only used in pass0) uint32_t isize; // size in bytes of x64 instructions included + uint32_t prefixsize; // size in byte of the prefix of the block void* block; // memory pointer where next instruction is emitted uintptr_t native_start; // start of the arm code size_t native_size; // size of emitted arm code @@ -126,17 +179,32 @@ typedef struct dynarec_arm_s { dynablock_t* dynablock; instsize_t* instsize; size_t insts_size; // size of the instruction size array (calculated) + int callret_size; // size of the array + int sep_size; // size of the array + callret_t* callrets; // array of callret return, with NOP / UDF depending if the block is clean or dirty + sep_t* sep; // array of secondary entry point uintptr_t forward; // address of the last end of code while testing forward uintptr_t forward_to; // address of the next jump to (to check if everything is ok) int32_t forward_size; // size at the forward point int forward_ninst; // ninst at the forward point uint16_t ymm_zero; // bitmap of ymm to zero at purge uint8_t smwrite; // for strongmem model emulation - uint8_t smread; uint8_t doublepush; uint8_t doublepop; uint8_t always_test; uint8_t abort; // abort the creation of the block + uint8_t use_x87:1; // set if x87 regs are used + uint8_t use_mmx:1; + uint8_t use_xmm:1; + uint8_t use_ymm:1; + uint8_t have_purge:1; // set to 1 if block can be purged + void* gdbjit_block; + uint32_t need_x87check; // needs x87 precision control check if non-null, or 0 if not + uint32_t need_dump; // need to dump the block + int need_reloc; // does the dynablock need relocations + int reloc_size; + uint32_t* relocs; + box64env_t* env; } dynarec_arm_t; void add_next(dynarec_arm_t *dyn, uintptr_t addr); @@ -145,18 +213,20 @@ void add_jump(dynarec_arm_t *dyn, int ninst); int get_first_jump(dynarec_arm_t *dyn, int next); int get_first_jump_addr(dynarec_arm_t *dyn, uintptr_t next); int is_nops(dynarec_arm_t *dyn, uintptr_t addr, int n); -int is_instructions(dynarec_arm_t *dyn, uintptr_t addr, int n); +int isTable64(dynarec_arm_t *dyn, uint64_t val); // return 1 if val already in Table64 int Table64(dynarec_arm_t *dyn, uint64_t val, int pass); // add a value to table64 (if needed) and gives back the imm19 to use in LDR_literal void CreateJmpNext(void* addr, void* next); -#define GO_TRACE(A, B, s0) \ - GETIP(addr); \ - MOVx_REG(x1, xRIP); \ - STORE_XEMU_CALL(xRIP); \ - MOV32w(x2, B); \ - CALL(A, -1); \ +#define GO_TRACE(A, B, s0) \ + GETIP(addr); \ + MOVx_REG(x1, xRIP); \ + MRS_nzcv(s0); \ + STORE_XEMU_CALL(xRIP); \ + MOV32w(x2, B); \ + CALL_(const_##A, -1, s0); \ + MSR_nzcv(s0); \ LOAD_XEMU_CALL(xRIP) #endif //__DYNAREC_ARM_PRIVATE_H_ diff --git a/src/dynarec/arm64/updateflags_arm64.c b/src/dynarec/arm64/updateflags_arm64.c new file mode 100644 index 0000000..ba21205 --- /dev/null +++ b/src/dynarec/arm64/updateflags_arm64.c @@ -0,0 +1,134 @@ +#include +#include +#include +#include +#include + +#include "os.h" +#include "debug.h" +#include "box64context.h" +#include "custommem.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynablock.h" +#include "../dynablock_private.h" + +#include "dynarec_native.h" +#include "../dynarec_arch.h" + +void updateflags_pass0(dynarec_arm_t* dyn, uint64_t jmp_df[]); +void updateflags_pass1(dynarec_arm_t* dyn, uint64_t jmp_df[]); +void updateflags_pass2(dynarec_arm_t* dyn, uint64_t jmp_df[]); +void updateflags_pass3(dynarec_arm_t* dyn, uint64_t jmp_df[]); + +static dynablock_t* updaflags_arm64 = NULL; + +static uint8_t dummy_code[] = {0x90, 0xc3}; // some dummy code so update_flags dynablock point to something + +void* create_updateflags() +{ + if(updaflags_arm64) + return updaflags_arm64->block; + uint64_t jmp_df[d_unknown+1] = {0}; + dynarec_arm_t helper = {0}; + instruction_arm64_t insts[1] = {0}; + helper.insts = insts; + helper.need_dump = BOX64ENV(dynarec_dump); + helper.cap = 1; + helper.f = status_none; + helper.insts[0].x64.gen_flags = X_ALL; + // pass 0 + updateflags_pass0(&helper, jmp_df); + // check if all flags are handled + helper.have_purge = 0; // force no purge + int ok = 1; + for(int i=d_none; ix64_addr = &dummy_code; + block->isize = 0; + block->actual_block = actual_p; + helper.relocs = relocs; + block->relocs = relocs; + block->table64size = helper.table64size; + helper.native_start = (uintptr_t)p; + helper.tablestart = (uintptr_t)tablestart; + helper.jmp_next = (uintptr_t)next+sizeof(void*); + helper.instsize = (instsize_t*)instsize; + *(dynablock_t**)actual_p = block; + helper.table64cap = helper.table64size; + helper.table64 = (uint64_t*)helper.tablestart; + helper.callrets = (callret_t*)callrets; + block->table64 = helper.table64; + helper.callret_size = 0; + // pass 3, emit (log emit native opcode) + if(helper.need_dump) { + dynarec_log(LOG_NONE, "%s%04d|Emitting %zu bytes for UpdateFlags", (helper.need_dump>1)?"\e[01;36m":"", GetTID(), helper.native_size); + PrintFunctionAddr(helper.start, " => "); + dynarec_log_prefix(0, LOG_NONE, "%s\n", (helper.need_dump>1)?"\e[m":""); + } + helper.native_size = 0; + updateflags_pass3(&helper, jmp_df); + helper.jmp_sz = helper.jmp_cap = 0; + helper.jmps = NULL; + // keep size of instructions for signal handling + block->instsize = instsize; + helper.table64 = NULL; + helper.instsize = NULL; + helper.predecessor = NULL; + block->size = sz; + block->isize = helper.size; + block->block = p; + block->jmpnext = next+sizeof(void*); + block->always_test = helper.always_test; + block->dirty = block->always_test; + block->is32bits = 0; + block->relocsize = helper.reloc_size*sizeof(uint32_t); + block->arch = NULL; + block->arch_size = 0; + block->callret_size = helper.callret_size; + block->callrets = helper.callrets; + block->native_size = native_size; + *(dynablock_t**)next = block; + *(void**)(next+3*sizeof(void*)) = NULL; + CreateJmpNext(block->jmpnext, next+3*sizeof(void*)); + ClearCache(block->jmpnext, 4*sizeof(void*)); + block->x64_size = 0; + // all done... + ClearCache(actual_p+sizeof(void*), native_size); // need to clear the cache before execution... + + updaflags_arm64 = block; + return block->block; +} \ No newline at end of file diff --git a/src/dynarec/arm64/updateflags_arm64_pass.c b/src/dynarec/arm64/updateflags_arm64_pass.c new file mode 100644 index 0000000..3932342 --- /dev/null +++ b/src/dynarec/arm64/updateflags_arm64_pass.c @@ -0,0 +1,1059 @@ +#include +#include +#include +#include +#include + +#include "os.h" +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "emu/x64run_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "x64trace.h" +#include "dynablock.h" +#include "dynarec_native.h" +#include "../dynablock_private.h" +#include "custommem.h" +#include "x64test.h" +#include "pe_tools.h" + +#include "../dynarec_arch.h" + +#if STEP == 0 + #define EMIT(A) dyn->native_size+=4 + #define SETMARK(A) jmp_df[A] = 1 +#elif STEP == 1 + #define EMIT(A) do {} while (0) + #define SETMARK(A) jmp_df[A] = 0 +#elif STEP == 2 + #define EMIT(A) dyn->native_size+=4 + #define SETMARK(A) jmp_df[A] = dyn->native_size +#elif STEP == 3 + #define MESSAGE(A, ...) \ + do { \ + if (dyn->need_dump) dynarec_log_prefix(0, LOG_NONE, __VA_ARGS__); \ + } while (0) + #define EMIT(A) \ + do{ \ + if(dyn->need_dump) print_opcode(dyn, ninst, (uint32_t)(A)); \ + *(uint32_t*)(dyn->block) = (uint32_t)(A); \ + dyn->block += 4; dyn->native_size += 4; \ + dyn->insts[ninst].size2 += 4; \ + }while(0) + #define SETMARK(A) MESSAGE(LOG_DUMP, "Mark(%d)=%p\n", A, dyn->block) +#else +#error Meh! +#endif +#define STEP_PASS +#include "../dynarec_helper.h" + +/* + Will generate a dynablock that does UpdateFlags. x0 = x64emu_t, x1 = df + So read the current df, set df to None, and jump to the correct function + using a static jump table. + Only x1..x5 regs will be used. No saving of SIMD regs needed. + LR will be used for return, and x0 needs to be corrctly setup as xEmu + flags will be changed +*/ + +void updateflags_pass(dynarec_arm_t* dyn, uint64_t jmp_df[]) +{ + int ninst = 0; + rex_t rex = {0}; + LDRw_U12(x1, xEmu, offsetof(x64emu_t, df)); + STRw_U12(xZR, xEmu, offsetof(x64emu_t, df)); + CMPSw_U12(x1, d_unknown); + Bcond(cLT, 4+4); + RET(xLR); + ADR_S20(x2, 4+8); + ADDx_REG_LSL(x1, x2, x1, 2); + BR(x1); + for(int i=d_none; inative_size); +SETMARK(d_none); + RET(xLR); +SETMARK(d_add8); +SETMARK(d_add8b); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRB_U12(x2, xEmu, offsetof(x64emu_t, op2)); + emit_add8(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_add16); +SETMARK(d_add16b); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op2)); + emit_add16(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_add32); +SETMARK(d_add32b); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op2)); + rex.w = 0; + emit_add32(dyn, ninst, rex, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_add64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op2)); + rex.w = 1; + emit_add32(dyn, ninst, rex, x1, x2, x3, x4); + rex.w = 0; + RET(xLR); +SETMARK(d_and8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV32w(x2, 0xff); + emit_and8(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_and16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV32w(x2, 0xffff); + emit_and16(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_and32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV32w(x2, 0xffffffff); + rex.w = 0; + emit_and32(dyn, ninst, rex, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_and64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV64x(x2, 0xffffffffffffffffULL); + rex.w = 1; + emit_and32(dyn, ninst, rex, x1, x2, x3, x4); + rex.w = 0; + RET(xLR); +SETMARK(d_dec8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, op1)); + emit_dec8(dyn, ninst, x1, x3, x4); + RET(xLR); +SETMARK(d_dec16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, op1)); + emit_dec16(dyn, ninst, x1, x3, x4); + RET(xLR); +SETMARK(d_dec32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, op1)); + rex.w = 0; + emit_dec32(dyn, ninst, rex, x1, x3, x4); + RET(xLR); +SETMARK(d_dec64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, op1)); + rex.w = 1; + emit_dec32(dyn, ninst, rex, x1, x3, x4); + rex.w = 0; + RET(xLR); +SETMARK(d_inc8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, op1)); + emit_inc8(dyn, ninst, x1, x3, x4); + RET(xLR); +SETMARK(d_inc16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, op1)); + emit_inc16(dyn, ninst, x1, x3, x4); + RET(xLR); +SETMARK(d_inc32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, op1)); + rex.w = 0; + emit_inc32(dyn, ninst, rex, x1, x3, x4); + RET(xLR); +SETMARK(d_inc64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, op1)); + rex.w = 1; + emit_inc32(dyn, ninst, rex, x1, x3, x4); + rex.w = 0; + RET(xLR); +SETMARK(d_imul8); + LDRSH_U12(x1, xEmu, offsetof(x64emu_t, res)); + ASRxw(x2, x1, 8); + CMPSw_REG_ASR(x2, x1, 16); + CSETw(x3, cNE); + BFIw(xFlags, x3, F_CF, 1); + BFIw(xFlags, x3, F_OF, 1); + if(!BOX64ENV(cputype)) { + LSRw(x2, x1, 7); + BFIw(xFlags, x2, F_SF, 1); + BFCw(xFlags, F_ZF, 1); + BFCw(xFlags, F_AF, 1); + emit_pf(dyn, ninst, x1, x4); + } + RET(xLR); +SETMARK(d_imul16); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + ASRw(x2, x1, 16); + CMPSw_REG_ASR(x2, x1, 31); + CSETw(x3, cNE); + BFIw(xFlags, x3, F_CF, 1); + BFIw(xFlags, x3, F_OF, 1); + if(!BOX64ENV(cputype)) { + LSRw(x2, x1, 15); + BFIw(xFlags, x2, F_SF, 1); + BFCw(xFlags, F_ZF, 1); + BFCw(xFlags, F_AF, 1); + emit_pf(dyn, ninst, x1, x4); + } + RET(xLR); +SETMARK(d_imul32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op1)); + CMPSw_REG_ASR(x2, x1, 31); + CSETw(x3, cNE); + BFIw(xFlags, x3, F_CF, 1); + BFIw(xFlags, x3, F_OF, 1); + if(!BOX64ENV(cputype)) { + LSRw(x2, x1, 31); + BFIw(xFlags, x2, F_SF, 1); + BFCw(xFlags, F_ZF, 1); + BFCw(xFlags, F_AF, 1); + emit_pf(dyn, ninst, x1, x4); + } + RET(xLR); +SETMARK(d_imul64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op1)); + CMPSx_REG_ASR(x2, x1, 63); + CSETw(x3, cNE); + BFIw(xFlags, x3, F_CF, 1); + BFIw(xFlags, x3, F_OF, 1); + if(!BOX64ENV(cputype)) { + LSRx(x2, x1, 63); + BFIw(xFlags, x2, F_SF, 1); + BFCw(xFlags, F_ZF, 1); + BFCw(xFlags, F_AF, 1); + emit_pf(dyn, ninst, x1, x4); + } + RET(xLR); +SETMARK(d_or8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV32w(x2, 0); + emit_or8(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_or16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV32w(x2, 0); + emit_or16(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_or32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV32w(x2, 0); + rex.w = 0; + emit_or32(dyn, ninst, rex, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_or64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV64x(x2, 0); + rex.w = 1; + emit_or32(dyn, ninst, rex, x1, x2, x3, x4); + rex.w = 0; + RET(xLR); +SETMARK(d_mul8); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, res)); + CMPSw_REG_LSR(xZR, x1, 8); + CSETw(x3, cNE); + BFIw(xFlags, x3, F_CF, 1); + BFIw(xFlags, x3, F_OF, 1); + if(!BOX64ENV(cputype)) { + LSRw(x2, x1, 7); + BFIw(xFlags, x2, F_SF, 1); + BFCw(xFlags, F_ZF, 1); + BFCw(xFlags, F_AF, 1); + emit_pf(dyn, ninst, x1, x4); + } + RET(xLR); +SETMARK(d_mul16); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + CMPSw_REG_LSR(xZR, x1, 16); + CSETw(x3, cNE); + BFIw(xFlags, x3, F_CF, 1); + BFIw(xFlags, x3, F_OF, 1); + if(!BOX64ENV(cputype)) { + LSRw(x2, x1, 15); + BFIw(xFlags, x2, F_SF, 1); + BFCw(xFlags, F_ZF, 1); + BFCw(xFlags, F_AF, 1); + emit_pf(dyn, ninst, x1, x4); + } + RET(xLR); +SETMARK(d_mul32); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op1)); + CMPSw_U12(x2, 0); + CSETw(x3, cNE); + BFIw(xFlags, x3, F_CF, 1); + BFIw(xFlags, x3, F_OF, 1); + if(!BOX64ENV(cputype)) { + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + LSRw(x2, x1, 31); + BFIw(xFlags, x2, F_SF, 1); + BFCw(xFlags, F_ZF, 1); + BFCw(xFlags, F_AF, 1); + emit_pf(dyn, ninst, x1, x4); + } + RET(xLR); +SETMARK(d_mul64); + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op1)); + CMPSx_U12(x2, 0); + CSETw(x3, cNE); + BFIw(xFlags, x3, F_CF, 1); + BFIw(xFlags, x3, F_OF, 1); + if(!BOX64ENV(cputype)) { + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + LSRx(x2, x1, 63); + BFIw(xFlags, x2, F_SF, 1); + BFCw(xFlags, F_ZF, 1); + BFCw(xFlags, F_AF, 1); + emit_pf(dyn, ninst, x1, x4); + } + RET(xLR); +SETMARK(d_neg8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, op1)); + emit_neg8(dyn, ninst, x1, x3, x4); + RET(xLR); +SETMARK(d_neg16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, op1)); + emit_neg16(dyn, ninst, x1, x3, x4); + RET(xLR); +SETMARK(d_neg32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, op1)); + rex.w = 0; + emit_neg32(dyn, ninst, rex, x1, x3, x4); + RET(xLR); +SETMARK(d_neg64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, op1)); + rex.w = 1; + emit_neg32(dyn, ninst, rex, x1, x3, x4); + rex.w = 0; + RET(xLR); +SETMARK(d_shl8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRB_U12(x2, xEmu, offsetof(x64emu_t, op2)); + ANDSw_mask(x2, x2, 0, 4); + Bcond(cNE, 4+4); + RET(xLR); + emit_shl8(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_shl16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op2)); + ANDSw_mask(x2, x2, 0, 4); + Bcond(cNE, 4+4); + RET(xLR); + emit_shl16(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_shl32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op2)); + ANDSw_mask(x2, x2, 0, 4); + Bcond(cNE, 4+4); + RET(xLR); + rex.w = 0; + emit_shl32(dyn, ninst, rex, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_shl64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op2)); + ANDSw_mask(x2, x2, 0, 5); + Bcond(cNE, 4+4); + RET(xLR); + rex.w = 1; + emit_shl32(dyn, ninst, rex, x1, x2, x3, x4); + rex.w = 0; + RET(xLR); +SETMARK(d_shr8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRB_U12(x2, xEmu, offsetof(x64emu_t, op2)); + ANDSw_mask(x2, x2, 0, 4); + Bcond(cNE, 4+4); + RET(xLR); + emit_shr8(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_shr16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op2)); + ANDSw_mask(x2, x2, 0, 4); + Bcond(cNE, 4+4); + RET(xLR); + emit_shr16(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_shr32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op2)); + ANDSw_mask(x2, x2, 0, 4); + Bcond(cNE, 4+4); + RET(xLR); + rex.w = 0; + emit_shr32(dyn, ninst, rex, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_shr64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op2)); + ANDSw_mask(x2, x2, 0, 5); + Bcond(cNE, 4+4); + RET(xLR); + rex.w = 1; + emit_shr32(dyn, ninst, rex, x1, x2, x3, x4); + rex.w = 0; + RET(xLR); +SETMARK(d_sar8); + LDRSB_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRB_U12(x2, xEmu, offsetof(x64emu_t, op2)); + ANDSw_mask(x2, x2, 0, 4); + Bcond(cNE, 4+4); + RET(xLR); + emit_sar8(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_sar16); + LDRSH_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op2)); + ANDSw_mask(x2, x2, 0, 4); + Bcond(cNE, 4+4); + RET(xLR); + emit_sar16(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_sar32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op2)); + ANDSw_mask(x2, x2, 0, 4); + Bcond(cNE, 4+4); + RET(xLR); + rex.w = 0; + emit_sar32(dyn, ninst, rex, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_sar64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op2)); + ANDSw_mask(x2, x2, 0, 5); + Bcond(cNE, 4+4); + RET(xLR); + rex.w = 1; + emit_sar32(dyn, ninst, rex, x1, x2, x3, x4); + rex.w = 0; + RET(xLR); +SETMARK(d_sub8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRB_U12(x2, xEmu, offsetof(x64emu_t, op2)); + emit_sub8(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_sub16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op2)); + emit_sub16(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_sub32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op2)); + rex.w = 0; + emit_sub32(dyn, ninst, rex, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_sub64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op2)); + rex.w = 1; + emit_sub32(dyn, ninst, rex, x1, x2, x3, x4); + rex.w = 0; + RET(xLR); +SETMARK(d_xor8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV32w(x2, 0); + emit_xor8(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_xor16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV32w(x2, 0); + emit_xor16(dyn, ninst, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_xor32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV32w(x2, 0); + rex.w = 0; + emit_xor32(dyn, ninst, rex, x1, x2, x3, x4); + RET(xLR); +SETMARK(d_xor64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV64x(x2, 0); + rex.w = 1; + emit_xor32(dyn, ninst, rex, x1, x2, x3, x4); + rex.w = 0; + RET(xLR); +SETMARK(d_cmp8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRB_U12(x2, xEmu, offsetof(x64emu_t, op2)); + emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5); + RET(xLR); +SETMARK(d_cmp16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op2)); + emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5); + RET(xLR); +SETMARK(d_cmp32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op2)); + rex.w = 0; + emit_cmp32(dyn, ninst, rex, x1, x2, x3, x4, x5); + RET(xLR); +SETMARK(d_cmp64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, op1)); + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op2)); + rex.w = 1; + emit_cmp32(dyn, ninst, rex, x1, x2, x3, x4, x5); + rex.w = 0; + RET(xLR); +SETMARK(d_tst8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV32w(x2, 0xff); + emit_test8(dyn, ninst, x1, x2, x3, x4, x5); + RET(xLR); +SETMARK(d_tst16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV32w(x2, 0xffff); + emit_test16(dyn, ninst, x1, x2, x3, x4, x5); + RET(xLR); +SETMARK(d_tst32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV32w(x2, 0xffffffff); + rex.w = 0; + emit_test32(dyn, ninst, rex, x1, x2, x3, x4, x5); + RET(xLR); +SETMARK(d_tst64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + MOV64x(x2, 0xffffffffffffffffULL); + rex.w = 1; + emit_test32(dyn, ninst, rex, x1, x2, x3, x4, x5); + rex.w = 0; + RET(xLR); +// for ADC & SBB, the emit_adcX cannot be used because the CF state is not saved +SETMARK(d_adc8); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, res)); + BFXILw(xFlags, x1, 8, 1); //F_CF + LSRw(x2, x1, 7); + BFIw(xFlags, x2, F_SF, 1); + TSTw_mask(x1, 0, 7); // mask 0xff + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_ZF, 1); + LDRB_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRB_U12(x3, xEmu, offsetof(x64emu_t, op2)); + ANDw_REG(x4, x2, x3); // op1 & op2 + ORRw_REG(x2, x2, x3); // op1 | op2 + BICw_REG(x2, x2, x1); // ~res & (op1 | op2) + ORRw_REG(x2, x2, x4); // CC + LSRw(x3, x2, 3); + BFIw(xFlags, x3, F_AF, 1); + LSRw(x3, x2, 6); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_adc8b); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, res)); + LDRB_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRB_U12(x3, xEmu, offsetof(x64emu_t, op2)); + ADDw_REG(x4, x2, x3); + SUBw_UXTB(x4, x1, x4); + CBZw(x4, 4+4); + MOVZw(x4, 1); + ADDw_REG(x1, x2, x3); + ADDw_REG(x1, x1, x4); // recompute res as 16bits + BFXILw(xFlags, x1, 8, 1); //F_CF + LSRw(x4, x1, 7); + BFIw(xFlags, x4, F_SF, 1); + TSTw_mask(x1, 0, 7); // mask 0xff + CSETw(x4, cEQ); + BFIw(xFlags, x4, F_ZF, 1); + ANDw_REG(x4, x2, x3); // op1 & op2 + ORRw_REG(x2, x2, x3); // op1 | op2 + BICw_REG(x2, x2, x1); // ~res & (op1 | op2) + ORRw_REG(x2, x2, x4); // CC + LSRw(x3, x2, 3); + BFIw(xFlags, x3, F_AF, 1); + LSRw(x3, x2, 6); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_adc16); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + BFXILw(xFlags, x1, 16, 1); //F_CF + LSRw(x2, x1, 15); + BFIw(xFlags, x2, F_SF, 1); + TSTw_mask(x1, 0, 15); // mask 0xffff + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_ZF, 1); + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRH_U12(x3, xEmu, offsetof(x64emu_t, op2)); + ANDw_REG(x4, x2, x3); // op1 & op2 + ORRw_REG(x2, x2, x3); // op1 | op2 + BICw_REG(x2, x2, x1); // ~res & (op1 | op2) + ORRw_REG(x2, x2, x4); // CC + LSRw(x3, x2, 3); + BFIw(xFlags, x3, F_AF, 1); + LSRw(x3, x2, 14); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_adc16b); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, res)); + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRH_U12(x3, xEmu, offsetof(x64emu_t, op2)); + ADDw_REG(x4, x2, x3); + SUBw_UXTH(x4, x1, x4); + CBZw(x4, 4+4); + MOVZw(x4, 1); + ADDw_REG(x1, x2, x3); + ADDw_REG(x1, x1, x4); // recompute res as 16bits + BFXILw(xFlags, x1, 16, 1); //F_CF + LSRw(x4, x1, 15); + BFIw(xFlags, x4, F_SF, 1); + TSTw_mask(x1, 0, 15); // mask 0xffff + CSETw(x4, cEQ); + BFIw(xFlags, x4, F_ZF, 1); + ANDw_REG(x4, x2, x3); // op1 & op2 + ORRw_REG(x2, x2, x3); // op1 | op2 + BICw_REG(x2, x2, x1); // ~res & (op1 | op2) + ORRw_REG(x2, x2, x4); // CC + LSRw(x3, x2, 3); + BFIw(xFlags, x3, F_AF, 1); + LSRw(x3, x2, 14); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_adc32); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + BFXILx(xFlags, x1, 32, 1); //F_CF + LSRw(x2, x1, 31); + BFIw(xFlags, x2, F_SF, 1); + TSTw_REG(x1, x1); + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_ZF, 1); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRw_U12(x3, xEmu, offsetof(x64emu_t, op2)); + ANDw_REG(x4, x2, x3); // op1 & op2 + ORRw_REG(x2, x2, x3); // op1 | op2 + BICw_REG(x2, x2, x1); // ~res & (op1 | op2) + ORRw_REG(x2, x2, x4); // CC + LSRw(x3, x2, 3); + BFIw(xFlags, x3, F_AF, 1); + LSRw(x3, x2, 30); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_adc32b); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + LSRw(x2, x1, 31); + BFIw(xFlags, x2, F_SF, 1); + TSTw_REG(x1, x1); + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_ZF, 1); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRw_U12(x3, xEmu, offsetof(x64emu_t, op2)); + ADDw_REG(x4, x2, x3); + CMPSw_REG(x1, x4); + CSETw(x4, cNE); + ADDx_REG(x4, x4, x2); + ADDx_REG(x4, x4, x3); + BFXILx(xFlags, x4, 32, 1); //F_CF + ANDw_REG(x4, x2, x3); // op1 & op2 + ORRw_REG(x2, x2, x3); // op1 | op2 + BICw_REG(x2, x2, x1); // ~res & (op1 | op2) + ORRw_REG(x2, x2, x4); // CC + LSRw(x3, x2, 3); + BFIw(xFlags, x3, F_AF, 1); + LSRw(x3, x2, 30); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_adc64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + LSRx(x2, x1, 63); + BFIw(xFlags, x2, F_SF, 1); + TSTx_REG(x1, x1); + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_ZF, 1); + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRx_U12(x3, xEmu, offsetof(x64emu_t, op2)); + ADDx_REG(x4, x2, x3); + CMPSx_REG(x1, x4); + CSETw(x4, cNE); + ADDx_UXTW(x4, x4, x2); + ADDx_UXTW(x4, x4, x3); // x4 = lo + LSRx(x4, x4, 32); + ADDx_REG_LSR(x4, x4, x2, 32); + ADDx_REG_LSR(x4, x4, x3, 32); // hi + BFXILx(xFlags, x4, 32, 1); //F_CF + ANDx_REG(x4, x2, x3); // op1 & op2 + ORRx_REG(x2, x2, x3); // op1 | op2 + BICx_REG(x2, x2, x1); // ~res & (op1 | op2) + ORRx_REG(x2, x2, x4); // CC + LSRx(x3, x2, 3); + BFIx(xFlags, x3, F_AF, 1); + LSRx(x3, x2, 62); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_sbb8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, res)); + LSRw(x2, x1, 7); + BFIw(xFlags, x2, F_SF, 1); + TSTw_mask(x1, 0, 7); // mask 0xff + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_ZF, 1); + LDRB_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRB_U12(x3, xEmu, offsetof(x64emu_t, op2)); + BICw_REG(x4, x3, x2); // ~op1 & op2 + ORNw_REG(x2, x3, x2); // ~op1 | op2 + ANDw_REG(x2, x2, x1); // res & (~op1 | op2) + ORRw_REG(x2, x2, x4); // CC + BFXILw(xFlags, x2, 7, 1); + LSRw(x3, x2, 3); + BFIw(xFlags, x3, F_AF, 1); + LSRw(x3, x2, 6); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_sbb16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, res)); + LSRw(x2, x1, 15); + BFIw(xFlags, x2, F_SF, 1); + TSTw_mask(x1, 0, 15); // mask 0xffff + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_ZF, 1); + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRH_U12(x3, xEmu, offsetof(x64emu_t, op2)); + BICw_REG(x4, x3, x2); // ~op1 & op2 + ORNw_REG(x2, x3, x2); // ~op1 | op2 + ANDw_REG(x2, x2, x1); // res & (~op1 | op2) + ORRw_REG(x2, x2, x4); // CC + BFXILw(xFlags, x2, 15, 1); + LSRw(x3, x2, 3); + BFIw(xFlags, x3, F_AF, 1); + LSRw(x3, x2, 14); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_sbb32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + LSRw(x2, x1, 31); + BFIw(xFlags, x2, F_SF, 1); + TSTw_REG(x1, x1); + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_ZF, 1); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRw_U12(x3, xEmu, offsetof(x64emu_t, op2)); + BICw_REG(x4, x3, x2); // ~op1 & op2 + ORNw_REG(x2, x3, x2); // ~op1 | op2 + ANDw_REG(x2, x2, x1); // res & (~op1 | op2) + ORRw_REG(x2, x2, x4); // CC + BFXILw(xFlags, x2, 31, 1); + LSRw(x3, x2, 3); + BFIw(xFlags, x3, F_AF, 1); + LSRw(x3, x2, 30); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_sbb64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + LSRx(x2, x1, 63); + BFIw(xFlags, x2, F_SF, 1); + TSTx_REG(x1, x1); + CSETw(x2, cEQ); + BFIw(xFlags, x2, F_ZF, 1); + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRx_U12(x3, xEmu, offsetof(x64emu_t, op2)); + BICx_REG(x4, x3, x2); // ~op1 & op2 + ORNx_REG(x2, x3, x2); // ~op1 | op2 + ANDx_REG(x2, x2, x1); // res & (~op1 | op2) + ORRx_REG(x2, x2, x4); // CC + BFXILx(xFlags, x2, 63, 1); + LSRw(x3, x2, 3); + BFIw(xFlags, x3, F_AF, 1); + LSRx(x3, x2, 62); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_rol8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, res)); + if(BOX64ENV(cputype)) { + EORw_REG_LSR(x2, x1, x1, 7); + BFIw(xFlags, x2, F_OF, 1); + } else { + LDRB_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LSLw_IMM(x3, x2, 6); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + } + BFXILw(xFlags, x1, 0, 1); + RET(xLR); +SETMARK(d_rol16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, res)); + if(BOX64ENV(cputype)) { + EORw_REG_LSR(x2, x1, x1, 15); + BFIw(xFlags, x2, F_OF, 1); + } else { + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LSLw_IMM(x3, x2, 14); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + } + BFXILw(xFlags, x1, 0, 1); + RET(xLR); +SETMARK(d_rol32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + if(BOX64ENV(cputype)) { + EORw_REG_LSR(x2, x1, x1, 31); + BFIw(xFlags, x2, F_OF, 1); + } else { + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LSLw_IMM(x3, x2, 30); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + } + BFXILw(xFlags, x1, 0, 1); + RET(xLR); +SETMARK(d_rol64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + if(BOX64ENV(cputype)) { + EORx_REG_LSR(x2, x1, x1, 63); + BFIw(xFlags, x2, F_OF, 1); + } else { + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LSLx_IMM(x3, x2, 62); + EORw_REG_LSR(x3, x3, x3, 1); + BFIw(xFlags, x3, F_OF, 1); + } + BFXILw(xFlags, x1, 0, 1); + RET(xLR); +SETMARK(d_ror8); + LDRB_U12(x1, xEmu, offsetof(x64emu_t, res)); + if(BOX64ENV(cputype)) { + LSLw_IMM(x2, x1, 6); + EORw_REG_LSR(x3, x2, x2, 1); + BFIw(xFlags, x3, F_OF, 1); + } else { + LDRB_U12(x2, xEmu, offsetof(x64emu_t, op1)); + EORw_REG_LSR(x3, x2, x2, 7); + BFIw(xFlags, x3, F_OF, 1); + } + BFXILw(xFlags, x1, 7, 1); + RET(xLR); +SETMARK(d_ror16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, res)); + if(BOX64ENV(cputype)) { + LSLw_IMM(x2, x1, 14); + EORw_REG_LSR(x3, x2, x2, 1); + BFIw(xFlags, x3, F_OF, 1); + } else { + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op1)); + EORw_REG_LSR(x3, x2, x2, 15); + BFIw(xFlags, x3, F_OF, 1); + } + BFXILw(xFlags, x1, 15, 1); + RET(xLR); +SETMARK(d_ror32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + if(BOX64ENV(cputype)) { + LSLw_IMM(x2, x1, 30); + EORw_REG_LSR(x3, x2, x2, 1); + BFIw(xFlags, x3, F_OF, 1); + } else { + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op1)); + EORw_REG_LSR(x3, x2, x2, 31); + BFIw(xFlags, x3, F_OF, 1); + } + BFXILw(xFlags, x1, 31, 1); + RET(xLR); +SETMARK(d_ror64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + if(BOX64ENV(cputype)) { + LSLx_IMM(x2, x1, 62); + EORw_REG_LSR(x3, x2, x2, 1); + BFIw(xFlags, x3, F_OF, 1); + } else { + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op1)); + EORx_REG_LSR(x3, x2, x2, 63); + BFIw(xFlags, x3, F_OF, 1); + } + BFXILx(xFlags, x1, 63, 1); + RET(xLR); +SETMARK(d_shrd16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, res)); + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRH_U12(x3, xEmu, offsetof(x64emu_t, op2)); + if(BOX64ENV(cputype)) { + LSRw(x4, x1, 14); + EORw_REG_LSR(x4, x4, x4, 1); + BFIw(xFlags, x4, F_OF, 1); + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + } else { + ANDw_mask(x4, x3, 0, 3); // mask = 0x0f + SUBw_U12(x4, x4, 16); + NEGw_REG(x4, x4); + LSRw_REG(x4, x1, x4); + EORw_REG_LSR(x4, x4, x2, 15); + BFIw(xFlags, x4, F_OF, 1); + BFCw(xFlags, F_AF, 1); + } + CBZw(x3, 4+4); + RET(xLR); + SUBw_U12(x4, x3, 1); + LSRw_REG(x4, x2, x4); + if(BOX64ENV(cputype)) { + CMPSw_U12(x3, 15); + CSELw(x4, x4, xZR, cGT); + } + BFIw(xFlags, x4, F_CF, 1); + LSRw(x4, x1, 15); + BFIw(xFlags, x4, F_SF, 1); + TSTw_mask(x1, 0, 15); + CSETw(x4, cEQ); + BFIw(xFlags, x4, F_ZF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_shrd32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRw_U12(x3, xEmu, offsetof(x64emu_t, op2)); + CBNZw(x3, 4+4); + RET(xLR); + if(BOX64ENV(cputype)) { + LSRw(x4, x1, 30); + EORw_REG_LSR(x4, x4, x4, 1); + BFIw(xFlags, x4, F_OF, 1); + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + } else { + SUBw_U12(x4, x3, 32); + NEGw_REG(x4, x4); + LSRw_REG(x4, x1, x4); + EORw_REG_LSR(x4, x4, x2, 31); + BFIw(xFlags, x4, F_OF, 1); + BFCw(xFlags, F_AF, 1); + } + SUBw_U12(x4, x3, 1); + LSRw_REG(x4, x2, x4); + BFIw(xFlags, x4, F_CF, 1); + LSRw(x4, x1, 31); + BFIw(xFlags, x4, F_SF, 1); + TSTw_REG(x1, x1); + CSETw(x4, cEQ); + BFIw(xFlags, x4, F_ZF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_shrd64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRx_U12(x3, xEmu, offsetof(x64emu_t, op2)); + CBNZw(x3, 4+4); + RET(xLR); + if(BOX64ENV(cputype)) { + LSRx(x4, x1, 62); + EORw_REG_LSR(x4, x4, x4, 1); + BFIw(xFlags, x4, F_OF, 1); + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + } else { + SUBw_U12(x4, x3, 64); + NEGw_REG(x4, x4); + LSRx_REG(x4, x1, x4); + EORx_REG_LSR(x4, x4, x2, 63); + BFIw(xFlags, x4, F_OF, 1); + BFCw(xFlags, F_AF, 1); + } + SUBx_U12(x4, x3, 1); + LSRx_REG(x4, x2, x4); + BFIw(xFlags, x4, F_CF, 1); + LSRx(x4, x1, 63); + BFIw(xFlags, x4, F_SF, 1); + TSTx_REG(x1, x1); + CSETw(x4, cEQ); + BFIw(xFlags, x4, F_ZF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_shld16); + LDRH_U12(x1, xEmu, offsetof(x64emu_t, res)); + LDRH_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRH_U12(x3, xEmu, offsetof(x64emu_t, op2)); + CBNZw(x3, 4+4); + RET(xLR); + SUBw_U12(x4, x3, 16); + NEGw_REG(x4, x4); + LSRw_REG(x4, x2, x4); + BFIw(xFlags, x4, F_CF, 1); + if(BOX64ENV(cputype)) { + EORw_REG_LSR(x4, xFlags, x1, 15); + CMPSw_U12(x3, 15); + CSELw(x4, x4, xFlags, cGT); + BFIw(xFlags, x4, F_OF, 1); + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + } else { + LSRw(x4, x2, 14); + EORw_REG_LSR(x4, x4, x4, 1); + BFIw(xFlags, x4, F_OF, 1); + BFCw(xFlags, F_AF, 1); + } + LSRw(x4, x1, 15); + BFIw(xFlags, x4, F_SF, 1); + TSTw_mask(x1, 0, 15); + CSETw(x4, cEQ); + BFIw(xFlags, x4, F_ZF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_shld32); + LDRw_U12(x1, xEmu, offsetof(x64emu_t, res)); + LDRw_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRw_U12(x3, xEmu, offsetof(x64emu_t, op2)); + CBNZw(x3, 4+4); + RET(xLR); + SUBw_U12(x4, x3, 32); + NEGw_REG(x4, x4); + LSRw_REG(x4, x2, x4); + BFIw(xFlags, x4, F_CF, 1); + if(BOX64ENV(cputype)) { + EORw_REG_LSR(x4, xFlags, x1, 31); + BFIw(xFlags, x4, F_OF, 1); + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + } else { + LSRw(x4, x2, 30); + EORw_REG_LSR(x4, x4, x4, 1); + BFIw(xFlags, x4, F_OF, 1); + BFCw(xFlags, F_AF, 1); + } + LSRw(x4, x1, 31); + BFIw(xFlags, x4, F_SF, 1); + TSTw_REG(x1, x1); + CSETw(x4, cEQ); + BFIw(xFlags, x4, F_ZF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +SETMARK(d_shld64); + LDRx_U12(x1, xEmu, offsetof(x64emu_t, res)); + LDRx_U12(x2, xEmu, offsetof(x64emu_t, op1)); + LDRx_U12(x3, xEmu, offsetof(x64emu_t, op2)); + CBNZx(x3, 4+4); + RET(xLR); + MOV32w(x4, 64); + SUBw_REG(x4, x4, x3); + LSRx_REG(x4, x2, x4); + BFIw(xFlags, x4, F_CF, 1); + if(BOX64ENV(cputype)) { + EORx_REG_LSR(x4, xFlags, x1, 63); + BFIw(xFlags, x4, F_OF, 1); + ORRw_mask(xFlags, xFlags, 28, 0); // mask = 0x10 + } else { + LSRx(x4, x2, 62); + EORw_REG_LSR(x4, x4, x4, 1); + BFIw(xFlags, x4, F_OF, 1); + BFCw(xFlags, F_AF, 1); + } + LSRx(x4, x1, 63); + BFIw(xFlags, x4, F_SF, 1); + TSTx_REG(x1, x1); + CSETw(x4, cEQ); + BFIw(xFlags, x4, F_ZF, 1); + emit_pf(dyn, ninst, x1, x4); + RET(xLR); +// all done! +} \ No newline at end of file diff --git a/src/dynarec/dynablock.c b/src/dynarec/dynablock.c index 4c70316..7437d68 100644 --- a/src/dynarec/dynablock.c +++ b/src/dynarec/dynablock.c @@ -1,14 +1,13 @@ #include #include #include -#include -#include +#include +#include "os.h" #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -17,10 +16,10 @@ #include "dynablock.h" #include "dynablock_private.h" #include "dynarec_private.h" -#include "elfloader.h" -#include "bridge.h" +#include "alternate.h" #include "dynarec_native.h" +#include "dynarec_arch.h" #include "native_lock.h" #include "custommem.h" @@ -30,6 +29,9 @@ uint32_t X31_hash_code(void* addr, int len) { if(!len) return 0; + #ifdef ARCH_CRC + ARCH_CRC(addr, len); + #endif uint8_t* p = (uint8_t*)addr; int32_t h = *p; for (--len, ++p; len; --len, ++p) h = (h << 5) - h + (int32_t)*p; @@ -44,19 +46,26 @@ dynablock_t* InvalidDynablock(dynablock_t* db, int need_lock) dynarec_log(LOG_DEBUG, "InvalidDynablock(%p), db->block=%p x64=%p:%p already gone=%d\n", db, db->block, db->x64_addr, db->x64_addr+db->x64_size-1, db->gone); // remove jumptable without waiting setJumpTableDefault64(db->x64_addr); + for(int i=0; isep_size; ++i) + if(db->sep[i].active) + setJumpTableDefault64(db->x64_addr+db->sep[i].x64_offs); if(need_lock) mutex_lock(&my_context->mutex_dyndump); db->done = 0; db->gone = 1; uintptr_t db_size = db->x64_size; - if(db_size && my_context) { - uint32_t n = rb_get(my_context->db_sizes, db_size); - if(n>1) - rb_set(my_context->db_sizes, db_size, db_size+1, n-1); - else - rb_unset(my_context->db_sizes, db_size, db_size+1); - if(db_size == my_context->max_db_size) { - my_context->max_db_size = rb_get_righter(my_context->db_sizes); + #ifdef ARCH_NOP + if(db->callret_size) { + // mark all callrets to UDF + for(int i=0; icallret_size; ++i) + *(uint32_t*)(db->block+db->callrets[i].offs) = ARCH_UDF; + ClearCache(db->block, db->size); + } + #endif + if(db_size && my_context && !BOX64ENV(dynarec_dirty)) { + uint32_t n = rb_dec(my_context->db_sizes, db_size, db_size+1); + if(!n && (db_size >= my_context->max_db_size)) { + my_context->max_db_size = rb_get_rightmost(my_context->db_sizes); dynarec_log(LOG_INFO, "BOX64 Dynarec: lower max_db=%d\n", my_context->max_db_size); } } @@ -66,29 +75,71 @@ dynablock_t* InvalidDynablock(dynablock_t* db, int need_lock) return db; } +dynablock_t* SwitchDynablock(dynablock_t* db, int need_lock) +{ + if(db) { + if(!db->done || !db->previous || !db->previous->gone) + return NULL; // not a correct block! + dynarec_log(LOG_DEBUG, "SwitchDynablock(%p/%p), db->block=%p->%p x64=%p:%p->%p hash->%x->%x\n", db, db->previous, db->block, db->previous->block, db->x64_addr, db->x64_addr+db->x64_size-1, db->previous->x64_addr+db->previous->x64_size-1, db->hash, db->previous->hash); + // remove jumptable without waiting + dynablock_t* db_new = db->previous; + db->previous = NULL; + if(need_lock) + mutex_lock(&my_context->mutex_dyndump); + InvalidDynablock(db, 0); + db_new->done = 1; + db_new->gone = 0; + db_new->previous = db; + #ifdef ARCH_NOP + if(db_new->callret_size) { + // mark all callrets to UDF + for(int i=0; icallret_size; ++i) + *(uint32_t*)(db_new->block+db_new->callrets[i].offs) = ARCH_NOP; + ClearCache(db_new->block, db_new->size); + } + #endif + if(need_lock) + mutex_unlock(&my_context->mutex_dyndump); + return db_new; + } + return db; +} + void FreeInvalidDynablock(dynablock_t* db, int need_lock) { if(db) { if(!db->gone) return; // already in the process of deletion! dynarec_log(LOG_DEBUG, "FreeInvalidDynablock(%p), db->block=%p x64=%p:%p already gone=%d\n", db, db->block, db->x64_addr, db->x64_addr+db->x64_size-1, db->gone); + uintptr_t db_size = db->x64_size; if(need_lock) mutex_lock(&my_context->mutex_dyndump); - FreeDynarecMap((uintptr_t)db->actual_block); - customFree(db); + if(db_size && my_context && BOX64ENV(dynarec_dirty)) { + uint32_t n = rb_dec(my_context->db_sizes, db_size, db_size+1); + if(!n && (db_size >= my_context->max_db_size)) { + my_context->max_db_size = rb_get_rightmost(my_context->db_sizes); + dynarec_log(LOG_INFO, "BOX64 Dynarec: lower max_db=%d\n", my_context->max_db_size); + } + } + FreeDynarecMap((uintptr_t)db->actual_block); // will also free db if(need_lock) mutex_unlock(&my_context->mutex_dyndump); } } -void FreeDynablock(dynablock_t* db, int need_lock) +void FreeDynablock(dynablock_t* db, int need_lock, int need_remove) { if(db) { if(db->gone) return; // already in the process of deletion! dynarec_log(LOG_DEBUG, "FreeDynablock(%p), db->block=%p x64=%p:%p already gone=%d\n", db, db->block, db->x64_addr, db->x64_addr+db->x64_size-1, db->gone); // remove jumptable without waiting - setJumpTableDefault64(db->x64_addr); + if(need_remove) { + setJumpTableDefault64(db->x64_addr); + for(int i=0; isep_size; ++i) + if(db->sep[i].active) + setJumpTableDefault64(db->x64_addr+db->sep[i].x64_offs); + } if(need_lock) mutex_lock(&my_context->mutex_dyndump); dynarec_log(LOG_DEBUG, " -- FreeDyrecMap(%p, %d)\n", db->actual_block, db->size); @@ -96,20 +147,15 @@ void FreeDynablock(dynablock_t* db, int need_lock) db->gone = 1; uintptr_t db_size = db->x64_size; if(db_size && my_context) { - uint32_t n = rb_get(my_context->db_sizes, db_size); - if(n>1) - rb_set(my_context->db_sizes, db_size, db_size+1, n-1); - else - rb_unset(my_context->db_sizes, db_size, db_size+1); - if(db_size == my_context->max_db_size) { - my_context->max_db_size = rb_get_righter(my_context->db_sizes); + uint32_t n = rb_dec(my_context->db_sizes, db_size, db_size+1); + if(!n && (db_size >= my_context->max_db_size)) { + my_context->max_db_size = rb_get_rightmost(my_context->db_sizes); dynarec_log(LOG_INFO, "BOX64 Dynarec: lower max_db=%d\n", my_context->max_db_size); } } if(db->previous) FreeInvalidDynablock(db->previous, 0); - FreeDynarecMap((uintptr_t)db->actual_block); - customFree(db); + FreeDynarecMap((uintptr_t)db->actual_block); // will also free db if(need_lock) mutex_unlock(&my_context->mutex_dyndump); } @@ -121,6 +167,9 @@ void MarkDynablock(dynablock_t* db) { if(db) { dynarec_log(LOG_DEBUG, "MarkDynablock %p %p-%p\n", db, db->x64_addr, db->x64_addr+db->x64_size-1); + for(int i=0; isep_size; ++i) + if(db->sep[i].active) + setJumpTableIfRef64(db->x64_addr+db->sep[i].x64_offs, db->jmpnext, db->block+db->sep[i].nat_offs); if(!setJumpTableIfRef64(db->x64_addr, db->jmpnext, db->block)) { dynablock_t* old = db; db = getDB((uintptr_t)old->x64_addr); @@ -134,6 +183,14 @@ void MarkDynablock(dynablock_t* db) else db->previous = old; } + #ifdef ARCH_NOP + } else { + if(db->callret_size) { + // mark all callrets to UDF + for(int i=0; icallret_size; ++i) + *(uint32_t*)(db->block+db->callrets[i].offs) = ARCH_UDF; + } + #endif } } } @@ -162,135 +219,215 @@ int FreeRangeDynablock(dynablock_t* db, uintptr_t addr, uintptr_t size) int need_lock = my_context?1:0; if(IntervalIntersects((uintptr_t)db->x64_addr, (uintptr_t)db->x64_addr+db->x64_size-1, addr, addr+size+1)) { - FreeDynablock(db, need_lock); + FreeDynablock(db, need_lock, 1); return 0; } return 1; } -dynablock_t *AddNewDynablock(uintptr_t addr) +NEW_JUMPBUFF(dynarec_jmpbuf); + +void cancelFillBlock() { - dynablock_t* block; - // create and add new block - dynarec_log(LOG_VERBOSE, "Ask for DynaRec Block creation @%p\n", (void*)addr); - block = (dynablock_t*)customCalloc(1, sizeof(dynablock_t)); - return block; + LongJmp(GET_JUMPBUFF(dynarec_jmpbuf), 1); } -//TODO: move this to dynrec_arm.c and track allocated structure to avoid memory leak -static __thread JUMPBUFF dynarec_jmpbuf; -#ifdef ANDROID -#define DYN_JMPBUF dynarec_jmpbuf -#else -#define DYN_JMPBUF &dynarec_jmpbuf -#endif - -void cancelFillBlock() +void dynablock_leave_runtime(dynablock_t* db) { - longjmp(DYN_JMPBUF, 1); + if(!db) return; + if(!db->tick) return; + __atomic_fetch_sub(&db->in_used, 1, __ATOMIC_ACQ_REL); } /* return NULL if block is not found / cannot be created. Don't create if create==0 */ -static dynablock_t* internalDBGetBlock(x64emu_t* emu, uintptr_t addr, uintptr_t filladdr, int create, int need_lock, int is32bits) +static dynablock_t* internalDBGetBlock(x64emu_t* emu, uintptr_t addr, uintptr_t filladdr, int create, int need_lock, int is32bits, int is_new) { - if(hasAlternate((void*)addr)) + if (hasAlternate((void*)filladdr)) + return NULL; + const uint32_t req_prot = (box64_pagesize==4096)?(PROT_EXEC|PROT_READ):PROT_READ; + if(BOX64ENV(nodynarec_delay) && (addr>=BOX64ENV(nodynarec_start)) && (addrmutex_dyndump); } else { - if(mutex_trylock(&my_context->mutex_dyndump)) // FillBlock not available for now + if(mutex_trylock(&my_context->mutex_dyndump)) { // FillBlock not available for now + pthread_sigmask(SIG_SETMASK, &old_sig, NULL); return NULL; + } } block = getDB(addr); // just in case if(block) { + if(block && getNeedTest(addr) && (getProtection_fast(addr)&req_prot)!=req_prot) + block = NULL; mutex_unlock(&my_context->mutex_dyndump); + pthread_sigmask(SIG_SETMASK, &old_sig, NULL); return block; } } - - block = AddNewDynablock(addr); - - // fill the block - block->x64_addr = (void*)addr; - if(sigsetjmp(DYN_JMPBUF, 1)) { +#ifndef _WIN32 + if((getProtection_fast(filladdr)&req_prot)!=req_prot) {// cannot be run, get out of the Dynarec + if(need_lock) + mutex_unlock(&my_context->mutex_dyndump); + pthread_sigmask(SIG_SETMASK, &old_sig, NULL); + return NULL; + } +#endif + if (SigSetJmp(GET_JUMPBUFF(dynarec_jmpbuf), 1)) { printf_log(LOG_INFO, "FillBlock at %p triggered a segfault, canceling\n", (void*)addr); - FreeDynablock(block, 0); if(need_lock) mutex_unlock(&my_context->mutex_dyndump); + pthread_sigmask(SIG_SETMASK, &old_sig, NULL); return NULL; } - void* ret = FillBlock64(block, filladdr, (addr==filladdr)?0:1, is32bits); - if(!ret) { + block = FillBlock64(filladdr, (addr==filladdr)?0:1, is32bits, MAX_INSTS, is_new); + if(!block) { dynarec_log(LOG_DEBUG, "Fillblock of block %p for %p returned an error\n", block, (void*)addr); - customFree(block); - block = NULL; } // check size if(block) { // fill-in jumptable - if(!addJumpTableIfDefault64(block->x64_addr, block->dirty?block->jmpnext:block->block)) { - FreeDynablock(block, 0); + if(!addJumpTableIfDefault64(block->x64_addr, (block->dirty || block->always_test)?block->jmpnext:block->block)) { + FreeDynablock(block, 0, 0); block = getDB(addr); MarkDynablock(block); // just in case... } else { + if(block->dirty) + block->dirty = 0; if(block->x64_size) { if(block->x64_size>my_context->max_db_size) { my_context->max_db_size = block->x64_size; dynarec_log(LOG_INFO, "BOX64 Dynarec: higher max_db=%d\n", my_context->max_db_size); } block->done = 1; // don't validate the block if the size is null, but keep the block - rb_set(my_context->db_sizes, block->x64_size, block->x64_size+1, rb_get(my_context->db_sizes, block->x64_size)+1); + rb_inc(my_context->db_sizes, block->x64_size, block->x64_size+1); + } + for(int i=0; isep_size; ++i) { + uint32_t x64_offs = block->sep[i].x64_offs; + uint32_t nat_offs = block->sep[i].nat_offs; + if(addJumpTableIfDefault64(block->x64_addr+x64_offs, (block->dirty || block->always_test)?block->jmpnext:(block->block+nat_offs))) + block->sep[i].active = 1; + else + block->sep[i].active = 0; } } } if(need_lock) mutex_unlock(&my_context->mutex_dyndump); + pthread_sigmask(SIG_SETMASK, &old_sig, NULL); - dynarec_log(LOG_DEBUG, "%04d| --- DynaRec Block created @%p:%p (%p, 0x%x bytes)\n", GetTID(), (void*)addr, (void*)(addr+((block)?block->x64_size:1)-1), (block)?block->block:0, (block)?block->size:0); + dynarec_log(LOG_DEBUG, "%04d| --- DynaRec Block %p created @%p:%p (%p, 0x%x bytes)\n", GetTID(), block, (void*)addr, (void*)(addr+((block)?block->x64_size:1)-1), (block)?block->block:0, (block)?block->size:0); return block; } dynablock_t* DBGetBlock(x64emu_t* emu, uintptr_t addr, int create, int is32bits) { - if(isInHotPage(addr)) + int is_inhotpage = isInHotPage(addr); + if(is_inhotpage && !BOX64ENV(dynarec_dirty)) return NULL; - dynablock_t *db = internalDBGetBlock(emu, addr, addr, create, 1, is32bits); + dynablock_t *db = internalDBGetBlock(emu, addr, addr, create, 1, is32bits, 1); if(db && db->done && db->block && getNeedTest(addr)) { - if(db->always_test) - sched_yield(); // just calm down... + //if (db->always_test) SchedYield(); // just calm down... uint32_t hash = X31_hash_code(db->x64_addr, db->x64_size); - int need_lock = mutex_trylock(&my_context->mutex_dyndump); + mutex_lock(&my_context->mutex_dyndump)?1:0; if(hash!=db->hash) { + if(is_inhotpage && db->previous) { + // check alternate + if(db->previous && !db->dirty && X31_hash_code(db->previous->x64_addr, db->previous->x64_size)==db->previous->hash) { + db = SwitchDynablock(db, 0); + if(!addJumpTableIfDefault64(db->x64_addr, (db->always_test)?db->jmpnext:db->block)) { + FreeDynablock(db, 0, 0); + db = getDB(addr); + MarkDynablock(db); // just in case... + } else { + for(int i=0; isep_size; ++i) { + uint32_t x64_offs = db->sep[i].x64_offs; + uint32_t nat_offs = db->sep[i].nat_offs; + if(addJumpTableIfDefault64(db->x64_addr+x64_offs, (db->always_test)?db->jmpnext:(db->block+nat_offs))) + db->sep[i].active = 1; + else + db->sep[i].active = 0; + } + } + mutex_unlock(&my_context->mutex_dyndump); + return db; + } + mutex_unlock(&my_context->mutex_dyndump); + dynarec_log(LOG_DEBUG, "Cannot run block (or previous) %p from %p:%p (hash:%X/%X, always_test:%d, previous=%p/hash=%X) for %p\n", db, db->x64_addr, db->x64_addr+db->x64_size-1, hash, db->hash, db->always_test,db->previous, db->previous?db->previous->hash:0,(void*)addr); + return NULL; // will be handle when hotpage is over + } db->done = 0; // invalidating the block - dynarec_log(LOG_DEBUG, "Invalidating block %p from %p:%p (hash:%X/%X, always_test:%d) for %p\n", db, db->x64_addr, db->x64_addr+db->x64_size-1, hash, db->hash, db->always_test,(void*)addr); + dynarec_log(LOG_DEBUG, "Invalidating block %p from %p:%p (hash:%X/%X, always_test:%d, previous=%p/hash=%X) for %p\n", db, db->x64_addr, db->x64_addr+db->x64_size-1, hash, db->hash, db->always_test,db->previous, db->previous?db->previous->hash:0,(void*)addr); // Free db, it's now invalid! - dynablock_t* old = InvalidDynablock(db, need_lock); + dynablock_t* old = InvalidDynablock(db, 0); // start again... (will create a new block) - db = internalDBGetBlock(emu, addr, addr, create, need_lock, is32bits); + db = internalDBGetBlock(emu, addr, addr, create, 0, is32bits, 0); if(db) { if(db->previous) - FreeInvalidDynablock(db->previous, need_lock); + FreeInvalidDynablock(db->previous, 0); db->previous = old; } else - FreeInvalidDynablock(old, need_lock); + FreeInvalidDynablock(old, 0); } else { - dynarec_log(LOG_DEBUG, "Validating block %p from %p:%p (hash:%X, always_test:%d) for %p\n", db, db->x64_addr, db->x64_addr+db->x64_size-1, db->hash, db->always_test, (void*)addr); - if(db->always_test) - protectDB((uintptr_t)db->x64_addr, db->x64_size); - else - protectDBJumpTable((uintptr_t)db->x64_addr, db->x64_size, db->block, db->jmpnext); + if(is_inhotpage) { + db->always_test = 2; + // log? + } else { + dynarec_log(LOG_DEBUG, "Validating block %p from %p:%p (hash:%X, always_test:%d) for %p\n", db, db->x64_addr, db->x64_addr+db->x64_size-1, db->hash, db->always_test, (void*)addr); + if(db->always_test) { + if(db->always_test==2) + db->always_test = 0; + protectDB((uintptr_t)db->x64_addr, db->x64_size); + } else { + #ifdef ARCH_NOP + if(db->callret_size) { + // mark all callrets to UDF + for(int i=0; icallret_size; ++i) + *(uint32_t*)(db->block+db->callrets[i].offs) = ARCH_NOP; + ClearCache(db->block, db->size); + } + #endif + protectDBJumpTable((uintptr_t)db->x64_addr, db->x64_size, db->block, db->jmpnext); + for(int i=0; isep_size; ++i) { + uint32_t x64_offs = db->sep[i].x64_offs; + uint32_t nat_offs = db->sep[i].nat_offs; + if(addJumpTableIfDefault64(db->x64_addr+x64_offs, (db->always_test)?db->jmpnext:(db->block+nat_offs))) + db->sep[i].active = 1; + else + db->sep[i].active = 0; + } + } + } } - if(!need_lock) - mutex_unlock(&my_context->mutex_dyndump); + mutex_unlock(&my_context->mutex_dyndump); } if(!db || !db->block || !db->done) emu->test.test = 0; @@ -301,35 +438,132 @@ dynablock_t* DBAlternateBlock(x64emu_t* emu, uintptr_t addr, uintptr_t filladdr, { dynarec_log(LOG_DEBUG, "Creating AlternateBlock at %p for %p%s\n", (void*)addr, (void*)filladdr, is32bits?" 32bits":""); int create = 1; - dynablock_t *db = internalDBGetBlock(emu, addr, filladdr, create, 1, is32bits); - if(db && db->done && db->block && getNeedTest(filladdr)) { - if(db->always_test) - sched_yield(); // just calm down... - int need_lock = mutex_trylock(&my_context->mutex_dyndump); + dynablock_t *db = internalDBGetBlock(emu, addr, filladdr, create, 1, is32bits, 1); + if(db && db->done && db->block && (db->dirty || getNeedTest(filladdr))) { + if (db->always_test) SchedYield(); // just calm down... + mutex_lock(&my_context->mutex_dyndump); uint32_t hash = X31_hash_code(db->x64_addr, db->x64_size); if(hash!=db->hash) { db->done = 0; // invalidating the block dynarec_log(LOG_DEBUG, "Invalidating alt block %p from %p:%p (hash:%X/%X) for %p\n", db, db->x64_addr, db->x64_addr+db->x64_size, hash, db->hash, (void*)addr); // Free db, it's now invalid! - dynablock_t* old = InvalidDynablock(db, need_lock); + dynablock_t* old = InvalidDynablock(db, 0); // start again... (will create a new block) - db = internalDBGetBlock(emu, addr, filladdr, create, need_lock, is32bits); + db = internalDBGetBlock(emu, addr, filladdr, create, 0, is32bits, 0); if(db) { if(db->previous) - FreeInvalidDynablock(db->previous, need_lock); + FreeInvalidDynablock(db->previous, 0); db->previous = old; } else - FreeInvalidDynablock(old, need_lock); + FreeInvalidDynablock(old, 0); } else { if(db->always_test) protectDB((uintptr_t)db->x64_addr, db->x64_size); - else + else { + #ifdef ARCH_NOP + if(db->callret_size) { + // mark all callrets to UDF + for(int i=0; icallret_size; ++i) + *(uint32_t*)(db->block+db->callrets[i].offs) = ARCH_NOP; + ClearCache(db->block, db->size); + } + #endif protectDBJumpTable((uintptr_t)db->x64_addr, db->x64_size, db->block, db->jmpnext); + for(int i=0; isep_size; ++i) { + uint32_t x64_offs = db->sep[i].x64_offs; + uint32_t nat_offs = db->sep[i].nat_offs; + if(addJumpTableIfDefault64(db->x64_addr+x64_offs, (db->always_test)?db->jmpnext:(db->block+nat_offs))) + db->sep[i].active = 1; + else + db->sep[i].active = 0; + } + } } - if(!need_lock) - mutex_unlock(&my_context->mutex_dyndump); + mutex_unlock(&my_context->mutex_dyndump); } if(!db || !db->block || !db->done) emu->test.test = 0; return db; } + +uintptr_t getX64Address(dynablock_t* db, uintptr_t native_addr) +{ + if ((native_addr < (uintptr_t)db->block) || (native_addr > (uintptr_t)db->actual_block + db->size)) + return 0; + uintptr_t x64addr = (uintptr_t)db->x64_addr; + uintptr_t armaddr = (uintptr_t)db->block; + if (!db->isize) return x64addr; + if(native_addr<(uintptr_t)db->block+db->prefixsize) + // issue indide the prefix, return as the 1st opcode + return x64addr; + armaddr += db->prefixsize; + int i = 0; + do { + int x64sz = 0; + int armsz = 0; + do { + x64sz += db->instsize[i].x64; + armsz += db->instsize[i].nat * 4; + ++i; + } while ((db->instsize[i - 1].x64 == 15) || (db->instsize[i - 1].nat == 15)); + // if the opcode is a NOP on ARM side (so armsz==0), it cannot be an address to find + if ((native_addr >= armaddr) && (native_addr < (armaddr + armsz))) + return x64addr; + armaddr += armsz; + x64addr += x64sz; + } while (db->instsize[i].x64 || db->instsize[i].nat); + return x64addr; +} + +int getX64AddressInst(dynablock_t* db, uintptr_t x64pc) +{ + uintptr_t x64addr = (uintptr_t)db->x64_addr; + uintptr_t armaddr = (uintptr_t)db->block; + int ret = 0; + if (x64pc < (uintptr_t)db->x64_addr || x64pc > (uintptr_t)db->x64_addr + db->x64_size) + return -1; + armaddr += db->prefixsize; + int i = 0; + do { + int x64sz = 0; + int armsz = 0; + do { + x64sz += db->instsize[i].x64; + armsz += db->instsize[i].nat * 4; + ++i; + } while ((db->instsize[i - 1].x64 == 15) || (db->instsize[i - 1].nat == 15)); + // if the opcode is a NOP on ARM side (so armsz==0), it cannot be an address to find + if ((x64pc >= x64addr) && (x64pc < (x64addr + x64sz))) + return ret; + armaddr += armsz; + x64addr += x64sz; + ret++; + } while (db->instsize[i].x64 || db->instsize[i].nat); + return ret; +} + +uintptr_t getX64InstAddress(dynablock_t* db, int inst) +{ + uintptr_t x64addr = (uintptr_t)db->x64_addr; + uintptr_t armaddr = (uintptr_t)db->block + db->prefixsize; + if (inst < 0 || inst > db->isize) + return (uintptr_t)-1LL; + int i = 0; + int ret = 0; + do { + if (inst == ret) + return x64addr; + int x64sz = 0; + int armsz = 0; + do { + x64sz += db->instsize[i].x64; + armsz += db->instsize[i].nat * 4; + ++i; + } while ((db->instsize[i - 1].x64 == 15) || (db->instsize[i - 1].nat == 15)); + // if the opcode is a NOP on ARM side (so armsz==0), it cannot be an address to find + armaddr += armsz; + x64addr += x64sz; + ret++; + } while (db->instsize[i].x64 || db->instsize[i].nat); + return (uintptr_t)-1LL; +} diff --git a/src/dynarec/dynablock_private.h b/src/dynarec/dynablock_private.h index 18666e0..908ad56 100644 --- a/src/dynarec/dynablock_private.h +++ b/src/dynarec/dynablock_private.h @@ -6,21 +6,50 @@ typedef struct instsize_s { unsigned char nat:4; } instsize_t; +typedef struct callret_s { + uint32_t offs:31; + uint32_t type:1; +} callret_t; + +typedef struct sep_s { + uint32_t active:1; + uint32_t nat_offs:31; + uint32_t x64_offs; +} sep_t; + typedef struct dynablock_s { void* block; // block-sizeof(void*) == self void* actual_block; // the actual start of the block (so block-sizeof(void*)) struct dynablock_s* previous; // a previous block that might need to be freed - int size; + uint32_t in_used;// will be 0 if not in_used, >0 if used be some code + uint32_t tick; // last "tick" when dynablock was run void* x64_addr; uintptr_t x64_size; + size_t native_size; + uint32_t prefixsize; // size in byte of the prefix of the block + int size; uint32_t hash; uint8_t done; uint8_t gone; - uint8_t always_test; uint8_t dirty; // if need to be tested as soon as it's created + uint8_t always_test:2; + uint8_t is32bits:1; + int callret_size; // size of the array int isize; + int arch_size; // size of of arch dependant infos + int sep_size; // SEP are the Secondary Entry Point instsize_t* instsize; + void* arch; // arch dependant per inst info (can be NULL) + callret_t* callrets; // array of callret return, with NOP / UDF depending if the block is clean or dirty + sep_t* sep; // secondary entry point, offsets are relative to x64_addr & block void* jmpnext; // a branch jmpnext code when block is marked + size_t table64size;// to check table64 + void* table64; // to relocate the table64 + size_t relocsize; // number of relocations (should be an int only) + void* relocs; // relocations, when block is loaded + #ifdef GDBJIT + void* gdbjit_block; + #endif } dynablock_t; -#endif //__DYNABLOCK_PRIVATE_H_ \ No newline at end of file +#endif //__DYNABLOCK_PRIVATE_H_ diff --git a/src/dynarec/dynacache_reloc.c b/src/dynarec/dynacache_reloc.c new file mode 100644 index 0000000..d3d4fa0 --- /dev/null +++ b/src/dynarec/dynacache_reloc.c @@ -0,0 +1,243 @@ +#include +#include + +#include "os.h" +#include "dynarec_private.h" +#include "emu/x64run_private.h" +#include "dynablock_private.h" +#include "dynarec_arch.h" +#include "custommem.h" +#include "debug.h" + +#define RELOC_TBL64C 1 +#define RELOC_TBL64ADDR 2 +#define RELOC_TBL64RETENDBL 3 +#define RELOC_CANCELBLOCK 4 +#define RELOC_TBL64TBLJMPH 5 +#define RELOC_TBL64TBLJMPL 6 + +typedef union reloc_s { + uint8_t type; + struct { + uint8_t type; + uint8_t C; + uint16_t idx; + } table64c; + struct { + uint8_t type; + uint8_t nothing; + uint16_t idx; + } table64addr; + struct { + uint8_t type; + uint8_t delta; + uint16_t idx; + } table64retendbl; + struct { + uint8_t type; + uint8_t deltah; + uint16_t idx; + } table64jmptblh; + struct { + uint32_t type:8; + uint32_t deltal:24; + } table64jmptbll; + uint32_t x; +} reloc_t; + +void AddRelocTable64Const(dynarec_native_t* dyn, int ninst, native_consts_t C, int pass) +{ + if(!dyn->need_reloc) + return; + if(isTable64(dyn, getConst(C))) + return; + if(pass<3) { + dyn->reloc_size++; + return; + } + // generating the reloc + reloc_t reloc = {0}; + reloc.table64c.type = RELOC_TBL64C; + reloc.table64c.C = C; + reloc.table64c.idx = dyn->table64size; + dyn->relocs[dyn->reloc_size++] = reloc.x; +} + +void AddRelocTable64RetEndBlock(dynarec_native_t* dyn, int ninst, uintptr_t addr, int pass) +{ + if(!dyn->need_reloc) + return; + if(isTable64(dyn, getJumpTableAddress64(addr))) + return; // no need, already handled + // TODO: check iif addr is in current map + if(pass<3) { + dyn->reloc_size++; + return; + } + reloc_t reloc = {0}; + intptr_t delta = addr-(dyn->start + dyn->isize); + if(delta>255 || delta<0) { + dynarec_log(LOG_INFO, "Warning Relocation Ret End Block not possible: delta=%lld, aborting block\n", delta); + dyn->abort = 1; + } + reloc.table64retendbl.type = RELOC_TBL64RETENDBL; + reloc.table64retendbl.delta = delta; + reloc.table64retendbl.idx = dyn->table64size; + dyn->relocs[dyn->reloc_size++] = reloc.x; +} + +void AddRelocCancelBlock(dynarec_native_t* dyn, int ninst, int pass) +{ + if(!dyn->need_reloc) + return; + if(pass<3) { + dyn->reloc_size++; + return; + } + reloc_t reloc = {0}; + reloc.type = RELOC_CANCELBLOCK; + dyn->relocs[dyn->reloc_size++] = reloc.x; +} + +void AddRelocTable64Addr(dynarec_native_t* dyn, int ninst, uintptr_t addr, int pass) +{ + if(!dyn->need_reloc) + return; + if(isTable64(dyn, addr)) + return; // no need, already handled + // check if addr is in the same mmap area + // else, use a cancel block instead + uintptr_t start; + int ok = 1; + if(!IsAddrFileMapped(dyn->start, NULL, &start)) + ok = 0; + else { + uintptr_t end = start + SizeFileMapped(dyn->start); + if(addr=end) + ok = 0; + if(ok && ((addr-start)>=0x100000000LL)) + ok = 0; + } + if(!ok) return AddRelocCancelBlock(dyn, ninst, pass); + if(pass<3) { + dyn->reloc_size++; + return; + } + reloc_t reloc = {0}; + reloc.type = RELOC_TBL64ADDR; + reloc.table64addr.idx = dyn->table64size; + dyn->relocs[dyn->reloc_size++] = reloc.x; +} + + +void AddRelocTable64JmpTbl(dynarec_native_t* dyn, int ninst, uintptr_t addr, int pass) +{ + if(!dyn->need_reloc) + return; + if(isTable64(dyn, getJumpTableAddress64(addr))) + return; // no need, already handled + // check if addr is in the same mmap area + // else, use a cancel block instead + uintptr_t start; + int ok = 1; + if(!IsAddrFileMapped(dyn->start, NULL, &start)) + ok = 0; + else { + uintptr_t end = start + SizeFileMapped(dyn->start); + if(addr=end) + ok = 0; + if(ok && ((addr-start)>=0x100000000LL)) + ok = 0; + } + if(!ok) return AddRelocCancelBlock(dyn, ninst, pass); + if(pass<3) { + dyn->reloc_size+=2; + return; + } + uintptr_t delta = addr - start; + reloc_t reloc = {0}; + reloc.type = RELOC_TBL64TBLJMPH; + reloc.table64jmptblh.idx = dyn->table64size; + reloc.table64jmptblh.deltah = delta>>24; + dyn->relocs[dyn->reloc_size++] = reloc.x; + reloc.type = RELOC_TBL64TBLJMPL; + reloc.table64jmptbll.deltal = delta&0xffffff; + dyn->relocs[dyn->reloc_size++] = reloc.x; +} + +int ApplyRelocs(dynablock_t* block, intptr_t delta_block, intptr_t delta_map, uintptr_t mapping_start) +{ + if(!block || !block->relocs || !block->relocsize) + return 0; + size_t reloc_size = block->relocsize / sizeof(uint32_t); + reloc_t *relocs = block->relocs; + uint64_t *table64 = block->table64; + int idx; + + int i = 0; + uintptr_t addr; + dynarec_log(LOG_DEBUG, "Will apply %zd reloc to dynablock starting at %p - %p\n", reloc_size, block->x64_addr, block->x64_addr + block->x64_size); + while(ix64_addr + block->x64_size + relocs[i].table64retendbl.delta; + table64[idx] = getJumpTableAddress64(addr); + dynarec_log(LOG_DEBUG, "\tApply Relocs[%d]: TABLE64[%d]=JmpTable64(%p)\n", i, idx, (void*)addr); + break; + case RELOC_CANCELBLOCK: + dynarec_log(LOG_DEBUG, "\tApply Relocs[%d]: Cancel Block\n", i); + block->dirty = 1; + block->hash = 0; + return 0; + case RELOC_TBL64TBLJMPH: + if(relocs[i+1].type!=RELOC_TBL64TBLJMPL) + return -2; // bad sequence + idx = relocs[i].table64jmptblh.idx; + addr = relocs[i].table64jmptblh.deltah; + addr = mapping_start + relocs[i+1].table64jmptbll.deltal + (addr<<24); + table64[idx] = getJumpTableAddress64(addr); + dynarec_log(LOG_DEBUG, "\tApply Relocs[%d,%d]: TABLE64[%d]=JmpTable64(%p)=%p\n", i, i+1, idx, (void*)addr, getJumpTableAddress64(addr)); + break; + case RELOC_TBL64TBLJMPL: + break; + default: + dynarec_log(LOG_DEBUG, "\tUnknown Relocs[%d]: %d\n", i, relocs[i].type); + return -1; + } + if(idx!=-1) { + if(idx>=block->table64size) { + dynarec_log(LOG_NONE, "Warning: Reloc Table64 idx out of range (%d vs %d)\n", idx, block->table64size); + } + } + ++i; + } + return 0; +} + +int RelocsHaveCancel(dynablock_t* block) +{ + if(!block->relocs || !block->relocsize) + return 0; + size_t reloc_size = block->relocsize/sizeof(uint32_t); + for(size_t i=0; irelocs)[i].type == RELOC_CANCELBLOCK) + return 1; + return 0; +} + +uintptr_t RelocGetNext() +{ + return getConst(const_native_next); +} diff --git a/src/dynarec/dynacache_reloc.h b/src/dynarec/dynacache_reloc.h new file mode 100644 index 0000000..63b8b77 --- /dev/null +++ b/src/dynarec/dynacache_reloc.h @@ -0,0 +1,27 @@ +#ifndef __DYNACACHE_RELOC_H__ +#define __DYNACACHE_RELOC_H__ + +#ifdef ARM64 +#include "dynarec/arm64/dynarec_arm64_consts.h" +#define native_consts_t arm64_consts_t +#elif defined(RV64) +#include "dynarec/rv64/dynarec_rv64_consts.h" +#define native_consts_t rv64_consts_t +#elif defined(LA64) +#include "dynarec/la64/dynarec_la64_consts.h" +#define native_consts_t la64_consts_t +#else +#error Unsupported architecture +#endif + +void AddRelocTable64Const(dynarec_native_t* dyn, int ninst, native_consts_t C, int pass); +void AddRelocTable64Addr(dynarec_native_t* dyn, int ninst, uintptr_t addr, int pass); +void AddRelocTable64RetEndBlock(dynarec_native_t* dyn, int ninst, uintptr_t addr, int pass); +void AddRelocTable64JmpTbl(dynarec_native_t* dyn, int ninst, uintptr_t addr, int pass); +void AddRelocCancelBlock(dynarec_native_t* dyn, int ninst, int pass); + +int ApplyRelocs(dynablock_t* block, intptr_t delta_block, intptr_t delta_map, uintptr_t mapping_start); +int RelocsHaveCancel(dynablock_t* block); +uintptr_t RelocGetNext(); + +#endif \ No newline at end of file diff --git a/src/dynarec/dynarec.c b/src/dynarec/dynarec.c index 1a389b9..ecfbcfe 100644 --- a/src/dynarec/dynarec.c +++ b/src/dynarec/dynarec.c @@ -1,13 +1,13 @@ #include #include #include -#include +#include "os.h" #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" +#include "box64cpu_util.h" #include "emu/x64emu_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -18,34 +18,46 @@ #include "dynablock.h" #include "dynablock_private.h" #include "bridge.h" +#include "alternate.h" #include "dynarec_next.h" #include "custommem.h" +#include "x64test.h" #endif #ifdef HAVE_TRACE #include "elfloader.h" #endif +extern int running32bits; #ifdef DYNAREC -uintptr_t getX64Address(dynablock_t* db, uintptr_t arm_addr); - void* LinkNext(x64emu_t* emu, uintptr_t addr, void* x2, uintptr_t* x3) { int is32bits = (R_CS == 0x23); + if(!running32bits && is32bits) running32bits=1; #ifdef HAVE_TRACE + uintptr_t new_addr = (uintptr_t)getAlternate((void*)addr); if(!addr) { dynablock_t* db = FindDynablockFromNativeAddress(x2-4); - printf_log(LOG_NONE, "Warning, jumping to NULL address from %p (db=%p, x64addr=%p/%s)\n", x2-4, db, db?(void*)getX64Address(db, (uintptr_t)x2-4):NULL, db?getAddrFunctionName(getX64Address(db, (uintptr_t)x2-4)):"(nil)"); - } else if(addr<0x10000) { + printf_log(LOG_INFO, "Warning, jumping to NULL address from %p (db=%p, x64addr=%p/%s)\n", x2-4, db, db?(void*)getX64Address(db, (uintptr_t)x2-4):NULL, db?getAddrFunctionName(getX64Address(db, (uintptr_t)x2-4)):"(nil)"); + } else if(new_addr<0x10000) { + dynablock_t* db = FindDynablockFromNativeAddress(x2-4); + printf_log(LOG_INFO, "Warning, jumping to low address %p->%p from %p (db=%p, x64addr=%p/%s)\n", (void*)new_addr, (void*)addr, x2-4, db, db?(void*)getX64Address(db, (uintptr_t)x2-4):NULL, db?getAddrFunctionName(getX64Address(db, (uintptr_t)x2-4)):"(nil)"); + #ifdef BOX32 + } else if(emu->segs[_CS]==0x23 && addr>0x100000000LL) { + dynablock_t* db = FindDynablockFromNativeAddress(x2-4); + printf_log(LOG_INFO, "Warning, jumping to high address %p from %p (db=%p, x64addr=%p/%s)\n", (void*)addr, x2-4, db, db?(void*)getX64Address(db, (uintptr_t)x2-4):NULL, db?getAddrFunctionName(getX64Address(db, (uintptr_t)x2-4)):"(nil)"); + #endif + } else if(!memExist(new_addr)) { dynablock_t* db = FindDynablockFromNativeAddress(x2-4); - printf_log(LOG_NONE, "Warning, jumping to low address %p from %p (db=%p, x64addr=%p/%s)\n", (void*)addr, x2-4, db, db?(void*)getX64Address(db, (uintptr_t)x2-4):NULL, db?getAddrFunctionName(getX64Address(db, (uintptr_t)x2-4)):"(nil)"); + printf_log(LOG_INFO, "Warning, jumping to an unmapped address %p->%p from %p (db=%p, x64addr=%p/%s)\n", (void*)new_addr, (void*)addr, x2-4, db, db?(void*)getX64Address(db, (uintptr_t)x2-4):NULL, db?getAddrFunctionName(getX64Address(db, (uintptr_t)x2-4)):"(nil)"); } + #else //HAVE_TRACE + uintptr_t new_addr = addr; #endif void * jblock; dynablock_t* block = NULL; + uintptr_t old_addr = addr; if(hasAlternate((void*)addr)) { - printf_log(LOG_DEBUG, "Jmp address has alternate: %p", (void*)addr); - if(box64_logdone) { // not finished yet... leave linker #ifdef HAVE_TRACE - if(box64_dynarec_log && !block->isize) { + if(BOX64ENV(dynarec_log) && !block->isize) { dynablock_t* db = FindDynablockFromNativeAddress(x2-4); printf_log(LOG_NONE, "Warning, NULL block at %p from %p (db=%p, x64addr=%p/%s)\n", (void*)addr, x2-4, db, db?(void*)getX64Address(db, (uintptr_t)x2-4):NULL, db?getAddrFunctionName(getX64Address(db, (uintptr_t)x2-4)):"(nil)"); } @@ -82,6 +94,17 @@ void* LinkNext(x64emu_t* emu, uintptr_t addr, void* x2, uintptr_t* x3) // null block, but done: go to epilog, no linker here return native_epilog; } + if(block->sep_size && (uintptr_t)block->x64_addr!=old_addr) { + jblock = NULL; + for(int i=0; isep_size && !jblock; ++i) { + if(old_addr==(uintptr_t)block->x64_addr + block->sep[i].x64_offs) + jblock = block->block + block->sep[i].nat_offs; + } + if(!jblock) { + printf_log(LOG_NONE, "Warning, cannot find Secondary Entry Point %p in dynablock %p\n", new_addr, block); + return native_epilog; + } + } //dynablock_t *father = block->father?block->father:block; return jblock; } @@ -95,25 +118,25 @@ void DynaCall(x64emu_t* emu, uintptr_t addr) uint64_t old_rsi = R_RSI; uint64_t old_rbp = R_RBP; uint64_t old_rip = R_RIP; + x64flags_t old_eflags = emu->eflags; // save defered flags deferred_flags_t old_df = emu->df; multiuint_t old_op1 = emu->op1; multiuint_t old_op2 = emu->op2; multiuint_t old_res = emu->res; - multiuint_t old_op1_sav= emu->op1_sav; - multiuint_t old_res_sav= emu->res_sav; - deferred_flags_t old_df_sav= emu->df_sav; - // uc_link - x64_ucontext_t* old_uc_link = emu->uc_link; - emu->uc_link = NULL; - PushExit(emu); + #ifdef BOX32 + if(box64_is32bits) + PushExit_32(emu); + else + #endif + PushExit(emu); R_RIP = addr; emu->df = d_none; - DynaRun(emu); + emu->flags.need_jmpbuf = 1; + EmuRun(emu, 1); emu->quit = 0; // reset Quit flags... emu->df = d_none; - emu->uc_link = old_uc_link; if(emu->flags.quitonlongjmp && emu->flags.longjmp) { if(emu->flags.quitonlongjmp==1) emu->flags.longjmp = 0; // don't change anything because of the longjmp @@ -123,10 +146,8 @@ void DynaCall(x64emu_t* emu, uintptr_t addr) emu->op1 = old_op1; emu->op2 = old_op2; emu->res = old_res; - emu->op1_sav = old_op1_sav; - emu->res_sav = old_res_sav; - emu->df_sav = old_df_sav; // and the old registers + emu->eflags = old_eflags; R_RBX = old_rbx; R_RDI = old_rdi; R_RSI = old_rsi; @@ -136,8 +157,7 @@ void DynaCall(x64emu_t* emu, uintptr_t addr) } } -int my_setcontext(x64emu_t* emu, void* ucp); -void DynaRun(x64emu_t* emu) +void EmuRun(x64emu_t* emu, int use_dynarec) { // prepare setjump for signal handling JUMPBUFF jmpbuf[1] = {0}; @@ -147,7 +167,7 @@ void DynaRun(x64emu_t* emu) uintptr_t old_savesp = emu->xSPSave; #endif emu->flags.jmpbuf_ready = 0; - + int is32bits = (emu->segs[_CS]==0x23); while(!(emu->quit)) { if(!emu->jmpbuf || (emu->flags.need_jmpbuf && emu->jmpbuf!=jmpbuf)) { emu->jmpbuf = jmpbuf; @@ -156,57 +176,87 @@ void DynaRun(x64emu_t* emu) #endif emu->flags.jmpbuf_ready = 1; #ifdef ANDROID - if((skip=sigsetjmp(*(JUMPBUFF*)emu->jmpbuf, 1))) + if ((skip = SigSetJmp(*(JUMPBUFF*)emu->jmpbuf, 1))) #else - if((skip=sigsetjmp(emu->jmpbuf, 1))) + if ((skip = SigSetJmp(emu->jmpbuf, 1))) #endif { - printf_log(LOG_DEBUG, "Setjmp DynaRun, fs=0x%x\n", emu->segs[_FS]); + dynarec_log(LOG_DEBUG, "Setjmp EmuRun, fs=0x%x will %sskip dynarec next\n", emu->segs[_FS], (skip==3)?"not ":""); #ifdef DYNAREC - if(box64_dynarec_test) { + if(BOX64ENV(dynarec_test)) { if(emu->test.clean) x64test_check(emu, R_RIP); emu->test.clean = 0; } #endif + if(skip==3) + skip = 0; } } if(emu->flags.need_jmpbuf) emu->flags.need_jmpbuf = 0; #ifdef DYNAREC - if(!box64_dynarec) + if(!BOX64ENV(dynarec) || !use_dynarec) #endif Run(emu, 0); #ifdef DYNAREC else { - int is32bits = (emu->segs[_CS]==0x23); - dynablock_t* block = (skip)?NULL:DBGetBlock(emu, R_RIP, 1, is32bits); + int newis32bits = (emu->segs[_CS]==0x23); + if(newis32bits!=is32bits) { + is32bits = newis32bits; + if(is32bits) { + // Zero upper part of the 32bits regs + R_RAX = R_EAX; + R_RBX = R_EBX; + R_RCX = R_ECX; + R_RDX = R_EDX; + R_RSP = R_ESP; + R_RBP = R_EBP; + R_RSI = R_ESI; + R_RDI = R_EDI; + running32bits = 1; + } + } + dynablock_t* block = (skip || ACCESS_FLAG(F_TF))?NULL:DBGetBlock(emu, R_RIP, 1, is32bits); if(!block || !block->block || !block->done || ACCESS_FLAG(F_TF)) { skip = 0; // no block, of block doesn't have DynaRec content (yet, temp is not null) // Use interpreter (should use single instruction step...) - dynarec_log(LOG_DEBUG, "%04d|Running Interpreter @%p, emu=%p\n", GetTID(), (void*)R_RIP, emu); - if(box64_dynarec_test) + if(BOX64ENV(dynarec_log)) { + if(ACCESS_FLAG(F_TF)) + dynarec_log(LOG_INFO, "%04d|Running Interpreter @%p, emu=%p because TF is on\n", GetTID(), (void*)R_RIP, emu); + else + dynarec_log(LOG_DEBUG, "%04d|Running Interpreter @%p, emu=%p\n", GetTID(), (void*)R_RIP, emu); + } + if (BOX64ENV(dynarec_test)) emu->test.clean = 0; Run(emu, 1); } else { dynarec_log(LOG_DEBUG, "%04d|Running DynaRec Block @%p (%p) of %d x64 insts (hash=0x%x) emu=%p\n", GetTID(), (void*)R_RIP, block->block, block->isize, block->hash, emu); + if(!BOX64ENV(dynarec_df)) { + CHECK_FLAGS(emu); + } // block is here, let's run it! - native_prolog(emu, block->block); - extern int running32bits; - if(emu->segs[_CS]==0x23) - running32bits = 1; + void* jblock = block->block; + if(block->sep_size && R_RIP!=(uintptr_t)block->x64_addr) { + jblock = NULL; + for(int i=0; isep_size && !jblock; ++i) { + if(R_RIP==(uintptr_t)block->x64_addr + block->sep[i].x64_offs) + jblock = block->block + block->sep[i].nat_offs; + } + } + if(!jblock) { + printf_log(LOG_NONE, "Warning, cannot find Secondary Entry Point %p in dynablock %p\n", (void*)R_RIP, block); + skip = 1; + } else + native_prolog(emu, jblock); } if(emu->fork) { int forktype = emu->fork; emu->quit = 0; emu->fork = 0; - emu = x64emu_fork(emu, forktype); - } - if(emu->quit && emu->uc_link) { - emu->quit = 0; - my_setcontext(emu, emu->uc_link); + emu = EmuFork(emu, forktype); } } #endif @@ -219,3 +269,8 @@ void DynaRun(x64emu_t* emu) emu->xSPSave = old_savesp; #endif } + +void DynaRun(x64emu_t *emu) +{ + EmuRun(emu, 1); +} diff --git a/src/dynarec/dynarec_arch.h b/src/dynarec/dynarec_arch.h index f89125a..10a6ac2 100644 --- a/src/dynarec/dynarec_arch.h +++ b/src/dynarec/dynarec_arch.h @@ -5,22 +5,45 @@ #define instruction_native_t instruction_arm64_t #define dynarec_native_t dynarec_arm_t +#define extcache_native_t neoncache_t #define ADDITIONNAL_DEFINITION() \ int fpuCacheNeedsTransform(dynarec_native_t* dyn, int ninst); -#define OTHER_CACHE() \ - if (fpuCacheNeedsTransform(dyn, ninst)) ret|=2; +#define OTHER_CACHE() \ + if (fpuCacheNeedsTransform(dyn, ninst)) ret|=2; \ + if (nativeFlagsNeedsTransform(dyn, ninst)) ret|=4; #include "arm64/arm64_printer.h" #include "arm64/dynarec_arm64_private.h" #include "arm64/dynarec_arm64_functions.h" -// Limit here is defined by LD litteral, that is 19bits -#define MAXBLOCK_SIZE ((1<<19)-200) +#include "arm64/dynarec_arm64_arch.h" +// TBZ/TBNZ is signed 14bits shifted by 2, but not use to jump from opcode to opcode +// Limit here is defined by LD litteral, that is 19bits signed ledt shifted by 2. So 20bits (positive/negative) address space (used for TABLE64) +// C.cond is also signed 19bits shifted by 2 +#define MAXBLOCK_SIZE ((1<<20)-200) + +#define RAZ_SPECIFIC(A, N) rasNativeState(A, N) +#define UPDATE_SPECIFICS(A) updateYmm0s(dyn, 0, 0); updateNativeFlags(A); propagateFpuBarrier(A) +#define PREUPDATE_SPECIFICS(A) +#define POSTUPDATE_SPECIFICS(A) updateUneeded(A) +#define ARCH_SIZE(A) get_size_arch(A) +#define ARCH_FILL(A, B, C) populate_arch(A, B, C) +#define ARCH_ADJUST(A, B, C, D) adjust_arch(A, B, C, D) +#define STOP_NATIVE_FLAGS(A, B) A->insts[B].nat_flags_op = NAT_FLAG_OP_UNUSABLE +#define ARCH_UNALIGNED(A, B) arch_unaligned(A, B) +extern uint32_t arm64_crc(void* p, uint32_t len); +#define ARCH_CRC(A, B) if(cpuext.crc32) return arm64_crc(A, B) +extern void* create_updateflags(); +#define ARCH_UPDATEFLAGS() create_updateflags() + +#define ARCH_NOP 0b11010101000000110010000000011111 +#define ARCH_UDF 0xcafe #elif defined(LA64) #define instruction_native_t instruction_la64_t #define dynarec_native_t dynarec_la64_t +#define extcache_native_t lsxcache_t #define ADDITIONNAL_DEFINITION() \ int fpuCacheNeedsTransform(dynarec_native_t* dyn, int ninst); @@ -33,24 +56,55 @@ #include "la64/dynarec_la64_functions.h" // Limit here is unconditionnal jump, that is signed 28bits #define MAXBLOCK_SIZE ((1 << 27) - 200) + +#define RAZ_SPECIFIC(A, N) +#define UPDATE_SPECIFICS(A) propagateFpuBarrier(A) +#define PREUPDATE_SPECIFICS(A) updateNativeFlags(A) +#define POSTUPDATE_SPECIFICS(A) + +#define ARCH_SIZE(A) 0 +#define ARCH_FILL(A, B, C) NULL +#define ARCH_ADJUST(A, B, C, D) {} +#define STOP_NATIVE_FLAGS(A, B) {} +#define ARCH_UNALIGNED(A, B) 0 +extern uint32_t la64_crc(void* p, uint32_t len); +#define ARCH_CRC(A, B) return la64_crc(A, B) + #elif defined(RV64) #define instruction_native_t instruction_rv64_t #define dynarec_native_t dynarec_rv64_t +#define extcache_native_t extcache_t -#define ADDITIONNAL_DEFINITION() \ - int fpuCacheNeedsTransform(dynarec_native_t* dyn, int ninst); +#define ADDITIONNAL_DEFINITION() \ + int fpuCacheNeedsTransform(dynarec_native_t* dyn, int ninst); \ + int sewNeedsTransform(dynarec_rv64_t* dyn, int ninst); -#define OTHER_CACHE() \ - if (fpuCacheNeedsTransform(dyn, ninst)) ret|=2; +#define OTHER_CACHE() \ + if (fpuCacheNeedsTransform(dyn, ninst)) ret |= 2; \ + if (sewNeedsTransform(dyn, ninst)) ret |= 4; #include "rv64/rv64_printer.h" #include "rv64/dynarec_rv64_private.h" #include "rv64/dynarec_rv64_functions.h" +#include "rv64/dynarec_rv64_arch.h" // Limit here is unconditionnal jump, that is signed 21bits #define MAXBLOCK_SIZE ((1<<20)-200) + +#define RAZ_SPECIFIC(A, N) +#define UPDATE_SPECIFICS(A) +#define PREUPDATE_SPECIFICS(A) updateNativeFlags(A) +#define POSTUPDATE_SPECIFICS(A) + +#define ARCH_SIZE(A) get_size_arch(A) +#define ARCH_FILL(A, B, C) populate_arch(A, B, C) +#define ARCH_ADJUST(A, B, C, D) {} +#define STOP_NATIVE_FLAGS(A, B) {} +#define ARCH_UNALIGNED(A, B) arch_unaligned(A, B) #else #error Unsupported platform #endif +#include "dynacache_reloc.h" + #endif //__DYNAREC_ARCH__H_ diff --git a/src/dynarec/dynarec_helper.h b/src/dynarec/dynarec_helper.h index c20c9d7..a017094 100644 --- a/src/dynarec/dynarec_helper.h +++ b/src/dynarec/dynarec_helper.h @@ -1,6 +1,208 @@ #ifndef __DYNAREC_HELPER__H_ #define __DYNAREC_HELPER__H_ +#include "env.h" +#include "pe_tools.h" +#include "debug.h" + +/* Box64 Strong Memory Model Emulation + * + * Definition of a SEQ: + * A SEQ is a sequence of opcodes that writes to guest memory, terminated by JMP, RET, CALL, etc. + * + * Memory barriers are added in the following cases to emulate the strong memory model: + * 1. End of a SEQ: + * - Scalar operations (a1) + * - SIMD operations (a2) + * 2. Start of a SEQ: + * - Scalar operations (b1) + * - SIMD operations (b2) + * 3. Right before the last guest memory store in a SEQ: + * - Scalar operations (c1) + * - SIMD operations (c2) + * 4. After every third guest memory store in a SEQ (d) + * + * STRONGMEM levels (coarse-grained): + * 1: Includes a1, b1, c1 + * 2: Includes LEVEL1, plus a2, b2, c2 + * 3: Includes LEVEL2, plus d + * + * WEAKBARRIER levels (fine-grained): + * 1: Use dmb.ishld and dmb.ishst over dmb.ish for more performance + * 2. All 1. Plus disabled the last write barriers (c1, c2) + */ + +#define STRONGMEM_SIMD_WRITE 2 // The level of SIMD memory writes will be tracked +#define STRONGMEM_LAST_WRITE 1 // The level of a barrier before the last guest memory store will be put +#define STRONGMEM_SEQ_WRITE 3 // The level of a barrier at every third memory store will be put + +#define STRONGMEM_LEVEL() ((box64_wine && VolatileRangesContains(ip)) ? 0 : BOX64DRENV(dynarec_strongmem)) + +#if STEP == 1 + +#define SMWRITE() \ + do { \ + /* Mark that current sequence writes to guest memory. */ \ + /* This will be used in SMEND for last_write. */ \ + dyn->smwrite = 1; \ + /* Mark that current opcode writes to guest memory. */ \ + dyn->insts[ninst].will_write = 1; \ + } while (0) + +#define SMWRITELOCK(lock) \ + do { \ + if(lock) dyn->insts[ninst].lock = 1;\ + SMWRITE(); \ + } while (0) + +#define SMWRITE2() \ + do { \ + if (STRONGMEM_LEVEL() >= STRONGMEM_SIMD_WRITE) { \ + dyn->smwrite = 1; \ + dyn->insts[ninst].will_write = 2; \ + } \ + } while (0) + +#define SMREAD() \ + do { \ + /* Mark that current opcode read from guest memory. */ \ + dyn->insts[ninst].will_read = 1; \ + } while (0) + +#define SMREADLOCK(lock) +#define WILLWRITE() +#define WILLWRITELOCK(lock) + +#define SMSTART() \ + do { \ + /* Clear current state at the start of a potential SEQ. */ \ + dyn->smwrite = 0; \ + } while (0) + +#define SMEND() \ + do { \ + /* If there is any guest memory write, which is a SEQ, then compute the last_write. */ \ + if (dyn->smwrite && (STRONGMEM_LEVEL() >= STRONGMEM_LAST_WRITE)) { \ + int i = ninst; \ + while (i >= 0 && !dyn->insts[i].will_write) \ + --i; \ + if (i >= 0) { dyn->insts[i].last_write = 1; } \ + } \ + dyn->smwrite = 0; \ + } while (0) + +#define SMDMB() + +#else + +// An opcode writes guest memory, this need to be put after the STORE instruction manually. It will also end the SEQ automaticaly on last_write immediatly +#define SMWRITE() \ + do { \ + if (dyn->insts[ninst].last_write) { \ + dyn->smwrite = 1; \ + SMEND(); \ + } else { \ + /* Put a barrier at every third memory write. */ \ + if (STRONGMEM_LEVEL() >= STRONGMEM_SEQ_WRITE) { \ + if (++dyn->smwrite >= 3 /* Every third memory write */) { \ + DMB_ISH(); \ + dyn->smwrite = 1; \ + } \ + } else { \ + /* Mark that current sequence writes to guest memory. */ \ + dyn->smwrite = 1; \ + } \ + } \ + } while (0) + +// Similar to SMWRITE, but checks lock. +#define SMWRITELOCK(lock) \ + do { \ + if (lock) { \ + DMB_ISH(); \ + } else { \ + SMWRITE(); \ + } \ + } while (0) + +// Similar to SMWRITE, but for SIMD instructions. +#define SMWRITE2() \ + do { \ + if (STRONGMEM_LEVEL() >= STRONGMEM_SIMD_WRITE) \ + SMWRITE(); \ + } while (0) + +// An opcode reads guest memory, this need to be put before the LOAD instruction manually. +#define SMREAD() + +// Similar to SMREAD, but checks lock. +#define SMREADLOCK(lock) \ + do { \ + if (lock) { \ + DMB_ISH(); \ + } else { \ + SMREAD(); \ + } \ + } while (0) + +// An opcode will write memory, this will be put before the STORE instruction automatically. +#define WILLWRITE() \ + do { \ + if (STRONGMEM_LEVEL() >= dyn->insts[ninst].will_write && dyn->smwrite == 0) { \ + /* Will write but never written, this is the start of a SEQ, put a barrier. */ \ + if (BOX64ENV(dynarec_weakbarrier)) \ + DMB_ISHLD(); \ + else \ + DMB_ISH(); \ + } else if (STRONGMEM_LEVEL() >= STRONGMEM_LAST_WRITE && BOX64ENV(dynarec_weakbarrier) != 2 \ + && dyn->insts[ninst].last_write) { \ + /* Last write, put a barrier */ \ + if (BOX64ENV(dynarec_weakbarrier)) \ + DMB_ISHST(); \ + else \ + DMB_ISH(); \ + } \ + } while (0) + +// Similar to WILLWRITE, but checks lock. +#define WILLWRITELOCK(lock) \ + do { \ + if (lock) { \ + DMB_ISH(); \ + } else { \ + WILLWRITE(); \ + } \ + } while (0) + +// Used to clear the state at the start of a SEQ +#define SMSTART() \ + do { \ + dyn->smwrite = 0; \ + } while (0) + +// Will be put at the end of the SEQ +#define SMEND() \ + do { \ + if (STRONGMEM_LEVEL()) { \ + /* It's a SEQ, put a barrier here. */ \ + if (dyn->smwrite) { \ + /* Check if the next instruction has a end loop mark */ \ + if (BOX64ENV(dynarec_weakbarrier)) \ + DMB_ISHST(); \ + else \ + DMB_ISH(); \ + } \ + } \ + dyn->smwrite = 0; \ + } while (0) + +// The barrier. +#define SMDMB() DMB_ISH() +#endif + +int is_addr_unaligned(uintptr_t addr); +int is_addr_autosmc(uintptr_t addr); + #ifdef ARM64 #include "arm64/dynarec_arm64_helper.h" #elif defined(LA64) @@ -11,4 +213,4 @@ #error Unsupported architecture #endif -#endif //__DYNAREC_HELPER__H_ \ No newline at end of file +#endif //__DYNAREC_HELPER__H_ diff --git a/src/dynarec/dynarec_native.c b/src/dynarec/dynarec_native.c index a233c69..84b0ed9 100644 --- a/src/dynarec/dynarec_native.c +++ b/src/dynarec/dynarec_native.c @@ -1,15 +1,16 @@ +#include #include #include #include #include #include +#include "os.h" #include "debug.h" #include "box64context.h" #include "custommem.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -17,48 +18,51 @@ #include "x64trace.h" #include "dynablock.h" #include "dynablock_private.h" -#include "elfloader.h" #include "dynarec_native.h" #include "dynarec_arch.h" #include "dynarec_next.h" +#include "gdbjit.h" +#include "khash.h" -void printf_x64_instruction(zydis_dec_t* dec, instruction_x64_t* inst, const char* name) { +KHASH_MAP_INIT_INT64(table64, uint32_t) + +void printf_x64_instruction(dynarec_native_t* dyn, zydis_dec_t* dec, instruction_x64_t* inst, const char* name) { uint8_t *ip = (uint8_t*)inst->addr; - if(ip[0]==0xcc && ip[1]=='S' && ip[2]=='C') { + if (ip[0] == 0xcc && IsBridgeSignature(ip[1], ip[2])) { uintptr_t a = *(uintptr_t*)(ip+3); if(a==0) { - dynarec_log(LOG_NONE, "%s%p: Exit x64emu%s\n", (box64_dynarec_dump>1)?"\e[01;33m":"", (void*)ip, (box64_dynarec_dump>1)?"\e[m":""); + dynarec_log(LOG_NONE, "%s%p: Exit x64emu%s\n", (dyn->need_dump>1)?"\e[01;33m":"", (void*)ip, (dyn->need_dump>1)?"\e[m":""); } else { - dynarec_log(LOG_NONE, "%s%p: Native call to %p%s\n", (box64_dynarec_dump>1)?"\e[01;33m":"", (void*)ip, (void*)a, (box64_dynarec_dump>1)?"\e[m":""); + dynarec_log(LOG_NONE, "%s%p: Native call to %p%s\n", (dyn->need_dump>1)?"\e[01;33m":"", (void*)ip, (void*)a, (dyn->need_dump>1)?"\e[m":""); } } else { if(dec) { - dynarec_log(LOG_NONE, "%s%p: %s", (box64_dynarec_dump>1)?"\e[01;33m":"", ip, DecodeX64Trace(dec, inst->addr)); + dynarec_log(LOG_NONE, "%s%p: %s", (dyn->need_dump > 1) ? "\e[01;33m" : "", ip, DecodeX64Trace(dec, inst->addr, 1)); } else { - dynarec_log(LOG_NONE, "%s%p: ", (box64_dynarec_dump>1)?"\e[01;33m":"", ip); + dynarec_log(LOG_NONE, "%s%p: ", (dyn->need_dump>1)?"\e[01;33m":"", ip); for(int i=0; isize; ++i) { - dynarec_log(LOG_NONE, "%02X ", ip[i]); + dynarec_log_prefix(0, LOG_NONE, "%02X ", ip[i]); } - dynarec_log(LOG_NONE, " %s", name); + dynarec_log_prefix(0, LOG_NONE, " %s", name); } // print Call function name if possible if(ip[0]==0xE8 || ip[0]==0xE9) { // Call / Jmp uintptr_t nextaddr = (uintptr_t)ip + 5 + *((int32_t*)(ip+1)); - printFunctionAddr(nextaddr, "=> "); + PrintFunctionAddr(nextaddr, "=> "); } else if(ip[0]==0xFF) { if(ip[1]==0x25) { uintptr_t nextaddr = (uintptr_t)ip + 6 + *((int32_t*)(ip+2)); - printFunctionAddr(nextaddr, "=> "); + PrintFunctionAddr(nextaddr, "=> "); } } // end of line and colors - dynarec_log(LOG_NONE, "%s\n", (box64_dynarec_dump>1)?"\e[m":""); + dynarec_log_prefix(0, LOG_NONE, "%s\n", (dyn->need_dump>1)?"\e[m":""); } } void add_next(dynarec_native_t *dyn, uintptr_t addr) { - if(!box64_dynarec_bigblock) + if (!BOX64DRENV(dynarec_bigblock)) return; // exist? for(int i=0; inext_sz; ++i) @@ -121,6 +125,8 @@ int is_nops(dynarec_native_t *dyn, uintptr_t addr, int n) return is_nops(dyn, addr+1, n-1); if(n>1 && PK(0)==0x66) // if opcode start with 0x66, and there is more after, than is *can* be a NOP return is_nops(dyn, addr+1, n-1); + if(n>1 && PK(0)==0xF3 && PK(1)==0x90) + return is_nops(dyn, addr+2, n-2); if(n>2 && PK(0)==0x0f && PK(1)==0x1f && PK(2)==0x00) return is_nops(dyn, addr+3, n-3); if(n>2 && PK(0)==0x8d && PK(1)==0x76 && PK(2)==0x00) // lea esi, [esi] @@ -141,123 +147,8 @@ int is_nops(dynarec_native_t *dyn, uintptr_t addr, int n) return is_nops(dyn, addr+8, n-8); return 0; } - -// return size of next instruction, -1 is unknown -// not all instructions are setup -int next_instruction(dynarec_native_t *dyn, uintptr_t addr) -{ - uint8_t opcode = PK(0); - uint8_t nextop; - switch (opcode) { - case 0x66: - opcode = PK(1); - switch(opcode) { - case 0x90: - return 2; - } - break; - case 0x81: - nextop = PK(1); - return fakeed(dyn, addr+2, 0, nextop)-addr + 4; - case 0x83: - nextop = PK(1); - return fakeed(dyn, addr+2, 0, nextop)-addr + 1; - case 0x84: - case 0x85: - case 0x88: - case 0x89: - case 0x8A: - case 0x8B: - case 0x8C: - case 0x8D: - case 0x8E: - case 0x8F: - nextop = PK(1); - return fakeed(dyn, addr+2, 0, nextop)-addr; - case 0x50: - case 0x51: - case 0x52: - case 0x53: - case 0x54: - case 0x55: - case 0x56: - case 0x57: - case 0x58: - case 0x59: - case 0x5A: - case 0x5B: - case 0x5C: - case 0x5D: - case 0x5E: - case 0x5F: - case 0x90: - case 0x91: - case 0x92: - case 0x93: - case 0x94: - case 0x95: - case 0x96: - case 0x97: - case 0x98: - case 0x99: - case 0x9B: - case 0x9C: - case 0x9D: - case 0x9E: - case 0x9F: - return 1; - case 0xA0: - case 0xA1: - case 0xA2: - case 0xA3: - return 5; - case 0xB0: - case 0xB1: - case 0xB2: - case 0xB3: - case 0xB4: - case 0xB5: - case 0xB6: - case 0xB7: - return 2; - case 0xB8: - case 0xB9: - case 0xBA: - case 0xBB: - case 0xBC: - case 0xBD: - case 0xBE: - case 0xBF: - return 5; - case 0xFF: - nextop = PK(1); - switch((nextop>>3)&7) { - case 0: // INC Ed - case 1: //DEC Ed - case 2: // CALL Ed - case 4: // JMP Ed - case 6: // Push Ed - return fakeed(dyn, addr+2, 0, nextop)-addr; - } - break; - default: - break; - } - return -1; -} #undef PK -int is_instructions(dynarec_native_t *dyn, uintptr_t addr, int n) -{ - int i = 0; - while(i15) - insts[*size].x64 = 15; + insts[*size].x64 = 15; else insts[*size].x64 = x64_size; x64_size -= insts[*size].x64; @@ -282,27 +173,51 @@ void addInst(instsize_t* insts, size_t* size, int x64_size, int native_size) } } +static kh_table64_t* khtable64 = NULL; + +int isTable64(dynarec_native_t *dyn, uint64_t val) +{ + if(!khtable64) + return 0; + if(kh_get(table64, khtable64, val)==kh_end(khtable64)) + return 0; + return 1; +} // add a value to table64 (if needed) and gives back the imm19 to use in LDR_literal int Table64(dynarec_native_t *dyn, uint64_t val, int pass) { + if(!khtable64) + khtable64 = kh_init(table64); // find the value if already present - int idx = -1; - for(int i=0; itable64size && (idx==-1); ++i) - if(dyn->table64[i] == val) - idx = i; - // not found, add it - if(idx==-1) { + khint_t k = kh_get(table64, khtable64, val); + uint32_t idx = 0; + if(k!=kh_end(khtable64)) { + idx = kh_value(khtable64, k); + } else { idx = dyn->table64size++; - if(idx < dyn->table64cap) - dyn->table64[idx] = val; - else if(pass==3) - printf_log(LOG_NONE, "Warning, table64 bigger than expected %d vs %d\n", idx, dyn->table64cap); + if(pass==3) { + if(idx < dyn->table64cap) + dyn->table64[idx] = val; + else + printf_log(LOG_NONE, "Warning, table64 bigger than expected %d vs %d\n", idx, dyn->table64cap); + } + int ret; + k = kh_put(table64, khtable64, val, &ret); + kh_value(khtable64, k) = idx; } // calculate offset int delta = dyn->tablestart + idx*sizeof(uint64_t) - (uintptr_t)dyn->block; return delta; } +void ResetTable64(dynarec_native_t* dyn) +{ + dyn->table64size = 0; + if(khtable64) { + kh_clear(table64, khtable64); + } +} + static void recurse_mark_alive(dynarec_native_t* dyn, int i) { if(dyn->insts[i].x64.alive) @@ -314,9 +229,8 @@ static void recurse_mark_alive(dynarec_native_t* dyn, int i) recurse_mark_alive(dyn, i+1); } -static int sizePredecessors(dynarec_native_t* dyn) +static void sizePredecessors(dynarec_native_t* dyn) { - int pred_sz = 1; // to be safe // compute total size of predecessor to allocate the array // mark alive... recurse_mark_alive(dyn, 0); @@ -324,7 +238,6 @@ static int sizePredecessors(dynarec_native_t* dyn) int jmpto; for(int i=0; isize; ++i) { if(dyn->insts[i].x64.alive && dyn->insts[i].x64.jmp && ((jmpto=dyn->insts[i].x64.jmp_insts)!=-1)) { - pred_sz++; dyn->insts[jmpto].pred_sz++; } } @@ -336,11 +249,9 @@ static int sizePredecessors(dynarec_native_t* dyn) // second the "has_next" for(int i=0; isize-1; ++i) { if(dyn->insts[i].x64.has_next) { - pred_sz++; dyn->insts[i+1].pred_sz++; } } - return pred_sz; } static void fillPredecessors(dynarec_native_t* dyn) { @@ -367,9 +278,10 @@ static int updateNeed(dynarec_native_t* dyn, int ninst, uint8_t need) { while (ninst>=0) { // need pending but instruction is only a subset: remove pend and use an X_ALL instead need |= dyn->insts[ninst].x64.need_after; - if((need&X_PEND) && (dyn->insts[ninst].x64.state_flags==SF_SUBSET || dyn->insts[ninst].x64.state_flags==SF_SET || dyn->insts[ninst].x64.state_flags==SF_SET_NODF)) { + if((need&X_PEND) && ((dyn->insts[ninst].x64.state_flags==SF_SUBSET) || (dyn->insts[ninst].x64.state_flags==SF_SET) || (dyn->insts[ninst].x64.state_flags==SF_SET_NODF))) { need &=~X_PEND; need |= X_ALL; + STOP_NATIVE_FLAGS(dyn, ninst); } if((need&X_PEND) && dyn->insts[ninst].x64.state_flags==SF_SUBSET_PENDING) { need |= X_ALL&~(dyn->insts[ninst].x64.set_flags); @@ -405,90 +317,47 @@ static int updateNeed(dynarec_native_t* dyn, int ninst, uint8_t need) { return ninst; } -static void updateYmm0s(dynarec_native_t* dyn, int ninst, int max_ninst_reached) { - int can_incr = ninst == max_ninst_reached; // Are we the top-level call? - int ok = 1; - while ((can_incr || ok) && ninstsize) { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "update ninst=%d (%d): can_incr=%d\n", ninst, max_ninst_reached, can_incr); - uint16_t new_purge_ymm, new_ymm0_in, new_ymm0_out; - - if (ninst && dyn->insts[ninst].pred_sz && dyn->insts[ninst].x64.alive) { - uint16_t ymm0_union = 0, ymm0_inter = (uint16_t)-1; // The union of the empty set is empty, the intersection is the universe - for (int i = 0; i < dyn->insts[ninst].pred_sz; ++i) { - int pred = dyn->insts[ninst].pred[i]; - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "\twith pred[%d] = %d", i, pred); - if (pred >= max_ninst_reached) { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, " (skipped)\n"); - continue; - } - - int pred_out = dyn->insts[pred].x64.has_callret ? 0 : dyn->insts[pred].ymm0_out; - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, " ~> %04X\n", pred_out); - ymm0_union |= pred_out; - ymm0_inter &= pred_out; - } - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "\t=> %04X,%04X\n", ymm0_union, ymm0_inter); - // Notice the default values yield something coherent here (if all pred are after ninst) - new_purge_ymm = ymm0_union & ~ymm0_inter; - new_ymm0_in = ymm0_inter; - new_ymm0_out = (ymm0_inter | dyn->insts[ninst].ymm0_add) & ~dyn->insts[ninst].ymm0_sub; - - if ((dyn->insts[ninst].purge_ymm != new_purge_ymm) || (dyn->insts[ninst].ymm0_in != new_ymm0_in) || (dyn->insts[ninst].ymm0_out != new_ymm0_out)) { - // Need to update self and next(s) - dyn->insts[ninst].purge_ymm = new_purge_ymm; - dyn->insts[ninst].ymm0_in = new_ymm0_in; - dyn->insts[ninst].ymm0_out = new_ymm0_out; - - if (can_incr) { - // We always have ninst == max_ninst_reached when can_incr == 1 - ++max_ninst_reached; - } else { - // We need to stop here if the opcode has no "real" next or if we reached the ninst of the toplevel - ok = (max_ninst_reached - 1 != ninst) && dyn->insts[ninst].x64.has_next && !dyn->insts[ninst].x64.has_callret; - } - - int jmp = (dyn->insts[ninst].x64.jmp)?dyn->insts[ninst].x64.jmp_insts:-1; - if((jmp!=-1) && (jmp < max_ninst_reached)) { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "\t! jump to %d\n", jmp); - // The jump goes before the last instruction reached, update the destination - // If this is the top level call, this means the jump goes backward (jmp != ninst) - // Otherwise, since we don't update all instructions, we may miss the update (don't use jmp < ninst) - updateYmm0s(dyn, jmp, max_ninst_reached); - } - } else { - if (can_incr) { - // We always have ninst == max_ninst_reached when can_incr == 1 - ++max_ninst_reached; - - // Also update jumps to before (they are skipped otherwise) - int jmp = (dyn->insts[ninst].x64.jmp)?dyn->insts[ninst].x64.jmp_insts:-1; - if((jmp!=-1) && (jmp < max_ninst_reached)) { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "\t! jump to %d\n", jmp); - updateYmm0s(dyn, jmp, max_ninst_reached); - } - } else { - // We didn't update anything, we can leave - ok = 0; - } - } - } else if (can_incr) { - // We always have ninst == max_ninst_reached when can_incr == 1 - ++max_ninst_reached; - } else { - // We didn't update anything, we can leave - ok = 0; - } - ++ninst; - } -} - void* current_helper = NULL; static int static_jmps[MAX_INSTS+2]; static uintptr_t static_next[MAX_INSTS+2]; -static uint64_t static_table64[(MAX_INSTS+3)/4]; static instruction_native_t static_insts[MAX_INSTS+2] = {0}; +static callret_t static_callrets[MAX_INSTS+2] = {0}; +static int static_preds[MAX_INSTS*2+2]; // for the worst case scenario were all instructions are conditional jumps +void* redundant_helper = NULL; // TODO: ninst could be a uint16_t instead of an int, that could same some temp. memory +void ClearCache(void* start, size_t len) +{ +#if defined(ARM64) + // manually clear cache, I have issue with regular function on Ampere with kernel 6.12.4 + uintptr_t xstart = (uintptr_t)start; + uintptr_t xend = (uintptr_t)start + len + 1; + // Cache Type Info. Only grab the info once + static uint64_t ctr_el0 = 0; + if (ctr_el0 == 0) + __asm __volatile("mrs %0, ctr_el0" : "=r"(ctr_el0)); + const int ctr_el0_idc = (ctr_el0>>28)&1; // 0: datacache needs to be cleaned too, 1: no need + const int ctr_el0_dic = (ctr_el0>>29)&1; // 0: instruction cache needs to be cleaned, 1: no need + const uintptr_t dcache_line_size = 4 << ((ctr_el0 >> 16) & 15); + const uintptr_t icache_line_size = 4 << ((ctr_el0 >> 0) & 15); + if (!ctr_el0_idc) { + //purge each dcache line if no icache is defined... + for (uint64_t addr=xstart&~(dcache_line_size-1); addrmutex_dyndump); } -uintptr_t native_pass0(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits); -uintptr_t native_pass1(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits); -uintptr_t native_pass2(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits); -uintptr_t native_pass3(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits); +uintptr_t native_pass0(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits, int inst_max); +uintptr_t native_pass1(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits, int inst_max); +uintptr_t native_pass2(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits, int inst_max); +uintptr_t native_pass3(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits, int inst_max); -void* CreateEmptyBlock(dynablock_t* block, uintptr_t addr) { - block->isize = 0; - block->done = 0; - size_t sz = 4*sizeof(void*); - void* actual_p = (void*)AllocDynarecMap(sz); +dynablock_t* CreateEmptyBlock(uintptr_t addr, int is32bits, int is_new) { + size_t sz = 4*sizeof(void*) + sizeof(dynablock_t); + void* actual_p = (void*)AllocDynarecMap(addr, sz, is_new); void* p = actual_p + sizeof(void*); if(actual_p==NULL) { - dynarec_log(LOG_INFO, "AllocDynarecMap(%p, %zu) failed, canceling block\n", block, sz); + dynarec_log(LOG_INFO, "AllocDynarecMap(%p, %zu) failed, canceling block\n", (void*)addr, sz); CancelBlock64(0); return NULL; } + dynablock_t* block = (dynablock_t*)(actual_p+4*sizeof(void*)); + memset(block, 0, sizeof(dynablock_t)); + // fill the block + block->x64_addr = (void*)addr; + block->isize = 0; + block->done = 0; block->size = sz; block->actual_block = actual_p; block->block = p; block->jmpnext = p; + block->is32bits = is32bits; *(dynablock_t**)actual_p = block; *(void**)(p+2*sizeof(void*)) = native_epilog; CreateJmpNext(block->jmpnext, p+2*sizeof(void*)); // all done... - __clear_cache(actual_p, actual_p+sz); // need to clear the cache before execution... + ClearCache(actual_p+sizeof(void*), 3*sizeof(void*)); // need to clear the cache before execution... return block; } -void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bits) { +dynablock_t* FillBlock64(uintptr_t addr, int alternate, int is32bits, int inst_max, int is_new) { /* A Block must have this layout: @@ -545,22 +420,35 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bit B+16 .. B+23 : jmpnext (or jmp_epilog) address. jumpnext is used when the block needs testing B+24 .. B+31 : empty (in case an architecture needs more than 2 opcodes) B+32 .. B+32+sz : instsize (compressed array with each instruction length on x64 and native side) + C .. C+sz : arch: arch specific info (likes flags info) per inst (can be absent) */ - if(addr>=box64_nodynarec_start && addr=BOX64ENV(nodynarec_start) && addrstart, ((dynarec_native_t*)current_helper)->dynablock); + return NULL; + } + dynarec_log(LOG_INFO, "Warning: some static area curruption appeared (current=%p, redundant=%p)\n", current_helper, redundant_helper); + } // protect the 1st page protectDB(addr, 1); // init the helper dynarec_native_t helper = {0}; - current_helper = &helper; - helper.dynablock = block; + dynarec_native_t* dyn = &helper; +#ifdef GDBJIT + helper.gdbjit_block = box_calloc(1, sizeof(gdbjit_block_t)); +#endif + redundant_helper = current_helper = &helper; + helper.dynablock = NULL; helper.start = addr; uintptr_t start = addr; helper.cap = MAX_INSTS; @@ -569,29 +457,45 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bit helper.jmp_cap = MAX_INSTS; helper.next = static_next; helper.next_cap = MAX_INSTS; - helper.table64 = static_table64; - helper.table64cap = sizeof(static_table64)/sizeof(uint64_t); + helper.table64 = NULL; + helper.env = GetCurEnvByAddr(addr); + ResetTable64(&helper); + helper.table64cap = 0; + helper.end = addr + SizeFileMapped(addr); + if(helper.end == helper.start) // that means there is no mmap with a file associated to the memory + helper.end = (uintptr_t)~0LL; + helper.need_reloc = IsAddrNeedReloc(addr); // pass 0, addresses, x64 jump addresses, overall size of the block - uintptr_t end = native_pass0(&helper, addr, alternate, is32bits); + uintptr_t end = native_pass0(&helper, addr, alternate, is32bits, inst_max); if(helper.abort) { - if(box64_dynarec_dump || box64_dynarec_log)dynarec_log(LOG_NONE, "Abort dynablock on pass0\n"); - CancelBlock64(0); - return NULL; + if(helper.size<2) { + if(dyn->need_dump || BOX64ENV(dynarec_log))dynarec_log(LOG_NONE, "Abort dynablock on pass0\n"); + CancelBlock64(0); + // return an Empty block to not try again, pass0 abort are definitive + return CreateEmptyBlock(addr, is32bits, is_new); + } + if(dyn->need_dump || BOX64ENV(dynarec_log))dynarec_log(LOG_NONE, "Dynablock shorten on pass0 at ninst=%d\n", helper.size); + --helper.size; + helper.abort = 0; + } + if(BOX64ENV(dynarec_x87double)==2) { + helper.need_x87check = 1; } // basic checks if(!helper.size) { dynarec_log(LOG_INFO, "Warning, null-sized dynarec block (%p)\n", (void*)addr); CancelBlock64(0); - return CreateEmptyBlock(block, addr); + return CreateEmptyBlock(addr, is32bits, is_new); } - if(!isprotectedDB(addr, 1)) { + if(!is_inhotpage && !isprotectedDB(addr, 1)) { dynarec_log(LOG_INFO, "Warning, write on current page on pass0, aborting dynablock creation (%p)\n", (void*)addr); CancelBlock64(0); return NULL; } // protect the block of it goes over the 1st page - if((addr&~(box64_pagesize-1))!=(end&~(box64_pagesize-1))) // need to protect some other pages too - protectDB(addr, end-addr); //end is 1byte after actual end + if(!is_inhotpage) + if((addr&~(box64_pagesize-1))!=(end&~(box64_pagesize-1))) // need to protect some other pages too + protectDB(addr, end-addr); //end is 1byte after actual end // compute hash signature uint32_t hash = X31_hash_code((void*)addr, end-addr); // calculate barriers @@ -599,10 +503,17 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bit int i = helper.jmps[ii]; uintptr_t j = helper.insts[i].x64.jmp; helper.insts[i].x64.jmp_insts = -1; - if(j=end || j==helper.insts[i].x64.addr) { - if(j==helper.insts[i].x64.addr) // if there is a loop on some opcode, make the block "always to tested" - helper.always_test = 1; + #ifndef ARCH_NOP + if(j=end || j==helper.insts[i].x64.addr) + #else + if(j=end) + #endif + { helper.insts[i].x64.need_after |= X_PEND; + if(helper.insts[i].barrier_maybe) { + helper.insts[i].x64.barrier|=BARRIER_FLOAT; + helper.insts[i].barrier_maybe = 0; + } } else { // find jump address instruction int k=-1; @@ -635,21 +546,34 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bit k=i2; }*/ if(k!=-1) { - if(!helper.insts[i].barrier_maybe) - helper.insts[k].x64.barrier |= BARRIER_FULL; + // special case, loop on itself with some nop in between + if(k=0) pos = updateNeed(&helper, pos, 0); // remove fpu stuff on non-executed code @@ -658,7 +582,7 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bit int ii = i; while(iineed_dump || BOX64ENV(dynarec_log))dynarec_log(LOG_NONE, "Abort dynablock on pass1\n"); CancelBlock64(0); return NULL; } - + if(BOX64ENV(dynarec_x87double)==2) { + if(helper.need_x87check==1) + helper.need_x87check = 0; + } + POSTUPDATE_SPECIFICS(&helper); + ResetTable64(&helper); + helper.reloc_size = 0; // pass 2, instruction size - native_pass2(&helper, addr, alternate, is32bits); + helper.callrets = static_callrets; + native_pass2(&helper, addr, alternate, is32bits, inst_max); if(helper.abort) { - if(box64_dynarec_dump || box64_dynarec_log)dynarec_log(LOG_NONE, "Abort dynablock on pass2\n"); + if(dyn->need_dump || BOX64ENV(dynarec_log))dynarec_log(LOG_NONE, "Abort dynablock on pass2\n"); CancelBlock64(0); return NULL; } // keep size of instructions for signal handling + size_t native_size = (helper.native_size+7)&~7; // round the size... + // check if size is overlimit + if((inst_max==MAX_INSTS) && (native_size>MAXBLOCK_SIZE)) { + int imax = 0; + size_t max_size = 0; + while((max_sizeneed_dump || BOX64ENV(dynarec_log))dynarec_log(LOG_NONE, "Dynablock oversized, with %zu (max=%zd), recomputing cutting at %d from %d\n", native_size, MAXBLOCK_SIZE, imax, helper.size); + CancelBlock64(0); + return FillBlock64(addr, alternate, is32bits, imax, is_new); + } size_t insts_rsize = (helper.insts_size+2)*sizeof(instsize_t); insts_rsize = (insts_rsize+7)&~7; // round the size... - size_t native_size = (helper.native_size+7)&~7; // round the size... + size_t arch_size = ARCH_SIZE(&helper); + size_t callret_size = helper.callret_size*sizeof(callret_t); + size_t sep_size = helper.sep_size*sizeof(sep_t); + size_t reloc_size = helper.reloc_size*sizeof(uint32_t); // ok, now allocate mapped memory, with executable flag on - size_t sz = sizeof(void*) + native_size + helper.table64size*sizeof(uint64_t) + 4*sizeof(void*) + insts_rsize; - // dynablock_t* block (arm insts) table64 jmpnext code instsize - void* actual_p = (void*)AllocDynarecMap(sz); - void* p = (void*)(((uintptr_t)actual_p) + sizeof(void*)); - void* tablestart = p + native_size; - void* next = tablestart + helper.table64size*sizeof(uint64_t); - void* instsize = next + 4*sizeof(void*); + size_t sz = sizeof(void*) + native_size + helper.table64size*sizeof(uint64_t) + 4*sizeof(void*) + insts_rsize + arch_size + callret_size + sep_size; + size_t dynablock_align = (sz&7)?(8 -(sz&7)):0; // align dynablock + sz += dynablock_align + sizeof(dynablock_t) + reloc_size; + // dynablock_t* block (arm insts) table64 jmpnext code instsize arch callrets sep dynablock relocs + void* actual_p = (void*)AllocDynarecMap(addr, sz, is_new); if(actual_p==NULL) { - dynarec_log(LOG_INFO, "AllocDynarecMap(%p, %zu) failed, canceling block\n", block, sz); + dynarec_log(LOG_INFO, "AllocDynarecMap(%p, %zu) failed, canceling block\n", (void*)addr, sz); CancelBlock64(0); return NULL; } + void* p = (void*)(((uintptr_t)actual_p) + sizeof(void*)); + void* tablestart = p + native_size; + void* next = tablestart + helper.table64size*sizeof(uint64_t); + void* instsize = next + 4*sizeof(void*); + void* arch = instsize + insts_rsize; + void* callrets = arch + arch_size; + void* seps = callrets + callret_size; helper.block = p; + dynablock_t* block = (dynablock_t*)(seps+sep_size+dynablock_align); + memset(block, 0, sizeof(dynablock_t)); + void* relocs = helper.need_reloc?(block+1):NULL; + // fill the block + block->x64_addr = (void*)addr; + block->isize = 0; block->actual_block = actual_p; + helper.relocs = relocs; + block->relocs = relocs; + block->table64size = helper.table64size; helper.native_start = (uintptr_t)p; helper.tablestart = (uintptr_t)tablestart; helper.jmp_next = (uintptr_t)next+sizeof(void*); @@ -718,22 +695,34 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bit *(dynablock_t**)actual_p = block; helper.table64cap = helper.table64size; helper.table64 = (uint64_t*)helper.tablestart; + helper.callrets = (callret_t*)callrets; + helper.sep = (sep_t*)seps; + block->prefixsize = helper.prefixsize; + block->table64 = helper.table64; + if(callret_size) + memcpy(helper.callrets, static_callrets, helper.callret_size*sizeof(callret_t)); + helper.callret_size = 0; + helper.sep_size = 0; // pass 3, emit (log emit native opcode) - if(box64_dynarec_dump) { - dynarec_log(LOG_NONE, "%s%04d|Emitting %zu bytes for %u %s bytes", (box64_dynarec_dump>1)?"\e[01;36m":"", GetTID(), helper.native_size, helper.isize, is32bits?"x86":"x64"); - printFunctionAddr(helper.start, " => "); - dynarec_log(LOG_NONE, "%s\n", (box64_dynarec_dump>1)?"\e[m":""); + if(dyn->need_dump) { + dynarec_log(LOG_NONE, "%s%04d|Emitting %zu bytes for %u %s bytes (native=%zu, table64=%zu, instsize=%zu, arch=%zu, callrets=%zu, entry=%p)", (dyn->need_dump>1)?"\e[01;36m":"", GetTID(), helper.native_size, helper.isize, is32bits?"x86":"x64", native_size, helper.table64size*sizeof(uint64_t), insts_rsize, arch_size, callret_size, helper.block); + PrintFunctionAddr(helper.start, " => "); + dynarec_log_prefix(0, LOG_NONE, "%s\n", (dyn->need_dump>1)?"\e[m":""); + } + if (BOX64ENV(dynarec_gdbjit) && (!BOX64ENV(dynarec_gdbjit_end) || (addr >= BOX64ENV(dynarec_gdbjit_start) && addr < BOX64ENV(dynarec_gdbjit_end)))) { + GdbJITNewBlock(helper.gdbjit_block, (GDB_CORE_ADDR)block->actual_block, (GDB_CORE_ADDR)block->actual_block + native_size, helper.start); } int oldtable64size = helper.table64size; size_t oldnativesize = helper.native_size; size_t oldinstsize = helper.insts_size; int oldsize= helper.size; helper.native_size = 0; - helper.table64size = 0; // reset table64 (but not the cap) + ResetTable64(&helper); // reset table64 (but not the cap) helper.insts_size = 0; // reset - native_pass3(&helper, addr, alternate, is32bits); + helper.reloc_size = 0; + native_pass3(&helper, addr, alternate, is32bits, inst_max); if(helper.abort) { - if(box64_dynarec_dump || box64_dynarec_log)dynarec_log(LOG_NONE, "Abort dynablock on pass1\n"); + if(dyn->need_dump || BOX64ENV(dynarec_log))dynarec_log(LOG_NONE, "Abort dynablock on pass3\n"); CancelBlock64(0); return NULL; } @@ -751,32 +740,60 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bit block->jmpnext = next+sizeof(void*); block->always_test = helper.always_test; block->dirty = block->always_test; + block->is32bits = is32bits; + block->relocsize = helper.reloc_size*sizeof(uint32_t); + if(arch_size) { + block->arch_size = arch_size; + block->arch = ARCH_FILL(&helper, arch, arch_size); + if(!block->arch) block->arch_size = 0; + } else { + block->arch = NULL; + block->arch_size = arch_size; + } + block->callret_size = helper.callret_size; + block->callrets = helper.callrets; + block->sep_size = helper.sep_size; + block->sep = helper.sep; + block->native_size = native_size; *(dynablock_t**)next = block; + for(int i=0; iblock + helper.sep[i].nat_offs - sizeof(void*)); + *(dynablock_t**)p = block; + } *(void**)(next+3*sizeof(void*)) = native_next; CreateJmpNext(block->jmpnext, next+3*sizeof(void*)); + ClearCache(block->jmpnext, 4*sizeof(void*)); //block->x64_addr = (void*)start; block->x64_size = end-start; // all done... - __clear_cache(actual_p, actual_p+sz); // need to clear the cache before execution... + if (BOX64ENV(dynarec_gdbjit) && (!BOX64ENV(dynarec_gdbjit_end) || (addr >= BOX64ENV(dynarec_gdbjit_start) && addr < BOX64ENV(dynarec_gdbjit_end)))) { + if (BOX64ENV(dynarec_gdbjit) != 3) GdbJITBlockReady(helper.gdbjit_block); + GdbJITBlockCleanup(helper.gdbjit_block); + #ifdef GDBJIT + block->gdbjit_block = helper.gdbjit_block; + #endif + } + ClearCache(actual_p+sizeof(void*), native_size); // need to clear the cache before execution... block->hash = X31_hash_code(block->x64_addr, block->x64_size); // Check if something changed, to abort if it is - if((block->hash != hash)) { + if((helper.abort || (block->hash != hash))) { dynarec_log(LOG_DEBUG, "Warning, a block changed while being processed hash(%p:%ld)=%x/%x\n", block->x64_addr, block->x64_size, block->hash, hash); CancelBlock64(0); return NULL; } if((oldnativesize!=helper.native_size) || (oldtable64size ":"", dump); for(; dump<(uint8_t*)helper.insts[i+1].x64.addr; ++dump) - printf_log(LOG_NONE, " %02X", *dump); - printf_log(LOG_NONE, "\t%d -> %d", helper.insts[i].size2, helper.insts[i].size); + printf_log_prefix(0, LOG_NONE, " %02X", *dump); + printf_log_prefix(0, LOG_NONE, "\t%d -> %d", helper.insts[i].size2, helper.insts[i].size); if(helper.insts[i].ymm0_pass2 || helper.insts[i].ymm0_pass3) - printf_log(LOG_NONE, "\t %04x -> %04x", helper.insts[i].ymm0_pass2, helper.insts[i].ymm0_pass3); - printf_log(LOG_NONE, "\n"); + printf_log_prefix(0, LOG_NONE, "\t %04x -> %04x", helper.insts[i].ymm0_pass2, helper.insts[i].ymm0_pass3); + printf_log_prefix(0, LOG_NONE, "\n"); } printf_log(LOG_NONE, "Table64 \t%d -> %d\n", oldtable64size*8, helper.table64size*8); printf_log(LOG_NONE, " ------------\n"); @@ -784,24 +801,32 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bit return NULL; } // ok, free the helper now + ResetTable64(&helper); //dynaFree(helper.insts); helper.insts = NULL; if(insts_rsize/sizeof(instsize_t)x64_addr, block->x64_size); + if(!is_inhotpage && !isprotectedDB(addr, end-addr)) { + dynarec_log(LOG_INFO, "Warning, block unprotected while being processed %p:%ld, marking as need_test\n", block->x64_addr, block->x64_size); block->dirty = 1; //protectDB(addr, end-addr); } if(getProtection(addr)&PROT_NEVERCLEAN) { - block->dirty = 1; block->always_test = 1; } + else if(is_inhotpage) + block->always_test = 2; if(block->always_test) { - dynarec_log(LOG_DEBUG, "Note: block marked as always dirty %p:%ld\n", block->x64_addr, block->x64_size); - } - current_helper = NULL; + dynarec_log(LOG_INFO, "Note: block marked as always dirty %p:%ld\n", block->x64_addr, block->x64_size); + #ifdef ARCH_NOP + // mark callrets to trigger SIGILL to check clean state + if(block->callret_size) + for(int i=0; icallret_size; ++i) + *(uint32_t*)(block->block+block->callrets[i].offs) = ARCH_UDF; + #endif + } + redundant_helper = current_helper = NULL; //block->done = 1; - return (void*)block; + return block; } diff --git a/src/dynarec/dynarec_native_functions.c b/src/dynarec/dynarec_native_functions.c index 219fd41..5cfa016 100644 --- a/src/dynarec/dynarec_native_functions.c +++ b/src/dynarec/dynarec_native_functions.c @@ -4,23 +4,24 @@ #include #include #include -#include #include #include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" #include "tools/bridge_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" #include "emu/x64run_private.h" #include "emu/x87emu_private.h" #include "x64trace.h" -#include "signals.h" +#include "mysignal.h" +#include "emit_signals.h" #include "dynarec_native.h" #include "custommem.h" #include "bridge.h" @@ -37,12 +38,12 @@ void native_fstp(x64emu_t* emu, void* p) void native_print_armreg(x64emu_t* emu, uintptr_t reg, uintptr_t n) { (void)emu; - dynarec_log(LOG_DEBUG, "R%lu=0x%lx (%lu)\n", n, reg, reg); + dynarec_log(LOG_INFO, "Debug Register R%lu=0x%lx (%lu)\n", n, reg, reg); } void native_f2xm1(x64emu_t* emu) { - ST0.d = exp2(ST0.d) - 1.0; + ST0.d = expm1(LN2 * ST0.d); } void native_fyl2x(x64emu_t* emu) { @@ -50,47 +51,50 @@ void native_fyl2x(x64emu_t* emu) } void native_ftan(x64emu_t* emu) { +#pragma STDC FENV_ACCESS ON + // seems that tan of glib doesn't follow the rounding direction mode ST0.d = tan(ST0.d); emu->sw.f.F87_C2 = 0; } void native_fpatan(x64emu_t* emu) { +#pragma STDC FENV_ACCESS ON ST1.d = atan2(ST1.d, ST0.d); } void native_fxtract(x64emu_t* emu) { - int32_t tmp32s = (ST1.q&0x7ff0000000000000LL)>>52; - tmp32s -= 1023; - ST1.d /= exp2(tmp32s); - ST0.d = tmp32s; + int tmp32s; + if(isnan(ST1.d)) { + ST0.d = ST1.d; + } else if(isinf(ST1.d)) { + ST0.d = ST1.d; + ST1.d = INFINITY; + } else if(ST1.d==0.0) { + ST0.d = ST1.d; + ST1.d = -INFINITY; + } else { + // LD80bits doesn't have implicit "1" bit, so need to adjust for that + ST0.d = frexp(ST1.d, &tmp32s)*2; + ST1.d = tmp32s-1; + } } void native_fprem(x64emu_t* emu) { - int e0, e1; - int64_t ll; - frexp(ST0.d, &e0); - frexp(ST1.d, &e1); - int32_t tmp32s = e0 - e1; - if(tmp32s<64) - { - ll = (int64_t)floor(ST0.d/ST1.d); - ST0.d = ST0.d - (ST1.d*ll); - emu->sw.f.F87_C2 = 0; - emu->sw.f.F87_C1 = (ll&1)?1:0; - emu->sw.f.F87_C3 = (ll&2)?1:0; - emu->sw.f.F87_C0 = (ll&4)?1:0; - } else { - ll = (int64_t)(floor((ST0.d/ST1.d))/exp2(tmp32s - 32)); - ST0.d = ST0.d - ST1.d*ll*exp2(tmp32s - 32); - emu->sw.f.F87_C2 = 1; - } + int64_t ll = (int64_t)trunc(ST0.d / ST1.d); + ST0.d = ST0.d - (ST1.d * ll); + emu->sw.f.F87_C2 = 0; + emu->sw.f.F87_C1 = (ll & 1) ? 1 : 0; + emu->sw.f.F87_C3 = (ll & 2) ? 1 : 0; + emu->sw.f.F87_C0 = (ll & 4) ? 1 : 0; } void native_fyl2xp1(x64emu_t* emu) { - ST(1).d = log2(ST0.d + 1.0)*ST(1).d; + ST(1).d = log1p(ST0.d)*ST(1).d/LN2; } void native_fsincos(x64emu_t* emu) { +#pragma STDC FENV_ACCESS ON + // seems that sincos of glib doesn't follow the rounding direction mode sincos(ST1.d, &ST1.d, &ST0.d); emu->sw.f.F87_C2 = 0; } @@ -100,20 +104,69 @@ void native_frndint(x64emu_t* emu) } void native_fscale(x64emu_t* emu) { +#pragma STDC FENV_ACCESS ON if(ST0.d!=0.0) - ST0.d *= exp2(trunc(ST1.d)); + ST0.d = ldexp(ST0.d, trunc(ST1.d)); } void native_fsin(x64emu_t* emu) { +#pragma STDC FENV_ACCESS ON + // seems that sin of glib doesn't follow the rounding direction mode ST0.d = sin(ST0.d); emu->sw.f.F87_C2 = 0; } void native_fcos(x64emu_t* emu) { +#pragma STDC FENV_ACCESS ON + // seems that cos of glib doesn't follow the rounding direction mode ST0.d = cos(ST0.d); emu->sw.f.F87_C2 = 0; } +double direct_f2xm1(x64emu_t* emu, double a) +{ + return expm1(LN2 * a); +} +double direct_fyl2x(x64emu_t* emu, double a, double b) +{ + return log2(a)*b; +} +double direct_fyl2xp1(x64emu_t* emu, double a, double b) +{ + return log1p(a)*b/LN2; +} +double direct_fpatan(x64emu_t* emu, double a, double b) +{ +#pragma STDC FENV_ACCESS ON + return atan2(b, a); +} +double direct_fsin(x64emu_t* emu, double a) +{ +#pragma STDC FENV_ACCESS ON + // seems that sin of glib doesn't follow the rounding direction mode + emu->sw.f.F87_C2 = 0; + return sin(a); +} +double direct_fcos(x64emu_t* emu, double a) +{ +#pragma STDC FENV_ACCESS ON + // seems that cos of glib doesn't follow the rounding direction mode + emu->sw.f.F87_C2 = 0; + return cos(a); +} +double direct_ftan(x64emu_t* emu, double a) +{ +#pragma STDC FENV_ACCESS ON + // seems that tan of glib doesn't follow the rounding direction mode + emu->sw.f.F87_C2 = 0; + return tan(a); +} +double direct_fscale(x64emu_t* emu, double a, double b) +{ +#pragma STDC FENV_ACCESS ON + return a?ldexp(a, trunc(b)):a; +} + void native_fbld(x64emu_t* emu, uint8_t* ed) { fpu_fbld(emu, ed); @@ -164,37 +217,51 @@ void native_fld(x64emu_t* emu, uint8_t* ed) void native_ud(x64emu_t* emu) { - if(box64_dynarec_test) + if(BOX64ENV(dynarec_test)) emu->test.test = 0; - emit_signal(emu, SIGILL, (void*)R_RIP, 0); + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); +} + +void native_br(x64emu_t* emu) +{ + if(BOX64ENV(dynarec_test)) + emu->test.test = 0; + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xb09d); } void native_priv(x64emu_t* emu) { emu->test.test = 0; - emit_signal(emu, SIGSEGV, (void*)R_RIP, 0); + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); } -void native_int(x64emu_t* emu, int num) +void native_gpf(x64emu_t* emu) { emu->test.test = 0; - emit_interruption(emu, num, (void*)R_RIP); + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); // same effect has private opcode? } -void native_singlestep(x64emu_t* emu) +void native_int(x64emu_t* emu, int num) { - emit_signal(emu, SIGTRAP, (void*)R_RIP, 1); + emu->test.test = 0; + EmitInterruption(emu, num, (void*)R_RIP); } - +#ifndef _WIN32 +void native_wineint(x64emu_t* emu, int num) +{ + emu->test.test = 0; + EmitWineInt(emu, num, (void*)R_RIP); +} +#endif void native_int3(x64emu_t* emu) { - emit_signal(emu, SIGTRAP, (void*)R_RIP, 128); + EmitSignal(emu, X64_SIGTRAP, NULL, 3); } void native_div0(x64emu_t* emu) { emu->test.test = 0; - emit_div0(emu, (void*)R_RIP, 0); + EmitDiv0(emu, (void*)R_RIP, 1); } void native_fsave(x64emu_t* emu, uint8_t* ed) @@ -207,6 +274,7 @@ void native_fsave(x64emu_t* emu, uint8_t* ed) LD2D(p, &emu->x87[7-i].d); p+=10; } + reset_fpu(emu); } void native_fsave16(x64emu_t* emu, uint8_t* ed) { @@ -218,6 +286,7 @@ void native_fsave16(x64emu_t* emu, uint8_t* ed) LD2D(p, &emu->x87[7-i].d); p+=10; } + reset_fpu(emu); } void native_frstor(x64emu_t* emu, uint8_t* ed) { @@ -247,24 +316,154 @@ void native_frstor16(x64emu_t* emu, uint8_t* ed) void native_fprem1(x64emu_t* emu) { int e0, e1; - int64_t ll; - frexp(ST0.d, &e0); - frexp(ST1.d, &e1); - int32_t tmp32s = e0 - e1; - if(tmp32s<64) - { - ll = (int64_t)round(ST0.d/ST1.d); - ST0.d = ST0.d - (ST1.d*ll); - emu->sw.f.F87_C2 = 0; - emu->sw.f.F87_C1 = (ll&1)?1:0; - emu->sw.f.F87_C3 = (ll&2)?1:0; - emu->sw.f.F87_C0 = (ll&4)?1:0; - } else { - ll = (int64_t)(trunc((ST0.d/ST1.d))/exp2(tmp32s - 32)); - ST0.d = ST0.d - ST1.d*ll*exp2(tmp32s - 32); - emu->sw.f.F87_C2 = 1; - } -} + int64_t ll = (int64_t)round(ST0.d / ST1.d); + ST0.d = ST0.d - (ST1.d * ll); + emu->sw.f.F87_C2 = 0; + emu->sw.f.F87_C1 = (ll & 1) ? 1 : 0; + emu->sw.f.F87_C3 = (ll & 2) ? 1 : 0; + emu->sw.f.F87_C0 = (ll & 4) ? 1 : 0; +} + +const uint8_t ff_mult2[4][256] = { + // a = 0x0e + 0x00, 0x0e, 0x1c, 0x12, 0x38, 0x36, 0x24, 0x2a, 0x70, 0x7e, 0x6c, 0x62, 0x48, 0x46, 0x54, 0x5a, + 0xe0, 0xee, 0xfc, 0xf2, 0xd8, 0xd6, 0xc4, 0xca, 0x90, 0x9e, 0x8c, 0x82, 0xa8, 0xa6, 0xb4, 0xba, + 0xdb, 0xd5, 0xc7, 0xc9, 0xe3, 0xed, 0xff, 0xf1, 0xab, 0xa5, 0xb7, 0xb9, 0x93, 0x9d, 0x8f, 0x81, + 0x3b, 0x35, 0x27, 0x29, 0x03, 0x0d, 0x1f, 0x11, 0x4b, 0x45, 0x57, 0x59, 0x73, 0x7d, 0x6f, 0x61, + 0xad, 0xa3, 0xb1, 0xbf, 0x95, 0x9b, 0x89, 0x87, 0xdd, 0xd3, 0xc1, 0xcf, 0xe5, 0xeb, 0xf9, 0xf7, + 0x4d, 0x43, 0x51, 0x5f, 0x75, 0x7b, 0x69, 0x67, 0x3d, 0x33, 0x21, 0x2f, 0x05, 0x0b, 0x19, 0x17, + 0x76, 0x78, 0x6a, 0x64, 0x4e, 0x40, 0x52, 0x5c, 0x06, 0x08, 0x1a, 0x14, 0x3e, 0x30, 0x22, 0x2c, + 0x96, 0x98, 0x8a, 0x84, 0xae, 0xa0, 0xb2, 0xbc, 0xe6, 0xe8, 0xfa, 0xf4, 0xde, 0xd0, 0xc2, 0xcc, + 0x41, 0x4f, 0x5d, 0x53, 0x79, 0x77, 0x65, 0x6b, 0x31, 0x3f, 0x2d, 0x23, 0x09, 0x07, 0x15, 0x1b, + 0xa1, 0xaf, 0xbd, 0xb3, 0x99, 0x97, 0x85, 0x8b, 0xd1, 0xdf, 0xcd, 0xc3, 0xe9, 0xe7, 0xf5, 0xfb, + 0x9a, 0x94, 0x86, 0x88, 0xa2, 0xac, 0xbe, 0xb0, 0xea, 0xe4, 0xf6, 0xf8, 0xd2, 0xdc, 0xce, 0xc0, + 0x7a, 0x74, 0x66, 0x68, 0x42, 0x4c, 0x5e, 0x50, 0x0a, 0x04, 0x16, 0x18, 0x32, 0x3c, 0x2e, 0x20, + 0xec, 0xe2, 0xf0, 0xfe, 0xd4, 0xda, 0xc8, 0xc6, 0x9c, 0x92, 0x80, 0x8e, 0xa4, 0xaa, 0xb8, 0xb6, + 0x0c, 0x02, 0x10, 0x1e, 0x34, 0x3a, 0x28, 0x26, 0x7c, 0x72, 0x60, 0x6e, 0x44, 0x4a, 0x58, 0x56, + 0x37, 0x39, 0x2b, 0x25, 0x0f, 0x01, 0x13, 0x1d, 0x47, 0x49, 0x5b, 0x55, 0x7f, 0x71, 0x63, 0x6d, + 0xd7, 0xd9, 0xcb, 0xc5, 0xef, 0xe1, 0xf3, 0xfd, 0xa7, 0xa9, 0xbb, 0xb5, 0x9f, 0x91, 0x83, 0x8d, + // a = 0x09 + 0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f, 0x48, 0x41, 0x5a, 0x53, 0x6c, 0x65, 0x7e, 0x77, + 0x90, 0x99, 0x82, 0x8b, 0xb4, 0xbd, 0xa6, 0xaf, 0xd8, 0xd1, 0xca, 0xc3, 0xfc, 0xf5, 0xee, 0xe7, + 0x3b, 0x32, 0x29, 0x20, 0x1f, 0x16, 0x0d, 0x04, 0x73, 0x7a, 0x61, 0x68, 0x57, 0x5e, 0x45, 0x4c, + 0xab, 0xa2, 0xb9, 0xb0, 0x8f, 0x86, 0x9d, 0x94, 0xe3, 0xea, 0xf1, 0xf8, 0xc7, 0xce, 0xd5, 0xdc, + 0x76, 0x7f, 0x64, 0x6d, 0x52, 0x5b, 0x40, 0x49, 0x3e, 0x37, 0x2c, 0x25, 0x1a, 0x13, 0x08, 0x01, + 0xe6, 0xef, 0xf4, 0xfd, 0xc2, 0xcb, 0xd0, 0xd9, 0xae, 0xa7, 0xbc, 0xb5, 0x8a, 0x83, 0x98, 0x91, + 0x4d, 0x44, 0x5f, 0x56, 0x69, 0x60, 0x7b, 0x72, 0x05, 0x0c, 0x17, 0x1e, 0x21, 0x28, 0x33, 0x3a, + 0xdd, 0xd4, 0xcf, 0xc6, 0xf9, 0xf0, 0xeb, 0xe2, 0x95, 0x9c, 0x87, 0x8e, 0xb1, 0xb8, 0xa3, 0xaa, + 0xec, 0xe5, 0xfe, 0xf7, 0xc8, 0xc1, 0xda, 0xd3, 0xa4, 0xad, 0xb6, 0xbf, 0x80, 0x89, 0x92, 0x9b, + 0x7c, 0x75, 0x6e, 0x67, 0x58, 0x51, 0x4a, 0x43, 0x34, 0x3d, 0x26, 0x2f, 0x10, 0x19, 0x02, 0x0b, + 0xd7, 0xde, 0xc5, 0xcc, 0xf3, 0xfa, 0xe1, 0xe8, 0x9f, 0x96, 0x8d, 0x84, 0xbb, 0xb2, 0xa9, 0xa0, + 0x47, 0x4e, 0x55, 0x5c, 0x63, 0x6a, 0x71, 0x78, 0x0f, 0x06, 0x1d, 0x14, 0x2b, 0x22, 0x39, 0x30, + 0x9a, 0x93, 0x88, 0x81, 0xbe, 0xb7, 0xac, 0xa5, 0xd2, 0xdb, 0xc0, 0xc9, 0xf6, 0xff, 0xe4, 0xed, + 0x0a, 0x03, 0x18, 0x11, 0x2e, 0x27, 0x3c, 0x35, 0x42, 0x4b, 0x50, 0x59, 0x66, 0x6f, 0x74, 0x7d, + 0xa1, 0xa8, 0xb3, 0xba, 0x85, 0x8c, 0x97, 0x9e, 0xe9, 0xe0, 0xfb, 0xf2, 0xcd, 0xc4, 0xdf, 0xd6, + 0x31, 0x38, 0x23, 0x2a, 0x15, 0x1c, 0x07, 0x0e, 0x79, 0x70, 0x6b, 0x62, 0x5d, 0x54, 0x4f, 0x46, + // a = 0x0d + 0x00, 0x0d, 0x1a, 0x17, 0x34, 0x39, 0x2e, 0x23, 0x68, 0x65, 0x72, 0x7f, 0x5c, 0x51, 0x46, 0x4b, + 0xd0, 0xdd, 0xca, 0xc7, 0xe4, 0xe9, 0xfe, 0xf3, 0xb8, 0xb5, 0xa2, 0xaf, 0x8c, 0x81, 0x96, 0x9b, + 0xbb, 0xb6, 0xa1, 0xac, 0x8f, 0x82, 0x95, 0x98, 0xd3, 0xde, 0xc9, 0xc4, 0xe7, 0xea, 0xfd, 0xf0, + 0x6b, 0x66, 0x71, 0x7c, 0x5f, 0x52, 0x45, 0x48, 0x03, 0x0e, 0x19, 0x14, 0x37, 0x3a, 0x2d, 0x20, + 0x6d, 0x60, 0x77, 0x7a, 0x59, 0x54, 0x43, 0x4e, 0x05, 0x08, 0x1f, 0x12, 0x31, 0x3c, 0x2b, 0x26, + 0xbd, 0xb0, 0xa7, 0xaa, 0x89, 0x84, 0x93, 0x9e, 0xd5, 0xd8, 0xcf, 0xc2, 0xe1, 0xec, 0xfb, 0xf6, + 0xd6, 0xdb, 0xcc, 0xc1, 0xe2, 0xef, 0xf8, 0xf5, 0xbe, 0xb3, 0xa4, 0xa9, 0x8a, 0x87, 0x90, 0x9d, + 0x06, 0x0b, 0x1c, 0x11, 0x32, 0x3f, 0x28, 0x25, 0x6e, 0x63, 0x74, 0x79, 0x5a, 0x57, 0x40, 0x4d, + 0xda, 0xd7, 0xc0, 0xcd, 0xee, 0xe3, 0xf4, 0xf9, 0xb2, 0xbf, 0xa8, 0xa5, 0x86, 0x8b, 0x9c, 0x91, + 0x0a, 0x07, 0x10, 0x1d, 0x3e, 0x33, 0x24, 0x29, 0x62, 0x6f, 0x78, 0x75, 0x56, 0x5b, 0x4c, 0x41, + 0x61, 0x6c, 0x7b, 0x76, 0x55, 0x58, 0x4f, 0x42, 0x09, 0x04, 0x13, 0x1e, 0x3d, 0x30, 0x27, 0x2a, + 0xb1, 0xbc, 0xab, 0xa6, 0x85, 0x88, 0x9f, 0x92, 0xd9, 0xd4, 0xc3, 0xce, 0xed, 0xe0, 0xf7, 0xfa, + 0xb7, 0xba, 0xad, 0xa0, 0x83, 0x8e, 0x99, 0x94, 0xdf, 0xd2, 0xc5, 0xc8, 0xeb, 0xe6, 0xf1, 0xfc, + 0x67, 0x6a, 0x7d, 0x70, 0x53, 0x5e, 0x49, 0x44, 0x0f, 0x02, 0x15, 0x18, 0x3b, 0x36, 0x21, 0x2c, + 0x0c, 0x01, 0x16, 0x1b, 0x38, 0x35, 0x22, 0x2f, 0x64, 0x69, 0x7e, 0x73, 0x50, 0x5d, 0x4a, 0x47, + 0xdc, 0xd1, 0xc6, 0xcb, 0xe8, 0xe5, 0xf2, 0xff, 0xb4, 0xb9, 0xae, 0xa3, 0x80, 0x8d, 0x9a, 0x97, + // a = 0x0b + 0x00, 0x0b, 0x16, 0x1d, 0x2c, 0x27, 0x3a, 0x31, 0x58, 0x53, 0x4e, 0x45, 0x74, 0x7f, 0x62, 0x69, + 0xb0, 0xbb, 0xa6, 0xad, 0x9c, 0x97, 0x8a, 0x81, 0xe8, 0xe3, 0xfe, 0xf5, 0xc4, 0xcf, 0xd2, 0xd9, + 0x7b, 0x70, 0x6d, 0x66, 0x57, 0x5c, 0x41, 0x4a, 0x23, 0x28, 0x35, 0x3e, 0x0f, 0x04, 0x19, 0x12, + 0xcb, 0xc0, 0xdd, 0xd6, 0xe7, 0xec, 0xf1, 0xfa, 0x93, 0x98, 0x85, 0x8e, 0xbf, 0xb4, 0xa9, 0xa2, + 0xf6, 0xfd, 0xe0, 0xeb, 0xda, 0xd1, 0xcc, 0xc7, 0xae, 0xa5, 0xb8, 0xb3, 0x82, 0x89, 0x94, 0x9f, + 0x46, 0x4d, 0x50, 0x5b, 0x6a, 0x61, 0x7c, 0x77, 0x1e, 0x15, 0x08, 0x03, 0x32, 0x39, 0x24, 0x2f, + 0x8d, 0x86, 0x9b, 0x90, 0xa1, 0xaa, 0xb7, 0xbc, 0xd5, 0xde, 0xc3, 0xc8, 0xf9, 0xf2, 0xef, 0xe4, + 0x3d, 0x36, 0x2b, 0x20, 0x11, 0x1a, 0x07, 0x0c, 0x65, 0x6e, 0x73, 0x78, 0x49, 0x42, 0x5f, 0x54, + 0xf7, 0xfc, 0xe1, 0xea, 0xdb, 0xd0, 0xcd, 0xc6, 0xaf, 0xa4, 0xb9, 0xb2, 0x83, 0x88, 0x95, 0x9e, + 0x47, 0x4c, 0x51, 0x5a, 0x6b, 0x60, 0x7d, 0x76, 0x1f, 0x14, 0x09, 0x02, 0x33, 0x38, 0x25, 0x2e, + 0x8c, 0x87, 0x9a, 0x91, 0xa0, 0xab, 0xb6, 0xbd, 0xd4, 0xdf, 0xc2, 0xc9, 0xf8, 0xf3, 0xee, 0xe5, + 0x3c, 0x37, 0x2a, 0x21, 0x10, 0x1b, 0x06, 0x0d, 0x64, 0x6f, 0x72, 0x79, 0x48, 0x43, 0x5e, 0x55, + 0x01, 0x0a, 0x17, 0x1c, 0x2d, 0x26, 0x3b, 0x30, 0x59, 0x52, 0x4f, 0x44, 0x75, 0x7e, 0x63, 0x68, + 0xb1, 0xba, 0xa7, 0xac, 0x9d, 0x96, 0x8b, 0x80, 0xe9, 0xe2, 0xff, 0xf4, 0xc5, 0xce, 0xd3, 0xd8, + 0x7a, 0x71, 0x6c, 0x67, 0x56, 0x5d, 0x40, 0x4b, 0x22, 0x29, 0x34, 0x3f, 0x0e, 0x05, 0x18, 0x13, + 0xca, 0xc1, 0xdc, 0xd7, 0xe6, 0xed, 0xf0, 0xfb, 0x92, 0x99, 0x84, 0x8f, 0xbe, 0xb5, 0xa8, 0xa3, +}; +const uint8_t ff_mult3[4][256] = { + // a = 0x02 + 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, + 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, + 0x40, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e, + 0x60, 0x62, 0x64, 0x66, 0x68, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7a, 0x7c, 0x7e, + 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e, 0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e, + 0xa0, 0xa2, 0xa4, 0xa6, 0xa8, 0xaa, 0xac, 0xae, 0xb0, 0xb2, 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe, + 0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde, + 0xe0, 0xe2, 0xe4, 0xe6, 0xe8, 0xea, 0xec, 0xee, 0xf0, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfc, 0xfe, + 0x1b, 0x19, 0x1f, 0x1d, 0x13, 0x11, 0x17, 0x15, 0x0b, 0x09, 0x0f, 0x0d, 0x03, 0x01, 0x07, 0x05, + 0x3b, 0x39, 0x3f, 0x3d, 0x33, 0x31, 0x37, 0x35, 0x2b, 0x29, 0x2f, 0x2d, 0x23, 0x21, 0x27, 0x25, + 0x5b, 0x59, 0x5f, 0x5d, 0x53, 0x51, 0x57, 0x55, 0x4b, 0x49, 0x4f, 0x4d, 0x43, 0x41, 0x47, 0x45, + 0x7b, 0x79, 0x7f, 0x7d, 0x73, 0x71, 0x77, 0x75, 0x6b, 0x69, 0x6f, 0x6d, 0x63, 0x61, 0x67, 0x65, + 0x9b, 0x99, 0x9f, 0x9d, 0x93, 0x91, 0x97, 0x95, 0x8b, 0x89, 0x8f, 0x8d, 0x83, 0x81, 0x87, 0x85, + 0xbb, 0xb9, 0xbf, 0xbd, 0xb3, 0xb1, 0xb7, 0xb5, 0xab, 0xa9, 0xaf, 0xad, 0xa3, 0xa1, 0xa7, 0xa5, + 0xdb, 0xd9, 0xdf, 0xdd, 0xd3, 0xd1, 0xd7, 0xd5, 0xcb, 0xc9, 0xcf, 0xcd, 0xc3, 0xc1, 0xc7, 0xc5, + 0xfb, 0xf9, 0xff, 0xfd, 0xf3, 0xf1, 0xf7, 0xf5, 0xeb, 0xe9, 0xef, 0xed, 0xe3, 0xe1, 0xe7, 0xe5, + // a = 0x01 + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, + // a = 0x01 + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, + // a = 0x03 + 0x00, 0x03, 0x06, 0x05, 0x0c, 0x0f, 0x0a, 0x09, 0x18, 0x1b, 0x1e, 0x1d, 0x14, 0x17, 0x12, 0x11, + 0x30, 0x33, 0x36, 0x35, 0x3c, 0x3f, 0x3a, 0x39, 0x28, 0x2b, 0x2e, 0x2d, 0x24, 0x27, 0x22, 0x21, + 0x60, 0x63, 0x66, 0x65, 0x6c, 0x6f, 0x6a, 0x69, 0x78, 0x7b, 0x7e, 0x7d, 0x74, 0x77, 0x72, 0x71, + 0x50, 0x53, 0x56, 0x55, 0x5c, 0x5f, 0x5a, 0x59, 0x48, 0x4b, 0x4e, 0x4d, 0x44, 0x47, 0x42, 0x41, + 0xc0, 0xc3, 0xc6, 0xc5, 0xcc, 0xcf, 0xca, 0xc9, 0xd8, 0xdb, 0xde, 0xdd, 0xd4, 0xd7, 0xd2, 0xd1, + 0xf0, 0xf3, 0xf6, 0xf5, 0xfc, 0xff, 0xfa, 0xf9, 0xe8, 0xeb, 0xee, 0xed, 0xe4, 0xe7, 0xe2, 0xe1, + 0xa0, 0xa3, 0xa6, 0xa5, 0xac, 0xaf, 0xaa, 0xa9, 0xb8, 0xbb, 0xbe, 0xbd, 0xb4, 0xb7, 0xb2, 0xb1, + 0x90, 0x93, 0x96, 0x95, 0x9c, 0x9f, 0x9a, 0x99, 0x88, 0x8b, 0x8e, 0x8d, 0x84, 0x87, 0x82, 0x81, + 0x9b, 0x98, 0x9d, 0x9e, 0x97, 0x94, 0x91, 0x92, 0x83, 0x80, 0x85, 0x86, 0x8f, 0x8c, 0x89, 0x8a, + 0xab, 0xa8, 0xad, 0xae, 0xa7, 0xa4, 0xa1, 0xa2, 0xb3, 0xb0, 0xb5, 0xb6, 0xbf, 0xbc, 0xb9, 0xba, + 0xfb, 0xf8, 0xfd, 0xfe, 0xf7, 0xf4, 0xf1, 0xf2, 0xe3, 0xe0, 0xe5, 0xe6, 0xef, 0xec, 0xe9, 0xea, + 0xcb, 0xc8, 0xcd, 0xce, 0xc7, 0xc4, 0xc1, 0xc2, 0xd3, 0xd0, 0xd5, 0xd6, 0xdf, 0xdc, 0xd9, 0xda, + 0x5b, 0x58, 0x5d, 0x5e, 0x57, 0x54, 0x51, 0x52, 0x43, 0x40, 0x45, 0x46, 0x4f, 0x4c, 0x49, 0x4a, + 0x6b, 0x68, 0x6d, 0x6e, 0x67, 0x64, 0x61, 0x62, 0x73, 0x70, 0x75, 0x76, 0x7f, 0x7c, 0x79, 0x7a, + 0x3b, 0x38, 0x3d, 0x3e, 0x37, 0x34, 0x31, 0x32, 0x23, 0x20, 0x25, 0x26, 0x2f, 0x2c, 0x29, 0x2a, + 0x0b, 0x08, 0x0d, 0x0e, 0x07, 0x04, 0x01, 0x02, 0x13, 0x10, 0x15, 0x16, 0x1f, 0x1c, 0x19, 0x1a, +}; static uint8_t ff_mult(uint8_t a, uint8_t b) { @@ -292,10 +491,15 @@ void native_aesimc(x64emu_t* emu, int xmm) sse_regs_t eax1 = emu->xmm[xmm]; for(int j=0; j<4; ++j) { - emu->xmm[xmm].ub[0+j*4] = ff_mult(0x0E, eax1.ub[0+j*4]) ^ ff_mult(0x0B, eax1.ub[1+j*4]) ^ ff_mult(0x0D, eax1.ub[2+j*4]) ^ ff_mult(0x09, eax1.ub[3+j*4]); - emu->xmm[xmm].ub[1+j*4] = ff_mult(0x09, eax1.ub[0+j*4]) ^ ff_mult(0x0E, eax1.ub[1+j*4]) ^ ff_mult(0x0B, eax1.ub[2+j*4]) ^ ff_mult(0x0D, eax1.ub[3+j*4]); - emu->xmm[xmm].ub[2+j*4] = ff_mult(0x0D, eax1.ub[0+j*4]) ^ ff_mult(0x09, eax1.ub[1+j*4]) ^ ff_mult(0x0E, eax1.ub[2+j*4]) ^ ff_mult(0x0B, eax1.ub[3+j*4]); - emu->xmm[xmm].ub[3+j*4] = ff_mult(0x0B, eax1.ub[0+j*4]) ^ ff_mult(0x0D, eax1.ub[1+j*4]) ^ ff_mult(0x09, eax1.ub[2+j*4]) ^ ff_mult(0x0E, eax1.ub[3+j*4]); + // 0x0E -> 0, 0x09 -> 1, 0x0D -> 2, 0x0B -> 3 + // emu->xmm[xmm].ub[0+j*4] = ff_mult(0x0E, eax1.ub[0+j*4]) ^ ff_mult(0x0B, eax1.ub[1+j*4]) ^ ff_mult(0x0D, eax1.ub[2+j*4]) ^ ff_mult(0x09, eax1.ub[3+j*4]); + // emu->xmm[xmm].ub[1+j*4] = ff_mult(0x09, eax1.ub[0+j*4]) ^ ff_mult(0x0E, eax1.ub[1+j*4]) ^ ff_mult(0x0B, eax1.ub[2+j*4]) ^ ff_mult(0x0D, eax1.ub[3+j*4]); + // emu->xmm[xmm].ub[2+j*4] = ff_mult(0x0D, eax1.ub[0+j*4]) ^ ff_mult(0x09, eax1.ub[1+j*4]) ^ ff_mult(0x0E, eax1.ub[2+j*4]) ^ ff_mult(0x0B, eax1.ub[3+j*4]); + // emu->xmm[xmm].ub[3+j*4] = ff_mult(0x0B, eax1.ub[0+j*4]) ^ ff_mult(0x0D, eax1.ub[1+j*4]) ^ ff_mult(0x09, eax1.ub[2+j*4]) ^ ff_mult(0x0E, eax1.ub[3+j*4]); + emu->xmm[xmm].ub[0+j*4] = ff_mult2[0][eax1.ub[0+j*4]] ^ ff_mult2[3][eax1.ub[1+j*4]] ^ ff_mult2[2][eax1.ub[2+j*4]] ^ ff_mult2[1][eax1.ub[3+j*4]]; + emu->xmm[xmm].ub[1+j*4] = ff_mult2[1][eax1.ub[0+j*4]] ^ ff_mult2[0][eax1.ub[1+j*4]] ^ ff_mult2[3][eax1.ub[2+j*4]] ^ ff_mult2[2][eax1.ub[3+j*4]]; + emu->xmm[xmm].ub[2+j*4] = ff_mult2[2][eax1.ub[0+j*4]] ^ ff_mult2[1][eax1.ub[1+j*4]] ^ ff_mult2[0][eax1.ub[2+j*4]] ^ ff_mult2[3][eax1.ub[3+j*4]]; + emu->xmm[xmm].ub[3+j*4] = ff_mult2[3][eax1.ub[0+j*4]] ^ ff_mult2[2][eax1.ub[1+j*4]] ^ ff_mult2[1][eax1.ub[2+j*4]] ^ ff_mult2[0][eax1.ub[3+j*4]]; } } void native_aesimc_y(x64emu_t* emu, int ymm) @@ -303,10 +507,14 @@ void native_aesimc_y(x64emu_t* emu, int ymm) sse_regs_t eay1 = emu->ymm[ymm]; for(int j=0; j<4; ++j) { - emu->ymm[ymm].ub[0+j*4] = ff_mult(0x0E, eay1.ub[0+j*4]) ^ ff_mult(0x0B, eay1.ub[1+j*4]) ^ ff_mult(0x0D, eay1.ub[2+j*4]) ^ ff_mult(0x09, eay1.ub[3+j*4]); - emu->ymm[ymm].ub[1+j*4] = ff_mult(0x09, eay1.ub[0+j*4]) ^ ff_mult(0x0E, eay1.ub[1+j*4]) ^ ff_mult(0x0B, eay1.ub[2+j*4]) ^ ff_mult(0x0D, eay1.ub[3+j*4]); - emu->ymm[ymm].ub[2+j*4] = ff_mult(0x0D, eay1.ub[0+j*4]) ^ ff_mult(0x09, eay1.ub[1+j*4]) ^ ff_mult(0x0E, eay1.ub[2+j*4]) ^ ff_mult(0x0B, eay1.ub[3+j*4]); - emu->ymm[ymm].ub[3+j*4] = ff_mult(0x0B, eay1.ub[0+j*4]) ^ ff_mult(0x0D, eay1.ub[1+j*4]) ^ ff_mult(0x09, eay1.ub[2+j*4]) ^ ff_mult(0x0E, eay1.ub[3+j*4]); + // emu->ymm[ymm].ub[0+j*4] = ff_mult(0x0E, eay1.ub[0+j*4]) ^ ff_mult(0x0B, eay1.ub[1+j*4]) ^ ff_mult(0x0D, eay1.ub[2+j*4]) ^ ff_mult(0x09, eay1.ub[3+j*4]); + // emu->ymm[ymm].ub[1+j*4] = ff_mult(0x09, eay1.ub[0+j*4]) ^ ff_mult(0x0E, eay1.ub[1+j*4]) ^ ff_mult(0x0B, eay1.ub[2+j*4]) ^ ff_mult(0x0D, eay1.ub[3+j*4]); + // emu->ymm[ymm].ub[2+j*4] = ff_mult(0x0D, eay1.ub[0+j*4]) ^ ff_mult(0x09, eay1.ub[1+j*4]) ^ ff_mult(0x0E, eay1.ub[2+j*4]) ^ ff_mult(0x0B, eay1.ub[3+j*4]); + // emu->ymm[ymm].ub[3+j*4] = ff_mult(0x0B, eay1.ub[0+j*4]) ^ ff_mult(0x0D, eay1.ub[1+j*4]) ^ ff_mult(0x09, eay1.ub[2+j*4]) ^ ff_mult(0x0E, eay1.ub[3+j*4]); + emu->ymm[ymm].ub[0+j*4] = ff_mult2[0][eay1.ub[0+j*4]] ^ ff_mult2[3][eay1.ub[1+j*4]] ^ ff_mult2[2][eay1.ub[2+j*4]] ^ ff_mult2[1][eay1.ub[3+j*4]]; + emu->ymm[ymm].ub[1+j*4] = ff_mult2[1][eay1.ub[0+j*4]] ^ ff_mult2[0][eay1.ub[1+j*4]] ^ ff_mult2[3][eay1.ub[2+j*4]] ^ ff_mult2[2][eay1.ub[3+j*4]]; + emu->ymm[ymm].ub[2+j*4] = ff_mult2[2][eay1.ub[0+j*4]] ^ ff_mult2[1][eay1.ub[1+j*4]] ^ ff_mult2[0][eay1.ub[2+j*4]] ^ ff_mult2[3][eay1.ub[3+j*4]]; + emu->ymm[ymm].ub[3+j*4] = ff_mult2[3][eay1.ub[0+j*4]] ^ ff_mult2[2][eay1.ub[1+j*4]] ^ ff_mult2[1][eay1.ub[2+j*4]] ^ ff_mult2[0][eay1.ub[3+j*4]]; } } void native_aesmc(x64emu_t* emu, int xmm) @@ -314,10 +522,15 @@ void native_aesmc(x64emu_t* emu, int xmm) sse_regs_t eax1 = emu->xmm[xmm]; for(int j=0; j<4; ++j) { - emu->xmm[xmm].ub[0+j*4] = ff_mult(0x02, eax1.ub[0+j*4]) ^ ff_mult(0x03, eax1.ub[1+j*4]) ^ eax1.ub[2+j*4] ^ eax1.ub[3+j*4] ; - emu->xmm[xmm].ub[1+j*4] = eax1.ub[0+j*4] ^ ff_mult(0x02, eax1.ub[1+j*4]) ^ ff_mult(0x03, eax1.ub[2+j*4]) ^ eax1.ub[3+j*4] ; - emu->xmm[xmm].ub[2+j*4] = eax1.ub[0+j*4] ^ eax1.ub[1+j*4] ^ ff_mult(0x02, eax1.ub[2+j*4]) ^ ff_mult(0x03, eax1.ub[3+j*4]); - emu->xmm[xmm].ub[3+j*4] = ff_mult(0x03, eax1.ub[0+j*4]) ^ eax1.ub[1+j*4] ^ eax1.ub[2+j*4] ^ ff_mult(0x02, eax1.ub[3+j*4]); + // 0x02 -> 0, 0x01 -> 1, 0x01 -> 2, 0x03 -> 3 + // emu->xmm[xmm].ub[0+j*4] = ff_mult(0x02, eax1.ub[0+j*4]) ^ ff_mult(0x03, eax1.ub[1+j*4]) ^ eax1.ub[2+j*4] ^ eax1.ub[3+j*4] ; + // emu->xmm[xmm].ub[1+j*4] = eax1.ub[0+j*4] ^ ff_mult(0x02, eax1.ub[1+j*4]) ^ ff_mult(0x03, eax1.ub[2+j*4]) ^ eax1.ub[3+j*4] ; + // emu->xmm[xmm].ub[2+j*4] = eax1.ub[0+j*4] ^ eax1.ub[1+j*4] ^ ff_mult(0x02, eax1.ub[2+j*4]) ^ ff_mult(0x03, eax1.ub[3+j*4]); + // emu->xmm[xmm].ub[3+j*4] = ff_mult(0x03, eax1.ub[0+j*4]) ^ eax1.ub[1+j*4] ^ eax1.ub[2+j*4] ^ ff_mult(0x02, eax1.ub[3+j*4]); + emu->xmm[xmm].ub[0+j*4] = ff_mult3[0][eax1.ub[0+j*4]] ^ ff_mult3[3][eax1.ub[1+j*4]] ^ ff_mult3[2][eax1.ub[2+j*4]] ^ ff_mult3[1][eax1.ub[3+j*4]]; + emu->xmm[xmm].ub[1+j*4] = ff_mult3[1][eax1.ub[0+j*4]] ^ ff_mult3[0][eax1.ub[1+j*4]] ^ ff_mult3[3][eax1.ub[2+j*4]] ^ ff_mult3[2][eax1.ub[3+j*4]]; + emu->xmm[xmm].ub[2+j*4] = ff_mult3[2][eax1.ub[0+j*4]] ^ ff_mult3[1][eax1.ub[1+j*4]] ^ ff_mult3[0][eax1.ub[2+j*4]] ^ ff_mult3[3][eax1.ub[3+j*4]]; + emu->xmm[xmm].ub[3+j*4] = ff_mult3[3][eax1.ub[0+j*4]] ^ ff_mult3[2][eax1.ub[1+j*4]] ^ ff_mult3[1][eax1.ub[2+j*4]] ^ ff_mult3[0][eax1.ub[3+j*4]]; } } void native_aesmc_y(x64emu_t* emu, int ymm) @@ -325,16 +538,20 @@ void native_aesmc_y(x64emu_t* emu, int ymm) sse_regs_t eay1 = emu->ymm[ymm]; for(int j=0; j<4; ++j) { - emu->ymm[ymm].ub[0+j*4] = ff_mult(0x02, eay1.ub[0+j*4]) ^ ff_mult(0x03, eay1.ub[1+j*4]) ^ eay1.ub[2+j*4] ^ eay1.ub[3+j*4] ; - emu->ymm[ymm].ub[1+j*4] = eay1.ub[0+j*4] ^ ff_mult(0x02, eay1.ub[1+j*4]) ^ ff_mult(0x03, eay1.ub[2+j*4]) ^ eay1.ub[3+j*4] ; - emu->ymm[ymm].ub[2+j*4] = eay1.ub[0+j*4] ^ eay1.ub[1+j*4] ^ ff_mult(0x02, eay1.ub[2+j*4]) ^ ff_mult(0x03, eay1.ub[3+j*4]); - emu->ymm[ymm].ub[3+j*4] = ff_mult(0x03, eay1.ub[0+j*4]) ^ eay1.ub[1+j*4] ^ eay1.ub[2+j*4] ^ ff_mult(0x02, eay1.ub[3+j*4]); + // emu->ymm[ymm].ub[0+j*4] = ff_mult(0x02, eay1.ub[0+j*4]) ^ ff_mult(0x03, eay1.ub[1+j*4]) ^ eay1.ub[2+j*4] ^ eay1.ub[3+j*4] ; + // emu->ymm[ymm].ub[1+j*4] = eay1.ub[0+j*4] ^ ff_mult(0x02, eay1.ub[1+j*4]) ^ ff_mult(0x03, eay1.ub[2+j*4]) ^ eay1.ub[3+j*4] ; + // emu->ymm[ymm].ub[2+j*4] = eay1.ub[0+j*4] ^ eay1.ub[1+j*4] ^ ff_mult(0x02, eay1.ub[2+j*4]) ^ ff_mult(0x03, eay1.ub[3+j*4]); + // emu->ymm[ymm].ub[3+j*4] = ff_mult(0x03, eay1.ub[0+j*4]) ^ eay1.ub[1+j*4] ^ eay1.ub[2+j*4] ^ ff_mult(0x02, eay1.ub[3+j*4]); + emu->ymm[ymm].ub[0+j*4] = ff_mult3[0][eay1.ub[0+j*4]] ^ ff_mult3[3][eay1.ub[1+j*4]] ^ ff_mult3[2][eay1.ub[2+j*4]] ^ ff_mult3[1][eay1.ub[3+j*4]]; + emu->ymm[ymm].ub[1+j*4] = ff_mult3[1][eay1.ub[0+j*4]] ^ ff_mult3[0][eay1.ub[1+j*4]] ^ ff_mult3[3][eay1.ub[2+j*4]] ^ ff_mult3[2][eay1.ub[3+j*4]]; + emu->ymm[ymm].ub[2+j*4] = ff_mult3[2][eay1.ub[0+j*4]] ^ ff_mult3[1][eay1.ub[1+j*4]] ^ ff_mult3[0][eay1.ub[2+j*4]] ^ ff_mult3[3][eay1.ub[3+j*4]]; + emu->ymm[ymm].ub[3+j*4] = ff_mult3[3][eay1.ub[0+j*4]] ^ ff_mult3[2][eay1.ub[1+j*4]] ^ ff_mult3[1][eay1.ub[2+j*4]] ^ ff_mult3[0][eay1.ub[3+j*4]]; } } // A0 B1 C2 D3 E4 F5 G6 H7 I8 J9 Ka Lb Mc Nd Oe Pf // A N K H E B O L I F C P M J G D -static const uint8_t invshiftrows[] = {0,13,10, 7, 4, 1,14,11, 8, 5, 2,15,12, 9, 6, 3}; -static const uint8_t invsubbytes[256] = { +const uint8_t invshiftrows[] = {0,13,10, 7, 4, 1,14,11, 8, 5, 2,15,12, 9, 6, 3}; +const uint8_t invsubbytes[256] = { 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, @@ -374,8 +591,8 @@ void native_aesdlast_y(x64emu_t* emu, int ymm) emu->ymm[ymm].ub[i] = invsubbytes[eay1.ub[i]]; } -static const uint8_t shiftrows[] = {0, 5,10,15, 4, 9,14, 3, 8,13, 2, 7,12, 1, 6,11}; -static const uint8_t subbytes[256] = { +const uint8_t shiftrows[] = {0, 5,10,15, 4, 9,14, 3, 8,13, 2, 7,12, 1, 6,11}; +const uint8_t subbytes[256] = { 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, @@ -463,14 +680,12 @@ void native_pclmul(x64emu_t* emu, int gx, int ex, void* p, uint32_t u8) for (int i=0; i<64; ++i) if(GX->q[g]&(1LL<q[0] = result&0xffffffffffffffffLL; - GX->q[1] = (result>>64)&0xffffffffffffffffLL; + GX->u128 = result; } void native_pclmul_x(x64emu_t* emu, int gx, int vx, void* p, uint32_t u8) { - sse_regs_t *EX = ((uintptr_t)p<16)?((sse_regs_t*)p):&emu->xmm[(uintptr_t)p]; + sse_regs_t *EX = ((uintptr_t)p>15)?((sse_regs_t*)p):&emu->xmm[(uintptr_t)p]; sse_regs_t *GX = &emu->xmm[gx]; sse_regs_t *VX = &emu->xmm[vx]; int g = (u8&1)?1:0; @@ -481,13 +696,13 @@ void native_pclmul_x(x64emu_t* emu, int gx, int vx, void* p, uint32_t u8) if(VX->q[g]&(1LL<q[0] = result&0xffffffffffffffffLL; - GX->q[1] = (result>>64)&0xffffffffffffffffLL; + GX->u128 = result; } void native_pclmul_y(x64emu_t* emu, int gy, int vy, void* p, uint32_t u8) { - - sse_regs_t *EY = ((uintptr_t)p<16)?((sse_regs_t*)p):&emu->ymm[(uintptr_t)p]; + //compute both low and high values + native_pclmul_x(emu, gy, vy, p, u8); + sse_regs_t *EY = ((uintptr_t)p>15)?((sse_regs_t*)(p+16)):&emu->ymm[(uintptr_t)p]; sse_regs_t *GY = &emu->ymm[gy]; sse_regs_t *VY = &emu->ymm[vy]; int g = (u8&1)?1:0; @@ -498,22 +713,35 @@ void native_pclmul_y(x64emu_t* emu, int gy, int vy, void* p, uint32_t u8) if(VY->q[g]&(1LL<q[0] = result&0xffffffffffffffffLL; - GY->q[1] = (result>>64)&0xffffffffffffffffLL; -} - -void native_clflush(x64emu_t* emu, void* p) -{ - cleanDBFromAddressRange((uintptr_t)p, 8, 0); + GY->u128 = result; } static int flagsCacheNeedsTransform(dynarec_native_t* dyn, int ninst) { int jmp = dyn->insts[ninst].x64.jmp_insts; if(jmp<0) return 0; + #if defined(ARM64) || defined(LA64) + // df_none is now a defered information + if(dyn->insts[ninst].f_exit==dyn->insts[jmp].f_entry) + return 0; + if(dyn->insts[jmp].df_notneeded) + return 0; + if((dyn->insts[jmp].f_entry==status_none_pending) && (dyn->insts[ninst].f_exit!=status_none_pending)) + return 1; + switch (dyn->insts[jmp].f_entry) { + case status_unk: + return (dyn->insts[ninst].f_exit==status_none_pending)?1:0; + case status_none: + return 1; + case status_set: + return (dyn->insts[ninst].f_exit==status_none)?0:1; + case status_none_pending: + return 1; + } +#else if(dyn->insts[ninst].f_exit.dfnone) // flags are fully known, nothing we can do more return 0; - if(dyn->insts[jmp].f_entry.dfnone && !dyn->insts[ninst].f_exit.dfnone) + if(dyn->insts[jmp].f_entry.dfnone && !dyn->insts[ninst].f_exit.dfnone && !dyn->insts[jmp].df_notneeded) return 1; switch (dyn->insts[jmp].f_entry.pending) { case SF_UNKNOWN: return 0; @@ -531,6 +759,7 @@ static int flagsCacheNeedsTransform(dynarec_native_t* dyn, int ninst) { return 0; return (dyn->insts[jmp].f_entry.dfnone == dyn->insts[ninst].f_exit.dfnone)?0:1; } + #endif return 0; } @@ -584,7 +813,7 @@ uintptr_t fakeed(dynarec_native_t* dyn, uintptr_t addr, int ninst, uint8_t nexto } return addr; } -// return Ib on a mod/rm opcode without emiting anything +// return Ib on a mod/rm opcode without emitting anything uint8_t geted_ib(dynarec_native_t* dyn, uintptr_t addr, int ninst, uint8_t nextop) { addr = fakeed(dyn, addr, ninst, nextop); @@ -592,57 +821,65 @@ uint8_t geted_ib(dynarec_native_t* dyn, uintptr_t addr, int ninst, uint8_t nexto } #undef F8 -int isNativeCall(dynarec_native_t* dyn, uintptr_t addr, uintptr_t* calladdress, uint16_t* retn) -{ - (void)dyn; - -#define PK(a) *(uint8_t*)(addr+a) -#define PK32(a) *(int32_t*)(addr+a) - - if(!addr || !getProtection(addr)) - return 0; - if(PK(0)==0xff && PK(1)==0x25) { // "absolute" jump, maybe the GOT (well, RIP relative in fact) - uintptr_t a1 = addr + 6 + (PK32(2)); // need to add a check to see if the address is from the GOT ! - addr = (uintptr_t)getAlternate(*(void**)a1); +void propagate_nodf(dynarec_native_t* dyn, int ninst) +{ + while(ninst>=0) { + if(dyn->insts[ninst].df_notneeded) + return; // already flagged + if(dyn->insts[ninst].x64.gen_flags || dyn->insts[ninst].x64.use_flags) + return; // flags are use, so maybe it's needed + dyn->insts[ninst].df_notneeded = 1; + if(!dyn->insts[ninst].pred_sz) + return; + for(int i=1; iinsts[ninst].pred_sz; ++i) + propagate_nodf(dyn, dyn->insts[ninst].pred[i]); + ninst = dyn->insts[ninst].pred[0]; } - if(!addr || !getProtection(addr)) - return 0; - onebridge_t *b = (onebridge_t*)(addr); - if(b->CC==0xCC && b->S=='S' && b->C=='C' && b->w!=(wrapper_t)0 && b->f!=(uintptr_t)PltResolver) { - // found ! - if(retn) *retn = (b->C3==0xC2)?b->N:0; - if(calladdress) *calladdress = addr+1; - return 1; - } - return 0; -#undef PK32 -#undef PK } -// AVX -void avx_mark_zero(dynarec_native_t* dyn, int ninst, int reg) -{ - dyn->ymm_zero |= (1<ymm_zero>>reg)&1; -} -int is_avx_zero_unset(dynarec_native_t* dyn, int ninst, int reg) +void x64disas_add_register_mapping_annotations(char* buf, const char* disas, const register_mapping_t* mappings, size_t mappings_sz) { - if((dyn->ymm_zero>>reg)&1) { - dyn->ymm_zero &= ~(1<ymm_zero = 0; + p++; // skip the space + while (*p) { + while (*p && !(*p >= 'a' && *p <= 'e') && *p != 's' && *p != 'r') // skip non-register characters + p++; + if (!*p) break; + for (int i = 0; i < mappings_sz; ++i) { + if (!strncmp(p, mappings[i].name, strlen(mappings[i].name))) { + len += sprintf(tmp + len, " %s,", mappings[i].native); + p += strlen(mappings[i].name) - 1; + break; + } + } + p++; + } + if (tmp[0]) tmp[strlen(tmp) - 1] = '\0'; + sprintf(buf, "%-35s ;%s", disas, tmp); } -void avx_unmark_zero(dynarec_native_t* dyn, int ninst, int reg) +void dynarec_stopped(uintptr_t ip, int is32bits) { - dyn->ymm_zero &= ~(1<dec32 : my_context->dec; + if(getProtection(ip+14)&PROT_READ) { + if (dec) { + dynarec_log_prefix(0, LOG_NONE, "%s", DecodeX64Trace(dec, ip, 1)); + } else { + dynarec_log_prefix(0, LOG_NONE, "%02hhX %02hhX %02hhX %02hhX %02hhX %02hhX %02hhX %02hhX %02hhX %02hhX %02hhX %02hhX %02hhX %02hhX %02hhX", + PKip(0), PKip(1), PKip(2), PKip(3), PKip(4), PKip(5), PKip(6), PKip(7), PKip(8), PKip(9), + PKip(10), PKip(11), PKip(12), PKip(13), PKip(14)); + } + } else dynarec_log_prefix(0, LOG_NONE, "%02hhX", PKip(0)); + PrintFunctionAddr(ip, " => "); + dynarec_log_prefix(0, LOG_NONE, "\n"); +} \ No newline at end of file diff --git a/src/dynarec/dynarec_native_functions.h b/src/dynarec/dynarec_native_functions.h index 1072a20..4ac8915 100644 --- a/src/dynarec/dynarec_native_functions.h +++ b/src/dynarec/dynarec_native_functions.h @@ -35,6 +35,15 @@ void native_frstor(x64emu_t* emu, uint8_t* ed); void native_frstor16(x64emu_t* emu, uint8_t* ed); void native_fprem1(x64emu_t* emu); +double direct_f2xm1(x64emu_t* emu, double a); +double direct_fyl2x(x64emu_t* emu, double a, double b); +double direct_fyl2xp1(x64emu_t* emu, double a, double b); +double direct_fpatan(x64emu_t* emu, double a, double b); +double direct_fsin(x64emu_t* emu, double a); +double direct_fcos(x64emu_t* emu, double a); +double direct_ftan(x64emu_t* emu, double a); +double direct_fscale(x64emu_t* emu, double a, double b); + void native_aesd(x64emu_t* emu, int xmm); void native_aesd_y(x64emu_t* emu, int ymm); void native_aese(x64emu_t* emu, int xmm); @@ -50,17 +59,19 @@ void native_pclmul(x64emu_t* emu, int gx, int ex, void* p, uint32_t u8); void native_pclmul_x(x64emu_t* emu, int gx, int vx, void* p, uint32_t u8); void native_pclmul_y(x64emu_t* emu, int gy, int vy, void* p, uint32_t u8); -void native_clflush(x64emu_t* emu, void* p); - void native_ud(x64emu_t* emu); +void native_br(x64emu_t* emu); void native_priv(x64emu_t* emu); -void native_singlestep(x64emu_t* emu); +void native_gpf(x64emu_t* emu); void native_int3(x64emu_t* emu); void native_int(x64emu_t* emu, int num); +void native_wineint(x64emu_t* emu, int num); void native_div0(x64emu_t* emu); // Caches transformation (for loops) // Specific, need to be written par backend int CacheNeedsTransform(dynarec_native_t* dyn, int i1); +// propagete defererd to unknow, as state is not needed +void propagate_nodf(dynarec_native_t* dyn, int ninst); // predecessor access int isPred(dynarec_native_t* dyn, int ninst, int pred); @@ -68,18 +79,16 @@ int getNominalPred(dynarec_native_t* dyn, int ninst); // Do the GETED, but don't emit anything... uintptr_t fakeed(dynarec_native_t* dyn, uintptr_t addr, int ninst, uint8_t nextop); -// return Ib on a mod/rm opcode without emiting anything +// return Ib on a mod/rm opcode without emitting anything uint8_t geted_ib(dynarec_native_t* dyn, uintptr_t addr, int ninst, uint8_t nextop); -// Is what pointed at addr a native call? And if yes, to what function? -int isNativeCall(dynarec_native_t* dyn, uintptr_t addr, uintptr_t* calladdress, uint16_t* retn); +typedef struct register_mapping_s { + const char* name; + const char* native; +} register_mapping_t; -// AVX utilities -void avx_mark_zero(dynarec_native_t* dyn, int ninst, int reg); -int is_avx_zero(dynarec_native_t* dyn, int ninst, int reg); -int is_avx_zero_unset(dynarec_native_t* dyn, int ninst, int reg); -void avx_mark_zero_reset(dynarec_native_t* dyn, int ninst); -void avx_unmark_zero(dynarec_native_t* dyn, int ninst, int reg); +void x64disas_add_register_mapping_annotations(char* buf, const char* disas, const register_mapping_t* mappings, size_t mappings_sz); +void dynarec_stopped(uintptr_t x64addr, int is32bits); ADDITIONNAL_DEFINITION() diff --git a/src/dynarec/dynarec_native_pass.c b/src/dynarec/dynarec_native_pass.c index a6bcd4e..38035c2 100644 --- a/src/dynarec/dynarec_native_pass.c +++ b/src/dynarec/dynarec_native_pass.c @@ -4,20 +4,21 @@ #include #include +#include "os.h" #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" #include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" -#include "emu/x64run_private.h" #include "x64trace.h" #include "dynablock.h" #include "dynarec_native.h" +#include "dynablock_private.h" #include "custommem.h" -#include "elfloader.h" +#include "x64test.h" +#include "pe_tools.h" #include "dynarec_arch.h" #include "dynarec_helper.h" @@ -32,7 +33,7 @@ #endif #endif -uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits) +uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int is32bits, int inst_max) { int ok = 1; int ninst = 0; @@ -43,52 +44,81 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int int rep = 0; // 0 none, 1=F2 prefix, 2=F3 prefix int need_epilog = 1; // Clean up (because there are multiple passes) + #if defined(ARM64) || defined(LA64) + dyn->f = status_unk; + #else dyn->f.pending = 0; dyn->f.dfnone = 0; + #endif dyn->forward = 0; dyn->forward_to = 0; dyn->forward_size = 0; dyn->forward_ninst = 0; dyn->ymm_zero = 0; + int dynarec_dirty = BOX64ENV(dynarec_dirty); #if STEP == 0 memset(&dyn->insts[ninst], 0, sizeof(instruction_native_t)); + #ifdef ARM64 + dyn->have_purge = BOX64ENV(dynarec_purge); + #endif #endif fpu_reset(dyn); ARCH_INIT(); - int reset_n = -1; + int reset_n = -1; // -1 no reset; -2 reset to 0; else reset to the state of reset_n dyn->last_ip = (alternate || (dyn->insts && dyn->insts[0].pred_sz))?0:ip; // RIP is always set at start of block unless there is a predecessor! - int stopblock = 2+(FindElfAddress(my_context, addr)?0:1); // if block is in elf_memory, it can be extended with box64_dynarec_bigblock==2, else it needs 3 + int stopblock = 2 + !IsAddrElfOrFileMapped(addr); // if block is in elf memory or file mapped memory, it can be extended with BOX64DRENV(dynarec_bigblock)==2, else it needs 3 // ok, go now INIT; #if STEP == 0 - uintptr_t cur_page = (addr)&~box64_pagesize; + uintptr_t cur_page = (addr)&~(box64_pagesize-1); #endif while(ok) { #if STEP == 0 - if(cur_page != ((addr)&~box64_pagesize)) { - cur_page = (addr)&~box64_pagesize; - if(!(getProtection(addr)&PROT_READ)) { + if(cur_page != ((addr)&~(box64_pagesize-1))) { + cur_page = (addr)&~(box64_pagesize-1); + uint32_t prot = getProtection(addr); + if(!(prot&PROT_READ) || checkInHotPage(addr) || (addr>dyn->end)) { + dynarec_log(LOG_INFO, "Stopping dynablock because of protection, hotpage or mmap crossing at %p -> %p inst=%d\n", (void*)dyn->start, (void*)addr, ninst); need_epilog = 1; break; } + if(prot&PROT_NEVERCLEAN) + dyn->always_test = 1; } // This test is here to prevent things like TABLE64 to be out of range // native_size is not exact at this point, but it should be larger, not smaller, and not by a huge margin anyway // so it's good enough to avoid overflow in relative to PC data fectching - if((dyn->native_size >= MAXBLOCK_SIZE) || (ninst >= MAX_INSTS)) { + if(ninst >= inst_max) { need_epilog = 1; break; } #endif - fpu_propagate_stack(dyn, ninst); + if(!ninst && dyn->need_x87check) { + NATIVE_RESTORE_X87PC(); + } ip = addr; + #ifdef ARM64 + if(!ninst) { + if(dyn->have_purge) + doEnterBlock(dyn, 0, x1, x2, x3); + if(dyn->insts[0].preload_xmmymm) + doPreload(dyn, 0); + ENDPREFIX; + } + #endif + fpu_propagate_stack(dyn, ninst); if (reset_n!=-1) { dyn->last_ip = 0; if(reset_n==-2) { MESSAGE(LOG_DEBUG, "Reset Caches to zero\n"); + #if defined(ARM64) || defined(LA64) + dyn->f = status_unk; + #else dyn->f.dfnone = 0; dyn->f.pending = 0; + #endif fpu_reset(dyn); + ARCH_RESET(); } else { fpu_reset_cache(dyn, ninst, reset_n); dyn->f = dyn->insts[reset_n].f_exit; @@ -98,8 +128,12 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int } if(dyn->insts[ninst].x64.barrier&BARRIER_FLAGS) { MESSAGE(LOG_DEBUG, "Apply Barrier Flags\n"); + #if defined(ARM64) || defined(LA64) + dyn->f = status_unk; + #else dyn->f.dfnone = 0; dyn->f.pending = 0; + #endif } } reset_n = -1; @@ -108,30 +142,48 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int else if(ninst && (dyn->insts[ninst].pred_sz>1 || (dyn->insts[ninst].pred_sz==1 && dyn->insts[ninst].pred[0]!=ninst-1))) dyn->last_ip = 0; // reset IP if some jump are coming here #endif - dyn->f.dfnone_here = 0; NEW_INST; - MESSAGE(LOG_DUMP, "New Instruction x64:%p, native:%p\n", (void*)addr, (void*)dyn->block); - #if STEP == 0 - if(ninst && dyn->insts[ninst-1].x64.barrier_next) { - BARRIER(dyn->insts[ninst-1].x64.barrier_next); - } + MESSAGE(LOG_DUMP, "New Instruction %s:%p, native:%p\n", is32bits?"x86":"x64",(void*)addr, (void*)dyn->block); + #ifdef ARCH_NOP + if(dyn->insts[ninst].x64.alive && dyn->insts[ninst].x64.self_loop) + CALLRET_LOOP(); #endif if(!ninst) { GOTEST(x1, x2); } - if(dyn->insts[ninst].pred_sz>1) {SMSTART();} - if((dyn->insts[ninst].x64.need_before&~X_PEND) && !dyn->insts[ninst].pred_sz) { + if(dyn->insts[ninst].pred_sz>1) {SMEND();} + #if STEP > 1 + if (dyn->insts[ninst].lock) { + WILLWRITELOCK(dyn->insts[ninst].lock); + } else if (dyn->insts[ninst].will_write) { + WILLWRITE(); + } + + int is_opcode_volatile = /*box64_wine &&*/ VolatileRangesContains(ip) && VolatileOpcodesHas(ip); + if (is_opcode_volatile && !dyn->insts[ninst].lock) + DMB_ISHST(); + #endif + if((dyn->insts[ninst].x64.need_before&~X_PEND) && !ninst) { READFLAGS(dyn->insts[ninst].x64.need_before&~X_PEND); } - if(box64_dynarec_test && (!box64_dynarec_test_end || (ip>=box64_dynarec_test_start && ip= BOX64ENV(dynarec_dump_range_start) && ip < BOX64ENV(dynarec_dump_range_end)))) { + dyn->need_dump = BOX64DRENV(dynarec_dump); + } + if(BOX64ENV(dynarec_test) && (!BOX64ENV(dynarec_test_end) || (ip>=BOX64ENV(dynarec_test_start) && ipneed_dump; + if (BOX64ENV(dynarec_test_nodump)) dyn->need_dump = 0; MESSAGE(LOG_DUMP, "TEST STEP ----\n"); + extcache_native_t save; + fpu_save_and_unwind(dyn, ninst, &save); fpu_reflectcache(dyn, ninst, x1, x2, x3); GO_TRACE(x64test_step, 1, x5); fpu_unreflectcache(dyn, ninst, x1, x2, x3); + fpu_unwind_restore(dyn, ninst, &save); MESSAGE(LOG_DUMP, "----------\n"); + dyn->need_dump = need_dump; } -#ifdef HAVE_TRACE - else if(my_context->dec && box64_dynarec_trace) { + #ifdef HAVE_TRACE + else if(my_context->dec && BOX64ENV(dynarec_trace)) { if((trace_end == 0) || ((ip >= trace_start) && (ip < trace_end))) { MESSAGE(LOG_DUMP, "TRACE ----\n"); @@ -141,43 +193,84 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int MESSAGE(LOG_DUMP, "----------\n"); } } -#endif + #endif - rep = 0; uint8_t pk = PK(0); - while((pk==0xF2) || (pk==0xF3) || (pk==0x3E) || (pk==0x26)) { - switch(pk) { - case 0xF2: rep = 1; break; - case 0xF3: rep = 2; break; - case 0x3E: - case 0x26: /* ignored */ break; + + rex.rex = 0; + rex.seg = 0; + rex.offset = 0; + rex.is32bits = is32bits; + rex.is66 = 0; + rex.is67 = 0; + rex.isf0 = 0; + rex.rep = 0; + while((pk==0xF2) || (pk==0xF3) || (pk==0xf0) + || (pk==0x3E) || (pk==0x26) || (pk==0x2e) || (pk==0x36) + || (pk==0x64) || (pk==0x65) || (pk==0x66) || (pk==0x67) + || (!is32bits && (pk>=0x40 && pk<=0x4f))) { + switch (pk) { + case 0xF0: rex.isf0 = 1; rex.rex = 0; break; + case 0xF2: rex.rep = 1; rex.rex = 0; break; + case 0xF3: rex.rep = 2; rex.rex = 0; break; + case 0x26: /* ES: */ + case 0x2E: /* CS: */ + case 0x36: /* SS; */ + case 0x3E: /* DS; */ + rex.seg = 0; rex.rex = 0; break; + case 0x64: rex.seg = _FS; rex.rex = 0; break; + case 0x65: rex.seg = _GS; rex.rex = 0; break; + case 0x66: rex.is66 = 1; rex.rex = 0; break; + case 0x67: rex.is67 = 1; rex.rex = 0; break; + case 0x40 ... 0x4F: rex.rex = pk; break; } ++addr; pk = PK(0); } - rex.rex = 0; - rex.is32bits = is32bits; - if(!rex.is32bits) - while(pk>=0x40 && pk<=0x4f) { - rex.rex = pk; - ++addr; - pk = PK(0); - } - - addr = dynarec64_00(dyn, addr, ip, ninst, rex, rep, &ok, &need_epilog); + if(rex.isf0) { + if(rex.is66 && !rex.w) + addr = dynarec64_66F0(dyn, addr, ip, ninst, rex, &ok, &need_epilog); + else + addr = dynarec64_F0(dyn, addr, ip, ninst, rex, &ok, &need_epilog); + } else if(rex.is66) + addr = dynarec64_66(dyn, addr, ip, ninst, rex, &ok, &need_epilog); + else + addr = dynarec64_00(dyn, addr, ip, ninst, rex, &ok, &need_epilog); if(dyn->abort) return ip; INST_EPILOG; + + #if STEP > 1 + if (is_opcode_volatile || dyn->insts[ninst].lock) + DMB_ISH(); + #endif + #ifdef ARM64 + if(dyn->insts[ninst].x64.has_next && dyn->insts[ninst+1].preload_xmmymm) { + doPreload(dyn, ninst+1); + } + #endif + fpu_reset_scratch(dyn); int next = ninst+1; #if STEP > 0 if(dyn->insts[ninst].x64.has_next && dyn->insts[next].x64.barrier) { if(dyn->insts[next].x64.barrier&BARRIER_FLOAT) { - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + #if defined (RV64) || defined(LA64) + uint8_t tmp1, tmp2, tmp3; + if(dyn->insts[next].nat_flags_fusion) get_free_scratch(dyn, next, &tmp1, &tmp2, &tmp3, x1, x2, x3, x4, x5); + else { tmp1=x1; tmp2=x2; tmp3=x3; } + fpu_purgecache(dyn, ninst, 0, tmp1, tmp2, tmp3); + #else + fpu_purgecache(dyn, ninst, 0, x1, x2, x3, 0); + #endif } if(dyn->insts[next].x64.barrier&BARRIER_FLAGS) { + #if defined(ARM64) || defined(LA64) + dyn->f = status_unk; + #else dyn->f.pending = 0; dyn->f.dfnone = 0; + #endif dyn->last_ip = 0; } } @@ -185,14 +278,25 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int #ifndef PROT_READ #define PROT_READ 1 #endif + #if STEP == 0 + if(dynarec_dirty && ok && is_addr_autosmc(ip)) { + // this is the last opcode, because it will write in current block if not stopped + ok = 0; + need_epilog = 1; + } + #endif #if STEP != 0 if(!ok && !need_epilog && (addr < (dyn->start+dyn->isize))) { ok = 1; // we use the 1st predecessor here if((ninst+1)size && !dyn->insts[ninst+1].x64.alive) { // reset fpu value... + #if defined(ARM64) || defined(LA64) + dyn->f = status_unk; + #else dyn->f.dfnone = 0; dyn->f.pending = 0; + #endif fpu_reset(dyn); while((ninst+1)size && !dyn->insts[ninst+1].x64.alive) { // may need to skip opcodes to advance @@ -218,16 +322,17 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int } #else // check if block need to be stopped, because it's a 00 00 opcode (unreadeable is already checked earlier) - if((ok>0) && !dyn->forward && !(*(uint8_t*)addr) && !(*(uint8_t*)(addr+1))) { - if(box64_dynarec_dump) dynarec_log(LOG_NONE, "Stopping block at %p reason: %s\n", (void*)addr, "Next opcode is 00 00"); + if((ok>0) && !dyn->forward && (!(getProtection(addr+3)&PROT_READ) || !(*(uint32_t*)addr))) { + if (dyn->need_dump) dynarec_log(LOG_NONE, "Stopping block at %p reason: %s\n", (void*)addr, "Next opcode is 00 00 00 00"); ok = 0; need_epilog = 1; + dyn->insts[ninst].x64.need_after |= X_PEND; } if(dyn->forward) { if(dyn->forward_to == addr && !need_epilog && ok>=0) { // we made it! reset_n = get_first_jump_addr(dyn, addr); - if(box64_dynarec_dump) dynarec_log(LOG_NONE, "Forward extend block for %d bytes %s%p -> %p (ninst %d - %d)\n", dyn->forward_to-dyn->forward, dyn->insts[dyn->forward_ninst].x64.has_callret?"(opt. call) ":"", (void*)dyn->forward, (void*)dyn->forward_to, reset_n, ninst); + if (dyn->need_dump) dynarec_log(LOG_NONE, "Forward extend block for %d bytes %s%p -> %p (ninst %d - %d)\n", dyn->forward_to - dyn->forward, dyn->insts[dyn->forward_ninst].x64.has_callret ? "(opt. call) " : "", (void*)dyn->forward, (void*)dyn->forward_to, reset_n, ninst); if(dyn->insts[dyn->forward_ninst].x64.has_callret && !dyn->insts[dyn->forward_ninst].x64.has_next) dyn->insts[dyn->forward_ninst].x64.has_next = 1; // this block actually continue dyn->forward = 0; @@ -237,7 +342,7 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int ok = 1; // in case it was 0 } else if ((dyn->forward_to < addr) || ok<=0) { // something when wrong! rollback - if(box64_dynarec_dump) dynarec_log(LOG_NONE, "Could not forward extend block for %d bytes %p -> %p\n", dyn->forward_to-dyn->forward, (void*)dyn->forward, (void*)dyn->forward_to); + if (dyn->need_dump) dynarec_log(LOG_NONE, "Could not forward extend block for %d bytes %p -> %p\n", dyn->forward_to - dyn->forward, (void*)dyn->forward, (void*)dyn->forward_to); ok = 0; dyn->size = dyn->forward_size; ninst = dyn->forward_ninst; @@ -248,12 +353,11 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int dyn->forward_ninst = 0; } // else just continue - } else if(!ok && !need_epilog && box64_dynarec_bigblock && (getProtection(addr+3)&~PROT_READ)) + } else if (!ok && !need_epilog && BOX64DRENV(dynarec_bigblock) && (getProtection(addr + 3) & ~PROT_READ)) if(*(uint32_t*)addr!=0) { // check if need to continue (but is next 4 bytes are 0, stop) uintptr_t next = get_closest_next(dyn, addr); if(next && ( - (((next-addr)<15) && is_nops(dyn, addr, next-addr)) - /*||(((next-addr)<30) && is_instructions(dyn, addr, next-addr))*/ )) + (((next-addr)<15) && is_nops(dyn, addr, next-addr)))) { ok = 1; if(dyn->insts[ninst].x64.has_callret && !dyn->insts[ninst].x64.has_next) { @@ -261,11 +365,11 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int } else { // need to find back that instruction to copy the caches, as previous version cannot be used anymore // and pred table is not ready yet - reset_n = get_first_jump(dyn, next); + reset_n = get_first_jump_addr(dyn, next); } - if(box64_dynarec_dump) dynarec_log(LOG_NONE, "Extend block %p, %s%p -> %p (ninst=%d, jump from %d)\n", dyn, dyn->insts[ninst].x64.has_callret?"(opt. call) ":"", (void*)addr, (void*)next, ninst+1, dyn->insts[ninst].x64.has_callret?ninst:reset_n); - } else if(next && (int)(next-addr)=stopblock*/) { - if(!((box64_dynarec_bigblockneed_dump) dynarec_log(LOG_NONE, "Extend block %p, %s%p -> %p (ninst=%d, jump from %d)\n", dyn, dyn->insts[ninst].x64.has_callret ? "(opt. call) " : "", (void*)addr, (void*)next, ninst + 1, dyn->insts[ninst].x64.has_callret ? ninst : reset_n); + } else if (next && (int)(next - addr) < BOX64ENV(dynarec_forward) && (getProtection(next) & PROT_READ) /*BOX64DRENV(dynarec_bigblock)>=stopblock*/) { + if (!((BOX64DRENV(dynarec_bigblock) < stopblock) && !isJumpTableDefault64((void*)next))) { if(dyn->forward) { if(nextforward_to) dyn->forward_to = next; @@ -308,14 +412,12 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int } if((ok>0) && dyn->insts[ninst].x64.has_callret) reset_n = -2; - if((ok>0) && reset_n==-1 && dyn->insts[ninst+1].purge_ymm) - PURGE_YMM(); + PURGE_YMM(); ++ninst; #if STEP == 0 memset(&dyn->insts[ninst], 0, sizeof(instruction_native_t)); - if((ok>0) && (((box64_dynarec_bigblock=box64_nodynarec_start && addr 0) && (((BOX64DRENV(dynarec_bigblock) < stopblock) && !isJumpTableDefault64((void*)addr)) || (addr >= BOX64ENV(nodynarec_start) && addr < BOX64ENV(nodynarec_end)))) +#else if((ok>0) && (ninst==dyn->size)) #endif { @@ -331,10 +433,8 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int dyn->forward_ninst = 0; } #endif - int j32; - MAYUSE(j32); MESSAGE(LOG_DEBUG, "Stopping block %p (%d / %d)\n",(void*)init_addr, ninst, dyn->size); - if(!box64_dynarec_dump && addr>=box64_nodynarec_start && addrneed_dump && addr >= BOX64ENV(nodynarec_start) && addr < BOX64ENV(nodynarec_end)) dynarec_log(LOG_INFO, "Stopping block in no-dynarec zone\n"); --ninst; if(!dyn->insts[ninst].x64.barrier) { @@ -345,14 +445,22 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr, int alternate, int #endif ++ninst; NOTEST(x3); + #if defined (RV64) || defined(LA64) fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + #else + fpu_purgecache(dyn, ninst, 0, x1, x2, x3, 0); + #endif jump_to_next(dyn, addr, 0, ninst, rex.is32bits); ok=0; need_epilog=0; } } if(need_epilog) { NOTEST(x3); + #if defined (RV64) || defined(LA64) fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + #else + fpu_purgecache(dyn, ninst, 0, x1, x2, x3, 0); + #endif jump_to_epilog(dyn, ip, 0, ninst); // no linker here, it's an unknown instruction } FINI; diff --git a/src/dynarec/dynarec_next.h b/src/dynarec/dynarec_next.h index 9c3411d..301ec4a 100644 --- a/src/dynarec/dynarec_next.h +++ b/src/dynarec/dynarec_next.h @@ -12,16 +12,20 @@ void arm64_epilog(void) EXPORTDYN; void la64_next(void) EXPORTDYN; void la64_prolog(x64emu_t* emu, void* addr) EXPORTDYN; void la64_epilog(void) EXPORTDYN; +void la64_epilog_fast(void) EXPORTDYN; #define native_next la64_next #define native_prolog la64_prolog #define native_epilog la64_epilog +#define native_epilog_fast la64_epilog_fast #elif defined(RV64) void rv64_next(void) EXPORTDYN; void rv64_prolog(x64emu_t* emu, void* addr) EXPORTDYN; void rv64_epilog(void) EXPORTDYN; +void rv64_epilog_fast(void) EXPORTDYN; #define native_next rv64_next #define native_prolog rv64_prolog #define native_epilog rv64_epilog +#define native_epilog_fast rv64_epilog_fast #else #error Unsupported architecture #endif diff --git a/src/dynarec/dynarec_private.h b/src/dynarec/dynarec_private.h index 682f267..9e3c55b 100644 --- a/src/dynarec/dynarec_private.h +++ b/src/dynarec/dynarec_private.h @@ -29,6 +29,9 @@ #define SF_NODF 16 #define SF_SET_NODF (SF_SET|SF_NODF) +#define NAT_FLAGS_FUSION 0 +#define NAT_FLAGS_NOFUSION 1 + typedef struct instruction_x64_s { uintptr_t addr; //address of the instruction int32_t size; // size of the instruction @@ -36,10 +39,10 @@ typedef struct instruction_x64_s { int jmp_insts; // instuction to jump to (-1 if out of the block) uint8_t jmp_cond:1; // 1 of conditionnal jump uint8_t has_next:1; // does this opcode can continue to the next? - uint8_t has_callret:1; // this instruction have an optimised call setup + uint8_t has_callret:1; // this instruction have an optimized call setup uint8_t alive:1; // this opcode gets executed (0 if dead code in that block) + uint8_t self_loop:1; // this is a landing address for a self-loop (loop on itslef with no exit) uint8_t barrier; // next instruction is a jump point, so no optim allowed - uint8_t barrier_next; // next instruction needs a barrier uint8_t state_flags;// One of SF_XXX state uint8_t use_flags; // 0 or combination of X_?F uint8_t set_flags; // 0 or combination of X_?F @@ -49,6 +52,4 @@ typedef struct instruction_x64_s { uint8_t need_after; // calculated } instruction_x64_t; -void printf_x64_instruction(zydis_dec_t* dec, instruction_x64_t* inst, const char* name); - #endif //__DYNAREC_PRIVATE_H_ diff --git a/src/dynarec/la64/dynarec_la64_00.c b/src/dynarec/la64/dynarec_la64_00.c index e790492..ef92fff 100644 --- a/src/dynarec/la64/dynarec_la64_00.c +++ b/src/dynarec/la64/dynarec_la64_00.c @@ -2,15 +2,15 @@ #include #include #include -#include +#include "la64_mapping.h" +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "la64_emitter.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,28 +19,31 @@ #include "x64trace.h" #include "dynarec_native.h" #include "custommem.h" +#include "alternate.h" #include "la64_printer.h" #include "dynarec_la64_private.h" #include "dynarec_la64_functions.h" -#include "dynarec_la64_helper.h" +#include "../dynarec_helper.h" int isSimpleWrapper(wrapper_t fun); int isRetX87Wrapper(wrapper_t fun); -uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { uint8_t nextop, opcode; - uint8_t gd, ed; + uint8_t gd, ed, tmp1, tmp2, tmp3; int8_t i8; int32_t i32, tmp; int64_t i64, j64; uint8_t u8; uint8_t gb1, gb2, eb1, eb2; + uint16_t u16; uint32_t u32; uint64_t u64; uint8_t wback, wb1, wb2, wb; int64_t fixedaddress; + uint8_t v0, v1, v2; int unscaled; int lock; int cacheupd = 0; @@ -56,16 +59,15 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni switch (opcode) { case 0x00: INST_NAME("ADD Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_add8(dyn, ninst, x1, x2, x4, x5); + GETGBEB(x1, x2, 0); + emit_add8(dyn, ninst, ed, gd, x4, x5); EBBACK(); break; case 0x01: INST_NAME("ADD Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -74,16 +76,15 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x02: INST_NAME("ADD Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_add8(dyn, ninst, x2, x1, x4, x5); + GETGBEB(x1, x2, 0); + emit_add8(dyn, ninst, gd, ed, x4, x5); GBBACK(); break; case 0x03: INST_NAME("ADD Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -91,7 +92,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x04: INST_NAME("ADD AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); emit_add8c(dyn, ninst, x1, u8, x3, x4, x5); @@ -99,22 +100,59 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x05: INST_NAME("ADD EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; emit_add32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5, x6); break; + case 0x06: + if (rex.is32bits) { + INST_NAME("PUSH ES"); + LD_HU(x1, xEmu, offsetof(x64emu_t, segs[_ES])); + PUSH1_32(x1); + } else { + INST_NAME("Illegal 06"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; + case 0x07: + if (rex.is32bits) { + INST_NAME("POP ES"); + POP1_32(x1); + ST_H(x1, xEmu, offsetof(x64emu_t, segs[_ES])); + } else { + INST_NAME("Illegal 07"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_FUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; case 0x08: INST_NAME("OR Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_or8(dyn, ninst, x1, x2, x4, x5); + GETGBEB(x1, x2, 0); + emit_or8(dyn, ninst, ed, gd, x4, x5); EBBACK(); break; case 0x09: INST_NAME("OR Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -123,16 +161,15 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x0A: INST_NAME("OR Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_or8(dyn, ninst, x2, x1, x4, x5); + GETGBEB(x1, x2, 0); + emit_or8(dyn, ninst, gd, ed, x4, x5); GBBACK(); break; case 0x0B: INST_NAME("OR Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -140,7 +177,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x0C: INST_NAME("OR AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); emit_or8c(dyn, ninst, x1, u8, x3, x4, x5); @@ -148,15 +185,32 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x0D: INST_NAME("OR EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; emit_or32c(dyn, ninst, rex, xRAX, i64, x3, x4); break; + case 0x0E: + if (rex.is32bits) { + INST_NAME("PUSH CS"); + LD_HU(x1, xEmu, offsetof(x64emu_t, segs[_CS])); + PUSH1_32(x1); + SMWRITE(); + } else { + INST_NAME("Illegal 0E"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; case 0x0F: - switch (rep) { - case 0: - addr = dynarec64_0F(dyn, addr, ip, ninst, rex, ok, need_epilog); - break; + switch (rex.rep) { case 1: addr = dynarec64_F20F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; @@ -164,52 +218,135 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni addr = dynarec64_F30F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; default: - DEFAULT; + addr = dynarec64_0F(dyn, addr, ip, ninst, rex, ok, need_epilog); } break; + case 0x10: + INST_NAME("ADC Eb, Gb"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + GETGBEB(x1, x2, 0); + emit_adc8(dyn, ninst, ed, gd, x4, x5, x6); + EBBACK(); + break; case 0x11: INST_NAME("ADC Ed, Gd"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); emit_adc32(dyn, ninst, rex, ed, gd, x3, x4, x5, x6); WBACK; break; + case 0x12: + INST_NAME("ADC Gb, Eb"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + GETGBEB(x1, x2, 0); + emit_adc8(dyn, ninst, gd, ed, x4, x6, x5); + GBBACK(); + break; case 0x13: INST_NAME("ADC Gd, Ed"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); emit_adc32(dyn, ninst, rex, gd, ed, x3, x4, x5, x6); break; + case 0x14: + INST_NAME("ADC AL, Ib"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + u8 = F8; + ANDI(x1, xRAX, 0xff); + emit_adc8c(dyn, ninst, x1, u8, x3, x4, x5, x6); + BSTRINS_D(xRAX, x1, 7, 0); + break; + case 0x15: + INST_NAME("ADC EAX, Id"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + i64 = F32S; + MOV64xw(x1, i64); + emit_adc32(dyn, ninst, rex, xRAX, x1, x3, x4, x5, x6); + break; + case 0x16: + if (rex.is32bits) { + INST_NAME("PUSH SS"); + LD_HU(x1, xEmu, offsetof(x64emu_t, segs[_SS])); + PUSH1_32(x1); + SMWRITE(); + } else { + INST_NAME("Illegal 16"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; + case 0x17: + if (rex.is32bits) { + INST_NAME("POP SS"); + SMREAD(); + POP1_32(x1); + ST_H(x1, xEmu, offsetof(x64emu_t, segs[_SS])); + } else { + INST_NAME("Illegal 17"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; case 0x18: INST_NAME("SBB Eb, Gb"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_sbb8(dyn, ninst, x1, x2, x4, x5, x6); + GETGBEB(x1, x2, 0); + emit_sbb8(dyn, ninst, ed, gd, x4, x5, x6); EBBACK(); break; case 0x19: INST_NAME("SBB Ed, Gd"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); emit_sbb32(dyn, ninst, rex, ed, gd, x3, x4, x5); WBACK; break; + case 0x1A: + INST_NAME("SBB Gb, Eb"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + GETGBEB(x1, x2, 0); + emit_sbb8(dyn, ninst, gd, ed, x6, x4, x5); + GBBACK(); + break; case 0x1B: INST_NAME("SBB Gd, Ed"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -218,24 +355,71 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x1C: INST_NAME("SBB AL, Ib"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); emit_sbb8c(dyn, ninst, x1, u8, x3, x4, x5, x6); BSTRINS_D(xRAX, x1, 7, 0); break; + case 0x1D: + INST_NAME("SBB EAX, Id"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + i64 = F32S; + MOV64xw(x2, i64); + emit_sbb32(dyn, ninst, rex, xRAX, x2, x3, x4, x5); + break; + case 0x1E: + if (rex.is32bits) { + INST_NAME("PUSH DS"); + LD_HU(x1, xEmu, offsetof(x64emu_t, segs[_DS])); + PUSH1_32(x1); + SMWRITE(); + } else { + INST_NAME("Illegal 1E"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; + case 0x1F: + if (rex.is32bits) { + INST_NAME("POP DS"); + SMREAD(); + POP1_32(x1); + ST_H(x1, xEmu, offsetof(x64emu_t, segs[_DS])); + } else { + INST_NAME("Illegal 1F"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; case 0x20: INST_NAME("AND Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_and8(dyn, ninst, x1, x2, x4, x5); + GETGBEB(x1, x2, 0); + emit_and8(dyn, ninst, ed, gd, x4, x5); EBBACK(); break; case 0x21: INST_NAME("AND Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -244,16 +428,15 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x22: INST_NAME("AND Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_and8(dyn, ninst, x2, x1, x4, x5); + GETGBEB(x1, x2, 0); + emit_and8(dyn, ninst, gd, ed, x4, x5); GBBACK(); break; case 0x23: INST_NAME("AND Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -261,7 +444,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x24: INST_NAME("AND AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); emit_and8c(dyn, ninst, x1, u8, x3, x4); @@ -269,22 +452,21 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x25: INST_NAME("AND EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; emit_and32c(dyn, ninst, rex, xRAX, i64, x3, x4); break; case 0x28: INST_NAME("SUB Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_sub8(dyn, ninst, x1, x2, x4, x5, x6); + GETGBEB(x1, x2, 0); + emit_sub8(dyn, ninst, ed, gd, x4, x5, x6); EBBACK(); break; case 0x29: INST_NAME("SUB Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -293,16 +475,15 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x2A: INST_NAME("SUB Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_sub8(dyn, ninst, x2, x1, x4, x5, x6); + GETGBEB(x1, x2, 0); + emit_sub8(dyn, ninst, gd, ed, x4, x5, x6); GBBACK(); break; case 0x2B: INST_NAME("SUB Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -310,7 +491,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x2C: INST_NAME("SUB AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); emit_sub8c(dyn, ninst, x1, u8, x2, x3, x4, x5); @@ -318,22 +499,24 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x2D: INST_NAME("SUB EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; emit_sub32c(dyn, ninst, rex, xRAX, i64, x2, x3, x4, x5); break; + case 0x2E: + INST_NAME("CS:"); + break; case 0x30: INST_NAME("XOR Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_xor8(dyn, ninst, x1, x2, x4, x5); + GETGBEB(x1, x2, 0); + emit_xor8(dyn, ninst, ed, gd, x4, x5); EBBACK(); break; case 0x31: INST_NAME("XOR Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -344,16 +527,15 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x32: INST_NAME("XOR Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_xor8(dyn, ninst, x2, x1, x4, x5); + GETGBEB(x1, x2, 0); + emit_xor8(dyn, ninst, gd, ed, x4, x5); GBBACK(); break; case 0x33: INST_NAME("XOR Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -361,7 +543,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x34: INST_NAME("XOR AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); emit_xor8c(dyn, ninst, x1, u8, x3, x4); @@ -369,21 +551,23 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x35: INST_NAME("XOR EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; emit_xor32c(dyn, ninst, rex, xRAX, i64, x3, x4); break; + case 0x36: + INST_NAME("SS:"); + break; case 0x38: INST_NAME("CMP Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6); + GETGBEB(x1, x2, 0); + emit_cmp8(dyn, ninst, ed, gd, x3, x4, x5, x6); break; case 0x39: INST_NAME("CMP Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -391,7 +575,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x3B: INST_NAME("CMP Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -399,15 +583,14 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x3A: INST_NAME("CMP Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEB(x1, 0); - GETGB(x2); - emit_cmp8(dyn, ninst, x2, x1, x3, x4, x5, x6); + GETGBEB(x1, x2, 0); + emit_cmp8(dyn, ninst, gd, ed, x3, x4, x5, x6); break; case 0x3C: INST_NAME("CMP AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); if (u8) { @@ -419,13 +602,39 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x3D: INST_NAME("CMP EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; - if(i64) { - MOV64xw(x2, i64); + if (i64) { + MOV64x(x2, i64); emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5, x6); } else - emit_cmp32_0(dyn, ninst, rex, xRAX, x3, x4); + emit_cmp32_0(dyn, ninst, rex, 0xC0 /* fake nextop */, xRAX, x3, x4, x5); + break; + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + INST_NAME("INC Reg (32bits)"); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + gd = TO_NAT(opcode & 7); + emit_inc32(dyn, ninst, rex, gd, x1, x2, x3, x4); + break; + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + INST_NAME("DEC Reg (32bits)"); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + gd = TO_NAT(opcode & 7); + emit_dec32(dyn, ninst, rex, gd, x1, x2, x3, x4); break; case 0x50: case 0x51: @@ -436,8 +645,10 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x56: case 0x57: INST_NAME("PUSH reg"); - gd = TO_LA64((opcode & 0x07) + (rex.b << 3)); + SCRATCH_USAGE(0); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); PUSH1z(gd); + SMWRITE(); break; case 0x58: case 0x59: @@ -448,9 +659,80 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x5E: case 0x5F: INST_NAME("POP reg"); - gd = TO_LA64((opcode & 0x07) + (rex.b << 3)); + SCRATCH_USAGE(0); + SMREAD(); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); POP1z(gd); break; + case 0x60: + if (rex.is32bits) { + INST_NAME("PUSHAD"); + MV(x1, xRSP); + PUSH1_32(xRAX); + PUSH1_32(xRCX); + PUSH1_32(xRDX); + PUSH1_32(xRBX); + PUSH1_32(x1); + PUSH1_32(xRBP); + PUSH1_32(xRSI); + PUSH1_32(xRDI); + SMWRITE(); + } else { + INST_NAME("Illegal 60"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; + case 0x61: + if (rex.is32bits) { + INST_NAME("POPAD"); + SMREAD(); + POP1_32(xRDI); + POP1_32(xRSI); + POP1_32(xRBP); + POP1_32(x1); + POP1_32(xRBX); + POP1_32(xRDX); + POP1_32(xRCX); + POP1_32(xRAX); + } else { + INST_NAME("Illegal 61"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; + case 0x62: + if (rex.is32bits) { + // BOUND here + DEFAULT; + } else { + INST_NAME("Illegal 62"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + UDF(); + *need_epilog = 1; + *ok = 0; + } break; case 0x63: if (rex.is32bits) { @@ -460,9 +742,10 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOVSXD Gd, Ed"); nextop = F8; GETGD; + SCRATCH_USAGE(0); if (rex.w) { if (MODREG) { // reg <= reg - ADDI_W(gd, TO_LA64((nextop & 7) + (rex.b << 3)), 0); + ADDI_W(gd, TO_NAT((nextop & 7) + (rex.b << 3)), 0); } else { // mem <= reg SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); @@ -470,7 +753,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } } else { if (MODREG) { // reg <= reg - AND(gd, TO_LA64((nextop & 7) + (rex.b << 3)), xMASK); + ZEROUP2(gd, TO_NAT((nextop & 7) + (rex.b << 3))); } else { // mem <= reg SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); @@ -479,155 +762,229 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } } break; - case 0x64: - addr = dynarec64_64(dyn, addr, ip, ninst, rex, rep, _FS, ok, need_epilog); - break; - case 0x65: - addr = dynarec64_64(dyn, addr, ip, ninst, rex, rep, _GS, ok, need_epilog); - break; - case 0x66: - addr = dynarec64_66(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); - break; - case 0x67: - if (rex.is32bits) { - DEFAULT; - } else - addr = dynarec64_67(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); - break; case 0x68: INST_NAME("PUSH Id"); i64 = F32S; - if(PK(0)==0xC3) { + if (PK(0) == 0xC3) { MESSAGE(LOG_DUMP, "PUSH then RET, using indirect\n"); - TABLE64(x3, addr-4); + TABLE64(x3, addr - 4); LD_W(x1, x3, 0); PUSH1z(x1); } else { - MOV64z(x3, i64); - PUSH1z(x3); + if (!i64) { + PUSH1z(xZR); + } else { + MOV64z(x3, i64); + PUSH1z(x3); + } + SMWRITE(); } break; case 0x69: INST_NAME("IMUL Gd, Ed, Id"); - SETFLAGS(X_ALL, SF_PENDING); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); nextop = F8; GETGD; GETED(4); i64 = F32S; MOV64xw(x4, i64); + CLEAR_FLAGS(x3); if (rex.w) { - // 64bits imul UFLAG_IF { MULH_D(x3, ed, x4); MUL_D(gd, ed, x4); - UFLAG_OP1(x3); - UFLAG_RES(gd); - UFLAG_DF(x3, d_imul64); + SET_DFNONE(); + IFX (X_CF | X_OF) { + SRAI_D(x4, gd, 63); + XOR(x3, x3, x4); + SNEZ(x3, x3); + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); + } } else { - MULxw(gd, ed, x4); + MUL_D(gd, ed, x4); } } else { - // 32bits imul UFLAG_IF { SLLI_W(x3, ed, 0); - MUL_D(gd, x3, x4); - UFLAG_RES(gd); - SRLI_D(x3, gd, 32); - UFLAG_OP1(x3); - UFLAG_DF(x3, d_imul32); + MUL_D(x5, x3, x4); + SRLI_D(x3, x5, 32); + SLLI_W(gd, x5, 0); + SET_DFNONE(); + IFX (X_CF | X_OF) { + XOR(x3, gd, x5); + SNEZ(x3, x3); + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); + } } else { - MULxw(gd, ed, x4); + MUL_W(gd, ed, x4); } ZEROUP(gd); } + IFX (X_SF) { + SRLI_D(x3, gd, rex.w ? 63 : 31); + BSTRINS_D(xFlags, x3, F_SF, F_SF); + } + IFX (X_PF) emit_pf(dyn, ninst, gd, x3, x4); + IFX (X_ALL) SPILL_EFLAGS(); break; case 0x6A: INST_NAME("PUSH Ib"); i64 = F8S; - MOV64z(x3, i64); - PUSH1z(x3); + if (!i64) { + PUSH1z(xZR); + } else { + MOV64z(x3, i64); + PUSH1z(x3); + } + SMWRITE(); break; case 0x6B: INST_NAME("IMUL Gd, Ed, Ib"); - SETFLAGS(X_ALL, SF_PENDING); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); nextop = F8; GETGD; GETED(1); i64 = F8S; - MOV64xw(x4, i64); + MOV64x(x4, i64); + CLEAR_FLAGS(x3); if (rex.w) { - // 64bits imul UFLAG_IF { MULH_D(x3, ed, x4); MUL_D(gd, ed, x4); - UFLAG_OP1(x3); - UFLAG_RES(gd); - UFLAG_DF(x3, d_imul64); + SET_DFNONE(); + IFX (X_CF | X_OF) { + SRAI_D(x4, gd, 63); + XOR(x3, x3, x4); + SNEZ(x3, x3); + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); + } } else { MUL_D(gd, ed, x4); } } else { - // 32bits imul UFLAG_IF { SLLI_W(x3, ed, 0); - MUL_D(gd, x3, x4); - UFLAG_RES(gd); - SRLI_D(x3, gd, 32); - UFLAG_OP1(x3); - UFLAG_DF(x3, d_imul32); + MUL_D(x5, x3, x4); + SRLI_D(x3, x5, 32); + SLLI_W(gd, x5, 0); + SET_DFNONE(); + IFX (X_CF | X_OF) { + XOR(x3, gd, x5); + SNEZ(x3, x3); + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); + } } else { MUL_W(gd, ed, x4); } ZEROUP(gd); } + IFX (X_SF) { + SRLI_D(x3, gd, rex.w ? 63 : 31); + BSTRINS_D(xFlags, x3, F_SF, F_SF); + } + IFX (X_PF) emit_pf(dyn, ninst, gd, x3, x4); + IFX (X_ALL) SPILL_EFLAGS(); break; - - #define GO(GETFLAGS, NO, YES, F, I) \ - if (box64_dynarec_test == 2) { NOTEST(x1); } \ - READFLAGS(F); \ - i8 = F8S; \ - BARRIER(BARRIER_MAYBE); \ - JUMP(addr + i8, 1); \ - if (la64_lbt) { \ - X64_SETJ(x1, I); \ - } else { \ - GETFLAGS; \ - } \ - if (dyn->insts[ninst].x64.jmp_insts == -1 || CHECK_CACHE()) { \ - /* out of block */ \ - i32 = dyn->insts[ninst].epilog - (dyn->native_size); \ - if (la64_lbt) \ - BEQZ_safe(x1, i32); \ - else \ - B##NO##_safe(x1, i32); \ - if (dyn->insts[ninst].x64.jmp_insts == -1) { \ - if (!(dyn->insts[ninst].x64.barrier & BARRIER_FLOAT)) \ - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ - jump_to_next(dyn, addr + i8, 0, ninst, rex.is32bits); \ - } else { \ - CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ - B(i32); \ - } \ - } else { \ - /* inside the block */ \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ - if (la64_lbt) \ - BNEZ_safe(x1, i32); \ - else \ - B##YES##_safe(x1, i32); \ + case 0x6C: + case 0x6D: + INST_NAME(opcode == 0x6C ? "INSB" : "INSD"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_priv, -1, 0, 0); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + break; + case 0x6E: + case 0x6F: + INST_NAME(opcode == 0x6C ? "OUTSB" : "OUTSD"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state } + GETIP(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_priv, -1, 0, 0); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + break; + +#define GO(GETFLAGS, NO, YES, NATNO, NATYES, F, I) \ + READFLAGS_FUSION(F, x1, x2, x3, x4, x5); \ + i8 = F8S; \ + JUMP(addr + i8, 1); \ + if (!dyn->insts[ninst].nat_flags_fusion) { \ + if (cpuext.lbt) { \ + X64_SETJ(tmp1, I); \ + } else { \ + GETFLAGS; \ + } \ + } \ + if (dyn->insts[ninst].x64.jmp_insts == -1 || CHECK_CACHE()) { \ + /* out of block */ \ + i32 = dyn->insts[ninst].epilog - (dyn->native_size); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP_safe(NATNO, i32); \ + } else { \ + if (cpuext.lbt) \ + BEQZ_safe(tmp1, i32); \ + else \ + B##NO##_safe(tmp1, i32); \ + } \ + if (dyn->insts[ninst].x64.jmp_insts == -1) { \ + if (!(dyn->insts[ninst].x64.barrier & BARRIER_FLOAT)) \ + fpu_purgecache(dyn, ninst, 1, tmp1, tmp2, tmp3); \ + jump_to_next(dyn, addr + i8, 0, ninst, rex.is32bits); \ + } else { \ + CacheTransform(dyn, ninst, cacheupd, tmp1, tmp2, tmp3); \ + i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ + B(i32); \ + } \ + } else { \ + /* inside the block */ \ + i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP_safe(NATYES, i32); \ + } else { \ + if (cpuext.lbt) \ + BNEZ_safe(tmp1, i32); \ + else \ + B##YES##_safe(tmp1, i32); \ + } \ + } GOCOND(0x70, "J", "ib"); - #undef GO +#undef GO + case 0x82: + if (!rex.is32bits) { + INST_NAME("Invalid 82"); + UDF(); + *need_epilog = 1; + *ok = 0; + return addr; + } + // fallthru case 0x80: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: // ADD INST_NAME("ADD Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; emit_add8c(dyn, ninst, x1, u8, x2, x4, x5); @@ -635,16 +992,25 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 1: // OR INST_NAME("OR Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; emit_or8c(dyn, ninst, x1, u8, x2, x4, x5); EBBACK(); break; + case 2: // ADC + INST_NAME("ADC Eb, Ib"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEB(x1, 1); + u8 = F8; + emit_adc8c(dyn, ninst, x1, u8, x2, x4, x5, x6); + EBBACK(); + break; case 3: // SBB INST_NAME("SBB Eb, Ib"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; emit_sbb8c(dyn, ninst, x1, u8, x2, x4, x5, x6); @@ -652,7 +1018,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 4: // AND INST_NAME("AND Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; emit_and8c(dyn, ninst, x1, u8, x2, x4); @@ -660,7 +1026,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 5: // SUB INST_NAME("SUB Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; emit_sub8c(dyn, ninst, x1, u8, x2, x4, x5, x6); @@ -668,7 +1034,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 6: // XOR INST_NAME("XOR Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; emit_xor8c(dyn, ninst, x1, u8, x2, x4); @@ -676,10 +1042,10 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 7: // CMP INST_NAME("CMP Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; - if(u8) { + if (u8) { ADDI_D(x2, xZR, u8); emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6); } else { @@ -700,9 +1066,12 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { INST_NAME("ADD Ed, Ib"); } - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED((opcode == 0x81) ? 4 : 1); - if (opcode == 0x81) i64 = F32S; else i64 = F8S; + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6); WBACK; break; @@ -712,9 +1081,12 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { INST_NAME("OR Ed, Ib"); } - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED((opcode == 0x81) ? 4 : 1); - if (opcode == 0x81) i64 = F32S; else i64 = F8S; + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; emit_or32c(dyn, ninst, rex, ed, i64, x3, x4); WBACK; break; @@ -725,26 +1097,14 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("ADC Ed, Ib"); } READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED((opcode == 0x81) ? 4 : 1); if (opcode == 0x81) i64 = F32S; else i64 = F8S; MOV64xw(x5, i64); - emit_adc32(dyn, ninst, rex, ed, x5, x3, x4, x6, x1); - WBACK; - break; - case 4: // AND - if (opcode == 0x81) { - INST_NAME("AND Ed, Id"); - } else { - INST_NAME("AND Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED((opcode == 0x81) ? 4 : 1); - if (opcode == 0x81) i64 = F32S; else i64 = F8S; - emit_and32c(dyn, ninst, rex, ed, i64, x3, x4); + emit_adc32(dyn, ninst, rex, ed, x5, x3, x4, x6, x7); WBACK; break; case 3: // SBB @@ -754,7 +1114,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("SBB Ed, Ib"); } READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED((opcode == 0x81) ? 4 : 1); if (opcode == 0x81) i64 = F32S; @@ -764,13 +1124,28 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4, x6); WBACK; break; + case 4: // AND + if (opcode == 0x81) { + INST_NAME("AND Ed, Id"); + } else { + INST_NAME("AND Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED((opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; + emit_and32c(dyn, ninst, rex, ed, i64, x3, x4); + WBACK; + break; case 5: // SUB if (opcode == 0x81) { INST_NAME("SUB Ed, Id"); } else { INST_NAME("SUB Ed, Ib"); } - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED((opcode == 0x81) ? 4 : 1); if (opcode == 0x81) i64 = F32S; @@ -785,7 +1160,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { INST_NAME("XOR Ed, Ib"); } - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED((opcode == 0x81) ? 4 : 1); if (opcode == 0x81) i64 = F32S; @@ -800,35 +1175,30 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { INST_NAME("CMP Ed, Ib"); } - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED((opcode == 0x81) ? 4 : 1); - if (opcode == 0x81) i64 = F32S; else i64 = F8S; + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; if (i64) { - MOV64xw(x2, i64); + MOV64x(x2, i64); emit_cmp32(dyn, ninst, rex, ed, x2, x3, x4, x5, x6); - } else { - if (!rex.w && MODREG) { - AND(x1, ed, xMASK); - ed = x1; - } - emit_cmp32_0(dyn, ninst, rex, ed, x3, x4); - } + } else + emit_cmp32_0(dyn, ninst, rex, nextop, ed, x3, x4, x5); break; - default: - DEFAULT; } break; case 0x84: INST_NAME("TEST Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop=F8; - GETEB(x1, 0); - GETGB(x2); - emit_test8(dyn, ninst, x1, x2, x3, x4, x5); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + GETGBEB(x1, x2, 0); + emit_test8(dyn, ninst, ed, gd, x3, x4, x5); break; case 0x85: INST_NAME("TEST Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -845,10 +1215,10 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { GETGB(x3); addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - if (la64_lam_bh) + if (cpuext.lam_bh) { AMSWAP_DB_B(x1, gd, ed); - else { - SMDMB(); + BSTRINS_D(gb1, x1, gb2 + 7, gb2); + } else { // calculate shift amount ANDI(x1, ed, 0x3); @@ -858,32 +1228,25 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni ADDI_D(x4, xZR, 0xffc); AND(x6, ed, x4); - // load aligned data - LD_WU(x5, x6, 0); - - // insert gd byte into the aligned data + // prepare mask ADDI_D(x4, xZR, 0xff); SLL_D(x4, x4, x1); NOR(x4, x4, xZR); - AND(x4, x5, x4); - SLL_D(x5, gd, x1); - OR(x4, x4, x5); - // do aligned ll/sc sequence + SLL_D(x7, gd, x1); + + // do aligned ll/sc sequence, reusing x2 (ed might be x2 but is no longer needed) MARKLOCK; - LL_W(x1, x6, 0); - MV(x5, x4); + LL_W(x2, x6, 0); + AND(x5, x2, x4); + OR(x5, x5, x7); SC_W(x5, x6, 0); BEQZ_MARKLOCK(x5); - // calculate shift amount again - ANDI(x4, ed, 0x3); - SLLI_D(x4, x4, 3); - // extract loaded byte - SRL_D(x1, x1, x4); + SRL_D(gd, x2, x1); + BSTRINS_D(gb1, gd, gb2 + 7, gb2); } - BSTRINS_D(gb1, x1, gb2 + 7, gb2); } break; case 0x87: @@ -897,21 +1260,40 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MVxw(ed, x1); } else { GETGD; - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - SMDMB(); - ANDI(x3, ed, (1 << (2 + rex.w)) - 1); - BNEZ_MARK(x3); - MARKLOCK; - LLxw(x1, ed, 0); - MVxw(x3, gd); - SCxw(x3, ed, 0); - BEQZ_MARKLOCK(x3); - B_MARK2_nocond; - MARK; - LDxw(x1, ed, 0); - SDxw(gd, ed, 0); - MARK2; - SMDMB(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + /* LoongArch Reference Manual Vol1 2.2.7.1 + If the AM* atomic memory access instruction has the same register number as rd and rk, + the execution result is uncertain. Please software to avoid this situation. + */ + AMSWAP_DB_D(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMSWAP_DB_W(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(ADDI_W(x4, gd, 0), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(ADDI_D(x4, gd, 0), x1, wback, x4, x5, x6); + MARK3; + } MVxw(gd, x1); } break; @@ -921,10 +1303,10 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni gd = ((nextop & 0x38) >> 3) + (rex.r << 3); if (rex.rex) { gb2 = 0; - gb1 = TO_LA64(gd); + gb1 = TO_NAT(gd); } else { gb2 = ((gd & 4) << 1); - gb1 = TO_LA64(gd & 3); + gb1 = TO_NAT(gd & 3); } if (gb2) { gd = x4; @@ -935,10 +1317,10 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni if (MODREG) { ed = (nextop & 7) + (rex.b << 3); if (rex.rex) { - eb1 = TO_LA64(ed); + eb1 = TO_NAT(ed); eb2 = 0; } else { - eb1 = TO_LA64(ed & 3); // Ax, Cx, Dx or Bx + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx eb2 = ((ed & 4) >> 2); // L or H } BSTRINS_D(eb1, gd, eb2 * 8 + 7, eb2 * 8); @@ -952,10 +1334,15 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOV Ed, Gd"); nextop = F8; GETGD; + SCRATCH_USAGE(0); if (MODREG) { // reg <= reg - MVxw(TO_LA64((nextop & 7) + (rex.b << 3)), gd); + MVxw(TO_NAT((nextop & 7) + (rex.b << 3)), gd); } else { // mem <= reg addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); + if(!lock && BOX64ENV(unity) && !VolatileRangesContains(ip) && ((fixedaddress==0x80) || (fixedaddress==0x84) || (fixedaddress==0xc0) || (fixedaddress==0xc4))) { + DMB_ISH(); + lock = 1; + } if (rex.w) { ST_D(gd, ed, fixedaddress); } else { @@ -968,21 +1355,21 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOV Gb, Eb"); nextop = F8; if (rex.rex) { - gb1 = gd = TO_LA64(((nextop & 0x38) >> 3) + (rex.r << 3)); + gb1 = gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); gb2 = 0; } else { gd = (nextop & 0x38) >> 3; - gb1 = TO_LA64(gd & 3); + gb1 = TO_NAT(gd & 3); gb2 = ((gd & 4) << 1); } if (MODREG) { if (rex.rex) { - wback = TO_LA64((nextop & 7) + (rex.b << 3)); + wback = TO_NAT((nextop & 7) + (rex.b << 3)); wb2 = 0; } else { wback = (nextop & 7); wb2 = (wback >> 2); - wback = TO_LA64(wback & 3); + wback = TO_NAT(wback & 3); } if (wb2) { BSTRPICK_D(x4, wback, 7 + wb2 * 8, wb2 * 8); @@ -1002,28 +1389,121 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOV Gd, Ed"); nextop = F8; GETGD; + SCRATCH_USAGE(0); if (MODREG) { - MVxw(gd, TO_LA64((nextop & 7) + (rex.b << 3))); + MVxw(gd, TO_NAT((nextop & 7) + (rex.b << 3))); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); + if(!lock && BOX64ENV(unity) && !VolatileRangesContains(ip) && ((fixedaddress==0x80) || (fixedaddress==0x84) || (fixedaddress==0xc0) || (fixedaddress==0xc4))) { + lock = 1; + } SMREADLOCK(lock); LDxw(gd, ed, fixedaddress); } break; + case 0x8C: + nextop = F8; + u8 = (nextop & 38) >> 3; + if (u8 > 5) { + INST_NAME("Invalid MOV Ed, Seg"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("MOV Ed, Seg"); + if (MODREG) { + SCRATCH_USAGE(0); + gd = TO_NAT((nextop & 7) + (rex.b << 3)); + LD_HU(gd, xEmu, offsetof(x64emu_t, segs[(nextop & 0x38) >> 3])); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LD_HU(x3, xEmu, offsetof(x64emu_t, segs[(nextop & 0x38) >> 3])); + ST_H(x3, ed, fixedaddress); + SMWRITE2(); + } + } + break; case 0x8D: INST_NAME("LEA Gd, Ed"); nextop = F8; GETGD; - if (MODREG) { // reg <= reg? that's an invalid operation - DEFAULT; - } else { // mem <= reg - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 0, 0); - MV(gd, ed); - if (!rex.w || rex.is32bits) { + if (MODREG) { + INST_NAME("Invalid 8D"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { // mem <= reg + rex.seg = 0; // to be safe + SCRATCH_USAGE(0); + addr = geted(dyn, addr, ninst, nextop, &ed, gd, x1, &fixedaddress, rex, NULL, 0, 0); + if (gd != ed) { + if (rex.w && rex.is67) + ZEROUP2(gd, ed); + else + MVxw(gd, ed); + } else if (!rex.w && !rex.is32bits) { ZEROUP(gd); // truncate the higher 32bits as asked } } break; + case 0x8E: + nextop = F8; + u8 = (nextop & 0x38) >> 3; + if ((u8 > 5) || (u8 == 1)) { + INST_NAME("Invalid MOV Seg, Ed"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("MOV Seg, Ed"); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LD_HU(x1, ed, fixedaddress); + ed = x1; + } + ST_H(ed, xEmu, offsetof(x64emu_t, segs[u8])); + if ((u8 == _FS) || (u8 == _GS)) { + // refresh offset if needed + CBZ_NEXT(ed); + MOV32w(x1, u8); + CALL(const_getsegmentbase, -1, x1, x2); + } + } + break; + case 0x8F: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("POP Ed"); + SMREAD(); + if (MODREG) { + POP1z(TO_NAT((nextop & 7) + (rex.b << 3))); + } else { + POP1z(x2); // so this can handle POP [ESP] and maybe some variant too + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x1, &fixedaddress, rex, NULL, 1, 0); + if (ed == xRSP) { + SDz(x2, ed, fixedaddress); + } else { + // complicated to just allow a segfault that can be recovered correctly + ADDIz(xRSP, xRSP, rex.is32bits ? -4 : -8); + SDz(x2, ed, fixedaddress); + ADDIz(xRSP, xRSP, rex.is32bits ? 4 : 8); + } + SMWRITE(); + } + break; + case 3: + INST_NAME("Invalid 8F /3"); + UDF(); + *need_epilog = 1; + *ok = 0; + break; + default: DEFAULT; + } + break; case 0x90: case 0x91: case 0x92: @@ -1032,7 +1512,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x95: case 0x96: case 0x97: - gd = TO_LA64((opcode & 0x07) + (rex.b << 3)); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); if (gd == xRAX) { INST_NAME("NOP"); } else { @@ -1043,10 +1523,11 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } break; case 0x98: - INST_NAME("CWDE"); if (rex.w) { + INST_NAME("CDQE"); SEXT_W(xRAX, xRAX); } else { + INST_NAME("CWDE"); EXT_W_H(xRAX, xRAX); ZEROUP(xRAX); } @@ -1060,19 +1541,159 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni BSTRPICK_D(xRDX, xRDX, 31, 0); } break; - case 0xA0: - INST_NAME("MOV AL,Ob"); - if(rex.is32bits) u64 = F32; else u64 = F64; - MOV64z(x1, u64); - LD_BU(x2, x1, 0); - BSTRINS_D(xRAX, x2, 7, 0); - break; - case 0xA4: - if (rep) { - INST_NAME("REP MOVSB"); - CBZ_NEXT(xRCX); + case 0x9A: + if (rex.is32bits) { + DEFAULT; + } else { + INST_NAME("Illegal 9A"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; + case 0x9B: + INST_NAME("FWAIT"); + break; + case 0x9C: + INST_NAME("PUSHF"); + READFLAGS(X_ALL); + RESTORE_EFLAGS(x1); + PUSH1z(xFlags); + break; + case 0x9D: + INST_NAME("POPF"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + POP1z(xFlags); + MOV32w(x1, 0x3E7FD7); + AND(xFlags, xFlags, x1); + ORI(xFlags, xFlags, 0x202); + SPILL_EFLAGS(); + SET_DFNONE(); + if (box64_wine) { // should this be done all the time? + ANDI(x1, xFlags, 1 << F_TF); + CBZ_NEXT(x1); + // go to epilog, TF should trigger at end of next opcode, so using Interpreter only + LD_W(x4, xEmu, offsetof(x64emu_t, flags)); + ORI(x4, x4, 1< 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + SMREAD(); CBZ_NEXT(xRCX); ANDI(x1, xFlags, 1 << F_DF); BNEZ_MARK2(x1); @@ -1149,7 +1777,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni ADDI_D(xRSI, xRSI, 1); ADDI_D(xRDI, xRDI, 1); ADDI_D(xRCX, xRCX, -1); - if (rep == 1) { + if (rex.rep == 1) { BEQ_MARK3(x1, x2); } else { BNE_MARK3(x1, x2); @@ -1162,7 +1790,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni ADDI_D(xRSI, xRSI, -1); ADDI_D(xRDI, xRDI, -1); ADDI_D(xRCX, xRCX, -1); - if (rep == 1) { + if (rex.rep == 1) { BEQ_MARK3(x1, x2); } else { BNE_MARK3(x1, x2); @@ -1173,8 +1801,9 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; default: INST_NAME("CMPSB"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); GETDIR(x3, x1, 1); + SMREAD(); LD_BU(x1, xRSI, 0); LD_BU(x2, xRDI, 0); ADD_D(xRSI, xRSI, x3); @@ -1183,9 +1812,68 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; } break; + case 0xA7: + switch (rex.rep) { + case 1: + case 2: + if (rex.rep == 1) { + INST_NAME("REPNZ CMPSD"); + } else { + INST_NAME("REPZ CMPSD"); + } + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + SMREAD(); + CBZ_NEXT(xRCX); + ANDI(x1, xFlags, 1 << F_DF); + BNEZ_MARK2(x1); + MARK; // Part with DF==0 + LDxw(x1, xRSI, 0); + LDxw(x2, xRDI, 0); + ADDI_D(xRSI, xRSI, rex.w ? 8 : 4); + ADDI_D(xRDI, xRDI, rex.w ? 8 : 4); + ADDI_D(xRCX, xRCX, -1); + if (rex.rep == 1) { + BEQ_MARK3(x1, x2); + } else { + BNE_MARK3(x1, x2); + } + BNEZ_MARK(xRCX); + B_MARK3_nocond; + MARK2; // Part with DF==1 + LDxw(x1, xRSI, 0); + LDxw(x2, xRDI, 0); + ADDI_D(xRSI, xRSI, rex.w ? -8 : -4); + ADDI_D(xRDI, xRDI, rex.w ? -8 : -4); + ADDI_D(xRCX, xRCX, -1); + if (rex.rep == 1) { + BEQ_MARK3(x1, x2); + } else { + BNE_MARK3(x1, x2); + } + BNEZ_MARK2(xRCX); + MARK3; // end + emit_cmp32(dyn, ninst, rex, x1, x2, x3, x4, x5, x6); + break; + default: + INST_NAME("CMPSD"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + GETDIR(x3, x1, rex.w ? 8 : 4); + SMREAD(); + LDxw(x1, xRSI, 0); + LDxw(x2, xRDI, 0); + ADD_D(xRSI, xRSI, x3); + ADD_D(xRDI, xRDI, x3); + emit_cmp32(dyn, ninst, rex, x1, x2, x3, x4, x5, x6); + break; + } + break; case 0xA8: INST_NAME("TEST AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); ANDI(x1, xRAX, 0xff); u8 = F8; MOV32w(x2, u8); @@ -1193,24 +1881,73 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0xA9: INST_NAME("TEST EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; MOV64xw(x2, i64); emit_test32(dyn, ninst, rex, xRAX, x2, x3, x4, x5); break; case 0xAA: - if (rep) { + if (rex.rep) { INST_NAME("REP STOSB"); CBZ_NEXT(xRCX); + v0 = fpu_get_scratch(dyn); + VREPLGR2VR_B(v0, xRAX); + MOV64x(x4, 16); + MOV64x(x5, 8); + MOV64x(x6, 4); + ANDI(x1, xFlags, 1 << F_DF); - BNEZ_MARK2(x1); - MARK; // Part with DF==0 + BNEZ_MARK3(x1); + // Part with DF==0 + + BLT(xRCX, x4, 4 + 4 * 4); // loop in 16bytes + VST(v0, xRDI, 0); + ADDI_D(xRDI, xRDI, 16); + ADDI_D(xRCX, xRCX, -16); + BGE(xRCX, x4, -4 * 3); + + BLT(xRCX, x5, 4 + 4 * 4); // try 8 bytes + FST_D(v0, xRDI, 0); + ADDI_D(xRDI, xRDI, 8); + ADDI_D(xRCX, xRCX, -8); + BGE(xRCX, x5, -4 * 3); + + BLT(xRCX, x6, 4 + 4 * 4); // try 4 bytes + FST_S(v0, xRDI, 0); + ADDI_D(xRDI, xRDI, 4); + ADDI_D(xRCX, xRCX, -4); + BGE(xRCX, x6, -4 * 3); + + BEQZ(xRCX, 4 + 4 * 4); + MARK; ST_B(xRAX, xRDI, 0); ADDI_D(xRDI, xRDI, 1); ADDI_D(xRCX, xRCX, -1); BNEZ_MARK(xRCX); B_NEXT_nocond; - MARK2; // Part with DF==1 + + // Part with DF==1 + MARK3; + BLT(xRCX, x4, 4 + 4 * 4); // loop in 16bytes + VST(v0, xRDI, -15); + ADDI_D(xRDI, xRDI, -16); + ADDI_D(xRCX, xRCX, -16); + BGE(xRCX, x4, -4 * 3); + + BLT(xRCX, x5, 4 + 4 * 4); // try 8 bytes + FST_D(v0, xRDI, -7); + ADDI_D(xRDI, xRDI, -8); + ADDI_D(xRCX, xRCX, -8); + BGE(xRCX, x5, -4 * 3); + + BLT(xRCX, x6, 4 + 4 * 4); // try 4 bytes + FST_S(v0, xRDI, -3); + ADDI_D(xRDI, xRDI, -4); + ADDI_D(xRCX, xRCX, -4); + BGE(xRCX, x6, -4 * 3); + + BEQZ(xRCX, 4 + 4 * 4); + MARK2; ST_B(xRAX, xRDI, 0); ADDI_D(xRDI, xRDI, -1); ADDI_D(xRCX, xRCX, -1); @@ -1222,9 +1959,10 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni ST_B(xRAX, xRDI, 0); ADD_D(xRDI, xRDI, x3); } + SMWRITE(); break; case 0xAB: - if (rep) { + if (rex.rep) { INST_NAME("REP STOSD"); CBZ_NEXT(xRCX); ANDI(x1, xFlags, 1 << F_DF); @@ -1247,18 +1985,61 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SDxw(xRAX, xRDI, 0); ADD_D(xRDI, xRDI, x3); } + SMWRITE(); + break; + case 0xAC: + if (rex.rep) { + INST_NAME("REP LODSB"); + GETDIR(x1, x2, 1); + SMREAD(); + CBZ_NEXT(xRCX); + MARK; + LD_BU(x2, xRSI, 0); + ADD_D(xRSI, xRSI, x1); + BSTRINS_D(xRAX, x2, 7, 0); + ADDI_D(xRCX, xRCX, -1); + BNEZ_MARK(xRCX); + } else { + INST_NAME("LODSB"); + GETDIR(x1, x2, 1); + SMREAD(); + LD_BU(x2, xRSI, 0); + ADD_D(xRSI, xRSI, x1); + BSTRINS_D(xRAX, x2, 7, 0); + } + break; + case 0xAD: + if (rex.rep) { + INST_NAME("REP LODSD"); + CBZ_NEXT(xRCX); + GETDIR(x1, x2, rex.w ? 8 : 4); + MARK; + LDxw(xRAX, xRSI, 0); + ADD_D(xRSI, xRSI, x1); + ADDI_D(xRCX, xRCX, -1); + BNEZ_MARK(xRCX); + } else { + INST_NAME("LODSD"); + GETDIR(x1, x2, rex.w ? 8 : 4); + LDxw(xRAX, xRSI, 0); + ADD_D(xRSI, xRSI, x1); + } break; case 0xAE: - switch (rep) { + switch (rex.rep) { case 1: case 2: - if (rep == 1) { + if (rex.rep == 1) { INST_NAME("REPNZ SCASB"); } else { INST_NAME("REPZ SCASB"); } - MAYSETFLAGS(); - SETFLAGS(X_ALL, SF_SET_PENDING); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + SMREAD(); CBZ_NEXT(xRCX); ANDI(x1, xRAX, 0xff); ANDI(x2, xFlags, 1 << F_DF); @@ -1267,7 +2048,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LD_BU(x2, xRDI, 0); ADDI_D(xRDI, xRDI, 1); ADDI_D(xRCX, xRCX, -1); - if (rep == 1) { + if (rex.rep == 1) { BEQ_MARK3(x1, x2); } else { BNE_MARK3(x1, x2); @@ -1278,7 +2059,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LD_BU(x2, xRDI, 0); ADDI_D(xRDI, xRDI, -1); ADDI_D(xRCX, xRCX, -1); - if (rep == 1) { + if (rex.rep == 1) { BEQ_MARK3(x1, x2); } else { BNE_MARK3(x1, x2); @@ -1289,7 +2070,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; default: INST_NAME("SCASB"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); GETDIR(x3, x1, 1); ANDI(x1, xRAX, 0xff); LD_BU(x2, xRDI, 0); @@ -1298,18 +2079,76 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; } break; + case 0xAF: + switch (rex.rep) { + case 1: + case 2: + if (rex.rep == 1) { + INST_NAME("REPNZ SCASD"); + } else { + INST_NAME("REPZ SCASD"); + } + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + SMREAD(); + CBZ_NEXT(xRCX); + if (rex.w) { + MV(x1, xRAX); + } else { + ZEROUP2(x1, xRAX); + } + ANDI(x2, xFlags, 1 << F_DF); + BNEZ_MARK2(x2); + MARK; // Part with DF==0 + LDxw(x2, xRDI, 0); + ADDI_D(xRDI, xRDI, rex.w ? 8 : 4); + ADDI_D(xRCX, xRCX, -1); + if (rex.rep == 1) { + BEQ_MARK3(x1, x2); + } else { + BNE_MARK3(x1, x2); + } + BNE_MARK(xRCX, xZR); + B_MARK3_nocond; + MARK2; // Part with DF==1 + LDxw(x2, xRDI, 0); + ADDI_D(xRDI, xRDI, rex.w ? -8 : -4); + ADDI_D(xRCX, xRCX, -1); + if (rex.rep == 1) { + BEQ_MARK3(x1, x2); + } else { + BNE_MARK3(x1, x2); + } + BNE_MARK2(xRCX, xZR); + MARK3; // end + emit_cmp32(dyn, ninst, rex, x1, x2, x3, x4, x5, x6); + break; + default: + INST_NAME("SCASD"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + GETDIR(x3, x1, rex.w ? 8 : 4); + LDxw(x2, xRDI, 0); + ADD_D(xRDI, xRDI, x3); + emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5, x6); + break; + } + break; case 0xB0: case 0xB1: case 0xB2: case 0xB3: INST_NAME("MOV xL, Ib"); u8 = F8; - MOV32w(x1, u8); + SCRATCH_USAGE(0); if (rex.rex) - gb1 = TO_LA64((opcode & 7) + (rex.b << 3)); + gb1 = TO_NAT((opcode & 7) + (rex.b << 3)); else - gb1 = TO_LA64(opcode & 3); - BSTRINS_D(gb1, x1, 7, 0); + gb1 = TO_NAT(opcode & 3); + BSTRINS_D(gb1, xZR, 7, 0); + ORI(gb1, gb1, u8); break; case 0xB4: case 0xB5: @@ -1319,10 +2158,10 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni u8 = F8; MOV32w(x1, u8); if (rex.rex) { - gb1 = TO_LA64((opcode & 7) + (rex.b << 3)); + gb1 = TO_NAT((opcode & 7) + (rex.b << 3)); BSTRINS_D(gb1, x1, 7, 0); } else { - gb1 = TO_LA64(opcode & 3); + gb1 = TO_NAT(opcode & 3); BSTRINS_D(gb1, x1, 15, 8); } break; @@ -1335,7 +2174,8 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0xBE: case 0xBF: INST_NAME("MOV Reg, Id"); - gd = TO_LA64((opcode & 7) + (rex.b << 3)); + gd = TO_NAT((opcode & 7) + (rex.b << 3)); + SCRATCH_USAGE(0); if (rex.w) { u64 = F64; MOV64x(gd, u64); @@ -1346,68 +2186,106 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0xC0: nextop = F8; - // TODO: refine these... switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("ROL Eb, Ib"); + u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; + if (u8) { + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEB(x1, 1); + u8 = F8 & 0x1f; + emit_rol8c(dyn, ninst, ed, u8, x4, x5, x6); + EBBACK(); + } else { + FAKEED; + F8; + } + break; + case 1: + INST_NAME("ROR Eb, Ib"); + u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; + if (u8) { + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEB(x1, 1); + u8 = F8 & 0x1f; + emit_ror8c(dyn, ninst, x1, u8, x4, x5); + EBBACK(); + } else { + FAKEED; + F8; + } + break; + case 2: + INST_NAME("RCL Eb, Ib"); + u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; + if (u8) { + READFLAGS(X_CF); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEB(x1, 1); + u8 = F8 & 0x1f; + emit_rcl8c(dyn, ninst, x1, u8, x4, x5); + EBBACK(); + } else { + FAKEED; + F8; + } + break; + case 3: + INST_NAME("RCR Eb, Ib"); + u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; + if (u8) { + READFLAGS(X_CF); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEB(x1, 1); + u8 = F8 & 0x1f; + emit_rcr8c(dyn, ninst, x1, u8, x4, x5); + EBBACK(); + } else { + FAKEED; + F8; + } + break; case 4: case 6: INST_NAME("SHL Eb, Ib"); - GETEB(x1, 1); - u8 = (F8) & 0x1f; + u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; if (u8) { - SETFLAGS(X_ALL, SF_PENDING); - UFLAG_IF { - MOV32w(x4, u8); - UFLAG_OP2(x4); - }; - UFLAG_OP1(ed); - SLLI_W(ed, ed, u8); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEB(x1, 1); + u8 = (F8) & 0x1f; + emit_shl8c(dyn, ninst, ed, u8, x4, x5); EBBACK(); - UFLAG_RES(ed); - UFLAG_DF(x3, d_shl8); } else { - NOP(); + FAKEED; + F8; } break; case 5: INST_NAME("SHR Eb, Ib"); - GETEB(x1, 1); - u8 = (F8) & 0x1f; + u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; if (u8) { - SETFLAGS(X_ALL, SF_PENDING); - UFLAG_IF { - MOV32w(x4, u8); - UFLAG_OP2(x4); - }; - UFLAG_OP1(ed); - if (u8) { - SRLI_W(ed, ed, u8); - EBBACK(); - } - UFLAG_RES(ed); - UFLAG_DF(x3, d_shr8); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEB(x1, 1); + u8 = (F8) & 0x1f; + emit_shr8c(dyn, ninst, ed, u8, x4, x5); + EBBACK(); } else { - NOP(); + FAKEED; + F8; } break; case 7: INST_NAME("SAR Eb, Ib"); - GETSEB(x1, 1); - u8 = (F8) & 0x1f; + u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; if (u8) { - SETFLAGS(X_ALL, SF_PENDING); - UFLAG_IF { - MOV32w(x4, u8); - UFLAG_OP2(x4); - }; - UFLAG_OP1(ed); - if (u8) { - SRAI_W(ed, ed, u8); - EBBACK(); - } - UFLAG_RES(ed); - UFLAG_DF(x3, d_sar8); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETSEB(x1, 1); + u8 = (F8) & 0x1f; + emit_sar8c(dyn, ninst, ed, u8, x4, x5); + EBBACK(); } else { - NOP(); + FAKEED; + F8; } break; default: @@ -1419,16 +2297,15 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni switch ((nextop >> 3) & 7) { case 0: INST_NAME("ROL Ed, Ib"); - u8 = geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 0x3f : 0x1f); - // flags are not affected if count is 0, we make it a nop if possible. + u8 = geted_ib(dyn, addr, ninst, nextop) & (0x1f + (rex.w * 0x20)); if (u8) { - SETFLAGS(X_OF | X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose GETED(1); - F8; + u8 = (F8) & (rex.w ? 0x3f : 0x1f); emit_rol32c(dyn, ninst, rex, ed, u8, x3, x4); WBACK; } else { - if (MODREG && !rex.w) { + if (MODREG && !rex.w && !rex.is32bits) { GETED(1); ZEROUP(ed); } else { @@ -1439,16 +2316,55 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 1: INST_NAME("ROR Ed, Ib"); - u8 = geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 0x3f : 0x1f); - // flags are not affected if count is 0, we make it a nop if possible. + u8 = geted_ib(dyn, addr, ninst, nextop) & (0x1f + (rex.w * 0x20)); if (u8) { - SETFLAGS(X_OF | X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose GETED(1); - F8; + u8 = (F8) & (rex.w ? 0x3f : 0x1f); emit_ror32c(dyn, ninst, rex, ed, u8, x3, x4); WBACK; } else { - if (MODREG && !rex.w) { + if (MODREG && !rex.w && !rex.is32bits) { + GETED(1); + ZEROUP(ed); + } else { + FAKEED; + } + F8; + } + break; + case 2: + INST_NAME("RCL Ed, Ib"); + u8 = geted_ib(dyn, addr, ninst, nextop) & (0x1f + (rex.w * 0x20)); + if (u8) { + READFLAGS(X_CF); + SETFLAGS(X_CF | X_OF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETED(1); + u8 = (F8) & (rex.w ? 0x3f : 0x1f); + emit_rcl32c(dyn, ninst, rex, ed, u8, x3, x4, x5); + WBACK; + } else { + if (MODREG && !rex.w && !rex.is32bits) { + GETED(1); + ZEROUP(ed); + } else { + FAKEED; + } + F8; + } + break; + case 3: + INST_NAME("RCR Ed, Ib"); + u8 = geted_ib(dyn, addr, ninst, nextop) & (0x1f + (rex.w * 0x20)); + if (u8) { + READFLAGS(X_CF); + SETFLAGS(X_CF | X_OF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETED(1); + u8 = (F8) & (rex.w ? 0x3f : 0x1f); + emit_rcr32c(dyn, ninst, rex, ed, u8, x3, x4, x5); + WBACK; + } else { + if (MODREG && !rex.w && !rex.is32bits) { GETED(1); ZEROUP(ed); } else { @@ -1460,10 +2376,9 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 4: case 6: INST_NAME("SHL Ed, Ib"); - u8 = geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 0x3f : 0x1f); - // flags are not affected if count is 0, we make it a nop if possible. + u8 = geted_ib(dyn, addr, ninst, nextop) & (0x1f + (rex.w * 0x20)); if (u8) { - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED(1); u8 = (F8) & (rex.w ? 0x3f : 0x1f); emit_shl32c(dyn, ninst, rex, ed, u8, x3, x4, x5); @@ -1480,9 +2395,9 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 5: INST_NAME("SHR Ed, Ib"); - u8 = geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 0x3f : 0x1f); + u8 = geted_ib(dyn, addr, ninst, nextop) & (0x1f + (rex.w * 0x20)); if (u8) { - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED(1); u8 = (F8) & (rex.w ? 0x3f : 0x1f); emit_shr32c(dyn, ninst, rex, ed, u8, x3, x4); @@ -1499,10 +2414,9 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 7: INST_NAME("SAR Ed, Ib"); - // flags are not affected if count is 0, we make it a nop if possible. - u8 = geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 0x3f : 0x1f); + u8 = geted_ib(dyn, addr, ninst, nextop) & (0x1f + (rex.w * 0x20)); if (u8) { - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined GETED(1); u8 = (F8) & (rex.w ? 0x3f : 0x1f); emit_sar32c(dyn, ninst, rex, ed, u8, x3, x4); @@ -1523,27 +2437,72 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0xC2: INST_NAME("RETN"); - // SETFLAGS(X_ALL, SF_SET); // Hack, set all flags (to an unknown state...) - if (box64_dynarec_safeflags) { + if (BOX64DRENV(dynarec_safeflags)) { READFLAGS(X_PEND); // lets play safe here too } - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); // using next, even if there no next - i32 = F16; - retn_to_epilog(dyn, ninst, rex, i32); + BARRIER(BARRIER_FLOAT); + u16 = F16; + POP1z(xRIP); + if (u16 < 2048) + ADDIz(xRSP, xRSP, u16); + else { + MOV32w(x1, u16); + ADDz(xRSP, xRSP, x1); + } + ret_to_next(dyn, ip, ninst, rex); *need_epilog = 0; *ok = 0; break; case 0xC3: INST_NAME("RET"); - // SETFLAGS(X_ALL, SF_SET); // Hack, set all flags (to an unknown state...) - if (box64_dynarec_safeflags) { + if (BOX64DRENV(dynarec_safeflags)) { READFLAGS(X_PEND); // so instead, force the deferred flags, so it's not too slow, and flags are not lost } - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); // using next, even if there no next - ret_to_epilog(dyn, ninst, rex); + BARRIER(BARRIER_FLOAT); + POP1z(xRIP); + ret_to_next(dyn, ip, ninst, rex); *need_epilog = 0; *ok = 0; break; + case 0xC4: + nextop = F8; + if (rex.is32bits && !(MODREG)) { + DEFAULT; + } else { + vex_t vex = { 0 }; + vex.rex = rex; + u8 = nextop; + vex.m = u8 & 0b00011111; + vex.rex.b = (u8 & 0b00100000) ? 0 : 1; + vex.rex.x = (u8 & 0b01000000) ? 0 : 1; + vex.rex.r = (u8 & 0b10000000) ? 0 : 1; + u8 = F8; + vex.p = u8 & 0b00000011; + vex.l = (u8 >> 2) & 1; + vex.v = ((~u8) >> 3) & 0b1111; + vex.rex.w = (u8 >> 7) & 1; + addr = dynarec64_AVX(dyn, addr, ip, ninst, vex, ok, need_epilog); + } + break; + case 0xC5: + nextop = F8; + if (rex.is32bits && !(MODREG)) { + DEFAULT; + } else { + vex_t vex = { 0 }; + vex.rex = rex; + u8 = nextop; + vex.p = u8 & 0b00000011; + vex.l = (u8 >> 2) & 1; + vex.v = ((~u8) >> 3) & 0b1111; + vex.rex.r = (u8 & 0b10000000) ? 0 : 1; + vex.rex.b = 0; + vex.rex.x = 0; + vex.rex.w = 0; + vex.m = VEX_M_0F; + addr = dynarec64_AVX(dyn, addr, ip, ninst, vex, ok, need_epilog); + } + break; case 0xC6: INST_NAME("MOV Eb, Ib"); nextop = F8; @@ -1551,18 +2510,20 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni u8 = F8; if (!rex.rex) { ed = (nextop & 7); - eb1 = TO_LA64((ed & 3)); // Ax, Cx, Dx or Bx - eb2 = (ed & 4) >> 2; // L or H + eb1 = TO_NAT((ed & 3)); // Ax, Cx, Dx or Bx + eb2 = (ed & 4) >> 2; // L or H } else { - eb1 = TO_LA64((nextop & 7) + (rex.b << 3)); + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); eb2 = 0; } MOV32w(x3, u8); BSTRINS_D(eb1, x3, eb2 * 8 + 7, eb2 * 8); } else { // mem <= u8 + SCRATCH_USAGE(0); addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, &lock, 1, 1); u8 = F8; if (u8) { + SCRATCH_USAGE(1); ADDI_D(x3, xZR, u8); ed = x3; } else @@ -1574,15 +2535,17 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0xC7: INST_NAME("MOV Ed, Id"); nextop = F8; + SCRATCH_USAGE(0); if (MODREG) { // reg <= i32 i64 = F32S; - ed = TO_LA64((nextop & 7) + (rex.b << 3)); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); MOV64xw(ed, i64); } else { // mem <= i32 - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, &lock, 0, 4); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, &lock, 1, 4); i64 = F32S; if (i64) { - MOV64xw(x3, i64); + SCRATCH_USAGE(1); + MOV64x(x3, i64); ed = x3; } else ed = xZR; @@ -1590,15 +2553,77 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SMWRITELOCK(lock); } break; + case 0xC8: + INST_NAME("ENTER Iw,Ib"); + u16 = F16; + u8 = (F8) & 0x1f; + if (u8) { + MV(x1, xRBP); + } + PUSH1z(xRBP); + MV(xRBP, xRSP); + if (u8) { + for (u32 = 1; u32 < u8; u32++) { + LDz(x2, x1, rex.is32bits ? -4 : -8); + PUSH1z(x2); + } + PUSH1z(xRBP); + } + if (u16 < 2047) { + ADDI_D(xRSP, xRSP, -u16); + } else { + MOV32w(x2, u16); + SUB_D(xRSP, xRSP, x2); + } + break; case 0xC9: INST_NAME("LEAVE"); MVz(xRSP, xRBP); POP1z(xRBP); break; + case 0xCA: + INST_NAME("FAR RETN"); + u16 = F16; + READFLAGS(X_PEND); + BARRIER(BARRIER_FLOAT); + if (rex.w) { + POP1(xRIP); + POP1(x3); + } else { + POP1_32(xRIP); + POP1_32(x3); + } + ST_H(x3, xEmu, offsetof(x64emu_t, segs[_CS])); + if (u16 < 2048) + ADDIz(xRSP, xRSP, u16); + else { + MOV32w(x1, u16); + ADDz(xRSP, xRSP, x1); + } + ret_to_next(dyn, ip, ninst, rex); + *need_epilog = 0; + *ok = 0; + break; + case 0xCB: + INST_NAME("FAR RET"); + READFLAGS(X_PEND); + BARRIER(BARRIER_FLOAT); + if (rex.w) { + POP1(xRIP); + POP1(x3); + } else { + POP1_32(xRIP); + POP1_32(x3); + } + ST_H(x3, xEmu, offsetof(x64emu_t, segs[_CS])); + ret_to_next(dyn, ip, ninst, rex); + *need_epilog = 0; + *ok = 0; + break; case 0xCC: - SETFLAGS(X_ALL, SF_SET); + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); SKIPTEST(x1); - if (PK(0) == 'S' && PK(1) == 'C') { + if (IsBridgeSignature(PK(0), PK(1))) { addr += 2; BARRIER(BARRIER_FLOAT); INST_NAME("Special Box64 instruction"); @@ -1611,62 +2636,178 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni *need_epilog = 1; } else { MESSAGE(LOG_DUMP, "Native Call to %s\n", GetNativeName(GetNativeFnc(ip))); + x87_stackcount(dyn, ninst, x1); x87_forget(dyn, ninst, x3, x4, 0); sse_purge07cache(dyn, ninst, x3); - - // FIXME: Even the basic support of isSimpleWrapper is disabled for now. - - GETIP(ip + 1); // read the 0xCC - STORE_XEMU_CALL(); - ADDI_D(x1, xEmu, (uint32_t)offsetof(x64emu_t, ip)); // setup addr as &emu->ip - CALL_S(x64Int3, -1); - LOAD_XEMU_CALL(); - addr += 8 + 8; - TABLE64(x3, addr); // expected return address - BNE_MARK(xRIP, x3); - LD_W(w1, xEmu, offsetof(x64emu_t, quit)); - CBZ_NEXT(w1); - MARK; - jump_to_epilog_fast(dyn, 0, xRIP, ninst); + // Partially support isSimpleWrapper + tmp = isSimpleWrapper(*(wrapper_t*)(addr)); + if (isRetX87Wrapper(*(wrapper_t*)(addr))) + // return value will be on the stack, so the stack depth needs to be updated + x87_purgecache(dyn, ninst, 0, x3, x1, x4); + if (tmp < 0 || (tmp & 15) > 1) + tmp = 0; // TODO: removed when FP is in place + if ((BOX64ENV(log) < 2 && !BOX64ENV(rolling_log)) && tmp) { + call_n(dyn, ninst, (void*)(addr + 8), tmp); + SMWRITE2(); + addr += 8 + 8; + } else { + GETIP(ip + 1, x7); // read the 0xCC + STORE_XEMU_CALL(); + ADDI_D(x3, xRIP, 8 + 8 + 2); // expected return address + ADDI_D(x1, xEmu, (uint32_t)offsetof(x64emu_t, ip)); // setup addr as &emu->ip + CALL_(const_int3, -1, x3, x1, 0); + SMWRITE2(); + LOAD_XEMU_CALL(); + addr += 8 + 8; + BNE_MARK(xRIP, x3); + LD_W(x1, xEmu, offsetof(x64emu_t, quit)); + CBZ_NEXT(x1); + MARK; + jump_to_epilog_fast(dyn, 0, xRIP, ninst); + } } } else { - if (!box64_ignoreint3) { - INST_NAME("INT 3"); + INST_NAME("INT 3"); + if (!BOX64ENV(ignoreint3)) { // check if TRAP signal is handled - LD_D(x1, xEmu, offsetof(x64emu_t, context)); - MOV64x(x2, offsetof(box64context_t, signals[SIGTRAP])); - ADD_D(x2, x2, x1); - LD_D(x3, x2, 0); - CBZ_NEXT(x3); - GETIP(ip); + TABLE64C(x1, const_context); + MOV32w(x2, offsetof(box64context_t, signals[X64_SIGTRAP])); + LDX_D(x3, x1, x2); + BEQZ_MARK(x3); + GETIP(addr, x7); STORE_XEMU_CALL(); - CALL(native_int3, -1); + CALL(const_native_int3, -1, 0, 0); LOAD_XEMU_CALL(); + MARK; + jump_to_epilog(dyn, addr, 0, ninst); + *need_epilog = 0; + *ok = 0; } } break; + case 0xCD: + u8 = F8; + NOTEST(x1); + if (box64_wine && (u8 == 0x2D || u8 == 0x2C || u8 == 0x29)) { + INST_NAME("INT 29/2c/2d"); + // lets do nothing + MESSAGE(LOG_INFO, "INT 29/2c/2d Windows interruption\n"); + GETIP(ip, x7); // priviledged instruction, IP not updated + STORE_XEMU_CALL(); + MOV32w(x1, u8); + CALL(const_native_int, -1, x1, 0); + LOAD_XEMU_CALL(); + } else if (u8 == 0x80) { + INST_NAME("32bits SYSCALL"); + NOTEST(x1); + SMEND(); + GETIP(addr, x7); + STORE_XEMU_CALL(); + CALL_S(const_x86syscall, -1, 0); + LOAD_XEMU_CALL(); + TABLE64(x3, addr); // expected return address + BNE_MARK(xRIP, x3); + LD_W(x1, xEmu, offsetof(x64emu_t, quit)); + CBZ_NEXT(x1); + MARK; + LOAD_XEMU_REM(); + jump_to_epilog(dyn, 0, xRIP, ninst); + } else if (u8 == 0x03) { + INST_NAME("INT 3"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(addr, x7); + STORE_XEMU_CALL(); + CALL(const_native_int3, -1, 0, 0); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + } else { + INST_NAME("INT n"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); // priviledged instruction, IP not updated + STORE_XEMU_CALL(); + CALL(const_native_priv, -1, 0, 0); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + } + break; + case 0xCF: + INST_NAME("IRET"); + SETFLAGS(X_ALL, SF_SET_DF, NAT_FLAGS_NOFUSION); // Not a hack, EFLAGS are restored + BARRIER(BARRIER_FLOAT); + iret_to_next(dyn, ip, ninst, rex.is32bits, rex.w); + *need_epilog = 0; + *ok = 0; + break; case 0xD0: - case 0xD2: // TODO: Jump if CL is 0 nextop = F8; switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("ROL Eb, 1"); + GETEB(x1, 0); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + emit_rol8c(dyn, ninst, ed, 1, x4, x5, x6); + EBBACK(); + break; + case 1: + INST_NAME("ROR Eb, 1"); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEB(x1, 0); + emit_ror8c(dyn, ninst, ed, 1, x4, x5); + EBBACK(); + break; + case 2: + INST_NAME("RCL Eb, 1"); + READFLAGS(X_CF); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEB(x1, 0); + emit_rcl8c(dyn, ninst, ed, 1, x4, x5); + EBBACK(); + break; + case 3: + INST_NAME("RCR Eb, 1"); + READFLAGS(X_CF); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEB(x1, 0); + emit_rcr8c(dyn, ninst, ed, 1, x4, x5); + EBBACK(); + break; + case 4: + case 6: + INST_NAME("SHL Eb, 1"); + GETEB(x1, 0); + MOV32w(x2, 1); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + emit_shl8(dyn, ninst, x1, x2, x5, x4, x6); + EBBACK(); + break; case 5: - if (opcode == 0xD0) { - INST_NAME("SHR Eb, 1"); - MOV32w(x2, 1); - } else { - INST_NAME("SHR Eb, CL"); - ANDI(x2, xRCX, 0x1F); - BEQ_NEXT(x2, xZR); - } - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if (box64_dynarec_safeflags > 1) - MAYSETFLAGS(); + INST_NAME("SHR Eb, 1"); GETEB(x1, 0); + MOV32w(x2, 1); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined emit_shr8(dyn, ninst, x1, x2, x5, x4, x6); EBBACK(); break; - default: - DEFAULT; + case 7: + INST_NAME("SAR Eb, 1"); + GETSEB(x1, 0); + MOV32w(x2, 1); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + emit_sar8(dyn, ninst, x1, x2, x5, x4, x6); + EBBACK(); + break; } break; case 0xD1: @@ -1674,242 +2815,563 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni switch ((nextop >> 3) & 7) { case 0: INST_NAME("ROL Ed, 1"); - SETFLAGS(X_OF | X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose GETED(0); emit_rol32c(dyn, ninst, rex, ed, 1, x3, x4); WBACK; - if (!wback && !rex.w) ZEROUP(ed); + break; + case 1: + INST_NAME("ROR Ed, 1"); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETED(0); + emit_ror32c(dyn, ninst, rex, ed, 1, x3, x4); + WBACK; + break; + case 2: + INST_NAME("RCL Ed, 1"); + READFLAGS(X_CF); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETED(0); + emit_rcl32c(dyn, ninst, rex, ed, 1, x3, x4, x5); + WBACK; + break; + case 3: + INST_NAME("RCR Ed, 1"); + READFLAGS(X_CF); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETED(0); + emit_rcr32c(dyn, ninst, rex, ed, 1, x3, x4, x5); + WBACK; break; case 4: case 6: INST_NAME("SHL Ed, 1"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined GETED(0); emit_shl32c(dyn, ninst, rex, ed, 1, x3, x4, x5); WBACK; break; case 5: INST_NAME("SHR Ed, 1"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined GETED(0); emit_shr32c(dyn, ninst, rex, ed, 1, x3, x4); WBACK; break; case 7: INST_NAME("SAR Ed, 1"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined GETED(0); emit_sar32c(dyn, ninst, rex, ed, 1, x3, x4); WBACK; break; - default: - DEFAULT; + } + break; + case 0xD2: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("ROL Eb, CL"); + GETEB(x1, 0); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_OF | X_CF); + } + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + UFLAG_IF { + ANDI(x2, xRCX, 0x1f); + CBZ_NEXT(x2); + } + ANDI(x2, xRCX, 7); + emit_rol8(dyn, ninst, ed, x2, x4, x5); + EBBACK(); + break; + case 1: + INST_NAME("ROR Eb, CL"); + GETEB(x1, 0); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_OF | X_CF); + } + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + UFLAG_IF { + ANDI(x2, xRCX, 0x1f); + CBZ_NEXT(x2); + } + ANDI(x2, xRCX, 7); + emit_ror8(dyn, ninst, ed, x2, x4, x5); + EBBACK(); + break; + case 2: + INST_NAME("RCL Eb, CL"); + GETEB(x1, 0); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_OF | X_CF); + } else { + READFLAGS(X_CF); + } + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + ANDI(x2, xRCX, 0x1f); + CBZ_NEXT(x2); + emit_rcl8(dyn, ninst, ed, x2, x4, x5, x6); + EBBACK(); + break; + case 3: + INST_NAME("RCR Eb, CL"); + GETEB(x1, 0); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_OF | X_CF); + } else { + READFLAGS(X_CF); + } + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + ANDI(x2, xRCX, 0x1f); + CBZ_NEXT(x2); + emit_rcr8(dyn, ninst, ed, x2, x4, x5, x6); + EBBACK(); + break; + case 4: + case 6: + INST_NAME("SHL Eb, CL"); + GETEB(x1, 0); + ANDI(x2, xRCX, 0x1F); + CBZ_NEXT(x2); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + emit_shl8(dyn, ninst, x1, x2, x5, x4, x6); + EBBACK(); + break; + case 5: + INST_NAME("SHR Eb, CL"); + GETEB(x1, 0); + ANDI(x2, xRCX, 0x1F); + CBZ_NEXT(x2); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + emit_shr8(dyn, ninst, x1, x2, x5, x4, x6); + EBBACK(); + break; + case 7: + INST_NAME("SAR Eb, CL"); + GETSEB(x1, 0); + ANDI(x2, xRCX, 0x1f); + CBZ_NEXT(x2); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + emit_sar8(dyn, ninst, x1, x2, x5, x4, x6); + EBBACK(); + break; } break; case 0xD3: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: INST_NAME("ROL Ed, CL"); - SETFLAGS(X_OF | X_CF, SF_SUBSET); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_OF | X_CF); + } + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETED(0); + ANDI(x6, xRCX, rex.w ? 0x3f : 0x1f); + if (!rex.w && !rex.is32bits && MODREG) ZEROUP(ed); + CBZ_NEXT(x6); + emit_rol32(dyn, ninst, rex, ed, x6, x3, x4); + WBACK; + break; + case 1: + INST_NAME("ROR Ed, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_OF | X_CF); + } + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETED(0); + ANDI(x6, xRCX, rex.w ? 0x3f : 0x1f); + if (!rex.w && !rex.is32bits && MODREG) ZEROUP(ed); + CBZ_NEXT(x6); + emit_ror32(dyn, ninst, rex, ed, x6, x3, x4); + WBACK; + break; + case 2: + INST_NAME("RCL Ed, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_OF | X_CF); + } else { + READFLAGS(X_CF); + } + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + ANDI(x3, xRCX, rex.w ? 63 : 31); + GETED(0); + UFLAG_IF { + if (!rex.w && !rex.is32bits && MODREG) { ZEROUP(ed); } + } + CBZ_NEXT(x3); + emit_rcl32(dyn, ninst, rex, ed, x3, x5, x4, x6); + WBACK; + break; + case 3: + INST_NAME("RCR Ed, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_OF | X_CF); + } else { + READFLAGS(X_CF); + } + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + if (rex.w) { + ANDI(x3, xRCX, 0x3f); + } else { + ANDI(x3, xRCX, 0x1f); + } GETED(0); - emit_rol32(dyn, ninst, rex, ed, xRCX, x3, x4); + UFLAG_IF { + if (!rex.w && !rex.is32bits && MODREG) { ZEROUP(ed); } + } + CBZ_NEXT(x3); + emit_rcr32(dyn, ninst, rex, ed, x3, x5, x4, x6); WBACK; - if (!wback && !rex.w) ZEROUP(ed); break; case 4: case 6: INST_NAME("SHL Ed, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + if (!dyn->insts[ninst].x64.gen_flags) { + GETED(0); + if (rex.w) + SLL_D(ed, ed, xRCX); + else + SLL_W(ed, ed, xRCX); + if (dyn->insts[ninst].nat_flags_fusion) { + if (!rex.w) ZEROUP(ed); + NAT_FLAGS_OPS(ed, xZR, x5, xZR); + } else if (!rex.w && MODREG) { + ZEROUP(ed); + } + WBACK; + break; + } ANDI(x3, xRCX, rex.w ? 0x3f : 0x1f); GETED(0); - if (!rex.w && MODREG) { ZEROUP(ed); } + if (!rex.w && !rex.is32bits && MODREG) ZEROUP(ed); CBZ_NEXT(x3); emit_shl32(dyn, ninst, rex, ed, x3, x5, x4, x6); WBACK; break; case 5: INST_NAME("SHR Ed, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + if (!dyn->insts[ninst].x64.gen_flags) { + GETED(0); + if (rex.w) + SRL_D(ed, ed, xRCX); + else + SRL_W(ed, ed, xRCX); + if (dyn->insts[ninst].nat_flags_fusion) { + if (!rex.w) ZEROUP(ed); + NAT_FLAGS_OPS(ed, xZR, x5, xZR); + } else if (!rex.w && MODREG) { + ZEROUP(ed); + } + WBACK; + break; + } ANDI(x3, xRCX, rex.w ? 0x3f : 0x1f); GETED(0); - if (!rex.w && MODREG) { ZEROUP(ed); } + if (!rex.w && !rex.is32bits && MODREG) ZEROUP(ed); CBZ_NEXT(x3); emit_shr32(dyn, ninst, rex, ed, x3, x5, x4); WBACK; break; case 7: INST_NAME("SAR Ed, CL"); - SETFLAGS(X_ALL, SF_PENDING); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); ANDI(x3, xRCX, rex.w ? 0x3f : 0x1f); GETED(0); - if (!rex.w && MODREG) { ZEROUP(ed); } + if (!rex.w && !rex.is32bits && MODREG) { ZEROUP(ed); } CBZ_NEXT(x3); - UFLAG_OP12(ed, x3); - SRAxw(ed, ed, x3); + emit_sar32(dyn, ninst, rex, ed, x3, x5, x4); WBACK; - UFLAG_RES(ed); - UFLAG_DF(x3, rex.w ? d_sar64 : d_sar32); break; default: DEFAULT; } break; - #define GO(Z) \ - BARRIER(BARRIER_MAYBE); \ - JUMP(addr + i8, 1); \ - if (dyn->insts[ninst].x64.jmp_insts == -1 || CHECK_CACHE()) { \ - /* out of the block */ \ - i32 = dyn->insts[ninst].epilog - (dyn->native_size); \ - if (Z) { \ - BNE(xRCX, xZR, i32); \ - } else { \ - BEQ(xRCX, xZR, i32); \ - } \ - if (dyn->insts[ninst].x64.jmp_insts == -1) { \ - if (!(dyn->insts[ninst].x64.barrier & BARRIER_FLOAT)) \ - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ - jump_to_next(dyn, addr + i8, 0, ninst, rex.is32bits); \ - } else { \ - CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ - B(i32); \ - } \ - } else { \ - /* inside the block */ \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ - if (Z) { \ - BEQ(xRCX, xZR, i32); \ - } else { \ - BNE(xRCX, xZR, i32); \ - }; \ - } + case 0xD7: + INST_NAME("XLAT"); + BSTRPICK_D(x1, xRAX, 7, 0); + LDXxw(x1, xRBX, x1); + BSTRINS_D(xRAX, x1, 7, 0); + break; + case 0xD8: + addr = dynarec64_D8(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + case 0xD9: + addr = dynarec64_D9(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + case 0xDA: + addr = dynarec64_DA(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + case 0xDB: + addr = dynarec64_DB(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + case 0xDC: + addr = dynarec64_DC(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + case 0xDD: + addr = dynarec64_DD(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + + case 0xDE: + addr = dynarec64_DE(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + case 0xDF: + addr = dynarec64_DF(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + +#define GO(Z, R) \ + JUMP(addr + i8, 1); \ + if (dyn->insts[ninst].x64.jmp_insts == -1 || CHECK_CACHE()) { \ + /* out of the block */ \ + i32 = dyn->insts[ninst].epilog - (dyn->native_size); \ + if (Z) { \ + BNE(R, xZR, i32); \ + } else { \ + BEQ(R, xZR, i32); \ + } \ + if (dyn->insts[ninst].x64.jmp_insts == -1) { \ + if (!(dyn->insts[ninst].x64.barrier & BARRIER_FLOAT)) \ + fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ + jump_to_next(dyn, addr + i8, 0, ninst, rex.is32bits); \ + } else { \ + CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ + i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ + B(i32); \ + } \ + } else { \ + /* inside the block */ \ + i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ + if (Z) { \ + BEQ(R, xZR, i32); \ + } else { \ + BNE(R, xZR, i32); \ + }; \ + } + case 0xE0: INST_NAME("LOOPNZ"); READFLAGS(X_ZF); i8 = F8S; - ADDI_D(xRCX, xRCX, -1); - if (la64_lbt) X64_GET_EFLAGS(x1, X_ZF); else ANDI(x1, xFlags, 1 << F_ZF); - CBNZ_NEXT(x1); - GO(0); + if (rex.is32bits && rex.is67) { + BSTRPICK_D(x3, xRCX, 15, 0); + ADDI_W(x3, x3, -1); + BSTRINS_D(xRCX, x3, 15, 0); + if (cpuext.lbt) + X64_GET_EFLAGS(x1, X_ZF); + else + ANDI(x1, xFlags, 1 << F_ZF); + CBNZ_NEXT(x1); + GO(0, x3); + } else { + ADDIy(xRCX, xRCX, -1); + if (cpuext.lbt) + X64_GET_EFLAGS(x1, X_ZF); + else + ANDI(x1, xFlags, 1 << F_ZF); + CBNZ_NEXT(x1); + GO(0, xRCX); + } break; case 0xE1: INST_NAME("LOOPZ"); READFLAGS(X_ZF); i8 = F8S; - ADDI_D(xRCX, xRCX, -1); - if (la64_lbt) X64_GET_EFLAGS(x1, X_ZF); else ANDI(x1, xFlags, 1 << F_ZF); - CBZ_NEXT(x1); - GO(0); + if (rex.is32bits && rex.is67) { + BSTRPICK_D(x3, xRCX, 15, 0); + ADDI_W(x3, x3, -1); + BSTRINS_D(xRCX, x3, 15, 0); + if (cpuext.lbt) + X64_GET_EFLAGS(x1, X_ZF); + else + ANDI(x1, xFlags, 1 << F_ZF); + CBZ_NEXT(x1); + GO(0, x3); + } else { + ADDIy(xRCX, xRCX, -1); + if (cpuext.lbt) + X64_GET_EFLAGS(x1, X_ZF); + else + ANDI(x1, xFlags, 1 << F_ZF); + CBZ_NEXT(x1); + GO(0, xRCX); + } break; case 0xE2: INST_NAME("LOOP"); i8 = F8S; - ADDI_D(xRCX, xRCX, -1); - GO(0); + if (rex.is32bits && rex.is67) { + BSTRPICK_D(x3, xRCX, 15, 0); + ADDI_W(x3, x3, -1); + BSTRINS_D(xRCX, x3, 15, 0); + GO(0, x3); + } else { + ADDIy(xRCX, xRCX, -1); + GO(0, xRCX); + } break; case 0xE3: INST_NAME("JECXZ"); i8 = F8S; - GO(1); + if (rex.is32bits && rex.is67) { + BSTRPICK_D(x3, xRCX, 15, 0); + GO(1, x3); + } else if (rex.is32bits || rex.is67) { + ADDIy(x3, xRCX, 0); + GO(1, x3); + } else { + GO(1, xRCX); + } + break; +#undef GO + case 0xE4: /* IN AL, Ib */ + case 0xE5: /* IN EAX, Ib */ + case 0xE6: /* OUT Ib, AL */ + case 0xE7: /* OUT Ib, EAX */ + INST_NAME(opcode == 0xE4 ? "IN AL, Ib" : (opcode == 0xE5 ? "IN EAX, Ib" : (opcode == 0xE6 ? "OUT Ib, AL" : "OUT Ib, EAX"))); + if (rex.is32bits && BOX64ENV(ignoreint3)) { + F8; + } else { + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + u8 = F8; + GETIP(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_priv, -1, 0, 0); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + } break; - #undef GO case 0xE8: INST_NAME("CALL Id"); i32 = F32S; if (addr + i32 == 0) { - #if STEP == 3 +#if STEP == 3 printf_log(LOG_INFO, "Warning, CALL to 0x0 at %p (%p)\n", (void*)addr, (void*)(addr - 1)); - #endif +#endif } - #if STEP < 2 - if (!rex.is32bits && isNativeCall(dyn, addr + i32, &dyn->insts[ninst].natcall, &dyn->insts[ninst].retn)) +#if STEP < 2 + if (!rex.is32bits && !dyn->need_reloc && IsNativeCall(addr + i32, rex.is32bits, &dyn->insts[ninst].natcall, &dyn->insts[ninst].retn)) tmp = dyn->insts[ninst].pass2choice = 3; else - tmp = dyn->insts[ninst].pass2choice = 0; - #else + tmp = dyn->insts[ninst].pass2choice = i32 ? 0 : 1; +#else tmp = dyn->insts[ninst].pass2choice; - #endif +#endif switch (tmp) { case 3: - SETFLAGS(X_ALL, SF_SET); // Hack to set flags to "dont'care" state + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags to "dont'care" state SKIPTEST(x1); BARRIER(BARRIER_FULL); - // BARRIER_NEXT(BARRIER_FULL); - if (dyn->last_ip && (addr - dyn->last_ip < 0x1000)) { + if (dyn->last_ip && ((addr - dyn->last_ip < 0x800) || (dyn->last_ip - addr < 0x800))) { ADDI_D(x2, xRIP, addr - dyn->last_ip); } else { - TABLE64(x2, addr); + if (dyn->need_reloc) { + TABLE64(x2, addr); + } else { + MOV64x(x2, addr); + } } PUSH1(x2); MESSAGE(LOG_DUMP, "Native Call to %s (retn=%d)\n", GetNativeName(GetNativeFnc(dyn->insts[ninst].natcall - 1)), dyn->insts[ninst].retn); // calling a native function sse_purge07cache(dyn, ninst, x3); - if ((box64_log < 2 && !cycle_log) && dyn->insts[ninst].natcall) { - // FIXME: Add basic support for isSimpleWrapper - tmp = 0; // isSimpleWrapper(*(wrapper_t*)(dyn->insts[ninst].natcall + 2)); + if ((BOX64ENV(log) < 2 && !BOX64ENV(rolling_log)) && dyn->insts[ninst].natcall) { + // Partially support isSimpleWrapper + tmp = isSimpleWrapper(*(wrapper_t*)(dyn->insts[ninst].natcall + 2)); } else tmp = 0; - if (tmp < 0 || tmp > 1) + if (tmp < 0 || (tmp & 15) > 1) tmp = 0; // TODO: removed when FP is in place - // FIXME: if (dyn->insts[ninst].natcall && isRetX87Wrapper(*(wrapper_t*)(dyn->insts[ninst].natcall + 2))) - // // return value will be on the stack, so the stack depth needs to be updated - // x87_purgecache(dyn, ninst, 0, x3, x1, x4); - if ((box64_log < 2 && !cycle_log) && dyn->insts[ninst].natcall && tmp) { - // GETIP(ip+3+8+8); // read the 0xCC - // FIXME: call_n(dyn, ninst, *(void**)(dyn->insts[ninst].natcall + 2 + 8), tmp); + if (dyn->insts[ninst].natcall && isRetX87Wrapper(*(wrapper_t*)(dyn->insts[ninst].natcall + 2))) + // return value will be on the stack, so the stack depth needs to be updated + x87_purgecache(dyn, ninst, 0, x3, x1, x4); + if ((BOX64ENV(log) < 2 && !BOX64ENV(rolling_log)) && dyn->insts[ninst].natcall && tmp) { + call_n(dyn, ninst, (void*)(dyn->insts[ninst].natcall + 2 + 8), tmp); + SMWRITE2(); POP1(xRIP); // pop the return address dyn->last_ip = addr; } else { - GETIP_(dyn->insts[ninst].natcall); // read the 0xCC already + GETIP_(dyn->insts[ninst].natcall, x7); // read the 0xCC already STORE_XEMU_CALL(); ADDI_D(x1, xEmu, (uint32_t)offsetof(x64emu_t, ip)); // setup addr as &emu->ip - CALL_S(x64Int3, -1); + CALL_S(const_int3, -1, x1); + SMWRITE2(); LOAD_XEMU_CALL(); - TABLE64(x3, dyn->insts[ninst].natcall); + MOV64x(x3, dyn->insts[ninst].natcall); ADDI_D(x3, x3, 2 + 8 + 8); BNE_MARK(xRIP, x3); // Not the expected address, exit dynarec block POP1(xRIP); // pop the return address if (dyn->insts[ninst].retn) { - if (dyn->insts[ninst].retn < 0x1000) { + if (dyn->insts[ninst].retn < 0x800) { ADDI_D(xRSP, xRSP, dyn->insts[ninst].retn); } else { MOV64x(x3, dyn->insts[ninst].retn); ADD_D(xRSP, xRSP, x3); } } - TABLE64(x3, addr); - BNE_MARK(xRIP, x3); // Not the expected address again - LD_W(w1, xEmu, offsetof(x64emu_t, quit)); - CBZ_NEXT(w1); + LD_W(x1, xEmu, offsetof(x64emu_t, quit)); + CBZ_NEXT(x1); MARK; jump_to_epilog_fast(dyn, 0, xRIP, ninst); dyn->last_ip = addr; } break; + case 1: + // this is call to next step, so just push the return address to the stack + if (dyn->need_reloc) { + TABLE64(x2, addr); + } else { + MOV64x(x2, addr); + } + PUSH1z(x2); + break; default: - if ((box64_dynarec_safeflags > 1) || (ninst && dyn->insts[ninst - 1].x64.set_flags)) { + if ((BOX64DRENV(dynarec_safeflags) > 1) || (ninst && dyn->insts[ninst - 1].x64.set_flags)) { READFLAGS(X_PEND); // that's suspicious } else { - SETFLAGS(X_ALL, SF_SET); // Hack to set flags to "dont'care" state + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags to "dont'care" state } // regular call - /*if (box64_dynarec_callret && box64_dynarec_bigblock > 1) { - BARRIER(BARRIER_FULL); - } else { - BARRIER(BARRIER_FLOAT); - *need_epilog = 0; - *ok = 0; - }*/ - - if (rex.is32bits) { - MOV32w(x2, addr); - } else { + if (dyn->need_reloc) { TABLE64(x2, addr); + } else { + MOV64x(x2, addr); } - fpu_purgecache(dyn, ninst, 1, x1, x3, x4); + BARRIER(BARRIER_FLOAT); PUSH1z(x2); - if (box64_dynarec_callret) { + if (BOX64DRENV(dynarec_callret)) { SET_HASCALLRET(); // Push actual return address if (addr < (dyn->start + dyn->isize)) { @@ -1919,10 +3381,10 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni ADDI_D(x4, x4, j64 & 0xfff); MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64 >> 2); } else { - MESSAGE(LOG_NONE, "\tCALLRET set return to Jmptable(%p)\n", (void*)addr); - j64 = getJumpTableAddress64(addr); - TABLE64(x4, j64); - LD_D(x4, x4, 0); + j64 = (dyn->insts) ? (GETMARK - (dyn->native_size)) : 0; + PCADDU12I(x4, ((j64 + 0x800) >> 12) & 0xfffff); + ADDI_D(x4, x4, j64 & 0xfff); + MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64 >> 2); } ADDI_D(xSP, xSP, -16); ST_D(x4, xSP, 0); @@ -1931,14 +3393,30 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni *ok = 0; *need_epilog = 0; } - jump_to_next(dyn, addr + i32, 0, ninst, rex.is32bits); + if (rex.is32bits) + j64 = (uint32_t)(addr + i32); + else + j64 = addr + i32; + jump_to_next(dyn, j64, 0, ninst, rex.is32bits); + if (BOX64DRENV(dynarec_callret) && addr >= (dyn->start + dyn->isize)) { + // jumps out of current dynablock... + MARK; + j64 = getJumpTableAddress64(addr); + if (dyn->need_reloc) { + AddRelocTable64JmpTbl(dyn, ninst, addr, STEP); + TABLE64_(x4, j64); + } else { + MOV64x(x4, j64); + } + LD_D(x4, x4, 0); + BR(x4); + } break; } break; case 0xE9: case 0xEB: BARRIER(BARRIER_MAYBE); - if (box64_dynarec_test == 2) { NOTEST(x1); } if (opcode == 0xE9) { INST_NAME("JMP Id"); i32 = F32S; @@ -1946,11 +3424,15 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("JMP Ib"); i32 = F8S; } - JUMP((uintptr_t)getAlternate((void*)(addr + i32)), 0); + if (rex.is32bits) + j64 = (uint32_t)(addr + i32); + else + j64 = addr + i32; + JUMP((uintptr_t)getAlternate((void*)j64), 0); if (dyn->insts[ninst].x64.jmp_insts == -1) { // out of the block - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); - jump_to_next(dyn, (uintptr_t)getAlternate((void*)(addr + i32)), 0, ninst, rex.is32bits); + BARRIER(BARRIER_FLOAT); + jump_to_next(dyn, (uintptr_t)getAlternate((void*)j64), 0, ninst, rex.is32bits); } else { // inside the block CacheTransform(dyn, ninst, CHECK_CACHE(), x1, x2, x3); @@ -1965,8 +3447,96 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni *need_epilog = 0; *ok = 0; break; - case 0xF0: - addr = dynarec64_F0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + case 0xEA: + if (rex.is32bits) { + DEFAULT; + } else { + INST_NAME("Illegal EA"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; + case 0xEC ... 0xEF: + if (opcode == 0xEC) + INST_NAME("IN AL, DX"); + else if (opcode == 0xED) + INST_NAME("IN EAX, DX"); + else if (opcode == 0xEE) + INST_NAME("OUT DX, AL"); + else + INST_NAME("OUT DX, EAX"); + if (rex.is32bits && BOX64ENV(ignoreint3)) { + } else { + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_priv, -1, 0, 0); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + } + break; + case 0xF1: + INST_NAME("INT1"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_priv, -1, 0, 0); // is that a privileged opcodes or an int 1?? + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + break; + case 0xF4: + INST_NAME("HLT"); + if (box64_unittest_mode) { // HLT in unittest mode is an exit + READFLAGS(X_ALL); + BARRIER(BARRIER_FLOAT); + MOV32w(x1, 1); + ST_W(x1, xEmu, offsetof(x64emu_t, quit)); + } else { + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_priv, -1, 0, 0); + LOAD_XEMU_CALL(); + } + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + break; + case 0xF5: + INST_NAME("CMC"); + READFLAGS(X_CF); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + if (cpuext.lbt) { + X64_GET_EFLAGS(x3, X_CF); + XORI(x3, x3, 1 << F_CF); + X64_SET_EFLAGS(x3, X_CF); + } else { + XORI(xFlags, xFlags, 1 << F_CF); + } break; case 0xF6: nextop = F8; @@ -1974,11 +3544,19 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0: case 1: INST_NAME("TEST Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEB(x1, 1); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + if (MODREG && (rex.rex || (((nextop & 7) >> 2) == 0))) { + // quick path for low 8bit registers + if (rex.rex) + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + else + ed = TO_NAT(nextop & 3); + } else { + GETEB(x1, 1); + ed = x1; + } u8 = F8; - MOV32w(x2, u8); - emit_test8(dyn, ninst, x1, x2, x3, x4, x5); + emit_test8c(dyn, ninst, ed, u8, x3, x4, x5); break; case 2: INST_NAME("NOT Eb"); @@ -1988,20 +3566,112 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 3: INST_NAME("NEG Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 0); emit_neg8(dyn, ninst, x1, x2, x4); EBBACK(); break; case 4: - INST_NAME("MUL AL, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - UFLAG_DF(x1, d_mul8); + INST_NAME("MUL AL, Eb"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); GETEB(x1, 0); ANDI(x2, xRAX, 0xff); MUL_W(x1, x2, x1); - UFLAG_RES(x1); BSTRINS_D(xRAX, x1, 15, 0); + SET_DFNONE(); + CLEAR_FLAGS(x3); + IFX (X_CF | X_OF) { + SRLI_D(x3, x1, 8); + SNEZ(x3, x3); + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); + } + IFX (X_SF) { + SRLI_D(x3, xRAX, 7); + BSTRINS_D(xFlags, x3, F_SF, F_SF); + } + IFX (X_PF) emit_pf(dyn, ninst, xRAX, x3, x4); + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + break; + case 5: + INST_NAME("IMUL AL, Eb"); + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); + GETSEB(x1, 0); + EXT_W_B(x2, xRAX); + MUL_W(x1, x2, x1); + BSTRINS_D(xRAX, x1, 15, 0); + SET_DFNONE(); + CLEAR_FLAGS(x3); + IFX (X_CF | X_OF) { + EXT_W_H(x1, xRAX); + EXT_W_B(x2, x1); + XOR(x3, x1, x2); + SNEZ(x3, x3); + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); + } + IFX (X_SF) { + SRLI_D(x3, xRAX, 7); + BSTRINS_D(xFlags, x3, F_SF, F_SF); + } + IFX (X_PF) emit_pf(dyn, ninst, xRAX, x3, x4); + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + break; + case 6: + INST_NAME("DIV Eb"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETEB(x1, 0); + BSTRPICK_D(x2, xRAX, 15, 0); + if (BOX64ENV(dynarec_div0)) { + BNE_MARK3(x1, xZR); + GETIP_(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_div0, -1, 0, 0); + CLEARIP(); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + MARK3; + } + DIV_WU(x3, x2, ed); // warning: x2 and ed must be signed extended! + MOD_WU(x4, x2, ed); // warning: x2 and ed must be signed extended! + BSTRINS_D(xRAX, x3, 7, 0); + BSTRINS_D(xRAX, x4, 15, 8); + FORCE_DFNONE(); + RESTORE_EFLAGS(x3); + IFX (X_ZF | X_PF) ADDI_D(x6, xZR, 1); + IFX (X_OF) BSTRINS_D(xFlags, xZR, F_OF, F_OF); + IFX (X_CF) BSTRINS_D(xFlags, xZR, F_CF, F_CF); + IFX (X_AF) BSTRINS_D(xFlags, xZR, F_AF, F_AF); + IFX (X_ZF) BSTRINS_D(xFlags, x6, F_ZF, F_ZF); + IFX (X_SF) BSTRINS_D(xFlags, xZR, F_SF, F_SF); + IFX (X_PF) BSTRINS_D(xFlags, x6, F_PF, F_PF); + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + break; + case 7: + INST_NAME("IDIV Eb"); + SKIPTEST(x1); + if (BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_SF | X_PF | X_ZF | X_AF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else if (BOX64ENV(cputype)) { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } + GETSEB(x1, 0); + if (BOX64ENV(dynarec_div0)) { + BNE_MARK3(x1, xZR); + GETIP_(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_div0, -1, 0, 0); + CLEARIP(); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + MARK3; + } + EXT_W_H(x2, xRAX); + DIV_W(x3, x2, ed); // warning: x2 and ed must be signed extended! + MOD_W(x4, x2, ed); // warning: x2 and ed must be signed extended! + BSTRINS_D(xRAX, x3, 7, 0); + BSTRINS_D(xRAX, x4, 15, 8); + FORCE_DFNONE(); break; default: DEFAULT; @@ -2013,7 +3683,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0: case 1: INST_NAME("TEST Ed, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED(4); i64 = F32S; emit_test32c(dyn, ninst, rex, ed, i64, x3, x4, x5); @@ -2022,21 +3692,20 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("NOT Ed"); GETED(0); NOR(ed, ed, xZR); - if(!rex.w && MODREG) + if (!rex.w && MODREG) ZEROUP(ed); WBACK; break; case 3: INST_NAME("NEG Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED(0); emit_neg32(dyn, ninst, rex, ed, x3, x4); WBACK; break; case 4: INST_NAME("MUL EAX, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - UFLAG_DF(x2, rex.w ? d_mul64 : d_mul32); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); GETED(0); if (rex.w) { if (ed == xRDX) @@ -2047,22 +3716,32 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MUL_D(xRAX, xRAX, ed); if (gd != xRDX) { MV(xRDX, gd); } } else { - AND(x3, xRAX, xMASK); + ZEROUP2(x3, xRAX); if (MODREG) { - AND(x4, ed, xMASK); + ZEROUP2(x4, ed); ed = x4; } MUL_D(xRDX, x3, ed); // 64 <- 32x32 - AND(xRAX, xRDX, xMASK); + ZEROUP2(xRAX, xRDX); SRLI_D(xRDX, xRDX, 32); } - UFLAG_RES(xRAX); - UFLAG_OP1(xRDX); + SET_DFNONE(); + CLEAR_FLAGS(x3); + IFX (X_CF | X_OF) { + SNEZ(x3, xRDX); + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); + } + IFX (X_SF) { + SRLI_D(x3, xRAX, rex.w ? 63 : 31); + BSTRINS_D(xFlags, x3, F_SF, F_SF); + } + IFX (X_PF) emit_pf(dyn, ninst, xRAX, x3, x5); + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); break; case 5: INST_NAME("IMUL EAX, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - UFLAG_DF(x2, rex.w ? d_imul64 : d_imul32); + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); GETSED(0); if (rex.w) { if (ed == xRDX) @@ -2075,81 +3754,134 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { ADDI_W(x3, xRAX, 0); // sign extend 32bits-> 64bits MUL_D(xRDX, x3, ed); // 64 <- 32x32 - AND(xRAX, xRDX, xMASK); + ZEROUP2(xRAX, xRDX); SRLI_D(xRDX, xRDX, 32); } - UFLAG_RES(xRAX); - UFLAG_OP1(xRDX); + SET_DFNONE(); + CLEAR_FLAGS(x3); + IFX (X_CF | X_OF | X_SF) { + SRAIxw(x5, xRAX, rex.w ? 63 : 31); + MVxw(x6, xRDX); + XOR(x3, x6, x5); + SNEZ(x3, x3); + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); + IFX (X_SF) BSTRINS_D(xFlags, x5, F_SF, F_SF); + } + IFX (X_PF) emit_pf(dyn, ninst, xRAX, x3, x5); + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); break; case 6: INST_NAME("DIV Ed"); - SETFLAGS(X_ALL, SF_SET); - // TODO: handle zero divisor + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + FORCE_DFNONE(); if (!rex.w) { - SET_DFNONE(); GETED(0); - SLLI_D(x3, xRDX, 32); - AND(x2, xRAX, xMASK); - OR(x3, x3, x2); - if (MODREG) { - AND(x4, ed, xMASK); - ed = x4; + if (ninst && (nextop == 0xF0) + && dyn->insts[ninst - 1].x64.addr + && *(uint8_t*)(dyn->insts[ninst - 1].x64.addr) == 0xB8 + && *(uint32_t*)(dyn->insts[ninst - 1].x64.addr + 1) == 0) { + // hack for some protection that check a divide by zero actually trigger a divide by zero exception + MESSAGE(LOG_INFO, "Divide by 0 hack\n"); + GETIP(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_div0, -1, 0, 0); + LOAD_XEMU_CALL(); + } else { + if (BOX64ENV(dynarec_div0)) { + BNE_MARK3(ed, xZR); + GETIP_(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_div0, -1, 0, 0); + CLEARIP(); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + MARK3; + } + SLLI_D(x3, xRDX, 32); + ZEROUP2(x2, xRAX); + OR(x3, x3, x2); + if (MODREG) { + ZEROUP2(x4, ed); + ed = x4; + } + DIV_DU(x2, x3, ed); + MOD_DU(xRDX, x3, ed); + ZEROUP2(xRAX, x2); + ZEROUP(xRDX); } - DIV_DU(x2, x3, ed); - MOD_DU(xRDX, x3, ed); - AND(xRAX, x2, xMASK); - ZEROUP(xRDX); } else { if (ninst && dyn->insts[ninst - 1].x64.addr && *(uint8_t*)(dyn->insts[ninst - 1].x64.addr) == 0x31 && *(uint8_t*)(dyn->insts[ninst - 1].x64.addr + 1) == 0xD2) { - SET_DFNONE(); GETED(0); + if (BOX64ENV(dynarec_div0)) { + BNE_MARK3(ed, xZR); + GETIP_(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_div0, -1, 0, 0); + CLEARIP(); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + MARK3; + } DIV_DU(x2, xRAX, ed); MOD_DU(xRDX, xRAX, ed); MV(xRAX, x2); } else { - GETEDH(x1, 0); // get edd changed addr, so cannot be called 2 times for same op... + GETEDH(x4, x1, 0); // get edd changed addr, so cannot be called 2 times for same op... + if (BOX64ENV(dynarec_div0)) { + BNE_MARK3(ed, xZR); + GETIP_(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_div0, -1, 0, 0); + CLEARIP(); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + MARK3; + } BEQ_MARK(xRDX, xZR); - if (ed != x1) { MV(x1, ed); } - CALL(div64, -1); + CALL(const_div64, -1, ed, 0); B_NEXT_nocond; MARK; DIV_DU(x2, xRAX, ed); MOD_DU(xRDX, xRAX, ed); MV(xRAX, x2); - SET_DFNONE(); } } + CLEAR_FLAGS(x7); + IFX (X_ZF) ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_PF) ORI(xFlags, xFlags, 1 << F_PF); + SPILL_EFLAGS(); break; case 7: INST_NAME("IDIV Ed"); SKIPTEST(x1); - SETFLAGS(X_ALL, SF_SET); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); // TODO: handle zero divisor if (!rex.w) { - SET_DFNONE() + SET_DFNONE(); GETSED(0); SLLI_D(x3, xRDX, 32); - AND(x2, xRAX, xMASK); + ZEROUP2(x2, xRAX); OR(x3, x3, x2); DIV_D(x2, x3, ed); MOD_D(xRDX, x3, ed); - AND(xRAX, x2, xMASK); + ZEROUP2(xRAX, x2); ZEROUP(xRDX); } else { if (ninst && dyn->insts && dyn->insts[ninst - 1].x64.addr && *(uint8_t*)(dyn->insts[ninst - 1].x64.addr) == 0x48 && *(uint8_t*)(dyn->insts[ninst - 1].x64.addr + 1) == 0x99) { - SET_DFNONE() + FORCE_DFNONE(); GETED(0); DIV_D(x2, xRAX, ed); MOD_D(xRDX, xRAX, ed); MV(xRAX, x2); } else { - GETEDH(x1, 0); // get edd changed addr, so cannot be called 2 times for same op... + GETEDH(x4, x1, 0); // get edd changed addr, so cannot be called 2 times for same op... // need to see if RDX == 0 and RAX not signed // or RDX == -1 and RAX signed BNE_MARK2(xRDX, xZR); @@ -2159,14 +3891,13 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni BNE_MARK3(x2, xZR); BLT_MARK(xRAX, xZR); MARK3; - if (ed != x1) MV(x1, ed); - CALL((void*)idiv64, -1); + CALL(const_idiv64, -1, ed, 0); B_NEXT_nocond; MARK; DIV_D(x2, xRAX, ed); MOD_D(xRDX, xRAX, ed); MV(xRAX, x2); - SET_DFNONE() + FORCE_DFNONE(); } } break; @@ -2174,6 +3905,45 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni DEFAULT; } break; + case 0xF8: + INST_NAME("CLC"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + if (cpuext.lbt) + X64_SET_EFLAGS(xZR, X_CF); + else + BSTRINS_D(xFlags, xZR, F_CF, F_CF); + break; + case 0xF9: + INST_NAME("STC"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + if (cpuext.lbt) { + ORI(x3, xZR, 1 << F_CF); + X64_SET_EFLAGS(x3, X_CF); + } else { + ORI(xFlags, xFlags, 1 << F_CF); + } + break; + case 0xFA: + case 0xFB: + INST_NAME(opcode == 0xFA ? "CLI" : "STI"); + if (rex.is32bits && BOX64ENV(ignoreint3)) { + } else { + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); // priviledged instruction, IP not updated + STORE_XEMU_CALL(); + CALL(const_native_priv, -1, 0, 0); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + } + break; case 0xFC: INST_NAME("CLD"); BSTRINS_D(xFlags, xZR, F_DF, F_DF); @@ -2187,14 +3957,14 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni switch ((nextop >> 3) & 7) { case 0: INST_NAME("INC Eb"); - SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); GETEB(x1, 0); emit_inc8(dyn, ninst, ed, x2, x4, x5); EBBACK(); break; case 1: INST_NAME("DEC Eb"); - SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); GETEB(x1, 0); emit_dec8(dyn, ninst, ed, x2, x4, x5); EBBACK(); @@ -2208,35 +3978,35 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni switch ((nextop >> 3) & 7) { case 0: // INC Ed INST_NAME("INC Ed"); - SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); GETED(0); emit_inc32(dyn, ninst, rex, ed, x3, x4, x5, x6); WBACK; break; case 1: // DEC Ed INST_NAME("DEC Ed"); - SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); GETED(0); emit_dec32(dyn, ninst, rex, ed, x3, x4, x5, x6); WBACK; break; case 2: INST_NAME("CALL Ed"); - PASS2IF ((box64_dynarec_safeflags > 1) || ((ninst && dyn->insts[ninst - 1].x64.set_flags) || ((ninst > 1) && dyn->insts[ninst - 2].x64.set_flags)), 1) { + PASS2IF ((BOX64DRENV(dynarec_safeflags) > 1) || ((ninst && dyn->insts[ninst - 1].x64.set_flags) || ((ninst > 1) && dyn->insts[ninst - 2].x64.set_flags)), 1) { READFLAGS(X_PEND); // that's suspicious } else { - SETFLAGS(X_ALL, SF_SET); // Hack to put flag in "don't care" state + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to put flag in "don't care" state } GETEDz(0); - if (box64_dynarec_callret && box64_dynarec_bigblock > 1) { + if (BOX64DRENV(dynarec_callret) && BOX64DRENV(dynarec_bigblock) > 1) { BARRIER(BARRIER_FULL); } else { BARRIER(BARRIER_FLOAT); *need_epilog = 0; *ok = 0; } - GETIP_(addr); - if (box64_dynarec_callret) { + GETIP_(addr, x7); + if (BOX64DRENV(dynarec_callret)) { SET_HASCALLRET(); // Push actual return address if (addr < (dyn->start + dyn->isize)) { @@ -2246,10 +4016,10 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni ADDI_D(x4, x4, j64 & 0xfff); MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64 >> 2); } else { - MESSAGE(LOG_NONE, "\tCALLRET set return to Jmptable(%p)\n", (void*)addr); - j64 = getJumpTableAddress64(addr); - TABLE64(x4, j64); - LD_D(x4, x4, 0); + j64 = (dyn->insts) ? (GETMARK - (dyn->native_size)) : 0; + PCADDU12I(x4, ((j64 + 0x800) >> 12) & 0xfffff); + ADDI_D(x4, x4, j64 & 0xfff); + MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64 >> 2); } ADDI_D(xSP, xSP, -16); ST_D(x4, xSP, 0); @@ -2257,6 +4027,76 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } PUSH1z(xRIP); jump_to_next(dyn, 0, ed, ninst, rex.is32bits); + if (BOX64DRENV(dynarec_callret) && addr >= (dyn->start + dyn->isize)) { + // jumps out of current dynablock... + MARK; + j64 = getJumpTableAddress64(addr); + if (dyn->need_reloc) AddRelocTable64RetEndBlock(dyn, ninst, addr, STEP); + TABLE64_(x4, j64); + LD_D(x4, x4, 0); + BR(x4); + } + break; + case 3: // CALL FAR Ed + if (MODREG) { + DEFAULT; + } else { + INST_NAME("CALL FAR Ed"); + READFLAGS(X_PEND); + BARRIER(BARRIER_FLOAT); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 0, 0); + LDxw(x1, wback, 0); + ed = x1; + LD_HU(x3, wback, rex.w ? 8 : 4); + LD_HU(x5, xEmu, offsetof(x64emu_t, segs[_CS])); + if (BOX64DRENV(dynarec_callret) && BOX64DRENV(dynarec_bigblock) > 1) { + BARRIER(BARRIER_FULL); + } else { + BARRIER(BARRIER_FLOAT); + *need_epilog = 0; + *ok = 0; + } + GETIP_(addr, x7); + if (BOX64DRENV(dynarec_callret)) { + SET_HASCALLRET(); + // Push actual return address. Note that CS will not be tested, but that should be ok? + if (addr < (dyn->start + dyn->isize)) { + // there is a next... + j64 = (dyn->insts) ? (dyn->insts[ninst].epilog - (dyn->native_size)) : 0; + PCADDU12I(x4, ((j64 + 0x800) >> 12) & 0xfffff); + ADDI_D(x4, x4, j64 & 0xfff); + MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64 >> 2); + } else { + j64 = (dyn->insts) ? (GETMARK - (dyn->native_size)) : 0; + PCADDU12I(x4, ((j64 + 0x800) >> 12) & 0xfffff); + ADDI_D(x4, x4, j64 & 0xfff); + MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64 >> 2); + } + ADDI_D(xSP, xSP, -16); + ST_D(x4, xSP, 0); + ST_D(xRIP, xSP, 8); + } + if (rex.w) { + PUSH1(x5); + PUSH1(xRIP); + } else { + PUSH1_32(x5); + PUSH1_32(xRIP); + } + ST_H(x3, xEmu, offsetof(x64emu_t, segs[_CS])); + jump_to_next(dyn, 0, ed, ninst, rex.is32bits); + if (BOX64DRENV(dynarec_callret) && addr >= (dyn->start + dyn->isize)) { + // jumps out of current dynablock... + MARK; + j64 = getJumpTableAddress64(addr); + if (dyn->need_reloc) AddRelocTable64RetEndBlock(dyn, ninst, addr, STEP); + TABLE64_(x4, j64); + LD_D(x4, x4, 0); + BR(x4); + } + CLEARIP(); + } break; case 4: // JMP Ed INST_NAME("JMP Ed"); @@ -2267,10 +4107,29 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni *need_epilog = 0; *ok = 0; break; + case 5: // JMP FAR Ed + if (MODREG) { + DEFAULT; + } else { + INST_NAME("JMP FAR Ed"); + READFLAGS(X_PEND); + BARRIER(BARRIER_FLOAT); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 0, 0); + LDxw(x1, wback, 0); + ed = x1; + LD_HU(x3, wback, rex.w ? 8 : 4); + ST_H(x3, xEmu, offsetof(x64emu_t, segs[_CS])); + jump_to_next(dyn, 0, ed, ninst, rex.w ? 0 : 1); + *need_epilog = 0; + *ok = 0; + } + break; case 6: // Push Ed INST_NAME("PUSH Ed"); GETEDz(0); PUSH1z(ed); + SMWRITE(); break; default: diff --git a/src/dynarec/la64/dynarec_la64_0f.c b/src/dynarec/la64/dynarec_la64_0f.c index 2bdc22a..1abe663 100644 --- a/src/dynarec/la64/dynarec_la64_0f.c +++ b/src/dynarec/la64/dynarec_la64_0f.c @@ -5,11 +5,10 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "la64_emitter.h" -#include "x64run.h" +#include "la64_mapping.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -20,11 +19,12 @@ #include "emu/x87emu_private.h" #include "emu/x64shaext.h" #include "bitutils.h" - +#include "freq.h" #include "la64_printer.h" #include "dynarec_la64_private.h" #include "dynarec_la64_functions.h" -#include "dynarec_la64_helper.h" +#include "elfloader.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { @@ -37,6 +37,7 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni uint8_t wb1, wback, wb2, gback; uint8_t eb1, eb2; uint8_t gb1, gb2; + uint8_t tmp1, tmp2, tmp3; int32_t i32, i32_; int cacheupd = 0; int v0, v1; @@ -63,8 +64,8 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x01: // TODO:, /0 is SGDT. While 0F 01 D0 is XGETBV, etc... nextop = F8; - if(MODREG) { - switch(nextop) { + if (MODREG) { + switch (nextop) { case 0xD0: INST_NAME("XGETBV"); BEQZ_MARK(xRCX); @@ -77,7 +78,7 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni DEFAULT; } } else { - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { default: DEFAULT; } @@ -87,31 +88,62 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("SYSCALL"); NOTEST(x1); SMEND(); - GETIP(addr); + GETIP(addr, x7); STORE_XEMU_CALL(); - CALL_S(x64Syscall, -1); + if(!box64_wine || FindElfAddress(my_context, ip)) { + CALL_S(const_x64syscall_linux, -1, 0); + } else { + CALL_S(const_x64syscall, -1, 0); + } LOAD_XEMU_CALL(); TABLE64(x3, addr); // expected return address BNE_MARK(xRIP, x3); - LD_W(w1, xEmu, offsetof(x64emu_t, quit)); - CBZ_NEXT(w1); + LD_W(x1, xEmu, offsetof(x64emu_t, quit)); + CBZ_NEXT(x1); MARK; LOAD_XEMU_REM(); jump_to_epilog(dyn, 0, xRIP, ninst); break; case 0x0B: INST_NAME("UD2"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state - GETIP(ip); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); STORE_XEMU_CALL(); - CALL(native_ud, -1); + CALL(const_native_ud, -1, 0, 0); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; *ok = 0; break; + case 0x0D: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("PREFETCH"); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + PRELD(0, ed, 0); + break; + case 1: + INST_NAME("PREFETCHW"); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + PRELD(8, ed, 0); + break; + case 2: + INST_NAME("PREFETCHWT1"); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + PRELD(8, ed, 0); + break; + default: // NOP + FAKEED; + break; + } + break; case 0x10: - INST_NAME("MOVUPS Gx,Ex"); + INST_NAME("MOVUPS Gx, Ex"); nextop = F8; GETG; if (MODREG) { @@ -144,23 +176,25 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x12: nextop = F8; if (MODREG) { - INST_NAME("MOVHLPS Gx,Ex"); + INST_NAME("MOVHLPS Gx, Ex"); GETGX(v0, 1); v1 = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0); VEXTRINS_D(v0, v1, 1); } else { - INST_NAME("MOVLPS Gx,Ex"); + INST_NAME("MOVLPS Gx, Ex"); GETGX(v0, 1); SMREAD(); - GETEX(q1, 0, 0); - VEXTRINS_D(v0, q1, 0); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + FLD_D(v1, ed, fixedaddress); + VEXTRINS_D(v0, v1, 0); } break; case 0x13: nextop = F8; INST_NAME("MOVLPS Ex,Gx"); GETGX(v0, 0); - if(MODREG) { + if (MODREG) { v1 = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 1); VEXTRINS_D(v1, v0, 0); } else { @@ -172,7 +206,6 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x14: INST_NAME("UNPCKLPS Gx, Ex"); nextop = F8; - SMREAD(); GETEX(q0, 0, 0); GETGX(v0, 1); VILVL_W(v0, q0, v0); @@ -180,7 +213,6 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x15: INST_NAME("UNPCKHPS Gx, Ex"); nextop = F8; - SMREAD(); GETEX(q0, 0, 0); GETGX(v0, 1); VILVH_W(v0, q0, v0); @@ -188,11 +220,11 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x16: nextop = F8; if (MODREG) { - INST_NAME("MOVLHPS Gx,Ex"); + INST_NAME("MOVLHPS Gx, Ex"); GETGX(v0, 1); v1 = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0); } else { - INST_NAME("MOVHPS Gx,Ex"); + INST_NAME("MOVHPS Gx, Ex"); SMREAD(); GETGX(v0, 1); v1 = fpu_get_scratch(dyn); @@ -205,42 +237,57 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni nextop = F8; INST_NAME("MOVHPS Ex,Gx"); GETGX(v0, 0); - if(MODREG) { + if (MODREG) { v1 = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 1); VEXTRINS_D(v1, v0, 0x01); } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); - v1 = fpu_get_scratch(dyn); - VEXTRINS_D(v1, v0, 0x01); - FST_D(v1, ed, fixedaddress); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VSTELM_D(v0, ed, 0, 1); SMWRITE2(); } break; case 0x18: nextop = F8; - if ((nextop & 0xC0) == 0xC0) { + if (MODREG) { INST_NAME("NOP (multibyte)"); } else switch ((nextop >> 3) & 7) { case 0: + INST_NAME("PREFETCHNTA Ed"); + FAKEED; + break; case 1: + INST_NAME("PREFETCHT0 Ed"); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + PRELD(0, ed, 0); + break; case 2: - case 3: - INST_NAME("PREFETCHh Ed"); + INST_NAME("PREFETCHT1 Ed"); FAKEED; break; + case 3: + INST_NAME("PREFETCHT2 Ed"); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + PRELDX_LOAD_L3_1CACHELINE(ed, x4); // is this a good idea? + break; default: INST_NAME("NOP (multibyte)"); FAKEED; } break; + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: case 0x1F: INST_NAME("NOP (multibyte)"); nextop = F8; FAKEED; break; case 0x28: - INST_NAME("MOVAPS Gx,Ex"); + INST_NAME("MOVAPS Gx, Ex"); nextop = F8; GETG; if (MODREG) { @@ -270,8 +317,19 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SMWRITE2(); } break; + case 0x2A: + INST_NAME("CVTPI2PS Gx,Em"); + nextop = F8; + GETGX(v0, 1); + GETEM(v1, 0); + q0 = fpu_get_scratch(dyn); + u8 = sse_setround(dyn, ninst, x1, x2); + VFFINT_S_W(q0, v1); + x87_restoreround(dyn, ninst, u8); + VEXTRINS_D(v0, q0, VEXTRINS_IMM_4_0(0, 0)); + break; case 0x2B: - INST_NAME("MOVNTPS Ex,Gx"); + INST_NAME("MOVNTPS Ex, Gx"); nextop = F8; GETG; v0 = sse_get_reg(dyn, ninst, x1, gd, 0); @@ -284,6 +342,73 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni VST(v0, ed, fixedaddress); } break; + case 0x2C: + INST_NAME("CVTTPS2PI Gm, Ex"); + nextop = F8; + GETGM(v0); + GETEXSD(v1, 0, 0); + if (BOX64ENV(dynarec_fastround)) { + VFTINTRZ_W_S(v0, v1); + } else { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + VFTINTRZ_W_S(v0, v1); + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + MOV32w(x3, (1 << FR_V) | (1 << FR_O)); + AND(x5, x5, x3); + BEQZ_MARK3(x5); // no fp exception, work done. + + // check +/-Nan, +overlow ,replace with 0x80000000 + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); // mask + d0 = fpu_get_scratch(dyn); + VLDI(q0, 0b1001110000000); // broadcast 0x80000000 to all + VLDI(d0, (0b10011 << 8) | 0x4f); + VFCMP_S(q1, d0, v1, cULE); // get Nan,+overflow mark + VBITSEL_V(v0, v0, q0, q1); + + MARK3; + } + break; + case 0x2D: + INST_NAME("CVTPS2PI Gm, Ex"); + nextop = F8; + GETGM(v0); + GETEXSD(v1, 0, 0); + u8 = sse_setround(dyn, ninst, x4, x6); + if (BOX64ENV(dynarec_fastround)) { + VFTINTRZ_W_S(v0, v1); + } else { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + VFTINT_W_S(v0, v1); + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + MOV32w(x3, (1 << FR_V) | (1 << FR_O)); + AND(x5, x5, x3); + BEQZ_MARK3(x5); // no fp exception, work done, fast path. + + // check +/-Nan, +overlow ,replace with 0x80000000 + /* LoongArch follow IEEE754-2008, + if val < -2147483648.0f got -2147483648 match sse + if var > 2147483648.0f got 2147483647 need mask + but lucky _Float32 is not accurate: + -2147483648.0f is 0xcf000000 (_Float32) + -2147483520.0f is 0xceffffff (_Float32) + 2147483648.0f is 0x4f000000 (_Float32) + 2147483520.0f is 0x4effffff (_Float32) + combine (unorder || gt 0x4f000000) + use cULE for (unodered || 0x4f000000 <= v1[x]) + */ + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); // mask + d0 = fpu_get_scratch(dyn); + VLDI(q0, 0b1001110000000); // broadcast 0x80000000 to all + VLDI(d0, (0b10011 << 8) | 0x4f); + VFCMP_S(q1, d0, v1, cULE); // get Nan,+overflow mark + VBITSEL_V(v0, v0, q0, q1); + + MARK3; + } + x87_restoreround(dyn, ninst, u8); + break; case 0x2E: // no special check... case 0x2F: @@ -292,8 +417,7 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { INST_NAME("UCOMISS Gx, Ex"); } - SETFLAGS(X_ALL, SF_SET); - SET_DFNONE(); + SETFLAGS(X_ALL, SF_SET_DF, NAT_FLAGS_NOFUSION); nextop = F8; GETGX(d0, 0); GETEXSS(v0, 0, 0); @@ -325,10 +449,195 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SPILL_EFLAGS(); } break; + case 0x31: + INST_NAME("RDTSC"); + NOTEST(x1); + if (box64_rdtsc) { + CALL(const_readtsc, x3, 0, 0); // will return the u64 in x3 + } else { + RDTIME_D(x3, xZR); + } + if (box64_rdtsc_shift) { + SRLI_D(x3, x3, box64_rdtsc_shift); + } + SRLI_D(xRDX, x3, 32); + ZEROUP2(xRDX, x3); + break; case 0x38: // SSE3 nextop = F8; switch (nextop) { + case 0x00: + INST_NAME("PSHUFB Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + VLDI(v0, 0b0000010000111); // broadcast 0b10000111 as byte + VAND_V(v0, v0, q1); + VMINI_BU(v0, v0, 0x1f); + VXOR_V(v1, v1, v1); + VSHUF_B(q0, v1, q0, v0); + break; + case 0x01: + INST_NAME("PHADDW Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VPICKEV_H(v0, q1, q0); + VPICKOD_H(v1, q1, q0); + VADD_H(q0, v1, v0); + VSHUF4I_W(q0, q0, 0b11011000); + break; + case 0x02: + INST_NAME("PHADDD Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VPICKEV_W(v0, q1, q0); + VPICKOD_W(v1, q1, q0); + VADD_W(q0, v0, v1); + VSHUF4I_W(q0, q0, 0b11011000); + break; + case 0x03: + INST_NAME("PHADDSW Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VPICKEV_H(v0, q1, q0); + VPICKOD_H(v1, q1, q0); + VSADD_H(q0, v0, v1); + VSHUF4I_W(q0, q0, 0b11011000); + break; + case 0x04: + INST_NAME("PMADDUBSW Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VMULWEV_H_BU_B(v0, q0, q1); + VMULWOD_H_BU_B(v1, q0, q1); + VSADD_H(q0, v0, v1); + break; + case 0x05: + INST_NAME("PHSUBW Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VPICKEV_H(v0, q1, q0); + VPICKOD_H(v1, q1, q0); + VSUB_H(q0, v0, v1); + VSHUF4I_W(q0, q0, 0b11011000); + break; + case 0x06: + INST_NAME("PHSUBD Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VPICKEV_W(v0, q1, q0); + VPICKOD_W(v1, q1, q0); + VSUB_W(q0, v0, v1); + VSHUF4I_W(q0, q0, 0b11011000); + break; + case 0x07: + INST_NAME("PHSUBSW Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VPICKEV_H(v0, q1, q0); + VPICKOD_H(v1, q1, q0); + VSSUB_H(q0, v0, v1); + VSHUF4I_W(q0, q0, 0b11011000); + break; + case 0x08: + INST_NAME("PSIGNB Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + VSIGNCOV_B(q0, q1, q0); + break; + case 0x09: + INST_NAME("PSIGNW Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + VSIGNCOV_H(q0, q1, q0); + break; + case 0x0A: + INST_NAME("PSIGND Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + VSIGNCOV_W(q0, q1, q0); + break; + case 0x0B: + INST_NAME("PMULHRSW Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + if (cpuext.lasx) { + VEXT2XV_W_H(v0, q0); + VEXT2XV_W_H(v1, q1); + XVMUL_W(v0, v0, v1); + VSRLI_W(v0, v0, 14); + VADDI_WU(v0, v0, 1); + VSRLNI_H_W(q0, v0, 1); + } else { + VMULWEV_W_H(v0, q0, q1); + VMULWOD_W_H(v1, q0, q1); + VSRLI_W(v0, v0, 14); + VSRLI_W(v1, v1, 14); + VADDI_WU(v0, v0, 1); + VADDI_WU(v1, v1, 1); + VSRLNI_H_W(v1, v0, 1); + VSHUF4I_W(v1, v1, 0b11011000); + VSHUF4I_H(q0, v1, 0b11011000); + } + break; + case 0x1C: + INST_NAME("PABSB Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + v0 = fpu_get_scratch(dyn); + VXOR_V(v0, v0, v0); + VABSD_B(q0, q1, v0); + break; + case 0x1D: + INST_NAME("PABSW Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + v0 = fpu_get_scratch(dyn); + VXOR_V(v0, v0, v0); + VABSD_H(q0, q1, v0); + break; + case 0x1E: + INST_NAME("PABSD Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + v0 = fpu_get_scratch(dyn); + VXOR_V(v0, v0, v0); + VABSD_W(q0, q1, v0); + break; case 0xC8 ... 0xCD: u8 = nextop; switch (u8) { @@ -356,12 +665,10 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni ed = (nextop & 7) + (rex.b << 3); sse_reflect_reg(dyn, ninst, ed); ADDI_D(x2, xEmu, offsetof(x64emu_t, xmm[ed])); + ed = x2; } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 0, 0); - if (ed != x2) { - MV(x2, ed); - } } GETG; sse_forget_reg(dyn, ninst, gd); @@ -369,59 +676,141 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni sse_reflect_reg(dyn, ninst, 0); switch (u8) { case 0xC8: - CALL(sha1nexte, -1); + CALL(const_sha1nexte, -1, x1, ed); break; case 0xC9: - CALL(sha1msg1, -1); + CALL(const_sha1msg1, -1, x1, ed); break; case 0xCA: - CALL(sha1msg2, -1); + CALL(const_sha1msg2, -1, x1, ed); break; case 0xCB: - CALL(sha256rnds2, -1); + CALL(const_sha256rnds2, -1, x1, ed); break; case 0xCC: - CALL(sha256msg1, -1); + CALL(const_sha256msg1, -1, x1, ed); break; case 0xCD: - CALL(sha256msg2, -1); + CALL(const_sha256msg2, -1, x1, ed); break; } break; + case 0xF0: + INST_NAME("MOVBE Gd, Ed"); + nextop = F8; + GETGD; + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LDxw(gd, ed, fixedaddress); + if (rex.w) { + REVB_D(gd, gd); + } else { + REVB_2W(gd, gd); + ZEROUP(gd); + } + break; + case 0xF1: + INST_NAME("MOVBE Ed, Gd"); + nextop = F8; + GETGD; + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + if (rex.w) + REVB_D(x1, gd); + else + REVB_2W(x1, gd); + SDxw(x1, wback, fixedaddress); + SMWRITE2(); + break; + default: + DEFAULT; + } + break; + case 0x3A: // more SSE3 opcodes + opcode = F8; + switch (opcode) { + case 0x0F: + INST_NAME("PALIGNR Gm, Em, Ib"); + nextop = F8; + GETGM(q0); + GETEM(q1, 1); + u8 = F8; + if (u8 > 15) { + VXOR_V(q0, q0, q0); + } else if (!u8) { + VEXTRINS_D(q0, q1, VEXTRINS_IMM_4_0(0, 0)); + } else { + d0 = fpu_get_scratch(dyn); + VOR_V(d0, q0, q0); + VSHUF4I_D(d0, q1, 0b00010010); + VBSRL_V(d0, d0, u8); + VEXTRINS_D(q0, d0, 0); + } + break; + case 0xCC: + INST_NAME("SHA1RNDS4 Gx, Ex, Ib"); + nextop = F8; + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + sse_reflect_reg(dyn, ninst, ed); + ADDI_D(x2, xEmu, offsetof(x64emu_t, xmm[ed])); + wback = x2; + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 0, 1); + } + u8 = F8; + GETG; + sse_forget_reg(dyn, ninst, gd); + ADDI_D(x1, xEmu, offsetof(x64emu_t, xmm[gd])); + MOV32w(x3, u8); + CALL4(const_sha1rnds4, -1, x1, wback, x3, 0); + break; default: DEFAULT; } break; - #define GO(GETFLAGS, NO, YES, F, I) \ - READFLAGS(F); \ - if (la64_lbt) { \ - X64_SETJ(x1, I); \ - } else { \ - GETFLAGS; \ - } \ - nextop = F8; \ - GETGD; \ - if (MODREG) { \ - ed = TO_LA64((nextop & 7) + (rex.b << 3)); \ - if (la64_lbt) \ - BEQZ(x1, 8); \ - else \ - B##NO(x1, 8); \ - MV(gd, ed); \ - } else { \ - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x4, &fixedaddress, rex, NULL, 1, 0); \ - if (la64_lbt) \ - BEQZ(x1, 8); \ - else \ - B##NO(x1, 8); \ - LDxw(gd, ed, fixedaddress); \ - } \ - if (!rex.w) ZEROUP(gd); +#define GO(GETFLAGS, NO, YES, NATNO, NATYES, F, I) \ + READFLAGS_FUSION(F, x1, x2, x3, x4, x5); \ + if (!dyn->insts[ninst].nat_flags_fusion) { \ + if (cpuext.lbt) { \ + X64_SETJ(tmp1, I); \ + } else { \ + GETFLAGS; \ + } \ + } \ + nextop = F8; \ + GETGD; \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP(NATNO, 8); \ + } else { \ + if (cpuext.lbt) \ + BEQZ(tmp1, 8); \ + else \ + B##NO(tmp1, 8); \ + } \ + MV(gd, ed); \ + if (!rex.w) ZEROUP(gd); \ + } else { \ + addr = geted(dyn, addr, ninst, nextop, &ed, tmp2, tmp3, &fixedaddress, rex, NULL, 1, 0); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP(NATNO, 8); \ + } else { \ + if (cpuext.lbt) \ + BEQZ(tmp1, 8); \ + else \ + B##NO(tmp1, 8); \ + } \ + LDxw(gd, ed, fixedaddress); \ + if (!rex.w) ZEROUP(gd); \ + } GOCOND(0x40, "CMOV", "Gd, Ed"); - #undef GO +#undef GO case 0x50: INST_NAME("MOVMSPKPS Gd, Ex"); @@ -438,7 +827,17 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni nextop = F8; GETEX(q0, 0, 0); GETGX_empty(v0); - VFSQRT_S(v0, q0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMP_S(d0, q0, q0, cEQ); + VFSQRT_S(v0, q0); + VFCMP_S(d1, v0, v0, cEQ); + VANDN_V(d1, d1, d0); + VSLLI_W(d1, d1, 31); + VOR_V(v0, v0, d1); + } else + VFSQRT_S(v0, q0); break; case 0x52: INST_NAME("RSQRTPS Gx, Ex"); @@ -446,7 +845,11 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SKIPTEST(x1); GETEX(q0, 0, 0); GETGX_empty(q1); - VFRSQRT_S(q1, q0); + if (cpuext.frecipe) { + VFRSQRTE_S(q1, q0); + } else { + VFRSQRT_S(q1, q0); + } break; case 0x53: INST_NAME("RCPPS Gx, Ex"); @@ -454,8 +857,11 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SKIPTEST(x1); GETEX(q0, 0, 0); GETGX_empty(q1); - // TODO: use v1.1 vfrecipe when possible - VFRECIP_S(q1, q0); + if (cpuext.frecipe) { + VFRECIPE_S(q1, q0); + } else { + VFRECIP_S(q1, q0); + } break; case 0x54: INST_NAME("ANDPS Gx, Ex"); @@ -503,13 +909,27 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MULPS Gx, Ex"); nextop = F8; GETEX(q0, 0, 0); - GETGX(v0, 1); - VFMUL_S(v0, v0, q0); + GETGX(q1, 1); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VFCMP_S(v0, q0, q1, cUN); + } + VFMUL_S(q1, q1, q0); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMP_S(v1, q1, q1, cUN); + VANDN_V(v0, v0, v1); + VLDI(v1, 0b011111111100); // broadcast 0xFFFFFFFFFFFFFFFC + VSLLI_W(v1, v1, 20); + VAND_V(v1, v0, v1); + VANDN_V(v0, v0, q1); + VOR_V(q1, v0, v1); + } break; case 0x5A: INST_NAME("CVTPS2PD Gx, Ex"); nextop = F8; - GETEX(q0, 0, 0); + GETEXSD(q0, 0, 0); GETGX(q1, 1); VFCVTL_D_S(q1, q0); break; @@ -524,307 +944,840 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("SUBPS Gx, Ex"); nextop = F8; GETEX(q0, 0, 0); - GETGX(v0, 1); - VFSUB_S(v0, v0, q0); + GETGX(q1, 1); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VFCMP_S(v0, q0, q1, cUN); + } + VFSUB_S(q1, q1, q0); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMP_S(v1, q1, q1, cUN); + VANDN_V(v0, v0, v1); + VLDI(v1, 0b011111111100); // broadcast 0xFFFFFFFFFFFFFFFC + VSLLI_W(v1, v1, 20); + VAND_V(v1, v0, v1); + VANDN_V(v0, v0, q1); + VOR_V(q1, v0, v1); + } break; case 0x5D: INST_NAME("MINPS Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); - if (!box64_dynarec_fastnan && v0 != v1) { - q0 = fpu_get_scratch(dyn); - // always copy from v1 if any oprand is NaN - VFCMP_S(q0, v0, v1, cUN); - VANDN_V(v0, q0, v0); - VAND_V(q0, q0, v1); - VOR_V(v0, v0, q0); - } - VFMIN_S(v0, v0, v1); + q0 = fpu_get_scratch(dyn); + VFCMP_S(q0, v1, v0, cULE); + VBITSEL_V(v0, v0, v1, q0); break; case 0x5E: INST_NAME("DIVPS Gx, Ex"); nextop = F8; GETEX(q0, 0, 0); - GETGX(v0, 1); - VFDIV_S(v0, v0, q0); + GETGX(q1, 1); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VFCMP_S(v0, q0, q1, cUN); + } + VFDIV_S(q1, q1, q0); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMP_S(v1, q1, q1, cUN); + VANDN_V(v0, v0, v1); + VLDI(v1, 0b011111111100); // broadcast 0xFFFFFFFFFFFFFFFC + VSLLI_W(v1, v1, 20); + VAND_V(v1, v0, v1); + VANDN_V(v0, v0, q1); + VOR_V(q1, v0, v1); + } break; case 0x5F: INST_NAME("MAXPS Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); - if (!box64_dynarec_fastnan && v0 != v1) { - q0 = fpu_get_scratch(dyn); - // always copy from v1 if any oprand is NaN - VFCMP_S(q0, v0, v1, cUN); - VANDN_V(v0, q0, v0); - VAND_V(q0, q0, v1); - VOR_V(v0, v0, q0); - } - VFMAX_S(v0, v0, v1); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VFCMP_S(q0, v1, v0, cLT); // ~cLT = un ge eq, if either v0/v1=nan ,choose v1. if eq either is ok,but when +0.0 == -0.0 x86 sse choose v1 + VBITSEL_V(v0, v1, v0, q0); // swap v0 v1 => v1 v0 for ~cLT break; - - #define GO(GETFLAGS, NO, YES, F, I) \ - if (box64_dynarec_test == 2) { NOTEST(x1); } \ - READFLAGS(F); \ - i32_ = F32S; \ - BARRIER(BARRIER_MAYBE); \ - JUMP(addr + i32_, 1); \ - if (la64_lbt) { \ - X64_SETJ(x1, I); \ - } else { \ - GETFLAGS; \ - } \ - if (dyn->insts[ninst].x64.jmp_insts == -1 || CHECK_CACHE()) { \ - /* out of the block */ \ - i32 = dyn->insts[ninst].epilog - (dyn->native_size); \ - if (la64_lbt) \ - BEQZ_safe(x1, i32); \ - else \ - B##NO##_safe(x1, i32); \ - if (dyn->insts[ninst].x64.jmp_insts == -1) { \ - if (!(dyn->insts[ninst].x64.barrier & BARRIER_FLOAT)) \ - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ - jump_to_next(dyn, addr + i32_, 0, ninst, rex.is32bits); \ - } else { \ - CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ - B(i32); \ - } \ - } else { \ - /* inside the block */ \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ - if (la64_lbt) \ - BNEZ_safe(x1, i32); \ - else \ - B##YES##_safe(x1, i32); \ - } - - GOCOND(0x80, "J", "Id"); - - #undef GO - - - #define GO(GETFLAGS, NO, YES, F, I) \ - READFLAGS(F); \ - if (la64_lbt) { \ - X64_SETJ(x3, I); \ - } else { \ - GETFLAGS; \ - S##YES(x3, x1); \ - } \ - nextop = F8; \ - if (MODREG) { \ - if (rex.rex) { \ - eb1 = TO_LA64((nextop & 7) + (rex.b << 3)); \ - eb2 = 0; \ - } else { \ - ed = (nextop & 7); \ - eb2 = (ed >> 2) * 8; \ - eb1 = TO_LA64(ed & 3); \ - } \ - BSTRINS_D(eb1, x3, eb2 + 7, eb2); \ - } else { \ - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); \ - ST_B(x3, ed, fixedaddress); \ - SMWRITE(); \ - } - - GOCOND(0x90, "SET", "Eb"); - #undef GO - - case 0xA2: - INST_NAME("CPUID"); - NOTEST(x1); - MV(A1, xRAX); - CALL_(my_cpuid, -1, 0); - // BX and DX are not synchronized durring the call, so need to force the update - LD_D(xRDX, xEmu, offsetof(x64emu_t, regs[_DX])); - LD_D(xRBX, xEmu, offsetof(x64emu_t, regs[_BX])); + case 0x60: + INST_NAME("PUNPCKLBW Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VILVL_B(v0, v1, v0); break; - case 0xA3: - INST_NAME("BT Ed, Gd"); - SETFLAGS(X_CF, SF_SUBSET); - SET_DFNONE(); + case 0x61: + INST_NAME("PUNPCKLWD Gm,Em"); nextop = F8; - GETGD; + GETGM(v0); + GETEM(v1, 0); + VILVL_H(v0, v1, v0); + break; + case 0x62: + INST_NAME("PUNPCKLDQ Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VEXTRINS_W(v0, v1, VEXTRINS_IMM_4_0(1, 0)); + break; + case 0x63: + INST_NAME("PACKSSWB Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VPACKEV_D(v0, v1, v0); + VSSRANI_B_H(v0, v0, 0); + break; + case 0x64: + INST_NAME("PCMPGTB Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VSLT_B(v0, v1, v0); + break; + case 0x65: + INST_NAME("PCMPGTW Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VSLT_H(v0, v1, v0); + break; + case 0x66: + INST_NAME("PCMPGTD Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VSLT_W(v0, v1, v0); + break; + case 0x67: + INST_NAME("PACKUSWB Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + q0 = fpu_get_scratch(dyn); + VPACKEV_D(v0, v1, v0); + VSSRANI_BU_H(v0, v0, 0); + break; + case 0x68: + INST_NAME("PUNPCKHBW Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VILVL_B(v0, v1, v0); + VEXTRINS_D(v0, v0, VEXTRINS_IMM_4_0(0, 1)); + break; + case 0x69: + INST_NAME("PUNPCKHWD Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VILVL_H(v0, v1, v0); + VEXTRINS_D(v0, v0, VEXTRINS_IMM_4_0(0, 1)); + break; + case 0x6A: + INST_NAME("PUNPCKHDQ Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VILVL_W(v0, v1, v0); + VEXTRINS_D(v0, v0, VEXTRINS_IMM_4_0(0, 1)); + break; + case 0x6B: + INST_NAME("PACKSSDW Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + d0 = fpu_get_scratch(dyn); + VPACKEV_D(v0, v1, v0); + VSSRANI_H_W(v0, v0, 0); + break; + case 0x6E: + INST_NAME("MOVD Gm, Ed"); + nextop = F8; + GETG; + v0 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, gd); if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); + ed = TO_NAT(nextop & 7); + if (rex.w) { + MOVGR2FR_D(v0, ed); + } else { + MOVGR2FR_W(v0, ed); + MOVGR2FRH_W(v0, xZR); + } } else { - SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); - SRAIxw(x1, gd, 5 + rex.w); // r1 = (gd>>5) - ALSL_D(x3, wback, x1, 2 + rex.w); // (&ed) += r1*4; - LDxw(x1, x3, fixedaddress); - ed = x1; + if (rex.w) { + FLD_D(v0, wback, fixedaddress); + } else { + FLD_S(v0, wback, fixedaddress); + MOVGR2FRH_W(v0, xZR); + } } - ANDI(x2, gd, rex.w ? 0x3f : 0x1f); - SRLxw(x4, ed, x2); - if (la64_lbt) - X64_SET_EFLAGS(x4, X_CF); - else - BSTRINS_D(xFlags, x4, F_CF, F_CF); break; - case 0xA4: + case 0x6F: + INST_NAME("MOVQ Gm, Em"); nextop = F8; - INST_NAME("SHLD Ed, Gd, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED(1); - GETGD; - u8 = F8; - emit_shld32c(dyn, ninst, rex, ed, gd, u8, x3, x4); - WBACK; + GETG; + if (MODREG) { + v1 = mmx_get_reg(dyn, ninst, x1, x2, x3, nextop & 7); + v0 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, gd); + FMOV_D(v0, v1); + } else { + v0 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, gd); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_D(v0, wback, fixedaddress); + } break; - case 0xAC: + case 0x70: + INST_NAME("PSHUFW Gm,Em,Ib"); nextop = F8; - INST_NAME("SHRD Ed, Gd, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED(1); - GETGD; + GETGM(v0); + GETEM(v1, 1); u8 = F8; - u8 &= (rex.w ? 0x3f : 0x1f); - emit_shrd32c(dyn, ninst, rex, ed, gd, u8, x3, x4); - WBACK; + VSHUF4I_H(v0, v1, u8); break; - case 0xAE: + case 0x71: nextop = F8; - if (MODREG) - switch (nextop) { - case 0xE8: - INST_NAME("LFENCE"); - SMDMB(); - break; - case 0xF0: - INST_NAME("MFENCE"); - SMDMB(); - break; - case 0xF8: - INST_NAME("SFENCE"); - SMDMB(); - break; - default: - DEFAULT; - } - else - switch ((nextop >> 3) & 7) { - case 0: - INST_NAME("FXSAVE Ed"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - SKIPTEST(x1); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); - if (MODREG) { - DEFAULT; - } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x1, x3, &fixedaddress, rex, NULL, 0, 0); - if (ed != x1) { MV(x1, ed); } - CALL(rex.w ? ((void*)fpu_fxsave64) : ((void*)fpu_fxsave32), -1); + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("PSRLW Em, Ib"); + GETEM(v0, 1); + u8 = F8; + if (u8) { + if (u8 > 15) { + VXOR_V(v0, v0, v0); + } else if (u8) { + VSRLI_H(v0, v0, u8); } - break; - case 2: - INST_NAME("LDMXCSR Md"); - GETED(0); - ST_W(ed, xEmu, offsetof(x64emu_t, mxcsr)); - if (box64_sse_flushto0) { - // TODO + PUTEM(v0); + } + break; + case 4: + INST_NAME("PSRAW Em, Ib"); + GETEM(v0, 1); + u8 = F8; + if (u8 > 15) u8 = 15; + if (u8) { + VSRAI_H(v0, v0, u8); + } + PUTEM(v0); + break; + case 6: + INST_NAME("PSLLW Em, Ib"); + GETEM(v0, 1); + u8 = F8; + if (u8) { + if (u8 > 15) { + VXOR_V(v0, v0, v0); + } else { + VSLLI_H(v0, v0, u8); } - break; - case 3: - INST_NAME("STMXCSR Md"); - addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, NULL, 0, 0); + PUTEM(v0); + } + break; + default: + *ok = 0; + DEFAULT; + } + break; + case 0x72: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("PSRLD Em, Ib"); + GETEM(v0, 1); + u8 = F8; + if (u8) { + if (u8 > 31) { + VXOR_V(v0, v0, v0); + } else if (u8) { + VSRLI_W(v0, v0, u8); + } + PUTEM(v0); + } + break; + case 4: + INST_NAME("PSRAD Em, Ib"); + GETEM(v0, 1); + u8 = F8; + if (u8 > 31) u8 = 31; + if (u8) { + VSRAI_W(v0, v0, u8); + } + PUTEM(v0); + break; + case 6: + INST_NAME("PSLLD Em, Ib"); + GETEM(v0, 1); + u8 = F8; + if (u8) { + if (u8 > 31) { + VXOR_V(v0, v0, v0); + } else { + VSLLI_W(v0, v0, u8); + } + PUTEM(v0); + } + break; + default: + DEFAULT; + } + break; + case 0x73: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("PSRLQ Em, Ib"); + GETEM(v0, 1); + u8 = F8; + if (u8) { + if (u8 > 63) { + VXOR_V(v0, v0, v0); + } else if (u8) { + VSRLI_D(v0, v0, u8); + } + PUTEM(v0); + } + break; + case 6: + INST_NAME("PSLLQ Em, Ib"); + GETEM(v0, 1); + u8 = F8; + if (u8) { + if (u8 > 63) { + VXOR_V(v0, v0, v0); + } else { + VSLLI_D(v0, v0, u8); + } + PUTEM(v0); + } + break; + default: + DEFAULT; + } + break; + case 0x74: + INST_NAME("PCMPEQB Gm,Em"); + nextop = F8; + GETGM(d0); + GETEM(d1, 0); + VSEQ_B(d0, d0, d1); + break; + case 0x75: + INST_NAME("PCMPEQW Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(q0, 0); + VSEQ_H(v0, v0, q0); + break; + case 0x76: + INST_NAME("PCMPEQD Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VSEQ_W(v0, v0, v1); + break; + case 0x77: + INST_NAME("EMMS"); + // empty MMX, FPU now usable + mmx_purgecache(dyn, ninst, 0, x1); + break; + case 0x7E: + INST_NAME("MOVD Ed, Gm"); + nextop = F8; + GETGM(v0); + if (MODREG) { + ed = TO_NAT((nextop & 0x07) + (rex.b << 3)); + if (rex.w) { + MOVFR2GR_D(ed, v0); + } else { + MOVFR2GR_S(ed, v0); + ZEROUP(ed); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 1, 0); + if (rex.w) + FST_D(v0, ed, fixedaddress); + else + FST_S(v0, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0x7F: + INST_NAME("MOVQ Em, Gm"); + nextop = F8; + GETGM(v0); + if (MODREG) { + v1 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, nextop & 7); + FMOV_D(v1, v0); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 1, 0); + FST_D(v0, ed, fixedaddress); + SMWRITE2(); + } + break; +#define GO(GETFLAGS, NO, YES, NATNO, NATYES, F, I) \ + READFLAGS_FUSION(F, x1, x2, x3, x4, x5); \ + i32_ = F32S; \ + if (rex.is32bits) \ + j64 = (uint32_t)(addr + i32_); \ + else \ + j64 = addr + i32_; \ + JUMP(j64, 1); \ + if (!dyn->insts[ninst].nat_flags_fusion) { \ + if (cpuext.lbt) { \ + X64_SETJ(x1, I); \ + } else { \ + GETFLAGS; \ + } \ + } \ + if (dyn->insts[ninst].x64.jmp_insts == -1 || CHECK_CACHE()) { \ + /* out of the block */ \ + i32 = dyn->insts[ninst].epilog - (dyn->native_size); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP_safe(NATNO, i32); \ + } else { \ + if (cpuext.lbt) \ + BEQZ_safe(x1, i32); \ + else \ + B##NO##_safe(x1, i32); \ + } \ + if (dyn->insts[ninst].x64.jmp_insts == -1) { \ + if (!(dyn->insts[ninst].x64.barrier & BARRIER_FLOAT)) \ + fpu_purgecache(dyn, ninst, 1, tmp1, tmp2, tmp3); \ + jump_to_next(dyn, j64, 0, ninst, rex.is32bits); \ + } else { \ + CacheTransform(dyn, ninst, cacheupd, tmp1, tmp2, tmp3); \ + i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ + B(i32); \ + } \ + } else { \ + /* inside the block */ \ + i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP_safe(NATYES, i32); \ + } else { \ + if (cpuext.lbt) \ + BNEZ_safe(tmp1, i32); \ + else \ + B##YES##_safe(tmp1, i32); \ + } \ + } + + GOCOND(0x80, "J", "Id"); + +#undef GO + + +#define GO(GETFLAGS, NO, YES, NATNO, NATYES, F, I) \ + READFLAGS_FUSION(F, x1, x2, x3, x4, x5); \ + nextop = F8; \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVESET(NATYES, tmp3); \ + } else if (cpuext.lbt) { \ + X64_SETJ(tmp3, I); \ + } else { \ + GETFLAGS; \ + S##YES(tmp3, x1); \ + } \ + if (MODREG) { \ + if (rex.rex) { \ + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); \ + eb2 = 0; \ + } else { \ + ed = (nextop & 7); \ + eb2 = (ed >> 2) * 8; \ + eb1 = TO_NAT(ed & 3); \ + } \ + BSTRINS_D(eb1, tmp3, eb2 + 7, eb2); \ + } else { \ + addr = geted(dyn, addr, ninst, nextop, &ed, tmp2, tmp1, &fixedaddress, rex, NULL, 1, 0); \ + ST_B(tmp3, ed, fixedaddress); \ + SMWRITE(); \ + } + + GOCOND(0x90, "SET", "Eb"); +#undef GO + case 0xA0: + INST_NAME("PUSH FS"); + LD_HU(x2, xEmu, offsetof(x64emu_t, segs[_FS])); + PUSH1z(x2); + break; + case 0xA1: + INST_NAME("POP FS"); + POP1z(x2); + ST_H(x2, xEmu, offsetof(x64emu_t, segs[_FS])); + CBZ_NEXT(x2); + ADDI_D(x1, xZR, _FS); + CALL(const_getsegmentbase, -1, x1, 0); + break; + case 0xA2: + INST_NAME("CPUID"); + NOTEST(x1); + CALL_(const_cpuid, -1, 0, xRAX, 0); + // BX and DX are not synchronized durring the call, so need to force the update + LD_D(xRDX, xEmu, offsetof(x64emu_t, regs[_DX])); + LD_D(xRBX, xEmu, offsetof(x64emu_t, regs[_BX])); + break; + case 0xA3: + INST_NAME("BT Ed, Gd"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGD; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + if (rex.w) + SRAI_D(x1, gd, 6); + else + SRAI_W(x1, gd, 5); + if (!rex.w && !rex.is32bits) { ADDI_W(x1, x1, 0); } + ALSLy(x3, x1, wback, 2 + rex.w); // (&ed) += r1*4; + LDxw(x1, x3, fixedaddress); + ed = x1; + } + IFX (X_CF) { + ANDI(x2, gd, rex.w ? 0x3f : 0x1f); + SRLxw(x4, ed, x2); + if (cpuext.lbt) + X64_SET_EFLAGS(x4, X_CF); + else + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + break; + case 0xA4: + nextop = F8; + INST_NAME("SHLD Ed, Gd, Ib"); + if (geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 63 : 31)) { + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED(1); + GETGD; + u8 = F8 & (rex.w ? 63 : 31); + emit_shld32c(dyn, ninst, rex, ed, gd, u8, x3, x4); + WBACK; + } else { + FAKEED; + if (!rex.w && !rex.is32bits && MODREG) { ZEROUP(ed); } + F8; + } + break; + case 0xA5: + nextop = F8; + INST_NAME("SHLD Ed, Gd, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; + GETED(0); + if (!rex.w && !rex.is32bits && MODREG) { ZEROUP(ed); } + ANDI(x3, xRCX, rex.w ? 0x3f : 0x1f); + CBZ_NEXT(x3); + emit_shld32(dyn, ninst, rex, ed, gd, x3, x4, x5, x6); + WBACK; + break; + case 0xA8: + INST_NAME("PUSH GS"); + LD_HU(x2, xEmu, offsetof(x64emu_t, segs[_GS])); + PUSH1z(x2); + break; + case 0xA9: + INST_NAME("POP GS"); + POP1z(x2); + ST_H(x2, xEmu, offsetof(x64emu_t, segs[_GS])); + CBZ_NEXT(x2); + ADDI_D(x1, xZR, _GS); + CALL(const_getsegmentbase, -1, x1, 0); + break; + case 0xAB: + INST_NAME("BTS Ed, Gd"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGD; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + wback = 0; + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + if (rex.w) + SRAI_D(x1, gd, 6); + else + SRAI_W(x1, gd, 5); + if (!rex.w && !rex.is32bits) { ADDI_W(x1, x1, 0); } + ALSLy(x3, x1, wback, 2 + rex.w); // (&ed) += r1*4; + LDxw(x1, x3, fixedaddress); + ed = x1; + wback = x3; + } + ANDI(x2, gd, rex.w ? 0x3f : 0x1f); + IFX (X_CF) { + SRL_D(x4, ed, x2); + if (cpuext.lbt) { + X64_SET_EFLAGS(x4, X_CF); + } else { + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + } + ADDI_D(x4, xZR, 1); + SLL_D(x4, x4, x2); + OR(ed, ed, x4); + if (wback) { + SDxw(ed, wback, fixedaddress); + SMWRITE(); + } else if (!rex.w) { + ZEROUP(ed); + } + break; + case 0xAC: + nextop = F8; + INST_NAME("SHRD Ed, Gd, Ib"); + if (geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 63 : 31)) { + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED(1); + GETGD; + u8 = F8 & (rex.w ? 63 : 31); + emit_shrd32c(dyn, ninst, rex, ed, gd, u8, x3, x4); + WBACK; + } else { + FAKEED; + if (!rex.w && !rex.is32bits && MODREG) { ZEROUP(ed); } + F8; + } + break; + case 0xAD: + nextop = F8; + INST_NAME("SHRD Ed, Gd, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; + GETED(0); + if (!rex.w && !rex.is32bits && MODREG) { ZEROUP(ed); } + ANDI(x3, xRCX, rex.w ? 0x3f : 0x1f); + CBZ_NEXT(x3); + emit_shrd32(dyn, ninst, rex, ed, gd, x3, x5, x4, x6); + WBACK; + break; + case 0xAE: + nextop = F8; + if (MODREG) + switch (nextop) { + case 0xE8: + INST_NAME("LFENCE"); + DBAR(0); + break; + case 0xF0: + INST_NAME("MFENCE"); + DBAR(0); + break; + case 0xF8: + INST_NAME("SFENCE"); + DBAR(0); + break; + default: + DEFAULT; + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FXSAVE Ed"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + BARRIER(BARRIER_FLOAT); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x3, &fixedaddress, rex, NULL, 0, 0); + CALL(rex.is32bits ? const_fpu_fxsave32 : const_fpu_fxsave64, -1, ed, 0); + break; + case 1: + INST_NAME("FXRSTOR Ed"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + BARRIER(BARRIER_FLOAT); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x3, &fixedaddress, rex, NULL, 0, 0); + CALL(rex.is32bits ? const_fpu_fxrstor32 : const_fpu_fxrstor64, -1, ed, 0); + break; + case 2: + INST_NAME("LDMXCSR Md"); + GETED(0); + ST_W(ed, xEmu, offsetof(x64emu_t, mxcsr)); + if (BOX64ENV(sse_flushto0)) { + /* LA <-> x86 + 16/24 <-> 5 inexact + 17/25 <-> 4 underflow + 18/26 <-> 3 overflow + 19/27 <-> 2 divide by zero + x <-> 1 denormal + 20/28 <-> 0 invalid operation + */ + // Doing x86 -> LA here, ignore denormal + XOR(x4, x4, x4); + BSTRPICK_W(x3, ed, 5, 5); + BSTRINS_W(x4, x3, 16, 16); + BSTRPICK_W(x3, ed, 4, 4); + BSTRINS_W(x4, x3, 17, 17); + BSTRPICK_W(x3, ed, 3, 3); + BSTRINS_W(x4, x3, 18, 18); + BSTRPICK_W(x3, ed, 2, 2); + BSTRINS_W(x4, x3, 19, 19); + BSTRPICK_W(x3, ed, 0, 0); + BSTRINS_W(x4, x3, 20, 20); + MOVGR2FCSR(FCSR2, x4); + } + break; + case 3: + INST_NAME("STMXCSR Md"); + addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, NULL, 0, 0); LD_WU(x4, xEmu, offsetof(x64emu_t, mxcsr)); + if (BOX64ENV(sse_flushto0)) { + MOVFCSR2GR(x5, FCSR2); + // Doing LA -> x86 here, ignore denormal + BSTRPICK_W(x3, x5, 16, 16); + BSTRINS_W(x4, x3, 5, 5); + BSTRPICK_W(x3, x5, 17, 17); + BSTRINS_W(x4, x3, 4, 4); + BSTRPICK_W(x3, x5, 18, 18); + BSTRINS_W(x4, x3, 3, 3); + BSTRPICK_W(x3, x5, 19, 19); + BSTRINS_W(x4, x3, 2, 2); + BSTRPICK_W(x3, x5, 20, 20); + BSTRINS_W(x4, x3, 0, 0); + } ST_W(x4, wback, fixedaddress); break; + case 4: + INST_NAME("XSAVE Ed"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + BARRIER(BARRIER_FLOAT); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + MOV32w(x2, rex.w ? 0 : 1); + CALL(const_fpu_xsave, -1, ed, x2); + break; + case 5: + INST_NAME("XRSTOR Ed"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + BARRIER(BARRIER_FLOAT); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + MOV32w(x2, rex.w ? 0 : 1); + CALL(const_fpu_xrstor, -1, ed, x2); + break; + case 7: + INST_NAME("CLFLUSH Ed"); + FAKEED; + // Full flush... no fine-grained options available + DBAR(0); + break; default: DEFAULT; } break; case 0xAF: INST_NAME("IMUL Gd, Ed"); - SETFLAGS(X_ALL, SF_PENDING); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); nextop = F8; GETGD; GETED(0); - if (box64_dynarec_test) { - // avoid noise during test - CLEAR_FLAGS(x3); - } + CLEAR_FLAGS(x3); if (rex.w) { - // 64bits imul UFLAG_IF { - if (la64_lbt) { - X64_MUL_D(gd, ed); - } MULH_D(x3, gd, ed); MUL_D(gd, gd, ed); - IFX (X_PEND) { - UFLAG_OP1(x3); - UFLAG_RES(gd); - UFLAG_DF(x3, d_imul64); - } else { - SET_DFNONE(); - } - IFXA (X_CF | X_OF, !la64_lbt) { + SET_DFNONE(); + IFX (X_CF | X_OF) { SRAI_D(x4, gd, 63); XOR(x3, x3, x4); SNEZ(x3, x3); - IFX (X_CF) { - BSTRINS_D(xFlags, x3, F_CF, F_CF); - } - IFX (X_OF) { - BSTRINS_D(xFlags, x3, F_OF, F_OF); - } + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); } } else { - MULxw(gd, gd, ed); + MUL_D(gd, gd, ed); } } else { - // 32bits imul UFLAG_IF { - if (la64_lbt) { - X64_MUL_W(gd, ed); - } SLLI_W(gd, gd, 0); SLLI_W(x3, ed, 0); - MUL_D(gd, gd, x3); - SRLI_D(x3, gd, 32); - SLLI_W(gd, gd, 0); - IFX (X_PEND) { - UFLAG_RES(gd); - UFLAG_OP1(x3); - UFLAG_DF(x4, d_imul32); - } else IFX (X_CF | X_OF) { - SET_DFNONE(); - } - IFXA (X_CF | X_OF, !la64_lbt) { - SRAI_W(x4, gd, 31); - SUB_D(x3, x3, x4); + MUL_D(x4, gd, x3); + SRLI_D(x3, x4, 32); + SLLI_W(gd, x4, 0); + SET_DFNONE(); + IFX (X_CF | X_OF) { + XOR(x3, gd, x4); SNEZ(x3, x3); - IFX (X_CF) { - BSTRINS_D(xFlags, x3, F_CF, F_CF); - } - IFX (X_OF) { - BSTRINS_D(xFlags, x3, F_OF, F_OF); - } + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); } } else { - MULxw(gd, gd, ed); + MUL_W(gd, gd, ed); } ZEROUP(gd); } + IFX (X_SF) { + SRLI_D(x3, gd, rex.w ? 63 : 31); + BSTRINS_D(xFlags, x3, F_SF, F_SF); + } + IFX (X_PF) emit_pf(dyn, ninst, gd, x3, x4); + IFX (X_ALL) SPILL_EFLAGS(); + break; + case 0xB3: + INST_NAME("BTR Ed, Gd"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGD; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + wback = 0; + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + if (rex.w) + SRAI_D(x1, gd, 6); + else + SRAI_W(x1, gd, 5); + if (!rex.w && !rex.is32bits) { ADDI_W(x1, x1, 0); } + ALSLy(x3, x1, wback, 2 + rex.w); // (&ed) += r1*4; + LDxw(x1, x3, fixedaddress); + ed = x1; + wback = x3; + } + ANDI(x2, gd, rex.w ? 0x3f : 0x1f); + SRL_D(x4, ed, x2); + if(cpuext.lbt) { + X64_SET_EFLAGS(x4, X_CF); + } else { + BSTRINS_D(xFlags, x4, 0, 0); + } + ADDI_D(x4, xZR, 1); + ANDI(x2, gd, rex.w ? 0x3f : 0x1f); + SLL_D(x4, x4, x2); + ANDN(ed, ed, x4); + if (wback) { + SDxw(ed, wback, fixedaddress); + SMWRITE(); + } else if (!rex.w) { + ZEROUP(ed); + } break; case 0xB6: INST_NAME("MOVZX Gd, Eb"); nextop = F8; GETGD; + SCRATCH_USAGE(0); if (MODREG) { if (rex.rex) { - eb1 = TO_LA64((nextop & 7) + (rex.b << 3)); + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); eb2 = 0; } else { ed = (nextop & 7); - eb1 = TO_LA64(ed & 3); // Ax, Cx, Dx or Bx - eb2 = (ed & 4) >> 2; // L or H + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx + eb2 = (ed & 4) >> 2; // L or H } BSTRPICK_D(gd, eb1, eb2 * 8 + 7, eb2 * 8); } else { @@ -838,7 +1791,7 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni nextop = F8; GETGD; if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); BSTRPICK_D(gd, ed, 15, 0); } else { SMREAD(); @@ -851,26 +1804,26 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni switch ((nextop >> 3) & 7) { case 4: INST_NAME("BT Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); GETED(1); u8 = F8; u8 &= rex.w ? 0x3f : 0x1f; BSTRPICK_D(x4, ed, u8, u8); - if (la64_lbt) + if (cpuext.lbt) X64_SET_EFLAGS(x4, X_CF); else BSTRINS_D(xFlags, x4, 0, 0); break; case 5: INST_NAME("BTS Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); GETED(1); u8 = F8; u8 &= (rex.w ? 0x3f : 0x1f); BSTRPICK_D(x4, ed, u8, u8); - if (la64_lbt) + if (cpuext.lbt) X64_SET_EFLAGS(x4, X_CF); else BSTRINS_D(xFlags, x4, 0, 0); @@ -879,18 +1832,19 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni if (wback) { SDxw(ed, wback, fixedaddress); SMWRITE(); + } else if (!rex.w) { + ZEROUP(ed); } - MARK; break; case 6: INST_NAME("BTR Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); GETED(1); u8 = F8; u8 &= (rex.w ? 0x3f : 0x1f); BSTRPICK_D(x4, ed, u8, u8); - if (la64_lbt) + if (cpuext.lbt) X64_SET_EFLAGS(x4, X_CF); else BSTRINS_D(xFlags, x4, 0, 0); @@ -898,77 +1852,132 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni if (wback) { SDxw(ed, wback, fixedaddress); SMWRITE(); + } else if (!rex.w) { + ZEROUP(ed); + } + break; + case 7: + INST_NAME("BTC Ed, Ib"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + GETED(1); + u8 = F8; + u8 &= rex.w ? 0x3f : 0x1f; + BSTRPICK_D(x3, ed, u8, u8); + if (cpuext.lbt) + X64_SET_EFLAGS(x3, X_CF); + else + BSTRINS_D(xFlags, x3, 0, 0); + if (u8 <= 10) { + XORI(ed, ed, (1LL << u8)); + } else { + MOV64xw(x3, (1LL << u8)); + XOR(ed, ed, x3); + } + if (wback) { + SDxw(ed, wback, fixedaddress); + SMWRITE(); + } else if (!rex.w) { + ZEROUP(ed); } - MARK; break; default: DEFAULT; } break; + case 0xBB: + INST_NAME("BTC Ed, Gd"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGD; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + wback = 0; + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + if (rex.w) + SRAI_D(x1, gd, 6); + else + SRAI_W(x1, gd, 5); + if (!rex.w && !rex.is32bits) { ADDI_W(x1, x1, 0); } + ALSLy(x3, x1, wback, 2 + rex.w); // (&ed) += r1*4; + LDxw(x1, x3, fixedaddress); + ed = x1; + wback = x3; + } + ANDI(x2, gd, rex.w ? 0x3f : 0x1f); + SRL_D(x4, ed, x2); + if (cpuext.lbt) + X64_SET_EFLAGS(x4, X_CF); + else + BSTRINS_D(xFlags, x4, F_CF, F_CF); + ADDI_D(x4, xZR, 1); + SLL_D(x4, x4, x2); + XOR(ed, ed, x4); + if (wback) { + SDxw(ed, wback, fixedaddress); + SMWRITE(); + } else if (!rex.w) { + ZEROUP(ed); + } + break; case 0xBC: INST_NAME("BSF Gd, Ed"); - SETFLAGS(X_ZF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); + CLEAR_FLAGS(x2); nextop = F8; GETED(0); GETGD; if (!rex.w && MODREG) { - AND(x4, ed, xMASK); + ZEROUP2(x4, ed); ed = x4; } BNE_MARK(ed, xZR); - if (la64_lbt) { - ADDI_D(x3, xZR, 1 << F_ZF); - X64_SET_EFLAGS(x3, X_ZF); - } else { - ORI(xFlags, xFlags, 1 << F_ZF); - } - B_NEXT_nocond; + IFX (X_ZF) ORI(xFlags, xFlags, 1 << F_ZF); + B_MARK2_nocond; MARK; - // gd is undefined if ed is all zeros, don't worry. - if (rex.w) - CTZ_D(gd, ed); - else - CTZ_W(gd, ed); - if (la64_lbt) { - X64_SET_EFLAGS(xZR, X_ZF); - } else { - ADDI_D(x3, xZR, ~(1 << F_ZF)); - AND(xFlags, xFlags, x3); + CTZxw(gd, ed); + MARK2; + IFX (BOX64DRENV(dynarec_safeflags)) { + IFX (X_PF) emit_pf(dyn, ninst, gd, x2, x5); } + SPILL_EFLAGS(); break; case 0xBD: INST_NAME("BSR Gd, Ed"); - SETFLAGS(X_ZF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); + CLEAR_FLAGS(x2); nextop = F8; GETED(0); GETGD; if (!rex.w && MODREG) { - AND(x4, ed, xMASK); + ZEROUP2(x4, ed); ed = x4; } BNE_MARK(ed, xZR); - if (la64_lbt) { - ADDI_D(x3, xZR, 1 << F_ZF); - X64_SET_EFLAGS(x3, X_ZF); - } else { - ORI(xFlags, xFlags, 1 << F_ZF); - } - B_NEXT_nocond; + IFX (X_ZF) ORI(xFlags, xFlags, 1 << F_ZF); + B_MARK2_nocond; MARK; - if (la64_lbt) { - X64_SET_EFLAGS(xZR, X_ZF); - } else { - ADDI_D(x3, xZR, ~(1 << F_ZF)); - AND(xFlags, xFlags, x3); - } - if (rex.w) - CLZ_D(gd, ed); - else - CLZ_W(gd, ed); + CLZxw(gd, ed); ADDI_D(x1, xZR, rex.w ? 63 : 31); SUB_D(gd, x1, gd); + MARK2; + if (BOX64DRENV(dynarec_safeflags)) { + IFX (X_PF) emit_pf(dyn, ninst, gd, x2, x5); + } + SPILL_EFLAGS(); break; case 0xBE: INST_NAME("MOVSX Gd, Eb"); @@ -976,12 +1985,12 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni GETGD; if (MODREG) { if (rex.rex) { - wback = TO_LA64((nextop & 7) + (rex.b << 3)); + wback = TO_NAT((nextop & 7) + (rex.b << 3)); wb2 = 0; } else { wback = (nextop & 7); wb2 = (wback >> 2) * 8; - wback = TO_LA64(wback & 3); + wback = TO_NAT(wback & 3); } BSTRPICK_D(gd, wback, wb2 + 7, wb2); EXT_W_B(gd, gd); @@ -997,7 +2006,7 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni nextop = F8; GETGD; if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); EXT_W_H(gd, ed); } else { SMREAD(); @@ -1006,6 +2015,29 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } if (!rex.w) ZEROUP(gd); break; + case 0xC0: + INST_NAME("XADD Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + GETGB(x1); + GETEB(x2, 0); + gd = x2; + ed = x1; + emit_add8(dyn, ninst, ed, gd, x4, x5); + GBBACK(); + EBBACK(); + break; + case 0xC1: + INST_NAME("XADD Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + GETGD; + GETED(0); + if (ed != gd) MV(x7, ed); + emit_add32(dyn, ninst, rex, ed, gd, x4, x5, x6); + if (ed != gd) MVxw(gd, x7); + WBACK; + break; case 0xC2: INST_NAME("CMPPS Gx, Ex, Ib"); nextop = F8; @@ -1023,6 +2055,48 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 7: VFCMP_S(v0, v0, v1, cOR); break; // not NaN } break; + case 0xC3: + INST_NAME("MOVNTI Ed, Gd"); + nextop = F8; + GETGD; + if (MODREG) { + MVxw(TO_NAT((nextop & 7) + (rex.b << 3)), gd); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + SDxw(gd, ed, fixedaddress); + } + break; + case 0xC4: + INST_NAME("PINSRW Gm,Ed,Ib"); + nextop = F8; + GETGM(v0); + if (MODREG) { + u8 = (F8) & 3; + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x4, &fixedaddress, rex, NULL, 1, 1); + u8 = (F8) & 3; + ed = x3; + LD_HU(ed, wback, fixedaddress); + } + VINSGR2VR_H(v0, ed, u8); + break; + case 0xC5: + INST_NAME("PEXTRW Gd,Em,Ib"); + nextop = F8; + GETGD; + if (MODREG) { + GETEM(v0, 1); + u8 = (F8) & 3; + VPICKVE2GR_HU(gd, v0, u8); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x4, &fixedaddress, rex, NULL, 0, 1); + u8 = (F8) & 3; + LD_HU(gd, wback, (u8 << 1)); + } + break; case 0xC6: INST_NAME("SHUFPS Gx, Ex, Ib"); nextop = F8; @@ -1038,6 +2112,26 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni VEXTRINS_D(v0, q1, 0x11); // v0[127:64] = q1[127:64] } break; + case 0xC7: + // rep has no impact here + nextop = F8; + if (MODREG) { + switch ((nextop >> 3) & 7) { + default: + DEFAULT; + } + } else { + switch ((nextop >> 3) & 7) { + case 4: + INST_NAME("Unsupported XSAVEC Ed"); + FAKEED; + UDF(); + break; + default: + DEFAULT; + } + } + break; case 0xC8: case 0xC9: case 0xCA: @@ -1047,9 +2141,365 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0xCE: case 0xCF: INST_NAME("BSWAP Reg"); - gd = TO_LA64((opcode & 7) + (rex.b << 3)); + gd = TO_NAT((opcode & 7) + (rex.b << 3)); REVBxw(gd, gd); break; + case 0xD1: + INST_NAME("PSRLW Gm, Em"); + nextop = F8; + GETGM(d0); + GETEM(d1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VSLEI_DU(v0, d1, 15); + VREPLVEI_H(v1, d1, 0); + VSRL_H(d0, d0, v1); + VAND_V(d0, d0, v0); + break; + case 0xD2: + INST_NAME("PSRLD Gm, Em"); + nextop = F8; + GETGM(d0); + GETEM(d1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VSLEI_DU(v0, d1, 31); + VREPLVEI_W(v1, d1, 0); + VSRL_W(d0, d0, v1); + VAND_V(d0, d0, v0); + break; + case 0xD3: + INST_NAME("PSRLQ Gm, Em"); + nextop = F8; + GETGM(d0); + GETEM(d1, 0); + v0 = fpu_get_scratch(dyn); + VLDI(v0, 0b0110000111111); // broadcast 63 as 64bit imm + VSLE_DU(v0, d1, v0); + VSRL_D(d0, d0, d1); + VAND_V(d0, d0, v0); + break; + case 0xD4: + INST_NAME("PADDQ Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VADD_D(v0, v0, v1); + break; + case 0xD5: + INST_NAME("PMULLW Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + VMUL_H(q0, q0, q1); + break; + case 0xD7: + nextop = F8; + INST_NAME("PMOVMSKB Gd, Em"); + GETGD; + v0 = fpu_get_scratch(dyn); + GETEM(v1, 0); + VMSKLTZ_B(v0, v1); + MOVFR2GR_D(x1, v0); + BSTRPICK_D(gd, x1, 7, 0); + break; + case 0xD8: + INST_NAME("PSUBUSB Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + VSSUB_BU(q0, q0, q1); + break; + case 0xD9: + INST_NAME("PSUBUSW Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + VSSUB_HU(q0, q0, q1); + break; + case 0xDA: + INST_NAME("PMINUB Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VMIN_BU(v0, v0, v1); + break; + case 0xDB: + INST_NAME("PAND Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VAND_V(v0, v0, v1); + break; + case 0xDC: + INST_NAME("PADDUSB Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + VSADD_BU(q0, q0, q1); + break; + case 0xDD: + INST_NAME("PADDUSW Gm, Em"); + nextop = F8; + GETGM(q0); + GETEM(q1, 0); + VSADD_HU(q0, q0, q1); + break; + case 0xDE: + INST_NAME("PMAXUB Gm, Em"); + nextop = F8; + GETGM(d0); + GETEM(d1, 0); + VMAX_BU(d0, d0, d1); + break; + case 0xDF: + INST_NAME("PANDN Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VANDN_V(v0, v0, v1); + break; + case 0xE0: + INST_NAME("PAVGB Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VAVGR_BU(v0, v0, v1); + break; + case 0xE1: + INST_NAME("PSRAW Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + q0 = fpu_get_scratch(dyn); + VMINI_DU(q0, v1, 15); + VREPLVEI_H(q0, q0, 0); + VSRA_H(v0, v0, q0); + break; + case 0xE2: + INST_NAME("PSRAD Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + q0 = fpu_get_scratch(dyn); + VMINI_DU(q0, v1, 31); + VREPLVEI_W(q0, q0, 0); + VSRA_W(v0, v0, q0); + break; + case 0xE3: + INST_NAME("PAVGW Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VAVGR_HU(v0, v0, v1); + break; + case 0xE4: + INST_NAME("PMULHUW Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VMUH_HU(v0, v0, v1); + break; + case 0xE5: + INST_NAME("PMULHW Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VMUH_H(v0, v0, v1); + break; + case 0xE7: + INST_NAME("MOVNTQ Em, Gm"); + nextop = F8; + GETGM(v0); + if (MODREG) { + v1 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, nextop & 7); + FMOV_D(v1, v0); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 1, 0); + FST_D(v0, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0xE8: + INST_NAME("PSUBSB Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(q0, 0); + VSSUB_B(v0, v0, q0); + break; + case 0xE9: + INST_NAME("PSUBSW Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(q0, 0); + VSSUB_H(v0, v0, q0); + break; + case 0xEA: + INST_NAME("PMINSW Gx, Ex"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VMIN_H(v0, v0, v1); + break; + case 0xEB: + INST_NAME("POR Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VOR_V(v0, v0, v1); + break; + case 0xEC: + INST_NAME("PADDSB Gm, Em"); + nextop = F8; + GETGM(d0); + GETEM(d1, 0); + VSADD_B(d0, d0, d1); + break; + case 0xED: + INST_NAME("PADDSW Gm, Em"); + nextop = F8; + GETGM(d0); + GETEM(d1, 0); + VSADD_H(d0, d0, d1); + break; + case 0xEE: + INST_NAME("PMAXSW Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VMAX_H(v0, v0, v1); + break; + case 0xEF: + INST_NAME("PXOR Gm, Em"); + nextop = F8; + GETGM(d0); + GETEM(d1, 0); + VXOR_V(d0, d0, d1); + break; + case 0xF1: + INST_NAME("PSLLW Gm, Em"); + nextop = F8; + GETGM(d0); + GETEM(d1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VSLEI_DU(v0, d1, 15); + VREPLVEI_H(v1, d1, 0); + VSLL_H(d0, d0, v1); + VAND_V(d0, d0, v0); + break; + case 0xF2: + INST_NAME("PSLLD Gm, Em"); + nextop = F8; + GETGM(d0); + GETEM(d1, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VSLEI_DU(v0, d1, 31); + VREPLVEI_W(v1, d1, 0); + VSLL_W(d0, d0, v1); + VAND_V(d0, d0, v0); + break; + case 0xF3: + INST_NAME("PSLLQ Gm, Em"); + nextop = F8; + GETGM(d0); + GETEM(d1, 0); + v0 = fpu_get_scratch(dyn); + VLDI(v0, 0b0110000111111); // broadcast 63 as 64bit imm + VSLE_DU(v0, d1, v0); + VSLL_D(d0, d0, d1); + VAND_V(d0, d0, v0); + break; + case 0xF4: + INST_NAME("PMULUDQ Gm,Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VMULWEV_D_WU(v0, v0, v1); + break; + case 0xF5: + INST_NAME("PMADDWD Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + q0 = fpu_get_scratch(dyn); + VXOR_V(q0, q0, q0); + VMADDWEV_W_H(q0, v0, v1); + VMADDWOD_W_H(q0, v0, v1); + VBSLL_V(v0, q0, 0); + break; + case 0xF6: + INST_NAME("PSADBW Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VABSD_BU(v0, v0, v1); + VHADDW_HU_BU(v0, v0, v0); + VHADDW_WU_HU(v0, v0, v0); + VHADDW_DU_WU(v0, v0, v0); + break; + case 0xF7: + INST_NAME("MASKMOVQ Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VSLTI_B(q1, v1, 0); // q1 = byte selection mask + FLD_D(q0, xRDI, 0); + VBITSEL_V(q0, q0, v0, q1); // sel v0 if mask is 1 + FST_D(q0, xRDI, 0); + break; + case 0xF8: + INST_NAME("PSUBB Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VSUB_B(v0, v0, v1); + break; + case 0xF9: + INST_NAME("PSUBW Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VSUB_H(v0, v0, v1); + break; + case 0xFA: + INST_NAME("PSUBD Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VSUB_W(v0, v0, v1); + break; + case 0xFB: + INST_NAME("PSUBQ Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VSUB_D(v0, v0, v1); + break; + case 0xFC: + INST_NAME("PADDB Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VADD_B(v0, v0, v1); + break; + case 0xFD: + INST_NAME("PADDW Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VADD_H(v0, v0, v1); + break; + case 0xFE: + INST_NAME("PADDD Gm, Em"); + nextop = F8; + GETGM(v0); + GETEM(v1, 0); + VADD_W(v0, v0, v1); + break; default: DEFAULT; } diff --git a/src/dynarec/la64/dynarec_la64_64.c b/src/dynarec/la64/dynarec_la64_64.c deleted file mode 100644 index 892d329..0000000 --- a/src/dynarec/la64/dynarec_la64_64.c +++ /dev/null @@ -1,393 +0,0 @@ -#include -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "la64_emitter.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" -#include "custommem.h" - -#include "la64_printer.h" -#include "dynarec_la64_private.h" -#include "dynarec_la64_helper.h" -#include "dynarec_la64_functions.h" - -uintptr_t dynarec64_64(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int seg, int* ok, int* need_epilog) -{ - (void)ip; - (void)rep; - (void)need_epilog; - - uint8_t opcode = F8; - uint8_t nextop; - uint8_t u8; - uint8_t gd, ed, eb1, eb2, gb1, gb2; - uint8_t gback, wback, wb1, wb2, wb; - int64_t i64, j64; - uint64_t u64; - int v0, v1; - int q0; - int d0; - int64_t fixedaddress, gdoffset; - int unscaled; - MAYUSE(eb1); - MAYUSE(eb2); - MAYUSE(wb1); - MAYUSE(wb2); - MAYUSE(gb1); - MAYUSE(gb2); - MAYUSE(j64); - MAYUSE(d0); - MAYUSE(q0); - MAYUSE(v0); - MAYUSE(v1); - - while ((opcode == 0xF2) || (opcode == 0xF3)) { - rep = opcode - 0xF1; - opcode = F8; - } - - GETREX(); - - switch (opcode) { - case 0x03: - INST_NAME("ADD Gd, Seg:Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_add32(dyn, ninst, rex, gd, ed, x3, x4, x5); - break; - case 0x33: - INST_NAME("XOR Gd, Seg:Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0); - emit_xor32(dyn, ninst, rex, gd, ed, x3, x4); - break; - case 0x64: - addr = dynarec64_64(dyn, addr, ip, ninst, rex, rep, _FS, ok, need_epilog); - break; - case 0x65: - addr = dynarec64_64(dyn, addr, ip, ninst, rex, rep, _GS, ok, need_epilog); - break; - case 0x66: - addr = dynarec64_6664(dyn, addr, ip, ninst, rex, seg, ok, need_epilog); - break; - case 0x80: - nextop = F8; - switch ((nextop >> 3) & 7) { - case 0: // ADD - INST_NAME("ADD Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_add8c(dyn, ninst, x1, u8, x2, x4, x5); - EBBACK(); - break; - case 1: // OR - INST_NAME("OR Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_or8c(dyn, ninst, x1, u8, x2, x4, x5); - EBBACK(); - break; - case 3: // SBB - INST_NAME("SBB Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_sbb8c(dyn, ninst, x1, u8, x2, x4, x5, x6); - EBBACK(); - break; - case 4: // AND - INST_NAME("AND Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_and8c(dyn, ninst, x1, u8, x2, x4); - EBBACK(); - break; - case 5: // SUB - INST_NAME("SUB Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_sub8c(dyn, ninst, x1, u8, x2, x4, x5, x6); - EBBACK(); - break; - case 6: // XOR - INST_NAME("XOR Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_xor8c(dyn, ninst, x1, u8, x2, x4); - EBBACK(); - break; - case 7: // CMP - INST_NAME("CMP Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - if (u8) { - MOV32w(x2, u8); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6); - } else { - emit_cmp8_0(dyn, ninst, x1, x3, x4); - } - break; - default: - DEFAULT; - } - break; - case 0x81: - case 0x83: - nextop = F8; - grab_segdata(dyn, addr, ninst, x6, seg); - switch ((nextop >> 3) & 7) { - case 0: - if (opcode == 0x81) { - INST_NAME("ADD Ed, Id"); - } else { - INST_NAME("ADD Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode == 0x81) ? 4 : 1); - if (opcode == 0x81) - i64 = F32S; - else - i64 = F8S; - emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5, xMASK); - IFXA (X_CF, !la64_lbt) - REGENERATE_MASK(); // use xMASK as a scratch - WBACKO(x6); - break; - case 1: - if (opcode == 0x81) { - INST_NAME("OR Ed, Id"); - } else { - INST_NAME("OR Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode == 0x81) ? 4 : 1); - if (opcode == 0x81) - i64 = F32S; - else - i64 = F8S; - emit_or32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACKO(x6); - break; - case 2: - if (opcode == 0x81) { - INST_NAME("ADC Ed, Id"); - } else { - INST_NAME("ADC Ed, Ib"); - } - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode == 0x81) ? 4 : 1); - if (opcode == 0x81) - i64 = F32S; - else - i64 = F8S; - MOV64xw(x5, i64); - IFXA (X_ALL, !la64_lbt) - ST_D(x6, xEmu, offsetof(x64emu_t, scratch)); - emit_adc32(dyn, ninst, rex, ed, x5, x3, x4, x6, xMASK); - IFXA (X_ALL, !la64_lbt) { - LD_D(x6, xEmu, offsetof(x64emu_t, scratch)); - REGENERATE_MASK(); // use xMASK as a scratch - } - WBACKO(x6); - break; - case 3: - if (opcode == 0x81) { - INST_NAME("SBB Ed, Id"); - } else { - INST_NAME("SBB Ed, Ib"); - } - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode == 0x81) ? 4 : 1); - if (opcode == 0x81) - i64 = F32S; - else - i64 = F8S; - MOV64xw(x5, i64); - emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4, xMASK); - IFXA (X_CF, !la64_lbt) - REGENERATE_MASK(); // use xMASK as a scratch - WBACKO(x6); - break; - case 4: - if (opcode == 0x81) { - INST_NAME("AND Ed, Id"); - } else { - INST_NAME("AND Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode == 0x81) ? 4 : 1); - if (opcode == 0x81) - i64 = F32S; - else - i64 = F8S; - emit_and32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACKO(x6); - break; - case 5: - if (opcode == 0x81) { - INST_NAME("SUB Ed, Id"); - } else { - INST_NAME("SUB Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode == 0x81) ? 4 : 1); - if (opcode == 0x81) - i64 = F32S; - else - i64 = F8S; - emit_sub32c(dyn, ninst, rex, ed, i64, x3, x4, x5, xMASK); - IFXA (X_CF, !la64_lbt) - REGENERATE_MASK(); // use xMASK as a scratch - WBACKO(x6); - break; - case 6: - if (opcode == 0x81) { - INST_NAME("XOR Ed, Id"); - } else { - INST_NAME("XOR Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode == 0x81) ? 4 : 1); - if (opcode == 0x81) - i64 = F32S; - else - i64 = F8S; - emit_xor32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACKO(x6); - break; - case 7: - if (opcode == 0x81) { - INST_NAME("CMP Ed, Id"); - } else { - INST_NAME("CMP Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode == 0x81) ? 4 : 1); - if (opcode == 0x81) - i64 = F32S; - else - i64 = F8S; - if (i64) { - MOV64xw(x2, i64); - emit_cmp32(dyn, ninst, rex, ed, x2, x3, x4, x5, x6); - } else - emit_cmp32_0(dyn, ninst, rex, ed, x3, x4); - break; - } - break; - case 0x89: - INST_NAME("MOV Seg:Ed, Gd"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - if (MODREG) { // reg <= reg - MVxw(TO_LA64((nextop & 7) + (rex.b << 3)), gd); - } else { // mem <= reg - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - ADD_D(x4, ed, x4); - SDxw(gd, x4, fixedaddress); - SMWRITE2(); - } - break; - case 0x8B: - INST_NAME("MOV Gd, Seg:Ed"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - if (MODREG) { // reg <= reg - MVxw(gd, TO_LA64((nextop & 7) + (rex.b << 3))); - } else { // mem <= reg - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - ADD_D(x4, ed, x4); - LDxw(gd, x4, fixedaddress); - } - break; - case 0xC6: - INST_NAME("MOV Seg:Eb, Ib"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - if (MODREG) { // reg <= u8 - u8 = F8; - if (!rex.rex) { - ed = (nextop & 7); - eb1 = TO_LA64(ed & 3); // Ax, Cx, Dx or Bx - eb2 = (ed & 4) >> 2; // L or H - } else { - eb1 = TO_LA64((nextop & 7) + (rex.b << 3)); - eb2 = 0; - } - MOV32w(x3, u8); - BSTRINS_D(eb1, x3, eb2 * 8 + 7, eb2 * 8); - } else { // mem <= u8 - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 1); - u8 = F8; - if (u8) { - ADDI_D(x3, xZR, u8); - ed = x3; - } else - ed = xZR; - STX_B(x3, wback, x4); - SMWRITE2(); - } - break; - case 0xC7: - INST_NAME("MOV Seg:Ed, Id"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - if (MODREG) { // reg <= i32 - i64 = F32S; - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - MOV64xw(ed, i64); - } else { // mem <= i32 - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 4); - i64 = F32S; - if (i64) { - MOV64xw(x3, i64); - ed = x3; - } else - ed = xZR; - ADD_D(x4, wback, x4); - SDxw(ed, x4, fixedaddress); - SMWRITE2(); - } - break; - default: - DEFAULT; - } - return addr; -} diff --git a/src/dynarec/la64/dynarec_la64_66.c b/src/dynarec/la64/dynarec_la64_66.c index 3c32462..a98a310 100644 --- a/src/dynarec/la64/dynarec_la64_66.c +++ b/src/dynarec/la64/dynarec_la64_66.c @@ -5,11 +5,10 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "la64_emitter.h" -#include "x64run.h" +#include "la64_mapping.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -20,11 +19,11 @@ #include "la64_printer.h" #include "dynarec_la64_private.h" -#include "dynarec_la64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_la64_functions.h" -uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { uint8_t opcode = F8; uint8_t nextop, u8; @@ -44,173 +43,235 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MAYUSE(j64); MAYUSE(lock); - while ((opcode == 0x2E) || (opcode == 0x36) || (opcode == 0x66)) // ignoring CS:, SS: or multiple 0x66 - opcode = F8; - - while ((opcode == 0xF2) || (opcode == 0xF3)) { - rep = opcode - 0xF1; - opcode = F8; - } - - GETREX(); - - if (rex.w && !(opcode == 0x0f || opcode == 0xf0 || opcode == 0x64 || opcode == 0x65)) // rex.w cancels "66", but not for 66 0f type of prefix - return dynarec64_00(dyn, addr - 1, ip, ninst, rex, rep, ok, need_epilog); // addr-1, to "put back" opcode + if (rex.w && !(opcode == 0x0f)) // rex.w cancels "66", but not for 66 0f type of prefix + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); // addr-1, to "put back" opcode switch (opcode) { case 0x01: INST_NAME("ADD Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETGW(x2); - GETEW(x1, 0); - emit_add16(dyn, ninst, x1, x2, x4, x5, x6); + GETGWEW(x1, x2, 0); + emit_add16(dyn, ninst, ed, gd, x4, x5, x6); EWBACK; break; case 0x03: INST_NAME("ADD Gw, Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETGW(x1); - GETEW(x2, 0); - emit_add16(dyn, ninst, x1, x2, x3, x4, x6); + GETGWEW(x1, x2, 0); + emit_add16(dyn, ninst, gd, ed, x3, x4, x6); GWBACK; break; case 0x05: INST_NAME("ADD AX, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i32 = F16; BSTRPICK_D(x1, xRAX, 15, 0); MOV32w(x2, i32); emit_add16(dyn, ninst, x1, x2, x3, x4, x6); - BSTRINS_D(xRAX, x1, 15, 0); + BSTRINSz(xRAX, x1, 15, 0); + break; + case 0x06: + INST_NAME("PUSH ES"); + LD_HU(x1, xEmu, offsetof(x64emu_t, segs[_ES])); + PUSH1_16(x1); + break; + case 0x07: + INST_NAME("POP ES"); + POP1_16(x1); + ST_H(x1, xEmu, offsetof(x64emu_t, segs[_ES])); break; case 0x09: INST_NAME("OR Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETGW(x2); - GETEW(x1, 0); - emit_or16(dyn, ninst, x1, x2, x4, x2); + GETGWEW(x1, x2, 0); + emit_or16(dyn, ninst, ed, gd, x4, x5); EWBACK; break; case 0x0B: INST_NAME("OR Gw, Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETGW(x1); - GETEW(x2, 0); - emit_or16(dyn, ninst, x1, x2, x4, x5); + GETGWEW(x1, x2, 0); + emit_or16(dyn, ninst, gd, ed, x4, x5); GWBACK; break; case 0x0D: INST_NAME("OR AX, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i32 = F16; BSTRPICK_D(x1, xRAX, 15, 0); MOV32w(x2, i32); emit_or16(dyn, ninst, x1, x2, x3, x4); - BSTRINS_D(xRAX, x1, 15, 0); + BSTRINSz(xRAX, x1, 15, 0); break; case 0x0F: - switch (rep) { - case 0: addr = dynarec64_660F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; - default: - DEFAULT; + switch (rex.rep) { + case 1: addr = dynarec64_66F20F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; + case 2: addr = dynarec64_66F30F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; + default: addr = dynarec64_660F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; } break; + case 0x11: + INST_NAME("ADC Ew, Gw"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + GETGWEW(x1, x2, 0); + emit_adc16(dyn, ninst, ed, gd, x4, x6, x5); + EWBACK; + break; + case 0x13: + INST_NAME("ADC Gw, Ew"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + GETGWEW(x1, x2, 0); + emit_adc16(dyn, ninst, gd, ed, x4, x6, x5); + GWBACK; + break; + case 0x15: + INST_NAME("ADC AX, Iw"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + u64 = F16; + BSTRPICK_D(x1, xRAX, 15, 0); + MOV64x(x2, u64); + emit_adc16(dyn, ninst, x1, x2, x3, x4, x5); + BSTRINSz(xRAX, x1, 15, 0); + break; case 0x19: INST_NAME("SBB Ew, Gw"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETGW(x2); - GETEW(x1, 0); - emit_sbb16(dyn, ninst, x1, x2, x4, x5, x6); + GETGWEW(x1, x2, 0); + emit_sbb16(dyn, ninst, ed, gd, x4, x5, x6); EWBACK; break; + case 0x1B: + INST_NAME("SBB Gw, Ew"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + GETGWEW(x1, x2, 0); + emit_sbb16(dyn, ninst, gd, ed, x6, x4, x5); + GWBACK; + break; + case 0x1D: + INST_NAME("SBB AX, Iw"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + BSTRPICK_D(x1, xRAX, 15, 0); + u64 = F16; + MOV64x(x2, u64); + emit_sbb16(dyn, ninst, x1, x2, x3, x4, x5); + BSTRINSz(xRAX, x1, 15, 0); + break; + case 0x1E: + INST_NAME("PUSH DS"); + LD_HU(x1, xEmu, offsetof(x64emu_t, segs[_DS])); + PUSH1_16(x1); + break; + case 0x1F: + INST_NAME("POP DS"); + POP1_16(x1); + ST_H(x1, xEmu, offsetof(x64emu_t, segs[_DS])); + break; case 0x21: INST_NAME("AND Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETGW(x2); - GETEW(x1, 0); - emit_and16(dyn, ninst, x1, x2, x4, x5); + GETGWEW(x1, x2, 0); + emit_and16(dyn, ninst, ed, gd, x4, x5); EWBACK; break; case 0x23: INST_NAME("AND Gw, Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETGW(x1); - GETEW(x2, 0); - emit_and16(dyn, ninst, x1, x2, x3, x4); + GETGWEW(x1, x2, 0); + emit_and16(dyn, ninst, gd, ed, x3, x4); GWBACK; break; case 0x25: INST_NAME("AND AX, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i32 = F16; BSTRPICK_D(x1, xRAX, 15, 0); MOV32w(x2, i32); emit_and16(dyn, ninst, x1, x2, x3, x4); - BSTRINS_D(xRAX, x1, 15, 0); + BSTRINSz(xRAX, x1, 15, 0); break; case 0x29: INST_NAME("SUB Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETGW(x1); - GETEW(x2, 0); - emit_sub16(dyn, ninst, x2, x1, x4, x5, x6); + GETGWEW(x1, x2, 0); + emit_sub16(dyn, ninst, ed, gd, x4, x5, x6); EWBACK; break; case 0x2B: INST_NAME("SUB Gw, Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETGW(x1); - GETEW(x2, 0); - emit_sub16(dyn, ninst, x1, x2, x3, x4, x5); + GETGWEW(x1, x2, 0); + emit_sub16(dyn, ninst, gd, ed, x3, x4, x5); GWBACK; break; case 0x2D: INST_NAME("SUB AX, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i32 = F16; BSTRPICK_D(x1, xRAX, 15, 0); MOV32w(x2, i32); emit_sub16(dyn, ninst, x1, x2, x3, x4, x5); - BSTRINS_D(xRAX, x1, 15, 0); + BSTRINSz(xRAX, x1, 15, 0); break; case 0x31: INST_NAME("XOR Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETGW(x2); - GETEW(x1, 0); - emit_xor16(dyn, ninst, x1, x2, x4, x5, x6); + GETGWEW(x1, x2, 0); + emit_xor16(dyn, ninst, ed, gd, x4, x5, x6); EWBACK; break; + case 0x33: + INST_NAME("XOR Gw, Ew"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + GETGWEW(x1, x2, 0); + emit_xor16(dyn, ninst, gd, ed, x3, x4, x5); + GWBACK; + break; + case 0x35: + INST_NAME("XOR AX, Iw"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + i32 = F16; + BSTRPICK_D(x1, xRAX, 15, 0); + MOV32w(x2, i32); + emit_xor16(dyn, ninst, x1, x2, x3, x4, x5); + BSTRINSz(xRAX, x1, 15, 0); + break; case 0x39: INST_NAME("CMP Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETGW(x2); - GETEW(x1, 0); - emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6); + GETGWEW(x1, x2, 0); + emit_cmp16(dyn, ninst, ed, gd, x3, x4, x5, x6); break; case 0x3B: INST_NAME("CMP Gw, Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETGW(x1); - GETEW(x2, 0); - emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6); + GETGWEW(x1, x2, 0); + emit_cmp16(dyn, ninst, gd, ed, x3, x4, x5, x6); break; case 0x3D: INST_NAME("CMP AX, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i32 = F16; BSTRPICK_D(x1, xRAX, 15, 0); if (i32) { @@ -220,23 +281,116 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni emit_cmp16_0(dyn, ninst, x1, x3, x4); } break; - case 0x64: - addr = dynarec64_6664(dyn, addr, ip, ninst, rex, _FS, ok, need_epilog); + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + INST_NAME("INC Reg16 (32bits)"); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + gd = TO_NAT(opcode & 7); + BSTRPICK_D(x1, gd, 15, 0); + emit_inc16(dyn, ninst, x1, x2, x3, x4); + BSTRINS_D(gd, x1, 15, 0); + break; + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + INST_NAME("DEC Reg16 (32bits)"); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + gd = TO_NAT(opcode & 7); + BSTRPICK_D(x1, gd, 15, 0); + emit_dec16(dyn, ninst, x1, x2, x3, x4, x5); + BSTRINS_D(gd, x1, 15, 0); + break; + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + INST_NAME("PUSH reg"); + SCRATCH_USAGE(0); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); + PUSH1_16(gd); + break; + case 0x58: + case 0x59: + case 0x5A: + case 0x5B: + case 0x5C: + case 0x5D: + case 0x5E: + case 0x5F: + INST_NAME("POP reg"); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); + POP1_16(x1); + BSTRINS_D(gd, x1, 15, 0); + break; + case 0x60: + if (rex.is32bits) { + INST_NAME("PUSHA 16bits (32bits)"); + MV(x1, xRSP); + PUSH1_16(xRAX); + PUSH1_16(xRCX); + PUSH1_16(xRDX); + PUSH1_16(xRBX); + PUSH1_16(x1); + PUSH1_16(xRBP); + PUSH1_16(xRSI); + PUSH1_16(xRDI); + } else + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); break; - case 0x65: - addr = dynarec64_6664(dyn, addr, ip, ninst, rex, _GS, ok, need_epilog); + case 0x61: + if (rex.is32bits) { + INST_NAME("POPA 16bits (32bits)"); + POP1_16(x1); + BSTRINS_D(xRDI, x1, 15, 0); + POP1_16(x1); + BSTRINS_D(xRSI, x1, 15, 0); + POP1_16(x1); + BSTRINS_D(xRBP, x1, 15, 0); + POP1_16(x1); // RSP ignored + POP1_16(x1); + BSTRINS_D(xRBX, x1, 15, 0); + POP1_16(x1); + BSTRINS_D(xRDX, x1, 15, 0); + POP1_16(x1); + BSTRINS_D(xRCX, x1, 15, 0); + POP1_16(x1); + BSTRINS_D(xRAX, x1, 15, 0); + } else + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); break; - case 0x66: - addr = dynarec64_66(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + case 0x68: + INST_NAME("PUSH Iw"); + u16 = F16; + if (!u16) { + PUSH1_16(xZR); + } else { + MOV32w(x2, u16); + PUSH1_16(x2); + } break; case 0x69: case 0x6B: if (opcode == 0x69) { - INST_NAME("IMUL Gw,Ew,Iw"); + INST_NAME("IMUL Gw, Ew, Iw"); } else { - INST_NAME("IMUL Gw,Ew,Ib"); + INST_NAME("IMUL Gw, Ew, Ib"); } - SETFLAGS(X_ALL, SF_PENDING); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); nextop = F8; GETSEW(x1, (opcode == 0x69) ? 2 : 1); if (opcode == 0x69) @@ -245,11 +399,56 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni i32 = F8S; MOV32w(x2, i32); MUL_W(x2, x2, x1); - UFLAG_RES(x2); gd = x2; GWBACK; - UFLAG_DF(x1, d_imul16); + SET_DFNONE(); + CLEAR_FLAGS(x3); + IFX (X_CF | X_OF) { + SRAI_W(x1, x2, 15); + SRAI_W(x3, x2, 31); + XOR(x3, x1, x3); + SNEZ(x3, x3); + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); + } + IFX (X_SF) { + SRLI_D(x3, x2, 15); + BSTRINS_D(xFlags, x3, F_SF, F_SF); + } + IFX (X_PF) emit_pf(dyn, ninst, x2, x3, x5); + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + break; + case 0x6A: + INST_NAME("PUSH Ib"); + i16 = F8S; + if (!i16) { + PUSH1_16(xZR); + } else { + MOV32w(x2, (uint16_t)i16); + PUSH1_16(x2); + } break; + case 0x6C: + case 0x6E: + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: + case 0x79: + case 0x7a: + case 0x7b: + case 0x7c: + case 0x7d: + case 0x7e: + case 0x7f: + // just use regular conditional jump + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); case 0x81: case 0x83: nextop = F8; @@ -260,13 +459,13 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { INST_NAME("ADD Ew, Ib"); } - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEW(x1, (opcode == 0x81) ? 2 : 1); if (opcode == 0x81) - i16 = F16S; + u64 = F16; else - i16 = F8S; - MOV64x(x5, i16); + u64 = (uint16_t)(int16_t)F8S; + MOV64x(x5, u64); emit_add16(dyn, ninst, ed, x5, x2, x4, x6); EWBACK; break; @@ -276,29 +475,63 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { INST_NAME("OR Ew, Ib"); } - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEW(x1, (opcode == 0x81) ? 2 : 1); if (opcode == 0x81) - i16 = F16S; + u64 = F16; else - i16 = F8S; - MOV64x(x5, i16); + u64 = (uint16_t)(int16_t)F8S; + MOV64x(x5, u64); emit_or16(dyn, ninst, x1, x5, x2, x4); EWBACK; break; + case 2: // ADC + if (opcode == 0x81) { + INST_NAME("ADC Ew, Iw"); + } else { + INST_NAME("ADC Ew, Ib"); + } + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEW(x1, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; + MOV64x(x5, u64); + emit_adc16(dyn, ninst, x1, x5, x2, x4, x6); + EWBACK; + break; + case 3: // SBB + if (opcode == 0x81) { + INST_NAME("SBB Ew, Iw"); + } else { + INST_NAME("SBB Ew, Ib"); + } + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEW(x1, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; + MOV64x(x5, u64); + emit_sbb16(dyn, ninst, x1, x5, x2, x4, x6); + EWBACK; + break; case 4: // AND if (opcode == 0x81) { INST_NAME("AND Ew, Iw"); } else { INST_NAME("AND Ew, Ib"); } - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEW(x1, (opcode == 0x81) ? 2 : 1); if (opcode == 0x81) - i16 = F16S; + u64 = F16; else - i16 = F8S; - MOV64x(x5, i16); + u64 = (uint16_t)(int16_t)F8S; + MOV64x(x5, u64); emit_and16(dyn, ninst, x1, x5, x2, x4); EWBACK; break; @@ -308,13 +541,13 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { INST_NAME("SUB Ew, Ib"); } - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEW(x1, (opcode == 0x81) ? 2 : 1); if (opcode == 0x81) - i16 = F16S; + u64 = F16; else - i16 = F8S; - MOV32w(x5, i16); + u64 = (uint16_t)(int16_t)F8S; + MOV32w(x5, u64); emit_sub16(dyn, ninst, x1, x5, x2, x4, x6); EWBACK; break; @@ -324,13 +557,13 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { INST_NAME("XOR Ew, Ib"); } - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEW(x1, (opcode == 0x81) ? 2 : 1); if (opcode == 0x81) - i16 = F16S; + u64 = F16; else - i16 = F8S; - MOV32w(x5, i16); + u64 = (uint16_t)(int16_t)F8S; + MOV32w(x5, u64); emit_xor16(dyn, ninst, x1, x5, x2, x4, x6); EWBACK; break; @@ -340,14 +573,14 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { INST_NAME("CMP Ew, Ib"); } - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEW(x1, (opcode == 0x81) ? 2 : 1); if (opcode == 0x81) - i16 = F16S; + u64 = F16; else - i16 = F8S; - if (i16) { - MOV64x(x2, i16); + u64 = (uint16_t)(int16_t)F8S; + if (u64) { + MOV64x(x2, u64); emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6); } else emit_cmp16_0(dyn, ninst, x1, x3, x4); @@ -358,21 +591,70 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x85: INST_NAME("TEST Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - GETEW(x1, 0); - GETGW(x2); - emit_test16(dyn, ninst, x1, x2, x3, x4, x5); + GETGWEW(x1, x2, 0); + emit_test16(dyn, ninst, ed, gd, x3, x4, x5); + break; + case 0x87: + INST_NAME("(LOCK) XCHG Ew, Gw"); + nextop = F8; + if (MODREG) { + GETGD; + GETED(0); + MV(x1, gd); + BSTRINS_D(gd, ed, 15, 0); + BSTRINS_D(ed, x1, 15, 0); + } else { + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + ANDI(x3, wback, 1); + BEQ_MARK(x3, xZR); + SMDMB(); + LD_HU(x1, wback, 0); + ST_H(gd, wback, 0); + SMDMB(); + BSTRINS_D(gd, x1, 15, 0); + B_NEXT_nocond; + MARK; + if (cpuext.lam_bh) { + AMSWAP_DB_H(x1, gd, wback); + } else if (cpuext.lamcas) { + LD_H(x1, wback, 0); + MARKLOCK; + MV(x6, x1); + AMCAS_DB_H(x1, gd, wback); + BNE_MARKLOCK(x1, x6); + } else { + MV(x6, wback); + BSTRINS_D(x6, xZR, 1, 0); + ANDI(x3, wback, 0b10); + BEQZ(x3, 4 + 4 * 6); + // hi16 + LL_W(x5, x6, 0); + BSTRPICK_D(x1, x5, 31, 16); + BSTRINS_D(x5, gd, 31, 16); + SC_W(x5, x6, 0); + BEQZ(x5, -4 * 4); + B(4 + 4 * 5); + // lo16 + LL_W(x5, x6, 0); + BSTRPICK_D(x1, x5, 15, 0); + BSTRINS_D(x5, gd, 15, 0); + SC_W(x5, x6, 0); + BEQZ(x5, -4 * 4); + } + BSTRINS_D(gd, x1, 15, 0); + } break; case 0x89: INST_NAME("MOV Ew, Gw"); nextop = F8; GETGD; + SCRATCH_USAGE(0); if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - if (ed != gd) { - BSTRINS_D(ed, gd, 15, 0); - } + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + if (ed != gd) BSTRINSz(ed, gd, 15, 0); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); ST_H(gd, ed, fixedaddress); @@ -384,15 +666,87 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni nextop = F8; GETGD; if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - if (ed != gd) { - BSTRINS_D(gd, ed, 15, 0); - } + SCRATCH_USAGE(0); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + if (ed != gd) BSTRINSz(gd, ed, 15, 0); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); SMREADLOCK(lock); LD_HU(x1, ed, fixedaddress); - BSTRINS_D(gd, x1, 15, 0); + BSTRINSz(gd, x1, 15, 0); + } + break; + case 0x8C: + INST_NAME("MOV Ew, Seg"); + nextop = F8; + LD_HU(x3, xEmu, offsetof(x64emu_t, segs[(nextop & 0x38) >> 3])); + if (MODREG) { + BSTRINSz(TO_NAT((nextop & 7) + (rex.b << 3)), x3, 15, 0); + } else { // mem <= seg + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + ST_H(x3, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0x8D: + INST_NAME("LEA Gd, Ed"); + nextop = F8; + GETGD; + if (MODREG) { + INST_NAME("Invalid 8D"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { // mem <= reg + rex.seg = 0; + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 0, 0); + BSTRINS_D(gd, ed, 15, 0); + } + break; + case 0x8E: + nextop = F8; + u8 = (nextop & 0x38) >> 3; + if ((u8 > 5) || (u8 == 1)) { + INST_NAME("Invalid MOV Seg, Ew"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("MOV Seg, Ew"); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LD_HU(x1, wback, fixedaddress); + ed = x1; + } + ST_H(ed, xEmu, offsetof(x64emu_t, segs[u8])); + if ((u8 == _FS) || (u8 == _GS)) { + // refresh offset if needed + CBZ_NEXT(ed); + MOV32w(x1, u8); + CALL(const_getsegmentbase, -1, x1, x2); + } + } + break; + case 0x8F: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("POP Ew"); + POP1_16(x1); + if (MODREG) { + wback = TO_NAT((nextop & 7) + (rex.b << 3)); + BSTRINS_D(wback, x1, 15, 0); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + ST_H(x1, wback, fixedaddress); + } + break; + default: + DEFAULT; } break; case 0x90: @@ -403,50 +757,96 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x95: case 0x96: case 0x97: - gd = TO_LA64((opcode & 0x07) + (rex.b << 3)); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); if (gd == xRAX) { INST_NAME("NOP"); } else { INST_NAME("XCHG AX, Reg"); MV(x2, xRAX); - BSTRINS_D(xRAX, gd, 15, 0); - BSTRINS_D(gd, x2, 15, 0); + BSTRINSz(xRAX, gd, 15, 0); + BSTRINSz(gd, x2, 15, 0); } break; - - case 0xA4: - if (rep) { - INST_NAME("REP MOVSB"); - CBZ_NEXT(xRCX); - ANDI(x1, xFlags, 1 << F_DF); - BNEZ_MARK2(x1); - MARK; // Part with DF==0 - LD_BU(x1, xRSI, 0); - ST_B(x1, xRDI, 0); - ADDI_D(xRSI, xRSI, 1); - ADDI_D(xRDI, xRDI, 1); - ADDI_D(xRCX, xRCX, -1); - BNEZ_MARK(xRCX); - B_NEXT_nocond; - MARK2; // Part with DF==1 - LD_BU(x1, xRSI, 0); - ST_B(x1, xRDI, 0); - ADDI_D(xRSI, xRSI, -1); - ADDI_D(xRDI, xRDI, -1); - ADDI_D(xRCX, xRCX, -1); - BNEZ_MARK2(xRCX); - // done - } else { - INST_NAME("MOVSB"); - GETDIR(x3, x1, 1); - LD_BU(x1, xRSI, 0); - ST_B(x1, xRDI, 0); - ADD_D(xRSI, xRSI, x3); - ADD_D(xRDI, xRDI, x3); + case 0x98: + INST_NAME("CBW"); + EXT_W_B(x1, xRAX); + BSTRINSz(xRAX, x1, 15, 0); + break; + case 0x99: + INST_NAME("CWD"); + EXT_W_H(x1, xRAX); + SRLI_D(x1, x1, 48); + BSTRINS_D(xRDX, x1, 15, 0); + break; + case 0x9C: + INST_NAME("PUSHF"); + READFLAGS(X_ALL); + RESTORE_EFLAGS(x1); + PUSH1_16(xFlags); + SMWRITE(); + break; + case 0x9D: + INST_NAME("POPF"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + SMREAD(); + POP1_16(x1); + MOV32w(x2, 0x7FD7); + AND(x1, x1, x2); + ORI(x1, x1, 0x202); + // no need to restore eflags here + BSTRINS_D(xFlags, x1, 15, 0); + SPILL_EFLAGS(); + SET_DFNONE(); + if (box64_wine) { // should this be done all the time? + ANDI(x1, xFlags, 1 << F_TF); + CBZ_NEXT(x1); + // go to epilog, TF should trigger at end of next opcode, so using Interpreter only + LD_W(x4, xEmu, offsetof(x64emu_t, flags)); + ORI(x4, x4, 1< 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + CBZ_NEXT(xRCX); + ANDI(x1, xFlags, 1 << F_DF); + BNEZ_MARK2(x1); + MARK; // DF==0 + LD_HU(x1, xRSI, 0); + LD_HU(x2, xRDI, 0); + ADDI_D(xRSI, xRSI, 2); + ADDI_D(xRDI, xRDI, 2); + ADDI_D(xRCX, xRCX, -1); + if (rex.rep == 1) { + BEQ_MARK3(x1, x2); // REPNZ + } else { + BNE_MARK3(x1, x2); // REPZ + } + BNEZ_MARK(xRCX); + B_MARK3_nocond; + MARK2; // DF=1 + LD_HU(x1, xRSI, 0); + LD_HU(x2, xRDI, 0); + ADDI_D(xRSI, xRSI, -2); + ADDI_D(xRDI, xRDI, -2); + ADDI_D(xRCX, xRCX, -1); + if (rex.rep == 1) { + BEQ_MARK3(x1, x2); // REPNZ + } else { + BNE_MARK3(x1, x2); // REPZ + } + BNEZ_MARK2(xRCX); + MARK3; // end + emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6); + break; + default: + INST_NAME("CMPSW"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + GETDIR(x3, x1, 2); + LD_HU(x1, xRSI, 0); + LD_HU(x2, xRDI, 0); + ADD_D(xRSI, xRSI, x3); + ADD_D(xRDI, xRDI, x3); + emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6); + break; + } break; case 0xA9: INST_NAME("TEST AX,Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u16 = F16; MOV32w(x2, u16); BSTRPICK_D(x1, xRAX, 15, 0); emit_test16(dyn, ninst, x1, x2, x3, x4, x5); break; case 0xAB: - if (rep) { + if (rex.rep) { INST_NAME("REP STOSW"); CBZ_NEXT(xRCX); ANDI(x1, xFlags, 1 << F_DF); @@ -508,6 +966,80 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni ST_H(xRAX, xRDI, 0); ADD_D(xRDI, xRDI, x3); } + SMWRITE(); + break; + case 0xAD: + if (rex.rep) { + DEFAULT; + } else { + INST_NAME("LODSW"); + GETDIR(x1, x2, 2); + LD_HU(x2, xRSI, 0); + ADD_D(xRSI, xRSI, x1); + BSTRINSz(xRAX, x2, 15, 0); + } + break; + case 0xAF: + switch (rex.rep) { + case 1: + case 2: + if (rex.rep == 1) { + INST_NAME("REPNZ SCASW"); + } else { + INST_NAME("REPZ SCASW"); + } + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + CBZ_NEXT(xRCX); + GETDIR(x3, x1, rex.w ? 8 : 2); + if (rex.w) { + MARK; + LD_D(x2, xRDI, 0); + ADD_D(xRDI, xRDI, x3); + ADDI_D(xRCX, xRCX, -1); + if (rex.rep == 1) { + BEQ_MARK3(xRAX, x2); + } else { + BNE_MARK3(xRAX, x2); + } + BNE_MARK(xRCX, xZR); + MARK3; + emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5, x6); + } else { + BSTRPICK_D(x1, xRAX, 15, 0); + MARK; + LD_HU(x2, xRDI, 0); + ADD_D(xRDI, xRDI, x3); + ADDI_D(xRCX, xRCX, -1); + if (rex.rep == 1) { + BEQ_MARK3(x1, x2); + } else { + BNE_MARK3(x1, x2); + } + BNE_MARK(xRCX, xZR); + MARK3; + emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6); + } + break; + default: + INST_NAME("SCASW"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETDIR(x3, x1, rex.w ? 8 : 2); + if (rex.w) { + LD_D(x2, xRDI, 0); + ADD_D(xRDI, xRDI, x3); + emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5, x6); + } else { + BSTRPICK_D(x1, xRAX, 15, 0); + LD_HU(x2, xRDI, 0); + ADD_D(xRDI, xRDI, x3); + emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6); + } + break; + } break; case 0xB8: case 0xB9: @@ -520,90 +1052,116 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOV Reg16, Iw"); u16 = F16; MOV32w(x1, u16); - gd = TO_LA64((opcode & 7) + (rex.b << 3)); - BSTRINS_D(gd, x1, 15, 0); + gd = TO_NAT((opcode & 7) + (rex.b << 3)); + BSTRINSz(gd, x1, 15, 0); break; case 0xC1: nextop = F8; switch ((nextop >> 3) & 7) { case 0: INST_NAME("ROL Ew, Ib"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - SETFLAGS(X_OF | X_CF, SF_SET_DF); - GETEW(x1, 1); - u8 = F8; - MOV32w(x2, u8); - CALL_(rol16, x1, x3); - EWBACK; + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEW(x1, 1); + u8 = (F8) & 0x1f; + emit_rol16c(dyn, ninst, x1, u8, x4, x5, x6); + EWBACK; + } else { + FAKEED; + F8; + } break; case 1: INST_NAME("ROR Ew, Ib"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - SETFLAGS(X_OF | X_CF, SF_SET_DF); - GETEW(x1, 1); - u8 = F8; - MOV32w(x2, u8); - CALL_(ror16, x1, x3); - EWBACK; + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEW(x1, 1); + u8 = (F8) & 0x1f; + emit_ror16c(dyn, ninst, x1, u8, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } + break; + case 2: + INST_NAME("RCL Ew, Ib"); + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { + READFLAGS(X_CF); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEW(x1, 1); + u8 = (F8) & 0x1f; + emit_rcl16c(dyn, ninst, ed, u8, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } + break; + case 3: + INST_NAME("RCR Ew, Ib"); + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { + READFLAGS(X_CF); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEW(x1, 1); + u8 = (F8) & 0x1f; + emit_rcr16c(dyn, ninst, ed, u8, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } break; case 4: case 6: INST_NAME("SHL Ew, Ib"); - UFLAG_IF { MESSAGE(LOG_DUMP, "Need Optimization for flags\n"); } - SETFLAGS(X_ALL, SF_PENDING); - GETEW(x1, 1); - u8 = F8; - UFLAG_IF { MOV32w(x2, (u8 & 15)); } - UFLAG_OP12(ed, x2) - if (MODREG) { - SLLI_D(ed, ed, 48 + (u8 & 15)); - SRLI_D(ed, ed, 48); + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + GETEW(x1, 0); + u8 = (F8) & 0x1f; + emit_shl16c(dyn, ninst, x1, u8, x5, x4, x6); + EWBACK; } else { - SLLI_D(ed, ed, u8 & 15); + FAKEED; + F8; } - EWBACK; - UFLAG_RES(ed); - UFLAG_DF(x3, d_shl16); break; case 5: INST_NAME("SHR Ew, Ib"); - UFLAG_IF { MESSAGE(LOG_DUMP, "Need Optimization for flags\n"); } - SETFLAGS(X_ALL, SF_PENDING); - GETEW(x1, 1); - u8 = F8; - UFLAG_IF { MOV32w(x2, (u8 & 15)); } - UFLAG_OP12(ed, x2) - SRLI_D(ed, ed, u8 & 15); - EWBACK; - UFLAG_RES(ed); - UFLAG_DF(x3, d_shr16); + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + GETEW(x1, 0); + u8 = (F8) & 0x1f; + emit_shr16c(dyn, ninst, x1, u8, x5, x4, x6); + EWBACK; + } else { + FAKEED; + F8; + } break; case 7: INST_NAME("SAR Ew, Ib"); - SETFLAGS(X_ALL, SF_PENDING); - UFLAG_IF { MESSAGE(LOG_DUMP, "Need Optimization for flags\n"); } - GETSEW(x1, 1); - u8 = F8; - UFLAG_IF { MOV32w(x2, (u8 & 15)); } - UFLAG_OP12(ed, x2) - SRAI_D(ed, ed, u8 & 15); - if (MODREG) BSTRPICK_D(ed, ed, 15, 0); - EWBACK; - UFLAG_RES(ed); - UFLAG_DF(x3, d_sar16); + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + GETSEW(x1, 0); + u8 = (F8) & 0x1f; + emit_sar16c(dyn, ninst, x1, u8, x5, x4, x6); + EWBACK; + } else { + FAKEED; + F8; + } break; - default: - DEFAULT; } break; case 0xC7: INST_NAME("MOV Ew, Iw"); nextop = F8; if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); u16 = F16; MOV32w(x1, u16); - BSTRINS_D(ed, x1, 15, 0); + BSTRINSz(ed, x1, 15, 0); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 2); u16 = F16; @@ -613,101 +1171,320 @@ uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } break; case 0xD1: - case 0xD3: nextop = F8; switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("ROL Ew, 1"); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEW(x1, 0); + emit_rol16c(dyn, ninst, x1, 1, x5, x4, x6); + EWBACK; + break; + case 1: + INST_NAME("ROR Ew, 1"); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEW(x1, 1); + emit_ror16c(dyn, ninst, x1, 1, x5, x4); + EWBACK; + break; + case 2: + INST_NAME("RCL Ew, 1"); + READFLAGS(X_CF); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEW(x1, 0); + emit_rcl16c(dyn, ninst, x1, 1, x5, x4); + EWBACK; + break; + case 3: + INST_NAME("RCR Ew, 1"); + READFLAGS(X_CF); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); // removed PENDING on purpose + GETEW(x1, 0); + emit_rcr16c(dyn, ninst, x1, 1, x5, x4); + EWBACK; + break; case 5: - if (opcode == 0xD1) { - INST_NAME("SHR Ew, 1"); - MOV32w(x2, 1); + INST_NAME("SHR Ew, 1"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + GETEW(x1, 0); + emit_shr16c(dyn, ninst, x1, 1, x5, x4, x6); + EWBACK; + break; + case 4: + case 6: + INST_NAME("SHL Ew, 1"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + GETEW(x1, 0); + emit_shl16c(dyn, ninst, x1, 1, x5, x4, x6); + EWBACK; + break; + case 7: + INST_NAME("SAR Ew, 1"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + GETSEW(x1, 0); + emit_sar16c(dyn, ninst, x1, 1, x5, x4, x6); + EWBACK; + break; + } + break; + + case 0xD3: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("ROL Ew, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_OF | X_CF); + } + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + ANDI(x2, xRCX, 0x1f); + CBZ_NEXT(x2); + GETEW(x1, 0); + emit_rol16(dyn, ninst, x1, x2, x5, x4); + EWBACK; + break; + case 1: + INST_NAME("ROR Ew, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_OF | X_CF); + } + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + ANDI(x2, xRCX, 0x1f); + CBZ_NEXT(x2); + GETEW(x1, 0); + emit_ror16(dyn, ninst, x1, x2, x5, x4); + EWBACK; + break; + case 2: + INST_NAME("RCL Ew, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_OF | X_CF); + } else { + READFLAGS(X_CF); + } + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + ANDI(x2, xRCX, 0x1f); + CBZ_NEXT(x2); + GETEW(x1, 0); + emit_rcl16(dyn, ninst, x1, x2, x5, x4, x6); + EWBACK; + break; + case 3: + INST_NAME("RCR Ew, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_OF | X_CF); } else { - INST_NAME("SHR Ew, CL"); - ANDI(x2, xRCX, 0x1f); - BEQ_NEXT(x2, xZR); + READFLAGS(X_CF); } - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if (box64_dynarec_safeflags > 1) MAYSETFLAGS(); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + ANDI(x2, xRCX, 0x1f); + CBZ_NEXT(x2); + GETEW(x1, 0); + emit_rcr16(dyn, ninst, x1, x2, x5, x4, x6); + EWBACK; + break; + case 5: + INST_NAME("SHR Ew, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + ANDI(x2, xRCX, 0x1f); + CBZ_NEXT(x2); GETEW(x1, 0); emit_shr16(dyn, ninst, x1, x2, x5, x4, x6); EWBACK; break; case 4: case 6: - if (opcode == 0xD1) { - INST_NAME("SHL Ew, 1"); - MOV32w(x2, 1); - } else { - INST_NAME("SHL Ew, CL"); - ANDI(x2, xRCX, 0x1f); - BEQ_NEXT(x2, xZR); - } - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if (box64_dynarec_safeflags > 1) - MAYSETFLAGS(); + INST_NAME("SHL Ew, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + ANDI(x2, xRCX, 0x1f); + CBZ_NEXT(x2); GETEW(x1, 0); emit_shl16(dyn, ninst, x1, x2, x5, x4, x6); EWBACK; break; case 7: - if (opcode == 0xD1) { - INST_NAME("SAR Ew, 1"); - MOV32w(x2, 1); - } else { - INST_NAME("SAR Ew, CL"); - ANDI(x2, xRCX, 0x1f); - BEQ_NEXT(x2, xZR); - } - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if (box64_dynarec_safeflags > 1) - MAYSETFLAGS(); + INST_NAME("SAR Ew, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + ANDI(x2, xRCX, 0x1f); + CBZ_NEXT(x2); GETSEW(x1, 0); emit_sar16(dyn, ninst, x1, x2, x5, x4, x6); EWBACK; break; - default: - DEFAULT; } break; + case 0xD9: + nextop = F8; + if (MODREG) { + DEFAULT; + } else + switch ((nextop >> 3) & 7) { + case 6: + INST_NAME("FNSTENV Ed"); + MESSAGE(LOG_DUMP, "Need Optimization (FNSTENV16)\n"); + BARRIER(BARRIER_FLOAT); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + if (ed != x1) { MV(x1, ed); } + MOV32w(x2, 1); + CALL(const_fpu_savenv, -1, x1, x2); + break; + default: + DEFAULT; + } + break; + case 0xE4: /* IN AL, Ib */ + case 0xE5: /* IN AX, Ib */ + case 0xE6: /* OUT Ib, AL */ + case 0xE7: /* OUT Ib, AX */ + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); + case 0xEC: /* IN AL, DX */ + case 0xED: /* IN AX, DX */ + case 0xEE: /* OUT DX, AL */ + case 0xEF: /* OUT DX, AX */ + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); + case 0xF7: nextop = F8; switch ((nextop >> 3) & 7) { case 0: case 1: INST_NAME("TEST Ew, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEW(x1, 2); u16 = F16; MOV32w(x2, u16); emit_test16(dyn, ninst, x1, x2, x3, x4, x5); break; + case 2: + INST_NAME("NOT Ew"); + GETEW(x1, 0); + MOV32w(x5, 0xffff); + XOR(ed, ed, x5); // No flags affected + EWBACK; + break; case 3: INST_NAME("NEG Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEW(x1, 0); emit_neg16(dyn, ninst, ed, x2, x4); EWBACK; break; + case 4: + INST_NAME("MUL AX, Ew"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETEW(x1, 0); + BSTRPICK_D(x2, xRAX, 15, 0); + MUL_W(x1, x2, x1); + ZEROUP(x1); + BSTRINSz(xRAX, x1, 15, 0); + SRLI_D(x3, x1, 16); + BSTRINS_D(xRDX, x3, 15, 0); + SET_DFNONE(); + CLEAR_FLAGS(x3); + IFX (X_CF | X_OF) { + SRLI_W(x3, x1, 16); + SNEZ(x3, x3); + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); + } + IFX (X_SF) { + SRLI_D(x3, xRAX, 15); + BSTRINS_D(xFlags, x3, F_SF, F_SF); + } + IFX (X_PF) emit_pf(dyn, ninst, xRAX, x3, x5); + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + break; + case 6: + INST_NAME("DIV Ew"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + GETEW(x1, 0); + BSTRPICK_D(x2, xRAX, 15, 0); + BSTRINS_W(x2, xRDX, 31, 16); + if (BOX64ENV(dynarec_div0)) { + BNE_MARK3(ed, xZR); + GETIP_(ip, x6); + STORE_XEMU_CALL(); + CALL(const_native_div0, -1, 0, 0); + CLEARIP(); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + MARK3; + } + DIV_WU(x7, x2, ed); // warning: x2 and ed must be signed extended! + MOD_WU(x4, x2, ed); // warning: x2 and ed must be signed extended! + BSTRINSz(xRAX, x7, 15, 0); + BSTRINSz(xRDX, x4, 15, 0); + SET_DFNONE(); + CLEAR_FLAGS(x5); + ADDI_D(x5, xZR, ((1 << F_ZF) | (1 << F_PF))); + OR(xFlags, xFlags, x5); + SPILL_EFLAGS(); + break; + case 7: + INST_NAME("IDIV Ew"); + NOTEST(x1); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + GETSEW(x1, 0); + if (BOX64ENV(dynarec_div0)) { + BNE_MARK3(ed, xZR); + GETIP_(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_div0, -1, 0, 0); + CLEARIP(); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + MARK3; + } + BSTRPICK_D(x2, xRAX, 15, 0); + BSTRINS_W(x2, xRDX, 31, 16); + DIV_W(x3, x2, ed); // warning: x2 and ed must be signed extended! + MOD_W(x4, x2, ed); // warning: x2 and ed must be signed extended! + BSTRINSz(xRAX, x3, 15, 0); + BSTRINSz(xRDX, x4, 15, 0); + break; default: DEFAULT; } break; + case 0xF8: + case 0xF9: + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); case 0xFF: nextop = F8; switch ((nextop >> 3) & 7) { case 0: INST_NAME("INC Ew"); - SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); GETEW(x1, 0); emit_inc16(dyn, ninst, x1, x2, x4, x5); EWBACK; break; case 1: INST_NAME("DEC Ew"); - SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); GETEW(x1, 0); emit_dec16(dyn, ninst, x1, x2, x4, x5, x6); EWBACK; break; + case 6: // Push Ew + INST_NAME("PUSH Ew"); + GETEW(x1, 0); + PUSH1_16(ed); + break; default: DEFAULT; } diff --git a/src/dynarec/la64/dynarec_la64_660f.c b/src/dynarec/la64/dynarec_la64_660f.c index 9200461..15eea92 100644 --- a/src/dynarec/la64/dynarec_la64_660f.c +++ b/src/dynarec/la64/dynarec_la64_660f.c @@ -5,11 +5,10 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "la64_emitter.h" -#include "x64run.h" +#include "la64_mapping.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -21,7 +20,8 @@ #include "la64_printer.h" #include "dynarec_la64_private.h" #include "dynarec_la64_functions.h" -#include "dynarec_la64_helper.h" +#include "../dynarec_helper.h" +#include "emu/x64compstrings.h" uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { @@ -34,10 +34,11 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int uint8_t gd, ed; uint8_t wback, wb1, wb2, gback; uint8_t eb1, eb2; + uint8_t tmp1, tmp2, tmp3; int64_t j64; uint64_t tmp64u, tmp64u2; - int v0, v1; - int q0, q1; + int v0, v1, v2; + int q0, q1, q2; int d0, d1, d2; int64_t fixedaddress, gdoffset; int unscaled; @@ -49,8 +50,31 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int MAYUSE(eb1); MAYUSE(eb2); MAYUSE(j64); +#if STEP > 1 + static const int8_t round_round[] = { + 0x3, // round to nearest with ties to even + 0x0, // round toward minus infinity + 0x1, // round toward plus infinity + 0x2 // round toward zero + }; +#endif + switch (opcode) { + case 0x10: + INST_NAME("MOVUPD Gx, Ex"); + nextop = F8; + GETG; + v0 = sse_get_reg_empty(dyn, ninst, x1, gd); + if (MODREG) { + v1 = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0); + VOR_V(v0, v1, v1); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + VLD(v0, ed, fixedaddress); + } + break; case 0x11: INST_NAME("MOVUPD Ex,Gx"); nextop = F8; @@ -79,6 +103,18 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int FLD_D(v1, wback, fixedaddress); VEXTRINS_D(v0, v1, 0); break; + case 0x13: + INST_NAME("MOVLPD Eq, Gx"); + nextop = F8; + GETGX(v0, 0); + if (MODREG) { + DEFAULT; + return addr; + } + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + FST_D(v0, ed, fixedaddress); + SMWRITE2(); + break; case 0x14: INST_NAME("UNPCKLPD Gx, Ex"); nextop = F8; @@ -93,6 +129,56 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int } VEXTRINS_D(v0, v1, 0x10); break; + case 0x15: + INST_NAME("UNPCKHPD Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + if (MODREG) { + v1 = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0); + VSHUF4I_D(v0, v1, 0b1101); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + v1 = fpu_get_scratch(dyn); + ADDI_D(x1, ed, 8); + FLD_D(v1, x1, fixedaddress); + VSHUF4I_D(v0, v1, 0b1001); + } + break; + case 0x16: + INST_NAME("MOVHPD Gx, Eq"); + nextop = F8; + GETGX(v0, 1); + if (MODREG) { + // access register instead of memory is bad opcode! + DEFAULT; + return addr; + } + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + v1 = fpu_get_scratch(dyn); + FLD_D(v1, ed, fixedaddress); + VEXTRINS_D(v0, v1, 0x10); + break; + case 0x17: + INST_NAME("MOVHPD Eq, Gx"); + nextop = F8; + GETGX(v0, 0); + if (MODREG) { + DEFAULT; + return addr; + } + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VSTELM_D(v0, ed, 0, 1); + SMWRITE2(); + break; + case 0x18: + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: case 0x1F: INST_NAME("NOP (multibyte)"); nextop = F8; @@ -129,6 +215,108 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int SMWRITE2(); } break; + case 0x2A: + INST_NAME("CVTPI2PD Gx,Em"); + nextop = F8; + GETGX(v0, 1); + GETEM(v1, 0); + q0 = fpu_get_scratch(dyn); + VFFINTL_D_W(v0, v1); + break; + case 0x2B: + INST_NAME("MOVNTPD Ex,Gx"); + nextop = F8; + GETG; + v0 = sse_get_reg(dyn, ninst, x1, gd, 0); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_empty(dyn, ninst, x1, ed); + VOR_V(v1, v0, v0); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + VST(v0, ed, fixedaddress); + } + break; + case 0x2C: + INST_NAME("CVTTPD2PI Gm, Ex"); + nextop = F8; + GETGM(v0); + GETEX(v1, 0, 0); + if (BOX64ENV(dynarec_fastround)) { + VFTINTRZ_W_D(v0, v1, v1); + } else { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + VFTINTRZ_W_D(v0, v1, v1); + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + MOV32w(x3, (1 << FR_V) | (1 << FR_O)); + AND(x5, x5, x3); + BEQZ_MARK3(x5); // no fp exception, work done. + + q0 = fpu_get_scratch(dyn); + MOVGR2FCSR(FCSR2, xZR); // reset all bits + FTINTRZ_W_D(v0, v1); + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + AND(x5, x5, x3); + BEQZ_MARK(x5); + MOV32w(x1, 0x80000000); + MOVGR2FR_W(v0, x1); + MARK; + + MOVGR2FCSR(FCSR2, xZR); // reset all bits + VSHUF4I_W(q0, v1, 0b1110); // get v1 high 64bits + FTINTRZ_W_D(q0, q0); + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + AND(x5, x5, x3); + BEQZ_MARK2(x5); + MOV32w(x1, 0x80000000); + MOVGR2FRH_W(v0, x1); + B_MARK3_nocond; + MARK2; + VEXTRINS_W(v0, q0, VEXTRINS_IMM_4_0(1, 0)); + MARK3; + } + break; + case 0x2D: + INST_NAME("CVTPD2PI Gm, Ex"); + nextop = F8; + GETGM(v0); + GETEX(v1, 0, 0); + u8 = sse_setround(dyn, ninst, x4, x6); + if (BOX64ENV(dynarec_fastround)) { + VFTINT_W_D(v0, v1, v1); + } else { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + VFTINT_W_D(v0, v1, v1); + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + MOV32w(x3, (1 << FR_V) | (1 << FR_O)); + AND(x5, x5, x3); + BEQZ_MARK3(x5); // no fp exception, work done. + + q0 = fpu_get_scratch(dyn); + MOVGR2FCSR(FCSR2, xZR); // reset all bits + FTINT_W_D(v0, v1); + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + AND(x5, x5, x3); + BEQZ_MARK(x5); + MOV32w(x1, 0x80000000); + MOVGR2FR_W(v0, x1); + MARK; + + MOVGR2FCSR(FCSR2, xZR); // reset all bits + VSHUF4I_W(q0, v1, 0b1110); // get v1 high 64bits + FTINT_W_D(q0, q0); + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + AND(x5, x5, x3); + BEQZ_MARK2(x5); + MOV32w(x1, 0x80000000); + MOVGR2FRH_W(v0, x1); + B_MARK3_nocond; + MARK2; + VEXTRINS_W(v0, q0, VEXTRINS_IMM_4_0(1, 0)); + MARK3; + } + x87_restoreround(dyn, ninst, u8); + break; case 0x2E: // no special check... case 0x2F: @@ -137,7 +325,7 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int } else { INST_NAME("UCOMISD Gx, Ex"); } - SETFLAGS(X_ALL, SF_SET); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); SET_DFNONE(); nextop = F8; GETGX(d0, 0); @@ -219,19 +407,15 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int VSADD_H(q0, v0, v1); break; case 0x04: - INST_NAME("PMADDUBSW Gx,Ex"); + INST_NAME("PMADDUBSW Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); v0 = fpu_get_scratch(dyn); v1 = fpu_get_scratch(dyn); - VEXT2XV_HU_BU(v0, q0); - VEXT2XV_H_B(v1, q1); - XVMUL_H(v0, v0, v1); - XVPERMI_Q(v1, v0, 1); // v1[127:0] = v0[255:128]; - VPICKEV_H(q0, v1, v0); - VPICKOD_H(v0, v1, v0); - VSADD_H(q0, v0, q0); + VMULWEV_H_BU_B(v0, q0, q1); + VMULWOD_H_BU_B(v1, q0, q1); + VSADD_H(q0, v0, v1); break; case 0x05: INST_NAME("PHSUBW Gx, Ex"); @@ -253,7 +437,7 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int v1 = fpu_get_scratch(dyn); VPICKEV_W(v0, q1, q0); VPICKOD_W(v1, q1, q0); - VSUB_D(q0, v0, v1); + VSUB_W(q0, v0, v1); break; case 0x07: INST_NAME("PHSUBSW Gx, Ex"); @@ -287,168 +471,1114 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int GETEX(q1, 0, 0); VSIGNCOV_W(q0, q1, q0); break; - default: - DEFAULT; - } - break; - case 0x3A: // these are some more SSSE3+ opcodes - opcode = F8; - switch (opcode) { - case 0x0F: - INST_NAME("PALIGNR Gx, Ex, Ib"); + case 0x0B: + INST_NAME("PMULHRSW Gx, Ex"); nextop = F8; GETGX(q0, 1); - GETEX(q1, 0, 1); - u8 = F8; - if (u8 > 31) { - VXOR_V(q0, q0, q0); - } else if (u8 > 15) { - VBSRL_V(q0, q0, u8 - 16); - } else if (!u8) { - VOR_V(q0, q1, q1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + if (cpuext.lasx) { + VEXT2XV_W_H(v0, q0); + VEXT2XV_W_H(v1, q1); + XVMUL_W(v0, v0, v1); + XVSRLI_W(v0, v0, 14); + XVADDI_WU(v0, v0, 1); + XVSRLNI_H_W(v0, v0, 1); + XVPERMI_D(q0, v0, 0b1000); } else { - d0 = fpu_get_scratch(dyn); - VBSLL_V(q0, q0, 16 - u8); - VBSRL_V(d0, q1, u8); - VOR_V(q0, q0, d0); + VMULWEV_W_H(v0, q0, q1); + VMULWOD_W_H(v1, q0, q1); + VSRLI_W(v0, v0, 14); + VSRLI_W(v1, v1, 14); + VADDI_WU(v0, v0, 1); + VADDI_WU(v1, v1, 1); + VSRLNI_H_W(v1, v0, 1); + VSHUF4I_W(v1, v1, 0b11011000); + VSHUF4I_H(q0, v1, 0b11011000); } break; - case 0x44: - INST_NAME("PCLMULQDQ Gx, Ex, Ib"); + case 0x10: + INST_NAME("PBLENDVB Gx, Ex"); nextop = F8; - GETG; - sse_forget_reg(dyn, ninst, gd); - MOV32w(x1, gd); // gx - if (MODREG) { - ed = (nextop & 7) + (rex.b << 3); - sse_forget_reg(dyn, ninst, ed); - MOV32w(x2, ed); - MOV32w(x3, 0); // p = NULL - } else { - MOV32w(x2, 0); - addr = geted(dyn, addr, ninst, nextop, &ed, x3, x5, &fixedaddress, rex, NULL, 0, 1); - if (ed != x3) { - MV(x3, ed); + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = sse_get_reg(dyn, ninst, x1, 0, 0); // XMM0 + v1 = fpu_get_scratch(dyn); + if (q0 != q1) { + VSLTI_B(v1, v0, 0); // bit[7]==1 -> fill with 0xff + VBITSEL_V(q0, q0, q1, v1); + } + break; + case 0x14: + INST_NAME("BLENDVPS Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = sse_get_reg(dyn, ninst, x1, 0, 0); // XMM0 + v1 = fpu_get_scratch(dyn); + if (q0 != q1) { + VSLTI_W(v1, v0, 0); + VBITSEL_V(q0, q0, q1, v1); + } + break; + case 0x15: + INST_NAME("BLENDVPD Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = sse_get_reg(dyn, ninst, x1, 0, 0); // XMM0 + v1 = fpu_get_scratch(dyn); + if (q0 != q1) { + VSLTI_D(v1, v0, 0); + VBITSEL_V(q0, q0, q1, v1); + } + break; + case 0x17: + INST_NAME("PTEST Gx, Ex"); + nextop = F8; + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETGX(q0, 0); + GETEX(q1, 0, 0); + if (!cpuext.lbt) { + CLEAR_FLAGS(x3); + } else IFX (X_ALL) { + X64_SET_EFLAGS(xZR, X_ALL); + } + SET_DFNONE(); + v0 = fpu_get_scratch(dyn); + IFX (X_ZF) { + VAND_V(v0, q1, q0); + VSETEQZ_V(fcc0, v0); + BCEQZ_MARK(fcc0); + if (cpuext.lbt) { + ADDI_D(x3, xZR, 1 << F_ZF); + X64_SET_EFLAGS(x3, X_ZF); + } else { + ORI(xFlags, xFlags, 1 << F_ZF); } } - u8 = F8; - MOV32w(x4, u8); - CALL(native_pclmul, -1); + MARK; + IFX (X_CF) { + VANDN_V(v0, q0, q1); + VSETEQZ_V(fcc0, v0); + BCEQZ_MARK2(fcc0); + if (cpuext.lbt) { + ADDI_D(x3, xZR, 1 << F_CF); + X64_SET_EFLAGS(x3, X_CF); + } else { + ORI(xFlags, xFlags, 1 << F_CF); + } + } + MARK2; break; - case 0xDF: - INST_NAME("AESKEYGENASSIST Gx, Ex, Ib"); // AES-NI + case 0x1C: + INST_NAME("PABSB Gx, Ex"); + nextop = F8; + GETEX(q1, 0, 0); + GETGX_empty(q0); + v0 = fpu_get_scratch(dyn); + VXOR_V(v0, v0, v0); + VABSD_B(q0, q1, v0); + break; + case 0x1D: + INST_NAME("PABSW Gx, Ex"); + nextop = F8; + GETEX(q1, 0, 0); + GETGX_empty(q0); + v0 = fpu_get_scratch(dyn); + VXOR_V(v0, v0, v0); + VABSD_H(q0, q1, v0); + break; + case 0x1E: + INST_NAME("PABSD Gx, Ex"); + nextop = F8; + GETEX(q1, 0, 0); + GETGX_empty(q0); + VSIGNCOV_W(q0, q1, q1); + break; + case 0x20: + INST_NAME("PMOVSXBW Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX64(q1, 0, 0); + GETGX_empty(q0); + VSLLWIL_H_B(q0, q1, 0); + break; + case 0x21: + INST_NAME("PMOVSXBD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX32(q1, 0, 0); + GETGX_empty(q0); + VSLLWIL_H_B(q0, q1, 0); + VSLLWIL_W_H(q0, q0, 0); + break; + case 0x22: + INST_NAME("PMOVSXBQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX16(q1, 0, 0); + GETGX_empty(q0); + VSLLWIL_H_B(q0, q1, 0); + VSLLWIL_W_H(q0, q0, 0); + VSLLWIL_D_W(q0, q0, 0); + break; + case 0x23: + INST_NAME("PMOVSXWD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX64(q1, 0, 0); + GETGX_empty(q0); + VSLLWIL_W_H(q0, q1, 0); + break; + case 0x24: + INST_NAME("PMOVSXWQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX32(q1, 0, 0); + GETGX_empty(q0); + VSLLWIL_W_H(q0, q1, 0); + VSLLWIL_D_W(q0, q0, 0); + break; + case 0x25: + INST_NAME("PMOVSXDQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX64(q1, 0, 0); + GETGX_empty(q0); + VSLLWIL_D_W(q0, q1, 0); + break; + case 0x28: + INST_NAME("PMULDQ Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + VMULWEV_D_W(q0, q0, q1); + break; + case 0x29: + INST_NAME("PCMPEQQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX(q1, 0, 0); + GETGX_empty(q0); + VSEQ_D(q0, q0, q1); + break; + case 0x2A: + INST_NAME("MOVNTDQA Gx, Ex"); nextop = F8; - GETG; - sse_forget_reg(dyn, ninst, gd); - MOV32w(x1, gd); // gx if (MODREG) { - ed = (nextop & 7) + (rex.b << 3); - sse_forget_reg(dyn, ninst, ed); - MOV32w(x2, ed); - MOV32w(x3, 0); // p = NULL + v1 = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0); + GETGX_empty(v0); + VOR_V(v0, v1, v1); } else { - MOV32w(x2, 0); - addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 1); - if (ed != x3) { - MV(x3, ed); - } + GETGX_empty(v0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + VLD(v0, ed, fixedaddress); } - u8 = F8; - MOV32w(x4, u8); - CALL(native_aeskeygenassist, -1); break; - default: - DEFAULT; - } - break; - - #define GO(GETFLAGS, NO, YES, F, I) \ - READFLAGS(F); \ - if (la64_lbt) { \ - X64_SETJ(x1, I); \ - } else { \ - GETFLAGS; \ - } \ - nextop = F8; \ - GETGD; \ - if (MODREG) { \ - ed = TO_LA64((nextop & 7) + (rex.b << 3)); \ - } else { \ - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x4, &fixedaddress, rex, NULL, 1, 0); \ - LD_HU(x4, ed, fixedaddress); \ - ed = x4; \ - } \ - if (la64_lbt) \ - BEQZ(x1, 4 + 4); \ - else \ - B##NO(x1, 4 + 4); \ - BSTRINS_D(gd, ed, 15, 0); - - GOCOND(0x40, "CMOV", "Gd, Ed"); - #undef GO - - case 0x54: - INST_NAME("ANDPD Gx, Ex"); - nextop = F8; - GETEX(q0, 0, 0); - GETGX(v0, 1); - VAND_V(v0, v0, q0); - break; - case 0x55: - INST_NAME("ANDNPD Gx, Ex"); - nextop = F8; - GETEX(q0, 0, 0); - GETGX(v0, 1); - VANDN_V(v0, v0, q0); - break; - case 0x56: - INST_NAME("ORPD Gx, Ex"); - nextop = F8; - GETEX(q0, 0, 0); - GETGX(v0, 1); - VOR_V(v0, v0, q0); - break; - case 0x57: - INST_NAME("XORPD Gx, Ex"); - nextop = F8; - GETG; - if (MODREG && ((nextop & 7) + (rex.b << 3) == gd)) { - // special case for XORPD Gx, Gx - q0 = sse_get_reg_empty(dyn, ninst, x1, gd); - VXOR_V(q0, q0, q0); - } else { - q0 = sse_get_reg(dyn, ninst, x1, gd, 1); - GETEX(q1, 0, 0); - VXOR_V(q0, q0, q1); - } - break; - case 0x58: - INST_NAME("ADDPD Gx, Ex"); - nextop = F8; - GETEX(q0, 0, 0); - GETGX(q1, 1); - // TODO: fastnan handling - VFADD_D(q1, q1, q0); - break; - case 0x5A: - INST_NAME("CVTPD2PS Gx, Ex"); - nextop = F8; - GETEX(v1, 0, 0); - GETGX_empty(v0); - // TODO: !box64_dynarec_fastround - q0 = fpu_get_scratch(dyn); - VFCVT_S_D(q0, v1, v1); - VXOR_V(v0, v0, v0); - VEXTRINS_D(v0, q0, 0); - break; - case 0x5B: + case 0x2B: + INST_NAME("PACKUSDW Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX(q1, 0, 0); + GETGX(q0, 1); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VSLTI_W(v0, q0, 0); + VANDN_V(q0, v0, q0); + VSSRANI_HU_W(q0, q0, 0); + if (q0 == q1) { + VEXTRINS_D(q0, q0, VEXTRINS_IMM_4_0(1, 0)); + } else { + VSLTI_W(v1, q1, 0); + VANDN_V(v1, v1, q1); + VSSRANI_HU_W(v1, v1, 0); + VEXTRINS_D(q0, v1, VEXTRINS_IMM_4_0(1, 0)); + } + break; + case 0x30: + INST_NAME("PMOVZXBW Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX(q1, 0, 0); + GETGX_empty(q0); + if (cpuext.lasx) + VEXT2XV_HU_BU(q0, q1); + else + VSLLWIL_HU_BU(q0, q1, 0); + break; + case 0x31: + INST_NAME("PMOVZXBD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX32(q1, 0, 0); + GETGX_empty(q0); + VSLLWIL_HU_BU(q0, q1, 0); + VSLLWIL_WU_HU(q0, q0, 0); + break; + case 0x32: + INST_NAME("PMOVZXBQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX16(q1, 0, 0); + GETGX_empty(q0); + VSLLWIL_HU_BU(q0, q1, 0); + VSLLWIL_WU_HU(q0, q0, 0); + VSLLWIL_DU_WU(q0, q0, 0); + break; + case 0x33: + INST_NAME("PMOVZXWD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX64(q1, 0, 0); + GETGX_empty(q0); + VSLLWIL_WU_HU(q0, q1, 0); + break; + case 0x34: + INST_NAME("PMOVZXWQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX32(q1, 0, 0); + GETGX_empty(q0); + VSLLWIL_WU_HU(q0, q1, 0); + VSLLWIL_DU_WU(q0, q0, 0); + break; + case 0x35: + INST_NAME("PMOVZXDQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX64(q1, 0, 0); + GETGX_empty(q0); + VSLLWIL_DU_WU(q0, q1, 0); + break; + case 0x37: + INST_NAME("PCMPGTQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + VSLT_D(q0, q1, q0); + break; + case 0x38: + INST_NAME("PMINSB Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX(q1, 0, 0); + GETGX(q0, 1); + VMIN_B(q0, q0, q1); + break; + case 0x39: + INST_NAME("PMINSD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX(q1, 0, 0); + GETGX(q0, 1); + VMIN_W(q0, q0, q1); + break; + case 0x3A: + INST_NAME("PMINUW Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX(q1, 0, 0); + GETGX(q0, 1); + VMIN_HU(q0, q0, q1); + break; + case 0x3B: + INST_NAME("PMINUD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX(q1, 0, 0); + GETGX(q0, 1); + VMIN_WU(q0, q0, q1); + break; + case 0x3C: + INST_NAME("PMAXSB Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX(q1, 0, 0); + GETGX(q0, 1); + VMAX_B(q0, q0, q1); + break; + case 0x3D: + INST_NAME("PMAXSD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX(q1, 0, 0); + GETGX(q0, 1); + VMAX_W(q0, q0, q1); + break; + case 0x3E: + INST_NAME("PMAXUW Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX(q1, 0, 0); + GETGX(q0, 1); + VMAX_HU(q0, q0, q1); + break; + case 0x3F: + INST_NAME("PMAXUD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX(q1, 0, 0); + GETGX(q0, 1); + VMAX_WU(q0, q0, q1); + break; + case 0x40: + INST_NAME("PMULLD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETEX(q1, 0, 0); + GETGX(q0, 1); + VMUL_W(q0, q0, q1); + break; + case 0xDB: + INST_NAME("AESIMC Gx, Ex"); // AES-NI + nextop = F8; + GETEX(q1, 0, 0); + GETGX_empty(q0); + if (q0 != q1) { + VOR_V(q0, q1, q1); + } + sse_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); + CALL(const_native_aesimc, -1, x1, 0); + break; + case 0xDC: + INST_NAME("AESENC Gx, Ex"); // AES-NI + nextop = F8; + GETG; + GETEX(q1, 0, 0); + if (MODREG && (gd == (nextop & 7) + (rex.b << 3))) { + d0 = fpu_get_scratch(dyn); + VOR_V(d0, q1, q1); + } else + d0 = -1; + sse_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); + CALL(const_native_aese, -1, x1, 0); + GETGX(q0, 1); + VXOR_V(q0, q0, (d0 != -1) ? d0 : q1); + break; + case 0xDD: + INST_NAME("AESENCLAST Gx, Ex"); // AES-NI + nextop = F8; + GETG; + GETEX(q1, 0, 0); + if (MODREG && (gd == (nextop & 7) + (rex.b << 3))) { + d0 = fpu_get_scratch(dyn); + VOR_V(d0, q1, q1); + } else + d0 = -1; + sse_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); + CALL(const_native_aeselast, -1, x1, 0); + GETGX(q0, 1); + VXOR_V(q0, q0, (d0 != -1) ? d0 : q1); + break; + case 0xDE: + INST_NAME("AESDEC Gx, Ex"); // AES-NI + nextop = F8; + GETG; + GETEX(q1, 0, 0); + if (MODREG && (gd == (nextop & 7) + (rex.b << 3))) { + d0 = fpu_get_scratch(dyn); + VOR_V(d0, q1, q1); + } else + d0 = -1; + sse_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); + CALL(const_native_aesd, -1, x1, 0); + GETGX(q0, 1); + VXOR_V(q0, q0, (d0 != -1) ? d0 : q1); + break; + case 0xDF: + INST_NAME("AESDECLAST Gx, Ex"); // AES-NI + nextop = F8; + GETG; + GETEX(q1, 0, 0); + if (MODREG && (gd == (nextop & 7) + (rex.b << 3))) { + d0 = fpu_get_scratch(dyn); + VOR_V(d0, q1, q1); + } else + d0 = -1; + sse_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); + CALL(const_native_aesdlast, -1, x1, 0); + GETGX(q0, 1); + VXOR_V(q0, q0, (d0 != -1) ? d0 : q1); + break; + case 0xF0: + INST_NAME("MOVBE Gw, Ew"); + nextop = F8; + GETGD; + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 1, 0); + LD_HU(x1, ed, fixedaddress); + REVB_2H(x1, x1); + BSTRINS_D(gd, x1, 15, 0); + break; + case 0xF1: + INST_NAME("MOVBE Ew, Gw"); + nextop = F8; + GETGD; + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 1, 0); + REVB_2H(x1, gd); + ST_H(x1, wback, fixedaddress); + SMWRITE(); + break; + case 0xF6: + INST_NAME("ADCX Gd, Ed"); + nextop = F8; + READFLAGS(X_CF); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + GETED(0); + GETGD; + if(cpuext.lbt) { + X64_GET_EFLAGS(x3, X_CF); // CF pos is 0, no need SLLI + } else { + BSTRPICK_D(x3, xFlags, F_CF, F_CF); + } + IFX(X_CF) { + if(rex.w) { + ADD_D(x4, gd, ed); + SLTU(x5, x4, gd); + ADD_D(gd, x4, x3); + SLTU(x6, gd, x4); + } else { + ADD_W(x4, gd, ed); + ZEROUP(x4); + ZEROUP(gd); + SLTU(x5, x4, gd); + ADD_W(gd, x4, x3); + ZEROUP(gd); + SLTU(x6, gd, x4); + } + OR(x5, x5, x6); + if(cpuext.lbt) { + X64_SET_EFLAGS(x5, X_CF); + } else { + BSTRINS_D(xFlags, x5, F_CF, F_CF); + } + } else { + ADDxw(x5, gd, ed); + ADDxw(gd, x5, x3); + if (!rex.w) ZEROUP(gd); + } + break; + default: + DEFAULT; + } + break; + case 0x3A: // these are some more SSSE3+ opcodes + opcode = F8; + switch (opcode) { + case 0x08: + INST_NAME("ROUNDPS Gx, Ex, Ib"); + nextop = F8; + GETEX(q1, 0, 1); + GETGX_empty(q0); + u8 = F8; + v1 = fpu_get_scratch(dyn); + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x1, x2); + VFRINT_S(q0, q1); + x87_restoreround(dyn, ninst, u8); + } else { + VFRINTRRD_S(q0, q1, round_round[u8 & 3]); + } + break; + case 0x09: + INST_NAME("ROUNDPD Gx, Ex, Ib"); + nextop = F8; + GETEX(q1, 0, 1); + GETGX_empty(q0); + u8 = F8; + v1 = fpu_get_scratch(dyn); + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x1, x2); + VFRINT_D(q0, q1); + x87_restoreround(dyn, ninst, u8); + } else { + VFRINTRRD_D(q0, q1, round_round[u8 & 3]); + } + break; + case 0x0A: + INST_NAME("ROUNDSS Gx, Ex, Ib"); + nextop = F8; + GETGX(q0, 1); + GETEXSS(q1, 0, 1); + u8 = F8; + v1 = fpu_get_scratch(dyn); + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x1, x2); + VFRINT_S(v1, q1); + x87_restoreround(dyn, ninst, u8); + } else { + VFRINTRRD_S(v1, q1, round_round[u8 & 3]); + } + VEXTRINS_W(q0, v1, 0); + break; + case 0x0B: + INST_NAME("ROUNDSD Gx, Ex, Ib"); + nextop = F8; + GETGX(q0, 1); + GETEXSD(q1, 0, 1); + u8 = F8; + v1 = fpu_get_scratch(dyn); + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x1, x2); + VFRINT_D(v1, q1); + x87_restoreround(dyn, ninst, u8); + } else { + VFRINTRRD_D(v1, q1, round_round[u8 & 3]); + } + VEXTRINS_D(q0, v1, 0); + break; + case 0x0C: + INST_NAME("BLENDPS Gx, Ex, Ib"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 1); + u8 = F8 & 0b1111; + if ((u8 & 0b11) == 0b11) { + VEXTRINS_D(q0, q1, 0); + u8 &= ~0b0011; + } + if ((u8 & 0b1100) == 0b1100) { + VEXTRINS_D(q0, q1, 0b00010001); + u8 &= ~0b1100; + } + for (int i = 0; i < 4; ++i) + if (u8 & (1 << i)) { + VEXTRINS_W(q0, q1, (i << 4) | i); + } + break; + case 0x0D: + INST_NAME("BLENDPD Gx, Ex, Ib"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 1); + u8 = F8 & 0b11; + if (u8 == 0b01) { + VEXTRINS_D(q0, q1, 0b00000000); + } else if (u8 == 0b10) { + VEXTRINS_D(q0, q1, 0b00010001); + } else if (u8 == 0b11) { + VOR_V(q0, q1, q1); + } + break; + case 0x0F: + INST_NAME("PALIGNR Gx, Ex, Ib"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 1); + u8 = F8; + if (u8 > 31) { + VXOR_V(q0, q0, q0); + } else if (u8 > 15) { + VBSRL_V(q0, q0, u8 - 16); + } else if (!u8) { + VOR_V(q0, q1, q1); + } else { + d0 = fpu_get_scratch(dyn); + VBSRL_V(d0, q1, u8); + VBSLL_V(q0, q0, 16 - u8); + VOR_V(q0, q0, d0); + } + break; + case 0x0E: + INST_NAME("PBLENDW Gx, Ex, Ib"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 1); + u8 = F8; + i32 = 0; + if (q0 != q1) { + if (u8 == 0xff) { + VAND_V(q0, q1, q1); + } else { + /* 64bits */ + if ((u8 & 0xf) == 0xf) { + VEXTRINS_D(q0, q1, VEXTRINS_IMM_4_0(0, 0)); + u8 &= ~0xf; + } + if ((u8 & 0xf0) == 0xf0) { + VEXTRINS_D(q0, q1, VEXTRINS_IMM_4_0(1, 1)); + u8 &= ~0xf0; + } + /* 32bits */ + if ((u8 & 0x3) == 0x3) { + VEXTRINS_W(q0, q1, VEXTRINS_IMM_4_0(0, 0)); + u8 &= ~0x3; + } + if ((u8 & 0xc) == 0xc) { + VEXTRINS_W(q0, q1, VEXTRINS_IMM_4_0(1, 1)); + u8 &= ~0xc; + } + if ((u8 & 0x30) == 0x30) { + VEXTRINS_W(q0, q1, VEXTRINS_IMM_4_0(2, 2)); + u8 &= ~0x30; + } + if ((u8 & 0xc0) == 0xc0) { + VEXTRINS_W(q0, q1, VEXTRINS_IMM_4_0(3, 3)); + u8 &= ~0xc0; + } + /* 16bits */ + if (u8 & 0x1) + VEXTRINS_H(q0, q1, VEXTRINS_IMM_4_0(0, 0)); + if (u8 & 0x2) + VEXTRINS_H(q0, q1, VEXTRINS_IMM_4_0(1, 1)); + if (u8 & 0x4) + VEXTRINS_H(q0, q1, VEXTRINS_IMM_4_0(2, 2)); + if (u8 & 0x8) + VEXTRINS_H(q0, q1, VEXTRINS_IMM_4_0(3, 3)); + if (u8 & 0x10) + VEXTRINS_H(q0, q1, VEXTRINS_IMM_4_0(4, 4)); + if (u8 & 0x20) + VEXTRINS_H(q0, q1, VEXTRINS_IMM_4_0(5, 5)); + if (u8 & 0x40) + VEXTRINS_H(q0, q1, VEXTRINS_IMM_4_0(6, 6)); + if (u8 & 0x80) + VEXTRINS_H(q0, q1, VEXTRINS_IMM_4_0(7, 7)); + } + } + break; + case 0x14: + INST_NAME("PEXTRB Ed, Gx, Ib"); + nextop = F8; + GETGX(q0, 0); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + u8 = (F8) & 15; + VPICKVE2GR_BU(ed, q0, u8); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x4, &fixedaddress, rex, NULL, 1, 1); + u8 = (F8) & 15; + VPICKVE2GR_BU(x1, q0, u8); + ST_B(x1, wback, fixedaddress); + SMWRITE2(); + } + break; + case 0x15: + INST_NAME("PEXTRW Ed, Gx, Ib"); + nextop = F8; + GETGX(q0, 0); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + u8 = (F8) & 7; + VPICKVE2GR_HU(ed, q0, u8); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x4, &fixedaddress, rex, NULL, 1, 1); + u8 = (F8) & 7; + VPICKVE2GR_HU(x1, q0, u8); + ST_H(x1, wback, fixedaddress); + SMWRITE2(); + } + break; + case 0x16: + if (rex.w) { + INST_NAME("PEXTRQ Ed, Gx, Ib"); + } else { + INST_NAME("PEXTRD Ed, Gx, Ib"); + } + nextop = F8; + GETGX(q0, 0); + d0 = fpu_get_scratch(dyn); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + u8 = F8; + if (rex.w) { + VPICKVE2GR_D(ed, q0, (u8 & 1)); + } else { + VPICKVE2GR_WU(ed, q0, (u8 & 3)); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x5, &fixedaddress, rex, NULL, 1, 1); + u8 = F8; + if (rex.w) { + VBSRL_V(d0, q0, (u8 & 1) * 8); + FST_D(d0, ed, fixedaddress); + } else { + VBSRL_V(d0, q0, (u8 & 3) * 4); + FST_S(d0, ed, fixedaddress); + } + SMWRITE2(); + } + break; + case 0x17: + INST_NAME("EXTRACTPS Ew, Gx, Ib"); + nextop = F8; + GETGX(q0, 0); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + u8 = F8 & 0b11; + VPICKVE2GR_WU(ed, q0, u8); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x5, &fixedaddress, rex, NULL, 1, 1); + u8 = F8 & 0b11; + d0 = fpu_get_scratch(dyn); + VBSRL_V(d0, q0, (u8 & 3) * 4); + FST_S(d0, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0x20: + INST_NAME("PINSRB Gx, ED, Ib"); + nextop = F8; + GETGX(q0, 1); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + wback = 0; + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 1); + LD_B(x1, wback, fixedaddress); + ed = x1; + } + u8 = F8; + VINSGR2VR_B(q0, ed, (u8 & 0xf)); + break; + case 0x21: + INST_NAME("INSERTPS Gx, Ex, Ib"); + nextop = F8; + GETGX(q0, 1); + q2 = fpu_get_scratch(dyn); + if (MODREG) { + u8 = F8; + q1 = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0); + VEXTRINS_W(q0, q1, VEXTRINS_IMM_4_0(((u8 >> 4) & 3), ((u8 >> 6) & 3))); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x5, &fixedaddress, rex, NULL, 0, 1); + u8 = F8; + FLD_S(q2, wback, fixedaddress); + VEXTRINS_W(q0, q2, VEXTRINS_IMM_4_0(((u8 >> 4) & 3), 0)); // src index is zero when Ex is mem operand + } + uint8_t zmask = u8 & 0xf; + VXOR_V(q2, q2, q2); + if (zmask) { + for (uint8_t i = 0; i < 4; i++) { + if (zmask & (1 << i)) { + VEXTRINS_W(q0, q2, VEXTRINS_IMM_4_0(i, 0)); + } + } + } + + break; + case 0x22: + INST_NAME("PINSRD Gx, ED, Ib"); + nextop = F8; + GETGX(q0, 1); + GETED(1); + u8 = F8; + if (rex.w) { + VINSGR2VR_D(q0, ed, (u8 & 1)); + } else { + VINSGR2VR_W(q0, ed, (u8 & 3)); + } + break; + case 0x40: + INST_NAME("DPPS Gx, Ex, Ib"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 1); + u8 = F8; + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + v2 = fpu_get_scratch(dyn); + VFMUL_S(v0, q0, q1); + VXOR_V(v2, v2, v2); + for (int i = 0; i < 4; ++i) { + if (!(u8 & (1 << (4 + i)))) { + VEXTRINS_W(v0, v2, (i << 4)); + } + } + VSHUF4I_W(v1, v0, 0b10110001); // v0[a,b,c,d] v1[b,a,d,c] + VFADD_S(v0, v0, v1); // v0[ab,ba,cd,dc] + VSHUF4I_W(v1, v0, 0b01001110); // v1[cd,dc,ab,ba] + VFADD_S(v0, v0, v1); // v0[abcd,badc,cdab,dcba] + VREPLVEI_W(q0, v0, 0); + for (int i = 0; i < 4; ++i) { + if (!(u8 & (1 << i))) { + VEXTRINS_W(q0, v2, (i << 4)); + } + } + break; + case 0x41: + INST_NAME("DPPD Gx, Ex, Ib"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 1); + u8 = F8; + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + v2 = fpu_get_scratch(dyn); + VFMUL_D(v0, q0, q1); + VXOR_V(v2, v2, v2); + for (int i = 0; i < 2; ++i) { + if (!(u8 & (1 << (4 + i)))) { + VEXTRINS_D(v0, v2, (i << 4)); + } + } + VSHUF4I_W(v1, v0, 0b01001110); // v0[a,b] v1[b,a] + VFADD_D(v0, v0, v1); // v0[ab,ba] + VREPLVEI_D(q0, v0, 0); + for (int i = 0; i < 2; ++i) { + if (!(u8 & (1 << i))) { + VEXTRINS_D(q0, v2, (i << 4)); + } + } + break; + case 0x44: + INST_NAME("PCLMULQDQ Gx, Ex, Ib"); + nextop = F8; + GETG; + sse_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); // gx + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + sse_forget_reg(dyn, ninst, ed); + MOV32w(x2, ed); + MOV32w(x3, 0); // p = NULL + } else { + MOV32w(x2, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x5, &fixedaddress, rex, NULL, 0, 1); + if (ed != x3) MV(x3, ed); + } + u8 = F8; + MOV32w(x4, u8); + CALL4(const_native_pclmul, -1, x1, x2, x3, x4); + break; + case 0x61: + INST_NAME("PCMPESTRI Gx, Ex, Ib"); + nextop = F8; + GETG; + u8 = geted_ib(dyn, addr, ninst, nextop); + SETFLAGS(X_ALL, SF_SET_DF, NAT_FLAGS_NOFUSION); + if (gd > 7) // no need to reflect cache as xmm0-xmm7 will be saved before the function call anyway + sse_reflect_reg(dyn, ninst, gd); + ADDI_D(x3, xEmu, offsetof(x64emu_t, xmm[gd])); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + if (ed > 7) + sse_reflect_reg(dyn, ninst, ed); + ADDI_D(x1, xEmu, offsetof(x64emu_t, xmm[ed])); + ed = x1; + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 1); + } + MV(x2, xRDX); + MV(x4, xRAX); + u8 = F8; + MOV32w(x5, u8); + CALL6(const_sse42_compare_string_explicit_len, x1, ed, x2, x3, x4, x5, 0); + ZEROUP(x1); + BNEZ_MARK(x1); + MOV32w(xRCX, (u8 & 1) ? 8 : 16); + B_NEXT_nocond; + MARK; + if (u8 & 0b1000000) { + CLZ_W(xRCX, x1); + ADDI_D(x2, xZR, 31); + SUB_D(xRCX, x2, xRCX); + } else { + CTZ_W(xRCX, x1); + } + break; + case 0x63: + INST_NAME("PCMPISTRI Gx, Ex, Ib"); + SETFLAGS(X_ALL, SF_SET_DF, NAT_FLAGS_NOFUSION); + nextop = F8; + GETG; + if (gd > 7) sse_reflect_reg(dyn, ninst, gd); + ADDI_D(x2, xEmu, offsetof(x64emu_t, xmm[gd])); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + if (ed > 7) sse_reflect_reg(dyn, ninst, ed); + ADDI_D(x1, xEmu, offsetof(x64emu_t, xmm[ed])); + ed = x1; + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 1); + } + u8 = F8; + MOV32w(x3, u8); + CALL4(const_sse42_compare_string_implicit_len, x1, ed, x2, x3, 0); + BNEZ_MARK(x1); + MOV32w(xRCX, (u8 & 1) ? 8 : 16); + B_NEXT_nocond; + MARK; + if (u8 & 0b1000000) { + CLZ_W(xRCX, x1); + ADDI_D(x2, xZR, 31); + SUB_D(xRCX, x2, xRCX); + } else { + CTZ_W(xRCX, x1); + } + break; + case 0xDF: + INST_NAME("AESKEYGENASSIST Gx, Ex, Ib"); // AES-NI + nextop = F8; + GETG; + sse_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); // gx + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + sse_forget_reg(dyn, ninst, ed); + MOV32w(x2, ed); + MOV32w(x3, 0); // p = NULL + } else { + MOV32w(x2, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 1); + if (ed != x3) { + MV(x3, ed); + } + } + u8 = F8; + MOV32w(x4, u8); + CALL4(const_native_aeskeygenassist, -1, x1, x2, x3, x4); + break; + default: + DEFAULT; + } + break; + +#define GO(GETFLAGS, NO, YES, NATNO, NATYES, F, I) \ + READFLAGS(F); \ + tmp1 = x1; \ + tmp3 = x3; \ + if (cpuext.lbt) { \ + X64_SETJ(x1, I); \ + } else { \ + GETFLAGS; \ + } \ + nextop = F8; \ + GETGD; \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + } else { \ + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x4, &fixedaddress, rex, NULL, 1, 0); \ + LD_HU(x4, ed, fixedaddress); \ + ed = x4; \ + } \ + if (cpuext.lbt) \ + BEQZ(x1, 4 + 4); \ + else \ + B##NO(x1, 4 + 4); \ + BSTRINS_D(gd, ed, 15, 0); + + GOCOND(0x40, "CMOV", "Gd, Ed"); +#undef GO + + case 0x50: + nextop = F8; + INST_NAME("PMOVMSKD Gd, Ex"); + GETEX(q0, 0, 0); + GETGD; + VPICKVE2GR_D(x1, q0, 0); + VPICKVE2GR_D(gd, q0, 1); + SRLI_D(gd, gd, 62); + SRLI_D(x1, x1, 63); + BSTRINS_D(gd, x1, 0, 0); + break; + case 0x51: + INST_NAME("SQRTPD Gx, Ex"); + nextop = F8; + GETEX(q0, 0, 0); + GETGX_empty(q1); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VFCMP_D(v0, q0, q0, cEQ); + VFSQRT_D(q1, q0); + VFCMP_D(v1, q1, q1, cEQ); + VANDN_V(v1, v1, v0); + VSLLI_D(v1, v1, 63); + VOR_V(q1, q1, v1); + } else { + VFSQRT_D(q1, q0); + } + break; + case 0x54: + INST_NAME("ANDPD Gx, Ex"); + nextop = F8; + GETEX(q0, 0, 0); + GETGX(v0, 1); + VAND_V(v0, v0, q0); + break; + case 0x55: + INST_NAME("ANDNPD Gx, Ex"); + nextop = F8; + GETEX(q0, 0, 0); + GETGX(v0, 1); + VANDN_V(v0, v0, q0); + break; + case 0x56: + INST_NAME("ORPD Gx, Ex"); + nextop = F8; + GETEX(q0, 0, 0); + GETGX(v0, 1); + VOR_V(v0, v0, q0); + break; + case 0x57: + INST_NAME("XORPD Gx, Ex"); + nextop = F8; + GETG; + if (MODREG && ((nextop & 7) + (rex.b << 3) == gd)) { + // special case for XORPD Gx, Gx + q0 = sse_get_reg_empty(dyn, ninst, x1, gd); + VXOR_V(q0, q0, q0); + } else { + q0 = sse_get_reg(dyn, ninst, x1, gd, 1); + GETEX(q1, 0, 0); + VXOR_V(q0, q0, q1); + } + break; + case 0x58: + INST_NAME("ADDPD Gx, Ex"); + nextop = F8; + GETEX(q0, 0, 0); + GETGX(q1, 1); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VFCMP_D(v0, q0, q1, cUN); + } + VFADD_D(q1, q1, q0); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMP_D(v1, q1, q1, cUN); + VANDN_V(v0, v0, v1); + VLDI(v1, 0b011111111000); // broadcast 0xFFFFFFFFFFFFFFF8 + VSLLI_D(v1, v1, 48); + VAND_V(v1, v0, v1); + VANDN_V(v0, v0, q1); + VOR_V(q1, v0, v1); + } + break; + case 0x59: + INST_NAME("MULPD Gx, Ex"); + nextop = F8; + GETEX(q0, 0, 0); + GETGX(q1, 1); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VFCMP_D(v0, q0, q1, cUN); + } + VFMUL_D(q1, q1, q0); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMP_D(v1, q1, q1, cUN); + VANDN_V(v0, v0, v1); + VLDI(v1, 0b011111111000); // broadcast 0xFFFFFFFFFFFFFFF8 + VSLLI_D(v1, v1, 48); + VAND_V(v1, v0, v1); + VANDN_V(v0, v0, q1); + VOR_V(q1, v0, v1); + } + break; + case 0x5A: + INST_NAME("CVTPD2PS Gx, Ex"); + nextop = F8; + GETEX(v1, 0, 0); + GETGX_empty(v0); + // TODO: !BOX64ENV(dynarec_fastround) + q0 = fpu_get_scratch(dyn); + VFCVT_S_D(q0, v1, v1); + VXOR_V(v0, v0, v0); + VEXTRINS_D(v0, q0, 0); + break; + case 0x5B: INST_NAME("CVTPS2DQ Gx, Ex"); nextop = F8; GETEX(v1, 0, 0); GETGX_empty(v0); u8 = sse_setround(dyn, ninst, x6, x4); + if (v0 == v1 && !BOX64ENV(dynarec_fastround)) { + v1 = fpu_get_scratch(dyn); + VOR_V(v1, v0, v0); + } VFTINT_W_S(v0, v1); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { q0 = fpu_get_scratch(dyn); q1 = fpu_get_scratch(dyn); d1 = fpu_get_scratch(dyn); @@ -469,46 +1599,121 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETEX(q0, 0, 0); GETGX(q1, 1); - // TODO: fastnan handling + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VFCMP_D(v0, q0, q1, cUN); + } VFSUB_D(q1, q1, q0); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMP_D(v1, q1, q1, cUN); + VANDN_V(v0, v0, v1); + VLDI(v1, 0b011111111000); // broadcast 0xFFFFFFFFFFFFFFF8 + VSLLI_D(v1, v1, 48); + VAND_V(v1, v0, v1); + VANDN_V(v0, v0, q1); + VOR_V(q1, v0, v1); + } + break; + case 0x5D: + INST_NAME("MINPD Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(v1, 0, 0); + // LoongArch FMIN/FMAX follow IEEE 754-2008 , it wll copy the none NaN value. + // If both NaN, then copy NaN. + // but x86 will copy the second if either v0[x] or v1[x] is NaN + q0 = fpu_get_scratch(dyn); + VFCMP_D(q0, v1, v0, cULE); + VBITSEL_V(v0, v0, v1, q0); + break; + case 0x5E: + INST_NAME("DIVPD Gx, Ex"); + nextop = F8; + GETEX(q0, 0, 0); + GETGX(q1, 1); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VFCMP_D(v0, q0, q1, cUN); + } + VFDIV_D(q1, q1, q0); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMP_D(v1, q1, q1, cUN); + VANDN_V(v0, v0, v1); + VLDI(v1, 0b011111111000); // broadcast 0xFFFFFFFFFFFFFFF8 + VSLLI_D(v1, v1, 48); + VAND_V(v1, v0, v1); + VANDN_V(v0, v0, q1); + VOR_V(q1, v0, v1); + } + break; + case 0x5F: + INST_NAME("MAXPD Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(v1, 0, 0); + // LoongArch FMIN/FMAX follow IEEE 754-2008 , it wll copy the none NaN value. + // If both NaN, then copy NaN. + // but x86 will copy the second if either v0[x] or v1[x] is NaN + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VFCMP_D(q0, v1, v0, cLT); // ~cLT = un ge eq, if either v0/v1=nan ,choose v1. if eq either is ok,but when +0.0 == -0.0 x86 sse choose v1 + VBITSEL_V(v0, v1, v0, q0); // swap v0 v1 => v1 v0 for ~cLT break; + case 0x60: - INST_NAME("PUNPCKLBW Gx,Ex"); + INST_NAME("PUNPCKLBW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VILVL_B(v0, q0, v0); break; case 0x61: - INST_NAME("PUNPCKLWD Gx,Ex"); + INST_NAME("PUNPCKLWD Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VILVL_H(v0, q0, v0); break; case 0x62: - INST_NAME("PUNPCKLDQ Gx,Ex"); + INST_NAME("PUNPCKLDQ Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VILVL_W(v0, q0, v0); break; + case 0x63: + INST_NAME("PACKSSWB Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(v1, 0, 0); + q0 = fpu_get_scratch(dyn); + if (v0 == v1) { + VSAT_H(v0, v0, 7); + VPICKEV_B(v0, v0, v0); + } else { + VSAT_H(v0, v0, 7); + VSAT_H(q0, v1, 7); + VPICKEV_B(v0, q0, v0); + } + break; case 0x64: - INST_NAME("PCMPGTB Gx,Ex"); + INST_NAME("PCMPGTB Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); VSLT_B(v0, v1, v0); break; case 0x65: - INST_NAME("PCMPGTW Gx,Ex"); + INST_NAME("PCMPGTW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); VSLT_H(v0, v1, v0); break; case 0x66: - INST_NAME("PCMPGTD Gx,Ex"); + INST_NAME("PCMPGTD Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); @@ -535,28 +1740,38 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int } break; case 0x68: - INST_NAME("PUNPCKHBW Gx,Ex"); + INST_NAME("PUNPCKHBW Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); VILVH_B(q0, q1, q0); break; case 0x69: - INST_NAME("PUNPCKHWD Gx,Ex"); + INST_NAME("PUNPCKHWD Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); VILVH_H(q0, q1, q0); break; case 0x6A: - INST_NAME("PUNPCKHDQ Gx,Ex"); + INST_NAME("PUNPCKHDQ Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); VILVH_W(q0, q1, q0); break; + case 0x6B: + INST_NAME("PACKSSDW Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(v1, 0, 0); + d0 = fpu_get_scratch(dyn); + VOR_V(d0, v1, v1); + VSSRANI_H_W(d0, v0, 0); + VOR_V(v0, d0, d0); + break; case 0x6C: - INST_NAME("PUNPCKLQDQ Gx,Ex"); + INST_NAME("PUNPCKLQDQ Gx, Ex"); nextop = F8; GETGX(v0, 1); if (MODREG) { @@ -569,7 +1784,7 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int VILVL_D(v0, v1, v0); // v0[127:64] = v1[63:0] break; case 0x6D: - INST_NAME("PUNPCKHQDQ Gx,Ex"); + INST_NAME("PUNPCKHQDQ Gx, Ex"); nextop = F8; GETGX(v0, 1); if (MODREG) { @@ -588,7 +1803,7 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int GETGX_empty(v0); v1 = fpu_get_scratch(dyn); if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); if (rex.w) { MOVGR2FR_D(v1, ed); } else { @@ -621,7 +1836,7 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int } break; case 0x70: - INST_NAME("PSHUFD Gx,Ex,Ib"); + INST_NAME("PSHUFD Gx, Ex, Ib"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 1); @@ -737,99 +1952,575 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int u8 = F8; if (u8) { if (u8 > 15) { - XVOR_V(q0, q0, q0); + VXOR_V(q0, q0, q0); + } else { + VBSRL_V(q0, q0, u8); + } + PUTEX(q0); + } + break; + case 6: + INST_NAME("PSLLQ Ex, Ib"); + GETEX(q0, 1, 1); + u8 = F8; + if (u8) { + if (u8 > 63) { + VXOR_V(q0, q0, q0); + } else { + VSLLI_D(q0, q0, u8); + } + PUTEX(q0); + } + break; + case 7: + INST_NAME("PSLLDQ Ex, Ib"); + GETEX(q0, 1, 1); + u8 = F8; + if (u8) { + if (u8 > 15) { + VXOR_V(q0, q0, q0); + } else if (u8 > 0) { + VBSLL_V(q0, q0, u8); + } + PUTEX(q0); + } + break; + default: + DEFAULT; + } + break; + case 0x74: + INST_NAME("PCMPEQB Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(q0, 0, 0); + VSEQ_B(v0, v0, q0); + break; + case 0x75: + INST_NAME("PCMPEQW Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(q0, 0, 0); + VSEQ_H(v0, v0, q0); + break; + case 0x76: + INST_NAME("PCMPEQD Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(q0, 0, 0); + VSEQ_W(v0, v0, q0); + break; + case 0x7C: + INST_NAME("HADDPD Gx, Ex"); + nextop = F8; + GETGX(q1, 1); + GETEX(q0, 0, 0); + d0 = fpu_get_scratch(dyn); + VPICKEV_D(d0, q0, q1); + VPICKOD_D(q1, q0, q1); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VFCMP_D(v0, d0, q1, cUN); + } + VFADD_D(q1, d0, q1); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMP_D(v1, q1, q1, cUN); + VANDN_V(v0, v0, v1); + VLDI(v1, 0b011111111000); // broadcast 0xFFFFFFFFFFFFFFF8 + VSLLI_D(v1, v1, 48); + VAND_V(v1, v0, v1); + VANDN_V(v0, v0, q1); + VOR_V(q1, v0, v1); + } + break; + case 0x7D: + INST_NAME("HSUBPD Gx, Ex"); + nextop = F8; + GETGX(q1, 1); + GETEX(q0, 0, 0); + d0 = fpu_get_scratch(dyn); + VPICKEV_D(d0, q0, q1); + VPICKOD_D(q1, q0, q1); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VFCMP_D(v0, d0, q1, cUN); + } + VFSUB_D(q1, d0, q1); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMP_D(v1, q1, q1, cUN); + VANDN_V(v0, v0, v1); + VLDI(v1, 0b011111111000); // broadcast 0xFFFFFFFFFFFFFFF8 + VSLLI_D(v1, v1, 48); + VAND_V(v1, v0, v1); + VANDN_V(v0, v0, q1); + VOR_V(q1, v0, v1); + } + break; + case 0x7E: + INST_NAME("MOVD Ed,Gx"); + nextop = F8; + GETGX(v0, 0); + if (rex.w) { + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + MOVFR2GR_D(ed, v0); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + FST_D(v0, ed, fixedaddress); + SMWRITE2(); + } + } else { + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + MOVFR2GR_S(ed, v0); + ZEROUP(ed); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + FST_S(v0, ed, fixedaddress); + SMWRITE2(); + } + } + break; + case 0x7F: + INST_NAME("MOVDQA Ex, Gx"); + nextop = F8; + GETGX(v0, 0); + if (MODREG) { + v1 = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 1); + VOR_V(v1, v0, v0); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + VST(v0, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0xA3: + INST_NAME("BT Ew, Gw"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } + SET_DFNONE(); + nextop = F8; + GETGD; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + EXT_W_H(x1, gd); + SRAI_D(x1, x1, 4); + ALSL_D(x3, x1, wback, 1); + LD_H(x1, x3, fixedaddress); + ed = x1; + } + IFX (X_CF) { + ANDI(x2, gd, 0xf); + SRL_D(x4, ed, x2); + if (cpuext.lbt) + X64_SET_EFLAGS(x4, X_CF); + else + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + break; + case 0xA4: + INST_NAME("SHLD Ew, Gw, Ib"); + nextop = F8; + u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; + if (u8) { + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGWEW(x1, x2, 1); + u8 = F8; + emit_shld16c(dyn, ninst, rex, ed, gd, u8, x6, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } + break; + case 0xA5: + nextop = F8; + INST_NAME("SHLD Ew, Gw, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGWEW(x1, x2, 0); + ANDI(x4, xRCX, 0x1f); + UFLAG_IF { CBZ_NEXT(x4); } + emit_shld16(dyn, ninst, ed, gd, x4, x5, x6, x7); + EWBACK; + break; + case 0xAB: + INST_NAME("BTS Ew, Gw"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } + SET_DFNONE(); + nextop = F8; + GETGD; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + wback = 0; + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + EXT_W_H(x1, gd); + SRAI_D(x1, x1, 4); + ALSL_D(x3, x1, wback, 1); + LD_H(x1, x3, fixedaddress); + ed = x1; + wback = x3; + } + ANDI(x2, gd, 0xf); + IFX (X_CF) { + SRL_D(x4, ed, x2); + if (cpuext.lbt) + X64_SET_EFLAGS(x4, X_CF); + else + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + ADDI_D(x4, xZR, 1); + SLL_D(x4, x4, x2); + OR(ed, ed, x4); + if (wback) { + ST_H(ed, wback, fixedaddress); + SMWRITE(); + } + break; + case 0xAC: + nextop = F8; + INST_NAME("SHRD Ew, Gw, Ib"); + u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; + if (u8) { + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGWEW(x1, x2, 1); + u8 = F8; + emit_shrd16c(dyn, ninst, rex, ed, gd, u8, x6, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } + break; + case 0xAD: + nextop = F8; + INST_NAME("SHRD Ew, Gw, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGWEW(x1, x2, 0); + ANDI(x4, xRCX, 0x1f); + UFLAG_IF { CBZ_NEXT(x4); } + emit_shrd16(dyn, ninst, ed, gd, x4, x5, x6, x7); + EWBACK; + break; + case 0xAE: + nextop = F8; + if (MODREG) + switch (nextop) { + default: DEFAULT; + } + else + switch ((nextop >> 3) & 7) { + case 6: + INST_NAME("CLWB Ed"); + FAKEED; + // Full flush... no fine-grained options available + DBAR(0); + break; + case 7: + INST_NAME("CLFLUSHOPT Ed"); + FAKEED; + // Full flush... no fine-grained options available + DBAR(0); + break; + default: + DEFAULT; + } + break; + case 0xAF: + INST_NAME("IMUL Gw, Ew"); + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); + nextop = F8; + GETSEW(x1, 0); + GETSGW(x2); + MUL_W(x2, x2, x1); + GWBACK; + SET_DFNONE(); + CLEAR_FLAGS(x3); + IFX (X_CF | X_OF) { + SRAI_W(x1, x2, 15); + SRAI_W(x3, x2, 31); + XOR(x3, x3, x1); + SNEZ(x3, x3); + IFX (X_CF) BSTRINS_D(xFlags, x3, F_CF, F_CF); + IFX (X_OF) BSTRINS_D(xFlags, x3, F_OF, F_OF); + } + IFX (X_SF) { + SRLI_D(x3, gd, 15); + BSTRINS_D(xFlags, x3, F_SF, F_SF); + } + IFX (X_PF) emit_pf(dyn, ninst, gd, x3, x4); + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + break; + case 0xB3: + INST_NAME("BTR Ew, Gw"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } + SET_DFNONE(); + nextop = F8; + GETGD; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + wback = 0; + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + EXT_W_H(x1, gd); + SRAI_D(x1, x1, 4); + ALSL_D(x3, x1, wback, 1); + LD_H(x1, x3, fixedaddress); + ed = x1; + wback = x3; + } + ANDI(x2, gd, 0xf); + IFX (X_CF) { + SRL_D(x4, ed, x2); + if (cpuext.lbt) + X64_SET_EFLAGS(x4, X_CF); + else + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + ADDI_D(x4, xZR, 1); + SLL_D(x4, x4, x2); + NOR(x4, x4, xZR); + AND(ed, ed, x4); + if (wback) { + ST_H(ed, wback, fixedaddress); + SMWRITE(); + } + break; + case 0xB6: + INST_NAME("MOVZX Gw, Eb"); + nextop = F8; + if (MODREG) { + if (rex.rex) { + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); + eb2 = 0; + } else { + ed = (nextop & 7); + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx + eb2 = (ed & 4) >> 2; // L or H + } + BSTRPICK_W(x1, eb1, eb2 * 8 + 7, eb2 * 8); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x4, &fixedaddress, rex, NULL, 1, 0); + LD_BU(x1, ed, fixedaddress); + } + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); + BSTRINS_D(gd, x1, 15, 0); // insert in Gw + break; + case 0xBA: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 4: + INST_NAME("BT Ew, Ib"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } + SET_DFNONE(); + GETED(1); + u8 = F8; + u8 &= (rex.w ? 0x3f : 0x0f); + IFX (X_CF) { + BSTRPICK_D(x3, ed, u8, u8); + if (cpuext.lbt) { + X64_SET_EFLAGS(x3, X_CF); } else { - VBSRL_V(q0, q0, u8); + BSTRINS_D(xFlags, x3, F_CF, F_CF); } - PUTEX(q0); } break; + case 5: + INST_NAME("BTS Ew, Ib"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } + SET_DFNONE(); + GETEW(x1, 1); + u8 = F8; + u8 &= (rex.w ? 0x3f : 0x0f); + if (cpuext.lbt) { + SRLI_D(x3, ed, u8); + X64_SET_EFLAGS(x3, X_CF); + } else { + BSTRPICK_D(x3, ed, u8, u8); + BSTRINS_D(xFlags, x3, F_CF, F_CF); + } + if (u8 <= 11) { + ORI(ed, ed, (1LL << u8)); + } else { + ADDI_D(x3, xZR, -1); + BSTRINS_D(ed, x3, u8, u8); + } + EWBACK; + break; case 6: - INST_NAME("PSLLQ Ex, Ib"); - GETEX(q0, 1, 1); + INST_NAME("BTR Ew, Ib"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } + SET_DFNONE(); + GETEW(x1, 1); u8 = F8; - if (u8) { - if (u8 > 63) { - XVOR_V(q0, q0, q0); - } else { - VSLLI_D(q0, q0, u8); - } - PUTEX(q0); + u8 &= (rex.w ? 0x3f : 0x0f); + if (cpuext.lbt) { + SRLI_D(x3, ed, u8); + X64_SET_EFLAGS(x3, X_CF); + } else { + BSTRPICK_D(x3, ed, u8, u8); + BSTRINS_D(xFlags, x3, F_CF, F_CF); } + BSTRINS_D(ed, xZR, u8, u8); + EWBACK; break; case 7: - INST_NAME("PSLLDQ Ex, Ib"); - GETEX(q0, 1, 1); + INST_NAME("BTC Ew, Ib"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } + SET_DFNONE(); + GETEW(x1, 1); u8 = F8; - if (u8) { - if (u8 > 15) { - VXOR_V(q0, q0, q0); - } else if (u8 > 0) { - VBSLL_V(q0, q0, u8); - } - PUTEX(q0); + u8 &= (rex.w ? 0x3f : 0x0f); + if (cpuext.lbt) { + SRLI_D(x3, ed, u8); + X64_SET_EFLAGS(x3, X_CF); + } else { + BSTRPICK_D(x3, ed, u8, u8); + BSTRINS_D(xFlags, x3, F_CF, F_CF); + } + if (u8 <= 11) { + XORI(ed, ed, (1LL << u8)); + } else { + MOV64xw(x6, (1LL << u8)); + XOR(ed, ed, x6); } + EWBACK; break; default: DEFAULT; } break; - case 0x76: - INST_NAME("PCMPEQD Gx,Ex"); - nextop = F8; - GETGX(v0, 1); - GETEX(q0, 0, 0); - VSEQ_W(v0, v0, q0); - break; - case 0x7E: - INST_NAME("MOVD Ed,Gx"); - nextop = F8; - GETGX(v0, 0); - if (rex.w) { - if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - MOVFR2GR_D(ed, v0); - } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); - FST_D(v0, ed, fixedaddress); - SMWRITE2(); - } + case 0xBB: + INST_NAME("BTC Ew, Gw"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); } else { - if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - MOVFR2GR_S(ed, v0); - ZEROUP(ed); - } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); - FST_S(v0, ed, fixedaddress); - SMWRITE2(); - } + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); } - break; - case 0x7F: - INST_NAME("MOVDQA Ex, Gx"); + SET_DFNONE(); nextop = F8; - GETGX(v0, 0); + GETGD; if (MODREG) { - v1 = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 1); - VOR_V(v1, v0, v0); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + wback = 0; } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); - VST(v0, ed, fixedaddress); - SMWRITE2(); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + EXT_W_H(x1, gd); + SRAI_D(x1, x1, 4); + ALSL_D(x3, x1, wback, 1); + LD_H(x1, x3, fixedaddress); + ed = x1; + wback = x3; + } + ANDI(x2, gd, 0xf); + IFX (X_CF) { + SRL_D(x4, ed, x2); + if (cpuext.lbt) + X64_SET_EFLAGS(x4, X_CF); + else + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + ADDI_D(x4, xZR, 1); + SLL_D(x4, x4, x2); + XOR(ed, ed, x4); + if (wback) { + ST_H(ed, wback, fixedaddress); + SMWRITE(); } break; - case 0xAF: - INST_NAME("IMUL Gw,Ew"); - SETFLAGS(X_ALL, SF_PENDING); + case 0xBC: + INST_NAME("BSF Gw, Ew"); + if (BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + IFX (X_ALL) CLEAR_FLAGS(x3); + } else + SETFLAGS(X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); nextop = F8; - UFLAG_DF(x1, d_imul16); - GETSEW(x1, 0); - GETSGW(x2); - MUL_W(x2, x2, x1); - UFLAG_RES(x2); - BSTRPICK_D(x2, x2, 15, 0); + GETGWEW(x4, x5, 0); + BNE_MARK(ed, xZR); + IFX (X_ZF) ORI(xFlags, xFlags, 1 << F_ZF); + B_MARK2_nocond; + MARK; + IFXA (X_ZF, !BOX64DRENV(dynarec_safeflags)) + BSTRINS_D(xFlags, xZR, F_ZF, F_ZF); + CTZ_D(gd, ed); + GWBACK; + MARK2; + if (BOX64DRENV(dynarec_safeflags)) { + IFX (X_PF) emit_pf(dyn, ninst, gd, x1, x2); + } + IFX (X_ALL) SPILL_EFLAGS(); + break; + case 0xBD: + INST_NAME("BSR Gw, Ew"); + if (BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + IFX (X_ALL) CLEAR_FLAGS(x3); + } else + SETFLAGS(X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGWEW(x4, x5, 0); + BNE_MARK(ed, xZR); + IFX (X_ZF) ORI(xFlags, xFlags, 1 << F_ZF); + B_MARK2_nocond; + MARK; + IFXA (X_ZF, !BOX64DRENV(dynarec_safeflags)) + BSTRINS_D(xFlags, xZR, F_ZF, F_ZF); + CLZ_D(gd, ed); + ADDI_D(x1, xZR, 63); + SUB_D(gd, x1, gd); GWBACK; + MARK2; + if (BOX64DRENV(dynarec_safeflags)) { + IFX (X_PF) emit_pf(dyn, ninst, gd, x1, x2); + } + IFX (X_ALL) SPILL_EFLAGS(); break; case 0xBE: INST_NAME("MOVSX Gw, Eb"); @@ -837,13 +2528,13 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int GETGD; if (MODREG) { if (rex.rex) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); eb1 = ed; eb2 = 0; } else { ed = (nextop & 7); - eb1 = TO_LA64(ed & 3); // Ax, Cx, Dx or Bx - eb2 = (ed & 4) >> 2; // L or H + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx + eb2 = (ed & 4) >> 2; // L or H } if (eb2) { SRLI_D(x1, eb1, eb2 * 8); @@ -858,6 +2549,154 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int } BSTRINS_D(gd, x1, 15, 0); break; + case 0xBF: + if (rex.w) return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); + INST_NAME("MOVSX Gw, Ew"); + nextop = F8; + GETGD; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x4, &fixedaddress, rex, NULL, 1, 0); + LD_H(x1, wback, fixedaddress); + ed = x1; + } + BSTRINS_D(gd, ed, 15, 0); + break; + case 0xC1: + INST_NAME("XADD Ew, Gw"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + GETGWEW(x1, x2, 0); + BSTRINS_D(TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)), ed, 15, 0); + emit_add16(dyn, ninst, ed, gd, x4, x5, x6); + EWBACK; + break; + case 0xC2: + INST_NAME("CMPPD Gx, Ex, Ib"); + nextop = F8; + GETGX(v0, 1); + GETEX(v1, 0, 1); + u8 = F8; + switch (u8 & 7) { + case 0: VFCMP_D(v0, v0, v1, cEQ); break; // Equal => cEQ True if EQ + case 1: VFCMP_D(v0, v0, v1, cLT); break; // Less than => cLT True if EQ LT + case 2: VFCMP_D(v0, v0, v1, cLE); break; // Less or equal => CLE True if LT EQ + case 3: VFCMP_D(v0, v0, v1, cUN); break; // unordered => CUN True if UN + case 4: VFCMP_D(v0, v0, v1, cUNE); break; // Not Equal or unordered True if UN LT GT + case 5: VFCMP_D(v0, v1, v0, cULE); break; // grether or equal or un True if UN EQ GT, use cULE UN LT, swap v0 v1 + case 6: VFCMP_D(v0, v1, v0, cULT); break; // Greater or unordered True if UN GT, use cULE UN EQ LT, swap v0 v1 + case 7: VFCMP_D(v0, v0, v1, cOR); break; // not NaN(ordered) True if LT EQ GT + } + break; + case 0xC4: + INST_NAME("PINSRW Gx, Ed, Ib"); + nextop = F8; + GETGX(v0, 1); + if (MODREG) { + u8 = (F8) & 7; + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x4, &fixedaddress, rex, NULL, 1, 1); + u8 = (F8) & 7; + ed = x3; + LD_HU(ed, wback, fixedaddress); + } + VINSGR2VR_H(v0, ed, u8); + break; + case 0xC5: + INST_NAME("PEXTRW Gd, Ex, Ib"); + nextop = F8; + GETGD; + if (MODREG) { + GETEX(v0, 0, 1); + u8 = (F8) & 7; + v1 = fpu_get_scratch(dyn); + VPICKVE2GR_HU(gd, v0, u8); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x4, &fixedaddress, rex, NULL, 1, 1); + u8 = (F8) & 7; + LD_HU(gd, wback, (u8 << 1)); + } + break; + case 0xC6: + INST_NAME("SHUFPD Gx, Ex, Ib"); + nextop = F8; + GETGX(v0, 1); + GETEX(v1, 0, 1); + u8 = F8; + VSHUF4I_D(v0, v1, 0x8 | (u8 & 1) | ((u8 & 2) << 1)); + break; + case 0xC8: + case 0xC9: + case 0xCA: + case 0xCB: + case 0xCC: + case 0xCD: + case 0xCE: + case 0xCF: + INST_NAME("BSWAP Reg"); + gd = TO_NAT((opcode & 7) + (rex.b << 3)); + if(rex.w){ + REVB_D(gd, gd); + } else { + // undefined behaviour + BSTRINS_D(gd, xZR, 15, 0); + } + break; + case 0xD0: + INST_NAME("ADDSUBPD Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + VFSUB_D(v0, q0, q1); + VFADD_D(q0, q0, q1); + VEXTRINS_D(q0, v0, 0); + break; + case 0xD1: + INST_NAME("PSRLW Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VREPLVEI_D(v0, q1, 0); + VSLEI_DU(v1, v0, 15); + VREPLVEI_H(v0, q1, 0); + VSRL_H(q0, q0, v0); + VAND_V(q0, q0, v1); + break; + case 0xD2: + INST_NAME("PSRLD Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VREPLVEI_D(v0, q1, 0); + VSLEI_DU(v0, v0, 31); + VREPLVEI_W(v1, q1, 0); + VSRL_W(q0, q0, v1); + VAND_V(q0, q0, v0); + break; + case 0xD3: + INST_NAME("PSRLQ Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + VREPLVEI_D(v0, q1, 0); + VLDI(v1, 0b0110000111111); // broadcast 63 as uint64 + VSLE_DU(v1, v0, v1); + VSRL_D(q0, q0, v0); + VAND_V(q0, q0, v1); + break; case 0xD4: INST_NAME("PADDQ Gx, Ex"); nextop = F8; @@ -866,7 +2705,7 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int VADD_D(v0, v0, q0); break; case 0xD5: - INST_NAME("PMULLW Gx,Ex"); + INST_NAME("PMULLW Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); @@ -902,43 +2741,133 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int v0 = fpu_get_scratch(dyn); VMSKLTZ_B(v0, q0); MOVFR2GR_D(x1, v0); - BSTRINS_D(gd, x1, 15, 0); + BSTRPICK_D(gd, x1, 15, 0); + break; + case 0xD8: + INST_NAME("PSUBUSB Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + VSSUB_BU(q0, q0, q1); + break; + case 0xD9: + INST_NAME("PSUBUSW Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + VSSUB_HU(q0, q0, q1); + break; + case 0xDA: + INST_NAME("PMINUB Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + VMIN_BU(q0, q0, q1); break; case 0xDB: - INST_NAME("PAND Gx,Ex"); + INST_NAME("PAND Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VAND_V(v0, v0, q0); break; case 0xDC: - INST_NAME("PADDUSB Gx,Ex"); + INST_NAME("PADDUSB Gx, Ex"); nextop = F8; GETGX(q0, 1); GETEX(q1, 0, 0); VSADD_BU(q0, q0, q1); break; + case 0xDD: + INST_NAME("PADDUSW Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + VSADD_HU(q0, q0, q1); + break; + case 0xDE: + INST_NAME("PMAXUB Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + VMAX_BU(q0, q0, q1); + break; case 0xDF: - INST_NAME("PANDN Gx,Ex"); + INST_NAME("PANDN Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VANDN_V(v0, v0, q0); break; + case 0xE0: + INST_NAME("PAVGB Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(v1, 0, 0); + VAVGR_BU(v0, v0, v1); + break; + case 0xE1: + INST_NAME("PSRAW Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + VMINI_DU(v0, q1, 15); + VREPLVEI_H(v0, v0, 0); + VSRA_H(q0, q0, v0); + break; + case 0xE2: + INST_NAME("PSRAD Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + VMINI_DU(v0, q1, 31); + VREPLVEI_W(v0, v0, 0); + VSRA_W(q0, q0, v0); + break; + case 0xE3: + INST_NAME("PAVGW Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(v1, 0, 0); + VAVGR_HU(v0, v0, v1); + break; case 0xE4: - INST_NAME("PMULHUW Gx,Ex"); + INST_NAME("PMULHUW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); VMUH_HU(v0, v0, v1); break; case 0xE5: - INST_NAME("PMULHW Gx,Ex"); + INST_NAME("PMULHW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(v1, 0, 0); VMUH_H(v0, v0, v1); break; + case 0xE6: + INST_NAME("CVTTPD2DQ Gx, Ex"); + nextop = F8; + GETEX(v1, 0, 0); + GETGX_empty(v0); + if (!BOX64ENV(dynarec_fastround)) { + d0 = fpu_get_scratch(dyn); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VFTINTRZ_W_D(d0, v1, v1); + VLDI(q0, 0b1001110000000); // broadcast 32bit 0x80000000 to all + LU52I_D(x5, xZR, 0x41e); + VREPLGR2VR_D(q1, x5); + VFCMP_D(q1, q1, v1, cULE); + VSHUF4I_W(q1, q1, 0b00001000); + VBITSEL_V(v0, d0, q0, q1); + } else { + VFTINTRZ_W_D(v0, v1, v1); + } + VINSGR2VR_D(v0, xZR, 1); + break; case 0xE7: INST_NAME("MOVNTDQ Ex, Gx"); nextop = F8; @@ -951,15 +2880,57 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int VST(v0, ed, fixedaddress); } break; + case 0xE8: + INST_NAME("PSUBSB Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(q0, 0, 0); + VSSUB_B(v0, v0, q0); + break; + case 0xE9: + INST_NAME("PSUBSW Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(q0, 0, 0); + VSSUB_H(v0, v0, q0); + break; + case 0xEA: + INST_NAME("PMINSW Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(q0, 0, 0); + VMIN_H(v0, v0, q0); + break; case 0xEB: - INST_NAME("POR Gx,Ex"); + INST_NAME("POR Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VOR_V(v0, v0, q0); break; + case 0xEC: + INST_NAME("PADDSB Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(q0, 0, 0); + VSADD_B(v0, v0, q0); + break; + case 0xED: + INST_NAME("PADDSW Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(q0, 0, 0); + VSADD_H(v0, v0, q0); + break; + case 0xEE: + INST_NAME("PMAXSW Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(q0, 0, 0); + VMAX_H(v0, v0, q0); + break; case 0xEF: - INST_NAME("PXOR Gx,Ex"); + INST_NAME("PXOR Gx, Ex"); nextop = F8; GETG; if (MODREG && ((nextop & 7) + (rex.b << 3) == gd)) { @@ -972,6 +2943,45 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int VXOR_V(q0, q0, q1); } break; + case 0xF1: + INST_NAME("PSLLW Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VREPLVEI_D(v0, q1, 0); + VSLEI_DU(v0, v0, 15); + VREPLVEI_H(v1, q1, 0); + VSLL_H(q0, q0, v1); + VAND_V(q0, q0, v0); + break; + case 0xF2: + INST_NAME("PSLLD Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VREPLVEI_D(v0, q1, 0); + VSLEI_DU(v0, v0, 31); + VREPLVEI_W(v1, q1, 0); + VSLL_W(q0, q0, v1); + VAND_V(q0, q0, v0); + break; + case 0xF3: + INST_NAME("PSLLQ Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VREPLVEI_D(v0, q1, 0); + VLDI(v1, (0b011 << 10) | 0x3f); + VSLE_DU(v1, v0, v1); + VSLL_D(q0, q0, v0); + VAND_V(q0, q0, v1); + break; case 0xF4: INST_NAME("PMULUDQ Gx,Ex"); nextop = F8; @@ -979,6 +2989,41 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int GETEX(v1, 0, 0); VMULWEV_D_WU(v0, v0, v1); break; + case 0xF5: + INST_NAME("PMADDWD Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(v1, 0, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VMULWEV_W_H(q0, v0, v1); + VMULWOD_W_H(q1, v0, v1); + VADD_W(v0, q0, q1); + break; + case 0xF6: + INST_NAME("PSADBW Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VABSD_BU(q0, q0, q1); + VHADDW_HU_BU(q0, q0, q0); + VHADDW_WU_HU(q0, q0, q0); + VHADDW_DU_WU(q0, q0, q0); + break; + case 0xF7: + INST_NAME("MASKMOVDQU Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEX(v1, 0, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VSLTI_B(q1, v1, 0); // q1 = byte selection mask + VLD(q0, xRDI, 0); + VBITSEL_V(q0, q0, v0, q1); // sel v0 if mask is 1 + VST(q0, xRDI, 0); + break; case 0xF8: INST_NAME("PSUBB Gx,Ex"); nextop = F8; @@ -987,14 +3032,14 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int VSUB_B(v0, v0, q0); break; case 0xF9: - INST_NAME("PSUBW Gx,Ex"); + INST_NAME("PSUBW Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); VSUB_H(v0, v0, q0); break; case 0xFA: - INST_NAME("PSUBD Gx,Ex"); + INST_NAME("PSUBD Gx, Ex"); nextop = F8; GETGX(v0, 1); GETEX(q0, 0, 0); diff --git a/src/dynarec/la64/dynarec_la64_6664.c b/src/dynarec/la64/dynarec_la64_6664.c deleted file mode 100644 index 01db802..0000000 --- a/src/dynarec/la64/dynarec_la64_6664.c +++ /dev/null @@ -1,70 +0,0 @@ -#include -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "la64_emitter.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" - -#include "la64_printer.h" -#include "dynarec_la64_private.h" -#include "dynarec_la64_helper.h" -#include "dynarec_la64_functions.h" - -uintptr_t dynarec64_6664(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int seg, int* ok, int* need_epilog) -{ - (void)ip; - (void)need_epilog; - - uint8_t opcode = F8; - uint8_t nextop; - uint8_t gd, ed; - int64_t j64; - int v0, v1; - int64_t fixedaddress; - int unscaled; - MAYUSE(j64); - - GETREX(); - - switch (opcode) { - case 0x8B: - INST_NAME("MOV Gd, FS:Ed"); - nextop = F8; - GETGD; - if (MODREG) { // reg <= reg - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - if (rex.w) { - MV(gd, ed); - } else { - if (ed != gd) BSTRINS_D(gd, ed, 15, 0); - } - } else { // mem <= reg - grab_segdata(dyn, addr, ninst, x4, seg); - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - if (rex.w) { - LDX_D(gd, ed, x4); - } else { - LDX_HU(x1, ed, x4); - BSTRINS_D(gd, x1, 15, 0); - } - } - break; - - default: - DEFAULT; - } - return addr; -} diff --git a/src/dynarec/la64/dynarec_la64_66f0.c b/src/dynarec/la64/dynarec_la64_66f0.c new file mode 100644 index 0000000..fc88bd0 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_66f0.c @@ -0,0 +1,560 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "la64_emitter.h" +#include "la64_mapping.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "../dynarec_helper.h" +#include "dynarec_la64_functions.h" + + +uintptr_t dynarec64_66F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop; + uint8_t gd, ed, u8; + uint8_t wback, wb1, wb2, gb1, gb2; + int32_t i32; + int64_t i64, j64; + uint64_t u64; + int64_t fixedaddress; + int unscaled; + MAYUSE(gb1); + MAYUSE(gb2); + MAYUSE(wb1); + MAYUSE(wb2); + MAYUSE(j64); + + switch (opcode) { + case 0x01: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK ADD Ew, Gw"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGW(x5); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (cpuext.lam_bh) { + AMADD_DB_H(x1, x5, wback); + } else { + ANDI(x3, wback, 0b10); + BNEZ_MARK(x3); + // lower 16 bits + MARKLOCK; + LL_W(x1, wback, 0); + ADD_D(x4, x1, x5); + MV(x3, x1); + BSTRINS_D(x3, x4, 15, 0); + SC_W(x3, wback, 0); + BEQZ_MARKLOCK(x3); + B_MARK3_nocond; + MARK; + // upper 16 bits + XORI(wback, wback, 0b10); + MARK2; + LL_W(x1, wback, 0); + BSTRPICK_D(x3, x1, 15, 0); + SRLI_W(x1, x1, 16); + ADD_D(x4, x1, x5); + BSTRINS_D(x3, x4, 31, 15); + SC_W(x3, wback, 0); + BEQZ_MARK2(x3); + MARK3; + } + // final + IFXORNAT (X_ALL | X_PEND) { + BSTRPICK_D(x6, x1, 15, 0); + emit_add16(dyn, ninst, x6, x5, x3, x4, x7); + } + } + break; + case 0x09: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK OR Ew, Gw"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGW(x5); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + ANDI(x3, wback, 0b10); + BNEZ_MARK(x3); + // lower 16 bits + MARKLOCK; + LL_W(x1, wback, 0); + OR(x4, x1, x5); + MV(x3, x1); + BSTRINS_D(x3, x4, 15, 0); + SC_W(x3, wback, 0); + BEQZ_MARKLOCK(x3); + B_MARK3_nocond; + MARK; + // upper 16 bits + XORI(wback, wback, 0b10); + MARK2; + LL_W(x1, wback, 0); + BSTRPICK_D(x3, x1, 15, 0); + SRLI_W(x1, x1, 16); + OR(x4, x1, x5); + BSTRINS_D(x3, x4, 31, 15); + SC_W(x3, wback, 0); + BEQZ_MARK2(x3); + MARK3; + // final + IFXORNAT (X_ALL | X_PEND) { + BSTRPICK_D(x6, x1, 15, 0); + emit_or16(dyn, ninst, x6, x5, x3, x4); + } + } + break; + case 0x0F: + nextop = F8; + switch (nextop) { + case 0xAB: + if (MODREG) { + INST_NAME("Invalid LOCK BTS"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTS Ew, Gw"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (rex.w) { + SRAI_D(x1, gd, 3); + } else { + EXT_W_H(x4, gd); + SRAI_W(x1, x4, 3); + } + ANDI(x2, gd, 7); + ADD_D(x6, wback, x1); + + ANDI(x4, x6, 0b11); + ALSL_D(x2, x4, x2, 3); + BSTRINS_D(x6, xZR, 1, 0); + + ADDI_D(x5, xZR, 1); + SLL_D(x5, x5, x2); + AMOR_DB_W(x4, x5, x6); + IFX (X_CF) { + SRL_D(x4, x4, x2); + if (cpuext.lbt) { + X64_SET_EFLAGS(x4, X_CF); + } else { + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + } + } + break; + case 0xB1: + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK CMPXCHG Ew, Gw"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + nextop = F8; + GETGD; + BSTRPICK_D(x6, xRAX, 15, 0); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + // Aligned + if (cpuext.lamcas) { + MV(x1, x6); + AMCAS_DB_H(x1, gd, wback); + BSTRPICK_D(x1, x1, 15, 0); + BEQ_MARK(x1, x6); // equal = cas success. + } else { + MV(x7, wback); + BSTRINS_D(x7, xZR, 1, 0); + ANDI(x3, wback, 0b10); + BEQZ(x3, 4 + 4 * 7); + // hi16 + LL_W(x5, x7, 0); + BSTRPICK_D(x1, x5, 31, 16); + BNE_MARK2(x1, x6); + BSTRINS_D(x5, gd, 31, 16); + SC_W(x5, x7, 0); + BEQZ(x5, -4 * 5); + B_MARK_nocond; + // lo16 + LL_W(x5, x7, 0); + BSTRPICK_D(x1, x5, 15, 0); + BNE_MARK2(x1, x6); + BSTRINS_D(x5, gd, 15, 0); + SC_W(x5, x7, 0); + BEQZ(x5, -4 * 5); + B_MARK_nocond; + } + MARK2; + BSTRINS_D(xRAX, x1, 15, 0); + MARK; + UFLAG_IF { emit_cmp16(dyn, ninst, x6, x1, x3, x4, x5, x7); } + } + break; + case 0xB3: + if (MODREG) { + INST_NAME("Invalid LOCK BTR"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTR Ew, Gw"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (rex.w) { + SRAI_D(x1, gd, 3); + } else { + EXT_W_H(x4, gd); + SRAI_W(x1, x4, 3); + } + ANDI(x2, gd, 7); + ADD_D(x6, wback, x1); + + ANDI(x4, x6, 0b11); + ALSL_D(x2, x4, x2, 3); + BSTRINS_D(x6, xZR, 1, 0); + + ADDI_D(x5, xZR, 1); + SLL_D(x5, x5, x2); + NOR(x5, x5, xZR); + AMAND_DB_W(x4, x5, x6); + IFX (X_CF) { + SRL_D(x4, x4, x2); + if (cpuext.lbt) { + X64_SET_EFLAGS(x4, X_CF); + } else { + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + } + } + break; + case 0xBA: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 4: + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + break; + case 5: + if (MODREG) { + INST_NAME("Invalid LOCK BTS"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTS Ew, Ib"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 0, 1); + u8 = F8; + u8 &= (rex.w ? 0x3f : 0xf); + ADDI_D(x6, wback, u8 >> 3); + MOV64x(x2, u8 & 7); + ANDI(x4, x6, 0b11); + ALSL_D(x2, x4, x2, 3); + BSTRINS_D(x6, xZR, 1, 0); // aligned_dword_addr = byte_addr & ~3 + + ADDI_D(x5, xZR, 1); + SLL_D(x5, x5, x2); // mask = 1 << total_bit_offset + AMOR_DB_W(x4, x5, x6); + IFX (X_CF) { + SRL_D(x4, x4, x2); + if (cpuext.lbt) { + X64_SET_EFLAGS(x4, X_CF); + } else { + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + } + } + break; + case 6: + if (MODREG) { + INST_NAME("Invalid LOCK BTR"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTR Ew, Ib"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 0, 1); + u8 = F8; + u8 &= (rex.w ? 0x3f : 0xf); + ADDI_D(x6, wback, u8 >> 3); + MOV64x(x2, u8 & 7); + ANDI(x4, x6, 0b11); + ALSL_D(x2, x4, x2, 3); + BSTRINS_D(x6, xZR, 1, 0); // aligned_dword_addr = byte_addr & ~3 + + ADDI_D(x5, xZR, 1); + SLL_D(x5, x5, x2); // mask = 1 << total_bit_offset + NOR(x5, x5, xZR); + AMAND_DB_W(x4, x5, x6); + IFX (X_CF) { + SRL_D(x4, x4, x2); + if (cpuext.lbt) { + X64_SET_EFLAGS(x4, X_CF); + } else { + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + } + } + break; + default: + DEFAULT; + } + break; + case 0xC1: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK XADD Gw, Ew"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; + BSTRPICK_D(x5, gd, 15, 0); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (cpuext.lam_bh) { + AMADD_DB_H(x1, x5, wback); + } else { + ANDI(x3, wback, 0b10); + BNEZ_MARK(x3); + // lower 16 bits + MARKLOCK; + LL_W(x1, wback, 0); + ADD_D(x4, x1, x5); + MV(x3, x1); + BSTRINS_D(x3, x4, 15, 0); + SC_W(x3, wback, 0); + BEQZ_MARKLOCK(x3); + B_MARK3_nocond; + MARK; + // upper 16 bits + XORI(wback, wback, 0b10); + MARK2; + LL_W(x1, wback, 0); + BSTRPICK_D(x3, x1, 15, 0); + SRLI_W(x1, x1, 16); + ADD_D(x4, x1, x5); + BSTRINS_D(x3, x4, 31, 15); + SC_W(x3, wback, 0); + BEQZ_MARK2(x3); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) { + BSTRPICK_D(x6, x1, 15, 0); + emit_add16(dyn, ninst, x6, gd, x3, x4, x5); + } + BSTRINS_D(gd, x1, 15, 0); + } + break; + default: + DEFAULT; + } + break; + case 0x81: + case 0x83: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 0: // ADD + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + if (opcode == 0x81) { + INST_NAME("LOCK ADD Ew, Iw"); + } else { + INST_NAME("LOCK ADD Ew, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; + MOV64x(x5, u64); + + if (cpuext.lam_bh) { + AMADD_DB_H(x1, x5, wback); + } else { + ANDI(x3, wback, 0b10); + BNEZ_MARK(x3); + // lower 16 bits + MARKLOCK; + LL_W(x1, wback, 0); + ADD_D(x4, x1, x5); + MV(x3, x1); + BSTRINS_D(x3, x4, 15, 0); + SC_W(x3, wback, 0); + BEQZ_MARKLOCK(x3); + B_MARK3_nocond; + MARK; + // upper 16 bits + XORI(wback, wback, 0b10); + MARK2; + LL_W(x1, wback, 0); + BSTRPICK_D(x3, x1, 15, 0); + SRLI_W(x1, x1, 16); + ADD_D(x4, x1, x5); + BSTRINS_D(x3, x4, 31, 15); + SC_W(x3, wback, 0); + BEQZ_MARK2(x3); + MARK3; + } + // final + IFXORNAT (X_ALL | X_PEND) { + BSTRPICK_D(x6, x1, 15, 0); + emit_add16(dyn, ninst, x6, x5, x3, x4, x7); + } + } + break; + default: + DEFAULT; + } + break; + case 0xFF: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 0: + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK INC Ew"); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (cpuext.lam_bh) { + ADDI_D(x5, xZR, 1); + AMADD_DB_H(x1, x5, wback); + } else { + ANDI(x3, wback, 0b10); + BNEZ_MARK(x3); + // lower 16 bits + MARKLOCK; + LL_W(x1, wback, 0); + ADDI_D(x4, x1, 1); + MV(x3, x1); + BSTRINS_D(x3, x4, 15, 0); + SC_W(x3, wback, 0); + BEQZ_MARKLOCK(x3); + B_MARK3_nocond; + MARK; + // upper 16 bits + XORI(wback, wback, 0b10); + MARK2; + LL_W(x1, wback, 0); + BSTRPICK_D(x3, x1, 15, 0); + SRLI_W(x1, x1, 16); + ADDI_D(x4, x1, 1); + BSTRINS_D(x3, x4, 31, 15); + SC_W(x3, wback, 0); + BEQZ_MARK2(x3); + MARK3; + } + // final + IFXORNAT (X_ALL | X_PEND) { + if (!cpuext.lam_bh) ADDI_D(x5, xZR, 1); + BSTRPICK_D(x6, x1, 15, 0); + emit_inc16(dyn, ninst, x6, x5, x3, x4); + } + } + break; + case 1: + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK DEC Ew"); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (cpuext.lam_bh) { + ADDI_D(x5, xZR, -1); + AMADD_DB_H(x1, x5, wback); + } else { + ANDI(x3, wback, 0b10); + BNEZ_MARK(x3); + // lower 16 bits + MARKLOCK; + LL_W(x1, wback, 0); + ADDI_D(x4, x1, -1); + MV(x3, x1); + BSTRINS_D(x3, x4, 15, 0); + SC_W(x3, wback, 0); + BEQZ_MARKLOCK(x3); + B_MARK3_nocond; + MARK; + // upper 16 bits + XORI(wback, wback, 0b10); + MARK2; + LL_W(x1, wback, 0); + BSTRPICK_D(x3, x1, 15, 0); + SRLI_W(x1, x1, 16); + ADDI_D(x4, x1, -1); + BSTRINS_D(x3, x4, 31, 15); + SC_W(x3, wback, 0); + BEQZ_MARK2(x3); + MARK3; + } + // final + IFXORNAT (X_ALL | X_PEND) { + if (!cpuext.lam_bh) ADDI_D(x5, xZR, -1); + BSTRPICK_D(x6, x1, 15, 0); + emit_dec16(dyn, ninst, x6, x5, x3, x4, x7); + } + } + break; + default: + DEFAULT; + } + break; + + default: + DEFAULT; + } + + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_66f20f.c b/src/dynarec/la64/dynarec_la64_66f20f.c new file mode 100644 index 0000000..5e4c5b1 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_66f20f.c @@ -0,0 +1,71 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "la64_emitter.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_66F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8, s8; + int32_t i32; + uint8_t gd, ed; + uint8_t wback, wb1, wb2, gback; + uint8_t eb1, eb2; + int64_t j64; + uint64_t tmp64u, tmp64u2; + int v0, v1; + int q0, q1; + int d0, d1; + int64_t fixedaddress, gdoffset; + int unscaled; + + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(j64); + + switch (opcode) { + case 0x38: // these are some more SSSE4.2+ opcodes + opcode = F8; + switch (opcode) { + case 0xF1: + if (rex.w) return dynarec64_F20F(dyn, addr - 2, ip, ninst, rex, ok, need_epilog); + INST_NAME("CRC32 Gd, Ew"); + nextop = F8; + GETEW(x1, 0); + GETGD; + CRCC_W_H_W(gd, gd, ed); + ZEROUP(gd); + break; + default: + DEFAULT; + } + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_66f30f.c b/src/dynarec/la64/dynarec_la64_66f30f.c new file mode 100644 index 0000000..7f47ee6 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_66f30f.c @@ -0,0 +1,125 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_66F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8, s8; + int32_t i32; + uint8_t gd, ed; + uint8_t wback, wb1, wb2, gback; + uint8_t eb1, eb2; + int64_t j64; + uint64_t tmp64u, tmp64u2; + int v0, v1; + int q0, q1; + int d0, d1; + int64_t fixedaddress, gdoffset; + int unscaled; + + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(j64); + + switch (opcode) { + case 0xB8: + INST_NAME("POPCNT Gw, Ew"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGD; + GETEW(x4, 0); + v0 = fpu_get_scratch(dyn); + VINSGR2VR_H(v0, ed, 0); + VPCNT_H(v0, v0); + VPICKVE2GR_HU(x2, v0, 0); + BSTRINS_D(gd, x2, 15, 0); + IFX (X_ALL) { + CLEAR_FLAGS(x5); + BNEZ_MARK(x2); + ORI(xFlags, xFlags, 1 << F_ZF); + MARK; + SPILL_EFLAGS(); + } + break; + case 0xBC: + INST_NAME("TZCNT Gw, Ew"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_CF | X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } + SET_DFNONE(); + nextop = F8; + GETEW(x1, 0); + GETGW(x2); + CLEAR_FLAGS(x2); + IFX (X_CF) { + SEQZ(x3, ed); + BSTRINS_D(xFlags, x3, F_CF, F_CF); + } + ADDI_D(x4, xZR, -1); + BSTRINS_D(x4, ed, 15, 0); + CTZ_W(gd, x4); + IFX (X_ZF) { + SEQZ(x3, gd); + BSTRINS_D(xFlags, x3, F_ZF, F_ZF); + } + SPILL_EFLAGS(); + GWBACK; + break; + case 0xBD: + INST_NAME("LZCNT Gw, Ew"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_CF | X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } + SET_DFNONE(); + nextop = F8; + GETEW(x1, 0); + GETGW(x2); + CLEAR_FLAGS(x2); + IFX (X_CF) { + SEQZ(x3, ed); + BSTRINS_D(xFlags, x3, F_CF, F_CF); + } + CLZ_W(gd, ed); + ADDI_D(gd, gd, -16); + IFX (X_ZF) { + SEQZ(x3, gd); + BSTRINS_D(xFlags, x3, F_ZF, F_ZF); + } + SPILL_EFLAGS(); + GWBACK; + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_67.c b/src/dynarec/la64/dynarec_la64_67.c deleted file mode 100644 index 242d315..0000000 --- a/src/dynarec/la64/dynarec_la64_67.c +++ /dev/null @@ -1,142 +0,0 @@ -#include -#include -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "la64_emitter.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" - -#include "la64_printer.h" -#include "dynarec_la64_private.h" -#include "dynarec_la64_helper.h" -#include "dynarec_la64_functions.h" - -uintptr_t dynarec64_67(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) -{ - (void)ip; (void)need_epilog; - - uint8_t opcode = F8; - uint8_t nextop; - uint8_t gd, ed, wback, wb, wb1, wb2, gb1, gb2, eb1, eb2; - int64_t fixedaddress; - int unscaled; - int8_t i8; - uint8_t u8; - int32_t i32; - int64_t j64, i64; - int cacheupd = 0; - int lock; - int v0, v1, s0; - MAYUSE(i32); - MAYUSE(j64); - MAYUSE(v0); - MAYUSE(v1); - MAYUSE(s0); - MAYUSE(lock); - MAYUSE(cacheupd); - - if(rex.is32bits) { - // should do a different file - DEFAULT; - return addr; - } - - GETREX(); - - rep = 0; - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - switch(opcode) { - case 0x88: - INST_NAME("MOV Eb, Gb"); - nextop = F8; - gd = ((nextop & 0x38) >> 3) + (rex.r << 3); - if (rex.rex) { - gb2 = 0; - gb1 = TO_LA64(gd); - } else { - gb2 = ((gd & 4) << 1); - gb1 = TO_LA64(gd & 3); - } - if (gb2) { - gd = x4; - BSTRPICK_D(gd, gb1, gb2 + 7, gb2); - } else { - gd = gb1; // no need to extract - } - if (MODREG) { - ed = (nextop & 7) + (rex.b << 3); - if (rex.rex) { - eb1 = TO_LA64(ed); - eb2 = 0; - } else { - eb1 = TO_LA64(ed & 3); // Ax, Cx, Dx or Bx - eb2 = ((ed & 4) >> 2); // L or H - } - BSTRINS_D(eb1, gd, eb2 * 8 + 7, eb2 * 8); - } else { - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); - ST_B(gb1, ed, fixedaddress); - SMWRITELOCK(lock); - } - break; - case 0x89: - INST_NAME("MOV Ed, Gd"); - nextop = F8; - GETGD; - if (MODREG) { // reg <= reg - MVxw(TO_LA64((nextop & 7) + (rex.b << 3)), gd); - } else { // mem <= reg - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); - SDxw(gd, ed, fixedaddress); - SMWRITELOCK(lock); - } - break; - case 0xF7: - nextop = F8; - switch ((nextop >> 3) & 7) { - case 4: - INST_NAME("MUL EAX, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - GETED32(0); - if (rex.w) { - if (ed == xRDX) - gd = x3; - else - gd = xRDX; - MULH_DU(gd, xRAX, ed); - MUL_D(xRAX, xRAX, ed); - if (gd != xRDX) MV(xRDX, gd); - } else { - MUL_D(xRDX, xRAX, ed); // 64 <- 32x32 - AND(xRAX, xRDX, xMASK); - SRLI_W(xRDX, xRDX, 32); - } - UFLAG_RES(xRAX); - UFLAG_OP1(xRDX); - UFLAG_DF(x2, rex.w ? d_mul64 : d_mul32); - break; - default: - DEFAULT; - } - break; - default: - DEFAULT; - } - return addr; -} diff --git a/src/dynarec/la64/dynarec_la64_avx.c b/src/dynarec/la64/dynarec_la64_avx.c new file mode 100644 index 0000000..6d24e3e --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_avx.c @@ -0,0 +1,82 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "dynarec_la64_helper.h" + +static const char* avx_prefix_string(uint16_t p) +{ + switch (p) { + case VEX_P_NONE: return "0"; + case VEX_P_66: return "66"; + case VEX_P_F2: return "F2"; + case VEX_P_F3: return "F3"; + default: return "??"; + } +} +static const char* avx_map_string(uint16_t m) +{ + switch (m) { + case VEX_M_NONE: return "0"; + case VEX_M_0F: return "0F"; + case VEX_M_0F38: return "0F38"; + case VEX_M_0F3A: return "0F3A"; + default: return "??"; + } +} + +uintptr_t dynarec64_AVX(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = PK(0); + rex_t rex = vex.rex; + + if (!cpuext.lasx) { + DEFAULT; + } else if ((vex.m == VEX_M_0F) && (vex.p == VEX_P_NONE)) + addr = dynarec64_AVX_0F(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if ((vex.m == VEX_M_0F38) && (vex.p == VEX_P_NONE)) + addr = dynarec64_AVX_0F38(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if ((vex.m == VEX_M_0F) && (vex.p == VEX_P_66)) + addr = dynarec64_AVX_66_0F(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if ((vex.m == VEX_M_0F) && (vex.p == VEX_P_F2)) + addr = dynarec64_AVX_F2_0F(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if ((vex.m == VEX_M_0F) && (vex.p == VEX_P_F3)) + addr = dynarec64_AVX_F3_0F(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if ((vex.m == VEX_M_0F38) && (vex.p == VEX_P_66)) + addr = dynarec64_AVX_66_0F38(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if ((vex.m == VEX_M_0F3A) && (vex.p == VEX_P_66)) + addr = dynarec64_AVX_66_0F3A(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if( (vex.m == VEX_M_0F38) && (vex.p == VEX_P_F2)) + addr = dynarec64_AVX_F2_0F38(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if ((vex.m == VEX_M_0F3A) && (vex.p == VEX_P_F2)) + addr = dynarec64_AVX_F2_0F3A(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if( (vex.m==VEX_M_0F38) && (vex.p==VEX_P_F3)) + addr = dynarec64_AVX_F3_0F38(dyn, addr, ip, ninst, vex, ok, need_epilog); + else { + DEFAULT; + } + + if ((*ok == -1) && (BOX64ENV(dynarec_log) >= LOG_INFO || dyn->need_dump || BOX64ENV(dynarec_missing))) + if (!dyn->size || BOX64ENV(dynarec_log) > LOG_INFO || dyn->need_dump) { + dynarec_log(LOG_NONE, " Dynarec unimplemented VEX opcode size %d prefix %s map %s opcode %02X\n", 128 << vex.l, avx_prefix_string(vex.p), avx_map_string(vex.m), opcode); + } + return addr; +} \ No newline at end of file diff --git a/src/dynarec/la64/dynarec_la64_avx_0f.c b/src/dynarec/la64/dynarec_la64_avx_0f.c new file mode 100644 index 0000000..effe955 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_avx_0f.c @@ -0,0 +1,615 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "env.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed; + uint8_t wback, wb1, wb2; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u; + int64_t j64; + int64_t fixedaddress; + int unscaled; + MAYUSE(wb1); + MAYUSE(wb2); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(gb1); + MAYUSE(gb2); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(s0); + MAYUSE(j64); + MAYUSE(cacheupd); + + rex_t rex = vex.rex; + + switch (opcode) { + case 0x10: + INST_NAME("VMOVUPS Gx, Ex"); + nextop = F8; + if (MODREG) { + GETGY_empty_EY_xy(q0, q1, 0); + if (vex.l) { + XVOR_V(q0, q1, q1); + } else { + VOR_V(q0, q1, q1); + } + } else { + GETGYxy_empty(q0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVLD(q0, ed, fixedaddress); + } else { + VLD(q0, ed, fixedaddress); + } + } + break; + case 0x11: + INST_NAME("VMOVUPS Ex, Gx"); + nextop = F8; + GETGYxy(q0, 0); + if (MODREG) { + GETEYxy_empty(q1, 0); + if (vex.l) { + XVOR_V(q1, q0, q0); + } else { + VOR_V(q1, q0, q0); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVST(q0, ed, fixedaddress); + } else { + VST(q0, ed, fixedaddress); + } + SMWRITE2(); + } + break; + case 0x12: + nextop = F8; + GETVYx(v1, 0); + if (MODREG) { + INST_NAME("VMOVHLPS Gx, Vx, Ex"); + GETEYx(v2, 0, 0); + GETGYx_empty(v0); + VEXTRINS_D(v0, v2, VEXTRINS_IMM_4_0(0, 1)); + VEXTRINS_D(v0, v1, VEXTRINS_IMM_4_0(1, 1)); + } else { + INST_NAME("VMOVLPS Gx, Vx, Ex"); + GETEYSD(v2, 0, 0); + GETGYx_empty(v0); + VEXTRINS_D(v0, v2, VEXTRINS_IMM_4_0(0, 0)); + VEXTRINS_D(v0, v1, VEXTRINS_IMM_4_0(1, 1)); + } + break; + case 0x13: + nextop = F8; + INST_NAME("VMOVLPS Ex, Gx"); + GETGYx(v0, 0); + if (MODREG) { + DEFAULT; + return addr; + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + FST_D(v0, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0x14: + INST_NAME("VUNPCKLPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VILVLxy(W, v0, v2, v1); + break; + case 0x15: + INST_NAME("VUNPCKHPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VILVHxy(W, v0, v2, v1); + break; + case 0x16: + nextop = F8; + GETVYx(v1, 0); + if (MODREG) { + INST_NAME("VMOVLHPS Gx, Vx, Ex"); + GETEYx(v2, 0, 0); + GETGYx_empty(v0); + VEXTRINS_D(v0, v2, VEXTRINS_IMM_4_0(1, 0)); + VEXTRINS_D(v0, v1, VEXTRINS_IMM_4_0(0, 0)); + } else { + INST_NAME("VMOVHPS Gx, Vx, Ex"); + GETEYSD(v2, 0, 0); + GETGYx_empty(v0); + VEXTRINS_D(v0, v2, VEXTRINS_IMM_4_0(1, 0)); + VEXTRINS_D(v0, v1, VEXTRINS_IMM_4_0(0, 0)); + } + break; + case 0x17: + nextop = F8; + INST_NAME("VMOVHPS Ex, Gx"); + GETGYx(v0, 0); + if (MODREG) { + DEFAULT; + return addr; + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 0, 0); + VSTELM_D(v0, ed, fixedaddress, 1); + SMWRITE2(); + } + break; + case 0x28: + INST_NAME("VMOVAPS Gx, Ex"); + nextop = F8; + if (MODREG) { + GETGY_empty_EY_xy(q0, q1, 0); + if (vex.l) { + XVOR_V(q0, q1, q1); + } else { + VOR_V(q0, q1, q1); + } + } else { + GETGYxy_empty(q0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVLD(q0, ed, fixedaddress); + } else { + VLD(q0, ed, fixedaddress); + } + } + break; + case 0x29: + INST_NAME("VMOVAPS Ex, Gx"); + nextop = F8; + GETGYxy(q0, 0); + if (MODREG) { + GETEYxy_empty(q1, 0); + if (vex.l) { + XVOR_V(q1, q0, q0); + } else { + VOR_V(q1, q0, q0); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVST(q0, ed, fixedaddress); + } else { + VST(q0, ed, fixedaddress); + } + SMWRITE2(); + } + break; + case 0x2B: + INST_NAME("VMOVNTPS Ex, Gx"); + nextop = F8; + GETGYxy(q0, 0); + if (MODREG) { + DEFAULT; + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVST(q0, ed, fixedaddress); + } else { + VST(q0, ed, fixedaddress); + } + SMWRITE2(); + } + break; + case 0x2E: + // no special check... + case 0x2F: + if (opcode == 0x2F) { + INST_NAME("VCOMISS Gx, Ex"); + } else { + INST_NAME("VUCOMISS Gx, Ex"); + } + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGYx(d0, 0); + GETEYSS(v0, 0, 0); + CLEAR_FLAGS(x2); + // if isnan(d0) || isnan(v0) + IFX (X_ZF | X_PF | X_CF) { + FCMP_S(fcc0, d0, v0, cUN); + BCEQZ_MARK(fcc0); + ORI(xFlags, xFlags, (1 << F_ZF) | (1 << F_PF) | (1 << F_CF)); + B_MARK3_nocond; + } + MARK; + // else if isless(d0, v0) + IFX (X_CF) { + FCMP_S(fcc1, d0, v0, cLT); + BCEQZ_MARK2(fcc1); + ORI(xFlags, xFlags, 1 << F_CF); + B_MARK3_nocond; + } + MARK2; + // else if d0 == v0 + IFX (X_ZF) { + FCMP_S(fcc2, d0, v0, cEQ); + BCEQZ_MARK3(fcc2); + ORI(xFlags, xFlags, 1 << F_ZF); + } + MARK3; + IFX (X_ALL) { + SPILL_EFLAGS(); + } + break; + case 0x50: + nextop = F8; + INST_NAME("VMOVMSKPS Gd, Ex"); + GETEYxy(v0, 0, 0); + GETGD; + d1 = fpu_get_scratch(dyn); + if (vex.l) { + XVMSKLTZ_W(d1, v0); + XVPICKVE2GR_DU(gd, d1, 0); + XVPICKVE2GR_DU(x4, d1, 2); + BSTRINS_D(gd, x4, 7, 4); + } else { + VMSKLTZ_W(d1, v0); + VPICKVE2GR_DU(gd, d1, 0); + } + break; + case 0x51: + INST_NAME("VSQRTPS Gx, Ex"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(S, d0, v1, v1, cEQ); + VFSQRTxy(S, v0, v1); + VFCMPxy(S, d1, v0, v0, cEQ); + VANDN_Vxy(d1, d1, d0); + VSLLIxy(W, d1, d1, 31); + VOR_Vxy(v0, v0, d1); + } else { + VFSQRTxy(S, v0, v1); + } + break; + case 0x52: + INST_NAME("VRSQRTPS Gx, Ex"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 0); + if (cpuext.frecipe) { + VFRSQRTExy(S, v0, v1); + } else { + VFRSQRTxy(S, v0, v1); + } + break; + case 0x53: + INST_NAME("VRCPPS Gx, Ex"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 0); + if (cpuext.frecipe) { + VFRECIPExy(S, v0, v1); + } else { + VFRECIPxy(S, v0, v1); + } + break; + case 0x54: + INST_NAME("VANDPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VAND_Vxy(v0, v1, v2); + break; + case 0x55: + INST_NAME("VANDNPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VANDN_Vxy(v0, v1, v2); + break; + case 0x56: + INST_NAME("VORPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VOR_Vxy(v0, v1, v2); + break; + case 0x57: + INST_NAME("VXORPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VXOR_Vxy(v0, v1, v2); + break; + case 0x58: + INST_NAME("VADDPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(S, d0, v1, v2, cUN); + } + VFADDxy(S, v0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(S, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b010 << 9) | 0b1111111100); + VSLLIxy(W, d1, d1, 20); // broadcast 0xFFC00000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0x59: + INST_NAME("VMULPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(S, d0, v1, v2, cUN); + } + VFMULxy(S, v0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(S, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b010 << 9) | 0b1111111100); + VSLLIxy(W, d1, d1, 20); // broadcast 0xFFC00000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0x5A: + INST_NAME("VCVTPS2PD Gx, Ex"); + nextop = F8; + if(vex.l){ + GETEYx(v1, 0 ,0); + } else { + GETEYSD(v1, 0, 0); + } + GETGYxy_empty(v0); + if(!BOX64ENV(dynarec_fastround)) { + u8 = sse_setround(dyn, ninst, x6, x4); + } + d0 = fpu_get_scratch(dyn); + if(vex.l) { + XVFCVTH_D_S(d0, v1); + XVFCVTL_D_S(v0, v1); + XVPERMI_Q(v0, d0, XVPERMI_IMM_4_0(0, 2)); + } else { + VFCVTL_D_S(v0, v1); + } + if(!BOX64ENV(dynarec_fastround)) { + x87_restoreround(dyn, ninst, u8); + } + break; + case 0x5B: + INST_NAME("VCVTDQ2PS Gx, Ex"); + nextop = F8; + GETEYxy(v1, 0, 0); + GETGYxy_empty(v0); + if(vex.l){ + XVFFINT_S_W(v0, v1); + }else{ + VFFINT_S_W(v0, v1); + } + break; + case 0x5C: + INST_NAME("VSUBPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(S, d0, v1, v2, cUN); + } + VFSUBxy(S, v0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(S, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b010 << 9) | 0b1111111100); + VSLLIxy(W, d1, d1, 20); // broadcast 0xFFC00000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0x5D: + INST_NAME("VMINPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VFCMPxy(S, q0, v2, v1, cULE); + VBITSEL_Vxy(v0, v1, v2, q0); + break; + case 0x5E: + INST_NAME("VDIVPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(S, d0, v1, v2, cUN); + } + VFDIVxy(S, v0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(S, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b010 << 9) | 0b1111111100); + VSLLIxy(W, d1, d1, 20); // broadcast 0xFFC00000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0x5F: + INST_NAME("VMAXPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VFCMPxy(S, q0, v2, v1, cLT); + VBITSEL_Vxy(v0, v2, v1, q0); + break; + case 0x77: + if (!vex.l) { + INST_NAME("VZEROUPPER"); + if (vex.v != 0) { + UDF(); + } else { + q2 = fpu_get_scratch(dyn); + XVXOR_V(q2, q2, q2); + for (int i = 0; i < (rex.is32bits ? 8 : 16); ++i) { + if (dyn->lsx.avxcache[i].v != -1) { + // avx used register + if (dyn->lsx.avxcache[i].width == LSX_AVX_WIDTH_256) { + // 256 width, fill upper 128bits with zero. + q1 = avx_get_reg(dyn, ninst, x1, i, 1, LSX_AVX_WIDTH_256); // mark reg write (dirty) + XVPERMI_Q(q1, q2, XVPERMI_IMM_4_0(0, 2)); + } else { + // 128 width, lazy save. + q1 = avx_get_reg(dyn, ninst, x1, i, 1, LSX_AVX_WIDTH_128); // mark reg write (dirty) + dyn->lsx.avxcache[i].zero_upper = 1; + } + } else { + // SSE register or unused register, store 128bit zero to x64emu_t.ymm[] + VST(q2, xEmu, offsetof(x64emu_t, ymm[i])); + } + } + SMWRITE2(); + } + } else { + INST_NAME("VZEROALL"); + if (vex.v != 0) { + UDF(); + } else { + for (int i = 0; i < (rex.is32bits ? 8 : 16); ++i) { + q0 = avx_get_reg_empty(dyn, ninst, x1, i, LSX_AVX_WIDTH_256); + XVXOR_V(q0, q0, q0); + } + } + } + break; + case 0xAE: + nextop = F8; + if (MODREG) { + DEFAULT; + } else + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("VLDMXCSR Md"); + GETED(0); + ST_W(ed, xEmu, offsetof(x64emu_t, mxcsr)); + if (BOX64ENV(sse_flushto0)) { + /* LA <-> x86 + 16/24 <-> 5 inexact + 17/25 <-> 4 underflow + 18/26 <-> 3 overflow + 19/27 <-> 2 divide by zero + x <-> 1 denormal + 20/28 <-> 0 invalid operation + */ + // Doing x86 -> LA here, ignore denormal + XOR(x4, x4, x4); + BSTRPICK_W(x3, ed, 5, 5); + BSTRINS_W(x4, x3, 16, 16); + BSTRPICK_W(x3, ed, 4, 4); + BSTRINS_W(x4, x3, 17, 17); + BSTRPICK_W(x3, ed, 3, 3); + BSTRINS_W(x4, x3, 18, 18); + BSTRPICK_W(x3, ed, 2, 2); + BSTRINS_W(x4, x3, 19, 19); + BSTRPICK_W(x3, ed, 0, 0); + BSTRINS_W(x4, x3, 20, 20); + MOVGR2FCSR(FCSR2, x4); + } + break; + case 3: + INST_NAME("VSTMXCSR Md"); + addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, NULL, 0, 0); + LD_WU(x4, xEmu, offsetof(x64emu_t, mxcsr)); + if (BOX64ENV(sse_flushto0)) { + MOVFCSR2GR(x5, FCSR2); + // Doing LA -> x86 here, ignore denormal + BSTRPICK_W(x3, x5, 16, 16); + BSTRINS_W(x4, x3, 5, 5); + BSTRPICK_W(x3, x5, 17, 17); + BSTRINS_W(x4, x3, 4, 4); + BSTRPICK_W(x3, x5, 18, 18); + BSTRINS_W(x4, x3, 3, 3); + BSTRPICK_W(x3, x5, 19, 19); + BSTRINS_W(x4, x3, 2, 2); + BSTRPICK_W(x3, x5, 20, 20); + BSTRINS_W(x4, x3, 0, 0); + } + ST_W(x4, wback, fixedaddress); + break; + default: + DEFAULT; + } + break; + case 0xC2: + INST_NAME("VCMPPS Gx, Vx, Ex, Ib"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8; + switch (u8 & 0xf) { + case 0x00: VFCMPxy(S, v0, v1, v2, cEQ); break; // Equal, not unordered + case 0x01: VFCMPxy(S, v0, v1, v2, cLT); break; // Less than + case 0x02: VFCMPxy(S, v0, v1, v2, cLE); break; // Less or equal + case 0x03: VFCMPxy(S, v0, v1, v2, cUN); break; // unordered + case 0x04: VFCMPxy(S, v0, v1, v2, cUNE); break; // Not Equal (or unordered on ARM, not on X86...) + case 0x05: VFCMPxy(S, v0, v2, v1, cULE); break; // Greater or equal or unordered + case 0x06: VFCMPxy(S, v0, v2, v1, cULT); break; // Greater or unordered + case 0x07: VFCMPxy(S, v0, v1, v2, cOR); break; // Greater or unordered + case 0x08: VFCMPxy(S, v0, v1, v2, cUEQ); break; // Equal, or unordered + case 0x09: VFCMPxy(S, v0, v1, v2, cULT); break; // Less than or unordered + case 0x0a: VFCMPxy(S, v0, v1, v2, cULE); break; // Less or equal or unordered + case 0x0b: XVXOR_V(v0, v0, v0); break; // false + case 0x0c: VFCMPxy(S, v0, v1, v2, cNE); break; // Not Eual, ordered + case 0x0d: VFCMPxy(S, v0, v2, v1, cLE); break; // Greater or Equal ordered + case 0x0e: VFCMPxy(S, v0, v2, v1, cLT); break; // Greater ordered + case 0x0f: VSEQxy(B, v0, v1, v1); break; // true + } + break; + case 0xC6: + INST_NAME("VSHUFPS Gx, Vx, Ex, Ib"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + if (v1 == v2) { + VSHUF4Ixy(W, v0, v1, u8); + } else { + VSHUF4Ixy(W, d0, v1, u8); + VSHUF4Ixy(W, d1, v2, u8 >> 4); + VPICKEVxy(D, v0, d1, d0); + } + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_avx_0f38.c b/src/dynarec/la64/dynarec_la64_avx_0f38.c new file mode 100644 index 0000000..7941abf --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_avx_0f38.c @@ -0,0 +1,235 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "env.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_0F38(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u; + int64_t j64; + int64_t fixedaddress; + int unscaled; + MAYUSE(wb1); + MAYUSE(wb2); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(gb1); + MAYUSE(gb2); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(s0); + MAYUSE(j64); + MAYUSE(cacheupd); + + rex_t rex = vex.rex; + + switch (opcode) { + case 0xF2: + INST_NAME("ANDN Gd, Vd, Ed"); + nextop = F8; + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETGD; + GETED(0); + GETVD; + ANDN(gd, ed, vd); + if (!rex.w) { + BSTRPICK_D(gd, gd, 31, 0); + } + CLEAR_FLAGS(x6); + IFX (X_SF) { + SRLI_D(x6, gd, rex.w ? 63 : 31); + SLLI_D(x6, x6, F_SF); + OR(xFlags, xFlags, x6); + } + IFX (X_ZF) { + BNEZ(gd, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + SPILL_EFLAGS(); + break; + case 0xF3: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 1: + INST_NAME("BLSR Vd, Ed"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETED(0); + GETVD; + CLEAR_FLAGS(x6); + IFX (X_CF) { + BNEZ(ed, 8); + ORI(xFlags, xFlags, 1 << F_CF); + } + ADDIxw(x3, ed, -1); + AND(vd, ed, x3); + if (!rex.w) { + BSTRPICK_D(vd, vd, 31, 0); + } + IFX (X_ZF) { + BNEZ(vd, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_SF) { + BSTRPICK_D(x5, vd, rex.w ? 63 : 31, rex.w ? 63 : 31); + SLLI_D(x5, x5, F_SF); + OR(xFlags, xFlags, x5); + } + SPILL_EFLAGS(); + break; + case 2: + INST_NAME("BLSMSK Vd, Ed"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETED(0); + GETVD; + CLEAR_FLAGS(x6); + IFX (X_CF) { + BNEZ(ed, 8); + ORI(xFlags, xFlags, 1 << F_CF); + } + ADDIxw(x3, ed, -1); + XOR(vd, ed, x3); + if (!rex.w) { + BSTRPICK_D(vd, vd, 31, 0); + } + IFX (X_SF) { + BSTRPICK_D(x5, vd, rex.w ? 63 : 31, rex.w ? 63 : 31); + SLLI_D(x5, x5, F_SF); + OR(xFlags, xFlags, x5); + } + SPILL_EFLAGS(); + break; + case 3: + INST_NAME("BLSI Vd, Ed"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETED(0); + GETVD; + CLEAR_FLAGS(x6); + IFX (X_CF) { + BEQZ(ed, 8); + ORI(xFlags, xFlags, 1 << F_CF); + } + SUBxw(x3, xZR, ed); + AND(vd, ed, x3); + if (!rex.w) { + BSTRPICK_D(vd, vd, 31, 0); + } + IFX (X_ZF) { + BNEZ(vd, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_SF) { + BSTRPICK_D(x5, vd, rex.w ? 63 : 31, rex.w ? 63 : 31); + SLLI_D(x5, x5, F_SF); + OR(xFlags, xFlags, x5); + } + SPILL_EFLAGS(); + break; + default: + DEFAULT; + } + break; + + case 0xF5: + INST_NAME("BZHI Gd, Ed, Vd"); + nextop = F8; + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETGD; + GETED(0); + GETVD; + CLEAR_FLAGS(x6); + BSTRPICK_D(x4, vd, 7, 0); + MOV64x(x5, rex.w ? 64 : 32); + BGE_MARK(x4, x5); + ADDI_D(x6, xZR, -1); + SLL_D(x6, x6, x4); + ANDN(gd, ed, x6); + B_MARK2_nocond; + MARK; + OR(gd, ed, ed); + IFX (X_CF) { + ORI(xFlags, xFlags, 1 << F_CF); + } + MARK2; + if (!rex.w) { + BSTRPICK_D(gd, gd, 31, 0); + } + IFX (X_ZF) { + BNEZ(gd, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_SF) { + BSTRPICK_D(x5, gd, rex.w ? 63 : 31, rex.w ? 63 : 31); + SLLI_D(x5, x5, F_SF); + OR(xFlags, xFlags, x5); + } + SPILL_EFLAGS(); + break; + + case 0xF7: + INST_NAME("BEXTR Gd, Vd, Ed"); + nextop = F8; + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETGD; + GETED(0); + GETVD; + BSTRPICK_D(x4, vd, 7, 0); // start + BSTRPICK_D(x3, vd, 15, 8); // length + XOR(x5, x5, x5); + BEQZ_MARK(x3); + MOV64xw(x6, rex.w ? 64 : 32); + BGE_MARK(x4, x6); + SRLxw(x5, ed, x4); + BLT_MARK(x6, x3); + SUBxw(x6, x6, x3); + SLLxw(x5, x5, x6); + SRLxw(x5, x5, x6); + MARK; + OR(gd, x5, x5); + if (!rex.w) { + BSTRPICK_D(gd, gd, 31, 0); + } + CLEAR_FLAGS(x6); + IFX (X_ZF) { + BNEZ(gd, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + SPILL_EFLAGS(); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_avx_66_0f.c b/src/dynarec/la64/dynarec_la64_avx_66_0f.c new file mode 100644 index 0000000..1151641 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_avx_66_0f.c @@ -0,0 +1,1355 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "env.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_66_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed; + uint8_t wback, wb1, wb2; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u; + int64_t j64; + int64_t fixedaddress; + int unscaled; + MAYUSE(wb1); + MAYUSE(wb2); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(gb1); + MAYUSE(gb2); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(s0); + MAYUSE(j64); + MAYUSE(cacheupd); + + rex_t rex = vex.rex; + + switch (opcode) { + case 0x10: + INST_NAME("VMOVUPD Gx, Ex"); + nextop = F8; + if (MODREG) { + GETGY_empty_EY_xy(q0, q1, 0); + if (vex.l) { + XVOR_V(q0, q1, q1); + } else { + VOR_V(q0, q1, q1); + } + } else { + GETGYxy_empty(q0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVLD(q0, ed, fixedaddress); + } else { + VLD(q0, ed, fixedaddress); + } + } + break; + case 0x11: + INST_NAME("VMOVUPD Ex, Gx"); + nextop = F8; + GETGYxy(q0, 0); + if (MODREG) { + GETEYxy_empty(q1, 0); + if (vex.l) { + XVOR_V(q1, q0, q0); + } else { + VOR_V(q1, q0, q0); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVST(q0, ed, fixedaddress); + } else { + VST(q0, ed, fixedaddress); + } + SMWRITE2(); + } + break; + case 0x12: + INST_NAME("VMOVLPD Gx, Vx, Eq"); + nextop = F8; + if (MODREG) { + // access register instead of memory is bad opcode! + DEFAULT; + return addr; + } + GETVYx(v1, 0); + GETEYSD(v2, 0, 0); + GETGYx_empty(v0); + VEXTRINS_D(v0, v2, VEXTRINS_IMM_4_0(0, 0)); + VEXTRINS_D(v0, v1, VEXTRINS_IMM_4_0(1, 1)); + break; + case 0x13: + INST_NAME("VMOVLPD Eq, Gx"); + nextop = F8; + if (MODREG) { + // access register instead of memory is bad opcode! + DEFAULT; + return addr; + } + GETGYx(v0, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + FST_D(v0, ed, fixedaddress); + SMWRITE2(); + break; + case 0x14: + INST_NAME("VUNPCKLPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VILVLxy(D, v0, v2, v1); + break; + case 0x15: + INST_NAME("VUNPCKHPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VILVHxy(D, v0, v2, v1); + break; + case 0x16: + INST_NAME("VMOVHPD Gx, Vx, Eq"); + nextop = F8; + if (MODREG) { + // access register instead of memory is bad opcode! + DEFAULT; + return addr; + } + GETVYx(v1, 0); + GETEYSD(v2, 0, 0); + GETGYx_empty(v0); + VEXTRINS_D(v0, v2, VEXTRINS_IMM_4_0(1, 0)); + VEXTRINS_D(v0, v1, VEXTRINS_IMM_4_0(0, 0)); + break; + case 0x17: + INST_NAME("VMOVHPD Eq, Gx"); + nextop = F8; + if (MODREG) { + // access register instead of memory is bad opcode! + DEFAULT; + return addr; + } + GETGYx(v0, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 0, 0); + VSTELM_D(v0, ed, 0, 1); + SMWRITE2(); + break; + case 0x28: + INST_NAME("VMOVAPD Gx, Ex"); + nextop = F8; + if (MODREG) { + GETGY_empty_EY_xy(q0, q1, 0); + if (vex.l) { + XVOR_V(q0, q1, q1); + } else { + VOR_V(q0, q1, q1); + } + } else { + GETGYxy_empty(q0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVLD(q0, ed, fixedaddress); + } else { + VLD(q0, ed, fixedaddress); + } + } + break; + case 0x29: + INST_NAME("VMOVAPD Ex, Gx"); + nextop = F8; + GETGYxy(q0, 0); + if (MODREG) { + GETEYxy_empty(q1, 0); + if (vex.l) { + XVOR_V(q1, q0, q0); + } else { + VOR_V(q1, q0, q0); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVST(q0, ed, fixedaddress); + } else { + VST(q0, ed, fixedaddress); + } + SMWRITE2(); + } + break; + case 0x2B: + INST_NAME("VMOVNTPD Ex, Gx"); + nextop = F8; + GETGYxy(q0, 0); + if (MODREG) { + DEFAULT; + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVST(q0, ed, fixedaddress); + } else { + VST(q0, ed, fixedaddress); + } + SMWRITE2(); + } + break; + case 0x2E: + // no special check... + case 0x2F: + if (opcode == 0x2F) { + INST_NAME("VCOMISD Gx, Ex"); + } else { + INST_NAME("VUCOMISD Gx, Ex"); + } + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGYx(d0, 0); + GETEYSD(v0, 0, 0); + + CLEAR_FLAGS(x3); + // if isnan(d0) || isnan(v0) + IFX (X_ZF | X_PF | X_CF) { + FCMP_D(fcc0, d0, v0, cUN); + BCEQZ_MARK(fcc0); + ORI(xFlags, xFlags, (1 << F_ZF) | (1 << F_PF) | (1 << F_CF)); + B_MARK3_nocond; + } + MARK; + // else if isless(d0, v0) + IFX (X_CF) { + FCMP_D(fcc1, d0, v0, cLT); + BCEQZ_MARK2(fcc1); + ORI(xFlags, xFlags, 1 << F_CF); + B_MARK3_nocond; + } + MARK2; + // else if d0 == v0 + IFX (X_ZF) { + FCMP_D(fcc2, d0, v0, cEQ); + BCEQZ_MARK3(fcc2); + ORI(xFlags, xFlags, 1 << F_ZF); + } + MARK3; + SPILL_EFLAGS(); + break; + case 0x50: + nextop = F8; + INST_NAME("VMOVMSKPD Gd, Ex"); + GETEYxy(v0, 0, 0); + GETGD; + d1 = fpu_get_scratch(dyn); + if (vex.l) { + XVMSKLTZ_D(d1, v0); + XVPICKVE2GR_DU(gd, d1, 0); + XVPICKVE2GR_DU(x4, d1, 2); + BSTRINS_D(gd, x4, 3, 2); + } else { + VMSKLTZ_D(d1, v0); + VPICKVE2GR_DU(gd, d1, 0); + } + break; + case 0x51: + INST_NAME("VSQRTPD Gx, Ex"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(D, d0, v1, v1, cEQ); + VFSQRTxy(D, v0, v1); + VFCMPxy(D, d1, v0, v0, cEQ); + VANDN_Vxy(d1, d1, d0); + VSLLIxy(D, d1, d1, 63); + VOR_Vxy(v0, v0, d1); + } else { + VFSQRTxy(D, v0, v1); + } + break; + case 0x54: + INST_NAME("VANDPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VAND_Vxy(v0, v1, v2); + break; + case 0x55: + INST_NAME("VANDNPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VANDN_Vxy(v0, v1, v2); + break; + case 0x56: + INST_NAME("VORPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VOR_Vxy(v0, v1, v2); + break; + case 0x57: + INST_NAME("VXORPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VXOR_Vxy(v0, v1, v2); + break; + case 0x58: + INST_NAME("VADDPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(D, d0, v1, v2, cUN); + } + VFADDxy(D, v0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(D, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b011 << 9) | 0b111111000); + VSLLIxy(D, d1, d1, 48); // broadcast 0xfff8000000000000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0x59: + INST_NAME("VMULPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(D, d0, v1, v2, cUN); + } + VFMULxy(D, v0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(D, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b011 << 9) | 0b111111000); + VSLLIxy(D, d1, d1, 48); // broadcast 0xfff8000000000000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0x5A: + INST_NAME("VCVTPD2PS Gx, Ex"); + nextop = F8; + GETEYxy(v1, 0, 0); + GETGYx_empty(v0); + if(!BOX64ENV(dynarec_fastround)) { + u8 = sse_setround(dyn, ninst, x6, x4); + } + d0 = fpu_get_scratch(dyn); + if(vex.l) { + XVXOR_V(d0, d0, d0); + XVFCVT_S_D(v0, d0, v1); + XVPERMI_D(v0, v0, 0b11011000); + } else { + VFCVT_S_D(d0, v1, v1); + XVPICKVE_D(v0, d0, 0); + YMM_UNMARK_UPPER_ZERO(v0); + } + if(!BOX64ENV(dynarec_fastround)) { + x87_restoreround(dyn, ninst, u8); + } + break; + case 0x5B: + INST_NAME("VCVTPS2DQ Gx, Ex"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 0); + u8 = sse_setround(dyn, ninst, x6, x4); + if(vex.l){ + if (!BOX64ENV(dynarec_fastround)) { + d1 = fpu_get_scratch(dyn); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); // mask + d0 = fpu_get_scratch(dyn); + XVFTINT_W_S(d1, v1); + XVLDI(q0, 0b1001110000000); // broadcast 0x80000000 to all + XVLDI(d0, (0b10011 << 8) | 0x4f); + XVFCMP_S(q1, d0, v1, cULE); // get Nan,+overflow mark + XVBITSEL_V(v0, d1, q0, q1); + } else { + XVFTINT_W_S(v0, v1); + } + } else { + if (!BOX64ENV(dynarec_fastround)) { + d1 = fpu_get_scratch(dyn); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); // mask + d0 = fpu_get_scratch(dyn); + VFTINT_W_S(d1, v1); + VLDI(q0, 0b1001110000000); // broadcast 0x80000000 to all + VLDI(d0, (0b10011 << 8) | 0x4f); + VFCMP_S(q1, d0, v1, cULE); // get Nan,+overflow mark + VBITSEL_V(v0, d1, q0, q1); + } else { + VFTINT_W_S(v0, v1); + } + } + x87_restoreround(dyn, ninst, u8); + break; + case 0x5C: + INST_NAME("VSUBPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(D, d0, v1, v2, cUN); + } + VFSUBxy(D, v0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(D, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b011 << 9) | 0b111111000); + VSLLIxy(D, d1, d1, 48); // broadcast 0xfff8000000000000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0x5D: + INST_NAME("VMINPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VFCMPxy(D, q0, v2, v1, cULE); + VBITSEL_Vxy(v0, v1, v2, q0); + break; + case 0x5E: + INST_NAME("VDIVPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(D, d0, v1, v2, cUN); + } + VFDIVxy(D, v0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(D, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b011 << 9) | 0b111111000); + VSLLIxy(D, d1, d1, 48); // broadcast 0xfff8000000000000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0x5F: + INST_NAME("VMAXPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + if (BOX64ENV(dynarec_fastnan)) { + VFMAXxy(D, v0, v2, v1); + } else { + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VFCMPxy(D, q0, v2, v1, cLT); + VBITSEL_Vxy(v0, v2, v1, q0); + } + break; + case 0x60: + INST_NAME("VPUNPCKLBW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VILVLxy(B, v0, v2, v1); + break; + case 0x61: + INST_NAME("VPUNPCKLWD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VILVLxy(H, v0, v2, v1); + break; + case 0x62: + INST_NAME("VPUNPCKLDQ Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VILVLxy(W, v0, v2, v1); + break; + case 0x63: + INST_NAME("VPACKSSWB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + if (v1 == v2) { + VSATxy(H, v0, v1, 7); + VPICKEVxy(B, v0, v0, v0); + } else { + VSATxy(H, q0, v2, 7); + VSATxy(H, v0, v1, 7); + VPICKEVxy(B, v0, q0, v0); + } + break; + case 0x64: + INST_NAME("VPCMPGTB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSLTxy(B, v0, v2, v1); + break; + case 0x65: + INST_NAME("VPCMPGTW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSLTxy(H, v0, v2, v1); + break; + case 0x66: + INST_NAME("VPCMPGTD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSLTxy(W, v0, v2, v1); + break; + case 0x67: + INST_NAME("VPACKUSWB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + VLDIxy(q0, 0b0010011111111); // broadcast 0xff as 16-bit elements to all lanes + if (v1 == v2) { + VMAXIxy(H, d0, v1, 0); + VMINxy(H, d0, d0, q0); + VPICKEVxy(B, v0, d0, d0); + } else { + VMAXIxy(H, d0, v1, 0); + VMAXIxy(H, q1, v2, 0); + VMINxy(H, d0, d0, q0); + VMINxy(H, q1, q1, q0); + VPICKEVxy(B, v0, q1, d0); + } + break; + case 0x68: + INST_NAME("VPUNPCKHBW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VILVHxy(B, v0, v2, v1); + break; + case 0x69: + INST_NAME("VPUNPCKHWD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VILVHxy(H, v0, v2, v1); + break; + case 0x6A: + INST_NAME("VPUNPCKHDQ Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VILVHxy(W, v0, v2, v1); + break; + case 0x6B: + INST_NAME("VPACKSSDW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + if (v1 == v2) { + VSATxy(W, d0, v1, 15); + VPICKEVxy(H, v0, d0, d0); + } else { + VSATxy(W, d0, v1, 15); + VSATxy(W, q0, v2, 15); + VPICKEVxy(H, v0, q0, d0); + } + break; + case 0x6C: + INST_NAME("VPUNPCKLQDQ Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VILVLxy(D, v0, v2, v1); + break; + case 0x6D: + INST_NAME("VPUNPCKHQDQ Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VILVHxy(D, v0, v2, v1); + break; + case 0x6E: + INST_NAME("VMOVD Gx, Ed"); + nextop = F8; + GETED(0); + GETGYx_empty(q0); + XVXOR_V(q0, q0, q0); + if (rex.w) { + XVINSGR2VR_D(q0, ed, 0); + } else { + XVINSGR2VR_W(q0, ed, 0); + } + YMM_UNMARK_UPPER_ZERO(q0); + break; + case 0x6F: + INST_NAME("VMOVDQA Gx, Ex"); + nextop = F8; + if (MODREG) { + GETGY_empty_EY_xy(q0, q1, 0); + if (vex.l) { + XVOR_V(q0, q1, q1); + } else { + VOR_V(q0, q1, q1); + } + } else { + GETGYxy_empty(q0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVLD(q0, ed, fixedaddress); + } else { + VLD(q0, ed, fixedaddress); + } + } + break; + case 0x70: + INST_NAME("VPSHUFD Gx, Ex, Ib"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 1); + u8 = F8; + VSHUF4Ixy(W, v0, v1, u8); + break; + case 0x71: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("VPSRLW Vx, Ex, Ib"); + GETEYxy(v1, 0, 1); + GETVYxy_empty(v0); + u8 = F8; + if (u8 > 15) { + VXOR_Vxy(v0, v0, v0); + } else { + VSRLIxy(H, v0, v1, u8); + } + break; + case 4: + INST_NAME("VPSRAW Vx, Ex, Ib"); + GETEYxy(v1, 0, 1); + GETVYxy_empty(v0); + u8 = F8; + if (u8 > 15) u8 = 15; + if (u8) { + VSRAIxy(H, v0, v1, u8); + } else if (v0 != v1) { + VOR_Vxy(v0, v1, v1); + } + break; + case 6: + INST_NAME("VPSLLW Vx, Ex, Ib"); + GETEYxy(v1, 0, 1); + GETVYxy_empty(v0); + u8 = F8; + if (u8 > 15) { + VXOR_Vxy(v0, v0, v0); + } else { + VSLLIxy(H, v0, v1, u8); + } + break; + default: + *ok = 0; + DEFAULT; + } + break; + case 0x72: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("VPSRLD Vx, Ex, Ib"); + GETEYxy(v1, 0, 1); + GETVYxy_empty(v0); + u8 = F8; + if (u8 > 31) { + VXOR_Vxy(v0, v0, v0); + } else { + VSRLIxy(W, v0, v1, u8); + } + break; + case 4: + INST_NAME("VPSRAD Vx, Ex, Ib"); + GETEYxy(v1, 0, 1); + GETVYxy_empty(v0); + u8 = F8; + if (u8 > 31) u8 = 31; + if (u8) { + VSRAIxy(W, v0, v1, u8); + } else if (v0 != v1) { + VOR_Vxy(v0, v1, v1); + } + break; + case 6: + INST_NAME("VPSLLD Vx, Ex, Ib"); + GETEYxy(v1, 0, 1); + GETVYxy_empty(v0); + u8 = F8; + if (u8 > 31) { + VXOR_Vxy(v0, v0, v0); + } else { + VSLLIxy(W, v0, v1, u8); + } + break; + default: + DEFAULT; + } + break; + case 0x73: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("VPSRLQ Vx, Ex, Ib"); + GETEYxy(v1, 0, 1); + GETVYxy_empty(v0); + u8 = F8; + if (u8 > 63) { + VXOR_Vxy(v0, v0, v0); + } else { + VSRLIxy(D, v0, v1, u8); + } + break; + case 3: + INST_NAME("VPSRLDQ Vx, Ex, Ib"); + GETEYxy(v1, 0, 1); + GETVYxy_empty(v0); + u8 = F8; + if (u8 > 15) { + VXOR_Vxy(v0, v0, v0); + } else { + VBSRL_Vxy(v0, v1, u8); + } + break; + case 6: + INST_NAME("VPSLLQ Vx, Ex, Ib"); + GETEYxy(v1, 0, 1); + GETVYxy_empty(v0); + u8 = F8; + if (u8 > 63) { + VXOR_Vxy(v0, v0, v0); + } else { + VSLLIxy(D, v0, v1, u8); + } + break; + case 7: + INST_NAME("VPSLLDQ Vx, Ex, Ib"); + GETEYxy(v1, 0, 1); + GETVYxy_empty(v0); + u8 = F8; + if (u8 > 15) { + VXOR_Vxy(v0, v0, v0); + } else { + VBSLL_Vxy(v0, v1, u8); + } + break; + default: + DEFAULT; + } + break; + case 0x74: + INST_NAME("VPCMPEQB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSEQxy(B, v0, v1, v2); + break; + case 0x75: + INST_NAME("VPCMPEQW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSEQxy(H, v0, v1, v2); + break; + case 0x76: + INST_NAME("VPCMPEQD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSEQxy(W, v0, v1, v2); + break; + case 0x7C: + INST_NAME("VHADDPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + VPICKEVxy(D, q0, v2, v1); + VPICKODxy(D, v0, v2, v1); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(D, d0, q0, v0, cUN); + } + VFADDxy(D, v0, q0, v0); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(D, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b011 << 9) | 0b111111000); + VSLLIxy(D, d1, d1, 48); // broadcast 0xfff8000000000000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0x7D: + INST_NAME("VHSUBPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + VPICKEVxy(D, q0, v2, v1); + VPICKODxy(D, v0, v2, v1); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(D, d0, q0, v0, cUN); + } + VFSUBxy(D, v0, q0, v0); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(D, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b011 << 9) | 0b111111000); + VSLLIxy(D, d1, d1, 48); // broadcast 0xfff8000000000000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0x7E: + INST_NAME("VMOVD Ed, Gx"); + nextop = F8; + GETGYx(v0, 0); + if (MODREG) { + ed = TO_NAT((nextop & 0x07) + (rex.b << 3)); + if (rex.w) { + VPICKVE2GR_D(ed, v0, 0); + } else { + VPICKVE2GR_WU(ed, v0, 0); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + if (rex.w) { + FST_D(v0, ed, fixedaddress); + } else { + FST_S(v0, ed, fixedaddress); + } + SMWRITE2(); + } + break; + case 0x7F: + INST_NAME("VMOVDQA Ex, Gx"); + nextop = F8; + GETGYxy(q0, 0); + if (MODREG) { + GETEYxy_empty(q1, 0); + if (vex.l) { + XVOR_V(q1, q0, q0); + } else { + VOR_V(q1, q0, q0); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVST(q0, ed, fixedaddress); + } else { + VST(q0, ed, fixedaddress); + } + SMWRITE2(); + } + break; + case 0xC2: + INST_NAME("VCMPPD Gx, Vx, Ex, Ib"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8; + switch (u8 & 0xf) { + case 0x00: VFCMPxy(D, v0, v1, v2, cEQ); break; // Equal, not unordered + case 0x01: VFCMPxy(D, v0, v1, v2, cLT); break; // Less than + case 0x02: VFCMPxy(D, v0, v1, v2, cLE); break; // Less or equal + case 0x03: VFCMPxy(D, v0, v1, v2, cUN); break; // unordered + case 0x04: VFCMPxy(D, v0, v1, v2, cUNE); break; // Not Equal (or unordered on ARM, not on X86...) + case 0x05: VFCMPxy(D, v0, v2, v1, cULE); break; // Greater or equal or unordered + case 0x06: VFCMPxy(D, v0, v2, v1, cULT); break; // Greater or unordered + case 0x07: VFCMPxy(D, v0, v1, v2, cOR); break; // Greater or unordered + case 0x08: VFCMPxy(D, v0, v1, v2, cUEQ); break; // Equal, or unordered + case 0x09: VFCMPxy(D, v0, v1, v2, cULT); break; // Less than or unordered + case 0x0a: VFCMPxy(D, v0, v1, v2, cULE); break; // Less or equal or unordered + case 0x0b: XVXOR_V(v0, v0, v0); break; // false + case 0x0c: VFCMPxy(D, v0, v1, v2, cNE); break; // Not Eual, ordered + case 0x0d: VFCMPxy(D, v0, v2, v1, cLE); break; // Greater or Equal ordered + case 0x0e: VFCMPxy(D, v0, v2, v1, cLT); break; // Greater ordered + case 0x0f: VSEQxy(B, v0, v1, v1); break; // true + } + break; + case 0xC4: + INST_NAME("VPINSRW Gx, Vx, ED, Ib"); + nextop = F8; + GETEWW(0, x5, 1); + GETVYx(v1, 0); + GETGYx_empty(v0); + u8 = F8; + if(v0 != v1) VOR_V(v0, v1, v1); + VINSGR2VR_H(v0, ed, (u8 & 0x7)); + break; + case 0xC5: + INST_NAME("VPEXTRW Gd, Ex, Ib"); + nextop = F8; + GETGD; + if (MODREG) { + GETEYx(v0, 0, 1); + u8 = (F8) & 7; + VPICKVE2GR_HU(gd, v0, u8); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x4, &fixedaddress, rex, NULL, 0, 1); + u8 = (F8) & 7; + LD_HU(gd, wback, (u8 << 1)); + } + break; + case 0xC6: + INST_NAME("VSHUFPD Gx, Vx, Ex, Ib"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8 & 0xf; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + if (vex.l) { + if ((u8 >> 2) == (u8 & 0b11)) { + XVOR_V(d0, v1, v1); + XVSHUF4I_D(d0, v2, 0x8 | (u8 & 1) | ((u8 & 2) << 1)); + XVOR_V(v0, d0, d0); + } else { + XVOR_V(d0, v1, v1); + XVOR_V(d1, v1, v1); + XVSHUF4I_D(d0, v2, 0x8 | (u8 & 1) | ((u8 & 2) << 1)); + XVSHUF4I_D(d1, v2, 0x8 | ((u8 & 4) >> 2) | ((u8 & 8) >> 1)); + XVPERMI_Q(d1, d0, XVPERMI_IMM_4_0(3, 0)); + XVOR_V(v0, d1, d1); + } + } else { + VOR_V(d0, v1, v1); + VSHUF4I_D(d0, v2, 0x8 | (u8 & 1) | ((u8 & 2) << 1)); + VOR_V(v0, d0, d0); + } + break; + case 0xD0: + INST_NAME("VADDSUBPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(D, d0, v1, v2, cUN); + } + q0 = fpu_get_scratch(dyn); + VFSUBxy(D, q0, v1, v2); + VFADDxy(D, v0, v1, v2); + VEXTRINSxy(D, v0, q0, 0); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(D, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b011 << 9) | 0b111111000); + VSLLIxy(D, d1, d1, 48); // broadcast 0xfff8000000000000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0xD1: + INST_NAME("VPSRLW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + VREPLVE0xy(D, q0, v2); + VREPLVE0xy(H, d0, v2); + VSLEIxy(DU, q0, q0, 15); + VSRLxy(H, v0, v1, d0); + VAND_Vxy(v0, v0, q0); + break; + case 0xD2: + INST_NAME("VPSRLD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + VREPLVE0xy(D, q0, v2); + VREPLVE0xy(W, d0, v2); + VSLEIxy(DU, q0, q0, 31); + VSRLxy(W, v0, v1, d0); + VAND_Vxy(v0, v0, q0); + break; + case 0xD3: + INST_NAME("VPSRLQ Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + VREPLVE0xy(D, q0, v2); + VLDIxy(d0, (0b011 << 10) | 0x3f); + VSLExy(DU, d0, q0, d0); + VSRLxy(D, v0, v1, q0); + VAND_Vxy(v0, v0, d0); + break; + case 0xD4: + INST_NAME("VPADDQ Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VADDxy(D, v0, v1, v2); + break; + case 0xD5: + INST_NAME("VPMULLW Gx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMULxy(H, v0, v1, v2); + break; + case 0xD6: + INST_NAME("VMOVD Ex, Gx"); + nextop = F8; + GETGYx(q0, 0); + if (MODREG) { + GETEYx_empty(q1, 0); + XVPICKVE_D(q1, q0, 0); + YMM_UNMARK_UPPER_ZERO(q1); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + FST_D(q0, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0xD7: + nextop = F8; + INST_NAME("VPMOVMSKB Gd, Ex"); + GETEYxy(v0, 0, 0); + GETGD; + d1 = fpu_get_scratch(dyn); + if (vex.l) { + XVMSKLTZ_B(d1, v0); + XVPICKVE2GR_DU(gd, d1, 0); + XVPICKVE2GR_DU(x4, d1, 2); + BSTRINS_D(gd, x4, 31, 16); + } else { + VMSKLTZ_B(d1, v0); + VPICKVE2GR_DU(gd, d1, 0); + } + break; + case 0xD8: + INST_NAME("VPSUBUSB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSSUBxy(BU, v0, v1, v2); + break; + case 0xD9: + INST_NAME("VPSUBUSW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSSUBxy(HU, v0, v1, v2); + break; + case 0xDA: + INST_NAME("VPMINUB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMINxy(BU, v0, v1, v2); + break; + case 0xDB: + INST_NAME("VPAND Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VAND_Vxy(v0, v1, v2); + break; + case 0xDC: + INST_NAME("VPADDUSB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSADDxy(BU, v0, v1, v2); + break; + case 0xDD: + INST_NAME("VPADDUSW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSADDxy(HU, v0, v1, v2); + break; + case 0xDE: + INST_NAME("VPMAXUB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMAXxy(BU, v0, v1, v2); + break; + case 0xDF: + INST_NAME("VPANDN Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VANDN_Vxy(v0, v1, v2); + break; + case 0xE0: + INST_NAME("VPAVGB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VAVGRxy(BU, v0, v1, v2); + break; + case 0xE1: + INST_NAME("VPSRAW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + VMINIxy(DU, d0, v2, 15); + VREPLVE0xy(H, d0, d0); + VSRAxy(H, v0, v1, d0); + break; + case 0xE2: + INST_NAME("VPSRAD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + VMINIxy(DU, d0, v2, 31); + VREPLVE0xy(W, d0, d0); + VSRAxy(W, v0, v1, d0); + break; + case 0xE3: + INST_NAME("VPAVGW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VAVGRxy(HU, v0, v1, v2); + break; + case 0xE4: + INST_NAME("VPMULHUW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMUHxy(HU, v0, v1, v2); + break; + case 0xE5: + INST_NAME("VPMULHW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMUHxy(H, v0, v1, v2); + break; + case 0xE6: + INST_NAME("VCVTTPD2DQ Gx, Ex"); + nextop = F8; + GETEYxy(v1, 0, 0); + GETGYx_empty(v0); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + if(vex.l){ + XVXOR_V(d0, d0, d0); + XVFTINTRZ_W_D(d1, d0, v1); // v0 [lo0, lo1, --, --, hi0, hi1, --, -- ] + if (!BOX64ENV(dynarec_fastround)) { + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + XVLDI(q0, 0b1001110000000); // broadcast 0x80000000 to all + /* + VCVTTPD2DQ has default rounding mode RZ + so we could combine +-NAN +overflow to xvfcmp.cule 0x41e0000000000000 + */ + LU52I_D(x5, xZR, 0x41e); + XVREPLGR2VR_D(q1, x5); + XVFCMP_D(d0, q1, v1, cULE); // get Nan mask + XVSRLNI_W_D(d0, d0, 0); + XVBITSEL_V(v0, d1, q0, d0); + } + XVPERMI_D(v0, v0, 0b11011000); + }else{ + VFTINTRZ_W_D(d0, v1, v1); + if (!BOX64ENV(dynarec_fastround)) { + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + XVLDI(q0, 0b1001110000000); // broadcast 0x80000000 to all + LU52I_D(x5, xZR, 0x41e); + XVREPLGR2VR_D(q1, x5); + XVFCMP_D(q1, q1, v1, cULE); // get Nan mask + VSHUF4I_W(q1, q1, 0b11011000); + VBITSEL_V(d0, d0, q0, q1); + } + XVPICKVE_D(v0, d0, 0); + YMM_UNMARK_UPPER_ZERO(v0); + } + break; + case 0xE7: + INST_NAME("VMOVNTDQ Ex, Gx"); + nextop = F8; + GETGYxy(q0, 0); + if (MODREG) { + DEFAULT; + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVST(q0, ed, fixedaddress); + } else { + VST(q0, ed, fixedaddress); + } + SMWRITE2(); + } + break; + case 0xE8: + INST_NAME("VPSUBSB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSSUBxy(B, v0, v1, v2); + break; + case 0xE9: + INST_NAME("VPSUBSW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSSUBxy(H, v0, v1, v2); + break; + case 0xEA: + INST_NAME("VPMINSW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMINxy(H, v0, v1, v2); + break; + case 0xEB: + INST_NAME("VPOR Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VOR_Vxy(v0, v1, v2); + break; + case 0xEC: + INST_NAME("VPADDSB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSADDxy(B, v0, v1, v2); + break; + case 0xED: + INST_NAME("VPADDSW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSADDxy(H, v0, v1, v2); + break; + case 0xEE: + INST_NAME("VPMAXSW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMAXxy(H, v0, v1, v2); + break; + case 0xEF: + INST_NAME("VPXOR Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VXOR_Vxy(v0, v1, v2); + break; + case 0xF1: + INST_NAME("VPSLLW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + VREPLVE0xy(D, q0, v2); + VSLEIxy(DU, q0, q0, 15); + VREPLVE0xy(H, d0, v2); + VSLLxy(H, v0, v1, d0); + VAND_Vxy(v0, v0, q0); + break; + case 0xF2: + INST_NAME("VPSLLD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + VREPLVE0xy(D, q0, v2); + VSLEIxy(DU, q0, q0, 31); + VREPLVE0xy(W, d0, v2); + VSLLxy(W, v0, v1, d0); + VAND_Vxy(v0, v0, q0); + break; + case 0xF3: + INST_NAME("VPSLLQ Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + VREPLVE0xy(D, q0, v2); + VLDIxy(d0, (0b011 << 10) | 0x3f); + VSLExy(DU, d0, q0, d0); + VSLLxy(D, v0, v1, q0); + VAND_Vxy(v0, v0, d0); + break; + case 0xF4: + INST_NAME("VPMULUDQ Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMULWEVxy(D_WU, v0, v1, v2); + break; + case 0xF5: + INST_NAME("VPMADDWD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VMULWEVxy(W_H, q0, v1, v2); + VMULWODxy(W_H, q1, v1, v2); + VADDxy(W, v0, q0, q1); + break; + case 0xF6: + INST_NAME("VPSADBW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VABSDxy(BU, v0, v1, v2); + VHADDWxy(HU_BU, v0, v0, v0); + VHADDWxy(WU_HU, v0, v0, v0); + VHADDWxy(DU_WU, v0, v0, v0); + break; + case 0xF7: + INST_NAME("VMASKMOVDQU Gx, Ex"); + nextop = F8; + GETEYx(v1, 0, 0); + GETGYx(v0, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VSLTI_B(q1, v1, 0); // q1 = byte selection mask + VLD(q0, xRDI, 0); + VBITSEL_V(q0, q0, v0, q1); // sel v0 if mask is 1 + VST(q0, xRDI, 0); + break; + case 0xF8: + INST_NAME("VPSUBB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSUBxy(B, v0, v1, v2); + break; + case 0xF9: + INST_NAME("VPSUBW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSUBxy(H, v0, v1, v2); + break; + case 0xFA: + INST_NAME("VPSUBD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSUBxy(W, v0, v1, v2); + break; + case 0xFB: + INST_NAME("VPSUBQ Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSUBxy(D, v0, v1, v2); + break; + case 0xFC: + INST_NAME("VPADDB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VADDxy(B, v0, v1, v2); + break; + case 0xFD: + INST_NAME("VPADDW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VADDxy(H, v0, v1, v2); + break; + case 0xFE: + INST_NAME("VPADDD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VADDxy(W, v0, v1, v2); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_avx_66_0f38.c b/src/dynarec/la64/dynarec_la64_avx_66_0f38.c new file mode 100644 index 0000000..d9473a3 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_avx_66_0f38.c @@ -0,0 +1,1408 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "env.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_66_0F38(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u; + int64_t j64; + int64_t fixedaddress; + int unscaled; + MAYUSE(wb1); + MAYUSE(wb2); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(gb1); + MAYUSE(gb2); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(s0); + MAYUSE(j64); + MAYUSE(cacheupd); + + rex_t rex = vex.rex; + + switch (opcode) { + case 0x00: + INST_NAME("VPSHUFB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VLDIxy(q0, 0b0000010001111); // broadcast 0b10001111 as byte + VAND_Vxy(q0, q0, v2); + VMINIxy(BU, q0, q0, 0x1f); + VXOR_Vxy(q1, q1, q1); + VSHUF_Bxy(v0, q1, v1, q0); + break; + case 0x01: + INST_NAME("VPHADDW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VPICKEVxy(H, q0, v2, v1); + VPICKODxy(H, q1, v2, v1); + VADDxy(H, v0, q0, q1); + break; + case 0x02: + INST_NAME("VPHADDD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VPICKEVxy(W, q0, v2, v1); + VPICKODxy(W, q1, v2, v1); + VADDxy(W, v0, q0, q1); + break; + case 0x03: + INST_NAME("VPHADDSW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VPICKEVxy(H, q0, v2, v1); + VPICKODxy(H, q1, v2, v1); + VSADDxy(H, v0, q0, q1); + break; + case 0x04: + INST_NAME("VPMADDUBSW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VMULWEVxy(H_BU_B, q0, v1, v2); + VMULWODxy(H_BU_B, q1, v1, v2); + VSADDxy(H, v0, q0, q1); + break; + case 0x05: + INST_NAME("VPHSUBW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VPICKEVxy(H, q0, v2, v1); + VPICKODxy(H, q1, v2, v1); + VSUBxy(H, v0, q0, q1); + break; + case 0x06: + INST_NAME("VPHSUBD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VPICKEVxy(W, q0, v2, v1); + VPICKODxy(W, q1, v2, v1); + VSUBxy(W, v0, q0, q1); + break; + case 0x07: + INST_NAME("VPHSUBSW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VPICKEVxy(H, q0, v2, v1); + VPICKODxy(H, q1, v2, v1); + VSSUBxy(H, v0, q0, q1); + break; + case 0x08: + INST_NAME("VPSIGNB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSIGNCOVxy(B, v0, v2, v1); + break; + case 0x09: + INST_NAME("VPSIGNW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSIGNCOVxy(H, v0, v2, v1); + break; + case 0x0A: + INST_NAME("VPSIGND Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSIGNCOVxy(W, v0, v2, v1); + break; + case 0x0B: + INST_NAME("VPMULHRSW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + if (vex.l) { + XVMULWEV_W_H(q0, v1, v2); + XVMULWOD_W_H(q1, v1, v2); + XVSRLI_W(q0, q0, 14); + XVSRLI_W(q1, q1, 14); + XVADDI_WU(q0, q0, 1); + XVADDI_WU(q1, q1, 1); + XVSRLNI_H_W(q0, q0, 1); + XVSRLNI_H_W(q1, q1, 1); + XVILVL_H(v0, q1, q0); + } else { + VEXT2XV_W_H(q0, v1); + VEXT2XV_W_H(q1, v2); + XVMUL_W(q0, q0, q1); + XVSRLI_W(q0, q0, 14); + XVADDI_WU(q0, q0, 1); + XVSRLNI_H_W(q0, q0, 1); + XVPERMI_D(v0, q0, 0b1000); + } + break; + case 0x0C: + INST_NAME("VPERMILPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + VANDIxy(d0, v2, 0b11); + VSHUFxy(W, d0, v1, v1); + VOR_Vxy(v0, d0, d0); + break; + case 0x0D: + INST_NAME("VPERMILPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + VSRLIxy(D, d0, v2, 0x1); + VANDIxy(d0, d0, 0b1); + VSHUFxy(D, d0, v2, v1); + VOR_Vxy(v0, d0, d0); + break; + case 0x0E: + case 0x0F: + if (opcode == 0x0E) { + INST_NAME("VTESTPS Gx, Ex"); + } else { + INST_NAME("VTESTPD Gx, Ex"); + } + nextop = F8; + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETGYxy(q0, 0); + GETEYxy(q1, 0, 0); + if (!cpuext.lbt) { + CLEAR_FLAGS(x3); + } else IFX (X_ALL) { + X64_SET_EFLAGS(xZR, X_ALL); + } + SET_DFNONE(); + v0 = fpu_get_scratch(dyn); + IFX (X_ZF) { + VAND_Vxy(v0, q1, q0); + if (opcode == 0x0E) { + VMSKLTZxy(W, v0, v0); + } else { + VMSKLTZxy(D, v0, v0); + } + VSETEQZ_Vxy(fcc0, v0); + BCEQZ_MARK(fcc0); + if (cpuext.lbt) { + ADDI_D(x3, xZR, 1 << F_ZF); + X64_SET_EFLAGS(x3, X_ZF); + } else { + ORI(xFlags, xFlags, 1 << F_ZF); + } + } + MARK; + IFX (X_CF) { + VANDN_Vxy(v0, q0, q1); + if (opcode == 0x0E) { + VMSKLTZxy(W, v0, v0); + } else { + VMSKLTZxy(D, v0, v0); + } + VSETEQZ_Vxy(fcc0, v0); + BCEQZ_MARK2(fcc0); + if (cpuext.lbt) { + ADDI_D(x3, xZR, 1 << F_CF); + X64_SET_EFLAGS(x3, X_CF); + } else { + ORI(xFlags, xFlags, 1 << F_CF); + } + } + MARK2; + break; + case 0x13: + INST_NAME("VCVTPH2PS Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYx(v1, 0, 0); + GETGYy_empty(v0); + d0 = fpu_get_scratch(dyn); + /* + xvffintl.s.h convert [h0..h3,h4..h7,h8..h11,h12..h15] to [h0..h3,h8..h11] + xvffinth.s.h convert [h0..h3,h4..h7,h8..h11,h12..h15] to [h4..h7,h12..h15] + so user xvpermi.d to reorder input [h0..h3,h4..h7,h8..h11,h12..h15] to [h0..h3,h8..h11,h4..h7,h12..h15] + */ + XVPERMI_D(d0, v1, 0b11011000); + XVFCVTL_S_H(v0, d0); + } else { + GETEYSD(v1, 0, 0); + GETGYx_empty(v0); + VFCVTL_S_H(v0, v1); + } + break; + case 0x16: + INST_NAME("VPERMPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + XVPERM_W(v0, v2, v1); + break; + case 0x17: + INST_NAME("VPTEST Gx, Ex"); + nextop = F8; + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETGYxy(q0, 0); + GETEYxy(q1, 0, 0); + if (!cpuext.lbt) { + CLEAR_FLAGS(x3); + } else IFX (X_ALL) { + X64_SET_EFLAGS(xZR, X_ALL); + } + SET_DFNONE(); + v0 = fpu_get_scratch(dyn); + IFX (X_ZF) { + VAND_Vxy(v0, q1, q0); + VSETEQZ_Vxy(fcc0, v0); + BCEQZ_MARK(fcc0); + if (cpuext.lbt) { + ADDI_D(x3, xZR, 1 << F_ZF); + X64_SET_EFLAGS(x3, X_ZF); + } else { + ORI(xFlags, xFlags, 1 << F_ZF); + } + } + MARK; + IFX (X_CF) { + VANDN_Vxy(v0, q0, q1); + VSETEQZ_Vxy(fcc0, v0); + BCEQZ_MARK2(fcc0); + if (cpuext.lbt) { + ADDI_D(x3, xZR, 1 << F_CF); + X64_SET_EFLAGS(x3, X_CF); + } else { + ORI(xFlags, xFlags, 1 << F_CF); + } + } + MARK2; + break; + case 0x18: + INST_NAME("VBROADCASTSS Gx, Ex"); + nextop = F8; + GETEYSS(q2, 0, 0); + GETGYxy_empty(q0); + VREPLVE0xy(W, q0, q2); + break; + case 0x19: + INST_NAME("VBROADCASTSD Gx, Ex"); + nextop = F8; + GETEYSD(q2, 0, 0); + GETGYxy_empty(q0); + VREPLVE0xy(D, q0, q2); + break; + case 0x1A: + INST_NAME("VBROADCASTF128 Gx, Ex"); + nextop = F8; + GETEYx(q2, 0, 0); + GETGYxy_empty(q0); + XVREPLVE0_Q(q0, q2); + break; + case 0x1C: + INST_NAME("VPABSB Gx, Ex"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 0); + q0 = fpu_get_scratch(dyn); + XVXOR_V(q0, q0, q0); + VABSDxy(B, v0, v1, q0); + break; + case 0x1D: + INST_NAME("VPABSW Gx, Ex"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 0); + q0 = fpu_get_scratch(dyn); + XVXOR_V(q0, q0, q0); + VABSDxy(H, v0, v1, q0); + break; + case 0x1E: + INST_NAME("VPABSD Gx, Ex"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 0); + q0 = fpu_get_scratch(dyn); + XVXOR_V(q0, q0, q0); + VABSDxy(W, v0, v1, q0); + break; + case 0x20: + INST_NAME("VPMOVSXBW Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYx(q1, 0, 0); + GETGYy_empty(q0); + VEXT2XV_H_B(q0, q1); + } else { + GETEYSD(q1, 0, 0); + GETGYx_empty(q0); + VSLLWIL_H_B(q0, q1, 0); + } + break; + case 0x21: + INST_NAME("VPMOVSXBD Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYSD(q1, 0, 0); + } else { + GETEYSS(q1, 0, 0); + } + GETGYxy_empty(q0); + VEXT2XV_W_B(q0, q1); + break; + case 0x22: + INST_NAME("VPMOVSXBQ Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYSS(q1, 0, 0); + } else { + if (MODREG) { + GETEYx(q1, 0, 0); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LD_H(x5, ed, fixedaddress); + q1 = fpu_get_scratch(dyn); + MOVGR2FR_W(q1, x5); + } + } + GETGYxy_empty(q0); + VEXT2XV_D_B(q0, q1); + break; + case 0x23: + INST_NAME("VPMOVSXWD Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYx(q1, 0, 0); + GETGYy_empty(q0); + VEXT2XV_W_H(q0, q1); + } else { + GETEYSD(q1, 0, 0); + GETGYx_empty(q0); + VSLLWIL_W_H(q0, q1, 0); + } + break; + case 0x24: + INST_NAME("VPMOVSXWQ Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYSD(q1, 0, 0); + } else { + GETEYSS(q1, 0, 0); + } + GETGYxy_empty(q0); + VEXT2XV_D_H(q0, q1); + break; + case 0x25: + INST_NAME("VPMOVSXDQ Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYx(q1, 0, 0); + GETGYy_empty(q0); + VEXT2XV_D_W(q0, q1); + } else { + GETEYSD(q1, 0, 0); + GETGYx_empty(q0); + VSLLWIL_D_W(q0, q1, 0); + } + break; + case 0x28: + INST_NAME("VPMULDQ Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMULWEVxy(D_W, v0, v1, v2); + break; + case 0x29: + INST_NAME("VPCMPEQQ Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSEQxy(D, v0, v2, v1); + break; + case 0x2A: + INST_NAME("VMOVNTDQA Gx, Ex"); + nextop = F8; + if (MODREG) { + DEFAULT; + } else { + GETGYxy_empty(q0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 0, 0); + if (vex.l) { + XVLD(q0, ed, fixedaddress); + } else { + VLD(q0, ed, fixedaddress); + } + } + break; + case 0x2B: + INST_NAME("VPACKUSDW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + VLDIxy(d0, (0b10111 << 8) | 0x00); // Broadcast 0x0000FFFF as 32bits to all lane + if (v1 == v2) { + VMAXIxy(W, q0, v1, 0); + VMINxy(W, q0, q0, d0); + VPICKEVxy(H, v0, q0, q0); + } else { + VMAXIxy(W, q1, v2, 0); + VMAXIxy(W, q0, v1, 0); + VMINxy(W, q1, q1, d0); + VMINxy(W, q0, q0, d0); + VPICKEVxy(H, v0, q1, q0); + } + break; + case 0x2C: + INST_NAME("VMASKMOVPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + if (vex.l) { + XVXOR_V(d0, d0, d0); + XVSLTI_W(d1, v1, 0); // create all-one mask for negetive element. + XVBITSEL_V(v0, d0, v2, d1); + } else { + VXOR_V(d0, d0, d0); + VSLTI_W(d1, v1, 0); // create all-one mask for negetive element. + VBITSEL_V(v0, d0, v2, d1); + } + break; + case 0x2D: + INST_NAME("VMASKMOVPD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + if (vex.l) { + XVXOR_V(d0, d0, d0); + XVSLTI_D(d1, v1, 0); // create all-one mask for negetive element. + XVBITSEL_V(v0, d0, v2, d1); + } else { + VXOR_V(d0, d0, d0); + VSLTI_D(d1, v1, 0); // create all-one mask for negetive element. + VBITSEL_V(v0, d0, v2, d1); + } + break; + case 0x2E: + INST_NAME("VMASKMOVPS Ex, Vx, Gx"); + nextop = F8; + GETEY_VYGY_xy(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + if (vex.l) { + XVSLTI_W(d0, v1, 0); // create all-one mask for negetive element. + XVBITSEL_V(v0, v0, v2, d0); + PUTEYy(v0); + } else { + VSLTI_W(d0, v1, 0); // create all-one mask for negetive element. + VBITSEL_V(v0, v0, v2, d0); + PUTEYx(v0); + } + break; + case 0x2F: + INST_NAME("VMASKMOVPD Ex, Vx, Gx"); + nextop = F8; + GETEY_VYGY_xy(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + if (vex.l) { + XVSLTI_D(d0, v1, 0); // create all-one mask for negetive element. + XVBITSEL_V(v0, v0, v2, d0); + PUTEYy(v0); + } else { + VSLTI_D(d0, v1, 0); // create all-one mask for negetive element. + VBITSEL_V(v0, v0, v2, d0); + PUTEYx(v0); + } + break; + case 0x30: + INST_NAME("VPMOVZXBW Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYx(q1, 0, 0); + GETGYy_empty(q0); + VEXT2XV_HU_BU(q0, q1); + } else { + GETEYSD(q1, 0, 0); + GETGYx_empty(q0); + VSLLWIL_HU_BU(q0, q1, 0); + } + break; + case 0x31: + INST_NAME("VPMOVZXBD Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYSD(q1, 0, 0); + } else { + GETEYSS(q1, 0, 0); + } + GETGYxy_empty(q0); + VEXT2XV_WU_BU(q0, q1); + break; + case 0x32: + INST_NAME("VPMOVZXBQ Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYSS(q1, 0, 0); + } else { + if (MODREG) { + GETEYx(q1, 0, 0); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LD_H(x5, ed, fixedaddress); + q1 = fpu_get_scratch(dyn); + MOVGR2FR_W(q1, x5); + } + } + GETGYxy_empty(q0); + VEXT2XV_DU_BU(q0, q1); + break; + case 0x33: + INST_NAME("VPMOVZXWD Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYx(q1, 0, 0); + GETGYy_empty(q0); + VEXT2XV_WU_HU(q0, q1); + } else { + GETEYSD(q1, 0, 0); + GETGYx_empty(q0); + VSLLWIL_WU_HU(q0, q1, 0); + } + break; + case 0x34: + INST_NAME("VPMOVZXWQ Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYSD(q1, 0, 0); + } else { + GETEYSS(q1, 0, 0); + } + GETGYxy_empty(q0); + VEXT2XV_DU_HU(q0, q1); + break; + case 0x35: + INST_NAME("VPMOVZXDQ Gx, Ex"); + nextop = F8; + if (vex.l) { + GETEYx(q1, 0, 0); + GETGYy_empty(q0); + VEXT2XV_DU_WU(q0, q1); + } else { + GETEYSD(q1, 0, 0); + GETGYx_empty(q0); + VSLLWIL_DU_WU(q0, q1, 0); + } + break; + case 0x36: + INST_NAME("VPERMD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + XVPERM_W(v0, v2, v1); + break; + case 0x37: + INST_NAME("VPCMPGTQ Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VSLTxy(D, v0, v2, v1); + break; + case 0x38: + INST_NAME("VPMINSB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMINxy(B, v0, v1, v2); + break; + case 0x39: + INST_NAME("VPMINSD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMINxy(W, v0, v1, v2); + break; + case 0x3A: + INST_NAME("VPMINUW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMINxy(HU, v0, v1, v2); + break; + case 0x3B: + INST_NAME("VPMINUD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMINxy(WU, v0, v1, v2); + break; + case 0x3C: + INST_NAME("VPMAXSB Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMAXxy(B, v0, v1, v2); + break; + case 0x3D: + INST_NAME("VPMAXSD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMAXxy(W, v0, v1, v2); + break; + case 0x3E: + INST_NAME("VPMAXUW Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMAXxy(HU, v0, v1, v2); + break; + case 0x3F: + INST_NAME("VPMAXUD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMAXxy(WU, v0, v1, v2); + break; + case 0x40: + INST_NAME("VPMULLD Gx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + VMULxy(W, v0, v1, v2); + break; + case 0x41: + INST_NAME("VPHMINPOSUW Gx, Ex"); + nextop = F8; + GETEYx(v1, 0, 0); + GETGYx_empty(v0); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + q2 = fpu_get_scratch(dyn); + // v1[a,b,c,d,e,f,g,h] + VSHUF4I_W(q0, v1, 0b01001110); // q0[e,f,g,h,a,b,c,d] + VMIN_HU(q1, v1, q0); // q1[ae,bf,cg,dh ...] + + VSHUF4I_H(q2, q1, 0b10110001); // q2[bf,ae,dh,cg ...] + VMIN_HU(q1, q1, q2); // q1[aebf,aebf,cgdh,cgdh ...] + VSHUF4I_H(q0, q1, 0b01001110); // q0[cgdh,cgdh,aebf,aebf] + VMIN_HU(q2, q0, q1); // all lane is min(abcdefgh) + VSEQ_H(q0, q2, v1); // get mask(0xffff) + VFRSTPI_H(q2, q0, 1); // find first neg(0xffff),insert index to q2 + XVPICKVE_W(v0, q2, 0); + YMM_UNMARK_UPPER_ZERO(v0); + break; + case 0x45: + INST_NAME("VPSRLVD/Q Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + d1 = fpu_get_scratch(dyn); + if (rex.w) { + d0 = fpu_get_scratch(dyn); + VLDIxy(d0, (0b011 << 10) | 63); + VSLExy(DU, d1, v2, d0); + VSRLxy(D, v0, v1, v2); + VAND_Vxy(v0, v0, d1); + } else { + VSLEIxy(WU, d1, v2, 31); + VSRLxy(W, v0, v1, v2); + VAND_Vxy(v0, v0, d1); + } + break; + case 0x46: + INST_NAME("VPSRAVD Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + VMINIxy(WU, d0, v2, 31); + VSRAxy(W, v0, v1, d0); + break; + case 0x47: + INST_NAME("VPSLLVD/Q Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + d1 = fpu_get_scratch(dyn); + if (rex.w) { + d0 = fpu_get_scratch(dyn); + VLDIxy(d0, (0b011 << 10) | 63); + VSLExy(DU, d1, v2, d0); + VSLLxy(D, v0, v1, v2); + VAND_Vxy(v0, v0, d1); + } else { + VSLEIxy(WU, d1, v2, 31); + VSLLxy(W, v0, v1, v2); + VAND_Vxy(v0, v0, d1); + } + break; + case 0x58: + INST_NAME("VPBROADCASTD Gx, Ex"); + nextop = F8; + if (MODREG) { + GETEYx(v1, 0, 0); + GETGYxy_empty(v0); + VREPLVE0xy(W, v0, v1); + } else { + GETGYxy_empty(v0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 0, 0); + VLDREPLxy(W, v0, ed, 0); + } + break; + case 0x59: + INST_NAME("VPBROADCASTQ Gx, Ex"); + nextop = F8; + if (MODREG) { + GETEYx(v1, 0, 0); + GETGYxy_empty(v0); + VREPLVE0xy(D, v0, v1); + } else { + GETGYxy_empty(v0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 0, 0); + VLDREPLxy(D, v0, ed, 0); + } + break; + case 0x5A: + INST_NAME("VBROADCASTI128 Gx, Ex"); + nextop = F8; + GETEYx(q2, 0, 0); + GETGYxy_empty(q0); + XVREPLVE0_Q(q0, q2); + break; + case 0x78: + INST_NAME("VPBROADCASTB Gx, Ex"); + nextop = F8; + if (MODREG) { + GETEYx(v1, 0, 0); + GETGYxy_empty(v0); + VREPLVE0xy(B, v0, v1); + } else { + GETGYxy_empty(v0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 0, 0); + VLDREPLxy(B, v0, ed, 0); + } + break; + case 0x79: + INST_NAME("VPBROADCASTW Gx, Ex"); + nextop = F8; + if (MODREG) { + GETEYx(v1, 0, 0); + GETGYxy_empty(v0); + VREPLVE0xy(H, v0, v1); + } else { + GETGYxy_empty(v0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 0, 0); + VLDREPLxy(H, v0, ed, 0); + } + break; + case 0x8C: + INST_NAME("VPMASKMOVD/Q Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + if (vex.l) { + XVXOR_V(d0, d0, d0); + if (rex.w) { + XVSLTI_D(d1, v1, 0); + } else { + XVSLTI_W(d1, v1, 0); + } + XVBITSEL_V(v0, d0, v2, d1); + } else { + VXOR_V(d0, d0, d0); + if (rex.w) { + VSLTI_D(d1, v1, 0); + } else { + VSLTI_W(d1, v1, 0); + } + VBITSEL_V(v0, d0, v2, d1); + } + break; + case 0x8E: + INST_NAME("VPMASKMOVD/Q Ex, Vx, Gx"); + nextop = F8; + GETEY_VYGY_xy(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + if (vex.l) { + if (rex.w) { + XVSLTI_D(d0, v1, 0); + } else { + XVSLTI_W(d0, v1, 0); + } + XVBITSEL_V(v0, v0, v2, d0); + PUTEYy(v0); + } else { + if (rex.w) { + VSLTI_D(d0, v1, 0); + } else { + VSLTI_W(d0, v1, 0); + } + VBITSEL_V(v0, v0, v2, d0); + PUTEYx(v0); + } + break; + case 0x90: + case 0x92: + if (opcode == 0x90) { + INST_NAME("VPGATHERDD/VPGATHERDQ Gx, VSIB, Vx"); + } else { + INST_NAME("VGATHERDPD/VGATHERDPS Gx, VSIB, Vx"); + } + nextop = F8; + if (((nextop & 7) != 4) || MODREG) { UDF(); } + GETG; + u8 = F8; // SIB + if ((u8 & 0x7) == 0x5 && !(nextop & 0xC0)) { + int64_t i64 = F32S64; + MOV64x(x5, i64); + eb1 = x5; + } else + eb1 = TO_NAT((u8 & 0x7) + (rex.b << 3)); // base + eb2 = ((u8 >> 3) & 7) + (rex.x << 3); // index + if (nextop & 0x40) + i32 = F8S; + else if (nextop & 0x80) + i32 = F32S; + else + i32 = 0; + if (!i32) + ed = eb1; + else { + ed = x3; + if (i32 < -2048 || i32 >= 2048) { + MOV64x(ed, i32); + ADD_D(ed, ed, eb1); + } else { + ADDI_D(ed, eb1, i32); + } + } + // ed is base + wb1 = u8 >> 6; // scale + GETVYxy(v2, 1); + GETGYxy(v0, 1); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + + if (vex.l) { + v1 = avx_get_reg(dyn, ninst, x6, eb2, 0, rex.w ? LSX_AVX_WIDTH_128 : LSX_AVX_WIDTH_256); + if (rex.w) { + XVSRLI_D(d1, v2, 63); + } else { + XVSRLI_W(d1, v2, 31); + }; + for (int i = 0; i < (rex.w ? 4 : 8); i++) { + XVPICKVE2GRxw(x4, d1, i); + BEQZ(x4, 4 + 4 * (5 + rex.is32bits)); + XVPICKVE2GR_W(x4, v1, i); + SLLI_D(x4, x4, wb1); + ADD_D(x4, x4, ed); + if (rex.is32bits) ZEROUP(x4); + LDxw(x6, x4, 0); + XVINSGR2VRxw(v0, x6, i); + } + XVXOR_V(v2, v2, v2); + } else { + v1 = avx_get_reg(dyn, ninst, x6, eb2, 0, LSX_AVX_WIDTH_128); + if (rex.w) { + VSRLI_D(d1, v2, 63); + } else { + VSRLI_W(d1, v2, 31); + }; + for (int i = 0; i < (rex.w ? 2 : 4); i++) { + VPICKVE2GRxw(x4, d1, i); + BEQZ(x4, 4 + 4 * (5 + rex.is32bits)); + VPICKVE2GR_W(x4, v1, i); + SLLI_D(x4, x4, wb1); + ADD_D(x4, x4, ed); + if (rex.is32bits) ZEROUP(x4); + LDxw(x6, x4, 0); + VINSGR2VRxw(v0, x6, i); + } + VXOR_V(v2, v2, v2); + } + break; + case 0x91: + case 0x93: + if (opcode == 0x91) { + INST_NAME("VPGATHERQD/VPGATHERQQ Gx, VSIB, Vx"); + } else { + INST_NAME("VGATHERQPD/VGATHERQPS Gx, VSIB, Vx"); + } + nextop = F8; + if (((nextop & 7) != 4) || MODREG) { UDF(); } + GETG; + u8 = F8; // SIB + if ((u8 & 0x7) == 0x5 && !(nextop & 0xC0)) { + int64_t i64 = F32S64; + MOV64x(x5, i64); + eb1 = x5; + } else + eb1 = TO_NAT((u8 & 0x7) + (rex.b << 3)); // base + eb2 = ((u8 >> 3) & 7) + (rex.x << 3); // index + if (nextop & 0x40) + i32 = F8S; + else if (nextop & 0x80) + i32 = F32S; + else + i32 = 0; + if (!i32) + ed = eb1; + else { + ed = x3; + if (i32 < -2048 || i32 >= 2048) { + MOV64x(ed, i32); + ADD_D(ed, ed, eb1); + } else { + ADDI_D(ed, eb1, i32); + } + } + // ed is base + wb1 = u8 >> 6; // scale + if (rex.w) { + GETVYxy(v2, 1); + GETGYxy(v0, 1); + } else { + GETVYx(v2, 1); + GETGYx(v0, 1); + } + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + + if (vex.l) { + v1 = avx_get_reg(dyn, ninst, x6, eb2, 0, LSX_AVX_WIDTH_256); + if (rex.w) { + XVSRLI_D(d1, v2, 63); + } else { + XVSRLI_W(d1, v2, 31); + }; + for (int i = 0; i < 4; i++) { + XVPICKVE2GRxw(x4, d1, i); + BEQZ(x4, 4 + 4 * (5 + rex.is32bits)); + XVPICKVE2GR_D(x4, v1, i); + SLLI_D(x4, x4, wb1); + ADD_D(x4, x4, ed); + if (rex.is32bits) ZEROUP(x4); + LDxw(x6, x4, 0); + XVINSGR2VRxw(v0, x6, i); + } + XVXOR_V(v2, v2, v2); + } else { + v1 = avx_get_reg(dyn, ninst, x6, eb2, 0, LSX_AVX_WIDTH_128); + if (rex.w) { + VSRLI_D(d1, v2, 63); + } else { + VSRLI_W(d1, v2, 31); + }; + for (int i = 0; i < 2; i++) { + VPICKVE2GRxw(x4, d1, i); + BEQZ(x4, 4 + 4 * (5 + rex.is32bits)); + VPICKVE2GR_D(x4, v1, i); + SLLI_D(x4, x4, wb1); + ADD_D(x4, x4, ed); + if (rex.is32bits) ZEROUP(x4); + LDxw(x6, x4, 0); + VINSGR2VRxw(v0, x6, i); + } + VXOR_V(v2, v2, v2); + if (!rex.w) VINSGR2VR_D(v0, xZR, 1); // for set DEST[127:64] to zero, cause 128bit op only gather 2 32bits float. + } + break; + case 0x96: + INST_NAME("VFMADDSUB132PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + VFMADDxyxw(q0, v0, v2, v1); + VFMSUBxyxw(v0, v0, v2, v1); + if (rex.w) { + VEXTRINSxy(D, v0, q0, VEXTRINS_IMM_4_0(1, 1)); + } else { + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(1, 1)); + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(3, 3)); + } + break; + case 0x97: + INST_NAME("VFMSUBADD132PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + VFMSUBxyxw(q0, v0, v2, v1); + VFMADDxyxw(v0, v0, v2, v1); + if (rex.w) { + VEXTRINSxy(D, v0, q0, VEXTRINS_IMM_4_0(1, 1)); + } else { + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(1, 1)); + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(3, 3)); + } + break; + case 0x98: + INST_NAME("VFMADD132PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + VFMADDxyxw(v0, v0, v2, v1); + break; + case 0x99: + INST_NAME("VFMADD132SS/D Gx, Vx, Ex"); + nextop = F8; + GETGYx_VYx_EYxw(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + FMADDxw(d0, v0, v2, v1); + VEXTRINSxw(v0, d0, 0); + break; + case 0x9A: + INST_NAME("VFMSUB132PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + VFMSUBxyxw(v0, v0, v2, v1); + break; + case 0x9B: + INST_NAME("VFMSUB132SS/D Gx, Vx, Ex"); + nextop = F8; + GETGYx_VYx_EYxw(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + FMSUBxw(d0, v0, v2, v1); + VEXTRINSxw(v0, d0, 0); + break; + case 0x9C: + INST_NAME("VFNMADD132PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + VFNMSUBxyxw(v0, v0, v2, v1); + break; + case 0x9D: + INST_NAME("VFNMADD132SS/D Gx, Vx, Ex"); + nextop = F8; + GETGYx_VYx_EYxw(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + FNMSUBxw(d0, v0, v2, v1); + VEXTRINSxw(v0, d0, 0); + break; + case 0x9E: + INST_NAME("VFNMSUB132PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + VFNMADDxyxw(v0, v0, v2, v1); + break; + case 0x9F: + INST_NAME("VFNMSUB132SS/D Gx, Vx, Ex"); + nextop = F8; + GETGYx_VYx_EYxw(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + FNMADDxw(d0, v0, v2, v1); + VEXTRINSxw(v0, d0, 0); + break; + case 0xA6: + INST_NAME("VFMADDSUB213PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + VFMADDxyxw(q0, v1, v0, v2); + VFMSUBxyxw(v0, v1, v0, v2); + if (rex.w) { + VEXTRINSxy(D, v0, q0, VEXTRINS_IMM_4_0(1, 1)); + } else { + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(1, 1)); + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(3, 3)); + } + break; + case 0xA7: + INST_NAME("VFMSUBADD213PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + VFMSUBxyxw(q0, v1, v0, v2); + VFMADDxyxw(v0, v1, v0, v2); + if (rex.w) { + VEXTRINSxy(D, v0, q0, VEXTRINS_IMM_4_0(1, 1)); + } else { + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(1, 1)); + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(3, 3)); + } + break; + case 0xA8: + INST_NAME("VFMADD213PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + VFMADDxyxw(v0, v1, v0, v2); + break; + case 0xA9: + INST_NAME("VFMADD213SS/D Gx, Vx, Ex"); + nextop = F8; + GETGYx_VYx_EYxw(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + FMADDxw(d0, v1, v0, v2); + VEXTRINSxw(v0, d0, 0); + break; + case 0xAA: + INST_NAME("VFMSUB213PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + VFMSUBxyxw(v0, v1, v0, v2); + break; + case 0xAB: + INST_NAME("VFMSUB213SS/D Gx, Vx, Ex"); + nextop = F8; + GETGYx_VYx_EYxw(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + FMSUBxw(d0, v1, v0, v2); + VEXTRINSxw(v0, d0, 0); + break; + case 0xAC: + INST_NAME("VFNMADD213PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + VFNMSUBxyxw(v0, v1, v0, v2); + break; + case 0xAD: + INST_NAME("VFNMADD213SS/D Gx, Vx, Ex"); + nextop = F8; + GETGYx_VYx_EYxw(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + FNMSUBxw(d0, v1, v0, v2); + VEXTRINSxw(v0, d0, 0); + break; + case 0xAE: + INST_NAME("VFNMSUB213PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + VFNMADDxyxw(v0, v1, v0, v2); + break; + case 0xAF: + INST_NAME("VFNMSUB213SS/D Gx, Vx, Ex"); + nextop = F8; + GETGYx_VYx_EYxw(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + FNMADDxw(d0, v1, v0, v2); + VEXTRINSxw(v0, d0, 0); + break; + case 0xB6: + INST_NAME("VFMADDSUB231PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + VFMADDxyxw(q0, v1, v2, v0); + VFMSUBxyxw(v0, v1, v2, v0); + if (rex.w) { + VEXTRINSxy(D, v0, q0, VEXTRINS_IMM_4_0(1, 1)); + } else { + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(1, 1)); + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(3, 3)); + } + break; + case 0xB7: + INST_NAME("VFMSUBADD231PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + VFMSUBxyxw(q0, v1, v2, v0); + VFMADDxyxw(v0, v1, v2, v0); + if (rex.w) { + VEXTRINSxy(D, v0, q0, VEXTRINS_IMM_4_0(1, 1)); + } else { + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(1, 1)); + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(3, 3)); + } + break; + case 0xB8: + INST_NAME("VFMADD231PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + VFMADDxyxw(v0, v1, v2, v0); + break; + case 0xB9: + INST_NAME("VFMADD231SS/D Gx, Vx, Ex"); + nextop = F8; + GETGYx_VYx_EYxw(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + FMADDxw(d0, v1, v2, v0); + VEXTRINSxw(v0, d0, 0); + break; + case 0xBA: + INST_NAME("VFMSUB231PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + VFMSUBxyxw(v0, v1, v2, v0); + break; + case 0xBB: + INST_NAME("VFMSUB231SS/D Gx, Vx, Ex"); + nextop = F8; + GETGYx_VYx_EYxw(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + FMSUBxw(d0, v1, v2, v0); + VEXTRINSxw(v0, d0, 0); + break; + case 0xBC: + INST_NAME("VFNMADD231PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + VFNMSUBxyxw(v0, v1, v2, v0); + break; + case 0xBD: + INST_NAME("VFNMADD231SS/D Gx, Vx, Ex"); + nextop = F8; + GETGYx_VYx_EYxw(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + FNMSUBxw(d0, v1, v2, v0); + VEXTRINSxw(v0, d0, 0); + break; + case 0xBE: + INST_NAME("VFNMSUB231PS/D Gx, Vx, Ex"); + nextop = F8; + GETGY_VYEY_xy(v0, v1, v2, 0); + VFNMADDxyxw(v0, v1, v2, v0); + break; + case 0xBF: + INST_NAME("VFNMSUB231SS/D Gx, Vx, Ex"); + nextop = F8; + GETGYx_VYx_EYxw(v0, v1, v2, 0); + d0 = fpu_get_scratch(dyn); + FNMADDxw(d0, v1, v2, v0); + VEXTRINSxw(v0, d0, 0); + break; + case 0xDB: + INST_NAME("VAESIMC Gx, Ex"); + nextop = F8; + GETEYx(q1, 0, 0); + GETGYx_empty(q0); + if (q0 != q1) { + VOR_V(q0, q1, q1); + } + avx_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); + CALL(const_native_aesimc, -1, x1, 0); + GETGYx(q0, 1); // reget writable for mark zeroup hi-128bits. + break; + case 0xDC: + INST_NAME("VAESENC Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(q0, q1, q2, 0); + if (MODREG && (gd == (nextop & 7) + (rex.b << 3))) { + d0 = fpu_get_scratch(dyn); + VOR_Vxy(d0, q2, q2); + } else + d0 = -1; + if (gd != vex.v) { + VOR_Vxy(q0, q1, q1); + } + avx_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); + CALL(const_native_aese, -1, x1, 0); + if (vex.l) { + MOV32w(x1, gd); + CALL(const_native_aese_y, -1, x1, 0); + } + GETGYxy(q0, 1); + VXOR_Vxy(q0, q0, (d0 != -1) ? d0 : q2); + break; + case 0xDD: + INST_NAME("VAESENCLAST Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(q0, q1, q2, 0); + if (MODREG && (gd == (nextop & 7) + (rex.b << 3))) { + d0 = fpu_get_scratch(dyn); + VOR_Vxy(d0, q2, q2); + } else + d0 = -1; + if (gd != vex.v) { + VOR_Vxy(q0, q1, q1); + } + avx_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); + CALL(const_native_aeselast, -1, x1, 0); + if (vex.l) { + MOV32w(x1, gd); + CALL(const_native_aeselast_y, -1, x1, 0); + } + GETGYxy(q0, 1); + VXOR_Vxy(q0, q0, (d0 != -1) ? d0 : q2); + break; + case 0xDE: + INST_NAME("VAESDEC Gx, Vx, Ex"); // AES-NI + nextop = F8; + GETGY_empty_VYEY_xy(q0, q1, q2, 0); + if (MODREG && (gd == (nextop & 7) + (rex.b << 3))) { + d0 = fpu_get_scratch(dyn); + VOR_Vxy(d0, q2, q2); + } else + d0 = -1; + if (gd != vex.v) { + VOR_Vxy(q0, q1, q1); + } + avx_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); + CALL(const_native_aesd, -1, x1, 0); + if (vex.l) { + MOV32w(x1, gd); + CALL(const_native_aesd_y, -1, x1, 0); + } + GETGYxy(q0, 1); + VXOR_Vxy(q0, q0, (d0 != -1) ? d0 : q2); + break; + case 0xDF: + INST_NAME("VAESDECLAST Gx, Vx, Ex"); // AES-NI + nextop = F8; + GETGY_empty_VYEY_xy(q0, q1, q2, 0); + if (MODREG && (gd == (nextop & 7) + (rex.b << 3))) { + d0 = fpu_get_scratch(dyn); + VOR_Vxy(d0, q2, q2); + } else + d0 = -1; + if (gd != vex.v) { + VOR_Vxy(q0, q1, q1); + } + avx_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); + CALL(const_native_aesdlast, -1, x1, 0); + if (vex.l) { + MOV32w(x1, gd); + CALL(const_native_aesdlast_y, -1, x1, 0); + } + GETGYxy(q0, 1); + VXOR_Vxy(q0, q0, (d0 != -1) ? d0 : q2); + break; + case 0xF7: + INST_NAME("SHLX Gd, Ed, Vd"); + nextop = F8; + GETGD; + GETED(0); + GETVD; + ANDI(x5, vd, rex.w ? 0x3f : 0x1f); + SLLxw(gd, ed, x5); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_avx_66_0f3a.c b/src/dynarec/la64/dynarec_la64_avx_66_0f3a.c new file mode 100644 index 0000000..05a37f2 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_avx_66_0f3a.c @@ -0,0 +1,812 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "env.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_66_0F3A(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed; + uint8_t wback, wb1, wb2; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u; + int64_t j64; + int64_t fixedaddress; + int unscaled; + MAYUSE(wb1); + MAYUSE(wb2); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(gb1); + MAYUSE(gb2); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(s0); + MAYUSE(j64); + MAYUSE(cacheupd); +#if STEP > 1 + static const int8_t round_round[] = { + 0x3, // round to nearest with ties to even + 0x0, // round toward minus infinity + 0x1, // round toward plus infinity + 0x2 // round toward zero + }; +#endif + rex_t rex = vex.rex; + + switch (opcode) { + case 0x00: + case 0x01: + if (opcode) { + INST_NAME("VPERMPD Gx, Ex, Imm8"); + } else { + INST_NAME("VPERMQ Gx, Ex, Imm8"); + } + nextop = F8; + if (!vex.l) EMIT(0); + GETGY_empty_EY_xy(v0, v1, 1); + u8 = F8; + XVPERMI_D(v0, v1, u8); + break; + case 0x02: + case 0x0C: + if (opcode == 0x2) { + INST_NAME("VPBLENDD Gx, Vx, Ex, Ib"); + } else { + INST_NAME("VBLENDPS Gx, Vx, Ex, Ib"); + } + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8; + d0 = fpu_get_scratch(dyn); + if (vex.l) { + // 256bits fast path + if (u8 == 0) { + if (v0 != v1) XVOR_V(v0, v1, v1); + break; + } else if (u8 == 0xFF) { + if (v0 != v2) XVOR_V(v0, v2, v2); + break; + } + } else { + // VEX.128 128bits fast path + if ((u8 & 0xf) == 0) { + if (v0 != v1) VOR_V(v0, v1, v1); + break; + } else if ((u8 & 0xf) == 0xF) { + if (v0 != v2) VOR_V(v0, v2, v2); + break; + } + } + tmp64u = 0; + for (int i = 0; i < 8; i++) { + if (u8 & (1 << i)) tmp64u |= (0xffULL << (i * 8)); + } + MOV64x(x5, tmp64u); + MOVGR2FR_D(d0, x5); + VEXT2XV_W_B(d0, d0); + XVBITSEL_V(v0, v1, v2, d0); + break; + case 0x04: + INST_NAME("VPERMILPS Gx, Ex, Imm8"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 1); + u8 = F8; + VSHUF4Ixy(W, v0, v1, u8); + break; + case 0x05: + INST_NAME("VPERMILPD Gx, Ex, Imm8"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 1); + u8 = F8; + u8 = 0b10100000 + ((u8 & 0b00001000) << 3) + ((u8 & 0b00000100) << 2) + ((u8 & 0b00000010) << 1) + (u8 & 0b00000001); + XVPERMI_D(v0, v1, u8); + break; + case 0x06: + case 0x46: + if (opcode == 0x06) { + INST_NAME("VPERM2F128 Gx, Vx, Ex, Imm8"); + } else { + INST_NAME("VPERM2I128 Gx, Vx, Ex, Imm8"); + } + nextop = F8; + if (!vex.l) EMIT(0); + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8; + if ((u8 & 0x88) == 0x88) { + XVXOR_V(v0, v0, v0); + break; + } + d0 = fpu_get_scratch(dyn); + uint8_t zero_low = (u8 & 0x8) >> 3; + uint8_t zero_up = (u8 & 0x80) >> 7; + uint8_t vec_lo = (u8 & 0x2) >> 1; + uint8_t index_lo = u8 & 0x1; + uint8_t vec_hi = (u8 & 0x20) >> 5; + uint8_t index_hi = (u8 & 0x10) >> 4; + if (!zero_low && !zero_up) { + if (v0 == v1) { + XVPERMI_Q(v0, v2, XVPERMI_IMM_4_0((vec_hi ? 0 : 2) | index_hi, (vec_lo ? 0 : 2) | index_lo)); + } else if (v0 == v2) { + XVPERMI_Q(v0, v1, XVPERMI_IMM_4_0((vec_hi << 1) | index_hi, ((vec_lo) << 1) | index_lo)); + } else { + XVOR_V(v0, v2, v2); + XVPERMI_Q(v0, v1, XVPERMI_IMM_4_0((vec_hi << 1) | index_hi, ((vec_lo) << 1) | index_lo)); + } + break; + } + XVXOR_V(d0, d0, d0); + if (zero_low) { + XVORI_B(v0, vec_hi ? v2 : v1, 0); + XVPERMI_Q(v0, d0, XVPERMI_IMM_4_0(2 + index_hi, 0)); + } else { + XVORI_B(v0, vec_lo ? v2 : v1, 0); + XVPERMI_Q(v0, d0, XVPERMI_IMM_4_0(0, 2 + index_lo)); + } + break; + case 0x08: + INST_NAME("VROUNDPS Gx, Ex, Ib"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 1); + u8 = F8; + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x1, x2); + if (vex.l) { + XVFRINT_S(v0, v1); + } else { + VFRINT_S(v0, v1); + } + x87_restoreround(dyn, ninst, u8); + } else { + if (vex.l) { + XVFRINTRRD_S(v0, v1, round_round[u8 & 3]); + } else { + VFRINTRRD_S(v0, v1, round_round[u8 & 3]); + } + } + break; + case 0x09: + INST_NAME("VROUNDPD Gx, Ex, Ib"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 1); + u8 = F8; + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x1, x2); + if (vex.l) { + XVFRINT_D(v0, v1); + } else { + VFRINT_D(v0, v1); + } + x87_restoreround(dyn, ninst, u8); + } else { + if (vex.l) { + XVFRINTRRD_D(v0, v1, round_round[u8 & 3]); + } else { + VFRINTRRD_D(v0, v1, round_round[u8 & 3]); + } + } + break; + case 0x0A: + INST_NAME("VROUNDSS Gx, Vx, Ex, Ib"); + nextop = F8; + GETEYSS(v2, 0, 1); + GETVYx(v1, 0); + GETGYx_empty(v0); + u8 = F8; + d0 = fpu_get_scratch(dyn); + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x1, x2); + VFRINT_S(d0, v2); + x87_restoreround(dyn, ninst, u8); + } else { + VFRINTRRD_S(d0, v2, round_round[u8 & 3]); + } + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, d0, 0); + break; + case 0x0B: + INST_NAME("VROUNDSD Gx, Vx, Ex, Ib"); + nextop = F8; + GETEYSD(v2, 0, 1); + GETVYx(v1, 0); + GETGYx_empty(v0); + u8 = F8; + d0 = fpu_get_scratch(dyn); + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x1, x2); + VFRINT_D(d0, v2); + x87_restoreround(dyn, ninst, u8); + } else { + VFRINTRRD_D(d0, v2, round_round[u8 & 3]); + } + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_D(v0, d0, 0); + break; + case 0x0D: + INST_NAME("VBLENDPD Gx, Vx, Ex, Ib"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8; + + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + if (vex.l) { + u8 = u8 & 0b1111; + if (u8 == 0b0000) { + XVOR_V(v0, v1, v1); + break; + } + if (u8 == 0b1111) { + XVOR_V(v0, v2, v2); + break; + } + if (u8 == 0b0011) { + if (v0 == v1) { + XVPERMI_Q(v0, v2, XVPERMI_IMM_4_0(3, 0)); + } else { + XVOR_V(v0, v2, v2); + XVPERMI_Q(v0, v1, XVPERMI_IMM_4_0(1, 2)); + } + break; + } + if (u8 == 0b1100) { + if (v0 == v1) { + XVPERMI_Q(v0, v2, XVPERMI_IMM_4_0(1, 2)); + } else { + XVOR_V(v0, v2, v2); + XVPERMI_Q(v0, v1, XVPERMI_IMM_4_0(3, 0)); + } + break; + } + XVOR_V(d0, v1, v1); + XVOR_V(d1, v1, v1); + if (u8 & 1) XVEXTRINS_D(d0, v2, VEXTRINS_IMM_4_0(0, 0)); + if (u8 & 2) XVEXTRINS_D(d0, v2, VEXTRINS_IMM_4_0(1, 1)); + if (u8 & 4) XVEXTRINS_D(d1, v2, VEXTRINS_IMM_4_0(0, 0)); + if (u8 & 8) XVEXTRINS_D(d1, v2, VEXTRINS_IMM_4_0(1, 1)); + XVPERMI_Q(d0, d1, XVPERMI_IMM_4_0(1, 2)); + XVOR_V(v0, d0, d0); + } else { + u8 = u8 & 0b11; + switch (u8) { + case 0b00: + VOR_V(v0, v1, v1); + break; + case 0b11: + VOR_V(v0, v2, v2); + break; + case 0b01: + VEXTRINS_D(v0, v1, VEXTRINS_IMM_4_0(1, 1)); + VEXTRINS_D(v0, v2, VEXTRINS_IMM_4_0(0, 0)); + break; + case 0b10: + VEXTRINS_D(v0, v1, VEXTRINS_IMM_4_0(0, 0)); + VEXTRINS_D(v0, v2, VEXTRINS_IMM_4_0(1, 1)); + } + } + break; + case 0x0E: + INST_NAME("VPBLENDW Gx, Vx, Ex, Ib"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8; + d0 = fpu_get_scratch(dyn); + if (u8 == 0) { + if (v0 != v1) VOR_Vxy(v0, v1, v1); + break; + } else if (u8 == 0xFF) { + if (v0 != v2) VOR_Vxy(v0, v2, v2); + break; + } + tmp64u = 0; + for (int i = 0; i < 8; i++) { + if (u8 & (1 << i)) tmp64u |= (0xffULL << (i * 8)); + } + MOV64x(x5, tmp64u); + MOVGR2FR_D(d0, x5); + VEXT2XV_H_B(d0, d0); + XVPERMI_Q(d0, d0, 0); + XVBITSEL_V(v0, v1, v2, d0); + break; + case 0x0F: + INST_NAME("VPALIGNR Gx, Vx, Ex, Ib"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + if (vex.l) { + if (u8 > 31) { + XVXOR_V(v0, v0, v0); + break; + } else { + if (u8 > 15) { + XVBSRL_V(v0, v1, u8 - 16); + } else if (!u8) { + XVOR_V(v0, v2, v2); + } else { + XVBSLL_V(d0, v1, 16 - u8); + XVBSRL_V(d1, v2, u8); + XVOR_V(v0, d0, d1); + } + } + } else { + if (u8 > 31) { + XVXOR_V(v0, v0, v0); + YMM_UNMARK_UPPER_ZERO(v0); + } else if (u8 > 15) { + VBSRL_V(v0, v1, u8 - 16); + } else if (!u8) { + VOR_V(v0, v2, v2); + } else { + VBSLL_V(d0, v1, 16 - u8); + VBSRL_V(d1, v2, u8); + VOR_V(v0, d0, d1); + } + } + break; + case 0x14: + INST_NAME("VPEXTRB Ed, Gx, imm8"); + nextop = F8; + GETGYx(q0, 0); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + u8 = (F8) & 15; + VPICKVE2GR_BU(ed, q0, u8); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x4, &fixedaddress, rex, NULL, 0, 1); + u8 = (F8) & 15; + VSTELM_B(q0, wback, 0, u8); + SMWRITE2(); + } + break; + case 0x15: + INST_NAME("VPEXTRW Ed, Gx, imm8"); + nextop = F8; + GETGYx(q0, 0); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + u8 = (F8) & 7; + VPICKVE2GR_HU(ed, q0, u8); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x4, &fixedaddress, rex, NULL, 0, 1); + u8 = (F8) & 7; + VSTELM_H(q0, wback, 0, u8); + SMWRITE2(); + } + break; + case 0x16: + if (rex.w) { + INST_NAME("VPEXTRQ Ed, Gx, Ib"); + } else { + INST_NAME("VPEXTRD Ed, Gx, Ib"); + } + nextop = F8; + GETGYx(q0, 0); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + u8 = F8; + if (rex.w) { + VPICKVE2GR_D(ed, q0, (u8 & 1)); + } else { + VPICKVE2GR_WU(ed, q0, (u8 & 3)); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x5, &fixedaddress, rex, NULL, 0, 1); + u8 = F8; + if (rex.w) { + VSTELM_D(q0, ed, 0, (u8 & 1)); + } else { + VSTELM_W(q0, ed, 0, (u8 & 3)); + } + SMWRITE2(); + } + break; + case 0x17: + INST_NAME("VEXTRACTPS Ed, Gx, imm8"); + nextop = F8; + GETGYx(v0, 0); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + u8 = F8 & 0b11; + VPICKVE2GR_WU(ed, v0, u8); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x5, &fixedaddress, rex, NULL, 0, 1); + u8 = F8 & 0b11; + VSTELM_W(v0, ed, 0, u8); + SMWRITE2(); + } + break; + case 0x18: + case 0x38: + if (opcode == 0x18) { + INST_NAME("VINSERTF128 Gx, Vx, Ex, imm8"); + } else { + INST_NAME("VINSERTI128 Gx, Vx, Ex, imm8"); + } + nextop = F8; + GETEYx(q2, 0, 1); + GETVYy(q1, 0); + GETGYy_empty(q0); + u8 = F8; + if (q0 != q2) { + if (q0 != q1) XVOR_V(q0, q1, q1); + XVPERMI_Q(q0, q2, ((u8 & 1) == 0) ? 0x30 : 0x02); + } else { + XVPERMI_Q(q0, q1, ((u8 & 1) == 0) ? 0x12 : 0x20); + } + break; + case 0x19: + case 0x39: + if (opcode == 0x19) { + INST_NAME("VEXTRACTF128 Ex, Gx, imm8"); + } else { + INST_NAME("VEXTRACTI128 Ex, Gx, imm8"); + } + nextop = F8; + GETGYy(q0, 0); + if (MODREG) { + GETEYx_empty(q1, 1); + u8 = F8; + if ((u8 & 1) == 0) { + VOR_V(q1, q0, q0); + } else { + XVPERMI_Q(q1, q0, XVPERMI_IMM_4_0(3, 1)); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 0, 1); + u8 = F8; + if ((u8 & 1) == 1) { + XVSTELM_D(q0, ed, 0, 2); + XVSTELM_D(q0, ed, 1, 3); + } else { + VST(q0, ed, fixedaddress); + } + SMWRITE2(); + } + break; + case 0x1D: + INST_NAME("VCVTPS2PH Ex, Gx, Ib"); + nextop = F8; + GETGYxy(v0, 0); + if (vex.l) { + GETEYx(v1, 1, 1); + } else { + GETEYSD(v1, 1, 1); + } + u8 = F8; + d0 = fpu_get_scratch(dyn); + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x1, x2); + } else { + MOVFCSR2GR(x4, FCSR3); + ORI(x5, x5, round_round[u8 & 3]); + SLLI_D(x5, x5, 8); + MOVGR2FCSR(FCSR3, x5); + u8 = x4; + } + if (vex.l) { + XVXOR_V(d0, d0, d0); + XVFCVT_H_S(v1, d0, v0); + XVPERMI_D(v1, v1, 0b11011000); + PUTEYx(v1); + } else { + XVXOR_V(d0, d0, d0); + VFCVT_H_S(v1, d0, v0); + PUTEYSD(v1); + } + x87_restoreround(dyn, ninst, u8); + break; + case 0x20: + INST_NAME("VPINSRB Gx, Vx, ED, Ib"); + nextop = F8; + GETEB(x5, 1); + GETVYx(v1, 0); + GETGYx_empty(v0); + u8 = F8; + if (v0 != v1) VOR_V(v0, v1, v1); + VINSGR2VR_B(v0, ed, (u8 & 0xf)); + break; + case 0x21: + INST_NAME("VINSERTPS Gx, Vx, Ex, Ib"); + nextop = F8; + q1 = fpu_get_scratch(dyn); + if (MODREG) { + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8; + if (v0 == v2) { + VOR_V(q1, v2, v2); + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, q1, VEXTRINS_IMM_4_0((u8 >> 4) & 3, (u8 >> 6) & 3)); + } else { + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, v2, VEXTRINS_IMM_4_0((u8 >> 4) & 3, (u8 >> 6) & 3)); + } + } else { + GETVYx(v1, 0); + GETGYx_empty(v0); + if (v0 != v1) VOR_V(v0, v1, v1); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x5, &fixedaddress, rex, NULL, 1, 1); + u8 = F8; + FLD_S(q1, wback, fixedaddress); + VEXTRINS_W(v0, q1, VEXTRINS_IMM_4_0((u8 >> 4) & 3, 0)); // src index is zero when Ex is mem operand + } + uint8_t zmask = u8 & 0xf; + if (zmask) { + VXOR_V(q1, q1, q1); + for (uint8_t i = 0; i < 4; i++) { + if (zmask & (1 << i)) { + VEXTRINS_W(v0, q1, VEXTRINS_IMM_4_0(i, 0)); + } + } + } + break; + case 0x22: + if (rex.w) { + INST_NAME("VPINSRQ Gx, Vx, ED, Ib"); + } else { + INST_NAME("VPINSRD Gx, Vx, ED, Ib"); + } + nextop = F8; + GETED(1); + GETVYx(v1, 0); + GETGYx_empty(v0); + u8 = F8; + if (v0 != v1) VOR_V(v0, v1, v1); + if (rex.w) { + VINSGR2VR_D(v0, ed, (u8 & 0x1)); + } else { + VINSGR2VR_W(v0, ed, (u8 & 0x3)); + } + break; + case 0x40: + INST_NAME("VDPPS Gx, Vx, Ex, Ib"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + d2 = fpu_get_scratch(dyn); + VFMULxy(S, d0, v1, v2); + VXOR_Vxy(d2, d2, d2); + for (int i = 0; i < 4; ++i) { + if (!(u8 & (1 << (4 + i)))) { + VEXTRINSxy(W, d0, d2, (i << 4)); + } + } + VSHUF4Ixy(W, d1, d0, 0b10110001); // v0[a,b,c,d] v1[b,a,d,c] + VFADDxy(S, d0, d0, d1); // v0[ab,ba,cd,dc] + VSHUF4Ixy(W, d1, d0, 0b01001110); // v1[cd,dc,ab,ba] + VFADDxy(S, d0, d0, d1); // v0[abcd,badc,cdab,dcba] + VREPLVEIxy(W, v0, d0, 0); + for (int i = 0; i < 4; ++i) { + if (!(u8 & (1 << i))) { + VEXTRINSxy(W, v0, d2, (i << 4)); + } + } + break; + case 0x41: + INST_NAME("VDPPD Gx, Vx, Ex, Ib"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + d2 = fpu_get_scratch(dyn); + VFMULxy(D, d0, v1, v2); + VXOR_Vxy(d2, d2, d2); + for (int i = 0; i < 2; ++i) { + if (!(u8 & (1 << (4 + i)))) { + VEXTRINSxy(D, d0, d2, (i << 4)); + } + } + VSHUF4Ixy(W, d1, d0, 0b01001110); // v0[a,b] v1[b,a] + VFADDxy(D, d0, d0, d1); // v0[ab,ba] + VREPLVEIxy(D, v0, d0, 0); + for (int i = 0; i < 2; ++i) { + if (!(u8 & (1 << i))) { + VEXTRINSxy(D, v0, d2, (i << 4)); + } + } + break; + case 0x42: + INST_NAME("VMPSADBW Gx, Vx, Ex, Ib"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + u8 = F8; + if (vex.l) { + uint8_t low_blk2_offset = 4 * (u8 & 3); + uint8_t low_blk1_offset = 4 * ((u8 >> 2) & 1); + uint8_t high_blk2_offset = 4 * ((u8 >> 3) & 3); + uint8_t high_blk1_offset = 4 * ((u8 >> 5) & 1); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + q2 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + if (low_blk1_offset == high_blk1_offset) { + // generate hi128/low128 mask in one shot + XVMEPATMSK_V(d0, 1, low_blk1_offset); + XVMEPATMSK_V(d1, 1, low_blk1_offset + 4); + XVSHUF_B(q0, v1, v1, d0); + XVSHUF_B(q2, v1, v1, d1); + } else { + XVMEPATMSK_V(d0, 1, low_blk1_offset); + XVMEPATMSK_V(d1, 1, high_blk1_offset); + XVSHUF_B(q0, v1, v1, d0); + XVSHUF_B(q1, v1, v1, d1); + XVPERMI_Q(q0, q1, XVPERMI_IMM_4_0(1, 2)); + XVMEPATMSK_V(d0, 1, low_blk1_offset + 4); + XVMEPATMSK_V(d1, 1, high_blk1_offset + 4); + XVSHUF_B(q2, v1, v1, d0); + XVSHUF_B(q1, v1, v1, d1); + XVPERMI_Q(q2, q1, XVPERMI_IMM_4_0(1, 2)); + } + if (low_blk2_offset == high_blk2_offset) { + // generate hi128/low128 mask in one shot + XVBSRL_V(q1, v2, low_blk2_offset); + XVSHUF4I_W(q1, q1, 0b00000000); + } else { + XVBSRL_V(q1, v2, low_blk2_offset); + XVBSRL_V(d1, v2, high_blk2_offset); + XVPERMI_Q(q1, d1, XVPERMI_IMM_4_0(1, 2)); + XVSHUF4I_W(q1, q1, 0b00000000); + } + XVABSD_BU(d0, q0, q1); + XVABSD_BU(d1, q2, q1); + XVHADDW_HU_BU(d0, d0, d0); + XVHADDW_HU_BU(d1, d1, d1); + XVHADDW_WU_HU(d0, d0, d0); + XVHADDW_WU_HU(d1, d1, d1); + XVSSRANI_HU_W(d0, d0, 0); + XVSSRANI_HU_W(d1, d1, 0); + XVEXTRINS_D(v0, d0, VEXTRINS_IMM_4_0(0, 0)); + XVEXTRINS_D(v0, d1, VEXTRINS_IMM_4_0(1, 0)); + } else { + uint8_t blk2_offset = 4 * (u8 & 3); + uint8_t blk1_offset = 4 * ((u8 >> 2) & 1); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + q2 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VMEPATMSK_V(d0, 1, blk1_offset); + VMEPATMSK_V(d1, 1, blk1_offset + 4); + VSHUF_B(q0, v1, v1, d0); + VSHUF_B(q2, v1, v1, d1); + VBSRL_V(q1, v2, blk2_offset); + VSHUF4I_W(q1, q1, 0b00000000); + + VABSD_BU(d0, q0, q1); + VABSD_BU(d1, q2, q1); + VHADDW_HU_BU(d0, d0, d0); + VHADDW_HU_BU(d1, d1, d1); + VHADDW_WU_HU(d0, d0, d0); + VHADDW_WU_HU(d1, d1, d1); + VSSRANI_HU_W(d0, d0, 0); + VSSRANI_HU_W(d1, d1, 0); + VEXTRINS_D(v0, d0, VEXTRINS_IMM_4_0(0, 0)); + VEXTRINS_D(v0, d1, VEXTRINS_IMM_4_0(1, 0)); + } + break; + case 0x44: + INST_NAME("VPCLMULQDQ Gx, Vx, Ex, Ib"); + nextop = F8; + GETG; + avx_forget_reg(dyn, ninst, gd); + avx_reflect_reg(dyn, ninst, vex.v); + MOV32w(x1, gd); // gx + MOV32w(x2, vex.v); // vx + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + avx_forget_reg(dyn, ninst, ed); + MOV32w(x3, ed); // ex + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x5, &fixedaddress, rex, NULL, 0, 1); + if (ed != x3) MV(x3, ed); + } + u8 = F8; + MOV32w(x4, u8); + CALL4_(vex.l ? const_native_pclmul_y : const_native_pclmul_x, -1, x3, x1, x2, x3, x4); + if (!vex.l) { + ST_D(xZR, xEmu, offsetof(x64emu_t, ymm[gd])); + ST_D(xZR, xEmu, offsetof(x64emu_t, ymm[gd]) + 8); + } + break; + case 0x4A: + INST_NAME("VBLENDVPS Gx, Vx, Ex, XMMImm8"); + nextop = F8; + u8 = geted_ib(dyn, addr, ninst, nextop) >> 4; + d0 = avx_get_reg(dyn, ninst, x5, u8, 0, LSX_AVX_WIDTH_128); + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + F8; + q0 = fpu_get_scratch(dyn); + VSLTIxy(W, q0, d0, 0); + VBITSEL_Vxy(v0, v1, v2, q0); + break; + case 0x4B: + INST_NAME("VBLENDVPD Gx, Vx, Ex, XMMImm8"); + nextop = F8; + u8 = geted_ib(dyn, addr, ninst, nextop) >> 4; + d0 = avx_get_reg(dyn, ninst, x5, u8, 0, LSX_AVX_WIDTH_128); + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + F8; + q0 = fpu_get_scratch(dyn); + VSLTIxy(D, q0, d0, 0); + VBITSEL_Vxy(v0, v1, v2, q0); + break; + case 0x4C: + INST_NAME("VPBLENDVB Gx, Vx, Ex, XMMImm8"); + nextop = F8; + u8 = geted_ib(dyn, addr, ninst, nextop) >> 4; + d0 = avx_get_reg(dyn, ninst, x5, u8, 0, LSX_AVX_WIDTH_128); + GETGY_empty_VYEY_xy(v0, v1, v2, 1); + F8; + q0 = fpu_get_scratch(dyn); + VSLTIxy(B, q0, d0, 0); + VBITSEL_Vxy(v0, v1, v2, q0); + break; + case 0xDF: + INST_NAME("VAESKEYGENASSIST Gx, Ex, Ib"); + nextop = F8; + GETG; + avx_forget_reg(dyn, ninst, gd); + MOV32w(x1, gd); // gx + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + avx_forget_reg(dyn, ninst, ed); + MOV32w(x2, ed); + MOV32w(x3, 0); // p = NULL + } else { + MOV32w(x2, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 1); + if (ed != x3) { + MV(x3, ed); + } + } + u8 = F8; + MOV32w(x4, u8); + CALL4(const_native_aeskeygenassist, -1, x1, x2, x3, x4); + if (!vex.l) { + ST_D(xZR, xEmu, offsetof(x64emu_t, ymm[gd])); + ST_D(xZR, xEmu, offsetof(x64emu_t, ymm[gd]) + 8); + } + break; + + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_avx_f2_0f.c b/src/dynarec/la64/dynarec_la64_avx_f2_0f.c new file mode 100644 index 0000000..73ecc5e --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_avx_f2_0f.c @@ -0,0 +1,516 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "env.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_F2_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u, u64; + int64_t j64; + int64_t fixedaddress; + int unscaled; + MAYUSE(wb1); + MAYUSE(wb2); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(gb1); + MAYUSE(gb2); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(s0); + MAYUSE(j64); + MAYUSE(cacheupd); + + rex_t rex = vex.rex; + + switch (opcode) { + + case 0x10: + INST_NAME("VMOVSD Gx, [Vx,] Ex"); + nextop = F8; + if (MODREG) { + GETVYx(q1, 0); + GETEYSD(q2, 0, 0); + GETGYx_empty(q0); + if (q0 != q2) VEXTRINS_D(q0, q2, 0b00000); + if (q0 != q1) VEXTRINS_D(q0, q1, 0b10001); + } else { + GETEYSD(q2, 0, 0); + GETGYx_empty(q0); + XVPICKVE_D(q0, q2, 0); + YMM_UNMARK_UPPER_ZERO(q0); + } + break; + case 0x11: + INST_NAME("VMOVSD Ex, [Vx,] Gx"); + nextop = F8; + GETGYx(q2, 0); + if (MODREG) { + GETVYx(q1, 0); + GETEYSD(q0, 1, 0); + if (q0 != q2) VEXTRINS_D(q0, q2, 0b00000); + if (q0 != q1) VEXTRINS_D(q0, q1, 0b10001); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FST_D(q2, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0x12: + INST_NAME("VMOVDDUP Gx, Ex"); + nextop = F8; + if (MODREG) { + GETGY_empty_EY_xy(q0, q1, 0); + } else { + GETGYxy_empty(q0); + q1 = fpu_get_scratch(dyn); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 0, 0); + if (vex.l) { + XVLD(q1, ed, 0); + } else { + VLDREPL_D(q0, ed, 0); + } + } + if (vex.l) { + XVSHUF4I_D(q0, q1, 0b1010); + } else if (MODREG) { + VREPLVE_D(q0, q1, 0); + } + break; + case 0x2A: + INST_NAME("VCVTSI2SD Gx, Vx, Ed"); + nextop = F8; + GETED(0); + GETVYx(v1, 0); + GETGYx_empty(v0); + d1 = fpu_get_scratch(dyn); + if (!BOX64ENV(dynarec_fastround)) { + u8 = sse_setround(dyn, ninst, x2, x3); + } + if (rex.w) { + MOVGR2FR_D(d1, ed); + FFINT_D_L(d1, d1); + } else { + MOVGR2FR_W(d1, ed); + FFINT_D_W(d1, d1); + } + if (!BOX64ENV(dynarec_fastround)) { + x87_restoreround(dyn, ninst, u8); + } + if(v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_D(v0, d1, 0); + break; + case 0x2C: + INST_NAME("VCVTTSD2SI Gd, Ex"); + nextop = F8; + GETGD; + GETEYSD(q0, 0, 0); + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + d1 = fpu_get_scratch(dyn); + if (rex.w) { + FTINTRZ_L_D(d1, q0); + MOVFR2GR_D(gd, d1); + } else { + FTINTRZ_W_D(d1, q0); + MOVFR2GR_S(gd, d1); + ZEROUP(gd); + } + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + MOV32w(x3, (1 << FR_V) | (1 << FR_O)); + AND(x5, x5, x3); + CBZ_NEXT(x5); + if (rex.w) { + MOV64x(gd, 0x8000000000000000LL); + } else { + MOV32w(gd, 0x80000000); + } + } + break; + case 0x2D: + INST_NAME("VCVTSD2SI Gd, Ex"); + nextop = F8; + GETGD; + GETEYSD(q0, 0, 0); + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + d1 = fpu_get_scratch(dyn); + u8 = sse_setround(dyn, ninst, x2, x3); + if (rex.w) { + FTINT_L_D(d1, q0); + MOVFR2GR_D(gd, d1); + } else { + FTINT_W_D(d1, q0); + MOVFR2GR_S(gd, d1); + ZEROUP(gd); + } + x87_restoreround(dyn, ninst, u8); + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + MOV32w(x3, (1 << FR_V) | (1 << FR_O)); + AND(x5, x5, x3); + CBZ_NEXT(x5); + if (rex.w) { + MOV64x(gd, 0x8000000000000000LL); + } else { + MOV32w(gd, 0x80000000); + } + } + break; + case 0x51: + INST_NAME("VSQRTSD Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSD(v2, 0, 0); + GETGYx_empty(v0); + d1 = fpu_get_scratch(dyn); + FSQRT_D(d1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + VXOR_V(d0, d0, d0); + FCMP_D(fcc0, v2, d0, cLT); + BCEQZ(fcc0, 4 + 4); + FNEG_D(d1, d1); + } + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_D(v0, d1, 0); + break; + case 0x58: + INST_NAME("VADDSD Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSD(v2, 0, 0); + GETGYx_empty(v0); + d0 = fpu_get_scratch(dyn); + FADD_D(d0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + FCMP_D(fcc0, v1, v2, cUN); + BCNEZ_MARK(fcc0); + FCMP_D(fcc1, d0, d0, cOR); + BCNEZ_MARK(fcc1); + FNEG_D(d0, d0); + } + MARK; + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_D(v0, d0, 0); + break; + case 0x59: + INST_NAME("VMULSD Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSD(v2, 0, 0); + GETGYx_empty(v0); + d0 = fpu_get_scratch(dyn); + FMUL_D(d0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + FCMP_D(fcc0, v1, v2, cUN); + BCNEZ_MARK(fcc0); + FCMP_D(fcc1, d0, d0, cOR); + BCNEZ_MARK(fcc1); + FNEG_D(d0, d0); + } + MARK; + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_D(v0, d0, 0); + break; + case 0x5A: + INST_NAME("VCVTSD2SS Gx, Vx, Ex"); + nextop = F8; + GETEYSD(v2, 0, 0); + GETVYx(v1, 0); + GETGYx_empty(v0); + d0 = fpu_get_scratch(dyn); + FCVT_S_D(d0, v2); + if(v0 != v1) VOR_V(v0, v1, v1); + XVINSVE0_W(v0, d0, 0); + break; + case 0x5C: + INST_NAME("VSUBSD Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSD(v2, 0, 0); + GETGYx_empty(v0); + d0 = fpu_get_scratch(dyn); + FSUB_D(d0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + FCMP_D(fcc0, v1, v2, cUN); + BCNEZ_MARK(fcc0); + FCMP_D(fcc1, d0, d0, cOR); + BCNEZ_MARK(fcc1); + FNEG_D(d0, d0); + } + MARK; + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_D(v0, d0, 0); + break; + case 0x5D: + INST_NAME("VMINSD Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSD(v2, 0, 0); + GETGYx_empty(v0); + q0 = fpu_get_scratch(dyn); + if (BOX64ENV(dynarec_fastnan)) { + FMIN_D(q0, v1, v2); + } else { + FCMP_D(fcc0, v2, v1, cULE); + FSEL(q0, v1, v2, fcc0); + } + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_D(v0, q0, 0); + break; + case 0x5E: + INST_NAME("VDIVSD Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSD(v2, 0, 0); + GETGYx_empty(v0); + d0 = fpu_get_scratch(dyn); + FDIV_D(d0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + FCMP_D(fcc0, v1, v2, cUN); + BCNEZ_MARK(fcc0); + FCMP_D(fcc1, d0, d0, cOR); + BCNEZ_MARK(fcc1); + FNEG_D(d0, d0); + } + MARK; + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_D(v0, d0, 0); + break; + case 0x5F: + INST_NAME("VMAXSD Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSD(v2, 0, 0); + GETGYx_empty(v0); + q0 = fpu_get_scratch(dyn); + if (BOX64ENV(dynarec_fastnan)) { + FMAX_D(q0, v1, v2); + } else { + FCMP_D(fcc0, v2, v1, cLT); + FSEL(q0, v2, v1, fcc0); + } + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_D(v0, q0, 0); + break; + case 0x70: + INST_NAME("VPSHUFLW Gx, Ex, Ib"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 1); + u8 = F8; + d0 = fpu_get_scratch(dyn); + if (v0 != v1) { + VSHUF4Ixy(H, v0, v1, u8); + VEXTRINSxy(D, v0, v1, VEXTRINS_IMM_4_0(1, 1)); + } else { + VSHUF4Ixy(H, d0, v1, u8); + VEXTRINSxy(D, v0, d0, VEXTRINS_IMM_4_0(0, 0)); + } + break; + case 0x7C: + INST_NAME("VHADDPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + VPICKEVxy(W, q0, v2, v1); + VPICKODxy(W, v0, v2, v1); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(S, d0, q0, v0, cUN); + } + VFADDxy(S, v0, q0, v0); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(S, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b010 << 9) | 0b1111111100); + VSLLIxy(W, d1, d1, 20); // broadcast 0xFFC00000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0x7D: + INST_NAME("VHSUBPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + q0 = fpu_get_scratch(dyn); + VPICKEVxy(W, q0, v2, v1); + VPICKODxy(W, v0, v2, v1); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(S, d0, q0, v0, cUN); + } + VFSUBxy(S, v0, q0, v0); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(S, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b010 << 9) | 0b1111111100); + VSLLIxy(W, d1, d1, 20); // broadcast 0xFFC00000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0xC2: + INST_NAME("VCMPSD Gx, Vx, Ex, Ib"); + nextop = F8; + GETVYx(v1, 0); + GETEYSD(v2, 0, 1); + GETGYx(v0, 1); + q0 = fpu_get_scratch(dyn); + u8 = F8; + switch (u8 & 0xf) { + case 0x00: VFCMP_D(q0, v1, v2, cEQ); break; // Equal, not unordered + case 0x01: VFCMP_D(q0, v1, v2, cLT); break; // Less than + case 0x02: VFCMP_D(q0, v1, v2, cLE); break; // Less or equal + case 0x03: VFCMP_D(q0, v1, v2, cUN); break; // unordered + case 0x04: VFCMP_D(q0, v1, v2, cUNE); break; // Not Equal (or unordered on ARM, not on X86...) + case 0x05: VFCMP_D(q0, v2, v1, cULE); break; // Greater or equal or unordered + case 0x06: VFCMP_D(q0, v2, v1, cULT); break; // Greater or unordered + case 0x07: VFCMP_D(q0, v1, v2, cOR); break; // Greater or unordered + case 0x08: VFCMP_D(q0, v1, v2, cUEQ); break; // Equal, or unordered + case 0x09: VFCMP_D(q0, v1, v2, cULT); break; // Less than or unordered + case 0x0a: VFCMP_D(q0, v1, v2, cULE); break; // Less or equal or unordered + case 0x0b: VXOR_V(q0, q0, q0); break; // false + case 0x0c: VFCMP_D(q0, v1, v2, cNE); break; // Not Eual, ordered + case 0x0d: VFCMP_D(q0, v2, v1, cLE); break; // Greater or Equal ordered + case 0x0e: VFCMP_D(q0, v2, v1, cLT); break; // Greater ordered + case 0x0f: VSEQ_B(q0, v1, v1); break; // true + } + XVPERMI_Q(v0, v1, XVPERMI_IMM_4_0(3, 0)); + XVINSVE0_D(v0, q0, 0); + break; + case 0xD0: + INST_NAME("VADDSUBPS Gx, Vx, Ex"); + nextop = F8; + GETGY_empty_VYEY_xy(v0, v1, v2, 0); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFCMPxy(S, d0, v1, v2, cUN); + } + q0 = fpu_get_scratch(dyn); + VFSUBxy(S, q0, v1, v2); + VFADDxy(S, v0, v1, v2); + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(0, 0)); + VEXTRINSxy(W, v0, q0, VEXTRINS_IMM_4_0(2, 2)); + if (!BOX64ENV(dynarec_fastnan)) { + VFCMPxy(S, d1, v0, v0, cUN); + VANDN_Vxy(d0, d0, d1); + VLDIxy(d1, (0b010 << 9) | 0b1111111100); + VSLLIxy(W, d1, d1, 20); // broadcast 0xFFC00000 + VBITSEL_Vxy(v0, v0, d1, d0); + } + break; + case 0xE6: + INST_NAME("VCVTPD2DQ Gx, Ex"); + nextop = F8; + GETEYxy(v1, 0, 0); + GETGYx_empty(v0); + u8 = sse_setround(dyn, ninst, x1, x2); + d0 = fpu_get_scratch(dyn); + if (vex.l) { + XVXOR_V(d0, d0, d0); + XVFTINT_W_D(v0, d0, v1); // v0 [lo0, lo1, --, --, hi0, hi1, --, -- ] + if (!BOX64ENV(dynarec_fastround)) { + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + q2 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + XVFTINT_L_D(q2, v1); + XVLDI(q0, 0b1001110000000); // broadcast 0x80000000 to all + MOV32w(x5, 0x7FFFFFFF); + BSTRPICK_D(x5, x5, 31, 0); + XVREPLGR2VR_D(q1, x5); + XVFCMP_D(d0, v1, v1, cUN); // get Nan mask + XVSLT_D(d1, q1, q2); // get +inf mask + XVOR_V(d0, d1, d0); + XVSRLNI_W_D(d0, d0, 0); // [A,B,C,D] => [a,b,--,--,c,d,--,--] + XVBITSEL_V(v0, v0, q0, d0); + } + XVPERMI_D(v0, v0, 0b11011000); + } else { + VFTINT_W_D(d0, v1, v1); + if (!BOX64ENV(dynarec_fastround)) { + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + q2 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFTINT_L_D(d1, v1); + VLDI(q0, 0b1001110000000); // broadcast 0x80000000 to all + MOV32w(x5, 0x7FFFFFFF); + BSTRPICK_D(x5, x5, 31, 0); + VREPLGR2VR_D(q1, x5); + VSLT_D(q1, q1, d1); // get +inf mask + VFCMP_D(q2, v1, v1, cUN); // get Nan mask + VOR_V(q1, q1, q2); + VSHUF4I_W(q1, q1, 0b11011000); + VBITSEL_V(d0, d0, q0, q1); + } + XVPICKVE_D(v0, d0, 0); + YMM_UNMARK_UPPER_ZERO(v0); + } + x87_restoreround(dyn, ninst, u8); + break; + case 0xF0: + INST_NAME("VLDDQU Gx, Ex"); + nextop = F8; + if (MODREG) { + GETGY_empty_EY_xy(q0, q1, 0); + if (vex.l) { + XVOR_V(q0, q1, q1); + } else { + VOR_V(q0, q1, q1); + } + } else { + GETGYxy_empty(q0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVLD(q0, ed, fixedaddress); + } else { + VLD(q0, ed, fixedaddress); + } + } + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_avx_f2_0f38.c b/src/dynarec/la64/dynarec_la64_avx_f2_0f38.c new file mode 100644 index 0000000..74dcb59 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_avx_f2_0f38.c @@ -0,0 +1,126 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "env.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_F2_0F38(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u; + int64_t j64; + int64_t fixedaddress; + int unscaled; + MAYUSE(wb1); + MAYUSE(wb2); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(gb1); + MAYUSE(gb2); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(s0); + MAYUSE(j64); + MAYUSE(cacheupd); + + rex_t rex = vex.rex; + + switch (opcode) { + case 0xF5: + INST_NAME("PDEP Gd, Vd, Ed"); + nextop = F8; + GETGD; + GETVD; + GETED(0); + if (gd == ed || gd == vd) { + gb1 = gd; + gd = x6; + } else { + gb1 = 0; + } + MOV64x(gd, 0); + MOV64x(x3, 1); + MOV64x(x4, 1); + MARK; + AND(x5, ed, x4); + BEQZ_MARK2(x5); + AND(x5, vd, x3); + BEQZ_MARK3(x5); + OR(gd, gd, x4); + MARK3; + SLLIxw(x3, x3, 1); + MARK2; + SLLIxw(x4, x4, 1); + BNEZ_MARK(x4); + if (gb1) + OR(gb1, gd, gd); + break; + case 0xF6: + INST_NAME("MULX Gd, Vd, Ed (,RDX)"); + nextop = F8; + GETGD; + GETED(0); + GETVD; + if ((gd == xRDX) || (gd == ed) || (gd == vd)) + gb1 = x3; + else + gb1 = gd; + if (rex.w) { + MULH_DU(gb1, xRDX, ed); + if (gd != vd) { MUL_D(vd, xRDX, ed); } + if (gb1 == x3) { + OR(gd, gb1, gb1); + } + } else { + MULH_WU(gb1, xRDX, ed); + if (gd != vd) { MUL_W(vd, xRDX, ed); } + } + if (gb1 == x3) { + BSTRINS_D(gd, gb1, 31, 0); + } + break; + case 0xF7: + INST_NAME("SHRX Gd, Ed, Vd"); + nextop = F8; + GETGD; + GETED(0); + GETVD; + ANDI(x5, vd, rex.w ? 0x3f : 0x1f); + SRLxw(gd, ed, x5); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_avx_f2_0f3a.c b/src/dynarec/la64/dynarec_la64_avx_f2_0f3a.c new file mode 100644 index 0000000..4181c68 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_avx_f2_0f3a.c @@ -0,0 +1,72 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "env.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_F2_0F3A(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u; + int64_t j64; + int64_t fixedaddress; + int unscaled; + MAYUSE(wb1); + MAYUSE(wb2); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(gb1); + MAYUSE(gb2); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(s0); + MAYUSE(j64); + MAYUSE(cacheupd); + + rex_t rex = vex.rex; + + switch (opcode) { + case 0xF0: + INST_NAME("RORX Gd, Ed, Ib"); + nextop = F8; + GETGD; + GETED(1); + u8 = F8; + ROTRIxw(gd, ed, u8 & (rex.w ? 0x3f : 0x1f)); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_avx_f3_0f.c b/src/dynarec/la64/dynarec_la64_avx_f3_0f.c new file mode 100644 index 0000000..c61f424 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_avx_f3_0f.c @@ -0,0 +1,507 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "env.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_F3_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2, gback, vback; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u, u64; + int64_t j64; + int64_t fixedaddress, gdoffset, vxoffset; + int unscaled; + + rex_t rex = vex.rex; + + switch (opcode) { + case 0x10: + INST_NAME("VMOVSS Gx, [Vx,] Ex"); + nextop = F8; + if (MODREG) { + GETVYx(q1, 0); + GETEYSS(q2, 0, 0); + GETGYx_empty(q0); + if (q0 != q2) VEXTRINS_W(q0, q2, 0b00000); + if (q0 != q1) { + VEXTRINS_D(q0, q1, 0b10001); + VEXTRINS_W(q0, q1, 0b10001); + } + } else { + GETEYSS(q2, 0, 0); + GETGYx_empty(q0); + XVPICKVE_W(q0, q2, 0); + YMM_UNMARK_UPPER_ZERO(q0); + } + break; + case 0x11: + INST_NAME("VMOVSS Ex, [Vx,] Gx"); + nextop = F8; + GETGYx(q2, 0); + if (MODREG) { + GETVYx(q1, 0); + GETEYSD(q0, 1, 0); + if (q0 != q2) VEXTRINS_W(q0, q2, 0b00000); + if (q0 != q1) { + VEXTRINS_D(q0, q1, 0b10001); + VEXTRINS_W(q0, q1, 0b10001); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FST_S(q2, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0x12: + INST_NAME("VMOVSLDUP Gx, Ex"); + nextop = F8; + GETGY_empty_EY_xy(q0, q1, 0); + if (vex.l) { + XVPACKEV_W(q0, q1, q1); + } else { + VPACKEV_W(q0, q1, q1); + } + break; + case 0x16: + INST_NAME("VMOVSHDUP Gx, Ex"); + nextop = F8; + GETGY_empty_EY_xy(q0, q1, 0); + if (vex.l) { + XVPACKOD_W(q0, q1, q1); + } else { + VPACKOD_W(q0, q1, q1); + } + break; + case 0x2A: + INST_NAME("VCVTSI2SS Gx, Vx, Ed"); + nextop = F8; + GETED(0); + GETVYx(v1, 0); + GETGYx_empty(v0); + d1 = fpu_get_scratch(dyn); + if (!BOX64ENV(dynarec_fastround)) { + u8 = sse_setround(dyn, ninst, x2, x3); + } + if (rex.w) { + MOVGR2FR_D(d1, ed); + FFINT_S_L(d1, d1); + } else { + MOVGR2FR_W(d1, ed); + FFINT_S_W(d1, d1); + } + if (!BOX64ENV(dynarec_fastround)) { + x87_restoreround(dyn, ninst, u8); + } + if(v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, d1, 0); + break; + case 0x2C: + INST_NAME("VCVTTSS2SI Gd, Ex"); + nextop = F8; + GETGD; + GETEYSS(d0, 0, 0); + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + u8 = sse_setround(dyn, ninst, x5, x6); + d1 = fpu_get_scratch(dyn); + if (rex.w) { + FTINTRZ_L_S(d1, d0); + MOVFR2GR_D(gd, d1); + } else { + FTINTRZ_W_S(d1, d0); + MOVFR2GR_S(gd, d1); + ZEROUP(gd); + } + x87_restoreround(dyn, ninst, u8); + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + MOV32w(x3, (1 << FR_V) | (1 << FR_O)); + AND(x5, x5, x3); + CBZ_NEXT(x5); + if (rex.w) { + MOV64x(gd, 0x8000000000000000LL); + } else { + MOV32w(gd, 0x80000000); + } + } + break; + case 0x2D: + INST_NAME("VCVTSS2SI Gd, Ex"); + nextop = F8; + GETGD; + GETEYSS(d0, 0, 0); + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + u8 = sse_setround(dyn, ninst, x5, x6); + d1 = fpu_get_scratch(dyn); + if (rex.w) { + FTINT_L_S(d1, d0); + MOVFR2GR_D(gd, d1); + } else { + FTINT_W_S(d1, d0); + MOVFR2GR_S(gd, d1); + ZEROUP(gd); + } + x87_restoreround(dyn, ninst, u8); + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + MOV32w(x3, (1 << FR_V) | (1 << FR_O)); + AND(x5, x5, x3); + CBZ_NEXT(x5); + if (rex.w) { + MOV64x(gd, 0x8000000000000000LL); + } else { + MOV32w(gd, 0x80000000); + } + } + break; + case 0x51: + INST_NAME("VSQRTSS Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSS(v2, 0, 0); + GETGYx_empty(v0); + d1 = fpu_get_scratch(dyn); + FSQRT_S(d1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + d0 = fpu_get_scratch(dyn); + VXOR_V(d0, d0, d0); + FCMP_S(fcc0, v2, d0, cLT); + BCEQZ(fcc0, 4 + 4); + FNEG_S(d1, d1); + } + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, d1, 0); + break; + case 0x52: + INST_NAME("VRSQRTSS Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSS(v2, 0, 0); + GETGYx_empty(v0); + d0 = fpu_get_scratch(dyn); + if (cpuext.frecipe) { + FRSQRTE_S(d0, v1); + } else { + FRSQRT_S(d0, v1); + } + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, d0, 0); + break; + case 0x53: + INST_NAME("VRCPSS Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSS(v2, 0, 0); + GETGYx_empty(v0); + d0 = fpu_get_scratch(dyn); + if (cpuext.frecipe) { + FRECIPE_S(d0, v1); + } else { + FRECIP_S(d0, v1); + } + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, d0, 0); + break; + case 0x58: + INST_NAME("VADDSS Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSS(v2, 0, 0); + GETGYx_empty(v0); + d0 = fpu_get_scratch(dyn); + FADD_S(d0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + FCMP_S(fcc0, v1, v2, cUN); + BCNEZ_MARK(fcc0); + FCMP_S(fcc1, d0, d0, cOR); + BCNEZ_MARK(fcc1); + FNEG_S(d0, d0); + } + MARK; + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, d0, 0); + break; + case 0x59: + INST_NAME("VMULSS Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSS(v2, 0, 0); + GETGYx_empty(v0); + d0 = fpu_get_scratch(dyn); + FMUL_S(d0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + FCMP_S(fcc0, v1, v2, cUN); + BCNEZ_MARK(fcc0); + FCMP_S(fcc1, d0, d0, cOR); + BCNEZ_MARK(fcc1); + FNEG_S(d0, d0); + } + MARK; + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, d0, 0); + break; + case 0x5A: + INST_NAME("VCVTSS2SD Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSS(v2, 0, 0); + GETGYx_empty(v0); + d1 = fpu_get_scratch(dyn); + FCVT_D_S(d1, v2); + if(v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_D(v0, d1, 0); + break; + case 0x5B: + INST_NAME("VCVTTPS2DQ Gx, Ex"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 0); + if (vex.l) { + if (!BOX64ENV(dynarec_fastround)) { + d1 = fpu_get_scratch(dyn); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); // mask + d0 = fpu_get_scratch(dyn); + XVFTINTRZ_W_S(d1, v1); + XVLDI(q0, 0b1001110000000); // broadcast 0x80000000 to all + XVLDI(d0, (0b10011 << 8) | 0x4f); + XVFCMP_S(q1, d0, v1, cULE); // get Nan,+overflow mark + XVBITSEL_V(v0, d1, q0, q1); + } else { + XVFTINTRZ_W_S(v0, v1); + } + } else { + if (!BOX64ENV(dynarec_fastround)) { + d1 = fpu_get_scratch(dyn); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); // mask + d0 = fpu_get_scratch(dyn); + VFTINTRZ_W_S(d1, v1); + VLDI(q0, 0b1001110000000); // broadcast 0x80000000 to all + VLDI(d0, (0b10011 << 8) | 0x4f); + VFCMP_S(q1, d0, v1, cULE); // get Nan,+overflow mark + VBITSEL_V(v0, d1, q0, q1); + } else { + VFTINTRZ_W_S(v0, v1); + } + } + break; + case 0x5C: + INST_NAME("VSUBSS Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSS(v2, 0, 0); + GETGYx_empty(v0); + d0 = fpu_get_scratch(dyn); + FSUB_S(d0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + FCMP_S(fcc0, v1, v2, cUN); + BCNEZ_MARK(fcc0); + FCMP_S(fcc1, d0, d0, cOR); + BCNEZ_MARK(fcc1); + FNEG_S(d0, d0); + } + MARK; + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, d0, 0); + break; + case 0x5D: + INST_NAME("VMINSS Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSS(v2, 0, 0); + GETGYx_empty(v0); + q0 = fpu_get_scratch(dyn); + if (BOX64ENV(dynarec_fastnan)) { + FMIN_S(q0, v1, v2); + } else { + FCMP_S(fcc0, v2, v1, cULE); + FSEL(q0, v1, v2, fcc0); + } + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, q0, 0); + break; + case 0x5E: + INST_NAME("VDIVSS Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSS(v2, 0, 0); + GETGYx_empty(v0); + d0 = fpu_get_scratch(dyn); + FDIV_S(d0, v1, v2); + if (!BOX64ENV(dynarec_fastnan)) { + FCMP_S(fcc0, v1, v2, cUN); + BCNEZ_MARK(fcc0); + FCMP_S(fcc1, d0, d0, cOR); + BCNEZ_MARK(fcc1); + FNEG_S(d0, d0); + } + MARK; + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, d0, 0); + break; + case 0x5F: + INST_NAME("VMAXSS Gx, Vx, Ex"); + nextop = F8; + GETVYx(v1, 0); + GETEYSS(v2, 0, 0); + GETGYx_empty(v0); + q0 = fpu_get_scratch(dyn); + if (BOX64ENV(dynarec_fastnan)) { + FMAX_S(q0, v1, v2); + } else { + FCMP_S(fcc0, v2, v1, cLT); + FSEL(q0, v2, v1, fcc0); + } + if (v0 != v1) VOR_V(v0, v1, v1); + VEXTRINS_W(v0, q0, 0); + break; + case 0x6F: + INST_NAME("VMOVDQU Gx, Ex"); + nextop = F8; + if (MODREG) { + GETGY_empty_EY_xy(q0, q1, 0); + if (vex.l) { + XVOR_V(q0, q1, q1); + } else { + VOR_V(q0, q1, q1); + } + } else { + GETGYxy_empty(q0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVLD(q0, ed, fixedaddress); + } else { + VLD(q0, ed, fixedaddress); + } + } + break; + case 0x70: + INST_NAME("VPSHUFHW Gx, Ex, Ib"); + nextop = F8; + GETGY_empty_EY_xy(v0, v1, 1); + u8 = F8; + d0 = fpu_get_scratch(dyn); + if (v0 != v1) { + VSHUF4Ixy(H, v0, v1, u8); + VEXTRINSxy(D, v0, v1, VEXTRINS_IMM_4_0(0, 0)); + } else { + VSHUF4Ixy(H, d0, v1, u8); + VEXTRINSxy(D, v0, d0, VEXTRINS_IMM_4_0(1, 1)); + } + break; + case 0x7E: + INST_NAME("VMOVQ Gx, Ex"); + nextop = F8; + GETEYSD(q1, 0, 0); + GETGYx_empty(q0); + XVPICKVE_D(q0, q1, 0); + YMM_UNMARK_UPPER_ZERO(q0); + break; + case 0x7F: + INST_NAME("VMOVDQU Ex, Gx"); + nextop = F8; + GETGYxy(q0, 0); + if (MODREG) { + GETEYxy_empty(q1, 0); + if (vex.l) { + XVOR_V(q1, q0, q0); + } else { + VOR_V(q1, q0, q0); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x5, &fixedaddress, rex, NULL, 1, 0); + if (vex.l) { + XVST(q0, ed, fixedaddress); + } else { + VST(q0, ed, fixedaddress); + } + SMWRITE2(); + } + break; + case 0xC2: + INST_NAME("VCMPSS Gx, Vx, Ex, Ib"); + nextop = F8; + GETVYx(v1, 0); + GETEYSS(v2, 0, 1); + GETGYx(v0, 1); + q0 = fpu_get_scratch(dyn); + u8 = F8; + switch (u8 & 0xf) { + case 0x00: VFCMP_S(q0, v1, v2, cEQ); break; // Equal, not unordered + case 0x01: VFCMP_S(q0, v1, v2, cLT); break; // Less than + case 0x02: VFCMP_S(q0, v1, v2, cLE); break; // Less or equal + case 0x03: VFCMP_S(q0, v1, v2, cUN); break; // unordered + case 0x04: VFCMP_S(q0, v1, v2, cUNE); break; // Not Equal (or unordered on ARM, not on X86...) + case 0x05: VFCMP_S(q0, v2, v1, cULE); break; // Greater or equal or unordered + case 0x06: VFCMP_S(q0, v2, v1, cULT); break; // Greater or unordered + case 0x07: VFCMP_S(q0, v1, v2, cOR); break; // Greater or unordered + case 0x08: VFCMP_S(q0, v1, v2, cUEQ); break; // Equal, or unordered + case 0x09: VFCMP_S(q0, v1, v2, cULT); break; // Less than or unordered + case 0x0a: VFCMP_S(q0, v1, v2, cULE); break; // Less or equal or unordered + case 0x0b: VXOR_V(q0, q0, q0); break; // false + case 0x0c: VFCMP_S(q0, v1, v2, cNE); break; // Not Eual, ordered + case 0x0d: VFCMP_S(q0, v2, v1, cLE); break; // Greater or Equal ordered + case 0x0e: VFCMP_S(q0, v2, v1, cLT); break; // Greater ordered + case 0x0f: VSEQ_B(q0, v1, v1); break; // true + } + XVPERMI_Q(v0, v1, XVPERMI_IMM_4_0(3, 0)); + XVINSVE0_W(v0, q0, 0); + break; + case 0xE6: + INST_NAME("VCVTDQ2PD Gx, Ex"); + nextop = F8; + d0 = fpu_get_scratch(dyn); + if(vex.l){ + GETEYx(v1, 0, 0); + GETGYy_empty(v0); + /* + xvffintl.d.w convert [v0,v1,v2,v3,v4,v5,v6,v7] to [v0,v1,v4,v5] + xvffinth.d.w convert [v0,v1,v2,v3,v4,v5,v6,v7] to [v2,v3,v6,v7] + so user xvpermi.d to reorder input [v0v1,v2v3,v4v5,v6v7] to [v0v1,v4v5,v2v3,v6v7] + */ + XVPERMI_D(d0, v1, 0b11011000); + XVFFINTL_D_W(v0, d0); + }else{ + GETEYSD(v1, 0, 0); + GETGYx_empty(v0); + VFFINTL_D_W(v0, v1); + } + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_avx_f3_0f38.c b/src/dynarec/la64/dynarec_la64_avx_f3_0f38.c new file mode 100644 index 0000000..7dfaf00 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_avx_f3_0f38.c @@ -0,0 +1,103 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "env.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "dynarec_la64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_F3_0F38(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u; + int64_t j64; + int64_t fixedaddress; + int unscaled; + MAYUSE(wb1); + MAYUSE(wb2); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(gb1); + MAYUSE(gb2); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(s0); + MAYUSE(j64); + MAYUSE(cacheupd); + + rex_t rex = vex.rex; + + switch (opcode) { + case 0xF5: + INST_NAME("PEXT Gd, Vd, Ed"); + nextop = F8; + GETGD; + GETVD; + GETED(0); + if (gd == ed || gd == vd) { + gb1 = gd; + gd = x6; + } else { + gb1 = 0; + } + MOV64x(gd, 0); + MOV64x(x3, 1); + MOV64x(x4, 1); + MARK; + AND(x5, ed, x4); + BEQZ_MARK2(x5); + AND(x5, vd, x4); + BEQZ_MARK3(x5); + OR(gd, gd, x3); + MARK3; + SLLIxw(x3, x3, 1); + MARK2; + SLLIxw(x4, x4, 1); + BNEZ_MARK(x4); + if (gb1) + OR(gb1, gd, gd); + break; + + case 0xF7: + INST_NAME("SARX Gd, Ed, Vd"); + nextop = F8; + GETGD; + GETED(0); + GETVD; + ANDI(x5, vd, rex.w ? 0x3f : 0x1f); + SRAxw(gd, ed, x5); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_consts.c b/src/dynarec/la64/dynarec_la64_consts.c new file mode 100644 index 0000000..d7c3cd7 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_consts.c @@ -0,0 +1,142 @@ +#include +#include + +#include "dynarec_la64_consts.h" +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "emu/x87emu_private.h" +#include "emu/x64primop.h" +#include "my_cpuid.h" +#include "freq.h" +#include "debug.h" +#include "custommem.h" +#include "dynarec_la64_functions.h" +#include "emu/x64shaext.h" +#include "emu/x87emu_private.h" +#include "emu/x64compstrings.h" +#include "x64test.h" +#include "dynarec/dynarec_next.h" +#include "bitutils.h" +#include "random.h" + +#ifndef HAVE_TRACE +void PrintTrace() {} +#endif + +uintptr_t getConst(la64_consts_t which) +{ + switch(which) { + case const_none: dynarec_log(LOG_NONE, "Warning, const none used\n"); + return 0; + case const_daa8: return (uintptr_t)daa8; + case const_das8: return (uintptr_t)das8; + case const_aaa16: return (uintptr_t)aaa16; + case const_aas16: return (uintptr_t)aas16; + case const_aam16: return (uintptr_t)aam16; + case const_aad16: return (uintptr_t)aad16; + case const_native_br: return (uintptr_t)native_br; + case const_native_ud: return (uintptr_t)native_ud; + case const_native_priv: return (uintptr_t)native_priv; + case const_native_int3: return (uintptr_t)native_int3; + case const_native_int: return (uintptr_t)native_int; + case const_native_div0: return (uintptr_t)native_div0; + case const_native_fprem: return (uintptr_t)native_fprem; + case const_native_fprem1: return (uintptr_t)native_fprem1; + case const_native_frstor16: return (uintptr_t)native_frstor16; + case const_native_fsave16: return (uintptr_t)native_fsave16; + case const_native_fsave: return (uintptr_t)native_fsave; + case const_native_aesimc: return (uintptr_t)native_aesimc; + case const_native_aesd: return (uintptr_t)native_aesd; + case const_native_aesd_y: return (uintptr_t)native_aesd_y; + case const_native_aesdlast: return (uintptr_t)native_aesdlast; + case const_native_aesdlast_y: return (uintptr_t)native_aesdlast_y; + case const_native_aese: return (uintptr_t)native_aese; + case const_native_aese_y: return (uintptr_t)native_aese_y; + case const_native_aeselast: return (uintptr_t)native_aeselast; + case const_native_aeselast_y: return (uintptr_t)native_aeselast_y; + case const_native_aeskeygenassist: return (uintptr_t)native_aeskeygenassist; + case const_native_pclmul: return (uintptr_t)native_pclmul; + case const_native_pclmul_x: return (uintptr_t)native_pclmul_x; + case const_native_pclmul_y: return (uintptr_t)native_pclmul_y; + case const_native_f2xm1: return (uintptr_t)native_f2xm1; + case const_native_fyl2x: return (uintptr_t)native_fyl2x; + case const_native_fyl2xp1: return (uintptr_t)native_fyl2xp1; + case const_native_fxtract: return (uintptr_t)native_fxtract; + case const_native_ftan: return (uintptr_t)native_ftan; + case const_native_fpatan: return (uintptr_t)native_fpatan; + case const_native_fcos: return (uintptr_t)native_fcos; + case const_native_fsin: return (uintptr_t)native_fsin; + case const_native_fsincos: return (uintptr_t)native_fsincos; + case const_native_fscale: return (uintptr_t)native_fscale; + case const_native_fld: return (uintptr_t)native_fld; + case const_native_fstp: return (uintptr_t)native_fstp; + case const_native_frstor: return (uintptr_t)native_frstor; + case const_native_next: return (uintptr_t)native_next; + case const_int3: return (uintptr_t)EmuInt3; + case const_x86syscall: return (uintptr_t)EmuX86Syscall; + case const_x64syscall: return (uintptr_t)EmuX64Syscall; + case const_x64syscall_linux: return (uintptr_t)EmuX64Syscall_linux; + case const_rcl8: return (uintptr_t)rcl8; + case const_rcl16: return (uintptr_t)rcl16; + case const_rcl32: return (uintptr_t)rcl32; + case const_rcl64: return (uintptr_t)rcl64; + case const_rcr8: return (uintptr_t)rcr8; + case const_rcr16: return (uintptr_t)rcr16; + case const_rcr32: return (uintptr_t)rcr32; + case const_rcr64: return (uintptr_t)rcr64; + case const_rol8: return (uintptr_t)rol8; + case const_rol16: return (uintptr_t)rol16; + case const_ror8: return (uintptr_t)ror8; + case const_ror16: return (uintptr_t)ror16; + case const_div64: return (uintptr_t)div64; + case const_div8: return (uintptr_t)div8; + case const_idiv64: return (uintptr_t)idiv64; + case const_idiv8: return (uintptr_t)idiv8; + case const_random32: return (uintptr_t)get_random32; + case const_random64: return (uintptr_t)get_random64; + case const_readtsc: return (uintptr_t)ReadTSC; + case const_helper_getcpu: return (uintptr_t)helper_getcpu; + case const_cpuid: return (uintptr_t)my_cpuid; + case const_getsegmentbase: return (uintptr_t)GetSegmentBaseEmu; + case const_updateflags: return (uintptr_t)UpdateFlags; + case const_reset_fpu: return (uintptr_t)reset_fpu; + case const_sha1nexte: return (uintptr_t)sha1nexte; + case const_sha1msg1: return (uintptr_t)sha1msg1; + case const_sha1msg2: return (uintptr_t)sha1msg2; + case const_sha1rnds4: return (uintptr_t)sha1rnds4; + case const_sha256msg1: return (uintptr_t)sha256msg1; + case const_sha256msg2: return (uintptr_t)sha256msg2; + case const_sha256rnds2: return (uintptr_t)sha256rnds2; + case const_fpu_loadenv: return (uintptr_t)fpu_loadenv; + case const_fpu_savenv: return (uintptr_t)fpu_savenv; + case const_fpu_fxsave32: return (uintptr_t)fpu_fxsave32; + case const_fpu_fxsave64: return (uintptr_t)fpu_fxsave64; + case const_fpu_fxrstor32: return (uintptr_t)fpu_fxrstor32; + case const_fpu_fxrstor64: return (uintptr_t)fpu_fxrstor64; + case const_fpu_xsave: return (uintptr_t)fpu_xsave; + case const_fpu_xrstor: return (uintptr_t)fpu_xrstor; + case const_fpu_fbld: return (uintptr_t)fpu_fbld; + case const_fpu_fbst: return (uintptr_t)fpu_fbst; + case const_sse42_compare_string_explicit_len: return (uintptr_t)sse42_compare_string_explicit_len; + case const_sse42_compare_string_implicit_len: return (uintptr_t)sse42_compare_string_implicit_len; + case const_x64test_step: return (uintptr_t)x64test_step; + case const_printtrace: return (uintptr_t)PrintTrace; + case const_epilog: return (uintptr_t)native_epilog; + case const_epilog_fast: return (uintptr_t)native_epilog_fast; + case const_jmptbl32: return getJumpTable32(); + case const_jmptbl48: return getJumpTable48(); + case const_jmptbl64: return getJumpTable64(); + case const_context: return (uintptr_t)my_context; + + case const_last: dynarec_log(LOG_NONE, "Warning, const last used\n"); + return 0; + } + dynarec_log(LOG_NONE, "Warning, Unknown const %d used\n", which); + return 0; +} \ No newline at end of file diff --git a/src/dynarec/la64/dynarec_la64_consts.h b/src/dynarec/la64/dynarec_la64_consts.h new file mode 100644 index 0000000..699543a --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_consts.h @@ -0,0 +1,115 @@ +#ifndef __DYNAREC_LA64_CONSTS__ +#define __DYNAREC_LA64_CONSTS__ +#include + +typedef enum la64_consts_s { + const_none, + const_daa8, + const_das8, + const_aaa16, + const_aas16, + const_aam16, + const_aad16, + const_native_br, + const_native_ud, + const_native_priv, + const_native_int3, + const_native_int, + const_native_div0, + const_native_fprem, + const_native_fprem1, + const_native_frstor16, + const_native_fsave16, + const_native_fsave, + const_native_aesimc, + const_native_aesd, + const_native_aesd_y, + const_native_aesdlast, + const_native_aesdlast_y, + const_native_aese, + const_native_aese_y, + const_native_aeselast, + const_native_aeselast_y, + const_native_aeskeygenassist, + const_native_pclmul, + const_native_pclmul_x, + const_native_pclmul_y, + const_native_f2xm1, + const_native_fyl2x, + const_native_fyl2xp1, + const_native_fxtract, + const_native_ftan, + const_native_fpatan, + const_native_fcos, + const_native_fsin, + const_native_fsincos, + const_native_fscale, + const_native_fld, + const_native_fstp, + const_native_frstor, + const_native_next, + const_int3, + const_x86syscall, + const_x64syscall, + const_x64syscall_linux, + const_rcl8, + const_rcl16, + const_rcl32, + const_rcl64, + const_rcr8, + const_rcr16, + const_rcr32, + const_rcr64, + const_rol8, + const_rol16, + const_ror8, + const_ror16, + const_div64, + const_div8, + const_idiv64, + const_idiv8, + const_random32, + const_random64, + const_readtsc, + const_helper_getcpu, + const_cpuid, + const_getsegmentbase, + const_updateflags, + const_reset_fpu, + const_sha1nexte, + const_sha1msg1, + const_sha1msg2, + const_sha1rnds4, + const_sha256msg1, + const_sha256msg2, + const_sha256rnds2, + const_fpu_loadenv, + const_fpu_savenv, + const_fpu_fxsave32, + const_fpu_fxsave64, + const_fpu_fxrstor32, + const_fpu_fxrstor64, + const_fpu_xsave, + const_fpu_xrstor, + const_fpu_fbld, + const_fpu_fbst, + const_sse42_compare_string_explicit_len, + const_sse42_compare_string_implicit_len, + const_x64test_step, + const_printtrace, + const_epilog, + const_epilog_fast, + const_jmptbl32, + const_jmptbl48, + const_jmptbl64, + const_context, + + const_last +} la64_consts_t; + +uintptr_t getConst(la64_consts_t which); + +// temporary define... +#define const_PrintTrace const_printtrace + +#endif //__DYNAREC_LA64_CONSTS__ \ No newline at end of file diff --git a/src/dynarec/la64/dynarec_la64_d8.c b/src/dynarec/la64/dynarec_la64_d8.c new file mode 100644 index 0000000..98a6caf --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_d8.c @@ -0,0 +1,275 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "emu/x87emu_private.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "../dynarec_helper.h" +#include "dynarec_la64_functions.h" + + +uintptr_t dynarec64_D8(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t nextop = F8; + uint8_t ed; + uint8_t wback, wb1; + uint8_t u8; + int64_t fixedaddress; + int unscaled; + int v1, v2; + int s0; + int i1, i2, i3; + + MAYUSE(s0); + MAYUSE(v2); + MAYUSE(v1); + + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FADD ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FADD_S(v1, v1, v2); + } else { + FADD_D(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xC8 ... 0xCF: + INST_NAME("FMUL ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FMUL_S(v1, v1, v2); + } else { + FMUL_D(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xD0 ... 0xD7: + INST_NAME("FCOM ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3); + } else { + FCOMD(v1, v2, x1, x2, x3); + } + break; + case 0xD8 ... 0xDF: + INST_NAME("FCOMP ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3); + } else { + FCOMD(v1, v2, x1, x2, x3); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE0 ... 0xE7: + INST_NAME("FSUB ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FSUB_S(v1, v1, v2); + } else { + FSUB_D(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xE8 ... 0xEF: + INST_NAME("FSUBR ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FSUB_S(v1, v2, v1); + } else { + FSUB_D(v1, v2, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xF0 ... 0xF7: + INST_NAME("FDIV ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FDIV_S(v1, v1, v2); + } else { + FDIV_D(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xF8 ... 0xFF: + INST_NAME("FDIVR ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FDIV_S(v1, v2, v1); + } else { + FDIV_D(v1, v2, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + default: + DEFAULT; + break; + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FADD ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(s0, ed, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + if (ST_IS_F(0)) { + FADD_S(v1, v1, s0); + } else { + FCVT_D_S(s0, s0); + FADD_D(v1, v1, s0); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 1: + INST_NAME("FMUL ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(s0, ed, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + if (ST_IS_F(0)) { + FMUL_S(v1, v1, s0); + } else { + FCVT_D_S(s0, s0); + FMUL_D(v1, v1, s0); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 2: + INST_NAME("FCOM ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(s0, ed, fixedaddress); + if (ST_IS_F(0)) { + FCOMS(v1, s0, x1, x6, x3); + } else { + FCVT_D_S(s0, s0); + FCOMD(v1, s0, x1, x6, x3); + } + break; + case 3: + INST_NAME("FCOMP ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(s0, ed, fixedaddress); + if (ST_IS_F(0)) { + FCOMS(v1, s0, x1, x6, x3); + } else { + FCVT_D_S(s0, s0); + FCOMD(v1, s0, x1, x6, x3); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FSUB ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(s0, ed, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + if (ST_IS_F(0)) { + FSUB_S(v1, v1, s0); + } else { + FCVT_D_S(s0, s0); + FSUB_D(v1, v1, s0); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 5: + INST_NAME("FSUBR ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(s0, ed, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + if (ST_IS_F(0)) { + FSUB_S(v1, s0, v1); + } else { + FCVT_D_S(s0, s0); + FSUB_D(v1, s0, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 6: + INST_NAME("FDIV ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(s0, ed, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + if (ST_IS_F(0)) { + FDIV_S(v1, v1, s0); + } else { + FCVT_D_S(s0, s0); + FDIV_D(v1, v1, s0); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 7: + INST_NAME("FDIVR ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(s0, ed, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + if (ST_IS_F(0)) { + FDIV_S(v1, s0, v1); + } else { + FCVT_D_S(s0, s0); + FDIV_D(v1, s0, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_d9.c b/src/dynarec/la64/dynarec_la64_d9.c new file mode 100644 index 0000000..f810264 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_d9.c @@ -0,0 +1,515 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "la64_emitter.h" +#include "la64_mapping.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "emu/x87emu_private.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "../dynarec_helper.h" +#include "dynarec_la64_functions.h" + + +uintptr_t dynarec64_D9(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t nextop = F8; + uint8_t ed; + uint8_t wback, wb1; + uint8_t u8; + int64_t fixedaddress; + int unscaled; + int v0, v1, v2; + int s0; + int i1, i2, i3; + int64_t j64; + + MAYUSE(s0); + MAYUSE(v0); + MAYUSE(v1); + MAYUSE(v2); + MAYUSE(j64); + + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FLD STx"); + X87_PUSH_OR_FAIL(v2, dyn, ninst, x1, X87_ST(nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, (nextop & 7) + 1, X87_COMBINE(0, (nextop & 7) + 1)); + if (ST_IS_F(0)) { + FMOV_S(v2, v1); + } else { + FMOV_D(v2, v1); + } + break; + + case 0xC8: + INST_NAME("FXCH ST0"); + break; + case 0xC9 ... 0xCF: + INST_NAME("FXCH STx"); + // swap the cache value, not the double value itself :p + x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_ST(nextop & 7)); + x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + x87_swapreg(dyn, ninst, x1, x2, 0, nextop & 7); + // should set C1 to 0 + break; + + case 0xD0: + INST_NAME("FNOP"); + break; + + case 0xD8: + INST_NAME("FSTPNCE ST0, ST0"); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xD9 ... 0xDF: + INST_NAME("FSTPNCE ST0, STx"); + // copy the cache value for st0 to stx + x87_get_st_empty(dyn, ninst, x1, x2, nextop & 7, X87_ST(nextop & 7)); + x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + x87_swapreg(dyn, ninst, x1, x2, 0, nextop & 7); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE0: + INST_NAME("FCHS"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + if (ST_IS_F(0)) { + FNEG_S(v1, v1); + } else { + FNEG_D(v1, v1); + } + break; + case 0xE1: + INST_NAME("FABS"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + if (ST_IS_F(0)) { + FABS_S(v1, v1); + } else { + FABS_D(v1, v1); + } + break; + + case 0xE4: + INST_NAME("FTST"); + DEFAULT; + break; + case 0xE5: + INST_NAME("FXAM"); +#if 1 + i1 = x87_get_current_cache(dyn, ninst, 0, LSX_CACHE_ST_D); + // value put in x4 + if (i1 == -1) { + if (fpu_is_st_freed(dyn, ninst, 0)) { + MOV32w(x4, 0b100000100000000); + B_MARK3_nocond; + } else { + // not in cache, so check Empty status and load it + i2 = -dyn->lsx.x87stack; + LD_WU(x3, xEmu, offsetof(x64emu_t, fpu_stack)); + if (i2) { + ADDI_D(x3, x3, -i2); + } + MOV32w(x4, 0b100000100000000); // empty: C3,C2,C0 = 101 + BGE_MARK3(xZR, x3); + // x5 will be the actual top + LD_WU(x5, xEmu, offsetof(x64emu_t, top)); + if (i2) { + ADDI_D(x5, x5, i2); + ANDI(x5, x5, 7); // (emu->top + i)&7 + } + // load x2 with ST0 anyway, for sign extraction + SLLI_D(x5, x5, 3); + ADD_D(x1, xEmu, x5); + LD_D(x2, x1, offsetof(x64emu_t, x87)); + // load tag + if (i2 >= 0) { + LD_HU(x3, xEmu, offsetof(x64emu_t, fpu_tags)); + if (i2 > 0) { + BSTRINS_D(x3, xZR, 15, 0); + SRLI_D(x3, x3, i2 * 2); + } + ANDI(x3, x3, 0b11); + BNEZ_MARK3(x3); // empty: C3,C2,C0 = 101 + } + } + } else { + // simply move from cache reg to x2 + v1 = dyn->lsx.x87reg[i1]; + MOVFR2GR_D(x2, v1); + } + // get exponant in x1 + SRLI_D(x1, x2, 20 + 32); + ANDI(x1, x1, 0x7ff); // 0x7ff + BNEZ_MARK(x1); // not zero or denormal + MOV64x(x3, 0x7fffffffffffffff); + AND(x1, x2, x3); + MOV32w(x4, 0b100000000000000); // Zero: C3,C2,C0 = 100 + BEQZ_MARK3(x1); + MOV32w(x4, 0b100010000000000); // Denormal: C3,C2,C0 = 110 + B_MARK3_nocond; + MARK; + ADDI_D(x3, xZR, 0x7ff); // infinite/NaN? + MOV32w(x4, 0b000010000000000); // normal: C3,C2,C0 = 010 + BNE_MARK3(x1, x3); + SLLI_D(x3, x2, 12); + SRLI_D(x3, x3, 12); // and 0x000fffffffffffff + MOV32w(x4, 0b000010100000000); // infinity: C3,C2,C0 = 011 + BEQZ_MARK3(x3); + MOV32w(x4, 0b000000100000000); // NaN: C3,C2,C0 = 001 + MARK3; + // Extract sign & Update SW + SRLI_D(x1, x2, 63); + SLLI_D(x1, x1, 9); + OR(x4, x4, x1); // C1 + LD_HU(x1, xEmu, offsetof(x64emu_t, sw)); + MOV32w(x2, ~0b0100011100000000); + AND(x1, x1, x2); + OR(x4, x4, x1); + ST_H(x4, xEmu, offsetof(x64emu_t, sw)); +#else + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_refresh(dyn, ninst, x1, x2, 0); + s0 = x87_stackcount(dyn, ninst, x1); + CALL(fpu_fxam, -1, 0, 0); // should be possible inline, but is it worth it? + x87_unstackcount(dyn, ninst, x1, s0); +#endif + break; + + case 0xE8: + INST_NAME("FLD1"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_F); + if (ST_IS_F(0)) { + MOV32w(x1, 0x3f800000); + MOVGR2FR_W(v1, x1); + } else { + MOV64x(x1, 0x3FF0000000000000); + MOVGR2FR_D(v1, x1); + } + break; + case 0xE9: + INST_NAME("FLDL2T"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_D); + FTABLE64(v1, L2T); + break; + case 0xEA: + INST_NAME("FLDL2E"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_D); + FTABLE64(v1, L2E); + break; + case 0xEB: + INST_NAME("FLDPI"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_D); + FTABLE64(v1, PI); + break; + case 0xEC: + INST_NAME("FLDLG2"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_D); + FTABLE64(v1, LG2); + break; + case 0xED: + INST_NAME("FLDLN2"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_D); + FTABLE64(v1, LN2); + break; + case 0xEE: + INST_NAME("FLDZ"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_F); + if (ST_IS_F(0)) + MOVGR2FR_W(v1, xZR); + else + MOVGR2FR_D(v1, xZR); + break; + + case 0xF0: + INST_NAME("F2XM1"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_forget(dyn, ninst, x1, x2, 0); + s0 = x87_stackcount(dyn, ninst, x3); + CALL(const_native_f2xm1, -1, 0, 0); + x87_unstackcount(dyn, ninst, x3, s0); + break; + case 0xF1: + INST_NAME("FYL2X"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_forget(dyn, ninst, x1, x2, 0); + x87_forget(dyn, ninst, x1, x2, 1); + s0 = x87_stackcount(dyn, ninst, x3); + CALL(const_native_fyl2x, -1, 0, 0); + x87_unstackcount(dyn, ninst, x3, s0); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xF2: + INST_NAME("FPTAN"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_forget(dyn, ninst, x1, x2, 0); + s0 = x87_stackcount(dyn, ninst, x3); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + CALL_(const_native_ftan, -1, BOX64ENV(dynarec_fastround) ? 0 : u8, 0, 0); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + x87_unstackcount(dyn, ninst, x3, s0); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_F); + if (ST_IS_F(0)) { + MOV32w(x1, 0x3f800000); + MOVGR2FR_W(v1, x1); + } else { + MOV64x(x1, 0x3FF0000000000000); + MOVGR2FR_D(v1, x1); + } + break; + case 0xF3: + INST_NAME("FPATAN"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_forget(dyn, ninst, x1, x2, 0); + x87_forget(dyn, ninst, x1, x2, 1); + s0 = x87_stackcount(dyn, ninst, x3); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + CALL_(const_native_fpatan, -1, BOX64ENV(dynarec_fastround) ? 0 : u8, 0, 0); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + x87_unstackcount(dyn, ninst, x3, s0); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xF4: + INST_NAME("FXTRACT"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, x3); + x87_forget(dyn, ninst, x1, x2, 1); + s0 = x87_stackcount(dyn, ninst, x3); + CALL(const_native_fxtract, -1, 0, 0); + x87_unstackcount(dyn, ninst, x3, s0); + break; + case 0xF5: + INST_NAME("FPREM1"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_forget(dyn, ninst, x1, x2, 0); + x87_forget(dyn, ninst, x1, x2, 1); + s0 = x87_stackcount(dyn, ninst, x3); + CALL(const_native_fprem1, -1, 0, 0); + x87_unstackcount(dyn, ninst, x3, s0); + break; + case 0xF6: + INST_NAME("FDECSTP"); + BARRIER(BARRIER_FLOAT); + LD_W(x2, xEmu, offsetof(x64emu_t, top)); + ADDI_D(x2, x2, -1); + ANDI(x2, x2, 7); + ST_W(x2, xEmu, offsetof(x64emu_t, top)); + break; + case 0xF7: + INST_NAME("FINCSTP"); + BARRIER(BARRIER_FLOAT); + LD_W(x2, xEmu, offsetof(x64emu_t, top)); + ADDI_D(x2, x2, 1); + ANDI(x2, x2, 7); + ST_W(x2, xEmu, offsetof(x64emu_t, top)); + break; + case 0xF8: + INST_NAME("FPREM"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_forget(dyn, ninst, x1, x2, 0); + x87_forget(dyn, ninst, x1, x2, 1); + s0 = x87_stackcount(dyn, ninst, x3); + CALL(const_native_fprem, -1, 0, 0); + x87_unstackcount(dyn, ninst, x3, s0); + break; + case 0xF9: + INST_NAME("FYL2XP1"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_forget(dyn, ninst, x1, x2, 0); + x87_forget(dyn, ninst, x1, x2, 1); + s0 = x87_stackcount(dyn, ninst, x3); + CALL(const_native_fyl2xp1, -1, 0, 0); + x87_unstackcount(dyn, ninst, x3, s0); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xFA: + INST_NAME("FSQRT"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FSQRT_S(v1, v1); + } else { + FSQRT_D(v1, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xFB: + INST_NAME("FSINCOS"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, x3); + x87_forget(dyn, ninst, x1, x2, 1); + s0 = x87_stackcount(dyn, ninst, x3); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + CALL_(const_native_fsincos, -1, BOX64ENV(dynarec_fastround) ? 0 : u8, 0, 0); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + x87_unstackcount(dyn, ninst, x3, s0); + break; + case 0xFC: + INST_NAME("FRNDINT"); + v0 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + v1 = fpu_get_scratch(dyn); + v2 = fpu_get_scratch(dyn); + u8 = x87_setround(dyn, ninst, x1, x2); + + if (ST_IS_F(0)) { + FCMP_S(fcc0, v0, v0, cEQ); + BCNEZ_MARK(fcc0); + B_NEXT_nocond; + MARK; // v0 is not nan + FABS_S(v1, v0); + MOV64x(x3, 1ULL << __FLT_MANT_DIG__); + MOVGR2FR_W(v2, x3); + FFINT_S_L(v2, v2); + FCMP_S(fcc1, v1, v2, cLT); + BCNEZ_MARK2(fcc1); + B_NEXT_nocond; + MARK2; + FTINT_L_S(v1, v0); + FFINT_S_L(v1, v1); + FCOPYSIGN_S(v0, v1, v0); + } else { + FCMP_D(fcc0, v0, v0, cEQ); + BCNEZ_MARK(fcc0); + B_NEXT_nocond; + MARK; // v0 is not nan + FABS_D(v1, v0); + MOV64x(x3, 1ULL << __DBL_MANT_DIG__); + MOVGR2FR_D(v2, x3); + FFINT_D_L(v2, v2); + FCMP_D(fcc1, v1, v2, cLT); + BCNEZ_MARK2(fcc1); + B_NEXT_nocond; + MARK2; + FTINT_L_D(v1, v0); + FFINT_D_L(v1, v1); + FCOPYSIGN_D(v0, v1, v0); + } + x87_restoreround(dyn, ninst, u8); + break; + case 0xFD: + INST_NAME("FSCALE"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_forget(dyn, ninst, x1, x2, 0); + x87_forget(dyn, ninst, x1, x2, 1); + s0 = x87_stackcount(dyn, ninst, x3); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + CALL_(const_native_fscale, -1, BOX64ENV(dynarec_fastround) ? 0 : u8, 0, 0); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + x87_unstackcount(dyn, ninst, x3, s0); + break; + case 0xFE: + INST_NAME("FSIN"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_forget(dyn, ninst, x1, x2, 0); + s0 = x87_stackcount(dyn, ninst, x3); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + CALL_(const_native_fsin, -1, BOX64ENV(dynarec_fastround) ? 0 : u8, 0, 0); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + x87_unstackcount(dyn, ninst, x3, s0); + break; + case 0xFF: + INST_NAME("FCOS"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_forget(dyn, ninst, x1, x2, 0); + s0 = x87_stackcount(dyn, ninst, x3); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + CALL_(const_native_fcos, -1, BOX64ENV(dynarec_fastround) ? 0 : u8, 0, 0); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + x87_unstackcount(dyn, ninst, x3, s0); + break; + default: + DEFAULT; + break; + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FLD ST0, float[ED]"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, (BOX64ENV(dynarec_x87double) == 1) ? LSX_CACHE_ST_D : LSX_CACHE_ST_F); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(v1, ed, fixedaddress); + if (!ST_IS_F(0)) { + FCVT_D_S(v1, v1); + } + break; + case 2: + INST_NAME("FST float[ED], ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_F); + if (ST_IS_F(0)) + s0 = v1; + else { + s0 = fpu_get_scratch(dyn); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + FCVT_S_D(s0, v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + } + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FST_S(s0, ed, fixedaddress); + break; + case 3: + INST_NAME("FSTP float[ED], ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_F); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + if (!ST_IS_F(0)) { + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + FCVT_S_D(v1, v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + } + FST_S(v1, ed, fixedaddress); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FLDENV Ed"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + BARRIER(BARRIER_FLOAT); // maybe only x87, not SSE? + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + MOV32w(x2, 0); + CALL(const_fpu_loadenv, -1, ed, x2); + NATIVE_RESTORE_X87PC(); + break; + case 5: + INST_NAME("FLDCW Ew"); + GETEW(x1, 0); + ST_H(x1, xEmu, offsetof(x64emu_t, cw)); // hopefully cw is not too far for an imm8 + if (dyn->need_x87check) { + SRLI_D(x87pc, x1, 8); + ANDI(x87pc, x87pc, 0b11); + } + break; + case 6: + INST_NAME("FNSTENV Ed"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + BARRIER(BARRIER_FLOAT); // maybe only x87, not SSE? + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + MOV32w(x2, 0); + CALL(const_fpu_savenv, -1, ed, x2); + break; + case 7: + INST_NAME("FNSTCW Ew"); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 0, 0); + ed = x1; + wb1 = 1; + LD_H(x1, xEmu, offsetof(x64emu_t, cw)); + EWBACK; + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_da.c b/src/dynarec/la64/dynarec_la64_da.c new file mode 100644 index 0000000..83b3bd8 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_da.c @@ -0,0 +1,210 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "la64_emitter.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "emu/x87emu_private.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "../dynarec_helper.h" +#include "dynarec_la64_functions.h" + + +uintptr_t dynarec64_DA(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + uint8_t nextop = F8; + int64_t j64; + uint8_t ed; + uint8_t u8; + uint8_t wback; + int v1, v2; + int d0; + int s0; + int64_t fixedaddress; + int unscaled; + + MAYUSE(s0); + MAYUSE(d0); + MAYUSE(v2); + MAYUSE(v1); + MAYUSE(ed); + MAYUSE(j64); + + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FCMOVB ST0, STx"); + READFLAGS(X_CF); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + RESTORE_EFLAGS(x5); + ANDI(x1, xFlags, 1 << F_CF); + CBZ_NEXT(x1); + if (ST_IS_F(0)) + FMOV_S(v1, v2); + else + FMOV_D(v1, v2); + break; + case 0xC8 ... 0xCF: + INST_NAME("FCMOVE ST0, STx"); + READFLAGS(X_ZF); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + RESTORE_EFLAGS(x5); + ANDI(x1, xFlags, 1 << F_ZF); + CBZ_NEXT(x1); + if (ST_IS_F(0)) + FMOV_S(v1, v2); + else + FMOV_D(v1, v2); + break; + case 0xD0 ... 0xD7: + INST_NAME("FCMOVBE ST0, STx"); + READFLAGS(X_CF | X_ZF); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + RESTORE_EFLAGS(x5); + ANDI(x1, xFlags, (1 << F_CF) | (1 << F_ZF)); + CBZ_NEXT(x1); + if (ST_IS_F(0)) + FMOV_S(v1, v2); + else + FMOV_D(v1, v2); + break; + case 0xD8 ... 0xDF: + INST_NAME("FCMOVU ST0, STx"); + READFLAGS(X_PF); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + RESTORE_EFLAGS(x5); + ANDI(x1, xFlags, (1 << F_PF)); + CBZ_NEXT(x1); + if (ST_IS_F(0)) + FMOV_S(v1, v2); + else + FMOV_D(v1, v2); + break; + case 0xE9: + INST_NAME("FUCOMPP ST0, ST1"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, 1, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3); + } else { + FCOMD(v1, v2, x1, x2, x3); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + default: + DEFAULT; + break; + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FIADD ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(v2, ed, fixedaddress); + FFINT_D_W(v2, v2); // i32 -> double + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FADD_D(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 1: + INST_NAME("FIMUL ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(v2, ed, fixedaddress); + FFINT_D_W(v2, v2); // i32 -> double + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FMUL_D(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 2: + INST_NAME("FICOM ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(v2, ed, fixedaddress); + FFINT_D_W(v2, v2); // i32 -> double + FCOMD(v1, v2, x1, x2, x3); + break; + case 3: + INST_NAME("FICOMP ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(v2, ed, fixedaddress); + FFINT_D_W(v2, v2); // i32 -> double + FCOMD(v1, v2, x1, x2, x3); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FISUB ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(v2, ed, fixedaddress); + FFINT_D_W(v2, v2); // i32 -> double + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FSUB_D(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 5: + INST_NAME("FISUBR ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(v2, ed, fixedaddress); + FFINT_D_W(v2, v2); // i32 -> double + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FSUB_D(v1, v2, v1); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 6: + INST_NAME("FIDIV ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(v2, ed, fixedaddress); + FFINT_D_W(v2, v2); // i32 -> double + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FDIV_D(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 7: + INST_NAME("FIDIVR ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(v2, ed, fixedaddress); + FFINT_D_W(v2, v2); // i32 -> double + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FDIV_D(v1, v2, v1); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_db.c b/src/dynarec/la64/dynarec_la64_db.c new file mode 100644 index 0000000..a0d4885 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_db.c @@ -0,0 +1,273 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "la64_emitter.h" +#include "la64_mapping.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "emu/x87emu_private.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "../dynarec_helper.h" +#include "dynarec_la64_functions.h" + + +uintptr_t dynarec64_DB(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t nextop = F8; + uint8_t ed; + uint8_t wback; + uint8_t u8; + int64_t fixedaddress; + int unscaled; + int v1, v2; + int s0; + int64_t j64; + + MAYUSE(s0); + MAYUSE(v2); + MAYUSE(v1); + MAYUSE(j64); + + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FCMOVNB ST0, STx"); + READFLAGS(X_CF); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + RESTORE_EFLAGS(x5); + ANDI(x1, xFlags, 1 << F_CF); + CBNZ_NEXT(x1); + if (ST_IS_F(0)) { + FMOV_S(v1, v2); + } else { + FMOV_D(v1, v2); // F_CF==0 + } + break; + case 0xC8 ... 0xCF: + INST_NAME("FCMOVNE ST0, STx"); + READFLAGS(X_ZF); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + RESTORE_EFLAGS(x5); + ANDI(x1, xFlags, 1 << F_ZF); + CBNZ_NEXT(x1); + if (ST_IS_F(0)) { + FMOV_S(v1, v2); + } else { + FMOV_D(v1, v2); // F_ZF==0 + } + break; + case 0xD0 ... 0xD7: + INST_NAME("FCMOVNBE ST0, STx"); + READFLAGS(X_CF | X_ZF); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + RESTORE_EFLAGS(x5); + ANDI(x1, xFlags, (1 << F_CF) | (1 << F_ZF)); + CBNZ_NEXT(x1); + if (ST_IS_F(0)) { + FMOV_S(v1, v2); + } else { + FMOV_D(v1, v2); // F_CF==0 & F_ZF==0 + } + break; + case 0xD8 ... 0xDF: + INST_NAME("FCMOVNU ST0, STx"); + READFLAGS(X_PF); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + RESTORE_EFLAGS(x5); + ANDI(x1, xFlags, 1 << F_PF); + CBNZ_NEXT(x1); + if (ST_IS_F(0)) { + FMOV_S(v1, v2); + } else { + FMOV_D(v1, v2); // F_PF==0 + } + break; + case 0xE1: + INST_NAME("FDISI8087_NOP"); // so.. NOP? + break; + case 0xE2: + INST_NAME("FNCLEX"); + LD_H(x2, xEmu, offsetof(x64emu_t, sw)); + BSTRINS_D(x2, x2, 7, 0); // IE .. PE, SF, ES + BSTRINS_D(x2, x2, 15, 15); // B + ST_H(x2, xEmu, offsetof(x64emu_t, sw)); + break; + case 0xE3: + INST_NAME("FNINIT"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_purgecache(dyn, ninst, 0, x1, x2, x3); + CALL(const_reset_fpu, -1, 0, 0); + NATIVE_RESTORE_X87PC(); + break; + case 0xE8 ... 0xEF: + INST_NAME("FUCOMI ST0, STx"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMIS(v1, v2, x1, x2); + } else { + FCOMID(v1, v2, x1, x2); + } + + break; + case 0xF0 ... 0xF7: + INST_NAME("FCOMI ST0, STx"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMIS(v1, v2, x1, x2); + } else { + FCOMID(v1, v2, x1, x2); + } + break; + default: + DEFAULT; + break; + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FILD ST0, Ed"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_D); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_S(v1, ed, fixedaddress); + FFINT_D_W(v1, v1); // i32 -> double + break; + case 1: + INST_NAME("FISTTP Ed, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0); + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + FTINTRZ_W_D(v2, v1); + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + BSTRPICK_D(x5, x5, FR_V, FR_V); + BEQZ_MARK(x5); + MOV32w(x4, 0x80000000); + MOVGR2FR_W(v2, x4); + MARK; + } + FST_S(v2, wback, fixedaddress); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 2: + INST_NAME("FIST Ed, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + u8 = x87_setround(dyn, ninst, x1, x5); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + v2 = fpu_get_scratch(dyn); + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + FTINT_W_D(v2, v1); + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + BSTRPICK_D(x5, x5, FR_V, FR_V); + BEQZ_MARK(x5); + MOV32w(x4, 0x80000000); + MOVGR2FR_W(v2, x4); + MARK; + } + FST_S(v2, wback, fixedaddress); + x87_restoreround(dyn, ninst, u8); + break; + break; + case 3: + INST_NAME("FISTP Ed, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + u8 = x87_setround(dyn, ninst, x1, x5); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + v2 = fpu_get_scratch(dyn); + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + FTINT_W_D(v2, v1); + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + BSTRPICK_D(x5, x5, FR_V, FR_V); + BEQZ_MARK(x5); + MOV32w(x4, 0x80000000); + MOVGR2FR_W(v2, x4); + MARK; + } + FST_S(v2, wback, fixedaddress); + x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 5: + INST_NAME("FLD tbyte"); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 8, 0); + if ((PK(0) == 0xDB && ((PK(1) >> 3) & 7) == 7) || (!rex.is32bits && PK(0) >= 0x40 && PK(0) <= 0x4f && PK(1) == 0xDB && ((PK(2) >> 3) & 7) == 7)) { + NOTEST(x5); + // the FLD is immediatly followed by an FSTP + LD_D(x5, ed, fixedaddress + 0); + LD_H(x6, ed, fixedaddress + 8); + // no persistant scratch register, so unrool both instruction here... + MESSAGE(LOG_DUMP, "\tHack: FSTP tbyte\n"); + nextop = F8; // 0xDB or rex + if (!rex.is32bits && nextop >= 0x40 && nextop <= 0x4f) { + rex.rex = nextop; + nextop = F8; // 0xDB + } else + rex.rex = 0; + nextop = F8; // modrm + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 8, 0); + ST_D(x5, ed, fixedaddress + 0); + ST_H(x6, ed, fixedaddress + 8); + } else { + if (BOX64ENV(x87_no80bits)) { + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_D); + FLD_D(v1, ed, fixedaddress); + } else { + ADDI_D(x1, ed, fixedaddress); + X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, x3); + x87_reflectcount(dyn, ninst, x3, x4); + CALL(const_native_fld, -1, x1, 0); + x87_unreflectcount(dyn, ninst, x3, x4); + } + } + break; + case 7: + INST_NAME("FSTP tbyte"); + if (BOX64ENV(x87_no80bits)) { + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FST_D(v1, wback, fixedaddress); + } else { + x87_forget(dyn, ninst, x1, x3, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + x87_reflectcount(dyn, ninst, x3, x4); + CALL(const_native_fstp, -1, ed, 0); + x87_unreflectcount(dyn, ninst, x3, x4); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_dc.c b/src/dynarec/la64/dynarec_la64_dc.c new file mode 100644 index 0000000..2a2ba28 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_dc.c @@ -0,0 +1,226 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "emu/x87emu_private.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "../dynarec_helper.h" +#include "dynarec_la64_functions.h" + + +uintptr_t dynarec64_DC(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t nextop = F8; + uint8_t wback; + uint8_t u8; + int64_t fixedaddress; + int unscaled; + int v1, v2; + + MAYUSE(v2); + MAYUSE(v1); + + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FADD STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FADD_S(v1, v1, v2); + } else { + FADD_D(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xC8 ... 0xCF: + INST_NAME("FMUL STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FMUL_S(v1, v1, v2); + } else { + FMUL_D(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xD0 ... 0xD7: + INST_NAME("FCOM ST0, STx"); // yep + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3); + } else { + FCOMD(v1, v2, x1, x2, x3); + } + break; + case 0xD8 ... 0xDF: + INST_NAME("FCOMP ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3); + } else { + FCOMD(v1, v2, x1, x2, x3); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE0 ... 0xE7: + INST_NAME("FSUBR STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FSUB_S(v1, v2, v1); + } else { + FSUB_D(v1, v2, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xE8 ... 0xEF: + INST_NAME("FSUB STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FSUB_S(v1, v1, v2); + } else { + FSUB_D(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xF0 ... 0xF7: + INST_NAME("FDIVR STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FDIV_S(v1, v2, v1); + } else { + FDIV_D(v1, v2, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xF8 ... 0xFF: + INST_NAME("FDIV STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FDIV_S(v1, v1, v2); + } else { + FDIV_D(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + default: + DEFAULT; + break; + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FADD ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_D(v2, wback, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FADD_D(v1, v1, v2); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 1: + INST_NAME("FMUL ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_D(v2, wback, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FMUL_D(v1, v1, v2); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 2: + INST_NAME("FCOM ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_D(v2, wback, fixedaddress); + FCOMD(v1, v2, x1, x6, x3); + break; + case 3: + INST_NAME("FCOMP ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_D(v2, wback, fixedaddress); + FCOMD(v1, v2, x1, x6, x3); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FSUB ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_D(v2, wback, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FSUB_D(v1, v1, v2); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 5: + INST_NAME("FSUBR ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_D(v2, wback, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FSUB_D(v1, v2, v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 6: + INST_NAME("FDIV ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_D(v2, wback, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FDIV_D(v1, v1, v2); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 7: + INST_NAME("FDIVR ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_D(v2, wback, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FDIV_D(v1, v2, v1); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_dd.c b/src/dynarec/la64/dynarec_la64_dd.c new file mode 100644 index 0000000..12fcca6 --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_dd.c @@ -0,0 +1,184 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "la64_emitter.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "emu/x87emu_private.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "../dynarec_helper.h" +#include "dynarec_la64_functions.h" + + +uintptr_t dynarec64_DD(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t nextop = F8; + uint8_t ed, wback; + int64_t fixedaddress; + int unscaled; + int v1, v2; + int s0; + int64_t j64; + + MAYUSE(s0); + MAYUSE(v2); + MAYUSE(v1); + MAYUSE(j64); + + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FFREE STx"); + if ((nextop & 7) == 0 && PK(0) == 0xD9 && PK(1) == 0xF7) { + MESSAGE(LOG_DUMP, "Hack for FFREE ST0 / FINCSTP\n"); + x87_do_pop(dyn, ninst, x1); + addr += 2; + SKIPTEST(x1); + } else + x87_free(dyn, ninst, x1, x2, x3, nextop & 7); + break; + case 0xD0 ... 0xD7: + INST_NAME("FST ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FMOV_S(v2, v1); + } else { + FMOV_D(v2, v1); + } + break; + case 0xD8: + INST_NAME("FSTP ST0, ST0"); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xD9 ... 0xDF: + INST_NAME("FSTP ST0, STx"); + // copy the cache value for st0 to stx + x87_get_st_empty(dyn, ninst, x1, x2, nextop & 7, X87_ST(nextop & 7)); + x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + x87_swapreg(dyn, ninst, x1, x2, 0, nextop & 7); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE0 ... 0xE7: + INST_NAME("FUCOM ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3); + } else { + FCOMD(v1, v2, x1, x2, x3); + } + break; + case 0xE8 ... 0xEF: + INST_NAME("FUCOMP ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3); + } else { + FCOMD(v1, v2, x1, x2, x3); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + default: + DEFAULT; + break; + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FLD double"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_D); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD_D(v1, wback, fixedaddress); + break; + case 1: + INST_NAME("FISTTP i64, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_I64); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0); + if (ST_IS_I64(0)) { + FST_D(v1, wback, fixedaddress); + } else { + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + FTINTRZ_L_D(v2, v1); + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + MOV32w(x3, (1 << FR_V)); + AND(x5, x5, x3); + BEQZ_MARK(x5); + MOV64x(x4, 0x8000000000000000); + MOVGR2FR_D(v2, x4); + MARK; + } + FST_D(v2, wback, fixedaddress); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 2: + INST_NAME("FST double"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FST_D(v1, wback, fixedaddress); + break; + case 3: + INST_NAME("FSTP double"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FST_D(v1, wback, fixedaddress); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FRSTOR m108byte"); + MESSAGE(LOG_DUMP, "Need Optimization (FRSTOR)\n"); + BARRIER(BARRIER_FLOAT); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x6, &fixedaddress, rex, NULL, 0, 0); + CALL(const_native_frstor, -1, ed, 0); + break; + case 6: + INST_NAME("FNSAVE m108byte"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + BARRIER(BARRIER_FLOAT); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x6, &fixedaddress, rex, NULL, 0, 0); + CALL(const_native_fsave, -1, ed, 0); + NATIVE_RESTORE_X87PC(); + break; + case 7: + INST_NAME("FNSTSW m2byte"); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x6, &fixedaddress, rex, NULL, 0, 0); + LD_WU(x2, xEmu, offsetof(x64emu_t, top)); + LD_HU(x3, xEmu, offsetof(x64emu_t, sw)); + if (dyn->lsx.x87stack) { + // update top + ADDI_D(x2, x2, -dyn->lsx.x87stack); + ANDI(x2, x2, 7); + } + MOV32w(x5, ~0x3800); + AND(x3, x3, x5); // mask out TOP + SLLI_D(x2, x2, 11); // shift TOP to bit 11 + OR(x3, x3, x2); // inject TOP + ST_H(x3, xEmu, offsetof(x64emu_t, sw)); + ST_H(x3, ed, fixedaddress); // store whole sw flags + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_de.c b/src/dynarec/la64/dynarec_la64_de.c new file mode 100644 index 0000000..34805de --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_de.c @@ -0,0 +1,260 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "la64_emitter.h" +#include "la64_mapping.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "emu/x87emu_private.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "../dynarec_helper.h" +#include "dynarec_la64_functions.h" + + +uintptr_t dynarec64_DE(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t nextop = F8; + uint8_t wback; + uint8_t u8; + int64_t fixedaddress; + int v1, v2; + + MAYUSE(v2); + MAYUSE(v1); + + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FADDP STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FADD_S(v1, v1, v2); + } else { + FADD_D(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xC8 ... 0xCF: + INST_NAME("FMULP STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FMUL_S(v1, v1, v2); + } else { + FMUL_D(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xD0 ... 0xD7: + INST_NAME("FCOMP ST0, STx"); // yep + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3); + } else { + FCOMD(v1, v2, x1, x2, x3); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xD9: + INST_NAME("FCOMPP ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3); + } else { + FCOMD(v1, v2, x1, x2, x3); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE0 ... 0xE7: + INST_NAME("FSUBRP STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FSUB_S(v1, v2, v1); + } else { + FSUB_D(v1, v2, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE8 ... 0xEF: + INST_NAME("FSUBP STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FSUB_S(v1, v1, v2); + } else { + FSUB_D(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xF0 ... 0xF7: + INST_NAME("FDIVRP STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FDIV_S(v1, v2, v1); + } else { + FDIV_D(v1, v2, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xF8 ... 0xFF: + INST_NAME("FDIVP STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FDIV_S(v1, v1, v2); + } else { + FDIV_D(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + default: + DEFAULT; + break; + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FIADD ST0, word[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + LD_HU(x2, wback, fixedaddress); + SLLI_D(x2, x2, 48); + SRAI_D(x2, x2, 48); + MOVGR2FR_D(v2, x2); + FFINT_D_L(v2, v2); + FADD_D(v1, v1, v2); + X87_CHECK_PRECISION(v1); + break; + case 1: + INST_NAME("FIMUL ST0, word[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + LD_HU(x2, wback, fixedaddress); + SLLI_D(x2, x2, 48); + SRAI_D(x2, x2, 48); + MOVGR2FR_D(v2, x2); + FFINT_D_L(v2, v2); + FMUL_D(v1, v1, v2); + X87_CHECK_PRECISION(v1); + break; + case 2: + INST_NAME("FICOM ST0, word[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + LD_HU(x2, wback, fixedaddress); + SLLI_D(x2, x2, 48); + SRAI_D(x2, x2, 48); + MOVGR2FR_D(v2, x2); + FFINT_D_L(v2, v2); + FCOMD(v1, v2, x1, x2, x3); + break; + case 3: + INST_NAME("FICOMP ST0, word[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + LD_HU(x2, wback, fixedaddress); + SLLI_D(x2, x2, 48); + SRAI_D(x2, x2, 48); + MOVGR2FR_D(v2, x2); + FFINT_D_L(v2, v2); + FCOMD(v1, v2, x1, x2, x3); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FISUB ST0, word[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + LD_HU(x2, wback, fixedaddress); + SLLI_D(x2, x2, 48); + SRAI_D(x2, x2, 48); + MOVGR2FR_D(v2, x2); + FFINT_D_L(v2, v2); + FSUB_D(v1, v1, v2); + X87_CHECK_PRECISION(v1); + break; + case 5: + INST_NAME("FISUBR ST0, word[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + LD_HU(x2, wback, fixedaddress); + SLLI_D(x2, x2, 48); + SRAI_D(x2, x2, 48); + MOVGR2FR_D(v2, x2); + FFINT_D_L(v2, v2); + FSUB_D(v1, v2, v1); + X87_CHECK_PRECISION(v1); + break; + case 6: + INST_NAME("FIDIV ST0, word[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + LD_HU(x2, wback, fixedaddress); + SLLI_D(x2, x2, 48); + SRAI_D(x2, x2, 48); + MOVGR2FR_D(v2, x2); + FFINT_D_L(v2, v2); + FDIV_D(v1, v1, v2); + X87_CHECK_PRECISION(v1); + break; + case 7: + INST_NAME("FIDIVR ST0, word[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + LD_HU(x2, wback, fixedaddress); + SLLI_D(x2, x2, 48); + SRAI_D(x2, x2, 48); + MOVGR2FR_D(v2, x2); + FFINT_D_L(v2, v2); + FDIV_D(v1, v2, v1); + X87_CHECK_PRECISION(v1); + break; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_df.c b/src/dynarec/la64/dynarec_la64_df.c new file mode 100644 index 0000000..fa166de --- /dev/null +++ b/src/dynarec/la64/dynarec_la64_df.c @@ -0,0 +1,310 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "la64_emitter.h" +#include "la64_mapping.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "emu/x87emu_private.h" +#include "dynarec_native.h" + +#include "la64_printer.h" +#include "dynarec_la64_private.h" +#include "../dynarec_helper.h" +#include "dynarec_la64_functions.h" + +uintptr_t dynarec64_DF(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t nextop = F8; + uint8_t ed, wback, u8; + int v1, v2; + int s0; + int64_t j64; + int64_t fixedaddress; + + MAYUSE(s0); + MAYUSE(v2); + MAYUSE(v1); + MAYUSE(j64); + + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FFREEP STx"); + // not handling Tag... + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xD0: + case 0xD1: + case 0xD2: + case 0xD3: + case 0xD4: + case 0xD5: + case 0xD6: + case 0xD7: + INST_NAME("FSTP STx, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FMOV_S(v2, v1); + } else { + FMOV_D(v2, v1); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE0: + INST_NAME("FNSTSW AX"); + LD_WU(x2, xEmu, offsetof(x64emu_t, top)); + if (dyn->lsx.x87stack) { + ADDI_D(x2, x2, -dyn->lsx.x87stack); + ANDI(x2, x2, 0x7); + } + LD_HU(x1, xEmu, offsetof(x64emu_t, sw)); + MOV32w(x3, 0b1100011111111111); // mask + AND(x1, x1, x3); + SLLI_D(x2, x2, 11); + OR(x1, x1, x2); // inject top + ST_H(x1, xEmu, offsetof(x64emu_t, sw)); + SRLI_D(xRAX, xRAX, 16); + SLLI_D(xRAX, xRAX, 16); + OR(xRAX, xRAX, x1); + break; + case 0xE8 ... 0xF7: + if (nextop < 0xF0) { + INST_NAME("FUCOMIP ST0, STx"); + } else { + INST_NAME("FCOMIP ST0, STx"); + } + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMIS(v1, v2, x1, x2); + } else { + FCOMID(v1, v2, x1, x2); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + default: + DEFAULT; + break; + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FILD ST0, Ew"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_F); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0); + LD_H(x1, wback, fixedaddress); + MOVGR2FR_D(v1, x1); + if (ST_IS_F(0)) { + FFINT_S_L(v1, v1); + } else { + FFINT_D_L(v1, v1); + } + break; + case 1: + INST_NAME("FISTTP Ew, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_F); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0); + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + if (ST_IS_F(0)) { + FTINTRZ_W_S(v2, v1); + MOVFR2GR_S(x4, v2); + } else { + FTINTRZ_W_D(v2, v1); + MOVFR2GR_S(x4, v2); + } + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + BSTRPICK_D(x5, x5, FR_V, FR_V); + BNEZ_MARK(x5); + SLLI_W(x5, x4, 16); + SRAI_W(x5, x5, 16); + BEQ_MARK2(x5, x4); + MARK; + MOV32w(x4, 0x8000); + } + MARK2; + ST_H(x4, wback, fixedaddress); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 2: + INST_NAME("FIST Ew, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_F); + v2 = fpu_get_scratch(dyn); + u8 = x87_setround(dyn, ninst, x1, x5); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + if (ST_IS_F(0)) { + FTINT_W_S(v2, v1); + MOVFR2GR_S(x4, v2); + } else { + FTINT_W_D(v2, v1); + MOVFR2GR_S(x4, v2); + } + x87_restoreround(dyn, ninst, u8); + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + BSTRPICK_D(x5, x5, FR_V, FR_V); + BNEZ_MARK(x5); + SLLI_W(x5, x4, 16); + SRAI_W(x5, x5, 16); + BEQ_MARK2(x5, x4); + MARK; + MOV32w(x4, 0x8000); + } + MARK2; + ST_H(x4, wback, fixedaddress); + break; + case 3: + INST_NAME("FISTP Ew, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_F); + v2 = fpu_get_scratch(dyn); + u8 = x87_setround(dyn, ninst, x1, x5); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + if (ST_IS_F(0)) { + FTINT_W_S(v2, v1); + MOVFR2GR_S(x4, v2); + } else { + FTINT_W_D(v2, v1); + MOVFR2GR_S(x4, v2); + } + x87_restoreround(dyn, ninst, u8); + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + BSTRPICK_D(x5, x5, FR_V, FR_V); + BNEZ_MARK(x5); + SLLI_W(x5, x4, 16); + SRAI_W(x5, x5, 16); + BEQ_MARK2(x5, x4); + MARK; + MOV32w(x4, 0x8000); + } + MARK2; + ST_H(x4, wback, fixedaddress); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FBLD ST0, tbytes"); + X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, x1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + s0 = x87_stackcount(dyn, ninst, x3); + CALL(const_fpu_fbld, -1, ed, 0); + x87_unstackcount(dyn, ninst, x3, s0); + break; + case 5: + INST_NAME("FILD ST0, i64"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, LSX_CACHE_ST_I64); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + + if (ST_IS_I64(0)) { + FLD_D(v1, wback, fixedaddress); + } else { + LD_D(x1, wback, fixedaddress); + if (rex.is32bits) { + // need to also feed the STll stuff... + ADDI_D(x4, xEmu, offsetof(x64emu_t, fpu_ll)); + LD_WU(x5, xEmu, offsetof(x64emu_t, top)); + int a = 0 - dyn->lsx.x87stack; + if (a) { + ADDI_W(x5, x5, a); + ANDI(x5, x5, 0x7); + } + SLLI_D(x5, x5, 4); // fpu_ll is 2 i64 + ADD_D(x5, x5, x4); + ST_D(x1, x5, 8); // ll + } + MOVGR2FR_D(v1, x1); + FFINT_D_L(v1, v1); + if (rex.is32bits) { + FST_D(v1, x5, 0); // ref + } + } + break; + case 6: + INST_NAME("FBSTP tbytes, ST0"); + x87_forget(dyn, ninst, x1, x2, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + s0 = x87_stackcount(dyn, ninst, x3); + CALL(const_fpu_fbst, -1, ed, 0); + x87_unstackcount(dyn, ninst, x3, s0); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 7: + INST_NAME("FISTP i64, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, LSX_CACHE_ST_I64); + v2 = fpu_get_scratch(dyn); + if (!ST_IS_I64(0)) { + u8 = x87_setround(dyn, ninst, x1, x7); + } + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + + if (ST_IS_I64(0)) { + FST_D(v1, wback, fixedaddress); + } else { + if (rex.is32bits) { + // need to check STll first... + ADDI_D(x4, xEmu, offsetof(x64emu_t, fpu_ll)); + LD_WU(x5, xEmu, offsetof(x64emu_t, top)); + int a = 0 - dyn->lsx.x87stack; + if (a) { + ADDI_W(x5, x5, a); + ANDI(x5, x5, 0x7); + } + SLLI_D(x5, x5, 4); // fpu_ll is 2 i64 + ADD_D(x5, x5, x4); + MOVFR2GR_D(x3, v1); + LD_D(x6, x5, 0); // ref + BNE_MARK(x6, x3); + LD_D(x6, x5, 8); // ll + ST_D(x6, wback, fixedaddress); + B_MARK3_nocond; + MARK; + } + + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + FTINT_L_D(v2, v1); + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + BSTRPICK_D(x5, x5, FR_V, FR_V); + BEQ_MARK2(x5, xZR); + MOV64x(x4, 0x8000000000000000LL); + MOVGR2FR_D(v2, x4); + } + MARK2; + FST_D(v2, wback, fixedaddress); + MARK3; + x87_restoreround(dyn, ninst, u8); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + default: + DEFAULT; + break; + } + return addr; +} diff --git a/src/dynarec/la64/dynarec_la64_emit_logic.c b/src/dynarec/la64/dynarec_la64_emit_logic.c index 0815096..1e3a2a4 100644 --- a/src/dynarec/la64/dynarec_la64_emit_logic.c +++ b/src/dynarec/la64/dynarec_la64_emit_logic.c @@ -5,11 +5,9 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "la64_emitter.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -20,18 +18,18 @@ #include "la64_printer.h" #include "dynarec_la64_private.h" #include "dynarec_la64_functions.h" -#include "dynarec_la64_helper.h" +#include "../dynarec_helper.h" // emit XOR8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed) void emit_xor8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { IFX (X_PEND) { SET_DF(s4, d_xor8); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA (X_ALL, la64_lbt) { + IFXA (X_ALL, cpuext.lbt) { X64_XOR_B(s1, s2); } @@ -42,7 +40,10 @@ void emit_xor8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) ST_B(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) return; + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } CLEAR_FLAGS(s3); IFX (X_SF) { @@ -57,6 +58,7 @@ void emit_xor8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit XOR8 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch @@ -64,18 +66,20 @@ void emit_xor8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s { IFX (X_PEND) { SET_DF(s4, d_xor8); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { + if (cpuext.lbt) { IFX (X_ALL) { ADDI_D(s3, xZR, c & 0xff); X64_XOR_B(s1, s3); } XORI(s1, s1, c & 0xff); + ANDI(s1, s1, 0xff); IFX (X_PEND) ST_B(s1, xEmu, offsetof(x64emu_t, res)); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -97,6 +101,7 @@ void emit_xor8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit XOR16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed) @@ -104,23 +109,29 @@ void emit_xor16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, { IFX (X_PEND) { SET_DF(s4, d_xor16); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA (X_ALL, la64_lbt) { - X64_XOR_W(s1, s2); - } + IFXA (X_ALL, cpuext.lbt) X64_XOR_W(s1, s2); XOR(s1, s1, s2); BSTRINS_D(s1, s1, 15, 0); + IFXA (X_SF, BOX64DRENV(dynarec_safeflags)) { + SRLI_D(s3, s1, 15 - F_SF); + X64_SET_EFLAGS(s3, X_SF); + } + IFX (X_PEND) { ST_H(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) return; + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } CLEAR_FLAGS(s3); IFX (X_ZF | X_SF) { @@ -137,6 +148,7 @@ void emit_xor16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit XOR32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch @@ -144,11 +156,11 @@ void emit_xor32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s { IFX(X_PEND) { SET_DF(s4, rex.w ? d_xor64 : d_xor32); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { + if (cpuext.lbt) { IFX(X_ALL) { if (rex.w) X64_XOR_D(s1, s2); @@ -160,6 +172,7 @@ void emit_xor32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s IFX(X_PEND) SDxw(s1, xEmu, offsetof(x64emu_t, res)); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -187,6 +200,7 @@ void emit_xor32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s IFX(X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } @@ -195,11 +209,11 @@ void emit_xor32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i { IFX (X_PEND) { SET_DF(s4, rex.w ? d_xor64 : d_xor32); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { + if (cpuext.lbt) { IFX (X_ALL) { MOV64xw(s3, c); if (rex.w) @@ -222,6 +236,7 @@ void emit_xor32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i } IFX (X_PEND) SDxw(s1, xEmu, offsetof(x64emu_t, res)); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -254,6 +269,7 @@ void emit_xor32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit AND8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed) @@ -261,11 +277,11 @@ void emit_and8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { IFX(X_PEND) { SET_DF(s3, d_and8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA(X_ALL, la64_lbt) { + IFXA(X_ALL, cpuext.lbt) { X64_AND_B(s1, s2); } @@ -275,7 +291,10 @@ void emit_and8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) ST_B(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) return; + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } CLEAR_FLAGS(s3); IFX(X_SF) { @@ -290,20 +309,21 @@ void emit_and8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) IFX(X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit AND8 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch void emit_and8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4) { - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s3, d_and8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA(X_ALL, la64_lbt) { + IFXA(X_ALL, cpuext.lbt) { MOV32w(s3, c); X64_AND_B(s1, s3); } @@ -314,7 +334,10 @@ void emit_and8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s ST_D(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) return; + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } CLEAR_FLAGS(s3); IFX(X_SF) { @@ -329,18 +352,19 @@ void emit_and8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s IFX(X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } void emit_and16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { IFX (X_PEND) { SET_DF(s3, d_tst16); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA (X_ALL, la64_lbt) { - X64_AND_W(s1, s2); + IFXA (X_ALL, cpuext.lbt) { + X64_AND_H(s1, s2); } AND(s1, s1, s2); // res = s1 & s2 @@ -350,7 +374,10 @@ void emit_and16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) ST_H(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) return; + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } CLEAR_FLAGS(s3); IFX (X_SF) { @@ -365,19 +392,19 @@ void emit_and16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit AND32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_and32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) { - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s3, rex.w ? d_tst64 : d_tst32); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - - IFXA(X_ALL, la64_lbt) { + IFXA(X_ALL, cpuext.lbt) { if (rex.w) X64_AND_D(s1, s2); else @@ -391,7 +418,10 @@ void emit_and32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) return; + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } CLEAR_FLAGS(s3); IFX(X_SF) { @@ -407,18 +437,19 @@ void emit_and32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit AND32 instruction, from s1, c, store result in s1 using s3 and s4 as scratch void emit_and32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4) { - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s3, rex.w ? d_tst64 : d_tst32); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA(X_ALL, la64_lbt) { + IFXA(X_ALL, cpuext.lbt) { MOV64xw(s3, c); if (rex.w) X64_AND_D(s1, s3); @@ -429,7 +460,7 @@ void emit_and32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i if (c >= 0 && c <= 4095) { ANDI(s1, s1, c); } else { - IFXA(X_ALL, la64_lbt) { } else MOV64xw(s3, c); + IFXA(X_ALL, cpuext.lbt) { } else MOV64xw(s3, c); AND(s1, s1, s3); // res = s1 & s2 } @@ -437,7 +468,10 @@ void emit_and32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) return; + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } CLEAR_FLAGS(s3); IFX(X_SF) { @@ -452,6 +486,7 @@ void emit_and32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i IFX(X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } @@ -460,11 +495,11 @@ void emit_or16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { IFX (X_PEND) { SET_DF(s3, d_or16); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA (X_ALL, la64_lbt) { + IFXA (X_ALL, cpuext.lbt) { X64_OR_H(s1, s2); } @@ -474,7 +509,10 @@ void emit_or16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) ST_D(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) return; + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } CLEAR_FLAGS(s3); IFX (X_SF) { @@ -490,18 +528,19 @@ void emit_or16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit OR32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_or32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) { - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s4, rex.w?d_or64:d_or32); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA (X_ALL, la64_lbt) { + IFXA (X_ALL, cpuext.lbt) { if (rex.w) X64_OR_D(s1, s2); else @@ -514,8 +553,9 @@ void emit_or32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3 SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) { + if (cpuext.lbt) { if (!rex.w) ZEROUP(s1); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -535,18 +575,19 @@ void emit_or32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3 IFX(X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit OR32 instruction, from s1, c, store result in s1 using s3 and s4 as scratch void emit_or32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4) { - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s4, rex.w ? d_or64 : d_or32); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA(X_ALL, la64_lbt) { + IFXA(X_ALL, cpuext.lbt) { MOV64xw(s3, c); if (rex.w) X64_OR_D(s1, s3); @@ -557,7 +598,7 @@ void emit_or32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, in if (c >= 0 && c <= 4095) { ORI(s1, s1, c); } else { - IFXA(X_ALL, la64_lbt) { } else MOV64xw(s3, c); + IFXA(X_ALL, cpuext.lbt) { } else MOV64xw(s3, c); OR(s1, s1, s3); } @@ -565,8 +606,9 @@ void emit_or32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, in SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) { + if (cpuext.lbt) { if (!rex.w) ZEROUP(s1); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -588,6 +630,7 @@ void emit_or32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, in IFX(X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } @@ -596,11 +639,11 @@ void emit_or8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { IFX (X_PEND) { SET_DF(s3, d_or8); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA (X_ALL, la64_lbt) { + IFXA (X_ALL, cpuext.lbt) { X64_OR_B(s1, s2); } @@ -610,7 +653,10 @@ void emit_or8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) ST_B(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) return; + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } CLEAR_FLAGS(s3); IFX (X_SF) { @@ -625,6 +671,7 @@ void emit_or8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit OR8 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch diff --git a/src/dynarec/la64/dynarec_la64_emit_math.c b/src/dynarec/la64/dynarec_la64_emit_math.c index f99c61e..73600e9 100644 --- a/src/dynarec/la64/dynarec_la64_emit_math.c +++ b/src/dynarec/la64/dynarec_la64_emit_math.c @@ -5,11 +5,9 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "la64_emitter.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -20,12 +18,12 @@ #include "la64_printer.h" #include "dynarec_la64_private.h" #include "dynarec_la64_functions.h" -#include "dynarec_la64_helper.h" +#include "../dynarec_helper.h" // emit ADD32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_add32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) { - IFX(X_PEND) { + IFX (X_PEND) { if (rex.w) { ST_D(s1, xEmu, offsetof(x64emu_t, op1)); ST_D(s2, xEmu, offsetof(x64emu_t, op2)); @@ -34,31 +32,31 @@ void emit_add32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s ST_W(s2, xEmu, offsetof(x64emu_t, op2)); } SET_DF(s3, rex.w ? d_add64 : d_add32b); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { - IFX(X_ALL) { + if (cpuext.lbt) { + IFX (X_ALL) { if (rex.w) - X64_ADD_DU(s1, s2); + X64_ADD_D(s1, s2); else - X64_ADD_WU(s1, s2); + X64_ADD_W(s1, s2); } ADDxw(s1, s1, s2); if (!rex.w) ZEROUP(s1); - IFX(X_PEND) + IFX (X_PEND) SDxw(s1, xEmu, offsetof(x64emu_t, res)); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } CLEAR_FLAGS(s3); - IFX(X_CF) - { + IFX (X_CF) { if (rex.w) { - AND(s5, xMASK, s1); - AND(s4, xMASK, s2); + ZEROUP2(s5, s1); + ZEROUP2(s4, s2); ADD_D(s5, s5, s4); SRLI_D(s3, s1, 0x20); SRLI_D(s4, s2, 0x20); @@ -69,116 +67,110 @@ void emit_add32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s BEQZ(s5, 8); ORI(xFlags, xFlags, 1 << F_CF); } else { - AND(s3, s1, xMASK); - AND(s4, s2, xMASK); + ZEROUP2(s3, s1); + ZEROUP2(s4, s2); ADD_D(s5, s3, s4); SRLI_D(s5, s5, 0x20); BEQZ(s5, 8); ORI(xFlags, xFlags, 1 << F_CF); } } - IFX(X_AF | X_OF) - { + IFX (X_AF | X_OF) { OR(s3, s1, s2); // s3 = op1 | op2 AND(s4, s1, s2); // s4 = op1 & op2 } ADDxw(s1, s1, s2); - IFX(X_PEND) - { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_AF | X_OF) - { + IFX (X_AF | X_OF) { ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) - IFX(X_AF) - { + IFX (X_AF) { ANDI(s4, s3, 0x08); // AF: cc & 0x08 BEQZ(s4, 8); ORI(xFlags, xFlags, 1 << F_AF); } - IFX(X_OF) - { + IFX (X_OF) { SRLI_D(s3, s3, rex.w ? 62 : 30); SRLI_D(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } } - IFX(X_SF) - { + IFX (X_SF) { BGE(s1, xZR, 8); ORI(xFlags, xFlags, 1 << F_SF); } if (!rex.w) { ZEROUP(s1); } - IFX(X_PF) - { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } - IFX(X_ZF) - { + IFX (X_ZF) { BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADD32 instruction, from s1, constant c, store result in s1 using s3 and s4 as scratch void emit_add32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5) { - if (s1 == xRSP && (!dyn->insts || dyn->insts[ninst].x64.gen_flags == X_PEND)) { + if ((s1 == xRSP) && (BOX64DRENV(dynarec_safeflags) < 2) && (!dyn->insts || (dyn->insts[ninst].x64.gen_flags == X_PEND) || (!BOX64ENV(dynarec_df) && (dyn->insts[ninst].x64.gen_flags == X_ALL)))) { // special case when doing math on ESP and only PEND is needed: ignoring it! if (c >= -2048 && c < 2048) { - ADDIxw(s1, s1, c); + ADDI_D(s1, s1, c); } else { - MOV64xw(s2, c); - ADDxw(s1, s1, s2); + MOV64x(s2, c); + ADD_D(s1, s1, s2); } + if (!rex.w) { ZEROUP(s1); } return; } - IFX(X_PEND | X_AF | X_CF | X_OF) - { + IFX (X_PEND | X_AF | X_CF | X_OF) { MOV64xw(s2, c); - } else if (la64_lbt) { + } else IFXA (X_ALL, cpuext.lbt) { + MOV64xw(s2, c); + } else if (c < -2048 || c >= 2048) { MOV64xw(s2, c); } - IFX(X_PEND) - { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, rex.w ? d_add64 : d_add32b); - } - else IFX(X_ALL) - { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { - IFX(X_ALL) { + if (cpuext.lbt) { + IFX (X_ALL) { if (rex.w) - X64_ADD_DU(s1, s2); + X64_ADD_D(s1, s2); else - X64_ADD_WU(s1, s2); + X64_ADD_W(s1, s2); + } + if (c >= -2048 && c < 2048) { + ADDIxw(s1, s1, c); + } else { + ADDxw(s1, s1, s2); } - ADDxw(s1, s1, s2); if (!rex.w) ZEROUP(s1); - IFX(X_PEND) - SDxw(s1, xEmu, offsetof(x64emu_t, res)); + IFX (X_PEND) SDxw(s1, xEmu, offsetof(x64emu_t, res)); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } CLEAR_FLAGS(s3); - IFX(X_CF) - { + IFX (X_CF) { if (rex.w) { - AND(s5, xMASK, s1); - AND(s4, xMASK, s2); + ZEROUP2(s5, s1); + ZEROUP2(s4, s2); ADD_D(s5, s5, s4); SRLI_D(s3, s1, 0x20); SRLI_D(s4, s2, 0x20); @@ -189,16 +181,15 @@ void emit_add32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i BEQZ(s5, 8); ORI(xFlags, xFlags, 1 << F_CF); } else { - AND(s3, s1, xMASK); - AND(s4, s2, xMASK); + ZEROUP2(s3, s1); + ZEROUP2(s4, s2); ADD_D(s5, s3, s4); SRLI_D(s5, s5, 0x20); BEQZ(s5, 8); ORI(xFlags, xFlags, 1 << F_CF); } } - IFX(X_AF | X_OF) - { + IFX (X_AF | X_OF) { OR(s3, s1, s2); // s3 = op1 | op2 AND(s4, s1, s2); // s4 = op1 & op2 } @@ -206,204 +197,196 @@ void emit_add32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i if (c >= -2048 && c < 2048) { ADDIxw(s1, s1, c); } else { - IFX(X_PEND | X_AF | X_CF | X_OF) { } - else - { - MOV64xw(s2, c); - } ADDxw(s1, s1, s2); } - IFX(X_PEND) - { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_AF | X_OF) - { + IFX (X_AF | X_OF) { ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) - IFX(X_AF) - { + IFX (X_AF) { ANDI(s4, s3, 0x08); // AF: cc & 0x08 BEQZ(s4, 8); ORI(xFlags, xFlags, 1 << F_AF); } - IFX(X_OF) - { + IFX (X_OF) { SRLI_D(s3, s3, rex.w ? 62 : 30); SRLI_D(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } } - IFX(X_SF) - { + IFX (X_SF) { BGE(s1, xZR, 8); ORI(xFlags, xFlags, 1 << F_SF); } if (!rex.w) { ZEROUP(s1); } - IFX(X_PF) - { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } - IFX(X_ZF) - { + IFX (X_ZF) { BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADD8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_add8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { - IFX(X_PEND) { + IFX (X_PEND) { ST_B(s1, xEmu, offsetof(x64emu_t, op1)); ST_B(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_add8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { - IFX(X_ALL) { + if (cpuext.lbt) { + IFX (X_ALL) { X64_ADD_B(s1, s2); } ADD_D(s1, s1, s2); - IFX(X_PEND) + // d_add8 will use 16bits result to check for CF, so save 16bits and truncate after + IFX (X_PEND) ST_H(s1, xEmu, offsetof(x64emu_t, res)); + ANDI(s1, s1, 0xff); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } CLEAR_FLAGS(s3); - IFX(X_AF | X_OF) { + IFX (X_AF | X_OF) { OR(s3, s1, s2); // s3 = op1 | op2 AND(s4, s1, s2); // s4 = op1 & op2 } ADD_D(s1, s1, s2); - IFX(X_AF | X_OF) { + IFX (X_AF | X_OF) { ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) - IFX(X_AF) { + IFX (X_AF) { ANDI(s4, s3, 0x08); // AF: cc & 0x08 BEQZ(s4, 8); ORI(xFlags, xFlags, 1 << F_AF); } - IFX(X_OF) { + IFX (X_OF) { SRLI_D(s3, s3, 6); SRLI_D(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } } - IFX(X_CF) { + IFX (X_CF) { SRLI_D(s3, s1, 8); BEQZ(s3, 8); ORI(xFlags, xFlags, 1 << F_CF); } - IFX(X_PEND) { + // d_add8 will use 16bits result to check for CF, so save 16bits and truncate after + IFX (X_PEND) { ST_H(s1, xEmu, offsetof(x64emu_t, res)); } ANDI(s1, s1, 0xff); - IFX(X_ZF) { + IFX (X_ZF) { BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } - IFX(X_SF) { + IFX (X_SF) { SRLI_D(s3, s1, 7); BEQZ(s3, 8); ORI(xFlags, xFlags, 1 << F_SF); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADD8 instruction, from s1, const c, store result in s1 using s3 and s4 as scratch void emit_add8c(dynarec_la64_t* dyn, int ninst, int s1, int c, int s2, int s3, int s4) { - IFX(X_PEND) { + IFX (X_PEND) { MOV32w(s4, c & 0xff); ST_B(s1, xEmu, offsetof(x64emu_t, op1)); ST_B(s4, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_add8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { - IFX(X_ALL) { - IFX(X_PEND) {} else { MOV32w(s4, c & 0xff); } + if (cpuext.lbt) { + IFX (X_ALL) { + IFX (X_PEND) { + } else { + MOV32w(s4, c & 0xff); + } X64_ADD_B(s1, s4); } ADDI_D(s1, s1, c & 0xff); - - IFX(X_PEND) + // d_add8 will use 16bits result to check for CF, so save 16bits and truncate after + IFX (X_PEND) ST_H(s1, xEmu, offsetof(x64emu_t, res)); + ANDI(s1, s1, 0xff); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } CLEAR_FLAGS(s3); - IFX(X_AF | X_OF) - { - IFX(X_PEND) {} else { MOV32w(s4, c & 0xff); } + IFX (X_AF | X_OF) { + IFX (X_PEND) { + } else { + MOV32w(s4, c & 0xff); + } OR(s3, s1, s4); // s3 = op1 | op2 AND(s4, s1, s4); // s4 = op1 & op2 } ADDI_D(s1, s1, c & 0xff); - IFX(X_AF | X_OF) - { + IFX (X_AF | X_OF) { ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) - IFX(X_AF) - { + IFX (X_AF) { ANDI(s4, s3, 0x08); // AF: cc & 0x08 BEQZ(s4, 8); ORI(xFlags, xFlags, 1 << F_AF); } - IFX(X_OF) - { + IFX (X_OF) { SRLI_D(s3, s3, 6); SRLI_D(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } } - IFX(X_CF) - { + IFX (X_CF) { SRLI_D(s3, s1, 8); BEQZ(s3, 8); ORI(xFlags, xFlags, 1 << F_CF); } - IFX(X_PEND) - { + // d_add8 will use 16bits result to check for CF, so save 16bits and truncate after + IFX (X_PEND) { ST_H(s1, xEmu, offsetof(x64emu_t, res)); } ANDI(s1, s1, 0xff); - IFX(X_ZF) - { + IFX (X_ZF) { BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } - IFX(X_SF) - { + IFX (X_SF) { SRLI_D(s3, s1, 7); BEQZ(s3, 8); ORI(xFlags, xFlags, 1 << F_SF); } - IFX(X_PF) - { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADD16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch @@ -413,26 +396,28 @@ void emit_add16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, ST_H(s1, xEmu, offsetof(x64emu_t, op1)); ST_H(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_add16); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA (X_AF | X_OF, !la64_lbt) { + IFXA (X_AF | X_OF, !cpuext.lbt) { OR(s3, s1, s2); // s3 = op1 | op2 AND(s4, s1, s2); // s4 = op1 & op2 } - IFXA (X_ALL, la64_lbt) { - X64_ADD_DU(s1, s2); + IFXA (X_ALL, cpuext.lbt) { + X64_ADD_H(s1, s2); } ADD_D(s1, s1, s2); + // d_add16 will use 32bits result to check for CF IFX (X_PEND) { ST_W(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) { + if (cpuext.lbt) { BSTRPICK_D(s1, s1, 15, 0); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -450,8 +435,7 @@ void emit_add16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, SRLI_D(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } } @@ -475,60 +459,63 @@ void emit_add16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SUB8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_sub8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { - IFX(X_PEND) { + IFX (X_PEND) { ST_B(s1, xEmu, offsetof(x64emu_t, op1)); ST_B(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_sub8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { - IFX(X_ALL) { + if (cpuext.lbt) { + IFX (X_ALL) { X64_SUB_B(s1, s2); } SUB_D(s1, s1, s2); - - IFX(X_PEND) + ANDI(s1, s1, 0xff); + IFX (X_PEND) ST_H(s1, xEmu, offsetof(x64emu_t, res)); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } CLEAR_FLAGS(s3); - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOR(s5, xZR, s1); } SUB_D(s1, s1, s2); ANDI(s1, s1, 0xff); - IFX(X_SF) { + IFX (X_SF) { SRLI_D(s3, s1, 7); BEQZ(s3, 8); ORI(xFlags, xFlags, 1 << F_SF); } - IFX(X_PEND) { + IFX (X_PEND) { ST_B(s1, xEmu, offsetof(x64emu_t, res)); } CALC_SUB_FLAGS(s5, s2, s1, s3, s4, 8); - IFX(X_ZF) { + IFX (X_ZF) { BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SUB8 instruction, from s1, constant c, store result in s1 using s3 and s4 as scratch void emit_sub8c(dynarec_la64_t* dyn, int ninst, int s1, int c, int s2, int s3, int s4, int s5) { - MOV32w(s2, c&0xff); + MOV32w(s2, c & 0xff); emit_sub8(dyn, ninst, s1, s2, s3, s4, s5); } @@ -539,16 +526,16 @@ void emit_sub16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, ST_H(s1, xEmu, offsetof(x64emu_t, op1)); ST_H(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_sub16); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA (X_AF | X_CF | X_OF, !la64_lbt) { + IFXA (X_AF | X_CF | X_OF, !cpuext.lbt) { // for later flag calculation NOR(s5, xZR, s1); } - IFXA (X_ALL, la64_lbt) { + IFXA (X_ALL, cpuext.lbt) { X64_SUB_H(s1, s2); } @@ -557,7 +544,11 @@ void emit_sub16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, ST_H(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) return; + if (cpuext.lbt) { + BSTRPICK_D(s1, s1, 15, 0); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } CLEAR_FLAGS(s3); SLLI_D(s1, s1, 48); @@ -575,66 +566,68 @@ void emit_sub16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SUB32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_sub32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) { - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s3, rex.w?d_sub64:d_sub32); - } else IFX(X_ALL) { + SET_DF(s3, rex.w ? d_sub64 : d_sub32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { - IFX(X_ALL) { + if (cpuext.lbt) { + IFX (X_ALL) { if (rex.w) - X64_SUB_DU(s1, s2); + X64_SUB_D(s1, s2); else - X64_SUB_WU(s1, s2); + X64_SUB_W(s1, s2); } SUBxw(s1, s1, s2); if (!rex.w) ZEROUP(s1); - IFX(X_PEND) + IFX (X_PEND) SDxw(s1, xEmu, offsetof(x64emu_t, res)); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } CLEAR_FLAGS(s3); - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOR(s5, xZR, s1); } SUBxw(s1, s1, s2); - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { + IFX (X_SF) { BGE(s1, xZR, 8); ORI(xFlags, xFlags, 1 << F_SF); } if (!rex.w) { ZEROUP(s1); } - CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w?64:32); - IFX(X_ZF) { + CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w ? 64 : 32); + IFX (X_ZF) { BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SUB32 instruction, from s1, constant c, store result in s1 using s2, s3, s4 and s5 as scratch void emit_sub32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5) { - if(s1==xRSP && (!dyn->insts || dyn->insts[ninst].x64.gen_flags==X_PEND)) - { + if ((s1 == xRSP) && (BOX64DRENV(dynarec_safeflags) < 2) && (!dyn->insts || (dyn->insts[ninst].x64.gen_flags == X_PEND) || (!BOX64ENV(dynarec_df) && (dyn->insts[ninst].x64.gen_flags == X_ALL)))) { // special case when doing math on RSP and only PEND is needed: ignoring it! if (c > -2048 && c <= 2048) { ADDI_D(s1, s1, -c); @@ -642,37 +635,47 @@ void emit_sub32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i MOV64xw(s2, c); SUBxw(s1, s1, s2); } + if (!rex.w) { ZEROUP(s1); } return; } - IFX(X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, op1)); + IFX (X_PEND | X_AF | X_CF | X_OF) { + MOV64xw(s2, c); + } else IFXA (X_ALL, cpuext.lbt) { + MOV64xw(s2, c); + } else if (c <= -2048 || c > 2048) { MOV64xw(s2, c); + } + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s3, rex.w?d_sub64:d_sub32); - } else IFX(X_ALL) { + SET_DF(s3, rex.w ? d_sub64 : d_sub32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - - if (la64_lbt) { - IFX(X_PEND) {} else {MOV64xw(s2, c);} - IFX(X_ALL) { + if (cpuext.lbt) { + IFX (X_ALL) { if (rex.w) { - X64_SUB_DU(s1, s2); + X64_SUB_D(s1, s2); } else { - X64_SUB_WU(s1, s2); + X64_SUB_W(s1, s2); } } - SUBxw(s1, s1, s2); + if (c > -2048 && c <= 2048) { + ADDIxw(s1, s1, -c); + } else { + SUBxw(s1, s1, s2); + } if (!rex.w) ZEROUP(s1); - IFX(X_PEND) + IFX (X_PEND) SDxw(s1, xEmu, offsetof(x64emu_t, res)); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } CLEAR_FLAGS(s3); - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOR(s5, xZR, s1); } @@ -680,34 +683,28 @@ void emit_sub32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i if (c > -2048 && c <= 2048) { ADDIxw(s1, s1, -c); } else { - IFX(X_PEND) {} else {MOV64xw(s2, c);} SUBxw(s1, s1, s2); } - IFX(X_AF | X_CF | X_OF) { - IFX(X_PEND) {} - else if (c > -2048 && c <= 2048) { - MOV64xw(s2, c); - } - } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { + IFX (X_SF) { BGE(s1, xZR, 8); ORI(xFlags, xFlags, 1 << F_SF); } if (!rex.w) { ZEROUP(s1); } - CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w?64:32); - IFX(X_ZF) { + CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w ? 64 : 32); + IFX (X_ZF) { BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } @@ -718,20 +715,31 @@ void emit_sbb8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i ST_B(s1, xEmu, offsetof(x64emu_t, op1)); ST_B(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_sbb8); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { + if (cpuext.lbt) { SBC_B(s3, s1, s2); IFX (X_ALL) { X64_SBC_B(s1, s2); } - - MV(s1, s3); + IFX (X_AF) NOR(s5, xZR, s1); + ANDI(s1, s3, 0xff); + IFX (X_AF) { + // bc = (res & (~op1 | op2)) | (~op1 & op2) + OR(s3, s5, s2); + AND(s4, s1, s3); + AND(s5, s5, s2); + OR(s4, s4, s5); + // af = bc & 0x8 + SLLI_D(s3, s4, F_AF - 3); + X64_SET_EFLAGS(s3, X_AF); + } IFX (X_PEND) ST_B(s1, xEmu, offsetof(x64emu_t, res)); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -764,6 +772,7 @@ void emit_sbb8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SBB8 instruction, from s1, constant c, store result in s1 using s3, s4, s5 and s6 as scratch @@ -780,19 +789,28 @@ void emit_sbb16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, ST_H(s1, xEmu, offsetof(x64emu_t, op1)); ST_H(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_sbb16); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFXA (X_ALL, la64_lbt) { + if (cpuext.lbt) { + IFXA (X_AF, BOX64DRENV(dynarec_safeflags)) NOR(s5, xZR, s1); SBC_H(s3, s1, s2); - - IFX (X_ALL) { - X64_SBC_H(s1, s2); - } + IFX (X_ALL) X64_SBC_H(s1, s2); BSTRPICK_D(s1, s3, 15, 0); + IFXA (X_AF, BOX64DRENV(dynarec_safeflags)) { + // bc = (res & (~op1 | op2)) | (~op1 & op2) + OR(s3, s5, s2); + AND(s4, s1, s3); + AND(s5, s5, s2); + OR(s4, s4, s5); + // af = bc & 0x8 + SLLI_D(s3, s4, F_AF - 3); + X64_SET_EFLAGS(s3, X_AF); + } IFX (X_PEND) ST_H(s1, xEmu, offsetof(x64emu_t, res)); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -825,6 +843,7 @@ void emit_sbb16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SBB32 instruction, from s1, s2, store result in s1 using s3, s4 and s5 as scratch @@ -834,11 +853,11 @@ void emit_sbb32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, rex.w ? d_sbb64 : d_sbb32); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { + if (cpuext.lbt) { if (rex.w) { SBC_D(s3, s1, s2); } else { @@ -850,10 +869,24 @@ void emit_sbb32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s else X64_SBC_W(s1, s2); } - MVxw(s1, s3); - + IFXA (X_AF, BOX64DRENV(dynarec_safeflags)) NOR(s5, xZR, s1); + if (rex.w) + MV(s1, s3); + else + ZEROUP2(s1, s3); + IFXA (X_AF, BOX64DRENV(dynarec_safeflags)) { + // bc = (res & (~op1 | op2)) | (~op1 & op2) + OR(s3, s5, s2); + AND(s4, s1, s3); + AND(s5, s5, s2); + OR(s4, s4, s5); + // af = bc & 0x8 + SLLI_D(s3, s4, F_AF - 3); + X64_SET_EFLAGS(s3, X_AF); + } IFX (X_PEND) SDxw(s1, xEmu, offsetof(x64emu_t, res)); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -871,14 +904,10 @@ void emit_sbb32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s BGE(s1, xZR, 8); ORI(xFlags, xFlags, 1 << F_SF); } - if (!rex.w) { - ZEROUP(s1); - } - + if (!rex.w) ZEROUP(s1); IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w ? 64 : 32); IFX (X_ZF) { BNEZ(s1, 8); @@ -887,6 +916,7 @@ void emit_sbb32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } @@ -896,14 +926,14 @@ void emit_neg8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3) IFX (X_PEND) { ST_B(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s3, d_neg8); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } IFX (X_AF | X_OF) { MV(s3, s1); // s3 = op1 } - IFXA (X_ALL, la64_lbt) { + IFXA (X_ALL, cpuext.lbt) { X64_SUB_B(xZR, s1); } @@ -913,7 +943,10 @@ void emit_neg8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3) ST_B(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) return; + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } CLEAR_FLAGS(s2); IFX (X_CF) { @@ -950,6 +983,7 @@ void emit_neg8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3) BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit NEG32 instruction, from s1, store result in s1 using s2 and s3 as scratch @@ -958,21 +992,21 @@ void emit_neg32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s3, rex.w ? d_neg64 : d_neg32); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (!la64_lbt) { + if (!cpuext.lbt) { IFX (X_AF | X_OF) { MV(s3, s1); // s3 = op1 } } - IFXA (X_ALL, la64_lbt) { + IFXA (X_ALL, cpuext.lbt) { if (rex.w) - X64_SUB_DU(xZR, s1); + X64_SUB_D(xZR, s1); else - X64_SUB_WU(xZR, s1); + X64_SUB_W(xZR, s1); } NEGxw(s1, s1); @@ -980,10 +1014,9 @@ void emit_neg32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - if (la64_lbt) { - if (!rex.w) { - ZEROUP(s1); - } + if (cpuext.lbt) { + if (!rex.w) ZEROUP(s1); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -1025,6 +1058,170 @@ void emit_neg32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit ADC8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch +void emit_adc8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) +{ + IFX (X_PEND) { + ST_B(s1, xEmu, offsetof(x64emu_t, op1)); + ST_B(s2, xEmu, offsetof(x64emu_t, op2)); + SET_DF(s3, d_adc8b); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + if (cpuext.lbt) { + ADC_B(s3, s1, s2); + + IFX (X_ALL) { + X64_ADC_B(s1, s2); + } + ANDI(s1, s3, 0xff); // that's probably unneeded as ADC_B should restrain the result to 8bits already + IFX (X_PEND) { + ST_B(s3, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } + + IFX (X_AF | X_OF) { + OR(s4, s1, s2); // s4 = op1 | op2 + AND(s5, s1, s2); // s5 = op1 & op2 + } + + ADD_D(s1, s1, s2); + ANDI(s3, xFlags, 1 << F_CF); + ADD_D(s1, s1, s3); + + CLEAR_FLAGS(s3); + IFX (X_PEND) { + // d_adc8 will use 16bits result to check for CF + ST_B(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_AF | X_OF) { + ANDN(s3, s4, s1); // s3 = ~res & (op1 | op2) + OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2) + IFX (X_AF) { + ANDI(s4, s3, 0x08); // AF: cc & 0x08 + BEQZ(s4, 8); + ORI(xFlags, xFlags, 1 << F_AF); + } + IFX (X_OF) { + SRLI_D(s3, s3, 6); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + ANDI(s3, s3, 1); // OF: xor of two MSB's of cc + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + } + IFX (X_CF) { + SRLI_D(s3, s1, 8); + BEQZ(s3, 8); + ORI(xFlags, xFlags, 1 << F_CF); + } + + ANDI(s1, s1, 0xff); // unneeded? + + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_SF) { + SRLI_D(s3, s1, 7); + BEQZ(s3, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit ADC8 instruction, from s1, const c, store result in s1 using s3, s4, s5 and s6 as scratch +void emit_adc8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5, int s6) +{ + MOV32w(s5, c & 0xff); + emit_adc8(dyn, ninst, s1, s5, s3, s4, s6); +} + +// emit ADC16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch +void emit_adc16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) +{ + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, op1)); + ST_H(s2, xEmu, offsetof(x64emu_t, op2)); + SET_DF(s3, d_adc16b); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + if (cpuext.lbt) { + ADC_H(s3, s1, s2); + + IFX (X_ALL) { + X64_ADC_H(s1, s2); + } + BSTRPICK_D(s1, s3, 15, 0); + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } + + IFX (X_AF | X_OF) { + OR(s4, s1, s2); // s4 = op1 | op2 + AND(s5, s1, s2); // s5 = op1 & op2 + } + + ADD_D(s1, s1, s2); + ANDI(s3, xFlags, 1 << F_CF); + ADD_D(s1, s1, s3); + + CLEAR_FLAGS(s3); + IFX (X_PEND) { + // d_adc16 will use 32bits result to check for CF + ST_H(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_AF | X_OF) { + ANDN(s3, s4, s1); // s3 = ~res & (op1 | op2) + OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2) + IFX (X_AF) { + ANDI(s4, s3, 0x08); // AF: cc & 0x08 + BEQZ(s4, 8); + ORI(xFlags, xFlags, 1 << F_AF); + } + IFX (X_OF) { + SRLI_D(s3, s3, 14); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + ANDI(s3, s3, 1); // OF: xor of two MSB's of cc + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + } + IFX (X_CF) { + SRLI_D(s3, s1, 16); + BEQZ(s3, 8); + ORI(xFlags, xFlags, 1 << F_CF); + } + + BSTRPICK_D(s1, s1, 15, 0); // unneeded? + + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_SF) { + SRLI_D(s3, s1, 15); + BEQZ(s3, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADC32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch @@ -1034,11 +1231,11 @@ void emit_adc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, rex.w ? d_adc64 : d_adc32b); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { + if (cpuext.lbt) { if (rex.w) ADC_D(s3, s1, s2); else @@ -1050,17 +1247,21 @@ void emit_adc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s else X64_ADC_W(s1, s2); } - MV(s1, s3); + if (rex.w) + MV(s1, s3); + else + ZEROUP2(s1, s3); IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } IFX (X_CF) { if (rex.w) { - AND(s5, xMASK, s1); - AND(s4, xMASK, s2); + ZEROUP2(s5, s1); + ZEROUP2(s4, s2); ADD_D(s5, s5, s4); // lo ANDI(s3, xFlags, 1); ADD_D(s5, s5, s3); // add carry @@ -1071,8 +1272,8 @@ void emit_adc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s ADD_D(s5, s5, s4); // hi SRAI_D(s6, s5, 0x20); } else { - AND(s3, s1, xMASK); - AND(s4, s2, xMASK); + ZEROUP2(s3, s1); + ZEROUP2(s4, s2); ADD_D(s5, s3, s4); ANDI(s3, xFlags, 1); ADD_D(s5, s5, s3); // add carry @@ -1110,8 +1311,7 @@ void emit_adc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s SRLI_D(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } } IFX (X_SF) { @@ -1128,42 +1328,35 @@ void emit_adc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit INC8 instruction, from s1, store result in s1 using s2, s3 and s4 as scratch void emit_inc8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { - IFX (X_PEND) { - ST_B(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s3, d_inc8); - } else IFX (X_ALL) { - SET_DFNONE(); + SET_DFNONE(); + IFXA (X_ALL, !cpuext.lbt) { + // preserving CF + MOV64x(s4, (1UL << F_AF) | (1UL << F_OF) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF)); + ANDN(xFlags, xFlags, s4); } - IFXA (X_AF | X_OF, !la64_lbt) { + + IFXA (X_AF | X_OF, !cpuext.lbt) { ORI(s3, s1, 1); // s3 = op1 | op2 ANDI(s4, s1, 1); // s5 = op1 & op2 } - IFXA (X_ALL, la64_lbt) { + IFXA (X_ALL, cpuext.lbt) { X64_INC_B(s1); } ADDI_W(s1, s1, 1); - - IFX (X_PEND) { - ST_B(s1, xEmu, offsetof(x64emu_t, res)); - } - - if (la64_lbt) { + if (cpuext.lbt) { ANDI(s1, s1, 0xff); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } - IFX (X_ALL) { - // preserving CF - MOV64x(s4, (1UL << F_AF) | (1UL << F_OF) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF)); - ANDN(xFlags, xFlags, s4); - } IFX (X_AF | X_OF) { ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) @@ -1177,8 +1370,7 @@ void emit_inc8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) SRLI_D(s2, s3, 1); XOR(s3, s3, s2); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } } IFX (X_SF) { @@ -1194,43 +1386,35 @@ void emit_inc8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit INC16 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_inc16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { - IFX (X_PEND) { - ST_H(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s3, d_inc16); - } else IFX (X_ZF | X_OF | X_AF | X_SF | X_PF) { - SET_DFNONE(); + SET_DFNONE(); + IFXA (X_ALL, !cpuext.lbt) { + // preserving CF + MOV64x(s4, (1UL << F_AF) | (1UL << F_OF) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF)); + ANDN(xFlags, xFlags, s4); } - IFXA (X_AF | X_OF, !la64_lbt) { + + IFXA (X_AF | X_OF, !cpuext.lbt) { ORI(s3, s1, 1); // s3 = op1 | op2 ANDI(s4, s1, 1); // s4 = op1 & op2 } - IFXA (X_ALL, la64_lbt) { + IFXA (X_ALL, cpuext.lbt) { X64_INC_H(s1); } ADDI_D(s1, s1, 1); - - IFX (X_PEND) { - ST_H(s1, xEmu, offsetof(x64emu_t, res)); - } - - if (la64_lbt) { + if (cpuext.lbt) { BSTRPICK_D(s1, s1, 15, 0); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } - IFX (X_ALL) { - // preserving CF - MOV64x(s4, (1UL << F_AF) | (1UL << F_OF) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF)); - ANDN(xFlags, xFlags, s4); - } - IFX (X_AF | X_OF) { ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) @@ -1244,8 +1428,7 @@ void emit_inc16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) SRLI_D(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } } @@ -1263,24 +1446,25 @@ void emit_inc16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit INC32 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_inc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) { - IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s3, rex.w ? d_inc64 : d_inc32); - } else IFX (X_ALL) { - SET_DFNONE(); + SET_DFNONE(); + IFXA (X_ALL, !cpuext.lbt) { + // preserving CF + MOV64x(s4, (1UL << F_AF) | (1UL << F_OF) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF)); + ANDN(xFlags, xFlags, s4); } - IFXA (X_AF | X_OF, !la64_lbt) { + IFXA (X_AF | X_OF, !cpuext.lbt) { ORI(s3, s1, 1); // s3 = op1 | op2 ANDI(s5, s1, 1); // s5 = op1 & op2 } - IFXA (X_ALL, la64_lbt) { + IFXA (X_ALL, cpuext.lbt) { if (rex.w) { X64_INC_D(s1); } else { @@ -1289,21 +1473,12 @@ void emit_inc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s } ADDIxw(s1, s1, 1); - - IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); - } - - if (la64_lbt) { + if (cpuext.lbt) { if (!rex.w) ZEROUP(s1); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } - IFX (X_ALL) { - // preserving CF - MOV64x(s4, (1UL << F_AF) | (1UL << F_OF) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF)); - ANDN(xFlags, xFlags, s4); - } IFX (X_AF | X_OF) { ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2) @@ -1317,8 +1492,7 @@ void emit_inc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s SRLI_D(s2, s3, 1); XOR(s3, s3, s2); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } } IFX (X_SF) { @@ -1335,43 +1509,36 @@ void emit_inc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit DEC8 instruction, from s1, store result in s1 using s2, s3 and s4 as scratch void emit_dec8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { - IFX (X_PEND) { - ST_B(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s3, d_dec8); - } else IFX (X_ALL) { - SET_DFNONE(); + SET_DFNONE(); + IFXA (X_ALL, !cpuext.lbt) { + // preserving CF + MOV64x(s4, (1UL << F_AF) | (1UL << F_OF) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF)); + ANDN(xFlags, xFlags, s4); } - IFXA (X_AF | X_OF, !la64_lbt) { + + IFXA (X_AF | X_OF, !cpuext.lbt) { NOR(s4, xZR, s1); // s4 = ~op1 ORI(s3, s4, 1); // s3 = ~op1 | op2 ANDI(s4, s4, 1); // s4 = ~op1 & op2 } - IFXA (X_ALL, la64_lbt) { + IFXA (X_ALL, cpuext.lbt) { X64_DEC_B(s1); } ADDI_W(s1, s1, -1); - - IFX (X_PEND) { - ST_B(s1, xEmu, offsetof(x64emu_t, res)); - } - - if (la64_lbt) { + if (cpuext.lbt) { ANDI(s1, s1, 0xff); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } - IFX (X_ALL) { - // preserving CF - MOV64x(s4, (1UL << F_AF) | (1UL << F_OF) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF)); - ANDN(xFlags, xFlags, s4); - } IFX (X_AF | X_OF) { AND(s3, s1, s3); // s3 = res & (~op1 | op2) OR(s3, s3, s4); // cc = (res & (~op1 | op2)) | (~op1 & op2) @@ -1385,8 +1552,7 @@ void emit_dec8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) SRLI_D(s2, s3, 1); XOR(s3, s3, s2); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } } IFX (X_SF) { @@ -1402,38 +1568,29 @@ void emit_dec8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit DEC16 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_dec16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { - IFX (X_PEND) { - ST_H(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s3, d_dec16); - } else IFX (X_ALL) { - SET_DFNONE(); + SET_DFNONE(); + + if (cpuext.lbt) { + IFX (X_ALL) X64_DEC_H(s1); + ADDI_W(s1, s1, -1); + BSTRPICK_D(s1, s1, 15, 0); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; } + IFX (X_AF | X_OF) { NOR(s5, xZR, s1); ORI(s3, s5, 1); // s3 = ~op1 | op2 ANDI(s5, s5, 1); // s5 = ~op1 & op2 } - IFXA (X_ALL, la64_lbt) { - X64_DEC_H(s1); - } - ADDI_W(s1, s1, -1); - - IFX (X_PEND) { - ST_H(s1, xEmu, offsetof(x64emu_t, res)); - } - - if (la64_lbt) { - BSTRPICK_D(s1, s1, 15, 0); - return; - } - IFX (X_ALL) { // preserving CF MOV64x(s4, (1UL << F_AF) | (1UL << F_OF) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF)); @@ -1453,16 +1610,13 @@ void emit_dec16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, SRLI_D(s2, s3, 1); XOR(s3, s3, s2); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } } - SLLI_W(s1, s1, 16); IFX (X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + BSTRPICK_D(s5, s1, 15, 15); + BSTRINS_D(xFlags, s5, F_SF, F_SF); } - SRLI_W(s1, s1, 16); IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s2); } @@ -1470,42 +1624,35 @@ void emit_dec16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit DEC32 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_dec32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) { - IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s3, rex.w ? d_dec64 : d_dec32); - } else IFX (X_ALL) { - SET_DFNONE(); + SET_DFNONE(); + if (cpuext.lbt) { + IFX (X_ALL) { + if (rex.w) { + X64_DEC_D(s1); + } else { + X64_DEC_W(s1); + } + } + ADDIxw(s1, s1, -1); + if (!rex.w) ZEROUP(s1); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; } - IFXA (X_AF | X_OF, !la64_lbt) { + + IFX (X_AF | X_OF) { NOR(s5, xZR, s1); ORI(s3, s5, 1); // s3 = ~op1 | op2 ANDI(s5, s5, 1); // s5 = ~op1 & op2 } - IFXA (X_ALL, la64_lbt) { - if (rex.w) { - X64_DEC_D(s1); - } else { - X64_DEC_W(s1); - } - } ADDIxw(s1, s1, -1); - - IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); - } - - if (la64_lbt) { - if (!rex.w) ZEROUP(s1); - return; - } - IFX (X_ALL) { // preserving CF MOV64x(s4, (1UL << F_AF) | (1UL << F_OF) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF)); @@ -1524,17 +1671,14 @@ void emit_dec32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s SRLI_D(s2, s3, 1); XOR(s3, s3, s2); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } } IFX (X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); - } - if (!rex.w) { - ZEROUP(s1); + BSTRPICK_D(s5, s1, 31, 31); + BSTRINS_D(xFlags, s5, F_SF, F_SF); } + if (!rex.w) ZEROUP(s1); IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s2); } @@ -1542,6 +1686,7 @@ void emit_dec32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } @@ -1551,20 +1696,20 @@ void emit_neg16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3) IFX (X_PEND) { ST_H(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s3, d_neg16); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } + CLEAR_FLAGS(s3); IFX (X_AF | X_OF) { MV(s3, s1); // s3 = op1 } - NOR(s1, s1, xZR); + NEG_D(s1, s1); BSTRPICK_D(s1, s1, 15, 0); IFX (X_PEND) { ST_H(s1, xEmu, offsetof(x64emu_t, res)); } - CLEAR_FLAGS(s3); IFX (X_CF) { BEQZ(s1, 8); ORI(xFlags, xFlags, 1 << F_CF); @@ -1601,7 +1746,8 @@ void emit_neg16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3) ORI(xFlags, xFlags, 1 << F_ZF); } - IFXA (X_ALL, la64_lbt) { + IFXA (X_ALL, cpuext.lbt) { SPILL_EFLAGS(); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } diff --git a/src/dynarec/la64/dynarec_la64_emit_shift.c b/src/dynarec/la64/dynarec_la64_emit_shift.c index 7cc978a..680cd20 100644 --- a/src/dynarec/la64/dynarec_la64_emit_shift.c +++ b/src/dynarec/la64/dynarec_la64_emit_shift.c @@ -5,11 +5,10 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "la64_emitter.h" -#include "x64run.h" +#include "la64_mapping.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -20,7 +19,7 @@ #include "la64_printer.h" #include "dynarec_la64_private.h" #include "dynarec_la64_functions.h" -#include "dynarec_la64_helper.h" +#include "../dynarec_helper.h" // emit SHL16 instruction, from s1 , shift s2, store result in s1 using s3, s4 and s5 as scratch void emit_shl16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) @@ -30,26 +29,42 @@ void emit_shl16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, ST_H(s1, xEmu, offsetof(x64emu_t, op1)); ST_H(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, d_shl16); - } else IFX (X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { + if (cpuext.lbt) { IFX (X_ALL) { X64_SLL_H(s1, s2); } + + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) { + SRLI_D(s3, s1, 14 - F_OF); + SRLI_D(s5, s3, 1); + XOR(s3, s3, s5); + BSTRINS_D(s3, xZR, F_AF, F_AF); + X64_SET_EFLAGS(s3, (X_OF | X_AF)); + } + SLL_D(s1, s1, s2); BSTRPICK_D(s1, s1, 15, 0); IFX (X_PEND) { ST_H(s1, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } + CLEAR_FLAGS(s3); + IFX (X_OF) { + SRLI_D(s3, s1, 14); + SRLI_D(s5, s3, 1); + XOR(s3, s3, s5); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } SLL_D(s1, s1, s2); - CLEAR_FLAGS(s3); IFX (X_CF | X_OF) { SRLI_D(s5, s1, 16); ANDI(s5, s5, 1); // LSB == F_CF @@ -72,17 +87,111 @@ void emit_shl16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit SHL16 instruction, from s1 , constant c, store result in s1 using s3, s4 and s5 as scratch +void emit_shl16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5) +{ + if (!c) return; + // c != 0 + + IFX (X_PEND) { + MOV64x(s3, c); + ST_H(s3, xEmu, offsetof(x64emu_t, op2)); + ST_H(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, d_shl16); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + if (cpuext.lbt) { + IFX (X_PEND) { + } else { + MOV64x(s3, c); + } + IFX (X_ALL) { + X64_SLL_H(s1, s3); + } + + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) { + SRLI_D(s3, s1, 14 - F_OF); + SRLI_D(s5, s3, 1); + XOR(s3, s3, s5); + BSTRINS_D(s3, xZR, F_AF, F_AF); + X64_SET_EFLAGS(s3, (X_OF | X_AF)); + } + + SLLI_D(s1, s1, c); + + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) { + BSTRPICK_D(s1, s1, 15, 0); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } + return; + } + + CLEAR_FLAGS(s3); + IFX (X_OF) { - // OF flag is affected only on 1-bit shifts - ADDI_D(s3, s2, -1); - BNEZ(s3, 4 + 4 * 4); - SRLI_D(s3, s1, 15); + SRLI_D(s3, s1, 14); + SRLI_D(s5, s3, 1); XOR(s3, s3, s5); - SLLI_D(s3, s3, F_OF); - OR(xFlags, xFlags, s3); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } - IFX (X_PF) { - emit_pf(dyn, ninst, s1, s3, s4); + + if (c < 16) { + IFX (X_CF) { + SRLI_D(s3, s1, 16 - c); + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + + SLLI_D(s1, s1, c + 48); + IFX (X_SF) { + SLTI(s3, s1, 0); + BSTRINS_D(xFlags, s3, F_SF, F_SF); + } + SRLI_D(s1, s1, 48); + + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } else { + IFXA (X_CF, c == 16) { + ANDI(s3, s1, 1); + OR(xFlags, xFlags, s3); // F_CF == 0 + } + MV(s1, xZR); + + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); + } + // OF nop + // SF nop + // AF nop + IFX (X_PF | X_ZF) { + IFX (X_ZF) { + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_PF) { + ORI(xFlags, xFlags, 1 << F_PF); + } + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(xZR, xZR, xZR, xZR); } } @@ -90,68 +199,71 @@ void emit_shl16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, void emit_shl32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) { // s2 is not 0 here and is 1..1f/3f - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s4, rex.w?d_shl64:d_shl32); - } else IFX(X_ALL) { + SET_DF(s4, rex.w ? d_shl64 : d_shl32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { - IFX(X_ALL) { + if (cpuext.lbt) { + IFX (X_ALL) { if (rex.w) X64_SLL_D(s1, s2); else X64_SLL_W(s1, s2); } + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) { + SRLIxw(s3, s1, (rex.w ? 62 : 30) - F_OF); + SRLI_D(s5, s3, 1); + XOR(s3, s3, s5); + BSTRINS_D(s3, xZR, F_AF, F_AF); + X64_SET_EFLAGS(s3, (X_OF | X_AF)); + } SLL_D(s1, s1, s2); if (!rex.w) { ZEROUP(s1); } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } CLEAR_FLAGS(s3); - IFX(X_CF | X_OF) { - ADDI_D(s5, s2, rex.w?-64:-32); - SUB_D(s5, xZR, s5); - SRL_W(s3, s1, s5); - ANDI(s5, s3, 1); // LSB == F_CF - IFX(X_CF) { - OR(xFlags, xFlags, s5); - } + IFX (X_OF) { + SRLIxw(s3, s1, rex.w ? 62 : 30); + SRLI_D(s5, s3, 1); + XOR(s3, s3, s5); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } - - SLL_D(s1, s1, s2); - - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_CF) { + ADDI_D(s5, s2, rex.w ? -64 : -32); + NEG_D(s5, s5); + SRL_D(s3, s1, s5); + BSTRINS_D(xFlags, s3, F_CF, F_CF); } - if (!rex.w) { - ZEROUP(s1); + if (rex.w) { + SLL_D(s1, s1, s2); + } else { + SLL_W(s1, s1, s2); + } + IFX (X_SF) { + SLTI(s3, s1, 0); + BSTRINS_D(xFlags, s3, F_SF, F_SF); } - IFX(X_PEND) { + if (!rex.w) ZEROUP(s1); + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { + IFX (X_ZF) { BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts - ADDI_D(s3, s2, -1); - BNEZ(s3, 4 + 4 * 4); - SRLIxw(s3, s1, rex.w?63:31); - XOR(s3, s3, s5); - SLLI_D(s3, s3, F_OF); - OR(xFlags, xFlags, s3); - } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SHL32 instruction, from s1 , constant c, store result in s1 using s3, s4 and s5 as scratch @@ -159,7 +271,7 @@ void emit_shl32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, { if (!c) return; - IFX(X_PEND) { + IFX (X_PEND) { if (c) { MOV64x(s3, c); SDxw(s3, xEmu, offsetof(x64emu_t, op2)); @@ -167,37 +279,48 @@ void emit_shl32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); } SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w?d_shl64:d_shl32); - } else IFX(X_ALL) { + SET_DF(s4, rex.w ? d_shl64 : d_shl32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if(la64_lbt) { - IFX(X_PEND) {} else { MOV64x(s3, c); } - IFX(X_ALL) { + if (cpuext.lbt) { + IFX (X_PEND) { + } else { + MOV64x(s3, c); + } + IFX (X_ALL) { if (rex.w) X64_SLL_D(s1, s3); else X64_SLL_W(s1, s3); } - + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) { + SRLIxw(s3, s1, (rex.w ? 62 : 30) - F_OF); + SRLI_D(s5, s3, 1); + XOR(s3, s3, s5); + BSTRINS_D(s3, xZR, F_AF, F_AF); + X64_SET_EFLAGS(s3, (X_OF | X_AF)); + } SLLIxw(s1, s1, c); - - IFX(X_PEND) { + if (!rex.w) ZEROUP(s1); + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } CLEAR_FLAGS(s3); - IFX(X_CF | X_OF) { - if (c > 0) { - SRLI_D(s3, s1, (rex.w ? 64 : 32) - c); - ANDI(s5, s3, 1); // LSB == F_CF - IFX(X_CF) { - OR(xFlags, xFlags, s5); - } - } + IFX (X_OF) { + SRLIxw(s3, s1, rex.w ? 62 : 30); + SRLI_D(s5, s3, 1); + XOR(s3, s3, s5); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + IFX (X_CF) { + SRLI_D(s3, s1, (rex.w ? 64 : 32) - c); + BSTRINS_D(xFlags, s3, F_CF, F_CF); } if (rex.w) { @@ -206,82 +329,79 @@ void emit_shl32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, SLLI_W(s1, s1, c); } - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SLTI(s3, s1, 0); + BSTRINS_D(xFlags, s3, F_SF, F_SF); } if (!rex.w) { ZEROUP(s1); } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { + IFX (X_ZF) { BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts - if (c == 1) { - SRLIxw(s3, s1, rex.w ? 63 : 31); - XOR(s3, s3, s5); - SLLI_D(s3, s3, F_OF); - OR(xFlags, xFlags, s3); - } - } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } -// emit SHR8 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3 and s4 as scratch -void emit_shr8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) +// emit SHL8 instruction, from s1 , shift s2, store result in s1 using s3, s4 and s5 as scratch +void emit_shl8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { - int64_t j64; - - IFX (X_PEND) { - ST_B(s2, xEmu, offsetof(x64emu_t, op2)); ST_B(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, d_shr8); - } else IFX (X_ALL) { + ST_B(s2, xEmu, offsetof(x64emu_t, op2)); + SET_DF(s4, d_shl8); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { - IFX (X_ALL) { - X64_SRL_B(s1, s2); + if (cpuext.lbt) { + IFX (X_ALL) X64_SLL_B(s1, s2); + IFXA ((X_OF | X_AF), BOX64DRENV(dynarec_safeflags)) { + SLLI_D(s3, s1, F_OF - 6); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + BSTRINS_D(s3, xZR, F_AF, F_AF); + X64_SET_EFLAGS(s3, (X_OF | X_AF)); } - SRL_D(s1, s1, s2); + SLL_D(s1, s1, s2); ANDI(s1, s1, 0xff); IFX (X_PEND) { ST_B(s1, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } CLEAR_FLAGS(s3); - IFX (X_CF) { - ADDI_D(s3, s2, -1); - SRA_D(s3, s1, s3); - ANDI(s3, s3, 1); // LSB == F_CF - OR(xFlags, xFlags, s3); - } + IFX (X_OF) { - // OF flag is affected only on 1-bit shifts - // OF flag is set to the most-significant bit of the original operand - ADDI_D(s3, xZR, 1); - BNE(s2, s3, 4 + 3 * 4); - SRLI_D(s3, s1, 7); - SLLI_D(s3, s3, F_OF); - OR(xFlags, xFlags, s3); + SRLI_D(s3, s1, 6); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } - SRL_D(s1, s1, s2); - ANDI(s1, s1, 0xff); + SLL_D(s1, s1, s2); + + IFX (X_CF) { + SRLI_D(s5, s1, 8); + BSTRINS_D(xFlags, s5, F_CF, F_CF); + } + + SLLI_D(s1, s1, 56); + IFX (X_SF) { + BGE(s1, xZR, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + SRLI_D(s1, s1, 56); - // SF should be unset IFX (X_PEND) { ST_B(s1, xEmu, offsetof(x64emu_t, res)); } @@ -292,32 +412,35 @@ void emit_shr8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } -// emit SHR16 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3 and s4 as scratch -void emit_shr16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) +// emit SHR8 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3 and s4 as scratch +void emit_shr8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { - int64_t j64; IFX (X_PEND) { - ST_H(s2, xEmu, offsetof(x64emu_t, op2)); - ST_H(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, d_shr16); - } else IFX (X_ALL) { + ST_B(s2, xEmu, offsetof(x64emu_t, op2)); + ST_B(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, d_shr8); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { - IFX (X_ALL) { - X64_SRL_H(s1, s2); + if (cpuext.lbt) { + IFX (X_ALL) X64_SRL_B(s1, s2); + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) { + SLLI_D(s3, s1, F_OF - 7); + BSTRINS_D(s3, xZR, F_AF, F_AF); + X64_SET_EFLAGS(s3, (X_OF | X_AF)); } - SRL_D(s1, s1, s2); - BSTRPICK_D(s1, s1, 15, 0); + ANDI(s1, s1, 0xff); IFX (X_PEND) { - ST_H(s1, xEmu, offsetof(x64emu_t, res)); + ST_B(s1, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -329,21 +452,17 @@ void emit_shr16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, OR(xFlags, xFlags, s3); } IFX (X_OF) { - // OF flag is affected only on 1-bit shifts // OF flag is set to the most-significant bit of the original operand - ADDI_D(s3, xZR, 1); - BNE(s2, s3, 4 + 3 * 4); - SRLI_D(s3, s1, 15); - SLLI_D(s3, s3, F_OF); - OR(xFlags, xFlags, s3); + SRLI_D(s3, s1, 7); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } SRL_D(s1, s1, s2); - BSTRPICK_D(s1, s1, 15, 0); + ANDI(s1, s1, 0xff); // SF should be unset IFX (X_PEND) { - ST_H(s1, xEmu, offsetof(x64emu_t, res)); + ST_B(s1, xEmu, offsetof(x64emu_t, res)); } IFX (X_ZF) { BNEZ(s1, 8); @@ -352,34 +471,31 @@ void emit_shr16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } -// emit SHR32 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3 and s4 as scratch -void emit_shr32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) +// emit SAR8 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3, s4 and s5 as scratch +void emit_sar8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { int64_t j64; - - IFX (X_PEND) { - SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w ? d_shr64 : d_shr32); - } else IFX (X_ALL) { + ST_B(s2, xEmu, offsetof(x64emu_t, op2)); + ST_B(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, d_sar8); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { - IFX (X_ALL) { - if (rex.w) - X64_SRL_D(s1, s2); - else - X64_SRL_W(s1, s2); - } - SRL_D(s1, s1, s2); - if (!rex.w) { ZEROUP(s1); } + if (cpuext.lbt) { + IFX (X_ALL) X64_SRA_B(s1, s2); + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) X64_SET_EFLAGS(xZR, (X_AF | X_OF)); + SRA_D(s1, s1, s2); + ANDI(s1, s1, 0xff); + IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); + ST_B(s1, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -390,27 +506,19 @@ void emit_shr32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s ANDI(s3, s3, 1); // LSB == F_CF OR(xFlags, xFlags, s3); } - IFX (X_OF) { - // OF flag is affected only on 1-bit shifts - // OF flag is set to the most-significant bit of the original operand - ADDI_D(s3, xZR, 1); - BNE(s2, s3, 4 + 4 * 4); - SRLIxw(s3, s1, rex.w ? 63 : 31); - SLLI_D(s3, s3, F_OF); - OR(xFlags, xFlags, s3); - } - - SRL_D(s1, s1, s2); - + // For the SAR instruction, the OF flag is cleared for all 1-bit shifts. + // OF nop IFX (X_SF) { + // SF is the same as the original operand BGE(s1, xZR, 8); ORI(xFlags, xFlags, 1 << F_SF); } - if (!rex.w) { - ZEROUP(s1); - } + + SRA_D(s1, s1, s2); + ANDI(s1, s1, 0xff); + IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); + ST_B(s1, xEmu, offsetof(x64emu_t, res)); } IFX (X_ZF) { BNEZ(s1, 8); @@ -419,109 +527,169 @@ void emit_shr32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } -// emit SHR32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch -void emit_shr32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4) +// emit SHL8 instruction, from s1 , constant c, store result in s1 using s3, s4 as scratch +void emit_shl8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) { - IFX(X_PEND) { - if (c) { - MOV64x(s3, c); - SDxw(s3, xEmu, offsetof(x64emu_t, op2)); - } else - SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); - SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w ? d_shr64 : d_shr32); - } else IFX(X_ALL) { + if (!c) return; + IFX (X_PEND) { + MOV64x(s3, c); + ST_B(s3, xEmu, offsetof(x64emu_t, op2)); + ST_B(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, d_shl8); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (!c) { - IFX(X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); - } - return; - } - if (la64_lbt) { - IFX(X_PEND) {} else { MOV64x(s3, c); } - IFX(X_ALL) { - if (rex.w) - X64_SRL_D(s1, s3); - else - X64_SRL_W(s1, s3); - } - - SRLIxw(s1, s1, c); - - IFX(X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); - } - return; + CLEAR_FLAGS(s3); + IFX (X_OF) { + SRLI_D(s3, s1, 6); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + SLLI_D(s1, s1, c); + IFX (X_CF) { + BSTRPICK_D(s3, s1, 8, 8); + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + IFX (X_PEND) { + ST_B(s1, xEmu, offsetof(x64emu_t, res)); + } + ANDI(s1, s1, 0xff); + IFX (X_SF) { + SRLI_D(s3, s1, 7); + BSTRINS_D(xFlags, s3, F_SF, F_SF); } + IFX (X_ZF) { + SEQZ(s3, s1); + BSTRINS_D(xFlags, s3, F_ZF, F_ZF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} +// emit SHR8 instruction, from s1 , constant c, store result in s1 using s3, s4 as scratch +void emit_shr8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) +{ + if (!c) return; + IFX (X_PEND) { + MOV64x(s3, c); + ST_B(s3, xEmu, offsetof(x64emu_t, op2)); + ST_B(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, d_shr8); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } CLEAR_FLAGS(s3); - IFX(X_CF) { - if (c > 1) { - SRAI_D(s3, s1, c - 1); - ANDI(s3, s3, 1); // LSB == F_CF + IFX (X_CF) { + if (c == 1) { + BSTRINS_D(xFlags, s1, F_CF, F_CF); } else { - // no need to shift - ANDI(s3, s1, 1); // LSB == F_CF + BSTRPICK_D(s3, s1, c - 1, c - 1); + BSTRINS_D(xFlags, s3, F_CF, F_CF); } - OR(xFlags, xFlags, s3); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts - // OF flag is set to the most-significant bit of the original operand - if (c == 1) { - SRLIxw(s3, s1, rex.w ? 63 : 31); - SLLI_D(s3, s3, F_OF); - OR(xFlags, xFlags, s3); - } + IFX (X_OF) { + BSTRPICK_D(s3, s1, 7, 7); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } - if (rex.w) { - SRLI_D(s1, s1, c); - } else { - SRLI_W(s1, s1, c); - } + SRLI_D(s1, s1, c); + ANDI(s1, s1, 0xff); - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); - } - if (!rex.w) { - ZEROUP(s1); - } - IFX(X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); + IFX (X_PEND) { + ST_B(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SEQZ(s4, s1); + BSTRINS_D(xFlags, s4, F_ZF, F_ZF); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } +// emit SAR8 instruction, from s1 , constant c, store result in s1 using s3, s4 as scratch +void emit_sar8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) +{ + if (!c) return; + IFX (X_PEND) { + MOV64x(s3, c); + ST_B(s3, xEmu, offsetof(x64emu_t, op2)); + ST_B(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, d_sar8); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + CLEAR_FLAGS(s3); + IFXA (X_CF, c < 8) { + BSTRPICK_D(s3, s1, c - 1, c - 1); + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + + SRAI_D(s1, s1, c); + ANDI(s1, s1, 0xff); + IFX (X_PEND) { + ST_B(s1, xEmu, offsetof(x64emu_t, res)); + } + if (c < 8) { + IFX (X_ZF) { + SEQZ(s3, s1); + BSTRINS_D(xFlags, s3, F_ZF, F_ZF); + } + IFX (X_SF) { + SRLI_D(s3, s1, 7); + BSTRINS_D(xFlags, s3, F_SF, F_SF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + } else { + IFX (X_CF | X_ZF | X_SF | X_PF) { + SRLI_D(s3, s1, 7); + IFX (X_CF) BSTRINS_D(xFlags, s3, F_CF, F_CF); + IFX (X_SF) BSTRINS_D(xFlags, s3, F_SF, F_SF); + IFX (X_ZF) { + SEQZ(s4, s1); + BSTRINS_D(xFlags, s4, F_ZF, F_ZF); + } + IFX (X_PF) ORI(xFlags, xFlags, 1 << F_PF); + } + } + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} -// emit SAR16 instruction, from s1, shift s2 (!0 and and'd already), store result in s1 using s3, s4 and s5 as scratch -void emit_sar16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) +// emit SHR16 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3 and s4 as scratch +void emit_shr16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { int64_t j64; - IFX (X_PEND) { ST_H(s2, xEmu, offsetof(x64emu_t, op2)); ST_H(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, d_sar8); - } else IFX (X_ALL) { + SET_DF(s4, d_shr16); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (la64_lbt) { + if (cpuext.lbt) { IFX (X_ALL) { - X64_SRA_H(s1, s2); + X64_SRL_H(s1, s2); + } + + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) { + SRLI_D(s3, s1, 15 - F_OF); + BSTRINS_D(s3, xZR, F_AF, F_AF); + X64_SET_EFLAGS(s3, (X_OF | X_AF)); } SRL_D(s1, s1, s2); @@ -530,6 +698,7 @@ void emit_sar16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, IFX (X_PEND) { ST_H(s1, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } @@ -540,17 +709,17 @@ void emit_sar16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, ANDI(s3, s3, 1); // LSB == F_CF OR(xFlags, xFlags, s3); } - // For the SAR instruction, the OF flag is cleared for all 1-bit shifts. - // OF nop - IFX (X_SF) { - // SF is the same as the original operand - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_OF) { + // OF flag is set to the most-significant bit of the original operand + SRLI_D(s3, s1, 15); + SLLI_D(s3, s3, F_OF); + OR(xFlags, xFlags, s3); } SRL_D(s1, s1, s2); BSTRPICK_D(s1, s1, 15, 0); + // SF should be unset IFX (X_PEND) { ST_H(s1, xEmu, offsetof(x64emu_t, res)); } @@ -561,48 +730,44 @@ void emit_sar16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } -// emit SAR32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch -void emit_sar32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4) +// emit SHR16 instruction, from s1 , constant c, store result in s1 using s3, s4 and s5 as scratch +void emit_shr16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5) { - IFX(X_PEND) { - if (c) { - MOV64x(s3, c); - SDxw(s3, xEmu, offsetof(x64emu_t, op2)); - } else - SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); - SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w ? d_sar64 : d_sar32); - } else IFX(X_ALL) { + if (!c) return; + IFX (X_PEND) { + MOV64x(s3, c); + ST_H(s3, xEmu, offsetof(x64emu_t, op2)); + ST_H(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, d_shr16); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (!c) { - IFX(X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); - } - return; - } - if (la64_lbt) { - IFX(X_PEND) {} else { MOV64x(s3, c); } - IFX(X_ALL) { - if (rex.w) - X64_SRA_D(s1, s3); - else - X64_SRA_W(s1, s3); + if (cpuext.lbt) { + IFX (X_ALL) { + MOV64x(s3, c); + X64_SRL_H(s1, s3); } - SRAIxw(s1, s1, c); + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) { + SRLI_D(s3, s1, 15 - F_OF); + BSTRINS_D(s3, xZR, F_AF, F_AF); + X64_SET_EFLAGS(s3, (X_OF | X_AF)); + } - IFX(X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); + SRLI_D(s1, s1, c); + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } CLEAR_FLAGS(s3); - IFX(X_CF) { + IFX (X_CF) { if (c > 1) { SRAI_D(s3, s1, c - 1); ANDI(s3, s3, 1); // LSB == F_CF @@ -612,351 +777,1722 @@ void emit_sar32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, } OR(xFlags, xFlags, s3); } - - if (rex.w) { - SRAI_D(s1, s1, c); - } else { - SRAI_W(s1, s1, c); + IFX (X_OF) { + // OF flag is set to the most-significant bit of the original operand + SRLI_D(s3, s1, 15); + SLLI_D(s3, s3, F_OF); + OR(xFlags, xFlags, s3); } - // SRAI_W sign-extends, so test sign bit before clearing upper bits - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); - } - if (!rex.w) { - ZEROUP(s1); - } - IFX(X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); + SRLI_D(s1, s1, c); + + // SF should be unset + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { + IFX (X_ZF) { BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } - -// emit ROR32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch -void emit_ror32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4) +// emit SHR32 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3 and s4 as scratch +void emit_shr32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) { - if (!c) return; - + int64_t j64; IFX (X_PEND) { - MOV32w(s3, c); - SDxw(s3, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s4, rex.w ? d_ror64 : d_ror32); - } else IFX (X_ALL) { + SDxw(s2, xEmu, offsetof(x64emu_t, op2)); + SDxw(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, rex.w ? d_shr64 : d_shr32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if (!c) { - IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); - } - return; - } - if (la64_lbt) { + if (cpuext.lbt) { IFX (X_ALL) { if (rex.w) - X64_ROTRI_D(s1, c); + X64_SRL_D(s1, s2); else - X64_ROTRI_W(s1, c); + X64_SRL_W(s1, s2); } + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) { + SRLIxw(s3, s1, (rex.w ? 63 : 31) - F_OF); + BSTRINS_D(s3, xZR, F_AF, F_AF); + X64_SET_EFLAGS(s3, X_OF | X_AF); + } + SRL_D(s1, s1, s2); + if (!rex.w) ZEROUP(s1); + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; } - ROTRIxw(s1, s1, c); - - IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); - } - - if (la64_lbt) return; - CLEAR_FLAGS(s3); IFX (X_CF) { - SRLIxw(s3, s1, rex.w ? 63 : 31); + ADDI_D(s3, s2, -1); + SRA_D(s3, s1, s3); + ANDI(s3, s3, 1); // LSB == F_CF OR(xFlags, xFlags, s3); } IFX (X_OF) { - // the OF flag is set to the exclusive OR of the two most-significant bits of the result - if (c == 1) { - SRLI_D(s3, s1, rex.w ? 62 : 30); - SRLI_D(s4, s3, 1); - XOR(s3, s3, s4); - ANDI(s3, s3, 1); - SLLI_D(s3, s3, F_OF); - OR(xFlags, xFlags, s3); - } + // OF flag is set to the most-significant bit of the original operand + SRLIxw(s3, s1, rex.w ? 63 : 31); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } -} - -// emit ROL32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch -void emit_rol32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) -{ - int64_t j64; - IFX (X_PEND) { - SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s4, rex.w ? d_rol64 : d_rol32); - } else IFX (X_ALL) { - SET_DFNONE(); - } + SRL_D(s1, s1, s2); - if (la64_lbt) { - IFX (X_ALL) { - if (rex.w) - X64_ROTL_D(s1, s2); - else - X64_ROTL_W(s1, s2); - } + IFX (X_SF) { + BGE(s1, xZR, 8); + ORI(xFlags, xFlags, 1 << F_SF); } - - if (rex.w) { - ANDI(s4, s2, 0x3f); - } else { - ANDI(s4, s2, 0x1f); + if (!rex.w) { + ZEROUP(s1); } - - if (!rex.w) ZEROUP(s1); - BEQ_NEXT(s4, xZR); - - SLLxw(s3, s1, s4); - NEG_D(s4, s4); - ADDI_D(s4, s4, rex.w ? 64 : 32); - SRLxw(s1, s1, s4); - OR(s1, s3, s1); - IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - - if (la64_lbt) return; - - CLEAR_FLAGS(s3); - IFX (X_CF | X_OF) { - ANDI(s4, s1, 1); // LSB == F_CF - IFX (X_CF) OR(xFlags, xFlags, s4); + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); } - IFX (X_OF) { - // the OF flag is set to the exclusive OR of the CF bit (after the rotate) and the most-significant bit of the result. - ADDI_D(s3, xZR, 1); - BNE_NEXT(s2, s3); - SRLIxw(s3, s1, rex.w ? 63 : 31); - XOR(s3, s3, s4); // s3: MSB, s4: CF bit - SLLI_D(s3, s3, F_OF); - OR(xFlags, xFlags, s3); + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } - -// emit ROL32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch -void emit_rol32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4) +// emit SHR32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_shr32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4) { if (!c) return; - IFX (X_PEND) { - MOV32w(s3, c); - SDxw(s3, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s4, rex.w ? d_rol64 : d_rol32); - } else IFX (X_ALL) { - SET_DFNONE(); - } - if (!c) { - IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); + if (c) { + MOV64x(s3, c); + SDxw(s3, xEmu, offsetof(x64emu_t, op2)); + } else + SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); + SDxw(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, rex.w ? d_shr64 : d_shr32); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + if (cpuext.lbt) { + IFX (X_PEND) { + } else IFX (X_ALL) { + MOV64x(s3, c); + } + IFX (X_ALL) { + if (rex.w) + X64_SRL_D(s1, s3); + else + X64_SRL_W(s1, s3); + } + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) { + SRLIxw(s3, s1, (rex.w ? 63 : 31) - F_OF); + BSTRINS_D(s3, xZR, F_AF, F_AF); + X64_SET_EFLAGS(s3, X_OF | X_AF); + } + SRLIxw(s1, s1, c); // no need to zeroup on !rex.w + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } + + CLEAR_FLAGS(s3); + IFX (X_CF) { + if (c > 1) { + SRAI_D(s3, s1, c - 1); + ANDI(s3, s3, 1); // LSB == F_CF + } else { + // no need to shift + ANDI(s3, s1, 1); // LSB == F_CF + } + OR(xFlags, xFlags, s3); + } + IFX (X_OF) { + // OF flag is set to the most-significant bit of the original operand + SRLIxw(s3, s1, rex.w ? 63 : 31); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + if (rex.w) { + SRLI_D(s1, s1, c); + } else { + SRLI_W(s1, s1, c); // no need to zeroup + } + + IFX (X_SF) { + BGE(s1, xZR, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + + +// emit SAR16 instruction, from s1, shift s2 (!0 and and'd already), store result in s1 using s3, s4 and s5 as scratch +void emit_sar16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) +{ + int64_t j64; + IFX (X_PEND) { + ST_H(s2, xEmu, offsetof(x64emu_t, op2)); + ST_H(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, d_sar16); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + if (cpuext.lbt) { + IFX (X_ALL) { + X64_SRA_H(s1, s2); + } + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) X64_SET_EFLAGS(xZR, (X_AF | X_OF)); + + SRL_D(s1, s1, s2); + BSTRPICK_D(s1, s1, 15, 0); + + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } + + CLEAR_FLAGS(s3); + IFX (X_CF) { + ADDI_D(s3, s2, -1); + SRA_D(s3, s1, s3); + ANDI(s3, s3, 1); // LSB == F_CF + OR(xFlags, xFlags, s3); + } + // For the SAR instruction, the OF flag is cleared for all 1-bit shifts. + // OF nop + IFX (X_SF) { + // SF is the same as the original operand + BGE(s1, xZR, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + + SRL_D(s1, s1, s2); + BSTRPICK_D(s1, s1, 15, 0); + + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + + +// emit SAR16 instruction, from s1 , constant c, store result in s1 using s3, s4 and s5 as scratch +void emit_sar16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5) +{ + if (!c) return; + IFX (X_PEND) { + MOV64x(s3, c); + ST_H(s3, xEmu, offsetof(x64emu_t, op2)); + ST_H(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, d_sar16); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + if (cpuext.lbt) { + IFX (X_PEND) { + } else { + MOV64x(s3, c); } + IFX (X_ALL) { + X64_SRA_H(s1, s3); + } + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) X64_SET_EFLAGS(xZR, (X_AF | X_OF)); + SRLI_D(s1, s1, c); + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) { + BSTRPICK_D(s1, s1, 15, 0); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } + return; + } + + CLEAR_FLAGS(s3); + IFX (X_CF) { + if (c > 1) { + SRAI_D(s3, s1, c - 1); + ANDI(s3, s3, 1); // LSB == F_CF + } else { + // no need to shift + ANDI(s3, s1, 1); // LSB == F_CF + } + OR(xFlags, xFlags, s3); + } + // For the SAR instruction, the OF flag is cleared for all 1-bit shifts. + // OF nop + IFX (X_SF) { + // SF is the same as the original operand + BGE(s1, xZR, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + + SRLI_D(s1, s1, c); + BSTRPICK_D(s1, s1, 15, 0); + + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit SAR32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_sar32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4) +{ + IFX (X_PEND) { + if (c) { + MOV64x(s3, c); + SDxw(s3, xEmu, offsetof(x64emu_t, op2)); + } else + SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); + SDxw(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, rex.w ? d_sar64 : d_sar32); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + if (!c) { + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, res)); + } + return; + } + + if (cpuext.lbt) { + IFX (X_PEND) { + } else { + MOV64x(s3, c); + } + IFX (X_ALL) { + if (rex.w) + X64_SRA_D(s1, s3); + else + X64_SRA_W(s1, s3); + } + + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) X64_SET_EFLAGS(xZR, X_OF | X_AF); + + SRAIxw(s1, s1, c); + if (!rex.w) ZEROUP(s1); + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); return; } - if (la64_lbt) { - IFX (X_CF | X_OF) { - if (rex.w) - X64_ROTLI_D(s1, c); - else - X64_ROTLI_W(s1, c); + CLEAR_FLAGS(s3); + IFX (X_CF) { + if (c > 1) { + SRAI_D(s3, s1, c - 1); + ANDI(s3, s3, 1); // LSB == F_CF + } else { + // no need to shift + ANDI(s3, s1, 1); // LSB == F_CF + } + OR(xFlags, xFlags, s3); + } + // For the SAR instruction, the OF flag is cleared for all 1-bit shifts. + // OF nop + + if (rex.w) { + SRAI_D(s1, s1, c); + } else { + SRAI_W(s1, s1, c); + } + + // SRAI_W sign-extends, so test sign bit before clearing upper bits + IFX (X_SF) { + BGE(s1, xZR, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + if (!rex.w) { + ZEROUP(s1); + } + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +void emit_sar32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) +{ + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, op1)); + SDxw(s2, xEmu, offsetof(x64emu_t, op2)); + SET_DF(s4, rex.w ? d_sar64 : d_sar32); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + if (cpuext.lbt) { + IFX (X_ALL) { + if (rex.w) + X64_SRA_D(s1, s2); + else + X64_SRA_W(s1, s2); + } + + IFXA ((X_AF | X_OF), BOX64DRENV(dynarec_safeflags)) X64_SET_EFLAGS(xZR, X_OF | X_AF); + + SRAxw(s1, s1, s2); + if (!rex.w) ZEROUP(s1); + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } + + CLEAR_FLAGS(s3); + IFX (X_CF) { + ADDIxw(s3, s2, -1); + SRAxw(s3, s1, s3); + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + if (rex.w) + SRA_D(s1, s1, s2); + else + SRA_W(s1, s1, s2); + + IFX (X_SF) { + BGE(s1, xZR, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + if (!rex.w) ZEROUP(s1); + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + + +// emit ROR32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_ror32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4) +{ + if (!c) return; + + IFXA ((X_CF | X_OF), cpuext.lbt) { + if (rex.w) + X64_ROTRI_D(s1, c); + else + X64_ROTRI_W(s1, c); + } + + IFXA (X_CF | X_OF, !cpuext.lbt) { + MOV64x(s4, ((1UL << F_CF) | (1UL << F_OF))); + ANDN(xFlags, xFlags, s4); + } + + IFXA (X_OF, (!cpuext.lbt || BOX64DRENV(dynarec_safeflags))) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + XOR(s3, s3, s1); + if (cpuext.lbt) { + SLLI_D(s3, s3, F_OF); + X64_SET_EFLAGS(s3, X_OF); + } else + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + ROTRIxw(s1, s1, c); + if (!rex.w) ZEROUP(s1); + + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } + + IFX (X_CF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + OR(xFlags, xFlags, s3); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit ROL8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch +void emit_rol8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) +{ + RESTORE_EFLAGS(s3); + + IFX (X_OF) { + SRLI_W(s3, s1, 6); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + ADDI_D(s4, xZR, 8); + SUB_D(s4, s4, s2); + BSTRINS_D(s1, s1, 15, 8); + SRL_D(s1, s1, s4); + IFX (X_CF) { + BSTRINS_D(xFlags, s1, F_CF, F_CF); + } + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) { + ANDI(s1, s1, 0xFF); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } +} + +// emit ROL8 instruction, from s1, c, store result in s1 using s3 s4 and s5 as scratch +void emit_rol8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5) +{ + int64_t j64; + if (!c) return; + if (cpuext.lbt) { + IFX (X_CF | X_OF) X64_ROTLI_B(s1, c); + IFXA (X_OF, BOX64DRENV(dynarec_safeflags)) { + SRLI_W(s3, s1, 6); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + SLLI_D(s3, s3, F_OF); + X64_SET_EFLAGS(s3, X_OF); + } + if (c & 7) + ROTRI_B(s1, s1, 8 - (c & 7)); + + IFX (X_PEND) { + ST_B(s1, xEmu, offsetof(x64emu_t, res)); + } + + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } + + IFX (X_OF) { + SRLI_W(s3, s1, 6); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + if (c & 7) { + SLLI_D(s3, s1, (c & 7)); + SRLI_D(s1, s1, 8 - (c & 7)); + OR(s1, s3, s1); + } + + IFX (X_CF) { + BSTRINS_D(xFlags, s1, F_CF, F_CF); + } + if (dyn->insts[ninst].nat_flags_fusion) { + ANDI(s1, s1, 0xFF); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } +} + +// emit ROL16 instruction, from s1, c, store result in s1 using s3 s4 and s5 as scratch +void emit_rol16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5) +{ + if (!c) return; + RESTORE_EFLAGS(s3); + + IFXA (X_OF, c == 1) { + SRLI_D(s3, s1, 14); + SRLI_D(s4, s3, 1); + XOR(s3, s4, s3); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + if (c & 15) { + int rc = 16 - (c & 15); + if (cpuext.lbt) + ROTRI_H(s1, s1, rc); + else { + SLLI_D(s3, s1, 16); + OR(s1, s3, s1); + SRLI_D(s1, s1, rc); + } + } + + IFX (X_CF) BSTRINS_D(xFlags, s1, F_CF, F_CF); + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) { + if (!cpuext.lbt) BSTRPICK_D(s1, s1, 15, 0); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } +} + +// emit ROL32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch +void emit_rol32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) +{ + IFXA (X_CF | X_OF, !cpuext.lbt) { + MOV64x(s4, ((1UL << F_CF) | (1UL << F_OF))); + ANDN(xFlags, xFlags, s4); + } + + IFXA ((X_CF | X_OF), cpuext.lbt) { + if (rex.w) + X64_ROTL_D(s1, s2); + else + X64_ROTL_W(s1, s2); + } + + + IFXA (X_OF, (!cpuext.lbt || BOX64DRENV(dynarec_safeflags))) { + SRLIxw(s3, s1, rex.w ? 62 : 30); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + if (cpuext.lbt) { + SLLI_D(s3, s3, F_OF); + X64_SET_EFLAGS(s3, X_OF); + } else + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + MOV64x(s3, rex.w ? 64 : 32); + SUB_D(s3, s3, s2); + if (rex.w) { + ROTR_D(s1, s1, s3); + } else { + ROTR_W(s1, s1, s3); + } + if (!rex.w) ZEROUP(s1); + + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } + + IFX (X_CF) { + ANDI(s4, s1, 1); // LSB == F_CF + OR(xFlags, xFlags, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit ROR32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch +void emit_ror32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) +{ + IFXA ((X_CF | X_OF), cpuext.lbt) { + if (rex.w) + X64_ROTR_D(s1, s2); + else + X64_ROTR_W(s1, s2); + } + + IFXA (X_CF | X_OF, !cpuext.lbt) { + MOV64x(s4, ((1UL << F_CF) | (1UL << F_OF))); + ANDN(xFlags, xFlags, s4); + } + + IFXA (X_OF, (!cpuext.lbt || BOX64DRENV(dynarec_safeflags))) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + XOR(s3, s3, s1); + if (cpuext.lbt) { + SLLI_D(s3, s3, F_OF); + X64_SET_EFLAGS(s3, X_OF); + } else + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + if (rex.w) { + ROTR_D(s1, s1, s2); + } else { + ROTR_W(s1, s1, s2); + } + if (!rex.w) ZEROUP(s1); + + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } + + IFX (X_CF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + OR(xFlags, xFlags, s3); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit ROL32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_rol32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4) +{ + if (!c) return; + + IFXA (X_CF | X_OF, !cpuext.lbt) { + MOV64x(s3, ((1UL << F_CF) | (1UL << F_OF))); + ANDN(xFlags, xFlags, s3); + } + + IFXA ((X_CF | X_OF), cpuext.lbt) { + if (rex.w) + X64_ROTLI_D(s1, c); + else + X64_ROTLI_W(s1, c); + } + + IFXA (X_OF, (!cpuext.lbt || BOX64DRENV(dynarec_safeflags))) { + SRLIxw(s3, s1, rex.w ? 62 : 30); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + if (cpuext.lbt) { + SLLI_D(s3, s3, F_OF); + X64_SET_EFLAGS(s3, X_OF); + } else + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + ROTRIxw(s1, s1, (rex.w ? 64 : 32) - c); + if (!rex.w) ZEROUP(s1); + + if (cpuext.lbt) { + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); + return; + } + + IFX (X_CF) { + ANDI(s4, s1, 1 << F_CF); + OR(xFlags, xFlags, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + + +void emit_shld32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4) +{ + IFX (X_PEND) { + if (c) { + MOV64x(s3, c); + SDxw(s3, xEmu, offsetof(x64emu_t, op2)); + } else + SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); + SDxw(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, rex.w ? d_shld64 : d_shld32); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + CLEAR_FLAGS(s3); + IFX (X_CF) { + SRLI_D(s3, s1, (rex.w ? 64 : 32) - c); + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + IFX (X_OF) { + SRLIxw(s3, s1, rex.w ? 62 : 30); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + SLLIxw(s3, s1, c); + SRLIxw(s1, s2, (rex.w ? 64 : 32) - c); + OR(s1, s1, s3); + + if (!rex.w) { + ZEROUP(s1); + } + IFX (X_SF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + BEQZ(s3, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + + +// emit SHRD32 instruction, from s1, fill s2 , constant c, store result in s1 using s3 and s4 as scratch +void emit_shrd32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4) +{ + IFX (X_PEND) { + if (c) { + MOV64x(s3, c); + SDxw(s3, xEmu, offsetof(x64emu_t, op2)); + } else + SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); + SDxw(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, rex.w ? d_shrd64 : d_shrd32); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + CLEAR_FLAGS(s3); + IFX (X_CF) { + int reg; + if (c > 1) { + SRAI_D(s3, s1, c - 1); + reg = s3; + } else + reg = s1; + BSTRINS_D(xFlags, reg, F_CF, F_CF); + } + + IFX (X_OF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + XOR(s3, s3, s2); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + SRLIxw(s3, s1, c); + SLLIxw(s1, s2, (rex.w ? 64 : 32) - c); + OR(s1, s1, s3); + + if (!rex.w) { + ZEROUP(s1); + } + IFX (X_SF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + BEQZ(s3, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +void emit_shrd32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s5, int s3, int s4, int s6) +{ + int64_t j64; + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, op1)); + SDxw(s5, xEmu, offsetof(x64emu_t, op2)); + SET_DF(s4, rex.w ? d_shrd64 : d_shrd32); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + CLEAR_FLAGS(s3); + IFX (X_CF) { + ADDI_D(s3, s5, -1); + SRA_D(s3, s1, s3); + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + IFX (X_OF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + XOR(s3, s3, s2); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + ADDI_D(s4, xZR, (rex.w ? 64 : 32)); + SUB_D(s4, s4, s5); + SRLxw(s3, s1, s5); + SLLxw(s4, s2, s4); + OR(s1, s4, s3); + + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, res)); + } + if (!rex.w) { + ZEROUP(s1); + } + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_SF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + BEQZ(s3, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +void emit_shld32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s5, int s3, int s4, int s6) +{ + int64_t j64; + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, op1)); + SDxw(s5, xEmu, offsetof(x64emu_t, op2)); + SET_DF(s4, rex.w ? d_shld64 : d_shld32); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + CLEAR_FLAGS(s3); + MOV32w(s3, (rex.w ? 64 : 32)); + SUB_D(s3, s3, s5); + + IFX (X_CF) { + SRL_D(s4, s1, s3); + BSTRINS_D(xFlags, s4, F_CF, F_CF); + } + IFX (X_OF) { + SRLIxw(s6, s1, rex.w ? 62 : 30); + SRLI_D(s4, s6, 1); + XOR(s6, s6, s4); + BSTRINS_D(xFlags, s6, F_OF, F_OF); + } + SLLxw(s4, s1, s5); + SRLxw(s3, s2, s3); + OR(s1, s3, s4); + + IFX (X_PEND) { + SDxw(s1, xEmu, offsetof(x64emu_t, res)); + } + if (!rex.w) ZEROUP(s1); + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_SF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + BEQZ(s3, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit RCL8 instruction, from s1, s1, store result in s1 using s3, s4 and s5 as scratch +void emit_rcl8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) +{ + int64_t j64; + RESTORE_EFLAGS(s3); + + ADDI_D(s4, xZR, 9); + MOD_DU(s2, s2, s4); + CBZ_NEXT(s2); + + IFX (X_OF) { + SRLI_D(s3, s1, 6); + SRLI_D(s5, s3, 1); + XOR(s3, s3, s5); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + BSTRINS_D(s1, xFlags, 8, 8); // insert CF to bit 8 + BSTRINS_D(s1, s1, 16, 9); + SUB_D(s2, s4, s2); + IFX (X_CF) { + ADDI_D(s5, s2, -1); + SRL_D(s5, s1, s5); + BSTRINS_D(xFlags, s5, F_CF, F_CF); + } + SRL_D(s1, s1, s2); + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) { + ANDI(s1, s1, 0xFF); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } +} + +// emit RCL8 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_rcl8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) +{ + c %= 9; + if (!c) return; + + RESTORE_EFLAGS(s3); + + BSTRINS_D(s1, xFlags, 8, 8); // insert CF to bit 8 + IFX (X_OF | X_CF) { + BSTRPICK_D(s3, s1, 8 - c, 8 - c); + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + + IFX (X_OF) { + SRLI_D(s3, s1, 6); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + BSTRINS_D(s1, s1, 16, 9); + SRLI_D(s1, s1, 9 - c); + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) { + ANDI(s1, s1, 0xFF); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } +} + +// emit RCL16 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_rcl16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) +{ + c %= 17; + if (!c) return; + + RESTORE_EFLAGS(s3); + + BSTRINS_D(s1, xFlags, 16, 16); // insert CF to bit 16 + IFX (X_CF) { + BSTRPICK_D(s3, s1, 16 - c, 16 - c); + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + + IFX (X_OF) { + SRLI_D(s3, s1, 14); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + BSTRINS_D(s1, s1, 32, 17); + SRLI_D(s1, s1, 17 - c); + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit RCL32 instruction, from s1, s2, store result in s1 using s3, s4 and s5 as scratch +void emit_rcl32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) +{ + RESTORE_EFLAGS(s3); + IFX (X_CF) { + ADDI_D(s4, xZR, rex.w ? 64 : 32); + SUB_D(s4, s4, s2); + SRL_D(s3, s1, s4); + } + IFX (X_OF) { + SRLI_D(s4, s1, rex.w ? 62 : 30); + SRLI_D(s5, s4, 1); + XOR(s4, s5, s4); + BSTRINS_D(xFlags, s4, F_OF, F_OF); + } + MV(s4, xFlags); + BSTRINS_D(s4, s1, rex.w ? 63 : 31, 1); + ADDI_D(s5, s2, -1); + BEQZ(s5, 4 + 4 * 5); // goto label + SLL_D(s4, s4, s5); + ADDI_D(s5, xZR, rex.w ? 65 : 33); + SUB_D(s2, s5, s2); + if (rex.w) + SRL_D(s1, s1, s2); + else + SRL_W(s1, s1, s2); + OR(s4, s1, s4); + // label + if (rex.w) + MV(s1, s4); + else + ZEROUP2(s1, s4); + + IFX (X_CF) { + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit RCL32 instruction, from s1 , constant c, store result in s1 using s3, s4 and s5 as scratch +void emit_rcl32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4, int s5) +{ + if (!c) return; + + RESTORE_EFLAGS(s3); + IFX (X_CF) { + SRLI_D(s3, s1, (rex.w ? 64 : 32) - c); + } + + IFX (X_OF) { + SRLI_D(s4, s1, rex.w ? 62 : 30); + SRLI_D(s5, s4, 1); + XOR(s4, s5, s4); + BSTRINS_D(xFlags, s4, F_OF, F_OF); + } + if (c == 1) { + SLLI_D(s1, s1, 1); + BSTRINS_D(s1, xFlags, 0, 0); + } else { + SLLI_D(s4, s1, c); + BSTRINS_D(s4, xFlags, c - 1, c - 1); + if (rex.w) + SRLI_D(s5, s1, 65 - c); + else + SRLI_W(s5, s1, 33 - c); + OR(s1, s5, s4); + } + if (!rex.w) ZEROUP(s1); + + IFX (X_CF) { + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit RCR8 instruction, from s1, s2, store result in s1 using s3, s4 and s5 as scratch +void emit_rcr8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) +{ + + int64_t j64; + RESTORE_EFLAGS(s3); + + ADDI_D(s4, xZR, 9); + MOD_DU(s2, s2, s4); + CBZ_NEXT(s2); + + BSTRINS_D(s1, xFlags, 8, 8); // insert CF to bit 8 + BSTRINS_D(s1, s1, 16, 9); + + IFX (X_OF) { + SRLI_D(s3, s1, 7); + XOR(s3, s3, xFlags); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + IFX (X_CF) { + ADDI_D(s4, s2, -1); + SRL_D(s4, s1, s4); + BSTRINS_D(xFlags, s4, F_CF, F_CF); + } + SRL_D(s1, s1, s2); + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) { + ANDI(s1, s1, 0xFF); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } +} + +// emit RCR8 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_rcr8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) +{ + c %= 9; + if (!c) return; + + RESTORE_EFLAGS(s3); + IFX (X_OF) { + SRLI_D(s3, s1, 7); + XOR(s3, s3, xFlags); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + if (c) { + BSTRINS_D(s1, xFlags, 8, 8); // insert CF to bit 8 + IFX (X_CF) { + BSTRPICK_D(s3, s1, c - 1, c - 1); + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + if (c > 1) { + BSTRINS_D(s1, s1, 16, 9); + } + SRLI_D(s1, s1, c); + } + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) { + ANDI(s1, s1, 0xFF); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } +} + +// emit RCR16 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_rcr16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) +{ + c %= 17; + if (!c) return; + + RESTORE_EFLAGS(s3); + IFX (X_OF) { + SRLI_D(s3, s1, 15); + XOR(s3, s3, xFlags); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + if (c) { + BSTRINS_D(s1, xFlags, 16, 16); // insert CF to bit 16 + IFX (X_CF) { + BSTRPICK_D(s3, s1, c - 1, c - 1); + BSTRINS_D(xFlags, s3, F_CF, F_CF); } + if (c > 1) BSTRINS_D(s1, s1, 32, 17); + SRLI_D(s1, s1, c); } - ROTRIxw(s1, s1, (rex.w ? 64 : 32) - c); + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit RCR32 instruction, from s1, s2, store result in s1 using s3, s4 and s5 as scratch +void emit_rcr32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) +{ + RESTORE_EFLAGS(s3); + + IFX (X_OF) { + SRLI_D(s3, s1, rex.w ? 63 : 31); + XOR(s3, s3, xFlags); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + ADDI_D(s5, s2, -1); + IFX (X_CF) SRL_D(s3, s1, s5); // for later + + SRLI_D(s4, s1, 1); + BSTRINS_D(s4, xFlags, rex.w ? 63 : 31, rex.w ? 63 : 31); // insert cf + BEQZ(s5, 4 + 4 * 5); // goto label + SRL_D(s4, s4, s5); + ADDI_D(s5, xZR, rex.w ? 65 : 33); + SUB_D(s2, s5, s2); + if (rex.w) + SLL_D(s1, s1, s2); + else + SLL_W(s1, s1, s2); + OR(s4, s1, s4); + // label + if (rex.w) + MV(s1, s4); + else + ZEROUP2(s1, s4); + + IFX (X_CF) BSTRINS_D(xFlags, s3, F_CF, F_CF); + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} +// emit RCR32 instruction, from s1 , constant c, store result in s1 using s3, s4 and s5 as scratch +void emit_rcr32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4, int s5) +{ + if (!c) return; + + RESTORE_EFLAGS(s3); + IFX (X_OF) { + SRLI_D(s3, s1, rex.w ? 63 : 31); + XOR(s3, s3, xFlags); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + IFX (X_CF) BSTRPICK_D(s5, s1, c - 1, c - 1); + if (c == 1) { + SRLI_D(s1, s1, 1); + BSTRINS_D(s1, xFlags, rex.w ? 63 : 31, rex.w ? 63 : 31); + } else { + SRLIxw(s4, s1, c); + BSTRINS_D(s4, xFlags, (rex.w ? 64 : 32) - c, (rex.w ? 64 : 32) - c); + SLLI_D(s3, s1, (rex.w ? 65 : 33) - c); + OR(s1, s3, s4); + } if (!rex.w) ZEROUP(s1); - IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); + IFX (X_CF) { + BSTRINS_D(xFlags, s5, F_CF, F_CF); } - if (la64_lbt) return; + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} - IFX (X_CF | X_OF) { - MOV64x(s3, (1UL << F_CF | 1UL << F_OF)); - ANDN(xFlags, xFlags, s3); +// emit ROR8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch +void emit_ror8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) +{ + RESTORE_EFLAGS(s3); + + IFX (X_OF) { + SRLI_D(s3, s1, 7); + XOR(s3, s1, s3); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } - IFX (X_CF | X_OF) { - ANDI(s4, s1, 1 << F_CF); - IFX (X_CF) OR(xFlags, xFlags, s4); + + BSTRINS_D(s1, s1, 15, 8); + SRL_D(s1, s1, s2); + + IFX (X_CF) { + SRLI_D(s3, s1, 7); + BSTRINS_D(xFlags, s3, F_CF, F_CF); } - IFX (X_OF) { - // the OF flag is set to the exclusive OR of the CF bit (after the rotate) and the most-significant bit of the result. - if (c == 1) { - SRLIxw(s3, s1, rex.w ? 63 : 31); - XOR(s3, s3, s4); - SLLI_D(s3, s3, F_OF); - OR(xFlags, xFlags, s3); - } + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) { + ANDI(s1, s1, 0xFF); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); } } +// emit ROR8 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_ror8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) +{ + if (!c) return; + RESTORE_EFLAGS(s3); -void emit_shld32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4) + IFX (X_OF) { + SRLI_D(s3, s1, 7); + XOR(s3, s1, s3); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + if (c & 7) { + BSTRINS_D(s1, s1, 15, 8); + SRLI_D(s1, s1, c & 7); + } + IFX (X_CF) { + SRLI_D(s3, s1, 7); + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) { + ANDI(s1, s1, 0xFF); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } +} + +// emit ROR16 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_ror16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) { - c &= (rex.w ? 0x3f : 0x1f); + if (!c) return; + RESTORE_EFLAGS(s3); + IFXA (X_OF, (c == 1)) { + SRLI_D(s3, s1, 15); + XOR(s3, s3, s1); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + if (c & 15) { + if (cpuext.lbt) { + ROTRI_H(s1, s1, (c & 15)); + } else { + SRLI_D(s3, s1, c & 15); + SLLI_D(s1, s1, 16 - (c & 15)); + OR(s1, s1, s3); + BSTRPICK_D(s1, s1, 15, 0); + } + } + + IFX (X_CF) { + SRLI_D(s3, s1, 15); + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} +void emit_shld16c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5) +{ + c &= 0x1f; IFX (X_PEND) { if (c) { MOV64x(s3, c); - SDxw(s3, xEmu, offsetof(x64emu_t, op2)); + ST_H(s3, xEmu, offsetof(x64emu_t, op2)); } else - SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); - SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w ? d_shld64 : d_shld32); - } else IFX (X_ALL) { + ST_H(xZR, xEmu, offsetof(x64emu_t, op2)); + ST_H(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, d_shld16); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } if (!c) { IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); + ST_H(s1, xEmu, offsetof(x64emu_t, res)); } return; } CLEAR_FLAGS(s3); - IFX (X_CF) { - if (c > 0) { - SRLI_D(s3, s1, (rex.w ? 64 : 32) - c); - ANDI(s4, s3, 1); // F_CF - OR(xFlags, xFlags, s4); - } - } IFX (X_OF) { - // Store sign for later use. - if (c == 1) SRLIxw(s4, s1, rex.w ? 63 : 31); + SRLI_D(s3, s1, 14); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } - SLLIxw(s3, s1, c); - SRLIxw(s1, s2, (rex.w ? 64 : 32) - c); + // create concat first + SLLI_D(s5, s2, 16); + OR(s1, s1, s5); + + IFX (X_CF) { + if (c <= 16) { + SRLI_D(s3, s1, 16 - c); + } else { + SRLI_D(s3, s2, 32 - c); + } + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + SLLI_D(s3, s1, c); + SRLI_D(s1, s1, 32 - c); OR(s1, s1, s3); + BSTRPICK_D(s1, s1, 15, 0); - if (!rex.w) { - ZEROUP(s1); + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); } IFX (X_SF) { - SRLIxw(s3, s1, rex.w ? 63 : 31); - BEQZ(s3, 8); + SLLI_W(s4, s1, 16); + BGE(s4, xZR, 8); ORI(xFlags, xFlags, 1 << F_SF); } - IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); - } IFX (X_ZF) { BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } - IFX (X_OF) { - // the OF flag is set if a sign change occurred - if (c == 1) { - SRLIxw(s3, s1, rex.w ? 63 : 31); - XOR(s3, s3, s4); - SLLI_D(s3, s3, F_OF); - ORI(xFlags, xFlags, s3); - } - } IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } - IFXA (X_ALL, la64_lbt) { - SPILL_EFLAGS(); - } + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } -// emit SHRD32 instruction, from s1, fill s2 , constant c, store result in s1 using s3 and s4 as scratch -void emit_shrd32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4) +void emit_shrd16c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5) { - c &= (rex.w ? 0x3f : 0x1f); + c &= 0x1f; IFX (X_PEND) { if (c) { MOV64x(s3, c); - SDxw(s3, xEmu, offsetof(x64emu_t, op2)); + ST_H(s3, xEmu, offsetof(x64emu_t, op2)); } else - SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); - SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w ? d_shrd64 : d_shrd32); - } else IFX (X_ALL) { + ST_H(xZR, xEmu, offsetof(x64emu_t, op2)); + ST_H(s1, xEmu, offsetof(x64emu_t, op1)); + SET_DF(s4, d_shrd16); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } if (!c) { IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); + ST_H(s1, xEmu, offsetof(x64emu_t, res)); } return; } + CLEAR_FLAGS(s3); + IFX (X_OF) { + SRLI_D(s3, s1, 15); + XOR(s3, s3, s2); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + // create concat first + SLLI_D(s5, s2, 16); + OR(s1, s1, s5); - CLEAR_FLAGS(s3); IFX (X_CF) { if (c > 1) { SRAI_D(s3, s1, c - 1); - ANDI(s3, s3, 1); // LSB == F_CF + BSTRINS_D(xFlags, s3, F_CF, F_CF); } else { - ANDI(s3, s1, 1); // LSB == F_CF + BSTRINS_D(xFlags, s1, F_CF, F_CF); } - OR(xFlags, xFlags, s3); } + + SRLI_D(s5, s1, c); + SLLI_D(s1, s1, 32 - c); + OR(s1, s1, s5); + BSTRPICK_D(s1, s1, 15, 0); + + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_SF) { + SLLI_W(s4, s1, 16); + BGE(s4, xZR, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + + +void emit_shld16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6) +{ + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, op1)); + ST_H(s3, xEmu, offsetof(x64emu_t, op2)); + SET_DF(s4, d_shld16); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + CLEAR_FLAGS(s6); IFX (X_OF) { - // Store sign for later use. - if (c == 1) SRLIxw(s4, s1, rex.w ? 63 : 31); + SRLI_D(s5, s1, 14); + SRLI_D(s4, s5, 1); + XOR(s5, s5, s4); + ANDI(s5, s5, 1); + SLLI_D(s5, s5, F_OF); + OR(xFlags, xFlags, s5); } - SRLIxw(s3, s1, c); - SLLIxw(s1, s2, (rex.w ? 64 : 32) - c); - OR(s1, s1, s3); + MOV32w(s6, 32); + SUB_W(s6, s6, s3); + IFX (X_CF) { + SLLI_D(s5, s1, 16); + OR(s4, s2, s5); + SRL_W(s5, s4, s6); + ANDI(s5, s5, 1); // LSB == F_CF + OR(xFlags, xFlags, s5); + } + // create concat first + SLLI_D(s5, s2, 16); + OR(s1, s1, s5); - if (!rex.w) { - ZEROUP(s1); + SLL_W(s5, s1, s3); + SRL_W(s1, s1, s6); + OR(s1, s1, s5); + BSTRPICK_D(s1, s1, 15, 0); + + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); } IFX (X_SF) { - SRLIxw(s3, s1, rex.w ? 63 : 31); - BEQZ(s3, 8); + SLLI_W(s4, s1, 16); + BGE(s4, xZR, 8); ORI(xFlags, xFlags, 1 << F_SF); } + IFX (X_ZF) { + BNEZ(s1, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s4, s5); + } + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +void emit_shrd16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6) +{ IFX (X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); + ST_H(s1, xEmu, offsetof(x64emu_t, op1)); + ST_H(s3, xEmu, offsetof(x64emu_t, op2)); + SET_DF(s4, d_shrd16); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + CLEAR_FLAGS(s6); + SLLI_D(s5, s2, 16); + OR(s1, s1, s5); + IFX (X_OF) { + SRLI_D(s5, s1, 15); + XOR(s5, s5, s2); + ANDI(s5, s5, 1); + SLLI_D(s5, s5, F_OF); + OR(xFlags, xFlags, s5); + } + + IFX (X_CF) { + ADDI_W(s5, s3, -1); + SRL_W(s5, s1, s5); + ANDI(s5, s5, 1); // LSB == F_CF + OR(xFlags, xFlags, s5); + } + + MOV32w(s6, 32); + SUB_W(s6, s6, s3); + SRL_W(s5, s1, s3); + SLL_W(s1, s1, s6); + OR(s1, s1, s5); + BSTRPICK_D(s1, s1, 15, 0); + + IFX (X_PEND) { + ST_H(s1, xEmu, offsetof(x64emu_t, res)); } IFX (X_ZF) { BNEZ(s1, 8); ORI(xFlags, xFlags, 1 << F_ZF); } - IFX (X_OF) { - // the OF flag is set if a sign change occurred - if (c == 1) { - SRLI_D(s3, s1, rex.w ? 63 : 31); - XOR(s3, s3, s4); - SLLI_D(s3, s3, F_OF); - OR(xFlags, xFlags, s3); - } + IFX (X_SF) { + SLLI_W(s4, s1, 16); + BGE(s4, xZR, 8); + ORI(xFlags, xFlags, 1 << F_SF); } IFX (X_PF) { - emit_pf(dyn, ninst, s1, s3, s4); + emit_pf(dyn, ninst, s1, s4, s5); + } + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit ROL16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch +void emit_rol16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) +{ + RESTORE_EFLAGS(s3); + + ANDI(s2, s2, 0xf); + IFX (X_OF) { + SRLI_W(s3, s1, 14); + SRLI_D(s4, s3, 1); + XOR(s3, s3, s4); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + ADDI_D(s4, xZR, 16); + SUB_D(s4, s4, s2); + BSTRINS_D(s1, s1, 31, 16); + SRL_D(s1, s1, s4); + IFX (X_CF) { + BSTRINS_D(xFlags, s1, F_CF, F_CF); + } + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) { + BSTRPICK_D(s1, s1, 15, 0); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } +} + +// emit ROR16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch +void emit_ror16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4) +{ + RESTORE_EFLAGS(s3); + + ANDI(s2, s2, 0xf); + IFX (X_OF) { + SRLI_D(s3, s1, 15); + XOR(s3, s1, s3); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + BSTRINS_D(s1, s1, 31, 16); + SRL_D(s1, s1, s2); + + IFX (X_CF) { + SRLI_D(s3, s1, 15); + BSTRINS_D(xFlags, s3, F_CF, F_CF); + } + + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) { + BSTRPICK_D(s1, s1, 15, 0); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } +} + +// emit RCL16 instruction, from s1, s1, store result in s1 using s3, s4 and s5 as scratch +void emit_rcl16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) +{ + int64_t j64; + RESTORE_EFLAGS(s3); + + ADDI_D(s4, xZR, 17); + MOD_DU(s2, s2, s4); + CBZ_NEXT(s2); + + IFX (X_OF) { + SRLI_D(s3, s1, 14); + SRLI_D(s5, s3, 1); + XOR(s3, s3, s5); + BSTRINS_D(xFlags, s3, F_OF, F_OF); + } + + BSTRINS_D(s1, xFlags, 16, 16); // insert CF to bit 16 + BSTRINS_D(s1, s1, 32, 17); + SUB_D(s2, s4, s2); + IFX (X_CF) { + ADDI_D(s5, s2, -1); + SRL_D(s5, s1, s5); + BSTRINS_D(xFlags, s5, F_CF, F_CF); + } + SRL_D(s1, s1, s2); + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) { + BSTRPICK_D(s1, s1, 15, 0); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } +} + +// emit RCR16 instruction, from s1, s2, store result in s1 using s3, s4 and s5 as scratch +void emit_rcr16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) +{ + + int64_t j64; + RESTORE_EFLAGS(s3); + + ADDI_D(s4, xZR, 17); + MOD_DU(s2, s2, s4); + CBZ_NEXT(s2); + + BSTRINS_D(s1, xFlags, 16, 16); // insert CF to bit 16 + BSTRINS_D(s1, s1, 32, 17); + + IFX (X_OF) { + SRLI_D(s3, s1, 15); + XOR(s3, s3, xFlags); + BSTRINS_D(xFlags, s3, F_OF, F_OF); } + IFX (X_CF) { + ADDI_D(s4, s2, -1); + SRL_D(s4, s1, s4); + BSTRINS_D(xFlags, s4, F_CF, F_CF); + } + SRL_D(s1, s1, s2); - IFXA (X_ALL, la64_lbt) { - SPILL_EFLAGS(); + IFXA (X_ALL, cpuext.lbt) SPILL_EFLAGS(); + if (dyn->insts[ninst].nat_flags_fusion) { + BSTRPICK_D(s1, s1, 15, 0); + NAT_FLAGS_OPS(s1, xZR, s3, xZR); } } diff --git a/src/dynarec/la64/dynarec_la64_emit_tests.c b/src/dynarec/la64/dynarec_la64_emit_tests.c index 2e65ca0..49440e1 100644 --- a/src/dynarec/la64/dynarec_la64_emit_tests.c +++ b/src/dynarec/la64/dynarec_la64_emit_tests.c @@ -5,10 +5,9 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" +#include "la64_emitter.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,7 +18,7 @@ #include "la64_printer.h" #include "dynarec_la64_private.h" #include "dynarec_la64_functions.h" -#include "dynarec_la64_helper.h" +#include "../dynarec_helper.h" // emit CMP8 instruction, from cmp s1, s2, using s3, s4, s5 and s6 as scratch @@ -33,7 +32,9 @@ void emit_cmp8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i SET_DFNONE(); } - if (la64_lbt) { + NAT_FLAGS_ENABLE_CARRY(); + NAT_FLAGS_ENABLE_SIGN(); + if (cpuext.lbt) { IFX(X_ALL) { X64_SUB_B(s1, s2); } @@ -42,6 +43,15 @@ void emit_cmp8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i SUB_D(s6, s1, s2); ST_B(s6, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_B(s3, s1); + EXT_W_B(s4, s2); + NAT_FLAGS_OPS(s3, s4, s5, xZR); + } else { + NAT_FLAGS_OPS(s1, s2, s3, xZR); + } + } return; } @@ -70,6 +80,15 @@ void emit_cmp8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i IFX(X_PF) { emit_pf(dyn, ninst, s6, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_B(s3, s1); + EXT_W_B(s4, s2); + NAT_FLAGS_OPS(s3, s4, s5, xZR); + } else { + NAT_FLAGS_OPS(s1, s2, s3, xZR); + } + } } // emit CMP8 instruction, from cmp s1 , 0, using s3 and s4 as scratch @@ -84,10 +103,20 @@ void emit_cmp8_0(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4) SET_DFNONE(); } - if (la64_lbt) { + NAT_FLAGS_ENABLE_CARRY(); + NAT_FLAGS_ENABLE_SIGN(); + if (cpuext.lbt) { IFX(X_ALL) { X64_SUB_B(s1, xZR); } + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_B(s3, s1); + NAT_FLAGS_OPS(s3, xZR, s4, xZR); + } else { + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } + } return; } @@ -104,6 +133,14 @@ void emit_cmp8_0(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4) IFX(X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_B(s3, s1); + NAT_FLAGS_OPS(s3, xZR, s4, xZR); + } else { + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } + } } // emit CMP16 instruction, from cmp s1, s2, using s3 and s4 as scratch @@ -117,7 +154,9 @@ void emit_cmp16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, SET_DFNONE(); } - if (la64_lbt) { + NAT_FLAGS_ENABLE_CARRY(); + NAT_FLAGS_ENABLE_SIGN(); + if (cpuext.lbt) { IFX(X_ALL) { X64_SUB_H(s1, s2); } @@ -126,6 +165,15 @@ void emit_cmp16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, SUB_D(s6, s1, s2); ST_H(s6, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_H(s3, s1); + EXT_W_H(s4, s2); + NAT_FLAGS_OPS(s3, s4, s5, xZR); + } else { + NAT_FLAGS_OPS(s1, s2, s3, xZR); + } + } return; } @@ -156,6 +204,15 @@ void emit_cmp16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, IFX(X_PF) { emit_pf(dyn, ninst, s6, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_H(s3, s1); + EXT_W_H(s4, s2); + NAT_FLAGS_OPS(s3, s4, s5, xZR); + } else { + NAT_FLAGS_OPS(s1, s2, s3, xZR); + } + } } // emit CMP16 instruction, from cmp s1 , #0, using s3 and s4 as scratch @@ -170,10 +227,20 @@ void emit_cmp16_0(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4) SET_DFNONE(); } - if (la64_lbt) { + NAT_FLAGS_ENABLE_CARRY(); + NAT_FLAGS_ENABLE_SIGN(); + if (cpuext.lbt) { IFX(X_ALL) { X64_SUB_H(s1, xZR); } + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_H(s3, s1); + NAT_FLAGS_OPS(s3, xZR, s4, xZR); + } else { + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } + } return; } @@ -190,6 +257,14 @@ void emit_cmp16_0(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4) IFX(X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_H(s3, s1); + NAT_FLAGS_OPS(s3, xZR, s4, xZR); + } else { + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } + } } // emit CMP32 instruction, from cmp s1, s2, using s3 and s4 as scratch @@ -203,7 +278,9 @@ void emit_cmp32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s SET_DFNONE(); } - if (la64_lbt) { + NAT_FLAGS_ENABLE_CARRY(); + NAT_FLAGS_ENABLE_SIGN(); + if (cpuext.lbt) { IFX(X_ALL) { if (rex.w) X64_SUB_D(s1, s2); @@ -215,6 +292,20 @@ void emit_cmp32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s SUBxw(s6, s1, s2); SDxw(s6, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) { + if (rex.w) + NAT_FLAGS_OPS(s1, s2, s3, s4); + else { + if (dyn->insts[ninst].nat_flags_needsign) { + SEXT_W(s3, s1); + SEXT_W(s4, s2); + } else { + ZEROUP2(s3, s1); + ZEROUP2(s4, s2); + } + NAT_FLAGS_OPS(s3, s4, s5, xZR); + } + } return; } @@ -244,10 +335,24 @@ void emit_cmp32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s IFX(X_PF) { emit_pf(dyn, ninst, s6, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) { + if (rex.w) + NAT_FLAGS_OPS(s1, s2, s3, s4); + else { + if (dyn->insts[ninst].nat_flags_needsign) { + SEXT_W(s3, s1); + SEXT_W(s4, s2); + } else { + ZEROUP2(s3, s1); + ZEROUP2(s4, s2); + } + NAT_FLAGS_OPS(s3, s4, s5, xZR); + } + } } // emit CMP32 instruction, from cmp s1, 0, using s3 and s4 as scratch -void emit_cmp32_0(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4) +void emit_cmp32_0(dynarec_la64_t* dyn, int ninst, rex_t rex, uint8_t nextop, int s1, int s3, int s4, int s5) { IFX_PENDOR0 { ST_D(s1, xEmu, offsetof(x64emu_t, op1)); @@ -258,13 +363,30 @@ void emit_cmp32_0(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s3, int SET_DFNONE(); } - if (la64_lbt) { + NAT_FLAGS_ENABLE_CARRY(); + NAT_FLAGS_ENABLE_SIGN(); + if (cpuext.lbt) { IFX(X_ALL) { if (rex.w) X64_SUB_D(s1, xZR); else X64_SUB_W(s1, xZR); } + if (dyn->insts[ninst].nat_flags_fusion) { + if (rex.w) + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + else { + if (dyn->insts[ninst].nat_flags_needsign) { + SEXT_W(s3, s1); + NAT_FLAGS_OPS(s3, xZR, s4, xZR); + } else if (MODREG) { + ZEROUP2(s3, s1); + NAT_FLAGS_OPS(s3, xZR, s4, xZR); + } else { + NAT_FLAGS_OPS(s1, xZR, s4, xZR); + } + } + } return; } @@ -278,12 +400,34 @@ void emit_cmp32_0(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s3, int } ORI(xFlags, xFlags, 1 << F_SF); } + int res = s1; + IFX (X_ZF | X_PF) { + if (!rex.w && MODREG) { + ZEROUP2(s5, s1); + res = s5; + } + } IFX(X_ZF) { - BNEZ(s1, 8); + BNEZ(res, 8); ORI(xFlags, xFlags, 1 << F_ZF); } IFX(X_PF) { - emit_pf(dyn, ninst, s1, s3, s4); + emit_pf(dyn, ninst, res, s3, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) { + if (rex.w) + NAT_FLAGS_OPS(s1, xZR, s4, xZR); + else { + if (dyn->insts[ninst].nat_flags_needsign) { + SEXT_W(s3, s1); + NAT_FLAGS_OPS(s3, xZR, s4, xZR); + } else if (res == s5) { // zero-up'd case + NAT_FLAGS_OPS(res, xZR, s4, xZR); + } else { + ZEROUP2(s3, s1); + NAT_FLAGS_OPS(s3, xZR, s4, xZR); + } + } } } @@ -297,14 +441,37 @@ void emit_test8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, SET_DFNONE(); } - if (la64_lbt) { + NAT_FLAGS_ENABLE_SIGN(); + if (cpuext.lbt) { IFX(X_ALL) { X64_AND_B(s1, s2); } + if (s1 == s2) { + NAT_FLAGS_ENABLE_SF(); + int r = s1; + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_B(s3, s1); + r = s3; + } + NAT_FLAGS_OPS(r, xZR, s5, xZR); + } + IFX_PENDOR0 { + ST_B(r, xEmu, offsetof(x64emu_t, res)); + } + } else { + if (dyn->insts[ninst].nat_flags_fusion) { + AND(s3, s1, s2); + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_B(s3, s3); + } + } - IFX_PENDOR0 { - AND(s3, s1, s2); - ST_D(s3, xEmu, offsetof(x64emu_t, res)); + IFX_PENDOR0 { + if (!dyn->insts[ninst].nat_flags_fusion) AND(s3, s1, s2); + ST_B(s3, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, s4, xZR); } return; } @@ -327,6 +494,66 @@ void emit_test8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, IFX(X_PF) { emit_pf(dyn, ninst, s3, s4, s5); } + if (dyn->insts[ninst].nat_flags_fusion && dyn->insts[ninst].nat_flags_needsign) { + EXT_W_B(s3, s3); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, s4, xZR); +} + +// emit TEST8 instruction, from test s1, c, using s3, s4 and s5 as scratch +void emit_test8c(dynarec_la64_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4, int s5) +{ + IFX_PENDOR0 { + SET_DF(s3, d_tst8); + } else { + SET_DFNONE(); + } + + NAT_FLAGS_ENABLE_SIGN(); + + if (cpuext.lbt) { + IFX (X_ALL) { + ADDI_D(s3, xZR, c); + X64_AND_B(s1, s3); + } + + if (dyn->insts[ninst].nat_flags_fusion) { + ANDI(s3, s1, c); + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_B(s3, s3); + } + } + + IFX_PENDOR0 { + if (!dyn->insts[ninst].nat_flags_fusion) ANDI(s3, s1, c); + ST_B(s3, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, xZR, xZR); + return; + } + + CLEAR_FLAGS(s3); + ANDI(s3, s1, c); // res = s1 & c + + IFX_PENDOR0 { + ST_D(s3, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_SF) { + SRLI_D(s4, s3, 7); + BEQZ(s4, 8); + ORI(xFlags, xFlags, 1 << F_SF); + } + IFX (X_ZF) { + BNEZ(s3, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s3, s4, s5); + } + if (dyn->insts[ninst].nat_flags_fusion && dyn->insts[ninst].nat_flags_needsign) { + EXT_W_B(s3, s3); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, xZR, xZR); } // emit TEST16 instruction, from test s1, s2, using s3, s4 and s5 as scratch @@ -338,14 +565,38 @@ void emit_test16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, SET_DFNONE(); } - if (la64_lbt) { + NAT_FLAGS_ENABLE_SIGN(); + if (cpuext.lbt) { IFX (X_ALL) { X64_AND_H(s1, s2); } - IFX_PENDOR0 { - AND(s3, s1, s2); - ST_H(s3, xEmu, offsetof(x64emu_t, res)); + if (s1 == s2) { + NAT_FLAGS_ENABLE_SF(); + int r = s1; + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_H(s3, s1); + r = s3; + } + NAT_FLAGS_OPS(r, xZR, s5, xZR); + } + IFX_PENDOR0 { + ST_H(r, xEmu, offsetof(x64emu_t, res)); + } + } else { + if (dyn->insts[ninst].nat_flags_fusion) { + AND(s3, s1, s2); + if (dyn->insts[ninst].nat_flags_needsign) { + EXT_W_H(s3, s3); + } + } + + IFX_PENDOR0 { + if (!dyn->insts[ninst].nat_flags_fusion) AND(s3, s1, s2); + ST_H(s3, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, xZR, xZR); } return; } @@ -368,6 +619,10 @@ void emit_test16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, IFX (X_PF) { emit_pf(dyn, ninst, s3, s4, s5); } + if (dyn->insts[ninst].nat_flags_fusion && dyn->insts[ninst].nat_flags_needsign) { + EXT_W_H(s3, s3); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, xZR, xZR); } // emit TEST32 instruction, from test s1, s2, using s3 and s4 as scratch @@ -379,7 +634,8 @@ void emit_test32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int SET_DFNONE(); } - if (la64_lbt) { + NAT_FLAGS_ENABLE_SIGN(); + if (cpuext.lbt) { IFX(X_ALL) { if (rex.w) X64_AND_D(s1, s2); @@ -387,10 +643,39 @@ void emit_test32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int X64_AND_W(s1, s2); } - IFX_PENDOR0 { - AND(s3, s1, s2); - SDxw(s3, xEmu, offsetof(x64emu_t, res)); + if (s1 == s2) { + NAT_FLAGS_ENABLE_SF(); + int r = s1; + if (dyn->insts[ninst].nat_flags_fusion) { + if (!rex.w) { + if (dyn->insts[ninst].nat_flags_needsign) + SEXT_W(s3, s1); + else + ZEROUP2(s3, s1); + r = s3; + } + NAT_FLAGS_OPS(r, xZR, s5, xZR); + } + IFX_PENDOR0 { + SDxw(r, xEmu, offsetof(x64emu_t, res)); + } + } else { + if (dyn->insts[ninst].nat_flags_fusion) { + AND(s3, s1, s2); + if (dyn->insts[ninst].nat_flags_needsign) { + if (!rex.w) SEXT_W(s3, s3); + } else if (!rex.w) { + ZEROUP(s3); + } + } + + IFX_PENDOR0 { + if (!dyn->insts[ninst].nat_flags_fusion) AND(s3, s1, s2); + SDxw(s3, xEmu, offsetof(x64emu_t, res)); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, xZR, xZR); } + return; } @@ -415,6 +700,14 @@ void emit_test32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int IFX(X_PF) { emit_pf(dyn, ninst, s3, s4, s5); } + if (dyn->insts[ninst].nat_flags_fusion && !rex.w) { + if (dyn->insts[ninst].nat_flags_needsign) { + SEXT_W(s3, s3); + } else { + ZEROUP(s3); + } + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, xZR, xZR); } // emit TEST32 instruction, from test s1, s2, using s3 and s4 as scratch @@ -426,8 +719,8 @@ void emit_test32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, SET_DFNONE(); } - - if (la64_lbt) { + NAT_FLAGS_ENABLE_SIGN(); + if (cpuext.lbt) { IFX(X_ALL) { MOV64xw(s3, c); if (rex.w) @@ -436,15 +729,26 @@ void emit_test32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, X64_AND_W(s1, s3); } - IFX_PENDOR0 { - if (c >= 0 && c <= 4095) { - ANDI(s3, s1, c); - } else { - IFX(X_ALL) { } else MOV64xw(s3, c); - AND(s3, s1, s3); + if (c >= 0 && c <= 4095) { + ANDI(s3, s1, c); + } else { + IFX (X_ALL) { + } else + MOV64xw(s3, c); + AND(s3, s1, s3); + } + if (dyn->insts[ninst].nat_flags_fusion && !rex.w) { + if (dyn->insts[ninst].nat_flags_needsign) { + SEXT_W(s3, s3); + } else if (((uint64_t)c >> 32) != 0) { + ZEROUP(s3); } + } + + IFX_PENDOR0 { SDxw(s3, xEmu, offsetof(x64emu_t, res)); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, xZR, xZR); return; } @@ -452,7 +756,7 @@ void emit_test32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, if (c >= 0 && c <= 4095) { ANDI(s3, s1, c); } else { - IFXA(X_ALL, la64_lbt) { } else MOV64xw(s3, c); + IFXA(X_ALL, cpuext.lbt) { } else MOV64xw(s3, c); AND(s3, s1, s3); } @@ -471,4 +775,12 @@ void emit_test32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, IFX(X_PF) { emit_pf(dyn, ninst, s3, s4, s5); } + if (dyn->insts[ninst].nat_flags_fusion && !rex.w) { + if (dyn->insts[ninst].nat_flags_needsign) { + SEXT_W(s3, s3); + } else if (((uint64_t)c >> 32) != 0) { + ZEROUP(s3); + } + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, xZR, xZR); } diff --git a/src/dynarec/la64/dynarec_la64_f0.c b/src/dynarec/la64/dynarec_la64_f0.c index d1b0810..1c42671 100644 --- a/src/dynarec/la64/dynarec_la64_f0.c +++ b/src/dynarec/la64/dynarec_la64_f0.c @@ -5,11 +5,10 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "la64_emitter.h" -#include "x64run.h" +#include "la64_mapping.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,14 +18,13 @@ #include "la64_printer.h" #include "dynarec_la64_private.h" -#include "dynarec_la64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_la64_functions.h" -uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { (void)ip; - (void)rep; (void)need_epilog; uint8_t opcode = F8; @@ -45,59 +43,253 @@ uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MAYUSE(wb2); MAYUSE(j64); - while ((opcode == 0xF2) || (opcode == 0xF3)) { - rep = opcode - 0xF1; - opcode = F8; - } - - GETREX(); - switch (opcode) { + case 0x00: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK ADD Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGB(x7); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (cpuext.lam_bh) { + AMADD_DB_B(x1, gd, wback); + } else { + LOCK_8_OP(ADD_D(x4, x1, gd), x1, wback, x3, x4, x5, x6); + } + IFXORNAT (X_ALL | X_PEND) { + emit_add8(dyn, ninst, x1, gd, x3, x4); + } + } + break; case 0x01: - INST_NAME("LOCK ADD Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; - SMDMB(); - if ((nextop & 0xC0) == 0xC0) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - emit_add32(dyn, ninst, rex, ed, gd, x3, x4, x5); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK ADD Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LLxw(x1, wback, 0); - ADDxw(x4, x1, gd); - SCxw(x4, wback, 0); - BEQZ_MARKLOCK(x4); - IFX (X_ALL | X_PEND) { + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMADD_DB_D(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMADD_DB_W(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(ADD_W(x4, x1, gd), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(ADDxw(x4, x1, gd), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) { emit_add32(dyn, ninst, rex, x1, gd, x3, x4, x5); } } - SMDMB(); + break; + case 0x08: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK OR Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGB(x7); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + ANDI(x3, wback, 0b11); + SLLI_W(x3, x3, 3); + MV(x6, wback); + BSTRINS_D(x6, xZR, 1, 0); // aligned to 4-byte + SLL_W(x4, gd, x3); // shift GETGB's BSTRPICK result to pos + AMOR_DB_W(x1, x4, x6); + IFXORNAT (X_ALL | X_PEND) { + SRL_W(x1, x1, x3); + BSTRPICK_D(x1, x1, 7, 0); + emit_or8(dyn, ninst, x1, gd, x3, x4); + } + } + break; + case 0x09: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK OR Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMOR_DB_D(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMOR_DB_W(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(OR(x4, x1, gd), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(OR(x4, x1, gd), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) + emit_or32(dyn, ninst, rex, x1, gd, x3, x4); + } break; case 0x0F: nextop = F8; switch (nextop) { + case 0xAB: + if (MODREG) { + INST_NAME("Invalid LOCK BTS"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTS Ed, Gd"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (rex.w) { + SRAI_D(x1, gd, 3); + } else { + SRAI_W(x1, gd, 3); + } + if (!rex.w && !rex.is32bits) { ADDI_W(x1, x1, 0); } + ADDy(x6, wback, x1); + ANDI(x2, gd, 7); + ANDI(x4, x6, 0b11); + ALSL_D(x2, x4, x2, 3); + BSTRINS_D(x6, xZR, 1, 0); + + ADDI_D(x5, xZR, 1); + SLL_D(x5, x5, x2); + AMOR_DB_W(x4, x5, x6); + IFX (X_CF) { + SRL_D(x4, x4, x2); + if (cpuext.lbt) { + X64_SET_EFLAGS(x4, X_CF); + } else { + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + } + } + break; + case 0xB0: + switch (rex.rep) { + case 0: + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK CMPXCHG Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + nextop = F8; + ANDI(x6, xRAX, 0xff); // AL + if (rex.rex) { + gb1 = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); + gb2 = 0; + } else { + gd = (nextop & 0x38) >> 3; + gb2 = ((gd & 4) >> 2) * 8; + gb1 = TO_NAT(gd & 3); + } + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, LOCK_LOCK, 0, 0); + ANDI(x5, wback, 0b11); + SLLI_D(x5, x5, 3); // shamt + MARKLOCK; + ADDI_D(x7, xZR, ~0b11); + AND(x7, wback, x7); // align to 32bit + LL_W(x4, x7, 0); + MV(x1, x4); + SRL_D(x4, x4, x5); + ANDI(x4, x4, 0xff); + BNE_MARK(x6, x4); // compare AL with m8 + // AL == m8, r8 is loaded into m8 + ADDI_D(x2, xZR, 0xff); + SLL_D(x2, x2, x5); + NOR(x2, x2, xZR); + AND(x2, x1, x2); + BSTRPICK_D(x1, gb1, gb2 + 7, gb2); + SLL_D(x1, x1, x5); + OR(x1, x1, x2); + SC_W(x1, x7, 0); + BEQZ_MARKLOCK(x1); + // done + MARK; + UFLAG_IF { emit_cmp8(dyn, ninst, x6, x4, x1, x2, x3, x5); } + BSTRINS_D(xRAX, x4, 7, 0); + } + break; + default: + DEFAULT; + } + break; case 0xB1: - switch (rep) { + switch (rex.rep) { case 0: - INST_NAME("LOCK CMPXCHG Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - wback = 0; - UFLAG_IF { emit_cmp32(dyn, ninst, rex, xRAX, ed, x3, x4, x5, x6); } - MV(x1, ed); // save value - SUB_D(x2, x1, xRAX); - BNE_MARK2(x2, xZR); - MV(ed, gd); - MARK2; - MVxw(xRAX, x1); + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - SMDMB(); + INST_NAME("LOCK CMPXCHG Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + UFLAG_IF { MVxw(x6, xRAX); } ANDI(x1, wback, (1 << (rex.w + 2)) - 1); BNEZ_MARK3(x1); // Aligned @@ -105,28 +297,179 @@ uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MV(x4, gd); LLxw(x1, wback, 0); SUBxw(x3, x1, xRAX); - BNEZ_MARK(x3); + BNEZ(x3, 4 + (rex.w ? 8 : 12)); // EAX == Ed SCxw(x4, wback, 0); BEQZ_MARKLOCK(x4); + if (!rex.w) { B_MARK_nocond; } + MVxw(xRAX, x1); B_MARK_nocond; MARK3; // Unaligned ADDI_D(x5, xZR, -(1 << (rex.w + 2))); AND(x5, x5, wback); - MARK2; + MARKLOCK2; LDxw(x1, wback, 0); - LLxw(x6, x5, 0); + LLxw(x7, x5, 0); SUBxw(x3, x1, xRAX); - BNEZ_MARK(x3); + BNEZ(x3, 4 + (rex.w ? 12 : 16)); // EAX == Ed - SCxw(x6, x5, 0); - BEQZ_MARK2(x6); + SCxw(x7, x5, 0); + BEQZ_MARKLOCK2(x7); SDxw(gd, wback, 0); - MARK; - UFLAG_IF { emit_cmp32(dyn, ninst, rex, xRAX, x1, x3, x4, x5, x6); } + if (!rex.w) { B_MARK_nocond; } MVxw(xRAX, x1); - SMDMB(); + MARK; + UFLAG_IF { emit_cmp32(dyn, ninst, rex, x6, x1, x3, x4, x5, x7); } + } + break; + default: + DEFAULT; + } + break; + case 0xB3: + if (MODREG) { + INST_NAME("Invalid LOCK BTR"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTR Ed, Gd"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (rex.w) { + SRAI_D(x1, gd, 3); + } else { + SRAI_W(x1, gd, 3); + } + if (!rex.w && !rex.is32bits) { ADDI_W(x1, x1, 0); } + ADDy(x6, wback, x1); + ANDI(x2, gd, 7); + + ANDI(x4, x6, 0b11); + ALSL_D(x2, x4, x2, 3); + BSTRINS_D(x6, xZR, 1, 0); + + ADDI_D(x5, xZR, 1); + SLL_D(x5, x5, x2); + NOR(x5, x5, xZR); + AMAND_DB_W(x4, x5, x6); + IFX (X_CF) { + SRL_D(x4, x4, x2); + if (cpuext.lbt) { + X64_SET_EFLAGS(x4, X_CF); + } else { + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + } + } + break; + case 0xBA: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 4: + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + break; + case 5: + if (MODREG) { + INST_NAME("Invalid LOCK BTS"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTS Ed, Ib"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 0, 1); + u8 = F8; + u8 &= (rex.w ? 0x3f : 0x1f); + ADDI_D(x6, wback, u8 >> 3); + MOV64x(x2, u8 & 7); + ANDI(x4, x6, 0b11); + ALSL_D(x2, x4, x2, 3); + BSTRINS_D(x6, xZR, 1, 0); + + ADDI_D(x5, xZR, 1); + SLL_D(x5, x5, x2); + AMOR_DB_W(x4, x5, x6); + IFX (X_CF) { + SRL_D(x4, x4, x2); + if (cpuext.lbt) { + X64_SET_EFLAGS(x4, X_CF); + } else { + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + } + } + break; + case 6: + if (MODREG) { + INST_NAME("Invalid LOCK BTR"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTR Ed, Ib"); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 0, 1); + u8 = F8; + u8 &= (rex.w ? 0x3f : 0x1f); + ADDI_D(x6, wback, u8 >> 3); + MOV64x(x2, u8 & 7); + ANDI(x4, x6, 0b11); + ALSL_D(x2, x4, x2, 3); + BSTRINS_D(x6, xZR, 1, 0); + + ADDI_D(x5, xZR, 1); + SLL_D(x5, x5, x2); + NOR(x5, x5, xZR); + AMAND_DB_W(x4, x5, x6); + IFX (X_CF) { + SRL_D(x4, x4, x2); + if (cpuext.lbt) { + X64_SET_EFLAGS(x4, X_CF); + } else { + BSTRINS_D(xFlags, x4, F_CF, F_CF); + } + } + } + break; + default: + DEFAULT; + } + break; + case 0xC0: + switch (rex.rep) { + case 0: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK XADD Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGB(x7); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (cpuext.lam_bh) { + AMADD_DB_B(x1, gd, wback); + } else { + LOCK_8_OP(ADD_D(x4, gd, x1), x1, wback, x3, x4, x5, x6); + } + IFXORNAT (X_ALL | X_PEND) { + ANDI(x6, x1, 0xff); + emit_add8(dyn, ninst, x6, gd, x3, x4); + } + BSTRINSz(gb1, x1, gb2 + 7, gb2); } break; default: @@ -134,57 +477,85 @@ uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } break; case 0xC1: - switch (rep) { + switch (rex.rep) { case 0: - INST_NAME("LOCK XADD Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; - SMDMB(); if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - MVxw(x1, ed); - MVxw(ed, gd); - MVxw(gd, x1); - emit_add32(dyn, ninst, rex, ed, gd, x3, x4, x5); + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK XADD Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LLxw(x1, wback, 0); - ADDxw(x4, x1, gd); - SCxw(x4, wback, 0); - BEQZ_MARKLOCK(x4); - IFX(X_ALL | X_PEND) { + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMADD_DB_D(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMADD_DB_W(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(ADD_W(x4, x1, gd), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(ADDxw(x4, x1, gd), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) { MVxw(x2, x1); emit_add32(dyn, ninst, rex, x2, gd, x3, x4, x5); } MVxw(gd, x1); } - SMDMB(); break; default: DEFAULT; } break; case 0xC7: - switch (rep) { - case 0: + // rep has no impact here + nextop = F8; + switch ((nextop >> 3) & 7) { + case 1: if (rex.w) { INST_NAME("LOCK CMPXCHG16B Gq, Eq"); + if (!cpuext.scq) { + static int warned = 0; + PASS3(if (!warned) dynarec_log(LOG_INFO, "Warning, LOCK CMPXCHG16B is not well supported on LoongArch without SCQ and issues are expected.\n")); + warned = 1; + } } else { INST_NAME("LOCK CMPXCHG8B Gq, Eq"); } - SETFLAGS(X_ZF, SF_SUBSET); - nextop = F8; + SETFLAGS(X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, LOCK_LOCK, 0, 0); - if (la64_lbt) { - X64_SET_EFLAGS(xZR, X_ZF); - } else { - ADDI_D(x2, xZR, ~(1 << F_ZF)); - AND(xFlags, xFlags, x2); + UFLAG_IF { + if (cpuext.lbt) { + X64_SET_EFLAGS(xZR, X_ZF); + } else { + BSTRINS_D(xFlags, xZR, F_ZF, F_ZF); + } } if (rex.w) { - if (la64_scq) { + if (cpuext.scq) { MARKLOCK; LL_D(x2, wback, 0); LD_D(x3, wback, 8); @@ -194,18 +565,19 @@ uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MV(x5, xRBX); SC_Q(x5, xRCX, wback); BEQZ_MARKLOCK(x5); - if (la64_lbt) { - ADDI_D(x5, xZR, -1); - X64_SET_EFLAGS(x5, X_ZF); - } else { - ORI(xFlags, xFlags, 1 << F_ZF); + UFLAG_IF { + if (cpuext.lbt) { + ADDI_D(x5, xZR, -1); + X64_SET_EFLAGS(x5, X_ZF); + } else { + ORI(xFlags, xFlags, 1 << F_ZF); + } } B_MARK3_nocond; MARK; MV(xRAX, x2); MV(xRDX, x3); MARK3; - SMDMB(); } else { // if scq extension is not available, implement it with mutex LD_D(x6, xEmu, offsetof(x64emu_t, context)); @@ -222,11 +594,13 @@ uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni BNE_MARK(x3, xRDX); ST_D(xRBX, wback, 0); ST_D(xRCX, wback, 8); - if (la64_lbt) { - ADDI_D(x5, xZR, -1); - X64_SET_EFLAGS(x5, X_ZF); - } else { - ORI(xFlags, xFlags, 1 << F_ZF); + UFLAG_IF { + if (cpuext.lbt) { + ADDI_D(x5, xZR, -1); + X64_SET_EFLAGS(x5, X_ZF); + } else { + ORI(xFlags, xFlags, 1 << F_ZF); + } } B_MARK3_nocond; MARK; @@ -238,31 +612,52 @@ uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni AMSWAP_DB_W(xZR, xZR, x6); } } else { - SMDMB(); - AND(x3, xRAX, xMASK); - SLLI_D(x2, xRDX, 32); - OR(x3, x3, x2); - AND(x4, xRBX, xMASK); - SLLI_D(x2, xRCX, 32); - OR(x4, x4, x2); + BSTRINS_D(x3, xRAX, 31, 0); + BSTRINS_D(x3, xRDX, 63, 32); + BSTRINS_D(x4, xRBX, 31, 0); + BSTRINS_D(x4, xRCX, 63, 32); + ANDI(x2, wback, 7); + BNEZ_MARK2(x2); + // Aligned MARKLOCK; LL_D(x2, wback, 0); BNE_MARK(x2, x3); // EDX_EAX != Ed MV(x5, x4); SC_D(x5, wback, 0); BEQZ_MARKLOCK(x5); - if (la64_lbt) { - ADDI_D(x5, xZR, -1); - X64_SET_EFLAGS(x5, X_ZF); - } else { - ORI(xFlags, xFlags, 1 << F_ZF); + UFLAG_IF { + if (cpuext.lbt) { + ADDI_D(x5, xZR, -1); + X64_SET_EFLAGS(x5, X_ZF); + } else { + ORI(xFlags, xFlags, 1 << F_ZF); + } + } + B_MARK3_nocond; + MARK2; + // Unaligned + ADDI_W(x5, xZR, 0xFF8); + AND(x5, wback, x5); + MARKLOCK2; + LD_D(x2, wback, 0); + LL_D(x6, x5, 0); + BNE_MARK(x2, x3); // EDX_EAX != Ed + SC_D(x6, x5, 0); + BEQZ_MARKLOCK2(x6); + ST_D(x4, wback, 0); + UFLAG_IF { + if (cpuext.lbt) { + ADDI_D(x5, xZR, -1); + X64_SET_EFLAGS(x5, X_ZF); + } else { + ORI(xFlags, xFlags, 1 << F_ZF); + } } B_MARK3_nocond; MARK; - SLLI_D(xRDX, x2, 32); - AND(xRAX, x2, xMASK); + SRLI_D(xRDX, x2, 32); + ZEROUP2(xRAX, x2); MARK3; - SMDMB(); } break; default: @@ -273,142 +668,729 @@ uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni DEFAULT; } break; + case 0x11: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK ADC Ed, Gd"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (cpuext.lbt) { + X64_GET_EFLAGS(x7, X_CF); + } else { + BSTRPICK_D(x7, xFlags, F_CF, F_CF); + } + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + ADD_D(x7, gd, x7); + AMADD_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + ADD_W(x7, gd, x7); + AMADD_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + ADD_W(x7, gd, x7); + LOCK_32_IN_8BYTE(ADD_W(x4, x1, x7), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + ADDxw(x7, gd, x7); + LOCK_3264_CROSS_8BYTE(ADDxw(x4, x1, x7), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) { + emit_adc32(dyn, ninst, rex, x1, gd, x3, x4, x5, x6); + } + } + break; + case 0x19: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK SBB Ed, Gd"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (cpuext.lbt) { + X64_GET_EFLAGS(x6, X_CF); + } else { + BSTRPICK_D(x6, xFlags, F_CF, F_CF); + } + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + SUB_D(x7, xZR, gd); + SUB_D(x7, x7, x6); + AMADD_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + SUB_W(x7, xZR, gd); + SUB_W(x7, x7, x6); + AMADD_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + SUB_W(x7, xZR, gd); + SUB_W(x7, x7, x6); + LOCK_32_IN_8BYTE(ADD_W(x4, x1, x7), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + SUBxw(x7, xZR, gd); + SUBxw(x7, x7, x6); + LOCK_3264_CROSS_8BYTE(ADDxw(x4, x1, x7), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) { + emit_sbb32(dyn, ninst, rex, x1, gd, x3, x4, x5); + } + } + break; + case 0x20: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK AND Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGB(x7); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + ANDI(x3, wback, 0b11); + SLLI_W(x3, x3, 3); + MV(x6, wback); + BSTRINS_D(x6, xZR, 1, 0); + SLL_W(x4, gd, x3); + ADDI_D(x5, xZR, 0xFF); + SLL_W(x5, x5, x3); + ORN(x4, x4, x5); + AMAND_DB_W(x1, x4, x6); + IFXORNAT (X_ALL | X_PEND) { + SRL_W(x1, x1, x3); + BSTRPICK_D(x1, x1, 7, 0); + emit_and8(dyn, ninst, x1, gd, x3, x4); + } + } + break; + case 0x21: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK AND Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMAND_DB_D(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMAND_DB_W(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(AND(x4, x1, gd), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(AND(x4, x1, gd), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) + emit_and32(dyn, ninst, rex, x1, gd, x3, x4); + } + break; case 0x29: - INST_NAME("LOCK SUB Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; - SMDMB(); if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - emit_sub32(dyn, ninst, rex, ed, gd, x3, x4, x5); + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK SUB Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LLxw(x1, wback, 0); - SUB_D(x4, x1, gd); - SCxw(x4, wback, 0); - BEQZ_MARKLOCK(x4); - IFX (X_ALL | X_PEND) + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + NEG_D(x7, gd); + AMADD_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + NEGxw(x7, gd); + AMADD_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(SUB_W(x4, x1, gd), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(SUBxw(x4, x1, gd), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) emit_sub32(dyn, ninst, rex, x1, gd, x3, x4, x5); } - SMDMB(); break; - case 0x81: - case 0x83: + case 0x31: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK XOR Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMXOR_DB_D(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMXOR_DB_W(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(XOR(x4, x1, gd), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(XOR(x4, x1, gd), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) + emit_xor32(dyn, ninst, rex, x1, gd, x3, x4); + } + break; + + case 0x80: nextop = F8; - SMDMB(); switch ((nextop >> 3) & 7) { - case 0: // ADD - if (opcode == 0x81) { - INST_NAME("LOCK ADD Ed, Id"); + case 1: // OR + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - INST_NAME("LOCK ADD Ed, Ib"); + INST_NAME("LOCK OR Eb, Ib"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x5, x1, &fixedaddress, rex, LOCK_LOCK, 0, 1); + u8 = F8; + ANDI(x2, wback, 3); + SLLI_D(x2, x2, 3); // offset in bits + MV(x3, wback); // aligned addr + BSTRINS_D(x3, xZR, 1, 0); + ADDI_D(x1, xZR, u8); + SLL_D(x1, x1, x2); // Ib << offset + AMOR_DB_W(x4, x1, x3); + IFXORNAT (X_ALL | X_PEND) { + SRL_D(x1, x4, x2); + ANDI(x1, x1, 0xFF); + emit_or8c(dyn, ninst, x1, u8, x2, x4, x5); + } } - SETFLAGS(X_ALL, SF_SET_PENDING); + break; + case 4: // AND if (MODREG) { - if (opcode == 0x81) - i64 = F32S; - else - i64 = F8S; - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6); + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK AND Eb, Ib"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x5, x1, &fixedaddress, rex, LOCK_LOCK, 0, 1); + u8 = F8; + ANDI(x2, wback, 3); + SLLI_D(x2, x2, 3); + MV(x3, wback); + BSTRINS_D(x3, xZR, 1, 0); + ADDI_D(x1, xZR, u8); + SLL_D(x1, x1, x2); + AMAND_DB_W(x4, x1, x3); + IFXORNAT (X_ALL | X_PEND) { + SRL_D(x1, x4, x2); + ANDI(x1, x1, 0xFF); + emit_and8c(dyn, ninst, x1, u8, x2, x4); + } + } + break; + default: + DEFAULT; + } + break; + case 0x81: + case 0x83: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 0: + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + if (opcode == 0x81) { + INST_NAME("LOCK ADD Ed, Id"); + } else { + INST_NAME("LOCK ADD Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); if (opcode == 0x81) i64 = F32S; else i64 = F8S; - if (i64 < -2048 || i64 >= 2048) { - MOV64xw(x3, i64); - } - MARKLOCK; - LLxw(x1, wback, 0); - if (i64 >= -2048 && i64 < 2048) { - ADDIxw(x4, x1, i64); + MOV64xw(x7, i64); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMADD_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } } else { - ADDxw(x4, x1, x3); + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMADD_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(ADD_W(x4, x1, x7), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } } - SCxw(x4, wback, 0); - BEQZ_MARKLOCK(x4); - IFX(X_ALL | X_PEND) { + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(ADDxw(x4, x1, x7), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) { emit_add32c(dyn, ninst, rex, x1, i64, x3, x4, x5, x6); } - SMDMB(); } break; - case 1: // OR - if (opcode == 0x81) { - INST_NAME("LOCK OR Ed, Id"); + case 1: + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - INST_NAME("LOCK OR Ed, Ib"); + if (opcode == 0x81) { + INST_NAME("LOCK OR Ed, Id"); + } else { + INST_NAME("LOCK OR Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) { + i64 = F32S; + } else { + i64 = F8S; + } + MOV64xw(x7, i64); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMOR_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMOR_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(OR(x4, x1, x7), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(OR(x4, x1, x7), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) + emit_or32c(dyn, ninst, rex, x1, i64, x3, x4); } - SETFLAGS(X_ALL, SF_SET_PENDING); + break; + case 2: if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + if (opcode == 0x81) { + INST_NAME("LOCK ADC Ed, Id"); + } else { + INST_NAME("LOCK ADC Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); + if (cpuext.lbt) { + X64_GET_EFLAGS(x6, X_CF); + } else { + BSTRPICK_D(x6, xFlags, F_CF, F_CF); + } if (opcode == 0x81) i64 = F32S; else i64 = F8S; - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - emit_or32c(dyn, ninst, rex, ed, i64, x3, x4); + MOV64xw(x7, i64); + ADDxw(x7, x7, x6); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMADD_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMADD_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(ADD_W(x4, x1, x7), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(ADDxw(x4, x1, x7), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) { + MOV64xw(x7, i64); + emit_adc32(dyn, ninst, rex, x1, x7, x3, x4, x5, x6); + } + } + break; + case 3: + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); if (opcode == 0x81) { - i64 = F32S; + INST_NAME("LOCK SBB Ed, Id"); } else { - i64 = F8S; + INST_NAME("LOCK SBB Ed, Ib"); } - if (i64 <= -2048 || i64 > 2048) { - MOV64xw(x3, i64); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); + if (cpuext.lbt) { + X64_GET_EFLAGS(x6, X_CF); + } else { + BSTRPICK_D(x6, xFlags, F_CF, F_CF); } - MARKLOCK; - LLxw(x1, wback, 0); - if (i64 >= -2048 && i64 < 2048) { - ORI(x4, x1, i64); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; + MOV64xw(x7, -i64); + SUBxw(x7, x7, x6); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMADD_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } } else { - OR(x4, x1, x3); + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMADD_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(ADD_W(x4, x1, x7), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(ADDxw(x4, x1, x7), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) { + MOV64xw(x7, i64); + emit_sbb32(dyn, ninst, rex, x1, x7, x3, x4, x5); } - if (!rex.w) ZEROUP(x4); - SCxw(x4, wback, 0); - BEQZ_MARKLOCK(x4); - IFX (X_ALL | X_PEND) - emit_or32c(dyn, ninst, rex, x1, i64, x3, x4); } break; - case 5: // SUB - if (opcode == 0x81) { - INST_NAME("LOCK SUB Ed, Id"); + case 4: + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - INST_NAME("LOCK SUB Ed, Ib"); + if (opcode == 0x81) { + INST_NAME("LOCK AND Ed, Id"); + } else { + INST_NAME("LOCK AND Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; + MOV64xw(x7, i64); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMAND_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMAND_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(AND(x4, x1, x7), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(AND(x4, x1, x7), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) + emit_and32c(dyn, ninst, rex, x1, i64, x3, x4); } - SETFLAGS(X_ALL, SF_SET_PENDING); + break; + case 5: if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + if (opcode == 0x81) { + INST_NAME("LOCK SUB Ed, Id"); + } else { + INST_NAME("LOCK SUB Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); if (opcode == 0x81) i64 = F32S; else i64 = F8S; - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - emit_sub32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6); + MOV64xw(x7, -i64); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMADD_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMADD_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(ADD_W(x4, x1, x7), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(ADDxw(x4, x1, x7), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) + emit_sub32c(dyn, ninst, rex, x1, i64, x3, x4, x5, x6); + } + break; + case 6: + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + if (opcode == 0x81) { + INST_NAME("LOCK XOR Ed, Id"); + } else { + INST_NAME("LOCK XOR Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); if (opcode == 0x81) i64 = F32S; else i64 = F8S; - if (i64 <= -2048 || i64 > 2048) { - MOV64xw(x3, i64); - } - MARKLOCK; - LLxw(x1, wback, 0); - if (i64 > -2048 && i64 <= 2048) { - ADDIxw(x4, x1, -i64); + MOV64xw(x7, i64); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMXOR_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; }; } else { - SUBxw(x4, x1, x3); + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMXOR_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(XOR(x4, x1, x7), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } } - SCxw(x4, wback, 0); - BEQZ_MARKLOCK(x4); - IFX (X_ALL | X_PEND) - emit_sub32c(dyn, ninst, rex, x1, i64, x3, x4, x5, x6); + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(XOR(x4, x1, x7), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) + emit_xor32c(dyn, ninst, rex, x1, i64, x3, x4); } break; default: @@ -416,25 +1398,209 @@ uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } break; case 0x87: - INST_NAME("LOCK XCHG Ed, Gd"); nextop = F8; if (MODREG) { - GETGD; - GETED(0); - MV(x1, gd); - MV(gd, ed); - MV(ed, x1); + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - SMDMB(); + INST_NAME("LOCK XCHG Ed, Gd"); GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LLxw(x1, wback, 0); - MV(x4, gd); - SCxw(x4, wback, 0); - BEQZ_MARKLOCK(x4); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMSWAP_DB_D(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMSWAP_DB_W(x1, gd, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(ADDI_W(x4, gd, 0), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(ADDI_D(x4, gd, 0), x1, wback, x4, x5, x6); + MARK3; + } MVxw(gd, x1); - SMDMB(); + } + break; + case 0xF7: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK NOT Ed"); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + MOV64xw(x7, -1); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + AMXOR_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + AMXOR_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(XOR(x4, x1, x7), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(XOR(x4, x1, x7), x1, wback, x4, x5, x6); + MARK3; + } + } + break; + case 3: + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK NEG Ed"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + if (cpuext.lamcas) { + LD_D(x5, wback, 0); + SUB_D(x4, xZR, x5); + MV(x6, x5); + AMCAS_DB_D(x5, x4, wback); + BNE(x6, x5, -4 * 3); + } else { + LL_D(x1, wback, 0); + SUB_D(x4, xZR, x1); + SC_D(x4, wback, 0); + BEQZ(x4, -4 * 3); + } + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + if (cpuext.lamcas) { + LD_WU(x5, wback, 0); + SUB_W(x4, xZR, x5); + MV(x6, x5); + AMCAS_DB_W(x5, x4, wback); + BNE(x6, x5, -4 * 3); + } else { + LL_W(x1, wback, 0); + SUB_W(x4, xZR, x1); + SC_W(x4, wback, 0); + BEQZ(x4, -4 * 3); + } + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(SUB_W(x4, xZR, x1), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(SUBxw(x4, xZR, x1), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) { + emit_neg32(dyn, ninst, rex, x1, x3, x4); + } + } + break; + default: + DEFAULT; + } + break; + case 0xFE: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 0: // INC Eb + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK INC Eb"); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + MOV64x(x7, 1); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (cpuext.lam_bh) { + AMADD_DB_B(x1, x7, wback); + } else { + LOCK_8_OP(ADD_D(x4, x1, x7), x1, wback, x3, x4, x5, x6); + } + IFXORNAT (X_ALL | X_PEND) { + emit_inc8(dyn, ninst, x1, x3, x4, x5); + } + } + break; + case 1: // DEC Eb + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK DEC Eb"); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + MOV64x(x7, -1); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (cpuext.lam_bh) { + AMADD_DB_B(x1, x7, wback); + } else { + LOCK_8_OP(ADD_D(x4, x1, x7), x1, wback, x3, x4, x5, x6); + } + IFXORNAT (X_ALL | X_PEND) { + emit_dec8(dyn, ninst, x1, x3, x4, x5); + } + } + break; + default: + DEFAULT; } break; case 0xFF: @@ -442,38 +1608,92 @@ uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni switch ((nextop >> 3) & 7) { case 0: - INST_NAME("LOCK INC Ed"); - SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING); - SMDMB(); if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - emit_inc32(dyn, ninst, rex, ed, x3, x4, x5, x6); + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK INC Ed"); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LLxw(x1, wback, 0); - ADDIxw(x4, x1, 1); - SCxw(x4, wback, 0); - BEQZ_MARKLOCK(x4); - IFX (X_ALL | X_PEND) + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + MOV32w(x7, 1); + AMADD_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + MOV32w(x7, 1); + AMADD_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(ADDI_W(x4, x1, 1), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(ADDIxw(x4, x1, 1), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) emit_inc32(dyn, ninst, rex, x1, x3, x4, x5, x6); } break; case 1: - INST_NAME("LOCK DEC Ed"); - SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING); - SMDMB(); if (MODREG) { - ed = TO_LA64((nextop & 7) + (rex.b << 3)); - emit_dec32(dyn, ninst, rex, ed, x3, x4, x5, x6); + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK DEC Ed"); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET, NAT_FLAGS_FUSION); addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LLxw(x1, wback, 0); - ADDIxw(x4, x1, -1); - SCxw(x4, wback, 0); - BEQZ_MARKLOCK(x4); - IFX (X_ALL | X_PEND) + if (rex.w) { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b111); + BNEZ_MARK2(x3); + } + MOV64xw(x7, -1); + AMADD_DB_D(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { B_MARK3_nocond; } + } else { + if (!ALIGNED_ATOMICxw) { + ANDI(x3, wback, 0b11); + BNEZ_MARK(x3); + } + // aligned 4byte + MOV64xw(x7, -1); + AMADD_DB_W(x1, x7, wback); + if (!ALIGNED_ATOMICxw) { + B_MARK3_nocond; + MARK; + ANDI(x3, wback, 0b111); + SLTI(x4, x3, 4); + BEQZ_MARK2(x4); // addr %8 >4 , cross 8bytes or cross cacheline + LOCK_32_IN_8BYTE(ADDI_W(x4, x1, -1), x1, wback, x3, x4, x5, x6); + B_MARK3_nocond; + } + } + if (!ALIGNED_ATOMICxw) { + MARK2; + LOCK_3264_CROSS_8BYTE(ADDIxw(x4, x1, -1), x1, wback, x4, x5, x6); + MARK3; + } + IFXORNAT (X_ALL | X_PEND) emit_dec32(dyn, ninst, rex, x1, x3, x4, x5, x6); } break; diff --git a/src/dynarec/la64/dynarec_la64_f20f.c b/src/dynarec/la64/dynarec_la64_f20f.c index ab6bcc1..35eb262 100644 --- a/src/dynarec/la64/dynarec_la64_f20f.c +++ b/src/dynarec/la64/dynarec_la64_f20f.c @@ -5,11 +5,9 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "la64_emitter.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -20,11 +18,12 @@ #include "la64_printer.h" #include "dynarec_la64_private.h" #include "dynarec_la64_functions.h" -#include "dynarec_la64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)need_epilog; + (void)ip; + (void)need_epilog; uint8_t opcode = F8; uint8_t nextop; @@ -44,12 +43,12 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int MAYUSE(v0); MAYUSE(v1); - switch(opcode) { + switch (opcode) { case 0x10: INST_NAME("MOVSD Gx, Ex"); nextop = F8; GETG; - if(MODREG) { + if (MODREG) { ed = (nextop & 7) + (rex.b << 3); v0 = sse_get_reg(dyn, ninst, x1, gd, 1); v1 = sse_get_reg(dyn, ninst, x1, ed, 0); @@ -68,7 +67,7 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETG; v0 = sse_get_reg(dyn, ninst, x1, gd, 0); - if(MODREG) { + if (MODREG) { ed = (nextop & 7) + (rex.b << 3); d0 = sse_get_reg(dyn, ninst, x1, ed, 0); VEXTRINS_D(d0, v0, 0); // d0[63:0] = v0[63:0] @@ -78,6 +77,21 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int SMWRITE2(); } break; + case 0x12: + INST_NAME("MOVDDUP Gx, Ex"); + nextop = F8; + GETG; + if (MODREG) { + d0 = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0); + v0 = sse_get_reg_empty(dyn, ninst, x1, gd); + VREPLVE_D(v0, d0, xZR); + } else { + SMREAD(); + v0 = sse_get_reg_empty(dyn, ninst, x1, gd); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + VLDREPL_D(v0, ed, 0); + } + break; case 0x2A: INST_NAME("CVTSI2SD Gx, Ed"); nextop = F8; @@ -98,7 +112,7 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETGD; GETEXSD(q0, 0, 0); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { MOVGR2FCSR(FCSR2, xZR); // reset all bits } d1 = fpu_get_scratch(dyn); @@ -111,7 +125,7 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ZEROUP(gd); } if (!rex.w) ZEROUP(gd); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { MOVFCSR2GR(x5, FCSR2); // get back FPSR to check MOV32w(x3, (1 << FR_V) | (1 << FR_O)); AND(x5, x5, x3); @@ -128,7 +142,7 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETGD; GETEXSD(q0, 0, 0); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { MOVGR2FCSR(FCSR2, xZR); // reset all bits } d1 = fpu_get_scratch(dyn); @@ -142,7 +156,7 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ZEROUP(gd); } x87_restoreround(dyn, ninst, u8); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { MOVFCSR2GR(x5, FCSR2); // get back FPSR to check MOV32w(x3, (1 << FR_V) | (1 << FR_O)); AND(x5, x5, x3); @@ -154,14 +168,42 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int } } break; + + case 0x38: // these are some more SSSE4.2+ opcodes + opcode = F8; + switch (opcode) { + case 0xF0: + INST_NAME("CRC32 Gd, Eb"); + nextop = F8; + GETEB(x1, 0); + GETGD; + CRCC_W_B_W(gd, gd, ed); + ZEROUP(gd); + break; + case 0xF1: + INST_NAME("CRC32 Gd, Ed"); + nextop = F8; + GETED(0); + GETGD; + if (rex.w) { + CRCC_W_D_W(gd, gd, ed); + } else { + CRCC_W_W_W(gd, gd, ed); + } + ZEROUP(gd); + break; + default: + DEFAULT; + } + break; case 0x51: INST_NAME("SQRTSD Gx, Ex"); nextop = F8; - GETGX_empty(v0); + GETGX(v0, 1); d1 = fpu_get_scratch(dyn); GETEXSD(d0, 0, 0); FSQRT_D(d1, d0); - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { v1 = fpu_get_scratch(dyn); MOVGR2FR_D(v1, xZR); FCMP_D(fcc0, d0, v1, cLT); @@ -177,7 +219,7 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int GETEXSD(v1, 0, 0); d0 = fpu_get_scratch(dyn); FADD_D(d0, v0, v1); - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { FCMP_D(fcc0, v0, v1, cUN); BCNEZ_MARK(fcc0); FCMP_D(fcc1, d0, d0, cOR); @@ -194,7 +236,7 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int GETEXSD(v1, 0, 0); d0 = fpu_get_scratch(dyn); FMUL_D(d0, v0, v1); - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { FCMP_D(fcc0, v0, v1, cUN); BCNEZ_MARK(fcc0); FCMP_D(fcc1, d0, d0, cOR); @@ -220,7 +262,7 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int GETEXSD(v1, 0, 0); d0 = fpu_get_scratch(dyn); FSUB_D(d0, v0, v1); - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { FCMP_D(fcc0, v0, v1, cUN); BCNEZ_MARK(fcc0); FCMP_D(fcc1, d0, d0, cOR); @@ -250,7 +292,7 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int GETEXSD(v1, 0, 0); d0 = fpu_get_scratch(dyn); FDIV_D(d0, v0, v1); - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { FCMP_D(fcc0, v0, v1, cUN); BCNEZ_MARK(fcc0); FCMP_D(fcc1, d0, d0, cOR); @@ -288,11 +330,45 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int VEXTRINS_D(v0, q0, 0x0); // v0[63:0] = q0[63:0] } break; + case 0x7C: + INST_NAME("HADDPS Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VPICKEV_W(v0, q1, q0); + VPICKOD_W(v1, q1, q0); + VFADD_S(q0, v0, v1); + break; + case 0x7D: + INST_NAME("HSUBPS Gx, Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VPICKEV_W(v0, q1, q0); + VPICKOD_W(v1, q1, q0); + VFSUB_S(q0, v0, v1); + break; + case 0xAE: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 6: + INST_NAME("(unsupported) UWAIT Ed"); + FAKEED; + UDF(); + break; + default: + DEFAULT; + } + break; case 0xC2: INST_NAME("CMPSD Gx, Ex, Ib"); nextop = F8; GETGX(v0, 1); - GETEXSS(v1, 0, 1); + GETEXSD(v1, 0, 1); u8 = F8; switch (u8 & 7) { case 0: FCMP_D(fcc0, v0, v1, cEQ); break; // Equal @@ -310,8 +386,65 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int MOVGR2FR_D(q1, x2); VEXTRINS_D(v0, q1, 0); break; + case 0xD0: + INST_NAME("ADDSUBPS Gx,Ex"); + nextop = F8; + GETGX(q0, 1); + GETEX(q1, 0, 0); + v0 = fpu_get_scratch(dyn); + VFSUB_S(v0, q0, q1); + VFADD_S(q0, q0, q1); + VEXTRINS_W(q0, v0, 0); + VEXTRINS_W(q0, v0, 0b00100010); + break; + case 0xD6: + INST_NAME("MOVDQ2Q Gm, Ex"); + nextop = F8; + GETGM(v0); + GETEXSD(v1, 0, 0); + FMOV_D(v0, v1); + break; + case 0xE6: + INST_NAME("CVTPD2DQ Gx, Ex"); + nextop = F8; + GETEX(v1, 0, 0); + GETGX_empty(v0); + u8 = sse_setround(dyn, ninst, x1, x2); + if (BOX64ENV(dynarec_fastround)) { + VFTINT_W_D(v0, v1, v1); + } else { + d0 = fpu_get_scratch(dyn); + q0 = fpu_get_scratch(dyn); + q1 = fpu_get_scratch(dyn); + VFTINT_W_D(d0, v1, v1); + VLDI(q0, 0b1001110000000); // broadcast 32bit 0x80000000 to all + LU52I_D(x5, xZR, 0x41e); + VREPLGR2VR_D(q1, x5); + VFCMP_D(q1, q1, v1, cULE); + VSHUF4I_W(q1, q1, 0b00001000); + VBITSEL_V(v0, d0, q0, q1); + } + x87_restoreround(dyn, ninst, u8); + VINSGR2VR_D(v0, xZR, 1); + break; + case 0xF0: + INST_NAME("LDDQU Gx, Ex"); + nextop = F8; + GETG; + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg(dyn, ninst, x1, ed, 0); + v0 = sse_get_reg_empty(dyn, ninst, x1, gd); + VOR_V(v0, v1, v1); + } else { + v0 = sse_get_reg_empty(dyn, ninst, x1, gd); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + VLD(v0, ed, fixedaddress); + } + break; default: DEFAULT; } return addr; -} \ No newline at end of file +} diff --git a/src/dynarec/la64/dynarec_la64_f30f.c b/src/dynarec/la64/dynarec_la64_f30f.c index 333c7b6..c03f30e 100644 --- a/src/dynarec/la64/dynarec_la64_f30f.c +++ b/src/dynarec/la64/dynarec_la64_f30f.c @@ -5,11 +5,9 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "la64_emitter.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -21,7 +19,7 @@ #include "la64_printer.h" #include "dynarec_la64_private.h" #include "dynarec_la64_functions.h" -#include "dynarec_la64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { @@ -36,6 +34,7 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int int v0, v1; int q0, q1; int d0, d1; + uint8_t tmp1, tmp2, tmp3; int64_t fixedaddress, gdoffset; int unscaled; int64_t j64; @@ -53,7 +52,7 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MOVSS Gx, Ex"); nextop = F8; GETG; - if(MODREG) { + if (MODREG) { v0 = sse_get_reg(dyn, ninst, x1, gd, 1); v1 = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0); } else { @@ -80,6 +79,20 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int SMWRITE2(); } break; + case 0x12: + INST_NAME("MOVSLDUP Gx, Ex"); + nextop = F8; + GETEX(q1, 0, 0); + GETGX_empty(q0); + VPACKEV_W(q0, q1, q1); + break; + case 0x16: + INST_NAME("MOVSHDUP Gx, Ex"); + nextop = F8; + GETEX(q1, 0, 0); + GETGX_empty(q0); + VPACKOD_W(q0, q1, q1); + break; case 0x1E: INST_NAME("NOP / ENDBR32 / ENDBR64"); nextop = F8; @@ -92,7 +105,7 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int GETED(0); d1 = fpu_get_scratch(dyn); MOVGR2FR_D(d1, ed); - if(rex.w) { + if (rex.w) { FFINT_S_L(d1, d1); } else { FFINT_S_W(d1, d1); @@ -104,7 +117,7 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETGD; GETEXSS(d0, 0, 0); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { MOVGR2FCSR(FCSR2, xZR); // reset all bits } d1 = fpu_get_scratch(dyn); @@ -116,8 +129,7 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int MOVFR2GR_S(gd, d1); ZEROUP(gd); } - if (!rex.w) ZEROUP(gd); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { MOVFCSR2GR(x5, FCSR2); // get back FPSR to check MOV32w(x3, (1 << FR_V) | (1 << FR_O)); AND(x5, x5, x3); @@ -129,6 +141,128 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int } } break; + case 0x2D: + INST_NAME("CVTSS2SI Gd, Ex"); + if (addr >= 0x1033f98d && addr <= 0x1033f98d + 8) + EMIT(0); + nextop = F8; + GETGD; + GETEXSS(d0, 0, 0); + if (!BOX64ENV(dynarec_fastround)) { + MOVGR2FCSR(FCSR2, xZR); // reset all bits + } + u8 = sse_setround(dyn, ninst, x5, x6); + d1 = fpu_get_scratch(dyn); + if (rex.w) { + FTINT_L_S(d1, d0); + MOVFR2GR_D(gd, d1); + } else { + FTINT_W_S(d1, d0); + MOVFR2GR_S(gd, d1); + ZEROUP(gd); + } + x87_restoreround(dyn, ninst, u8); + if (!BOX64ENV(dynarec_fastround)) { + MOVFCSR2GR(x5, FCSR2); // get back FPSR to check + MOV32w(x3, (1 << FR_V) | (1 << FR_O)); + AND(x5, x5, x3); + CBZ_NEXT(x5); + if (rex.w) { + MOV64x(gd, 0x8000000000000000LL); + } else { + MOV32w(gd, 0x80000000); + } + } + break; + case 0x38: /* MAP */ + opcode = F8; + switch(opcode) { + case 0xF6: + INST_NAME("ADOX Gd, Ed"); + nextop = F8; + READFLAGS(X_OF); + SETFLAGS(X_OF, SF_SUBSET, NAT_FLAGS_NOFUSION); + GETED(0); + GETGD; + if(cpuext.lbt) { + X64_GET_EFLAGS(x3, X_OF); + SRLI_D(x3, x3, F_OF); + } else { + BSTRPICK_D(x3, xFlags, F_OF, F_OF); + } + IFX(X_OF) { + if(rex.w) { + ADD_D(x4, gd, ed); + SLTU(x5, x4, gd); + ADD_D(gd, x4, x3); + SLTU(x6, gd, x4); + } else { + ADD_W(x4, gd, ed); + ZEROUP(x4); + ZEROUP(gd); + SLTU(x5, x4, gd); + ADD_W(gd, x4, x3); + ZEROUP(gd); + SLTU(x6, gd, x4); + } + OR(x5, x5, x6); + if(cpuext.lbt) { + SLLI_D(x5, x5, F_OF); + X64_SET_EFLAGS(x5, X_OF); + } else { + BSTRINS_D(xFlags, x5, F_OF, F_OF); + } + } else { + ADDxw(x5, gd, ed); + ADDxw(gd, x5, x3); + if (!rex.w) ZEROUP(gd); + } + break; + default: + DEFAULT; + } + break; + +#define GO(GETFLAGS, NO, YES, NATNO, NATYES, F, I) \ + READFLAGS_FUSION(F, x1, x2, x3, x4, x5); \ + if (!dyn->insts[ninst].nat_flags_fusion) { \ + if (cpuext.lbt) { \ + X64_SETJ(tmp1, I); \ + } else { \ + GETFLAGS; \ + } \ + } \ + nextop = F8; \ + GETGD; \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP(NATNO, 8); \ + } else { \ + if (cpuext.lbt) \ + BEQZ(tmp1, 8); \ + else \ + B##NO(tmp1, 8); \ + } \ + MV(gd, ed); \ + if (!rex.w) ZEROUP(gd); \ + } else { \ + addr = geted(dyn, addr, ninst, nextop, &ed, tmp2, tmp3, &fixedaddress, rex, NULL, 1, 0); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP(NATNO, 8); \ + } else { \ + if (cpuext.lbt) \ + BEQZ(tmp1, 8); \ + else \ + B##NO(tmp1, 8); \ + } \ + LDxw(gd, ed, fixedaddress); \ + } + + GOCOND(0x40, "CMOV", "Gd, Ed"); + +#undef GO + case 0x51: INST_NAME("SQRTSS Gx, Ex"); nextop = F8; @@ -138,6 +272,28 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int FSQRT_S(d1, d0); VEXTRINS_W(v0, d1, 0); break; + case 0x52: + INST_NAME("RSQRTSS Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEXSS(v1, 0, 0); + q0 = fpu_get_scratch(dyn); + if (cpuext.frecipe) { + FRSQRTE_S(q0, v1); + } else { + FRSQRT_S(q0, v1); + } + VEXTRINS_W(v0, q0, 0); + break; + case 0x53: + INST_NAME("RCPSS Gx, Ex"); + nextop = F8; + GETGX(v0, 1); + GETEXSS(v1, 0, 0); + d1 = fpu_get_scratch(dyn); + FRECIP_S(d1, v1); + VEXTRINS_W(v0, d1, 0); + break; case 0x58: INST_NAME("ADDSS Gx, Ex"); nextop = F8; @@ -170,8 +326,12 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETEX(v1, 0, 0); GETGX_empty(v0); + if (v0 == v1 && !BOX64ENV(dynarec_fastround)) { + v1 = fpu_get_scratch(dyn); + VOR_V(v1, v0, v0); + } VFTINTRZ_W_S(v0, v1); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { q0 = fpu_get_scratch(dyn); q1 = fpu_get_scratch(dyn); d1 = fpu_get_scratch(dyn); @@ -200,15 +360,14 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETGX(d0, 1); GETEXSS(d1, 0, 0); - FCMP_S(fcc0, d0, d1, cUN); - BCNEZ_MARK(fcc0); - FCMP_S(fcc1, d1, d0, cLT); - BCEQZ_MARK2(fcc1); - MARK; - v1 = fpu_get_scratch(dyn); - FMOV_S(v1, d1); - VEXTRINS_W(d0, v1, 0); - MARK2; + q0 = fpu_get_scratch(dyn); + if (BOX64ENV(dynarec_fastnan)) { + FMIN_S(q0, d0, d1); + } else { + FCMP_S(fcc0, d1, d0, cULE); + FSEL(q0, d0, d1, fcc0); + } + VEXTRINS_W(d0, q0, 0); break; case 0x5E: INST_NAME("DIVSS Gx, Ex"); @@ -224,15 +383,14 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETGX(d0, 1); GETEXSS(d1, 0, 0); - FCMP_S(fcc0, d0, d1, cUN); - BCNEZ_MARK(fcc0); - FCMP_S(fcc1, d0, d1, cLT); - BCEQZ_MARK2(fcc1); - MARK; - v1 = fpu_get_scratch(dyn); - FMOV_S(v1, d1); - VEXTRINS_W(d0, v1, 0); - MARK2; + q0 = fpu_get_scratch(dyn); + if (BOX64ENV(dynarec_fastnan)) { + FMAX_S(q0, d0, d1); + } else { + FCMP_S(fcc0, d1, d0, cLT); + FSEL(q0, d1, d0, fcc0); + } + VEXTRINS_W(d0, q0, 0); break; case 0x6F: INST_NAME("MOVDQU Gx, Ex"); @@ -254,8 +412,14 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int GETEX(v1, 0, 1); GETGX(v0, 1); u8 = F8; - VSHUF4I_H(v0, v1, u8); - VEXTRINS_D(v0, v1, 0); // v0[63:0] = v1[63:0] + if (v0 == v1) { + q0 = fpu_get_scratch(dyn); + VSHUF4I_H(q0, v1, u8); + VEXTRINS_D(v0, q0, 0x11); // v0[127:64] = q0[127:64] + } else { + VSHUF4I_H(v0, v1, u8); + VEXTRINS_D(v0, v1, 0); // v0[63:0] = v1[63:0] + } break; case 0x7E: INST_NAME("MOVQ Gx, Ex"); @@ -270,11 +434,7 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int } GETGX_empty(v0); if (v0 == v1) { - // clear upper bits.. - q1 = fpu_get_scratch(dyn); - VXOR_V(q1, q1, q1); - VEXTRINS_D(q1, v1, 0); // q1[63:0] = v1[63:0] - VOR_V(v0, q1, q1); + VINSGR2VR_D(v0, xZR, 1); } else { VXOR_V(v0, v0, v0); VEXTRINS_D(v0, v1, 0); // v0[63:0] = v1[63:0] @@ -284,7 +444,7 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MOVDQU Ex,Gx"); nextop = F8; GETGX(v0, 0); - if(MODREG) { + if (MODREG) { v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop & 7) + (rex.b << 3)); VOR_V(v1, v0, v0); } else { @@ -293,28 +453,151 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int SMWRITE2(); } break; + case 0xAE: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 0: + case 1: + if(rex.is32bits || !MODREG) { + INST_NAME("Illegal AE"); + FAKEED; + UDF(); + } else { + if (((nextop >> 3) & 7) == 1) { + INST_NAME("RDGSBASE"); + } else { + INST_NAME("RDFSBASE"); + } + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + int seg = _FS + ((nextop >> 3) & 7); + grab_segdata(dyn, addr, ninst, x4, seg); + MVxw(ed, x4); + } + break; + case 2: + case 3: + if (rex.is32bits || !MODREG) { + INST_NAME("Illegal AE"); + FAKEED; + UDF(); + } else { + if (((nextop >> 3) & 7) == 3) { + INST_NAME("WRGSBASE"); + } else { + INST_NAME("WRFSBASE"); + } + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + int seg = _FS + ((nextop >> 3) & 7) - 2; + if (!rex.w) { + ZEROUP2(x4, ed); + ST_D(x4, xEmu, offsetof(x64emu_t, segs_offs[seg])); + } else { + ST_D(ed, xEmu, offsetof(x64emu_t, segs_offs[seg])); + } + } + break; + case 5: + INST_NAME("(unsupported) INCSSPD/INCSSPQ Ed"); + FAKEED; + UDF(); + break; + case 6: + INST_NAME("(unsupported) UMONITOR Ed"); + FAKEED; + UDF(); + break; + default: + DEFAULT; + } + break; + case 0xB8: + INST_NAME("POPCNT Gd, Ed"); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + v1 = fpu_get_scratch(dyn); + GETGD; + if (MODREG) { + GETED(0); + if (rex.w) { + VINSGR2VR_D(v1, ed, 0); + } else { + VINSGR2VR_W(v1, ed, 0); + } + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + FLDxw(v1, ed, fixedaddress); + } + if (rex.w) { + VPCNT_D(v1, v1); + MOVFR2GR_D(gd, v1); + } else { + VPCNT_W(v1, v1); + VPICKVE2GR_WU(gd, v1, 0); + } + IFX (X_ALL) { + if (cpuext.lbt) { + X64_SET_EFLAGS(xZR, X_ALL); + BNEZ_MARK(gd); + ADDI_D(x3, xZR, 1 << F_ZF); + X64_SET_EFLAGS(x3, X_ZF); + } else { + CLEAR_FLAGS(x2); + BNEZ_MARK(gd); + ORI(xFlags, xFlags, 1 << F_ZF); + } + MARK; + } + break; case 0xBC: INST_NAME("TZCNT Gd, Ed"); - SETFLAGS(X_ZF, SF_SUBSET); + SETFLAGS(X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); nextop = F8; GETED(0); GETGD; if (!rex.w && MODREG) { - AND(x4, ed, xMASK); + ZEROUP2(x4, ed); ed = x4; } - RESTORE_EFLAGS(x1); - ANDI(xFlags, xFlags, ~((1 << F_ZF) | (1 << F_CF))); - BNE_MARK(ed, xZR); - ORI(xFlags, xFlags, 1 << F_CF); - MOV32w(gd, rex.w ? 64 : 32); - SPILL_EFLAGS(); - B_NEXT_nocond; - MARK; + RESTORE_EFLAGS(x6); + /* + ZF is set if gd is zero, unset non-zero. + CF is set if ed is zero, unset non-zero. + OF, SF, PF, and AF flags are undefined + */ + CLEAR_FLAGS(x2); CTZxw(gd, ed); BNE(gd, xZR, 4 + 4); ORI(xFlags, xFlags, 1 << F_ZF); + SRLI_W(x5, gd, rex.w ? 6 : 5); // maximum value is 64/32, F_CF = 0 + OR(xFlags, xFlags, x5); + SPILL_EFLAGS(); + break; + case 0xBD: + INST_NAME("LZCNT Gd, Ed"); + SETFLAGS(X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETED(0); + GETGD; + if (!rex.w && MODREG) { + ZEROUP2(x4, ed); + ed = x4; + } + RESTORE_EFLAGS(x6); + /* + ZF is set if gd is zero, unset non-zero. + CF is set if ed is zero, unset non-zero. + OF, SF, PF, and AF flags are undefined + */ + CLEAR_FLAGS(x2); + CLZxw(gd, ed); + BNE(gd, xZR, 4 + 4); + ORI(xFlags, xFlags, 1 << F_ZF); + SRLI_W(x5, gd, rex.w ? 6 : 5); // maximum value is 64/32, F_CF = 0 + OR(xFlags, xFlags, x5); SPILL_EFLAGS(); break; case 0xC2: @@ -339,8 +622,23 @@ uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int MOVGR2FR_W(q1, x2); VEXTRINS_W(v0, q1, 0); break; + case 0xD6: + INST_NAME("MOVQ2DQ Gx, Em"); + nextop = F8; + GETGX_empty(v0); + GETEM(v1, 0); + VXOR_V(v0, v0, v0); + VEXTRINS_D(v0, v1, VEXTRINS_IMM_4_0(0, 0)); + break; + case 0xE6: + INST_NAME("CVTDQ2PD Gx, Ex"); + nextop = F8; + GETEXSD(v1, 0, 0); + GETGX_empty(v0); + VFFINTL_D_W(v0, v1); + break; default: DEFAULT; } return addr; -} \ No newline at end of file +} diff --git a/src/dynarec/la64/dynarec_la64_functions.c b/src/dynarec/la64/dynarec_la64_functions.c index 700cae5..4c4da2f 100644 --- a/src/dynarec/la64/dynarec_la64_functions.c +++ b/src/dynarec/la64/dynarec_la64_functions.c @@ -10,9 +10,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -25,11 +24,13 @@ #include "dynarec_la64_functions.h" #include "custommem.h" #include "bridge.h" +#include "gdbjit.h" +#include "perfmap.h" +#include "elfloader.h" #define XMM0 0 -#define XMM8 16 -#define X870 8 -#define EMM0 8 +#define X870 XMM0 + 16 +#define EMM0 XMM0 + 16 // Get a FPU scratch reg int fpu_get_scratch(dynarec_la64_t* dyn) @@ -40,8 +41,22 @@ int fpu_get_scratch(dynarec_la64_t* dyn) void fpu_reset_scratch(dynarec_la64_t* dyn) { dyn->lsx.fpu_scratch = 0; + dyn->lsx.ymm_used = 0; + dyn->lsx.xmm_used = 0; +} +// Get a x87 double reg +int fpu_get_reg_x87(dynarec_la64_t* dyn, int t, int n) +{ + int i = X870; + while (dyn->lsx.fpuused[i]) + ++i; + dyn->lsx.fpuused[i] = 1; + dyn->lsx.lsxcache[i].n = n; + dyn->lsx.lsxcache[i].t = t; + dyn->lsx.news |= (1 << i); + dyn->use_x87 = 1; + return i; // return a Dx } - // Free a FPU double reg void fpu_free_reg(dynarec_la64_t* dyn, int reg) { @@ -50,27 +65,48 @@ void fpu_free_reg(dynarec_la64_t* dyn, int reg) if (dyn->lsx.lsxcache[reg].t != LSX_CACHE_ST_F && dyn->lsx.lsxcache[reg].t != LSX_CACHE_ST_D && dyn->lsx.lsxcache[reg].t != LSX_CACHE_ST_I64) dyn->lsx.lsxcache[reg].v = 0; } - +// Get an MMX double reg +int fpu_get_reg_emm(dynarec_la64_t* dyn, int emm) +{ + int ret = EMM0 + emm; + dyn->lsx.fpuused[ret] = 1; + dyn->lsx.lsxcache[ret].t = LSX_CACHE_MM; + dyn->lsx.lsxcache[ret].n = emm; + dyn->lsx.news |= (1 << (ret)); + dyn->use_mmx = 1; + return ret; +} // Get an XMM quad reg int fpu_get_reg_xmm(dynarec_la64_t* dyn, int t, int xmm) { int i; - if (xmm > 7) { - i = XMM8 + xmm - 8; - } else { - i = XMM0 + xmm; - } + i = XMM0 + xmm; + dyn->lsx.fpuused[i] = 1; dyn->lsx.lsxcache[i].t = t; dyn->lsx.lsxcache[i].n = xmm; dyn->lsx.news |= (1 << i); + dyn->use_xmm = 1; + return i; +} + +// Get an YMM quad reg +int fpu_get_reg_ymm(dynarec_la64_t* dyn, int t, int ymm) +{ + int i; + i = XMM0 + ymm; + + dyn->lsx.fpuused[i] = 1; + dyn->lsx.lsxcache[i].t = t; + dyn->lsx.lsxcache[i].n = ymm; + dyn->lsx.news |= (1 << i); + dyn->use_ymm = 1; return i; } // Reset fpu regs counter static void fpu_reset_reg_lsxcache(lsxcache_t* lsx) { - lsx->fpu_reg = 0; for (int i = 0; i < 24; ++i) { lsx->fpuused[i] = 0; lsx->lsxcache[i].v = 0; @@ -82,6 +118,220 @@ void fpu_reset_reg(dynarec_la64_t* dyn) fpu_reset_reg_lsxcache(&dyn->lsx); } + +int lsxcache_no_i64(dynarec_la64_t* dyn, int ninst, int st, int a) +{ + if (a == LSX_CACHE_ST_I64) { + lsxcache_promote_double(dyn, ninst, st); + return LSX_CACHE_ST_D; + } + return a; +} + +int lsxcache_get_st(dynarec_la64_t* dyn, int ninst, int a) +{ + if (dyn->insts[ninst].lsx.swapped) { + if (dyn->insts[ninst].lsx.combined1 == a) + a = dyn->insts[ninst].lsx.combined2; + else if (dyn->insts[ninst].lsx.combined2 == a) + a = dyn->insts[ninst].lsx.combined1; + } + for (int i = 0; i < 24; ++i) + if ((dyn->insts[ninst].lsx.lsxcache[i].t == LSX_CACHE_ST_F + || dyn->insts[ninst].lsx.lsxcache[i].t == LSX_CACHE_ST_D + || dyn->insts[ninst].lsx.lsxcache[i].t == LSX_CACHE_ST_I64) + && dyn->insts[ninst].lsx.lsxcache[i].n == a) + return dyn->insts[ninst].lsx.lsxcache[i].t; + // not in the cache yet, so will be fetched... + return LSX_CACHE_ST_D; +} + +int lsxcache_get_current_st(dynarec_la64_t* dyn, int ninst, int a) +{ + (void)ninst; + if (!dyn->insts) + return LSX_CACHE_ST_D; + for (int i = 0; i < 24; ++i) + if ((dyn->lsx.lsxcache[i].t == LSX_CACHE_ST_F + || dyn->lsx.lsxcache[i].t == LSX_CACHE_ST_D + || dyn->lsx.lsxcache[i].t == LSX_CACHE_ST_I64) + && dyn->lsx.lsxcache[i].n == a) + return dyn->lsx.lsxcache[i].t; + // not in the cache yet, so will be fetched... + return LSX_CACHE_ST_D; +} + +int lsxcache_get_st_f(dynarec_la64_t* dyn, int ninst, int a) +{ + for (int i = 0; i < 24; ++i) + if (dyn->insts[ninst].lsx.lsxcache[i].t == LSX_CACHE_ST_F + && dyn->insts[ninst].lsx.lsxcache[i].n == a) + return i; + return -1; +} + +int lsxcache_get_st_f_i64(dynarec_la64_t* dyn, int ninst, int a) +{ + for (int i = 0; i < 24; ++i) + if ((dyn->insts[ninst].lsx.lsxcache[i].t == LSX_CACHE_ST_I64 || dyn->insts[ninst].lsx.lsxcache[i].t == LSX_CACHE_ST_F) + && dyn->insts[ninst].lsx.lsxcache[i].n == a) + return i; + return -1; +} + +int lsxcache_get_st_f_noback(dynarec_la64_t* dyn, int ninst, int a) +{ + for (int i = 0; i < 24; ++i) + if (dyn->insts[ninst].lsx.lsxcache[i].t == LSX_CACHE_ST_F + && dyn->insts[ninst].lsx.lsxcache[i].n == a) + return i; + return -1; +} + +int lsxcache_get_st_f_i64_noback(dynarec_la64_t* dyn, int ninst, int a) +{ + for (int i = 0; i < 24; ++i) + if ((dyn->insts[ninst].lsx.lsxcache[i].t == LSX_CACHE_ST_I64 || dyn->insts[ninst].lsx.lsxcache[i].t == LSX_CACHE_ST_F) + && dyn->insts[ninst].lsx.lsxcache[i].n == a) + return i; + return -1; +} + +int lsxcache_get_current_st_f(dynarec_la64_t* dyn, int a) +{ + for (int i = 0; i < 24; ++i) + if (dyn->lsx.lsxcache[i].t == LSX_CACHE_ST_F + && dyn->lsx.lsxcache[i].n == a) + return i; + return -1; +} + +int lsxcache_get_current_st_f_i64(dynarec_la64_t* dyn, int a) +{ + for (int i = 0; i < 24; ++i) + if ((dyn->lsx.lsxcache[i].t == LSX_CACHE_ST_I64 || dyn->lsx.lsxcache[i].t == LSX_CACHE_ST_F) + && dyn->lsx.lsxcache[i].n == a) + return i; + return -1; +} + +static void lsxcache_promote_double_forward(dynarec_la64_t* dyn, int ninst, int maxinst, int a); +static void lsxcache_promote_double_internal(dynarec_la64_t* dyn, int ninst, int maxinst, int a); +static void lsxcache_promote_double_combined(dynarec_la64_t* dyn, int ninst, int maxinst, int a) +{ + if (a == dyn->insts[ninst].lsx.combined1 || a == dyn->insts[ninst].lsx.combined2) { + if (a == dyn->insts[ninst].lsx.combined1) { + a = dyn->insts[ninst].lsx.combined2; + } else + a = dyn->insts[ninst].lsx.combined1; + int i = lsxcache_get_st_f_i64_noback(dyn, ninst, a); + if (i >= 0) { + dyn->insts[ninst].lsx.lsxcache[i].t = LSX_CACHE_ST_D; + if (dyn->insts[ninst].x87precision) dyn->need_x87check = 2; + if (!dyn->insts[ninst].lsx.barrier) + lsxcache_promote_double_internal(dyn, ninst - 1, maxinst, a - dyn->insts[ninst].lsx.stack_push); + // go forward is combined is not pop'd + if (a - dyn->insts[ninst].lsx.stack_pop >= 0) + if (!dyn->insts[ninst + 1].lsx.barrier) + lsxcache_promote_double_forward(dyn, ninst + 1, maxinst, a - dyn->insts[ninst].lsx.stack_pop); + } + } +} +static void lsxcache_promote_double_internal(dynarec_la64_t* dyn, int ninst, int maxinst, int a) +{ + if (dyn->insts[ninst + 1].lsx.barrier) + return; + while (ninst >= 0) { + a += dyn->insts[ninst].lsx.stack_pop; // adjust Stack depth: add pop'd ST (going backward) + int i = lsxcache_get_st_f_i64(dyn, ninst, a); + if (i < 0) return; + dyn->insts[ninst].lsx.lsxcache[i].t = LSX_CACHE_ST_D; + if (dyn->insts[ninst].x87precision) dyn->need_x87check = 2; + // check combined propagation too + if (dyn->insts[ninst].lsx.combined1 || dyn->insts[ninst].lsx.combined2) { + if (dyn->insts[ninst].lsx.swapped) { + // if(dyn->need_dump) dynarec_log(LOG_NONE, "lsxcache_promote_double_internal, ninst=%d swapped %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack); + if (a == dyn->insts[ninst].lsx.combined1) + a = dyn->insts[ninst].lsx.combined2; + else if (a == dyn->insts[ninst].lsx.combined2) + a = dyn->insts[ninst].lsx.combined1; + } else { + lsxcache_promote_double_combined(dyn, ninst, maxinst, a); + } + } + a -= dyn->insts[ninst].lsx.stack_push; // // adjust Stack depth: remove push'd ST (going backward) + --ninst; + if (ninst < 0 || a < 0 || dyn->insts[ninst].lsx.barrier) + return; + } +} + +static void lsxcache_promote_double_forward(dynarec_la64_t* dyn, int ninst, int maxinst, int a) +{ + while ((ninst != -1) && (ninst < maxinst) && (a >= 0)) { + a += dyn->insts[ninst].lsx.stack_push; // // adjust Stack depth: add push'd ST (going forward) + if ((dyn->insts[ninst].lsx.combined1 || dyn->insts[ninst].lsx.combined2) && dyn->insts[ninst].lsx.swapped) { + // if(dyn->need_dump) dynarec_log(LOG_NONE, "lsxcache_promote_double_forward, ninst=%d swapped %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack); + if (a == dyn->insts[ninst].lsx.combined1) + a = dyn->insts[ninst].lsx.combined2; + else if (a == dyn->insts[ninst].lsx.combined2) + a = dyn->insts[ninst].lsx.combined1; + } + int i = lsxcache_get_st_f_i64_noback(dyn, ninst, a); + if (i < 0) return; + dyn->insts[ninst].lsx.lsxcache[i].t = LSX_CACHE_ST_D; + if (dyn->insts[ninst].x87precision) dyn->need_x87check = 2; + // check combined propagation too + if ((dyn->insts[ninst].lsx.combined1 || dyn->insts[ninst].lsx.combined2) && !dyn->insts[ninst].lsx.swapped) { + // if(dyn->need_dump) dynarec_log(LOG_NONE, "lsxcache_promote_double_forward, ninst=%d combined %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack); + lsxcache_promote_double_combined(dyn, ninst, maxinst, a); + } + a -= dyn->insts[ninst].lsx.stack_pop; // adjust Stack depth: remove pop'd ST (going forward) + if (dyn->insts[ninst].x64.has_next && !dyn->insts[ninst].lsx.barrier) + ++ninst; + else + ninst = -1; + } + if (ninst == maxinst) + lsxcache_promote_double(dyn, ninst, a); +} + +void lsxcache_promote_double(dynarec_la64_t* dyn, int ninst, int a) +{ + int i = lsxcache_get_current_st_f_i64(dyn, a); + if (i < 0) return; + dyn->lsx.lsxcache[i].t = LSX_CACHE_ST_D; + dyn->insts[ninst].lsx.lsxcache[i].t = LSX_CACHE_ST_D; + if (dyn->insts[ninst].x87precision) dyn->need_x87check = 2; + // check combined propagation too + if (dyn->lsx.combined1 || dyn->lsx.combined2) { + if (dyn->lsx.swapped) { + if (dyn->lsx.combined1 == a) + a = dyn->lsx.combined2; + else if (dyn->lsx.combined2 == a) + a = dyn->lsx.combined1; + } else { + if (dyn->lsx.combined1 == a) + lsxcache_promote_double(dyn, ninst, dyn->lsx.combined2); + else if (dyn->lsx.combined2 == a) + lsxcache_promote_double(dyn, ninst, dyn->lsx.combined1); + } + } + a -= dyn->insts[ninst].lsx.stack_push; // // adjust Stack depth: remove push'd ST (going backward) + if (!ninst || a < 0) return; + lsxcache_promote_double_internal(dyn, ninst - 1, ninst, a); +} + +int lsxcache_combine_st(dynarec_la64_t* dyn, int ninst, int a, int b) +{ + dyn->lsx.combined1 = a; + dyn->lsx.combined2 = b; + if (lsxcache_get_current_st(dyn, ninst, a) == LSX_CACHE_ST_F + && lsxcache_get_current_st(dyn, ninst, b) == LSX_CACHE_ST_F) + return LSX_CACHE_ST_F; + return LSX_CACHE_ST_D; +} + static int isCacheEmpty(dynarec_native_t* dyn, int ninst) { if (dyn->insts[ninst].lsx.stack_next) { @@ -138,6 +388,7 @@ int fpuCacheNeedsTransform(dynarec_la64_t* dyn, int ninst) if (dyn->insts[ninst].lsx.lsxcache[i].n != cache_i2.lsxcache[i].n) { // not the same x64 reg ret = 1; } else if (dyn->insts[ninst].lsx.lsxcache[i].t == LSX_CACHE_XMMR && cache_i2.lsxcache[i].t == LSX_CACHE_XMMW) { /* nothing */ + } else if (dyn->insts[ninst].lsx.lsxcache[i].t == LSX_CACHE_YMMR && cache_i2.lsxcache[i].t == LSX_CACHE_YMMW) { /* nothing */ } else ret = 1; } @@ -186,24 +437,36 @@ void lsxcacheUnwind(lsxcache_t* cache) } } cache->x87stack -= cache->stack_push; + cache->tags >>= (cache->stack_push * 2); cache->stack -= cache->stack_push; + if (cache->pushed >= cache->stack_push) + cache->pushed -= cache->stack_push; + else + cache->pushed = 0; cache->stack_push = 0; } cache->x87stack += cache->stack_pop; cache->stack_next = cache->stack; + if (cache->stack_pop) { + if (cache->poped >= cache->stack_pop) + cache->poped -= cache->stack_pop; + else + cache->poped = 0; + cache->tags <<= (cache->stack_pop * 2); + } cache->stack_pop = 0; cache->barrier = 0; // And now, rebuild the x87cache info with lsxcache cache->mmxcount = 0; cache->fpu_scratch = 0; - cache->fpu_extra_qscratch = 0; - cache->fpu_reg = 0; for (int i = 0; i < 8; ++i) { cache->x87cache[i] = -1; cache->mmxcache[i] = -1; cache->x87reg[i] = 0; cache->ssecache[i * 2].v = -1; cache->ssecache[i * 2 + 1].v = -1; + cache->avxcache[i * 2].v = -1; + cache->avxcache[i * 2 + 1].v = -1; } int x87reg = 0; for (int i = 0; i < 24; ++i) { @@ -213,13 +476,16 @@ void lsxcacheUnwind(lsxcache_t* cache) case LSX_CACHE_MM: cache->mmxcache[cache->lsxcache[i].n] = i; ++cache->mmxcount; - ++cache->fpu_reg; break; case LSX_CACHE_XMMR: case LSX_CACHE_XMMW: cache->ssecache[cache->lsxcache[i].n].reg = i; cache->ssecache[cache->lsxcache[i].n].write = (cache->lsxcache[i].t == LSX_CACHE_XMMW) ? 1 : 0; - ++cache->fpu_reg; + break; + case LSX_CACHE_YMMR: + case LSX_CACHE_YMMW: + cache->avxcache[cache->lsxcache[i].n].reg = i; + cache->avxcache[cache->lsxcache[i].n].write = (cache->lsxcache[i].t == LSX_CACHE_YMMW) ? 1 : 0; break; case LSX_CACHE_ST_F: case LSX_CACHE_ST_D: @@ -227,7 +493,6 @@ void lsxcacheUnwind(lsxcache_t* cache) cache->x87cache[x87reg] = cache->lsxcache[i].n; cache->x87reg[x87reg] = i; ++x87reg; - ++cache->fpu_reg; break; case LSX_CACHE_SCR: cache->fpuused[i] = 0; @@ -250,120 +515,256 @@ const char* getCacheName(int t, int n) case LSX_CACHE_MM: sprintf(buff, "MM%d", n); break; case LSX_CACHE_XMMW: sprintf(buff, "XMM%d", n); break; case LSX_CACHE_XMMR: sprintf(buff, "xmm%d", n); break; + case LSX_CACHE_YMMW: sprintf(buff, "YMM%d", n); break; + case LSX_CACHE_YMMR: sprintf(buff, "ymm%d", n); break; case LSX_CACHE_SCR: sprintf(buff, "Scratch"); break; case LSX_CACHE_NONE: buff[0] = '\0'; break; } return buff; } +static register_mapping_t register_mappings[] = { + { "rax", "t0" }, + { "eax", "t0" }, + { "ax", "t0" }, + { "ah", "t0" }, + { "al", "t0" }, + { "rcx", "t1" }, + { "ecx", "t1" }, + { "cx", "t1" }, + { "ch", "t1" }, + { "cl", "t1" }, + { "rdx", "t2" }, + { "edx", "t2" }, + { "dx", "t2" }, + { "dh", "t2" }, + { "dl", "t2" }, + { "rbx", "t3" }, + { "ebx", "t3" }, + { "bx", "t3" }, + { "bh", "t3" }, + { "bl", "t3" }, + { "rsi", "t4" }, + { "esi", "t4" }, + { "si", "t4" }, + { "sil", "t4" }, + { "rdi", "t5" }, + { "edi", "t5" }, + { "di", "t5" }, + { "dil", "t5" }, + { "rsp", "t6" }, + { "esp", "t6" }, + { "sp", "t6" }, + { "spl", "t6" }, + { "rbp", "t7" }, + { "ebp", "t7" }, + { "bp", "t7" }, + { "bpl", "t7" }, + { "r8", "s0" }, + { "r8d", "s0" }, + { "r8w", "s0" }, + { "r8b", "s0" }, + { "r9", "s1" }, + { "r9d", "s1" }, + { "r9w", "s1" }, + { "r9b", "s1" }, + { "r10", "s2" }, + { "r10d", "s2" }, + { "r10w", "s2" }, + { "r10b", "s2" }, + { "r11", "s3" }, + { "r11d", "s3" }, + { "r11w", "s3" }, + { "r11b", "s3" }, + { "r12", "s4" }, + { "r12d", "s4" }, + { "r12w", "s4" }, + { "r12b", "s4" }, + { "r13", "s5" }, + { "r13d", "s5" }, + { "r13w", "s5" }, + { "r13b", "s5" }, + { "r14", "s6" }, + { "r14d", "s6" }, + { "r14w", "s6" }, + { "r14b", "s6" }, + { "r15", "s7" }, + { "r15d", "s7" }, + { "r15w", "s7" }, + { "r15b", "s7" }, + { "rip", "t8" }, +}; + +static const char* Ft[] = { "fa0", "fa1", "fa2", "fa3", "fa4", "fa5", "fa6", "fa7", "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7", "ft8", "ft9", "ft10", "ft11", "ft12", "ft13", "ft14", "ft15", "fs0", "fs1", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7" }; +static const char* Vt[] = { "vra0", "vra1", "vra2", "vra3", "vra4", "vra5", "vra6", "vra7", "vrt0", "vrt1", "vrt2", "vrt3", "vrt4", "vrt5", "vrt6", "vrt7", "vrt8", "vrt9", "vrt10", "vrt11", "vrt12", "vrt13", "vrt14", "vrt15", "vrs0", "vrs1", "vrs2", "vrs3", "vrs4", "vrs5", "vrs6", "vrs7" }; +static const char* XVt[] = { "xvra0", "xvra1", "xvra2", "xvra3", "xvra4", "xvra5", "xvra6", "xvra7", "xvrt0", "xvrt1", "xvrt2", "xvrt3", "xvrt4", "xvrt5", "xvrt6", "xvrt7", "xvrt8", "xvrt9", "xvrt10", "xvrt11", "xvrt12", "xvrt13", "xvrt14", "xvrt15", "xvrs0", "xvrs1", "xvrs2", "xvrs3", "xvrs4", "xvrs5", "xvrs6", "xvrs7" }; + +static const char* df_status[] = { "unknown", "set", "none_pending", "none" }; + +void printf_x64_instruction(dynarec_native_t* dyn, zydis_dec_t* dec, instruction_x64_t* inst, const char* name); void inst_name_pass3(dynarec_native_t* dyn, int ninst, const char* name, rex_t rex) { - if (box64_dynarec_dump) { - printf_x64_instruction(rex.is32bits ? my_context->dec32 : my_context->dec, &dyn->insts[ninst].x64, name); - dynarec_log(LOG_NONE, "%s%p: %d emitted opcodes, inst=%d, barrier=%d state=%d/%d(%d), %s=%X/%X, use=%X, need=%X/%X, sm=%d/%d", - (box64_dynarec_dump > 1) ? "\e[32m" : "", - (void*)(dyn->native_start + dyn->insts[ninst].address), - dyn->insts[ninst].size / 4, - ninst, - dyn->insts[ninst].x64.barrier, - dyn->insts[ninst].x64.state_flags, - dyn->f.pending, - dyn->f.dfnone, - dyn->insts[ninst].x64.may_set ? "may" : "set", - dyn->insts[ninst].x64.set_flags, - dyn->insts[ninst].x64.gen_flags, - dyn->insts[ninst].x64.use_flags, - dyn->insts[ninst].x64.need_before, - dyn->insts[ninst].x64.need_after, - dyn->smread, dyn->smwrite); - if (dyn->insts[ninst].pred_sz) { - dynarec_log(LOG_NONE, ", pred="); - for (int ii = 0; ii < dyn->insts[ninst].pred_sz; ++ii) - dynarec_log(LOG_NONE, "%s%d", ii ? "/" : "", dyn->insts[ninst].pred[ii]); + if (!dyn->need_dump && !BOX64ENV(dynarec_gdbjit) && !BOX64ENV(dynarec_perf_map)) return; + + static char buf[4096]; + int length = sprintf(buf, "barrier=%d state=%d/%s(%s->%s), set=%X/%X, use=%X, need=%X/%X, fuse=%d/%d, sm=%d(%d/%d)", + dyn->insts[ninst].x64.barrier, + dyn->insts[ninst].x64.state_flags, + df_status[dyn->f], + df_status[dyn->insts[ninst].f_entry], + df_status[dyn->insts[ninst].f_exit], + dyn->insts[ninst].x64.set_flags, + dyn->insts[ninst].x64.gen_flags, + dyn->insts[ninst].x64.use_flags, + dyn->insts[ninst].x64.need_before, + dyn->insts[ninst].x64.need_after, + dyn->insts[ninst].nat_flags_fusion, + dyn->insts[ninst].no_scratch_usage, + dyn->smwrite, dyn->insts[ninst].will_write, dyn->insts[ninst].last_write); + if (dyn->insts[ninst].pred_sz) { + length += sprintf(buf + length, ", pred="); + for (int ii = 0; ii < dyn->insts[ninst].pred_sz; ++ii) + length += sprintf(buf + length, "%s%d", ii ? "/" : "", dyn->insts[ninst].pred[ii]); + } + if (dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts >= 0) + length += sprintf(buf + length, ", jmp=%d", dyn->insts[ninst].x64.jmp_insts); + if (dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts == -1) + length += sprintf(buf + length, ", jmp=out"); + if (dyn->last_ip) + length += sprintf(buf + length, ", last_ip=%p", (void*)dyn->last_ip); + for (int ii = 0; ii < 24; ++ii) { + switch (dyn->insts[ninst].lsx.lsxcache[ii].t) { + case LSX_CACHE_ST_D: length += sprintf(buf + length, " D%d:%s", ii, getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; + case LSX_CACHE_ST_F: length += sprintf(buf + length, " S%d:%s", ii, getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; + case LSX_CACHE_ST_I64: length += sprintf(buf + length, " D%d:%s", ii, getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; + case LSX_CACHE_MM: length += sprintf(buf + length, " %s:%s", Ft[ii], getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; + case LSX_CACHE_XMMW: length += sprintf(buf + length, " %s:%s", Vt[ii], getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; + case LSX_CACHE_XMMR: length += sprintf(buf + length, " %s:%s", Vt[ii], getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; + case LSX_CACHE_YMMW: length += sprintf(buf + length, " %s:%s%s", XVt[ii], getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n), dyn->insts[ninst].lsx.avxcache[dyn->insts[ninst].lsx.lsxcache[ii].n].zero_upper == 1 ? "-UZ" : ""); break; + case LSX_CACHE_YMMR: length += sprintf(buf + length, " %s:%s%s", XVt[ii], getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n), dyn->insts[ninst].lsx.avxcache[dyn->insts[ninst].lsx.lsxcache[ii].n].zero_upper == 1 ? "-UZ" : ""); break; + case LSX_CACHE_SCR: length += sprintf(buf + length, " %s:%s", Ft[ii], getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; + case LSX_CACHE_NONE: + default: break; } - if (dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts >= 0) - dynarec_log(LOG_NONE, ", jmp=%d", dyn->insts[ninst].x64.jmp_insts); - if (dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts == -1) - dynarec_log(LOG_NONE, ", jmp=out"); - if (dyn->last_ip) - dynarec_log(LOG_NONE, ", last_ip=%p", (void*)dyn->last_ip); - for (int ii = 0; ii < 24; ++ii) { - switch (dyn->insts[ninst].lsx.lsxcache[ii].t) { - case LSX_CACHE_ST_D: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; - case LSX_CACHE_ST_F: dynarec_log(LOG_NONE, " S%d:%s", ii, getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; - case LSX_CACHE_ST_I64: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; - case LSX_CACHE_MM: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; - case LSX_CACHE_XMMW: dynarec_log(LOG_NONE, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; - case LSX_CACHE_XMMR: dynarec_log(LOG_NONE, " Q%d:%s", ii, getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; - case LSX_CACHE_SCR: dynarec_log(LOG_NONE, " D%d:%s", ii, getCacheName(dyn->insts[ninst].lsx.lsxcache[ii].t, dyn->insts[ninst].lsx.lsxcache[ii].n)); break; - case LSX_CACHE_NONE: - default: break; - } + } + if (dyn->lsx.stack || dyn->insts[ninst].lsx.stack_next || dyn->insts[ninst].lsx.x87stack) + length += sprintf(buf + length, " X87:%d/%d(+%d/-%d)%d", dyn->lsx.stack, dyn->insts[ninst].lsx.stack_next, dyn->insts[ninst].lsx.stack_push, dyn->insts[ninst].lsx.stack_pop, dyn->insts[ninst].lsx.x87stack); + if (dyn->insts[ninst].lsx.combined1 || dyn->insts[ninst].lsx.combined2) + length += sprintf(buf + length, " %s:%d/%d", dyn->insts[ninst].lsx.swapped ? "SWP" : "CMB", dyn->insts[ninst].lsx.combined1, dyn->insts[ninst].lsx.combined2); + + if (dyn->need_dump) { + printf_x64_instruction(dyn, rex.is32bits ? my_context->dec32 : my_context->dec, &dyn->insts[ninst].x64, name); + dynarec_log(LOG_NONE, "%s%p: %d emitted opcodes, inst=%d, %s%s\n", + (dyn->need_dump > 1) ? "\e[32m" : "", + (void*)(dyn->native_start + dyn->insts[ninst].address), dyn->insts[ninst].size / 4, ninst, buf, (dyn->need_dump > 1) ? "\e[m" : ""); + } + if (BOX64ENV(dynarec_gdbjit)) { + static char buf2[512]; + if (BOX64ENV(dynarec_gdbjit) > 1) { + sprintf(buf2, "; %d: %d opcodes, %s", ninst, dyn->insts[ninst].size / 4, buf); + dyn->gdbjit_block = GdbJITBlockAddLine(dyn->gdbjit_block, (dyn->native_start + dyn->insts[ninst].address), buf2); } - if (dyn->lsx.stack || dyn->insts[ninst].lsx.stack_next || dyn->insts[ninst].lsx.x87stack) - dynarec_log(LOG_NONE, " X87:%d/%d(+%d/-%d)%d", dyn->lsx.stack, dyn->insts[ninst].lsx.stack_next, dyn->insts[ninst].lsx.stack_push, dyn->insts[ninst].lsx.stack_pop, dyn->insts[ninst].lsx.x87stack); - if (dyn->insts[ninst].lsx.combined1 || dyn->insts[ninst].lsx.combined2) - dynarec_log(LOG_NONE, " %s:%d/%d", dyn->insts[ninst].lsx.swapped ? "SWP" : "CMB", dyn->insts[ninst].lsx.combined1, dyn->insts[ninst].lsx.combined2); - dynarec_log(LOG_NONE, "%s\n", (box64_dynarec_dump > 1) ? "\e[m" : ""); + zydis_dec_t* dec = rex.is32bits ? my_context->dec32 : my_context->dec; + const char* inst_name = name; + if (dec) { + inst_name = DecodeX64Trace(dec, dyn->insts[ninst].x64.addr, 0); + x64disas_add_register_mapping_annotations(buf2, inst_name, register_mappings, sizeof(register_mappings) / sizeof(register_mappings[0])); + inst_name = buf2; + } + dyn->gdbjit_block = GdbJITBlockAddLine(dyn->gdbjit_block, (dyn->native_start + dyn->insts[ninst].address), inst_name); + } + if (BOX64ENV(dynarec_perf_map) && BOX64ENV(dynarec_perf_map_fd) != -1) { + writePerfMap(dyn->insts[ninst].x64.addr, dyn->native_start + dyn->insts[ninst].address, dyn->insts[ninst].size / 4, name); } + if (length > sizeof(buf)) printf_log(LOG_NONE, "Warning: buf to small in inst_name_pass3 (%d vs %zd)\n", length, sizeof(buf)); } // will go badly if address is unaligned static uint8_t extract_byte(uint32_t val, void* address) { - int idx = (((uintptr_t)address)&3)*8; - return (val>>idx)&0xff; + int idx = (((uintptr_t)address) & 3) * 8; + return (val >> idx) & 0xff; } static uint32_t insert_byte(uint32_t val, uint8_t b, void* address) { - int idx = (((uintptr_t)address)&3)*8; - val&=~(0xff<>idx)&0xffff; + int idx = (((uintptr_t)address) & 3) * 8; + return (val >> idx) & 0xffff; } static uint32_t insert_half(uint32_t val, uint16_t h, void* address) { - int idx = (((uintptr_t)address)&3)*8; - val&=~(0xffff<block)); + dynarec_log_prefix(0, LOG_NONE, "\t%08x\t%s\n", opcode, la64_print(opcode, (uintptr_t)dyn->block)); +} + +static void x87_reset(lsxcache_t* lsx) +{ + for (int i = 0; i < 8; ++i) + lsx->x87cache[i] = -1; + lsx->tags = 0; + lsx->x87stack = 0; + lsx->stack = 0; + lsx->stack_next = 0; + lsx->stack_pop = 0; + lsx->stack_push = 0; + lsx->combined1 = lsx->combined2 = 0; + lsx->swapped = 0; + lsx->barrier = 0; + lsx->pushed = 0; + lsx->poped = 0; + + for (int i = 0; i < 24; ++i) + if (lsx->lsxcache[i].t == LSX_CACHE_ST_F + || lsx->lsxcache[i].t == LSX_CACHE_ST_D + || lsx->lsxcache[i].t == LSX_CACHE_ST_I64) + lsx->lsxcache[i].v = 0; +} + +static void mmx_reset(lsxcache_t* lsx) +{ + lsx->mmxcount = 0; + for (int i = 0; i < 8; ++i) + lsx->mmxcache[i] = -1; } static void sse_reset(lsxcache_t* lsx) @@ -371,17 +772,153 @@ static void sse_reset(lsxcache_t* lsx) for (int i = 0; i < 16; ++i) lsx->ssecache[i].v = -1; } +static void avx_reset(lsxcache_t* lsx) +{ + for (int i = 0; i < 16; ++i) + lsx->avxcache[i].v = -1; +} void fpu_reset(dynarec_la64_t* dyn) { - // TODO: x87 and mmx + x87_reset(&dyn->lsx); + mmx_reset(&dyn->lsx); sse_reset(&dyn->lsx); + avx_reset(&dyn->lsx); fpu_reset_reg(dyn); } +int fpu_is_st_freed(dynarec_la64_t* dyn, int ninst, int st) +{ + return (dyn->lsx.tags & (0b11 << (st * 2))) ? 1 : 0; +} + + void fpu_reset_ninst(dynarec_la64_t* dyn, int ninst) { // TODO: x87 and mmx sse_reset(&dyn->insts[ninst].lsx); + avx_reset(&dyn->insts[ninst].lsx); fpu_reset_reg_lsxcache(&dyn->insts[ninst].lsx); +} + +void fpu_save_and_unwind(dynarec_la64_t* dyn, int ninst, lsxcache_t* cache) +{ + memcpy(cache, &dyn->insts[ninst].lsx, sizeof(lsxcache_t)); + lsxcacheUnwind(&dyn->insts[ninst].lsx); +} +void fpu_unwind_restore(dynarec_la64_t* dyn, int ninst, lsxcache_t* cache) +{ + memcpy(&dyn->insts[ninst].lsx, cache, sizeof(lsxcache_t)); +} + +void updateNativeFlags(dynarec_la64_t* dyn) +{ + if (!BOX64ENV(dynarec_nativeflags)) + return; + for (int i = 1; i < dyn->size; ++i) + if (dyn->insts[i].nat_flags_fusion) { + int j = i - 1; + int found = 0; + if (dyn->insts[i].pred_sz == 1 && dyn->insts[i].pred[0] == j) { + while (j >= 0) { + if (dyn->insts[j].x64.set_flags && (dyn->insts[i].x64.use_flags & dyn->insts[j].x64.set_flags) == dyn->insts[i].x64.use_flags) { + dyn->insts[j].nat_flags_fusion = 1; + if (dyn->insts[i].x64.use_flags & X_SF) { + dyn->insts[j].nat_flags_needsign = 1; + } + dyn->insts[i].x64.use_flags = 0; + dyn->insts[j].nat_next_inst = i; + found = 1; + break; + } else if (j && dyn->insts[j].pred_sz == 1 && dyn->insts[j].pred[0] == j - 1 + && dyn->insts[j].no_scratch_usage && !dyn->insts[j].x64.set_flags && !dyn->insts[j].x64.use_flags) { + j -= 1; + } else + break; + } + } + if (!found) dyn->insts[i].nat_flags_fusion = 0; + } +} + +void get_free_scratch(dynarec_la64_t* dyn, int ninst, uint8_t* tmp1, uint8_t* tmp2, uint8_t* tmp3, uint8_t s1, uint8_t s2, uint8_t s3, uint8_t s4, uint8_t s5) +{ + uint8_t n1 = dyn->insts[ninst].nat_flags_op1; + uint8_t n2 = dyn->insts[ninst].nat_flags_op2; + uint8_t tmp[5] = { 0 }; + int idx = 0; +#define GO(s) \ + if ((s != n1) && (s != n2)) tmp[idx++] = s + GO(s1); + GO(s2); + GO(s3); + GO(s4); + GO(s5); +#undef GO + *tmp1 = tmp[0]; + *tmp2 = tmp[1]; + *tmp3 = tmp[2]; +} + +void tryEarlyFpuBarrier(dynarec_la64_t* dyn, int last_fpu_used, int ninst) +{ + // there is a barrier at ninst + // check if, up to last fpu_used, if there is some suspicious jump that would prevent the barrier to be put earlier + int usefull = 0; + for (int i = ninst - 1; i > last_fpu_used; --i) { + if (!dyn->insts[i].x64.has_next) + return; // break of chain, don't try to be smart for now + if (dyn->insts[i].x64.barrier & BARRIER_FLOAT) + return; // already done? + if (dyn->insts[i].x64.jmp && dyn->insts[i].x64.jmp_insts == -1) + usefull = 1; + if (dyn->insts[i].x64.jmp && dyn->insts[i].x64.jmp_insts != -1) { + int i2 = dyn->insts[i].x64.jmp_insts; + if (i2 < last_fpu_used || i2 > ninst) { + // check if some xmm/ymm/x87 stack are used in landing point + if (i2 > ninst) { + if (dyn->insts[i2].lsx.xmm_used || dyn->insts[i2].lsx.ymm_used || dyn->insts[i2].lsx.stack) + return; + } + // we will stop there, not trying to guess too much thing + if ((usefull && (i + 1) != ninst)) { + if (BOX64ENV(dynarec_dump) || BOX64ENV(dynarec_log) > 1) dynarec_log(LOG_NONE, "Putting early Float Barrier in %d for %d\n", i + 1, ninst); + dyn->insts[i + 1].x64.barrier |= BARRIER_FLOAT; + } + return; + } + usefull = 1; + } + for (int pred = 0; pred < dyn->insts[i].pred_sz; ++pred) { + if (dyn->insts[i].pred[pred] <= last_fpu_used) { + if (usefull && ((i + 1) != ninst)) { + if (BOX64ENV(dynarec_dump) || BOX64ENV(dynarec_log) > 1) dynarec_log(LOG_NONE, "Putting early Float Barrier in %d for %d\n", i + 1, ninst); + dyn->insts[i + 1].x64.barrier |= BARRIER_FLOAT; + } + return; + } + } + if (dyn->insts[i].pred_sz > 1) + usefull = 1; + } + if (usefull) { + if (BOX64ENV(dynarec_dump) || BOX64ENV(dynarec_log) > 1) dynarec_log(LOG_NONE, "Putting early Float Barrier in %d for %d\n", last_fpu_used, ninst); + dyn->insts[last_fpu_used + 1].x64.barrier |= BARRIER_FLOAT; + } +} + +void propagateFpuBarrier(dynarec_la64_t* dyn) +{ + if (!dyn->use_x87) + return; + int last_fpu_used = -1; + for (int ninst = 0; ninst < dyn->size; ++ninst) { + int fpu_used = dyn->insts[ninst].lsx.xmm_used || dyn->insts[ninst].lsx.ymm_used || dyn->insts[ninst].mmx_used || dyn->insts[ninst].x87_used; + if (fpu_used) last_fpu_used = ninst; + dyn->insts[ninst].fpu_used = fpu_used; + if (dyn->insts[ninst].fpupurge && (last_fpu_used != -1) && (last_fpu_used != (ninst - 1))) { + tryEarlyFpuBarrier(dyn, last_fpu_used, ninst); + last_fpu_used = -1; // reset the last_fpu_used... + } + } } \ No newline at end of file diff --git a/src/dynarec/la64/dynarec_la64_functions.h b/src/dynarec/la64/dynarec_la64_functions.h index b674983..c5198eb 100644 --- a/src/dynarec/la64/dynarec_la64_functions.h +++ b/src/dynarec/la64/dynarec_la64_functions.h @@ -12,18 +12,45 @@ typedef struct dynarec_la64_s dynarec_la64_t; int fpu_get_scratch(dynarec_la64_t* dyn); // Reset scratch regs counter void fpu_reset_scratch(dynarec_la64_t* dyn); +// Get an x87 double reg +int fpu_get_reg_x87(dynarec_la64_t* dyn, int t, int n); // Get an XMM quad reg int fpu_get_reg_xmm(dynarec_la64_t* dyn, int t, int xmm); +// Get an YMM quad reg +int fpu_get_reg_ymm(dynarec_la64_t* dyn, int t, int ymm); // Free a FPU/MMX/XMM reg void fpu_free_reg(dynarec_la64_t* dyn, int reg); // Reset fpu regs counter void fpu_reset_reg(dynarec_la64_t* dyn); +// Get an MMX double reg +int fpu_get_reg_emm(dynarec_la64_t* dyn, int emm); + +// Get type for STx +int lsxcache_get_st(dynarec_la64_t* dyn, int ninst, int a); +// Get if STx is FLOAT or DOUBLE +int lsxcache_get_st_f(dynarec_la64_t* dyn, int ninst, int a); +// Get if STx is FLOAT or I64 +int lsxcache_get_st_f_i64(dynarec_la64_t* dyn, int ninst, int a); +// Get actual type for STx +int lsxcache_get_current_st(dynarec_la64_t* dyn, int ninst, int a); +// Get actual STx is FLOAT or DOUBLE +int lsxcache_get_current_st_f(dynarec_la64_t* dyn, int a); +// Get actual STx is FLOAT or I64 +int lsxcache_get_current_st_f_i64(dynarec_la64_t* dyn, int a); +// Back-propagate a change float->double +void lsxcache_promote_double(dynarec_la64_t* dyn, int ninst, int a); +// Combine and propagate if needed (pass 1 only) +int lsxcache_combine_st(dynarec_la64_t* dyn, int ninst, int a, int b); // with stack current dyn->n_stack* +// Do not allow i64 type +int lsxcache_no_i64(dynarec_la64_t* dyn, int ninst, int st, int a); // FPU Cache transformation (for loops) // Specific, need to be written by backend int fpuCacheNeedsTransform(dynarec_la64_t* dyn, int ninst); // Undo the changes of a lsxcache to get the status before the instruction void lsxcacheUnwind(lsxcache_t* cache); +void fpu_save_and_unwind(dynarec_la64_t* dyn, int ninst, lsxcache_t* cache); +void fpu_unwind_restore(dynarec_la64_t* dyn, int ninst, lsxcache_t* cache); const char* getCacheName(int t, int n); @@ -33,5 +60,11 @@ void print_opcode(dynarec_native_t* dyn, int ninst, uint32_t opcode); // reset the cache void fpu_reset(dynarec_native_t* dyn); void fpu_reset_ninst(dynarec_native_t* dyn, int ninst); +// is st freed +int fpu_is_st_freed(dynarec_native_t* dyn, int ninst, int st); +// propage FPU_BARRIER to trigger it as soon as possible (avoiding fetching an FPU reg if it's unused) +void propagateFpuBarrier(dynarec_la64_t* dyn); +void updateNativeFlags(dynarec_la64_t* dyn); +void get_free_scratch(dynarec_la64_t* dyn, int ninst, uint8_t* tmp1, uint8_t* tmp2, uint8_t* tmp3, uint8_t s1, uint8_t s2, uint8_t s3, uint8_t s4, uint8_t s5); #endif //__DYNAREC_LA64_FUNCTIONS_H__ diff --git a/src/dynarec/la64/dynarec_la64_helper.c b/src/dynarec/la64/dynarec_la64_helper.c index 5c0b387..9ffb247 100644 --- a/src/dynarec/la64/dynarec_la64_helper.c +++ b/src/dynarec/la64/dynarec_la64_helper.c @@ -7,11 +7,10 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "la64_emitter.h" -#include "x64run.h" +#include "la64_mapping.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -24,12 +23,10 @@ #include "la64_printer.h" #include "dynarec_la64_private.h" #include "dynarec_la64_functions.h" -#include "dynarec_la64_helper.h" +#include "../dynarec_helper.h" #define SCRATCH 31 -static uintptr_t geted_32(dynarec_la64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, int* l, int i12); - /* setup r2 to address pointed by ED, also fixaddress is an optionnal delta in the range [-absmax, +absmax], with delta&mask==0 to be added to ed for LDR/STR */ uintptr_t geted(dynarec_la64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int* l, int i12, int delta) { @@ -37,18 +34,23 @@ uintptr_t geted(dynarec_la64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, MAYUSE(ninst); MAYUSE(delta); - if (rex.is32bits) - return geted_32(dyn, addr, ninst, nextop, ed, hint, scratch, fixaddress, l, i12); + if (l == LOCK_LOCK) { + dyn->insts[ninst].lock = 1; + } int lock = l ? ((l == LOCK_LOCK) ? 1 : 2) : 0; - if (lock == 2) - *l = 0; + if (lock == 2) *l = 0; + + if (rex.is32bits && rex.is67) + return geted16(dyn, addr, ninst, nextop, ed, hint, scratch, fixaddress, rex, i12); + uint8_t ret = x2; *fixaddress = 0; if (hint > 0) ret = hint; int maxval = 2047; if (i12 > 1) maxval -= i12; + int seg_done = 0; MAYUSE(scratch); if (!(nextop & 0xC0)) { if ((nextop & 7) == 4) { @@ -59,66 +61,109 @@ uintptr_t geted(dynarec_la64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, int64_t tmp = F32S; if (sib_reg != 4) { if (tmp && ((tmp < -2048) || (tmp > maxval) || !i12)) { - MOV64x(scratch, tmp); - ADDSL(ret, scratch, TO_LA64(sib_reg), sib >> 6, ret); + MOV64y(scratch, tmp); + ALSLy(ret, TO_NAT(sib_reg), scratch, sib >> 6); + SCRATCH_USAGE(1); } else { if (sib >> 6) { - SLLI_D(ret, TO_LA64(sib_reg), (sib >> 6)); + SLLIy(ret, TO_NAT(sib_reg), (sib >> 6)); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); } else { - ret = TO_LA64(sib_reg); + ret = TO_NAT(sib_reg); } *fixaddress = tmp; } } else { + if (rex.seg && !(tmp && ((tmp < -2048) || (tmp > maxval) || !i12))) { + grab_segdata(dyn, addr, ninst, ret, rex.seg); + seg_done = 1; + *fixaddress = tmp; + } else if (rex.seg && tmp >= -2048 && tmp < 2048) { + grab_segdata(dyn, addr, ninst, ret, rex.seg); + if (tmp) ADDI_D(ret, ret, tmp); + seg_done = 1; + } else + MOV64y(ret, tmp); + switch (lock) { case 1: addLockAddress(tmp); break; case 2: if (isLockAddress(tmp)) *l = 1; break; } - MOV64x(ret, tmp); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); } } else { if (sib_reg != 4) { - ADDSL(ret, TO_LA64(sib_reg2), TO_LA64(sib_reg), sib >> 6, scratch); + ALSLy(ret, TO_NAT(sib_reg), TO_NAT(sib_reg2), sib >> 6); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); } else { - ret = TO_LA64(sib_reg2); + ret = TO_NAT(sib_reg2); } } } else if ((nextop & 7) == 5) { - int64_t tmp = F32S64; - int64_t adj = dyn->last_ip ? ((addr + delta) - dyn->last_ip) : 0; - if (i12 && adj && (tmp + adj >= -2048) && (tmp + adj <= maxval)) { - ret = xRIP; - *fixaddress = tmp + adj; - } else if (i12 && (tmp >= -2048) && (tmp <= maxval)) { - GETIP(addr + delta); - ret = xRIP; - *fixaddress = tmp; - } else if (adj && (tmp + adj >= -2048) && (tmp + adj <= maxval)) { - ADDI_D(ret, xRIP, tmp + adj); - } else if ((tmp >= -2048) && (tmp <= maxval)) { - GETIP(addr + delta); - ADDI_D(ret, xRIP, tmp); - } else if (tmp + addr + delta < 0x100000000LL) { - MOV64x(ret, tmp + addr + delta); + if (rex.is32bits) { + int tmp = F32S; + if (rex.seg && tmp >= -2048 && tmp < 2048) { + grab_segdata(dyn, addr, ninst, ret, rex.seg); + if (tmp) ADDI_D(ret, ret, tmp); + seg_done = 1; + } else + MOV32w(ret, tmp); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + if (!rex.seg) + switch (lock) { + case 1: + addLockAddress(tmp); + if (fixaddress) *fixaddress = tmp; + break; + case 2: + if (isLockAddress(tmp)) *l = 1; + break; + } } else { - if (adj) { - MOV64x(ret, tmp + adj); + int64_t tmp = F32S64; + int64_t adj = dyn->last_ip ? ((addr + delta) - dyn->last_ip) : 0; + if (i12 && adj && (tmp + adj >= -2048) && (tmp + adj <= maxval)) { + ret = xRIP; + *fixaddress = tmp + adj; + } else if (i12 && (tmp >= -2048) && (tmp <= maxval)) { + GETIP(addr + delta, scratch); + ret = xRIP; + *fixaddress = tmp; + SCRATCH_USAGE(1); + } else if (adj && (tmp + adj >= -2048) && (tmp + adj <= maxval)) { + ADDI_D(ret, xRIP, tmp + adj); + } else if ((tmp >= -2048) && (tmp <= maxval)) { + GETIP(addr + delta, scratch); + ADDIy(ret, xRIP, tmp); + SCRATCH_USAGE(1); + } else if (tmp + addr + delta < 0x80000000LL && !dyn->need_reloc) { + MOV64y(ret, tmp + addr + delta); } else { - MOV64x(ret, tmp); - GETIP(addr + delta); + if (adj) { + MOV64y(ret, tmp + adj); + } else { + MOV64y(ret, tmp); + GETIP(addr + delta, scratch); + SCRATCH_USAGE(1); + } + ADDy(ret, ret, xRIP); } - ADD_D(ret, ret, xRIP); - } - switch (lock) { - case 1: addLockAddress(addr + delta + tmp); break; - case 2: - if (isLockAddress(addr + delta + tmp)) *l = 1; - break; + if (!rex.seg) + switch (lock) { + case 1: + addLockAddress(addr + delta + tmp); + if (fixaddress) *fixaddress = addr + delta + tmp; + break; + case 2: + if (isLockAddress(addr + delta + tmp)) *l = 1; + break; + } + if (!IS_GPR(ret)) SCRATCH_USAGE(1); } } else { - ret = TO_LA64((nextop & 7) + (rex.b << 3)); + ret = TO_NAT((nextop & 7) + (rex.b << 3)); } } else { int64_t i64; @@ -133,337 +178,153 @@ uintptr_t geted(dynarec_la64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, i64 = F32S; else i64 = F8S; - if (i64 == 0 || ((i64 >= -2048) && (i64 <= 2047) && i12)) { + if (i64 == 0 || ((i64 >= -2048) && (i64 <= maxval) && i12)) { *fixaddress = i64; if ((nextop & 7) == 4) { if (sib_reg != 4) { - ADDSL(ret, TO_LA64(sib_reg2), TO_LA64(sib_reg), sib >> 6, scratch); + ALSLy(ret, TO_NAT(sib_reg), TO_NAT(sib_reg2), sib >> 6); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); } else { - ret = TO_LA64(sib_reg2); + ret = TO_NAT(sib_reg2); } } else { - ret = TO_LA64((nextop & 0x07) + (rex.b << 3)); + ret = TO_NAT((nextop & 0x07) + (rex.b << 3)); } } else { if (i64 >= -2048 && i64 <= 2047) { if ((nextop & 7) == 4) { if (sib_reg != 4) { - ADDSL(scratch, TO_LA64(sib_reg2), TO_LA64(sib_reg), sib >> 6, scratch); + ALSLy(scratch, TO_NAT(sib_reg), TO_NAT(sib_reg2), sib >> 6); + SCRATCH_USAGE(1); } else { - scratch = TO_LA64(sib_reg2); + scratch = TO_NAT(sib_reg2); } } else { - scratch = TO_LA64((nextop & 0x07) + (rex.b << 3)); + scratch = TO_NAT((nextop & 0x07) + (rex.b << 3)); } - ADDI_D(ret, scratch, i64); + ADDIy(ret, scratch, i64); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); } else { - MOV64x(scratch, i64); + MOV64y(scratch, i64); + SCRATCH_USAGE(1); if ((nextop & 7) == 4) { if (sib_reg != 4) { - ADD_D(scratch, scratch, TO_LA64(sib_reg2)); - ADDSL(ret, scratch, TO_LA64(sib_reg), sib >> 6, ret); + ADDy(scratch, scratch, TO_NAT(sib_reg2)); + ALSLy(ret, TO_NAT(sib_reg), scratch, sib >> 6); } else { - PASS3(int tmp = TO_LA64(sib_reg2)); - ADD_D(ret, tmp, scratch); + PASS3(int tmp = TO_NAT(sib_reg2)); + ADDy(ret, tmp, scratch); } } else { - PASS3(int tmp = TO_LA64((nextop & 0x07) + (rex.b << 3))); - ADD_D(ret, tmp, scratch); + PASS3(int tmp = TO_NAT((nextop & 0x07) + (rex.b << 3))); + ADDy(ret, tmp, scratch); } } } } + if (rex.is67 && IS_GPR(ret) && !rex.seg) { + ZEROUP2(hint, ret); // truncate for is67 case only (is32bits case regs are already 32bits only) + ret = hint; + } + if (rex.seg && !seg_done) { + if (scratch == ret) + scratch = ret + 1; + SCRATCH_USAGE(1); + grab_segdata(dyn, addr, ninst, scratch, rex.seg); + // seg offset is 64bits, so no truncation here + ADDxREGy(hint, scratch, ret, hint); + ret = hint; + } *ed = ret; return addr; } -static uintptr_t geted_32(dynarec_la64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, int* l, int i12) +uintptr_t geted16(dynarec_la64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int i12) { MAYUSE(dyn); MAYUSE(ninst); - int lock = l ? ((l == LOCK_LOCK) ? 1 : 2) : 0; - if (lock == 2) - *l = 0; uint8_t ret = x2; *fixaddress = 0; if (hint > 0) ret = hint; - int maxval = 2047; - if (i12 > 1) - maxval -= i12; MAYUSE(scratch); - if (!(nextop & 0xC0)) { - if ((nextop & 7) == 4) { - uint8_t sib = F8; - int sib_reg = (sib >> 3) & 0x7; - int sib_reg2 = sib & 0x7; - if (sib_reg2 == 5) { - int64_t tmp = F32S; - if (sib_reg != 4) { - if (tmp && ((tmp < -2048) || (tmp > maxval) || !i12)) { - MOV32w(scratch, tmp); - if ((sib >> 6)) { - SLLI_D(ret, TO_LA64(sib_reg), sib >> 6); - ADD_W(ret, ret, scratch); - } else { - ADD_W(ret, TO_LA64(sib_reg), scratch); - } - } else { - if (sib >> 6) { - SLLI_D(ret, TO_LA64(sib_reg), (sib >> 6)); - } else { - ret = TO_LA64(sib_reg); - } - *fixaddress = tmp; - } - } else { - switch (lock) { - case 1: addLockAddress((int32_t)tmp); break; - case 2: - if (isLockAddress((int32_t)tmp)) *l = 1; - break; - } - MOV32w(ret, tmp); - } - } else { - if (sib_reg != 4) { - if ((sib >> 6)) { - SLLI_D(ret, TO_LA64(sib_reg), (sib >> 6)); - ADD_W(ret, ret, TO_LA64(sib_reg2)); - } else { - ADD_W(ret, TO_LA64(sib_reg2), TO_LA64(sib_reg)); - } - } else { - ret = TO_LA64(sib_reg2); - } - } - } else if ((nextop & 7) == 5) { - uint32_t tmp = F32; - MOV32w(ret, tmp); - switch (lock) { - case 1: addLockAddress(tmp); break; - case 2: - if (isLockAddress(tmp)) *l = 1; - break; - } - } else { - ret = TO_LA64((nextop & 7)); - if (ret == hint) { - AND(hint, ret, xMASK); // to clear upper part - } - } + uint32_t m = nextop & 0xC7; + uint32_t n = (m >> 6) & 3; + int64_t offset = 0; + if (!n && (m & 7) == 6) { + offset = F16S; + MOV32w(ret, offset); } else { - int64_t i32; - uint8_t sib = 0; - int sib_reg = 0; - if ((nextop & 7) == 4) { - sib = F8; - sib_reg = (sib >> 3) & 7; - } - int sib_reg2 = sib & 0x07; - if (nextop & 0x80) - i32 = F32S; - else - i32 = F8S; - if (i32 == 0 || ((i32 >= -2048) && (i32 <= 2047) && i12)) { - *fixaddress = i32; - if ((nextop & 7) == 4) { - if (sib_reg != 4) { - if (sib >> 6) { - SLLI_D(ret, TO_LA64(sib_reg), (sib >> 6)); - ADD_W(ret, ret, TO_LA64(sib_reg2)); - } else { - ADD_W(ret, TO_LA64(sib_reg2), TO_LA64(sib_reg)); - } - } else { - ret = TO_LA64(sib_reg2); - } - } else { - ret = TO_LA64((nextop & 0x07)); - } - } else { - if (i32 >= -2048 && i32 <= 2047) { - if ((nextop & 7) == 4) { - if (sib_reg != 4) { - if (sib >> 6) { - SLLI_D(scratch, TO_LA64(sib_reg), sib >> 6); - ADD_W(scratch, scratch, TO_LA64(sib_reg2)); - } else { - ADD_W(scratch, TO_LA64(sib_reg2), TO_LA64(sib_reg)); - } - } else { - scratch = TO_LA64(sib_reg2); - } - } else { - scratch = TO_LA64((nextop & 0x07)); - } - ADDI_W(ret, scratch, i32); - } else { - MOV32w(scratch, i32); - if ((nextop & 7) == 4) { - if (sib_reg != 4) { - ADD_W(scratch, scratch, TO_LA64(sib_reg2)); - if (sib >> 6) { - SLLI_D(ret, TO_LA64(sib_reg), (sib >> 6)); - ADD_W(ret, ret, scratch); - } else { - ADD_W(ret, scratch, TO_LA64(sib_reg)); - } - } else { - PASS3(int tmp = TO_LA64(sib_reg2)); - ADD_W(ret, tmp, scratch); - } - } else { - PASS3(int tmp = TO_LA64((nextop & 0x07))); - ADD_W(ret, tmp, scratch); - } - } + switch (n) { + case 0: offset = 0; break; + case 1: offset = F8S; break; + case 2: offset = F16S; break; } - } - *ed = ret; - return addr; -} - -/* setup r2 to address pointed by ED, also fixaddress is an optionnal delta in the range [-absmax, +absmax], with delta&mask==0 to be added to ed for LDR/STR */ -uintptr_t geted32(dynarec_la64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int* l, int i12, int delta) -{ - MAYUSE(dyn); - MAYUSE(ninst); - MAYUSE(delta); - - int lock = l ? ((l == LOCK_LOCK) ? 1 : 2) : 0; - if (lock == 2) - *l = 0; - uint8_t ret = x2; - *fixaddress = 0; - if (hint > 0) ret = hint; - int maxval = 2047; - if (i12 > 1) - maxval -= i12; - MAYUSE(scratch); - if (!(nextop & 0xC0)) { - if ((nextop & 7) == 4) { - uint8_t sib = F8; - int sib_reg = ((sib >> 3) & 0x7) + (rex.x << 3); - int sib_reg2 = (sib & 0x7) + (rex.b << 3); - if ((sib & 0x7) == 5) { - int64_t tmp = F32S; - if (sib_reg != 4) { - if (tmp && ((tmp < -2048) || (tmp > maxval) || !i12)) { - MOV64x(scratch, tmp); - if ((sib >> 6)) { - SLLI_D(ret, TO_LA64(sib_reg), sib >> 6); - ADD_W(ret, ret, scratch); - } else - ADD_W(ret, TO_LA64(sib_reg), scratch); - } else { - if (sib >> 6) - SLLI_D(ret, TO_LA64(sib_reg), (sib >> 6)); - else - ret = TO_LA64(sib_reg); - *fixaddress = tmp; - } - } else { - switch (lock) { - case 1: addLockAddress(tmp); break; - case 2: - if (isLockAddress(tmp)) *l = 1; - break; - } - MOV64x(ret, tmp); - } - } else { - if (sib_reg != 4) { - if ((sib >> 6)) { - SLLI_D(ret, TO_LA64(sib_reg), (sib >> 6)); - ADD_W(ret, ret, TO_LA64(sib_reg2)); - } else - ADD_W(ret, TO_LA64(sib_reg2), TO_LA64(sib_reg)); - } else { - ret = TO_LA64(sib_reg2); - } - } - } else if ((nextop & 7) == 5) { - uint32_t tmp = F32; - MOV32w(ret, tmp); - GETIP(addr + delta); - ADD_W(ret, ret, xRIP); - switch (lock) { - case 1: addLockAddress(addr + delta + tmp); break; - case 2: - if (isLockAddress(addr + delta + tmp)) *l = 1; - break; - } - } else { - ret = TO_LA64((nextop & 7) + (rex.b << 3)); - if (ret == hint) { - AND(hint, ret, xMASK); // to clear upper part - } + if (i12 && offset && offset >= -2048 && offset <= 2047) { + *fixaddress = offset; + offset = 0; } - } else { - int64_t i64; - uint8_t sib = 0; - int sib_reg = 0; - if ((nextop & 7) == 4) { - sib = F8; - sib_reg = ((sib >> 3) & 7) + (rex.x << 3); + int reg; + switch (m & 7) { + case 0: // R_BX + R_SI + ADD_D(ret, xRBX, xRSI); + reg = ret; + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + break; + case 1: // R_BX + R_DI + ADD_D(ret, xRBX, xRDI); + reg = ret; + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + break; + case 2: // R_BP + R_SI + ADD_D(ret, xRBP, xRSI); + reg = ret; + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + break; + case 3: // R_BP + R_DI + ADD_D(ret, xRBP, xRDI); + reg = ret; + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + break; + case 4: // R_SI + reg = xRSI; + break; + case 5: // R_DI + reg = xRDI; + break; + case 6: // R_BP + reg = xRBP; + break; + case 7: // R_BX + reg = xRBX; + break; } - int sib_reg2 = (sib & 0x07) + (rex.b << 3); - if (nextop & 0x80) - i64 = F32S; - else - i64 = F8S; - if (i64 == 0 || ((i64 >= -2048) && (i64 <= 2047) && i12)) { - *fixaddress = i64; - if ((nextop & 7) == 4) { - if (sib_reg != 4) { - if (sib >> 6) { - SLLI_D(ret, TO_LA64(sib_reg), (sib >> 6)); - ADD_W(ret, ret, TO_LA64(sib_reg2)); - } else - ADD_W(ret, TO_LA64(sib_reg2), TO_LA64(sib_reg)); - } else { - ret = TO_LA64(sib_reg2); - } + BSTRPICK_D(ret, reg, 15, 0); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + if (offset) { + if (offset >= -2048 && offset < 2048) { + ADDI_D(ret, ret, offset); } else { - ret = TO_LA64((nextop & 0x07) + (rex.b << 3)); - } - } else { - if (i64 >= -2048 && i64 <= 2047) { - if ((nextop & 7) == 4) { - if (sib_reg != 4) { - if (sib >> 6) { - SLLI_D(scratch, TO_LA64(sib_reg), sib >> 6); - ADD_W(scratch, scratch, TO_LA64(sib_reg2)); - } else - ADD_W(scratch, TO_LA64(sib_reg2), TO_LA64(sib_reg)); - } else { - scratch = TO_LA64(sib_reg2); - } - } else - scratch = TO_LA64((nextop & 0x07) + (rex.b << 3)); - ADDI_W(ret, scratch, i64); - } else { - MOV32w(scratch, i64); - if ((nextop & 7) == 4) { - if (sib_reg != 4) { - ADD_W(scratch, scratch, TO_LA64(sib_reg2)); - if (sib >> 6) { - SLLI_D(ret, TO_LA64(sib_reg), (sib >> 6)); - ADD_W(ret, ret, scratch); - } else - ADD_W(ret, scratch, TO_LA64(sib_reg)); - } else { - PASS3(int tmp = TO_LA64(sib_reg2)); - ADD_W(ret, tmp, scratch); - } - } else { - PASS3(int tmp = TO_LA64((nextop & 0x07) + (rex.b << 3))); - ADD_W(ret, tmp, scratch); - } + MOV64x(scratch, offset); + ADD_D(ret, ret, scratch); + SCRATCH_USAGE(1); } + BSTRPICK_D(ret, ret, 15, 0); } } + + if (rex.seg) { + if (scratch == ret) + scratch = ret + 1; + SCRATCH_USAGE(1); + grab_segdata(dyn, addr, ninst, scratch, rex.seg); + // seg offset is 64bits, so no truncation here + if (IS_GPR(ret)) { + ADD_D(hint, ret, scratch); + ret = hint; + } else + ADD_D(ret, ret, scratch); + } *ed = ret; return addr; } @@ -480,10 +341,11 @@ void jump_to_epilog(dynarec_la64_t* dyn, uintptr_t ip, int reg, int ninst) MV(xRIP, reg); } } else { - GETIP_(ip); + GETIP_(ip, x2); } - TABLE64(x2, (uintptr_t)la64_epilog); + TABLE64C(x2, const_epilog); SMEND(); + CHECK_DFNONE(0); BR(x2); } @@ -499,260 +361,909 @@ void jump_to_epilog_fast(dynarec_la64_t* dyn, uintptr_t ip, int reg, int ninst) MV(xRIP, reg); } } else { - GETIP_(ip); + GETIP_(ip, x2); } - TABLE64(x2, (uintptr_t)la64_epilog_fast); + TABLE64C(x2, const_epilog_fast); SMEND(); + CHECK_DFNONE(0); BR(x2); } + +static int indirect_lookup(dynarec_la64_t* dyn, int ninst, int is32bits, int s1, int s2) +{ + MAYUSE(dyn); + if (!is32bits) { + SRLI_D(s1, xRIP, 48); + BNEZ_safe(s1, (intptr_t)dyn->jmp_next - (intptr_t)dyn->block); + if (dyn->need_reloc) { + TABLE64C(s2, const_jmptbl48); + } else { + MOV64x(s2, getConst(const_jmptbl48)); + } + BSTRPICK_D(s1, xRIP, JMPTABL_START2 + JMPTABL_SHIFT2 - 1, JMPTABL_START2); + ALSL_D(s2, s1, s2, 3); + LD_D(s2, s2, 0); + } else { + TABLE64C(s2, const_jmptbl32); + } + BSTRPICK_D(s1, xRIP, JMPTABL_START1 + JMPTABL_SHIFT1 - 1, JMPTABL_START1); + ALSL_D(s2, s1, s2, 3); + LD_D(s2, s2, 0); + BSTRPICK_D(s1, xRIP, JMPTABL_START0 + JMPTABL_SHIFT0 - 1, JMPTABL_START0); + ALSL_D(s2, s1, s2, 3); + LD_D(s1, s2, 0); + return s1; +} + void jump_to_next(dynarec_la64_t* dyn, uintptr_t ip, int reg, int ninst, int is32bits) { MAYUSE(dyn); MAYUSE(ninst); MESSAGE(LOG_DUMP, "Jump to next\n"); + if (is32bits) + ip &= 0xffffffffLL; + + CHECK_DFNONE(0); + int dest; if (reg) { if (reg != xRIP) { MV(xRIP, reg); } NOTEST(x2); - uintptr_t tbl = is32bits ? getJumpTable32() : getJumpTable64(); - MAYUSE(tbl); - TABLE64(x3, tbl); - if (!is32bits) { - BSTRPICK_D(x2, xRIP, JMPTABL_START3 + JMPTABL_SHIFT3 - 1, JMPTABL_START3); - ALSL_D(x3, x2, x3, 3); - LD_D(x3, x3, 0); - } - BSTRPICK_D(x2, xRIP, JMPTABL_START2 + JMPTABL_SHIFT2 - 1, JMPTABL_START2); - ALSL_D(x3, x2, x3, 3); - LD_D(x3, x3, 0); - BSTRPICK_D(x2, xRIP, JMPTABL_START1 + JMPTABL_SHIFT1 - 1, JMPTABL_START1); - ALSL_D(x3, x2, x3, 3); - LD_D(x3, x3, 0); - BSTRPICK_D(x2, xRIP, JMPTABL_START0 + JMPTABL_SHIFT0 - 1, JMPTABL_START0); - ALSL_D(x3, x2, x3, 3); - LD_D(x2, x3, 0); + dest = indirect_lookup(dyn, ninst, is32bits, x2, x3); } else { NOTEST(x2); uintptr_t p = getJumpTableAddress64(ip); MAYUSE(p); - TABLE64(x3, p); - GETIP_(ip); - LD_D(x2, x3, 0); // LR_D(x2, x3, 1, 1); + GETIP_(ip, x3); + if (dyn->need_reloc) AddRelocTable64JmpTbl(dyn, ninst, ip, STEP); + TABLE64_(x3, p); + LD_D(x2, x3, 0); + dest = x2; } if (reg != x1) { MV(x1, xRIP); } CLEARIP(); + SMEND(); #ifdef HAVE_TRACE -// MOVx(x3, 15); no access to PC reg + JIRL(xRA, dest, 0x0); +#else + JIRL((dyn->insts[ninst].x64.has_callret ? xRA : xZR), dest, 0x0); #endif - SMEND(); - JIRL(xRA, x2, 0x0); // save LR... } -void ret_to_epilog(dynarec_la64_t* dyn, int ninst, rex_t rex) +void ret_to_next(dynarec_la64_t* dyn, uintptr_t ip, int ninst, rex_t rex) { MAYUSE(dyn); MAYUSE(ninst); - MESSAGE(LOG_DUMP, "Ret to epilog\n"); - POP1z(xRIP); + MESSAGE(LOG_DUMP, "Ret to next\n"); + CHECK_DFNONE(0); MVz(x1, xRIP); SMEND(); - if (box64_dynarec_callret) { - // pop the actual return address from RV64 stack - LD_D(x2, xSP, 0); // native addr + if (BOX64DRENV(dynarec_callret)) { + // pop the actual return address from LA64 stack + LD_D(xRA, xSP, 0); // native addr LD_D(x6, xSP, 8); // x86 addr ADDI_D(xSP, xSP, 16); // pop BNE(x6, xRIP, 2 * 4); // is it the right address? - BR(x2); + BR(xRA); // not the correct return address, regular jump, but purge the stack first, it's unsync now... ADDI_D(xSP, xSavedSP, -16); } - - uintptr_t tbl = rex.is32bits ? getJumpTable32() : getJumpTable64(); - MOV64x(x3, tbl); - if (!rex.is32bits) { - BSTRPICK_D(x2, xRIP, JMPTABL_START3 + JMPTABL_SHIFT3 - 1, JMPTABL_START3); - ALSL_D(x3, x2, x3, 3); - LD_D(x3, x3, 0); - } - BSTRPICK_D(x2, xRIP, JMPTABL_START2 + JMPTABL_SHIFT2 - 1, JMPTABL_START2); - ALSL_D(x3, x2, x3, 3); - LD_D(x3, x3, 0); - BSTRPICK_D(x2, xRIP, JMPTABL_START1 + JMPTABL_SHIFT1 - 1, JMPTABL_START1); - ALSL_D(x3, x2, x3, 3); - LD_D(x3, x3, 0); - BSTRPICK_D(x2, xRIP, JMPTABL_START0 + JMPTABL_SHIFT0 - 1, JMPTABL_START0); - ALSL_D(x3, x2, x3, 3); - LD_D(x2, x3, 0); - BR(x2); // save LR + NOTEST(x2); + int dest = indirect_lookup(dyn, ninst, rex.is32bits, x2, x3); + BR(dest); CLEARIP(); } -void retn_to_epilog(dynarec_la64_t* dyn, int ninst, rex_t rex, int n) +void iret_to_next(dynarec_la64_t* dyn, uintptr_t ip, int ninst, int is32bits, int is64bits) { - MAYUSE(dyn); MAYUSE(ninst); - MESSAGE(LOG_DUMP, "Retn to epilog\n"); - POP1z(xRIP); - if (n > 0x7ff) { - MOV64x(w1, n); - ADDz(xRSP, xRSP, x1); + MESSAGE(LOG_DUMP, "IRet to next\n"); + if (is64bits) { + POP1(xRIP); + POP1(x2); + POP1(xFlags); } else { - ADDIz(xRSP, xRSP, n); - } - MVz(x1, xRIP); - SMEND(); - if (box64_dynarec_callret) { - // pop the actual return address from RV64 stack - LD_D(x2, xSP, 0); // native addr - LD_D(x6, xSP, 8); // x86 addr - ADDI_D(xSP, xSP, 16); // pop - BNE(x6, xRIP, 2 * 4); // is it the right address? - BR(x2); - // not the correct return address, regular jump, but purge the stack first, it's unsync now... - ADDI_D(xSP, xSavedSP, -16); + POP1_32(xRIP); + POP1_32(x2); + POP1_32(xFlags); } - uintptr_t tbl = rex.is32bits ? getJumpTable32() : getJumpTable64(); - MOV64x(x3, tbl); - if (!rex.is32bits) { - BSTRPICK_D(x2, xRIP, JMPTABL_START3 + JMPTABL_SHIFT3 - 1, JMPTABL_START3); - ALSL_D(x3, x2, x3, 3); - LD_D(x3, x3, 0); + ST_H(x2, xEmu, offsetof(x64emu_t, segs[_CS])); + // clean EFLAGS + RESTORE_EFLAGS(x1); + MOV32w(x1, 0x3E7FD7); // also mask RF + AND(xFlags, xFlags, x1); + ORI(xFlags, xFlags, 0x2); + SPILL_EFLAGS(); + CHECK_DFNONE(0); + // POP RSP + if (is64bits) { + POP1(x3); // rsp + POP1(x2); // ss + } else { + POP1_32(x3); // rsp + POP1_32(x2); // ss } - BSTRPICK_D(x2, xRIP, JMPTABL_START2 + JMPTABL_SHIFT2 - 1, JMPTABL_START2); - ALSL_D(x3, x2, x3, 3); - LD_D(x3, x3, 0); - BSTRPICK_D(x2, xRIP, JMPTABL_START1 + JMPTABL_SHIFT1 - 1, JMPTABL_START1); - ALSL_D(x3, x2, x3, 3); - LD_D(x3, x3, 0); - BSTRPICK_D(x2, xRIP, JMPTABL_START0 + JMPTABL_SHIFT0 - 1, JMPTABL_START0); - ALSL_D(x3, x2, x3, 3); - LD_D(x2, x3, 0); - BR(x2); // save LR + // POP SS + ST_H(x2, xEmu, offsetof(x64emu_t, segs[_SS])); + // set new RSP + MV(xRSP, x3); + // Ret.... + rex_t dummy = { 0 }; + dummy.is32bits = is32bits; + dummy.w = is64bits; + ret_to_next(dyn, ip, ninst, dummy); CLEARIP(); } -void call_c(dynarec_la64_t* dyn, int ninst, void* fnc, int reg, int ret, int saveflags, int savereg) +void call_c(dynarec_la64_t* dyn, int ninst, la64_consts_t fnc, int reg, int ret, int saveflags, int savereg, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6) { MAYUSE(fnc); + CHECK_DFNONE(1); if (savereg == 0) - savereg = x6; + savereg = x87pc; if (saveflags) { RESTORE_EFLAGS(reg); ST_D(xFlags, xEmu, offsetof(x64emu_t, eflags)); } fpu_pushcache(dyn, ninst, reg, 0); if (ret != -2) { - ADDI_D(xSP, xSP, -16); // RV64 stack needs to be 16byte aligned - ST_D(xEmu, xSP, 0); - ST_D(savereg, xSP, 8); - // $r4..$r20 needs to be saved by caller - STORE_REG(RAX); - STORE_REG(RCX); + ADDI_D(xSP, xSP, -16); // LA64 stack needs to be 16byte aligned + ST_D(savereg, xSP, 0); + STORE_REG(RDI); + STORE_REG(RSI); STORE_REG(RDX); + STORE_REG(RCX); + STORE_REG(R8); + STORE_REG(R9); + STORE_REG(RAX); STORE_REG(RBX); STORE_REG(RSP); STORE_REG(RBP); - STORE_REG(RSI); - STORE_REG(RDI); ST_D(xRIP, xEmu, offsetof(x64emu_t, ip)); } - TABLE64(reg, (uintptr_t)fnc); + TABLE64C(reg, fnc); + MV(A0, xEmu); + if (arg1) MV(A1, arg1); + if (arg2) MV(A2, arg2); + if (arg3) MV(A3, arg3); + if (arg4) MV(A4, arg4); + if (arg5) MV(A5, arg5); + if (arg6) MV(A6, arg6); JIRL(xRA, reg, 0); if (ret >= 0) { - MV(ret, xEmu); + MV(ret, A0); } if (ret != -2) { - LD_D(xEmu, xSP, 0); - LD_D(savereg, xSP, 8); + LD_D(savereg, xSP, 0); ADDI_D(xSP, xSP, 16); #define GO(A) \ if (ret != x##A) { LOAD_REG(A); } - GO(RAX); - GO(RCX); + GO(RDI); + GO(RSI); GO(RDX); + GO(RCX); + GO(R8); + GO(R9); + GO(RAX); GO(RBX); GO(RSP); GO(RBP); - GO(RSI); - GO(RDI); if (ret != xRIP) LD_D(xRIP, xEmu, offsetof(x64emu_t, ip)); #undef GO } - REGENERATE_MASK(); - fpu_popcache(dyn, ninst, reg, 0); - if (saveflags) { - LD_D(xFlags, xEmu, offsetof(x64emu_t, eflags)); - SPILL_EFLAGS(); + fpu_popcache(dyn, ninst, reg, 0); + if (saveflags) { + LD_D(xFlags, xEmu, offsetof(x64emu_t, eflags)); + SPILL_EFLAGS(); + } + if (savereg != x87pc && dyn->need_x87check) + NATIVE_RESTORE_X87PC(); + // SET_NODF(); + dyn->last_ip = 0; +} + +void call_n(dynarec_la64_t* dyn, int ninst, void* fnc, int w) +{ + MAYUSE(fnc); + CHECK_DFNONE(1); + fpu_pushcache(dyn, ninst, x3, 1); + ST_D(xRSP, xEmu, offsetof(x64emu_t, regs[_SP])); + ST_D(xRBP, xEmu, offsetof(x64emu_t, regs[_BP])); + ST_D(xRBX, xEmu, offsetof(x64emu_t, regs[_BX])); + // check if additional sextw needed + int sextw_mask = ((w > 0 ? w : -w) >> 4) & 0b111111; + for (int i = 0; i < 6; i++) { + if (sextw_mask & (1 << i)) { + SEXT_W(A0 + i, A0 + i); + } + } + // native call + if (dyn->need_reloc) { + // fnc is indirect, to help with relocation (but PltResolver might be an issue here) + TABLE64(x3, (uintptr_t)fnc); + LD_D(x3, x3, 0); + } else { + TABLE64_(x3, *(uintptr_t*)fnc); // using x16 as scratch regs for call address + } + JIRL(xRA, x3, 0x0); + // put return value in x64 regs + if (w > 0) { + MV(xRAX, A0); + MV(xRDX, A1); + } + // all done, restore all regs + LD_D(xRSP, xEmu, offsetof(x64emu_t, regs[_SP])); + LD_D(xRBP, xEmu, offsetof(x64emu_t, regs[_BP])); + LD_D(xRBX, xEmu, offsetof(x64emu_t, regs[_BX])); + fpu_popcache(dyn, ninst, x3, 1); + NATIVE_RESTORE_X87PC(); + // SET_NODF(); +} + +void grab_segdata(dynarec_la64_t* dyn, uintptr_t addr, int ninst, int reg, int segment) +{ + (void)addr; + int64_t j64; + MAYUSE(j64); + MESSAGE(LOG_DUMP, "Get %s Offset\n", (segment == _FS) ? "FS" : "GS"); + LD_D(reg, xEmu, offsetof(x64emu_t, segs_offs[segment])); + MESSAGE(LOG_DUMP, "----%s Offset\n", (segment == _FS) ? "FS" : "GS"); +} + +int x87_stackcount(dynarec_la64_t* dyn, int ninst, int scratch) +{ + MAYUSE(scratch); + if (!dyn->lsx.x87stack) + return 0; + if (dyn->lsx.mmxcount) + mmx_purgecache(dyn, ninst, 0, scratch); + MESSAGE(LOG_DUMP, "\tSynch x87 Stackcount (%d)\n", dyn->lsx.x87stack); + int a = dyn->lsx.x87stack; + // Add x87stack to emu fpu_stack + LD_W(scratch, xEmu, offsetof(x64emu_t, fpu_stack)); + ADDI_D(scratch, scratch, a); + ST_W(scratch, xEmu, offsetof(x64emu_t, fpu_stack)); + // Sub x87stack to top, with and 7 + LD_W(scratch, xEmu, offsetof(x64emu_t, top)); + ADDI_D(scratch, scratch, -a); + ANDI(scratch, scratch, 7); + ST_W(scratch, xEmu, offsetof(x64emu_t, top)); + // reset x87stack, but not the stack count of extcache + dyn->lsx.x87stack = 0; + dyn->lsx.stack_next -= dyn->lsx.stack; + int ret = dyn->lsx.stack; + dyn->lsx.stack = 0; + MESSAGE(LOG_DUMP, "\t------x87 Stackcount\n"); + return ret; +} +void x87_unstackcount(dynarec_la64_t* dyn, int ninst, int scratch, int count) +{ + MAYUSE(scratch); + if (!count) + return; + if (dyn->lsx.mmxcount) + mmx_purgecache(dyn, ninst, 0, scratch); + MESSAGE(LOG_DUMP, "\tSynch x87 Unstackcount (%d)\n", count); + int a = -count; + // Add x87stack to emu fpu_stack + LD_W(scratch, xEmu, offsetof(x64emu_t, fpu_stack)); + ADDI_D(scratch, scratch, a); + ST_W(scratch, xEmu, offsetof(x64emu_t, fpu_stack)); + // Sub x87stack to top, with and 7 + LD_W(scratch, xEmu, offsetof(x64emu_t, top)); + ADDI_D(scratch, scratch, -a); + ANDI(scratch, scratch, 7); + ST_W(scratch, xEmu, offsetof(x64emu_t, top)); + // reset x87stack, but not the stack count of extcache + dyn->lsx.x87stack = count; + dyn->lsx.stack = count; + dyn->lsx.stack_next += dyn->lsx.stack; + MESSAGE(LOG_DUMP, "\t------x87 Unstackcount\n"); +} + +void x87_forget(dynarec_la64_t* dyn, int ninst, int s1, int s2, int st) +{ + int ret = -1; + for (int i = 0; (i < 8) && (ret == -1); ++i) + if (dyn->lsx.x87cache[i] == st) + ret = i; + if (ret == -1) // nothing to do + return; + MESSAGE(LOG_DUMP, "\tForget x87 Cache for ST%d\n", st); + const int reg = dyn->lsx.x87reg[ret]; +#if STEP == 1 + if (dyn->lsx.lsxcache[dyn->lsx.x87reg[ret]].t == LSX_CACHE_ST_F + || dyn->lsx.lsxcache[dyn->lsx.x87reg[ret]].t == LSX_CACHE_ST_I64) + lsxcache_promote_double(dyn, ninst, st); +#endif + // prepare offset to fpu => s1 + // Get top + LD_W(s2, xEmu, offsetof(x64emu_t, top)); + // Update + int a = st - dyn->lsx.x87stack; + if (a) { + ADDI_D(s2, s2, a); + ANDI(s2, s2, 7); // (emu->top + i)&7 + } + SLLI_D(s2, s2, 3); + ADD_D(s1, xEmu, s2); + if (dyn->lsx.lsxcache[reg].t == LSX_CACHE_ST_F) { + FCVT_D_S(SCRATCH0, reg); + FST_D(SCRATCH0, s1, offsetof(x64emu_t, x87)); + } else if (dyn->lsx.lsxcache[reg].t == LSX_CACHE_ST_I64) { + FFINT_D_L(SCRATCH0, reg); + FST_D(SCRATCH0, s1, offsetof(x64emu_t, x87)); + } else { + FST_D(reg, s1, offsetof(x64emu_t, x87)); + } + MESSAGE(LOG_DUMP, "\t--------x87 Cache for ST%d\n", st); + // and forget that cache + fpu_free_reg(dyn, dyn->lsx.x87reg[ret]); + dyn->lsx.lsxcache[reg].v = 0; + dyn->lsx.x87cache[ret] = -1; + dyn->lsx.x87reg[ret] = -1; +} + + +void x87_reget_st(dynarec_la64_t* dyn, int ninst, int s1, int s2, int st) +{ + dyn->insts[ninst].x87_used = 1; + if (dyn->lsx.mmxcount) + mmx_purgecache(dyn, ninst, 0, s1); + // search in cache first + for (int i = 0; i < 8; ++i) + if (dyn->lsx.x87cache[i] == st) { + // refresh the value + MESSAGE(LOG_DUMP, "\tRefresh x87 Cache for ST%d\n", st); +#if STEP == 1 + if (dyn->lsx.lsxcache[dyn->lsx.x87reg[i]].t == LSX_CACHE_ST_F + || dyn->lsx.lsxcache[dyn->lsx.x87reg[i]].t == LSX_CACHE_ST_I64) + lsxcache_promote_double(dyn, ninst, st); +#endif + LD_W(s2, xEmu, offsetof(x64emu_t, top)); + int a = st - dyn->lsx.x87stack; + if (a) { + ADDI_D(s2, s2, a); + AND(s2, s2, 7); + } + SLLI_D(s2, s2, 3); + ADD_D(s1, xEmu, s2); + FLD_D(dyn->lsx.x87reg[i], s1, offsetof(x64emu_t, x87)); + MESSAGE(LOG_DUMP, "\t-------x87 Cache for ST%d\n", st); + // ok + return; + } + // Was not in the cache? creating it.... + MESSAGE(LOG_DUMP, "\tCreate x87 Cache for ST%d\n", st); + // get a free spot + int ret = -1; + for (int i = 0; (i < 8) && (ret == -1); ++i) + if (dyn->lsx.x87cache[i] == -1) + ret = i; + // found, setup and grab the value + dyn->lsx.x87cache[ret] = st; + dyn->lsx.x87reg[ret] = fpu_get_reg_x87(dyn, LSX_CACHE_ST_D, st); + LD_W(s2, xEmu, offsetof(x64emu_t, top)); + int a = st - dyn->lsx.x87stack; + ADDI_D(s2, s2, a); + ANDI(s2, s2, 7); // (emu->top + i)&7 + SLLI_D(s2, s2, 3); + ADD_D(s1, xEmu, s2); + FLD_D(dyn->lsx.x87reg[ret], s1, offsetof(x64emu_t, x87)); + MESSAGE(LOG_DUMP, "\t-------x87 Cache for ST%d\n", st); +} + +void x87_free(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int st) +{ + dyn->insts[ninst].x87_used = 1; + int ret = -1; + for (int i = 0; (i < 8) && (ret == -1); ++i) + if (dyn->lsx.x87cache[i] == st) + ret = i; + MESSAGE(LOG_DUMP, "\tFFREE%s x87 Cache for ST%d\n", (ret != -1) ? " (and Forget)" : "", st); + if (ret != -1) { + const int reg = dyn->lsx.x87reg[ret]; +#if STEP == 1 + if (dyn->lsx.lsxcache[reg].t == LSX_CACHE_ST_F || dyn->lsx.lsxcache[reg].t == LSX_CACHE_ST_I64) + lsxcache_promote_double(dyn, ninst, st); +#endif + // Get top + LD_W(s2, xEmu, offsetof(x64emu_t, top)); + // Update + int ast = st - dyn->lsx.x87stack; + if (ast) { + ADDI_D(s2, s2, ast); + ANDI(s2, s2, 7); // (emu->top + i)&7 + } + SLLI_D(s2, s2, 3); + ADD_D(s1, xEmu, s2); + if (dyn->lsx.lsxcache[reg].t == LSX_CACHE_ST_F) { + FCVT_D_S(SCRATCH0, reg); + FST_D(SCRATCH0, s1, offsetof(x64emu_t, x87)); + } else if (dyn->lsx.lsxcache[reg].t == LSX_CACHE_ST_I64) { + FFINT_D_L(SCRATCH0, reg); + FST_D(SCRATCH0, s1, offsetof(x64emu_t, x87)); + } else { + FST_D(reg, s1, offsetof(x64emu_t, x87)); + } + // and forget that cache + fpu_free_reg(dyn, reg); + dyn->lsx.lsxcache[reg].v = 0; + dyn->lsx.x87cache[ret] = -1; + dyn->lsx.x87reg[ret] = -1; + } else { + // Get top + LD_W(s2, xEmu, offsetof(x64emu_t, top)); + // Update + int ast = st - dyn->lsx.x87stack; + if (ast) { + ADDI_D(s2, s2, ast); + ANDI(s2, s2, 7); // (emu->top + i)&7 + } + } + // add mark in the freed array + dyn->lsx.tags |= 0b11 << (st * 2); + MESSAGE(LOG_DUMP, "\t--------x87 FFREE for ST%d\n", st); +} + +void x87_swapreg(dynarec_la64_t* dyn, int ninst, int s1, int s2, int a, int b) +{ + int i1, i2, i3; + i1 = x87_get_cache(dyn, ninst, 1, s1, s2, b, X87_ST(b)); + i2 = x87_get_cache(dyn, ninst, 1, s1, s2, a, X87_ST(a)); + i3 = dyn->lsx.x87cache[i1]; + dyn->lsx.x87cache[i1] = dyn->lsx.x87cache[i2]; + dyn->lsx.x87cache[i2] = i3; + // swap those too + int j1, j2, j3; + j1 = x87_get_lsxcache(dyn, ninst, s1, s2, b); + j2 = x87_get_lsxcache(dyn, ninst, s1, s2, a); + j3 = dyn->lsx.lsxcache[j1].n; + dyn->lsx.lsxcache[j1].n = dyn->lsx.lsxcache[j2].n; + dyn->lsx.lsxcache[j2].n = j3; + // mark as swapped + dyn->lsx.swapped = 1; + dyn->lsx.combined1 = a; + dyn->lsx.combined2 = b; +} + +// Set rounding according to cw flags, return reg to restore flags +int x87_setround(dynarec_la64_t* dyn, int ninst, int s1, int s2) +{ + MAYUSE(dyn); + MAYUSE(ninst); + MAYUSE(s1); + MAYUSE(s2); + LD_W(s1, xEmu, offsetof(x64emu_t, cw)); + BSTRPICK_W(s1, s1, 11, 10); + // MMX/x87 Round mode: 0..3: Nearest, Down, Up, Chop + // LA64: 0..3: Nearest, TowardZero, TowardsPositive, TowardsNegative + // 0->0, 1->3, 2->2, 3->1 + SUB_W(s1, xZR, s1); + ANDI(s1, s1, 3); + // done + SLLI_D(s1, s1, 8); + MOVFCSR2GR(s2, FCSR3); + MOVGR2FCSR(FCSR3, s1); // exchange RM with current + return s2; +} + +// Set rounding according to mxcsr flags, return reg to restore flags +int sse_setround(dynarec_la64_t* dyn, int ninst, int s1, int s2) +{ + MAYUSE(dyn); + MAYUSE(ninst); + MAYUSE(s1); + MAYUSE(s2); + LD_W(s1, xEmu, offsetof(x64emu_t, mxcsr)); + BSTRPICK_W(s1, s1, 14, 13); + // MMX/x87 Round mode: 0..3: Nearest, Down, Up, Chop + // LA64: 0..3: Nearest, TowardZero, TowardsPositive, TowardsNegative + // 0->0, 1->3, 2->2, 3->1 + SUB_W(s1, xZR, s1); + ANDI(s1, s1, 3); + // done + SLLI_D(s1, s1, 8); + MOVFCSR2GR(s2, FCSR3); + MOVGR2FCSR(FCSR3, s1); // exchange RM with current + return s2; +} + +int lsxcache_st_coherency(dynarec_la64_t* dyn, int ninst, int a, int b) +{ + int i1 = lsxcache_get_st(dyn, ninst, a); + int i2 = lsxcache_get_st(dyn, ninst, b); + if (i1 != i2) { + MESSAGE(LOG_DUMP, "Warning, ST cache incoherent between ST%d(%d) and ST%d(%d)\n", a, i1, b, i2); + } + + return i1; +} + +// On step 1, Float/Double for ST is actually computed and back-propagated +// On step 2-3, the value is just read for inst[...].n.neocache[..] +// the reg returned is *2 for FLOAT +int x87_do_push(dynarec_la64_t* dyn, int ninst, int s1, int t) +{ + dyn->insts[ninst].x87_used = 1; + if (dyn->lsx.mmxcount) + mmx_purgecache(dyn, ninst, 0, s1); + dyn->lsx.x87stack += 1; + dyn->lsx.stack += 1; + dyn->lsx.stack_next += 1; + dyn->lsx.stack_push += 1; + ++dyn->lsx.pushed; + if (dyn->lsx.poped) + --dyn->lsx.poped; + // move all regs in cache, and find a free one + for (int j = 0; j < 24; ++j) + if ((dyn->lsx.lsxcache[j].t == LSX_CACHE_ST_D) + || (dyn->lsx.lsxcache[j].t == LSX_CACHE_ST_F) + || (dyn->lsx.lsxcache[j].t == LSX_CACHE_ST_I64)) + ++dyn->lsx.lsxcache[j].n; + int ret = -1; + dyn->lsx.tags <<= 2; + for (int i = 0; i < 8; ++i) + if (dyn->lsx.x87cache[i] != -1) + ++dyn->lsx.x87cache[i]; + else if (ret == -1) { + dyn->lsx.x87cache[i] = 0; + ret = dyn->lsx.x87reg[i] = fpu_get_reg_x87(dyn, t, 0); + dyn->lsx.lsxcache[ret].t = X87_ST0; + } + if (ret == -1) { + MESSAGE(LOG_DUMP, "Incoherent x87 stack cache, aborting\n"); + dyn->abort = 1; + } + return ret; +} +void x87_do_push_empty(dynarec_la64_t* dyn, int ninst, int s1) +{ + dyn->insts[ninst].x87_used = 1; + if (dyn->lsx.mmxcount) + mmx_purgecache(dyn, ninst, 0, s1); + dyn->lsx.x87stack += 1; + dyn->lsx.stack += 1; + dyn->lsx.stack_next += 1; + dyn->lsx.stack_push += 1; + ++dyn->lsx.pushed; + if (dyn->lsx.poped) + --dyn->lsx.poped; + // move all regs in cache + for (int j = 0; j < 24; ++j) + if ((dyn->lsx.lsxcache[j].t == LSX_CACHE_ST_D) + || (dyn->lsx.lsxcache[j].t == LSX_CACHE_ST_F) + || (dyn->lsx.lsxcache[j].t == LSX_CACHE_ST_I64)) + ++dyn->lsx.lsxcache[j].n; + int ret = -1; + dyn->lsx.tags <<= 2; + for (int i = 0; i < 8; ++i) + if (dyn->lsx.x87cache[i] != -1) + ++dyn->lsx.x87cache[i]; + else if (ret == -1) + ret = i; + if (ret == -1) { + MESSAGE(LOG_DUMP, "Incoherent x87 stack cache, aborting\n"); + dyn->abort = 1; + } +} +static void internal_x87_dopop(dynarec_la64_t* dyn) +{ + for (int i = 0; i < 8; ++i) + if (dyn->lsx.x87cache[i] != -1) { + --dyn->lsx.x87cache[i]; + if (dyn->lsx.x87cache[i] == -1) { + fpu_free_reg(dyn, dyn->lsx.x87reg[i]); + dyn->lsx.x87reg[i] = -1; + } + } +} +static int internal_x87_dofree(dynarec_la64_t* dyn) +{ + if (dyn->lsx.tags & 0b11) { + MESSAGE(LOG_DUMP, "\t--------x87 FREED ST0, poping 1 more\n"); + return 1; + } + return 0; +} +void x87_do_pop(dynarec_la64_t* dyn, int ninst, int s1) +{ + dyn->insts[ninst].x87_used = 1; + if (dyn->lsx.mmxcount) + mmx_purgecache(dyn, ninst, 0, s1); + do { + dyn->lsx.x87stack -= 1; + dyn->lsx.stack_next -= 1; + dyn->lsx.stack_pop += 1; + dyn->lsx.tags >>= 2; + ++dyn->lsx.poped; + if (dyn->lsx.pushed) + --dyn->lsx.pushed; + // move all regs in cache, poping ST0 + internal_x87_dopop(dyn); + } while (internal_x87_dofree(dyn)); +} + + +void x87_purgecache(dynarec_la64_t* dyn, int ninst, int next, int s1, int s2, int s3) +{ + dyn->insts[ninst].x87_used = 1; + int ret = 0; + for (int i = 0; i < 8 && !ret; ++i) + if (dyn->lsx.x87cache[i] != -1) + ret = 1; + if (!ret && !dyn->lsx.x87stack) // nothing to do + return; + MESSAGE(LOG_DUMP, "\tPurge %sx87 Cache and Synch Stackcount (%+d)---\n", next ? "locally " : "", dyn->lsx.x87stack); + int a = dyn->lsx.x87stack; + if (a != 0) { + // reset x87stack + if (!next) + dyn->lsx.x87stack = 0; + // Add x87stack to emu fpu_stack + LD_W(s2, xEmu, offsetof(x64emu_t, fpu_stack)); + ADDI_D(s2, s2, a); + ST_W(s2, xEmu, offsetof(x64emu_t, fpu_stack)); + // Sub x87stack to top, with and 7 + LD_W(s2, xEmu, offsetof(x64emu_t, top)); + // update tags (and top at the same time) + ADDI_D(s2, s2, -a); + ANDI(s2, s2, 7); + ST_W(s2, xEmu, offsetof(x64emu_t, top)); + // update tags (and top at the same time) + LD_HU(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + if (a > 0) { + SLLI_D(s1, s1, a * 2); + } else { + BSTRINS_D(s1, xZR, 15, 0); + SRLI_D(s1, s1, -a * 2); + } + ST_H(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + } else { + LD_W(s2, xEmu, offsetof(x64emu_t, top)); + } + // check if free is used + if (dyn->lsx.tags) { + LD_H(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + MOV32w(s3, dyn->lsx.tags); + OR(s1, s1, s3); + ST_H(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + } + if (ret != 0) { + // --- set values + // Get top + // loop all cache entries + for (int i = 0; i < 8; ++i) + if (dyn->lsx.x87cache[i] != -1) { + int st = dyn->lsx.x87cache[i] + dyn->lsx.stack_pop; + // don't force promotion here + ADDI_D(s3, s2, dyn->lsx.x87cache[i]); // unadjusted count, as it's relative to real top + ANDI(s3, s3, 7); // (emu->top + st)&7 + SLLI_D(s1, s3, 3); + ADD_D(s1, xEmu, s1); + switch (lsxcache_get_current_st(dyn, ninst, st)) { + case LSX_CACHE_ST_D: + FST_D(dyn->lsx.x87reg[i], s1, offsetof(x64emu_t, x87)); // save the value + break; + case LSX_CACHE_ST_F: + FCVT_D_S(SCRATCH0, dyn->lsx.x87reg[i]); + FST_D(SCRATCH0, s1, offsetof(x64emu_t, x87)); // save the value + break; + case LSX_CACHE_ST_I64: + FFINT_D_L(SCRATCH0, dyn->lsx.x87reg[i]); + FST_D(SCRATCH0, s1, offsetof(x64emu_t, x87)); // save the value + break; + } + if (!next) { + fpu_free_reg(dyn, dyn->lsx.x87reg[i]); + dyn->lsx.x87reg[i] = -1; + dyn->lsx.x87cache[i] = -1; + // dyn->lsx.stack_pop+=1; //no pop, but the purge because of barrier will have the n.barrier flags set + } + } + } + if (!next) { + dyn->lsx.stack_next = 0; + dyn->lsx.tags = 0; +#if STEP < 2 + // refresh the cached valued, in case it's a purge outside a instruction + dyn->insts[ninst].lsx.barrier = 1; + dyn->lsx.pushed = 0; + dyn->lsx.poped = 0; + +#endif + } + MESSAGE(LOG_DUMP, "\t---Purge x87 Cache and Synch Stackcount\n"); +} + +void x87_reflectcount(dynarec_la64_t* dyn, int ninst, int s1, int s2) +{ + // Synch top and stack count + int a = dyn->lsx.x87stack; + if (a) { + MESSAGE(LOG_DUMP, "\tSync x87 Count of %d-----\n", a); + // Add x87stack to emu fpu_stack + LD_W(s2, xEmu, offsetof(x64emu_t, fpu_stack)); + ADDI_D(s2, s2, a); + ST_W(s2, xEmu, offsetof(x64emu_t, fpu_stack)); + // Sub x87stack to top, with and 7 + LD_W(s2, xEmu, offsetof(x64emu_t, top)); + ADDI_D(s2, s2, -a); + ANDI(s2, s2, 7); + ST_W(s2, xEmu, offsetof(x64emu_t, top)); + // update tags + LD_H(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + if (a > 0) { + SLLI_D(s1, s1, a * 2); + } else { + MOV32w(s2, 0xffff0000); + OR(s1, s1, s2); + SRLI_D(s1, s1, -a * 2); + } + ST_H(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + } +} + +static void x87_reflectcache(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3) +{ + // Sync top and stack count + int a = dyn->lsx.x87stack; + if (a) { + // Add x87stack to emu fpu_stack + LD_W(s2, xEmu, offsetof(x64emu_t, fpu_stack)); + ADDI_D(s2, s2, a); + ST_W(s2, xEmu, offsetof(x64emu_t, fpu_stack)); + // Sub x87stack to top, with and 7 + LD_W(s2, xEmu, offsetof(x64emu_t, top)); + ADDI_D(s2, s2, -a); + ANDI(s2, s2, 7); + ST_W(s2, xEmu, offsetof(x64emu_t, top)); + // update tags (and top at the same time) + LD_H(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + if (a > 0) { + SLLI_D(s1, s1, a * 2); + } else { + MOV32w(s3, 0xffff0000); + OR(s1, s1, s3); + SRLI_D(s1, s1, -a * 2); + } + ST_H(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + } + int ret = 0; + for (int i = 0; (i < 8) && (!ret); ++i) + if (dyn->lsx.x87cache[i] != -1) + ret = 1; + if (!ret) // nothing to do + return; + // prepare offset to fpu => s1 + // Get top + if (!a) { + LD_W(s2, xEmu, offsetof(x64emu_t, top)); + } + // loop all cache entries + for (int i = 0; i < 8; ++i) + if (dyn->lsx.x87cache[i] != -1) { + ADDI_D(s3, s2, dyn->lsx.x87cache[i]); + ANDI(s3, s3, 7); // (emu->top + i)&7 + SLLI_D(s1, s3, 3); + ADD_D(s1, xEmu, s1); + if (lsxcache_get_current_st_f(dyn, dyn->lsx.x87cache[i]) >= 0) { + FCVT_D_S(SCRATCH0, dyn->lsx.x87reg[i]); + FST_D(SCRATCH0, s1, offsetof(x64emu_t, x87)); + } else + FST_D(dyn->lsx.x87reg[i], s1, offsetof(x64emu_t, x87)); + } +} + + +void x87_unreflectcount(dynarec_la64_t* dyn, int ninst, int s1, int s2) +{ + // revert top and stack count + int a = dyn->lsx.x87stack; + if (a) { + // Sub x87stack to emu fpu_stack + LD_W(s2, xEmu, offsetof(x64emu_t, fpu_stack)); + ADDI_D(s2, s2, -a); + ST_W(s2, xEmu, offsetof(x64emu_t, fpu_stack)); + // Add x87stack to top, with and 7 + LD_W(s2, xEmu, offsetof(x64emu_t, top)); + ADDI_D(s2, s2, a); + ANDI(s2, s2, 7); + ST_W(s2, xEmu, offsetof(x64emu_t, top)); + // update tags + LD_H(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + if (a > 0) { + MOV32w(s2, 0xffff0000); + OR(s1, s1, s2); + SRLI_D(s1, s1, a * 2); + } else { + SLLI_D(s1, s1, -a * 2); + } + ST_H(s1, xEmu, offsetof(x64emu_t, fpu_tags)); } - SET_NODF(); - dyn->last_ip = 0; } -void grab_segdata(dynarec_la64_t* dyn, uintptr_t addr, int ninst, int reg, int segment) +int x87_get_current_cache(dynarec_la64_t* dyn, int ninst, int st, int t) { - (void)addr; - int64_t j64; - MAYUSE(j64); - MESSAGE(LOG_DUMP, "Get %s Offset\n", (segment == _FS) ? "FS" : "GS"); - int t1 = x1, t2 = x4; - if (reg == t1) ++t1; - if (reg == t2) ++t2; - LD_WU(t2, xEmu, offsetof(x64emu_t, segs_serial[segment])); - LD_D(reg, xEmu, offsetof(x64emu_t, segs_offs[segment])); - if (segment == _GS) { - CBNZ_MARKSEG(t2); // fast check - } else { - LD_D(t1, xEmu, offsetof(x64emu_t, context)); - LD_WU(t1, t1, offsetof(box64context_t, sel_serial)); - SUB_W(t1, t1, t2); - CBZ_MARKSEG(t1); - } - MOV64x(x1, segment); - call_c(dyn, ninst, GetSegmentBaseEmu, t2, reg, 0, xFlags); - MARKSEG; - MESSAGE(LOG_DUMP, "----%s Offset\n", (segment == _FS) ? "FS" : "GS"); + dyn->insts[ninst].x87_used = 1; + // search in cache first + for (int i = 0; i < 8; ++i) { + if (dyn->lsx.x87cache[i] == st) { +#if STEP == 1 + if (t == LSX_CACHE_ST_D && (dyn->lsx.lsxcache[dyn->lsx.x87reg[i]].t == LSX_CACHE_ST_F || dyn->lsx.lsxcache[dyn->lsx.x87reg[i]].t == LSX_CACHE_ST_I64)) + lsxcache_promote_double(dyn, ninst, st); + else if (t == LSX_CACHE_ST_I64 && (dyn->lsx.lsxcache[dyn->lsx.x87reg[i]].t == LSX_CACHE_ST_F)) + lsxcache_promote_double(dyn, ninst, st); + else if (t == LSX_CACHE_ST_F && (dyn->lsx.lsxcache[dyn->lsx.x87reg[i]].t == LSX_CACHE_ST_I64)) + lsxcache_promote_double(dyn, ninst, st); +#endif + return i; + } + assert(dyn->lsx.x87cache[i] < 8); + } + return -1; } +int x87_get_cache(dynarec_la64_t* dyn, int ninst, int populate, int s1, int s2, int st, int t) +{ + dyn->insts[ninst].x87_used = 1; + if (dyn->lsx.mmxcount) + mmx_purgecache(dyn, ninst, 0, s1); + int ret = x87_get_current_cache(dyn, ninst, st, t); + if (ret != -1) + return ret; + MESSAGE(LOG_DUMP, "\tCreate %sx87 Cache for ST%d\n", populate ? "and populate " : "", st); + // get a free spot + for (int i = 0; (i < 8) && (ret == -1); ++i) + if (dyn->lsx.x87cache[i] == -1) + ret = i; + // found, setup and grab the value + dyn->lsx.x87cache[ret] = st; + dyn->lsx.x87reg[ret] = fpu_get_reg_x87(dyn, LSX_CACHE_ST_D, st); + if (populate) { + LD_W(s2, xEmu, offsetof(x64emu_t, top)); + int a = st - dyn->lsx.x87stack; + if (a) { + ADDI_D(s2, s2, a); + ANDI(s2, s2, 7); + } + SLLI_D(s2, s2, 3); + ADD_D(s1, xEmu, s2); + FLD_D(dyn->lsx.x87reg[ret], s1, offsetof(x64emu_t, x87)); + } + MESSAGE(LOG_DUMP, "\t-------x87 Cache for ST%d\n", st); -void x87_forget(dynarec_la64_t* dyn, int ninst, int s1, int s2, int st) + return ret; +} +int x87_get_lsxcache(dynarec_la64_t* dyn, int ninst, int s1, int s2, int st) { - // TODO + dyn->insts[ninst].x87_used = 1; + for (int ii = 0; ii < 24; ++ii) + if ((dyn->lsx.lsxcache[ii].t == LSX_CACHE_ST_F + || dyn->lsx.lsxcache[ii].t == LSX_CACHE_ST_D + || dyn->lsx.lsxcache[ii].t == LSX_CACHE_ST_I64) + && dyn->lsx.lsxcache[ii].n == st) + return ii; + assert(0); + return -1; } - -// Set rounding according to mxcsr flags, return reg to restore flags -int sse_setround(dynarec_la64_t* dyn, int ninst, int s1, int s2) +int x87_get_st(dynarec_la64_t* dyn, int ninst, int s1, int s2, int a, int t) { - MAYUSE(dyn); - MAYUSE(ninst); - MAYUSE(s1); - MAYUSE(s2); - LD_W(s1, xEmu, offsetof(x64emu_t, mxcsr)); - SRLI_D(s1, s1, 13); - ANDI(s1, s1, 0b11); - // MMX/x87 Round mode: 0..3: Nearest, Down, Up, Chop - // LA64: 0..3: Nearest, TowardZero, TowardsPositive, TowardsNegative - // 0->0, 1->3, 2->2, 3->1 - BEQ(s1, xZR, 32); - ADDI_D(s2, xZR, 2); - BEQ(s1, s2, 24); - ADDI_D(s2, xZR, 3); - BEQ(s1, s2, 12); - ADDI_D(s1, xZR, 3); - B(8); - ADDI_D(s1, xZR, 1); - // done - SLLI_D(s1, s1, 8); - MOVFCSR2GR(s2, FCSR3); - MOVGR2FCSR(FCSR3, s1); // exange RM with current - return s2; + dyn->insts[ninst].x87_used = 1; + return dyn->lsx.x87reg[x87_get_cache(dyn, ninst, 1, s1, s2, a, t)]; +} +int x87_get_st_empty(dynarec_la64_t* dyn, int ninst, int s1, int s2, int a, int t) +{ + dyn->insts[ninst].x87_used = 1; + return dyn->lsx.x87reg[x87_get_cache(dyn, ninst, 0, s1, s2, a, t)]; } // Restore round flag @@ -764,10 +1275,76 @@ void x87_restoreround(dynarec_la64_t* dyn, int ninst, int s1) MOVGR2FCSR(FCSR3, s1); } +// MMX helpers +static int isx87Empty(dynarec_la64_t* dyn) +{ + for (int i = 0; i < 8; ++i) + if (dyn->lsx.x87cache[i] != -1) + return 0; + return 1; +} + +// get neon register for a MMX reg, create the entry if needed +int mmx_get_reg(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int a) +{ + dyn->insts[ninst].mmx_used = 1; + if (!dyn->lsx.x87stack && isx87Empty(dyn)) + x87_purgecache(dyn, ninst, 0, s1, s2, s3); + if (dyn->lsx.mmxcache[a] != -1) + return dyn->lsx.mmxcache[a]; + ++dyn->lsx.mmxcount; + int ret = dyn->lsx.mmxcache[a] = fpu_get_reg_emm(dyn, a); + FLD_D(ret, xEmu, offsetof(x64emu_t, mmx[a])); + return ret; +} +// get neon register for a MMX reg, but don't try to synch it if it needed to be created +int mmx_get_reg_empty(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int a) +{ + dyn->insts[ninst].mmx_used = 1; + if (!dyn->lsx.x87stack && isx87Empty(dyn)) + x87_purgecache(dyn, ninst, 0, s1, s2, s3); + if (dyn->lsx.mmxcache[a] != -1) + return dyn->lsx.mmxcache[a]; + ++dyn->lsx.mmxcount; + int ret = dyn->lsx.mmxcache[a] = fpu_get_reg_emm(dyn, a); + return ret; +} +// purge the MMX cache only +void mmx_purgecache(dynarec_la64_t* dyn, int ninst, int next, int s1) +{ + if (!dyn->lsx.mmxcount) return; + if (!next) dyn->lsx.mmxcount = 0; + int old = -1; + for (int i = 0; i < 8; ++i) + if (dyn->lsx.mmxcache[i] != -1) { + if (old == -1) { + MESSAGE(LOG_DUMP, "\tPurge %sMMX Cache ------\n", next ? "locally " : ""); + ++old; + } + FST_D(dyn->lsx.mmxcache[i], xEmu, offsetof(x64emu_t, mmx[i])); + if (!next) { + fpu_free_reg(dyn, dyn->lsx.mmxcache[i]); + dyn->lsx.mmxcache[i] = -1; + } + } + if (old != -1) { + MESSAGE(LOG_DUMP, "\t------ Purge MMX Cache\n"); + } +} + +static void mmx_reflectcache(dynarec_la64_t* dyn, int ninst, int s1) +{ + for (int i = 0; i < 8; ++i) + if (dyn->lsx.mmxcache[i] != -1) { + FST_D(dyn->lsx.mmxcache[i], xEmu, offsetof(x64emu_t, mmx[i])); + } +} + // SSE / SSE2 helpers // get lsx register for a SSE reg, create the entry if needed int sse_get_reg(dynarec_la64_t* dyn, int ninst, int s1, int a, int forwrite) { + dyn->lsx.xmm_used |= 1 << a; if (dyn->lsx.ssecache[a].v != -1) { if (forwrite) { dyn->lsx.ssecache[a].write = 1; // update only if forwrite @@ -775,21 +1352,34 @@ int sse_get_reg(dynarec_la64_t* dyn, int ninst, int s1, int a, int forwrite) } return dyn->lsx.ssecache[a].reg; } + int need_vld = 1; + // migrate from avx to sse + if (dyn->lsx.avxcache[a].v != -1) { + avx_reflect_reg_upper128(dyn, ninst, a, forwrite); + dyn->lsx.avxcache[a].v = -1; + need_vld = 0; + } dyn->lsx.ssecache[a].reg = fpu_get_reg_xmm(dyn, forwrite ? LSX_CACHE_XMMW : LSX_CACHE_XMMR, a); int ret = dyn->lsx.ssecache[a].reg; dyn->lsx.ssecache[a].write = forwrite; - VLD(ret, xEmu, offsetof(x64emu_t, xmm[a])); + if(need_vld) VLD(ret, xEmu, offsetof(x64emu_t, xmm[a])); //skip VLD if migrate from avx return ret; } // get lsx register for an SSE reg, but don't try to synch it if it needed to be created int sse_get_reg_empty(dynarec_la64_t* dyn, int ninst, int s1, int a) { + dyn->lsx.xmm_used |= 1 << a; if (dyn->lsx.ssecache[a].v != -1) { dyn->lsx.ssecache[a].write = 1; dyn->lsx.lsxcache[dyn->lsx.ssecache[a].reg].t = LSX_CACHE_XMMW; return dyn->lsx.ssecache[a].reg; } + // migrate from avx to sse + if (dyn->lsx.avxcache[a].v != -1) { + avx_reflect_reg_upper128(dyn, ninst, a, 1); + dyn->lsx.avxcache[a].v = -1; + } dyn->lsx.ssecache[a].reg = fpu_get_reg_xmm(dyn, LSX_CACHE_XMMW, a); dyn->lsx.ssecache[a].write = 1; // it will be write... return dyn->lsx.ssecache[a].reg; @@ -797,6 +1387,7 @@ int sse_get_reg_empty(dynarec_la64_t* dyn, int ninst, int s1, int a) // forget ext register for a SSE reg, does nothing if the regs is not loaded void sse_forget_reg(dynarec_la64_t* dyn, int ninst, int a) { + dyn->lsx.xmm_used |= 1 << a; if (dyn->lsx.ssecache[a].v == -1) return; if (dyn->lsx.lsxcache[dyn->lsx.ssecache[a].reg].t == LSX_CACHE_XMMW) { @@ -809,6 +1400,7 @@ void sse_forget_reg(dynarec_la64_t* dyn, int ninst, int a) void sse_reflect_reg(dynarec_la64_t* dyn, int ninst, int a) { + dyn->lsx.xmm_used |= 1 << a; if (dyn->lsx.ssecache[a].v == -1) return; if (dyn->lsx.lsxcache[dyn->lsx.ssecache[a].reg].t == LSX_CACHE_XMMW) { @@ -821,16 +1413,27 @@ void sse_purge07cache(dynarec_la64_t* dyn, int ninst, int s1) { int old = -1; for (int i = 0; i < 8; ++i) - if (dyn->lsx.ssecache[i].v != -1) { + if (dyn->lsx.ssecache[i].v != -1 || dyn->lsx.avxcache[i].v != -1) { if (old == -1) { MESSAGE(LOG_DUMP, "\tPurge XMM0..7 Cache ------\n"); ++old; } - if (dyn->lsx.lsxcache[dyn->lsx.ssecache[i].reg].t == LSX_CACHE_XMMW) { + dyn->lsx.xmm_used |= 1 << i; + if (dyn->lsx.lsxcache[dyn->lsx.avxcache[i].reg].t == LSX_CACHE_YMMW) { + VST(dyn->lsx.avxcache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + if(dyn->lsx.avxcache[i].zero_upper == 1){ + XVXOR_V(SCRATCH, SCRATCH, SCRATCH); + }else{ + XVPERMI_Q(SCRATCH, dyn->lsx.avxcache[i].reg, XVPERMI_IMM_4_0(0, 1)); + } + VST(SCRATCH, xEmu, offsetof(x64emu_t, ymm[i])); + fpu_free_reg(dyn, dyn->lsx.avxcache[i].reg); + dyn->lsx.avxcache[i].v = -1; + } else if (dyn->lsx.lsxcache[dyn->lsx.ssecache[i].reg].t == LSX_CACHE_XMMW) { VST(dyn->lsx.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + fpu_free_reg(dyn, dyn->lsx.ssecache[i].reg); + dyn->lsx.ssecache[i].v = -1; } - fpu_free_reg(dyn, dyn->lsx.ssecache[i].reg); - dyn->lsx.ssecache[i].v = -1; } if (old != -1) { MESSAGE(LOG_DUMP, "\t------ Purge XMM0..7 Cache\n"); @@ -843,6 +1446,7 @@ static void sse_purgecache(dynarec_la64_t* dyn, int ninst, int next, int s1) int old = -1; for (int i = 0; i < 16; ++i) if (dyn->lsx.ssecache[i].v != -1) { + if (next) dyn->lsx.xmm_used |= (1 << i); if (dyn->lsx.ssecache[i].write) { if (old == -1) { MESSAGE(LOG_DUMP, "\tPurge %sSSE Cache ------\n", next ? "locally " : ""); @@ -862,68 +1466,281 @@ static void sse_purgecache(dynarec_la64_t* dyn, int ninst, int next, int s1) static void sse_reflectcache(dynarec_la64_t* dyn, int ninst, int s1) { - for (int i=0; i<16; ++i) - if(dyn->lsx.ssecache[i].v!=-1 && dyn->lsx.ssecache[i].write) { - VST(dyn->lsx.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + for (int i = 0; i < 16; ++i) + if (dyn->lsx.ssecache[i].v != -1) { + dyn->lsx.xmm_used |= 1 << i; + if (dyn->lsx.ssecache[i].write) { + VST(dyn->lsx.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + } + } +} + +// AVX helpers +// get lasx register for a SSE reg, create the entry if needed +int avx_get_reg(dynarec_la64_t* dyn, int ninst, int s1, int a, int forwrite, int width) +{ + dyn->lsx.ymm_used |= 1 << a; + if (dyn->lsx.avxcache[a].v != -1) { + if (forwrite) { + dyn->lsx.avxcache[a].write = 1; // update only if forwrite + dyn->lsx.lsxcache[dyn->lsx.avxcache[a].reg].t = LSX_CACHE_YMMW; + } + if (width == LSX_AVX_WIDTH_128) { + dyn->lsx.avxcache[a].width = LSX_AVX_WIDTH_128; + if(forwrite) dyn->lsx.avxcache[a].zero_upper = 1; + } else { + // if width changed to 256, and vzeroup ==1, means need zero-fill upper 128bits now. + if (dyn->lsx.avxcache[a].zero_upper == 1) { + dyn->lsx.avxcache[a].zero_upper = 0; + XVXOR_V(SCRATCH, SCRATCH, SCRATCH); + XVPERMI_Q(dyn->lsx.avxcache[a].reg, SCRATCH, 0b00000010); + } + dyn->lsx.avxcache[a].width = LSX_AVX_WIDTH_256; + } + + return dyn->lsx.avxcache[a].reg; + } + + // migrate from sse to avx + if (dyn->lsx.ssecache[a].v != -1) { + // release SSE reg cache + fpu_free_reg(dyn, dyn->lsx.ssecache[a].reg); + dyn->lsx.ssecache[a].v = -1; + } + + // new reg + dyn->lsx.avxcache[a].v = 0; + dyn->lsx.avxcache[a].reg = fpu_get_reg_ymm(dyn, forwrite ? LSX_CACHE_YMMW : LSX_CACHE_YMMR, a); + int ret = dyn->lsx.avxcache[a].reg; + dyn->lsx.avxcache[a].write = forwrite; + dyn->lsx.avxcache[a].width = width; + if (width == LSX_AVX_WIDTH_128) { + if(forwrite) dyn->lsx.avxcache[a].zero_upper = 1; + VLD(ret, xEmu, offsetof(x64emu_t, xmm[a])); + } else { + VLD(ret, xEmu, offsetof(x64emu_t, xmm[a])); + VLD(SCRATCH, xEmu, offsetof(x64emu_t, ymm[a])); + XVPERMI_Q(ret, SCRATCH, XVPERMI_IMM_4_0(0, 2)); + dyn->lsx.avxcache[a].zero_upper = 0; + } + return ret; +} + +int avx_get_reg_empty(dynarec_la64_t* dyn, int ninst, int s1, int a, int width) +{ + dyn->lsx.ymm_used |= 1 << a; + if (dyn->lsx.avxcache[a].v != -1) { + dyn->lsx.avxcache[a].write = 1; + dyn->lsx.lsxcache[dyn->lsx.avxcache[a].reg].t = LSX_CACHE_YMMW; + if (width == LSX_AVX_WIDTH_128) { + dyn->lsx.avxcache[a].width = LSX_AVX_WIDTH_128; + dyn->lsx.avxcache[a].zero_upper = 1; + } else { + dyn->lsx.avxcache[a].width = LSX_AVX_WIDTH_256; + dyn->lsx.avxcache[a].zero_upper = 0; + } + return dyn->lsx.avxcache[a].reg; + } + // migrate from sse to avx + if (dyn->lsx.ssecache[a].v != -1) { + // Release SSE reg cache + fpu_free_reg(dyn, dyn->lsx.ssecache[a].reg); + dyn->lsx.ssecache[a].v = -1; + } + dyn->lsx.avxcache[a].v = 0; + dyn->lsx.avxcache[a].reg = fpu_get_reg_ymm(dyn, LSX_CACHE_YMMW, a); + dyn->lsx.avxcache[a].write = 1; + dyn->lsx.avxcache[a].width = width; + if (width == LSX_AVX_WIDTH_128){ + dyn->lsx.avxcache[a].zero_upper = 1; + } else { + dyn->lsx.avxcache[a].zero_upper = 0; + } + return dyn->lsx.avxcache[a].reg; +} + +void avx_reflect_reg_upper128(dynarec_la64_t* dyn, int ninst, int a, int forwrite) +{ + dyn->lsx.ymm_used |= 1 << a; + if (dyn->lsx.avxcache[a].v == -1 || forwrite == 0) + return; + if (dyn->lsx.lsxcache[dyn->lsx.avxcache[a].reg].t == LSX_CACHE_YMMW) { + if (dyn->lsx.avxcache[a].zero_upper == 1) { + XVXOR_V(SCRATCH, SCRATCH, SCRATCH); + } else { + XVPERMI_Q(SCRATCH, dyn->lsx.avxcache[a].reg, XVPERMI_IMM_4_0(0, 1)); + } + VST(SCRATCH, xEmu, offsetof(x64emu_t, ymm[a])); + } + dyn->lsx.avxcache[a].v = -1; + return; +} + +void avx_forget_reg(dynarec_la64_t* dyn, int ninst, int a) +{ + dyn->lsx.ymm_used |= 1 << a; + if (dyn->lsx.avxcache[a].v == -1) + return; + if (dyn->lsx.lsxcache[dyn->lsx.avxcache[a].reg].t == LSX_CACHE_YMMW) { + VST(dyn->lsx.avxcache[a].reg, xEmu, offsetof(x64emu_t, xmm[a])); + if (dyn->lsx.avxcache[a].zero_upper == 1) { + XVXOR_V(SCRATCH, SCRATCH, SCRATCH); + } else { + XVPERMI_Q(SCRATCH, dyn->lsx.avxcache[a].reg, XVPERMI_IMM_4_0(0, 1)); + } + VST(SCRATCH, xEmu, offsetof(x64emu_t, ymm[a])); + } + fpu_free_reg(dyn, dyn->lsx.avxcache[a].reg); + dyn->lsx.avxcache[a].v = -1; + return; +} + +void avx_reflect_reg(dynarec_la64_t* dyn, int ninst, int a) +{ + dyn->lsx.ymm_used |= 1 << a; + if (dyn->lsx.avxcache[a].v == -1) + return; + if (dyn->lsx.lsxcache[dyn->lsx.avxcache[a].reg].t == LSX_CACHE_YMMW) { + VST(dyn->lsx.avxcache[a].reg, xEmu, offsetof(x64emu_t, xmm[a])); + if (dyn->lsx.avxcache[a].zero_upper == 1) { + XVXOR_V(SCRATCH, SCRATCH, SCRATCH); + XVPERMI_Q(dyn->lsx.avxcache[a].reg, SCRATCH, 0b00000010); + } else { + XVPERMI_Q(SCRATCH, dyn->lsx.avxcache[a].reg, XVPERMI_IMM_4_0(0, 1)); + } + VST(SCRATCH, xEmu, offsetof(x64emu_t, ymm[a])); + dyn->lsx.avxcache[a].zero_upper = 0; + } +} + +// purge the AVX cache only +static void avx_purgecache(dynarec_la64_t* dyn, int ninst, int next, int s1) +{ + int old = -1; + for (int i = 0; i < 16; ++i) + if (dyn->lsx.avxcache[i].v != -1) { + dyn->lsx.ymm_used |= 1 << i; + if (dyn->lsx.avxcache[i].write) { + if (old == -1) { + MESSAGE(LOG_DUMP, "\tPurge %sAVX Cache ------\n", next ? "locally " : ""); + ++old; + } + if (dyn->lsx.lsxcache[dyn->lsx.avxcache[i].reg].t == LSX_CACHE_YMMW) { + VST(dyn->lsx.avxcache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + if (dyn->lsx.avxcache[i].zero_upper == 1) { + XVXOR_V(SCRATCH, SCRATCH, SCRATCH); + } else { + XVPERMI_Q(SCRATCH, dyn->lsx.avxcache[i].reg, XVPERMI_IMM_4_0(0, 1)); + } + VST(SCRATCH, xEmu, offsetof(x64emu_t, ymm[i])); + } + } + if (!next) { + fpu_free_reg(dyn, dyn->lsx.avxcache[i].reg); + dyn->lsx.avxcache[i].v = -1; + } + } + if (old != -1) { + MESSAGE(LOG_DUMP, "\t------ Purge AVX Cache\n"); + } +} + +static void avx_reflectcache(dynarec_la64_t* dyn, int ninst, int s1) +{ + for (int i = 0; i < 16; ++i) { + if (dyn->lsx.avxcache[i].v != -1) { + dyn->lsx.ymm_used |= 1 << i; + if (dyn->lsx.avxcache[i].write) { + if (dyn->lsx.lsxcache[dyn->lsx.avxcache[i].reg].t == LSX_CACHE_YMMW) { + avx_reflect_reg(dyn, ninst, i); + } + } } + } } void fpu_pushcache(dynarec_la64_t* dyn, int ninst, int s1, int not07) { int start = not07 ? 8 : 0; - // only SSE regs needs to be push back to xEmu (needs to be "write") int n = 0; - for (int i = start; i < 16; i++) + + for (int i = start; i < 16; i++) { if ((dyn->lsx.ssecache[i].v != -1) && (dyn->lsx.ssecache[i].write)) ++n; - if (!n) - return; - MESSAGE(LOG_DUMP, "\tPush XMM Cache (%d)------\n", n); - for (int i = start; i < 16; ++i) - if ((dyn->lsx.ssecache[i].v != -1) && (dyn->lsx.ssecache[i].write)) { - VST(dyn->lsx.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + if ((dyn->lsx.avxcache[i].v != -1) && (dyn->lsx.avxcache[i].write)) + ++n; + } + + if (n) { + MESSAGE(LOG_DUMP, "\tPush XMM/YMM Cache (%d)------\n", n); + for (int i = start; i < 16; ++i) { + if ((dyn->lsx.ssecache[i].v != -1) && (dyn->lsx.ssecache[i].write)) { + VST(dyn->lsx.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + } + if ((dyn->lsx.avxcache[i].v != -1) && (dyn->lsx.avxcache[i].write)) { + VST(dyn->lsx.avxcache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + if (dyn->lsx.avxcache[i].zero_upper == 0) { + XVPERMI_Q(SCRATCH, dyn->lsx.avxcache[i].reg, XVPERMI_IMM_4_0(0, 1)); + VST(SCRATCH, xEmu, offsetof(x64emu_t, ymm[i])); + } + } } - MESSAGE(LOG_DUMP, "\t------- Push XMM Cache (%d)\n", n); + MESSAGE(LOG_DUMP, "\t------- Pushed XMM/YMM Cache (%d)\n", n); + } } void fpu_popcache(dynarec_la64_t* dyn, int ninst, int s1, int not07) { int start = not07 ? 8 : 0; - // only SSE regs needs to be pop back from xEmu (don't need to be "write" this time) int n = 0; - for (int i = start; i < 16; i++) - if (dyn->lsx.ssecache[i].v != -1) + + for (int i = start; i < 16; i++) { + if (dyn->lsx.ssecache[i].v != -1 || dyn->lsx.avxcache[i].v != -1) ++n; - if (!n) - return; - MESSAGE(LOG_DUMP, "\tPop XMM Cache (%d)------\n", n); - for (int i = start; i < 16; ++i) - if (dyn->lsx.ssecache[i].v != -1) { - VLD(dyn->lsx.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + } + + if (n) { + MESSAGE(LOG_DUMP, "\tPop XMM/YMM Cache (%d)------\n", n); + for (int i = start; i < 16; ++i) { + if (dyn->lsx.ssecache[i].v != -1) { + VLD(dyn->lsx.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + } + if (dyn->lsx.avxcache[i].v != -1) { + VLD(dyn->lsx.avxcache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); + if (dyn->lsx.avxcache[i].zero_upper == 0) { + VLD(SCRATCH, xEmu, offsetof(x64emu_t, ymm[i])); + XVPERMI_Q(dyn->lsx.avxcache[i].reg, SCRATCH, XVPERMI_IMM_4_0(0, 2)); + } + } } - MESSAGE(LOG_DUMP, "\t------- Pop XMM Cache (%d)\n", n); + MESSAGE(LOG_DUMP, "\t------- Pop XMM/YMM Cache (%d)\n", n); + } } void fpu_purgecache(dynarec_la64_t* dyn, int ninst, int next, int s1, int s2, int s3) { - // TODO: x87_purgecache(dyn, ninst, next, s1, s2, s3); - // TODO: mmx_purgecache(dyn, ninst, next, s1); - + x87_purgecache(dyn, ninst, next, s1, s2, s3); + mmx_purgecache(dyn, ninst, next, s1); sse_purgecache(dyn, ninst, next, s1); - if (!next) + avx_purgecache(dyn, ninst, next, s1); + if (!next) { fpu_reset_reg(dyn); + dyn->insts[ninst].fpupurge = 1; + } } void fpu_reflectcache(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3) { - // TODO: x87_reflectcache(dyn, ninst, s1, s2, s3); - // TODO: mmx_reflectcache(dyn, ninst, s1); + x87_reflectcache(dyn, ninst, s1, s2, s3); + mmx_reflectcache(dyn, ninst, s1); sse_reflectcache(dyn, ninst, s1); + avx_reflectcache(dyn, ninst, s1); } void fpu_unreflectcache(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3) { - // TODO + // need to undo the top and stack tracking that must not be reflected permanently yet + x87_unreflectcount(dyn, ninst, s1, s2); } void emit_pf(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4) @@ -947,16 +1764,46 @@ void emit_pf(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4) void fpu_reset_cache(dynarec_la64_t* dyn, int ninst, int reset_n) { MESSAGE(LOG_DEBUG, "Reset Caches with %d\n", reset_n); -#if STEP > 1 - // for STEP 2 & 3, just need to refrest with current, and undo the changes (push & swap) + #if STEP > 1 + // for STEP 2 & 3, just need to refresh with current, and undo the changes (push & swap) dyn->lsx = dyn->insts[ninst].lsx; lsxcacheUnwind(&dyn->lsx); -#ifdef HAVE_TRACE -// TODO: trace -#endif // HAVE_TRACE #else - dyn->lsx = dyn->insts[reset_n].lsx; +dyn->lsx = dyn->insts[reset_n].lsx; #endif +#if STEP == 0 + if(dyn->need_dump && dyn->lsx.x87stack) dynarec_log(LOG_NONE, "New x87stack=%d at ResetCache in inst %d with %d\n", dyn->lsx.x87stack, ninst, reset_n); +#endif +#if defined(HAVE_TRACE) && (STEP > 2) + if (dyn->need_dump && 0) // disable for now + if (memcmp(&dyn->lsx, &dyn->insts[reset_n].lsx, sizeof(lsx_cache_t))) { + MESSAGE(LOG_DEBUG, "Warning, difference in lsxcache: reset="); + for (int i = 0; i < 24; ++i) + if (dyn->insts[reset_n].lsx.lsxcache[i].v) + MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->insts[reset_n].lsx.lsxcache[i].t, dyn->insts[reset_n].lsx.lsxcache[i].n)); + if (dyn->insts[reset_n].lsx.combined1 || dyn->insts[reset_n].lsx.combined2) + MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->insts[reset_n].lsx.swapped ? "SWP" : "CMB", dyn->insts[reset_n].lsx.combined1, dyn->insts[reset_n].lsx.combined2); + if (dyn->insts[reset_n].lsx.stack_push || dyn->insts[reset_n].lsx.stack_pop) + MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->insts[reset_n].lsx.stack_push, -dyn->insts[reset_n].lsx.stack_pop); + MESSAGE(LOG_DEBUG, " ==> "); + for (int i = 0; i < 24; ++i) + if (dyn->insts[ninst].lsx.lsxcache[i].v) + MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->insts[ninst].lsx.lsxcache[i].t, dyn->insts[ninst].lsx.lsxcache[i].n)); + if (dyn->insts[ninst].lsx.combined1 || dyn->insts[ninst].lsx.combined2) + MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->insts[ninst].lsx.swapped ? "SWP" : "CMB", dyn->insts[ninst].lsx.combined1, dyn->insts[ninst].lsx.combined2); + if (dyn->insts[ninst].lsx.stack_push || dyn->insts[ninst].lsx.stack_pop) + MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->insts[ninst].lsx.stack_push, -dyn->insts[ninst].lsx.stack_pop); + MESSAGE(LOG_DEBUG, " -> "); + for (int i = 0; i < 24; ++i) + if (dyn->lsx.lsxcache[i].v) + MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->lsx.lsxcache[i].t, dyn->lsx.lsxcache[i].n)); + if (dyn->lsx.combined1 || dyn->lsx.combined2) + MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->lsx.swapped ? "SWP" : "CMB", dyn->lsx.combined1, dyn->lsx.combined2); + if (dyn->lsx.stack_push || dyn->lsx.stack_pop) + MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->lsx.stack_push, -dyn->lsx.stack_pop); + MESSAGE(LOG_DEBUG, "\n"); + } +#endif // HAVE_TRACE } // propagate ST stack state, especial stack pop that are deferred @@ -1017,6 +1864,14 @@ static int findCacheSlot(dynarec_la64_t* dyn, int ninst, int t, int n, lsxcache_ if (t == LSX_CACHE_XMMR) return i; break; + case LSX_CACHE_YMMR: + if (t == LSX_CACHE_YMMW) + return i; + break; + case LSX_CACHE_YMMW: + if (t == LSX_CACHE_YMMR) + return i; + break; } } } @@ -1032,15 +1887,25 @@ static void swapCache(dynarec_la64_t* dyn, int ninst, int i, int j, lsxcache_t* quad = 1; if (cache->lsxcache[j].t == LSX_CACHE_XMMR || cache->lsxcache[j].t == LSX_CACHE_XMMW) quad = 1; + if (cache->lsxcache[i].t == LSX_CACHE_YMMR || cache->lsxcache[i].t == LSX_CACHE_YMMW) + quad = 2; + if (cache->lsxcache[j].t == LSX_CACHE_YMMR || cache->lsxcache[j].t == LSX_CACHE_YMMW) + quad = 2; if (!cache->lsxcache[i].v) { // a mov is enough, no need to swap MESSAGE(LOG_DUMP, "\t - Moving %d <- %d\n", i, j); - if (quad) { - VOR_V(i, j, j); - } else { - VXOR_V(i, i, i); - VEXTRINS_D(i, j, 0); + switch (quad) { + case 2: + XVOR_V(i, j, j); + break; + case 1: + VOR_V(i, j, j); + break; + default: + VXOR_V(i, i, i); + VEXTRINS_D(i, j, 0); + break; } cache->lsxcache[i].v = cache->lsxcache[j].v; cache->lsxcache[j].v = 0; @@ -1051,17 +1916,25 @@ static void swapCache(dynarec_la64_t* dyn, int ninst, int i, int j, lsxcache_t* MESSAGE(LOG_DUMP, "\t - Swapping %d <-> %d\n", i, j); // There is no VSWP in Arm64 NEON to swap 2 register contents! // so use a scratch... - if (quad) { - VOR_V(SCRATCH, i, i); - VOR_V(i, j, j); - VOR_V(j, SCRATCH, SCRATCH); - } else { - VXOR_V(SCRATCH, SCRATCH, SCRATCH); - VEXTRINS_D(SCRATCH, i, 0); - VXOR_V(i, i, i); - VEXTRINS_D(i, j, 0); - VXOR_V(j, j, j); - VEXTRINS_D(j, SCRATCH, 0); + switch (quad) { + case 2: + XVOR_V(SCRATCH, i, i); + XVOR_V(i, j, j); + XVOR_V(j, SCRATCH, SCRATCH); + break; + case 1: + VOR_V(SCRATCH, i, i); + VOR_V(i, j, j); + VOR_V(j, SCRATCH, SCRATCH); + break; + default: + VXOR_V(SCRATCH, SCRATCH, SCRATCH); + VEXTRINS_D(SCRATCH, i, 0); + VXOR_V(i, i, i); + VEXTRINS_D(i, j, 0); + VXOR_V(j, j, j); + VEXTRINS_D(j, SCRATCH, 0); + break; } tmp.v = cache->lsxcache[i].v; cache->lsxcache[i].v = cache->lsxcache[j].v; @@ -1074,21 +1947,38 @@ static void loadCache(dynarec_la64_t* dyn, int ninst, int stack_cnt, int s1, int int quad = 0; if (t == LSX_CACHE_XMMR || t == LSX_CACHE_XMMW) quad = 1; + if (t == LSX_CACHE_YMMR || t == LSX_CACHE_YMMW) + quad = 2; if (cache->lsxcache[i].t == LSX_CACHE_XMMR || cache->lsxcache[i].t == LSX_CACHE_XMMW) quad = 1; + if (cache->lsxcache[i].t == LSX_CACHE_YMMR || cache->lsxcache[i].t == LSX_CACHE_YMMW) + quad = 2; int j = i + 1; while (cache->lsxcache[j].v) ++j; MESSAGE(LOG_DUMP, "\t - Moving away %d\n", i); - if (quad) { - VOR_V(j, i, i); - } else { - VXOR_V(j, j, j); - VEXTRINS_D(j, i, 0); + switch (quad) { + case 2: + XVOR_V(j, i, i); + break; + case 1: + VOR_V(j, i, i); + break; + default: + VXOR_V(j, j, j); + VEXTRINS_D(j, i, 0); + break; } cache->lsxcache[j].v = cache->lsxcache[i].v; } switch (t) { + case LSX_CACHE_YMMR: + case LSX_CACHE_YMMW: + MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n)); + VLD(i, xEmu, offsetof(x64emu_t, xmm[n])); + VLD(SCRATCH, xEmu, offsetof(x64emu_t, ymm[n])); + XVPERMI_Q(i, SCRATCH, XVPERMI_IMM_4_0(0, 2)); + break; case LSX_CACHE_XMMR: case LSX_CACHE_XMMW: MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n)); @@ -1104,7 +1994,26 @@ static void loadCache(dynarec_la64_t* dyn, int ninst, int stack_cnt, int s1, int case LSX_CACHE_ST_F: case LSX_CACHE_ST_I64: MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n)); - // TODO: x87 + if ((*s3_top) == 0xffff) { + LD_W(s3, xEmu, offsetof(x64emu_t, top)); + *s3_top = 0; + } + int a = n - (*s3_top) - stack_cnt; + if (a) { + ADDI_D(s3, s3, a); + ANDI(s3, s3, 7); // (emu->top + i)&7 + } + *s3_top += a; + *s2_val = 0; + SLLI_D(s2, s3, 3); + ADD_D(s2, xEmu, s2); + FLD_D(i, s2, offsetof(x64emu_t, x87)); + if (t == LSX_CACHE_ST_F) { + FCVT_S_D(i, i); + } + if (t == LSX_CACHE_ST_I64) { + FTINTRZ_L_D(i, i); + } break; case LSX_CACHE_NONE: case LSX_CACHE_SCR: @@ -1120,12 +2029,19 @@ static void unloadCache(dynarec_la64_t* dyn, int ninst, int stack_cnt, int s1, i { switch (t) { case LSX_CACHE_XMMR: + case LSX_CACHE_YMMR: MESSAGE(LOG_DUMP, "\t - ignoring %s\n", getCacheName(t, n)); break; case LSX_CACHE_XMMW: MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n)); VST(i, xEmu, offsetof(x64emu_t, xmm[n])); break; + case LSX_CACHE_YMMW: + MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n)); + XVPERMI_Q(SCRATCH, i, XVPERMI_IMM_4_0(0, 1)); + VST(i, xEmu, offsetof(x64emu_t, xmm[n])); + VST(SCRATCH, xEmu, offsetof(x64emu_t, ymm[n])); + break; case LSX_CACHE_MM: MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n)); FST_D(i, xEmu, offsetof(x64emu_t, mmx[n])); @@ -1134,7 +2050,26 @@ static void unloadCache(dynarec_la64_t* dyn, int ninst, int stack_cnt, int s1, i case LSX_CACHE_ST_F: case LSX_CACHE_ST_I64: MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n)); - // TODO: x87 + if ((*s3_top) == 0xffff) { + LD_W(s3, xEmu, offsetof(x64emu_t, top)); + *s3_top = 0; + } + int a = n - (*s3_top) - stack_cnt; + if (a) { + ADDI_D(s3, s3, a); + ANDI(s3, s3, 7); + } + *s3_top += a; + SLLI_D(s2, s3, 3); + ADD_D(s2, xEmu, s2); + *s2_val = 0; + if (t == LSX_CACHE_ST_F) { + FCVT_D_S(i, i); + } + if (t == LSX_CACHE_ST_I64) { + FFINT_D_L(i, i); + } + FST_D(i, s2, offsetof(x64emu_t, x87)); break; case LSX_CACHE_NONE: case LSX_CACHE_SCR: @@ -1147,7 +2082,6 @@ static void unloadCache(dynarec_la64_t* dyn, int ninst, int stack_cnt, int s1, i static void fpuCacheTransform(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3) { -#if STEP > 1 int i2 = dyn->insts[ninst].x64.jmp_insts; if (i2 < 0) return; @@ -1183,18 +2117,16 @@ static void fpuCacheTransform(dynarec_la64_t* dyn, int ninst, int s1, int s2, in } int stack_cnt = dyn->lsx.stack_next; int s3_top = 0xffff; - if (stack_cnt != cache_i2.stack) { - MESSAGE(LOG_DUMP, "\t - adjust stack count %d -> %d -\n", stack_cnt, cache_i2.stack); - int a = stack_cnt - cache_i2.stack; - // TODO: x87 - s3_top = 0; - stack_cnt = cache_i2.stack; - } lsxcache_t cache = dyn->lsx; int s1_val = 0; int s2_val = 0; - // unload every uneeded cache - // check SSE first, than MMX, in order, for optimisation issue + // unload every unneeded cache + // check SSE first, than MMX, in order, for optimization issue + for (int i = 0; i < 16; ++i) { + int j = findCacheSlot(dyn, ninst, LSX_CACHE_YMMW, i, &cache); + if (j >= 0 && findCacheSlot(dyn, ninst, LSX_CACHE_YMMW, i, &cache_i2) == -1) + unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, j, cache.lsxcache[j].t, cache.lsxcache[j].n); + } for (int i = 0; i < 16; ++i) { int j = findCacheSlot(dyn, ninst, LSX_CACHE_XMMW, i, &cache); if (j >= 0 && findCacheSlot(dyn, ninst, LSX_CACHE_XMMW, i, &cache_i2) == -1) @@ -1250,6 +2182,15 @@ static void fpuCacheTransform(dynarec_la64_t* dyn, int ninst, int s1, int s2, in cache.lsxcache[i].t = LSX_CACHE_ST_D; } else if (cache.lsxcache[i].t == LSX_CACHE_XMMR && cache_i2.lsxcache[i].t == LSX_CACHE_XMMW) { cache.lsxcache[i].t = LSX_CACHE_XMMW; + } else if (cache.lsxcache[i].t == LSX_CACHE_YMMR && cache_i2.lsxcache[i].t == LSX_CACHE_YMMW) { + cache.lsxcache[i].t = LSX_CACHE_YMMW; + } else if (cache.lsxcache[i].t == LSX_CACHE_YMMW && cache_i2.lsxcache[i].t == LSX_CACHE_YMMR) { + // refresh cache... + MESSAGE(LOG_DUMP, "\t - Refreh %s\n", getCacheName(cache.lsxcache[i].t, cache.lsxcache[i].n)); + XVPERMI_Q(SCRATCH, i, XVPERMI_IMM_4_0(0, 1)); + VST(i, xEmu, offsetof(x64emu_t, xmm[cache.lsxcache[i].n])); + VST(SCRATCH, xEmu, offsetof(x64emu_t, ymm[cache.lsxcache[i].n])); + cache.lsxcache[i].t = LSX_CACHE_YMMR; } else if (cache.lsxcache[i].t == LSX_CACHE_XMMW && cache_i2.lsxcache[i].t == LSX_CACHE_XMMR) { // refresh cache... MESSAGE(LOG_DUMP, "\t - Refreh %s\n", getCacheName(cache.lsxcache[i].t, cache.lsxcache[i].n)); @@ -1259,58 +2200,85 @@ static void fpuCacheTransform(dynarec_la64_t* dyn, int ninst, int s1, int s2, in } } } + if (stack_cnt != cache_i2.stack) { + MESSAGE(LOG_DUMP, "\t - adjust stack count %d -> %d -\n", stack_cnt, cache_i2.stack); + int a = stack_cnt - cache_i2.stack; + // Add x87stack to emu fpu_stack + LD_WU(s3, xEmu, offsetof(x64emu_t, fpu_stack)); + ADDI_D(s3, s3, a); + ST_W(s3, xEmu, offsetof(x64emu_t, fpu_stack)); + // Sub x87stack to top, with and 7 + LD_WU(s3, xEmu, offsetof(x64emu_t, top)); + ADDI_D(s3, s3, -a); + ANDI(s3, s3, 7); + ST_W(s3, xEmu, offsetof(x64emu_t, top)); + // update tags + LD_H(s2, xEmu, offsetof(x64emu_t, fpu_tags)); + if (a > 0) { + SLLI_D(s2, s2, a * 2); + } else { + MOV32w(s3, 0xffff0000); + OR(s2, s2, s3); + SRLI_D(s2, s2, -a * 2); + } + ST_H(s2, xEmu, offsetof(x64emu_t, fpu_tags)); + s3_top = 0; + stack_cnt = cache_i2.stack; + } MESSAGE(LOG_DUMP, "\t---- Cache Transform\n"); -#endif } static void flagsCacheTransform(dynarec_la64_t* dyn, int ninst, int s1) { -#if STEP > 1 int j64; int jmp = dyn->insts[ninst].x64.jmp_insts; - if(jmp<0) + if (jmp < 0) return; - if(dyn->f.dfnone) // flags are fully known, nothing we can do more + if (dyn->insts[jmp].f_exit == dyn->insts[jmp].f_entry) // flags will be fully known, nothing we can do more return; MESSAGE(LOG_DUMP, "\tFlags fetch ---- ninst=%d -> %d\n", ninst, jmp); - int go = (dyn->insts[jmp].f_entry.dfnone && !dyn->f.dfnone)?1:0; - switch (dyn->insts[jmp].f_entry.pending) { - case SF_UNKNOWN: break; - case SF_SET: - if(dyn->f.pending!=SF_SET && dyn->f.pending!=SF_SET_PENDING) - go = 1; + int go_fetch = 0; + switch (dyn->insts[jmp].f_entry) { + case status_unk: + if (dyn->insts[ninst].f_exit == status_none_pending) { + FORCE_DFNONE(); + } + break; + case status_set: + if (dyn->insts[ninst].f_exit == status_none_pending) { + FORCE_DFNONE(); + } + if (dyn->insts[ninst].f_exit == status_unk) + go_fetch = 1; break; - case SF_SET_PENDING: - if(dyn->f.pending!=SF_SET - && dyn->f.pending!=SF_SET_PENDING - && dyn->f.pending!=SF_PENDING) - go = 1; + case status_none_pending: + if (dyn->insts[ninst].f_exit != status_none) + go_fetch = 1; break; - case SF_PENDING: - if(dyn->f.pending!=SF_SET - && dyn->f.pending!=SF_SET_PENDING - && dyn->f.pending!=SF_PENDING) - go = 1; - else if (dyn->insts[jmp].f_entry.dfnone !=dyn->f.dfnone) - go = 1; + case status_none: + if (dyn->insts[ninst].f_exit == status_none_pending) { + FORCE_DFNONE(); + } else + go_fetch = 1; break; } - if(go) { - if(dyn->f.pending!=SF_PENDING) { - LD_W(s1, xEmu, offsetof(x64emu_t, df)); - j64 = (GETMARKF2)-(dyn->native_size); + if (go_fetch) { + if (dyn->f == status_unk) { + LD_WU(s1, xEmu, offsetof(x64emu_t, df)); + j64 = (GETMARKF2) - (dyn->native_size); BEQZ(s1, j64); } - CALL_(UpdateFlags, -1, 0); + CALL_(const_updateflags, -1, 0, 0, 0); MARKF2; } -#endif + MESSAGE(LOG_DUMP, "\t---- Flags fetch\n"); } -void CacheTransform(dynarec_la64_t* dyn, int ninst, int cacheupd, int s1, int s2, int s3) { - if(cacheupd&2) +void CacheTransform(dynarec_la64_t* dyn, int ninst, int cacheupd, int s1, int s2, int s3) +{ + if (cacheupd & 2) fpuCacheTransform(dyn, ninst, s1, s2, s3); - if(cacheupd&1) + if (cacheupd & 1) flagsCacheTransform(dyn, ninst, s1); } @@ -1340,4 +2308,4 @@ void la64_move64(dynarec_la64_t* dyn, int ninst, int reg, int64_t val) return; } LU52I_D(reg, reg, (val >> 52) & 0xfff); -} \ No newline at end of file +} diff --git a/src/dynarec/la64/dynarec_la64_helper.h b/src/dynarec/la64/dynarec_la64_helper.h index 2bfff82..73ba1f5 100644 --- a/src/dynarec/la64/dynarec_la64_helper.h +++ b/src/dynarec/la64/dynarec_la64_helper.h @@ -17,6 +17,7 @@ #include "debug.h" #include "la64_emitter.h" #include "../emu/x64primop.h" +#include "dynarec_la64_consts.h" #define F8 *(uint8_t*)(addr++) #define F8S *(int8_t*)(addr++) @@ -24,7 +25,7 @@ #define F16S *(int16_t*)(addr += 2, addr - 2) #define F32 *(uint32_t*)(addr += 4, addr - 4) #define F32S *(int32_t*)(addr += 4, addr - 4) -#define F32S64 (uint64_t)(int64_t) F32S +#define F32S64 (uint64_t)(int64_t)F32S #define F64 *(uint64_t*)(addr += 8, addr - 8) #define PK(a) *(uint8_t*)(addr + a) #define PK16(a) *(uint16_t*)(addr + a) @@ -32,67 +33,24 @@ #define PK64(a) *(uint64_t*)(addr + a) #define PKip(a) *(uint8_t*)(ip + a) -// Strong mem emulation helpers -#define SMREAD_MIN 2 -#define SMWRITE_MIN 1 -// Sequence of Read will trigger a DMB on "first" read if strongmem is >= SMREAD_MIN -// Sequence of Write will trigger a DMB on "last" write if strongmem is >= 1 -// All Write operation that might use a lock all have a memory barrier if strongmem is >= SMWRITE_MIN -// Opcode will read -#define SMREAD() \ - if ((dyn->smread == 0) && (box64_dynarec_strongmem > SMREAD_MIN)) { \ - SMDMB(); \ - } else \ - dyn->smread = 1 -// Opcode will read with option forced lock -#define SMREADLOCK(lock) \ - if ((lock) || ((dyn->smread == 0) && (box64_dynarec_strongmem > SMREAD_MIN))) { SMDMB(); } -// Opcode might read (depend on nextop) -#define SMMIGHTREAD() \ - if (!MODREG) { SMREAD(); } -// Opcode has wrote -#define SMWRITE() dyn->smwrite = 1 -// Opcode has wrote (strongmem>1 only) -#define SMWRITE2() \ - if (box64_dynarec_strongmem > SMREAD_MIN) dyn->smwrite = 1 -// Opcode has wrote with option forced lock -#define SMWRITELOCK(lock) \ - if (lock || (box64_dynarec_strongmem > SMWRITE_MIN)) { \ - SMDMB(); \ - } else \ - dyn->smwrite = 1 -// Opcode might have wrote (depend on nextop) -#define SMMIGHTWRITE() \ - if (!MODREG) { SMWRITE(); } -// Start of sequence -#define SMSTART() SMEND() -// End of sequence -#define SMEND() \ - if (dyn->smwrite && box64_dynarec_strongmem) { DBAR(0); } \ - dyn->smwrite = 0; \ - dyn->smread = 0; -// Force a Data memory barrier (for LOCK: prefix) -#define SMDMB() \ - DBAR(0); \ - dyn->smwrite = 0; \ - dyn->smread = 1 - // LOCK_* define #define LOCK_LOCK (int*)1 // GETGD get x64 register in gd -#define GETGD gd = TO_LA64(((nextop & 0x38) >> 3) + (rex.r << 3)); +#define GETGD gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); +// GETVD get x64 register in vd +#define GETVD vd = TO_NAT(vex.v) // GETGW extract x64 register in gd, that is i -#define GETGW(i) \ - gd = TO_LA64(((nextop & 0x38) >> 3) + (rex.r << 3)); \ - BSTRPICK_D(i, gd, 15, 0); \ +#define GETGW(i) \ + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + BSTRPICK_D(i, gd, 15, 0); \ gd = i; // GETED can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI #define GETED(D) \ if (MODREG) { \ - ed = TO_LA64((nextop & 7) + (rex.b << 3)); \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ wback = 0; \ } else { \ SMREAD(); \ @@ -103,7 +61,7 @@ #define GETEDz(D) \ if (MODREG) { \ - ed = TO_LA64((nextop & 7) + (rex.b << 3)); \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ wback = 0; \ } else { \ SMREAD(); \ @@ -111,32 +69,33 @@ LDz(x1, wback, fixedaddress); \ ed = x1; \ } -// GETED32 can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI -#define GETED32(D) \ - if (MODREG) { \ - ed = TO_LA64((nextop & 7) + (rex.b << 3)); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted32(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, D); \ - LDxw(x1, wback, fixedaddress); \ - ed = x1; \ + +// GETEDH can use hint for wback and ret for ed. wback is 0 if ed is xEAX..xEDI +#define GETEDH(hint, ret, D) \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wback = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, hint, ret, &fixedaddress, rex, NULL, 1, D); \ + ed = ret; \ + LDxw(ed, wback, fixedaddress); \ } -// GETEDH can use hint for ed, and x1 or x2 for wback (depending on hint), might also use x3. wback is 0 if ed is xEAX..xEDI -#define GETEDH(hint, D) \ - if (MODREG) { \ - ed = TO_LA64((nextop & 7) + (rex.b << 3)); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, (hint == x2) ? x1 : x2, (hint == x1) ? x1 : x3, &fixedaddress, rex, NULL, 1, D); \ - LDxw(hint, wback, fixedaddress); \ - ed = hint; \ +#define GETEDW(hint, ret, D) \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + MV(ret, ed); \ + wback = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, hint, ret, &fixedaddress, rex, NULL, 0, D); \ + ed = ret; \ + LDxw(ed, wback, fixedaddress); \ } // GETEWW will use i for ed, and can use w for wback. #define GETEWW(w, i, D) \ if (MODREG) { \ - wback = TO_LA64((nextop & 7) + (rex.b << 3)); \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ BSTRPICK_D(i, wback, 15, 0); \ ed = i; \ wb1 = 0; \ @@ -150,22 +109,23 @@ // GETEW will use i for ed, and can use r3 for wback. #define GETEW(i, D) GETEWW(x3, i, D) -// GETEDO can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI -#define GETEDO(O, D) \ - if (MODREG) { \ - ed = TO_LA64((nextop & 7) + (rex.b << 3)); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 0, D); \ - LDXxw(x1, wback, O); \ - ed = x1; \ +#define GETGWEW(i, j, D) \ + GETEW(j, D); \ + if (MODREG) { \ + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + if (gd == wback) \ + gd = ed; \ + else { \ + GETGW(i); \ + } \ + } else { \ + GETGW(i); \ } // GETSED can use r1 for ed, and r2 for wback. ed will be sign extended! #define GETSED(D) \ if (MODREG) { \ - ed = TO_LA64((nextop & 7) + (rex.b << 3)); \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ wback = 0; \ if (!rex.w) { \ ADD_W(x1, ed, xZR); \ @@ -182,15 +142,18 @@ } // FAKEED like GETED, but doesn't get anything -#define FAKEED \ - if (!MODREG) { \ - addr = fakeed(dyn, addr, ninst, nextop); \ +#define FAKEED \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wback = 0; \ + } else { \ + addr = fakeed(dyn, addr, ninst, nextop); \ } // GETGW extract x64 register in gd, that is i, Signed extented -#define GETSGW(i) \ - gd = TO_LA64(((nextop & 0x38) >> 3) + (rex.r << 3)); \ - EXT_W_H(i, gd); \ +#define GETSGW(i) \ + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + EXT_W_H(i, gd); \ gd = i; // Write back ed in wback (if wback not 0) @@ -203,16 +166,21 @@ SMWRITE(); \ } -#define WBACKO(O) \ - if (wback) { \ - SDXxw(ed, wback, O); \ - SMWRITE2(); \ +#define WBACKO(O) \ + if (wback) { \ + if (rex.is32bits) { \ + ADDz(O, wback, O); \ + ST_W(ed, O, 0); \ + } else { \ + SDXxw(ed, wback, O); \ + } \ + SMWRITE2(); \ } // GETSEW will use i for ed, and can use r3 for wback. This is the Signed version #define GETSEW(i, D) \ if (MODREG) { \ - wback = TO_LA64((nextop & 7) + (rex.b << 3)); \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ EXT_W_H(i, wback); \ ed = i; \ wb1 = 0; \ @@ -235,18 +203,18 @@ #define EWBACK EWBACKW(ed) // Write back gd in correct register -#define GWBACK BSTRINS_D((TO_LA64(((nextop & 0x38) >> 3) + (rex.r << 3))), gd, 15, 0); +#define GWBACK BSTRINS_D((TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3))), gd, 15, 0); // GETEB will use i for ed, and can use r3 for wback. #define GETEB(i, D) \ if (MODREG) { \ if (rex.rex) { \ - wback = TO_LA64((nextop & 7) + (rex.b << 3)); \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ wb2 = 0; \ } else { \ wback = (nextop & 7); \ wb2 = (wback >> 2) * 8; \ - wback = TO_LA64((wback & 3)); \ + wback = TO_NAT((wback & 3)); \ } \ BSTRPICK_D(i, wback, wb2 + 7, wb2); \ wb1 = 0; \ @@ -262,12 +230,12 @@ #define GETSEB(i, D) \ if (MODREG) { \ if (rex.rex) { \ - wback = TO_LA64((nextop & 7) + (rex.b << 3)); \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ wb2 = 0; \ } else { \ wback = (nextop & 7); \ wb2 = (wback >> 2) * 8; \ - wback = TO_LA64(wback & 3); \ + wback = TO_NAT(wback & 3); \ } \ if (wb2) { \ SRLI_D(i, wback, wb2); \ @@ -279,48 +247,69 @@ ed = i; \ } else { \ SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, D); \ + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 1, D); \ LD_B(i, wback, fixedaddress); \ wb1 = 1; \ ed = i; \ } +// GETEB32 will use i for ed, and can use r3 for wback. +#define GETEB32(i, D) \ + if (MODREG) { \ + if (rex.rex) { \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wb2 = 0; \ + } else { \ + wback = (nextop & 7); \ + wb2 = (wback >> 2) * 8; \ + wback = TO_NAT(wback & 3); \ + } \ + BSTRPICK_D(i, wback, wb2 + 7, wb2); \ + wb1 = 0; \ + ed = i; \ + } else { \ + SMREAD(); \ + addr = geted32(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 1, D); \ + LD_BU(i, wback, fixedaddress); \ + wb1 = 1; \ + ed = i; \ + } + // GETGB will use i for gd -#define GETGB(i) \ - if (rex.rex) { \ - gb1 = TO_LA64(((nextop & 0x38) >> 3) + (rex.r << 3)); \ - gb2 = 0; \ - } else { \ - gd = (nextop & 0x38) >> 3; \ - gb2 = ((gd & 4) >> 2); \ - gb1 = TO_LA64((gd & 3)); \ - } \ - gd = i; \ +#define GETGB(i) \ + if (rex.rex) { \ + gb1 = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + gb2 = 0; \ + } else { \ + gd = (nextop & 0x38) >> 3; \ + gb2 = ((gd & 4) << 1); \ + gb1 = TO_NAT((gd & 3)); \ + } \ + gd = i; \ BSTRPICK_D(gd, gb1, gb2 + 7, gb2); -// GETEBO will use i for ed, i is also Offset, and can use r3 for wback. -#define GETEBO(i, D) \ - if (MODREG) { \ - if (rex.rex) { \ - wback = TO_LA64((nextop & 7) + (rex.b << 3)); \ - wb2 = 0; \ - } else { \ - wback = (nextop & 7); \ - wb2 = (wback >> 2) * 8; \ - wback = TO_LA64(wback & 3); \ - } \ - BSTRPICK_D(i, wback, wb2 + 7, wb2); \ - wb1 = 0; \ - ed = i; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 1, D); \ - ADD_D(x3, wback, i); \ - if (wback != x3) wback = x3; \ - LD_B(i, wback, fixedaddress); \ - wb1 = 1; \ - ed = i; \ +#define GETGBEB(i, j, D) \ + GETEB(j, D); \ + if (MODREG) { \ + if (rex.rex) { \ + gb1 = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + gb2 = 0; \ + } else { \ + gd = (nextop & 0x38) >> 3; \ + gb2 = ((gd & 4) << 1); \ + gb1 = TO_NAT((gd & 3)); \ + } \ + if (gb1 == wback && gb2 == wb2) \ + gd = ed; \ + else { \ + GETGB(i); \ + } \ + } else { \ + GETGB(i); \ } +#define VEXTRINS_IMM_4_0(n, m) ((n & 0xf) << 4 | (m & 0xf)) +#define XVPERMI_IMM_4_0(n, m) ((n & 0xf) << 4 | (m & 0xf)) + // Get GX as a quad (might use x1) #define GETGX(a, w) \ gd = ((nextop & 0x38) >> 3) + (rex.r << 3); \ @@ -360,6 +349,9 @@ FLD_D(a, ed, fixedaddress); \ } +// Get Ex as 64bits, not a quad (warning, x1 get used, x2 might too) +#define GETEX64(a, w, D) GETEXSD(a, w, D) + // Get Ex as a single, not a quad (warning, x1 get used) #define GETEXSS(a, w, D) \ if (MODREG) { \ @@ -371,6 +363,44 @@ FLD_S(a, ed, fixedaddress); \ } +// Get Ex as 32bits, not a quad (warning, x1 get used) +#define GETEX32(a, w, D) GETEXSS(a, w, D) + +// Get Ex as 16bits, not a quad (warning, x1 get used) +#define GETEX16(a, w, D) \ + if (MODREG) { \ + a = sse_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), w); \ + } else { \ + SMREAD(); \ + a = fpu_get_scratch(dyn); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, D); \ + LD_HU(x2, ed, fixedaddress); \ + MOVGR2FR_D(a, x2); \ + } + +// Get GM, might use x1, x2 and x3 +#define GETGM(a) \ + gd = ((nextop & 0x38) >> 3); \ + a = mmx_get_reg(dyn, ninst, x1, x2, x3, gd) + +// Get EM, might use x1, x2 and x3 +#define GETEM(a, D) \ + if (MODREG) { \ + a = mmx_get_reg(dyn, ninst, x1, x2, x3, (nextop & 7)); \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, D); \ + a = fpu_get_scratch(dyn); \ + FLD_D(a, ed, fixedaddress); \ + } + +// Put Back Em if it was a memory and not an emm register +#define PUTEM(a) \ + if (!MODREG) { \ + FST_D(a, ed, fixedaddress); \ + SMWRITE2(); \ + } + // Write gb (gd) back to original register / memory, using s1 as scratch #define GBBACK() BSTRINS_D(gb1, gd, gb2 + 7, gb2); @@ -386,6 +416,221 @@ BSTRINS_D(wback, ed, wb2 + 7, wb2); \ } +#define YMM_UNMARK_UPPER_ZERO(a) \ + do { \ + dyn->lsx.avxcache[a].zero_upper = 0; \ + } while (0) + +// AVX helpers +// Get VX (might use x1) +#define GETVYx(a, w) \ + a = avx_get_reg(dyn, ninst, x1, vex.v, w, LSX_AVX_WIDTH_128) + +#define GETVYy(a, w) \ + a = avx_get_reg(dyn, ninst, x1, vex.v, w, LSX_AVX_WIDTH_256) + +// Get an empty VX (use x1) +#define GETVYx_empty(a) \ + a = avx_get_reg_empty(dyn, ninst, x1, vex.v, LSX_AVX_WIDTH_128) + +#define GETVYy_empty(a) \ + a = avx_get_reg_empty(dyn, ninst, x1, vex.v, LSX_AVX_WIDTH_256) + +// Get GX as a quad (might use x1) +#define GETGYx(a, w) \ + gd = ((nextop & 0x38) >> 3) + (rex.r << 3); \ + a = avx_get_reg(dyn, ninst, x1, gd, w, LSX_AVX_WIDTH_128) + +#define GETGYy(a, w) \ + gd = ((nextop & 0x38) >> 3) + (rex.r << 3); \ + a = avx_get_reg(dyn, ninst, x1, gd, w, LSX_AVX_WIDTH_256) + +#define GETGYx_empty(a) \ + gd = ((nextop & 0x38) >> 3) + (rex.r << 3); \ + a = avx_get_reg_empty(dyn, ninst, x1, gd, LSX_AVX_WIDTH_128) + +#define GETGYy_empty(a) \ + gd = ((nextop & 0x38) >> 3) + (rex.r << 3); \ + a = avx_get_reg_empty(dyn, ninst, x1, gd, LSX_AVX_WIDTH_256) + +// Get EY as a quad, (x1 is used) +#define GETEYx(a, w, D) \ + if (MODREG) { \ + a = avx_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), w, LSX_AVX_WIDTH_128); \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, D); \ + a = fpu_get_scratch(dyn); \ + VLD(a, ed, fixedaddress); \ + } + +#define GETEYy(a, w, D) \ + if (MODREG) { \ + a = avx_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), w, LSX_AVX_WIDTH_256); \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, D); \ + a = fpu_get_scratch(dyn); \ + XVLD(a, ed, fixedaddress); \ + } + +#define GETEYx_empty(a, D) \ + if (MODREG) { \ + a = avx_get_reg_empty(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), LSX_AVX_WIDTH_128); \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, D); \ + a = fpu_get_scratch(dyn); \ + } + +#define GETEYy_empty(a, D) \ + if (MODREG) { \ + a = avx_get_reg_empty(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), LSX_AVX_WIDTH_256); \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, D); \ + a = fpu_get_scratch(dyn); \ + } + +// Get EY as 32bits , (x1 is used) +#define GETEYSS(a, w, D) \ + if (MODREG) { \ + a = avx_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), w, LSX_AVX_WIDTH_128); \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, D); \ + a = fpu_get_scratch(dyn); \ + FLD_S(a, ed, fixedaddress); \ + } + +#define PUTEYSS(a) \ + if (!MODREG) { \ + FST_S(a, ed, fixedaddress); \ + SMWRITE2(); \ + } + +// Get EY as 32bits , (x1 is used) +#define GETEYSD(a, w, D) \ + if (MODREG) { \ + a = avx_get_reg(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), w, LSX_AVX_WIDTH_128); \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, D); \ + a = fpu_get_scratch(dyn); \ + FLD_D(a, ed, fixedaddress); \ + } + +#define PUTEYSD(a) \ + if (!MODREG) { \ + FST_D(a, ed, fixedaddress); \ + SMWRITE2(); \ + } + +#define GETGYxy(a, w) \ + if (vex.l) { \ + GETGYy(a, w); \ + } else { \ + GETGYx(a, w); \ + } + +#define GETGYxy_empty(a) \ + if (vex.l) { \ + GETGYy_empty(a); \ + } else { \ + GETGYx_empty(a); \ + } + +#define GETVYxy(a, w) \ + if (vex.l) { \ + GETVYy(a, w); \ + } else { \ + GETVYx(a, w); \ + } + +#define GETVYxy_empty(a) \ + if (vex.l) { \ + GETVYy_empty(a); \ + } else { \ + GETVYx_empty(a); \ + } + +#define GETEYxy(a, w, D) \ + if (vex.l) { \ + GETEYy(a, w, D); \ + } else { \ + GETEYx(a, w, D); \ + } + +#define GETEYxy_empty(a, D) \ + if (vex.l) { \ + GETEYy_empty(a, D); \ + } else { \ + GETEYx_empty(a, D); \ + } + +// Put Back EY if it was a memory and not an emm register +#define PUTEYy(a) \ + if (!MODREG) { \ + XVST(a, ed, fixedaddress); \ + SMWRITE2(); \ + } + +#define PUTEYx(a) \ + if (!MODREG) { \ + VST(a, ed, fixedaddress); \ + SMWRITE2(); \ + } + +#define PUTEYxy(a) \ + if (vex.l) { \ + PUTEYy(a); \ + } else { \ + PUTEYx(a); \ + } + +// Get empty GY, and non-written VY and EY +#define GETGY_empty_VYEY_xy(gx, vx, ex, D) \ + GETVYxy(vx, 0); \ + GETEYxy(ex, 0, D); \ + GETGYxy_empty(gx); + +// Get empty GY, and non-written EY +#define GETGY_empty_EY_xy(gx, ex, D) \ + GETEYxy(ex, 0, D); \ + GETGYxy_empty(gx); + +// Get writable GY, and non-written VY and EY +#define GETGY_VYEY_xy(gx, vx, ex, D) \ + GETVYxy(vx, 0); \ + GETEYxy(ex, 0, D); \ + GETGYxy(gx, 1); + +// Get writable GY, and non-written EY +#define GETGY_EY_xy(gx, ex, D) \ + GETEYxy(ex, 0, D); \ + GETGYxy(gx, 1); + +// Get writable EY, and non-written VY and GY +#define GETEY_VYGY_xy(ex, vx, gx, D) \ + GETVYxy(vx, 0); \ + GETGYxy(gx, 0); \ + GETEYxy(ex, 1, D); + +// Get writable EY, and non-written GY +#define GETEY_GY_xy(ex, gx, D) \ + GETGYxy(gx, 0); \ + GETEYxy(ex, 1, D); + +// Get writable GYx, and non-written VYx, EYSD or EYSS , for FMA SD/SSinsts. +#define GETGYx_VYx_EYxw(gx, vx, ex, D) \ + GETVYx(vx, 0); \ + if (rex.w) { \ + GETEYSD(ex, 0, D) \ + } else { \ + GETEYSS(ex, 0, D); \ + } \ + GETGYx(gx, 1); + // Get direction with size Z and based of F_DF flag, on register r ready for load/store fetching // using s as scratch. // F_DF is not in LBT4.eflags, don't worry @@ -397,13 +642,16 @@ // CALL will use x6 for the call address. Return value can be put in ret (unless ret is -1) // R0 will not be pushed/popd if ret is -2 -#define CALL(F, ret) call_c(dyn, ninst, F, x6, ret, 1, 0) +#define CALL(F, ret, arg1, arg2) call_c(dyn, ninst, F, x6, ret, 1, 0, arg1, arg2, 0, 0, 0, 0) +#define CALL4(F, ret, arg1, arg2, arg3, arg4) call_c(dyn, ninst, F, x6, ret, 1, 0, arg1, arg2, arg3, arg4, 0, 0) +#define CALL6(F, ret, arg1, arg2, arg3, arg4, arg5, arg6) call_c(dyn, ninst, F, x6, ret, 1, 0, arg1, arg2, arg3, arg4, arg5, arg6) // CALL_ will use x6 for the call address. Return value can be put in ret (unless ret is -1) // R0 will not be pushed/popd if ret is -2 -#define CALL_(F, ret, reg) call_c(dyn, ninst, F, x6, ret, 1, reg) +#define CALL_(F, ret, reg, arg1, arg2) call_c(dyn, ninst, F, x6, ret, 1, reg, arg1, arg2, 0, 0, 0, 0) +#define CALL4_(F, ret, reg, arg1, arg2, arg3, arg4) call_c(dyn, ninst, F, x6, ret, 1, reg, arg1, arg2, arg3, arg4, 0, 0) // CALL_S will use x6 for the call address. Return value can be put in ret (unless ret is -1) // R0 will not be pushed/popd if ret is -2. Flags are not save/restored -#define CALL_S(F, ret) call_c(dyn, ninst, F, x6, ret, 0, 0) +#define CALL_S(F, ret, arg1) call_c(dyn, ninst, F, x6, ret, 0, 0, arg1, 0, 0, 0, 0, 0) #define MARKi(i) dyn->insts[ninst].mark[i] = dyn->native_size #define GETMARKi(i) dyn->insts[ninst].mark[i] @@ -421,10 +669,12 @@ #define MARKF2 MARKFi(1) #define GETMARKF2 GETMARKFi(1) -#define MARKSEG dyn->insts[ninst].markseg = dyn->native_size -#define GETMARKSEG dyn->insts[ninst].markseg -#define MARKLOCK dyn->insts[ninst].marklock = dyn->native_size -#define GETMARKLOCK dyn->insts[ninst].marklock +#define MARKSEG dyn->insts[ninst].markseg = dyn->native_size +#define GETMARKSEG dyn->insts[ninst].markseg +#define MARKLOCK dyn->insts[ninst].marklock = dyn->native_size +#define GETMARKLOCK dyn->insts[ninst].marklock +#define MARKLOCK2 dyn->insts[ninst].marklock2 = dyn->native_size +#define GETMARKLOCK2 dyn->insts[ninst].marklock2 #define Bxx_gen(OP, M, reg1, reg2) \ j64 = GET##M - dyn->native_size; \ @@ -446,6 +696,8 @@ #define BNE_MARK3(reg1, reg2) Bxx_gen(NE, MARK3, reg1, reg2) // Branch to MARKLOCK if reg1!=reg2 (use j64) #define BNE_MARKLOCK(reg1, reg2) Bxx_gen(NE, MARKLOCK, reg1, reg2) +// Branch to MARKLOCK2 if reg1!=reg2 (use j64) +#define BNE_MARKLOCK2(reg1, reg2) Bxx_gen(NE, MARKLOCK2, reg1, reg2) // Branch to MARK if reg1==reg2 (use j64) #define BEQ_MARK(reg1, reg2) Bxx_gen(EQ, MARK, reg1, reg2) @@ -455,12 +707,18 @@ #define BEQ_MARK3(reg1, reg2) Bxx_gen(EQ, MARK3, reg1, reg2) // Branch to MARKLOCK if reg1==reg2 (use j64) #define BEQ_MARKLOCK(reg1, reg2) Bxx_gen(EQ, MARKLOCK, reg1, reg2) +// Branch to MARKLOCK2 if reg1==reg2 (use j64) +#define BEQ_MARKLOCK2(reg1, reg2) Bxx_gen(EQ, MARKLOCK2, reg1, reg2) // Branch to MARK if reg1==0 (use j64) #define BEQZ_MARK(reg) BxxZ_gen(EQ, MARK, reg) // Branch to MARK2 if reg1==0 (use j64) #define BEQZ_MARK2(reg) BxxZ_gen(EQ, MARK2, reg) +// Branch to MARK3 if reg1==0 (use j64) +#define BEQZ_MARK3(reg) BxxZ_gen(EQ, MARK3, reg) // Branch to MARKLOCK if reg1==0 (use j64) #define BEQZ_MARKLOCK(reg) BxxZ_gen(EQ, MARKLOCK, reg) +// Branch to MARKLOCK2 if reg1==0 (use j64) +#define BEQZ_MARKLOCK2(reg) BxxZ_gen(EQ, MARKLOCK2, reg) // Branch to MARK if reg1!=0 (use j64) #define BNEZ_MARK(reg) BxxZ_gen(NE, MARK, reg) @@ -470,6 +728,8 @@ #define BNEZ_MARK3(reg) BxxZ_gen(NE, MARK3, reg) // Branch to MARKLOCK if reg1!=0 (use j64) #define BNEZ_MARKLOCK(reg) BxxZ_gen(NE, MARKLOCK, reg) +// Branch to MARKLOCK2 if reg1!=0 (use j64) +#define BNEZ_MARKLOCK2(reg) BxxZ_gen(NE, MARKLOCK2, reg) // Branch to MARK if fcc!=0 (use j64) #define BCNEZ_MARK(fcc) BCxxZ_gen(NE, MARK, fcc) @@ -479,6 +739,8 @@ #define BCNEZ_MARK3(fcc) BCxxZ_gen(NE, MARK3, fcc) // Branch to MARKLOCK if fcc!=0 (use j64) #define BCNEZ_MARKLOCK(fcc) BxxZ_gen(NE, MARKLOCK, fcc) +// Branch to MARKLOCK2 if fcc!=0 (use j64) +#define BCNEZ_MARKLOCK2(fcc) BxxZ_gen(NE, MARKLOCK2, fcc) // Branch to MARK if fcc==0 (use j64) #define BCEQZ_MARK(fcc) BCxxZ_gen(EQ, MARK, fcc) @@ -488,6 +750,8 @@ #define BCEQZ_MARK3(fcc) BCxxZ_gen(EQ, MARK3, fcc) // Branch to MARKLOCK if fcc==0 (use j64) #define BCEQZ_MARKLOCK(fcc) BxxZ_gen(EQ, MARKLOCK, fcc) +// Branch to MARKLOCK2 if fcc==0 (use j64) +#define BCEQZ_MARKLOCK2(fcc) BxxZ_gen(EQ, MARKLOCK2, fcc) // Branch to MARK if reg1=reg2 (use j64) #define BGE_MARK(reg1, reg2) Bxx_gen(GE, MARK, reg1, reg2) +// Branch to MARK2 if reg1>=0 (use j64) +#define BGE_MARK2(reg, reg2) Bxx_gen(GE, MARK2, reg, reg2) +// Branch to MARK3 if reg1>=0 (use j64) +#define BGE_MARK3(reg, reg2) Bxx_gen(GE, MARK3, reg, reg2) // Branch to MARK instruction unconditionnal (use j64) #define B_MARK_nocond Bxx_gen(__, MARK, 0, 0) @@ -523,16 +791,6 @@ j64 = (dyn->insts) ? (dyn->insts[ninst].epilog - (dyn->native_size)) : 0; \ BCNEZ(fcc, j64) -// Branch to NEXT if reg1==reg2 (use j64) -#define BEQ_NEXT(reg1, reg2) \ - j64 = (dyn->insts) ? (dyn->insts[ninst].epilog - (dyn->native_size)) : 0; \ - BEQ(reg1, reg2, j64) - -// Branch to NEXT if reg1!=reg2 (use j64) -#define BNE_NEXT(reg1, reg2) \ - j64 = (dyn->insts) ? (dyn->insts[ninst].epilog - (dyn->native_size)) : 0; \ - BNE(reg1, reg2, j64) - // Branch to MARKSEG if reg is 0 (use j64) #define CBZ_MARKSEG(reg) \ j64 = GETMARKSEG - (dyn->native_size); \ @@ -544,18 +802,37 @@ #define IFX(A) if ((dyn->insts[ninst].x64.gen_flags & (A))) #define IFXA(A, B) if ((dyn->insts[ninst].x64.gen_flags & (A)) && (B)) -#define IFX_PENDOR0 if ((dyn->insts[ninst].x64.gen_flags & (X_PEND) || !dyn->insts[ninst].x64.gen_flags)) +#define IFXORNAT(A) if ((dyn->insts[ninst].x64.gen_flags & (A)) || dyn->insts[ninst].nat_flags_fusion) +#define IFX_PENDOR0 if ((dyn->insts[ninst].x64.gen_flags & (X_PEND) || (!dyn->insts[ninst].x64.gen_flags && !dyn->insts[ninst].nat_flags_fusion))) #define IFXX(A) if ((dyn->insts[ninst].x64.gen_flags == (A))) #define IFX2X(A, B) if ((dyn->insts[ninst].x64.gen_flags == (A) || dyn->insts[ninst].x64.gen_flags == (B) || dyn->insts[ninst].x64.gen_flags == ((A) | (B)))) #define IFXN(A, B) if ((dyn->insts[ninst].x64.gen_flags & (A) && !(dyn->insts[ninst].x64.gen_flags & (B)))) +#ifndef NATIVE_RESTORE_X87PC +#define NATIVE_RESTORE_X87PC() \ + if (dyn->need_x87check) { \ + LD_D(x87pc, xEmu, offsetof(x64emu_t, cw)); \ + SRLI_D(x87pc, x87pc, 8); \ + ANDI(x87pc, x87pc, 0b11); \ + } +#endif +#ifndef X87_CHECK_PRECISION +#define X87_CHECK_PRECISION(A) \ + if (!ST_IS_F(0) && dyn->need_x87check) { \ + BNEZ(x87pc, 4 + 8); \ + FCVT_S_D(A, A); \ + FCVT_D_S(A, A); \ + } +#endif + #define STORE_REG(A) ST_D(x##A, xEmu, offsetof(x64emu_t, regs[_##A])) #define LOAD_REG(A) LD_D(x##A, xEmu, offsetof(x64emu_t, regs[_##A])) // Need to also store current value of some register, as they may be used by functions like setjmp #define STORE_XEMU_CALL() \ - STORE_REG(R8); \ - STORE_REG(R9); \ + STORE_REG(RBX); \ + STORE_REG(RSP); \ + STORE_REG(RBP); \ STORE_REG(R10); \ STORE_REG(R11); \ STORE_REG(R12); \ @@ -566,8 +843,9 @@ #define LOAD_XEMU_CALL() #define LOAD_XEMU_REM() \ - LOAD_REG(R8); \ - LOAD_REG(R9); \ + LOAD_REG(RBX); \ + LOAD_REG(RSP); \ + LOAD_REG(RBP); \ LOAD_REG(R10); \ LOAD_REG(R11); \ LOAD_REG(R12); \ @@ -575,61 +853,65 @@ LOAD_REG(R14); \ LOAD_REG(R15); -#define SET_DFNONE() \ - do { \ - dyn->f.dfnone_here=1; \ - if (!dyn->f.dfnone) { \ - ST_W(xZR, xEmu, offsetof(x64emu_t, df)); \ - dyn->f.dfnone = 1; \ - } } while(0); +#define FORCE_DFNONE() ST_W(xZR, xEmu, offsetof(x64emu_t, df)) +#define CHECK_DFNONE(N) \ + do { \ + if (dyn->f == status_none_pending) { \ + FORCE_DFNONE(); \ + if (N) dyn->f = status_none; \ + } \ + } while (0) + +#define SET_DFNONE() \ + do { \ + if (dyn->f != status_none) { \ + dyn->f = status_none_pending; \ + } \ + } while (0) + #define SET_DF(S, N) \ if ((N) != d_none) { \ MOV32w(S, (N)); \ ST_W(S, xEmu, offsetof(x64emu_t, df)); \ - dyn->f.dfnone = 0; \ + dyn->f = status_set; \ } else \ SET_DFNONE() -#define SET_NODF() dyn->f.dfnone = 0 -#define SET_DFOK() dyn->f.dfnone = 1; dyn->f.dfnone_here=1 -#define CLEAR_FLAGS_(s) \ - MOV64x(s, (1UL << F_AF) | (1UL << F_CF) | (1UL << F_OF) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF)); ANDN(xFlags, xFlags, s); +#define CLEAR_FLAGS_(s) \ + MOV64x(s, (1UL << F_AF) | (1UL << F_CF) | (1UL << F_OF) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF)); \ + ANDN(xFlags, xFlags, s); #define CLEAR_FLAGS(s) \ - IFX(X_ALL) { CLEAR_FLAGS_(s) } + IFX (X_ALL) { CLEAR_FLAGS_(s) } #define CALC_SUB_FLAGS(op1_, op2, res, scratch1, scratch2, width) \ - IFX(X_AF | X_CF | X_OF) \ - { \ + IFX (X_AF | X_CF | X_OF) { \ /* calc borrow chain */ \ /* bc = (res & (~op1 | op2)) | (~op1 & op2) */ \ OR(scratch1, op1_, op2); \ AND(scratch2, res, scratch1); \ AND(op1_, op1_, op2); \ OR(scratch2, scratch2, op1_); \ - IFX(X_AF) \ - { \ + IFX (X_AF) { \ /* af = bc & 0x8 */ \ ANDI(scratch1, scratch2, 8); \ - BEQZ(scratch1, 8); \ - ORI(xFlags, xFlags, 1 << F_AF); \ + SLLI_D(scratch1, scratch1, F_AF - 3); \ + OR(xFlags, xFlags, scratch1); \ } \ - IFX(X_CF) \ - { \ + IFX (X_CF) { \ /* cf = bc & (1<<(width-1)) */ \ if ((width) == 8) { \ ANDI(scratch1, scratch2, 0x80); \ } else { \ - SRLI_D(scratch1, scratch2, (width)-1); \ + SRLI_D(scratch1, scratch2, (width) - 1); \ if ((width) != 64) ANDI(scratch1, scratch1, 1); \ } \ BEQZ(scratch1, 8); \ ORI(xFlags, xFlags, 1 << F_CF); \ } \ - IFX(X_OF) \ - { \ + IFX (X_OF) { \ /* of = ((bc >> (width-2)) ^ (bc >> (width-1))) & 0x1; */ \ - SRLI_D(scratch1, scratch2, (width)-2); \ + SRLI_D(scratch1, scratch2, (width) - 2); \ SRLI_D(scratch2, scratch1, 1); \ XOR(scratch1, scratch1, scratch2); \ ANDI(scratch1, scratch1, 1); \ @@ -638,43 +920,104 @@ } \ } -#ifndef MAYSETFLAGS -#define MAYSETFLAGS() do {} while (0) + +#if STEP == 0 +#define X87_PUSH_OR_FAIL(var, dyn, ninst, scratch, t) var = x87_do_push(dyn, ninst, scratch, t) +#define X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, scratch) x87_do_push_empty(dyn, ninst, scratch) +#define X87_POP_OR_FAIL(dyn, ninst, scratch) x87_do_pop(dyn, ninst, scratch) +#else +#define X87_PUSH_OR_FAIL(var, dyn, ninst, scratch, t) \ + if ((dyn->lsx.x87stack == 8) || (dyn->lsx.pushed == 8)) { \ + if (dyn->need_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Push, stack=%d/%d on inst %d\n", dyn->lsx.x87stack, dyn->lsx.pushed, ninst); \ + dyn->abort = 1; \ + return addr; \ + } \ + var = x87_do_push(dyn, ninst, scratch, t); + +#define X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, scratch) \ + if ((dyn->lsx.x87stack == 8) || (dyn->lsx.pushed == 8)) { \ + if (dyn->need_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Push, stack=%d/%d on inst %d\n", dyn->lsx.x87stack, dyn->lsx.pushed, ninst); \ + dyn->abort = 1; \ + return addr; \ + } \ + x87_do_push_empty(dyn, ninst, scratch); + +#define X87_POP_OR_FAIL(dyn, ninst, scratch) \ + if ((dyn->lsx.x87stack == -8) || (dyn->lsx.poped == 8)) { \ + if (dyn->need_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Pop, stack=%d/%d on inst %d\n", dyn->lsx.x87stack, dyn->lsx.poped, ninst); \ + dyn->abort = 1; \ + return addr; \ + } \ + x87_do_pop(dyn, ninst, scratch); #endif #ifndef READFLAGS -#define READFLAGS(A) \ - if (((A) != X_PEND && dyn->f.pending != SF_SET) \ - && (dyn->f.pending != SF_SET_PENDING)) { \ - if (dyn->f.pending != SF_PENDING) { \ - LD_D(x3, xEmu, offsetof(x64emu_t, df)); \ - j64 = (GETMARKF) - (dyn->native_size); \ - BEQ(x3, xZR, j64); \ - } \ - CALL_(UpdateFlags, -1, 0); \ - MARKF; \ - dyn->f.pending = SF_SET; \ - SET_DFOK(); \ +#define READFLAGS(A) \ + if ((A) != X_PEND \ + && (dyn->f == status_unk)) { \ + CALL_(const_updateflags, -1, 0, 0, 0); \ + dyn->f = status_none; \ } #endif +#ifndef READFLAGS_FUSION +#define READFLAGS_FUSION(A, s1, s2, s3, s4, s5) \ + if (dyn->insts[ninst].nat_flags_fusion) \ + get_free_scratch(dyn, ninst, &tmp1, &tmp2, &tmp3, s1, s2, s3, s4, s5); \ + else { \ + tmp1 = s1; \ + tmp2 = s2; \ + tmp3 = s3; \ + } \ + READFLAGS(A) +#endif + +#define NAT_FLAGS_OPS(op1, op2, s1, s2) \ + do { \ + dyn->insts[dyn->insts[ninst].nat_next_inst].nat_flags_op1 = op1; \ + dyn->insts[dyn->insts[ninst].nat_next_inst].nat_flags_op2 = op2; \ + if (dyn->insts[ninst + 1].no_scratch_usage && IS_GPR(op1)) { \ + MV(s1, op1); \ + dyn->insts[dyn->insts[ninst].nat_next_inst].nat_flags_op1 = s1; \ + } \ + if (dyn->insts[ninst + 1].no_scratch_usage && IS_GPR(op2)) { \ + MV(s2, op2); \ + dyn->insts[dyn->insts[ninst].nat_next_inst].nat_flags_op2 = s2; \ + } \ + } while (0) + +#define NAT_FLAGS_ENABLE_CARRY() dyn->insts[ninst].nat_flags_carry = 1 +#define NAT_FLAGS_ENABLE_SIGN() dyn->insts[ninst].nat_flags_sign = 1 +#define NAT_FLAGS_ENABLE_SF() dyn->insts[ninst].nat_flags_sf = 1 + +#define GRABFLAGS(A) \ + if ((A) != X_PEND \ + && ((dyn->f == status_unk) || (dyn->f == status_set))) { \ + CALL_(const_updateflags, -1, 0, 0, 0); \ + dyn->f = status_none; \ + } + #ifndef SETFLAGS -#define SETFLAGS(A, B) \ - if (dyn->f.pending != SF_SET \ - && ((B) & SF_SUB) \ - && (dyn->insts[ninst].x64.gen_flags & (~(A)))) \ - READFLAGS(((dyn->insts[ninst].x64.gen_flags & X_PEND) ? X_ALL : dyn->insts[ninst].x64.gen_flags) & (~(A))); \ - if (dyn->insts[ninst].x64.gen_flags) switch (B) { \ - case SF_SUBSET: \ - case SF_SET: dyn->f.pending = SF_SET; break; \ - case SF_PENDING: dyn->f.pending = SF_PENDING; break; \ - case SF_SUBSET_PENDING: \ - case SF_SET_PENDING: \ - dyn->f.pending = (dyn->insts[ninst].x64.gen_flags & X_PEND) ? SF_SET_PENDING : SF_SET; \ - break; \ - } \ - else \ - dyn->f.pending = SF_SET +#define SETFLAGS(A, B, FUSION) \ + do { \ + if (((B) & SF_SUB) \ + && (dyn->insts[ninst].x64.gen_flags & (~(A)))) \ + GRABFLAGS(((dyn->insts[ninst].x64.gen_flags & X_PEND) ? X_ALL : dyn->insts[ninst].x64.gen_flags) & (~(A))); \ + if (dyn->insts[ninst].x64.gen_flags) switch (B) { \ + case SF_SET_DF: dyn->f = status_set; break; \ + case SF_SET_NODF: SET_DFNONE(); break; \ + case SF_SUBSET: \ + case SF_SUBSET_PENDING: \ + case SF_SET: \ + case SF_PENDING: \ + case SF_SET_PENDING: \ + SET_DFNONE(); \ + break; \ + } \ + else \ + SET_DFNONE(); \ + dyn->insts[ninst].nat_flags_nofusion = (FUSION); \ + } while (0) #endif #ifndef JUMP #define JUMP(A, C) @@ -697,7 +1040,7 @@ #define UFLAG_RES(A) \ if (dyn->insts[ninst].x64.gen_flags) { SDxw(A, xEmu, offsetof(x64emu_t, res)); } #define UFLAG_DF(r, A) \ - if (dyn->insts[ninst].x64.gen_flags) { SET_DF(r, A) } + if (dyn->insts[ninst].x64.gen_flags) { SET_DF(r, A); } #define UFLAG_IF if (dyn->insts[ninst].x64.gen_flags) #ifndef DEFAULT #define DEFAULT \ @@ -708,38 +1051,56 @@ #ifndef TABLE64 #define TABLE64(A, V) #endif +#ifndef FTABLE64 +#define FTABLE64(A, V) +#endif +#ifndef TABLE64C +#define TABLE64C(A, V) +#endif + +#ifndef TABLE64_ +#define TABLE64_(A, V) +#endif + +#define ARCH_INIT() SMSTART() -#define ARCH_INIT() +#define ARCH_RESET() #if STEP < 2 -#define GETIP(A) TABLE64(0, 0) -#define GETIP_(A) TABLE64(0, 0) +#define GETIP(A, scratch) +#define GETIP_(A, scratch) #else -// put value in the Table64 even if not using it for now to avoid difference between Step2 and Step3. Needs to be optimized later... -#define GETIP(A) \ - if (dyn->last_ip && ((A)-dyn->last_ip) < 2048) { \ - uint64_t _delta_ip = (A)-dyn->last_ip; \ - dyn->last_ip += _delta_ip; \ - if (_delta_ip) { \ - ADDI_D(xRIP, xRIP, _delta_ip); \ - } \ - } else { \ - dyn->last_ip = (A); \ - if (dyn->last_ip < 0xffffffff) { \ - MOV64x(xRIP, dyn->last_ip); \ - } else \ - TABLE64(xRIP, dyn->last_ip); \ - } -#define GETIP_(A) \ - if (dyn->last_ip && ((A)-dyn->last_ip) < 2048) { \ - int64_t _delta_ip = (A)-dyn->last_ip; \ - if (_delta_ip) { ADDI_D(xRIP, xRIP, _delta_ip); } \ - } else { \ - if ((A) < 0xffffffff) { \ - MOV64x(xRIP, (A)); \ - } else \ - TABLE64(xRIP, (A)); \ - } + +#define GETIP_(A, scratch) \ + do { \ + ssize_t _delta_ip = (ssize_t)(A) - (ssize_t)dyn->last_ip; \ + if (!dyn->last_ip) { \ + if (dyn->need_reloc) { \ + TABLE64(xRIP, (A)); \ + } else { \ + MOV64x(xRIP, (A)); \ + } \ + } else if (_delta_ip == 0) { \ + } else if (_delta_ip >= -2048 && _delta_ip < 2048) { \ + ADDI_D(xRIP, xRIP, _delta_ip); \ + } else if (_delta_ip < 0 && _delta_ip >= -0xffffffffL) { \ + MOV32w(scratch, -_delta_ip); \ + SUB_D(xRIP, xRIP, scratch); \ + } else if (_delta_ip > 0 && _delta_ip <= 0xffffffffL) { \ + MOV32w(scratch, _delta_ip); \ + ADD_D(xRIP, xRIP, scratch); \ + } else { \ + if (dyn->need_reloc) { \ + TABLE64(xRIP, (A)); \ + } else { \ + MOV64x(xRIP, (A)); \ + } \ + } \ + } while (0) +#define GETIP(A, scratch) \ + GETIP_(A, scratch); \ + dyn->last_ip = (A); + #endif #define CLEARIP() dyn->last_ip = 0 @@ -755,10 +1116,6 @@ #define MODREG ((nextop & 0xC0) == 0xC0) -void la64_epilog(void); -void la64_epilog_fast(void); -void* la64_next(x64emu_t* emu, uintptr_t addr); - #ifndef STEPNAME #define STEPNAME3(N, M) N##M #define STEPNAME2(N, M) STEPNAME3(N, M) @@ -767,106 +1124,198 @@ void* la64_next(x64emu_t* emu, uintptr_t addr); #define native_pass STEPNAME(native_pass) -#define dynarec64_00 STEPNAME(dynarec64_00) -#define dynarec64_0F STEPNAME(dynarec64_0F) -#define dynarec64_64 STEPNAME(dynarec64_64) -#define dynarec64_66 STEPNAME(dynarec64_66) -#define dynarec64_6664 STEPNAME(dynarec64_6664) -#define dynarec64_67 STEPNAME(dynarec64_67) -#define dynarec64_F30F STEPNAME(dynarec64_F30F) -#define dynarec64_660F STEPNAME(dynarec64_660F) -#define dynarec64_F0 STEPNAME(dynarec64_F0) -#define dynarec64_F20F STEPNAME(dynarec64_F20F) +#define dynarec64_00 STEPNAME(dynarec64_00) +#define dynarec64_0F STEPNAME(dynarec64_0F) +#define dynarec64_66 STEPNAME(dynarec64_66) +#define dynarec64_F30F STEPNAME(dynarec64_F30F) +#define dynarec64_660F STEPNAME(dynarec64_660F) +#define dynarec64_66F0 STEPNAME(dynarec64_66F0) +#define dynarec64_66F20F STEPNAME(dynarec64_66F20F) +#define dynarec64_66F30F STEPNAME(dynarec64_66F30F) +#define dynarec64_F0 STEPNAME(dynarec64_F0) +#define dynarec64_F20F STEPNAME(dynarec64_F20F) +#define dynarec64_AVX STEPNAME(dynarec64_AVX) +#define dynarec64_AVX_0F STEPNAME(dynarec64_AVX_0F) +#define dynarec64_AVX_0F38 STEPNAME(dynarec64_AVX_0F38) +#define dynarec64_AVX_66_0F STEPNAME(dynarec64_AVX_66_0F) +#define dynarec64_AVX_66_0F38 STEPNAME(dynarec64_AVX_66_0F38) +#define dynarec64_AVX_66_0F3A STEPNAME(dynarec64_AVX_66_0F3A) +#define dynarec64_AVX_F2_0F STEPNAME(dynarec64_AVX_F2_0F) +#define dynarec64_AVX_F2_0F38 STEPNAME(dynarec64_AVX_F2_0F38) +#define dynarec64_AVX_F2_0F3A STEPNAME(dynarec64_AVX_F2_0F3A) +#define dynarec64_AVX_F3_0F STEPNAME(dynarec64_AVX_F3_0F) +#define dynarec64_AVX_F3_0F38 STEPNAME(dynarec64_AVX_F3_0F38) + +#define dynarec64_D8 STEPNAME(dynarec64_D8) +#define dynarec64_D9 STEPNAME(dynarec64_D9) +#define dynarec64_DA STEPNAME(dynarec64_DA) +#define dynarec64_DB STEPNAME(dynarec64_DB) +#define dynarec64_DC STEPNAME(dynarec64_DC) +#define dynarec64_DD STEPNAME(dynarec64_DD) +#define dynarec64_DE STEPNAME(dynarec64_DE) +#define dynarec64_DF STEPNAME(dynarec64_DF) +#define dynarec64_F0 STEPNAME(dynarec64_F0) #define geted STEPNAME(geted) -#define geted32 STEPNAME(geted32) +#define geted16 STEPNAME(geted16) #define jump_to_epilog STEPNAME(jump_to_epilog) #define jump_to_epilog_fast STEPNAME(jump_to_epilog_fast) #define jump_to_next STEPNAME(jump_to_next) -#define ret_to_epilog STEPNAME(ret_to_epilog) -#define retn_to_epilog STEPNAME(retn_to_epilog) +#define ret_to_next STEPNAME(ret_to_next) +#define iret_to_next STEPNAME(iret_to_next) #define call_c STEPNAME(call_c) +#define call_n STEPNAME(call_n) #define grab_segdata STEPNAME(grab_segdata) +#define emit_adc16 STEPNAME(emit_adc16) +#define emit_adc32 STEPNAME(emit_adc32) +#define emit_adc8 STEPNAME(emit_adc8) +#define emit_adc8c STEPNAME(emit_adc8c) +#define emit_add16 STEPNAME(emit_add16) +#define emit_add32 STEPNAME(emit_add32) +#define emit_add32c STEPNAME(emit_add32c) +#define emit_add8 STEPNAME(emit_add8) +#define emit_add8c STEPNAME(emit_add8c) +#define emit_and16 STEPNAME(emit_and16) +#define emit_and32 STEPNAME(emit_and32) +#define emit_and32c STEPNAME(emit_and32c) +#define emit_and8 STEPNAME(emit_and8) +#define emit_and8c STEPNAME(emit_and8c) #define emit_cmp16 STEPNAME(emit_cmp16) #define emit_cmp16_0 STEPNAME(emit_cmp16_0) #define emit_cmp32 STEPNAME(emit_cmp32) #define emit_cmp32_0 STEPNAME(emit_cmp32_0) #define emit_cmp8 STEPNAME(emit_cmp8) #define emit_cmp8_0 STEPNAME(emit_cmp8_0) -#define emit_test8 STEPNAME(emit_test8) -#define emit_test16 STEPNAME(emit_test16) -#define emit_test32 STEPNAME(emit_test32) -#define emit_test32c STEPNAME(emit_test32c) -#define emit_add32 STEPNAME(emit_add32) -#define emit_add32c STEPNAME(emit_add32c) -#define emit_add8 STEPNAME(emit_add8) -#define emit_add8c STEPNAME(emit_add8c) -#define emit_add16 STEPNAME(emit_add16) -#define emit_adc32 STEPNAME(emit_adc32) -#define emit_sub16 STEPNAME(emit_sub16) -#define emit_sub32 STEPNAME(emit_sub32) -#define emit_sub32c STEPNAME(emit_sub32c) -#define emit_sub8 STEPNAME(emit_sub8) -#define emit_sub8c STEPNAME(emit_sub8c) -#define emit_sbb8 STEPNAME(emit_sbb8) -#define emit_sbb8c STEPNAME(emit_sbb8c) -#define emit_sbb16 STEPNAME(emit_sbb16) -#define emit_sbb32 STEPNAME(emit_sbb32) -#define emit_neg8 STEPNAME(emit_neg8) -#define emit_neg16 STEPNAME(emit_neg16) -#define emit_neg32 STEPNAME(emit_neg32) -#define emit_inc8 STEPNAME(emit_inc8) -#define emit_inc16 STEPNAME(emit_inc16) -#define emit_inc32 STEPNAME(emit_inc32) -#define emit_dec8 STEPNAME(emit_dec8) #define emit_dec16 STEPNAME(emit_dec16) #define emit_dec32 STEPNAME(emit_dec32) +#define emit_dec8 STEPNAME(emit_dec8) +#define emit_inc16 STEPNAME(emit_inc16) +#define emit_inc32 STEPNAME(emit_inc32) +#define emit_inc8 STEPNAME(emit_inc8) +#define emit_neg16 STEPNAME(emit_neg16) +#define emit_neg32 STEPNAME(emit_neg32) +#define emit_neg8 STEPNAME(emit_neg8) +#define emit_or16 STEPNAME(emit_or16) #define emit_or32 STEPNAME(emit_or32) #define emit_or32c STEPNAME(emit_or32c) #define emit_or8 STEPNAME(emit_or8) #define emit_or8c STEPNAME(emit_or8c) -#define emit_or16 STEPNAME(emit_or16) -#define emit_xor8 STEPNAME(emit_xor8) -#define emit_xor8c STEPNAME(emit_xor8c) -#define emit_xor16 STEPNAME(emit_xor16) -#define emit_xor32 STEPNAME(emit_xor32) -#define emit_xor32c STEPNAME(emit_xor32c) -#define emit_and8 STEPNAME(emit_and8) -#define emit_and8c STEPNAME(emit_and8c) -#define emit_and16 STEPNAME(emit_and16) -#define emit_and32 STEPNAME(emit_and32) -#define emit_and32c STEPNAME(emit_and32c) +#define emit_rcl16 STEPNAME(emit_rcl16) +#define emit_rcl16c STEPNAME(emit_rcl16c) +#define emit_rcl32 STEPNAME(emit_rcl32) +#define emit_rcl32c STEPNAME(emit_rcl32c) +#define emit_rcl8 STEPNAME(emit_rcl8) +#define emit_rcl8c STEPNAME(emit_rcl8c) +#define emit_rcr16 STEPNAME(emit_rcr16) +#define emit_rcr16c STEPNAME(emit_rcr16c) +#define emit_rcr32 STEPNAME(emit_rcr32) +#define emit_rcr32c STEPNAME(emit_rcr32c) +#define emit_rcr8 STEPNAME(emit_rcr8) +#define emit_rcr8c STEPNAME(emit_rcr8c) +#define emit_rol16 STEPNAME(emit_rol16) +#define emit_rol16c STEPNAME(emit_rol16c) +#define emit_rol32 STEPNAME(emit_rol32) +#define emit_rol32c STEPNAME(emit_rol32c) +#define emit_rol8 STEPNAME(emit_rol8) +#define emit_rol8c STEPNAME(emit_rol8c) +#define emit_ror16 STEPNAME(emit_ror16) +#define emit_ror16c STEPNAME(emit_ror16c) +#define emit_ror32 STEPNAME(emit_ror32) +#define emit_ror32c STEPNAME(emit_ror32c) +#define emit_ror8 STEPNAME(emit_ror8) +#define emit_ror8c STEPNAME(emit_ror8c) +#define emit_sar16 STEPNAME(emit_sar16) +#define emit_sar16c STEPNAME(emit_sar16c) +#define emit_sar32 STEPNAME(emit_sar32) +#define emit_sar32c STEPNAME(emit_sar32c) +#define emit_sar8 STEPNAME(emit_sar8) +#define emit_sar8c STEPNAME(emit_sar8c) +#define emit_sbb16 STEPNAME(emit_sbb16) +#define emit_sbb32 STEPNAME(emit_sbb32) +#define emit_sbb8 STEPNAME(emit_sbb8) +#define emit_sbb8c STEPNAME(emit_sbb8c) #define emit_shl16 STEPNAME(emit_shl16) +#define emit_shl16c STEPNAME(emit_shl16c) #define emit_shl32 STEPNAME(emit_shl32) #define emit_shl32c STEPNAME(emit_shl32c) -#define emit_shr8 STEPNAME(emit_shr8) +#define emit_shl8 STEPNAME(emit_shl8) +#define emit_shl8c STEPNAME(emit_shl8c) +#define emit_shld16 STEPNAME(emit_shld16) +#define emit_shld16c STEPNAME(emit_shld16c) +#define emit_shld32 STEPNAME(emit_shld32) +#define emit_shld32c STEPNAME(emit_shld32c) #define emit_shr16 STEPNAME(emit_shr16) +#define emit_shr16c STEPNAME(emit_shr16c) #define emit_shr32 STEPNAME(emit_shr32) #define emit_shr32c STEPNAME(emit_shr32c) -#define emit_sar16 STEPNAME(emit_sar16) -#define emit_sar32c STEPNAME(emit_sar32c) -#define emit_shld32c STEPNAME(emit_shld32c) +#define emit_shr8 STEPNAME(emit_shr8) +#define emit_shr8c STEPNAME(emit_shr8c) +#define emit_shrd16 STEPNAME(emit_shrd16) +#define emit_shrd16c STEPNAME(emit_shrd16c) +#define emit_shrd32 STEPNAME(emit_shrd32) #define emit_shrd32c STEPNAME(emit_shrd32c) -#define emit_ror32c STEPNAME(emit_ror32c) -#define emit_rol32 STEPNAME(emit_rol32) -#define emit_rol32c STEPNAME(emit_rol32c) +#define emit_sub16 STEPNAME(emit_sub16) +#define emit_sub32 STEPNAME(emit_sub32) +#define emit_sub32c STEPNAME(emit_sub32c) +#define emit_sub8 STEPNAME(emit_sub8) +#define emit_sub8c STEPNAME(emit_sub8c) +#define emit_test16 STEPNAME(emit_test16) +#define emit_test32 STEPNAME(emit_test32) +#define emit_test32c STEPNAME(emit_test32c) +#define emit_test8 STEPNAME(emit_test8) +#define emit_test8c STEPNAME(emit_test8c) +#define emit_xor16 STEPNAME(emit_xor16) +#define emit_xor32 STEPNAME(emit_xor32) +#define emit_xor32c STEPNAME(emit_xor32c) +#define emit_xor8 STEPNAME(emit_xor8) +#define emit_xor8c STEPNAME(emit_xor8c) #define emit_pf STEPNAME(emit_pf) -#define x87_restoreround STEPNAME(x87_restoreround) +#define x87_do_push STEPNAME(x87_do_push) +#define x87_do_push_empty STEPNAME(x87_do_push_empty) +#define x87_do_pop STEPNAME(x87_do_pop) +#define x87_get_current_cache STEPNAME(x87_get_current_cache) +#define x87_get_cache STEPNAME(x87_get_cache) +#define x87_get_lsxcache STEPNAME(x87_get_lsxcache) +#define x87_get_st STEPNAME(x87_get_st) +#define x87_get_st_empty STEPNAME(x87_get_st) +#define x87_free STEPNAME(x87_free) +#define x87_refresh STEPNAME(x87_refresh) +#define x87_forget STEPNAME(x87_forget) +#define x87_reget_st STEPNAME(x87_reget_st) +#define x87_stackcount STEPNAME(x87_stackcount) +#define x87_unstackcount STEPNAME(x87_unstackcount) +#define x87_swapreg STEPNAME(x87_swapreg) +#define x87_setround STEPNAME(x87_setround) +#define x87_restoreround STEPNAME(x87_restoreround) +#define x87_reflectcount STEPNAME(x87_reflectcount) +#define x87_unreflectcount STEPNAME(x87_unreflectcount) +#define x87_purgecache STEPNAME(x87_purgecache) + #define sse_setround STEPNAME(sse_setround) -#define x87_forget STEPNAME(x87_forget) -#define sse_purge07cache STEPNAME(sse_purge07cache) +#define mmx_get_reg STEPNAME(mmx_get_reg) +#define mmx_get_reg_empty STEPNAME(mmx_get_reg_empty) +#define sse_purge07cache STEPNAME(sse_purge07cache) #define sse_get_reg STEPNAME(sse_get_reg) #define sse_get_reg_empty STEPNAME(sse_get_reg_empty) #define sse_forget_reg STEPNAME(sse_forget_reg) #define sse_reflect_reg STEPNAME(sse_reflect_reg) +#define avx_get_reg STEPNAME(avx_get_reg) +#define avx_get_reg_empty STEPNAME(avx_get_reg_empty) +#define avx_forget_reg STEPNAME(sse_forget_reg) +#define avx_reflect_reg STEPNAME(avx_reflect_reg) +#define avx_purgecache STEPNAME(avx_purgecache) +#define avx_reflect_reg_upper128 STEPNAME(avx_reflect_reg_upper128) + + #define fpu_pushcache STEPNAME(fpu_pushcache) #define fpu_popcache STEPNAME(fpu_popcache) #define fpu_reset_cache STEPNAME(fpu_reset_cache) #define fpu_propagate_stack STEPNAME(fpu_propagate_stack) #define fpu_purgecache STEPNAME(fpu_purgecache) +#define mmx_purgecache STEPNAME(mmx_purgecache) #define fpu_reflectcache STEPNAME(fpu_reflectcache) #define fpu_unreflectcache STEPNAME(fpu_unreflectcache) @@ -878,99 +1327,176 @@ void* la64_next(x64emu_t* emu, uintptr_t addr); uintptr_t geted(dynarec_la64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int* l, int i12, int delta); /* setup r2 to address pointed by */ -uintptr_t geted32(dynarec_la64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int* l, int i12, int delta); +uintptr_t geted16(dynarec_la64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int i12); // generic x64 helper void jump_to_epilog(dynarec_la64_t* dyn, uintptr_t ip, int reg, int ninst); void jump_to_epilog_fast(dynarec_la64_t* dyn, uintptr_t ip, int reg, int ninst); void jump_to_next(dynarec_la64_t* dyn, uintptr_t ip, int reg, int ninst, int is32bits); -void ret_to_epilog(dynarec_la64_t* dyn, int ninst, rex_t rex); -void retn_to_epilog(dynarec_la64_t* dyn, int ninst, rex_t rex, int n); -void call_c(dynarec_la64_t* dyn, int ninst, void* fnc, int reg, int ret, int saveflags, int save_reg); +void ret_to_next(dynarec_la64_t* dyn, uintptr_t ip, int ninst, rex_t rex); +void iret_to_next(dynarec_la64_t* dyn, uintptr_t ip, int ninst, int is32bits, int is64bits); +void call_c(dynarec_la64_t* dyn, int ninst, la64_consts_t fnc, int reg, int ret, int saveflags, int save_reg, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6); +void call_n(dynarec_la64_t* dyn, int ninst, void* fnc, int w); void grab_segdata(dynarec_la64_t* dyn, uintptr_t addr, int ninst, int reg, int segment); -void emit_cmp8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6); -void emit_cmp16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6); -void emit_cmp32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5, int s6); -void emit_cmp8_0(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4); -void emit_cmp16_0(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4); -void emit_cmp32_0(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4); -void emit_test8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); -void emit_test16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); -void emit_test32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); -void emit_test32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4, int s5); +void emit_adc16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_adc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5, int s6); +void emit_adc8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_adc8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5, int s6); +void emit_add16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); void emit_add32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); void emit_add32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5); void emit_add8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); void emit_add8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s2, int s3, int s4); -void emit_add16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); -void emit_adc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5, int s6); -void emit_sub16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); -void emit_sub32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); -void emit_sub32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5); -void emit_sub8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); -void emit_sub8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s2, int s3, int s4, int s5); -void emit_sbb8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); -void emit_sbb8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5, int s6); -void emit_sbb16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); -void emit_sbb32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); -void emit_neg8(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4); -void emit_neg16(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4); -void emit_neg32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3); -void emit_inc8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_inc16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_inc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); -void emit_dec8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_and16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_and32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); +void emit_and32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4); +void emit_and8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_and8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); +void emit_cmp16_0(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4); +void emit_cmp16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6); +void emit_cmp32_0(dynarec_la64_t* dyn, int ninst, rex_t rex, uint8_t nextop, int s1, int s3, int s4, int s5); +void emit_cmp32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5, int s6); +void emit_cmp8_0(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4); +void emit_cmp8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6); void emit_dec16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); void emit_dec32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); +void emit_dec8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_inc16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_inc32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); +void emit_inc8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_neg16(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4); +void emit_neg32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3); +void emit_neg8(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4); +void emit_or16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); void emit_or32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); void emit_or32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4); void emit_or8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); void emit_or8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s2, int s3, int s4); -void emit_or16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_xor8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_xor8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); -void emit_xor16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); -void emit_xor32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4); -void emit_xor32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); -void emit_and8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_and8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); -void emit_and16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_and32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); -void emit_and32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4); +void emit_rcl16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_rcl16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); +void emit_rcl32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); +void emit_rcl32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4, int s5); +void emit_rcl8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_rcl8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); +void emit_rcr16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_rcr16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); +void emit_rcr32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); +void emit_rcr32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4, int s5); +void emit_rcr8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_rcr8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); +void emit_rol16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_rol16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5); +void emit_rol32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); +void emit_rol32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); +void emit_rol8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_rol8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5); +void emit_ror16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_ror16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); +void emit_ror32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); +void emit_ror32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); +void emit_ror8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_ror8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); +void emit_sar16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_sar16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5); +void emit_sar32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); +void emit_sar32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); +void emit_sar8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_sar8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); +void emit_sbb16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_sbb32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); +void emit_sbb8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_sbb8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5, int s6); void emit_shl16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_shl16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5); void emit_shl32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); void emit_shl32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4, int s5); -void emit_shr8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_shl8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_shl8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); +void emit_shld16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6); +void emit_shld16c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5); +void emit_shld32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s5, int s3, int s4, int s6); +void emit_shld32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4); void emit_shr16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_shr16c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5); void emit_shr32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); void emit_shr32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); -void emit_sar16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); -void emit_sar32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); -void emit_shld32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4); +void emit_shr8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_shr8c(dynarec_la64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); +void emit_shrd16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6); +void emit_shrd16c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5); +void emit_shrd32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s5, int s3, int s4, int s6); void emit_shrd32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4); -void emit_ror32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); -void emit_rol32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); -void emit_rol32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); +void emit_sub16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_sub32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); +void emit_sub32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5); +void emit_sub8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_sub8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s2, int s3, int s4, int s5); +void emit_test16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_test32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); +void emit_test32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4, int s5); +void emit_test8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_test8c(dynarec_la64_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4, int s5); +void emit_xor16(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_xor32(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); +void emit_xor32c(dynarec_la64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4); +void emit_xor8(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_xor8c(dynarec_la64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); void emit_pf(dynarec_la64_t* dyn, int ninst, int s1, int s3, int s4); // common coproc helpers + +// x87 helper +// cache of the local stack counter, to avoid update at every call +int x87_stackcount(dynarec_la64_t* dyn, int ninst, int scratch); +// restore local stack counter +void x87_unstackcount(dynarec_la64_t* dyn, int ninst, int scratch, int count); +// fpu push. Return the Dd value to be used +int x87_do_push(dynarec_la64_t* dyn, int ninst, int s1, int t); +// fpu push. Do not allocate a cache register. Needs a scratch register to do x87stack synch (or 0 to not do it) +void x87_do_push_empty(dynarec_la64_t* dyn, int ninst, int s1); +// fpu pop. All previous returned Dd should be considered invalid +void x87_do_pop(dynarec_la64_t* dyn, int ninst, int s1); +// get cache index for a x87 reg, return -1 if cache doesn't exist +int x87_get_current_cache(dynarec_la64_t* dyn, int ninst, int st, int t); +// get cache index for a x87 reg, create the entry if needed +int x87_get_cache(dynarec_la64_t* dyn, int ninst, int populate, int s1, int s2, int a, int t); +// get extcache index for a x87 reg +int x87_get_lsxcache(dynarec_la64_t* dyn, int ninst, int s1, int s2, int a); +// get vfpu register for a x87 reg, create the entry if needed +int x87_get_st(dynarec_la64_t* dyn, int ninst, int s1, int s2, int a, int t); +// get vfpu register for a x87 reg, create the entry if needed. Do not fetch the Stx if not already in cache +int x87_get_st_empty(dynarec_la64_t* dyn, int ninst, int s1, int s2, int a, int t); +// Free st, using the FFREE opcode (so it's freed but stack is not moved) +void x87_free(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int st); +// refresh a value from the cache ->emu (nothing done if value is not cached) +void x87_refresh(dynarec_la64_t* dyn, int ninst, int s1, int s2, int st); +// refresh a value from the cache ->emu and then forget the cache (nothing done if value is not cached) +void x87_forget(dynarec_la64_t* dyn, int ninst, int s1, int s2, int st); +// refresh the cache value from emu +void x87_reget_st(dynarec_la64_t* dyn, int ninst, int s1, int s2, int st); +// swap 2 x87 regs +void x87_swapreg(dynarec_la64_t* dyn, int ninst, int s1, int s2, int a, int b); +// Set rounding according to cw flags, return reg to restore flags +int x87_setround(dynarec_la64_t* dyn, int ninst, int s1, int s2); +// Restore round flag +void x87_restoreround(dynarec_la64_t* dyn, int ninst, int s1); +// Set rounding according to mxcsr flags, return reg to restore flags +void x87_reflectcount(dynarec_la64_t* dyn, int ninst, int s1, int s2); +void x87_unreflectcount(dynarec_la64_t* dyn, int ninst, int s1, int s2); +void x87_purgecache(dynarec_la64_t* dyn, int ninst, int next, int s1, int s2, int s3); + // reset the cache with n void fpu_reset_cache(dynarec_la64_t* dyn, int ninst, int reset_n); -// propagate stack state void fpu_propagate_stack(dynarec_la64_t* dyn, int ninst); -// purge the FPU cache (needs 3 scratch registers) void fpu_purgecache(dynarec_la64_t* dyn, int ninst, int next, int s1, int s2, int s3); +void mmx_purgecache(dynarec_la64_t* dyn, int ninst, int next, int s1); void fpu_reflectcache(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3); void fpu_unreflectcache(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3); void fpu_pushcache(dynarec_la64_t* dyn, int ninst, int s1, int not07); void fpu_popcache(dynarec_la64_t* dyn, int ninst, int s1, int not07); -// Restore round flag -void x87_restoreround(dynarec_la64_t* dyn, int ninst, int s1); // Set rounding according to mxcsr flags, return reg to restore flags int sse_setround(dynarec_la64_t* dyn, int ninst, int s1, int s2); -// refresh a value from the cache ->emu and then forget the cache (nothing done if value is not cached) -void x87_forget(dynarec_la64_t* dyn, int ninst, int s1, int s2, int st); // SSE/SSE2 helpers // purge the XMM0..XMM7 cache (before function call) @@ -984,6 +1510,24 @@ void sse_forget_reg(dynarec_la64_t* dyn, int ninst, int a); // Push current value to the cache void sse_reflect_reg(dynarec_la64_t* dyn, int ninst, int a); +// MMX helpers +// get lsx register for a MMX reg, create the entry if needed +int mmx_get_reg(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int a); +// get lsx register for a MMX reg, but don't try to synch it if it needed to be created +int mmx_get_reg_empty(dynarec_la64_t* dyn, int ninst, int s1, int s2, int s3, int a); + + +// AVX helpers +// get lasx register for a AVX reg, create the entry if needed +int avx_get_reg(dynarec_la64_t* dyn, int ninst, int s1, int a, int forwrite, int width); +// get lasx register for an AVX reg, but don't try to synch it if it needed to be created +int avx_get_reg_empty(dynarec_la64_t* dyn, int ninst, int s1, int a, int width); +// forget float register for a AVX reg, create the entry if needed +void avx_forget_reg(dynarec_la64_t* dyn, int ninst, int a); +// Push current value to the cache +void avx_reflect_reg(dynarec_la64_t* dyn, int ninst, int a); +void avx_reflect_reg_upper128(dynarec_la64_t* dyn, int ninst, int a, int forwrite); + void CacheTransform(dynarec_la64_t* dyn, int ninst, int cacheupd, int s1, int s2, int s3); void la64_move64(dynarec_la64_t* dyn, int ninst, int reg, int64_t val); @@ -995,16 +1539,68 @@ void la64_move32(dynarec_la64_t* dyn, int ninst, int reg, int32_t val, int zerou #define CHECK_CACHE() (cacheupd = CacheNeedsTransform(dyn, ninst)) #endif -uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); +#define lsxcache_st_coherency STEPNAME(lsxcache_st_coherency) +int lsxcache_st_coherency(dynarec_la64_t* dyn, int ninst, int a, int b); + +#if STEP == 0 +#define ST_IS_F(A) 0 +#define ST_IS_I64(A) 0 +#define X87_COMBINE(A, B) LSX_CACHE_ST_D +#define X87_ST0 LSX_CACHE_ST_D +#define X87_ST(A) LSX_CACHE_ST_D +#elif STEP == 1 +#define ST_IS_F(A) (lsxcache_get_current_st(dyn, ninst, A) == LSX_CACHE_ST_F) +#define ST_IS_I64(A) (lsxcache_get_current_st(dyn, ninst, A) == LSX_CACHE_ST_I64) +#define X87_COMBINE(A, B) lsxcache_combine_st(dyn, ninst, A, B) +#define X87_ST0 lsxcache_no_i64(dyn, ninst, 0, lsxcache_get_current_st(dyn, ninst, 0)) +#define X87_ST(A) lsxcache_no_i64(dyn, ninst, A, lsxcache_get_current_st(dyn, ninst, A)) +#else +#define ST_IS_F(A) (lsxcache_get_st(dyn, ninst, A) == LSX_CACHE_ST_F) +#define ST_IS_I64(A) (lsxcache_get_st(dyn, ninst, A) == LSX_CACHE_ST_I64) +#if STEP == 3 +#define X87_COMBINE(A, B) lsxcache_st_coherency(dyn, ninst, A, B) +#else +#define X87_COMBINE(A, B) lsxcache_get_st(dyn, ninst, A) +#endif +#define X87_ST0 lsxcache_get_st(dyn, ninst, 0) +#define X87_ST(A) lsxcache_get_st(dyn, ninst, A) +#endif + + +uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); -uintptr_t dynarec64_64(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int seg, int* ok, int* need_epilog); -uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); +uintptr_t dynarec64_64(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int seg, int* ok, int* need_epilog); +uintptr_t dynarec64_66(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_6664(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int seg, int* ok, int* need_epilog); -uintptr_t dynarec64_67(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); +uintptr_t dynarec64_67(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_6764(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int seg, int* ok, int* need_epilog); uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); -uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); +uintptr_t dynarec64_66F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_66F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_66F30F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_0F38(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_66_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_66_0F38(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_66_0F3A(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_F2_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_F2_0F38(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_F2_0F3A(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_F3_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_F3_0F38(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_D8(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_D9(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DA(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DB(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DC(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DD(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DE(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DF(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); + #if STEP < 3 #define PASS3(A) @@ -1018,99 +1614,117 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int #define MAYUSE(A) #endif -#define GOCOND(B, T1, T2) \ - case B + 0x0: \ - INST_NAME(T1 "O " T2); \ - GO(ANDI(x1, xFlags, 1 << F_OF), EQZ, NEZ, X_OF, X64_JMP_JO); \ - break; \ - case B + 0x1: \ - INST_NAME(T1 "NO " T2); \ - GO(ANDI(x1, xFlags, 1 << F_OF), NEZ, EQZ, X_OF, X64_JMP_JNO); \ - break; \ - case B + 0x2: \ - INST_NAME(T1 "C " T2); \ - GO(ANDI(x1, xFlags, 1 << F_CF), EQZ, NEZ, X_CF, X64_JMP_JC); \ - break; \ - case B + 0x3: \ - INST_NAME(T1 "NC " T2); \ - GO(ANDI(x1, xFlags, 1 << F_CF), NEZ, EQZ, X_CF, X64_JMP_JNC); \ - break; \ - case B + 0x4: \ - INST_NAME(T1 "Z " T2); \ - GO(ANDI(x1, xFlags, 1 << F_ZF), EQZ, NEZ, X_ZF, X64_JMP_JZ); \ - break; \ - case B + 0x5: \ - INST_NAME(T1 "NZ " T2); \ - GO(ANDI(x1, xFlags, 1 << F_ZF), NEZ, EQZ, X_ZF, X64_JMP_JNZ); \ - break; \ - case B + 0x6: \ - INST_NAME(T1 "BE " T2); \ - GO(ANDI(x1, xFlags, (1 << F_CF) | (1 << F_ZF)), EQZ, NEZ, X_CF | X_ZF, X64_JMP_JBE); \ - break; \ - case B + 0x7: \ - INST_NAME(T1 "NBE " T2); \ - GO(ANDI(x1, xFlags, (1 << F_CF) | (1 << F_ZF)), NEZ, EQZ, X_CF | X_ZF, X64_JMP_JNBE); \ - break; \ - case B + 0x8: \ - INST_NAME(T1 "S " T2); \ - GO(ANDI(x1, xFlags, 1 << F_SF), EQZ, NEZ, X_SF, X64_JMP_JS); \ - break; \ - case B + 0x9: \ - INST_NAME(T1 "NS " T2); \ - GO(ANDI(x1, xFlags, 1 << F_SF), NEZ, EQZ, X_SF, X64_JMP_JNS); \ - break; \ - case B + 0xA: \ - INST_NAME(T1 "P " T2); \ - GO(ANDI(x1, xFlags, 1 << F_PF), EQZ, NEZ, X_PF, X64_JMP_JP); \ - break; \ - case B + 0xB: \ - INST_NAME(T1 "NP " T2); \ - GO(ANDI(x1, xFlags, 1 << F_PF), NEZ, EQZ, X_PF, X64_JMP_JNP); \ - break; \ - case B + 0xC: \ - INST_NAME(T1 "L " T2); \ - GO(SRLI_D(x1, xFlags, F_OF - F_SF); \ - XOR(x1, x1, xFlags); \ - ANDI(x1, x1, 1 << F_SF), EQZ, NEZ, X_SF | X_OF, X64_JMP_JL); \ - break; \ - case B + 0xD: \ - INST_NAME(T1 "GE " T2); \ - GO(SRLI_D(x1, xFlags, F_OF - F_SF); \ - XOR(x1, x1, xFlags); \ - ANDI(x1, x1, 1 << F_SF), NEZ, EQZ, X_SF | X_OF, X64_JMP_JGE); \ - break; \ - case B + 0xE: \ - INST_NAME(T1 "LE " T2); \ - GO(SRLI_D(x1, xFlags, F_OF - F_SF); \ - XOR(x1, x1, xFlags); \ - ANDI(x1, x1, 1 << F_SF); \ - ANDI(x3, xFlags, 1 << F_ZF); \ - OR(x1, x1, x3); \ - ANDI(x1, x1, (1 << F_SF) | (1 << F_ZF)), EQZ, NEZ, X_SF | X_OF | X_ZF, X64_JMP_JLE); \ - break; \ - case B + 0xF: \ - INST_NAME(T1 "G " T2); \ - GO(SRLI_D(x1, xFlags, F_OF - F_SF); \ - XOR(x1, x1, xFlags); \ - ANDI(x1, x1, 1 << F_SF); \ - ANDI(x3, xFlags, 1 << F_ZF); \ - OR(x1, x1, x3); \ - ANDI(x1, x1, (1 << F_SF) | (1 << F_ZF)), NEZ, EQZ, X_SF | X_OF | X_ZF, X64_JMP_JG); \ +#define GOCOND(B, T1, T2) \ + case B + 0x0: \ + INST_NAME(T1 "O " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_OF), EQZ, NEZ, _, _, X_OF, X64_JMP_JO); \ + break; \ + case B + 0x1: \ + INST_NAME(T1 "NO " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_OF), NEZ, EQZ, _, _, X_OF, X64_JMP_JNO); \ + break; \ + case B + 0x2: \ + INST_NAME(T1 "C " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_CF), EQZ, NEZ, GEU, LTU, X_CF, X64_JMP_JC); \ + break; \ + case B + 0x3: \ + INST_NAME(T1 "NC " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_CF), NEZ, EQZ, LTU, GEU, X_CF, X64_JMP_JNC); \ + break; \ + case B + 0x4: \ + INST_NAME(T1 "Z " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_ZF), EQZ, NEZ, NE, EQ, X_ZF, X64_JMP_JZ); \ + break; \ + case B + 0x5: \ + INST_NAME(T1 "NZ " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_ZF), NEZ, EQZ, EQ, NE, X_ZF, X64_JMP_JNZ); \ + break; \ + case B + 0x6: \ + INST_NAME(T1 "BE " T2); \ + GO(ANDI(tmp1, xFlags, (1 << F_CF) | (1 << F_ZF)), EQZ, NEZ, GTU, LEU, X_CF | X_ZF, X64_JMP_JBE); \ + break; \ + case B + 0x7: \ + INST_NAME(T1 "NBE " T2); \ + GO(ANDI(tmp1, xFlags, (1 << F_CF) | (1 << F_ZF)), NEZ, EQZ, LEU, GTU, X_CF | X_ZF, X64_JMP_JNBE); \ + break; \ + case B + 0x8: \ + INST_NAME(T1 "S " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_SF), EQZ, NEZ, GE, LT, X_SF, X64_JMP_JS); \ + break; \ + case B + 0x9: \ + INST_NAME(T1 "NS " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_SF), NEZ, EQZ, LT, GE, X_SF, X64_JMP_JNS); \ + break; \ + case B + 0xA: \ + INST_NAME(T1 "P " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_PF), EQZ, NEZ, _, _, X_PF, X64_JMP_JP); \ + break; \ + case B + 0xB: \ + INST_NAME(T1 "NP " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_PF), NEZ, EQZ, _, _, X_PF, X64_JMP_JNP); \ + break; \ + case B + 0xC: \ + INST_NAME(T1 "L " T2); \ + GO(SRLI_D(tmp1, xFlags, F_OF - F_SF); \ + XOR(tmp1, tmp1, xFlags); \ + ANDI(tmp1, tmp1, 1 << F_SF), EQZ, NEZ, GE, LT, X_SF | X_OF, X64_JMP_JL); \ + break; \ + case B + 0xD: \ + INST_NAME(T1 "GE " T2); \ + GO(SRLI_D(tmp1, xFlags, F_OF - F_SF); \ + XOR(tmp1, tmp1, xFlags); \ + ANDI(tmp1, tmp1, 1 << F_SF), NEZ, EQZ, LT, GE, X_SF | X_OF, X64_JMP_JGE); \ + break; \ + case B + 0xE: \ + INST_NAME(T1 "LE " T2); \ + GO(SRLI_D(tmp1, xFlags, F_OF - F_SF); \ + XOR(tmp1, tmp1, xFlags); \ + ANDI(tmp1, tmp1, 1 << F_SF); \ + ANDI(tmp3, xFlags, 1 << F_ZF); \ + OR(tmp1, tmp1, tmp3); \ + ANDI(tmp1, tmp1, (1 << F_SF) | (1 << F_ZF)), EQZ, NEZ, GT, LE, X_SF | X_OF | X_ZF, X64_JMP_JLE); \ + break; \ + case B + 0xF: \ + INST_NAME(T1 "G " T2); \ + GO(SRLI_D(tmp1, xFlags, F_OF - F_SF); \ + XOR(tmp1, tmp1, xFlags); \ + ANDI(tmp1, tmp1, 1 << F_SF); \ + ANDI(tmp3, xFlags, 1 << F_ZF); \ + OR(tmp1, tmp1, tmp3); \ + ANDI(tmp1, tmp1, (1 << F_SF) | (1 << F_ZF)), NEZ, EQZ, LE, GT, X_SF | X_OF | X_ZF, X64_JMP_JG); \ break +// Dummy macros +#define B__safe(a, b, c) XOR(xZR, xZR, xZR) +#define B_(a, b, c) XOR(xZR, xZR, xZR) +#define S_(a, b, c) XOR(xZR, xZR, xZR) +#define MV_(a, b, c, d) XOR(xZR, xZR, xZR) + +#define NATIVEJUMP_safe(COND, val) \ + B##COND##_safe(dyn->insts[ninst].nat_flags_op1, dyn->insts[ninst].nat_flags_op2, val); + +#define NATIVEJUMP(COND, val) \ + B##COND(dyn->insts[ninst].nat_flags_op1, dyn->insts[ninst].nat_flags_op2, val); + +#define NATIVESET(COND, rd) \ + S##COND(rd, dyn->insts[ninst].nat_flags_op1, dyn->insts[ninst].nat_flags_op2); + +#define NATIVEMV(COND, rd, rs) \ + MV##COND(rd, rs, dyn->insts[ninst].nat_flags_op1, dyn->insts[ninst].nat_flags_op2); + #define NOTEST(s1) \ - if (box64_dynarec_test) { \ + if (BOX64ENV(dynarec_test)) { \ ST_W(xZR, xEmu, offsetof(x64emu_t, test.test)); \ ST_W(xZR, xEmu, offsetof(x64emu_t, test.clean)); \ } #define SKIPTEST(s1) \ - if (box64_dynarec_test) { \ + if (BOX64ENV(dynarec_test)) { \ ST_W(xZR, xEmu, offsetof(x64emu_t, test.clean)); \ } #define GOTEST(s1, s2) \ - if (box64_dynarec_test) { \ + if (BOX64ENV(dynarec_test)) { \ MOV32w(s2, 1); \ ST_W(s2, xEmu, offsetof(x64emu_t, test.test)); \ } @@ -1123,30 +1737,198 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int opcode = F8; \ } + +#define FCOM(w, v1, v2, s1, s2, s3) \ + LD_HU(s3, xEmu, offsetof(x64emu_t, sw)); \ + MOV32w(s1, 0b1011100011111111); /* mask off c0,c1,c2,c3 */ \ + AND(s3, s3, s1); \ + FCMP_##w(fcc0, v1, v2, cOR); \ + BCEQZ(fcc0, 28); /* undefined/NaN */ \ + FCMP_##w(fcc1, v1, v2, cEQ); \ + BCNEZ(fcc1, 32); /* equal */ \ + FCMP_##w(fcc2, v1, v2, cLT); /* x2 = (v1insts[ninst].x64.addr = addr; \ if (ninst) dyn->insts[ninst - 1].x64.size = dyn->insts[ninst].x64.addr - dyn->insts[ninst - 1].x64.addr -#define MESSAGE(A, ...) do {} while (0) -#define MAYSETFLAGS() dyn->insts[ninst].x64.may_set = 1 -#define READFLAGS(A) \ - dyn->insts[ninst].x64.use_flags = A; \ - dyn->f.dfnone = 1; \ - dyn->f.pending = SF_SET -#define SETFLAGS(A, B) \ - dyn->insts[ninst].x64.set_flags = A; \ - dyn->insts[ninst].x64.state_flags = B; \ - dyn->f.pending = (B) & SF_SET_PENDING; \ - dyn->f.dfnone = ((B) & SF_SET) ? 1 : 0; +#define MESSAGE(A, ...) \ + do { \ + } while (0) +#define READFLAGS(A) \ + do { \ + dyn->insts[ninst].x64.use_flags = A; \ + if (dyn->f != status_none_pending) dyn->f = status_none; \ + if (!BOX64ENV(dynarec_df) && (A) & X_PEND) dyn->insts[ninst].x64.use_flags = X_ALL; \ + dyn->f = status_none; \ + } while (0) + +#define READFLAGS_FUSION(A, s1, s2, s3, s4, s5) \ + if (BOX64ENV(dynarec_nativeflags) && ninst > 0) { \ + int prev = ninst - 1; \ + while (prev && dyn->insts[prev].no_scratch_usage) \ + prev -= 1; \ + if (!dyn->insts[prev].nat_flags_nofusion) { \ + if ((A) == (X_ZF)) \ + dyn->insts[ninst].nat_flags_fusion = 1; \ + else if (dyn->insts[prev].nat_flags_carry && ((A) == (X_CF) || (A) == (X_CF | X_ZF))) \ + dyn->insts[ninst].nat_flags_fusion = 1; \ + else if (dyn->insts[prev].nat_flags_sign && ((A) == (X_SF | X_OF) || (A) == (X_SF | X_OF | X_ZF))) \ + dyn->insts[ninst].nat_flags_fusion = 1; \ + else if (dyn->insts[prev].nat_flags_sf && dyn->insts[prev].nat_flags_sign && (A) == X_SF) \ + dyn->insts[ninst].nat_flags_fusion = 1; \ + } \ + } \ + READFLAGS(A); + +#define SETFLAGS(A, B, FUSION) \ + do { \ + dyn->insts[ninst].x64.set_flags = A; \ + dyn->insts[ninst].x64.state_flags = (B) & ~SF_DF; \ + dyn->f = ((B) & SF_SET) ? (((B) == SF_SET_NODF) ? status_none : status_none_pending) : (((B) & SF_SET_PENDING) ? status_set : status_none_pending); \ + if (!BOX64ENV(dynarec_df)) { \ + dyn->f = status_none; \ + if ((A) == SF_PENDING) { \ + printf_log(LOG_INFO, "Warning, some opcode use SF_PENDING, forcing deferedflags ON\n"); \ + SET_BOX64ENV(dynarec_df, 1); \ + } \ + } \ + dyn->insts[ninst].nat_flags_nofusion = (FUSION); \ + } while (0) + #define EMIT(A) dyn->native_size += 4 #define JUMP(A, C) add_jump(dyn, ninst); add_next(dyn, (uintptr_t)A); SMEND(); dyn->insts[ninst].x64.jmp = A; dyn->insts[ninst].x64.jmp_cond = C; dyn->insts[ninst].x64.jmp_insts = 0 #define BARRIER(A) \ @@ -37,18 +70,22 @@ dyn->insts[ninst].lsx = dyn->lsx; \ dyn->insts[ninst].x64.has_next = (ok > 0) ? 1 : 0; #define INST_NAME(name) -#define DEFAULT \ - --dyn->size; \ - *ok = -1; \ - if (box64_dynarec_log >= LOG_INFO || box64_dynarec_dump || box64_dynarec_missing) { \ - dynarec_log(LOG_NONE, "%p: Dynarec stopped because of %sOpcode %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", \ - (void*)ip, rex.is32bits ? "32bits " : "", \ - PKip(0), \ - PKip(1), PKip(2), PKip(3), \ - PKip(4), PKip(5), PKip(6), \ - PKip(7), PKip(8), PKip(9), \ - PKip(10), PKip(11), PKip(12), \ - PKip(13), PKip(14)); \ - printFunctionAddr(ip, " => "); \ - dynarec_log(LOG_NONE, "\n"); \ +#define DEFAULT \ + --dyn->size; \ + *ok = -1; \ + if (ninst) { dyn->insts[ninst - 1].x64.size = ip - dyn->insts[ninst - 1].x64.addr; } \ + if (BOX64ENV(dynarec_log) >= LOG_INFO || dyn->need_dump || BOX64ENV(dynarec_missing) == 1) { \ + dynarec_stopped(dyn->insts[ninst].x64.addr, rex.is32bits); \ } + + +#define NATIVE_RESTORE_X87PC() +#define X87_CHECK_PRECISION(A) \ + do { \ + if (dyn->need_x87check) dyn->insts[ninst].x87precision = 1; \ + } while (0) + +#define SCRATCH_USAGE(usage) \ + do { \ + dyn->insts[ninst].no_scratch_usage = !usage; \ + } while (0) diff --git a/src/dynarec/la64/dynarec_la64_pass1.h b/src/dynarec/la64/dynarec_la64_pass1.h index 20366bd..b0dde23 100644 --- a/src/dynarec/la64/dynarec_la64_pass1.h +++ b/src/dynarec/la64/dynarec_la64_pass1.h @@ -13,3 +13,10 @@ dyn->insts[ninst].f_exit = dyn->f #define INST_NAME(name) + +#define NATIVE_RESTORE_X87PC() +#define X87_CHECK_PRECISION(A) \ + do { \ + if (dyn->need_x87check) \ + dyn->need_x87check = 2; \ + } while (0) diff --git a/src/dynarec/la64/dynarec_la64_pass2.h b/src/dynarec/la64/dynarec_la64_pass2.h index 38c1646..26ce8fa 100644 --- a/src/dynarec/la64/dynarec_la64_pass2.h +++ b/src/dynarec/la64/dynarec_la64_pass2.h @@ -2,7 +2,7 @@ #define FINI \ if (ninst) { \ dyn->insts[ninst].address = (dyn->insts[ninst - 1].address + dyn->insts[ninst - 1].size); \ - dyn->insts_size += 1 + ((dyn->insts[ninst].x64.size > (dyn->insts[ninst].size / 4)) ? dyn->insts[ninst].x64.size : (dyn->insts[ninst].size / 4)) / 15; \ + dyn->insts_size += 1+((dyn->insts[ninst-1].x64.size>(dyn->insts[ninst-1].size/4))?dyn->insts[ninst-1].x64.size:(dyn->insts[ninst-1].size/4))/15; \ } #define MESSAGE(A, ...) do {} while (0) @@ -19,9 +19,32 @@ } #define INST_EPILOG dyn->insts[ninst].epilog = dyn->native_size; #define INST_NAME(name) -#define TABLE64(A, V) \ - { \ +#define TABLE64(A, V) \ + do { \ + if (dyn->need_reloc && !isTable64(dyn, (V))) \ + AddRelocTable64Addr(dyn, ninst, (V), 2); \ + Table64(dyn, (V), 2); \ + EMIT(0); \ + EMIT(0); \ + } while (0) +#define TABLE64_(A, V) \ + do { \ Table64(dyn, (V), 2); \ EMIT(0); \ EMIT(0); \ - } + } while (0) +#define FTABLE64(A, V) \ + do { \ + mmx87_regs_t v = { .d = V }; \ + Table64(dyn, v.q, 2); \ + EMIT(0); \ + EMIT(0); \ + } while (0) +#define TABLE64C(A, V) \ + do { \ + if (dyn->need_reloc && !isTable64(dyn, getConst(V))) \ + AddRelocTable64Const(dyn, ninst, (V), 2); \ + Table64(dyn, getConst(V), 2); \ + EMIT(0); \ + EMIT(0); \ + } while (0) diff --git a/src/dynarec/la64/dynarec_la64_pass3.h b/src/dynarec/la64/dynarec_la64_pass3.h index 34654f9..f0eb141 100644 --- a/src/dynarec/la64/dynarec_la64_pass3.h +++ b/src/dynarec/la64/dynarec_la64_pass3.h @@ -1,20 +1,22 @@ #define INIT -#define FINI \ - if (ninst) \ - addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst].x64.size, dyn->insts[ninst].size / 4); \ +#define FINI \ + if (ninst) \ + addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst-1].x64.size, dyn->insts[ninst-1].size/4); \ addInst(dyn->instsize, &dyn->insts_size, 0, 0); -#define EMIT(A) \ - do { \ - if (box64_dynarec_dump) print_opcode(dyn, ninst, (uint32_t)(A)); \ - if ((uintptr_t)dyn->block < dyn->tablestart) \ - *(uint32_t*)(dyn->block) = (uint32_t)(A); \ - dyn->block += 4; \ - dyn->native_size += 4; \ - dyn->insts[ninst].size2 += 4; \ +#define EMIT(A) \ + do { \ + if (dyn->need_dump) print_opcode(dyn, ninst, (uint32_t)(A)); \ + if ((uintptr_t)dyn->block < dyn->tablestart) \ + *(uint32_t*)(dyn->block) = (uint32_t)(A); \ + dyn->block += 4; \ + dyn->native_size += 4; \ + dyn->insts[ninst].size2 += 4; \ } while (0) -#define MESSAGE(A, ...) \ - if (box64_dynarec_dump) dynarec_log(LOG_NONE, __VA_ARGS__) +#define MESSAGE(A, ...) \ + do { \ + if (dyn->need_dump) dynarec_log(LOG_NONE, __VA_ARGS__); \ + } while (0) #define NEW_INST \ if (ninst) { \ addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst - 1].x64.size, dyn->insts[ninst - 1].size / 4); \ @@ -23,9 +25,35 @@ #define INST_EPILOG #define INST_NAME(name) inst_name_pass3(dyn, ninst, name, rex) #define TABLE64(A, V) \ - { \ + do { \ + if (dyn->need_reloc && !isTable64(dyn, (V))) \ + AddRelocTable64Addr(dyn, ninst, (V), 3); \ int val64offset = Table64(dyn, (V), 3); \ MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); \ PCADDU12I(A, SPLIT20(val64offset)); \ LD_D(A, A, SPLIT12(val64offset)); \ - } + } while (0) +#define TABLE64_(A, V) \ + do { \ + int val64offset = Table64(dyn, (V), 3); \ + MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); \ + PCADDU12I(A, SPLIT20(val64offset)); \ + LD_D(A, A, SPLIT12(val64offset)); \ + } while (0) +#define FTABLE64(A, V) \ + do { \ + mmx87_regs_t v = { .d = V }; \ + int val64offset = Table64(dyn, v.q, 3); \ + MESSAGE(LOG_DUMP, " FTable64: %g\n", v.d); \ + PCADDU12I(x1, SPLIT20(val64offset)); \ + FLD_D(A, x1, SPLIT12(val64offset)); \ + } while (0) +#define TABLE64C(A, V) \ + do { \ + if (dyn->need_reloc && !isTable64(dyn, getConst(V))) \ + AddRelocTable64Const(dyn, ninst, (V), 3); \ + int val64offset = Table64(dyn, getConst(V), 3); \ + MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); \ + PCADDU12I(A, SPLIT20(val64offset)); \ + LD_D(A, A, SPLIT12(val64offset)); \ + } while (0) diff --git a/src/dynarec/la64/dynarec_la64_private.h b/src/dynarec/la64/dynarec_la64_private.h index 56b2e71..cee23f4 100644 --- a/src/dynarec/la64/dynarec_la64_private.h +++ b/src/dynarec/la64/dynarec_la64_private.h @@ -6,6 +6,7 @@ typedef struct x64emu_s x64emu_t; typedef struct dynablock_s dynablock_t; typedef struct instsize_s instsize_t; +typedef struct box64env_s box64env_t; #define BARRIER_MAYBE 8 @@ -16,7 +17,12 @@ typedef struct instsize_s instsize_t; #define LSX_CACHE_MM 4 #define LSX_CACHE_XMMW 5 #define LSX_CACHE_XMMR 6 -#define LSX_CACHE_SCR 7 +#define LSX_CACHE_YMMW 7 +#define LSX_CACHE_YMMR 8 +#define LSX_CACHE_SCR 9 + +#define LSX_AVX_WIDTH_128 0 +#define LSX_AVX_WIDTH_256 1 typedef union lsx_cache_s { int8_t v; @@ -34,6 +40,16 @@ typedef union sse_cache_s { }; } sse_cache_t; +typedef union avx_cache_s { + int8_t v; + struct { + uint8_t reg : 5; + uint8_t width : 1; + uint8_t zero_upper : 1; + uint8_t write : 1; + }; +} avx_cache_t; + typedef struct lsxcache_s { // LSX cache lsx_cache_t lsxcache[24]; @@ -45,27 +61,34 @@ typedef struct lsxcache_s { uint8_t combined2; uint8_t swapped; // the combined reg were swapped uint8_t barrier; // is there a barrier at instruction epilog? + uint8_t pushed; // positive pushed value (to check for overflow) + uint8_t poped; // positive poped value (to check for underflow) uint32_t news; // bitmask, wich neoncache are new for this opcode // fpu cache int8_t x87cache[8]; // cache status for the 8 x87 register behind the fpu stack int8_t x87reg[8]; // reg used for x87cache entry - int8_t freed[8]; // set when FFREE is used, -1 else + int16_t tags; // similar to fpu_tags int8_t mmxcache[8]; // cache status for the 8 MMX registers sse_cache_t ssecache[16]; // cache status for the 16 SSE(2) registers + avx_cache_t avxcache[16]; // cache status for the 16 SSE(2) registers int8_t fpuused[24]; // all 0..24 double reg from fpu, used by x87, sse and mmx int8_t x87stack; // cache stack counter int8_t mmxcount; // number of mmx register used (not both mmx and x87 at the same time) int8_t fpu_scratch; // scratch counter - int8_t fpu_extra_qscratch; // some opcode need an extra quad scratch register - int8_t fpu_reg; // x87/sse/mmx reg counter + uint16_t xmm_used; // mask of the xmm regs used in this opcode + uint16_t ymm_used; // mask of the ymm regs used in this opcode } lsxcache_t; -typedef struct flagcache_s { - int pending; // is there a pending flags here, or to check? - uint8_t dfnone; // if deferred flags is already set to df_none - uint8_t dfnone_here;// defered flags is cleared in this opcode +typedef enum flagcache_s { + status_unk = 0, // unknown deferred flags status + status_set, // deferred flags set to something (not 0) + status_none_pending, // deferred flags set to 0, but still pending the write to x64emu_t + status_none, // deferred flags set to 0, written to x64emu_t } flagcache_t; +typedef struct callret_s callret_t; +typedef struct sep_s sep_t; + typedef struct instruction_la64_s { instruction_x64_t x64; uintptr_t address; // (start) address of the arm emitted instruction @@ -78,18 +101,32 @@ typedef struct instruction_la64_s { uintptr_t markf[2]; uintptr_t markseg; uintptr_t marklock; + uintptr_t marklock2; int pass2choice;// value for choices that are fixed on pass2 for pass3 uintptr_t natcall; uint16_t retn; - uint16_t purge_ymm; // need to purge some ymm - uint16_t ymm0_in; // bitmap of ymm to zero at purge - uint16_t ymm0_add; // the ymm0 added by the opcode - uint16_t ymm0_sub; // the ymm0 removed by the opcode - uint16_t ymm0_out; // the ymmm0 at th end of the opcode uint16_t ymm0_pass2, ymm0_pass3; uint8_t barrier_maybe; - uint8_t will_write; - uint8_t last_write; + uint8_t will_write:2; // [strongmem] will write to memory + uint8_t will_read:1; // [strongmem] will read from memory + uint8_t last_write:1; // [strongmem] the last write in a SEQ + uint8_t lock:1; // [strongmem] lock semantic + uint8_t df_notneeded; + uint8_t nat_flags_fusion:1; + uint8_t nat_flags_nofusion:1; + uint8_t nat_flags_carry:1; + uint8_t nat_flags_sign:1; + uint8_t nat_flags_sf:1; + uint8_t nat_flags_needsign:1; + uint8_t no_scratch_usage : 1; // this opcode does not use scratch register + uint8_t nat_flags_op1; + uint8_t nat_flags_op2; + uint8_t x87precision:1; // this opcode can handle x87pc + unsigned mmx_used:1; // no fine tracking, just a global "any reg used" + unsigned x87_used:1; // no fine tracking, just a global "any reg used" + unsigned fpu_used:1; // any xmm/ymm/x87/mmx reg used + unsigned fpupurge:1; // this opcode will purge all fpu regs + uint16_t nat_next_inst; flagcache_t f_exit; // flags status at end of instruction lsxcache_t lsx; // lsxcache at end of instruction (but before poping) flagcache_t f_entry; // flags status before the instruction begin @@ -100,7 +137,9 @@ typedef struct dynarec_la64_s { int32_t size; int32_t cap; uintptr_t start; // start of the block + uintptr_t end; // maximum end of the block (only used in pass0) uint32_t isize; // size in bytes of x64 instructions included + uint32_t prefixsize; // size in byte of the prefix of the block void* block; // memory pointer where next instruction is emitted uintptr_t native_start; // start of the arm code size_t native_size; // size of emitted arm code @@ -122,15 +161,29 @@ typedef struct dynarec_la64_s { dynablock_t* dynablock; instsize_t* instsize; size_t insts_size; // size of the instruction size array (calculated) + int callret_size; // size of the array + int sep_size; // size of the array + callret_t* callrets; // array of callret return, with NOP / UDF depending if the block is clean or dirty + sep_t* sep; // array of secondary entry point uintptr_t forward; // address of the last end of code while testing forward uintptr_t forward_to; // address of the next jump to (to check if everything is ok) int32_t forward_size; // size at the forward point int forward_ninst; // ninst at the forward point uint16_t ymm_zero; // bitmap of ymm to zero at purge - uint8_t smread; // for strongmem model emulation uint8_t smwrite; // for strongmem model emulation uint8_t always_test; uint8_t abort; + uint8_t use_x87:1; // set if x87 regs are used + uint8_t use_mmx:1; + uint8_t use_xmm:1; + uint8_t use_ymm:1; + void* gdbjit_block; + uint32_t need_x87check; // x87 low precision check + uint32_t need_dump; // need to dump the block + int need_reloc; // does the dynablock need relocations + int reloc_size; + uint32_t* relocs; + box64env_t* env; } dynarec_la64_t; void add_next(dynarec_la64_t *dyn, uintptr_t addr); @@ -139,18 +192,18 @@ void add_jump(dynarec_la64_t *dyn, int ninst); int get_first_jump(dynarec_la64_t *dyn, int next); int get_first_jump_addr(dynarec_la64_t *dyn, uintptr_t next); int is_nops(dynarec_la64_t *dyn, uintptr_t addr, int n); -int is_instructions(dynarec_la64_t *dyn, uintptr_t addr, int n); +int isTable64(dynarec_la64_t *dyn, uint64_t val); // return 1 if val already in Table64 int Table64(dynarec_la64_t *dyn, uint64_t val, int pass); // add a value to table64 (if needed) and gives back the imm19 to use in LDR_literal void CreateJmpNext(void* addr, void* next); -#define GO_TRACE(A, B, s0) \ - GETIP(addr); \ - MV(A1, xRIP); \ - STORE_XEMU_CALL(); \ - MOV64x(A2, B); \ - CALL(A, -1); \ +#define GO_TRACE(A, B, s0) \ + GETIP(addr, s0); \ + MV(x1, xRIP); \ + STORE_XEMU_CALL(); \ + MOV64x(x2, B); \ + CALL(const_##A, -1, x1, x2); \ LOAD_XEMU_CALL() #endif //__DYNAREC_ARM_PRIVATE_H_ diff --git a/src/dynarec/la64/la64_emitter.h b/src/dynarec/la64/la64_emitter.h index 25d800f..b359da9 100644 --- a/src/dynarec/la64/la64_emitter.h +++ b/src/dynarec/la64/la64_emitter.h @@ -4,153 +4,7 @@ LA64 Emitter */ -// LA64 ABI -/* -Name Alias Meaning saver ---------------------------------------------------------- -r0 zero Zero register - -r1 ra Return address Callee -r2 tp Thread pointer - -r3 sp Stack pointer Callee -r4-r5 a0-a1 Function arguments,Return val. Caller -r6-r11 a2-a7 Function arguments Caller -r12-r20 t0-t8 Temp registers Caller -r21 Reserved Non-allocatable - -r22 fp/s9 Frame pointer/Static register Callee -r23-31 s0-s8 Static registers Callee ---------------------------------------------------------- -f0-f1 fa0-fa1 Function arguments,Return val. Caller -f2-f7 fa2-fa7 Function arguments Caller -f8-f23 ft0-ft15 Temp registers Caller -f24-f31 fs0-fs7 Static registers Callee -*/ -/* - LA64 GPR mapping - There is no 15 registers free, so split the regs in 2 part - AX..DI : r12-r19 - R8..R15: r23-r30 - flags in r31 - ip in r20 -*/ -// x86 Register mapping -#define xRAX 12 -#define xRCX 13 -#define xRDX 14 -#define xRBX 15 -#define xRSP 16 -#define xRBP 17 -#define xRSI 18 -#define xRDI 19 -#define xR8 23 -#define xR9 24 -#define xR10 25 -#define xR11 26 -#define xR12 27 -#define xR13 28 -#define xR14 29 -#define xR15 30 -#define xFlags 31 -#define xRIP 20 -#define xSavedSP 22 -// function to move from x86 regs number to LA64 reg number -#define TO_LA64(A) (((A)>7)?((A)+15):((A)+12)) -// 32bits version -#define wEAX xRAX -#define wECX xRCX -#define wEDX xRDX -#define wEBX xRBX -#define wESP xRSP -#define wEBP xRBP -#define wESI xRSI -#define wEDI xRDI -#define wR8 xR8 -#define wR9 xR9 -#define wR10 xR10 -#define wR11 xR11 -#define wR12 xR12 -#define wR13 xR13 -#define wR14 xR14 -#define wR15 xR15 -#define wFlags xFlags -// scratch registers -#define x1 5 -#define x2 6 -#define x3 7 -#define x4 8 -#define x5 9 -#define x6 10 -// used to clear the upper 32bits -#define xMASK 11 -// 32bits version of scratch -#define w1 x1 -#define w2 x2 -#define w3 x3 -#define w4 x4 -#define w5 x5 -#define w6 x6 -// emu is r0 -#define xEmu 4 -// LA64 RA -#define xRA 1 -#define ra xRA -// LA64 SP -#define xSP 3 -// RV64 args -#define A0 4 -#define A1 5 -#define A2 6 -#define A3 7 -#define A4 8 -#define A5 9 -#define A6 10 -#define A7 11 -// xZR regs -#define xZR 0 -#define wZR xZR -#define r0 xZR - -#define fcc0 0 -#define fcc1 1 -#define fcc2 2 -#define fcc3 3 -#define fcc4 4 -#define fcc5 5 -#define fcc6 6 -#define fcc7 7 - -#define cAF 0x0 -#define cUN 0x8 -#define cEQ 0x4 -#define cUEQ 0xC -#define cLT 0x2 -#define cULT 0xA -#define cLE 0x6 -#define cULE 0xE -#define cNE 0x10 -#define cOR 0x14 -#define cUNE 0x18 -#define sAF 0x1 -#define sUN 0x9 -#define sEQ 0x5 -#define sUEQ 0xD -#define sLT 0x3 -#define sULT 0xB -#define sLE 0x7 -#define sULE 0xF -#define sNE 0x11 -#define sOR 0x15 -#define sUNE 0x19 - -#define FCSR0 0 -#define FCSR1 1 -#define FCSR2 2 -#define FCSR3 3 - -#define FR_V 28 -#define FR_Z 27 -#define FR_O 26 -#define FR_U 25 -#define FR_I 24 +#include "la64_mapping.h" #define RM_RNE 0b0000000000 #define RM_RZ 0b0100000000 @@ -176,11 +30,19 @@ f24-f31 fs0-fs7 Static registers Callee #define type_I26(opc, imm26) ((opc) << 26 | ((imm26) & 0xFFFF) << 10 | ((imm26 >> 16) & 0x3FF)) // Made-up formats not found in the spec. -#define type_1RI13(opc, imm13, rd) ((opc) << 18 | ((imm13) & 0x1FFFF) << 5 | (rd)) -#define type_2RI3(opc, imm3, rj, rd) ((opc) << 13 | ((imm3) & 0x7 ) << 10 | (rj) << 5 | (rd)) -#define type_2RI4(opc, imm4, rj, rd) ((opc) << 14 | ((imm4) & 0xF ) << 10 | (rj) << 5 | (rd)) -#define type_2RI5(opc, imm5, rj, rd) ((opc) << 15 | ((imm5) & 0x1F) << 10 | (rj) << 5 | (rd)) -#define type_2RI6(opc, imm6, rj, rd) ((opc) << 16 | ((imm6) & 0x3F) << 10 | (rj) << 5 | (rd)) +#define type_1RI13(opc, imm13, rd) ((opc) << 18 | ((imm13) & 0x1FFFF) << 5 | (rd)) +#define type_2RI1(opc, imm1, rj, rd) ((opc) << 11 | ((imm1) & 0x1) << 10 | (rj) << 5 | (rd)) +#define type_2RI2(opc, imm2, rj, rd) ((opc) << 12 | ((imm2) & 0x3) << 10 | (rj) << 5 | (rd)) +#define type_2RI3(opc, imm3, rj, rd) ((opc) << 13 | ((imm3) & 0x7) << 10 | (rj) << 5 | (rd)) +#define type_2RI4(opc, imm4, rj, rd) ((opc) << 14 | ((imm4) & 0xF) << 10 | (rj) << 5 | (rd)) +#define type_2RI5(opc, imm5, rj, rd) ((opc) << 15 | ((imm5) & 0x1F) << 10 | (rj) << 5 | (rd)) +#define type_2RI6(opc, imm6, rj, rd) ((opc) << 16 | ((imm6) & 0x3F) << 10 | (rj) << 5 | (rd)) +#define type_2RI7(opc, imm7, rj, rd) ((opc) << 17 | ((imm7) & 0x7F) << 10 | (rj) << 5 | (rd)) +#define type_2RI9(opc, imm9, rj, rd) ((opc) << 19 | ((imm9) & 0x1FF) << 10 | (rj) << 5 | (rd)) +#define type_2RI10(opc, imm10, rj, rd) ((opc) << 20 | ((imm10) & 0x3FF) << 10 | (rj) << 5 | (rd)) +#define type_2RI11(opc, imm11, rj, rd) ((opc) << 21 | ((imm11) & 0x7FF) << 10 | (rj) << 5 | (rd)) +#define type_2RI13(opc, imm13, rj, rd) ((opc) << 23 | ((imm13) & 0x1FFF) << 10 | (rj) << 5 | (rd)) +#define type_1RI5I5(opc, imm5, imm5_2, rd) ((opc) << 15 | ((imm5) & 0x1F) << 10 | ((imm5_2) & 0x1F) << 5 | (rd)) // tmp = GR[rj][31:0] + GR[rk][31:0] // Gr[rd] = SignExtend(tmp[31:0], GRLEN) @@ -207,13 +69,43 @@ f24-f31 fs0-fs7 Static registers Callee // tmp = (GR[rj][31:0] << imm) + GR[rk][31:0] // GR[rd] = SignExtend(tmp[31:0], GRLEN) -#define ALSL_W(rd, rj, rk, imm) EMIT(type_3RI2(0b000000000000010, (imm - 1), rk, rj, rd)) +#define ALSL_W(rd, rj, rk, imm) \ + do { \ + if (imm) \ + EMIT(type_3RI2(0b000000000000010, ((imm) - 1), rk, rj, rd)); \ + else \ + ADD_W(rd, rj, rk); \ + } while (0) + // tmp = (GR[rj][31:0] << imm) + GR[rk][31:0] // GR[rd] = ZeroExtend(tmp[31:0], GRLEN) -#define ALSL_WU(rd, rj, rk, imm) EMIT(type_3RI2(0b000000000000011, (imm - 1), rk, rj, rd)) +#define ALSL_WU(rd, rj, rk, imm) \ + do { \ + if (imm) \ + EMIT(type_3RI2(0b000000000000011, ((imm) - 1), rk, rj, rd)); \ + else { \ + ADD_W(rd, rj, rk); \ + ZEROUP(rd); \ + } \ + } while (0) + // tmp = (GR[rj][63:0] << imm) + GR[rk][63:0] // GR[rd] = tmp[63:0] -#define ALSL_D(rd, rj, rk, imm) EMIT(type_3RI2(0b000000000010110, (imm - 1), rk, rj, rd)) +#define ALSL_D(rd, rj, rk, imm) \ + do { \ + if (imm) \ + EMIT(type_3RI2(0b000000000010110, ((imm) - 1), rk, rj, rd)); \ + else \ + ADD_D(rd, rj, rk); \ + } while (0) + +#define ALSLy(rd, rj, rk, imm) \ + do { \ + if (rex.is32bits || rex.is67) \ + ALSL_WU(rd, rj, rk, imm); \ + else \ + ALSL_D(rd, rj, rk, imm); \ + } while (0) // GR[rd] = SignExtend({imm20, 12'b0}, GRLEN) #define LU12I_W(rd, imm20) EMIT(type_1RI20(0b0001010, imm20, rd)) @@ -233,10 +125,10 @@ f24-f31 fs0-fs7 Static registers Callee // GR[rd] = (unsigned(GR[rj]) < unsigned(tmp)) ? 1 : 0 #define SLTUI(rd, rj, imm12) EMIT(type_2RI12(0b1001, imm12, rj, rd)) -// rd = rs1 == 0 -#define SEQZ(rd, rs1) SLTUI(rd, rs1, 1) -// rd = rs1 != 0 -#define SNEZ(rd, rs1) SLTU(rd, xZR, rs1) +// rd = rj == 0 +#define SEQZ(rd, rj) SLTUI(rd, rj, 1) +// rd = rj != 0 +#define SNEZ(rd, rj) SLTU(rd, xZR, rj) // GR[rd] = PC + SignExtend({imm20, 2'b0}, GRLEN) #define PCADDI(rd, imm20) EMIT(type_1RI20(0b0001100, imm20, rd)) @@ -261,6 +153,16 @@ f24-f31 fs0-fs7 Static registers Callee // DBAR hint #define DBAR(hint) EMIT(type_hint(0b00111000011100100, hint)) +#define DBAR_RW_RW() DBAR(0b10000) +#define DBAR_R_RW() DBAR(0b10100) +#define DBAR_W_RW() DBAR(0b11000) + +#define DMB_ISH() DBAR_RW_RW() +#define DMB_ISHLD() DBAR_R_RW() +#define DMB_ISHST() DBAR_W_RW() + +#define BRK(hint) EMIT(type_hint(0b00000000001010100, hint)) + // GR[rd] = GR[rj] & GR[rk] #define AND(rd, rj, rk) EMIT(type_3R(0b00000000000101001, rk, rj, rd)) // GR[rd] = GR[rj] | GR[rk] @@ -283,6 +185,11 @@ f24-f31 fs0-fs7 Static registers Callee #define NOP() ANDI(xZR, xZR, 0) +#define BREAK() EMIT(0b1010100) + +// there is no UDF instruction, use BREAK instead is an acceptable offer +#define UDF() BREAK() + // tmp = SLL(GR[rj][31:0], GR[rk][4:0]) // GR[rd] = SignExtend(tmp[31:0], GRLEN) #define SLL_W(rd, rj, rk) EMIT(type_3R(0b00000000000101110, rk, rj, rd)) @@ -354,59 +261,57 @@ f24-f31 fs0-fs7 Static registers Callee } while (0) // Shift Left Immediate -#define SLLIxw(rd, rs1, imm) \ - do { \ - if (rex.w) { \ - SLLI_D(rd, rs1, imm); \ - } else { \ - SLLI_W(rd, rs1, imm); \ - ZEROUP(rd); \ - } \ +#define SLLIxw(rd, rj, imm) \ + do { \ + if (rex.w) { \ + SLLI_D(rd, rj, imm); \ + } else { \ + SLLI_W(rd, rj, imm); \ + ZEROUP(rd); \ + } \ + } while (0) +#define SLLIy(rd, rj, imm) \ + do { \ + if (rex.is32bits || rex.is67) { \ + SLLI_W(rd, rj, imm); \ + ZEROUP(rd); \ + } else \ + SLLI_D(rd, rj, imm); \ } while (0) + // Shift Right Logical Immediate -#define SRLIxw(rd, rs1, imm) \ +#define SRLIxw(rd, rj, imm) \ do { \ if (rex.w) { \ - SRLI_D(rd, rs1, imm); \ + SRLI_D(rd, rj, imm); \ } else { \ - SRLI_W(rd, rs1, imm); \ + SRLI_W(rd, rj, imm); \ if ((imm) == 0) ZEROUP(rd); \ } \ } while (0) // Shift Right Arithmetic Immediate -#define SRAIxw(rd, rs1, imm) \ +#define SRAIxw(rd, rj, imm) \ + do { \ + if (rex.w) { \ + SRAI_D(rd, rj, imm); \ + } else { \ + SRAI_W(rd, rj, imm); \ + ZEROUP(rd); \ + } \ + } while (0) + +#define ROTRIxw(rd, rj, imm) \ do { \ if (rex.w) { \ - SRAI_D(rd, rs1, imm); \ + ROTRI_D(rd, rj, imm); \ } else { \ - SRAI_W(rd, rs1, imm); \ + ROTRI_W(rd, rj, imm); \ ZEROUP(rd); \ } \ } while (0) -#define ROTRIxw(rd, rs1, imm) \ - do { \ - if (rex.w) { \ - ROTRI_D(rd, rs1, imm); \ - } else { \ - ROTRI_W(rd, rs1, imm); \ - ZEROUP(rd); \ - } \ - } while (0) - -// rd = rj + (rk << imm6) -#define ADDSL(rd, rs1, rs2, imm6, scratch) \ - do { \ - if (!(imm6)) { \ - ADD_D(rd, rs1, rs2); \ - } else { \ - SLLI_D(scratch, rs2, imm6); \ - ADD_D(rd, rs1, scratch); \ - } \ - } while (0) - -#define SEXT_W(rd, rs1) SLLI_W(rd, rs1, 0) +#define SEXT_W(rd, rj) SLLI_W(rd, rj, 0) // product = signed(GR[rj][31:0]) * signed(GR[rk][31:0]) // GR[rd] = SignExtend(product[31:0], GRLEN) @@ -442,18 +347,22 @@ f24-f31 fs0-fs7 Static registers Callee // quotient = signed(GR[rj][31:0]) / signed(GR[rk][31:0]) // GR[rd] = SignExtend(quotient[31:0], GRLEN) +// Warning: rj and rk must be sign-extended! #define DIV_W(rd, rj, rk) EMIT(type_3R(0b00000000001000000, rk, rj, rd)) // quotient = unsigned(GR[rj][31:0]) / unsigned(GR[rk][31:0]) // GR[rd] = SignExtend(quotient[31:0], GRLEN) +// Warning: rj and rk must be sign-extended! #define DIV_WU(rd, rj, rk) EMIT(type_3R(0b00000000001000010, rk, rj, rd)) // remainder = signed(GR[rj][31:0]) % signed(GR[rk][31:0]) // GR[rd] = SignExtend(remainder[31:0], GRLEN) +// Warning: rj and rk must be sign-extended! #define MOD_W(rd, rj, rk) EMIT(type_3R(0b00000000001000001, rk, rj, rd)) // remainder = unsigned(GR[rj][31:0]) % unsigned(GR[rk][31:0]) // GR[rd] = SignExtend(remainder[31:0], GRLEN) +// Warning: rj and rk must be sign-extended! #define MOD_WU(rd, rj, rk) EMIT(type_3R(0b00000000001000011, rk, rj, rd)) // GR[rd] = signed(GR[rj][63:0]) / signed(GR[rk][63:0]) @@ -497,7 +406,14 @@ f24-f31 fs0-fs7 Static registers Callee #define BSTRPICK_D(rd, rj, msbd6, lsbd6) EMIT(type_2RI12(0b0000000011, ((msbd6) & 0x3F) << 6 | ((lsbd6) & 0x3F), rj, rd)) // ZERO the upper part -#define ZEROUP(rd) BSTRINS_D(rd, xZR, 63, 32); +#define ZEROUP(rd) BSTRPICK_D(rd, rd, 31, 0) +#define ZEROUP2(rd, rj) BSTRPICK_D(rd, rj, 31, 0) + +#define BSTRINSz(rd, rj, msbd6, lsbd6) \ + do { \ + BSTRINS_D(rd, rj, msbd6, lsbd6); \ + if (rex.is32bits) ZEROUP(rd); \ + } while (0) #define CLO_W(rd, rj) EMIT(type_2R(0b0000000000000000000100, rj, rd)) #define CLZ_W(rd, rj) EMIT(type_2R(0b0000000000000000000101, rj, rd)) @@ -537,6 +453,14 @@ f24-f31 fs0-fs7 Static registers Callee } \ } while (0) +#define CLZxw(rd, rj) \ + do { \ + if (rex.w) { \ + CLZ_D(rd, rj); \ + } else { \ + CLZ_W(rd, rj); \ + } \ + } while (0) // GR[rd] = SignExtend(GR[rj][7:0], GRLEN) #define EXT_W_B(rd, rj) EMIT(type_2R(0b0000000000000000010111, rj, rd)) @@ -546,55 +470,110 @@ f24-f31 fs0-fs7 Static registers Callee // if GR[rj] == GR[rd]: // PC = PC + SignExtend({imm16, 2'b0}, GRLEN) -#define BEQ(rj, rd, imm18) EMIT(type_2RI16(0b010110, ((imm18)>>2), rj, rd)) +#define BEQ(rj, rd, imm18) EMIT(type_2RI16(0b010110, ((imm18) >> 2), rj, rd)) // if GR[rj] != GR[rd]: // PC = PC + SignExtend({imm16, 2'b0}, GRLEN) -#define BNE(rj, rd, imm18) EMIT(type_2RI16(0b010111, ((imm18)>>2), rj, rd)) +#define BNE(rj, rd, imm18) EMIT(type_2RI16(0b010111, ((imm18) >> 2), rj, rd)) // if signed(GR[rj]) < signed(GR[rd]): // PC = PC + SignExtend({imm16, 2'b0}, GRLEN) -#define BLT(rj, rd, imm18) EMIT(type_2RI16(0b011000, ((imm18)>>2), rj, rd)) +#define BLT(rj, rd, imm18) EMIT(type_2RI16(0b011000, ((imm18) >> 2), rj, rd)) // if signed(GR[rj]) >= signed(GR[rd]): // PC = PC + SignExtend({imm16, 2'b0}, GRLEN) -#define BGE(rj, rd, imm18) EMIT(type_2RI16(0b011001, ((imm18)>>2), rj, rd)) +#define BGE(rj, rd, imm18) EMIT(type_2RI16(0b011001, ((imm18) >> 2), rj, rd)) // if unsigned(GR[rj]) == unsigned(GR[rd]): // PC = PC + SignExtend({imm16, 2'b0}, GRLEN) -#define BLTU(rj, rd, imm18) EMIT(type_2RI16(0b011010, ((imm18)>>2), rj, rd)) +#define BLTU(rj, rd, imm18) EMIT(type_2RI16(0b011010, ((imm18) >> 2), rj, rd)) // if unsigned(GR[rj]) == unsigned(GR[rd]): // PC = PC + SignExtend({imm16, 2'b0}, GRLEN) -#define BGEU(rj, rd, imm18) EMIT(type_2RI16(0b011011, ((imm18)>>2), rj, rd)) +#define BGEU(rj, rd, imm18) EMIT(type_2RI16(0b011011, ((imm18) >> 2), rj, rd)) // if GR[rj] == 0: // PC = PC + SignExtend({imm21, 2'b0}, GRLEN) -#define BEQZ(rj, imm23) EMIT(type_1RI21(0b010000, ((imm23)>>2), rj)) +#define BEQZ(rj, imm23) EMIT(type_1RI21(0b010000, ((imm23) >> 2), rj)) // if GR[rj] != 0: // PC = PC + SignExtend({imm21, 2'b0}, GRLEN) #define BNEZ(rj, imm23) EMIT(type_1RI21(0b010001, ((imm23) >> 2), rj)) -#define BCEQZ(cj, imm23) EMIT(type_1RI21(0b010010, ((imm23)>>2), 0b00000 | cj)) -#define BCNEZ(cj, imm23) EMIT(type_1RI21(0b010010, ((imm23)>>2), 0b01000 | cj)) +#define BGT(rj, rd, imm13) BLT(rd, rj, imm13) +#define BLE(rj, rd, imm13) BGE(rd, rj, imm13) +#define BGTU(rj, rd, imm13) BLTU(rd, rj, imm13) +#define BLEU(rj, rd, imm13) BGEU(rd, rj, imm13) + +#define SEQ(rd, rj, rk) \ + do { \ + if (rj == xZR) { \ + SEQZ(rd, rk); \ + } else if (rk == xZR) { \ + SEQZ(rd, rj); \ + } else { \ + XOR(rd, rj, rk); \ + SEQZ(rd, rd); \ + } \ + } while (0) + +#define SNE(rd, rj, rk) \ + do { \ + if (rj == xZR) { \ + SNEZ(rd, rk); \ + } else if (rk == xZR) { \ + SNEZ(rd, rj); \ + } else { \ + XOR(rd, rj, rk); \ + SNEZ(rd, rd); \ + } \ + } while (0) + +#define SGE(rd, rj, rk) \ + do { \ + if (rj == xZR) { \ + SLTI(rd, rk, 1); \ + } else { \ + SLT(rd, rj, rk); \ + XORI(rd, rd, 1); \ + } \ + } while (0) + +#define SGEU(rd, rj, rk) \ + do { \ + if (rj == xZR) { \ + SEQZ(rd, rk); \ + } else if (rk == xZR) { \ + ADDI_D(rd, xZR, 1); \ + } else { \ + SLTU(rd, rj, rk); \ + XORI(rd, rd, 1); \ + } \ + } while (0) + +#define SGT(rd, rj, rk) SLT(rd, rk, rj); +#define SLE(rd, rj, rk) SGE(rd, rk, rj); +#define SGTU(rd, rj, rk) SLTU(rd, rk, rj); +#define SLEU(rd, rj, rk) SGEU(rd, rk, rj); + +#define BCEQZ(cj, imm23) EMIT(type_1RI21(0b010010, ((imm23) >> 2), 0b00000 | cj)) +#define BCNEZ(cj, imm23) EMIT(type_1RI21(0b010010, ((imm23) >> 2), 0b01000 | cj)) // GR[rd] = PC + 4 // PC = GR[rj] + SignExtend({imm16, 2'b0}, GRLEN) -#define JIRL(rd, rj, imm18) EMIT(type_2RI16(0b010011, ((imm18)>>2), rj, rd)) +#define JIRL(rd, rj, imm18) EMIT(type_2RI16(0b010011, ((imm18) >> 2), rj, rd)) // PC = GR[rj] #define BR(rj) JIRL(xZR, rj, 0x0) // PC = PC + SignExtend({imm26, 2'b0}, GRLEN) -#define B(imm28) EMIT(type_I26(0b010100, ((imm28)>>2))) +#define B(imm28) EMIT(type_I26(0b010100, ((imm28) >> 2))) #define B__(reg1, reg2, imm28) B(imm28) #define BEQ_safe(rj, rd, imm) \ - if { \ + do { \ if ((imm) > -0x20000 && (imm) < 0x20000) { \ BEQ(rj, rd, imm); \ NOP(); \ } else { \ BNE(rj, rd, 8); \ - B(imm - 4); \ + B((imm) - 4); \ } \ - } \ - while (0) + } while (0) #define BNE_safe(rj, rd, imm) \ do { \ @@ -603,7 +582,7 @@ f24-f31 fs0-fs7 Static registers Callee NOP(); \ } else { \ BEQ(rj, rd, 8); \ - B(imm - 4); \ + B((imm) - 4); \ } \ } while (0) @@ -614,7 +593,7 @@ f24-f31 fs0-fs7 Static registers Callee NOP(); \ } else { \ BGE(rj, rd, 8); \ - B(imm - 4); \ + B((imm) - 4); \ } \ } while (0) @@ -625,7 +604,7 @@ f24-f31 fs0-fs7 Static registers Callee NOP(); \ } else { \ BLT(rj, rd, 8); \ - B(imm - 4); \ + B((imm) - 4); \ } \ } while (0) @@ -636,7 +615,7 @@ f24-f31 fs0-fs7 Static registers Callee NOP(); \ } else { \ BGEU(rj, rd, 8); \ - B(imm - 4); \ + B((imm) - 4); \ } \ } while (0) @@ -647,7 +626,51 @@ f24-f31 fs0-fs7 Static registers Callee NOP(); \ } else { \ BLTU(rj, rd, 8); \ - B(imm - 4); \ + B((imm) - 4); \ + } \ + } while (0) + +#define BGT_safe(rj, rd, imm) \ + do { \ + if ((imm) > -0x20000 && (imm) < 0x20000) { \ + BGT(rj, rd, imm); \ + NOP(); \ + } else { \ + BLE(rj, rd, 8); \ + B((imm) - 4); \ + } \ + } while (0) + +#define BLE_safe(rj, rd, imm) \ + do { \ + if ((imm) > -0x20000 && (imm) < 0x20000) { \ + BLE(rj, rd, imm); \ + NOP(); \ + } else { \ + BGT(rj, rd, 8); \ + B((imm) - 4); \ + } \ + } while (0) + +#define BGTU_safe(rj, rd, imm) \ + do { \ + if ((imm) > -0x20000 && (imm) < 0x20000) { \ + BGTU(rj, rd, imm); \ + NOP(); \ + } else { \ + BLEU(rj, rd, 8); \ + B((imm) - 4); \ + } \ + } while (0) + +#define BLEU_safe(rj, rd, imm) \ + do { \ + if ((imm) > -0x20000 && (imm) < 0x20000) { \ + BLEU(rj, rd, imm); \ + NOP(); \ + } else { \ + BGTU(rj, rd, 8); \ + B((imm) - 4); \ } \ } while (0) @@ -658,7 +681,7 @@ f24-f31 fs0-fs7 Static registers Callee NOP(); \ } else { \ BNEZ(rj, 8); \ - B(imm - 4); \ + B((imm) - 4); \ } \ } while (0) @@ -669,7 +692,7 @@ f24-f31 fs0-fs7 Static registers Callee NOP(); \ } else { \ BEQZ(rj, 8); \ - B(imm - 4); \ + B((imm) - 4); \ } \ } while (0) @@ -736,6 +759,20 @@ f24-f31 fs0-fs7 Static registers Callee // MemoryStore(GR[rd][63:0], paddr, DOUBLEWORD) #define ST_D(rd, rj, imm12) EMIT(type_2RI12(0b0010100111, imm12, rj, rd)) +#define PRELD(hint, rj, imm12) EMIT(type_2RI12(0b0010101011, imm12, rj, hint)) + +#define PRELDX(hint, rj, rk) EMIT(type_3R(0b00111000001011000, rk, rj, hint)) + +#define PRELDX_LOAD_L3_1CACHELINE(rj, s1) \ + do { \ + MOV64x(s1, (0b0000000000000000ULL << 44) /* stride */ \ + | (0b00000000ULL << 32) /* 1 block */ \ + | (0b000000ULL << 20) /* 16-byte */ \ + | (0b0ULL << 16) /* asc */ \ + | 0x0000ULL); /* offset */ \ + PRELDX(2 /* L3 load */, rj, s1); \ + } while (0) + #define LDX_B(rd, rj, rk) EMIT(type_3R(0b00111000000000000, rk, rj, rd)) #define LDX_H(rd, rj, rk) EMIT(type_3R(0b00111000000001000, rk, rj, rd)) #define LDX_W(rd, rj, rk) EMIT(type_3R(0b00111000000010000, rk, rj, rd)) @@ -748,6 +785,15 @@ f24-f31 fs0-fs7 Static registers Callee #define LDX_HU(rd, rj, rk) EMIT(type_3R(0b00111000001001000, rk, rj, rd)) #define LDX_WU(rd, rj, rk) EMIT(type_3R(0b00111000001010000, rk, rj, rd)) +#define CRC_W_B_W(rd, rk, rj) EMIT(type_3R(0b00000000001001000, rk, rj, rd)) +#define CRC_W_H_W(rd, rk, rj) EMIT(type_3R(0b00000000001001001, rk, rj, rd)) +#define CRC_W_W_W(rd, rk, rj) EMIT(type_3R(0b00000000001001010, rk, rj, rd)) +#define CRC_W_D_W(rd, rk, rj) EMIT(type_3R(0b00000000001001011, rk, rj, rd)) +#define CRCC_W_B_W(rd, rk, rj) EMIT(type_3R(0b00000000001001100, rk, rj, rd)) +#define CRCC_W_H_W(rd, rk, rj) EMIT(type_3R(0b00000000001001101, rk, rj, rd)) +#define CRCC_W_W_W(rd, rk, rj) EMIT(type_3R(0b00000000001001110, rk, rj, rd)) +#define CRCC_W_D_W(rd, rk, rj) EMIT(type_3R(0b00000000001001111, rk, rj, rd)) + // Beware the position of rj and rk are swapped in atomic instructions. #define AMCAS_B(rd, rk, rj) EMIT(type_3R(0b00111000010110000, rk, rj, rd)) #define AMCAS_H(rd, rk, rj) EMIT(type_3R(0b00111000010110001, rk, rj, rd)) @@ -802,10 +848,24 @@ f24-f31 fs0-fs7 Static registers Callee #define AMMIN_DB_WU(rd, rk, rj) EMIT(type_3R(0b00111000011100010, rk, rj, rd)) #define AMMIN_DB_DU(rd, rk, rj) EMIT(type_3R(0b00111000011100011, rk, rj, rd)) +#define AMAND_DBxw(rd, rk, rj) EMIT(type_3R(0b00111000011010110 | rex.w, rk, rj, rd)) + #define FLD_D(fd, rj, imm12) EMIT(type_2RI12(0b0010101110, imm12, rj, fd)) #define FLD_S(fd, rj, imm12) EMIT(type_2RI12(0b0010101100, imm12, rj, fd)) #define FST_D(fd, rj, imm12) EMIT(type_2RI12(0b0010101111, imm12, rj, fd)) #define FST_S(fd, rj, imm12) EMIT(type_2RI12(0b0010101101, imm12, rj, fd)) +#define FLDX_D(fd, rj, rk) EMIT(type_3R(0b00111000001101000, rk, rj, fd)) +#define FLDX_S(fd, rj, rk) EMIT(type_3R(0b00111000001100000, rk, rj, fd)) +#define FSTX_D(fd, rj, rk) EMIT(type_3R(0b00111000001111000, rk, rj, fd)) +#define FSTX_S(fd, rj, rk) EMIT(type_3R(0b00111000001110000, rk, rj, fd)) +#define FLDGT_D(fd, rj, rk) EMIT(type_3R(0b00111000011101001, rk, rj, fd)) +#define FLDGT_S(fd, rj, rk) EMIT(type_3R(0b00111000011101000, rk, rj, fd)) +#define FLDLE_D(fd, rj, rk) EMIT(type_3R(0b00111000011101011, rk, rj, fd)) +#define FLDLE_S(fd, rj, rk) EMIT(type_3R(0b00111000011101010, rk, rj, fd)) +#define FSTGT_D(fd, rj, rk) EMIT(type_3R(0b00111000011101101, rk, rj, fd)) +#define FSTGT_S(fd, rj, rk) EMIT(type_3R(0b00111000011101100, rk, rj, fd)) +#define FSTLE_D(fd, rj, rk) EMIT(type_3R(0b00111000011101111, rk, rj, fd)) +#define FSTLE_S(fd, rj, rk) EMIT(type_3R(0b00111000011101110, rk, rj, fd)) #define FADD_S(fd, fj, fk) EMIT(type_3R(0b00000001000000001, fk, fj, fd)) #define FADD_D(fd, fj, fk) EMIT(type_3R(0b00000001000000010, fk, fj, fd)) @@ -899,6 +959,8 @@ f24-f31 fs0-fs7 Static registers Callee #define FCMP_D(cd, fj, fk, cond) EMIT(type_4R(0b000011000010, cond, fk, fj, cd & 0b111)) #define FSEL(fd, fj, fk, ca) EMIT(type_4R(0b000011010000, ca & 0b111, fk, fj, fd)) +#define RDTIME_D(rd, rj) EMIT(type_2R(0b11010, rj, rd)) + //////////////////////////////////////////////////////////////////////////////// // (undocumented) LSX/LASX extension instructions @@ -918,470 +980,561 @@ LSX instruction starts with V, LASX instruction starts with XV. */ -#define VADD_B(vd, vj, vk) EMIT(type_3R(0b01110000000010100, vk, vj, vd)) -#define VADD_H(vd, vj, vk) EMIT(type_3R(0b01110000000010101, vk, vj, vd)) -#define VADD_W(vd, vj, vk) EMIT(type_3R(0b01110000000010110, vk, vj, vd)) -#define VADD_D(vd, vj, vk) EMIT(type_3R(0b01110000000010111, vk, vj, vd)) -#define VADD_Q(vd, vj, vk) EMIT(type_3R(0b01110001001011010, vk, vj, vd)) -#define VSUB_B(vd, vj, vk) EMIT(type_3R(0b01110000000011000, vk, vj, vd)) -#define VSUB_H(vd, vj, vk) EMIT(type_3R(0b01110000000011001, vk, vj, vd)) -#define VSUB_W(vd, vj, vk) EMIT(type_3R(0b01110000000011010, vk, vj, vd)) -#define VSUB_D(vd, vj, vk) EMIT(type_3R(0b01110000000011011, vk, vj, vd)) -#define VSUB_Q(vd, vj, vk) EMIT(type_3R(0b01110001001011011, vk, vj, vd)) -#define VADDI_BU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100010100, imm5, vj, vd)) -#define VADDI_HU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100010101, imm5, vj, vd)) -#define VADDI_WU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100010110, imm5, vj, vd)) -#define VADDI_DU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100010111, imm5, vj, vd)) -#define VSUBI_BU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100011000, imm5, vj, vd)) -#define VSUBI_HU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100011001, imm5, vj, vd)) -#define VSUBI_WU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100011010, imm5, vj, vd)) -#define VSUBI_DU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100011011, imm5, vj, vd)) -#define VSADD_B(vd, vj, vk) EMIT(type_3R(0b01110000010001100, vk, vj, vd)) -#define VSADD_H(vd, vj, vk) EMIT(type_3R(0b01110000010001101, vk, vj, vd)) -#define VSADD_W(vd, vj, vk) EMIT(type_3R(0b01110000010001110, vk, vj, vd)) -#define VSADD_D(vd, vj, vk) EMIT(type_3R(0b01110000010001111, vk, vj, vd)) -#define VSADD_BU(vd, vj, vk) EMIT(type_3R(0b01110000010010100, vk, vj, vd)) -#define VSADD_HU(vd, vj, vk) EMIT(type_3R(0b01110000010010101, vk, vj, vd)) -#define VSADD_WU(vd, vj, vk) EMIT(type_3R(0b01110000010010110, vk, vj, vd)) -#define VSADD_DU(vd, vj, vk) EMIT(type_3R(0b01110000010010111, vk, vj, vd)) -#define VSSUB_B(vd, vj, vk) EMIT(type_3R(0b01110000010010000, vk, vj, vd)) -#define VSSUB_H(vd, vj, vk) EMIT(type_3R(0b01110000010010001, vk, vj, vd)) -#define VSSUB_W(vd, vj, vk) EMIT(type_3R(0b01110000010010010, vk, vj, vd)) -#define VSSUB_D(vd, vj, vk) EMIT(type_3R(0b01110000010010011, vk, vj, vd)) -#define VSSUB_BU(vd, vj, vk) EMIT(type_3R(0b01110000010011000, vk, vj, vd)) -#define VSSUB_HU(vd, vj, vk) EMIT(type_3R(0b01110000010011001, vk, vj, vd)) -#define VSSUB_WU(vd, vj, vk) EMIT(type_3R(0b01110000010011010, vk, vj, vd)) -#define VSSUB_DU(vd, vj, vk) EMIT(type_3R(0b01110000010011011, vk, vj, vd)) -#define VHADDW_H_B(vd, vj, vk) EMIT(type_3R(0b01110000010101000, vk, vj, vd)) -#define VHADDW_W_H(vd, vj, vk) EMIT(type_3R(0b01110000010101001, vk, vj, vd)) -#define VHADDW_D_W(vd, vj, vk) EMIT(type_3R(0b01110000010101010, vk, vj, vd)) -#define VHADDW_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000010101011, vk, vj, vd)) -#define VHADDW_HU_BU(vd, vj, vk) EMIT(type_3R(0b01110000010110000, vk, vj, vd)) -#define VHADDW_WU_HU(vd, vj, vk) EMIT(type_3R(0b01110000010110001, vk, vj, vd)) -#define VHADDW_DU_WU(vd, vj, vk) EMIT(type_3R(0b01110000010110010, vk, vj, vd)) -#define VHADDW_QU_DU(vd, vj, vk) EMIT(type_3R(0b01110000010110011, vk, vj, vd)) -#define VHSUBW_H_B(vd, vj, vk) EMIT(type_3R(0b01110000010101100, vk, vj, vd)) -#define VHSUBW_W_H(vd, vj, vk) EMIT(type_3R(0b01110000010101101, vk, vj, vd)) -#define VHSUBW_D_W(vd, vj, vk) EMIT(type_3R(0b01110000010101110, vk, vj, vd)) -#define VHSUBW_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000010101111, vk, vj, vd)) -#define VHSUBW_HU_BU(vd, vj, vk) EMIT(type_3R(0b01110000010110100, vk, vj, vd)) -#define VHSUBW_WU_HU(vd, vj, vk) EMIT(type_3R(0b01110000010110101, vk, vj, vd)) -#define VHSUBW_DU_WU(vd, vj, vk) EMIT(type_3R(0b01110000010110110, vk, vj, vd)) -#define VHSUBW_QU_DU(vd, vj, vk) EMIT(type_3R(0b01110000010110111, vk, vj, vd)) -#define VADDWEV_H_B(vd, vj, vk) EMIT(type_3R(0b01110000000111100, vk, vj, vd)) -#define VADDWEV_W_H(vd, vj, vk) EMIT(type_3R(0b01110000000111101, vk, vj, vd)) -#define VADDWEV_D_W(vd, vj, vk) EMIT(type_3R(0b01110000000111110, vk, vj, vd)) -#define VADDWEV_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000000111111, vk, vj, vd)) -#define VADDWOD_H_B(vd, vj, vk) EMIT(type_3R(0b01110000001000100, vk, vj, vd)) -#define VADDWOD_W_H(vd, vj, vk) EMIT(type_3R(0b01110000001000101, vk, vj, vd)) -#define VADDWOD_D_W(vd, vj, vk) EMIT(type_3R(0b01110000001000110, vk, vj, vd)) -#define VADDWOD_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000001000111, vk, vj, vd)) -#define VSUBWEV_H_B(vd, vj, vk) EMIT(type_3R(0b01110000001000000, vk, vj, vd)) -#define VSUBWEV_W_H(vd, vj, vk) EMIT(type_3R(0b01110000001000001, vk, vj, vd)) -#define VSUBWEV_D_W(vd, vj, vk) EMIT(type_3R(0b01110000001000010, vk, vj, vd)) -#define VSUBWEV_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000001000011, vk, vj, vd)) -#define VSUBWOD_H_B(vd, vj, vk) EMIT(type_3R(0b01110000001001000, vk, vj, vd)) -#define VSUBWOD_W_H(vd, vj, vk) EMIT(type_3R(0b01110000001001001, vk, vj, vd)) -#define VSUBWOD_D_W(vd, vj, vk) EMIT(type_3R(0b01110000001001010, vk, vj, vd)) -#define VSUBWOD_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000001001011, vk, vj, vd)) -#define VADDWEV_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000001011100, vk, vj, vd)) -#define VADDWEV_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000001011101, vk, vj, vd)) -#define VADDWEV_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000001011110, vk, vj, vd)) -#define VADDWEV_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000001011111, vk, vj, vd)) -#define VADDWOD_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000001100100, vk, vj, vd)) -#define VADDWOD_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000001100101, vk, vj, vd)) -#define VADDWOD_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000001100110, vk, vj, vd)) -#define VADDWOD_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000001100111, vk, vj, vd)) -#define VSUBWEV_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000001100000, vk, vj, vd)) -#define VSUBWEV_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000001100001, vk, vj, vd)) -#define VSUBWEV_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000001100010, vk, vj, vd)) -#define VSUBWEV_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000001100011, vk, vj, vd)) -#define VSUBWOD_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000001101000, vk, vj, vd)) -#define VSUBWOD_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000001101001, vk, vj, vd)) -#define VSUBWOD_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000001101010, vk, vj, vd)) -#define VSUBWOD_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000001101011, vk, vj, vd)) -#define VADDWEV_H_BU_B(vd, vj, vk) EMIT(type_3R(0b01110000001111100, vk, vj, vd)) -#define VADDWEV_W_HU_H(vd, vj, vk) EMIT(type_3R(0b01110000001111101, vk, vj, vd)) -#define VADDWEV_D_WU_W(vd, vj, vk) EMIT(type_3R(0b01110000001111110, vk, vj, vd)) -#define VADDWEV_Q_DU_D(vd, vj, vk) EMIT(type_3R(0b01110000001111111, vk, vj, vd)) -#define VADDWOD_H_BU_B(vd, vj, vk) EMIT(type_3R(0b01110000010000000, vk, vj, vd)) -#define VADDWOD_W_HU_H(vd, vj, vk) EMIT(type_3R(0b01110000010000001, vk, vj, vd)) -#define VADDWOD_D_WU_W(vd, vj, vk) EMIT(type_3R(0b01110000010000010, vk, vj, vd)) -#define VADDWOD_Q_DU_D(vd, vj, vk) EMIT(type_3R(0b01110000010000011, vk, vj, vd)) -#define VAVG_B(vd, vj, vk) EMIT(type_3R(0b01110000011001000, vk, vj, vd)) -#define VAVG_H(vd, vj, vk) EMIT(type_3R(0b01110000011001001, vk, vj, vd)) -#define VAVG_W(vd, vj, vk) EMIT(type_3R(0b01110000011001010, vk, vj, vd)) -#define VAVG_D(vd, vj, vk) EMIT(type_3R(0b01110000011001011, vk, vj, vd)) -#define VAVG_BU(vd, vj, vk) EMIT(type_3R(0b01110000011001100, vk, vj, vd)) -#define VAVG_HU(vd, vj, vk) EMIT(type_3R(0b01110000011001101, vk, vj, vd)) -#define VAVG_WU(vd, vj, vk) EMIT(type_3R(0b01110000011001110, vk, vj, vd)) -#define VAVG_DU(vd, vj, vk) EMIT(type_3R(0b01110000011001111, vk, vj, vd)) -#define VAVGR_B(vd, vj, vk) EMIT(type_3R(0b01110000011010000, vk, vj, vd)) -#define VAVGR_H(vd, vj, vk) EMIT(type_3R(0b01110000011010001, vk, vj, vd)) -#define VAVGR_W(vd, vj, vk) EMIT(type_3R(0b01110000011010010, vk, vj, vd)) -#define VAVGR_D(vd, vj, vk) EMIT(type_3R(0b01110000011010011, vk, vj, vd)) -#define VAVGR_BU(vd, vj, vk) EMIT(type_3R(0b01110000011010100, vk, vj, vd)) -#define VAVGR_HU(vd, vj, vk) EMIT(type_3R(0b01110000011010101, vk, vj, vd)) -#define VAVGR_WU(vd, vj, vk) EMIT(type_3R(0b01110000011010110, vk, vj, vd)) -#define VAVGR_DU(vd, vj, vk) EMIT(type_3R(0b01110000011010111, vk, vj, vd)) -#define VABSD_B(vd, vj, vk) EMIT(type_3R(0b01110000011000000, vk, vj, vd)) -#define VABSD_H(vd, vj, vk) EMIT(type_3R(0b01110000011000001, vk, vj, vd)) -#define VABSD_W(vd, vj, vk) EMIT(type_3R(0b01110000011000010, vk, vj, vd)) -#define VABSD_D(vd, vj, vk) EMIT(type_3R(0b01110000011000011, vk, vj, vd)) -#define VABSD_BU(vd, vj, vk) EMIT(type_3R(0b01110000011000100, vk, vj, vd)) -#define VABSD_HU(vd, vj, vk) EMIT(type_3R(0b01110000011000101, vk, vj, vd)) -#define VABSD_WU(vd, vj, vk) EMIT(type_3R(0b01110000011000110, vk, vj, vd)) -#define VABSD_DU(vd, vj, vk) EMIT(type_3R(0b01110000011000111, vk, vj, vd)) -#define VADDA_B(vd, vj, vk) EMIT(type_3R(0b01110000010111000, vk, vj, vd)) -#define VADDA_H(vd, vj, vk) EMIT(type_3R(0b01110000010111001, vk, vj, vd)) -#define VADDA_W(vd, vj, vk) EMIT(type_3R(0b01110000010111010, vk, vj, vd)) -#define VADDA_D(vd, vj, vk) EMIT(type_3R(0b01110000010111011, vk, vj, vd)) -#define VMAXI_B(vd, vj, imm5) EMIT(type_3R(0b01110010100100000, imm5, vj, vd)) -#define VMAXI_H(vd, vj, imm5) EMIT(type_3R(0b01110010100100001, imm5, vj, vd)) -#define VMAXI_W(vd, vj, imm5) EMIT(type_3R(0b01110010100100010, imm5, vj, vd)) -#define VMAXI_D(vd, vj, imm5) EMIT(type_3R(0b01110010100100011, imm5, vj, vd)) -#define VMAXI_BU(vd, vj, imm5) EMIT(type_3R(0b01110010100101000, imm5, vj, vd)) -#define VMAXI_HU(vd, vj, imm5) EMIT(type_3R(0b01110010100101001, imm5, vj, vd)) -#define VMAXI_WU(vd, vj, imm5) EMIT(type_3R(0b01110010100101010, imm5, vj, vd)) -#define VMAXI_DU(vd, vj, imm5) EMIT(type_3R(0b01110010100101011, imm5, vj, vd)) -#define VMAX_B(vd, vj, vk) EMIT(type_3R(0b01110000011100000, vk, vj, vd)) -#define VMAX_H(vd, vj, vk) EMIT(type_3R(0b01110000011100001, vk, vj, vd)) -#define VMAX_W(vd, vj, vk) EMIT(type_3R(0b01110000011100010, vk, vj, vd)) -#define VMAX_D(vd, vj, vk) EMIT(type_3R(0b01110000011100011, vk, vj, vd)) -#define VMAX_BU(vd, vj, vk) EMIT(type_3R(0b01110000011101000, vk, vj, vd)) -#define VMAX_HU(vd, vj, vk) EMIT(type_3R(0b01110000011101001, vk, vj, vd)) -#define VMAX_WU(vd, vj, vk) EMIT(type_3R(0b01110000011101010, vk, vj, vd)) -#define VMAX_DU(vd, vj, vk) EMIT(type_3R(0b01110000011101011, vk, vj, vd)) -#define VMINI_B(vd, vj, imm5) EMIT(type_3R(0b01110010100100100, imm5, vj, vd)) -#define VMINI_H(vd, vj, imm5) EMIT(type_3R(0b01110010100100101, imm5, vj, vd)) -#define VMINI_W(vd, vj, imm5) EMIT(type_3R(0b01110010100100110, imm5, vj, vd)) -#define VMINI_D(vd, vj, imm5) EMIT(type_3R(0b01110010100100111, imm5, vj, vd)) -#define VMINI_BU(vd, vj, imm5) EMIT(type_3R(0b01110010100101100, imm5, vj, vd)) -#define VMINI_HU(vd, vj, imm5) EMIT(type_3R(0b01110010100101101, imm5, vj, vd)) -#define VMINI_WU(vd, vj, imm5) EMIT(type_3R(0b01110010100101110, imm5, vj, vd)) -#define VMINI_DU(vd, vj, imm5) EMIT(type_3R(0b01110010100101111, imm5, vj, vd)) -#define VMIN_B(vd, vj, vk) EMIT(type_3R(0b01110000011100100, vk, vj, vd)) -#define VMIN_H(vd, vj, vk) EMIT(type_3R(0b01110000011100101, vk, vj, vd)) -#define VMIN_W(vd, vj, vk) EMIT(type_3R(0b01110000011100110, vk, vj, vd)) -#define VMIN_D(vd, vj, vk) EMIT(type_3R(0b01110000011100111, vk, vj, vd)) -#define VMIN_BU(vd, vj, vk) EMIT(type_3R(0b01110000011101100, vk, vj, vd)) -#define VMIN_HU(vd, vj, vk) EMIT(type_3R(0b01110000011101101, vk, vj, vd)) -#define VMIN_WU(vd, vj, vk) EMIT(type_3R(0b01110000011101110, vk, vj, vd)) -#define VMIN_DU(vd, vj, vk) EMIT(type_3R(0b01110000011101111, vk, vj, vd)) -#define VMUL_B(vd, vj, vk) EMIT(type_3R(0b01110000100001000, vk, vj, vd)) -#define VMUL_H(vd, vj, vk) EMIT(type_3R(0b01110000100001001, vk, vj, vd)) -#define VMUL_W(vd, vj, vk) EMIT(type_3R(0b01110000100001010, vk, vj, vd)) -#define VMUL_D(vd, vj, vk) EMIT(type_3R(0b01110000100001011, vk, vj, vd)) -#define VMUH_B(vd, vj, vk) EMIT(type_3R(0b01110000100001100, vk, vj, vd)) -#define VMUH_H(vd, vj, vk) EMIT(type_3R(0b01110000100001101, vk, vj, vd)) -#define VMUH_W(vd, vj, vk) EMIT(type_3R(0b01110000100001110, vk, vj, vd)) -#define VMUH_D(vd, vj, vk) EMIT(type_3R(0b01110000100001111, vk, vj, vd)) -#define VMUH_BU(vd, vj, vk) EMIT(type_3R(0b01110000100010000, vk, vj, vd)) -#define VMUH_HU(vd, vj, vk) EMIT(type_3R(0b01110000100010001, vk, vj, vd)) -#define VMUH_WU(vd, vj, vk) EMIT(type_3R(0b01110000100010010, vk, vj, vd)) -#define VMUH_DU(vd, vj, vk) EMIT(type_3R(0b01110000100010011, vk, vj, vd)) -#define VMULWEV_H_B(vd, vj, vk) EMIT(type_3R(0b01110000100100000, vk, vj, vd)) -#define VMULWEV_W_H(vd, vj, vk) EMIT(type_3R(0b01110000100100001, vk, vj, vd)) -#define VMULWEV_D_W(vd, vj, vk) EMIT(type_3R(0b01110000100100010, vk, vj, vd)) -#define VMULWEV_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000100100011, vk, vj, vd)) -#define VMULWOD_H_B(vd, vj, vk) EMIT(type_3R(0b01110000100100100, vk, vj, vd)) -#define VMULWOD_W_H(vd, vj, vk) EMIT(type_3R(0b01110000100100101, vk, vj, vd)) -#define VMULWOD_D_W(vd, vj, vk) EMIT(type_3R(0b01110000100100110, vk, vj, vd)) -#define VMULWOD_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000100100111, vk, vj, vd)) -#define VMULWEV_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000100110000, vk, vj, vd)) -#define VMULWEV_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000100110001, vk, vj, vd)) -#define VMULWEV_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000100110010, vk, vj, vd)) -#define VMULWEV_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000100110011, vk, vj, vd)) -#define VMULWOD_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000100110100, vk, vj, vd)) -#define VMULWOD_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000100110101, vk, vj, vd)) -#define VMULWOD_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000100110110, vk, vj, vd)) -#define VMULWOD_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000100110111, vk, vj, vd)) -#define VMULWEV_H_BU_B(vd, vj, vk) EMIT(type_3R(0b01110000101000000, vk, vj, vd)) -#define VMULWEV_W_HU_H(vd, vj, vk) EMIT(type_3R(0b01110000101000001, vk, vj, vd)) -#define VMULWEV_D_WU_W(vd, vj, vk) EMIT(type_3R(0b01110000101000010, vk, vj, vd)) -#define VMULWEV_Q_DU_D(vd, vj, vk) EMIT(type_3R(0b01110000101000011, vk, vj, vd)) -#define VMULWOD_H_BU_B(vd, vj, vk) EMIT(type_3R(0b01110000101000100, vk, vj, vd)) -#define VMULWOD_W_HU_H(vd, vj, vk) EMIT(type_3R(0b01110000101000101, vk, vj, vd)) -#define VMULWOD_D_WU_W(vd, vj, vk) EMIT(type_3R(0b01110000101000110, vk, vj, vd)) -#define VMULWOD_Q_DU_D(vd, vj, vk) EMIT(type_3R(0b01110000101000111, vk, vj, vd)) -#define VMADD_B(vd, vj, vk) EMIT(type_3R(0b01110000101010000, vk, vj, vd)) -#define VMADD_H(vd, vj, vk) EMIT(type_3R(0b01110000101010001, vk, vj, vd)) -#define VMADD_W(vd, vj, vk) EMIT(type_3R(0b01110000101010010, vk, vj, vd)) -#define VMADD_D(vd, vj, vk) EMIT(type_3R(0b01110000101010011, vk, vj, vd)) -#define VMSUB_B(vd, vj, vk) EMIT(type_3R(0b01110000101010100, vk, vj, vd)) -#define VMSUB_H(vd, vj, vk) EMIT(type_3R(0b01110000101010101, vk, vj, vd)) -#define VMSUB_W(vd, vj, vk) EMIT(type_3R(0b01110000101010110, vk, vj, vd)) -#define VMSUB_D(vd, vj, vk) EMIT(type_3R(0b01110000101010111, vk, vj, vd)) -#define VMADDWEV_H_B(vd, vj, vk) EMIT(type_3R(0b01110000101011000, vk, vj, vd)) -#define VMADDWEV_W_H(vd, vj, vk) EMIT(type_3R(0b01110000101011001, vk, vj, vd)) -#define VMADDWEV_D_W(vd, vj, vk) EMIT(type_3R(0b01110000101011010, vk, vj, vd)) -#define VMADDWEV_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000101011011, vk, vj, vd)) -#define VMADDWOD_H_B(vd, vj, vk) EMIT(type_3R(0b01110000101011100, vk, vj, vd)) -#define VMADDWOD_W_H(vd, vj, vk) EMIT(type_3R(0b01110000101011101, vk, vj, vd)) -#define VMADDWOD_D_W(vd, vj, vk) EMIT(type_3R(0b01110000101011110, vk, vj, vd)) -#define VMADDWOD_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000101011111, vk, vj, vd)) -#define VMADDWEV_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000101101000, vk, vj, vd)) -#define VMADDWEV_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000101101001, vk, vj, vd)) -#define VMADDWEV_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000101101010, vk, vj, vd)) -#define VMADDWEV_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000101101011, vk, vj, vd)) -#define VMADDWOD_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000101101100, vk, vj, vd)) -#define VMADDWOD_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000101101101, vk, vj, vd)) -#define VMADDWOD_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000101101110, vk, vj, vd)) -#define VMADDWOD_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000101101111, vk, vj, vd)) -#define VMADDWEV_H_BU_B(vd, vj, vk) EMIT(type_3R(0b01110000101111000, vk, vj, vd)) -#define VMADDWEV_W_HU_H(vd, vj, vk) EMIT(type_3R(0b01110000101111001, vk, vj, vd)) -#define VMADDWEV_D_WU_W(vd, vj, vk) EMIT(type_3R(0b01110000101111010, vk, vj, vd)) -#define VMADDWEV_Q_DU_D(vd, vj, vk) EMIT(type_3R(0b01110000101111011, vk, vj, vd)) -#define VMADDWOD_H_BU_B(vd, vj, vk) EMIT(type_3R(0b01110000101111100, vk, vj, vd)) -#define VMADDWOD_W_HU_H(vd, vj, vk) EMIT(type_3R(0b01110000101111101, vk, vj, vd)) -#define VMADDWOD_D_WU_W(vd, vj, vk) EMIT(type_3R(0b01110000101111110, vk, vj, vd)) -#define VMADDWOD_Q_DU_D(vd, vj, vk) EMIT(type_3R(0b01110000101111111, vk, vj, vd)) -#define VDIV_B(vd, vj, vk) EMIT(type_3R(0b01110000111000000, vk, vj, vd)) -#define VDIV_H(vd, vj, vk) EMIT(type_3R(0b01110000111000001, vk, vj, vd)) -#define VDIV_W(vd, vj, vk) EMIT(type_3R(0b01110000111000010, vk, vj, vd)) -#define VDIV_D(vd, vj, vk) EMIT(type_3R(0b01110000111000011, vk, vj, vd)) -#define VDIV_BU(vd, vj, vk) EMIT(type_3R(0b01110000111001000, vk, vj, vd)) -#define VDIV_HU(vd, vj, vk) EMIT(type_3R(0b01110000111001001, vk, vj, vd)) -#define VDIV_WU(vd, vj, vk) EMIT(type_3R(0b01110000111001010, vk, vj, vd)) -#define VDIV_DU(vd, vj, vk) EMIT(type_3R(0b01110000111001011, vk, vj, vd)) -#define VMOD_B(vd, vj, vk) EMIT(type_3R(0b01110000111000100, vk, vj, vd)) -#define VMOD_H(vd, vj, vk) EMIT(type_3R(0b01110000111000101, vk, vj, vd)) -#define VMOD_W(vd, vj, vk) EMIT(type_3R(0b01110000111000110, vk, vj, vd)) -#define VMOD_D(vd, vj, vk) EMIT(type_3R(0b01110000111000111, vk, vj, vd)) -#define VMOD_BU(vd, vj, vk) EMIT(type_3R(0b01110000111001100, vk, vj, vd)) -#define VMOD_HU(vd, vj, vk) EMIT(type_3R(0b01110000111001101, vk, vj, vd)) -#define VMOD_WU(vd, vj, vk) EMIT(type_3R(0b01110000111001110, vk, vj, vd)) -#define VMOD_DU(vd, vj, vk) EMIT(type_3R(0b01110000111001111, vk, vj, vd)) -#define VSIGNCOV_B(vd, vj, vk) EMIT(type_3R(0b01110001001011100, vk, vj, vd)) -#define VSIGNCOV_H(vd, vj, vk) EMIT(type_3R(0b01110001001011101, vk, vj, vd)) -#define VSIGNCOV_W(vd, vj, vk) EMIT(type_3R(0b01110001001011110, vk, vj, vd)) -#define VSIGNCOV_D(vd, vj, vk) EMIT(type_3R(0b01110001001011111, vk, vj, vd)) -#define VMSKLTZ_B(vd, vj) EMIT(type_2R(0b0111001010011100010000, vj, vd)) -#define VMSKLTZ_H(vd, vj) EMIT(type_2R(0b0111001010011100010001, vj, vd)) -#define VMSKLTZ_W(vd, vj) EMIT(type_2R(0b0111001010011100010010, vj, vd)) -#define VMSKLTZ_D(vd, vj) EMIT(type_2R(0b0111001010011100010011, vj, vd)) -#define VMSKGEZ_B(vd, vj) EMIT(type_2R(0b0111001010011100010100, vj, vd)) -#define VMSKNZ_B(vd, vj) EMIT(type_2R(0b0111001010011100011000, vj, vd)) -#define VAND_V(vd, vj, vk) EMIT(type_3R(0b01110001001001100, vk, vj, vd)) -#define VLDI(vd, imm13) EMIT(type_1RI13(0b01110011111000, imm13, vd)) -#define VOR_V(vd, vj, vk) EMIT(type_3R(0b01110001001001101, vk, vj, vd)) -#define VXOR_V(vd, vj, vk) EMIT(type_3R(0b01110001001001110, vk, vj, vd)) -#define VNOR_V(vd, vj, vk) EMIT(type_3R(0b01110001001001111, vk, vj, vd)) -#define VANDN_V(vd, vj, vk) EMIT(type_3R(0b01110001001010000, vk, vj, vd)) -#define VORN_V(vd, vj, vk) EMIT(type_3R(0b01110001001010001, vk, vj, vd)) -#define VSLL_B(vd, vj, vk) EMIT(type_3R(0b01110000111010000, vk, vj, vd)) -#define VSLL_H(vd, vj, vk) EMIT(type_3R(0b01110000111010001, vk, vj, vd)) -#define VSLL_W(vd, vj, vk) EMIT(type_3R(0b01110000111010010, vk, vj, vd)) -#define VSLL_D(vd, vj, vk) EMIT(type_3R(0b01110000111010011, vk, vj, vd)) -#define VSRL_B(vd, vj, vk) EMIT(type_3R(0b01110000111010100, vk, vj, vd)) -#define VSRL_H(vd, vj, vk) EMIT(type_3R(0b01110000111010101, vk, vj, vd)) -#define VSRL_W(vd, vj, vk) EMIT(type_3R(0b01110000111010110, vk, vj, vd)) -#define VSRL_D(vd, vj, vk) EMIT(type_3R(0b01110000111010111, vk, vj, vd)) -#define VSRA_B(vd, vj, vk) EMIT(type_3R(0b01110000111011000, vk, vj, vd)) -#define VSRA_H(vd, vj, vk) EMIT(type_3R(0b01110000111011001, vk, vj, vd)) -#define VSRA_W(vd, vj, vk) EMIT(type_3R(0b01110000111011010, vk, vj, vd)) -#define VSRA_D(vd, vj, vk) EMIT(type_3R(0b01110000111011011, vk, vj, vd)) -#define VSLLI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111001100101100001, imm3, vj, vd)) -#define VSLLI_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110010110001, imm4, vj, vd)) -#define VSLLI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011001011001, imm5, vj, vd)) -#define VSLLI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001100101101, imm6, vj, vd)) -#define VSRLI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111001100110000001, imm3, vj, vd)) -#define VSRLI_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110011000001, imm4, vj, vd)) -#define VSRLI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011001100001, imm5, vj, vd)) -#define VSRLI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001100110001, imm6, vj, vd)) -#define VSRAI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111001100110100001, imm3, vj, vd)) -#define VSRAI_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110011010001, imm4, vj, vd)) -#define VSRAI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011001101001, imm5, vj, vd)) -#define VSRAI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001100110101, imm6, vj, vd)) -#define VROTR_B(vd, vj, vk) EMIT(type_3R(0b01110000111011100, vk, vj, vd)) -#define VROTR_H(vd, vj, vk) EMIT(type_3R(0b01110000111011101, vk, vj, vd)) -#define VROTR_W(vd, vj, vk) EMIT(type_3R(0b01110000111011110, vk, vj, vd)) -#define VROTR_D(vd, vj, vk) EMIT(type_3R(0b01110000111011111, vk, vj, vd)) -#define VSRLR_B(vd, vj, vk) EMIT(type_3R(0b01110000111100000, vk, vj, vd)) -#define VSRLR_H(vd, vj, vk) EMIT(type_3R(0b01110000111100001, vk, vj, vd)) -#define VSRLR_W(vd, vj, vk) EMIT(type_3R(0b01110000111100010, vk, vj, vd)) -#define VSRLR_D(vd, vj, vk) EMIT(type_3R(0b01110000111100011, vk, vj, vd)) -#define VSRAR_B(vd, vj, vk) EMIT(type_3R(0b01110000111100100, vk, vj, vd)) -#define VSRAR_H(vd, vj, vk) EMIT(type_3R(0b01110000111100101, vk, vj, vd)) -#define VSRAR_W(vd, vj, vk) EMIT(type_3R(0b01110000111100110, vk, vj, vd)) -#define VSRAR_D(vd, vj, vk) EMIT(type_3R(0b01110000111100111, vk, vj, vd)) -#define VSRLN_B_H(vd, vj, vk) EMIT(type_3R(0b01110000111101001, vk, vj, vd)) -#define VSRLN_H_W(vd, vj, vk) EMIT(type_3R(0b01110000111101010, vk, vj, vd)) -#define VSRLN_W_D(vd, vj, vk) EMIT(type_3R(0b01110000111101011, vk, vj, vd)) -#define VSRAN_B_H(vd, vj, vk) EMIT(type_3R(0b01110000111101101, vk, vj, vd)) -#define VSRAN_H_W(vd, vj, vk) EMIT(type_3R(0b01110000111101110, vk, vj, vd)) -#define VSRAN_W_D(vd, vj, vk) EMIT(type_3R(0b01110000111101111, vk, vj, vd)) -#define VSRLRN_B_H(vd, vj, vk) EMIT(type_3R(0b01110000111110001, vk, vj, vd)) -#define VSRLRN_H_W(vd, vj, vk) EMIT(type_3R(0b01110000111110010, vk, vj, vd)) -#define VSRLRN_W_D(vd, vj, vk) EMIT(type_3R(0b01110000111110011, vk, vj, vd)) -#define VSRARN_B_H(vd, vj, vk) EMIT(type_3R(0b01110000111110101, vk, vj, vd)) -#define VSRARN_H_W(vd, vj, vk) EMIT(type_3R(0b01110000111110110, vk, vj, vd)) -#define VSRARN_W_D(vd, vj, vk) EMIT(type_3R(0b01110000111110111, vk, vj, vd)) -#define VSSRLN_B_H(vd, vj, vk) EMIT(type_3R(0b01110000111111001, vk, vj, vd)) -#define VSSRLN_H_W(vd, vj, vk) EMIT(type_3R(0b01110000111111010, vk, vj, vd)) -#define VSSRLN_W_D(vd, vj, vk) EMIT(type_3R(0b01110000111111011, vk, vj, vd)) -#define VSSRAN_B_H(vd, vj, vk) EMIT(type_3R(0b01110000111111101, vk, vj, vd)) -#define VSSRAN_H_W(vd, vj, vk) EMIT(type_3R(0b01110000111111110, vk, vj, vd)) -#define VSSRAN_W_D(vd, vj, vk) EMIT(type_3R(0b01110000111111111, vk, vj, vd)) -#define VSSRLN_BU_H(vd, vj, vk) EMIT(type_3R(0b01110001000001001, vk, vj, vd)) -#define VSSRLN_HU_W(vd, vj, vk) EMIT(type_3R(0b01110001000001010, vk, vj, vd)) -#define VSSRLN_WU_D(vd, vj, vk) EMIT(type_3R(0b01110001000001011, vk, vj, vd)) -#define VSSRAN_BU_H(vd, vj, vk) EMIT(type_3R(0b01110001000001101, vk, vj, vd)) -#define VSSRAN_HU_W(vd, vj, vk) EMIT(type_3R(0b01110001000001110, vk, vj, vd)) -#define VSSRAN_WU_D(vd, vj, vk) EMIT(type_3R(0b01110001000001111, vk, vj, vd)) -#define VSSRLRN_B_H(vd, vj, vk) EMIT(type_3R(0b01110001000000001, vk, vj, vd)) -#define VSSRLRN_H_W(vd, vj, vk) EMIT(type_3R(0b01110001000000010, vk, vj, vd)) -#define VSSRLRN_W_D(vd, vj, vk) EMIT(type_3R(0b01110001000000011, vk, vj, vd)) -#define VSSRARN_B_H(vd, vj, vk) EMIT(type_3R(0b01110001000000101, vk, vj, vd)) -#define VSSRARN_H_W(vd, vj, vk) EMIT(type_3R(0b01110001000000110, vk, vj, vd)) -#define VSSRARN_W_D(vd, vj, vk) EMIT(type_3R(0b01110001000000111, vk, vj, vd)) -#define VSSRLRN_BU_H(vd, vj, vk) EMIT(type_3R(0b01110001000010001, vk, vj, vd)) -#define VSSRLRN_HU_W(vd, vj, vk) EMIT(type_3R(0b01110001000010010, vk, vj, vd)) -#define VSSRLRN_WU_D(vd, vj, vk) EMIT(type_3R(0b01110001000010011, vk, vj, vd)) -#define VSSRARN_BU_H(vd, vj, vk) EMIT(type_3R(0b01110001000010101, vk, vj, vd)) -#define VSSRARN_HU_W(vd, vj, vk) EMIT(type_3R(0b01110001000010110, vk, vj, vd)) -#define VSSRARN_WU_D(vd, vj, vk) EMIT(type_3R(0b01110001000010111, vk, vj, vd)) -#define VBITCLR_B(vd, vj, vk) EMIT(type_3R(0b01110001000011000, vk, vj, vd)) -#define VBITCLR_H(vd, vj, vk) EMIT(type_3R(0b01110001000011001, vk, vj, vd)) -#define VBITCLR_W(vd, vj, vk) EMIT(type_3R(0b01110001000011010, vk, vj, vd)) -#define VBITCLR_D(vd, vj, vk) EMIT(type_3R(0b01110001000011011, vk, vj, vd)) -#define VBITSET_B(vd, vj, vk) EMIT(type_3R(0b01110001000011100, vk, vj, vd)) -#define VBITSET_H(vd, vj, vk) EMIT(type_3R(0b01110001000011101, vk, vj, vd)) -#define VBITSET_W(vd, vj, vk) EMIT(type_3R(0b01110001000011110, vk, vj, vd)) -#define VBITSET_D(vd, vj, vk) EMIT(type_3R(0b01110001000011111, vk, vj, vd)) -#define VBITREV_B(vd, vj, vk) EMIT(type_3R(0b01110001000100000, vk, vj, vd)) -#define VBITREV_H(vd, vj, vk) EMIT(type_3R(0b01110001000100001, vk, vj, vd)) -#define VBITREV_W(vd, vj, vk) EMIT(type_3R(0b01110001000100010, vk, vj, vd)) -#define VBITREV_D(vd, vj, vk) EMIT(type_3R(0b01110001000100011, vk, vj, vd)) -#define VFRSTP_B(vd, vj, vk) EMIT(type_3R(0b01110001001010110, vk, vj, vd)) -#define VFRSTP_H(vd, vj, vk) EMIT(type_3R(0b01110001001010111, vk, vj, vd)) -#define VFADD_S(vd, vj, vk) EMIT(type_3R(0b01110001001100001, vk, vj, vd)) -#define VFADD_D(vd, vj, vk) EMIT(type_3R(0b01110001001100010, vk, vj, vd)) -#define VFSUB_S(vd, vj, vk) EMIT(type_3R(0b01110001001100101, vk, vj, vd)) -#define VFSUB_D(vd, vj, vk) EMIT(type_3R(0b01110001001100110, vk, vj, vd)) -#define VFMUL_S(vd, vj, vk) EMIT(type_3R(0b01110001001110001, vk, vj, vd)) -#define VFMUL_D(vd, vj, vk) EMIT(type_3R(0b01110001001110010, vk, vj, vd)) -#define VFDIV_S(vd, vj, vk) EMIT(type_3R(0b01110001001110101, vk, vj, vd)) -#define VFDIV_D(vd, vj, vk) EMIT(type_3R(0b01110001001110110, vk, vj, vd)) -#define VFMAX_S(vd, vj, vk) EMIT(type_3R(0b01110001001111001, vk, vj, vd)) -#define VFMAX_D(vd, vj, vk) EMIT(type_3R(0b01110001001111010, vk, vj, vd)) -#define VFMIN_S(vd, vj, vk) EMIT(type_3R(0b01110001001111101, vk, vj, vd)) -#define VFMIN_D(vd, vj, vk) EMIT(type_3R(0b01110001001111110, vk, vj, vd)) -#define VFMAXA_S(vd, vj, vk) EMIT(type_3R(0b01110001010000001, vk, vj, vd)) -#define VFMAXA_D(vd, vj, vk) EMIT(type_3R(0b01110001010000010, vk, vj, vd)) -#define VFMINA_S(vd, vj, vk) EMIT(type_3R(0b01110001010000101, vk, vj, vd)) -#define VFMINA_D(vd, vj, vk) EMIT(type_3R(0b01110001010000110, vk, vj, vd)) -#define VFSQRT_S(vd, vj) EMIT(type_2R(0b0111001010011100111001, vj, vd)) -#define VFSQRT_D(vd, vj) EMIT(type_2R(0b0111001010011100111010, vj, vd)) -#define VFRECIP_S(vd, vj) EMIT(type_2R(0b0111001010011100111101, vj, vd)) -#define VFRECIP_D(vd, vj) EMIT(type_2R(0b0111001010011100111110, vj, vd)) -#define VFRSQRT_S(vd, vj) EMIT(type_2R(0b0111001010011101000001, vj, vd)) -#define VFRSQRT_D(vd, vj) EMIT(type_2R(0b0111001010011101000010, vj, vd)) -#define VFCVTL_S_H(vd, vj) EMIT(type_2R(0b0111001010011101111010, vj, vd)) -#define VFCVTH_S_H(vd, vj) EMIT(type_2R(0b0111001010011101111011, vj, vd)) -#define VFCVTL_D_S(vd, vj) EMIT(type_2R(0b0111001010011101111100, vj, vd)) -#define VFCVTH_D_S(vd, vj) EMIT(type_2R(0b0111001010011101111101, vj, vd)) -#define VFCVT_H_S(vd, vj, vk) EMIT(type_3R(0b01110001010001100, vk, vj, vd)) -#define VFCVT_S_D(vd, vj, vk) EMIT(type_3R(0b01110001010001101, vk, vj, vd)) -#define VFTINT_W_S(vd, vj) EMIT(type_2R(0b0111001010011110001100, vj, vd)) -#define VFTINT_L_D(vd, vj) EMIT(type_2R(0b0111001010011110001101, vj, vd)) -#define VFTINTRM_W_S(vd, vj) EMIT(type_2R(0b0111001010011110001110, vj, vd)) -#define VFTINTRM_L_D(vd, vj) EMIT(type_2R(0b0111001010011110001111, vj, vd)) -#define VFTINTRP_W_S(vd, vj) EMIT(type_2R(0b0111001010011110010000, vj, vd)) -#define VFTINTRP_L_D(vd, vj) EMIT(type_2R(0b0111001010011110010001, vj, vd)) -#define VFTINTRZ_W_S(vd, vj) EMIT(type_2R(0b0111001010011110010010, vj, vd)) -#define VFTINTRZ_L_D(vd, vj) EMIT(type_2R(0b0111001010011110010011, vj, vd)) -#define VFTINTRNE_W_S(vd, vj) EMIT(type_2R(0b0111001010011110010100, vj, vd)) -#define VFTINTRNE_L_D(vd, vj) EMIT(type_2R(0b0111001010011110010101, vj, vd)) -#define VFTINT_WU_S(vd, vj) EMIT(type_2R(0b0111001010011110010110, vj, vd)) -#define VFTINT_LU_D(vd, vj) EMIT(type_2R(0b0111001010011110010111, vj, vd)) -#define VFTINTRZ_WU_S(vd, vj) EMIT(type_2R(0b0111001010011110011100, vj, vd)) -#define VFTINTRZ_LU_D(vd, vj) EMIT(type_2R(0b0111001010011110011101, vj, vd)) -#define VFTINT_W_D(vd, vj, vk) EMIT(type_3R(0b01110001010010011, vk, vj, vd)) -#define VFTINTRM_W_D(vd, vj, vk) EMIT(type_3R(0b01110001010010100, vk, vj, vd)) -#define VFTINTRP_W_D(vd, vj, vk) EMIT(type_3R(0b01110001010010101, vk, vj, vd)) -#define VFTINTRZ_W_D(vd, vj, vk) EMIT(type_3R(0b01110001010010110, vk, vj, vd)) -#define VFTINTRNE_W_D(vd, vj, vk) EMIT(type_3R(0b01110001010010111, vk, vj, vd)) -#define VFTINTL_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100000, vj, vd)) -#define VFTINTH_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100001, vj, vd)) -#define VFTINTRML_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100010, vj, vd)) -#define VFTINTRMH_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100011, vj, vd)) -#define VFTINTRPL_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100100, vj, vd)) -#define VFTINTRPH_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100101, vj, vd)) -#define VFTINTRZL_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100110, vj, vd)) -#define VFTINTRZH_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100111, vj, vd)) -#define VFTINTRNEL_L_S(vd, vj) EMIT(type_2R(0b0111001010011110101000, vj, vd)) -#define VFTINTRNEH_L_S(vd, vj) EMIT(type_2R(0b0111001010011110101001, vj, vd)) -#define VFFINT_S_W(vd, vj) EMIT(type_2R(0b0111001010011110000000, vj, vd)) -#define VFFINT_S_WU(vd, vj) EMIT(type_2R(0b0111001010011110000001, vj, vd)) -#define VFFINT_D_L(vd, vj) EMIT(type_2R(0b0111001010011110000010, vj, vd)) -#define VFFINT_D_LU(vd, vj) EMIT(type_2R(0b0111001010011110000011, vj, vd)) -#define VFFINTL_D_W(vd, vj) EMIT(type_2R(0b0111001010011110000100, vj, vd)) -#define VFFINTH_D_W(vd, vj) EMIT(type_2R(0b0111001010011110000101, vj, vd)) -#define VFFINT_S_L(vd, vj, vk) EMIT(type_3R(0b01110001010010000, vk, vj, vd)) -#define VSEQ_B(vd, vj, vk) EMIT(type_3R(0b01110000000000000, vk, vj, vd)) -#define VSEQ_H(vd, vj, vk) EMIT(type_3R(0b01110000000000001, vk, vj, vd)) -#define VSEQ_W(vd, vj, vk) EMIT(type_3R(0b01110000000000010, vk, vj, vd)) -#define VSEQ_D(vd, vj, vk) EMIT(type_3R(0b01110000000000011, vk, vj, vd)) -#define VSLE_B(vd, vj, vk) EMIT(type_3R(0b01110000000000100, vk, vj, vd)) -#define VSLE_H(vd, vj, vk) EMIT(type_3R(0b01110000000000101, vk, vj, vd)) -#define VSLE_W(vd, vj, vk) EMIT(type_3R(0b01110000000000110, vk, vj, vd)) -#define VSLE_D(vd, vj, vk) EMIT(type_3R(0b01110000000000111, vk, vj, vd)) -#define VSLE_BU(vd, vj, vk) EMIT(type_3R(0b01110000000001000, vk, vj, vd)) -#define VSLE_HU(vd, vj, vk) EMIT(type_3R(0b01110000000001001, vk, vj, vd)) -#define VSLE_WU(vd, vj, vk) EMIT(type_3R(0b01110000000001010, vk, vj, vd)) -#define VSLE_DU(vd, vj, vk) EMIT(type_3R(0b01110000000001011, vk, vj, vd)) -#define VSLT_B(vd, vj, vk) EMIT(type_3R(0b01110000000001100, vk, vj, vd)) -#define VSLT_H(vd, vj, vk) EMIT(type_3R(0b01110000000001101, vk, vj, vd)) -#define VSLT_W(vd, vj, vk) EMIT(type_3R(0b01110000000001110, vk, vj, vd)) -#define VSLT_D(vd, vj, vk) EMIT(type_3R(0b01110000000001111, vk, vj, vd)) -#define VSLT_BU(vd, vj, vk) EMIT(type_3R(0b01110000000010000, vk, vj, vd)) -#define VSLT_HU(vd, vj, vk) EMIT(type_3R(0b01110000000010001, vk, vj, vd)) -#define VSLT_WU(vd, vj, vk) EMIT(type_3R(0b01110000000010010, vk, vj, vd)) -#define VSLT_DU(vd, vj, vk) EMIT(type_3R(0b01110000000010011, vk, vj, vd)) -#define VBSLL_V(vd, vj, imm5) EMIT(type_2RI5(0b01110010100011100, imm5, vj, vd)) -#define VBSRL_V(vd, vj, imm5) EMIT(type_2RI5(0b01110010100011101, imm5, vj, vd)) -#define VPACKEV_B(vd, vj, vk) EMIT(type_3R(0b01110001000101100, vk, vj, vd)) -#define VPACKEV_H(vd, vj, vk) EMIT(type_3R(0b01110001000101101, vk, vj, vd)) -#define VPACKEV_W(vd, vj, vk) EMIT(type_3R(0b01110001000101110, vk, vj, vd)) -#define VPACKEV_D(vd, vj, vk) EMIT(type_3R(0b01110001000101111, vk, vj, vd)) -#define VPACKOD_B(vd, vj, vk) EMIT(type_3R(0b01110001000110000, vk, vj, vd)) -#define VPACKOD_H(vd, vj, vk) EMIT(type_3R(0b01110001000110001, vk, vj, vd)) -#define VPACKOD_W(vd, vj, vk) EMIT(type_3R(0b01110001000110010, vk, vj, vd)) -#define VPACKOD_D(vd, vj, vk) EMIT(type_3R(0b01110001000110011, vk, vj, vd)) -#define VPICKEV_B(vd, vj, vk) EMIT(type_3R(0b01110001000111100, vk, vj, vd)) -#define VPICKEV_H(vd, vj, vk) EMIT(type_3R(0b01110001000111101, vk, vj, vd)) -#define VPICKEV_W(vd, vj, vk) EMIT(type_3R(0b01110001000111110, vk, vj, vd)) -#define VPICKEV_D(vd, vj, vk) EMIT(type_3R(0b01110001000111111, vk, vj, vd)) -#define VPICKOD_B(vd, vj, vk) EMIT(type_3R(0b01110001001000000, vk, vj, vd)) -#define VPICKOD_H(vd, vj, vk) EMIT(type_3R(0b01110001001000001, vk, vj, vd)) -#define VPICKOD_W(vd, vj, vk) EMIT(type_3R(0b01110001001000010, vk, vj, vd)) -#define VPICKOD_D(vd, vj, vk) EMIT(type_3R(0b01110001001000011, vk, vj, vd)) -#define VILVL_B(vd, vj, vk) EMIT(type_3R(0b01110001000110100, vk, vj, vd)) -#define VILVL_H(vd, vj, vk) EMIT(type_3R(0b01110001000110101, vk, vj, vd)) -#define VILVL_W(vd, vj, vk) EMIT(type_3R(0b01110001000110110, vk, vj, vd)) -#define VILVL_D(vd, vj, vk) EMIT(type_3R(0b01110001000110111, vk, vj, vd)) -#define VILVH_B(vd, vj, vk) EMIT(type_3R(0b01110001000111000, vk, vj, vd)) -#define VILVH_H(vd, vj, vk) EMIT(type_3R(0b01110001000111001, vk, vj, vd)) -#define VILVH_W(vd, vj, vk) EMIT(type_3R(0b01110001000111010, vk, vj, vd)) -#define VILVH_D(vd, vj, vk) EMIT(type_3R(0b01110001000111011, vk, vj, vd)) -#define VSHUF_B(vd, vj, vk, va) EMIT(type_4R(0b000011010101, va, vk, vj, vd)) -#define VSHUF_H(vd, vj, vk) EMIT(type_3R(0b01110001011110101, vk, vj, vd)) -#define VSHUF_W(vd, vj, vk) EMIT(type_3R(0b01110001011110110, vk, vj, vd)) -#define VSHUF_D(vd, vj, vk) EMIT(type_3R(0b01110001011110111, vk, vj, vd)) -#define VSHUF4I_B(vd, vj, imm8) EMIT(type_2RI8(0b01110011100100, imm8, vj, vd)) -#define VSHUF4I_H(vd, vj, imm8) EMIT(type_2RI8(0b01110011100101, imm8, vj, vd)) -#define VSHUF4I_W(vd, vj, imm8) EMIT(type_2RI8(0b01110011100110, imm8, vj, vd)) -#define VSHUF4I_D(vd, vj, imm8) EMIT(type_2RI8(0b01110011100111, imm8, vj, vd)) -#define VEXTRINS_D(vd, vj, imm8) EMIT(type_2RI8(0b01110011100000, imm8, vj, vd)) -#define VEXTRINS_W(vd, vj, imm8) EMIT(type_2RI8(0b01110011100001, imm8, vj, vd)) -#define VEXTRINS_H(vd, vj, imm8) EMIT(type_2RI8(0b01110011100010, imm8, vj, vd)) -#define VEXTRINS_B(vd, vj, imm8) EMIT(type_2RI8(0b01110011100011, imm8, vj, vd)) -#define VLD(vd, rj, imm12) EMIT(type_2RI12(0b0010110000, imm12, rj, vd)) -#define VST(vd, rj, imm12) EMIT(type_2RI12(0b0010110001, imm12, rj, vd)) - -#define VFCMP_S(vd, vj, vk, cond) EMIT(type_4R(0b000011000101, cond, vk, vj, vd)) -#define VFCMP_D(vd, vj, vk, cond) EMIT(type_4R(0b000011000110, cond, vk, vj, vd)) +#define VADD_B(vd, vj, vk) EMIT(type_3R(0b01110000000010100, vk, vj, vd)) +#define VADD_H(vd, vj, vk) EMIT(type_3R(0b01110000000010101, vk, vj, vd)) +#define VADD_W(vd, vj, vk) EMIT(type_3R(0b01110000000010110, vk, vj, vd)) +#define VADD_D(vd, vj, vk) EMIT(type_3R(0b01110000000010111, vk, vj, vd)) +#define VADD_Q(vd, vj, vk) EMIT(type_3R(0b01110001001011010, vk, vj, vd)) +#define VSUB_B(vd, vj, vk) EMIT(type_3R(0b01110000000011000, vk, vj, vd)) +#define VSUB_H(vd, vj, vk) EMIT(type_3R(0b01110000000011001, vk, vj, vd)) +#define VSUB_W(vd, vj, vk) EMIT(type_3R(0b01110000000011010, vk, vj, vd)) +#define VSUB_D(vd, vj, vk) EMIT(type_3R(0b01110000000011011, vk, vj, vd)) +#define VSUB_Q(vd, vj, vk) EMIT(type_3R(0b01110001001011011, vk, vj, vd)) +#define VADDI_BU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100010100, imm5, vj, vd)) +#define VADDI_HU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100010101, imm5, vj, vd)) +#define VADDI_WU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100010110, imm5, vj, vd)) +#define VADDI_DU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100010111, imm5, vj, vd)) +#define VSUBI_BU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100011000, imm5, vj, vd)) +#define VSUBI_HU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100011001, imm5, vj, vd)) +#define VSUBI_WU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100011010, imm5, vj, vd)) +#define VSUBI_DU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100011011, imm5, vj, vd)) +#define VSADD_B(vd, vj, vk) EMIT(type_3R(0b01110000010001100, vk, vj, vd)) +#define VSADD_H(vd, vj, vk) EMIT(type_3R(0b01110000010001101, vk, vj, vd)) +#define VSADD_W(vd, vj, vk) EMIT(type_3R(0b01110000010001110, vk, vj, vd)) +#define VSADD_D(vd, vj, vk) EMIT(type_3R(0b01110000010001111, vk, vj, vd)) +#define VSADD_BU(vd, vj, vk) EMIT(type_3R(0b01110000010010100, vk, vj, vd)) +#define VSADD_HU(vd, vj, vk) EMIT(type_3R(0b01110000010010101, vk, vj, vd)) +#define VSADD_WU(vd, vj, vk) EMIT(type_3R(0b01110000010010110, vk, vj, vd)) +#define VSADD_DU(vd, vj, vk) EMIT(type_3R(0b01110000010010111, vk, vj, vd)) +#define VSSUB_B(vd, vj, vk) EMIT(type_3R(0b01110000010010000, vk, vj, vd)) +#define VSSUB_H(vd, vj, vk) EMIT(type_3R(0b01110000010010001, vk, vj, vd)) +#define VSSUB_W(vd, vj, vk) EMIT(type_3R(0b01110000010010010, vk, vj, vd)) +#define VSSUB_D(vd, vj, vk) EMIT(type_3R(0b01110000010010011, vk, vj, vd)) +#define VSSUB_BU(vd, vj, vk) EMIT(type_3R(0b01110000010011000, vk, vj, vd)) +#define VSSUB_HU(vd, vj, vk) EMIT(type_3R(0b01110000010011001, vk, vj, vd)) +#define VSSUB_WU(vd, vj, vk) EMIT(type_3R(0b01110000010011010, vk, vj, vd)) +#define VSSUB_DU(vd, vj, vk) EMIT(type_3R(0b01110000010011011, vk, vj, vd)) +#define VHADDW_H_B(vd, vj, vk) EMIT(type_3R(0b01110000010101000, vk, vj, vd)) +#define VHADDW_W_H(vd, vj, vk) EMIT(type_3R(0b01110000010101001, vk, vj, vd)) +#define VHADDW_D_W(vd, vj, vk) EMIT(type_3R(0b01110000010101010, vk, vj, vd)) +#define VHADDW_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000010101011, vk, vj, vd)) +#define VHADDW_HU_BU(vd, vj, vk) EMIT(type_3R(0b01110000010110000, vk, vj, vd)) +#define VHADDW_WU_HU(vd, vj, vk) EMIT(type_3R(0b01110000010110001, vk, vj, vd)) +#define VHADDW_DU_WU(vd, vj, vk) EMIT(type_3R(0b01110000010110010, vk, vj, vd)) +#define VHADDW_QU_DU(vd, vj, vk) EMIT(type_3R(0b01110000010110011, vk, vj, vd)) +#define VHSUBW_H_B(vd, vj, vk) EMIT(type_3R(0b01110000010101100, vk, vj, vd)) +#define VHSUBW_W_H(vd, vj, vk) EMIT(type_3R(0b01110000010101101, vk, vj, vd)) +#define VHSUBW_D_W(vd, vj, vk) EMIT(type_3R(0b01110000010101110, vk, vj, vd)) +#define VHSUBW_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000010101111, vk, vj, vd)) +#define VHSUBW_HU_BU(vd, vj, vk) EMIT(type_3R(0b01110000010110100, vk, vj, vd)) +#define VHSUBW_WU_HU(vd, vj, vk) EMIT(type_3R(0b01110000010110101, vk, vj, vd)) +#define VHSUBW_DU_WU(vd, vj, vk) EMIT(type_3R(0b01110000010110110, vk, vj, vd)) +#define VHSUBW_QU_DU(vd, vj, vk) EMIT(type_3R(0b01110000010110111, vk, vj, vd)) +#define VADDWEV_H_B(vd, vj, vk) EMIT(type_3R(0b01110000000111100, vk, vj, vd)) +#define VADDWEV_W_H(vd, vj, vk) EMIT(type_3R(0b01110000000111101, vk, vj, vd)) +#define VADDWEV_D_W(vd, vj, vk) EMIT(type_3R(0b01110000000111110, vk, vj, vd)) +#define VADDWEV_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000000111111, vk, vj, vd)) +#define VADDWOD_H_B(vd, vj, vk) EMIT(type_3R(0b01110000001000100, vk, vj, vd)) +#define VADDWOD_W_H(vd, vj, vk) EMIT(type_3R(0b01110000001000101, vk, vj, vd)) +#define VADDWOD_D_W(vd, vj, vk) EMIT(type_3R(0b01110000001000110, vk, vj, vd)) +#define VADDWOD_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000001000111, vk, vj, vd)) +#define VSUBWEV_H_B(vd, vj, vk) EMIT(type_3R(0b01110000001000000, vk, vj, vd)) +#define VSUBWEV_W_H(vd, vj, vk) EMIT(type_3R(0b01110000001000001, vk, vj, vd)) +#define VSUBWEV_D_W(vd, vj, vk) EMIT(type_3R(0b01110000001000010, vk, vj, vd)) +#define VSUBWEV_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000001000011, vk, vj, vd)) +#define VSUBWOD_H_B(vd, vj, vk) EMIT(type_3R(0b01110000001001000, vk, vj, vd)) +#define VSUBWOD_W_H(vd, vj, vk) EMIT(type_3R(0b01110000001001001, vk, vj, vd)) +#define VSUBWOD_D_W(vd, vj, vk) EMIT(type_3R(0b01110000001001010, vk, vj, vd)) +#define VSUBWOD_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000001001011, vk, vj, vd)) +#define VADDWEV_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000001011100, vk, vj, vd)) +#define VADDWEV_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000001011101, vk, vj, vd)) +#define VADDWEV_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000001011110, vk, vj, vd)) +#define VADDWEV_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000001011111, vk, vj, vd)) +#define VADDWOD_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000001100100, vk, vj, vd)) +#define VADDWOD_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000001100101, vk, vj, vd)) +#define VADDWOD_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000001100110, vk, vj, vd)) +#define VADDWOD_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000001100111, vk, vj, vd)) +#define VSUBWEV_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000001100000, vk, vj, vd)) +#define VSUBWEV_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000001100001, vk, vj, vd)) +#define VSUBWEV_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000001100010, vk, vj, vd)) +#define VSUBWEV_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000001100011, vk, vj, vd)) +#define VSUBWOD_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000001101000, vk, vj, vd)) +#define VSUBWOD_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000001101001, vk, vj, vd)) +#define VSUBWOD_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000001101010, vk, vj, vd)) +#define VSUBWOD_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000001101011, vk, vj, vd)) +#define VADDWEV_H_BU_B(vd, vj, vk) EMIT(type_3R(0b01110000001111100, vk, vj, vd)) +#define VADDWEV_W_HU_H(vd, vj, vk) EMIT(type_3R(0b01110000001111101, vk, vj, vd)) +#define VADDWEV_D_WU_W(vd, vj, vk) EMIT(type_3R(0b01110000001111110, vk, vj, vd)) +#define VADDWEV_Q_DU_D(vd, vj, vk) EMIT(type_3R(0b01110000001111111, vk, vj, vd)) +#define VADDWOD_H_BU_B(vd, vj, vk) EMIT(type_3R(0b01110000010000000, vk, vj, vd)) +#define VADDWOD_W_HU_H(vd, vj, vk) EMIT(type_3R(0b01110000010000001, vk, vj, vd)) +#define VADDWOD_D_WU_W(vd, vj, vk) EMIT(type_3R(0b01110000010000010, vk, vj, vd)) +#define VADDWOD_Q_DU_D(vd, vj, vk) EMIT(type_3R(0b01110000010000011, vk, vj, vd)) +#define VAVG_B(vd, vj, vk) EMIT(type_3R(0b01110000011001000, vk, vj, vd)) +#define VAVG_H(vd, vj, vk) EMIT(type_3R(0b01110000011001001, vk, vj, vd)) +#define VAVG_W(vd, vj, vk) EMIT(type_3R(0b01110000011001010, vk, vj, vd)) +#define VAVG_D(vd, vj, vk) EMIT(type_3R(0b01110000011001011, vk, vj, vd)) +#define VAVG_BU(vd, vj, vk) EMIT(type_3R(0b01110000011001100, vk, vj, vd)) +#define VAVG_HU(vd, vj, vk) EMIT(type_3R(0b01110000011001101, vk, vj, vd)) +#define VAVG_WU(vd, vj, vk) EMIT(type_3R(0b01110000011001110, vk, vj, vd)) +#define VAVG_DU(vd, vj, vk) EMIT(type_3R(0b01110000011001111, vk, vj, vd)) +#define VAVGR_B(vd, vj, vk) EMIT(type_3R(0b01110000011010000, vk, vj, vd)) +#define VAVGR_H(vd, vj, vk) EMIT(type_3R(0b01110000011010001, vk, vj, vd)) +#define VAVGR_W(vd, vj, vk) EMIT(type_3R(0b01110000011010010, vk, vj, vd)) +#define VAVGR_D(vd, vj, vk) EMIT(type_3R(0b01110000011010011, vk, vj, vd)) +#define VAVGR_BU(vd, vj, vk) EMIT(type_3R(0b01110000011010100, vk, vj, vd)) +#define VAVGR_HU(vd, vj, vk) EMIT(type_3R(0b01110000011010101, vk, vj, vd)) +#define VAVGR_WU(vd, vj, vk) EMIT(type_3R(0b01110000011010110, vk, vj, vd)) +#define VAVGR_DU(vd, vj, vk) EMIT(type_3R(0b01110000011010111, vk, vj, vd)) +#define VABSD_B(vd, vj, vk) EMIT(type_3R(0b01110000011000000, vk, vj, vd)) +#define VABSD_H(vd, vj, vk) EMIT(type_3R(0b01110000011000001, vk, vj, vd)) +#define VABSD_W(vd, vj, vk) EMIT(type_3R(0b01110000011000010, vk, vj, vd)) +#define VABSD_D(vd, vj, vk) EMIT(type_3R(0b01110000011000011, vk, vj, vd)) +#define VABSD_BU(vd, vj, vk) EMIT(type_3R(0b01110000011000100, vk, vj, vd)) +#define VABSD_HU(vd, vj, vk) EMIT(type_3R(0b01110000011000101, vk, vj, vd)) +#define VABSD_WU(vd, vj, vk) EMIT(type_3R(0b01110000011000110, vk, vj, vd)) +#define VABSD_DU(vd, vj, vk) EMIT(type_3R(0b01110000011000111, vk, vj, vd)) +#define VADDA_B(vd, vj, vk) EMIT(type_3R(0b01110000010111000, vk, vj, vd)) +#define VADDA_H(vd, vj, vk) EMIT(type_3R(0b01110000010111001, vk, vj, vd)) +#define VADDA_W(vd, vj, vk) EMIT(type_3R(0b01110000010111010, vk, vj, vd)) +#define VADDA_D(vd, vj, vk) EMIT(type_3R(0b01110000010111011, vk, vj, vd)) +#define VMAXI_B(vd, vj, imm5) EMIT(type_3R(0b01110010100100000, imm5, vj, vd)) +#define VMAXI_H(vd, vj, imm5) EMIT(type_3R(0b01110010100100001, imm5, vj, vd)) +#define VMAXI_W(vd, vj, imm5) EMIT(type_3R(0b01110010100100010, imm5, vj, vd)) +#define VMAXI_D(vd, vj, imm5) EMIT(type_3R(0b01110010100100011, imm5, vj, vd)) +#define VMAXI_BU(vd, vj, imm5) EMIT(type_3R(0b01110010100101000, imm5, vj, vd)) +#define VMAXI_HU(vd, vj, imm5) EMIT(type_3R(0b01110010100101001, imm5, vj, vd)) +#define VMAXI_WU(vd, vj, imm5) EMIT(type_3R(0b01110010100101010, imm5, vj, vd)) +#define VMAXI_DU(vd, vj, imm5) EMIT(type_3R(0b01110010100101011, imm5, vj, vd)) +#define VMAX_B(vd, vj, vk) EMIT(type_3R(0b01110000011100000, vk, vj, vd)) +#define VMAX_H(vd, vj, vk) EMIT(type_3R(0b01110000011100001, vk, vj, vd)) +#define VMAX_W(vd, vj, vk) EMIT(type_3R(0b01110000011100010, vk, vj, vd)) +#define VMAX_D(vd, vj, vk) EMIT(type_3R(0b01110000011100011, vk, vj, vd)) +#define VMAX_BU(vd, vj, vk) EMIT(type_3R(0b01110000011101000, vk, vj, vd)) +#define VMAX_HU(vd, vj, vk) EMIT(type_3R(0b01110000011101001, vk, vj, vd)) +#define VMAX_WU(vd, vj, vk) EMIT(type_3R(0b01110000011101010, vk, vj, vd)) +#define VMAX_DU(vd, vj, vk) EMIT(type_3R(0b01110000011101011, vk, vj, vd)) +#define VMINI_B(vd, vj, imm5) EMIT(type_3R(0b01110010100100100, imm5, vj, vd)) +#define VMINI_H(vd, vj, imm5) EMIT(type_3R(0b01110010100100101, imm5, vj, vd)) +#define VMINI_W(vd, vj, imm5) EMIT(type_3R(0b01110010100100110, imm5, vj, vd)) +#define VMINI_D(vd, vj, imm5) EMIT(type_3R(0b01110010100100111, imm5, vj, vd)) +#define VMINI_BU(vd, vj, imm5) EMIT(type_3R(0b01110010100101100, imm5, vj, vd)) +#define VMINI_HU(vd, vj, imm5) EMIT(type_3R(0b01110010100101101, imm5, vj, vd)) +#define VMINI_WU(vd, vj, imm5) EMIT(type_3R(0b01110010100101110, imm5, vj, vd)) +#define VMINI_DU(vd, vj, imm5) EMIT(type_3R(0b01110010100101111, imm5, vj, vd)) +#define VMIN_B(vd, vj, vk) EMIT(type_3R(0b01110000011100100, vk, vj, vd)) +#define VMIN_H(vd, vj, vk) EMIT(type_3R(0b01110000011100101, vk, vj, vd)) +#define VMIN_W(vd, vj, vk) EMIT(type_3R(0b01110000011100110, vk, vj, vd)) +#define VMIN_D(vd, vj, vk) EMIT(type_3R(0b01110000011100111, vk, vj, vd)) +#define VMIN_BU(vd, vj, vk) EMIT(type_3R(0b01110000011101100, vk, vj, vd)) +#define VMIN_HU(vd, vj, vk) EMIT(type_3R(0b01110000011101101, vk, vj, vd)) +#define VMIN_WU(vd, vj, vk) EMIT(type_3R(0b01110000011101110, vk, vj, vd)) +#define VMIN_DU(vd, vj, vk) EMIT(type_3R(0b01110000011101111, vk, vj, vd)) +#define VMUL_B(vd, vj, vk) EMIT(type_3R(0b01110000100001000, vk, vj, vd)) +#define VMUL_H(vd, vj, vk) EMIT(type_3R(0b01110000100001001, vk, vj, vd)) +#define VMUL_W(vd, vj, vk) EMIT(type_3R(0b01110000100001010, vk, vj, vd)) +#define VMUL_D(vd, vj, vk) EMIT(type_3R(0b01110000100001011, vk, vj, vd)) +#define VMUH_B(vd, vj, vk) EMIT(type_3R(0b01110000100001100, vk, vj, vd)) +#define VMUH_H(vd, vj, vk) EMIT(type_3R(0b01110000100001101, vk, vj, vd)) +#define VMUH_W(vd, vj, vk) EMIT(type_3R(0b01110000100001110, vk, vj, vd)) +#define VMUH_D(vd, vj, vk) EMIT(type_3R(0b01110000100001111, vk, vj, vd)) +#define VMUH_BU(vd, vj, vk) EMIT(type_3R(0b01110000100010000, vk, vj, vd)) +#define VMUH_HU(vd, vj, vk) EMIT(type_3R(0b01110000100010001, vk, vj, vd)) +#define VMUH_WU(vd, vj, vk) EMIT(type_3R(0b01110000100010010, vk, vj, vd)) +#define VMUH_DU(vd, vj, vk) EMIT(type_3R(0b01110000100010011, vk, vj, vd)) +#define VMULWEV_H_B(vd, vj, vk) EMIT(type_3R(0b01110000100100000, vk, vj, vd)) +#define VMULWEV_W_H(vd, vj, vk) EMIT(type_3R(0b01110000100100001, vk, vj, vd)) +#define VMULWEV_D_W(vd, vj, vk) EMIT(type_3R(0b01110000100100010, vk, vj, vd)) +#define VMULWEV_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000100100011, vk, vj, vd)) +#define VMULWOD_H_B(vd, vj, vk) EMIT(type_3R(0b01110000100100100, vk, vj, vd)) +#define VMULWOD_W_H(vd, vj, vk) EMIT(type_3R(0b01110000100100101, vk, vj, vd)) +#define VMULWOD_D_W(vd, vj, vk) EMIT(type_3R(0b01110000100100110, vk, vj, vd)) +#define VMULWOD_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000100100111, vk, vj, vd)) +#define VMULWEV_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000100110000, vk, vj, vd)) +#define VMULWEV_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000100110001, vk, vj, vd)) +#define VMULWEV_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000100110010, vk, vj, vd)) +#define VMULWEV_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000100110011, vk, vj, vd)) +#define VMULWOD_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000100110100, vk, vj, vd)) +#define VMULWOD_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000100110101, vk, vj, vd)) +#define VMULWOD_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000100110110, vk, vj, vd)) +#define VMULWOD_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000100110111, vk, vj, vd)) +#define VMULWEV_H_BU_B(vd, vj, vk) EMIT(type_3R(0b01110000101000000, vk, vj, vd)) +#define VMULWEV_W_HU_H(vd, vj, vk) EMIT(type_3R(0b01110000101000001, vk, vj, vd)) +#define VMULWEV_D_WU_W(vd, vj, vk) EMIT(type_3R(0b01110000101000010, vk, vj, vd)) +#define VMULWEV_Q_DU_D(vd, vj, vk) EMIT(type_3R(0b01110000101000011, vk, vj, vd)) +#define VMULWOD_H_BU_B(vd, vj, vk) EMIT(type_3R(0b01110000101000100, vk, vj, vd)) +#define VMULWOD_W_HU_H(vd, vj, vk) EMIT(type_3R(0b01110000101000101, vk, vj, vd)) +#define VMULWOD_D_WU_W(vd, vj, vk) EMIT(type_3R(0b01110000101000110, vk, vj, vd)) +#define VMULWOD_Q_DU_D(vd, vj, vk) EMIT(type_3R(0b01110000101000111, vk, vj, vd)) +#define VMADD_B(vd, vj, vk) EMIT(type_3R(0b01110000101010000, vk, vj, vd)) +#define VMADD_H(vd, vj, vk) EMIT(type_3R(0b01110000101010001, vk, vj, vd)) +#define VMADD_W(vd, vj, vk) EMIT(type_3R(0b01110000101010010, vk, vj, vd)) +#define VMADD_D(vd, vj, vk) EMIT(type_3R(0b01110000101010011, vk, vj, vd)) +#define VMSUB_B(vd, vj, vk) EMIT(type_3R(0b01110000101010100, vk, vj, vd)) +#define VMSUB_H(vd, vj, vk) EMIT(type_3R(0b01110000101010101, vk, vj, vd)) +#define VMSUB_W(vd, vj, vk) EMIT(type_3R(0b01110000101010110, vk, vj, vd)) +#define VMSUB_D(vd, vj, vk) EMIT(type_3R(0b01110000101010111, vk, vj, vd)) +#define VMADDWEV_H_B(vd, vj, vk) EMIT(type_3R(0b01110000101011000, vk, vj, vd)) +#define VMADDWEV_W_H(vd, vj, vk) EMIT(type_3R(0b01110000101011001, vk, vj, vd)) +#define VMADDWEV_D_W(vd, vj, vk) EMIT(type_3R(0b01110000101011010, vk, vj, vd)) +#define VMADDWEV_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000101011011, vk, vj, vd)) +#define VMADDWOD_H_B(vd, vj, vk) EMIT(type_3R(0b01110000101011100, vk, vj, vd)) +#define VMADDWOD_W_H(vd, vj, vk) EMIT(type_3R(0b01110000101011101, vk, vj, vd)) +#define VMADDWOD_D_W(vd, vj, vk) EMIT(type_3R(0b01110000101011110, vk, vj, vd)) +#define VMADDWOD_Q_D(vd, vj, vk) EMIT(type_3R(0b01110000101011111, vk, vj, vd)) +#define VMADDWEV_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000101101000, vk, vj, vd)) +#define VMADDWEV_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000101101001, vk, vj, vd)) +#define VMADDWEV_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000101101010, vk, vj, vd)) +#define VMADDWEV_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000101101011, vk, vj, vd)) +#define VMADDWOD_H_BU(vd, vj, vk) EMIT(type_3R(0b01110000101101100, vk, vj, vd)) +#define VMADDWOD_W_HU(vd, vj, vk) EMIT(type_3R(0b01110000101101101, vk, vj, vd)) +#define VMADDWOD_D_WU(vd, vj, vk) EMIT(type_3R(0b01110000101101110, vk, vj, vd)) +#define VMADDWOD_Q_DU(vd, vj, vk) EMIT(type_3R(0b01110000101101111, vk, vj, vd)) +#define VMADDWEV_H_BU_B(vd, vj, vk) EMIT(type_3R(0b01110000101111000, vk, vj, vd)) +#define VMADDWEV_W_HU_H(vd, vj, vk) EMIT(type_3R(0b01110000101111001, vk, vj, vd)) +#define VMADDWEV_D_WU_W(vd, vj, vk) EMIT(type_3R(0b01110000101111010, vk, vj, vd)) +#define VMADDWEV_Q_DU_D(vd, vj, vk) EMIT(type_3R(0b01110000101111011, vk, vj, vd)) +#define VMADDWOD_H_BU_B(vd, vj, vk) EMIT(type_3R(0b01110000101111100, vk, vj, vd)) +#define VMADDWOD_W_HU_H(vd, vj, vk) EMIT(type_3R(0b01110000101111101, vk, vj, vd)) +#define VMADDWOD_D_WU_W(vd, vj, vk) EMIT(type_3R(0b01110000101111110, vk, vj, vd)) +#define VMADDWOD_Q_DU_D(vd, vj, vk) EMIT(type_3R(0b01110000101111111, vk, vj, vd)) +#define VDIV_B(vd, vj, vk) EMIT(type_3R(0b01110000111000000, vk, vj, vd)) +#define VDIV_H(vd, vj, vk) EMIT(type_3R(0b01110000111000001, vk, vj, vd)) +#define VDIV_W(vd, vj, vk) EMIT(type_3R(0b01110000111000010, vk, vj, vd)) +#define VDIV_D(vd, vj, vk) EMIT(type_3R(0b01110000111000011, vk, vj, vd)) +#define VDIV_BU(vd, vj, vk) EMIT(type_3R(0b01110000111001000, vk, vj, vd)) +#define VDIV_HU(vd, vj, vk) EMIT(type_3R(0b01110000111001001, vk, vj, vd)) +#define VDIV_WU(vd, vj, vk) EMIT(type_3R(0b01110000111001010, vk, vj, vd)) +#define VDIV_DU(vd, vj, vk) EMIT(type_3R(0b01110000111001011, vk, vj, vd)) +#define VMOD_B(vd, vj, vk) EMIT(type_3R(0b01110000111000100, vk, vj, vd)) +#define VMOD_H(vd, vj, vk) EMIT(type_3R(0b01110000111000101, vk, vj, vd)) +#define VMOD_W(vd, vj, vk) EMIT(type_3R(0b01110000111000110, vk, vj, vd)) +#define VMOD_D(vd, vj, vk) EMIT(type_3R(0b01110000111000111, vk, vj, vd)) +#define VMOD_BU(vd, vj, vk) EMIT(type_3R(0b01110000111001100, vk, vj, vd)) +#define VMOD_HU(vd, vj, vk) EMIT(type_3R(0b01110000111001101, vk, vj, vd)) +#define VMOD_WU(vd, vj, vk) EMIT(type_3R(0b01110000111001110, vk, vj, vd)) +#define VMOD_DU(vd, vj, vk) EMIT(type_3R(0b01110000111001111, vk, vj, vd)) +#define VSIGNCOV_B(vd, vj, vk) EMIT(type_3R(0b01110001001011100, vk, vj, vd)) +#define VSIGNCOV_H(vd, vj, vk) EMIT(type_3R(0b01110001001011101, vk, vj, vd)) +#define VSIGNCOV_W(vd, vj, vk) EMIT(type_3R(0b01110001001011110, vk, vj, vd)) +#define VSIGNCOV_D(vd, vj, vk) EMIT(type_3R(0b01110001001011111, vk, vj, vd)) +#define VMSKLTZ_B(vd, vj) EMIT(type_2R(0b0111001010011100010000, vj, vd)) +#define VMSKLTZ_H(vd, vj) EMIT(type_2R(0b0111001010011100010001, vj, vd)) +#define VMSKLTZ_W(vd, vj) EMIT(type_2R(0b0111001010011100010010, vj, vd)) +#define VMSKLTZ_D(vd, vj) EMIT(type_2R(0b0111001010011100010011, vj, vd)) +#define VMSKGEZ_B(vd, vj) EMIT(type_2R(0b0111001010011100010100, vj, vd)) +#define VMSKNZ_B(vd, vj) EMIT(type_2R(0b0111001010011100011000, vj, vd)) +#define VAND_V(vd, vj, vk) EMIT(type_3R(0b01110001001001100, vk, vj, vd)) +#define VLDI(vd, imm13) EMIT(type_1RI13(0b01110011111000, imm13, vd)) +#define VOR_V(vd, vj, vk) EMIT(type_3R(0b01110001001001101, vk, vj, vd)) +#define VXOR_V(vd, vj, vk) EMIT(type_3R(0b01110001001001110, vk, vj, vd)) +#define VNOR_V(vd, vj, vk) EMIT(type_3R(0b01110001001001111, vk, vj, vd)) +#define VANDN_V(vd, vj, vk) EMIT(type_3R(0b01110001001010000, vk, vj, vd)) +#define VORN_V(vd, vj, vk) EMIT(type_3R(0b01110001001010001, vk, vj, vd)) +#define VSLL_B(vd, vj, vk) EMIT(type_3R(0b01110000111010000, vk, vj, vd)) +#define VSLL_H(vd, vj, vk) EMIT(type_3R(0b01110000111010001, vk, vj, vd)) +#define VSLL_W(vd, vj, vk) EMIT(type_3R(0b01110000111010010, vk, vj, vd)) +#define VSLL_D(vd, vj, vk) EMIT(type_3R(0b01110000111010011, vk, vj, vd)) +#define VSRL_B(vd, vj, vk) EMIT(type_3R(0b01110000111010100, vk, vj, vd)) +#define VSRL_H(vd, vj, vk) EMIT(type_3R(0b01110000111010101, vk, vj, vd)) +#define VSRL_W(vd, vj, vk) EMIT(type_3R(0b01110000111010110, vk, vj, vd)) +#define VSRL_D(vd, vj, vk) EMIT(type_3R(0b01110000111010111, vk, vj, vd)) +#define VSRA_B(vd, vj, vk) EMIT(type_3R(0b01110000111011000, vk, vj, vd)) +#define VSRA_H(vd, vj, vk) EMIT(type_3R(0b01110000111011001, vk, vj, vd)) +#define VSRA_W(vd, vj, vk) EMIT(type_3R(0b01110000111011010, vk, vj, vd)) +#define VSRA_D(vd, vj, vk) EMIT(type_3R(0b01110000111011011, vk, vj, vd)) +#define VSLLI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111001100101100001, imm3, vj, vd)) +#define VSLLI_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110010110001, imm4, vj, vd)) +#define VSLLI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011001011001, imm5, vj, vd)) +#define VSLLI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001100101101, imm6, vj, vd)) +#define VSRLI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111001100110000001, imm3, vj, vd)) +#define VSRLI_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110011000001, imm4, vj, vd)) +#define VSRLI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011001100001, imm5, vj, vd)) +#define VSRLI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001100110001, imm6, vj, vd)) +#define VSRAI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111001100110100001, imm3, vj, vd)) +#define VSRAI_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110011010001, imm4, vj, vd)) +#define VSRAI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011001101001, imm5, vj, vd)) +#define VSRAI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001100110101, imm6, vj, vd)) +#define VROTR_B(vd, vj, vk) EMIT(type_3R(0b01110000111011100, vk, vj, vd)) +#define VROTR_H(vd, vj, vk) EMIT(type_3R(0b01110000111011101, vk, vj, vd)) +#define VROTR_W(vd, vj, vk) EMIT(type_3R(0b01110000111011110, vk, vj, vd)) +#define VROTR_D(vd, vj, vk) EMIT(type_3R(0b01110000111011111, vk, vj, vd)) +#define VSRLR_B(vd, vj, vk) EMIT(type_3R(0b01110000111100000, vk, vj, vd)) +#define VSRLR_H(vd, vj, vk) EMIT(type_3R(0b01110000111100001, vk, vj, vd)) +#define VSRLR_W(vd, vj, vk) EMIT(type_3R(0b01110000111100010, vk, vj, vd)) +#define VSRLR_D(vd, vj, vk) EMIT(type_3R(0b01110000111100011, vk, vj, vd)) +#define VSRAR_B(vd, vj, vk) EMIT(type_3R(0b01110000111100100, vk, vj, vd)) +#define VSRAR_H(vd, vj, vk) EMIT(type_3R(0b01110000111100101, vk, vj, vd)) +#define VSRAR_W(vd, vj, vk) EMIT(type_3R(0b01110000111100110, vk, vj, vd)) +#define VSRAR_D(vd, vj, vk) EMIT(type_3R(0b01110000111100111, vk, vj, vd)) +#define VSRLN_B_H(vd, vj, vk) EMIT(type_3R(0b01110000111101001, vk, vj, vd)) +#define VSRLN_H_W(vd, vj, vk) EMIT(type_3R(0b01110000111101010, vk, vj, vd)) +#define VSRLN_W_D(vd, vj, vk) EMIT(type_3R(0b01110000111101011, vk, vj, vd)) +#define VSRAN_B_H(vd, vj, vk) EMIT(type_3R(0b01110000111101101, vk, vj, vd)) +#define VSRAN_H_W(vd, vj, vk) EMIT(type_3R(0b01110000111101110, vk, vj, vd)) +#define VSRAN_W_D(vd, vj, vk) EMIT(type_3R(0b01110000111101111, vk, vj, vd)) +#define VSRLNI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110100000001, imm4, vj, vd)) +#define VSRLNI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011010000001, imm5, vj, vd)) +#define VSRLNI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001101000001, imm6, vj, vd)) +#define VSRLNI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011100110100001, imm7, vj, vd)) +#define VSRANI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110101100001, imm4, vj, vd)) +#define VSRANI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011010110001, imm5, vj, vd)) +#define VSRANI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001101011001, imm6, vj, vd)) +#define VSRANI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011100110101101, imm7, vj, vd)) +#define VSRLRN_B_H(vd, vj, vk) EMIT(type_3R(0b01110000111110001, vk, vj, vd)) +#define VSRLRN_H_W(vd, vj, vk) EMIT(type_3R(0b01110000111110010, vk, vj, vd)) +#define VSRLRN_W_D(vd, vj, vk) EMIT(type_3R(0b01110000111110011, vk, vj, vd)) +#define VSRARN_B_H(vd, vj, vk) EMIT(type_3R(0b01110000111110101, vk, vj, vd)) +#define VSRARN_H_W(vd, vj, vk) EMIT(type_3R(0b01110000111110110, vk, vj, vd)) +#define VSRARN_W_D(vd, vj, vk) EMIT(type_3R(0b01110000111110111, vk, vj, vd)) +#define VSSRLN_B_H(vd, vj, vk) EMIT(type_3R(0b01110000111111001, vk, vj, vd)) +#define VSSRLN_H_W(vd, vj, vk) EMIT(type_3R(0b01110000111111010, vk, vj, vd)) +#define VSSRLN_W_D(vd, vj, vk) EMIT(type_3R(0b01110000111111011, vk, vj, vd)) +#define VSSRAN_B_H(vd, vj, vk) EMIT(type_3R(0b01110000111111101, vk, vj, vd)) +#define VSSRAN_H_W(vd, vj, vk) EMIT(type_3R(0b01110000111111110, vk, vj, vd)) +#define VSSRAN_W_D(vd, vj, vk) EMIT(type_3R(0b01110000111111111, vk, vj, vd)) +#define VSSRLN_BU_H(vd, vj, vk) EMIT(type_3R(0b01110001000001001, vk, vj, vd)) +#define VSSRLN_HU_W(vd, vj, vk) EMIT(type_3R(0b01110001000001010, vk, vj, vd)) +#define VSSRLN_WU_D(vd, vj, vk) EMIT(type_3R(0b01110001000001011, vk, vj, vd)) +#define VSSRAN_BU_H(vd, vj, vk) EMIT(type_3R(0b01110001000001101, vk, vj, vd)) +#define VSSRAN_HU_W(vd, vj, vk) EMIT(type_3R(0b01110001000001110, vk, vj, vd)) +#define VSSRAN_WU_D(vd, vj, vk) EMIT(type_3R(0b01110001000001111, vk, vj, vd)) +#define VSSRLNI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110100100001, imm4, vj, vd)) +#define VSSRLNI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011010010001, imm5, vj, vd)) +#define VSSRLNI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001101001001, imm6, vj, vd)) +#define VSSRLNI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011100110100101, imm7, vj, vd)) +#define VSSRANI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110110000001, imm4, vj, vd)) +#define VSSRANI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011011000001, imm5, vj, vd)) +#define VSSRANI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001101100001, imm6, vj, vd)) +#define VSSRANI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011100110110001, imm7, vj, vd)) +#define VSSRLNI_BU_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110100110001, imm4, vj, vd)) +#define VSSRLNI_HU_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011010011001, imm5, vj, vd)) +#define VSSRLNI_WU_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001101001101, imm6, vj, vd)) +#define VSSRLNI_DU_Q(vd, vj, imm7) EMIT(type_2RI7(0b011100110100111, imm7, vj, vd)) +#define VSSRANI_BU_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110110010001, imm4, vj, vd)) +#define VSSRANI_HU_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011011001001, imm5, vj, vd)) +#define VSSRANI_WU_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001101100101, imm6, vj, vd)) +#define VSSRANI_DU_Q(vd, vj, imm7) EMIT(type_2RI7(0b011100110110011, imm7, vj, vd)) +#define VSSRLRN_B_H(vd, vj, vk) EMIT(type_3R(0b01110001000000001, vk, vj, vd)) +#define VSSRLRN_H_W(vd, vj, vk) EMIT(type_3R(0b01110001000000010, vk, vj, vd)) +#define VSSRLRN_W_D(vd, vj, vk) EMIT(type_3R(0b01110001000000011, vk, vj, vd)) +#define VSSRARN_B_H(vd, vj, vk) EMIT(type_3R(0b01110001000000101, vk, vj, vd)) +#define VSSRARN_H_W(vd, vj, vk) EMIT(type_3R(0b01110001000000110, vk, vj, vd)) +#define VSSRARN_W_D(vd, vj, vk) EMIT(type_3R(0b01110001000000111, vk, vj, vd)) +#define VSSRLRN_BU_H(vd, vj, vk) EMIT(type_3R(0b01110001000010001, vk, vj, vd)) +#define VSSRLRN_HU_W(vd, vj, vk) EMIT(type_3R(0b01110001000010010, vk, vj, vd)) +#define VSSRLRN_WU_D(vd, vj, vk) EMIT(type_3R(0b01110001000010011, vk, vj, vd)) +#define VSSRARN_BU_H(vd, vj, vk) EMIT(type_3R(0b01110001000010101, vk, vj, vd)) +#define VSSRARN_HU_W(vd, vj, vk) EMIT(type_3R(0b01110001000010110, vk, vj, vd)) +#define VSSRARN_WU_D(vd, vj, vk) EMIT(type_3R(0b01110001000010111, vk, vj, vd)) +#define VSSRLRNI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110101000001, imm4, vj, vd)) +#define VSSRLRNI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011010100001, imm5, vj, vd)) +#define VSSRLRNI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001101010001, imm6, vj, vd)) +#define VSSRLRNI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011100110101001, imm7, vj, vd)) +#define VSSRARNI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110110100001, imm4, vj, vd)) +#define VSSRARNI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011011010001, imm5, vj, vd)) +#define VSSRARNI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001101101001, imm6, vj, vd)) +#define VSSRARNI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011100110110101, imm7, vj, vd)) +#define VSSRLRNI_BU_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110101010001, imm4, vj, vd)) +#define VSSRLRNI_HU_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011010101001, imm5, vj, vd)) +#define VSSRLRNI_WU_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001101010101, imm6, vj, vd)) +#define VSSRLRNI_DU_Q(vd, vj, imm7) EMIT(type_2RI7(0b011100110101011, imm7, vj, vd)) +#define VSSRARNI_BU_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110110110001, imm4, vj, vd)) +#define VSSRARNI_HU_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011011011001, imm5, vj, vd)) +#define VSSRARNI_WU_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001101101101, imm6, vj, vd)) +#define VSSRARNI_DU_Q(vd, vj, imm7) EMIT(type_2RI7(0b011100110110111, imm7, vj, vd)) +#define VBITCLR_B(vd, vj, vk) EMIT(type_3R(0b01110001000011000, vk, vj, vd)) +#define VBITCLR_H(vd, vj, vk) EMIT(type_3R(0b01110001000011001, vk, vj, vd)) +#define VBITCLR_W(vd, vj, vk) EMIT(type_3R(0b01110001000011010, vk, vj, vd)) +#define VBITCLR_D(vd, vj, vk) EMIT(type_3R(0b01110001000011011, vk, vj, vd)) +#define VBITCLRI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111001100010000001, imm3, vj, vd)) +#define VBITCLRI_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110001000001, imm4, vj, vd)) +#define VBITCLRI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011000100001, imm5, vj, vd)) +#define VBITCLRI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111001100010001, imm6, vj, vd)) +#define VBITSET_B(vd, vj, vk) EMIT(type_3R(0b01110001000011100, vk, vj, vd)) +#define VBITSET_H(vd, vj, vk) EMIT(type_3R(0b01110001000011101, vk, vj, vd)) +#define VBITSET_W(vd, vj, vk) EMIT(type_3R(0b01110001000011110, vk, vj, vd)) +#define VBITSET_D(vd, vj, vk) EMIT(type_3R(0b01110001000011111, vk, vj, vd)) +#define VBITSEL_V(vd, vj, vk, va) EMIT(type_4R(0b000011010001, va, vk, vj, vd)) +#define VBITREV_B(vd, vj, vk) EMIT(type_3R(0b01110001000100000, vk, vj, vd)) +#define VBITREV_H(vd, vj, vk) EMIT(type_3R(0b01110001000100001, vk, vj, vd)) +#define VBITREV_W(vd, vj, vk) EMIT(type_3R(0b01110001000100010, vk, vj, vd)) +#define VBITREV_D(vd, vj, vk) EMIT(type_3R(0b01110001000100011, vk, vj, vd)) +#define VFRSTP_B(vd, vj, vk) EMIT(type_3R(0b01110001001010110, vk, vj, vd)) +#define VFRSTP_H(vd, vj, vk) EMIT(type_3R(0b01110001001010111, vk, vj, vd)) +#define VFRSTPI_B(vd, vj, imm5) EMIT(type_2RI5(0b01110010100110100, imm5, vj, vd)) +#define VFRSTPI_H(vd, vj, imm5) EMIT(type_2RI5(0b01110010100110101, imm5, vj, vd)) +#define VFADD_S(vd, vj, vk) EMIT(type_3R(0b01110001001100001, vk, vj, vd)) +#define VFADD_D(vd, vj, vk) EMIT(type_3R(0b01110001001100010, vk, vj, vd)) +#define VFSUB_S(vd, vj, vk) EMIT(type_3R(0b01110001001100101, vk, vj, vd)) +#define VFSUB_D(vd, vj, vk) EMIT(type_3R(0b01110001001100110, vk, vj, vd)) +#define VFMUL_S(vd, vj, vk) EMIT(type_3R(0b01110001001110001, vk, vj, vd)) +#define VFMUL_D(vd, vj, vk) EMIT(type_3R(0b01110001001110010, vk, vj, vd)) +#define VFDIV_S(vd, vj, vk) EMIT(type_3R(0b01110001001110101, vk, vj, vd)) +#define VFDIV_D(vd, vj, vk) EMIT(type_3R(0b01110001001110110, vk, vj, vd)) +#define VFMAX_S(vd, vj, vk) EMIT(type_3R(0b01110001001111001, vk, vj, vd)) +#define VFMAX_D(vd, vj, vk) EMIT(type_3R(0b01110001001111010, vk, vj, vd)) +#define VFMIN_S(vd, vj, vk) EMIT(type_3R(0b01110001001111101, vk, vj, vd)) +#define VFMIN_D(vd, vj, vk) EMIT(type_3R(0b01110001001111110, vk, vj, vd)) +#define VFMAXA_S(vd, vj, vk) EMIT(type_3R(0b01110001010000001, vk, vj, vd)) +#define VFMAXA_D(vd, vj, vk) EMIT(type_3R(0b01110001010000010, vk, vj, vd)) +#define VFMINA_S(vd, vj, vk) EMIT(type_3R(0b01110001010000101, vk, vj, vd)) +#define VFMINA_D(vd, vj, vk) EMIT(type_3R(0b01110001010000110, vk, vj, vd)) +#define VFSQRT_S(vd, vj) EMIT(type_2R(0b0111001010011100111001, vj, vd)) +#define VFSQRT_D(vd, vj) EMIT(type_2R(0b0111001010011100111010, vj, vd)) +#define VFRECIP_S(vd, vj) EMIT(type_2R(0b0111001010011100111101, vj, vd)) +#define VFRECIP_D(vd, vj) EMIT(type_2R(0b0111001010011100111110, vj, vd)) +#define VFRECIPE_S(vd, vj) EMIT(type_2R(0b0111001010011101000101, vj, vd)) +#define VFRECIPE_D(vd, vj) EMIT(type_2R(0b0111001010011101000110, vj, vd)) +#define VFRSQRT_S(vd, vj) EMIT(type_2R(0b0111001010011101000001, vj, vd)) +#define VFRSQRT_D(vd, vj) EMIT(type_2R(0b0111001010011101000010, vj, vd)) +#define VFRSQRTE_S(vd, vj) EMIT(type_2R(0b0111001010011101001001, vj, vd)) +#define VFRSQRTE_D(vd, vj) EMIT(type_2R(0b0111001010011101001010, vj, vd)) +#define VFCVTL_S_H(vd, vj) EMIT(type_2R(0b0111001010011101111010, vj, vd)) +#define VFCVTH_S_H(vd, vj) EMIT(type_2R(0b0111001010011101111011, vj, vd)) +#define VFCVTL_D_S(vd, vj) EMIT(type_2R(0b0111001010011101111100, vj, vd)) +#define VFCVTH_D_S(vd, vj) EMIT(type_2R(0b0111001010011101111101, vj, vd)) +#define VFCVT_H_S(vd, vj, vk) EMIT(type_3R(0b01110001010001100, vk, vj, vd)) +#define VFCVT_S_D(vd, vj, vk) EMIT(type_3R(0b01110001010001101, vk, vj, vd)) +#define VFTINT_W_S(vd, vj) EMIT(type_2R(0b0111001010011110001100, vj, vd)) +#define VFTINT_L_D(vd, vj) EMIT(type_2R(0b0111001010011110001101, vj, vd)) +#define VFTINTRM_W_S(vd, vj) EMIT(type_2R(0b0111001010011110001110, vj, vd)) +#define VFTINTRM_L_D(vd, vj) EMIT(type_2R(0b0111001010011110001111, vj, vd)) +#define VFTINTRP_W_S(vd, vj) EMIT(type_2R(0b0111001010011110010000, vj, vd)) +#define VFTINTRP_L_D(vd, vj) EMIT(type_2R(0b0111001010011110010001, vj, vd)) +#define VFTINTRZ_W_S(vd, vj) EMIT(type_2R(0b0111001010011110010010, vj, vd)) +#define VFTINTRZ_L_D(vd, vj) EMIT(type_2R(0b0111001010011110010011, vj, vd)) +#define VFTINTRNE_W_S(vd, vj) EMIT(type_2R(0b0111001010011110010100, vj, vd)) +#define VFTINTRNE_L_D(vd, vj) EMIT(type_2R(0b0111001010011110010101, vj, vd)) +#define VFTINT_WU_S(vd, vj) EMIT(type_2R(0b0111001010011110010110, vj, vd)) +#define VFTINT_LU_D(vd, vj) EMIT(type_2R(0b0111001010011110010111, vj, vd)) +#define VFTINTRZ_WU_S(vd, vj) EMIT(type_2R(0b0111001010011110011100, vj, vd)) +#define VFTINTRZ_LU_D(vd, vj) EMIT(type_2R(0b0111001010011110011101, vj, vd)) +#define VFTINT_W_D(vd, vj, vk) EMIT(type_3R(0b01110001010010011, vk, vj, vd)) +#define VFTINTRM_W_D(vd, vj, vk) EMIT(type_3R(0b01110001010010100, vk, vj, vd)) +#define VFTINTRP_W_D(vd, vj, vk) EMIT(type_3R(0b01110001010010101, vk, vj, vd)) +#define VFTINTRZ_W_D(vd, vj, vk) EMIT(type_3R(0b01110001010010110, vk, vj, vd)) +#define VFTINTRNE_W_D(vd, vj, vk) EMIT(type_3R(0b01110001010010111, vk, vj, vd)) +#define VFTINTL_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100000, vj, vd)) +#define VFTINTH_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100001, vj, vd)) +#define VFTINTRML_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100010, vj, vd)) +#define VFTINTRMH_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100011, vj, vd)) +#define VFTINTRPL_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100100, vj, vd)) +#define VFTINTRPH_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100101, vj, vd)) +#define VFTINTRZL_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100110, vj, vd)) +#define VFTINTRZH_L_S(vd, vj) EMIT(type_2R(0b0111001010011110100111, vj, vd)) +#define VFTINTRNEL_L_S(vd, vj) EMIT(type_2R(0b0111001010011110101000, vj, vd)) +#define VFTINTRNEH_L_S(vd, vj) EMIT(type_2R(0b0111001010011110101001, vj, vd)) +#define VFFINT_S_W(vd, vj) EMIT(type_2R(0b0111001010011110000000, vj, vd)) +#define VFFINT_S_WU(vd, vj) EMIT(type_2R(0b0111001010011110000001, vj, vd)) +#define VFFINT_D_L(vd, vj) EMIT(type_2R(0b0111001010011110000010, vj, vd)) +#define VFFINT_D_LU(vd, vj) EMIT(type_2R(0b0111001010011110000011, vj, vd)) +#define VFFINTL_D_W(vd, vj) EMIT(type_2R(0b0111001010011110000100, vj, vd)) +#define VFFINTH_D_W(vd, vj) EMIT(type_2R(0b0111001010011110000101, vj, vd)) +#define VFFINT_S_L(vd, vj, vk) EMIT(type_3R(0b01110001010010000, vk, vj, vd)) +#define VSEQ_B(vd, vj, vk) EMIT(type_3R(0b01110000000000000, vk, vj, vd)) +#define VSEQ_H(vd, vj, vk) EMIT(type_3R(0b01110000000000001, vk, vj, vd)) +#define VSEQ_W(vd, vj, vk) EMIT(type_3R(0b01110000000000010, vk, vj, vd)) +#define VSEQ_D(vd, vj, vk) EMIT(type_3R(0b01110000000000011, vk, vj, vd)) +#define VSLE_B(vd, vj, vk) EMIT(type_3R(0b01110000000000100, vk, vj, vd)) +#define VSLE_H(vd, vj, vk) EMIT(type_3R(0b01110000000000101, vk, vj, vd)) +#define VSLE_W(vd, vj, vk) EMIT(type_3R(0b01110000000000110, vk, vj, vd)) +#define VSLE_D(vd, vj, vk) EMIT(type_3R(0b01110000000000111, vk, vj, vd)) +#define VSLE_BU(vd, vj, vk) EMIT(type_3R(0b01110000000001000, vk, vj, vd)) +#define VSLE_HU(vd, vj, vk) EMIT(type_3R(0b01110000000001001, vk, vj, vd)) +#define VSLE_WU(vd, vj, vk) EMIT(type_3R(0b01110000000001010, vk, vj, vd)) +#define VSLE_DU(vd, vj, vk) EMIT(type_3R(0b01110000000001011, vk, vj, vd)) +#define VSLEI_BU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100001000, imm5, vj, vd)) +#define VSLEI_HU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100001001, imm5, vj, vd)) +#define VSLEI_WU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100001010, imm5, vj, vd)) +#define VSLEI_DU(vd, vj, imm5) EMIT(type_2RI5(0b01110010100001011, imm5, vj, vd)) +#define VSLT_B(vd, vj, vk) EMIT(type_3R(0b01110000000001100, vk, vj, vd)) +#define VSLT_H(vd, vj, vk) EMIT(type_3R(0b01110000000001101, vk, vj, vd)) +#define VSLT_W(vd, vj, vk) EMIT(type_3R(0b01110000000001110, vk, vj, vd)) +#define VSLTI_B(vd, vj, imm5) EMIT(type_2RI5(0b01110010100001100, imm5, vj, vd)) +#define VSLTI_H(vd, vj, imm5) EMIT(type_2RI5(0b01110010100001101, imm5, vj, vd)) +#define VSLTI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110010100001110, imm5, vj, vd)) +#define VSLTI_D(vd, vj, imm5) EMIT(type_2RI5(0b01110010100001111, imm5, vj, vd)) +#define VSLT_D(vd, vj, vk) EMIT(type_3R(0b01110000000001111, vk, vj, vd)) +#define VSLT_BU(vd, vj, vk) EMIT(type_3R(0b01110000000010000, vk, vj, vd)) +#define VSLT_HU(vd, vj, vk) EMIT(type_3R(0b01110000000010001, vk, vj, vd)) +#define VSLT_WU(vd, vj, vk) EMIT(type_3R(0b01110000000010010, vk, vj, vd)) +#define VSLT_DU(vd, vj, vk) EMIT(type_3R(0b01110000000010011, vk, vj, vd)) +#define VREPLVE_B(vd, vj, rk) EMIT(type_3R(0b01110001001000100, rk, vj, vd)) +#define VREPLVE_H(vd, vj, rk) EMIT(type_3R(0b01110001001000101, rk, vj, vd)) +#define VREPLVE_W(vd, vj, rk) EMIT(type_3R(0b01110001001000110, rk, vj, vd)) +#define VREPLVE_D(vd, vj, rk) EMIT(type_3R(0b01110001001000111, rk, vj, vd)) +#define VREPLVEI_B(vd, vk, imm4) EMIT(type_2RI4(0b011100101111011110, imm4, vk, vd)) +#define VREPLVEI_H(vd, vk, imm3) EMIT(type_2RI3(0b0111001011110111110, imm3, vk, vd)) +#define VREPLVEI_W(vd, vk, imm2) EMIT(type_2RI2(0b01110010111101111110, imm2, vk, vd)) +#define VREPLVEI_D(vd, vk, imm1) EMIT(type_2RI1(0b011100101111011111110, imm1, vk, vd)) +#define VBSLL_V(vd, vj, imm5) EMIT(type_2RI5(0b01110010100011100, imm5, vj, vd)) +#define VBSRL_V(vd, vj, imm5) EMIT(type_2RI5(0b01110010100011101, imm5, vj, vd)) +#define VPACKEV_B(vd, vj, vk) EMIT(type_3R(0b01110001000101100, vk, vj, vd)) +#define VPACKEV_H(vd, vj, vk) EMIT(type_3R(0b01110001000101101, vk, vj, vd)) +#define VPACKEV_W(vd, vj, vk) EMIT(type_3R(0b01110001000101110, vk, vj, vd)) +#define VPACKEV_D(vd, vj, vk) EMIT(type_3R(0b01110001000101111, vk, vj, vd)) +#define VPACKOD_B(vd, vj, vk) EMIT(type_3R(0b01110001000110000, vk, vj, vd)) +#define VPACKOD_H(vd, vj, vk) EMIT(type_3R(0b01110001000110001, vk, vj, vd)) +#define VPACKOD_W(vd, vj, vk) EMIT(type_3R(0b01110001000110010, vk, vj, vd)) +#define VPACKOD_D(vd, vj, vk) EMIT(type_3R(0b01110001000110011, vk, vj, vd)) +#define VPICKEV_B(vd, vj, vk) EMIT(type_3R(0b01110001000111100, vk, vj, vd)) +#define VPICKEV_H(vd, vj, vk) EMIT(type_3R(0b01110001000111101, vk, vj, vd)) +#define VPICKEV_W(vd, vj, vk) EMIT(type_3R(0b01110001000111110, vk, vj, vd)) +#define VPICKEV_D(vd, vj, vk) EMIT(type_3R(0b01110001000111111, vk, vj, vd)) +#define VPICKOD_B(vd, vj, vk) EMIT(type_3R(0b01110001001000000, vk, vj, vd)) +#define VPICKOD_H(vd, vj, vk) EMIT(type_3R(0b01110001001000001, vk, vj, vd)) +#define VPICKOD_W(vd, vj, vk) EMIT(type_3R(0b01110001001000010, vk, vj, vd)) +#define VPICKOD_D(vd, vj, vk) EMIT(type_3R(0b01110001001000011, vk, vj, vd)) +#define VILVL_B(vd, vj, vk) EMIT(type_3R(0b01110001000110100, vk, vj, vd)) +#define VILVL_H(vd, vj, vk) EMIT(type_3R(0b01110001000110101, vk, vj, vd)) +#define VILVL_W(vd, vj, vk) EMIT(type_3R(0b01110001000110110, vk, vj, vd)) +#define VILVL_D(vd, vj, vk) EMIT(type_3R(0b01110001000110111, vk, vj, vd)) +#define VILVH_B(vd, vj, vk) EMIT(type_3R(0b01110001000111000, vk, vj, vd)) +#define VILVH_H(vd, vj, vk) EMIT(type_3R(0b01110001000111001, vk, vj, vd)) +#define VILVH_W(vd, vj, vk) EMIT(type_3R(0b01110001000111010, vk, vj, vd)) +#define VILVH_D(vd, vj, vk) EMIT(type_3R(0b01110001000111011, vk, vj, vd)) +#define VSHUF_B(vd, vj, vk, va) EMIT(type_4R(0b000011010101, va, vk, vj, vd)) +#define VSHUF_H(vd, vj, vk) EMIT(type_3R(0b01110001011110101, vk, vj, vd)) +#define VSHUF_W(vd, vj, vk) EMIT(type_3R(0b01110001011110110, vk, vj, vd)) +#define VSHUF_D(vd, vj, vk) EMIT(type_3R(0b01110001011110111, vk, vj, vd)) +#define VSHUF4I_B(vd, vj, imm8) EMIT(type_2RI8(0b01110011100100, imm8, vj, vd)) +#define VSHUF4I_H(vd, vj, imm8) EMIT(type_2RI8(0b01110011100101, imm8, vj, vd)) +#define VSHUF4I_W(vd, vj, imm8) EMIT(type_2RI8(0b01110011100110, imm8, vj, vd)) +#define VSHUF4I_D(vd, vj, imm8) EMIT(type_2RI8(0b01110011100111, imm8, vj, vd)) +#define VEXTRINS_D(vd, vj, imm8) EMIT(type_2RI8(0b01110011100000, imm8, vj, vd)) +#define VEXTRINS_W(vd, vj, imm8) EMIT(type_2RI8(0b01110011100001, imm8, vj, vd)) +#define VEXTRINS_H(vd, vj, imm8) EMIT(type_2RI8(0b01110011100010, imm8, vj, vd)) +#define VEXTRINS_B(vd, vj, imm8) EMIT(type_2RI8(0b01110011100011, imm8, vj, vd)) +#define VLD(vd, rj, imm12) EMIT(type_2RI12(0b0010110000, imm12, rj, vd)) +#define VST(vd, rj, imm12) EMIT(type_2RI12(0b0010110001, imm12, rj, vd)) +#define VLDX(vd, rj, rk) EMIT(type_3R(0b00111000010000000, rk, rj, vd)) +#define VSTX(vd, rj, rk) EMIT(type_3R(0b00111000010001000, rk, rj, vd)) +#define VSTELM_D(vd, rj, imm8, imm1) EMIT(type_2RI9(0b0011000100010, (((imm1) << 8) | (imm8)), rj, vd)) +#define VSTELM_W(vd, rj, imm8, imm2) EMIT(type_2RI10(0b001100010010, (((imm2) << 8) | (imm8)), rj, vd)) +#define VSTELM_H(vd, rj, imm8, imm3) EMIT(type_2RI11(0b00110001010, (((imm3) << 8) | (imm8)), rj, vd)) +#define VSTELM_B(vd, rj, imm8, imm4) EMIT(type_2RI12(0b0011000110, (((imm4) << 8) | (imm8)), rj, vd)) +#define VLDREPL_D(vd, rj, imm9) EMIT(type_2RI9(0b0011000000010, imm9, rj, vd)) +#define VLDREPL_W(vd, rj, imm10) EMIT(type_2RI10(0b001100000010, imm10, rj, vd)) +#define VLDREPL_H(vd, rj, imm11) EMIT(type_2RI11(0b00110000010, imm11, rj, vd)) +#define VLDREPL_B(vd, rj, imm12) EMIT(type_2RI12(0b0011000010, imm12, rj, vd)) +#define VFCMP_S(vd, vj, vk, cond) EMIT(type_4R(0b000011000101, cond, vk, vj, vd)) +#define VFCMP_D(vd, vj, vk, cond) EMIT(type_4R(0b000011000110, cond, vk, vj, vd)) +#define XVFCMP_S(vd, vj, vk, cond) EMIT(type_4R(0b000011001001, cond, vk, vj, vd)) +#define XVFCMP_D(vd, vj, vk, cond) EMIT(type_4R(0b000011001010, cond, vk, vj, vd)) +#define VPERMI_W(vd, vj, imm8) EMIT(type_2RI8(0b01110011111001, imm8, vj, vd)) +#define VFMADD_S(vd, vj, vk, va) EMIT(type_4R(0b000010010001, va, vk, vj, vd)) +#define VFMSUB_S(vd, vj, vk, va) EMIT(type_4R(0b000010010101, va, vk, vj, vd)) +#define VFNMADD_S(vd, vj, vk, va) EMIT(type_4R(0b000010011001, va, vk, vj, vd)) +#define VFNMSUB_S(vd, vj, vk, va) EMIT(type_4R(0b000010011101, va, vk, vj, vd)) +#define VFMADD_D(vd, vj, vk, va) EMIT(type_4R(0b000010010010, va, vk, vj, vd)) +#define VFMSUB_D(vd, vj, vk, va) EMIT(type_4R(0b000010010110, va, vk, vj, vd)) +#define VFNMADD_D(vd, vj, vk, va) EMIT(type_4R(0b000010011010, va, vk, vj, vd)) +#define VFNMSUB_D(vd, vj, vk, va) EMIT(type_4R(0b000010011110, va, vk, vj, vd)) +#define VANDI_B(vd, vj, imm8) EMIT(type_2RI8(0b01110011110100, imm8, vj, vd)) +#define VORI_B(vd, vj, imm8) EMIT(type_2RI8(0b01110011110101, imm8, vj, vd)) +#define VXORI_B(vd, vj, imm8) EMIT(type_2RI8(0b01110011110110, imm8, vj, vd)) +#define VNORI_B(vd, vj, imm8) EMIT(type_2RI8(0b01110011110111, imm8, vj, vd)) #define XVADD_B(vd, vj, vk) EMIT(type_3R(0b01110100000010100, vk, vj, vd)) #define XVADD_H(vd, vj, vk) EMIT(type_3R(0b01110100000010101, vk, vj, vd)) @@ -1601,6 +1754,14 @@ LSX instruction starts with V, LASX instruction starts with XV. #define VSAT_HU(vd, vj, imm4) EMIT(type_2RI4(0b011100110010100001, imm4, vj, vd)) #define VSAT_WU(vd, vj, imm5) EMIT(type_2RI5(0b01110011001010001, imm5, vj, vd)) #define VSAT_DU(vd, vj, imm6) EMIT(type_2RI6(0b0111001100101001, imm6, vj, vd)) +#define VEXTH_H_B(vd, vj) EMIT(type_2R(0b0111001010011110111000, vj, vd)) +#define VEXTH_W_H(vd, vj) EMIT(type_2R(0b0111001010011110111001, vj, vd)) +#define VEXTH_D_W(vd, vj) EMIT(type_2R(0b0111001010011110111010, vj, vd)) +#define VEXTH_Q_D(vd, vj) EMIT(type_2R(0b0111001010011110111011, vj, vd)) +#define VEXTH_HU_BU(vd, vj) EMIT(type_2R(0b0111001010011110111100, vj, vd)) +#define VEXTH_WU_HU(vd, vj) EMIT(type_2R(0b0111001010011110111101, vj, vd)) +#define VEXTH_DU_WU(vd, vj) EMIT(type_2R(0b0111001010011110111110, vj, vd)) +#define VEXTH_QU_DU(vd, vj) EMIT(type_2R(0b0111001010011110111111, vj, vd)) #define XVSIGNCOV_B(vd, vj, vk) EMIT(type_3R(0b01110101001011100, vk, vj, vd)) #define XVSIGNCOV_H(vd, vj, vk) EMIT(type_3R(0b01110101001011101, vk, vj, vd)) #define XVSIGNCOV_W(vd, vj, vk) EMIT(type_3R(0b01110101001011110, vk, vj, vd)) @@ -1673,6 +1834,62 @@ LSX instruction starts with V, LASX instruction starts with XV. #define XVBITREV_D(vd, vj, vk) EMIT(type_3R(0b01110101000100011, vk, vj, vd)) #define XVFRSTP_B(vd, vj, vk) EMIT(type_3R(0b01110101001010110, vk, vj, vd)) #define XVFRSTP_H(vd, vj, vk) EMIT(type_3R(0b01110101001010111, vk, vj, vd)) +#define XVCLO_B(xd, xj) EMIT(type_2R(0b0111011010011100000000, xj, xd)) +#define XVCLO_H(xd, xj) EMIT(type_2R(0b0111011010011100000001, xj, xd)) +#define XVCLO_W(xd, xj) EMIT(type_2R(0b0111011010011100000010, xj, xd)) +#define XVCLO_D(xd, xj) EMIT(type_2R(0b0111011010011100000011, xj, xd)) +#define XVCLZ_B(xd, xj) EMIT(type_2R(0b0111011010011100000100, xj, xd)) +#define XVCLZ_H(xd, xj) EMIT(type_2R(0b0111011010011100000101, xj, xd)) +#define XVCLZ_W(xd, xj) EMIT(type_2R(0b0111011010011100000110, xj, xd)) +#define XVCLZ_D(xd, xj) EMIT(type_2R(0b0111011010011100000111, xj, xd)) +#define XVPCNT_B(xd, xj) EMIT(type_2R(0b0111011010011100001000, xj, xd)) +#define XVPCNT_H(xd, xj) EMIT(type_2R(0b0111011010011100001001, xj, xd)) +#define XVPCNT_W(xd, xj) EMIT(type_2R(0b0111011010011100001010, xj, xd)) +#define XVPCNT_D(xd, xj) EMIT(type_2R(0b0111011010011100001011, xj, xd)) +#define XVNEG_B(xd, xj) EMIT(type_2R(0b0111011010011100001100, xj, xd)) +#define XVNEG_H(xd, xj) EMIT(type_2R(0b0111011010011100001101, xj, xd)) +#define XVNEG_W(xd, xj) EMIT(type_2R(0b0111011010011100001110, xj, xd)) +#define XVNEG_D(xd, xj) EMIT(type_2R(0b0111011010011100001111, xj, xd)) +#define XVMSKLTZ_B(xd, xj) EMIT(type_2R(0b0111011010011100010000, xj, xd)) +#define XVMSKLTZ_H(xd, xj) EMIT(type_2R(0b0111011010011100010001, xj, xd)) +#define XVMSKLTZ_W(xd, xj) EMIT(type_2R(0b0111011010011100010010, xj, xd)) +#define XVMSKLTZ_D(xd, xj) EMIT(type_2R(0b0111011010011100010011, xj, xd)) +#define XVMSKGEZ_B(xd, xj) EMIT(type_2R(0b0111011010011100010100, xj, xd)) +#define XVMSKNZ_B(xd, xj) EMIT(type_2R(0b0111011010011100011000, xj, xd)) +#define XVSETEQZ_V(cd, xj) EMIT(type_2R(0b0111011010011100100110, xj, cd & 0b111)) +#define XVSETNEZ_V(cd, xj) EMIT(type_2R(0b0111011010011100100111, xj, cd & 0b111)) +#define XVSETANYEQZ_B(cd, xj) EMIT(type_2R(0b0111011010011100101000, xj, cd & 0b111)) +#define XVSETANYEQZ_H(cd, xj) EMIT(type_2R(0b0111011010011100101001, xj, cd & 0b111)) +#define XVSETANYEQZ_W(cd, xj) EMIT(type_2R(0b0111011010011100101010, xj, cd & 0b111)) +#define XVSETANYEQZ_D(cd, xj) EMIT(type_2R(0b0111011010011100101011, xj, cd & 0b111)) +#define XVSETALLNEZ_B(cd, xj) EMIT(type_2R(0b0111011010011100101100, xj, cd & 0b111)) +#define XVSETALLNEZ_H(cd, xj) EMIT(type_2R(0b0111011010011100101101, xj, cd & 0b111)) +#define XVSETALLNEZ_W(cd, xj) EMIT(type_2R(0b0111011010011100101110, xj, cd & 0b111)) +#define XVSETALLNEZ_D(cd, xj) EMIT(type_2R(0b0111011010011100101111, xj, cd & 0b111)) +#define XVFLOGB_S(xd, xj) EMIT(type_2R(0b0111011010011100110001, xj, xd)) +#define XVFLOGB_D(xd, xj) EMIT(type_2R(0b0111011010011100110010, xj, xd)) +#define XVFCLASS_S(xd, xj) EMIT(type_2R(0b0111011010011100110101, xj, xd)) +#define XVFCLASS_D(xd, xj) EMIT(type_2R(0b0111011010011100110110, xj, xd)) +#define XVFSQRT_S(xd, xj) EMIT(type_2R(0b0111011010011100111001, xj, xd)) +#define XVFSQRT_D(xd, xj) EMIT(type_2R(0b0111011010011100111010, xj, xd)) +#define XVFRECIP_S(xd, xj) EMIT(type_2R(0b0111011010011100111101, xj, xd)) +#define XVFRECIP_D(xd, xj) EMIT(type_2R(0b0111011010011100111110, xj, xd)) +#define XVFRSQRT_S(xd, xj) EMIT(type_2R(0b0111011010011101000001, xj, xd)) +#define XVFRSQRT_D(xd, xj) EMIT(type_2R(0b0111011010011101000010, xj, xd)) +#define XVFRECIPE_S(xd, xj) EMIT(type_2R(0b0111011010011101000101, xj, xd)) +#define XVFRECIPE_D(xd, xj) EMIT(type_2R(0b0111011010011101000110, xj, xd)) +#define XVFRSQRTE_S(xd, xj) EMIT(type_2R(0b0111011010011101001001, xj, xd)) +#define XVFRSQRTE_D(xd, xj) EMIT(type_2R(0b0111011010011101001010, xj, xd)) +#define XVFRINT_S(xd, xj) EMIT(type_2R(0b0111011010011101001101, xj, xd)) +#define XVFRINT_D(xd, xj) EMIT(type_2R(0b0111011010011101001110, xj, xd)) +#define XVFRINTRM_S(xd, xj) EMIT(type_2R(0b0111011010011101010001, xj, xd)) +#define XVFRINTRM_D(xd, xj) EMIT(type_2R(0b0111011010011101010010, xj, xd)) +#define XVFRINTRP_S(xd, xj) EMIT(type_2R(0b0111011010011101010101, xj, xd)) +#define XVFRINTRP_D(xd, xj) EMIT(type_2R(0b0111011010011101010110, xj, xd)) +#define XVFRINTRZ_S(xd, xj) EMIT(type_2R(0b0111011010011101011001, xj, xd)) +#define XVFRINTRZ_D(xd, xj) EMIT(type_2R(0b0111011010011101011010, xj, xd)) +#define XVFRINTRNE_S(xd, xj) EMIT(type_2R(0b0111011010011101011101, xj, xd)) +#define XVFRINTRNE_D(xd, xj) EMIT(type_2R(0b0111011010011101011110, xj, xd)) #define XVFADD_S(vd, vj, vk) EMIT(type_3R(0b01110101001100001, vk, vj, vd)) #define XVFADD_D(vd, vj, vk) EMIT(type_3R(0b01110101001100010, vk, vj, vd)) #define XVFSUB_S(vd, vj, vk) EMIT(type_3R(0b01110101001100101, vk, vj, vd)) @@ -1689,14 +1906,60 @@ LSX instruction starts with V, LASX instruction starts with XV. #define XVFMAXA_D(vd, vj, vk) EMIT(type_3R(0b01110101010000010, vk, vj, vd)) #define XVFMINA_S(vd, vj, vk) EMIT(type_3R(0b01110101010000101, vk, vj, vd)) #define XVFMINA_D(vd, vj, vk) EMIT(type_3R(0b01110101010000110, vk, vj, vd)) -#define XVFCVT_H_S(vd, vj, vk) EMIT(type_3R(0b01110101010001100, vk, vj, vd)) -#define XVFCVT_S_D(vd, vj, vk) EMIT(type_3R(0b01110101010001101, vk, vj, vd)) -#define XVFTINTRNE_W_D(vd, vj, vk) EMIT(type_3R(0b01110101010010111, vk, vj, vd)) -#define XVFTINTRZ_W_D(vd, vj, vk) EMIT(type_3R(0b01110101010010110, vk, vj, vd)) -#define XVFTINTRP_W_D(vd, vj, vk) EMIT(type_3R(0b01110101010010101, vk, vj, vd)) -#define XVFTINTRM_W_D(vd, vj, vk) EMIT(type_3R(0b01110101010010100, vk, vj, vd)) -#define XVFTINT_W_D(vd, vj, vk) EMIT(type_3R(0b01110101010010011, vk, vj, vd)) -#define XVFFINT_S_L(vd, vj, vk) EMIT(type_3R(0b01110101010010000, vk, vj, vd)) +#define XVFRINT_S(xd, xj) EMIT(type_2R(0b0111011010011101001101, xj, xd)) +#define XVFRINT_D(xd, xj) EMIT(type_2R(0b0111011010011101001110, xj, xd)) +#define XVFRINTRM_S(xd, xj) EMIT(type_2R(0b0111011010011101010001, xj, xd)) +#define XVFRINTRM_D(xd, xj) EMIT(type_2R(0b0111011010011101010010, xj, xd)) +#define XVFRINTRP_S(xd, xj) EMIT(type_2R(0b0111011010011101010101, xj, xd)) +#define XVFRINTRP_D(xd, xj) EMIT(type_2R(0b0111011010011101010110, xj, xd)) +#define XVFRINTRZ_S(xd, xj) EMIT(type_2R(0b0111011010011101011001, xj, xd)) +#define XVFRINTRZ_D(xd, xj) EMIT(type_2R(0b0111011010011101011010, xj, xd)) +#define XVFRINTRNE_S(xd, xj) EMIT(type_2R(0b0111011010011101011101, xj, xd)) +#define XVFRINTRNE_D(xd, xj) EMIT(type_2R(0b0111011010011101011110, xj, xd)) +#define XVFRINTRRD_S(vd, vj, rm) EMIT(type_2RI4(0b011101101001110101, ((rm & 0b11) << 2) | 0b01, vj, vd)) +#define XVFRINTRRD_D(vd, vj, rm) EMIT(type_2RI4(0b011101101001110101, ((rm & 0b11) << 2) | 0b10, vj, vd)) +#define XVFCVTL_S_H(xd, xj) EMIT(type_2R(0b0111011010011101111010, xj, xd)) +#define XVFCVTH_S_H(xd, xj) EMIT(type_2R(0b0111011010011101111011, xj, xd)) +#define XVFCVTL_D_S(xd, xj) EMIT(type_2R(0b0111011010011101111100, xj, xd)) +#define XVFCVTH_D_S(xd, xj) EMIT(type_2R(0b0111011010011101111101, xj, xd)) +#define XVFFINT_S_W(xd, xj) EMIT(type_2R(0b0111011010011110000000, xj, xd)) +#define XVFFINT_S_WU(xd, xj) EMIT(type_2R(0b0111011010011110000001, xj, xd)) +#define XVFFINT_D_L(xd, xj) EMIT(type_2R(0b0111011010011110000010, xj, xd)) +#define XVFFINT_D_LU(xd, xj) EMIT(type_2R(0b0111011010011110000011, xj, xd)) +#define XVFFINTL_D_W(xd, xj) EMIT(type_2R(0b0111011010011110000100, xj, xd)) +#define XVFFINTH_D_W(xd, xj) EMIT(type_2R(0b0111011010011110000101, xj, xd)) +#define XVFTINT_W_S(xd, xj) EMIT(type_2R(0b0111011010011110001100, xj, xd)) +#define XVFTINT_L_D(xd, xj) EMIT(type_2R(0b0111011010011110001101, xj, xd)) +#define XVFTINTRM_W_S(xd, xj) EMIT(type_2R(0b0111011010011110001110, xj, xd)) +#define XVFTINTRM_L_D(xd, xj) EMIT(type_2R(0b0111011010011110001111, xj, xd)) +#define XVFTINTRP_W_S(xd, xj) EMIT(type_2R(0b0111011010011110010000, xj, xd)) +#define XVFTINTRP_L_D(xd, xj) EMIT(type_2R(0b0111011010011110010001, xj, xd)) +#define XVFTINTRZ_W_S(xd, xj) EMIT(type_2R(0b0111011010011110010010, xj, xd)) +#define XVFTINTRZ_L_D(xd, xj) EMIT(type_2R(0b0111011010011110010011, xj, xd)) +#define XVFTINTRNE_W_S(xd, xj) EMIT(type_2R(0b0111011010011110010100, xj, xd)) +#define XVFTINTRNE_L_D(xd, xj) EMIT(type_2R(0b0111011010011110010101, xj, xd)) +#define XVFTINT_WU_S(xd, xj) EMIT(type_2R(0b0111011010011110010110, xj, xd)) +#define XVFTINT_LU_D(xd, xj) EMIT(type_2R(0b0111011010011110010111, xj, xd)) +#define XVFTINTRZ_WU_S(xd, xj) EMIT(type_2R(0b0111011010011110011100, xj, xd)) +#define XVFTINTRZ_LU_D(xd, xj) EMIT(type_2R(0b0111011010011110011101, xj, xd)) +#define XVFTINTL_L_S(xd, xj) EMIT(type_2R(0b0111011010011110100000, xj, xd)) +#define XVFTINTH_L_S(xd, xj) EMIT(type_2R(0b0111011010011110100001, xj, xd)) +#define XVFTINTRML_L_S(xd, xj) EMIT(type_2R(0b0111011010011110100010, xj, xd)) +#define XVFTINTRMH_L_S(xd, xj) EMIT(type_2R(0b0111011010011110100011, xj, xd)) +#define XVFTINTRPL_L_S(xd, xj) EMIT(type_2R(0b0111011010011110100100, xj, xd)) +#define XVFTINTRPH_L_S(xd, xj) EMIT(type_2R(0b0111011010011110100101, xj, xd)) +#define XVFTINTRZL_L_S(xd, xj) EMIT(type_2R(0b0111011010011110100110, xj, xd)) +#define XVFTINTRZH_L_S(xd, xj) EMIT(type_2R(0b0111011010011110100111, xj, xd)) +#define XVFTINTRNEL_L_S(xd, xj) EMIT(type_2R(0b0111011010011110101000, xj, xd)) +#define XVFTINTRNEH_L_S(xd, xj) EMIT(type_2R(0b0111011010011110101001, xj, xd)) +#define XVFCVT_H_S(xd, xj, xk) EMIT(type_3R(0b01110101010001100, xk, xj, xd)) +#define XVFCVT_S_D(xd, xj, xk) EMIT(type_3R(0b01110101010001101, xk, xj, xd)) +#define XVFFINT_S_L(xd, xj, xk) EMIT(type_3R(0b01110101010010000, xk, xj, xd)) +#define XVFTINT_W_D(xd, xj, xk) EMIT(type_3R(0b01110101010010011, xk, xj, xd)) +#define XVFTINTRM_W_D(xd, xj, xk) EMIT(type_3R(0b01110101010010100, xk, xj, xd)) +#define XVFTINTRP_W_D(xd, xj, xk) EMIT(type_3R(0b01110101010010101, xk, xj, xd)) +#define XVFTINTRZ_W_D(xd, xj, xk) EMIT(type_3R(0b01110101010010110, xk, xj, xd)) +#define XVFTINTRNE_W_D(xd, xj, xk) EMIT(type_3R(0b01110101010010111, xk, xj, xd)) #define XVSEQ_B(vd, vj, vk) EMIT(type_3R(0b01110100000000000, vk, vj, vd)) #define XVSEQ_H(vd, vj, vk) EMIT(type_3R(0b01110100000000001, vk, vj, vd)) #define XVSEQ_W(vd, vj, vk) EMIT(type_3R(0b01110100000000010, vk, vj, vd)) @@ -1743,14 +2006,18 @@ LSX instruction starts with V, LASX instruction starts with XV. #define XVILVH_H(vd, vj, vk) EMIT(type_3R(0b01110101000111001, vk, vj, vd)) #define XVILVH_W(vd, vj, vk) EMIT(type_3R(0b01110101000111010, vk, vj, vd)) #define XVILVH_D(vd, vj, vk) EMIT(type_3R(0b01110101000111011, vk, vj, vd)) +#define XVSHUF_B(xd, xj, xk, xa) EMIT(type_4R(0b000011010110, xa, xk, xj, xd)) #define XVSHUF_H(vd, vj, vk) EMIT(type_3R(0b01110101011110101, vk, vj, vd)) #define XVSHUF_W(vd, vj, vk) EMIT(type_3R(0b01110101011110110, vk, vj, vd)) #define XVSHUF_D(vd, vj, vk) EMIT(type_3R(0b01110101011110111, vk, vj, vd)) +#define XVSHUF4I_B(vd, vj, imm8) EMIT(type_2RI8(0b01110111100100, imm8, vj, vd)) +#define XVSHUF4I_H(vd, vj, imm8) EMIT(type_2RI8(0b01110111100101, imm8, vj, vd)) +#define XVSHUF4I_W(vd, vj, imm8) EMIT(type_2RI8(0b01110111100110, imm8, vj, vd)) +#define XVSHUF4I_D(vd, vj, imm8) EMIT(type_2RI8(0b01110111100111, imm8, vj, vd)) #define XVPERM_W(vd, vj, vk) EMIT(type_3R(0b01110101011111010, vk, vj, vd)) #define XVPERMI_W(vd, vj, imm8) EMIT(type_2RI8(0b01110111111001, imm8, vj, vd)) #define XVPERMI_D(vd, vj, imm8) EMIT(type_2RI8(0b01110111111010, imm8, vj, vd)) #define XVPERMI_Q(vd, vj, imm8) EMIT(type_2RI8(0b01110111111011, imm8, vj, vd)) - #define VEXT2XV_H_B(vd, vj) EMIT(type_2R(0b0111011010011111000100, vj, vd)) #define VEXT2XV_W_B(vd, vj) EMIT(type_2R(0b0111011010011111000101, vj, vd)) #define VEXT2XV_D_B(vd, vj) EMIT(type_2R(0b0111011010011111000110, vj, vd)) @@ -1763,6 +2030,262 @@ LSX instruction starts with V, LASX instruction starts with XV. #define VEXT2XV_WU_HU(vd, vj) EMIT(type_2R(0b0111011010011111001101, vj, vd)) #define VEXT2XV_DU_HU(vd, vj) EMIT(type_2R(0b0111011010011111001110, vj, vd)) #define VEXT2XV_DU_WU(vd, vj) EMIT(type_2R(0b0111011010011111001111, vj, vd)) +#define XVADDI_WU(vd, vj, imm5) EMIT(type_2RI5(0b01110110100010110, imm5, vj, vd)) +#define XVSRLNI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111010000001, imm5, vj, vd)) +#define XVSRLI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111001100001, imm5, vj, vd)) +#define VSETEQZ_V(cd, vj) EMIT(type_2R(0b0111001010011100100110, vj, cd & 0b111)) +#define VSETNEZ_V(cd, vj) EMIT(type_2R(0b0111001010011100100111, vj, cd & 0b111)) +#define VSETANYEQZ_B(cd, vj) EMIT(type_2R(0b0111001010011100101000, vj, cd & 0b111)) +#define VSETANYEQZ_H(cd, vj) EMIT(type_2R(0b0111001010011100101001, vj, cd & 0b111)) +#define VSETANYEQZ_W(cd, vj) EMIT(type_2R(0b0111001010011100101010, vj, cd & 0b111)) +#define VSETANYEQZ_D(cd, vj) EMIT(type_2R(0b0111001010011100101011, vj, cd & 0b111)) +#define VSETALLNEZ_B(cd, vj) EMIT(type_2R(0b0111001010011100101100, vj, cd & 0b111)) +#define VSETALLNEZ_H(cd, vj) EMIT(type_2R(0b0111001010011100101101, vj, cd & 0b111)) +#define VSETALLNEZ_W(cd, vj) EMIT(type_2R(0b0111001010011100101110, vj, cd & 0b111)) +#define VSETALLNEZ_D(cd, vj) EMIT(type_2R(0b0111001010011100101111, vj, cd & 0b111)) +#define VINSGR2VR_B(vd, rj, imm4) EMIT(type_2RI4(0b011100101110101110, imm4, rj, vd)) +#define VINSGR2VR_H(vd, rj, imm3) EMIT(type_2RI3(0b0111001011101011110, imm3, rj, vd)) +#define VINSGR2VR_W(vd, rj, imm2) EMIT(type_2RI2(0b01110010111010111110, imm2, rj, vd)) +#define VINSGR2VR_D(vd, rj, imm1) EMIT(type_2RI1(0b011100101110101111110, imm1, rj, vd)) +#define VPCNT_B(vd, vj) EMIT(type_2R(0b0111001010011100001000, vj, vd)) +#define VPCNT_H(vd, vj) EMIT(type_2R(0b0111001010011100001001, vj, vd)) +#define VPCNT_W(vd, vj) EMIT(type_2R(0b0111001010011100001010, vj, vd)) +#define VPCNT_D(vd, vj) EMIT(type_2R(0b0111001010011100001011, vj, vd)) +#define VPICKVE2GR_B(rd, vj, imm4) EMIT(type_2RI4(0b011100101110111110, imm4, vj, rd)) +#define VPICKVE2GR_H(rd, vj, imm3) EMIT(type_2RI3(0b0111001011101111110, imm3, vj, rd)) +#define VPICKVE2GR_W(rd, vj, imm2) EMIT(type_2RI2(0b01110010111011111110, imm2, vj, rd)) +#define VPICKVE2GR_D(rd, vj, imm1) EMIT(type_2RI1(0b011100101110111111110, imm1, vj, rd)) +#define VPICKVE2GR_BU(rd, vj, imm4) EMIT(type_2RI4(0b011100101111001110, imm4, vj, rd)) +#define VPICKVE2GR_HU(rd, vj, imm3) EMIT(type_2RI3(0b0111001011110011110, imm3, vj, rd)) +#define VPICKVE2GR_WU(rd, vj, imm2) EMIT(type_2RI2(0b01110010111100111110, imm2, vj, rd)) +#define VPICKVE2GR_DU(rd, vj, imm1) EMIT(type_2RI1(0b011100101111001111110, imm1, vj, rd)) +#define VFRINT_S(vd, vj) EMIT(type_2R(0b0111001010011101001101, vj, vd)) +#define VFRINT_D(vd, vj) EMIT(type_2R(0b0111001010011101001110, vj, vd)) +// vfrintrm.d 0010 vfrintrm.s 0001, vfrintrne.d 1110 vfrintrne.s 1101... +#define VFRINTRRD_S(vd, vj, rm) EMIT(type_2RI4(0b011100101001110101, ((rm & 0b11) << 2) | 0b01, vj, vd)) +#define VFRINTRRD_D(vd, vj, rm) EMIT(type_2RI4(0b011100101001110101, ((rm & 0b11) << 2) | 0b10, vj, vd)) +#define VREPLGR2VR_B(vd, rj) EMIT(type_2R(0b0111001010011111000000, rj, vd)) +#define VREPLGR2VR_H(vd, rj) EMIT(type_2R(0b0111001010011111000001, rj, vd)) +#define VREPLGR2VR_W(vd, rj) EMIT(type_2R(0b0111001010011111000010, rj, vd)) +#define VREPLGR2VR_D(vd, rj) EMIT(type_2R(0b0111001010011111000011, rj, vd)) +#define VSLLWIL_H_B(vd, vj, imm3) EMIT(type_2RI3(0b0111001100001000001, imm3, vj, vd)) +#define VSLLWIL_W_H(vd, vj, imm4) EMIT(type_2RI4(0b011100110000100001, imm4, vj, vd)) +#define VSLLWIL_D_W(vd, vj, imm5) EMIT(type_2RI5(0b01110011000010001, imm5, vj, vd)) +#define VSLLWIL_HU_BU(vd, vj, imm3) EMIT(type_2RI3(0b0111001100001100001, imm3, vj, vd)) +#define VSLLWIL_WU_HU(vd, vj, imm4) EMIT(type_2RI4(0b011100110000110001, imm4, vj, vd)) +#define VSLLWIL_DU_WU(vd, vj, imm5) EMIT(type_2RI5(0b01110011000011001, imm5, vj, vd)) +#define VNEG_B(vd, vj) EMIT(type_2R(0b0111011010011100001100, vj, vd)) +#define VNEG_H(vd, vj) EMIT(type_2R(0b0111011010011100001101, vj, vd)) +#define VNEG_W(vd, vj) EMIT(type_2R(0b0111011010011100001110, vj, vd)) +#define VNEG_D(vd, vj) EMIT(type_2R(0b0111011010011100001111, vj, vd)) + +#define XVLD(vd, rj, imm12) EMIT(type_2RI12(0b0010110010, imm12, rj, vd)) +#define XVST(vd, rj, imm12) EMIT(type_2RI12(0b0010110011, imm12, rj, vd)) +#define XVLDX(vd, vj, vk) EMIT(type_3R(0b00111000010010000, vk, vj, vd)) +#define XVSTX(vd, vj, vk) EMIT(type_3R(0b00111000010011000, vk, vj, vd)) +#define XVLDREPL_D(xd, rj, offset) EMIT(type_2RI9(0b0011001000010, (offset >> 3), rj, xd)) +#define XVLDREPL_W(xd, rj, offset) EMIT(type_2RI10(0b001100100010, (offset >> 2), rj, xd)) +#define XVLDREPL_H(xd, rj, offset) EMIT(type_2RI11(0b00110010010, (offset >> 1), rj, xd)) +#define XVLDREPL_B(xd, rj, offset) EMIT(type_2RI12(0b0011001010, offset, rj, xd)) +#define XVSTELM_D(xd, rj, offset, imm2) EMIT(type_2RI10(0b001100110001, ((imm2) << 8) | (offset), rj, xd)) +#define XVSTELM_W(xd, rj, offset, imm3) EMIT(type_2RI11(0b00110011001, ((imm3) << 8) | (offset), rj, xd)) +#define XVSTELM_H(xd, rj, offset, imm4) EMIT(type_2RI12(0b0011001101, ((imm4) << 8) | (offset), rj, xd)) +#define XVSTELM_B(xd, rj, offset, imm5) EMIT(type_2RI13(0b001100111, ((imm5) << 8) | (offset), rj, xd)) + +#define XVHSELI_D(vd, vj, imm5) EMIT(type_2RI5(0b01110110100111111, imm5, vj, vd)) +#define XVROTRI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111011010100000001, imm3, vj, vd)) +#define XVROTRI_H(vd, vj, imm4) EMIT(type_2RI4(0b011101101010000001, imm4, vj, vd)) +#define XVROTRI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110110101000001, imm5, vj, vd)) +#define XVROTRI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011010100001, imm6, vj, vd)) +#define XVSRLRI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111011010100100001, imm3, vj, vd)) +#define XVSRLRI_H(vd, vj, imm4) EMIT(type_2RI4(0b011101101010010001, imm4, vj, vd)) +#define XVSRLRI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110110101001001, imm5, vj, vd)) +#define XVSRLRI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011010100101, imm6, vj, vd)) +#define XVSRARI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111011010101000001, imm3, vj, vd)) +#define XVSRARI_H(vd, vj, imm4) EMIT(type_2RI4(0b011101101010100001, imm4, vj, vd)) +#define XVSRARI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110110101010001, imm5, vj, vd)) +#define XVSRARI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011010101001, imm6, vj, vd)) +#define XVINSGR2VR_W(vd, vj, imm3) EMIT(type_2RI3(0b0111011011101011110, imm3, vj, vd)) +#define XVINSGR2VR_D(vd, vj, imm2) EMIT(type_2RI2(0b01110110111010111110, imm2, vj, vd)) +#define XVPICKVE2GR_W(vd, vj, imm3) EMIT(type_2RI3(0b0111011011101111110, imm3, vj, vd)) +#define XVPICKVE2GR_D(vd, vj, imm2) EMIT(type_2RI2(0b01110110111011111110, imm2, vj, vd)) +#define XVPICKVE2GR_WU(vd, vj, imm3) EMIT(type_2RI3(0b0111011011110011110, imm3, vj, vd)) +#define XVPICKVE2GR_DU(vd, vj, imm2) EMIT(type_2RI2(0b01110110111100111110, imm2, vj, vd)) +#define XVREPL128VEI_B(vd, vj, imm4) EMIT(type_2RI4(0b011101101111011110, imm4, vj, vd)) +#define XVREPL128VEI_H(vd, vj, imm3) EMIT(type_2RI3(0b0111011011110111110, imm3, vj, vd)) +#define XVREPL128VEI_W(vd, vj, imm2) EMIT(type_2RI2(0b01110110111101111110, imm2, vj, vd)) +#define XVREPL128VEI_D(vd, vj, imm1) EMIT(type_2RI1(0b011101101111011111110, imm1, vj, vd)) +#define XVINSVE0_W(vd, vj, imm3) EMIT(type_2RI3(0b0111011011111111110, imm3, vj, vd)) +#define XVINSVE0_D(vd, vj, imm2) EMIT(type_2RI2(0b01110110111111111110, imm2, vj, vd)) +#define XVPICKVE_W(vd, vj, imm3) EMIT(type_2RI3(0b0111011100000011110, imm3, vj, vd)) +#define XVPICKVE_D(vd, vj, imm2) EMIT(type_2RI2(0b01110111000000111110, imm2, vj, vd)) +#define XVREPLVE0_B(xd, xj) EMIT(type_2R(0b0111011100000111000000, xj, xd)) +#define XVREPLVE0_H(xd, xj) EMIT(type_2R(0b0111011100000111100000, xj, xd)) +#define XVREPLVE0_W(xd, xj) EMIT(type_2R(0b0111011100000111110000, xj, xd)) +#define XVREPLVE0_D(xd, xj) EMIT(type_2R(0b0111011100000111111000, xj, xd)) +#define XVREPLVE0_Q(xd, xj) EMIT(type_2R(0b0111011100000111111100, xj, xd)) +#define XVEXTL_Q_D(xd, xj) EMIT(type_2R(0b0111011100001001000000, xj, xd)) +#define XVEXTL_QU_DU(xd, xj) EMIT(type_2R(0b0111011100001101000000, xj, xd)) +#define XVSLLWIL_H_B(vd, vj, imm3) EMIT(type_2RI3(0b0111011100001000001, imm3, vj, vd)) +#define XVSLLWIL_W_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110000100001, imm4, vj, vd)) +#define XVSLLWIL_D_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111000010001, imm5, vj, vd)) +#define XVSLLWIL_HU_BU(vd, vj, imm3) EMIT(type_2RI3(0b0111011100001100001, imm3, vj, vd)) +#define XVSLLWIL_WU_HU(vd, vj, imm4) EMIT(type_2RI4(0b011101110000110001, imm4, vj, vd)) +#define XVSLLWIL_DU_WU(vd, vj, imm5) EMIT(type_2RI5(0b01110111000011001, imm5, vj, vd)) +#define XVBITCLRI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111011100010000001, imm3, vj, vd)) +#define XVBITCLRI_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110001000001, imm4, vj, vd)) +#define XVBITCLRI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111000100001, imm5, vj, vd)) +#define XVBITCLRI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011100010001, imm6, vj, vd)) +#define XVBITSETI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111011100010100001, imm3, vj, vd)) +#define XVBITSETI_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110001010001, imm4, vj, vd)) +#define XVBITSETI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111000101001, imm5, vj, vd)) +#define XVBITSETI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011100010101, imm6, vj, vd)) +#define XVBITREVI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111011100011000001, imm3, vj, vd)) +#define XVBITREVI_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110001100001, imm4, vj, vd)) +#define XVBITREVI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111000110001, imm5, vj, vd)) +#define XVBITREVI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011100011001, imm6, vj, vd)) +#define XVSAT_B(vd, vj, imm3) EMIT(type_2RI3(0b0111011100100100001, imm3, vj, vd)) +#define XVSAT_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110010010001, imm4, vj, vd)) +#define XVSAT_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111001001001, imm5, vj, vd)) +#define XVSAT_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011100100101, imm6, vj, vd)) +#define XVSAT_BU(vd, vj, imm3) EMIT(type_2RI3(0b0111011100101000001, imm3, vj, vd)) +#define XVSAT_HU(vd, vj, imm4) EMIT(type_2RI4(0b011101110010100001, imm4, vj, vd)) +#define XVSAT_WU(vd, vj, imm5) EMIT(type_2RI5(0b01110111001010001, imm5, vj, vd)) +#define XVSAT_DU(vd, vj, imm6) EMIT(type_2RI6(0b0111011100101001, imm6, vj, vd)) +#define XVSLLI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111011100101100001, imm3, vj, vd)) +#define XVSLLI_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110010110001, imm4, vj, vd)) +#define XVSLLI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111001011001, imm5, vj, vd)) +#define XVSLLI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011100101101, imm6, vj, vd)) +#define XVSRLI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111011100110000001, imm3, vj, vd)) +#define XVSRLI_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110011000001, imm4, vj, vd)) +#define XVSRLI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111001100001, imm5, vj, vd)) +#define XVSRLI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011100110001, imm6, vj, vd)) +#define XVSRAI_B(vd, vj, imm3) EMIT(type_2RI3(0b0111011100110100001, imm3, vj, vd)) +#define XVSRAI_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110011010001, imm4, vj, vd)) +#define XVSRAI_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111001101001, imm5, vj, vd)) +#define XVSRAI_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011100110101, imm6, vj, vd)) +#define XVSRLNI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110100000001, imm4, vj, vd)) +#define XVSRLNI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111010000001, imm5, vj, vd)) +#define XVSRLNI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011101000001, imm6, vj, vd)) +#define XVSRLNI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011101110100001, imm7, vj, vd)) +#define XVSRLRNI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110100010001, imm4, vj, vd)) +#define XVSRLRNI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111010001001, imm5, vj, vd)) +#define XVSRLRNI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011101000101, imm6, vj, vd)) +#define XVSRLRNI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011101110100011, imm7, vj, vd)) +#define XVSSRLNI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110100100001, imm4, vj, vd)) +#define XVSSRLNI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111010010001, imm5, vj, vd)) +#define XVSSRLNI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011101001001, imm6, vj, vd)) +#define XVSSRLNI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011101110100101, imm7, vj, vd)) +#define XVSSRLNI_BU_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110100110001, imm4, vj, vd)) +#define XVSSRLNI_HU_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111010011001, imm5, vj, vd)) +#define XVSSRLNI_WU_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011101001101, imm6, vj, vd)) +#define XVSSRLNI_DU_Q(vd, vj, imm7) EMIT(type_2RI7(0b011101110100111, imm7, vj, vd)) +#define XVSSRLRNI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110101000001, imm4, vj, vd)) +#define XVSSRLRNI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111010100001, imm5, vj, vd)) +#define XVSSRLRNI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011101010001, imm6, vj, vd)) +#define XVSSRLRNI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011101110101001, imm7, vj, vd)) +#define XVSSRLRNI_BU_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110101010001, imm4, vj, vd)) +#define XVSSRLRNI_HU_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111010101001, imm5, vj, vd)) +#define XVSSRLRNI_WU_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011101010101, imm6, vj, vd)) +#define XVSSRLRNI_DU_Q(vd, vj, imm7) EMIT(type_2RI7(0b011101110101011, imm7, vj, vd)) +#define XVSRANI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110101100001, imm4, vj, vd)) +#define XVSRANI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111010110001, imm5, vj, vd)) +#define XVSRANI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011101011001, imm6, vj, vd)) +#define XVSRANI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011101110101101, imm7, vj, vd)) +#define XVSRARNI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110101110001, imm4, vj, vd)) +#define XVSRARNI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111010111001, imm5, vj, vd)) +#define XVSRARNI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011101011101, imm6, vj, vd)) +#define XVSRARNI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011101110101111, imm7, vj, vd)) +#define XVSSRANI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110110000001, imm4, vj, vd)) +#define XVSSRANI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111011000001, imm5, vj, vd)) +#define XVSSRANI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011101100001, imm6, vj, vd)) +#define XVSSRANI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011101110110001, imm7, vj, vd)) +#define XVSSRANI_BU_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110110010001, imm4, vj, vd)) +#define XVSSRANI_HU_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111011001001, imm5, vj, vd)) +#define XVSSRANI_WU_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011101100101, imm6, vj, vd)) +#define XVSSRANI_DU_Q(vd, vj, imm7) EMIT(type_2RI7(0b011101110110011, imm7, vj, vd)) +#define XVSSRARNI_B_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110110100001, imm4, vj, vd)) +#define XVSSRARNI_H_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111011010001, imm5, vj, vd)) +#define XVSSRARNI_W_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011101101001, imm6, vj, vd)) +#define XVSSRARNI_D_Q(vd, vj, imm7) EMIT(type_2RI7(0b011101110110101, imm7, vj, vd)) +#define XVSSRARNI_BU_H(vd, vj, imm4) EMIT(type_2RI4(0b011101110110110001, imm4, vj, vd)) +#define XVSSRARNI_HU_W(vd, vj, imm5) EMIT(type_2RI5(0b01110111011011001, imm5, vj, vd)) +#define XVSSRARNI_WU_D(vd, vj, imm6) EMIT(type_2RI6(0b0111011101101101, imm6, vj, vd)) +#define XVSSRARNI_DU_Q(vd, vj, imm7) EMIT(type_2RI7(0b011101110110111, imm7, vj, vd)) +#define XVEXTRINS_D(vd, vj, imm8) EMIT(type_2RI8(0b01110111100000, imm8, vj, vd)) +#define XVEXTRINS_W(vd, vj, imm8) EMIT(type_2RI8(0b01110111100001, imm8, vj, vd)) +#define XVEXTRINS_H(vd, vj, imm8) EMIT(type_2RI8(0b01110111100010, imm8, vj, vd)) +#define XVEXTRINS_B(vd, vj, imm8) EMIT(type_2RI8(0b01110111100011, imm8, vj, vd)) +#define XVSHUF4I_B(vd, vj, imm8) EMIT(type_2RI8(0b01110111100100, imm8, vj, vd)) +#define XVSHUF4I_H(vd, vj, imm8) EMIT(type_2RI8(0b01110111100101, imm8, vj, vd)) +#define XVSHUF4I_W(vd, vj, imm8) EMIT(type_2RI8(0b01110111100110, imm8, vj, vd)) +#define XVSHUF4I_D(vd, vj, imm8) EMIT(type_2RI8(0b01110111100111, imm8, vj, vd)) +#define XVBITSELI_B(vd, vj, imm8) EMIT(type_2RI8(0b01110111110001, imm8, vj, vd)) +#define XVANDI_B(vd, vj, imm8) EMIT(type_2RI8(0b01110111110100, imm8, vj, vd)) +#define XVORI_B(vd, vj, imm8) EMIT(type_2RI8(0b01110111110101, imm8, vj, vd)) +#define XVXORI_B(vd, vj, imm8) EMIT(type_2RI8(0b01110111110110, imm8, vj, vd)) +#define XVNORI_B(vd, vj, imm8) EMIT(type_2RI8(0b01110111110111, imm8, vj, vd)) +#define XVBITSEL_V(xd, xj, xk, xa) EMIT(type_4R(0b000011010010, xa, xk, xj, xd)) +#define XVSEQI_B(xd, xj, imm5) EMIT(type_2RI5(0b01110110100000000, imm5, xj, xd)) +#define XVSEQI_H(xd, xj, imm5) EMIT(type_2RI5(0b01110110100000001, imm5, xj, xd)) +#define XVSEQI_W(xd, xj, imm5) EMIT(type_2RI5(0b01110110100000010, imm5, xj, xd)) +#define XVSEQI_D(xd, xj, imm5) EMIT(type_2RI5(0b01110110100000011, imm5, xj, xd)) +#define XVSLEI_B(xd, xj, imm5) EMIT(type_2RI5(0b01110110100000100, imm5, xj, xd)) +#define XVSLEI_H(xd, xj, imm5) EMIT(type_2RI5(0b01110110100000101, imm5, xj, xd)) +#define XVSLEI_W(xd, xj, imm5) EMIT(type_2RI5(0b01110110100000110, imm5, xj, xd)) +#define XVSLEI_D(xd, xj, imm5) EMIT(type_2RI5(0b01110110100000111, imm5, xj, xd)) +#define XVSLEI_BU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100001000, imm5, xj, xd)) +#define XVSLEI_HU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100001001, imm5, xj, xd)) +#define XVSLEI_WU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100001010, imm5, xj, xd)) +#define XVSLEI_DU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100001011, imm5, xj, xd)) +#define XVSLTI_B(xd, xj, imm5) EMIT(type_2RI5(0b01110110100001100, imm5, xj, xd)) +#define XVSLTI_H(xd, xj, imm5) EMIT(type_2RI5(0b01110110100001101, imm5, xj, xd)) +#define XVSLTI_W(xd, xj, imm5) EMIT(type_2RI5(0b01110110100001110, imm5, xj, xd)) +#define XVSLTI_D(xd, xj, imm5) EMIT(type_2RI5(0b01110110100001111, imm5, xj, xd)) +#define XVSLTI_BU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100010000, imm5, xj, xd)) +#define XVSLTI_HU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100010001, imm5, xj, xd)) +#define XVSLTI_WU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100010010, imm5, xj, xd)) +#define XVSLTI_DU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100010011, imm5, xj, xd)) +#define XVMAXI_B(xd, xj, imm5) EMIT(type_2RI5(0b01110110100100000, imm5, xj, xd)) +#define XVMAXI_H(xd, xj, imm5) EMIT(type_2RI5(0b01110110100100001, imm5, xj, xd)) +#define XVMAXI_W(xd, xj, imm5) EMIT(type_2RI5(0b01110110100100010, imm5, xj, xd)) +#define XVMAXI_D(xd, xj, imm5) EMIT(type_2RI5(0b01110110100100011, imm5, xj, xd)) +#define XVMINI_B(xd, xj, imm5) EMIT(type_2RI5(0b01110110100100100, imm5, xj, xd)) +#define XVMINI_H(xd, xj, imm5) EMIT(type_2RI5(0b01110110100100101, imm5, xj, xd)) +#define XVMINI_W(xd, xj, imm5) EMIT(type_2RI5(0b01110110100100110, imm5, xj, xd)) +#define XVMINI_D(xd, xj, imm5) EMIT(type_2RI5(0b01110110100100111, imm5, xj, xd)) +#define XVMAXI_BU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100101000, imm5, xj, xd)) +#define XVMAXI_HU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100101001, imm5, xj, xd)) +#define XVMAXI_WU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100101010, imm5, xj, xd)) +#define XVMAXI_DU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100101011, imm5, xj, xd)) +#define XVMINI_BU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100101100, imm5, xj, xd)) +#define XVMINI_HU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100101101, imm5, xj, xd)) +#define XVMINI_WU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100101110, imm5, xj, xd)) +#define XVMINI_DU(xd, xj, imm5) EMIT(type_2RI5(0b01110110100101111, imm5, xj, xd)) +#define XVFRSTPI_B(xd, xj, imm5) EMIT(type_2RI5(0b01110110100110100, imm5, xj, xd)) +#define XVFRSTPI_H(xd, xj, imm5) EMIT(type_2RI5(0b01110110100110101, imm5, xj, xd)) +#define XVLDI(xd, imm13) EMIT(type_1RI13(0b01110111111000, imm13, xd)) +#define XVSHUF_B(xd, xj, xk, xa) EMIT(type_4R(0b000011010110, xa, xk, xj, xd)) +#define XVREPLVE_B(xd, xj, rk) EMIT(type_3R(0b01110101001000100, rk, xj, xd)) +#define XVREPLVE_H(xd, xj, rk) EMIT(type_3R(0b01110101001000101, rk, xj, xd)) +#define XVREPLVE_W(xd, xj, rk) EMIT(type_3R(0b01110101001000110, rk, xj, xd)) +#define XVREPLVE_D(xd, xj, rk) EMIT(type_3R(0b01110101001000111, rk, xj, xd)) +#define XVREPLGR2VR_B(xd, rj) EMIT(type_2R(0b0111011010011111000000, rj, xd)) +#define XVREPLGR2VR_H(xd, rj) EMIT(type_2R(0b0111011010011111000001, rj, xd)) +#define XVREPLGR2VR_W(xd, rj) EMIT(type_2R(0b0111011010011111000010, rj, xd)) +#define XVREPLGR2VR_D(xd, rj) EMIT(type_2R(0b0111011010011111000011, rj, xd)) + +#define XVFMADD_S(xd, xj, xk, xa) EMIT(type_4R(0b000010100001, xa, xk, xj, xd)) +#define XVFMSUB_S(xd, xj, xk, xa) EMIT(type_4R(0b000010100101, xa, xk, xj, xd)) +#define XVFNMADD_S(xd, xj, xk, xa) EMIT(type_4R(0b000010101001, xa, xk, xj, xd)) +#define XVFNMSUB_S(xd, xj, xk, xa) EMIT(type_4R(0b000010101101, xa, xk, xj, xd)) +#define XVFMADD_D(xd, xj, xk, xa) EMIT(type_4R(0b000010100010, xa, xk, xj, xd)) +#define XVFMSUB_D(xd, xj, xk, xa) EMIT(type_4R(0b000010100110, xa, xk, xj, xd)) +#define XVFNMADD_D(xd, xj, xk, xa) EMIT(type_4R(0b000010101010, xa, xk, xj, xd)) +#define XVFNMSUB_D(xd, xj, xk, xa) EMIT(type_4R(0b000010101110, xa, xk, xj, xd)) + +#define VMEPATMSK_V(vd, mode, uimm5) EMIT(type_1RI5I5(0b01110010100110111, uimm5, mode, vd)) +#define XVMEPATMSK_V(xd, mode, uimm5) EMIT(type_1RI5I5(0b01110110100110111, uimm5, mode, xd)) //////////////////////////////////////////////////////////////////////////////// // (undocumented) LBT extension instructions @@ -1795,7 +2318,7 @@ LSX instruction starts with V, LASX instruction starts with XV. // GET/SET LBT4.ftop #define X64_SET_TOP(imm3) EMIT(0x00007000 | ((imm3 & 0b111) << 5)) -#define X64_GET_TOP(rd) EMIT(type_2R(0x00007400, 0, rd)) +#define X64_GET_TOP(rd) EMIT(type_2R(0x00007400, 0, rd)) #define X64_GET_EFLAGS(rd, mask8) EMIT(type_2RI8(0x17, mask8, 0, rd)) #define X64_SET_EFLAGS(rd, mask8) EMIT(type_2RI8(0x17, mask8, 1, rd)) @@ -1822,141 +2345,137 @@ LSX instruction starts with V, LASX instruction starts with XV. // Note that these instructions only affect the LBT4.eflags. -#define X64_INC_B(rj) EMIT(type_2R(0x20, rj, 0x0)) -#define X64_INC_H(rj) EMIT(type_2R(0x20, rj, 0x1)) -#define X64_INC_W(rj) EMIT(type_2R(0x20, rj, 0x2)) -#define X64_INC_D(rj) EMIT(type_2R(0x20, rj, 0x3)) -#define X64_DEC_B(rj) EMIT(type_2R(0x20, rj, 0x4)) -#define X64_DEC_H(rj) EMIT(type_2R(0x20, rj, 0x5)) -#define X64_DEC_W(rj) EMIT(type_2R(0x20, rj, 0x6)) -#define X64_DEC_D(rj) EMIT(type_2R(0x20, rj, 0x7)) -#define X64_MUL_B(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x0)) -#define X64_MUL_H(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x1)) -#define X64_MUL_W(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x2)) -#define X64_MUL_D(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x3)) -#define X64_MUL_BU(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x4)) -#define X64_MUL_HU(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x5)) -#define X64_MUL_WU(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x6)) -#define X64_MUL_DU(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x7)) -#define X64_ADD_WU(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x0)) -#define X64_ADD_DU(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1)) -#define X64_SUB_WU(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x2)) -#define X64_SUB_DU(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x3)) -#define X64_ADD_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x4)) -#define X64_ADD_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x5)) -#define X64_ADD_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x6)) -#define X64_ADD_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x7)) -#define X64_SUB_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x8)) -#define X64_SUB_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x9)) -#define X64_SUB_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0xa)) -#define X64_SUB_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0xb)) -#define X64_ADC_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0xc)) -#define X64_ADC_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0xd)) -#define X64_ADC_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0xe)) -#define X64_ADC_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0xf)) -#define X64_SBC_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x10)) -#define X64_SBC_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x11)) -#define X64_SBC_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x12)) -#define X64_SBC_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x13)) -#define X64_SLL_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x14)) -#define X64_SLL_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x15)) -#define X64_SLL_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x16)) -#define X64_SLL_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x17)) -#define X64_SRL_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x18)) -#define X64_SRL_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x19)) -#define X64_SRL_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1a)) -#define X64_SRL_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1b)) -#define X64_SRA_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1c)) -#define X64_SRA_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1d)) -#define X64_SRA_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1e)) -#define X64_SRA_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1f)) -#define X64_ROTR_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x0)) -#define X64_ROTR_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x1)) -#define X64_ROTR_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x2)) -#define X64_ROTR_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x3)) -#define X64_ROTL_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x4)) -#define X64_ROTL_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x5)) -#define X64_ROTL_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x6)) -#define X64_ROTL_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x7)) -#define X64_RCR_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x8)) -#define X64_RCR_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x9)) -#define X64_RCR_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0xa)) -#define X64_RCR_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0xb)) -#define X64_RCL_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0xc)) -#define X64_RCL_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0xd)) -#define X64_RCL_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0xe)) -#define X64_RCL_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0xf)) -#define X64_AND_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x10)) -#define X64_AND_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x11)) -#define X64_AND_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x12)) -#define X64_AND_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x13)) -#define X64_OR_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x14)) -#define X64_OR_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x15)) -#define X64_OR_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x16)) -#define X64_OR_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x17)) -#define X64_XOR_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x18)) -#define X64_XOR_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x19)) -#define X64_XOR_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x1a)) -#define X64_XOR_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x1b)) -#define X64_SLLI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0x0)) -#define X64_SRLI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0x4)) -#define X64_SRAI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0x8)) -#define X64_ROTRI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0xc)) -#define X64_RCRI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0x10)) -#define X64_ROTLI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0x14)) -#define X64_RCLI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0x18)) -#define X64_SLLI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0x1)) -#define X64_SRLI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0x5)) -#define X64_SRAI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0x9)) -#define X64_ROTRI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0xd)) -#define X64_RCRI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0x11)) -#define X64_ROTLI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0x15)) -#define X64_RCLI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0x19)) -#define X64_SLLI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0x2)) -#define X64_SRLI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0x6)) -#define X64_SRAI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0xa)) -#define X64_ROTRI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0xe)) -#define X64_RCRI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0x12)) -#define X64_ROTLI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0x16)) -#define X64_RCLI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0x1a)) -#define X64_SLLI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0x3)) -#define X64_SRLI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0x7)) -#define X64_SRAI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0xb)) -#define X64_ROTRI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0xf)) -#define X64_RCRI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0x13)) -#define X64_ROTLI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0x17)) -#define X64_RCLI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0x1b)) +#define X64_INC_B(rj) EMIT(type_2R(0x20, rj, 0x0)) +#define X64_INC_H(rj) EMIT(type_2R(0x20, rj, 0x1)) +#define X64_INC_W(rj) EMIT(type_2R(0x20, rj, 0x2)) +#define X64_INC_D(rj) EMIT(type_2R(0x20, rj, 0x3)) +#define X64_DEC_B(rj) EMIT(type_2R(0x20, rj, 0x4)) +#define X64_DEC_H(rj) EMIT(type_2R(0x20, rj, 0x5)) +#define X64_DEC_W(rj) EMIT(type_2R(0x20, rj, 0x6)) +#define X64_DEC_D(rj) EMIT(type_2R(0x20, rj, 0x7)) +#define X64_MUL_B(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x0)) +#define X64_MUL_H(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x1)) +#define X64_MUL_W(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x2)) +#define X64_MUL_D(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x3)) +#define X64_MUL_BU(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x4)) +#define X64_MUL_HU(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x5)) +#define X64_MUL_WU(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x6)) +#define X64_MUL_DU(rj, rk) EMIT(type_3R(0x7d, rk, rj, 0x7)) +#define X64_ADD_WU(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x0)) +#define X64_ADD_DU(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1)) +#define X64_SUB_WU(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x2)) +#define X64_SUB_DU(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x3)) +#define X64_ADD_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x4)) +#define X64_ADD_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x5)) +#define X64_ADD_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x6)) +#define X64_ADD_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x7)) +#define X64_SUB_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x8)) +#define X64_SUB_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x9)) +#define X64_SUB_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0xa)) +#define X64_SUB_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0xb)) +#define X64_ADC_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0xc)) +#define X64_ADC_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0xd)) +#define X64_ADC_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0xe)) +#define X64_ADC_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0xf)) +#define X64_SBC_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x10)) +#define X64_SBC_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x11)) +#define X64_SBC_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x12)) +#define X64_SBC_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x13)) +#define X64_SLL_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x14)) +#define X64_SLL_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x15)) +#define X64_SLL_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x16)) +#define X64_SLL_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x17)) +#define X64_SRL_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x18)) +#define X64_SRL_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x19)) +#define X64_SRL_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1a)) +#define X64_SRL_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1b)) +#define X64_SRA_B(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1c)) +#define X64_SRA_H(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1d)) +#define X64_SRA_W(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1e)) +#define X64_SRA_D(rj, rk) EMIT(type_3R(0x7e, rk, rj, 0x1f)) +#define X64_ROTR_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x0)) +#define X64_ROTR_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x1)) +#define X64_ROTR_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x2)) +#define X64_ROTR_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x3)) +#define X64_ROTL_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x4)) +#define X64_ROTL_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x5)) +#define X64_ROTL_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x6)) +#define X64_ROTL_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x7)) +#define X64_RCR_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x8)) +#define X64_RCR_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x9)) +#define X64_RCR_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0xa)) +#define X64_RCR_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0xb)) +#define X64_RCL_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0xc)) +#define X64_RCL_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0xd)) +#define X64_RCL_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0xe)) +#define X64_RCL_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0xf)) +#define X64_AND_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x10)) +#define X64_AND_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x11)) +#define X64_AND_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x12)) +#define X64_AND_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x13)) +#define X64_OR_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x14)) +#define X64_OR_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x15)) +#define X64_OR_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x16)) +#define X64_OR_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x17)) +#define X64_XOR_B(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x18)) +#define X64_XOR_H(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x19)) +#define X64_XOR_W(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x1a)) +#define X64_XOR_D(rj, rk) EMIT(type_3R(0x7f, rk, rj, 0x1b)) +#define X64_SLLI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0x0)) +#define X64_SRLI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0x4)) +#define X64_SRAI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0x8)) +#define X64_ROTRI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0xc)) +#define X64_RCRI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0x10)) +#define X64_ROTLI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0x14)) +#define X64_RCLI_B(rj, imm3) EMIT(type_2RI3(0x2a1, imm3, rj, 0x18)) +#define X64_SLLI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0x1)) +#define X64_SRLI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0x5)) +#define X64_SRAI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0x9)) +#define X64_ROTRI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0xd)) +#define X64_RCRI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0x11)) +#define X64_ROTLI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0x15)) +#define X64_RCLI_H(rj, imm4) EMIT(type_2RI4(0x151, imm4, rj, 0x19)) +#define X64_SLLI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0x2)) +#define X64_SRLI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0x6)) +#define X64_SRAI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0xa)) +#define X64_ROTRI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0xe)) +#define X64_RCRI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0x12)) +#define X64_ROTLI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0x16)) +#define X64_RCLI_W(rj, imm5) EMIT(type_2RI5(0xa9, imm5, rj, 0x1a)) +#define X64_SLLI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0x3)) +#define X64_SRLI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0x7)) +#define X64_SRAI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0xb)) +#define X64_ROTRI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0xf)) +#define X64_RCRI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0x13)) +#define X64_ROTLI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0x17)) +#define X64_RCLI_D(rj, imm6) EMIT(type_2RI6(0x55, imm6, rj, 0x1b)) // Warning, these are LBT addons that uses LBT4.eflags internally -#define ADC_B(rd, rj, rk) EMIT(type_3R(0x60, rk, rj, rd)) -#define ADC_H(rd, rj, rk) EMIT(type_3R(0x61, rk, rj, rd)) -#define ADC_W(rd, rj, rk) EMIT(type_3R(0x62, rk, rj, rd)) -#define ADC_D(rd, rj, rk) EMIT(type_3R(0x63, rk, rj, rd)) -#define SBC_B(rd, rj, rk) EMIT(type_3R(0x64, rk, rj, rd)) -#define SBC_H(rd, rj, rk) EMIT(type_3R(0x65, rk, rj, rd)) -#define SBC_W(rd, rj, rk) EMIT(type_3R(0x66, rk, rj, rd)) -#define SBC_D(rd, rj, rk) EMIT(type_3R(0x67, rk, rj, rd)) -#define RCR_B(rd, rj, rk) EMIT(type_3R(0x68, rk, rj, rd)) -#define RCR_H(rd, rj, rk) EMIT(type_3R(0x69, rk, rj, rd)) -#define RCR_W(rd, rj, rk) EMIT(type_3R(0x6a, rk, rj, rd)) -#define RCR_D(rd, rj, rk) EMIT(type_3R(0x6b, rk, rj, rd)) +#define ADC_B(rd, rj, rk) EMIT(type_3R(0x60, rk, rj, rd)) +#define ADC_H(rd, rj, rk) EMIT(type_3R(0x61, rk, rj, rd)) +#define ADC_W(rd, rj, rk) EMIT(type_3R(0x62, rk, rj, rd)) +#define ADC_D(rd, rj, rk) EMIT(type_3R(0x63, rk, rj, rd)) +#define SBC_B(rd, rj, rk) EMIT(type_3R(0x64, rk, rj, rd)) +#define SBC_H(rd, rj, rk) EMIT(type_3R(0x65, rk, rj, rd)) +#define SBC_W(rd, rj, rk) EMIT(type_3R(0x66, rk, rj, rd)) +#define SBC_D(rd, rj, rk) EMIT(type_3R(0x67, rk, rj, rd)) +#define RCR_B(rd, rj, rk) EMIT(type_3R(0x68, rk, rj, rd)) +#define RCR_H(rd, rj, rk) EMIT(type_3R(0x69, rk, rj, rd)) +#define RCR_W(rd, rj, rk) EMIT(type_3R(0x6a, rk, rj, rd)) +#define RCR_D(rd, rj, rk) EMIT(type_3R(0x6b, rk, rj, rd)) +#define RCRI_B(rd, rj, imm3) EMIT(type_2RI3(0b0000000001010000001, imm3, rj, rd)) +#define RCRI_H(rd, rj, imm4) EMIT(type_2RI4(0b000000000101000001, imm4, rj, rd)) +#define RCRI_W(rd, rj, imm5) EMIT(type_2RI5(0b00000000010100001, imm5, rj, rd)) +#define RCRI_D(rd, rj, imm6) EMIT(type_2RI6(0b0000000001010001, imm6, rj, rd)) + +// Additional LBT inst +#define ROTR_B(rd, rj, rk) EMIT(type_3R(0b00000000000110100, rk, rj, rd)) +#define ROTR_H(rd, rj, rk) EMIT(type_3R(0b00000000000110101, rk, rj, rd)) +#define ROTRI_B(rd, rj, imm3) EMIT(type_2RI3(0b0000000001001100001, imm3, rj, rd)) +#define ROTRI_H(rd, rj, imm4) EMIT(type_2RI4(0b000000000100110001, imm4, rj, rd)) //////////////////////////////////////////////////////////////////////////////// - -// GR[rd] = imm32 -#define MOV32w_(rd, imm32, zeroup) \ - do { \ - if (((uint32_t)(imm32)) > 0xfffu) { \ - LU12I_W(rd, (imm32) >> 12); \ - ORI(rd, rd, imm32); \ - if (zeroup && (int32_t)imm32 < 0) \ - ZEROUP(rd); \ - } else { \ - ORI(rd, xZR, imm32); \ - } \ - } while (0) - // MOV64x/MOV32w is quite complex, so use a function for this #define MOV64x(A, B) la64_move64(dyn, ninst, A, B) #define MOV32w(A, B) la64_move32(dyn, ninst, A, B, 1) @@ -1972,27 +2491,35 @@ LSX instruction starts with V, LASX instruction starts with XV. } else { \ MOV64x(A, B); \ } +#define MOV64y(A, B) \ + do { \ + if (rex.is32bits || rex.is67) { \ + MOV32w(A, B); \ + } else { \ + MOV64x(A, B); \ + } \ + } while (0) // rd[63:0] = rj[63:0] (pseudo instruction) #define MV(rd, rj) ADDI_D(rd, rj, 0) // rd = rj (pseudo instruction) -#define MVxw(rd, rj) \ - do { \ - if (rex.w) { \ - MV(rd, rj); \ - } else { \ - AND(rd, rj, xMASK); \ - } \ +#define MVxw(rd, rj) \ + do { \ + if (rex.w) { \ + MV(rd, rj); \ + } else { \ + ZEROUP2(rd, rj); \ + } \ } while (0) // rd = rj (pseudo instruction) -#define MVz(rd, rj) \ - do { \ - if (rex.is32bits) { \ - AND(rd, rj, xMASK); \ - } else { \ - MV(rd, rj); \ - } \ +#define MVz(rd, rj) \ + do { \ + if (rex.is32bits) { \ + ZEROUP2(rd, rj); \ + } else { \ + MV(rd, rj); \ + } \ } while (0) #define ADDIxw(rd, rj, imm12) \ @@ -2005,12 +2532,22 @@ LSX instruction starts with V, LASX instruction starts with XV. #define ADDIz(rd, rj, imm12) \ do { \ - if (rex.is32bits) \ + if (rex.is32bits) { \ ADDI_W(rd, rj, imm12); \ - else \ + ZEROUP(rd); \ + } else \ ADDI_D(rd, rj, imm12); \ } while (0) +#define ADDIy(rd, rj, imm12) \ + do { \ + if (rex.is32bits || rex.is67) { \ + ADDI_W(rd, rj, imm12); \ + ZEROUP(rd); \ + } else \ + ADDI_D(rd, rj, imm12); \ + } while (0) + #define ADDxw(rd, rj, rk) \ do { \ if (rex.w) \ @@ -2021,12 +2558,31 @@ LSX instruction starts with V, LASX instruction starts with XV. #define ADDz(rd, rj, rk) \ do { \ - if (rex.is32bits) \ + if (rex.is32bits) { \ ADD_W(rd, rj, rk); \ - else \ + ZEROUP(rd); \ + } else \ ADD_D(rd, rj, rk); \ } while (0) +#define ADDy(rd, rj, rk) \ + do { \ + if (rex.is32bits || rex.is67) { \ + ADD_W(rd, rj, rk); \ + ZEROUP(rd); \ + } else \ + ADD_D(rd, rj, rk); \ + } while (0) + +#define ADDxREGy(rd, rj, rk, s1) \ + do { \ + if (rex.is32bits || rex.is67) { \ + ADDI_W(s1, rk, 0); \ + ADD_D(rd, rj, s1); \ + } else \ + ADD_D(rd, rj, rk); \ + } while (0) + #define LDxw(rd, rj, imm12) \ do { \ if (rex.w) \ @@ -2084,7 +2640,7 @@ LSX instruction starts with V, LASX instruction starts with XV. ST_D(rd, rj, imm12); \ } while (0) -#define NEG_D(rd, rs1) SUB_D(rd, xZR, rs1) +#define NEG_D(rd, rj) SUB_D(rd, xZR, rj) #define SUBxw(rd, rj, rk) \ do { \ @@ -2094,13 +2650,14 @@ LSX instruction starts with V, LASX instruction starts with XV. SUB_W(rd, rj, rk); \ } while (0) -#define NEGxw(rd, rs1) SUBxw(rd, xZR, rs1) +#define NEGxw(rd, rj) SUBxw(rd, xZR, rj) #define SUBz(rd, rj, rk) \ do { \ - if (rex.is32bits) \ + if (rex.is32bits) { \ SUB_W(rd, rj, rk); \ - else \ + ZEROUP(rd); \ + } else \ SUB_D(rd, rj, rk); \ } while (0) @@ -2120,14 +2677,26 @@ LSX instruction starts with V, LASX instruction starts with XV. #define PUSH1_32(reg) \ do { \ ST_W(reg, xRSP, -4); \ - ADDI_W(xRSP, xRSP, -4); \ + ADDI_D(xRSP, xRSP, -4); \ } while (0); #define POP1_32(reg) \ do { \ LD_WU(reg, xRSP, 0); \ - if (reg != xRSP) ADDI_W(xRSP, xRSP, 4); \ + if (reg != xRSP) ADDI_D(xRSP, xRSP, 4); \ } while (0); +#define PUSH1_16(reg) \ + do { \ + ST_H(reg, xRSP, -2); \ + ADDI_D(xRSP, xRSP, -2); \ + } while (0) + +#define POP1_16(reg) \ + do { \ + LD_HU(reg, xRSP, 0); \ + if (reg != xRSP) ADDI_D(xRSP, xRSP, 2); \ + } while (0) + // POP reg #define POP1z(reg) \ do { \ @@ -2148,4 +2717,814 @@ LSX instruction starts with V, LASX instruction starts with XV. } \ } while (0) -#endif //__ARM64_EMITTER_H__ +#define VAND_Vxy(vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVAND_V(vd, vj, vk); \ + } else { \ + VAND_V(vd, vj, vk); \ + } \ + } while (0) + +#define VANDN_Vxy(vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVANDN_V(vd, vj, vk); \ + } else { \ + VANDN_V(vd, vj, vk); \ + } \ + } while (0) + +#define VOR_Vxy(vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVOR_V(vd, vj, vk); \ + } else { \ + VOR_V(vd, vj, vk); \ + } \ + } while (0) + +#define VXOR_Vxy(vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVXOR_V(vd, vj, vk); \ + } else { \ + VXOR_V(vd, vj, vk); \ + } \ + } while (0) + +#define VBSLL_Vxy(vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVBSLL_V(vd, vj, imm); \ + } else { \ + VBSLL_V(vd, vj, imm); \ + } \ + } while (0) + +#define VBSRL_Vxy(vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVBSRL_V(vd, vj, imm); \ + } else { \ + VBSRL_V(vd, vj, imm); \ + } \ + } while (0) + +#define VSLLIxy(width, vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVSLLI_##width(vd, vj, imm); \ + } else { \ + VSLLI_##width(vd, vj, imm); \ + } \ + } while (0) + +#define VSRLIxy(width, vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVSRLI_##width(vd, vj, imm); \ + } else { \ + VSRLI_##width(vd, vj, imm); \ + } \ + } while (0) + +#define VSRAIxy(width, vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVSRAI_##width(vd, vj, imm); \ + } else { \ + VSRAI_##width(vd, vj, imm); \ + } \ + } while (0) + +#define VSLLxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVSLL_##width(vd, vj, vk); \ + } else { \ + VSLL_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VSRLxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVSRL_##width(vd, vj, vk); \ + } else { \ + VSRL_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VSRAxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVSRA_##width(vd, vj, vk); \ + } else { \ + VSRA_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VSLEIxy(width, vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVSLEI_##width(vd, vj, imm); \ + } else { \ + VSLEI_##width(vd, vj, imm); \ + } \ + } while (0) + +#define VSLExy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVSLE_##width(vd, vj, vk); \ + } else { \ + VSLE_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VLDIxy(vd, imm) \ + do { \ + if (vex.l) { \ + XVLDI(vd, imm); \ + } else { \ + VLDI(vd, imm); \ + } \ + } while (0) + +#define VREPLVE0xy(width, vd, vj) \ + do { \ + if (vex.l) { \ + XVREPLVE0_##width(vd, vj); \ + } else { \ + VREPLVEI_##width(vd, vj, 0); \ + } \ + } while (0) + +#define VMAXIxy(width, vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVMAXI_##width(vd, vj, imm); \ + } else { \ + VMAXI_##width(vd, vj, imm); \ + } \ + } while (0) + +#define VMINIxy(width, vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVMINI_##width(vd, vj, imm); \ + } else { \ + VMINI_##width(vd, vj, imm); \ + } \ + } while (0) + +#define VADDxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVADD_##width(vd, vj, vk); \ + } else { \ + VADD_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VSUBxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVSUB_##width(vd, vj, vk); \ + } else { \ + VSUB_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VSADDxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVSADD_##width(vd, vj, vk); \ + } else { \ + VSADD_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VSSUBxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVSSUB_##width(vd, vj, vk); \ + } else { \ + VSSUB_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VMULxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVMUL_##width(vd, vj, vk); \ + } else { \ + VMUL_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VMUHxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVMUH_##width(vd, vj, vk); \ + } else { \ + VMUH_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VMULWEVxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVMULWEV_##width(vd, vj, vk); \ + } else { \ + VMULWEV_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VMULWODxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVMULWOD_##width(vd, vj, vk); \ + } else { \ + VMULWOD_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VMAXxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVMAX_##width(vd, vj, vk); \ + } else { \ + VMAX_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VMINxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVMIN_##width(vd, vj, vk); \ + } else { \ + VMIN_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VSIGNCOVxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVSIGNCOV_##width(vd, vj, vk); \ + } else { \ + VSIGNCOV_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VAVGxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVAVG_##width(vd, vj, vk); \ + } else { \ + VAVG_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VAVGRxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVAVGR_##width(vd, vj, vk); \ + } else { \ + VAVGR_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VABSDxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVABSD_##width(vd, vj, vk); \ + } else { \ + VABSD_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VHADDWxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVHADDW_##width(vd, vj, vk); \ + } else { \ + VHADDW_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VMADDxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVMADD_##width(vd, vj, vk); \ + } else { \ + VMADD_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VPICKEVxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVPICKEV_##width(vd, vj, vk); \ + } else { \ + VPICKEV_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VPICKODxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVPICKOD_##width(vd, vj, vk); \ + } else { \ + VPICKOD_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VPACKEVxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVPACKEV_##width(vd, vj, vk); \ + } else { \ + VPACKEV_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VPACKODxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVPACKOD_##width(vd, vj, vk); \ + } else { \ + VPACKOD_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VILVLxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVILVL_##width(vd, vj, vk); \ + } else { \ + VILVL_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VILVHxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVILVH_##width(vd, vj, vk); \ + } else { \ + VILVH_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VSATxy(width, vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVSAT_##width(vd, vj, imm); \ + } else { \ + VSAT_##width(vd, vj, imm); \ + } \ + } while (0) + +#define VSLTIxy(width, vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVSLTI_##width(vd, vj, imm); \ + } else { \ + VSLTI_##width(vd, vj, imm); \ + } \ + } while (0) + +#define VBITSEL_Vxy(vd, vj, vk, va) \ + do { \ + if (vex.l) { \ + XVBITSEL_V(vd, vj, vk, va); \ + } else { \ + VBITSEL_V(vd, vj, vk, va); \ + } \ + } while (0) + +#define VSHUF_Bxy(vd, vj, vk, va) \ + do { \ + if (vex.l) { \ + XVSHUF_B(vd, vj, vk, va); \ + } else { \ + VSHUF_B(vd, vj, vk, va); \ + } \ + } while (0) + +#define VSHUFxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVSHUF_##width(vd, vj, vk); \ + } else { \ + VSHUF_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VSHUF4Ixy(width, vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVSHUF4I_##width(vd, vj, imm); \ + } else { \ + VSHUF4I_##width(vd, vj, imm); \ + } \ + } while (0) + +#define VEXTRINSxy(width, vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVEXTRINS_##width(vd, vj, imm); \ + } else { \ + VEXTRINS_##width(vd, vj, imm); \ + } \ + } while (0) + +#define VANDIxy(vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVANDI_B(vd, vj, imm); \ + } else { \ + VANDI_B(vd, vj, imm); \ + } \ + } while (0) + +#define VLDREPLxy(width, vd, rj, imm) \ + do { \ + if (vex.l) { \ + XVLDREPL_##width(vd, rj, imm); \ + } else { \ + VLDREPL_##width(vd, rj, imm); \ + } \ + } while (0) + +#define XVPICKVE2GRxw(rd, xj, imm) \ + do { \ + if (rex.w) \ + XVPICKVE2GR_D(rd, xj, imm); \ + else \ + XVPICKVE2GR_WU(rd, xj, imm); \ + } while (0) + +#define XVINSGR2VRxw(xd, rj, imm) \ + do { \ + if (rex.w) \ + XVINSGR2VR_D(xd, rj, imm); \ + else \ + XVINSGR2VR_W(xd, rj, imm); \ + } while (0) + +#define VPICKVE2GRxw(rd, xj, imm) \ + do { \ + if (rex.w) \ + VPICKVE2GR_D(rd, xj, imm); \ + else \ + VPICKVE2GR_WU(rd, xj, imm); \ + } while (0) + +#define VINSGR2VRxw(xd, rj, imm) \ + do { \ + if (rex.w) \ + VINSGR2VR_D(xd, rj, imm); \ + else \ + VINSGR2VR_W(xd, rj, imm); \ + } while (0) + +#define XVINSVE0xw(xd, xj, imm) \ + do { \ + if (rex.w) \ + XVINSVE0_D(xd, xj, imm); \ + else \ + XVINSVE0_W(xd, xj, imm); \ + } while (0) + +#define VEXTRINSxw(xd, xj, imm) \ + do { \ + if (rex.w) \ + VEXTRINS_D(xd, xj, imm); \ + else \ + VEXTRINS_W(xd, xj, imm); \ + } while (0) + +#define VFMADDxy(width, vd, vj, vk, va) \ + do { \ + if (vex.l) { \ + XVFMADD_##width(vd, vj, vk, va); \ + } else { \ + VFMADD_##width(vd, vj, vk, va); \ + } \ + } while (0) + +#define VFMSUBxy(width, vd, vj, vk, va) \ + do { \ + if (vex.l) { \ + XVFMSUB_##width(vd, vj, vk, va); \ + } else { \ + VFMSUB_##width(vd, vj, vk, va); \ + } \ + } while (0) + +#define VFNMADDxy(width, vd, vj, vk, va) \ + do { \ + if (vex.l) { \ + XVFNMADD_##width(vd, vj, vk, va); \ + } else { \ + VFNMADD_##width(vd, vj, vk, va); \ + } \ + } while (0) + +#define VFNMSUBxy(width, vd, vj, vk, va) \ + do { \ + if (vex.l) { \ + XVFNMSUB_##width(vd, vj, vk, va); \ + } else { \ + VFNMSUB_##width(vd, vj, vk, va); \ + } \ + } while (0) + +#define VFMADDxyxw(vd, vj, vk, va) \ + do { \ + if (rex.w) { \ + VFMADDxy(D, vd, vj, vk, va); \ + } else { \ + VFMADDxy(S, vd, vj, vk, va); \ + } \ + } while (0) + +#define VFMSUBxyxw(vd, vj, vk, va) \ + do { \ + if (rex.w) { \ + VFMSUBxy(D, vd, vj, vk, va); \ + } else { \ + VFMSUBxy(S, vd, vj, vk, va); \ + } \ + } while (0) + +#define VFNMADDxyxw(vd, vj, vk, va) \ + do { \ + if (rex.w) { \ + VFNMADDxy(D, vd, vj, vk, va); \ + } else { \ + VFNMADDxy(S, vd, vj, vk, va); \ + } \ + } while (0) + +#define VFNMSUBxyxw(vd, vj, vk, va) \ + do { \ + if (rex.w) { \ + VFNMSUBxy(D, vd, vj, vk, va); \ + } else { \ + VFNMSUBxy(S, vd, vj, vk, va); \ + } \ + } while (0) + +#define VPICKEVxyxw(vd, vj, vk) \ + do { \ + if (rex.w) { \ + VPICKEVxy(D, vd, vj, vk); \ + } else { \ + VPICKEVxy(W, vd, vj, vk); \ + } \ + } while (0) + +#define VPICKODxyxw(vd, vj, vk) \ + do { \ + if (rex.w) { \ + VPICKODxy(D, vd, vj, vk); \ + } else { \ + VPICKODxy(W, vd, vj, vk); \ + } \ + } while (0) + +#define VILVLxyxw(vd, vj, vk) \ + do { \ + if (rex.w) { \ + VILVLxy(D, vd, vj, vk); \ + } else { \ + VILVLxy(W, vd, vj, vk); \ + } \ + } while (0) + +#define VILVHxyxw(vd, vj, vk) \ + do { \ + if (rex.w) { \ + VILVHxy(D, vd, vj, vk); \ + } else { \ + VILVHxy(W, vd, vj, vk); \ + } \ + } while (0) + +#define FMADDxw(fd, fj, fk, fa) \ + do { \ + if (rex.w) { \ + FMADD_D(fd, fj, fk, fa); \ + } else { \ + FMADD_S(fd, fj, fk, fa); \ + } \ + } while (0) + +#define FMSUBxw(fd, fj, fk, fa) \ + do { \ + if (rex.w) { \ + FMSUB_D(fd, fj, fk, fa); \ + } else { \ + FMSUB_S(fd, fj, fk, fa); \ + } \ + } while (0) + +#define FNMADDxw(fd, fj, fk, fa) \ + do { \ + if (rex.w) { \ + FNMADD_D(fd, fj, fk, fa); \ + } else { \ + FNMADD_S(fd, fj, fk, fa); \ + } \ + } while (0) + +#define FNMSUBxw(fd, fj, fk, fa) \ + do { \ + if (rex.w) { \ + FNMSUB_D(fd, fj, fk, fa); \ + } else { \ + FNMSUB_S(fd, fj, fk, fa); \ + } \ + } while (0) + + +#define VFCMPxy(width, vd, vj, vk, cond) \ + do { \ + if (vex.l) { \ + XVFCMP_##width(vd, vj, vk, cond); \ + } else { \ + VFCMP_##width(vd, vj, vk, cond); \ + } \ + } while (0) + +#define VFADDxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVFADD_##width(vd, vj, vk); \ + } else { \ + VFADD_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VFSUBxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVFSUB_##width(vd, vj, vk); \ + } else { \ + VFSUB_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VFMULxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVFMUL_##width(vd, vj, vk); \ + } else { \ + VFMUL_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VFDIVxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVFDIV_##width(vd, vj, vk); \ + } else { \ + VFDIV_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VFRECIPxy(width, vd, vj) \ + do { \ + if (vex.l) { \ + XVFRECIP_##width(vd, vj); \ + } else { \ + VFRECIP_##width(vd, vj); \ + } \ + } while (0) + +#define VFRECIPExy(width, vd, vj) \ + do { \ + if (vex.l) { \ + XVFRECIPE_##width(vd, vj); \ + } else { \ + VFRECIPE_##width(vd, vj); \ + } \ + } while (0) + +#define VFRSQRTxy(width, vd, vj) \ + do { \ + if (vex.l) { \ + XVFRSQRT_##width(vd, vj); \ + } else { \ + VFRSQRT_##width(vd, vj); \ + } \ + } while (0) + +#define VFRSQRTExy(width, vd, vj) \ + do { \ + if (vex.l) { \ + XVFRSQRTE_##width(vd, vj); \ + } else { \ + VFRSQRTE_##width(vd, vj); \ + } \ + } while (0) + +#define VFSQRTxy(width, vd, vj) \ + do { \ + if (vex.l) { \ + XVFSQRT_##width(vd, vj); \ + } else { \ + VFSQRT_##width(vd, vj); \ + } \ + } while (0) + +#define VFMAXxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVFMAX_##width(vd, vj, vk); \ + } else { \ + VFMAX_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VFMINxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVFMIN_##width(vd, vj, vk); \ + } else { \ + VFMIN_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VREPLVEIxy(width, vd, vj, imm) \ + do { \ + if (vex.l) { \ + if (imm > 0) { \ + ADDI_D(x5, xZR, imm); \ + XVREPLVE_##width(vd, vj, x5); \ + } else { \ + XVREPLVE_##width(vd, vj, xZR); \ + } \ + } else { \ + VREPLVEI_##width(vd, vj, imm); \ + } \ + } while (0) + +#define VSEQxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVSEQ_##width(vd, vj, vk); \ + } else { \ + VSEQ_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VSLTxy(width, vd, vj, vk) \ + do { \ + if (vex.l) { \ + XVSLT_##width(vd, vj, vk); \ + } else { \ + VSLT_##width(vd, vj, vk); \ + } \ + } while (0) + +#define VSETEQZ_Vxy(fcc, vd) \ + do { \ + if (vex.l) { \ + XVSETEQZ_V(fcc, vd); \ + } else { \ + VSETEQZ_V(fcc, vd); \ + } \ + } while (0) + +#define VSETNEZ_Vxy(fcc, vd) \ + do { \ + if (vex.l) { \ + XVSETNEZ_V(fcc, vd); \ + } else { \ + VSETNEZ_V(fcc, vd); \ + } \ + } while (0) + +#define VBITCLRIxy(width, vd, vj, imm) \ + do { \ + if (vex.l) { \ + XVBITCLRI_##width(vd, vj, imm); \ + } else { \ + VBITCLRI_##width(vd, vj, imm); \ + } \ + } while (0) + +#define VMSKLTZxy(width, vd, vj) \ + do { \ + if (vex.l) { \ + XVMSKLTZ_##width(vd, vj); \ + } else { \ + VMSKLTZ_##width(vd, vj); \ + } \ + } while (0) + +#endif //__LA64_EMITTER_H__ diff --git a/src/dynarec/la64/la64_epilog.S b/src/dynarec/la64/la64_epilog.S index 0b1feb7..30a0c69 100644 --- a/src/dynarec/la64/la64_epilog.S +++ b/src/dynarec/la64/la64_epilog.S @@ -1,3 +1,7 @@ +#define ASM_MAPPING 1 +#include "la64_mapping.h" +#undef ASM_MAPPING + //la64 epilog for dynarec //Save stuff, prepare stack and register //called with pointer to emu as 1st parameter @@ -11,36 +15,37 @@ la64_epilog: // update register -> emu - st.d $r12, $r4, (8 * 0) - st.d $r13, $r4, (8 * 1) - st.d $r14, $r4, (8 * 2) - st.d $r15, $r4, (8 * 3) - st.d $r16, $r4, (8 * 4) - st.d $r17, $r4, (8 * 5) - st.d $r18, $r4, (8 * 6) - st.d $r19, $r4, (8 * 7) - st.d $r23, $r4, (8 * 8) - st.d $r24, $r4, (8 * 9) - st.d $r25, $r4, (8 * 10) - st.d $r26, $r4, (8 * 11) - st.d $r27, $r4, (8 * 12) - st.d $r28, $r4, (8 * 13) - st.d $r29, $r4, (8 * 14) - st.d $r30, $r4, (8 * 15) + st.d RAX, Emu, (8 * 0) + st.d RCX, Emu, (8 * 1) + st.d RDX, Emu, (8 * 2) + st.d RBX, Emu, (8 * 3) + st.d RSP, Emu, (8 * 4) + st.d RBP, Emu, (8 * 5) + st.d RSI, Emu, (8 * 6) + st.d RDI, Emu, (8 * 7) + st.d R8, Emu, (8 * 8) + st.d R9, Emu, (8 * 9) + st.d R10, Emu, (8 * 10) + st.d R11, Emu, (8 * 11) + st.d R12, Emu, (8 * 12) + st.d R13, Emu, (8 * 13) + st.d R14, Emu, (8 * 14) + st.d R15, Emu, (8 * 15) // restore xFlags from LBT.eflags - la.global $r12, la64_lbt - ldptr.d $r12, $r12, 0 - beqz $r12, 1f - ori $r13, $r0, 0b100011010101 - andn $r31, $r31, $r13 - x86mfflag $r13, 0b111111 - or $r31, $r31, $r13 + la.global $r19, cpuext + ldptr.d $r19, $r19, 0 + andi $r19, $r19, 1 + beqz $r19, 1f + ori $r19, $r0, 0b100011010101 + andn Flags, Flags, $r19 + x86mfflag $r19, 0b111111 + or Flags, Flags, $r19 1: - st.d $r31, $r4, (8 * 16) // xFlags - st.d $r20, $r4, (8 * 17) // put back reg value in emu, including EIP (so $r20 must be EIP now) + st.d Flags, Emu, (8 * 16) // xFlags + st.d RIP, Emu, (8 * 17) // put back reg value in emu, including EIP (so $r29 must be EIP now) // fallback to epilog_fast now, just restoring saved regs la64_epilog_fast: - addi.d $sp, $r22, 0 // restore save sp from xSavedSP + addi.d $sp, SavedSP, 0 // restore save sp from xSavedSP // restore all used register ld.d $r1, $sp, (8 * 0) // load ra ld.d $r22, $sp, (8 * 1) // load fp @@ -61,6 +66,6 @@ la64_epilog_fast: fld.d $f29, $sp, (8 * 16) fld.d $f30, $sp, (8 * 17) fld.d $f31, $sp, (8 * 18) - addi.d $sp, $sp, (8 * 19) + addi.d $sp, $sp, (8 * 20) // end, return ret diff --git a/src/dynarec/la64/la64_lock.S b/src/dynarec/la64/la64_lock.S index 18736af..700688a 100644 --- a/src/dynarec/la64/la64_lock.S +++ b/src/dynarec/la64/la64_lock.S @@ -1,3 +1,7 @@ +#define ASM_MAPPING 1 +#include "la64_mapping.h" +#undef ASM_MAPPING + // LA64 lock helper // there is 2 part: read and write // write return 0 on success, 1 on fail (value has been changed) @@ -11,6 +15,7 @@ .global la64_lock_storeifnull .global la64_lock_storeifnull_d .global la64_lock_storeifref +.global la64_lock_storeifref2 .global la64_lock_storeifref_d .global la64_lock_storeifref2_d .global la64_lock_storeb @@ -26,6 +31,7 @@ .global la64_lock_get_b .global la64_lock_get_d .global la64_lock_get_dd +.global la64_crc la64_lock_xchg_b: .word 0x385e1486 // amswap_db.b $a2, $a1, $a0 @@ -113,6 +119,19 @@ la64_lock_storeifref2_d: move $a0, $a3 ret +la64_lock_storeifref2: + // address is a0, value is a1, a1 store to a0 only if [a0] is a2. return old [a0] value + dbar 0 +1: + move $a4, $a1 + ll.d $a3, $a0, 0 + bne $a2, $a3, 2f + sc.d $a4, $a0, 0 + beqz $a4, 1b +2: + move $a0, $a3 + ret + la64_lock_storeb: st.b $a1, $a0, 0 dbar 0 @@ -212,4 +231,26 @@ la64_lock_get_d: la64_lock_get_dd: dbar 0 ld.d $a0, $a0, 0 + ret + +la64_crc: + move $a2, $a0 + xor $a0, $a0, $a0 + li.d $a3, 8 +1: + bltu $a1, $a3, 2f + ld.d $a4, $a2, 0 + crc.w.d.w $a0, $a4, $a0 + addi.d $a2, $a2, 8 + addi.w $a1, $a1, -8 + bnez $a1, 1b +2: + beqz $a1, 4f +3: + ld.bu $a4, $a2, 0 + crc.w.b.w $a0, $a4, $a0 + addi.d $a2, $a2, 1 + addi.w $a1, $a1, -1 + bnez $a1, 3b +4: ret \ No newline at end of file diff --git a/src/dynarec/la64/la64_lock.h b/src/dynarec/la64/la64_lock.h index 80cd80b..531f06b 100644 --- a/src/dynarec/la64/la64_lock.h +++ b/src/dynarec/la64/la64_lock.h @@ -1,9 +1,9 @@ #ifndef __LA64_LOCK__H__ #define __LA64_LOCK__H__ #include +#include "hostext.h" -extern int la64_lamcas; -extern int la64_lam_bh; +extern cpu_ext_t cpuext; // Atomically store val at [p] if old [p] is ref. Return 0 if OK, 1 is not. p needs to be aligned extern int @@ -27,6 +27,9 @@ extern void* la64_lock_storeifnull(void* p, void* val); // Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old) extern void* la64_lock_storeifref(void* p, void* val, void* ref); +// Atomically store value to [p] only if [p] is ref. Return old [p] value (so ref or old) +extern void* la64_lock_storeifref2(void* p, void* val, void* ref); + // Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old) extern uint32_t la64_lock_storeifref_d(void* p, uint32_t val, uint32_t ref); diff --git a/src/dynarec/la64/la64_mapping.h b/src/dynarec/la64/la64_mapping.h new file mode 100644 index 0000000..423f8b0 --- /dev/null +++ b/src/dynarec/la64/la64_mapping.h @@ -0,0 +1,178 @@ +#ifndef __LA64_MAPPING_H__ +#define __LA64_MAPPING_H__ + +// LA64 Register Mapping Scheme +/***************************************************************************************** +name alias mapping native description Box64 description saver +****************************************************************************************** +r0 zero native zero Hard-wired zero N/A - +r1 ra native ra Return address N/A Caller +r2 tp - Thread pointer N/A - +r3 sp native sp Stack pointer N/A Callee +r4 a0 RDI Function argument/return val. - Caller +r5 a1 RSI Function argument/return val. - Caller +r6 a2 RDX Function argument - Caller +r7 a3 RCX Function argument - Caller +r8 a4 R8 Function argument - Caller +r9 a5 R9 Function argument - Caller +r10 a6 RBX Function argument - Caller +r11 a7 RSP Function argument - Caller +r12 t0 RAX Temporary - Caller +r13 t1 RBP Temporary - Caller +r14 t2 x1 Temporary Scratch Caller +r15 t3 x2 Temporary Scratch Caller +r16 t4 x3 Temporary Scratch Caller +r17 t5 x4 Temporary Scratch Caller +r18 t6 x5 Temporary Scratch Caller +r19 t7 x6 Temporary Scratch Caller +r20 t8 x7 Temporary Scratch Caller +r21 rx - Reserved X87 Precision Control - +r22 fp SavedSP Saved register/frame pointer - Callee +r23 s0 R10 Saved register - Callee +r24 s1 R11 Saved register - Callee +r25 s2 R12 Saved register - Callee +r26 s3 R13 Saved register - Callee +r27 s4 R14 Saved register - Callee +r28 s5 R15 Saved register - Callee +r29 s6 RIP Saved register - Callee +r30 s7 FLAGS Saved register - Callee +r31 s8 xEmu Saved register The Emu struct Callee +******************************************************************************************/ + +#ifndef ASM_MAPPING + +// x86 Register mapping +#define xRAX 12 +#define xRCX 7 +#define xRDX 6 +#define xRBX 10 +#define xRSP 11 +#define xRBP 13 +#define xRSI 5 +#define xRDI 4 +#define xR8 8 +#define xR9 9 +#define xR10 23 +#define xR11 24 +#define xR12 25 +#define xR13 26 +#define xR14 27 +#define xR15 28 +#define xFlags 30 +#define xRIP 29 +#define xSavedSP 22 + +// convert a x86 register to native according to the register mapping +#define TO_NAT(A) (((uint8_t[]) { 12, 7, 6, 10, 11, 13, 5, 4, 8, 9, 23, 24, 25, 26, 27, 28 })[(A)]) +#define IS_GPR(A) (((uint8_t[]) { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0 })[(A)]) + +// scratch registers +#define x1 14 +#define x2 15 +#define x3 16 +#define x4 17 +#define x5 18 +#define x6 19 +#define x7 20 + +#define x87pc 21 + +// emu is $r31 +#define xEmu 31 +// LA64 RA +#define xRA 1 +#define ra xRA +// LA64 SP +#define xSP 3 +// LA64 args +#define A0 4 +#define A1 5 +#define A2 6 +#define A3 7 +#define A4 8 +#define A5 9 +#define A6 10 +#define A7 11 +// xZR regs +#define xZR 0 +#define wZR xZR +#define r0 xZR + +#define fcc0 0 +#define fcc1 1 +#define fcc2 2 +#define fcc3 3 +#define fcc4 4 +#define fcc5 5 +#define fcc6 6 +#define fcc7 7 + +#define cAF 0x0 +#define cUN 0x8 +#define cEQ 0x4 +#define cUEQ 0xC +#define cLT 0x2 +#define cULT 0xA +#define cLE 0x6 +#define cULE 0xE +#define cNE 0x10 +#define cOR 0x14 +#define cUNE 0x18 +#define sAF 0x1 +#define sUN 0x9 +#define sEQ 0x5 +#define sUEQ 0xD +#define sLT 0x3 +#define sULT 0xB +#define sLE 0x7 +#define sULE 0xF +#define sNE 0x11 +#define sOR 0x15 +#define sUNE 0x19 + +#define FCSR0 0 +#define FCSR1 1 +#define FCSR2 2 +#define FCSR3 3 + +#define FR_V 28 +#define FR_Z 27 +#define FR_O 26 +#define FR_U 25 +#define FR_I 24 + +#else + +// x86 Register mapping +#define RAX $r12 +#define RCX $r7 +#define RDX $r6 +#define RBX $r10 +#define RSP $r11 +#define RBP $r13 +#define RSI $r5 +#define RDI $r4 +#define R8 $r8 +#define R9 $r9 +#define R10 $r23 +#define R11 $r24 +#define R12 $r25 +#define R13 $r26 +#define R14 $r27 +#define R15 $r28 +#define Flags $r30 +#define RIP $r29 +#define Emu $r31 +#define SavedSP $r22 + +#ifdef LA64_ABI_1 + +.macro ret + jr $ra +.endm + +#endif // LA64_ABI_1 + +#endif // ASM_MAPPING + +#endif //__LA64_MAPPING_H__ diff --git a/src/dynarec/la64/la64_next.S b/src/dynarec/la64/la64_next.S index f98558b..fd33ad0 100644 --- a/src/dynarec/la64/la64_next.S +++ b/src/dynarec/la64/la64_next.S @@ -1,3 +1,7 @@ +#define ASM_MAPPING 1 +#include "la64_mapping.h" +#undef ASM_MAPPING + //la64 update linker table for dynarec //called with pointer to emu as 1st parameter //and address of table to as 2nd parameter @@ -12,41 +16,41 @@ .8byte 0 // NULL pointer before la64_next, for getDB la64_next: - // emu is a0 - // IP address is a1 - addi.d $sp, $sp, -(8 * 12) - st.d $a0, $sp, 0 - st.d $a1, $sp, 8 - st.d $r11, $sp, 16 - st.d $r12, $sp, 24 - st.d $r13, $sp, 32 - st.d $r14, $sp, 40 - st.d $r15, $sp, 48 - st.d $r16, $sp, 56 - st.d $r17, $sp, 64 - st.d $r18, $sp, 72 - st.d $r19, $sp, 80 - st.d $r20, $sp, 88 // also save r20(rip) to allow change in LinkNext + // move emu to a0 + // move IP address to a1 + addi.d $sp, $sp, -(8 * 11) + st.d RDI, $sp, 0 + st.d RSI, $sp, 8 + st.d RDX, $sp, 16 + st.d RCX, $sp, 24 + st.d R8, $sp, 32 + st.d R9, $sp, 40 + st.d RAX, $sp, 48 + st.d RBX, $sp, 56 + st.d RSP, $sp, 64 + st.d RBP, $sp, 72 + st.d RIP, $sp, 80 // also save r29(rip) to allow change in LinkNext + move $a0, Emu + move $a1, RIP move $a2, $ra // "from" is in ra, so put in a2 - addi.d $a3, $sp, 88 // a3 is address to change rip + addi.d $a3, $sp, 80 // a3 is address to change rip // call the function bl LinkNext // preserve return value - move $a3, $a0 + move $r16, $a0 // pop regs - ld.d $a0, $sp, 0 - ld.d $a1, $sp, 8 - ld.d $r11, $sp, 16 - ld.d $r12, $sp, 24 - ld.d $r13, $sp, 32 - ld.d $r14, $sp, 40 - ld.d $r15, $sp, 48 - ld.d $r16, $sp, 56 - ld.d $r17, $sp, 64 - ld.d $r18, $sp, 72 - ld.d $r19, $sp, 80 - ld.d $r20, $sp, 88 - addi.d $sp, $sp, (8 * 12) + ld.d RDI, $sp, 0 + ld.d RSI, $sp, 8 + ld.d RDX, $sp, 16 + ld.d RCX, $sp, 24 + ld.d R8, $sp, 32 + ld.d R9, $sp, 40 + ld.d RAX, $sp, 48 + ld.d RBX, $sp, 56 + ld.d RSP, $sp, 64 + ld.d RBP, $sp, 72 + ld.d RIP, $sp, 80 + addi.d $sp, $sp, (8 * 11) // return offset is jump address - jr $a3 \ No newline at end of file + jr $r16 diff --git a/src/dynarec/la64/la64_printer.c b/src/dynarec/la64/la64_printer.c index ba9264f..9ca3d07 100644 --- a/src/dynarec/la64/la64_printer.c +++ b/src/dynarec/la64/la64_printer.c @@ -6,34 +6,42 @@ #include "la64_printer.h" #include "debug.h" -static const char* Xt[] = { "xZR", "r1", "r2", "sp", "xEmu", "x1_r5", "x2_r6", "x3_r7", "x4_r8", "x5_r9", "x6_r10", "xMASK_r11", "xRAX_r12", "xRCX_r13", "xRDX_r14", "xRBX_r15", "xRSP_r16", "xRBP_r17", "xRSI_r18", "xRDI_r19", "xRIP_r20", "r21", "r22", "xR8_r23", "xR9_r24", "xR10_r25", "xR11_r26", "xR12_r27", "xR13_r28", "xR14_r29", "xR15_r30", "xFlags_r31" }; +static const char* Xt[] = { "xZR", "r1", "r2", "sp", "xRDI", "xRSI", "xRDX", "xRCX", "xR8", "xR9", "xRBX", "xRSP", "xRAX", "xRBP", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "r21", "xSavedSP", "xR10", "xR11", "xR12", "xR13", "xR14", "xR15", "xRIP", "xFlags", "xEmu" }; static const char* Ft[] = { "fa0", "fa1", "fa2", "fa3", "fa4", "fa5", "fa6", "fa7", "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7", "ft8", "ft9", "ft10", "ft11", "ft12", "ft13", "ft14", "ft15", "fs0", "fs1", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7" }; static const char* Vt[] = { "vra0", "vra1", "vra2", "vra3", "vra4", "vra5", "vra6", "vra7", "vrt0", "vrt1", "vrt2", "vrt3", "vrt4", "vrt5", "vrt6", "vrt7", "vrt8", "vrt9", "vrt10", "vrt11", "vrt12", "vrt13", "vrt14", "vrt15", "vrs0", "vrs1", "vrs2", "vrs3", "vrs4", "vrs5", "vrs6", "vrs7" }; +static const char* XVt[] = { "xvra0", "xvra1", "xvra2", "xvra3", "xvra4", "xvra5", "xvra6", "xvra7", "xvrt0", "xvrt1", "xvrt2", "xvrt3", "xvrt4", "xvrt5", "xvrt6", "xvrt7", "xvrt8", "xvrt9", "xvrt10", "xvrt11", "xvrt12", "xvrt13", "xvrt14", "xvrt15", "xvrs0", "xvrs1", "xvrs2", "xvrs3", "xvrs4", "xvrs5", "xvrs6", "xvrs7" }; +static const char* FCCt[] = { "fcc0", "fcc1", "fcc2", "fcc3", "fcc4", "fcc5", "fcc6", "fcc7" }; +static const char* FCSRt[] = { "ALL", "Enables", "Cause_Flag", "RM" }; typedef struct la64_print_s { int d, j, k, a; - uint64_t i, u; + uint64_t i, u, c; } la64_print_t; -int isMask(uint32_t opcode, const char* mask, la64_print_t *a) +int isMask(uint32_t opcode, const char* mask, la64_print_t* a) { - if(strlen(mask)!=32) { + if (strlen(mask) != 32) { printf_log(LOG_NONE, "Error: printer mask \"%s\" in not len 32 but %ld\n", mask, strlen(mask)); return 0; } memset(a, 0, sizeof(*a)); int i = 31; - while(*mask) { - uint8_t v = (opcode>>i)&1; - switch(*mask) { - case '0': if(v!=0) return 0; break; - case '1': if(v!=1) return 0; break; - case 'd': a->d = (a->d<<1) | v; break; - case 'j': a->j = (a->j<<1) | v; break; - case 'k': a->k = (a->k<<1) | v; break; - case 'a': a->a = (a->a<<1) | v; break; - case 'i': a->i = (a->i<<1) | v; break; - case 'u': a->u = (a->u<<1) | v; break; + while (*mask) { + uint8_t v = (opcode >> i) & 1; + switch (*mask) { + case '0': + if (v != 0) return 0; + break; + case '1': + if (v != 1) return 0; + break; + case 'd': a->d = (a->d << 1) | v; break; + case 'j': a->j = (a->j << 1) | v; break; + case 'k': a->k = (a->k << 1) | v; break; + case 'a': a->a = (a->a << 1) | v; break; + case 'i': a->i = (a->i << 1) | v; break; + case 'u': a->u = (a->u << 1) | v; break; + case 'c': a->c = (a->c << 1) | v; break; default: printf_log(LOG_NONE, "Warning, printer mask use unhandled '%c'\n", *mask); } @@ -47,8 +55,8 @@ int isMask(uint32_t opcode, const char* mask, la64_print_t *a) int64_t signExtend(uint64_t val, int sz) { int64_t ret = val; - if((val>>(sz-1))&1) - ret |= (0xffffffffffffffffll<> (sz - 1)) & 1) + ret |= (0xffffffffffffffffll << sz); return ret; } @@ -56,13 +64,13 @@ const char* la64_print(uint32_t opcode, uintptr_t addr) { static char buff[200]; la64_print_t a; - #define Rd a.d - #define Rj a.j - #define Rk a.k - #define Ra a.a - #define imm a.i - #define imm_up a.u - +#define Rd a.d +#define Rj a.j +#define Rk a.k +#define Ra a.a +#define Rc a.c +#define imm a.i +#define imm_up a.u if (isMask(opcode, "00000000000100000kkkkkjjjjjddddd", &a)) { snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ADD.W", Xt[Rd], Xt[Rj], Xt[Rk]); return buff; @@ -92,15 +100,15 @@ const char* la64_print(uint32_t opcode, uintptr_t addr) return buff; } if (isMask(opcode, "000000000000010iikkkkkjjjjjddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %lu", "ALSL.W", Xt[Rd], Xt[Rj], Xt[Rk], imm); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %lu", "ALSL.W", Xt[Rd], Xt[Rj], Xt[Rk], imm + 1); return buff; } if (isMask(opcode, "000000000000011iikkkkkjjjjjddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %lu", "ALSL.WU", Xt[Rd], Xt[Rj], Xt[Rk], imm); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %lu", "ALSL.WU", Xt[Rd], Xt[Rj], Xt[Rk], imm + 1); return buff; } if (isMask(opcode, "000000000010110iikkkkkjjjjjddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %lu", "ALSL.D", Xt[Rd], Xt[Rj], Xt[Rk], imm); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %lu", "ALSL.D", Xt[Rd], Xt[Rj], Xt[Rk], imm + 1); return buff; } if (isMask(opcode, "0001010iiiiiiiiiiiiiiiiiiiiddddd", &a)) { @@ -163,6 +171,230 @@ const char* la64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "SC.D", Xt[Rd], Xt[Rj], signExtend(imm << 2, 16)); return buff; } + if (isMask(opcode, "0011100001010111100000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "LLACQ.W", Xt[Rd], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0011100001010111100001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "SCREL.W", Xt[Rd], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0011100001010111100010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "LLACQ.D", Xt[Rd], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0011100001010111100011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "SCREL.D", Xt[Rd], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010110000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMCAS.B", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010110001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMCAS.H", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010110010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMCAS.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010110011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMCAS.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010110100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMCAS_DB.B", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010110101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMCAS_DB.H", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010110110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMCAS_DB.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010110111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMCAS_DB.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010111000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMSWAP.B", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010111001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMSWAP.H", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010111010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMADD.B", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010111011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMADD.H", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010111100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMSWAP_DB.B", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010111101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMSWAP_DB.H", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010111110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMADD_DB.B", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000010111111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMADD_DB.H", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011000000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMSWAP.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011000001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMSWAP.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011000010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMADD.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011000011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMADD.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011000100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMAND.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011000101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMAND.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011000110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMOR.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011000111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMOR.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011001000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMXOR.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011001001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMXOR.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011001010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMAX.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011001011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMAX.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011001100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMIN.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011001101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMIN.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011001110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMAX.WU", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011001111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMAX.DU", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011010000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMIN.WU", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011010001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMIN.DU", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011010010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMSWAP_DB.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011010011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMSWAP_DB.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011010100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMADD_DB.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011010101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMADD_DB.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011010110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMAND_DB.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011010111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMAND_DB.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011011000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMOR_DB.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011011001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMOR_DB.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011011010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMXOR_DB.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011011011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMXOR_DB.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011011100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMAX_DB.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011011101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMAX_DB.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011011110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMIN_DB.W", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011011111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMIN_DB.D", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011100000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMAX_DB.WU", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011100001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMAX_DB.DU", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011100010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMIN_DB.WU", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } + if (isMask(opcode, "00111000011100011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AMMIN_DB.DU", Xt[Rd], Xt[Rk], Xt[Rj]); + return buff; + } if (isMask(opcode, "00111000011100100iiiiiiiiiiiiiii", &a)) { snprintf(buff, sizeof(buff), "%-15s %lu", "DBAR", imm); return buff; @@ -432,27 +664,27 @@ const char* la64_print(uint32_t opcode, uintptr_t addr) return buff; } if (isMask(opcode, "010110iiiiiiiiiiiiiiiijjjjjddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "BEQ", Xt[Rd], Xt[Rj], signExtend(imm << 2, 18)); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "BEQ", Xt[Rj], Xt[Rd], signExtend(imm << 2, 18)); return buff; } if (isMask(opcode, "010111iiiiiiiiiiiiiiiijjjjjddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "BNE", Xt[Rd], Xt[Rj], signExtend(imm << 2, 18)); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "BNE", Xt[Rj], Xt[Rd], signExtend(imm << 2, 18)); return buff; } if (isMask(opcode, "011000iiiiiiiiiiiiiiiijjjjjddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "BLT", Xt[Rd], Xt[Rj], signExtend(imm << 2, 18)); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "BLT", Xt[Rj], Xt[Rd], signExtend(imm << 2, 18)); return buff; } if (isMask(opcode, "011001iiiiiiiiiiiiiiiijjjjjddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "BGE", Xt[Rd], Xt[Rj], signExtend(imm << 2, 18)); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "BGE", Xt[Rj], Xt[Rd], signExtend(imm << 2, 18)); return buff; } if (isMask(opcode, "011010iiiiiiiiiiiiiiiijjjjjddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "BLTU", Xt[Rd], Xt[Rj], signExtend(imm << 2, 18)); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "BLTU", Xt[Rj], Xt[Rd], signExtend(imm << 2, 18)); return buff; } if (isMask(opcode, "011011iiiiiiiiiiiiiiiijjjjjddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "BGEU", Xt[Rd], Xt[Rj], signExtend(imm << 2, 18)); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "BGEU", Xt[Rj], Xt[Rd], signExtend(imm << 2, 18)); return buff; } if (isMask(opcode, "010000iiiiiiiiiiiiiiiijjjjjuuuuu", &a)) { @@ -563,6 +795,38 @@ const char* la64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "LDX.WU", Xt[Rd], Xt[Rj], Xt[Rk]); return buff; } + if (isMask(opcode, "00000000001001000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "CRC.W.B.W", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001001001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "CRC.W.H.W", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001001010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "CRC.W.W.W", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001001011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "CRC.W.D.W", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001001100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "CRCC.W.B.W", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001001101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "CRCC.W.H.W", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001001110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "CRCC.W.W.W", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001001111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "CRCC.W.D.W", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } if (isMask(opcode, "0010101110iiiiiiiiiiiijjjjjddddd", &a)) { snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "FLD.D", Ft[Rd], Xt[Rj], signExtend(imm, 12)); return buff; @@ -579,6 +843,54 @@ const char* la64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "FST.S", Ft[Rd], Xt[Rj], signExtend(imm, 12)); return buff; } + if (isMask(opcode, "00111000001100000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FLDX.S", Ft[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00111000001110000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSTX.S", Ft[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00111000011101000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FLDGT.S", Ft[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00111000011101010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FLDLE.S", Ft[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00111000011101100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSTGT.S", Ft[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00111000011101110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSTLE.S", Ft[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00111000001101000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FLDX.D", Ft[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00111000001111000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSTX.D", Ft[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00111000011101001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FLDGT.D", Ft[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00111000011101011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FLDLE.D", Ft[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00111000011101101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSTGT.D", Ft[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00111000011101111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSTLE.D", Ft[Rd], Xt[Rj], Xt[Rk]); + return buff; + } if (isMask(opcode, "00000001000000001kkkkkjjjjjddddd", &a)) { snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FADD.S", Ft[Rd], Ft[Rj], Ft[Rk]); return buff; @@ -659,6 +971,14 @@ const char* la64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCOPYSIGN.D", Ft[Rd], Ft[Rj], Ft[Rk]); return buff; } + if (isMask(opcode, "0000000100010100100101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FMOV.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100010100100110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FMOV.D", Ft[Rd], Ft[Rj]); + return buff; + } if (isMask(opcode, "0000000100010100101001jjjjjddddd", &a)) { snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVGR2FR.W", Ft[Rd], Xt[Rj]); return buff; @@ -683,6 +1003,98 @@ const char* la64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVFRH2GR.S", Xt[Rd], Ft[Rj]); return buff; } + if (isMask(opcode, "0000000100010100110000jjjjj000cc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVGR2FCSR", FCSRt[Rc], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0000000100010100110010000ccddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVFCSR2GR", Xt[Rd], FCSRt[Rc]); + return buff; + } + if (isMask(opcode, "0000000100010100110100jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVFR2CF", FCCt[Rc], Ft[Rj]); + return buff; + } + if (isMask(opcode, "000000010001010011010100cccddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVCF2FR", Ft[Rd], FCCt[Rc]); + return buff; + } + if (isMask(opcode, "0000000100010100110110jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVGR2CF", FCCt[Rc], Xt[Rj]); + return buff; + } + if (isMask(opcode, "000000010001010011011100cccddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVCF2GR", Xt[Rd], FCCt[Rc]); + return buff; + } + if (isMask(opcode, "0000000100011001001001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FCVT.D.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011001000110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FCVT.S.D", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011010000001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FTINTRM.W.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011010001001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FTINTRM.L.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011010010001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FTINTRP.W.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011010011001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FTINTRP.L.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011010100001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FTINTRZ.W.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011010101001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FTINTRZ.L.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011010110001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FTINTRNE.W.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011010111001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FTINTRNE.L.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011011000001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FTINT.W.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011011001001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FTINT.L.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011101000100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FFINT.S.W", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011101000110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FFINT.S.L", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100011110010001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FRINT.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "010010iiiiiiiiiiiiiiii00cccuuuuu", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %ld", "BCEQZ", FCCt[Rc], signExtend((imm + (imm_up << 16)) << 2, 23)); + return buff; + } + if (isMask(opcode, "010010iiiiiiiiiiiiiiii01cccuuuuu", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %ld", "BCNEZ", FCCt[Rc], signExtend((imm + (imm_up << 16)) << 2, 23)); + return buff; + } if (isMask(opcode, "01110000000010100kkkkkjjjjjddddd", &a)) { snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VADD.B", Vt[Rd], Vt[Rj], Vt[Rk]); return buff; @@ -2156,467 +2568,5514 @@ const char* la64_print(uint32_t opcode, uintptr_t addr) snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VEXTRINS.B", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0010110000iiiiiiiiiiiijjjjjddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "VLD", Vt[Rd], Xt[Rj], signExtend(imm, 12)); + if (isMask(opcode, "011100101110101110iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VINSGR2VR.B", Vt[Rd], Xt[Rj], imm); return buff; } - if (isMask(opcode, "0010110001iiiiiiiiiiiijjjjjddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "VST", Vt[Rd], Xt[Rj], signExtend(imm, 12)); + if (isMask(opcode, "0111001011101011110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VINSGR2VR.H", Vt[Rd], Xt[Rj], imm); return buff; } - if (isMask(opcode, "00000000000000001000000000101000", &a)) { - snprintf(buff, sizeof(buff), "X64CLRSM"); + if (isMask(opcode, "01110010111010111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VINSGR2VR.W", Vt[Rd], Xt[Rj], imm); return buff; } - if (isMask(opcode, "00000000000000001000000000001000", &a)) { - snprintf(buff, sizeof(buff), "X64SETSM"); + if (isMask(opcode, "011100101110101111110ijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VINSGR2VR.D", Vt[Rd], Xt[Rj], imm); return buff; } - if (isMask(opcode, "00000000000000001000000000001001", &a)) { - snprintf(buff, sizeof(buff), "X64INCTOP"); + if (isMask(opcode, "011100101110111110iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.B", Xt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "00000000000000001000000000101001", &a)) { - snprintf(buff, sizeof(buff), "X64DECTOP"); + if (isMask(opcode, "0111001011101111110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.H", Xt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "000000000000000001110000iii00000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %lu", "X64SETTOP", imm); + if (isMask(opcode, "01110010111011111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.W", Xt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "000000000000000001110100000ddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s", "X64GETTOP", Xt[Rd]); + if (isMask(opcode, "011100101110111111110ijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.D", Xt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "00000000010111iiiiiiii00000ddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, 0x%lx", "X64GETEFLAGS", Xt[Rd], imm); + if (isMask(opcode, "011100101111001110iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.BU", Xt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "00000000010111iiiiiiii00001ddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, 0x%lx", "X64SETEFLAGS", Xt[Rd], imm); + if (isMask(opcode, "0111001011110011110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.HU", Xt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "000000000011011010iiii00000ddddd", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, 0x%lx", "X64SETJ", Xt[Rd], imm); + if (isMask(opcode, "01110010111100111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.WU", Xt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0000000000000000100000jjjjj00000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s", "X64INC.B", Xt[Rj]); + if (isMask(opcode, "011100101111001111110ijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.DU", Xt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0000000000000000100000jjjjj00001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s", "X64INC.H", Xt[Rj]); + if (isMask(opcode, "011100101111011110iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VREPLVEI.B", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0000000000000000100000jjjjj00010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s", "X64INC.W", Xt[Rj]); + if (isMask(opcode, "0111001011110111110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VREPLVEI.H", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0000000000000000100000jjjjj00011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s", "X64INC.D", Xt[Rj]); + if (isMask(opcode, "01110010111101111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VREPLVEI.W", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0000000000000000100000jjjjj00100", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s", "X64DEC.B", Xt[Rj]); + if (isMask(opcode, "011100101111011111110ijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VREPLVEI.D", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0000000000000000100000jjjjj00101", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s", "X64DEC.H", Xt[Rj]); + if (isMask(opcode, "0111001100001000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLWIL.H.B", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0000000000000000100000jjjjj00110", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s", "X64DEC.W", Xt[Rj]); + if (isMask(opcode, "011100110000100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLWIL.W.H", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0000000000000000100000jjjjj00111", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s", "X64DEC.D", Xt[Rj]); + if (isMask(opcode, "01110011000010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLWIL.D.W", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111101kkkkkjjjjj00000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "0111001100001001000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXTL.Q.D", Vt[Rd], Vt[Rj]); return buff; } - if (isMask(opcode, "00000000001111101kkkkkjjjjj00001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "0111001100001100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLWIL.HU.BU", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111101kkkkkjjjjj00010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "011100110000110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLWIL.WU.HU", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111101kkkkkjjjjj00011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110011000011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLWIL.DU.WU", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111101kkkkkjjjjj00100", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.BU", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "0111001100001101000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXTL.QU.DU", Vt[Rd], Vt[Rj]); return buff; } - if (isMask(opcode, "00000000001111101kkkkkjjjjj00101", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.HU", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "0111001100010000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITCLRI.B", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111101kkkkkjjjjj00110", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.WU", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "011100110001000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITCLRI.H", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111101kkkkkjjjjj00111", &a)) { + if (isMask(opcode, "01110011000100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITCLRI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100010001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITCLRI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100010100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITSETI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110001010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITSETI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011000101001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITSETI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100010101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITSETI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100011000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITREVI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110001100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITREVI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011000110001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITREVI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100011001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITREVI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100100100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110010010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011001001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100100101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100101000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.BU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110010100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.HU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011001010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.WU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100101001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.DU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100101100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110010110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011001011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100101101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100110000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110011000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011001100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100110001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100110100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRAI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110011010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRAI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011001101001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRAI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100110101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRAI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLNI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010000001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLNI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101000001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLNI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100001iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLNI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101001001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100101iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLRNI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLRNI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101000101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLRNI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100011iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLRNI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.BU.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.HU.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101001101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.WU.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100111iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.DU.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101010001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101001iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.BU.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010101001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.HU.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101010101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.WU.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101011iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.DU.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRANI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010110001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRANI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101011001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRANI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101101iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRANI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRARNI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010111001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRARNI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101011101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRARNI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101111iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRARNI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011011000001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101100001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110001iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.BU.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011011001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.HU.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101100101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.WU.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110011iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.DU.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011011010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101101001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110101iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.BU.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011011011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.HU.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101101101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.WU.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110111iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.DU.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011111001iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPERMI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0010110000iiiiiiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "VLD", Vt[Rd], Xt[Rj], signExtend(imm, 12)); + return buff; + } + if (isMask(opcode, "0010110001iiiiiiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "VST", Vt[Rd], Xt[Rj], signExtend(imm, 12)); + return buff; + } + if (isMask(opcode, "00111000010000000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VLDX", Vt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00111000010001000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VSTX", Vt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "000011010001aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VBITSEL.V", Vt[Rd], Vt[Rj], Vt[Rk], Vt[Ra]); + return buff; + } + if (isMask(opcode, "0111001010011101001101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRINT.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101001110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRINT.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101010001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRINTRM.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101010010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRINTRM.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101010101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRINTRP.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101010110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRINTRP.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101011001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRINTRZ.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101011010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRINTRZ.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101011101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRINTRNE.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101011110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRINTRNE.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101111010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFCVTL.S.H", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101111011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFCVTH.S.H", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101111100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFCVTL.D.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101111101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFCVTH.D.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFFINT.S.W", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110000001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFFINT.S.WU", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110000010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFFINT.D.L", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110000011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFFINT.D.LU", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110000100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFFINTL.D.W", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110000101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFFINTH.D.W", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110001100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINT.W.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110001101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINT.L.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110001110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRM.W.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110001111jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRM.L.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110010000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRP.W.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110010001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRP.L.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110010010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRZ.W.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110010011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRZ.L.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110010100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRNE.W.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110010101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRNE.L.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110010110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINT.WU.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110010111jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINT.LU.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110011100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRZ.WU.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110011101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRZ.LU.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110100000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTL.L.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110100001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTH.L.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110100010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRML.L.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110100011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRMH.L.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110100100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRPL.L.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110100101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRPH.L.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110100110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRZL.L.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110100111jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRZH.L.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110101000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRNEL.L.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110101001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFTINTRNEH.L.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110111000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXTH.H.B", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110111001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXTH.W.H", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110111010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXTH.D.W", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110111011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXTH.Q.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110111100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXTH.HU.BU", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110111101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXTH.WU.HU", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110111110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXTH.DU.WU", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011110111111jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXTH.QU.DU", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011111000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VREPLGR2VR.B", Vt[Rd], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011111000001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VREPLGR2VR.H", Vt[Rd], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011111000010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VREPLGR2VR.W", Vt[Rd], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011111000011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VREPLGR2VR.D", Vt[Rd], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010100000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VROTRI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100101010000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VROTRI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010101000001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VROTRI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001010100001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VROTRI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001010100100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLRI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100101010010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLRI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010101001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLRI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001010100101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLRI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001010101000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRARI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100101010100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRARI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010101010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRARI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001010101001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRARI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100101110101110iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VINSGR2VR.B", Vt[Rd], Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001011101011110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VINSGR2VR.H", Vt[Rd], Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010111010111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VINSGR2VR.W", Vt[Rd], Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100101110101111110ijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VINSGR2VR.D", Vt[Rd], Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100101110111110iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.B", Xt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001011101111110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.H", Xt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010111011111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.W", Xt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100101110111111110ijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.D", Xt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100101111001110iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.BU", Xt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001011110011110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.HU", Xt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010111100111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.WU", Xt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100101111001111110ijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPICKVE2GR.DU", Xt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100101111011110iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VREPLVEI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001011110111110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VREPLVEI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010111101111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VREPLVEI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100101111011111110ijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VREPLVEI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100001000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLWIL.H.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110000100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLWIL.W.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011000010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLWIL.D.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100001001000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXTL.Q.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001100001100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLWIL.HU.BU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110000110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLWIL.WU.HU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011000011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLWIL.DU.WU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100001101000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXTL.QU.DU", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001100010000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITCLRI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110001000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITCLRI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011000100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITCLRI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100010001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITCLRI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100010100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITSETI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110001010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITSETI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011000101001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITSETI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100010101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITSETI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100011000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITREVI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110001100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITREVI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011000110001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITREVI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100011001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITREVI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100100100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110010010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011001001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100100101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100101000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.BU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110010100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.HU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011001010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.WU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100101001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSAT.DU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100101100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110010110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011001011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100101101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSLLI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100110000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110011000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011001100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100110001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100110100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRAI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110011010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRAI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011001101001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRAI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100110101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRAI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLNI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010000001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLNI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101000001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLNI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100001iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLNI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101001001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100101iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLRNI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLRNI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101000101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLRNI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100011iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRLRNI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.BU.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.HU.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101001101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.WU.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110100111iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLNI.DU.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101010001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101001iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.BU.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010101001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.HU.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101010101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.WU.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101011iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRLRNI.DU.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRANI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010110001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRANI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101011001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRANI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101101iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRANI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRARNI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011010111001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRARNI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101011101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRARNI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110101111iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSRARNI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011011000001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101100001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110001iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.BU.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011011001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.HU.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101100101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.WU.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110011iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRANI.DU.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.B.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011011010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.H.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101101001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.W.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110101iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.D.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.BU.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011011011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.HU.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001101101101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.WU.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110110111iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VSSRARNI.DU.Q", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011111001iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VPERMI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "00001100010100000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CAF.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SAF.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CLT.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SLT.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CEQ.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SEQ.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CLE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SLE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CUN.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SUN.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CULT.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SULT.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CUEQ.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SUEQ.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CULE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SULE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010110000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CNE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010110001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SNE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010110100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.COR.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010110101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SOR.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010111000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CUNE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010111001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SUNE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "0010110010iiiiiiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "XVLD", XVt[Rd], Xt[Rj], signExtend(imm, 12)); + return buff; + } + if (isMask(opcode, "0010110011iiiiiiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %ld", "XVST", XVt[Rd], Xt[Rj], signExtend(imm, 12)); + return buff; + } + if (isMask(opcode, "00000000000000001000000000101000", &a)) { + snprintf(buff, sizeof(buff), "X64CLRSM"); + return buff; + } + if (isMask(opcode, "00000000000000001000000000001000", &a)) { + snprintf(buff, sizeof(buff), "X64SETSM"); + return buff; + } + if (isMask(opcode, "00000000000000001000000000001001", &a)) { + snprintf(buff, sizeof(buff), "X64INCTOP"); + return buff; + } + if (isMask(opcode, "00000000000000001000000000101001", &a)) { + snprintf(buff, sizeof(buff), "X64DECTOP"); + return buff; + } + if (isMask(opcode, "000000000000000001110000iii00000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %lu", "X64SETTOP", imm); + return buff; + } + if (isMask(opcode, "000000000000000001110100000ddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s", "X64GETTOP", Xt[Rd]); + return buff; + } + if (isMask(opcode, "00000000010111iiiiiiii00000ddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, 0x%lx", "X64GETEFLAGS", Xt[Rd], imm); + return buff; + } + if (isMask(opcode, "00000000010111iiiiiiii00001ddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, 0x%lx", "X64SETEFLAGS", Xt[Rd], imm); + return buff; + } + if (isMask(opcode, "000000000011011010iiii00000ddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, 0x%lx", "X64SETJ", Xt[Rd], imm); + return buff; + } + if (isMask(opcode, "0000000000000000100000jjjjj00000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s", "X64INC.B", Xt[Rj]); + return buff; + } + if (isMask(opcode, "0000000000000000100000jjjjj00001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s", "X64INC.H", Xt[Rj]); + return buff; + } + if (isMask(opcode, "0000000000000000100000jjjjj00010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s", "X64INC.W", Xt[Rj]); + return buff; + } + if (isMask(opcode, "0000000000000000100000jjjjj00011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s", "X64INC.D", Xt[Rj]); + return buff; + } + if (isMask(opcode, "0000000000000000100000jjjjj00100", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s", "X64DEC.B", Xt[Rj]); + return buff; + } + if (isMask(opcode, "0000000000000000100000jjjjj00101", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s", "X64DEC.H", Xt[Rj]); + return buff; + } + if (isMask(opcode, "0000000000000000100000jjjjj00110", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s", "X64DEC.W", Xt[Rj]); + return buff; + } + if (isMask(opcode, "0000000000000000100000jjjjj00111", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s", "X64DEC.D", Xt[Rj]); + return buff; + } + if (isMask(opcode, "00000000001111101kkkkkjjjjj00000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111101kkkkkjjjjj00001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111101kkkkkjjjjj00010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111101kkkkkjjjjj00011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111101kkkkkjjjjj00100", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.BU", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111101kkkkkjjjjj00101", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.HU", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111101kkkkkjjjjj00110", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.WU", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111101kkkkkjjjjj00111", &a)) { snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64MUL.DU", Xt[Rj], Xt[Rk]); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj00000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADD.WU", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "00000000001111110kkkkkjjjjj00000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADD.WU", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj00001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADD.DU", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj00010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SUB.WU", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj00011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SUB.DU", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj00100", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADD.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj00101", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADD.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj00110", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADD.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj00111", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADD.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj01000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SUB.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj01001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SUB.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj01010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SUB.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj01011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SUB.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj01100", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADC.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj01101", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADC.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj01110", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADC.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj01111", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADC.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj10000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SBC.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj10001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SBC.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj10010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SBC.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj10011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SBC.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj10100", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SLL.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj10101", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SLL.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj10110", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SLL.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj10111", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SLL.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj11000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRL.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj11001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRL.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj11010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRL.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj11011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRL.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj11100", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRA.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj11101", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRA.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj11110", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRA.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111110kkkkkjjjjj11111", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRA.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj00000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTR.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj00001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTR.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj00010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTR.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj00011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTR.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj00100", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTL.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj00101", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTL.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj00110", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTL.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj00111", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTL.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj01000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCR.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj01001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCR.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj01010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCR.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj01011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCR.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj01100", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCL.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj01101", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCL.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj01110", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCL.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj01111", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCL.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj10000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64AND.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj10001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64AND.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj10010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64AND.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj10011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64AND.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj10100", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64OR.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj10101", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64OR.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj10110", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64OR.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj10111", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64OR.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj11000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64XOR.B", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj11001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64XOR.H", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj11010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64XOR.W", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001111111kkkkkjjjjj11011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64XOR.D", Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "0000000001010100001iiijjjjj00000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SLLI.B", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010100001iiijjjjj00100", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRLI.B", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010100001iiijjjjj01000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRAI.B", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010100001iiijjjjj01100", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTRI.B", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010100001iiijjjjj10000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCRI.B", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010100001iiijjjjj10100", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTLI.B", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010100001iiijjjjj11000", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCLI.B", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "000000000101010001iiiijjjjj00001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SLLI.H", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "000000000101010001iiiijjjjj00101", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRLI.H", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "000000000101010001iiiijjjjj01001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRAI.H", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "000000000101010001iiiijjjjj01101", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTRI.H", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "000000000101010001iiiijjjjj10001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCRI.H", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "000000000101010001iiiijjjjj10101", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTLI.H", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "000000000101010001iiiijjjjj11001", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCLI.H", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "00000000010101001iiiiijjjjj00010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SLLI.W", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "00000000010101001iiiiijjjjj00110", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRLI.W", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "00000000010101001iiiiijjjjj01010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRAI.W", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "00000000010101001iiiiijjjjj01110", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTRI.W", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "00000000010101001iiiiijjjjj10010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCRI.W", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "00000000010101001iiiiijjjjj10110", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTLI.W", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "00000000010101001iiiiijjjjj11010", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCLI.W", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010101iiiiiijjjjj00011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SLLI.D", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010101iiiiiijjjjj00111", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRLI.D", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010101iiiiiijjjjj01011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRAI.D", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010101iiiiiijjjjj01111", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTRI.D", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010101iiiiiijjjjj10011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCRI.D", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010101iiiiiijjjjj10111", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTLI.D", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010101iiiiiijjjjj11011", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCLI.D", Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "00000000001100000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ADC.B", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001100001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ADC.H", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001100010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ADC.W", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001100011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ADC.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001100100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SBC.B", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001100101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SBC.H", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001100110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SBC.W", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001100111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SBC.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000000110100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ROTR.B", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000000110101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ROTR.H", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "0000000001001100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "ROTRI.B", Xt[Rd], Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "000000000100110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "ROTRI.H", Xt[Rd], Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "00000000001101000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "RCR.B", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001101001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "RCR.H", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001101010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "RCR.W", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00000000001101011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "RCR.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "0000000001010000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "RCRI.B", Xt[Rd], Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "000000000101000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "RCRI.H", Xt[Rd], Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "00000000010100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "RCRI.W", Xt[Rd], Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000001010001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "RCRI.D", Xt[Rd], Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0000000100010100111000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FCVT.LD.D", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100010100111001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FCVT.UD.D", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "00000001000101010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s,", "FCVT.D.LD", Ft[Rd], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "0000000100010100110000jjjjj000cc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVGR2FCSR", FCSRt[Rc], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0000000100010100110010000ccddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVFCSR2GR", Xt[Rd], FCSRt[Rc]); + return buff; + } + if (isMask(opcode, "0000000100010100110100jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVFR2CF", FCCt[Rc], Ft[Rj]); + return buff; + } + if (isMask(opcode, "000000010001010011010100cccddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVCF2FR", Ft[Rd], FCCt[Rc]); + return buff; + } + if (isMask(opcode, "0000000100010100110110jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVGR2CF", FCCt[Rc], Xt[Rj]); + return buff; + } + if (isMask(opcode, "000000010001010011011100cccddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MOVCF2GR", Xt[Rd], FCCt[Rc]); + return buff; + } + if (isMask(opcode, "010010iiiiiiiiiiiiiiii00cccuuuuu", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %ld", "BCEQZ", FCCt[Rc], signExtend((imm + (imm_up << 16)) << 2, 23)); + return buff; + } + if (isMask(opcode, "010010iiiiiiiiiiiiiiii01cccuuuuu", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %ld", "BCNEZ", FCCt[Rc], signExtend((imm + (imm_up << 16)) << 2, 23)); + return buff; + } + if (isMask(opcode, "00001100000100000kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CAF.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000100001kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SAF.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000100010kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CLT.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000100011kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SLT.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000100011kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SGT.S", FCCt[Rc], Ft[Rk], Ft[Rj]); + return buff; + } + if (isMask(opcode, "00001100000100100kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CEQ.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000100101kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SEQ.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000100110kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CLE.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000100111kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SLE.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000100111kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SGE.S", FCCt[Rc], Ft[Rk], Ft[Rj]); + return buff; + } + if (isMask(opcode, "00001100000101000kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CUN.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000101001kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SUN.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000101010kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CULT.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000101010kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CUGT.S", FCCt[Rc], Ft[Rk], Ft[Rj]); + return buff; + } + if (isMask(opcode, "00001100000101011kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SULT.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000101100kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CUEQ.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000101101kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SUEQ.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000101110kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CULE.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000101110kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CUGE.S", FCCt[Rc], Ft[Rk], Ft[Rj]); + return buff; + } + if (isMask(opcode, "00001100000101111kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SULE.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000110000kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CNE.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000110001kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SNE.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000110100kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.COR.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000110101kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SOR.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000111000kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CUNE.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100000111001kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SUNE.S", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001000000kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CAF.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001000001kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SAF.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001000010kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CLT.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001000011kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SLT.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001000011kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SGT.D", FCCt[Rc], Ft[Rk], Ft[Rj]); + return buff; + } + if (isMask(opcode, "00001100001000100kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CEQ.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001000101kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SEQ.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001000110kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CLE.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001000111kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SLE.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001000111kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SGE.D", FCCt[Rc], Ft[Rk], Ft[Rj]); + return buff; + } + if (isMask(opcode, "00001100001001000kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CUN.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001001001kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SUN.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001001010kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CULT.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001001010kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CUGT.D", FCCt[Rc], Ft[Rk], Ft[Rj]); + return buff; + } + if (isMask(opcode, "00001100001001011kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SULT.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001001100kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CUEQ.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001001101kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SUEQ.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001001110kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CULE.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001001110kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CUGE.D", FCCt[Rc], Ft[Rk], Ft[Rj]); + return buff; + } + if (isMask(opcode, "00001100001001111kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SULE.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001010000kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CNE.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001010001kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SNE.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001010100kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.COR.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001010101kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SOR.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001011000kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.CUNE.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100001011001kkkkkjjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCMP.SUNE.D", FCCt[Rc], Ft[Rj], Ft[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CAF.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SAF.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CLT.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SLT.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CEQ.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SEQ.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CLE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010100111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SLE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CUN.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SUN.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CULT.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SULT.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CUEQ.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SUEQ.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CULE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010101111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SULE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010110000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CNE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010110001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SNE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010110100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.COR.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010110101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SOR.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010111000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CUNE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100010111001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SUNE.S", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100100000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CAF.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100100001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SAF.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100100010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CLT.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100100011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SLT.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100100100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CEQ.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100100101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SEQ.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100100110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CLE.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100100111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SLE.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100101000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CUN.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100101001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SUN.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100101010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CULT.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100101011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SULT.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100101100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CUEQ.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100101101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SUEQ.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100101110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CULE.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100101111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SULE.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100110000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CNE.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100110001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SNE.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100110100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.COR.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100110101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SOR.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100111000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CUNE.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100100111001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SUNE.S", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011000000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CAF.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011000001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SAF.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011000010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CLT.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011000011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SLT.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011000100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CEQ.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011000101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SEQ.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011000110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CLE.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011000111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SLE.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011001000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CUN.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011001001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SUN.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011001010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CULT.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011001011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SULT.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011001100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CUEQ.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011001101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SUEQ.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011001110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CULE.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011001111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SULE.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011010000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CNE.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011010001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SNE.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011010100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.COR.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011010101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SOR.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011011000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.CUNE.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100011011001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCMP.SUNE.D", Vt[Rd], Vt[Rj], Vt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101000000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CAF.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101000001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SAF.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101000010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CLT.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101000011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SLT.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101000100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CEQ.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101000101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SEQ.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101000110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CLE.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101000111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SLE.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101001000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CUN.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101001001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SUN.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101001010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CULT.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101001011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SULT.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101001100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CUEQ.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101001101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SUEQ.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101001110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CULE.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101001111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SULE.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101010000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CNE.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101010001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SNE.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101010100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.COR.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101010101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SOR.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101011000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.CUNE.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "00001100101011001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCMP.SUNE.D", Xt[Rd], Xt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000000000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSEQ.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000000001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSEQ.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000000010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSEQ.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000000011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSEQ.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000000100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLE.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000000101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLE.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000000110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLE.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000000111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLE.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000001000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLE.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000001001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLE.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000001010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLE.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000001011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLE.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000001100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLT.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000001101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLT.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000001110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLT.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000001111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLT.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000010000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLT.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000010001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLT.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000010010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLT.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000010011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLT.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000010100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADD.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000010101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADD.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000010110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADD.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000010111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADD.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000011000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUB.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000011001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUB.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000011010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUB.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000011011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUB.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010001100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSADD.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010001101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSADD.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010001110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSADD.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010001111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSADD.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010010000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSUB.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010010001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSUB.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010010010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSUB.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010010011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSUB.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010010100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSADD.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010010101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSADD.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010010110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSADD.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010010111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSADD.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010011000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSUB.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010011001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSUB.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010011010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSUB.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010011011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSUB.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010101000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHADDW.H.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010101001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHADDW.W.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010101010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHADDW.D.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010101011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHADDW.Q.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010101100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHSUBW.H.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010101101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHSUBW.W.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010101110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHSUBW.D.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010101111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHSUBW.Q.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010110000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHADDW.HU.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010110001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHADDW.WU.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010110010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHADDW.DU.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010110011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHADDW.QU.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010110100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHSUBW.HU.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010110101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHSUBW.WU.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010110110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHSUBW.DU.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010110111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVHSUBW.QU.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000111100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWEV.H.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000111101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWEV.W.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000111110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWEV.D.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100000111111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWEV.Q.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001011100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWEV.H.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001011101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWEV.W.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001011110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWEV.D.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001011111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWEV.Q.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001111100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWEV.H.BU.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001111101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWEV.W.HU.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001111110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWEV.D.WU.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001111111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWEV.Q.DU.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001000100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWOD.H.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001000101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWOD.W.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001000110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWOD.D.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001000111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWOD.Q.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001100100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWOD.H.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001100101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWOD.W.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001100110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWOD.D.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001100111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWOD.Q.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010000000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWOD.H.BU.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010000001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWOD.W.HU.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010000010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWOD.D.WU.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010000011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDWOD.Q.DU.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101011000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWEV.H.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101011001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWEV.W.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101011010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWEV.D.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101011011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWEV.Q.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101111000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWEV.H.BU.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101111001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWEV.W.HU.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101111010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWEV.D.WU.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101111011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWEV.Q.DU.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101101000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWEV.H.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101101001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWEV.W.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101101010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWEV.D.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101101011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWEV.Q.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101011100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWOD.H.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101011101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWOD.W.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101011110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWOD.D.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101011111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWOD.Q.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101101100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWOD.H.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101101101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWOD.W.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101101110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWOD.D.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101101111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWOD.Q.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101111100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWOD.H.BU.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101111101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWOD.W.HU.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101111110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWOD.D.WU.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101111111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADDWOD.Q.DU.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100100000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWEV.H.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100100001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWEV.W.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100100010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWEV.D.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100100011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWEV.Q.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100110000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWEV.H.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100110001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWEV.W.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100110010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWEV.D.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100110011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWEV.Q.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101000000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWEV.H.BU.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101000001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWEV.W.HU.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101000010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWEV.D.WU.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101000011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWEV.Q.DU.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100100100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWOD.H.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100100101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWOD.W.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100100110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWOD.D.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100100111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWOD.Q.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100110100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWOD.H.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100110101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWOD.W.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100110110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWOD.D.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100110111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWOD.Q.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101000100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWOD.H.BU.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101000101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWOD.W.HU.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101000110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWOD.D.WU.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101000111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMULWOD.Q.DU.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001000000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWEV.H.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001000001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWEV.W.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001000010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWEV.D.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001000011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWEV.Q.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001100000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWEV.H.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001100001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWEV.W.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001100010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWEV.D.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001100011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWEV.Q.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001001000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWOD.H.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001001001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWOD.W.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001001010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWOD.D.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001001011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWOD.Q.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001101000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWOD.H.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001101001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWOD.W.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001101010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWOD.D.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100001101011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUBWOD.Q.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010111000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDA.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010111001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDA.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010111010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDA.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100010111011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADDA.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011000000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVABSD.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011000001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVABSD.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011000010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVABSD.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011000011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVABSD.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011000100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVABSD.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011000101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVABSD.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011000110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVABSD.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011000111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVABSD.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011001000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVG.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011001001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVG.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011001010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVG.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011001011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVG.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011001100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVG.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011001101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVG.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011001110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVG.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011001111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVG.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011010000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVGR.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011010001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVGR.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011010010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVGR.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011010011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVGR.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011010100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVGR.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011010101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVGR.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011010110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVGR.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011010111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAVGR.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011100000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMAX.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011100001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMAX.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011100010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMAX.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011100011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMAX.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011100100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMIN.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011100101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMIN.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011100110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMIN.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011100111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMIN.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011101000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMAX.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011101001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMAX.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011101010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMAX.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011101011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMAX.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011101100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMIN.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011101101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMIN.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011101110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMIN.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100011101111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMIN.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100001000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMUL.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100001001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMUL.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100001010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMUL.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100001011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMUL.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100001100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMUH.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100001101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMUH.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100001110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMUH.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100001111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMUH.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100010000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMUH.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100010001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMUH.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100010010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMUH.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100100010011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMUH.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101010000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADD.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101010001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADD.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101010010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADD.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101010011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMADD.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101010100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMSUB.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101010101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMSUB.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101010110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMSUB.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100101010111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMSUB.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111000000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVDIV.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111000001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVDIV.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111000010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVDIV.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111000011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVDIV.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111000100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMOD.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111000101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMOD.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111000110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMOD.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111000111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMOD.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111001000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVDIV.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111001001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVDIV.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111001010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVDIV.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111001011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVDIV.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111001100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMOD.BU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111001101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMOD.HU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111001110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMOD.WU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111001111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVMOD.DU", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111010000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLL.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111010001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLL.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111010010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLL.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111010011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSLL.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111010100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRL.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111010101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRL.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111010110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRL.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111010111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRL.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111011000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRA.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111011001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRA.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111011010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRA.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111011011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRA.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111011100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVROTR.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111011101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVROTR.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111011110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVROTR.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111011111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVROTR.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111100000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRLR.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111100001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRLR.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111100010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRLR.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111100011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRLR.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111100100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRAR.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111100101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRAR.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111100110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRAR.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111100111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRAR.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111101001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRLN.B.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111101010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRLN.H.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111101011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRLN.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111101101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRAN.B.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111101110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRAN.H.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111101111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRAN.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111110001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRLRN.B.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111110010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRLRN.H.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111110011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRLRN.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111110101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRARN.B.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111110110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRARN.H.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111110111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSRARN.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111111001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRLN.B.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111111010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRLN.H.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111111011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRLN.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111111101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRAN.B.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111111110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRAN.H.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110100111111111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRAN.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000000001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRLRN.B.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000000010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRLRN.H.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000000011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRLRN.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000000101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRARN.B.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000000110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRARN.H.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000000111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRARN.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000001001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRLN.BU.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000001010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRLN.HU.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000001011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRLN.WU.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000001101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRAN.BU.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000001110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRAN.HU.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000001111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRAN.WU.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000010001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRLRN.BU.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000010010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRLRN.HU.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000010011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRLRN.WU.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000010101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRARN.BU.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000010110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRARN.HU.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000010111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSSRARN.WU.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000011000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVBITCLR.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000011001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVBITCLR.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000011010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVBITCLR.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000011011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVBITCLR.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000011100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVBITSET.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000011101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVBITSET.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000011110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVBITSET.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000011111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVBITSET.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000100000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVBITREV.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000100001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVBITREV.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000100010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVBITREV.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000100011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVBITREV.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000101100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPACKEV.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000101101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPACKEV.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000101110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPACKEV.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000101111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPACKEV.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000110000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPACKOD.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000110001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPACKOD.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000110010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPACKOD.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000110011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPACKOD.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000110100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVILVL.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000110101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVILVL.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000110110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVILVL.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000110111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVILVL.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000111000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVILVH.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000111001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVILVH.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000111010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVILVH.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000111011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVILVH.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000111100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPICKEV.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000111101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPICKEV.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000111110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPICKEV.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101000111111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPICKEV.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001000000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPICKOD.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001000001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPICKOD.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001000010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPICKOD.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001000011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPICKOD.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001000100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVREPLVE.B", XVt[Rd], XVt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001000101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVREPLVE.H", XVt[Rd], XVt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001000110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVREPLVE.W", XVt[Rd], XVt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001000111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVREPLVE.D", XVt[Rd], XVt[Rj], Xt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001001100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVAND.V", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001001101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVOR.V", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001001110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVXOR.V", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001001111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVNOR.V", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001010000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVANDN.V", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001010001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVORN.V", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001010110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFRSTP.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001010111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFRSTP.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001011010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVADD.Q", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001011011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSUB.Q", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001011100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSIGNCOV.B", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001011101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSIGNCOV.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001011110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSIGNCOV.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001011111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSIGNCOV.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001100001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFADD.S", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001100010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFADD.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001100101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFSUB.S", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001100110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFSUB.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001110001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFMUL.S", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001110010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFMUL.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001110101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFDIV.S", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001110110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFDIV.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001111001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFMAX.S", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001111010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFMAX.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001111101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFMIN.S", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101001111110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFMIN.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101010000001kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFMAXA.S", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101010000010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFMAXA.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101010000101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFMINA.S", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101010000110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFMINA.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101010001100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCVT.H.S", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101010001101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFCVT.S.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101010010000kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFFINT.S.L", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101010010011kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFTINT.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101010010100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFTINTRM.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101010010101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFTINTRP.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101010010110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFTINTRZ.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101010010111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVFTINTRNE.W.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101011110101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSHUF.H", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101011110110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSHUF.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101011110111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVSHUF.D", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110101011111010kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVPERM.W", XVt[Rd], XVt[Rj], XVt[Rk]); + return buff; + } + if (isMask(opcode, "01110110100000000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSEQI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100000001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSEQI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100000010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSEQI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100000011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSEQI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100000100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100000101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100000110iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100000111iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100001000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.BU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.HU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100001010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.WU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100001011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.DU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100001100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100001101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100001110iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100001111iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100010000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.BU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.HU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100010010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.WU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100010011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.DU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100010100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVADDI.BU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100010101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVADDI.HU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100010110iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVADDI.WU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100010111iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVADDI.DU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100011000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSUBI.BU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSUBI.HU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100011010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSUBI.WU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100011011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSUBI.DU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100011100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBSLL.V", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100011101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBSRL.V", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100100000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100100010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100100011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100100100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100100101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100100110iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100100111iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100101000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.BU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100101001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.HU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100101010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.WU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100101011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.DU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100101100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.BU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100101101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.HU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100101110iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.WU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100101111iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.DU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100110100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVFRSTPI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110100110101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVFRSTPI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011010011100000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVCLO.B", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100000001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVCLO.H", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100000010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVCLO.W", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100000011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVCLO.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100000100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVCLZ.B", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100000101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVCLZ.H", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100000110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVCLZ.W", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100000111jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVCLZ.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100001000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVPCNT.B", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100001001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVPCNT.H", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100001010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVPCNT.W", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100001011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVPCNT.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100001100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVNEG.B", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100001101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVNEG.H", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100001110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVNEG.W", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100001111jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVNEG.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100010000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVMSKLTZ.B", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100010001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVMSKLTZ.H", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100010010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVMSKLTZ.W", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100010011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVMSKLTZ.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100010100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVMSKGEZ.B", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100011000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVMSKNZ.B", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100100110jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVSETEQZ.V", FCCt[Rc], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100100111jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVSETNEZ.V", FCCt[Rc], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100101000jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVSETANYEQZ.B", FCCt[Rc], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100101001jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVSETANYEQZ.H", FCCt[Rc], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100101010jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVSETANYEQZ.W", FCCt[Rc], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100101011jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVSETANYEQZ.D", FCCt[Rc], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100101100jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVSETALLNEZ.B", FCCt[Rc], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100101101jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVSETALLNEZ.H", FCCt[Rc], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100101110jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVSETALLNEZ.W", FCCt[Rc], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100101111jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVSETALLNEZ.D", FCCt[Rc], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100110001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFLOGB.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100110010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFLOGB.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100110101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFCLASS.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100110110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFCLASS.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100111001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFSQRT.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100111010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFSQRT.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100111101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRECIP.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011100111110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRECIP.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101000001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRSQRT.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101000010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRSQRT.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101000101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRECIPE.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101000110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRECIPE.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101001001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRSQRTE.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101001010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRSQRTE.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101001101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRINT.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101001110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRINT.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101010001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRINTRM.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101010010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRINTRM.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101010101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRINTRP.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101010110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRINTRP.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101011001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRINTRZ.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101011010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRINTRZ.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101011101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRINTRNE.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101011110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFRINTRNE.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101111010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFCVTL.S.H", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101111011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFCVTH.S.H", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101111100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFCVTL.D.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011101111101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFCVTH.D.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFFINT.S.W", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110000001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFFINT.S.WU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110000010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFFINT.D.L", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110000011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFFINT.D.LU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110000100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFFINTL.D.W", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110000101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFFINTH.D.W", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110001100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINT.W.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110001101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINT.L.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110001110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRM.W.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110001111jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRM.L.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110010000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRP.W.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110010001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRP.L.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110010010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRZ.W.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110010011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRZ.L.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110010100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRNE.W.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110010101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRNE.L.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110010110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINT.WU.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110010111jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINT.LU.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110011100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRZ.WU.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110011101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRZ.LU.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110100000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTL.L.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110100001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTH.L.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110100010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRML.L.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110100011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRMH.L.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110100100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRPL.L.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110100101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRPH.L.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110100110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRZL.L.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110100111jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRZH.L.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110101000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRNEL.L.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110101001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVFTINTRNEH.L.S", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110111000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVEXTH.H.B", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110111001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVEXTH.W.H", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110111010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVEXTH.D.W", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110111011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVEXTH.Q.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110111100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVEXTH.HU.BU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110111101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVEXTH.WU.HU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110111110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVEXTH.DU.WU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011110111111jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVEXTH.QU.DU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLGR2VR.B", XVt[Rd], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111000001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLGR2VR.H", XVt[Rd], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111000010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLGR2VR.W", XVt[Rd], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111000011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLGR2VR.D", XVt[Rd], Xt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111000100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXT2XV.H.B", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111000101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXT2XV.W.B", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111000110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXT2XV.D.B", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111000111jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXT2XV.W.H", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111001000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXT2XV.D.H", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111001001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXT2XV.D.W", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111001010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXT2XV.HU.BU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111001011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXT2XV.WU.BU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111001100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXT2XV.DU.BU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111001101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXT2XV.WU.HU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111001110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXT2XV.DU.HU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011010011111001111jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VEXT2XV.DU.WU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "01110110100111111iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVHSELI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011010100000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVROTRI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101101010000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVROTRI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110101000001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVROTRI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011010100001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVROTRI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011010100100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLRI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101101010010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLRI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110101001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLRI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011010100101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLRI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011010101000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRARI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101101010100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRARI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110101010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRARI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011010101001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRARI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011011101011110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVINSGR2VR.W", XVt[Rd], Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110111010111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVINSGR2VR.D", XVt[Rd], Xt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011011101111110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVPICKVE2GR.W", Xt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110111011111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVPICKVE2GR.D", Xt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011011110011110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVPICKVE2GR.WU", Xt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110111100111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVPICKVE2GR.DU", Xt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101101111011110iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVREPL128VEI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011011110111110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVREPL128VEI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110111101111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVREPL128VEI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101101111011111110ijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVREPL128VEI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011011111111110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVINSVE0.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110110111111111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVINSVE0.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100000011110iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVPICKVE.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111000000111110iijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVPICKVE.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100000111000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLVE0.B", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011100000111100000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLVE0.H", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011100000111110000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLVE0.W", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011100000111111000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLVE0.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011100000111111100jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLVE0.Q", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011100001000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLLWIL.H.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110000100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLLWIL.W.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111000010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLLWIL.D.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100001001000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVEXTL.Q.D", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011100001100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLLWIL.HU.BU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110000110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLLWIL.WU.HU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111000011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLLWIL.DU.WU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100001101000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVEXTL.QU.DU", XVt[Rd], XVt[Rj]); + return buff; + } + if (isMask(opcode, "0111011100010000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITCLRI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110001000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITCLRI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111000100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITCLRI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100010001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITCLRI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100010100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITSETI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110001010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITSETI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111000101001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITSETI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100010101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITSETI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100011000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITREVI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110001100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITREVI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111000110001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITREVI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100011001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITREVI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100100100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSAT.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110010010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSAT.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111001001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSAT.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100100101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSAT.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100101000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSAT.BU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110010100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSAT.HU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111001010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSAT.WU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100101001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSAT.DU", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100101100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLLI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110010110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLLI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111001011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLLI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100101101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLLI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100110000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110011000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111001100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100110001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100110100001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRAI.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110011010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRAI.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111001101001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRAI.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011100110101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRAI.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110100000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLNI.B.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111010000001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLNI.H.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011101000001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLNI.W.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110100001iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLNI.D.Q", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110100010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLRNI.B.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111010001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLRNI.H.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011101000101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLRNI.W.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110100011iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRLRNI.D.Q", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110100100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLNI.B.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111010010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLNI.H.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011101001001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLNI.W.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110100101iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLNI.D.Q", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110100110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLNI.BU.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111010011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLNI.HU.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011101001101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLNI.WU.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110100111iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLNI.DU.Q", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110101000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLRNI.B.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111010100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLRNI.H.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011101010001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLRNI.W.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110101001iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLRNI.D.Q", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110101010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLRNI.BU.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111010101001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLRNI.HU.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011101010101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLRNI.WU.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110101011iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRLRNI.DU.Q", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110101100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRANI.B.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111010110001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRANI.H.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011101011001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRANI.W.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110101101iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRANI.D.Q", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110101110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRARNI.B.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111010111001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRARNI.H.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011101011101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRARNI.W.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110101111iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSRARNI.D.Q", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110110000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRANI.B.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111011000001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRANI.H.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011101100001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRANI.W.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110110001iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRANI.D.Q", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110110010001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRANI.BU.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111011001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRANI.HU.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011101100101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRANI.WU.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110110011iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRANI.DU.Q", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110110100001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRARNI.B.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111011010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRARNI.H.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011101101001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRARNI.W.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110110101iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRARNI.D.Q", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110110110001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRARNI.BU.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111011011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRARNI.HU.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111011101101101iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRARNI.WU.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "011101110110111iiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSSRARNI.DU.Q", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111100000iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVEXTRINS.D", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111100001iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVEXTRINS.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111100010iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVEXTRINS.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111100011iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVEXTRINS.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111100100iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSHUF4I.B", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111100101iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSHUF4I.H", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111100110iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSHUF4I.W", XVt[Rd], XVt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110111100111iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSHUF4I.D", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj00001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADD.DU", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110111110001iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBITSELI.B", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj00010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SUB.WU", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110111110100iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVANDI.B", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj00011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SUB.DU", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110111110101iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVORI.B", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj00100", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADD.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110111110110iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVXORI.B", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj00101", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADD.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110111110111iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVNORI.B", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj00110", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADD.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110111111000iiiiiiiiiiiiiddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, 0x%lx", "XVLDI", XVt[Rd], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj00111", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADD.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110111111001iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVPERMI.W", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj01000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SUB.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110111111010iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVPERMI.D", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj01001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SUB.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110111111011iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVPERMI.Q", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj01010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SUB.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "000011010010aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "XVBITSEL.V", XVt[Rd], XVt[Rj], XVt[Rk], XVt[Ra]); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj01011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SUB.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100000000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSEQI.B", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj01100", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADC.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100000001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSEQI.H", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj01101", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADC.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100000010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSEQI.W", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj01110", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADC.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100000011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSEQI.D", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj01111", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ADC.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100000100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.B", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj10000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SBC.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100000101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.H", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj10001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SBC.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100000110iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.W", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj10010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SBC.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100000111iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.D", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj10011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SBC.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100001000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.BU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj10100", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SLL.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100001001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.HU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj10101", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SLL.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100001010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.WU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj10110", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SLL.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100001011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLEI.DU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj10111", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SLL.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100001100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.B", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj11000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRL.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100001101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.H", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj11001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRL.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100001110iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.W", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj11010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRL.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100001111iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.D", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj11011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRL.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100010000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.BU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj11100", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRA.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100010001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.HU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj11101", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRA.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100010010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.WU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj11110", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRA.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100010011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSLTI.DU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111110kkkkkjjjjj11111", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64SRA.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100010100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVADDI.BU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj00000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTR.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100010101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVADDI.HU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj00001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTR.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100010110iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVADDI.WU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj00010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTR.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100010111iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVADDI.DU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj00011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTR.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100011000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSUBI.BU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj00100", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTL.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100011001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSUBI.HU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj00101", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTL.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100011010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSUBI.WU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj00110", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTL.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100011011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVSUBI.DU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj00111", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64ROTL.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100011100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBSLL.V", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj01000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCR.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100011101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVBSRL.V", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj01001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCR.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100100000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.B", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj01010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCR.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.H", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj01011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCR.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100100010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.W", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj01100", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCL.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100100011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.D", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj01101", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCL.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100100100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.B", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj01110", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCL.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100100101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.H", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj01111", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64RCL.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100100110iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.W", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj10000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64AND.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100100111iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.D", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj10001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64AND.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100101000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.BU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj10010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64AND.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100101001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.HU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj10011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64AND.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100101010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.WU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj10100", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64OR.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100101011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMAXI.DU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj10101", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64OR.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100101100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.BU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj10110", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64OR.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100101101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.HU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj10111", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64OR.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100101110iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.WU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj11000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64XOR.B", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100101111iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVMINI.DU", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj11001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64XOR.H", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100110100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVFRSTPI.B", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj11010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64XOR.W", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110110100110101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "XVFRSTPI.H", XVt[Rd], XVt[Rj], imm); return buff; } - if (isMask(opcode, "00000000001111111kkkkkjjjjj11011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %s", "X64XOR.D", Xt[Rj], Xt[Rk]); + if (isMask(opcode, "01110011110100iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VANDI.B", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0000000001010100001iiijjjjj00000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SLLI.B", Xt[Rj], imm); + if (isMask(opcode, "01110011110101iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VORI.B", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0000000001010100001iiijjjjj00100", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRLI.B", Xt[Rj], imm); + if (isMask(opcode, "01110011110110iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VXORI.B", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0000000001010100001iiijjjjj01000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRAI.B", Xt[Rj], imm); + if (isMask(opcode, "01110011110111iiiiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VNORI.B", Vt[Rd], Vt[Rj], imm); return buff; } - if (isMask(opcode, "0000000001010100001iiijjjjj01100", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTRI.B", Xt[Rj], imm); + if (isMask(opcode, "000010010001aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMADD.S", Vt[Rd], Vt[Rj], Vt[Rk], Vt[Ra]); return buff; } - if (isMask(opcode, "0000000001010100001iiijjjjj10000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCRI.B", Xt[Rj], imm); + if (isMask(opcode, "000010010101aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMSUB.S", Vt[Rd], Vt[Rj], Vt[Rk], Vt[Ra]); return buff; } - if (isMask(opcode, "0000000001010100001iiijjjjj10100", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTLI.B", Xt[Rj], imm); + if (isMask(opcode, "000010011001aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFNMADD.S", Vt[Rd], Vt[Rj], Vt[Rk], Vt[Ra]); return buff; } - if (isMask(opcode, "0000000001010100001iiijjjjj11000", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCLI.B", Xt[Rj], imm); + if (isMask(opcode, "000010011101aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFNMSUB.S", Vt[Rd], Vt[Rj], Vt[Rk], Vt[Ra]); return buff; } - if (isMask(opcode, "000000000101010001iiiijjjjj00001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SLLI.H", Xt[Rj], imm); + if (isMask(opcode, "000010100001aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "XVFMADD.S", XVt[Rd], XVt[Rj], XVt[Rk], XVt[Ra]); return buff; } - if (isMask(opcode, "000000000101010001iiiijjjjj00101", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRLI.H", Xt[Rj], imm); + if (isMask(opcode, "000010100101aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "XVFMSUB.S", XVt[Rd], XVt[Rj], XVt[Rk], XVt[Ra]); return buff; } - if (isMask(opcode, "000000000101010001iiiijjjjj01001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRAI.H", Xt[Rj], imm); + if (isMask(opcode, "000010101001aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "XVFNMADD.S", XVt[Rd], XVt[Rj], XVt[Rk], XVt[Ra]); return buff; } - if (isMask(opcode, "000000000101010001iiiijjjjj01101", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTRI.H", Xt[Rj], imm); + if (isMask(opcode, "000010101101aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "XVFNMSUB.S", XVt[Rd], XVt[Rj], XVt[Rk], XVt[Ra]); return buff; } - if (isMask(opcode, "000000000101010001iiiijjjjj10001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCRI.H", Xt[Rj], imm); + if (isMask(opcode, "000010010010aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMADD.D", Vt[Rd], Vt[Rj], Vt[Rk], Vt[Ra]); return buff; } - if (isMask(opcode, "000000000101010001iiiijjjjj10101", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTLI.H", Xt[Rj], imm); + if (isMask(opcode, "000010010110aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMSUB.D", Vt[Rd], Vt[Rj], Vt[Rk], Vt[Ra]); return buff; } - if (isMask(opcode, "000000000101010001iiiijjjjj11001", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCLI.H", Xt[Rj], imm); + if (isMask(opcode, "000010011010aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFNMADD.D", Vt[Rd], Vt[Rj], Vt[Rk], Vt[Ra]); return buff; } - if (isMask(opcode, "00000000010101001iiiiijjjjj00010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SLLI.W", Xt[Rj], imm); + if (isMask(opcode, "000010011110aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFNMSUB.D", Vt[Rd], Vt[Rj], Vt[Rk], Vt[Ra]); return buff; } - if (isMask(opcode, "00000000010101001iiiiijjjjj00110", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRLI.W", Xt[Rj], imm); + if (isMask(opcode, "000010100010aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "XVFMADD.D", XVt[Rd], XVt[Rj], XVt[Rk], XVt[Ra]); return buff; } - if (isMask(opcode, "00000000010101001iiiiijjjjj01010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRAI.W", Xt[Rj], imm); + if (isMask(opcode, "000010100110aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "XVFMSUB.D", XVt[Rd], XVt[Rj], XVt[Rk], XVt[Ra]); return buff; } - if (isMask(opcode, "00000000010101001iiiiijjjjj01110", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTRI.W", Xt[Rj], imm); + if (isMask(opcode, "000010101010aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "XVFNMADD.D", XVt[Rd], XVt[Rj], XVt[Rk], XVt[Ra]); return buff; } - if (isMask(opcode, "00000000010101001iiiiijjjjj10010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCRI.W", Xt[Rj], imm); + if (isMask(opcode, "000010101110aaaaakkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "XVFNMSUB.D", XVt[Rd], XVt[Rj], XVt[Rk], XVt[Ra]); return buff; } - if (isMask(opcode, "00000000010101001iiiiijjjjj10110", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTLI.W", Xt[Rj], imm); + if (isMask(opcode, "01110101001000100kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVREPLVE.B", XVt[Rd], XVt[Rj], Xt[Rk]); return buff; } - if (isMask(opcode, "00000000010101001iiiiijjjjj11010", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCLI.W", Xt[Rj], imm); + if (isMask(opcode, "01110101001000101kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVREPLVE.H", XVt[Rd], XVt[Rj], Xt[Rk]); return buff; } - if (isMask(opcode, "0000000001010101iiiiiijjjjj00011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SLLI.D", Xt[Rj], imm); + if (isMask(opcode, "01110101001000110kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVREPLVE.W", XVt[Rd], XVt[Rj], Xt[Rk]); return buff; } - if (isMask(opcode, "0000000001010101iiiiiijjjjj00111", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRLI.D", Xt[Rj], imm); + if (isMask(opcode, "01110101001000111kkkkkjjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XVREPLVE.D", XVt[Rd], XVt[Rj], Xt[Rk]); return buff; } - if (isMask(opcode, "0000000001010101iiiiiijjjjj01011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64SRAI.D", Xt[Rj], imm); + if (isMask(opcode, "0111011010011111000000jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLGR2VR.B", XVt[Rd], Xt[Rj]); return buff; } - if (isMask(opcode, "0000000001010101iiiiiijjjjj01111", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTRI.D", Xt[Rj], imm); + if (isMask(opcode, "0111011010011111000001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLGR2VR.H", XVt[Rd], Xt[Rj]); return buff; } - if (isMask(opcode, "0000000001010101iiiiiijjjjj10011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCRI.D", Xt[Rj], imm); + if (isMask(opcode, "0111011010011111000010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLGR2VR.W", XVt[Rd], Xt[Rj]); return buff; } - if (isMask(opcode, "0000000001010101iiiiiijjjjj10111", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64ROTLI.D", Xt[Rj], imm); + if (isMask(opcode, "0111011010011111000011jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "XVREPLGR2VR.D", XVt[Rd], Xt[Rj]); return buff; } - if (isMask(opcode, "0000000001010101iiiiiijjjjj11011", &a)) { - snprintf(buff, sizeof(buff), "%-15s %s, %lu", "X64RCLI.D", Xt[Rj], imm); + if (isMask(opcode, "0000000100010100010101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FRECIP.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100010100011101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FRECIPE.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100010100010110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FRECIP.D", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100010100011110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FRECIPE.D", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011100111101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRECIP.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011100111110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRECIP.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101000101jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRECIPE.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101000110jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRECIPE.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0000000100010100011001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FRSQRT.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100010100100001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FRSQRTE.S", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100010100011010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FRSQRT.D", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0000000100010100100010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FRSQRTE.D", Ft[Rd], Ft[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101000001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRSQRT.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101000010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRSQRT.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101001001jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRSQRTE.S", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011101001010jjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFRSQRTE.D", Vt[Rd], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011100100111jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VSETNEZ.V", FCCt[Rc], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011100101000jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VSETANYEQZ.B", FCCt[Rc], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011100101001jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VSETANYEQZ.H", FCCt[Rc], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011100101010jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VSETANYEQZ.W", FCCt[Rc], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011100101011jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VSETANYEQZ.D", FCCt[Rc], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011100101100jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VSETALLNEZ.B", FCCt[Rc], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011100101101jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VSETALLNEZ.H", FCCt[Rc], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011100101110jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VSETALLNEZ.W", FCCt[Rc], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001010011100101111jjjjj00ccc", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VSETALLNEZ.D", FCCt[Rc], Vt[Rj]); + return buff; + } + if (isMask(opcode, "0111001100010000001iiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITCLRI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "011100110001000001iiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITCLRI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011000100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITCLRI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "0111001100010001iiiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VBITCLRI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010100110100iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VFRSTPI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010100110101iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VFRSTPI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010100100000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VMAXI.B", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010100100001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VMAXI.H", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010100100010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VMAXI.W", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010100100011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VMAXI.D", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010100101000iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VMAXI.BU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010100101001iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VMAXI.HU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010100101010iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VMAXI.WU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110010100101011iiiiijjjjjddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%lx", "VMAXI.DU", Vt[Rd], Vt[Rj], imm); + return buff; + } + if (isMask(opcode, "01110011111000iiiiiiiiiiiiiddddd", &a)) { + snprintf(buff, sizeof(buff), "%-15s %s, 0x%lx", "VLDI", Vt[Rd], imm); return buff; } - snprintf(buff, sizeof(buff), "%08X ???", __builtin_bswap32(opcode)); return buff; } diff --git a/src/dynarec/la64/la64_prolog.S b/src/dynarec/la64/la64_prolog.S index d0faa1e..b269f89 100644 --- a/src/dynarec/la64/la64_prolog.S +++ b/src/dynarec/la64/la64_prolog.S @@ -1,3 +1,7 @@ +#define ASM_MAPPING 1 +#include "la64_mapping.h" +#undef ASM_MAPPING + //loongarch prologue for dynarec //Save stuff, prepare stack and register //called with pointer to emu as 1st parameter @@ -6,12 +10,12 @@ .text .align 4 -.extern la64_lbt +.extern cpuext .global la64_prolog la64_prolog: //save all 18 used register - addi.d $sp, $sp, -(8 * 19) + addi.d $sp, $sp, -(8 * 20) st.d $r1, $sp, (8 * 0) //save ra st.d $r22, $sp, (8 * 1) //save fp // save s0 - s8 @@ -33,39 +37,40 @@ la64_prolog: fst.d $f29, $sp, (8 * 16) fst.d $f30, $sp, (8 * 17) fst.d $f31, $sp, (8 * 18) + // save a1 + move $r16, $a1 // setup emu -> register - ld.d $r12, $r4, (8 * 0) - ld.d $r13, $r4, (8 * 1) - ld.d $r14, $r4, (8 * 2) - ld.d $r15, $r4, (8 * 3) - ld.d $r16, $r4, (8 * 4) - ld.d $r17, $r4, (8 * 5) - ld.d $r18, $r4, (8 * 6) - ld.d $r19, $r4, (8 * 7) - ld.d $r23, $r4, (8 * 8) - ld.d $r24, $r4, (8 * 9) - ld.d $r25, $r4, (8 * 10) - ld.d $r26, $r4, (8 * 11) - ld.d $r27, $r4, (8 * 12) - ld.d $r28, $r4, (8 * 13) - ld.d $r29, $r4, (8 * 14) - ld.d $r30, $r4, (8 * 15) - ld.d $r31, $r4, (8 * 16) // xFlags - ld.d $r20, $r4, (8 * 17) // xRIP + move Emu, $a0 + ld.d RAX, Emu, (8 * 0) + ld.d RCX, Emu, (8 * 1) + ld.d RDX, Emu, (8 * 2) + ld.d RBX, Emu, (8 * 3) + ld.d RSP, Emu, (8 * 4) + ld.d RBP, Emu, (8 * 5) + ld.d RSI, Emu, (8 * 6) + ld.d RDI, Emu, (8 * 7) + ld.d R8, Emu, (8 * 8) + ld.d R9, Emu, (8 * 9) + ld.d R10, Emu, (8 * 10) + ld.d R11, Emu, (8 * 11) + ld.d R12, Emu, (8 * 12) + ld.d R13, Emu, (8 * 13) + ld.d R14, Emu, (8 * 14) + ld.d R15, Emu, (8 * 15) + ld.d Flags, Emu, (8 * 16) // xFlags + ld.d RIP, Emu, (8 * 17) // xRIP // spill xFlags to LBT.eflags - la.global $a6, la64_lbt - ldptr.d $a6, $a6, 0 - beqz $a6, 1f - x86mtflag $r31, 0b111111 + la.global $r19, cpuext + ldptr.d $r19, $r19, 0 + andi $r19, $r19, 1 + beqz $r19, 1f + x86mtflag Flags, 0b111111 1: // push sentinel onto the stack - st.d $r0, $sp, -16 + st.d $r0, $sp, -16 st.d $r0, $sp, -8 addi.d $sp, $sp, -16 // save old sp into xSavedSP - addi.d $r22, $sp, 16 - // setup xMASK - addi.w $r11, $r0, -1 - lu32i.d $r11, 0 + addi.d SavedSP, $sp, 16 //jump to function - jirl $r0, $a1, 0 + jirl $r0, $r16, 0 diff --git a/src/dynarec/native_lock.h b/src/dynarec/native_lock.h index 1ed26e8..ba4cb13 100644 --- a/src/dynarec/native_lock.h +++ b/src/dynarec/native_lock.h @@ -19,6 +19,7 @@ #define native_lock_xchg_h(A, B) arm64_lock_xchg_h(A, B) #define native_lock_xchg_b(A, B) arm64_lock_xchg_b(A, B) #define native_lock_storeifref(A, B, C) arm64_lock_storeifref(A, B, C) +#define native_lock_storeifref2(A, B, C) arm64_lock_storeifref2(A, B, C) #define native_lock_storeifref_d(A, B, C) arm64_lock_storeifref_d(A, B, C) #define native_lock_storeifref2_d(A, B, C) arm64_lock_storeifref2_d(A, B, C) #define native_lock_storeifnull(A, B) arm64_lock_storeifnull(A, B) @@ -45,6 +46,7 @@ #define native_lock_xchg_dd(A, B) rv64_lock_xchg_dd(A, B) #define native_lock_xchg_d(A, B) rv64_lock_xchg_d(A, B) #define native_lock_storeifref(A, B, C) rv64_lock_storeifref(A, B, C) +#define native_lock_storeifref2(A, B, C) rv64_lock_storeifref2(A, B, C) #define native_lock_storeifref_d(A, B, C) rv64_lock_storeifref_d(A, B, C) #define native_lock_storeifref2_d(A, B, C) rv64_lock_storeifref2_d(A, B, C) #define native_lock_storeifnull(A, B) rv64_lock_storeifnull(A, B) @@ -83,6 +85,7 @@ #define native_lock_xchg_dd(A, B) la64_lock_xchg_dd(A, B) #define native_lock_xchg_d(A, B) la64_lock_xchg_d(A, B) #define native_lock_storeifref(A, B, C) la64_lock_storeifref(A, B, C) +#define native_lock_storeifref2(A, B, C) la64_lock_storeifref2(A, B, C) #define native_lock_storeifref_d(A, B, C) la64_lock_storeifref_d(A, B, C) #define native_lock_storeifref2_d(A, B, C) la64_lock_storeifref2_d(A, B, C) #define native_lock_storeifnull(A, B) la64_lock_storeifnull(A, B) @@ -96,13 +99,13 @@ #define native_lock_cas_d(A, B, C) la64_lock_cas_d(A, B, C) #define native_lock_cas_dd(A, B, C) la64_lock_cas_dd(A, B, C) #define native_lock_xchg_b(A, B) \ - la64_lam_bh ? la64_lock_xchg_b(A, B) : la64_lock_xchg_b_slow(A, B) + cpuext.lam_bh ? la64_lock_xchg_b(A, B) : la64_lock_xchg_b_slow(A, B) #define native_lock_read_b(A) tmpcas=*(uint8_t*)(A) #define native_lock_write_b(A, B) \ - la64_lamcas ? la64_lock_cas_b(A, tmpcas, B) : la64_lock_cas_b_slow(A, tmpcas, B) + cpuext.lamcas ? la64_lock_cas_b(A, tmpcas, B) : la64_lock_cas_b_slow(A, tmpcas, B) #define native_lock_read_h(A) tmpcas=*(uint16_t*)(A) #define native_lock_write_h(A, B) \ - la64_lamcas ? la64_lock_cas_h(A, tmpcas, B) : la64_lock_cas_h_slow(A, tmpcas, B) + cpuext.lamcas ? la64_lock_cas_h(A, tmpcas, B) : la64_lock_cas_h_slow(A, tmpcas, B) #define native_lock_read_d(A) tmpcas=*(uint32_t*)(A) #define native_lock_write_d(A, B) la64_lock_cas_d(A, tmpcas, B) #define native_lock_read_dd(A) tmpcas=*(uint64_t*)(A) diff --git a/src/dynarec/rv64/dynarec_rv64_00.c b/src/dynarec/rv64/dynarec_rv64_00.c index 5f529fb..2ccf55a 100644 --- a/src/dynarec/rv64/dynarec_rv64_00.c +++ b/src/dynarec/rv64/dynarec_rv64_00.c @@ -7,10 +7,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -23,18 +21,18 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" -uintptr_t dynarec64_00(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_00(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { uint8_t opcode; opcode = PK(0); - switch(opcode) { - case 0x00 ... 0x3f: addr = dynarec64_00_0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); break; - case 0x40 ... 0x7f: addr = dynarec64_00_1(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); break; - case 0x80 ... 0xbf: addr = dynarec64_00_2(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); break; - case 0xc0 ... 0xff: addr = dynarec64_00_3(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); break; + switch (opcode) { + case 0x00 ... 0x3f: addr = dynarec64_00_0(dyn, addr, ip, ninst, rex, ok, need_epilog); break; + case 0x40 ... 0x7f: addr = dynarec64_00_1(dyn, addr, ip, ninst, rex, ok, need_epilog); break; + case 0x80 ... 0xbf: addr = dynarec64_00_2(dyn, addr, ip, ninst, rex, ok, need_epilog); break; + case 0xc0 ... 0xff: addr = dynarec64_00_3(dyn, addr, ip, ninst, rex, ok, need_epilog); break; } return addr; diff --git a/src/dynarec/rv64/dynarec_rv64_00_0.c b/src/dynarec/rv64/dynarec_rv64_00_0.c index 716671d..dc8d109 100644 --- a/src/dynarec/rv64/dynarec_rv64_00_0.c +++ b/src/dynarec/rv64/dynarec_rv64_00_0.c @@ -7,10 +7,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -23,9 +21,9 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" -uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { uint8_t nextop, opcode; uint8_t gd, ed; @@ -33,13 +31,14 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int int32_t i32, tmp; int64_t i64, j64; uint8_t u8; - uint8_t gb1, gb2, eb1, eb2; + uint8_t gb, gb1, gb2, eb1, eb2; uint32_t u32; uint64_t u64; uint8_t wback, wb1, wb2, wb; int64_t fixedaddress; int lock; int cacheupd = 0; + uintptr_t retaddr = 0; opcode = F8; MAYUSE(eb1); @@ -49,19 +48,20 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int MAYUSE(lock); MAYUSE(cacheupd); - switch(opcode) { + switch (opcode) { case 0x00: INST_NAME("ADD Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_8BIT_OPERATION(wb, gb, x1, ADD(wb, wb, x1)); GETEB(x1, 0); GETGB(x2); - emit_add8(dyn, ninst, x1, x2, x4, x5); + emit_add8(dyn, ninst, x1, x2, x4, x5, x6); EBBACK(x5, 0); break; case 0x01: INST_NAME("ADD Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -70,16 +70,17 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x02: INST_NAME("ADD Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_8BIT_OPERATION(gb, wb, x1, ADD(gb, gb, x1)); GETEB(x1, 0); GETGB(x2); - emit_add8(dyn, ninst, x2, x1, x4, x5); + emit_add8(dyn, ninst, x2, x1, x4, x5, x6); GBBACK(x5); break; case 0x03: INST_NAME("ADD Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -87,16 +88,16 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x04: INST_NAME("ADD AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); - emit_add8c(dyn, ninst, x1, u8, x3, x4, x5); + emit_add8c(dyn, ninst, x1, u8, x3, x4, x5, x6); ANDI(xRAX, xRAX, ~0xff); OR(xRAX, xRAX, x1); break; case 0x05: INST_NAME("ADD EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; emit_add32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5, x6); break; @@ -106,7 +107,17 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int LHU(x1, xEmu, offsetof(x64emu_t, segs[_ES])); PUSH1_32(x1); } else { - DEFAULT; + INST_NAME("Illegal 06"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; } break; case 0x07: @@ -114,15 +125,25 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("POP ES"); POP1_32(x1); SH(x1, xEmu, offsetof(x64emu_t, segs[_ES])); - SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_ES])); } else { - DEFAULT; + INST_NAME("Illegal 07"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; } break; case 0x08: INST_NAME("OR Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_8BIT_OPERATION(wb, gb, x1, OR(wb, wb, x1)); GETEB(x1, 0); GETGB(x2); emit_or8(dyn, ninst, x1, x2, x4, x5); @@ -130,7 +151,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x09: INST_NAME("OR Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -139,8 +160,9 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x0A: INST_NAME("OR Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_8BIT_OPERATION(gb, wb, x1, OR(gb, gb, x1)); GETEB(x1, 0); GETGB(x2); emit_or8(dyn, ninst, x2, x1, x4, x5); @@ -148,7 +170,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x0B: INST_NAME("OR Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -156,7 +178,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x0C: INST_NAME("OR AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); emit_or8c(dyn, ninst, x1, u8, x3, x4, x5); @@ -165,40 +187,71 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x0D: INST_NAME("OR EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; emit_or32c(dyn, ninst, rex, xRAX, i64, x3, x4); break; - + case 0x0E: + if (rex.is32bits) { + INST_NAME("PUSH CS"); + LHU(x1, xEmu, offsetof(x64emu_t, segs[_CS])); + PUSH1_32(x1); + SMWRITE(); + } else { + INST_NAME("Illegal 0E"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; case 0x0F: - switch(rep) { - case 0: - addr = dynarec64_0F(dyn, addr, ip, ninst, rex, ok, need_epilog); - break; - case 1: - addr = dynarec64_F20F(dyn, addr, ip, ninst, rex, ok, need_epilog); - break; - case 2: - addr = dynarec64_F30F(dyn, addr, ip, ninst, rex, ok, need_epilog); - break; - default: - DEFAULT; + switch (rex.rep) { + case 0: + if (cpuext.vector) + retaddr = dynarec64_0F_vector(dyn, addr, ip, ninst, rex, ok, need_epilog); + addr = retaddr ? retaddr : dynarec64_0F(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + case 1: + if (cpuext.vector) + retaddr = dynarec64_F20F_vector(dyn, addr, ip, ninst, rex, ok, need_epilog); + addr = retaddr ? retaddr : dynarec64_F20F(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + case 2: + if (cpuext.vector) + retaddr = dynarec64_F30F_vector(dyn, addr, ip, ninst, rex, ok, need_epilog); + addr = retaddr ? retaddr : dynarec64_F30F(dyn, addr, ip, ninst, rex, ok, need_epilog); + break; + default: + DEFAULT; } break; case 0x10: INST_NAME("ADC Eb, Gb"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + FAST_8BIT_OPERATION(wb, gb, x1, { + ADD(wb, wb, x1); + ANDI(x2, xFlags, 1 << F_CF); + SLLI(x2, x2, 64 - 8); + ADD(wb, wb, x2); + }); GETEB(x1, 0); GETGB(x2); - emit_adc8(dyn, ninst, x1, x2, x4, x5, x3); + emit_adc8(dyn, ninst, x1, x2, x4, x5, x6); EBBACK(x5, 0); break; case 0x11: INST_NAME("ADC Ed, Gd"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -208,17 +261,23 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x12: INST_NAME("ADC Gb, Eb"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + FAST_8BIT_OPERATION(gb, wb, x1, { + ADD(gb, gb, x1); + ANDI(x2, xFlags, 1 << F_CF); + SLLI(x2, x2, 64 - 8); + ADD(gb, gb, x2); + }); GETEB(x2, 0); GETGB(x1); - emit_adc8(dyn, ninst, x1, x2, x4, x3, x5); + emit_adc8(dyn, ninst, x1, x2, x4, x6, x5); GBBACK(x5); break; case 0x13: INST_NAME("ADC Gd, Ed"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -227,7 +286,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x14: INST_NAME("ADC AL, Ib"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); emit_adc8c(dyn, ninst, x1, u8, x3, x4, x5, x6); @@ -237,7 +296,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x15: INST_NAME("ADC EAX, Id"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; MOV64xw(x1, i64); emit_adc32(dyn, ninst, rex, xRAX, x1, x3, x4, x5, x6); @@ -249,7 +308,17 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int PUSH1_32(x1); SMWRITE(); } else { - DEFAULT; + INST_NAME("Illegal 16"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; } break; case 0x17: @@ -258,16 +327,31 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int SMREAD(); POP1_32(x1); SH(x1, xEmu, offsetof(x64emu_t, segs[_SS])); - SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_SS])); } else { - DEFAULT; + INST_NAME("Illegal 17"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; } break; case 0x18: INST_NAME("SBB Eb, Gb"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + FAST_8BIT_OPERATION(wb, gb, x1, { + SUB(wb, wb, x1); + ANDI(x2, xFlags, 1 << F_CF); + SLLI(x2, x2, 64 - 8); + SUB(wb, wb, x2); + }); GETEB(x1, 0); GETGB(x2); emit_sbb8(dyn, ninst, x1, x2, x4, x5, x6); @@ -276,7 +360,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x19: INST_NAME("SBB Ed, Gd"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -286,17 +370,23 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x1A: INST_NAME("SBB Gb, Eb"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; + FAST_8BIT_OPERATION(gb, wb, x1, { + SUB(gb, gb, x1); + ANDI(x2, xFlags, 1 << F_CF); + SLLI(x2, x2, 64 - 8); + SUB(gb, gb, x2); + }); GETEB(x2, 0); GETGB(x1); - emit_sbb8(dyn, ninst, x1, x2, x3, x4, x5); + emit_sbb8(dyn, ninst, x1, x2, x6, x4, x5); GBBACK(x5); break; case 0x1B: INST_NAME("SBB Gd, Ed"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -305,7 +395,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x1C: INST_NAME("SBB AL, Ib"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); emit_sbb8c(dyn, ninst, x1, u8, x3, x4, x5, x6); @@ -315,7 +405,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x1D: INST_NAME("SBB EAX, Id"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; MOV64xw(x2, i64); emit_sbb32(dyn, ninst, rex, xRAX, x2, x3, x4, x5); @@ -327,23 +417,42 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int PUSH1_32(x1); SMWRITE(); } else { - DEFAULT; + INST_NAME("Illegal 1E"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; } break; case 0x1F: - if(rex.is32bits) { + if (rex.is32bits) { INST_NAME("POP DS"); SMREAD(); POP1_32(x1); SH(x1, xEmu, offsetof(x64emu_t, segs[_DS])); - SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_DS])); } else { - DEFAULT; + INST_NAME("Illegal 1F"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; } break; case 0x20: INST_NAME("AND Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETEB(x1, 0); GETGB(x2); @@ -352,7 +461,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x21: INST_NAME("AND Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -361,7 +470,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x22: INST_NAME("AND Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETEB(x1, 0); GETGB(x2); @@ -370,7 +479,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x23: INST_NAME("AND Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -378,7 +487,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x24: INST_NAME("AND AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); emit_and8c(dyn, ninst, x1, u8, x3, x4); @@ -387,14 +496,15 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x25: INST_NAME("AND EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; emit_and32c(dyn, ninst, rex, xRAX, i64, x3, x4); break; case 0x28: INST_NAME("SUB Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_8BIT_OPERATION(wb, gb, x1, SUB(wb, wb, x1)); GETEB(x1, 0); GETGB(x2); emit_sub8(dyn, ninst, x1, x2, x4, x5, x6); @@ -402,7 +512,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x29: INST_NAME("SUB Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -411,8 +521,9 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x2A: INST_NAME("SUB Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_8BIT_OPERATION(gb, wb, x1, SUB(gb, gb, x1)); GETEB(x1, 0); GETGB(x2); emit_sub8(dyn, ninst, x2, x1, x4, x5, x6); @@ -420,7 +531,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x2B: INST_NAME("SUB Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -428,7 +539,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x2C: INST_NAME("SUB AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); emit_sub8c(dyn, ninst, x1, u8, x2, x3, x4, x5); @@ -437,14 +548,18 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x2D: INST_NAME("SUB EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; emit_sub32c(dyn, ninst, rex, xRAX, i64, x2, x3, x4, x5); break; + case 0x2E: + INST_NAME("CS:"); + break; case 0x30: INST_NAME("XOR Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_8BIT_OPERATION(wb, gb, x1, XOR(wb, wb, x1)); GETEB(x1, 0); GETGB(x2); emit_xor8(dyn, ninst, x1, x2, x4, x5); @@ -452,19 +567,20 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x31: INST_NAME("XOR Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); emit_xor32(dyn, ninst, rex, ed, gd, x3, x4); - if(ed!=gd) { + if (ed != gd) { WBACK; } break; case 0x32: INST_NAME("XOR Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_8BIT_OPERATION(gb, wb, x1, XOR(gb, gb, x1)); GETEB(x1, 0); GETGB(x2); emit_xor8(dyn, ninst, x2, x1, x4, x5); @@ -472,7 +588,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x33: INST_NAME("XOR Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -480,7 +596,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x34: INST_NAME("XOR AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); emit_xor8c(dyn, ninst, x1, u8, x3, x4); @@ -489,7 +605,7 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x35: INST_NAME("XOR EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; emit_xor32c(dyn, ninst, rex, xRAX, i64, x3, x4); break; @@ -498,15 +614,15 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x38: INST_NAME("CMP Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETEB(x1, 0); GETGB(x2); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6); + emit_cmp8(dyn, ninst, x1, x2, x7, x4, x5, x6); break; case 0x39: INST_NAME("CMP Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -514,15 +630,15 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x3A: INST_NAME("CMP Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETEB(x1, 0); GETGB(x2); - emit_cmp8(dyn, ninst, x2, x1, x3, x4, x5, x6); + emit_cmp8(dyn, ninst, x2, x1, x7, x4, x5, x6); break; case 0x3B: INST_NAME("CMP Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); @@ -530,10 +646,10 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x3C: INST_NAME("CMP AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u8 = F8; ANDI(x1, xRAX, 0xff); - if(u8) { + if (u8) { MOV32w(x2, u8); emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6); } else { @@ -542,18 +658,18 @@ uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x3D: INST_NAME("CMP EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i64 = F32S; - if(i64) { - MOV64xw(x2, i64); + if (i64) { + MOV64x(x2, i64); emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5, x6); } else - emit_cmp32_0(dyn, ninst, rex, xRAX, x3, x4); + emit_cmp32_0(dyn, ninst, rex, 0xC0 /* fake nextop */, xRAX, x3, x4, x5); break; default: DEFAULT; } - return addr; + return addr; } diff --git a/src/dynarec/rv64/dynarec_rv64_00_1.c b/src/dynarec/rv64/dynarec_rv64_00_1.c index a361af5..7db5ffa 100644 --- a/src/dynarec/rv64/dynarec_rv64_00_1.c +++ b/src/dynarec/rv64/dynarec_rv64_00_1.c @@ -7,10 +7,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -23,14 +21,14 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" int isSimpleWrapper(wrapper_t fun); -uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { uint8_t nextop, opcode; - uint8_t gd, ed; + uint8_t gd, ed, tmp1, tmp2, tmp3; int8_t i8; int32_t i32, tmp; int64_t i64, j64; @@ -42,6 +40,7 @@ uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int int64_t fixedaddress; int lock; int cacheupd = 0; + uintptr_t retaddr = 0; opcode = F8; MAYUSE(eb1); @@ -51,7 +50,7 @@ uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int MAYUSE(lock); MAYUSE(cacheupd); - switch(opcode) { + switch (opcode) { case 0x40: case 0x41: case 0x42: @@ -61,8 +60,8 @@ uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x46: case 0x47: INST_NAME("INC Reg (32bits)"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - gd = xRAX + (opcode&7); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); + gd = TO_NAT(opcode & 7); emit_inc32(dyn, ninst, rex, gd, x1, x2, x3, x4); break; case 0x48: @@ -74,8 +73,8 @@ uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x4E: case 0x4F: INST_NAME("DEC Reg (32bits)"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - gd = xRAX + (opcode&7); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); + gd = TO_NAT(opcode & 7); emit_dec32(dyn, ninst, rex, gd, x1, x2, x3, x4); break; case 0x50: @@ -87,7 +86,8 @@ uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x56: case 0x57: INST_NAME("PUSH reg"); - gd = xRAX+(opcode&0x07)+(rex.b<<3); + SCRATCH_USAGE(0); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); PUSH1z(gd); break; case 0x58: @@ -99,14 +99,15 @@ uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x5E: case 0x5F: INST_NAME("POP reg"); - gd = xRAX+(opcode&0x07)+(rex.b<<3); + SCRATCH_USAGE(0); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); POP1z(gd); break; case 0x60: - if(rex.is32bits) { + if (rex.is32bits) { INST_NAME("PUSHAD"); - AND(x1, xRSP, xMASK); + ZEXTW2(x1, xRSP); PUSH1_32(xRAX); PUSH1_32(xRCX); PUSH1_32(xRDX); @@ -115,13 +116,25 @@ uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int PUSH1_32(xRBP); PUSH1_32(xRSI); PUSH1_32(xRDI); + SMWRITE(); } else { - DEFAULT; + INST_NAME("Illegal 60"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; } break; case 0x61: - if(rex.is32bits) { + if (rex.is32bits) { INST_NAME("POPAD"); + SMREAD(); POP1_32(xRDI); POP1_32(xRSI); POP1_32(xRBP); @@ -131,30 +144,57 @@ uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int POP1_32(xRCX); POP1_32(xRAX); } else { + INST_NAME("Illegal 61"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + BARRIER(BARRIER_FLOAT); + UDF(); + *need_epilog = 1; + *ok = 0; + } + break; + case 0x62: + if (rex.is32bits && !MODREG) { + // BOUND here DEFAULT; + } else { + INST_NAME("Illegal 62"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + UDF(); + *need_epilog = 1; + *ok = 0; } break; - case 0x63: - if(rex.is32bits) { + if (rex.is32bits) { // this is ARPL opcode DEFAULT; } else { INST_NAME("MOVSXD Gd, Ed"); nextop = F8; GETGD; - if(rex.w) { - if(MODREG) { // reg <= reg - ADDIW(gd, xRAX+(nextop&7)+(rex.b<<3), 0); - } else { // mem <= reg + SCRATCH_USAGE(0); + if (rex.w) { + if (MODREG) { // reg <= reg + ADDIW(gd, TO_NAT((nextop & 7) + (rex.b << 3)), 0); + } else { // mem <= reg SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); LW(gd, ed, fixedaddress); } } else { - if(MODREG) { // reg <= reg - AND(gd, xRAX+(nextop&7)+(rex.b<<3), xMASK); - } else { // mem <= reg + if (MODREG) { // reg <= reg + ZEXTW2(gd, TO_NAT((nextop & 7) + (rex.b << 3))); + } else { // mem <= reg SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); LWU(gd, ed, fixedaddress); @@ -162,43 +202,32 @@ uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } } break; - case 0x64: - addr = dynarec64_64(dyn, addr, ip, ninst, rex, rep, _FS, ok, need_epilog); - break; - case 0x65: - addr = dynarec64_64(dyn, addr, ip, ninst, rex, rep, _GS, ok, need_epilog); - break; - case 0x66: - addr = dynarec64_66(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); - break; - case 0x67: - if(rex.is32bits) - addr = dynarec64_67_32(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); - else - addr = dynarec64_67(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); - break; case 0x68: INST_NAME("PUSH Id"); i64 = F32S; - if(PK(0)==0xC3) { + if (PK(0) == 0xC3) { MESSAGE(LOG_DUMP, "PUSH then RET, using indirect\n"); - TABLE64(x3, addr-4); + TABLE64(x3, addr - 4); LW(x1, x3, 0); PUSH1z(x1); } else { - MOV64z(x3, i64); - PUSH1z(x3); + if (!i64) { + PUSH1z(xZR); + } else { + MOV64z(x3, i64); + PUSH1z(x3); + } } break; case 0x69: INST_NAME("IMUL Gd, Ed, Id"); - SETFLAGS(X_ALL, SF_PENDING); + SETFLAGS(X_ALL, SF_PENDING, NAT_FLAGS_NOFUSION); nextop = F8; GETGD; GETED(4); i64 = F32S; MOV64xw(x4, i64); - if(rex.w) { + if (rex.w) { // 64bits imul UFLAG_IF { MULH(x3, ed, x4); @@ -227,18 +256,22 @@ uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x6A: INST_NAME("PUSH Ib"); i64 = F8S; - MOV64z(x3, i64); - PUSH1z(x3); + if (!i64) { + PUSH1z(xZR); + } else { + MOV64z(x3, i64); + PUSH1z(x3); + } break; case 0x6B: INST_NAME("IMUL Gd, Ed, Ib"); - SETFLAGS(X_ALL, SF_PENDING); + SETFLAGS(X_ALL, SF_PENDING, NAT_FLAGS_NOFUSION); nextop = F8; GETGD; GETED(1); i64 = F8S; - MOV64xw(x4, i64); - if(rex.w) { + MOV64x(x4, i64); + if (rex.w) { // 64bits imul UFLAG_IF { MULH(x3, ed, x4); @@ -268,10 +301,14 @@ uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x6C: case 0x6D: INST_NAME(opcode == 0x6C ? "INSB" : "INSD"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state - GETIP(ip); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); STORE_XEMU_CALL(x3); - CALL(native_priv, -1); + CALL(const_native_priv, -1, 0, 0); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; @@ -280,49 +317,60 @@ uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x6E: case 0x6F: INST_NAME(opcode == 0x6C ? "OUTSB" : "OUTSD"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state - GETIP(ip); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); STORE_XEMU_CALL(x3); - CALL(native_priv, -1); + CALL(const_native_priv, -1, 0, 0); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; *ok = 0; break; - #define GO(GETFLAGS, NO, YES, F) \ - if (box64_dynarec_test == 2) { NOTEST(x1); } \ - READFLAGS(F); \ - i8 = F8S; \ - BARRIER(BARRIER_MAYBE); \ - JUMP(addr+i8, 1); \ - GETFLAGS; \ - if(dyn->insts[ninst].x64.jmp_insts==-1 || \ - CHECK_CACHE()) { \ - /* out of the block */ \ - i32 = dyn->insts[ninst].epilog-(dyn->native_size); \ - B##NO##_safe(x1, i32); \ - if(dyn->insts[ninst].x64.jmp_insts==-1) { \ - if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \ - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ - jump_to_next(dyn, addr+i8, 0, ninst, rex.is32bits); \ - } else { \ - CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size);\ - B(i32); \ - } \ - } else { \ - /* inside the block */ \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ - B##YES##_safe(x1, i32); \ - } - - GOCOND(0x70, "J", "ib"); +#define GO(GETFLAGS, NO, YES, NATNO, NATYES, F) \ + READFLAGS_FUSION(F, x1, x2, x3, x4, x5); \ + i8 = F8S; \ + BARRIER(BARRIER_MAYBE); \ + JUMP(addr + i8, 1); \ + if (!dyn->insts[ninst].nat_flags_fusion) { \ + GETFLAGS; \ + } \ + if (dyn->insts[ninst].x64.jmp_insts == -1 || CHECK_CACHE()) { \ + /* out of the block */ \ + i32 = dyn->insts[ninst].epilog - (dyn->native_size); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP_safe(NATNO, i32); \ + } else { \ + B##NO##_safe(tmp1, i32); \ + } \ + if (dyn->insts[ninst].x64.jmp_insts == -1) { \ + if (!(dyn->insts[ninst].x64.barrier & BARRIER_FLOAT)) \ + fpu_purgecache(dyn, ninst, 1, tmp1, tmp2, tmp3); \ + jump_to_next(dyn, addr + i8, 0, ninst, rex.is32bits); \ + } else { \ + CacheTransform(dyn, ninst, cacheupd, tmp1, tmp2, tmp3); \ + i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ + B(i32); \ + } \ + } else { \ + /* inside the block */ \ + i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP_safe(NATYES, i32); \ + } else { \ + B##YES##_safe(tmp1, i32); \ + } \ + } + GOCOND(0x70, "J", "ib"); +#undef GO - #undef GO default: DEFAULT; } - return addr; + return addr; } diff --git a/src/dynarec/rv64/dynarec_rv64_00_2.c b/src/dynarec/rv64/dynarec_rv64_00_2.c index 1232a97..42c8fb3 100644 --- a/src/dynarec/rv64/dynarec_rv64_00_2.c +++ b/src/dynarec/rv64/dynarec_rv64_00_2.c @@ -7,10 +7,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -23,9 +21,9 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" -uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { uint8_t nextop, opcode; uint8_t gd, ed; @@ -49,21 +47,21 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int MAYUSE(lock); MAYUSE(cacheupd); - switch(opcode) { + switch (opcode) { case 0x80: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: // ADD INST_NAME("ADD Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; - emit_add8c(dyn, ninst, x1, u8, x2, x4, x5); + emit_add8c(dyn, ninst, x1, u8, x2, x4, x5, x6); EBBACK(x5, 0); break; case 1: // OR INST_NAME("OR Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; emit_or8c(dyn, ninst, x1, u8, x2, x4, x5); @@ -72,7 +70,7 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 2: // ADC INST_NAME("ADC Eb, Ib"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; emit_adc8c(dyn, ninst, x1, u8, x2, x4, x5, x6); @@ -81,7 +79,7 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 3: // SBB INST_NAME("SBB Eb, Ib"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; emit_sbb8c(dyn, ninst, x1, u8, x2, x4, x5, x6); @@ -89,7 +87,7 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 4: // AND INST_NAME("AND Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; emit_and8c(dyn, ninst, x1, u8, x2, x4); @@ -97,7 +95,7 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 5: // SUB INST_NAME("SUB Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; emit_sub8c(dyn, ninst, x1, u8, x2, x4, x5, x6); @@ -105,7 +103,7 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 6: // XOR INST_NAME("XOR Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; emit_xor8c(dyn, ninst, x1, u8, x2, x4); @@ -113,12 +111,12 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 7: // CMP INST_NAME("CMP Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = F8; - if(u8) { + if (u8) { ADDI(x2, xZR, u8); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6); + emit_cmp8(dyn, ninst, x1, x2, x7, x4, x5, x6); } else { emit_cmp8_0(dyn, ninst, x1, x3, x4); } @@ -130,97 +128,153 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x81: case 0x83: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: // ADD - if(opcode==0x81) {INST_NAME("ADD Ed, Id");} else {INST_NAME("ADD Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; + if (opcode == 0x81) { + INST_NAME("ADD Ed, Id"); + } else { + INST_NAME("ADD Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED((opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6); WBACK; break; case 1: // OR - if(opcode==0x81) {INST_NAME("OR Ed, Id");} else {INST_NAME("OR Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; + if (opcode == 0x81) { + INST_NAME("OR Ed, Id"); + } else { + INST_NAME("OR Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED((opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; emit_or32c(dyn, ninst, rex, ed, i64, x3, x4); WBACK; break; case 2: // ADC - if(opcode==0x81) {INST_NAME("ADC Ed, Id");} else {INST_NAME("ADC Ed, Ib");} + if (opcode == 0x81) { + INST_NAME("ADC Ed, Id"); + } else { + INST_NAME("ADC Ed, Ib"); + } READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED((opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; MOV64xw(x5, i64); - emit_adc32(dyn, ninst, rex, ed, x5, x3, x4, x6, x9); + emit_adc32(dyn, ninst, rex, ed, x5, x3, x4, x6, x7); WBACK; break; case 3: // SBB - if(opcode==0x81) {INST_NAME("SBB Ed, Id");} else {INST_NAME("SBB Ed, Ib");} + if (opcode == 0x81) { + INST_NAME("SBB Ed, Id"); + } else { + INST_NAME("SBB Ed, Ib"); + } READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED((opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; MOV64xw(x5, i64); emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4, x6); WBACK; break; case 4: // AND - if(opcode==0x81) {INST_NAME("AND Ed, Id");} else {INST_NAME("AND Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; + if (opcode == 0x81) { + INST_NAME("AND Ed, Id"); + } else { + INST_NAME("AND Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED((opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; emit_and32c(dyn, ninst, rex, ed, i64, x3, x4); WBACK; break; case 5: // SUB - if(opcode==0x81) {INST_NAME("SUB Ed, Id");} else {INST_NAME("SUB Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; + if (opcode == 0x81) { + INST_NAME("SUB Ed, Id"); + } else { + INST_NAME("SUB Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED((opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; emit_sub32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6); WBACK; break; case 6: // XOR - if(opcode==0x81) {INST_NAME("XOR Ed, Id");} else {INST_NAME("XOR Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; + if (opcode == 0x81) { + INST_NAME("XOR Ed, Id"); + } else { + INST_NAME("XOR Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED((opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; emit_xor32c(dyn, ninst, rex, ed, i64, x3, x4); WBACK; break; case 7: // CMP - if(opcode==0x81) {INST_NAME("CMP Ed, Id");} else {INST_NAME("CMP Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - if(i64) { - MOV64xw(x2, i64); - emit_cmp32(dyn, ninst, rex, ed, x2, x3, x4, x5, x6); + if (opcode == 0x81) { + INST_NAME("CMP Ed, Id"); } else { - if(!rex.w && MODREG) { - AND(x1, ed, xMASK); - ed = x1; - } - emit_cmp32_0(dyn, ninst, rex, ed, x3, x4); + INST_NAME("CMP Ed, Ib"); } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED((opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; + if (i64) { + MOV64x(x2, i64); + emit_cmp32(dyn, ninst, rex, ed, x2, x3, x4, x5, x6); + } else + emit_cmp32_0(dyn, ninst, rex, nextop, ed, x3, x4, x5); break; } break; case 0x84: INST_NAME("TEST Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop=F8; + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; GETEB(x1, 0); - GETGB(x2); - emit_test8(dyn, ninst, x1, x2, x3, x4, x5); + if (GB_EQ_EB()) + u8 = x1; + else { + GETGB(x2); + u8 = x2; + } + emit_test8(dyn, ninst, x1, u8, x6, x4, x5); break; case 0x85: INST_NAME("TEST Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop=F8; + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + nextop = F8; GETGD; GETED(0); emit_test32(dyn, ninst, rex, ed, gd, x3, x4, x5); @@ -228,7 +282,7 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x86: INST_NAME("(LOCK) XCHG Eb, Gb"); nextop = F8; - if(MODREG) { + if (MODREG) { GETGB(x1); GETEB(x2, 0); MV(x4, gd); @@ -239,99 +293,92 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } else { GETGB(x3); addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - SMDMB(); // calculate shift amount ANDI(x1, ed, 0x3); SLLI(x1, x1, 3); // align address to 4-bytes to use ll.w/sc.w - ADDI(x4, xZR, 0xffc); - AND(x6, ed, x4); + ANDI(x6, ed, ~3); - // load aligned data - LWU(x5, x6, 0); - - // insert gd byte into the aligned data + // prepare mask ADDI(x4, xZR, 0xff); SLL(x4, x4, x1); NOT(x4, x4); - AND(x4, x5, x4); - SLL(x5, gd, x1); - OR(x4, x4, x5); + SLL(x7, gd, x1); - // do aligned ll/sc sequence + // do aligned ll/sc sequence, reusing x2 (ed might be x2 but is no longer needed) MARKLOCK; - LR_W(x1, x6, 1, 1); - SC_W(x5, x4, x6, 1, 1); + LR_W(x2, x6, 1, 1); + AND(x5, x2, x4); + OR(x5, x5, x7); + SC_W(x5, x5, x6, 1, 1); BNEZ_MARKLOCK(x5); - // calculate shift amount again - ANDI(x4, ed, 0x3); - SLLI(x4, x4, 3); - // extract loaded byte - SRL(x1, x1, x4); + SRL(gd, x2, x1); + ANDI(gd, gd, 0xff); - gd = x1; - GBBACK(x3); + GBBACK(x5); } break; case 0x87: - INST_NAME("(LOCK)XCHG Ed, Gd"); + INST_NAME("(LOCK) XCHG Ed, Gd"); nextop = F8; - if(MODREG) { + if (MODREG) { GETGD; GETED(0); - MVxw(x1, gd); + MVxw(x3, gd); MVxw(gd, ed); - MVxw(ed, x1); + MVxw(ed, x3); } else { GETGD; addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - SMDMB(); - ANDI(x3, ed, (1<<(2+rex.w))-1); + ANDI(x3, ed, (1 << (2 + rex.w)) - 1); BNE_MARK(x3, xZR); - MARKLOCK; - LRxw(x1, ed, 1, 0); - SCxw(x3, gd, ed, 0, 1); - BNE_MARKLOCK(x3, xZR); - B_MARK2_nocond; + AMOSWAPxw(gd, gd, ed, 1, 1); + if (!rex.w) ZEROUP(gd); + B_NEXT_nocond; MARK; + // Unaligned + ANDI(x5, ed, -(1 << (rex.w + 2))); + MARKLOCK; LDxw(x1, ed, 0); + LRxw(x3, x5, 1, 1); + SCxw(x4, x3, x5, 1, 1); + BNEZ_MARKLOCK(x4); SDxw(gd, ed, 0); - MARK2; - SMDMB(); MVxw(gd, x1); + SMDMB(); } break; case 0x88: INST_NAME("MOV Eb, Gb"); nextop = F8; - gd = ((nextop&0x38)>>3)+(rex.r<<3); - if(rex.rex) { + gd = ((nextop & 0x38) >> 3) + (rex.r << 3); + if (rex.rex) { gb2 = 0; - gb1 = xRAX + gd; + gb1 = TO_NAT(gd); } else { - gb2 = ((gd&4)>>2); - gb1 = xRAX+(gd&3); + gb2 = ((gd & 4) >> 2); + gb1 = TO_NAT(gd & 3); } gd = x4; - if(gb2) { + if (gb2) { SRLI(x4, gb1, 8); gb1 = x4; } - if(MODREG) { - ed = (nextop&7) + (rex.b<<3); - if(rex.rex) { - eb1 = xRAX+ed; + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + if (rex.rex) { + eb1 = TO_NAT(ed); eb2 = 0; } else { - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx - eb2 = ((ed&4)>>2); // L or H + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx + eb2 = ((ed & 4) >> 2); // L or H } ANDI(gd, gb1, 0xff); - if(eb2) { + if (eb2) { MOV64x(x1, 0xffffffffffff00ffLL); AND(x1, eb1, x1); SLLI(gd, gd, 8); @@ -348,38 +395,56 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x89: INST_NAME("MOV Ed, Gd"); - nextop=F8; + nextop = F8; GETGD; - if(MODREG) { // reg <= reg - MVxw(xRAX+(nextop&7)+(rex.b<<3), gd); - } else { // mem <= reg - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); - SDxw(gd, ed, fixedaddress); + if (MODREG) { // reg <= reg + SCRATCH_USAGE(0); + MVxw(TO_NAT((nextop & 7) + (rex.b << 3)), gd); + } else { // mem <= reg + IF_UNALIGNED(ip) { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, (1 << (2 + rex.w)) - 1, 0); + for (int i = 0; i < (1 << (2 + rex.w)); i++) { + if (i == 0) { + SB(gd, ed, fixedaddress); + } else { + SRLI(x3, gd, i * 8); + SB(x3, ed, fixedaddress + i); + } + } + } else { + SCRATCH_USAGE(0); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); + if(!lock && BOX64ENV(unity) && !VolatileRangesContains(ip) && ((fixedaddress==0x80) || (fixedaddress==0x84) || (fixedaddress==0xc0) || (fixedaddress==0xc4))) { + DMB_ISH(); + lock = 1; + } + SDxw(gd, ed, fixedaddress); + } SMWRITELOCK(lock); } break; case 0x8A: INST_NAME("MOV Gb, Eb"); nextop = F8; - gd = ((nextop&0x38)>>3)+(rex.r<<3); - if(rex.rex) { + gd = ((nextop & 0x38) >> 3) + (rex.r << 3); + if (rex.rex) { gb2 = 0; - gb1 = xRAX + gd; + gb1 = TO_NAT(gd); } else { - gb2 = ((gd&4)>>2); - gb1 = xRAX+(gd&3); + gb2 = ((gd & 4) >> 2); + gb1 = TO_NAT(gd & 3); } gd = x4; - if(MODREG) { - ed = (nextop&7) + (rex.b<<3); - if(rex.rex) { - eb1 = xRAX+ed; + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + if (rex.rex) { + eb1 = TO_NAT(ed); eb2 = 0; } else { - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx - eb2 = ((ed&4)>>2); // L or H + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx + eb2 = ((ed & 4) >> 2); // L or H } - if(eb2) { + if (eb2) { SRLI(x1, eb1, 8); ANDI(x1, x1, 0xff); } else { @@ -390,7 +455,7 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int SMREADLOCK(lock); LBU(x1, ed, fixedaddress); } - if(gb2) { + if (gb2) { MOV64x(x4, ~0xff00); AND(gb1, gb1, x4); SLLI(x1, x1, 8); @@ -401,38 +466,49 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x8B: INST_NAME("MOV Gd, Ed"); - nextop=F8; + nextop = F8; GETGD; - if(MODREG) { - MVxw(gd, xRAX+(nextop&7)+(rex.b<<3)); + SCRATCH_USAGE(0); + if (MODREG) { + MVxw(gd, TO_NAT((nextop & 7) + (rex.b << 3))); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); + if(!lock && BOX64ENV(unity) && !VolatileRangesContains(ip) && ((fixedaddress==0x80) || (fixedaddress==0x84) || (fixedaddress==0xc0) || (fixedaddress==0xc4))) { + lock = 1; + } SMREADLOCK(lock); LDxw(gd, ed, fixedaddress); } break; case 0x8C: INST_NAME("MOV Ed, Seg"); - nextop=F8; - if((nextop&0xC0)==0xC0) { // reg <= seg - LHU(xRAX+(nextop&7)+(rex.b<<3), xEmu, offsetof(x64emu_t, segs[(nextop&0x38)>>3])); - } else { // mem <= seg + nextop = F8; + if (MODREG) { + SCRATCH_USAGE(0); + LHU(TO_NAT((nextop & 7) + (rex.b << 3)), xEmu, offsetof(x64emu_t, segs[(nextop & 0x38) >> 3])); + } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - LHU(x3, xEmu, offsetof(x64emu_t, segs[(nextop&0x38)>>3])); + LHU(x3, xEmu, offsetof(x64emu_t, segs[(nextop & 0x38) >> 3])); SH(x3, ed, fixedaddress); SMWRITE2(); } break; case 0x8D: INST_NAME("LEA Gd, Ed"); - nextop=F8; + nextop = F8; GETGD; - if(MODREG) { // reg <= reg? that's an invalid operation + if (MODREG) { // reg <= reg? that's an invalid operation DEFAULT; - } else { // mem <= reg - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 0, 0); - MV(gd, ed); - if(!rex.w || rex.is32bits) { + } else { // mem <= reg + rex.seg = 0; // to be safe + SCRATCH_USAGE(0); + addr = geted(dyn, addr, ninst, nextop, &ed, gd, x1, &fixedaddress, rex, NULL, 0, 0); + if (gd != ed) { + if (rex.w && rex.is67) + ZEXTW2(gd, ed); + else + MVxw(gd, ed); + } else if (!rex.w && !rex.is32bits) { ZEROUP(gd); // truncate the higher 32bits as asked } } @@ -440,32 +516,38 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x8E: INST_NAME("MOV Seg,Ew"); nextop = F8; - if((nextop&0xC0)==0xC0) { - ed = xRAX+(nextop&7)+(rex.b<<3); + u8 = (nextop & 0x38) >> 3; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); } else { SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); LHU(x1, ed, fixedaddress); ed = x1; } - SH(ed, xEmu, offsetof(x64emu_t, segs[(nextop&0x38)>>3])); - SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[(nextop&0x38)>>3])); + SH(ed, xEmu, offsetof(x64emu_t, segs[u8])); + if((u8==_FS) || (u8==_GS)) { + // refresh offset if needed + CBZ_NEXT(ed); + MOV32w(x1, u8); + CALL(const_getsegmentbase, -1, x1, x2); + } break; case 0x8F: INST_NAME("POP Ed"); nextop = F8; - if(MODREG) { - POP1z(xRAX+(nextop&7)+(rex.b<<3)); + if (MODREG) { + POP1z(TO_NAT((nextop & 7) + (rex.b << 3))); } else { POP1z(x2); // so this can handle POP [ESP] and maybe some variant too - addr = geted(dyn, addr, ninst, nextop, &ed, x3, x1, &fixedaddress, rex, &lock, 1, 0); - if(ed==xRSP) { + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x1, &fixedaddress, rex, NULL, 1, 0); + if (ed == xRSP) { SDz(x2, ed, fixedaddress); } else { // complicated to just allow a segfault that can be recovered correctly - ADDIz(xRSP, xRSP, rex.is32bits?-4:-8); + ADDIz(xRSP, xRSP, rex.is32bits ? -4 : -8); SDz(x2, ed, fixedaddress); - ADDIz(xRSP, xRSP, rex.is32bits?4:8); + ADDIz(xRSP, xRSP, rex.is32bits ? 4 : 8); } } break; @@ -477,8 +559,8 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x95: case 0x96: case 0x97: - gd = xRAX+(opcode&0x07)+(rex.b<<3); - if(gd==xRAX) { + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); + if (gd == xRAX) { INST_NAME("NOP"); } else { INST_NAME("XCHG EAX, Reg"); @@ -489,7 +571,7 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x98: INST_NAME("CWDE"); - if(rex.w) { + if (rex.w) { SEXT_W(xRAX, xRAX); } else { SLLI(xRAX, xRAX, 16); @@ -499,7 +581,7 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x99: INST_NAME("CDQ"); - if(rex.w) { + if (rex.w) { SRAI(xRDX, xRAX, 63); } else { SLLI(xRDX, xRAX, 32); @@ -512,30 +594,32 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0x9C: INST_NAME("PUSHF"); - NOTEST(x1); READFLAGS(X_ALL); FLAGS_ADJUST_TO11(x3, xFlags, x2); PUSH1z(x3); break; case 0x9D: INST_NAME("POPF"); - SETFLAGS(X_ALL, SF_SET); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); POP1z(xFlags); FLAGS_ADJUST_FROM11(xFlags, xFlags, x2); - MOV32w(x1, 0x3F7FD7); + MOV32w(x1, 0x3E7FF7); AND(xFlags, xFlags, x1); ORI(xFlags, xFlags, 0x202); SET_DFNONE(); - if(box64_wine) { // should this be done all the time? + if (box64_wine) { // should this be done all the time? ANDI(x1, xFlags, 1 << F_TF); CBZ_NEXT(x1); - // go to epilog, TF should trigger at end of next opcode, so using Interpretor only + // go to epilog, TF should trigger at end of next opcode, so using Interpreter only + LWU(x4, xEmu, offsetof(x64emu_t, flags)); + ORI(x4, x4, 1< #include #include -#include #include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,16 +18,17 @@ #include "x64trace.h" #include "dynarec_native.h" #include "custommem.h" +#include "alternate.h" #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" int isSimpleWrapper(wrapper_t fun); int isRetX87Wrapper(wrapper_t fun); -uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { uint8_t nextop, opcode; uint8_t gd, ed; @@ -52,50 +52,50 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int MAYUSE(lock); MAYUSE(cacheupd); - switch(opcode) { + switch (opcode) { case 0xC0: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: INST_NAME("ROL Eb, Ib"); MESSAGE(LOG_DUMP, "Need Optimization\n"); - SETFLAGS(X_OF|X_CF, SF_SET_DF); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); GETEB(x1, 1); u8 = F8; MOV32w(x2, u8); - CALL_(rol8, ed, x3); + CALL_(const_rol8, ed, x3, x1, x2); EBBACK(x5, 0); break; case 1: INST_NAME("ROR Eb, Ib"); MESSAGE(LOG_DUMP, "Need Optimization\n"); - SETFLAGS(X_OF|X_CF, SF_SET_DF); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); GETEB(x1, 1); u8 = F8; MOV32w(x2, u8); - CALL_(ror8, ed, x3); + CALL_(const_ror8, ed, x3, x1, x2); EBBACK(x5, 0); break; case 2: INST_NAME("RCL Eb, Ib"); MESSAGE(LOG_DUMP, "Need Optimization\n"); READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); GETEB(x1, 1); u8 = F8; MOV32w(x2, u8); - CALL_(rcl8, ed, x3); + CALL_(const_rcl8, ed, x3, x1, x2); EBBACK(x5, 0); break; case 3: INST_NAME("RCR Eb, Ib"); MESSAGE(LOG_DUMP, "Need Optimization\n"); READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); GETEB(x1, 1); u8 = F8; MOV32w(x2, u8); - CALL_(rcr8, ed, x3); + CALL_(const_rcr8, ed, x3, x1, x2); EBBACK(x5, 0); break; case 4: @@ -103,7 +103,7 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("SHL Eb, Ib"); u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; if (u8) { - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = (F8) & 0x1f; emit_shl8c(dyn, ninst, ed, u8, x4, x5, x6); @@ -117,7 +117,7 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("SHR Eb, Ib"); u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; if (u8) { - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 1); u8 = (F8) & 0x1f; emit_shr8c(dyn, ninst, ed, u8, x4, x5, x6); @@ -131,7 +131,7 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("SAR Eb, Ib"); u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; if (u8) { - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETSEB(x1, 1); u8 = (F8) & 0x1f; emit_sar8c(dyn, ninst, ed, u8, x4, x5, x6); @@ -147,13 +147,13 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0xC1: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: INST_NAME("ROL Ed, Ib"); u8 = geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 0x3f : 0x1f); // flags are not affected if count is 0, we make it a nop if possible. if (u8) { - SETFLAGS(X_OF | X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF | X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); GETED(1); F8; emit_rol32c(dyn, ninst, rex, ed, u8, x3, x4); @@ -173,7 +173,7 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int u8 = geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 0x3f : 0x1f); // flags are not affected if count is 0, we make it a nop if possible. if (u8) { - SETFLAGS(X_OF | X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF | X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); GETED(1); F8; emit_ror32c(dyn, ninst, rex, ed, u8, x3, x4); @@ -192,25 +192,25 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("RCL Ed, Ib"); MESSAGE(LOG_DUMP, "Need Optimization\n"); READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - u8 = (F8)&(rex.w?0x3f:0x1f); - MOV32w(x2, u8); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); GETEDW(x4, x1, 0); - CALL_(rex.w?((void*)rcl64):((void*)rcl32), ed, x4); + u8 = (F8) & (rex.w ? 0x3f : 0x1f); + MOV32w(x2, u8); + CALL_(rex.w ? (const_rcl64) : (const_rcl32), ed, x4, x1, x2); WBACK; - if(!wback && !rex.w) ZEROUP(ed); + if (!wback && !rex.w) ZEROUP(ed); break; case 3: INST_NAME("RCR Ed, Ib"); MESSAGE(LOG_DUMP, "Need Optimization\n"); READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - u8 = (F8)&(rex.w?0x3f:0x1f); - MOV32w(x2, u8); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); GETEDW(x4, x1, 0); - CALL_(rex.w?((void*)rcr64):((void*)rcr32), ed, x4); + u8 = (F8) & (rex.w ? 0x3f : 0x1f); + MOV32w(x2, u8); + CALL_(rex.w ? (const_rcr64) : (const_rcr32), ed, x4, x1, x2); WBACK; - if(!wback && !rex.w) ZEROUP(ed); + if (!wback && !rex.w) ZEROUP(ed); break; case 4: case 6: @@ -218,7 +218,7 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int u8 = geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 0x3f : 0x1f); // flags are not affected if count is 0, we make it a nop if possible. if (u8) { - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED(1); F8; emit_shl32c(dyn, ninst, rex, ed, u8, x3, x4, x5); @@ -238,7 +238,7 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int u8 = geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 0x3f : 0x1f); // flags are not affected if count is 0, we make it a nop if possible. if (u8) { - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED(1); F8; emit_shr32c(dyn, ninst, rex, ed, u8, x3, x4); @@ -258,7 +258,7 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int u8 = geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 0x3f : 0x1f); // flags are not affected if count is 0, we make it a nop if possible. if (u8) { - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED(1); F8; emit_sar32c(dyn, ninst, rex, ed, u8, x3, x4); @@ -279,39 +279,77 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0xC2: INST_NAME("RETN"); - //SETFLAGS(X_ALL, SF_SET_NODF); // Hack, set all flags (to an unknown state...) - if(box64_dynarec_safeflags) { - READFLAGS(X_PEND); // lets play safe here too + // SETFLAGS(X_ALL, SF_SET_NODF); // Hack, set all flags (to an unknown state...) + if (BOX64DRENV(dynarec_safeflags)) { + READFLAGS(X_PEND); // lets play safe here too } - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); // using next, even if there no next + fpu_purgecache(dyn, ninst, 1, x1, x2, x3); // using next, even if there no next i32 = F16; - retn_to_epilog(dyn, ninst, rex, i32); + retn_to_epilog(dyn, ip, ninst, rex, i32); *need_epilog = 0; *ok = 0; break; case 0xC3: INST_NAME("RET"); // SETFLAGS(X_ALL, SF_SET_NODF); // Hack, set all flags (to an unknown state...) - if(box64_dynarec_safeflags) { - READFLAGS(X_PEND); // so instead, force the deferred flags, so it's not too slow, and flags are not lost + if (BOX64DRENV(dynarec_safeflags)) { + READFLAGS(X_PEND); // so instead, force the deferred flags, so it's not too slow, and flags are not lost } - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); // using next, even if there no next - ret_to_epilog(dyn, ninst, rex); + fpu_purgecache(dyn, ninst, 1, x1, x2, x3); // using next, even if there no next + ret_to_epilog(dyn, ip, ninst, rex); *need_epilog = 0; *ok = 0; break; - + case 0xC4: + nextop = F8; + if (rex.is32bits && !(MODREG)) { + DEFAULT; + } else { + vex_t vex = { 0 }; + vex.rex = rex; + u8 = nextop; + vex.m = u8 & 0b00011111; + vex.rex.b = (u8 & 0b00100000) ? 0 : 1; + vex.rex.x = (u8 & 0b01000000) ? 0 : 1; + vex.rex.r = (u8 & 0b10000000) ? 0 : 1; + u8 = F8; + vex.p = u8 & 0b00000011; + vex.l = (u8 >> 2) & 1; + vex.v = ((~u8) >> 3) & 0b1111; + vex.rex.w = (u8 >> 7) & 1; + addr = dynarec64_AVX(dyn, addr, ip, ninst, vex, ok, need_epilog); + } + break; + case 0xC5: + nextop = F8; + if (rex.is32bits && !(MODREG)) { + DEFAULT; + } else { + vex_t vex = { 0 }; + vex.rex = rex; + u8 = nextop; + vex.p = u8 & 0b00000011; + vex.l = (u8 >> 2) & 1; + vex.v = ((~u8) >> 3) & 0b1111; + vex.rex.r = (u8 & 0b10000000) ? 0 : 1; + vex.rex.b = 0; + vex.rex.x = 0; + vex.rex.w = 0; + vex.m = VEX_M_0F; + addr = dynarec64_AVX(dyn, addr, ip, ninst, vex, ok, need_epilog); + } + break; case 0xC6: INST_NAME("MOV Eb, Ib"); - nextop=F8; - if(MODREG) { // reg <= u8 + nextop = F8; + if (MODREG) { // reg <= u8 u8 = F8; - if(!rex.rex) { - ed = (nextop&7); - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx - eb2 = (ed&4)>>2; // L or H + if (!rex.rex) { + ed = (nextop & 7); + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx + eb2 = (ed & 4) >> 2; // L or H } else { - eb1 = xRAX+(nextop&7)+(rex.b<<3); + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); eb2 = 0; } @@ -321,9 +359,9 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ORI(x3, x3, 0xff); // apply mask AND(eb1, eb1, x3); - if(u8) { - if((u8<<8)<2048) { - ADDI(x4, xZR, u8<<8); + if (u8) { + if ((u8 << 8) < 2048) { + ADDI(x4, xZR, u8 << 8); } else { ADDI(x4, xZR, u8); SLLI(x4, x4, 8); @@ -331,13 +369,15 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int OR(eb1, eb1, x4); } } else { - ANDI(eb1, eb1, 0xf00); // mask ffffffffffffff00 + ANDI(eb1, eb1, 0xf00); // mask ffffffffffffff00 ORI(eb1, eb1, u8); } - } else { // mem <= u8 - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, &lock, 0, 1); + } else { // mem <= u8 + SCRATCH_USAGE(0); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, &lock, 1, 1); u8 = F8; - if(u8) { + if (u8) { + SCRATCH_USAGE(1); ADDI(x3, xZR, u8); ed = x3; } else @@ -348,20 +388,41 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0xC7: INST_NAME("MOV Ed, Id"); - nextop=F8; - if(MODREG) { // reg <= i32 + nextop = F8; + if (MODREG) { // reg <= i32 + SCRATCH_USAGE(0); i64 = F32S; - ed = xRAX+(nextop&7)+(rex.b<<3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); MOV64xw(ed, i64); - } else { // mem <= i32 - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, &lock, 0, 4); - i64 = F32S; - if(i64) { - MOV64xw(x3, i64); - ed = x3; - } else - ed = xZR; - SDxw(ed, wback, fixedaddress); + } else { // mem <= i32 + IF_UNALIGNED(ip) { + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, &lock, (1 << (2 + rex.w)) - 1, 4); + i64 = F32S; + if (i64) { + MOV64x(x4, i64); + ed = x4; + } else + ed = xZR; + for (int i = 0; i < (1 << (2 + rex.w)); i++) { + if (i == 0 || ed == xZR) { + SB(ed, wback, fixedaddress + i); + } else { + SRLI(x3, ed, i * 8); + SB(x3, wback, fixedaddress + i); + } + } + } else { + SCRATCH_USAGE(0); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, &lock, 1, 4); + i64 = F32S; + if (i64) { + SCRATCH_USAGE(1); + MOV64x(x3, i64); + ed = x3; + } else + ed = xZR; + SDxw(ed, wback, fixedaddress); + } SMWRITELOCK(lock); } break; @@ -373,87 +434,89 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0xCC: - SETFLAGS(X_ALL, SF_SET_NODF); // Hack, set all flags (to an unknown state...) + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack, set all flags (to an unknown state...) SKIPTEST(x1); - if(PK(0)=='S' && PK(1)=='C') { - addr+=2; + if (IsBridgeSignature(PK(0), PK(1))) { + addr += 2; BARRIER(BARRIER_FLOAT); INST_NAME("Special Box64 instruction"); - if((PK64(0)==0)) - { - addr+=8; + if ((PK64(0) == 0)) { + addr += 8; MESSAGE(LOG_DEBUG, "Exit x64 Emu\n"); - //GETIP(ip+1+2); // no use - //STORE_XEMU_REGS(xRIP); // no need, done in epilog MOV64x(x1, 1); SW(x1, xEmu, offsetof(x64emu_t, quit)); *ok = 0; *need_epilog = 1; } else { MESSAGE(LOG_DUMP, "Native Call to %s\n", GetNativeName(GetNativeFnc(ip))); + x87_stackcount(dyn, ninst, x1); x87_forget(dyn, ninst, x3, x4, 0); sse_purge07cache(dyn, ninst, x3); // Partially support isSimpleWrapper tmp = isSimpleWrapper(*(wrapper_t*)(addr)); - if(isRetX87Wrapper(*(wrapper_t*)(addr))) + if (isRetX87Wrapper(*(wrapper_t*)(addr))) // return value will be on the stack, so the stack depth needs to be updated x87_purgecache(dyn, ninst, 0, x3, x1, x4); - if (tmp < 0 || tmp > 1) + if (tmp < 0 || (tmp & 15) > 1) tmp = 0; // TODO: removed when FP is in place - if((box64_log<2 && !cycle_log) && tmp) { - //GETIP(ip+3+8+8); // read the 0xCC - call_n(dyn, ninst, *(void**)(addr+8), tmp); - addr+=8+8; + if ((BOX64ENV(log) < 2 && !BOX64ENV(rolling_log)) && tmp) { + call_n(dyn, ninst, (void*)(addr + 8), tmp); + addr += 8 + 8; } else { - GETIP(ip+1); // read the 0xCC + GETIP(ip + 1, x7); // read the 0xCC STORE_XEMU_CALL(x3); + ADDI(x3, xRIP, 8 + 8 + 2); // expected return address ADDI(x1, xEmu, (uint32_t)offsetof(x64emu_t, ip)); // setup addr as &emu->ip - CALL_S(x64Int3, -1); + CALL_(const_int3, -1, x3, x1, 0); LOAD_XEMU_CALL(); - addr+=8+8; - TABLE64(x3, addr); // expected return address + addr += 8 + 8; BNE_MARK(xRIP, x3); - LW(w1, xEmu, offsetof(x64emu_t, quit)); - CBZ_NEXT(w1); + LW(x1, xEmu, offsetof(x64emu_t, quit)); + CBZ_NEXT(x1); MARK; jump_to_epilog_fast(dyn, 0, xRIP, ninst); } } } else { - if(!box64_ignoreint3) { - INST_NAME("INT 3"); + INST_NAME("INT 3"); + if (!BOX64ENV(ignoreint3)) { // check if TRAP signal is handled - LD(x1, xEmu, offsetof(x64emu_t, context)); - MOV64x(x2, offsetof(box64context_t, signals[SIGTRAP])); + TABLE64C(x1, const_context); + MOV32w(x2, offsetof(box64context_t, signals[X64_SIGTRAP])); ADD(x2, x2, x1); LD(x3, x2, 0); - CBZ_NEXT(x3); - GETIP(ip); + BEQZ_MARK(x3); + GETIP(addr, x7); STORE_XEMU_CALL(x3); - CALL(native_int3, -1); + CALL(const_native_int3, -1, 0, 0); LOAD_XEMU_CALL(); + MARK; + jump_to_epilog(dyn, addr, 0, ninst); + *need_epilog = 0; + *ok = 0; } break; } break; case 0xCD: u8 = F8; - if (box64_wine && (u8==0x2D || u8==0x2C || u8==0x29)) { + NOTEST(x1); + if (box64_wine && (u8 == 0x2D || u8 == 0x2C || u8 == 0x29)) { INST_NAME("INT 29/2c/2d"); // lets do nothing MESSAGE(LOG_INFO, "INT 29/2c/2d Windows interruption\n"); - GETIP(ip); + GETIP(ip, x7); // priviledged instruction, IP not updated STORE_XEMU_CALL(x3); MOV32w(x1, u8); - CALL(native_int, -1); + CALL(const_native_int, -1, x1, 0); LOAD_XEMU_CALL(); } else if (u8 == 0x80) { INST_NAME("32bits SYSCALL"); NOTEST(x1); SMEND(); - GETIP(addr); + GETIP(addr, x7); STORE_XEMU_CALL(x3); - CALL_S(x86Syscall, -1); + CALL_S(const_x86syscall, -1, 0); LOAD_XEMU_CALL(); TABLE64(x3, addr); // expected return address BNE_MARK(xRIP, x3); @@ -462,12 +525,30 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int MARK; LOAD_XEMU_REM(x3); jump_to_epilog(dyn, 0, xRIP, ninst); + } else if (u8 == 0x03) { + INST_NAME("INT 3"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(addr, x7); + STORE_XEMU_CALL(x3); + CALL(const_native_int3, -1, 0, 0); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; } else { INST_NAME("INT n"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state - GETIP(ip); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); // priviledged instruction, IP not updated STORE_XEMU_CALL(x3); - CALL(native_priv, -1); + CALL(const_native_priv, -1, 0, 0); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; @@ -476,120 +557,133 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0xCF: INST_NAME("IRET"); - SETFLAGS(X_ALL, SF_SET_NODF); // Not a hack, EFLAGS are restored + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Not a hack, EFLAGS are restored BARRIER(BARRIER_FLOAT); - iret_to_epilog(dyn, ninst, rex.w); + iret_to_epilog(dyn, ip, ninst, rex.w); *need_epilog = 0; *ok = 0; break; case 0xD0: - case 0xD2: // TODO: Jump if CL is 0 + case 0xD2: // TODO: Jump if CL is 0 nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: - if(opcode==0xD0) { + if (opcode == 0xD0) { INST_NAME("ROL Eb, 1"); + GETEB(x1, 0); MOV32w(x2, 1); } else { INST_NAME("ROL Eb, CL"); + GETEB(x1, 0); ANDI(x2, xRCX, 0x1f); } MESSAGE(LOG_DUMP, "Need Optimization\n"); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - GETEB(x1, 0); - CALL_(rol8, ed, x3); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); + CALL_(const_rol8, ed, x3, x1, x2); EBBACK(x5, 0); break; case 1: - if(opcode==0xD0) { + if (opcode == 0xD0) { INST_NAME("ROR Eb, 1"); + GETEB(x1, 0); MOV32w(x2, 1); } else { INST_NAME("ROR Eb, CL"); + GETEB(x1, 0); ANDI(x2, xRCX, 0x1f); } MESSAGE(LOG_DUMP, "Need Optimization\n"); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - GETEB(x1, 0); - CALL_(ror8, ed, x3); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); + CALL_(const_ror8, ed, x3, x1, x2); EBBACK(x5, 0); break; case 2: - if(opcode==0xD0) { + if (opcode == 0xD0) { INST_NAME("RCL Eb, 1"); + GETEB(x1, 0); MOV32w(x2, 1); } else { INST_NAME("RCL Eb, CL"); + GETEB(x1, 0); ANDI(x2, xRCX, 0x1f); } MESSAGE(LOG_DUMP, "Need Optimization\n"); READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - GETEB(x1, 0); - CALL_(rcl8, ed, x3); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); + CALL_(const_rcl8, ed, x3, x1, x2); EBBACK(x5, 0); break; case 3: - if(opcode==0xD0) { + if (opcode == 0xD0) { INST_NAME("RCR Eb, 1"); + GETEB(x1, 0); MOV32w(x2, 1); } else { INST_NAME("RCR Eb, CL"); + GETEB(x1, 0); ANDI(x2, xRCX, 0x1f); } MESSAGE(LOG_DUMP, "Need Optimization\n"); READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - GETEB(x1, 0); - CALL_(rcr8, ed, x3); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); + CALL_(const_rcr8, ed, x3, x1, x2); EBBACK(x5, 0); break; case 4: case 6: - if(opcode==0xD0) { + if (opcode == 0xD0) { INST_NAME("SHL Eb, 1"); + GETEB(x1, 0); MOV32w(x2, 1); } else { INST_NAME("SHL Eb, CL"); + GETEB(x1, 0); ANDI(x2, xRCX, 0x1f); BEQ_NEXT(x2, xZR); } - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); - GETEB(x1, 0); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); emit_shl8(dyn, ninst, x1, x2, x5, x4, x6); EBBACK(x5, 0); break; case 5: - if(opcode==0xD0) { + if (opcode == 0xD0) { INST_NAME("SHR Eb, 1"); + GETEB(x1, 0); MOV32w(x2, 1); } else { INST_NAME("SHR Eb, CL"); + GETEB(x1, 0); ANDI(x2, xRCX, 0x1F); BEQ_NEXT(x2, xZR); } - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); - GETEB(x1, 0); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); emit_shr8(dyn, ninst, x1, x2, x5, x4, x6); EBBACK(x5, 0); break; case 7: - if(opcode==0xD0) { + if (opcode == 0xD0) { INST_NAME("SAR Eb, 1"); + GETSEB(x1, 0); MOV32w(x2, 1); } else { INST_NAME("SAR Eb, CL"); + GETSEB(x1, 0); ANDI(x2, xRCX, 0x1f); BEQ_NEXT(x2, xZR); } - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); - GETSEB(x1, 0); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); emit_sar8(dyn, ninst, x1, x2, x5, x4, x6); EBBACK(x5, 0); break; @@ -599,63 +693,63 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0xD1: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: INST_NAME("ROL Ed, 1"); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF | X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); GETED(0); emit_rol32c(dyn, ninst, rex, ed, 1, x3, x4); WBACK; - if(!wback && !rex.w) ZEROUP(ed); + if (!wback && !rex.w) ZEROUP(ed); break; case 1: INST_NAME("ROR Ed, 1"); - SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_OF | X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); GETED(0); emit_ror32c(dyn, ninst, rex, ed, 1, x3, x4); WBACK; - if(!wback && !rex.w) ZEROUP(ed); + if (!wback && !rex.w) ZEROUP(ed); break; case 2: INST_NAME("RCL Ed, 1"); MESSAGE("LOG_DUMP", "Need optimization\n"); READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); MOV32w(x2, 1); GETEDW(x4, x1, 0); - CALL_(rex.w ? ((void*)rcl64) : ((void*)rcl32), ed, x4); + CALL_(rex.w ? (const_rcl64) : (const_rcl32), ed, x4, x1, x2); WBACK; - if(!wback && !rex.w) ZEROUP(ed); + if (!wback && !rex.w) ZEROUP(ed); break; case 3: INST_NAME("RCR Ed, 1"); MESSAGE(LOG_DUMP, "Need Optimization\n"); READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); MOV32w(x2, 1); GETEDW(x4, x1, 0); - CALL_(rex.w?((void*)rcr64):((void*)rcr32), ed, x4); + CALL_(rex.w ? (const_rcr64) : (const_rcr32), ed, x4, x1, x2); WBACK; - if(!wback && !rex.w) ZEROUP(ed); + if (!wback && !rex.w) ZEROUP(ed); break; case 4: case 6: INST_NAME("SHL Ed, 1"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined GETED(0); emit_shl32c(dyn, ninst, rex, ed, 1, x3, x4, x5); WBACK; break; case 5: INST_NAME("SHR Ed, 1"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined GETED(0); emit_shr32c(dyn, ninst, rex, ed, 1, x3, x4); WBACK; break; case 7: INST_NAME("SAR Ed, 1"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined GETED(0); emit_sar32c(dyn, ninst, rex, ed, 1, x3, x4); WBACK; @@ -667,78 +761,110 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0xD3: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: INST_NAME("ROL Ed, CL"); - SETFLAGS(X_OF|X_CF, SF_SUBSET); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); GETED(0); - emit_rol32(dyn, ninst, rex, ed, xRCX, x3, x4); + ANDI(x6, xRCX, rex.w ? 0x3f : 0x1f); + emit_rol32(dyn, ninst, rex, ed, x6, x3, x4); WBACK; - if(!wback && !rex.w) ZEROUP(ed); + if (!wback && !rex.w) ZEROUP(ed); break; case 1: INST_NAME("ROR Ed, CL"); - SETFLAGS(X_OF|X_CF, SF_SUBSET); + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); GETED(0); - emit_ror32(dyn, ninst, rex, ed, xRCX, x3, x4); + ANDI(x6, xRCX, rex.w ? 0x3f : 0x1f); + emit_ror32(dyn, ninst, rex, ed, x6, x3, x4); WBACK; - if(!wback && !rex.w) ZEROUP(ed); + if (!wback && !rex.w) ZEROUP(ed); break; case 2: INST_NAME("RCL Ed, CL"); MESSAGE("LOG_DUMP", "Need optimization\n"); READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - ANDI(x2, xRCX, rex.w?0x3f:0x1f); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); + ANDI(x2, xRCX, rex.w ? 0x3f : 0x1f); GETEDW(x4, x1, 0); - CALL_(rex.w ? ((void*)rcl64) : ((void*)rcl32), ed, x4); + CALL_(rex.w ? (const_rcl64) : (const_rcl32), ed, x4, x1, x2); WBACK; - if(!wback && !rex.w) ZEROUP(ed); + if (!wback && !rex.w) ZEROUP(ed); break; case 3: INST_NAME("RCR Ed, CL"); MESSAGE(LOG_DUMP, "Need Optimization\n"); READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - ANDI(x2, xRCX, rex.w?0x3f:0x1f); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); + ANDI(x2, xRCX, rex.w ? 0x3f : 0x1f); GETEDW(x4, x1, 0); - CALL_(rex.w?((void*)rcr64):((void*)rcr32), ed, x4); + CALL_(rex.w ? (const_rcr64) : (const_rcr32), ed, x4, x1, x2); WBACK; - if(!wback && !rex.w) ZEROUP(ed); + if (!wback && !rex.w) ZEROUP(ed); break; case 4: case 6: INST_NAME("SHL Ed, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - ANDI(x3, xRCX, rex.w?0x3f:0x1f); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + if (!dyn->insts[ninst].x64.gen_flags) { + GETED(0); + if (rex.w) + SLL(ed, ed, xRCX); + else + SLLW(ed, ed, xRCX); + if (dyn->insts[ninst].nat_flags_fusion) { + if (!rex.w) ZEROUP(ed); + NAT_FLAGS_OPS(ed, xZR, x5, xZR); + } else if (!rex.w && MODREG) { + ZEROUP(ed); + } + WBACK; + break; + } + ANDI(x3, xRCX, rex.w ? 0x3f : 0x1f); GETED(0); - if(!rex.w && MODREG) {ZEROUP(ed);} + if (!rex.w && MODREG) ZEROUP(ed); CBZ_NEXT(x3); emit_shl32(dyn, ninst, rex, ed, x3, x5, x4, x6); WBACK; break; case 5: INST_NAME("SHR Ed, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - ANDI(x3, xRCX, rex.w?0x3f:0x1f); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + if (!dyn->insts[ninst].x64.gen_flags) { + GETED(0); + if (rex.w) + SRL(ed, ed, xRCX); + else + SRLW(ed, ed, xRCX); + if (dyn->insts[ninst].nat_flags_fusion) { + if (!rex.w) ZEROUP(ed); + NAT_FLAGS_OPS(ed, xZR, x5, xZR); + } else if (!rex.w && MODREG) { + ZEROUP(ed); + } + WBACK; + break; + } + ANDI(x3, xRCX, rex.w ? 0x3f : 0x1f); GETED(0); - if(!rex.w && MODREG) {ZEROUP(ed);} + if (!rex.w && MODREG) { ZEROUP(ed); } CBZ_NEXT(x3); emit_shr32(dyn, ninst, rex, ed, x3, x5, x4); WBACK; break; case 7: INST_NAME("SAR Ed, CL"); - SETFLAGS(X_ALL, SF_PENDING); - ANDI(x3, xRCX, rex.w?0x3f:0x1f); + SETFLAGS(X_ALL, SF_PENDING, NAT_FLAGS_NOFUSION); + ANDI(x3, xRCX, rex.w ? 0x3f : 0x1f); GETED(0); - if(!rex.w && MODREG) {ZEROUP(ed);} + if (!rex.w && MODREG) { ZEROUP(ed); } CBZ_NEXT(x3); UFLAG_OP12(ed, x3); SRAxw(ed, ed, x3); WBACK; UFLAG_RES(ed); - UFLAG_DF(x3, rex.w?d_sar64:d_sar32); + UFLAG_DF(x3, rex.w ? d_sar64 : d_sar32); break; } break; @@ -752,193 +878,225 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int OR(xRAX, xRAX, x1); break; case 0xD8: - addr = dynarec64_D8(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_D8(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xD9: - addr = dynarec64_D9(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_D9(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xDA: - addr = dynarec64_DA(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_DA(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xDB: - addr = dynarec64_DB(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_DB(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xDC: - addr = dynarec64_DC(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_DC(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xDD: - addr = dynarec64_DD(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_DD(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xDE: - addr = dynarec64_DE(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_DE(dyn, addr, ip, ninst, rex, ok, need_epilog); break; case 0xDF: - addr = dynarec64_DF(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + addr = dynarec64_DF(dyn, addr, ip, ninst, rex, ok, need_epilog); break; - #define GO(Z) \ - BARRIER(BARRIER_MAYBE); \ - JUMP(addr+i8, 1); \ - if(dyn->insts[ninst].x64.jmp_insts==-1 || \ - CHECK_CACHE()) { \ - /* out of the block */ \ - i32 = dyn->insts[ninst].epilog-(dyn->native_size); \ - if(Z) {BNE(xRCX, xZR, i32);} else {BEQ(xRCX, xZR, i32);}; \ - if(dyn->insts[ninst].x64.jmp_insts==-1) { \ - if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \ - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ - jump_to_next(dyn, addr+i8, 0, ninst, rex.is32bits); \ - } else { \ - CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ - B(i32); \ - } \ - } else { \ - /* inside the block */ \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ - if(Z) {BEQ(xRCX, xZR, i32);} else {BNE(xRCX, xZR, i32);}; \ - } +#define GO(Z, R) \ + BARRIER(BARRIER_MAYBE); \ + JUMP(addr + i8, 1); \ + if (dyn->insts[ninst].x64.jmp_insts == -1 || CHECK_CACHE()) { \ + /* out of the block */ \ + i32 = dyn->insts[ninst].epilog - (dyn->native_size); \ + if (Z) { \ + BNE(R, xZR, i32); \ + } else { \ + BEQ(R, xZR, i32); \ + }; \ + if (dyn->insts[ninst].x64.jmp_insts == -1) { \ + if (!(dyn->insts[ninst].x64.barrier & BARRIER_FLOAT)) \ + fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ + jump_to_next(dyn, addr + i8, 0, ninst, rex.is32bits); \ + } else { \ + CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ + i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ + B(i32); \ + } \ + } else { \ + /* inside the block */ \ + i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ + if (Z) { \ + BEQ(R, xZR, i32); \ + } else { \ + BNE(R, xZR, i32); \ + }; \ + } case 0xE0: INST_NAME("LOOPNZ"); READFLAGS(X_ZF); i8 = F8S; - SUBI(xRCX, xRCX, 1); - ANDI(x1, xFlags, 1 << F_ZF); - CBNZ_NEXT(x1); - GO(0); + if (rex.is32bits && rex.is67) { + ADDIW(x3, x3, -1); + INSH(xRCX, x3, x5, x6, 1, 1); // x3 will be zexth'ed + ANDI(x1, xFlags, 1 << F_ZF); + CBNZ_NEXT(x1); + GO(0, x3); + } else { + ADDIy(xRCX, xRCX, -1); + ANDI(x1, xFlags, 1 << F_ZF); + CBNZ_NEXT(x1); + GO(0, xRCX); + } break; case 0xE1: INST_NAME("LOOPZ"); READFLAGS(X_ZF); i8 = F8S; - SUBI(xRCX, xRCX, 1); - ANDI(x1, xFlags, 1 << F_ZF); - CBZ_NEXT(x1); - GO(0); + if (rex.is32bits && rex.is67) { + ADDIW(x3, x3, -1); + INSH(xRCX, x3, x5, x6, 1, 1); // x3 will be zexth'ed + ANDI(x1, xFlags, 1 << F_ZF); + CBZ_NEXT(x1); + GO(0, x3); + } else { + ADDIy(xRCX, xRCX, -1); + ANDI(x1, xFlags, 1 << F_ZF); + CBZ_NEXT(x1); + GO(0, xRCX); + } break; case 0xE2: INST_NAME("LOOP"); i8 = F8S; - SUBI(xRCX, xRCX, 1); - GO(0); + if (rex.is32bits && rex.is67) { + ADDIW(x3, x3, -1); + INSH(xRCX, x3, x5, x6, 1, 1); // x3 will be zexth'ed + GO(0, x3); + } else { + ADDIy(xRCX, xRCX, -1); + GO(0, xRCX); + } break; case 0xE3: INST_NAME("JECXZ"); i8 = F8S; - GO(1); + if (rex.is32bits && rex.is67) { + ZEXTH(x3, xRCX); + GO(1, x3); + } else if (rex.is32bits || rex.is67) { + ADDIy(x3, xRCX, 0); + GO(1, x3); + } else { + GO(1, xRCX); + } break; - #undef GO +#undef GO case 0xE8: INST_NAME("CALL Id"); i32 = F32S; - if(addr+i32==0) { - #if STEP == 3 - printf_log(LOG_INFO, "Warning, CALL to 0x0 at %p (%p)\n", (void*)addr, (void*)(addr-1)); - #endif + if (addr + i32 == 0) { +#if STEP == 3 + printf_log(LOG_INFO, "Warning, CALL to 0x0 at %p (%p)\n", (void*)addr, (void*)(addr - 1)); +#endif } - #if STEP < 2 - if(!rex.is32bits && isNativeCall(dyn, addr+i32, &dyn->insts[ninst].natcall, &dyn->insts[ninst].retn)) +#if STEP < 2 + if (!rex.is32bits && !dyn->need_reloc && IsNativeCall(addr + i32, rex.is32bits, &dyn->insts[ninst].natcall, &dyn->insts[ninst].retn)) tmp = dyn->insts[ninst].pass2choice = 3; else - tmp = dyn->insts[ninst].pass2choice = 0; - #else - tmp = dyn->insts[ninst].pass2choice; - #endif - switch(tmp) { + tmp = dyn->insts[ninst].pass2choice = i32 ? 0 : 1; +#else + tmp = dyn->insts[ninst].pass2choice; +#endif + switch (tmp) { case 3: - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags to "dont'care" state + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags to "dont'care" state SKIPTEST(x1); BARRIER(BARRIER_FULL); - //BARRIER_NEXT(BARRIER_FULL); - if(dyn->last_ip && (addr-dyn->last_ip<0x1000)) { - ADDI(x2, xRIP, addr-dyn->last_ip); + if (dyn->last_ip && (addr - dyn->last_ip < 0x800)) { + ADDI(x2, xRIP, addr - dyn->last_ip); + } else if (dyn->last_ip && (dyn->last_ip - addr < 0x800)) { + SUBI(x2, xRIP, dyn->last_ip - addr); } else { - TABLE64(x2, addr); + if (dyn->need_reloc) { + TABLE64(x2, addr); + } else { + MOV64x(x2, addr); + } } PUSH1(x2); - MESSAGE(LOG_DUMP, "Native Call to %s (retn=%d)\n", GetNativeName(GetNativeFnc(dyn->insts[ninst].natcall-1)), dyn->insts[ninst].retn); + MESSAGE(LOG_DUMP, "Native Call to %s (retn=%d)\n", GetNativeName(GetNativeFnc(dyn->insts[ninst].natcall - 1)), dyn->insts[ninst].retn); // calling a native function sse_purge07cache(dyn, ninst, x3); - if((box64_log<2 && !cycle_log) && dyn->insts[ninst].natcall) { + if ((BOX64ENV(log) < 2 && !BOX64ENV(rolling_log)) && dyn->insts[ninst].natcall) { // Partially support isSimpleWrapper tmp = isSimpleWrapper(*(wrapper_t*)(dyn->insts[ninst].natcall + 2)); } else - tmp=0; - if (tmp < 0 || tmp > 1) + tmp = 0; + if (tmp < 0 || (tmp & 15) > 1) tmp = 0; // TODO: removed when FP is in place - if(dyn->insts[ninst].natcall && isRetX87Wrapper(*(wrapper_t*)(dyn->insts[ninst].natcall+2))) + if (dyn->insts[ninst].natcall && isRetX87Wrapper(*(wrapper_t*)(dyn->insts[ninst].natcall + 2))) // return value will be on the stack, so the stack depth needs to be updated x87_purgecache(dyn, ninst, 0, x3, x1, x4); - if((box64_log<2 && !cycle_log) && dyn->insts[ninst].natcall && tmp) { - //GETIP(ip+3+8+8); // read the 0xCC - call_n(dyn, ninst, *(void**)(dyn->insts[ninst].natcall+2+8), tmp); - POP1(xRIP); // pop the return address + if ((BOX64ENV(log) < 2 && !BOX64ENV(rolling_log)) && dyn->insts[ninst].natcall && tmp) { + call_n(dyn, ninst, (void*)(dyn->insts[ninst].natcall + 2 + 8), tmp); + POP1(xRIP); // pop the return address dyn->last_ip = addr; } else { - GETIP_(dyn->insts[ninst].natcall); // read the 0xCC already + GETIP_(dyn->insts[ninst].natcall, x7); // read the 0xCC already STORE_XEMU_CALL(x3); ADDI(x1, xEmu, (uint32_t)offsetof(x64emu_t, ip)); // setup addr as &emu->ip - CALL_S(x64Int3, -1); + CALL_S(const_int3, -1, x1); LOAD_XEMU_CALL(); - TABLE64(x3, dyn->insts[ninst].natcall); - ADDI(x3, x3, 2+8+8); - BNE_MARK(xRIP, x3); // Not the expected address, exit dynarec block - POP1(xRIP); // pop the return address - if(dyn->insts[ninst].retn) { - if(dyn->insts[ninst].retn<0x1000) { + MOV64x(x3, dyn->insts[ninst].natcall); + ADDI(x3, x3, 2 + 8 + 8); + BNE_MARK(xRIP, x3); // Not the expected address, exit dynarec block + POP1(xRIP); // pop the return address + if (dyn->insts[ninst].retn) { + if (dyn->insts[ninst].retn < 0x800) { ADDI(xRSP, xRSP, dyn->insts[ninst].retn); } else { MOV64x(x3, dyn->insts[ninst].retn); ADD(xRSP, xRSP, x3); } } - TABLE64(x3, addr); - BNE_MARK(xRIP, x3); // Not the expected address again - LW(w1, xEmu, offsetof(x64emu_t, quit)); - CBZ_NEXT(w1); + LW(x1, xEmu, offsetof(x64emu_t, quit)); + CBZ_NEXT(x1); MARK; jump_to_epilog_fast(dyn, 0, xRIP, ninst); dyn->last_ip = addr; } break; + case 1: + // this is call to next step, so just push the return address to the stack + if (dyn->need_reloc) { + TABLE64(x2, addr); + } else { + MOV64x(x2, addr); + } + PUSH1z(x2); + break; default: - if((box64_dynarec_safeflags>1) || (ninst && dyn->insts[ninst-1].x64.set_flags)) { - READFLAGS(X_PEND); // that's suspicious + if ((BOX64DRENV(dynarec_safeflags) > 1) || (ninst && dyn->insts[ninst - 1].x64.set_flags)) { + READFLAGS(X_PEND); // that's suspicious } else { - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags to "dont'care" state + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags to "dont'care" state } // regular call - /*if(box64_dynarec_callret && box64_dynarec_bigblock>1) { - BARRIER(BARRIER_FULL); - } else { - BARRIER(BARRIER_FLOAT); - *need_epilog = 0; - *ok = 0; - }*/ - - if(rex.is32bits) { - MOV32w(x2, addr); - } else { + if (dyn->need_reloc) { TABLE64(x2, addr); + } else { + MOV64x(x2, addr); } fpu_purgecache(dyn, ninst, 1, x1, x3, x4); PUSH1z(x2); - if(box64_dynarec_callret) { + if (BOX64DRENV(dynarec_callret)) { SET_HASCALLRET(); // Push actual return address - if(addr < (dyn->start+dyn->isize)) { - // there is a next... - j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; - AUIPC(x4, ((j64 + 0x800) >> 12) & 0xfffff); - ADDI(x4, x4, j64 & 0xfff); - MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64>>2); - } else { - MESSAGE(LOG_NONE, "\tCALLRET set return to Jmptable(%p)\n", (void*)addr); - j64 = getJumpTableAddress64(addr); - TABLE64(x4, j64); - LD(x4, x4, 0); - } + j64 = (dyn->insts) ? (GETMARK - (dyn->native_size)) : 0; + AUIPC(x4, ((j64 + 0x800) >> 12) & 0xfffff); + ADDI(x4, x4, j64 & 0xfff); + MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64 >> 2); ADDI(xSP, xSP, -16); SD(x4, xSP, 0); SD(x2, xSP, 8); @@ -946,32 +1104,54 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int *ok = 0; *need_epilog = 0; } - jump_to_next(dyn, addr+i32, 0, ninst, rex.is32bits); + if (rex.is32bits) + j64 = (uint32_t)(addr + i32); + else + j64 = addr + i32; + jump_to_next(dyn, j64, 0, ninst, rex.is32bits); + MARK; + if (BOX64DRENV(dynarec_callret) && dyn->vector_sew != VECTOR_SEWNA) + vector_vsetvli(dyn, ninst, x3, dyn->vector_sew, VECTOR_LMUL1, 1); + if (BOX64DRENV(dynarec_callret) && addr >= (dyn->start + dyn->isize)) { + // jumps out of current dynablock... + j64 = getJumpTableAddress64(addr); + if (dyn->need_reloc) { + AddRelocTable64JmpTbl(dyn, ninst, addr, STEP); + TABLE64_(x4, j64); + } else { + MOV64x(x4, j64); + } + LD(x4, x4, 0); + BR(x4); + } break; } break; case 0xE9: case 0xEB: BARRIER(BARRIER_MAYBE); - if (box64_dynarec_test == 2) { NOTEST(x1); } - if(opcode==0xE9) { + if (opcode == 0xE9) { INST_NAME("JMP Id"); i32 = F32S; } else { INST_NAME("JMP Ib"); i32 = F8S; } - JUMP((uintptr_t)getAlternate((void*)(addr+i32)), 0); - if(dyn->insts[ninst].x64.jmp_insts==-1) { + if (rex.is32bits) + j64 = (uint32_t)(addr + i32); + else + j64 = addr + i32; + JUMP((uintptr_t)getAlternate((void*)j64), 0); + if (dyn->insts[ninst].x64.jmp_insts == -1) { // out of the block fpu_purgecache(dyn, ninst, 1, x1, x2, x3); - jump_to_next(dyn, (uintptr_t)getAlternate((void*)(addr+i32)), 0, ninst, rex.is32bits); + jump_to_next(dyn, (uintptr_t)getAlternate((void*)j64), 0, ninst, rex.is32bits); } else { // inside the block CacheTransform(dyn, ninst, CHECK_CACHE(), x1, x2, x3); - tmp = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); + tmp = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); MESSAGE(1, "Jump to %d / 0x%x\n", tmp, tmp); - if(tmp==4) { + if (tmp == 4) { NOP(); } else { B(tmp); @@ -980,26 +1160,71 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int *need_epilog = 0; *ok = 0; break; - case 0xF0: - addr = dynarec64_F0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + case 0xEC ... 0xEF: + if (opcode == 0xEC) + INST_NAME("IN AL, DX"); + else if (opcode == 0xED) + INST_NAME("IN EAX, DX"); + else if (opcode == 0xEE) + INST_NAME("OUT DX, AL"); + else + INST_NAME("OUT DX, EAX"); + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + GETIP(ip, x7); + STORE_XEMU_CALL(xRIP); + CALL(const_native_priv, -1, 0, 0); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; + break; + case 0xF4: + INST_NAME("HLT"); + if (box64_unittest_mode) { // HLT in unittest mode is an exit + READFLAGS(X_ALL); + BARRIER(BARRIER_FLOAT); + MOV32w(x1, 1); + SW(x1, xEmu, offsetof(x64emu_t, quit)); + } else { + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); + STORE_XEMU_CALL(); + CALL(const_native_priv, -1, 0, 0); + LOAD_XEMU_CALL(); + } + jump_to_epilog(dyn, 0, xRIP, ninst); + *need_epilog = 0; + *ok = 0; break; case 0xF5: INST_NAME("CMC"); READFLAGS(X_CF); - SETFLAGS(X_CF, SF_SUBSET); - XORI(xFlags, xFlags, 1<>3)&7) { + switch ((nextop >> 3) & 7) { case 0: case 1: INST_NAME("TEST Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEB(x1, 1); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + if (MODREG && (rex.rex || (((nextop & 7) >> 2) == 0))) { + // quick path for low 8bit registers + if (rex.rex) + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + else + ed = TO_NAT(nextop & 3); + } else { + GETEB(x1, 1); + ed = x1; + } u8 = F8; - MOV32w(x2, u8); - emit_test8(dyn, ninst, x1, x2, x3, x4, x5); + emit_test8c(dyn, ninst, ed, u8, x6, x4, x5); break; case 2: INST_NAME("NOT Eb"); @@ -1009,15 +1234,14 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 3: INST_NAME("NEG Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 0); - emit_neg8(dyn, ninst, x1, x2, x4); + emit_neg8(dyn, ninst, x1, x2, x4, x5); EBBACK(x5, 0); break; case 4: INST_NAME("MUL AL, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - UFLAG_DF(x1, d_mul8); + SETFLAGS(X_ALL, SF_PENDING, NAT_FLAGS_NOFUSION); GETEB(x1, 0); ANDI(x2, xRAX, 0xff); MULW(x1, x2, x1); @@ -1026,11 +1250,11 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int AND(xRAX, xRAX, x2); ZEXTH(x1, x1); OR(xRAX, xRAX, x1); + UFLAG_DF(x1, d_mul8); break; case 5: INST_NAME("IMUL AL, Eb"); - SETFLAGS(X_ALL, SF_PENDING); - UFLAG_DF(x1, d_imul8); + SETFLAGS(X_ALL, SF_PENDING, NAT_FLAGS_NOFUSION); GETSEB(x1, 0); SLLI(x2, xRAX, 56); SRAI(x2, x2, 56); @@ -1040,31 +1264,55 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int AND(xRAX, xRAX, x2); ZEXTH(x1, x1); OR(xRAX, xRAX, x1); + UFLAG_DF(x1, d_imul8); break; case 6: INST_NAME("DIV Eb"); MESSAGE(LOG_DUMP, "Need Optimization\n"); - SETFLAGS(X_ALL, SF_SET_DF); + SETFLAGS(X_ALL, SF_SET_DF, NAT_FLAGS_NOFUSION); GETEB(x1, 0); - CALL(div8, -1); + ZEXTH(x2, xRAX); + if (BOX64ENV(dynarec_div0)) { + BNE_MARK3(ed, xZR); + GETIP_(ip, x7); + STORE_XEMU_CALL(x3); + CALL(const_native_div0, -1, 0, 0); + CLEARIP(); + LOAD_XEMU_CALL(); + jump_to_epilog(dyn, 0, xRIP, ninst); + MARK3; + } + DIVUW(x3, x2, ed); + REMUW(x4, x2, ed); + LUI(x5, 0xffff0); + AND(xRAX, xRAX, x5); + ANDI(x3, x3, 0xff); + OR(xRAX, xRAX, x3); + ANDI(x4, x4, 0xff); + SLLI(x4, x4, 8); + OR(xRAX, xRAX, x4); + SET_DFNONE(); + CLEAR_FLAGS(); + IFX (X_ZF) ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_PF) ORI(xFlags, xFlags, 1 << F_PF); break; case 7: INST_NAME("IDIV Eb"); SKIPTEST(x1); MESSAGE(LOG_DUMP, "Need Optimization\n"); - SETFLAGS(X_ALL, SF_SET_DF); + SETFLAGS(X_ALL, SF_SET_DF, NAT_FLAGS_NOFUSION); GETEB(x1, 0); - CALL(idiv8, -1); + CALL(const_idiv8, -1, x1, 0); break; } break; case 0xF7: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: case 1: INST_NAME("TEST Ed, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED(4); i64 = F32S; emit_test32c(dyn, ninst, rex, ed, i64, x3, x4, x5); @@ -1073,109 +1321,143 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("NOT Ed"); GETED(0); XORI(ed, ed, -1); - if(!rex.w && MODREG) + if (!rex.w && MODREG) ZEROUP(ed); WBACK; break; case 3: INST_NAME("NEG Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETED(0); - emit_neg32(dyn, ninst, rex, ed, x3, x4); + emit_neg32(dyn, ninst, rex, ed, x3, x4, x5, x6); WBACK; break; case 4: INST_NAME("MUL EAX, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - UFLAG_DF(x2, rex.w?d_mul64:d_mul32); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + CLEAR_FLAGS(); + SET_DFNONE(); GETED(0); - if(rex.w) { - if(ed==xRDX) gd=x3; else gd=xRDX; + if (rex.w) { + if (ed == xRDX) + gd = x3; + else + gd = xRDX; MULHU(gd, xRAX, ed); MUL(xRAX, xRAX, ed); - if(gd!=xRDX) {MV(xRDX, gd);} + if (gd != xRDX) { MV(xRDX, gd); } } else { - AND(x3, xRAX, xMASK); - if(MODREG) { - AND(x4, ed, xMASK); + ZEXTW2(x3, xRAX); + if (MODREG) { + ZEXTW2(x4, ed); ed = x4; } - MUL(xRDX, x3, ed); //64 <- 32x32 - AND(xRAX, xRDX, xMASK); + MUL(xRDX, x3, ed); // 64 <- 32x32 + ZEXTW2(xRAX, xRDX); SRLI(xRDX, xRDX, 32); } - UFLAG_RES(xRAX); - UFLAG_OP1(xRDX); + IFX (X_CF | X_OF) { + // CF = OF = RDX != 0 + SNEZ(x6, xRDX); + IFX (X_CF) { + OR(xFlags, xFlags, x6); // F_CF == 0 + } + IFX (X_OF) { + SLLI(x6, x6, F_OF2); + OR(xFlags, xFlags, x6); + } + } + IFX (X_SF) { + SRLI(x6, xRAX, rex.w ? 63 : 31); + SLLI(x6, x6, F_SF); + OR(xFlags, xFlags, x6); + } + IFX (X_PF) emit_pf(dyn, ninst, xRAX, x6, x4); break; case 5: INST_NAME("IMUL EAX, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - UFLAG_DF(x2, rex.w?d_imul64:d_imul32); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + CLEAR_FLAGS(); + SET_DFNONE(); GETSED(0); - if(rex.w) { - if(ed==xRDX) gd=x3; else gd=xRDX; + if (rex.w) { + if (ed == xRDX) + gd = x3; + else + gd = xRDX; MULH(gd, xRAX, ed); MUL(xRAX, xRAX, ed); - if(gd!=xRDX) {MV(xRDX, gd);} + if (gd != xRDX) { MV(xRDX, gd); } } else { ADDIW(x3, xRAX, 0); // sign extend 32bits-> 64bits - MUL(xRDX, x3, ed); //64 <- 32x32 - AND(xRAX, xRDX, xMASK); + MUL(xRDX, x3, ed); // 64 <- 32x32 + ZEXTW2(xRAX, xRDX); SRLI(xRDX, xRDX, 32); } - UFLAG_RES(xRAX); - UFLAG_OP1(xRDX); + IFX (X_CF | X_OF) { + // CF = OF = SignExtend(RAX) != RDX:RAX + SRAIxw(x6, xRAX, rex.w ? 63 : 31); + SUBxw(x6, xRDX, x6); + SNEZ(x6, x6); + IFX (X_CF) { + OR(xFlags, xFlags, x6); // F_CF == 0 + } + IFX (X_OF) { + SLLI(x6, x6, F_OF2); + OR(xFlags, xFlags, x6); + } + } break; case 6: INST_NAME("DIV Ed"); - SETFLAGS(X_ALL, SF_SET); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); SET_DFNONE(); - if(!rex.w) { + if (!rex.w) { GETED(0); - if(ninst && (nextop==0xF0) - && dyn->insts[ninst-1].x64.addr - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0xB8 - && *(uint32_t*)(dyn->insts[ninst-1].x64.addr+1)==0) { - // hack for some protection that check a divide by zero actualy trigger a divide by zero exception + if (ninst && (nextop == 0xF0) + && dyn->insts[ninst - 1].x64.addr + && *(uint8_t*)(dyn->insts[ninst - 1].x64.addr) == 0xB8 + && *(uint32_t*)(dyn->insts[ninst - 1].x64.addr + 1) == 0) { + // hack for some protection that check a divide by zero actually trigger a divide by zero exception MESSAGE(LOG_INFO, "Divide by 0 hack\n"); - GETIP(ip); + GETIP(ip, x7); STORE_XEMU_CALL(x3); - CALL(native_div0, -1); + CALL(const_native_div0, -1, 0, 0); LOAD_XEMU_CALL(); } else { - if(box64_dynarec_div0) { + if (BOX64ENV(dynarec_div0)) { BNE_MARK3(ed, xZR); - GETIP_(ip); + GETIP_(ip, x7); STORE_XEMU_CALL(x3); - CALL(native_div0, -1); + CALL(const_native_div0, -1, 0, 0); CLEARIP(); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); MARK3; } SLLI(x3, xRDX, 32); - AND(x2, xRAX, xMASK); + ZEXTW2(x2, xRAX); OR(x3, x3, x2); - if(MODREG) { - AND(x4, ed, xMASK); + if (MODREG) { + ZEXTW2(x4, ed); ed = x4; } DIVU(x2, x3, ed); REMU(xRDX, x3, ed); - AND(xRAX, x2, xMASK); + ZEXTW2(xRAX, x2); ZEROUP(xRDX); } } else { - if(ninst - && dyn->insts[ninst-1].x64.addr - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31 - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0xD2) { + if (ninst + && dyn->insts[ninst - 1].x64.addr + && *(uint8_t*)(dyn->insts[ninst - 1].x64.addr) == 0x31 + && *(uint8_t*)(dyn->insts[ninst - 1].x64.addr + 1) == 0xD2) { GETED(0); - if(box64_dynarec_div0) { + if (BOX64ENV(dynarec_div0)) { BNE_MARK3(ed, xZR); - GETIP_(ip); + GETIP_(ip, x7); STORE_XEMU_CALL(x3); - CALL(native_div0, -1); + CALL(const_native_div0, -1, 0, 0); CLEARIP(); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); @@ -1185,20 +1467,19 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int REMU(xRDX, xRAX, ed); MV(xRAX, x2); } else { - GETEDH(x1, 0); // get edd changed addr, so cannot be called 2 times for same op... - if(box64_dynarec_div0) { + GETEDH(x4, x1, 0); // get edd changed addr, so cannot be called 2 times for same op... + if (BOX64ENV(dynarec_div0)) { BNE_MARK3(ed, xZR); - GETIP_(ip); + GETIP_(ip, x7); STORE_XEMU_CALL(x3); - CALL(native_div0, -1); + CALL(const_native_div0, -1, 0, 0); CLEARIP(); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); MARK3; } BEQ_MARK(xRDX, xZR); - if(ed!=x1) {MV(x1, ed);} - CALL(div64, -1); + CALL(const_div64, -1, ed, 0); B_NEXT_nocond; MARK; DIVU(x2, xRAX, ed); @@ -1206,42 +1487,46 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int MV(xRAX, x2); } } + SET_DFNONE(); + CLEAR_FLAGS(); + IFX (X_ZF) ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_PF) ORI(xFlags, xFlags, 1 << F_PF); break; case 7: INST_NAME("IDIV Ed"); SKIPTEST(x1); - SETFLAGS(X_ALL, SF_SET); - SET_DFNONE() - if(!rex.w) { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + if (!rex.w) { GETSED(0); - if(box64_dynarec_div0) { + if (BOX64ENV(dynarec_div0)) { BNE_MARK3(ed, xZR); - GETIP_(ip); + GETIP_(ip, x7); STORE_XEMU_CALL(x3); - CALL(native_div0, -1); + CALL(const_native_div0, -1, 0, 0); CLEARIP(); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); MARK3; } SLLI(x3, xRDX, 32); - AND(x2, xRAX, xMASK); + ZEXTW2(x2, xRAX); OR(x3, x3, x2); DIV(x2, x3, ed); REM(xRDX, x3, ed); - AND(xRAX, x2, xMASK); + ZEXTW2(xRAX, x2); ZEROUP(xRDX); } else { - if(ninst && dyn->insts - && dyn->insts[ninst-1].x64.addr - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x48 - && *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0x99) { + if (ninst && dyn->insts + && dyn->insts[ninst - 1].x64.addr + && *(uint8_t*)(dyn->insts[ninst - 1].x64.addr) == 0x48 + && *(uint8_t*)(dyn->insts[ninst - 1].x64.addr + 1) == 0x99) { GETED(0); - if(box64_dynarec_div0) { + if (BOX64ENV(dynarec_div0)) { BNE_MARK3(ed, xZR); - GETIP_(ip); + GETIP_(ip, x7); STORE_XEMU_CALL(x3); - CALL(native_div0, -1); + CALL(const_native_div0, -1, 0, 0); CLEARIP(); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); @@ -1251,19 +1536,19 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int REM(xRDX, xRAX, ed); MV(xRAX, x2); } else { - GETEDH(x1, 0); // get edd changed addr, so cannot be called 2 times for same op... - if(box64_dynarec_div0) { + GETEDH(x4, x1, 0); // get edd changed addr, so cannot be called 2 times for same op... + if (BOX64ENV(dynarec_div0)) { BNE_MARK3(ed, xZR); - GETIP_(ip); + GETIP_(ip, x7); STORE_XEMU_CALL(x3); - CALL(native_div0, -1); + CALL(const_native_div0, -1, 0, 0); CLEARIP(); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); MARK3; } - //Need to see if RDX==0 and RAX not signed - // or RDX==-1 and RAX signed + // Need to see if RDX==0 and RAX not signed + // or RDX==-1 and RAX signed BNE_MARK2(xRDX, xZR); BGE_MARK(xRAX, xZR); MARK2; @@ -1271,8 +1556,7 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int BNE_MARK3(x2, xZR); BLT_MARK(xRAX, xZR); MARK3; - if(ed!=x1) MV(x1, ed); - CALL((void*)idiv64, -1); + CALL(const_idiv64, -1, ed, 0); B_NEXT_nocond; MARK; DIV(x2, xRAX, ed); @@ -1288,13 +1572,13 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0xF8: INST_NAME("CLC"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); ANDI(xFlags, xFlags, ~(1 << F_CF)); break; case 0xF9: INST_NAME("STC"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); ORI(xFlags, xFlags, 1 << F_CF); break; @@ -1308,17 +1592,17 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0xFE: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: INST_NAME("INC Eb"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 0); emit_inc8(dyn, ninst, ed, x2, x4, x5); EBBACK(x5, 0); break; case 1: INST_NAME("DEC Eb"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); GETEB(x1, 0); emit_dec8(dyn, ninst, ed, x2, x4, x5); EBBACK(x5, 0); @@ -1329,61 +1613,60 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0xFF: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: // INC Ed INST_NAME("INC Ed"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); GETED(0); emit_inc32(dyn, ninst, rex, ed, x3, x4, x5, x6); WBACK; break; - case 1: //DEC Ed + case 1: // DEC Ed INST_NAME("DEC Ed"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); GETED(0); emit_dec32(dyn, ninst, rex, ed, x3, x4, x5, x6); WBACK; break; case 2: // CALL Ed INST_NAME("CALL Ed"); - PASS2IF((box64_dynarec_safeflags>1) || - ((ninst && dyn->insts[ninst-1].x64.set_flags) - || ((ninst>1) && dyn->insts[ninst-2].x64.set_flags)), 1) - { - READFLAGS(X_PEND); // that's suspicious + PASS2IF ((BOX64DRENV(dynarec_safeflags) > 1) || ((ninst && dyn->insts[ninst - 1].x64.set_flags) || ((ninst > 1) && dyn->insts[ninst - 2].x64.set_flags)), 1) { + READFLAGS(X_PEND); // that's suspicious } else { - SETFLAGS(X_ALL, SF_SET_NODF); //Hack to put flag in "don't care" state + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to put flag in "don't care" state } GETEDz(0); - if(box64_dynarec_callret && box64_dynarec_bigblock>1) { + if (BOX64DRENV(dynarec_callret) && BOX64DRENV(dynarec_bigblock) > 1) { BARRIER(BARRIER_FULL); } else { BARRIER(BARRIER_FLOAT); *need_epilog = 0; *ok = 0; } - GETIP_(addr); - if(box64_dynarec_callret) { + GETIP_(addr, x7); + if (BOX64DRENV(dynarec_callret)) { SET_HASCALLRET(); - // Push actual return address - if(addr < (dyn->start+dyn->isize)) { - // there is a next... - j64 = (dyn->insts)?(dyn->insts[ninst].epilog-(dyn->native_size)):0; - AUIPC(x4, ((j64 + 0x800) >> 12) & 0xfffff); - ADDI(x4, x4, j64 & 0xfff); - MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64>>2); - } else { - MESSAGE(LOG_NONE, "\tCALLRET set return to Jmptable(%p)\n", (void*)addr); - j64 = getJumpTableAddress64(addr); - TABLE64(x4, j64); - LD(x4, x4, 0); - } + j64 = (dyn->insts) ? (GETMARK - (dyn->native_size)) : 0; + AUIPC(x4, ((j64 + 0x800) >> 12) & 0xfffff); + ADDI(x4, x4, j64 & 0xfff); + MESSAGE(LOG_NONE, "\tCALLRET set return to +%di\n", j64 >> 2); ADDI(xSP, xSP, -16); SD(x4, xSP, 0); SD(xRIP, xSP, 8); } PUSH1z(xRIP); jump_to_next(dyn, 0, ed, ninst, rex.is32bits); + MARK; + if (BOX64DRENV(dynarec_callret) && dyn->vector_sew != VECTOR_SEWNA) + vector_vsetvli(dyn, ninst, x3, dyn->vector_sew, VECTOR_LMUL1, 1); + if (BOX64DRENV(dynarec_callret) && addr >= (dyn->start + dyn->isize)) { + // jumps out of current dynablock... + j64 = getJumpTableAddress64(addr); + if (dyn->need_reloc) AddRelocTable64RetEndBlock(dyn, ninst, addr, STEP); + TABLE64_(x4, j64); + LD(x4, x4, 0); + BR(x4); + } break; case 4: // JMP Ed INST_NAME("JMP Ed"); @@ -1395,7 +1678,7 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int *ok = 0; break; case 5: // JMP FAR Ed - if(MODREG) { + if (MODREG) { DEFAULT; } else { INST_NAME("JMP FAR Ed"); @@ -1405,9 +1688,8 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 0, 0); LDxw(x1, wback, 0); ed = x1; - LHU(x3, wback, rex.w?8:4); + LHU(x3, wback, rex.w ? 8 : 4); SH(x3, xEmu, offsetof(x64emu_t, segs[_CS])); - SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_CS])); jump_to_epilog(dyn, 0, ed, ninst); *need_epilog = 0; *ok = 0; @@ -1427,5 +1709,5 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int DEFAULT; } - return addr; + return addr; } diff --git a/src/dynarec/rv64/dynarec_rv64_0f.c b/src/dynarec/rv64/dynarec_rv64_0f.c index f7565a7..e989f43 100644 --- a/src/dynarec/rv64/dynarec_rv64_0f.c +++ b/src/dynarec/rv64/dynarec_rv64_0f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,11 +17,12 @@ #include "emu/x87emu_private.h" #include "emu/x64shaext.h" #include "bitutils.h" - +#include "freq.h" #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "elfloader.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { @@ -36,6 +35,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni uint8_t wb1, wback, wb2, gback; uint8_t eb1, eb2; uint8_t gb1, gb2; + uint8_t tmp1, tmp2, tmp3; int32_t i32, i32_; int cacheupd = 0; int v0, v1; @@ -63,44 +63,49 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x01: // TODO:, /0 is SGDT. While 0F 01 D0 is XGETBV, etc... nextop = F8; - if(MODREG) { - switch(nextop) { + if (MODREG) { + switch (nextop) { case 0xD0: - //TODO - DEFAULT; - /*INST_NAME("FAKE xgetbv"); - nextop = F8; - addr = fakeed(dyn, addr, ninst, nextop); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state - GETIP(ip); - STORE_XEMU_CALL(x3); - CALL(native_ud, -1); - LOAD_XEMU_CALL(); - jump_to_epilog(dyn, 0, xRIP, ninst); - *need_epilog = 0; - *ok = 0;*/ + INST_NAME("XGETBV"); + ZEXTW2(x1, xRCX); + BEQZ_MARK(x1); + UDF(); + MARK; + MOV32w(xRAX, 0b111); + MOV32w(xRDX, 0); + break; + case 0xE0: + case 0xE1: + case 0xE2: + case 0xE3: + case 0xE4: + case 0xE5: + case 0xE6: + case 0xE7: + INST_NAME("SMSW Ed"); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + MOV32w(ed, (1 << 0) | (1 << 4)); // only PE and ET set... break; - case 0xF9: INST_NAME("RDTSCP"); NOTEST(x1); if (box64_rdtsc) { - CALL(ReadTSC, x3); // will return the u64 in x3 + CALL(const_readtsc, x3, 0, 0); // will return the u64 in x3 } else { CSRRS(x3, xZR, 0xC01); // RDTIME } - if(box64_rdtsc_shift) { + if (box64_rdtsc_shift) { SRLI(x3, x3, box64_rdtsc_shift); } SRLI(xRDX, x3, 32); - AND(xRAX, x3, xMASK); // wipe upper part + ZEXTW2(xRAX, x3); // wipe upper part MV(xRCX, xZR); // IA32_TSC, 0 for now break; default: DEFAULT; } } else { - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { default: DEFAULT; } @@ -110,14 +115,18 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("SYSCALL"); NOTEST(x1); SMEND(); - GETIP(addr); + GETIP(addr, x7); STORE_XEMU_CALL(x3); - CALL_S(x64Syscall, -1); + if(!box64_wine || FindElfAddress(my_context, ip)) { + CALL_S(const_x64syscall_linux, -1, 0); + } else { + CALL_S(const_x64syscall, -1, 0); + } LOAD_XEMU_CALL(); TABLE64(x3, addr); // expected return address BNE_MARK(xRIP, x3); - LW(w1, xEmu, offsetof(x64emu_t, quit)); - CBZ_NEXT(w1); + LW(x1, xEmu, offsetof(x64emu_t, quit)); + CBZ_NEXT(x1); MARK; LOAD_XEMU_REM(x3); jump_to_epilog(dyn, 0, xRIP, ninst); @@ -125,10 +134,14 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x09: INST_NAME("WBINVD"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state - GETIP(ip); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); STORE_XEMU_CALL(x3); - CALL(native_ud, -1); + CALL(const_native_ud, -1, 0, 0); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; @@ -137,10 +150,14 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x0B: INST_NAME("UD2"); - SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state - GETIP(ip); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_PEND); + } else { + SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state + } + GETIP(ip, x7); STORE_XEMU_CALL(x3); - CALL(native_ud, -1); + CALL(const_native_ud, -1, 0, 0); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); *need_epilog = 0; @@ -164,7 +181,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOVUPS Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); LD(x3, wback, fixedaddress + 0); LD(x4, wback, fixedaddress + 8); SD(x3, gback, gdoffset + 0); @@ -174,11 +191,33 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOVUPS Ex,Gx"); nextop = F8; GETGX(); - GETEX(x2, 0); - LD(x3, gback, gdoffset + 0); - LD(x4, gback, gdoffset + 8); - SD(x3, wback, fixedaddress + 0); - SD(x4, wback, fixedaddress + 8); + IF_UNALIGNED(ip) { + GETEX(x2, 0, 15); + LD(x3, gback, gdoffset + 0); + LD(x4, gback, gdoffset + 8); + for (int i = 0; i < 8; i++) { + if (i == 0) { + SB(x3, wback, fixedaddress); + } else { + SRLI(x5, x3, i * 8); + SB(x5, wback, fixedaddress + i); + } + } + for (int i = 0; i < 8; i++) { + if (i == 0) { + SB(x4, wback, fixedaddress + 8); + } else { + SRLI(x5, x4, i * 8); + SB(x5, wback, fixedaddress + i + 8); + } + } + } else { + GETEX(x2, 0, 8); + LD(x3, gback, gdoffset + 0); + LD(x4, gback, gdoffset + 8); + SD(x3, wback, fixedaddress + 0); + SD(x4, wback, fixedaddress + 8); + } if (!MODREG) SMWRITE2(); break; @@ -187,7 +226,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni if (MODREG) { INST_NAME("MOVHLPS Gx,Ex"); GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); LD(x3, wback, fixedaddress + 8); SD(x3, gback, gdoffset + 0); } else { @@ -201,7 +240,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOVLPS Ex,Gx"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 1); LD(x3, gback, gdoffset + 0); SD(x3, wback, fixedaddress + 0); if (!MODREG) @@ -211,7 +250,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("UNPCKLPS Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 4); LWU(x5, gback, gdoffset + 1 * 4); LWU(x3, wback, fixedaddress + 0); LWU(x4, wback, fixedaddress + 4); @@ -223,7 +262,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("UNPCKHPS Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); LWU(x3, wback, fixedaddress + 2 * 4); LWU(x4, wback, fixedaddress + 3 * 4); LWU(x5, gback, gdoffset + 2 * 4); @@ -242,7 +281,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SMREAD(); } GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 1); LD(x4, wback, fixedaddress + 0); SD(x4, gback, gdoffset + 8); break; @@ -250,7 +289,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOVHPS Ex,Gx"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 1); LD(x4, gback, gdoffset + 8); SD(x4, wback, fixedaddress + 0); if (!MODREG) @@ -258,7 +297,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x18: nextop = F8; - if ((nextop & 0xC0) == 0xC0) { + if (MODREG) { INST_NAME("NOP (multibyte)"); } else switch ((nextop >> 3) & 7) { @@ -275,6 +314,12 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } break; + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: case 0x1F: INST_NAME("NOP (multibyte)"); nextop = F8; @@ -285,14 +330,14 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOVAPS Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_MV_Q(x3); break; case 0x29: INST_NAME("MOVAPS Ex,Gx"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_MV_Q2(x3); if (!MODREG) SMWRITE2(); @@ -301,7 +346,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("CVTPI2PS Gx,Em"); nextop = F8; GETGX(); - GETEM(x2, 0); + GETEM(x2, 0, 4); d0 = fpu_get_scratch(dyn); u8 = sse_setround(dyn, ninst, x4, x5); for (int i = 0; i < 2; ++i) { @@ -315,7 +360,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOVNTPS Ex,Gx"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); LD(x3, gback, gdoffset + 0); LD(x4, gback, gdoffset + 8); SD(x3, wback, fixedaddress + 0); @@ -325,15 +370,15 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("CVTTPS2PI Gm,Ex"); nextop = F8; GETGM(); - GETEX(x2, 0); + GETEX(x2, 0, 4); d0 = fpu_get_scratch(dyn); for (int i = 0; i < 2; ++i) { - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FSFLAGSI(0); // // reset all bits } FLW(d0, wback, fixedaddress + i * 4); FCVTWS(x1, d0, RD_RTZ); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FRFLAGS(x5); // get back FPSR to check the IOC bit ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); BEQ_MARKi(x5, xZR, i); @@ -347,16 +392,16 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("CVTPS2PI Gm, Ex"); nextop = F8; GETGM(); - GETEX(x2, 0); + GETEX(x2, 0, 4); d0 = fpu_get_scratch(dyn); u8 = sse_setround(dyn, ninst, x6, x4); for (int i = 0; i < 2; ++i) { - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FSFLAGSI(0); // // reset all bits } FLW(d0, wback, fixedaddress + i * 4); FCVTWS(x1, d0, RD_DYN); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FRFLAGS(x5); // get back FPSR to check the IOC bit ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); BEQ_MARKi(x5, xZR, i); @@ -375,15 +420,14 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else { INST_NAME("UCOMISS Gx, Ex"); } - SETFLAGS(X_ALL, SF_SET); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); SET_DFNONE(); nextop = F8; GETGXSS(d0); GETEXSS(v0, 0); CLEAR_FLAGS(); // if isnan(d0) || isnan(v0) - IFX(X_ZF | X_PF | X_CF) - { + IFX (X_ZF | X_PF | X_CF) { FEQS(x3, d0, d0); FEQS(x2, v0, v0); AND(x2, x2, x3); @@ -393,8 +437,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } MARK; // else if isless(d0, v0) - IFX(X_CF) - { + IFX (X_CF) { FLTS(x2, d0, v0); BEQ_MARK2(x2, xZR); ORI(xFlags, xFlags, 1 << F_CF); @@ -402,8 +445,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } MARK2; // else if d0 == v0 - IFX(X_ZF) - { + IFX (X_ZF) { FEQS(x2, d0, v0); CBZ_NEXT(x2); ORI(xFlags, xFlags, 1 << F_ZF); @@ -413,15 +455,15 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("RDTSC"); NOTEST(x1); if (box64_rdtsc) { - CALL(ReadTSC, x3); // will return the u64 in x3 + CALL(const_readtsc, x3, 0, 0); // will return the u64 in x3 } else { CSRRS(x3, xZR, 0xC01); // RDTIME } - if(box64_rdtsc_shift) { + if (box64_rdtsc_shift) { SRLI(x3, x3, box64_rdtsc_shift); } SRLI(xRDX, x3, 32); - AND(xRAX, x3, xMASK); // wipe upper part + ZEXTW2(xRAX, x3); // wipe upper part break; case 0x38: // SSE3 @@ -431,7 +473,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSHUFB Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); LD(x4, gback, gdoffset); for (int i = 0; i < 8; ++i) { LB(x3, wback, fixedaddress + i); @@ -461,7 +503,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LW(x3, gback, gdoffset + 0); SW(x3, gback, gdoffset + 4); } else { - GETEM(x2, 0); + GETEM(x2, 0, 6); for (int i = 0; i < 2; ++i) { // tmp32s = EX->sw[i*2+0] + EX->sw[i*2+1]; // GX->sw[4+i] = sat(tmp32s); @@ -485,7 +527,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni // GM->sd[1] = GM->sd[0]; SW(x3, gback, gdoffset + 1 * 4); } else { - GETEM(x2, 0); + GETEM(x2, 0, 4); // GM->sd[1] = EM->sd[0] + EM->sd[1]; LW(x3, wback, fixedaddress + 0 * 4); LW(x4, wback, fixedaddress + 1 * 4); @@ -505,7 +547,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LH(x3, gback, gdoffset + 2 * (i * 2 + 0)); LH(x4, gback, gdoffset + 2 * (i * 2 + 1)); ADDW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -521,14 +563,14 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LW(x3, gback, gdoffset + 0); SW(x3, gback, gdoffset + 4); } else { - GETEM(x2, 0); + GETEM(x2, 0, 6); for (int i = 0; i < 2; ++i) { // tmp32s = EX->sw[i*2+0] + EX->sw[i*2+1]; // GX->sw[4+i] = sat(tmp32s); LH(x3, wback, fixedaddress + 2 * (i * 2 + 0)); LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); ADDW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -545,18 +587,18 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PMADDUBSW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); MOV64x(x5, 32767); MOV64x(x6, -32768); for (int i = 0; i < 4; ++i) { LBU(x3, gback, gdoffset + i * 2); LB(x4, wback, fixedaddress + i * 2); - MUL(x9, x3, x4); + MUL(x7, x3, x4); LBU(x3, gback, gdoffset + i * 2 + 1); LB(x4, wback, fixedaddress + i * 2 + 1); MUL(x3, x3, x4); - ADD(x3, x3, x9); - if (rv64_zbb) { + ADD(x3, x3, x7); + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -585,7 +627,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LW(x3, gback, gdoffset + 0); SW(x3, gback, gdoffset + 4); } else { - GETEM(x2, 0); + GETEM(x2, 0, 6); for (int i = 0; i < 2; ++i) { // tmp32s = EX->sw[i*2+0] + EX->sw[i*2+1]; // GX->sw[4+i] = sat(tmp32s); @@ -609,7 +651,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni // GM->sd[1] = GM->sd[0]; SW(x3, gback, gdoffset + 1 * 4); } else { - GETEM(x2, 0); + GETEM(x2, 0, 4); // GM->sd[1] = EM->sd[0] + EM->sd[1]; LW(x3, wback, fixedaddress + 0 * 4); LW(x4, wback, fixedaddress + 1 * 4); @@ -629,7 +671,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LH(x3, gback, gdoffset + 2 * (i * 2 + 0)); LH(x4, gback, gdoffset + 2 * (i * 2 + 1)); SUBW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -645,14 +687,14 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LW(x3, gback, gdoffset + 0); SW(x3, gback, gdoffset + 4); } else { - GETEM(x2, 0); + GETEM(x2, 0, 6); for (int i = 0; i < 2; ++i) { // tmp32s = EX->sw[i*2+0] + EX->sw[i*2+1]; // GX->sw[4+i] = sat(tmp32s); LH(x3, wback, fixedaddress + 2 * (i * 2 + 0)); LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); SUBW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -669,7 +711,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSIGNB Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); for (int i = 0; i < 8; ++i) { LB(x3, gback, gdoffset + i); LB(x4, wback, fixedaddress + i); @@ -684,7 +726,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSIGNW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); for (int i = 0; i < 4; ++i) { LH(x3, gback, gdoffset + i * 2); LH(x4, wback, fixedaddress + i * 2); @@ -699,7 +741,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSIGND Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 4); for (int i = 0; i < 2; ++i) { LW(x3, gback, gdoffset + i * 4); LW(x4, wback, fixedaddress + i * 4); @@ -714,7 +756,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PMULHRSW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); for (int i = 0; i < 4; ++i) { LH(x3, gback, gdoffset + i * 2); LH(x4, wback, fixedaddress + i * 2); @@ -729,7 +771,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PABSB Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); for (int i = 0; i < 8; ++i) { LB(x4, wback, fixedaddress + i); BGE(x4, xZR, 4 + 4); @@ -741,7 +783,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PABSW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); for (int i = 0; i < 4; ++i) { LH(x4, wback, fixedaddress + i * 2); BGE(x4, xZR, 4 + 4); @@ -753,7 +795,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PABSD Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 4); for (int i = 0; i < 2; ++i) { LW(x4, wback, fixedaddress + i * 4); BGE(x4, xZR, 4 + 4); @@ -788,12 +830,10 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni ed = (nextop & 7) + (rex.b << 3); sse_reflect_reg(dyn, ninst, x6, ed); ADDI(x2, xEmu, offsetof(x64emu_t, xmm[ed])); + ed = x2; } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 0, 0); - if (ed != x2) { - MV(x2, ed); - } } GETG; sse_forget_reg(dyn, ninst, x6, gd); @@ -801,22 +841,22 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni sse_reflect_reg(dyn, ninst, x6, 0); switch (u8) { case 0xC8: - CALL(sha1nexte, -1); + CALL(const_sha1nexte, -1, x1, ed); break; case 0xC9: - CALL(sha1msg1, -1); + CALL(const_sha1msg1, -1, x1, ed); break; case 0xCA: - CALL(sha1msg2, -1); + CALL(const_sha1msg2, -1, x1, ed); break; case 0xCB: - CALL(sha256rnds2, -1); + CALL(const_sha256rnds2, -1, x1, ed); break; case 0xCC: - CALL(sha256msg1, -1); + CALL(const_sha256msg1, -1, x1, ed); break; case 0xCD: - CALL(sha256msg2, -1); + CALL(const_sha256msg2, -1, x1, ed); break; } break; @@ -849,7 +889,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PALIGNR Gm, Em, Ib"); nextop = F8; GETGM(); - GETEM(x2, 1); + GETEM(x2, 1, 1); u8 = F8; if (u8 > 15) { SD(xZR, gback, gdoffset); @@ -880,38 +920,48 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni ed = (nextop & 7) + (rex.b << 3); sse_reflect_reg(dyn, ninst, x6, ed); ADDI(x2, xEmu, offsetof(x64emu_t, xmm[ed])); + wback = x2; } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 0, 1); - if (wback != x2) MV(x2, wback); } u8 = F8; GETG; sse_forget_reg(dyn, ninst, x6, gd); ADDI(x1, xEmu, offsetof(x64emu_t, xmm[gd])); MOV32w(x3, u8); - CALL(sha1rnds4, -1); + CALL4(const_sha1rnds4, -1, x1, wback, x3, 0); break; default: DEFAULT; } break; -#define GO(GETFLAGS, NO, YES, F) \ - READFLAGS(F); \ - GETFLAGS; \ - nextop = F8; \ - GETGD; \ - if (MODREG) { \ - ed = xRAX + (nextop & 7) + (rex.b << 3); \ - B##NO(x1, 8); \ - MV(gd, ed); \ - } else { \ - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x4, &fixedaddress, rex, NULL, 1, 0); \ - B##NO(x1, 8); \ - LDxw(gd, ed, fixedaddress); \ - } \ - if (!rex.w) ZEROUP(gd); +#define GO(GETFLAGS, NO, YES, NATNO, NATYES, F) \ + READFLAGS_FUSION(F, x1, x2, x3, x4, x5); \ + if (!dyn->insts[ninst].nat_flags_fusion) { \ + GETFLAGS; \ + } \ + nextop = F8; \ + GETGD; \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEMV(NATYES, gd, ed); \ + } else { \ + MV##YES(gd, ed, tmp1); \ + } \ + if (!rex.w) ZEROUP(gd); \ + } else { \ + addr = geted(dyn, addr, ninst, nextop, &ed, tmp2, tmp3, &fixedaddress, rex, NULL, 1, 0); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP(NATNO, 8); \ + } else { \ + B##NO(tmp1, 8); \ + } \ + LDxw(gd, ed, fixedaddress); \ + if (!rex.w) ZEROUP(gd); \ + } GOCOND(0x40, "CMOV", "Gd, Ed"); #undef GO @@ -919,7 +969,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOVMSKPS Gd, Ex"); nextop = F8; GETGD; - GETEX(x1, 0); + GETEX(x1, 0, 12); XOR(gd, gd, gd); for (int i = 0; i < 4; ++i) { LWU(x2, wback, fixedaddress + i * 4); @@ -932,44 +982,56 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("SQRTPS Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); d0 = fpu_get_scratch(dyn); for (int i = 0; i < 4; ++i) { FLW(d0, wback, fixedaddress + 4 * i); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, d0, d0); + BNEZ(x3, 4 + 2 * 4); // isnan(d0)? copy it + FSW(d0, gback, gdoffset + i * 4); + J(4 + 5 * 4); // continue + } FSQRTS(d0, d0); - FSW(d0, gback, gdoffset + 4 * i); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, d0, d0); + BNEZ(x3, 4 + 4); // isnan(d0)? negate it + FNEGS(d0, d0); + } + FSW(d0, gback, gdoffset + i * 4); } break; case 0x52: INST_NAME("RSQRTPS Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); s0 = fpu_get_scratch(dyn); s1 = fpu_get_scratch(dyn); // 1.0f v0 = fpu_get_scratch(dyn); // 0.0f - // do accurate computation, because riscv doesn't have rsqrt - MOV32w(x3, 1); - FCVTSW(s1, x3, RD_DYN); - if (!box64_dynarec_fastnan) { + LUI(x3, 0x3f800); + FMVWX(s1, x3); // 1.0f + if (!BOX64ENV(dynarec_fastnan)) { FCVTSW(v0, xZR, RD_DYN); } for (int i = 0; i < 4; ++i) { FLW(s0, wback, fixedaddress + i * 4); - if (!box64_dynarec_fastnan) { - FLES(x3, v0, s0); // s0 >= 0.0f? - BNEZ(x3, 6 * 4); - FEQS(x3, s0, s0); // isnan(s0)? - BEQZ(x3, 2 * 4); - // s0 is negative, so generate a NaN - FDIVS(s0, s1, v0); - // s0 is a NaN, just copy it + if (!BOX64ENV(dynarec_fastnan)) { + FLTS(x3, v0, s0); // s0 > 0.0f? + BNEZ(x3, 4 + 5 * 4); + FEQS(x3, v0, s0); // s0 == 0.0f? + BEQZ(x3, 4 + 3 * 4); + FDIVS(s0, s1, v0); // generate an inf FSW(s0, gback, gdoffset + i * 4); - J(4 * 4); - // do regular computation + J(4 + 6 * 4); // continue } FSQRTS(s0, s0); FDIVS(s0, s1, s0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); // isnan(s0)? negate it + FNEGS(s0, s0); + } FSW(s0, gback, gdoffset + i * 4); } break; @@ -977,14 +1039,25 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("RCPPS Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); d0 = fpu_get_scratch(dyn); d1 = fpu_get_scratch(dyn); LUI(x3, 0x3f800); FMVWX(d0, x3); // 1.0f for (int i = 0; i < 4; ++i) { FLW(d1, wback, fixedaddress + 4 * i); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, d1, d1); + BNEZ(x3, 4 + 2 * 4); // isnan(d1)? copy it + FSW(d1, gback, gdoffset + i * 4); + J(4 + 5 * 4); // continue + } FDIVS(d1, d0, d1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, d1, d1); + BNEZ(x3, 4 + 4); // isnan(d1)? negate it + FNEGS(d1, d1); + } FSW(d1, gback, gdoffset + 4 * i); } break; @@ -994,7 +1067,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni gd = ((nextop & 0x38) >> 3) + (rex.r << 3); if (!(MODREG && gd == (nextop & 7) + (rex.b << 3))) { GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_Q(x3, x4, AND(x3, x3, x4)); } break; @@ -1002,7 +1075,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("ANDNPS Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_Q(x3, x4, NOT(x3, x3); AND(x3, x3, x4)); break; case 0x56: @@ -1011,21 +1084,20 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni gd = ((nextop & 0x38) >> 3) + (rex.r << 3); if (!(MODREG && gd == (nextop & 7) + (rex.b << 3))) { GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_Q(x3, x4, OR(x3, x3, x4)); } break; case 0x57: INST_NAME("XORPS Gx, Ex"); nextop = F8; - // TODO: it might be possible to check if SS or SD are used and not purge them to optimize a bit GETGX(); if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { // just zero dest SD(xZR, gback, gdoffset + 0); SD(xZR, gback, gdoffset + 8); } else { - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4)); } break; @@ -1033,7 +1105,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("ADDPS Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); s0 = fpu_get_scratch(dyn); s1 = fpu_get_scratch(dyn); for (int i = 0; i < 4; ++i) { @@ -1048,22 +1120,33 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MULPS Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); s0 = fpu_get_scratch(dyn); s1 = fpu_get_scratch(dyn); for (int i = 0; i < 4; ++i) { // GX->f[i] *= EX->f[i]; FLW(s0, wback, fixedaddress + i * 4); FLW(s1, gback, gdoffset + i * 4); - FMULS(s1, s1, s0); - FSW(s1, gback, gdoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + } + FMULS(s0, s0, s1); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BEQZ(x3, 16); + FEQS(x3, s0, s0); + BNEZ(x3, 8); + FNEGS(s0, s0); + } + FSW(s0, gback, gdoffset + i * 4); } break; case 0x5A: INST_NAME("CVTPS2PD Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 4); s0 = fpu_get_scratch(dyn); s1 = fpu_get_scratch(dyn); FLW(s0, wback, fixedaddress); @@ -1077,7 +1160,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("CVTDQ2PS Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); s0 = fpu_get_scratch(dyn); for (int i = 0; i < 4; ++i) { LW(x3, wback, fixedaddress + i * 4); @@ -1089,78 +1172,90 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("SUBPS Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); s0 = fpu_get_scratch(dyn); s1 = fpu_get_scratch(dyn); for (int i = 0; i < 4; ++i) { // GX->f[i] -= EX->f[i]; FLW(s0, wback, fixedaddress + i * 4); FLW(s1, gback, gdoffset + i * 4); - FSUBS(s1, s1, s0); - FSW(s1, gback, gdoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + } + FSUBS(s0, s1, s0); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BEQZ(x3, 16); + FEQS(x3, s0, s0); + BNEZ(x3, 8); + FNEGS(s0, s0); + } + FSW(s0, gback, gdoffset + i * 4); } break; case 0x5D: INST_NAME("MINPS Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); s0 = fpu_get_scratch(dyn); s1 = fpu_get_scratch(dyn); for (int i = 0; i < 4; ++i) { FLW(s0, wback, fixedaddress + i * 4); FLW(s1, gback, gdoffset + i * 4); - if (!box64_dynarec_fastnan) { - FEQS(x3, s0, s0); - FEQS(x4, s1, s1); - AND(x3, x3, x4); - BEQZ(x3, 12); - FLTS(x3, s0, s1); - BEQZ(x3, 8); - FSW(s0, gback, gdoffset + i * 4); - } else { - FMINS(s1, s1, s0); - FSW(s1, gback, gdoffset + i * 4); - } + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + BEQZ(x3, 12); + FLTS(x3, s0, s1); + BEQZ(x3, 8); + FSW(s0, gback, gdoffset + i * 4); } break; case 0x5E: INST_NAME("DIVPS Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); s0 = fpu_get_scratch(dyn); s1 = fpu_get_scratch(dyn); for (int i = 0; i < 4; ++i) { // GX->f[i] /= EX->f[i]; FLW(s0, wback, fixedaddress + i * 4); FLW(s1, gback, gdoffset + i * 4); - FDIVS(s1, s1, s0); - FSW(s1, gback, gdoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + } + FDIVS(s0, s1, s0); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BEQZ(x3, 16); + FEQS(x3, s0, s0); + BNEZ(x3, 8); + FNEGS(s0, s0); + } + FSW(s0, gback, gdoffset + i * 4); } break; case 0x5F: INST_NAME("MAXPS Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); s0 = fpu_get_scratch(dyn); s1 = fpu_get_scratch(dyn); for (int i = 0; i < 4; ++i) { FLW(s0, wback, fixedaddress + i * 4); FLW(s1, gback, gdoffset + i * 4); - if (!box64_dynarec_fastnan) { - FEQS(x3, s0, s0); - FEQS(x4, s1, s1); - AND(x3, x3, x4); - BEQZ(x3, 12); - FLTS(x3, s1, s0); - BEQZ(x3, 8); - FSW(s0, gback, gdoffset + i * 4); - } else { - FMAXS(s1, s1, s0); - FSW(s1, gback, gdoffset + i * 4); - } + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + BEQZ(x3, 12); + FLTS(x3, s1, s0); + BEQZ(x3, 8); + FSW(s0, gback, gdoffset + i * 4); } break; case 0x60: @@ -1179,7 +1274,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SB(x3, gback, gdoffset + 2 * i + 1); } } else { - GETEM(x2, 0); + GETEM(x2, 0, 3); for (int i = 0; i < 4; ++i) { // GX->ub[2 * i + 1] = EX->ub[i]; LBU(x3, wback, fixedaddress + i); @@ -1191,7 +1286,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PUNPCKLWD Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 2); // GM->uw[3] = EM->uw[1]; LHU(x3, wback, fixedaddress + 2 * 1); SH(x3, gback, gdoffset + 2 * 3); @@ -1206,7 +1301,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PUNPCKLDQ Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 1); // GM->ud[1] = EM->ud[0]; LWU(x3, wback, fixedaddress); SW(x3, gback, gdoffset + 4 * 1); @@ -1215,12 +1310,12 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PACKSSWB Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); MOV64x(x5, 127); MOV64x(x6, -128); for (int i = 0; i < 4; ++i) { LH(x3, gback, gdoffset + i * 2); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -1237,7 +1332,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } else for (int i = 0; i < 4; ++i) { LH(x3, wback, fixedaddress + i * 2); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -1253,7 +1348,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PCMPGTB Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); for (int i = 0; i < 8; ++i) { // GX->ub[i] = (GX->sb[i]>EX->sb[i])?0xFF:0x00; LB(x3, wback, fixedaddress + i); @@ -1267,14 +1362,14 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PCMPGTW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); MMX_LOOP_WS(x3, x4, SLT(x3, x4, x3); NEG(x3, x3)); break; case 0x66: INST_NAME("PCMPGTD Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 4); MMX_LOOP_DS(x3, x4, SLT(x3, x4, x3); NEG(x3, x3)); break; case 0x67: @@ -1297,7 +1392,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LW(x3, gback, gdoffset + 0 * 4); SW(x3, gback, gdoffset + 1 * 4); } else { - GETEM(x1, 0); + GETEM(x1, 0, 6); for (int i = 0; i < 4; ++i) { // GX->ub[4+i] = (EX->sw[i]<0)?0:((EX->sw[i]>0xff)?0xff:EX->sw[i]); LH(x3, wback, fixedaddress + i * 2); @@ -1326,7 +1421,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SB(x3, gback, gdoffset + 2 * i + 1); } } else { - GETEM(x2, 0); + GETEM(x2, 0, 7); for (int i = 0; i < 4; ++i) { // GX->ub[2 * i + 1] = EX->ub[i + 4]; LBU(x3, wback, fixedaddress + i + 4); @@ -1350,7 +1445,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SH(x3, gback, gdoffset + (2 * i + 1) * 2); } } else { - GETEM(x1, 0); + GETEM(x1, 0, 6); for (int i = 0; i < 2; ++i) { // GX->uw[2 * i + 1] = EX->uw[i + 2]; LHU(x3, wback, fixedaddress + (i + 2) * 2); @@ -1361,8 +1456,8 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x6A: INST_NAME("PUNPCKHDQ Gm,Em"); nextop = F8; - GETEM(x1, 0); GETGM(); + GETEM(x1, 0, 4); // GM->ud[0] = GM->ud[1]; LWU(x3, gback, gdoffset + 1 * 4); SW(x3, gback, gdoffset + 0 * 4); @@ -1392,7 +1487,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LWU(x3, gback, gdoffset); SW(x3, gback, gdoffset + 4); } else { - GETEM(x1, 0); + GETEM(x1, 0, 4); for (int i = 0; i < 2; ++i) { // GM->sw[2+i] = (EM->sd[i]<-32768)?-32768:((EM->sd[i]>32767)?32767:EM->sd[i]); LW(x3, wback, fixedaddress + i * 4); @@ -1412,9 +1507,9 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni nextop = F8; GETGM(); if (MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); if (!rex.w) { - AND(x4, ed, xMASK); + ZEXTW2(x4, ed); ed = x4; } } else { @@ -1428,7 +1523,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOVQ Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 1); LD(x3, wback, fixedaddress); SD(x3, gback, gdoffset + 0); break; @@ -1436,7 +1531,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSHUFW Gm, Em, Ib"); nextop = F8; GETGM(); - GETEM(x2, 1); + GETEM(x2, 1, 6); u8 = F8; LHU(x3, wback, fixedaddress + ((u8 >> (0 * 2)) & 3) * 2); LHU(x4, wback, fixedaddress + ((u8 >> (1 * 2)) & 3) * 2); @@ -1452,7 +1547,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni switch ((nextop >> 3) & 7) { case 2: INST_NAME("PSRLW Em, Ib"); - GETEM(x1, 1); + GETEM(x1, 1, 6); u8 = F8; if (u8 > 15) { // just zero dest @@ -1468,7 +1563,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 4: INST_NAME("PSRAW Em, Ib"); - GETEM(x1, 1); + GETEM(x1, 1, 6); u8 = F8; if (u8 > 15) u8 = 15; if (u8) { @@ -1482,7 +1577,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 6: INST_NAME("PSLLW Em, Ib"); - GETEM(x1, 1); + GETEM(x1, 1, 6); u8 = F8; if (u8 > 15) { // just zero dest @@ -1506,7 +1601,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni switch ((nextop >> 3) & 7) { case 2: INST_NAME("PSRLD Em, Ib"); - GETEM(x4, 1); + GETEM(x4, 1, 4); u8 = F8; if (u8) { if (u8 > 31) { @@ -1522,7 +1617,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 4: INST_NAME("PSRAD Em, Ib"); - GETEM(x4, 1); + GETEM(x4, 1, 4); u8 = F8; if (u8 > 31) u8 = 31; if (u8) { @@ -1535,7 +1630,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 6: INST_NAME("PSLLD Em, Ib"); - GETEM(x4, 1); + GETEM(x4, 1, 4); u8 = F8; if (u8) { if (u8 > 31) { @@ -1559,7 +1654,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni switch ((nextop >> 3) & 7) { case 2: INST_NAME("PSRLQ Em, Ib"); - GETEM(x4, 1); + GETEM(x4, 1, 1); u8 = F8; if (u8) { if (u8 > 63) { @@ -1573,7 +1668,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 6: INST_NAME("PSLLQ Em, Ib"); - GETEM(x4, 1); + GETEM(x4, 1, 1); u8 = F8; if (u8) { if (u8 > 63) { @@ -1593,28 +1688,37 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PCMPEQB Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); - for (int i = 0; i < 8; ++i) { - LBU(x3, gback, gdoffset + i); - LBU(x4, wback, fixedaddress + i); - SUB(x3, x3, x4); - SEQZ(x3, x3); - NEG(x3, x3); - SB(x3, gback, gdoffset + i); + if (cpuext.xtheadbb) { + GETEM(x2, 0, 0); + LD(x3, gback, gdoffset); + LD(x4, wback, fixedaddress); + XOR(x3, x3, x4); + TH_TSTNBZ(x3, x3); + SD(x3, gback, gdoffset); + } else { + GETEM(x2, 0, 7); + for (int i = 0; i < 8; ++i) { + LBU(x3, gback, gdoffset + i); + LBU(x4, wback, fixedaddress + i); + SUB(x3, x3, x4); + SEQZ(x3, x3); + NEG(x3, x3); + SB(x3, gback, gdoffset + i); + } } break; case 0x75: INST_NAME("PCMPEQW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); MMX_LOOP_W(x3, x4, SUB(x3, x3, x4); SEQZ(x3, x3); NEG(x3, x3)); break; case 0x76: INST_NAME("PCMPEQD Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 4); MMX_LOOP_D(x3, x4, SUB(x3, x3, x4); SEQZ(x3, x3); NEG(x3, x3)); break; case 0x77: @@ -1628,14 +1732,25 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x7E: INST_NAME("MOVD Ed, Gm"); nextop = F8; - GETGM(); - if ((nextop & 0xC0) == 0xC0) { - ed = xRAX + (nextop & 7) + (rex.b << 3); - LDxw(ed, gback, gdoffset); + gd = ((nextop & 0x38) >> 3); + v0 = mmx_get_reg(dyn, ninst, x1, x2, x3, gd); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + if (rex.w) + FMVXD(ed, v0); + else { + FMVXW(ed, v0); + ZEROUP(ed); + } } else { addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 1, 0); - LDxw(x1, gback, gdoffset); - SDxw(x1, wback, fixedaddress); + if (rex.w) { + FMVXD(x1, v0); + SD(x1, wback, fixedaddress); + } else { + FMVXW(x1, v0); + SW(x1, wback, fixedaddress); + } SMWRITE2(); } break; @@ -1643,119 +1758,145 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOVQ Em, Gm"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 1); LD(x3, gback, gdoffset + 0); SD(x3, wback, fixedaddress); break; -#define GO(GETFLAGS, NO, YES, F) \ - if (box64_dynarec_test == 2) { NOTEST(x1); } \ - READFLAGS(F); \ +#define GO(GETFLAGS, NO, YES, NATNO, NATYES, F) \ + READFLAGS_FUSION(F, x1, x2, x3, x4, x5); \ i32_ = F32S; \ + if (rex.is32bits) \ + j64 = (uint32_t)(addr + i32_); \ + else \ + j64 = addr + i32_; \ BARRIER(BARRIER_MAYBE); \ - JUMP(addr + i32_, 1); \ - GETFLAGS; \ + JUMP(j64, 1); \ + if (!dyn->insts[ninst].nat_flags_fusion) { \ + GETFLAGS; \ + } \ if (dyn->insts[ninst].x64.jmp_insts == -1 || CHECK_CACHE()) { \ /* out of the block */ \ i32 = dyn->insts[ninst].epilog - (dyn->native_size); \ - B##NO##_safe(x1, i32); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP_safe(NATNO, i32); \ + } else { \ + B##NO##_safe(tmp1, i32); \ + } \ if (dyn->insts[ninst].x64.jmp_insts == -1) { \ if (!(dyn->insts[ninst].x64.barrier & BARRIER_FLOAT)) \ - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ - jump_to_next(dyn, addr + i32_, 0, ninst, rex.is32bits); \ + fpu_purgecache(dyn, ninst, 1, tmp1, tmp2, tmp3); \ + jump_to_next(dyn, j64, 0, ninst, rex.is32bits); \ } else { \ - CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ + CacheTransform(dyn, ninst, cacheupd, tmp1, tmp2, tmp3); \ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ B(i32); \ } \ } else { \ /* inside the block */ \ i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address - (dyn->native_size); \ - B##YES##_safe(x1, i32); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP_safe(NATYES, i32); \ + } else { \ + B##YES##_safe(tmp1, i32); \ + } \ } - GOCOND(0x80, "J", "Id"); #undef GO -#define GO(GETFLAGS, NO, YES, F) \ - READFLAGS(F); \ - GETFLAGS; \ - nextop = F8; \ - S##YES(x3, x1); \ - if (MODREG) { \ - if (rex.rex) { \ - eb1 = xRAX + (nextop & 7) + (rex.b << 3); \ - eb2 = 0; \ - } else { \ - ed = (nextop & 7); \ - eb2 = (ed >> 2) * 8; \ - eb1 = xRAX + (ed & 3); \ - } \ - if (eb2) { \ - LUI(x1, 0xffff0); \ - ORI(x1, x1, 0xff); \ - AND(eb1, eb1, x1); \ - SLLI(x3, x3, 8); \ - } else { \ - ANDI(eb1, eb1, 0xf00); \ - } \ - OR(eb1, eb1, x3); \ - } else { \ - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); \ - SB(x3, ed, fixedaddress); \ - SMWRITE(); \ +#define GO(GETFLAGS, NO, YES, NATNO, NATYES, F) \ + READFLAGS_FUSION(F, x1, x2, x3, x4, x5); \ + if (!dyn->insts[ninst].nat_flags_fusion) { GETFLAGS; } \ + nextop = F8; \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVESET(NATYES, tmp3); \ + } else { \ + S##YES(tmp3, tmp1); \ + } \ + if (MODREG) { \ + if (rex.rex) { \ + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); \ + eb2 = 0; \ + } else { \ + ed = (nextop & 7); \ + eb2 = (ed >> 2) * 8; \ + eb1 = TO_NAT(ed & 3); \ + } \ + if (eb2) { \ + LUI(tmp1, 0xffff0); \ + ORI(tmp1, tmp1, 0xff); \ + AND(eb1, eb1, tmp1); \ + SLLI(tmp3, tmp3, 8); \ + } else { \ + ANDI(eb1, eb1, 0xf00); \ + } \ + OR(eb1, eb1, tmp3); \ + } else { \ + addr = geted(dyn, addr, ninst, nextop, &ed, tmp2, tmp1, &fixedaddress, rex, NULL, 1, 0); \ + SB(tmp3, ed, fixedaddress); \ + SMWRITE(); \ } - GOCOND(0x90, "SET", "Eb"); #undef GO case 0xA2: INST_NAME("CPUID"); NOTEST(x1); - MV(A1, xRAX); - CALL_(my_cpuid, -1, 0); - // BX and DX are not synchronized durring the call, so need to force the update + CALL_(const_cpuid, -1, 0, xRAX, 0); + // BX and DX are not synchronized during the call, so need to force the update LD(xRDX, xEmu, offsetof(x64emu_t, regs[_DX])); LD(xRBX, xEmu, offsetof(x64emu_t, regs[_BX])); break; case 0xA3: INST_NAME("BT Ed, Gd"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); nextop = F8; GETGD; if (MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); - SRAIxw(x1, gd, 5 + rex.w); // r1 = (gd>>5) - ADDSL(x3, wback, x1, 2 + rex.w, x1); + if (rex.w) + SRAI(x1, gd, 6); + else + SRAIW(x1, gd, 5); + if (!rex.w && !rex.is32bits) { ADDIW(x1, x1, 0); } + ADDSLy(x3, wback, x1, 2 + rex.w, x1); LDxw(x1, x3, fixedaddress); ed = x1; } - BEXT(x4, ed, gd, x2); - ANDI(xFlags, xFlags, ~1); // F_CF is 1 - OR(xFlags, xFlags, x4); + IFX (X_CF) { + BEXT(x4, ed, gd, x2); + ANDI(xFlags, xFlags, ~1); // F_CF is 1 + OR(xFlags, xFlags, x4); + } break; case 0xA4: nextop = F8; INST_NAME("SHLD Ed, Gd, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED(1); - GETGD; - u8 = F8; - emit_shld32c(dyn, ninst, rex, ed, gd, u8, x3, x4); - WBACK; + if (geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 63 : 31)) { + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED(1); + GETGD; + u8 = F8 & (rex.w ? 63 : 31); + emit_shld32c(dyn, ninst, rex, ed, gd, u8, x3, x4, x5); + WBACK; + } else { + FAKEED; + if (!rex.w && !rex.is32bits && MODREG) { ZEROUP(ed); } + F8; + } break; case 0xA5: nextop = F8; INST_NAME("SHLD Ed, Gd, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + if (BOX64DRENV(dynarec_safeflags) > 1) MAYSETFLAGS(); GETGD; GETED(0); - if(!rex.w && !rex.is32bits && MODREG) { ZEROUP(ed); } + if (!rex.w && !rex.is32bits && MODREG) { ZEROUP(ed); } ANDI(x3, xRCX, rex.w ? 0x3f : 0x1f); BEQ_NEXT(x3, xZR); emit_shld32(dyn, ninst, rex, ed, gd, x3, x4, x5, x6); @@ -1763,18 +1904,22 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0xAB: INST_NAME("BTS Ed, Gd"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); nextop = F8; GETGD; if (MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); - SRAIxw(x1, gd, 5 + rex.w); - ADDSL(x3, wback, x1, 2 + rex.w, x1); + if (rex.w) + SRAI(x1, gd, 6); + else + SRAIW(x1, gd, 5); + if (!rex.w && !rex.is32bits) { ADDIW(x1, x1, 0); } + ADDSLy(x3, wback, x1, 2 + rex.w, x1); LDxw(x1, x3, fixedaddress); ed = x1; wback = x3; @@ -1789,26 +1934,31 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni if (wback) { SDxw(ed, wback, fixedaddress); SMWRITE(); - } else if(!rex.w) { + } else if (!rex.w) { ZEROUP(ed); } break; case 0xAC: nextop = F8; INST_NAME("SHRD Ed, Gd, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED(1); - GETGD; - u8 = F8; - u8 &= (rex.w ? 0x3f : 0x1f); - emit_shrd32c(dyn, ninst, rex, ed, gd, u8, x3, x4); - WBACK; + if (geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 63 : 31)) { + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETED(1); + GETGD; + u8 = F8 & (rex.w ? 63 : 31); + emit_shrd32c(dyn, ninst, rex, ed, gd, u8, x3, x4, x5); + WBACK; + } else { + FAKEED; + if (!rex.w && !rex.is32bits && MODREG) { ZEROUP(ed); } + F8; + } break; case 0xAD: nextop = F8; INST_NAME("SHRD Ed, Gd, CL"); - SETFLAGS(X_ALL, SF_SET_PENDING); - if (box64_dynarec_safeflags > 1) + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + if (BOX64DRENV(dynarec_safeflags) > 1) MAYSETFLAGS(); GETGD; GETED(0); @@ -1845,8 +1995,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SKIPTEST(x1); fpu_purgecache(dyn, ninst, 0, x1, x2, x3); addr = geted(dyn, addr, ninst, nextop, &ed, x1, x3, &fixedaddress, rex, NULL, 0, 0); - if (ed != x1) { MV(x1, ed); } - CALL(rex.w ? ((void*)fpu_fxsave64) : ((void*)fpu_fxsave32), -1); + CALL(rex.is32bits ? (const_fpu_fxsave32) : (const_fpu_fxsave64), -1, ed, 0); break; case 1: INST_NAME("FXRSTOR Ed"); @@ -1854,31 +2003,96 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SKIPTEST(x1); fpu_purgecache(dyn, ninst, 0, x1, x2, x3); addr = geted(dyn, addr, ninst, nextop, &ed, x1, x3, &fixedaddress, rex, NULL, 0, 0); - if (ed != x1) { MV(x1, ed); } - CALL(rex.w ? ((void*)fpu_fxrstor64) : ((void*)fpu_fxrstor32), -1); + CALL(rex.is32bits ? (const_fpu_fxrstor32) : (const_fpu_fxrstor64), -1, ed, 0); break; case 2: INST_NAME("LDMXCSR Md"); GETED(0); SW(ed, xEmu, offsetof(x64emu_t, mxcsr)); - if (box64_sse_flushto0) { - // TODO: applyFlushTo0 also needs to add RISC-V support. + if (BOX64ENV(sse_flushto0)) { + /* RV <-> x86 + 0 <-> 5 inexact + 1 <-> 4 underflow + 2 <-> 3 overflow + 3 <-> 2 divide by zero + x <-> 1 denormal + 4 <-> 0 invalid operation + */ + // Doing x86 -> RV here, 543210 => 0123x4, ignore denormal + // x5 = (ed & 0b1) << 4 + SLLIW(x5, ed, 4); + ANDI(x5, x5, 16); + // x3 = x5 | ((ed & 0b100) << 1); + SLLIW(x3, ed, 1); + ANDI(x3, x3, 8); + OR(x3, x3, x5); + // x3 = x3 | (ed & 0b1000) >> 1; + SRLIW(x4, ed, 1); + ANDI(x4, x4, 4); + OR(x3, x3, x4); + // x3 = x3 | (ed & 0b10000) >> 3; + SRLIW(x5, ed, 3); + ANDI(x5, x5, 2); + OR(x3, x3, x5); + // x3 = x3 | (ed & 0b100000) >> 5; + SRLIW(x5, ed, 5); + ANDI(x5, x5, 1); + OR(x3, x3, x5); + CSRRW(xZR, x3, /* fflags */ 0x001); } break; case 3: INST_NAME("STMXCSR Md"); addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, NULL, 0, 0); LWU(x4, xEmu, offsetof(x64emu_t, mxcsr)); + if (BOX64ENV(sse_flushto0)) { + // Doing RV -> x86, 43210 => 02345, ignore denormal + ANDI(x4, x4, 0xfc0); + CSRRS(x3, xZR, /* fflags */ 0x001); + // x4 = x4 | (x3 & 0b1) << 5; + SLLIW(x5, x3, 5); + ANDI(x5, x5, 32); + OR(x4, x4, x5); + // x4 = x4 | (x3 & 0b10) << 3; + SLLIW(x6, x3, 3); + ANDI(x6, x6, 16); + OR(x4, x4, x6); + // x4 = x4 | (x3 & 0b100) << 1; + SLLIW(x6, x3, 1); + ANDI(x6, x6, 8); + OR(x4, x4, x6); + // x4 = x4 | (x3 & 0b1000) >> 1; + SRLIW(x5, x3, 1); + ANDI(x5, x5, 4); + OR(x4, x4, x5); + // x4 = x4 | (x3 & 0b10000) >> 4; + SRLIW(x5, x3, 4); + ANDI(x5, x5, 2); + OR(x4, x4, x5); + } SW(x4, wback, fixedaddress); break; + case 4: + INST_NAME("XSAVE Ed"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + MOV32w(x2, rex.w ? 0 : 1); + CALL(const_fpu_xsave, -1, ed, x2); + break; + case 5: + INST_NAME("XRSTOR Ed"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + MOV32w(x2, rex.w ? 0 : 1); + CALL(const_fpu_xrstor, -1, ed, x2); + break; case 7: INST_NAME("CLFLUSH Ed"); - MESSAGE(LOG_DUMP, "Need Optimization?\n"); - addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, NULL, 0, 0); - if (wback != A1) { - MV(A1, wback); - } - CALL_(native_clflush, -1, 0); + FAKEED; + // Placebo, TODO: we need Zicbom + SMDMB(); break; default: DEFAULT; @@ -1888,7 +2102,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0xAF: // TODO: Refine this INST_NAME("IMUL Gd, Ed"); - SETFLAGS(X_ALL, SF_PENDING); + SETFLAGS(X_ALL, SF_PENDING, NAT_FLAGS_NOFUSION); nextop = F8; GETGD; GETED(0); @@ -1921,18 +2135,22 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0xB3: INST_NAME("BTR Ed, Gd"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); nextop = F8; GETGD; if (MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); - SRAIxw(x1, gd, 5 + rex.w); - ADDSL(x3, wback, x1, 2 + rex.w, x1); + if (rex.w) + SRAI(x1, gd, 6); + else + SRAIW(x1, gd, 5); + if (!rex.w && !rex.is32bits) { ADDIW(x1, x1, 0); } + ADDSLy(x3, wback, x1, 2 + rex.w, x1); LDxw(x1, x3, fixedaddress); ed = x1; wback = x3; @@ -1948,7 +2166,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni if (wback) { SDxw(ed, wback, fixedaddress); SMWRITE(); - } else if(!rex.w) { + } else if (!rex.w) { ZEROUP(ed); } break; @@ -1956,14 +2174,15 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MOVZX Gd, Eb"); nextop = F8; GETGD; + SCRATCH_USAGE(0); if (MODREG) { if (rex.rex) { - eb1 = xRAX + (nextop & 7) + (rex.b << 3); + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); eb2 = 0; } else { ed = (nextop & 7); - eb1 = xRAX + (ed & 3); // Ax, Cx, Dx or Bx - eb2 = (ed & 4) >> 2; // L or H + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx + eb2 = (ed & 4) >> 2; // L or H } if (eb2) { SRLI(gd, eb1, 8); @@ -1982,7 +2201,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni nextop = F8; GETGD; if (MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); ZEXTH(gd, ed); } else { SMREAD(); @@ -1995,7 +2214,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni switch ((nextop >> 3) & 7) { case 4: INST_NAME("BT Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); GETED(1); u8 = F8; @@ -2006,7 +2225,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 5: INST_NAME("BTS Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); GETED(1); u8 = F8; @@ -2028,14 +2247,13 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni if (wback) { SDxw(ed, wback, fixedaddress); SMWRITE(); - } else if(!rex.w) { - ZEROUP(ed); } MARK; + if (!rex.w && !wback) ZEROUP(ed); break; case 6: INST_NAME("BTR Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); GETED(1); u8 = F8; @@ -2058,13 +2276,13 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni if (wback) { SDxw(ed, wback, fixedaddress); SMWRITE(); - } else if(!rex.w) { + } else if (!rex.w) { ZEROUP(ed); } break; case 7: INST_NAME("BTC Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); GETED(1); u8 = F8; @@ -2081,7 +2299,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni if (wback) { SDxw(ed, wback, fixedaddress); SMWRITE(); - } else if(!rex.w) { + } else if (!rex.w) { ZEROUP(ed); } break; @@ -2091,18 +2309,22 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0xBB: INST_NAME("BTC Ed, Gd"); - SETFLAGS(X_CF, SF_SUBSET); + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); nextop = F8; GETGD; if (MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); - SRAIxw(x1, gd, 5 + rex.w); - ADDSL(x3, wback, x1, 2 + rex.w, x1); + if (rex.w) + SRAI(x1, gd, 6); + else + SRAIW(x1, gd, 5); + if (!rex.w && !rex.is32bits) { ADDIW(x1, x1, 0); } + ADDSLy(x3, wback, x1, 2 + rex.w, x1); LDxw(x1, x3, fixedaddress); ed = x1; wback = x3; @@ -2117,48 +2339,63 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni if (wback) { SDxw(ed, wback, fixedaddress); SMWRITE(); - } else if(!rex.w) { + } else if (!rex.w) { ZEROUP(ed); } break; case 0xBC: INST_NAME("BSF Gd, Ed"); - SETFLAGS(X_ZF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); + CLEAR_FLAGS(); nextop = F8; GETED(0); GETGD; if (!rex.w && MODREG) { - AND(x4, ed, xMASK); + ZEXTW2(x4, ed); ed = x4; } BNE_MARK(ed, xZR); - ORI(xFlags, xFlags, 1 << F_ZF); - B_NEXT_nocond; + IFX (X_ZF) ORI(xFlags, xFlags, 1 << F_ZF); + B_MARK2_nocond; MARK; - // gd is undefined if ed is all zeros, don't worry. - CTZxw(gd, ed, rex.w, x1, x2); - ANDI(xFlags, xFlags, ~(1 << F_ZF)); + CTZxw(gd, ed, rex.w, x3, x5); + MARK2; + if (BOX64DRENV(dynarec_safeflags)) { + IFX (X_PF) emit_pf(dyn, ninst, gd, x2, x5); + } break; case 0xBD: INST_NAME("BSR Gd, Ed"); - SETFLAGS(X_ZF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); + CLEAR_FLAGS(); nextop = F8; GETED(0); GETGD; if (!rex.w && MODREG) { - AND(x4, ed, xMASK); + ZEXTW2(x4, ed); ed = x4; } BNE_MARK(ed, xZR); - ORI(xFlags, xFlags, 1 << F_ZF); - B_NEXT_nocond; + IFX (X_ZF) ORI(xFlags, xFlags, 1 << F_ZF); + B_MARK2_nocond; MARK; - ANDI(xFlags, xFlags, ~(1 << F_ZF)); - CLZxw(gd, ed, rex.w, x1, x2, x3); - ADDI(x1, xZR, rex.w ? 63 : 31); - SUB(gd, x1, gd); + CLZxw(gd, ed, rex.w, x3, x5, x7); + ADDI(x3, xZR, rex.w ? 63 : 31); + SUB(gd, x3, gd); + MARK2; + if (BOX64DRENV(dynarec_safeflags)) { + IFX (X_PF) emit_pf(dyn, ninst, gd, x2, x5); + } break; case 0xBE: INST_NAME("MOVSX Gd, Eb"); @@ -2166,12 +2403,12 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni GETGD; if (MODREG) { if (rex.rex) { - wback = xRAX + (nextop & 7) + (rex.b << 3); + wback = TO_NAT((nextop & 7) + (rex.b << 3)); wb2 = 0; } else { wback = (nextop & 7); wb2 = (wback >> 2) * 8; - wback = xRAX + (wback & 3); + wback = TO_NAT(wback & 3); } SLLI(gd, wback, 56 - wb2); SRAI(gd, gd, 56); @@ -2188,7 +2425,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni nextop = F8; GETGD; if (MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); SLLI(gd, ed, 48); SRAI(gd, gd, 48); } else { @@ -2201,37 +2438,37 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0xC0: INST_NAME("XADD Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETEB(x1, 0); GETGB(x2); if (!(MODREG && wback == gb1 && !!(wb2) == !!(gb2))) - MV(x9, ed); - emit_add8(dyn, ninst, ed, gd, x4, x5); + MV(x7, ed); + emit_add8(dyn, ninst, ed, gd, x4, x5, x6); if (!(MODREG && wback == gb1 && !!(wb2) == !!(gb2))) - MV(gd, x9); + MV(gd, x7); EBBACK(x5, 0); if (!(MODREG && wback == gb1 && !!(wb2) == !!(gb2))) GBBACK(x5); break; case 0xC1: INST_NAME("XADD Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGD; GETED(0); - if(ed!=gd) - MV(x9, ed); + if (ed != gd) + MV(x7, ed); emit_add32(dyn, ninst, rex, ed, gd, x4, x5, x6); - if(ed!=gd) - MVxw(gd, x9); + if (ed != gd) + MVxw(gd, x7); WBACK; break; case 0xC2: INST_NAME("CMPPS Gx, Ex, Ib"); nextop = F8; GETGX(); - GETEX(x2, 1); + GETEX(x2, 1, 12); u8 = F8; d0 = fpu_get_scratch(dyn); d1 = fpu_get_scratch(dyn); @@ -2289,7 +2526,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni nextop = F8; GETGD; if (MODREG) { - MVxw(xRAX + (nextop & 7) + (rex.b << 3), gd); + MVxw(TO_NAT((nextop & 7) + (rex.b << 3)), gd); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); SDxw(gd, ed, fixedaddress); @@ -2300,22 +2537,22 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni nextop = F8; GETED(1); GETGM(); - u8 = (F8)&3; + u8 = (F8) & 3; SH(ed, gback, gdoffset + u8 * 2); break; case 0xC5: INST_NAME("PEXTRW Gd,Em,Ib"); nextop = F8; GETGD; - GETEM(x2, 0); - u8 = (F8)&3; + GETEM(x2, 0, 6); + u8 = (F8) & 3; LHU(gd, wback, fixedaddress + u8 * 2); break; - case 0xC6: // TODO: Optimize this! + case 0xC6: INST_NAME("SHUFPS Gx, Ex, Ib"); nextop = F8; GETGX(); - GETEX(x2, 1); + GETEX(x2, 1, 12); u8 = F8; int32_t idx; @@ -2333,7 +2570,26 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SW(x5, gback, gdoffset + 2 * 4); SW(x6, gback, gdoffset + 3 * 4); break; - + case 0xC7: + // rep has no impact here + nextop = F8; + if (MODREG) { + switch ((nextop >> 3) & 7) { + default: + DEFAULT; + } + } else { + switch ((nextop >> 3) & 7) { + case 4: + INST_NAME("Unsupported XSAVEC Ed"); + FAKEED; + UDF(); + break; + default: + DEFAULT; + } + } + break; case 0xC8: case 0xC9: case 0xCA: @@ -2343,14 +2599,14 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0xCE: case 0xCF: INST_NAME("BSWAP Reg"); - gd = xRAX + (opcode & 7) + (rex.b << 3); + gd = TO_NAT((opcode & 7) + (rex.b << 3)); REV8xw(gd, gd, x1, x2, x3, x4); break; case 0xD1: INST_NAME("PSRLW Gm, Em"); nextop = F8; GETGM(); - GETEM(x4, 0); + GETEM(x4, 0, 1); LD(x1, wback, fixedaddress); ADDI(x2, xZR, 15); BLTU_MARK(x2, x1); @@ -2367,7 +2623,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSRLD Gm, Em"); nextop = F8; GETGM(); - GETEM(x4, 0); + GETEM(x4, 0, 1); LD(x1, wback, fixedaddress); ADDI(x2, xZR, 31); BLTU_MARK(x2, x1); @@ -2384,7 +2640,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSRLQ Gm,Em"); nextop = F8; GETGM(); - GETEM(x4, 0); + GETEM(x4, 0, 1); LD(x1, wback, fixedaddress); ADDI(x2, xZR, 63); BLTU_MARK(x2, x1); @@ -2399,7 +2655,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PADDQ Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 1); LD(x1, wback, fixedaddress); LD(x2, gback, gdoffset); ADD(x1, x1, x2); @@ -2409,17 +2665,17 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PMULLW Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); MMX_LOOP_WS(x3, x4, MULW(x3, x3, x4)); break; case 0xD7: INST_NAME("PMOVMSKB Gd, Em"); nextop = F8; GETGD; - GETEM(x2, 0); + GETEM(x2, 0, 1); LD(x1, wback, fixedaddress + 0); for (int i = 0; i < 8; i++) { - if (rv64_zbs) { + if (cpuext.zbs) { if (i == 0) { BEXTI(gd, x1, 63); } else { @@ -2434,7 +2690,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } } if (i != 0) { - if (rv64_zba) { + if (cpuext.zba) { SH1ADD(gd, gd, x6); } else { SLLI(gd, gd, 1); @@ -2447,12 +2703,12 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSUBUSB Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); for (int i = 0; i < 8; ++i) { LBU(x3, gback, gdoffset + i); LBU(x4, wback, fixedaddress + i); SUB(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MAX(x3, x3, xZR); } else { NOT(x4, x3); @@ -2466,28 +2722,21 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSUBUSW Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); - MMX_LOOP_W(x3, x4, - SUB(x3, x3, x4); - if (rv64_zbb) { - MAX(x3, x3, xZR); - } else { + GETEM(x2, 0, 6); + MMX_LOOP_W(x3, x4, SUB(x3, x3, x4); if (cpuext.zbb) { MAX(x3, x3, xZR); } else { NOT(x4, x3); SRAI(x4, x4, 63); - AND(x3, x3, x4); - } - SH(x3, gback, gdoffset + i * 2); - ); + AND(x3, x3, x4); } SH(x3, gback, gdoffset + i * 2);); break; case 0xDA: INST_NAME("PMINUB Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); for (int i = 0; i < 8; ++i) { LBU(x3, gback, gdoffset + i); LBU(x4, wback, fixedaddress + i); - if (rv64_zbb) { + if (cpuext.zbb) { MINU(x3, x3, x4); } else { BLTU(x3, x4, 8); @@ -2500,7 +2749,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PAND Gm, Em"); nextop = F8; GETGM(); - GETEM(x4, 0); + GETEM(x4, 0, 1); LD(x1, wback, fixedaddress); LD(x2, gback, gdoffset); AND(x1, x1, x2); @@ -2510,13 +2759,13 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PADDUSB Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); ADDI(x5, xZR, 0xFF); for (int i = 0; i < 8; ++i) { LBU(x3, gback, gdoffset + i); LBU(x4, wback, fixedaddress + i); ADD(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MINU(x3, x3, x5); } else { BLT(x3, x5, 8); @@ -2529,7 +2778,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PADDUSW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); MOV32w(x5, 65535); for (int i = 0; i < 4; ++i) { // tmp32s = (int32_t)GX->uw[i] + EX->uw[i]; @@ -2537,7 +2786,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LHU(x3, gback, gdoffset + i * 2); LHU(x4, wback, fixedaddress + i * 2); ADDW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MINU(x3, x3, x5); } else { BGE(x5, x3, 8); // tmp32s <= 65535? @@ -2550,11 +2799,11 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PMAXUB Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); for (int i = 0; i < 8; ++i) { LBU(x3, gback, gdoffset + i); LBU(x4, wback, fixedaddress + i); - if (rv64_zbb) { + if (cpuext.zbb) { MAXU(x3, x3, x4); } else { BLTU(x4, x3, 8); @@ -2567,10 +2816,10 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PANDN Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 1); LD(x1, gback, gdoffset); LD(x3, wback, fixedaddress); - if (rv64_zbb) { + if (cpuext.zbb) { ANDN(x1, x3, x1); } else { NOT(x1, x1); @@ -2582,7 +2831,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PAVGB Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); for (int i = 0; i < 8; ++i) { LBU(x3, gback, gdoffset + i); LBU(x4, wback, fixedaddress + i); @@ -2596,10 +2845,10 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSRAW Gm,Em"); nextop = F8; GETGM(); - GETEM(x4, 0); - LBU(x1, wback, fixedaddress); + GETEM(x4, 0, 1); + LD(x1, wback, fixedaddress); ADDI(x2, xZR, 15); - if (rv64_zbb) { + if (cpuext.zbb) { MINU(x1, x1, x2); } else { BLTU(x1, x2, 4 + 4); @@ -2615,10 +2864,10 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSRAD Gm, Em"); nextop = F8; GETGM(); - GETEM(x4, 0); - LBU(x1, wback, fixedaddress); + GETEM(x4, 0, 1); + LD(x1, wback, fixedaddress); ADDI(x2, xZR, 31); - if (rv64_zbb) { + if (cpuext.zbb) { MINU(x1, x1, x2); } else { BLTU(x1, x2, 4 + 4); @@ -2634,7 +2883,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PAVGW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); for (int i = 0; i < 4; ++i) { LHU(x3, gback, gdoffset + 2 * i); LHU(x4, wback, fixedaddress + 2 * i); @@ -2648,7 +2897,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PMULHUW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); for (int i = 0; i < 4; ++i) { LHU(x3, gback, gdoffset + 2 * i); LHU(x4, wback, fixedaddress + 2 * i); @@ -2661,7 +2910,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PMULHW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); for (int i = 0; i < 4; ++i) { LH(x3, gback, gdoffset + 2 * i); LH(x4, wback, fixedaddress + 2 * i); @@ -2686,14 +2935,14 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSUBSB Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); ADDI(x5, xZR, 0x7f); ADDI(x6, xZR, 0xf80); for (int i = 0; i < 8; ++i) { LB(x3, gback, gdoffset + i); LB(x4, wback, fixedaddress + i); SUBW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -2709,7 +2958,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSUBSW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); MOV64x(x5, 32767); MOV64x(x6, -32768); for (int i = 0; i < 4; ++i) { @@ -2718,7 +2967,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LH(x3, gback, gdoffset + 2 * i); LH(x4, wback, fixedaddress + 2 * i); SUBW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -2734,11 +2983,11 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PMINSW Gx,Ex"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); for (int i = 0; i < 4; ++i) { LH(x3, gback, gdoffset + 2 * i); LH(x4, wback, fixedaddress + 2 * i); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x4); } else { BLT(x3, x4, 8); @@ -2751,7 +3000,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("POR Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 1); LD(x3, gback, gdoffset); LD(x4, wback, fixedaddress); OR(x3, x3, x4); @@ -2761,7 +3010,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PADDSB Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); MOV64x(x5, 127); MOV64x(x6, -128); for (int i = 0; i < 8; ++i) { @@ -2770,7 +3019,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LB(x3, gback, gdoffset + i); LB(x4, wback, fixedaddress + i); ADDW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -2786,7 +3035,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PADDSW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); MOV64x(x5, 32767); MOV64x(x6, -32768); for (int i = 0; i < 4; ++i) { @@ -2795,7 +3044,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni LH(x3, gback, gdoffset + 2 * i); LH(x4, wback, fixedaddress + 2 * i); ADDW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -2811,15 +3060,10 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PMAXSW Gm,Em"); nextop = F8; GETGM(); - GETEM(x1, 0); - MMX_LOOP_WS(x3, x4, - if (rv64_zbb) { - MAX(x3, x3, x4); - } else { + GETEM(x1, 0, 6); + MMX_LOOP_WS(x3, x4, if (cpuext.zbb) { MAX(x3, x3, x4); } else { BGE(x3, x4, 8); - MV(x3, x4); - } - ); + MV(x3, x4); }); break; case 0xEF: INST_NAME("PXOR Gm,Em"); @@ -2829,7 +3073,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni // just zero dest SD(xZR, gback, gdoffset + 0); } else { - GETEM(x2, 0); + GETEM(x2, 0, 1); LD(x3, gback, gdoffset + 0); LD(x4, wback, fixedaddress); XOR(x3, x3, x4); @@ -2840,7 +3084,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSLLW Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 1); ADDI(x4, xZR, 15); LD(x1, wback, fixedaddress + 0); BLTU_MARK(x4, x1); @@ -2864,7 +3108,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSLLD Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 1); ADDI(x4, xZR, 31); LD(x1, wback, fixedaddress + 0); BLTU_MARK(x4, x1); @@ -2882,7 +3126,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSLLQ Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 1); ADDI(x4, xZR, 63); LD(x1, gback, gdoffset + 0); LD(x3, wback, fixedaddress + 0); @@ -2897,7 +3141,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PMULUDQ Gm,Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 1); LWU(x3, gback, gdoffset + 0 * 4); LWU(x4, wback, fixedaddress + 0 * 4); MUL(x3, x3, x4); @@ -2907,7 +3151,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PMADDWD Gm, Em"); nextop = F8; GETGM(); - GETEM(x5, 0); + GETEM(x5, 0, 6); for (int i = 0; i < 2; ++i) { LH(x1, gback, gdoffset + i * 4); LH(x2, gback, gdoffset + i * 4 + 2); @@ -2923,7 +3167,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSADBW Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); MV(x6, xZR); for (int i = 0; i < 8; ++i) { LBU(x3, gback, gdoffset + i); @@ -2943,10 +3187,10 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("MASKMOVQ Gm, Em"); nextop = F8; GETGM(); - GETEM(x5, 0); + GETEM(x5, 0, 7); for (int i = 0; i < 8; i++) { LB(x1, wback, fixedaddress + i); - BLT(xZR, x1, 4 * 3); + BLE(xZR, x1, 4 * 3); LB(x2, gback, gdoffset + i); SB(x2, xRDI, i); } @@ -2955,7 +3199,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSUBB Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); for (int i = 0; i < 8; ++i) { LB(x3, wback, fixedaddress + i); LB(x4, gback, gdoffset + i); @@ -2967,21 +3211,21 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PSUBW Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); MMX_LOOP_W(x3, x4, SUBW(x3, x3, x4)); break; case 0xFA: INST_NAME("PSUBD Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 4); MMX_LOOP_D(x3, x4, SUBW(x3, x3, x4)); break; case 0xFB: INST_NAME("PSUBQ Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 1); LD(x1, gback, gdoffset + 0); LD(x3, wback, fixedaddress + 0); SUB(x1, x1, x3); @@ -2991,7 +3235,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PADDB Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 7); for (int i = 0; i < 8; ++i) { // GM->sb[i] += EM->sb[i]; LB(x3, gback, gdoffset + i); @@ -3004,14 +3248,14 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("PADDW Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 6); MMX_LOOP_W(x3, x4, ADDW(x3, x3, x4)); break; case 0xFE: INST_NAME("PADDD Gm, Em"); nextop = F8; GETGM(); - GETEM(x2, 0); + GETEM(x2, 0, 4); MMX_LOOP_D(x3, x4, ADDW(x3, x3, x4)); break; default: diff --git a/src/dynarec/rv64/dynarec_rv64_0f_vector.c b/src/dynarec/rv64/dynarec_rv64_0f_vector.c new file mode 100644 index 0000000..6b81f59 --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_0f_vector.c @@ -0,0 +1,1511 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" +#include "my_cpuid.h" +#include "emu/x87emu_private.h" +#include "emu/x64shaext.h" +#include "bitutils.h" + +#include "rv64_printer.h" +#include "dynarec_rv64_private.h" +#include "dynarec_rv64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_0F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed; + uint8_t wb1, wback, wb2, gback; + uint8_t eb1, eb2; + uint8_t gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1; + int q0, q1; + int d0, d1; + int s0, s1; + uint64_t tmp64u0, tmp64u1; + int64_t j64; + int64_t fixedaddress, gdoffset; + int unscaled; + MAYUSE(wb2); + MAYUSE(gback); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(s0); + MAYUSE(j64); + MAYUSE(cacheupd); + + switch (opcode) { + case 0x10: + INST_NAME("MOVUPS Gx, Ex"); + nextop = F8; + GETG; + if (MODREG) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_vector(dyn, ninst, x1, ed, 0, dyn->vector_eew); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + VMV_V_V(v0, v1); + } else { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); // unaligned! + SMREAD(); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VLE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + } + break; + case 0x11: + INST_NAME("MOVUPS Ex, Gx"); + nextop = F8; + if (MODREG) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETGX_vector(v0, 0, dyn->vector_eew); + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_empty_vector(dyn, ninst, x1, ed); + VMV_V_V(v1, v0); + } else { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); // unaligned! + GETGX_vector(v0, 0, dyn->vector_eew); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VSE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + SMWRITE2(); + } + break; + case 0x12: + nextop = F8; + if (MODREG) { + INST_NAME("MOVHLPS Gx, Ex"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(v0, 1, VECTOR_SEW64); + GETEX_vector(v1, 0, 0, VECTOR_SEW64); + q0 = fpu_get_scratch(dyn); + VSLIDEDOWN_VI(q0, v1, 1, VECTOR_UNMASKED); + if (cpuext.xtheadvector) { + VECTOR_LOAD_VMASK(0b01, x4, 1); + VMERGE_VVM(v0, v0, q0); // implies VMASK + } else { + VMV_X_S(x4, q0); + VMV_S_X(v0, x4); + } + } else { + INST_NAME("MOVLPS Gx, Ex"); + SMREAD(); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); // unaligned! + GETGX_vector(v0, 1, VECTOR_SEW8); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + VECTOR_LOAD_VMASK(0xFF, x4, 1); + VLE8_V(v0, ed, VECTOR_MASKED, VECTOR_NFIELD1); + } + break; + case 0x13: + INST_NAME("MOVLPS Ex, Gx"); + nextop = F8; + GETG; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + v0 = sse_get_reg_vector(dyn, ninst, x1, gd, 0, VECTOR_SEW64); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + d0 = sse_get_reg_vector(dyn, ninst, x1, ed, 1, VECTOR_SEW64); + if (cpuext.xtheadvector) { + VECTOR_LOAD_VMASK(0b01, x4, 1); + VMERGE_VVM(v0, v0, v1); // implies VMASK + } else { + VMV_X_S(x4, v1); + VMV_S_X(v0, x4); + } + } else { + VMV_X_S(x4, v0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + SD(x4, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0x14: + INST_NAME("UNPCKLPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + v1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); // no more scratches! + // Zvbb VWSLL would help here.... + VWADDU_VX(v0, q0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v1, q1, xZR, VECTOR_UNMASKED); + VSLIDE1UP_VX(d0, v1, xZR, VECTOR_UNMASKED); + VOR_VV(q0, v0, d0, VECTOR_UNMASKED); + break; + case 0x15: + INST_NAME("UNPCKHPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + v1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); // no more scratches! + if (cpuext.vlen >= 32) { + VWADDU_VX(v0, q0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v1, q1, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL2, 2); + VSLIDEDOWN_VI(d0, v1, 3, VECTOR_UNMASKED); + VSLIDEDOWN_VI(v1, v0, 4, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 1); + VOR_VV(q0, v1, d0, VECTOR_UNMASKED); + } else { + // Zvbb VWSLL would help here.... + VWADDU_VX(v0, q0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v1, q1, xZR, VECTOR_UNMASKED); + VSLIDE1UP_VX(d0, v1 + 1, xZR, VECTOR_UNMASKED); + VOR_VV(q0, v0 + 1, d0, VECTOR_UNMASKED); + } + break; + case 0x16: + nextop = F8; + if (MODREG) { + INST_NAME("MOVLHPS Gx, Ex"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(v0, 1, VECTOR_SEW64); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + if (v0 == v1) { + // for vslideup.vi, cannot be overlapped + v1 = fpu_get_scratch(dyn); + VMV_V_V(v1, v0); + } + VSLIDEUP_VI(v0, v1, 1, VECTOR_UNMASKED); + } else { + INST_NAME("MOVHPS Gx, Ex"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGX_vector(v0, 1, VECTOR_SEW8); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 0); + v1 = fpu_get_scratch(dyn); + VECTOR_LOAD_VMASK(0xFF, x4, 1); + VLE8_V(v1, ed, VECTOR_MASKED, VECTOR_NFIELD1); + VSLIDEUP_VI(v0, v1, 8, VECTOR_UNMASKED); + } + break; + case 0x17: + INST_NAME("MOVHPS Ex, Gx"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(v0, 1, VECTOR_SEW64); + // EX->q[0] = GX->q[1]; + if (MODREG) { + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + q0 = fpu_get_scratch(dyn); + VSLIDE1DOWN_VX(q0, v0, xZR, VECTOR_UNMASKED); + if (cpuext.xtheadvector) { + VECTOR_LOAD_VMASK(0b01, x4, 1); + VMERGE_VVM(v1, v1, q0); // implies VMASK + } else { + VMV_X_S(x4, q0); + VMV_S_X(v1, x4); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + q0 = fpu_get_scratch(dyn); + VSLIDE1DOWN_VX(q0, v0, xZR, VECTOR_UNMASKED); + VMV_X_S(x4, q0); + SD(x4, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0x28: + INST_NAME("MOVAPS Gx, Ex"); + nextop = F8; + GETG; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_vector(dyn, ninst, x1, ed, 0, dyn->vector_eew); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + VMV_V_V(v0, v1); + } else { + SMREAD(); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VLE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + } + break; + case 0x29: + INST_NAME("MOVAPS Ex, Gx"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETGX_vector(v0, 0, dyn->vector_eew); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_empty_vector(dyn, ninst, x1, ed); + VMV_V_V(v1, v0); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VSE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + SMWRITE2(); + } + break; + case 0x2B: + INST_NAME("MOVNTPS Ex, Gx"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETGX_vector(v0, 0, dyn->vector_eew); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_empty_vector(dyn, ninst, x1, ed); + VMV_V_V(v1, v0); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VSE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + SMWRITE2(); + } + break; + case 0x2E: + case 0x2F: + return 0; + case 0x38: + nextop = F8; + switch (nextop) { + case 0x00: + INST_NAME("PSHUFB Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + ADDI(x4, xZR, 0b000010000111); + VMV_V_X(v0, x4); // broadcast the mask + VAND_VV(v0, q1, v0, VECTOR_UNMASKED); + VRGATHER_VV(v1, q0, v0, VECTOR_UNMASKED); // registers cannot be overlapped!! + VMV_V_V(q0, v1); + break; + case 0x01: + INST_NAME("PHADDW Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(v0, q0); + if (q1 & 1) VMV_V_V(d1, q1); + VSLIDEUP_VI(v0, (q1 & 1) ? d1 : q1, 4, VECTOR_UNMASKED); + VNSRL_WX(d0, v0, xZR, VECTOR_UNMASKED); + VNSRL_WI(d1, v0, 16, VECTOR_UNMASKED); + VADD_VV(q0, d1, d0, VECTOR_UNMASKED); + break; + case 0x02: + INST_NAME("PHADDD Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(v0, q0); + if (q1 & 1) VMV_V_V(d1, q1); + VSLIDEUP_VI(v0, (q1 & 1) ? d1 : q1, 2, VECTOR_UNMASKED); + ADDI(x4, xZR, 32); + VNSRL_WX(d0, v0, xZR, VECTOR_UNMASKED); + VNSRL_WX(d1, v0, x4, VECTOR_UNMASKED); + VADD_VV(q0, d1, d0, VECTOR_UNMASKED); + break; + case 0x03: + INST_NAME("PHADDSW Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(v0, q0); + if (q1 & 1) VMV_V_V(d1, q1); + VSLIDEUP_VI(v0, (q1 & 1) ? d1 : q1, 4, VECTOR_UNMASKED); + VNSRL_WX(d0, v0, xZR, VECTOR_UNMASKED); + VNSRL_WI(d1, v0, 16, VECTOR_UNMASKED); + VSADD_VV(q0, d1, d0, VECTOR_UNMASKED); + break; + case 0x04: + INST_NAME("PMADDUBSW Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); // no more scratches! + VWMULSU_VV(v0, q1, q0, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VNSRL_WI(d0, v0, 0, VECTOR_UNMASKED); + VNSRL_WI(d1, v0, 16, VECTOR_UNMASKED); + VSADD_VV(q0, d1, d0, VECTOR_UNMASKED); + break; + case 0x05: + INST_NAME("PHSUBW Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(v0, q0); + if (q1 & 1) VMV_V_V(d1, q1); + VSLIDEUP_VI(v0, (q1 & 1) ? d1 : q1, 4, VECTOR_UNMASKED); + VNSRL_WX(d0, v0, xZR, VECTOR_UNMASKED); + VNSRL_WI(d1, v0, 16, VECTOR_UNMASKED); + VSUB_VV(q0, d0, d1, VECTOR_UNMASKED); + break; + case 0x06: + INST_NAME("PHSUBD Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(v0, q0); + if (q1 & 1) VMV_V_V(d1, q1); + VSLIDEUP_VI(v0, (q1 & 1) ? d1 : q1, 2, VECTOR_UNMASKED); + ADDI(x4, xZR, 32); + VNSRL_WX(d0, v0, xZR, VECTOR_UNMASKED); + VNSRL_WX(d1, v0, x4, VECTOR_UNMASKED); + VSUB_VV(q0, d0, d1, VECTOR_UNMASKED); + break; + case 0x07: + INST_NAME("PHSUBSW Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(v0, q0); + if (q1 & 1) VMV_V_V(d1, q1); + VSLIDEUP_VI(v0, (q1 & 1) ? d1 : q1, 4, VECTOR_UNMASKED); + VNSRL_WX(d0, v0, xZR, VECTOR_UNMASKED); + VNSRL_WI(d1, v0, 16, VECTOR_UNMASKED); + VSSUB_VV(q0, d0, d1, VECTOR_UNMASKED); + break; + case 0x08 ... 0x0A: + if (nextop == 0x08) { + INST_NAME("PSIGNB Gm, Em"); + i32 = 7; + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + } else if (nextop == 0x09) { + INST_NAME("PSIGNW Gm, Em"); + i32 = 15; + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + } else { + INST_NAME("PSIGND Gm, Em"); + i32 = 31; + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + } + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VMSLT_VX(VMASK, q1, xZR, VECTOR_UNMASKED); + VRSUB_VX(q0, q0, xZR, VECTOR_MASKED); + VMSEQ_VX(VMASK, q1, xZR, VECTOR_UNMASKED); + VXOR_VV(q0, q0, q0, VECTOR_MASKED); + break; + case 0x0B: + INST_NAME("PMULHRSW Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + fpu_get_scratch(dyn); + VWMUL_VV(v0, q1, q0, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 1); + VSRL_VI(v0, v0, 14, VECTOR_UNMASKED); + VADD_VI(v0, v0, 1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 1); + VNSRL_WI(q0, v0, 1, VECTOR_UNMASKED); + break; + case 0xC8 ... 0xCD: + return 0; + default: + DEFAULT_VECTOR; + } + break; + case 0x3A: + nextop = F8; + switch (nextop) { + case 0xCC: + return 0; + default: + DEFAULT_VECTOR; + } + break; + case 0x50: + INST_NAME("MOVMSKPS Gd, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGD; + GETEX_vector(q0, 0, 0, VECTOR_SEW32); + if (cpuext.xtheadvector) { + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL8); + VSRL_VI(v0, q0, 31, VECTOR_UNMASKED); + // Force the element width to 4bit + vector_vsetvli(dyn, ninst, x4, VECTOR_SEW32, VECTOR_LMUL8, 1); + VMSNE_VX(VMASK, v0, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x4, VECTOR_SEW32, VECTOR_LMUL1, 1); + VMV_X_S(x4, VMASK); + BEXTI(gd, x4, 12); + BEXTI(x5, x4, 8); + ADDSL(gd, x5, gd, 1, x6); + BEXTI(x5, x4, 4); + ADDSL(gd, x5, gd, 1, x6); + BEXTI(x5, x4, 0); + ADDSL(gd, x5, gd, 1, x6); + } else { + VMSLT_VX(VMASK, q0, xZR, VECTOR_UNMASKED); + VMV_X_S(gd, VMASK); + ANDI(gd, gd, 0xF); + } + break; + case 0x51: + if (!BOX64ENV(dynarec_fastround)) return 0; + INST_NAME("SQRTPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(v0, 0, 0, VECTOR_SEW32); + GETGX_empty_vector(v1); + VFSQRT_V(v1, v0, VECTOR_UNMASKED); + break; + case 0x52: + if (!BOX64ENV(dynarec_fastround)) return 0; + INST_NAME("RSQRTPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(v0, 0, 0, VECTOR_SEW32); + GETGX_empty_vector(v1); + LUI(x4, 0x3f800); + FMVWX(v0, x4); // 1.0f + VFSQRT_V(v1, v0, VECTOR_UNMASKED); + VFRDIV_VF(v1, v1, v0, VECTOR_UNMASKED); + break; + case 0x53: + if (!BOX64ENV(dynarec_fastround)) return 0; + INST_NAME("RCPPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(v0, 0, 0, VECTOR_SEW32); + GETGX_empty_vector(v1); + LUI(x4, 0x3f800); + FMVWX(v0, x4); // 1.0f + VFRDIV_VF(v1, v0, v0, VECTOR_UNMASKED); + break; + case 0x54: + INST_NAME("ANDPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q0, 0, 0, VECTOR_SEW32); + GETGX_vector(v0, 1, VECTOR_SEW32); + VAND_VV(v0, v0, q0, VECTOR_UNMASKED); + break; + case 0x55: + INST_NAME("ANDNPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q0, 0, 0, VECTOR_SEW32); + GETGX_vector(v0, 1, VECTOR_SEW32); + VXOR_VI(v0, v0, 0x1f, VECTOR_UNMASKED); + VAND_VV(v0, v0, q0, VECTOR_UNMASKED); + break; + case 0x56: + INST_NAME("ORPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q0, 0, 0, VECTOR_SEW32); + GETGX_vector(v0, 1, VECTOR_SEW32); + VOR_VV(v0, v0, q0, VECTOR_UNMASKED); + break; + case 0x57: + INST_NAME("XORPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETG; + if (MODREG && ((nextop & 7) + (rex.b << 3) == gd)) { + // special case for XORPS Gx, Gx + q0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else { + q0 = sse_get_reg_vector(dyn, ninst, x1, gd, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VXOR_VV(q0, q1, q0, VECTOR_UNMASKED); + } + break; + case 0x58: + INST_NAME("ADDPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q0, 0, 0, VECTOR_SEW32); + GETGX_vector(v0, 1, VECTOR_SEW32); + VFADD_VV(v0, v0, q0, VECTOR_UNMASKED); + break; + case 0x59: + if (!BOX64ENV(dynarec_fastnan)) return 0; + INST_NAME("MULPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q0, 0, 0, VECTOR_SEW32); + GETGX_vector(v0, 1, VECTOR_SEW32); + VFMUL_VV(v0, v0, q0, VECTOR_UNMASKED); + break; + case 0x5A: + INST_NAME("CVTPS2PD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + GETGX_empty_vector(v0); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_empty_vector(v0); + } + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 0.5); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VFWCVT_F_F_V(d0, v1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL1, 1); + VMV_V_V(v0, d0); + break; + case 0x5B: + INST_NAME("CVTDQ2PS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q0, 0, 0, VECTOR_SEW32); + GETGX_empty_vector(v0); + VFCVT_F_X_V(v0, q0, VECTOR_UNMASKED); + break; + case 0x5C: + if (!BOX64ENV(dynarec_fastnan)) return 0; + INST_NAME("SUBPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q0, 0, 0, VECTOR_SEW32); + GETGX_vector(v0, 1, VECTOR_SEW32); + VFSUB_VV(v0, v0, q0, VECTOR_UNMASKED); + break; + case 0x5D: + INST_NAME("MINPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + v0 = fpu_get_scratch(dyn); + VMFEQ_VV(VMASK, q0, q0, VECTOR_UNMASKED); + VMFEQ_VV(v0, q1, q1, VECTOR_UNMASKED); + VFMIN_VV(q0, q0, q1, VECTOR_UNMASKED); + VMAND_MM(VMASK, v0, VMASK); + VXOR_VI(VMASK, VMASK, 0x1F, VECTOR_UNMASKED); + VADD_VX(q0, q1, xZR, VECTOR_MASKED); + break; + case 0x5E: + if (!BOX64ENV(dynarec_fastnan)) return 0; + INST_NAME("DIVPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + VFDIV_VV(q0, q0, q1, VECTOR_UNMASKED); + break; + case 0x5F: + INST_NAME("MAXPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + v0 = fpu_get_scratch(dyn); + VMFEQ_VV(VMASK, q0, q0, VECTOR_UNMASKED); + VMFEQ_VV(v0, q1, q1, VECTOR_UNMASKED); + VFMAX_VV(q0, q0, q1, VECTOR_UNMASKED); + VMAND_MM(VMASK, v0, VMASK); + VXOR_VI(VMASK, VMASK, 0x1F, VECTOR_UNMASKED); + VADD_VX(q0, q1, xZR, VECTOR_MASKED); + break; + case 0x60: + INST_NAME("PUNPCKLBW Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VWADDU_VX(d0, q0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v0, q1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VSLL_VI(v0, v0, 8, VECTOR_UNMASKED); + VOR_VV(q0, d0, v0, VECTOR_UNMASKED); + break; + case 0x61: + INST_NAME("PUNPCKLWD Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VWADDU_VX(d0, q0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v0, q1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + VSLL_VI(v0, v0, 16, VECTOR_UNMASKED); + VOR_VV(q0, d0, v0, VECTOR_UNMASKED); + break; + case 0x62: + INST_NAME("PUNPCKLDQ Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + MOV32w(x2, 32); + VWADDU_VX(d0, q0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v0, q1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VSLL_VX(v0, v0, x2, VECTOR_UNMASKED); + VOR_VV(q0, d0, v0, VECTOR_UNMASKED); + break; + case 0x63: + INST_NAME("PACKSSWB Gm, Em"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(d0, v0); + VSLIDEUP_VI(d0, v1, 4, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + VNCLIP_WI(v0, d0, 0, VECTOR_UNMASKED); + break; + case 0x64 ... 0x66: + if (opcode == 0x64) { + INST_NAME("PCMPGTB Gm, Em"); + u8 = VECTOR_SEW8; + } else if (opcode == 0x65) { + INST_NAME("PCMPGTW Gm, Em"); + u8 = VECTOR_SEW16; + } else { + INST_NAME("PCMPGTD Gm, Em"); + u8 = VECTOR_SEW32; + } + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, u8, 1); + VMSLT_VV(VMASK, q1, q0, VECTOR_UNMASKED); + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + VMERGE_VIM(q0, q0, 0b11111); // implies vmask and widened it + break; + case 0x67: + INST_NAME("PACKUSWB Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + if (q0 == q1) { + VMV_V_V(d0, q0); + VSLIDEUP_VI(d0, q1, 4, VECTOR_UNMASKED); // splice q0 and q1 here! + VMAX_VX(d0, d0, xZR, VECTOR_UNMASKED); + } else { + VSLIDEUP_VI(q0, q1, 4, VECTOR_UNMASKED); // splice q0 and q1 here! + VMAX_VX(d0, q0, xZR, VECTOR_UNMASKED); + } + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + VNCLIPU_WI(q0, d0, 0, VECTOR_UNMASKED); + break; + case 0x68: + INST_NAME("PUNPCKHBW Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + v1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VSLIDEDOWN_VI(v0, q0, 4, VECTOR_UNMASKED); + VSLIDEDOWN_VI(v1, q1, 4, VECTOR_UNMASKED); + VWADDU_VX(d0, v0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v0, v1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VSLL_VI(v0, v0, 8, VECTOR_UNMASKED); + VOR_VV(q0, d0, v0, VECTOR_UNMASKED); + break; + case 0x69: + INST_NAME("PUNPCKHWD Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + v1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VSLIDEDOWN_VI(v0, q0, 2, VECTOR_UNMASKED); + VSLIDEDOWN_VI(v1, q1, 2, VECTOR_UNMASKED); + VWADDU_VX(d0, v0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v0, v1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + VSLL_VI(v0, v0, 16, VECTOR_UNMASKED); + VOR_VV(q0, d0, v0, VECTOR_UNMASKED); + break; + case 0x6A: + INST_NAME("PUNPCKHDQ Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + MOV32w(x2, 32); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + v1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VSLIDEDOWN_VI(v0, q0, 1, VECTOR_UNMASKED); + VSLIDEDOWN_VI(v1, q1, 1, VECTOR_UNMASKED); + VWADDU_VX(d0, v0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v0, v1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VSLL_VX(v0, v0, x2, VECTOR_UNMASKED); + VOR_VV(q0, d0, v0, VECTOR_UNMASKED); + break; + case 0x6B: + INST_NAME("PACKSSDW Gm, Em"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(d0, v0); + VSLIDEUP_VI(d0, v1, 2, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VNCLIP_WI(v0, d0, 0, VECTOR_UNMASKED); + break; + case 0x6E: + INST_NAME("MOVD Gm, Ed"); + nextop = F8; + GETGM_vector(v0); + GETED(0); + if (rex.w) { + SET_ELEMENT_WIDTH(x3, VECTOR_SEW64, 1); + } else { + SET_ELEMENT_WIDTH(x3, VECTOR_SEW32, 1); + } + if (!cpuext.xtheadvector) { + VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + } + VMV_S_X(v0, ed); + break; + case 0x6F: + INST_NAME("MOVQ Gm, Em"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETG; + if (MODREG) { + v1 = mmx_get_reg_vector(dyn, ninst, x1, x2, x3, nextop & 7); + v0 = mmx_get_reg_empty_vector(dyn, ninst, x1, x2, x3, gd); + VMV_V_V(v0, v1); + } else { + v0 = mmx_get_reg_empty_vector(dyn, ninst, x1, x2, x3, gd); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v0, x4); + } + break; + case 0x71: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("PSRLW Em, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q0, 1); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + u8 = F8; + if (u8 > 15) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + PUTEM_vector(q0); + } else if (u8) { + MOV64x(x4, u8); + VSRL_VX(q0, q0, x4, VECTOR_UNMASKED); + PUTEM_vector(q0); + } + break; + case 4: + INST_NAME("PSRAW Em, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q0, 1); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + u8 = F8; + if (u8 > 15) u8 = 15; + if (u8) { + MOV64x(x4, u8); + VSRA_VX(q0, q0, x4, VECTOR_UNMASKED); + PUTEM_vector(q0); + } + break; + case 6: + INST_NAME("PSLLW Em, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q0, 1); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + u8 = F8; + if (u8 > 15) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + PUTEM_vector(q0); + } else if (u8) { + MOV64x(x4, u8); + VSLL_VX(q0, q0, x4, VECTOR_UNMASKED); + PUTEM_vector(q0); + } + break; + default: DEFAULT_VECTOR; + } + break; + case 0x72: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("PSRLD Em, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q0, 1); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + u8 = F8; + if (u8 > 31) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + PUTEM_vector(q0); + } else if (u8) { + MOV64x(x4, u8); + VSRL_VX(q0, q0, x4, VECTOR_UNMASKED); + PUTEM_vector(q0); + } + break; + case 4: + INST_NAME("PSRAD Em, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q0, 1); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + u8 = F8; + if (u8 > 31) u8 = 31; + if (u8) { + MOV64x(x4, u8); + VSRA_VX(q0, q0, x4, VECTOR_UNMASKED); + } + PUTEM_vector(q0); + break; + case 6: + INST_NAME("PSLLD Em, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q0, 1); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + u8 = F8; + if (u8 > 31) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + PUTEM_vector(q0); + } else if (u8) { + MOV64x(x4, u8); + VSLL_VX(q0, q0, x4, VECTOR_UNMASKED); + PUTEM_vector(q0); + } + break; + default: DEFAULT_VECTOR; + } + break; + case 0x73: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("PSRLQ Em, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q0, 1); + u8 = F8; + if (u8) { + if (u8 > 63) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else { + MOV64x(x4, u8); + VSRL_VX(q0, q0, x4, VECTOR_UNMASKED); + } + PUTEM_vector(q0); + } + break; + case 6: + INST_NAME("PSLLQ Em, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q0, 1); + u8 = F8; + if (u8) { + if (u8 > 63) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else { + MOV64x(x4, u8); + VSLL_VX(q0, q0, x4, VECTOR_UNMASKED); + } + PUTEM_vector(q0); + } + break; + default: DEFAULT_VECTOR; + } + break; + case 0x74 ... 0x76: + if (opcode == 0x74) { + INST_NAME("PCMPEQB Gm, Em"); + u8 = VECTOR_SEW8; + } else if (opcode == 0x75) { + INST_NAME("PCMPEQW Gm, Em"); + u8 = VECTOR_SEW16; + } else { + INST_NAME("PCMPEQD Gm, Em"); + u8 = VECTOR_SEW32; + } + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + SET_ELEMENT_WIDTH(x1, u8, 1); + VMSEQ_VV(VMASK, q1, q0, VECTOR_UNMASKED); + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + VMERGE_VIM(q0, q0, 0b11111); // implies vmask and widened it + break; + case 0x7F: + INST_NAME("MOVQ Em, Gm"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETG; + if (MODREG) { + v1 = mmx_get_reg_vector(dyn, ninst, x1, x2, x3, gd); + v0 = mmx_get_reg_empty_vector(dyn, ninst, x1, x2, x3, nextop & 7); + VMV_V_V(v0, v1); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + v1 = mmx_get_reg_vector(dyn, ninst, x1, x2, x3, gd); + VMV_X_S(x4, v1); + SD(x4, ed, fixedaddress); + } + break; + case 0xC2: + INST_NAME("CMPPS Gx, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(v0, 1, VECTOR_SEW32); + GETEX_vector(v1, 0, 1, VECTOR_SEW32); + u8 = F8; + if ((u8 & 7) == 0) { // Equal + VMFEQ_VV(VMASK, v0, v1, VECTOR_UNMASKED); + } else if ((u8 & 7) == 4) { // Not Equal or unordered + VMFEQ_VV(VMASK, v0, v1, VECTOR_UNMASKED); + VXOR_VI(VMASK, VMASK, 0x1F, VECTOR_UNMASKED); + } else { + d0 = fpu_get_scratch(dyn); + VMFEQ_VV(VMASK, v0, v0, VECTOR_UNMASKED); + VMFEQ_VV(d0, v1, v1, VECTOR_UNMASKED); + VMAND_MM(VMASK, VMASK, d0); + switch (u8 & 7) { + case 1: // Less than + VMFLT_VV(d0, v0, v1, VECTOR_UNMASKED); + VMAND_MM(VMASK, VMASK, d0); + break; + case 2: // Less or equal + VMFLE_VV(d0, v0, v1, VECTOR_UNMASKED); + VMAND_MM(VMASK, VMASK, d0); + break; + case 3: // NaN + VXOR_VI(VMASK, VMASK, 0x1F, VECTOR_UNMASKED); + break; + case 5: // Greater or equal or unordered + VMFLE_VV(d0, v1, v0, VECTOR_UNMASKED); + VMORN_MM(VMASK, d0, VMASK); + break; + case 6: // Greater or unordered, test inverted, N!=V so unordered or less than (inverted) + VMFLT_VV(d0, v1, v0, VECTOR_UNMASKED); + VMORN_MM(VMASK, d0, VMASK); + break; + case 7: // Not NaN + break; + } + } + VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + VXOR_VI(v0, v0, 0x1F, VECTOR_MASKED); + break; + case 0xC4: + INST_NAME("PINSRW Gm, Ed, Ib"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + if (MODREG) { + u8 = (F8) & 3; + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 1); + u8 = (F8) & 3; + LHU(x4, ed, fixedaddress); + ed = x4; + } + VECTOR_LOAD_VMASK((1 << u8), x5, 1); + v0 = fpu_get_scratch(dyn); + VMERGE_VXM(v0, q0, ed); // uses VMASK + VMV_V_V(q0, v0); + break; + case 0xC5: + INST_NAME("PEXTRW Gd, Em, Ib"); + nextop = F8; + GETGD; + if (MODREG) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q0, 1); + u8 = (F8) & 3; + v0 = fpu_get_scratch(dyn); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VSLIDEDOWN_VI(v0, q0, u8, VECTOR_UNMASKED); + VMV_X_S(gd, v0); + ZEXTH(gd, gd); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 1); + u8 = (F8) & 3; + LHU(gd, ed, u8 * 2); + } + break; + case 0xC6: + INST_NAME("SHUFPS Gx, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(v0, 1, VECTOR_SEW32); + GETEX_vector(v1, 0, 1, VECTOR_SEW32); + u8 = F8; + q0 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + if (cpuext.xtheadvector) { // lack of vrgatherei16.vv + q1 = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL1, 1); + tmp64u0 = ((((uint64_t)u8 >> 2) & 3) << 32) | (u8 & 3); + VECTOR_SPLAT_IMM(q0, tmp64u0, x4); + tmp64u1 = ((((uint64_t)u8 >> 6) & 3) << 32) | ((u8 >> 4) & 3); + if (tmp64u1 != tmp64u0) { + VECTOR_SPLAT_IMM(q1, tmp64u1, x4); + } else { + q1 = q0; + } + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 1); + VRGATHER_VV(d0, v0, q0, VECTOR_UNMASKED); + VRGATHER_VV(d1, v1, q1, VECTOR_UNMASKED); + } else { + tmp64u0 = ((((uint64_t)u8 >> 2) & 3) << 16) | (u8 & 3); + VECTOR_SPLAT_IMM(q0, tmp64u0, x4); + VRGATHEREI16_VV(d0, v0, q0, VECTOR_UNMASKED); + tmp64u1 = ((((uint64_t)u8 >> 6) & 3) << 16) | ((u8 >> 4) & 3); + if (tmp64u1 != tmp64u0) { + VECTOR_SPLAT_IMM(q0, tmp64u1, x4); + } + VRGATHEREI16_VV(d1, v1, q0, VECTOR_UNMASKED); + } + VMV_V_V(v0, d0); + VSLIDEUP_VI(v0, d1, 2, VECTOR_UNMASKED); + break; + case 0xD1: + case 0xD2: + case 0xD3: + if (opcode == 0xD1) { + INST_NAME("PSRLW Gm, Em"); + u8 = VECTOR_SEW16; + i32 = 16; + } else if (opcode == 0xD2) { + INST_NAME("PSRLD Gm, Em"); + u8 = VECTOR_SEW32; + i32 = 32; + } else { + INST_NAME("PSRLQ Gm, Em"); + u8 = VECTOR_SEW64; + i32 = 64; + } + nextop = F8; + q0 = fpu_get_scratch(dyn); + GETGM_vector(v0); + if (MODREG) { + v1 = mmx_get_reg_vector(dyn, ninst, x1, x2, x3, (nextop & 7)); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VMV_X_S(x4, v1); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x1, x3, &fixedaddress, rex, NULL, 1, 0); + LD(x4, wback, fixedaddress); + } + SET_ELEMENT_WIDTH(x1, u8, 1); + SLTIU(x3, x4, i32); + SUB(x3, xZR, x3); + VSRL_VX(v0, v0, x4, VECTOR_UNMASKED); + VAND_VX(v0, v0, x3, VECTOR_UNMASKED); + break; + case 0xD4: + INST_NAME("PADDQ Gm, Em"); + nextop = F8; + GETGM_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q1, 0); + VADD_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0xD5: + INST_NAME("PMULLW Gm, Em"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VMUL_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0xD7: + INST_NAME("PMOVMSKB Gd, Em"); + nextop = F8; + GETGD; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(q0, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + if (cpuext.xtheadvector) { + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL8); + VSRL_VI(v0, q0, 7, VECTOR_UNMASKED); + // Force the element width to 1bit + vector_vsetvli(dyn, ninst, x4, VECTOR_SEW8, VECTOR_LMUL8, 1); + VMSNE_VX(VMASK, v0, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x4, VECTOR_SEW8, VECTOR_LMUL1, 1); + } else { + VMSLT_VX(VMASK, q0, xZR, VECTOR_UNMASKED); + } + VMV_X_S(gd, VMASK); + if (!cpuext.xtheadvector) { ANDI(gd, gd, 0xff); } + break; + case 0xD8: + case 0xD9: + if (opcode == 0xD8) { + INST_NAME("PSUBUSB Gm, Em"); + u8 = VECTOR_SEW8; + } else { + INST_NAME("PSUBUSW Gm, Em"); + u8 = VECTOR_SEW16; + } + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, u8, 1); + VSSUBU_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0xDB: + INST_NAME("PAND Gm, Em"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + VAND_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0xDC: + case 0xDD: + if (opcode == 0xDC) { + INST_NAME("PADDUSB Gm, Em"); + u8 = VECTOR_SEW8; + } else { + INST_NAME("PADDUSW Gm, Em"); + u8 = VECTOR_SEW16; + } + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, u8, 1); + VSADDU_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0xDF: + INST_NAME("PANDN Gm, Em"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + VXOR_VI(v0, v0, 0x1F, VECTOR_UNMASKED); + VAND_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0xE1: + case 0xE2: + if (opcode == 0xE1) { + INST_NAME("PSRAW Gm, Em"); + u8 = VECTOR_SEW16; + i32 = 16; + } else { + INST_NAME("PSRAD Gm, Em"); + u8 = VECTOR_SEW32; + i32 = 32; + } + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + MOV32w(x5, i32 - 1); + q0 = fpu_get_scratch(dyn); + VMINU_VX(q0, v1, x5, VECTOR_UNMASKED); + VMV_X_S(x4, q0); + SET_ELEMENT_WIDTH(x1, u8, 1); + VSRA_VX(v0, v0, x4, VECTOR_UNMASKED); + break; + case 0xE5: + INST_NAME("PMULHW Gm, Em"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VMULH_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0xE7: + INST_NAME("MOVNTQ Em, Gm"); + nextop = F8; + if (MODREG) { + DEFAULT; + } else { + GETGM_vector(v0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x3, &fixedaddress, rex, NULL, 1, 0); + PUTEM_vector(v0); + } + break; + case 0xE8: + INST_NAME("PSUBSB Gm, Em"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + VSSUB_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0xE9: + INST_NAME("PSUBSW Gm, Em"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VSSUB_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0xEB: + INST_NAME("POR Gm, Em"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + VOR_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0xEC: + INST_NAME("PADDSB Gm, Em"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + VSADD_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0xED: + INST_NAME("PADDSW Gm, Em"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VSADD_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0xEF: + INST_NAME("PXOR Gm, Em"); + nextop = F8; + GETG; + if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + // special case + q0 = mmx_get_reg_empty_vector(dyn, ninst, x1, x2, x3, gd); + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else { + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + VXOR_VV(v0, v0, v1, VECTOR_UNMASKED); + } + break; + case 0xF1: + case 0xF2: + case 0xF3: + if (opcode == 0xF1) { + INST_NAME("PSLLW Gm, Em"); + u8 = VECTOR_SEW16; + i32 = 16; + } else if (opcode == 0xF2) { + INST_NAME("PSLLD Gm, Em"); + u8 = VECTOR_SEW32; + i32 = 32; + } else { + INST_NAME("PSLLQ Gm, Em"); + u8 = VECTOR_SEW64; + i32 = 64; + } + nextop = F8; + GETGM_vector(v0); + if (MODREG) { + v1 = mmx_get_reg_vector(dyn, ninst, x1, x2, x3, (nextop & 7)); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VMV_X_S(x4, v1); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x1, x3, &fixedaddress, rex, NULL, 1, 0); + LD(x4, wback, fixedaddress); + } + SET_ELEMENT_WIDTH(x1, u8, 1); + SLTIU(x3, x4, i32); + SUB(x3, xZR, x3); + VSLL_VX(v0, v0, x4, VECTOR_UNMASKED); + VAND_VX(v0, v0, x3, VECTOR_UNMASKED); + break; + case 0xF4: + INST_NAME("PMULUDQ Gx, Ex"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VWMULU_VV(d0, v0, v1, VECTOR_UNMASKED); + VMV_V_V(v0, d0); + break; + case 0xF5: + INST_NAME("PMADDWD Gm, Em"); + nextop = F8; + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + q1 = fpu_get_scratch(dyn); + q0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + ADDI(x3, xZR, 32); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VWMUL_VV(q0, v1, v0, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + VNSRL_WX(q1, q0, x3, VECTOR_UNMASKED); + VNSRL_WI(v0, q0, 0, VECTOR_UNMASKED); + VADD_VV(v0, v0, q1, VECTOR_UNMASKED); + break; + case 0xF8 ... 0xFB: + nextop = F8; + if (opcode == 0xF8) { + INST_NAME("PSUBB Gm, Em"); + u8 = VECTOR_SEW8; + } else if (opcode == 0xF9) { + INST_NAME("PSUBW Gm, Em"); + u8 = VECTOR_SEW16; + } else if (opcode == 0xFA) { + INST_NAME("PSUBD Gm, Em"); + u8 = VECTOR_SEW32; + } else { + INST_NAME("PSUBQ Gm, Em"); + u8 = VECTOR_SEW64; + } + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, u8, 1); + VSUB_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0xFC ... 0xFE: + nextop = F8; + if (opcode == 0xFC) { + INST_NAME("PADDB Gm, Em"); + u8 = VECTOR_SEW8; + } else if (opcode == 0xFD) { + INST_NAME("PADDW Gm, Em"); + u8 = VECTOR_SEW16; + } else { + INST_NAME("PADDD Gm, Em"); + u8 = VECTOR_SEW32; + } + GETGM_vector(v0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEM_vector(v1, 0); + SET_ELEMENT_WIDTH(x1, u8, 1); + VADD_VV(v0, v0, v1, VECTOR_UNMASKED); + break; + case 0x00 ... 0x0F: + case 0x18: + case 0x1F: + case 0x31: + case 0x40 ... 0x4F: + case 0x77: + case 0x7E: + case 0x80 ... 0xBF: + case 0xC0 ... 0xC1: + case 0xC3: + case 0xC7 ... 0xCF: + return 0; + default: + DEFAULT_VECTOR; + } + return addr; +} diff --git a/src/dynarec/rv64/dynarec_rv64_64.c b/src/dynarec/rv64/dynarec_rv64_64.c deleted file mode 100644 index ad022f5..0000000 --- a/src/dynarec/rv64/dynarec_rv64_64.c +++ /dev/null @@ -1,547 +0,0 @@ -#include -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" -#include "custommem.h" - -#include "rv64_printer.h" -#include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" -#include "dynarec_rv64_functions.h" - -uintptr_t dynarec64_64(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int seg, int* ok, int* need_epilog) -{ - (void)ip; (void)rep; (void)need_epilog; - - uint8_t opcode = F8; - uint8_t nextop; - uint8_t u8; - uint8_t gd, ed, eb1, eb2, gb1, gb2; - uint8_t gback, wback, wb1, wb2, wb; - int64_t i64, j64; - uint64_t u64; - int v0, v1; - int q0; - int d0; - int64_t fixedaddress, gdoffset; - int unscaled; - MAYUSE(eb1); - MAYUSE(eb2); - MAYUSE(wb1); - MAYUSE(wb2); - MAYUSE(gb1); - MAYUSE(gb2); - MAYUSE(j64); - MAYUSE(d0); - MAYUSE(q0); - MAYUSE(v0); - MAYUSE(v1); - - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - GETREX(); - - switch(opcode) { - case 0x03: - INST_NAME("ADD Gd, Seg:Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0, x5); - emit_add32(dyn, ninst, rex, gd, ed, x3, x4, x5); - break; - case 0x0F: - opcode = F8; - switch(opcode) { - case 0x11: - switch(rep) { - case 0: - INST_NAME("MOVUPS Ex,Gx"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - if(!MODREG) { - grab_segdata(dyn, addr, ninst, x4, seg); - ADD(x4, x4, wback); - wback = x4; - } - LD(x3, gback, gdoffset+0); - LD(x5, gback, gdoffset+8); - SD(x3, wback, fixedaddress+0); - SD(x5, wback, fixedaddress+8); - if(!MODREG) - SMWRITE2(); - break; - case 1: - INST_NAME("MOVSD Ex, Gx"); - nextop = F8; - GETG; - v0 = sse_get_reg(dyn, ninst, x1, gd, 0); - if(MODREG) { - ed = (nextop&7)+ (rex.b<<3); - d0 = sse_get_reg(dyn, ninst, x1, ed, 0); - FMVD(d0, v0); - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); - ADD(x4, x4, ed); - ed = x4; - FSD(v0, ed, fixedaddress); - SMWRITE2(); - } - break; - case 2: - INST_NAME("MOVSS Ex, Gx"); - nextop = F8; - GETG; - v0 = sse_get_reg(dyn, ninst, x1, gd, 1); - if(MODREG) { - q0 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 1); - FMVS(q0, v0); - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); - ADD(x4, x4, ed); - ed = x4; - FSW(v0, ed, fixedaddress); - SMWRITE2(); - } - break; - default: - DEFAULT; - } - break; - - default: - DEFAULT; - } - break; - case 0x2B: - INST_NAME("SUB Gd, Seg:Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0, x5); - emit_sub32(dyn, ninst, rex, gd, ed, x3, x4, x5); - break; - - case 0x33: - INST_NAME("XOR Gd, Seg:Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - GETGD; - GETEDO(x4, 0, x5); - emit_xor32(dyn, ninst, rex, gd, ed, x3, x4); - break; - - case 0x66: - addr = dynarec64_6664(dyn, addr, ip, ninst, rex, seg, ok, need_epilog); - break; - case 0x80: - nextop = F8; - switch((nextop>>3)&7) { - case 0: // ADD - INST_NAME("ADD Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_add8c(dyn, ninst, x1, u8, x2, x4, x5); - EBBACK(x5, 0); - break; - case 1: // OR - INST_NAME("OR Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_or8c(dyn, ninst, x1, u8, x2, x4, x5); - EBBACK(x5, 0); - break; - case 2: // ADC - INST_NAME("ADC Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_adc8c(dyn, ninst, x1, u8, x2, x4, x5, x6); - EBBACK(x5, 0); - break; - case 3: // SBB - INST_NAME("SBB Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_sbb8c(dyn, ninst, x1, u8, x2, x4, x5, x6); - EBBACK(x5, 0); - break; - case 4: // AND - INST_NAME("AND Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_and8c(dyn, ninst, x1, u8, x2, x4); - EBBACK(x5, 0); - break; - case 5: // SUB - INST_NAME("SUB Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_sub8c(dyn, ninst, x1, u8, x2, x4, x5, x6); - EBBACK(x5, 0); - break; - case 6: // XOR - INST_NAME("XOR Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - emit_xor8c(dyn, ninst, x1, u8, x2, x4); - EBBACK(x5, 0); - break; - case 7: // CMP - INST_NAME("CMP Eb, Ib"); - grab_segdata(dyn, addr, ninst, x1, seg); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEBO(x1, 1); - u8 = F8; - if(u8) { - MOV32w(x2, u8); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6); - } else { - emit_cmp8_0(dyn, ninst, x1, x3, x4); - } - break; - default: - DEFAULT; - } - break; - case 0x81: - case 0x83: - nextop = F8; - grab_segdata(dyn, addr, ninst, x6, seg); - switch((nextop>>3)&7) { - case 0: // ADD - if(opcode==0x81) {INST_NAME("ADD Ed, Id");} else {INST_NAME("ADD Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1, x5); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x9); - WBACKO(x6); - break; - case 1: // OR - if(opcode==0x81) {INST_NAME("OR Ed, Id");} else {INST_NAME("OR Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1, x5); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_or32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACKO(x6); - break; - case 2: // ADC - if(opcode==0x81) {INST_NAME("ADC Ed, Id");} else {INST_NAME("ADC Ed, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1, x5); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - MOV64xw(x5, i64); - SD(x6, xEmu, offsetof(x64emu_t, scratch)); - emit_adc32(dyn, ninst, rex, ed, x5, x3, x4, x6, x9); - LD(x6, xEmu, offsetof(x64emu_t, scratch)); - WBACKO(x6); - break; - case 3: // SBB - if(opcode==0x81) {INST_NAME("SBB Ed, Id");} else {INST_NAME("SBB Ed, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1, x5); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - MOV64xw(x5, i64); - emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4, x9); - WBACKO(x6); - break; - case 4: // AND - if(opcode==0x81) {INST_NAME("AND Ed, Id");} else {INST_NAME("AND Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1, x5); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_and32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACKO(x6); - break; - case 5: // SUB - if(opcode==0x81) {INST_NAME("SUB Ed, Id");} else {INST_NAME("SUB Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1, x5); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_sub32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x9); - WBACKO(x6); - break; - case 6: // XOR - if(opcode==0x81) {INST_NAME("XOR Ed, Id");} else {INST_NAME("XOR Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1, x5); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_xor32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACKO(x6); - break; - case 7: // CMP - if(opcode==0x81) {INST_NAME("CMP Ed, Id");} else {INST_NAME("CMP Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEDO(x6, (opcode==0x81)?4:1, x5); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - if(i64) { - MOV64xw(x2, i64); - emit_cmp32(dyn, ninst, rex, ed, x2, x3, x4, x5, x6); - } else - emit_cmp32_0(dyn, ninst, rex, ed, x3, x4); - break; - } - break; - case 0x88: - INST_NAME("MOV Seg:Eb, Gb"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop=F8; - gd = ((nextop&0x38)>>3)+(rex.r<<3); - if(rex.rex) { - gb2 = 0; - gb1 = xRAX + gd; - } else { - gb2 = ((gd&4)>>2); - gb1 = xRAX+(gd&3); - } - gd = x5; - if(gb2) { - SRLI(x5, gb1, 8); - gb1 = x5; - } - if(MODREG) { - ed = (nextop&7) + (rex.b<<3); - if(rex.rex) { - eb1 = xRAX+ed; - eb2 = 0; - } else { - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx - eb2 = ((ed&4)>>2); // L or H - } - ANDI(gd, gb1, 0xff); - if(eb2) { - MOV64x(x1, 0xffffffffffff00ffLL); - ANDI(x1, eb1, x1); - SLLI(gd, gd, 8); - OR(eb1, x1, gd); - } else { - ANDI(x1, eb1, ~0xff); - OR(eb1, x1, gd); - } - } else { - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - ADD(x4, ed, x4); - SB(gb1, x4, fixedaddress); - SMWRITE2(); - } - break; - case 0x89: - INST_NAME("MOV Seg:Ed, Gd"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop=F8; - GETGD; - if(MODREG) { // reg <= reg - MVxw(xRAX+(nextop&7)+(rex.b<<3), gd); - } else { // mem <= reg - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - ADD(x4, ed, x4); - SDxw(gd, x4, fixedaddress); - SMWRITE2(); - } - break; - - case 0x8B: - INST_NAME("MOV Gd, Seg:Ed"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop=F8; - GETGD; - if(MODREG) { // reg <= reg - MVxw(gd, xRAX+(nextop&7)+(rex.b<<3)); - } else { // mem <= reg - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - ADD(x4, ed, x4); - LDxw(gd, x4, fixedaddress); - } - break; - case 0x8E: - INST_NAME("MOV Seg,Ew"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - u8 = (nextop&0x38) >> 3; - if ((nextop&0xC0) == 0xC0) { - ed = xRAX+(nextop&7) + (rex.b<<3); - } else { - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 0, 0); - ADD(x4, wback, x4); - LHU(x1, x4, 0); - ed = x1; - } - SH(ed, xEmu, offsetof(x64emu_t, segs[u8])); - SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[u8])); - break; - case 0x8F: - INST_NAME("POP FS:Ed"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop = F8; - if (MODREG) { - POP1z(xRAX + (nextop & 7) + (rex.b << 3)); - } else { - POP1z(x3); // so this can handle POP [ESP] and maybe some variant too - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 0, 0); - if (ed == xRSP) { - ADD(x4, ed, x4); - SDz(x3, x4, 0); - } else { - // complicated to just allow a segfault that can be recovered correctly - ADDIz(xRSP, xRSP, rex.is32bits ? -4 : -8); - ADD(x4, ed, x4); - SDz(x3, x4, 0); - ADDIz(xRSP, xRSP, rex.is32bits ? 4 : 8); - } - } - break; - case 0xA1: - INST_NAME("MOV EAX,FS:Od"); - grab_segdata(dyn, addr, ninst, x4, seg); - if(rex.is32bits) - u64 = F32; - else - u64 = F64; - // TODO: could be optimized. - MOV64z(x1, u64); - ADD(x1, x1, x4); - LDxw(xRAX, x1, 0); - break; - - case 0xA3: - INST_NAME("MOV FS:Od,EAX"); - grab_segdata(dyn, addr, ninst, x4, seg); - if(rex.is32bits) - u64 = F32; - else - u64 = F64; - // TODO: could be optimized. - MOV64z(x1, u64); - ADD(x1, x1, x4); - SDxw(xRAX, x1, 0); - SMWRITE2(); - break; - - case 0xC6: - INST_NAME("MOV Seg:Eb, Ib"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop=F8; - if(MODREG) { // reg <= u8 - u8 = F8; - if(!rex.rex) { - ed = (nextop&7); - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx - eb2 = (ed&4)>>2; // L or H - } else { - eb1 = xRAX+(nextop&7)+(rex.b<<3); - eb2 = 0; - } - - if (eb2) { - // load a mask to x3 (ffffffffffff00ff) - LUI(x3, 0xffff0); - ORI(x3, x3, 0xff); - // apply mask - AND(eb1, eb1, x3); - if(u8) { - if((u8<<8)<2048) { - ADDI(x4, xZR, u8<<8); - } else { - ADDI(x4, xZR, u8); - SLLI(x4, x4, 8); - } - OR(eb1, eb1, x4); - } - } else { - ANDI(eb1, eb1, 0xf00); // mask ffffffffffffff00 - ORI(eb1, eb1, u8); - } - } else { // mem <= u8 - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 1); - u8 = F8; - if(u8) { - ADDI(x3, xZR, u8); - ed = x3; - } else - ed = xZR; - ADD(x4, wback, x4); - SB(ed, x4, fixedaddress); - SMWRITE2(); - } - break; - case 0xC7: - INST_NAME("MOV Seg:Ed, Id"); - grab_segdata(dyn, addr, ninst, x4, seg); - nextop=F8; - if(MODREG) { // reg <= i32 - i64 = F32S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV64xw(ed, i64); - } else { // mem <= i32 - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 4); - i64 = F32S; - if(i64) { - MOV64xw(x3, i64); - ed = x3; - } else - ed = xZR; - ADD(x4, wback, x4); - SDxw(ed, x4, fixedaddress); - SMWRITE2(); - } - break; - - case 0xFF: - nextop = F8; - grab_segdata(dyn, addr, ninst, x6, seg); - switch((nextop>>3)&7) { - case 6: // Push Ed - INST_NAME("PUSH Ed"); - GETEDOz(x6, 0, x3); - PUSH1z(ed); - break; - default: - DEFAULT; - } - break; - default: - DEFAULT; - } - return addr; -} diff --git a/src/dynarec/rv64/dynarec_rv64_66.c b/src/dynarec/rv64/dynarec_rv64_66.c index b0e4556..aa45796 100644 --- a/src/dynarec/rv64/dynarec_rv64_66.c +++ b/src/dynarec/rv64/dynarec_rv64_66.c @@ -5,11 +5,9 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "rv64_emitter.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -20,11 +18,11 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_rv64_functions.h" -uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { uint8_t opcode = F8; uint8_t nextop, u8; @@ -45,24 +43,15 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MAYUSE(j64); MAYUSE(lock); - while((opcode==0x2E) || (opcode==0x36) || (opcode==0x66)) // ignoring CS:, SS: or multiple 0x66 - opcode = F8; - - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - GETREX(); + if (rex.w && !(opcode == 0x0f)) // rex.w cancels "66", but not for 66 0f type of prefix + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); // addr-1, to "put back" opcode - if(rex.w && !(opcode==0x0f || opcode==0xf0 || opcode==0x64 || opcode==0x65)) // rex.w cancels "66", but not for 66 0f type of prefix - return dynarec64_00(dyn, addr-1, ip, ninst, rex, rep, ok, need_epilog); // addr-1, to "put back" opcode - - switch(opcode) { + switch (opcode) { case 0x01: INST_NAME("ADD Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_16BIT_OPERATION(ed, gd, x1, ADD(ed, ed, x1)); GETGW(x2); GETEW(x1, 0); emit_add16(dyn, ninst, x1, x2, x4, x5, x6); @@ -70,21 +59,22 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x03: INST_NAME("ADD Gw, Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_16BIT_OPERATION(gd, ed, x1, ADD(gd, gd, x1)); GETGW(x1); GETEW(x2, 0); - emit_add16(dyn, ninst, x1, x2, x3, x4, x6); + emit_add16(dyn, ninst, x1, x2, x5, x4, x6); GWBACK; break; case 0x05: INST_NAME("ADD AX, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i32 = F16; - ZEXTH(x1 , xRAX); + ZEXTH(x1, xRAX); MOV32w(x2, i32); emit_add16(dyn, ninst, x1, x2, x3, x4, x6); - INSH(xRAX, x1, x3, x4, 1, 0); + INSHz(xRAX, x1, x3, x4, 1, 0); break; case 0x06: INST_NAME("PUSH ES"); @@ -95,21 +85,22 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("POP ES"); POP1_16(x1); SH(x1, xEmu, offsetof(x64emu_t, segs[_ES])); - SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_ES])); break; case 0x09: INST_NAME("OR Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_16BIT_OPERATION(ed, gd, x1, OR(ed, ed, x1)); GETGW(x2); GETEW(x1, 0); - emit_or16(dyn, ninst, x1, x2, x4, x2); + emit_or16(dyn, ninst, x1, x2, x4, x5); EWBACK; break; case 0x0B: INST_NAME("OR Gw, Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_16BIT_OPERATION(gd, ed, x1, OR(gd, gd, x1)); GETGW(x1); GETEW(x2, 0); emit_or16(dyn, ninst, x1, x2, x4, x5); @@ -117,62 +108,78 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x0D: INST_NAME("OR AX, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i32 = F16; ZEXTH(x1, xRAX); MOV32w(x2, i32); emit_or16(dyn, ninst, x1, x2, x3, x4); - INSH(xRAX, x1, x3, x4, 1, 0); + INSHz(xRAX, x1, x3, x4, 1, 0); break; case 0x0F: - switch(rep) { - case 0: { - if (rv64_vector) { + switch (rex.rep) { + case 1: addr = dynarec64_66F20F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; + case 2: addr = dynarec64_66F30F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; + default: { + if (cpuext.vector) retaddr = dynarec64_660F_vector(dyn, addr, ip, ninst, rex, ok, need_epilog); - addr = retaddr ? retaddr : dynarec64_660F(dyn, addr, ip, ninst, rex, ok, need_epilog); - } else - addr = dynarec64_660F(dyn, addr, ip, ninst, rex, ok, need_epilog); + addr = retaddr ? retaddr : dynarec64_660F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; } - case 1: addr = dynarec64_66F20F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; - case 2: addr = dynarec64_66F30F(dyn, addr, ip, ninst, rex, ok, need_epilog); break; } break; case 0x11: INST_NAME("ADC Ew, Gw"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_16BIT_OPERATION(ed, gd, x1, { + ADD(ed, ed, x1); + ANDI(x2, xFlags, 1 << F_CF); + SLLI(x2, x2, 64 - 16); + ADD(ed, ed, x2); + }); GETGW(x2); GETEW(x1, 0); - emit_adc16(dyn, ninst, x1, x2, x4, x3, x5); + emit_adc16(dyn, ninst, x1, x2, x4, x6, x5); EWBACK; break; case 0x13: INST_NAME("ADC Gw, Ew"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_16BIT_OPERATION(gd, ed, x1, { + ADD(gd, gd, x1); + ANDI(x2, xFlags, 1 << F_CF); + SLLI(x2, x2, 64 - 16); + ADD(gd, gd, x2); + }); GETGW(x1); GETEW(x2, 0); - emit_adc16(dyn, ninst, x1, x2, x4, x3, x5); + emit_adc16(dyn, ninst, x1, x2, x4, x6, x5); GWBACK; break; case 0x15: INST_NAME("ADC AX, Iw"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); u64 = F16; ZEXTH(x1, xRAX); MOV64x(x2, u64); emit_adc16(dyn, ninst, x1, x2, x3, x4, x5); - INSH(xRAX, x1, x3, x4, 1, 0); + INSHz(xRAX, x1, x3, x4, 1, 0); break; case 0x19: INST_NAME("SBB Ew, Gw"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_16BIT_OPERATION(ed, gd, x1, { + SUB(ed, ed, x1); + ANDI(x2, xFlags, 1 << F_CF); + SLLI(x2, x2, 64 - 16); + SUB(ed, ed, x2); + }); GETGW(x2); GETEW(x1, 0); emit_sbb16(dyn, ninst, x1, x2, x4, x5, x6); @@ -181,22 +188,28 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x1B: INST_NAME("SBB Gw, Ew"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_16BIT_OPERATION(gd, ed, x1, { + SUB(gd, gd, x1); + ANDI(x2, xFlags, 1 << F_CF); + SLLI(x2, x2, 64 - 16); + SUB(gd, gd, x2); + }); GETGW(x1); GETEW(x2, 0); - emit_sbb16(dyn, ninst, x1, x2, x3, x4, x5); + emit_sbb16(dyn, ninst, x1, x2, x6, x4, x5); GWBACK; break; case 0x1D: INST_NAME("SBB AX, Iw"); READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); ZEXTH(x1, xRAX); u64 = F16; MOV64x(x2, u64); emit_sbb16(dyn, ninst, x1, x2, x3, x4, x5); - INSH(xRAX, x1, x3, x4, 1, 0); + INSHz(xRAX, x1, x3, x4, 1, 0); break; case 0x1E: INST_NAME("PUSH DS"); @@ -207,11 +220,10 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni INST_NAME("POP DS"); POP1_16(x1); SH(x1, xEmu, offsetof(x64emu_t, segs[_DS])); - SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_DS])); break; case 0x21: INST_NAME("AND Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGW(x2); GETEW(x1, 0); @@ -220,7 +232,7 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x23: INST_NAME("AND Gw, Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGW(x1); GETEW(x2, 0); @@ -229,17 +241,18 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x25: INST_NAME("AND AX, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i32 = F16; ZEXTH(x1, xRAX); MOV32w(x2, i32); emit_and16(dyn, ninst, x1, x2, x3, x4); - INSH(xRAX, x1, x3, x4, 1, 0); + INSHz(xRAX, x1, x3, x4, 1, 0); break; case 0x29: INST_NAME("SUB Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_16BIT_OPERATION(ed, gd, x1, SUB(ed, ed, x1)); GETGW(x1); GETEW(x2, 0); emit_sub16(dyn, ninst, x2, x1, x4, x5, x6); @@ -247,125 +260,92 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x2B: INST_NAME("SUB Gw, Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; + FAST_16BIT_OPERATION(gd, ed, x1, SUB(gd, gd, x1)); GETGW(x1); GETEW(x2, 0); - emit_sub16(dyn, ninst, x1, x2, x3, x4, x5); + emit_sub16(dyn, ninst, x1, x2, x6, x4, x5); GWBACK; break; case 0x2D: INST_NAME("SUB AX, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i32 = F16; ZEXTH(x1, xRAX); MOV32w(x2, i32); emit_sub16(dyn, ninst, x1, x2, x3, x4, x5); - INSH(xRAX, x1, x3, x4, 1, 0); + INSHz(xRAX, x1, x3, x4, 1, 0); break; case 0x31: INST_NAME("XOR Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - // try to determine ed and gd - ed = 0; - GETGD; - if (MODREG) { - GETED(0); - } - if (ed == gd) { - // optimize XOR Gw, Gw - CLEAR_FLAGS(); - IFX(X_PEND) { - SET_DF(x6, d_xor16); - } else IFX(X_ALL) { - SET_DFNONE(); - } - SRLI(ed, ed, 16); - SLLI(ed, ed, 16); - IFX(X_PEND) { - SH(ed, xEmu, offsetof(x64emu_t, res)); - } - IFX(X_ZF) { - ORI(xFlags, xFlags, 1 << F_ZF); - } - IFX(X_PF) { - ORI(xFlags, xFlags, 1 << F_PF); + if (MODREG && !dyn->insts[ninst].x64.gen_flags) { + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + if (ed == gd) { + SRLI(ed, ed, 16); + SLLI(ed, ed, 16); + break; } - } else { - GETGW(x2); - GETEW(x1, 0); - emit_xor16(dyn, ninst, x1, x2, x4, x5, x6); - EWBACK; } + FAST_16BIT_OPERATION(ed, gd, x1, XOR(ed, ed, x1)); + GETGW(x2); + GETEW(x1, 0); + emit_xor16(dyn, ninst, x1, x2, x4, x5, x6); + EWBACK; break; case 0x33: INST_NAME("XOR Gw, Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; - // try to determine ed and gd - ed = 0; - GETGD; - if (MODREG) { - GETED(0); - } - if (ed == gd) { - // optimize XOR Gw, Gw - CLEAR_FLAGS(); - IFX(X_PEND) { - SET_DF(x6, d_xor16); - } else IFX(X_ALL) { - SET_DFNONE(); - } - SRLI(ed, ed, 16); - SLLI(ed, ed, 16); - IFX(X_PEND) { - SH(ed, xEmu, offsetof(x64emu_t, res)); - } - IFX(X_ZF) { - ORI(xFlags, xFlags, 1 << F_ZF); - } - IFX(X_PF) { - ORI(xFlags, xFlags, 1 << F_PF); + if (MODREG && !dyn->insts[ninst].x64.gen_flags) { + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + if (ed == gd) { + SRLI(gd, gd, 16); + SLLI(gd, gd, 16); + break; } - } else { - GETGW(x1); - GETEW(x2, 0); - emit_xor16(dyn, ninst, x1, x2, x4, x5, x6); - GWBACK; } + FAST_16BIT_OPERATION(gd, ed, x1, XOR(gd, gd, x1)); + GETGW(x1); + GETEW(x2, 0); + emit_xor16(dyn, ninst, x1, x2, x4, x5, x6); + GWBACK; break; case 0x35: INST_NAME("XOR AX, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i32 = F16; ZEXTH(x1, xRAX); MOV32w(x2, i32); emit_xor16(dyn, ninst, x1, x2, x3, x4, x5); - INSH(xRAX, x1, x3, x4, 1, 0); + INSHz(xRAX, x1, x3, x4, 1, 0); break; case 0x39: INST_NAME("CMP Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGW(x2); GETEW(x1, 0); - emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6); + emit_cmp16(dyn, ninst, x1, x2, x7, x4, x5, x6); break; case 0x3B: INST_NAME("CMP Gw, Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGW(x1); GETEW(x2, 0); - emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6); + emit_cmp16(dyn, ninst, x1, x2, x7, x4, x5, x6); break; case 0x3D: INST_NAME("CMP AX, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); i32 = F16; ZEXTH(x1, xRAX); - if(i32) { + if (i32) { MOV32w(x2, i32); emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6); } else { @@ -381,14 +361,11 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x46: case 0x47: INST_NAME("INC Reg16 (32bits)"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - gd = xRAX + (opcode&7); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); + gd = TO_NAT(opcode & 7); ZEXTH(x1, gd); - emit_inc16(dyn, ninst, x1, x2, x3, x4); - LUI(x3, 0xffff0); - AND(gd, gd, x3); - OR(gd, gd, x1); - ZEROUP(gd); + emit_inc16(dyn, ninst, x1, x2, x3, x4, x5); + INSHz(gd, x1, x3, x4, 1, 0); break; case 0x48: case 0x49: @@ -399,43 +376,132 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x4E: case 0x4F: INST_NAME("DEC Reg16 (32bits)"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - gd = xRAX + (opcode&7); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); + gd = TO_NAT(opcode & 7); ZEXTH(x1, gd); emit_dec16(dyn, ninst, x1, x2, x3, x4, x5); - LUI(x3, 0xffff0); - AND(gd, gd, x3); - OR(gd, gd, x1); - ZEROUP(gd); + INSHz(gd, x1, x3, x4, 1, 0); break; - case 0x64: - addr = dynarec64_6664(dyn, addr, ip, ninst, rex, _FS, ok, need_epilog); + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + INST_NAME("PUSH reg"); + SCRATCH_USAGE(0); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); + PUSH1_16(gd); break; - case 0x65: - addr = dynarec64_6664(dyn, addr, ip, ninst, rex, _GS, ok, need_epilog); + case 0x58: + case 0x59: + case 0x5A: + case 0x5B: + case 0x5C: + case 0x5D: + case 0x5E: + case 0x5F: + INST_NAME("POP reg"); + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); + POP1_16(x1); + INSHz(gd, x1, x2, x3, 1, 0); break; - case 0x66: - addr = dynarec64_66(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); + case 0x60: + if (rex.is32bits) { + INST_NAME("PUSHA 16bits (32bits)"); + MV(x1, xRSP); + PUSH1_16(xRAX); + PUSH1_16(xRCX); + PUSH1_16(xRDX); + PUSH1_16(xRBX); + PUSH1_16(x1); + PUSH1_16(xRBP); + PUSH1_16(xRSI); + PUSH1_16(xRDI); + } else + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); + break; + case 0x61: + if (rex.is32bits) { + INST_NAME("POPA 16bits (32bits)"); + POP1_16(x1); + INSH(xRDI, x1, x5, x6, 1, 0); + POP1_16(x1); + INSH(xRSI, x1, x5, x6, 0, 0); + POP1_16(x1); + INSH(xRBP, x1, x5, x6, 0, 0); + POP1_16(x1); // RSP ignored + POP1_16(x1); + INSH(xRBX, x1, x5, x6, 0, 0); + POP1_16(x1); + INSH(xRDX, x1, x5, x6, 0, 0); + POP1_16(x1); + INSH(xRCX, x1, x5, x6, 0, 0); + POP1_16(x1); + INSH(xRAX, x1, x5, x6, 0, 0); + } else + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); + break; + case 0x68: + INST_NAME("PUSH Iw"); + u16 = F16; + if (!u16) { + PUSH1_16(xZR); + } else { + MOV32w(x2, u16); + PUSH1_16(x2); + } break; case 0x69: case 0x6B: - if(opcode==0x69) { - INST_NAME("IMUL Gw,Ew,Iw"); + if (opcode == 0x69) { + INST_NAME("IMUL Gw, Ew, Iw"); } else { - INST_NAME("IMUL Gw,Ew,Ib"); + INST_NAME("IMUL Gw, Ew, Ib"); } - SETFLAGS(X_ALL, SF_PENDING); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); nextop = F8; - UFLAG_DF(x1, d_imul16); - GETSEW(x1, (opcode==0x69)?2:1); - if(opcode==0x69) i32 = F16S; else i32 = F8S; + GETSEW(x1, (opcode == 0x69) ? 2 : 1); + if (opcode == 0x69) + i32 = F16S; + else + i32 = F8S; MOV32w(x2, i32); - MULW(x2, x2, x1); - ZEXTH(x2, x2); - UFLAG_RES(x2); - gd=x2; + MULW(x5, x2, x1); + ZEXTH(x2, x5); + SET_DFNONE(); + CLEAR_FLAGS(); + IFX (X_CF | X_OF) { + SRAIW(x6, x5, 15); + SRAIW(x7, x5, 31); + XOR(x6, x6, x7); + IFX (X_CF) SET_FLAGS_NEZ(x6, F_CF, x7); + IFX (X_OF) SET_FLAGS_NEZ(x6, F_OF2, x7); + } + IFX (X_SF) { + SRLI(x6, x5, 15 - F_SF); + ANDI(x6, x6, 1 << F_SF); + OR(xFlags, xFlags, x6); + } + IFX (X_PF) emit_pf(dyn, ninst, x5, x6, x7); + gd = x2; GWBACK; break; + case 0x6A: + INST_NAME("PUSH Ib"); + i16 = F8S; + if (!i16) { + PUSH1_16(xZR); + } else { + MOV32w(x2, (uint16_t)i16); + PUSH1_16(x2); + } + break; + case 0x6C: + case 0x6E: + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); case 0x70: case 0x71: case 0x72: @@ -446,94 +512,150 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x77: case 0x78: case 0x79: - case 0x7a: - case 0x7b: - case 0x7c: - case 0x7d: - case 0x7e: - case 0x7f: + case 0x7A: + case 0x7B: + case 0x7C: + case 0x7D: + case 0x7E: + case 0x7F: // just use regular conditional jump - return dynarec64_00(dyn, addr-1, ip, ninst, rex, rep, ok, need_epilog); + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); case 0x81: case 0x83: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: // ADD - if(opcode==0x81) {INST_NAME("ADD Ew, Iw");} else {INST_NAME("ADD Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW(x1, (opcode==0x81)?2:1); - if(opcode==0x81) u64 = F16; else u64 = (uint16_t)(int16_t)F8S; + if (opcode == 0x81) { + INST_NAME("ADD Ew, Iw"); + } else { + INST_NAME("ADD Ew, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEW(x1, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; MOV64x(x5, u64); emit_add16(dyn, ninst, ed, x5, x2, x4, x6); EWBACK; break; case 1: // OR - if(opcode==0x81) {INST_NAME("OR Ew, Iw");} else {INST_NAME("OR Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW(x1, (opcode==0x81)?2:1); - if(opcode==0x81) u64 = F16; else u64 = (uint16_t)(int16_t)F8S; + if (opcode == 0x81) { + INST_NAME("OR Ew, Iw"); + } else { + INST_NAME("OR Ew, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEW(x1, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; MOV64x(x5, u64); emit_or16(dyn, ninst, x1, x5, x2, x4); EWBACK; break; case 2: // ADC - if(opcode==0x81) {INST_NAME("ADC Ew, Iw");} else {INST_NAME("ADC Ew, Ib");} + if (opcode == 0x81) { + INST_NAME("ADC Ew, Iw"); + } else { + INST_NAME("ADC Ew, Ib"); + } READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW(x1, (opcode==0x81)?2:1); - if(opcode==0x81) u64 = F16; else u64 = (uint16_t)(int16_t)F8S; + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEW(x1, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; MOV64x(x5, u64); emit_adc16(dyn, ninst, x1, x5, x2, x4, x6); EWBACK; break; case 3: // SBB - if(opcode==0x81) {INST_NAME("SBB Ew, Iw");} else {INST_NAME("SBB Ew, Ib");} + if (opcode == 0x81) { + INST_NAME("SBB Ew, Iw"); + } else { + INST_NAME("SBB Ew, Ib"); + } READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW(x1, (opcode==0x81)?2:1); - if(opcode==0x81) u64 = F16; else u64 = (uint16_t)(int16_t)F8S; + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEW(x1, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; MOV64x(x5, u64); emit_sbb16(dyn, ninst, x1, x5, x2, x4, x6); EWBACK; break; case 4: // AND - if(opcode==0x81) {INST_NAME("AND Ew, Iw");} else {INST_NAME("AND Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW(x1, (opcode==0x81)?2:1); - if(opcode==0x81) u64 = F16; else u64 = (uint16_t)(int16_t)F8S; + if (opcode == 0x81) { + INST_NAME("AND Ew, Iw"); + } else { + INST_NAME("AND Ew, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEW(x1, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; MOV64x(x5, u64); emit_and16(dyn, ninst, x1, x5, x2, x4); EWBACK; break; case 5: // SUB - if(opcode==0x81) {INST_NAME("SUB Ew, Iw");} else {INST_NAME("SUB Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW(x1, (opcode==0x81)?2:1); - if(opcode==0x81) u64 = F16; else u64 = (uint16_t)(int16_t)F8S; + if (opcode == 0x81) { + INST_NAME("SUB Ew, Iw"); + } else { + INST_NAME("SUB Ew, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEW(x1, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; MOV64x(x5, u64); emit_sub16(dyn, ninst, x1, x5, x2, x4, x6); EWBACK; break; case 6: // XOR - if(opcode==0x81) {INST_NAME("XOR Ew, Iw");} else {INST_NAME("XOR Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW(x1, (opcode==0x81)?2:1); - if(opcode==0x81) u64 = F16; else u64 = (uint16_t)(int16_t)F8S; + if (opcode == 0x81) { + INST_NAME("XOR Ew, Iw"); + } else { + INST_NAME("XOR Ew, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEW(x1, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; MOV64x(x5, u64); emit_xor16(dyn, ninst, x1, x5, x2, x4, x6); EWBACK; break; case 7: // CMP - if(opcode==0x81) {INST_NAME("CMP Ew, Iw");} else {INST_NAME("CMP Ew, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW(x1, (opcode==0x81)?2:1); - if(opcode==0x81) u64 = F16; else u64 = (uint16_t)(int16_t)F8S; - if(u64) { + if (opcode == 0x81) { + INST_NAME("CMP Ew, Iw"); + } else { + INST_NAME("CMP Ew, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEW(x1, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; + if (u64) { MOV64x(x2, u64); - emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6); + emit_cmp16(dyn, ninst, x1, x2, x7, x4, x5, x6); } else - emit_cmp16_0(dyn, ninst, x1, x3, x4); + emit_cmp16_0(dyn, ninst, x1, x7, x4); break; default: DEFAULT; @@ -541,25 +663,24 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x85: INST_NAME("TEST Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETEW(x1, 0); GETGW(x2); - emit_test16(dyn, ninst, x1, x2, x3, x4, x5); + emit_test16(dyn, ninst, x1, x2, x6, x4, x5); break; case 0x87: - INST_NAME("(LOCK)XCHG Ew, Gw"); + INST_NAME("(LOCK) XCHG Ew, Gw"); nextop = F8; - if(MODREG) { + if (MODREG) { GETGD; GETED(0); - MV(x1, gd); - INSH(gd, ed, x3, x4, 1, 1); - INSH(ed, x1, x3, x4, 0, 1); + MV(x5, gd); + INSHz(gd, ed, x3, x4, 1, 1); + INSHz(ed, x5, x3, x4, 0, 1); } else { GETGD; addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - SMDMB(); ANDI(x3, ed, 1); BNEZ_MARK(x3); @@ -595,24 +716,26 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni B_MARK2_nocond; MARK; + SMDMB(); LHU(x1, ed, 0); SH(gd, ed, 0); + SMDMB(); MARK2; - SMDMB(); - INSH(gd, x1, x3, x4, 1, 0); + INSHz(gd, x1, x3, x4, 1, 0); } break; case 0x89: INST_NAME("MOV Ew, Gw"); nextop = F8; GETGD; - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); if (ed != gd) { - INSH(ed, gd, x2, x3, 1, 1); + INSHz(ed, gd, x2, x3, 1, 1); } } else { + SCRATCH_USAGE(0); addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); SH(gd, ed, fixedaddress); SMWRITELOCK(lock); @@ -621,31 +744,63 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x8B: INST_NAME("MOV Gw, Ew"); nextop = F8; - GETGD; // don't need GETGW neither - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); + GETGD; // don't need GETGW neither + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); if (ed != gd) { - INSH(gd, ed, x2, x3, 1, 1); + INSHz(gd, ed, x2, x3, 1, 1); } } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); SMREADLOCK(lock); LHU(x1, ed, fixedaddress); - INSH(gd, x1, x2, x3, 1, 0); + INSHz(gd, x1, x2, x3, 1, 0); } break; case 0x8C: - INST_NAME("MOV Ed, Seg"); + INST_NAME("MOV Ew, Seg"); nextop = F8; LHU(x3, xEmu, offsetof(x64emu_t, segs[(nextop & 0x38) >> 3])); - if ((nextop & 0xC0) == 0xC0) { // reg <= seg - INSH(xRAX + (nextop & 7) + (rex.b << 3), x3, x1, x2, 1, 0); + if (MODREG) { + INSHz(TO_NAT((nextop & 7) + (rex.b << 3)), x3, x1, x2, 1, 0); } else { // mem <= seg addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); SH(x3, ed, fixedaddress); SMWRITE2(); } break; + case 0x8D: + INST_NAME("LEA Gd, Ed"); + nextop = F8; + GETGD; + if (MODREG) { // reg <= reg? that's an invalid operation + DEFAULT; + } else { // mem <= reg + rex.seg = 0; + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 0, 0); + INSH(gd, ed, x5, x6, 1, 1); + } + break; + case 0x8E: + INST_NAME("MOV Seg, Ew"); + nextop = F8; + u8 = (nextop & 0x38) >> 3; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LHU(x1, wback, fixedaddress); + ed = x1; + } + SH(ed, xEmu, offsetof(x64emu_t, segs[u8])); + if((u8==_FS) || (u8==_GS)) { + // refresh offset if needed + CBZ_NEXT(ed); + MOV32w(x1, u8); + CALL(const_getsegmentbase, -1, x1, x2); + } + break; case 0x90: case 0x91: case 0x92: @@ -654,21 +809,21 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0x95: case 0x96: case 0x97: - gd = xRAX+(opcode&0x07)+(rex.b<<3); - if(gd==xRAX) { - INST_NAME("NOP"); - } else { - INST_NAME("XCHG AX, Reg"); - MV(x2, xRAX); - INSH(xRAX, gd, x3, x4, 1, 1); - INSH(gd, x2, x3, x4, 0, 1); - } + gd = TO_NAT((opcode & 0x07) + (rex.b << 3)); + if (gd == xRAX) { + INST_NAME("NOP"); + } else { + INST_NAME("XCHG AX, Reg"); + MV(x2, xRAX); + INSHz(xRAX, gd, x3, x4, 1, 1); + INSHz(gd, x2, x3, x4, 0, 1); + } break; case 0x98: INST_NAME("CBW"); SLLI(x1, xRAX, 56); SRAI(x1, x1, 56); - INSH(xRAX, x1, x2, x3, 1, 1); + INSHz(xRAX, x1, x2, x3, 1, 1); break; case 0x99: INST_NAME("CWD"); @@ -681,119 +836,119 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0x9C: INST_NAME("PUSHF"); - NOTEST(x1); READFLAGS(X_ALL); FLAGS_ADJUST_TO11(x3, xFlags, x2); PUSH1_16(x3); break; case 0x9D: INST_NAME("POPF"); - SETFLAGS(X_ALL, SF_SET); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); POP1_16(x1); FLAGS_ADJUST_FROM11(x1, x1, x2); LUI(x2, 0xffff0); AND(xFlags, xFlags, x2); OR(xFlags, xFlags, x1); - MOV32w(x1, 0x3F7FD7); + MOV32w(x1, 0x3F7FF7); AND(xFlags, xFlags, x1); ORI(xFlags, xFlags, 0x2); SET_DFNONE(); if (box64_wine) { // should this be done all the time? ANDI(x1, xFlags, 1 << F_TF); CBZ_NEXT(x1); - // go to epilog, TF should trigger at end of next opcode, so using Interpretor only + // go to epilog, TF should trigger at end of next opcode, so using Interpreter only + LWU(x4, xEmu, offsetof(x64emu_t, flags)); + ORI(x4, x4, 1<>3)&7) { + switch ((nextop >> 3) & 7) { case 0: INST_NAME("ROL Ew, Ib"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - GETEW(x1, 1); - u8 = F8; - MOV32w(x2, u8); - CALL_(rol16, x1, x3); - EWBACK; + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { + // removed PENDING on purpose + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + GETEW(x1, 1); + u8 = (F8) & 0x1f; + emit_rol16c(dyn, ninst, x1, u8, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } break; case 1: INST_NAME("ROR Ew, Ib"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - GETEW(x1, 1); - u8 = F8; - MOV32w(x2, u8); - CALL_(ror16, x1, x3); - EWBACK; + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { + // removed PENDING on purpose + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + GETEW(x1, 1); + u8 = (F8) & 0x1f; + emit_ror16c(dyn, ninst, x1, u8, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } break; case 2: INST_NAME("RCL Ew, Ib"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - GETEW(x1, 1); - u8 = F8; - MOV32w(x2, u8); - CALL_(rcl16, x1, x3); - EWBACK; + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { + READFLAGS(X_CF); + // removed PENDING on purpose + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + GETEW(x1, 1); + u8 = (F8) & 0x1f; + emit_rcl16c(dyn, ninst, ed, u8, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } break; case 3: INST_NAME("RCR Ew, Ib"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); - GETEW(x1, 1); - u8 = F8; - MOV32w(x2, u8); - CALL_(rcr16, x1, x3); - EWBACK; + if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { + READFLAGS(X_CF); + // removed PENDING on purpose + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + GETEW(x1, 1); + u8 = (F8) & 0x1f; + emit_rcr16c(dyn, ninst, ed, u8, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } break; case 4: case 6: INST_NAME("SHL Ew, Ib"); if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined GETEW(x1, 0); - u8 = (F8)&0x1f; + u8 = (F8) & 0x1f; emit_shl16c(dyn, ninst, x1, u8, x5, x4, x6); EWBACK; } else { @@ -999,11 +1190,27 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 5: INST_NAME("SHR Ew, Ib"); if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - GETEW(x1, 0); - u8 = (F8)&0x1f; - emit_shr16c(dyn, ninst, x1, u8, x5, x4, x6); - EWBACK; + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + if (MODREG && !dyn->insts[ninst].x64.gen_flags) { + // save an srli instruction... + wback = TO_NAT((nextop & 7) + (rex.b << 3)); + u8 = (F8) & 0x1f; + if (u8 > 15) { + ed = xZR; + } else { + SLLI(x1, wback, 48); + SRLI(x1, x1, 48 + u8); + ed = x1; + } + wb1 = 0; + EWBACK; + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(ed, xZR, x5, xZR); + } else { + GETEW(x1, 0); + u8 = (F8) & 0x1f; + emit_shr16c(dyn, ninst, x1, u8, x5, x4, x6); + EWBACK; + } } else { FAKEED; F8; @@ -1012,9 +1219,9 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 7: INST_NAME("SAR Ew, Ib"); if (geted_ib(dyn, addr, ninst, nextop) & 0x1f) { - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined GETSEW(x1, 0); - u8 = (F8)&0x1f; + u8 = (F8) & 0x1f; emit_sar16c(dyn, ninst, x1, u8, x5, x4, x6); EWBACK; } else { @@ -1028,11 +1235,11 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni case 0xC7: INST_NAME("MOV Ew, Iw"); nextop = F8; - if(MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); u16 = F16; MOV32w(x1, u16); - INSH(ed, x1, x2, x3, 1, 0); + INSHz(ed, x1, x2, x3, 1, 0); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 2); u16 = F16; @@ -1042,185 +1249,251 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } break; case 0xD1: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("ROL Ew, 1"); + // removed PENDING on purpose + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + GETEW(x1, 0); + emit_rol16c(dyn, ninst, x1, 1, x5, x4); + EWBACK; + break; + case 1: + INST_NAME("ROR Ew, 1"); + // removed PENDING on purpose + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + GETEW(x1, 1); + emit_ror16c(dyn, ninst, x1, 1, x5, x4); + EWBACK; + break; + case 2: + INST_NAME("RCL Ew, 1"); + READFLAGS(X_CF); + // removed PENDING on purpose + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + GETEW(x1, 0); + emit_rcl16c(dyn, ninst, x1, 1, x5, x4); + EWBACK; + break; + case 3: + INST_NAME("RCR Ew, 1"); + READFLAGS(X_CF); + // removed PENDING on purpose + SETFLAGS(X_OF | X_CF, SF_SUBSET, NAT_FLAGS_FUSION); + GETEW(x1, 0); + emit_rcr16c(dyn, ninst, x1, 1, x5, x4); + EWBACK; + break; + case 5: + INST_NAME("SHR Ew, 1"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + GETEW(x1, 0); + emit_shr16c(dyn, ninst, x1, 1, x5, x4, x6); + EWBACK; + break; + case 4: + case 6: + INST_NAME("SHL Ew, 1"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + GETEW(x1, 0); + emit_shl16c(dyn, ninst, x1, 1, x5, x4, x6); + EWBACK; + break; + case 7: + INST_NAME("SAR Ew, 1"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + GETSEW(x1, 0); + emit_sar16c(dyn, ninst, x1, 1, x5, x4, x6); + EWBACK; + break; + } + break; + case 0xD3: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: - if(opcode==0xD1) { - INST_NAME("ROL Ew, 1"); - MOV32w(x2, 1); - } else { - INST_NAME("ROL Ew, CL"); - ANDI(x2, xRCX, 0x1f); - } + INST_NAME("ROL Ew, CL"); + ANDI(x2, xRCX, 0x1f); MESSAGE(LOG_DUMP, "Need Optimization\n"); - SETFLAGS(X_OF|X_CF, SF_SET_DF); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); + if (BOX64DRENV(dynarec_safeflags) > 1) MAYSETFLAGS(); GETEW(x1, 1); - CALL_(rol16, x1, x3); + CALL_(const_rol16, x1, x3, x1, x2); EWBACK; break; case 1: - if(opcode==0xD1) { - INST_NAME("ROR Ew, 1"); - MOV32w(x2, 1); - } else { - INST_NAME("ROR Ew, CL"); - ANDI(x2, xRCX, 0x1f); - } + INST_NAME("ROR Ew, CL"); + ANDI(x2, xRCX, 0x1f); MESSAGE(LOG_DUMP, "Need Optimization\n"); - SETFLAGS(X_OF|X_CF, SF_SET_DF); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); + if (BOX64DRENV(dynarec_safeflags) > 1) MAYSETFLAGS(); GETEW(x1, 1); - CALL_(ror16, x1, x3); + CALL_(const_ror16, x1, x3, x1, x2); EWBACK; break; case 2: - if(opcode==0xD1) { - INST_NAME("RCL Ew, 1"); - MOV32w(x2, 1); - } else { - INST_NAME("RCL Ew, CL"); - ANDI(x2, xRCX, 0x1f); - } + INST_NAME("RCL Ew, CL"); + ANDI(x2, xRCX, 0x1f); MESSAGE("LOG_DUMP", "Need optimization\n"); READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); + if (BOX64DRENV(dynarec_safeflags) > 1) MAYSETFLAGS(); GETEW(x1, 1); - CALL_(rcl16, x1, x3); + CALL_(const_rcl16, x1, x3, x1, x2); EWBACK; break; case 3: - if(opcode==0xD1) { - INST_NAME("RCR Ew, 1"); - MOV32w(x2, 1); - } else { - INST_NAME("RCR Ew, CL"); - ANDI(x2, xRCX, 0x1f); - } + INST_NAME("RCR Ew, CL"); + ANDI(x2, xRCX, 0x1f); MESSAGE("LOG_DUMP", "Need optimization\n"); READFLAGS(X_CF); - SETFLAGS(X_OF|X_CF, SF_SET_DF); + SETFLAGS(X_OF | X_CF, SF_SET_DF, NAT_FLAGS_NOFUSION); + if (BOX64DRENV(dynarec_safeflags) > 1) MAYSETFLAGS(); GETEW(x1, 1); - CALL_(rcr16, x1, x3); + CALL_(const_rcr16, x1, x3, x1, x2); EWBACK; break; case 5: - if(opcode==0xD1) { - INST_NAME("SHR Ew, 1"); - MOV32w(x2, 1); - } else { - INST_NAME("SHR Ew, CL"); - ANDI(x2, xRCX, 0x1f); - BEQ_NEXT(x2, xZR); - } - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + INST_NAME("SHR Ew, CL"); + ANDI(x2, xRCX, 0x1f); + BEQ_NEXT(x2, xZR); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + if (BOX64DRENV(dynarec_safeflags) > 1) MAYSETFLAGS(); GETEW(x1, 0); emit_shr16(dyn, ninst, x1, x2, x5, x4, x6); EWBACK; break; case 4: case 6: - if(opcode==0xD1) { - INST_NAME("SHL Ew, 1"); - MOV32w(x2, 1); - } else { - INST_NAME("SHL Ew, CL"); - ANDI(x2, xRCX, 0x1f); - BEQ_NEXT(x2, xZR); - } - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + INST_NAME("SHL Ew, CL"); + ANDI(x2, xRCX, 0x1f); + BEQ_NEXT(x2, xZR); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + if (BOX64DRENV(dynarec_safeflags) > 1) MAYSETFLAGS(); GETEW(x1, 0); emit_shl16(dyn, ninst, x1, x2, x5, x4, x6); EWBACK; break; case 7: - if(opcode==0xD1) { - INST_NAME("SAR Ew, 1"); - MOV32w(x2, 1); - } else { - INST_NAME("SAR Ew, CL"); - ANDI(x2, xRCX, 0x1f); - BEQ_NEXT(x2, xZR); - } - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - if(box64_dynarec_safeflags>1) - MAYSETFLAGS(); + INST_NAME("SAR Ew, CL"); + ANDI(x2, xRCX, 0x1f); + BEQ_NEXT(x2, xZR); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); // some flags are left undefined + if (BOX64DRENV(dynarec_safeflags) > 1) MAYSETFLAGS(); GETSEW(x1, 0); emit_sar16(dyn, ninst, x1, x2, x5, x4, x6); EWBACK; break; - default: - DEFAULT; } break; - - case 0xF0: - return dynarec64_66F0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); - + case 0xE4: /* IN AL, Ib */ + case 0xE5: /* IN AX, Ib */ + case 0xE6: /* OUT Ib, AL */ + case 0xE7: /* OUT Ib, AX */ + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); + case 0xEC: /* IN AL, DX */ + case 0xED: /* IN AX, DX */ + case 0xEE: /* OUT DX, AL */ + case 0xEF: /* OUT DX, AX */ + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); case 0xF7: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: case 1: INST_NAME("TEST Ew, Iw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEW(x1, 2); u16 = F16; MOV32w(x2, u16); - emit_test16(dyn, ninst, x1, x2, x3, x4, x5); + emit_test16(dyn, ninst, x1, x2, x6, x4, x5); break; case 2: INST_NAME("NOT Ew"); GETEW(x1, 0); - MOV32w(x3, 0xffff); - XOR(ed, ed, x3); // No flags affected + MOV32w(x5, 0xffff); + XOR(ed, ed, x5); // No flags affected EWBACK; break; case 3: INST_NAME("NEG Ew"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETEW(x1, 0); - emit_neg16(dyn, ninst, ed, x2, x4); + emit_neg16(dyn, ninst, ed, x2, x4, x5); EWBACK; break; + case 4: + INST_NAME("MUL AX, Ew"); + SETFLAGS(X_ALL, SF_PENDING, NAT_FLAGS_NOFUSION); + GETEW(x1, 0); + ZEXTH(x2, xRAX); + MULW(x1, x2, x1); + ZEROUP(x1); + UFLAG_RES(x1); + INSHz(xRAX, x1, x4, x5, 1, 1); + SRLI(xRDX, xRDX, 16); + SLLI(xRDX, xRDX, 16); + SRLI(x1, x1, 16); + OR(xRDX, xRDX, x1); + UFLAG_DF(x1, d_mul16); + break; + case 5: + INST_NAME("IMUL AX, Ew"); + SETFLAGS(X_ALL, SF_PENDING, NAT_FLAGS_NOFUSION); + GETSEW(x1, 0); + SLLI(x2, xRAX, 16); + SRAIW(x2, x2, 16); + MULW(x1, x2, x1); + ZEROUP(x1); + UFLAG_RES(x1); + INSHz(xRAX, x1, x4, x5, 1, 1); + SRLI(xRDX, xRDX, 16); + SLLI(xRDX, xRDX, 16); + SRLI(x1, x1, 16); + OR(xRDX, xRDX, x1); + UFLAG_DF(x1, d_imul16); + break; case 6: INST_NAME("DIV Ew"); - SETFLAGS(X_ALL, SF_SET); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); SET_DFNONE(); GETEW(x1, 0); ZEXTH(x2, xRAX); - SLLI(x3, xRDX, 48); - SRLI(x3, x3, 32); - OR(x2, x2, x3); - if(box64_dynarec_div0) { + SLLI(x7, xRDX, 48); + SRLI(x7, x7, 32); + OR(x2, x2, x7); + if (BOX64ENV(dynarec_div0)) { BNE_MARK3(ed, xZR); - GETIP_(ip); + GETIP_(ip, x7); STORE_XEMU_CALL(x6); - CALL(native_div0, -1); + CALL(const_native_div0, -1, 0, 0); CLEARIP(); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); MARK3; } - DIVUW(x3, x2, ed); + DIVUW(x7, x2, ed); REMUW(x4, x2, ed); - INSH(xRAX, x3, x5, x6, 1, 1); - INSH(xRDX, x4, x5, x6, 0, 1); + INSHz(xRAX, x7, x5, x6, 1, 1); + INSHz(xRDX, x4, x5, x6, 0, 1); + SET_DFNONE(); + CLEAR_FLAGS(); + ADDI(x5, xZR, ((1 << F_ZF) | (1 << F_PF))); + OR(xFlags, xFlags, x5); break; case 7: INST_NAME("IDIV Ew"); NOTEST(x1); - SETFLAGS(X_ALL, SF_SET); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); SET_DFNONE(); GETSEW(x1, 0); - if(box64_dynarec_div0) { + if (BOX64ENV(dynarec_div0)) { BNE_MARK3(ed, xZR); - GETIP_(ip); + GETIP_(ip, x7); STORE_XEMU_CALL(x6); - CALL(native_div0, -1); + CALL(const_native_div0, -1, 0, 0); CLEARIP(); LOAD_XEMU_CALL(); jump_to_epilog(dyn, 0, xRIP, ninst); @@ -1232,31 +1505,38 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni OR(x2, x2, x3); DIVW(x3, x2, ed); REMW(x4, x2, ed); - INSH(xRAX, x3, x5, x6, 1, 1); - INSH(xRDX, x4, x5, x6, 0, 1); + INSHz(xRAX, x3, x5, x6, 1, 1); + INSHz(xRDX, x4, x5, x6, 0, 1); break; default: DEFAULT; } break; - + case 0xF8: + case 0xF9: + return dynarec64_00(dyn, addr - 1, ip, ninst, rex, ok, need_epilog); case 0xFF: nextop = F8; - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: INST_NAME("INC Ew"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); GETEW(x1, 0); - emit_inc16(dyn, ninst, x1, x2, x4, x5); + emit_inc16(dyn, ninst, x1, x2, x4, x5, x6); EWBACK; break; case 1: INST_NAME("DEC Ew"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); GETEW(x1, 0); emit_dec16(dyn, ninst, x1, x2, x4, x5, x6); EWBACK; break; + case 6: // Push Ew + INST_NAME("PUSH Ew"); + GETEW(x1, 0); + PUSH1_16(ed); + break; default: DEFAULT; } diff --git a/src/dynarec/rv64/dynarec_rv64_660f.c b/src/dynarec/rv64/dynarec_rv64_660f.c index c5cc978..27062bb 100644 --- a/src/dynarec/rv64/dynarec_rv64_660f.c +++ b/src/dynarec/rv64/dynarec_rv64_660f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -20,7 +18,7 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" #include "emu/x64compstrings.h" uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) @@ -34,6 +32,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int uint8_t gd, ed; uint8_t wback, wb1, wb2, gback; uint8_t eb1, eb2; + uint8_t tmp1, tmp2, tmp3; int64_t j64; uint64_t tmp64u, tmp64u2; int v0, v1; @@ -56,14 +55,14 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x10: INST_NAME("MOVUPD Gx,Ex"); nextop = F8; - GETEX(x1, 0); + GETEX(x1, 0, 8); GETGX(); SSE_LOOP_MV_Q(x3); break; case 0x11: INST_NAME("MOVUPD Ex,Gx"); nextop = F8; - GETEX(x1, 0); + GETEX(x1, 0, 8); GETGX(); SSE_LOOP_MV_Q2(x3); if (!MODREG) SMWRITE2(); @@ -100,7 +99,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("UNPCKLPD Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 2); // GX->q[1] = EX->q[0]; LD(x3, wback, fixedaddress + 0); SD(x3, gback, gdoffset + 8); @@ -108,7 +107,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x15: INST_NAME("UNPCKHPD Gx, Ex"); nextop = F8; - GETEX(x1, 0); + GETEX(x1, 0, 8); GETGX(); // GX->q[0] = GX->q[1]; LD(x3, gback, gdoffset + 8); @@ -131,6 +130,27 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int LD(x3, wback, fixedaddress); SD(x3, gback, gdoffset + 8); break; + case 0x17: + INST_NAME("MOVHPD Eq, Gx"); + nextop = F8; + GETGX(); + if (MODREG) { + // access register instead of memory is bad opcode! + DEFAULT; + return addr; + } + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + LD(x3, gback, gdoffset + 8); + SD(x3, wback, fixedaddress); + break; + case 0x18: + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: case 0x1F: INST_NAME("NOP (multibyte)"); nextop = F8; @@ -139,14 +159,14 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x28: INST_NAME("MOVAPD Gx,Ex"); nextop = F8; - GETEX(x1, 0); + GETEX(x1, 0, 8); GETGX(); SSE_LOOP_MV_Q(x3); break; case 0x29: INST_NAME("MOVAPD Ex,Gx"); nextop = F8; - GETEX(x1, 0); + GETEX(x1, 0, 8); GETGX(); SSE_LOOP_MV_Q2(x3); if (!MODREG) SMWRITE2(); @@ -155,7 +175,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("CVTPI2PD Gx,Em"); nextop = F8; GETGX(); - GETEM(x2, 0); + GETEM(x2, 0, 4); d0 = fpu_get_scratch(dyn); for (int i = 0; i < 2; ++i) { LW(x1, wback, fixedaddress + i * 4); @@ -167,22 +187,22 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MOVNTPD Ex, Gx"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_MV_Q2(x3); break; case 0x2C: INST_NAME("CVTTPD2PI Gm,Ex"); nextop = F8; GETGM(); - GETEX(x2, 0); + GETEX(x2, 0, 8); d0 = fpu_get_scratch(dyn); for (int i = 0; i < 2; ++i) { - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FSFLAGSI(0); // // reset all bits } FLD(d0, wback, fixedaddress + i * 8); FCVTWD(x1, d0, RD_RTZ); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FRFLAGS(x5); // get back FPSR to check the IOC bit ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); BEQ_MARKi(x5, xZR, i); @@ -196,16 +216,16 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("CVTPD2PI Gm,Ex"); nextop = F8; GETGM(); - GETEX(x2, 0); + GETEX(x2, 0, 8); d0 = fpu_get_scratch(dyn); u8 = sse_setround(dyn, ninst, x4, x5); for (int i = 0; i < 2; ++i) { - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FSFLAGSI(0); // // reset all bits } FLD(d0, wback, fixedaddress + i * 8); FCVTWD(x1, d0, RD_DYN); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FRFLAGS(x5); // get back FPSR to check the IOC bit ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); BEQ_MARKi(x5, xZR, i); @@ -224,15 +244,14 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } else { INST_NAME("UCOMISD Gx, Ex"); } - SETFLAGS(X_ALL, SF_SET); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); SET_DFNONE(); nextop = F8; GETGXSD(d0); GETEXSD(v0, 0); CLEAR_FLAGS(); // if isnan(d0) || isnan(v0) - IFX(X_ZF | X_PF | X_CF) - { + IFX (X_ZF | X_PF | X_CF) { FEQD(x3, d0, d0); FEQD(x2, v0, v0); AND(x2, x2, x3); @@ -242,8 +261,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } MARK; // else if isless(d0, v0) - IFX(X_CF) - { + IFX (X_CF) { FLTD(x2, d0, v0); BEQ_MARK2(x2, xZR); ORI(xFlags, xFlags, 1 << F_CF); @@ -251,1139 +269,26 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } MARK2; // else if d0 == v0 - IFX(X_ZF) - { + IFX (X_ZF) { FEQD(x2, d0, v0); CBZ_NEXT(x2); ORI(xFlags, xFlags, 1 << F_ZF); } break; case 0x38: // SSSE3 opcodes - nextop = F8; - switch (nextop) { - case 0x00: - INST_NAME("PSHUFB Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - - ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); - - // perserve gd - LD(x3, gback, gdoffset + 0); - LD(x4, gback, gdoffset + 8); - SD(x3, x5, 0); - SD(x4, x5, 8); - - for (int i = 0; i < 16; ++i) { - LBU(x3, wback, fixedaddress + i); - ANDI(x4, x3, 128); - BEQZ(x4, 12); - SB(xZR, gback, gdoffset + i); - BEQZ(xZR, 20); // continue - ANDI(x4, x3, 15); - ADD(x4, x4, x5); - LBU(x4, x4, 0); - SB(x4, gback, gdoffset + i); - } - break; - case 0x01: - INST_NAME("PHADDW Gx, Ex"); - nextop = F8; - GETGX(); - for (int i = 0; i < 4; ++i) { - // GX->sw[i] = GX->sw[i*2+0]+GX->sw[i*2+1]; - LH(x3, gback, gdoffset + 2 * (i * 2 + 0)); - LH(x4, gback, gdoffset + 2 * (i * 2 + 1)); - ADDW(x3, x3, x4); - SH(x3, gback, gdoffset + 2 * i); - } - if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { - // GX->q[1] = GX->q[0]; - LD(x3, gback, gdoffset + 0); - SD(x3, gback, gdoffset + 8); - } else { - GETEX(x2, 0); - for (int i = 0; i < 4; ++i) { - // GX->sw[4+i] = EX->sw[i*2+0] + EX->sw[i*2+1]; - LH(x3, wback, fixedaddress + 2 * (i * 2 + 0)); - LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); - ADDW(x3, x3, x4); - SH(x3, gback, gdoffset + 2 * (4 + i)); - } - } - break; - case 0x02: - INST_NAME("PHADDD Gx, Ex"); - nextop = F8; - GETGX(); - // GX->sd[0] += GX->sd[1]; - LW(x3, gback, gdoffset + 0 * 4); - LW(x4, gback, gdoffset + 1 * 4); - ADDW(x3, x3, x4); - SW(x3, gback, gdoffset + 0 * 4); - // GX->sd[1] = GX->sd[2] + GX->sd[3]; - LW(x3, gback, gdoffset + 2 * 4); - LW(x4, gback, gdoffset + 3 * 4); - ADDW(x3, x3, x4); - SW(x3, gback, gdoffset + 1 * 4); - if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { - // GX->q[1] = GX->q[0]; - LD(x3, gback, gdoffset + 0); - SD(x3, gback, gdoffset + 8); - } else { - GETEX(x2, 0); - // GX->sd[2] = EX->sd[0] + EX->sd[1]; - LW(x3, wback, fixedaddress + 0 * 4); - LW(x4, wback, fixedaddress + 1 * 4); - ADDW(x3, x3, x4); - SW(x3, gback, gdoffset + 2 * 4); - // GX->sd[3] = EX->sd[2] + EX->sd[3]; - LW(x3, wback, fixedaddress + 2 * 4); - LW(x4, wback, fixedaddress + 3 * 4); - ADDW(x3, x3, x4); - SW(x3, gback, gdoffset + 3 * 4); - } - break; - case 0x03: - INST_NAME("PHADDSW Gx, Ex"); - nextop = F8; - GETGX(); - MOV64x(x5, 32767); - MOV64x(x6, -32768); - for (int i = 0; i < 4; ++i) { - // tmp32s = GX->sw[i*2+0]+GX->sw[i*2+1]; - // GX->sw[i] = sat(tmp32s); - LH(x3, gback, gdoffset + 2 * (i * 2 + 0)); - LH(x4, gback, gdoffset + 2 * (i * 2 + 1)); - ADDW(x3, x3, x4); - if (rv64_zbb) { - MIN(x3, x3, x5); - MAX(x3, x3, x6); - } else { - BLT(x3, x5, 4 + 4); - MV(x3, x5); - BLT(x6, x3, 4 + 4); - MV(x3, x6); - } - SH(x3, gback, gdoffset + i * 2); - } - if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { - // GX->q[1] = GX->q[0]; - LD(x3, gback, gdoffset + 0); - SD(x3, gback, gdoffset + 8); - } else { - GETEX(x2, 0); - for (int i = 0; i < 4; ++i) { - // tmp32s = EX->sw[i*2+0] + EX->sw[i*2+1]; - // GX->sw[4+i] = sat(tmp32s); - LH(x3, wback, fixedaddress + 2 * (i * 2 + 0)); - LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); - ADDW(x3, x3, x4); - if (rv64_zbb) { - MIN(x3, x3, x5); - MAX(x3, x3, x6); - } else { - BLT(x3, x5, 4 + 4); - MV(x3, x5); - BLT(x6, x3, 4 + 4); - MV(x3, x6); - } - SH(x3, gback, gdoffset + 2 * (4 + i)); - } - } - break; - case 0x04: - INST_NAME("PMADDUBSW Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - MOV64x(x5, 32767); - MOV64x(x6, -32768); - for (int i = 0; i < 8; ++i) { - LBU(x3, gback, gdoffset + i * 2); - LB(x4, wback, fixedaddress + i * 2); - MUL(x9, x3, x4); - LBU(x3, gback, gdoffset + i * 2 + 1); - LB(x4, wback, fixedaddress + i * 2 + 1); - MUL(x3, x3, x4); - ADD(x3, x3, x9); - if (rv64_zbb) { - MIN(x3, x3, x5); - MAX(x3, x3, x6); - } else { - BLT(x3, x5, 4 + 4); - MV(x3, x5); - BLT(x6, x3, 4 + 4); - MV(x3, x6); - } - SH(x3, gback, gdoffset + i * 2); - } - break; - case 0x05: - INST_NAME("PHSUBW Gx, Ex"); - nextop = F8; - GETGX(); - for (int i = 0; i < 4; ++i) { - // GX->sw[i] = GX->sw[i*2+0] - GX->sw[i*2+1]; - LH(x3, gback, gdoffset + 2 * (i * 2 + 0)); - LH(x4, gback, gdoffset + 2 * (i * 2 + 1)); - SUBW(x3, x3, x4); - SH(x3, gback, gdoffset + 2 * i); - } - if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { - // GX->q[1] = GX->q[0]; - LD(x3, gback, gdoffset + 0); - SD(x3, gback, gdoffset + 8); - } else { - GETEX(x2, 0); - for (int i = 0; i < 4; ++i) { - // GX->sw[4+i] = EX->sw[i*2+0] - EX->sw[i*2+1]; - LH(x3, wback, fixedaddress + 2 * (i * 2 + 0)); - LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); - SUBW(x3, x3, x4); - SH(x3, gback, gdoffset + 2 * (4 + i)); - } - } - break; - case 0x08: - INST_NAME("PSIGNB Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 16; ++i) { - LB(x3, gback, gdoffset + i); - LB(x4, wback, fixedaddress + i); - SLT(x1, xZR, x4); - SRAI(x5, x4, 63); - OR(x1, x1, x5); - MUL(x3, x1, x3); - SB(x3, gback, gdoffset + i); - } - break; - case 0x09: - INST_NAME("PSIGNW Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 8; ++i) { - LH(x3, gback, gdoffset + i * 2); - LH(x4, wback, fixedaddress + i * 2); - SLT(x1, xZR, x4); - SRAI(x5, x4, 63); - OR(x1, x1, x5); - MUL(x3, x1, x3); - SH(x3, gback, gdoffset + i * 2); - } - break; - case 0x0A: - INST_NAME("PSIGND Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 4; ++i) { - LW(x3, gback, gdoffset + i * 4); - LW(x4, wback, fixedaddress + i * 4); - SLT(x1, xZR, x4); - SRAI(x5, x4, 63); - OR(x1, x1, x5); - MUL(x3, x1, x3); - SW(x3, gback, gdoffset + i * 4); - } - break; - case 0x0B: - INST_NAME("PMULHRSW Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 8; ++i) { - LH(x3, gback, gdoffset + i * 2); - LH(x4, wback, fixedaddress + i * 2); - MUL(x3, x3, x4); - SRAI(x3, x3, 14); - ADDI(x3, x3, 1); - SRAI(x3, x3, 1); - SH(x3, gback, gdoffset + i * 2); - } - break; - case 0x10: - INST_NAME("PBLENDVB Gx,Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - sse_forget_reg(dyn, ninst, x6, 0); // forget xmm[0] - for (int i = 0; i < 16; ++i) { - LB(x3, xEmu, offsetof(x64emu_t, xmm[0]) + i); - BGE(x3, xZR, 12); // continue - LBU(x3, wback, fixedaddress + i); - SB(x3, gback, gdoffset + i); - // continue - } - break; - case 0x14: - INST_NAME("PBLENDVPS Gx,Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 4; ++i) { - LW(x3, xEmu, offsetof(x64emu_t, xmm[0]) + i * 4); - BGE(x3, xZR, 4 + 4 * 2); - LWU(x3, wback, fixedaddress + i * 4); - SW(x3, gback, gdoffset + i * 4); - } - break; - case 0x17: - INST_NAME("PTEST Gx, Ex"); - nextop = F8; - SETFLAGS(X_ALL, SF_SET); - GETGX(); - GETEX(x2, 0); - CLEAR_FLAGS(); - SET_DFNONE(); - IFX(X_ZF | X_CF) - { - LD(x5, wback, fixedaddress + 0); - LD(x6, wback, fixedaddress + 8); - - IFX(X_ZF) - { - LD(x3, gback, gdoffset + 0); - LD(x4, gback, gdoffset + 8); - AND(x3, x3, x5); - AND(x4, x4, x6); - OR(x3, x3, x4); - BNEZ(x3, 8); - ORI(xFlags, xFlags, 1 << F_ZF); - } - IFX(X_CF) - { - LD(x3, gback, gdoffset + 0); - NOT(x3, x3); - LD(x4, gback, gdoffset + 8); - NOT(x4, x4); - AND(x3, x3, x5); - AND(x4, x4, x6); - OR(x3, x3, x4); - BNEZ(x3, 8); - ORI(xFlags, xFlags, 1 << F_CF); - } - } - break; - - case 0x1C: - INST_NAME("PABSB Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 16; ++i) { - LB(x4, wback, fixedaddress + i); - BGE(x4, xZR, 4 + 4); - NEG(x4, x4); - SB(x4, gback, gdoffset + i); - } - break; - case 0x1D: - INST_NAME("PABSW Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 8; ++i) { - LH(x4, wback, fixedaddress + i * 2); - BGE(x4, xZR, 4 + 4); - NEG(x4, x4); - SH(x4, gback, gdoffset + i * 2); - } - break; - case 0x1E: - INST_NAME("PABSD Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 4; ++i) { - LW(x4, wback, fixedaddress + i * 4); - BGE(x4, xZR, 4 + 4); - NEG(x4, x4); - SW(x4, gback, gdoffset + i * 4); - } - break; - case 0x20: - INST_NAME("PMOVSXBW Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 7; i >= 0; --i) { - // GX->sw[i] = EX->sb[i]; - LB(x3, wback, fixedaddress + i); - SH(x3, gback, gdoffset + i * 2); - } - break; - case 0x21: - INST_NAME("PMOVSXBD Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 3; i >= 0; --i) { - // GX->sd[i] = EX->sb[i]; - LB(x3, wback, fixedaddress + i); - SW(x3, gback, gdoffset + i * 4); - } - break; - case 0x22: - INST_NAME("PMOVSXBQ Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 1; i >= 0; --i) { - // GX->sq[i] = EX->sb[i]; - LB(x3, wback, fixedaddress + i); - SD(x3, gback, gdoffset + i * 8); - } - break; - case 0x23: - INST_NAME("PMOVSXWD Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 3; i >= 0; --i) { - // GX->sd[i] = EX->sw[i]; - LH(x3, wback, fixedaddress + i * 2); - SW(x3, gback, gdoffset + i * 4); - } - break; - case 0x24: - INST_NAME("PMOVSXWQ Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 1; i >= 0; --i) { - // GX->sq[i] = EX->sw[i]; - LH(x3, wback, fixedaddress + i * 2); - SD(x3, gback, gdoffset + i * 8); - } - break; - case 0x25: - INST_NAME("PMOVSXDQ Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 1; i >= 0; --i) { - // GX->sq[i] = EX->sd[i]; - LW(x4, wback, fixedaddress + i * 4); - SD(x4, gback, gdoffset + i * 8); - } - break; - case 0x28: - INST_NAME("PMULDQ Gx, Ex"); - nextop = F8; - GETEX(x2, 0); - GETGX(); - for (int i = 1; i >= 0; --i) { - LW(x3, wback, fixedaddress + i * 8); - LW(x4, gback, gdoffset + i * 8); - MUL(x3, x3, x4); - SD(x3, gback, gdoffset + i * 8); - } - break; - case 0x2B: - INST_NAME("PACKUSDW Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - MOV64x(x5, 65535); - for (int i = 0; i < 4; ++i) { - LW(x3, gback, gdoffset + i * 4); - if (rv64_zbb) { - MIN(x3, x3, x5); - MAX(x3, x3, xZR); - } else { - BGE(x3, xZR, 4 + 4); - MV(x3, xZR); - BLT(x3, x5, 4 + 4); - MV(x3, x5); - } - SH(x3, gback, gdoffset + i * 2); - } - if (MODREG && gd == ed) { - LD(x3, gback, gdoffset + 0); - SD(x3, gback, gdoffset + 8); - } else - for (int i = 0; i < 4; ++i) { - LW(x3, wback, fixedaddress + i * 4); - if (rv64_zbb) { - MIN(x3, x3, x5); - MAX(x3, x3, xZR); - } else { - BGE(x3, xZR, 4 + 4); - MV(x3, xZR); - BLT(x3, x5, 4 + 4); - MV(x3, x5); - } - SH(x3, gback, gdoffset + 8 + i * 2); - } - break; - - case 0x30: - INST_NAME("PMOVZXBW Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 7; i >= 0; --i) { - LBU(x3, wback, fixedaddress + i); - SH(x3, gback, gdoffset + i * 2); - } - break; - case 0x31: - INST_NAME("PMOVZXBD Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 3; i >= 0; --i) { - LBU(x3, wback, fixedaddress + i); - SW(x3, gback, gdoffset + i * 4); - } - break; - case 0x32: - INST_NAME("PMOVZXBQ Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 1; i >= 0; --i) { - LBU(x3, wback, fixedaddress + i); - SD(x3, gback, gdoffset + i * 8); - } - break; - case 0x33: - INST_NAME("PMOVZXWD Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 3; i >= 0; --i) { - LHU(x3, wback, fixedaddress + i * 2); - SW(x3, gback, gdoffset + i * 4); - } - break; - case 0x34: - INST_NAME("PMOVZXWQ Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 1; i >= 0; --i) { - LHU(x3, wback, fixedaddress + i * 2); - SD(x3, gback, gdoffset + i * 8); - } - break; - case 0x35: - INST_NAME("PMOVZXDQ Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 1; i >= 0; --i) { - LWU(x3, wback, fixedaddress + i * 4); - SD(x3, gback, gdoffset + i * 8); - } - break; - - case 0x38: - INST_NAME("PMINSB Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 16; ++i) { - LB(x3, gback, gdoffset + i); - LB(x4, wback, fixedaddress + i); - if (rv64_zbb) - MIN(x4, x3, x4); - else - BLT(x3, x4, 4 + 4); - SB(x4, gback, gdoffset + i); - } - break; - case 0x39: - INST_NAME("PMINSD Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 4; ++i) { - LW(x3, gback, gdoffset + i * 4); - LW(x4, wback, fixedaddress + i * 4); - if (rv64_zbb) - MIN(x4, x3, x4); - else - BLT(x3, x4, 4 + 4); - SW(x4, gback, gdoffset + i * 4); - } - break; - case 0x3A: - INST_NAME("PMINUW Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 8; ++i) { - LHU(x3, gback, gdoffset + i * 2); - LHU(x4, wback, fixedaddress + i * 2); - if (rv64_zbb) - MINU(x4, x3, x4); - else - BLTU(x3, x4, 4 + 4); - SH(x4, gback, gdoffset + i * 2); - } - break; - case 0x3B: - INST_NAME("PMINUD Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 4; ++i) { - LWU(x3, gback, gdoffset + i * 4); - LWU(x4, wback, fixedaddress + i * 4); - if (rv64_zbb) - MINU(x4, x3, x4); - else - BLTU(x3, x4, 4 + 4); - SW(x4, gback, gdoffset + i * 4); - } - break; - case 0x3C: - INST_NAME("PMAXSB Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 16; ++i) { - LB(x3, gback, gdoffset + i); - LB(x4, wback, fixedaddress + i); - if (rv64_zbb) - MAX(x4, x3, x4); - else - BLT(x4, x3, 4 + 4); - SB(x4, gback, gdoffset + i); - } - break; - case 0x3D: - INST_NAME("PMAXSD Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 4; ++i) { - LW(x3, gback, gdoffset + i * 4); - LW(x4, wback, fixedaddress + i * 4); - if (rv64_zbb) - MAX(x4, x3, x4); - else - BLT(x4, x3, 4 + 4); - SW(x4, gback, gdoffset + i * 4); - } - break; - case 0x3E: - INST_NAME("PMAXUW Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 8; ++i) { - LHU(x3, gback, gdoffset + i * 2); - LHU(x4, wback, fixedaddress + i * 2); - if (rv64_zbb) - MAXU(x4, x3, x4); - else - BLTU(x4, x3, 4 + 4); - SH(x4, gback, gdoffset + i * 2); - } - break; - case 0x3F: - INST_NAME("PMAXUD Gx, Ex"); // SSE4 opcode! - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 4; ++i) { - LWU(x3, gback, gdoffset + i * 4); - LWU(x4, wback, fixedaddress + i * 4); - if (rv64_zbb) - MAXU(x4, x3, x4); - else - BLTU(x4, x3, 4 + 4); - SW(x4, gback, gdoffset + i * 4); - } - break; - case 0x40: - INST_NAME("PMULLD Gx, Ex"); - nextop = F8; - GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 4; ++i) { - LW(x3, gback, gdoffset + i * 4); - LW(x4, wback, fixedaddress + i * 4); - MUL(x3, x3, x4); - SW(x3, gback, gdoffset + i * 4); - } - break; - case 0x61: - INST_NAME("PCMPESTRI Gx, Ex, Ib"); - SETFLAGS(X_ALL, SF_SET_DF); - nextop = F8; - GETG; - sse_reflect_reg(dyn, ninst, x6, gd); - ADDI(x3, xEmu, offsetof(x64emu_t, xmm[gd])); - if (MODREG) { - ed = (nextop & 7) + (rex.b << 3); - sse_reflect_reg(dyn, ninst, x6, ed); - ADDI(x1, xEmu, offsetof(x64emu_t, xmm[ed])); - } else { - addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, NULL, 0, 1); - if (ed != x1) { - MV(x1, ed); - } - } - // prepare rest arguments - MV(x2, xRDX); - MV(x4, xRAX); - u8 = F8; - MOV32w(x5, u8); - CALL(sse42_compare_string_explicit_len, x1); - ZEROUP(x1); - BNEZ_MARK(x1); - MOV32w(xRCX, (u8 & 1) ? 8 : 16); - B_NEXT_nocond; - MARK; - if (u8 & 0b1000000) { - CLZxw(xRCX, x1, 0, x2, x3, x4); - ADDI(x2, xZR, 31); - SUB(xRCX, x2, xRCX); - } else { - CTZxw(xRCX, xRCX, 0, x1, x2); - } - break; - case 0xDB: - INST_NAME("AESIMC Gx, Ex"); // AES-NI - nextop = F8; - GETGX(); - GETEX(x2, 0); - SSE_LOOP_MV_Q(x3); - sse_forget_reg(dyn, ninst, x6, gd); - MOV32w(x1, gd); - CALL(native_aesimc, -1); - break; - case 0xDC: - INST_NAME("AESENC Gx, Ex"); // AES-NI - nextop = F8; - GETG; - sse_forget_reg(dyn, ninst, x6, gd); - MOV32w(x1, gd); - CALL(native_aese, -1); - GETGX(); - GETEX(x2, 0); - SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4)); - break; - case 0xDD: - INST_NAME("AESENCLAST Gx, Ex"); // AES-NI - nextop = F8; - GETG; - sse_forget_reg(dyn, ninst, x6, gd); - MOV32w(x1, gd); - CALL(native_aeselast, -1); - GETGX(); - GETEX(x2, 0); - SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4)); - break; - case 0xDE: - INST_NAME("AESDEC Gx, Ex"); // AES-NI - nextop = F8; - GETG; - sse_forget_reg(dyn, ninst, x6, gd); - MOV32w(x1, gd); - CALL(native_aesd, -1); - GETGX(); - GETEX(x2, 0); - SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4)); - break; - - case 0xDF: - INST_NAME("AESDECLAST Gx, Ex"); // AES-NI - nextop = F8; - GETG; - sse_forget_reg(dyn, ninst, x6, gd); - MOV32w(x1, gd); - CALL(native_aesdlast, -1); - GETGX(); - GETEX(x2, 0); - SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4)); - break; - case 0xF0: - INST_NAME("MOVBE Gw, Ew"); - nextop = F8; - GETGD; - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 1, 0); - LHU(x1, ed, fixedaddress); - if (rv64_zbb) { - REV8(x1, x1); - SRLI(x1, x1, 48); - } else if (rv64_xtheadbb) { - TH_REVW(x1, x1); - SRLI(x1, x1, 16); - } else { - ANDI(x2, x1, 0xff); - SLLI(x2, x2, 8); - SRLI(x1, x1, 8); - OR(x1, x1, x2); - } - LUI(x2, 0xffff0); - AND(gd, gd, x2); - OR(gd, gd, x1); - break; - case 0xF1: - INST_NAME("MOVBE Ew, Gw"); - nextop = F8; - GETGD; - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 1, 0); - if (rv64_zbb) { - REV8(x1, gd); - SRLI(x1, x1, 48); - } else if (rv64_xtheadbb) { - TH_REVW(x1, gd); - SRLI(x1, x1, 16); - } else { - ANDI(x1, gd, 0xff); - SLLI(x1, x1, 8); - SRLI(x2, gd, 8); - ANDI(x2, x2, 0xff); - OR(x1, x1, x2); - } - SH(x1, wback, fixedaddress); - break; - default: - DEFAULT; - } - break; case 0x3A: // these are some more SSSE3+ opcodes - opcode = F8; - switch (opcode) { - case 0x0B: - INST_NAME("ROUNDSD Gx, Ex, Ib"); - nextop = F8; - GETEXSD(d0, 1); - GETGXSD_empty(v0); - d1 = fpu_get_scratch(dyn); - v1 = fpu_get_scratch(dyn); - u8 = F8; - FEQD(x2, d0, d0); - BNEZ_MARK(x2); - if (v0 != d0) FMVD(v0, d0); - B_NEXT_nocond; - MARK; // d0 is not nan - FABSD(v1, d0); - MOV64x(x3, 1ULL << __DBL_MANT_DIG__); - FCVTDL(d1, x3, RD_RTZ); - FLTD(x3, v1, d1); - BNEZ_MARK2(x3); - if (v0 != d0) FMVD(v0, d0); - B_NEXT_nocond; - MARK2; - if (u8 & 4) { - u8 = sse_setround(dyn, ninst, x4, x2); - FCVTLD(x5, d0, RD_DYN); - FCVTDL(v0, x5, RD_RTZ); - x87_restoreround(dyn, ninst, u8); - } else { - FCVTLD(x5, d0, round_round[u8 & 3]); - FCVTDL(v0, x5, RD_RTZ); - } - break; - case 0x09: - INST_NAME("ROUNDPD Gx, Ex, Ib"); - nextop = F8; - GETGX(); - GETEX(x2, 1); - u8 = F8; - d0 = fpu_get_scratch(dyn); - d1 = fpu_get_scratch(dyn); - v1 = fpu_get_scratch(dyn); - MOV64x(x3, 1ULL << __DBL_MANT_DIG__); - FCVTDL(d1, x3, RD_RTZ); - - // i = 0 - FLD(d0, wback, fixedaddress); - FEQD(x4, d0, d0); - BNEZ(x4, 8); - B_MARK_nocond; - // d0 is not nan - FABSD(v1, d0); - FLTD(x4, v1, d1); - BNEZ(x4, 8); - B_MARK_nocond; - if (u8 & 4) { - u8 = sse_setround(dyn, ninst, x4, x5); - FCVTLD(x5, d0, RD_DYN); - FCVTDL(d0, x5, RD_RTZ); - x87_restoreround(dyn, ninst, u8); - } else { - FCVTLD(x5, d0, round_round[u8 & 3]); - FCVTDL(d0, x5, RD_RTZ); - } - MARK; - FSD(d0, gback, gdoffset + 0); - - // i = 1 - FLD(d0, wback, fixedaddress + 8); - FEQD(x4, d0, d0); - BNEZ(x4, 8); - B_MARK2_nocond; - // d0 is not nan - FABSD(v1, d0); - FLTD(x4, v1, d1); - BNEZ(x4, 8); - B_MARK2_nocond; - if (u8 & 4) { - u8 = sse_setround(dyn, ninst, x4, x5); - FCVTLD(x5, d0, RD_DYN); - FCVTDL(d0, x5, RD_RTZ); - x87_restoreround(dyn, ninst, u8); - } else { - FCVTLD(x5, d0, round_round[u8 & 3]); - FCVTDL(d0, x5, RD_RTZ); - } - MARK2; - FSD(d0, gback, gdoffset + 8); - break; - case 0x0E: - INST_NAME("PBLENDW Gx, Ex, Ib"); - nextop = F8; - GETGX(); - GETEX(x2, 1); - u8 = F8; - i32 = 0; - if (MODREG && gd == ed) break; - while (u8) - if (u8 & 1) { - if (!(i32 & 1) && u8 & 2) { - if (!(i32 & 3) && (u8 & 0xf) == 0xf) { - // whole 64bits - LD(x3, wback, fixedaddress + 8 * (i32 >> 2)); - SD(x3, gback, gdoffset + 8 * (i32 >> 2)); - i32 += 4; - u8 >>= 4; - } else { - // 32bits - LWU(x3, wback, fixedaddress + 4 * (i32 >> 1)); - SW(x3, gback, gdoffset + 4 * (i32 >> 1)); - i32 += 2; - u8 >>= 2; - } - } else { - // 16 bits - LHU(x3, wback, fixedaddress + 2 * i32); - SH(x3, gback, gdoffset + 2 * i32); - i32++; - u8 >>= 1; - } - } else { - // nope - i32++; - u8 >>= 1; - } - break; - case 0x0F: - INST_NAME("PALIGNR Gx, Ex, Ib"); - nextop = F8; - GETGX(); - GETEX(x2, 1); - u8 = F8; - if (u8 > 31) { - SD(xZR, gback, gdoffset + 0); - SD(xZR, gback, gdoffset + 8); - } else if (u8 > 23) { - LD(x5, gback, gdoffset + 8); - if (u8 > 24) { - SRLI(x5, x5, 8 * (u8 - 24)); - } - SD(x5, gback, gdoffset + 0); - SD(xZR, gback, gdoffset + 8); - } else if (u8 > 15) { - if (u8 > 16) { - LD(x5, gback, gdoffset + 8); - LD(x4, gback, gdoffset + 0); - SRLI(x3, x5, 8 * (u8 - 16)); // lower of higher 64 bits - SLLI(x5, x5, 8 * (24 - u8)); // higher of lower 64 bits - SD(x3, gback, gdoffset + 8); - SRLI(x4, x4, 8 * (u8 - 16)); // lower of lower 64 bits - OR(x4, x4, x5); // lower 64 bits - SD(x4, gback, gdoffset + 0); - } - } else if (u8 > 7) { - if (u8 > 8) { - LD(x5, gback, gdoffset + 8); - LD(x4, gback, gdoffset + 0); - LD(x3, wback, fixedaddress + 8); - SLLI(x5, x5, 8 * (16 - u8)); // higher of higher 64 bits - SRLI(x1, x4, 8 * (u8 - 8)); // lower of higher 64 bits - SLLI(x4, x4, 8 * (16 - u8)); // higher of lower 64 bits - OR(x5, x1, x5); // higher 64 bits - SRLI(x3, x3, 8 * (u8 - 8)); // lower of lower 64 bits - SD(x5, gback, gdoffset + 8); - OR(x4, x4, x3); // lower 64 bits - SD(x4, gback, gdoffset + 0); - } else { - LD(x5, gback, gdoffset + 0); - LD(x4, wback, fixedaddress + 8); - SD(x5, gback, gdoffset + 8); - SD(x4, gback, gdoffset + 0); - } - } else { - if (u8 > 0) { - LD(x5, gback, gdoffset + 0); - LD(x4, wback, fixedaddress + 8); - LD(x3, wback, fixedaddress + 0); - SLLI(x5, x5, 8 * (8 - u8)); // higher of higher 64 bits - SRLI(x1, x4, 8 * (u8 - 0)); // lower of higher 64 bits - SLLI(x4, x4, 8 * (8 - u8)); // higher of lower 64 bits - OR(x5, x1, x5); // higher 64 bits - SRLI(x3, x3, 8 * (u8 - 0)); // lower of lower 64 bits - SD(x5, gback, gdoffset + 8); - OR(x4, x4, x3); // lower 64 bits - SD(x4, gback, gdoffset + 0); - } else { - LD(x5, wback, fixedaddress + 8); - LD(x4, wback, fixedaddress + 0); - SD(x5, gback, gdoffset + 8); - SD(x4, gback, gdoffset + 0); - } - } - break; - case 0x16: - if (rex.w) { - INST_NAME("PEXTRQ Ed, Gx, Ib"); - } else { - INST_NAME("PEXTRD Ed, Gx, Ib"); - } - nextop = F8; - GETGX(); - GETED(1); - u8 = F8; - if (rex.w) - LD(ed, gback, gdoffset + 8 * (u8 & 1)); - else - LWU(ed, gback, gdoffset + 4 * (u8 & 3)); - if (wback) { - SDxw(ed, wback, fixedaddress); - SMWRITE2(); - } - break; - case 0x20: - INST_NAME("PINSRB Gx, ED, Ib"); - nextop = F8; - GETGX(); - GETED(1); - u8 = F8; - SB(ed, gback, gdoffset + (u8 & 0xF)); - break; - case 0x21: - INST_NAME("INSERTPS GX, EX, Ib"); - nextop = F8; - GETGX(); - GETEX(x2, 1); - u8 = F8; - if (MODREG) - s8 = (u8 >> 6) & 3; - else - s8 = 0; - // GX->ud[(tmp8u>>4)&3] = EX->ud[tmp8s]; - LWU(x3, wback, fixedaddress + 4 * s8); - SW(x3, gback, gdoffset + 4 * (u8 >> 4)); - for (int i = 0; i < 4; ++i) { - if (u8 & (1 << i)) - // GX->ud[i] = 0; - SW(xZR, gback, gdoffset + 4 * i); - } - break; - case 0x22: - INST_NAME("PINSRD Gx, ED, Ib"); - nextop = F8; - GETGX(); - GETED(1); - u8 = F8; - if (rex.w) { - SD(ed, gback, gdoffset + 8 * (u8 & 0x1)); - } else { - SW(ed, gback, gdoffset + 4 * (u8 & 0x3)); - } - break; - case 0x40: - INST_NAME("DPPS Gx, Ex, Ib"); - nextop = F8; - GETGX(); - GETEX(x2, 1); - u8 = F8; - d0 = fpu_get_scratch(dyn); - d1 = fpu_get_scratch(dyn); - d2 = fpu_get_scratch(dyn); - FMVWX(d2, xZR); - for (int i = 0; i < 4; ++i) - if (u8 & (1 << (i + 4))) { - FLW(d0, gback, gdoffset + i * 4); - FLW(d1, wback, fixedaddress + i * 4); - FMULS(d0, d0, d1); - FADDS(d2, d2, d0); - } - for (int i = 0; i < 4; ++i) - if (u8 & (1 << i)) - FSW(d2, gback, gdoffset + i * 4); - else - SW(xZR, gback, gdoffset + i * 4); - break; - case 0x44: - INST_NAME("PCLMULQDQ Gx, Ex, Ib"); - nextop = F8; - GETG; - sse_forget_reg(dyn, ninst, x6, gd); - MOV32w(x1, gd); // gx - if (MODREG) { - ed = (nextop & 7) + (rex.b << 3); - sse_forget_reg(dyn, ninst, x6, ed); - MOV32w(x2, ed); - MOV32w(x3, 0); // p = NULL - } else { - MOV32w(x2, 0); - addr = geted(dyn, addr, ninst, nextop, &ed, x3, x5, &fixedaddress, rex, NULL, 0, 1); - if (ed != x3) { - MV(x3, ed); - } - } - u8 = F8; - MOV32w(x4, u8); - CALL(native_pclmul, -1); - break; - case 0xDF: - INST_NAME("AESKEYGENASSIST Gx, Ex, Ib"); // AES-NI - nextop = F8; - GETG; - sse_forget_reg(dyn, ninst, x6, gd); - MOV32w(x1, gd); // gx - if (MODREG) { - ed = (nextop & 7) + (rex.b << 3); - sse_forget_reg(dyn, ninst, x6, ed); - MOV32w(x2, ed); - MOV32w(x3, 0); // p = NULL - } else { - MOV32w(x2, 0); - addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 1); - if (ed != x3) { - MV(x3, ed); - } - } - u8 = F8; - MOV32w(x4, u8); - CALL(native_aeskeygenassist, -1); - break; - default: - DEFAULT; - } + addr = dynarec64_660F38(dyn, addr, opcode, ip, ninst, rex, ok, need_epilog); break; -#define GO(GETFLAGS, NO, YES, F) \ + +#define GO(GETFLAGS, NO, YES, NATNO, NATYES, F) \ READFLAGS(F); \ + tmp1 = x1; \ + tmp3 = x3; \ GETFLAGS; \ nextop = F8; \ GETGD; \ if (MODREG) { \ - ed = xRAX + (nextop & 7) + (rex.b << 3); \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ ZEXTH(x4, ed); \ ed = x4; \ } else { \ @@ -1399,12 +304,13 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int GOCOND(0x40, "CMOV", "Gw, Ew"); #undef GO + case 0x50: INST_NAME("PMOVMSKD Gd, Ex"); nextop = F8; GETGD; - GETEX(x1, 0); - MV(gd, xZR); + GETEX(x1, 0, 8); + XOR(gd, gd, gd); for (int i = 0; i < 2; ++i) { // GD->dword[0] |= ((EX->q[i]>>63)&1)<f[0] = EX->d[0]; FLD(d0, wback, fixedaddress + 0); FCVTSD(d0, d0); - FSD(d0, gback, gdoffset + 0); + FSW(d0, gback, gdoffset + 0); // GX->f[1] = EX->d[1]; FLD(d0, wback, fixedaddress + 8); FCVTSD(d0, d0); - FSD(d0, gback, gdoffset + 4); + FSW(d0, gback, gdoffset + 4); // GX->q[1] = 0; SD(xZR, gback, gdoffset + 8); break; @@ -1525,7 +431,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("CVTPS2DQ Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); d0 = fpu_get_scratch(dyn); u8 = sse_setround(dyn, ninst, x6, x4); for (int i = 0; i < 4; ++i) { @@ -1541,15 +447,15 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x5C: INST_NAME("SUBPD Gx, Ex"); nextop = F8; - GETEX(x1, 0); + GETEX(x1, 0, 8); GETGX(); SSE_LOOP_FQ(x3, x4, { - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { FEQD(x3, v0, v0); FEQD(x4, v1, v1); } FSUBD(v0, v0, v1); - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { AND(x3, x3, x4); BEQZ(x3, 16); FEQD(x3, v0, v0); @@ -1562,7 +468,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MINPD Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); d0 = fpu_get_scratch(dyn); d1 = fpu_get_scratch(dyn); for (int i = 0; i < 2; ++i) { @@ -1580,15 +486,15 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x5E: INST_NAME("DIVPD Gx, Ex"); nextop = F8; - GETEX(x1, 0); + GETEX(x1, 0, 8); GETGX(); SSE_LOOP_FQ(x3, x4, { - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { FEQD(x3, v0, v0); FEQD(x4, v1, v1); } FDIVD(v0, v0, v1); - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { AND(x3, x3, x4); BEQZ(x3, 16); FEQD(x3, v0, v0); @@ -1601,7 +507,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MAXPD Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); d0 = fpu_get_scratch(dyn); d1 = fpu_get_scratch(dyn); for (int i = 0; i < 2; ++i) { @@ -1632,7 +538,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int SB(x3, gback, gdoffset + 2 * i + 1); } } else { - GETEX(x1, 0); + GETEX(x1, 0, 7); for (int i = 0; i < 8; ++i) { // GX->ub[2 * i + 1] = EX->ub[i]; LBU(x3, wback, fixedaddress + i); @@ -1656,7 +562,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int SH(x3, gback, gdoffset + (2 * i + 1) * 2); } } else { - GETEX(x1, 0); + GETEX(x1, 0, 6); for (int i = 0; i < 4; ++i) { // GX->uw[2 * i + 1] = EX->uw[i]; LHU(x3, wback, fixedaddress + i * 2); @@ -1667,7 +573,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x62: INST_NAME("PUNPCKLDQ Gx,Ex"); nextop = F8; - GETEX(x1, 0); + GETEX(x1, 0, 4); GETGX(); // GX->ud[3] = EX->ud[1]; LWU(x3, wback, fixedaddress + 1 * 4); @@ -1683,12 +589,12 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PACKSSWB Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); MOV64x(x5, 127); MOV64x(x6, -128); for (int i = 0; i < 8; ++i) { LH(x3, gback, gdoffset + i * 2); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -1705,7 +611,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } else for (int i = 0; i < 8; ++i) { LH(x3, wback, fixedaddress + i * 2); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -1721,7 +627,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PCMPGTB Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 15); for (int i = 0; i < 16; ++i) { // GX->ub[i] = (GX->sb[i]>EX->sb[i])?0xFF:0x00; LB(x3, wback, fixedaddress + i); @@ -1735,7 +641,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PCMPGTW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); for (int i = 0; i < 8; ++i) { // GX->uw[i] = (GX->sw[i]>EX->sw[i])?0xFFFF:0x0000; LH(x3, wback, fixedaddress + i * 2); @@ -1748,7 +654,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x66: INST_NAME("PCMPGTD Gx,Ex"); nextop = F8; - GETEX(x1, 0); + GETEX(x1, 0, 12); GETGX(); SSE_LOOP_DS(x3, x4, SLT(x4, x4, x3); NEG(x3, x4)); break; @@ -1772,7 +678,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int LD(x3, gback, gdoffset + 0 * 8); SD(x3, gback, gdoffset + 1 * 8); } else { - GETEX(x1, 0); + GETEX(x1, 0, 14); for (int i = 0; i < 8; ++i) { // GX->ub[8+i] = (EX->sw[i]<0)?0:((EX->sw[i]>0xff)?0xff:EX->sw[i]); LH(x3, wback, fixedaddress + i * 2); @@ -1801,7 +707,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int SB(x3, gback, gdoffset + 2 * i + 1); } } else { - GETEX(x2, 0); + GETEX(x2, 0, 7); for (int i = 0; i < 8; ++i) { // GX->ub[2 * i + 1] = EX->ub[i + 8]; LBU(x3, wback, fixedaddress + i + 8); @@ -1825,7 +731,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int SH(x3, gback, gdoffset + (2 * i + 1) * 2); } } else { - GETEX(x1, 0); + GETEX(x1, 0, 14); for (int i = 0; i < 4; ++i) { // GX->uw[2 * i + 1] = EX->uw[i + 4]; LHU(x3, wback, fixedaddress + (i + 4) * 2); @@ -1836,7 +742,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0x6A: INST_NAME("PUNPCKHDQ Gx,Ex"); nextop = F8; - GETEX(x1, 0); + GETEX(x1, 0, 12); GETGX(); // GX->ud[0] = GX->ud[2]; LWU(x3, gback, gdoffset + 2 * 4); @@ -1873,7 +779,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int LD(x3, gback, gdoffset + 0 * 8); SD(x3, gback, gdoffset + 1 * 8); } else { - GETEX(x1, 0); + GETEX(x1, 0, 12); for (int i = 0; i < 4; ++i) { // GX->sw[4+i] = (EX->sd[i]<-32768)?-32768:((EX->sd[i]>32767)?32767:EX->sd[i]); LW(x3, wback, fixedaddress + i * 4); @@ -1902,7 +808,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PUNPCKHQDQ Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); LD(x3, gback, gdoffset + 8); SD(x3, gback, gdoffset + 0); LD(x3, wback, fixedaddress + 8); @@ -1929,14 +835,14 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MOVDQA Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_MV_Q(x3); break; - case 0x70: // TODO: Optimize this! + case 0x70: INST_NAME("PSHUFD Gx,Ex,Ib"); nextop = F8; GETGX(); - GETEX(x2, 1); + GETEX(x2, 1, 12); u8 = F8; int32_t idx; @@ -1959,7 +865,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int switch ((nextop >> 3) & 7) { case 2: INST_NAME("PSRLW Ex, Ib"); - GETEX(x1, 1); + GETEX(x1, 1, 14); u8 = F8; if (u8 > 15) { // just zero dest @@ -1976,7 +882,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 4: INST_NAME("PSRAW Ex, Ib"); - GETEX(x1, 1); + GETEX(x1, 1, 14); u8 = F8; if (u8 > 15) u8 = 15; if (u8) { @@ -1990,7 +896,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 6: INST_NAME("PSLLW Ex, Ib"); - GETEX(x1, 1); + GETEX(x1, 1, 14); u8 = F8; if (u8 > 15) { // just zero dest @@ -2015,7 +921,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int switch ((nextop >> 3) & 7) { case 2: INST_NAME("PSRLD Ex, Ib"); - GETEX(x1, 1); + GETEX(x1, 1, 12); u8 = F8; if (u8) { if (u8 > 31) { @@ -2029,7 +935,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 4: INST_NAME("PSRAD Ex, Ib"); - GETEX(x1, 1); + GETEX(x1, 1, 12); u8 = F8; if (u8 > 31) u8 = 31; if (u8) { @@ -2038,7 +944,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 6: INST_NAME("PSLLD Ex, Ib"); - GETEX(x1, 1); + GETEX(x1, 1, 12); u8 = F8; if (u8) { if (u8 > 31) { @@ -2059,7 +965,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int switch ((nextop >> 3) & 7) { case 2: INST_NAME("PSRLQ Ex, Ib"); - GETEX(x1, 1); + GETEX(x1, 1, 8); u8 = F8; if (!u8) break; if (u8 > 63) { @@ -2077,7 +983,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 3: INST_NAME("PSRLDQ Ex, Ib"); - GETEX(x1, 1); + GETEX(x1, 1, 8); u8 = F8; if (!u8) break; if (u8 > 15) { @@ -2105,7 +1011,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 6: INST_NAME("PSLLQ Ex, Ib"); - GETEX(x1, 1); + GETEX(x1, 1, 8); u8 = F8; if (!u8) break; if (u8 > 63) { @@ -2123,7 +1029,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 7: INST_NAME("PSLLDQ Ex, Ib"); - GETEX(x1, 1); + GETEX(x1, 1, 8); u8 = F8; if (!u8) break; if (u8 > 15) { @@ -2157,28 +1063,33 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PCMPEQB Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); - for (int i = 0; i < 16; ++i) { - LBU(x3, gback, gdoffset + i); - LBU(x4, wback, fixedaddress + i); - SUB(x3, x3, x4); - SEQZ(x3, x3); - NEG(x3, x3); - SB(x3, gback, gdoffset + i); + if (cpuext.xtheadbb) { + GETEX(x2, 0, 8); + SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4); TH_TSTNBZ(x3, x3);); + } else { + GETEX(x2, 0, 15); + for (int i = 0; i < 16; ++i) { + LBU(x3, gback, gdoffset + i); + LBU(x4, wback, fixedaddress + i); + SUB(x3, x3, x4); + SEQZ(x3, x3); + NEG(x3, x3); + SB(x3, gback, gdoffset + i); + } } break; case 0x75: INST_NAME("PCMPEQW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); SSE_LOOP_W(x3, x4, SUB(x3, x3, x4); SEQZ(x3, x3); NEG(x3, x3)); break; case 0x76: INST_NAME("PCMPEQD Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); SSE_LOOP_D(x3, x4, XOR(x3, x3, x4); SNEZ(x3, x3); ADDI(x3, x3, -1)); break; case 0x7C: @@ -2189,13 +1100,13 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int d1 = fpu_get_scratch(dyn); FLD(d0, gback, gdoffset + 0); FLD(d1, gback, gdoffset + 8); - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { FEQD(x3, d0, d0); FEQD(x4, d1, d1); AND(x3, x3, x4); } FADDD(d0, d0, d1); - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { FEQD(x4, d0, d0); BEQZ(x3, 12); BNEZ(x4, 8); @@ -2205,16 +1116,16 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { FSD(d0, gback, gdoffset + 8); } else { - GETEX(x2, 0); + GETEX(x2, 0, 8); FLD(d0, wback, fixedaddress + 0); FLD(d1, wback, fixedaddress + 8); - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { FEQD(x3, d0, d0); FEQD(x4, d1, d1); AND(x3, x3, x4); } FADDD(d0, d0, d1); - if (!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { FEQD(x4, d0, d0); BEQZ(x3, 12); BNEZ(x4, 8); @@ -2229,7 +1140,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int GETGX(); if (rex.w) { if (MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); LD(ed, gback, gdoffset + 0); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); @@ -2239,7 +1150,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } } else { if (MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); LWU(ed, gback, gdoffset + 0); } else { addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); @@ -2253,99 +1164,238 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MOVDQA Ex,Gx"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_MV_Q2(x3); if (!MODREG) SMWRITE2(); break; case 0xA3: INST_NAME("BT Ew, Gw"); - SETFLAGS(X_CF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); nextop = F8; - GETEW(x1, 0); - GETGW(x2); - ANDI(gd, gd, 15); - BEXT(x4, ed, gd, x6); - ANDI(xFlags, xFlags, ~1); - OR(xFlags, xFlags, x4); + GETGD; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + SLLI(x1, gd, 48); + SRAI(x1, x1, 48 + 4); + ADDSL(x3, wback, x1, 1, x1); + LH(x1, x3, fixedaddress); + ed = x1; + } + IFX (X_CF) { + ANDI(x2, gd, 0xf); + if (cpuext.zbs) { + BEXT_(x4, ed, x2); + } else { + SRL(x4, ed, x2); + ANDI(x4, x4, 1); + } + ANDI(xFlags, xFlags, ~1); + OR(xFlags, xFlags, x4); + } break; case 0xA4: - nextop = F8; INST_NAME("SHLD Ew, Gw, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW(x1, 0); + nextop = F8; + u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; + if (u8) { + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEW(x1, 1); + GETGW(x2); + u8 = F8; + emit_shld16c(dyn, ninst, rex, ed, gd, u8, x6, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } + break; + case 0xA5: + nextop = F8; + INST_NAME("SHLD Ew, Gw, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETGW(x2); - u8 = F8; - emit_shld16c(dyn, ninst, rex, ed, gd, u8, x3, x4, x5); + GETEW(x1, 0); + ANDI(x4, xRCX, 0x1f); + UFLAG_IF { BEQ_NEXT(x4, xZR); } + emit_shld16(dyn, ninst, ed, gd, x4, x5, x6, x7); EWBACK; break; case 0xAB: INST_NAME("BTS Ew, Gw"); - SETFLAGS(X_CF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); nextop = F8; - GETEW(x1, 0); - GETGW(x2); - ANDI(gd, gd, 15); - BEXT(x4, ed, gd, x6); - ANDI(xFlags, xFlags, ~1); - OR(xFlags, xFlags, x4); + GETGD; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + wback = 0; + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + SLLI(x1, gd, 48); + SRAI(x1, x1, 48 + 4); + ADDSL(x3, wback, x1, 1, x1); + LH(x1, x3, fixedaddress); + ed = x1; + wback = x3; + } + ANDI(x2, gd, 0xf); + IFX (X_CF) { + if (cpuext.zbs) { + BEXT_(x4, ed, x2); + } else { + SRL(x4, ed, x2); + ANDI(x4, x4, 1); + } + ANDI(xFlags, xFlags, ~1); + OR(xFlags, xFlags, x4); + } ADDI(x4, xZR, 1); - SLL(x4, x4, gd); + SLL(x4, x4, x2); OR(ed, ed, x4); - EWBACK; + if (wback) { + SH(ed, wback, fixedaddress); + SMWRITE(); + } break; case 0xAC: nextop = F8; INST_NAME("SHRD Ew, Gw, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETEW(x1, 0); + u8 = geted_ib(dyn, addr, ninst, nextop) & 0x1f; + if (u8) { + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETEW(x1, 1); + GETGW(x2); + u8 = F8; + emit_shrd16c(dyn, ninst, rex, ed, gd, u8, x6, x4, x5); + EWBACK; + } else { + FAKEED; + F8; + } + break; + case 0xAD: + nextop = F8; + INST_NAME("SHRD Ew, Gw, CL"); + if (BOX64DRENV(dynarec_safeflags) > 1) { + READFLAGS(X_ALL); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_FUSION); + } else + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); GETGW(x2); - u8 = F8; - emit_shrd16c(dyn, ninst, rex, ed, gd, u8, x3, x4, x5); + GETEW(x1, 0); + ANDI(x4, xRCX, 0x1f); + UFLAG_IF { BEQ_NEXT(x4, xZR); } + emit_shrd16(dyn, ninst, ed, gd, x4, x5, x6, x7); EWBACK; break; + case 0xAE: + nextop = F8; + if (MODREG) + switch (nextop) { + default: DEFAULT; + } + else + switch ((nextop >> 3) & 7) { + case 6: + INST_NAME("CLWB Ed"); + FAKEED; + // Placebo, TODO: we need Zicbom + SMDMB(); + break; + case 7: + INST_NAME("CLFLUSHOPT Ed"); + FAKEED; + // Placebo, TODO: we need Zicbom + SMDMB(); + break; + default: + DEFAULT; + } + break; case 0xAF: - INST_NAME("IMUL Gw,Ew"); - SETFLAGS(X_ALL, SF_PENDING); + INST_NAME("IMUL Gw, Ew"); + SETFLAGS(X_ALL, SF_PENDING, NAT_FLAGS_NOFUSION); nextop = F8; - UFLAG_DF(x1, d_imul16); GETSEW(x1, 0); GETSGW(x2); MULW(x2, x2, x1); UFLAG_RES(x2); ZEXTH(x2, x2); GWBACK; + UFLAG_DF(x1, d_imul16); break; case 0xB3: INST_NAME("BTR Ew, Gw"); - SETFLAGS(X_CF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); nextop = F8; - GETEW(x1, 0); - GETGW(x2); - ANDI(gd, gd, 15); - BEXT(x4, ed, gd, x3); // F_CF is 1 - ANDI(xFlags, xFlags, ~1); - OR(xFlags, xFlags, x4); + GETGD; + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + wback = 0; + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); + SLLI(x1, gd, 48); + SRAI(x1, x1, 48 + 4); + ADDSL(x3, wback, x1, 1, x1); + LH(x1, x3, fixedaddress); + ed = x1; + wback = x3; + } + ANDI(x2, gd, 0xf); + IFX (X_CF) { + if (cpuext.zbs) { + BEXT_(x4, ed, x2); + } else { + SRL(x4, ed, x2); + ANDI(x4, x4, 1); + } + ANDI(xFlags, xFlags, ~1); + OR(xFlags, xFlags, x4); + } ADDI(x4, xZR, 1); - SLL(x4, x4, gd); + SLL(x4, x4, x2); NOT(x4, x4); AND(ed, ed, x4); - EWBACK; + if (wback) { + SH(ed, wback, fixedaddress); + SMWRITE(); + } break; case 0xB6: INST_NAME("MOVZX Gw, Eb"); nextop = F8; - gd = xRAX+((nextop&0x38)>>3)+(rex.r<<3); + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); if (MODREG) { if (rex.rex) { - eb1 = xRAX + (nextop & 7) + (rex.b << 3); + eb1 = TO_NAT((nextop & 7) + (rex.b << 3)); eb2 = 0; } else { ed = (nextop & 7); - eb1 = xRAX + (ed & 3); // Ax, Cx, Dx or Bx - eb2 = (ed & 4) >> 2; // L or H + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx + eb2 = (ed & 4) >> 2; // L or H } if (eb2) { SRLI(x1, eb1, 8); @@ -2366,58 +1416,72 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int switch ((nextop >> 3) & 7) { case 4: INST_NAME("BT Ew, Ib"); - SETFLAGS(X_CF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); GETED(1); u8 = F8; - u8 &= rex.w ? 0x3f : 15; - BEXTI(x3, ed, u8); // F_CF is 1 - ANDI(xFlags, xFlags, ~1); - OR(xFlags, xFlags, x3); + u8 &= (rex.w ? 0x3f : 0x0f); + IFX (X_CF) { + BEXTI(x3, ed, u8); // F_CF is 1 + ANDI(xFlags, xFlags, ~1); + OR(xFlags, xFlags, x3); + } break; case 5: INST_NAME("BTS Ew, Ib"); - SETFLAGS(X_CF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); GETEW(x1, 1); u8 = F8; - u8 &= (rex.w ? 0x3f : 15); - ORI(xFlags, xFlags, 1 << F_CF); + u8 &= (rex.w ? 0x3f : 0x0f); + IFX (X_CF) ORI(xFlags, xFlags, 1 << F_CF); if (u8 <= 10) { ANDI(x6, ed, 1 << u8); BNE_MARK(x6, xZR); - ANDI(xFlags, xFlags, ~(1 << F_CF)); + IFX (X_CF) ANDI(xFlags, xFlags, ~(1 << F_CF)); XORI(ed, ed, 1 << u8); } else { ORI(x6, xZR, 1); SLLI(x6, x6, u8); AND(x4, ed, x6); BNE_MARK(x4, xZR); - ANDI(xFlags, xFlags, ~(1 << F_CF)); + IFX (X_CF) ANDI(xFlags, xFlags, ~(1 << F_CF)); XOR(ed, ed, x6); } EWBACK; MARK; break; case 6: - INST_NAME("BTR Ed, Ib"); - SETFLAGS(X_CF, SF_SUBSET); + INST_NAME("BTR Ew, Ib"); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); GETEW(x1, 1); u8 = F8; - u8 &= (rex.w ? 0x3f : 15); - ANDI(xFlags, xFlags, ~(1 << F_CF)); + u8 &= (rex.w ? 0x3f : 0x0f); + IFX (X_CF) ANDI(xFlags, xFlags, ~(1 << F_CF)); if (u8 <= 10) { ANDI(x6, ed, 1 << u8); BEQ_MARK(x6, xZR); - ORI(xFlags, xFlags, 1 << F_CF); + IFX (X_CF) ORI(xFlags, xFlags, 1 << F_CF); XORI(ed, ed, 1 << u8); } else { ORI(x6, xZR, 1); SLLI(x6, x6, u8); AND(x6, ed, x6); BEQ_MARK(x6, xZR); - ORI(xFlags, xFlags, 1 << F_CF); + IFX (X_CF) ORI(xFlags, xFlags, 1 << F_CF); XOR(ed, ed, x6); } MARK; @@ -2425,19 +1489,25 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 7: INST_NAME("BTC Ew, Ib"); - SETFLAGS(X_CF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); GETEW(x1, 1); u8 = F8; - u8 &= rex.w ? 0x3f : 15; - BEXTI(x3, ed, u8); // F_CF is 1 - ANDI(xFlags, xFlags, ~1); - OR(xFlags, xFlags, x3); + u8 &= (rex.w ? 0x3f : 0x0f); + IFX (X_CF) { + BEXTI(x6, ed, u8); // F_CF is 1 + ANDI(xFlags, xFlags, ~1); + OR(xFlags, xFlags, x6); + } if (u8 <= 10) { XORI(ed, ed, (1LL << u8)); } else { - MOV64xw(x3, (1LL << u8)); - XOR(ed, ed, x3); + MOV64xw(x6, (1LL << u8)); + XOR(ed, ed, x6); } EWBACK; break; @@ -2447,77 +1517,95 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0xBB: INST_NAME("BTC Ew, Gw"); - SETFLAGS(X_CF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_CF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); nextop = F8; GETGD; if (MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); wback = 0; } else { SMREAD(); addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 1, 0); - SRAIxw(x1, gd, 5 + rex.w); - ADDSL(x3, wback, x1, 2 + rex.w, x1); - LDxw(x1, x3, fixedaddress); + SLLI(x1, gd, 48); + SRAI(x1, x1, 48 + 4); + ADDSL(x3, wback, x1, 1, x1); + LH(x1, x3, fixedaddress); ed = x1; wback = x3; } - if (rv64_zbs) { - if (rex.w) { - BEXT_(x4, ed, gd); - } else { - ANDI(x2, gd, 0xf); + ANDI(x2, gd, 0xf); + IFX (X_CF) { + if (cpuext.zbs) { BEXT_(x4, ed, x2); + } else { + SRL(x4, ed, x2); + ANDI(x4, x4, 1); } - } else { - ANDI(x2, gd, rex.w ? 0x3f : 0xf); - SRL(x4, ed, x2); - ANDI(x4, x4, 1); + ANDI(xFlags, xFlags, ~1); + OR(xFlags, xFlags, x4); } - ANDI(xFlags, xFlags, ~1); - OR(xFlags, xFlags, x4); ADDI(x4, xZR, 1); - ANDI(x2, gd, rex.w ? 0x3f : 15); SLL(x4, x4, x2); XOR(ed, ed, x4); if (wback) { - SDxw(ed, wback, fixedaddress); + SH(ed, wback, fixedaddress); SMWRITE(); } break; case 0xBC: INST_NAME("BSF Gw, Ew"); - SETFLAGS(X_ZF, SF_SUBSET); + if (BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + IFX (X_ALL) CLEAR_FLAGS(); + } else + SETFLAGS(X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); nextop = F8; GETEW(x5, 0); GETGW(x4); BNE_MARK(ed, xZR); - ORI(xFlags, xFlags, 1 << F_ZF); - B_NEXT_nocond; + IFX (X_ZF) ORI(xFlags, xFlags, 1 << F_ZF); + B_MARK2_nocond; MARK; - // gd is undefined if ed is all zeros, don't worry. + IFXA (X_ZF, !BOX64DRENV(dynarec_safeflags)) + ANDI(xFlags, xFlags, ~(1 << F_ZF)); CTZxw(gd, ed, 0, x1, x2); - ANDI(xFlags, xFlags, ~(1 << F_ZF)); GWBACK; + MARK2; + if (BOX64DRENV(dynarec_safeflags)) { + IFX (X_PF) emit_pf(dyn, ninst, gd, x1, x2); + } break; case 0xBD: INST_NAME("BSR Gw, Ew"); - SETFLAGS(X_ZF, SF_SUBSET); + if (BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + IFX (X_ALL) CLEAR_FLAGS(); + } else + SETFLAGS(X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); SET_DFNONE(); nextop = F8; GETEW(x5, 0); GETGW(x4); BNE_MARK(ed, xZR); - ORI(xFlags, xFlags, 1 << F_ZF); - B_NEXT_nocond; + IFX (X_ZF) ORI(xFlags, xFlags, 1 << F_ZF); + B_MARK2_nocond; MARK; - ANDI(xFlags, xFlags, ~(1 << F_ZF)); - CLZxw(gd, ed, 0, x1, x2, x3); - ADDI(x1, xZR, rex.w ? 63 : 31); + IFXA (X_ZF, !BOX64DRENV(dynarec_safeflags)) + ANDI(xFlags, xFlags, ~(1 << F_ZF)); + CLZxw(gd, ed, 1, x1, x2, x6); + ADDI(x1, xZR, 63); SUB(gd, x1, gd); GWBACK; + MARK2; + if (BOX64DRENV(dynarec_safeflags)) { + IFX (X_PF) emit_pf(dyn, ninst, gd, x1, x2); + } break; case 0xBE: INST_NAME("MOVSX Gw, Eb"); @@ -2525,13 +1613,13 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int GETGD; if (MODREG) { if (rex.rex) { - ed = xRAX + (nextop & 7) + (rex.b << 3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); eb1 = ed; eb2 = 0; } else { ed = (nextop & 7); - eb1 = xRAX + (ed & 3); // Ax, Cx, Dx or Bx - eb2 = (ed & 4) >> 2; // L or H + eb1 = TO_NAT(ed & 3); // Ax, Cx, Dx or Bx + eb2 = (ed & 4) >> 2; // L or H } SLLI(x1, eb1, 56 - eb2 * 8); SRAI(x1, x1, 56); @@ -2548,24 +1636,24 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int break; case 0xC1: INST_NAME("XADD Ew, Gw"); - SETFLAGS(X_ALL, SF_SET_PENDING); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); nextop = F8; GETGW(x1); GETEW(x2, 0); - if (!(MODREG && wback == xRAX + ((nextop & 0x38) >> 3) + (rex.r << 3))) - MV(x9, ed); + if (!(MODREG && wback == TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)))) + MV(x7, ed); emit_add16(dyn, ninst, ed, gd, x4, x5, x6); - if (!(MODREG && wback == xRAX + ((nextop & 0x38) >> 3) + (rex.r << 3))) - MV(gd, x9); + if (!(MODREG && wback == TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)))) + MV(gd, x7); EWBACK; - if (!(MODREG && wback == xRAX + ((nextop & 0x38) >> 3) + (rex.r << 3))) + if (!(MODREG && wback == TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)))) GWBACK; break; case 0xC2: INST_NAME("CMPPD Gx, Ex, Ib"); nextop = F8; GETGX(); - GETEX(x2, 1); + GETEX(x2, 1, 8); u8 = F8; d0 = fpu_get_scratch(dyn); d1 = fpu_get_scratch(dyn); @@ -2585,11 +1673,11 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int switch (u8 & 7) { case 1: - BEQ_MARK(x3, xZR); + BEQ(x3, xZR, 8); // MARK FLTD(x3, d0, d1); break; // Less than case 2: - BEQ_MARK(x3, xZR); + BEQ(x3, xZR, 8); // MARK FLED(x3, d0, d1); break; // Less or equal case 3: XORI(x3, x3, 1); break; // NaN @@ -2623,22 +1711,22 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETED(1); GETGX(); - u8 = (F8)&7; + u8 = (F8) & 7; SH(ed, gback, gdoffset + u8 * 2); break; case 0xC5: INST_NAME("PEXTRW Gd,Ex,Ib"); nextop = F8; GETGD; - GETEX(x1, 0); - u8 = (F8)&7; + GETEX(x1, 0, 14); + u8 = (F8) & 7; LHU(gd, wback, fixedaddress + u8 * 2); break; case 0xC6: INST_NAME("SHUFPD Gx, Ex, Ib"); nextop = F8; GETGX(); - GETEX(x2, 1); + GETEX(x2, 1, 8); u8 = F8; if (MODREG && gd == (nextop & 7) + (rex.b << 3) && u8 == 0) { LD(x3, gback, gdoffset + 0); @@ -2657,27 +1745,22 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0xCC: case 0xCD: case 0xCE: - case 0xCF: /* BSWAP reg */ + case 0xCF: /* BSWAP reg */ INST_NAME("BSWAP Reg"); - gd = xRAX+(opcode&7)+(rex.b<<3); - if(rex.w) { + gd = TO_NAT((opcode & 7) + (rex.b << 3)); + if (rex.w) { REV8xw(gd, gd, x1, x2, x3, x4); } else { - ANDI(x1, gd, 0xff); - SRLI(x2, gd, 8); - SLLI(x1, x1, 8); - ANDI(x2, x2, 0xff); + // undefined behaviour SRLI(gd, gd, 16); - OR(x1, x1, x2); SLLI(gd, gd, 16); - OR(gd, gd, x1); } break; case 0xD1: INST_NAME("PSRLW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 1); LD(x3, wback, fixedaddress); ADDI(x4, xZR, 16); BLTU_MARK(x3, x4); @@ -2695,7 +1778,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PSRLD Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 1); LD(x3, wback, fixedaddress); ADDI(x4, xZR, 32); BLTU_MARK(x3, x4); @@ -2713,7 +1796,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PSRLQ Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 1); LD(x3, wback, fixedaddress); ADDI(x4, xZR, 64); BLTU_MARK(x3, x4); @@ -2731,14 +1814,14 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PADDQ Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_Q(x3, x4, ADD(x3, x3, x4)); break; case 0xD5: INST_NAME("PMULLW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); for (int i = 0; i < 8; ++i) { LH(x3, gback, gdoffset + 2 * i); LH(x4, wback, fixedaddress + 2 * i); @@ -2750,7 +1833,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MOVQ Ex, Gx"); nextop = F8; GETGXSD(d0); - GETEX(x2, 0); + GETEX(x2, 0, 8); FSD(d0, wback, fixedaddress + 0); if (MODREG) { SD(xZR, wback, fixedaddress + 8); @@ -2761,12 +1844,12 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int case 0xD7: INST_NAME("PMOVMSKB Gd, Ex"); nextop = F8; - GETEX(x2, 0); + GETEX(x2, 0, 8); GETGD; LD(x1, wback, fixedaddress + 8); // high part LD(x2, wback, fixedaddress + 0); // low part, also destroyed wback(x2) for (int i = 0; i < 8; i++) { - if (rv64_zbs) { + if (cpuext.zbs) { if (i == 0) { BEXTI(gd, x1, 63); } else { @@ -2781,7 +1864,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } } if (i != 0) { - if (rv64_zba) { + if (cpuext.zba) { SH1ADD(gd, gd, x6); } else { SLLI(gd, gd, 1); @@ -2790,13 +1873,13 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } } for (int i = 0; i < 8; i++) { - if (rv64_zbs) { + if (cpuext.zbs) { BEXTI(x6, x2, 63 - i * 8); } else { SRLI(x6, x2, 63 - i * 8); ANDI(x6, x6, 1); } - if (rv64_zba) { + if (cpuext.zba) { SH1ADD(gd, gd, x6); } else { SLLI(gd, gd, 1); @@ -2808,12 +1891,12 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PSUBUSB Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 15); for (int i = 0; i < 16; ++i) { LBU(x3, gback, gdoffset + i); LBU(x4, wback, fixedaddress + i); SUB(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MAX(x3, x3, xZR); } else { NOT(x4, x3); @@ -2827,28 +1910,27 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PSUBUSW Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); - SSE_LOOP_W(x3, x4, + GETEX(x2, 0, 14); + SSE_LOOP_W( + x3, x4, SUB(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MAX(x3, x3, xZR); } else { NOT(x4, x3); SRAI(x4, x4, 63); AND(x3, x3, x4); - } - SH(x3, gback, gdoffset + i * 2); - ); + }); break; case 0xDA: INST_NAME("PMINUB Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 15); for (int i = 0; i < 16; ++i) { LBU(x3, gback, gdoffset + i); LBU(x4, wback, fixedaddress + i); - if (rv64_zbb) { + if (cpuext.zbb) { MINU(x3, x3, x4); } else { BLTU(x3, x4, 8); @@ -2861,20 +1943,20 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PAND Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_Q(x3, x4, AND(x3, x3, x4)); break; case 0xDC: INST_NAME("PADDUSB Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 15); ADDI(x5, xZR, 0xFF); for (int i = 0; i < 16; ++i) { LBU(x3, gback, gdoffset + i); LBU(x4, wback, fixedaddress + i); ADD(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MINU(x3, x3, x5); } else { BLT(x3, x5, 8); @@ -2887,7 +1969,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PADDUSW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); MOV32w(x5, 65535); for (int i = 0; i < 8; ++i) { // tmp32s = (int32_t)GX->uw[i] + EX->uw[i]; @@ -2895,7 +1977,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int LHU(x3, gback, gdoffset + i * 2); LHU(x4, wback, fixedaddress + i * 2); ADDW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MINU(x3, x3, x5); } else { BGE(x5, x3, 8); // tmp32s <= 65535? @@ -2908,11 +1990,11 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PMAXUB Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 15); for (int i = 0; i < 16; ++i) { LBU(x3, gback, gdoffset + i); LBU(x4, wback, fixedaddress + i); - if (rv64_zbb) { + if (cpuext.zbb) { MAXU(x3, x3, x4); } else { BLTU(x4, x3, 8); @@ -2925,14 +2007,14 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PANDN Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_Q(x3, x4, NOT(x3, x3); AND(x3, x3, x4)); break; case 0xE0: INST_NAME("PAVGB Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 15); for (int i = 0; i < 16; ++i) { LBU(x3, gback, gdoffset + i); LBU(x4, wback, fixedaddress + i); @@ -2946,7 +2028,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PSRAW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 1); ADDI(x4, xZR, 16); LD(x3, wback, fixedaddress); BLTU(x3, x4, 8); @@ -2961,7 +2043,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PSRAD Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 1); ADDI(x4, xZR, 32); LD(x3, wback, fixedaddress); BLTU(x3, x4, 8); @@ -2976,7 +2058,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PAVGW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); for (int i = 0; i < 8; ++i) { LHU(x3, gback, gdoffset + 2 * i); LHU(x4, wback, fixedaddress + 2 * i); @@ -2990,7 +2072,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PMULHUW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); for (int i = 0; i < 8; ++i) { LHU(x3, gback, gdoffset + 2 * i); LHU(x4, wback, fixedaddress + 2 * i); @@ -3003,7 +2085,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PMULHW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); for (int i = 0; i < 8; ++i) { LH(x3, gback, gdoffset + 2 * i); LH(x4, wback, fixedaddress + 2 * i); @@ -3016,16 +2098,16 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("CVTTPD2DQ Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); v0 = fpu_get_scratch(dyn); v1 = fpu_get_scratch(dyn); FLD(v0, wback, fixedaddress + 0); FLD(v1, wback, fixedaddress + 8); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FSFLAGSI(0); // // reset all bits } FCVTWD(x3, v0, RD_RTZ); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FRFLAGS(x5); // get back FPSR to check the IOC bit ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); BEQ_MARK(x5, xZR); @@ -3034,7 +2116,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int FSFLAGSI(0); // // reset all bits } FCVTWD(x4, v1, RD_RTZ); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FRFLAGS(x5); // get back FPSR to check the IOC bit ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); BEQ_MARK2(x5, xZR); @@ -3049,14 +2131,14 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MOVNTDQ Ex, Gx"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_MV_Q2(x3); break; case 0xE8: INST_NAME("PSUBSB Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 15); ADDI(x5, xZR, 0x7f); ADDI(x6, xZR, 0xf80); for (int i = 0; i < 16; ++i) { @@ -3065,7 +2147,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int LB(x3, gback, gdoffset + i); LB(x4, wback, fixedaddress + i); SUBW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -3081,7 +2163,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PSUBSW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); MOV64x(x5, 32767); MOV64x(x6, -32768); for (int i = 0; i < 8; ++i) { @@ -3090,7 +2172,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int LH(x3, gback, gdoffset + 2 * i); LH(x4, wback, fixedaddress + 2 * i); SUBW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -3106,11 +2188,11 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PMINSW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); for (int i = 0; i < 8; ++i) { LH(x3, gback, gdoffset + 2 * i); LH(x4, wback, fixedaddress + 2 * i); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x4); } else { BLT(x3, x4, 8); @@ -3123,14 +2205,14 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("POR Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_Q(x3, x4, OR(x3, x3, x4)); break; case 0xEC: INST_NAME("PADDSB Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 15); MOV64x(x5, 127); MOV64x(x6, -128); for (int i = 0; i < 16; ++i) { @@ -3139,7 +2221,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int LB(x3, gback, gdoffset + i); LB(x4, wback, fixedaddress + i); ADDW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -3155,7 +2237,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PADDSW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); MOV64x(x5, 32767); MOV64x(x6, -32768); for (int i = 0; i < 8; ++i) { @@ -3164,7 +2246,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int LH(x3, gback, gdoffset + 2 * i); LH(x4, wback, fixedaddress + 2 * i); ADDW(x3, x3, x4); - if (rv64_zbb) { + if (cpuext.zbb) { MIN(x3, x3, x5); MAX(x3, x3, x6); } else { @@ -3180,15 +2262,10 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PMAXSW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); - SSE_LOOP_WS(x3, x4, - if (rv64_zbb) { - MAX(x3, x3, x4); - } else { + GETEX(x2, 0, 14); + SSE_LOOP_WS(x3, x4, if (cpuext.zbb) { MAX(x3, x3, x4); } else { BGE(x3, x4, 8); - MV(x3, x4); - } - ); + MV(x3, x4); }); break; case 0xEF: INST_NAME("PXOR Gx, Ex"); @@ -3199,15 +2276,15 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int SD(xZR, gback, gdoffset + 0); SD(xZR, gback, gdoffset + 8); } else { - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4)); } break; case 0xF1: - INST_NAME("PSLLQ Gx,Ex"); + INST_NAME("PSLLW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 1); ADDI(x4, xZR, 16); LD(x3, wback, fixedaddress + 0); BLTU_MARK(x3, x4); @@ -3223,10 +2300,10 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } break; case 0xF2: - INST_NAME("PSLLQ Gx,Ex"); + INST_NAME("PSLLD Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 1); ADDI(x4, xZR, 32); LD(x3, wback, fixedaddress + 0); BLTU_MARK(x3, x4); @@ -3245,7 +2322,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PSLLQ Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 1); ADDI(x4, xZR, 64); LD(x3, wback, fixedaddress + 0); BLTU_MARK(x3, x4); @@ -3264,7 +2341,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PMULUDQ Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); // GX->q[1] = (uint64_t)EX->ud[2]*GX->ud[2]; LWU(x3, gback, gdoffset + 2 * 4); LWU(x4, wback, fixedaddress + 2 * 4); @@ -3280,7 +2357,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PMADDWD Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); for (int i = 0; i < 4; ++i) { // GX->sd[i] = (int32_t)(GX->sw[i*2+0])*EX->sw[i*2+0] + // (int32_t)(GX->sw[i*2+1])*EX->sw[i*2+1]; @@ -3298,7 +2375,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PSADBW Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 15); MV(x6, xZR); for (int i = 0; i < 16; ++i) { LBU(x3, gback, gdoffset + i); @@ -3319,7 +2396,7 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PSUBB Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 15); for (int i = 0; i < 16; ++i) { // GX->sb[i] -= EX->sb[i]; LB(x3, wback, fixedaddress + i); @@ -3332,28 +2409,28 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PSUBW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); SSE_LOOP_W(x3, x4, SUBW(x3, x3, x4)); break; case 0xFA: INST_NAME("PSUBD Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); SSE_LOOP_D(x3, x4, SUBW(x3, x3, x4)); break; case 0xFB: INST_NAME("PSUBQ Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_Q(x3, x4, SUB(x3, x3, x4)); break; case 0xFC: INST_NAME("PADDB Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 15); for (int i = 0; i < 16; ++i) { // GX->sb[i] += EX->sb[i]; LB(x3, gback, gdoffset + i); @@ -3366,14 +2443,14 @@ uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PADDW Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 14); SSE_LOOP_W(x3, x4, ADDW(x3, x3, x4)); break; case 0xFE: INST_NAME("PADDD Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); SSE_LOOP_D(x3, x4, ADDW(x3, x3, x4)); break; default: diff --git a/src/dynarec/rv64/dynarec_rv64_660f38.c b/src/dynarec/rv64/dynarec_rv64_660f38.c new file mode 100644 index 0000000..a5cbb9d --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_660f38.c @@ -0,0 +1,1374 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" +#include "bitutils.h" + +#include "rv64_printer.h" +#include "dynarec_rv64_private.h" +#include "dynarec_rv64_functions.h" +#include "../dynarec_helper.h" +#include "emu/x64compstrings.h" + +uintptr_t dynarec64_660F38(dynarec_rv64_t* dyn, uintptr_t addr, uint8_t opcode, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t nextop, u8, s8; + int32_t i32; + uint8_t gd, ed; + uint8_t wback, wb1, wb2, gback; + uint8_t eb1, eb2; + int64_t j64; + uint64_t tmp64u, tmp64u2; + int v0, v1; + int q0, q1; + int d0, d1, d2; + int64_t fixedaddress, gdoffset; + int unscaled; + + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(eb1); + MAYUSE(eb2); + MAYUSE(j64); + + static const int8_t round_round[] = { RD_RNE, RD_RDN, RD_RUP, RD_RTZ }; + + switch (opcode) { + case 0x38: // SSSE3 opcodes + nextop = F8; + switch (nextop) { + case 0x00: + INST_NAME("PSHUFB Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 15); + + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + + // preserve gd + LD(x3, gback, gdoffset + 0); + LD(x4, gback, gdoffset + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + + for (int i = 0; i < 16; ++i) { + LBU(x3, wback, fixedaddress + i); + ANDI(x4, x3, 128); + BEQZ(x4, 4 + 4 * 2); + SB(xZR, gback, gdoffset + i); + J(4 + 4 * 4); // continue + ANDI(x4, x3, 15); + ADD(x4, x4, x5); + LBU(x4, x4, 0); + SB(x4, gback, gdoffset + i); + } + break; + case 0x01: + INST_NAME("PHADDW Gx, Ex"); + nextop = F8; + GETGX(); + for (int i = 0; i < 4; ++i) { + // GX->sw[i] = GX->sw[i*2+0]+GX->sw[i*2+1]; + LH(x3, gback, gdoffset + 2 * (i * 2 + 0)); + LH(x4, gback, gdoffset + 2 * (i * 2 + 1)); + ADDW(x3, x3, x4); + SH(x3, gback, gdoffset + 2 * i); + } + if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { + // GX->q[1] = GX->q[0]; + LD(x3, gback, gdoffset + 0); + SD(x3, gback, gdoffset + 8); + } else { + GETEX(x2, 0, 14); + for (int i = 0; i < 4; ++i) { + // GX->sw[4+i] = EX->sw[i*2+0] + EX->sw[i*2+1]; + LH(x3, wback, fixedaddress + 2 * (i * 2 + 0)); + LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); + ADDW(x3, x3, x4); + SH(x3, gback, gdoffset + 2 * (4 + i)); + } + } + break; + case 0x02: + INST_NAME("PHADDD Gx, Ex"); + nextop = F8; + GETGX(); + // GX->sd[0] += GX->sd[1]; + LW(x3, gback, gdoffset + 0 * 4); + LW(x4, gback, gdoffset + 1 * 4); + ADDW(x3, x3, x4); + SW(x3, gback, gdoffset + 0 * 4); + // GX->sd[1] = GX->sd[2] + GX->sd[3]; + LW(x3, gback, gdoffset + 2 * 4); + LW(x4, gback, gdoffset + 3 * 4); + ADDW(x3, x3, x4); + SW(x3, gback, gdoffset + 1 * 4); + if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { + // GX->q[1] = GX->q[0]; + LD(x3, gback, gdoffset + 0); + SD(x3, gback, gdoffset + 8); + } else { + GETEX(x2, 0, 12); + // GX->sd[2] = EX->sd[0] + EX->sd[1]; + LW(x3, wback, fixedaddress + 0 * 4); + LW(x4, wback, fixedaddress + 1 * 4); + ADDW(x3, x3, x4); + SW(x3, gback, gdoffset + 2 * 4); + // GX->sd[3] = EX->sd[2] + EX->sd[3]; + LW(x3, wback, fixedaddress + 2 * 4); + LW(x4, wback, fixedaddress + 3 * 4); + ADDW(x3, x3, x4); + SW(x3, gback, gdoffset + 3 * 4); + } + break; + case 0x03: + INST_NAME("PHADDSW Gx, Ex"); + nextop = F8; + GETGX(); + LUI(x6, 0xFFFF8); // -32768 + LUI(x7, 0x8); // 32768 + for (int i = 0; i < 4; ++i) { + // tmp32s = GX->sw[i*2+0]+GX->sw[i*2+1]; + // GX->sw[i] = sat(tmp32s); + LH(x3, gback, gdoffset + 2 * (i * 2 + 0)); + LH(x4, gback, gdoffset + 2 * (i * 2 + 1)); + ADDW(x3, x3, x4); + SATw(x3, x6, x7); + SH(x3, gback, gdoffset + i * 2); + } + if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { + // GX->q[1] = GX->q[0]; + LD(x3, gback, gdoffset + 0); + SD(x3, gback, gdoffset + 8); + } else { + GETEX(x2, 0, 14); + for (int i = 0; i < 4; ++i) { + // tmp32s = EX->sw[i*2+0] + EX->sw[i*2+1]; + // GX->sw[4+i] = sat(tmp32s); + LH(x3, wback, fixedaddress + 2 * (i * 2 + 0)); + LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); + ADDW(x3, x3, x4); + SATw(x3, x6, x7); + SH(x3, gback, gdoffset + 2 * (4 + i)); + } + } + break; + case 0x04: + INST_NAME("PMADDUBSW Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 15); + LUI(x6, 0xFFFF8); // -32768 + LUI(x7, 0x8); // 32768 + for (int i = 0; i < 8; ++i) { + LBU(x3, gback, gdoffset + i * 2); + LB(x4, wback, fixedaddress + i * 2); + MUL(x1, x3, x4); + LBU(x3, gback, gdoffset + i * 2 + 1); + LB(x4, wback, fixedaddress + i * 2 + 1); + MUL(x3, x3, x4); + ADD(x3, x3, x1); + SATw(x3, x6, x7); + SH(x3, gback, gdoffset + i * 2); + } + break; + case 0x05: + INST_NAME("PHSUBW Gx, Ex"); + nextop = F8; + GETGX(); + for (int i = 0; i < 4; ++i) { + // GX->sw[i] = GX->sw[i*2+0] - GX->sw[i*2+1]; + LH(x3, gback, gdoffset + 2 * (i * 2 + 0)); + LH(x4, gback, gdoffset + 2 * (i * 2 + 1)); + SUBW(x3, x3, x4); + SH(x3, gback, gdoffset + 2 * i); + } + if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { + // GX->q[1] = GX->q[0]; + LD(x3, gback, gdoffset + 0); + SD(x3, gback, gdoffset + 8); + } else { + GETEX(x2, 0, 14); + for (int i = 0; i < 4; ++i) { + // GX->sw[4+i] = EX->sw[i*2+0] - EX->sw[i*2+1]; + LH(x3, wback, fixedaddress + 2 * (i * 2 + 0)); + LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); + SUBW(x3, x3, x4); + SH(x3, gback, gdoffset + 2 * (4 + i)); + } + } + break; + case 0x08: + INST_NAME("PSIGNB Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 15); + for (int i = 0; i < 16; ++i) { + LB(x3, gback, gdoffset + i); + LB(x4, wback, fixedaddress + i); + SLT(x1, xZR, x4); + SRAI(x5, x4, 63); + OR(x1, x1, x5); + MUL(x3, x1, x3); + SB(x3, gback, gdoffset + i); + } + break; + case 0x09: + INST_NAME("PSIGNW Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 14); + for (int i = 0; i < 8; ++i) { + LH(x3, gback, gdoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + SLT(x1, xZR, x4); + SRAI(x5, x4, 63); + OR(x1, x1, x5); + MUL(x3, x1, x3); + SH(x3, gback, gdoffset + i * 2); + } + break; + case 0x0A: + INST_NAME("PSIGND Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 12); + for (int i = 0; i < 4; ++i) { + LW(x3, gback, gdoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + SLT(x1, xZR, x4); + SRAI(x5, x4, 63); + OR(x1, x1, x5); + MUL(x3, x1, x3); + SW(x3, gback, gdoffset + i * 4); + } + break; + case 0x0B: + INST_NAME("PMULHRSW Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 14); + for (int i = 0; i < 8; ++i) { + LH(x3, gback, gdoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + MUL(x3, x3, x4); + SRAI(x3, x3, 14); + ADDI(x3, x3, 1); + SRAI(x3, x3, 1); + SH(x3, gback, gdoffset + i * 2); + } + break; + case 0x10: + INST_NAME("PBLENDVB Gx,Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 15); + sse_forget_reg(dyn, ninst, x6, 0); // forget xmm[0] + for (int i = 0; i < 16; ++i) { + LB(x3, xEmu, offsetof(x64emu_t, xmm[0]) + i); + BGE(x3, xZR, 12); // continue + LBU(x3, wback, fixedaddress + i); + SB(x3, gback, gdoffset + i); + // continue + } + break; + case 0x14: + INST_NAME("PBLENDVPS Gx,Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 12); + sse_forget_reg(dyn, ninst, x6, 0); + for (int i = 0; i < 4; ++i) { + LW(x3, xEmu, offsetof(x64emu_t, xmm[0]) + i * 4); + BGE(x3, xZR, 4 + 4 * 2); + LWU(x3, wback, fixedaddress + i * 4); + SW(x3, gback, gdoffset + i * 4); + } + break; + case 0x15: + INST_NAME("PBLENDVPD Gx,Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 8); + sse_forget_reg(dyn, ninst, x6, 0); + for (int i = 0; i < 2; ++i) { + LD(x3, xEmu, offsetof(x64emu_t, xmm[0]) + i * 8); + BGE(x3, xZR, 4 + 4 * 2); + LD(x3, wback, fixedaddress + i * 8); + SD(x3, gback, gdoffset + i * 8); + } + break; + case 0x17: + INST_NAME("PTEST Gx, Ex"); + nextop = F8; + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETGX(); + GETEX(x1, 0, 8); + CLEAR_FLAGS(); + SET_DFNONE(); + IFX (X_ZF | X_CF) { + LD(x2, wback, fixedaddress + 0); + LD(x3, wback, fixedaddress + 8); + LD(x4, gback, gdoffset + 0); + LD(x5, gback, gdoffset + 8); + + IFX (X_ZF) { + AND(x6, x4, x2); + AND(x7, x5, x3); + OR(x6, x6, x7); + BNEZ(x6, 4 + 4); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_CF) { + NOT(x4, x4); + NOT(x5, x5); + AND(x6, x4, x2); + AND(x7, x5, x3); + OR(x6, x6, x7); + BNEZ(x6, 4 + 4); + ORI(xFlags, xFlags, 1 << F_CF); + } + } + break; + + case 0x1C: + INST_NAME("PABSB Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 15); + for (int i = 0; i < 16; ++i) { + LB(x4, wback, fixedaddress + i); + BGE(x4, xZR, 4 + 4); + NEG(x4, x4); + SB(x4, gback, gdoffset + i); + } + break; + case 0x1D: + INST_NAME("PABSW Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 14); + for (int i = 0; i < 8; ++i) { + LH(x4, wback, fixedaddress + i * 2); + BGE(x4, xZR, 4 + 4); + NEG(x4, x4); + SH(x4, gback, gdoffset + i * 2); + } + break; + case 0x1E: + INST_NAME("PABSD Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 12); + for (int i = 0; i < 4; ++i) { + LW(x4, wback, fixedaddress + i * 4); + BGE(x4, xZR, 4 + 4); + NEG(x4, x4); + SW(x4, gback, gdoffset + i * 4); + } + break; + case 0x20: + INST_NAME("PMOVSXBW Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 7); + for (int i = 7; i >= 0; --i) { + // GX->sw[i] = EX->sb[i]; + LB(x3, wback, fixedaddress + i); + SH(x3, gback, gdoffset + i * 2); + } + break; + case 0x21: + INST_NAME("PMOVSXBD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 3); + for (int i = 3; i >= 0; --i) { + // GX->sd[i] = EX->sb[i]; + LB(x3, wback, fixedaddress + i); + SW(x3, gback, gdoffset + i * 4); + } + break; + case 0x22: + INST_NAME("PMOVSXBQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 1); + for (int i = 1; i >= 0; --i) { + // GX->sq[i] = EX->sb[i]; + LB(x3, wback, fixedaddress + i); + SD(x3, gback, gdoffset + i * 8); + } + break; + case 0x23: + INST_NAME("PMOVSXWD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 6); + for (int i = 3; i >= 0; --i) { + // GX->sd[i] = EX->sw[i]; + LH(x3, wback, fixedaddress + i * 2); + SW(x3, gback, gdoffset + i * 4); + } + break; + case 0x24: + INST_NAME("PMOVSXWQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 2); + for (int i = 1; i >= 0; --i) { + // GX->sq[i] = EX->sw[i]; + LH(x3, wback, fixedaddress + i * 2); + SD(x3, gback, gdoffset + i * 8); + } + break; + case 0x25: + INST_NAME("PMOVSXDQ Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 4); + for (int i = 1; i >= 0; --i) { + // GX->sq[i] = EX->sd[i]; + LW(x4, wback, fixedaddress + i * 4); + SD(x4, gback, gdoffset + i * 8); + } + break; + case 0x28: + INST_NAME("PMULDQ Gx, Ex"); + nextop = F8; + GETEX(x2, 0, 8); + GETGX(); + for (int i = 1; i >= 0; --i) { + LW(x3, wback, fixedaddress + i * 8); + LW(x4, gback, gdoffset + i * 8); + MUL(x3, x3, x4); + SD(x3, gback, gdoffset + i * 8); + } + break; + case 0x29: + INST_NAME("PCMPEQQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 8); + SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4); SNEZ(x3, x3); ADDI(x3, x3, -1)); + break; + case 0x2B: + INST_NAME("PACKUSDW Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 12); + LUI(x5, 0x10); // 65536 + for (int i = 0; i < 4; ++i) { + LW(x3, gback, gdoffset + i * 4); + SATUw(x3, x5); + SH(x3, gback, gdoffset + i * 2); + } + if (MODREG && gd == ed) { + LD(x3, gback, gdoffset + 0); + SD(x3, gback, gdoffset + 8); + } else + for (int i = 0; i < 4; ++i) { + LW(x3, wback, fixedaddress + i * 4); + SATUw(x3, x5); + SH(x3, gback, gdoffset + 8 + i * 2); + } + break; + + case 0x30: + INST_NAME("PMOVZXBW Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 7); + for (int i = 7; i >= 0; --i) { + LBU(x3, wback, fixedaddress + i); + SH(x3, gback, gdoffset + i * 2); + } + break; + case 0x31: + INST_NAME("PMOVZXBD Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 3); + for (int i = 3; i >= 0; --i) { + LBU(x3, wback, fixedaddress + i); + SW(x3, gback, gdoffset + i * 4); + } + break; + case 0x32: + INST_NAME("PMOVZXBQ Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 2); + for (int i = 1; i >= 0; --i) { + LBU(x3, wback, fixedaddress + i); + SD(x3, gback, gdoffset + i * 8); + } + break; + case 0x33: + INST_NAME("PMOVZXWD Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 6); + for (int i = 3; i >= 0; --i) { + LHU(x3, wback, fixedaddress + i * 2); + SW(x3, gback, gdoffset + i * 4); + } + break; + case 0x34: + INST_NAME("PMOVZXWQ Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 2); + for (int i = 1; i >= 0; --i) { + LHU(x3, wback, fixedaddress + i * 2); + SD(x3, gback, gdoffset + i * 8); + } + break; + case 0x35: + INST_NAME("PMOVZXDQ Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 4); + for (int i = 1; i >= 0; --i) { + LWU(x3, wback, fixedaddress + i * 4); + SD(x3, gback, gdoffset + i * 8); + } + break; + case 0x37: + INST_NAME("PCMPGTQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 8); + SSE_LOOP_Q(x3, x4, SLT(x4, x4, x3); NEG(x3, x4)); + break; + case 0x38: + INST_NAME("PMINSB Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 15); + for (int i = 0; i < 16; ++i) { + LB(x3, gback, gdoffset + i); + LB(x4, wback, fixedaddress + i); + if (cpuext.zbb) + MIN(x4, x3, x4); + else + BLT(x3, x4, 4 + 4); + SB(x4, gback, gdoffset + i); + } + break; + case 0x39: + INST_NAME("PMINSD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 12); + for (int i = 0; i < 4; ++i) { + LW(x3, gback, gdoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + if (cpuext.zbb) + MIN(x4, x3, x4); + else + BLT(x3, x4, 4 + 4); + SW(x4, gback, gdoffset + i * 4); + } + break; + case 0x3A: + INST_NAME("PMINUW Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 14); + for (int i = 0; i < 8; ++i) { + LHU(x3, gback, gdoffset + i * 2); + LHU(x4, wback, fixedaddress + i * 2); + if (cpuext.zbb) + MINU(x4, x3, x4); + else + BLTU(x3, x4, 4 + 4); + SH(x4, gback, gdoffset + i * 2); + } + break; + case 0x3B: + INST_NAME("PMINUD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 12); + for (int i = 0; i < 4; ++i) { + LWU(x3, gback, gdoffset + i * 4); + LWU(x4, wback, fixedaddress + i * 4); + if (cpuext.zbb) + MINU(x4, x3, x4); + else + BLTU(x3, x4, 4 + 4); + SW(x4, gback, gdoffset + i * 4); + } + break; + case 0x3C: + INST_NAME("PMAXSB Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 15); + for (int i = 0; i < 16; ++i) { + LB(x3, gback, gdoffset + i); + LB(x4, wback, fixedaddress + i); + if (cpuext.zbb) + MAX(x4, x3, x4); + else + BLT(x4, x3, 4 + 4); + SB(x4, gback, gdoffset + i); + } + break; + case 0x3D: + INST_NAME("PMAXSD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 12); + for (int i = 0; i < 4; ++i) { + LW(x3, gback, gdoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + if (cpuext.zbb) + MAX(x4, x3, x4); + else + BLT(x4, x3, 4 + 4); + SW(x4, gback, gdoffset + i * 4); + } + break; + case 0x3E: + INST_NAME("PMAXUW Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 14); + for (int i = 0; i < 8; ++i) { + LHU(x3, gback, gdoffset + i * 2); + LHU(x4, wback, fixedaddress + i * 2); + if (cpuext.zbb) + MAXU(x4, x3, x4); + else + BLTU(x4, x3, 4 + 4); + SH(x4, gback, gdoffset + i * 2); + } + break; + case 0x3F: + INST_NAME("PMAXUD Gx, Ex"); // SSE4 opcode! + nextop = F8; + GETGX(); + GETEX(x2, 0, 12); + for (int i = 0; i < 4; ++i) { + LWU(x3, gback, gdoffset + i * 4); + LWU(x4, wback, fixedaddress + i * 4); + if (cpuext.zbb) + MAXU(x4, x3, x4); + else + BLTU(x4, x3, 4 + 4); + SW(x4, gback, gdoffset + i * 4); + } + break; + case 0x40: + INST_NAME("PMULLD Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 12); + for (int i = 0; i < 4; ++i) { + LW(x3, gback, gdoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + MUL(x3, x3, x4); + SW(x3, gback, gdoffset + i * 4); + } + break; + case 0x61: + INST_NAME("PCMPESTRI Gx, Ex, Ib"); + SETFLAGS(X_ALL, SF_SET_DF, NAT_FLAGS_NOFUSION); + nextop = F8; + GETG; + sse_reflect_reg(dyn, ninst, x6, gd); + ADDI(x3, xEmu, offsetof(x64emu_t, xmm[gd])); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + sse_reflect_reg(dyn, ninst, x6, ed); + ADDI(x1, xEmu, offsetof(x64emu_t, xmm[ed])); + ed = x1; + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 1); + } + // prepare rest arguments + MV(x2, xRDX); + MV(x4, xRAX); + u8 = F8; + MOV32w(x5, u8); + CALL6(const_sse42_compare_string_explicit_len, x1, ed, x2, x3, x4, x5, 0); + ZEROUP(x1); + BNEZ_MARK(x1); + MOV32w(xRCX, (u8 & 1) ? 8 : 16); + B_NEXT_nocond; + MARK; + if (u8 & 0b1000000) { + CLZxw(xRCX, x1, 0, x2, x3, x4); + ADDI(x2, xZR, 31); + SUB(xRCX, x2, xRCX); + } else { + CTZxw(xRCX, x1, 0, x2, x3); + } + break; + case 0xDB: + INST_NAME("AESIMC Gx, Ex"); // AES-NI + nextop = F8; + GETGX(); + GETEX(x2, 0, 8); + SSE_LOOP_MV_Q(x3); + sse_forget_reg(dyn, ninst, x6, gd); + MOV32w(x1, gd); + CALL(const_native_aesimc, -1, x1, 0); + break; + case 0xDC: + INST_NAME("AESENC Gx, Ex"); // AES-NI + nextop = F8; + GETG; + sse_forget_reg(dyn, ninst, x6, gd); + MOV32w(x1, gd); + CALL(const_native_aese, -1, x1, 0); + GETGX(); + GETEX(x2, 0, 8); + SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4)); + break; + case 0xDD: + INST_NAME("AESENCLAST Gx, Ex"); // AES-NI + nextop = F8; + GETG; + sse_forget_reg(dyn, ninst, x6, gd); + MOV32w(x1, gd); + CALL(const_native_aeselast, -1, x1, 0); + GETGX(); + GETEX(x2, 0, 8); + SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4)); + break; + case 0xDE: + INST_NAME("AESDEC Gx, Ex"); // AES-NI + nextop = F8; + GETG; + sse_forget_reg(dyn, ninst, x6, gd); + MOV32w(x1, gd); + CALL(const_native_aesd, -1, x1, 0); + GETGX(); + GETEX(x2, 0, 8); + SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4)); + break; + + case 0xDF: + INST_NAME("AESDECLAST Gx, Ex"); // AES-NI + nextop = F8; + GETG; + sse_forget_reg(dyn, ninst, x6, gd); + MOV32w(x1, gd); + CALL(const_native_aesdlast, -1, x1, 0); + GETGX(); + GETEX(x2, 0, 8); + SSE_LOOP_Q(x3, x4, XOR(x3, x3, x4)); + break; + case 0xF0: + INST_NAME("MOVBE Gw, Ew"); + nextop = F8; + GETGD; + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 1, 0); + LHU(x1, ed, fixedaddress); + if (cpuext.zbb) { + REV8(x1, x1); + SRLI(x1, x1, 48); + } else if (cpuext.xtheadbb) { + TH_REVW(x1, x1); + SRLI(x1, x1, 16); + } else { + ANDI(x2, x1, 0xff); + SLLI(x2, x2, 8); + SRLI(x1, x1, 8); + OR(x1, x1, x2); + } + LUI(x2, 0xffff0); + AND(gd, gd, x2); + OR(gd, gd, x1); + break; + case 0xF1: + INST_NAME("MOVBE Ew, Gw"); + nextop = F8; + GETGD; + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 1, 0); + if (cpuext.zbb) { + REV8(x1, gd); + SRLI(x1, x1, 48); + } else if (cpuext.xtheadbb) { + TH_REVW(x1, gd); + SRLI(x1, x1, 16); + } else { + ANDI(x1, gd, 0xff); + SLLI(x1, x1, 8); + SRLI(x2, gd, 8); + ANDI(x2, x2, 0xff); + OR(x1, x1, x2); + } + SH(x1, wback, fixedaddress); + break; + default: + DEFAULT; + } + break; + case 0x3A: // these are some more SSSE3+ opcodes + opcode = F8; + switch (opcode) { + case 0x09: + INST_NAME("ROUNDPD Gx, Ex, Ib"); + nextop = F8; + GETGX(); + GETEX(x2, 1, 8); + u8 = F8; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + MOV64x(x3, 1ULL << __DBL_MANT_DIG__); + FCVTDL(d1, x3, RD_RTZ); + + // i = 0 + FLD(d0, wback, fixedaddress); + FEQD(x4, d0, d0); + BNEZ(x4, 8); + B_MARK_nocond; + // d0 is not nan + FABSD(v1, d0); + FLTD(x4, v1, d1); + BNEZ(x4, 8); + B_MARK_nocond; + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x4, x5); + FCVTLD(x5, d0, RD_DYN); + FCVTDL(d0, x5, RD_RTZ); + x87_restoreround(dyn, ninst, u8); + } else { + FCVTLD(x5, d0, round_round[u8 & 3]); + FCVTDL(d0, x5, RD_RTZ); + } + MARK; + FSD(d0, gback, gdoffset + 0); + + // i = 1 + FLD(d0, wback, fixedaddress + 8); + FEQD(x4, d0, d0); + BNEZ(x4, 8); + B_MARK2_nocond; + // d0 is not nan + FABSD(v1, d0); + FLTD(x4, v1, d1); + BNEZ(x4, 8); + B_MARK2_nocond; + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x4, x5); + FCVTLD(x5, d0, RD_DYN); + FCVTDL(d0, x5, RD_RTZ); + x87_restoreround(dyn, ninst, u8); + } else { + FCVTLD(x5, d0, round_round[u8 & 3]); + FCVTDL(d0, x5, RD_RTZ); + } + MARK2; + FSD(d0, gback, gdoffset + 8); + break; + case 0x0A: + INST_NAME("ROUNDSS Gx, Ex, Ib"); + nextop = F8; + GETEXSS(d0, 1); + GETGXSS_empty(v0); + d1 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + u8 = F8; + FEQS(x2, d0, d0); + BNEZ_MARK(x2); + if (v0 != d0) FMVS(v0, d0); + B_NEXT_nocond; + MARK; // d0 is not nan + FABSS(v1, d0); + MOV64x(x3, 1ULL << __FLT_MANT_DIG__); + FCVTSW(d1, x3, RD_RTZ); + FLTS(x3, v1, d1); + BNEZ_MARK2(x3); + if (v0 != d0) FMVS(v0, d0); + B_NEXT_nocond; + MARK2; + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x4, x2); + FCVTWS(x5, d0, RD_DYN); + FCVTSW(v0, x5, RD_RTZ); + x87_restoreround(dyn, ninst, u8); + } else { + FCVTWS(x5, d0, round_round[u8 & 3]); + FCVTSW(v0, x5, RD_RTZ); + } + break; + case 0x0B: + INST_NAME("ROUNDSD Gx, Ex, Ib"); + nextop = F8; + GETEXSD(d0, 1); + GETGXSD_empty(v0); + d1 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + u8 = F8; + FEQD(x2, d0, d0); + BNEZ_MARK(x2); + if (v0 != d0) FMVD(v0, d0); + B_NEXT_nocond; + MARK; // d0 is not nan + FABSD(v1, d0); + MOV64x(x3, 1ULL << __DBL_MANT_DIG__); + FCVTDL(d1, x3, RD_RTZ); + FLTD(x3, v1, d1); + BNEZ_MARK2(x3); + if (v0 != d0) FMVD(v0, d0); + B_NEXT_nocond; + MARK2; + if (u8 & 4) { + u8 = sse_setround(dyn, ninst, x4, x2); + FCVTLD(x5, d0, RD_DYN); + FCVTDL(v0, x5, RD_RTZ); + x87_restoreround(dyn, ninst, u8); + } else { + FCVTLD(x5, d0, round_round[u8 & 3]); + FCVTDL(v0, x5, RD_RTZ); + } + break; + case 0x0C: + INST_NAME("BLENDPS Gx, Ex, Ib"); + nextop = F8; + GETGX(); + GETEX(x2, 1, 12); + u8 = F8 & 0b1111; + for (int i = 0; i < 4; ++i) + if (u8 & (1 << i)) { + LWU(x1, wback, fixedaddress + i * 4); + SW(x1, gback, gdoffset + i * 4); + } + break; + case 0x0E: + INST_NAME("PBLENDW Gx, Ex, Ib"); + nextop = F8; + GETGX(); + GETEX(x2, 1, 14); + u8 = F8; + i32 = 0; + if (MODREG && gd == ed) break; + while (u8) + if (u8 & 1) { + if (!(i32 & 1) && u8 & 2) { + if (!(i32 & 3) && (u8 & 0xf) == 0xf) { + // whole 64bits + LD(x3, wback, fixedaddress + 8 * (i32 >> 2)); + SD(x3, gback, gdoffset + 8 * (i32 >> 2)); + i32 += 4; + u8 >>= 4; + } else { + // 32bits + LWU(x3, wback, fixedaddress + 4 * (i32 >> 1)); + SW(x3, gback, gdoffset + 4 * (i32 >> 1)); + i32 += 2; + u8 >>= 2; + } + } else { + // 16 bits + LHU(x3, wback, fixedaddress + 2 * i32); + SH(x3, gback, gdoffset + 2 * i32); + i32++; + u8 >>= 1; + } + } else { + // nope + i32++; + u8 >>= 1; + } + break; + case 0x0F: + INST_NAME("PALIGNR Gx, Ex, Ib"); + nextop = F8; + GETGX(); + GETEX(x2, 1, 8); + u8 = F8; + if (u8 > 31) { + SD(xZR, gback, gdoffset + 0); + SD(xZR, gback, gdoffset + 8); + } else if (u8 > 23) { + LD(x5, gback, gdoffset + 8); + if (u8 > 24) { + SRLI(x5, x5, 8 * (u8 - 24)); + } + SD(x5, gback, gdoffset + 0); + SD(xZR, gback, gdoffset + 8); + } else if (u8 > 15) { + if (u8 > 16) { + LD(x5, gback, gdoffset + 8); + LD(x4, gback, gdoffset + 0); + SRLI(x3, x5, 8 * (u8 - 16)); // lower of higher 64 bits + SLLI(x5, x5, 8 * (24 - u8)); // higher of lower 64 bits + SD(x3, gback, gdoffset + 8); + SRLI(x4, x4, 8 * (u8 - 16)); // lower of lower 64 bits + OR(x4, x4, x5); // lower 64 bits + SD(x4, gback, gdoffset + 0); + } + } else if (u8 > 7) { + if (u8 > 8) { + LD(x5, gback, gdoffset + 8); + LD(x4, gback, gdoffset + 0); + LD(x3, wback, fixedaddress + 8); + SLLI(x5, x5, 8 * (16 - u8)); // higher of higher 64 bits + SRLI(x1, x4, 8 * (u8 - 8)); // lower of higher 64 bits + SLLI(x4, x4, 8 * (16 - u8)); // higher of lower 64 bits + OR(x5, x1, x5); // higher 64 bits + SRLI(x3, x3, 8 * (u8 - 8)); // lower of lower 64 bits + SD(x5, gback, gdoffset + 8); + OR(x4, x4, x3); // lower 64 bits + SD(x4, gback, gdoffset + 0); + } else { + LD(x5, gback, gdoffset + 0); + LD(x4, wback, fixedaddress + 8); + SD(x5, gback, gdoffset + 8); + SD(x4, gback, gdoffset + 0); + } + } else { + if (u8 > 0) { + LD(x5, gback, gdoffset + 0); + LD(x4, wback, fixedaddress + 8); + LD(x3, wback, fixedaddress + 0); + SLLI(x5, x5, 8 * (8 - u8)); // higher of higher 64 bits + SRLI(x1, x4, 8 * (u8 - 0)); // lower of higher 64 bits + SLLI(x4, x4, 8 * (8 - u8)); // higher of lower 64 bits + OR(x5, x1, x5); // higher 64 bits + SRLI(x3, x3, 8 * (u8 - 0)); // lower of lower 64 bits + SD(x5, gback, gdoffset + 8); + OR(x4, x4, x3); // lower 64 bits + SD(x4, gback, gdoffset + 0); + } else { + LD(x5, wback, fixedaddress + 8); + LD(x4, wback, fixedaddress + 0); + SD(x5, gback, gdoffset + 8); + SD(x4, gback, gdoffset + 0); + } + } + break; + case 0x16: + if (rex.w) { + INST_NAME("PEXTRQ Ed, Gx, Ib"); + } else { + INST_NAME("PEXTRD Ed, Gx, Ib"); + } + nextop = F8; + GETGX(); + GETED(1); + u8 = F8; + if (rex.w) + LD(ed, gback, gdoffset + 8 * (u8 & 1)); + else + LWU(ed, gback, gdoffset + 4 * (u8 & 3)); + if (wback) { + SDxw(ed, wback, fixedaddress); + SMWRITE2(); + } + break; + case 0x17: + INST_NAME("EXTRACTPS Ew, Gx, Ib"); + nextop = F8; + GETGX(); + GETED(1); + u8 = F8; + LWU(ed, gback, gdoffset + 4 * (u8 & 3)); + if (wback) { + SW(ed, wback, fixedaddress); + SMWRITE2(); + } + break; + case 0x20: + INST_NAME("PINSRB Gx, ED, Ib"); + nextop = F8; + GETGX(); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + wback = 0; + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 1); + LB(x1, wback, fixedaddress); + ed = x1; + } + u8 = F8; + SB(ed, gback, gdoffset + (u8 & 0xF)); + break; + case 0x21: + INST_NAME("INSERTPS GX, EX, Ib"); + nextop = F8; + GETGX(); + GETEX(x2, 1, 12); + u8 = F8; + if (MODREG) + s8 = (u8 >> 6) & 3; + else + s8 = 0; + // GX->ud[(tmp8u>>4)&3] = EX->ud[tmp8s]; + LWU(x3, wback, fixedaddress + 4 * s8); + SW(x3, gback, gdoffset + 4 * ((u8 >> 4) & 3)); + for (int i = 0; i < 4; ++i) { + if (u8 & (1 << i)) + // GX->ud[i] = 0; + SW(xZR, gback, gdoffset + 4 * i); + } + break; + case 0x22: + INST_NAME("PINSRD Gx, ED, Ib"); + nextop = F8; + GETGX(); + GETED(1); + u8 = F8; + if (rex.w) { + SD(ed, gback, gdoffset + 8 * (u8 & 0x1)); + } else { + SW(ed, gback, gdoffset + 4 * (u8 & 0x3)); + } + break; + case 0x40: + INST_NAME("DPPS Gx, Ex, Ib"); + nextop = F8; + GETGX(); + GETEX(x2, 1, 12); + u8 = F8; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + d2 = fpu_get_scratch(dyn); + FMVWX(d2, xZR); + for (int i = 0; i < 4; ++i) + if (u8 & (1 << (i + 4))) { + FLW(d0, gback, gdoffset + i * 4); + FLW(d1, wback, fixedaddress + i * 4); + FMULS(d0, d0, d1); + FADDS(d2, d2, d0); + } + for (int i = 0; i < 4; ++i) + if (u8 & (1 << i)) + FSW(d2, gback, gdoffset + i * 4); + else + SW(xZR, gback, gdoffset + i * 4); + break; + case 0x44: + INST_NAME("PCLMULQDQ Gx, Ex, Ib"); + nextop = F8; + GETG; + sse_forget_reg(dyn, ninst, x6, gd); + MOV32w(x1, gd); // gx + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + sse_forget_reg(dyn, ninst, x6, ed); + MOV32w(x2, ed); + MOV32w(x3, 0); // p = NULL + } else { + MOV32w(x2, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x5, &fixedaddress, rex, NULL, 0, 1); + if (ed != x3) { + MV(x3, ed); + } + } + u8 = F8; + MOV32w(x4, u8); + CALL4(const_native_pclmul, -1, x1, x2, x3, x4); + break; + case 0x60: + INST_NAME("PCMPESTRM Gx, Ex, Ib"); + SETFLAGS(X_ALL, SF_SET_DF, NAT_FLAGS_NOFUSION); + nextop = F8; + GETG; + sse_forget_reg(dyn, ninst, x6, gd); + sse_forget_reg(dyn, ninst, x6, 0); + ADDI(x3, xEmu, offsetof(x64emu_t, xmm[gd])); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + sse_reflect_reg(dyn, ninst, x6, ed); + ADDI(x1, xEmu, offsetof(x64emu_t, xmm[ed])); + ed = x1; + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 1); + } + MV(x2, xRDX); + MV(x4, xRAX); + u8 = F8; + ADDI(x5, xZR, u8); + CALL6(const_sse42_compare_string_explicit_len, x1, ed, x2, x3, x4, x5, 0); + if (u8 & 0b1000000) { + switch (u8 & 1) { + case 0b00: + for (int i = 0; i < 16; ++i) { + SRLI(x3, x1, i); + ANDI(x3, x3, 1); + NEG(x3, x3); + SB(x3, xEmu, offsetof(x64emu_t, xmm[0]) + i); + } + break; + case 0b01: + for (int i = 0; i < 8; ++i) { + SRLI(x3, x1, i); + ANDI(x3, x3, 1); + NEG(x3, x3); + SH(x3, xEmu, offsetof(x64emu_t, xmm[0]) + i * 2); + } + break; + } + } else { + SW(x1, xEmu, offsetof(x64emu_t, xmm[0])); + SW(xZR, xEmu, offsetof(x64emu_t, xmm[0]) + 4); + SD(xZR, xEmu, offsetof(x64emu_t, xmm[0]) + 8); + } + break; + case 0x61: + INST_NAME("PCMPESTRI Gx, Ex, Ib"); + nextop = F8; + GETG; + u8 = geted_ib(dyn, addr, ninst, nextop); + SETFLAGS(X_ALL, SF_SET_DF, NAT_FLAGS_NOFUSION); + sse_reflect_reg(dyn, ninst, x6, gd); + ADDI(x3, xEmu, offsetof(x64emu_t, xmm[gd])); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + sse_reflect_reg(dyn, ninst, x6, ed); + ADDI(x1, xEmu, offsetof(x64emu_t, xmm[ed])); + ed = x1; + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 1); + } + ZEXTW2(x2, xRDX); + ZEXTW2(x4, xRAX); + u8 = F8; + ADDI(x5, xZR, u8); + CALL6(const_sse42_compare_string_explicit_len, x1, ed, x2, x3, x4, x5, 0); + ZEROUP(x1); + BNEZ_MARK(x1); + MOV32w(xRCX, (u8 & 1) ? 8 : 16); + B_NEXT_nocond; + MARK; + if (u8 & 0b1000000) { + CLZxw(xRCX, x1, 0, x2, x3, x4); + ADDI(x2, xZR, 31); + SUB(xRCX, x2, xRCX); + } else { + CTZxw(xRCX, x1, 0, x2, x3); + } + break; + case 0x62: + INST_NAME("PCMPISTRM Gx, Ex, Ib"); + SETFLAGS(X_ALL, SF_SET_DF, NAT_FLAGS_NOFUSION); + nextop = F8; + GETG; + sse_forget_reg(dyn, ninst, x6, gd); + sse_forget_reg(dyn, ninst, x6, 0); + ADDI(x2, xEmu, offsetof(x64emu_t, xmm[gd])); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + sse_reflect_reg(dyn, ninst, x6, ed); + ADDI(x1, xEmu, offsetof(x64emu_t, xmm[ed])); + ed = x1; + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 1); + } + u8 = F8; + ADDI(x3, xZR, u8); + CALL4(const_sse42_compare_string_implicit_len, x1, ed, x2, x3, 0); + if (u8 & 0b1000000) { + switch (u8 & 1) { + case 0b00: + for (int i = 0; i < 16; ++i) { + SRLI(x3, x1, i); + ANDI(x3, x3, 1); + NEG(x3, x3); + SB(x3, xEmu, offsetof(x64emu_t, xmm[0]) + i); + } + break; + case 0b01: + for (int i = 0; i < 8; ++i) { + SRLI(x3, x1, i); + ANDI(x3, x3, 1); + NEG(x3, x3); + SH(x3, xEmu, offsetof(x64emu_t, xmm[0]) + i * 2); + } + break; + } + } else { + SW(x1, xEmu, offsetof(x64emu_t, xmm[0])); + SW(xZR, xEmu, offsetof(x64emu_t, xmm[0]) + 4); + SD(xZR, xEmu, offsetof(x64emu_t, xmm[0]) + 8); + } + break; + case 0x63: + INST_NAME("PCMPISTRI Gx, Ex, Ib"); + SETFLAGS(X_ALL, SF_SET_DF, NAT_FLAGS_NOFUSION); + nextop = F8; + GETG; + sse_reflect_reg(dyn, ninst, x6, gd); + ADDI(x2, xEmu, offsetof(x64emu_t, xmm[gd])); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + sse_reflect_reg(dyn, ninst, x6, ed); + ADDI(x1, xEmu, offsetof(x64emu_t, xmm[ed])); + ed = x1; + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 1); + } + u8 = F8; + MOV32w(x3, u8); + CALL4(const_sse42_compare_string_implicit_len, x1, ed, x2, x3, 0); + ZEROUP(x1); + BNEZ_MARK(x1); + MOV32w(xRCX, (u8 & 1) ? 8 : 16); + B_NEXT_nocond; + MARK; + if (u8 & 0b1000000) { + CLZxw(xRCX, x1, 0, x2, x3, x4); + ADDI(x2, xZR, 31); + SUB(xRCX, x2, xRCX); + } else { + CTZxw(xRCX, x1, 0, x2, x3); + } + break; + case 0xDF: + INST_NAME("AESKEYGENASSIST Gx, Ex, Ib"); // AES-NI + nextop = F8; + GETG; + sse_forget_reg(dyn, ninst, x6, gd); + MOV32w(x1, gd); // gx + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + sse_forget_reg(dyn, ninst, x6, ed); + MOV32w(x2, ed); + MOV32w(x3, 0); // p = NULL + } else { + MOV32w(x2, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 1); + if (ed != x3) { + MV(x3, ed); + } + } + u8 = F8; + MOV32w(x4, u8); + CALL4(const_native_aeskeygenassist, -1, x1, x2, x3, x4); + break; + default: + DEFAULT; + } + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/rv64/dynarec_rv64_660f_vector.c b/src/dynarec/rv64/dynarec_rv64_660f_vector.c index bcda410..61d5e39 100644 --- a/src/dynarec/rv64/dynarec_rv64_660f_vector.c +++ b/src/dynarec/rv64/dynarec_rv64_660f_vector.c @@ -4,10 +4,8 @@ #include #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -18,7 +16,7 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_660F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { @@ -35,7 +33,9 @@ uintptr_t dynarec64_660F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t i int v0, v1; int q0, q1; int d0, d1, d2; + uint64_t tmp64u0, tmp64u1; int64_t fixedaddress, gdoffset; + uint32_t vtypei; int unscaled; MAYUSE(d0); MAYUSE(d1); @@ -45,26 +45,2396 @@ uintptr_t dynarec64_660F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t i MAYUSE(eb2); MAYUSE(j64); switch (opcode) { + case 0x10: + INST_NAME("MOVUPD Gx, Ex"); + nextop = F8; + GETG; + if (MODREG) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, dyn->vector_eew); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + VMV_V_V(v0, v1); + } else { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); // unaligned! + SMREAD(); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VLE8_V(v0, ed, VECTOR_UNMASKED, VECTOR_NFIELD1); + } + break; + case 0x11: + INST_NAME("MOVUPD Ex, Gx"); + nextop = F8; + GETG; + if (MODREG) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + v0 = sse_get_reg_vector(dyn, ninst, x1, gd, 0, dyn->vector_eew); + v1 = sse_get_reg_empty_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3)); + VMV_V_V(v1, v0); + } else { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); // unaligned! + v0 = sse_get_reg_vector(dyn, ninst, x1, gd, 0, dyn->vector_eew); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VSE8_V(v0, ed, VECTOR_UNMASKED, VECTOR_NFIELD1); + SMWRITE2(); + } + break; + case 0x12: + INST_NAME("MOVLPD Gx, Eq"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(v0, 1, VECTOR_SEW64); + if (MODREG) { + // access register instead of memory is bad opcode! + DEFAULT; + return addr; + } + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + if (cpuext.xtheadvector) { + v1 = fpu_get_scratch(dyn); + VMV_S_X(v1, x4); + VECTOR_LOAD_VMASK(0b01, x3, 1); + VMERGE_VVM(v0, v0, v1); // implies VMASK + } else { + VMV_S_X(v0, x4); + } + break; + case 0x13: + INST_NAME("MOVLPD Eq, Gx"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(v0, 0, VECTOR_SEW64); + if (MODREG) { + DEFAULT; + return addr; + } + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + VMV_X_S(x4, v0); + SD(x4, ed, fixedaddress); + SMWRITE2(); + break; + case 0x14: + INST_NAME("UNPCKLPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + // GX->q[0] = GX->q[0]; -> unchanged + // GX->q[1] = EX->q[0]; + GETGX_vector(v0, 1, VECTOR_SEW64); + if (MODREG) { + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + if (v0 == v1) { + // for vslideup.vi, cannot be overlapped + v1 = fpu_get_scratch(dyn); + VMV_V_V(v1, v0); + } + VSLIDEUP_VI(v0, v1, 1, VECTOR_UNMASKED); + } else { + q0 = fpu_get_scratch(dyn); + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + VECTOR_LOAD_VMASK(0b10, x1, 1); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 0); + VLUXEI64_V(v0, q0, ed, VECTOR_MASKED, VECTOR_NFIELD1); + } + break; + case 0x15: + INST_NAME("UNPCKHPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + // GX->q[0] = GX->q[1]; + // GX->q[1] = EX->q[1]; + GETGX_vector(v0, 1, VECTOR_SEW64); + if (MODREG) { + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + q0 = fpu_get_scratch(dyn); + VSLIDE1DOWN_VX(q0, v0, xZR, VECTOR_UNMASKED); + if (cpuext.xtheadvector) { + VECTOR_LOAD_VMASK(0b01, x4, 1); + VMERGE_VVM(v0, v1, q0); // implies VMASK + } else { + if (v0 != v1) { VMV_V_V(v0, v1); } + VMV_X_S(x4, q0); + VMV_S_X(v0, x4); + } + } else { + q0 = fpu_get_scratch(dyn); + VECTOR_LOAD_VMASK(0b10, x1, 1); + VSLIDE1DOWN_VX(v0, v0, xZR, VECTOR_UNMASKED); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 0); + VLE64_V(v0, ed, VECTOR_MASKED, VECTOR_NFIELD1); + } + break; + case 0x16: + INST_NAME("MOVHPD Gx, Eq"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(v0, 1, VECTOR_SEW64); + if (MODREG) { + // access register instead of memory is bad opcode! + DEFAULT; + return addr; + } + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 0); + LD(x4, ed, fixedaddress); + d0 = fpu_get_scratch(dyn); + VMV_S_X(d0, x4); + VSLIDEUP_VI(v0, d0, 1, VECTOR_UNMASKED); + break; + case 0x17: + INST_NAME("MOVHPD Eq, Gx"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(v0, 1, VECTOR_SEW64); + if (MODREG) { + // access register instead of memory is bad opcode! + DEFAULT; + return addr; + } + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 0); + d0 = fpu_get_scratch(dyn); + VSLIDE1DOWN_VX(d0, v0, xZR, VECTOR_UNMASKED); + VMV_X_S(x5, d0); + SD(x5, ed, fixedaddress); + SMWRITE2(); + break; + case 0x18: + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: + case 0x1F: + return 0; + case 0x28: + INST_NAME("MOVAPD Gx, Ex"); + nextop = F8; + GETG; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_vector(dyn, ninst, x1, ed, 0, dyn->vector_eew); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + VMV_V_V(v0, v1); + } else { + SMREAD(); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VLE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + } + break; + case 0x29: + INST_NAME("MOVAPD Ex, Gx"); + nextop = F8; + GETG; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + v0 = sse_get_reg_vector(dyn, ninst, x1, gd, 0, dyn->vector_eew); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_empty_vector(dyn, ninst, x1, ed); + VMV_V_V(v1, v0); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VSE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + SMWRITE2(); + } + break; + case 0x2B: + INST_NAME("MOVNTPD Ex, Gx"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETGX_vector(v0, 0, dyn->vector_eew); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_empty_vector(dyn, ninst, x1, ed); + VMV_V_V(v1, v0); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VSE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + SMWRITE2(); + } + break; + case 0x2E: + case 0x2F: + return 0; + case 0x38: // SSSE3 opcodes + nextop = F8; + switch (nextop) { + case 0x00: + INST_NAME("PSHUFB Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGX_vector(q0, 1, VECTOR_SEW8); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + ADDI(x4, xZR, 0b000010001111); + VMV_V_X(v0, x4); // broadcast the mask + VAND_VV(v0, q1, v0, VECTOR_UNMASKED); + VRGATHER_VV(v1, q0, v0, VECTOR_UNMASKED); // registers cannot be overlapped!! + VMV_V_V(q0, v1); + break; + case 0x01: + INST_NAME("PHADDW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(v0, q0); + if (q1 & 1) VMV_V_V(d1, q1); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL2, 2); + VSLIDEUP_VI(v0, (q1 & 1) ? d1 : q1, 8, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 1); + VNSRL_WI(d0, v0, 0, VECTOR_UNMASKED); + VNSRL_WI(d1, v0, 16, VECTOR_UNMASKED); + VADD_VV(q0, d1, d0, VECTOR_UNMASKED); + break; + case 0x02: + INST_NAME("PHADDD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(v0, q0); + if (q1 & 1) VMV_V_V(d1, q1); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL2, 2); + VSLIDEUP_VI(v0, (q1 & 1) ? d1 : q1, 4, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 1); + ADDI(x4, xZR, 32); + VNSRL_WX(d0, v0, xZR, VECTOR_UNMASKED); + VNSRL_WX(d1, v0, x4, VECTOR_UNMASKED); + VADD_VV(q0, d1, d0, VECTOR_UNMASKED); + break; + case 0x03: + INST_NAME("PHADDSW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(v0, q0); + if (q1 & 1) VMV_V_V(d1, q1); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL2, 2); + VSLIDEUP_VI(v0, (q1 & 1) ? d1 : q1, 8, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 1); + VNSRL_WI(d0, v0, 0, VECTOR_UNMASKED); + VNSRL_WI(d1, v0, 16, VECTOR_UNMASKED); + VSADD_VV(q0, d1, d0, VECTOR_UNMASKED); + break; + case 0x04: + INST_NAME("PMADDUBSW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGX_vector(q0, 1, VECTOR_SEW8); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); // no more scratches! + VWMULSU_VV(v0, q1, q0, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VNSRL_WI(d0, v0, 0, VECTOR_UNMASKED); + VNSRL_WI(d1, v0, 16, VECTOR_UNMASKED); + VSADD_VV(q0, d1, d0, VECTOR_UNMASKED); + break; + case 0x05: + INST_NAME("PHSUBW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(v0, q0); + if (q1 & 1) VMV_V_V(d1, q1); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL2, 2); + VSLIDEUP_VI(v0, (q1 & 1) ? d1 : q1, 8, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 1); + VNSRL_WI(d0, v0, 0, VECTOR_UNMASKED); + VNSRL_WI(d1, v0, 16, VECTOR_UNMASKED); + VSUB_VV(q0, d0, d1, VECTOR_UNMASKED); + break; + case 0x08 ... 0x0A: + if (nextop == 0x08) { + INST_NAME("PSIGNB Gx, Ex"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + i32 = 7; + nextop = F8; + GETGX_vector(q0, 1, VECTOR_SEW8); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + } else if (nextop == 0x09) { + INST_NAME("PSIGNW Gx, Ex"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + i32 = 15; + nextop = F8; + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + } else { + INST_NAME("PSIGND Gx, Ex"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + i32 = 31; + nextop = F8; + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + } + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VMSLT_VX(VMASK, q1, xZR, VECTOR_UNMASKED); + VRSUB_VX(q0, q0, xZR, VECTOR_MASKED); + VMSEQ_VX(VMASK, q1, xZR, VECTOR_UNMASKED); + VXOR_VV(q0, q0, q0, VECTOR_MASKED); + break; + case 0x0B: + INST_NAME("PMULHRSW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + fpu_get_scratch(dyn); + VWMUL_VV(v0, q1, q0, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL2, 2); + VSRL_VI(v0, v0, 14, VECTOR_UNMASKED); + VADD_VI(v0, v0, 1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 1); + VNSRL_WI(q0, v0, 1, VECTOR_UNMASKED); + break; + case 0x10: + INST_NAME("PBLENDVB Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGX_vector(q0, 1, VECTOR_SEW8); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + v0 = sse_get_reg_vector(dyn, ninst, x4, 0, 0, VECTOR_SEW8); + VMSLT_VX(VMASK, v0, xZR, VECTOR_UNMASKED); + VADD_VX(q0, q1, xZR, VECTOR_MASKED); + break; + case 0x14: + INST_NAME("PBLENDVPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + v0 = sse_get_reg_vector(dyn, ninst, x4, 0, 0, VECTOR_SEW32); + VMSLT_VX(VMASK, v0, xZR, VECTOR_UNMASKED); + VADD_VX(q0, q1, xZR, VECTOR_MASKED); + break; + case 0x15: + INST_NAME("PBLENDVPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + GETEX_vector(q1, 0, 0, VECTOR_SEW64); + v0 = sse_get_reg_vector(dyn, ninst, x4, 0, 0, VECTOR_SEW64); + VMSLT_VX(VMASK, v0, xZR, VECTOR_UNMASKED); + VADD_VX(q0, q1, xZR, VECTOR_MASKED); + break; + case 0x17: + INST_NAME("PTEST Gx, Ex"); + nextop = F8; + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 0, VECTOR_SEW64); + GETEX_vector(q1, 0, 0, VECTOR_SEW64); + CLEAR_FLAGS(); + SET_DFNONE(); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + IFX (X_ZF) { + VAND_VV(v0, q1, q0, VECTOR_UNMASKED); + if (cpuext.xtheadvector) { + // Force the mask element width to 32 + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL2, 1); + } + VMSGTU_VX(VMASK, v0, xZR, VECTOR_UNMASKED); + if (cpuext.xtheadvector) { + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL1, 1); + } + VMV_X_S(x4, VMASK); + if (!cpuext.xtheadvector) ANDI(x4, x4, 0b11); + BNEZ(x4, 8); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_CF) { + VXOR_VI(v0, q0, 0x1F, VECTOR_UNMASKED); + VAND_VV(v0, q1, v0, VECTOR_UNMASKED); + if (cpuext.xtheadvector) { + // Force the mask element width to 32 + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL2, 1); + } + VMSGTU_VX(VMASK, v0, xZR, VECTOR_UNMASKED); + if (cpuext.xtheadvector) { + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL1, 1); + } + VMV_X_S(x4, VMASK); + if (!cpuext.xtheadvector) ANDI(x4, x4, 0b11); + BNEZ(x4, 8); + ORI(xFlags, xFlags, 1 << F_CF); + } + break; + case 0x1C ... 0x1E: + if (nextop == 0x1C) { + INST_NAME("PABSB Gx, Ex"); + u8 = VECTOR_SEW8; + } else if (nextop == 0x1D) { + INST_NAME("PABSW Gx, Ex"); + u8 = VECTOR_SEW16; + } else { + INST_NAME("PABSD Gx, Ex"); + u8 = VECTOR_SEW32; + } + nextop = F8; + SET_ELEMENT_WIDTH(x1, u8, 1); + GETEX_vector(q1, 0, 0, u8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch(dyn); + VSRA_VI(v0, q1, 0x1F, VECTOR_UNMASKED); + VXOR_VV(q0, v0, q1, VECTOR_UNMASKED); + VSUB_VV(q0, q0, v0, VECTOR_UNMASKED); + break; + case 0x20: + INST_NAME("PMOVSXBW Gx, Ex"); + nextop = F8; + if (cpuext.xtheadvector) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 0.5); + VWADD_VX(v0, q1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VMV_V_V(q0, v0); + } else { + if (!MODREG) SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + VSEXT_VF2(q0, q1, VECTOR_UNMASKED); + } + break; + case 0x21: + INST_NAME("PMOVSXBD Gx, Ex"); + nextop = F8; + if (cpuext.xtheadvector) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 0.25); + VWADD_VX(v0, q1, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 0.5); + VWADD_VX(v1, v0, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + VMV_V_V(q0, v1); + } else { + if (!MODREG) SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + VSEXT_VF4(q0, q1, VECTOR_UNMASKED); + } + break; + break; + case 0x22: + INST_NAME("PMOVSXBQ Gx, Ex"); + nextop = F8; + if (cpuext.xtheadvector) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 0.125); + VWADD_VX(v0, q1, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 0.25); + VWADD_VX(v1, v0, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 0.5); + VWADD_VX(v0, v1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VMV_V_V(q0, v0); + } else { + if (!MODREG) SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + VSEXT_VF8(q0, q1, VECTOR_UNMASKED); + } + break; + case 0x23: + INST_NAME("PMOVSXWD Gx, Ex"); + nextop = F8; + if (cpuext.xtheadvector) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 0.5); + VWADD_VX(v0, q1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + VMV_V_V(q0, v0); + } else { + if (!MODREG) SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + VSEXT_VF2(q0, q1, VECTOR_UNMASKED); + } + break; + case 0x24: + INST_NAME("PMOVSXWQ Gx, Ex"); + nextop = F8; + if (cpuext.xtheadvector) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 0.25); + VWADD_VX(v0, q1, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 0.5); + VWADD_VX(v1, v0, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VMV_V_V(q0, v1); + } else { + if (!MODREG) SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + VSEXT_VF4(q0, q1, VECTOR_UNMASKED); + } + break; + case 0x25: + INST_NAME("PMOVSXDQ Gx, Ex"); + nextop = F8; + if (cpuext.xtheadvector) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 0.5); + VWADD_VX(v0, q1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VMV_V_V(q0, v0); + } else { + if (!MODREG) SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + VSEXT_VF2(q0, q1, VECTOR_UNMASKED); + } + break; + case 0x28: + INST_NAME("PMULDQ Gx, Ex"); + nextop = F8; + if (cpuext.vlen >= 32) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(v0, 1, VECTOR_SEW64); + GETEX_vector(v1, 0, 0, VECTOR_SEW64); + d1 = fpu_get_scratch(dyn); + ADDI(x2, xZR, 32); + VSLL_VX(v0, v0, x2, VECTOR_UNMASKED); + VSRA_VX(v0, v0, x2, VECTOR_UNMASKED); + VSLL_VX(d1, v1, x2, VECTOR_UNMASKED); + VSRA_VX(d1, d1, x2, VECTOR_UNMASKED); + VMUL_VV(v0, v0, d1, VECTOR_UNMASKED); + } else { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(v0, 1, VECTOR_SEW32); + GETEX_vector(v1, 0, 0, VECTOR_SEW32); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch(dyn); + VWMUL_VV(d0, v0, v1, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VSLIDEUP_VI(d0, d1, 1, VECTOR_UNMASKED); + VMV_V_V(v0, d0); + } + break; + case 0x29: + INST_NAME("PCMPEQQ Gx, Ex"); // SSE4 opcode! + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW64); + GETGX_vector(q0, 1, VECTOR_SEW64); + VMSEQ_VV(VMASK, q0, q1, VECTOR_UNMASKED); + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + VMERGE_VIM(q0, q0, 0b11111); + break; + case 0x2B: + INST_NAME("PACKUSDW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + GETGX_vector(q0, 1, VECTOR_SEW32); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VXOR_VV(d0, d0, d0, VECTOR_UNMASKED); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMAX_VX(d0, q0, xZR, VECTOR_UNMASKED); + if (q0 != q1) VMAX_VX(d1, q1, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 0.5); + VNCLIPU_WX(q0, d0, xZR, VECTOR_UNMASKED); + if (q0 != q1) VNCLIPU_WX(v0, d1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + if (q0 == q1) VMV_V_V(v0, q0); + VSLIDEUP_VI(q0, v0, 4, VECTOR_UNMASKED); + break; + case 0x30: + INST_NAME("PMOVZXBW Gx, Ex"); + nextop = F8; + if (cpuext.xtheadvector) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 0.5); + VWADDU_VX(v0, q1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VMV_V_V(q0, v0); + } else { + if (!MODREG) SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + VZEXT_VF2(q0, q1, VECTOR_UNMASKED); + } + break; + case 0x31: + INST_NAME("PMOVZXBD Gx, Ex"); + nextop = F8; + if (cpuext.xtheadvector) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 0.25); + VWADDU_VX(v0, q1, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 0.5); + VWADDU_VX(v1, v0, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + VMV_V_V(q0, v1); + } else { + if (!MODREG) SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + VZEXT_VF4(q0, q1, VECTOR_UNMASKED); + } + break; + case 0x32: + INST_NAME("PMOVZXBQ Gx, Ex"); + nextop = F8; + if (cpuext.xtheadvector) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 0.125); + VWADDU_VX(v0, q1, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 0.25); + VWADDU_VX(v1, v0, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 0.5); + VWADDU_VX(v0, v1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VMV_V_V(q0, v0); + } else { + if (!MODREG) SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + VZEXT_VF8(q0, q1, VECTOR_UNMASKED); + } + break; + case 0x33: + INST_NAME("PMOVZXWD Gx, Ex"); + nextop = F8; + if (cpuext.xtheadvector) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 0.5); + VWADDU_VX(v0, q1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + VMV_V_V(q0, v0); + } else { + if (!MODREG) SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + VZEXT_VF2(q0, q1, VECTOR_UNMASKED); + } + break; + case 0x34: + INST_NAME("PMOVZXWQ Gx, Ex"); + nextop = F8; + if (cpuext.xtheadvector) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 0.25); + VWADDU_VX(v0, q1, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 0.5); + VWADDU_VX(v1, v0, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VMV_V_V(q0, v1); + } else { + if (!MODREG) SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + VZEXT_VF4(q0, q1, VECTOR_UNMASKED); + } + break; + case 0x35: + INST_NAME("PMOVZXDQ Gx, Ex"); + nextop = F8; + if (cpuext.xtheadvector) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 0.5); + VWADDU_VX(v0, q1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VMV_V_V(q0, v0); + } else { + if (!MODREG) SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + GETGX_empty_vector(q0); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (q0 == q1) { + q1 = fpu_get_scratch(dyn); + VMV_V_V(q1, q0); + } + VZEXT_VF2(q0, q1, VECTOR_UNMASKED); + } + break; + case 0x37: + INST_NAME("PCMPGTQ Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VMSLT_VV(VMASK, q1, q0, VECTOR_UNMASKED); + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + VMERGE_VIM(q0, q0, 0b11111); // implies vmask and widened it + break; + case 0x39: + INST_NAME("PMINSD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + VMIN_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0x3A: + INST_NAME("PMINUW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + GETGX_vector(q0, 1, VECTOR_SEW16); + VMINU_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0x3B: + INST_NAME("PMINUD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + GETGX_vector(q0, 1, VECTOR_SEW32); + VMINU_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0x3D: + INST_NAME("PMAXSD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + VMAX_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0x40: + INST_NAME("PMULLD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + GETGX_vector(q0, 1, VECTOR_SEW32); + VMUL_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0xDB ... 0xDF: + return 0; + default: + DEFAULT_VECTOR; + } + break; + case 0x3A: // these are some more SSSE3+ opcodes + opcode = F8; + switch (opcode) { + case 0x0E: + INST_NAME("PBLENDW Gx, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 1, VECTOR_SEW16); + u8 = F8; + VECTOR_LOAD_VMASK(u8, x4, 1); + VADD_VI(q0, q1, 0, VECTOR_MASKED); + break; + case 0x0F: + INST_NAME("PALIGNR Gx, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGX_vector(q0, 1, VECTOR_SEW8); + GETEX_vector(q1, 0, 1, VECTOR_SEW8); + u8 = F8; + if (u8 > 31) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else if (u8 > 16) { + d0 = fpu_get_scratch(dyn); + if (cpuext.vlen >= 32) { + // clear high bits before slidedown! + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 2); + VXOR_VV(d0, d0, d0, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 1); + } + VMV_V_V(d0, q0); + VSLIDEDOWN_VI(q0, d0, u8 - 16, VECTOR_UNMASKED); + } else if (u8 == 16) { + // nop + } else if (u8 > 0) { + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + VSLIDEUP_VI(v0, q0, 16 - u8, VECTOR_UNMASKED); + if (cpuext.vlen >= 32) { + // clear high bits before slidedown! + d0 = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 2); + VXOR_VV(d0, d0, d0, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 1); + VMV_V_V(d0, q1); + q1 = d0; + } + VSLIDEDOWN_VI(v1, q1, u8, VECTOR_UNMASKED); + VOR_VV(q0, v1, v0, VECTOR_UNMASKED); + } else { + if (q0 != q1) VMV_V_V(q0, q1); + } + break; + case 0x16: + nextop = F8; + if (rex.w) { + INST_NAME("PEXTRQ Ed, Gx, Ib"); + } else { + INST_NAME("PEXTRD Ed, Gx, Ib"); + } + SET_ELEMENT_WIDTH(x1, (rex.w ? VECTOR_SEW64 : VECTOR_SEW32), 1); + GETGX_vector(q0, 1, dyn->vector_eew); + if (MODREG) { + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + u8 = F8; + if (u8 & (rex.w ? 1 : 3)) { + if (cpuext.xtheadvector) { + ADDI(x4, xZR, (u8 & (rex.w ? 1 : 3))); + VEXT_X_V(ed, q0, x4); + } else { + d0 = fpu_get_scratch(dyn); + VSLIDEDOWN_VI(d0, q0, (u8 & (rex.w ? 1 : 3)), VECTOR_UNMASKED); + VMV_X_S(ed, d0); + if (!rex.w) ZEROUP(ed); + } + } else { + VMV_X_S(ed, q0); + if (!cpuext.xtheadvector && !rex.w) ZEROUP(ed); + } + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 1); + u8 = F8; + if (u8 & (rex.w ? 1 : 3)) { + if (cpuext.xtheadvector) { + ADDI(x4, xZR, (u8 & (rex.w ? 1 : 3))); + VEXT_X_V(x5, q0, x4); + } else { + d0 = fpu_get_scratch(dyn); + VSLIDEDOWN_VI(d0, q0, (u8 & (rex.w ? 1 : 3)), VECTOR_UNMASKED); + VMV_X_S(x5, d0); + } + } else { + VMV_X_S(x5, q0); + } + SDxw(x5, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0x22: + INST_NAME("PINSRD Gx, Ed, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, rex.w ? VECTOR_SEW64 : VECTOR_SEW32, 1); + GETGX_vector(q0, 1, dyn->vector_eew); + if (MODREG) { + u8 = (F8) & (rex.w ? 1 : 3); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 1); + u8 = (F8) & (rex.w ? 1 : 3); + LDxw(x4, ed, fixedaddress); + ed = x4; + } + VECTOR_LOAD_VMASK((1 << u8), x5, 1); + v0 = fpu_get_scratch(dyn); + VMERGE_VXM(v0, q0, ed); // uses VMASK + VMV_V_V(q0, v0); + break; + case 0x40: + INST_NAME("DPPS Gx, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 1, VECTOR_SEW32); + u8 = F8; + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + d0 = fpu_get_scratch(dyn); + VXOR_VV(v1, v1, v1, VECTOR_UNMASKED); + VECTOR_LOAD_VMASK((u8 >> 4), x4, 1); + VFMUL_VV(v0, q0, q1, VECTOR_MASKED); + VFREDUSUM_VS(d0, v0, v1, VECTOR_MASKED); + VMV_X_S(x4, d0); + VMV_V_X(d0, x4); + VECTOR_LOAD_VMASK((u8 & 0xf), x4, 1); + VMERGE_VVM(q0, v1, d0); + break; + case 0x44: + case 0x60 ... 0x63: + case 0xDF: return 0; + default: DEFAULT_VECTOR; + } + break; + case 0x40 ... 0x4F: return 0; + case 0x50: + INST_NAME("PMOVMSKD Gd, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGD; + GETEX_vector(q0, 0, 0, VECTOR_SEW64); + if (cpuext.xtheadvector) { + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + ADDI(x4, xZR, 63); + VSRL_VX(v0, q0, x4, VECTOR_UNMASKED); + // Force the mask element width to 32 + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL2, 1); + VMSNE_VX(VMASK, v0, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL1, 1); + VMV_X_S(x4, VMASK); + ANDI(gd, x4, 1); + SRLI(x4, x4, 31); + OR(gd, gd, x4); + } else { + VMSLT_VX(VMASK, q0, xZR, VECTOR_UNMASKED); + VMV_X_S(x4, VMASK); + ANDI(gd, x4, 0b11); + } + break; + case 0x51: + INST_NAME("SQRTPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + GETEX_vector(q1, 0, 0, VECTOR_SEW64); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + VMFLT_VV(VMASK, q1, v0, VECTOR_UNMASKED); + } + VFSQRT_V(q0, q1, VECTOR_UNMASKED); + if (!BOX64ENV(dynarec_fastnan)) { + VFSGNJN_VV(q0, q0, q0, VECTOR_MASKED); + } + break; + case 0x54: + INST_NAME("ANDPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETGX_vector(q0, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VAND_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0x55: + INST_NAME("ANDNPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETGX_vector(q0, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VXOR_VI(q0, q0, 0x1F, VECTOR_UNMASKED); + VAND_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0x56: + INST_NAME("ORPD Gx, Ex"); + nextop = F8; + GETG; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + if (MODREG && ((nextop & 7) + (rex.b << 3) == gd)) { + // special case for XORPD Gx, Gx + q0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + VOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else { + GETGX_vector(q0, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VOR_VV(q0, q1, q0, VECTOR_UNMASKED); + } + break; + case 0x57: + INST_NAME("XORPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETGX_vector(q0, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VXOR_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0x58: + INST_NAME("ADDPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + GETEX_vector(q1, 0, 0, VECTOR_SEW64); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + VMFEQ_VV(VMASK, q0, q0, VECTOR_UNMASKED); + VMFEQ_VV(v0, q1, q1, VECTOR_UNMASKED); + } + VFADD_VV(q0, q0, q1, VECTOR_UNMASKED); + if (!BOX64ENV(dynarec_fastnan)) { + VMAND_MM(VMASK, v0, VMASK); + VMFEQ_VV(v0, q0, q0, VECTOR_UNMASKED); + VXOR_VI(v0, v0, 0x1F, VECTOR_UNMASKED); + VMAND_MM(VMASK, v0, VMASK); + VFSGNJN_VV(q0, q0, q0, VECTOR_MASKED); + } + break; + case 0x59: + INST_NAME("MULPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + GETEX_vector(q1, 0, 0, VECTOR_SEW64); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + VMFEQ_VV(VMASK, q0, q0, VECTOR_UNMASKED); + VMFEQ_VV(v0, q1, q1, VECTOR_UNMASKED); + } + VFMUL_VV(q0, q0, q1, VECTOR_UNMASKED); + if (!BOX64ENV(dynarec_fastnan)) { + VMAND_MM(VMASK, v0, VMASK); + VMFEQ_VV(v0, q0, q0, VECTOR_UNMASKED); + VXOR_VI(v0, v0, 0x1F, VECTOR_UNMASKED); + VMAND_MM(VMASK, v0, VMASK); + VFSGNJN_VV(q0, q0, q0, VECTOR_MASKED); + } + break; + case 0x5A: + INST_NAME("CVTPD2PS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEX_vector(v1, 0, 0, VECTOR_SEW64); + GETGX_empty_vector(v0); + if (v1 & 1) { + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(d1, v1); + } else { + d1 = v1; + } + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 0.5); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VFNCVT_F_F_W(d0, d1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL1, 1); + if (!cpuext.xtheadvector) VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + VMV_X_S(x4, d0); + VMV_S_X(v0, x4); + break; + case 0x5B: + if (!BOX64ENV(dynarec_fastround)) return 0; + INST_NAME("CVTPS2DQ Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(v1, 0, 0, VECTOR_SEW32); + GETGX_empty_vector(v0); + u8 = sse_setround(dyn, ninst, x6, x4); + VFCVT_X_F_V(v0, v1, VECTOR_UNMASKED); + x87_restoreround(dyn, ninst, u8); + break; + case 0x5C: + INST_NAME("SUBPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + GETEX_vector(q1, 0, 0, VECTOR_SEW64); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + VMFEQ_VV(VMASK, q0, q0, VECTOR_UNMASKED); + VMFEQ_VV(v0, q1, q1, VECTOR_UNMASKED); + } + VFSUB_VV(q0, q0, q1, VECTOR_UNMASKED); + if (!BOX64ENV(dynarec_fastnan)) { + VMAND_MM(VMASK, v0, VMASK); + VMFEQ_VV(v0, q0, q0, VECTOR_UNMASKED); + VXOR_VI(v0, v0, 0x1F, VECTOR_UNMASKED); + VMAND_MM(VMASK, v0, VMASK); + VFSGNJN_VV(q0, q0, q0, VECTOR_MASKED); + } + break; + case 0x5D: + INST_NAME("MINPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + GETEX_vector(q1, 0, 0, VECTOR_SEW64); + v0 = fpu_get_scratch(dyn); + VMFEQ_VV(VMASK, q0, q0, VECTOR_UNMASKED); + VMFEQ_VV(v0, q1, q1, VECTOR_UNMASKED); + VFMIN_VV(q0, q0, q1, VECTOR_UNMASKED); + VMAND_MM(VMASK, v0, VMASK); + VXOR_VI(VMASK, VMASK, 0x1F, VECTOR_UNMASKED); + VADD_VX(q0, q1, xZR, VECTOR_MASKED); + break; + case 0x5E: + INST_NAME("DIVPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + GETEX_vector(q1, 0, 0, VECTOR_SEW64); + if (!BOX64ENV(dynarec_fastnan)) { + v0 = fpu_get_scratch(dyn); + VMFEQ_VV(VMASK, q0, q0, VECTOR_UNMASKED); + VMFEQ_VV(v0, q1, q1, VECTOR_UNMASKED); + } + VFDIV_VV(q0, q0, q1, VECTOR_UNMASKED); + if (!BOX64ENV(dynarec_fastnan)) { + VMAND_MM(VMASK, v0, VMASK); + VMFEQ_VV(v0, q0, q0, VECTOR_UNMASKED); + VXOR_VI(v0, v0, 0x1F, VECTOR_UNMASKED); + VMAND_MM(VMASK, v0, VMASK); + VFSGNJN_VV(q0, q0, q0, VECTOR_MASKED); + } + break; + case 0x5F: + INST_NAME("MAXPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + GETEX_vector(q1, 0, 0, VECTOR_SEW64); + v0 = fpu_get_scratch(dyn); + VMFEQ_VV(VMASK, q0, q0, VECTOR_UNMASKED); + VMFEQ_VV(v0, q1, q1, VECTOR_UNMASKED); + VFMAX_VV(q0, q0, q1, VECTOR_UNMASKED); + VMAND_MM(VMASK, v0, VMASK); + VXOR_VI(VMASK, VMASK, 0x1F, VECTOR_UNMASKED); + VADD_VX(q0, q1, xZR, VECTOR_MASKED); + break; + case 0x60: + INST_NAME("PUNPCKLBW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGX_vector(q0, 1, VECTOR_SEW8); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VWADDU_VX(d0, q0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v0, q1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VSLL_VI(v0, v0, 8, VECTOR_UNMASKED); + VOR_VV(q0, d0, v0, VECTOR_UNMASKED); + break; + case 0x61: + INST_NAME("PUNPCKLWD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VWADDU_VX(d0, q0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v0, q1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + VSLL_VI(v0, v0, 16, VECTOR_UNMASKED); + VOR_VV(q0, d0, v0, VECTOR_UNMASKED); + break; + case 0x62: + INST_NAME("PUNPCKLDQ Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + MOV32w(x2, 32); + VWADDU_VX(d0, q0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v0, q1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VSLL_VX(v0, v0, x2, VECTOR_UNMASKED); + VOR_VV(q0, d0, v0, VECTOR_UNMASKED); + break; + case 0x63: + INST_NAME("PACKSSWB Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch(dyn); + if (cpuext.vlen >= 32) { + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 2); // double the vl for slideup. + VMV_V_V(d0, q0); + VSLIDEUP_VI(d0, q1, 8, VECTOR_UNMASKED); // splice q0 and q1 here! + } else { + VMV_V_V(d0, q0); + VMV_V_V(d1, q1); + } + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + VNCLIP_WI(q0, d0, 0, VECTOR_UNMASKED); + break; + case 0x64 ... 0x66: + if (opcode == 0x64) { + INST_NAME("PCMPGTB Gx, Ex"); + u8 = VECTOR_SEW8; + } else if (opcode == 0x65) { + INST_NAME("PCMPGTW Gx, Ex"); + u8 = VECTOR_SEW16; + } else { + INST_NAME("PCMPGTD Gx, Ex"); + u8 = VECTOR_SEW32; + } + nextop = F8; + SET_ELEMENT_WIDTH(x1, u8, 1); + GETGX_vector(q0, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VMSLT_VV(VMASK, q1, q0, VECTOR_UNMASKED); + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + VMERGE_VIM(q0, q0, 0b11111); // implies vmask and widened it + break; + case 0x67: + INST_NAME("PACKUSWB Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch(dyn); + if (cpuext.vlen >= 32) { + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 2); // double the vl for slideup. + if (q0 == q1) { + VMV_V_V(d0, q0); + VSLIDEUP_VI(d0, q1, 8, VECTOR_UNMASKED); // splice q0 and q1 here! + VMAX_VX(d0, d0, xZR, VECTOR_UNMASKED); + } else { + VSLIDEUP_VI(q0, q1, 8, VECTOR_UNMASKED); // splice q0 and q1 here! + VMAX_VX(d0, q0, xZR, VECTOR_UNMASKED); + } + } else { + VMAX_VX(d0, q0, xZR, VECTOR_UNMASKED); + VMAX_VX(d1, q1, xZR, VECTOR_UNMASKED); + } + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + VNCLIPU_WI(q0, d0, 0, VECTOR_UNMASKED); + break; + case 0x68 ... 0x6A: + if (opcode == 0x68) { + INST_NAME("PUNPCKHBW Gx, Ex"); + u8 = VECTOR_SEW8; + i32 = VECTOR_SEW16; + s8 = 8; + d2 = 8; + } else if (opcode == 0x69) { + INST_NAME("PUNPCKHWD Gx, Ex"); + u8 = VECTOR_SEW16; + i32 = VECTOR_SEW32; + s8 = 4; + d2 = 16; + } else { + INST_NAME("PUNPCKHDQ Gx, Ex"); + u8 = VECTOR_SEW32; + i32 = VECTOR_SEW64; + s8 = 2; + d2 = 32; + MOV32w(x5, 32); + } + nextop = F8; + SET_ELEMENT_WIDTH(x1, u8, 1); + GETGX_vector(q0, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + v1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VSLIDEDOWN_VI(v0, q0, s8, VECTOR_UNMASKED); + VSLIDEDOWN_VI(v1, q1, s8, VECTOR_UNMASKED); + VWADDU_VX(d0, v0, xZR, VECTOR_UNMASKED); + VWADDU_VX(v0, v1, xZR, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, i32, 1); + if (d2 < 32) + VSLL_VI(v0, v0, d2, VECTOR_UNMASKED); + else + VSLL_VX(v0, v0, x5, VECTOR_UNMASKED); + VOR_VV(q0, d0, v0, VECTOR_UNMASKED); + break; + case 0x6B: + INST_NAME("PACKSSDW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch(dyn); + if (cpuext.vlen >= 32) { + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 2); // double the vl for slideup. + VMV_V_V(d0, q0); + VSLIDEUP_VI(d0, q1, 4, VECTOR_UNMASKED); // splice q0 and q1 here! + } else { + VMV_V_V(d0, q0); + VMV_V_V(d1, q1); + } + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VNCLIP_WI(q0, d0, 0, VECTOR_UNMASKED); + break; + case 0x6C: + INST_NAME("PUNPCKLQDQ Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + // GX->q[0] = GX->q[0]; -> unchanged + // GX->q[1] = EX->q[0]; + GETGX_vector(v0, 1, VECTOR_SEW64); + if (MODREG) { + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + if (v0 == v1) { + // for vslideup.vi, cannot be overlapped + v1 = fpu_get_scratch(dyn); + VMV_V_V(v1, v0); + } + VSLIDEUP_VI(v0, v1, 1, VECTOR_UNMASKED); + } else { + q0 = fpu_get_scratch(dyn); + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + VECTOR_LOAD_VMASK(0b10, x1, 1); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 0); + VLUXEI64_V(v0, q0, ed, VECTOR_MASKED, VECTOR_NFIELD1); + } + break; + case 0x6D: + INST_NAME("PUNPCKHQDQ Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + // GX->q[0] = GX->q[1]; + // GX->q[1] = EX->q[1]; + GETGX_vector(v0, 1, VECTOR_SEW64); + if (MODREG) { + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + q0 = fpu_get_scratch(dyn); + VSLIDE1DOWN_VX(q0, v0, xZR, VECTOR_UNMASKED); + if (cpuext.xtheadvector) { + VECTOR_LOAD_VMASK(0b01, x4, 1); + VMERGE_VVM(v0, v1, q0); // implies VMASK + } else { + if (v0 != v1) { VMV_V_V(v0, v1); } + VMV_X_S(x4, q0); + VMV_S_X(v0, x4); + } + } else { + q0 = fpu_get_scratch(dyn); + VECTOR_LOAD_VMASK(0b10, x1, 1); + VSLIDE1DOWN_VX(v0, v0, xZR, VECTOR_UNMASKED); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 0); + VLE64_V(v0, ed, VECTOR_MASKED, VECTOR_NFIELD1); + } + break; + case 0x6E: + INST_NAME("MOVD Gx, Ed"); + nextop = F8; + GETGX_empty_vector(v0); + GETED(0); + if (rex.w) { + SET_ELEMENT_WIDTH(x3, VECTOR_SEW64, 1); + } else { + SET_ELEMENT_WIDTH(x3, VECTOR_SEW32, 1); + } + VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + VECTOR_LOAD_VMASK(1, x4, 1); + VMERGE_VXM(v0, v0, ed); + break; + case 0x6F: + INST_NAME("MOVDQA Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, dyn->vector_eew); + GETGX_empty_vector(v0); + VMV_V_V(v0, v1); + } else { + GETGX_empty_vector(v0); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 0, 0); + VLE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + } + break; + case 0x70: + INST_NAME("PSHUFD Gx, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEX_vector(q1, 0, 1, VECTOR_SEW64); + GETGX_empty_vector(q0); + v0 = fpu_get_scratch(dyn); + tmp64u0 = F8; + if (cpuext.xtheadvector) { // lack of vrgatherei16.vv + v1 = fpu_get_scratch(dyn); + if (tmp64u0 == 0) { + VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + } else { + tmp64u1 = (((tmp64u0 >> 6) & 3) << 32) | ((tmp64u0 >> 4) & 3); + tmp64u0 = (((tmp64u0 >> 2) & 3) << 32) | (tmp64u0 & 3); + if (tmp64u1 == 0) { + VXOR_VV(v1, v1, v1, VECTOR_UNMASKED); + } else { + MOV64x(x4, tmp64u1); + VMV_S_X(v1, x4); // clears upper bits! + } + if (tmp64u0 == tmp64u1) { + VSLIDE1UP_VX(v0, v1, x4, VECTOR_UNMASKED); + } else if (tmp64u0 == 0) { + VSLIDE1UP_VX(v0, v1, xZR, VECTOR_UNMASKED); + } else { + MOV64x(x4, tmp64u0); + VSLIDE1UP_VX(v0, v1, x4, VECTOR_UNMASKED); + } + } + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (q0 == q1) { + VRGATHER_VV(v1, q1, v0, VECTOR_UNMASKED); + VMV_V_V(q0, v1); + } else { + VRGATHER_VV(q0, q1, v0, VECTOR_UNMASKED); + } + } else { + tmp64u0 = ((tmp64u0 >> 6) << 48) | (((tmp64u0 >> 4) & 3) << 32) | (((tmp64u0 >> 2) & 3) << 16) | (tmp64u0 & 3); + VECTOR_SPLAT_IMM(v0, tmp64u0, x4); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (q0 == q1) { + v1 = fpu_get_scratch(dyn); + VRGATHEREI16_VV(v1, q1, v0, VECTOR_UNMASKED); + VMV_V_V(q0, v1); + } else { + VRGATHEREI16_VV(q0, q1, v0, VECTOR_UNMASKED); + } + } + break; + case 0x71: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("PSRLW Ex, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETEX_vector(q0, 1, 1, VECTOR_SEW16); + u8 = F8; + if (u8) { + if (u8 > 15) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else { + VSRL_VI(q0, q0, u8, VECTOR_UNMASKED); + } + PUTEX_vector(q0, VECTOR_SEW16); + } + break; + case 4: + INST_NAME("PSRAW Ex, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETEX_vector(q0, 1, 1, VECTOR_SEW16); + u8 = F8; + if (u8 > 15) u8 = 15; + if (u8) { + VSRA_VI(q0, q0, u8, VECTOR_UNMASKED); + } + PUTEX_vector(q0, VECTOR_SEW16); + break; + case 6: + INST_NAME("PSLLW Ex, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETEX_vector(q0, 1, 1, VECTOR_SEW16); + u8 = F8; + if (u8) { + if (u8 > 15) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else { + VSLL_VI(q0, q0, u8, VECTOR_UNMASKED); + } + PUTEX_vector(q0, VECTOR_SEW16); + } + break; + default: + DEFAULT_VECTOR; + } + break; + case 0x72: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("PSRLD Ex, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q0, 1, 1, VECTOR_SEW32); + u8 = F8; + if (u8) { + if (u8 > 31) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else if (u8) { + VSRL_VI(q0, q0, u8, VECTOR_UNMASKED); + } + PUTEX_vector(q0, VECTOR_SEW32); + } + break; + case 4: + INST_NAME("PSRAD Ex, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q0, 1, 1, VECTOR_SEW32); + u8 = F8; + if (u8 > 31) u8 = 31; + if (u8) { + VSRA_VI(q0, q0, u8, VECTOR_UNMASKED); + } + PUTEX_vector(q0, VECTOR_SEW32); + break; + case 6: + INST_NAME("PSLLD Ex, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(q0, 1, 1, VECTOR_SEW32); + u8 = F8; + if (u8) { + if (u8 > 31) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else { + VSLL_VI(q0, q0, u8, VECTOR_UNMASKED); + } + PUTEX_vector(q0, VECTOR_SEW32); + } + break; + default: + DEFAULT_VECTOR; + } + break; + case 0x73: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + INST_NAME("PSRLQ Ex, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEX_vector(q0, 1, 1, VECTOR_SEW64); + u8 = F8; + if (u8) { + if (u8 > 63) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else { + MOV64x(x4, u8); + VSRL_VX(q0, q0, x4, VECTOR_UNMASKED); + } + PUTEX_vector(q0, VECTOR_SEW64); + } + break; + case 3: + INST_NAME("PSRLDQ Ex, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q0, 1, 1, VECTOR_SEW8); + u8 = F8; + if (!u8) break; + if (u8 > 15) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else { + d0 = fpu_get_scratch(dyn); + if (cpuext.vlen >= 32) { + // clear high bits before slidedown! + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 2); + VXOR_VV(d0, d0, d0, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 1); + } + VMV_V_V(d0, q0); + VSLIDEDOWN_VI(q0, d0, u8, VECTOR_UNMASKED); + } + PUTEX_vector(q0, VECTOR_SEW8); + break; + case 6: + INST_NAME("PSLLQ Ex, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEX_vector(q0, 1, 1, VECTOR_SEW64); + u8 = F8; + if (u8) { + if (u8 > 63) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + } else { + MOV64x(x4, u8); + VSLL_VX(q0, q0, x4, VECTOR_UNMASKED); + } + PUTEX_vector(q0, VECTOR_SEW64); + } + break; + case 7: + INST_NAME("PSLLDQ Ex, Ib"); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETEX_vector(q0, 1, 1, VECTOR_SEW8); + u8 = F8; + if (!u8) break; + if (u8 > 15) { + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + PUTEX_vector(q0, VECTOR_SEW8); + } else { + d0 = fpu_get_scratch(dyn); + VXOR_VV(d0, d0, d0, VECTOR_UNMASKED); + VSLIDEUP_VI(d0, q0, u8, VECTOR_UNMASKED); + if (MODREG) { + VMV_V_V(q0, d0); + } else { + PUTEX_vector(d0, VECTOR_SEW8); + } + } + break; + default: DEFAULT_VECTOR; + } + break; + case 0x74 ... 0x76: + if (opcode == 0x74) { + INST_NAME("PCMPEQB Gx, Ex"); + u8 = VECTOR_SEW8; + } else if (opcode == 0x75) { + INST_NAME("PCMPEQW Gx, Ex"); + u8 = VECTOR_SEW16; + } else { + INST_NAME("PCMPEQD Gx, Ex"); + u8 = VECTOR_SEW32; + } + nextop = F8; + SET_ELEMENT_WIDTH(x1, u8, 1); + GETGX_vector(q0, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VMSEQ_VV(VMASK, q1, q0, VECTOR_UNMASKED); + VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); + VMERGE_VIM(q0, q0, 0b11111); // implies vmask and widened it + break; + case 0x7C: + INST_NAME("HADDPD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + GETEX_vector(q1, 0, 0, VECTOR_SEW64); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + v1 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); // no more scratches! + VMV_V_V(v0, q0); + if (q1 & 1) VMV_V_V(d1, q1); + VMV_V_I(VMASK, cpuext.xtheadvector ? 1 : 0b0101); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL2, 2); + VSLIDEUP_VI(v0, (q1 & 1) ? d1 : q1, 2, VECTOR_UNMASKED); + VCOMPRESS_VM(d0, v0, VMASK); + VXOR_VI(VMASK, VMASK, 0x1F, VECTOR_UNMASKED); + VCOMPRESS_VM(d1, v0, VMASK); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL1, 1); + if (!BOX64ENV(dynarec_fastnan)) { + VMFEQ_VV(v0, d0, d0, VECTOR_UNMASKED); + VMFEQ_VV(v1, d1, d1, VECTOR_UNMASKED); + VMAND_MM(v0, v0, v1); + } + VFADD_VV(q0, d0, d1, VECTOR_UNMASKED); + if (!BOX64ENV(dynarec_fastnan)) { + VMFEQ_VV(v1, q0, q0, VECTOR_UNMASKED); + VMANDN_MM(VMASK, v0, v1); + VFSGNJN_VV(q0, q0, q0, VECTOR_MASKED); + } + break; + case 0x7E: + return 0; + case 0x7F: + INST_NAME("MOVDQA Ex, Gx"); + nextop = F8; + GETG; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, ed); + v1 = sse_get_reg_vector(dyn, ninst, x1, gd, 0, dyn->vector_eew); + VMV_V_V(v0, v1); + } else { + SMREAD(); + v1 = sse_get_reg_vector(dyn, ninst, x1, gd, 0, dyn->vector_eew); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VSE_V(v1, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + } + break; + case 0xA3 ... 0xC1: return 0; + case 0xC2: + INST_NAME("CMPPD Gx, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(v0, 1, VECTOR_SEW64); + GETEX_vector(v1, 0, 1, VECTOR_SEW64); + u8 = F8; + if ((u8 & 7) == 0) { // Equal + VMFEQ_VV(VMASK, v0, v1, VECTOR_UNMASKED); + } else if ((u8 & 7) == 4) { // Not Equal or unordered + VMFEQ_VV(VMASK, v0, v1, VECTOR_UNMASKED); + VXOR_VI(VMASK, VMASK, 0x1F, VECTOR_UNMASKED); + } else { + d0 = fpu_get_scratch(dyn); + VMFEQ_VV(VMASK, v0, v0, VECTOR_UNMASKED); + VMFEQ_VV(d0, v1, v1, VECTOR_UNMASKED); + VMAND_MM(VMASK, VMASK, d0); + switch (u8 & 7) { + case 1: // Less than + VMFLT_VV(d0, v0, v1, VECTOR_UNMASKED); + VMAND_MM(VMASK, VMASK, d0); + break; + case 2: // Less or equal + VMFLE_VV(d0, v0, v1, VECTOR_UNMASKED); + VMAND_MM(VMASK, VMASK, d0); + break; + case 3: // NaN + VXOR_VI(VMASK, VMASK, 0x1F, VECTOR_UNMASKED); + break; + case 5: // Greater or equal or unordered + VMFLE_VV(d0, v1, v0, VECTOR_UNMASKED); + VMORN_MM(VMASK, d0, VMASK); + break; + case 6: // Greater or unordered, test inverted, N!=V so unordered or less than (inverted) + VMFLT_VV(d0, v1, v0, VECTOR_UNMASKED); + VMORN_MM(VMASK, d0, VMASK); + break; + case 7: // Not NaN + break; + } + } + VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + VXOR_VI(v0, v0, 0x1F, VECTOR_MASKED); + break; + case 0xC4: + INST_NAME("PINSRW Gx, Ed, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + if (MODREG) { + u8 = (F8) & 7; + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 1); + u8 = (F8) & 7; + LHU(x4, ed, fixedaddress); + ed = x4; + } + VECTOR_LOAD_VMASK((1 << u8), x5, 1); + v0 = fpu_get_scratch(dyn); + VMERGE_VXM(v0, q0, ed); // uses VMASK + VMV_V_V(q0, v0); + break; + case 0xC5: + INST_NAME("PEXTRW Gd, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGD; + if (MODREG) { + GETEX_vector(q0, 0, 1, VECTOR_SEW16); + u8 = (F8) & 7; + v0 = fpu_get_scratch(dyn); + VSLIDEDOWN_VI(v0, q0, u8, VECTOR_UNMASKED); + VMV_X_S(gd, v0); + ZEXTH(gd, gd); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 1); + u8 = (F8) & 7; + LHU(gd, ed, u8 * 2); + } + break; + case 0xC6: + INST_NAME("SHUFPD Gx, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(v0, 1, VECTOR_SEW64); + GETEX_vector(v1, 0, 1, VECTOR_SEW64); + u8 = F8; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + if ((u8 >> 1) & 1) { + VSLIDE1DOWN_VX(d1, v1, xZR, VECTOR_UNMASKED); + v1 = d1; + } else if (v0 == v1) { + v1 = fpu_get_scratch(dyn); + VMV_V_V(v1, v0); + } + if (u8 & 1) { + if (cpuext.xtheadvector) { + ADDI(x5, xZR, 1); + VEXT_X_V(x4, v0, x5); + } else { + VSLIDE1DOWN_VX(d0, v0, xZR, VECTOR_UNMASKED); + VMV_X_S(x4, d0); + } + } else { + d0 = v0; + VMV_X_S(x4, d0); + } + VSLIDE1UP_VX(v0, v1, x4, VECTOR_UNMASKED); + break; + case 0xD1: + case 0xD2: + case 0xD3: + if (opcode == 0xD1) { + INST_NAME("PSRLW Gx, Ex"); + u8 = VECTOR_SEW16; + i32 = 16; + } else if (opcode == 0xD2) { + INST_NAME("PSRLD Gx, Ex"); + u8 = VECTOR_SEW32; + i32 = 32; + } else { + INST_NAME("PSRLQ Gx, Ex"); + u8 = VECTOR_SEW64; + i32 = 64; + } + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + if (MODREG) { + q1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + VMV_X_S(x4, q1); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 0, 0); + LD(x4, wback, fixedaddress); + } + SET_ELEMENT_WIDTH(x1, u8, 1); + SLTIU(x3, x4, i32); + SUB(x3, xZR, x3); + VSRL_VX(q0, q0, x4, VECTOR_UNMASKED); + VAND_VX(q0, q0, x3, VECTOR_UNMASKED); + break; + case 0xD4: + INST_NAME("PADDQ Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + GETEX_vector(q1, 0, 0, VECTOR_SEW64); + VADD_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0xD5: + INST_NAME("PMULLW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + VMUL_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0xD6: + INST_NAME("MOVQ Ex, Gx"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + if (MODREG) { + q1 = sse_get_reg_empty_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3)); + VMV_X_S(x4, q0); + if (!cpuext.xtheadvector) { + VXOR_VV(q1, q1, q1, VECTOR_UNMASKED); + } + VMV_S_X(q1, x4); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 1, 0); + VMV_X_S(x4, q0); + SD(x4, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0xD7: + INST_NAME("PMOVMSKB Gd, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGD; + GETEX_vector(q0, 0, 0, VECTOR_SEW8); + if (cpuext.xtheadvector) { + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL8); + VSRL_VI(v0, q0, 7, VECTOR_UNMASKED); + // Force the element width to 1bit + vector_vsetvli(dyn, ninst, x4, VECTOR_SEW8, VECTOR_LMUL8, 1); + VMSNE_VX(VMASK, v0, xZR, VECTOR_UNMASKED); + } else { + VMSLT_VX(VMASK, q0, xZR, VECTOR_UNMASKED); + } + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VMV_X_S(gd, VMASK); + if (!cpuext.xtheadvector) { ZEXTH(gd, gd); } + break; + case 0xD8: + case 0xD9: + if (opcode == 0xD8) { + INST_NAME("PSUBUSB Gx, Ex"); + u8 = VECTOR_SEW8; + } else { + INST_NAME("PSUBUSW Gx, Ex"); + u8 = VECTOR_SEW16; + } + nextop = F8; + SET_ELEMENT_WIDTH(x1, u8, 1); + GETGX_vector(q0, 1, u8); + GETEX_vector(q1, 0, 0, u8); + VSSUBU_VV(q0, q0, q1, VECTOR_UNMASKED); + break; + case 0xDA: + INST_NAME("PMINUB Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGX_vector(q0, 1, VECTOR_SEW8); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + VMINU_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0xDB: + INST_NAME("PAND Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETGX_vector(q0, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VAND_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0xDC: + case 0xDD: + if (opcode == 0xDC) { + INST_NAME("PADDUSB Gx, Ex"); + u8 = VECTOR_SEW8; + } else { + INST_NAME("PADDUSW Gx, Ex"); + u8 = VECTOR_SEW16; + } + nextop = F8; + SET_ELEMENT_WIDTH(x1, u8, 1); + GETGX_vector(q0, 1, u8); + GETEX_vector(q1, 0, 0, u8); + VSADDU_VV(q0, q0, q1, VECTOR_UNMASKED); + break; + case 0xDE: + INST_NAME("PMAXUB Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGX_vector(q0, 1, VECTOR_SEW8); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + VMAXU_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0xDF: + INST_NAME("PANDN Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETGX_vector(q0, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VXOR_VI(q0, q0, 0x1F, VECTOR_UNMASKED); + VAND_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0xE0: + INST_NAME("PAVGB Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGX_vector(q0, 1, VECTOR_SEW8); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + if (cpuext.xtheadvector) { // lack of vaddu.vv + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VWADDU_VV(v0, q0, q1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL2, 2); + VADD_VI(v0, v0, 1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 1); + VNSRL_WI(q0, v0, 1, VECTOR_UNMASKED); + } else { + CSRRWI(xZR, 0b00 /* rnu */, 0x00A /* vxrm */); + VAADDU_VV(q0, q0, q1, VECTOR_UNMASKED); + } + break; + case 0xE1: + INST_NAME("PSRAW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + VECTOR_LOAD_VMASK(1, x1, 1); + if (MODREG) { + q1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 0); + q1 = fpu_get_scratch(dyn); + VLE_V(q1, ed, VECTOR_SEW64, VECTOR_MASKED, VECTOR_NFIELD1); + } + v1 = fpu_get_scratch(dyn); + ADDI(x4, xZR, 15); + VMINU_VX(v1, q1, x4, VECTOR_MASKED); + VMV_X_S(x4, v1); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VSRA_VX(q0, q0, x4, VECTOR_UNMASKED); + break; + case 0xE2: + INST_NAME("PSRAD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + VECTOR_LOAD_VMASK(1, x1, 1); + if (MODREG) { + q1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, 0); + q1 = fpu_get_scratch(dyn); + VLE_V(q1, ed, VECTOR_SEW64, VECTOR_MASKED, VECTOR_NFIELD1); + } + v1 = fpu_get_scratch(dyn); + ADDI(x4, xZR, 31); + VMINU_VX(v1, q1, x4, VECTOR_MASKED); + VMV_X_S(x4, v1); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + VSRA_VX(q0, q0, x4, VECTOR_UNMASKED); + break; + case 0xE3: + INST_NAME("PAVGW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + if (cpuext.xtheadvector) { // lack of vaddu.vv + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VWADDU_VV(v0, q0, q1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL2, 2); + VADD_VI(v0, v0, 1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 1); + VNSRL_WI(q0, v0, 1, VECTOR_UNMASKED); + } else { + CSRRWI(xZR, 0b00 /* rnu */, 0x00A /* vxrm */); + VAADDU_VV(q0, q0, q1, VECTOR_UNMASKED); + } + break; + case 0xE4: + INST_NAME("PMULHUW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + VMULHU_VV(q0, q0, q1, VECTOR_UNMASKED); + break; + case 0xE5: + INST_NAME("PMULHW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + VMULH_VV(q0, q0, q1, VECTOR_UNMASKED); + break; + case 0xE6: + if (!BOX64ENV(dynarec_fastround)) return 0; + INST_NAME("CVTTPD2DQ Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(v1, 0, 0, VECTOR_SEW32); + GETGX_empty_vector(v0); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(d0, v1); + if (cpuext.xtheadvector) { + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 0.5); + ADDI(x4, xZR, 1); // RTZ + FSRM(x4, x4); + VFNCVT_X_F_W(v0, d0, VECTOR_UNMASKED); + FSRM(xZR, x4); + } else { + VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 0.5); + VFNCVT_RTZ_X_F_W(v0, d0, VECTOR_UNMASKED); + } + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 1); + break; + case 0xE7: + INST_NAME("MOVNTDQ Ex, Gx"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETGX_vector(v0, 0, dyn->vector_eew); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_empty_vector(dyn, ninst, x1, ed); + VMV_V_V(v1, v0); + } else { + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VSE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + SMWRITE2(); + } + break; + case 0xE8: + INST_NAME("PSUBSB Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGX_vector(q0, 1, VECTOR_SEW8); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + VSSUB_VV(q0, q0, q1, VECTOR_UNMASKED); + break; + case 0xE9: + INST_NAME("PSUBSW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + VSSUB_VV(q0, q0, q1, VECTOR_UNMASKED); + break; + case 0xEA: + INST_NAME("PMINSW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + VMIN_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0xEB: + INST_NAME("POR Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETGX_vector(q0, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VOR_VV(q0, q1, q0, VECTOR_UNMASKED); + break; + case 0xEC: + INST_NAME("PADDSB Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGX_vector(q0, 1, VECTOR_SEW8); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + VSADD_VV(q0, q0, q1, VECTOR_UNMASKED); + break; + case 0xED: + INST_NAME("PADDSW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + VSADD_VV(q0, q0, q1, VECTOR_UNMASKED); + break; + case 0xEE: + INST_NAME("PMAXSW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(q0, 1, VECTOR_SEW16); + GETEX_vector(q1, 0, 0, VECTOR_SEW16); + VMAX_VV(q0, q1, q0, VECTOR_UNMASKED); + break; case 0xEF: INST_NAME("PXOR Gx, Ex"); nextop = F8; - // FIXME: we should try to minimize vsetvl usage as it may hurts performance a lot. - vector_vsetvl_emul1(dyn, ninst, x1, VECTOR_SEW8); - GETG; if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); // special case q0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); VXOR_VV(q0, q0, q0, VECTOR_UNMASKED); } else { - q0 = sse_get_reg_vector(dyn, ninst, x1, gd, 1); - GETEX_vector(q1, 0, 0); - VXOR_VV(q0, q0, q1, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + q0 = sse_get_reg_vector(dyn, ninst, x1, gd, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VXOR_VV(q0, q1, q0, VECTOR_UNMASKED); + } + break; + case 0xF1: + case 0xF2: + case 0xF3: + if (opcode == 0xF1) { + INST_NAME("PSLLW Gx, Ex"); + u8 = VECTOR_SEW16; + i32 = 16; + } else if (opcode == 0xF2) { + INST_NAME("PSLLD Gx, Ex"); + u8 = VECTOR_SEW32; + i32 = 32; + } else { + INST_NAME("PSLLQ Gx, Ex"); + u8 = VECTOR_SEW64; + i32 = 64; + } + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(q0, 1, VECTOR_SEW64); + if (MODREG) { + q1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + VMV_X_S(x4, q1); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 0, 0); + LD(x4, wback, fixedaddress); } + SET_ELEMENT_WIDTH(x1, u8, 1); + SLTIU(x3, x4, i32); + SUB(x3, xZR, x3); + VSLL_VX(q0, q0, x4, VECTOR_UNMASKED); + VAND_VX(q0, q0, x3, VECTOR_UNMASKED); + break; + case 0xF4: + INST_NAME("PMULUDQ Gx, Ex"); + nextop = F8; + if (cpuext.vlen >= 32) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETGX_vector(v0, 1, VECTOR_SEW64); + GETEX_vector(v1, 0, 0, VECTOR_SEW64); + d1 = fpu_get_scratch(dyn); + ADDI(x2, xZR, 32); + VSLL_VX(v0, v0, x2, VECTOR_UNMASKED); + VSRL_VX(v0, v0, x2, VECTOR_UNMASKED); + VSLL_VX(d1, v1, x2, VECTOR_UNMASKED); + VSRL_VX(d1, d1, x2, VECTOR_UNMASKED); + VMUL_VV(v0, v0, d1, VECTOR_UNMASKED); + } else { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(v0, 1, VECTOR_SEW32); + GETEX_vector(v1, 0, 0, VECTOR_SEW32); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch(dyn); + VWMULU_VV(d0, v0, v1, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + VSLIDEUP_VI(d0, d1, 1, VECTOR_UNMASKED); + VMV_V_V(v0, d0); + } + break; + case 0xF5: + INST_NAME("PMADDWD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETGX_vector(v0, 1, VECTOR_SEW16); + GETEX_vector(v1, 0, 0, VECTOR_SEW16); + q1 = fpu_get_scratch(dyn); + q0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + ADDI(x3, xZR, 32); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + VWMUL_VV(q0, v1, v0, VECTOR_UNMASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + VNSRL_WX(q1, q0, x3, VECTOR_UNMASKED); + VNSRL_WI(v0, q0, 0, VECTOR_UNMASKED); + VADD_VV(v0, v0, q1, VECTOR_UNMASKED); + break; + case 0xF6: + INST_NAME("PSADBW Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); + GETGX_vector(q0, 1, VECTOR_SEW8); + GETEX_vector(q1, 0, 0, VECTOR_SEW8); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + v1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); // no more scratches! + VWSUBU_VV(v0, q0, q1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL2, 2); + VSRA_VI(v1, v0, 15, VECTOR_UNMASKED); + VXOR_VV(v0, v1, v0, VECTOR_UNMASKED); + VSUB_VV(v1, v0, v1, VECTOR_UNMASKED); + VECTOR_LOAD_VMASK(0xFF, x4, 2); + VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + VREDSUM_VS(v0, v1, v0, VECTOR_MASKED); // sum low 64 + VSLIDEDOWN_VI(d0, v1, 8, VECTOR_UNMASKED); + VXOR_VV(v1, v1, v1, VECTOR_UNMASKED); + VREDSUM_VS(v1, d0, v1, VECTOR_MASKED); // sum high 64 + VSLIDEUP_VI(v0, v1, 4, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW8, VECTOR_LMUL1, 1); + VMV_V_V(q0, v0); + break; + case 0xF8 ... 0xFB: + if (opcode == 0xF8) { + INST_NAME("PSUBB Gx, Ex"); + u8 = VECTOR_SEW8; + } else if (opcode == 0xF9) { + INST_NAME("PSUBW Gx, Ex"); + u8 = VECTOR_SEW16; + } else if (opcode == 0xFA) { + INST_NAME("PSUBD Gx, Ex"); + u8 = VECTOR_SEW32; + } else { + INST_NAME("PSUBQ Gx, Ex"); + u8 = VECTOR_SEW64; + } + nextop = F8; + SET_ELEMENT_WIDTH(x1, u8, 1); + GETGX_vector(q0, 1, u8); + GETEX_vector(q1, 0, 0, u8); + VSUB_VV(q0, q0, q1, VECTOR_UNMASKED); + break; + case 0xFC ... 0xFE: + nextop = F8; + if (opcode == 0xFC) { + INST_NAME("PADDB Gx, Ex"); + u8 = VECTOR_SEW8; + } else if (opcode == 0xFD) { + INST_NAME("PADDW Gx, Ex"); + u8 = VECTOR_SEW16; + } else { + INST_NAME("PADDD Gx, Ex"); + u8 = VECTOR_SEW32; + } + SET_ELEMENT_WIDTH(x1, u8, 1); + GETGX_vector(q0, 1, dyn->vector_eew); + GETEX_vector(q1, 0, 0, dyn->vector_eew); + VADD_VV(q0, q1, q0, VECTOR_UNMASKED); break; default: - // fallback to the scalar version - return 0; + DEFAULT_VECTOR; } + return addr; } diff --git a/src/dynarec/rv64/dynarec_rv64_6664.c b/src/dynarec/rv64/dynarec_rv64_6664.c deleted file mode 100644 index 3acac90..0000000 --- a/src/dynarec/rv64/dynarec_rv64_6664.c +++ /dev/null @@ -1,105 +0,0 @@ -#include -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" - -#include "rv64_printer.h" -#include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" -#include "dynarec_rv64_functions.h" - -uintptr_t dynarec64_6664(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int seg, int* ok, int* need_epilog) -{ - (void)ip; (void)need_epilog; - - uint8_t opcode = F8; - uint8_t nextop; - uint8_t gd, ed; - int64_t j64; - int v0, v1; - int64_t fixedaddress; - int unscaled; - MAYUSE(j64); - - GETREX(); - - switch(opcode) { - case 0x89: - INST_NAME("MOV FS:Ew, Gw"); - nextop = F8; - GETGD; // don't need GETGW here - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - if(rex.w) { - ADDI(ed, gd, 0); - } else { - if(ed!=gd) { - LUI(x1, 0xffff0); - AND(gd, gd, x1); - ZEXTH(x1, ed); - OR(gd, gd, x1); - } - } - } else { - grab_segdata(dyn, addr, ninst, x4, seg); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - ADD(x4, ed, x4); - if(rex.w) { - SD(gd, x4, fixedaddress); - } else { - SH(gd, x4, fixedaddress); - } - SMWRITE(); - } - break; - - case 0x8B: - INST_NAME("MOV Gd, FS:Ed"); - nextop=F8; - GETGD; - if(MODREG) { // reg <= reg - ed = xRAX+(nextop&7)+(rex.b<<3); - if(rex.w) { - MV(gd, ed); - } else { - if(ed!=gd) { - LUI(x1, 0xffff0); - AND(gd, gd, x1); - ZEXTH(x1, ed); - OR(gd, gd, x1); - } - } - } else { // mem <= reg - grab_segdata(dyn, addr, ninst, x4, seg); - SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - ADD(x4, ed, x4); - if(rex.w) { - LD(gd, x4, fixedaddress); - } else { - LHU(x1, x4, fixedaddress); - SRLI(gd, gd, 16); - SLLI(gd, gd, 16); - OR(gd, gd, x1); - } - } - break; - - default: - DEFAULT; - } - return addr; -} diff --git a/src/dynarec/rv64/dynarec_rv64_66f0.c b/src/dynarec/rv64/dynarec_rv64_66f0.c index 4317171..a01f062 100644 --- a/src/dynarec/rv64/dynarec_rv64_66f0.c +++ b/src/dynarec/rv64/dynarec_rv64_66f0.c @@ -5,11 +5,9 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "rv64_emitter.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,13 +17,14 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_rv64_functions.h" -uintptr_t dynarec64_66F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_66F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; + (void)need_epilog; uint8_t opcode = F8; uint8_t nextop; @@ -42,103 +41,80 @@ uintptr_t dynarec64_66F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int MAYUSE(wb2); MAYUSE(j64); - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } + switch (opcode) { + case 0x0F: + opcode = F8; + switch (opcode) { + case 0xB1: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK CMPXCHG Ew, Gw"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; + ZEXTH(x6, xRAX); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, LOCK_LOCK, 0, 0); + ANDI(x5, wback, 0b10); + BNEZ_MARK2(x5); - GETREX(); + // lower 16 bits + MARKLOCK; + LR_W(x2, wback, 1, 1); + ZEXTH(x1, x2); + BNE_MARK(x6, x1); + INSH(x2, gd, x5, x4, 1, 1); + SC_W(x5, x2, wback, 1, 1); + BNEZ_MARKLOCK(x5); + B_MARK_nocond; - switch(opcode) { - case 0x11: - INST_NAME("LOCK ADC Ew, Gw"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGW(x1); - SMDMB(); - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV32w(x6, 0xFFFF); - AND(x2, ed, x6); - emit_adc16(dyn, ninst, x1, x2, x3, x4, x5); - if (rv64_zbb) { - ANDN(ed, ed, x6); - } else { - NOT(x6, x6); - AND(ed, ed, x6); - } - OR(ed, ed, x2); - } else { - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, LOCK_LOCK, 0, 0); - ANDI(x3, wback, 0b10); - MOV32w(x4, 0xffff); // x4 = mask - BNEZ_MARK(x3); - // lower 16bits - MARKLOCK; - LR_W(x5, wback, 1, 1); - AND(x6, x5, x4); // x6 = Ed.h[0] - SRLIW(x5, x5, 16); - SLLIW(x5, x5, 16); // x5 = clear Ed.h[0] - ADDW(x2, x1, x6); // x2 = Gw + Ew - ANDI(x9, xFlags, 1 << F_CF); - ADDW(x2, x2, x9); // x2 = adc - AND(x2, x2, x4); - OR(x5, x5, x2); - SC_W(x2, x5, wback, 1, 1); - BNEZ_MARKLOCK(x2); - B_MARK3_nocond; - MARK; - // upper 16bits - SLLIW(x3, x4, 16); // x3 = mask - SUBI(wback, wback, 2); // aligning address - SLLI(x1, x1, 16); // x1 = extended Gw - MARK2; - LR_W(x6, wback, 1, 1); // x6 = Ed - AND(x5, x6, x3); // x5 = Ed.h[1] << 16 - ADDW(x5,x5, x1); - ANDI(x9, xFlags, 1 << F_CF); - SLLIW(x9, x9, 16); - ADDW(x5, x5, x9); // x5 = adc << 16 - AND(x9, x6, x4); // x9 = Ed.h[0] - OR(x5, x5, x9); - SC_W(x9, x5, wback, 1, 1); - BNEZ_MARK2(x9); - IFX(X_ALL|X_PEND) { - SRLIW(x6, x6, 16); - SRLIW(x1, x1, 16); - } - MARK3; - IFX(X_ALL|X_PEND) { - emit_adc16(dyn, ninst, x1, x6, x3, x4, x5); - } + MARK2; + // upper 16 bits + XORI(wback, wback, 0b10); + MARKLOCK2; + LR_W(x2, wback, 1, 1); + SRLIW(x1, x2, 16); + BNE_MARK(x6, x1); + SLLIW(x2, x2, 16); + SRLIW(x2, x2, 16); + SLLIW(x5, gd, 16); + OR(x2, x2, x5); + SC_W(x5, x2, wback, 1, 1); + BNEZ_MARKLOCK2(x5); + } + MARK; + UFLAG_IF { emit_cmp16(dyn, ninst, x6, x1, x2, x3, x4, x5); } + INSH(xRAX, x1, x2, x3, 1, 0); + break; + default: + DEFAULT; } - SMDMB(); break; case 0x81: case 0x83: nextop = F8; - SMDMB(); - switch((nextop>>3)&7) { - case 0: //ADD - if(opcode==0x81) { - INST_NAME("LOCK ADD Ew, Iw"); - } else { - INST_NAME("LOCK ADD Ew, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); - if(MODREG) { - if(opcode==0x81) u64 = F16; else u64 = (uint16_t)(int16_t)F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - MOV64x(x5, u64); - ZEXTH(x6, ed); - emit_add16(dyn, ninst, x6, x5, x3, x4, x2); - SRLI(ed, ed, 16); - SLLI(ed, ed, 16); - OR(ed, ed, x6); + switch ((nextop >> 3) & 7) { + case 0: // ADD + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode==0x81)?2:1); - if(opcode==0x81) u64 = F16; else u64 = (uint16_t)(int16_t)F8S; + if (opcode == 0x81) { + INST_NAME("LOCK ADD Ew, Iw"); + } else { + INST_NAME("LOCK ADD Ew, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; MOV64x(x5, u64); ANDI(x3, wback, 0b10); @@ -155,7 +131,7 @@ uintptr_t dynarec64_66F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int OR(x4, x4, x3); SC_W(x3, x4, wback, 1, 1); BNEZ_MARKLOCK(x3); - IFX(X_ALL|X_PEND) { + IFXORNAT (X_ALL | X_PEND) { SLLIW(x1, x1, 16); SRLIW(x1, x1, 16); } @@ -177,15 +153,132 @@ uintptr_t dynarec64_66F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int MARK3; // final - IFX(X_ALL|X_PEND) { + IFXORNAT (X_ALL | X_PEND) { emit_add16(dyn, ninst, x1, x5, x3, x4, x6); } } break; + case 1: // OR + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + if (opcode == 0x81) { + INST_NAME("LOCK OR Ew, Iw"); + } else { + INST_NAME("LOCK OR Ew, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; + MOV64x(x5, u64); + + ANDI(x3, wback, 0b10); + BNEZ_MARK(x3); + + // lower 16 bits + MARKLOCK; + LR_W(x1, wback, 1, 1); + SRLIW(x3, x1, 16); + SLLIW(x3, x3, 16); + OR(x4, x1, x5); + OR(x4, x4, x3); + SC_W(x3, x4, wback, 1, 1); + BNEZ_MARKLOCK(x3); + IFXORNAT (X_ALL | X_PEND) { + SLLIW(x1, x1, 16); + SRLIW(x1, x1, 16); + } + B_MARK3_nocond; + + MARK; + // upper 16 bits + XORI(wback, wback, 0b10); + MARK2; + LR_W(x1, wback, 1, 1); + SLLIW(x3, x1, 16); + SRLIW(x3, x3, 16); + SRLIW(x1, x1, 16); + OR(x4, x1, x5); + SLLIW(x4, x4, 16); + OR(x4, x4, x3); + SC_W(x3, x4, wback, 1, 1); + BNEZ_MARK2(x3); + + MARK3; + // final + IFXORNAT (X_ALL | X_PEND) { + emit_or16(dyn, ninst, x1, x5, x3, x4); + } + } + break; + case 4: // AND + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + if (opcode == 0x81) { + INST_NAME("LOCK AND Ew, Iw"); + } else { + INST_NAME("LOCK AND Ew, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 2 : 1); + if (opcode == 0x81) + u64 = F16; + else + u64 = (uint16_t)(int16_t)F8S; + MOV64x(x5, u64); + + ANDI(x3, wback, 0b10); + BNEZ_MARK(x3); + + // lower 16 bits + MARKLOCK; + LR_W(x1, wback, 1, 1); + SRLIW(x3, x1, 16); + SLLIW(x3, x3, 16); + AND(x4, x1, x5); + OR(x4, x4, x3); + SC_W(x3, x4, wback, 1, 1); + BNEZ_MARKLOCK(x3); + IFXORNAT (X_ALL | X_PEND) { + SLLIW(x1, x1, 16); + SRLIW(x1, x1, 16); + } + B_MARK3_nocond; + + MARK; + // upper 16 bits + XORI(wback, wback, 0b10); + MARK2; + LR_W(x1, wback, 1, 1); + SLLIW(x3, x1, 16); + SRLIW(x3, x3, 16); + SRLIW(x1, x1, 16); + AND(x4, x1, x5); + SLLIW(x4, x4, 16); + OR(x4, x4, x3); + SC_W(x3, x4, wback, 1, 1); + BNEZ_MARK2(x3); + + MARK3; + // final + IFXORNAT (X_ALL | X_PEND) { + emit_and16(dyn, ninst, x1, x5, x3, x4); + } + } + break; default: DEFAULT; } - SMDMB(); break; default: diff --git a/src/dynarec/rv64/dynarec_rv64_66f20f.c b/src/dynarec/rv64/dynarec_rv64_66f20f.c index 949270b..bc78eec 100644 --- a/src/dynarec/rv64/dynarec_rv64_66f20f.c +++ b/src/dynarec/rv64/dynarec_rv64_66f20f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,7 +17,7 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_66F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { @@ -51,24 +49,25 @@ uintptr_t dynarec64_66F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, in static const int8_t round_round[] = { RD_RNE, RD_RDN, RD_RUP, RD_RTZ }; switch (opcode) { - case 0x38: // these are some more SSSE4.2+ opcodes + case 0x38: // these are some more SSSE4.2+ opcodes opcode = F8; - switch(opcode) { - case 0xF1: // CRC32 Gd, Ew + switch (opcode) { + case 0xF1: + if (rex.w) return dynarec64_F20F(dyn, addr - 2, ip, ninst, rex, ok, need_epilog); INST_NAME("CRC32 Gd, Ew"); nextop = F8; GETGD; GETEW(x1, 0); MOV32w(x2, 0x82f63b78); - for(int j=0; j<2; ++j) { - SRLI(x5, ed, 8*j); - ANDI(x3, x5, 0xFF); - XOR(gd, gd, x3); + for (int j = 0; j < 2; ++j) { + SRLI(x5, ed, 8 * j); + ANDI(x6, x5, 0xFF); + XOR(gd, gd, x6); for (int i = 0; i < 8; i++) { - SRLI((i&1)?gd:x4, (i&1)?x4:gd, 1); - ANDI(x6, (i&1)?x4:gd, 1); - BEQZ(x6, 4+4); - XOR((i&1)?gd:x4, (i&1)?gd:x4, x2); + SRLI((i & 1) ? gd : x4, (i & 1) ? x4 : gd, 1); + ANDI(x6, (i & 1) ? x4 : gd, 1); + BEQZ(x6, 4 + 4); + XOR((i & 1) ? gd : x4, (i & 1) ? gd : x4, x2); } } break; diff --git a/src/dynarec/rv64/dynarec_rv64_66f30f.c b/src/dynarec/rv64/dynarec_rv64_66f30f.c index 50b4e4a..0677a3d 100644 --- a/src/dynarec/rv64/dynarec_rv64_66f30f.c +++ b/src/dynarec/rv64/dynarec_rv64_66f30f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,7 +17,7 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_66F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { diff --git a/src/dynarec/rv64/dynarec_rv64_67.c b/src/dynarec/rv64/dynarec_rv64_67.c deleted file mode 100644 index f1dd054..0000000 --- a/src/dynarec/rv64/dynarec_rv64_67.c +++ /dev/null @@ -1,788 +0,0 @@ -#include -#include -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" - -#include "rv64_printer.h" -#include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" -#include "dynarec_rv64_functions.h" - -uintptr_t dynarec64_67(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) -{ - (void)ip; (void)need_epilog; - - uint8_t opcode = F8; - uint8_t nextop; - uint8_t gd, ed, wback, wb, wb1, wb2, gb1, gb2, eb1, eb2; - int64_t fixedaddress; - int unscaled; - int8_t i8; - uint8_t u8; - int32_t i32; - int64_t j64, i64; - int cacheupd = 0; - int lock; - int v0, v1, s0; - MAYUSE(i32); - MAYUSE(j64); - MAYUSE(v0); - MAYUSE(v1); - MAYUSE(s0); - MAYUSE(lock); - MAYUSE(cacheupd); - - if(rex.is32bits) { - // should do a different file - DEFAULT; - return addr; - } - - GETREX(); - - rep = 0; - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - switch(opcode) { - - case 0x01: - INST_NAME("ADD Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_add32(dyn, ninst, rex, ed, gd, x3, x4, x5); - WBACK; - break; - case 0x02: - INST_NAME("ADD Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_add8(dyn, ninst, x1, x2, x3, x4); - GBBACK(x4); - break; - case 0x03: - INST_NAME("ADD Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_add32(dyn, ninst, rex, gd, ed, x3, x4, x5); - break; - - case 0x05: - INST_NAME("ADD EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - emit_add32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5, x6); - break; - - case 0x09: - INST_NAME("OR Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_or32(dyn, ninst, rex, ed, gd, x3, x4); - WBACK; - break; - case 0x0A: - INST_NAME("OR Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_or8(dyn, ninst, x1, x2, x3, x4); - GBBACK(x4); - break; - case 0x0B: - INST_NAME("OR Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_or32(dyn, ninst, rex, gd, ed, x3, x4); - break; - - case 0x0D: - INST_NAME("OR EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - emit_or32c(dyn, ninst, rex, xRAX, i64, x3, x4); - break; - - case 0x0F: - opcode=F8; - switch(opcode) { - case 0x2E: - // no special check... - case 0x2F: - switch (rep) { - case 0: - if(opcode==0x2F) {INST_NAME("COMISS Gx, Ex");} else {INST_NAME("UCOMISS Gx, Ex");} - SETFLAGS(X_ALL, SF_SET); - nextop = F8; - GETGXSS(s0); - if(MODREG) { - v0 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 1); - } else { - v0 = fpu_get_scratch(dyn); - SMREAD(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); - FLW(v0, ed, fixedaddress); - } - CLEAR_FLAGS(); - // if isnan(s0) || isnan(v0) - IFX(X_ZF | X_PF | X_CF) { - FEQS(x3, s0, s0); - FEQS(x2, v0, v0); - AND(x2, x2, x3); - BNE_MARK(x2, xZR); - ORI(xFlags, xFlags, (1<> 2; // L or H - } - if (eb2) { - SRLI(gd, eb1, 8); - ANDI(gd, gd, 0xff); - } else { - ANDI(gd, eb1, 0xff); - } - } else { - SMREAD(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); - LBU(gd, ed, fixedaddress); - } - break; - case 0xB7: - INST_NAME("MOVZX Gd, Ew"); - nextop = F8; - GETGD; - if(MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); - ZEXTH(gd, ed); - } else { - SMREAD(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); - LHU(gd, ed, fixedaddress); - } - break; - default: - DEFAULT; - } - break; - - case 0x11: - INST_NAME("ADC Ed, Gd"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_adc32(dyn, ninst, rex, ed, gd, x3, x4, x5, x6); - WBACK; - break; - - case 0x13: - INST_NAME("ADC Gd, Ed"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_adc32(dyn, ninst, rex, gd, ed, x3, x4, x5, x6); - break; - - case 0x15: - INST_NAME("ADC EAX, Id"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - MOV64xw(x1, i64); - emit_adc32(dyn, ninst, rex, xRAX, x1, x3, x4, x5, x6); - break; - - case 0x19: - INST_NAME("SBB Ed, Gd"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_sbb32(dyn, ninst, rex, ed, gd, x3, x4, x5); - WBACK; - break; - case 0x1A: - INST_NAME("SBB Gb, Eb"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_sbb8(dyn, ninst, x1, x2, x3, x4, x5); - GBBACK(x4); - break; - case 0x1B: - INST_NAME("SBB Gd, Ed"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_sbb32(dyn, ninst, rex, gd, ed, x3, x4, x5); - break; - - case 0x1D: - INST_NAME("SBB EAX, Id"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - MOV64xw(x2, i64); - emit_sbb32(dyn, ninst, rex, xRAX, x2, x3, x4, x5); - break; - - case 0x21: - INST_NAME("AND Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_and32(dyn, ninst, rex, ed, gd, x3, x4); - WBACK; - break; - case 0x22: - INST_NAME("AND Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_and8(dyn, ninst, x1, x2, x3, x4); - GBBACK(x4); - break; - case 0x23: - INST_NAME("AND Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_and32(dyn, ninst, rex, gd, ed, x3, x4); - break; - - case 0x25: - INST_NAME("AND EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - emit_and32c(dyn, ninst, rex, xRAX, i64, x3, x4); - break; - - case 0x29: - INST_NAME("SUB Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_sub32(dyn, ninst, rex, ed, gd, x3, x4, x5); - WBACK; - break; - case 0x2A: - INST_NAME("SUB Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_sub8(dyn, ninst, x1, x2, x3, x4, x5); - GBBACK(x5); - break; - case 0x2B: - INST_NAME("SUB Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_sub32(dyn, ninst, rex, gd, ed, x3, x4, x5); - break; - - case 0x2D: - INST_NAME("SUB EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - emit_sub32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5, x6); - break; - - case 0x31: - INST_NAME("XOR Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_xor32(dyn, ninst, rex, ed, gd, x3, x4); - WBACK; - break; - case 0x32: - INST_NAME("XOR Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_xor8(dyn, ninst, x1, x2, x3, x4); - GBBACK(x4); - break; - case 0x33: - INST_NAME("XOR Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_xor32(dyn, ninst, rex, gd, ed, x3, x4); - break; - - case 0x35: - INST_NAME("XOR EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - emit_xor32c(dyn, ninst, rex, xRAX, i64, x3, x4); - break; - - case 0x38: - INST_NAME("CMP Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x1, 0); - GETGB(x2); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6); - break; - case 0x39: - INST_NAME("CMP Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_cmp32(dyn, ninst, rex, ed, gd, x3, x4, x5, x6); - break; - case 0x3A: - INST_NAME("CMP Gb, Eb"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETEB32(x2, 0); - GETGB(x1); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6); - break; - case 0x3B: - INST_NAME("CMP Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); - nextop = F8; - GETGD; - GETED32(0); - emit_cmp32(dyn, ninst, rex, gd, ed, x3, x4, x5, x6); - break; - case 0x3C: - INST_NAME("CMP AL, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - u8 = F8; - ANDI(x1, xRAX, 0xff); - if(u8) { - MOV32w(x2, u8); - emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5, x6); - } else { - emit_cmp8_0(dyn, ninst, x1, x3, x4); - } - break; - case 0x3D: - INST_NAME("CMP EAX, Id"); - SETFLAGS(X_ALL, SF_SET_PENDING); - i64 = F32S; - if(i64) { - MOV64xw(x2, i64); - emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5, x6); - } else - emit_cmp32_0(dyn, ninst, rex, xRAX, x3, x4); - break; - case 0x63: - INST_NAME("MOVSXD Gd, Ed"); - nextop = F8; - GETGD; - if (rex.w) { - if (MODREG) { // reg <= reg - ADDIW(gd, xRAX + (nextop & 7) + (rex.b << 3), 0); - } else { // mem <= reg - SMREAD(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); - LW(gd, ed, fixedaddress); - } - } else { - if (MODREG) { // reg <= reg - AND(gd, xRAX + (nextop & 7) + (rex.b << 3), xMASK); - } else { // mem <= reg - SMREAD(); - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); - LWU(gd, ed, fixedaddress); - } - } - break; - case 0x66: - opcode = F8; - switch (opcode) { - case 0x89: - INST_NAME("MOV Ew, Gw"); - nextop = F8; - GETGD; // don't need GETGW here - if (MODREG) { - ed = xRAX + (nextop & 7) + (rex.b << 3); - if (ed != gd) { - LUI(x1, 0xffff0); - AND(ed, ed, x1); - ZEXTH(x2, gd); - OR(ed, ed, x2); - } - } else { - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); - SH(gd, ed, fixedaddress); - SMWRITELOCK(lock); - } - break; - - default: - DEFAULT; - } - break; - - case 0x81: - case 0x83: - nextop = F8; - switch((nextop>>3)&7) { - case 0: //ADD - if(opcode==0x81) {INST_NAME("ADD Ed, Id");} else {INST_NAME("ADD Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6); - WBACK; - break; - case 1: //OR - if(opcode==0x81) {INST_NAME("OR Ed, Id");} else {INST_NAME("OR Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_or32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACK; - break; - case 2: //ADC - if(opcode==0x81) {INST_NAME("ADC Ed, Id");} else {INST_NAME("ADC Ed, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - MOV64xw(x5, i64); - emit_adc32(dyn, ninst, rex, ed, x5, x3, x4, x5, x6); - WBACK; - break; - case 3: //SBB - if(opcode==0x81) {INST_NAME("SBB Ed, Id");} else {INST_NAME("SBB Ed, Ib");} - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - MOV64xw(x5, i64); - emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4, x5); - WBACK; - break; - case 4: //AND - if(opcode==0x81) {INST_NAME("AND Ed, Id");} else {INST_NAME("AND Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_and32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACK; - break; - case 5: //SUB - if(opcode==0x81) {INST_NAME("SUB Ed, Id");} else {INST_NAME("SUB Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_sub32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6); - WBACK; - break; - case 6: //XOR - if(opcode==0x81) {INST_NAME("XOR Ed, Id");} else {INST_NAME("XOR Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - emit_xor32c(dyn, ninst, rex, ed, i64, x3, x4); - WBACK; - break; - case 7: //CMP - if(opcode==0x81) {INST_NAME("CMP Ed, Id");} else {INST_NAME("CMP Ed, Ib");} - SETFLAGS(X_ALL, SF_SET_PENDING); - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - if(i64) { - MOV64xw(x2, i64); - emit_cmp32(dyn, ninst, rex, ed, x2, x3, x4, x5, x6); - } else - emit_cmp32_0(dyn, ninst, rex, ed, x3, x4); - break; - } - break; - - case 0x88: - INST_NAME("MOV Eb, Gb"); - nextop = F8; - gd = ((nextop&0x38)>>3)+(rex.r<<3); - if(rex.rex) { - gb2 = 0; - gb1 = xRAX + gd; - } else { - gb2 = ((gd&4)>>2); - gb1 = xRAX+(gd&3); - } - gd = x4; - if(gb2) { - SRLI(x4, gb1, 8); - gb1 = x4; - } - if(MODREG) { - ed = (nextop&7) + (rex.b<<3); - if(rex.rex) { - eb1 = xRAX+ed; - eb2 = 0; - } else { - eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx - eb2 = ((ed&4)>>2); // L or H - } - ANDI(gd, gb1, 0xff); - if(eb2) { - MOV64x(x1, 0xffffffffffff00ffLL); - AND(x1, eb1, x1); - SLLI(gd, gd, 8); - OR(eb1, x1, gd); - } else { - ANDI(x1, eb1, ~0xff); - OR(eb1, x1, gd); - } - } else { - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); - SB(gb1, ed, fixedaddress); - SMWRITELOCK(lock); - } - break; - case 0x89: - INST_NAME("MOV Ed, Gd"); - nextop=F8; - GETGD; - if(MODREG) { // reg <= reg - MVxw(xRAX+(nextop&7)+(rex.b<<3), gd); - } else { // mem <= reg - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); - SDxw(gd, ed, fixedaddress); - SMWRITELOCK(lock); - } - break; - case 0x8B: - INST_NAME("MOV Gd, Ed"); - nextop=F8; - GETGD; - if(MODREG) { - MVxw(gd, xRAX+(nextop&7)+(rex.b<<3)); - } else { - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); - SMREADLOCK(lock); - LDxw(gd, ed, fixedaddress); - } - break; - case 0x8D: - INST_NAME("LEA Gd, Ed"); - nextop=F8; - GETGD; - if(MODREG) { // reg <= reg? that's an invalid operation - DEFAULT; - } else { // mem <= reg - addr = geted32(dyn, addr, ninst, nextop, &ed, gd, x1, &fixedaddress, rex, NULL, 0, 0); - AND(gd, ed, xMASK); - } - break; - - case 0xC1: - nextop = F8; - switch ((nextop >> 3) & 7) { - case 5: - INST_NAME("SHR Ed, Ib"); - u8 = geted_ib(dyn, addr, ninst, nextop) & (rex.w ? 0x3f : 0x1f); - // flags are not affected if count is 0, we make it a nop if possible. - if (u8) { - SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined - GETED32(1); - F8; - emit_shr32c(dyn, ninst, rex, ed, u8, x3, x4); - WBACK; - } else { - if (MODREG && !rex.w) { - GETED(1); - ZEROUP(ed); - } else { - FAKEED; - } - F8; - } - break; - default: - DEFAULT; - } - break; - - case 0xC7: - INST_NAME("MOV Ed, Id"); - nextop = F8; - if(MODREG) { // reg <= i32 - i64 = F32S; - ed = xRAX + (nextop & 7) + (rex.b << 3); - MOV64xw(ed, i64); - } else { // mem <= i32 - addr = geted32(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, &lock, 1, 0); - i64 = F32S; - MOV64xw(x3, i64); - SDxw(x3, ed, fixedaddress); - SMWRITELOCK(lock); - } - break; - - #define GO(Z) \ - BARRIER(BARRIER_MAYBE); \ - JUMP(addr+i8, 1); \ - if(dyn->insts[ninst].x64.jmp_insts==-1 || \ - CHECK_CACHE()) { \ - /* out of the block */ \ - i32 = dyn->insts[ninst].epilog-(dyn->native_size); \ - if(Z) {BNE(x1, xZR, i32);} else {BEQ(x1, xZR, i32);}; \ - if(dyn->insts[ninst].x64.jmp_insts==-1) { \ - if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \ - fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \ - jump_to_next(dyn, addr+i8, 0, ninst, rex.is32bits); \ - } else { \ - CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ - B(i32); \ - } \ - } else { \ - /* inside the block */ \ - i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \ - if(Z) {BEQ(x1, xZR, i32);} else {BNE(x1, xZR, i32);}; \ - } - case 0xE0: - INST_NAME("LOOPNZ (32bits)"); - READFLAGS(X_ZF); - i8 = F8S; - SUBI(xRCX, xRCX, 1); - ANDI(x1, xFlags, 1 << F_ZF); - CBNZ_NEXT(x1); - AND(x1, xRCX, xMASK); - GO(0); - break; - case 0xE1: - INST_NAME("LOOPZ (32bits)"); - READFLAGS(X_ZF); - i8 = F8S; - SUBI(xRCX, xRCX, 1); - ANDI(x1, xFlags, 1 << F_ZF); - CBZ_NEXT(x1); - AND(x1, xRCX, xMASK); - GO(0); - break; - case 0xE2: - INST_NAME("LOOP (32bits)"); - i8 = F8S; - SUBI(xRCX, xRCX, 1); - AND(x1, xRCX, xMASK); - GO(0); - break; - case 0xE3: - INST_NAME("JECXZ (32bits)"); - i8 = F8S; - AND(x1, xRCX, xMASK); - GO(1); - break; - #undef GO - - case 0xF7: - nextop = F8; - switch ((nextop >> 3) & 7) { - case 4: - INST_NAME("MUL EAX, Ed"); - SETFLAGS(X_ALL, SF_PENDING); - GETED32(0); - if (rex.w) { - if (ed == xRDX) - gd = x3; - else - gd = xRDX; - MULHU(gd, xRAX, ed); - MUL(xRAX, xRAX, ed); - if (gd != xRDX) MV(xRDX, gd); - } else { - MUL(xRDX, xRAX, ed); // 64 <- 32x32 - AND(xRAX, xRDX, xMASK); - SRLIW(xRDX, xRDX, 32); - } - UFLAG_RES(xRAX); - UFLAG_OP1(xRDX); - UFLAG_DF(x2, rex.w ? d_mul64 : d_mul32); - break; - default: - DEFAULT; - } - break; - default: - DEFAULT; - } - return addr; -} diff --git a/src/dynarec/rv64/dynarec_rv64_67_32.c b/src/dynarec/rv64/dynarec_rv64_67_32.c deleted file mode 100644 index aa663d3..0000000 --- a/src/dynarec/rv64/dynarec_rv64_67_32.c +++ /dev/null @@ -1,59 +0,0 @@ -#include -#include -#include -#include -#include - -#include "debug.h" -#include "box64context.h" -#include "dynarec.h" -#include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" -#include "x64emu.h" -#include "box64stack.h" -#include "callback.h" -#include "emu/x64run_private.h" -#include "x64trace.h" -#include "dynarec_native.h" - -#include "rv64_printer.h" -#include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" -#include "dynarec_rv64_functions.h" - -uintptr_t dynarec64_67_32(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) -{ - (void)ip; (void)need_epilog; - - uint8_t opcode = F8; - uint8_t nextop; - uint8_t gd, ed, wback, wb, wb1, wb2, gb1, gb2, eb1, eb2; - int64_t fixedaddress; - int unscaled; - int8_t i8; - uint8_t u8; - int32_t i32; - int64_t j64, i64; - int cacheupd = 0; - int lock; - int v0, v1, s0; - - if(!rex.is32bits) { - // should do a different file - DEFAULT; - return addr; - } - - rep = 0; - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - switch(opcode) { - default: - DEFAULT; - } - return addr; -} diff --git a/src/dynarec/rv64/dynarec_rv64_arch.c b/src/dynarec/rv64/dynarec_rv64_arch.c new file mode 100644 index 0000000..1bd3075 --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_arch.c @@ -0,0 +1,229 @@ +#include +#include +#include +#include +#include + +#include "debug.h" +#include "dynablock.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "emu/x64run_private.h" +#include "dynarec/dynablock_private.h" +#include "dynarec_rv64_arch.h" +#include "dynarec_rv64_functions.h" +#include "dynarec_rv64_private.h" + +//order might be important, so define SUPER for the right one +#define SUPER() \ + GO(flags) \ + GO(x87) \ + GO(mmx) \ + GO(sse) \ + GO(ymm) \ + + +typedef struct arch_flags_s +{ + uint8_t ignore:1; +} arch_flags_t; + +#define X87_ST_D 0 +#define X87_ST_F 1 +#define X87_ST_I64 2 +#define XMM0 0 +#define X870 XMM0 + 16 +#define EMM0 XMM0 + 16 +typedef struct arch_x87_s +{ + int8_t delta; //up to +/-7 + uint8_t x87; // 1bit is STx present + uint16_t x87_type; // 2bits per STx type + uint32_t x87_pos; //4bits per STx position (well, 3 would be enough) +} arch_x87_t; + +typedef struct arch_mmx_s +{ + uint8_t mmx; //1bit for each mmx reg present +} arch_mmx_t; + +typedef struct arch_sse_s +{ + uint16_t sse; //1bit for each sse reg present +} arch_sse_t; + +typedef struct arch_ymm_s +{ + uint16_t ymm0; // 1bit for ymm0 + uint16_t ymm; // 1bit for each ymm present + uint64_t ymm_pos; // 4bits for position of each ymm present +} arch_ymm_t; + +typedef struct arch_arch_s +{ + #define GO(A) uint16_t A:1; + SUPER() + #undef GO + uint16_t unaligned:1; + uint16_t seq:10; // how many instruction on the same values +} arch_arch_t; + +typedef struct arch_build_s +{ + #define GO(A) uint8_t A:1; + SUPER() + #undef GO + uint8_t unaligned; + #define GO(A) arch_##A##_t A##_; + SUPER() + #undef GO +} arch_build_t; + +static int arch_build(dynarec_rv64_t* dyn, int ninst, arch_build_t* arch) +{ + memset(arch, 0, sizeof(arch_build_t)); + // todo + // opcode can handle unaligned + arch->unaligned = dyn->insts[ninst].unaligned; + return arch->flags + arch->x87 + arch->mmx + arch->sse + arch->ymm + arch->unaligned; +} + +size_t get_size_arch(dynarec_rv64_t* dyn) +{ + arch_build_t build = {0}; + arch_build_t previous = {0}; + size_t sz = 0; + int seq = 0; + int nseq = 0; + int last = 0; + if(!dyn->size) return 0; + for(int i=0; isize; ++i) { + last = arch_build(dyn, i, &build); + if((!memcmp(&build, &previous, sizeof(arch_build_t))) && (seq<((1<<10)-1)) && i) { + // same sequence, increment + ++seq; + } else { + seq = 0; + ++nseq; + memcpy(&previous, &build, sizeof(arch_build_t)); + sz+=sizeof(arch_arch_t); + #define GO(A) if(build.A) sz+=sizeof(arch_##A##_t); + SUPER() + #undef GO + } + } + if(nseq==1 && !last) + return 0; //empty, no flags, no nothing + return sz; +} + +static void build_next(arch_arch_t* arch, arch_build_t* build) +{ + #define GO(A) arch->A = build->A; + SUPER() + #undef GO + arch->unaligned = build->unaligned; + arch->seq = 0; + void* p = ((void*)arch)+sizeof(arch_arch_t); + #define GO(A) \ + if(arch->A) { \ + memcpy(p, &build->A##_, sizeof(arch_ ##A##_t)); \ + p+=sizeof(arch_##A##_t); \ + } + SUPER() + #undef GO +} + +static int sizeof_arch(arch_arch_t* arch) +{ + int sz = sizeof(arch_arch_t); + #define GO(A) if(arch->A) sz+=sizeof(arch_##A##_t); + SUPER() + #undef GO + return sz; +} + +void* populate_arch(dynarec_rv64_t* dyn, void* p, size_t sz) +{ + arch_build_t build = {0}; + arch_build_t previous = {0}; + arch_arch_t* arch = p; + arch_arch_t* next = p; + int seq = 0; + for(int i=0; isize; ++i) { + arch_build(dyn, i, &build); + if((!memcmp(&build, &previous, sizeof(arch_build_t))) && (seq<((1<<10)-1)) && i) { + // same sequence, increment + seq++; + arch->seq = seq; + } else { + arch = next; + build_next(arch, &build); + seq = 0; + memcpy(&previous, &build, sizeof(arch_build_t)); + int sz = sizeof_arch(arch); + next = (arch_arch_t*)((uintptr_t)arch+sz); + } + } + return p; +} + +void adjust_arch(dynablock_t* db, x64emu_t* emu, ucontext_t* p, uintptr_t x64pc) +{ + if(!db->arch_size || !db->arch) + return; + int ninst = getX64AddressInst(db, x64pc); + dynarec_log(LOG_INFO, "adjust_arch(...), db=%p, x64pc=%p, nints=%d", db, (void*)x64pc, ninst); + if(ninst<0) { + dynarec_log(LOG_INFO, "\n"); + return; + } + if(ninst==0) { + dynarec_log(LOG_INFO, "\n"); + CHECK_FLAGS(emu); + return; + } + // look for state at ninst-1 + arch_arch_t* arch = db->arch; + arch_arch_t* next = arch; + #define GO(A) arch_##A##_t* A = NULL; + SUPER() + #undef GO + int i = 0; + while(iseq; + dynarec_log(LOG_INFO, "[ seq=%d%s%s%s%s%s ] ", arch->seq, arch->flags?" Flags":"", arch->x87?" x87":"", arch->mmx?" MMX":"", arch->sse?" SSE":"", arch->ymm?" YMM":""); + next = (arch_arch_t*)((uintptr_t)next + sizeof_arch(arch)); + } + int sz = sizeof(arch_arch_t); + #define GO(A) \ + if(arch->A) { \ + A = (arch_##A##_t*)((uintptr_t)arch + sz); \ + sz+=sizeof(arch_##A##_t); \ + } + SUPER() + #undef GO + // todo + dynarec_log(LOG_INFO, "\n"); +} + +int arch_unaligned(dynablock_t* db, uintptr_t x64pc) +{ + if(!db->arch_size || !db->arch) + return 0; + int ninst = getX64AddressInst(db, x64pc); + if(ninst<0) { + return 0; + } + // look for state at ninst + arch_arch_t* arch = db->arch; + arch_arch_t* next = arch; + int i = -1; + while(iseq; + next = (arch_arch_t*)((uintptr_t)next + sizeof_arch(arch)); + } + return arch->unaligned; +} diff --git a/src/dynarec/rv64/dynarec_rv64_arch.h b/src/dynarec/rv64/dynarec_rv64_arch.h new file mode 100644 index 0000000..0775524 --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_arch.h @@ -0,0 +1,20 @@ +#ifndef __DYNAREC_RV_ARCH_H__ +#define __DYNAREC_RV_ARCH_H__ + +#include +#include + +#include "x64emu.h" +#include "box64context.h" +#include "box64cpu.h" +#include "dynarec_rv64_private.h" + +// get size of arch specific info (can be 0) +size_t get_size_arch(dynarec_rv64_t* dyn); +//populate the array +void* populate_arch(dynarec_rv64_t* dyn, void* p, size_t sz); +//adjust flags and more +void adjust_arch(dynablock_t* db, x64emu_t* emu, ucontext_t* p, uintptr_t x64pc); +// get if instruction can be regenerated for unaligned access +int arch_unaligned(dynablock_t* db, uintptr_t x64pc); +#endif // __DYNAREC_RV_ARCH_H__ diff --git a/src/dynarec/rv64/dynarec_rv64_avx.c b/src/dynarec/rv64/dynarec_rv64_avx.c new file mode 100644 index 0000000..791307f --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_avx.c @@ -0,0 +1,72 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "rv64_printer.h" +#include "dynarec_rv64_private.h" +#include "dynarec_rv64_functions.h" +#include "../dynarec_helper.h" + +static const char* avx_prefix_string(uint16_t p) +{ + switch (p) { + case VEX_P_NONE: return "0"; + case VEX_P_66: return "66"; + case VEX_P_F2: return "F2"; + case VEX_P_F3: return "F3"; + default: return "??"; + } +} +static const char* avx_map_string(uint16_t m) +{ + switch (m) { + case VEX_M_NONE: return "0"; + case VEX_M_0F: return "0F"; + case VEX_M_0F38: return "0F38"; + case VEX_M_0F3A: return "0F3A"; + default: return "??"; + } +} + +uintptr_t dynarec64_AVX(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = PK(0); + rex_t rex = vex.rex; + + if ((vex.m == VEX_M_0F) && (vex.p == VEX_P_NONE)) + addr = dynarec64_AVX_0F(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if ((vex.m == VEX_M_0F) && (vex.p == VEX_P_66)) + addr = dynarec64_AVX_66_0F(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if ((vex.m == VEX_M_0F) && (vex.p == VEX_P_F2)) + addr = dynarec64_AVX_F2_0F(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if ((vex.m == VEX_M_0F) && (vex.p == VEX_P_F3)) + addr = dynarec64_AVX_F3_0F(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if ((vex.m == VEX_M_0F38) && (vex.p == VEX_P_66)) + addr = dynarec64_AVX_66_0F38(dyn, addr, ip, ninst, vex, ok, need_epilog); + else if ((vex.m == VEX_M_0F3A) && (vex.p == VEX_P_66)) + addr = dynarec64_AVX_66_0F3A(dyn, addr, ip, ninst, vex, ok, need_epilog); + else { + DEFAULT; + } + + if ((*ok == -1) && (BOX64ENV(dynarec_log) >= LOG_INFO || dyn->need_dump || BOX64ENV(dynarec_missing))) { + if (!dyn->size || BOX64ENV(dynarec_log) > LOG_INFO || dyn->need_dump) + dynarec_log(LOG_NONE, " Dynarec unimplemented VEX opcode size %d prefix %s map %s opcode %02X\n", 128 << vex.l, avx_prefix_string(vex.p), avx_map_string(vex.m), opcode); + } + return addr; +} diff --git a/src/dynarec/rv64/dynarec_rv64_avx_0f.c b/src/dynarec/rv64/dynarec_rv64_avx_0f.c new file mode 100644 index 0000000..9097a73 --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_avx_0f.c @@ -0,0 +1,993 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" +#include "my_cpuid.h" +#include "emu/x87emu_private.h" +#include "emu/x64shaext.h" + +#include "rv64_printer.h" +#include "dynarec_rv64_private.h" +#include "dynarec_rv64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2, gback, vback; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0, s1; + uint64_t tmp64u, u64; + int64_t j64; + int64_t fixedaddress, gdoffset, vxoffset, gyoffset, vyoffset; + int unscaled; + + rex_t rex = vex.rex; + + switch (opcode) { + case 0x10: + INST_NAME("VMOVUPS Gx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, gback, gdoffset + 0); + SD(x4, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, gback, gyoffset + 0); + SD(x4, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x11: + INST_NAME("VMOVUPS Ex, Gx"); + nextop = F8; + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + LD(x3, gback, gdoffset + 0); + LD(x4, gback, gdoffset + 8); + SD(x3, wback, fixedaddress + 0); + SD(x4, wback, fixedaddress + 8); + if (vex.l) { + GETEY(); + LD(x3, gback, gyoffset + 0); + LD(x4, gback, gyoffset + 8); + SD(x3, wback, fixedaddress + 0); + SD(x4, wback, fixedaddress + 8); + } else + YMM0(ed); + if (!MODREG) SMWRITE2(); + break; + case 0x12: + nextop = F8; + GETEX(x2, 0, 8); + GETGX(); + GETVX(); + if (MODREG) { + INST_NAME("VMOVHLPS Gx, Vx, Ex"); + LD(x3, wback, fixedaddress + 8); + SD(x3, gback, gdoffset); + } else { + INST_NAME("VMOVLPS Gx, Vx, Ex"); + LD(x3, wback, fixedaddress); + SD(x3, gback, gdoffset); + } + LD(x3, vback, vxoffset + 8); + SD(x3, gback, gdoffset + 8); + YMM0(gd); + break; + case 0x14: + INST_NAME("VUNPCKLPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 20 : 4); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LWU(x3, vback, vxoffset + 0); + LWU(x5, vback, vxoffset + 4); + LWU(x4, wback, fixedaddress + 0); + LWU(x6, wback, fixedaddress + 4); + SW(x3, gback, gdoffset + 0); + SW(x4, gback, gdoffset + 4); + SW(x5, gback, gdoffset + 8); + SW(x6, gback, gdoffset + 12); + if (vex.l) { + GETEY(); + LWU(x3, vback, vyoffset + 0); + LWU(x5, vback, vyoffset + 4); + LWU(x4, wback, fixedaddress + 0); + LWU(x6, wback, fixedaddress + 4); + SW(x3, gback, gyoffset + 0); + SW(x4, gback, gyoffset + 4); + SW(x5, gback, gyoffset + 8); + SW(x6, gback, gyoffset + 12); + } else + YMM0(gd); + break; + case 0x15: + INST_NAME("VUNPCKHPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LWU(x3, vback, vxoffset + 8); + LWU(x5, vback, vxoffset + 12); + LWU(x4, wback, fixedaddress + 8); + LWU(x6, wback, fixedaddress + 12); + SW(x3, gback, gdoffset + 0); + SW(x4, gback, gdoffset + 4); + SW(x5, gback, gdoffset + 8); + SW(x6, gback, gdoffset + 12); + if (vex.l) { + GETEY(); + LWU(x3, vback, vyoffset + 8); + LWU(x5, vback, vyoffset + 12); + LWU(x4, wback, fixedaddress + 8); + LWU(x6, wback, fixedaddress + 12); + SW(x3, gback, gyoffset + 0); + SW(x4, gback, gyoffset + 4); + SW(x5, gback, gyoffset + 8); + SW(x6, gback, gyoffset + 12); + } else + YMM0(gd); + break; + case 0x16: + nextop = F8; + GETEX(x2, 0, 1); + GETGX(); + GETVX(); + if (MODREG) { + INST_NAME("VMOVLHPS Gx, Vx, Ex"); + LD(x3, wback, fixedaddress); + SD(x3, gback, gdoffset + 8); + } else { + INST_NAME("VMOVHPS Gx, Vx, Ex"); + LD(x3, wback, fixedaddress); + SD(x3, gback, gdoffset + 8); + } + LD(x4, vback, vxoffset); + SD(x4, gback, gdoffset); + YMM0(gd); + break; + case 0x28: + INST_NAME("VMOVAPS Gx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + LD(x3, wback, fixedaddress); + SD(x3, gback, gdoffset); + LD(x3, wback, fixedaddress + 8); + SD(x3, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, wback, fixedaddress); + SD(x3, gback, gyoffset); + LD(x3, wback, fixedaddress + 8); + SD(x3, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x29: + INST_NAME("VMOVAPS Ex, Gx"); + nextop = F8; + GETEX(x2, 0, vex.l ? 24 : 8); + GETGX(); + LD(x3, gback, gdoffset); + SD(x3, wback, fixedaddress); + LD(x3, gback, gdoffset + 8); + SD(x3, wback, fixedaddress + 8); + if (vex.l) { + GETEY(); + GETGY(); + LD(x3, gback, gyoffset); + SD(x3, wback, fixedaddress); + LD(x3, gback, gyoffset + 8); + SD(x3, wback, fixedaddress + 8); + } else if (MODREG) + YMM0(ed); + break; + case 0x2E: + // no special check... + case 0x2F: + if (opcode == 0x2F) { + INST_NAME("COMISS Gx, Ex"); + } else { + INST_NAME("UCOMISS Gx, Ex"); + } + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGXSS(d0); + GETEXSS(v0, 0); + CLEAR_FLAGS(); + // if isnan(d0) || isnan(v0) + IFX (X_ZF | X_PF | X_CF) { + FEQS(x3, d0, d0); + FEQS(x2, v0, v0); + AND(x2, x2, x3); + BNE_MARK(x2, xZR); + ORI(xFlags, xFlags, (1 << F_ZF) | (1 << F_PF) | (1 << F_CF)); + B_NEXT_nocond; + } + MARK; + // else if isless(d0, v0) + IFX (X_CF) { + FLTS(x2, d0, v0); + BEQ_MARK2(x2, xZR); + ORI(xFlags, xFlags, 1 << F_CF); + B_NEXT_nocond; + } + MARK2; + // else if d0 == v0 + IFX (X_ZF) { + FEQS(x2, d0, v0); + CBZ_NEXT(x2); + ORI(xFlags, xFlags, 1 << F_ZF); + } + break; + case 0x51: + INST_NAME("VSQRTPS Gx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + d0 = fpu_get_scratch(dyn); + for (int i = 0; i < 4; ++i) { + FLW(d0, wback, fixedaddress + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, d0, d0); + BNEZ(x3, 4 + 2 * 4); // isnan(d0)? copy it + FSW(d0, gback, gdoffset + i * 4); + J(4 + 5 * 4); // continue + } + FSQRTS(d0, d0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, d0, d0); + BNEZ(x3, 4 + 4); // isnan(d0)? negate it + FNEGS(d0, d0); + } + FSW(d0, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + FLW(d0, wback, fixedaddress + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, d0, d0); + BNEZ(x3, 4 + 2 * 4); // isnan(d0)? copy it + FSW(d0, gback, gyoffset + i * 4); + J(4 + 5 * 4); // continue + } + FSQRTS(d0, d0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, d0, d0); + BNEZ(x3, 4 + 4); // isnan(d0)? negate it + FNEGS(d0, d0); + } + FSW(d0, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0x52: + INST_NAME("VRSQRTPS Gx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + s0 = fpu_get_scratch(dyn); + s1 = fpu_get_scratch(dyn); // 1.0f + v0 = fpu_get_scratch(dyn); // 0.0f + LUI(x3, 0x3f800); + FMVWX(s1, x3); // 1.0f + if (!BOX64ENV(dynarec_fastnan)) { + FMVWX(v0, xZR); + } + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FLTS(x3, v0, s0); // s0 > 0.0f? + BNEZ(x3, 4 + 5 * 4); + FEQS(x3, v0, s0); // s0 == 0.0f? + BEQZ(x3, 4 + 3 * 4); + FDIVS(s0, s1, v0); // generate an inf + FSW(s0, gback, gdoffset + i * 4); + J(4 + 6 * 4); // continue + } + FSQRTS(s0, s0); + FDIVS(s0, s1, s0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); // isnan(s0)? negate it + FNEGS(s0, s0); + } + FSW(s0, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FLTS(x3, v0, s0); // s0 > 0.0f? + BNEZ(x3, 4 + 5 * 4); + FEQS(x3, v0, s0); // s0 == 0.0f? + BEQZ(x3, 4 + 3 * 4); + FDIVS(s0, s1, v0); // generate an inf + FSW(s0, gback, gyoffset + i * 4); + J(4 + 6 * 4); // continue + } + FSQRTS(s0, s0); + FDIVS(s0, s1, s0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); // isnan(s0)? negate it + FNEGS(s0, s0); + } + FSW(s0, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0x53: + INST_NAME("VRCPPS Gx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + LUI(x3, 0x3f800); + FMVWX(d0, x3); // 1.0f + for (int i = 0; i < 4; ++i) { + FLW(d1, wback, fixedaddress + 4 * i); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, d1, d1); + BNEZ(x3, 4 + 2 * 4); // isnan(d1)? copy it + FSW(d1, gback, gdoffset + i * 4); + J(4 + 5 * 4); // continue + } + FDIVS(d1, d0, d1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, d1, d1); + BNEZ(x3, 4 + 4); // isnan(d1)? negate it + FNEGS(d1, d1); + } + FSW(d1, gback, gdoffset + 4 * i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + FLW(d1, wback, fixedaddress + 4 * i); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, d1, d1); + BNEZ(x3, 4 + 2 * 4); // isnan(d1)? copy it + FSW(d1, gback, gyoffset + i * 4); + J(4 + 5 * 4); // continue + } + FDIVS(d1, d0, d1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, d1, d1); + BNEZ(x3, 4 + 4); // isnan(d1)? negate it + FNEGS(d1, d1); + } + FSW(d1, gback, gyoffset + 4 * i); + } + } else + YMM0(gd); + break; + case 0x54: + INST_NAME("VANDPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LD(x3, vback, vxoffset + 0); + LD(x4, wback, fixedaddress + 0); + AND(x5, x3, x4); + SD(x5, gback, gdoffset + 0); + LD(x3, vback, vxoffset + 8); + LD(x4, wback, fixedaddress + 8); + AND(x5, x3, x4); + SD(x5, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, vback, vyoffset + 0); + LD(x4, wback, fixedaddress + 0); + AND(x5, x3, x4); + SD(x5, gback, gyoffset + 0); + LD(x3, vback, vyoffset + 8); + LD(x4, wback, fixedaddress + 8); + AND(x5, x3, x4); + SD(x5, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x55: + INST_NAME("VANDNPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LD(x3, vback, vxoffset + 0); + LD(x4, wback, fixedaddress + 0); + NOT(x3, x3); + AND(x5, x3, x4); + SD(x5, gback, gdoffset + 0); + LD(x3, vback, vxoffset + 8); + LD(x4, wback, fixedaddress + 8); + NOT(x3, x3); + AND(x5, x3, x4); + SD(x5, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, vback, vyoffset + 0); + LD(x4, wback, fixedaddress + 0); + NOT(x3, x3); + AND(x5, x3, x4); + SD(x5, gback, gyoffset + 0); + LD(x3, vback, vyoffset + 8); + LD(x4, wback, fixedaddress + 8); + NOT(x3, x3); + AND(x5, x3, x4); + SD(x5, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x56: + INST_NAME("VORPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LD(x3, vback, vxoffset + 0); + LD(x4, wback, fixedaddress + 0); + OR(x5, x3, x4); + SD(x5, gback, gdoffset + 0); + LD(x3, vback, vxoffset + 8); + LD(x4, wback, fixedaddress + 8); + OR(x5, x3, x4); + SD(x5, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, vback, vyoffset + 0); + LD(x4, wback, fixedaddress + 0); + OR(x5, x3, x4); + SD(x5, gback, gyoffset + 0); + LD(x3, vback, vyoffset + 8); + LD(x4, wback, fixedaddress + 8); + OR(x5, x3, x4); + SD(x5, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x57: + INST_NAME("VXORPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + if (vex.v == ed) { + SD(xZR, gback, gdoffset + 0); + SD(xZR, gback, gdoffset + 8); + } else { + LD(x3, vback, vxoffset + 0); + LD(x4, wback, fixedaddress + 0); + XOR(x5, x3, x4); + SD(x5, gback, gdoffset + 0); + LD(x3, vback, vxoffset + 8); + LD(x4, wback, fixedaddress + 8); + XOR(x5, x3, x4); + SD(x5, gback, gdoffset + 8); + } + if (vex.l) { + GETEY(); + if (vex.v == ed) { + YMM0(gd); + } else { + LD(x3, vback, vyoffset + 0); + LD(x4, wback, fixedaddress + 0); + XOR(x5, x3, x4); + SD(x5, gback, gyoffset + 0); + LD(x3, vback, vyoffset + 8); + LD(x4, wback, fixedaddress + 8); + XOR(x5, x3, x4); + SD(x5, gback, gyoffset + 8); + } + } else + YMM0(gd); + break; + case 0x58: + INST_NAME("VADDPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + s0 = fpu_get_scratch(dyn); + s1 = fpu_get_scratch(dyn); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vxoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + BEQZ(x3, 4 + 4 * 4); + } + FADDS(s0, s0, s1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); + FNEGS(s0, s0); + BNEZ(x4, 4 + 4); + FMVS(s0, s1); + } + FSW(s0, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vyoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + BEQZ(x3, 4 + 4 * 4); + } + FADDS(s0, s0, s1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); + FNEGS(s0, s0); + BNEZ(x4, 4 + 4); + FMVS(s0, s1); + } + FSW(s0, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0x59: + INST_NAME("VMULPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + s0 = fpu_get_scratch(dyn); + s1 = fpu_get_scratch(dyn); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vxoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + BEQZ(x3, 4 + 4 * 4); + } + FMULS(s0, s0, s1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); + FNEGS(s0, s0); + BNEZ(x4, 4 + 4); + FMVS(s0, s1); + } + FSW(s0, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vyoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + BEQZ(x3, 4 + 4 * 4); + } + FMULS(s0, s0, s1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); + FNEGS(s0, s0); + BNEZ(x4, 4 + 4); + FMVS(s0, s1); + } + FSW(s0, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0x5A: + INST_NAME("VCVTPS2PD Gx, Ex"); + nextop = F8; + GETGX(); + GETGY(); + GETEX(x2, 0, vex.l ? 12 : 4); + s0 = fpu_get_scratch(dyn); + s1 = fpu_get_scratch(dyn); + FLW(s0, wback, fixedaddress); + FLW(s1, wback, fixedaddress + 4); + FCVTDS(s0, s0); + FCVTDS(s1, s1); + FSD(s0, gback, gdoffset + 0); + FSD(s1, gback, gdoffset + 8); + if (vex.l) { + FLW(s0, wback, fixedaddress + 8); + FLW(s1, wback, fixedaddress + 12); + FCVTDS(s0, s0); + FCVTDS(s1, s1); + FSD(s0, gback, gyoffset + 0); + FSD(s1, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x5C: + INST_NAME("VSUBPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + s0 = fpu_get_scratch(dyn); + s1 = fpu_get_scratch(dyn); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vxoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + BEQZ(x3, 4 + 4 * 4); + } + FSUBS(s0, s1, s0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); + FNEGS(s0, s0); + BNEZ(x4, 4 + 4); + FMVS(s0, s1); + } + FSW(s0, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vyoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + BEQZ(x3, 4 + 4 * 4); + } + FSUBS(s0, s1, s0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); + FNEGS(s0, s0); + BNEZ(x4, 4 + 4); + FMVS(s0, s1); + } + FSW(s0, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0x5D: + INST_NAME("VMINPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + s0 = fpu_get_scratch(dyn); + s1 = fpu_get_scratch(dyn); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vxoffset + i * 4); + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + FLTS(x5, s1, s0); + AND(x3, x3, x5); + BNEZ(x3, 4 + 4 * 2); + FSW(s0, gback, gdoffset + i * 4); + B(4 + 4); + FSW(s1, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vyoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + FLTS(x5, s1, s0); + AND(x3, x3, x5); + BNEZ(x3, 4 + 4 * 2); + FSW(s0, gback, gyoffset + i * 4); + B(4 + 4); + FSW(s1, gback, gyoffset + i * 4); + } else { + FMINS(s1, s1, s0); + FSW(s1, gback, gyoffset + i * 4); + } + } + } else + YMM0(gd); + break; + case 0x5E: + INST_NAME("VDIVPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + s0 = fpu_get_scratch(dyn); + s1 = fpu_get_scratch(dyn); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vxoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + BEQZ(x3, 4 + 4 * 4); + } + FDIVS(s0, s1, s0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); + FNEGS(s0, s0); + BNEZ(x4, 4 + 4); + FMVS(s0, s1); + } + FSW(s0, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vyoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + BEQZ(x3, 4 + 4 * 4); + } + FDIVS(s0, s1, s0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); + FNEGS(s0, s0); + BNEZ(x4, 4 + 4); + FMVS(s0, s1); + } + FSW(s0, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0x5F: + INST_NAME("VMAXPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + s0 = fpu_get_scratch(dyn); + s1 = fpu_get_scratch(dyn); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vxoffset + i * 4); + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + FLTS(x5, s0, s1); + AND(x3, x3, x5); + BNEZ(x3, 4 + 4 * 2); + FSW(s0, gback, gdoffset + i * 4); + B(4 + 4); + FSW(s1, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vyoffset + i * 4); + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + FLTS(x5, s0, s1); + AND(x3, x3, x5); + BNEZ(x3, 4 + 4 * 2); + FSW(s0, gback, gyoffset + i * 4); + B(4 + 4); + FSW(s1, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0xC2: + INST_NAME("VCMPPS Gx, Vx, Ex, Ib"); + nextop = F8; + GETEX(x2, 1, vex.l ? 28 : 12); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + u8 = F8; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + for (int i = 0; i < 4 + (vex.l ? 4 : 0); ++i) { + if (i == 4) { GETEY(); } + if (i < 4) { + FLW(d0, vback, vxoffset + 4 * i); + FLW(d1, wback, fixedaddress + 4 * i); + } else { + FLW(d0, vback, vyoffset + 4 * (i - 4)); + FLW(d1, wback, fixedaddress + 4 * (i - 4)); + } + + if ((u8 & 0xf) != 0x0b && (u8 & 0xf) != 0xf) { + // x6 = !(isnan(d0) || isnan(d1)) + FEQS(x4, d0, d0); + FEQS(x3, d1, d1); + AND(x6, x3, x4); + } + + switch (u8 & 0x7) { + case 0: + FEQS(x3, d0, d1); + break; // Equal + case 1: + BEQ(x6, xZR, 8); + FLTS(x3, d0, d1); + break; // Less than + case 2: + BEQ(x6, xZR, 8); + FLES(x3, d0, d1); + break; // Less or equal + case 3: + if (u8 & 0x8) + ADDI(x3, xZR, 0); + else + XORI(x3, x6, 1); + break; + case 4: + FEQS(x3, d0, d1); + XORI(x3, x3, 1); + break; // Not Equal or unordered + case 5: + BEQ(x6, xZR, 12); + FLES(x3, d1, d0); + J(8); + ADDI(x3, xZR, 1); + break; // Greater or equal or unordered + case 6: + BEQ(x6, xZR, 12); + FLTS(x3, d1, d0); + J(8); + ADDI(x3, xZR, 1); + break; // Greater or unordered + case 7: + if (u8 & 0x8) + ADDI(x3, xZR, 1); + else + MV(x3, x6); + break; // Not NaN + } + if ((u8 & 0x3) != 0x3) { + if ((u8 & 0xC) == 0x8 || (u8 & 0xC) == 0x4) { + XORI(x7, x6, 1); + OR(x3, x3, x7); + } else + AND(x3, x3, x6); + } + NEG(x3, x3); + if (i < 4) { + SW(x3, gback, gdoffset + 4 * i); + } else { + SW(x3, gback, gyoffset + 4 * (i - 4)); + } + } + if (!vex.l) YMM0(gd); + break; + case 0xC6: + INST_NAME("VSHUFPS Gx, Vx, Ex, Ib"); + nextop = F8; + GETEX(x2, 1, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + u8 = F8; + + int32_t idx; + idx = (u8 >> (0 * 2)) & 3; + LWU(x3, vback, vxoffset + idx * 4); + idx = (u8 >> (1 * 2)) & 3; + LWU(x4, vback, vxoffset + idx * 4); + idx = (u8 >> (2 * 2)) & 3; + LWU(x5, wback, fixedaddress + idx * 4); + idx = (u8 >> (3 * 2)) & 3; + LWU(x6, wback, fixedaddress + idx * 4); + + SW(x3, gback, gdoffset + 0 * 4); + SW(x4, gback, gdoffset + 1 * 4); + SW(x5, gback, gdoffset + 2 * 4); + SW(x6, gback, gdoffset + 3 * 4); + + if (vex.l) { + GETEY(); + idx = (u8 >> (0 * 2)) & 3; + LWU(x3, vback, vyoffset + idx * 4); + idx = (u8 >> (1 * 2)) & 3; + LWU(x4, vback, vyoffset + idx * 4); + idx = (u8 >> (2 * 2)) & 3; + LWU(x5, wback, fixedaddress + idx * 4); + idx = (u8 >> (3 * 2)) & 3; + LWU(x6, wback, fixedaddress + idx * 4); + + SW(x3, gback, gyoffset + 0 * 4); + SW(x4, gback, gyoffset + 1 * 4); + SW(x5, gback, gyoffset + 2 * 4); + SW(x6, gback, gyoffset + 3 * 4); + } else + YMM0(gd); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/rv64/dynarec_rv64_avx_66_0f.c b/src/dynarec/rv64/dynarec_rv64_avx_66_0f.c new file mode 100644 index 0000000..8e2a430 --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_avx_66_0f.c @@ -0,0 +1,2953 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" +#include "my_cpuid.h" +#include "emu/x87emu_private.h" +#include "emu/x64shaext.h" + +#include "rv64_printer.h" +#include "dynarec_rv64_private.h" +#include "dynarec_rv64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_66_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2, gback, vback; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u, u64; + int64_t j64; + int64_t fixedaddress, gdoffset, vxoffset, gyoffset, vyoffset; + int unscaled; + + rex_t rex = vex.rex; + + switch (opcode) { + case 0x10: + INST_NAME("VMOVUPD Gx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + LD(x3, wback, fixedaddress); + LD(x4, wback, fixedaddress + 8); + SD(x3, gback, gdoffset); + SD(x4, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, wback, fixedaddress); + LD(x4, wback, fixedaddress + 8); + SD(x3, gback, gyoffset); + SD(x4, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x11: + INST_NAME("VMOVUPD Ex, Gx"); + nextop = F8; + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + LD(x3, gback, gdoffset + 0); + LD(x4, gback, gdoffset + 8); + SD(x3, wback, fixedaddress + 0); + SD(x4, wback, fixedaddress + 8); + if (vex.l) { + GETEY(); + LD(x3, gback, gyoffset + 0); + LD(x4, gback, gyoffset + 8); + SD(x3, wback, fixedaddress + 0); + SD(x4, wback, fixedaddress + 8); + } else if (MODREG) + YMM0(ed); + if (!MODREG) SMWRITE2(); + break; + case 0x12: + INST_NAME("VMOVLPD Gx, Vx, Eq"); + nextop = F8; + if (MODREG) { + // access register instead of memory is bad opcode! + DEFAULT; + return addr; + } + GETGX(); + GETVX(); + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + LD(x3, wback, fixedaddress); + SD(x3, gback, gdoffset + 0); + LD(x3, vback, vxoffset + 8); + SD(x3, gback, gdoffset + 8); + YMM0(gd); + break; + case 0x14: + INST_NAME("VUNPCKLPD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 16 : 0); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LD(x3, vback, vxoffset); + LD(x4, wback, fixedaddress); + SD(x3, gback, gdoffset); + SD(x4, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, vback, vyoffset); + LD(x4, wback, fixedaddress); + SD(x3, gback, gyoffset); + SD(x4, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x15: + INST_NAME("VUNPCKHPD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 16 : 0); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LD(x3, vback, vxoffset + 8); + LD(x4, wback, fixedaddress + 8); + SD(x3, gback, gdoffset); + SD(x4, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, vback, vyoffset + 8); + LD(x4, wback, fixedaddress + 8); + SD(x3, gback, gyoffset); + SD(x4, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x28: + INST_NAME("VMOVAPD Gx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + LD(x3, wback, fixedaddress); + SD(x3, gback, gdoffset); + LD(x3, wback, fixedaddress + 8); + SD(x3, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, wback, fixedaddress); + SD(x3, gback, gyoffset); + LD(x3, wback, fixedaddress + 8); + SD(x3, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x29: + INST_NAME("VMOVAPD Ex, Gx"); + nextop = F8; + GETEX(x2, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + LD(x3, gback, gdoffset + 0); + LD(x4, gback, gdoffset + 8); + SD(x3, wback, fixedaddress + 0); + SD(x4, wback, fixedaddress + 8); + if (vex.l) { + GETEY(); + LD(x3, gback, gyoffset + 0); + LD(x4, gback, gyoffset + 8); + SD(x3, wback, fixedaddress + 0); + SD(x4, wback, fixedaddress + 8); + } else if (MODREG) + YMM0(ed); + if (!MODREG) SMWRITE2(); + break; + case 0x2E: + // no special check... + case 0x2F: + if (opcode == 0x2F) { + INST_NAME("VCOMISD Gx, Ex"); + } else { + INST_NAME("VUCOMISD Gx, Ex"); + } + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + nextop = F8; + GETGXSD(d0); + GETEXSD(v0, 0); + CLEAR_FLAGS(); + // if isnan(d0) || isnan(v0) + IFX (X_ZF | X_PF | X_CF) { + FEQD(x3, d0, d0); + FEQD(x2, v0, v0); + AND(x2, x2, x3); + BNE_MARK(x2, xZR); + ORI(xFlags, xFlags, (1 << F_ZF) | (1 << F_PF) | (1 << F_CF)); + B_NEXT_nocond; + } + MARK; + // else if isless(d0, v0) + IFX (X_CF) { + FLTD(x2, d0, v0); + BEQ_MARK2(x2, xZR); + ORI(xFlags, xFlags, 1 << F_CF); + B_NEXT_nocond; + } + MARK2; + // else if d0 == v0 + IFX (X_ZF) { + FEQD(x2, d0, v0); + CBZ_NEXT(x2); + ORI(xFlags, xFlags, 1 << F_ZF); + } + break; + case 0x50: + INST_NAME("VMOVMSKPD Gd, Ex"); + nextop = F8; + GETGD; + GETEX(x1, 0, vex.l ? 24 : 8); + XOR(gd, gd, gd); + for (int i = 0; i < 2; ++i) { + // GD->dword[0] |= ((EX->q[i]>>63)&1)<= 0; --i) { + LBU(x3, wback, fixedaddress + i); + LBU(x4, vback, vxoffset + i); + SB(x3, gback, gdoffset + 2 * i + 1); + SB(x4, gback, gdoffset + 2 * i); + } + if (vex.l) { + GETEY(); + for (int i = 7; i >= 0; --i) { + LBU(x3, wback, fixedaddress + i); + LBU(x4, vback, vyoffset + i); + SB(x3, gback, gyoffset + 2 * i + 1); + SB(x4, gback, gyoffset + 2 * i); + } + } else + YMM0(gd); + break; + case 0x61: + INST_NAME("VPUNPCKLWD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 22 : 6); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 3; i >= 0; --i) { + LHU(x3, wback, fixedaddress + i * 2); + LHU(x4, vback, vxoffset + i * 2); + SH(x3, gback, gdoffset + 4 * i + 2); + SH(x4, gback, gdoffset + 4 * i); + } + if (vex.l) { + GETEY(); + for (int i = 3; i >= 0; --i) { + LHU(x3, wback, fixedaddress + i * 2); + LHU(x4, vback, vyoffset + i * 2); + SH(x3, gback, gyoffset + 4 * i + 2); + SH(x4, gback, gyoffset + 4 * i); + } + } else + YMM0(gd); + break; + case 0x62: + INST_NAME("VPUNPCKLDQ Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 20 : 4); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 1; i >= 0; --i) { + LWU(x3, wback, fixedaddress + i * 4); + LWU(x4, vback, vxoffset + i * 4); + SW(x3, gback, gdoffset + 8 * i + 4); + SW(x4, gback, gdoffset + 8 * i); + } + if (vex.l) { + GETEY(); + for (int i = 1; i >= 0; --i) { + LWU(x3, wback, fixedaddress + i * 4); + LWU(x4, vback, vyoffset + i * 4); + SW(x3, gback, gyoffset + 8 * i + 4); + SW(x4, gback, gyoffset + 8 * i); + } + } else + YMM0(gd); + break; + case 0x63: + case 0x67: + if (opcode == 0x63) + INST_NAME("VPACKSSWB Gx, Vx, Ex"); + else + INST_NAME("VPACKUSWB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + if (opcode == 0x63) { + ADDIW(x6, xZR, 0xF80); // -128 + ADDIW(x7, xZR, 0x80); // 128 + } else { + ADDIW(x6, xZR, 0x100); // 256 + } + if (gd == ed) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + wback = x5; + fixedaddress = 0; + } + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vxoffset + i * 2); + if (opcode == 0x63) + SATw(x3, x6, x7); + else + SATUw(x3, x6); + SB(x3, gback, gdoffset + i); + } + if (vex.v == ed) { + LD(x3, gback, gdoffset + 0); + SD(x3, gback, gdoffset + 8); + } else { + for (int i = 0; i < 8; ++i) { + LH(x3, wback, fixedaddress + i * 2); + if (opcode == 0x63) + SATw(x3, x6, x7); + else + SATUw(x3, x6); + SB(x3, gback, gdoffset + 8 + i); + } + } + if (vex.l) { + GETEY(); + if (gd == ed) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + wback = x5; + fixedaddress = 0; + } + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vyoffset + i * 2); + if (opcode == 0x63) + SATw(x3, x6, x7); + else + SATUw(x3, x6); + SB(x3, gback, gyoffset + i); + } + if (vex.v == ed) { + LD(x3, gback, gyoffset + 0); + SD(x3, gback, gyoffset + 8); + } else { + for (int i = 0; i < 8; ++i) { + LH(x3, wback, fixedaddress + i * 2); + if (opcode == 0x63) + SATw(x3, x6, x7); + else + SATUw(x3, x6); + SB(x3, gback, gyoffset + 8 + i); + } + } + } else + YMM0(gd); + break; + case 0x64: + INST_NAME("VPCMPGTB Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 31 : 15); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + for (int i = 0; i < 16; ++i) { + LB(x3, vback, vxoffset + i); + LB(x4, wback, fixedaddress + i); + SLT(x4, x4, x3); + NEG(x3, x4); + SB(x3, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LB(x3, vback, vyoffset + i); + LB(x4, wback, fixedaddress + i); + SLT(x4, x4, x3); + NEG(x3, x4); + SB(x3, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0x65: + INST_NAME("VPCMPGTW Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 30 : 14); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vxoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + SLT(x4, x4, x3); + NEG(x3, x4); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vyoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + SLT(x4, x4, x3); + NEG(x3, x4); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0x66: + INST_NAME("VPCMPGTD Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 28 : 12); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vxoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + SLT(x4, x4, x3); + NEG(x3, x4); + SW(x3, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vyoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + SLT(x4, x4, x3); + NEG(x3, x4); + SW(x3, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0x68: + INST_NAME("VPUNPCKHBW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LBU(x3, vback, vxoffset + i + 8); + LBU(x4, wback, fixedaddress + i + 8); + SB(x3, gback, gdoffset + i * 2); + SB(x4, gback, gdoffset + i * 2 + 1); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LBU(x3, vback, vyoffset + i + 8); + LBU(x4, wback, fixedaddress + i + 8); + SB(x3, gback, gyoffset + i * 2); + SB(x4, gback, gyoffset + i * 2 + 1); + } + } else + YMM0(gd); + break; + case 0x69: + INST_NAME("VPUNPCKHWD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 4; ++i) { + LHU(x3, vback, vxoffset + i * 2 + 8); + LHU(x4, wback, fixedaddress + i * 2 + 8); + SH(x3, gback, gdoffset + i * 4); + SH(x4, gback, gdoffset + i * 4 + 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + LHU(x3, vback, vyoffset + i * 2 + 8); + LHU(x4, wback, fixedaddress + i * 2 + 8); + SH(x3, gback, gyoffset + i * 4); + SH(x4, gback, gyoffset + i * 4 + 2); + } + } else + YMM0(gd); + break; + case 0x6A: + INST_NAME("VPUNPCKHDQ Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 2; ++i) { + LWU(x3, vback, vxoffset + i * 4 + 8); + LWU(x4, wback, fixedaddress + i * 4 + 8); + SW(x3, gback, gdoffset + i * 8); + SW(x4, gback, gdoffset + i * 8 + 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 2; ++i) { + LWU(x3, vback, vyoffset + i * 4 + 8); + LWU(x4, wback, fixedaddress + i * 4 + 8); + SW(x3, gback, gyoffset + i * 8); + SW(x4, gback, gyoffset + i * 8 + 4); + } + } else + YMM0(gd); + break; + case 0x6B: + INST_NAME("VPACKSSDW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LUI(x6, 0xFFFF8); // -32768 + LUI(x7, 0x8); // 32768 + if (gd == ed) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + wback = x5; + fixedaddress = 0; + } + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vxoffset + i * 4); + SATw(x3, x6, x7); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.v == ed) { + LD(x3, gback, gdoffset + 0); + SD(x3, gback, gdoffset + 8); + } else { + for (int i = 0; i < 4; ++i) { + LW(x3, wback, fixedaddress + i * 4); + SATw(x3, x6, x7); + SH(x3, gback, gdoffset + (4 + i) * 2); + } + } + if (vex.l) { + GETEY(); + if (gd == ed) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + wback = x5; + fixedaddress = 0; + } + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vyoffset + i * 4); + SATw(x3, x6, x7); + SH(x3, gback, gyoffset + i * 2); + } + if (vex.v == ed) { + LD(x3, gback, gyoffset + 0); + SD(x3, gback, gyoffset + 8); + } else { + for (int i = 0; i < 4; ++i) { + LW(x3, wback, fixedaddress + i * 4); + SATw(x3, x6, x7); + SH(x3, gback, gyoffset + (4 + i) * 2); + } + } + } else + YMM0(gd); + break; + case 0x6C: + INST_NAME("VPUNPCKLQDQ Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 16 : 1); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + LD(x3, vback, vxoffset + 0); + LD(x4, wback, fixedaddress + 0); + SD(x3, gback, gdoffset + 0); + SD(x4, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, vback, vyoffset + 0); + LD(x4, wback, fixedaddress + 0); + SD(x3, gback, gyoffset + 0); + SD(x4, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x6D: + INST_NAME("VPUNPCKHQDQ Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + LD(x3, vback, vxoffset + 8); + LD(x4, wback, fixedaddress + 8); + SD(x3, gback, gdoffset + 0); + SD(x4, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, vback, vyoffset + 8); + LD(x4, wback, fixedaddress + 8); + SD(x3, gback, gyoffset + 0); + SD(x4, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x6E: + INST_NAME("VMOVD Gx, Ed"); + nextop = F8; + GETED(0); + GETGX(); + GETGY(); + if (MODREG && !rex.w) { + ZEXTW2(x3, ed); + ed = x3; + } + SD(ed, gback, gdoffset); + SD(xZR, gback, gdoffset + 8); + YMM0(gd); + break; + case 0x6F: + INST_NAME("VMOVDQA Gx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + LD(x3, wback, fixedaddress); + SD(x3, gback, gdoffset); + LD(x3, wback, fixedaddress + 8); + SD(x3, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, wback, fixedaddress); + SD(x3, gback, gyoffset); + LD(x3, wback, fixedaddress + 8); + SD(x3, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x70: + INST_NAME("VPSHUFD Gx, Ex, Ib"); + nextop = F8; + GETEX(x2, 1, vex.l ? 28 : 12); + GETGX(); + GETGY(); + u8 = F8; + + LWU(x3, wback, fixedaddress + ((u8 >> (0 * 2)) & 3) * 4); + LWU(x4, wback, fixedaddress + ((u8 >> (1 * 2)) & 3) * 4); + LWU(x5, wback, fixedaddress + ((u8 >> (2 * 2)) & 3) * 4); + LWU(x6, wback, fixedaddress + ((u8 >> (3 * 2)) & 3) * 4); + SW(x3, gback, gdoffset + 0 * 4); + SW(x4, gback, gdoffset + 1 * 4); + SW(x5, gback, gdoffset + 2 * 4); + SW(x6, gback, gdoffset + 3 * 4); + if (vex.l) { + GETEY(); + LWU(x3, wback, fixedaddress + ((u8 >> (0 * 2)) & 3) * 4); + LWU(x4, wback, fixedaddress + ((u8 >> (1 * 2)) & 3) * 4); + LWU(x5, wback, fixedaddress + ((u8 >> (2 * 2)) & 3) * 4); + LWU(x6, wback, fixedaddress + ((u8 >> (3 * 2)) & 3) * 4); + SW(x3, gback, gyoffset + 0 * 4); + SW(x4, gback, gyoffset + 1 * 4); + SW(x5, gback, gyoffset + 2 * 4); + SW(x6, gback, gyoffset + 3 * 4); + } else + YMM0(gd); + break; + case 0x74: + INST_NAME("VPCMPEQB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 16; ++i) { + LBU(x3, vback, vxoffset + i); + LBU(x4, wback, fixedaddress + i); + if (cpuext.xtheadbb) { + XOR(x3, x3, x4); + TH_TSTNBZ(x3, x3); + } else { + SUB(x3, x3, x4); + SEQZ(x3, x3); + NEG(x3, x3); + } + SB(x3, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LBU(x3, vback, vyoffset + i); + LBU(x4, wback, fixedaddress + i); + if (cpuext.xtheadbb) { + XOR(x3, x3, x4); + TH_TSTNBZ(x3, x3); + } else { + SUB(x3, x3, x4); + SEQZ(x3, x3); + NEG(x3, x3); + } + SB(x3, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0x75: + INST_NAME("VPCMPEQW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LHU(x3, vback, vxoffset + i * 2); + LHU(x4, wback, fixedaddress + i * 2); + SUB(x3, x3, x4); + SEQZ(x3, x3); + NEG(x3, x3); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LHU(x3, vback, vyoffset + i * 2); + LHU(x4, wback, fixedaddress + i * 2); + SUB(x3, x3, x4); + SEQZ(x3, x3); + NEG(x3, x3); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0x76: + INST_NAME("VPCMPEQD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 4; ++i) { + LWU(x3, vback, vxoffset + i * 4); + LWU(x4, wback, fixedaddress + i * 4); + SUB(x3, x3, x4); + SEQZ(x3, x3); + NEG(x3, x3); + SW(x3, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + LWU(x3, vback, vyoffset + i * 4); + LWU(x4, wback, fixedaddress + i * 4); + SUB(x3, x3, x4); + SEQZ(x3, x3); + NEG(x3, x3); + SW(x3, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0x7C: + INST_NAME("VHADDPD Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + v0 = fpu_get_scratch(dyn); + if (gd == ed) { + FLD(v0, gback, gdoffset + 0); + } + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + FLD(d0, gback, vxoffset + 0); + FLD(d1, gback, vxoffset + 8); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, d0, d0); + FEQD(x4, d1, d1); + AND(x3, x3, x4); + } + FADDD(d0, d0, d1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x4, d0, d0); + BEQZ(x3, 12); + BNEZ(x4, 8); + FNEGD(d0, d0); + } + FSD(d0, gback, gdoffset + 0); + if (vex.v == ed) { + FSD(d0, gback, gdoffset + 8); + } else { + if (gd == ed) + d0 = v0; + else + FLD(d0, wback, fixedaddress + 0); + FLD(d1, wback, fixedaddress + 8); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, d0, d0); + FEQD(x4, d1, d1); + AND(x3, x3, x4); + } + FADDD(d0, d0, d1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x4, d0, d0); + BEQZ(x3, 12); + BNEZ(x4, 8); + FNEGD(d0, d0); + } + FSD(d0, gback, gdoffset + 8); + } + if (vex.l) { + GETEY(); + if (gd == ed) { + FLD(v0, gback, gyoffset + 0); + } + FLD(d0, gback, vyoffset + 0); + FLD(d1, gback, vyoffset + 8); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, d0, d0); + FEQD(x4, d1, d1); + AND(x3, x3, x4); + } + FADDD(d0, d0, d1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x4, d0, d0); + BEQZ(x3, 12); + BNEZ(x4, 8); + FNEGD(d0, d0); + } + FSD(d0, gback, gyoffset + 0); + if (vex.v == ed) { + FSD(d0, gback, gyoffset + 8); + } else { + if (gd == ed) + d0 = v0; + else + FLD(d0, wback, fixedaddress + 0); + FLD(d1, wback, fixedaddress + 8); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, d0, d0); + FEQD(x4, d1, d1); + AND(x3, x3, x4); + } + FADDD(d0, d0, d1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x4, d0, d0); + BEQZ(x3, 12); + BNEZ(x4, 8); + FNEGD(d0, d0); + } + FSD(d0, gback, gyoffset + 8); + } + } else + YMM0(gd); + break; + case 0x7D: + INST_NAME("VHSUBPD Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + v0 = fpu_get_scratch(dyn); + if (gd == ed) { + FLD(v0, gback, gdoffset + 0); + } + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + FLD(d0, gback, vxoffset + 0); + FLD(d1, gback, vxoffset + 8); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, d0, d0); + FEQD(x4, d1, d1); + AND(x3, x3, x4); + } + FSUBD(d0, d0, d1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x4, d0, d0); + BEQZ(x3, 12); + BNEZ(x4, 8); + FNEGD(d0, d0); + } + FSD(d0, gback, gdoffset + 0); + if (vex.v == ed) { + FSD(d0, gback, gdoffset + 8); + } else { + if (gd == ed) + d0 = v0; + else + FLD(d0, wback, fixedaddress + 0); + FLD(d1, wback, fixedaddress + 8); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, d0, d0); + FEQD(x4, d1, d1); + AND(x3, x3, x4); + } + FSUBD(d0, d0, d1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x4, d0, d0); + BEQZ(x3, 12); + BNEZ(x4, 8); + FNEGD(d0, d0); + } + FSD(d0, gback, gdoffset + 8); + } + if (vex.l) { + GETEY(); + if (gd == ed) { + FLD(v0, gback, gyoffset + 0); + } + FLD(d0, gback, vyoffset + 0); + FLD(d1, gback, vyoffset + 8); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, d0, d0); + FEQD(x4, d1, d1); + AND(x3, x3, x4); + } + FSUBD(d0, d0, d1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x4, d0, d0); + BEQZ(x3, 12); + BNEZ(x4, 8); + FNEGD(d0, d0); + } + FSD(d0, gback, gyoffset + 0); + if (vex.v == ed) { + FSD(d0, gback, gyoffset + 8); + } else { + if (gd == ed) + d0 = v0; + else + FLD(d0, wback, fixedaddress + 0); + FLD(d1, wback, fixedaddress + 8); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, d0, d0); + FEQD(x4, d1, d1); + AND(x3, x3, x4); + } + FSUBD(d0, d0, d1); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x4, d0, d0); + BEQZ(x3, 12); + BNEZ(x4, 8); + FNEGD(d0, d0); + } + FSD(d0, gback, gyoffset + 8); + } + } else + YMM0(gd); + break; + case 0x7E: + INST_NAME("VMOVD Ed, Gx"); + nextop = F8; + GETGX(); + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + if (rex.w) { + if (MODREG) { + LD(ed, gback, gdoffset); + } else { + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + LD(x3, gback, gdoffset); + SD(x3, wback, fixedaddress); + SMWRITE2(); + } + } else { + if (MODREG) { + LWU(ed, gback, gdoffset); + } else { + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + LWU(x3, gback, gdoffset); + SW(x3, wback, fixedaddress); + SMWRITE2(); + } + } + break; + case 0x7F: + INST_NAME("VMOVDQA Ex, Gx"); + nextop = F8; + GETEX(x2, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + LD(x3, gback, gdoffset); + SD(x3, wback, fixedaddress); + LD(x3, gback, gdoffset + 8); + SD(x3, wback, fixedaddress + 8); + if (vex.l) { + GETEY(); + LD(x3, gback, gyoffset); + SD(x3, wback, fixedaddress); + LD(x3, gback, gyoffset + 8); + SD(x3, wback, fixedaddress + 8); + } else if (MODREG) + YMM0(ed); + break; + case 0xC2: + INST_NAME("VCMPPD Gx, Vx, Ex, Ib"); + nextop = F8; + GETEX(x2, 1, vex.l ? 24 : 8); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + u8 = F8; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + for (int i = 0; i < 2 + (vex.l ? 2 : 0); ++i) { + if (i == 2) { GETEY(); } + if (i < 2) { + FLD(d0, vback, vxoffset + 8 * i); + FLD(d1, wback, fixedaddress + 8 * i); + } else { + FLD(d0, vback, vyoffset + 8 * (i - 2)); + FLD(d1, wback, fixedaddress + 8 * (i - 2)); + } + + if ((u8 & 0xf) != 0x0b && (u8 & 0xf) != 0xf) { + // x6 = !(isnan(d0) || isnan(d1)) + FEQD(x4, d0, d0); + FEQD(x3, d1, d1); + AND(x6, x3, x4); + } + + switch (u8 & 0x7) { + case 0: + FEQD(x3, d0, d1); + break; // Equal + case 1: + BEQ(x6, xZR, 8); + FLTD(x3, d0, d1); + break; // Less than + case 2: + BEQ(x6, xZR, 8); + FLED(x3, d0, d1); + break; // Less or equal + case 3: + if (u8 & 0x8) + ADDI(x3, xZR, 0); + else + XORI(x3, x6, 1); + break; + case 4: + FEQD(x3, d0, d1); + XORI(x3, x3, 1); + break; // Not Equal or unordered + case 5: + BEQ(x6, xZR, 12); + FLED(x3, d1, d0); + J(8); + ADDI(x3, xZR, 1); + break; // Greater or equal or unordered + case 6: + BEQ(x6, xZR, 12); + FLTD(x3, d1, d0); + J(8); + ADDI(x3, xZR, 1); + break; // Greater or unordered + case 7: + if (u8 & 0x8) + ADDI(x3, xZR, 1); + else + MV(x3, x6); + break; // Not NaN + } + if ((u8 & 0x3) != 0x3) { + if ((u8 & 0xC) == 0x8 || (u8 & 0xC) == 0x4) { + XORI(x7, x6, 1); + OR(x3, x3, x7); + } else + AND(x3, x3, x6); + } + NEG(x3, x3); + if (i < 2) { + SD(x3, gback, gdoffset + 8 * i); + } else { + SD(x3, gback, gyoffset + 8 * (i - 2)); + } + } + if (!vex.l) YMM0(gd); + break; + case 0xC6: + INST_NAME("VSHUFPD Gx, Vx, Ex, Ib"); + nextop = F8; + GETGX(); + GETEX(x2, 1, 8); + GETGY(); + GETVX(); + GETVY(); + u8 = F8; + LD(x3, vback, vxoffset + 8 * (u8 & 1)); + LD(x4, wback, fixedaddress + 8 * ((u8 >> 1) & 1)); + SD(x3, gback, gdoffset + 0); + SD(x4, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, vback, vyoffset + 8 * ((u8 >> 2) & 1)); + LD(x4, wback, fixedaddress + 8 * ((u8 >> 3) & 1)); + SD(x3, gback, gyoffset + 0); + SD(x4, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0xD0: + INST_NAME("VADDSUBPD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + for (int i = 0; i < 2; ++i) { + FLD(v0, wback, fixedaddress + 8 * i); + FLD(v1, vback, vxoffset + 8 * i); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, v0, v0); + FEQD(x4, v1, v1); + } + if (i == 0) + FSUBD(v0, v1, v0); + else + FADDD(v0, v1, v0); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BEQZ(x3, 16); + FEQD(x3, v0, v0); + BNEZ(x3, 8); + FNEGD(v0, v0); + } + FSD(v0, gback, gdoffset + 8 * i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 2; ++i) { + FLD(v0, wback, fixedaddress + 8 * i); + FLD(v1, vback, vyoffset + 8 * i); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, v0, v0); + FEQD(x4, v1, v1); + } + if (i == 0) + FSUBD(v0, v1, v0); + else + FADDD(v0, v1, v0); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BEQZ(x3, 16); + FEQD(x3, v0, v0); + BNEZ(x3, 8); + FNEGD(v0, v0); + } + FSD(v0, gback, gyoffset + 8 * i); + } + } else + YMM0(gd); + break; + case 0xD1: + INST_NAME("VPSRLW Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 1); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LD(x3, wback, fixedaddress); + ADDI(x4, xZR, 16); + BLTU_MARK(x3, x4); + SD(xZR, gback, gdoffset + 0); + SD(xZR, gback, gdoffset + 8); + B_MARK2_nocond; + MARK; + for (int i = 0; i < 8; ++i) { + LHU(x5, vback, vxoffset + 2 * i); + SRLW(x5, x5, x3); + SH(x5, gback, gdoffset + 2 * i); + } + MARK2; + if (vex.l) { + BLTU_MARK3(x3, x4); + SD(xZR, gback, gyoffset + 0); + SD(xZR, gback, gyoffset + 8); + B_NEXT_nocond; + MARK3; + for (int i = 0; i < 8; ++i) { + LHU(x5, vback, vyoffset + 2 * i); + SRLW(x5, x5, x3); + SH(x5, gback, gyoffset + 2 * i); + } + } else + YMM0(gd); + break; + case 0xD2: + INST_NAME("VPSRLD Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 1); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LD(x3, wback, fixedaddress); + ADDI(x4, xZR, 32); + BLTU_MARK(x3, x4); + SD(xZR, gback, gdoffset + 0); + SD(xZR, gback, gdoffset + 8); + B_MARK2_nocond; + MARK; + for (int i = 0; i < 4; ++i) { + LWU(x5, vback, vxoffset + 4 * i); + SRLW(x5, x5, x3); + SW(x5, gback, gdoffset + 4 * i); + } + MARK2; + if (vex.l) { + BLTU_MARK3(x3, x4); + SD(xZR, gback, gyoffset + 0); + SD(xZR, gback, gyoffset + 8); + B_NEXT_nocond; + MARK3; + for (int i = 0; i < 4; ++i) { + LWU(x5, vback, vyoffset + 4 * i); + SRLW(x5, x5, x3); + SW(x5, gback, gyoffset + 4 * i); + } + } else + YMM0(gd); + break; + case 0xD3: + INST_NAME("VPSRLQ Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 1); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LD(x3, wback, fixedaddress); + ADDI(x4, xZR, 64); + BLTU_MARK(x3, x4); + SD(xZR, gback, gdoffset + 0); + SD(xZR, gback, gdoffset + 8); + B_MARK2_nocond; + MARK; + for (int i = 0; i < 2; ++i) { + LD(x5, vback, vxoffset + 8 * i); + SRL(x5, x5, x3); + SD(x5, gback, gdoffset + 8 * i); + } + MARK2; + if (vex.l) { + BLTU_MARK3(x3, x4); + SD(xZR, gback, gyoffset + 0); + SD(xZR, gback, gyoffset + 8); + B_NEXT_nocond; + MARK3; + for (int i = 0; i < 2; ++i) { + LD(x5, vback, vyoffset + 8 * i); + SRL(x5, x5, x3); + SD(x5, gback, gyoffset + 8 * i); + } + } else + YMM0(gd); + break; + case 0xD4: + INST_NAME("VPADDQ Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 2; ++i) { + LD(x3, vback, vxoffset + 8 * i); + LD(x4, wback, fixedaddress + 8 * i); + ADD(x3, x3, x4); + SD(x3, gback, gdoffset + 8 * i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 2; ++i) { + LD(x3, vback, vyoffset + 8 * i); + LD(x4, wback, fixedaddress + 8 * i); + ADD(x3, x3, x4); + SD(x3, gback, gyoffset + 8 * i); + } + } else + YMM0(gd); + break; + case 0xD5: + INST_NAME("VPMULLW Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vxoffset + 2 * i); + LH(x4, wback, fixedaddress + 2 * i); + MULW(x3, x3, x4); + SH(x3, gback, gdoffset + 2 * i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vyoffset + 2 * i); + LH(x4, wback, fixedaddress + 2 * i); + MULW(x3, x3, x4); + SH(x3, gback, gyoffset + 2 * i); + } + } else + YMM0(gd); + break; + case 0xD6: + INST_NAME("VMOVQ Ex, Gx"); + nextop = F8; + GETEX(x2, 0, 8); + GETGX(); + LD(x3, gback, gdoffset); + SD(x3, wback, fixedaddress); + if (MODREG) { + SD(xZR, wback, fixedaddress + 8); + YMM0(ed); + } else { + SMWRITE2(); + } + break; + case 0xD8: + INST_NAME("VPSUBUSB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 16; ++i) { + LBU(x3, vback, vxoffset + i); + LBU(x4, wback, fixedaddress + i); + SUB(x3, x3, x4); + if (cpuext.zbb) { + MAX(x3, x3, xZR); + } else { + NOT(x4, x3); + SRAI(x4, x4, 63); + AND(x3, x3, x4); + } + SB(x3, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LBU(x3, vback, vyoffset + i); + LBU(x4, wback, fixedaddress + i); + SUB(x3, x3, x4); + if (cpuext.zbb) { + MAX(x3, x3, xZR); + } else { + NOT(x4, x3); + SRAI(x4, x4, 63); + AND(x3, x3, x4); + } + SB(x3, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0xD9: + INST_NAME("VPSUBUSW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LHU(x3, vback, vxoffset + i * 2); + LHU(x4, wback, fixedaddress + i * 2); + SUB(x3, x3, x4); + if (cpuext.zbb) { + MAX(x3, x3, xZR); + } else { + NOT(x4, x3); + SRAI(x4, x4, 63); + AND(x3, x3, x4); + } + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LHU(x3, vback, vyoffset + i * 2); + LHU(x4, wback, fixedaddress + i * 2); + SUB(x3, x3, x4); + if (cpuext.zbb) { + MAX(x3, x3, xZR); + } else { + NOT(x4, x3); + SRAI(x4, x4, 63); + AND(x3, x3, x4); + } + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0xDA: + INST_NAME("VPMINUB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 16; ++i) { + LBU(x3, vback, vxoffset + i); + LBU(x4, wback, fixedaddress + i); + if (cpuext.zbb) { + MINU(x3, x3, x4); + } else { + BLTU(x3, x4, 8); + MV(x3, x4); + } + SB(x3, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LBU(x3, vback, vyoffset + i); + LBU(x4, wback, fixedaddress + i); + if (cpuext.zbb) { + MINU(x3, x3, x4); + } else { + BLTU(x3, x4, 8); + MV(x3, x4); + } + SB(x3, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0xDB: + INST_NAME("VPAND Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 2; ++i) { + LD(x3, vback, vxoffset + 8 * i); + LD(x4, wback, fixedaddress + 8 * i); + AND(x3, x3, x4); + SD(x3, gback, gdoffset + 8 * i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 2; ++i) { + LD(x3, vback, vyoffset + 8 * i); + LD(x4, wback, fixedaddress + 8 * i); + AND(x3, x3, x4); + SD(x3, gback, gyoffset + 8 * i); + } + } else + YMM0(gd); + break; + case 0xDC: + INST_NAME("VPADDUSB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + ADDI(x5, xZR, 0xFF); + for (int i = 0; i < 16; ++i) { + LBU(x3, vback, vxoffset + i); + LBU(x4, wback, fixedaddress + i); + ADD(x3, x3, x4); + if (cpuext.zbb) { + MINU(x3, x3, x5); + } else { + BLT(x3, x5, 8); + ADDI(x3, xZR, 0xFF); + } + SB(x3, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LBU(x3, vback, vyoffset + i); + LBU(x4, wback, fixedaddress + i); + ADD(x3, x3, x4); + if (cpuext.zbb) { + MINU(x3, x3, x5); + } else { + BLT(x3, x5, 8); + ADDI(x3, xZR, 0xFF); + } + SB(x3, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0xDD: + INST_NAME("VPADDUSW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + MOV32w(x5, 65535); + for (int i = 0; i < 8; ++i) { + LHU(x3, vback, vxoffset + i * 2); + LHU(x4, wback, fixedaddress + i * 2); + ADDW(x3, x3, x4); + if (cpuext.zbb) { + MINU(x3, x3, x5); + } else { + BGE(x5, x3, 8); + MV(x3, x5); + } + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LHU(x3, vback, vyoffset + i * 2); + LHU(x4, wback, fixedaddress + i * 2); + ADDW(x3, x3, x4); + if (cpuext.zbb) { + MINU(x3, x3, x5); + } else { + BGE(x5, x3, 8); + MV(x3, x5); + } + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0xDE: + INST_NAME("VPMAXUB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 16; ++i) { + LBU(x3, vback, vxoffset + i); + LBU(x4, wback, fixedaddress + i); + if (cpuext.zbb) { + MAXU(x3, x3, x4); + } else { + BLTU(x4, x3, 8); + MV(x3, x4); + } + SB(x3, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LBU(x3, vback, vyoffset + i); + LBU(x4, wback, fixedaddress + i); + if (cpuext.zbb) { + MAXU(x3, x3, x4); + } else { + BLTU(x4, x3, 8); + MV(x3, x4); + } + SB(x3, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0xDF: + INST_NAME("VPANDN Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 2; ++i) { + LD(x3, vback, vxoffset + 8 * i); + LD(x4, wback, fixedaddress + 8 * i); + NOT(x3, x3); + AND(x3, x3, x4); + SD(x3, gback, gdoffset + 8 * i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 2; ++i) { + LD(x3, vback, vyoffset + 8 * i); + LD(x4, wback, fixedaddress + 8 * i); + NOT(x3, x3); + AND(x3, x3, x4); + SD(x3, gback, gyoffset + 8 * i); + } + } else + YMM0(gd); + break; + case 0xE0: + INST_NAME("VPAVGB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 16; ++i) { + LBU(x3, vback, vxoffset + i); + LBU(x4, wback, fixedaddress + i); + ADDW(x3, x3, x4); + ADDIW(x3, x3, 1); + SRAIW(x3, x3, 1); + SB(x3, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LBU(x3, vback, vyoffset + i); + LBU(x4, wback, fixedaddress + i); + ADDW(x3, x3, x4); + ADDIW(x3, x3, 1); + SRAIW(x3, x3, 1); + SB(x3, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0xE1: + INST_NAME("VPSRAW Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 1); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + ADDI(x4, xZR, 16); + LD(x3, wback, fixedaddress); + BLTU(x3, x4, 8); + SUBI(x3, x4, 1); + for (int i = 0; i < 8; ++i) { + LH(x5, vback, vxoffset + 2 * i); + SRAW(x5, x5, x3); + SH(x5, gback, gdoffset + 2 * i); + } + if (vex.l) { + for (int i = 0; i < 8; ++i) { + LH(x5, vback, vyoffset + 2 * i); + SRAW(x5, x5, x3); + SH(x5, gback, gyoffset + 2 * i); + } + } else + YMM0(gd); + break; + case 0xE2: + INST_NAME("VPSRAD Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 1); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + ADDI(x4, xZR, 32); + LD(x3, wback, fixedaddress); + BLTU(x3, x4, 8); + SUBI(x3, x4, 1); + for (int i = 0; i < 4; ++i) { + LW(x5, vback, vxoffset + 4 * i); + SRAW(x5, x5, x3); + SW(x5, gback, gdoffset + 4 * i); + } + if (vex.l) { + for (int i = 0; i < 4; ++i) { + LW(x5, vback, vyoffset + 4 * i); + SRAW(x5, x5, x3); + SW(x5, gback, gyoffset + 4 * i); + } + } else + YMM0(gd); + break; + case 0xE3: + INST_NAME("VPAVGW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LHU(x3, vback, vxoffset + i * 2); + LHU(x4, wback, fixedaddress + i * 2); + ADDW(x3, x3, x4); + ADDIW(x3, x3, 1); + SRAIW(x3, x3, 1); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LHU(x3, vback, vyoffset + i * 2); + LHU(x4, wback, fixedaddress + i * 2); + ADDW(x3, x3, x4); + ADDIW(x3, x3, 1); + SRAIW(x3, x3, 1); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0xE4: + INST_NAME("VPMULHUW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LHU(x3, vback, vxoffset + i * 2); + LHU(x4, wback, fixedaddress + i * 2); + MULW(x3, x3, x4); + SRLIW(x3, x3, 16); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LHU(x3, vback, vyoffset + i * 2); + LHU(x4, wback, fixedaddress + i * 2); + MULW(x3, x3, x4); + SRLIW(x3, x3, 16); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0xE5: + INST_NAME("VPMULHW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vxoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + MULW(x3, x3, x4); + SRAIW(x3, x3, 16); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vyoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + MULW(x3, x3, x4); + SRAIW(x3, x3, 16); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0xE8: + INST_NAME("VPSUBSB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + ADDIW(x6, xZR, 0xF80); // -128 + ADDIW(x7, xZR, 0x80); // 128 + for (int i = 0; i < 16; ++i) { + LB(x3, vback, vxoffset + i); + LB(x4, wback, fixedaddress + i); + SUBW(x3, x3, x4); + SATw(x3, x6, x7); + SB(x3, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LB(x3, vback, vyoffset + i); + LB(x4, wback, fixedaddress + i); + SUBW(x3, x3, x4); + SATw(x3, x6, x7); + SB(x3, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0xE9: + INST_NAME("VPSUBSW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LUI(x6, 0xFFFF8); // -32768 + LUI(x7, 0x8); // 32768 + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vxoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + SUBW(x3, x3, x4); + SATw(x3, x6, x7); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vyoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + SUBW(x3, x3, x4); + SATw(x3, x6, x7); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0xEA: + INST_NAME("VPMINSW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LH(x3, gback, vxoffset + 2 * i); + LH(x4, wback, fixedaddress + 2 * i); + if (cpuext.zbb) { + MIN(x3, x3, x4); + } else { + BLT(x3, x4, 8); + MV(x3, x4); + } + SH(x3, gback, gdoffset + 2 * i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LH(x3, gback, vyoffset + 2 * i); + LH(x4, wback, fixedaddress + 2 * i); + if (cpuext.zbb) { + MIN(x3, x3, x4); + } else { + BLT(x3, x4, 8); + MV(x3, x4); + } + SH(x3, gback, gyoffset + 2 * i); + } + } else + YMM0(gd); + break; + case 0xEB: + INST_NAME("VPOR Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 2; ++i) { + LD(x3, vback, vxoffset + 8 * i); + LD(x4, wback, fixedaddress + 8 * i); + OR(x3, x3, x4); + SD(x3, gback, gdoffset + 8 * i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 2; ++i) { + LD(x3, vback, vyoffset + 8 * i); + LD(x4, wback, fixedaddress + 8 * i); + OR(x3, x3, x4); + SD(x3, gback, gyoffset + 8 * i); + } + } else + YMM0(gd); + break; + case 0xEC: + INST_NAME("VPADDSB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + ADDIW(x6, xZR, 0xF80); // -128 + ADDIW(x7, xZR, 0x80); // 128 + for (int i = 0; i < 16; ++i) { + LB(x3, vback, vxoffset + i); + LB(x4, wback, fixedaddress + i); + ADD(x3, x3, x4); + SATw(x3, x6, x7); + SB(x3, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LB(x3, vback, vyoffset + i); + LB(x4, wback, fixedaddress + i); + ADD(x3, x3, x4); + SATw(x3, x6, x7); + SB(x3, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0xED: + INST_NAME("VPADDSW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LUI(x6, 0xFFFF8); // -32768 + LUI(x7, 0x8); // 32768 + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vxoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + ADD(x3, x3, x4); + SATw(x3, x6, x7); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vyoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + ADD(x3, x3, x4); + SATw(x3, x6, x7); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0xEE: + INST_NAME("VPMAXSW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LH(x3, gback, vxoffset + 2 * i); + LH(x4, wback, fixedaddress + 2 * i); + if (cpuext.zbb) { + MAX(x3, x3, x4); + } else { + BLT(x4, x3, 8); + MV(x3, x4); + } + SH(x3, gback, gdoffset + 2 * i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LH(x3, gback, vyoffset + 2 * i); + LH(x4, wback, fixedaddress + 2 * i); + if (cpuext.zbb) { + MAX(x3, x3, x4); + } else { + BLT(x4, x3, 8); + MV(x3, x4); + } + SH(x3, gback, gyoffset + 2 * i); + } + } else + YMM0(gd); + break; + case 0xEF: + INST_NAME("VPXOR Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 24 : 8); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + LD(x3, vback, vxoffset + 0); + LD(x4, wback, fixedaddress + 0); + XOR(x3, x3, x4); + SD(x3, gback, gdoffset + 0); + LD(x3, vback, vxoffset + 8); + LD(x4, wback, fixedaddress + 8); + XOR(x3, x3, x4); + SD(x3, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, vback, vyoffset + 0); + LD(x4, wback, fixedaddress + 0); + XOR(x3, x3, x4); + SD(x3, gback, gyoffset + 0); + LD(x3, vback, vyoffset + 8); + LD(x4, wback, fixedaddress + 8); + XOR(x3, x3, x4); + SD(x3, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0xF1: + INST_NAME("VPSLLW Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 1); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LD(x3, wback, fixedaddress); + ADDI(x4, xZR, 16); + BLTU_MARK(x3, x4); + SD(xZR, gback, gdoffset + 0); + SD(xZR, gback, gdoffset + 8); + B_MARK2_nocond; + MARK; + for (int i = 0; i < 8; ++i) { + LHU(x5, vback, vxoffset + 2 * i); + SLLW(x5, x5, x3); + SH(x5, gback, gdoffset + 2 * i); + } + MARK2; + if (vex.l) { + BLTU_MARK3(x3, x4); + SD(xZR, gback, gyoffset + 0); + SD(xZR, gback, gyoffset + 8); + B_NEXT_nocond; + MARK3; + for (int i = 0; i < 8; ++i) { + LHU(x5, vback, vyoffset + 2 * i); + SLLW(x5, x5, x3); + SH(x5, gback, gyoffset + 2 * i); + } + } else + YMM0(gd); + break; + case 0xF2: + INST_NAME("VPSLLD Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 1); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LD(x3, wback, fixedaddress); + ADDI(x4, xZR, 32); + BLTU_MARK(x3, x4); + SD(xZR, gback, gdoffset + 0); + SD(xZR, gback, gdoffset + 8); + B_MARK2_nocond; + MARK; + for (int i = 0; i < 4; ++i) { + LWU(x5, vback, vxoffset + 4 * i); + SLLW(x5, x5, x3); + SW(x5, gback, gdoffset + 4 * i); + } + MARK2; + if (vex.l) { + BLTU_MARK3(x3, x4); + SD(xZR, gback, gyoffset + 0); + SD(xZR, gback, gyoffset + 8); + B_NEXT_nocond; + MARK3; + for (int i = 0; i < 4; ++i) { + LWU(x5, vback, vyoffset + 4 * i); + SLLW(x5, x5, x3); + SW(x5, gback, gyoffset + 4 * i); + } + } else + YMM0(gd); + break; + case 0xF3: + INST_NAME("VPSLLQ Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 1); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + LD(x3, wback, fixedaddress); + ADDI(x4, xZR, 64); + BLTU_MARK(x3, x4); + SD(xZR, gback, gdoffset + 0); + SD(xZR, gback, gdoffset + 8); + B_MARK2_nocond; + MARK; + for (int i = 0; i < 2; ++i) { + LD(x5, vback, vxoffset + 8 * i); + SLL(x5, x5, x3); + SD(x5, gback, gdoffset + 8 * i); + } + MARK2; + if (vex.l) { + BLTU_MARK3(x3, x4); + SD(xZR, gback, gyoffset + 0); + SD(xZR, gback, gyoffset + 8); + B_NEXT_nocond; + MARK3; + for (int i = 0; i < 2; ++i) { + LD(x5, vback, vyoffset + 8 * i); + SLL(x5, x5, x3); + SD(x5, gback, gyoffset + 8 * i); + } + } else + YMM0(gd); + break; + case 0xF4: + INST_NAME("VPMULUDQ Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 2; ++i) { + LWU(x3, gback, vxoffset + i * 8); + LWU(x4, wback, fixedaddress + i * 8); + MUL(x3, x3, x4); + SD(x3, gback, gdoffset + i * 8); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 2; ++i) { + LWU(x3, gback, vyoffset + i * 8); + LWU(x4, wback, fixedaddress + i * 8); + MUL(x3, x3, x4); + SD(x3, gback, gyoffset + i * 8); + } + } else + YMM0(gd); + break; + case 0xF5: + INST_NAME("VPMADDWD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 4; ++i) { + LH(x3, gback, vxoffset + 2 * (i * 2 + 0)); + LH(x4, wback, fixedaddress + 2 * (i * 2 + 0)); + MULW(x5, x3, x4); + LH(x3, gback, vxoffset + 2 * (i * 2 + 1)); + LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); + MULW(x6, x3, x4); + ADDW(x5, x5, x6); + SW(x5, gback, gdoffset + 4 * i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + LH(x3, gback, vyoffset + 2 * (i * 2 + 0)); + LH(x4, wback, fixedaddress + 2 * (i * 2 + 0)); + MULW(x5, x3, x4); + LH(x3, gback, vyoffset + 2 * (i * 2 + 1)); + LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); + MULW(x6, x3, x4); + ADDW(x5, x5, x6); + SW(x5, gback, gyoffset + 4 * i); + } + } else + YMM0(gd); + break; + case 0xF6: + INST_NAME("VPSADBW Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 31 : 15); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + for (int i = 0; i < 16; ++i) { + if (i == 0 || i == 8) MV(x6, xZR); + LBU(x3, gback, vxoffset + i); + LBU(x4, wback, fixedaddress + i); + SUBW(x3, x3, x4); + SRAIW(x5, x3, 31); + XOR(x3, x5, x3); + SUBW(x3, x3, x5); + ANDI(x3, x3, 0xff); + ADDW(x6, x6, x3); + if (i == 7 || i == 15) + SD(x6, gback, gdoffset + i + 1 - 8); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + if (i == 0 || i == 8) MV(x6, xZR); + LBU(x3, gback, vyoffset + i); + LBU(x4, wback, fixedaddress + i); + SUBW(x3, x3, x4); + SRAIW(x5, x3, 31); + XOR(x3, x5, x3); + SUBW(x3, x3, x5); + ANDI(x3, x3, 0xff); + ADDW(x6, x6, x3); + if (i == 7 || i == 15) + SD(x6, gback, gyoffset + i + 1 - 8); + } + } else + YMM0(gd); + break; + case 0xF8: + INST_NAME("VPSUBB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 16; ++i) { + LB(x3, vback, vxoffset + i); + LB(x4, wback, fixedaddress + i); + SUB(x3, x3, x4); + SB(x3, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LB(x3, vback, vyoffset + i); + LB(x4, wback, fixedaddress + i); + SUB(x3, x3, x4); + SB(x3, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0xF9: + INST_NAME("VPSUBW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vxoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + SUB(x3, x3, x4); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vyoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + SUB(x3, x3, x4); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0xFA: + INST_NAME("VPSUBD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vxoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + SUB(x3, x3, x4); + SW(x3, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vyoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + SUB(x3, x3, x4); + SW(x3, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0xFB: + INST_NAME("VPSUBQ Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 8); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 2; ++i) { + LD(x3, vback, vxoffset + 8 * i); + LD(x4, wback, fixedaddress + 8 * i); + SUB(x3, x3, x4); + SD(x3, gback, gdoffset + 8 * i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 2; ++i) { + LD(x3, vback, vyoffset + 8 * i); + LD(x4, wback, fixedaddress + 8 * i); + SUB(x3, x3, x4); + SD(x3, gback, gyoffset + 8 * i); + } + } else + YMM0(gd); + break; + case 0xFC: + INST_NAME("VPADDB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 16; ++i) { + LB(x3, vback, vxoffset + i); + LB(x4, wback, fixedaddress + i); + ADD(x3, x3, x4); + SB(x3, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LB(x3, vback, vyoffset + i); + LB(x4, wback, fixedaddress + i); + ADD(x3, x3, x4); + SB(x3, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0xFD: + INST_NAME("VPADDW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vxoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + ADD(x3, x3, x4); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vyoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + ADD(x3, x3, x4); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0xFE: + INST_NAME("VPADDD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vxoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + ADD(x3, x3, x4); + SW(x3, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vyoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + ADD(x3, x3, x4); + SW(x3, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/rv64/dynarec_rv64_avx_66_0f38.c b/src/dynarec/rv64/dynarec_rv64_avx_66_0f38.c new file mode 100644 index 0000000..65b9d47 --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_avx_66_0f38.c @@ -0,0 +1,983 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" +#include "my_cpuid.h" +#include "emu/x87emu_private.h" +#include "emu/x64shaext.h" + +#include "rv64_printer.h" +#include "dynarec_rv64_private.h" +#include "dynarec_rv64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_66_0F38(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2, gback, vback; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u, u64; + int64_t j64; + int64_t fixedaddress, gdoffset, vxoffset, gyoffset, vyoffset; + int unscaled; + + rex_t rex = vex.rex; + + switch (opcode) { + case 0x00: + INST_NAME("VPSHUFB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + if (gd == vex.v) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, vback, vxoffset + 0); + LD(x4, vback, vxoffset + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + vback = x5; + vxoffset = 0; + } + + for (int i = 0; i < 16; ++i) { + LB(x3, wback, fixedaddress + i); + BGE(x3, xZR, 4 + 4 * 2); + SB(xZR, gback, gdoffset + i); + J(4 + 4 * 4); // continue + ANDI(x4, x3, 15); + ADD(x4, x4, vback); + LBU(x4, x4, vxoffset); + SB(x4, gback, gdoffset + i); + } + + if (vex.l) { + GETEY(); + if (gd == vex.v) { + LD(x3, vback, vyoffset + 0); + LD(x4, vback, vyoffset + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + vback = x5; + vyoffset = 0; + } + for (int i = 0; i < 16; ++i) { + LB(x3, wback, fixedaddress + i); + BGE(x3, xZR, 4 + 4 * 2); + SB(xZR, gback, gyoffset + i); + J(4 + 4 * 4); // continue + ANDI(x4, x3, 15); + ADD(x4, x4, vback); + LBU(x4, x4, vyoffset); + SB(x4, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0x01: + case 0x03: + if (opcode == 0x01) + INST_NAME("VPHADDW Gx, Vx, Ex"); + else + INST_NAME("VPHADDSW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + LUI(x6, 0xFFFF8); // -32768 + LUI(x7, 0x8); // 32768 + if (gd == ed) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + wback = x5; + fixedaddress = 0; + } + for (int i = 0; i < 4; ++i) { + // GX->sw[i] = VX->sw[i*2+0]+VX->sw[i*2+1]; + LH(x3, vback, vxoffset + 2 * (i * 2 + 0)); + LH(x4, vback, vxoffset + 2 * (i * 2 + 1)); + ADDW(x3, x3, x4); + if (opcode == 0x03) SATw(x3, x6, x7); + SH(x3, gback, gdoffset + 2 * i); + } + if (MODREG && ed == vex.v) { + // GX->q[1] = GX->q[0]; + LD(x3, gback, gdoffset + 0); + SD(x3, gback, gdoffset + 8); + } else { + for (int i = 0; i < 4; ++i) { + // GX->sw[4+i] = EX->sw[i*2+0]+EX->sw[i*2+1]; + LH(x3, wback, fixedaddress + 2 * (i * 2 + 0)); + LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); + ADDW(x3, x3, x4); + if (opcode == 0x03) SATw(x3, x6, x7); + SH(x3, gback, gdoffset + 2 * (4 + i)); + } + } + if (vex.l) { + GETEY(); + if (gd == ed) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + wback = x5; + fixedaddress = 0; + } + for (int i = 0; i < 4; ++i) { + // GY->sw[i] = VY->sw[i*2+0]+VY->sw[i*2+1]; + LH(x3, vback, vyoffset + 2 * (i * 2 + 0)); + LH(x4, vback, vyoffset + 2 * (i * 2 + 1)); + ADDW(x3, x3, x4); + if (opcode == 0x03) SATw(x3, x6, x7); + SH(x3, gback, gyoffset + 2 * i); + } + if (MODREG && ed == vex.v) { + // GY->q[1] = GY->q[0]; + LD(x3, gback, gyoffset + 0); + SD(x3, gback, gyoffset + 8); + } else { + for (int i = 0; i < 4; ++i) { + // GY->sw[4+i] = EY->sw[i*2+0]+EY->sw[i*2+1]; + LH(x3, wback, fixedaddress + 2 * (i * 2 + 0)); + LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); + ADDW(x3, x3, x4); + if (opcode == 0x03) SATw(x3, x6, x7); + SH(x3, gback, gyoffset + 2 * (4 + i)); + } + } + } else + YMM0(gd); + break; + case 0x02: + INST_NAME("VPHADDD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 28 : 12); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + if (gd == ed) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + wback = x5; + fixedaddress = 0; + } + for (int i = 0; i < 2; ++i) { + // GX->sd[i] = VX->sd[i*2+0]+VX->sd[i*2+1]; + LW(x3, vback, vxoffset + 4 * (i * 2 + 0)); + LW(x4, vback, vxoffset + 4 * (i * 2 + 1)); + ADDW(x3, x3, x4); + SW(x3, gback, gdoffset + 4 * i); + } + if (MODREG && ed == vex.v) { + // GX->q[1] = GX->q[0]; + LD(x3, gback, gdoffset + 0); + SD(x3, gback, gdoffset + 8); + } else { + for (int i = 0; i < 2; ++i) { + // GX->sd[4+i] = EX->sd[i*2+0]+EX->sd[i*2+1]; + LW(x3, wback, fixedaddress + 4 * (i * 2 + 0)); + LW(x4, wback, fixedaddress + 4 * (i * 2 + 1)); + ADDW(x3, x3, x4); + SW(x3, gback, gdoffset + 4 * (2 + i)); + } + } + if (vex.l) { + GETEY(); + if (gd == ed) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + wback = x5; + fixedaddress = 0; + } + for (int i = 0; i < 2; ++i) { + // GY->sd[i] = VY->sd[i*2+0]+VY->sd[i*2+1]; + LW(x3, vback, vyoffset + 4 * (i * 2 + 0)); + LW(x4, vback, vyoffset + 4 * (i * 2 + 1)); + ADDW(x3, x3, x4); + SW(x3, gback, gyoffset + 4 * i); + } + if (MODREG && ed == vex.v) { + // GY->q[1] = GY->q[0]; + LD(x3, gback, gyoffset + 0); + SD(x3, gback, gyoffset + 8); + } else { + for (int i = 0; i < 2; ++i) { + // GY->sd[4+i] = EY->sd[i*2+0]+EY->sd[i*2+1]; + LW(x3, wback, fixedaddress + 4 * (i * 2 + 0)); + LW(x4, wback, fixedaddress + 4 * (i * 2 + 1)); + ADDW(x3, x3, x4); + SW(x3, gback, gyoffset + 4 * (2 + i)); + } + } + } else + YMM0(gd); + break; + case 0x04: + INST_NAME("VPMADDUBSW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + LUI(x6, 0xFFFF8); // -32768 + LUI(x7, 0x8); // 32768 + for (int i = 0; i < 8; ++i) { + LBU(x3, vback, vxoffset + i * 2); + LB(x4, wback, fixedaddress + i * 2); + MUL(x2, x3, x4); + LBU(x3, vback, vxoffset + i * 2 + 1); + LB(x4, wback, fixedaddress + i * 2 + 1); + MUL(x3, x3, x4); + ADD(x3, x3, x2); + SATw(x3, x6, x7); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LBU(x3, vback, vyoffset + i * 2); + LB(x4, wback, fixedaddress + i * 2); + MUL(x2, x3, x4); + LBU(x3, vback, vyoffset + i * 2 + 1); + LB(x4, wback, fixedaddress + i * 2 + 1); + MUL(x3, x3, x4); + ADD(x3, x3, x2); + SATw(x3, x6, x7); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0x05: + case 0x07: + if (opcode == 0x05) + INST_NAME("VPHSUBW Gx, Vx, Ex"); + else + INST_NAME("VPHSUBSW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + LUI(x6, 0xFFFF8); // -32768 + LUI(x7, 0x8); // 32768 + if (gd == ed) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + wback = x5; + fixedaddress = 0; + } + for (int i = 0; i < 4; ++i) { + // GX->sw[i] = VX->sw[i*2+0]-VX->sw[i*2+1]; + LH(x3, vback, vxoffset + 2 * (i * 2 + 0)); + LH(x4, vback, vxoffset + 2 * (i * 2 + 1)); + SUBW(x3, x3, x4); + if (opcode == 0x07) SATw(x3, x6, x7); + SH(x3, gback, gdoffset + 2 * i); + } + if (MODREG && ed == vex.v) { + // GX->q[1] = GX->q[0]; + LD(x3, gback, gdoffset + 0); + SD(x3, gback, gdoffset + 8); + } else { + for (int i = 0; i < 4; ++i) { + // GX->sw[4+i] = EX->sw[i*2+0]-EX->sw[i*2+1]; + LH(x3, wback, fixedaddress + 2 * (i * 2 + 0)); + LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); + SUBW(x3, x3, x4); + if (opcode == 0x07) SATw(x3, x6, x7); + SH(x3, gback, gdoffset + 2 * (4 + i)); + } + } + if (vex.l) { + GETEY(); + if (gd == ed) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + wback = x5; + fixedaddress = 0; + } + for (int i = 0; i < 4; ++i) { + // GY->sw[i] = VY->sw[i*2+0]-VY->sw[i*2+1]; + LH(x3, vback, vyoffset + 2 * (i * 2 + 0)); + LH(x4, vback, vyoffset + 2 * (i * 2 + 1)); + SUBW(x3, x3, x4); + if (opcode == 0x07) SATw(x3, x6, x7); + SH(x3, gback, gyoffset + 2 * i); + } + if (MODREG && ed == vex.v) { + // GY->q[1] = GY->q[0]; + LD(x3, gback, gyoffset + 0); + SD(x3, gback, gyoffset + 8); + } else { + for (int i = 0; i < 4; ++i) { + // GY->sw[4+i] = EY->sw[i*2+0]-EY->sw[i*2+1]; + LH(x3, wback, fixedaddress + 2 * (i * 2 + 0)); + LH(x4, wback, fixedaddress + 2 * (i * 2 + 1)); + SUBW(x3, x3, x4); + if (opcode == 0x07) SATw(x3, x6, x7); + SH(x3, gback, gyoffset + 2 * (4 + i)); + } + } + } else + YMM0(gd); + break; + case 0x06: + INST_NAME("VPHSUBD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 28 : 12); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + if (gd == ed) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + wback = x5; + fixedaddress = 0; + } + for (int i = 0; i < 2; ++i) { + // GX->sd[i] = VX->sd[i*2+0]-VX->sd[i*2+1]; + LW(x3, vback, vxoffset + 4 * (i * 2 + 0)); + LW(x4, vback, vxoffset + 4 * (i * 2 + 1)); + SUBW(x3, x3, x4); + SW(x3, gback, gdoffset + 4 * i); + } + if (MODREG && ed == vex.v) { + // GX->q[1] = GX->q[0]; + LD(x3, gback, gdoffset + 0); + SD(x3, gback, gdoffset + 8); + } else { + for (int i = 0; i < 2; ++i) { + // GX->sd[4+i] = EX->sd[i*2+0]-EX->sd[i*2+1]; + LW(x3, wback, fixedaddress + 4 * (i * 2 + 0)); + LW(x4, wback, fixedaddress + 4 * (i * 2 + 1)); + SUBW(x3, x3, x4); + SW(x3, gback, gdoffset + 4 * (2 + i)); + } + } + if (vex.l) { + GETEY(); + if (gd == ed) { + ADDI(x5, xEmu, offsetof(x64emu_t, scratch)); + LD(x3, wback, fixedaddress + 0); + LD(x4, wback, fixedaddress + 8); + SD(x3, x5, 0); + SD(x4, x5, 8); + wback = x5; + fixedaddress = 0; + } + for (int i = 0; i < 2; ++i) { + // GY->sd[i] = VY->sd[i*2+0]-VY->sd[i*2+1]; + LW(x3, vback, vyoffset + 4 * (i * 2 + 0)); + LW(x4, vback, vyoffset + 4 * (i * 2 + 1)); + SUBW(x3, x3, x4); + SW(x3, gback, gyoffset + 4 * i); + } + if (MODREG && ed == vex.v) { + // GY->q[1] = GY->q[0]; + LD(x3, gback, gyoffset + 0); + SD(x3, gback, gyoffset + 8); + } else { + for (int i = 0; i < 2; ++i) { + // GY->sd[4+i] = EY->sd[i*2+0]-EY->sd[i*2+1]; + LW(x3, wback, fixedaddress + 4 * (i * 2 + 0)); + LW(x4, wback, fixedaddress + 4 * (i * 2 + 1)); + SUBW(x3, x3, x4); + SW(x3, gback, gyoffset + 4 * (2 + i)); + } + } + } else + YMM0(gd); + break; + case 0x08: + INST_NAME("VPSIGNB Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 31 : 15); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + for (int i = 0; i < 16; ++i) { + LB(x3, vback, vxoffset + i); + LB(x4, wback, fixedaddress + i); + SLT(x1, xZR, x4); + SRAI(x5, x4, 63); + OR(x1, x1, x5); + MUL(x3, x1, x3); + SB(x3, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LB(x3, vback, vyoffset + i); + LB(x4, wback, fixedaddress + i); + SLT(x1, xZR, x4); + SRAI(x5, x4, 63); + OR(x1, x1, x5); + MUL(x3, x1, x3); + SB(x3, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0x09: + INST_NAME("VPSIGNW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vxoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + SLT(x1, xZR, x4); + SRAI(x5, x4, 63); + OR(x1, x1, x5); + MUL(x3, x1, x3); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LH(x3, vback, vyoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + SLT(x1, xZR, x4); + SRAI(x5, x4, 63); + OR(x1, x1, x5); + MUL(x3, x1, x3); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0x0A: + INST_NAME("VPSIGND Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 28 : 12); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vxoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + SLT(x1, xZR, x4); + SRAI(x5, x4, 63); + OR(x1, x1, x5); + MUL(x3, x1, x3); + SW(x3, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vyoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + SLT(x1, xZR, x4); + SRAI(x5, x4, 63); + OR(x1, x1, x5); + MUL(x3, x1, x3); + SW(x3, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0x0B: + INST_NAME("VPMULHRSW Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, vex.l ? 30 : 14); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + for (int i = 0; i < 8; ++i) { + LH(x3, gback, vxoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + MUL(x3, x3, x4); + SRAI(x3, x3, 14); + ADDI(x3, x3, 1); + SRAI(x3, x3, 1); + SH(x3, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LH(x3, gback, vyoffset + i * 2); + LH(x4, wback, fixedaddress + i * 2); + MUL(x3, x3, x4); + SRAI(x3, x3, 14); + ADDI(x3, x3, 1); + SRAI(x3, x3, 1); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0x17: + INST_NAME("VPTEST Gx, Ex"); + nextop = F8; + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + GETEX(x1, 0, vex.l ? 24 : 8); + GETGX(); + CLEAR_FLAGS(); + SET_DFNONE(); + IFX (X_ZF | X_CF) { + LD(x2, wback, fixedaddress + 0); + LD(x3, wback, fixedaddress + 8); + LD(x4, gback, gdoffset + 0); + LD(x5, gback, gdoffset + 8); + + IFX (X_ZF) { + AND(x6, x4, x2); + AND(x7, x5, x3); + OR(x6, x6, x7); + BNEZ(x6, 4 + 4); + ORI(xFlags, xFlags, 1 << F_ZF); + } + IFX (X_CF) { + NOT(x4, x4); + NOT(x5, x5); + AND(x6, x4, x2); + AND(x7, x5, x3); + OR(x6, x6, x7); + BNEZ(x6, 4 + 4); + ORI(xFlags, xFlags, 1 << F_CF); + } + } + if (vex.l) { + GETEY(); + LD(x2, wback, fixedaddress + 0); + LD(x3, wback, fixedaddress + 8); + LD(x4, gback, gyoffset + 0); + LD(x5, gback, gyoffset + 8); + + IFX (X_ZF) { + AND(x6, x4, x2); + AND(x7, x5, x3); + OR(x6, x6, x7); + BNEZ(x6, 4 + 2 * 4); + ANDI(x6, xFlags, 1 << F_ZF); + OR(xFlags, xFlags, x6); + } + IFX (X_CF) { + NOT(x4, x4); + NOT(x5, x5); + AND(x6, x4, x2); + AND(x7, x5, x3); + OR(x6, x6, x7); + BNEZ(x6, 4 + 2 * 4); + ANDI(x6, xFlags, 1 << F_CF); + OR(xFlags, xFlags, x6); + } + } + break; + case 0x1C: + INST_NAME("VPABSB Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 31 : 15); + GETGY(); + for (int i = 0; i < 16; ++i) { + LB(x4, wback, fixedaddress + i); + BGE(x4, xZR, 4 + 4); + NEG(x4, x4); + SB(x4, gback, gdoffset + i); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 16; ++i) { + LB(x4, wback, fixedaddress + i); + BGE(x4, xZR, 4 + 4); + NEG(x4, x4); + SB(x4, gback, gyoffset + i); + } + } else + YMM0(gd); + break; + case 0x1D: + INST_NAME("VPABSW Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 30 : 14); + GETGY(); + for (int i = 0; i < 8; ++i) { + LH(x4, wback, fixedaddress + i * 2); + BGE(x4, xZR, 4 + 4); + NEG(x4, x4); + SH(x4, gback, gdoffset + i * 2); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + LH(x4, wback, fixedaddress + i * 2); + BGE(x4, xZR, 4 + 4); + NEG(x4, x4); + SH(x4, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + break; + case 0x1E: + INST_NAME("VPABSD Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 28 : 12); + GETGY(); + for (int i = 0; i < 4; ++i) { + LW(x4, wback, fixedaddress + i * 4); + BGE(x4, xZR, 4 + 4); + NEG(x4, x4); + SW(x4, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + LW(x4, wback, fixedaddress + i * 4); + BGE(x4, xZR, 4 + 4); + NEG(x4, x4); + SW(x4, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0x20: + INST_NAME("VPMOVSXBW Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 15 : 7); + GETGY(); + if (vex.l) { + for (int i = 7; i >= 0; --i) { + LB(x3, wback, fixedaddress + 8 + i); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + for (int i = 7; i >= 0; --i) { + LB(x3, wback, fixedaddress + i); + SH(x3, gback, gdoffset + i * 2); + } + break; + case 0x21: + INST_NAME("VPMOVSXBD Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 7 : 3); + GETGY(); + if (vex.l) { + for (int i = 3; i >= 0; --i) { + LB(x3, wback, fixedaddress + 4 + i); + SW(x3, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + for (int i = 3; i >= 0; --i) { + LB(x3, wback, fixedaddress + i); + SW(x3, gback, gdoffset + i * 4); + } + break; + case 0x22: + INST_NAME("VPMOVSXBQ Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 3 : 1); + GETGY(); + if (vex.l) { + for (int i = 1; i >= 0; --i) { + LB(x3, wback, fixedaddress + 2 + i); + SD(x3, gback, gyoffset + i * 8); + } + } else + YMM0(gd); + for (int i = 1; i >= 0; --i) { + LB(x3, wback, fixedaddress + i); + SD(x3, gback, gdoffset + i * 8); + } + break; + case 0x23: + INST_NAME("VPMOVSXWD Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 14 : 6); + GETGY(); + if (vex.l) { + for (int i = 3; i >= 0; --i) { + LH(x3, wback, fixedaddress + 8 + i * 2); + SW(x3, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + for (int i = 3; i >= 0; --i) { + LH(x3, wback, fixedaddress + i * 2); + SW(x3, gback, gdoffset + i * 4); + } + break; + case 0x24: + INST_NAME("VPMOVSXWQ Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 6 : 2); + GETGY(); + if (vex.l) { + for (int i = 1; i >= 0; --i) { + LH(x3, wback, fixedaddress + 4 + i * 2); + SD(x3, gback, gyoffset + i * 8); + } + } else + YMM0(gd); + for (int i = 1; i >= 0; --i) { + LH(x3, wback, fixedaddress + i * 2); + SD(x3, gback, gdoffset + i * 8); + } + break; + case 0x25: + INST_NAME("VPMOVSXDQ Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 12 : 4); + GETGY(); + if (vex.l) { + for (int i = 1; i >= 0; --i) { + LW(x4, wback, fixedaddress + 8 + i * 4); + SD(x4, gback, gyoffset + i * 8); + } + } else + YMM0(gd); + for (int i = 1; i >= 0; --i) { + LW(x4, wback, fixedaddress + i * 4); + SD(x4, gback, gdoffset + i * 8); + } + break; + case 0x30: + INST_NAME("VPMOVZXBW Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 15 : 7); + GETGY(); + if (vex.l) { + for (int i = 7; i >= 0; --i) { + LBU(x3, wback, fixedaddress + 8 + i); + SH(x3, gback, gyoffset + i * 2); + } + } else + YMM0(gd); + for (int i = 7; i >= 0; --i) { + LBU(x3, wback, fixedaddress + i); + SH(x3, gback, gdoffset + i * 2); + } + break; + case 0x31: + INST_NAME("VPMOVZXBD Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 7 : 3); + GETGY(); + if (vex.l) { + for (int i = 3; i >= 0; --i) { + LBU(x3, wback, fixedaddress + 4 + i); + SW(x3, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + for (int i = 3; i >= 0; --i) { + LBU(x3, wback, fixedaddress + i); + SW(x3, gback, gdoffset + i * 4); + } + break; + case 0x32: + INST_NAME("VPMOVZXBQ Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 3 : 1); + GETGY(); + if (vex.l) { + for (int i = 1; i >= 0; --i) { + LBU(x3, wback, fixedaddress + 2 + i); + SD(x3, gback, gyoffset + i * 8); + } + } else + YMM0(gd); + for (int i = 1; i >= 0; --i) { + LBU(x3, wback, fixedaddress + i); + SD(x3, gback, gdoffset + i * 8); + } + break; + case 0x33: + INST_NAME("VPMOVZXWD Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 14 : 6); + GETGY(); + if (vex.l) { + for (int i = 3; i >= 0; --i) { + LHU(x3, wback, fixedaddress + 8 + i * 2); + SW(x3, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + for (int i = 3; i >= 0; --i) { + LHU(x3, wback, fixedaddress + i * 2); + SW(x3, gback, gdoffset + i * 4); + } + break; + case 0x34: + INST_NAME("VPMOVZXWQ Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 6 : 2); + GETGY(); + if (vex.l) { + for (int i = 1; i >= 0; --i) { + LHU(x3, wback, fixedaddress + 4 + i * 2); + SD(x3, gback, gyoffset + i * 8); + } + } else + YMM0(gd); + for (int i = 1; i >= 0; --i) { + LHU(x3, wback, fixedaddress + i * 2); + SD(x3, gback, gdoffset + i * 8); + } + break; + case 0x35: + INST_NAME("VPMOVZXDQ Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 12 : 4); + GETGY(); + if (vex.l) { + for (int i = 1; i >= 0; --i) { + LWU(x4, wback, fixedaddress + 8 + i * 4); + SD(x4, gback, gyoffset + i * 8); + } + } else + YMM0(gd); + for (int i = 1; i >= 0; --i) { + LWU(x4, wback, fixedaddress + i * 4); + SD(x4, gback, gdoffset + i * 8); + } + break; + case 0x39: + INST_NAME("VPMINSD Gx, Vx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 28 : 12); + GETVX(); + GETGY(); + GETVY(); + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vxoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + if (cpuext.zbb) + MIN(x4, x3, x4); + else { + BLT(x4, x3, 4 + 4); + MV(x4, x3); + } + SW(x4, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vyoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + if (cpuext.zbb) + MIN(x4, x3, x4); + else { + BLT(x4, x3, 4 + 4); + MV(x4, x3); + } + SW(x4, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + case 0x3D: + INST_NAME("VPMAXSD Gx, Vx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, vex.l ? 28 : 12); + GETVX(); + GETGY(); + GETVY(); + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vxoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + if (cpuext.zbb) + MAX(x4, x3, x4); + else { + BLT(x3, x4, 4 + 4); + MV(x4, x3); + } + SW(x4, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + LW(x3, vback, vyoffset + i * 4); + LW(x4, wback, fixedaddress + i * 4); + if (cpuext.zbb) + MAX(x4, x3, x4); + else { + BLT(x3, x4, 4 + 4); + MV(x4, x3); + } + SW(x4, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/rv64/dynarec_rv64_avx_66_0f3a.c b/src/dynarec/rv64/dynarec_rv64_avx_66_0f3a.c new file mode 100644 index 0000000..5da46c7 --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_avx_66_0f3a.c @@ -0,0 +1,383 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" +#include "my_cpuid.h" +#include "emu/x87emu_private.h" +#include "emu/x64shaext.h" + +#include "rv64_printer.h" +#include "dynarec_rv64_private.h" +#include "dynarec_rv64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_66_0F3A(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2, gback, vback; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u, u64; + int64_t j64; + int64_t fixedaddress, gdoffset, vxoffset, gyoffset, vyoffset; + int unscaled; + + rex_t rex = vex.rex; + + switch (opcode) { + case 0x0E: + INST_NAME("VPBLENDW Gx, Vx, Ex, Ib"); + nextop = F8; + GETGX(); + GETEX(x2, 1, vex.l ? 30 : 14); + GETVX(); + GETVY(); + GETGY(); + u8 = F8; + for (int i = 0; i < 8; ++i) { + if (u8 & (1 << i)) { + if (gd != ed) { + LHU(x3, wback, fixedaddress + 2 * i); + SH(x3, gback, gdoffset + 2 * i); + } + } else if (gd != vex.v) { + LHU(x3, vback, vxoffset + 2 * i); + SH(x3, gback, gdoffset + 2 * i); + } + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 8; ++i) { + if (u8 & (1 << i)) { + if (gd != ed) { + LHU(x3, wback, fixedaddress + 2 * i); + SH(x3, gback, gyoffset + 2 * i); + } + } else if (gd != vex.v) { + LHU(x3, vback, vyoffset + 2 * i); + SH(x3, gback, gyoffset + 2 * i); + } + } + } else + YMM0(gd); + break; + case 0x0F: + INST_NAME("VPALIGNR Gx, Vx, Ex, Ib"); + nextop = F8; + GETGX(); + GETEX(x2, 1, vex.l ? 24 : 8); + GETVX(); + GETVY(); + GETGY(); + u8 = F8; + if (u8 > 31) { + SD(xZR, gback, gdoffset + 0); + SD(xZR, gback, gdoffset + 8); + } else if (u8 > 23) { + LD(x5, vback, vxoffset + 8); + if (u8 > 24) { + SRLI(x5, x5, 8 * (u8 - 24)); + } + SD(x5, gback, gdoffset + 0); + SD(xZR, gback, gdoffset + 8); + } else if (u8 > 15) { + if (u8 > 16) { + LD(x5, vback, vxoffset + 8); + LD(x4, vback, vxoffset + 0); + SRLI(x3, x5, 8 * (u8 - 16)); // lower of higher 64 bits + SLLI(x5, x5, 8 * (24 - u8)); // higher of lower 64 bits + SD(x3, gback, gdoffset + 8); + SRLI(x4, x4, 8 * (u8 - 16)); // lower of lower 64 bits + OR(x4, x4, x5); // lower 64 bits + SD(x4, gback, gdoffset + 0); + } else if (gd != vex.v) { + LD(x4, vback, vxoffset + 0); + LD(x5, vback, vxoffset + 8); + SD(x4, gback, gdoffset + 0); + SD(x5, gback, gdoffset + 8); + } + } else if (u8 > 7) { + if (u8 > 8) { + LD(x5, vback, vxoffset + 8); + LD(x4, vback, vxoffset + 0); + LD(x3, wback, fixedaddress + 8); + SLLI(x5, x5, 8 * (16 - u8)); // higher of higher 64 bits + SRLI(x1, x4, 8 * (u8 - 8)); // lower of higher 64 bits + SLLI(x4, x4, 8 * (16 - u8)); // higher of lower 64 bits + OR(x5, x1, x5); // higher 64 bits + SRLI(x3, x3, 8 * (u8 - 8)); // lower of lower 64 bits + SD(x5, gback, gdoffset + 8); + OR(x4, x4, x3); // lower 64 bits + SD(x4, gback, gdoffset + 0); + } else { + LD(x5, vback, vxoffset + 0); + LD(x4, wback, fixedaddress + 8); + SD(x5, gback, gdoffset + 8); + SD(x4, gback, gdoffset + 0); + } + } else { + if (u8 > 0) { + LD(x5, vback, vxoffset + 0); + LD(x4, wback, fixedaddress + 8); + LD(x3, wback, fixedaddress + 0); + SLLI(x5, x5, 8 * (8 - u8)); // higher of higher 64 bits + SRLI(x1, x4, 8 * (u8 - 0)); // lower of higher 64 bits + SLLI(x4, x4, 8 * (8 - u8)); // higher of lower 64 bits + OR(x5, x1, x5); // higher 64 bits + SRLI(x3, x3, 8 * (u8 - 0)); // lower of lower 64 bits + SD(x5, gback, gdoffset + 8); + OR(x4, x4, x3); // lower 64 bits + SD(x4, gback, gdoffset + 0); + } else { + LD(x5, wback, fixedaddress + 8); + LD(x4, wback, fixedaddress + 0); + SD(x5, gback, gdoffset + 8); + SD(x4, gback, gdoffset + 0); + } + } + if (vex.l) { + GETEY(); + if (u8 > 31) { + YMM0(gd); + } else if (u8 > 23) { + LD(x5, vback, vyoffset + 8); + if (u8 > 24) { + SRLI(x5, x5, 8 * (u8 - 24)); + } + SD(x5, gback, gyoffset + 0); + SD(xZR, gback, gyoffset + 8); + } else if (u8 > 15) { + if (u8 > 16) { + LD(x5, vback, vyoffset + 8); + LD(x4, vback, vyoffset + 0); + SRLI(x3, x5, 8 * (u8 - 16)); // lower of higher 64 bits + SLLI(x5, x5, 8 * (24 - u8)); // higher of lower 64 bits + SD(x3, gback, gyoffset + 8); + SRLI(x4, x4, 8 * (u8 - 16)); // lower of lower 64 bits + OR(x4, x4, x5); // lower 64 bits + SD(x4, gback, gyoffset + 0); + } else if (gd != vex.v) { + LD(x4, vback, vyoffset + 0); + LD(x5, vback, vyoffset + 8); + SD(x4, gback, gyoffset + 0); + SD(x5, gback, gyoffset + 8); + } + } else if (u8 > 7) { + if (u8 > 8) { + LD(x5, vback, vyoffset + 8); + LD(x4, vback, vyoffset + 0); + LD(x3, wback, fixedaddress + 8); + SLLI(x5, x5, 8 * (16 - u8)); // higher of higher 64 bits + SRLI(x1, x4, 8 * (u8 - 8)); // lower of higher 64 bits + SLLI(x4, x4, 8 * (16 - u8)); // higher of lower 64 bits + OR(x5, x1, x5); // higher 64 bits + SRLI(x3, x3, 8 * (u8 - 8)); // lower of lower 64 bits + SD(x5, gback, gyoffset + 8); + OR(x4, x4, x3); // lower 64 bits + SD(x4, gback, gyoffset + 0); + } else { + LD(x5, vback, vyoffset + 0); + LD(x4, wback, fixedaddress + 8); + SD(x5, gback, gyoffset + 8); + SD(x4, gback, gyoffset + 0); + } + } else { + if (u8 > 0) { + LD(x5, vback, vyoffset + 0); + LD(x4, wback, fixedaddress + 8); + LD(x3, wback, fixedaddress + 0); + SLLI(x5, x5, 8 * (8 - u8)); // higher of higher 64 bits + SRLI(x1, x4, 8 * (u8 - 0)); // lower of higher 64 bits + SLLI(x4, x4, 8 * (8 - u8)); // higher of lower 64 bits + OR(x5, x1, x5); // higher 64 bits + SRLI(x3, x3, 8 * (u8 - 0)); // lower of lower 64 bits + SD(x5, gback, gyoffset + 8); + OR(x4, x4, x3); // lower 64 bits + SD(x4, gback, gyoffset + 0); + } else { + LD(x5, wback, fixedaddress + 8); + LD(x4, wback, fixedaddress + 0); + SD(x5, gback, gyoffset + 8); + SD(x4, gback, gyoffset + 0); + } + } + } else + YMM0(gd); + break; + case 0x16: + if (rex.w) { + INST_NAME("VPEXTRQ Ed, Gx, Ib"); + } else { + INST_NAME("VPEXTRD Ed, Gx, Ib"); + } + nextop = F8; + GETGX(); + GETED(1); + u8 = F8; + if (rex.w) { + LD(ed, gback, gdoffset + 8 * (u8 & 0x1)); + if (!MODREG) { + SD(ed, wback, fixedaddress); + SMWRITE2(); + } + } else { + if (MODREG) { + LWU(ed, gback, gdoffset + 4 * (u8 & 0x3)); + } else { + LW(ed, gback, gdoffset + 4 * (u8 & 0x3)); + SW(ed, wback, fixedaddress); + SMWRITE2(); + } + } + break; + case 0x18: + case 0x38: + if (opcode == 0x18) { + INST_NAME("VINSERTF128 Gx, Vx, Ex, imm8"); + } else { + INST_NAME("VINSERTI128 Gx, Vx, Ex, imm8"); + } + nextop = F8; + GETEX(x1, 1, 8); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + u8 = F8; + if (u8 & 1) { + LD(x4, wback, fixedaddress + 0); + LD(x5, wback, fixedaddress + 8); + SD(x4, gback, gyoffset + 0); + SD(x5, gback, gyoffset + 8); + if (gd != vex.v) { + LD(x4, vback, vxoffset + 0); + LD(x5, vback, vxoffset + 8); + SD(x4, gback, gdoffset + 0); + SD(x5, gback, gdoffset + 8); + } + } else { + LD(x4, wback, fixedaddress + 0); + LD(x5, wback, fixedaddress + 8); + SD(x4, gback, gdoffset + 0); + SD(x5, gback, gdoffset + 8); + if (gd != vex.v) { + LD(x4, vback, vyoffset + 0); + LD(x5, vback, vyoffset + 8); + SD(x4, gback, gyoffset + 0); + SD(x5, gback, gyoffset + 8); + } + } + break; + case 0x19: + case 0x39: + if (opcode == 0x19) { + INST_NAME("VEXTRACTF128 Ex, Gx, imm8"); + } else { + INST_NAME("VEXTRACTI128 Ex, Gx, imm8"); + } + nextop = F8; + GETEX(x1, 1, 8); + GETGX(); + GETGY(); + u8 = F8; + if (u8 & 1) { + LD(x4, gback, gyoffset + 0); + LD(x5, gback, gyoffset + 8); + SD(x4, wback, fixedaddress + 0); + SD(x5, wback, fixedaddress + 8); + } else { + LD(x4, gback, gdoffset + 0); + LD(x5, gback, gdoffset + 8); + SD(x4, wback, fixedaddress + 0); + SD(x5, wback, fixedaddress + 8); + } + if (MODREG) { + YMM0(ed); + } else { + SMWRITE2(); + } + break; + case 0x22: + if (rex.w) { + INST_NAME("VPINSRQ Gx, Vx, ED, Ib"); + } else { + INST_NAME("VPINSRD Gx, Vx, ED, Ib"); + } + nextop = F8; + GETGX(); + GETED(1); + GETGY(); + GETVX(); + u8 = F8; + if (gd != vex.v) { + LD(x4, vback, vxoffset + 0); + LD(x5, vback, vxoffset + 8); + SD(x4, gback, gdoffset + 0); + SD(x5, gback, gdoffset + 8); + } + if (rex.w) { + SD(ed, gback, gdoffset + 8 * (u8 & 0x1)); + } else { + SW(ed, gback, gdoffset + 4 * (u8 & 0x3)); + } + YMM0(gd); + break; + case 0x4A: + INST_NAME("VBLENDVPS Gx, Vx, Ex, XMMImm8"); + nextop = F8; + u8 = geted_ib(dyn, addr, ninst, nextop) >> 4; + GETEX(x1, 1, vex.l ? 28 : 12); + GETGX(); + GETVX(); + GETGY(); + GETVY(); + F8; + for (int i = 0; i < 4; ++i) { + LW(x3, xEmu, offsetof(x64emu_t, xmm) + u8 * 16 + i * 4); + LWU(x4, wback, fixedaddress + i * 4); + LWU(x5, vback, vxoffset + i * 4); + BGE(x3, xZR, 4 + 4); + MV(x5, x4); + MV(x3, x5); + SW(x3, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + LW(x3, xEmu, offsetof(x64emu_t, ymm) + u8 * 16 + i * 4); + LWU(x4, wback, fixedaddress + i * 4); + LWU(x5, vback, vyoffset + i * 4); + BGE(x3, xZR, 4 + 4); + MV(x5, x4); + MV(x3, x5); + SW(x3, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/rv64/dynarec_rv64_avx_f2_0f.c b/src/dynarec/rv64/dynarec_rv64_avx_f2_0f.c new file mode 100644 index 0000000..fc00c0a --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_avx_f2_0f.c @@ -0,0 +1,424 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" +#include "my_cpuid.h" +#include "emu/x87emu_private.h" +#include "emu/x64shaext.h" + +#include "rv64_printer.h" +#include "dynarec_rv64_private.h" +#include "dynarec_rv64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_F2_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2, gback, vback; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0, s1; + uint64_t tmp64u, u64; + int64_t j64; + int64_t fixedaddress, gdoffset, vxoffset, gyoffset, vyoffset; + int unscaled; + + rex_t rex = vex.rex; + + switch (opcode) { + case 0x10: + INST_NAME("VMOVSD Gx, [Vx,] Ex"); + nextop = F8; + GETEX(x1, 0, 1); + GETGX(); + GETGY(); + LD(x3, wback, fixedaddress); + SD(x3, gback, gdoffset); + if (MODREG) { + GETVX(); + LD(x3, vback, vxoffset + 8); + SD(x3, gback, gdoffset + 8); + } else { + SD(xZR, gback, gdoffset + 8); + } + YMM0(gd); + break; + case 0x11: + INST_NAME("VMOVSD Ex, [Vx,] Gx"); + nextop = F8; + GETEX(x1, 0, 24); + GETGX(); + GETGY(); + LD(x3, gback, gdoffset); + SD(x3, wback, fixedaddress); + if (MODREG) { + GETVX(); + LD(x3, vback, vxoffset + 8); + SD(x3, wback, fixedaddress + 8); + YMM0(ed); + } + break; + case 0x12: + INST_NAME("VMOVDDUP Gx, Ex"); + nextop = F8; + GETEX(x1, 0, 1); + GETGX(); + GETGY(); + LD(x3, wback, fixedaddress); + SD(x3, gback, gdoffset); + SD(x3, gback, gdoffset + 8); + if (vex.l) { + GETEY(); + LD(x3, wback, fixedaddress + 0); + SD(x3, gback, gyoffset + 0); + SD(x3, gback, gyoffset + 8); + } else + YMM0(gd); + break; + case 0x58: + INST_NAME("VADDSD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, 1); + GETGX(); + GETVX(); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + FLD(v0, vback, vxoffset + 0); + FLD(v1, wback, fixedaddress + 0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, v0, v0); + FEQD(x4, v1, v1); + } + FADDD(v0, v0, v1); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BNEZ_MARK(x3); + BNEZ_MARK2(x4); + FMVD(v0, v1); + B_MARK2_nocond; + MARK; + FEQD(x3, v0, v0); + BNEZ_MARK2(x3); + FNEGD(v0, v0); + MARK2; + } + FSD(v0, gback, gdoffset + 0); + if (gd != vex.v) { + LD(x3, vback, vxoffset + 8); + SD(x3, gback, gdoffset + 8); + } + YMM0(gd); + break; + case 0x59: + INST_NAME("VMULSD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, 1); + GETGX(); + GETVX(); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + FLD(v0, vback, vxoffset + 0); + FLD(v1, wback, fixedaddress + 0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, v0, v0); + FEQD(x4, v1, v1); + } + FMULD(v0, v0, v1); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BNEZ_MARK(x3); + BNEZ_MARK2(x4); + FMVD(v0, v1); + B_MARK2_nocond; + MARK; + FEQD(x3, v0, v0); + BNEZ_MARK2(x3); + FNEGD(v0, v0); + MARK2; + } + FSD(v0, gback, gdoffset + 0); + if (gd != vex.v) { + LD(x3, vback, vxoffset + 8); + SD(x3, gback, gdoffset + 8); + } + YMM0(gd); + break; + case 0x5C: + INST_NAME("VSUBSD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, 1); + GETGX(); + GETVX(); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + FLD(v0, vback, vxoffset + 0); + FLD(v1, wback, fixedaddress + 0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, v0, v0); + FEQD(x4, v1, v1); + } + FSUBD(v0, v0, v1); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BNEZ_MARK(x3); + BNEZ_MARK2(x4); + FMVD(v0, v1); + B_MARK2_nocond; + MARK; + FEQD(x3, v0, v0); + BNEZ_MARK2(x3); + FNEGD(v0, v0); + MARK2; + } + FSD(v0, gback, gdoffset + 0); + if (gd != vex.v) { + LD(x3, vback, vxoffset + 8); + SD(x3, gback, gdoffset + 8); + } + YMM0(gd); + break; + case 0x5D: + INST_NAME("VMINSD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, 1); + GETGX(); + GETVX(); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + FLD(v0, vback, vxoffset + 0); + FLD(v1, wback, fixedaddress + 0); + FEQD(x2, v0, v0); + FEQD(x3, v1, v1); + AND(x2, x2, x3); + BEQ_MARK(x2, xZR); + FLED(x2, v1, v0); + BEQ_MARK2(x2, xZR); + MARK; + FMVD(v0, v1); + MARK2; + FSD(v0, gback, gdoffset + 0); + if (gd != vex.v) { + LD(x3, vback, vxoffset + 8); + SD(x3, gback, gdoffset + 8); + } + YMM0(gd); + break; + case 0x5E: + INST_NAME("VDIVSD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, 1); + GETGX(); + GETVX(); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + FLD(v0, vback, vxoffset + 0); + FLD(v1, wback, fixedaddress + 0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQD(x3, v0, v0); + FEQD(x4, v1, v1); + } + FDIVD(v0, v0, v1); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BNEZ_MARK(x3); + BNEZ_MARK2(x4); + FMVD(v0, v1); + B_MARK2_nocond; + MARK; + FEQD(x3, v0, v0); + BNEZ_MARK2(x3); + FNEGD(v0, v0); + MARK2; + } + FSD(v0, gback, gdoffset + 0); + if (gd != vex.v) { + LD(x3, vback, vxoffset + 8); + SD(x3, gback, gdoffset + 8); + } + YMM0(gd); + break; + case 0x5F: + INST_NAME("VMAXSD Gx, Vx, Ex"); + nextop = F8; + GETEX(x1, 0, 1); + GETGX(); + GETVX(); + v0 = fpu_get_scratch(dyn); + v1 = fpu_get_scratch(dyn); + FLD(v0, vback, vxoffset + 0); + FLD(v1, wback, fixedaddress + 0); + FEQD(x2, v0, v0); + FEQD(x3, v1, v1); + AND(x2, x2, x3); + BEQ_MARK(x2, xZR); + FLED(x2, v0, v1); + BEQ_MARK2(x2, xZR); + MARK; + FMVD(v0, v1); + MARK2; + FSD(v0, gback, gdoffset + 0); + if (gd != vex.v) { + LD(x3, vback, vxoffset + 8); + SD(x3, gback, gdoffset + 8); + } + YMM0(gd); + break; + case 0xC2: + INST_NAME("VCMPSD Gx, Vx, Ex, Ib"); + nextop = F8; + GETEX(x2, 1, 1); + GETGX(); + GETVX(); + u8 = F8; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + FLD(d0, vback, vxoffset); + FLD(d1, wback, fixedaddress); + + if ((u8 & 0xf) != 0x0b && (u8 & 0xf) != 0xf) { + // x6 = !(isnan(d0) || isnan(d1)) + FEQD(x4, d0, d0); + FEQD(x3, d1, d1); + AND(x6, x3, x4); + } + + switch (u8 & 0x7) { + case 0: + FEQD(x3, d0, d1); + break; // Equal + case 1: + BEQ(x6, xZR, 8); + FLTD(x3, d0, d1); + break; // Less than + case 2: + BEQ(x6, xZR, 8); + FLED(x3, d0, d1); + break; // Less or equal + case 3: + if (u8 & 0x8) + ADDI(x3, xZR, 0); + else + XORI(x3, x6, 1); + break; + case 4: + FEQD(x3, d0, d1); + XORI(x3, x3, 1); + break; // Not Equal or unordered + case 5: + BEQ(x6, xZR, 12); + FLED(x3, d1, d0); + J(8); + ADDI(x3, xZR, 1); + break; // Greater or equal or unordered + case 6: + BEQ(x6, xZR, 12); + FLTD(x3, d1, d0); + J(8); + ADDI(x3, xZR, 1); + break; // Greater or unordered + case 7: + if (u8 & 0x8) + ADDI(x3, xZR, 1); + else + MV(x3, x6); + break; // Not NaN + } + if ((u8 & 0x3) != 0x3) { + if ((u8 & 0xC) == 0x8 || (u8 & 0xC) == 0x4) { + XORI(x7, x6, 1); + OR(x3, x3, x7); + } else + AND(x3, x3, x6); + } + NEG(x3, x3); + SD(x3, gback, gdoffset); + if (gd != vex.v) { + LD(x3, vback, vxoffset + 8); + SD(x3, gback, gdoffset + 8); + } + YMM0(gd); + break; + case 0xD0: + INST_NAME("VADDSUBPS Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, vex.l ? 28 : 12); + GETGX(); + GETGY(); + GETVX(); + GETVY(); + s0 = fpu_get_scratch(dyn); + s1 = fpu_get_scratch(dyn); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vxoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + BEQZ(x3, 4 + 4 * 4); + } + if (i == 1 || i == 3) + FADDS(s0, s0, s1); + else + FSUBS(s0, s1, s0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); + FNEGS(s0, s0); + BNEZ(x4, 4 + 4); + FMVS(s0, s1); + } + FSW(s0, gback, gdoffset + i * 4); + } + if (vex.l) { + GETEY(); + for (int i = 0; i < 4; ++i) { + FLW(s0, wback, fixedaddress + i * 4); + FLW(s1, vback, vyoffset + i * 4); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + FEQS(x4, s1, s1); + AND(x3, x3, x4); + BEQZ(x3, 4 + 4 * 4); + } + if (i == 1 || i == 3) + FADDS(s0, s0, s1); + else + FSUBS(s0, s1, s0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, s0, s0); + BNEZ(x3, 4 + 4); + FNEGS(s0, s0); + BNEZ(x4, 4 + 4); + FMVS(s0, s1); + } + FSW(s0, gback, gyoffset + i * 4); + } + } else + YMM0(gd); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/rv64/dynarec_rv64_avx_f3_0f.c b/src/dynarec/rv64/dynarec_rv64_avx_f3_0f.c new file mode 100644 index 0000000..83e4748 --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_avx_f3_0f.c @@ -0,0 +1,241 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" +#include "my_cpuid.h" +#include "emu/x87emu_private.h" +#include "emu/x64shaext.h" + +#include "rv64_printer.h" +#include "dynarec_rv64_private.h" +#include "dynarec_rv64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_AVX_F3_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed, vd; + uint8_t wback, wb1, wb2, gback, vback; + uint8_t eb1, eb2, gb1, gb2; + int32_t i32, i32_; + int cacheupd = 0; + int v0, v1, v2; + int q0, q1, q2; + int d0, d1, d2; + int s0; + uint64_t tmp64u, u64; + int64_t j64; + int64_t fixedaddress, gdoffset, vxoffset, gyoffset; + int unscaled; + + rex_t rex = vex.rex; + + switch (opcode) { + case 0x10: + INST_NAME("VMOVSS Gx, [Vx,] Ex"); + nextop = F8; + GETEX(x2, 0, 1); + GETGX(); + LWU(x3, wback, fixedaddress); + SW(x3, gback, gdoffset); + if (MODREG) { + GETVX(); + if (gd != vex.v) { + LWU(x3, vback, vxoffset + 4); + SW(x3, gback, gdoffset + 4); + LD(x3, vback, vxoffset + 8); + SD(x3, gback, gdoffset + 8); + } + } else { + SW(xZR, gback, gdoffset + 4); + SD(xZR, gback, gdoffset + 8); + } + GETGY(); + YMM0(gd); + break; + case 0x11: + INST_NAME("VMOVSS Ex, [Vx,] Gx"); + nextop = F8; + GETEX(x2, 0, 1); + GETGX(); + LWU(x3, gback, gdoffset); + SW(x3, wback, fixedaddress); + if (MODREG) { + GETVX(); + LWU(x3, vback, vxoffset + 4); + SW(x3, wback, fixedaddress + 4); + LD(x3, vback, vxoffset + 8); + SD(x3, wback, fixedaddress + 8); + YMM0(ed); + } + break; + case 0x5A: + INST_NAME("VCVTSS2SD Gx, Vx, Ex"); + nextop = F8; + GETEX(x2, 0, 1); + GETGX(); + GETVX(); + GETGY(); + s0 = fpu_get_scratch(dyn); + FLW(s0, wback, fixedaddress); + FCVTDS(s0, s0); + FSD(s0, gback, gdoffset); + if (gd != vex.v) { + LD(x2, vback, vxoffset + 8); + SD(x2, gback, gdoffset + 8); + } + YMM0(gd); + break; + case 0x5D: + INST_NAME("VMINSS Gx, Vx, Ex"); + nextop = F8; + GETGX(); + GETEX(x1, 0, 1); + GETVX(); + GETGY(); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + FLW(d0, vback, vxoffset); + FLW(d1, wback, fixedaddress); + FEQS(x2, d0, d0); + FEQS(x3, d1, d1); + AND(x2, x2, x3); + BEQ_MARK(x2, xZR); + FLES(x2, d1, d0); + BEQ_MARK2(x2, xZR); + MARK; + FMVS(d0, d1); + MARK2; + FSW(d0, gback, gdoffset); + if (gd != vex.v) { + LWU(x2, vback, vxoffset + 4); + SW(x2, gback, gdoffset + 4); + LD(x2, vback, vxoffset + 8); + SD(x2, gback, gdoffset + 8); + } + YMM0(gd); + break; + case 0x5F: + INST_NAME("VMAXSS Gx, Vx, Ex"); + nextop = F8; + GETGX(); + GETEX(x1, 0, 1); + GETVX(); + GETGY(); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + FLW(d0, vback, vxoffset); + FLW(d1, wback, fixedaddress); + FEQS(x2, d0, d0); + FEQS(x3, d1, d1); + AND(x2, x2, x3); + BEQ_MARK(x2, xZR); + FLES(x2, d0, d1); + BEQ_MARK2(x2, xZR); + MARK; + FMVS(d0, d1); + MARK2; + FSW(d0, gback, gdoffset); + if (gd != vex.v) { + LWU(x2, vback, vxoffset + 4); + SW(x2, gback, gdoffset + 4); + LD(x2, vback, vxoffset + 8); + SD(x2, gback, gdoffset + 8); + } + YMM0(gd); + break; + case 0x7E: + INST_NAME("VMOVQ Gx, Ex"); + nextop = F8; + GETEX(x1, 0, 1); + GETGX(); + GETGY(); + LD(x3, wback, fixedaddress); + SD(x3, gback, gdoffset + 0); + SD(xZR, gback, gdoffset + 8); + YMM0(gd); + break; + case 0xC2: + INST_NAME("VCMPSS Gx, Vx, Ex, Ib"); + nextop = F8; + GETEX(x1, 0, 1); + GETGX(); + GETVX(); + GETGY(); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + FLW(d0, vback, vxoffset); + FLW(d1, wback, fixedaddress); + u8 = F8; + if ((u8 & 7) == 0) { // Equal + FEQS(x2, d0, d1); + } else if ((u8 & 7) == 4) { // Not Equal or unordered + FEQS(x2, d0, d1); + XORI(x2, x2, 1); + } else { + // x2 = !(isnan(d0) || isnan(d1)) + FEQS(x3, d0, d0); + FEQS(x2, d1, d1); + AND(x2, x2, x3); + + switch (u8 & 7) { + case 1: + BEQ_MARK(x2, xZR); + FLTS(x2, d0, d1); + break; // Less than + case 2: + BEQ_MARK(x2, xZR); + FLES(x2, d0, d1); + break; // Less or equal + case 3: XORI(x2, x2, 1); break; // NaN + case 5: { // Greater or equal or unordered + BEQ_MARK2(x2, xZR); + FLES(x2, d1, d0); + B_MARK_nocond; + break; + } + case 6: { // Greater or unordered, test inverted, N!=V so unordered or less than (inverted) + BEQ_MARK2(x2, xZR); + FLTS(x2, d1, d0); + B_MARK_nocond; + break; + } + case 7: break; // Not NaN + } + + MARK2; + if ((u8 & 7) == 5 || (u8 & 7) == 6) { + MOV32w(x2, 1); + } + MARK; + } + NEG(x2, x2); + SW(x2, gback, gdoffset); + if (gd != vex.v) { + LWU(x2, vback, vxoffset + 4); + SW(x2, gback, gdoffset + 4); + LD(x2, vback, vxoffset + 8); + SD(x2, gback, gdoffset + 8); + } + YMM0(gd); + break; + default: + DEFAULT; + } + return addr; +} diff --git a/src/dynarec/rv64/dynarec_rv64_consts.c b/src/dynarec/rv64/dynarec_rv64_consts.c new file mode 100644 index 0000000..f864566 --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_consts.c @@ -0,0 +1,144 @@ +#include +#include + +#include "dynarec_rv64_consts.h" +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "emu/x87emu_private.h" +#include "emu/x64primop.h" +#include "my_cpuid.h" +#include "freq.h" +#include "debug.h" +#include "custommem.h" +#include "dynarec_rv64_functions.h" +#include "emu/x64shaext.h" +#include "emu/x87emu_private.h" +#include "emu/x64compstrings.h" +#include "x64test.h" +#include "dynarec/dynarec_next.h" +#include "bitutils.h" +#include "random.h" + +#ifndef HAVE_TRACE +void PrintTrace() {} +#endif + +uintptr_t getConst(rv64_consts_t which) +{ + switch(which) { + case const_none: dynarec_log(LOG_NONE, "Warning, const none used\n"); + return 0; + case const_daa8: return (uintptr_t)daa8; + case const_das8: return (uintptr_t)das8; + case const_aaa16: return (uintptr_t)aaa16; + case const_aas16: return (uintptr_t)aas16; + case const_aam16: return (uintptr_t)aam16; + case const_aad16: return (uintptr_t)aad16; + case const_native_br: return (uintptr_t)native_br; + case const_native_ud: return (uintptr_t)native_ud; + case const_native_priv: return (uintptr_t)native_priv; + case const_native_int3: return (uintptr_t)native_int3; + case const_native_int: return (uintptr_t)native_int; + case const_native_div0: return (uintptr_t)native_div0; + case const_native_fprem: return (uintptr_t)native_fprem; + case const_native_fprem1: return (uintptr_t)native_fprem1; + case const_native_frstor16: return (uintptr_t)native_frstor16; + case const_native_fsave16: return (uintptr_t)native_fsave16; + case const_native_fsave: return (uintptr_t)native_fsave; + case const_native_aesimc: return (uintptr_t)native_aesimc; + case const_native_aesd: return (uintptr_t)native_aesd; + case const_native_aesd_y: return (uintptr_t)native_aesd_y; + case const_native_aesdlast: return (uintptr_t)native_aesdlast; + case const_native_aesdlast_y: return (uintptr_t)native_aesdlast_y; + case const_native_aese: return (uintptr_t)native_aese; + case const_native_aese_y: return (uintptr_t)native_aese_y; + case const_native_aeselast: return (uintptr_t)native_aeselast; + case const_native_aeselast_y: return (uintptr_t)native_aeselast_y; + case const_native_aeskeygenassist: return (uintptr_t)native_aeskeygenassist; + case const_native_pclmul: return (uintptr_t)native_pclmul; + case const_native_pclmul_x: return (uintptr_t)native_pclmul_x; + case const_native_pclmul_y: return (uintptr_t)native_pclmul_y; + case const_native_f2xm1: return (uintptr_t)native_f2xm1; + case const_native_fyl2x: return (uintptr_t)native_fyl2x; + case const_native_fyl2xp1: return (uintptr_t)native_fyl2xp1; + case const_native_fxtract: return (uintptr_t)native_fxtract; + case const_native_ftan: return (uintptr_t)native_ftan; + case const_native_fpatan: return (uintptr_t)native_fpatan; + case const_native_fcos: return (uintptr_t)native_fcos; + case const_native_fsin: return (uintptr_t)native_fsin; + case const_native_fsincos: return (uintptr_t)native_fsincos; + case const_native_fscale: return (uintptr_t)native_fscale; + case const_native_fld: return (uintptr_t)native_fld; + case const_native_fstp: return (uintptr_t)native_fstp; + case const_native_frstor: return (uintptr_t)native_frstor; + case const_native_next: return (uintptr_t)native_next; + case const_int3: return (uintptr_t)EmuInt3; + case const_x86syscall: return (uintptr_t)EmuX86Syscall; + case const_x64syscall: return (uintptr_t)EmuX64Syscall; + case const_x64syscall_linux: return (uintptr_t)EmuX64Syscall_linux; + case const_rcl8: return (uintptr_t)rcl8; + case const_rcl16: return (uintptr_t)rcl16; + case const_rcl32: return (uintptr_t)rcl32; + case const_rcl64: return (uintptr_t)rcl64; + case const_rcr8: return (uintptr_t)rcr8; + case const_rcr16: return (uintptr_t)rcr16; + case const_rcr32: return (uintptr_t)rcr32; + case const_rcr64: return (uintptr_t)rcr64; + case const_rol8: return (uintptr_t)rol8; + case const_rol16: return (uintptr_t)rol16; + case const_ror8: return (uintptr_t)ror8; + case const_ror16: return (uintptr_t)ror16; + case const_div64: return (uintptr_t)div64; + case const_div8: return (uintptr_t)div8; + case const_idiv64: return (uintptr_t)idiv64; + case const_idiv8: return (uintptr_t)idiv8; + case const_random32: return (uintptr_t)get_random32; + case const_random64: return (uintptr_t)get_random64; + case const_readtsc: return (uintptr_t)ReadTSC; + case const_helper_getcpu: return (uintptr_t)helper_getcpu; + case const_cpuid: return (uintptr_t)my_cpuid; + case const_getsegmentbase: return (uintptr_t)GetSegmentBaseEmu; + case const_updateflags: return (uintptr_t)UpdateFlags; + case const_reset_fpu: return (uintptr_t)reset_fpu; + case const_sha1nexte: return (uintptr_t)sha1nexte; + case const_sha1msg1: return (uintptr_t)sha1msg1; + case const_sha1msg2: return (uintptr_t)sha1msg2; + case const_sha1rnds4: return (uintptr_t)sha1rnds4; + case const_sha256msg1: return (uintptr_t)sha256msg1; + case const_sha256msg2: return (uintptr_t)sha256msg2; + case const_sha256rnds2: return (uintptr_t)sha256rnds2; + case const_fpu_loadenv: return (uintptr_t)fpu_loadenv; + case const_fpu_savenv: return (uintptr_t)fpu_savenv; + case const_fpu_fxsave32: return (uintptr_t)fpu_fxsave32; + case const_fpu_fxsave64: return (uintptr_t)fpu_fxsave64; + case const_fpu_fxrstor32: return (uintptr_t)fpu_fxrstor32; + case const_fpu_fxrstor64: return (uintptr_t)fpu_fxrstor64; + case const_fpu_xsave: return (uintptr_t)fpu_xsave; + case const_fpu_xrstor: return (uintptr_t)fpu_xrstor; + case const_fpu_fbld: return (uintptr_t)fpu_fbld; + case const_fpu_fbst: return (uintptr_t)fpu_fbst; + case const_sse42_compare_string_explicit_len: return (uintptr_t)sse42_compare_string_explicit_len; + case const_sse42_compare_string_implicit_len: return (uintptr_t)sse42_compare_string_implicit_len; + case const_x64test_step: return (uintptr_t)x64test_step; + case const_printtrace: return (uintptr_t)PrintTrace; + case const_epilog: return (uintptr_t)native_epilog; + case const_epilog_fast: return (uintptr_t)native_epilog_fast; + case const_jmptbl32: return getJumpTable32(); + case const_jmptbl48: return getJumpTable48(); + case const_jmptbl64: return getJumpTable64(); + case const_context: return (uintptr_t)my_context; + case const_lead0tab: return (uintptr_t)lead0tab; + case const_deBruijn64tab: return (uintptr_t)deBruijn64tab; + + case const_last: dynarec_log(LOG_NONE, "Warning, const last used\n"); + return 0; + } + dynarec_log(LOG_NONE, "Warning, Unknown const %d used\n", which); + return 0; +} \ No newline at end of file diff --git a/src/dynarec/rv64/dynarec_rv64_consts.h b/src/dynarec/rv64/dynarec_rv64_consts.h new file mode 100644 index 0000000..3dfb82b --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_consts.h @@ -0,0 +1,117 @@ +#ifndef __DYNAREC_RV64_CONSTS__ +#define __DYNAREC_RV64_CONSTS__ +#include + +typedef enum rv64_consts_s { + const_none, + const_daa8, + const_das8, + const_aaa16, + const_aas16, + const_aam16, + const_aad16, + const_native_br, + const_native_ud, + const_native_priv, + const_native_int3, + const_native_int, + const_native_div0, + const_native_fprem, + const_native_fprem1, + const_native_frstor16, + const_native_fsave16, + const_native_fsave, + const_native_aesimc, + const_native_aesd, + const_native_aesd_y, + const_native_aesdlast, + const_native_aesdlast_y, + const_native_aese, + const_native_aese_y, + const_native_aeselast, + const_native_aeselast_y, + const_native_aeskeygenassist, + const_native_pclmul, + const_native_pclmul_x, + const_native_pclmul_y, + const_native_f2xm1, + const_native_fyl2x, + const_native_fyl2xp1, + const_native_fxtract, + const_native_ftan, + const_native_fpatan, + const_native_fcos, + const_native_fsin, + const_native_fsincos, + const_native_fscale, + const_native_fld, + const_native_fstp, + const_native_frstor, + const_native_next, + const_int3, + const_x86syscall, + const_x64syscall, + const_x64syscall_linux, + const_rcl8, + const_rcl16, + const_rcl32, + const_rcl64, + const_rcr8, + const_rcr16, + const_rcr32, + const_rcr64, + const_rol8, + const_rol16, + const_ror8, + const_ror16, + const_div64, + const_div8, + const_idiv64, + const_idiv8, + const_random32, + const_random64, + const_readtsc, + const_helper_getcpu, + const_cpuid, + const_getsegmentbase, + const_updateflags, + const_reset_fpu, + const_sha1nexte, + const_sha1msg1, + const_sha1msg2, + const_sha1rnds4, + const_sha256msg1, + const_sha256msg2, + const_sha256rnds2, + const_fpu_loadenv, + const_fpu_savenv, + const_fpu_fxsave32, + const_fpu_fxsave64, + const_fpu_fxrstor32, + const_fpu_fxrstor64, + const_fpu_xsave, + const_fpu_xrstor, + const_fpu_fbld, + const_fpu_fbst, + const_sse42_compare_string_explicit_len, + const_sse42_compare_string_implicit_len, + const_x64test_step, + const_printtrace, + const_epilog, + const_epilog_fast, + const_jmptbl32, + const_jmptbl48, + const_jmptbl64, + const_context, + const_lead0tab, + const_deBruijn64tab, + + const_last +} rv64_consts_t; + +uintptr_t getConst(rv64_consts_t which); + +// temporary define... +#define const_PrintTrace const_printtrace + +#endif //__DYNAREC_RV64_CONSTS__ \ No newline at end of file diff --git a/src/dynarec/rv64/dynarec_rv64_d8.c b/src/dynarec/rv64/dynarec_rv64_d8.c index 885eebf..80eeae1 100644 --- a/src/dynarec/rv64/dynarec_rv64_d8.c +++ b/src/dynarec/rv64/dynarec_rv64_d8.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,13 +17,14 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_rv64_functions.h" -uintptr_t dynarec64_D8(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_D8(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; + (void)need_epilog; uint8_t nextop = F8; uint8_t ed; @@ -41,197 +40,236 @@ uintptr_t dynarec64_D8(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MAYUSE(v2); MAYUSE(v1); - switch(nextop) { - case 0xC0 ... 0xC7: - INST_NAME("FADD ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - if(ST_IS_F(0)) { - FADDS(v1, v1, v2); - } else { - FADDD(v1, v1, v2); - } - break; - case 0xC8 ... 0xCF: - INST_NAME("FMUL ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FMULS(v1, v1, v2); - } else { - FMULD(v1, v1, v2); - } - break; - case 0xD0 ... 0xD7: - INST_NAME("FCOM ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FCOMS(v1, v2, x1, x2, x3, x4, x5); - } else { - FCOMD(v1, v2, x1, x2, x3, x4, x5); - } - break; - case 0xD8 ... 0xDF: - INST_NAME("FCOMP ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if(ST_IS_F(0)) { - FCOMS(v1, v2, x1, x2, x3, x4, x5); - } else { - FCOMD(v1, v2, x1, x2, x3, x4, x5); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xE0 ... 0xE7: - INST_NAME("FSUB ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - if(ST_IS_F(0)) { - FSUBS(v1, v1, v2); - } else { - FSUBD(v1, v1, v2); - } - break; - case 0xE8 ... 0xEF: - INST_NAME("FSUBR ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FSUBS(v1, v2, v1); - } else { - FSUBD(v1, v2, v1); - } - break; - case 0xF0 ... 0xF7: - INST_NAME("FDIV ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if(ST_IS_F(0)) { - FDIVS(v1, v1, v2); - } else { - FDIVD(v1, v1, v2); - } - break; - case 0xF8 ... 0xFF: - INST_NAME("FDIVR ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FDIVS(v1, v2, v1); - } else { - FDIVD(v1, v2, v1); - } - break; - - default: - switch((nextop>>3)&7) { - case 0: - INST_NAME("FADD ST0, float[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - s0 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLW(s0, ed, fixedaddress); - if(ST_IS_F(0)) { - FADDS(v1, v1, s0); - } else { - FCVTDS(s0, s0); - FADDD(v1, v1, s0); - } - break; - case 1: - INST_NAME("FMUL ST0, float[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - s0 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLW(s0, ed, fixedaddress); - if(ST_IS_F(0)) { - FMULS(v1, v1, s0); - } else { - FCVTDS(s0, s0); - FMULD(v1, v1, s0); - } - break; - case 2: - INST_NAME("FCOM ST0, float[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - s0 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLW(s0, ed, fixedaddress); - if (ST_IS_F(0)) { - FCOMS(v1, s0, x1, x6, x3, x4, x5); - } else { - FCVTDS(s0, s0); - FCOMD(v1, s0, x1, x6, x3, x4, x5); - } - break; - case 3: - INST_NAME("FCOMP ST0, float[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - s0 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLW(s0, ed, fixedaddress); - if (ST_IS_F(0)) { - FCOMS(v1, s0, x1, x6, x3, x4, x5); - } else { - FCVTDS(s0, s0); - FCOMD(v1, s0, x1, x6, x3, x4, x5); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 4: - INST_NAME("FSUB ST0, float[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - s0 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLW(s0, ed, fixedaddress); - if(ST_IS_F(0)) { - FSUBS(v1, v1, s0); - } else { - FCVTDS(s0, s0); - FSUBD(v1, v1, s0); - } - break; - case 5: - INST_NAME("FSUBR ST0, float[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - s0 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLW(s0, ed, fixedaddress); - if (ST_IS_F(0)) { - FSUBS(v1, s0, v1); - } else { - FCVTDS(s0, s0); - FSUBD(v1, s0, v1); - } - break; - case 6: - INST_NAME("FDIV ST0, float[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - s0 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLW(s0, ed, fixedaddress); - if(ST_IS_F(0)) { - FDIVS(v1, v1, s0); - } else { - FCVTDS(s0, s0); - FDIVD(v1, v1, s0); - } - break; - case 7: - INST_NAME("FDIVR ST0, float[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - s0 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLW(s0, ed, fixedaddress); - if (ST_IS_F(0)) { - FDIVS(v1, s0, v1); - } else { - FCVTDS(s0, s0); - FDIVD(v1, s0, v1); - } - break; - } - } + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FADD ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FADDS(v1, v1, v2); + } else { + FADDD(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xC8 ... 0xCF: + INST_NAME("FMUL ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FMULS(v1, v1, v2); + } else { + FMULD(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xD0 ... 0xD7: + INST_NAME("FCOM ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3, x4, x5); + } else { + FCOMD(v1, v2, x1, x2, x3, x4, x5); + } + break; + case 0xD8 ... 0xDF: + INST_NAME("FCOMP ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3, x4, x5); + } else { + FCOMD(v1, v2, x1, x2, x3, x4, x5); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE0 ... 0xE7: + INST_NAME("FSUB ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FSUBS(v1, v1, v2); + } else { + FSUBD(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xE8 ... 0xEF: + INST_NAME("FSUBR ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FSUBS(v1, v2, v1); + } else { + FSUBD(v1, v2, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xF0 ... 0xF7: + INST_NAME("FDIV ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FDIVS(v1, v1, v2); + } else { + FDIVD(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xF8 ... 0xFF: + INST_NAME("FDIVR ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { + FDIVS(v1, v2, v1); + } else { + FDIVD(v1, v2, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + default: + DEFAULT; + break; + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FADD ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLW(s0, ed, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + if (ST_IS_F(0)) { + FADDS(v1, v1, s0); + } else { + FCVTDS(s0, s0); + FADDD(v1, v1, s0); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 1: + INST_NAME("FMUL ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLW(s0, ed, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + if (ST_IS_F(0)) { + FMULS(v1, v1, s0); + } else { + FCVTDS(s0, s0); + FMULD(v1, v1, s0); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 2: + INST_NAME("FCOM ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLW(s0, ed, fixedaddress); + if (ST_IS_F(0)) { + FCOMS(v1, s0, x1, x6, x3, x4, x5); + } else { + FCVTDS(s0, s0); + FCOMD(v1, s0, x1, x6, x3, x4, x5); + } + break; + case 3: + INST_NAME("FCOMP ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLW(s0, ed, fixedaddress); + if (ST_IS_F(0)) { + FCOMS(v1, s0, x1, x6, x3, x4, x5); + } else { + FCVTDS(s0, s0); + FCOMD(v1, s0, x1, x6, x3, x4, x5); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FSUB ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLW(s0, ed, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + if (ST_IS_F(0)) { + FSUBS(v1, v1, s0); + } else { + FCVTDS(s0, s0); + FSUBD(v1, v1, s0); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 5: + INST_NAME("FSUBR ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLW(s0, ed, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + if (ST_IS_F(0)) { + FSUBS(v1, s0, v1); + } else { + FCVTDS(s0, s0); + FSUBD(v1, s0, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 6: + INST_NAME("FDIV ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLW(s0, ed, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + if (ST_IS_F(0)) { + FDIVS(v1, v1, s0); + } else { + FCVTDS(s0, s0); + FDIVD(v1, v1, s0); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 7: + INST_NAME("FDIVR ST0, float[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + s0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLW(s0, ed, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + if (ST_IS_F(0)) { + FDIVS(v1, s0, v1); + } else { + FCVTDS(s0, s0); + FDIVD(v1, s0, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + } return addr; } diff --git a/src/dynarec/rv64/dynarec_rv64_d9.c b/src/dynarec/rv64/dynarec_rv64_d9.c index f600bb4..a70a8af 100644 --- a/src/dynarec/rv64/dynarec_rv64_d9.c +++ b/src/dynarec/rv64/dynarec_rv64_d9.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,13 +17,14 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_rv64_functions.h" -uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; + (void)need_epilog; uint8_t nextop = F8; uint8_t ed; @@ -44,222 +43,208 @@ uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MAYUSE(v2); MAYUSE(j64); - switch(nextop) { - case 0xC0: - case 0xC1: - case 0xC2: - case 0xC3: - case 0xC4: - case 0xC5: - case 0xC6: - case 0xC7: - INST_NAME("FLD STx"); - X87_PUSH_OR_FAIL(v2, dyn, ninst, x1, X87_ST(nextop&7)); - v1 = x87_get_st(dyn, ninst, x1, x2, (nextop&7)+1, X87_COMBINE(0, (nextop&7)+1)); - if(ST_IS_F(0)) { - FMVS(v2, v1); - } else { - FMVD(v2, v1); - } - break; + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FLD STx"); + X87_PUSH_OR_FAIL(v2, dyn, ninst, x1, X87_ST(nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, (nextop & 7) + 1, X87_COMBINE(0, (nextop & 7) + 1)); + if (ST_IS_F(0)) { + FMVS(v2, v1); + } else { + FMVD(v2, v1); + } + break; - case 0xC8: - INST_NAME("FXCH ST0"); - break; - case 0xC9: - case 0xCA: - case 0xCB: - case 0xCC: - case 0xCD: - case 0xCE: - case 0xCF: - INST_NAME("FXCH STx"); - // swap the cache value, not the double value itself :p - x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_ST(nextop&7)); - x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - x87_swapreg(dyn, ninst, x1, x2, 0, nextop&7); - // should set C1 to 0 - break; + case 0xC8: + INST_NAME("FXCH ST0"); + break; + case 0xC9 ... 0xCF: + INST_NAME("FXCH STx"); + // swap the cache value, not the double value itself :p + x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_ST(nextop & 7)); + x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + x87_swapreg(dyn, ninst, x1, x2, 0, nextop & 7); + // should set C1 to 0 + break; - case 0xD0: - INST_NAME("FNOP"); - break; - - case 0xD8: - INST_NAME("FSTPNCE ST0, ST0"); - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xD9: - case 0xDA: - case 0xDB: - case 0xDC: - case 0xDD: - case 0xDE: - case 0xDF: - INST_NAME("FSTPNCE ST0, STx"); - // copy the cache value for st0 to stx - x87_get_st_empty(dyn, ninst, x1, x2, nextop&7, X87_ST(nextop&7)); - x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - x87_swapreg(dyn, ninst, x1, x2, 0, nextop&7); - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xE0: - INST_NAME("FCHS"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - if(ST_IS_F(0)) { - FNEGS(v1, v1); - } else { - FNEGD(v1, v1); - } - break; - case 0xE1: - INST_NAME("FABS"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - if(ST_IS_F(0)) { - FABSS(v1, v1); - } else { - FABSD(v1, v1); - } - break; + case 0xD0: + INST_NAME("FNOP"); + break; - case 0xE4: - INST_NAME("FTST"); - DEFAULT - break; - case 0xE5: - INST_NAME("FXAM"); - #if 1 - i1 = x87_get_current_cache(dyn, ninst, 0, EXT_CACHE_ST_D); - // value put in x14 - if(i1==-1) { - if(fpu_is_st_freed(dyn, ninst, 0)) { - MOV32w(x4, 0b100000100000000); - B_MARK3_nocond; + case 0xD8: + INST_NAME("FSTPNCE ST0, ST0"); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xD9 ... 0xDF: + INST_NAME("FSTPNCE ST0, STx"); + // copy the cache value for st0 to stx + x87_get_st_empty(dyn, ninst, x1, x2, nextop & 7, X87_ST(nextop & 7)); + x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + x87_swapreg(dyn, ninst, x1, x2, 0, nextop & 7); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE0: + INST_NAME("FCHS"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + if (ST_IS_F(0)) { + FNEGS(v1, v1); } else { - // not in cache, so check Empty status and load it - i2 = -dyn->e.x87stack; - LWU(x3, xEmu, offsetof(x64emu_t, fpu_stack)); - if(i2) { - ADDI(x3, x3, i2); - } - MOV32w(x4, 0b100000100000000); // empty: C3,C2,C0 = 101 - BGE_MARK3(xZR, x3); - // x5 will be the actual top - LWU(x5, xEmu, offsetof(x64emu_t, top)); - if(i2) { - ADDI(x5, x5, i2); - ANDI(x5, x5, 7); // (emu->top + i)&7 - } - // load tag - LHU(x3, xEmu, offsetof(x64emu_t, fpu_tags)); - if (i2 < 0) { - SLLI(x3, x3, -i2 * 2); - } else if (i2 > 0) { - LUI(x2, 0xffff0); - OR(x3, x3, x2); - SRLI(x3, x3, i2 * 2); + FNEGD(v1, v1); + } + break; + case 0xE1: + INST_NAME("FABS"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + if (ST_IS_F(0)) { + FABSS(v1, v1); + } else { + FABSD(v1, v1); + } + break; + + case 0xE4: + INST_NAME("FTST"); + DEFAULT; + break; + case 0xE5: + INST_NAME("FXAM"); +#if 1 + i1 = x87_get_current_cache(dyn, ninst, 0, EXT_CACHE_ST_D); + // value put in x4 + if (i1 == -1) { + if (fpu_is_st_freed(dyn, ninst, 0)) { + MOV32w(x4, 0b100000100000000); + B_MARK3_nocond; + } else { + // not in cache, so check Empty status and load it + i2 = -dyn->e.x87stack; + LWU(x3, xEmu, offsetof(x64emu_t, fpu_stack)); + if (i2) { + SUBI(x3, x3, i2); + } + MOV32w(x4, 0b100000100000000); // empty: C3,C2,C0 = 101 + BGE_MARK3(xZR, x3); + // x5 will be the actual top + LWU(x5, xEmu, offsetof(x64emu_t, top)); + if (i2) { + ADDI(x5, x5, i2); + ANDI(x5, x5, 7); // (emu->top + i)&7 + } + // load x2 with ST0 anyway, for sign extraction + if (cpuext.zba) + SH3ADD(x1, x5, xEmu); + else { + SLLI(x5, x5, 3); + ADD(x1, xEmu, x5); + } + LD(x2, x1, offsetof(x64emu_t, x87)); + // load tag + if (i2 >= 0) { + LHU(x3, xEmu, offsetof(x64emu_t, fpu_tags)); + if (i2 > 0) { + LUI(x5, 0xffff0); + OR(x3, x3, x5); + SRLI(x3, x3, i2 * 2); + } + ANDI(x3, x3, 0b11); + BNEZ_MARK3(x3); // empty: C3,C2,C0 = 101 + } } - ANDI(x2, x3, 0b11); - BNEZ_MARK3(x2); // empty: C3,C2,C0 = 101 - // load x2 with ST0 anyway, for sign extraction - if(rv64_zba) SH3ADD(x1, x5, xEmu); else {SLLI(x5, x5, 3); ADD(x1, xEmu, x5);} - LD(x2, x1, offsetof(x64emu_t, x87)); + } else { + // simply move from cache reg to x2 + v1 = dyn->e.x87reg[i1]; + FMVXD(x2, v1); } - } else { - // simply move from cache reg to x2 - v1 = dyn->e.x87reg[i1]; - FMVXD(x2, v1); - } - // get exponant in x1 - SRLI(x1, x2, 20+32); - ANDI(x1, x1, 0x7ff); // 0x7ff - BNEZ_MARK(x1); // not zero or denormal - MOV64x(x3, 0x7fffffffffffffff); - AND(x1, x2, x3); - MOV32w(x4, 0b100000000000000); // Zero: C3,C2,C0 = 100 - BEQZ_MARK3(x1); - MOV32w(x4, 0b100010000000000); // Denormal: C3,C2,C0 = 110 - B_MARK3_nocond; - MARK; - ADDI(x3, xZR, 0x7ff); // infinite/NaN? - MOV32w(x4, 0b000010000000000); // normal: C3,C2,C0 = 010 - BNE_MARK3(x1, x3); - SLLI(x3, x2, 12); - SRLI(x3, x3, 12); // and 0x000fffffffffffff - MOV32w(x4, 0b000010100000000); // infinity: C3,C2,C0 = 011 - BEQZ_MARK3(x3); - MOV32w(x4, 0b000000100000000); // NaN: C3,C2,C0 = 001 - MARK3; - // Extract signa & Update SW - SRLI(x1, x2, 63); - SLLI(x1, x1, 9); - OR(x4, x4, x1); //C1 - LHU(x1, xEmu, offsetof(x64emu_t, sw)); - MOV32w(x2, ~0b0100011100000000); - AND(x1, x1, x2); - OR(x4, x4, x1); - SH(x4, xEmu, offsetof(x64emu_t, sw)); - #else - MESSAGE(LOG_DUMP, "Need Optimization\n"); - x87_refresh(dyn, ninst, x1, x2, 0); - s0 = x87_stackcount(dyn, ninst, x1); - CALL(fpu_fxam, -1); // should be possible inline, but is it worth it? - x87_unstackcount(dyn, ninst, x1, s0); - #endif - break; + // get exponant in x1 + SRLI(x1, x2, 20 + 32); + ANDI(x1, x1, 0x7ff); // 0x7ff + BNEZ_MARK(x1); // not zero or denormal + MOV64x(x3, 0x7fffffffffffffff); + AND(x1, x2, x3); + MOV32w(x4, 0b100000000000000); // Zero: C3,C2,C0 = 100 + BEQZ_MARK3(x1); + MOV32w(x4, 0b100010000000000); // Denormal: C3,C2,C0 = 110 + B_MARK3_nocond; + MARK; + ADDI(x3, xZR, 0x7ff); // infinite/NaN? + MOV32w(x4, 0b000010000000000); // normal: C3,C2,C0 = 010 + BNE_MARK3(x1, x3); + SLLI(x3, x2, 12); + SRLI(x3, x3, 12); // and 0x000fffffffffffff + MOV32w(x4, 0b000010100000000); // infinity: C3,C2,C0 = 011 + BEQZ_MARK3(x3); + MOV32w(x4, 0b000000100000000); // NaN: C3,C2,C0 = 001 + MARK3; + // Extract sign & Update SW + SRLI(x1, x2, 63); + SLLI(x1, x1, 9); + OR(x4, x4, x1); // C1 + LHU(x1, xEmu, offsetof(x64emu_t, sw)); + MOV32w(x2, ~0b0100011100000000); + AND(x1, x1, x2); + OR(x4, x4, x1); + SH(x4, xEmu, offsetof(x64emu_t, sw)); +#else + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_refresh(dyn, ninst, x1, x2, 0); + s0 = x87_stackcount(dyn, ninst, x1); + CALL(fpu_fxam, -1, 0, 0); // should be possible inline, but is it worth it? + x87_unstackcount(dyn, ninst, x1, s0); +#endif + break; - case 0xE8: - INST_NAME("FLD1"); - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_F); - if(ST_IS_F(0)) { - MOV32w(x1, 0x3f800000); - FMVWX(v1, x1); - } else { - MOV64x(x1, 0x3FF0000000000000); - FMVDX(v1, x1); - } - break; - case 0xE9: - INST_NAME("FLDL2T"); - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); - FTABLE64(v1, L2T); - break; - case 0xEA: - INST_NAME("FLDL2E"); - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); - FTABLE64(v1, L2E); - break; - case 0xEB: - INST_NAME("FLDPI"); - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); - FTABLE64(v1, PI); - break; - case 0xEC: - INST_NAME("FLDLG2"); - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); - FTABLE64(v1, LG2); - break; - case 0xED: - INST_NAME("FLDLN2"); - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); - FTABLE64(v1, LN2); - break; - case 0xEE: - INST_NAME("FLDZ"); - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_F); - if(ST_IS_F(0)) { - FMVWX(v1, xZR); - } else { - FMVDX(v1, xZR); - } - break; + case 0xE8: + INST_NAME("FLD1"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_F); + if (ST_IS_F(0)) { + MOV32w(x1, 0x3f800000); + FMVWX(v1, x1); + } else { + MOV64x(x1, 0x3FF0000000000000); + FMVDX(v1, x1); + } + break; + case 0xE9: + INST_NAME("FLDL2T"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); + FTABLE64(v1, L2T); + break; + case 0xEA: + INST_NAME("FLDL2E"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); + FTABLE64(v1, L2E); + break; + case 0xEB: + INST_NAME("FLDPI"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); + FTABLE64(v1, PI); + break; + case 0xEC: + INST_NAME("FLDLG2"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); + FTABLE64(v1, LG2); + break; + case 0xED: + INST_NAME("FLDLN2"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); + FTABLE64(v1, LN2); + break; + case 0xEE: + INST_NAME("FLDZ"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_F); + if (ST_IS_F(0)) + FMVWX(v1, xZR); + else + FMVDX(v1, xZR); + break; case 0xF0: INST_NAME("F2XM1"); MESSAGE(LOG_DUMP, "Need Optimization\n"); x87_forget(dyn, ninst, x1, x2, 0); s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_f2xm1, -1); + CALL(const_native_f2xm1, -1, 0, 0); x87_unstackcount(dyn, ninst, x3, s0); break; case 0xF1: @@ -268,7 +253,7 @@ uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni x87_forget(dyn, ninst, x1, x2, 0); x87_forget(dyn, ninst, x1, x2, 1); s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_fyl2x, -1); + CALL(const_native_fyl2x, -1, 0, 0); x87_unstackcount(dyn, ninst, x3, s0); X87_POP_OR_FAIL(dyn, ninst, x3); break; @@ -277,10 +262,12 @@ uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MESSAGE(LOG_DUMP, "Need Optimization\n"); x87_forget(dyn, ninst, x1, x2, 0); s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_ftan, -1); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + CALL_(const_native_ftan, -1, BOX64ENV(dynarec_fastround) ? 0 : u8, 0, 0); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); x87_unstackcount(dyn, ninst, x3, s0); X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_F); - if(ST_IS_F(0)) { + if (ST_IS_F(0)) { MOV32w(x1, 0x3f800000); FMVWX(v1, x1); } else { @@ -294,17 +281,19 @@ uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni x87_forget(dyn, ninst, x1, x2, 0); x87_forget(dyn, ninst, x1, x2, 1); s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_fpatan, -1); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + CALL_(const_native_fpatan, -1, BOX64ENV(dynarec_fastround) ? 0 : u8, 0, 0); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); x87_unstackcount(dyn, ninst, x3, s0); X87_POP_OR_FAIL(dyn, ninst, x3); break; case 0xF4: INST_NAME("FXTRACT"); MESSAGE(LOG_DUMP, "Need Optimization\n"); - X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, 0); + X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, x3); x87_forget(dyn, ninst, x1, x2, 1); s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_fxtract, -1); + CALL(const_native_fxtract, -1, 0, 0); x87_unstackcount(dyn, ninst, x3, s0); break; case 0xF5: @@ -313,7 +302,7 @@ uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni x87_forget(dyn, ninst, x1, x2, 0); x87_forget(dyn, ninst, x1, x2, 1); s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_fprem1, -1); + CALL(const_native_fprem1, -1, 0, 0); x87_unstackcount(dyn, ninst, x3, s0); break; case 0xF6: @@ -338,7 +327,7 @@ uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni x87_forget(dyn, ninst, x1, x2, 0); x87_forget(dyn, ninst, x1, x2, 1); s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_fprem, -1); + CALL(const_native_fprem, -1, 0, 0); x87_unstackcount(dyn, ninst, x3, s0); break; case 0xF9: @@ -347,26 +336,31 @@ uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni x87_forget(dyn, ninst, x1, x2, 0); x87_forget(dyn, ninst, x1, x2, 1); s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_fyl2xp1, -1); + CALL(const_native_fyl2xp1, -1, 0, 0); x87_unstackcount(dyn, ninst, x3, s0); X87_POP_OR_FAIL(dyn, ninst, x3); break; case 0xFA: INST_NAME("FSQRT"); v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - if(ST_IS_F(0)) { + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + if (ST_IS_F(0)) { FSQRTS(v1, v1); } else { FSQRTD(v1, v1); } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); break; case 0xFB: INST_NAME("FSINCOS"); MESSAGE(LOG_DUMP, "Need Optimization\n"); - X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, 0); + X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, x3); x87_forget(dyn, ninst, x1, x2, 1); s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_fsincos, -1); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + CALL_(const_native_fsincos, -1, BOX64ENV(dynarec_fastround) ? 0 : u8, 0, 0); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); x87_unstackcount(dyn, ninst, x3, s0); break; case 0xFC: @@ -376,7 +370,7 @@ uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni v2 = fpu_get_scratch(dyn); u8 = x87_setround(dyn, ninst, x1, x2); - if(ST_IS_F(0)) { + if (ST_IS_F(0)) { FEQS(x2, v0, v0); BNEZ_MARK(x2); B_NEXT_nocond; @@ -415,7 +409,9 @@ uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni x87_forget(dyn, ninst, x1, x2, 0); x87_forget(dyn, ninst, x1, x2, 1); s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_fscale, -1); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + CALL_(const_native_fscale, -1, BOX64ENV(dynarec_fastround) ? 0 : u8, 0, 0); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); x87_unstackcount(dyn, ninst, x3, s0); break; case 0xFE: @@ -423,7 +419,9 @@ uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MESSAGE(LOG_DUMP, "Need Optimization\n"); x87_forget(dyn, ninst, x1, x2, 0); s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_fsin, -1); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + CALL_(const_native_fsin, -1, BOX64ENV(dynarec_fastround) ? 0 : u8, 0, 0); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); x87_unstackcount(dyn, ninst, x3, s0); break; case 0xFF: @@ -431,95 +429,88 @@ uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MESSAGE(LOG_DUMP, "Need Optimization\n"); x87_forget(dyn, ninst, x1, x2, 0); s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_fcos, -1); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + CALL_(const_native_fcos, -1, BOX64ENV(dynarec_fastround) ? 0 : u8, 0, 0); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); x87_unstackcount(dyn, ninst, x3, s0); break; - - - case 0xD1: - case 0xD4: - case 0xD5: - case 0xD6: - case 0xD7: - case 0xE2: - case 0xE3: - case 0xE6: - case 0xE7: - case 0xEF: + default: DEFAULT; break; - - default: - switch((nextop>>3)&7) { - case 0: - INST_NAME("FLD ST0, float[ED]"); - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, box64_dynarec_x87double?EXT_CACHE_ST_D:EXT_CACHE_ST_F); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLW(v1, ed, fixedaddress); - if(!ST_IS_F(0)) { - FCVTDS(v1, v1); - } - break; - case 2: - INST_NAME("FST float[ED], ST0"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_F); - if(ST_IS_F(0)) - s0 = v1; - else { - s0 = fpu_get_scratch(dyn); - FCVTSD(s0, v1); - } - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FSW(s0, ed, fixedaddress); - break; - case 3: - INST_NAME("FSTP float[ED], ST0"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_F); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - if(!ST_IS_F(0)) { - FCVTSD(v1, v1); - } - FSW(v1, ed, fixedaddress); - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 4: - INST_NAME("FLDENV Ed"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); // maybe only x87, not SSE? - addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); - if(ed!=x1) { - MV(x1, ed); - } - MOV32w(x2, 0); - CALL(fpu_loadenv, -1); - break; - case 5: - INST_NAME("FLDCW Ew"); - GETEW(x1, 0); - SH(x1, xEmu, offsetof(x64emu_t, cw)); // hopefully cw is not too far for an imm8 - break; - case 6: - INST_NAME("FNSTENV Ed"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); // maybe only x87, not SSE? - addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); - if(ed!=x1) { - MV(x1, ed); - } - MOV32w(x2, 0); - CALL(fpu_savenv, -1); - break; - case 7: - INST_NAME("FNSTCW Ew"); - addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 0, 0); - ed = x1; - wb1 = 1; - LH(x1, xEmu, offsetof(x64emu_t, cw)); - EWBACK; - break; - default: - DEFAULT; - } - } + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FLD ST0, float[ED]"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, (BOX64ENV(dynarec_x87double)==1) ? EXT_CACHE_ST_D : EXT_CACHE_ST_F); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLW(v1, ed, fixedaddress); + if (!ST_IS_F(0)) { + FCVTDS(v1, v1); + } + break; + case 2: + INST_NAME("FST float[ED], ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_F); + if (ST_IS_F(0)) + s0 = v1; + else { + s0 = fpu_get_scratch(dyn); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x2); + FCVTSD(s0, v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + } + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FSW(s0, ed, fixedaddress); + break; + case 3: + INST_NAME("FSTP float[ED], ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_F); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + if (!ST_IS_F(0)) { + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x3); + FCVTSD(v1, v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + } + FSW(v1, ed, fixedaddress); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FLDENV Ed"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + fpu_purgecache(dyn, ninst, 0, x1, x2, x3); // maybe only x87, not SSE? + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + MOV32w(x2, 0); + CALL(const_fpu_loadenv, -1, ed, x2); + NATIVE_RESTORE_X87PC(); + break; + case 5: + INST_NAME("FLDCW Ew"); + GETEW(x1, 0); + SH(x1, xEmu, offsetof(x64emu_t, cw)); // hopefully cw is not too far for an imm8 + if (dyn->need_x87check) { + SRLI(x87pc, x1, 8); + ANDI(x87pc, x87pc, 0b11); + } + break; + case 6: + INST_NAME("FNSTENV Ed"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + fpu_purgecache(dyn, ninst, 0, x1, x2, x3); // maybe only x87, not SSE? + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + MOV32w(x2, 0); + CALL(const_fpu_savenv, -1, ed, x2); + break; + case 7: + INST_NAME("FNSTCW Ew"); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, NULL, 0, 0); + ed = x1; + wb1 = 1; + LH(x1, xEmu, offsetof(x64emu_t, cw)); + EWBACK; + break; + default: + DEFAULT; + } return addr; } diff --git a/src/dynarec/rv64/dynarec_rv64_da.c b/src/dynarec/rv64/dynarec_rv64_da.c index 648a5f9..e35eaf9 100644 --- a/src/dynarec/rv64/dynarec_rv64_da.c +++ b/src/dynarec/rv64/dynarec_rv64_da.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,15 +17,16 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_rv64_functions.h" -uintptr_t dynarec64_DA(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_DA(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { uint8_t nextop = F8; int64_t j64; uint8_t ed; + uint8_t u8; uint8_t wback; int v1, v2; int d0; @@ -42,184 +41,165 @@ uintptr_t dynarec64_DA(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MAYUSE(ed); MAYUSE(j64); - switch (nextop) { - case 0xC0: - case 0xC1: - case 0xC2: - case 0xC3: - case 0xC4: - case 0xC5: - case 0xC6: - case 0xC7: - INST_NAME("FCMOVB ST0, STx"); - READFLAGS(X_CF); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - ANDI(x1, xFlags, 1 << F_CF); - CBZ_NEXT(x1); - if (ST_IS_F(0)) - FMVS(v1, v2); - else - FMVD(v1, v2); - break; - case 0xC8: - case 0xC9: - case 0xCA: - case 0xCB: - case 0xCC: - case 0xCD: - case 0xCE: - case 0xCF: - INST_NAME("FCMOVE ST0, STx"); - READFLAGS(X_ZF); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - ANDI(x1, xFlags, 1 << F_ZF); - CBZ_NEXT(x1); - if (ST_IS_F(0)) - FMVS(v1, v2); - else - FMVD(v1, v2); - break; - case 0xD0: - case 0xD1: - case 0xD2: - case 0xD3: - case 0xD4: - case 0xD5: - case 0xD6: - case 0xD7: - INST_NAME("FCMOVBE ST0, STx"); - READFLAGS(X_CF | X_ZF); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - ANDI(x1, xFlags, (1 << F_CF) | (1 << F_ZF)); - CBZ_NEXT(x1); - if (ST_IS_F(0)) - FMVS(v1, v2); - else - FMVD(v1, v2); - break; - case 0xD8: - case 0xD9: - case 0xDA: - case 0xDB: - case 0xDC: - case 0xDD: - case 0xDE: - case 0xDF: - INST_NAME("FCMOVU ST0, STx"); - READFLAGS(X_PF); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - ANDI(x1, xFlags, (1 << F_PF)); - CBZ_NEXT(x1); - if (ST_IS_F(0)) - FMVS(v1, v2); - else - FMVD(v1, v2); - break; - case 0xE9: - INST_NAME("FUCOMPP ST0, ST1"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, 1, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FCOMS(v1, v2, x1, x2, x3, x4, x5); - } else { - FCOMD(v1, v2, x1, x2, x3, x4, x5); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xE4: - case 0xF0: - case 0xF1: - case 0xF4: - case 0xF5: - case 0xF6: - case 0xF7: - case 0xF8: - case 0xF9: - case 0xFD: + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FCMOVB ST0, STx"); + READFLAGS(X_CF); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + ANDI(x1, xFlags, 1 << F_CF); + CBZ_NEXT(x1); + if (ST_IS_F(0)) + FMVS(v1, v2); + else + FMVD(v1, v2); + break; + case 0xC8 ... 0xCF: + INST_NAME("FCMOVE ST0, STx"); + READFLAGS(X_ZF); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + ANDI(x1, xFlags, 1 << F_ZF); + CBZ_NEXT(x1); + if (ST_IS_F(0)) + FMVS(v1, v2); + else + FMVD(v1, v2); + break; + case 0xD0 ... 0xD7: + INST_NAME("FCMOVBE ST0, STx"); + READFLAGS(X_CF | X_ZF); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + ANDI(x1, xFlags, (1 << F_CF) | (1 << F_ZF)); + CBZ_NEXT(x1); + if (ST_IS_F(0)) + FMVS(v1, v2); + else + FMVD(v1, v2); + break; + case 0xD8 ... 0xDF: + INST_NAME("FCMOVU ST0, STx"); + READFLAGS(X_PF); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + ANDI(x1, xFlags, (1 << F_PF)); + CBZ_NEXT(x1); + if (ST_IS_F(0)) + FMVS(v1, v2); + else + FMVD(v1, v2); + break; + case 0xE9: + INST_NAME("FUCOMPP ST0, ST1"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, 1, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3, x4, x5); + } else { + FCOMD(v1, v2, x1, x2, x3, x4, x5); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + default: DEFAULT; break; - - default: - switch ((nextop >> 3) & 7) { - case 0: - INST_NAME("FIADD ST0, Ed"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - LW(x1, ed, fixedaddress); - FCVTDW(v2, x1, RD_RNE); // i32 -> double - FADDD(v1, v1, v2); - break; - case 1: - INST_NAME("FIMUL ST0, Ed"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - LW(x1, ed, fixedaddress); - FCVTDW(v2, x1, RD_RNE); // i32 -> double - FMULD(v1, v1, v2); - break; - case 2: - INST_NAME("FICOM ST0, Ed"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - LW(x1, ed, fixedaddress); - FCVTDW(v2, x1, RD_RNE); // i32 -> double - FCOMD(v1, v2, x1, x2, x3, x4, x5); - break; - case 3: - INST_NAME("FICOMP ST0, Ed"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - LW(x1, ed, fixedaddress); - FCVTDW(v2, x1, RD_RNE); // i32 -> double - FCOMD(v1, v2, x1, x2, x3, x4, x5); - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 4: - INST_NAME("FISUB ST0, Ed"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - LW(x1, ed, fixedaddress); - FCVTDW(v2, x1, RD_RNE); // i32 -> double - FSUBD(v1, v1, v2); - break; - case 5: - INST_NAME("FISUBR ST0, Ed"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - LW(x1, ed, fixedaddress); - FCVTDW(v2, x1, RD_RNE); // i32 -> double - FSUBD(v1, v2, v1); - break; - case 6: - INST_NAME("FIDIV ST0, Ed"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - LW(x1, ed, fixedaddress); - FCVTDW(v2, x1, RD_RNE); // i32 -> double - FDIVD(v1, v1, v2); - break; - case 7: - INST_NAME("FIDIVR ST0, Ed"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - LW(x1, ed, fixedaddress); - FCVTDW(v2, x1, RD_RNE); // i32 -> double - FDIVD(v1, v2, v1); - break; - } } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FIADD ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LW(x1, ed, fixedaddress); + FCVTDW(v2, x1, RD_RNE); // i32 -> double + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FADDD(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 1: + INST_NAME("FIMUL ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LW(x1, ed, fixedaddress); + FCVTDW(v2, x1, RD_RNE); // i32 -> double + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FMULD(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 2: + INST_NAME("FICOM ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LW(x1, ed, fixedaddress); + FCVTDW(v2, x1, RD_RNE); // i32 -> double + FCOMD(v1, v2, x1, x2, x3, x4, x5); + break; + case 3: + INST_NAME("FICOMP ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LW(x1, ed, fixedaddress); + FCVTDW(v2, x1, RD_RNE); // i32 -> double + FCOMD(v1, v2, x1, x2, x3, x4, x5); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FISUB ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LW(x1, ed, fixedaddress); + FCVTDW(v2, x1, RD_RNE); // i32 -> double + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FSUBD(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 5: + INST_NAME("FISUBR ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LW(x1, ed, fixedaddress); + FCVTDW(v2, x1, RD_RNE); // i32 -> double + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FSUBD(v1, v2, v1); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 6: + INST_NAME("FIDIV ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LW(x1, ed, fixedaddress); + FCVTDW(v2, x1, RD_RNE); // i32 -> double + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FDIVD(v1, v1, v2); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 7: + INST_NAME("FIDIVR ST0, Ed"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LW(x1, ed, fixedaddress); + FCVTDW(v2, x1, RD_RNE); // i32 -> double + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FDIVD(v1, v2, v1); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + } return addr; } diff --git a/src/dynarec/rv64/dynarec_rv64_db.c b/src/dynarec/rv64/dynarec_rv64_db.c index 80e9966..ca63dec 100644 --- a/src/dynarec/rv64/dynarec_rv64_db.c +++ b/src/dynarec/rv64/dynarec_rv64_db.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,13 +17,14 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_rv64_functions.h" -uintptr_t dynarec64_DB(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_DB(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; + (void)need_epilog; uint8_t nextop = F8; uint8_t ed; @@ -42,255 +41,223 @@ uintptr_t dynarec64_DB(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MAYUSE(v1); MAYUSE(j64); - switch(nextop) { - case 0xC0: - case 0xC1: - case 0xC2: - case 0xC3: - case 0xC4: - case 0xC5: - case 0xC6: - case 0xC7: - INST_NAME("FCMOVNB ST0, STx"); - READFLAGS(X_CF); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - ANDI(x1, xFlags, 1<>3)&7) { - case 0: - INST_NAME("FILD ST0, Ed"); - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); - addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); - LW(x1, ed, fixedaddress); - FCVTDW(v1, x1, RD_RNE); // i32 -> double - break; - case 1: - INST_NAME("FISTTP Ed, ST0"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0); - if (!box64_dynarec_fastround) { - FSFLAGSI(0); // reset all bits - } - FCVTWD(x4, v1, RD_RTZ); - if (!box64_dynarec_fastround) { - FRFLAGS(x5); // get back FPSR to check the IOC bit - ANDI(x5, x5, 1 << FR_NV); - BEQZ_MARK(x5); - MOV32w(x4, 0x80000000); - MARK; - } - SW(x4, wback, fixedaddress); - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 2: - INST_NAME("FIST Ed, ST0"); - DEFAULT; - break; - case 3: - INST_NAME("FISTP Ed, ST0"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - u8 = x87_setround(dyn, ninst, x1, x2); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); - v2 = fpu_get_scratch(dyn); - if(!box64_dynarec_fastround) { - FSFLAGSI(0); // reset all bits - } - FCVTWD(x4, v1, RD_DYN); - x87_restoreround(dyn, ninst, u8); - if(!box64_dynarec_fastround) { - FRFLAGS(x5); // get back FPSR to check the IOC bit - ANDI(x5, x5, 1<> 3) & 7) { + case 0: + INST_NAME("FILD ST0, Ed"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LW(x1, ed, fixedaddress); + FCVTDW(v1, x1, RD_RNE); // i32 -> double + break; + case 1: + INST_NAME("FISTTP Ed, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0); + if (!BOX64ENV(dynarec_fastround)) { + FSFLAGSI(0); // reset all bits + } + FCVTWD(x4, v1, RD_RTZ); + if (!BOX64ENV(dynarec_fastround)) { + FRFLAGS(x5); // get back FPSR to check the IOC bit + ANDI(x5, x5, 1 << FR_NV); + BEQZ_MARK(x5); + MOV32w(x4, 0x80000000); + MARK; + } + SW(x4, wback, fixedaddress); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 2: + INST_NAME("FIST Ed, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + u8 = x87_setround(dyn, ninst, x1, x5); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + v2 = fpu_get_scratch(dyn); + if (!BOX64ENV(dynarec_fastround)) { + FSFLAGSI(0); // reset all bits + } + FCVTWD(x4, v1, RD_DYN); + if (!BOX64ENV(dynarec_fastround)) { + FRFLAGS(x5); // get back FPSR to check the IOC bit + ANDI(x5, x5, 1 << FR_NV); + BEQ_MARK2(x5, xZR); + MOV32w(x4, 0x80000000); + } + MARK2; + SW(x4, wback, fixedaddress); + x87_restoreround(dyn, ninst, u8); + break; + case 3: + INST_NAME("FISTP Ed, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + u8 = x87_setround(dyn, ninst, x1, x5); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + v2 = fpu_get_scratch(dyn); + if (!BOX64ENV(dynarec_fastround)) { + FSFLAGSI(0); // reset all bits + } + FCVTWD(x4, v1, RD_DYN); + if (!BOX64ENV(dynarec_fastround)) { + FRFLAGS(x5); // get back FPSR to check the IOC bit + ANDI(x5, x5, 1 << FR_NV); + BEQ_MARK2(x5, xZR); + MOV32w(x4, 0x80000000); + } + MARK2; + SW(x4, wback, fixedaddress); + x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 5: + INST_NAME("FLD tbyte"); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 8, 0); + if ((PK(0) == 0xDB && ((PK(1) >> 3) & 7) == 7) || (!rex.is32bits && PK(0) >= 0x40 && PK(0) <= 0x4f && PK(1) == 0xDB && ((PK(2) >> 3) & 7) == 7)) { + NOTEST(x5); + // the FLD is immediatly followed by an FSTP + LD(x5, ed, fixedaddress + 0); + LH(x6, ed, fixedaddress + 8); + // no persistant scratch register, so unrool both instruction here... + MESSAGE(LOG_DUMP, "\tHack: FSTP tbyte\n"); + nextop = F8; // 0xDB or rex + if (!rex.is32bits && nextop >= 0x40 && nextop <= 0x4f) { + rex.rex = nextop; + nextop = F8; // 0xDB + } else + rex.rex = 0; + nextop = F8; // modrm addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 8, 0); - if((PK(0)==0xDB && ((PK(1)>>3)&7)==7) || (PK(0)>=0x40 && PK(0)<=0x4f && PK(1)==0xDB && ((PK(2)>>3)&7)==7)) { - // the FLD is immediatly followed by an FSTP - LD(x5, ed, fixedaddress+0); - LH(x6, ed, fixedaddress+8); - // no persistant scratch register, so unrool both instruction here... - MESSAGE(LOG_DUMP, "\tHack: FSTP tbyte\n"); - nextop = F8; // 0xDB or rex - if(nextop>=0x40 && nextop<=0x4f) { - rex.rex = nextop; - nextop = F8; //0xDB - } else - rex.rex = 0; - nextop = F8; //modrm - addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 8, 0); - SD(x5, ed, fixedaddress+0); - SH(x6, ed, fixedaddress+8); + SD(x5, ed, fixedaddress + 0); + SH(x6, ed, fixedaddress + 8); + } else { + if (BOX64ENV(x87_no80bits)) { + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); + FLD(v1, ed, fixedaddress); } else { - if(box64_x87_no80bits) { - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); - FLD(v1, ed, fixedaddress); - } else { - if(ed!=x1) { - ADDI(x1, ed, fixedaddress); - } - X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, x3); - CALL(native_fld, -1); - } + ADDI(x1, ed, fixedaddress); + X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, x3); + x87_reflectcount(dyn, ninst, x3, x4); + CALL(const_native_fld, -1, x1, 0); + x87_unreflectcount(dyn, ninst, x3, x4); } - break; - case 7: - INST_NAME("FSTP tbyte"); - if(box64_x87_no80bits) { - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FSD(v1, wback, fixedaddress); - } else { - x87_forget(dyn, ninst, x1, x3, 0); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); - if(ed!=x1) { - MV(x1, ed); - } - s0 = x87_stackcount(dyn, ninst, x3); - CALL(native_fstp, -1); - x87_unstackcount(dyn, ninst, x3, s0); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - default: - DEFAULT; - } - } + } + break; + case 7: + INST_NAME("FSTP tbyte"); + if (BOX64ENV(x87_no80bits)) { + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FSD(v1, wback, fixedaddress); + } else { + x87_forget(dyn, ninst, x1, x3, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + x87_reflectcount(dyn, ninst, x3, x4); + CALL(const_native_fstp, -1, ed, 0); + x87_unreflectcount(dyn, ninst, x3, x4); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + default: + DEFAULT; + } return addr; } diff --git a/src/dynarec/rv64/dynarec_rv64_dc.c b/src/dynarec/rv64/dynarec_rv64_dc.c index dbf7b31..8deed88 100644 --- a/src/dynarec/rv64/dynarec_rv64_dc.c +++ b/src/dynarec/rv64/dynarec_rv64_dc.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,16 +17,18 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_rv64_functions.h" -uintptr_t dynarec64_DC(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_DC(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; + (void)need_epilog; uint8_t nextop = F8; uint8_t wback; + uint8_t u8; int64_t fixedaddress; int unscaled; int v1, v2; @@ -36,156 +36,191 @@ uintptr_t dynarec64_DC(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MAYUSE(v2); MAYUSE(v1); - switch(nextop) { - case 0xC0 ... 0xC7: - INST_NAME("FADD STx, ST0"); - v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FADDS(v1, v1, v2); - } else { - FADDD(v1, v1, v2); - } - break; - case 0xC8 ... 0xCF: - INST_NAME("FMUL STx, ST0"); - v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FMULS(v1, v1, v2); - } else { - FMULD(v1, v1, v2); - } - break; - case 0xD0 ... 0xD7: - INST_NAME("FCOM ST0, STx"); //yep - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FCOMS(v1, v2, x1, x2, x3, x4, x5); - } else { - FCOMD(v1, v2, x1, x2, x3, x4, x5); - } - break; - case 0xD8 ... 0xDF: - INST_NAME("FCOMP ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FCOMS(v1, v2, x1, x2, x3, x4, x5); - } else { - FCOMD(v1, v2, x1, x2, x3, x4, x5); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xE0 ... 0xE7: - INST_NAME("FSUBR STx, ST0"); - v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FSUBS(v1, v2, v1); - } else { - FSUBD(v1, v2, v1); - } - break; - case 0xE8 ... 0xEF: - INST_NAME("FSUB STx, ST0"); - v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FSUBS(v1, v1, v2); - } else { - FSUBD(v1, v1, v2); - } - break; - case 0xF0 ... 0xF7: - INST_NAME("FDIVR STx, ST0"); - v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FDIVS(v1, v2, v1); - } else { - FDIVD(v1, v2, v1); - } - break; - case 0xF8 ... 0xFF: - INST_NAME("FDIV STx, ST0"); - v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FDIVS(v1, v1, v2); - } else { - FDIVD(v1, v1, v2); - } - break; - default: - switch((nextop>>3)&7) { - case 0: - INST_NAME("FADD ST0, double[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLD(v2, wback, fixedaddress); + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FADD STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FADDS(v1, v1, v2); + } else { FADDD(v1, v1, v2); - break; - case 1: - INST_NAME("FMUL ST0, double[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLD(v2, wback, fixedaddress); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xC8 ... 0xCF: + INST_NAME("FMUL STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FMULS(v1, v1, v2); + } else { FMULD(v1, v1, v2); - break; - case 2: - INST_NAME("FCOM ST0, double[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLD(v2, wback, fixedaddress); - FCOMD(v1, v2, x1, x6, x3, x4, x5); - break; - case 3: - INST_NAME("FCOMP ST0, double[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLD(v2, wback, fixedaddress); - FCOMD(v1, v2, x1, x6, x3, x4, x5); - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 4: - INST_NAME("FSUB ST0, double[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLD(v2, wback, fixedaddress); - FSUBD(v1, v1, v2); - break; - case 5: - INST_NAME("FSUBR ST0, double[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLD(v2, wback, fixedaddress); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xD0 ... 0xD7: + INST_NAME("FCOM ST0, STx"); // yep + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3, x4, x5); + } else { + FCOMD(v1, v2, x1, x2, x3, x4, x5); + } + break; + case 0xD8 ... 0xDF: + INST_NAME("FCOMP ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3, x4, x5); + } else { + FCOMD(v1, v2, x1, x2, x3, x4, x5); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE0 ... 0xE7: + INST_NAME("FSUBR STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FSUBS(v1, v2, v1); + } else { FSUBD(v1, v2, v1); - break; - case 6: - INST_NAME("FDIV ST0, double[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLD(v2, wback, fixedaddress); - FDIVD(v1, v1, v2); - break; - case 7: - INST_NAME("FDIVR ST0, double[ED]"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - v2 = fpu_get_scratch(dyn); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLD(v2, wback, fixedaddress); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xE8 ... 0xEF: + INST_NAME("FSUB STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FSUBS(v1, v1, v2); + } else { + FSUBD(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xF0 ... 0xF7: + INST_NAME("FDIVR STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FDIVS(v1, v2, v1); + } else { FDIVD(v1, v2, v1); - break; - } - } + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 0xF8 ... 0xFF: + INST_NAME("FDIV STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FDIVS(v1, v1, v2); + } else { + FDIVD(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + default: + DEFAULT; + break; + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FADD ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD(v2, wback, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FADDD(v1, v1, v2); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 1: + INST_NAME("FMUL ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD(v2, wback, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FMULD(v1, v1, v2); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 2: + INST_NAME("FCOM ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD(v2, wback, fixedaddress); + FCOMD(v1, v2, x1, x6, x3, x4, x5); + break; + case 3: + INST_NAME("FCOMP ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD(v2, wback, fixedaddress); + FCOMD(v1, v2, x1, x6, x3, x4, x5); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FSUB ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD(v2, wback, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FSUBD(v1, v1, v2); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 5: + INST_NAME("FSUBR ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD(v2, wback, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FSUBD(v1, v2, v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 6: + INST_NAME("FDIV ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD(v2, wback, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FDIVD(v1, v1, v2); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + case 7: + INST_NAME("FDIVR ST0, double[ED]"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + v2 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD(v2, wback, fixedaddress); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + FDIVD(v1, v2, v1); + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + break; + } return addr; } diff --git a/src/dynarec/rv64/dynarec_rv64_dd.c b/src/dynarec/rv64/dynarec_rv64_dd.c index d125565..2562be7 100644 --- a/src/dynarec/rv64/dynarec_rv64_dd.c +++ b/src/dynarec/rv64/dynarec_rv64_dd.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,13 +17,14 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_rv64_functions.h" -uintptr_t dynarec64_DD(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_DD(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; + (void)need_epilog; uint8_t nextop = F8; uint8_t ed, wback; @@ -40,189 +39,149 @@ uintptr_t dynarec64_DD(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MAYUSE(v1); MAYUSE(j64); - switch(nextop) { - case 0xC0: - case 0xC1: - case 0xC2: - case 0xC3: - case 0xC4: - case 0xC5: - case 0xC6: - case 0xC7: - INST_NAME("FFREE STx"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - x87_purgecache(dyn, ninst, 0, x1, x2, x3); - MOV32w(x1, nextop&7); - CALL(fpu_do_free, -1); - break; - case 0xD0: - case 0xD1: - case 0xD2: - case 0xD3: - case 0xD4: - case 0xD5: - case 0xD6: - case 0xD7: - INST_NAME("FST ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FMVS(v2, v1); - } else { - FMVD(v2, v1); - } - break; - case 0xD8: - INST_NAME("FSTP ST0, ST0"); - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xD9: - case 0xDA: - case 0xDB: - case 0xDC: - case 0xDD: - case 0xDE: - case 0xDF: - INST_NAME("FSTP ST0, STx"); - // copy the cache value for st0 to stx - x87_get_st_empty(dyn, ninst, x1, x2, nextop&7, X87_ST(nextop&7)); - x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); - x87_swapreg(dyn, ninst, x1, x2, 0, nextop&7); - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xE0: - case 0xE1: - case 0xE2: - case 0xE3: - case 0xE4: - case 0xE5: - case 0xE6: - case 0xE7: - INST_NAME("FUCOM ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FCOMS(v1, v2, x1, x2, x3, x4, x5); - } else { - FCOMD(v1, v2, x1, x2, x3, x4, x5); - } - break; - case 0xE8: - case 0xE9: - case 0xEA: - case 0xEB: - case 0xEC: - case 0xED: - case 0xEE: - case 0xEF: - INST_NAME("FUCOMP ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FCOMS(v1, v2, x1, x2, x3, x4, x5); - } else { - FCOMD(v1, v2, x1, x2, x3, x4, x5); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xC8: - case 0xC9: - case 0xCA: - case 0xCB: - case 0xCC: - case 0xCD: - case 0xCE: - case 0xCF: - case 0xF0: - case 0xF1: - case 0xF2: - case 0xF3: - case 0xF4: - case 0xF5: - case 0xF6: - case 0xF7: - case 0xF8: - case 0xF9: - case 0xFA: - case 0xFB: - case 0xFC: - case 0xFD: - case 0xFE: - case 0xFF: - DEFAULT; - break; - - default: - switch((nextop>>3)&7) { - case 0: - INST_NAME("FLD double"); - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FLD(v1, wback, fixedaddress); - break; - case 1: - INST_NAME("FISTTP i64, ST0"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_I64); - addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0); - if (ST_IS_I64(0)) { - FSD(v1, wback, fixedaddress); - } else { - if (!box64_dynarec_fastround) { - FSFLAGSI(0); // reset all bits - } - FCVTLD(x4, v1, RD_RTZ); - if (!box64_dynarec_fastround) { - FRFLAGS(x5); // get back FPSR to check the IOC bit - ANDI(x5, x5, 1 << FR_NV); - BEQZ_MARK(x5); - MOV64x(x4, 0x8000000000000000); - MARK; - } - SD(x4, wback, fixedaddress); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 2: - INST_NAME("FST double"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: +#if 1 + if ((nextop & 7) == 0 && PK(0) == 0xD9 && PK(1) == 0xF7) { + MESSAGE(LOG_DUMP, "Hack for FFREE ST0 / FINCSTP\n"); + x87_do_pop(dyn, ninst, x1); + addr += 2; + SKIPTEST(x1); + } else + x87_free(dyn, ninst, x1, x2, x3, nextop & 7); +#else + MESSAGE(LOG_DUMP, "Need Optimization\n"); + x87_purgecache(dyn, ninst, 0, x1, x2, x3); + MOV32w(x1, nextop & 7); + CALL(fpu_do_free, -1, x1, 0); +#endif + break; + case 0xD0 ... 0xD7: + INST_NAME("FST ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FMVS(v2, v1); + } else { + FMVD(v2, v1); + } + break; + case 0xD8: + INST_NAME("FSTP ST0, ST0"); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xD9 ... 0xDF: + INST_NAME("FSTP ST0, STx"); + // copy the cache value for st0 to stx + x87_get_st_empty(dyn, ninst, x1, x2, nextop & 7, X87_ST(nextop & 7)); + x87_get_st(dyn, ninst, x1, x2, 0, X87_ST0); + x87_swapreg(dyn, ninst, x1, x2, 0, nextop & 7); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE0 ... 0xE7: + INST_NAME("FUCOM ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3, x4, x5); + } else { + FCOMD(v1, v2, x1, x2, x3, x4, x5); + } + break; + case 0xE8 ... 0xEF: + INST_NAME("FUCOMP ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3, x4, x5); + } else { + FCOMD(v1, v2, x1, x2, x3, x4, x5); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + default: + DEFAULT; + break; + } + else + switch ((nextop >> 3) & 7) { + case 0: + INST_NAME("FLD double"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_D); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FLD(v1, wback, fixedaddress); + break; + case 1: + INST_NAME("FISTTP i64, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_I64); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0); + if (ST_IS_I64(0)) { FSD(v1, wback, fixedaddress); - break; - case 3: - INST_NAME("FSTP double"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); - FSD(v1, wback, fixedaddress); - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 6: - INST_NAME("FSAVE m108byte"); - MESSAGE(LOG_DUMP, "Need Optimization\n"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); - addr = geted(dyn, addr, ninst, nextop, &ed, x4, x6, &fixedaddress, rex, NULL, 0, 0); - if (ed != x1) { MV(x1, ed); } - CALL(native_fsave, -1); - break; - case 7: - INST_NAME("FNSTSW m2byte"); - fpu_purgecache(dyn, ninst, 0, x1, x2, x3); - addr = geted(dyn, addr, ninst, nextop, &ed, x4, x6, &fixedaddress, rex, NULL, 0, 0); - LWU(x2, xEmu, offsetof(x64emu_t, top)); - LHU(x3, xEmu, offsetof(x64emu_t, sw)); - if(dyn->e.x87stack) { - // update top - ADDI(x2, x2, -dyn->e.x87stack); - ANDI(x2, x2, 7); + } else { + if (!BOX64ENV(dynarec_fastround)) { + FSFLAGSI(0); // reset all bits + } + FCVTLD(x4, v1, RD_RTZ); + if (!BOX64ENV(dynarec_fastround)) { + FRFLAGS(x5); // get back FPSR to check the IOC bit + ANDI(x5, x5, 1 << FR_NV); + BEQZ_MARK(x5); + MOV64x(x4, 0x8000000000000000); + MARK; } - MOV32w(x5, ~0x3800); - AND(x3, x3, x5); // mask out TOP - SLLI(x2, x2, 11); // shift TOP to bit 11 - OR(x3, x3, x2); // inject TOP - SH(x3, ed, fixedaddress); // store whole sw flags - break; - default: - DEFAULT; - } - } + SD(x4, wback, fixedaddress); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 2: + INST_NAME("FST double"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FSD(v1, wback, fixedaddress); + break; + case 3: + INST_NAME("FSTP double"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_D); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, 0); + FSD(v1, wback, fixedaddress); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FRSTOR m108byte"); + MESSAGE(LOG_DUMP, "Need Optimization (FRSTOR)\n"); + fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x6, &fixedaddress, rex, NULL, 0, 0); + CALL(const_native_frstor, -1, ed, 0); + break; + case 6: + INST_NAME("FNSAVE m108byte"); + MESSAGE(LOG_DUMP, "Need Optimization\n"); + fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x6, &fixedaddress, rex, NULL, 0, 0); + CALL(const_native_fsave, -1, ed, 0); + NATIVE_RESTORE_X87PC(); + break; + case 7: + INST_NAME("FNSTSW m2byte"); + // fpu_purgecache(dyn, ninst, 0, x1, x2, x3); + addr = geted(dyn, addr, ninst, nextop, &ed, x4, x6, &fixedaddress, rex, NULL, 0, 0); + LWU(x2, xEmu, offsetof(x64emu_t, top)); + LHU(x3, xEmu, offsetof(x64emu_t, sw)); + if (dyn->e.x87stack) { + // update top + ADDI(x2, x2, -dyn->e.x87stack); + ANDI(x2, x2, 7); + } + MOV32w(x5, ~0x3800); + AND(x3, x3, x5); // mask out TOP + SLLI(x2, x2, 11); // shift TOP to bit 11 + OR(x3, x3, x2); // inject TOP + SH(x3, xEmu, offsetof(x64emu_t, sw)); + SH(x3, ed, fixedaddress); // store whole sw flags + break; + default: + DEFAULT; + } return addr; } diff --git a/src/dynarec/rv64/dynarec_rv64_de.c b/src/dynarec/rv64/dynarec_rv64_de.c index f20cc68..16a27e0 100644 --- a/src/dynarec/rv64/dynarec_rv64_de.c +++ b/src/dynarec/rv64/dynarec_rv64_de.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,175 +17,141 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_rv64_functions.h" -uintptr_t dynarec64_DE(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_DE(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; + (void)need_epilog; uint8_t nextop = F8; uint8_t wback; + uint8_t u8; int64_t fixedaddress; int v1, v2; MAYUSE(v2); MAYUSE(v1); - switch(nextop) { - case 0xC0: - case 0xC1: - case 0xC2: - case 0xC3: - case 0xC4: - case 0xC5: - case 0xC6: - case 0xC7: - INST_NAME("FADDP STx, ST0"); - v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); - v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - if(ST_IS_F(0)) { - FADDS(v1, v1, v2); - } else { - FADDD(v1, v1, v2); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xC8: - case 0xC9: - case 0xCA: - case 0xCB: - case 0xCC: - case 0xCD: - case 0xCE: - case 0xCF: - INST_NAME("FMULP STx, ST0"); - v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); - v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - if(ST_IS_F(0)) { - FMULS(v1, v1, v2); - } else { - FMULD(v1, v1, v2); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xD0: - case 0xD1: - case 0xD2: - case 0xD3: - case 0xD4: - case 0xD5: - case 0xD6: - case 0xD7: - INST_NAME("FCOMP ST0, STx"); // yep - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FCOMS(v1, v2, x1, x2, x3, x4, x5); - } else { - FCOMD(v1, v2, x1, x2, x3, x4, x5); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xD9: - INST_NAME("FCOMPP ST0, STx"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); - if (ST_IS_F(0)) { - FCOMS(v1, v2, x1, x2, x3, x4, x5); - } else { - FCOMD(v1, v2, x1, x2, x3, x4, x5); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xE0: - case 0xE1: - case 0xE2: - case 0xE3: - case 0xE4: - case 0xE5: - case 0xE6: - case 0xE7: - INST_NAME("FSUBRP STx, ST0"); - v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); - v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - if(ST_IS_F(0)) { - FSUBS(v1, v2, v1); - } else { - FSUBD(v1, v2, v1); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xE8: - case 0xE9: - case 0xEA: - case 0xEB: - case 0xEC: - case 0xED: - case 0xEE: - case 0xEF: - INST_NAME("FSUBP STx, ST0"); - v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); - v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - if(ST_IS_F(0)) { - FSUBS(v1, v1, v2); - } else { - FSUBD(v1, v1, v2); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xF0: - case 0xF1: - case 0xF2: - case 0xF3: - case 0xF4: - case 0xF5: - case 0xF6: - case 0xF7: - INST_NAME("FDIVRP STx, ST0"); - v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); - v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - if(ST_IS_F(0)) { - FDIVS(v1, v2, v1); - } else { - FDIVD(v1, v2, v1); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xF8: - case 0xF9: - case 0xFA: - case 0xFB: - case 0xFC: - case 0xFD: - case 0xFE: - case 0xFF: - INST_NAME("FDIVP STx, ST0"); - v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); - v1 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - if(ST_IS_F(0)) { - FDIVS(v1, v1, v2); - } else { - FDIVD(v1, v1, v2); - } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 0xD8: - case 0xDA: - case 0xDB: - case 0xDC: - case 0xDD: - case 0xDE: - case 0xDF: - DEFAULT; - break; - default: - switch((nextop>>3)&7) { - default: - DEFAULT; - } - } + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FADDP STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FADDS(v1, v1, v2); + } else { + FADDD(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xC8 ... 0xCF: + INST_NAME("FMULP STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FMULS(v1, v1, v2); + } else { + FMULD(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xD0 ... 0xD7: + INST_NAME("FCOMP ST0, STx"); // yep + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3, x4, x5); + } else { + FCOMD(v1, v2, x1, x2, x3, x4, x5); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xD9: + INST_NAME("FCOMPP ST0, STx"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v2 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (ST_IS_F(0)) { + FCOMS(v1, v2, x1, x2, x3, x4, x5); + } else { + FCOMD(v1, v2, x1, x2, x3, x4, x5); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE0 ... 0xE7: + INST_NAME("FSUBRP STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FSUBS(v1, v2, v1); + } else { + FSUBD(v1, v2, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xE8 ... 0xEF: + INST_NAME("FSUBP STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FSUBS(v1, v1, v2); + } else { + FSUBD(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xF0 ... 0xF7: + INST_NAME("FDIVRP STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FDIVS(v1, v2, v1); + } else { + FDIVD(v1, v2, v1); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 0xF8 ... 0xFF: + INST_NAME("FDIVP STx, ST0"); + v2 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop & 7)); + v1 = x87_get_st(dyn, ninst, x1, x2, nextop & 7, X87_COMBINE(0, nextop & 7)); + if (!BOX64ENV(dynarec_fastround)) u8 = x87_setround(dyn, ninst, x1, x5); + if (ST_IS_F(0)) { + FDIVS(v1, v1, v2); + } else { + FDIVD(v1, v1, v2); + } + X87_CHECK_PRECISION(v1); + if (!BOX64ENV(dynarec_fastround)) x87_restoreround(dyn, ninst, u8); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + default: + DEFAULT; + break; + } + else + switch ((nextop >> 3) & 7) { + default: + DEFAULT; + } return addr; } diff --git a/src/dynarec/rv64/dynarec_rv64_df.c b/src/dynarec/rv64/dynarec_rv64_df.c index a164fc6..3cbc857 100644 --- a/src/dynarec/rv64/dynarec_rv64_df.c +++ b/src/dynarec/rv64/dynarec_rv64_df.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,12 +17,13 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_rv64_functions.h" -uintptr_t dynarec64_DF(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_DF(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; + (void)need_epilog; uint8_t nextop = F8; uint8_t ed, wback, u8; @@ -38,273 +37,273 @@ uintptr_t dynarec64_DF(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MAYUSE(v1); MAYUSE(j64); - switch(nextop) { - case 0xC0 ... 0xC7: - INST_NAME("FFREEP STx"); - // not handling Tag... - X87_POP_OR_FAIL(dyn, ninst, x3); - break; + if (MODREG) + switch (nextop) { + case 0xC0 ... 0xC7: + INST_NAME("FFREEP STx"); + // not handling Tag... + X87_POP_OR_FAIL(dyn, ninst, x3); + break; - case 0xE0: - INST_NAME("FNSTSW AX"); - LWU(x2, xEmu, offsetof(x64emu_t, top)); - LHU(x1, xEmu, offsetof(x64emu_t, sw)); - MOV32w(x3, 0b1100011111111111); // mask - AND(x1, x1, x3); - SLLI(x2, x2, 11); - OR(x1, x1, x2); // inject top - SH(x1, xEmu, offsetof(x64emu_t, sw)); - SRLI(xRAX, xRAX, 16); - SLLI(xRAX, xRAX, 16); - OR(xRAX, xRAX, x1); - break; - case 0xE8 ... 0xF7: - if (nextop < 0xF0) { - INST_NAME("FUCOMIP ST0, STx"); - } else { - INST_NAME("FCOMIP ST0, STx"); - } - SETFLAGS(X_ALL, SF_SET); - SET_DFNONE(); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, X87_COMBINE(0, nextop&7)); - v2 = x87_get_st(dyn, ninst, x1, x2, nextop&7, X87_COMBINE(0, nextop&7)); - CLEAR_FLAGS(); - IFX(X_ZF | X_PF | X_CF) { - if(ST_IS_F(0)) { - FEQS(x5, v1, v1); - FEQS(x4, v2, v2); - AND(x5, x5, x4); - BEQZ(x5, 24); // undefined/NaN - FEQS(x5, v1, v2); - BNEZ(x5, 24); // equal - FLTS(x3, v1, v2); // x3 = (v1e.x87stack) { + ADDI(x2, x2, -dyn->e.x87stack); + ANDI(x2, x2, 0x7); + } + LHU(x1, xEmu, offsetof(x64emu_t, sw)); + MOV32w(x3, 0b1100011111111111); // mask + AND(x1, x1, x3); + SLLI(x2, x2, 11); + OR(x1, x1, x2); // inject top + SH(x1, xEmu, offsetof(x64emu_t, sw)); + SRLI(xRAX, xRAX, 16); + SLLI(xRAX, xRAX, 16); + OR(xRAX, xRAX, x1); + break; + case 0xE8 ... 0xF7: + if (nextop < 0xF0) { + INST_NAME("FUCOMIP ST0, STx"); } else { - FEQD(x5, v1, v1); - FEQD(x4, v2, v2); - AND(x5, x5, x4); - BEQZ(x5, 24); // undefined/NaN - FEQD(x5, v1, v2); - BNEZ(x5, 24); // equal - FLTD(x3, v1, v2); // x3 = (v1>3)&7) { - case 0: - INST_NAME("FILD ST0, Ew"); - X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_F); - addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0); - LH(x1, wback, fixedaddress); - if(ST_IS_F(0)) { - FCVTSL(v1, x1, RD_RNE); - } else { - FCVTDL(v1, x1, RD_RNE); - } - break; - case 1: - INST_NAME("FISTTP Ew, ST0"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_F); - addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0); - if(!box64_dynarec_fastround) { - FSFLAGSI(0); // reset all bits - } - if (ST_IS_F(0)) { - FCVTWS(x4, v1, RD_RTZ); - } else { - FCVTWD(x4, v1, RD_RTZ); - } - if(!box64_dynarec_fastround) { - FRFLAGS(x5); // get back FPSR to check the IOC bit - ANDI(x5, x5, 1<> 3) & 7) { + case 0: + INST_NAME("FILD ST0, Ew"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_F); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0); + LH(x1, wback, fixedaddress); + if (ST_IS_F(0)) { + FCVTSL(v1, x1, RD_RNE); + } else { + FCVTDL(v1, x1, RD_RNE); + } + break; + case 1: + INST_NAME("FISTTP Ew, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_F); + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x4, &fixedaddress, rex, NULL, 1, 0); + if (!BOX64ENV(dynarec_fastround)) { + FSFLAGSI(0); // reset all bits + } + if (ST_IS_F(0)) { + FCVTWS(x4, v1, RD_RTZ); + } else { + FCVTWD(x4, v1, RD_RTZ); + } + if (!BOX64ENV(dynarec_fastround)) { + FRFLAGS(x5); // get back FPSR to check the IOC bit + ANDI(x5, x5, 1 << FR_NV); + BNEZ_MARK(x5); + SLLIW(x5, x4, 16); + SRAIW(x5, x5, 16); + BEQ_MARK2(x5, x4); + MARK; + MOV32w(x4, 0x8000); + } + MARK2; + SH(x4, wback, fixedaddress); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 2: + INST_NAME("FIST Ew, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_F); + u8 = x87_setround(dyn, ninst, x1, x5); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + if (!BOX64ENV(dynarec_fastround)) { + FSFLAGSI(0); // reset all bits + } + if (ST_IS_F(0)) { + FCVTWS(x4, v1, RD_DYN); + } else { + FCVTWD(x4, v1, RD_DYN); + } + x87_restoreround(dyn, ninst, u8); + if (!BOX64ENV(dynarec_fastround)) { + FRFLAGS(x5); // get back FPSR to check the IOC bit + ANDI(x5, x5, 1 << FR_NV); + BNEZ_MARK(x5); + SLLIW(x5, x4, 16); + SRAIW(x5, x5, 16); + BEQ_MARK2(x5, x4); + MARK; + MOV32w(x4, 0x8000); + } + MARK2; + SH(x4, wback, fixedaddress); + break; + case 3: + INST_NAME("FISTP Ew, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_F); + u8 = x87_setround(dyn, ninst, x1, x5); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + if (!BOX64ENV(dynarec_fastround)) { + FSFLAGSI(0); // reset all bits + } + if (ST_IS_F(0)) { + FCVTWS(x4, v1, RD_DYN); + } else { + FCVTWD(x4, v1, RD_DYN); + } + x87_restoreround(dyn, ninst, u8); + if (!BOX64ENV(dynarec_fastround)) { + FRFLAGS(x5); // get back FPSR to check the IOC bit + ANDI(x5, x5, 1 << FR_NV); + BNEZ_MARK(x5); + SLLIW(x5, x4, 16); + SRAIW(x5, x5, 16); + BEQ_MARK2(x5, x4); + MARK; + MOV32w(x4, 0x8000); + } + MARK2; + SH(x4, wback, fixedaddress); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 4: + INST_NAME("FBLD ST0, tbytes"); + X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, x1); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + s0 = x87_stackcount(dyn, ninst, x3); + CALL(const_fpu_fbld, -1, ed, 0); + x87_unstackcount(dyn, ninst, x3, s0); + break; + case 5: + INST_NAME("FILD ST0, i64"); + X87_PUSH_OR_FAIL(v1, dyn, ninst, x1, EXT_CACHE_ST_I64); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); - if (ST_IS_I64(0)) { - FLD(v1, wback, fixedaddress); - } else { - LD(x1, wback, fixedaddress); - if (rex.is32bits) { - // need to also feed the STll stuff... - ADDI(x4, xEmu, offsetof(x64emu_t, fpu_ll)); - LWU(x5, xEmu, offsetof(x64emu_t, top)); - int a = 0 - dyn->e.x87stack; - if (a) { - ADDIW(x5, x5, a); - ANDI(x5, x5, 0x7); - } - SLLI(x5, x5, 4); // fpu_ll is 2 i64 - ADD(x5, x5, x4); - SD(x1, x5, 8); // ll - } - FCVTDL(v1, x1, RD_RTZ); - if (rex.is32bits) { - FSD(v1, x5, 0); // ref + if (ST_IS_I64(0)) { + FLD(v1, wback, fixedaddress); + } else { + LD(x1, wback, fixedaddress); + if (rex.is32bits) { + // need to also feed the STll stuff... + ADDI(x4, xEmu, offsetof(x64emu_t, fpu_ll)); + LWU(x5, xEmu, offsetof(x64emu_t, top)); + int a = 0 - dyn->e.x87stack; + if (a) { + ADDIW(x5, x5, a); + ANDI(x5, x5, 0x7); } + SLLI(x5, x5, 4); // fpu_ll is 2 i64 + ADD(x5, x5, x4); + SD(x1, x5, 8); // ll } - break; - case 6: - INST_NAME("FBSTP tbytes, ST0"); - x87_forget(dyn, ninst, x1, x2, 0); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); - if (ed != x1) { MV(x1, ed); } - s0 = x87_stackcount(dyn, ninst, x3); - CALL(fpu_fbst, -1); - x87_unstackcount(dyn, ninst, x3, s0); - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - case 7: - INST_NAME("FISTP i64, ST0"); - v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_I64); - if (!ST_IS_I64(0)) { - u8 = x87_setround(dyn, ninst, x1, x2); + FCVTDL(v1, x1, RD_DYN); + if (rex.is32bits) { + FSD(v1, x5, 0); // ref } - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); + } + break; + case 6: + INST_NAME("FBSTP tbytes, ST0"); + x87_forget(dyn, ninst, x1, x2, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + s0 = x87_stackcount(dyn, ninst, x3); + CALL(const_fpu_fbst, -1, ed, 0); + x87_unstackcount(dyn, ninst, x3, s0); + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + case 7: + INST_NAME("FISTP i64, ST0"); + v1 = x87_get_st(dyn, ninst, x1, x2, 0, EXT_CACHE_ST_I64); + if (!ST_IS_I64(0)) { + u8 = x87_setround(dyn, ninst, x1, x7); + } + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, 0); - if (ST_IS_I64(0)) { - FSD(v1, wback, fixedaddress); - } else { - if (rex.is32bits) { - // need to check STll first... - ADDI(x4, xEmu, offsetof(x64emu_t, fpu_ll)); - LWU(x5, xEmu, offsetof(x64emu_t, top)); - int a = 0 - dyn->e.x87stack; - if (a) { - ADDIW(x5, x5, a); - ANDI(x5, x5, 0x7); - } - SLLI(x5, x5, 4); // fpu_ll is 2 i64 - ADD(x5, x5, x4); - FMVXD(x3, v1); - LD(x6, x5, 0); // ref - BNE_MARK(x6, x3); - LD(x6, x5, 8); // ll - SD(x6, wback, fixedaddress); - B_MARK3_nocond; - MARK; + if (ST_IS_I64(0)) { + FSD(v1, wback, fixedaddress); + } else { + if (rex.is32bits) { + // need to check STll first... + ADDI(x4, xEmu, offsetof(x64emu_t, fpu_ll)); + LWU(x5, xEmu, offsetof(x64emu_t, top)); + int a = 0 - dyn->e.x87stack; + if (a) { + ADDIW(x5, x5, a); + ANDI(x5, x5, 0x7); } + SLLI(x5, x5, 4); // fpu_ll is 2 i64 + ADD(x5, x5, x4); + FMVXD(x3, v1); + LD(x6, x5, 0); // ref + BNE_MARK(x6, x3); + LD(x6, x5, 8); // ll + SD(x6, wback, fixedaddress); + B_MARK3_nocond; + MARK; + } - if (!box64_dynarec_fastround) { - FSFLAGSI(0); // reset all bits - } - FCVTLD(x4, v1, RD_DYN); - if (!box64_dynarec_fastround) { - FRFLAGS(x5); // get back FPSR to check the IOC bit - ANDI(x5, x5, 1 << FR_NV); - BEQ_MARK2(x5, xZR); - MOV64x(x4, 0x8000000000000000LL); - } - MARK2; - SD(x4, wback, fixedaddress); - MARK3; - x87_restoreround(dyn, ninst, u8); + if (!BOX64ENV(dynarec_fastround)) { + FSFLAGSI(0); // reset all bits + } + FCVTLD(x4, v1, RD_DYN); + if (!BOX64ENV(dynarec_fastround)) { + FRFLAGS(x5); // get back FPSR to check the IOC bit + ANDI(x5, x5, 1 << FR_NV); + BEQ_MARK2(x5, xZR); + MOV64x(x4, 0x8000000000000000LL); } - X87_POP_OR_FAIL(dyn, ninst, x3); - break; - default: - DEFAULT; - break; - } - } + MARK2; + SD(x4, wback, fixedaddress); + MARK3; + x87_restoreround(dyn, ninst, u8); + } + X87_POP_OR_FAIL(dyn, ninst, x3); + break; + default: + DEFAULT; + break; + } return addr; } diff --git a/src/dynarec/rv64/dynarec_rv64_emit_logic.c b/src/dynarec/rv64/dynarec_rv64_emit_logic.c index e954b32..f5c5f72 100644 --- a/src/dynarec/rv64/dynarec_rv64_emit_logic.c +++ b/src/dynarec/rv64/dynarec_rv64_emit_logic.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,110 +17,112 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" // emit XOR8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed) void emit_xor8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s4, d_xor8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } + XOR(s1, s1, s2); - ANDI(s1, s1, 0xff); - IFX(X_SF) { + + IFX (X_SF) { SRLI(s3, s1, 7); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit XOR8 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch void emit_xor8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s4, d_xor8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - XORI(s1, s1, c&0xff); - ANDI(s1, s1, 0xff); - IFX(X_SF) { + XORI(s1, s1, c & 0xff); + + IFX (X_SF) { SRLI(s3, s1, 7); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit XOR32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_xor32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) { CLEAR_FLAGS(); - IFX(X_PEND) { - SET_DF(s4, rex.w?d_xor64:d_xor32); - } else IFX(X_ALL) { + IFX (X_PEND) { + SET_DF(s4, rex.w ? d_xor64 : d_xor32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } XOR(s1, s1, s2); // test sign bit before zeroup. - IFX(X_SF) { + IFX (X_SF) { if (!rex.w) SEXT_W(s1, s1); - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } - if (!rex.w && s1!=s2) { - ZEROUP(s1); + + if (!rex.w && s1 != s2) { + IFX (X_ZF) + ZEROUP(s1); + else if (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion) + ZEROUP(s1); } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit XOR32 instruction, from s1, c, store result in s1 using s3 and s4 as scratch void emit_xor32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4) { CLEAR_FLAGS(); - IFX(X_PEND) { - SET_DF(s4, rex.w?d_xor64:d_xor32); - } else IFX(X_ALL) { + IFX (X_PEND) { + SET_DF(s4, rex.w ? d_xor64 : d_xor32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if(c>=-2048 && c<=2047) { + if (c >= -2048 && c <= 2047) { XORI(s1, s1, c); } else { MOV64xw(s3, c); @@ -130,193 +130,192 @@ void emit_xor32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i } // test sign bit before zeroup. - IFX(X_SF) { + IFX (X_SF) { if (!rex.w) SEXT_W(s1, s1); - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } if (!rex.w) { - ZEROUP(s1); + IFX (X_ZF) + ZEROUP(s1); + else if (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion) + ZEROUP(s1); } - - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit XOR16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed) void emit_xor16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s4, d_xor16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } XOR(s1, s1, s2); - ZEXTH(s1, s1); - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF | X_SF) { - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + + IFX (X_ZF | X_SF) { + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 15); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit OR16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed) -void emit_or16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { +void emit_or16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) +{ CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s3, d_or16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } OR(s1, s1, s2); - ZEXTH(s1, s1); - IFX(X_PEND) { + + IFX (X_PEND) { SD(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 15); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit OR32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_or32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) { CLEAR_FLAGS(); - IFX(X_PEND) { - SET_DF(s4, rex.w?d_or64:d_or32); - } else IFX(X_ALL) { + IFX (X_PEND) { + SET_DF(s4, rex.w ? d_or64 : d_or32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } OR(s1, s1, s2); - // test sign bit before zeroup. - IFX(X_SF) { + IFX (X_SF) { if (!rex.w) SEXT_W(s1, s1); - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } if (!rex.w) { - ZEROUP(s1); + IFX (X_ZF) + ZEROUP(s1); + else if (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion) + ZEROUP(s1); } - - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } + // emit OR32 instruction, from s1, c, store result in s1 using s3 and s4 as scratch void emit_or32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4) { CLEAR_FLAGS(); - IFX(X_PEND) { - SET_DF(s4, rex.w?d_or64:d_or32); - } else IFX(X_ALL) { + IFX (X_PEND) { + SET_DF(s4, rex.w ? d_or64 : d_or32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if(c>=-2048 && c<=2047) { + if (c >= -2048 && c <= 2047) { ORI(s1, s1, c); } else { MOV64xw(s3, c); OR(s1, s1, s3); } - // test sign bit before zeroup. - IFX(X_SF) { + IFX (X_SF) { if (!rex.w) SEXT_W(s1, s1); - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } if (!rex.w) { - ZEROUP(s1); + IFX (X_ZF) + ZEROUP(s1); + else if (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion) + ZEROUP(s1); } - - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit AND8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed) void emit_and8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { - CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s3, d_and8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } AND(s1, s1, s2); - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 7); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } @@ -324,155 +323,159 @@ void emit_and8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) void emit_and8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s3, d_and8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - ANDI(s1, s1, c&0xff); + ANDI(s1, s1, c & 0xff); - IFX(X_PEND) { + IFX (X_PEND) { SD(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 7); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } -void emit_and16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { +void emit_and16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) +{ CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s3, d_tst16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } AND(s1, s1, s2); // res = s1 & s2 - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 15); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit AND32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_and32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4) { CLEAR_FLAGS(); - IFX(X_PEND) { - SET_DF(s3, rex.w?d_tst64:d_tst32); - } else IFX(X_ALL) { + IFX (X_PEND) { + SET_DF(s3, rex.w ? d_tst64 : d_tst32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } AND(s1, s1, s2); // res = s1 & s2 - if (!rex.w) ZEROUP(s1); - - IFX(X_PEND) { + if (!rex.w) { + IFX (X_ZF | X_SF) + ZEROUP(s1); + else if (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion) + ZEROUP(s1); + } + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { - SRLI(s3, s1, rex.w?63:31); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SRLI(s3, s1, rex.w ? 63 : 31); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit AND32 instruction, from s1, c, store result in s1 using s3 and s4 as scratch void emit_and32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4) { CLEAR_FLAGS(); - IFX(X_PEND) { - SET_DF(s3, rex.w?d_tst64:d_tst32); - } else IFX(X_ALL) { + IFX (X_PEND) { + SET_DF(s3, rex.w ? d_tst64 : d_tst32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if(c>=-2048 && c<=2047) { + if (c >= -2048 && c <= 2047) { ANDI(s1, s1, c); } else { MOV64xw(s3, c); AND(s1, s1, s3); // res = s1 & s2 } - if (!rex.w) ZEROUP(s1); - - IFX(X_PEND) { + if (!rex.w) { + IFX (X_ZF | X_SF) + ZEROUP(s1); + else if (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion) + ZEROUP(s1); + } + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { - SRLI(s3, s1, rex.w?63:31); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SRLI(s3, s1, rex.w ? 63 : 31); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit OR8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch, s4 can be same as s2 (and so s2 destroyed) void emit_or8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SET_DF(s3, d_or8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } OR(s1, s1, s2); - - IFX(X_PEND) { + + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 7); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit OR8 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch void emit_or8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s2, int s3, int s4) { - MOV32w(s2, c&0xff); + MOV32w(s2, c & 0xff); emit_or8(dyn, ninst, s1, s2, s3, s4); } diff --git a/src/dynarec/rv64/dynarec_rv64_emit_math.c b/src/dynarec/rv64/dynarec_rv64_emit_math.c index 6175f19..cc6ecfd 100644 --- a/src/dynarec/rv64/dynarec_rv64_emit_math.c +++ b/src/dynarec/rv64/dynarec_rv64_emit_math.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,419 +17,413 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" // emit ADD32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_add32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s3, rex.w?d_add64:d_add32b); - } else IFX(X_ALL) { + SET_DF(s3, rex.w ? d_add64 : d_add32b); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { if (rex.w) { - AND(s5, xMASK, s1); - if(rv64_zba) ADDUW(s5, s2, s5); else {AND(s4, xMASK, s2); ADD(s5, s5, s4);} // lo + ZEXTW2(s5, s1); + if (cpuext.zba) // lo + ADDUW(s5, s2, s5); + else { + ZEXTW2(s4, s2); + ADD(s5, s5, s4); + } SRLI(s3, s1, 0x20); SRLI(s4, s2, 0x20); ADD(s4, s4, s3); SRLI(s5, s5, 0x20); ADD(s5, s5, s4); // hi SRAI(s5, s5, 0x20); - BEQZ(s5, 8); - ORI(xFlags, xFlags, 1 << F_CF); } else { - AND(s3, s1, xMASK); - AND(s4, s2, xMASK); + ZEXTW2(s3, s1); + ZEXTW2(s4, s2); ADD(s5, s3, s4); SRLI(s5, s5, 0x20); - BEQZ(s5, 8); - ORI(xFlags, xFlags, 1 << F_CF); } + SET_FLAGS_NEZ(s5, F_CF, s4); } - IFX(X_AF | X_OF) { - OR(s3, s1, s2); // s3 = op1 | op2 - AND(s4, s1, s2); // s4 = op1 & op2 + IFX (X_AF | X_OF) { + OR(s3, s1, s2); // s3 = op1 | op2 + AND(s4, s1, s2); // s4 = op1 & op2 } ADDxw(s1, s1, s2); - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_AF | X_OF) { - if(rv64_zbb) { - ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) + IFX (X_AF | X_OF) { + if (cpuext.zbb) { + ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) } else { - NOT(s5, s1); // s5 = ~res - AND(s3, s5, s3); // s3 = ~res & (op1 | op2) + NOT(s5, s1); // s5 = ~res + AND(s3, s5, s3); // s3 = ~res & (op1 | op2) } - OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) - IFX(X_AF) { + OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) + IFX (X_AF) { ANDI(s4, s3, 0x08); // AF: cc & 0x08 - BEQZ(s4, 8); - ORI(xFlags, xFlags, 1 << F_AF); + SET_FLAGS_NEZ(s4, F_AF, s5); } - IFX(X_OF) { - SRLI(s3, s3, rex.w?62:30); + IFX (X_OF) { + SRLI(s3, s3, rex.w ? 62 : 30); SRLI(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF2); + SET_FLAGS_NEZ(s3, F_OF2, s5); } } - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s5); } - if (!rex.w) { + if (!rex.w && (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion)) { ZEROUP(s1); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADD32 instruction, from s1, constant c, store result in s1 using s3 and s4 as scratch void emit_add32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5) { - CLEAR_FLAGS(); - if(s1==xRSP && (!dyn->insts || dyn->insts[ninst].x64.gen_flags==X_PEND)) - { + if ((s1 == xRSP) && (BOX64DRENV(dynarec_safeflags) < 2) && (!dyn->insts || (dyn->insts[ninst].x64.gen_flags == X_PEND) || (!BOX64ENV(dynarec_df) && (dyn->insts[ninst].x64.gen_flags == X_ALL)))) { // special case when doing math on ESP and only PEND is needed: ignoring it! - if(c >= -2048 && c < 2048) { - ADDIxw(s1, s1, c); + if (c >= -2048 && c < 2048) { + ADDI(s1, s1, c); } else { - MOV64xw(s2, c); - ADDxw(s1, s1, s2); + MOV64x(s2, c); + ADD(s1, s1, s2); + } + if (!rex.w) { + ZEROUP(s1); } return; } - IFX(X_PEND | X_AF | X_CF | X_OF) { + CLEAR_FLAGS(); + IFX (X_PEND | X_AF | X_CF | X_OF) { MOV64xw(s2, c); } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s3, rex.w?d_add64:d_add32b); - } else IFX(X_ALL) { + SET_DF(s3, rex.w ? d_add64 : d_add32b); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { if (rex.w) { - AND(s5, xMASK, s1); - if(rv64_zba) ADDUW(s5, s2, s5); else {AND(s4, xMASK, s2); ADD(s5, s5, s4);} // lo + ZEXTW2(s5, s1); + if (cpuext.zba) // lo + ADDUW(s5, s2, s5); + else { + ZEXTW2(s4, s2); + ADD(s5, s5, s4); + } SRLI(s3, s1, 0x20); SRLI(s4, s2, 0x20); ADD(s4, s4, s3); SRLI(s5, s5, 0x20); ADD(s5, s5, s4); // hi SRAI(s5, s5, 0x20); - BEQZ(s5, 8); - ORI(xFlags, xFlags, 1 << F_CF); } else { - AND(s3, s1, xMASK); - AND(s4, s2, xMASK); + ZEXTW2(s3, s1); + ZEXTW2(s4, s2); ADD(s5, s3, s4); SRLI(s5, s5, 0x20); - BEQZ(s5, 8); - ORI(xFlags, xFlags, 1 << F_CF); } + SET_FLAGS_NEZ(s5, F_CF, s4); } - IFX(X_AF | X_OF) { - OR(s3, s1, s2); // s3 = op1 | op2 - AND(s4, s1, s2); // s4 = op1 & op2 + IFX (X_AF | X_OF) { + OR(s3, s1, s2); // s3 = op1 | op2 + AND(s4, s1, s2); // s4 = op1 & op2 } - if(c >= -2048 && c < 2048) { + if (c >= -2048 && c < 2048) { ADDIxw(s1, s1, c); } else { - IFX(X_PEND | X_AF | X_CF | X_OF) {} else {MOV64xw(s2, c);} + IFX (X_PEND | X_AF | X_CF | X_OF) { + } else { + MOV64xw(s2, c); + } ADDxw(s1, s1, s2); } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_AF | X_OF) { - if(rv64_zbb) { - ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) + IFX (X_AF | X_OF) { + if (cpuext.zbb) { + ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) } else { - NOT(s2, s1); // s2 = ~res - AND(s3, s2, s3); // s3 = ~res & (op1 | op2) + NOT(s2, s1); // s2 = ~res + AND(s3, s2, s3); // s3 = ~res & (op1 | op2) } - OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) - IFX(X_AF) { + OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) + IFX (X_AF) { ANDI(s4, s3, 0x08); // AF: cc & 0x08 - BEQZ(s4, 8); - ORI(xFlags, xFlags, 1 << F_AF); + SET_FLAGS_NEZ(s4, F_AF, s5); } - IFX(X_OF) { - SRLI(s3, s3, rex.w?62:30); + IFX (X_OF) { + SRLI(s3, s3, rex.w ? 62 : 30); SRLI(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF2); + SET_FLAGS_NEZ(s3, F_OF2, s5); } } - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s5); } - if (!rex.w) { + if (!rex.w && (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion)) { ZEROUP(s1); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADD16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_add16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, op1)); SH(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_add16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_OF) { - OR(s3, s1, s2); // s3 = op1 | op2 - AND(s4, s1, s2); // s4 = op1 & op2 + IFX (X_AF | X_OF) { + OR(s3, s1, s2); // s3 = op1 | op2 + AND(s4, s1, s2); // s4 = op1 & op2 } ADD(s1, s1, s2); - IFX(X_PEND) { + IFX (X_PEND) { SW(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_AF | X_OF) { - if(rv64_zbb) { - ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) + IFX (X_AF | X_OF) { + if (cpuext.zbb) { + ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) } else { - NOT(s5, s1); // s5 = ~res - AND(s3, s5, s3); // s3 = ~res & (op1 | op2) + NOT(s5, s1); // s5 = ~res + AND(s3, s5, s3); // s3 = ~res & (op1 | op2) } - OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) - IFX(X_AF) { + OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) + IFX (X_AF) { ANDI(s4, s3, 0x08); // AF: cc & 0x08 - BEQZ(s4, 8); - ORI(xFlags, xFlags, 1 << F_AF); + SET_FLAGS_NEZ(s4, F_AF, s5); } - IFX(X_OF) { + IFX (X_OF) { SRLI(s3, s3, 14); SRLI(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF2); + SET_FLAGS_NEZ(s3, F_OF2, s5); } } - IFX(X_CF) { + IFX (X_CF) { SRLI(s3, s1, 16); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_CF); + SET_FLAGS_NEZ(s3, F_CF, s4); } ZEXTH(s1, s1); - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 15); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADD8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch -void emit_add8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) +void emit_add8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, op1)); SB(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_add8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_OF) { - OR(s3, s1, s2); // s3 = op1 | op2 - AND(s4, s1, s2); // s4 = op1 & op2 + IFX (X_AF | X_OF) { + OR(s3, s1, s2); // s3 = op1 | op2 + AND(s4, s1, s2); // s4 = op1 & op2 } ADD(s1, s1, s2); - IFX(X_AF|X_OF) { - if(rv64_zbb) { - ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) + IFX (X_AF | X_OF) { + if (cpuext.zbb) { + ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) } else { - NOT(s2, s1); // s4 = ~res - AND(s3, s2, s3); // s3 = ~res & (op1 | op2) + NOT(s2, s1); // s4 = ~res + AND(s3, s2, s3); // s3 = ~res & (op1 | op2) } - OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) - IFX(X_AF) { + OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) + IFX (X_AF) { ANDI(s4, s3, 0x08); // AF: cc & 0x08 - BEQZ(s4, 8); - ORI(xFlags, xFlags, 1 << F_AF); + SET_FLAGS_NEZ(s4, F_AF, s5); } - IFX(X_OF) { + IFX (X_OF) { SRLI(s3, s3, 6); SRLI(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF2); + SET_FLAGS_NEZ(s3, F_OF2, s5); } } - IFX(X_CF) { + IFX (X_CF) { SRLI(s3, s1, 8); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_CF); + SET_FLAGS_NEZ(s3, F_CF, s4); } - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } ANDI(s1, s1, 0xff); - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 7); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADD8 instruction, from s1, const c, store result in s1 using s3 and s4 as scratch -void emit_add8c(dynarec_rv64_t* dyn, int ninst, int s1, int c, int s2, int s3, int s4) +void emit_add8c(dynarec_rv64_t* dyn, int ninst, int s1, int c, int s2, int s3, int s4, int s5) { CLEAR_FLAGS(); - IFX(X_PEND) { - MOV32w(s4, c&0xff); + IFX (X_PEND) { + MOV32w(s4, c & 0xff); SB(s1, xEmu, offsetof(x64emu_t, op1)); SB(s4, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_add8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_OF) { - IFX(X_PEND) {} else {MOV32w(s4, c&0xff);} - OR(s3, s1, s4); // s3 = op1 | op2 - AND(s4, s1, s4); // s4 = op1 & op2 + IFX (X_AF | X_OF) { + IFX (X_PEND) { + } else { + MOV32w(s4, c & 0xff); + } + OR(s3, s1, s4); // s3 = op1 | op2 + AND(s4, s1, s4); // s4 = op1 & op2 } ADDI(s1, s1, c); - IFX(X_AF|X_OF) { - if(rv64_zbb) { - ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) + IFX (X_AF | X_OF) { + if (cpuext.zbb) { + ANDN(s3, s3, s1); // s3 = ~res & (op1 | op2) } else { - NOT(s2, s1); // s2 = ~res - AND(s3, s2, s3); // s3 = ~res & (op1 | op2) + NOT(s2, s1); // s2 = ~res + AND(s3, s2, s3); // s3 = ~res & (op1 | op2) } - OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) - IFX(X_AF) { + OR(s3, s3, s4); // cc = (~res & (op1 | op2)) | (op1 & op2) + IFX (X_AF) { ANDI(s4, s3, 0x08); // AF: cc & 0x08 - BEQZ(s4, 8); - ORI(xFlags, xFlags, 1 << F_AF); + SET_FLAGS_NEZ(s4, F_AF, s5); } - IFX(X_OF) { + IFX (X_OF) { SRLI(s3, s3, 6); SRLI(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF2); + SET_FLAGS_NEZ(s3, F_OF2, s5); } } - IFX(X_CF) { + IFX (X_CF) { SRLI(s3, s1, 8); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_CF); + SET_FLAGS_NEZ(s3, F_CF, s4); } - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } ANDI(s1, s1, 0xff); - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 7); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SUB8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_sub8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, op1)); SB(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_sub8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOT(s5, s1); } SUB(s1, s1, s2); ANDI(s1, s1, 0xff); - IFX(X_SF) { + + IFX (X_SF) { SRLI(s3, s1, 7); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } CALC_SUB_FLAGS(s5, s2, s1, s3, s4, 8); - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SUB8 instruction, from s1, constant c, store result in s1 using s3 and s4 as scratch void emit_sub8c(dynarec_rv64_t* dyn, int ninst, int s1, int c, int s2, int s3, int s4, int s5) { - MOV32w(s2, c&0xff); + MOV32w(s2, c & 0xff); emit_sub8(dyn, ninst, s1, s2, s3, s4, s5); } @@ -439,38 +431,38 @@ void emit_sub8c(dynarec_rv64_t* dyn, int ninst, int s1, int c, int s2, int s3, i void emit_sub16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, op1)); SH(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_sub16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOT(s5, s1); } SUBW(s1, s1, s2); - IFX(X_PEND) { + + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } SLLI(s1, s1, 48); - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } SRLI(s1, s1, 48); CALC_SUB_FLAGS(s5, s2, s1, s3, s4, 16); - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } @@ -478,47 +470,45 @@ void emit_sub16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, void emit_sub32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s3, rex.w?d_sub64:d_sub32); - } else IFX(X_ALL) { + SET_DF(s3, rex.w ? d_sub64 : d_sub32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOT(s5, s1); } SUBxw(s1, s1, s2); - IFX(X_PEND) { + + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } - if (!rex.w) { + if (!rex.w && (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion)) { ZEROUP(s1); } - CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w?64:32); - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w ? 64 : 32); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SUB32 instruction, from s1, constant c, store result in s1 using s2, s3, s4 and s5 as scratch void emit_sub32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5) { - CLEAR_FLAGS(); - if(s1==xRSP && (!dyn->insts || dyn->insts[ninst].x64.gen_flags==X_PEND)) - { + if ((s1 == xRSP) && (BOX64DRENV(dynarec_safeflags) < 2) && (!dyn->insts || (dyn->insts[ninst].x64.gen_flags == X_PEND) || (!BOX64ENV(dynarec_df) && (dyn->insts[ninst].x64.gen_flags == X_ALL)))) { // special case when doing math on RSP and only PEND is needed: ignoring it! if (c > -2048 && c <= 2048) { SUBI(s1, s1, c); @@ -526,19 +516,22 @@ void emit_sub32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i MOV64xw(s2, c); SUBxw(s1, s1, s2); } + if (!rex.w) { + ZEROUP(s1); + } return; } - - IFX(X_PEND) { + CLEAR_FLAGS(); + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); MOV64xw(s2, c); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s3, rex.w?d_sub64:d_sub32); - } else IFX(X_ALL) { + SET_DF(s3, rex.w ? d_sub64 : d_sub32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOT(s5, s1); } @@ -546,395 +539,379 @@ void emit_sub32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i if (c > -2048 && c <= 2048) { ADDIxw(s1, s1, -c); } else { - IFX(X_PEND) {} else {MOV64xw(s2, c);} + IFX (X_PEND) { + } else { + MOV64xw(s2, c); + } SUBxw(s1, s1, s2); } - IFX(X_AF | X_CF | X_OF) { - IFX(X_PEND) {} - else if (c > -2048 && c <= 2048) { + IFX (X_AF | X_CF | X_OF) { + IFX (X_PEND) { + } else if (c > -2048 && c <= 2048) { MOV64xw(s2, c); } } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } - if (!rex.w) { + if (!rex.w && (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion)) { ZEROUP(s1); } - CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w?64:32); - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w ? 64 : 32); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit INC8 instruction, from s1, store result in s1 using s2, s3 and s4 as scratch void emit_inc8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { - IFX(X_ALL) { - ANDI(xFlags, xFlags, ~((1UL<insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit DEC8 instruction, from s1, store result in s1 using s2, s3 and s4 as scratch void emit_dec8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { - IFX(X_ALL) { - ANDI(xFlags, xFlags, ~((1UL<insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit INC32 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_inc32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) { - IFX(X_ALL) { - ANDI(xFlags, xFlags, ~((1UL<insts[ninst].nat_flags_fusion)) { ZEROUP(s1); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s2); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit DEC32 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_dec32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) { - IFX(X_ALL) { - ANDI(xFlags, xFlags, ~((1UL<insts[ninst].nat_flags_fusion)) { ZEROUP(s1); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s2); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit INC16 instruction, from s1, store result in s1 using s3 and s4 as scratch -void emit_inc16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) +void emit_inc16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { - IFX(X_ALL) { - ANDI(xFlags, xFlags, ~((1UL<insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit DEC16 instruction, from s1, store result in s1 using s3 and s4 as scratch void emit_dec16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { - IFX(X_ALL) { - ANDI(xFlags, xFlags, ~((1UL<insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SBB8 instruction, from s1, s2, store result in s1 using s3, s4 and s5 as scratch void emit_sbb8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, op1)); SB(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_sbb8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOT(s5, s1); } @@ -945,35 +922,35 @@ void emit_sbb8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i ANDI(s1, s1, 0xff); CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } CALC_SUB_FLAGS(s5, s2, s1, s3, s4, 8); - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 7); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s5); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADC8 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch -void emit_adc8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { - IFX(X_PEND) { +void emit_adc8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) +{ + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, op1)); SH(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_adc8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_OF) { + IFX (X_AF | X_OF) { OR(s4, s1, s2); // s4 = op1 | op2 AND(s5, s1, s2); // s5 = op1 & op2 } @@ -983,78 +960,75 @@ void emit_adc8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i ADD(s1, s1, s3); CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SW(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_AF | X_OF) { - if(rv64_zbb) { - ANDN(s3, s4, s1); // s3 = ~res & (op1 | op2) + IFX (X_AF | X_OF) { + if (cpuext.zbb) { + ANDN(s3, s4, s1); // s3 = ~res & (op1 | op2) } else { NOT(s2, s1); // s2 = ~res AND(s3, s2, s4); // s3 = ~res & (op1 | op2) } - OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2) - IFX(X_AF) { + OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2) + IFX (X_AF) { ANDI(s4, s3, 0x08); // AF: cc & 0x08 - BEQZ(s4, 8); - ORI(xFlags, xFlags, 1 << F_AF); + SET_FLAGS_NEZ(s4, F_AF, s5); } - IFX(X_OF) { + IFX (X_OF) { SRLI(s3, s3, 6); SRLI(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF2); + SET_FLAGS_NEZ(s3, F_OF2, s5); } } - IFX(X_CF) { + IFX (X_CF) { SRLI(s3, s1, 8); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_CF); + SET_FLAGS_NEZ(s3, F_CF, s5); } ANDI(s1, s1, 0xff); - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 7); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADC8 instruction, from s1, const c, store result in s1 using s3, s4, s5 and s6 as scratch -void emit_adc8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5, int s6) { - MOV32w(s5, c&0xff); +void emit_adc8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5, int s6) +{ + MOV32w(s5, c & 0xff); emit_adc8(dyn, ninst, s1, s5, s3, s4, s6); } // emit SBB8 instruction, from s1, constant c, store result in s1 using s3, s4, s5 and s6 as scratch void emit_sbb8c(dynarec_rv64_t* dyn, int ninst, int s1, int c, int s3, int s4, int s5, int s6) { - MOV32w(s6, c&0xff); + MOV32w(s6, c & 0xff); emit_sbb8(dyn, ninst, s1, s6, s3, s4, s5); } // emit SBB16 instruction, from s1, s2, store result in s1 using s3, s4 and s5 as scratch void emit_sbb16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, op1)); SH(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_sbb16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOT(s5, s1); } @@ -1065,38 +1039,37 @@ void emit_sbb16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, CLEAR_FLAGS(); SLLIW(s1, s1, 16); - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s4, s5); } SRLIW(s1, s1, 16); - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } CALC_SUB_FLAGS(s5, s2, s1, s3, s4, 16); - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SBB32 instruction, from s1, s2, store result in s1 using s3, s4 and s5 as scratch void emit_sbb32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) { - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s3, rex.w?d_sbb64:d_sbb32); - } else IFX(X_ALL) { + SET_DF(s3, rex.w ? d_sbb64 : d_sbb32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOT(s5, s1); } @@ -1106,210 +1079,202 @@ void emit_sbb32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s SUBxw(s1, s1, s3); CLEAR_FLAGS(); - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s4, s5); } - if (!rex.w) { + if (!rex.w && (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion)) { ZEROUP(s1); } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w?64:32); - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + CALC_SUB_FLAGS(s5, s2, s1, s3, s4, rex.w ? 64 : 32); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit NEG32 instruction, from s1, store result in s1 using s2 and s3 as scratch -void emit_neg32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3) +void emit_neg32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s3, rex.w?d_neg64:d_neg32); - } else IFX(X_ALL) { + SET_DF(s3, rex.w ? d_neg64 : d_neg32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_OF) { - MV(s3, s1); // s3 = op1 + IFX (X_AF | X_OF) { + MV(s3, s1); // s3 = op1 } NEGxw(s1, s1); - IFX(X_PEND) { + + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_CF) { - BEQZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_CF); + IFX (X_CF) { + SET_FLAGS_NEZ(s1, F_CF, s4); } - IFX(X_AF | X_OF) { + IFX (X_AF | X_OF) { OR(s3, s1, s3); // s3 = res | op1 - IFX(X_AF) { + IFX (X_AF) { /* af = bc & 0x8 */ ANDI(s2, s3, 8); - BEQZ(s2, 8); - ORI(xFlags, xFlags, 1 << F_AF); + SET_FLAGS_NEZ(s2, F_AF, s4); } - IFX(X_OF) { + IFX (X_OF) { /* of = ((bc >> (width-2)) ^ (bc >> (width-1))) & 0x1; */ - SRLI(s2, s3, (rex.w?64:32)-2); + SRLI(s2, s3, (rex.w ? 64 : 32) - 2); SRLI(s3, s2, 1); XOR(s2, s2, s3); ANDI(s2, s2, 1); - BEQZ(s2, 8); - ORI(xFlags, xFlags, 1 << F_OF2); + SET_FLAGS_NEZ(s2, F_OF2, s4); } } - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s4, s5); } - if (!rex.w) { + if (!rex.w && (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion)) { ZEROUP(s1); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s2); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit NEG16 instruction, from s1, store result in s1 using s2 and s3 as scratch -void emit_neg16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3) +void emit_neg16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s3, d_neg16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_OF) { - MV(s3, s1); // s3 = op1 + IFX (X_AF | X_OF) { + MV(s3, s1); // s3 = op1 } NEG(s1, s1); ZEXTH(s1, s1); - IFX(X_PEND) { + + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_CF) { - BEQZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_CF); + IFX (X_CF) { + SET_FLAGS_NEZ(s1, F_CF, s4); } - IFX(X_AF | X_OF) { + IFX (X_AF | X_OF) { OR(s3, s1, s3); // s3 = res | op1 - IFX(X_AF) { + IFX (X_AF) { /* af = bc & 0x8 */ ANDI(s2, s3, 8); - BEQZ(s2, 8); - ORI(xFlags, xFlags, 1 << F_AF); + SET_FLAGS_NEZ(s2, F_AF, s4); } - IFX(X_OF) { + IFX (X_OF) { /* of = ((bc >> (width-2)) ^ (bc >> (width-1))) & 0x1; */ SRLI(s2, s3, 14); SRLI(s3, s2, 1); XOR(s2, s2, s3); ANDI(s2, s2, 1); - BEQZ(s2, 8); - ORI(xFlags, xFlags, 1 << F_OF2); + SET_FLAGS_NEZ(s2, F_OF2, s4); } } - IFX(X_SF) { - SRLI(s3, s1, 15-F_SF); // put sign bit in place - ANDI(s3, s3, 1 << F_SF); // 1<insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit NEG8 instruction, from s1, store result in s1 using s2 and s3 as scratch -void emit_neg8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3) +void emit_neg8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4) { CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s3, d_neg8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_OF) { - MV(s3, s1); // s3 = op1 + IFX (X_AF | X_OF) { + MV(s3, s1); // s3 = op1 } NEG(s1, s1); ANDI(s1, s1, 0xff); - IFX(X_PEND) { + + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_CF) { - BEQZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_CF); + IFX (X_CF) { + SET_FLAGS_NEZ(s1, F_CF, s4); } - IFX(X_AF | X_OF) { + IFX (X_AF | X_OF) { OR(s3, s1, s3); // s3 = res | op1 - IFX(X_AF) { + IFX (X_AF) { /* af = bc & 0x8 */ ANDI(s2, s3, 8); - BEQZ(s2, 8); - ORI(xFlags, xFlags, 1 << F_AF); + SET_FLAGS_NEZ(s2, F_AF, s4); } - IFX(X_OF) { + IFX (X_OF) { /* of = ((bc >> (width-2)) ^ (bc >> (width-1))) & 0x1; */ SRLI(s2, s3, 6); SRLI(s3, s2, 1); XOR(s2, s2, s3); ANDI(s2, s2, 1); - BEQZ(s2, 8); - ORI(xFlags, xFlags, 1 << F_OF2); + SET_FLAGS_NEZ(s2, F_OF2, s4); } } - IFX(X_SF) { - ANDI(s3, s1, 1 << F_SF); // 1<insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADC16 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_adc16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, op1)); SH(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s3, d_adc16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_AF | X_OF) { + IFX (X_AF | X_OF) { OR(s4, s1, s2); // s4 = op1 | op2 AND(s5, s1, s2); // s5 = op1 & op2 } @@ -1319,69 +1284,70 @@ void emit_adc16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, ADD(s1, s1, s3); CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SW(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_AF | X_OF) { - if(rv64_zbb) { - ANDN(s3, s4, s1); // s3 = ~res & (op1 | op2) + IFX (X_AF | X_OF) { + if (cpuext.zbb) { + ANDN(s3, s4, s1); // s3 = ~res & (op1 | op2) } else { NOT(s2, s1); // s2 = ~res AND(s3, s2, s4); // s3 = ~res & (op1 | op2) } - OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2) - IFX(X_AF) { + OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2) + IFX (X_AF) { ANDI(s4, s3, 0x08); // AF: cc & 0x08 - BEQZ(s4, 8); - ORI(xFlags, xFlags, 1 << F_AF); + SET_FLAGS_NEZ(s4, F_AF, s5); } - IFX(X_OF) { + IFX (X_OF) { SRLI(s3, s3, 14); SRLI(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF2); + SET_FLAGS_NEZ(s3, F_OF2, s5); } } - IFX(X_CF) { + IFX (X_CF) { SRLI(s3, s1, 16); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_CF); + SET_FLAGS_NEZ(s3, F_CF, s5); } ZEXTH(s1, s1); - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 15); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ADC32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch void emit_adc32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5, int s6) { - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s3, rex.w?d_adc64:d_adc32b); - } else IFX(X_ALL) { + SET_DF(s3, rex.w ? d_adc64 : d_adc32b); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { if (rex.w) { - AND(s5, xMASK, s1); - if(rv64_zba) ADDUW(s5, s2, s5); else {AND(s4, xMASK, s2); ADD(s5, s5, s4);} // lo + ZEXTW2(s5, s1); + if (cpuext.zba) + ADDUW(s5, s2, s5); + else { + ZEXTW2(s4, s2); + ADD(s5, s5, s4); + } // lo ANDI(s3, xFlags, 1); - ADD(s5, s5, s3); // add carry + ADD(s5, s5, s3); // add carry SRLI(s3, s1, 0x20); SRLI(s4, s2, 0x20); ADD(s4, s4, s3); @@ -1389,15 +1355,15 @@ void emit_adc32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s ADD(s5, s5, s4); // hi SRAI(s6, s5, 0x20); } else { - AND(s3, s1, xMASK); - AND(s4, s2, xMASK); + ZEXTW2(s3, s1); + ZEXTW2(s4, s2); ADD(s5, s3, s4); ANDI(s3, xFlags, 1); - ADD(s5, s5, s3); // add carry + ADD(s5, s5, s3); // add carry SRLI(s6, s5, 0x20); } } - IFX(X_AF | X_OF) { + IFX (X_AF | X_OF) { OR(s4, s1, s2); // s4 = op1 | op2 AND(s5, s1, s2); // s5 = op1 & op2 } @@ -1407,47 +1373,43 @@ void emit_adc32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s ADDxw(s1, s1, s3); CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_CF) { - BEQZ(s6, 8); - ORI(xFlags, xFlags, 1 << F_CF); - } - IFX(X_AF | X_OF) { - if(rv64_zbb) { - ANDN(s3, s4, s1); // s3 = ~res & (op1 | op2) + IFX (X_AF | X_OF) { + if (cpuext.zbb) { + ANDN(s3, s4, s1); // s3 = ~res & (op1 | op2) } else { NOT(s3, s1); // s2 = ~res AND(s3, s3, s4); // s3 = ~res & (op1 | op2) } - OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2) - IFX(X_AF) { + OR(s3, s3, s5); // cc = (~res & (op1 | op2)) | (op1 & op2) + IFX (X_AF) { ANDI(s4, s3, 0x08); // AF: cc & 0x08 - BEQZ(s4, 8); - ORI(xFlags, xFlags, 1 << F_AF); + SET_FLAGS_NEZ(s4, F_AF, s5); } - IFX(X_OF) { - SRLI(s3, s3, rex.w?62:30); + IFX (X_OF) { + SRLI(s3, s3, rex.w ? 62 : 30); SRLI(s4, s3, 1); XOR(s3, s3, s4); ANDI(s3, s3, 1); // OF: xor of two MSB's of cc - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_OF2); + SET_FLAGS_NEZ(s3, F_OF2, s5); } } - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_CF) { + SET_FLAGS_NEZ(s6, F_CF, s5); + } + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s5, s6); } - if (!rex.w) { + if (!rex.w && (IS_GPR(s1) || dyn->insts[ninst].nat_flags_fusion)) { ZEROUP(s1); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } diff --git a/src/dynarec/rv64/dynarec_rv64_emit_shift.c b/src/dynarec/rv64/dynarec_rv64_emit_shift.c index 62fc485..ba42db1 100644 --- a/src/dynarec/rv64/dynarec_rv64_emit_shift.c +++ b/src/dynarec/rv64/dynarec_rv64_emit_shift.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,7 +17,7 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" // emit SHL8 instruction, from s1 , constant c, store result in s1 using s3, s4 and s5 as scratch void emit_shl8c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5) @@ -28,69 +26,70 @@ void emit_shl8c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int // c != 0 CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { MOV64x(s3, c); SB(s3, xEmu, offsetof(x64emu_t, op2)); SB(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s4, d_shl8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } + IFX (X_OF) { + SRLI(s3, s1, 6); + SRLI(s4, s3, 1); + XOR(s3, s3, s4); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } + if (c < 8) { - IFX(X_CF|X_OF) { - SRLI(s3, s1, 8-c); + IFX (X_CF) { + SRLI(s3, s1, 8 - c); ANDI(s5, s3, 1); // LSB == F_CF - IFX(X_CF) { - OR(xFlags, xFlags, s5); - } + OR(xFlags, xFlags, s5); } - SLLI(s1, s1, c+56); - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SLLI(s1, s1, c + 56); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } SRLI(s1, s1, 56); - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); - } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts - if (c == 1) { - SRLI(s3, s1, 7); - XOR(s3, s3, s5); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } else { - IFX(X_CF) { + IFX (X_CF) { if (c == 8) { ANDI(s3, s1, 1); OR(xFlags, xFlags, s3); // F_CF == 0 } } MV(s1, xZR); - // OF nop + + IFX (X_PEND) { + SB(s1, xEmu, offsetof(x64emu_t, res)); + } // SF nop // AF nop - IFX(X_PF | X_ZF) { - IFX(X_ZF) { + IFX (X_PF | X_ZF) { + IFX (X_ZF) { ORI(xFlags, xFlags, 1 << F_ZF); } - IFX(X_PF) { + IFX (X_PF) { ORI(xFlags, xFlags, 1 << F_PF); } } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(xZR, xZR, xZR, xZR); } } @@ -100,17 +99,17 @@ void emit_shr8c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int if (!c) return; // c != 0 CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { MOV64x(s3, c); SB(s3, xEmu, offsetof(x64emu_t, op2)); SB(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s4, d_shr8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { if (c > 1) { - SRAI(s3, s1, c-1); + SRAI(s3, s1, c - 1); ANDI(s3, s3, 1); // LSB == F_CF } else { // no need to shift @@ -118,30 +117,26 @@ void emit_shr8c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int } OR(xFlags, xFlags, s3); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts - // OF flag is set to the most-significant bit of the original operand - if (c == 1) { - SRLI(s3, s1, 7); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } + IFX (X_OF) { + SRLI(s3, s1, 7); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); } SRLI(s1, s1, c); ANDI(s1, s1, 0xff); // SF should be unset - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SAR8 instruction, from s1 , constant c, store result in s1 using s3, s4 and s5 as scratch @@ -150,17 +145,17 @@ void emit_sar8c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int if (!c) return; // c != 0 CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { MOV64x(s3, c); SB(s3, xEmu, offsetof(x64emu_t, op2)); SB(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s4, d_sar8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { if (c > 1) { - SRAI(s3, s1, c-1); + SRAI(s3, s1, c - 1); ANDI(s3, s3, 1); // LSB == F_CF } else { // no need to shift @@ -170,25 +165,24 @@ void emit_sar8c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int } // For the SAR instruction, the OF flag is cleared for all 1-bit shifts. // OF nop - IFX(X_SF) { + IFX (X_SF) { // SF is the same as the original operand - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } SRLI(s1, s1, c); ANDI(s1, s1, 0xff); - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SHL8 instruction, from s1 , shift s2, store result in s1 using s3, s4 and s5 as scratch @@ -196,50 +190,48 @@ void emit_shl8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i { // s2 is not 0 here and is 1..1f/3f CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, op1)); SB(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, d_shl8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } + + IFX (X_OF) { + SRLI(s3, s1, 6); + SRLI(s4, s3, 1); + XOR(s3, s3, s4); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } + SLL(s1, s1, s2); - IFX(X_CF | X_OF) { + IFX (X_CF) { SRLI(s5, s1, 8); ANDI(s5, s5, 1); // LSB == F_CF - IFX(X_CF) { - OR(xFlags, xFlags, s5); - } + OR(xFlags, xFlags, s5); } SLLI(s1, s1, 56); - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } SRLI(s1, s1, 56); - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); - } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts - ADDI(s3, s2, -1); - BNEZ(s3, 4 + 4 * 4); - SRLI(s3, s1, 7); - XOR(s3, s3, s5); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SHR8 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3 and s4 as scratch @@ -249,25 +241,21 @@ void emit_shr8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SB(s2, xEmu, offsetof(x64emu_t, op2)); SB(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s4, d_shr8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { SUBI(s3, s2, 1); SRA(s3, s1, s3); ANDI(s3, s3, 1); // LSB == F_CF OR(xFlags, xFlags, s3); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts - // OF flag is set to the most-significant bit of the original operand - ADDI(s3, xZR, 1); - BNE(s2, s3, 4 + 3 * 4); + IFX (X_OF) { SRLI(s3, s1, 7); SLLI(s3, s3, F_OF2); OR(xFlags, xFlags, s3); @@ -277,16 +265,16 @@ void emit_shr8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i ANDI(s1, s1, 0xff); // SF should be unset - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SAR8 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3, s4 and s5 as scratch @@ -296,14 +284,14 @@ void emit_sar8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SB(s2, xEmu, offsetof(x64emu_t, op2)); SB(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s4, d_sar8); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { SUBI(s3, s2, 1); SRA(s3, s1, s3); ANDI(s3, s3, 1); // LSB == F_CF @@ -311,25 +299,24 @@ void emit_sar8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i } // For the SAR instruction, the OF flag is cleared for all 1-bit shifts. // OF nop - IFX(X_SF) { + IFX (X_SF) { // SF is the same as the original operand - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } SRL(s1, s1, s2); ANDI(s1, s1, 0xff); - IFX(X_PEND) { + IFX (X_PEND) { SB(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SHL16 instruction, from s1 , constant c, store result in s1 using s3, s4 and s5 as scratch @@ -339,69 +326,69 @@ void emit_shl16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int // c != 0 CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { MOV64x(s3, c); SH(s3, xEmu, offsetof(x64emu_t, op2)); SH(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s4, d_shl16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } + IFX (X_OF) { + SRLI(s3, s1, 14); + SRLI(s5, s3, 1); + XOR(s3, s3, s5); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } + if (c < 16) { - IFX(X_CF|X_OF) { - SRLI(s3, s1, 16-c); + IFX (X_CF) { + SRLI(s3, s1, 16 - c); ANDI(s5, s3, 1); // LSB == F_CF - IFX(X_CF) { - OR(xFlags, xFlags, s5); - } + OR(xFlags, xFlags, s5); } - SLLI(s1, s1, c+48); - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SLLI(s1, s1, c + 48); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } SRLI(s1, s1, 48); - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts - if (c == 1) { - SRLI(s3, s1, 15); - XOR(s3, s3, s5); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } - } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } else { - IFX(X_CF) { - if (c == 16) { - ANDI(s3, s1, 1); - OR(xFlags, xFlags, s3); // F_CF == 0 - } + IFXA (X_CF, (c == 16)) { + ANDI(s3, s1, 1); + OR(xFlags, xFlags, s3); // F_CF == 0 } MV(s1, xZR); + + IFX (X_PEND) { + SH(s1, xEmu, offsetof(x64emu_t, res)); + } // OF nop // SF nop // AF nop - IFX(X_PF | X_ZF) { - IFX(X_ZF) { + IFX (X_PF | X_ZF) { + IFX (X_ZF) { ORI(xFlags, xFlags, 1 << F_ZF); } - IFX(X_PF) { + IFX (X_PF) { ORI(xFlags, xFlags, 1 << F_PF); } } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(xZR, xZR, xZR, xZR); } } @@ -411,17 +398,17 @@ void emit_shr16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int if (!c) return; // c != 0 CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { MOV64x(s3, c); SH(s3, xEmu, offsetof(x64emu_t, op2)); SH(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s4, d_shr16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { if (c > 1) { - SRAI(s3, s1, c-1); + SRAI(s3, s1, c - 1); ANDI(s3, s3, 1); // LSB == F_CF } else { // no need to shift @@ -429,29 +416,27 @@ void emit_shr16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int } OR(xFlags, xFlags, s3); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts + IFX (X_OF) { // OF flag is set to the most-significant bit of the original operand - if (c == 1) { - SRLI(s3, s1, 15); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } + SRLI(s3, s1, 15); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); } SRLI(s1, s1, c); + // SF should be unset - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SAR16 instruction, from s1 , constant c, store result in s1 using s3, s4 and s5 as scratch @@ -460,17 +445,17 @@ void emit_sar16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int if (!c) return; // c != 0 CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { MOV64x(s3, c); SH(s3, xEmu, offsetof(x64emu_t, op2)); SH(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s4, d_sar16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { if (c > 1) { - SRAI(s3, s1, c-1); + SRAI(s3, s1, c - 1); ANDI(s3, s3, 1); // LSB == F_CF } else { // no need to shift @@ -478,35 +463,26 @@ void emit_sar16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int } OR(xFlags, xFlags, s3); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts - // OF flag is set to the most-significant bit of the original operand - if (c == 1) { - SRLI(s3, s1, 15); - ANDI(s3, s3, 1); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } - } - IFX(X_SF) { + // For the SAR instruction, the OF flag is cleared for all 1-bit shifts. + // OF nop + IFX (X_SF) { // SF is the same as the original operand - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } SRLI(s1, s1, c); ZEXTH(s1, s1); - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } @@ -515,50 +491,47 @@ void emit_shl16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, { // s2 is not 0 here and is 1..1f/3f CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, op1)); SH(s2, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, d_shl16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } + IFX (X_OF) { + SRLI(s3, s1, 14); + SRLI(s5, s3, 1); + XOR(s3, s3, s5); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } + SLL(s1, s1, s2); - IFX(X_CF | X_OF) { + IFX (X_CF) { SRLI(s5, s1, 16); ANDI(s5, s5, 1); // LSB == F_CF - IFX(X_CF) { - OR(xFlags, xFlags, s5); - } + OR(xFlags, xFlags, s5); } SLLI(s1, s1, 48); - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } SRLI(s1, s1, 48); - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts - ADDI(s3, s2, -1); - BNEZ(s3, 4 + 4 * 4); - SRLI(s3, s1, 15); - XOR(s3, s3, s5); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SHR16 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3 and s4 as scratch @@ -568,25 +541,22 @@ void emit_shr16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SH(s2, xEmu, offsetof(x64emu_t, op2)); SH(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s4, d_shr16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { SUBI(s3, s2, 1); SRA(s3, s1, s3); ANDI(s3, s3, 1); // LSB == F_CF OR(xFlags, xFlags, s3); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts + IFX (X_OF) { // OF flag is set to the most-significant bit of the original operand - ADDI(s3, xZR, 1); - BNE(s2, s3, 4 + 3 * 4); SRLI(s3, s1, 15); SLLI(s3, s3, F_OF2); OR(xFlags, xFlags, s3); @@ -596,16 +566,16 @@ void emit_shr16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, ZEXTH(s1, s1); // SF should be unset - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SAR16 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3, s4 and s5 as scratch @@ -615,14 +585,14 @@ void emit_sar16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SH(s2, xEmu, offsetof(x64emu_t, op2)); SH(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, d_sar8); - } else IFX(X_ALL) { + SET_DF(s4, d_sar16); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { SUBI(s3, s2, 1); SRA(s3, s1, s3); ANDI(s3, s3, 1); // LSB == F_CF @@ -630,25 +600,24 @@ void emit_sar16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, } // For the SAR instruction, the OF flag is cleared for all 1-bit shifts. // OF nop - IFX(X_SF) { + IFX (X_SF) { // SF is the same as the original operand - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } SRL(s1, s1, s2); ZEXTH(s1, s1); - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SHL32 instruction, from s1 , shift s2, store result in s1 using s3, s4 and s5 as scratch @@ -656,20 +625,28 @@ void emit_shl32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s { // s2 is not 0 here and is 1..1f/3f CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s4, rex.w?d_shl64:d_shl32); - } else IFX(X_ALL) { + SET_DF(s4, rex.w ? d_shl64 : d_shl32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF|X_OF) { - SUBI(s5, s2, rex.w?64:32); + IFX (X_OF) { + SRLIxw(s3, s1, rex.w ? 62 : 30); + SRLI(s5, s3, 1); + XOR(s3, s3, s5); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } + IFX (X_CF) { + SUBI(s5, s2, rex.w ? 64 : 32); NEG(s5, s5); SRL(s3, s1, s5); ANDI(s5, s3, 1); // LSB == F_CF - IFX(X_CF) { + IFX (X_CF) { OR(xFlags, xFlags, s5); } } @@ -680,32 +657,22 @@ void emit_shl32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s SLLW(s1, s1, s2); } - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } if (!rex.w) { ZEROUP(s1); } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts - ADDI(s3, s2, -1); - BNEZ(s3, 4 + 4 * 4); - SRLIxw(s3, s1, rex.w?63:31); - XOR(s3, s3, s5); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SHL32 instruction, from s1 , constant c, store result in s1 using s3, s4 and s5 as scratch void emit_shl32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4, int s5) @@ -716,21 +683,27 @@ void emit_shl32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, } CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { MOV64x(s3, c); SDxw(s3, xEmu, offsetof(x64emu_t, op2)); SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w?d_shl64:d_shl32); - } else IFX(X_ALL) { + SET_DF(s4, rex.w ? d_shl64 : d_shl32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF|X_OF) { - SRLI(s3, s1, (rex.w?64:32)-c); + IFX (X_OF) { + SRLIxw(s3, s1, rex.w ? 62 : 30); + SRLI(s5, s3, 1); + XOR(s3, s3, s5); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } + IFX (X_CF) { + SRLI(s3, s1, (rex.w ? 64 : 32) - c); ANDI(s5, s3, 1); // LSB == F_CF - IFX(X_CF) { - OR(xFlags, xFlags, s5); - } + OR(xFlags, xFlags, s5); } if (rex.w) { @@ -739,32 +712,22 @@ void emit_shl32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, SLLIW(s1, s1, c); } - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } if (!rex.w) { ZEROUP(s1); } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts - if (c == 1) { - SRLIxw(s3, s1, rex.w?63:31); - XOR(s3, s3, s5); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } - } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SHR32 instruction, from s1 , shift s2 (!0 and and'd already), store result in s1 using s3 and s4 as scratch @@ -774,74 +737,68 @@ void emit_shr32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s2, xEmu, offsetof(x64emu_t, op2)); SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w?d_shr64:d_shr32); - } else IFX(X_ALL) { + SET_DF(s4, rex.w ? d_shr64 : d_shr32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { SUBI(s3, s2, 1); SRA(s3, s1, s3); ANDI(s3, s3, 1); // LSB == F_CF OR(xFlags, xFlags, s3); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts + IFX (X_OF) { // OF flag is set to the most-significant bit of the original operand - ADDI(s3, xZR, 1); - BNE(s2, s3, 4 + 3 * 4); - SRLIxw(s3, s1, rex.w?63:31); + SRLIxw(s3, s1, rex.w ? 63 : 31); SLLI(s3, s3, F_OF2); OR(xFlags, xFlags, s3); } SRL(s1, s1, s2); - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } if (!rex.w) { ZEROUP(s1); } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SHR32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch void emit_shr32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4) { - if (!c) { - if (!rex.w) ZEROUP(s1); - return; - } + if (!c) return; CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { if (c) { MOV64x(s3, c); SDxw(s3, xEmu, offsetof(x64emu_t, op2)); - } else SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); + } else + SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w?d_shr64:d_shr32); - } else IFX(X_ALL) { + SET_DF(s4, rex.w ? d_shr64 : d_shr32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { if (c > 1) { - SRAI(s3, s1, c-1); + SRAI(s3, s1, c - 1); ANDI(s3, s3, 1); // LSB == F_CF } else { // no need to shift @@ -849,14 +806,11 @@ void emit_shr32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, } OR(xFlags, xFlags, s3); } - IFX(X_OF) { - // OF flag is affected only on 1-bit shifts + IFX (X_OF) { // OF flag is set to the most-significant bit of the original operand - if(c==1) { - SRLIxw(s3, s1, rex.w?63:31); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } + SRLIxw(s3, s1, rex.w ? 63 : 31); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); } if (rex.w) { @@ -865,23 +819,22 @@ void emit_shr32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, SRLIW(s1, s1, c); } - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } if (!rex.w && c == 0) { ZEROUP(s1); } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SAR32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch @@ -894,19 +847,20 @@ void emit_sar32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { if (c) { MOV64x(s3, c); SDxw(s3, xEmu, offsetof(x64emu_t, op2)); - } else SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); + } else + SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w?d_sar64:d_sar32); - } else IFX(X_ALL) { + SET_DF(s4, rex.w ? d_sar64 : d_sar32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { if (c > 1) { - SRAI(s3, s1, c-1); + SRAI(s3, s1, c - 1); ANDI(s3, s3, 1); // LSB == F_CF } else { // no need to shift @@ -914,6 +868,8 @@ void emit_sar32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, } OR(xFlags, xFlags, s3); } + // For the SAR instruction, the OF flag is cleared for all 1-bit shifts. + // OF nop if (rex.w) { SRAI(s1, s1, c); @@ -922,23 +878,22 @@ void emit_sar32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, } // SRAIW sign-extends, so test sign bit before clearing upper bits - IFX(X_SF) { - BGE(s1, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } if (!rex.w) { ZEROUP(s1); } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ROL32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch @@ -946,55 +901,53 @@ void emit_rol32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s { int64_t j64; - if(rex.w) { - ANDI(s4, s2, 0x3f); - } else { - ANDI(s4, s2, 0x1f); - } if (!rex.w) { ZEROUP(s1); } - BEQ_NEXT(s4, xZR); - IFX(X_PEND) { + BEQ_NEXT(s2, xZR); + IFX (X_PEND) { SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s4, rex.w?d_rol64:d_rol32); - } else IFX(X_ALL) { + SET_DF(s4, rex.w ? d_rol64 : d_rol32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if(rv64_zbb) { + IFX (X_CF | X_OF) { + ANDI(xFlags, xFlags, ~((1UL << F_CF) | (1UL << F_OF2))); + } + + IFX (X_OF) { + SRLIxw(s3, s1, rex.w ? 62 : 30); + SRLI(s4, s3, 1); + XOR(s3, s3, s4); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } + + if (cpuext.zbb) { if (rex.w) { - ROL(s1, s1, s4); + ROL(s1, s1, s2); } else { - ROLW(s1, s1, s4); + ROLW(s1, s1, s2); ZEROUP(s1); } } else { - SLLxw(s3, s1, s4); - NEG(s4, s4); - ADDI(s4, s4, rex.w?64:32); + SLLxw(s3, s1, s2); + NEG(s4, s2); + ADDI(s4, s4, rex.w ? 64 : 32); SRLxw(s1, s1, s4); OR(s1, s3, s1); } - IFX(X_PEND) { + + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_CF | X_OF) { - ANDI(xFlags, xFlags, ~((1UL<insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ROR32 instruction, from s1, s2, store result in s1 using s3 and s4 as scratch @@ -1002,57 +955,83 @@ void emit_ror32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s { int64_t j64; - if(rex.w) { - ANDI(s4, s2, 0x3f); - } else { - ANDI(s4, s2, 0x1f); - } if (!rex.w) { ZEROUP(s1); } - BEQ_NEXT(s4, xZR); - IFX(X_PEND) { + BEQ_NEXT(s2, xZR); + IFX (X_PEND) { SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s4, rex.w?d_ror64:d_ror32); - } else IFX(X_ALL) { + SET_DF(s4, rex.w ? d_ror64 : d_ror32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if(rv64_zbb) { + IFX (X_CF | X_OF) { + ANDI(xFlags, xFlags, ~(1UL << F_CF | 1UL << F_OF2)); + } + + IFX (X_OF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + XOR(s3, s3, s1); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } + + if (cpuext.zbb) { if (rex.w) { - ROR(s1, s1, s4); + ROR(s1, s1, s2); } else { - RORW(s1, s1, s4); + RORW(s1, s1, s2); ZEROUP(s1); } } else { - SRLxw(s3, s1, s4); - NEG(s4, s4); - ADDI(s4, s4, rex.w?64:32); + SRLxw(s3, s1, s2); + NEG(s4, s2); + ADDI(s4, s4, rex.w ? 64 : 32); SLLxw(s1, s1, s4); OR(s1, s3, s1); } - IFX(X_PEND) { + + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_CF | X_OF) { - ANDI(xFlags, xFlags, ~(1UL<insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit ROL16 instruction, from s1, constant c, store result in s1 using s3 and s4 as scratch +void emit_rol16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) +{ + if (!c) return; + + SET_DFNONE(); + + if (c & 15) { + SRLI(s3, s1, 16 - (c & 15)); + SLLI(s1, s1, c & 15); + OR(s1, s1, s3); + ZEXTH(s1, s1); + } + + IFX (X_CF | X_OF) { + if (c == 1) + ANDI(xFlags, xFlags, ~(1UL << F_CF | 1UL << F_OF2)); + else + ANDI(xFlags, xFlags, ~(1UL << F_CF)); + ANDI(s4, s1, 1 << F_CF); + IFX (X_CF) OR(xFlags, xFlags, s4); + IFXA (X_OF, (c == 1)) { + SRLI(s3, s1, 15); + XOR(s3, s3, s4); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ROL32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch @@ -1063,197 +1042,219 @@ void emit_rol32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, return; } - IFX(X_CF | X_OF) { - ANDI(xFlags, xFlags, ~(1UL<insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit ROR16 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_ror16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) +{ + if (!c) return; + + SET_DFNONE(); + + IFX (X_CF | X_OF) { + if (c == 1) + ANDI(xFlags, xFlags, ~(1UL << F_CF | 1UL << F_OF2)); + else + ANDI(xFlags, xFlags, ~(1UL << F_CF)); } - IFX(X_OF) { - // the OF flag is set to the exclusive OR of the CF bit (after the rotate) and the most-significant bit of the result. - if(c==1) { - SRLIxw(s3, s1, rex.w?63:31); - XOR(s3, s3, s4); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } + IFXA (X_OF, (c == 1)) { + SRLI(s3, s1, 15); + XOR(s3, s3, s1); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } + + if (c & 15) { + SRLI(s3, s1, c & 15); + SLLI(s1, s1, 16 - (c & 15)); + OR(s1, s1, s3); + ZEXTH(s1, s1); } + + IFX (X_CF) { + SRLI(s3, s1, 15); + OR(xFlags, xFlags, s3); + } + + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit ROR32 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch void emit_ror32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4) { - if (!c) { - if (!rex.w) ZEROUP(s1); - return; + if (!c) return; + + IFX (X_CF | X_OF) { + ANDI(xFlags, xFlags, ~(1UL << F_CF | 1UL << F_OF2)); } - IFX(X_CF | X_OF) { - ANDI(xFlags, xFlags, ~(1UL<insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } // emit SHRD32 instruction, from s1, fill s2 , constant c, store result in s1 using s3 and s4 as scratch -void emit_shrd32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4) +void emit_shrd32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5) { - c&=(rex.w?0x3f:0x1f); CLEAR_FLAGS(); - IFX(X_PEND) { - if (c) { - MOV64x(s3, c); - SDxw(s3, xEmu, offsetof(x64emu_t, op2)); - } else SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); + IFX (X_PEND) { + MOV64x(s3, c); + SDxw(s3, xEmu, offsetof(x64emu_t, op2)); SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w?d_shrd64:d_shrd32); - } else IFX(X_ALL) { + SET_DF(s4, rex.w ? d_shrd64 : d_shrd32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if(!c) { - if (!rex.w) ZEROUP(s1); - IFX(X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); - } - return; - } - IFX(X_CF) { + IFX (X_CF) { if (c > 1) { - SRAI(s3, s1, c-1); + SRAI(s3, s1, c - 1); ANDI(s3, s3, 1); // LSB == F_CF } else { ANDI(s3, s1, 1); // LSB == F_CF } OR(xFlags, xFlags, s3); } - IFX(X_OF) { - // Store sign for later use. - if (c == 1) SRLIxw(s4, s1, rex.w?63:31); + IFX (X_OF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + XOR(s3, s3, s2); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); } SRLIxw(s3, s1, c); - SLLIxw(s1, s2, (rex.w?64:32)-c); + SLLIxw(s1, s2, (rex.w ? 64 : 32) - c); OR(s1, s1, s3); if (!rex.w) { ZEROUP(s1); } - IFX(X_SF) { - SRLIxw(s3, s1, rex.w?63:31); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + IFX (X_SF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + SET_FLAGS_NEZ(s3, F_SF, s5); } - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); - } - IFX(X_OF) { - // the OF flag is set if a sign change occurred - if(c==1) { - SRLI(s3, s1, rex.w?63:31); - XOR(s3, s3, s4); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } void emit_shrd16c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5) { - c&=0x1f; + c &= 0x1f; CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { if (c) { MOV64x(s3, c); SH(s3, xEmu, offsetof(x64emu_t, op2)); - } else SH(xZR, xEmu, offsetof(x64emu_t, op2)); + } else + SH(xZR, xEmu, offsetof(x64emu_t, op2)); SH(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s4, d_shrd16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if(!c) { - IFX(X_PEND) { + if (!c) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } return; } + IFX (X_OF) { + SRLI(s3, s1, 15); + XOR(s3, s3, s2); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } // create concat first SLLI(s5, s2, 16); OR(s1, s1, s5); - IFX(X_CF) { + IFX (X_CF) { if (c > 1) { - SRAI(s3, s1, c-1); + SRAI(s3, s1, c - 1); ANDI(s3, s3, 1); // LSB == F_CF } else { // no need to shift @@ -1261,12 +1262,8 @@ void emit_shrd16c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uin } OR(xFlags, xFlags, s3); } - IFX(X_OF) { - // Store sign for later use. - if (c == 1) SRLI(s4, s1, 15); - } - if (rv64_zbb) { + if (cpuext.zbb) { RORIW(s1, s1, c); } else { SRLI(s5, s1, c); @@ -1275,100 +1272,69 @@ void emit_shrd16c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uin } ZEXTH(s1, s1); - IFX(X_SF) { - SLLIW(s3, s1, 16); - BGE(s3, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); - } - IFX(X_PEND) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_OF) { - // the OF flag is set if a sign change occurred - if(c==1) { - SRLI(s3, s1, 15); - XOR(s3, s3, s4); - ANDI(s3, s3, 1); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } + IFX (X_SF) { + SLLIW(s3, s1, 16); + SET_FLAGS_LTZ(s3, F_SF, s4, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } -void emit_shld32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4) +void emit_shld32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5) { - c&=(rex.w?0x3f:0x1f); CLEAR_FLAGS(); - IFX(X_PEND) { - if (c) { - MOV64x(s3, c); - SDxw(s3, xEmu, offsetof(x64emu_t, op2)); - } else SDxw(xZR, xEmu, offsetof(x64emu_t, op2)); + IFX (X_PEND) { + MOV64x(s3, c); + SDxw(s3, xEmu, offsetof(x64emu_t, op2)); SDxw(s1, xEmu, offsetof(x64emu_t, op1)); - SET_DF(s4, rex.w?d_shld64:d_shld32); - } else IFX(X_ALL) { + SET_DF(s4, rex.w ? d_shld64 : d_shld32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if(!c) { - if (!rex.w) { - ZEROUP(s1); - } - IFX(X_PEND) { - SDxw(s1, xEmu, offsetof(x64emu_t, res)); - } - return; - } - IFX(X_CF) { - if (c > 0) { - SRLI(s3, s1, (rex.w?64:32)-c); - ANDI(s4, s3, 1); // F_CF - OR(xFlags, xFlags, s4); - } + IFX (X_CF) { + SRLI(s3, s1, (rex.w ? 64 : 32) - c); + ANDI(s4, s3, 1); // F_CF + OR(xFlags, xFlags, s4); } - IFX(X_OF) { - // Store sign for later use. - if (c == 1) SRLIxw(s4, s1, rex.w?63:31); + + IFX (X_OF) { + SRLIxw(s3, s1, rex.w ? 62 : 30); + SRLI(s4, s3, 1); + XOR(s3, s3, s4); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); } SLLIxw(s3, s1, c); - SRLIxw(s1, s2, (rex.w?64:32)-c); + SRLIxw(s1, s2, (rex.w ? 64 : 32) - c); OR(s1, s1, s3); - if (!rex.w) { - ZEROUP(s1); - } - IFX(X_SF) { - SRLIxw(s3, s1, rex.w?63:31); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); - } - IFX(X_PEND) { + if (!rex.w) ZEROUP(s1); + + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_OF) { - // the OF flag is set if a sign change occurred - if (c == 1) { - SRLIxw(s3, s1, rex.w?63:31); - XOR(s3, s3, s4); - SLLI(s3, s3, F_OF2); - ORI(xFlags, xFlags, s3); - } + IFX (X_SF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } @@ -1376,22 +1342,25 @@ void emit_shrd32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int { int64_t j64; CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s5, xEmu, offsetof(x64emu_t, op2)); SET_DF(s4, rex.w ? d_shrd64 : d_shrd32); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - IFX(X_CF) { + IFX (X_CF) { SUBI(s3, s5, 1); SRA(s3, s1, s3); ANDI(s3, s3, 1); // LSB == F_CF OR(xFlags, xFlags, s3); } - IFX(X_OF) { - // Store current sign for later use. - SRLIxw(s6, s1, rex.w ? 63 : 31); + IFX (X_OF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + XOR(s3, s3, s2); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); } ADDI(s4, xZR, (rex.w ? 64 : 32)); SUB(s4, s4, s5); @@ -1399,132 +1368,121 @@ void emit_shrd32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int SLLxw(s4, s2, s4); OR(s1, s4, s3); - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } if (!rex.w) { ZEROUP(s1); } - IFX(X_SF) { - SRLIxw(s3, s1, rex.w?63:31); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); - } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_OF) { - ADDI(s5, s5, -1); - BNEZ_MARK(s5); - SRLIxw(s3, s1, rex.w?63:31); - XOR(s3, s3, s6); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - MARK; + IFX (X_SF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + SET_FLAGS_NEZ(s3, F_SF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } void emit_shld32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s5, int s3, int s4, int s6) { int64_t j64; CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s5, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s4, rex.w?d_shld64:d_shld32); - } else IFX(X_ALL) { + SET_DF(s4, rex.w ? d_shld64 : d_shld32); + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - MOV32w(s3, (rex.w?64:32)); + MOV32w(s3, (rex.w ? 64 : 32)); SUB(s3, s3, s5); - IFX(X_CF) { + IFX (X_CF) { SRL(s4, s1, s3); ANDI(s4, s4, 1); // LSB == F_CF OR(xFlags, xFlags, s4); } - IFX(X_OF) { - // Store current sign for later use. - SRLIxw(s6, s1, rex.w ? 63 : 31); + IFX (X_OF) { + SRLIxw(s6, s1, rex.w ? 62 : 30); + SRLI(s4, s6, 1); + XOR(s6, s6, s4); + ANDI(s6, s6, 1); + SLLI(s6, s6, F_OF2); + OR(xFlags, xFlags, s6); } SLLxw(s4, s1, s5); SRLxw(s3, s2, s3); OR(s1, s3, s4); - IFX(X_PEND) { + IFX (X_PEND) { SDxw(s1, xEmu, offsetof(x64emu_t, res)); } if (!rex.w) { ZEROUP(s1); } - IFX(X_SF) { - SRLIxw(s3, s1, rex.w?63:31); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); - } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_OF) { - ADDI(s5, s5, -1); - BNEZ_MARK(s5); - SRLIxw(s3, s1, rex.w?63:31); - XOR(s3, s3, s6); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - MARK; + IFX (X_SF) { + SRLIxw(s3, s1, rex.w ? 63 : 31); + SET_FLAGS_NEZ(s3, F_SF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } void emit_shld16c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5) { - c&=0x1f; + c &= 0x1f; CLEAR_FLAGS(); - IFX(X_PEND) { + IFX (X_PEND) { if (c) { MOV64x(s3, c); SH(s3, xEmu, offsetof(x64emu_t, op2)); - } else SH(xZR, xEmu, offsetof(x64emu_t, op2)); + } else + SH(xZR, xEmu, offsetof(x64emu_t, op2)); SH(s1, xEmu, offsetof(x64emu_t, op1)); SET_DF(s4, d_shld16); - } else IFX(X_ALL) { + } else IFXORNAT (X_ALL) { SET_DFNONE(); } - if(!c) { - IFX(X_PEND) { + if (!c) { + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } return; } + IFX (X_OF) { + SRLI(s3, s1, 14); + SRLI(s4, s3, 1); + XOR(s3, s3, s4); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } + // create concat first SLLI(s5, s2, 16); OR(s1, s1, s5); - IFX(X_CF) { - if (c < 16) { - SRLI(s3, s1, 16-c); + IFX (X_CF) { + if (c <= 16) { + SRLI(s3, s1, 16 - c); } else { - SRLI(s3, s2, 32-c); + SRLI(s3, s2, 32 - c); } ANDI(s5, s3, 1); // LSB == F_CF OR(xFlags, xFlags, s5); } - IFX(X_OF) { - // Store sign for later use. - if (c == 1) SRLI(s5, s1, 15); - } - - if (rv64_zbb) { + if (cpuext.zbb) { RORIW(s1, s1, 32 - c); } else { SLLI(s3, s1, c); @@ -1533,29 +1491,206 @@ void emit_shld16c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uin } ZEXTH(s1, s1); - IFX(X_SF) { + IFX (X_PEND) { + SH(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_SF) { + SLLIW(s4, s1, 16); + SET_FLAGS_LTZ(s4, F_SF, s3, s5); + } + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s3); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s3, s4); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +void emit_shld16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6) +{ + CLEAR_FLAGS(); + IFX (X_PEND) { + SH(s1, xEmu, offsetof(x64emu_t, op1)); + SH(s3, xEmu, offsetof(x64emu_t, op2)); + SET_DF(s4, d_shld16); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + IFX (X_OF) { + SRLI(s5, s1, 14); + SRLI(s4, s5, 1); + XOR(s5, s5, s4); + ANDI(s5, s5, 1); + SLLI(s5, s5, F_OF2); + OR(xFlags, xFlags, s5); + } + + MOV32w(s6, 32); + SUBW(s6, s6, s3); + IFX (X_CF) { + SLLI(s5, s1, 16); + OR(s4, s2, s5); + SRLW(s5, s4, s6); + ANDI(s5, s5, 1); // LSB == F_CF + OR(xFlags, xFlags, s5); + } + // create concat first + SLLI(s5, s2, 16); + OR(s1, s1, s5); + + if (cpuext.zbb) { + RORW(s1, s1, s6); + } else { + SLLW(s5, s1, s3); + SRLW(s1, s1, s6); + OR(s1, s1, s5); + } + ZEXTH(s1, s1); + + IFX (X_PEND) { + SH(s1, xEmu, offsetof(x64emu_t, res)); + } + IFX (X_SF) { SLLIW(s4, s1, 16); - BGE(s4, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_LTZ(s4, F_SF, s4, s5); + } + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s4, s5); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s4, xZR); +} + +void emit_shrd16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6) +{ + CLEAR_FLAGS(); + IFX (X_PEND) { + SH(s1, xEmu, offsetof(x64emu_t, op1)); + SH(s3, xEmu, offsetof(x64emu_t, op2)); + SET_DF(s4, d_shrd16); + } else IFXORNAT (X_ALL) { + SET_DFNONE(); + } + + SLLI(s5, s2, 16); + OR(s1, s1, s5); + IFX (X_OF) { + SRLI(s5, s1, 15); + XOR(s5, s5, s2); + ANDI(s5, s5, 1); + SLLI(s5, s5, F_OF2); + OR(xFlags, xFlags, s5); + } + + IFX (X_CF) { + ADDIW(s5, s3, -1); + SRLW(s5, s1, s5); + ANDI(s5, s5, 1); // LSB == F_CF + OR(xFlags, xFlags, s5); + } + + if (cpuext.zbb) { + RORW(s1, s1, s3); + } else { + MOV32w(s6, 32); + SUBW(s6, s6, s3); + SRLW(s5, s1, s3); + SLLW(s1, s1, s6); + OR(s1, s1, s5); } - IFX(X_PEND) { + ZEXTH(s1, s1); + + IFX (X_PEND) { SH(s1, xEmu, offsetof(x64emu_t, res)); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); } - IFX(X_OF) { - // the OF flag is set if a sign change occurred - if(c==1) { - SRLI(s3, s1, 15); - XOR(s3, s3, s5); - ANDI(s3, s3, 1); - SLLI(s3, s3, F_OF2); - OR(xFlags, xFlags, s3); - } + IFX (X_SF) { + SLLIW(s3, s1, 16); + SET_FLAGS_LTZ(s3, F_SF, s4, s5); } - IFX(X_PF) { - emit_pf(dyn, ninst, s1, s3, s4); + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s4, s5); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit RCL16 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_rcl16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) +{ + if (!(c % 17)) return; + + SET_DFNONE(); + + IFX (X_OF) { + ANDI(xFlags, xFlags, ~(1UL << F_OF2)); + SRLI(s3, s1, 14); + SRLI(s4, s3, 1); + XOR(s3, s3, s4); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } + + c %= 17; + + ANDI(s3, xFlags, 1 << F_CF); + SLLI(s3, s3, 16); + OR(s1, s1, s3); // insert CF to bit 16 + + SLLI(s4, s1, 47 + c); + SLLI(s3, s4, 1); + SRLI(s3, s3, 48); + SRLI(s1, s1, 17 - c); + OR(s1, s1, s3); + + IFX (X_CF) { + ANDI(xFlags, xFlags, ~(1UL << F_CF)); + SRLI(s4, s4, 63); + OR(xFlags, xFlags, s4); + } + + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit RCR16 instruction, from s1 , constant c, store result in s1 using s3 and s4 as scratch +void emit_rcr16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4) +{ + if (!(c % 17)) return; + + SET_DFNONE(); + + IFX (X_OF) { + ANDI(xFlags, xFlags, ~(1UL << F_OF2)); + SRLI(s3, s1, 15); + XOR(s3, s3, xFlags); + ANDI(s3, s3, 1); + SLLI(s3, s3, F_OF2); + OR(xFlags, xFlags, s3); + } + + c %= 17; + + ANDI(s3, xFlags, 1 << F_CF); + SLLI(s3, s3, 16); + OR(s1, s1, s3); // insert CF to bit 16 + + SRLI(s3, s1, c); + SLLI(s1, s1, 17 - c); + OR(s1, s1, s3); + SLLI(s4, s1, 47); + ZEXTH(s1, s1); + + IFX (X_CF) { + ANDI(xFlags, xFlags, ~(1UL << F_CF)); + SRLI(s4, s4, 63); + OR(xFlags, xFlags, s4); } + + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); } diff --git a/src/dynarec/rv64/dynarec_rv64_emit_tests.c b/src/dynarec/rv64/dynarec_rv64_emit_tests.c index 00c1fb7..2340436 100644 --- a/src/dynarec/rv64/dynarec_rv64_emit_tests.c +++ b/src/dynarec/rv64/dynarec_rv64_emit_tests.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,7 +17,7 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" // emit CMP8 instruction, from cmp s1, s2, using s3, s4, s5 and s6 as scratch void emit_cmp8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6) @@ -33,30 +31,45 @@ void emit_cmp8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i SET_DFNONE(); } - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOT(s5, s1); } - // It's a cmp, we can't store the result back to s1. - SUB(s6, s1, s2); - ANDI(s6, s6, 0xff); IFX_PENDOR0 { + SUB(s6, s1, s2); SB(s6, xEmu, offsetof(x64emu_t, res)); + } else IFX (X_ALL) { + SUB(s6, s1, s2); } - IFX(X_SF) { + IFX (X_ALL) ANDI(s6, s6, 0xff); + + IFX (X_SF) { SRLI(s3, s6, 7); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } + CALC_SUB_FLAGS(s5, s2, s6, s3, s4, 8); - IFX(X_ZF) { - BNEZ(s6, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s6, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s6, s3, s4); } + + NAT_FLAGS_ENABLE_CARRY(); + NAT_FLAGS_ENABLE_SIGN(); + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + SLLI(s3, s1, 56); + SRAI(s3, s3, 56); + SLLI(s4, s2, 56); + SRAI(s4, s4, 56); + NAT_FLAGS_OPS(s3, s4, s5, xZR); + } else { + NAT_FLAGS_OPS(s1, s2, s3, xZR); + } + } } // emit CMP8 instruction, from cmp s1 , 0, using s3 and s4 as scratch @@ -72,18 +85,27 @@ void emit_cmp8_0(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4) SET_DFNONE(); } - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 7); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + NAT_FLAGS_ENABLE_CARRY(); + NAT_FLAGS_ENABLE_SIGN(); + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + SLLI(s3, s1, 56); + SRAI(s3, s3, 56); + NAT_FLAGS_OPS(s3, xZR, s4, xZR); + } else { + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } + } } // emit CMP16 instruction, from cmp s1, s2, using s3 and s4 as scratch @@ -98,32 +120,45 @@ void emit_cmp16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, SET_DFNONE(); } - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOT(s5, s1); } - // It's a cmp, we can't store the result back to s1. - SUB(s6, s1, s2); - IFX(X_ALL) { - ZEXTH(s6, s6); - } IFX_PENDOR0 { + SUB(s6, s1, s2); SH(s6, xEmu, offsetof(x64emu_t, res)); + } else IFX (X_ALL) { + SUB(s6, s1, s2); } - IFX(X_SF) { + IFX (X_ALL) ZEXTH(s6, s6); + + IFX (X_SF) { SRLI(s3, s6, 15); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } + CALC_SUB_FLAGS(s5, s2, s6, s3, s4, 16); - IFX(X_ZF) { - BNEZ(s6, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s6, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s6, s3, s4); } + + NAT_FLAGS_ENABLE_CARRY(); + NAT_FLAGS_ENABLE_SIGN(); + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + SLLI(s3, s1, 48); + SRAI(s3, s3, 48); + SLLI(s4, s2, 48); + SRAI(s4, s4, 48); + NAT_FLAGS_OPS(s3, s4, s5, xZR); + } else { + NAT_FLAGS_OPS(s1, s2, s3, xZR); + } + } } // emit CMP16 instruction, from cmp s1 , #0, using s3 and s4 as scratch @@ -138,19 +173,28 @@ void emit_cmp16_0(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4) } else { SET_DFNONE(); } - - IFX(X_SF) { + IFX (X_SF) { SRLI(s3, s1, 15); - BEQZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s3, F_SF, s4); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s1, s3, s4); } + + NAT_FLAGS_ENABLE_CARRY(); + NAT_FLAGS_ENABLE_SIGN(); + if (dyn->insts[ninst].nat_flags_fusion) { + if (dyn->insts[ninst].nat_flags_needsign) { + SLLI(s3, s1, 48); + SRAI(s3, s3, 48); + NAT_FLAGS_OPS(s3, xZR, s4, xZR); + } else { + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + } + } } // emit CMP32 instruction, from cmp s1, s2, using s3 and s4 as scratch @@ -160,70 +204,110 @@ void emit_cmp32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s IFX_PENDOR0 { SDxw(s1, xEmu, offsetof(x64emu_t, op1)); SDxw(s2, xEmu, offsetof(x64emu_t, op2)); - SET_DF(s4, rex.w?d_cmp64:d_cmp32); + SET_DF(s4, rex.w ? d_cmp64 : d_cmp32); } else { SET_DFNONE(); } - IFX(X_AF | X_CF | X_OF) { + IFX (X_AF | X_CF | X_OF) { // for later flag calculation NOT(s5, s1); } - // It's a cmp, we can't store the result back to s1. - SUBxw(s6, s1, s2); IFX_PENDOR0 { + SUBxw(s6, s1, s2); SDxw(s6, xEmu, offsetof(x64emu_t, res)); + } else IFX (X_ALL) { + SUBxw(s6, s1, s2); } - IFX(X_SF) { - BGE(s6, xZR, 8); - ORI(xFlags, xFlags, 1 << F_SF); + + IFX (X_SF) { + SET_FLAGS_LTZ(s6, F_SF, s3, s4); } - if (!rex.w) { - ZEROUP(s6); + IFX (X_AF | X_CF | X_OF | X_ZF | X_PF) { + if (!rex.w) ZEROUP(s6); } - CALC_SUB_FLAGS(s5, s2, s6, s3, s4, rex.w?64:32); - IFX(X_ZF) { - BNEZ(s6, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + CALC_SUB_FLAGS(s5, s2, s6, s3, s4, rex.w ? 64 : 32); + IFX (X_ZF) { + SET_FLAGS_EQZ(s6, F_ZF, s4); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s6, s3, s4); } + NAT_FLAGS_ENABLE_CARRY(); + NAT_FLAGS_ENABLE_SIGN(); + if (dyn->insts[ninst].nat_flags_fusion) { + if (rex.w) { + NAT_FLAGS_OPS(s1, s2, s3, s4); + } else { + if (dyn->insts[ninst].nat_flags_needsign) { + SEXT_W(s3, s1); + SEXT_W(s4, s2); + } else { + ZEXTW2(s3, s1); + ZEXTW2(s4, s2); + } + NAT_FLAGS_OPS(s3, s4, s5, xZR); + } + } } // emit CMP32 instruction, from cmp s1, 0, using s3 and s4 as scratch -void emit_cmp32_0(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4) +void emit_cmp32_0(dynarec_rv64_t* dyn, int ninst, rex_t rex, uint8_t nextop, int s1, int s3, int s4, int s5) { CLEAR_FLAGS(); IFX_PENDOR0 { SD(s1, xEmu, offsetof(x64emu_t, op1)); SD(xZR, xEmu, offsetof(x64emu_t, op2)); SD(s1, xEmu, offsetof(x64emu_t, res)); - SET_DF(s4, rex.w?d_cmp64:d_cmp32); + SET_DF(s4, rex.w ? d_cmp64 : d_cmp32); } else { SET_DFNONE(); } - IFX(X_SF) { + + IFX (X_SF) { if (rex.w) { - BGE(s1, xZR, 8); + SET_FLAGS_LTZ(s1, F_SF, s3, s4); } else { SRLI(s3, s1, 31); - BEQZ(s3, 8); + SET_FLAGS_NEZ(s3, F_SF, s4); } - ORI(xFlags, xFlags, 1 << F_SF); } - IFX(X_ZF) { - BNEZ(s1, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + int res = s1; + IFX (X_ZF | X_PF) { + if (!rex.w && MODREG) { + ZEXTW2(s5, s1); + res = s5; + } } - IFX(X_PF) { - emit_pf(dyn, ninst, s1, s3, s4); + IFX (X_ZF) { + SET_FLAGS_EQZ(res, F_ZF, s3); + } + IFX (X_PF) { + emit_pf(dyn, ninst, res, s3, s4); + } + NAT_FLAGS_ENABLE_CARRY(); + NAT_FLAGS_ENABLE_SIGN(); + if (dyn->insts[ninst].nat_flags_fusion) { + if (rex.w) + NAT_FLAGS_OPS(s1, xZR, s3, xZR); + else { + if (dyn->insts[ninst].nat_flags_needsign) { + SEXT_W(s3, s1); + NAT_FLAGS_OPS(s3, xZR, s4, xZR); + } else if (res == s5) { // zero-up'd case + NAT_FLAGS_OPS(s5, xZR, s4, xZR); + } else { + ZEXTW2(s3, s1); + NAT_FLAGS_OPS(s3, xZR, s4, xZR); + } + } } } // emit TEST8 instruction, from test s1, s2, using s3, s4 and s5 as scratch -void emit_test8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) { +void emit_test8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5) +{ CLEAR_FLAGS(); IFX_PENDOR0 { SET_DF(s3, d_tst8); @@ -231,23 +315,64 @@ void emit_test8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, SET_DFNONE(); } - AND(s3, s1, s2); // res = s1 & s2 + if (s1 != s2) AND(s1, s1, s2); // res = s1 & s2 + + IFX_PENDOR0 { + SD(s1, xEmu, offsetof(x64emu_t, res)); + } + + IFX (X_SF) { + SRLI(s4, s1, 7); + SET_FLAGS_NEZ(s4, F_SF, s5); + } + IFX (X_ZF) { + SET_FLAGS_EQZ(s1, F_ZF, s5); + } + IFX (X_PF) { + emit_pf(dyn, ninst, s1, s4, s5); + } + + NAT_FLAGS_ENABLE_SIGN(); + if (dyn->insts[ninst].nat_flags_fusion && dyn->insts[ninst].nat_flags_needsign) { + SLLI(s1, s1, 56); + SRAI(s1, s1, 56); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s1, xZR, s3, xZR); +} + +// emit TEST8 instruction, from test s1, c, using s3, s4 and s5 as scratch +void emit_test8c(dynarec_rv64_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4, int s5) +{ + CLEAR_FLAGS(); + IFX_PENDOR0 { + SET_DF(s3, d_tst8); + } else { + SET_DFNONE(); + } + + ANDI(s3, s1, c); // res = s1 & c IFX_PENDOR0 { SD(s3, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { + + IFX (X_SF) { SRLI(s4, s3, 7); - BEQZ(s4, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s4, F_SF, s5); } - IFX(X_ZF) { - BNEZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s3, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s3, s4, s5); } + + NAT_FLAGS_ENABLE_SIGN(); + if (dyn->insts[ninst].nat_flags_fusion && dyn->insts[ninst].nat_flags_needsign) { + SLLI(s3, s3, 56); + SRAI(s3, s3, 56); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, xZR, xZR); } // emit TEST16 instruction, from test s1, s2, using s3, s4 and s5 as scratch @@ -265,18 +390,24 @@ void emit_test16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, IFX_PENDOR0 { SH(s3, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { + + IFX (X_SF) { SRLI(s4, s3, 15); - BEQZ(s4, 8); - ORI(xFlags, xFlags, 1 << F_SF); + SET_FLAGS_NEZ(s4, F_SF, s5); } - IFX(X_ZF) { - BNEZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s3, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s3, s4, s5); } + + NAT_FLAGS_ENABLE_SIGN(); + if (dyn->insts[ninst].nat_flags_fusion && dyn->insts[ninst].nat_flags_needsign) { + SLLI(s3, s3, 48); + SRAI(s3, s3, 48); + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, xZR, xZR); } // emit TEST32 instruction, from test s1, s2, using s3 and s4 as scratch @@ -284,7 +415,7 @@ void emit_test32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int { CLEAR_FLAGS(); IFX_PENDOR0 { - SET_DF(s3, rex.w?d_tst64:d_tst32); + SET_DF(s3, rex.w ? d_tst64 : d_tst32); } else { SET_DFNONE(); } @@ -294,21 +425,33 @@ void emit_test32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int IFX_PENDOR0 { SDxw(s3, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF|X_ZF) { + + IFX (X_SF | X_ZF) { if (!rex.w) ZEROUP(s3); } - IFX(X_SF) { - SRLI(s4, s3, rex.w?63:31); - BEQZ(s4, 8); - ORI(xFlags, xFlags, 1 << F_SF); + + IFX (X_SF) { + SRLI(s4, s3, rex.w ? 63 : 31); + SET_FLAGS_NEZ(s4, F_SF, s5); } - IFX(X_ZF) { - BNEZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s3, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s3, s4, s5); } + + NAT_FLAGS_ENABLE_SIGN(); + if (dyn->insts[ninst].nat_flags_fusion && !rex.w) { + if (dyn->insts[ninst].nat_flags_needsign) { + SEXT_W(s3, s3); + } else { + IFX (X_SF | X_ZF) { + } else + ZEROUP(s3); + } + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, xZR, xZR); } // emit TEST32 instruction, from test s1, s2, using s3 and s4 as scratch @@ -316,34 +459,46 @@ void emit_test32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, { CLEAR_FLAGS(); IFX_PENDOR0 { - SET_DF(s3, rex.w?d_tst64:d_tst32); + SET_DF(s3, rex.w ? d_tst64 : d_tst32); } else { SET_DFNONE(); } - if(c>=-2048 && c<=2047) { + if (c >= -2048 && c <= 2047) { ANDI(s3, s1, c); - IFX(X_SF|X_ZF) { - if (!rex.w && c<0) ZEROUP(s3); - } } else { MOV64xw(s3, c); AND(s3, s1, s3); // res = s1 & s2 } + IFX (X_SF | X_ZF) { + if (!rex.w && c < 0) ZEROUP(s3); + } + IFX_PENDOR0 { SDxw(s3, xEmu, offsetof(x64emu_t, res)); } - IFX(X_SF) { - SRLI(s4, s3, rex.w?63:31); - BEQZ(s4, 8); - ORI(xFlags, xFlags, 1 << F_SF); + + IFX (X_SF) { + SRLI(s4, s3, rex.w ? 63 : 31); + SET_FLAGS_NEZ(s4, F_SF, s5); } - IFX(X_ZF) { - BNEZ(s3, 8); - ORI(xFlags, xFlags, 1 << F_ZF); + IFX (X_ZF) { + SET_FLAGS_EQZ(s3, F_ZF, s5); } - IFX(X_PF) { + IFX (X_PF) { emit_pf(dyn, ninst, s3, s4, s5); } + + NAT_FLAGS_ENABLE_SIGN(); + if (dyn->insts[ninst].nat_flags_fusion && !rex.w) { + if (dyn->insts[ninst].nat_flags_needsign) { + SEXT_W(s3, s3); + } else { + IFX (X_SF | X_ZF) { + } else if (c < 0) + ZEROUP(s3); + } + } + if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(s3, xZR, xZR, xZR); } diff --git a/src/dynarec/rv64/dynarec_rv64_f0.c b/src/dynarec/rv64/dynarec_rv64_f0.c index 190ce10..a083678 100644 --- a/src/dynarec/rv64/dynarec_rv64_f0.c +++ b/src/dynarec/rv64/dynarec_rv64_f0.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -18,13 +16,14 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" #include "dynarec_rv64_functions.h" -uintptr_t dynarec64_F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog) +uintptr_t dynarec64_F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)rep; (void)need_epilog; + (void)ip; + (void)need_epilog; uint8_t opcode = F8; uint8_t nextop; @@ -42,126 +41,132 @@ uintptr_t dynarec64_F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni MAYUSE(wb2); MAYUSE(j64); - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - GETREX(); - - // TODO: Add support for unligned memory access for all the LOCK ones. - // TODO: Add support for BOX4_DYNAREC_ALIGNED_ATOMICS. - - switch(opcode) { + switch (opcode) { case 0x01: - INST_NAME("LOCK ADD Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; - SMDMB(); - if((nextop&0xC0)==0xC0) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_add32(dyn, ninst, rex, ed, gd, x3, x4, x5); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK ADD Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LRxw(x1, wback, 1, 1); - ADDxw(x4, x1, gd); - SCxw(x3, x4, wback, 1, 1); - BNEZ_MARKLOCK(x3); - IFX(X_ALL|X_PEND) { + AMOADDxw(x1, gd, wback, 1, 1); + IFXORNAT (X_ALL | X_PEND) { emit_add32(dyn, ninst, rex, x1, gd, x3, x4, x5); } } - SMDMB(); + break; + case 0x08: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK OR Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGB(x1); + addr = geted(dyn, addr, ninst, nextop, &wback, x5, x6, &fixedaddress, rex, LOCK_LOCK, 0, 0); + ANDI(x2, wback, 3); + SLLI(x2, x2, 3); + ANDI(x3, wback, ~3); + SLL(x1, x1, x2); + AMOOR_W(x4, x1, x3, 1, 1); + IFXORNAT (X_ALL | X_PEND) { + SRL(x2, x4, x2); + ANDI(x2, x2, 0xFF); + emit_or8(dyn, ninst, x2, x1, x4, x5); + } + } break; case 0x09: - INST_NAME("LOCK OR Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; - SMDMB(); if (MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_or32(dyn, ninst, rex, ed, gd, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK OR Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LRxw(x1, wback, 1, 1); - OR(x4, x1, gd); - SCxw(x3, x4, wback, 1, 1); - BNEZ_MARKLOCK(x3); - IFX(X_ALL|X_PEND) + AMOORxw(x1, gd, wback, 1, 1); + IFXORNAT (X_ALL | X_PEND) emit_or32(dyn, ninst, rex, x1, gd, x3, x4); } - SMDMB(); break; case 0x0F: nextop = F8; - switch(nextop) { + switch (nextop) { + case 0xAB: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTS Ed, Gd"); + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (rex.w) + SRAI(x1, gd, 6); + else + SRAIW(x1, gd, 5); + if (!rex.w && !rex.is32bits) { ADDIW(x1, x1, 0); } + ADDSLy(x3, wback, x1, 2 + rex.w, x1); + ed = x1; + wback = x3; + MARKLOCK; + LRxw(ed, wback, 1, 1); + BEXT(x4, ed, gd, x2); + ANDI(xFlags, xFlags, ~1); + OR(xFlags, xFlags, x4); + ADDI(x4, xZR, 1); + ANDI(x2, gd, rex.w ? 0x3f : 0x1f); + SLL(x4, x4, x2); + OR(ed, ed, x4); + SCxw(x7, ed, wback, 1, 1); + BNEZ_MARKLOCK(x7); + } + break; case 0xB0: - switch(rep) { + switch (rex.rep) { case 0: - INST_NAME("LOCK CMPXCHG Eb, Gb"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - ANDI(x6, xRAX, 0xff); // AL - SMDMB(); - if(MODREG) { - if(rex.rex) { - wback = xRAX+(nextop&7)+(rex.b<<3); - wb2 = 0; - } else { - wback = (nextop&7); - wb2 = (wback>>2)*8; - wback = xRAX+(wback&3); - } - if (wb2) { - MV(x2, wback); - SRLI(x2, x2, wb2); - ANDI(x2, x2, 0xff); - } else { - ANDI(x2, wback, 0xff); - } - wb1 = 0; - ed = x2; - UFLAG_IF { - emit_cmp8(dyn, ninst, x6, ed, x3, x4, x5, x1); - } - BNE_MARK2(x6, x2); - if (wb2) { - MV(wback, x2); - SRLI(wback, wback, wb2); - ANDI(wback, wback, 0xff); - } else { - ANDI(wback, x2, 0xff); - } - GETGB(x1); - MV(ed, gd); - MARK2; - ANDI(xRAX, xRAX, ~0xff); - OR(xRAX, xRAX, x2); - B_NEXT_nocond; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - // this one is tricky, and did some repetitive work. - // mostly because we only got 6 scratch registers, - // and has so much to do. - if(rex.rex) { - gb1 = xRAX+((nextop&0x38)>>3)+(rex.r<<3); + INST_NAME("LOCK CMPXCHG Eb, Gb"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + ANDI(x6, xRAX, 0xff); // AL + if (rex.rex) { + gb1 = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); gb2 = 0; } else { - gd = (nextop&0x38)>>3; - gb2 = ((gd&4)>>2); - gb1 = xRAX+(gd&3); + gd = (nextop & 0x38) >> 3; + gb2 = ((gd & 4) >> 2); + gb1 = TO_NAT(gd & 3); } addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, LOCK_LOCK, 0, 0); ANDI(x5, wback, 0b11); - SLLI(x5, x5, 3); // shamt + SLLI(x5, x5, 3); // shamt MARKLOCK; ANDI(x2, wback, ~0b11); // align to 32bit - LWU(x1, x2, 0); LR_W(x4, x2, 1, 1); + MV(x1, x4); SRL(x4, x4, x5); ANDI(x4, x4, 0xff); BNE_MARK(x6, x4); // compare AL with m8 @@ -171,8 +176,7 @@ uintptr_t dynarec64_F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni NOT(x2, x2); AND(x2, x1, x2); if (gb2) { - MV(x1, gb1); - SRLI(x1, x1, 8); + SRLI(x1, gb1, 8); ANDI(x1, x1, 0xff); } else { ANDI(x1, gb1, 0xff); @@ -180,102 +184,127 @@ uintptr_t dynarec64_F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni SLL(x1, x1, x5); OR(x1, x1, x2); ANDI(x2, wback, ~0b11); // align to 32bit again - SC_W(x9, x1, x2, 1, 1); - BNEZ_MARKLOCK(x9); + SC_W(x7, x1, x2, 1, 1); + BNEZ_MARKLOCK(x7); // done MARK; - UFLAG_IF {emit_cmp8(dyn, ninst, x6, x4, x1, x2, x3, x5);} + UFLAG_IF { emit_cmp8(dyn, ninst, x6, x4, x1, x2, x3, x5); } // load m8 into AL ANDI(xRAX, xRAX, ~0xff); OR(xRAX, xRAX, x4); } - SMDMB(); break; default: DEFAULT; } break; case 0xB1: - switch (rep) { + switch (rex.rep) { case 0: - INST_NAME("LOCK CMPXCHG Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; if (MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - wback = 0; - UFLAG_IF {emit_cmp32(dyn, ninst, rex, xRAX, ed, x3, x4, x5, x6);} - MV(x1, ed); // save value - SUB(x2, x1, xRAX); - BNE_MARK2(x2, xZR); - MV(ed, gd); - MARK2; - MVxw(xRAX, x1); + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - SMDMB(); + INST_NAME("LOCK CMPXCHG Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_NOFUSION); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + UFLAG_IF { MVxw(x6, xRAX); } ANDI(x1, wback, (1 << (rex.w + 2)) - 1); BNEZ_MARK3(x1); // Aligned MARKLOCK; LRxw(x1, wback, 1, 1); SUBxw(x3, x1, xRAX); - BNEZ_MARK(x3); + BNEZ(x3, 4 + (rex.w ? 8 : 12)); // EAX == Ed SCxw(x4, gd, wback, 1, 1); BNEZ_MARKLOCK(x4); + if (!rex.w) { B_MARK_nocond; } + MVxw(xRAX, x1); B_MARK_nocond; MARK3; // Unaligned ANDI(x5, wback, -(1 << (rex.w + 2))); - MARK2; // Use MARK2 as a "MARKLOCK" since we're running out of marks. + MARKLOCK2; LDxw(x1, wback, 0); - LRxw(x6, x5, 1, 1); + LRxw(x7, x5, 1, 1); SUBxw(x3, x1, xRAX); - BNEZ_MARK(x3); + BNEZ(x3, 4 + (rex.w ? 12 : 16)); // EAX == Ed - SCxw(x4, x6, x5, 1, 1); - BNEZ_MARK2(x4); + SCxw(x4, x7, x5, 1, 1); + BNEZ_MARKLOCK2(x4); SDxw(gd, wback, 0); - MARK; - UFLAG_IF {emit_cmp32(dyn, ninst, rex, xRAX, x1, x3, x4, x5, x6);} + if (!rex.w) { B_MARK_nocond; } MVxw(xRAX, x1); - SMDMB(); + MARK; + UFLAG_IF { emit_cmp32(dyn, ninst, rex, x6, x1, x3, x4, x5, x7); } } break; default: DEFAULT; } break; + case 0xB3: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK BTR Ed, Gd"); + SETFLAGS(X_ALL & ~X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + SET_DFNONE(); + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + if (rex.w) + SRAI(x1, gd, 6); + else + SRAIW(x1, gd, 5); + if (!rex.w && !rex.is32bits) { ADDIW(x1, x1, 0); } + ADDSLy(x3, wback, x1, 2 + rex.w, x1); + LDxw(x1, x3, fixedaddress); + ed = x1; + wback = x3; + MARKLOCK; + LRxw(ed, wback, 1, 1); + BEXT(x4, ed, gd, x2); // F_CF is 1 + ANDI(xFlags, xFlags, ~1); + OR(xFlags, xFlags, x4); + ADDI(x4, xZR, 1); + ANDI(x2, gd, rex.w ? 0x3f : 0x1f); + SLL(x4, x4, x2); + NOT(x4, x4); + AND(ed, ed, x4); + SCxw(x7, ed, wback, 1, 1); + BNEZ_MARKLOCK(x7); + } + break; case 0xC1: - switch(rep) { + switch (rex.rep) { case 0: - INST_NAME("LOCK XADD Gd, Ed"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; - SMDMB(); - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - MVxw(x1, ed); - MVxw(ed, gd); - MVxw(gd, x1); - emit_add32(dyn, ninst, rex, ed, gd, x3, x4, x5); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK XADD Gd, Ed"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LRxw(x1, wback, 1, 1); - ADDxw(x4, x1, gd); - SCxw(x3, x4, wback, 1, 1); - BNEZ_MARKLOCK(x3); - IFX(X_ALL|X_PEND) { + AMOADDxw(x1, gd, wback, 1, 1); + IFXORNAT (X_ALL | X_PEND) { MVxw(x2, x1); emit_add32(dyn, ninst, rex, x2, gd, x3, x4, x5); } MVxw(gd, x1); } - SMDMB(); break; default: DEFAULT; @@ -283,64 +312,87 @@ uintptr_t dynarec64_F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni break; case 0xC7: - switch(rep) { + switch (rex.rep) { case 0: - if (rex.w) { - INST_NAME("LOCK CMPXCHG16B Gq, Eq"); - } else { - INST_NAME("LOCK CMPXCHG8B Gq, Eq"); - } - SETFLAGS(X_ZF, SF_SUBSET); - nextop = F8; - addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, LOCK_LOCK, 0, 0); - ANDI(xFlags, xFlags, ~(1<>2); - wback = xRAX+(wback&3); - } - SRLIW(x1, wback, wb2*8); - ANDI(x1, x1, 0xFF); - emit_adc8(dyn, ninst, x1, x2, x3, x4, x5); - SLLI(x1, x1, wb2*8); - MOV_U12(x3, 0xFF); - SLLI(x3, x3, wb2*8); - NOT(x3, x3); - AND(wback, wback, x3); - OR(wback, wback, x1); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK ADC Eb, Gb"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGB(x2); addr = geted(dyn, addr, ninst, nextop, &wback, x1, x3, &fixedaddress, rex, LOCK_LOCK, 0, 0); ANDI(x3, wback, 0b11); BNEZ_MARK(x3); MARKLOCK; LR_W(x5, wback, 1, 1); - ANDI(x4, x5, 0xff); // x4 = Ed.b[0] + ANDI(x4, x5, 0xff); // x4 = Ed.b[0] ANDI(x5, x5, ~0xff); // x5 = clear Ed.b[0] ADDW(x6, x4, x2); - ANDI(x9, xFlags, 1 << F_CF); - ADDW(x6, x6, x9); // x6 = adc + ANDI(x7, xFlags, 1 << F_CF); + ADDW(x6, x6, x7); // x6 = adc ANDI(x6, x6, 0xff); OR(x5, x5, x6); - SC_W(x9, x5, wback, 1, 1); - BNEZ_MARKLOCK(x9); + SC_W(x7, x5, wback, 1, 1); + BNEZ_MARKLOCK(x7); B_MARK3_nocond; MARK; SLLI(x3, x3, 3); - MOV_U12(x4, 0xff); + ADDI(x4, xZR, 0xff); ANDI(wback, wback, ~3); // aligning address - SLLI(x4, x4, x3); // x4 = byte mask + SLL(x4, x4, x3); // x4 = byte mask NOT(x5, x4); // x5 = ~mask SLL(x2, x2, x3); // x2 = extented Gb MARK2; - LR_W(x6, wback, 1, 1); // x6 = Ed - AND(x9, x6, x4); // x9 = extended Ed.b[dest] - AND(x6, x6, x5); // x6 = clear Ed.b[dest] - ADDW(x5, x9, x2); + LR_W(x6, wback, 1, 1); // x6 = Ed + AND(x7, x6, x4); // x7 = extended Ed.b[dest] + AND(x6, x6, x5); // x6 = clear Ed.b[dest] + ADDW(x5, x7, x2); ANDI(x4, xFlags, 1 << F_CF); - SLL(x4, x4, x3); // extented - ADDW(x5, x5, x4); // x5 = adc + SLL(x4, x4, x3); // extented + ADDW(x5, x5, x4); // x5 = adc + ADDI(x4, xZR, 0xff); + SLL(x4, x4, x3); + AND(x5, x5, x4); OR(x5, x5, x6); SC_W(x4, x5, wback, 1, 1); BNEZ_MARK2(x4); - IFX(X_ALL|X_PEND) { - SRLI(x2, x2, x3); // Gb - SRLI(x4, x9, x3); // Eb + IFXORNAT (X_ALL | X_PEND) { + SRL(x2, x2, x3); // Gb + SRL(x4, x7, x3); // Eb } MARK3; - IFX(X_ALL|X_PEND) { + IFXORNAT (X_ALL | X_PEND) { emit_adc8(dyn, ninst, x4, x2, x3, x5, x6); } } - SMDMB(); break; case 0x11: - INST_NAME("LOCK ADC Ed, Gd"); - READFLAGS(X_CF); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; - SMDMB(); - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_adc32(dyn, ninst, rex, ed, gd, x3, x4, x5, x6); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK ADC Ed, Gd"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); MARKLOCK; LRxw(x1, wback, 1, 1); @@ -441,83 +482,108 @@ uintptr_t dynarec64_F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni ADDxw(x3, x3, x4); SCxw(x4, x3, wback, 1, 1); BNEZ_MARKLOCK(x4); - IFX(X_ALL|X_PEND) { + IFXORNAT (X_ALL | X_PEND) { emit_adc32(dyn, ninst, rex, x1, gd, x3, x4, x5, x6); } } - SMDMB(); break; - case 0x21: - INST_NAME("LOCK AND Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); + case 0x19: nextop = F8; - GETGD; - SMDMB(); - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_and32(dyn, ninst, rex, ed, gd, x3, x4); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK SBB Ed, Gd"); + READFLAGS(X_CF); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); MARKLOCK; LRxw(x1, wback, 1, 1); - AND(x4, x1, gd); - SCxw(x3, x4, wback, 1, 1); - BNEZ_MARKLOCK(x3); - IFX(X_ALL|X_PEND) + SUBxw(x3, x1, gd); + ANDI(x4, xFlags, 1 << F_CF); + SUBxw(x3, x3, x4); + SCxw(x4, x3, wback, 1, 1); + BNEZ_MARKLOCK(x4); + IFXORNAT (X_ALL | X_PEND) + emit_sbb32(dyn, ninst, rex, x1, gd, x3, x4, x5); + } + break; + case 0x21: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK AND Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + AMOANDxw(x1, gd, wback, 1, 1); + IFXORNAT (X_ALL | X_PEND) emit_and32(dyn, ninst, rex, x1, gd, x3, x4); } - SMDMB(); break; case 0x29: - INST_NAME("LOCK SUB Ed, Gd"); - SETFLAGS(X_ALL, SF_SET_PENDING); nextop = F8; - GETGD; - SMDMB(); - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_sub32(dyn, ninst, rex, ed, gd, x3, x4, x5); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK SUB Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LRxw(x1, wback, 1, 1); - SUB(x4, x1, gd); - SCxw(x3, x4, wback, 1, 1); - BNEZ_MARKLOCK(x3); - IFX(X_ALL|X_PEND) + SUBxw(x4, xZR, gd); + AMOADDxw(x1, x4, wback, 1, 1); + IFXORNAT (X_ALL | X_PEND) emit_sub32(dyn, ninst, rex, x1, gd, x3, x4, x5); } - SMDMB(); break; - case 0x66: - return dynarec64_66F0(dyn, addr, ip, ninst, rex, rep, ok, need_epilog); - + case 0x31: + nextop = F8; + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK XOR Ed, Gd"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + GETGD; + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + AMOXORxw(x1, gd, wback, 1, 1); + IFXORNAT (X_ALL | X_PEND) + emit_xor32(dyn, ninst, rex, x1, gd, x3, x4); + } + break; case 0x80: nextop = F8; - SMDMB(); - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 1: // OR - INST_NAME("LOCK OR Eb, Ib"); - SETFLAGS(X_ALL, SF_SET_PENDING); - if(MODREG) { - GETEB(x1, 1); - u8 = F8; - emit_or8c(dyn, ninst, x1, u8, x2, x4, x5); - EBBACK(x5, 0); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK OR Eb, Ib"); + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); addr = geted(dyn, addr, ninst, nextop, &wback, x5, x1, &fixedaddress, rex, LOCK_LOCK, 0, 1); u8 = F8; ANDI(x2, wback, 3); SLLI(x2, x2, 3); // offset in bits ANDI(x3, wback, ~3); // aligned addr ADDI(x1, xZR, u8); - SLL(x1, x1, x2); // Ib << offset - MARKLOCK; - LR_W(x4, x3, 1, 1); - OR(x6, x4, x1); - SC_W(x6, x6, x3, 1, 1); - BNEZ_MARKLOCK(x6); - IFX(X_ALL|X_PEND) { + SLL(x1, x1, x2); // Ib << offset + AMOOR_W(x4, x1, x3, 1, 1); + IFXORNAT (X_ALL | X_PEND) { SRL(x1, x4, x2); ANDI(x1, x1, 0xFF); emit_or8c(dyn, ninst, x1, u8, x2, x4, x5); @@ -527,281 +593,280 @@ uintptr_t dynarec64_F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni default: DEFAULT; } - SMDMB(); break; case 0x81: case 0x83: nextop = F8; - SMDMB(); - switch((nextop>>3)&7) { + switch ((nextop >> 3) & 7) { case 0: // ADD - if(opcode==0x81) { - INST_NAME("LOCK ADD Ed, Id"); - } else { - INST_NAME("LOCK ADD Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); - if(MODREG) { - if(opcode==0x81) i64 = F32S; else i64 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - SMDMB(); - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - if (i64 < -2048 || i64 >= 2048) - MOV64xw(x9, i64); + if (opcode == 0x81) { + INST_NAME("LOCK ADD Ed, Id"); + } else { + INST_NAME("LOCK ADD Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; + MOV64xw(x7, i64); ANDI(x1, wback, (1 << (rex.w + 2)) - 1); BNEZ_MARK3(x1); // Aligned - MARKLOCK; - LRxw(x1, wback, 1, 1); - if (i64 >= -2048 && i64 < 2048) - ADDIxw(x4, x1, i64); - else - ADDxw(x4, x1, x9); - SCxw(x3, x4, wback, 1, 1); - BNEZ_MARKLOCK(x3); + AMOADDxw(x1, x7, wback, 1, 1); B_MARK_nocond; MARK3; // Unaligned ANDI(x5, wback, -(1 << (rex.w + 2))); - MARK2; // Use MARK2 as a "MARKLOCK" since we're running out of marks. - LDxw(x6, wback, 0); - LRxw(x1, x5, 1, 1); - if (i64 >= -2048 && i64 < 2048) - ADDIxw(x4, x6, i64); - else - ADDxw(x4, x6, x9); - SCxw(x3, x1, x5, 1, 1); - BNEZ_MARK2(x3); + MARKLOCK2; + LDxw(x1, wback, 0); + LRxw(x6, x5, 1, 1); + ADDxw(x4, x1, x7); + SCxw(x3, x6, x5, 1, 1); + BNEZ_MARKLOCK2(x3); SDxw(x4, wback, 0); MARK; - IFX (X_ALL | X_PEND) + IFXORNAT (X_ALL | X_PEND) emit_add32c(dyn, ninst, rex, x1, i64, x3, x4, x5, x6); - SMDMB(); } break; case 1: // OR - if(opcode==0x81) { - INST_NAME("LOCK OR Ed, Id"); - } else { - INST_NAME("LOCK OR Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); - if(MODREG) { - if(opcode==0x81) i64 = F32S; else i64 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_or32c(dyn, ninst, rex, ed, i64, x3, x4); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - if (i64 < -2048 || i64 >= 2048) - MOV64xw(x9, i64); - MARKLOCK; - LRxw(x1, wback, 1, 1); - if (i64 >= -2048 && i64 < 2048) { - ORI(x4, x1, i64); + if (opcode == 0x81) { + INST_NAME("LOCK OR Ed, Id"); } else { - OR(x4, x1, x9); + INST_NAME("LOCK OR Ed, Ib"); } - if (!rex.w) ZEROUP(x4); - SCxw(x3, x4, wback, 1, 1); - BNEZ_MARKLOCK(x3); - IFX(X_ALL|X_PEND) + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; + MOV64xw(x4, i64); + AMOORxw(x1, x4, wback, 1, 1); + IFXORNAT (X_ALL | X_PEND) emit_or32c(dyn, ninst, rex, x1, i64, x3, x4); } break; case 4: // AND - if(opcode==0x81) { - INST_NAME("LOCK AND Ed, Id"); - } else { - INST_NAME("LOCK AND Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); - if(MODREG) { - if(opcode==0x81) i64 = F32S; else i64 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_and32c(dyn, ninst, rex, ed, i64, x3, x4); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - if (i64 < -2048 || i64 >= 2048) - MOV64xw(x9, i64); - MARKLOCK; - LRxw(x1, wback, 1, 1); - if (i64 >= -2048 && i64 < 2048) { - ANDI(x4, x1, i64); + if (opcode == 0x81) { + INST_NAME("LOCK AND Ed, Id"); } else { - AND(x4, x1, x9); + INST_NAME("LOCK AND Ed, Ib"); } - if (!rex.w) ZEROUP(x4); - SCxw(x3, x4, wback, 1, 1); - BNEZ_MARKLOCK(x3); - IFX(X_ALL|X_PEND) + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; + MOV64xw(x7, i64); + AMOANDxw(x1, x7, wback, 1, 1); + IFXORNAT (X_ALL | X_PEND) emit_and32c(dyn, ninst, rex, x1, i64, x3, x4); } break; case 5: // SUB - if(opcode==0x81) { - INST_NAME("LOCK SUB Ed, Id"); - } else { - INST_NAME("LOCK SUB Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); - if(MODREG) { - if(opcode==0x81) i64 = F32S; else i64 = F8S; - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_sub32c(dyn, ninst, rex, ed, i64, x3, x4, x5, x6); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode==0x81)?4:1); - if(opcode==0x81) i64 = F32S; else i64 = F8S; - if (i64 <= -2048 || i64 > 2048) - MOV64xw(x9, i64); + if (opcode == 0x81) { + INST_NAME("LOCK SUB Ed, Id"); + } else { + INST_NAME("LOCK SUB Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); + if (opcode == 0x81) + i64 = F32S; + else + i64 = F8S; + MOV64xw(x7, i64); ANDI(x1, wback, (1 << (rex.w + 2)) - 1); BNEZ_MARK3(x1); // Aligned - MARKLOCK; - LRxw(x1, wback, 1, 1); - if (i64 > -2048 && i64 <= 2048) { - ADDIxw(x4, x1, -i64); - } else { - SUBxw(x4, x1, x9); - } - SCxw(x3, x4, wback, 1, 1); - BNEZ_MARKLOCK(x3); + SUBxw(x4, xZR, x7); + AMOADDxw(x1, x4, wback, 1, 1); B_MARK_nocond; MARK3; // Unaligned ANDI(x5, wback, -(1 << (rex.w + 2))); - MARK2; // Use MARK2 as a "MARKLOCK" since we're running out of marks. - LDxw(x6, wback, 0); - LRxw(x1, x5, 1, 1); - if (i64 > -2048 && i64 <= 2048) { - ADDIxw(x4, x6, -i64); - } else { - SUBxw(x4, x6, x9); - } - SCxw(x3, x1, x5, 1, 1); - BNEZ_MARK2(x3); + MARKLOCK2; + LDxw(x1, wback, 0); + LRxw(x6, x5, 1, 1); + SUBxw(x4, x1, x7); + SCxw(x3, x6, x5, 1, 1); + BNEZ_MARKLOCK2(x3); SDxw(x4, wback, 0); MARK; - IFX (X_ALL | X_PEND) + IFXORNAT (X_ALL | X_PEND) emit_sub32c(dyn, ninst, rex, x1, i64, x3, x4, x5, x6); - SMDMB(); } break; case 6: // XOR - if (opcode == 0x81) { - INST_NAME("LOCK XOR Ed, Id"); - } else { - INST_NAME("LOCK XOR Ed, Ib"); - } - SETFLAGS(X_ALL, SF_SET_PENDING); if (MODREG) { - if (opcode == 0x81) - i64 = F32S; - else - i64 = F8S; - ed = xRAX + (nextop & 7) + (rex.b << 3); - emit_xor32c(dyn, ninst, rex, ed, i64, x3, x4); + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + if (opcode == 0x81) { + INST_NAME("LOCK XOR Ed, Id"); + } else { + INST_NAME("LOCK XOR Ed, Ib"); + } + SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION); addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1); if (opcode == 0x81) i64 = F32S; else i64 = F8S; - if (i64 < -2048 || i64 >= 2048) - MOV64xw(x9, i64); - MARKLOCK; - LRxw(x1, wback, 1, 1); - if (i64 >= -2048 && i64 < 2048) { - XORI(x4, x1, i64); - } else { - XOR(x4, x1, x9); - } - SCxw(x3, x4, wback, 1, 1); - BNEZ_MARKLOCK(x3); - IFX(X_ALL | X_PEND) + MOV64xw(x7, i64); + AMOXORxw(x1, x7, wback, 1, 1); + IFXORNAT (X_ALL | X_PEND) emit_xor32c(dyn, ninst, rex, x1, i64, x3, x4); } break; default: DEFAULT; } - SMDMB(); break; case 0x87: - INST_NAME("LOCK XCHG Ed, Gd"); nextop = F8; if (MODREG) { - GETGD; - GETED(0); - MV(x1, gd); - MV(gd, ed); - MV(ed, x1); + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { - SMDMB(); + INST_NAME("LOCK XCHG Ed, Gd"); GETGD; addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); ANDI(x1, wback, (1 << (rex.w + 2)) - 1); BNEZ_MARK3(x1); // Aligned - MARKLOCK; - LRxw(x1, wback, 1, 1); - SCxw(x4, gd, wback, 1, 1); - BNEZ_MARKLOCK(x4); - B_MARK_nocond; + AMOSWAPxw(gd, gd, wback, 1, 1); + if (!rex.w) ZEROUP(gd); + B_NEXT_nocond; MARK3; // Unaligned ANDI(x5, wback, -(1 << (rex.w + 2))); - MARK2; // Use MARK2 as a "MARKLOCK" since we're running out of marks. + MARKLOCK; LDxw(x1, wback, 0); LRxw(x3, x5, 1, 1); SCxw(x4, x3, x5, 1, 1); - BNEZ_MARK2(x4); + BNEZ_MARKLOCK(x4); SDxw(gd, wback, 0); - MARK; MVxw(gd, x1); - SMDMB(); + } + break; + case 0xF6: + nextop = F8; + switch ((nextop >> 3) & 7) { + case 2: + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; + } else { + INST_NAME("LOCK NOT Eb"); + addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); + ANDI(x3, wback, 3); + ANDI(x5, wback, ~3); + MOV32w(x4, 0xFF); + SLLIW(x3, x3, 3); + SLLW(x4, x4, x3); // mask + AMOXOR_W(xZR, x4, x5, 1, 1); + } + break; + default: + DEFAULT; } break; case 0xFF: nextop = F8; - switch((nextop>>3)&7) - { + switch ((nextop >> 3) & 7) { case 0: // INC Ed - INST_NAME("LOCK INC Ed"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - SMDMB(); - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_inc32(dyn, ninst, rex, ed, x3, x4, x5, x6); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK INC Ed"); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LRxw(x1, wback, 1, 1); + ANDI(x1, wback, (1 << (rex.w + 2)) - 1); + BNEZ_MARK3(x1); + // Aligned + ADDIxw(x4, xZR, 1); + AMOADDxw(x1, x4, wback, 1, 1); + B_MARK_nocond; + MARK3; + // Unaligned + ANDI(x5, wback, -(1 << (rex.w + 2))); + MARKLOCK2; + LDxw(x1, wback, 0); + LRxw(x6, x5, 1, 1); ADDIxw(x4, x1, 1); - SCxw(x3, x4, wback, 1, 1); - BNEZ_MARKLOCK(x3); - IFX(X_ALL|X_PEND) + SCxw(x3, x6, x5, 1, 1); + BNEZ_MARKLOCK2(x3); + SDxw(x4, wback, 0); + MARK; + IFXORNAT (X_ALL | X_PEND) emit_inc32(dyn, ninst, rex, x1, x3, x4, x5, x6); } break; case 1: // DEC Ed - INST_NAME("LOCK DEC Ed"); - SETFLAGS(X_ALL&~X_CF, SF_SUBSET_PENDING); - SMDMB(); - if(MODREG) { - ed = xRAX+(nextop&7)+(rex.b<<3); - emit_dec32(dyn, ninst, rex, ed, x3, x4, x5, x6); + if (MODREG) { + INST_NAME("Invalid LOCK"); + UDF(); + *need_epilog = 1; + *ok = 0; } else { + INST_NAME("LOCK DEC Ed"); + SETFLAGS(X_ALL & ~X_CF, SF_SUBSET_PENDING, NAT_FLAGS_FUSION); addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, 0); - MARKLOCK; - LRxw(x1, wback, 1, 1); + ANDI(x1, wback, (1 << (rex.w + 2)) - 1); + BNEZ_MARK3(x1); + // Aligned + ADDIxw(x4, xZR, -1); + AMOADDxw(x1, x4, wback, 1, 1); + B_MARK_nocond; + MARK3; + // Unaligned + ANDI(x5, wback, -(1 << (rex.w + 2))); + MARKLOCK2; + LDxw(x1, wback, 0); + LRxw(x6, x5, 1, 1); ADDIxw(x4, x1, -1); - SCxw(x3, x4, wback, 1, 1); - BNEZ_MARKLOCK(x3); - IFX(X_ALL|X_PEND) + SCxw(x3, x6, x5, 1, 1); + BNEZ_MARKLOCK2(x3); + SDxw(x4, wback, 0); + MARK; + IFXORNAT (X_ALL | X_PEND) emit_dec32(dyn, ninst, rex, x1, x3, x4, x5, x6); } break; diff --git a/src/dynarec/rv64/dynarec_rv64_f20f.c b/src/dynarec/rv64/dynarec_rv64_f20f.c index 6bd1c28..c122ccf 100644 --- a/src/dynarec/rv64/dynarec_rv64_f20f.c +++ b/src/dynarec/rv64/dynarec_rv64_f20f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -19,11 +17,12 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { - (void)ip; (void)need_epilog; + (void)ip; + (void)need_epilog; uint8_t opcode = F8; uint8_t nextop; @@ -44,24 +43,24 @@ uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int MAYUSE(v0); MAYUSE(v1); - switch(opcode) { + switch (opcode) { case 0x10: INST_NAME("MOVSD Gx, Ex"); nextop = F8; GETG; - if(MODREG) { - ed = (nextop&7)+ (rex.b<<3); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); v0 = sse_get_reg(dyn, ninst, x1, gd, 0); d0 = sse_get_reg(dyn, ninst, x1, ed, 0); FMVD(v0, d0); } else { SMREAD(); v0 = sse_get_reg_empty(dyn, ninst, x1, gd, 0); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 8, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); FLD(v0, ed, fixedaddress); // reset upper part - SD(xZR, xEmu, offsetof(x64emu_t, xmm[gd])+8); + SD(xZR, xEmu, offsetof(x64emu_t, xmm[gd]) + 8); } break; case 0x11: @@ -69,8 +68,8 @@ uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETG; v0 = sse_get_reg(dyn, ninst, x1, gd, 0); - if(MODREG) { - ed = (nextop&7)+ (rex.b<<3); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); d0 = sse_get_reg(dyn, ninst, x1, ed, 0); FMVD(d0, v0); } else { @@ -83,17 +82,17 @@ uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MOVDDUP Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); - LD(x3, wback, fixedaddress+0); - SD(x3, gback, gdoffset+0); - SD(x3, gback, gdoffset+8); + GETEX(x2, 0, 1); + LD(x3, wback, fixedaddress + 0); + SD(x3, gback, gdoffset + 0); + SD(x3, gback, gdoffset + 8); break; case 0x2A: INST_NAME("CVTSI2SD Gx, Ed"); nextop = F8; GETGXSD(v0); GETED(0); - if(rex.w) { + if (rex.w) { FCVTDL(v0, ed, RD_RNE); } else { FCVTDW(v0, ed, RD_RNE); @@ -104,17 +103,16 @@ uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETGD; GETEXSD(v0, 0); - if(!box64_dynarec_fastround) { - FSFLAGSI(0); // // reset all bits + if (!BOX64ENV(dynarec_fastround)) { + FSFLAGSI(0); // reset all bits } FCVTLDxw(gd, v0, RD_RTZ); - if(!rex.w) - ZEROUP(gd); - if(!box64_dynarec_fastround) { - FRFLAGS(x5); // get back FPSR to check the IOC bit - ANDI(x5, x5, (1<> 3) + (rex.r << 3); + if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { + v0 = sse_get_reg_size_changed(dyn, ninst, x2, gd, 1); + FCVTSD(v0, v0); + } else { + GETEXSD(v1, 0); + GETGXSS_empty(v0); + FCVTSD(v0, v1); + } break; case 0x5C: INST_NAME("SUBSD Gx, Ex"); nextop = F8; GETGXSD(v0); GETEXSD(v1, 0); - if(!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { FEQD(x3, v0, v0); FEQD(x4, v1, v1); } FSUBD(v0, v0, v1); - if(!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { AND(x3, x3, x4); - CBZ_NEXT(x3); + BNEZ_MARK(x3); + CBNZ_NEXT(x4); + FMVD(v0, v1); + B_NEXT_nocond; + MARK; FEQD(x3, v0, v0); CBNZ_NEXT(x3); FNEGD(v0, v0); @@ -280,14 +297,18 @@ uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETGXSD(v0); GETEXSD(v1, 0); - if(!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { FEQD(x3, v0, v0); FEQD(x4, v1, v1); } FDIVD(v0, v0, v1); - if(!box64_dynarec_fastnan) { + if (!BOX64ENV(dynarec_fastnan)) { AND(x3, x3, x4); - CBZ_NEXT(x3); + BNEZ_MARK(x3); + CBNZ_NEXT(x4); + FMVD(v0, v1); + B_NEXT_nocond; + MARK; FEQD(x3, v0, v0); CBNZ_NEXT(x3); FNEGD(v0, v0); @@ -312,34 +333,34 @@ uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("PSHUFLW Gx, Ex, Ib"); nextop = F8; GETGX(); - GETEX(x2, 1); + GETEX(x2, 1, 8); u8 = F8; int32_t idx; - idx = (u8>>(0*2))&3; - LHU(x3, wback, fixedaddress+idx*2); - idx = (u8>>(1*2))&3; - LHU(x4, wback, fixedaddress+idx*2); - idx = (u8>>(2*2))&3; - LHU(x5, wback, fixedaddress+idx*2); - idx = (u8>>(3*2))&3; - LHU(x6, wback, fixedaddress+idx*2); + idx = (u8 >> (0 * 2)) & 3; + LHU(x3, wback, fixedaddress + idx * 2); + idx = (u8 >> (1 * 2)) & 3; + LHU(x4, wback, fixedaddress + idx * 2); + idx = (u8 >> (2 * 2)) & 3; + LHU(x5, wback, fixedaddress + idx * 2); + idx = (u8 >> (3 * 2)) & 3; + LHU(x6, wback, fixedaddress + idx * 2); - SH(x3, gback, gdoffset+0*2); - SH(x4, gback, gdoffset+1*2); - SH(x5, gback, gdoffset+2*2); - SH(x6, gback, gdoffset+3*2); + SH(x3, gback, gdoffset + 0 * 2); + SH(x4, gback, gdoffset + 1 * 2); + SH(x5, gback, gdoffset + 2 * 2); + SH(x6, gback, gdoffset + 3 * 2); - if (!(MODREG && (gd==ed))) { - LD(x3, wback, fixedaddress+8); - SD(x3, gback, gdoffset+8); + if (!(MODREG && (gd == ed))) { + LD(x3, wback, fixedaddress + 8); + SD(x3, gback, gdoffset + 8); } break; case 0x7C: INST_NAME("HADDPS Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); s0 = fpu_get_scratch(dyn); s1 = fpu_get_scratch(dyn); // GX->f[0] += GX->f[1]; @@ -377,9 +398,9 @@ uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int GETGXSD(d0); GETEXSD(d1, 1); u8 = F8; - if ((u8&7) == 0) { // Equal + if ((u8 & 7) == 0) { // Equal FEQD(x2, d0, d1); - } else if ((u8&7) == 4) { // Not Equal or unordered + } else if ((u8 & 7) == 4) { // Not Equal or unordered FEQD(x2, d0, d1); XORI(x2, x2, 1); } else { @@ -388,27 +409,33 @@ uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int FEQD(x2, d1, d1); AND(x2, x2, x3); - switch(u8&7) { - case 1: BEQ_MARK(x2, xZR); FLTD(x2, d0, d1); break; // Less than - case 2: BEQ_MARK(x2, xZR); FLED(x2, d0, d1); break; // Less or equal - case 3: XORI(x2, x2, 1); break; // NaN - case 5: { // Greater or equal or unordered - BEQ_MARK2(x2, xZR); - FLED(x2, d1, d0); - B_MARK_nocond; - break; - } - case 6: { // Greater or unordered, test inverted, N!=V so unordered or less than (inverted) - BEQ_MARK2(x2, xZR); - FLTD(x2, d1, d0); - B_MARK_nocond; - break; - } - case 7: break; // Not NaN + switch (u8 & 7) { + case 1: + BEQ_MARK(x2, xZR); + FLTD(x2, d0, d1); + break; // Less than + case 2: + BEQ_MARK(x2, xZR); + FLED(x2, d0, d1); + break; // Less or equal + case 3: XORI(x2, x2, 1); break; // NaN + case 5: { // Greater or equal or unordered + BEQ_MARK2(x2, xZR); + FLED(x2, d1, d0); + B_MARK_nocond; + break; + } + case 6: { // Greater or unordered, test inverted, N!=V so unordered or less than (inverted) + BEQ_MARK2(x2, xZR); + FLTD(x2, d1, d0); + B_MARK_nocond; + break; + } + case 7: break; // Not NaN } MARK2; - if ((u8&7) == 5 || (u8&7) == 6) { + if ((u8 & 7) == 5 || (u8 & 7) == 6) { MOV32w(x2, 1); } MARK; @@ -416,29 +443,60 @@ uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int NEG(x2, x2); FMVDX(d0, x2); break; + case 0xD0: + INST_NAME("ADDSUBPS Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 12); + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + // GX->f[0] -= EX->f[0]; + FLW(d0, wback, fixedaddress + 0); + FLW(d1, gback, gdoffset + 0); + FSUBS(d1, d1, d0); + FSW(d1, gback, gdoffset + 0); + + // GX->f[1] += EX->f[1]; + FLW(d0, wback, fixedaddress + 4); + FLW(d1, gback, gdoffset + 4); + FADDS(d1, d1, d0); + FSW(d1, gback, gdoffset + 4); + + // GX->f[2] -= EX->f[2]; + FLW(d0, wback, fixedaddress + 8); + FLW(d1, gback, gdoffset + 8); + FSUBS(d1, d1, d0); + FSW(d1, gback, gdoffset + 8); + + // GX->f[3] += EX->f[3]; + FLW(d0, wback, fixedaddress + 12); + FLW(d1, gback, gdoffset + 12); + FADDS(d1, d1, d0); + FSW(d1, gback, gdoffset + 12); + break; case 0xE6: INST_NAME("CVTPD2DQ Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); d0 = fpu_get_scratch(dyn); u8 = sse_setround(dyn, ninst, x6, x4); - for (int i=0; i<2 ; ++i) { - FLD(d0, wback, fixedaddress+8*i); + for (int i = 0; i < 2; ++i) { + FLD(d0, wback, fixedaddress + 8 * i); FCVTLD(x3, d0, RD_DYN); SEXT_W(x5, x3); BEQ(x5, x3, 8); LUI(x3, 0x80000); // INT32_MIN - SW(x3, gback, gdoffset+4*i); + SW(x3, gback, gdoffset + 4 * i); } x87_restoreround(dyn, ninst, u8); - SD(xZR, gback, gdoffset+8); + SD(xZR, gback, gdoffset + 8); break; case 0xF0: INST_NAME("LDDQU Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_MV_Q(x3); break; default: diff --git a/src/dynarec/rv64/dynarec_rv64_f20f_vector.c b/src/dynarec/rv64/dynarec_rv64_f20f_vector.c new file mode 100644 index 0000000..c141376 --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_f20f_vector.c @@ -0,0 +1,597 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" + +#include "rv64_printer.h" +#include "dynarec_rv64_private.h" +#include "dynarec_rv64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_F20F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop; + uint8_t gd, ed; + uint8_t wb1, wback, wb2, gback; + uint8_t u8; + uint64_t u64, j64; + int v0, v1; + int q0, q1; + int d0, d1; + int s0, s1; + uint64_t tmp64u0, tmp64u1; + int64_t fixedaddress, gdoffset; + int unscaled; + + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(q0); + MAYUSE(v0); + MAYUSE(v1); + + switch (opcode) { + case 0x10: + INST_NAME("MOVSD Gx, Ex"); + nextop = F8; + GETG; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + v0 = sse_get_reg_vector(dyn, ninst, x1, gd, 1, VECTOR_SEW64); + v1 = sse_get_reg_vector(dyn, ninst, x1, ed, 0, VECTOR_SEW64); + if (cpuext.xtheadvector) { + VECTOR_LOAD_VMASK(0b01, x4, 1); + VMERGE_VVM(v0, v0, v1); // implies VMASK + } else { + VMV_X_S(x4, v1); + VMV_S_X(v0, x4); + } + } else { + SMREAD(); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + if (!cpuext.xtheadvector) VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + VMV_S_X(v0, x4); + } + break; + case 0x11: + INST_NAME("MOVSD Ex, Gx"); + nextop = F8; + GETG; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + v0 = sse_get_reg_vector(dyn, ninst, x1, gd, 0, VECTOR_SEW64); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + d0 = sse_get_reg_vector(dyn, ninst, x1, ed, 1, VECTOR_SEW64); + if (cpuext.xtheadvector) { + VECTOR_LOAD_VMASK(0b01, x4, 1); + VMERGE_VVM(v0, v0, v1); // implies VMASK + } else { + VMV_X_S(x4, v1); + VMV_S_X(v0, x4); + } + } else { + VMV_X_S(x4, v0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + SD(x4, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0x12: + INST_NAME("MOVDDUP Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + GETGX_empty_vector(v0); + VMV_X_S(x4, v1); + } else { + SMREAD(); + GETGX_empty_vector(v0); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + } + VMV_V_X(v0, x4); + break; + case 0x2A: + INST_NAME("CVTSI2SD Gx, Ed"); + nextop = F8; + if (rex.w) { + SET_ELEMENT_WIDTH(x3, VECTOR_SEW64, 1); + GETGX_vector(v0, 1, VECTOR_SEW64); + GETED(0); + FCVTDL(v0, ed, RD_RNE); + } else { + SET_ELEMENT_WIDTH(x3, VECTOR_SEW32, 1); + GETGX_vector(v0, 1, VECTOR_SEW32); + GETED(0); + FCVTDW(v0, ed, RD_RNE); + SET_ELEMENT_WIDTH(x3, VECTOR_SEW64, 1); + } + if (cpuext.xtheadvector) { + v1 = fpu_get_scratch(dyn); + VFMV_S_F(v1, v0); + VECTOR_LOAD_VMASK(0b01, x4, 1); + VMERGE_VVM(v0, v0, v1); // implies VMASK + } else { + VFMV_S_F(v0, v0); + } + break; + case 0x2C: + INST_NAME("CVTTSD2SI Gd, Ex"); + nextop = F8; + GETGD; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + v0 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, dyn->vector_eew); + } else { + SMREAD(); + v0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v0, x4); + } + if (BOX64ENV(dynarec_fastround)) { + VFMV_F_S(v0, v0); + FCVTLDxw(gd, v0, RD_RTZ); + if (!rex.w) ZEROUP(gd); + } else { + VFMV_F_S(v0, v0); + FSFLAGSI(0); // // reset all bits + FCVTLDxw(gd, v0, RD_RTZ); + if (!rex.w) ZEROUP(gd); + FRFLAGS(x5); // get back FPSR to check the IOC bit + ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); + CBZ_NEXT(x5); + if (rex.w) { + MOV64x(gd, 0x8000000000000000LL); + } else { + MOV32w(gd, 0x80000000); + } + } + break; + case 0x2D: + INST_NAME("CVTSD2SI Gd, Ex"); + nextop = F8; + GETGD; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + v0 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, dyn->vector_eew); + } else { + SMREAD(); + v0 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v0, x4); + } + if (BOX64ENV(dynarec_fastround)) { + VFMV_F_S(v0, v0); + u8 = sse_setround(dyn, ninst, x2, x3); + FCVTLDxw(gd, v0, RD_DYN); + if (!rex.w) ZEROUP(gd); + x87_restoreround(dyn, ninst, u8); + } else { + VFMV_F_S(v0, v0); + FSFLAGSI(0); // // reset all bits + u8 = sse_setround(dyn, ninst, x2, x3); + FCVTLDxw(gd, v0, RD_DYN); + if (!rex.w) ZEROUP(gd); + x87_restoreround(dyn, ninst, u8); + FRFLAGS(x5); // get back FPSR to check the IOC bit + ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); + CBZ_NEXT(x5); + if (rex.w) { + MOV64x(gd, 0x8000000000000000LL); + } else { + MOV32w(gd, 0x80000000); + } + } + break; + case 0x38: + return 0; + case 0x51: + INST_NAME("SQRTSD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW64); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + GETGX_vector(v0, 1, VECTOR_SEW64); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + } + if (BOX64ENV(dynarec_fastnan)) { + VECTOR_LOAD_VMASK(0b01, x4, 1); + VFSQRT_V(v0, v1, VECTOR_MASKED); + } else { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFSQRT_V(d1, v1, VECTOR_UNMASKED); + FMVDX(d0, xZR); + VMFLT_VF(VMASK, v1, d0, VECTOR_UNMASKED); + VFSGNJN_VV(d1, d1, d1, VECTOR_MASKED); + if (cpuext.xtheadvector) { + VECTOR_LOAD_VMASK(0b01, x4, 1); + VMERGE_VVM(v0, v0, d1); // implies VMASK + } else { + VMV_X_S(x4, d1); + VMV_S_X(v0, x4); + } + } + break; + case 0x58: + if (!BOX64ENV(dynarec_fastnan)) return 0; + INST_NAME("ADDSD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW64); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW64); + } + VECTOR_LOAD_VMASK(0b01, x4, 1); + VFADD_VV(v0, v0, v1, VECTOR_MASKED); + break; + case 0x59: + if (!BOX64ENV(dynarec_fastnan)) return 0; + INST_NAME("MULSD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW64); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW64); + } + VECTOR_LOAD_VMASK(0b01, x4, 1); + VFMUL_VV(v0, v0, v1, VECTOR_MASKED); + break; + case 0x5A: + INST_NAME("CVTSD2SS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW64); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + v1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW64); + } + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + VECTOR_LOAD_VMASK(0b0001, x4, 1); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + // as per section 5.2 Vector Operands of V-spec v1.0, + // > A destination vector register group can overlap a source vector register group only if one of the following holds: + // > - ... + // > - The destination EEW is smaller than the source EEW and the overlap is in the lowest-numbered part of the source register group + // > - ... + if (v1 & 1 || v0 == v1 + 1) { + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(d1, v1); + if (cpuext.xtheadvector) { + VFNCVT_F_F_W(d0, d1, VECTOR_MASKED); + VMERGE_VVM(v0, v0, d0); // implies VMASK + } else { + VFNCVT_F_F_W(v0, d1, VECTOR_MASKED); + } + } else { + if (cpuext.xtheadvector) { + VFNCVT_F_F_W(d0, v1, VECTOR_MASKED); + VMERGE_VVM(v0, v0, d0); // implies VMASK + } else { + VFNCVT_F_F_W(v0, v1, VECTOR_MASKED); + } + } + break; + case 0x5C: + if (!BOX64ENV(dynarec_fastnan)) return 0; + INST_NAME("SUBSD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW64); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW64); + } + VECTOR_LOAD_VMASK(0b01, x4, 1); + VFSUB_VV(v0, v0, v1, VECTOR_MASKED); + break; + case 0x5D: + INST_NAME("MINSD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW64); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW64); + } + if (BOX64ENV(dynarec_fastnan)) { + VECTOR_LOAD_VMASK(0b01, x4, 1); + VFMIN_VV(v0, v0, v1, VECTOR_MASKED); + } else { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFMV_F_S(d0, v0); + VFMV_F_S(d1, v1); + FEQD(x2, d0, d0); + FEQD(x3, d1, d1); + AND(x2, x2, x3); + BEQ_MARK(x2, xZR); + FLED(x2, d1, d0); + BEQ_MARK2(x2, xZR); + MARK; + FMVD(d0, d1); + MARK2; + if (cpuext.xtheadvector) { + VFMV_S_F(d0, d0); + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VMERGE_VVM(v0, v0, d0); // implies VMASK + } else { + VFMV_S_F(v0, d0); + } + } + break; + case 0x5E: + if (!BOX64ENV(dynarec_fastnan)) return 0; + INST_NAME("DIVSD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW64); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW64); + } + VECTOR_LOAD_VMASK(0b01, x4, 1); + VFDIV_VV(v0, v0, v1, VECTOR_MASKED); + break; + case 0x5F: + INST_NAME("MAXSD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW64); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW64); + } + if (BOX64ENV(dynarec_fastnan)) { + VECTOR_LOAD_VMASK(0b01, x4, 1); + VFMAX_VV(v0, v0, v1, VECTOR_MASKED); + } else { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFMV_F_S(d0, v0); + VFMV_F_S(d1, v1); + FEQD(x2, d0, d0); + FEQD(x3, d1, d1); + AND(x2, x2, x3); + BEQ_MARK(x2, xZR); + FLED(x2, d0, d1); + BEQ_MARK2(x2, xZR); + MARK; + FMVD(d0, d1); + MARK2; + if (cpuext.xtheadvector) { + VFMV_S_F(d0, d0); + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VMERGE_VVM(v0, v0, d0); // implies VMASK + } else { + VFMV_S_F(v0, d0); + } + } + break; + case 0x70: + INST_NAME("PSHUFLW Gx, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETEX_vector(v1, 0, 1, VECTOR_SEW16); + GETGX_vector(v0, 1, VECTOR_SEW16); + u8 = F8; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL1, 1); + tmp64u0 = 0x0007000600050004ULL; + MOV64x(x5, tmp64u0); + VMV_S_X(d1, x5); + tmp64u0 = ((((uint64_t)u8 >> 6) & 3) << 48) | ((((uint64_t)u8 >> 4) & 3) << 32) | (((u8 >> 2) & 3) << 16) | (u8 & 3); + MOV64x(x5, tmp64u0); + VSLIDE1UP_VX(d0, d1, x5, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 1); + if (v0 == v1) { + v1 = fpu_get_scratch(dyn); + VMV_V_V(v1, v0); + } + VRGATHER_VV(v0, v1, d0, VECTOR_UNMASKED); + break; + case 0x7C: + INST_NAME("HADDPS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETGX_vector(q0, 1, VECTOR_SEW32); + GETEX_vector(q1, 0, 0, VECTOR_SEW32); + v0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(v0, q0); + if (q1 & 1) VMV_V_V(d1, q1); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL2, 2); + VSLIDEUP_VI(v0, (q1 & 1) ? d1 : q1, 4, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 1); + ADDI(x4, xZR, 32); + VNSRL_WX(d0, v0, xZR, VECTOR_UNMASKED); + VNSRL_WX(d1, v0, x4, VECTOR_UNMASKED); + VFADD_VV(q0, d1, d0, VECTOR_UNMASKED); + break; + case 0xC2: + INST_NAME("CMPSD Gx, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + GETGX_vector(d0, 1, VECTOR_SEW64); + d1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + d1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 1); + LD(x4, ed, fixedaddress); + VMV_S_X(d1, x4); + GETGX_vector(d0, 1, VECTOR_SEW64); + } + u8 = F8; + VFMV_F_S(d0, d0); + VFMV_F_S(d1, d1); + if ((u8 & 7) == 0) { // Equal + FEQD(x2, d0, d1); + } else if ((u8 & 7) == 4) { // Not Equal or unordered + FEQD(x2, d0, d1); + XORI(x2, x2, 1); + } else { + // x2 = !(isnan(d0) || isnan(d1)) + FEQD(x3, d0, d0); + FEQD(x2, d1, d1); + AND(x2, x2, x3); + switch (u8 & 7) { + case 1: + BEQ_MARK(x2, xZR); + FLTD(x2, d0, d1); + break; // Less than + case 2: + BEQ_MARK(x2, xZR); + FLED(x2, d0, d1); + break; // Less or equal + case 3: XORI(x2, x2, 1); break; // NaN + case 5: { // Greater or equal or unordered + BEQ_MARK2(x2, xZR); + FLED(x2, d1, d0); + B_MARK_nocond; + break; + } + case 6: { // Greater or unordered, test inverted, N!=V so unordered or less than (inverted) + BEQ_MARK2(x2, xZR); + FLTD(x2, d1, d0); + B_MARK_nocond; + break; + } + case 7: break; // Not NaN + } + + MARK2; + if ((u8 & 7) == 5 || (u8 & 7) == 6) { + MOV32w(x2, 1); + } + MARK; + } + NEG(x2, x2); + if (cpuext.xtheadvector) { + v0 = fpu_get_scratch(dyn); + VMV_S_X(v0, x2); + VECTOR_LOAD_VMASK(0b01, x4, 1); + VMERGE_VVM(d0, d0, v0); // implies VMASK + } else { + VMV_S_X(d0, x2); + } + break; + case 0xE6: + if (!BOX64ENV(dynarec_fastround)) return 0; + INST_NAME("CVTPD2DQ Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + GETEX_vector(v1, 0, 0, VECTOR_SEW64); + GETGX_empty_vector(v0); + if (v1 & 1) { + d1 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VMV_V_V(d1, v1); + } else { + d1 = v1; + } + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 0.5); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + u8 = sse_setround(dyn, ninst, x6, x4); + VFNCVT_X_F_W(d0, d1, VECTOR_UNMASKED); + x87_restoreround(dyn, ninst, u8); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL1, 1); + if (!cpuext.xtheadvector) VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + VMV_X_S(x4, d0); + VMV_S_X(v0, x4); + break; + case 0xF0: + INST_NAME("LDDQU Gx, Ex"); + nextop = F8; + GETG; + if (MODREG) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_vector(dyn, ninst, x1, ed, 0, dyn->vector_eew); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + VMV_V_V(v0, v1); + } else { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); // unaligned! + SMREAD(); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VLE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + } + break; + default: DEFAULT_VECTOR; + } + return addr; +} diff --git a/src/dynarec/rv64/dynarec_rv64_f30f.c b/src/dynarec/rv64/dynarec_rv64_f30f.c index bebcc55..3cec09e 100644 --- a/src/dynarec/rv64/dynarec_rv64_f30f.c +++ b/src/dynarec/rv64/dynarec_rv64_f30f.c @@ -5,10 +5,8 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -20,7 +18,7 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" +#include "../dynarec_helper.h" uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) { @@ -35,6 +33,7 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int int v0, v1; int q0, q1; int d0, d1; + uint8_t tmp1, tmp2, tmp3; int64_t fixedaddress, gdoffset; int unscaled; int64_t j64; @@ -59,7 +58,7 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } else { v0 = sse_get_reg_empty(dyn, ninst, x1, gd, 1); SMREAD(); - addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 8, 0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); FLW(v0, ed, fixedaddress); // reset upper part SW(xZR, xEmu, offsetof(x64emu_t, xmm[gd]) + 4); @@ -85,7 +84,7 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MOVSLDUP Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); // GX->ud[1] = GX->ud[0] = EX->ud[0]; // GX->ud[3] = GX->ud[2] = EX->ud[2]; @@ -100,7 +99,7 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MOVSHDUP Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 12); // GX->ud[1] = GX->ud[0] = EX->ud[1]; // GX->ud[3] = GX->ud[2] = EX->ud[3]; @@ -134,13 +133,13 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETGD; GETEXSS(d0, 0); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FSFLAGSI(0); // // reset all bits } FCVTSxw(gd, d0, RD_RTZ); if (!rex.w) ZEROUP(gd); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FRFLAGS(x5); // get back FPSR to check the IOC bit ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); CBZ_NEXT(x5); @@ -156,7 +155,7 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETGD; GETEXSS(d0, 0); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FSFLAGSI(0); // // reset all bits } u8 = sse_setround(dyn, ninst, x5, x6); @@ -164,7 +163,7 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int x87_restoreround(dyn, ninst, u8); if (!rex.w) ZEROUP(gd); - if (!box64_dynarec_fastround) { + if (!BOX64ENV(dynarec_fastround)) { FRFLAGS(x5); // get back FPSR to check the IOC bit ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); CBZ_NEXT(x5); @@ -176,6 +175,34 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int } break; +#define GO(GETFLAGS, NO, YES, NATNO, NATYES, F) \ + READFLAGS_FUSION(F, x1, x2, x3, x4, x5); \ + if (!dyn->insts[ninst].nat_flags_fusion) { \ + GETFLAGS; \ + } \ + nextop = F8; \ + GETGD; \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEMV(NATYES, gd, ed); \ + } else { \ + MV##YES(gd, ed, tmp1); \ + } \ + if (!rex.w) ZEROUP(gd); \ + } else { \ + addr = geted(dyn, addr, ninst, nextop, &ed, tmp2, tmp3, &fixedaddress, rex, NULL, 1, 0); \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + NATIVEJUMP(NATNO, 8); \ + } else { \ + B##NO(tmp1, 8); \ + } \ + LDxw(gd, ed, fixedaddress); \ + } + + GOCOND(0x40, "CMOV", "Gd, Ed"); +#undef GO + case 0x51: INST_NAME("SQRTSS Gx, Ex"); nextop = F8; @@ -209,28 +236,92 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETGXSS(v0); GETEXSS(d0, 0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, v0, v0); + FEQS(x4, d0, d0); + } FADDS(v0, v0, d0); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BNEZ_MARK(x3); + CBNZ_NEXT(x4); + FMVS(v0, d0); + MARK; + } break; case 0x59: INST_NAME("MULSS Gx, Ex"); nextop = F8; GETGXSS(v0); GETEXSS(d0, 0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, v0, v0); + FEQS(x4, d0, d0); + } FMULS(v0, v0, d0); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BNEZ_MARK(x3); + CBNZ_NEXT(x4); + FMVS(v0, d0); + B_NEXT_nocond; + MARK; + FEQS(x3, v0, v0); + CBNZ_NEXT(x3); + FNEGS(v0, v0); + } break; case 0x5A: INST_NAME("CVTSS2SD Gx, Ex"); nextop = F8; + gd = ((nextop & 0x38) >> 3) + (rex.r << 3); GETEXSS(v1, 0); - GETGXSD_empty(v0); - FCVTDS(v0, v1); + if (MODREG && gd == (nextop & 7) + (rex.b << 3)) { + v0 = sse_get_reg_size_changed(dyn, ninst, x2, gd, 0); + FCVTDS(v0, v0); + } else { + GETGXSD_empty(v0); + FCVTDS(v0, v1); + } + break; + case 0x5B: + INST_NAME("CVTTPS2DQ Gx, Ex"); + nextop = F8; + GETGX(); + GETEX(x2, 0, 12); + v0 = fpu_get_scratch(dyn); + for (int i = 0; i < 4; ++i) { + if (!BOX64ENV(dynarec_fastround)) { + FSFLAGSI(0); // reset all bits + } + FLW(v0, wback, fixedaddress + i * 4); + FCVTWS(x3, v0, RD_RTZ); + if (!BOX64ENV(dynarec_fastround)) { + FRFLAGS(x5); // get back FPSR to check the IOC bit + ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); + BEQZ(x5, 8); + MOV32w(x3, 0x80000000); + } + SW(x3, gback, gdoffset + i * 4); + } break; case 0x5C: INST_NAME("SUBSS Gx, Ex"); nextop = F8; GETGXSS(v0); GETEXSS(d0, 0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, v0, v0); + FEQS(x4, d0, d0); + } FSUBS(v0, v0, d0); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BNEZ_MARK(x3); + CBNZ_NEXT(x4); + FMVS(v0, d0); + MARK; + } break; case 0x5D: INST_NAME("MINSS Gx, Ex"); @@ -241,7 +332,7 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int FEQS(x3, d1, d1); AND(x2, x2, x3); BEQ_MARK(x2, xZR); - FLTS(x2, d1, d0); + FLES(x2, d1, d0); BEQ_MARK2(x2, xZR); MARK; FMVS(d0, d1); @@ -252,7 +343,18 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int nextop = F8; GETGXSS(v0); GETEXSS(d0, 0); + if (!BOX64ENV(dynarec_fastnan)) { + FEQS(x3, v0, v0); + FEQS(x4, d0, d0); + } FDIVS(v0, v0, d0); + if (!BOX64ENV(dynarec_fastnan)) { + AND(x3, x3, x4); + BNEZ_MARK(x3); + CBNZ_NEXT(x4); + FMVS(v0, d0); + MARK; + } break; case 0x5F: INST_NAME("MAXSS Gx, Ex"); @@ -263,7 +365,7 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int FEQS(x3, d1, d1); AND(x2, x2, x3); BEQ_MARK(x2, xZR); - FLTS(x2, d0, d1); + FLES(x2, d0, d1); BEQ_MARK2(x2, xZR); MARK; FMVS(d0, d1); @@ -273,14 +375,14 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MOVDQU Gx,Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 8); SSE_LOOP_MV_Q(x3); break; case 0x70: // TODO: Optimize this! INST_NAME("PSHUFHW Gx, Ex, Ib"); nextop = F8; GETGX(); - GETEX(x2, 1); + GETEX(x2, 1, 14); u8 = F8; int32_t idx; @@ -323,41 +425,98 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("MOVDQU Ex,Gx"); nextop = F8; GETGX(); - GETEX(x2, 0); - SSE_LOOP_MV_Q2(x3); + IF_UNALIGNED(ip) { + GETEX(x2, 0, 15); + LD(x3, gback, gdoffset + 0); + LD(x4, gback, gdoffset + 8); + for (int i = 0; i < 8; i++) { + if (i == 0) { + SB(x3, wback, fixedaddress); + } else { + SRLI(x5, x3, i * 8); + SB(x5, wback, fixedaddress + i); + } + } + for (int i = 0; i < 8; i++) { + if (i == 0) { + SB(x4, wback, fixedaddress + 8); + } else { + SRLI(x5, x4, i * 8); + SB(x5, wback, fixedaddress + i + 8); + } + } + } else { + GETEX(x2, 0, 8); + SSE_LOOP_MV_Q2(x3); + } if (!MODREG) SMWRITE2(); break; - - case 0x5B: - INST_NAME("CVTTPS2DQ Gx, Ex"); + case 0xAE: nextop = F8; - GETGX(); - GETEX(x2, 0); - v0 = fpu_get_scratch(dyn); - for (int i = 0; i < 4; ++i) { - if (!box64_dynarec_fastround) { - FSFLAGSI(0); // reset all bits - } - FLW(v0, wback, fixedaddress + i * 4); - FCVTWS(x3, v0, RD_RTZ); - if (!box64_dynarec_fastround) { - FRFLAGS(x5); // get back FPSR to check the IOC bit - ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); - BEQZ(x5, 8); - MOV32w(x3, 0x80000000); - } - SW(x3, gback, gdoffset + i * 4); + switch ((nextop >> 3) & 7) { + case 0: + case 1: + if (rex.is32bits || !MODREG) { + INST_NAME("Illegal AE"); + FAKEED; + UDF(); + } else { + if (((nextop >> 3) & 7) == 1) { + INST_NAME("RDGSBASE"); + } else { + INST_NAME("RDFSBASE"); + } + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + int seg = _FS + ((nextop >> 3) & 7); + grab_segdata(dyn, addr, ninst, x4, seg); + MVxw(ed, x4); + } + break; + case 2: + case 3: + if (rex.is32bits || !MODREG) { + INST_NAME("Illegal AE"); + FAKEED; + UDF(); + } else { + if (((nextop >> 3) & 7) == 3) { + INST_NAME("WRGSBASE"); + } else { + INST_NAME("WRFSBASE"); + } + ed = TO_NAT((nextop & 7) + (rex.b << 3)); + int seg = _FS + ((nextop >> 3) & 7) - 2; + if (!rex.w) { + ZEXTW2(x4, ed); + SD(x4, xEmu, offsetof(x64emu_t, segs_offs[seg])); + } else { + SD(ed, xEmu, offsetof(x64emu_t, segs_offs[seg])); + } + } + break; + case 5: + INST_NAME("(unsupported) INCSSPD/INCSSPQ Ed"); + FAKEED; + UDF(); + break; + case 6: + INST_NAME("(unsupported) UMONITOR Ed"); + FAKEED; + UDF(); + break; + default: + DEFAULT; } break; case 0xB8: INST_NAME("POPCNT Gd, Ed"); - SETFLAGS(X_ALL, SF_SET); + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); SET_DFNONE(); nextop = F8; GETED(0); GETGD; if (!rex.w && MODREG) { - AND(x4, ed, xMASK); + ZEXTW2(x4, ed); ed = x4; } CLEAR_FLAGS(); @@ -366,73 +525,141 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int MOV32w(gd, 0); B_NEXT_nocond; MARK; - if (rv64_zbb) { + if (cpuext.zbb) { CPOPxw(gd, ed); } else { - TABLE64(x1, 0x5555555555555555uLL); - SRLI(x5, ed, 1); - AND(x5, x5, x1); - SUB(x5, ed, x5); - TABLE64(x3, 0x3333333333333333uLL); - SRLI(x1, x5, 2); - AND(x1, x1, x3); - AND(x5, x5, x3); - ADD(x5, x5, x1); - TABLE64(x3, 0x0F0F0F0F0F0F0F0FuLL); - SRLI(x1, x5, 4); - ADD(x5, x5, x1); - AND(x5, x5, x3); - SRLI(x1, x5, 32); - ADDW(x5, x5, x1); - SRLIW(x1, x5, 16); - ADDW(x5, x5, x1); - SRLIW(x1, x5, 8); - ADDW(x5, x5, x1); - ANDI(gd, x5, 0x7F); + if (rex.w) { + // x7 = 0x5555555555555555 + LUI(x7, 0x55555); + ADDIW(x7, x7, 0x555); + SLLI(x6, x7, 32); + ADD(x7, x7, x6); + + // v = v - ((v >> 1) & x7) + SRLI(x5, ed, 1); + AND(x5, x5, x7); + SUB(x5, ed, x5); + + // x3 = 0x3333333333333333 + LUI(x3, 0x33333); + ADDIW(x3, x3, 0x333); + SLLI(x6, x3, 32); + ADD(x3, x3, x6); + + // v = (v & x3) + ((v >> 2) & x3); + SRLI(x7, x5, 2); + AND(x7, x7, x3); + AND(x5, x5, x3); + ADD(x5, x5, x7); + + // x3 = 0x0F0F0F0F0F0F0F0F + LUI(x3, 0xF0F1); + ADDIW(x3, x3, 0xF0F); + SLLI(x6, x3, 32); + ADD(x3, x3, x6); + + // v = (v + (v >> 4) & x3) + SRLI(x7, x5, 4); + ADD(x5, x5, x7); + AND(x5, x5, x3); + + // x3 = 0x0101010101010101 + LUI(x3, 0x1010); + ADDIW(x3, x3, 0x101); + SLLI(x6, x3, 32); + ADD(x3, x3, x6); + + // count = (v * x3) >> 56 + MUL(gd, x5, x3); + SRLI(gd, gd, 56); + } else { + // x7 = 0x55555555uLL + LUI(x7, 0x55555); + ADDIW(x7, x7, 0x555); + + // v = v - ((v >> 1) & x7) + SRLI(x5, ed, 1); + AND(x5, x5, x7); + SUB(x5, ed, x5); + + // x3 = 0x33333333uLL + LUI(x3, 0x33333); + ADDIW(x3, x3, 0x333); + + // v = (v & x3) + ((v >> 2) & x3); + SRLI(x7, x5, 2); + AND(x7, x7, x3); + AND(x5, x5, x3); + ADD(x5, x5, x7); + + // x3 = 0x0F0F0F0FuLL + LUI(x3, 0xF0F1); + ADDIW(x3, x3, 0xF0F); + + // v = (v + (v >> 4) & x3) + SRLI(x7, x5, 4); + ADD(x5, x5, x7); + AND(x5, x5, x3); + + // x3 = 01010101uLL + LUI(x3, 0x1010); + ADDIW(x3, x3, 0x101); + + // count = (v * x3) >> 24 + MULW(gd, x5, x3); + SRLIW(gd, gd, 24); + } } break; case 0xBC: INST_NAME("TZCNT Gd, Ed"); - SETFLAGS(X_ZF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_CF | X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); nextop = F8; GETED(0); GETGD; + CLEAR_FLAGS(); if (!rex.w && MODREG) { - AND(x4, ed, xMASK); + ZEXTW2(x4, ed); ed = x4; } - ANDI(xFlags, xFlags, ~((1 << F_ZF) | (1 << F_CF))); - BNE_MARK(ed, xZR); - ORI(xFlags, xFlags, 1 << F_CF); + IFX (X_CF) SET_FLAGS_EQZ(ed, F_CF, x3); + BNEZ_MARK(ed); + IFX (X_ZF) ANDI(xFlags, xFlags, ~(1 << F_ZF)); MOV32w(gd, rex.w ? 64 : 32); B_NEXT_nocond; MARK; - CTZxw(gd, ed, rex.w, x1, x2); - BNE(gd, xZR, 4 + 4); - ORI(xFlags, xFlags, 1 << F_ZF); + CTZxw(gd, ed, rex.w, x3, x5); + IFX (X_ZF) SET_FLAGS_EQZ(gd, F_ZF, x3); break; case 0xBD: INST_NAME("LZCNT Gd, Ed"); - SETFLAGS(X_ZF | X_CF, SF_SUBSET); + if (!BOX64DRENV(dynarec_safeflags)) { + SETFLAGS(X_CF | X_ZF, SF_SUBSET, NAT_FLAGS_NOFUSION); + } else { + SETFLAGS(X_ALL, SF_SET, NAT_FLAGS_NOFUSION); + } SET_DFNONE(); nextop = F8; GETED(0); GETGD; + CLEAR_FLAGS(); if (!rex.w && MODREG) { - AND(x4, ed, xMASK); + ZEXTW2(x4, ed); ed = x4; } - BNE_MARK(ed, xZR); + IFX (X_CF) SET_FLAGS_EQZ(ed, F_CF, x3); + BNEZ_MARK(ed); MOV32w(gd, rex.w ? 64 : 32); - ANDI(xFlags, xFlags, ~(1 << F_ZF)); - ORI(xFlags, xFlags, 1 << F_CF); + IFX (X_ZF) ANDI(xFlags, xFlags, ~(1 << F_ZF)); B_NEXT_nocond; MARK; - CLZxw(gd, ed, rex.w, x1, x2, x3); - ANDI(xFlags, xFlags, ~((1 << F_ZF) | (1 << F_CF))); - BNE(gd, xZR, 4 + 4); - ORI(xFlags, xFlags, 1 << F_ZF); + CLZxw(gd, ed, rex.w, x5, x2, x3); + IFX (X_ZF) SET_FLAGS_EQZ(gd, F_ZF, x3); break; case 0xC2: @@ -491,7 +718,7 @@ uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int INST_NAME("CVTDQ2PD Gx, Ex"); nextop = F8; GETGX(); - GETEX(x2, 0); + GETEX(x2, 0, 4); q0 = fpu_get_scratch(dyn); q1 = fpu_get_scratch(dyn); LW(x3, wback, fixedaddress + 0); diff --git a/src/dynarec/rv64/dynarec_rv64_f30f_vector.c b/src/dynarec/rv64/dynarec_rv64_f30f_vector.c new file mode 100644 index 0000000..fa51179 --- /dev/null +++ b/src/dynarec/rv64/dynarec_rv64_f30f_vector.c @@ -0,0 +1,653 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "box64cpu.h" +#include "emu/x64emu_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "dynarec_native.h" +#include "bitutils.h" + +#include "rv64_printer.h" +#include "dynarec_rv64_private.h" +#include "dynarec_rv64_functions.h" +#include "../dynarec_helper.h" + +uintptr_t dynarec64_F30F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog) +{ + (void)ip; + (void)need_epilog; + + uint8_t opcode = F8; + uint8_t nextop, u8; + uint8_t gd, ed; + uint8_t wback, gback; + uint64_t u64; + int v0, v1; + int q0, q1; + int d0, d1; + uint64_t tmp64u0, tmp64u1; + int64_t fixedaddress, gdoffset; + int unscaled; + int64_t j64; + + MAYUSE(d0); + MAYUSE(d1); + MAYUSE(q0); + MAYUSE(q1); + MAYUSE(v0); + MAYUSE(v1); + MAYUSE(j64); + + switch (opcode) { + case 0x10: + INST_NAME("MOVSS Gx, Ex"); + nextop = F8; + GETG; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + v0 = sse_get_reg_vector(dyn, ninst, x1, gd, 1, VECTOR_SEW32); + v1 = sse_get_reg_vector(dyn, ninst, x1, ed, 0, VECTOR_SEW32); + if (cpuext.xtheadvector) { + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VMERGE_VVM(v0, v0, v1); // implies VMASK + } else { + VMV_X_S(x4, v1); + VMV_S_X(v0, x4); + } + } else { + SMREAD(); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LWU(x4, ed, fixedaddress); + VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + VMV_S_X(v0, x4); + } + break; + case 0x11: + INST_NAME("MOVSS Ex, Gx"); + nextop = F8; + GETG; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + v0 = sse_get_reg_vector(dyn, ninst, x1, gd, 0, VECTOR_SEW32); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + d0 = sse_get_reg_vector(dyn, ninst, x1, ed, 1, VECTOR_SEW32); + if (cpuext.xtheadvector) { + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VMERGE_VVM(v0, v0, v1); // implies VMASK + } else { + VMV_X_S(x4, v1); + VMV_S_X(v0, x4); + } + } else { + VMV_X_S(x4, v0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + SW(x4, ed, fixedaddress); + SMWRITE2(); + } + break; + case 0x12: + INST_NAME("MOVSLDUP Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + q1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + q1 = fpu_get_scratch(dyn); + VLE64_V(q1, ed, VECTOR_UNMASKED, VECTOR_NFIELD1); + } + GETGX_empty_vector(q0); + ADDI(x4, xZR, 32); + v0 = fpu_get_scratch(dyn); + VSLL_VX(q0, q1, x4, VECTOR_UNMASKED); + VSRL_VX(v0, q0, x4, VECTOR_UNMASKED); + VOR_VV(q0, q0, v0, VECTOR_UNMASKED); + break; + case 0x16: + INST_NAME("MOVSHDUP Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + q1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 0, 0); + q1 = fpu_get_scratch(dyn); + VLE64_V(q1, ed, VECTOR_UNMASKED, VECTOR_NFIELD1); + } + GETGX_empty_vector(q0); + ADDI(x4, xZR, 32); + v0 = fpu_get_scratch(dyn); + VSRL_VX(q0, q1, x4, VECTOR_UNMASKED); + VSLL_VX(v0, q0, x4, VECTOR_UNMASKED); + VOR_VV(q0, q0, v0, VECTOR_UNMASKED); + break; + case 0x1E: + return 0; + case 0x2A: + INST_NAME("CVTSI2SS Gx, Ed"); + nextop = F8; + if (rex.w) { + SET_ELEMENT_WIDTH(x3, VECTOR_SEW64, 1); + GETGX_vector(v0, 1, VECTOR_SEW64); + GETED(0); + FCVTSL(v0, ed, RD_RNE); + SET_ELEMENT_WIDTH(x3, VECTOR_SEW32, 1); + } else { + SET_ELEMENT_WIDTH(x3, VECTOR_SEW32, 1); + GETGX_vector(v0, 1, VECTOR_SEW32); + GETED(0); + FCVTSW(v0, ed, RD_RNE); + } + if (cpuext.xtheadvector) { + v1 = fpu_get_scratch(dyn); + VFMV_S_F(v1, v0); + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VMERGE_VVM(v0, v0, v1); // implies VMASK + } else { + VFMV_S_F(v0, v0); + } + break; + case 0x2C: + INST_NAME("CVTTSS2SI Gd, Ex"); + nextop = F8; + GETGD; + SET_ELEMENT_WIDTH(x3, VECTOR_SEW32, 1); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + d0 = sse_get_reg_vector(dyn, ninst, x1, ed, 0, VECTOR_SEW32); + VFMV_F_S(d0, d0); + } else { + GETEXSS(d0, 0); + } + if (!BOX64ENV(dynarec_fastround)) FSFLAGSI(0); + FCVTSxw(gd, d0, RD_RTZ); + if (!rex.w) ZEROUP(gd); + if (!BOX64ENV(dynarec_fastround)) { + FRFLAGS(x5); + ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); + CBZ_NEXT(x5); + if (rex.w) { + MOV64x(gd, 0x8000000000000000LL); + } else { + MOV32w(gd, 0x80000000); + } + } + break; + case 0x2D: + INST_NAME("CVTSS2SI Gd, Ex"); + nextop = F8; + GETGD; + SET_ELEMENT_WIDTH(x3, VECTOR_SEW32, 1); + if (MODREG) { + ed = (nextop & 7) + (rex.b << 3); + d0 = sse_get_reg_vector(dyn, ninst, x1, ed, 0, VECTOR_SEW32); + VFMV_F_S(d0, d0); + } else { + GETEXSS(d0, 0); + } + if (!BOX64ENV(dynarec_fastround)) FSFLAGSI(0); + u8 = sse_setround(dyn, ninst, x5, x6); + FCVTSxw(gd, d0, RD_DYN); + x87_restoreround(dyn, ninst, u8); + if (!rex.w) ZEROUP(gd); + if (!BOX64ENV(dynarec_fastround)) { + FRFLAGS(x5); + ANDI(x5, x5, (1 << FR_NV) | (1 << FR_OF)); + CBZ_NEXT(x5); + if (rex.w) { + MOV64x(gd, 0x8000000000000000LL); + } else { + MOV32w(gd, 0x80000000); + } + } + break; + case 0x38: + return 0; + case 0x51: + INST_NAME("SQRTSS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW32); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW32); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LWU(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW32); + } + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VFSQRT_V(v0, v1, VECTOR_MASKED); + break; + case 0x52: + INST_NAME("RSQRTSS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW32); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW32); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LWU(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW32); + } + LUI(x4, 0x3f800); + FMVWX(v1, x4); // 1.0f + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VFSQRT_V(v0, v1, VECTOR_MASKED); + VFRDIV_VF(v0, v0, v1, VECTOR_MASKED); + break; + case 0x53: + INST_NAME("RCPSS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW32); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW32); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LWU(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW32); + } + LUI(x4, 0x3f800); + FMVWX(v1, x4); // 1.0f + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VFRDIV_VF(v0, v1, v1, VECTOR_MASKED); + break; + case 0x58: + if (!BOX64ENV(dynarec_fastnan)) return 0; + INST_NAME("ADDSS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW32); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW32); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LWU(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW32); + } + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VFADD_VV(v0, v0, v1, VECTOR_MASKED); + break; + case 0x59: + if (!BOX64ENV(dynarec_fastnan)) return 0; + INST_NAME("MULSS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW32); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW32); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LWU(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW32); + } + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VFMUL_VV(v0, v0, v1, VECTOR_MASKED); + break; + case 0x5A: + INST_NAME("CVTSS2SD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW32); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW32); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LWU(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW32); + } + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VFWCVT_F_F_V(d0, v1, VECTOR_MASKED); + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (cpuext.xtheadvector) { + VMERGE_VVM(v0, v0, d0); // implies VMASK + } else { + VMV_X_S(x4, d0); + VMV_S_X(v0, x4); + } + break; + case 0x5B: + if (!BOX64ENV(dynarec_fastround)) return 0; + INST_NAME("CVTTPS2DQ Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + GETEX_vector(v1, 0, 0, VECTOR_SEW32); + GETGX_empty_vector(v0); + if (cpuext.xtheadvector) { + ADDI(x4, xZR, 1); // RTZ + FSRM(x4, x4); + VFCVT_X_F_V(v0, v1, VECTOR_UNMASKED); + FSRM(xZR, x4); + } else { + VFCVT_RTZ_X_F_V(v0, v1, VECTOR_UNMASKED); + } + break; + case 0x5C: + if (!BOX64ENV(dynarec_fastnan)) return 0; + INST_NAME("SUBSS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW32); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW32); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LWU(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW32); + } + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VFSUB_VV(v0, v0, v1, VECTOR_MASKED); + break; + case 0x5D: + INST_NAME("MINSS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW32); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW32); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LWU(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW32); + } + if (BOX64ENV(dynarec_fastnan)) { + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VFMIN_VV(v0, v0, v1, VECTOR_MASKED); + } else { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFMV_F_S(d0, v0); + VFMV_F_S(d1, v1); + FEQS(x2, d0, d0); + FEQS(x3, d1, d1); + AND(x2, x2, x3); + BEQ_MARK(x2, xZR); + FLES(x2, d1, d0); + BEQ_MARK2(x2, xZR); + MARK; + FMVS(d0, d1); + MARK2; + if (cpuext.xtheadvector) { + VFMV_S_F(d0, d0); + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VMERGE_VVM(v0, v0, d0); // implies VMASK + } else { + VFMV_S_F(v0, d0); + } + } + break; + case 0x5E: + if (!BOX64ENV(dynarec_fastnan)) return 0; + INST_NAME("DIVSS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW32); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW32); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LWU(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW32); + } + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VFDIV_VV(v0, v0, v1, VECTOR_MASKED); + break; + case 0x5F: + INST_NAME("MAXSS Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (MODREG) { + GETGX_vector(v0, 1, VECTOR_SEW32); + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW32); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LWU(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_vector(v0, 1, VECTOR_SEW32); + } + if (BOX64ENV(dynarec_fastnan)) { + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VFMAX_VV(v0, v0, v1, VECTOR_MASKED); + } else { + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + VFMV_F_S(d0, v0); + VFMV_F_S(d1, v1); + FEQS(x2, d0, d0); + FEQS(x3, d1, d1); + AND(x2, x2, x3); + BEQ_MARK(x2, xZR); + FLES(x2, d0, d1); + BEQ_MARK2(x2, xZR); + MARK; + FMVS(d0, d1); + MARK2; + if (cpuext.xtheadvector) { + VFMV_S_F(d0, d0); + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VMERGE_VVM(v0, v0, d0); // implies VMASK + } else { + VFMV_S_F(v0, d0); + } + } + break; + case 0x6F: + INST_NAME("MOVDQU Gx, Ex"); + nextop = F8; + GETG; + if (MODREG) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_vector(dyn, ninst, x1, ed, 0, dyn->vector_eew); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + VMV_V_V(v0, v1); + } else { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); // unaligned! + SMREAD(); + v0 = sse_get_reg_empty_vector(dyn, ninst, x1, gd); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VLE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + } + break; + case 0x70: + INST_NAME("PSHUFHW Gx, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW16, 1); + GETEX_vector(v1, 0, 1, VECTOR_SEW16); + GETGX_vector(v0, 1, VECTOR_SEW16); + u8 = F8; + d0 = fpu_get_scratch(dyn); + d1 = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL1, 1); + tmp64u0 = ((((uint64_t)u8 >> 6) & 3) << 48) | ((((uint64_t)u8 >> 4) & 3) << 32) | (((u8 >> 2) & 3) << 16) | (u8 & 3); + tmp64u0 += 0x0004000400040004ULL; + MOV64x(x5, tmp64u0); + VMV_S_X(d1, x5); + tmp64u0 = 0x0003000200010000ULL; + MOV64x(x5, tmp64u0); + VSLIDE1UP_VX(d0, d1, x5, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW16, VECTOR_LMUL1, 1); + if (v0 == v1) { + v1 = fpu_get_scratch(dyn); + VMV_V_V(v1, v0); + } + VRGATHER_VV(v0, v1, d0, VECTOR_UNMASKED); + break; + case 0x7E: + INST_NAME("MOVQ Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + GETEX_vector(v1, 0, 0, VECTOR_SEW64); + GETGX_empty_vector(v0); + VMV_X_S(x4, v1); + } else { + SMREAD(); + GETGX_empty_vector(v0); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + } + if (!cpuext.xtheadvector) VXOR_VV(v0, v0, v0, VECTOR_UNMASKED); + VMV_S_X(v0, x4); + break; + case 0x7F: + INST_NAME("MOVDQU Ex, Gx"); + nextop = F8; + if (MODREG) { + SET_ELEMENT_WIDTH(x1, VECTOR_SEWANY, 1); + GETGX_vector(v0, 0, dyn->vector_eew); + ed = (nextop & 7) + (rex.b << 3); + v1 = sse_get_reg_empty_vector(dyn, ninst, x1, ed); + VMV_V_V(v1, v0); + } else { + SET_ELEMENT_WIDTH(x1, VECTOR_SEW8, 1); // unaligned! + GETGX_vector(v0, 0, dyn->vector_eew); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x3, &fixedaddress, rex, NULL, 0, 0); + VSE_V(v0, ed, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + SMWRITE2(); + } + break; + case 0xAE: + case 0xB8: + case 0xBC: + case 0xBD: + return 0; + case 0xC2: + INST_NAME("CMPSS Gx, Ex, Ib"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW32, 1); + if (MODREG) { + GETGX_vector(d0, 1, VECTOR_SEW32); + d1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW32); + } else { + SMREAD(); + d1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 1); + LWU(x4, ed, fixedaddress); + VXOR_VV(d1, d1, d1, VECTOR_UNMASKED); + VMV_S_X(d1, x4); + GETGX_vector(d0, 1, VECTOR_SEW32); + } + u8 = F8; + VFMV_F_S(d0, d0); + VFMV_F_S(d1, d1); + if ((u8 & 7) == 0) { // Equal + FEQS(x2, d0, d1); + } else if ((u8 & 7) == 4) { // Not Equal or unordered + FEQS(x2, d0, d1); + XORI(x2, x2, 1); + } else { + // x2 = !(isnan(d0) || isnan(d1)) + FEQS(x3, d0, d0); + FEQS(x2, d1, d1); + AND(x2, x2, x3); + switch (u8 & 7) { + case 1: + BEQ_MARK(x2, xZR); + FLTS(x2, d0, d1); + break; // Less than + case 2: + BEQ_MARK(x2, xZR); + FLES(x2, d0, d1); + break; // Less or equal + case 3: XORI(x2, x2, 1); break; // NaN + case 5: { // Greater or equal or unordered + BEQ_MARK2(x2, xZR); + FLES(x2, d1, d0); + B_MARK_nocond; + break; + } + case 6: { // Greater or unordered, test inverted, N!=V so unordered or less than (inverted) + BEQ_MARK2(x2, xZR); + FLTS(x2, d1, d0); + B_MARK_nocond; + break; + } + case 7: break; // Not NaN + } + + MARK2; + if ((u8 & 7) == 5 || (u8 & 7) == 6) { + MOV32w(x2, 1); + } + MARK; + } + NEG(x2, x2); + if (cpuext.xtheadvector) { + v0 = fpu_get_scratch(dyn); + VMV_S_X(v0, x2); + VECTOR_LOAD_VMASK(0b0001, x4, 1); + VMERGE_VVM(d0, d0, v0); // implies VMASK + } else { + VMV_S_X(d0, x2); + } + break; + case 0xE6: + INST_NAME("CVTDQ2PD Gx, Ex"); + nextop = F8; + SET_ELEMENT_WIDTH(x1, VECTOR_SEW64, 1); + if (MODREG) { + v1 = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), 0, VECTOR_SEW64); + GETGX_empty_vector(v0); + } else { + SMREAD(); + v1 = fpu_get_scratch(dyn); + addr = geted(dyn, addr, ninst, nextop, &ed, x1, x2, &fixedaddress, rex, NULL, 1, 0); + LD(x4, ed, fixedaddress); + VMV_S_X(v1, x4); + GETGX_empty_vector(v0); + } + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW32, VECTOR_LMUL1, 0.5); + d0 = fpu_get_scratch_lmul(dyn, VECTOR_LMUL2); + VFWCVT_F_X_V(d0, v1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, x1, VECTOR_SEW64, VECTOR_LMUL1, 1); + VMV_V_V(v0, d0); + break; + default: + DEFAULT_VECTOR; + } + return addr; +} diff --git a/src/dynarec/rv64/dynarec_rv64_functions.c b/src/dynarec/rv64/dynarec_rv64_functions.c index 6ce97b8..a2d95e2 100644 --- a/src/dynarec/rv64/dynarec_rv64_functions.c +++ b/src/dynarec/rv64/dynarec_rv64_functions.c @@ -10,14 +10,14 @@ #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" #include "emu/x64run_private.h" #include "emu/x87emu_private.h" +#include "rv64_emitter.h" #include "x64trace.h" #include "signals.h" #include "dynarec_native.h" @@ -26,16 +26,28 @@ #include "custommem.h" #include "bridge.h" #include "rv64_lock.h" +#include "gdbjit.h" +#include "perfmap.h" -#define XMM0 0 -#define X870 XMM0+16 -#define EMM0 XMM0+16 +#define XMM0 0 +#define X870 XMM0 + 16 +#define EMM0 XMM0 + 16 // Get a FPU scratch reg int fpu_get_scratch(dynarec_rv64_t* dyn) { - return SCRATCH0 + dyn->e.fpu_scratch++; // return an Sx + return SCRATCH0 + dyn->e.fpu_scratch++; // return an Sx } + +// Get a FPU scratch reg aligned to LMUL +int fpu_get_scratch_lmul(dynarec_rv64_t* dyn, int lmul) +{ + int reg = SCRATCH0 + dyn->e.fpu_scratch; + int skip = (reg % (1 << lmul)) ? (1 << lmul) - (reg % (1 << lmul)) : 0; + dyn->e.fpu_scratch += skip + 1; + return reg + skip; +} + // Reset scratch regs counter void fpu_reset_scratch(dynarec_rv64_t* dyn) { @@ -44,12 +56,13 @@ void fpu_reset_scratch(dynarec_rv64_t* dyn) // Get a x87 double reg int fpu_get_reg_x87(dynarec_rv64_t* dyn, int t, int n) { - int i=X870; - while (dyn->e.fpuused[i]) ++i; + int i = X870; + while (dyn->e.fpuused[i]) + ++i; dyn->e.fpuused[i] = 1; dyn->e.extcache[i].n = n; dyn->e.extcache[i].t = t; - dyn->e.news |= (1<e.news |= (1 << i); return EXTREG(i); // return a Dx } // Free a FPU reg @@ -61,37 +74,40 @@ void fpu_free_reg(dynarec_rv64_t* dyn, int reg) if (dyn->e.extcache[idx].t != EXT_CACHE_ST_F && dyn->e.extcache[idx].t != EXT_CACHE_ST_D && dyn->e.extcache[idx].t != EXT_CACHE_ST_I64) dyn->e.extcache[idx].v = 0; } -// Get an MMX double reg -int fpu_get_reg_emm(dynarec_rv64_t* dyn, int emm) + +// Get an MMX reg +int fpu_get_reg_emm(dynarec_rv64_t* dyn, int t, int emm) { - dyn->e.fpuused[EMM0 + emm] = 1; - dyn->e.extcache[EMM0 + emm].t = EXT_CACHE_MM; - dyn->e.extcache[EMM0 + emm].n = emm; - dyn->e.news |= (1<<(EMM0 + emm)); - return EXTREG(EMM0 + emm); + int i = EMM0 + emm; + dyn->e.fpuused[i] = 1; + dyn->e.extcache[i].t = t; + dyn->e.extcache[i].n = emm; + dyn->e.news |= (1 << (i)); + return EXTREG(i); } + // Get an XMM reg int fpu_get_reg_xmm(dynarec_rv64_t* dyn, int t, int xmm) { - int i = XMM0+xmm; + int i = XMM0 + xmm; dyn->e.fpuused[i] = 1; dyn->e.extcache[i].t = t; dyn->e.extcache[i].n = xmm; - dyn->e.news |= (1<e.news |= (1 << i); return EXTREG(i); } // Reset fpu regs counter -void fpu_reset_reg_extcache(extcache_t* e) +static void fpu_reset_reg_extcache(dynarec_rv64_t* dyn, extcache_t* e) { - e->fpu_reg = 0; - for (int i=0; i<24; ++i) { - e->fpuused[i]=0; + for (int i = 0; i < 32; ++i) { + e->fpuused[i] = 0; e->extcache[i].v = 0; } + dyn->vector_sew = VECTOR_SEWNA; } void fpu_reset_reg(dynarec_rv64_t* dyn) { - fpu_reset_reg_extcache(&dyn->e); + fpu_reset_reg_extcache(dyn, &dyn->e); } int extcache_no_i64(dynarec_rv64_t* dyn, int ninst, int st, int a) @@ -138,9 +154,9 @@ int extcache_get_current_st(dynarec_rv64_t* dyn, int ninst, int a) int extcache_get_st_f(dynarec_rv64_t* dyn, int ninst, int a) { - for(int i=0; i<24; ++i) - if(dyn->insts[ninst].e.extcache[i].t==EXT_CACHE_ST_F - && dyn->insts[ninst].e.extcache[i].n==a) + for (int i = 0; i < 24; ++i) + if (dyn->insts[ninst].e.extcache[i].t == EXT_CACHE_ST_F + && dyn->insts[ninst].e.extcache[i].n == a) return i; return -1; } @@ -156,9 +172,9 @@ int extcache_get_st_f_i64(dynarec_rv64_t* dyn, int ninst, int a) int extcache_get_st_f_noback(dynarec_rv64_t* dyn, int ninst, int a) { - for(int i=0; i<24; ++i) - if(dyn->insts[ninst].e.extcache[i].t==EXT_CACHE_ST_F - && dyn->insts[ninst].e.extcache[i].n==a) + for (int i = 0; i < 24; ++i) + if (dyn->insts[ninst].e.extcache[i].t == EXT_CACHE_ST_F + && dyn->insts[ninst].e.extcache[i].n == a) return i; return -1; } @@ -174,9 +190,9 @@ int extcache_get_st_f_i64_noback(dynarec_rv64_t* dyn, int ninst, int a) int extcache_get_current_st_f(dynarec_rv64_t* dyn, int a) { - for(int i=0; i<24; ++i) - if(dyn->e.extcache[i].t==EXT_CACHE_ST_F - && dyn->e.extcache[i].n==a) + for (int i = 0; i < 24; ++i) + if (dyn->e.extcache[i].t == EXT_CACHE_ST_F + && dyn->e.extcache[i].n == a) return i; return -1; } @@ -194,118 +210,122 @@ static void extcache_promote_double_forward(dynarec_rv64_t* dyn, int ninst, int static void extcache_promote_double_internal(dynarec_rv64_t* dyn, int ninst, int maxinst, int a); static void extcache_promote_double_combined(dynarec_rv64_t* dyn, int ninst, int maxinst, int a) { - if(a == dyn->insts[ninst].e.combined1 || a == dyn->insts[ninst].e.combined2) { - if(a == dyn->insts[ninst].e.combined1) { + if (a == dyn->insts[ninst].e.combined1 || a == dyn->insts[ninst].e.combined2) { + if (a == dyn->insts[ninst].e.combined1) { a = dyn->insts[ninst].e.combined2; } else a = dyn->insts[ninst].e.combined1; int i = extcache_get_st_f_i64_noback(dyn, ninst, a); - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_combined, ninst=%d combined%c %d i=%d (stack:%d/%d)\n", ninst, (a == dyn->insts[ninst].e.combined2)?'2':'1', a ,i, dyn->insts[ninst].e.stack_push, -dyn->insts[ninst].e.stack_pop); - if(i>=0) { + // if(dyn->need_dump) dynarec_log(LOG_NONE, "extcache_promote_double_combined, ninst=%d combined%c %d i=%d (stack:%d/%d)\n", ninst, (a == dyn->insts[ninst].e.combined2)?'2':'1', a ,i, dyn->insts[ninst].e.stack_push, -dyn->insts[ninst].e.stack_pop); + if (i >= 0) { dyn->insts[ninst].e.extcache[i].t = EXT_CACHE_ST_D; - if(!dyn->insts[ninst].e.barrier) - extcache_promote_double_internal(dyn, ninst-1, maxinst, a-dyn->insts[ninst].e.stack_push); + if (dyn->insts[ninst].x87precision) dyn->need_x87check = 2; + if (!dyn->insts[ninst].e.barrier) + extcache_promote_double_internal(dyn, ninst - 1, maxinst, a - dyn->insts[ninst].e.stack_push); // go forward is combined is not pop'd - if(a-dyn->insts[ninst].e.stack_pop>=0) - if(!dyn->insts[ninst+1].e.barrier) - extcache_promote_double_forward(dyn, ninst+1, maxinst, a-dyn->insts[ninst].e.stack_pop); + if (a - dyn->insts[ninst].e.stack_pop >= 0) + if (!dyn->insts[ninst + 1].e.barrier) + extcache_promote_double_forward(dyn, ninst + 1, maxinst, a - dyn->insts[ninst].e.stack_pop); } } } static void extcache_promote_double_internal(dynarec_rv64_t* dyn, int ninst, int maxinst, int a) { - if(dyn->insts[ninst+1].e.barrier) + if (dyn->insts[ninst + 1].e.barrier) return; - while(ninst>=0) { - a+=dyn->insts[ninst].e.stack_pop; // adjust Stack depth: add pop'd ST (going backward) + while (ninst >= 0) { + a += dyn->insts[ninst].e.stack_pop; // adjust Stack depth: add pop'd ST (going backward) int i = extcache_get_st_f_i64(dyn, ninst, a); - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_internal, ninst=%d, a=%d st=%d:%d, i=%d\n", ninst, a, dyn->insts[ninst].e.stack, dyn->insts[ninst].e.stack_next, i); - if(i<0) return; + // if(dyn->need_dump) dynarec_log(LOG_NONE, "extcache_promote_double_internal, ninst=%d, a=%d st=%d:%d, i=%d\n", ninst, a, dyn->insts[ninst].e.stack, dyn->insts[ninst].e.stack_next, i); + if (i < 0) return; dyn->insts[ninst].e.extcache[i].t = EXT_CACHE_ST_D; + if (dyn->insts[ninst].x87precision) dyn->need_x87check = 2; // check combined propagation too - if(dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) { - if(dyn->insts[ninst].e.swapped) { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_internal, ninst=%d swapped %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack); - if (a==dyn->insts[ninst].e.combined1) + if (dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) { + if (dyn->insts[ninst].e.swapped) { + // if(dyn->need_dump) dynarec_log(LOG_NONE, "extcache_promote_double_internal, ninst=%d swapped %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack); + if (a == dyn->insts[ninst].e.combined1) a = dyn->insts[ninst].e.combined2; - else if (a==dyn->insts[ninst].e.combined2) + else if (a == dyn->insts[ninst].e.combined2) a = dyn->insts[ninst].e.combined1; } else { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_internal, ninst=%d combined %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack); + // if(dyn->need_dump) dynarec_log(LOG_NONE, "extcache_promote_double_internal, ninst=%d combined %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack); extcache_promote_double_combined(dyn, ninst, maxinst, a); } } - a-=dyn->insts[ninst].e.stack_push; // // adjust Stack depth: remove push'd ST (going backward) + a -= dyn->insts[ninst].e.stack_push; // // adjust Stack depth: remove push'd ST (going backward) --ninst; - if(ninst<0 || a<0 || dyn->insts[ninst].e.barrier) + if (ninst < 0 || a < 0 || dyn->insts[ninst].e.barrier) return; } } static void extcache_promote_double_forward(dynarec_rv64_t* dyn, int ninst, int maxinst, int a) { - while((ninst!=-1) && (ninst=0)) { - a+=dyn->insts[ninst].e.stack_push; // // adjust Stack depth: add push'd ST (going forward) - if((dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) && dyn->insts[ninst].e.swapped) { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_forward, ninst=%d swapped %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack); - if (a==dyn->insts[ninst].e.combined1) + while ((ninst != -1) && (ninst < maxinst) && (a >= 0)) { + a += dyn->insts[ninst].e.stack_push; // // adjust Stack depth: add push'd ST (going forward) + if ((dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) && dyn->insts[ninst].e.swapped) { + // if(dyn->need_dump) dynarec_log(LOG_NONE, "extcache_promote_double_forward, ninst=%d swapped %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack); + if (a == dyn->insts[ninst].e.combined1) a = dyn->insts[ninst].e.combined2; - else if (a==dyn->insts[ninst].e.combined2) + else if (a == dyn->insts[ninst].e.combined2) a = dyn->insts[ninst].e.combined1; } int i = extcache_get_st_f_i64_noback(dyn, ninst, a); - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_forward, ninst=%d, a=%d st=%d:%d(%d/%d), i=%d\n", ninst, a, dyn->insts[ninst].e.stack, dyn->insts[ninst].e.stack_next, dyn->insts[ninst].e.stack_push, -dyn->insts[ninst].e.stack_pop, i); - if(i<0) return; + // if(dyn->need_dump) dynarec_log(LOG_NONE, "extcache_promote_double_forward, ninst=%d, a=%d st=%d:%d(%d/%d), i=%d\n", ninst, a, dyn->insts[ninst].e.stack, dyn->insts[ninst].e.stack_next, dyn->insts[ninst].e.stack_push, -dyn->insts[ninst].e.stack_pop, i); + if (i < 0) return; dyn->insts[ninst].e.extcache[i].t = EXT_CACHE_ST_D; + if (dyn->insts[ninst].x87precision) dyn->need_x87check = 2; // check combined propagation too - if((dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) && !dyn->insts[ninst].e.swapped) { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double_forward, ninst=%d combined %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack); + if ((dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) && !dyn->insts[ninst].e.swapped) { + // if(dyn->need_dump) dynarec_log(LOG_NONE, "extcache_promote_double_forward, ninst=%d combined %d/%d vs %d with st %d\n", ninst, dyn->insts[ninst].e.combined1 ,dyn->insts[ninst].e.combined2, a, dyn->insts[ninst].e.stack); extcache_promote_double_combined(dyn, ninst, maxinst, a); } - a-=dyn->insts[ninst].e.stack_pop; // adjust Stack depth: remove pop'd ST (going forward) - if(dyn->insts[ninst].x64.has_next && !dyn->insts[ninst].e.barrier) + a -= dyn->insts[ninst].e.stack_pop; // adjust Stack depth: remove pop'd ST (going forward) + if (dyn->insts[ninst].x64.has_next && !dyn->insts[ninst].e.barrier) ++ninst; else - ninst=-1; + ninst = -1; } - if(ninst==maxinst) + if (ninst == maxinst) extcache_promote_double(dyn, ninst, a); } void extcache_promote_double(dynarec_rv64_t* dyn, int ninst, int a) { int i = extcache_get_current_st_f_i64(dyn, a); - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double, ninst=%d a=%d st=%d i=%d\n", ninst, a, dyn->e.stack, i); - if(i<0) return; + // if(dyn->need_dump) dynarec_log(LOG_NONE, "extcache_promote_double, ninst=%d a=%d st=%d i=%d\n", ninst, a, dyn->e.stack, i); + if (i < 0) return; dyn->e.extcache[i].t = EXT_CACHE_ST_D; dyn->insts[ninst].e.extcache[i].t = EXT_CACHE_ST_D; + if (dyn->insts[ninst].x87precision) dyn->need_x87check = 2; // check combined propagation too - if(dyn->e.combined1 || dyn->e.combined2) { - if(dyn->e.swapped) { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double, ninst=%d swapped! %d/%d vs %d\n", ninst, dyn->e.combined1 ,dyn->e.combined2, a); - if(dyn->e.combined1 == a) + if (dyn->e.combined1 || dyn->e.combined2) { + if (dyn->e.swapped) { + // if(dyn->need_dump) dynarec_log(LOG_NONE, "extcache_promote_double, ninst=%d swapped! %d/%d vs %d\n", ninst, dyn->e.combined1 ,dyn->e.combined2, a); + if (dyn->e.combined1 == a) a = dyn->e.combined2; - else if(dyn->e.combined2 == a) + else if (dyn->e.combined2 == a) a = dyn->e.combined1; } else { - //if(box64_dynarec_dump) dynarec_log(LOG_NONE, "extcache_promote_double, ninst=%d combined! %d/%d vs %d\n", ninst, dyn->e.combined1 ,dyn->e.combined2, a); - if(dyn->e.combined1 == a) + // if(dyn->need_dump) dynarec_log(LOG_NONE, "extcache_promote_double, ninst=%d combined! %d/%d vs %d\n", ninst, dyn->e.combined1 ,dyn->e.combined2, a); + if (dyn->e.combined1 == a) extcache_promote_double(dyn, ninst, dyn->e.combined2); - else if(dyn->e.combined2 == a) + else if (dyn->e.combined2 == a) extcache_promote_double(dyn, ninst, dyn->e.combined1); } } - a-=dyn->insts[ninst].e.stack_push; // // adjust Stack depth: remove push'd ST (going backward) - if(!ninst || a<0) return; - extcache_promote_double_internal(dyn, ninst-1, ninst, a); + a -= dyn->insts[ninst].e.stack_push; // // adjust Stack depth: remove push'd ST (going backward) + if (!ninst || a < 0) return; + extcache_promote_double_internal(dyn, ninst - 1, ninst, a); } int extcache_combine_st(dynarec_rv64_t* dyn, int ninst, int a, int b) { - dyn->e.combined1=a; - dyn->e.combined2=b; - if( extcache_get_current_st(dyn, ninst, a)==EXT_CACHE_ST_F - && extcache_get_current_st(dyn, ninst, b)==EXT_CACHE_ST_F ) + dyn->e.combined1 = a; + dyn->e.combined2 = b; + if (extcache_get_current_st(dyn, ninst, a) == EXT_CACHE_ST_F + && extcache_get_current_st(dyn, ninst, b) == EXT_CACHE_ST_F) return EXT_CACHE_ST_F; return EXT_CACHE_ST_D; } @@ -327,20 +347,21 @@ static int isCacheEmpty(dynarec_native_t* dyn, int ninst) return 1; } -int fpuCacheNeedsTransform(dynarec_rv64_t* dyn, int ninst) { +int fpuCacheNeedsTransform(dynarec_rv64_t* dyn, int ninst) +{ int i2 = dyn->insts[ninst].x64.jmp_insts; - if(i2<0) + if (i2 < 0) return 1; - if((dyn->insts[i2].x64.barrier&BARRIER_FLOAT)) + if ((dyn->insts[i2].x64.barrier & BARRIER_FLOAT)) // if the barrier as already been apply, no transform needed - return ((dyn->insts[ninst].x64.barrier&BARRIER_FLOAT))?0:(isCacheEmpty(dyn, ninst)?0:1); + return ((dyn->insts[ninst].x64.barrier & BARRIER_FLOAT)) ? 0 : (isCacheEmpty(dyn, ninst) ? 0 : 1); int ret = 0; - if(!i2) { // just purge - if(dyn->insts[ninst].e.stack_next) { + if (!i2) { // just purge + if (dyn->insts[ninst].e.stack_next) { return 1; } - for(int i=0; i<24 && !ret; ++i) - if(dyn->insts[ninst].e.extcache[i].v) { // there is something at ninst for i + for (int i = 0; i < 24 && !ret; ++i) + if (dyn->insts[ninst].e.extcache[i].v) { // there is something at ninst for i if (!( (dyn->insts[ninst].e.extcache[i].t == EXT_CACHE_ST_F || dyn->insts[ninst].e.extcache[i].t == EXT_CACHE_ST_D @@ -351,41 +372,59 @@ int fpuCacheNeedsTransform(dynarec_rv64_t* dyn, int ninst) { return ret; } // Check if ninst can be compatible to i2 - if(dyn->insts[ninst].e.stack_next != dyn->insts[i2].e.stack-dyn->insts[i2].e.stack_push) { + if (dyn->insts[ninst].e.stack_next != dyn->insts[i2].e.stack - dyn->insts[i2].e.stack_push) { return 1; } extcache_t cache_i2 = dyn->insts[i2].e; extcacheUnwind(&cache_i2); - for(int i=0; i<24; ++i) { - if(dyn->insts[ninst].e.extcache[i].v) { // there is something at ninst for i - if(!cache_i2.extcache[i].v) { // but there is nothing at i2 for i - ret = 1; - } else if(dyn->insts[ninst].e.extcache[i].v!=cache_i2.extcache[i].v) { // there is something different + for (int i = 0; i < 24; ++i) { + if (dyn->insts[ninst].e.extcache[i].v) { // there is something at ninst for i + if (!cache_i2.extcache[i].v) { // but there is nothing at i2 for i ret = 1; + } else if (dyn->insts[ninst].e.extcache[i].v != cache_i2.extcache[i].v) { // there is something different + if (dyn->insts[ninst].e.extcache[i].n != cache_i2.extcache[i].n) { // not the same x64 reg + ret = 1; + } else if (dyn->insts[ninst].e.extcache[i].t == EXT_CACHE_XMMR && cache_i2.extcache[i].t == EXT_CACHE_XMMW) { /* nothing */ + } else + ret = 1; } - } else if(cache_i2.extcache[i].v) + } else if (cache_i2.extcache[i].v) ret = 1; } return ret; } +int sewNeedsTransform(dynarec_rv64_t* dyn, int ninst) +{ + int i2 = dyn->insts[ninst].x64.jmp_insts; + + if (dyn->insts[i2].vector_sew_entry == VECTOR_SEWNA) + return 0; + else if (dyn->insts[i2].vector_sew_entry == VECTOR_SEWANY && dyn->insts[ninst].vector_sew_exit != VECTOR_SEWNA) + return 0; + else if (dyn->insts[i2].vector_sew_entry == dyn->insts[ninst].vector_sew_exit) + return 0; + + return 1; +} + void extcacheUnwind(extcache_t* cache) { - if(cache->swapped) { + if (cache->swapped) { // unswap int a = -1; int b = -1; - for(int j=0; j<24 && ((a==-1) || (b==-1)); ++j) + for (int j = 0; j < 24 && ((a == -1) || (b == -1)); ++j) if ((cache->extcache[j].t == EXT_CACHE_ST_D || cache->extcache[j].t == EXT_CACHE_ST_F || cache->extcache[j].t == EXT_CACHE_ST_I64)) { - if(cache->extcache[j].n == cache->combined1) + if (cache->extcache[j].n == cache->combined1) a = j; - else if(cache->extcache[j].n == cache->combined2) + else if (cache->extcache[j].n == cache->combined2) b = j; } - if(a!=-1 && b!=-1) { + if (a != -1 && b != -1) { int tmp = cache->extcache[a].n; cache->extcache[a].n = cache->extcache[b].n; cache->extcache[b].n = tmp; @@ -393,97 +432,98 @@ void extcacheUnwind(extcache_t* cache) cache->swapped = 0; cache->combined1 = cache->combined2 = 0; } - if(cache->news) { + if (cache->news) { // remove the newly created extcache - for(int i=0; i<24; ++i) - if(cache->news&(1<news & (1 << i)) && !cache->olds[i].changed) cache->extcache[i].v = 0; cache->news = 0; } // add/change bad regs - for(int i=0; i<16; ++i) { - if (cache->extcache[i].t == EXT_CACHE_SS || cache->extcache[i].t == EXT_CACHE_SD) { - if (cache->olds[i].changed) { - cache->extcache[i].t = cache->olds[i].single ? EXT_CACHE_SS : EXT_CACHE_SD; - } else if (cache->olds[i].purged) { + for (int i = 0; i < 16; ++i) { + if (cache->olds[i].changed || cache->olds[i].purged) { + if (cache->olds[i].type == EXT_CACHE_OLD_XMMR) + cache->extcache[i].t = EXT_CACHE_XMMR; + else if (cache->olds[i].type == EXT_CACHE_OLD_XMMW) + cache->extcache[i].t = EXT_CACHE_XMMW; + else if (cache->olds[i].type == EXT_CACHE_OLD_SS) + cache->extcache[i].t = EXT_CACHE_SS; + else if (cache->olds[i].type == EXT_CACHE_OLD_SD) + cache->extcache[i].t = EXT_CACHE_SD; + + if (cache->olds[i].purged) cache->extcache[i].n = i; - cache->extcache[i].t = cache->olds[i].single ? EXT_CACHE_SS : EXT_CACHE_SD; - } } } - if(cache->stack_push) { + if (cache->stack_push) { // unpush - for(int j=0; j<24; ++j) { + for (int j = 0; j < 24; ++j) { if ((cache->extcache[j].t == EXT_CACHE_ST_D || cache->extcache[j].t == EXT_CACHE_ST_F || cache->extcache[j].t == EXT_CACHE_ST_I64)) { - if(cache->extcache[j].nstack_push) + if (cache->extcache[j].n < cache->stack_push) cache->extcache[j].v = 0; else - cache->extcache[j].n-=cache->stack_push; + cache->extcache[j].n -= cache->stack_push; } } - cache->x87stack-=cache->stack_push; - cache->tags>>=(cache->stack_push*2); - cache->stack-=cache->stack_push; - if(cache->pushed>=cache->stack_push) - cache->pushed-=cache->stack_push; + cache->x87stack -= cache->stack_push; + cache->tags >>= (cache->stack_push * 2); + cache->stack -= cache->stack_push; + if (cache->pushed >= cache->stack_push) + cache->pushed -= cache->stack_push; else cache->pushed = 0; cache->stack_push = 0; } - cache->x87stack+=cache->stack_pop; + cache->x87stack += cache->stack_pop; cache->stack_next = cache->stack; - if(cache->stack_pop) { - if(cache->poped>=cache->stack_pop) - cache->poped-=cache->stack_pop; + if (cache->stack_pop) { + if (cache->poped >= cache->stack_pop) + cache->poped -= cache->stack_pop; else cache->poped = 0; - cache->tags<<=(cache->stack_pop*2); + cache->tags <<= (cache->stack_pop * 2); } cache->stack_pop = 0; cache->barrier = 0; // And now, rebuild the x87cache info with extcache cache->mmxcount = 0; cache->fpu_scratch = 0; - cache->fpu_extra_qscratch = 0; - cache->fpu_reg = 0; - for(int i=0; i<8; ++i) { + for (int i = 0; i < 8; ++i) { cache->x87cache[i] = -1; - cache->mmxcache[i] = -1; + cache->mmxcache[i].v = -1; cache->x87reg[i] = 0; - cache->ssecache[i*2].v = -1; - cache->ssecache[i*2+1].v = -1; + cache->ssecache[i * 2].v = -1; + cache->ssecache[i * 2 + 1].v = -1; } int x87reg = 0; - for(int i=0; i<24; ++i) { - if(cache->extcache[i].v) { + for (int i = 0; i < 32; ++i) { + if (cache->extcache[i].v) { cache->fpuused[i] = 1; switch (cache->extcache[i].t) { case EXT_CACHE_MM: - cache->mmxcache[cache->extcache[i].n] = EXTREG(i); + case EXT_CACHE_MMV: + cache->mmxcache[cache->extcache[i].n].reg = EXTREG(i); + cache->mmxcache[cache->extcache[i].n].vector = cache->extcache[i].t == EXT_CACHE_MMV; ++cache->mmxcount; - ++cache->fpu_reg; break; case EXT_CACHE_SS: cache->ssecache[cache->extcache[i].n].reg = EXTREG(i); cache->ssecache[cache->extcache[i].n].vector = 0; cache->ssecache[cache->extcache[i].n].single = 1; - ++cache->fpu_reg; break; case EXT_CACHE_SD: cache->ssecache[cache->extcache[i].n].reg = EXTREG(i); cache->ssecache[cache->extcache[i].n].vector = 0; cache->ssecache[cache->extcache[i].n].single = 0; - ++cache->fpu_reg; break; case EXT_CACHE_XMMR: case EXT_CACHE_XMMW: - cache->ssecache[cache->extcache[i].n].reg = i; + cache->ssecache[cache->extcache[i].n].reg = EXTREG(i); cache->ssecache[cache->extcache[i].n].vector = 1; cache->ssecache[cache->extcache[i].n].write = (cache->extcache[i].t == EXT_CACHE_XMMW) ? 1 : 0; - ++cache->fpu_reg; break; case EXT_CACHE_ST_F: case EXT_CACHE_ST_D: @@ -491,7 +531,6 @@ void extcacheUnwind(extcache_t* cache) cache->x87cache[x87reg] = cache->extcache[i].n; cache->x87reg[x87reg] = EXTREG(i); ++x87reg; - ++cache->fpu_reg; break; case EXT_CACHE_SCR: cache->fpuused[i] = 0; @@ -507,159 +546,238 @@ void extcacheUnwind(extcache_t* cache) // will go badly if address is unaligned static uint8_t extract_byte(uint32_t val, void* address) { - int idx = (((uintptr_t)address)&3)*8; - return (val>>idx)&0xff; + int idx = (((uintptr_t)address) & 3) * 8; + return (val >> idx) & 0xff; } static uint32_t insert_byte(uint32_t val, uint8_t b, void* address) { - int idx = (((uintptr_t)address)&3)*8; - val&=~(0xff<>idx)&0xffff; + int idx = (((uintptr_t)address) & 3) * 8; + return (val >> idx) & 0xffff; } static uint32_t insert_half(uint32_t val, uint16_t h, void* address) { - int idx = (((uintptr_t)address)&3)*8; - val&=~(0xffff<dec32:my_context->dec, &dyn->insts[ninst].x64, name); - dynarec_log(LOG_NONE, "%s%p: %d emitted opcodes, inst=%d, barrier=%d state=%d/%d(%d), %s=%X/%X, use=%X, need=%X/%X, sm=%d/%d", - (box64_dynarec_dump>1)?"\e[32m":"", - (void*)(dyn->native_start+dyn->insts[ninst].address), - dyn->insts[ninst].size/4, - ninst, - dyn->insts[ninst].x64.barrier, - dyn->insts[ninst].x64.state_flags, - dyn->f.pending, - dyn->f.dfnone, - dyn->insts[ninst].x64.may_set?"may":"set", - dyn->insts[ninst].x64.set_flags, - dyn->insts[ninst].x64.gen_flags, - dyn->insts[ninst].x64.use_flags, - dyn->insts[ninst].x64.need_before, - dyn->insts[ninst].x64.need_after, - dyn->smread, dyn->smwrite); - if(dyn->insts[ninst].pred_sz) { - dynarec_log(LOG_NONE, ", pred="); - for(int ii=0; iiinsts[ninst].pred_sz; ++ii) - dynarec_log(LOG_NONE, "%s%d", ii?"/":"", dyn->insts[ninst].pred[ii]); + if (!dyn->need_dump && !BOX64ENV(dynarec_gdbjit) && !BOX64ENV(dynarec_perf_map)) return; + + static char buf[4096]; + int length = sprintf(buf, "barrier=%d state=%d/%d(%d), %s=%X/%X, use=%X, need=%X/%X, fuse=%d/%d, sm=%d(%d/%d), sew@entry=%d, sew@exit=%d", + dyn->insts[ninst].x64.barrier, + dyn->insts[ninst].x64.state_flags, + dyn->f.pending, + dyn->f.dfnone, + dyn->insts[ninst].x64.may_set ? "may" : "set", + dyn->insts[ninst].x64.set_flags, + dyn->insts[ninst].x64.gen_flags, + dyn->insts[ninst].x64.use_flags, + dyn->insts[ninst].x64.need_before, + dyn->insts[ninst].x64.need_after, + dyn->insts[ninst].nat_flags_fusion, + dyn->insts[ninst].no_scratch_usage, + dyn->smwrite, dyn->insts[ninst].will_write, dyn->insts[ninst].last_write, + dyn->insts[ninst].vector_sew_entry, dyn->insts[ninst].vector_sew_exit); + if (dyn->insts[ninst].pred_sz) { + length += sprintf(buf + length, ", pred="); + for (int ii = 0; ii < dyn->insts[ninst].pred_sz; ++ii) + length += sprintf(buf + length, "%s%d", ii ? "/" : "", dyn->insts[ninst].pred[ii]); + } + if (dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts >= 0) + length += sprintf(buf + length, ", jmp=%d", dyn->insts[ninst].x64.jmp_insts); + if (dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts == -1) + length += sprintf(buf + length, ", jmp=out"); + if (dyn->last_ip) + length += sprintf(buf + length, ", last_ip=%p", (void*)dyn->last_ip); + for (int ii = 0; ii < 32; ++ii) { + switch (dyn->insts[ninst].e.extcache[ii].t) { + case EXT_CACHE_ST_D: length += sprintf(buf + length, " f%d:%s", EXTREG(ii), getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; + case EXT_CACHE_ST_F: length += sprintf(buf + length, " f%d:%s", EXTREG(ii), getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; + case EXT_CACHE_ST_I64: length += sprintf(buf + length, " f%d:%s", EXTREG(ii), getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; + case EXT_CACHE_MM: length += sprintf(buf + length, " f%d:%s", EXTREG(ii), getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; + case EXT_CACHE_MMV: length += sprintf(buf + length, " v%d:%s", EXTREG(ii), getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; + case EXT_CACHE_SS: length += sprintf(buf + length, " f%d:%s", EXTREG(ii), getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; + case EXT_CACHE_SD: length += sprintf(buf + length, " f%d:%s", EXTREG(ii), getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; + case EXT_CACHE_XMMR: length += sprintf(buf + length, " v%d:%s", EXTREG(ii), getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; + case EXT_CACHE_XMMW: length += sprintf(buf + length, " v%d:%s", EXTREG(ii), getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; + case EXT_CACHE_SCR: length += sprintf(buf + length, " f%d:%s", EXTREG(ii), getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; + case EXT_CACHE_NONE: + default: break; } - if(dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts>=0) - dynarec_log(LOG_NONE, ", jmp=%d", dyn->insts[ninst].x64.jmp_insts); - if(dyn->insts[ninst].x64.jmp && dyn->insts[ninst].x64.jmp_insts==-1) - dynarec_log(LOG_NONE, ", jmp=out"); - if(dyn->last_ip) - dynarec_log(LOG_NONE, ", last_ip=%p", (void*)dyn->last_ip); - for(int ii=0; ii<24; ++ii) { - switch(dyn->insts[ninst].e.extcache[ii].t) { - case EXT_CACHE_ST_D: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; - case EXT_CACHE_ST_F: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; - case EXT_CACHE_ST_I64: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; - case EXT_CACHE_MM: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; - case EXT_CACHE_SS: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; - case EXT_CACHE_SD: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; - case EXT_CACHE_XMMR: dynarec_log(LOG_NONE, " %s:%s", vnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; - case EXT_CACHE_XMMW: dynarec_log(LOG_NONE, " %s:%s", vnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; - case EXT_CACHE_SCR: dynarec_log(LOG_NONE, " %s:%s", fnames[EXTREG(ii)], getCacheName(dyn->insts[ninst].e.extcache[ii].t, dyn->insts[ninst].e.extcache[ii].n)); break; - case EXT_CACHE_NONE: - default: break; - } + } + if (dyn->ymm_zero) + length += sprintf(buf + length, " ymm0_mask = %04x", dyn->ymm_zero); + if (dyn->e.stack || dyn->insts[ninst].e.stack_next || dyn->insts[ninst].e.x87stack) + length += sprintf(buf + length, " X87:%d/%d(+%d/-%d)%d", dyn->e.stack, dyn->insts[ninst].e.stack_next, dyn->insts[ninst].e.stack_push, dyn->insts[ninst].e.stack_pop, dyn->insts[ninst].e.x87stack); + if (dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) + length += sprintf(buf + length, " %s:%d/%d", dyn->insts[ninst].e.swapped ? "SWP" : "CMB", dyn->insts[ninst].e.combined1, dyn->insts[ninst].e.combined2); + + if (dyn->need_dump) { + printf_x64_instruction(dyn, rex.is32bits ? my_context->dec32 : my_context->dec, &dyn->insts[ninst].x64, name); + dynarec_log(LOG_NONE, "%s%p: %d emitted opcodes, inst=%d, %s%s\n", + (dyn->need_dump > 1) ? "\e[32m" : "", + (void*)(dyn->native_start + dyn->insts[ninst].address), dyn->insts[ninst].size / 4, ninst, buf, (dyn->need_dump > 1) ? "\e[m" : ""); + } + if (BOX64ENV(dynarec_gdbjit)) { + static char buf2[512]; + if (BOX64ENV(dynarec_gdbjit) > 1) { + sprintf(buf2, "; %d: %d opcodes, %s", ninst, dyn->insts[ninst].size / 4, buf); + dyn->gdbjit_block = GdbJITBlockAddLine(dyn->gdbjit_block, (dyn->native_start + dyn->insts[ninst].address), buf2); + } + zydis_dec_t* dec = rex.is32bits ? my_context->dec32 : my_context->dec; + const char* inst_name = name; + if (dec) { + inst_name = DecodeX64Trace(dec, dyn->insts[ninst].x64.addr, 0); + x64disas_add_register_mapping_annotations(buf2, inst_name, register_mappings, sizeof(register_mappings) / sizeof(register_mappings[0])); + inst_name = buf2; } - if(dyn->e.stack || dyn->insts[ninst].e.stack_next || dyn->insts[ninst].e.x87stack) - dynarec_log(LOG_NONE, " X87:%d/%d(+%d/-%d)%d", dyn->e.stack, dyn->insts[ninst].e.stack_next, dyn->insts[ninst].e.stack_push, dyn->insts[ninst].e.stack_pop, dyn->insts[ninst].e.x87stack); - if(dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) - dynarec_log(LOG_NONE, " %s:%d/%d", dyn->insts[ninst].e.swapped?"SWP":"CMB", dyn->insts[ninst].e.combined1, dyn->insts[ninst].e.combined2); - dynarec_log(LOG_NONE, "%s\n", (box64_dynarec_dump>1)?"\e[m":""); + dyn->gdbjit_block = GdbJITBlockAddLine(dyn->gdbjit_block, (dyn->native_start + dyn->insts[ninst].address), inst_name); } + if (BOX64ENV(dynarec_perf_map) && BOX64ENV(dynarec_perf_map_fd) != -1) { + writePerfMap(dyn->insts[ninst].x64.addr, dyn->native_start + dyn->insts[ninst].address, dyn->insts[ninst].size / 4, name); + } + if (length > sizeof(buf)) printf_log(LOG_NONE, "Warning: buf to small in inst_name_pass3 (%d vs %zd)\n", length, sizeof(buf)); } void print_opcode(dynarec_native_t* dyn, int ninst, uint32_t opcode) { - dynarec_log(LOG_NONE, "\t%08x\t%s\n", opcode, rv64_print(opcode, (uintptr_t)dyn->block)); -} - -void print_newinst(dynarec_native_t* dyn, int ninst) -{ - dynarec_log(LOG_NONE, "%sNew instruction %d, native=%p (0x%x)%s\n", - (box64_dynarec_dump>1)?"\e[4;32m":"", - ninst, dyn->block, dyn->native_size, - (box64_dynarec_dump>1)?"\e[m":"" - ); + dynarec_log_prefix(0, LOG_NONE, "\t%08x\t%s\n", opcode, rv64_print(opcode, (uintptr_t)dyn->block)); } // x87 stuffs static void x87_reset(extcache_t* e) { - for (int i=0; i<8; ++i) + for (int i = 0; i < 8; ++i) e->x87cache[i] = -1; e->x87stack = 0; e->stack = 0; @@ -672,7 +790,7 @@ static void x87_reset(extcache_t* e) e->pushed = 0; e->poped = 0; - for(int i=0; i<24; ++i) + for (int i = 0; i < 24; ++i) if (e->extcache[i].t == EXT_CACHE_ST_F || e->extcache[i].t == EXT_CACHE_ST_D || e->extcache[i].t == EXT_CACHE_ST_I64) @@ -682,13 +800,13 @@ static void x87_reset(extcache_t* e) static void mmx_reset(extcache_t* e) { e->mmxcount = 0; - for (int i=0; i<8; ++i) - e->mmxcache[i] = -1; + for (int i = 0; i < 8; ++i) + e->mmxcache[i].v = -1; } static void sse_reset(extcache_t* e) { - for (int i=0; i<16; ++i) + for (int i = 0; i < 16; ++i) e->ssecache[i].v = -1; } @@ -698,6 +816,7 @@ void fpu_reset(dynarec_rv64_t* dyn) mmx_reset(&dyn->e); sse_reset(&dyn->e); fpu_reset_reg(dyn); + dyn->ymm_zero = 0; } void fpu_reset_ninst(dynarec_rv64_t* dyn, int ninst) @@ -705,10 +824,68 @@ void fpu_reset_ninst(dynarec_rv64_t* dyn, int ninst) x87_reset(&dyn->insts[ninst].e); mmx_reset(&dyn->insts[ninst].e); sse_reset(&dyn->insts[ninst].e); - fpu_reset_reg_extcache(&dyn->insts[ninst].e); + fpu_reset_reg_extcache(dyn, &dyn->insts[ninst].e); } int fpu_is_st_freed(dynarec_rv64_t* dyn, int ninst, int st) { - return (dyn->e.tags&(0b11<<(st*2)))?1:0; + return (dyn->e.tags & (0b11 << (st * 2))) ? 1 : 0; +} + +void updateNativeFlags(dynarec_rv64_t* dyn) +{ + if (!BOX64ENV(dynarec_nativeflags)) + return; + for (int i = 1; i < dyn->size; ++i) + if (dyn->insts[i].nat_flags_fusion) { + int j = i - 1; + int found = 0; + if (dyn->insts[i].pred_sz == 1 && dyn->insts[i].pred[0] == j) { + while (j >= 0) { + if (dyn->insts[j].x64.set_flags && (dyn->insts[i].x64.use_flags & dyn->insts[j].x64.set_flags) == dyn->insts[i].x64.use_flags) { + dyn->insts[j].nat_flags_fusion = 1; + if (dyn->insts[i].x64.use_flags & X_SF) { + dyn->insts[j].nat_flags_needsign = 1; + } + dyn->insts[i].x64.use_flags = 0; + dyn->insts[j].nat_next_inst = i; + found = 1; + break; + } else if (j && dyn->insts[j].pred_sz == 1 && dyn->insts[j].pred[0] == j - 1 + && dyn->insts[j].no_scratch_usage && !dyn->insts[j].x64.set_flags && !dyn->insts[j].x64.use_flags) { + j -= 1; + } else + break; + } + } + if (!found) dyn->insts[i].nat_flags_fusion = 0; + } +} + +void get_free_scratch(dynarec_rv64_t* dyn, int ninst, uint8_t* tmp1, uint8_t* tmp2, uint8_t* tmp3, uint8_t s1, uint8_t s2, uint8_t s3, uint8_t s4, uint8_t s5) +{ + uint8_t n1 = dyn->insts[ninst].nat_flags_op1; + uint8_t n2 = dyn->insts[ninst].nat_flags_op2; + uint8_t tmp[5] = {0}; + int idx = 0; + #define GO(s) if((s!=n1) && (s!=n2)) tmp[idx++] = s + GO(s1); + GO(s2); + GO(s3); + GO(s4); + GO(s5); + #undef GO + *tmp1 = tmp[0]; + *tmp2 = tmp[1]; + *tmp3 = tmp[2]; +} + +void fpu_save_and_unwind(dynarec_rv64_t* dyn, int ninst, extcache_t* cache) +{ + memcpy(cache, &dyn->insts[ninst].e, sizeof(extcache_t)); + extcacheUnwind(&dyn->insts[ninst].e); +} +void fpu_unwind_restore(dynarec_rv64_t* dyn, int ninst, extcache_t* cache) +{ + memcpy(&dyn->insts[ninst].e, cache, sizeof(extcache_t)); } diff --git a/src/dynarec/rv64/dynarec_rv64_functions.h b/src/dynarec/rv64/dynarec_rv64_functions.h index e3a5171..d3352f5 100644 --- a/src/dynarec/rv64/dynarec_rv64_functions.h +++ b/src/dynarec/rv64/dynarec_rv64_functions.h @@ -6,16 +6,19 @@ typedef struct x64emu_s x64emu_t; typedef struct dynarec_rv64_s dynarec_rv64_t; -#define SCRATCH0 2 +#define SCRATCH0 3 +#define VMASK 0 // Get an FPU scratch reg int fpu_get_scratch(dynarec_rv64_t* dyn); +// Get a FPU scratch reg aligned to LMUL +int fpu_get_scratch_lmul(dynarec_rv64_t* dyn, int lmul); // Reset scratch regs counter void fpu_reset_scratch(dynarec_rv64_t* dyn); // Get an x87 double reg int fpu_get_reg_x87(dynarec_rv64_t* dyn, int t, int n); // Get an MMX double reg -int fpu_get_reg_emm(dynarec_rv64_t* dyn, int emm); +int fpu_get_reg_emm(dynarec_rv64_t* dyn, int t, int emm); // Get an XMM quad reg int fpu_get_reg_xmm(dynarec_rv64_t* dyn, int t, int xmm); // Free a FPU/MMX/XMM reg @@ -39,21 +42,24 @@ int extcache_get_current_st_f_i64(dynarec_rv64_t* dyn, int a); // Back-propagate a change float->double void extcache_promote_double(dynarec_rv64_t* dyn, int ninst, int a); // Combine and propagate if needed (pass 1 only) -int extcache_combine_st(dynarec_rv64_t* dyn, int ninst, int a, int b); // with stack current dyn->n_stack* +int extcache_combine_st(dynarec_rv64_t* dyn, int ninst, int a, int b); // with stack current dyn->n_stack* // Do not allow i64 type int extcache_no_i64(dynarec_rv64_t* dyn, int ninst, int st, int a); // FPU Cache transformation (for loops) // Specific, need to be written par backend int fpuCacheNeedsTransform(dynarec_rv64_t* dyn, int ninst); +int sewNeedsTransform(dynarec_rv64_t* dyn, int ninst); + // Undo the changes of a extcache to get the status before the instruction void extcacheUnwind(extcache_t* cache); +void fpu_save_and_unwind(dynarec_rv64_t* dyn, int ninst, extcache_t* cache); +void fpu_unwind_restore(dynarec_rv64_t* dyn, int ninst, extcache_t* cache); const char* getCacheName(int t, int n); void inst_name_pass3(dynarec_native_t* dyn, int ninst, const char* name, rex_t rex); void print_opcode(dynarec_native_t* dyn, int ninst, uint32_t opcode); -void print_newinst(dynarec_native_t* dyn, int ninst); // reset the cache void fpu_reset(dynarec_native_t* dyn); @@ -61,4 +67,8 @@ void fpu_reset_ninst(dynarec_native_t* dyn, int ninst); // is st freed int fpu_is_st_freed(dynarec_native_t* dyn, int ninst, int st); + +void updateNativeFlags(dynarec_rv64_t* dyn); +void get_free_scratch(dynarec_rv64_t* dyn, int ninst, uint8_t* tmp1, uint8_t* tmp2, uint8_t* tmp3, uint8_t s1, uint8_t s2, uint8_t s3, uint8_t s4, uint8_t s5); + #endif //__DYNAREC_RV64_FUNCTIONS_H__ diff --git a/src/dynarec/rv64/dynarec_rv64_helper.c b/src/dynarec/rv64/dynarec_rv64_helper.c index c51f50e..19c3a51 100644 --- a/src/dynarec/rv64/dynarec_rv64_helper.c +++ b/src/dynarec/rv64/dynarec_rv64_helper.c @@ -8,10 +8,9 @@ #include "bitutils.h" #include "debug.h" #include "box64context.h" -#include "dynarec.h" +#include "box64cpu.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" -#include "x64run.h" +#include "rv64_emitter.h" #include "x64emu.h" #include "box64stack.h" #include "callback.h" @@ -24,628 +23,533 @@ #include "rv64_printer.h" #include "dynarec_rv64_private.h" #include "dynarec_rv64_functions.h" -#include "dynarec_rv64_helper.h" - -static uintptr_t geted_32(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, int *l, int i12); +#include "../dynarec_helper.h" /* setup r2 to address pointed by ED, also fixaddress is an optionnal delta in the range [-absmax, +absmax], with delta&mask==0 to be added to ed for LDR/STR */ -uintptr_t geted(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int *l, int i12, int delta) +uintptr_t geted(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int* l, int i12, int delta) { - MAYUSE(dyn); MAYUSE(ninst); MAYUSE(delta); + MAYUSE(dyn); + MAYUSE(ninst); + MAYUSE(delta); + + if (l == LOCK_LOCK) { + dyn->insts[ninst].lock = 1; + } + + int lock = l ? ((l == LOCK_LOCK) ? 1 : 2) : 0; + if (lock == 2) *l = 0; - if(rex.is32bits) - return geted_32(dyn, addr, ninst, nextop, ed, hint, scratch, fixaddress, l, i12); + if (rex.is32bits && rex.is67) + return geted16(dyn, addr, ninst, nextop, ed, hint, scratch, fixaddress, rex, i12); - int lock = l?((l==LOCK_LOCK)?1:2):0; - if(lock==2) - *l = 0; uint8_t ret = x2; *fixaddress = 0; - if(hint>0) ret = hint; + if (hint > 0) ret = hint; int maxval = 2047; - if(i12>1) + if (i12 > 1) maxval -= i12; + int seg_done = 0; MAYUSE(scratch); - if(!(nextop&0xC0)) { - if((nextop&7)==4) { + if (!(nextop & 0xC0)) { + if ((nextop & 7) == 4) { uint8_t sib = F8; - int sib_reg = ((sib>>3)&7)+(rex.x<<3); - int sib_reg2 = (sib&0x7)+(rex.b<<3); - if((sib&0x7)==5) { + int sib_reg = ((sib >> 3) & 7) + (rex.x << 3); + int sib_reg2 = (sib & 0x7) + (rex.b << 3); + if ((sib & 0x7) == 5) { int64_t tmp = F32S; - if (sib_reg!=4) { - if(tmp && ((tmp<-2048) || (tmp>maxval) || !i12)) { - MOV64x(scratch, tmp); - ADDSL(ret, scratch, xRAX+sib_reg, sib>>6, ret); + if (sib_reg != 4) { + if (tmp && ((tmp < -2048) || (tmp > maxval) || !i12)) { + MOV64y(scratch, tmp); + ADDSLy(ret, scratch, TO_NAT(sib_reg), sib >> 6, ret); + SCRATCH_USAGE(1); } else { - if(sib>>6) { - SLLI(ret, xRAX+sib_reg, (sib>>6)); + if (sib >> 6) { + SLLIy(ret, TO_NAT(sib_reg), (sib >> 6)); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); } else - ret = xRAX+sib_reg; + ret = TO_NAT(sib_reg); *fixaddress = tmp; } } else { - switch(lock) { + if (rex.seg && !(tmp && ((tmp < -2048) || (tmp > maxval) || !i12))) { + grab_segdata(dyn, addr, ninst, ret, rex.seg); + seg_done = 1; + *fixaddress = tmp; + } else if (rex.seg && tmp >= -2048 && tmp < 2048) { + grab_segdata(dyn, addr, ninst, ret, rex.seg); + if (tmp) ADDI(ret, ret, tmp); + seg_done = 1; + } else + MOV64y(ret, tmp); + switch (lock) { case 1: addLockAddress(tmp); break; - case 2: if(isLockAddress(tmp)) *l=1; break; + case 2: + if (isLockAddress(tmp)) *l = 1; + break; } - MOV64x(ret, tmp); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); } } else { - if (sib_reg!=4) { - ADDSL(ret, xRAX+sib_reg2, xRAX+sib_reg, sib>>6, scratch); + if (sib_reg != 4) { + if (!(sib >> 6)) { + ADD(ret, TO_NAT(sib_reg2), TO_NAT(sib_reg)); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + } else if (cpuext.zba) { + SHxADD(ret, TO_NAT(sib_reg), sib >> 6, TO_NAT(sib_reg2)); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + } else if (cpuext.xtheadba) { + TH_ADDSL(ret, TO_NAT(sib_reg2), TO_NAT(sib_reg), sib >> 6); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + } else { + SLLI(scratch, TO_NAT(sib_reg), sib >> 6); + ADD(ret, TO_NAT(sib_reg2), scratch); + SCRATCH_USAGE(1); + } + if (rex.is32bits || rex.is67) ZEROUP(ret); } else { - ret = xRAX+sib_reg2; + ret = TO_NAT(sib_reg2); } } - } else if((nextop&7)==5) { - int64_t tmp = F32S64; - int64_t adj = dyn->last_ip?((addr+delta)-dyn->last_ip):0; - if(i12 && adj && (tmp+adj>=-2048) && (tmp+adj<=maxval)) { - ret = xRIP; - *fixaddress = tmp+adj; - } else if(i12 && (tmp>=-2048) && (tmp<=maxval)) { - GETIP(addr+delta); - ret = xRIP; - *fixaddress = tmp; - } else if(adj && (tmp+adj>=-2048) && (tmp+adj<=maxval)) { - ADDI(ret, xRIP, tmp+adj); - } else if((tmp>=-2048) && (tmp<=maxval)) { - GETIP(addr+delta); - ADDI(ret, xRIP, tmp); - } else if(tmp+addr+delta<0x100000000LL) { - MOV64x(ret, tmp+addr+delta); + } else if ((nextop & 7) == 5) { + if (rex.is32bits) { + int tmp = F32S; + if (rex.seg && tmp >= -2048 && tmp < 2048) { + grab_segdata(dyn, addr, ninst, ret, rex.seg); + if (tmp) ADDI(ret, ret, tmp); + seg_done = 1; + } else + MOV32w(ret, tmp); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + if (!rex.seg) + switch (lock) { + case 1: + addLockAddress(tmp); + if (fixaddress) *fixaddress = tmp; + break; + case 2: + if (isLockAddress(tmp)) *l = 1; + break; + } } else { - if(adj) { - MOV64x(ret, tmp+adj); + int64_t tmp = F32S64; + int64_t adj = dyn->last_ip ? ((addr + delta) - dyn->last_ip) : 0; + if (i12 && adj && (tmp + adj >= -2048) && (tmp + adj <= maxval)) { + ret = xRIP; + *fixaddress = tmp + adj; + } else if (i12 && (tmp >= -2048) && (tmp <= maxval)) { + GETIP(addr + delta, scratch); + ret = xRIP; + *fixaddress = tmp; + SCRATCH_USAGE(1); + } else if (adj && (tmp + adj >= -2048) && (tmp + adj <= maxval)) { + ADDI(ret, xRIP, tmp + adj); + } else if ((tmp >= -2048) && (tmp <= maxval)) { + GETIP(addr + delta, scratch); + ADDIy(ret, xRIP, tmp); + SCRATCH_USAGE(1); + } else if (tmp + addr + delta < 0x80000000LL && !dyn->need_reloc) { + MOV64y(ret, tmp + addr + delta); } else { - MOV64x(ret, tmp); - GETIP(addr+delta); + if (adj) { + MOV64y(ret, tmp + adj); + } else { + MOV64y(ret, tmp); + GETIP(addr + delta, scratch); + SCRATCH_USAGE(1); + } + ADDy(ret, ret, xRIP); } - ADD(ret, ret, xRIP); - } - switch(lock) { - case 1: addLockAddress(addr+delta+tmp); break; - case 2: if(isLockAddress(addr+delta+tmp)) *l=1; break; + if (!rex.seg) + switch (lock) { + case 1: + addLockAddress(addr + delta + tmp); + if (fixaddress) *fixaddress = addr + delta + tmp; + break; + case 2: + if (isLockAddress(addr + delta + tmp)) *l = 1; + break; + } + if (!IS_GPR(ret)) SCRATCH_USAGE(1); } } else { - ret = xRAX+(nextop&7)+(rex.b<<3); + ret = TO_NAT((nextop & 7) + (rex.b << 3)); } } else { int64_t i64; uint8_t sib = 0; int sib_reg = 0; - if((nextop&7)==4) { + if ((nextop & 7) == 4) { sib = F8; - sib_reg = ((sib>>3)&7)+(rex.x<<3); + sib_reg = ((sib >> 3) & 7) + (rex.x << 3); } - int sib_reg2 = (sib&0x07)+(rex.b<<3); - if(nextop&0x80) + int sib_reg2 = (sib & 0x07) + (rex.b << 3); + if (nextop & 0x80) i64 = F32S; else i64 = F8S; - if(i64==0 || ((i64>=-2048) && (i64<=2047) && i12)) { + if (i64 == 0 || ((i64 >= -2048) && (i64 <= maxval) && i12)) { *fixaddress = i64; - if((nextop&7)==4) { - if (sib_reg!=4) { - ADDSL(ret, xRAX+sib_reg2, xRAX+sib_reg, sib>>6, scratch); - } else { - ret = xRAX+sib_reg2; - } - } else - ret = xRAX+(nextop&0x07)+(rex.b<<3); - } else { - if(i64>=-2048 && i64<=2047) { - if((nextop&7)==4) { - if (sib_reg!=4) { - ADDSL(scratch, xRAX+sib_reg2, xRAX+sib_reg, sib>>6, scratch); + if ((nextop & 7) == 4) { + if (sib_reg != 4) { + if (!(sib >> 6)) { + ADD(ret, TO_NAT(sib_reg2), TO_NAT(sib_reg)); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + } else if (cpuext.zba) { + SHxADD(ret, TO_NAT(sib_reg), sib >> 6, TO_NAT(sib_reg2)); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + } else if (cpuext.xtheadba) { + TH_ADDSL(ret, TO_NAT(sib_reg2), TO_NAT(sib_reg), sib >> 6); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); } else { - scratch = xRAX+sib_reg2; - } - } else - scratch = xRAX+(nextop&0x07)+(rex.b<<3); - ADDI(ret, scratch, i64); - } else { - MOV64x(scratch, i64); - if((nextop&7)==4) { - if (sib_reg!=4) { - ADD(scratch, scratch, xRAX+sib_reg2); - ADDSL(ret, scratch, xRAX+sib_reg, sib>>6, ret); - } else { - PASS3(int tmp = xRAX+sib_reg2); - ADD(ret, tmp, scratch); + SLLI(scratch, TO_NAT(sib_reg), sib >> 6); + ADD(ret, TO_NAT(sib_reg2), scratch); + SCRATCH_USAGE(1); } + if (rex.is32bits || rex.is67) ZEROUP(ret); } else { - PASS3(int tmp = xRAX+(nextop&0x07)+(rex.b<<3)); - ADD(ret, tmp, scratch); + ret = TO_NAT(sib_reg2); } - } - } - } - *ed = ret; - return addr; -} - -static uintptr_t geted_32(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, int *l, int i12) -{ - MAYUSE(dyn); MAYUSE(ninst); - - int lock = l?((l==LOCK_LOCK)?1:2):0; - if(lock==2) - *l = 0; - uint8_t ret = x2; - *fixaddress = 0; - if(hint>0) ret = hint; - int maxval = 2047; - if(i12>1) - maxval -= i12; - MAYUSE(scratch); - if(!(nextop&0xC0)) { - if((nextop&7)==4) { - uint8_t sib = F8; - int sib_reg = (sib>>3)&0x7; - int sib_reg2 = sib&0x7; - if(sib_reg2==5) { - int64_t tmp = F32S; - if (sib_reg!=4) { - if(tmp && ((tmp<-2048) || (tmp>maxval) || !i12)) { - MOV32w(scratch, tmp); - if((sib>>6)) { - SLLI(ret, xRAX + sib_reg, sib >> 6); - ADDW(ret, ret, scratch); - } else - ADDW(ret, xRAX+sib_reg, scratch); + } else + ret = TO_NAT((nextop & 0x07) + (rex.b << 3)); + } else { + if (i64 >= -2048 && i64 <= 2047) { + if ((nextop & 7) == 4) { + if (sib_reg != 4) { + if (!(sib >> 6)) { + ADD(ret, TO_NAT(sib_reg2), TO_NAT(sib_reg)); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + } else if (cpuext.zba) { + SHxADD(ret, TO_NAT(sib_reg), sib >> 6, TO_NAT(sib_reg2)); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + } else if (cpuext.xtheadba) { + TH_ADDSL(ret, TO_NAT(sib_reg2), TO_NAT(sib_reg), sib >> 6); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + } else { + SLLI(scratch, TO_NAT(sib_reg), sib >> 6); + ADD(ret, TO_NAT(sib_reg2), scratch); + SCRATCH_USAGE(1); + } + ADDIy(ret, ret, i64); } else { - if(sib>>6) - SLLI(ret, xRAX+sib_reg, (sib>>6)); - else - ret = xRAX+sib_reg; - *fixaddress = tmp; + ADDIy(ret, TO_NAT(sib_reg2), i64); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); } } else { - switch(lock) { - case 1: addLockAddress((int32_t)tmp); break; - case 2: if(isLockAddress((int32_t)tmp)) *l=1; break; - } - MOV32w(ret, tmp); - } - } else { - if (sib_reg!=4) { - if((sib>>6)) { - SLLI(ret, xRAX + sib_reg, (sib >> 6)); - ADDW(ret, ret, xRAX + sib_reg2); - } else - ADDW(ret, xRAX+sib_reg2, xRAX+sib_reg); - } else { - ret = xRAX+sib_reg2; - } - } - } else if((nextop&7)==5) { - uint32_t tmp = F32; - MOV32w(ret, tmp); - switch(lock) { - case 1: addLockAddress(tmp); break; - case 2: if(isLockAddress(tmp)) *l=1; break; - } - } else { - ret = xRAX+(nextop&7); - if(ret==hint) { - AND(hint, ret, xMASK); //to clear upper part - } - } - } else { - int64_t i32; - uint8_t sib = 0; - int sib_reg = 0; - if((nextop&7)==4) { - sib = F8; - sib_reg = (sib>>3)&7; - } - int sib_reg2 = sib&0x07; - if(nextop&0x80) - i32 = F32S; - else - i32 = F8S; - if(i32==0 || ((i32>=-2048) && (i32<=2047) && i12)) { - *fixaddress = i32; - if((nextop&7)==4) { - if (sib_reg!=4) { - if(sib>>6) { - SLLI(ret, xRAX + sib_reg, (sib >> 6)); - ADDW(ret, ret, xRAX + sib_reg2); - } else - ADDW(ret, xRAX+sib_reg2, xRAX+sib_reg); - } else { - ret = xRAX+sib_reg2; + ADDIy(ret, TO_NAT((nextop & 0x07) + (rex.b << 3)), i64); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); } } else { - ret = xRAX+(nextop&0x07); - } - } else { - if(i32>=-2048 && i32<=2047) { - if((nextop&7)==4) { - if (sib_reg!=4) { - if(sib>>6) { - SLLI(scratch, xRAX + sib_reg, sib >> 6); - ADDW(scratch, scratch, xRAX + sib_reg2); - } else - ADDW(scratch, xRAX+sib_reg2, xRAX+sib_reg); - } else { - scratch = xRAX+sib_reg2; - } - } else - scratch = xRAX+(nextop&0x07); - ADDIW(ret, scratch, i32); - } else { - MOV32w(scratch, i32); - if((nextop&7)==4) { - if (sib_reg!=4) { - ADDW(scratch, scratch, xRAX+sib_reg2); - if(sib>>6) { - SLLI(ret, xRAX + sib_reg, (sib >> 6)); - ADDW(ret, ret, scratch); - } else - ADDW(ret, scratch, xRAX+sib_reg); + MOV64y(scratch, i64); + SCRATCH_USAGE(1); + if ((nextop & 7) == 4) { + if (sib_reg != 4) { + ADDy(scratch, scratch, TO_NAT(sib_reg2)); + ADDSLy(ret, scratch, TO_NAT(sib_reg), sib >> 6, ret); } else { - PASS3(int tmp = xRAX+sib_reg2); - ADDW(ret, tmp, scratch); + PASS3(int tmp = TO_NAT(sib_reg2)); + ADDy(ret, tmp, scratch); } } else { - PASS3(int tmp = xRAX+(nextop&0x07)); - ADDW(ret, tmp, scratch); + PASS3(int tmp = TO_NAT((nextop & 0x07) + (rex.b << 3))); + ADDy(ret, tmp, scratch); } } } } + if (rex.is67 && IS_GPR(ret) && !rex.seg) { + ZEXTW2(hint, ret); // truncate for is67 case only (is32bits case regs are already 32bits only) + ret = hint; + } + if (rex.seg && !seg_done) { + if (scratch == ret) + scratch = ret + 1; + SCRATCH_USAGE(1); + grab_segdata(dyn, addr, ninst, scratch, rex.seg); + // seg offset is 64bits, so no truncation here + ADDxREGy(hint, scratch, ret, hint); + ret = hint; + } *ed = ret; return addr; } -/* setup r2 to address pointed by ED, also fixaddress is an optionnal delta in the range [-absmax, +absmax], with delta&mask==0 to be added to ed for LDR/STR */ -uintptr_t geted32(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int *l, int i12, int delta) +uintptr_t geted16(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int i12) { - MAYUSE(dyn); MAYUSE(ninst); MAYUSE(delta); + MAYUSE(dyn); + MAYUSE(ninst); - int lock = l?((l==LOCK_LOCK)?1:2):0; - if(lock==2) - *l = 0; uint8_t ret = x2; *fixaddress = 0; - if(hint>0) ret = hint; - int maxval = 2047; - if(i12>1) - maxval -= i12; + if (hint > 0) ret = hint; MAYUSE(scratch); - if(!(nextop&0xC0)) { - if((nextop&7)==4) { - uint8_t sib = F8; - int sib_reg = ((sib>>3)&0x7)+(rex.x<<3); - int sib_reg2 = (sib&0x7)+(rex.b<<3); - if((sib&0x7)==5) { - int64_t tmp = F32S; - if (sib_reg!=4) { - if(tmp && ((tmp<-2048) || (tmp>maxval) || !i12)) { - MOV64x(scratch, tmp); - if((sib>>6)) { - SLLI(ret, xRAX + sib_reg, sib >> 6); - ADDW(ret, ret, scratch); - } else - ADDW(ret, xRAX+sib_reg, scratch); - } else { - if(sib>>6) - SLLI(ret, xRAX+sib_reg, (sib>>6)); - else - ret = xRAX+sib_reg; - *fixaddress = tmp; - } - } else { - switch(lock) { - case 1: addLockAddress(tmp); break; - case 2: if(isLockAddress(tmp)) *l=1; break; - } - MOV64x(ret, tmp); - } - } else { - if (sib_reg!=4) { - if((sib>>6)) { - SLLI(ret, xRAX + sib_reg, (sib >> 6)); - ADDW(ret, ret, xRAX + sib_reg2); - } else - ADDW(ret, xRAX+sib_reg2, xRAX+sib_reg); - } else { - ret = xRAX+sib_reg2; - } - } - } else if((nextop&7)==5) { - uint32_t tmp = F32; - MOV32w(ret, tmp); - GETIP(addr+delta); - ADDW(ret, ret, xRIP); - switch(lock) { - case 1: addLockAddress(addr+delta+tmp); break; - case 2: if(isLockAddress(addr+delta+tmp)) *l=1; break; - } - } else { - ret = xRAX+(nextop&7)+(rex.b<<3); - if(ret==hint) { - AND(hint, ret, xMASK); //to clear upper part - } - } + uint32_t m = nextop & 0xC7; + uint32_t n = (m >> 6) & 3; + int64_t offset = 0; + if (!n && (m & 7) == 6) { + offset = F16S; + MOV32w(ret, offset); } else { - int64_t i64; - uint8_t sib = 0; - int sib_reg = 0; - if((nextop&7)==4) { - sib = F8; - sib_reg = ((sib>>3)&7)+(rex.x<<3); + switch (n) { + case 0: offset = 0; break; + case 1: offset = F8S; break; + case 2: offset = F16S; break; } - int sib_reg2 = (sib&0x07)+(rex.b<<3); - if(nextop&0x80) - i64 = F32S; - else - i64 = F8S; - if(i64==0 || ((i64>=-2048) && (i64<=2047) && i12)) { - *fixaddress = i64; - if((nextop&7)==4) { - if (sib_reg!=4) { - if(sib>>6) { - SLLI(ret, xRAX + sib_reg, (sib >> 6)); - ADDW(ret, ret, xRAX + sib_reg2); - } else - ADDW(ret, xRAX+sib_reg2, xRAX+sib_reg); - } else { - ret = xRAX+sib_reg2; - } - } else { - ret = xRAX+(nextop&0x07)+(rex.b<<3); - } - } else { - if(i64>=-2048 && i64<=2047) { - if((nextop&7)==4) { - if (sib_reg!=4) { - if(sib>>6) { - SLLI(scratch, xRAX + sib_reg, sib >> 6); - ADDW(scratch, scratch, xRAX + sib_reg2); - } else - ADDW(scratch, xRAX+sib_reg2, xRAX+sib_reg); - } else { - scratch = xRAX+sib_reg2; - } - } else - scratch = xRAX+(nextop&0x07)+(rex.b<<3); - ADDIW(ret, scratch, i64); + if (i12 && offset && offset >= -2048 && offset <= 2047) { + *fixaddress = offset; + offset = 0; + } + int reg; + switch (m & 7) { + case 0: // R_BX + R_SI + ADD(ret, xRBX, xRSI); + reg = ret; + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + break; + case 1: // R_BX + R_DI + ADD(ret, xRBX, xRDI); + reg = ret; + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + break; + case 2: // R_BP + R_SI + ADD(ret, xRBP, xRSI); + reg = ret; + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + break; + case 3: // R_BP + R_DI + ADD(ret, xRBP, xRDI); + reg = ret; + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + break; + case 4: // R_SI + reg = xRSI; + break; + case 5: // R_DI + reg = xRDI; + break; + case 6: // R_BP + reg = xRBP; + break; + case 7: // R_BX + reg = xRBX; + break; + } + ZEXTH(ret, reg); + if (!IS_GPR(ret)) SCRATCH_USAGE(1); + if (offset) { + if (offset >= -2048 && offset < 2048) { + ADDI(ret, ret, offset); } else { - MOV32w(scratch, i64); - if((nextop&7)==4) { - if (sib_reg!=4) { - ADDW(scratch, scratch, xRAX+sib_reg2); - if(sib>>6) { - SLLI(ret, xRAX + sib_reg, (sib >> 6)); - ADDW(ret, ret, scratch); - } else - ADDW(ret, scratch, xRAX+sib_reg); - } else { - PASS3(int tmp = xRAX+sib_reg2); - ADDW(ret, tmp, scratch); - } - } else { - PASS3(int tmp = xRAX+(nextop&0x07)+(rex.b<<3)); - ADDW(ret, tmp, scratch); - } + MOV64x(scratch, offset); + ADD(ret, ret, scratch); + SCRATCH_USAGE(1); } + ZEXTH(ret, ret); } } + + if (rex.seg) { + if (scratch == ret) + scratch = ret + 1; + SCRATCH_USAGE(1); + grab_segdata(dyn, addr, ninst, scratch, rex.seg); + // seg offset is 64bits, so no truncation here + if (IS_GPR(ret)) { + ADD(hint, ret, scratch); + ret = hint; + } else + ADD(ret, ret, scratch); + } *ed = ret; return addr; } void jump_to_epilog(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst) { - MAYUSE(dyn); MAYUSE(ip); MAYUSE(ninst); + MAYUSE(dyn); + MAYUSE(ip); + MAYUSE(ninst); MESSAGE(LOG_DUMP, "Jump to epilog\n"); - if(reg) { - if(reg!=xRIP) { + if (reg) { + if (reg != xRIP) { MV(xRIP, reg); } } else { - GETIP_(ip); + GETIP_(ip, x2); } - TABLE64(x2, (uintptr_t)rv64_epilog); + TABLE64C(x2, const_epilog); SMEND(); BR(x2); } void jump_to_epilog_fast(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst) { - MAYUSE(dyn); MAYUSE(ip); MAYUSE(ninst); + MAYUSE(dyn); + MAYUSE(ip); + MAYUSE(ninst); MESSAGE(LOG_DUMP, "Jump to epilog_fast\n"); - if(reg) { - if(reg!=xRIP) { + if (reg) { + if (reg != xRIP) { MV(xRIP, reg); } } else { - GETIP_(ip); + GETIP_(ip, x2); } - TABLE64(x2, (uintptr_t)rv64_epilog_fast); + TABLE64C(x2, const_epilog_fast); SMEND(); BR(x2); } #ifdef JMPTABLE_SHIFT4 #error TODO! #endif -void jump_to_next(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst, int is32bits) -{ - MAYUSE(dyn); MAYUSE(ninst); - MESSAGE(LOG_DUMP, "Jump to next\n"); - if(reg) { - if(reg!=xRIP) { - MV(xRIP, reg); - } - uintptr_t tbl = is32bits?getJumpTable32():getJumpTable64(); - MAYUSE(tbl); - TABLE64(x3, tbl); - if(!is32bits) { - SRLI(x2, xRIP, JMPTABL_START3); - if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);} - LD(x3, x3, 0); // could be LR_D(x3, x3, 1, 1); for better safety +static int indirect_lookup(dynarec_rv64_t* dyn, int ninst, int is32bits, int s1, int s2) +{ + MAYUSE(dyn); + if (cpuext.xtheadbb && cpuext.xtheadmemidx) { + if (!is32bits) { + SRLI(s1, xRIP, 48); + BNEZ_safe(s1, (intptr_t)dyn->jmp_next - (intptr_t)dyn->block); + if (dyn->need_reloc) { + TABLE64C(s2, const_jmptbl48); + } else { + MOV64x(s2, getConst(const_jmptbl48)); + } + TH_EXTU(s1, xRIP, JMPTABL_START2 + JMPTABL_SHIFT2 - 1, JMPTABL_START2); + TH_LRD(s2, s2, s1, 3); + } else { + TABLE64C(s2, const_jmptbl32); } - MOV64x(x4, JMPTABLE_MASK2<<3); // x4 = mask - SRLI(x2, xRIP, JMPTABL_START2-3); - AND(x2, x2, x4); - ADD(x3, x3, x2); - LD(x3, x3, 0); //LR_D(x3, x3, 1, 1); - if(JMPTABLE_MASK2!=JMPTABLE_MASK1) { - MOV64x(x4, JMPTABLE_MASK1<<3); // x4 = mask + TH_EXTU(s1, xRIP, JMPTABL_START1 + JMPTABL_SHIFT1 - 1, JMPTABL_START1); + TH_LRD(s2, s2, s1, 3); + TH_EXTU(s1, xRIP, JMPTABL_START0 + JMPTABL_SHIFT0 - 1, JMPTABL_START0); + TH_LRD(s1, s2, s1, 3); + } else { + if (!is32bits) { + SRLI(s1, xRIP, 48); + BNEZ_safe(s1, (intptr_t)dyn->jmp_next - (intptr_t)dyn->block); + MOV64x(s2, getConst(const_jmptbl48)); + SRLI(s1, xRIP, JMPTABL_START2); + ADDSL(s2, s2, s1, 3, s1); + LD(s2, s2, 0); + } else { + TABLE64C(s2, const_jmptbl32); } - SRLI(x2, xRIP, JMPTABL_START1-3); - AND(x2, x2, x4); - ADD(x3, x3, x2); - LD(x3, x3, 0); //LR_D(x3, x3, 1, 1); - if(JMPTABLE_MASK0<2048) { - ANDI(x2, xRIP, JMPTABLE_MASK0); + MOV64x(x4, JMPTABLE_MASK1 << 3); + SRLI(s1, xRIP, JMPTABL_START1 - 3); + AND(s1, s1, x4); + ADD(s2, s2, s1); + LD(s2, s2, 0); + if (JMPTABLE_MASK0 < 2048) { + ANDI(s1, xRIP, JMPTABLE_MASK0); } else { MOV64x(x4, JMPTABLE_MASK0); // x4 = mask - AND(x2, xRIP, x4); + AND(s1, xRIP, x4); + } + ADDSL(s2, s2, s1, 3, s1); + LD(s1, s2, 0); + } + return s1; +} + +void jump_to_next(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst, int is32bits) +{ + MAYUSE(dyn); + MAYUSE(ninst); + MESSAGE(LOG_DUMP, "Jump to next\n"); + + if (is32bits) + ip &= 0xffffffffLL; + + int dest; + if (reg) { + if (reg != xRIP) { + MV(xRIP, reg); } - if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);} - LD(x2, x3, 0); //LR_D(x2, x3, 1, 1); + NOTEST(x2); + dest = indirect_lookup(dyn, ninst, is32bits, x2, x3); } else { uintptr_t p = getJumpTableAddress64(ip); MAYUSE(p); - TABLE64(x3, p); - GETIP_(ip); - LD(x2, x3, 0); //LR_D(x2, x3, 1, 1); - } - if(reg!=A1) { - MV(A1, xRIP); + GETIP_(ip, x3); + if (dyn->need_reloc) AddRelocTable64JmpTbl(dyn, ninst, ip, STEP); + TABLE64_(x3, p); + LD(x2, x3, 0); + dest = x2; } CLEARIP(); - #ifdef HAVE_TRACE - //MOVx(x3, 15); no access to PC reg - #endif SMEND(); - JALR(x2); // save LR... +#ifdef HAVE_TRACE + JALR(xRA, dest); +#else + JALR((dyn->insts[ninst].x64.has_callret ? xRA : xZR), dest); +#endif } -void ret_to_epilog(dynarec_rv64_t* dyn, int ninst, rex_t rex) +void ret_to_epilog(dynarec_rv64_t* dyn, uintptr_t ip, int ninst, rex_t rex) { - MAYUSE(dyn); MAYUSE(ninst); + MAYUSE(dyn); + MAYUSE(ninst); MESSAGE(LOG_DUMP, "Ret to epilog\n"); POP1z(xRIP); MVz(x1, xRIP); SMEND(); - if (box64_dynarec_callret) { + if (BOX64DRENV(dynarec_callret)) { // pop the actual return address from RV64 stack - LD(x2, xSP, 0); // native addr - LD(x6, xSP, 8); // x86 addr - ADDI(xSP, xSP, 16); // pop - BNE(x6, xRIP, 2*4); // is it the right address? - JALR(x2); + LD(xRA, xSP, 0); // native addr + LD(x6, xSP, 8); // x86 addr + ADDI(xSP, xSP, 16); // pop + BNE(x6, xRIP, 2 * 4); // is it the right address? + BR(xRA); // not the correct return address, regular jump, but purge the stack first, it's unsync now... LD(xSP, xEmu, offsetof(x64emu_t, xSPSave)); ADDI(xSP, xSP, -16); } - - uintptr_t tbl = rex.is32bits?getJumpTable32():getJumpTable64(); - MOV64x(x3, tbl); - if(!rex.is32bits) { - SRLI(x2, xRIP, JMPTABL_START3); - if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);} - LD(x3, x3, 0); - } - MOV64x(x4, JMPTABLE_MASK2<<3); // x4 = mask - SRLI(x2, xRIP, JMPTABL_START2-3); - AND(x2, x2, x4); - ADD(x3, x3, x2); - LD(x3, x3, 0); - if(JMPTABLE_MASK2!=JMPTABLE_MASK1) { - MOV64x(x4, JMPTABLE_MASK1<<3); // x4 = mask - } - SRLI(x2, xRIP, JMPTABL_START1-3); - AND(x2, x2, x4); - ADD(x3, x3, x2); - LD(x3, x3, 0); - if(JMPTABLE_MASK0<2048) { - ANDI(x2, xRIP, JMPTABLE_MASK0); - } else { - if(JMPTABLE_MASK1!=JMPTABLE_MASK0) { - MOV64x(x4, JMPTABLE_MASK0); // x4 = mask - } - AND(x2, xRIP, x4); - } - if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);} - LD(x2, x3, 0); - JALR(x2); // save LR + NOTEST(x2); + int dest = indirect_lookup(dyn, ninst, rex.is32bits, x2, x3); + BR(dest); CLEARIP(); } -void retn_to_epilog(dynarec_rv64_t* dyn, int ninst, rex_t rex, int n) +void retn_to_epilog(dynarec_rv64_t* dyn, uintptr_t ip, int ninst, rex_t rex, int n) { - MAYUSE(dyn); MAYUSE(ninst); + MAYUSE(dyn); + MAYUSE(ninst); MESSAGE(LOG_DUMP, "Retn to epilog\n"); POP1z(xRIP); - if(n>0x7ff) { - MOV64x(w1, n); + if (n > 0x7ff) { + MOV64x(x1, n); ADDz(xRSP, xRSP, x1); } else { ADDIz(xRSP, xRSP, n); } MVz(x1, xRIP); SMEND(); - if (box64_dynarec_callret) { + if (BOX64DRENV(dynarec_callret)) { // pop the actual return address from RV64 stack - LD(x2, xSP, 0); // native addr - LD(x6, xSP, 8); // x86 addr - ADDI(xSP, xSP, 16); // pop - BNE(x6, xRIP, 2*4); // is it the right address? - JALR(x2); + LD(xRA, xSP, 0); // native addr + LD(x6, xSP, 8); // x86 addr + ADDI(xSP, xSP, 16); // pop + BNE(x6, xRIP, 2 * 4); // is it the right address? + BR(xRA); // not the correct return address, regular jump, but purge the stack first, it's unsync now... LD(xSP, xEmu, offsetof(x64emu_t, xSPSave)); ADDI(xSP, xSP, -16); } - uintptr_t tbl = rex.is32bits?getJumpTable32():getJumpTable64(); - MOV64x(x3, tbl); - if(!rex.is32bits) { - SRLI(x2, xRIP, JMPTABL_START3); - if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);} - LD(x3, x3, 0); - } - MOV64x(x4, JMPTABLE_MASK2<<3); // x4 = mask - SRLI(x2, xRIP, JMPTABL_START2-3); - AND(x2, x2, x4); - ADD(x3, x3, x2); - LD(x3, x3, 0); - if(JMPTABLE_MASK2!=JMPTABLE_MASK1) { - MOV64x(x4, JMPTABLE_MASK1<<3); // x4 = mask - } - SRLI(x2, xRIP, JMPTABL_START1-3); - AND(x2, x2, x4); - ADD(x3, x3, x2); - LD(x3, x3, 0); - if(JMPTABLE_MASK0<2048) { - ANDI(x2, xRIP, JMPTABLE_MASK0); - } else { - if(JMPTABLE_MASK1!=JMPTABLE_MASK0) { - MOV64x(x4, JMPTABLE_MASK0); // x4 = mask - } - AND(x2, xRIP, x4); - } - if(rv64_zba) SH3ADD(x3, x2, x3); else {SLLI(x2, x2, 3); ADD(x3, x3, x2);} - LD(x2, x3, 0); - JALR(x2); // save LR + NOTEST(x2); + int dest = indirect_lookup(dyn, ninst, rex.is32bits, x2, x3); + BR(dest); CLEARIP(); } -void iret_to_epilog(dynarec_rv64_t* dyn, int ninst, int is64bits) +void iret_to_epilog(dynarec_rv64_t* dyn, uintptr_t ip, int ninst, int is64bits) { - //#warning TODO: is64bits + // #warning TODO: is64bits MAYUSE(ninst); MESSAGE(LOG_DUMP, "IRet to epilog\n"); NOTEST(x2); - if(is64bits) { + if (is64bits) { POP1(xRIP); POP1(x2); POP1(xFlags); @@ -654,151 +558,139 @@ void iret_to_epilog(dynarec_rv64_t* dyn, int ninst, int is64bits) POP1_32(x2); POP1_32(xFlags); } + FLAGS_ADJUST_FROM11(xFlags, xFlags, x3); SH(x2, xEmu, offsetof(x64emu_t, segs[_CS])); - SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_CS])); // clean EFLAGS - MOV32w(x1, 0x3F7FD7); + MOV32w(x1, 0x3E7FF7); // also masking RF AND(xFlags, xFlags, x1); ORI(xFlags, xFlags, 0x2); SET_DFNONE(); // POP RSP if (is64bits) { - POP1(x3); //rsp - POP1(x2); //ss + POP1(x3); // rsp + POP1(x2); // ss } else { - POP1_32(x3); //rsp - POP1_32(x2); //ss + POP1_32(x3); // rsp + POP1_32(x2); // ss } // POP SS SH(x2, xEmu, offsetof(x64emu_t, segs[_SS])); - SW(xZR, xEmu, offsetof(x64emu_t, segs_serial[_SS])); // set new RSP MV(xRSP, x3); // Ret.... - MOV64x(x2, (uintptr_t)rv64_epilog); // epilog on purpose, CS might have changed! + // epilog on purpose, CS might have changed! + if (dyn->need_reloc) + TABLE64C(x2, const_epilog); + else + MOV64x(x2, getConst(const_epilog)); SMEND(); BR(x2); CLEARIP(); } -void call_c(dynarec_rv64_t* dyn, int ninst, void* fnc, int reg, int ret, int saveflags, int savereg) +void call_c(dynarec_rv64_t* dyn, int ninst, rv64_consts_t fnc, int reg, int ret, int saveflags, int savereg, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6) { MAYUSE(fnc); - if(savereg==0) - savereg = x6; - if(saveflags) { + if (savereg == 0) + savereg = x87pc; + if (saveflags) { FLAGS_ADJUST_TO11(xFlags, xFlags, reg); SD(xFlags, xEmu, offsetof(x64emu_t, eflags)); } fpu_pushcache(dyn, ninst, reg, 0); - if(ret!=-2) { - SUBI(xSP, xSP, 16); // RV64 stack needs to be 16byte aligned - SD(xEmu, xSP, 0); - SD(savereg, xSP, 8); - // x5..x8, x10..x17, x28..x31 those needs to be saved by caller - STORE_REG(RAX); - STORE_REG(RCX); + if (ret != -2) { + SUBI(xSP, xSP, 16); // RV64 stack needs to be 16byte aligned + SD(savereg, xSP, 0); + STORE_REG(RDI); + STORE_REG(RSI); STORE_REG(RDX); - STORE_REG(R12); - STORE_REG(R13); - STORE_REG(R14); - STORE_REG(R15); + STORE_REG(RCX); + STORE_REG(R8); + STORE_REG(R9); + STORE_REG(RAX); SD(xRIP, xEmu, offsetof(x64emu_t, ip)); } - TABLE64(reg, (uintptr_t)fnc); - JALR(reg); - if(ret>=0) { - MV(ret, xEmu); - } - if(ret!=-2) { - LD(xEmu, xSP, 0); - LD(savereg, xSP, 8); - ADDI(xSP, xSP, 16); - #define GO(A) if(ret!=x##A) {LOAD_REG(A);} - GO(RAX); - GO(RCX); - GO(RDX); - GO(R12); - GO(R13); - GO(R14); - GO(R15); - if(ret!=xRIP) - LD(xRIP, xEmu, offsetof(x64emu_t, ip)); - #undef GO - } - // regenerate mask - XORI(xMASK, xZR, -1); - SRLI(xMASK, xMASK, 32); + TABLE64C(reg, fnc); + MV(A0, xEmu); + if (arg1) MV(A1, arg1); + if (arg2) MV(A2, arg2); + if (arg3) MV(A3, arg3); + if (arg4) MV(A4, arg4); + if (arg5) MV(A5, arg5); + if (arg6) MV(A6, arg6); + JALR(xRA, reg); + if (ret >= 0) { + MV(ret, A0); + } + + // reinitialize sew + if (dyn->vector_sew != VECTOR_SEWNA) + vector_vsetvli(dyn, ninst, savereg, dyn->vector_sew, VECTOR_LMUL1, 1); + + LD(savereg, xSP, 0); + ADDI(xSP, xSP, 16); +#define GO(A) \ + if (ret != x##A) { LOAD_REG(A); } + GO(RDI); + GO(RSI); + GO(RDX); + GO(RCX); + GO(R8); + GO(R9); + GO(RAX); +#undef GO + if (ret != xRIP) + LD(xRIP, xEmu, offsetof(x64emu_t, ip)); fpu_popcache(dyn, ninst, reg, 0); - if(saveflags) { + if (saveflags) { LD(xFlags, xEmu, offsetof(x64emu_t, eflags)); FLAGS_ADJUST_FROM11(xFlags, xFlags, reg); } - //SET_NODF(); + if (savereg != x87pc && dyn->need_x87check) + NATIVE_RESTORE_X87PC(); + // SET_NODF(); CLEARIP(); } void call_n(dynarec_rv64_t* dyn, int ninst, void* fnc, int w) { MAYUSE(fnc); - FLAGS_ADJUST_TO11(xFlags, xFlags, x3); - SD(xFlags, xEmu, offsetof(x64emu_t, eflags)); fpu_pushcache(dyn, ninst, x3, 1); - // x5..x8, x10..x17, x28..x31 those needs to be saved by caller - // RDI, RSI, RDX, RCX, R8, R9 are used for function call - SUBI(xSP, xSP, 16); - SD(xEmu, xSP, 0); - SD(xRIP, xSP, 8); // RV64 stack needs to be 16byte aligned - STORE_REG(R12); - STORE_REG(R13); - STORE_REG(R14); - STORE_REG(R15); - /* - // float and double args - if (abs(w) > 1) { - MESSAGE(LOG_DUMP, "Getting %d XMM args\n", abs(w) - 1); - for (int i = 0; i < abs(w) - 1; ++i) { - sse_get_reg(dyn, ninst, x6, i, 0); + // save RSP in case there are x86 callbacks... + SD(xRSP, xEmu, offsetof(x64emu_t, regs[_SP])); + SD(xRBP, xEmu, offsetof(x64emu_t, regs[_BP])); + // check if additional sextw needed + int sextw_mask = ((w > 0 ? w : -w) >> 4) & 0b111111; + for (int i = 0; i < 6; i++) { + if (sextw_mask & (1 << i)) { + SEXT_W(A0 + i, A0 + i); } } - if (w < 0) { - MESSAGE(LOG_DUMP, "Return in XMM0\n"); - sse_get_reg_empty(dyn, ninst, x6, 0, 0); - } - */ - // prepare regs for native call - MV(A0, xRDI); - MV(A1, xRSI); - MV(A2, xRDX); - MV(A3, xRCX); - MV(A4, xR8); - MV(A5, xR9); // native call - TABLE64(16, (uintptr_t)fnc); // using x16 as scratch regs for call address - JALR(16); + if (dyn->need_reloc) { + // fnc is indirect, to help with relocation (but PltResolver might be an issue here) + TABLE64(x3, (uintptr_t)fnc); + LD(x3, x3, 0); + } else { + TABLE64_(x3, *(uintptr_t*)fnc); // using x16 as scratch regs for call address + } + JALR(xRA, x3); // put return value in x64 regs - if(w>0) { + if (w > 0) { MV(xRAX, A0); MV(xRDX, A1); } // all done, restore all regs - LD(xEmu, xSP, 0); - LD(xRIP, xSP, 8); - ADDI(xSP, xSP, 16); - LOAD_REG(R12); - LOAD_REG(R13); - LOAD_REG(R14); - LOAD_REG(R15); - // regenerate mask - XORI(xMASK, xZR, -1); - SRLI(xMASK, xMASK, 32); + + // reinitialize sew + if (dyn->vector_sew != VECTOR_SEWNA) + vector_vsetvli(dyn, ninst, x3, dyn->vector_sew, VECTOR_LMUL1, 1); fpu_popcache(dyn, ninst, x3, 1); - LD(xFlags, xEmu, offsetof(x64emu_t, eflags)); - FLAGS_ADJUST_FROM11(xFlags, xFlags, x3); - //SET_NODF(); + NATIVE_RESTORE_X87PC(); + // SET_NODF(); } void grab_segdata(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, int reg, int segment) @@ -806,32 +698,17 @@ void grab_segdata(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, int reg, int s (void)addr; int64_t j64; MAYUSE(j64); - MESSAGE(LOG_DUMP, "Get %s Offset\n", (segment==_FS)?"FS":"GS"); - int t1 = x1, t2 = x4; - if(reg==t1) ++t1; - if(reg==t2) ++t2; - LWU(t2, xEmu, offsetof(x64emu_t, segs_serial[segment])); + MESSAGE(LOG_DUMP, "Get %s Offset\n", (segment == _FS) ? "FS" : "GS"); LD(reg, xEmu, offsetof(x64emu_t, segs_offs[segment])); - if(segment==_GS) { - CBNZ_MARKSEG(t2); // fast check - } else { - LD(t1, xEmu, offsetof(x64emu_t, context)); - LWU(t1, t1, offsetof(box64context_t, sel_serial)); - SUBW(t1, t1, t2); - CBZ_MARKSEG(t1); - } - MOV64x(x1, segment); - call_c(dyn, ninst, GetSegmentBaseEmu, t2, reg, 0, xFlags); - MARKSEG; - MESSAGE(LOG_DUMP, "----%s Offset\n", (segment==_FS)?"FS":"GS"); + MESSAGE(LOG_DUMP, "----%s Offset\n", (segment == _FS) ? "FS" : "GS"); } int x87_stackcount(dynarec_rv64_t* dyn, int ninst, int scratch) { MAYUSE(scratch); - if(!dyn->e.x87stack) + if (!dyn->e.x87stack) return 0; - if(dyn->e.mmxcount) + if (dyn->e.mmxcount) mmx_purgecache(dyn, ninst, 0, scratch); MESSAGE(LOG_DUMP, "\tSynch x87 Stackcount (%d)\n", dyn->e.x87stack); int a = dyn->e.x87stack; @@ -855,9 +732,9 @@ int x87_stackcount(dynarec_rv64_t* dyn, int ninst, int scratch) void x87_unstackcount(dynarec_rv64_t* dyn, int ninst, int scratch, int count) { MAYUSE(scratch); - if(!count) + if (!count) return; - if(dyn->e.mmxcount) + if (dyn->e.mmxcount) mmx_purgecache(dyn, ninst, 0, scratch); MESSAGE(LOG_DUMP, "\tSynch x87 Unstackcount (%d)\n", count); int a = -count; @@ -880,44 +757,44 @@ int extcache_st_coherency(dynarec_rv64_t* dyn, int ninst, int a, int b) { int i1 = extcache_get_st(dyn, ninst, a); int i2 = extcache_get_st(dyn, ninst, b); - if(i1!=i2) { + if (i1 != i2) { MESSAGE(LOG_DUMP, "Warning, ST cache incoherent between ST%d(%d) and ST%d(%d)\n", a, i1, b, i2); } return i1; } -// On step 1, Float/Double for ST is actualy computed and back-propagated +// On step 1, Float/Double for ST is actually computed and back-propagated // On step 2-3, the value is just read for inst[...].n.neocache[..] // the reg returned is *2 for FLOAT int x87_do_push(dynarec_rv64_t* dyn, int ninst, int s1, int t) { - if(dyn->e.mmxcount) + if (dyn->e.mmxcount) mmx_purgecache(dyn, ninst, 0, s1); - dyn->e.x87stack+=1; - dyn->e.stack+=1; - dyn->e.stack_next+=1; - dyn->e.stack_push+=1; + dyn->e.x87stack += 1; + dyn->e.stack += 1; + dyn->e.stack_next += 1; + dyn->e.stack_push += 1; ++dyn->e.pushed; - if(dyn->e.poped) + if (dyn->e.poped) --dyn->e.poped; // move all regs in cache, and find a free one - for(int j=0; j<24; ++j) + for (int j = 0; j < 24; ++j) if ((dyn->e.extcache[j].t == EXT_CACHE_ST_D) || (dyn->e.extcache[j].t == EXT_CACHE_ST_F) || (dyn->e.extcache[j].t == EXT_CACHE_ST_I64)) ++dyn->e.extcache[j].n; int ret = -1; - dyn->e.tags<<=2; - for(int i=0; i<8; ++i) - if(dyn->e.x87cache[i]!=-1) + dyn->e.tags <<= 2; + for (int i = 0; i < 8; ++i) + if (dyn->e.x87cache[i] != -1) ++dyn->e.x87cache[i]; - else if(ret==-1) { + else if (ret == -1) { dyn->e.x87cache[i] = 0; - ret=dyn->e.x87reg[i]=fpu_get_reg_x87(dyn, t, 0); + ret = dyn->e.x87reg[i] = fpu_get_reg_x87(dyn, t, 0); dyn->e.extcache[EXTIDX(ret)].t = X87_ST0; } - if(ret==-1) { + if (ret == -1) { MESSAGE(LOG_DUMP, "Incoherent x87 stack cache, aborting\n"); dyn->abort = 1; } @@ -925,41 +802,39 @@ int x87_do_push(dynarec_rv64_t* dyn, int ninst, int s1, int t) } void x87_do_push_empty(dynarec_rv64_t* dyn, int ninst, int s1) { - if(dyn->e.mmxcount) + if (dyn->e.mmxcount) mmx_purgecache(dyn, ninst, 0, s1); - dyn->e.x87stack+=1; - dyn->e.stack+=1; - dyn->e.stack_next+=1; - dyn->e.stack_push+=1; + dyn->e.x87stack += 1; + dyn->e.stack += 1; + dyn->e.stack_next += 1; + dyn->e.stack_push += 1; ++dyn->e.pushed; - if(dyn->e.poped) + if (dyn->e.poped) --dyn->e.poped; // move all regs in cache - for(int j=0; j<24; ++j) + for (int j = 0; j < 24; ++j) if ((dyn->e.extcache[j].t == EXT_CACHE_ST_D) || (dyn->e.extcache[j].t == EXT_CACHE_ST_F) || (dyn->e.extcache[j].t == EXT_CACHE_ST_I64)) ++dyn->e.extcache[j].n; int ret = -1; - dyn->e.tags<<=2; - for(int i=0; i<8; ++i) - if(dyn->e.x87cache[i]!=-1) + dyn->e.tags <<= 2; + for (int i = 0; i < 8; ++i) + if (dyn->e.x87cache[i] != -1) ++dyn->e.x87cache[i]; - else if(ret==-1) + else if (ret == -1) ret = i; - if(ret==-1) { + if (ret == -1) { MESSAGE(LOG_DUMP, "Incoherent x87 stack cache, aborting\n"); dyn->abort = 1; } - if(s1) - x87_stackcount(dyn, ninst, s1); } static void internal_x87_dopop(dynarec_rv64_t* dyn) { - for(int i=0; i<8; ++i) - if(dyn->e.x87cache[i]!=-1) { + for (int i = 0; i < 8; ++i) + if (dyn->e.x87cache[i] != -1) { --dyn->e.x87cache[i]; - if(dyn->e.x87cache[i]==-1) { + if (dyn->e.x87cache[i] == -1) { fpu_free_reg(dyn, dyn->e.x87reg[i]); dyn->e.x87reg[i] = -1; } @@ -967,7 +842,7 @@ static void internal_x87_dopop(dynarec_rv64_t* dyn) } static int internal_x87_dofree(dynarec_rv64_t* dyn) { - if(dyn->e.tags&0b11) { + if (dyn->e.tags & 0b11) { MESSAGE(LOG_DUMP, "\t--------x87 FREED ST0, poping 1 more\n"); return 1; } @@ -975,34 +850,34 @@ static int internal_x87_dofree(dynarec_rv64_t* dyn) } void x87_do_pop(dynarec_rv64_t* dyn, int ninst, int s1) { - if(dyn->e.mmxcount) + if (dyn->e.mmxcount) mmx_purgecache(dyn, ninst, 0, s1); do { - dyn->e.x87stack-=1; - dyn->e.stack_next-=1; - dyn->e.stack_pop+=1; - dyn->e.tags>>=2; + dyn->e.x87stack -= 1; + dyn->e.stack_next -= 1; + dyn->e.stack_pop += 1; + dyn->e.tags >>= 2; ++dyn->e.poped; - if(dyn->e.pushed) + if (dyn->e.pushed) --dyn->e.pushed; // move all regs in cache, poping ST0 internal_x87_dopop(dyn); - } while(internal_x87_dofree(dyn)); + } while (internal_x87_dofree(dyn)); } void x87_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1, int s2, int s3) { int ret = 0; - for (int i=0; i<8 && !ret; ++i) - if(dyn->e.x87cache[i] != -1) + for (int i = 0; i < 8 && !ret; ++i) + if (dyn->e.x87cache[i] != -1) ret = 1; - if(!ret && !dyn->e.x87stack) // nothing to do + if (!ret && !dyn->e.x87stack) // nothing to do return; - MESSAGE(LOG_DUMP, "\tPurge %sx87 Cache and Synch Stackcount (%+d)---\n", next?"locally ":"", dyn->e.x87stack); + MESSAGE(LOG_DUMP, "\tPurge %sx87 Cache and Synch Stackcount (%+d)---\n", next ? "locally " : "", dyn->e.x87stack); int a = dyn->e.x87stack; - if(a!=0) { + if (a != 0) { // reset x87stack - if(!next) + if (!next) dyn->e.x87stack = 0; // Add x87stack to emu fpu_stack LW(s2, xEmu, offsetof(x64emu_t, fpu_stack)); @@ -1011,95 +886,125 @@ void x87_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1, int s2, in // Sub x87stack to top, with and 7 LW(s2, xEmu, offsetof(x64emu_t, top)); // update tags (and top at the same time) - if(a>0) { - SUBI(s2, s2, a); - } else { - ADDI(s2, s2, -a); - } + SUBI(s2, s2, a); ANDI(s2, s2, 7); SW(s2, xEmu, offsetof(x64emu_t, top)); // update tags (and top at the same time) LHU(s1, xEmu, offsetof(x64emu_t, fpu_tags)); - if(a>0) { - SLLI(s1, s1, a*2); + if (a > 0) { + SLLI(s1, s1, a * 2); } else { - SLLI(s3, xMASK, 16); // 0xffff0000 (plus some unused hipart) + LUI(s3, 0xffff0); OR(s1, s1, s3); - SRLI(s1, s1, -a*2); + SRLI(s1, s1, -a * 2); } SH(s1, xEmu, offsetof(x64emu_t, fpu_tags)); } else { LW(s2, xEmu, offsetof(x64emu_t, top)); } // check if free is used - if(dyn->e.tags) { + if (dyn->e.tags) { LH(s1, xEmu, offsetof(x64emu_t, fpu_tags)); MOV32w(s3, dyn->e.tags); OR(s1, s1, s3); SH(s1, xEmu, offsetof(x64emu_t, fpu_tags)); } - if(ret!=0) { + if (ret != 0) { // --- set values // Get top // loop all cache entries - for (int i=0; i<8; ++i) - if(dyn->e.x87cache[i]!=-1) { - int st = dyn->e.x87cache[i]+dyn->e.stack_pop; - #if STEP == 1 - if(!next) { // don't force promotion here + for (int i = 0; i < 8; ++i) + if (dyn->e.x87cache[i] != -1) { + int st = dyn->e.x87cache[i] + dyn->e.stack_pop; +#if STEP == 1 + if (!next) { // don't force promotion here // pre-apply pop, because purge happens in-between extcache_promote_double(dyn, ninst, st); } - #endif - #if STEP == 3 - if(!next && extcache_get_current_st(dyn, ninst, st) != EXT_CACHE_ST_D) { +#endif +#if STEP == 3 + if (!next && extcache_get_current_st(dyn, ninst, st) != EXT_CACHE_ST_D) { MESSAGE(LOG_DUMP, "Warning, incoherency with purged ST%d cache\n", st); } - #endif +#endif ADDI(s3, s2, dyn->e.x87cache[i]); // unadjusted count, as it's relative to real top - ANDI(s3, s3, 7); // (emu->top + st)&7 - if(rv64_zba) SH3ADD(s1, s3, xEmu); else {SLLI(s1, s3, 3); ADD(s1, xEmu, s1);} - switch(extcache_get_current_st(dyn, ninst, st)) { + ANDI(s3, s3, 7); // (emu->top + st)&7 + if (cpuext.zba) + SH3ADD(s1, s3, xEmu); + else { + SLLI(s1, s3, 3); + ADD(s1, xEmu, s1); + } + switch (extcache_get_current_st(dyn, ninst, st)) { case EXT_CACHE_ST_D: - FSD(dyn->e.x87reg[i], s1, offsetof(x64emu_t, x87)); // save the value + FSD(dyn->e.x87reg[i], s1, offsetof(x64emu_t, x87)); // save the value break; case EXT_CACHE_ST_F: FCVTDS(SCRATCH0, dyn->e.x87reg[i]); - FSD(SCRATCH0, s1, offsetof(x64emu_t, x87)); // save the value + FSD(SCRATCH0, s1, offsetof(x64emu_t, x87)); // save the value break; case EXT_CACHE_ST_I64: FMVXD(s2, dyn->e.x87reg[i]); FCVTDL(SCRATCH0, s2, RD_RTZ); - FSD(SCRATCH0, s1, offsetof(x64emu_t, x87)); // save the value + FSD(SCRATCH0, s1, offsetof(x64emu_t, x87)); // save the value break; } - if(!next) { + if (!next) { fpu_free_reg(dyn, dyn->e.x87reg[i]); dyn->e.x87reg[i] = -1; dyn->e.x87cache[i] = -1; - //dyn->e.stack_pop+=1; //no pop, but the purge because of barrier will have the n.barrier flags set + // dyn->e.stack_pop+=1; //no pop, but the purge because of barrier will have the n.barrier flags set } } } - if(!next) { + if (!next) { dyn->e.stack_next = 0; dyn->e.tags = 0; - #if STEP < 2 +#if STEP < 2 // refresh the cached valued, in case it's a purge outside a instruction dyn->insts[ninst].e.barrier = 1; dyn->e.pushed = 0; dyn->e.poped = 0; - #endif +#endif } MESSAGE(LOG_DUMP, "\t---Purge x87 Cache and Synch Stackcount\n"); } + +void x87_reflectcount(dynarec_rv64_t* dyn, int ninst, int s1, int s2) +{ + // Synch top and stack count + int a = dyn->e.x87stack; + if (a) { + MESSAGE(LOG_DUMP, "\tSync x87 Count of %d-----\n", a); + // Add x87stack to emu fpu_stack + LW(s2, xEmu, offsetof(x64emu_t, fpu_stack)); + ADDI(s2, s2, a); + SW(s2, xEmu, offsetof(x64emu_t, fpu_stack)); + // Sub x87stack to top, with and 7 + LW(s2, xEmu, offsetof(x64emu_t, top)); + SUBI(s2, s2, a); + ANDI(s2, s2, 7); + SW(s2, xEmu, offsetof(x64emu_t, top)); + // update tags + LH(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + if (a > 0) { + SLLI(s1, s1, a * 2); + } else { + MOV32w(s2, 0xffff0000); + OR(s1, s1, s2); + SRLI(s1, s1, -a * 2); + } + SH(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + } +} + static void x87_reflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3) { - //Sync top and stack count + // Sync top and stack count int a = dyn->e.x87stack; - if(a) { + if (a) { // Add x87stack to emu fpu_stack LW(s2, xEmu, offsetof(x64emu_t, fpu_stack)); ADDI(s2, s2, a); @@ -1111,33 +1016,38 @@ static void x87_reflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int SW(s2, xEmu, offsetof(x64emu_t, top)); // update tags (and top at the same time) LH(s1, xEmu, offsetof(x64emu_t, fpu_tags)); - if(a>0) { - SLLI(s1, s1, a*2); + if (a > 0) { + SLLI(s1, s1, a * 2); } else { - SLLI(s3, xMASK, 16); // 0xffff0000 + MOV32w(s3, 0xffff0000); OR(s1, s1, s3); - SRLI(s1, s1, -a*2); + SRLI(s1, s1, -a * 2); } SH(s1, xEmu, offsetof(x64emu_t, fpu_tags)); } int ret = 0; - for (int i=0; (i<8) && (!ret); ++i) - if(dyn->e.x87cache[i] != -1) + for (int i = 0; (i < 8) && (!ret); ++i) + if (dyn->e.x87cache[i] != -1) ret = 1; - if(!ret) // nothing to do + if (!ret) // nothing to do return; // prepare offset to fpu => s1 // Get top - if(!a) { + if (!a) { LW(s2, xEmu, offsetof(x64emu_t, top)); } // loop all cache entries - for (int i=0; i<8; ++i) - if(dyn->e.x87cache[i]!=-1) { + for (int i = 0; i < 8; ++i) + if (dyn->e.x87cache[i] != -1) { ADDI(s3, s2, dyn->e.x87cache[i]); - ANDI(s3, s3, 7); // (emu->top + i)&7 - if(rv64_zba) SH3ADD(s1, s3, xEmu); else {SLLI(s1, s3, 3); ADD(s1, xEmu, s1);} - if(extcache_get_st_f(dyn, ninst, dyn->e.x87cache[i])>=0) { + ANDI(s3, s3, 7); // (emu->top + i)&7 + if (cpuext.zba) + SH3ADD(s1, s3, xEmu); + else { + SLLI(s1, s3, 3); + ADD(s1, xEmu, s1); + } + if (extcache_get_current_st_f(dyn, dyn->e.x87cache[i]) >= 0) { FCVTDS(SCRATCH0, dyn->e.x87reg[i]); FSD(SCRATCH0, s1, offsetof(x64emu_t, x87)); } else @@ -1145,11 +1055,11 @@ static void x87_reflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int } } -static void x87_unreflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3) +void x87_unreflectcount(dynarec_rv64_t* dyn, int ninst, int s1, int s2) { // revert top and stack count int a = dyn->e.x87stack; - if(a) { + if (a) { // Sub x87stack to emu fpu_stack LW(s2, xEmu, offsetof(x64emu_t, fpu_stack)); SUBI(s2, s2, a); @@ -1159,22 +1069,25 @@ static void x87_unreflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, i ADDI(s2, s2, a); ANDI(s2, s2, 7); SW(s2, xEmu, offsetof(x64emu_t, top)); - if(a>0) { - SLLI(s3, xMASK, 16); // 0xffff0000 - OR(s1, s1, s3); - SRLI(s1, s1, a*2); + // update tags + LH(s1, xEmu, offsetof(x64emu_t, fpu_tags)); + if (a > 0) { + MOV32w(s2, 0xffff0000); + OR(s1, s1, s2); + SRLI(s1, s1, a * 2); } else { - SLLI(s1, s1, -a*2); + SLLI(s1, s1, -a * 2); } + SH(s1, xEmu, offsetof(x64emu_t, fpu_tags)); } } int x87_get_current_cache(dynarec_rv64_t* dyn, int ninst, int st, int t) { // search in cache first - for (int i=0; i<8; ++i) { - if(dyn->e.x87cache[i]==st) { - #if STEP == 1 + for (int i = 0; i < 8; ++i) { + if (dyn->e.x87cache[i] == st) { +#if STEP == 1 if (t == EXT_CACHE_ST_D && (dyn->e.extcache[EXTIDX(dyn->e.x87reg[i])].t == EXT_CACHE_ST_F || dyn->e.extcache[EXTIDX(dyn->e.x87reg[i])].t == EXT_CACHE_ST_I64)) extcache_promote_double(dyn, ninst, st); else if (t == EXT_CACHE_ST_I64 && (dyn->e.extcache[EXTIDX(dyn->e.x87reg[i])].t == EXT_CACHE_ST_F)) @@ -1184,34 +1097,39 @@ int x87_get_current_cache(dynarec_rv64_t* dyn, int ninst, int st, int t) #endif return i; } - assert(dyn->e.x87cache[i]<8); + assert(dyn->e.x87cache[i] < 8); } return -1; } int x87_get_cache(dynarec_rv64_t* dyn, int ninst, int populate, int s1, int s2, int st, int t) { - if(dyn->e.mmxcount) + if (dyn->e.mmxcount) mmx_purgecache(dyn, ninst, 0, s1); int ret = x87_get_current_cache(dyn, ninst, st, t); - if(ret!=-1) + if (ret != -1) return ret; - MESSAGE(LOG_DUMP, "\tCreate %sx87 Cache for ST%d\n", populate?"and populate ":"", st); + MESSAGE(LOG_DUMP, "\tCreate %sx87 Cache for ST%d\n", populate ? "and populate " : "", st); // get a free spot - for (int i=0; (i<8) && (ret==-1); ++i) - if(dyn->e.x87cache[i]==-1) + for (int i = 0; (i < 8) && (ret == -1); ++i) + if (dyn->e.x87cache[i] == -1) ret = i; // found, setup and grab the value dyn->e.x87cache[ret] = st; dyn->e.x87reg[ret] = fpu_get_reg_x87(dyn, EXT_CACHE_ST_D, st); - if(populate) { + if (populate) { LW(s2, xEmu, offsetof(x64emu_t, top)); int a = st - dyn->e.x87stack; - if(a) { + if (a) { ADDI(s2, s2, a); ANDI(s2, s2, 7); } - if(rv64_zba) SH3ADD(s1, s2, xEmu); else {SLLI(s2, s2, 3); ADD(s1, xEmu, s2);} + if (cpuext.zba) + SH3ADD(s1, s2, xEmu); + else { + SLLI(s2, s2, 3); + ADD(s1, xEmu, s2); + } FLD(dyn->e.x87reg[ret], s1, offsetof(x64emu_t, x87)); } MESSAGE(LOG_DUMP, "\t-------x87 Cache for ST%d\n", st); @@ -1220,7 +1138,7 @@ int x87_get_cache(dynarec_rv64_t* dyn, int ninst, int populate, int s1, int s2, } int x87_get_extcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st) { - for(int ii=0; ii<24; ++ii) + for (int ii = 0; ii < 24; ++ii) if ((dyn->e.extcache[ii].t == EXT_CACHE_ST_F || dyn->e.extcache[ii].t == EXT_CACHE_ST_D || dyn->e.extcache[ii].t == EXT_CACHE_ST_I64) @@ -1242,10 +1160,10 @@ int x87_get_st_empty(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int a, int void x87_refresh(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st) { int ret = -1; - for (int i=0; (i<8) && (ret==-1); ++i) - if(dyn->e.x87cache[i] == st) + for (int i = 0; (i < 8) && (ret == -1); ++i) + if (dyn->e.x87cache[i] == st) ret = i; - if(ret==-1) // nothing to do + if (ret == -1) // nothing to do return; MESSAGE(LOG_DUMP, "\tRefresh x87 Cache for ST%d\n", st); const int reg = dyn->e.x87reg[ret]; @@ -1254,11 +1172,16 @@ void x87_refresh(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st) LW(s2, xEmu, offsetof(x64emu_t, top)); // Update int a = st - dyn->e.x87stack; - if(a) { + if (a) { ADDI(s2, s2, a); - ANDI(s2, s2, 7); // (emu->top + i)&7 + ANDI(s2, s2, 7); // (emu->top + i)&7 + } + if (cpuext.zba) + SH3ADD(s1, s2, xEmu); + else { + SLLI(s2, s2, 3); + ADD(s1, xEmu, s2); } - if(rv64_zba) SH3ADD(s1, s2, xEmu); else {SLLI(s2, s2, 3); ADD(s1, xEmu, s2);} if (dyn->e.extcache[EXTIDX(reg)].t == EXT_CACHE_ST_F) { FCVTDS(SCRATCH0, reg); FSD(SCRATCH0, s1, offsetof(x64emu_t, x87)); @@ -1275,28 +1198,33 @@ void x87_refresh(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st) void x87_forget(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st) { int ret = -1; - for (int i=0; (i<8) && (ret==-1); ++i) - if(dyn->e.x87cache[i] == st) + for (int i = 0; (i < 8) && (ret == -1); ++i) + if (dyn->e.x87cache[i] == st) ret = i; - if(ret==-1) // nothing to do + if (ret == -1) // nothing to do return; MESSAGE(LOG_DUMP, "\tForget x87 Cache for ST%d\n", st); const int reg = dyn->e.x87reg[ret]; - #if STEP == 1 +#if STEP == 1 if (dyn->e.extcache[EXTIDX(dyn->e.x87reg[ret])].t == EXT_CACHE_ST_F || dyn->e.extcache[EXTIDX(dyn->e.x87reg[ret])].t == EXT_CACHE_ST_I64) extcache_promote_double(dyn, ninst, st); - #endif +#endif // prepare offset to fpu => s1 // Get top LW(s2, xEmu, offsetof(x64emu_t, top)); // Update int a = st - dyn->e.x87stack; - if(a) { + if (a) { ADDI(s2, s2, a); - ANDI(s2, s2, 7); // (emu->top + i)&7 + ANDI(s2, s2, 7); // (emu->top + i)&7 + } + if (cpuext.zba) + SH3ADD(s1, s2, xEmu); + else { + SLLI(s2, s2, 3); + ADD(s1, xEmu, s2); } - if(rv64_zba) SH3ADD(s1, s2, xEmu); else {SLLI(s2, s2, 3); ADD(s1, xEmu, s2);} if (dyn->e.extcache[EXTIDX(reg)].t == EXT_CACHE_ST_F) { FCVTDS(SCRATCH0, reg); FSD(SCRATCH0, s1, offsetof(x64emu_t, x87)); @@ -1317,25 +1245,30 @@ void x87_forget(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st) void x87_reget_st(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st) { - if(dyn->e.mmxcount) + if (dyn->e.mmxcount) mmx_purgecache(dyn, ninst, 0, s1); // search in cache first - for (int i=0; i<8; ++i) - if(dyn->e.x87cache[i]==st) { + for (int i = 0; i < 8; ++i) + if (dyn->e.x87cache[i] == st) { // refresh the value MESSAGE(LOG_DUMP, "\tRefresh x87 Cache for ST%d\n", st); - #if STEP == 1 +#if STEP == 1 if (dyn->e.extcache[EXTIDX(dyn->e.x87reg[i])].t == EXT_CACHE_ST_F || dyn->e.extcache[EXTIDX(dyn->e.x87reg[i])].t == EXT_CACHE_ST_I64) extcache_promote_double(dyn, ninst, st); - #endif +#endif LW(s2, xEmu, offsetof(x64emu_t, top)); int a = st - dyn->e.x87stack; - if(a) { + if (a) { ADDI(s2, s2, a); AND(s2, s2, 7); } - if(rv64_zba) SH3ADD(s1, s2, xEmu); else {SLLI(s2, s2, 3); ADD(s1, xEmu, s2);} + if (cpuext.zba) + SH3ADD(s1, s2, xEmu); + else { + SLLI(s2, s2, 3); + ADD(s1, xEmu, s2); + } FLD(dyn->e.x87reg[i], s1, offsetof(x64emu_t, x87)); MESSAGE(LOG_DUMP, "\t-------x87 Cache for ST%d\n", st); // ok @@ -1345,8 +1278,8 @@ void x87_reget_st(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st) MESSAGE(LOG_DUMP, "\tCreate x87 Cache for ST%d\n", st); // get a free spot int ret = -1; - for (int i=0; (i<8) && (ret==-1); ++i) - if(dyn->e.x87cache[i]==-1) + for (int i = 0; (i < 8) && (ret == -1); ++i) + if (dyn->e.x87cache[i] == -1) ret = i; // found, setup and grab the value dyn->e.x87cache[ret] = st; @@ -1354,8 +1287,13 @@ void x87_reget_st(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st) LW(s2, xEmu, offsetof(x64emu_t, top)); int a = st - dyn->e.x87stack; ADDI(s2, s2, a); - ANDI(s2, s2, 7); // (emu->top + i)&7 - if(rv64_zba) SH3ADD(s1, s2, xEmu); else {SLLI(s2, s2, 3); ADD(s1, xEmu, s2);} + ANDI(s2, s2, 7); // (emu->top + i)&7 + if (cpuext.zba) + SH3ADD(s1, s2, xEmu); + else { + SLLI(s2, s2, 3); + ADD(s1, xEmu, s2); + } FLD(dyn->e.x87reg[ret], s1, offsetof(x64emu_t, x87)); MESSAGE(LOG_DUMP, "\t-------x87 Cache for ST%d\n", st); } @@ -1363,29 +1301,34 @@ void x87_reget_st(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int st) void x87_free(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int st) { int ret = -1; - for (int i=0; (i<8) && (ret==-1); ++i) - if(dyn->e.x87cache[i] == st) + for (int i = 0; (i < 8) && (ret == -1); ++i) + if (dyn->e.x87cache[i] == st) ret = i; - MESSAGE(LOG_DUMP, "\tFFREE%s x87 Cache for ST%d\n", (ret!=-1)?" (and Forget)":"", st); - if(ret!=-1) { + MESSAGE(LOG_DUMP, "\tFFREE%s x87 Cache for ST%d\n", (ret != -1) ? " (and Forget)" : "", st); + if (ret != -1) { const int reg = dyn->e.x87reg[ret]; - #if STEP == 1 - if(dyn->e.extcache[reg].t==EXT_CACHE_ST_F || dyn->e.extcache[reg].t==EXT_CACHE_ST_I64) +#if STEP == 1 + if (dyn->e.extcache[reg].t == EXT_CACHE_ST_F || dyn->e.extcache[reg].t == EXT_CACHE_ST_I64) extcache_promote_double(dyn, ninst, st); - #endif +#endif // Get top LW(s2, xEmu, offsetof(x64emu_t, top)); // Update int ast = st - dyn->e.x87stack; - if(ast) { - if(ast>0) { + if (ast) { + if (ast > 0) { ADDI(s2, s2, ast); } else { SUBI(s2, s2, -ast); } ANDI(s2, s2, 7); // (emu->top + i)&7 } - if(rv64_zba) SH3ADD(s1, s2, xEmu); else {SLLI(s2, s2, 3); ADD(s1, xEmu, s2);} + if (cpuext.zba) + SH3ADD(s1, s2, xEmu); + else { + SLLI(s2, s2, 3); + ADD(s1, xEmu, s2); + } if (dyn->e.extcache[EXTIDX(reg)].t == EXT_CACHE_ST_F) { FCVTDS(SCRATCH0, reg); FSD(SCRATCH0, s1, offsetof(x64emu_t, x87)); @@ -1406,17 +1349,17 @@ void x87_free(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int st) LW(s2, xEmu, offsetof(x64emu_t, top)); // Update int ast = st - dyn->e.x87stack; - if(ast) { - if(ast>0) { + if (ast) { + if (ast > 0) { ADDI(s2, s2, ast); } else { SUBI(s2, s2, -ast); } - ANDI(s2, s2, 7); // (emu->top + i)&7 + ANDI(s2, s2, 7); // (emu->top + i)&7 } } // add mark in the freed array - dyn->e.tags |= 0b11<<(st*2); + dyn->e.tags |= 0b11 << (st * 2); MESSAGE(LOG_DUMP, "\t--------x87 FFREE for ST%d\n", st); } @@ -1437,14 +1380,17 @@ void x87_swapreg(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int a, int b) dyn->e.extcache[j2].n = j3; // mark as swapped dyn->e.swapped = 1; - dyn->e.combined1= a; dyn->e.combined2=b; + dyn->e.combined1 = a; + dyn->e.combined2 = b; } // Set rounding according to cw flags, return reg to restore flags int x87_setround(dynarec_rv64_t* dyn, int ninst, int s1, int s2) { - MAYUSE(dyn); MAYUSE(ninst); - MAYUSE(s1); MAYUSE(s2); + MAYUSE(dyn); + MAYUSE(ninst); + MAYUSE(s1); + MAYUSE(s2); LW(s1, xEmu, offsetof(x64emu_t, cw)); SRLI(s1, s1, 10); ANDI(s1, s1, 0b11); @@ -1458,15 +1404,17 @@ int x87_setround(dynarec_rv64_t* dyn, int ninst, int s1, int s2) J(8); ADDI(s1, xZR, 1); // transform done (is there a faster way?) - FSRM(s1, s1); // exange RM with current + FSRM(s1, s1); // exange RM with current return s1; } // Set rounding according to mxcsr flags, return reg to restore flags int sse_setround(dynarec_rv64_t* dyn, int ninst, int s1, int s2) { - MAYUSE(dyn); MAYUSE(ninst); - MAYUSE(s1); MAYUSE(s2); + MAYUSE(dyn); + MAYUSE(ninst); + MAYUSE(s1); + MAYUSE(s2); LW(s1, xEmu, offsetof(x64emu_t, mxcsr)); SRLI(s1, s1, 13); ANDI(s1, s1, 0b11); @@ -1480,91 +1428,172 @@ int sse_setround(dynarec_rv64_t* dyn, int ninst, int s1, int s2) J(8); ADDI(s1, xZR, 1); // transform done (is there a faster way?) - FSRM(s1, s1); // exange RM with current + FSRM(s1, s1); // exange RM with current return s1; } // Restore round flag, destroy s1 doing so void x87_restoreround(dynarec_rv64_t* dyn, int ninst, int s1) { - MAYUSE(dyn); MAYUSE(ninst); + MAYUSE(dyn); + MAYUSE(ninst); MAYUSE(s1); - FSRM(s1, s1); // put back fpscr + FSRM(s1, s1); // put back fpscr } // MMX helpers static int isx87Empty(dynarec_rv64_t* dyn) { - for (int i=0; i<8; ++i) - if(dyn->e.x87cache[i] != -1) + for (int i = 0; i < 8; ++i) + if (dyn->e.x87cache[i] != -1) return 0; return 1; } // forget ext register for a MMX reg, does nothing if the regs is not loaded -void mmx_forget_reg(dynarec_rv64_t* dyn, int ninst, int a) +void mmx_forget_reg(dynarec_rv64_t* dyn, int ninst, int s1, int a) +{ + if (dyn->e.mmxcache[a].v == -1) + return; + if (dyn->e.mmxcache[a].vector) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEW64, 1); + VFMV_F_S(dyn->e.mmxcache[a].reg, dyn->e.mmxcache[a].reg); + } + FSD(dyn->e.mmxcache[a].reg, xEmu, offsetof(x64emu_t, mmx[a])); + fpu_free_reg(dyn, dyn->e.mmxcache[a].reg); + dyn->e.mmxcache[a].v = -1; + return; +} + +static void mmx_transfer_reg(dynarec_rv64_t* dyn, int ninst, int s1, int a) { - if (dyn->e.mmxcache[a] == -1) + if (dyn->e.mmxcache[a].v == -1) return; - FSD(dyn->e.mmxcache[a], xEmu, offsetof(x64emu_t, mmx[a])); - fpu_free_reg(dyn, dyn->e.mmxcache[a]); + + SET_ELEMENT_WIDTH(s1, VECTOR_SEW64, 1); + if (dyn->e.mmxcache[a].vector) { + VFMV_F_S(dyn->e.mmxcache[a].reg, dyn->e.mmxcache[a].reg); + } else { + VFMV_S_F(dyn->e.mmxcache[a].reg, dyn->e.mmxcache[a].reg); + } + dyn->e.mmxcache[a].vector = 1 - dyn->e.mmxcache[a].vector; + dyn->e.extcache[EXTIDX(dyn->e.mmxcache[a].reg)].t = dyn->e.mmxcache[a].vector ? EXT_CACHE_MMV : EXT_CACHE_MM; return; } -// get neon register for a MMX reg, create the entry if needed +// get float register for a MMX reg, create the entry if needed int mmx_get_reg(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int a) { - if(!dyn->e.x87stack && isx87Empty(dyn)) + if (!dyn->e.x87stack && isx87Empty(dyn)) x87_purgecache(dyn, ninst, 0, s1, s2, s3); - if(dyn->e.mmxcache[a]!=-1) - return dyn->e.mmxcache[a]; + if (dyn->e.mmxcache[a].v != -1) { + if (dyn->e.mmxcache[a].vector) { + mmx_transfer_reg(dyn, ninst, s1, a); + } + return dyn->e.mmxcache[a].reg; + } + ++dyn->e.mmxcount; - int ret = dyn->e.mmxcache[a] = fpu_get_reg_emm(dyn, a); - FLD(ret, xEmu, offsetof(x64emu_t, mmx[a])); - return ret; + dyn->e.mmxcache[a].reg = fpu_get_reg_emm(dyn, EXT_CACHE_MM, a); + dyn->e.mmxcache[a].vector = 0; + FLD(dyn->e.mmxcache[a].reg, xEmu, offsetof(x64emu_t, mmx[a])); + return dyn->e.mmxcache[a].reg; } -// get neon register for a MMX reg, but don't try to synch it if it needed to be created + +// get vector register for a MMX reg, create the entry if needed +int mmx_get_reg_vector(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int a) +{ + if (!dyn->e.x87stack && isx87Empty(dyn)) + x87_purgecache(dyn, ninst, 0, s1, s2, s3); + if (dyn->e.mmxcache[a].v != -1) { + if (!dyn->e.mmxcache[a].vector) { + mmx_transfer_reg(dyn, ninst, s1, a); + } + return dyn->e.mmxcache[a].reg; + } + + ++dyn->e.mmxcount; + dyn->e.mmxcache[a].reg = fpu_get_reg_emm(dyn, EXT_CACHE_MMV, a); + dyn->e.mmxcache[a].vector = 1; + FLD(dyn->e.mmxcache[a].reg, xEmu, offsetof(x64emu_t, mmx[a])); + SET_ELEMENT_WIDTH(s1, VECTOR_SEW64, 1); + VFMV_S_F(dyn->e.mmxcache[a].reg, dyn->e.mmxcache[a].reg); + return dyn->e.mmxcache[a].reg; +} + +// get float register for a MMX reg, but don't try to synch it if it needed to be created int mmx_get_reg_empty(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int a) { - if(!dyn->e.x87stack && isx87Empty(dyn)) + if (!dyn->e.x87stack && isx87Empty(dyn)) x87_purgecache(dyn, ninst, 0, s1, s2, s3); - if(dyn->e.mmxcache[a]!=-1) - return dyn->e.mmxcache[a]; + if (dyn->e.mmxcache[a].v != -1) { + dyn->e.mmxcache[a].vector = 0; + dyn->e.extcache[EXTIDX(dyn->e.mmxcache[a].reg)].t = EXT_CACHE_MM; + return dyn->e.mmxcache[a].reg; + } + ++dyn->e.mmxcount; - int ret = dyn->e.mmxcache[a] = fpu_get_reg_emm(dyn, a); - return ret; + dyn->e.mmxcache[a].vector = 0; + return dyn->e.mmxcache[a].reg = fpu_get_reg_emm(dyn, EXT_CACHE_MM, a); } + +// get vector register for a MMX reg, but don't try to synch it if it needed to be created +int mmx_get_reg_empty_vector(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int a) +{ + if (!dyn->e.x87stack && isx87Empty(dyn)) + x87_purgecache(dyn, ninst, 0, s1, s2, s3); + if (dyn->e.mmxcache[a].v != -1) { + dyn->e.mmxcache[a].vector = 1; + dyn->e.extcache[EXTIDX(dyn->e.mmxcache[a].reg)].t = EXT_CACHE_MMV; + return dyn->e.mmxcache[a].reg; + } + + ++dyn->e.mmxcount; + dyn->e.mmxcache[a].vector = 1; + return dyn->e.mmxcache[a].reg = fpu_get_reg_emm(dyn, EXT_CACHE_MMV, a); +} + // purge the MMX cache only(needs 3 scratch registers) void mmx_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1) { - if(!dyn->e.mmxcount) + if (!dyn->e.mmxcount) return; - if(!next) + if (!next) dyn->e.mmxcount = 0; int old = -1; - for (int i=0; i<8; ++i) - if(dyn->e.mmxcache[i]!=-1) { - if (old==-1) { - MESSAGE(LOG_DUMP, "\tPurge %sMMX Cache ------\n", next?"locally ":""); + for (int i = 0; i < 8; ++i) { + if (dyn->e.mmxcache[i].v != -1) { + if (old == -1) { + MESSAGE(LOG_DUMP, "\tPurge %sMMX Cache ------\n", next ? "locally " : ""); ++old; } - FSD(dyn->e.mmxcache[i], xEmu, offsetof(x64emu_t, mmx[i])); - if(!next) { - fpu_free_reg(dyn, dyn->e.mmxcache[i]); - dyn->e.mmxcache[i] = -1; + if (dyn->e.mmxcache[i].vector) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEW64, 1); + VFMV_F_S(dyn->e.mmxcache[i].reg, dyn->e.mmxcache[i].reg); + } + FSD(dyn->e.mmxcache[i].reg, xEmu, offsetof(x64emu_t, mmx[i])); + if (!next) { + fpu_free_reg(dyn, dyn->e.mmxcache[i].reg); + dyn->e.mmxcache[i].v = -1; } } - if(old!=-1) { + } + if (old != -1) { MESSAGE(LOG_DUMP, "\t------ Purge MMX Cache\n"); } } static void mmx_reflectcache(dynarec_rv64_t* dyn, int ninst, int s1) { - for (int i=0; i<8; ++i) - if(dyn->e.mmxcache[i]!=-1) { - FLD(dyn->e.mmxcache[i], xEmu, offsetof(x64emu_t, mmx[i])); + for (int i = 0; i < 8; ++i) { + if (dyn->e.mmxcache[i].v != -1) { + if (dyn->e.mmxcache[i].vector) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEW64, 1); + VFMV_F_S(dyn->e.mmxcache[i].reg, dyn->e.mmxcache[i].reg); + } + FSD(dyn->e.mmxcache[i].reg, xEmu, offsetof(x64emu_t, mmx[i])); } + } } // SSE / SSE2 helpers @@ -1575,24 +1604,27 @@ int sse_get_reg(dynarec_rv64_t* dyn, int ninst, int s1, int a, int single) if (dyn->e.ssecache[a].vector == 1) { // it's in the fpu, forget it first... sse_forget_reg_vector(dyn, ninst, s1, a); + // update olds after the forget... + dyn->e.olds[a].changed = 1; + dyn->e.olds[a].purged = 0; return sse_get_reg(dyn, ninst, s1, a, single); } // forget / reload if change of size - if(dyn->e.ssecache[a].single!=single) { + if (dyn->e.ssecache[a].single != single) { sse_forget_reg(dyn, ninst, s1, a); // update olds after the forget... dyn->e.olds[a].changed = 1; dyn->e.olds[a].purged = 0; - dyn->e.olds[a].single = 1-single; + dyn->e.olds[a].type = 1 - single; return sse_get_reg(dyn, ninst, s1, a, single); } return dyn->e.ssecache[a].reg; } - dyn->e.ssecache[a].reg = fpu_get_reg_xmm(dyn, single?EXT_CACHE_SS:EXT_CACHE_SD, a); - int ret = dyn->e.ssecache[a].reg; + dyn->e.ssecache[a].reg = fpu_get_reg_xmm(dyn, single ? EXT_CACHE_SS : EXT_CACHE_SD, a); + int ret = dyn->e.ssecache[a].reg; dyn->e.ssecache[a].single = single; dyn->e.ssecache[a].vector = 0; - if(dyn->e.ssecache[a].single) + if (dyn->e.ssecache[a].single) FLW(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a])); else FLD(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a])); @@ -1604,32 +1636,73 @@ int sse_get_reg_empty(dynarec_rv64_t* dyn, int ninst, int s1, int a, int single) { if (dyn->e.ssecache[a].v != -1) { if (dyn->e.ssecache[a].vector == 1) { - // it's in the fpu, forget it first... + // it's in the vpu, forget it first... sse_forget_reg_vector(dyn, ninst, s1, a); + // update olds after the forget... + dyn->e.olds[a].changed = 1; + dyn->e.olds[a].purged = 0; return sse_get_reg_empty(dyn, ninst, s1, a, single); } if (dyn->e.ssecache[a].single != single) { if (single) { - // writing back the double, to clear upper 32 bit. - FSD(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a])); + // writing back the float + FSW(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a])); + // there is no need to clear upper bits, it's cleared manually when needed. } dyn->e.olds[a].changed = 1; dyn->e.olds[a].purged = 0; dyn->e.olds[a].reg = EXTIDX(dyn->e.ssecache[a].reg); - dyn->e.olds[a].single = 1-single; + dyn->e.olds[a].type = 1 - single; dyn->e.ssecache[a].single = single; dyn->e.ssecache[a].vector = 0; - dyn->e.extcache[EXTIDX(dyn->e.ssecache[a].reg)].t = single?EXT_CACHE_SS:EXT_CACHE_SD; + dyn->e.extcache[EXTIDX(dyn->e.ssecache[a].reg)].t = single ? EXT_CACHE_SS : EXT_CACHE_SD; } return dyn->e.ssecache[a].reg; } - dyn->e.ssecache[a].reg = fpu_get_reg_xmm(dyn, single?EXT_CACHE_SS:EXT_CACHE_SD, a); + dyn->e.ssecache[a].reg = fpu_get_reg_xmm(dyn, single ? EXT_CACHE_SS : EXT_CACHE_SD, a); dyn->e.ssecache[a].single = single; dyn->e.ssecache[a].vector = 0; return dyn->e.ssecache[a].reg; } +// get an ext register for an SSE reg which changes size, with single or not AFTER the change +int sse_get_reg_size_changed(dynarec_rv64_t* dyn, int ninst, int s1, int a, int single) +{ + if (dyn->e.ssecache[a].v != -1) { + if (dyn->e.ssecache[a].vector == 1) { + // it's in the vpu, forget it first... + sse_forget_reg_vector(dyn, ninst, s1, a); + // update olds after the forget... + dyn->e.olds[a].changed = 1; + dyn->e.olds[a].purged = 0; + return sse_get_reg_size_changed(dyn, ninst, s1, a, single); + } + + // forget / reload if change of size + if (dyn->e.ssecache[a].single == single) { + sse_forget_reg(dyn, ninst, s1, a); + return sse_get_reg_size_changed(dyn, ninst, s1, a, single); + } + dyn->e.olds[a].changed = 1; + dyn->e.olds[a].purged = 0; + dyn->e.olds[a].type = !single; + dyn->e.ssecache[a].single = single; + dyn->e.ssecache[a].vector = 0; + dyn->e.extcache[EXTIDX(dyn->e.ssecache[a].reg)].t = single ? EXT_CACHE_SS : EXT_CACHE_SD; + return dyn->e.ssecache[a].reg; + } + dyn->e.ssecache[a].reg = fpu_get_reg_xmm(dyn, single ? EXT_CACHE_SS : EXT_CACHE_SD, a); + int ret = dyn->e.ssecache[a].reg; + dyn->e.ssecache[a].single = single; + dyn->e.ssecache[a].vector = 0; + if (!single) // load happens before size changed + FLW(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a])); + else + FLD(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a])); + return ret; +} + // forget ext register for a SSE reg, does nothing if the regs is not loaded void sse_forget_reg(dynarec_rv64_t* dyn, int ninst, int s1, int a) { @@ -1637,31 +1710,38 @@ void sse_forget_reg(dynarec_rv64_t* dyn, int ninst, int s1, int a) return; if (dyn->e.ssecache[a].vector == 1) return sse_forget_reg_vector(dyn, ninst, s1, a); - if(dyn->e.ssecache[a].single) + if (dyn->e.ssecache[a].single) FSW(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a])); else FSD(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a])); fpu_free_reg(dyn, dyn->e.ssecache[a].reg); dyn->e.olds[a].changed = 0; dyn->e.olds[a].purged = 1; - dyn->e.olds[a].reg = dyn->e.ssecache[a].reg; - dyn->e.olds[a].single = dyn->e.ssecache[a].single; + dyn->e.olds[a].reg = EXTIDX(dyn->e.ssecache[a].reg); + dyn->e.olds[a].type = dyn->e.ssecache[a].single; dyn->e.ssecache[a].v = -1; return; } // get rvv register for a SSE reg, create the entry if needed -int sse_get_reg_vector(dynarec_rv64_t* dyn, int ninst, int s1, int a, int forwrite) +int sse_get_reg_vector(dynarec_rv64_t* dyn, int ninst, int s1, int a, int forwrite, int sew) { if (dyn->e.ssecache[a].v != -1) { if (dyn->e.ssecache[a].vector == 0) { // it's in the fpu, forget it first... sse_forget_reg(dyn, ninst, s1, a); - return sse_get_reg_vector(dyn, ninst, s1, a, forwrite); + // update olds after the forget... + dyn->e.olds[a].changed = 1; + dyn->e.olds[a].purged = 0; + return sse_get_reg_vector(dyn, ninst, s1, a, forwrite, sew); } if (forwrite) { - dyn->e.ssecache[a].write = 1; // update only if forwrite + dyn->e.olds[a].changed = 1; + dyn->e.olds[a].purged = 0; + dyn->e.olds[a].reg = EXTIDX(dyn->e.ssecache[a].reg); + dyn->e.olds[a].type = EXT_CACHE_OLD_XMMW; + dyn->e.ssecache[a].write = 1; // update only if forwrite dyn->e.ssecache[a].single = 0; // just to be clean dyn->e.extcache[EXTIDX(dyn->e.ssecache[a].reg)].t = EXT_CACHE_XMMW; } @@ -1673,7 +1753,7 @@ int sse_get_reg_vector(dynarec_rv64_t* dyn, int ninst, int s1, int a, int forwri dyn->e.ssecache[a].vector = 1; dyn->e.ssecache[a].single = 0; // just to be clean ADDI(s1, xEmu, offsetof(x64emu_t, xmm[a])); - VLE8_V(ret, s1, VECTOR_UNMASKED, VECTOR_NFIELD1); + VLE_V(ret, s1, sew, VECTOR_UNMASKED, VECTOR_NFIELD1); return ret; } @@ -1684,8 +1764,15 @@ int sse_get_reg_empty_vector(dynarec_rv64_t* dyn, int ninst, int s1, int a) if (dyn->e.ssecache[a].vector == 0) { // it's in the fpu, forget it first... sse_forget_reg(dyn, ninst, s1, a); + // update olds after the forget... + dyn->e.olds[a].changed = 1; + dyn->e.olds[a].purged = 0; return sse_get_reg_empty_vector(dyn, ninst, s1, a); } + dyn->e.olds[a].changed = 1; + dyn->e.olds[a].purged = 0; + dyn->e.olds[a].reg = EXTIDX(dyn->e.ssecache[a].reg); + dyn->e.olds[a].type = EXT_CACHE_OLD_XMMW; dyn->e.ssecache[a].vector = 1; dyn->e.ssecache[a].write = 1; dyn->e.ssecache[a].single = 0; // just to be clean @@ -1707,10 +1794,15 @@ void sse_forget_reg_vector(dynarec_rv64_t* dyn, int ninst, int s1, int a) if (dyn->e.ssecache[a].vector == 0) return sse_forget_reg(dyn, ninst, s1, a); if (dyn->e.extcache[EXTIDX(dyn->e.ssecache[a].reg)].t == EXT_CACHE_XMMW) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEWANY, 1); ADDI(s1, xEmu, offsetof(x64emu_t, xmm[a])); - VSE8_V(dyn->e.ssecache[a].reg, s1, VECTOR_UNMASKED, VECTOR_NFIELD1); + VSE_V(dyn->e.ssecache[a].reg, s1, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); } fpu_free_reg(dyn, dyn->e.ssecache[a].reg); + dyn->e.olds[a].changed = 0; + dyn->e.olds[a].purged = 1; + dyn->e.olds[a].type = dyn->e.ssecache[a].write ? EXT_CACHE_OLD_XMMW : EXT_CACHE_OLD_XMMR; + dyn->e.olds[a].reg = EXTIDX(dyn->e.ssecache[a].reg); dyn->e.ssecache[a].v = -1; return; } @@ -1726,8 +1818,9 @@ void sse_purge07cache(dynarec_rv64_t* dyn, int ninst, int s1) ++old; } if (dyn->e.ssecache[i].vector) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEWANY, 0); ADDI(s1, xEmu, offsetof(x64emu_t, xmm[i])); - VSE8_V(dyn->e.ssecache[i].reg, s1, VECTOR_UNMASKED, VECTOR_NFIELD1); + VSE_V(dyn->e.ssecache[i].reg, s1, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); } else if (dyn->e.ssecache[i].single) FSW(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); else @@ -1744,34 +1837,33 @@ void sse_purge07cache(dynarec_rv64_t* dyn, int ninst, int s1) static void sse_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1) { int old = -1; - for (int i=0; i<16; ++i) - if(dyn->e.ssecache[i].v!=-1) { - if (old==-1) { - MESSAGE(LOG_DUMP, "\tPurge %sSSE Cache ------\n", next?"locally ":""); + for (int i = 0; i < 16; ++i) + if (dyn->e.ssecache[i].v != -1) { + if (old == -1) { + MESSAGE(LOG_DUMP, "\tPurge %sSSE Cache ------\n", next ? "locally " : ""); ++old; } if (dyn->e.ssecache[i].vector) { - ADDI(s1, xEmu, offsetof(x64emu_t, xmm[i])); - VSE8_V(dyn->e.ssecache[i].reg, s1, VECTOR_UNMASKED, VECTOR_NFIELD1); + if (dyn->e.ssecache[i].write) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEWANY, 0); + ADDI(s1, xEmu, offsetof(x64emu_t, xmm[i])); + VSE_V(dyn->e.ssecache[i].reg, s1, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + } } else if (dyn->e.ssecache[i].single) FSW(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); else FSD(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); - if(!next) { - if (dyn->e.ssecache[i].vector) { - fpu_free_reg(dyn, dyn->e.ssecache[i].reg); - dyn->e.ssecache[i].v = -1; - } else { - fpu_free_reg(dyn, dyn->e.ssecache[i].reg); - dyn->e.olds[i].changed = 0; - dyn->e.olds[i].purged = 1; - dyn->e.olds[i].reg = dyn->e.ssecache[i].reg; - dyn->e.olds[i].single = dyn->e.ssecache[i].single; - dyn->e.ssecache[i].v = -1; - } + if (!next) { + fpu_free_reg(dyn, dyn->e.ssecache[i].reg); + dyn->e.olds[i].changed = 0; + dyn->e.olds[i].purged = 1; + dyn->e.olds[i].type = dyn->e.ssecache[i].vector ? (dyn->e.ssecache[i].write ? EXT_CACHE_OLD_XMMW : EXT_CACHE_OLD_XMMR) : dyn->e.ssecache[i].single; + dyn->e.olds[i].reg = dyn->e.ssecache[i].reg; + dyn->e.ssecache[i].v = -1; } } - if(old!=-1) { + + if (old != -1) { MESSAGE(LOG_DUMP, "\t------ Purge SSE Cache\n"); } } @@ -1781,8 +1873,9 @@ static void sse_reflectcache(dynarec_rv64_t* dyn, int ninst, int s1) for (int i = 0; i < 16; ++i) if (dyn->e.ssecache[i].v != -1) { if (dyn->e.ssecache[i].vector) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEWANY, 0); ADDI(s1, xEmu, offsetof(x64emu_t, xmm[i])); - VSE8_V(dyn->e.ssecache[i].reg, s1, VECTOR_UNMASKED, VECTOR_NFIELD1); + VSE_V(dyn->e.ssecache[i].reg, s1, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); } else if (dyn->e.ssecache[i].single) FSW(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); else @@ -1795,8 +1888,9 @@ void sse_reflect_reg(dynarec_rv64_t* dyn, int ninst, int s1, int a) if (dyn->e.ssecache[a].v == -1) return; if (dyn->e.ssecache[a].vector) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEWANY, 0); ADDI(s1, xEmu, offsetof(x64emu_t, xmm[a])); - VSE8_V(dyn->e.ssecache[a].reg, s1, VECTOR_UNMASKED, VECTOR_NFIELD1); + VSE_V(dyn->e.ssecache[a].reg, s1, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); } else if (dyn->e.ssecache[a].single) FSW(dyn->e.ssecache[a].reg, xEmu, offsetof(x64emu_t, xmm[a])); else @@ -1805,96 +1899,149 @@ void sse_reflect_reg(dynarec_rv64_t* dyn, int ninst, int s1, int a) void fpu_pushcache(dynarec_rv64_t* dyn, int ninst, int s1, int not07) { - // need to save 0..1 && 10..17 (maybe) && 28..31 - // so 0..7 (SSE) && 17..23 (x87+MMX) - int start = not07?8:0; - // only SSE regs needs to be push back to xEmu (needs to be "write") - int n=0; - for (int i=start; i<8; i++) - if(dyn->e.ssecache[i].v!=-1) - ++n; - if(n) { - MESSAGE(LOG_DUMP, "\tPush XMM Cache (%d)------\n", n); - for (int i=start; i<8; ++i) - if(dyn->e.ssecache[i].v!=-1) { - if (dyn->e.ssecache[i].vector) { - ADDI(s1, xEmu, offsetof(x64emu_t, xmm[i])); - VSE8_V(dyn->e.ssecache[i].reg, s1, VECTOR_UNMASKED, VECTOR_NFIELD1); - } else if (dyn->e.ssecache[i].single) + // for float registers, we might lost f0..f7, f10..f17 and f28..f31, that means + // for extcache, we're saving 0..7 (SSE), 18..23 (MMX). + int start = not07 ? 8 : 0; + int n = 0; + for (int i = start; i < 8; i++) + if (dyn->e.ssecache[i].v != -1 && !dyn->e.ssecache[i].vector) ++n; + if (n) { + MESSAGE(LOG_DUMP, "\tPush (float) XMM Cache (%d)------\n", n); + for (int i = start; i < 8; ++i) + if (dyn->e.ssecache[i].v != -1) { + if (dyn->e.ssecache[i].vector) + continue; + else if (dyn->e.ssecache[i].single) FSW(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); else FSD(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); } - MESSAGE(LOG_DUMP, "\t------- Push XMM Cache (%d)\n", n); + MESSAGE(LOG_DUMP, "\t------- Push (float) XMM Cache (%d)\n", n); } n = 0; - for(int i=17; i<24; ++i) - if(dyn->e.extcache[i].v!=0) - ++n; - if(n) { - MESSAGE(LOG_DUMP, "\tPush x87/MMX Cache (%d)------\n", n); - SUBI(xSP, xSP, 8*((n+1)&~1)); + for (int i = 18; i < 24; ++i) + if (dyn->e.extcache[i].v != 0) ++n; + if (n) { + MESSAGE(LOG_DUMP, "\tPush (float) x87/MMX Cache (%d)------\n", n); + SUBI(xSP, xSP, 8 * ((n + 1) & ~1)); int p = 0; - for(int i=17; i<24; ++i) - if(dyn->e.extcache[i].v!=0) { - switch(dyn->e.extcache[i].t) { + for (int i = 18; i < 24; ++i) + if (dyn->e.extcache[i].v != 0) { + switch (dyn->e.extcache[i].t) { case EXT_CACHE_ST_F: case EXT_CACHE_SS: - FSW(EXTREG(i), xSP, p*8); + FSW(EXTREG(i), xSP, p * 8); break; default: - FSD(EXTREG(i), xSP, p*8); + FSD(EXTREG(i), xSP, p * 8); break; }; ++p; } - MESSAGE(LOG_DUMP, "\t------- Push x87/MMX Cache (%d)\n", n); + MESSAGE(LOG_DUMP, "\t------- Push (float) x87/MMX Cache (%d)\n", n); + } + + // for vector registers, we might lost all of them, that means for extcache, + n = 0; + for (int i = start; i < 16; i++) + if (dyn->e.ssecache[i].v != -1 && dyn->e.ssecache[i].vector) ++n; + if (n) { + MESSAGE(LOG_DUMP, "\tPush (vector) XMM Cache (%d)------\n", n); + for (int i = start; i < 16; ++i) + if (dyn->e.ssecache[i].v != -1) { + if (dyn->e.ssecache[i].vector) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEWANY, 0); + ADDI(s1, xEmu, offsetof(x64emu_t, xmm[i])); + VSE_V(dyn->e.ssecache[i].reg, s1, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + } + } + MESSAGE(LOG_DUMP, "\t------- Push (vector) XMM Cache (%d)\n", n); + } + n = 0; + for (int i = 0; i < 8; ++i) + if (dyn->e.mmxcache[i].v != -1 && dyn->e.mmxcache[i].vector) ++n; + if (n) { + MESSAGE(LOG_DUMP, "\tPush (vector) MMX Cache (%d)------\n", n); + for (int i = 0; i < 8; ++i) + if (dyn->e.mmxcache[i].v != -1 && dyn->e.mmxcache[i].vector) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEW64, 0); + VFMV_F_S(dyn->e.mmxcache[i].reg, dyn->e.mmxcache[i].reg); + FSD(dyn->e.mmxcache[i].reg, xEmu, offsetof(x64emu_t, mmx[i])); + } + MESSAGE(LOG_DUMP, "\t------- Push (vector) MMX Cache (%d)\n", n); } } void fpu_popcache(dynarec_rv64_t* dyn, int ninst, int s1, int not07) { - int start = not07?8:0; - // only SSE regs needs to be pop back from xEmu (don't need to be "write" this time) - int n=0; - for (int i=start; i<8; i++) - if(dyn->e.ssecache[i].v!=-1) - ++n; - if(n) { - MESSAGE(LOG_DUMP, "\tPop XMM Cache (%d)------\n", n); - for (int i=start; i<8; ++i) - if(dyn->e.ssecache[i].v!=-1) { - if (dyn->e.ssecache[i].vector) { - ADDI(s1, xEmu, offsetof(x64emu_t, xmm[i])); - VLE8_V(dyn->e.ssecache[i].reg, s1, VECTOR_UNMASKED, VECTOR_NFIELD1); - } else if (dyn->e.ssecache[i].single) + // float registers + int start = not07 ? 8 : 0; + int n = 0; + for (int i = start; i < 8; i++) + if (dyn->e.ssecache[i].v != -1 && !dyn->e.ssecache[i].vector) ++n; + if (n) { + MESSAGE(LOG_DUMP, "\tPop (float) XMM Cache (%d)------\n", n); + for (int i = start; i < 8; ++i) + if (dyn->e.ssecache[i].v != -1) { + if (dyn->e.ssecache[i].vector) + continue; + else if (dyn->e.ssecache[i].single) FLW(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); else FLD(dyn->e.ssecache[i].reg, xEmu, offsetof(x64emu_t, xmm[i])); } - MESSAGE(LOG_DUMP, "\t------- Pop XMM Cache (%d)\n", n); + MESSAGE(LOG_DUMP, "\t------- Pop (float) XMM Cache (%d)\n", n); } n = 0; - for(int i=17; i<24; ++i) - if(dyn->e.extcache[i].v!=0) - ++n; - if(n) { - MESSAGE(LOG_DUMP, "\tPush x87/MMX Cache (%d)------\n", n); + for (int i = 18; i < 24; ++i) + if (dyn->e.extcache[i].v != 0) ++n; + if (n) { + MESSAGE(LOG_DUMP, "\tPop (float) x87/MMX Cache (%d)------\n", n); int p = 0; - for(int i=17; i<24; ++i) - if(dyn->e.extcache[i].v!=0) { - switch(dyn->e.extcache[i].t) { + for (int i = 18; i < 24; ++i) + if (dyn->e.extcache[i].v != 0) { + switch (dyn->e.extcache[i].t) { case EXT_CACHE_ST_F: case EXT_CACHE_SS: - FLW(EXTREG(i), xSP, p*8); + FLW(EXTREG(i), xSP, p * 8); break; default: - FLD(EXTREG(i), xSP, p*8); + FLD(EXTREG(i), xSP, p * 8); break; }; ++p; } - ADDI(xSP, xSP, 8*((n+1)&~1)); - MESSAGE(LOG_DUMP, "\t------- Push x87/MMX Cache (%d)\n", n); + ADDI(xSP, xSP, 8 * ((n + 1) & ~1)); + MESSAGE(LOG_DUMP, "\t------- Pop (float) x87/MMX Cache (%d)\n", n); + } + + // vector registers + n = 0; + for (int i = start; i < 16; i++) + if (dyn->e.ssecache[i].v != -1 && dyn->e.ssecache[i].vector) ++n; + if (n) { + MESSAGE(LOG_DUMP, "\tPop (vector) XMM Cache (%d)------\n", n); + for (int i = start; i < 16; ++i) + if (dyn->e.ssecache[i].v != -1) { + if (dyn->e.ssecache[i].vector) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEWANY, 0); + ADDI(s1, xEmu, offsetof(x64emu_t, xmm[i])); + VLE_V(dyn->e.ssecache[i].reg, s1, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + } + } + MESSAGE(LOG_DUMP, "\t------- Pop (vector) XMM Cache (%d)\n", n); + } + n = 0; + for (int i = 0; i < 8; ++i) + if (dyn->e.mmxcache[i].v != -1 && dyn->e.mmxcache[i].vector) ++n; + if (n) { + MESSAGE(LOG_DUMP, "\tPop (vector) MMX Cache (%d)------\n", n); + for (int i = 0; i < 8; ++i) + if (dyn->e.mmxcache[i].v != -1 && dyn->e.mmxcache[i].vector) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEW64, 0); + FLD(dyn->e.mmxcache[i].reg, xEmu, offsetof(x64emu_t, mmx[i])); + VFMV_S_F(dyn->e.mmxcache[i].reg, dyn->e.mmxcache[i].reg); + } + MESSAGE(LOG_DUMP, "\t------- Pop (vector) MMX Cache (%d)\n", n); } } @@ -1903,10 +2050,24 @@ void fpu_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1, int s2, in x87_purgecache(dyn, ninst, next, s1, s2, s3); mmx_purgecache(dyn, ninst, next, s1); sse_purgecache(dyn, ninst, next, s1); - if(!next) + if (!next) fpu_reset_reg(dyn); } +int fpu_needpurgecache(dynarec_rv64_t* dyn, int ninst) +{ + // x87 + for (int i = 0; i < 8; ++i) + if (dyn->e.x87cache[i] != -1) + return 1; + // mmx + if (dyn->e.mmxcount) return 1; + // sse + for (int i = 0; i < 16; ++i) + if (dyn->e.ssecache[i].v != -1) return 1; + return 0; +} + static int findCacheSlot(dynarec_rv64_t* dyn, int ninst, int t, int n, extcache_t* cache) { ext_cache_t f; @@ -1949,15 +2110,18 @@ static int findCacheSlot(dynarec_rv64_t* dyn, int ninst, int t, int n, extcache_ return -1; } -static void swapCache(dynarec_rv64_t* dyn, int ninst, int i, int j, extcache_t *cache) +static void swapCache(dynarec_rv64_t* dyn, int ninst, int i, int j, extcache_t* cache) { if (i == j) return; - if (cache->extcache[i].t == EXT_CACHE_XMMR || cache->extcache[i].t == EXT_CACHE_XMMW || cache->extcache[j].t == EXT_CACHE_XMMR || cache->extcache[j].t == EXT_CACHE_XMMW) { + if (cache->extcache[i].t == EXT_CACHE_XMMR || cache->extcache[i].t == EXT_CACHE_XMMW + || cache->extcache[j].t == EXT_CACHE_XMMR || cache->extcache[j].t == EXT_CACHE_XMMW) { + int reg_i = EXTREG(i); + int reg_j = EXTREG(j); if (!cache->extcache[i].v) { // a mov is enough, no need to swap MESSAGE(LOG_DUMP, "\t - Moving %d <- %d\n", i, j); - VOR_VV(i, j, j, VECTOR_UNMASKED); + VMV_V_V(reg_i, reg_j); cache->extcache[i].v = cache->extcache[j].v; cache->extcache[j].v = 0; return; @@ -1965,9 +2129,9 @@ static void swapCache(dynarec_rv64_t* dyn, int ninst, int i, int j, extcache_t * // SWAP ext_cache_t tmp; MESSAGE(LOG_DUMP, "\t - Swapping %d <-> %d\n", i, j); - VXOR_VV(i, i, j, VECTOR_UNMASKED); - VXOR_VV(j, i, j, VECTOR_UNMASKED); - VXOR_VV(i, i, j, VECTOR_UNMASKED); + VXOR_VV(reg_i, reg_i, reg_j, VECTOR_UNMASKED); + VXOR_VV(reg_j, reg_i, reg_j, VECTOR_UNMASKED); + VXOR_VV(reg_i, reg_i, reg_j, VECTOR_UNMASKED); tmp.v = cache->extcache[i].v; cache->extcache[i].v = cache->extcache[j].v; cache->extcache[j].v = tmp.v; @@ -1979,10 +2143,10 @@ static void swapCache(dynarec_rv64_t* dyn, int ninst, int i, int j, extcache_t * int i_single = cache->extcache[i].t == EXT_CACHE_SS || cache->extcache[i].t == EXT_CACHE_ST_F; int j_single = cache->extcache[j].t == EXT_CACHE_SS || cache->extcache[j].t == EXT_CACHE_ST_F; - if(!cache->extcache[i].v) { + if (!cache->extcache[i].v) { // a mov is enough, no need to swap MESSAGE(LOG_DUMP, "\t - Moving %d <- %d\n", i, j); - if(j_single) { + if (j_single) { FMVS(reg_i, reg_j); } else { FMVD(reg_i, reg_j); @@ -1994,22 +2158,13 @@ static void swapCache(dynarec_rv64_t* dyn, int ninst, int i, int j, extcache_t * // SWAP ext_cache_t tmp; MESSAGE(LOG_DUMP, "\t - Swapping %d <-> %d\n", i, j); - // There is no swap instruction in RV64 to swap 2 float registers! - // so use a scratch... - #define SCRATCH 2 - if(i_single) - FMVS(SCRATCH, reg_i); - else - FMVD(SCRATCH, reg_i); - if(j_single) - FMVS(reg_i, reg_j); - else - FMVD(reg_i, reg_j); - if(i_single) - FMVS(reg_j, SCRATCH); - else - FMVD(reg_j, SCRATCH); - #undef SCRATCH +// There is no swap instruction in RV64 to swap 2 float registers! +// so use a scratch... +#define SCRATCH 0 // f0 is not used anywhere else + FMV(SCRATCH, reg_i, i_single); + FMV(reg_i, reg_j, j_single); + FMV(reg_j, SCRATCH, i_single); +#undef SCRATCH tmp.v = cache->extcache[i].v; cache->extcache[i].v = cache->extcache[j].v; cache->extcache[j].v = tmp.v; @@ -2020,9 +2175,10 @@ static void loadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, int int reg = EXTREG(i); if (cache->extcache[i].v && (cache->extcache[i].t == EXT_CACHE_XMMR || cache->extcache[i].t == EXT_CACHE_XMMW)) { int j = i + 1; - while (cache->extcache[j].v) ++j; + while (cache->extcache[j].v) + ++j; MESSAGE(LOG_DUMP, "\t - Moving away %d\n", i); - VOR_VV(j, i, i, VECTOR_UNMASKED); + VMV_V_V(EXTREG(j), reg); cache->extcache[j].v = cache->extcache[i].v; } else if (cache->extcache[i].v) { int single = 0; @@ -2031,7 +2187,8 @@ static void loadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, int if (cache->extcache[i].t == EXT_CACHE_SS || cache->extcache[i].t == EXT_CACHE_ST_F) single = 1; int j = i + 1; - while (cache->extcache[j].v) ++j; + while (cache->extcache[j].v) + ++j; MESSAGE(LOG_DUMP, "\t - Moving away %d\n", i); if (single) { FMVS(EXTREG(j), reg); @@ -2040,12 +2197,13 @@ static void loadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, int } cache->extcache[j].v = cache->extcache[i].v; } - switch(t) { + switch (t) { case EXT_CACHE_XMMR: case EXT_CACHE_XMMW: MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n)); + SET_ELEMENT_WIDTH(s1, VECTOR_SEWANY, 0); ADDI(s1, xEmu, offsetof(x64emu_t, xmm[n])); - VLE8_V(i, s1, VECTOR_UNMASKED, VECTOR_NFIELD1); + VLE_V(reg, s1, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); break; case EXT_CACHE_SS: MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n)); @@ -2056,27 +2214,37 @@ static void loadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, int FLD(reg, xEmu, offsetof(x64emu_t, xmm[n])); break; case EXT_CACHE_MM: + case EXT_CACHE_MMV: MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n)); FLD(reg, xEmu, offsetof(x64emu_t, mmx[n])); + if (t == EXT_CACHE_MMV) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEW64, 0); + VFMV_S_F(reg, reg); + } break; case EXT_CACHE_ST_D: case EXT_CACHE_ST_F: case EXT_CACHE_ST_I64: MESSAGE(LOG_DUMP, "\t - Loading %s\n", getCacheName(t, n)); - if((*s3_top) == 0xffff) { + if ((*s3_top) == 0xffff) { LW(s3, xEmu, offsetof(x64emu_t, top)); *s3_top = 0; } - int a = n - (*s3_top) - stack_cnt; - if(a) { + int a = n - (*s3_top) - stack_cnt; + if (a) { ADDI(s3, s3, a); - ANDI(s3, s3, 7); // (emu->top + i)&7 + ANDI(s3, s3, 7); // (emu->top + i)&7 } *s3_top += a; *s2_val = 0; - if(rv64_zba) SH3ADD(s2, s3, xEmu); else {SLLI(s2, s3, 3); ADD(s2, xEmu, s2);} + if (cpuext.zba) + SH3ADD(s2, s3, xEmu); + else { + SLLI(s2, s3, 3); + ADD(s2, xEmu, s2); + } FLD(reg, s2, offsetof(x64emu_t, x87)); - if(t==EXT_CACHE_ST_F) { + if (t == EXT_CACHE_ST_F) { FCVTSD(reg, reg); } if (t == EXT_CACHE_ST_I64) { @@ -2086,7 +2254,7 @@ static void loadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, int break; case EXT_CACHE_NONE: case EXT_CACHE_SCR: - default: /* nothing done */ + default: /* nothing done */ MESSAGE(LOG_DUMP, "\t - ignoring %s\n", getCacheName(t, n)); break; } @@ -2094,17 +2262,18 @@ static void loadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, int cache->extcache[i].t = t; } -static void unloadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, int s2, int s3, int* s1_val, int* s2_val, int* s3_top, extcache_t *cache, int i, int t, int n) +static void unloadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, int s2, int s3, int* s1_val, int* s2_val, int* s3_top, extcache_t* cache, int i, int t, int n) { int reg = EXTREG(i); - switch(t) { + switch (t) { case EXT_CACHE_XMMR: MESSAGE(LOG_DUMP, "\t - ignoring %s\n", getCacheName(t, n)); break; case EXT_CACHE_XMMW: MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n)); + SET_ELEMENT_WIDTH(s1, VECTOR_SEWANY, 0); ADDI(s1, xEmu, offsetof(x64emu_t, xmm[n])); - VSE8_V(i, s1, VECTOR_UNMASKED, VECTOR_NFIELD1); + VSE_V(reg, s1, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); break; case EXT_CACHE_SS: MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n)); @@ -2115,24 +2284,34 @@ static void unloadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, i FSD(reg, xEmu, offsetof(x64emu_t, xmm[n])); break; case EXT_CACHE_MM: + case EXT_CACHE_MMV: MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n)); + if (t == EXT_CACHE_MMV) { + SET_ELEMENT_WIDTH(s1, VECTOR_SEW64, 0); + VFMV_F_S(reg, reg); + } FSD(reg, xEmu, offsetof(x64emu_t, mmx[n])); break; case EXT_CACHE_ST_D: case EXT_CACHE_ST_F: case EXT_CACHE_ST_I64: MESSAGE(LOG_DUMP, "\t - Unloading %s\n", getCacheName(t, n)); - if((*s3_top)==0xffff) { + if ((*s3_top) == 0xffff) { LW(s3, xEmu, offsetof(x64emu_t, top)); *s3_top = 0; } int a = n - (*s3_top) - stack_cnt; - if(a) { + if (a) { ADDI(s3, s3, a); ANDI(s3, s3, 7); } *s3_top += a; - if(rv64_zba) SH3ADD(s2, s3, xEmu); else {SLLI(s2, s3, 3); ADD(s2, xEmu, s2);} + if (cpuext.zba) + SH3ADD(s2, s3, xEmu); + else { + SLLI(s2, s3, 3); + ADD(s2, xEmu, s2); + } *s2_val = 0; if (t == EXT_CACHE_ST_F) { FCVTDS(reg, reg); @@ -2145,7 +2324,7 @@ static void unloadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, i break; case EXT_CACHE_NONE: case EXT_CACHE_SCR: - default: /* nothing done */ + default: /* nothing done */ MESSAGE(LOG_DUMP, "\t - ignoring %s\n", getCacheName(t, n)); break; } @@ -2154,19 +2333,18 @@ static void unloadCache(dynarec_rv64_t* dyn, int ninst, int stack_cnt, int s1, i static void fpuCacheTransform(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3) { -#if STEP > 1 int i2 = dyn->insts[ninst].x64.jmp_insts; - if(i2<0) + if (i2 < 0) return; MESSAGE(LOG_DUMP, "\tCache Transform ---- ninst=%d -> %d\n", ninst, i2); - if((!i2) || (dyn->insts[i2].x64.barrier&BARRIER_FLOAT)) { - if(dyn->e.stack_next) { + if ((!i2) || (dyn->insts[i2].x64.barrier & BARRIER_FLOAT)) { + if (dyn->e.stack_next) { fpu_purgecache(dyn, ninst, 1, s1, s2, s3); MESSAGE(LOG_DUMP, "\t---- Cache Transform\n"); return; } - for(int i=0; i<24; ++i) - if(dyn->e.extcache[i].v) { // there is something at ninst for i + for (int i = 0; i < 24; ++i) + if (dyn->e.extcache[i].v) { // there is something at ninst for i fpu_purgecache(dyn, ninst, 1, s1, s2, s3); MESSAGE(LOG_DUMP, "\t---- Cache Transform\n"); return; @@ -2177,12 +2355,12 @@ static void fpuCacheTransform(dynarec_rv64_t* dyn, int ninst, int s1, int s2, in extcache_t cache_i2 = dyn->insts[i2].e; extcacheUnwind(&cache_i2); - if(!cache_i2.stack) { + if (!cache_i2.stack) { int purge = 1; - for (int i=0; i<24 && purge; ++i) - if(cache_i2.extcache[i].v) + for (int i = 0; i < 24 && purge; ++i) + if (cache_i2.extcache[i].v) purge = 0; - if(purge) { + if (purge) { fpu_purgecache(dyn, ninst, 1, s1, s2, s3); MESSAGE(LOG_DUMP, "\t---- Cache Transform\n"); return; @@ -2193,9 +2371,8 @@ static void fpuCacheTransform(dynarec_rv64_t* dyn, int ninst, int s1, int s2, in extcache_t cache = dyn->e; int s1_val = 0; int s2_val = 0; - // unload every uneeded cache - // check SSE first, than MMX, in order, for optimisation issue - if (rv64_vector) vector_vsetvl_emul1(dyn, ninst, s1, VECTOR_SEW8); + // unload every unneeded cache + // check SSE first, than MMX, in order, for optimization issue for (int i = 0; i < 16; ++i) { int j = findCacheSlot(dyn, ninst, EXT_CACHE_SS, i, &cache); if (j >= 0 && findCacheSlot(dyn, ninst, EXT_CACHE_SS, i, &cache_i2) == -1) @@ -2211,9 +2388,12 @@ static void fpuCacheTransform(dynarec_rv64_t* dyn, int ninst, int s1, int s2, in int j = findCacheSlot(dyn, ninst, EXT_CACHE_MM, i, &cache); if (j >= 0 && findCacheSlot(dyn, ninst, EXT_CACHE_MM, i, &cache_i2) == -1) unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, j, cache.extcache[j].t, cache.extcache[j].n); + j = findCacheSlot(dyn, ninst, EXT_CACHE_MMV, i, &cache); + if (j >= 0 && findCacheSlot(dyn, ninst, EXT_CACHE_MMV, i, &cache_i2) == -1) + unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, j, cache.extcache[j].t, cache.extcache[j].n); } for (int i = 0; i < 24; ++i) { - if(cache.extcache[i].v) + if (cache.extcache[i].v) if (findCacheSlot(dyn, ninst, cache.extcache[i].t, cache.extcache[i].n, &cache_i2) == -1) unloadCache(dyn, ninst, stack_cnt, s1, s2, s3, &s1_val, &s2_val, &s3_top, &cache, i, cache.extcache[i].t, cache.extcache[i].n); } @@ -2259,11 +2439,20 @@ static void fpuCacheTransform(dynarec_rv64_t* dyn, int ninst, int s1, int s2, in FMVXD(s1, EXTREG(i)); FCVTDL(EXTREG(i), s1, RD_RTZ); cache.extcache[i].t = EXT_CACHE_ST_D; + } else if (cache.extcache[i].t == EXT_CACHE_XMMR && cache_i2.extcache[i].t == EXT_CACHE_XMMW) { + cache.extcache[i].t = EXT_CACHE_XMMW; + } else if (cache.extcache[i].t == EXT_CACHE_XMMW && cache_i2.extcache[i].t == EXT_CACHE_XMMR) { + // refresh cache... + MESSAGE(LOG_DUMP, "\t - Refreh %s\n", getCacheName(cache.extcache[i].t, cache.extcache[i].n)); + SET_ELEMENT_WIDTH(s1, VECTOR_SEWANY, 0); + ADDI(s1, xEmu, offsetof(x64emu_t, xmm[cache.extcache[i].n])); + VSE_V(EXTREG(i), s1, dyn->vector_eew, VECTOR_UNMASKED, VECTOR_NFIELD1); + cache.extcache[i].t = EXT_CACHE_XMMR; } } } } - if(stack_cnt != cache_i2.stack) { + if (stack_cnt != cache_i2.stack) { MESSAGE(LOG_DUMP, "\t - adjust stack count %d -> %d -\n", stack_cnt, cache_i2.stack); int a = stack_cnt - cache_i2.stack; // Add x87stack to emu fpu_stack @@ -2277,83 +2466,82 @@ static void fpuCacheTransform(dynarec_rv64_t* dyn, int ninst, int s1, int s2, in SW(s3, xEmu, offsetof(x64emu_t, top)); // update tags LH(s2, xEmu, offsetof(x64emu_t, fpu_tags)); - if(a>0) { - SLLI(s2, s2, a*2); + if (a > 0) { + SLLI(s2, s2, a * 2); } else { - SLLI(s3, xMASK, 16); // 0xffff0000 + MOV32w(s3, 0xffff0000); OR(s2, s2, s3); - SRLI(s2, s2, -a*2); + SRLI(s2, s2, -a * 2); } SH(s2, xEmu, offsetof(x64emu_t, fpu_tags)); s3_top = 0; stack_cnt = cache_i2.stack; } MESSAGE(LOG_DUMP, "\t---- Cache Transform\n"); -#endif } static void flagsCacheTransform(dynarec_rv64_t* dyn, int ninst, int s1) { -#if STEP > 1 int j64; int jmp = dyn->insts[ninst].x64.jmp_insts; - if(jmp<0) + if (jmp < 0) return; - if(dyn->f.dfnone) // flags are fully known, nothing we can do more + if (dyn->f.dfnone || ((dyn->insts[jmp].f_exit.dfnone && !dyn->insts[jmp].f_entry.dfnone) && !dyn->insts[jmp].x64.use_flags)) // flags are fully known, nothing we can do more return; MESSAGE(LOG_DUMP, "\tFlags fetch ---- ninst=%d -> %d\n", ninst, jmp); - int go = 0; + int go = (dyn->insts[jmp].f_entry.dfnone && !dyn->f.dfnone && !dyn->insts[jmp].df_notneeded) ? 1 : 0; switch (dyn->insts[jmp].f_entry.pending) { - case SF_UNKNOWN: break; - case SF_SET: - if(dyn->f.pending!=SF_SET && dyn->f.pending!=SF_SET_PENDING) - go = 1; + case SF_UNKNOWN: + go = 0; break; - case SF_SET_PENDING: - if(dyn->f.pending!=SF_SET - && dyn->f.pending!=SF_SET_PENDING - && dyn->f.pending!=SF_PENDING) - go = 1; - break; - case SF_PENDING: - if(dyn->f.pending!=SF_SET - && dyn->f.pending!=SF_SET_PENDING - && dyn->f.pending!=SF_PENDING) - go = 1; - else - go = (dyn->insts[jmp].f_entry.dfnone == dyn->f.dfnone)?0:1; + default: + if (go && !(dyn->insts[jmp].x64.need_before & X_PEND) && (dyn->f.pending != SF_UNKNOWN)) { + // just clear df flags + go = 0; + SW(xZR, xEmu, offsetof(x64emu_t, df)); + } break; } - if(dyn->insts[jmp].f_entry.dfnone && !dyn->f.dfnone) - go = 1; - if(go) { - if(dyn->f.pending!=SF_PENDING) { - LW(s1, xEmu, offsetof(x64emu_t, df)); - j64 = (GETMARKF2)-(dyn->native_size); + if (go) { + if (dyn->f.pending != SF_PENDING) { + LWU(s1, xEmu, offsetof(x64emu_t, df)); + j64 = (GETMARKF2) - (dyn->native_size); BEQZ(s1, j64); } - CALL_(UpdateFlags, -1, 0); + CALL_(const_updateflags, -1, 0, 0, 0); MARKF2; } -#endif } -void CacheTransform(dynarec_rv64_t* dyn, int ninst, int cacheupd, int s1, int s2, int s3) { - if(cacheupd&2) +static void sewTransform(dynarec_rv64_t* dyn, int ninst, int s1) +{ + int j64; + int jmp = dyn->insts[ninst].x64.jmp_insts; + if (jmp < 0) return; + if (dyn->insts[jmp].vector_sew_entry == VECTOR_SEWNA) return; + MESSAGE(LOG_DUMP, "\tSEW changed to %d ---- ninst=%d -> %d\n", dyn->insts[jmp].vector_sew_entry, ninst, jmp); + vector_vsetvli(dyn, ninst, s1, dyn->insts[jmp].vector_sew_entry, VECTOR_LMUL1, 1); +} + +void CacheTransform(dynarec_rv64_t* dyn, int ninst, int cacheupd, int s1, int s2, int s3) +{ + if (cacheupd & 2) fpuCacheTransform(dyn, ninst, s1, s2, s3); - if(cacheupd&1) + if (cacheupd & 1) flagsCacheTransform(dyn, ninst, s1); + if (cacheupd & 4) + sewTransform(dyn, ninst, s1); } void rv64_move32(dynarec_rv64_t* dyn, int ninst, int reg, int32_t val, int zeroup) { - // Depending on val, the following insns are emitted. + // Depending on val, the following insts are emitted. // val == 0 -> ADDI // lo12 != 0 && hi20 == 0 -> ADDI // lo12 == 0 && hi20 != 0 -> LUI // else -> LUI+ADDI - int32_t hi20 = (val+0x800)>>12 & 0xfffff; - int32_t lo12 = val&0xfff; + int32_t hi20 = (val + 0x800) >> 12 & 0xfffff; + int32_t lo12 = val & 0xfff; int src = xZR; if (hi20) { @@ -2361,24 +2549,23 @@ void rv64_move32(dynarec_rv64_t* dyn, int ninst, int reg, int32_t val, int zerou src = reg; } if (lo12 || !hi20) ADDIW(reg, src, lo12); - if((zeroup && ((hi20&0x80000) || (!hi20 && (lo12&0x800)))) - || (!zeroup && !(val&0x80000000) && ((hi20&0x80000) || (!hi20 && (lo12&0x800))))) { + if (zeroup && (val & 0x80000000)) { ZEROUP(reg); } } void rv64_move64(dynarec_rv64_t* dyn, int ninst, int reg, int64_t val) { - if(((val<<32)>>32)==val) { + if (((val << 32) >> 32) == val) { // 32bits value rv64_move32(dyn, ninst, reg, val, 0); return; } - int64_t lo12 = (val<<52)>>52; - int64_t hi52 = (val+0x800)>>12; - int shift = 12+TrailingZeros64((uint64_t)hi52); - hi52 = ((hi52>>(shift-12))<>shift; + int64_t lo12 = (val << 52) >> 52; + int64_t hi52 = (val + 0x800) >> 12; + int shift = 12 + TrailingZeros64((uint64_t)hi52); + hi52 = ((hi52 >> (shift - 12)) << shift) >> shift; rv64_move64(dyn, ninst, reg, hi52); SLLI(reg, reg, shift); @@ -2396,23 +2583,27 @@ void fpu_reflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3) void fpu_unreflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3) { - // need to undo the top and stack tracking that must not be reflected permenatly yet - x87_unreflectcache(dyn, ninst, s1, s2, s3); + // need to undo the top and stack tracking that must not be reflected permanently yet + x87_unreflectcount(dyn, ninst, s1, s2); } void emit_pf(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4) { MAYUSE(dyn); MAYUSE(ninst); + if (cpuext.zbb) { + ANDI(s3, s1, 0xFF); + CPOPW(s3, s3); + } else { + SRLI(s3, s1, 4); + XOR(s3, s3, s1); - SRLI(s3, s1, 4); - XOR(s3, s3, s1); - - SRLI(s4, s3, 2); - XOR(s4, s3, s4); + SRLI(s4, s3, 2); + XOR(s4, s3, s4); - SRLI(s3, s4, 1); - XOR(s3, s3, s4); + SRLI(s3, s4, 1); + XOR(s3, s3, s4); + } ANDI(s3, s3, 1); XORI(s3, s3, 1); @@ -2422,61 +2613,63 @@ void emit_pf(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4) void fpu_reset_cache(dynarec_rv64_t* dyn, int ninst, int reset_n) { - MESSAGE(LOG_DEBUG, "Reset Caches with %d\n",reset_n); - #if STEP > 1 - // for STEP 2 & 3, just need to refrest with current, and undo the changes (push & swap) + MESSAGE(LOG_DEBUG, "Reset Caches with %d\n", reset_n); +#if STEP > 1 + // for STEP 2 & 3, just need to refresh with current, and undo the changes (push & swap) dyn->e = dyn->insts[ninst].e; - #else - dyn->e = dyn->insts[reset_n].e; - #endif + dyn->vector_sew = dyn->insts[ninst].vector_sew_entry; extcacheUnwind(&dyn->e); - #if STEP == 0 - if(box64_dynarec_dump) dynarec_log(LOG_NONE, "New x87stack=%d\n", dyn->e.x87stack); - #endif - #if defined(HAVE_TRACE) && (STEP>2) - if(box64_dynarec_dump) - if(memcmp(&dyn->e, &dyn->insts[reset_n].e, sizeof(ext_cache_t))) { +#else + dyn->e = dyn->insts[reset_n].e; + dyn->vector_sew = dyn->insts[reset_n].vector_sew_exit; +#endif +#if STEP == 0 + if(dyn->need_dump && dyn->e.x87stack) dynarec_log(LOG_NONE, "New x87stack=%d at ResetCache in inst %d with %d\n", dyn->e.x87stack, ninst, reset_n); +#endif +#if defined(HAVE_TRACE) && (STEP > 2) + if (dyn->need_dump && 0) // disable for now + if (memcmp(&dyn->e, &dyn->insts[reset_n].e, sizeof(ext_cache_t))) { MESSAGE(LOG_DEBUG, "Warning, difference in extcache: reset="); - for(int i=0; i<24; ++i) - if(dyn->insts[reset_n].e.extcache[i].v) + for (int i = 0; i < 24; ++i) + if (dyn->insts[reset_n].e.extcache[i].v) MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->insts[reset_n].e.extcache[i].t, dyn->insts[reset_n].e.extcache[i].n)); - if(dyn->insts[reset_n].e.combined1 || dyn->insts[reset_n].e.combined2) - MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->insts[reset_n].e.swapped?"SWP":"CMB", dyn->insts[reset_n].e.combined1, dyn->insts[reset_n].e.combined2); - if(dyn->insts[reset_n].e.stack_push || dyn->insts[reset_n].e.stack_pop) + if (dyn->insts[reset_n].e.combined1 || dyn->insts[reset_n].e.combined2) + MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->insts[reset_n].e.swapped ? "SWP" : "CMB", dyn->insts[reset_n].e.combined1, dyn->insts[reset_n].e.combined2); + if (dyn->insts[reset_n].e.stack_push || dyn->insts[reset_n].e.stack_pop) MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->insts[reset_n].e.stack_push, -dyn->insts[reset_n].e.stack_pop); MESSAGE(LOG_DEBUG, " ==> "); - for(int i=0; i<24; ++i) - if(dyn->insts[ninst].e.extcache[i].v) + for (int i = 0; i < 24; ++i) + if (dyn->insts[ninst].e.extcache[i].v) MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->insts[ninst].e.extcache[i].t, dyn->insts[ninst].e.extcache[i].n)); - if(dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) - MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->insts[ninst].e.swapped?"SWP":"CMB", dyn->insts[ninst].e.combined1, dyn->insts[ninst].e.combined2); - if(dyn->insts[ninst].e.stack_push || dyn->insts[ninst].e.stack_pop) + if (dyn->insts[ninst].e.combined1 || dyn->insts[ninst].e.combined2) + MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->insts[ninst].e.swapped ? "SWP" : "CMB", dyn->insts[ninst].e.combined1, dyn->insts[ninst].e.combined2); + if (dyn->insts[ninst].e.stack_push || dyn->insts[ninst].e.stack_pop) MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->insts[ninst].e.stack_push, -dyn->insts[ninst].e.stack_pop); MESSAGE(LOG_DEBUG, " -> "); - for(int i=0; i<24; ++i) - if(dyn->e.extcache[i].v) + for (int i = 0; i < 24; ++i) + if (dyn->e.extcache[i].v) MESSAGE(LOG_DEBUG, " %02d:%s", i, getCacheName(dyn->e.extcache[i].t, dyn->e.extcache[i].n)); - if(dyn->e.combined1 || dyn->e.combined2) - MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->e.swapped?"SWP":"CMB", dyn->e.combined1, dyn->e.combined2); - if(dyn->e.stack_push || dyn->e.stack_pop) + if (dyn->e.combined1 || dyn->e.combined2) + MESSAGE(LOG_DEBUG, " %s:%02d/%02d", dyn->e.swapped ? "SWP" : "CMB", dyn->e.combined1, dyn->e.combined2); + if (dyn->e.stack_push || dyn->e.stack_pop) MESSAGE(LOG_DEBUG, " (%d:%d)", dyn->e.stack_push, -dyn->e.stack_pop); MESSAGE(LOG_DEBUG, "\n"); } - #endif //HAVE_TRACE +#endif // HAVE_TRACE } // propagate ST stack state, especial stack pop that are deferred void fpu_propagate_stack(dynarec_rv64_t* dyn, int ninst) { - if(dyn->e.stack_pop) { - for(int j=0; j<24; ++j) + if (dyn->e.stack_pop) { + for (int j = 0; j < 24; ++j) if ((dyn->e.extcache[j].t == EXT_CACHE_ST_D || dyn->e.extcache[j].t == EXT_CACHE_ST_F || dyn->e.extcache[j].t == EXT_CACHE_ST_I64)) { - if(dyn->e.extcache[j].ne.stack_pop) + if (dyn->e.extcache[j].n < dyn->e.stack_pop) dyn->e.extcache[j].v = 0; else - dyn->e.extcache[j].n-=dyn->e.stack_pop; + dyn->e.extcache[j].n -= dyn->e.stack_pop; } dyn->e.stack_pop = 0; } @@ -2486,17 +2679,279 @@ void fpu_propagate_stack(dynarec_rv64_t* dyn, int ninst) dyn->e.swapped = 0; } -// Use vector extension as like SIMD for now, this function sets the specified element width, -// other configs are set automatically. -void vector_vsetvl_emul1(dynarec_rv64_t* dyn, int ninst, int s1, int sew) +// Simple wrapper for vsetvli, may use s1 as scratch +int vector_vsetvli(dynarec_rv64_t* dyn, int ninst, int s1, int sew, int vlmul, float multiple) +{ + if (sew == VECTOR_SEWNA) return VECTOR_SEW8; + if (sew == VECTOR_SEWANY) sew = VECTOR_SEW8; + + uint32_t vl = (int)((float)(16 >> sew) * multiple); + uint32_t vtypei = (sew << (3 - !!cpuext.xtheadvector)) | vlmul; + if (dyn->inst_sew == VECTOR_SEWNA || dyn->inst_vl == 0 || dyn->inst_sew != sew || dyn->inst_vl != vl || dyn->inst_vlmul != vlmul) { + if (vl == (cpuext.vlen >> (sew - vlmul))) { + VSETVLI(s1, xZR, vtypei); + } else if (vl <= 31 && !cpuext.xtheadvector) { + VSETIVLI(xZR, vl, vtypei); + } else { + ADDI(s1, xZR, vl); + VSETVLI(xZR, s1, vtypei); + } + } + dyn->inst_sew = sew; + dyn->inst_vl = vl; + dyn->inst_vlmul = vlmul; + return sew; +} + +static uint64_t xtheadvector_16bitmasks[16] = { + 0x0000000000000000, + 0x0000000000000001, + 0x0000000000010000, + 0x0000000000010001, + 0x0000000100000000, + 0x0000000100000001, + 0x0000000100010000, + 0x0000000100010001, + 0x0001000000000000, + 0x0001000000000001, + 0x0001000000010000, + 0x0001000000010001, + 0x0001000100000000, + 0x0001000100000001, + 0x0001000100010000, + 0x0001000100010001, +}; + +void vector_loadmask(dynarec_rv64_t* dyn, int ninst, int vreg, uint64_t imm, int s1, float multiple) { - /* mu: mask undisturbed - * tu: tail undisturbed - * sew: selected element width - * lmul: vector register group multiplier - * - * mu tu sew lmul=1 */ - uint32_t vtypei = (0b0 << 7) | (0b0 << 6) | (sew << 3) | 0b000; - ADDI(s1, xZR, 16 >> sew); - VSETVLI(xZR, s1, vtypei); +#if STEP > 1 + uint8_t sew = dyn->inst_sew; + uint8_t vlmul = dyn->inst_vlmul; + if (cpuext.xtheadvector) { + if (sew == VECTOR_SEW64 && vlmul == VECTOR_LMUL1) { + switch (imm) { + case 0: + VXOR_VV(vreg, vreg, vreg, VECTOR_UNMASKED); + return; + case 1: + ADDI(s1, xZR, 1); + VMV_S_X(vreg, s1); + return; + case 2: { + int scratch = fpu_get_scratch(dyn); + VMV_V_I(scratch, 1); + VSLIDE1UP_VX(vreg, scratch, xZR, VECTOR_UNMASKED); + return; + } + case 3: + VMV_V_I(vreg, 1); + return; + default: abort(); + } + } else if ((sew == VECTOR_SEW32 && vlmul == VECTOR_LMUL1) || (sew == VECTOR_SEW64 && vlmul == VECTOR_LMUL2)) { + switch (imm) { + case 0b0000: + VMV_S_X(vreg, xZR); + return; + case 0b0001: + ADDI(s1, xZR, 1); + VMV_S_X(vreg, s1); + return; + case 0b0010: + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0x100000000ULL); + VMV_S_X(vreg, s1); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + case 0b0011: + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0x100000001ULL); + VMV_S_X(vreg, s1); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + case 0b0100: { + int scratch = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + VMV_V_I(scratch, 1); + VSLIDE1UP_VX(vreg, scratch, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + } + case 0b0101: + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + VMV_V_I(vreg, 1); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + case 0b0110: { + int scratch = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + VMV_V_I(scratch, 1); + MOV64x(s1, 0x100000000ULL); + VSLIDE1UP_VX(vreg, scratch, s1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + } + case 0b0111: { + int scratch = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + VMV_V_I(scratch, 1); + MOV64x(s1, 0x100000001ULL); + VSLIDE1UP_VX(vreg, scratch, s1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + } + case 0b1000: { + int scratch = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0x100000000ULL); + VMV_V_X(scratch, s1); + VSLIDE1UP_VX(vreg, scratch, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + } + case 0b1001: { + int scratch = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0x100000000ULL); + VMV_V_X(scratch, s1); + ADDI(s1, xZR, 1); + VSLIDE1UP_VX(vreg, scratch, s1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + } + case 0b1010: + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0x100000000ULL); + VMV_V_X(vreg, s1); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + case 0b1011: { + int scratch = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0x100000000ULL); + VMV_V_X(scratch, s1); + MOV64x(s1, 0x100000001ULL); + VSLIDE1UP_VX(vreg, scratch, s1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + } + case 0b1100: { + int scratch = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0x100000001ULL); + VMV_V_X(scratch, s1); + VSLIDE1UP_VX(vreg, scratch, xZR, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + } + case 0b1101: { + int scratch = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0x100000001ULL); + VMV_V_X(scratch, s1); + ADDI(s1, xZR, 1); + VSLIDE1UP_VX(vreg, scratch, s1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + } + case 0b1110: { + int scratch = fpu_get_scratch(dyn); + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0x100000001ULL); + VMV_V_X(scratch, s1); + ADDI(s1, s1, -1); + VSLIDE1UP_VX(vreg, scratch, s1, VECTOR_UNMASKED); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + } + case 0b1111: + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0x100000001ULL); + VMV_V_X(vreg, s1); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + default: abort(); + } + } else if ((sew == VECTOR_SEW16 && vlmul == VECTOR_LMUL1) || (sew == VECTOR_SEW32 && vlmul == VECTOR_LMUL2)) { + if (imm > 255) abort(); + if (imm == 0) { + VMV_S_X(vreg, xZR); + return; + } + int low = imm & 0xF; + int high = (imm >> 4) & 0xF; + int scratch; + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + if (low == high) { + MOV64x(s1, xtheadvector_16bitmasks[low]); + VMV_V_X(vreg, s1); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + } + if (high != 0) { + scratch = fpu_get_scratch(dyn); + MOV64x(s1, xtheadvector_16bitmasks[high]); + VMV_S_X(scratch, s1); + } + if (low != 0) + MOV64x(s1, xtheadvector_16bitmasks[low]); + else + s1 = xZR; + if (high != 0) { + VSLIDE1UP_VX(vreg, scratch, s1, VECTOR_UNMASKED); + } else { + VMV_S_X(vreg, s1); + } + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + } else if ((sew == VECTOR_SEW8 && vlmul == VECTOR_LMUL1) || (sew == VECTOR_SEW16 && vlmul == VECTOR_LMUL2)) { + switch (imm) { + case 0b0000000000001111: + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW32, VECTOR_LMUL1, 1); + MOV64x(s1, 0xFFFFFFFFFFFFFFFFULL); + VMV_S_X(vreg, s1); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + case 0b0000000011111111: + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0xFFFFFFFFFFFFFFFFULL); + VMV_S_X(vreg, s1); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + case 0b0101010101010101: + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0x0001000100010001ULL); + VMV_V_X(vreg, s1); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + case 0b1010101010101010: + vector_vsetvli(dyn, ninst, s1, VECTOR_SEW64, VECTOR_LMUL1, 1); + MOV64x(s1, 0x0100010001000100ULL); + VMV_V_X(vreg, s1); + vector_vsetvli(dyn, ninst, s1, sew, vlmul, multiple); + return; + default: abort(); + } + } else + abort(); + } else { + if (imm <= 0xF && (dyn->vector_eew == VECTOR_SEW32 || dyn->vector_eew == VECTOR_SEW64)) { + VMV_V_I(vreg, imm); + } else if (dyn->vector_eew == VECTOR_SEW8 && imm >= 0xFF) { + if ((imm > 0xFF) && (imm & 0xFF) == (imm >> 8)) { + MOV64x(s1, imm); + VMV_V_X(vreg, s1); + } else if (imm > 0xFF) { + abort(); // not used (yet) + } else { + MOV64x(s1, imm); + VXOR_VV(vreg, vreg, vreg, VECTOR_UNMASKED); + VMV_S_X(vreg, s1); + } + } else { + MOV64x(s1, imm); + VMV_S_X(vreg, s1); + } + } +#endif } diff --git a/src/dynarec/rv64/dynarec_rv64_helper.h b/src/dynarec/rv64/dynarec_rv64_helper.h index 9e9d14f..2b6aade 100644 --- a/src/dynarec/rv64/dynarec_rv64_helper.h +++ b/src/dynarec/rv64/dynarec_rv64_helper.h @@ -2,7 +2,7 @@ #define __DYNAREC_RV64_HELPER_H__ // undef to get Close to SSE Float->int conversions -//#define PRECISE_CVT +// #define PRECISE_CVT #if STEP == 0 #include "dynarec_rv64_pass0.h" @@ -17,6 +17,7 @@ #include "debug.h" #include "rv64_emitter.h" #include "../emu/x64primop.h" +#include "dynarec_rv64_consts.h" #define F8 *(uint8_t*)(addr++) #define F8S *(int8_t*)(addr++) @@ -32,43 +33,15 @@ #define PK64(a) *(uint64_t*)(addr + a) #define PKip(a) *(uint8_t*)(ip + a) - -// Strong mem emulation helpers -#define SMREAD_MIN 2 -#define SMWRITE_MIN 1 -// Sequence of Read will trigger a DMB on "first" read if strongmem is >= SMREAD_MIN -// Sequence of Write will trigger a DMB on "last" write if strongmem is >= 1 -// All Write operation that might use a lock all have a memory barrier if strongmem is >= SMWRITE_MIN -// Opcode will read -#define SMREAD() if((dyn->smread==0) && (box64_dynarec_strongmem>SMREAD_MIN)) {SMDMB();} else dyn->smread=1 -// Opcode will read with option forced lock -#define SMREADLOCK(lock) if((lock) || ((dyn->smread==0) && (box64_dynarec_strongmem>SMREAD_MIN))) {SMDMB();} -// Opcode might read (depend on nextop) -#define SMMIGHTREAD() if(!MODREG) {SMREAD();} -// Opcode has wrote -#define SMWRITE() dyn->smwrite=1 -// Opcode has wrote (strongmem>1 only) -#define SMWRITE2() if(box64_dynarec_strongmem>SMREAD_MIN) dyn->smwrite=1 -// Opcode has wrote with option forced lock -#define SMWRITELOCK(lock) if(lock || (box64_dynarec_strongmem>SMWRITE_MIN)) {SMDMB();} else dyn->smwrite=1 -// Opcode might have wrote (depend on nextop) -#define SMMIGHTWRITE() if(!MODREG) {SMWRITE();} -// Start of sequence -#define SMSTART() SMEND() -// End of sequence -#define SMEND() if(dyn->smwrite && box64_dynarec_strongmem) {FENCE();} dyn->smwrite=0; dyn->smread=0; -// Force a Data memory barrier (for LOCK: prefix) -#define SMDMB() FENCE(); dyn->smwrite=0; dyn->smread=1 - // LOCK_* define #define LOCK_LOCK (int*)1 // GETGD get x64 register in gd -#define GETGD gd = xRAX + ((nextop & 0x38) >> 3) + (rex.r << 3) +#define GETGD gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)) // GETED can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI #define GETED(D) \ if (MODREG) { \ - ed = xRAX + (nextop & 7) + (rex.b << 3); \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ wback = 0; \ } else { \ SMREAD(); \ @@ -79,7 +52,7 @@ // GETSED can use r1 for ed, and r2 for wback. ed will be sign extended! #define GETSED(D) \ if (MODREG) { \ - ed = xRAX + (nextop & 7) + (rex.b << 3); \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ wback = 0; \ if (!rex.w) { \ ADDW(x1, ed, xZR); \ @@ -97,7 +70,7 @@ // GETEDx can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI #define GETEDx(D) \ if (MODREG) { \ - ed = xRAX + (nextop & 7) + (rex.b << 3); \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ wback = 0; \ } else { \ SMREAD(); \ @@ -107,7 +80,7 @@ } #define GETEDz(D) \ if (MODREG) { \ - ed = xRAX + (nextop & 7) + (rex.b << 3); \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ wback = 0; \ } else { \ SMREAD(); \ @@ -115,49 +88,38 @@ LDz(x1, wback, fixedaddress); \ ed = x1; \ } -// GETED32 can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI -#define GETED32(D) \ - if (MODREG) { \ - ed = xRAX + (nextop & 7) + (rex.b << 3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted32(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, D); \ - LDxw(x1, wback, fixedaddress); \ - ed = x1; \ - } -// GETEDH can use hint for ed, and x1 or x2 for wback (depending on hint), might also use x3. wback is 0 if ed is xEAX..xEDI -#define GETEDH(hint, D) \ - if (MODREG) { \ - ed = xRAX + (nextop & 7) + (rex.b << 3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, (hint == x2) ? x1 : x2, (hint == x1) ? x1 : x3, &fixedaddress, rex, NULL, 1, D); \ - LDxw(hint, wback, fixedaddress); \ - ed = hint; \ +// GETEDH can use hint for wback and ret for ed. wback is 0 if ed is xEAX..xEDI +#define GETEDH(hint, ret, D) \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wback = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, hint, ret, &fixedaddress, rex, NULL, 1, D); \ + ed = ret; \ + LDxw(ed, wback, fixedaddress); \ } // GETEDW can use hint for wback and ret for ed. wback is 0 if ed is xEAX..xEDI -#define GETEDW(hint, ret, D) \ - if (MODREG) { \ - ed = xRAX + (nextop & 7) + (rex.b << 3); \ - MV(ret, ed); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, (hint == x2) ? x1 : x2, (hint == x1) ? x1 : x3, &fixedaddress, rex, NULL, 0, D); \ - ed = ret; \ - LDxw(ed, wback, fixedaddress); \ +#define GETEDW(hint, ret, D) \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + MV(ret, ed); \ + wback = 0; \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &wback, hint, ret, &fixedaddress, rex, NULL, 0, D); \ + ed = ret; \ + LDxw(ed, wback, fixedaddress); \ } // GETGW extract x64 register in gd, that is i -#define GETGW(i) \ - gd = xRAX + ((nextop & 0x38) >> 3) + (rex.r << 3); \ - ZEXTH(i, gd); \ +#define GETGW(i) \ + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + ZEXTH(i, gd); \ gd = i; // GETEWW will use i for ed, and can use w for wback. #define GETEWW(w, i, D) \ if (MODREG) { \ - wback = xRAX + (nextop & 7) + (rex.b << 3); \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ ZEXTH(i, wback); \ ed = i; \ wb1 = 0; \ @@ -168,12 +130,12 @@ ed = i; \ wb1 = 1; \ } -// GETEW will use i for ed, and can use r3 for wback. +// GETEW will use i for ed, and *may* use x3 for wback. #define GETEW(i, D) GETEWW(x3, i, D) -// GETSEW will use i for ed, and can use r3 for wback. This is the Signed version +// GETSEW will use i for ed, and *may* use x3 for wback. This is the Signed version #define GETSEW(i, D) \ if (MODREG) { \ - wback = xRAX + (nextop & 7) + (rex.b << 3); \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ SEXTH(i, wback); \ ed = i; \ wb1 = 0; \ @@ -197,56 +159,35 @@ OR(wback, wback, w); \ } // Write back gd in correct register (gd needs to be 16bits only!) -#define GWBACK \ - do { \ - int g = xRAX + ((nextop & 0x38) >> 3) + (rex.r << 3); \ - SRLI(g, g, 16); \ - SLLI(g, g, 16); \ - OR(g, g, gd); \ +#define GWBACK \ + do { \ + int g = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + SRLI(g, g, 16); \ + SLLI(g, g, 16); \ + OR(g, g, gd); \ } while (0) -// GETEDO can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI -#define GETEDO(O, D, S) \ - if (MODREG) { \ - ed = xRAX + (nextop & 7) + (rex.b << 3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, S, &fixedaddress, rex, NULL, 1, D); \ - ADD(S, wback, O); \ - LDxw(x1, S, fixedaddress); \ - ed = x1; \ - } -// GETEDOz can use r1 for ed, and r2 for wback. wback is 0 if ed is xEAX..xEDI -#define GETEDOz(O, D, S) \ - if (MODREG) { \ - ed = xRAX + (nextop & 7) + (rex.b << 3); \ - wback = 0; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, S, &fixedaddress, rex, NULL, 1, D); \ - ADD(S, wback, O); \ - LDz(x1, S, fixedaddress); \ - ed = x1; \ - } -#define WBACKO(O) \ - if (wback) { \ - ADD(O, wback, O); \ - SDxw(ed, O, 0); \ - SMWRITE2(); \ +#define WBACKO(O) \ + if (wback) { \ + ADDz(O, wback, O); \ + SDxw(ed, O, 0); \ + SMWRITE2(); \ } // FAKEED like GETED, but doesn't get anything -#define FAKEED \ - if (!MODREG) { \ - addr = fakeed(dyn, addr, ninst, nextop); \ +#define FAKEED \ + if (MODREG) { \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wback = 0; \ + } else { \ + addr = fakeed(dyn, addr, ninst, nextop); \ } // GETGW extract x64 register in gd, that is i, Signed extented -#define GETSGW(i) \ - gd = xRAX + ((nextop & 0x38) >> 3) + (rex.r << 3); \ - SLLIW(i, gd, 16); \ - SRAIW(i, i, 16); \ +#define GETSGW(i) \ + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + SLLIW(i, gd, 16); \ + SRAIW(i, i, 16); \ gd = i; // Write back ed in wback (if wback not 0) @@ -260,15 +201,15 @@ #define GETEB(i, D) \ if (MODREG) { \ if (rex.rex) { \ - wback = xRAX + (nextop & 7) + (rex.b << 3); \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ wb2 = 0; \ } else { \ wback = (nextop & 7); \ wb2 = (wback >> 2) * 8; \ - wback = xRAX + (wback & 3); \ + wback = TO_NAT(wback & 3); \ } \ if (wb2) { \ - if (rv64_xtheadbb) { \ + if (cpuext.xtheadbb) { \ TH_EXTU(i, wback, 15, 8); \ } else { \ SRLI(i, wback, wb2); \ @@ -285,47 +226,16 @@ wb1 = 1; \ ed = i; \ } -// GETEBO will use i for ed, i is also Offset, and can use r3 for wback. -#define GETEBO(i, D) \ - if (MODREG) { \ - if (rex.rex) { \ - wback = xRAX + (nextop & 7) + (rex.b << 3); \ - wb2 = 0; \ - } else { \ - wback = (nextop & 7); \ - wb2 = (wback >> 2) * 8; \ - wback = xRAX + (wback & 3); \ - } \ - if (wb2) { \ - if (rv64_xtheadbb) { \ - TH_EXTU(i, wback, 15, 8); \ - } else { \ - SRLI(i, wback, wb2); \ - ANDI(i, i, 0xff); \ - } \ - } else \ - ANDI(i, wback, 0xff); \ - wb1 = 0; \ - ed = i; \ - } else { \ - SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 1, D); \ - ADD(x3, wback, i); \ - if (wback != x3) wback = x3; \ - LBU(i, wback, fixedaddress); \ - wb1 = 1; \ - ed = i; \ - } // GETSEB sign extend EB, will use i for ed, and can use r3 for wback. #define GETSEB(i, D) \ if (MODREG) { \ if (rex.rex) { \ - wback = xRAX + (nextop & 7) + (rex.b << 3); \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ wb2 = 0; \ } else { \ wback = (nextop & 7); \ wb2 = (wback >> 2) * 8; \ - wback = xRAX + (wback & 3); \ + wback = TO_NAT(wback & 3); \ } \ MV(i, wback); \ SLLIW(i, i, 24 - wb2); \ @@ -334,7 +244,7 @@ ed = i; \ } else { \ SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &wback, x2, x3, &fixedaddress, rex, NULL, 1, D); \ + addr = geted(dyn, addr, ninst, nextop, &wback, x3, x2, &fixedaddress, rex, NULL, 1, D); \ LB(i, wback, fixedaddress); \ wb1 = 1; \ ed = i; \ @@ -343,15 +253,15 @@ #define GETEB32(i, D) \ if (MODREG) { \ if (rex.rex) { \ - wback = xRAX + (nextop & 7) + (rex.b << 3); \ + wback = TO_NAT((nextop & 7) + (rex.b << 3)); \ wb2 = 0; \ } else { \ wback = (nextop & 7); \ wb2 = (wback >> 2) * 8; \ - wback = xRAX + (wback & 3); \ + wback = TO_NAT(wback & 3); \ } \ if (wb2) { \ - if (rv64_xtheadbb) { \ + if (cpuext.xtheadbb) { \ TH_EXTU(i, wback, 15, 8); \ } else { \ MV(i, wback); \ @@ -371,37 +281,39 @@ } // GETGB will use i for gd -#define GETGB(i) \ - if (rex.rex) { \ - gb1 = xRAX + ((nextop & 0x38) >> 3) + (rex.r << 3); \ - gb2 = 0; \ - } else { \ - gd = (nextop & 0x38) >> 3; \ - gb2 = ((gd & 4) >> 2); \ - gb1 = xRAX + (gd & 3); \ - } \ - gd = i; \ - if (gb2) { \ - if (rv64_xtheadbb) { \ - TH_EXTU(gd, gb1, 15, 8); \ - } else { \ - SRLI(gd, gb1, 8); \ - ANDI(gd, gd, 0xff); \ - } \ - } else \ +#define GETGB(i) \ + if (rex.rex) { \ + gb1 = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + gb2 = 0; \ + } else { \ + gd = (nextop & 0x38) >> 3; \ + gb2 = ((gd & 4) >> 2); \ + gb1 = TO_NAT(gd & 3); \ + } \ + gd = i; \ + if (gb2) { \ + if (cpuext.xtheadbb) { \ + TH_EXTU(gd, gb1, 15, 8); \ + } else { \ + SRLI(gd, gb1, 8); \ + ANDI(gd, gd, 0xff); \ + } \ + } else \ ANDI(gd, gb1, 0xff); // Write gb (gd) back to original register / memory, using s1 as scratch -#define GBBACK(s1) do { \ - if (gb2) { \ - MOV64x(s1, 0xffffffffffff00ffLL); \ - AND(gb1, gb1, s1); \ - SLLI(s1, gd, 8); \ - OR(gb1, gb1, s1); \ - } else { \ - ANDI(gb1, gb1, ~0xff); \ - OR(gb1, gb1, gd); \ - } } while (0) +#define GBBACK(s1) \ + do { \ + if (gb2) { \ + MOV64x(s1, 0xffffffffffff00ffLL); \ + AND(gb1, gb1, s1); \ + SLLI(s1, gd, 8); \ + OR(gb1, gb1, s1); \ + } else { \ + ANDI(gb1, gb1, ~0xff); \ + OR(gb1, gb1, gd); \ + } \ + } while (0) // Write eb (ed) back to original register / memory, using s1 as scratch #define EBBACK(s1, c) \ @@ -420,6 +332,8 @@ OR(wback, wback, ed); \ } +#define GB_EQ_EB() (MODREG && ((nextop & 0x38) >> 3) == (nextop & 7) && (rex.r == rex.b)) + // Get direction with size Z and based of F_DF flag, on register r ready for load/store fetching // using s as scratch. #define GETDIR(r, s, Z) \ @@ -480,52 +394,130 @@ gback = xEmu; \ gdoffset = offsetof(x64emu_t, xmm[gd]) +#define GETGY() \ + gd = ((nextop & 0x38) >> 3) + (rex.r << 3); \ + /* TODO: forget */ \ + gyoffset = offsetof(x64emu_t, ymm[gd]) + +#define GETVX() \ + sse_forget_reg(dyn, ninst, x3, vex.v); \ + vback = xEmu; \ + vxoffset = offsetof(x64emu_t, xmm[vex.v]) + +#define GETVY() \ + /* TODO: forget */ \ + vyoffset = offsetof(x64emu_t, ymm[vex.v]); + // Get Ex address in general register a, will purge SS or SD if it's reg and is loaded. May use x3. Use wback as load address! -#define GETEX(a, D) \ - if (MODREG) { \ - ed = (nextop & 7) + (rex.b << 3); \ - sse_forget_reg(dyn, ninst, x3, ed); \ - fixedaddress = offsetof(x64emu_t, xmm[ed]); \ - wback = xEmu; \ - } else { \ - SMREAD(); \ - ed = 16; \ - addr = geted(dyn, addr, ninst, nextop, &wback, a, x3, &fixedaddress, rex, NULL, 0, D); \ - fixedaddress = 0; /* TODO: optimize this! */ \ +#define GETEX(a, D, I12) \ + if (MODREG) { \ + ed = (nextop & 7) + (rex.b << 3); \ + sse_forget_reg(dyn, ninst, x3, ed); \ + fixedaddress = offsetof(x64emu_t, xmm[ed]); \ + wback = xEmu; \ + } else { \ + SMREAD(); \ + ed = 16; \ + addr = geted(dyn, addr, ninst, nextop, &wback, a, x3, &fixedaddress, rex, NULL, I12, D); \ } + +#define GETEY() \ + if (MODREG) { \ + ed = (nextop & 7) + (rex.b << 3); \ + /* TODO: forget */ \ + wback = xEmu; \ + fixedaddress = offsetof(x64emu_t, ymm[ed]); \ + } else { \ + fixedaddress += 16; \ + } + + +#define GETEX32(a, D, I12) \ + if (MODREG) { \ + ed = (nextop & 7) + (rex.b << 3); \ + sse_forget_reg(dyn, ninst, x3, ed); \ + fixedaddress = offsetof(x64emu_t, xmm[ed]); \ + wback = xEmu; \ + } else { \ + SMREAD(); \ + ed = 16; \ + addr = geted32(dyn, addr, ninst, nextop, &wback, a, x3, &fixedaddress, rex, NULL, I12, D); \ + } + +// Get GX as a quad (might use x1) +#define GETGX_vector(a, w, sew) \ + gd = ((nextop & 0x38) >> 3) + (rex.r << 3); \ + a = sse_get_reg_vector(dyn, ninst, x1, gd, w, sew) + // Get EX as a quad, (x1 is used) -#define GETEX_vector(a, w, D) \ +#define GETEX_vector(a, w, D, sew) \ if (MODREG) { \ - a = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), w); \ + a = sse_get_reg_vector(dyn, ninst, x1, (nextop & 7) + (rex.b << 3), w, sew); \ } else { \ SMREAD(); \ - addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 1, D); \ + addr = geted(dyn, addr, ninst, nextop, &ed, x3, x2, &fixedaddress, rex, NULL, 0, D); \ a = fpu_get_scratch(dyn); \ - ADDI(x2, ed, fixedaddress); \ - VLE8_V(a, x2, VECTOR_UNMASKED, VECTOR_NFIELD1); \ + VLE_V(a, ed, sew, VECTOR_UNMASKED, VECTOR_NFIELD1); \ } -#define GETGM() \ - gd = ((nextop & 0x38) >> 3); \ - mmx_forget_reg(dyn, ninst, gd); \ - gback = xEmu; \ +// Put Back EX if it was a memory and not an emm register +#define PUTEX_vector(a, sew) \ + if (!MODREG) { \ + VSE_V(a, ed, sew, VECTOR_UNMASKED, VECTOR_NFIELD1); \ + SMWRITE2(); \ + } + +// Get GM, might use x1 as a scratch +#define GETGM() \ + gd = ((nextop & 0x38) >> 3); \ + mmx_forget_reg(dyn, ninst, x1, gd); \ + gback = xEmu; \ gdoffset = offsetof(x64emu_t, mmx[gd]) +// Get GM as vector, might use x1, x2 and x3 +#define GETGM_vector(a) \ + gd = ((nextop & 0x38) >> 3); \ + a = mmx_get_reg_vector(dyn, ninst, x1, x2, x3, gd) + // Get EM, might use x3 -#define GETEM(a, D) \ - if (MODREG) { \ - ed = (nextop & 7); \ - mmx_forget_reg(dyn, ninst, ed); \ - fixedaddress = offsetof(x64emu_t, mmx[ed]); \ - wback = xEmu; \ - } else { \ - SMREAD(); \ - ed = 8; \ - addr = geted(dyn, addr, ninst, nextop, &wback, a, x3, &fixedaddress, rex, NULL, 0, D); \ - fixedaddress = 0; /* TODO: optimize this! */ \ +#define GETEM(a, D, I12) \ + if (MODREG) { \ + ed = (nextop & 7); \ + mmx_forget_reg(dyn, ninst, a, ed); \ + fixedaddress = offsetof(x64emu_t, mmx[ed]); \ + wback = xEmu; \ + } else { \ + SMREAD(); \ + ed = 8; \ + addr = geted(dyn, addr, ninst, nextop, &wback, a, x3, &fixedaddress, rex, NULL, I12, D); \ + } + +// Get EM as vector, might use x1, x2 and x3; requires SEW64 +#define GETEM_vector(a, D) \ + if (MODREG) { \ + a = mmx_get_reg_vector(dyn, ninst, x1, x2, x3, (nextop & 7)); \ + } else { \ + SMREAD(); \ + addr = geted(dyn, addr, ninst, nextop, &ed, a, x3, &fixedaddress, rex, NULL, 1, D); \ + a = fpu_get_scratch(dyn); \ + FLD(a, ed, fixedaddress); \ + VFMV_S_F(a, a); \ + } + +// Put Back EM if it was a memory and not an mm register; requires SEW64 +#define PUTEM_vector(a) \ + if (!MODREG) { \ + VFMV_F_S(a, a); \ + FSD(a, ed, fixedaddress); \ + SMWRITE2(); \ } +#define GETGX_empty_vector(a) \ + gd = ((nextop & 0x38) >> 3) + (rex.r << 3); \ + a = sse_get_reg_empty_vector(dyn, ninst, x1, gd) + + #define SSE_LOOP_D_ITEM(GX1, EX1, F, i) \ LWU(GX1, gback, gdoffset + i * 4); \ LWU(EX1, wback, fixedaddress + i * 4); \ @@ -560,12 +552,12 @@ SW(GX1, gback, gdoffset + i * 4); \ } -#define MMX_LOOP_DS(GX1, EX1, F) \ - for (int i = 0; i < 2; ++i) { \ - LW(GX1, gback, gdoffset + i * 4); \ - LW(EX1, wback, fixedaddress + i * 4); \ - F; \ - SW(GX1, gback, gdoffset + i * 4); \ +#define MMX_LOOP_DS(GX1, EX1, F) \ + for (int i = 0; i < 2; ++i) { \ + LW(GX1, gback, gdoffset + i * 4); \ + LW(EX1, wback, fixedaddress + i * 4); \ + F; \ + SW(GX1, gback, gdoffset + i * 4); \ } #define MMX_LOOP_W(GX1, EX1, F) \ @@ -657,13 +649,15 @@ // CALL will use x6 for the call address. Return value can be put in ret (unless ret is -1) // R0 will not be pushed/popd if ret is -2 -#define CALL(F, ret) call_c(dyn, ninst, F, x6, ret, 1, 0) +#define CALL(F, ret, arg1, arg2) call_c(dyn, ninst, F, x6, ret, 1, 0, arg1, arg2, 0, 0, 0, 0) +#define CALL4(F, ret, arg1, arg2, arg3, arg4) call_c(dyn, ninst, F, x6, ret, 1, 0, arg1, arg2, arg3, arg4, 0, 0) +#define CALL6(F, ret, arg1, arg2, arg3, arg4, arg5, arg6) call_c(dyn, ninst, F, x6, ret, 1, 0, arg1, arg2, arg3, arg4, arg5, arg6) // CALL_ will use x6 for the call address. Return value can be put in ret (unless ret is -1) // R0 will not be pushed/popd if ret is -2 -#define CALL_(F, ret, reg) call_c(dyn, ninst, F, x6, ret, 1, reg) +#define CALL_(F, ret, reg, arg1, arg2) call_c(dyn, ninst, F, x6, ret, 1, reg, arg1, arg2, 0, 0, 0, 0) // CALL_S will use x6 for the call address. Return value can be put in ret (unless ret is -1) // R0 will not be pushed/popd if ret is -2. Flags are not save/restored -#define CALL_S(F, ret) call_c(dyn, ninst, F, x6, ret, 0, 0) +#define CALL_S(F, ret, arg1) call_c(dyn, ninst, F, x6, ret, 0, 0, arg1, 0, 0, 0, 0, 0) #define MARKi(i) dyn->insts[ninst].mark[i] = dyn->native_size #define GETMARKi(i) dyn->insts[ninst].mark[i] @@ -681,10 +675,12 @@ #define MARKF2 MARKFi(1) #define GETMARKF2 GETMARKFi(1) -#define MARKSEG dyn->insts[ninst].markseg = dyn->native_size -#define GETMARKSEG dyn->insts[ninst].markseg -#define MARKLOCK dyn->insts[ninst].marklock = dyn->native_size -#define GETMARKLOCK dyn->insts[ninst].marklock +#define MARKSEG dyn->insts[ninst].markseg = dyn->native_size +#define GETMARKSEG dyn->insts[ninst].markseg +#define MARKLOCK dyn->insts[ninst].marklock = dyn->native_size +#define GETMARKLOCK dyn->insts[ninst].marklock +#define MARKLOCK2 dyn->insts[ninst].marklock2 = dyn->native_size +#define GETMARKLOCK2 dyn->insts[ninst].marklock2 #define Bxx_gen(OP, M, reg1, reg2) \ j64 = GET##M - dyn->native_size; \ @@ -711,13 +707,13 @@ #define B_MARKi_nocond Bxx_geni(__, MARK, 0, 0, i) // Branch to MARK if reg1=reg2 (use j64) #define BGE_MARK(reg1, reg2) Bxx_gen(GE, MARK, reg1, reg2) -#define BGE_MARKi(reg1, reg2) Bxx_geni(GE, MARK, reg1, reg2, i) +#define BGE_MARKi(reg1, reg2, i) Bxx_geni(GE, MARK, reg1, reg2, i) // Branch to MARK2 if reg1==reg2 (use j64) #define BEQ_MARK2(reg1, reg2) Bxx_gen(EQ, MARK2, reg1, reg2) // Branch to MARK2 if reg1!=reg2 (use j64) @@ -734,6 +730,8 @@ #define BNE_MARK3(reg1, reg2) Bxx_gen(NE, MARK3, reg1, reg2) // Branch to MARK3 if reg1!>=reg2 (use j64) #define BGE_MARK3(reg1, reg2) Bxx_gen(GE, MARK3, reg1, reg2) +// Branch to MARK if reg1insts[ninst].x64.gen_flags & (A))) -#define IFX_PENDOR0 if ((dyn->insts[ninst].x64.gen_flags & (X_PEND) || !dyn->insts[ninst].x64.gen_flags)) +#define IFXA(A, B) if ((dyn->insts[ninst].x64.gen_flags & (A)) && (B)) +#define IFXORNAT(A) if ((dyn->insts[ninst].x64.gen_flags & (A)) || dyn->insts[ninst].nat_flags_fusion) +#define IFX_PENDOR0 if ((dyn->insts[ninst].x64.gen_flags & (X_PEND) || (!dyn->insts[ninst].x64.gen_flags && !dyn->insts[ninst].nat_flags_fusion))) #define IFXX(A) if ((dyn->insts[ninst].x64.gen_flags == (A))) #define IFX2X(A, B) if ((dyn->insts[ninst].x64.gen_flags == (A) || dyn->insts[ninst].x64.gen_flags == (B) || dyn->insts[ninst].x64.gen_flags == ((A) | (B)))) #define IFXN(A, B) if ((dyn->insts[ninst].x64.gen_flags & (A) && !(dyn->insts[ninst].x64.gen_flags & (B)))) +#ifndef IF_UNALIGNED +#define IF_UNALIGNED(A) if(is_addr_unaligned(A)) +#endif + +#ifndef IF_ALIGNED +#define IF_ALIGNED(A) if (!is_addr_unaligned(A)) +#endif + +#ifndef NATIVE_RESTORE_X87PC +#define NATIVE_RESTORE_X87PC() \ + if (dyn->need_x87check) { \ + LD(x87pc, xEmu, offsetof(x64emu_t, cw)); \ + SRLI(x87pc, x87pc, 8); \ + ANDI(x87pc, x87pc, 0b11); \ + } +#endif +#ifndef X87_CHECK_PRECISION +#define X87_CHECK_PRECISION(A) \ + if (!ST_IS_F(0) && dyn->need_x87check) { \ + BNEZ(x87pc, 4 + 8); \ + FCVTSD(A, A); \ + FCVTDS(A, A); \ + } +#endif + #define STORE_REG(A) SD(x##A, xEmu, offsetof(x64emu_t, regs[_##A])) #define LOAD_REG(A) LD(x##A, xEmu, offsetof(x64emu_t, regs[_##A])) // Need to also store current value of some register, as they may be used by functions like setjmp -#define STORE_XEMU_CALL(s0) \ - if (rv64_xtheadmempair) { \ - ADDI(s0, xEmu, offsetof(x64emu_t, regs[_RSP])); \ - TH_SDD(xRDX, xRBX, xEmu, 1); \ - TH_SDD(xRSP, xRBP, s0, 0); \ - TH_SDD(xRSI, xRDI, s0, 1); \ - TH_SDD(xR8, xR9, s0, 2); \ - TH_SDD(xR10, xR11, s0, 3); \ - } else { \ - STORE_REG(RBX); \ - STORE_REG(RDX); \ - STORE_REG(RSP); \ - STORE_REG(RBP); \ - STORE_REG(RDI); \ - STORE_REG(RSI); \ - STORE_REG(R8); \ - STORE_REG(R9); \ - STORE_REG(R10); \ - STORE_REG(R11); \ - } +#define STORE_XEMU_CALL(s0) \ + STORE_REG(RBX); \ + STORE_REG(RSP); \ + STORE_REG(RBP); \ + STORE_REG(R10); \ + STORE_REG(R11); \ + STORE_REG(R12); \ + STORE_REG(R13); \ + STORE_REG(R14); \ + STORE_REG(R15); #define LOAD_XEMU_CALL() -#define LOAD_XEMU_REM(s0) \ - if (rv64_xtheadmempair) { \ - ADDI(s0, xEmu, offsetof(x64emu_t, regs[_RSP])); \ - TH_LDD(xRDX, xRBX, xEmu, 1); \ - TH_LDD(xRSP, xRBP, s0, 0); \ - TH_LDD(xRSI, xRDI, s0, 1); \ - TH_LDD(xR8, xR9, s0, 2); \ - TH_LDD(xR10, xR11, s0, 3); \ - } else { \ - LOAD_REG(RBX); \ - LOAD_REG(RDX); \ - LOAD_REG(RSP); \ - LOAD_REG(RBP); \ - LOAD_REG(RDI); \ - LOAD_REG(RSI); \ - LOAD_REG(R8); \ - LOAD_REG(R9); \ - LOAD_REG(R10); \ - LOAD_REG(R11); \ - } - +#define LOAD_XEMU_REM(s0) \ + LOAD_REG(RBX); \ + LOAD_REG(RSP); \ + LOAD_REG(RBP); \ + LOAD_REG(R10); \ + LOAD_REG(R11); \ + LOAD_REG(R12); \ + LOAD_REG(R13); \ + LOAD_REG(R14); \ + LOAD_REG(R15); + +#define FORCE_DFNONE() SW(xZR, xEmu, offsetof(x64emu_t, df)) + +#define SET_DFNONE() \ + do { \ + if (!dyn->f.dfnone) { \ + FORCE_DFNONE(); \ + } \ + if (!dyn->insts[ninst].x64.may_set) { \ + dyn->f.dfnone = 1; \ + } \ + } while (0) -#define SET_DFNONE() \ - do { \ - dyn->f.dfnone_here=1; \ - if (!dyn->f.dfnone) { \ - SW(xZR, xEmu, offsetof(x64emu_t, df)); \ - dyn->f.dfnone = 1; \ - } } while(0); - -#define SET_DF(S, N) \ - if ((N) != d_none) { \ - MOV_U12(S, (N)); \ - SW(S, xEmu, offsetof(x64emu_t, df)); \ - dyn->f.dfnone = 0; \ - } else \ +#define SET_DF(S, N) \ + if ((N) != d_none) { \ + MOV_U12(S, (N)); \ + SW(S, xEmu, offsetof(x64emu_t, df)); \ + if (dyn->f.pending == SF_PENDING && dyn->insts[ninst].x64.need_after && !(dyn->insts[ninst].x64.need_after & X_PEND)) { \ + CALL_(const_updateflags, -1, 0, 0, 0); \ + dyn->f.pending = SF_SET; \ + SET_NODF(); \ + } \ + dyn->f.dfnone = 0; \ + } else \ SET_DFNONE() #define SET_NODF() dyn->f.dfnone = 0 -#define SET_DFOK() dyn->f.dfnone = 1; dyn->f.dfnone_here=1 +#define SET_DFOK() \ + dyn->f.dfnone = 1 #define CLEAR_FLAGS() \ - IFX(X_ALL) { ANDI(xFlags, xFlags, ~((1UL << F_AF) | (1UL << F_CF) | (1UL << F_OF2) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF))); } + IFX (X_ALL) { ANDI(xFlags, xFlags, ~((1UL << F_AF) | (1UL << F_CF) | (1UL << F_OF2) | (1UL << F_ZF) | (1UL << F_SF) | (1UL << F_PF))); } + +#define SET_FLAGS_NEZ(reg, F, scratch) \ + do { \ + if (cpuext.xtheadcondmov) { \ + ORI(scratch, xFlags, 1 << F); \ + TH_MVNEZ(xFlags, scratch, reg); \ + } else { \ + BEQZ(reg, 8); \ + ORI(xFlags, xFlags, 1 << F); \ + } \ + } while (0) + +#define SET_FLAGS_EQZ(reg, F, scratch) \ + do { \ + if (cpuext.xtheadcondmov) { \ + ORI(scratch, xFlags, 1 << F); \ + TH_MVEQZ(xFlags, scratch, reg); \ + } else { \ + BNEZ(reg, 8); \ + ORI(xFlags, xFlags, 1 << F); \ + } \ + } while (0) + +#define SET_FLAGS_LTZ(reg, F, scratch1, scratch2) \ + do { \ + if (cpuext.xtheadcondmov) { \ + SLT(scratch1, reg, xZR); \ + ORI(scratch2, xFlags, 1 << F); \ + TH_MVNEZ(xFlags, scratch2, scratch1); \ + } else { \ + BGE(reg, xZR, 8); \ + ORI(xFlags, xFlags, 1 << F); \ + } \ + } while (0) +// might use op1_ as scratch #define CALC_SUB_FLAGS(op1_, op2, res, scratch1, scratch2, width) \ - IFX(X_AF | X_CF | X_OF) \ - { \ + IFX (X_AF | X_CF | X_OF) { \ /* calc borrow chain */ \ /* bc = (res & (~op1 | op2)) | (~op1 & op2) */ \ OR(scratch1, op1_, op2); \ AND(scratch2, res, scratch1); \ AND(op1_, op1_, op2); \ OR(scratch2, scratch2, op1_); \ - IFX(X_AF) \ - { \ + IFX (X_AF) { \ /* af = bc & 0x8 */ \ ANDI(scratch1, scratch2, 8); \ - BEQZ(scratch1, 8); \ - ORI(xFlags, xFlags, 1 << F_AF); \ + SET_FLAGS_NEZ(scratch1, F_AF, op1_); \ } \ - IFX(X_CF) \ - { \ + IFX (X_CF) { \ /* cf = bc & (1<<(width-1)) */ \ if ((width) == 8) { \ ANDI(scratch1, scratch2, 0x80); \ } else { \ - SRLI(scratch1, scratch2, (width)-1); \ + SRLI(scratch1, scratch2, (width) - 1); \ if ((width) != 64) ANDI(scratch1, scratch1, 1); \ } \ - BEQZ(scratch1, 8); \ - ORI(xFlags, xFlags, 1 << F_CF); \ + SET_FLAGS_NEZ(scratch1, F_CF, op1_); \ } \ - IFX(X_OF) \ - { \ + IFX (X_OF) { \ /* of = ((bc >> (width-2)) ^ (bc >> (width-1))) & 0x1; */ \ - SRLI(scratch1, scratch2, (width)-2); \ + SRLI(scratch1, scratch2, (width) - 2); \ SRLI(scratch2, scratch1, 1); \ XOR(scratch1, scratch1, scratch2); \ ANDI(scratch1, scratch1, 1); \ - BEQZ(scratch1, 8); \ - ORI(xFlags, xFlags, 1 << F_OF2); \ + SET_FLAGS_NEZ(scratch1, F_OF2, op1_); \ } \ } @@ -910,37 +963,39 @@ OR(dst, dst, s1) #if STEP == 0 -#define X87_PUSH_OR_FAIL(var, dyn, ninst, scratch, t) var = x87_do_push(dyn, ninst, scratch, t) -#define X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, scratch) x87_do_push_empty(dyn, ninst, scratch) -#define X87_POP_OR_FAIL(dyn, ninst, scratch) x87_do_pop(dyn, ninst, scratch) +#define X87_PUSH_OR_FAIL(var, dyn, ninst, scratch, t) var = x87_do_push(dyn, ninst, scratch, t) +#define X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, scratch) x87_do_push_empty(dyn, ninst, scratch) +#define X87_POP_OR_FAIL(dyn, ninst, scratch) x87_do_pop(dyn, ninst, scratch) #else -#define X87_PUSH_OR_FAIL(var, dyn, ninst, scratch, t) \ - if ((dyn->e.x87stack==8) || (dyn->e.pushed==8)) { \ - if(box64_dynarec_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Push, stack=%d/%d on inst %d\n", dyn->e.x87stack, dyn->e.pushed, ninst); \ - dyn->abort = 1; \ - return addr; \ - } \ +#define X87_PUSH_OR_FAIL(var, dyn, ninst, scratch, t) \ + if ((dyn->e.x87stack == 8) || (dyn->e.pushed == 8)) { \ + if (dyn->need_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Push, stack=%d/%d on inst %d\n", dyn->e.x87stack, dyn->e.pushed, ninst); \ + dyn->abort = 1; \ + return addr; \ + } \ var = x87_do_push(dyn, ninst, scratch, t); -#define X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, scratch) \ - if ((dyn->e.x87stack==8) || (dyn->e.pushed==8)) { \ - if(box64_dynarec_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Push, stack=%d/%d on inst %d\n", dyn->e.x87stack, dyn->e.pushed, ninst); \ - dyn->abort = 1; \ - return addr; \ - } \ +#define X87_PUSH_EMPTY_OR_FAIL(dyn, ninst, scratch) \ + if ((dyn->e.x87stack == 8) || (dyn->e.pushed == 8)) { \ + if (dyn->need_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Push, stack=%d/%d on inst %d\n", dyn->e.x87stack, dyn->e.pushed, ninst); \ + dyn->abort = 1; \ + return addr; \ + } \ x87_do_push_empty(dyn, ninst, scratch); -#define X87_POP_OR_FAIL(dyn, ninst, scratch) \ - if ((dyn->e.x87stack==-8) || (dyn->e.poped==8)) { \ - if(box64_dynarec_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Pop, stack=%d/%d on inst %d\n", dyn->e.x87stack, dyn->e.poped, ninst); \ - dyn->abort = 1; \ - return addr; \ - } \ +#define X87_POP_OR_FAIL(dyn, ninst, scratch) \ + if ((dyn->e.x87stack == -8) || (dyn->e.poped == 8)) { \ + if (dyn->need_dump) dynarec_log(LOG_NONE, " Warning, suspicious x87 Pop, stack=%d/%d on inst %d\n", dyn->e.x87stack, dyn->e.poped, ninst); \ + dyn->abort = 1; \ + return addr; \ + } \ x87_do_pop(dyn, ninst, scratch); #endif #ifndef MAYSETFLAGS -#define MAYSETFLAGS() do {} while (0) +#define MAYSETFLAGS() \ + do { \ + } while (0) #endif #ifndef READFLAGS @@ -948,28 +1003,63 @@ if (((A) != X_PEND && dyn->f.pending != SF_SET) \ && (dyn->f.pending != SF_SET_PENDING)) { \ if (dyn->f.pending != SF_PENDING) { \ - LD(x3, xEmu, offsetof(x64emu_t, df)); \ + LWU(x3, xEmu, offsetof(x64emu_t, df)); \ j64 = (GETMARKF) - (dyn->native_size); \ BEQ(x3, xZR, j64); \ } \ - CALL_(UpdateFlags, -1, 0); \ + CALL_(const_updateflags, -1, 0, 0, 0); \ MARKF; \ dyn->f.pending = SF_SET; \ SET_DFOK(); \ } #endif +#ifndef READFLAGS_FUSION +#define READFLAGS_FUSION(A, s1, s2, s3, s4, s5) \ + if (dyn->insts[ninst].nat_flags_fusion) \ + get_free_scratch(dyn, ninst, &tmp1, &tmp2, &tmp3, s1, s2, s3, s4, s5); \ + else { \ + tmp1 = s1; \ + tmp2 = s2; \ + tmp3 = s3; \ + } \ + READFLAGS(A) +#endif + +#define NAT_FLAGS_OPS(op1, op2, s1, s2) \ + do { \ + dyn->insts[dyn->insts[ninst].nat_next_inst].nat_flags_op1 = op1; \ + dyn->insts[dyn->insts[ninst].nat_next_inst].nat_flags_op2 = op2; \ + if (dyn->insts[ninst + 1].no_scratch_usage && IS_GPR(op1)) { \ + MV(s1, op1); \ + dyn->insts[dyn->insts[ninst].nat_next_inst].nat_flags_op1 = s1; \ + } \ + if (dyn->insts[ninst + 1].no_scratch_usage && IS_GPR(op2)) { \ + MV(s2, op2); \ + dyn->insts[dyn->insts[ninst].nat_next_inst].nat_flags_op2 = s2; \ + } \ + } while (0) + +#define NAT_FLAGS_ENABLE_CARRY() dyn->insts[ninst].nat_flags_carry = 1 +#define NAT_FLAGS_ENABLE_SIGN() dyn->insts[ninst].nat_flags_sign = 1 + #ifndef SETFLAGS -#define SETFLAGS(A, B) \ +#define SETFLAGS(A, B, FUSION) \ if (dyn->f.pending != SF_SET \ - && ((B)&SF_SUB) \ + && ((B) & SF_SUB) \ && (dyn->insts[ninst].x64.gen_flags & (~(A)))) \ READFLAGS(((dyn->insts[ninst].x64.gen_flags & X_PEND) ? X_ALL : dyn->insts[ninst].x64.gen_flags) & (~(A))); \ if (dyn->insts[ninst].x64.gen_flags) switch (B) { \ case SF_SUBSET: \ case SF_SET: dyn->f.pending = SF_SET; break; \ - case SF_SET_DF: dyn->f.pending = SF_SET; dyn->f.dfnone = 1; break; \ - case SF_SET_NODF: dyn->f.pending = SF_SET; dyn->f.dfnone = 0; break; \ + case SF_SET_DF: \ + dyn->f.pending = SF_SET; \ + dyn->f.dfnone = 1; \ + break; \ + case SF_SET_NODF: \ + dyn->f.pending = SF_SET; \ + dyn->f.dfnone = 0; \ + break; \ case SF_PENDING: dyn->f.pending = SF_PENDING; break; \ case SF_SUBSET_PENDING: \ case SF_SET_PENDING: \ @@ -977,7 +1067,8 @@ break; \ } \ else \ - dyn->f.pending = SF_SET + dyn->f.pending = SF_SET; \ + dyn->insts[ninst].nat_flags_nofusion = (FUSION) #endif #ifndef JUMP #define JUMP(A, C) @@ -985,9 +1076,6 @@ #ifndef BARRIER #define BARRIER(A) #endif -#ifndef BARRIER_NEXT -#define BARRIER_NEXT(A) -#endif #ifndef SET_HASCALLRET #define SET_HASCALLRET() #endif @@ -1003,13 +1091,16 @@ #define UFLAG_RES(A) \ if (dyn->insts[ninst].x64.gen_flags) { SDxw(A, xEmu, offsetof(x64emu_t, res)); } #define UFLAG_DF(r, A) \ - if (dyn->insts[ninst].x64.gen_flags) { SET_DF(r, A) } + if (dyn->insts[ninst].x64.gen_flags) { SET_DF(r, A); } #define UFLAG_IF if (dyn->insts[ninst].x64.gen_flags) #ifndef DEFAULT #define DEFAULT \ *ok = -1; \ BARRIER(2) #endif +#ifndef DEFAULT_VECTOR +#define DEFAULT_VECTOR return 0 +#endif #ifndef TABLE64 #define TABLE64(A, V) @@ -1017,39 +1108,54 @@ #ifndef FTABLE64 #define FTABLE64(A, V) #endif +#ifndef TABLE64C +#define TABLE64C(A, V) +#endif +#ifndef TABLE64_ +#define TABLE64_(A, V) +#endif -#define ARCH_INIT() +#define ARCH_INIT() \ + SMSTART(); \ + dyn->vector_sew = VECTOR_SEWNA; +#define ARCH_RESET() \ + dyn->vector_sew = VECTOR_SEWNA; #if STEP < 2 -#define GETIP(A) TABLE64(0, 0) -#define GETIP_(A) TABLE64(0, 0) +#define GETIP(A, scratch) +#define GETIP_(A, scratch) #else -// put value in the Table64 even if not using it for now to avoid difference between Step2 and Step3. Needs to be optimized later... -#define GETIP(A) \ - if (dyn->last_ip && ((A)-dyn->last_ip) < 2048) { \ - uint64_t _delta_ip = (A)-dyn->last_ip; \ - dyn->last_ip += _delta_ip; \ - if (_delta_ip) { \ - ADDI(xRIP, xRIP, _delta_ip); \ - } \ - } else { \ - dyn->last_ip = (A); \ - if (dyn->last_ip < 0xffffffff) { \ - MOV64x(xRIP, dyn->last_ip); \ - } else \ - TABLE64(xRIP, dyn->last_ip); \ - } -#define GETIP_(A) \ - if (dyn->last_ip && ((A)-dyn->last_ip) < 2048) { \ - int64_t _delta_ip = (A)-dyn->last_ip; \ - if (_delta_ip) { ADDI(xRIP, xRIP, _delta_ip); } \ - } else { \ - if ((A) < 0xffffffff) { \ - MOV64x(xRIP, (A)); \ - } else \ - TABLE64(xRIP, (A)); \ - } +#define GETIP_(A, scratch) \ + do { \ + ssize_t _delta_ip = (ssize_t)(A) - (ssize_t)dyn->last_ip; \ + if (!dyn->last_ip) { \ + if (dyn->need_reloc) { \ + TABLE64(xRIP, (A)); \ + } else { \ + MOV64x(xRIP, (A)); \ + } \ + } else if (_delta_ip == 0) { \ + } else if (_delta_ip >= -2048 && _delta_ip < 2048) { \ + ADDI(xRIP, xRIP, _delta_ip); \ + } else if (_delta_ip < 0 && _delta_ip >= -0xffffffffL) { \ + MOV32w(scratch, -_delta_ip); \ + SUB(xRIP, xRIP, scratch); \ + } else if (_delta_ip > 0 && _delta_ip <= 0xffffffffL) { \ + MOV32w(scratch, _delta_ip); \ + ADD(xRIP, xRIP, scratch); \ + } else { \ + if (dyn->need_reloc) { \ + TABLE64(xRIP, (A)); \ + } else { \ + MOV64x(xRIP, (A)); \ + } \ + } \ + } while (0) +#define GETIP(A, scratch) \ + GETIP_(A, scratch); \ + dyn->last_ip = (A); + #endif #define CLEARIP() dyn->last_ip = 0 @@ -1065,9 +1171,19 @@ #define MODREG ((nextop & 0xC0) == 0xC0) -void rv64_epilog(void); -void rv64_epilog_fast(void); -void* rv64_next(x64emu_t* emu, uintptr_t addr); +#ifndef SET_ELEMENT_WIDTH +#define SET_ELEMENT_WIDTH(s1, sew, set) \ + do { \ + if ((sew) == VECTOR_SEWANY && dyn->vector_sew != VECTOR_SEWNA) { \ + dyn->vector_eew = dyn->vector_sew; \ + } else if ((sew) == dyn->vector_sew) { \ + dyn->vector_eew = dyn->vector_sew; \ + } else { \ + dyn->vector_eew = vector_vsetvli(dyn, ninst, s1, (sew), VECTOR_LMUL1, 1); \ + } \ + if (set) dyn->vector_sew = dyn->vector_eew; \ + } while (0) +#endif #ifndef STEPNAME #define STEPNAME3(N, M) N##M @@ -1083,11 +1199,8 @@ void* rv64_next(x64emu_t* emu, uintptr_t addr); #define dynarec64_00_2 STEPNAME(dynarec64_00_2) #define dynarec64_00_3 STEPNAME(dynarec64_00_3) #define dynarec64_0F STEPNAME(dynarec64_0F) -#define dynarec64_64 STEPNAME(dynarec64_64) #define dynarec64_65 STEPNAME(dynarec64_65) #define dynarec64_66 STEPNAME(dynarec64_66) -#define dynarec64_67 STEPNAME(dynarec64_67) -#define dynarec64_67_32 STEPNAME(dynarec64_67_32) #define dynarec64_D8 STEPNAME(dynarec64_D8) #define dynarec64_D9 STEPNAME(dynarec64_D9) #define dynarec64_DA STEPNAME(dynarec64_DA) @@ -1098,17 +1211,27 @@ void* rv64_next(x64emu_t* emu, uintptr_t addr); #define dynarec64_DF STEPNAME(dynarec64_DF) #define dynarec64_F0 STEPNAME(dynarec64_F0) #define dynarec64_660F STEPNAME(dynarec64_660F) +#define dynarec64_660F38 STEPNAME(dynarec64_660F38) #define dynarec64_66F20F STEPNAME(dynarec64_66F20F) #define dynarec64_66F30F STEPNAME(dynarec64_66F30F) -#define dynarec64_6664 STEPNAME(dynarec64_6664) #define dynarec64_66F0 STEPNAME(dynarec64_66F0) #define dynarec64_F20F STEPNAME(dynarec64_F20F) #define dynarec64_F30F STEPNAME(dynarec64_F30F) +#define dynarec64_0F_vector STEPNAME(dynarec64_0F_vector) #define dynarec64_660F_vector STEPNAME(dynarec64_660F_vector) +#define dynarec64_F20F_vector STEPNAME(dynarec64_F20F_vector) +#define dynarec64_F30F_vector STEPNAME(dynarec64_F30F_vector) + +#define dynarec64_AVX STEPNAME(dynarec64_AVX) +#define dynarec64_AVX_0F STEPNAME(dynarec64_AVX_0F) +#define dynarec64_AVX_66_0F STEPNAME(dynarec64_AVX_66_0F) +#define dynarec64_AVX_66_0F38 STEPNAME(dynarec64_AVX_66_0F38) +#define dynarec64_AVX_66_0F3A STEPNAME(dynarec64_AVX_66_0F3A) +#define dynarec64_AVX_F2_0F STEPNAME(dynarec64_AVX_F2_0F) +#define dynarec64_AVX_F3_0F STEPNAME(dynarec64_AVX_F3_0F) #define geted STEPNAME(geted) -#define geted32 STEPNAME(geted32) #define geted16 STEPNAME(geted16) #define jump_to_epilog STEPNAME(jump_to_epilog) #define jump_to_epilog_fast STEPNAME(jump_to_epilog_fast) @@ -1126,6 +1249,7 @@ void* rv64_next(x64emu_t* emu, uintptr_t addr); #define emit_cmp16_0 STEPNAME(emit_cmp16_0) #define emit_cmp32_0 STEPNAME(emit_cmp32_0) #define emit_test8 STEPNAME(emit_test8) +#define emit_test8c STEPNAME(emit_test8c) #define emit_test16 STEPNAME(emit_test16) #define emit_test32 STEPNAME(emit_test32) #define emit_test32c STEPNAME(emit_test32) @@ -1197,46 +1321,55 @@ void* rv64_next(x64emu_t* emu, uintptr_t addr); #define emit_shr32 STEPNAME(emit_shr32) #define emit_shr32c STEPNAME(emit_shr32c) #define emit_sar32c STEPNAME(emit_sar32c) +#define emit_rol16c STEPNAME(emit_rol16c) #define emit_rol32 STEPNAME(emit_rol32) +#define emit_ror16c STEPNAME(emit_ror16c) #define emit_ror32 STEPNAME(emit_ror32) #define emit_rol32c STEPNAME(emit_rol32c) #define emit_ror32c STEPNAME(emit_ror32c) #define emit_shrd32c STEPNAME(emit_shrd32c) #define emit_shld32c STEPNAME(emit_shld32c) -#define emit_shrd32 STEPNAME(emit_shld32) +#define emit_shrd32 STEPNAME(emit_shrd32) #define emit_shld32 STEPNAME(emit_shld32) #define emit_shld16c STEPNAME(emit_shld16c) +#define emit_shld16 STEPNAME(emit_shld16) #define emit_shrd16c STEPNAME(emit_shrd16c) +#define emit_shrd16 STEPNAME(emit_shrd16) +#define emit_rcl16c STEPNAME(emit_rcl16c) +#define emit_rcr16c STEPNAME(emit_rcr16c) #define emit_pf STEPNAME(emit_pf) -#define x87_do_push STEPNAME(x87_do_push) -#define x87_do_push_empty STEPNAME(x87_do_push_empty) -#define x87_do_pop STEPNAME(x87_do_pop) -#define x87_get_current_cache STEPNAME(x87_get_current_cache) -#define x87_get_cache STEPNAME(x87_get_cache) -#define x87_get_extcache STEPNAME(x87_get_extcache) -#define x87_get_st STEPNAME(x87_get_st) -#define x87_get_st_empty STEPNAME(x87_get_st) -#define x87_free STEPNAME(x87_free) -#define x87_refresh STEPNAME(x87_refresh) -#define x87_forget STEPNAME(x87_forget) -#define x87_reget_st STEPNAME(x87_reget_st) -#define x87_stackcount STEPNAME(x87_stackcount) -#define x87_unstackcount STEPNAME(x87_unstackcount) -#define x87_swapreg STEPNAME(x87_swapreg) -#define x87_setround STEPNAME(x87_setround) -#define x87_restoreround STEPNAME(x87_restoreround) -#define sse_setround STEPNAME(sse_setround) -#define mmx_get_reg STEPNAME(mmx_get_reg) -#define mmx_get_reg_empty STEPNAME(mmx_get_reg_empty) -#define mmx_forget_reg STEPNAME(mmx_forget_reg) -#define sse_get_reg STEPNAME(sse_get_reg) -#define sse_get_reg_empty STEPNAME(sse_get_reg_empty) -#define sse_forget_reg STEPNAME(sse_forget_reg) -#define sse_purge07cache STEPNAME(sse_purge07cache) -#define sse_reflect_reg STEPNAME(sse_reflect_reg) - +#define x87_do_push STEPNAME(x87_do_push) +#define x87_do_push_empty STEPNAME(x87_do_push_empty) +#define x87_do_pop STEPNAME(x87_do_pop) +#define x87_get_current_cache STEPNAME(x87_get_current_cache) +#define x87_get_cache STEPNAME(x87_get_cache) +#define x87_get_extcache STEPNAME(x87_get_extcache) +#define x87_get_st STEPNAME(x87_get_st) +#define x87_get_st_empty STEPNAME(x87_get_st) +#define x87_free STEPNAME(x87_free) +#define x87_refresh STEPNAME(x87_refresh) +#define x87_forget STEPNAME(x87_forget) +#define x87_reget_st STEPNAME(x87_reget_st) +#define x87_stackcount STEPNAME(x87_stackcount) +#define x87_unstackcount STEPNAME(x87_unstackcount) +#define x87_swapreg STEPNAME(x87_swapreg) +#define x87_setround STEPNAME(x87_setround) +#define x87_restoreround STEPNAME(x87_restoreround) +#define sse_setround STEPNAME(sse_setround) +#define mmx_get_reg STEPNAME(mmx_get_reg) +#define mmx_get_reg_empty STEPNAME(mmx_get_reg_empty) +#define mmx_forget_reg STEPNAME(mmx_forget_reg) +#define sse_get_reg STEPNAME(sse_get_reg) +#define sse_get_reg_empty STEPNAME(sse_get_reg_empty) +#define sse_get_reg_size_changed STEPNAME(sse_get_reg_size_changed) +#define sse_forget_reg STEPNAME(sse_forget_reg) +#define sse_purge07cache STEPNAME(sse_purge07cache) +#define sse_reflect_reg STEPNAME(sse_reflect_reg) + +#define mmx_get_reg_vector STEPNAME(mmx_get_reg_vector) +#define mmx_get_reg_empty_vector STEPNAME(mmx_get_reg_empty_vector) #define sse_get_reg_empty_vector STEPNAME(sse_get_reg_empty_vector) #define sse_get_reg_vector STEPNAME(sse_get_reg_vector) #define sse_forget_reg_vector STEPNAME(sse_forget_reg_vector) @@ -1246,36 +1379,34 @@ void* rv64_next(x64emu_t* emu, uintptr_t addr); #define fpu_reset_cache STEPNAME(fpu_reset_cache) #define fpu_propagate_stack STEPNAME(fpu_propagate_stack) #define fpu_purgecache STEPNAME(fpu_purgecache) +#define fpu_needpurgecache STEPNAME(fpu_needpurgecache) #define mmx_purgecache STEPNAME(mmx_purgecache) #define x87_purgecache STEPNAME(x87_purgecache) #define sse_purgecache STEPNAME(sse_purgecache) #define fpu_reflectcache STEPNAME(fpu_reflectcache) #define fpu_unreflectcache STEPNAME(fpu_unreflectcache) +#define x87_reflectcount STEPNAME(x87_reflectcount) +#define x87_unreflectcount STEPNAME(x87_unreflectcount) #define CacheTransform STEPNAME(CacheTransform) #define rv64_move64 STEPNAME(rv64_move64) #define rv64_move32 STEPNAME(rv64_move32) -#define vector_vsetvl_emul1 STEPNAME(vector_vsetvl_emul1) +#define vector_vsetvli STEPNAME(vector_vsetvli) +#define vector_loadmask STEPNAME(vector_loadmask) /* setup r2 to address pointed by */ uintptr_t geted(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int* l, int i12, int delta); - -/* setup r2 to address pointed by */ -uintptr_t geted32(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int* l, int i12, int delta); - -/* setup r2 to address pointed by */ -// uintptr_t geted16(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, int64_t* fixaddress, int absmax, uint32_t mask, int s); - +uintptr_t geted16(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, uint8_t nextop, uint8_t* ed, uint8_t hint, uint8_t scratch, int64_t* fixaddress, rex_t rex, int i12); // generic x64 helper void jump_to_epilog(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst); void jump_to_epilog_fast(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst); void jump_to_next(dynarec_rv64_t* dyn, uintptr_t ip, int reg, int ninst, int is32bits); -void ret_to_epilog(dynarec_rv64_t* dyn, int ninst, rex_t rex); -void retn_to_epilog(dynarec_rv64_t* dyn, int ninst, rex_t rex, int n); -void iret_to_epilog(dynarec_rv64_t* dyn, int ninst, int is64bits); -void call_c(dynarec_rv64_t* dyn, int ninst, void* fnc, int reg, int ret, int saveflags, int save_reg); +void ret_to_epilog(dynarec_rv64_t* dyn, uintptr_t ip, int ninst, rex_t rex); +void retn_to_epilog(dynarec_rv64_t* dyn, uintptr_t ip, int ninst, rex_t rex, int n); +void iret_to_epilog(dynarec_rv64_t* dyn, uintptr_t ip, int ninst, int is64bits); +void call_c(dynarec_rv64_t* dyn, int ninst, rv64_consts_t fnc, int reg, int ret, int saveflags, int savereg, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6); void call_n(dynarec_rv64_t* dyn, int ninst, void* fnc, int w); void grab_segdata(dynarec_rv64_t* dyn, uintptr_t addr, int ninst, int reg, int segment); void emit_cmp8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6); @@ -1283,15 +1414,16 @@ void emit_cmp16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, void emit_cmp32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5, int s6); void emit_cmp8_0(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4); void emit_cmp16_0(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4); -void emit_cmp32_0(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s3, int s4); +void emit_cmp32_0(dynarec_rv64_t* dyn, int ninst, rex_t rex, uint8_t nextop, int s1, int s3, int s4, int s5); void emit_test8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_test8c(dynarec_rv64_t* dyn, int ninst, int s1, uint8_t c, int s3, int s4, int s5); void emit_test16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); void emit_test32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); void emit_test32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s3, int s4, int s5); void emit_add32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); void emit_add32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5); -void emit_add8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4); -void emit_add8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s2, int s3, int s4); +void emit_add8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); +void emit_add8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s2, int s3, int s4, int s5); void emit_sub32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); void emit_sub32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, int s2, int s3, int s4, int s5); void emit_sub8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); @@ -1319,7 +1451,7 @@ void emit_xor16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, void emit_and16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4); // void emit_and16c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); void emit_inc32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); -void emit_inc16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_inc16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); void emit_inc8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4); void emit_dec32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); void emit_dec16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); @@ -1336,9 +1468,9 @@ void emit_sbb8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, i void emit_sbb8c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4, int s5, int s6); void emit_sbb16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5); // void emit_sbb16c(dynarec_rv64_t* dyn, int ninst, int s1, int32_t c, int s3, int s4); -void emit_neg32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3); -void emit_neg16(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4); -void emit_neg8(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4); +void emit_neg32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4, int s5); +void emit_neg16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4); +void emit_neg8(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4); void emit_shl8c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5); void emit_shr8c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5); void emit_sar8c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4, int s5); @@ -1358,19 +1490,25 @@ void emit_shr32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, void emit_sar32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); void emit_rol32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); void emit_ror32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s3, int s4); +void emit_rol16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); +void emit_ror16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); void emit_rol32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); void emit_ror32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, uint32_t c, int s3, int s4); -void emit_shrd32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4); -void emit_shld32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4); +void emit_shrd32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5); +void emit_shld32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5); void emit_shrd32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s5, int s3, int s4, int s6); void emit_shld32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s5, int s3, int s4, int s6); void emit_shrd16c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5); void emit_shld16c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, uint32_t c, int s3, int s4, int s5); +void emit_shld16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6); +void emit_shrd16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, int s5, int s6); +void emit_rcl16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); +void emit_rcr16c(dynarec_rv64_t* dyn, int ninst, int s1, uint32_t c, int s3, int s4); void emit_pf(dynarec_rv64_t* dyn, int ninst, int s1, int s3, int s4); // x87 helper -// cache of the local stack counter, to avoid upadte at every call +// cache of the local stack counter, to avoid update at every call int x87_stackcount(dynarec_rv64_t* dyn, int ninst, int scratch); // restore local stack counter void x87_unstackcount(dynarec_rv64_t* dyn, int ninst, int scratch, int count); @@ -1412,7 +1550,8 @@ void CacheTransform(dynarec_rv64_t* dyn, int ninst, int cacheupd, int s1, int s2 void rv64_move64(dynarec_rv64_t* dyn, int ninst, int reg, int64_t val); void rv64_move32(dynarec_rv64_t* dyn, int ninst, int reg, int32_t val, int zeroup); -void vector_vsetvl_emul1(dynarec_rv64_t* dyn, int ninst, int s1, int sew); +int vector_vsetvli(dynarec_rv64_t* dyn, int ninst, int s1, int sew, int vlmul, float multiple); +void vector_loadmask(dynarec_rv64_t* dyn, int ninst, int vreg, uint64_t imm, int s1, float multiple); #if STEP < 2 #define CHECK_CACHE() 0 @@ -1435,7 +1574,7 @@ int extcache_st_coherency(dynarec_rv64_t* dyn, int ninst, int a, int b); #define X87_ST0 extcache_no_i64(dyn, ninst, 0, extcache_get_current_st(dyn, ninst, 0)) #define X87_ST(A) extcache_no_i64(dyn, ninst, A, extcache_get_current_st(dyn, ninst, A)) #else -#define ST_IS_F(A) (extcache_get_st(dyn, ninst, A) == EXT_CACHE_ST_F) +#define ST_IS_F(A) (extcache_get_st(dyn, ninst, A) == EXT_CACHE_ST_F) #define ST_IS_I64(A) (extcache_get_st(dyn, ninst, A) == EXT_CACHE_ST_I64) #if STEP == 3 #define X87_COMBINE(A, B) extcache_st_coherency(dyn, ninst, A, B) @@ -1449,18 +1588,24 @@ int extcache_st_coherency(dynarec_rv64_t* dyn, int ninst, int a, int b); // MMX helpers // get float register for a MMX reg, create the entry if needed int mmx_get_reg(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int a); +// get vector register for a MMX reg, create the entry if needed +int mmx_get_reg_vector(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int a); // get float register for a MMX reg, but don't try to synch it if it needed to be created int mmx_get_reg_empty(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int a); +// get vector register for a MMX reg, but don't try to synch it if it needed to be created +int mmx_get_reg_empty_vector(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int a); // forget float register for a MMX reg, create the entry if needed -void mmx_forget_reg(dynarec_rv64_t* dyn, int ninst, int a); +void mmx_forget_reg(dynarec_rv64_t* dyn, int ninst, int s1, int a); // SSE/SSE2 helpers // get float register for a SSE reg, create the entry if needed int sse_get_reg(dynarec_rv64_t* dyn, int ninst, int s1, int a, int single); // get rvv register for a SSE reg, create the entry if needed -int sse_get_reg_vector(dynarec_rv64_t* dyn, int ninst, int s1, int a, int forwrite); +int sse_get_reg_vector(dynarec_rv64_t* dyn, int ninst, int s1, int a, int forwrite, int sew); // get float register for a SSE reg, but don't try to synch it if it needed to be created int sse_get_reg_empty(dynarec_rv64_t* dyn, int ninst, int s1, int a, int single); +// get an ext register for an SSE reg which changes size, with single or not AFTER the change +int sse_get_reg_size_changed(dynarec_rv64_t* dyn, int ninst, int s1, int a, int single); // get rvv register for an SSE reg, but don't try to synch it if it needed to be created int sse_get_reg_empty_vector(dynarec_rv64_t* dyn, int ninst, int s1, int a); // forget float register for a SSE reg, create the entry if needed @@ -1479,45 +1624,56 @@ void fpu_reset_cache(dynarec_rv64_t* dyn, int ninst, int reset_n); void fpu_propagate_stack(dynarec_rv64_t* dyn, int ninst); // purge the FPU cache (needs 3 scratch registers) void fpu_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1, int s2, int s3); +// check if the fpu cache need to be purged +int fpu_needpurgecache(dynarec_rv64_t* dyn, int ninst); // purge MMX cache void mmx_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1); // purge x87 cache void x87_purgecache(dynarec_rv64_t* dyn, int ninst, int next, int s1, int s2, int s3); void fpu_reflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3); void fpu_unreflectcache(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3); +void x87_reflectcount(dynarec_rv64_t* dyn, int ninst, int s1, int s2); +void x87_unreflectcount(dynarec_rv64_t* dyn, int ninst, int s1, int s2); void fpu_pushcache(dynarec_rv64_t* dyn, int ninst, int s1, int not07); void fpu_popcache(dynarec_rv64_t* dyn, int ninst, int s1, int not07); -uintptr_t dynarec64_00(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); +uintptr_t dynarec64_00(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_00_0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_00_1(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); -uintptr_t dynarec64_64(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int seg, int* ok, int* need_epilog); -// uintptr_t dynarec64_65(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep,int* ok, int* need_epilog); -uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_67(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_67_32(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_D8(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_DA(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_DB(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_DC(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_DD(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_DE(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_DF(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); -uintptr_t dynarec64_F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); +uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_D8(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_D9(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DA(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DB(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DC(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DD(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DE(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_DF(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_660F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_660F38(dynarec_rv64_t* dyn, uintptr_t addr, uint8_t opcode, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_66F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_66F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); -uintptr_t dynarec64_6664(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int seg, int* ok, int* need_epilog); -uintptr_t dynarec64_66F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog); +uintptr_t dynarec64_66F0(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_F20F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_F30F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_0F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); uintptr_t dynarec64_660F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_F20F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); +uintptr_t dynarec64_F30F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int* ok, int* need_epilog); + +uintptr_t dynarec64_AVX(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_66_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_66_0F38(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_66_0F3A(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_F2_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); +uintptr_t dynarec64_AVX_F3_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, vex_t vex, int* ok, int* need_epilog); #if STEP < 2 #define PASS2(A) @@ -1537,98 +1693,116 @@ uintptr_t dynarec64_660F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t i #define MAYUSE(A) #endif -// GOCOND will use x1 and x3 -#define GOCOND(B, T1, T2) \ - case B + 0x0: \ - INST_NAME(T1 "O " T2); \ - GO(ANDI(x1, xFlags, 1 << F_OF2), EQZ, NEZ, X_OF) \ - break; \ - case B + 0x1: \ - INST_NAME(T1 "NO " T2); \ - GO(ANDI(x1, xFlags, 1 << F_OF2), NEZ, EQZ, X_OF) \ - break; \ - case B + 0x2: \ - INST_NAME(T1 "C " T2); \ - GO(ANDI(x1, xFlags, 1 << F_CF), EQZ, NEZ, X_CF) \ - break; \ - case B + 0x3: \ - INST_NAME(T1 "NC " T2); \ - GO(ANDI(x1, xFlags, 1 << F_CF), NEZ, EQZ, X_CF) \ - break; \ - case B + 0x4: \ - INST_NAME(T1 "Z " T2); \ - GO(ANDI(x1, xFlags, 1 << F_ZF), EQZ, NEZ, X_ZF) \ - break; \ - case B + 0x5: \ - INST_NAME(T1 "NZ " T2); \ - GO(ANDI(x1, xFlags, 1 << F_ZF), NEZ, EQZ, X_ZF) \ - break; \ - case B + 0x6: \ - INST_NAME(T1 "BE " T2); \ - GO(ANDI(x1, xFlags, (1 << F_CF) | (1 << F_ZF)), EQZ, NEZ, X_CF | X_ZF) \ - break; \ - case B + 0x7: \ - INST_NAME(T1 "NBE " T2); \ - GO(ANDI(x1, xFlags, (1 << F_CF) | (1 << F_ZF)), NEZ, EQZ, X_CF | X_ZF) \ - break; \ - case B + 0x8: \ - INST_NAME(T1 "S " T2); \ - GO(ANDI(x1, xFlags, 1 << F_SF), EQZ, NEZ, X_SF) \ - break; \ - case B + 0x9: \ - INST_NAME(T1 "NS " T2); \ - GO(ANDI(x1, xFlags, 1 << F_SF), NEZ, EQZ, X_SF) \ - break; \ - case B + 0xA: \ - INST_NAME(T1 "P " T2); \ - GO(ANDI(x1, xFlags, 1 << F_PF), EQZ, NEZ, X_PF) \ - break; \ - case B + 0xB: \ - INST_NAME(T1 "NP " T2); \ - GO(ANDI(x1, xFlags, 1 << F_PF), NEZ, EQZ, X_PF) \ - break; \ - case B + 0xC: \ - INST_NAME(T1 "L " T2); \ - GO(SRLI(x1, xFlags, F_SF - F_OF2); \ - XOR(x1, x1, xFlags); \ - ANDI(x1, x1, 1 << F_OF2), EQZ, NEZ, X_SF | X_OF) \ - break; \ - case B + 0xD: \ - INST_NAME(T1 "GE " T2); \ - GO(SRLI(x1, xFlags, F_SF - F_OF2); \ - XOR(x1, x1, xFlags); \ - ANDI(x1, x1, 1 << F_OF2), NEZ, EQZ, X_SF | X_OF) \ - break; \ - case B + 0xE: \ - INST_NAME(T1 "LE " T2); \ - GO(SRLI(x1, xFlags, F_SF - F_OF2); \ - XOR(x1, x1, xFlags); \ - ANDI(x1, x1, 1 << F_OF2); \ - ANDI(x3, xFlags, 1 << F_ZF); \ - OR(x1, x1, x3); \ - ANDI(x1, x1, (1 << F_OF2) | (1 << F_ZF)), EQZ, NEZ, X_SF | X_OF | X_ZF) \ - break; \ - case B + 0xF: \ - INST_NAME(T1 "G " T2); \ - GO(SRLI(x1, xFlags, F_SF - F_OF2); \ - XOR(x1, x1, xFlags); \ - ANDI(x1, x1, 1 << F_OF2); \ - ANDI(x3, xFlags, 1 << F_ZF); \ - OR(x1, x1, x3); \ - ANDI(x1, x1, (1 << F_OF2) | (1 << F_ZF)), NEZ, EQZ, X_SF | X_OF | X_ZF) \ +// GOCOND will use tmp1 and tmp3 +#define GOCOND(B, T1, T2) \ + case B + 0x0: \ + INST_NAME(T1 "O " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_OF2), EQZ, NEZ, _, _, X_OF) \ + break; \ + case B + 0x1: \ + INST_NAME(T1 "NO " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_OF2), NEZ, EQZ, _, _, X_OF) \ + break; \ + case B + 0x2: \ + INST_NAME(T1 "C " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_CF), EQZ, NEZ, GEU, LTU, X_CF) \ + break; \ + case B + 0x3: \ + INST_NAME(T1 "NC " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_CF), NEZ, EQZ, LTU, GEU, X_CF) \ + break; \ + case B + 0x4: \ + INST_NAME(T1 "Z " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_ZF), EQZ, NEZ, NE, EQ, X_ZF) \ + break; \ + case B + 0x5: \ + INST_NAME(T1 "NZ " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_ZF), NEZ, EQZ, EQ, NE, X_ZF) \ + break; \ + case B + 0x6: \ + INST_NAME(T1 "BE " T2); \ + GO(ANDI(tmp1, xFlags, (1 << F_CF) | (1 << F_ZF)), EQZ, NEZ, GTU, LEU, X_CF | X_ZF) \ + break; \ + case B + 0x7: \ + INST_NAME(T1 "NBE " T2); \ + GO(ANDI(tmp1, xFlags, (1 << F_CF) | (1 << F_ZF)), NEZ, EQZ, LEU, GTU, X_CF | X_ZF) \ + break; \ + case B + 0x8: \ + INST_NAME(T1 "S " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_SF), EQZ, NEZ, _, _, X_SF) \ + break; \ + case B + 0x9: \ + INST_NAME(T1 "NS " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_SF), NEZ, EQZ, _, _, X_SF) \ + break; \ + case B + 0xA: \ + INST_NAME(T1 "P " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_PF), EQZ, NEZ, _, _, X_PF) \ + break; \ + case B + 0xB: \ + INST_NAME(T1 "NP " T2); \ + GO(ANDI(tmp1, xFlags, 1 << F_PF), NEZ, EQZ, _, _, X_PF) \ + break; \ + case B + 0xC: \ + INST_NAME(T1 "L " T2); \ + GO(SRLI(tmp1, xFlags, F_SF - F_OF2); \ + XOR(tmp1, tmp1, xFlags); \ + ANDI(tmp1, tmp1, 1 << F_OF2), EQZ, NEZ, GE, LT, X_SF | X_OF) \ + break; \ + case B + 0xD: \ + INST_NAME(T1 "GE " T2); \ + GO(SRLI(tmp1, xFlags, F_SF - F_OF2); \ + XOR(tmp1, tmp1, xFlags); \ + ANDI(tmp1, tmp1, 1 << F_OF2), NEZ, EQZ, LT, GE, X_SF | X_OF) \ + break; \ + case B + 0xE: \ + INST_NAME(T1 "LE " T2); \ + GO(SRLI(tmp1, xFlags, F_SF - F_OF2); \ + XOR(tmp1, tmp1, xFlags); \ + ANDI(tmp1, tmp1, 1 << F_OF2); \ + ANDI(tmp3, xFlags, 1 << F_ZF); \ + OR(tmp1, tmp1, tmp3); \ + ANDI(tmp1, tmp1, (1 << F_OF2) | (1 << F_ZF)), EQZ, NEZ, GT, LE, X_SF | X_OF | X_ZF) \ + break; \ + case B + 0xF: \ + INST_NAME(T1 "G " T2); \ + GO(SRLI(tmp1, xFlags, F_SF - F_OF2); \ + XOR(tmp1, tmp1, xFlags); \ + ANDI(tmp1, tmp1, 1 << F_OF2); \ + ANDI(tmp3, xFlags, 1 << F_ZF); \ + OR(tmp1, tmp1, tmp3); \ + ANDI(tmp1, tmp1, (1 << F_OF2) | (1 << F_ZF)), NEZ, EQZ, LE, GT, X_SF | X_OF | X_ZF) \ break +// Dummy macros +#define B__safe(a, b, c) XOR(xZR, xZR, xZR) +#define B_(a, b, c) XOR(xZR, xZR, xZR) +#define S_(a, b, c) XOR(xZR, xZR, xZR) +#define MV_(a, b, c, d) XOR(xZR, xZR, xZR) + +#define NATIVEJUMP_safe(COND, val) \ + B##COND##_safe(dyn->insts[ninst].nat_flags_op1, dyn->insts[ninst].nat_flags_op2, val); + +#define NATIVEJUMP(COND, val) \ + B##COND(dyn->insts[ninst].nat_flags_op1, dyn->insts[ninst].nat_flags_op2, val); + +#define NATIVESET(COND, rd) \ + S##COND(rd, dyn->insts[ninst].nat_flags_op1, dyn->insts[ninst].nat_flags_op2); + +#define NATIVEMV(COND, rd, rs) \ + MV##COND(rd, rs, dyn->insts[ninst].nat_flags_op1, dyn->insts[ninst].nat_flags_op2); + #define NOTEST(s1) \ - if (box64_dynarec_test) { \ + if (BOX64ENV(dynarec_test)) { \ SW(xZR, xEmu, offsetof(x64emu_t, test.test)); \ SW(xZR, xEmu, offsetof(x64emu_t, test.clean)); \ } #define SKIPTEST(s1) \ - if (box64_dynarec_test) { \ + if (BOX64ENV(dynarec_test)) { \ SW(xZR, xEmu, offsetof(x64emu_t, test.clean)); \ } #define GOTEST(s1, s2) \ - if (box64_dynarec_test) { \ + if (BOX64ENV(dynarec_test)) { \ MOV32w(s2, 1); \ SW(s2, xEmu, offsetof(x64emu_t, test.test)); \ } @@ -1668,50 +1842,142 @@ uintptr_t dynarec64_660F_vector(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t i #define FCOMS(v1, v2, s1, s2, s3, s4, s5) FCOM(S, v1, v2, s1, s2, s3, s4, s5) #define FCOMD(v1, v2, s1, s2, s3, s4, s5) FCOM(D, v1, v2, s1, s2, s3, s4, s5) -#define FCOMI(w, v1, v2, s1, s2, s3, s4, s5) \ - IFX(X_OF|X_AF|X_SF|X_PEND) { \ - MOV64x(s2, ~((1< 32767) ? 32767 : reg) -#define SAT16(reg, s) \ - LUI(s, 0xFFFF8); /* -32768 */ \ - BGE(reg, s, 4 + 2 * 4); \ - MV(reg, s); \ - J(4 + 4 * 3); \ - LUI(s, 8); /* 32768 */ \ - BLT(reg, s, 4 + 4); \ - ADDIW(reg, s, -1); +#define PURGE_YMM() + +// TODO: zbb? +#define SATw(reg, min, maxp1) \ + do { \ + BGE(reg, min, 4 + 4); \ + MV(reg, min); \ + BLT(reg, maxp1, 4 + 4); \ + ADDIW(reg, maxp1, -1); \ + } while (0) + +#define SATUw(reg, maxu) \ + do { \ + BGE(reg, xZR, 4 + 4); \ + MV(reg, xZR); \ + BLT(reg, maxu, 4 + 4); \ + ADDIW(reg, maxu, -1); \ + } while (0) + +#define FAST_8BIT_OPERATION(dst, src, s1, OP) \ + if (MODREG && (cpuext.zbb || cpuext.xtheadbb) && !dyn->insts[ninst].x64.gen_flags) { \ + if (rex.rex) { \ + wb = TO_NAT((nextop & 7) + (rex.b << 3)); \ + wb2 = 0; \ + gb = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + gb2 = 0; \ + } else { \ + wb = (nextop & 7); \ + wb2 = (wb >> 2) * 8; \ + wb = TO_NAT(wb & 3); \ + gd = (nextop & 0x38) >> 3; \ + gb2 = ((gd & 4) >> 2) * 8; \ + gb = TO_NAT(gd & 3); \ + } \ + if (src##2) { ANDI(s1, src, 0xf00); } \ + SLLI(s1, (src##2 ? s1 : src), 64 - src##2 - 8); \ + if (cpuext.zbb) { \ + RORI(dst, dst, 8 + dst##2); \ + } else { \ + TH_SRRI(dst, dst, 8 + dst##2); \ + } \ + OP; \ + if (cpuext.zbb) { \ + RORI(dst, dst, 64 - 8 - dst##2); \ + } else { \ + TH_SRRI(dst, dst, 64 - 8 - dst##2); \ + } \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + ANDI(s1, dst, 0xff); \ + NAT_FLAGS_OPS(s1, xZR, xZR, xZR); \ + } \ + break; \ + } + +#define FAST_16BIT_OPERATION(dst, src, s1, OP) \ + if (MODREG && (cpuext.zbb || cpuext.xtheadbb) && !dyn->insts[ninst].x64.gen_flags) { \ + gd = TO_NAT(((nextop & 0x38) >> 3) + (rex.r << 3)); \ + ed = TO_NAT((nextop & 7) + (rex.b << 3)); \ + SLLI(s1, src, 64 - 16); \ + if (cpuext.zbb) { \ + RORI(dst, dst, 16); \ + } else { \ + TH_SRRI(dst, dst, 16); \ + } \ + OP; \ + if (cpuext.zbb) { \ + RORI(dst, dst, 64 - 16); \ + } else { \ + TH_SRRI(dst, dst, 64 - 16); \ + } \ + if (dyn->insts[ninst].nat_flags_fusion) { \ + ZEXTH(s1, dst); \ + NAT_FLAGS_OPS(s1, xZR, xZR, xZR); \ + } \ + break; \ + } + +#define VECTOR_SPLAT_IMM(vreg, imm, s1) \ + do { \ + if (imm == 0) { \ + VXOR_VV(vreg, vreg, vreg, VECTOR_UNMASKED); \ + } else if ((imm & 0xf) == imm) { \ + VMV_V_I(vreg, imm); \ + } else { \ + MOV64x(s1, imm); \ + VMV_V_X(vreg, s1); \ + } \ + } while (0) + +#define VECTOR_LOAD_VMASK(mask, s1, multiple) \ + vector_loadmask(dyn, ninst, VMASK, mask, s1, multiple) + +#ifndef SCRATCH_USAGE +#define SCRATCH_USAGE(usage) +#endif + +// TODO: can be lazy +#define YMM0(a) \ + do { \ + SD(xZR, xEmu, offsetof(x64emu_t, ymm[a]) + 0); \ + SD(xZR, xEmu, offsetof(x64emu_t, ymm[a]) + 8); \ + } while (0) + #endif //__DYNAREC_RV64_HELPER_H__ diff --git a/src/dynarec/rv64/dynarec_rv64_jmpnext.c b/src/dynarec/rv64/dynarec_rv64_jmpnext.c index 9150dd4..273f646 100644 --- a/src/dynarec/rv64/dynarec_rv64_jmpnext.c +++ b/src/dynarec/rv64/dynarec_rv64_jmpnext.c @@ -2,18 +2,22 @@ #include "rv64_emitter.h" -#define EMIT(A) *block = (A); ++block +#define EMIT(A) \ + do { \ + *block = (A); \ + ++block; \ + } while (0) void CreateJmpNext(void* addr, void* next) { uint32_t* block = (uint32_t*)addr; uintptr_t diff = (intptr_t)next - (intptr_t)addr; AUIPC(x2, SPLIT20(diff)); - #if 1 +#if 1 LD(x2, x2, SPLIT12(diff)); - #else +#else // Probably not usefull, but keeping the code, just in case ADDI(x2, x2, SPLIT12(diff)); LR_D(x2, x2, 1, 1); - #endif +#endif BR(x2); -} \ No newline at end of file +} diff --git a/src/dynarec/rv64/dynarec_rv64_pass0.h b/src/dynarec/rv64/dynarec_rv64_pass0.h index 684d3bb..dd800c0 100644 --- a/src/dynarec/rv64/dynarec_rv64_pass0.h +++ b/src/dynarec/rv64/dynarec_rv64_pass0.h @@ -1,52 +1,108 @@ -#define INIT uintptr_t sav_addr=addr -#define FINI \ - dyn->isize = addr-sav_addr; \ - dyn->insts[ninst].x64.addr = addr; \ - if(ninst) dyn->insts[ninst-1].x64.size = dyn->insts[ninst].x64.addr - dyn->insts[ninst-1].x64.addr - -#define MESSAGE(A, ...) do {} while (0) -#define MAYSETFLAGS() dyn->insts[ninst].x64.may_set = 1 -#define READFLAGS(A) \ - dyn->insts[ninst].x64.use_flags = A; dyn->f.dfnone = 1;\ - dyn->f.pending=SF_SET -#define SETFLAGS(A,B) \ - dyn->insts[ninst].x64.set_flags = A; \ - dyn->insts[ninst].x64.state_flags = (B)&~SF_DF; \ - dyn->f.pending=(B)&SF_SET_PENDING; \ - dyn->f.dfnone=((B)&SF_SET)?(((B)==SF_SET_NODF)?0:1):0; -#define EMIT(A) dyn->native_size+=4 -#define JUMP(A, C) add_jump(dyn, ninst); add_next(dyn, (uintptr_t)A); SMEND(); dyn->insts[ninst].x64.jmp = A; dyn->insts[ninst].x64.jmp_cond = C; dyn->insts[ninst].x64.jmp_insts = 0 -#define BARRIER(A) if(A!=BARRIER_MAYBE) {fpu_purgecache(dyn, ninst, 0, x1, x2, x3); dyn->insts[ninst].x64.barrier = A;} else dyn->insts[ninst].barrier_maybe = 1 -#define BARRIER_NEXT(A) dyn->insts[ninst].x64.barrier_next = A -#define SET_HASCALLRET() dyn->insts[ninst].x64.has_callret = 1 -#define NEW_INST \ - ++dyn->size; \ - memset(&dyn->insts[ninst], 0, sizeof(instruction_native_t)); \ - dyn->insts[ninst].x64.addr = ip; \ - dyn->e.combined1 = dyn->e.combined2 = 0;\ - dyn->e.swapped = 0; dyn->e.barrier = 0; \ - for(int i=0; i<16; ++i) dyn->e.olds[i].v = 0;\ - dyn->insts[ninst].f_entry = dyn->f; \ - if(ninst) {dyn->insts[ninst-1].x64.size = dyn->insts[ninst].x64.addr - dyn->insts[ninst-1].x64.addr;} - -#define INST_EPILOG \ - dyn->insts[ninst].f_exit = dyn->f; \ - dyn->insts[ninst].e = dyn->e; \ - dyn->insts[ninst].x64.has_next = (ok>0)?1:0; -#define INST_NAME(name) -#define DEFAULT \ - --dyn->size; \ - *ok = -1; \ - if(box64_dynarec_log>=LOG_INFO || box64_dynarec_dump || box64_dynarec_missing) {\ - dynarec_log(LOG_NONE, "%p: Dynarec stopped because of %sOpcode %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", \ - (void*)ip, rex.is32bits?"32bits ":"",\ - PKip(0), \ - PKip(1), PKip(2), PKip(3), \ - PKip(4), PKip(5), PKip(6), \ - PKip(7), PKip(8), PKip(9), \ - PKip(10),PKip(11),PKip(12), \ - PKip(13),PKip(14)); \ - printFunctionAddr(ip, " => "); \ - dynarec_log(LOG_NONE, "\n"); \ +#define INIT uintptr_t sav_addr = addr +#define FINI \ + dyn->isize = addr - sav_addr; \ + dyn->insts[ninst].x64.addr = addr; \ + if (ninst) dyn->insts[ninst - 1].x64.size = dyn->insts[ninst].x64.addr - dyn->insts[ninst - 1].x64.addr + +#define MESSAGE(A, ...) \ + do { \ + } while (0) +#define MAYSETFLAGS() dyn->insts[ninst].x64.may_set = 1 +#define READFLAGS(A) \ + dyn->insts[ninst].x64.use_flags = A; \ + dyn->f.dfnone = 1; \ + dyn->f.pending = SF_SET + +#define READFLAGS_FUSION(A, s1, s2, s3, s4, s5) \ + if (BOX64ENV(dynarec_nativeflags) && ninst > 0) { \ + int prev = ninst - 1; \ + while (prev && dyn->insts[prev].no_scratch_usage) \ + prev -= 1; \ + if (!dyn->insts[prev].nat_flags_nofusion) { \ + if ((A) == (X_ZF)) \ + dyn->insts[ninst].nat_flags_fusion = 1; \ + else if (dyn->insts[prev].nat_flags_carry && ((A) == (X_CF) || (A) == (X_CF | X_ZF))) \ + dyn->insts[ninst].nat_flags_fusion = 1; \ + else if (dyn->insts[prev].nat_flags_sign && ((A) == (X_SF | X_OF) || (A) == (X_SF | X_OF | X_ZF))) \ + dyn->insts[ninst].nat_flags_fusion = 1; \ + } \ + } \ + READFLAGS(A); + +#define SETFLAGS(A, B, FUSION) \ + dyn->insts[ninst].x64.set_flags = A; \ + dyn->insts[ninst].x64.state_flags = (B) & ~SF_DF; \ + dyn->f.pending = (B) & SF_SET_PENDING; \ + dyn->f.dfnone = ((B) & SF_SET) ? (((B) == SF_SET_NODF) ? 0 : 1) : 0; \ + dyn->insts[ninst].nat_flags_nofusion = (FUSION) + +#define EMIT(A) dyn->native_size += 4 +#define JUMP(A, C) \ + add_jump(dyn, ninst); \ + add_next(dyn, (uintptr_t)A); \ + SMEND(); \ + dyn->insts[ninst].x64.jmp = A; \ + dyn->insts[ninst].x64.jmp_cond = C; \ + dyn->insts[ninst].x64.jmp_insts = 0 +#define BARRIER(A) \ + if (A != BARRIER_MAYBE) { \ + fpu_purgecache(dyn, ninst, 0, x1, x2, x3); \ + dyn->insts[ninst].x64.barrier = A; \ + } else \ + dyn->insts[ninst].barrier_maybe = 1 +#define SET_HASCALLRET() dyn->insts[ninst].x64.has_callret = 1 +#define NEW_INST \ + ++dyn->size; \ + memset(&dyn->insts[ninst], 0, sizeof(instruction_native_t)); \ + dyn->insts[ninst].x64.addr = ip; \ + dyn->e.combined1 = dyn->e.combined2 = 0; \ + dyn->e.swapped = 0; \ + dyn->e.barrier = 0; \ + for (int i = 0; i < 16; ++i) \ + dyn->e.olds[i].v = 0; \ + dyn->insts[ninst].f_entry = dyn->f; \ + dyn->insts[ninst].vector_sew_entry = dyn->vector_sew; \ + dyn->inst_sew = dyn->vector_sew; \ + dyn->inst_vlmul = VECTOR_LMUL1; \ + dyn->inst_vl = 0; \ + if (ninst) \ + dyn->insts[ninst - 1].x64.size = dyn->insts[ninst].x64.addr - dyn->insts[ninst - 1].x64.addr; + +#define INST_EPILOG \ + dyn->insts[ninst].f_exit = dyn->f; \ + dyn->insts[ninst].e = dyn->e; \ + dyn->insts[ninst].vector_sew_exit = dyn->vector_sew; \ + dyn->insts[ninst].x64.has_next = (ok > 0) ? 1 : 0; +#define INST_NAME(name) +#define DEFAULT \ + --dyn->size; \ + *ok = -1; \ + if (ninst) { dyn->insts[ninst - 1].x64.size = ip - dyn->insts[ninst - 1].x64.addr; } \ + if (BOX64ENV(dynarec_log) >= LOG_INFO || dyn->need_dump || BOX64ENV(dynarec_missing)) \ + if (!dyn->size || BOX64ENV(dynarec_log) > LOG_INFO || dyn->need_dump) { \ + dynarec_stopped(dyn->insts[ninst].x64.addr, rex.is32bits); \ } + +#define SET_ELEMENT_WIDTH(s1, sew, set) \ + do { \ + if ((sew) != VECTOR_SEWANY && (set)) \ + dyn->vector_sew = (sew); \ + else if (dyn->vector_sew == VECTOR_SEWNA && (set)) \ + dyn->vector_sew = VECTOR_SEW8; \ + } while (0) + +// mark opcode as "unaligned" possible only if the current address is not marked as already unaligned +#define IF_UNALIGNED(A) if ((dyn->insts[ninst].unaligned = (is_addr_unaligned(A) ? 0 : 1))) +#define IF_ALIGNED(A) if ((dyn->insts[ninst].unaligned = (is_addr_unaligned(A) ? 1 : 0))) + +#define NATIVE_RESTORE_X87PC() +#define X87_CHECK_PRECISION(A) \ + do { \ + if (dyn->need_x87check) dyn->insts[ninst].x87precision = 1; \ + } while (0) + +#define SCRATCH_USAGE(usage) \ + do { \ + dyn->insts[ninst].no_scratch_usage = !usage; \ + } while (0) diff --git a/src/dynarec/rv64/dynarec_rv64_pass1.h b/src/dynarec/rv64/dynarec_rv64_pass1.h index b76d7e9..1e1cbc9 100644 --- a/src/dynarec/rv64/dynarec_rv64_pass1.h +++ b/src/dynarec/rv64/dynarec_rv64_pass1.h @@ -1,15 +1,37 @@ -#define INIT +#define INIT #define FINI -#define MESSAGE(A, ...) do {} while (0) -#define EMIT(A) do {} while (0) -#define NEW_INST \ - dyn->insts[ninst].f_entry = dyn->f; \ - dyn->e.combined1 = dyn->e.combined2 = 0;\ - for(int i=0; i<16; ++i) dyn->e.olds[i].v = 0;\ - dyn->e.swapped = 0; dyn->e.barrier = 0 - -#define INST_EPILOG \ - dyn->insts[ninst].e = dyn->e; \ - dyn->insts[ninst].f_exit = dyn->f - -#define INST_NAME(name) +#define MESSAGE(A, ...) \ + do { \ + } while (0) +#define EMIT(A) \ + do { \ + } while (0) +#define NEW_INST \ + dyn->insts[ninst].f_entry = dyn->f; \ + dyn->e.combined1 = dyn->e.combined2 = 0; \ + for (int i = 0; i < 16; ++i) \ + dyn->e.olds[i].v = 0; \ + dyn->insts[ninst].vector_sew_entry = dyn->vector_sew; \ + dyn->inst_sew = dyn->vector_sew; \ + dyn->inst_vlmul = VECTOR_LMUL1; \ + dyn->inst_vl = 0; \ + dyn->e.swapped = 0; \ + dyn->e.barrier = 0 + +#define INST_EPILOG \ + dyn->insts[ninst].e = dyn->e; \ + dyn->insts[ninst].f_exit = dyn->f; \ + dyn->insts[ninst].vector_sew_exit = dyn->vector_sew; + +#define INST_NAME(name) + + +#define NATIVE_RESTORE_X87PC() +#define X87_CHECK_PRECISION(A) \ + do { \ + if (dyn->need_x87check) { \ + dyn->insts[ninst].x87precision = 1; \ + if (!ST_IS_F(0)) \ + dyn->need_x87check = 2; \ + } \ + } while (0) diff --git a/src/dynarec/rv64/dynarec_rv64_pass2.h b/src/dynarec/rv64/dynarec_rv64_pass2.h index 6761a45..d6bb493 100644 --- a/src/dynarec/rv64/dynarec_rv64_pass2.h +++ b/src/dynarec/rv64/dynarec_rv64_pass2.h @@ -1,19 +1,56 @@ -#define INIT dyn->native_size = 0 -#define FINI \ - if(ninst) { \ - dyn->insts[ninst].address = (dyn->insts[ninst-1].address+dyn->insts[ninst-1].size); \ - dyn->insts_size += 1+((dyn->insts[ninst].x64.size>(dyn->insts[ninst].size/4))?dyn->insts[ninst].x64.size:(dyn->insts[ninst].size/4))/15; \ - } +#define INIT dyn->native_size = 0 +#define FINI \ + if (ninst) { \ + dyn->insts[ninst].address = (dyn->insts[ninst - 1].address + dyn->insts[ninst - 1].size); \ + dyn->insts_size += 1+((dyn->insts[ninst-1].x64.size>(dyn->insts[ninst-1].size/4))?dyn->insts[ninst-1].x64.size:(dyn->insts[ninst-1].size/4))/15; \ + } -#define MESSAGE(A, ...) do {} while (0) -#define EMIT(A) do {dyn->insts[ninst].size+=4; dyn->native_size+=4;}while(0) -#define NEW_INST \ - if(ninst) { \ - dyn->insts[ninst].address = (dyn->insts[ninst-1].address+dyn->insts[ninst-1].size); \ - dyn->insts_size += 1+((dyn->insts[ninst-1].x64.size>(dyn->insts[ninst-1].size/4))?dyn->insts[ninst-1].x64.size:(dyn->insts[ninst-1].size/4))/15; \ - dyn->insts[ninst].ymm0_pass2 = dyn->ymm_zero; \ - } -#define INST_EPILOG dyn->insts[ninst].epilog = dyn->native_size; -#define INST_NAME(name) -#define TABLE64(A, V) {Table64(dyn, (V), 2); EMIT(0); EMIT(0);} -#define FTABLE64(A, V) {mmx87_regs_t v = {.d = V}; Table64(dyn, v.q, 2); EMIT(0); EMIT(0);} +#define MESSAGE(A, ...) \ + do { \ + } while (0) +#define EMIT(A) \ + do { \ + dyn->insts[ninst].size += 4; \ + dyn->native_size += 4; \ + } while (0) +#define NEW_INST \ + dyn->vector_sew = dyn->insts[ninst].vector_sew_entry; \ + dyn->inst_sew = dyn->vector_sew; \ + dyn->inst_vlmul = VECTOR_LMUL1; \ + dyn->inst_vl = 0; \ + if (ninst) { \ + dyn->insts[ninst].address = (dyn->insts[ninst - 1].address + dyn->insts[ninst - 1].size); \ + dyn->insts_size += 1 + ((dyn->insts[ninst - 1].x64.size > (dyn->insts[ninst - 1].size / 4)) ? dyn->insts[ninst - 1].x64.size : (dyn->insts[ninst - 1].size / 4)) / 15; \ + dyn->insts[ninst].ymm0_pass2 = dyn->ymm_zero; \ + } +#define INST_EPILOG dyn->insts[ninst].epilog = dyn->native_size; +#define INST_NAME(name) +#define TABLE64(A, V) \ + do { \ + if (dyn->need_reloc && !isTable64(dyn, (V))) \ + AddRelocTable64Addr(dyn, ninst, (V), 2); \ + Table64(dyn, (V), 2); \ + EMIT(0); \ + EMIT(0); \ + } while (0) +#define TABLE64_(A, V) \ + do { \ + Table64(dyn, (V), 2); \ + EMIT(0); \ + EMIT(0); \ + } while (0) +#define FTABLE64(A, V) \ + do { \ + mmx87_regs_t v = { .d = V }; \ + Table64(dyn, v.q, 2); \ + EMIT(0); \ + EMIT(0); \ + } while (0) +#define TABLE64C(A, V) \ + do { \ + if (dyn->need_reloc && !isTable64(dyn, getConst(V))) \ + AddRelocTable64Const(dyn, ninst, (V), 2); \ + Table64(dyn, getConst(V), 2); \ + EMIT(0); \ + EMIT(0); \ + } while (0) diff --git a/src/dynarec/rv64/dynarec_rv64_pass3.h b/src/dynarec/rv64/dynarec_rv64_pass3.h index 4a32a72..acfa00d 100644 --- a/src/dynarec/rv64/dynarec_rv64_pass3.h +++ b/src/dynarec/rv64/dynarec_rv64_pass3.h @@ -1,25 +1,79 @@ #define INIT -#define FINI \ - if(ninst) \ - addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst].x64.size, dyn->insts[ninst].size/4); \ +#define FINI \ + if (ninst) \ + addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst-1].x64.size, dyn->insts[ninst-1].size/4); \ addInst(dyn->instsize, &dyn->insts_size, 0, 0); -#define EMIT(A) \ - do { \ - if(box64_dynarec_dump) print_opcode(dyn, ninst, (uint32_t)A); \ - *(uint32_t*)(dyn->block) = (uint32_t)(A); \ - dyn->block += 4; dyn->native_size += 4; \ - dyn->insts[ninst].size2 += 4; \ - }while(0) +#define EMIT(A) \ + do { \ + if (dyn->need_dump) print_opcode(dyn, ninst, (uint32_t)A); \ + *(uint32_t*)(dyn->block) = (uint32_t)(A); \ + dyn->block += 4; \ + dyn->native_size += 4; \ + dyn->insts[ninst].size2 += 4; \ + } while (0) -#define MESSAGE(A, ...) if(box64_dynarec_dump) dynarec_log(LOG_NONE, __VA_ARGS__) -#define NEW_INST \ - if(box64_dynarec_dump) print_newinst(dyn, ninst); \ - if(ninst) { \ - addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst-1].x64.size, dyn->insts[ninst-1].size/4); \ - dyn->insts[ninst].ymm0_pass3 = dyn->ymm_zero; \ +#define MESSAGE(A, ...) \ + do { \ + if (dyn->need_dump) dynarec_log(LOG_NONE, __VA_ARGS__); \ + } while (0) +#define NEW_INST \ + dyn->vector_sew = dyn->insts[ninst].vector_sew_entry; \ + dyn->inst_sew = dyn->vector_sew; \ + dyn->inst_vlmul = VECTOR_LMUL1; \ + dyn->inst_vl = 0; \ + if (ninst) { \ + addInst(dyn->instsize, &dyn->insts_size, dyn->insts[ninst - 1].x64.size, dyn->insts[ninst - 1].size / 4); \ + dyn->insts[ninst].ymm0_pass3 = dyn->ymm_zero; \ } #define INST_EPILOG #define INST_NAME(name) inst_name_pass3(dyn, ninst, name, rex) -#define TABLE64(A, V) {int val64offset = Table64(dyn, (V), 3); MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); AUIPC(A, SPLIT20(val64offset)); LD(A, A, SPLIT12(val64offset));} -#define FTABLE64(A, V) {mmx87_regs_t v = {.d = V}; int val64offset = Table64(dyn, v.q, 3); MESSAGE(LOG_DUMP, " FTable64: %g\n", v.d); AUIPC(x1, SPLIT20(val64offset)); FLD(A, x1, SPLIT12(val64offset));} +#define TABLE64(A, V) \ + do { \ + if (dyn->need_reloc && !isTable64(dyn, (V))) \ + AddRelocTable64Addr(dyn, ninst, (V), 3); \ + int val64offset = Table64(dyn, (V), 3); \ + MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); \ + AUIPC(A, SPLIT20(val64offset)); \ + LD(A, A, SPLIT12(val64offset)); \ + } while (0) +#define TABLE64_(A, V) \ + do { \ + int val64offset = Table64(dyn, (V), 3); \ + MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); \ + AUIPC(A, SPLIT20(val64offset)); \ + LD(A, A, SPLIT12(val64offset)); \ + } while (0) +#define FTABLE64(A, V) \ + do { \ + mmx87_regs_t v = { .d = V }; \ + int val64offset = Table64(dyn, v.q, 3); \ + MESSAGE(LOG_DUMP, " FTable64: %g\n", v.d); \ + AUIPC(x1, SPLIT20(val64offset)); \ + FLD(A, x1, SPLIT12(val64offset)); \ + } while (0) +#define TABLE64C(A, V) \ + do { \ + if (dyn->need_reloc && !isTable64(dyn, getConst(V))) \ + AddRelocTable64Const(dyn, ninst, (V), 3); \ + int val64offset = Table64(dyn, getConst(V), 3); \ + MESSAGE(LOG_DUMP, " Table64: 0x%lx\n", (V)); \ + AUIPC(A, SPLIT20(val64offset)); \ + LD(A, A, SPLIT12(val64offset)); \ + } while (0) + +#define DEFAULT_VECTOR \ + if (BOX64ENV(dynarec_log) >= LOG_INFO || dyn->need_dump || BOX64ENV(dynarec_missing) == 2) { \ + dynarec_log(LOG_NONE, "%p: Dynarec fallback to scalar version because of %s Opcode ", (void*)ip, rex.is32bits ? "x86" : "x64"); \ + zydis_dec_t* dec = rex.is32bits ? my_context->dec32 : my_context->dec; \ + if (dec) { \ + dynarec_log_prefix(0, LOG_NONE, "%s", DecodeX64Trace(dec, dyn->insts[ninst].x64.addr, 1)); \ + } else { \ + dynarec_log_prefix(0, LOG_NONE, "%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", \ + PKip(0), PKip(1), PKip(2), PKip(3), PKip(4), PKip(5), PKip(6), PKip(7), PKip(8), PKip(9), \ + PKip(10), PKip(11), PKip(12), PKip(13), PKip(14)); \ + } \ + PrintFunctionAddr(ip, " => "); \ + dynarec_log_prefix(0, LOG_NONE, "\n"); \ + } \ + return 0 diff --git a/src/dynarec/rv64/dynarec_rv64_private.h b/src/dynarec/rv64/dynarec_rv64_private.h index 530a0f0..f281470 100644 --- a/src/dynarec/rv64/dynarec_rv64_private.h +++ b/src/dynarec/rv64/dynarec_rv64_private.h @@ -7,6 +7,7 @@ typedef struct x64emu_s x64emu_t; typedef struct dynablock_s dynablock_t; typedef struct instsize_s instsize_t; +typedef struct box64env_s box64env_t; #define BARRIER_MAYBE 8 @@ -20,6 +21,12 @@ typedef struct instsize_s instsize_t; #define EXT_CACHE_SCR 7 #define EXT_CACHE_XMMW 8 #define EXT_CACHE_XMMR 9 +#define EXT_CACHE_MMV 10 + +#define EXT_CACHE_OLD_SD 0 +#define EXT_CACHE_OLD_SS 1 +#define EXT_CACHE_OLD_XMMW 2 +#define EXT_CACHE_OLD_XMMR 3 typedef union ext_cache_s { int8_t v; @@ -29,14 +36,21 @@ typedef union ext_cache_s { }; } ext_cache_t; +typedef union mmx_cache_s { + int8_t v; + struct { + uint8_t reg : 7; + uint8_t vector : 1; + }; +} mmx_cache_t; + typedef union sse_cache_s { int16_t v; struct { - uint16_t reg : 7; + uint16_t reg : 13; uint16_t vector : 1; uint16_t single : 1; uint16_t write : 1; - uint16_t unused : 7; }; } sse_cache_t; @@ -46,13 +60,13 @@ typedef union sse_old_s { uint8_t changed:1; uint8_t purged:1; uint8_t reg:4; - uint8_t single:1; + uint8_t type:2; }; } sse_old_t; typedef struct extcache_s { // ext cache - ext_cache_t extcache[24]; + ext_cache_t extcache[32]; int8_t stack; int8_t stack_next; int8_t stack_pop; @@ -69,47 +83,61 @@ typedef struct extcache_s { int8_t x87cache[8]; // cache status for the 8 x87 register behind the fpu stack int8_t x87reg[8]; // reg used for x87cache entry int16_t tags; // similar to fpu_tags - int8_t mmxcache[8]; // cache status for the 8 MMX registers + mmx_cache_t mmxcache[8]; // cache status for the 8 MMX registers sse_cache_t ssecache[16]; // cache status for the 16 SSE(2) registers - int8_t fpuused[24]; // all 10..31 & 0..1 double reg from fpu, used by x87, sse and mmx + int8_t fpuused[32]; // all double reg from fpu, used by x87, mmx, sse and avx int8_t x87stack; // cache stack counter int8_t mmxcount; // number of mmx register used (not both mmx and x87 at the same time) int8_t fpu_scratch; // scratch counter - int8_t fpu_extra_qscratch; // some opcode need an extra quad scratch register - int8_t fpu_reg; // x87/sse/mmx reg counter } extcache_t; typedef struct flagcache_s { int pending; // is there a pending flags here, or to check? uint8_t dfnone; // if deferred flags is already set to df_none - uint8_t dfnone_here;// defered flags is cleared in this opcode } flagcache_t; +typedef struct callret_s callret_t; +typedef struct sep_s sep_t; + typedef struct instruction_rv64_s { instruction_x64_t x64; - uintptr_t address; // (start) address of the arm emitted instruction + uintptr_t address; // (start) address of the riscv emitted instruction uintptr_t epilog; // epilog of current instruction (can be start of next, or barrier stuff) - int size; // size of the arm emitted instruction - int size2; // size of the arm emitted instrucion after pass2 + int size; // size of the riscv emitted instruction + int size2; // size of the riscv emitted instruction after pass2 int pred_sz; // size of predecessor list int *pred; // predecessor array uintptr_t mark[3]; uintptr_t markf[2]; uintptr_t markseg; uintptr_t marklock; + uintptr_t marklock2; int pass2choice;// value for choices that are fixed on pass2 for pass3 uintptr_t natcall; uint16_t retn; - uint16_t purge_ymm; // need to purge some ymm - uint16_t ymm0_in; // bitmap of ymm to zero at purge - uint16_t ymm0_add; // the ymm0 added by the opcode - uint16_t ymm0_sub; // the ymm0 removed by the opcode - uint16_t ymm0_out; // the ymmm0 at th end of the opcode uint16_t ymm0_pass2, ymm0_pass3; int barrier_maybe; - flagcache_t f_exit; // flags status at end of intruction - extcache_t e; // extcache at end of intruction (but before poping) + uint8_t will_write:2; // [strongmem] will write to memory + uint8_t will_read:1; // [strongmem] will read from memory + uint8_t last_write:1; // [strongmem] the last write in a SEQ + uint8_t lock:1; // [strongmem] lock semantic + uint8_t df_notneeded; + uint8_t nat_flags_fusion:1; + uint8_t nat_flags_nofusion:1; + uint8_t nat_flags_carry:1; + uint8_t nat_flags_sign:1; + uint8_t nat_flags_needsign:1; + uint8_t unaligned:1; // this opcode can be re-generated for unaligned special case + uint8_t x87precision:1; // this opcode can handle x87pc + uint8_t no_scratch_usage:1; // this opcode does not use scratch register + uint8_t nat_flags_op1; + uint8_t nat_flags_op2; + uint16_t nat_next_inst; + flagcache_t f_exit; // flags status at end of instruction + extcache_t e; // extcache at end of instruction (but before poping) flagcache_t f_entry; // flags status before the instruction begin + uint8_t vector_sew_entry; // sew status before the instruction begin + uint8_t vector_sew_exit; // sew status at the end of instruction } instruction_rv64_t; typedef struct dynarec_rv64_s { @@ -117,10 +145,12 @@ typedef struct dynarec_rv64_s { int32_t size; int32_t cap; uintptr_t start; // start of the block + uintptr_t end; // maximum end of the block (only used in pass0) uint32_t isize; // size in byte of x64 instructions included + uint32_t prefixsize; // size in byte of the prefix of the block void* block; // memory pointer where next instruction is emitted - uintptr_t native_start; // start of the arm code - size_t native_size; // size of emitted arm code + uintptr_t native_start; // start of the riscv code + size_t native_size; // size of emitted riscv code uintptr_t last_ip; // last set IP in RIP (or NULL if unclean state) TODO: move to a cache something uint64_t* table64; // table of 64bits value int table64size;// size of table (will be appended at end of executable code) @@ -139,7 +169,10 @@ typedef struct dynarec_rv64_s { dynablock_t* dynablock; instsize_t* instsize; size_t insts_size; // size of the instruction size array (calculated) - uint8_t smread; // for strongmem model emulation + int callret_size; // size of the array + int sep_size; // size of the array + callret_t* callrets; // array of callret return, with NOP / UDF depending if the block is clean or dirty + sep_t* sep; // array of secondary entry point uint8_t smwrite; // for strongmem model emulation uintptr_t forward; // address of the last end of code while testing forward uintptr_t forward_to; // address of the next jump to (to check if everything is ok) @@ -148,12 +181,25 @@ typedef struct dynarec_rv64_s { uint16_t ymm_zero; // bitmap of ymm to zero at purge uint8_t always_test; uint8_t abort; + uint8_t vector_sew; // current sew status + uint8_t vector_eew; // current effective sew status, should only be used after SET_ELEMENT_WIDTH + uint8_t inst_sew; // sew inside current instruction, for vsetvli elimination + uint8_t inst_vl; // vl inside current instruction, for vsetvli elimination + uint8_t inst_vlmul; // vlmul inside current instruction + void* gdbjit_block; + uint32_t need_x87check; // x87 low precision check + uint32_t need_dump; // need to dump the block + int need_reloc; // does the dynablock need relocations + int reloc_size; + uint32_t* relocs; + box64env_t* env; } dynarec_rv64_t; -// convert idx (0..24) to reg index (10..31 0..1) -#define EXTREG(A) (((A)+10)&31) -// convert reg index (10..31 0..1) or idx (0..24) -#define EXTIDX(A) (((A)-10)&31) +// v0 is hardware wired to vector mask register, which should be always reserved +// convert idx (0..23) to reg index (10..31 1..2) +#define EXTREG(A) (((A) + 10 + ((A) > 21)) & 31) +// convert reg index (10..31 1..2) to idx (0..23) +#define EXTIDX(A) (((A) - 10 - ((A) < 3)) & 31) void add_next(dynarec_rv64_t *dyn, uintptr_t addr); uintptr_t get_closest_next(dynarec_rv64_t *dyn, uintptr_t addr); @@ -161,20 +207,18 @@ void add_jump(dynarec_rv64_t *dyn, int ninst); int get_first_jump(dynarec_rv64_t *dyn, int next); int get_first_jump_addr(dynarec_rv64_t *dyn, uintptr_t next); int is_nops(dynarec_rv64_t *dyn, uintptr_t addr, int n); -int is_instructions(dynarec_rv64_t *dyn, uintptr_t addr, int n); +int isTable64(dynarec_rv64_t *dyn, uint64_t val); // return 1 if val already in Table64 int Table64(dynarec_rv64_t *dyn, uint64_t val, int pass); // add a value to table64 (if needed) and gives back the imm19 to use in LDR_literal void CreateJmpNext(void* addr, void* next); -#define GO_TRACE(A, B, s0) \ - GETIP(addr); \ - MV(A1, xRIP); \ - FLAGS_ADJUST_TO11(xFlags, xFlags, s0); \ - STORE_XEMU_CALL(s0); \ - MOV64x(A2, B); \ - CALL(A, -1); \ - LOAD_XEMU_CALL(); \ - FLAGS_ADJUST_FROM11(xFlags, xFlags, s0); +#define GO_TRACE(A, B, s0) \ + GETIP(addr, s0); \ + MV(x1, xRIP); \ + STORE_XEMU_CALL(s0); \ + MOV64x(x2, B); \ + CALL(const_##A, -1, x1, x2); \ + LOAD_XEMU_CALL() #endif //__DYNAREC_RV64_PRIVATE_H_ diff --git a/src/dynarec/rv64/rv64_emitter.h b/src/dynarec/rv64/rv64_emitter.h index e0fe440..ea9b361 100644 --- a/src/dynarec/rv64/rv64_emitter.h +++ b/src/dynarec/rv64/rv64_emitter.h @@ -1,106 +1,9 @@ #ifndef __RV64_EMITTER_H__ #define __RV64_EMITTER_H__ -/* - RV64 Emitter - -*/ - -// RV64 ABI -/* -reg name description saver ------------------------------------------------------- -x0 zero Hard-wired zero — -x1 ra Return address Caller -x2 sp Stack pointer Callee -x3 gp Global pointer — -x4 tp Thread pointer — -x5–7 t0–2 Temporaries Caller -x8 s0/fp Saved register/frame pointer Callee -x9 s1 Saved register Callee -x10–11 a0–1 Function arguments/return val. Caller -x12–17 a2–7 Function arguments Caller -x18–27 s2–11 Saved registers Callee -x28–31 t3–6 Temporaries Caller -------------------------------------------------------- -f0–7 ft0–7 FP temporaries Caller -f8–9 fs0–1 FP saved registers Callee -f10–11 fa0–1 FP arguments/return values Caller -f12–17 fa2–7 FP arguments Caller -f18–27 fs2–11 FP saved registers Callee -f28–31 ft8–11 FP temporaries Caller -*/ -// x86 Register mapping -#define xRAX 16 -#define xRCX 17 -#define xRDX 18 -#define xRBX 19 -#define xRSP 20 -#define xRBP 21 -#define xRSI 22 -#define xRDI 23 -#define xR8 24 -#define xR9 25 -#define xR10 26 -#define xR11 27 -#define xR12 28 -#define xR13 29 -#define xR14 30 -#define xR15 31 -#define xFlags 8 -#define xRIP 7 - -// 32bits version -#define wEAX xRAX -#define wECX xRCX -#define wEDX xRDX -#define wEBX xRBX -#define wESP xRSP -#define wEBP xRBP -#define wESI xRSI -#define wEDI xRDI -#define wR8 xR8 -#define wR9 xR9 -#define wR10 xR10 -#define wR11 xR11 -#define wR12 xR12 -#define wR13 xR13 -#define wR14 xR14 -#define wR15 xR15 -#define wFlags xFlags -// scratch registers -#define x1 11 -#define x2 12 -#define x3 13 -#define x4 14 -#define x5 15 -#define x6 6 -#define x9 9 -// used to clear the upper 32bits -#define xMASK 5 -// 32bits version of scratch -#define w1 x1 -#define w2 x2 -#define w3 x3 -#define w4 x4 -#define w5 x5 -#define w6 x6 -// emu is r10 -#define xEmu 10 -// RV64 RA -#define xRA 1 -#define xSP 2 -// RV64 args -#define A0 10 -#define A1 11 -#define A2 12 -#define A3 13 -#define A4 14 -#define A5 15 -#define A6 16 -#define A7 17 -// xZR reg is 0 -#define xZR 0 -#define wZR xZR + +#include "rv64_mapping.h" + +// RV64 Emitter // replacement for F_OF internaly, using a reserved bit. Need to use F_OF2 internaly, never F_OF directly! #define F_OF2 F_res3 @@ -112,21 +15,44 @@ f28–31 ft8–11 FP temporaries Caller // MOV64x/MOV32w is quite complex, so use a function for this #define MOV64x(A, B) rv64_move64(dyn, ninst, A, B) #define MOV32w(A, B) rv64_move32(dyn, ninst, A, B, 1) -#define MOV64xw(A, B) do { \ - if (rex.w) { \ - MOV64x(A, B); \ - } else { \ - MOV32w(A, B); \ - } } while (0) -#define MOV64z(A, B) do { \ - if (rex.is32bits) { \ - MOV32w(A, B); \ - } else { \ - MOV64x(A, B); \ - } } while (0) +#define MOV64xw(A, B) \ + do { \ + if (rex.w) { \ + MOV64x(A, B); \ + } else { \ + MOV32w(A, B); \ + } \ + } while (0) +#define MOV64y(A, B) \ + do { \ + if (rex.is32bits || rex.is67) { \ + MOV32w(A, B); \ + } else { \ + MOV64x(A, B); \ + } \ + } while (0) +#define MOV64z(A, B) \ + do { \ + if (rex.is32bits) { \ + MOV32w(A, B); \ + } else { \ + MOV64x(A, B); \ + } \ + } while (0) -// ZERO the upper part -#define ZEROUP(r) AND(r, r, xMASK) +// ZERO the upper part, compatible to zba, xtheadbb, and rv64gc +#define ZEXTW2(rd, rs1) \ + do { \ + if (cpuext.zba) { \ + ZEXTW(rd, rs1); \ + } else if (cpuext.xtheadbb) {\ + TH_EXTU(rd, rs1, 31, 0); \ + } else { \ + SLLI(rd, rs1, 32); \ + SRLI(rd, rd, 32); \ + } \ + } while (0) +#define ZEROUP(r) ZEXTW2(r, r) #define R_type(funct7, rs2, rs1, funct3, rd, opcode) ((funct7) << 25 | (rs2) << 20 | (rs1) << 15 | (funct3) << 12 | (rd) << 7 | (opcode)) #define I_type(imm12, rs1, funct3, rd, opcode) ((imm12) << 20 | (rs1) << 15 | (funct3) << 12 | (rd) << 7 | (opcode)) @@ -157,9 +83,9 @@ f28–31 ft8–11 FP temporaries Caller // Unconditionnal branch to r+i12, no return address set #define BR_I12(r, imm12) EMIT(JALR_gen(xZR, r, (imm12) & 0b111111111111)) // Unconditionnal branch to r, return address set to xRA -#define JALR(r) EMIT(JALR_gen(xRA, r, 0)) +#define JALR(rd, rs) EMIT(JALR_gen(rd, rs, 0)) // Unconditionnal branch to r+i12, return address set to xRA -#define JALR_I12(r, imm12) EMIT(JALR_gen(xRA, r, (imm12) & 0b111111111111)) +#define JALR_I12(rd, rs, imm12) EMIT(JALR_gen(rd, rs, (imm12) & 0b111111111111)) // rd = rs1 + imm12 #define ADDI(rd, rs1, imm12) EMIT(I_type((imm12) & 0b111111111111, rs1, 0b000, rd, 0b0010011)) @@ -190,7 +116,33 @@ f28–31 ft8–11 FP temporaries Caller // rd = rs1 + rs2 #define ADDxw(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b000, rd, rex.w ? 0b0110011 : 0b0111011)) // rd = rs1 + rs2 -#define ADDz(rd, rs1, rs2) EMIT(R_type(0b0000000, rs2, rs1, 0b000, rd, rex.is32bits ? 0b0111011 : 0b0110011)) +#define ADDz(rd, rs1, rs2) \ + do { \ + if (!rex.is32bits) { \ + ADD(rd, rs1, rs2); \ + } else { \ + ADDW(rd, rs1, rs2); \ + ZEROUP(rd); \ + } \ + } while (0) +#define ADDy(rd, rs1, rs2) \ + do { \ + if (rex.is32bits || rex.is67) { \ + ADDW(rd, rs1, rs2); \ + ZEROUP(rd); \ + } else { \ + ADD(rd, rs1, rs2); \ + } \ + } while (0) +#define ADDxREGy(rd, rs1, rs2, s1) \ + do { \ + if (rex.is32bits || rex.is67) { \ + ADDIW(s1, rs2, 0); \ + ADD(rd, rs1, s1); \ + } else { \ + ADD(rd, rs1, rs2); \ + } \ + } while (0) // rd = rs1 - rs2 #define SUB(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b000, rd, 0b0110011)) // rd = rs1 - rs2 @@ -198,7 +150,15 @@ f28–31 ft8–11 FP temporaries Caller // rd = rs1 - rs2 #define SUBxw(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b000, rd, rex.w ? 0b0110011 : 0b0111011)) // rd = rs1 - rs2 -#define SUBz(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b000, rd, rex.is32bits ? 0b0111011 : 0b0110011)) +#define SUBz(rd, rs1, rs2) \ + do { \ + if (!rex.is32bits) { \ + SUB(rd, rs1, rs2); \ + } else { \ + SUB(rd, rs1, rs2); \ + ZEROUP(rd); \ + } \ + } while (0) // rd = rs1< -0x1000 && (imm) < 0x1000) { \ BEQ(rs1, rs2, imm); \ @@ -279,7 +340,7 @@ f28–31 ft8–11 FP temporaries Caller BLT(rs1, rs2, imm); \ NOP(); \ } else { \ - BGE(rs2, rs1, 8); \ + BGE(rs1, rs2, 8); \ B(imm - 4); \ } #define BGE_safe(rs1, rs2, imm) \ @@ -287,7 +348,7 @@ f28–31 ft8–11 FP temporaries Caller BGE(rs1, rs2, imm); \ NOP(); \ } else { \ - BLT(rs2, rs1, 8); \ + BLT(rs1, rs2, 8); \ B(imm - 4); \ } #define BLTU_safe(rs1, rs2, imm) \ @@ -295,7 +356,7 @@ f28–31 ft8–11 FP temporaries Caller BLTU(rs1, rs2, imm); \ NOP(); \ } else { \ - BGEU(rs2, rs1, 8); \ + BGEU(rs1, rs2, 8); \ B(imm - 4); \ } #define BGEU_safe(rs1, rs2, imm) \ @@ -303,7 +364,39 @@ f28–31 ft8–11 FP temporaries Caller BGEU(rs1, rs2, imm); \ NOP(); \ } else { \ - BLTU(rs2, rs1, 8); \ + BLTU(rs1, rs2, 8); \ + B(imm - 4); \ + } +#define BGT_safe(rs1, rs2, imm) \ + if ((imm) > -0x1000 && (imm) < 0x1000) { \ + BGT(rs1, rs2, imm); \ + NOP(); \ + } else { \ + BLE(rs1, rs2, 8); \ + B(imm - 4); \ + } +#define BLE_safe(rs1, rs2, imm) \ + if ((imm) > -0x1000 && (imm) < 0x1000) { \ + BLE(rs1, rs2, imm); \ + NOP(); \ + } else { \ + BGT(rs1, rs2, 8); \ + B(imm - 4); \ + } +#define BGTU_safe(rs1, rs2, imm) \ + if ((imm) > -0x1000 && (imm) < 0x1000) { \ + BGTU(rs1, rs2, imm); \ + NOP(); \ + } else { \ + BLEU(rs1, rs2, 8); \ + B(imm - 4); \ + } +#define BLEU_safe(rs1, rs2, imm) \ + if ((imm) > -0x1000 && (imm) < 0x1000) { \ + BLEU(rs1, rs2, imm); \ + NOP(); \ + } else { \ + BGTU(rs1, rs2, 8); \ B(imm - 4); \ } @@ -344,25 +437,41 @@ f28–31 ft8–11 FP temporaries Caller // 4-bytes[rs1+imm12] = rs2 #define SW(rs2, rs1, imm12) EMIT(S_type(imm12, rs2, rs1, 0b010, 0b0100011)) -#define PUSH1(reg) \ - do { \ - SD(reg, xRSP, 0xFF8); \ - SUBI(xRSP, xRSP, 8); \ +#define PUSH1(reg) \ + do { \ + if (cpuext.xtheadmemidx && reg != xRSP) { \ + TH_SDIB(reg, xRSP, -8, 0); \ + } else { \ + SD(reg, xRSP, 0xFF8); \ + SUBI(xRSP, xRSP, 8); \ + } \ } while (0) -#define POP1(reg) \ - do { \ - LD(reg, xRSP, 0); \ - if (reg != xRSP) ADDI(xRSP, xRSP, 8); \ +#define POP1(reg) \ + do { \ + if (cpuext.xtheadmemidx && reg != xRSP) { \ + TH_LDIA(reg, xRSP, 8, 0); \ + } else { \ + LD(reg, xRSP, 0); \ + if (reg != xRSP) ADDI(xRSP, xRSP, 8); \ + } \ } while (0) -#define PUSH1_32(reg) \ - do { \ - SW(reg, xRSP, 0xFFC); \ - SUBIW(xRSP, xRSP, 4); \ +#define PUSH1_32(reg) \ + do { \ + if (cpuext.xtheadmemidx && reg != xRSP) { \ + TH_SWIB(reg, xRSP, -4, 0); \ + } else { \ + SW(reg, xRSP, 0xFFC); \ + SUBI(xRSP, xRSP, 4); \ + } \ } while (0) -#define POP1_32(reg) \ - do { \ - LWU(reg, xRSP, 0); \ - if (reg != xRSP) ADDIW(xRSP, xRSP, 4); \ +#define POP1_32(reg) \ + do { \ + if (cpuext.xtheadmemidx && reg != xRSP) { \ + TH_LWUIA(reg, xRSP, 4, 0); \ + } else { \ + LWU(reg, xRSP, 0); \ + if (reg != xRSP) ADDI(xRSP, xRSP, 4); \ + } \ } while (0) #define POP1z(reg) \ @@ -378,20 +487,34 @@ f28–31 ft8–11 FP temporaries Caller PUSH1(reg); \ } -#define PUSH1_16(reg) \ - do { \ - SH(reg, xRSP, 0xFFE); \ - SUBI(xRSP, xRSP, 2); \ +#define PUSH1_16(reg) \ + do { \ + if (cpuext.xtheadmemidx && reg != xRSP) { \ + TH_SHIB(reg, xRSP, -2, 0); \ + } else { \ + SH(reg, xRSP, 0xFFE); \ + SUBI(xRSP, xRSP, 2); \ + } \ } while (0) -#define POP1_16(reg) \ - do { \ - LHU(reg, xRSP, 0); \ - if (reg != xRSP) ADDI(xRSP, xRSP, 2); \ +#define POP1_16(reg) \ + do { \ + if (cpuext.xtheadmemidx && reg != xRSP) { \ + TH_LHUIA(reg, xRSP, 2, 0); \ + } else { \ + LHU(reg, xRSP, 0); \ + if (reg != xRSP) ADDI(xRSP, xRSP, 2); \ + } \ } while (0) #define FENCE_gen(pred, succ) (((pred) << 24) | ((succ) << 20) | 0b0001111) -#define FENCE() EMIT(FENCE_gen(3, 3)) +#define FENCE_R_RW() EMIT(FENCE_gen(2, 3)) +#define FENCE_W_W() EMIT(FENCE_gen(1, 1)) +#define FENCE_RW_RW() EMIT(FENCE_gen(3, 3)) + +#define DMB_ISH() FENCE_RW_RW() +#define DMB_ISHLD() FENCE_R_RW() +#define DMB_ISHST() FENCE_W_W() #define FENCE_I_gen() ((0b001 << 12) | 0b0001111) #define FENCE_I() EMIT(FENCE_I_gen()) @@ -415,11 +538,11 @@ f28–31 ft8–11 FP temporaries Caller #define SDz(rs2, rs1, imm12) EMIT(S_type(imm12, rs2, rs1, 0b010 + (1 - rex.is32bits), 0b0100011)) // Shift Left Immediate -#define SLLI(rd, rs1, imm6) EMIT(I_type(imm6, rs1, 0b001, rd, 0b0010011)) +#define SLLI(rd, rs1, imm6) EMIT(I_type(((imm6) & 0x3f), rs1, 0b001, rd, 0b0010011)) // Shift Right Logical Immediate -#define SRLI(rd, rs1, imm6) EMIT(I_type(imm6, rs1, 0b101, rd, 0b0010011)) +#define SRLI(rd, rs1, imm6) EMIT(I_type(((imm6) & 0x3f), rs1, 0b101, rd, 0b0010011)) // Shift Right Arithmetic Immediate -#define SRAI(rd, rs1, imm6) EMIT(I_type((imm6) | (0b010000 << 6), rs1, 0b101, rd, 0b0010011)) +#define SRAI(rd, rs1, imm6) EMIT(I_type(((imm6) & 0x3f) | (0b010000 << 6), rs1, 0b101, rd, 0b0010011)) // rd = rs1 + imm12 #define ADDIW(rd, rs1, imm12) EMIT(I_type((imm12) & 0b111111111111, rs1, 0b000, rd, 0b0011011)) @@ -428,20 +551,44 @@ f28–31 ft8–11 FP temporaries Caller // rd = rs1 + imm12 #define ADDIxw(rd, rs1, imm12) EMIT(I_type((imm12) & 0b111111111111, rs1, 0b000, rd, rex.w ? 0b0010011 : 0b0011011)) // rd = rs1 + imm12 -#define ADDIz(rd, rs1, imm12) EMIT(I_type((imm12) & 0b111111111111, rs1, 0b000, rd, rex.is32bits ? 0b0011011 : 0b0010011)) +#define ADDIz(rd, rs1, imm12) \ + do { \ + if (!rex.is32bits) { \ + ADDI(rd, rs1, imm12); \ + } else { \ + ADDIW(rd, rs1, imm12); \ + ZEROUP(rd); \ + } \ + } while (0) +#define ADDIy(rd, rs1, imm12) \ + do { \ + if (rex.is32bits || rex.is67) { \ + ADDIW(rd, rs1, imm12); \ + ZEROUP(rd); \ + } else { \ + ADDI(rd, rs1, imm12); \ + } \ + } while (0) // rd = rs1 + (rs2 << imm2) #define ADDSL(rd, rs1, rs2, imm2, scratch) \ if (!(imm2)) { \ ADD(rd, rs1, rs2); \ - } else if (rv64_zba) { \ + } else if (cpuext.zba) { \ SHxADD(rd, rs2, imm2, rs1); \ - } else if (rv64_xtheadba) { \ + } else if (cpuext.xtheadba) { \ TH_ADDSL(rd, rs1, rs2, imm2); \ } else { \ SLLI(scratch, rs2, imm2); \ ADD(rd, rs1, scratch); \ } +#define ADDSLy(rd, rs1, rs2, imm2, scratch) \ + if (rex.is32bits || rex.is67) { \ + ADDSL(rd, rs1, rs2, imm2, scratch); \ + ZEROUP(rd); \ + } else { \ + ADDSL(rd, rs1, rs2, imm2, scratch); \ + } #define SEXT_W(rd, rs1) ADDIW(rd, rs1, 0) @@ -452,60 +599,81 @@ f28–31 ft8–11 FP temporaries Caller // rd = rs1>>rs2 arithmetic #define SRAW(rd, rs1, rs2) EMIT(R_type(0b0100000, rs2, rs1, 0b101, rd, 0b0111011)) -#define SLLxw(rd, rs1, rs2) do { \ - if (rex.w) { \ - SLL(rd, rs1, rs2); \ - } else { \ - SLLW(rd, rs1, rs2); \ - ZEROUP(rd); \ - } } while (0) - -#define SRLxw(rd, rs1, rs2) do { \ - if (rex.w) { \ - SRL(rd, rs1, rs2); \ - } else { \ - SRLW(rd, rs1, rs2); \ - ZEROUP(rd); \ - } } while (0) - -#define SRAxw(rd, rs1, rs2) do { \ - if (rex.w) { \ - SRA(rd, rs1, rs2); \ - } else { \ - SRAW(rd, rs1, rs2); \ - ZEROUP(rd); \ - } } while (0) +#define SLLxw(rd, rs1, rs2) \ + do { \ + if (rex.w) { \ + SLL(rd, rs1, rs2); \ + } else { \ + SLLW(rd, rs1, rs2); \ + ZEROUP(rd); \ + } \ + } while (0) + +#define SRLxw(rd, rs1, rs2) \ + do { \ + if (rex.w) { \ + SRL(rd, rs1, rs2); \ + } else { \ + SRLW(rd, rs1, rs2); \ + ZEROUP(rd); \ + } \ + } while (0) + +#define SRAxw(rd, rs1, rs2) \ + do { \ + if (rex.w) { \ + SRA(rd, rs1, rs2); \ + } else { \ + SRAW(rd, rs1, rs2); \ + ZEROUP(rd); \ + } \ + } while (0) // Shift Left Immediate, 32-bit, sign-extended #define SLLIW(rd, rs1, imm5) EMIT(I_type(imm5, rs1, 0b001, rd, 0b0011011)) // Shift Left Immediate -#define SLLIxw(rd, rs1, imm) do { \ - if (rex.w) { \ - SLLI(rd, rs1, imm); \ - } else { \ - SLLIW(rd, rs1, imm); \ - ZEROUP(rd); \ - } } while (0) +#define SLLIxw(rd, rs1, imm) \ + do { \ + if (rex.w) { \ + SLLI(rd, rs1, imm); \ + } else { \ + SLLIW(rd, rs1, imm); \ + ZEROUP(rd); \ + } \ + } while (0) +#define SLLIy(rd, rs1, imm) \ + do { \ + if (rex.is32bits || rex.is67) { \ + SLLIW(rd, rs1, imm); \ + ZEROUP(rd); \ + } else { \ + SLLI(rd, rs1, imm); \ + } \ + } while (0) // Shift Right Logical Immediate, 32-bit, sign-extended #define SRLIW(rd, rs1, imm5) EMIT(I_type(imm5, rs1, 0b101, rd, 0b0011011)) // Shift Right Logical Immediate -#define SRLIxw(rd, rs1, imm) do { \ - if (rex.w) { \ - SRLI(rd, rs1, imm); \ - } else { \ - SRLIW(rd, rs1, imm); \ - if ((imm) == 0) ZEROUP(rd); \ - } } while (0) +#define SRLIxw(rd, rs1, imm) \ + do { \ + if (rex.w) { \ + SRLI(rd, rs1, imm); \ + } else { \ + SRLIW(rd, rs1, imm); \ + if ((imm) == 0) ZEROUP(rd); \ + } \ + } while (0) // Shift Right Arithmetic Immediate, 32-bit, sign-extended #define SRAIW(rd, rs1, imm5) EMIT(I_type((imm5) | (0b0100000 << 5), rs1, 0b101, rd, 0b0011011)) // Shift Right Arithmetic Immediate -#define SRAIxw(rd, rs1, imm) do { \ - if (rex.w) { \ - SRAI(rd, rs1, imm); \ - } else { \ - SRAIW(rd, rs1, imm); \ - ZEROUP(rd); \ - } } while (0) +#define SRAIxw(rd, rs1, imm) \ + do { \ + if (rex.w) { \ + SRAI(rd, rs1, imm); \ + } else { \ + SRAIW(rd, rs1, imm); \ + ZEROUP(rd); \ + } \ + } while (0) #define CSRRW(rd, rs1, csr) EMIT(I_type(csr, rs1, 0b001, rd, 0b1110011)) #define CSRRS(rd, rs1, csr) EMIT(I_type(csr, rs1, 0b010, rd, 0b1110011)) @@ -553,6 +721,14 @@ f28–31 ft8–11 FP temporaries Caller #define SC_W(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00011, aq, rl), rs2, rs1, 0b010, rd, 0b0101111)) #define AMOSWAP_W(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00001, aq, rl), rs2, rs1, 0b010, rd, 0b0101111)) +#define AMOADD_W(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00000, aq, rl), rs2, rs1, 0b010, rd, 0b0101111)) +#define AMOXOR_W(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00100, aq, rl), rs2, rs1, 0b010, rd, 0b0101111)) +#define AMOAND_W(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b01100, aq, rl), rs2, rs1, 0b010, rd, 0b0101111)) +#define AMOOR_W(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b01000, aq, rl), rs2, rs1, 0b010, rd, 0b0101111)) +#define AMOMIN_W(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b10000, aq, rl), rs2, rs1, 0b010, rd, 0b0101111)) +#define AMOMAX_W(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b10100, aq, rl), rs2, rs1, 0b010, rd, 0b0101111)) +#define AMOMINU_W(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b11000, aq, rl), rs2, rs1, 0b010, rd, 0b0101111)) +#define AMOMAXU_W(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b11100, aq, rl), rs2, rs1, 0b010, rd, 0b0101111)) // RV64A #define LR_D(rd, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00010, aq, rl), 0, rs1, 0b011, rd, 0b0101111)) @@ -562,6 +738,24 @@ f28–31 ft8–11 FP temporaries Caller #define SCxw(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00011, aq, rl), rs2, rs1, 0b010 | rex.w, rd, 0b0101111)) #define AMOSWAP_D(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00001, aq, rl), rs2, rs1, 0b011, rd, 0b0101111)) +#define AMOADD_D(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00000, aq, rl), rs2, rs1, 0b011, rd, 0b0101111)) +#define AMOXOR_D(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00100, aq, rl), rs2, rs1, 0b011, rd, 0b0101111)) +#define AMOAND_D(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b01100, aq, rl), rs2, rs1, 0b011, rd, 0b0101111)) +#define AMOOR_D(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b01000, aq, rl), rs2, rs1, 0b011, rd, 0b0101111)) +#define AMOMIN_D(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b10000, aq, rl), rs2, rs1, 0b011, rd, 0b0101111)) +#define AMOMAX_D(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b10100, aq, rl), rs2, rs1, 0b011, rd, 0b0101111)) +#define AMOMINU_D(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b11000, aq, rl), rs2, rs1, 0b011, rd, 0b0101111)) +#define AMOMAXU_D(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b11100, aq, rl), rs2, rs1, 0b011, rd, 0b0101111)) + +#define AMOSWAPxw(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00001, aq, rl), rs2, rs1, 0b010 | rex.w, rd, 0b0101111)) +#define AMOADDxw(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00000, aq, rl), rs2, rs1, 0b010 | rex.w, rd, 0b0101111)) +#define AMOXORxw(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b00100, aq, rl), rs2, rs1, 0b010 | rex.w, rd, 0b0101111)) +#define AMOANDxw(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b01100, aq, rl), rs2, rs1, 0b010 | rex.w, rd, 0b0101111)) +#define AMOORxw(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b01000, aq, rl), rs2, rs1, 0b010 | rex.w, rd, 0b0101111)) +#define AMOMINxw(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b10000, aq, rl), rs2, rs1, 0b010 | rex.w, rd, 0b0101111)) +#define AMOMAXxw(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b10100, aq, rl), rs2, rs1, 0b010 | rex.w, rd, 0b0101111)) +#define AMOMINUxw(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b11000, aq, rl), rs2, rs1, 0b010 | rex.w, rd, 0b0101111)) +#define AMOMAXUxw(rd, rs2, rs1, aq, rl) EMIT(R_type(AQ_RL(0b11100, aq, rl), rs2, rs1, 0b010 | rex.w, rd, 0b0101111)) // RV32F // Read round mode @@ -605,7 +799,7 @@ f28–31 ft8–11 FP temporaries Caller #define FSGNJS(rd, rs1, rs2) EMIT(R_type(0b0010000, rs2, rs1, 0b000, rd, 0b1010011)) // move rs1 to rd #define FMVS(rd, rs1) FSGNJS(rd, rs1, rs1) -// store rs1 with oposite rs2 sign bit to rd +// store rs1 with opposite rs2 sign bit to rd #define FSGNJNS(rd, rs1, rs2) EMIT(R_type(0b0010000, rs2, rs1, 0b001, rd, 0b1010011)) // -rs1 => rd #define FNEGS(rd, rs1) FSGNJNS(rd, rs1, rs1) @@ -619,14 +813,14 @@ f28–31 ft8–11 FP temporaries Caller #define FMVWX(frd, rs1) EMIT(R_type(0b1111000, 0b00000, rs1, 0b000, frd, 0b1010011)) // Convert from signed 32bits to Single #define FCVTSW(frd, rs1, rm) EMIT(R_type(0b1101000, 0b00000, rs1, rm, frd, 0b1010011)) -// Convert from Single to signed 32bits (trucated) +// Convert from Single to signed 32bits (truncated) #define FCVTWS(rd, frs1, rm) EMIT(R_type(0b1100000, 0b00000, frs1, rm, rd, 0b1010011)) -#define FADDS(frd, frs1, frs2) EMIT(R_type(0b0000000, frs2, frs1, 0b000, frd, 0b1010011)) -#define FSUBS(frd, frs1, frs2) EMIT(R_type(0b0000100, frs2, frs1, 0b000, frd, 0b1010011)) -#define FMULS(frd, frs1, frs2) EMIT(R_type(0b0001000, frs2, frs1, 0b000, frd, 0b1010011)) -#define FDIVS(frd, frs1, frs2) EMIT(R_type(0b0001100, frs2, frs1, 0b000, frd, 0b1010011)) -#define FSQRTS(frd, frs1) EMIT(R_type(0b0101100, 0b00000, frs1, 0b000, frd, 0b1010011)) +#define FADDS(frd, frs1, frs2) EMIT(R_type(0b0000000, frs2, frs1, 0b111, frd, 0b1010011)) +#define FSUBS(frd, frs1, frs2) EMIT(R_type(0b0000100, frs2, frs1, 0b111, frd, 0b1010011)) +#define FMULS(frd, frs1, frs2) EMIT(R_type(0b0001000, frs2, frs1, 0b111, frd, 0b1010011)) +#define FDIVS(frd, frs1, frs2) EMIT(R_type(0b0001100, frs2, frs1, 0b111, frd, 0b1010011)) +#define FSQRTS(frd, frs1) EMIT(R_type(0b0101100, 0b00000, frs1, 0b111, frd, 0b1010011)) #define FMINS(frd, frs1, frs2) EMIT(R_type(0b0010100, frs2, frs1, 0b000, frd, 0b1010011)) #define FMAXS(frd, frs1, frs2) EMIT(R_type(0b0010100, frs2, frs1, 0b001, frd, 0b1010011)) @@ -644,7 +838,7 @@ f28–31 ft8–11 FP temporaries Caller #define FCVTLS(rd, frs1, rm) EMIT(R_type(0b1100000, 0b00010, frs1, rm, rd, 0b1010011)) // Convert from Single to unsigned 64bits #define FCVTLUS(rd, frs1, rm) EMIT(R_type(0b1100000, 0b00011, frs1, rm, rd, 0b1010011)) -// onvert from Single to signed 32/64bits (trucated) +// Convert from Single to signed 32/64bits (truncated) #define FCVTSxw(rd, frs1, rm) EMIT(R_type(0b1100000, rex.w ? 0b00010 : 0b00000, frs1, rm, rd, 0b1010011)) // RV32D @@ -653,9 +847,9 @@ f28–31 ft8–11 FP temporaries Caller // store double precision frs2 to rs1+imm12 #define FSD(frs2, rs1, imm12) EMIT(S_type(imm12, frs2, rs1, 0b011, 0b0100111)) // Convert Double frs1 to Single frd -#define FCVTSD(frd, frs1) EMIT(R_type(0b0100000, 0b00001, frs1, 0b000, frd, 0b1010011)) +#define FCVTSD(frd, frs1) EMIT(R_type(0b0100000, 0b00001, frs1, 0b111, frd, 0b1010011)) // Convert Single frs1 to Double frd -#define FCVTDS(frd, frs1) EMIT(R_type(0b0100001, 0b00000, frs1, 0b000, frd, 0b1010011)) +#define FCVTDS(frd, frs1) EMIT(R_type(0b0100001, 0b00000, frs1, 0b111, frd, 0b1010011)) // Convert from Double to signed 32bits #define FCVTWD(rd, frs1, rm) EMIT(R_type(0b1100001, 0b00000, frs1, rm, rd, 0b1010011)) // Convert from Double to unsigned 32bits @@ -664,7 +858,7 @@ f28–31 ft8–11 FP temporaries Caller #define FSGNJD(rd, rs1, rs2) EMIT(R_type(0b0010001, rs2, rs1, 0b000, rd, 0b1010011)) // move rs1 to rd #define FMVD(rd, rs1) FSGNJD(rd, rs1, rs1) -// store rs1 with oposite rs2 sign bit to rd +// store rs1 with opposite rs2 sign bit to rd #define FSGNJND(rd, rs1, rs2) EMIT(R_type(0b0010001, rs2, rs1, 0b001, rd, 0b1010011)) // -rs1 => rd #define FNEGD(rd, rs1) FSGNJND(rd, rs1, rs1) @@ -679,11 +873,11 @@ f28–31 ft8–11 FP temporaries Caller #define FLTD(rd, frs1, frs2) EMIT(R_type(0b1010001, frs2, frs1, 0b001, rd, 0b1010011)) #define FLED(rd, frs1, frs2) EMIT(R_type(0b1010001, frs2, frs1, 0b000, rd, 0b1010011)) -#define FADDD(frd, frs1, frs2) EMIT(R_type(0b0000001, frs2, frs1, 0b000, frd, 0b1010011)) -#define FSUBD(frd, frs1, frs2) EMIT(R_type(0b0000101, frs2, frs1, 0b000, frd, 0b1010011)) -#define FMULD(frd, frs1, frs2) EMIT(R_type(0b0001001, frs2, frs1, 0b000, frd, 0b1010011)) -#define FDIVD(frd, frs1, frs2) EMIT(R_type(0b0001101, frs2, frs1, 0b000, frd, 0b1010011)) -#define FSQRTD(frd, frs1) EMIT(R_type(0b0101101, 0b00000, frs1, 0b000, frd, 0b1010011)) +#define FADDD(frd, frs1, frs2) EMIT(R_type(0b0000001, frs2, frs1, 0b111, frd, 0b1010011)) +#define FSUBD(frd, frs1, frs2) EMIT(R_type(0b0000101, frs2, frs1, 0b111, frd, 0b1010011)) +#define FMULD(frd, frs1, frs2) EMIT(R_type(0b0001001, frs2, frs1, 0b111, frd, 0b1010011)) +#define FDIVD(frd, frs1, frs2) EMIT(R_type(0b0001101, frs2, frs1, 0b111, frd, 0b1010011)) +#define FSQRTD(frd, frs1) EMIT(R_type(0b0101101, 0b00000, frs1, 0b111, frd, 0b1010011)) #define FMIND(frd, frs1, frs2) EMIT(R_type(0b0010101, frs2, frs1, 0b000, frd, 0b1010011)) #define FMAXD(frd, frs1, frs2) EMIT(R_type(0b0010101, frs2, frs1, 0b001, frd, 0b1010011)) @@ -706,6 +900,14 @@ f28–31 ft8–11 FP temporaries Caller // Convert from Double to unsigned integer #define FCVTLUDxw(rd, frs1, rm) EMIT(R_type(0b1100001, 0b00001 + (rex.w ? 0b10 : 0b00), frs1, rm, rd, 0b1010011)) +#define FMV(frd, frs1, single) \ + do { \ + if (single) \ + FMVS(frd, frs1); \ + else \ + FMVD(frd, frs1); \ + } while (0) + // Zba // Add unsigned word (Wz(rs1) + X(rs2)) #define ADDUW(rd, rs1, rs2) EMIT(R_type(0b0000100, rs2, rs1, 0b000, rd, 0b0111011)) @@ -742,44 +944,52 @@ f28–31 ft8–11 FP temporaries Caller // Count leading zero bits in word #define CLZW(rd, rs) EMIT(R_type(0b0110000, 0b00000, rs, 0b001, rd, 0b0011011)) // Count leading zero bits -#define CLZxw(rd, rs, x, s1, s2, s3) \ - if (rv64_zbb) { \ - if (x) \ - CLZ(rd, rs); \ - else \ - CLZW(rd, rs); \ - } else { \ - if (rs != rd) \ - u8 = rd; \ - else \ - u8 = s1; \ - ADDI(u8, xZR, rex.w ? 63 : 31); \ - if (rex.w) { \ - MV(s2, rs); \ - SRLI(s3, s2, 32); \ - BEQZ(s3, 4 + 2 * 4); \ - SUBI(u8, u8, 32); \ - MV(s2, s3); \ - } else { \ - AND(s2, rs, xMASK); \ - } \ - SRLI(s3, s2, 16); \ - BEQZ(s3, 4 + 2 * 4); \ - SUBI(u8, u8, 16); \ - MV(s2, s3); \ - SRLI(s3, s2, 8); \ - BEQZ(s3, 4 + 2 * 4); \ - SUBI(u8, u8, 8); \ - MV(s2, s3); \ - SRLI(s3, s2, 4); \ - BEQZ(s3, 4 + 2 * 4); \ - SUBI(u8, u8, 4); \ - MV(s2, s3); \ - ANDI(s2, s2, 0b1111); \ - TABLE64(s3, (uintptr_t) & lead0tab); \ - ADD(s3, s3, s2); \ - LBU(s2, s3, 0); \ - SUB(rd, u8, s2); \ +#define CLZxw(rd, rs, x, s1, s2, s3) \ + if (cpuext.zbb) { \ + if (x) \ + CLZ(rd, rs); \ + else \ + CLZW(rd, rs); \ + } else if (cpuext.xtheadbb) { \ + if (x) { \ + TH_FF1(rd, rs); \ + } else { \ + ZEXTW2(rd, rs); \ + TH_FF1(rd, rd); \ + SUBI(rd, rd, 32); \ + } \ + } else { \ + if (rs != rd) \ + u8 = rd; \ + else \ + u8 = s1; \ + ADDI(u8, xZR, x ? 63 : 31); \ + if (x) { \ + MV(s2, rs); \ + SRLI(s3, s2, 32); \ + BEQZ(s3, 4 + 2 * 4); \ + SUBI(u8, u8, 32); \ + MV(s2, s3); \ + } else { \ + ZEXTW2(s2, rs); \ + } \ + SRLI(s3, s2, 16); \ + BEQZ(s3, 4 + 2 * 4); \ + SUBI(u8, u8, 16); \ + MV(s2, s3); \ + SRLI(s3, s2, 8); \ + BEQZ(s3, 4 + 2 * 4); \ + SUBI(u8, u8, 8); \ + MV(s2, s3); \ + SRLI(s3, s2, 4); \ + BEQZ(s3, 4 + 2 * 4); \ + SUBI(u8, u8, 4); \ + MV(s2, s3); \ + ANDI(s2, s2, 0b1111); \ + TABLE64C(s3, const_lead0tab); \ + ADD(s3, s3, s2); \ + LBU(s2, s3, 0); \ + SUB(rd, u8, s2); \ } // Count trailing zero bits @@ -789,21 +999,21 @@ f28–31 ft8–11 FP temporaries Caller // Count trailing zero bits // BEWARE: You should take care of the all zeros situation yourself, // and clear the high 32bit when x is 1. -#define CTZxw(rd, rs, x, s1, s2) \ - if (rv64_zbb) { \ - if (x) \ - CTZ(rd, rs); \ - else \ - CTZW(rd, rs); \ - } else { \ - NEG(s2, ed); \ - AND(s2, s2, ed); \ - TABLE64(x3, 0x03f79d71b4ca8b09ULL); \ - MUL(s2, s2, x3); \ - SRLI(s2, s2, 64 - 6); \ - TABLE64(s1, (uintptr_t) & deBruijn64tab); \ - ADD(s1, s1, s2); \ - LBU(gd, s1, 0); \ +#define CTZxw(rd, rs, x, s1, s2) \ + if (cpuext.zbb) { \ + if (x) \ + CTZ(rd, rs); \ + else \ + CTZW(rd, rs); \ + } else { \ + NEG(s2, rs); \ + AND(s2, s2, rs); \ + TABLE64_(s1, 0x03f79d71b4ca8b09ULL); \ + MUL(s2, s2, s1); \ + SRLI(s2, s2, 64 - 6); \ + TABLE64C(s1, const_deBruijn64tab); \ + ADD(s1, s1, s2); \ + LBU(rd, s1, 0); \ } // Count set bits @@ -825,22 +1035,26 @@ f28–31 ft8–11 FP temporaries Caller // Sign-extend half-word #define SEXTH_(rd, rs) EMIT(R_type(0b0110000, 0b00101, rs, 0b001, rd, 0b0010011)) // Sign-extend half-word -#define SEXTH(rd, rs) \ - if (rv64_zbb) \ - SEXTH_(rd, rs); \ - else { \ - SLLI(rd, rs, 48); \ - SRAI(rd, rd, 48); \ +#define SEXTH(rd, rs) \ + if (cpuext.zbb) \ + SEXTH_(rd, rs); \ + else if (cpuext.xtheadbb) \ + TH_EXT(rd, rs, 15, 0); \ + else { \ + SLLI(rd, rs, 48); \ + SRAI(rd, rd, 48); \ } // Zero-extend half-word #define ZEXTH_(rd, rs) EMIT(R_type(0b0000100, 0b00000, rs, 0b100, rd, 0b0111011)) // Zero-extend half-word -#define ZEXTH(rd, rs) \ - if (rv64_zbb) \ - ZEXTH_(rd, rs); \ - else { \ - SLLI(rd, rs, 48); \ - SRLI(rd, rd, 48); \ +#define ZEXTH(rd, rs) \ + if (cpuext.zbb) \ + ZEXTH_(rd, rs); \ + else if (cpuext.xtheadbb) \ + TH_EXTU(rd, rs, 15, 0); \ + else { \ + SLLI(rd, rs, 48); \ + SRLI(rd, rd, 48); \ } // Insert low 16bits in rs to low 16bits of rd @@ -854,6 +1068,11 @@ f28–31 ft8–11 FP temporaries Caller OR(rd, rd, rs); \ } +// Insert low 16bits in rs to low 16bits of rd +#define INSHz(rd, rs, s1, s2, init_s1, zexth_rs) \ + INSH(rd, rs, s1, s2, init_s1, zexth_rs) \ + if (rex.is32bits) ZEXTW2(rd, rd); + // Rotate left (register) #define ROL(rd, rs1, rs2) EMIT(R_type(0b0110000, rs2, rs1, 0b001, rd, 0b0110011)) // Rotate left word (register) @@ -879,12 +1098,12 @@ f28–31 ft8–11 FP temporaries Caller // Byte-reverse register, rd can be the same as rs or s1, but rs cannot be the same as s1. #define REV8xw(rd, rs, s1, s2, s3, s4) \ - if (rv64_zbb) { \ + if (cpuext.zbb) { \ REV8(rd, rs); \ if (!rex.w) { \ SRLI(rd, rd, 32); \ } \ - } else if (rv64_xtheadbb) { \ + } else if (cpuext.xtheadbb) { \ if (rex.w) { \ TH_REV(rd, rs); \ } else { \ @@ -935,11 +1154,11 @@ f28–31 ft8–11 FP temporaries Caller } \ } \ if (!rex.w) \ - AND(rd, rd, xMASK); + ZEXTW2(rd, rd); // Zbc -// Carry-less multily (low-part) +// Carry-less multiply (low-part) #define CLMUL(rd, rs1, rs2) EMIT(R_type(0b0000101, rs2, rs1, 0b001, rd, 0b0110011)) // Carry-less multiply (high-part) #define CLMULH(rd, rs1, rs2) EMIT(R_type(0b0000101, rs2, rs1, 0b011, rd, 0b0110011)) @@ -947,7 +1166,7 @@ f28–31 ft8–11 FP temporaries Caller #define CLMULR(rd, rs1, rs2) EMIT(R_type(0b0000101, rs2, rs1, 0b010, rd, 0b0110011)) // Zbs -// encoding of the "imm" on RV64 use a slight different mask, but it will work using R_type with high bit of imm ovewriting low bit op func +// encoding of the "imm" on RV64 use a slight different mask, but it will work using R_type with high bit of imm overwriting low bit op func // Single-bit Clear (Register) #define BCLR(rd, rs1, rs2) EMIT(R_type(0b0100100, rs2, rs1, 0b001, rd, 0b0110011)) // Single-bit Clear (Immediate) @@ -967,7 +1186,7 @@ f28–31 ft8–11 FP temporaries Caller // Single-bit Extract (Register) #define BEXT(rd, rs1, rs2, s0) \ - if (rv64_zbs) { \ + if (cpuext.zbs) { \ if (rex.w) { \ BEXT_(rd, rs1, rs2); \ } else { \ @@ -982,9 +1201,9 @@ f28–31 ft8–11 FP temporaries Caller // Single-bit Extract (Immediate) #define BEXTI(rd, rs1, imm) \ - if (rv64_zbs) \ + if (cpuext.zbs) \ BEXTI_(rd, rs1, imm); \ - else if (rv64_xtheadbs) \ + else if (cpuext.xtheadbs) \ TH_TST(rd, rs1, imm); \ else { \ SRLIxw(rd, rs1, imm); \ @@ -1020,11 +1239,11 @@ f28–31 ft8–11 FP temporaries Caller // Extract and sign-extend bits. // reg[rd] := sign_extend(reg[rs1][imm1:imm2]) -#define TH_EXT(rd, rs1, imm1, imm2) EMIT(I_type((((imm1) & 0x1f) << 6) | ((imm2) & 0x1f), rs1, 0b010, rd, 0b0001011)) +#define TH_EXT(rd, rs1, imm1, imm2) EMIT(I_type((((imm1) & 0x3f) << 6) | ((imm2) & 0x3f), rs1, 0b010, rd, 0b0001011)) // Extract and zero-extend bits. // reg[rd] := zero_extend(reg[rs1][imm1:imm2]) -#define TH_EXTU(rd, rs1, imm1, imm2) EMIT(I_type((((imm1) & 0x1f) << 6) | ((imm2) & 0x1f), rs1, 0b011, rd, 0b0001011)) +#define TH_EXTU(rd, rs1, imm1, imm2) EMIT(I_type((((imm1) & 0x3f) << 6) | ((imm2) & 0x3f), rs1, 0b011, rd, 0b0001011)) // Find first '0'-bit // for i=xlen..0: @@ -1060,7 +1279,7 @@ f28–31 ft8–11 FP temporaries Caller // reg[rd][i] := 0xff // else // reg[rd][i] := 0 -#define TH_TSTNBZ(rd, rs1) EMIT(I_type(0b1000000000000, rs1, 0b001, rd, 0b0001011)) +#define TH_TSTNBZ(rd, rs1) EMIT(I_type(0b100000000000, rs1, 0b001, rd, 0b0001011)) // XTheadBs - Single-bit instructions @@ -1091,19 +1310,71 @@ f28–31 ft8–11 FP temporaries Caller // rs1 := rs1 + (sign_extend(imm5) << imm2) #define TH_LBIA(rd, rs1, imm5, imm2) EMIT(I_type(0b000110000000 | (((imm2) & 0b11) << 5) | ((imm5) & 0x1f), rs1, 0b100, rd, 0b0001011)) +// Load indexed half-word, increment address after loading. +// if (rs1 != rd) { +// rd := sign_extend(mem[rs1+1:rs1]) +// rs1 := rs1 + (sign_extend(imm5) << imm2) +// } +#define TH_LHIA(rd, rs1, imm5, imm2) EMIT(I_type(0b001110000000 | (((imm2) & 0b11) << 5) | ((imm5) & 0x1f), rs1, 0b100, rd, 0b0001011)) + +// Load indexed unsigned half-word, increment address after loading. +// if (rs1 != rd) { +// rd := zero_extend(mem[rs1+1:rs1]) +// rs1 := rs1 + (sign_extend(imm5) << imm2) +// } +#define TH_LHUIA(rd, rs1, imm5, imm2) EMIT(I_type(0b101110000000 | (((imm2) & 0b11) << 5) | ((imm5) & 0x1f), rs1, 0b100, rd, 0b0001011)) + +// Load indexed word, increment address after loading. +// if (rs1 != rd) { +// rd := sign_extend(mem[rs1+3:rs1]) +// rs1 := rs1 + (sign_extend(imm5) << imm2) +// } +#define TH_LWIA(rd, rs1, imm5, imm2) EMIT(I_type(0b010110000000 | (((imm2) & 0b11) << 5) | ((imm5) & 0x1f), rs1, 0b100, rd, 0b0001011)) + +// Load indexed unsigned word, increment address after loading. +// if (rs1 != rd) { +// rd := zero_extend(mem[rs1+3:rs1]) +// rs1 := rs1 + (sign_extend(imm5) << imm2) +// } +#define TH_LWUIA(rd, rs1, imm5, imm2) EMIT(I_type(0b110110000000 | (((imm2) & 0b11) << 5) | ((imm5) & 0x1f), rs1, 0b100, rd, 0b0001011)) + +// Load indexed double-word, increment address after loading. +// if (rs1 != rd) { +// rd := sign_extend(mem[rs1+7:rs1]) +// rs1 := rs1 + (sign_extend(imm5) << imm2) +// } +#define TH_LDIA(rd, rs1, imm5, imm2) EMIT(I_type(0b011110000000 | (((imm2) & 0b11) << 5) | ((imm5) & 0x1f), rs1, 0b100, rd, 0b0001011)) + +// Store indexed half-word, increment address before storage. +// rs1 := rs1 + (sign_extend(imm5) << imm2) +// mem[rs1+1:rs1] := rd +#define TH_SHIB(rd, rs1, imm5, imm2) EMIT(I_type(0b001010000000 | (((imm2) & 0b11) << 5) | ((imm5) & 0x1f), rs1, 0b101, rd, 0b0001011)) + +// Store indexed word, increment address before storage. +// rs1 := rs1 + (sign_extend(imm5) << imm2) +// mem[rs1+3:rs1] := rd +#define TH_SWIB(rd, rs1, imm5, imm2) EMIT(I_type(0b010010000000 | (((imm2) & 0b11) << 5) | ((imm5) & 0x1f), rs1, 0b101, rd, 0b0001011)) + +// Store indexed double-word, increment address before storage. +// rs1 := rs1 + (sign_extend(imm5) << imm2) +// mem[rs1+7:rs1] := rd +#define TH_SDIB(rd, rs1, imm5, imm2) EMIT(I_type(0b011010000000 | (((imm2) & 0b11) << 5) | ((imm5) & 0x1f), rs1, 0b101, rd, 0b0001011)) + +// Load indexed word. +// addr := rs1 + (rs2 << imm2) +// rd := sign_extend(mem[addr+7:addr]) +#define TH_LRD(rd, rs1, rs2, imm2) EMIT(R_type(0b0110000 | ((imm2) & 0b11), rs2, rs1, 0b100, rd, 0b0001011)) + // TODO // th.lbib rd, (rs1), imm5, imm2 Load indexed byte // th.lbuia rd, (rs1), imm5, imm2 Load indexed unsigned byte // th.lbuib rd, (rs1), imm5, imm2 Load indexed unsigned byte // th.lhia rd, (rs1), imm5, imm2 Load indexed half-word // th.lhib rd, (rs1), imm5, imm2 Load indexed half-word -// th.lhuia rd, (rs1), imm5, imm2 Load indexed unsigned half-word // th.lhuib rd, (rs1), imm5, imm2 Load indexed unsigned half-word // th.lwia rd, (rs1), imm5, imm2 Load indexed word // th.lwib rd, (rs1), imm5, imm2 Load indexed word -// th.lwuia rd, (rs1), imm5, imm2 Load indexed unsigned word // th.lwuib rd, (rs1), imm5, imm2 Load indexed unsigned word -// th.ldia rd, (rs1), imm5, imm2 Load indexed double-word // th.ldib rd, (rs1), imm5, imm2 Load indexed double-word // th.sbia rd, (rs1), imm5, imm2 Store indexed byte // th.sbib rd, (rs1), imm5, imm2 Store indexed byte @@ -1112,14 +1383,12 @@ f28–31 ft8–11 FP temporaries Caller // th.swia rd, (rs1), imm5, imm2 Store indexed word // th.swib rd, (rs1), imm5, imm2 Store indexed word // th.sdia rd, (rs1), imm5, imm2 Store indexed double-word -// th.sdib rd, (rs1), imm5, imm2 Store indexed double-word // th.lrb rd, rs1, rs2, imm2 Load indexed byte // th.lrbu rd, rs1, rs2, imm2 Load indexed unsigned byte // th.lrh rd, rs1, rs2, imm2 Load indexed half-word // th.lrhu rd, rs1, rs2, imm2 Load indexed unsigned half-word // th.lrw rd, rs1, rs2, imm2 Load indexed word // th.lrwu rd, rs1, rs2, imm2 Load indexed unsigned word -// th.lrd rd, rs1, rs2, imm2 Load indexed double-word // th.srb rd, rs1, rs2, imm2 Store indexed byte // th.srh rd, rs1, rs2, imm2 Store indexed half-word // th.srw rd, rs1, rs2, imm2 Store indexed word @@ -1211,10 +1480,37 @@ f28–31 ft8–11 FP temporaries Caller // Vector extension emitter -#define VECTOR_SEW8 0b000 -#define VECTOR_SEW16 0b001 -#define VECTOR_SEW32 0b010 -#define VECTOR_SEW64 0b011 +/* Warning: mind the differences between RVV 1.0 and XTheadVector! + * + * - Different encoding of vsetvl/th.vsetvl. + * - No vsetivli instruction. + * - Cannot configure vta and vma vsetvl instruction, the fixed value is TAMU. + * - No whole register move instructions. + * - No fractional lmul. + * - Different load/store instructions. + * - Different name of vector indexed instructions. + * - Destination vector register cannot overlap source vector register group for vmadc/vmsbc/widen arithmetic/narrow arithmetic. + * - No vlm/vsm instructions. + * - Different vnsrl/vnsra/vfncvt suffix (vv/vx/vi vs wv/wx/wi). + * - Different size of mask mode (1.0 is vl and xtheadvector is vlen). + * - No vrgatherei16.vv instruction. + * - Different encoding of vmv.s.x instruction. + * + * We ignore all the naming differences and use the RVV 1.0 naming convention. + + */ + +#define VECTOR_SEW8 0b000 +#define VECTOR_SEW16 0b001 +#define VECTOR_SEW32 0b010 +#define VECTOR_SEW64 0b011 +#define VECTOR_SEWNA 0b111 // N/A +#define VECTOR_SEWANY 0b1000 // any sew would be ok, but not N/A. + +#define VECTOR_LMUL1 0b000 +#define VECTOR_LMUL2 0b001 +#define VECTOR_LMUL4 0b010 +#define VECTOR_LMUL8 0b011 #define VECTOR_MASKED 0 #define VECTOR_UNMASKED 1 @@ -1252,41 +1548,45 @@ f28–31 ft8–11 FP temporaries Caller #define VSE32_V(vs3, rs1, vm, nf) EMIT(I_type(((nf) << 9) | (vm << 5), rs1, 0b110, vs3, 0b0100111)) // ...000.00000.....110.....0100111 #define VSE64_V(vs3, rs1, vm, nf) EMIT(I_type(((nf) << 9) | (vm << 5), rs1, 0b111, vs3, 0b0100111)) // ...000.00000.....111.....0100111 +#define VLE_V(vd, rs1, sew, vm, nf) EMIT(I_type(((nf) << 9) | (vm << 5), rs1, (sew == 0b000 ? 0b000 : (0b100 | sew)), vd, 0b0000111)) +#define VSE_V(vs3, rs1, sew, vm, nf) EMIT(I_type(((nf) << 9) | (vm << 5), rs1, (sew == 0b000 ? 0b000 : (0b100 | sew)), vs3, 0b0100111)) + // Vector Indexed-Unordered Instructions (including segment part) // https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#76-vector-indexed-instructions +// Note: Make sure SEW in vtype is always the same as EEW, for xtheadvector compatibility! -#define VLUXEI8_V(vd, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0010, vs2, rs1, 0b000, vd, 0b0000111)) // ...001...........000.....0000111 -#define VLUXEI16_V(vd, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0010, vs2, rs1, 0b101, vd, 0b0000111)) // ...001...........101.....0000111 -#define VLUXEI32_V(vd, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0010, vs2, rs1, 0b110, vd, 0b0000111)) // ...001...........110.....0000111 -#define VLUXEI64_V(vd, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0010, vs2, rs1, 0b111, vd, 0b0000111)) // ...001...........111.....0000111 -#define VSUXEI8_V(vs3, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0010, vs2, rs1, 0b000, vs3, 0b0100111)) // ...001...........000.....0100111 -#define VSUXEI16_V(vs3, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0010, vs2, rs1, 0b101, vs3, 0b0100111)) // ...001...........101.....0100111 -#define VSUXEI32_V(vs3, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0010, vs2, rs1, 0b110, vs3, 0b0100111)) // ...001...........110.....0100111 -#define VSUXEI64_V(vs3, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0010, vs2, rs1, 0b111, vs3, 0b0100111)) // ...001...........111.....0100111 +#define VLUXEI8_V(vd, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | (cpuext.xtheadvector ? 0b0110 : 0b0010), vs2, rs1, 0b000, vd, 0b0000111)) // ...001...........000.....0000111 +#define VLUXEI16_V(vd, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | (cpuext.xtheadvector ? 0b0110 : 0b0010), vs2, rs1, 0b101, vd, 0b0000111)) // ...001...........101.....0000111 +#define VLUXEI32_V(vd, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | (cpuext.xtheadvector ? 0b0110 : 0b0010), vs2, rs1, 0b110, vd, 0b0000111)) // ...001...........110.....0000111 +#define VLUXEI64_V(vd, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | (cpuext.xtheadvector ? 0b0110 : 0b0010), vs2, rs1, 0b111, vd, 0b0000111)) // ...001...........111.....0000111 +#define VSUXEI8_V(vs3, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | (cpuext.xtheadvector ? 0b1110 : 0b0010), vs2, rs1, 0b000, vs3, 0b0100111)) // ...001...........000.....0100111 +#define VSUXEI16_V(vs3, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | (cpuext.xtheadvector ? 0b1110 : 0b0010), vs2, rs1, 0b101, vs3, 0b0100111)) // ...001...........101.....0100111 +#define VSUXEI32_V(vs3, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | (cpuext.xtheadvector ? 0b1110 : 0b0010), vs2, rs1, 0b110, vs3, 0b0100111)) // ...001...........110.....0100111 +#define VSUXEI64_V(vs3, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | (cpuext.xtheadvector ? 0b1110 : 0b0010), vs2, rs1, 0b111, vs3, 0b0100111)) // ...001...........111.....0100111 // Vector Strided Instructions (including segment part) // https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#75-vector-strided-instructions -#define VLSE8_V(vd, rs1, rs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b000, vd, 0b0000111)) // ...010...........000.....0000111 -#define VLSE16_V(vd, rs1, rs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b101, vd, 0b0000111)) // ...010...........101.....0000111 -#define VLSE32_V(vd, rs1, rs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b110, vd, 0b0000111)) // ...010...........110.....0000111 -#define VLSE64_V(vd, rs1, rs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b111, vd, 0b0000111)) // ...010...........111.....0000111 -#define VSSE8_V(vs3, rs1, rs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b000, vs3, 0b0100111)) // ...010...........000.....0100111 -#define VSSE16_V(vs3, rs1, rs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b101, vs3, 0b0100111)) // ...010...........101.....0100111 -#define VSSE32_V(vs3, rs1, rs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b110, vs3, 0b0100111)) // ...010...........110.....0100111 -#define VSSE64_V(vs3, rs1, rs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b111, vs3, 0b0100111)) // ...010...........111.....0100111 +#define VLSE8_V(vd, rs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b000, vd, 0b0000111)) // ...010...........000.....0000111 +#define VLSE16_V(vd, rs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b101, vd, 0b0000111)) // ...010...........101.....0000111 +#define VLSE32_V(vd, rs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b110, vd, 0b0000111)) // ...010...........110.....0000111 +#define VLSE64_V(vd, rs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b111, vd, 0b0000111)) // ...010...........111.....0000111 +#define VSSE8_V(vs3, rs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b000, vs3, 0b0100111)) // ...010...........000.....0100111 +#define VSSE16_V(vs3, rs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b101, vs3, 0b0100111)) // ...010...........101.....0100111 +#define VSSE32_V(vs3, rs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b110, vs3, 0b0100111)) // ...010...........110.....0100111 +#define VSSE64_V(vs3, rs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0100, rs2, rs1, 0b111, vs3, 0b0100111)) // ...010...........111.....0100111 // Vector Indexed-Ordered Instructions (including segment part) // https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#76-vector-indexed-instructions -#define VLOXEI8_V(vd, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b000, vd, 0b0000111)) // ...011...........000.....0000111 -#define VLOXEI16_V(vd, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b101, vd, 0b0000111)) // ...011...........101.....0000111 -#define VLOXEI32_V(vd, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b110, vd, 0b0000111)) // ...011...........110.....0000111 -#define VLOXEI64_V(vd, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b111, vd, 0b0000111)) // ...011...........111.....0000111 -#define VSOXEI8_V(vs3, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b000, vs3, 0b0100111)) // ...011...........000.....0100111 -#define VSOXEI16_V(vs3, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b101, vs3, 0b0100111)) // ...011...........101.....0100111 -#define VSOXEI32_V(vs3, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b110, vs3, 0b0100111)) // ...011...........110.....0100111 -#define VSOXEI64_V(vs3, rs1, vs2, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b111, vs3, 0b0100111)) // ...011...........111.....0100111 +#define VLOXEI8_V(vd, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b000, vd, 0b0000111)) // ...011...........000.....0000111 +#define VLOXEI16_V(vd, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b101, vd, 0b0000111)) // ...011...........101.....0000111 +#define VLOXEI32_V(vd, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b110, vd, 0b0000111)) // ...011...........110.....0000111 +#define VLOXEI64_V(vd, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b111, vd, 0b0000111)) // ...011...........111.....0000111 +#define VSOXEI8_V(vs3, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b000, vs3, 0b0100111)) // ...011...........000.....0100111 +#define VSOXEI16_V(vs3, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b101, vs3, 0b0100111)) // ...011...........101.....0100111 +#define VSOXEI32_V(vs3, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b110, vs3, 0b0100111)) // ...011...........110.....0100111 +#define VSOXEI64_V(vs3, vs2, rs1, vm, nf) EMIT(R_type(((nf) << 4) | (vm) | 0b0110, vs2, rs1, 0b111, vs3, 0b0100111)) // ...011...........111.....0100111 // Unit-stride F31..29=0ault-Only-First Loads // https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#77-unit-stride-fault-only-first-loads @@ -1324,246 +1624,247 @@ f28–31 ft8–11 FP temporaries Caller // https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#14-vector-floating-point-instructions // OPFVF -#define VFADD_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0000000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 000000...........101.....1010111 -#define VFSUB_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0000100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 000010...........101.....1010111 -#define VFMIN_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0001000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 000100...........101.....1010111 -#define VFMAX_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0001100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 000110...........101.....1010111 -#define VFSGNJ_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0010000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 001000...........101.....1010111 -#define VFSGNJN_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0010010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 001001...........101.....1010111 -#define VFSGNJX_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0010100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 001010...........101.....1010111 -#define VFSLIDE1UP_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0011100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 001110...........101.....1010111 -#define VFSLIDE1DOWN_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0011110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 001111...........101.....1010111 - -#define VFMV_S_F(vd, rs1) EMIT(I_type(0b010000100000, rs1, 0b101, vd, 0b1010111)) // 010000100000.....101.....1010111 -#define VFMV_V_F(vd, rs1) EMIT(I_type(0b010111100000, rs1, 0b101, vd, 0b1010111)) // 010111100000.....101.....1010111 - -#define VFMERGE_VFM(vd, rs1, vs2) EMIT(R_type(0b0101110, vs2, rs1, 0b101, vd, 0b1010111)) // 0101110..........101.....1010111 - -#define VMFEQ_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0110000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 011000...........101.....1010111 -#define VMFLE_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0110010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 011001...........101.....1010111 -#define VMFLT_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0110110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 011011...........101.....1010111 -#define VMFNE_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0111000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 011100...........101.....1010111 -#define VMFGT_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0111010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 011101...........101.....1010111 -#define VMFGE_VF(vd, rs1, vs2, vm) EMIT(R_type(0b0111110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 011111...........101.....1010111 -#define VFDIV_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1000000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 100000...........101.....1010111 -#define VFRDIV_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1000010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 100001...........101.....1010111 -#define VFMUL_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1001000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 100100...........101.....1010111 -#define VFRSUB_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1001110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 100111...........101.....1010111 -#define VFMADD_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1010000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101000...........101.....1010111 -#define VFNMADD_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1010010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101001...........101.....1010111 -#define VFMSUB_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1010100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101010...........101.....1010111 -#define VFNMSUB_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1010110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101011...........101.....1010111 -#define VFMACC_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1011000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101100...........101.....1010111 -#define VFNMACC_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1011010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101101...........101.....1010111 -#define VFMSAC_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1011100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101110...........101.....1010111 -#define VFNMSAC_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1011110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101111...........101.....1010111 -#define VFWADD_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1100000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 110000...........101.....1010111 -#define VFWSUB_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1100100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 110010...........101.....1010111 -#define VFWADD_WF(vd, rs1, vs2, vm) EMIT(R_type(0b1101000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 110100...........101.....1010111 -#define VFWSUB_WF(vd, rs1, vs2, vm) EMIT(R_type(0b1101100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 110110...........101.....1010111 -#define VFWMUL_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1110000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 111000...........101.....1010111 -#define VFWMACC_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1111000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 111100...........101.....1010111 -#define VFWNMACC_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1111010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 111101...........101.....1010111 -#define VFWMSAC_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1111100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 111110...........101.....1010111 -#define VFWNMSAC_VF(vd, rs1, vs2, vm) EMIT(R_type(0b1111110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 111111...........101.....1010111 +#define VFADD_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0000000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 000000...........101.....1010111 +#define VFSUB_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0000100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 000010...........101.....1010111 +#define VFMIN_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0001000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 000100...........101.....1010111 +#define VFMAX_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0001100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 000110...........101.....1010111 +#define VFSGNJ_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0010000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 001000...........101.....1010111 +#define VFSGNJN_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0010010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 001001...........101.....1010111 +#define VFSGNJX_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0010100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 001010...........101.....1010111 +#define VFSLIDE1UP_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0011100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 001110...........101.....1010111 +#define VFSLIDE1DOWN_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0011110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 001111...........101.....1010111 + +#define VFMV_S_F(vd, rs1) EMIT(I_type((cpuext.xtheadvector ? 0b001101100000 : 0b010000100000), rs1, 0b101, vd, 0b1010111)) // 010000100000.....101.....1010111 +#define VFMV_V_F(vd, rs1) EMIT(I_type(0b010111100000, rs1, 0b101, vd, 0b1010111)) // 010111100000.....101.....1010111 + +#define VFMERGE_VFM(vd, vs2, rs1) EMIT(R_type(0b0101110, vs2, rs1, 0b101, vd, 0b1010111)) // 0101110..........101.....1010111 + +#define VMFEQ_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0110000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 011000...........101.....1010111 +#define VMFLE_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0110010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 011001...........101.....1010111 +#define VMFLT_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0110110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 011011...........101.....1010111 +#define VMFNE_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0111000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 011100...........101.....1010111 +#define VMFGT_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0111010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 011101...........101.....1010111 +#define VMFGE_VF(vd, vs2, rs1, vm) EMIT(R_type(0b0111110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 011111...........101.....1010111 +#define VFDIV_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1000000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 100000...........101.....1010111 +#define VFRDIV_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1000010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 100001...........101.....1010111 +#define VFMUL_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1001000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 100100...........101.....1010111 +#define VFRSUB_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1001110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 100111...........101.....1010111 +#define VFMADD_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1010000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101000...........101.....1010111 +#define VFNMADD_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1010010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101001...........101.....1010111 +#define VFMSUB_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1010100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101010...........101.....1010111 +#define VFNMSUB_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1010110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101011...........101.....1010111 +#define VFMACC_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1011000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101100...........101.....1010111 +#define VFNMACC_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1011010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101101...........101.....1010111 +#define VFMSAC_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1011100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101110...........101.....1010111 +#define VFNMSAC_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1011110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 101111...........101.....1010111 +#define VFWADD_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1100000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 110000...........101.....1010111 +#define VFWSUB_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1100100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 110010...........101.....1010111 +#define VFWADD_WF(vd, vs2, rs1, vm) EMIT(R_type(0b1101000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 110100...........101.....1010111 +#define VFWSUB_WF(vd, vs2, rs1, vm) EMIT(R_type(0b1101100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 110110...........101.....1010111 +#define VFWMUL_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1110000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 111000...........101.....1010111 +#define VFWMACC_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1111000 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 111100...........101.....1010111 +#define VFWNMACC_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1111010 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 111101...........101.....1010111 +#define VFWMSAC_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1111100 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 111110...........101.....1010111 +#define VFWNMSAC_VF(vd, vs2, rs1, vm) EMIT(R_type(0b1111110 | (vm), vs2, rs1, 0b101, vd, 0b1010111)) // 111111...........101.....1010111 // OPFVV -#define VFADD_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0000000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000000...........001.....1010111 -#define VFREDUSUM_VS(vd, vs1, vs2, vm) EMIT(R_type(0b0000010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000001...........001.....1010111 -#define VFSUB_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0000100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000010...........001.....1010111 -#define VFREDOSUM_VS(vd, vs1, vs2, vm) EMIT(R_type(0b0000110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000011...........001.....1010111 -#define VFMIN_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0001000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000100...........001.....1010111 -#define VFREDMIN_VS(vd, vs1, vs2, vm) EMIT(R_type(0b0001010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000101...........001.....1010111 -#define VFMAX_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0001100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000110...........001.....1010111 -#define VFREDMAX_VS(vd, vs1, vs2, vm) EMIT(R_type(0b0001110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000111...........001.....1010111 -#define VFSGNJ_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0010000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 001000...........001.....1010111 -#define VFSGNJN_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0010010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 001001...........001.....1010111 -#define VFSGNJX_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0010100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 001010...........001.....1010111 - -#define VFMV_F_S(rd, vs2) EMIT(R_type(0b0100001, vs2, 0b00000, 0b001, rd, 0b1010111)) // 0100001.....00000001.....1010111 - -#define VMFEQ_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0110000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 011000...........001.....1010111 -#define VMFLE_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0110010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 011001...........001.....1010111 -#define VMFLT_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0110110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 011011...........001.....1010111 -#define VMFNE_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0111000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 011100...........001.....1010111 -#define VFDIV_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1000000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 100000...........001.....1010111 -#define VFMUL_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1001000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 100100...........001.....1010111 -#define VFMADD_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1010000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101000...........001.....1010111 -#define VFNMADD_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1010010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101001...........001.....1010111 -#define VFMSUB_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1010100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101010...........001.....1010111 -#define VFNMSUB_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1010110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101011...........001.....1010111 -#define VFMACC_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1011000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101100...........001.....1010111 -#define VFNMACC_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1011010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101101...........001.....1010111 -#define VFMSAC_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1011100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101110...........001.....1010111 -#define VFNMSAC_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1011110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101111...........001.....1010111 - -#define VFCVT_XU_F_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b00000, 0b001, vd, 0b1010111)) // 010010......00000001.....1010111 -#define VFCVT_X_F_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b00001, 0b001, vd, 0b1010111)) // 010010......00001001.....1010111 -#define VFCVT_F_XU_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b00010, 0b001, vd, 0b1010111)) // 010010......00010001.....1010111 -#define VFCVT_F_X_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b00011, 0b001, vd, 0b1010111)) // 010010......00011001.....1010111 -#define VFCVT_RTZ_XU_F_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b00110, 0b001, vd, 0b1010111)) // 010010......00110001.....1010111 -#define VFCVT_RTZ_X_F_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b00111, 0b001, vd, 0b1010111)) // 010010......00111001.....1010111 -#define VFWCVT_XU_F_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b01000, 0b001, vd, 0b1010111)) // 010010......01000001.....1010111 -#define VFWCVT_X_F_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b01001, 0b001, vd, 0b1010111)) // 010010......01001001.....1010111 -#define VFWCVT_F_XU_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b01010, 0b001, vd, 0b1010111)) // 010010......01010001.....1010111 -#define VFWCVT_F_X_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b01011, 0b001, vd, 0b1010111)) // 010010......01011001.....1010111 -#define VFWCVT_F_F_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b01100, 0b001, vd, 0b1010111)) // 010010......01100001.....1010111 -#define VFWCVT_RTZ_XU_F_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b01110, 0b001, vd, 0b1010111)) // 010010......01110001.....1010111 -#define VFWCVT_RTZ_X_F_V(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b01111, 0b001, vd, 0b1010111)) // 010010......01111001.....1010111 -#define VFNCVT_XU_F_W(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b10000, 0b001, vd, 0b1010111)) // 010010......10000001.....1010111 -#define VFNCVT_X_F_W(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b10001, 0b001, vd, 0b1010111)) // 010010......10001001.....1010111 -#define VFNCVT_F_XU_W(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b10010, 0b001, vd, 0b1010111)) // 010010......10010001.....1010111 -#define VFNCVT_F_X_W(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b10011, 0b001, vd, 0b1010111)) // 010010......10011001.....1010111 -#define VFNCVT_F_F_W(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b10100, 0b001, vd, 0b1010111)) // 010010......10100001.....1010111 -#define VFNCVT_ROD_F_F_W(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b10101, 0b001, vd, 0b1010111)) // 010010......10101001.....1010111 -#define VFNCVT_RTZ_XU_F_W(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b10110, 0b001, vd, 0b1010111)) // 010010......10110001.....1010111 -#define VFNCVT_RTZ_X_F_W(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b10111, 0b001, vd, 0b1010111)) // 010010......10111001.....1010111 -#define VFSQRT_V(vd, vs2, vm) EMIT(R_type(0b0100110 | (vm), vs2, 0b00000, 0b001, vd, 0b1010111)) // 010011......00000001.....1010111 -#define VFRSQRT7_V(vd, vs2, vm) EMIT(R_type(0b0100110 | (vm), vs2, 0b00100, 0b001, vd, 0b1010111)) // 010011......00100001.....1010111 -#define VFREC7_V(vd, vs2, vm) EMIT(R_type(0b0100110 | (vm), vs2, 0b00101, 0b001, vd, 0b1010111)) // 010011......00101001.....1010111 -#define VFCLASS_V(vd, vs2, vm) EMIT(R_type(0b0100110 | (vm), vs2, 0b10000, 0b001, vd, 0b1010111)) // 010011......10000001.....1010111 - -#define VFWADD_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1100000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 110000...........001.....1010111 -#define VFWREDUSUM_VS(vd, vs1, vs2, vm) EMIT(R_type(0b1100010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 110001...........001.....1010111 -#define VFWSUB_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1100100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 110010...........001.....1010111 -#define VFWREDOSUM_VS(vd, vs1, vs2, vm) EMIT(R_type(0b1100110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 110011...........001.....1010111 -#define VFWADD_WV(vd, vs1, vs2, vm) EMIT(R_type(0b1101000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 110100...........001.....1010111 -#define VFWSUB_WV(vd, vs1, vs2, vm) EMIT(R_type(0b1101100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 110110...........001.....1010111 -#define VFWMUL_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1110000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 111000...........001.....1010111 -#define VFWMACC_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1111000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 111100...........001.....1010111 -#define VFWNMACC_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1111010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 111101...........001.....1010111 -#define VFWMSAC_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1111100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 111110...........001.....1010111 -#define VFWNMSAC_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1111110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 111111...........001.....1010111 +#define VFADD_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0000000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000000...........001.....1010111 +#define VFREDUSUM_VS(vd, vs2, vs1, vm) EMIT(R_type(0b0000010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000001...........001.....1010111 +#define VFSUB_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0000100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000010...........001.....1010111 +#define VFREDOSUM_VS(vd, vs2, vs1, vm) EMIT(R_type(0b0000110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000011...........001.....1010111 +#define VFMIN_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0001000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000100...........001.....1010111 +#define VFREDMIN_VS(vd, vs2, vs1, vm) EMIT(R_type(0b0001010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000101...........001.....1010111 +#define VFMAX_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0001100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000110...........001.....1010111 +#define VFREDMAX_VS(vd, vs2, vs1, vm) EMIT(R_type(0b0001110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 000111...........001.....1010111 +#define VFSGNJ_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0010000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 001000...........001.....1010111 +#define VFSGNJN_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0010010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 001001...........001.....1010111 +#define VFSGNJX_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0010100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 001010...........001.....1010111 + +#define VFMV_F_S(rd, vs2) EMIT(R_type((cpuext.xtheadvector ? 0b0011001 : 0b0100001), vs2, 0b00000, 0b001, rd, 0b1010111)) // 0100001.....00000001.....1010111 + +#define VMFEQ_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0110000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 011000...........001.....1010111 +#define VMFLE_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0110010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 011001...........001.....1010111 +#define VMFLT_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0110110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 011011...........001.....1010111 +#define VMFNE_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0111000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 011100...........001.....1010111 +#define VFDIV_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1000000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 100000...........001.....1010111 +#define VFMUL_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1001000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 100100...........001.....1010111 +#define VFMADD_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1010000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101000...........001.....1010111 +#define VFNMADD_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1010010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101001...........001.....1010111 +#define VFMSUB_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1010100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101010...........001.....1010111 +#define VFNMSUB_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1010110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101011...........001.....1010111 +#define VFMACC_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1011000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101100...........001.....1010111 +#define VFNMACC_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1011010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101101...........001.....1010111 +#define VFMSAC_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1011100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101110...........001.....1010111 +#define VFNMSAC_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1011110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 101111...........001.....1010111 + +#define VFCVT_XU_F_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b00000, 0b001, vd, 0b1010111)) // 010010......00000001.....1010111 +#define VFCVT_X_F_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b00001, 0b001, vd, 0b1010111)) // 010010......00001001.....1010111 +#define VFCVT_F_XU_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b00010, 0b001, vd, 0b1010111)) // 010010......00010001.....1010111 +#define VFCVT_F_X_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b00011, 0b001, vd, 0b1010111)) // 010010......00011001.....1010111 +#define VFCVT_RTZ_XU_F_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b00110, 0b001, vd, 0b1010111)) // 010010......00110001.....1010111 +#define VFCVT_RTZ_X_F_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b00111, 0b001, vd, 0b1010111)) // 010010......00111001.....1010111 +#define VFWCVT_XU_F_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b01000, 0b001, vd, 0b1010111)) // 010010......01000001.....1010111 +#define VFWCVT_X_F_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b01001, 0b001, vd, 0b1010111)) // 010010......01001001.....1010111 +#define VFWCVT_F_XU_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b01010, 0b001, vd, 0b1010111)) // 010010......01010001.....1010111 +#define VFWCVT_F_X_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b01011, 0b001, vd, 0b1010111)) // 010010......01011001.....1010111 +#define VFWCVT_F_F_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b01100, 0b001, vd, 0b1010111)) // 010010......01100001.....1010111 +#define VFWCVT_RTZ_XU_F_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b01110, 0b001, vd, 0b1010111)) // 010010......01110001.....1010111 +#define VFWCVT_RTZ_X_F_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b01111, 0b001, vd, 0b1010111)) // 010010......01111001.....1010111 +#define VFNCVT_XU_F_W(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b10000, 0b001, vd, 0b1010111)) // 010010......10000001.....1010111 +#define VFNCVT_X_F_W(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b10001, 0b001, vd, 0b1010111)) // 010010......10001001.....1010111 +#define VFNCVT_F_XU_W(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b10010, 0b001, vd, 0b1010111)) // 010010......10010001.....1010111 +#define VFNCVT_F_X_W(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b10011, 0b001, vd, 0b1010111)) // 010010......10011001.....1010111 +#define VFNCVT_F_F_W(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b10100, 0b001, vd, 0b1010111)) // 010010......10100001.....1010111 +#define VFNCVT_ROD_F_F_W(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b10101, 0b001, vd, 0b1010111)) // 010010......10101001.....1010111 +#define VFNCVT_RTZ_XU_F_W(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b10110, 0b001, vd, 0b1010111)) // 010010......10110001.....1010111 +#define VFNCVT_RTZ_X_F_W(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000100 : 0b0100100) | (vm), vs2, 0b10111, 0b001, vd, 0b1010111)) // 010010......10111001.....1010111 +#define VFSQRT_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000110 : 0b0100110) | (vm), vs2, 0b00000, 0b001, vd, 0b1010111)) // 010011......00000001.....1010111 +#define VFCLASS_V(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b1000110 : 0b0100110) | (vm), vs2, 0b10000, 0b001, vd, 0b1010111)) // 010011......10000001.....1010111 + +#define VFRSQRT7_V(vd, vs2, vm) EMIT(R_type(0b0100110 | (vm), vs2, 0b00100, 0b001, vd, 0b1010111)) // 010011......00100001.....1010111 +#define VFREC7_V(vd, vs2, vm) EMIT(R_type(0b0100110 | (vm), vs2, 0b00101, 0b001, vd, 0b1010111)) // 010011......00101001.....1010111 + +#define VFWADD_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1100000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 110000...........001.....1010111 +#define VFWREDUSUM_VS(vd, vs2, vs1, vm) EMIT(R_type(0b1100010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 110001...........001.....1010111 +#define VFWSUB_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1100100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 110010...........001.....1010111 +#define VFWREDOSUM_VS(vd, vs2, vs1, vm) EMIT(R_type(0b1100110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 110011...........001.....1010111 +#define VFWADD_WV(vd, vs2, vs1, vm) EMIT(R_type(0b1101000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 110100...........001.....1010111 +#define VFWSUB_WV(vd, vs2, vs1, vm) EMIT(R_type(0b1101100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 110110...........001.....1010111 +#define VFWMUL_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1110000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 111000...........001.....1010111 +#define VFWMACC_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1111000 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 111100...........001.....1010111 +#define VFWNMACC_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1111010 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 111101...........001.....1010111 +#define VFWMSAC_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1111100 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 111110...........001.....1010111 +#define VFWNMSAC_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1111110 | (vm), vs2, vs1, 0b001, vd, 0b1010111)) // 111111...........001.....1010111 // OPIVX -#define VADD_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0000000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000000...........100.....1010111 -#define VSUB_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0000100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000010...........100.....1010111 -#define VRSUB_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0000110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000011...........100.....1010111 -#define VMINU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0001000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000100...........100.....1010111 -#define VMIN_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0001010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000101...........100.....1010111 -#define VMAXU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0001100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000110...........100.....1010111 -#define VMAX_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0001110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000111...........100.....1010111 -#define VAND_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0010010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 001001...........100.....1010111 -#define VOR_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0010100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 001010...........100.....1010111 -#define VXOR_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0010110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 001011...........100.....1010111 -#define VRGATHER_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0011000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 001100...........100.....1010111 -#define VSLIDEUP_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0011100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 001110...........100.....1010111 -#define VSLIDEDOWN_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0011110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 001111...........100.....1010111 - -#define VADC_VXM(vd, rs1, vs2) EMIT(R_type(0b0100000, vs2, rs1, 0b100, vd, 0b1010111)) // 0100000..........100.....1010111 -#define VMADC_VXM(vd, rs1, vs2) EMIT(R_type(0b0100010, vs2, rs1, 0b100, vd, 0b1010111)) // 0100010..........100.....1010111 -#define VMADC_VX(vd, rs1, vs2) EMIT(R_type(0b0100011, vs2, rs1, 0b100, vd, 0b1010111)) // 0100011..........100.....1010111 -#define VSBC_VXM(vd, rs1, vs2) EMIT(R_type(0b0100100, vs2, rs1, 0b100, vd, 0b1010111)) // 0100100..........100.....1010111 -#define VMSBC_VXM(vd, rs1, vs2) EMIT(R_type(0b0100110, vs2, rs1, 0b100, vd, 0b1010111)) // 0100110..........100.....1010111 -#define VMSBC_VX(vd, rs1, vs2) EMIT(R_type(0b0100111, vs2, rs1, 0b100, vd, 0b1010111)) // 0100111..........100.....1010111 -#define VMERGE_VXM(vd, rs1, vs2) EMIT(R_type(0b0101110, vs2, rs1, 0b100, vd, 0b1010111)) // 0101110..........100.....1010111 +#define VADD_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0000000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000000...........100.....1010111 +#define VSUB_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0000100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000010...........100.....1010111 +#define VRSUB_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0000110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000011...........100.....1010111 +#define VMINU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0001000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000100...........100.....1010111 +#define VMIN_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0001010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000101...........100.....1010111 +#define VMAXU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0001100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000110...........100.....1010111 +#define VMAX_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0001110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 000111...........100.....1010111 +#define VAND_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0010010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 001001...........100.....1010111 +#define VOR_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0010100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 001010...........100.....1010111 +#define VXOR_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0010110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 001011...........100.....1010111 +#define VRGATHER_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0011000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 001100...........100.....1010111 +#define VSLIDEUP_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0011100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 001110...........100.....1010111 +#define VSLIDEDOWN_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0011110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 001111...........100.....1010111 + +#define VADC_VXM(vd, vs2, rs1) EMIT(R_type((0b0100000 | cpuext.xtheadvector), vs2, rs1, 0b100, vd, 0b1010111)) // 0100000..........100.....1010111 +#define VMADC_VXM(vd, vs2, rs1) EMIT(R_type(0b0100010, vs2, rs1, 0b100, vd, 0b1010111)) // 0100010..........100.....1010111 +#define VMADC_VX(vd, vs2, rs1) EMIT(R_type(0b0100011, vs2, rs1, 0b100, vd, 0b1010111)) // 0100011..........100.....1010111 +#define VSBC_VXM(vd, vs2, rs1) EMIT(R_type((0b0100100 | cpuext.xtheadvector), vs2, rs1, 0b100, vd, 0b1010111)) // 0100100..........100.....1010111 +#define VMSBC_VXM(vd, vs2, rs1) EMIT(R_type(0b0100110, vs2, rs1, 0b100, vd, 0b1010111)) // 0100110..........100.....1010111 +#define VMSBC_VX(vd, vs2, rs1) EMIT(R_type(0b0100111, vs2, rs1, 0b100, vd, 0b1010111)) // 0100111..........100.....1010111 +#define VMERGE_VXM(vd, vs2, rs1) EMIT(R_type(0b0101110, vs2, rs1, 0b100, vd, 0b1010111)) // 0101110..........100.....1010111 #define VMV_V_X(vd, rs1) EMIT(I_type(0b010111100000, rs1, 0b100, vd, 0b1010111)) // 010111100000.....100.....1010111 -#define VMSEQ_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0110000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011000...........100.....1010111 -#define VMSNE_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0110010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011001...........100.....1010111 -#define VMSLTU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0110100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011010...........100.....1010111 -#define VMSLT_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0110110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011011...........100.....1010111 -#define VMSLEU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0111000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011100...........100.....1010111 -#define VMSLE_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0111010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011101...........100.....1010111 -#define VMSGTU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0111100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011110...........100.....1010111 -#define VMSGT_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0111110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011111...........100.....1010111 -#define VSADDU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1000000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 100000...........100.....1010111 -#define VSADD_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1000010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 100001...........100.....1010111 -#define VSSUBU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1000100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 100010...........100.....1010111 -#define VSSUB_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1000110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 100011...........100.....1010111 -#define VSLL_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1001010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 100101...........100.....1010111 -#define VSMUL_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1001110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 100111...........100.....1010111 -#define VSRL_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1010000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101000...........100.....1010111 -#define VSRA_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1010010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101001...........100.....1010111 -#define VSSRL_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1010100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101010...........100.....1010111 -#define VSSRA_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1010110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101011...........100.....1010111 -#define VNSRL_WX(vd, rs1, vs2, vm) EMIT(R_type(0b1011000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101100...........100.....1010111 -#define VNSRA_WX(vd, rs1, vs2, vm) EMIT(R_type(0b1011010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101101...........100.....1010111 -#define VNCLIPU_WX(vd, rs1, vs2, vm) EMIT(R_type(0b1011100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101110...........100.....1010111 -#define VNCLIP_WX(vd, rs1, vs2, vm) EMIT(R_type(0b1011110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101111...........100.....1010111 +#define VMSEQ_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0110000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011000...........100.....1010111 +#define VMSNE_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0110010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011001...........100.....1010111 +#define VMSLTU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0110100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011010...........100.....1010111 +#define VMSLT_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0110110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011011...........100.....1010111 +#define VMSLEU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0111000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011100...........100.....1010111 +#define VMSLE_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0111010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011101...........100.....1010111 +#define VMSGTU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0111100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011110...........100.....1010111 +#define VMSGT_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0111110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 011111...........100.....1010111 +#define VSADDU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1000000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 100000...........100.....1010111 +#define VSADD_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1000010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 100001...........100.....1010111 +#define VSSUBU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1000100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 100010...........100.....1010111 +#define VSSUB_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1000110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 100011...........100.....1010111 +#define VSLL_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1001010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 100101...........100.....1010111 +#define VSMUL_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1001110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 100111...........100.....1010111 +#define VSRL_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1010000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101000...........100.....1010111 +#define VSRA_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1010010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101001...........100.....1010111 +#define VSSRL_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1010100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101010...........100.....1010111 +#define VSSRA_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1010110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101011...........100.....1010111 +#define VNSRL_WX(vd, vs2, rs1, vm) EMIT(R_type(0b1011000 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101100...........100.....1010111 +#define VNSRA_WX(vd, vs2, rs1, vm) EMIT(R_type(0b1011010 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101101...........100.....1010111 +#define VNCLIPU_WX(vd, vs2, rs1, vm) EMIT(R_type(0b1011100 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101110...........100.....1010111 +#define VNCLIP_WX(vd, vs2, rs1, vm) EMIT(R_type(0b1011110 | (vm), vs2, rs1, 0b100, vd, 0b1010111)) // 101111...........100.....1010111 // OPIVV -#define VADD_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0000000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 000000...........000.....1010111 -#define VSUB_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0000100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 000010...........000.....1010111 -#define VMINU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0001000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 000100...........000.....1010111 -#define VMIN_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0001010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 000101...........000.....1010111 -#define VMAXU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0001100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 000110...........000.....1010111 -#define VMAX_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0001110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 000111...........000.....1010111 -#define VAND_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0010010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 001001...........000.....1010111 -#define VOR_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0010100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 001010...........000.....1010111 -#define VXOR_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0010110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 001011...........000.....1010111 -#define VRGATHER_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0011000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 001100...........000.....1010111 -#define VRGATHEREI16_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0011100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 001110...........000.....1010111 - -#define VADC_VVM(vd, vs1, vs2) EMIT(R_type(0b0100000, vs2, vs1, 0b000, vd, 0b1010111)) // 0100000..........000.....1010111 -#define VMADC_VVM(vd, vs1, vs2) EMIT(R_type(0b0100010, vs2, vs1, 0b000, vd, 0b1010111)) // 0100010..........000.....1010111 -#define VMADC_VV(vd, vs1, vs2) EMIT(R_type(0b0100011, vs2, vs1, 0b000, vd, 0b1010111)) // 0100011..........000.....1010111 -#define VSBC_VVM(vd, vs1, vs2) EMIT(R_type(0b0100100, vs2, vs1, 0b000, vd, 0b1010111)) // 0100100..........000.....1010111 -#define VMSBC_VVM(vd, vs1, vs2) EMIT(R_type(0b0100110, vs2, vs1, 0b000, vd, 0b1010111)) // 0100110..........000.....1010111 -#define VMSBC_VV(vd, vs1, vs2) EMIT(R_type(0b0100111, vs2, vs1, 0b000, vd, 0b1010111)) // 0100111..........000.....1010111 -#define VMERGE_VVM(vd, vs1, vs2) EMIT(R_type(0b0101110, vs2, vs1, 0b000, vd, 0b1010111)) // 0101110..........000.....1010111 +#define VADD_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0000000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 000000...........000.....1010111 +#define VSUB_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0000100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 000010...........000.....1010111 +#define VMINU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0001000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 000100...........000.....1010111 +#define VMIN_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0001010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 000101...........000.....1010111 +#define VMAXU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0001100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 000110...........000.....1010111 +#define VMAX_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0001110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 000111...........000.....1010111 +#define VAND_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0010010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 001001...........000.....1010111 +#define VOR_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0010100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 001010...........000.....1010111 +#define VXOR_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0010110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 001011...........000.....1010111 +#define VRGATHER_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0011000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 001100...........000.....1010111 +#define VRGATHEREI16_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0011100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 001110...........000.....1010111 + +#define VADC_VVM(vd, vs2, vs1) EMIT(R_type((0b0100000 | cpuext.xtheadvector), vs2, vs1, 0b000, vd, 0b1010111)) // 0100000..........000.....1010111 +#define VMADC_VVM(vd, vs2, vs1) EMIT(R_type(0b0100010, vs2, vs1, 0b000, vd, 0b1010111)) // 0100010..........000.....1010111 +#define VMADC_VV(vd, vs2, vs1) EMIT(R_type(0b0100011, vs2, vs1, 0b000, vd, 0b1010111)) // 0100011..........000.....1010111 +#define VSBC_VVM(vd, vs2, vs1) EMIT(R_type((0b0100100 | cpuext.xtheadvector), vs2, vs1, 0b000, vd, 0b1010111)) // 0100100..........000.....1010111 +#define VMSBC_VVM(vd, vs2, vs1) EMIT(R_type(0b0100110, vs2, vs1, 0b000, vd, 0b1010111)) // 0100110..........000.....1010111 +#define VMSBC_VV(vd, vs2, vs1) EMIT(R_type(0b0100111, vs2, vs1, 0b000, vd, 0b1010111)) // 0100111..........000.....1010111 +#define VMERGE_VVM(vd, vs2, vs1) EMIT(R_type(0b0101110, vs2, vs1, 0b000, vd, 0b1010111)) // 0101110..........000.....1010111 #define VMV_V_V(vd, vs1) EMIT(I_type(0b010111100000, vs1, 0b000, vd, 0b1010111)) // 010111100000.....000.....1010111 -#define VMSEQ_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0110000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 011000...........000.....1010111 -#define VMSNE_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0110010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 011001...........000.....1010111 -#define VMSLTU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0110100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 011010...........000.....1010111 -#define VMSLT_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0110110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 011011...........000.....1010111 -#define VMSLEU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0111000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 011100...........000.....1010111 -#define VMSLE_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0111010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 011101...........000.....1010111 -#define VSADDU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1000000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 100000...........000.....1010111 -#define VSADD_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1000010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 100001...........000.....1010111 -#define VSSUBU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1000100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 100010...........000.....1010111 -#define VSSUB_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1000110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 100011...........000.....1010111 -#define VSLL_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1001010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 100101...........000.....1010111 -#define VSMUL_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1001110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 100111...........000.....1010111 -#define VSRL_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1010000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101000...........000.....1010111 -#define VSRA_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1010010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101001...........000.....1010111 -#define VSSRL_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1010100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101010...........000.....1010111 -#define VSSRA_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1010110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101011...........000.....1010111 -#define VNSRL_WV(vd, vs1, vs2, vm) EMIT(R_type(0b1011000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101100...........000.....1010111 -#define VNSRA_WV(vd, vs1, vs2, vm) EMIT(R_type(0b1011010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101101...........000.....1010111 -#define VNCLIPU_WV(vd, vs1, vs2, vm) EMIT(R_type(0b1011100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101110...........000.....1010111 -#define VNCLIP_WV(vd, vs1, vs2, vm) EMIT(R_type(0b1011110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101111...........000.....1010111 -#define VWREDSUMU_VS(vd, vs1, vs2, vm) EMIT(R_type(0b1100000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 110000...........000.....1010111 -#define VWREDSUM_VS(vd, vs1, vs2, vm) EMIT(R_type(0b1100010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 110001...........000.....1010111 +#define VMSEQ_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0110000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 011000...........000.....1010111 +#define VMSNE_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0110010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 011001...........000.....1010111 +#define VMSLTU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0110100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 011010...........000.....1010111 +#define VMSLT_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0110110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 011011...........000.....1010111 +#define VMSLEU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0111000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 011100...........000.....1010111 +#define VMSLE_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0111010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 011101...........000.....1010111 +#define VSADDU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1000000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 100000...........000.....1010111 +#define VSADD_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1000010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 100001...........000.....1010111 +#define VSSUBU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1000100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 100010...........000.....1010111 +#define VSSUB_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1000110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 100011...........000.....1010111 +#define VSLL_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1001010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 100101...........000.....1010111 +#define VSMUL_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1001110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 100111...........000.....1010111 +#define VSRL_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1010000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101000...........000.....1010111 +#define VSRA_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1010010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101001...........000.....1010111 +#define VSSRL_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1010100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101010...........000.....1010111 +#define VSSRA_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1010110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101011...........000.....1010111 +#define VNSRL_WV(vd, vs2, vs1, vm) EMIT(R_type(0b1011000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101100...........000.....1010111 +#define VNSRA_WV(vd, vs2, vs1, vm) EMIT(R_type(0b1011010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101101...........000.....1010111 +#define VNCLIPU_WV(vd, vs2, vs1, vm) EMIT(R_type(0b1011100 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101110...........000.....1010111 +#define VNCLIP_WV(vd, vs2, vs1, vm) EMIT(R_type(0b1011110 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 101111...........000.....1010111 +#define VWREDSUMU_VS(vd, vs2, vs1, vm) EMIT(R_type(0b1100000 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 110000...........000.....1010111 +#define VWREDSUM_VS(vd, vs2, vs1, vm) EMIT(R_type(0b1100010 | (vm), vs2, vs1, 0b000, vd, 0b1010111)) // 110001...........000.....1010111 // OPIVI -#define VADD_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0000000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 000000...........011.....1010111 -#define VRSUB_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0000110 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 000011...........011.....1010111 -#define VAND_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0010010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 001001...........011.....1010111 -#define VOR_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0010100 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 001010...........011.....1010111 -#define VXOR_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0010110 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 001011...........011.....1010111 -#define VRGATHER_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0011000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 001100...........011.....1010111 -#define VSLIDEUP_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0011100 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 001110...........011.....1010111 -#define VSLIDEDOWN_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0011110 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 001111...........011.....1010111 - -#define VADC_VIM(vd, simm5, vs2) EMIT(R_type(0b0100000, vs2, simm5, 0b011, vd, 0b1010111)) // 0100000..........011.....1010111 -#define VMADC_VIM(vd, simm5, vs2) EMIT(R_type(0b0100010, vs2, simm5, 0b011, vd, 0b1010111)) // 0100010..........011.....1010111 -#define VMADC_VI(vd, simm5, vs2) EMIT(R_type(0b0100011, vs2, simm5, 0b011, vd, 0b1010111)) // 0100011..........011.....1010111 -#define VMERGE_VIM(vd, simm5, vs2) EMIT(R_type(0b0101110, vs2, simm5, 0b011, vd, 0b1010111)) // 0101110..........011.....1010111 +#define VADD_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0000000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 000000...........011.....1010111 +#define VRSUB_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0000110 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 000011...........011.....1010111 +#define VAND_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0010010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 001001...........011.....1010111 +#define VOR_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0010100 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 001010...........011.....1010111 +#define VXOR_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0010110 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 001011...........011.....1010111 +#define VRGATHER_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0011000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 001100...........011.....1010111 +#define VSLIDEUP_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0011100 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 001110...........011.....1010111 +#define VSLIDEDOWN_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0011110 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 001111...........011.....1010111 + +#define VADC_VIM(vd, vs2, simm5) EMIT(R_type((0b0100000 | cpuext.xtheadvector), vs2, simm5, 0b011, vd, 0b1010111)) // 0100000..........011.....1010111 +#define VMADC_VIM(vd, vs2, simm5) EMIT(R_type(0b0100010, vs2, simm5, 0b011, vd, 0b1010111)) // 0100010..........011.....1010111 +#define VMADC_VI(vd, vs2, simm5) EMIT(R_type(0b0100011, vs2, simm5, 0b011, vd, 0b1010111)) // 0100011..........011.....1010111 +#define VMERGE_VIM(vd, vs2, simm5) EMIT(R_type(0b0101110, vs2, simm5, 0b011, vd, 0b1010111)) // 0101110..........011.....1010111 #define VMV_V_I(vd, simm5) EMIT(I_type(0b010111100000, simm5, 0b011, vd, 0b1010111)) // 010111100000.....011.....1010111 -#define VMSEQ_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0110000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 011000...........011.....1010111 -#define VMSNE_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0110010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 011001...........011.....1010111 -#define VMSLEU_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0111000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 011100...........011.....1010111 -#define VMSLE_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0111010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 011101...........011.....1010111 -#define VMSGTU_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0111100 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 011110...........011.....1010111 -#define VMSGT_VI(vd, simm5, vs2, vm) EMIT(R_type(0b0111110 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 011111...........011.....1010111 - -#define VSADDU_VI(vd, simm5, vs2, vm) EMIT(R_type(0b1000000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 100000...........011.....1010111 -#define VSADD_VI(vd, simm5, vs2, vm) EMIT(R_type(0b1000010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 100001...........011.....1010111 -#define VSLL_VI(vd, simm5, vs2, vm) EMIT(R_type(0b1001010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 100101...........011.....1010111 -#define VSRL_VI(vd, simm5, vs2, vm) EMIT(R_type(0b1010000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101000...........011.....1010111 -#define VSRA_VI(vd, simm5, vs2, vm) EMIT(R_type(0b1010010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101001...........011.....1010111 -#define VSSRL_VI(vd, simm5, vs2, vm) EMIT(R_type(0b1010100 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101010...........011.....1010111 -#define VSSRA_VI(vd, simm5, vs2, vm) EMIT(R_type(0b1010110 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101011...........011.....1010111 -#define VNSRL_WI(vd, simm5, vs2, vm) EMIT(R_type(0b1011000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101100...........011.....1010111 -#define VNSRA_WI(vd, simm5, vs2, vm) EMIT(R_type(0b1011010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101101...........011.....1010111 -#define VNCLIPU_WI(vd, simm5, vs2, vm) EMIT(R_type(0b1011100 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101110...........011.....1010111 -#define VNCLIP_WI(vd, simm5, vs2, vm) EMIT(R_type(0b1011110 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101111...........011.....1010111 +#define VMSEQ_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0110000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 011000...........011.....1010111 +#define VMSNE_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0110010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 011001...........011.....1010111 +#define VMSLEU_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0111000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 011100...........011.....1010111 +#define VMSLE_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0111010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 011101...........011.....1010111 +#define VMSGTU_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0111100 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 011110...........011.....1010111 +#define VMSGT_VI(vd, vs2, simm5, vm) EMIT(R_type(0b0111110 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 011111...........011.....1010111 + +#define VSADDU_VI(vd, vs2, simm5, vm) EMIT(R_type(0b1000000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 100000...........011.....1010111 +#define VSADD_VI(vd, vs2, simm5, vm) EMIT(R_type(0b1000010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 100001...........011.....1010111 +#define VSLL_VI(vd, vs2, simm5, vm) EMIT(R_type(0b1001010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 100101...........011.....1010111 +#define VSRL_VI(vd, vs2, simm5, vm) EMIT(R_type(0b1010000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101000...........011.....1010111 +#define VSRA_VI(vd, vs2, simm5, vm) EMIT(R_type(0b1010010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101001...........011.....1010111 +#define VSSRL_VI(vd, vs2, simm5, vm) EMIT(R_type(0b1010100 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101010...........011.....1010111 +#define VSSRA_VI(vd, vs2, simm5, vm) EMIT(R_type(0b1010110 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101011...........011.....1010111 +#define VNSRL_WI(vd, vs2, simm5, vm) EMIT(R_type(0b1011000 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101100...........011.....1010111 +#define VNSRA_WI(vd, vs2, simm5, vm) EMIT(R_type(0b1011010 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101101...........011.....1010111 +#define VNCLIPU_WI(vd, vs2, simm5, vm) EMIT(R_type(0b1011100 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101110...........011.....1010111 +#define VNCLIP_WI(vd, vs2, simm5, vm) EMIT(R_type(0b1011110 | (vm), vs2, simm5, 0b011, vd, 0b1010111)) // 101111...........011.....1010111 #define VMV1R_V(vd, vs2) EMIT(R_type(0b1001111, vs2, 0b00000, 0b011, vd, 0b1010111)) // 1001111.....00000011.....1010111 #define VMV2R_V(vd, vs2) EMIT(R_type(0b1001111, vs2, 0b00001, 0b011, vd, 0b1010111)) // 1001111.....00001011.....1010111 @@ -1571,20 +1872,25 @@ f28–31 ft8–11 FP temporaries Caller #define VMV8R_V(vd, vs2) EMIT(R_type(0b1001111, vs2, 0b00111, 0b011, vd, 0b1010111)) // 1001111.....00111011.....1010111 // OPMVV -#define VREDSUM_VS(vd, vs1, vs2, vm) EMIT(R_type(0b0000000 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000000...........010.....1010111 -#define VREDAND_VS(vd, vs1, vs2, vm) EMIT(R_type(0b0000010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000001...........010.....1010111 -#define VREDOR_VS(vd, vs1, vs2, vm) EMIT(R_type(0b0000100 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000010...........010.....1010111 -#define VREDXOR_VS(vd, vs1, vs2, vm) EMIT(R_type(0b0000110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000011...........010.....1010111 -#define VREDMINU_VS(vd, vs1, vs2, vm) EMIT(R_type(0b0001000 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000100...........010.....1010111 -#define VREDMIN_VS(vd, vs1, vs2, vm) EMIT(R_type(0b0001010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000101...........010.....1010111 -#define VREDMAXU_VS(vd, vs1, vs2, vm) EMIT(R_type(0b0001100 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000110...........010.....1010111 -#define VREDMAX_VS(vd, vs1, vs2, vm) EMIT(R_type(0b0001110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000111...........010.....1010111 -#define VAADDU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0010000 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 001000...........010.....1010111 -#define VAADD_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0010010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 001001...........010.....1010111 -#define VASUBU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0010100 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 001010...........010.....1010111 -#define VASUB_VV(vd, vs1, vs2, vm) EMIT(R_type(0b0010110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 001011...........010.....1010111 - -#define VMV_X_S(rd, vs2) EMIT(R_type(0b0100001, vs2, 0b00000, 0b010, rd, 0b1010111)) // 0100001.....00000010.....1010111 +#define VREDSUM_VS(vd, vs2, vs1, vm) EMIT(R_type(0b0000000 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000000...........010.....1010111 +#define VREDAND_VS(vd, vs2, vs1, vm) EMIT(R_type(0b0000010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000001...........010.....1010111 +#define VREDOR_VS(vd, vs2, vs1, vm) EMIT(R_type(0b0000100 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000010...........010.....1010111 +#define VREDXOR_VS(vd, vs2, vs1, vm) EMIT(R_type(0b0000110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000011...........010.....1010111 +#define VREDMINU_VS(vd, vs2, vs1, vm) EMIT(R_type(0b0001000 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000100...........010.....1010111 +#define VREDMIN_VS(vd, vs2, vs1, vm) EMIT(R_type(0b0001010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000101...........010.....1010111 +#define VREDMAXU_VS(vd, vs2, vs1, vm) EMIT(R_type(0b0001100 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000110...........010.....1010111 +#define VREDMAX_VS(vd, vs2, vs1, vm) EMIT(R_type(0b0001110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 000111...........010.....1010111 +#define VAADD_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0010010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 001001...........010.....1010111 +#define VASUB_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0010110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 001011...........010.....1010111 +// Warning, no unsigned edition in Xtheadvector +#define VAADDU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0010000 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 001000...........010.....1010111 +#define VASUBU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b0010100 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 001010...........010.....1010111 + +// Warning: zero-extended on xtheadvector! +#define VMV_X_S(rd, vs2) EMIT(R_type((cpuext.xtheadvector ? 0b0011001 : 0b0100001), vs2, 0b00000, 0b010, rd, 0b1010111)) // 0100001.....00000010.....1010111 + +// Warning: xtheadvector only +#define VEXT_X_V(rd, vs2, rs1) EMIT(R_type((cpuext.xtheadvector ? 0b0011001 : 0b0100001), vs2, rs1, 0b010, rd, 0b1010111)) // Vector Integer Extension Instructions // https://github.com/riscv/riscv-v-spec/blob/e49574c92b072fd4d71e6cb20f7e8154de5b83fe/v-spec.adoc#123-vector-integer-extension @@ -1596,88 +1902,89 @@ f28–31 ft8–11 FP temporaries Caller #define VZEXT_VF2(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b00110, 0b010, vd, 0b1010111)) // 010010......00110010.....1010111 #define VSEXT_VF2(vd, vs2, vm) EMIT(R_type(0b0100100 | (vm), vs2, 0b00111, 0b010, vd, 0b1010111)) // 010010......00111010.....1010111 -#define VCOMPRESS_VM(vd, vs1, vs2) EMIT(R_type(0b0101111, vs2, vs1, 0b010, vd, 0b1010111)) // 0101111..........010.....1010111 -#define VMANDN_MM(vd, vs1, vs2) EMIT(R_type(0b0110001, vs2, vs1, 0b010, vd, 0b1010111)) // 0110001..........010.....1010111 -#define VMAND_MM(vd, vs1, vs2) EMIT(R_type(0b0110011, vs2, vs1, 0b010, vd, 0b1010111)) // 0110011..........010.....1010111 -#define VMOR_MM(vd, vs1, vs2) EMIT(R_type(0b0110101, vs2, vs1, 0b010, vd, 0b1010111)) // 0110101..........010.....1010111 -#define VMXOR_MM(vd, vs1, vs2) EMIT(R_type(0b0110111, vs2, vs1, 0b010, vd, 0b1010111)) // 0110111..........010.....1010111 -#define VMORN_MM(vd, vs1, vs2) EMIT(R_type(0b0111001, vs2, vs1, 0b010, vd, 0b1010111)) // 0111001..........010.....1010111 -#define VMNAND_MM(vd, vs1, vs2) EMIT(R_type(0b0111011, vs2, vs1, 0b010, vd, 0b1010111)) // 0111011..........010.....1010111 -#define VMNOR_MM(vd, vs1, vs2) EMIT(R_type(0b0111101, vs2, vs1, 0b010, vd, 0b1010111)) // 0111101..........010.....1010111 -#define VMXNOR_MM(vd, vs1, vs2) EMIT(R_type(0b0111111, vs2, vs1, 0b010, vd, 0b1010111)) // 0111111..........010.....1010111 - -#define VMSBF_M(vd, vs2, vm) EMIT(R_type(0b0101000 | (vm), vs2, 0b00001, 0b010, vd, 0b1010111)) // 010100......00001010.....1010111 -#define VMSOF_M(vd, vs2, vm) EMIT(R_type(0b0101000 | (vm), vs2, 0b00010, 0b010, vd, 0b1010111)) // 010100......00010010.....1010111 -#define VMSIF_M(vd, vs2, vm) EMIT(R_type(0b0101000 | (vm), vs2, 0b00011, 0b010, vd, 0b1010111)) // 010100......00011010.....1010111 -#define VIOTA_M(vd, vs2, vm) EMIT(R_type(0b0101000 | (vm), vs2, 0b10000, 0b010, vd, 0b1010111)) // 010100......10000010.....1010111 -#define VCPOP_M(rd, vs2, vm) EMIT(R_type(0b0100000 | (vm), vs2, 0b10000, 0b010, rd, 0b1010111)) // 010000......10000010.....1010111 -#define VFIRST_M(rd, vs2, vm) EMIT(R_type(0b0100000 | (vm), vs2, 0b10001, 0b010, rd, 0b1010111)) // 010000......10001010.....1010111 - -#define VID_V(vd, vm) EMIT(R_type(0b0101000 | (vm), 0b00000, 0b10001, 0b010, vd, 0b1010111)) // 010100.0000010001010.....1010111 - -#define VDIVU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1000000 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 100000...........010.....1010111 -#define VDIV_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1000010 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 100001...........010.....1010111 -#define VREMU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1000100 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 100010...........010.....1010111 -#define VREM_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1000110 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 100011...........010.....1010111 -#define VMULHU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1001000 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 100100...........010.....1010111 -#define VMUL_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1001010 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 100101...........010.....1010111 -#define VMULHSU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1001100 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 100110...........010.....1010111 -#define VMULH_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1001110 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 100111...........010.....1010111 -#define VMADD_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1010010 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 101001...........010.....1010111 -#define VNMSUB_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1010110 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 101011...........010.....1010111 -#define VMACC_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1011010 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 101101...........010.....1010111 -#define VNMSAC_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1011110 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 101111...........010.....1010111 -#define VWADDU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1100000 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 110000...........010.....1010111 -#define VWADD_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1100010 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 110001...........010.....1010111 -#define VWSUBU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1100100 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 110010...........010.....1010111 -#define VWSUB_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1100110 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 110011...........010.....1010111 -#define VWADDU_WV(vd, vs1, vs2, vm) EMIT(R_type(0b1101000 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 110100...........010.....1010111 -#define VWADD_WV(vd, vs1, vs2, vm) EMIT(R_type(0b1101010 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 110101...........010.....1010111 -#define VWSUBU_WV(vd, vs1, vs2, vm) EMIT(R_type(0b1101100 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 110110...........010.....1010111 -#define VWSUB_WV(vd, vs1, vs2, vm) EMIT(R_type(0b1101110 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 110111...........010.....1010111 -#define VWMULU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1110000 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 111000...........010.....1010111 -#define VWMULSU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1110100 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 111010...........010.....1010111 -#define VWMUL_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1110110 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 111011...........010.....1010111 -#define VWMACCU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1111000 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 111100...........010.....1010111 -#define VWMACC_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1111010 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 111101...........010.....1010111 -#define VWMACCSU_VV(vd, vs1, vs2, vm) EMIT(R_type(0b1111110 | (vm), vs2, vs1, 010, vd, 0b1010111)) // 111111...........010.....1010111 +#define VCOMPRESS_VM(vd, vs2, vs1) EMIT(R_type(0b0101111, vs2, vs1, 0b010, vd, 0b1010111)) // 0101111..........010.....1010111 +#define VMANDN_MM(vd, vs2, vs1) EMIT(R_type(0b0110001, vs2, vs1, 0b010, vd, 0b1010111)) // 0110001..........010.....1010111 +#define VMAND_MM(vd, vs2, vs1) EMIT(R_type(0b0110011, vs2, vs1, 0b010, vd, 0b1010111)) // 0110011..........010.....1010111 +#define VMOR_MM(vd, vs2, vs1) EMIT(R_type(0b0110101, vs2, vs1, 0b010, vd, 0b1010111)) // 0110101..........010.....1010111 +#define VMXOR_MM(vd, vs2, vs1) EMIT(R_type(0b0110111, vs2, vs1, 0b010, vd, 0b1010111)) // 0110111..........010.....1010111 +#define VMORN_MM(vd, vs2, vs1) EMIT(R_type(0b0111001, vs2, vs1, 0b010, vd, 0b1010111)) // 0111001..........010.....1010111 +#define VMNAND_MM(vd, vs2, vs1) EMIT(R_type(0b0111011, vs2, vs1, 0b010, vd, 0b1010111)) // 0111011..........010.....1010111 +#define VMNOR_MM(vd, vs2, vs1) EMIT(R_type(0b0111101, vs2, vs1, 0b010, vd, 0b1010111)) // 0111101..........010.....1010111 +#define VMXNOR_MM(vd, vs2, vs1) EMIT(R_type(0b0111111, vs2, vs1, 0b010, vd, 0b1010111)) // 0111111..........010.....1010111 + +#define VMSBF_M(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b0101100 : 0b0101000) | (vm), vs2, 0b00001, 0b010, vd, 0b1010111)) // 010100......00001010.....1010111 +#define VMSOF_M(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b0101100 : 0b0101000) | (vm), vs2, 0b00010, 0b010, vd, 0b1010111)) // 010100......00010010.....1010111 +#define VMSIF_M(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b0101100 : 0b0101000) | (vm), vs2, 0b00011, 0b010, vd, 0b1010111)) // 010100......00011010.....1010111 +#define VIOTA_M(vd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b0101100 : 0b0101000) | (vm), vs2, 0b10000, 0b010, vd, 0b1010111)) // 010100......10000010.....1010111 +#define VCPOP_M(rd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b0101100 : 0b0100000) | (vm), vs2, 0b10000, 0b010, rd, 0b1010111)) // 010000......10000010.....1010111 +#define VFIRST_M(rd, vs2, vm) EMIT(R_type((cpuext.xtheadvector ? 0b0101100 : 0b0100000) | (vm), vs2, 0b10001, 0b010, rd, 0b1010111)) // 010000......10001010.....1010111 + +#define VID_V(vd, vm) EMIT(R_type((cpuext.xtheadvector ? 0b0101100 : 0b0101000) | (vm), 0b00000, 0b10001, 0b010, vd, 0b1010111)) // 010100.0000010001010.....1010111 + +#define VDIVU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1000000 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 100000...........010.....1010111 +#define VDIV_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1000010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 100001...........010.....1010111 +#define VREMU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1000100 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 100010...........010.....1010111 +#define VREM_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1000110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 100011...........010.....1010111 +#define VMULHU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1001000 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 100100...........010.....1010111 +#define VMUL_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1001010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 100101...........010.....1010111 +#define VMULHSU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1001100 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 100110...........010.....1010111 +#define VMULH_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1001110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 100111...........010.....1010111 +#define VMADD_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1010010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 101001...........010.....1010111 +#define VNMSUB_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1010110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 101011...........010.....1010111 +#define VMACC_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1011010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 101101...........010.....1010111 +#define VNMSAC_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1011110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 101111...........010.....1010111 +#define VWADDU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1100000 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 110000...........010.....1010111 +#define VWADD_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1100010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 110001...........010.....1010111 +#define VWSUBU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1100100 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 110010...........010.....1010111 +#define VWSUB_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1100110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 110011...........010.....1010111 +#define VWADDU_WV(vd, vs2, vs1, vm) EMIT(R_type(0b1101000 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 110100...........010.....1010111 +#define VWADD_WV(vd, vs2, vs1, vm) EMIT(R_type(0b1101010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 110101...........010.....1010111 +#define VWSUBU_WV(vd, vs2, vs1, vm) EMIT(R_type(0b1101100 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 110110...........010.....1010111 +#define VWSUB_WV(vd, vs2, vs1, vm) EMIT(R_type(0b1101110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 110111...........010.....1010111 +#define VWMULU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1110000 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 111000...........010.....1010111 +#define VWMULSU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1110100 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 111010...........010.....1010111 +#define VWMUL_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1110110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 111011...........010.....1010111 +#define VWMACCU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1111000 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 111100...........010.....1010111 +#define VWMACC_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1111010 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 111101...........010.....1010111 +#define VWMACCSU_VV(vd, vs2, vs1, vm) EMIT(R_type(0b1111110 | (vm), vs2, vs1, 0b010, vd, 0b1010111)) // 111111...........010.....1010111 // OPMVX -#define VAADDU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0010000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 001000...........110.....1010111 -#define VAADD_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0010010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 001001...........110.....1010111 -#define VASUBU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0010100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 001010...........110.....1010111 -#define VASUB_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0010110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 001011...........110.....1010111 -#define VSLIDE1UP_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0011100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 001110...........110.....1010111 -#define VSLIDE1DOWN_VX(vd, rs1, vs2, vm) EMIT(R_type(0b0011110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 001111...........110.....1010111 - -#define VMV_S_X(vd, rs1) EMIT(I_type(0b010000100000, rs1, 0b110, vd, 0b1010111)) // 010000100000.....110.....1010111 - -#define VDIVU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1000000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100000...........110.....1010111 -#define VDIV_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1000010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100001...........110.....1010111 -#define VREMU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1000100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100010...........110.....1010111 -#define VREM_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1000110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100011...........110.....1010111 -#define VMULHU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1001000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100100...........110.....1010111 -#define VMUL_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1001010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100101...........110.....1010111 -#define VMULHSU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1001100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100110...........110.....1010111 -#define VMULH_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1001110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100111...........110.....1010111 -#define VMADD_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1010010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 101001...........110.....1010111 -#define VNMSUB_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1010110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 101011...........110.....1010111 -#define VMACC_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1011010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 101101...........110.....1010111 -#define VNMSAC_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1011110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 101111...........110.....1010111 -#define VWADDU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1100000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110000...........110.....1010111 -#define VWADD_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1100010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110001...........110.....1010111 -#define VWSUBU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1100100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110010...........110.....1010111 -#define VWSUB_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1100110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110011...........110.....1010111 -#define VWADDU_WX(vd, rs1, vs2, vm) EMIT(R_type(0b1101000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110100...........110.....1010111 -#define VWADD_WX(vd, rs1, vs2, vm) EMIT(R_type(0b1101010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110101...........110.....1010111 -#define VWSUBU_WX(vd, rs1, vs2, vm) EMIT(R_type(0b1101100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110110...........110.....1010111 -#define VWSUB_WX(vd, rs1, vs2, vm) EMIT(R_type(0b1101110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110111...........110.....1010111 -#define VWMULU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1110000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111000...........110.....1010111 -#define VWMULSU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1110100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111010...........110.....1010111 -#define VWMUL_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1110110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111011...........110.....1010111 -#define VWMACCU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1111000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111100...........110.....1010111 -#define VWMACC_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1111010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111101...........110.....1010111 -#define VWMACCUS_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1111100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111110...........110.....1010111 -#define VWMACCSU_VX(vd, rs1, vs2, vm) EMIT(R_type(0b1111110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111111...........110.....1010111 +#define VAADDU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0010000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 001000...........110.....1010111 +#define VAADD_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0010010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 001001...........110.....1010111 +#define VASUBU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0010100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 001010...........110.....1010111 +#define VASUB_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0010110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 001011...........110.....1010111 +#define VSLIDE1UP_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0011100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 001110...........110.....1010111 +#define VSLIDE1DOWN_VX(vd, vs2, rs1, vm) EMIT(R_type(0b0011110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 001111...........110.....1010111 + +// Warning, upper elements will be cleared in xtheadvector! +#define VMV_S_X(vd, rs1) EMIT(I_type((cpuext.xtheadvector ? 0b001101100000 : 0b010000100000), rs1, 0b110, vd, 0b1010111)) + +#define VDIVU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1000000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100000...........110.....1010111 +#define VDIV_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1000010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100001...........110.....1010111 +#define VREMU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1000100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100010...........110.....1010111 +#define VREM_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1000110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100011...........110.....1010111 +#define VMULHU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1001000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100100...........110.....1010111 +#define VMUL_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1001010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100101...........110.....1010111 +#define VMULHSU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1001100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100110...........110.....1010111 +#define VMULH_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1001110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 100111...........110.....1010111 +#define VMADD_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1010010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 101001...........110.....1010111 +#define VNMSUB_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1010110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 101011...........110.....1010111 +#define VMACC_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1011010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 101101...........110.....1010111 +#define VNMSAC_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1011110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 101111...........110.....1010111 +#define VWADDU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1100000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110000...........110.....1010111 +#define VWADD_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1100010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110001...........110.....1010111 +#define VWSUBU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1100100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110010...........110.....1010111 +#define VWSUB_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1100110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110011...........110.....1010111 +#define VWADDU_WX(vd, vs2, rs1, vm) EMIT(R_type(0b1101000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110100...........110.....1010111 +#define VWADD_WX(vd, vs2, rs1, vm) EMIT(R_type(0b1101010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110101...........110.....1010111 +#define VWSUBU_WX(vd, vs2, rs1, vm) EMIT(R_type(0b1101100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110110...........110.....1010111 +#define VWSUB_WX(vd, vs2, rs1, vm) EMIT(R_type(0b1101110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 110111...........110.....1010111 +#define VWMULU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1110000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111000...........110.....1010111 +#define VWMULSU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1110100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111010...........110.....1010111 +#define VWMUL_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1110110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111011...........110.....1010111 +#define VWMACCU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1111000 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111100...........110.....1010111 +#define VWMACC_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1111010 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111101...........110.....1010111 +#define VWMACCUS_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1111100 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111110...........110.....1010111 +#define VWMACCSU_VX(vd, vs2, rs1, vm) EMIT(R_type(0b1111110 | (vm), vs2, rs1, 0b110, vd, 0b1010111)) // 111111...........110.....1010111 #endif //__RV64_EMITTER_H__ diff --git a/src/dynarec/rv64/rv64_epilog.S b/src/dynarec/rv64/rv64_epilog.S index 1f81911..3cd4ba6 100644 --- a/src/dynarec/rv64/rv64_epilog.S +++ b/src/dynarec/rv64/rv64_epilog.S @@ -1,7 +1,6 @@ -//riscv epilog for dynarec -//Save stuff, prepare stack and register -//called with pointer to emu as 1st parameter -//and address to jump to as 2nd parameter +#define ASM_MAPPING 1 +#include "rv64_mapping.h" +#undef ASM_MAPPING .text .align 4 @@ -9,60 +8,71 @@ .global rv64_epilog .global rv64_epilog_fast +// rv64_epilog(void) rv64_epilog: - //update register -> emu - sd x16, (a0) - sd x17, 8(a0) - sd x18, 16(a0) - sd x19, 24(a0) - sd x20, 32(a0) - sd x21, 40(a0) - sd x22, 48(a0) - sd x23, 56(a0) - sd x24, 64(a0) - sd x25, 72(a0) - sd x26, 80(a0) - sd x27, 88(a0) - sd x28, 96(a0) - sd x29, 104(a0) - sd x30, 112(a0) - sd x31, 120(a0) + // adjust flags bit 5 -> bit 11 - li x5, ~(1<<11) - and x8, x8, x5 - andi x5, x8, 1<<5 - slli x5, x5, 11-5 - or x8, x8, x5 - sd x8, 128(a0) //xFlags - sd x7, 136(a0) // put back reg value in emu, including EIP (so x7 must be EIP now) + lui t3, 0xfffff + addiw t3, t3, 0x7df + and t3, Flags, t3 + andi Flags, Flags, 1<<5 + slli Flags, Flags, 11-5 + or Flags, Flags, t3 + + // spill x86 registers to emu + sd RAX, 0(Emu) + sd RCX, 8(Emu) + sd RDX, 16(Emu) + sd RBX, 24(Emu) + sd RSP, 32(Emu) + sd RBP, 40(Emu) + sd RSI, 48(Emu) + sd RDI, 56(Emu) + sd R8, 64(Emu) + sd R9, 72(Emu) + sd R10, 80(Emu) + sd R11, 88(Emu) + sd R12, 96(Emu) + sd R13, 104(Emu) + sd R14, 112(Emu) + sd R15, 120(Emu) + sd Flags, 128(Emu) + sd RIP, 136(Emu) + + /*** switch to native register naming convection ***/ + // fallback to epilog_fast now, just restoring saved regs rv64_epilog_fast: - ld sp, 808(a0) // restore saved sp from emu->xSPSave, see rv64_prolog - ld x9, -8(sp) - sd x9, 808(a0) // put back old value - ld ra, (sp) // save ra - ld x8, 8(sp) // save fp - ld x18, (2*8)(sp) - ld x19, (3*8)(sp) - ld x20, (4*8)(sp) - ld x21, (5*8)(sp) - ld x22, (6*8)(sp) - ld x23, (7*8)(sp) - ld x24, (8*8)(sp) - ld x25, (9*8)(sp) - ld x26, (10*8)(sp) - ld x27, (11*8)(sp) - ld x9, (12*8)(sp) - fld f18, (13*8)(sp) - fld f19, (14*8)(sp) - fld f20, (15*8)(sp) - fld f21, (16*8)(sp) - fld f22, (17*8)(sp) - fld f23, (19*8)(sp) - fld f24, (19*8)(sp) - fld f25, (20*8)(sp) - fld f26, (21*8)(sp) - fld f27, (22*8)(sp) + // restore saved sp from emu->xSPSave + ld sp, 808(Emu) + ld t3, -8(sp) + // put back old value + sd t3, 808(Emu) + + ld ra, (0*8)(sp) + ld fp, (1*8)(sp) + ld s1, (2*8)(sp) + ld s2, (3*8)(sp) + ld s3, (4*8)(sp) + ld s4, (5*8)(sp) + ld s5, (6*8)(sp) + ld s6, (7*8)(sp) + ld s7, (8*8)(sp) + ld s8, (9*8)(sp) + ld s9, (10*8)(sp) + ld s10, (11*8)(sp) + ld s11, (12*8)(sp) + fld fs2, (13*8)(sp) + fld fs3, (14*8)(sp) + fld fs4, (15*8)(sp) + fld fs5, (16*8)(sp) + fld fs6, (17*8)(sp) + fld fs7, (19*8)(sp) + fld fs8, (19*8)(sp) + fld fs9, (20*8)(sp) + fld fs10, (21*8)(sp) + fld fs11, (22*8)(sp) + + // 16 bytes aligned addi sp, sp, (8 * 24) - //end, return... ret diff --git a/src/dynarec/rv64/rv64_lock.S b/src/dynarec/rv64/rv64_lock.S index a525c99..999561f 100644 --- a/src/dynarec/rv64/rv64_lock.S +++ b/src/dynarec/rv64/rv64_lock.S @@ -10,6 +10,7 @@ .global rv64_lock_storeifnull .global rv64_lock_storeifnull_d .global rv64_lock_storeifref +.global rv64_lock_storeifref2 .global rv64_lock_storeifref_d .global rv64_lock_storeifref2_d .global rv64_lock_decifnot0b @@ -20,7 +21,6 @@ .global rv64_lock_store_dd .global rv64_lock_cas_d .global rv64_lock_cas_dd -.global rv64_lock_cas_dq .global rv64_lock_get_b .global rv64_lock_get_d .global rv64_lock_get_dd @@ -101,6 +101,18 @@ rv64_lock_storeifref2_d: mv a0, a3 ret +rv64_lock_storeifref2: + // address is a0, value is a1, a1 store to a0 only if [a0] is a2. return old [a0] value + fence rw, rw +1: + lr.d a3, (a0) + bne a2, a3, 2f + sc.d a4, a1, (a0) + bnez a4, 1b +2: + mv a0, a3 + ret + rv64_lock_decifnot0b: fence rw, rw andi a3, a0, 3 diff --git a/src/dynarec/rv64/rv64_lock.h b/src/dynarec/rv64/rv64_lock.h index 235ad46..c6857b9 100644 --- a/src/dynarec/rv64/rv64_lock.h +++ b/src/dynarec/rv64/rv64_lock.h @@ -15,40 +15,40 @@ extern uintptr_t rv64_lock_xchg_dd(void* p, uintptr_t val); extern uint32_t rv64_lock_xchg_d(void* p, uint32_t val); // Atomically store value to [p] only if [p] is NULL. Return old [p] value -extern uint32_t rv64_lock_storeifnull_d(void*p, uint32_t val); +extern uint32_t rv64_lock_storeifnull_d(void* p, uint32_t val); // Atomically store value to [p] only if [p] is NULL. Return old [p] value -extern void* rv64_lock_storeifnull(void*p, void* val); +extern void* rv64_lock_storeifnull(void* p, void* val); // Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old) -extern void* rv64_lock_storeifref(void*p, void* val, void* ref); +extern void* rv64_lock_storeifref(void* p, void* val, void* ref); + +// Atomically store value to [p] only if [p] is ref. Return old [p] value (so ref or old) +extern void* rv64_lock_storeifref2(void* p, void* val, void* ref); // Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old) -extern uint32_t rv64_lock_storeifref_d(void*p, uint32_t val, uint32_t ref); +extern uint32_t rv64_lock_storeifref_d(void* p, uint32_t val, uint32_t ref); // Atomically store value to [p] only if [p] is ref. Return new [p] value (so val or old) -extern uint32_t rv64_lock_storeifref2_d(void*p, uint32_t val, uint32_t ref); +extern uint32_t rv64_lock_storeifref2_d(void* p, uint32_t val, uint32_t ref); // decrement atomically the byte at [p] (but only if p not 0) -extern void rv64_lock_decifnot0b(void*p); +extern void rv64_lock_decifnot0b(void* p); // atomic store (with memory barrier) -extern void rv64_lock_storeb(void*p, uint8_t b); +extern void rv64_lock_storeb(void* p, uint8_t b); // increment atomically the int at [p] only if it was 0. Return the old value of [p] -extern int rv64_lock_incif0(void*p); +extern int rv64_lock_incif0(void* p); // decrement atomically the int at [p] (but only if p not 0) -extern int rv64_lock_decifnot0(void*p); +extern int rv64_lock_decifnot0(void* p); // atomic store (with memory barrier) -extern void rv64_lock_store(void*p, uint32_t v); +extern void rv64_lock_store(void* p, uint32_t v); // atomic store (with memory barrier) -extern void rv64_lock_store_dd(void*p, uint64_t v); - -// (mostly) Atomically store val1 and val2 at [p] if old [p] is ref. Return 0 if OK, 1 is not. p needs to be aligned -extern int rv64_lock_cas_dq(void* p, uint64_t ref, uint64_t val1, uint64_t val2); +extern void rv64_lock_store_dd(void* p, uint64_t v); // atomic get (with memory barrier) extern uint32_t rv64_lock_get_b(void* p); @@ -64,4 +64,4 @@ uint8_t rv64_lock_xchg_b(void* addr, uint8_t v); extern int rv64_lock_cas_b(void* p, uint8_t ref, uint8_t val); extern int rv64_lock_cas_h(void* p, uint16_t ref, uint16_t val); -#endif //__RV64_LOCK__H__ +#endif //__RV64_LOCK__H__ diff --git a/src/dynarec/rv64/rv64_mapping.h b/src/dynarec/rv64/rv64_mapping.h new file mode 100644 index 0000000..ac7ec91 --- /dev/null +++ b/src/dynarec/rv64/rv64_mapping.h @@ -0,0 +1,119 @@ +#ifndef __RV64_MAPPING_H__ +#define __RV64_MAPPING_H__ + +// RV64 Register Mapping Scheme +/***************************************************************************************** +reg name mapping native description Box64 description saver +****************************************************************************************** +x0 zero native zero Hard-wired zero N/A — +x1 ra native ra Return address N/A Caller +x2 sp native sp Stack pointer N/A Callee +x3 gp native gp Global pointer N/A — +x4 tp native tp Thread pointer N/A — +x5 t0 - Temporary X87 Precision Control Caller +x6 t1 x1 Temporary Scratch Caller +x7 t2 x2 Temporary Scratch Caller +x8 s0/fp RBP Saved register/frame pointer - Callee +x9 s1 RSP Saved register - Callee +x10 a0 RDI Function argument/return val. - Caller +x11 a1 RSI Function argument/return val. - Caller +x12 a2 RDX Function argument - Caller +x13 a3 RCX Function argument - Caller +x14 a4 R8 Function argument - Caller +x15 a5 R9 Function argument - Caller +x16 a6 RAX Function argument - Caller +x17 a7 x7 Function argument Scratch Caller +x18 s2 R12 Saved register - Callee +x19 s3 R13 Saved register - Callee +x20 s4 R14 Saved register - Callee +x21 s5 R15 Saved register - Callee +x22 s6 RIP Saved register - Callee +x23 s7 FLAGS Saved register - Callee +x24 s8 RBX Saved register - Callee +x25 s9 xEmu Saved register The Emu struct Callee +x26 s10 R10 Saved register - Callee +x27 s11 R11 Saved register - Callee +x28 t3 x3 Temporary Scratch Caller +x29 t4 x4 Temporary Scratch Caller +x30 t5 x5 Temporary Scratch Caller +x31 t6 x6 Temporary Scratch Caller +******************************************************************************************/ + +#ifndef ASM_MAPPING + +#include + +// x86 Register mapping +#define xRAX 16 +#define xRCX 13 +#define xRDX 12 +#define xRBX 24 +#define xRSP 9 +#define xRBP 8 +#define xRSI 11 +#define xRDI 10 +#define xR8 14 +#define xR9 15 +#define xR10 26 +#define xR11 27 +#define xR12 18 +#define xR13 19 +#define xR14 20 +#define xR15 21 +#define xRIP 22 +#define xFlags 23 + +// convert a x86 register to native according to the register mapping +#define TO_NAT(A) (((uint8_t[]) { 16, 13, 12, 24, 9, 8, 11, 10, 14, 15, 26, 27, 18, 19, 20, 21 })[(A)]) +#define IS_GPR(A) (((uint8_t[]) { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0 })[(A)]) + +#define x1 6 +#define x2 7 +#define x3 28 +#define x4 29 +#define x5 30 +#define x6 31 +#define xEmu 25 + +#define x7 17 +#define x87pc 5 + +#define xRA 1 +#define xSP 2 +#define A0 10 +#define A1 11 +#define A2 12 +#define A3 13 +#define A4 14 +#define A5 15 +#define A6 16 +#define A7 17 + +#define xZR 0 + +#else + +// x86 Register mapping +#define RAX x16 +#define RCX x13 +#define RDX x12 +#define RBX x24 +#define RSP x9 +#define RBP x8 +#define RSI x11 +#define RDI x10 +#define R8 x14 +#define R9 x15 +#define R10 x26 +#define R11 x27 +#define R12 x18 +#define R13 x19 +#define R14 x20 +#define R15 x21 +#define RIP x22 +#define Flags x23 +#define Emu x25 + +#endif + +#endif // __RV64_MAPPING_H__ diff --git a/src/dynarec/rv64/rv64_next.S b/src/dynarec/rv64/rv64_next.S index ce34bb7..5d4daa0 100644 --- a/src/dynarec/rv64/rv64_next.S +++ b/src/dynarec/rv64/rv64_next.S @@ -1,7 +1,6 @@ -//riscv update linker table for dynarec -//called with pointer to emu as 1st parameter -//and address of table to as 2nd parameter -//ip is at r12 +#define ASM_MAPPING 1 +#include "rv64_mapping.h" +#undef ASM_MAPPING .text .align 4 @@ -10,42 +9,52 @@ .global rv64_next - .8byte 0 // NULL pointer before rv64_next, for getDB + // NULL pointer before rv64_next, for getDB + .8byte 0 + +// rv64(void) rv64_next: - // emu is a0 - // IP address is a1 + + // 16 bytes aligned addi sp, sp, -(8 * 10) - sd a0, (sp) - sd a1, 8(sp) - sd x5, 16(sp) - sd x7, 24(sp) - sd x16, 32(sp) - sd x17, 40(sp) - sd x28, 48(sp) - sd x29, 56(sp) - sd x30, 64(sp) - sd x31, 72(sp) - - mv a2, ra // "from" is in ra, so put in a2 - addi a3, sp, 24 // a3 is address to change rip + + // push regs we care that might be destoryed + sd RDI, (0*8)(sp) + sd RSI, (1*8)(sp) + sd RDX, (2*8)(sp) + sd RCX, (3*8)(sp) + sd R8, (4*8)(sp) + sd R9, (5*8)(sp) + sd RAX, (6*8)(sp) + sd RIP, (8*8)(sp) + + mv a0, Emu + mv a1, RIP +#ifdef HAVE_TRACE + mv a2, ra // "from" is in ra, so put in a2 +#endif + addi a3, sp, 8*8 // a3 is address to change rip + // call the function 1: - auipc a4, %pcrel_hi(LinkNext) - jalr a4, %pcrel_lo(1b) - // preserve return value - mv a3, a0 + auipc t4, %pcrel_hi(LinkNext) + jalr t4, %pcrel_lo(1b) + + // reserve return value + mv t3, a0 + // pop regs - ld a0, (sp) - ld a1, 8(sp) - ld x5, 16(sp) - ld x7, 24(sp) - ld x16, 32(sp) - ld x17, 40(sp) - ld x28, 48(sp) - ld x29, 56(sp) - ld x30, 64(sp) - ld x31, 72(sp) + ld RDI, (0*8)(sp) + ld RSI, (1*8)(sp) + ld RDX, (2*8)(sp) + ld RCX, (3*8)(sp) + ld R8, (4*8)(sp) + ld R9, (5*8)(sp) + ld RAX, (6*8)(sp) + ld RIP, (8*8)(sp) + addi sp, sp, (8 * 10) + // return offset is jump address - jr a3 + jr t3 diff --git a/src/dynarec/rv64/rv64_printer.c b/src/dynarec/rv64/rv64_printer.c index 54f1ad5..2716f51 100644 --- a/src/dynarec/rv64/rv64_printer.c +++ b/src/dynarec/rv64/rv64_printer.c @@ -7,1783 +7,6758 @@ #include "rv64_printer.h" #include "debug.h" +static const char gpr[32][9] = { + "zero", + "ra", + "sp", + "gp", + "tp", + "t0", + "t1", + "t2", + "rbp_s0", + "rsp_s1", + "rdi_a0", + "rsi_a1", + "rdx_a2", + "rcx_a3", + "r8_a4", + "r9_a5", + "rax_a6", + "x7_a7", + "r12_s2", + "r13_s3", + "r14_s4", + "r15_s5", + "rip_s6", + "flags_s7", + "rbx_s8", + "emu_s9", + "r10_s10", + "r11_s11", + "t3", + "t4", + "t5", + "t6", +}; + +static const char fpr[32][5] = { + "f0", + "f1", + "f2", + "f3", + "f4", + "f5", + "f6", + "f7", + "f8", + "f9", + "f10", + "f11", + "f12", + "f13", + "f14", + "f15", + "f16", + "f17", + "f18", + "f19", + "f20", + "f21", + "f22", + "f23", + "f24", + "f25", + "f26", + "f27", + "f28", + "f29", + "f30", + "f31", +}; + +static const char vpr[32][4] = { + "v0", + "v1", + "v2", + "v3", + "v4", + "v5", + "v6", + "v7", + "v8", + "v9", + "v10", + "v11", + "v12", + "v13", + "v14", + "v15", + "v16", + "v17", + "v18", + "v19", + "v20", + "v21", + "v22", + "v23", + "v24", + "v25", + "v26", + "v27", + "v28", + "v29", + "v30", + "v31", +}; + +static const char vm[2][5] = { + "v0.t", + "none", +}; + +static const char aq[4][5] = { + "none", + "aq", +}; + +static const char rl[4][5] = { + "none", + "rl", +}; + +static const char rm[8][4] = { + "rne", + "rtz", + "rdn", + "rup", + "rmm", + "n/a", + "n/a", + "dyn", +}; + +static const char nf[8][4] = { + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", +}; + +#define BX(v, b) (((v) >> b) & 1) +#define FX(v, high, low) (((v) >> low) & ((1ULL << (high - low + 1)) - 1)) +#define SIGN_EXTEND(val, val_sz) (((int32_t)(val) << (32 - (val_sz))) >> (32 - (val_sz))) + typedef struct { int8_t rd; int8_t rs1; int8_t rs2; int8_t rs3; + int8_t vd; + int8_t vs1; + int8_t vs2; + int8_t vs3; + int8_t aq; + int8_t rl; + int8_t vm; + int8_t rm; + int8_t nf; + int16_t csr; + int32_t imm; int32_t imm2; - uint16_t csr; - char *name; - bool rvc; - bool f; -} insn_t; - -static const char gpnames[32][9] = { - "zero", "ra", "sp", "gp", "tp", "t0_mask", "t1", "t2_rip", - "s0_flags", "s1", "a0", "a1", "a2", "a3", "a4", "a5", - "a6_rax", "a7_rcx", "s2_rdx", "s3_rbx", "s4_rsp", "s5_rbp", "s6_rsi", "s7_rdi", - "s8_r8", "s9_r9", "s10_r10", "s11_r11", "t3_r12", "t4_r13", "t5_r14", "t6_r15", -}; - -static const char fpnames[32][5] = { - "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7", - "fs0", "fs1", "fa0", "fa1", "fa2", "fa3", "fa4", "fa5", - "fa6", "fa7", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7", - "fs8", "fs9", "fs10", "fs11", "ft8", "ft9", "ft10", "ft11", -}; + char* name; +} rv64_print_t; -#define QUADRANT(data) (((data) >> 0) & 0x3 ) - -/** - * normal types -*/ -#define OPCODE(data) (((data) >> 2) & 0x1f) -#define RD(data) (((data) >> 7) & 0x1f) -#define RS1(data) (((data) >> 15) & 0x1f) -#define RS2(data) (((data) >> 20) & 0x1f) -#define RS3(data) (((data) >> 27) & 0x1f) -#define FUNCT2(data) (((data) >> 25) & 0x3) -#define FUNCT3(data) (((data) >> 12) & 0x7) -#define FUNCT7(data) (((data) >> 25) & 0x7f) -#define IMM116(data) (((data) >> 26) & 0x3f) -#define AQ(data) (((data) >> 26) & 0x1) -#define RL(data) (((data) >> 25) & 0x1) -#define THIMM2(data) (((data) >> 20) & 0x3f) -#define THFUNCT12(data) (((data) >> 20) & 0xfff) -#define THFUNCT5(data) (((data) >> 27) & 0x1f) - -static inline insn_t insn_utype_read(uint32_t data) +const char* rv64_print(uint32_t opcode, uintptr_t addr) { - return (insn_t) { - .imm = (int32_t)data & 0xfffff000, - .rd = RD(data), - }; -} + static char buff[200]; + rv64_print_t a; -static inline insn_t insn_itype_read(uint32_t data) -{ - return (insn_t) { - .imm = (int32_t)data >> 20, - .rs1 = RS1(data), - .rd = RD(data), - }; -} + if (cpuext.xtheadba || cpuext.xtheadbb || cpuext.xtheadbs || cpuext.xtheadcondmov || cpuext.xtheadmempair) { -static inline insn_t insn_jtype_read(uint32_t data) -{ - uint32_t imm20 = (data >> 31) & 0x1; - uint32_t imm101 = (data >> 21) & 0x3ff; - uint32_t imm11 = (data >> 20) & 0x1; - uint32_t imm1912 = (data >> 12) & 0xff; - - int32_t imm = (imm20 << 20) | (imm1912 << 12) | (imm11 << 11) | (imm101 << 1); - imm = (imm << 11) >> 11; - - return (insn_t) { - .imm = imm, - .rd = RD(data), - }; -} + /**************** + * Generated by https://github.com/ksco/riscv-opcodes/tree/box64_printer + * Command: python parse.py -box64 rv_xtheadba rv_xtheadbb rv_xtheadbs rv_xtheadcondmov rv_xtheadmempair rv_xtheadmemidx > code.c + * Please do NOT edit the following code manually. + */ -static inline insn_t insn_btype_read(uint32_t data) -{ - uint32_t imm12 = (data >> 31) & 0x1; - uint32_t imm105 = (data >> 25) & 0x3f; - uint32_t imm41 = (data >> 8) & 0xf; - uint32_t imm11 = (data >> 7) & 0x1; - - int32_t imm = (imm12 << 12) | (imm11 << 11) |(imm105 << 5) | (imm41 << 1); - imm = (imm << 19) >> 19; - - return (insn_t) { - .imm = imm, - .rs1 = RS1(data), - .rs2 = RS2(data), - }; -} + // rv_xtheadba, TH.ADDSL + if ((opcode & 0xf800707f) == 0x100b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.ADDSL", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_rtype_read(uint32_t data) -{ - return (insn_t) { - .rs1 = RS1(data), - .rs2 = RS2(data), - .rd = RD(data), - }; -} + // rv_xtheadbb, TH.EXT + if ((opcode & 0x707f) == 0x200b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm2 = FX(opcode, 31, 26); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.EXT", gpr[a.rd], gpr[a.rs1], a.imm2, a.imm2, a.imm, a.imm); + return buff; + } -static inline insn_t insn_stype_read(uint32_t data) -{ - uint32_t imm115 = (data >> 25) & 0x7f; - uint32_t imm40 = (data >> 7) & 0x1f; - - int32_t imm = (imm115 << 5) | imm40; - imm = (imm << 20) >> 20; - return (insn_t) { - .imm = imm, - .rs1 = RS1(data), - .rs2 = RS2(data), - }; -} + // rv_xtheadbb, TH.EXTU + if ((opcode & 0x707f) == 0x300b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm2 = FX(opcode, 31, 26); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.EXTU", gpr[a.rd], gpr[a.rs1], a.imm2, a.imm2, a.imm, a.imm); + return buff; + } -static inline insn_t insn_csrtype_read(uint32_t data) -{ - return (insn_t) { - .csr = data >> 20, - .rs1 = RS1(data), - .rd = RD(data), - }; -} + // rv_xtheadbb, TH.FF0 + if ((opcode & 0xfff0707f) == 0x8400100b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "TH.FF0", gpr[a.rd], gpr[a.rs1]); + return buff; + } -static inline insn_t insn_fprtype_read(uint32_t data) -{ - return (insn_t) { - .rs1 = RS1(data), - .rs2 = RS2(data), - .rs3 = RS3(data), - .rd = RD(data), - }; -} + // rv_xtheadbb, TH.FF1 + if ((opcode & 0xfff0707f) == 0x8600100b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "TH.FF1", gpr[a.rd], gpr[a.rs1]); + return buff; + } -/** - * compressed types -*/ -#define COPCODE(data) (((data) >> 13) & 0x7 ) -#define CFUNCT1(data) (((data) >> 12) & 0x1 ) -#define CFUNCT2LOW(data) (((data) >> 5) & 0x3 ) -#define CFUNCT2HIGH(data) (((data) >> 10) & 0x3 ) -#define RP1(data) (((data) >> 7) & 0x7 ) -#define RP2(data) (((data) >> 2) & 0x7 ) -#define RC1(data) (((data) >> 7) & 0x1f) -#define RC2(data) (((data) >> 2) & 0x1f) - -static inline insn_t insn_catype_read(uint16_t data) -{ - return (insn_t) { - .rd = RP1(data) + 8, - .rs2 = RP2(data) + 8, - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LBIA + if ((opcode & 0xf800707f) == 0x1800400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.LBIA", gpr[a.rd], gpr[a.rs1], a.imm, a.imm, a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_crtype_read(uint16_t data) -{ - return (insn_t) { - .rs1 = RC1(data), - .rs2 = RC2(data), - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LBUIA + if ((opcode & 0xf800707f) == 0x9800400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.LBUIA", gpr[a.rd], gpr[a.rs1], a.imm, a.imm, a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_citype_read(uint16_t data) -{ - uint32_t imm40 = (data >> 2) & 0x1f; - uint32_t imm5 = (data >> 12) & 0x1; - int32_t imm = (imm5 << 5) | imm40; - imm = (imm << 26) >> 26; - - return (insn_t) { - .imm = imm, - .rd = RC1(data), - .rvc = true, - }; -} + // rv_xtheadmempair, TH.LDD + if ((opcode & 0xf800707f) == 0xf800400b) { + a.rd = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LDD", gpr[a.rd], gpr[a.rs2], gpr[a.rs1], a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_citype_read2(uint16_t data) -{ - uint32_t imm86 = (data >> 2) & 0x7; - uint32_t imm43 = (data >> 5) & 0x3; - uint32_t imm5 = (data >> 12) & 0x1; + // rv_xtheadmemidx, TH.LDIA + if ((opcode & 0xf800707f) == 0x7800400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.LDIA", gpr[a.rd], gpr[a.rs1], a.imm, a.imm, a.imm2, a.imm2); + return buff; + } - int32_t imm = (imm86 << 6) | (imm43 << 3) | (imm5 << 5); + // rv_xtheadmemidx, TH.LHIA + if ((opcode & 0xf800707f) == 0x3800400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.LHIA", gpr[a.rd], gpr[a.rs1], a.imm, a.imm, a.imm2, a.imm2); + return buff; + } - return (insn_t) { - .imm = imm, - .rd = RC1(data), - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LHUIA + if ((opcode & 0xf800707f) == 0xb800400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.LHUIA", gpr[a.rd], gpr[a.rs1], a.imm, a.imm, a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_citype_read3(uint16_t data) -{ - uint32_t imm5 = (data >> 2) & 0x1; - uint32_t imm87 = (data >> 3) & 0x3; - uint32_t imm6 = (data >> 5) & 0x1; - uint32_t imm4 = (data >> 6) & 0x1; - uint32_t imm9 = (data >> 12) & 0x1; - - int32_t imm = (imm5 << 5) | (imm87 << 7) | (imm6 << 6) | (imm4 << 4) | (imm9 << 9); - imm = (imm << 22) >> 22; - - return (insn_t) { - .imm = imm, - .rd = RC1(data), - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LRB + if ((opcode & 0xf800707f) == 0x400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LRB", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_citype_read4(uint16_t data) -{ - uint32_t imm5 = (data >> 12) & 0x1; - uint32_t imm42 = (data >> 4) & 0x7; - uint32_t imm76 = (data >> 2) & 0x3; + // rv_xtheadmemidx, TH.LRBU + if ((opcode & 0xf800707f) == 0x8000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LRBU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } - int32_t imm = (imm5 << 5) | (imm42 << 2) | (imm76 << 6); + // rv_xtheadmemidx, TH.LRD + if ((opcode & 0xf800707f) == 0x6000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LRD", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } - return (insn_t) { - .imm = imm, - .rd = RC1(data), - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LRH + if ((opcode & 0xf800707f) == 0x2000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LRH", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_citype_read5(uint16_t data) -{ - uint32_t imm1612 = (data >> 2) & 0x1f; - uint32_t imm17 = (data >> 12) & 0x1; - - int32_t imm = (imm1612 << 12) | (imm17 << 17); - imm = (imm << 14) >> 14; - return (insn_t) { - .imm = imm, - .rd = RC1(data), - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LRHU + if ((opcode & 0xf800707f) == 0xa000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LRHU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_cbtype_read(uint16_t data) -{ - uint32_t imm5 = (data >> 2) & 0x1; - uint32_t imm21 = (data >> 3) & 0x3; - uint32_t imm76 = (data >> 5) & 0x3; - uint32_t imm43 = (data >> 10) & 0x3; - uint32_t imm8 = (data >> 12) & 0x1; - - int32_t imm = (imm8 << 8) | (imm76 << 6) | (imm5 << 5) | (imm43 << 3) | (imm21 << 1); - imm = (imm << 23) >> 23; - - return (insn_t) { - .imm = imm, - .rs1 = RP1(data) + 8, - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LRW + if ((opcode & 0xf800707f) == 0x4000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LRW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_cbtype_read2(uint16_t data) -{ - uint32_t imm40 = (data >> 2) & 0x1f; - uint32_t imm5 = (data >> 12) & 0x1; - int32_t imm = (imm5 << 5) | imm40; - imm = (imm << 26) >> 26; - - return (insn_t) { - .imm = imm, - .rd = RP1(data) + 8, - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LRWU + if ((opcode & 0xf800707f) == 0xc000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LRWU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_cstype_read(uint16_t data) -{ - uint32_t imm76 = (data >> 5) & 0x3; - uint32_t imm53 = (data >> 10) & 0x7; + // rv_xtheadmemidx, TH.LURB + if ((opcode & 0xf800707f) == 0x1000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LURB", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } - int32_t imm = ((imm76 << 6) | (imm53 << 3)); + // rv_xtheadmemidx, TH.LURBU + if ((opcode & 0xf800707f) == 0x9000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LURBU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } - return (insn_t) { - .imm = imm, - .rs1 = RP1(data) + 8, - .rs2 = RP2(data) + 8, - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LURD + if ((opcode & 0xf800707f) == 0x7000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LURD", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_cstype_read2(uint16_t data) -{ - uint32_t imm6 = (data >> 5) & 0x1; - uint32_t imm2 = (data >> 6) & 0x1; - uint32_t imm53 = (data >> 10) & 0x7; - - int32_t imm = ((imm6 << 6) | (imm2 << 2) | (imm53 << 3)); - - return (insn_t) { - .imm = imm, - .rs1 = RP1(data) + 8, - .rs2 = RP2(data) + 8, - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LURH + if ((opcode & 0xf800707f) == 0x3000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LURH", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_cjtype_read(uint16_t data) -{ - uint32_t imm5 = (data >> 2) & 0x1; - uint32_t imm31 = (data >> 3) & 0x7; - uint32_t imm7 = (data >> 6) & 0x1; - uint32_t imm6 = (data >> 7) & 0x1; - uint32_t imm10 = (data >> 8) & 0x1; - uint32_t imm98 = (data >> 9) & 0x3; - uint32_t imm4 = (data >> 11) & 0x1; - uint32_t imm11 = (data >> 12) & 0x1; - - int32_t imm = ((imm5 << 5) | (imm31 << 1) | (imm7 << 7) | (imm6 << 6) | - (imm10 << 10) | (imm98 << 8) | (imm4 << 4) | (imm11 << 11)); - imm = (imm << 20) >> 20; - return (insn_t) { - .imm = imm, - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LURHU + if ((opcode & 0xf800707f) == 0xb000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LURHU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_cltype_read(uint16_t data) -{ - uint32_t imm6 = (data >> 5) & 0x1; - uint32_t imm2 = (data >> 6) & 0x1; - uint32_t imm53 = (data >> 10) & 0x7; - - int32_t imm = (imm6 << 6) | (imm2 << 2) | (imm53 << 3); - - return (insn_t) { - .imm = imm, - .rs1 = RP1(data) + 8, - .rd = RP2(data) + 8, - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LURW + if ((opcode & 0xf800707f) == 0x5000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LURW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_cltype_read2(uint16_t data) -{ - uint32_t imm76 = (data >> 5) & 0x3; - uint32_t imm53 = (data >> 10) & 0x7; + // rv_xtheadmemidx, TH.LURWU + if ((opcode & 0xf800707f) == 0xd000400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LURWU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } - int32_t imm = (imm76 << 6) | (imm53 << 3); + // rv_xtheadmempair, TH.LWD + if ((opcode & 0xf800707f) == 0xe000400b) { + a.rd = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LWD", gpr[a.rd], gpr[a.rs2], gpr[a.rs1], a.imm2, a.imm2); + return buff; + } - return (insn_t) { - .imm = imm, - .rs1 = RP1(data) + 8, - .rd = RP2(data) + 8, - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.LWIA + if ((opcode & 0xf800707f) == 0x5800400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.LWIA", gpr[a.rd], gpr[a.rs1], a.imm, a.imm, a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_csstype_read(uint16_t data) -{ - uint32_t imm86 = (data >> 7) & 0x7; - uint32_t imm53 = (data >> 10) & 0x7; + // rv_xtheadmempair, TH.LWUD + if ((opcode & 0xf800707f) == 0xf000400b) { + a.rd = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.LWUD", gpr[a.rd], gpr[a.rs2], gpr[a.rs1], a.imm2, a.imm2); + return buff; + } - int32_t imm = (imm86 << 6) | (imm53 << 3); + // rv_xtheadmemidx, TH.LWUIA + if ((opcode & 0xf800707f) == 0xd800400b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.LWUIA", gpr[a.rd], gpr[a.rs1], a.imm, a.imm, a.imm2, a.imm2); + return buff; + } - return (insn_t) { - .imm = imm, - .rs2 = RC2(data), - .rvc = true, - }; -} + // rv_xtheadcondmov, TH.MVEQZ + if ((opcode & 0xfe00707f) == 0x4000100b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "TH.MVEQZ", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } -static inline insn_t insn_csstype_read2(uint16_t data) -{ - uint32_t imm76 = (data >> 7) & 0x3; - uint32_t imm52 = (data >> 9) & 0xf; + // rv_xtheadcondmov, TH.MVNEZ + if ((opcode & 0xfe00707f) == 0x4200100b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "TH.MVNEZ", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } - int32_t imm = (imm76 << 6) | (imm52 << 2); + // rv_xtheadbb, TH.REV + if ((opcode & 0xfff0707f) == 0x8200100b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "TH.REV", gpr[a.rd], gpr[a.rs1]); + return buff; + } - return (insn_t) { - .imm = imm, - .rs2 = RC2(data), - .rvc = true, - }; -} + // rv_xtheadbb, TH.REVW + if ((opcode & 0xfff0707f) == 0x9000100b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "TH.REVW", gpr[a.rd], gpr[a.rs1]); + return buff; + } -static inline insn_t insn_ciwtype_read(uint16_t data) -{ - uint32_t imm3 = (data >> 5) & 0x1; - uint32_t imm2 = (data >> 6) & 0x1; - uint32_t imm96 = (data >> 7) & 0xf; - uint32_t imm54 = (data >> 11) & 0x3; - - int32_t imm = (imm3 << 3) | (imm2 << 2) | (imm96 << 6) | (imm54 << 4); - - return (insn_t) { - .imm = imm, - .rd = RP2(data) + 8, - .rvc = true, - }; -} + // rv_xtheadmemidx, TH.SBIB + if ((opcode & 0xf800707f) == 0x800500b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.SBIB", gpr[a.rd], gpr[a.rs1], a.imm, a.imm, a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_th1type_read(uint32_t data) -{ - return (insn_t) { - .rs1 = RS1(data), - .rs2 = RS2(data), - .rd = RD(data), - .imm = FUNCT2(data), - }; -} + // rv_xtheadmempair, TH.SDD + if ((opcode & 0xf800707f) == 0xf800500b) { + a.rd = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.SDD", gpr[a.rd], gpr[a.rs2], gpr[a.rs1], a.imm2, a.imm2); + return buff; + } -static inline insn_t insn_th2type_read(uint32_t data) -{ - return (insn_t) { - .rs1 = RS1(data), - .rd = RD(data), - .imm = IMM116(data), - .imm2 = THIMM2(data), - }; -} + // rv_xtheadmemidx, TH.SDIB + if ((opcode & 0xf800707f) == 0x6800500b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.SDIB", gpr[a.rd], gpr[a.rs1], a.imm, a.imm, a.imm2, a.imm2); + return buff; + } -#define RN(r) insn.f ? fpnames[insn.r] : gpnames[insn.r] - -#define PRINT_none() snprintf(buff, sizeof(buff), "%s", insn.name); return buff -#define PRINT_rd_rs1() snprintf(buff, sizeof(buff), "%s\t%s, %s", insn.name, RN(rd), RN(rs1)); return buff -#define PRINT_rd_rs1_rs2() snprintf(buff, sizeof(buff), "%s\t%s, %s, %s", insn.name, RN(rd), RN(rs1), RN(rs2)); return buff -#define PRINT_rd_rs1_rs2_rs3() snprintf(buff, sizeof(buff), "%s\t%s, %s, %s, %s", insn.name, RN(rd), RN(rs1), RN(rs2), RN(rs3)); return buff -#define PRINT_rd_rs1_imm() snprintf(buff, sizeof(buff), "%s\t%s, %s, %s0x%x", insn.name, RN(rd), RN(rs1), insn.imm>=0?"":"-", insn.imm>=0?insn.imm:-insn.imm); return buff -#define PRINT_rd_rs1_immx() snprintf(buff, sizeof(buff), "%s\t%s, %s, 0x%x", insn.name, RN(rd), RN(rs1), insn.imm); return buff -#define PRINT_rd_imm_rs1() snprintf(buff, sizeof(buff), "%s\t%s, %s0x%x(%s)", insn.name, RN(rd), insn.imm>=0?"":"-", insn.imm>=0?insn.imm:-insn.imm, gpnames[insn.rs1]); return buff -#define PRINT_rs2_imm_rs1() snprintf(buff, sizeof(buff), "%s\t%s, %s0x%x(%s)", insn.name, RN(rs2), insn.imm>=0?"":"-", insn.imm>=0?insn.imm:-insn.imm, gpnames[insn.rs1]); return buff -#define PRINT_rd_imm() snprintf(buff, sizeof(buff), "%s\t%s, %s0x%x", insn.name, RN(rd), insn.imm>=0?"":"-", insn.imm>=0?insn.imm:-insn.imm); return buff -#define PRINT_rd_imm_rel() snprintf(buff, sizeof(buff), "%s\t%s, pc%s0x%x # 0x%"PRIx64, insn.name, RN(rd), insn.imm>=0?"+":"-", insn.imm>=0?insn.imm:-insn.imm, insn.imm+(uint64_t)addr); return buff -#define PRINT_imm_rel() snprintf(buff, sizeof(buff), "%s\tpc%s0x%x # 0x%"PRIx64, insn.name, insn.imm>=0?"+":"-", insn.imm>=0?insn.imm:-insn.imm, insn.imm+(uint64_t)addr); return buff -#define PRINT_rd_immx() snprintf(buff, sizeof(buff), "%s\t%s, 0x%x", insn.name, RN(rd), insn.imm); return buff -#define PRINT_rs1_rs2_imm() snprintf(buff, sizeof(buff), "%s\t%s, %s, %s0x%x", insn.name, RN(rs1), RN(rs2), insn.imm>=0?"":"-", insn.imm>=0?insn.imm:-insn.imm); return buff -#define PRINT_rs1_rs2_imm_rel() snprintf(buff, sizeof(buff), "%s\t%s, %s, pc%s0x%x # 0x%"PRIx64, insn.name, RN(rs1), RN(rs2), insn.imm>=0?"+":"-", insn.imm>=0?insn.imm:-insn.imm, insn.imm+(uint64_t)addr); return buff -#define PRINT_fd_fs1() snprintf(buff, sizeof(buff), "%s\t%s, %s", insn.name, fpnames[insn.rd], fpnames[insn.rs1]); return buff -#define PRINT_xd_fs1() snprintf(buff, sizeof(buff), "%s\t%s, %s", insn.name, gpnames[insn.rd], fpnames[insn.rs1]); return buff -#define PRINT_fd_xs1() snprintf(buff, sizeof(buff), "%s\t%s, %s", insn.name, fpnames[insn.rd], gpnames[insn.rs1]); return buff -#define PRINT_rd_fs1_fs2() snprintf(buff, sizeof(buff), "%s\t%s, %s, %s", insn.name, gpnames[insn.rd], RN(rs1), RN(rs2)); return buff -#define PRINT_rd_rs1_aqrl() snprintf(buff, sizeof(buff), "%s%s%s\t%s, (%s)", insn.name, aq?".aq":"", rl?".rl":"", gpnames[insn.rd], gpnames[insn.rs1]); return buff -#define PRINT_rd_rs1_rs2_aqrl() snprintf(buff, sizeof(buff), "%s%s%s\t%s, %s, (%s)", insn.name, aq?".aq":"", rl?".rl":"", gpnames[insn.rd], gpnames[insn.rs2], gpnames[insn.rs1]); return buff -#define PRINT_rd_rs1_rs2_imm() snprintf(buff, sizeof(buff), "%s\t%s, %s, %s, %s0x%x", insn.name, RN(rd), RN(rs1), RN(rs2), insn.imm>=0?"":"-", insn.imm>=0?insn.imm:-insn.imm); return buff -#define PRINT_rd_rs1_imm1_imm2() snprintf(buff, sizeof(buff), "%s\t%s, %s, %s0x%x, %s0x%x", insn.name, RN(rd), RN(rs1), insn.imm>=0?"":"-", insn.imm>=0?insn.imm:-insn.imm, insn.imm2>=0?"":"-", insn.imm2>=0?insn.imm2:-insn.imm2); return buff -#define PRINT_rd1_rd2_rs1_imm_4() snprintf(buff, sizeof(buff), "%s\t%s, %s, (%s), %s0x%x, 4", insn.name, RN(rd), RN(rs2), RN(rs1), insn.imm>=0?"":"-", insn.imm>=0?insn.imm:-insn.imm); return buff - -// TODO: display csr name -#define PRINT_rd_csr_rs1() snprintf(buff, sizeof(buff), "%s\t%s, %d, %s", insn.name, RN(rd), insn.csr, RN(rs1)); return buff -#define PRINT_rd_csr_uimm() snprintf(buff, sizeof(buff), "%s\t%s, %d, %d", insn.name, RN(rd), insn.csr, (uint32_t)insn.imm); return buff - -const char* rv64_print(uint32_t data, uintptr_t addr) -{ - static char buff[200] = {0}; - - insn_t insn = { 0 }; - uint32_t quadrant = QUADRANT(data); - switch (quadrant) { - case 0x0: { - uint32_t copcode = COPCODE(data); - - switch (copcode) { - case 0x0: - insn = insn_ciwtype_read(data); - insn.rs1 = 2; - insn.name = "addi"; - assert(insn.imm != 0); - PRINT_rd_rs1_imm(); - case 0x1: - insn = insn_cltype_read2(data); - insn.name = "fld"; - insn.f = true; - PRINT_rd_imm_rs1(); - case 0x2: - insn = insn_cltype_read(data); - insn.name = "lw"; - PRINT_rd_imm_rs1(); - case 0x3: - insn = insn_cltype_read2(data); - insn.name = "ld"; - PRINT_rd_imm_rs1(); - case 0x5: - insn = insn_cstype_read(data); - insn.name = "fsd"; - insn.f = true; - PRINT_rs2_imm_rs1(); - case 0x6: - insn = insn_cstype_read2(data); - insn.name = "sw"; - PRINT_rd_imm_rs1(); - case 0x7: - insn = insn_cstype_read(data); - insn.name = "sd"; - PRINT_rs2_imm_rs1(); - } - } - case 0x1: { - uint32_t copcode = COPCODE(data); - - switch (copcode) { - case 0x0: - insn = insn_citype_read(data); - insn.rs1 = insn.rd; - insn.name = "addi"; - PRINT_rd_rs1_imm(); - case 0x1: - insn = insn_citype_read(data); - assert(insn.rd != 0); - insn.rs1 = insn.rd; - insn.name = "addiw"; - PRINT_rd_rs1_imm(); - case 0x2: - insn = insn_citype_read(data); - insn.rs1 = 0; - insn.name = "addi"; - PRINT_rd_rs1_imm(); - case 0x3: { - int32_t rd = RC1(data); - if (rd == 2) { - insn = insn_citype_read3(data); - assert(insn.imm != 0); - insn.rs1 = insn.rd; - insn.name = "addi"; - PRINT_rd_rs1_imm(); - } else { - insn = insn_citype_read5(data); - assert(insn.imm != 0); - insn.name = "lui"; - PRINT_rd_immx(); - } + // rv_xtheadmemidx, TH.SHIB + if ((opcode & 0xf800707f) == 0x2800500b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.SHIB", gpr[a.rd], gpr[a.rs1], a.imm, a.imm, a.imm2, a.imm2); + return buff; } - case 0x4: { - uint32_t cfunct2high = CFUNCT2HIGH(data); - - switch (cfunct2high) { - case 0x0: - case 0x1: - case 0x2: { - insn = insn_cbtype_read2(data); - insn.rs1 = insn.rd; - - if (cfunct2high == 0x0) { - insn.name = "srli"; - } else if (cfunct2high == 0x1) { - insn.name = "srai"; - } else { - insn.name = "andi"; - } - PRINT_rd_rs1_imm(); - } - case 0x3: { - uint32_t cfunct1 = CFUNCT1(data); - - switch (cfunct1) { - case 0x0: { - uint32_t cfunct2low = CFUNCT2LOW(data); - - insn = insn_catype_read(data); - insn.rs1 = insn.rd; - - switch (cfunct2low) { - case 0x0: - insn.name = "sub"; - break; - case 0x1: - insn.name = "xor"; - break; - case 0x2: - insn.name = "or"; - break; - case 0x3: - insn.name = "and"; - break; - } - break; - } - case 0x1: { - uint32_t cfunct2low = CFUNCT2LOW(data); - - insn = insn_catype_read(data); - insn.rs1 = insn.rd; - - switch (cfunct2low) { - case 0x0: - insn.name = "subw"; - break; - case 0x1: - insn.name = "addw"; - break; - default: - goto unknown; - } - break; - } - } - PRINT_rd_rs1_rs2(); - } - } + + // rv_xtheadmemidx, TH.SRB + if ((opcode & 0xf800707f) == 0x500b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.SRB", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; } - case 0x5: - insn = insn_cjtype_read(data); - insn.rd = 0; - insn.name = "jal"; - PRINT_rd_imm(); - case 0x6: - case 0x7: - insn = insn_cbtype_read(data); - insn.rs2 = 0; - insn.name = copcode == 0x6 ? "beq" : "bne"; - PRINT_rs1_rs2_imm(); - } - } - case 0x2: { - uint32_t copcode = COPCODE(data); - switch (copcode) { - case 0x0: - insn = insn_citype_read(data); - insn.rs1 = insn.rd; - insn.name = "slli"; - PRINT_rd_rs1_imm(); - case 0x1: - insn = insn_citype_read2(data); - insn.rs1 = 2; - insn.f = true; - insn.name = "fld"; - PRINT_rd_imm_rs1(); - case 0x2: - insn = insn_citype_read4(data); - assert(insn.rd != 0); - insn.rs1 = 2; - insn.name = "lw"; - PRINT_rd_imm_rs1(); - case 0x3: - insn = insn_citype_read2(data); - assert(insn.rd != 0); - insn.rs1 = 2; - insn.name = "ld"; - PRINT_rd_imm_rs1(); - case 0x4: { - uint32_t cfunct1 = CFUNCT1(data); - - switch (cfunct1) { - case 0x0: { - insn = insn_crtype_read(data); - - if (insn.rs2 == 0) { - assert(insn.rs1 != 0); - insn.rd = 0; - insn.name = "jalr"; - PRINT_rd_imm_rs1(); - } else { - insn.rd = insn.rs1; - insn.rs1 = 0; - insn.name = "add"; - PRINT_rd_rs1_rs2(); - } - } - case 0x1: { - insn = insn_crtype_read(data); - if (insn.rs1 == 0 && insn.rs2 == 0) { - insn.name = "ebreak"; - PRINT_none(); - } else if (insn.rs2 == 0) { - insn.rd = 1; - insn.name = "jalr"; - PRINT_rd_imm_rs1(); - } else { - insn.rd = insn.rs1; - insn.name = "add"; - PRINT_rd_rs1_rs2(); - } - } - } + + // rv_xtheadmemidx, TH.SRD + if ((opcode & 0xf800707f) == 0x6000500b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.SRD", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; } - case 0x5: - insn = insn_csstype_read(data); - insn.rs1 = 2; - insn.f = true; - insn.name = "fsd"; - PRINT_rs2_imm_rs1(); - case 0x6: - insn = insn_csstype_read2(data); - insn.rs1 = 2; - insn.name = "sw"; - PRINT_rs2_imm_rs1(); - case 0x7: - insn = insn_csstype_read(data); - insn.rs1 = 2; - insn.name = "sd"; - PRINT_rs2_imm_rs1(); - } - } - case 0x3: { - uint32_t opcode = OPCODE(data); - switch (opcode) { - case 0x0: { - uint32_t funct3 = FUNCT3(data); - - insn = insn_itype_read(data); - switch (funct3) { - case 0x0: - insn.name = "lb"; - break; - case 0x1: - insn.name = "lh"; - break; - case 0x2: - insn.name = "lw"; - break; - case 0x3: - insn.name = "ld"; - break; - case 0x4: - insn.name = "lbu"; - break; - case 0x5: - insn.name = "lhu"; - break; - case 0x6: - insn.name = "lwu"; - break; - default: - goto unknown; - } - PRINT_rd_imm_rs1(); - } - case 0x1: { - uint32_t funct3 = FUNCT3(data); - - insn = insn_itype_read(data); - switch (funct3) { - case 0x2: - insn.name = "flw"; - insn.f = true; - break; - case 0x3: - insn.name = "fld"; - insn.f = true; - break; - default: - goto unknown; - } - PRINT_rd_imm_rs1(); - } - case 0x2: { /* thead custom-0 */ - uint32_t funct3 = FUNCT3(data); - - switch (funct3) { - case 0x1: { - if (RS3(data) == 0x0) { - insn = insn_th1type_read(data); - insn.name = "th.addsl"; - PRINT_rd_rs1_rs2_imm(); - } else if (IMM116(data) == 0x4) { - insn = insn_itype_read(data); - insn.name = "th.srri"; - insn.imm &= 0b111111; - PRINT_rd_rs1_imm(); - } else if (IMM116(data) == 0x22) { - insn = insn_itype_read(data); - insn.name = "th.tst"; - insn.imm &= 0b111111; - PRINT_rd_rs1_imm(); - } else if (FUNCT7(data) == 0xa) { - insn = insn_itype_read(data); - insn.name = "th.srriw"; - insn.imm &= 0b11111; - PRINT_rd_rs1_imm(); - } else if (THFUNCT12(data) == 0x840) { - insn = insn_rtype_read(data); - insn.name = "th.ff0"; - PRINT_rd_rs1(); - } else if (THFUNCT12(data) == 0x860) { - insn = insn_rtype_read(data); - insn.name = "th.ff1"; - PRINT_rd_rs1(); - } else if (THFUNCT12(data) == 0x820) { - insn = insn_rtype_read(data); - insn.name = "th.rev"; - PRINT_rd_rs1(); - } else if (THFUNCT12(data) == 0x900) { - insn = insn_rtype_read(data); - insn.name = "th.revw"; - PRINT_rd_rs1(); - } else if (THFUNCT12(data) == 0x800) { - insn = insn_rtype_read(data); - insn.name = "th.tstnbz"; - PRINT_rd_rs1(); - } - goto unknown; - } - case 0x2: { - insn = insn_th2type_read(data); - insn.name = "th.ext"; - PRINT_rd_rs1_imm1_imm2(); - } - case 0x3: { - insn = insn_th2type_read(data); - insn.name = "th.extu"; - PRINT_rd_rs1_imm1_imm2(); - } - case 0x4: { - switch (THFUNCT5(data)) { - case 0x1f: { - insn = insn_th1type_read(data); - insn.name = "th.ldd"; - PRINT_rd1_rd2_rs1_imm_4(); - } - default: - goto unknown; - } - } - case 0x5: { - switch (THFUNCT5(data)) { - case 0x1f: { - insn = insn_th1type_read(data); - insn.name = "th.sdd"; - PRINT_rd1_rd2_rs1_imm_4(); - } - default: - goto unknown; - } - } - default: - goto unknown; - } - break; + + // rv_xtheadmemidx, TH.SRH + if ((opcode & 0xf800707f) == 0x2000500b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.SRH", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; } - case 0x3: { - uint32_t funct3 = FUNCT3(data); - switch (funct3) { - case 0x0: { - insn.name = "fence"; - // TODO: handle pred succ - PRINT_none(); - } - case 0x1: { - insn.name = "fence.i"; - PRINT_none(); - } - default: - goto unknown; - } + // rv_xtheadbb, TH.SRRI + if ((opcode & 0xfc00707f) == 0x1000100b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "TH.SRRI", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; } - case 0x4: { - int hex = 0; - int mv_alias = 0; - int nop_alias = 0; - int not_alias = 0; - uint32_t funct3 = FUNCT3(data); - - insn = insn_itype_read(data); - switch (funct3) { - case 0x0: - insn.name = "addi"; - if (insn.imm == 0) { - if (insn.rd == 0 && insn.rs1 == 0) { - nop_alias = 1; - insn.name = "nop"; - } else { - mv_alias = 1; - insn.name = "mv"; - } - } - break; - case 0x1: { - uint32_t imm116 = IMM116(data); - switch (imm116) { - case 0x0: - insn.name = "slli"; - break; - case 0x18: { - uint32_t rs2 = RS2(data); - switch (rs2) { - case 0x0: - insn.name = "clz"; - break; - case 0x1: - insn.name = "ctz"; - break; - case 0x2: - insn.name = "cpop"; - break; - case 0x4: - insn.name = "sext.b"; - break; - case 0x5: - insn.name = "sext.h"; - break; - default: - goto unknown; - } - PRINT_rd_rs1(); - } - default: - goto unknown; - } - break; - } - case 0x2: - insn.name = "slti"; - break; - case 0x3: - insn.name = "sltiu"; - break; - case 0x4: - insn.name = "xori"; - hex = 1; - if (insn.imm == -1) { - not_alias = 1; - insn.name = "not"; - } - break; - case 0x5: { - uint32_t imm116 = IMM116(data); - - if (imm116 == 0x0) { - insn.name = "srli"; - } else if (imm116 == 0x10) { - insn.name = "srai"; - insn.imm &= 0b111111; - } else if (imm116 == 0x12) { - insn.name = "bexti"; - insn.imm &= 0b111111; - } else if (imm116 == 0x18) { - insn.name = "rori"; - insn.imm &= 0b111111; - } else if (insn.imm==0b011010111000) { - insn.name = "rev8"; - PRINT_rd_rs1(); - } - break; - } - case 0x6: - insn.name = "ori"; - hex = 1; - break; - case 0x7: - insn.name = "andi"; - hex = 1; - break; - } - if (not_alias) { - PRINT_rd_rs1(); - } else if (nop_alias) { - PRINT_none(); - } else if (mv_alias) { - PRINT_rd_rs1(); - } else if(hex) { - PRINT_rd_rs1_immx(); - } else { - PRINT_rd_rs1_imm(); - } + + // rv_xtheadbb, TH.SRRIW + if ((opcode & 0xfe00707f) == 0x1400100b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "TH.SRRIW", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; } - case 0x5: { - insn = insn_utype_read(data); - insn.name = "auipc"; - PRINT_rd_imm_rel(); - } - case 0x6: { - uint32_t funct3 = FUNCT3(data); - uint32_t funct7 = FUNCT7(data); - - insn = insn_itype_read(data); - - switch (funct3) { - case 0x0: - insn.name = "addiw"; - break; - case 0x1: - switch (funct7) { - case 0x0: - insn.name = "slliw"; - break; - case 0x4: - insn.name = "slli.uw"; - break; - case 0x30: { - uint32_t rs2 = RS2(data); - switch (rs2) { - case 0x0: - insn.name = "clzw"; - break; - case 0x1: - insn.name = "ctzw"; - break; - case 0x2: - insn.name = "cpopw"; - break; - default: - goto unknown; - } - PRINT_rd_rs1(); - } - default: - goto unknown; - } - break; - case 0x5: { - switch (funct7) { - case 0x0: - insn.name = "srliw"; - break; - case 0x20: - insn.name = "sraiw"; - insn.imm &= 0b11111; - break; - case 0x30: - insn.name = "roriw"; - insn.imm &= 0b11111; - break; - default: - goto unknown; - } - break; - } - default: - goto unknown; - } - PRINT_rd_rs1_imm(); - } - case 0x8: { - uint32_t funct3 = FUNCT3(data); - - insn = insn_stype_read(data); - switch (funct3) { - case 0x0: - insn.name = "sb"; - break; - case 0x1: - insn.name = "sh"; - break; - case 0x2: - insn.name = "sw"; - break; - case 0x3: - insn.name = "sd"; - break; - default: - goto unknown; - } - PRINT_rs2_imm_rs1(); - } - case 0x9: { - uint32_t funct3 = FUNCT3(data); - - insn = insn_stype_read(data); - switch (funct3) { - case 0x2: - insn.name = "fsw"; - insn.f = true; - break; - case 0x3: - insn.name = "fsd"; - insn.f = true; - break; - default: - goto unknown; - } - PRINT_rs2_imm_rs1(); - } - case 0xb: { - uint32_t funct3 = FUNCT3(data); - uint32_t rs1 = RS3(data); - bool aq = AQ(data), rl = RL(data); - insn = insn_rtype_read(data); - switch(funct3) { - case 0x2: - switch (rs1) { - case 0x2: - insn.name = "lr.w"; - PRINT_rd_rs1_aqrl(); - case 0x3: - insn.name = "sc.w"; - PRINT_rd_rs1_rs2_aqrl(); - } - case 0x3: - switch (rs1) { - case 0x2: - insn.name = "lr.d"; - PRINT_rd_rs1_aqrl(); - case 0x3: - insn.name = "sc.d"; - PRINT_rd_rs1_rs2_aqrl(); - } - default: - goto unknown; - } + + // rv_xtheadmemidx, TH.SRW + if ((opcode & 0xf800707f) == 0x4000500b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.SRW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; } - case 0xc: { - insn = insn_rtype_read(data); - - uint32_t funct3 = FUNCT3(data); - uint32_t funct7 = FUNCT7(data); - - switch (funct7) { - case 0x0: { - switch (funct3) { - case 0x0: - insn.name = "add"; - break; - case 0x1: - insn.name = "sll"; - break; - case 0x2: - insn.name = "slt"; - break; - case 0x3: - insn.name = "sltu"; - break; - case 0x4: - insn.name = "xor"; - break; - case 0x5: - insn.name = "srl"; - break; - case 0x6: - insn.name = "or"; - break; - case 0x7: - insn.name = "and"; - break; - } - } - break; - case 0x1: { - switch (funct3) { - case 0x0: - insn.name = "mul"; - break; - case 0x1: - insn.name = "mulh"; - break; - case 0x2: - insn.name = "mulhsu"; - break; - case 0x3: - insn.name = "mulhu"; - break; - case 0x4: - insn.name = "div"; - break; - case 0x5: - insn.name = "divu"; - break; - case 0x6: - insn.name = "rem"; - break; - case 0x7: - insn.name = "remu"; - break; - } - } - break; - case 0x5: { - switch (funct3) { - case 0x4: - insn.name = "min"; - break; - case 0x5: - insn.name = "minu"; - break; - case 0x6: - insn.name = "max"; - break; - case 0x7: - insn.name = "maxu"; - break; - default: - goto unknown; - } - } - break; - case 0x10: { - switch (funct3) { - case 0x2: - insn.name = "sh1add"; - break; - case 0x4: - insn.name = "sh2add"; - break; - case 0x6: - insn.name = "sh3add"; - break; - default: - goto unknown; - } - } - break; - case 0x20: { - switch (funct3) { - case 0x0: - insn.name = "sub"; - break; - case 0x4: - insn.name = "xnor"; - break; - case 0x5: - insn.name = "sra"; - break; - case 0x6: - insn.name = "orn"; - break; - case 0x7: - insn.name = "andn"; - break; - default: - goto unknown; - } - break; - } - case 0x24: { - switch (funct3) { - case 0x5: - insn.name = "bext"; - break; - default: - goto unknown; - } - break; - } - case 0x30: { - switch (funct3) { - case 0x1: - insn.name = "rol"; - break; - case 0x5: - insn.name = "ror"; - break; - default: - goto unknown; - } - } - default: - goto unknown; - } - PRINT_rd_rs1_rs2(); - } - case 0xd: { - insn = insn_utype_read(data); - insn.name = "lui"; - PRINT_rd_immx(); - } - case 0xe: { - insn = insn_rtype_read(data); - - uint32_t funct3 = FUNCT3(data); - uint32_t funct7 = FUNCT7(data); - - switch (funct7) { - case 0x0: { - switch (funct3) { - case 0x0: - insn.name = "addw"; - break; - case 0x1: - insn.name = "sllw"; - break; - case 0x5: - insn.name = "srlw"; - break; - default: - goto unknown; - } - } - break; - case 0x1: { - switch (funct3) { - case 0x0: - insn.name = "mulw"; - break; - case 0x4: - insn.name = "divw"; - break; - case 0x5: - insn.name = "divuw"; - break; - case 0x6: - insn.name = "remw"; - break; - case 0x7: - insn.name = "remuw"; - break; - default: - goto unknown; - } - } - break; - case 0x4: { - switch (funct3) { - case 0x0: - insn.name = "add.uw"; - break; - case 0x4: - assert(insn.rs2 == 0); - insn.name = "zext.h"; - PRINT_rd_rs1(); - default: - goto unknown; - } - } - break; - case 0x10: { - switch (funct3) { - case 0x2: - insn.name = "sh1add.uw"; - break; - case 0x4: - insn.name = "sh2add.uw"; - break; - case 0x6: - insn.name = "sh3add.uw"; - break; - default: - goto unknown; - } - } - break; - case 0x20: { - switch (funct3) { - case 0x0: - insn.name = "subw"; - break; - case 0x5: - insn.name = "sraw"; - break; - default: - goto unknown; - } - } - break; - case 0x30: { - switch (funct3) { - case 0x1: - insn.name = "rolw"; - break; - case 0x5: - insn.name = "rorw"; - break; - default: - goto unknown; - } - } - default: - goto unknown; - } - PRINT_rd_rs1_rs2(); - } - case 0x10: { - uint32_t funct2 = FUNCT2(data); - - insn = insn_fprtype_read(data); - switch (funct2) { - case 0x0: - insn.name = "fmadd.s"; - insn.f = true; - break; - case 0x1: - insn.name = "fmadd.d"; - insn.f = true; - break; - default: - goto unknown; - } - PRINT_rd_rs1_rs2(); - } - case 0x11: { - uint32_t funct2 = FUNCT2(data); - - insn = insn_fprtype_read(data); - switch (funct2) { - case 0x0: - insn.name = "fmsub.s"; - insn.f = true; - break; - case 0x1: - insn.name = "fmsub.d"; - insn.f = true; - break; - default: - goto unknown; - } - PRINT_rd_rs1_rs2(); - } - case 0x12: { - uint32_t funct2 = FUNCT2(data); - - insn = insn_fprtype_read(data); - switch (funct2) { - case 0x0: - insn.name = "fnmsub.s"; - insn.f = true; - break; - case 0x1: - insn.name = "fnmsub.d"; - insn.f = true; - break; - default: - goto unknown; - } - PRINT_rd_rs1_rs2_rs3(); - } - case 0x13: { - uint32_t funct2 = FUNCT2(data); - - insn = insn_fprtype_read(data); - switch (funct2) { - case 0x0: - insn.name = "fnmadd.s"; - insn.f = true; - break; - case 0x1: - insn.name = "fnmadd.d"; - insn.f = true; - break; - default: - goto unknown; - } - PRINT_rd_rs1_rs2_rs3(); - } - case 0x14: { - uint32_t funct7 = FUNCT7(data); - - insn = insn_rtype_read(data); - insn.f = true; - switch (funct7) { - case 0x0: - insn.name = "fadd.s"; - PRINT_rd_rs1_rs2(); - case 0x1: - insn.name = "fadd.d"; - PRINT_rd_rs1_rs2(); - case 0x4: - insn.name = "fsub.s"; - PRINT_rd_rs1_rs2(); - case 0x5: - insn.name = "fsub.d"; - PRINT_rd_rs1_rs2(); - case 0x8: - insn.name = "fmul.s"; - PRINT_rd_rs1_rs2(); - case 0x9: - insn.name = "fmul.d"; - PRINT_rd_rs1_rs2(); - case 0xc: - insn.name = "fdiv.s"; - PRINT_rd_rs1_rs2(); - case 0xd: - insn.name = "fdiv.d"; - PRINT_rd_rs1_rs2(); - case 0x10: { - uint32_t funct3 = FUNCT3(data); - - switch (funct3) { - case 0x0: - insn.name = "fsgnj.s"; - break; - case 0x1: - insn.name = "fsgnjn.s"; - break; - case 0x2: - insn.name = "fsgnjx.s"; - break; - default: - goto unknown; - } - PRINT_rd_rs1_rs2(); - } - case 0x11: { - uint32_t funct3 = FUNCT3(data); - - switch (funct3) { - case 0x0: - insn.name = "fsgnj.d"; - break; - case 0x1: - insn.name = "fsgnjn.d"; - break; - case 0x2: - insn.name = "fsgnjx.d"; - break; - default: - goto unknown; - } - PRINT_rd_rs1_rs2(); - } - case 0x14: { - uint32_t funct3 = FUNCT3(data); - - switch (funct3) { - case 0x0: - insn.name = "fmin.s"; - break; - case 0x1: - insn.name = "fmax.s"; - break; - default: - goto unknown; - } - PRINT_rd_rs1_rs2(); - } - case 0x15: { - uint32_t funct3 = FUNCT3(data); - - switch (funct3) { - case 0x0: - insn.name = "fmin.d"; - break; - case 0x1: - insn.name = "fmax.d"; - break; - default: - goto unknown; - } - PRINT_rd_rs1_rs2(); - } - case 0x20: - assert(RS2(data) == 1); - insn.name = "fcvt.s.d"; - PRINT_fd_fs1(); - case 0x21: - assert(RS2(data) == 0); - insn.name = "fcvt.d.s"; - PRINT_fd_fs1(); - case 0x2c: - assert(insn.rs2 == 0); - insn.name = "fsqrt.s"; - PRINT_fd_fs1(); - case 0x2d: - assert(insn.rs2 == 0); - insn.name = "fsqrt.d"; - PRINT_fd_fs1(); - case 0x50: { - uint32_t funct3 = FUNCT3(data); - - switch (funct3) { - case 0x0: - insn.name = "fle.s"; - break; - case 0x1: - insn.name = "flt.s"; - break; - case 0x2: - insn.name = "feq.s"; - break; - default: - goto unknown; - } - PRINT_rd_fs1_fs2(); - } - case 0x51: { - uint32_t funct3 = FUNCT3(data); - - switch (funct3) { - case 0x0: - insn.name = "fle.d"; - break; - case 0x1: - insn.name = "flt.d"; - break; - case 0x2: - insn.name = "feq.d"; - break; - default: - goto unknown; - } - PRINT_rd_fs1_fs2(); - } - case 0x60: { - uint32_t rs2 = RS2(data); - - switch (rs2) { - case 0x0: - insn.name = "fcvt.w.s"; - break; - case 0x1: - insn.name = "fcvt.wu.s"; - break; - case 0x2: - insn.name = "fcvt.l.s"; - break; - case 0x3: - insn.name = "fcvt.lu.s"; - break; - default: - goto unknown; - } - PRINT_xd_fs1(); - } - case 0x61: { - uint32_t rs2 = RS2(data); - - switch (rs2) { - case 0x0: - insn.name = "fcvt.w.d"; - break; - case 0x1: - insn.name = "fcvt.wu.d"; - break; - case 0x2: - insn.name = "fcvt.l.d"; - break; - case 0x3: - insn.name = "fcvt.lu.d"; - break; - default: - goto unknown; - } - PRINT_xd_fs1(); - } - case 0x68: { - uint32_t rs2 = RS2(data); - - switch (rs2) { - case 0x0: - insn.name = "fcvt.s.w"; - break; - case 0x1: - insn.name = "fcvt.s.wu"; - break; - case 0x2: - insn.name = "fcvt.s.l"; - break; - case 0x3: - insn.name = "fcvt.s.lu"; - break; - default: - goto unknown; - } - PRINT_fd_xs1(); - } - case 0x69: { - uint32_t rs2 = RS2(data); - - switch (rs2) { - case 0x0: - insn.name = "fcvt.d.w"; - break; - case 0x1: - insn.name = "fcvt.d.wu"; - break; - case 0x2: - insn.name = "fcvt.d.l"; - break; - case 0x3: - insn.name = "fcvt.d.lu"; - break; - default: - goto unknown; - } - PRINT_fd_xs1(); - } - case 0x70: { - assert(RS2(data) == 0); - uint32_t funct3 = FUNCT3(data); - - switch (funct3) { - case 0x0: - insn.name = "fmv.x.w"; - break; - case 0x1: - insn.name = "fclass.s"; - break; - default: - goto unknown; - } - PRINT_xd_fs1(); - } - case 0x71: { - assert(RS2(data) == 0); - uint32_t funct3 = FUNCT3(data); - - switch (funct3) { - case 0x0: - insn.name = "fmv.x.d"; - break; - case 0x1: - insn.name = "fclass.d"; - break; - default: - goto unknown; - } - PRINT_xd_fs1(); - } - case 0x78: - assert(RS2(data) == 0 && FUNCT3(data) == 0); - insn.name = "fmv.w.x"; - PRINT_fd_xs1(); - case 0x79: - assert(RS2(data) == 0 && FUNCT3(data) == 0); - insn.name = "fmv.d.x"; - PRINT_fd_xs1(); + + // rv_xtheadmemidx, TH.SURB + if ((opcode & 0xf800707f) == 0x1000500b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.SURB", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } + + // rv_xtheadmemidx, TH.SURD + if ((opcode & 0xf800707f) == 0x7000500b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.SURD", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } + + // rv_xtheadmemidx, TH.SURH + if ((opcode & 0xf800707f) == 0x3000500b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.SURH", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } + + // rv_xtheadmemidx, TH.SURW + if ((opcode & 0xf800707f) == 0x5000500b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.SURW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], a.imm2, a.imm2); + return buff; + } + + // rv_xtheadmempair, TH.SWD + if ((opcode & 0xf800707f) == 0xe000500b) { + a.rd = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, 0x%x(%d)", "TH.SWD", gpr[a.rd], gpr[a.rs2], gpr[a.rs1], a.imm2, a.imm2); + return buff; + } + + // rv_xtheadmemidx, TH.SWIB + if ((opcode & 0xf800707f) == 0x4800500b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + a.imm2 = FX(opcode, 26, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), 0x%x(%d)", "TH.SWIB", gpr[a.rd], gpr[a.rs1], a.imm, a.imm, a.imm2, a.imm2); + return buff; + } + + // rv_xtheadbs, TH.TST + if ((opcode & 0xfc00707f) == 0x8800100b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "TH.TST", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv_xtheadbb, TH.TSTNBZ + if ((opcode & 0xfff0707f) == 0x8000100b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "TH.TSTNBZ", gpr[a.rd], gpr[a.rs1]); + return buff; + } + } + + if (cpuext.xtheadvector) { + /* These are written by hand.... */ + + // rv_v, VSETVLI + if ((opcode & 0x8000707f) == 0x7057) { + a.imm = FX(opcode, 30, 20); + a.rs1 = FX(opcode, 19, 15); + a.rd = FX(opcode, 11, 7); + const char *lmul_str, *sew_str; + switch (a.imm & 0b11) { + case 0b00: lmul_str = "m1"; break; + case 0b01: lmul_str = "m2"; break; + case 0b10: lmul_str = "m4"; break; + case 0b11: lmul_str = "m8"; break; + default: lmul_str = "reserved"; break; } - default: - goto unknown; - } - case 0x18: { - insn = insn_btype_read(data); - - uint32_t funct3 = FUNCT3(data); - switch (funct3) { - case 0x0: - insn.name = "beq"; - break; - case 0x1: - insn.name = "bne"; - break; - case 0x4: - insn.name = "blt"; - break; - case 0x5: - insn.name = "bge"; - break; - case 0x6: - insn.name = "bltu"; - break; - case 0x7: - insn.name = "bgeu"; - break; - default: - goto unknown; + switch ((a.imm & 0b0011100) >> 2) { + case 0b000: sew_str = "e8"; break; + case 0b001: sew_str = "e16"; break; + case 0b010: sew_str = "e32"; break; + case 0b011: sew_str = "e64"; break; + default: sew_str = "reserved"; break; } - PRINT_rs1_rs2_imm_rel(); - } - case 0x19: { - insn = insn_itype_read(data); - insn.name = "jalr"; - PRINT_rd_imm_rs1(); - } - case 0x1b: { - insn = insn_jtype_read(data); - if (insn.rd != 0) { - insn.name = "jal"; - PRINT_rd_imm_rel(); - } else { - insn.name = "j"; - PRINT_imm_rel(); - } + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSETVLI", gpr[a.rd], gpr[a.rs1], sew_str, lmul_str); + return buff; } - case 0x1c: { - if (data == 0x73) { - insn.name = "ecall"; - PRINT_none(); - } - uint32_t funct3 = FUNCT3(data); - insn = insn_csrtype_read(data); - switch(funct3) { - case 0x1: - insn.name = "csrrw"; - PRINT_rd_csr_rs1(); - case 0x2: - insn.name = "csrrs"; - PRINT_rd_csr_rs1(); - case 0x3: - insn.name = "csrrc"; - PRINT_rd_csr_rs1(); - case 0x5: - insn.name = "csrrwi"; - PRINT_rd_csr_uimm(); - case 0x6: - insn.name = "csrrsi"; - PRINT_rd_csr_uimm(); - case 0x7: - insn.name = "csrrci"; - PRINT_rd_csr_uimm(); - } + // rv_v, VLUXEI16.V + if ((opcode & 0x1c00707f) == 0xC005007) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLUXEI16.V", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; } + + // rv_v, VLUXEI32.V + if ((opcode & 0x1c00707f) == 0xC006007) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLUXEI32.V", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; } - } - } -unknown: - snprintf(buff, sizeof(buff), "%08X ???", __builtin_bswap32(data)); + // rv_v, VLUXEI64.V + if ((opcode & 0x1c00707f) == 0xC007007) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLUXEI64.V", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLUXEI8.V + if ((opcode & 0x1c00707f) == 0xC000007) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLUXEI8.V", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSUXEI16.V + if ((opcode & 0x1c00707f) == 0x1C005027) { + a.vs3 = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSUXEI16.V", vpr[a.vs3], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSUXEI32.V + if ((opcode & 0x1c00707f) == 0x1C006027) { + a.vs3 = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSUXEI32.V", vpr[a.vs3], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSUXEI64.V + if ((opcode & 0x1c00707f) == 0x1C007027) { + a.vs3 = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSUXEI64.V", vpr[a.vs3], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSUXEI8.V + if ((opcode & 0x1c00707f) == 0x1C000027) { + a.vs3 = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSUXEI8.V", vpr[a.vs3], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VFMV.S.F + if ((opcode & 0xfff0707f) == 0x36005057) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFMV.S.F", vpr[a.vd], fpr[a.rs1]); + return buff; + } + + // rv_v, VFMV.F.S + if ((opcode & 0xfe0ff07f) == 0x32001057) { + a.rd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFMV.F.S", fpr[a.rd], vpr[a.vs2]); + return buff; + } + + // rv_v, VFCVT.F.X.V + if ((opcode & 0xfc0ff07f) == 0x88019057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCVT.F.X.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFCVT.F.XU.V + if ((opcode & 0xfc0ff07f) == 0x88011057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCVT.F.XU.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFCVT.RTZ.X.F.V + if ((opcode & 0xfc0ff07f) == 0x88039057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCVT.RTZ.X.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFCVT.RTZ.XU.F.V + if ((opcode & 0xfc0ff07f) == 0x88031057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCVT.RTZ.XU.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFCVT.X.F.V + if ((opcode & 0xfc0ff07f) == 0x88009057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCVT.X.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFCVT.XU.F.V + if ((opcode & 0xfc0ff07f) == 0x88001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCVT.XU.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.F.F.V + if ((opcode & 0xfc0ff07f) == 0x88061057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.F.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.F.X.V + if ((opcode & 0xfc0ff07f) == 0x88059057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.F.X.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.F.XU.V + if ((opcode & 0xfc0ff07f) == 0x88051057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.F.XU.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.RTZ.X.F.V + if ((opcode & 0xfc0ff07f) == 0x88079057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.RTZ.X.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.RTZ.XU.F.V + if ((opcode & 0xfc0ff07f) == 0x88071057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.RTZ.XU.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.X.F.V + if ((opcode & 0xfc0ff07f) == 0x88049057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.X.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.XU.F.V + if ((opcode & 0xfc0ff07f) == 0x88041057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.XU.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.F.F.W + if ((opcode & 0xfc0ff07f) == 0x880a1057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.F.F.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.F.X.W + if ((opcode & 0xfc0ff07f) == 0x88099057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.F.X.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.F.XU.W + if ((opcode & 0xfc0ff07f) == 0x88091057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.F.XU.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.ROD.F.F.W + if ((opcode & 0xfc0ff07f) == 0x880a9057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.ROD.F.F.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.RTZ.X.F.W + if ((opcode & 0xfc0ff07f) == 0x880b9057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.RTZ.X.F.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.RTZ.XU.F.W + if ((opcode & 0xfc0ff07f) == 0x880b1057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.RTZ.XU.F.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.X.F.W + if ((opcode & 0xfc0ff07f) == 0x88089057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.X.F.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.XU.F.W + if ((opcode & 0xfc0ff07f) == 0x88081057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.XU.F.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFSQRT.V + if ((opcode & 0xfc0ff07f) == 0x8c001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFSQRT.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFCLASS.V + if ((opcode & 0xfc0ff07f) == 0x8c081057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCLASS.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VADC.VIM + if ((opcode & 0xfe00707f) == 0x42003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "VADC.VIM", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5)); + return buff; + } + + // rv_v, VADC.VVM + if ((opcode & 0xfe00707f) == 0x42000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VADC.VVM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VADC.VXM + if ((opcode & 0xfe00707f) == 0x42004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VADC.VXM", vpr[a.vd], vpr[a.vs2], gpr[a.rs1]); + return buff; + } + + // rv_v, VSBC.VVM + if ((opcode & 0xfe00707f) == 0x4A000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VSBC.VVM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VSBC.VXM + if ((opcode & 0xfe00707f) == 0x4A004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VSBC.VXM", vpr[a.vd], vpr[a.vs2], gpr[a.rs1]); + return buff; + } + + // rv_v, VMV.X.S + if ((opcode & 0xfe0ff07f) == 0x32002057) { + a.rd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VMV.X.S", gpr[a.rd], vpr[a.vs2]); + return buff; + } + + // rv_v, VMV.S.X + if ((opcode & 0xfff0707f) == 0x36006057) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VMV.S.X", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VMSBF.M + if ((opcode & 0xfc0ff07f) == 0x5800a057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMSBF.M", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VMSOF.M + if ((opcode & 0xfc0ff07f) == 0x58012057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMSOF.M", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VMSIF.M + if ((opcode & 0xfc0ff07f) == 0x5801a057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMSIF.M", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VIOTA.M + if ((opcode & 0xfc0ff07f) == 0x58082057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VIOTA.M", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VCPOP.M + if ((opcode & 0xfc0ff07f) == 0x58082057) { + a.rd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VCPOP.M", gpr[a.rd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFIRST.M + if ((opcode & 0xfc0ff07f) == 0x5808a057) { + a.rd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFIRST.M", fpr[a.rd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VEXT.X.V + if ((opcode & 0xfe00707f) == 0x32002057) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VEXT.X.V", vpr[a.rd], vpr[a.vs2], gpr[a.rs1]); + return buff; + } + } + + /**************** + * Hand-written pseudo instructions' printer + */ + + // NOP + if (opcode == 0x00000013) { + snprintf(buff, sizeof(buff), "%-15s", "NOP"); + return buff; + } + + // MV + if ((opcode & 0xfff0707f) == 0x00000013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "MV", gpr[a.rd], gpr[a.rs1]); + return buff; + } + + // FMV.D + if ((opcode & 0xfe00707f) == 0x22000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + if (a.rs1 == a.rs2) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FMV.D", fpr[a.rd], fpr[a.rs1]); + return buff; + } + } + + // FMV.S + if ((opcode & 0xfe00707f) == 0x20000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + if (a.rs1 == a.rs2) { + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FMV.S", fpr[a.rd], fpr[a.rs1]); + return buff; + } + } + + /**************** + * Generated by https://github.com/ksco/riscv-opcodes/tree/box64_printer + * Command: python parse.py -box64 rv_a rv_d rv_f rv_i rv_m rv_v rv_zba rv_zbb rv_zbc rv_zicsr rv_zbs rv64_a rv64_d rv64_f rv64_i rv64_m rv64_zba rv64_zbb rv64_zbs > code.c + * Please do NOT edit the following code manually. + */ + + // rv_i, ADD + if ((opcode & 0xfe00707f) == 0x33) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ADD", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_zba, ADD.UW + if ((opcode & 0xfe00707f) == 0x800003b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ADD.UW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, ADDI + if ((opcode & 0x707f) == 0x13) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "ADDI", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv64_i, ADDIW + if ((opcode & 0x707f) == 0x1b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "ADDIW", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv64_i, ADDW + if ((opcode & 0xfe00707f) == 0x3b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ADDW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_a, AMOADD.D + if ((opcode & 0xf800707f) == 0x302f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOADD.D", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_a, AMOADD.W + if ((opcode & 0xf800707f) == 0x202f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOADD.W", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv64_a, AMOAND.D + if ((opcode & 0xf800707f) == 0x6000302f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOAND.D", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_a, AMOAND.W + if ((opcode & 0xf800707f) == 0x6000202f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOAND.W", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv64_a, AMOMAX.D + if ((opcode & 0xf800707f) == 0xa000302f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOMAX.D", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_a, AMOMAX.W + if ((opcode & 0xf800707f) == 0xa000202f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOMAX.W", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv64_a, AMOMAXU.D + if ((opcode & 0xf800707f) == 0xe000302f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOMAXU.D", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_a, AMOMAXU.W + if ((opcode & 0xf800707f) == 0xe000202f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOMAXU.W", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv64_a, AMOMIN.D + if ((opcode & 0xf800707f) == 0x8000302f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOMIN.D", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_a, AMOMIN.W + if ((opcode & 0xf800707f) == 0x8000202f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOMIN.W", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv64_a, AMOMINU.D + if ((opcode & 0xf800707f) == 0xc000302f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOMINU.D", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_a, AMOMINU.W + if ((opcode & 0xf800707f) == 0xc000202f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOMINU.W", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv64_a, AMOOR.D + if ((opcode & 0xf800707f) == 0x4000302f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOOR.D", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_a, AMOOR.W + if ((opcode & 0xf800707f) == 0x4000202f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOOR.W", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv64_a, AMOSWAP.D + if ((opcode & 0xf800707f) == 0x800302f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOSWAP.D", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_a, AMOSWAP.W + if ((opcode & 0xf800707f) == 0x800202f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOSWAP.W", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv64_a, AMOXOR.D + if ((opcode & 0xf800707f) == 0x2000302f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOXOR.D", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_a, AMOXOR.W + if ((opcode & 0xf800707f) == 0x2000202f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "AMOXOR.W", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_i, AND + if ((opcode & 0xfe00707f) == 0x7033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "AND", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, ANDI + if ((opcode & 0x707f) == 0x7013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "ANDI", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv_zbb, ANDN + if ((opcode & 0xfe00707f) == 0x40007033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ANDN", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, AUIPC + if ((opcode & 0x7f) == 0x17) { + a.rd = FX(opcode, 11, 7); + a.imm = FX(opcode, 31, 12); + snprintf(buff, sizeof(buff), "%-15s %s, 0x%x(%d)", "AUIPC", gpr[a.rd], a.imm << 12, a.imm << 12); + return buff; + } + + // rv_zbs, BCLR + if ((opcode & 0xfe00707f) == 0x48001033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "BCLR", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_zbs, BCLRI + if ((opcode & 0xfc00707f) == 0x48001013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "BCLRI", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv_i, BEQ + if ((opcode & 0x707f) == 0x63) { + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm = BX(opcode, 31) << 12; + a.imm |= BX(opcode, 7) << 11; + a.imm |= FX(opcode, 30, 25) << 5; + a.imm |= FX(opcode, 11, 8) << 1; + a.imm = SIGN_EXTEND(a.imm, 13); + + int len = snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "BEQ", gpr[a.rs1], gpr[a.rs2], a.imm, a.imm); + snprintf(buff + len, sizeof(buff) - len, " # %+di(0x%lx)", a.imm >> 2, addr + (uintptr_t)a.imm); + return buff; + } + + // rv_zbs, BEXT + if ((opcode & 0xfe00707f) == 0x48005033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "BEXT", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_zbs, BEXTI + if ((opcode & 0xfc00707f) == 0x48005013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "BEXTI", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv_i, BGE + if ((opcode & 0x707f) == 0x5063) { + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm = BX(opcode, 31) << 12; + a.imm |= BX(opcode, 7) << 11; + a.imm |= FX(opcode, 30, 25) << 5; + a.imm |= FX(opcode, 11, 8) << 1; + a.imm = SIGN_EXTEND(a.imm, 13); + + int len = snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "BGE", gpr[a.rs1], gpr[a.rs2], a.imm, a.imm); + snprintf(buff + len, sizeof(buff) - len, " # %+di(0x%lx)", a.imm >> 2, addr + (uintptr_t)a.imm); + return buff; + } + + // rv_i, BGEU + if ((opcode & 0x707f) == 0x7063) { + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm = BX(opcode, 31) << 12; + a.imm |= BX(opcode, 7) << 11; + a.imm |= FX(opcode, 30, 25) << 5; + a.imm |= FX(opcode, 11, 8) << 1; + a.imm = SIGN_EXTEND(a.imm, 13); + + int len = snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "BGEU", gpr[a.rs1], gpr[a.rs2], a.imm, a.imm); + snprintf(buff + len, sizeof(buff) - len, " # %+di(0x%lx)", a.imm >> 2, addr + (uintptr_t)a.imm); + return buff; + } + + // rv_zbs, BINV + if ((opcode & 0xfe00707f) == 0x68001033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "BINV", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_zbs, BINVI + if ((opcode & 0xfc00707f) == 0x68001013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "BINVI", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv_i, BLT + if ((opcode & 0x707f) == 0x4063) { + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm = BX(opcode, 31) << 12; + a.imm |= BX(opcode, 7) << 11; + a.imm |= FX(opcode, 30, 25) << 5; + a.imm |= FX(opcode, 11, 8) << 1; + a.imm = SIGN_EXTEND(a.imm, 13); + + int len = snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "BLT", gpr[a.rs1], gpr[a.rs2], a.imm, a.imm); + snprintf(buff + len, sizeof(buff) - len, " # %+di(0x%lx)", a.imm >> 2, addr + (uintptr_t)a.imm); + return buff; + } + + // rv_i, BLTU + if ((opcode & 0x707f) == 0x6063) { + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm = BX(opcode, 31) << 12; + a.imm |= BX(opcode, 7) << 11; + a.imm |= FX(opcode, 30, 25) << 5; + a.imm |= FX(opcode, 11, 8) << 1; + a.imm = SIGN_EXTEND(a.imm, 13); + + int len = snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "BLTU", gpr[a.rs1], gpr[a.rs2], a.imm, a.imm); + snprintf(buff + len, sizeof(buff) - len, " # %+di(0x%lx)", a.imm >> 2, addr + (uintptr_t)a.imm); + return buff; + } + + // rv_i, BNE + if ((opcode & 0x707f) == 0x1063) { + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.imm = BX(opcode, 31) << 12; + a.imm |= BX(opcode, 7) << 11; + a.imm |= FX(opcode, 30, 25) << 5; + a.imm |= FX(opcode, 11, 8) << 1; + a.imm = SIGN_EXTEND(a.imm, 13); + + int len = snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "BNE", gpr[a.rs1], gpr[a.rs2], a.imm, a.imm); + snprintf(buff + len, sizeof(buff) - len, " # %+di(0x%lx)", a.imm >> 2, addr + (uintptr_t)a.imm); + return buff; + } + + // rv_zbs, BSET + if ((opcode & 0xfe00707f) == 0x28001033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "BSET", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_zbs, BSETI + if ((opcode & 0xfc00707f) == 0x28001013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "BSETI", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv_zbc, CLMUL + if ((opcode & 0xfe00707f) == 0xa001033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "CLMUL", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_zbc, CLMULH + if ((opcode & 0xfe00707f) == 0xa003033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "CLMULH", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_zbc, CLMULR + if ((opcode & 0xfe00707f) == 0xa002033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "CLMULR", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_zbb, CLZ + if ((opcode & 0xfff0707f) == 0x60001013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "CLZ", gpr[a.rd], gpr[a.rs1]); + return buff; + } + + // rv64_zbb, CLZW + if ((opcode & 0xfff0707f) == 0x6000101b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "CLZW", gpr[a.rd], gpr[a.rs1]); + return buff; + } + + // rv_zbb, CPOP + if ((opcode & 0xfff0707f) == 0x60201013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "CPOP", gpr[a.rd], gpr[a.rs1]); + return buff; + } + + // rv64_zbb, CPOPW + if ((opcode & 0xfff0707f) == 0x6020101b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "CPOPW", gpr[a.rd], gpr[a.rs1]); + return buff; + } + + // rv_zicsr, CSRRC + if ((opcode & 0x707f) == 0x3073) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.csr = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "CSRRC", gpr[a.rd], gpr[a.rs1], a.csr, a.csr); + return buff; + } + + // rv_zicsr, CSRRCI + if ((opcode & 0x707f) == 0x7073) { + a.rd = FX(opcode, 11, 7); + a.csr = FX(opcode, 31, 20); + a.imm = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, 0x%x(%d), 0x%x(%d)", "CSRRCI", gpr[a.rd], a.csr, a.csr, a.imm, a.imm); + return buff; + } + + // rv_zicsr, CSRRS + if ((opcode & 0x707f) == 0x2073) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.csr = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "CSRRS", gpr[a.rd], gpr[a.rs1], a.csr, a.csr); + return buff; + } + + // rv_zicsr, CSRRSI + if ((opcode & 0x707f) == 0x6073) { + a.rd = FX(opcode, 11, 7); + a.csr = FX(opcode, 31, 20); + a.imm = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, 0x%x(%d), 0x%x(%d)", "CSRRSI", gpr[a.rd], a.csr, a.csr, a.imm, a.imm); + return buff; + } + + // rv_zicsr, CSRRW + if ((opcode & 0x707f) == 0x1073) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.csr = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "CSRRW", gpr[a.rd], gpr[a.rs1], a.csr, a.csr); + return buff; + } + + // rv_zicsr, CSRRWI + if ((opcode & 0x707f) == 0x5073) { + a.rd = FX(opcode, 11, 7); + a.csr = FX(opcode, 31, 20); + a.imm = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, 0x%x(%d), 0x%x(%d)", "CSRRWI", gpr[a.rd], a.csr, a.csr, a.imm, a.imm); + return buff; + } + + // rv_zbb, CTZ + if ((opcode & 0xfff0707f) == 0x60101013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "CTZ", gpr[a.rd], gpr[a.rs1]); + return buff; + } + + // rv64_zbb, CTZW + if ((opcode & 0xfff0707f) == 0x6010101b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "CTZW", gpr[a.rd], gpr[a.rs1]); + return buff; + } + + // rv_m, DIV + if ((opcode & 0xfe00707f) == 0x2004033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "DIV", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_m, DIVU + if ((opcode & 0xfe00707f) == 0x2005033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "DIVU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_m, DIVUW + if ((opcode & 0xfe00707f) == 0x200503b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "DIVUW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_m, DIVW + if ((opcode & 0xfe00707f) == 0x200403b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "DIVW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, EBREAK + if ((opcode & 0xffffffff) == 0x100073) { + + snprintf(buff, sizeof(buff), "%-15s ", "EBREAK"); + return buff; + } + + // rv_i, ECALL + if ((opcode & 0xffffffff) == 0x73) { + + snprintf(buff, sizeof(buff), "%-15s ", "ECALL"); + return buff; + } + + // rv_d, FADD.D + if ((opcode & 0xfe00007f) == 0x2000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "FADD.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], rm[a.rm]); + return buff; + } + + // rv_f, FADD.S + if ((opcode & 0xfe00007f) == 0x53) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "FADD.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], rm[a.rm]); + return buff; + } + + // rv_d, FCLASS.D + if ((opcode & 0xfff0707f) == 0xe2001053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FCLASS.D", gpr[a.rd], fpr[a.rs1]); + return buff; + } + + // rv_f, FCLASS.S + if ((opcode & 0xfff0707f) == 0xe0001053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FCLASS.S", gpr[a.rd], fpr[a.rs1]); + return buff; + } + + // rv64_d, FCVT.D.L + if ((opcode & 0xfff0007f) == 0xd2200053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.D.L", fpr[a.rd], gpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv64_d, FCVT.D.LU + if ((opcode & 0xfff0007f) == 0xd2300053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.D.LU", fpr[a.rd], gpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_d, FCVT.D.S + if ((opcode & 0xfff0007f) == 0x42000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.D.S", fpr[a.rd], fpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_d, FCVT.D.W + if ((opcode & 0xfff0007f) == 0xd2000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.D.W", fpr[a.rd], gpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_d, FCVT.D.WU + if ((opcode & 0xfff0007f) == 0xd2100053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.D.WU", fpr[a.rd], gpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv64_d, FCVT.L.D + if ((opcode & 0xfff0007f) == 0xc2200053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.L.D", gpr[a.rd], fpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv64_f, FCVT.L.S + if ((opcode & 0xfff0007f) == 0xc0200053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.L.S", gpr[a.rd], fpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv64_d, FCVT.LU.D + if ((opcode & 0xfff0007f) == 0xc2300053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.LU.D", gpr[a.rd], fpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv64_f, FCVT.LU.S + if ((opcode & 0xfff0007f) == 0xc0300053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.LU.S", gpr[a.rd], fpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_d, FCVT.S.D + if ((opcode & 0xfff0007f) == 0x40100053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.S.D", fpr[a.rd], fpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv64_f, FCVT.S.L + if ((opcode & 0xfff0007f) == 0xd0200053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.S.L", fpr[a.rd], gpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv64_f, FCVT.S.LU + if ((opcode & 0xfff0007f) == 0xd0300053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.S.LU", fpr[a.rd], gpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_f, FCVT.S.W + if ((opcode & 0xfff0007f) == 0xd0000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.S.W", fpr[a.rd], gpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_f, FCVT.S.WU + if ((opcode & 0xfff0007f) == 0xd0100053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.S.WU", fpr[a.rd], gpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_d, FCVT.W.D + if ((opcode & 0xfff0007f) == 0xc2000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.W.D", gpr[a.rd], fpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_f, FCVT.W.S + if ((opcode & 0xfff0007f) == 0xc0000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.W.S", gpr[a.rd], fpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_d, FCVT.WU.D + if ((opcode & 0xfff0007f) == 0xc2100053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.WU.D", gpr[a.rd], fpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_f, FCVT.WU.S + if ((opcode & 0xfff0007f) == 0xc0100053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FCVT.WU.S", gpr[a.rd], fpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_d, FDIV.D + if ((opcode & 0xfe00007f) == 0x1a000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "FDIV.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], rm[a.rm]); + return buff; + } + + // rv_f, FDIV.S + if ((opcode & 0xfe00007f) == 0x18000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "FDIV.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], rm[a.rm]); + return buff; + } + + // rv_i, FENCE + if ((opcode & 0x707f) == 0xf) { + snprintf(buff, sizeof(buff), "%-15s", "FENCE"); + return buff; + } + + // rv_d, FEQ.D + if ((opcode & 0xfe00707f) == 0xa2002053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FEQ.D", gpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_f, FEQ.S + if ((opcode & 0xfe00707f) == 0xa0002053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FEQ.S", gpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_d, FLD + if ((opcode & 0x707f) == 0x3007) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "FLD", fpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv_d, FLE.D + if ((opcode & 0xfe00707f) == 0xa2000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FLE.D", gpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_f, FLE.S + if ((opcode & 0xfe00707f) == 0xa0000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FLE.S", gpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_d, FLT.D + if ((opcode & 0xfe00707f) == 0xa2001053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FLT.D", gpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_f, FLT.S + if ((opcode & 0xfe00707f) == 0xa0001053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FLT.S", gpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_f, FLW + if ((opcode & 0x707f) == 0x2007) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "FLW", fpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv_d, FMADD.D + if ((opcode & 0x600007f) == 0x2000043) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rs3 = FX(opcode, 31, 27); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "FMADD.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], fpr[a.rs3], rm[a.rm]); + return buff; + } + + // rv_f, FMADD.S + if ((opcode & 0x600007f) == 0x43) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rs3 = FX(opcode, 31, 27); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "FMADD.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], fpr[a.rs3], rm[a.rm]); + return buff; + } + + // rv_d, FMAX.D + if ((opcode & 0xfe00707f) == 0x2a001053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FMAX.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_f, FMAX.S + if ((opcode & 0xfe00707f) == 0x28001053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FMAX.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_d, FMIN.D + if ((opcode & 0xfe00707f) == 0x2a000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FMIN.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_f, FMIN.S + if ((opcode & 0xfe00707f) == 0x28000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FMIN.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_d, FMSUB.D + if ((opcode & 0x600007f) == 0x2000047) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rs3 = FX(opcode, 31, 27); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "FMSUB.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], fpr[a.rs3], rm[a.rm]); + return buff; + } + + // rv_f, FMSUB.S + if ((opcode & 0x600007f) == 0x47) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rs3 = FX(opcode, 31, 27); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "FMSUB.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], fpr[a.rs3], rm[a.rm]); + return buff; + } + + // rv_d, FMUL.D + if ((opcode & 0xfe00007f) == 0x12000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "FMUL.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], rm[a.rm]); + return buff; + } + + // rv_f, FMUL.S + if ((opcode & 0xfe00007f) == 0x10000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "FMUL.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], rm[a.rm]); + return buff; + } + + // rv64_d, FMV.D.X + if ((opcode & 0xfff0707f) == 0xf2000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FMV.D.X", fpr[a.rd], gpr[a.rs1]); + return buff; + } + + // rv_f, FMV.W.X + if ((opcode & 0xfff0707f) == 0xf0000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FMV.W.X", fpr[a.rd], gpr[a.rs1]); + return buff; + } + + // rv64_d, FMV.X.D + if ((opcode & 0xfff0707f) == 0xe2000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FMV.X.D", gpr[a.rd], fpr[a.rs1]); + return buff; + } + + // rv_f, FMV.X.W + if ((opcode & 0xfff0707f) == 0xe0000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "FMV.X.W", gpr[a.rd], fpr[a.rs1]); + return buff; + } + + // rv_d, FNMADD.D + if ((opcode & 0x600007f) == 0x200004f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rs3 = FX(opcode, 31, 27); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "FNMADD.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], fpr[a.rs3], rm[a.rm]); + return buff; + } + + // rv_f, FNMADD.S + if ((opcode & 0x600007f) == 0x4f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rs3 = FX(opcode, 31, 27); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "FNMADD.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], fpr[a.rs3], rm[a.rm]); + return buff; + } + + // rv_d, FNMSUB.D + if ((opcode & 0x600007f) == 0x200004b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rs3 = FX(opcode, 31, 27); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "FNMSUB.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], fpr[a.rs3], rm[a.rm]); + return buff; + } + + // rv_f, FNMSUB.S + if ((opcode & 0x600007f) == 0x4b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rs3 = FX(opcode, 31, 27); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "FNMSUB.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], fpr[a.rs3], rm[a.rm]); + return buff; + } + + // rv_d, FSD + if ((opcode & 0x707f) == 0x3027) { + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.imm = (FX(opcode, 31, 25) << 5) | (FX(opcode, 11, 7)); + a.imm = SIGN_EXTEND(a.imm, 12); + + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "FSD", fpr[a.rs2], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv_d, FSGNJ.D + if ((opcode & 0xfe00707f) == 0x22000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSGNJ.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_f, FSGNJ.S + if ((opcode & 0xfe00707f) == 0x20000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSGNJ.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_d, FSGNJN.D + if ((opcode & 0xfe00707f) == 0x22001053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSGNJN.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_f, FSGNJN.S + if ((opcode & 0xfe00707f) == 0x20001053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSGNJN.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_d, FSGNJX.D + if ((opcode & 0xfe00707f) == 0x22002053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSGNJX.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_f, FSGNJX.S + if ((opcode & 0xfe00707f) == 0x20002053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSGNJX.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2]); + return buff; + } + + // rv_d, FSQRT.D + if ((opcode & 0xfff0007f) == 0x5a000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSQRT.D", fpr[a.rd], fpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_f, FSQRT.S + if ((opcode & 0xfff0007f) == 0x58000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "FSQRT.S", fpr[a.rd], fpr[a.rs1], rm[a.rm]); + return buff; + } + + // rv_d, FSUB.D + if ((opcode & 0xfe00007f) == 0xa000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "FSUB.D", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], rm[a.rm]); + return buff; + } + + // rv_f, FSUB.S + if ((opcode & 0xfe00007f) == 0x8000053) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.rm = FX(opcode, 14, 12); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "FSUB.S", fpr[a.rd], fpr[a.rs1], fpr[a.rs2], rm[a.rm]); + return buff; + } + + // rv_f, FSW + if ((opcode & 0x707f) == 0x2027) { + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.imm = (FX(opcode, 31, 25) << 5) | (FX(opcode, 11, 7)); + a.imm = SIGN_EXTEND(a.imm, 12); + + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "FSW", fpr[a.rs2], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv_i, JAL + if ((opcode & 0x7f) == 0x6f) { + a.rd = FX(opcode, 11, 7); + a.imm = BX(opcode, 31) << 20; + a.imm |= FX(opcode, 19, 12) << 12; + a.imm |= BX(opcode, 20) << 11; + a.imm |= FX(opcode, 30, 21) << 1; + a.imm = SIGN_EXTEND(a.imm, 21); + + int len = snprintf(buff, sizeof(buff), "%-15s %s, 0x%x(%d)", "JAL", gpr[a.rd], a.imm, a.imm); + snprintf(buff + len, sizeof(buff) - len, " # %+di(0x%lx)", a.imm >> 2, addr + (uintptr_t)a.imm); + return buff; + } + + // rv_i, JALR + if ((opcode & 0x707f) == 0x67) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "JALR", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv_i, LB + if ((opcode & 0x707f) == 0x3) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "LB", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv_i, LBU + if ((opcode & 0x707f) == 0x4003) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "LBU", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv64_i, LD + if ((opcode & 0x707f) == 0x3003) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "LD", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv_i, LH + if ((opcode & 0x707f) == 0x1003) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "LH", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv_i, LHU + if ((opcode & 0x707f) == 0x5003) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "LHU", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv64_a, LR.D + if ((opcode & 0xf9f0707f) == 0x1000302f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "LR.D", gpr[a.rd], gpr[a.rs1], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_a, LR.W + if ((opcode & 0xf9f0707f) == 0x1000202f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "LR.W", gpr[a.rd], gpr[a.rs1], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_i, LUI + if ((opcode & 0x7f) == 0x37) { + a.rd = FX(opcode, 11, 7); + a.imm = FX(opcode, 31, 12); + snprintf(buff, sizeof(buff), "%-15s %s, 0x%x(%d)", "LUI", gpr[a.rd], a.imm << 12, a.imm << 12); + return buff; + } + + // rv_i, LW + if ((opcode & 0x707f) == 0x2003) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "LW", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv64_i, LWU + if ((opcode & 0x707f) == 0x6003) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "LWU", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv_zbb, MAX + if ((opcode & 0xfe00707f) == 0xa006033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "MAX", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_zbb, MAXU + if ((opcode & 0xfe00707f) == 0xa007033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "MAXU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_zbb, MIN + if ((opcode & 0xfe00707f) == 0xa004033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "MIN", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_zbb, MINU + if ((opcode & 0xfe00707f) == 0xa005033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "MINU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_m, MUL + if ((opcode & 0xfe00707f) == 0x2000033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "MUL", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_m, MULH + if ((opcode & 0xfe00707f) == 0x2001033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "MULH", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_m, MULHSU + if ((opcode & 0xfe00707f) == 0x2002033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "MULHSU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_m, MULHU + if ((opcode & 0xfe00707f) == 0x2003033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "MULHU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_m, MULW + if ((opcode & 0xfe00707f) == 0x200003b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "MULW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, OR + if ((opcode & 0xfe00707f) == 0x6033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "OR", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_zbb, ORC.B + if ((opcode & 0xfff0707f) == 0x28705013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "ORC.B", gpr[a.rd], gpr[a.rs1]); + return buff; + } + + // rv_i, ORI + if ((opcode & 0x707f) == 0x6013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "ORI", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv_zbb, ORN + if ((opcode & 0xfe00707f) == 0x40006033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ORN", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_m, REM + if ((opcode & 0xfe00707f) == 0x2006033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "REM", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_m, REMU + if ((opcode & 0xfe00707f) == 0x2007033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "REMU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_m, REMUW + if ((opcode & 0xfe00707f) == 0x200703b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "REMUW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_m, REMW + if ((opcode & 0xfe00707f) == 0x200603b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "REMW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_zbb, REV8 + if ((opcode & 0xfff0707f) == 0x6b805013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "REV8", gpr[a.rd], gpr[a.rs1]); + return buff; + } + + // rv_zbb, ROL + if ((opcode & 0xfe00707f) == 0x60001033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ROL", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_zbb, ROLW + if ((opcode & 0xfe00707f) == 0x6000103b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ROLW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_zbb, ROR + if ((opcode & 0xfe00707f) == 0x60005033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "ROR", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_zbb, RORI + if ((opcode & 0xfc00707f) == 0x60005013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "RORI", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv64_zbb, RORIW + if ((opcode & 0xfe00707f) == 0x6000501b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "RORIW", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv64_zbb, RORW + if ((opcode & 0xfe00707f) == 0x6000503b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "RORW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, SB + if ((opcode & 0x707f) == 0x23) { + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.imm = (FX(opcode, 31, 25) << 5) | (FX(opcode, 11, 7)); + a.imm = SIGN_EXTEND(a.imm, 12); + + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SB", gpr[a.rs2], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv64_a, SC.D + if ((opcode & 0xf800707f) == 0x1800302f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "SC.D", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv_a, SC.W + if ((opcode & 0xf800707f) == 0x1800202f) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + a.aq = FX(opcode, 26, 26); + a.rl = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "SC.W", gpr[a.rd], gpr[a.rs1], gpr[a.rs2], aq[a.aq], rl[a.rl]); + return buff; + } + + // rv64_i, SD + if ((opcode & 0x707f) == 0x3023) { + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.imm = (FX(opcode, 31, 25) << 5) | (FX(opcode, 11, 7)); + a.imm = SIGN_EXTEND(a.imm, 12); + + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SD", gpr[a.rs2], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv_zbb, SEXT.B + if ((opcode & 0xfff0707f) == 0x60401013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "SEXT.B", gpr[a.rd], gpr[a.rs1]); + return buff; + } + + // rv_zbb, SEXT.H + if ((opcode & 0xfff0707f) == 0x60501013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "SEXT.H", gpr[a.rd], gpr[a.rs1]); + return buff; + } + + // rv_i, SH + if ((opcode & 0x707f) == 0x1023) { + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.imm = (FX(opcode, 31, 25) << 5) | (FX(opcode, 11, 7)); + a.imm = SIGN_EXTEND(a.imm, 12); + + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SH", gpr[a.rs2], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv_zba, SH1ADD + if ((opcode & 0xfe00707f) == 0x20002033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SH1ADD", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_zba, SH1ADD.UW + if ((opcode & 0xfe00707f) == 0x2000203b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SH1ADD.UW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_zba, SH2ADD + if ((opcode & 0xfe00707f) == 0x20004033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SH2ADD", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_zba, SH2ADD.UW + if ((opcode & 0xfe00707f) == 0x2000403b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SH2ADD.UW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_zba, SH3ADD + if ((opcode & 0xfe00707f) == 0x20006033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SH3ADD", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_zba, SH3ADD.UW + if ((opcode & 0xfe00707f) == 0x2000603b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SH3ADD.UW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, SLL + if ((opcode & 0xfe00707f) == 0x1033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SLL", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_i, SLLI + if ((opcode & 0xfc00707f) == 0x1013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SLLI", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv64_zba, SLLI.UW + if ((opcode & 0xfc00707f) == 0x800101b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SLLI.UW", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv64_i, SLLIW + if ((opcode & 0xfe00707f) == 0x101b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SLLIW", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv64_i, SLLW + if ((opcode & 0xfe00707f) == 0x103b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SLLW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, SLT + if ((opcode & 0xfe00707f) == 0x2033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SLT", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, SLTI + if ((opcode & 0x707f) == 0x2013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SLTI", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv_i, SLTIU + if ((opcode & 0x707f) == 0x3013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SLTIU", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv_i, SLTU + if ((opcode & 0xfe00707f) == 0x3033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SLTU", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, SRA + if ((opcode & 0xfe00707f) == 0x40005033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SRA", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_i, SRAI + if ((opcode & 0xfc00707f) == 0x40005013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SRAI", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv64_i, SRAIW + if ((opcode & 0xfe00707f) == 0x4000501b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SRAIW", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv64_i, SRAW + if ((opcode & 0xfe00707f) == 0x4000503b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SRAW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, SRL + if ((opcode & 0xfe00707f) == 0x5033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SRL", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_i, SRLI + if ((opcode & 0xfc00707f) == 0x5013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 25, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SRLI", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv64_i, SRLIW + if ((opcode & 0xfe00707f) == 0x501b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SRLIW", gpr[a.rd], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv64_i, SRLW + if ((opcode & 0xfe00707f) == 0x503b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SRLW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, SUB + if ((opcode & 0xfe00707f) == 0x40000033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SUB", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv64_i, SUBW + if ((opcode & 0xfe00707f) == 0x4000003b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "SUBW", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, SW + if ((opcode & 0x707f) == 0x2023) { + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.imm = (FX(opcode, 31, 25) << 5) | (FX(opcode, 11, 7)); + a.imm = SIGN_EXTEND(a.imm, 12); + + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "SW", gpr[a.rs2], gpr[a.rs1], a.imm, a.imm); + return buff; + } + + // rv_v, VAADD.VV + if ((opcode & 0xfc00707f) == 0x24002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VAADD.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VAADD.VX + if ((opcode & 0xfc00707f) == 0x24006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VAADD.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VAADDU.VV + if ((opcode & 0xfc00707f) == 0x20002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VAADDU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VAADDU.VX + if ((opcode & 0xfc00707f) == 0x20006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VAADDU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VADC.VIM + if ((opcode & 0xfe00707f) == 0x40003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "VADC.VIM", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5)); + return buff; + } + + // rv_v, VADC.VVM + if ((opcode & 0xfe00707f) == 0x40000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VADC.VVM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VADC.VXM + if ((opcode & 0xfe00707f) == 0x40004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VADC.VXM", vpr[a.vd], vpr[a.vs2], gpr[a.rs1]); + return buff; + } + + // rv_v, VADD.VI + if ((opcode & 0xfc00707f) == 0x3057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VADD.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VADD.VV + if ((opcode & 0xfc00707f) == 0x57) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VADD.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VADD.VX + if ((opcode & 0xfc00707f) == 0x4057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VADD.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VAND.VI + if ((opcode & 0xfc00707f) == 0x24003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VAND.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VAND.VV + if ((opcode & 0xfc00707f) == 0x24000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VAND.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VAND.VX + if ((opcode & 0xfc00707f) == 0x24004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VAND.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VASUB.VV + if ((opcode & 0xfc00707f) == 0x2c002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VASUB.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VASUB.VX + if ((opcode & 0xfc00707f) == 0x2c006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VASUB.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VASUBU.VV + if ((opcode & 0xfc00707f) == 0x28002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VASUBU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VASUBU.VX + if ((opcode & 0xfc00707f) == 0x28006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VASUBU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VCOMPRESS.VM + if ((opcode & 0xfe00707f) == 0x5e002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VCOMPRESS.VM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VCPOP.M + if ((opcode & 0xfc0ff07f) == 0x40082057) { + a.rd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VCPOP.M", gpr[a.rd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VDIV.VV + if ((opcode & 0xfc00707f) == 0x84002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VDIV.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VDIV.VX + if ((opcode & 0xfc00707f) == 0x84006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VDIV.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VDIVU.VV + if ((opcode & 0xfc00707f) == 0x80002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VDIVU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VDIVU.VX + if ((opcode & 0xfc00707f) == 0x80006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VDIVU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFADD.VF + if ((opcode & 0xfc00707f) == 0x5057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFADD.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFADD.VV + if ((opcode & 0xfc00707f) == 0x1057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFADD.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFCLASS.V + if ((opcode & 0xfc0ff07f) == 0x4c081057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCLASS.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFCVT.F.X.V + if ((opcode & 0xfc0ff07f) == 0x48019057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCVT.F.X.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFCVT.F.XU.V + if ((opcode & 0xfc0ff07f) == 0x48011057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCVT.F.XU.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFCVT.RTZ.X.F.V + if ((opcode & 0xfc0ff07f) == 0x48039057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCVT.RTZ.X.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFCVT.RTZ.XU.F.V + if ((opcode & 0xfc0ff07f) == 0x48031057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCVT.RTZ.XU.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFCVT.X.F.V + if ((opcode & 0xfc0ff07f) == 0x48009057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCVT.X.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFCVT.XU.F.V + if ((opcode & 0xfc0ff07f) == 0x48001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFCVT.XU.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFDIV.VF + if ((opcode & 0xfc00707f) == 0x80005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFDIV.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFDIV.VV + if ((opcode & 0xfc00707f) == 0x80001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFDIV.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFIRST.M + if ((opcode & 0xfc0ff07f) == 0x4008a057) { + a.rd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFIRST.M", fpr[a.rd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFMACC.VF + if ((opcode & 0xfc00707f) == 0xb0005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMACC.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMACC.VV + if ((opcode & 0xfc00707f) == 0xb0001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMACC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMADD.VF + if ((opcode & 0xfc00707f) == 0xa0005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMADD.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMADD.VV + if ((opcode & 0xfc00707f) == 0xa0001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMADD.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMAX.VF + if ((opcode & 0xfc00707f) == 0x18005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMAX.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMAX.VV + if ((opcode & 0xfc00707f) == 0x18001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMAX.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMERGE.VFM + if ((opcode & 0xfe00707f) == 0x5c005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFMERGE.VFM", vpr[a.vd], vpr[a.vs2], fpr[a.rs1]); + return buff; + } + + // rv_v, VFMIN.VF + if ((opcode & 0xfc00707f) == 0x10005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMIN.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMIN.VV + if ((opcode & 0xfc00707f) == 0x10001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMIN.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMSAC.VF + if ((opcode & 0xfc00707f) == 0xb8005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMSAC.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMSAC.VV + if ((opcode & 0xfc00707f) == 0xb8001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMSAC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMSUB.VF + if ((opcode & 0xfc00707f) == 0xa8005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMSUB.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMSUB.VV + if ((opcode & 0xfc00707f) == 0xa8001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMSUB.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMUL.VF + if ((opcode & 0xfc00707f) == 0x90005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMUL.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMUL.VV + if ((opcode & 0xfc00707f) == 0x90001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFMUL.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFMV.F.S + if ((opcode & 0xfe0ff07f) == 0x42001057) { + a.rd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFMV.F.S", fpr[a.rd], vpr[a.vs2]); + return buff; + } + + // rv_v, VFMV.S.F + if ((opcode & 0xfff0707f) == 0x42005057) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFMV.S.F", vpr[a.vd], fpr[a.rs1]); + return buff; + } + + // rv_v, VFMV.V.F + if ((opcode & 0xfff0707f) == 0x5e005057) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VFMV.V.F", vpr[a.vd], fpr[a.rs1]); + return buff; + } + + // rv_v, VFNCVT.F.F.W + if ((opcode & 0xfc0ff07f) == 0x480a1057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.F.F.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.F.X.W + if ((opcode & 0xfc0ff07f) == 0x48099057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.F.X.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.F.XU.W + if ((opcode & 0xfc0ff07f) == 0x48091057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.F.XU.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.ROD.F.F.W + if ((opcode & 0xfc0ff07f) == 0x480a9057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.ROD.F.F.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.RTZ.X.F.W + if ((opcode & 0xfc0ff07f) == 0x480b9057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.RTZ.X.F.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.RTZ.XU.F.W + if ((opcode & 0xfc0ff07f) == 0x480b1057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.RTZ.XU.F.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.X.F.W + if ((opcode & 0xfc0ff07f) == 0x48089057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.X.F.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNCVT.XU.F.W + if ((opcode & 0xfc0ff07f) == 0x48081057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFNCVT.XU.F.W", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFNMACC.VF + if ((opcode & 0xfc00707f) == 0xb4005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFNMACC.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFNMACC.VV + if ((opcode & 0xfc00707f) == 0xb4001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFNMACC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFNMADD.VF + if ((opcode & 0xfc00707f) == 0xa4005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFNMADD.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFNMADD.VV + if ((opcode & 0xfc00707f) == 0xa4001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFNMADD.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFNMSAC.VF + if ((opcode & 0xfc00707f) == 0xbc005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFNMSAC.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFNMSAC.VV + if ((opcode & 0xfc00707f) == 0xbc001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFNMSAC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFNMSUB.VF + if ((opcode & 0xfc00707f) == 0xac005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFNMSUB.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFNMSUB.VV + if ((opcode & 0xfc00707f) == 0xac001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFNMSUB.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFRDIV.VF + if ((opcode & 0xfc00707f) == 0x84005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFRDIV.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFREC7.V + if ((opcode & 0xfc0ff07f) == 0x4c029057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFREC7.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFREDMAX.VS + if ((opcode & 0xfc00707f) == 0x1c001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFREDMAX.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFREDMIN.VS + if ((opcode & 0xfc00707f) == 0x14001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFREDMIN.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFREDOSUM.VS + if ((opcode & 0xfc00707f) == 0xc001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFREDOSUM.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFREDUSUM.VS + if ((opcode & 0xfc00707f) == 0x4001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFREDUSUM.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFRSQRT7.V + if ((opcode & 0xfc0ff07f) == 0x4c021057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFRSQRT7.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFRSUB.VF + if ((opcode & 0xfc00707f) == 0x9c005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFRSUB.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFSGNJ.VF + if ((opcode & 0xfc00707f) == 0x20005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFSGNJ.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFSGNJ.VV + if ((opcode & 0xfc00707f) == 0x20001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFSGNJ.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFSGNJN.VF + if ((opcode & 0xfc00707f) == 0x24005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFSGNJN.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFSGNJN.VV + if ((opcode & 0xfc00707f) == 0x24001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFSGNJN.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFSGNJX.VF + if ((opcode & 0xfc00707f) == 0x28005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFSGNJX.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFSGNJX.VV + if ((opcode & 0xfc00707f) == 0x28001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFSGNJX.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFSLIDE1DOWN.VF + if ((opcode & 0xfc00707f) == 0x3c005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFSLIDE1DOWN.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFSLIDE1UP.VF + if ((opcode & 0xfc00707f) == 0x38005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFSLIDE1UP.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFSQRT.V + if ((opcode & 0xfc0ff07f) == 0x4c001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFSQRT.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFSUB.VF + if ((opcode & 0xfc00707f) == 0x8005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFSUB.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFSUB.VV + if ((opcode & 0xfc00707f) == 0x8001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFSUB.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWADD.VF + if ((opcode & 0xfc00707f) == 0xc0005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWADD.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWADD.VV + if ((opcode & 0xfc00707f) == 0xc0001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWADD.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWADD.WF + if ((opcode & 0xfc00707f) == 0xd0005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWADD.WF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWADD.WV + if ((opcode & 0xfc00707f) == 0xd0001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWADD.WV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.F.F.V + if ((opcode & 0xfc0ff07f) == 0x48061057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.F.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.F.X.V + if ((opcode & 0xfc0ff07f) == 0x48059057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.F.X.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.F.XU.V + if ((opcode & 0xfc0ff07f) == 0x48051057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.F.XU.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.RTZ.X.F.V + if ((opcode & 0xfc0ff07f) == 0x48079057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.RTZ.X.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.RTZ.XU.F.V + if ((opcode & 0xfc0ff07f) == 0x48071057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.RTZ.XU.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.X.F.V + if ((opcode & 0xfc0ff07f) == 0x48049057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.X.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWCVT.XU.F.V + if ((opcode & 0xfc0ff07f) == 0x48041057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VFWCVT.XU.F.V", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VFWMACC.VF + if ((opcode & 0xfc00707f) == 0xf0005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWMACC.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWMACC.VV + if ((opcode & 0xfc00707f) == 0xf0001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWMACC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWMSAC.VF + if ((opcode & 0xfc00707f) == 0xf8005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWMSAC.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWMSAC.VV + if ((opcode & 0xfc00707f) == 0xf8001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWMSAC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWMUL.VF + if ((opcode & 0xfc00707f) == 0xe0005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWMUL.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWMUL.VV + if ((opcode & 0xfc00707f) == 0xe0001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWMUL.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWNMACC.VF + if ((opcode & 0xfc00707f) == 0xf4005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWNMACC.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWNMACC.VV + if ((opcode & 0xfc00707f) == 0xf4001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWNMACC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWNMSAC.VF + if ((opcode & 0xfc00707f) == 0xfc005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWNMSAC.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWNMSAC.VV + if ((opcode & 0xfc00707f) == 0xfc001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWNMSAC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWREDOSUM.VS + if ((opcode & 0xfc00707f) == 0xcc001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWREDOSUM.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWREDUSUM.VS + if ((opcode & 0xfc00707f) == 0xc4001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWREDUSUM.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWSUB.VF + if ((opcode & 0xfc00707f) == 0xc8005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWSUB.VF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWSUB.VV + if ((opcode & 0xfc00707f) == 0xc8001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWSUB.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWSUB.WF + if ((opcode & 0xfc00707f) == 0xd8005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWSUB.WF", vpr[a.vd], vpr[a.vs2], fpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VFWSUB.WV + if ((opcode & 0xfc00707f) == 0xd8001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VFWSUB.WV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VID.V + if ((opcode & 0xfdfff07f) == 0x5008a057) { + a.vd = FX(opcode, 11, 7); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VID.V", vpr[a.vd], vm[a.vm]); + return buff; + } + + // rv_v, VIOTA.M + if ((opcode & 0xfc0ff07f) == 0x50082057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VIOTA.M", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VL1RE16.V + if ((opcode & 0xfff0707f) == 0x2805007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL1RE16.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL1RE32.V + if ((opcode & 0xfff0707f) == 0x2806007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL1RE32.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL1RE64.V + if ((opcode & 0xfff0707f) == 0x2807007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL1RE64.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL1RE8.V + if ((opcode & 0xfff0707f) == 0x2800007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL1RE8.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL2RE16.V + if ((opcode & 0xfff0707f) == 0x22805007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL2RE16.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL2RE32.V + if ((opcode & 0xfff0707f) == 0x22806007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL2RE32.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL2RE64.V + if ((opcode & 0xfff0707f) == 0x22807007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL2RE64.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL2RE8.V + if ((opcode & 0xfff0707f) == 0x22800007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL2RE8.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL4RE16.V + if ((opcode & 0xfff0707f) == 0x62805007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL4RE16.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL4RE32.V + if ((opcode & 0xfff0707f) == 0x62806007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL4RE32.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL4RE64.V + if ((opcode & 0xfff0707f) == 0x62807007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL4RE64.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL4RE8.V + if ((opcode & 0xfff0707f) == 0x62800007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL4RE8.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL8RE16.V + if ((opcode & 0xfff0707f) == 0xe2805007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL8RE16.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL8RE32.V + if ((opcode & 0xfff0707f) == 0xe2806007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL8RE32.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL8RE64.V + if ((opcode & 0xfff0707f) == 0xe2807007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL8RE64.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VL8RE8.V + if ((opcode & 0xfff0707f) == 0xe2800007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VL8RE8.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VLE16.V + if ((opcode & 0x1df0707f) == 0x5007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VLE16.V", vpr[a.vd], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLE16FF.V + if ((opcode & 0x1df0707f) == 0x1005007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VLE16FF.V", vpr[a.vd], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLE32.V + if ((opcode & 0x1df0707f) == 0x6007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VLE32.V", vpr[a.vd], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLE32FF.V + if ((opcode & 0x1df0707f) == 0x1006007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VLE32FF.V", vpr[a.vd], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLE64.V + if ((opcode & 0x1df0707f) == 0x7007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VLE64.V", vpr[a.vd], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLE64FF.V + if ((opcode & 0x1df0707f) == 0x1007007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VLE64FF.V", vpr[a.vd], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLE8.V + if ((opcode & 0x1df0707f) == 0x7) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VLE8.V", vpr[a.vd], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLE8FF.V + if ((opcode & 0x1df0707f) == 0x1000007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VLE8FF.V", vpr[a.vd], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLM.V + if ((opcode & 0xfff0707f) == 0x2b00007) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VLM.V", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VLOXEI16.V + if ((opcode & 0x1c00707f) == 0xc005007) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLOXEI16.V", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLOXEI32.V + if ((opcode & 0x1c00707f) == 0xc006007) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLOXEI32.V", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLOXEI64.V + if ((opcode & 0x1c00707f) == 0xc007007) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLOXEI64.V", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLOXEI8.V + if ((opcode & 0x1c00707f) == 0xc000007) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLOXEI8.V", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLSE16.V + if ((opcode & 0x1c00707f) == 0x8005007) { + a.vd = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLSE16.V", vpr[a.vd], gpr[a.rs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLSE32.V + if ((opcode & 0x1c00707f) == 0x8006007) { + a.vd = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLSE32.V", vpr[a.vd], gpr[a.rs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLSE64.V + if ((opcode & 0x1c00707f) == 0x8007007) { + a.vd = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLSE64.V", vpr[a.vd], gpr[a.rs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLSE8.V + if ((opcode & 0x1c00707f) == 0x8000007) { + a.vd = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLSE8.V", vpr[a.vd], gpr[a.rs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLUXEI16.V + if ((opcode & 0x1c00707f) == 0x4005007) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLUXEI16.V", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLUXEI32.V + if ((opcode & 0x1c00707f) == 0x4006007) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLUXEI32.V", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLUXEI64.V + if ((opcode & 0x1c00707f) == 0x4007007) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLUXEI64.V", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VLUXEI8.V + if ((opcode & 0x1c00707f) == 0x4000007) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VLUXEI8.V", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VMACC.VV + if ((opcode & 0xfc00707f) == 0xb4002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMACC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMACC.VX + if ((opcode & 0xfc00707f) == 0xb4006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMACC.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMADC.VI + if ((opcode & 0xfe00707f) == 0x46003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "VMADC.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5)); + return buff; + } + + // rv_v, VMADC.VIM + if ((opcode & 0xfe00707f) == 0x44003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "VMADC.VIM", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5)); + return buff; + } + + // rv_v, VMADC.VV + if ((opcode & 0xfe00707f) == 0x46000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMADC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VMADC.VVM + if ((opcode & 0xfe00707f) == 0x44000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMADC.VVM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VMADC.VX + if ((opcode & 0xfe00707f) == 0x46004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMADC.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1]); + return buff; + } + + // rv_v, VMADC.VXM + if ((opcode & 0xfe00707f) == 0x44004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMADC.VXM", vpr[a.vd], vpr[a.vs2], gpr[a.rs1]); + return buff; + } + + // rv_v, VMADD.VV + if ((opcode & 0xfc00707f) == 0xa4002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMADD.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMADD.VX + if ((opcode & 0xfc00707f) == 0xa4006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMADD.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMAND.MM + if ((opcode & 0xfe00707f) == 0x66002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMAND.MM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VMANDN.MM + if ((opcode & 0xfe00707f) == 0x62002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMANDN.MM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VMAX.VV + if ((opcode & 0xfc00707f) == 0x1c000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMAX.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMAX.VX + if ((opcode & 0xfc00707f) == 0x1c004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMAX.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMAXU.VV + if ((opcode & 0xfc00707f) == 0x18000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMAXU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMAXU.VX + if ((opcode & 0xfc00707f) == 0x18004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMAXU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMERGE.VIM + if ((opcode & 0xfe00707f) == 0x5c003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "VMERGE.VIM", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5)); + return buff; + } + + // rv_v, VMERGE.VVM + if ((opcode & 0xfe00707f) == 0x5c000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMERGE.VVM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VMERGE.VXM + if ((opcode & 0xfe00707f) == 0x5c004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMERGE.VXM", vpr[a.vd], vpr[a.vs2], gpr[a.rs1]); + return buff; + } + + // rv_v, VMFEQ.VF + if ((opcode & 0xfc00707f) == 0x60005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMFEQ.VF", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMFEQ.VV + if ((opcode & 0xfc00707f) == 0x60001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMFEQ.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMFGE.VF + if ((opcode & 0xfc00707f) == 0x7c005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMFGE.VF", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMFGT.VF + if ((opcode & 0xfc00707f) == 0x74005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMFGT.VF", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMFLE.VF + if ((opcode & 0xfc00707f) == 0x64005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMFLE.VF", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMFLE.VV + if ((opcode & 0xfc00707f) == 0x64001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMFLE.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMFLT.VF + if ((opcode & 0xfc00707f) == 0x6c005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMFLT.VF", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMFLT.VV + if ((opcode & 0xfc00707f) == 0x6c001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMFLT.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMFNE.VF + if ((opcode & 0xfc00707f) == 0x70005057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMFNE.VF", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMFNE.VV + if ((opcode & 0xfc00707f) == 0x70001057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMFNE.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMIN.VV + if ((opcode & 0xfc00707f) == 0x14000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMIN.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMIN.VX + if ((opcode & 0xfc00707f) == 0x14004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMIN.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMINU.VV + if ((opcode & 0xfc00707f) == 0x10000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMINU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMINU.VX + if ((opcode & 0xfc00707f) == 0x10004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMINU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMNAND.MM + if ((opcode & 0xfe00707f) == 0x76002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMNAND.MM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VMNOR.MM + if ((opcode & 0xfe00707f) == 0x7a002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMNOR.MM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VMOR.MM + if ((opcode & 0xfe00707f) == 0x6a002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMOR.MM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VMORN.MM + if ((opcode & 0xfe00707f) == 0x72002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMORN.MM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VMSBC.VV + if ((opcode & 0xfe00707f) == 0x4e000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMSBC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VMSBC.VVM + if ((opcode & 0xfe00707f) == 0x4c000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMSBC.VVM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VMSBC.VX + if ((opcode & 0xfe00707f) == 0x4e004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMSBC.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1]); + return buff; + } + + // rv_v, VMSBC.VXM + if ((opcode & 0xfe00707f) == 0x4c004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMSBC.VXM", vpr[a.vd], vpr[a.vs2], gpr[a.rs1]); + return buff; + } + + // rv_v, VMSBF.M + if ((opcode & 0xfc0ff07f) == 0x5000a057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMSBF.M", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VMSEQ.VI + if ((opcode & 0xfc00707f) == 0x60003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VMSEQ.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VMSEQ.VV + if ((opcode & 0xfc00707f) == 0x60000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSEQ.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSEQ.VX + if ((opcode & 0xfc00707f) == 0x60004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSEQ.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSGT.VI + if ((opcode & 0xfc00707f) == 0x7c003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VMSGT.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VMSGT.VX + if ((opcode & 0xfc00707f) == 0x7c004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSGT.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSGTU.VI + if ((opcode & 0xfc00707f) == 0x78003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VMSGTU.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VMSGTU.VX + if ((opcode & 0xfc00707f) == 0x78004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSGTU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSIF.M + if ((opcode & 0xfc0ff07f) == 0x5001a057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMSIF.M", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VMSLE.VI + if ((opcode & 0xfc00707f) == 0x74003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VMSLE.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VMSLE.VV + if ((opcode & 0xfc00707f) == 0x74000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSLE.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSLE.VX + if ((opcode & 0xfc00707f) == 0x74004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSLE.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSLEU.VI + if ((opcode & 0xfc00707f) == 0x70003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VMSLEU.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VMSLEU.VV + if ((opcode & 0xfc00707f) == 0x70000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSLEU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSLEU.VX + if ((opcode & 0xfc00707f) == 0x70004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSLEU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSLT.VV + if ((opcode & 0xfc00707f) == 0x6c000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSLT.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSLT.VX + if ((opcode & 0xfc00707f) == 0x6c004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSLT.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSLTU.VV + if ((opcode & 0xfc00707f) == 0x68000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSLTU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSLTU.VX + if ((opcode & 0xfc00707f) == 0x68004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSLTU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSNE.VI + if ((opcode & 0xfc00707f) == 0x64003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VMSNE.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VMSNE.VV + if ((opcode & 0xfc00707f) == 0x64000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSNE.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSNE.VX + if ((opcode & 0xfc00707f) == 0x64004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMSNE.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMSOF.M + if ((opcode & 0xfc0ff07f) == 0x50012057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMSOF.M", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VMUL.VV + if ((opcode & 0xfc00707f) == 0x94002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMUL.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMUL.VX + if ((opcode & 0xfc00707f) == 0x94006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMUL.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMULH.VV + if ((opcode & 0xfc00707f) == 0x9c002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMULH.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMULH.VX + if ((opcode & 0xfc00707f) == 0x9c006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMULH.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMULHSU.VV + if ((opcode & 0xfc00707f) == 0x98002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMULHSU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMULHSU.VX + if ((opcode & 0xfc00707f) == 0x98006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMULHSU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMULHU.VV + if ((opcode & 0xfc00707f) == 0x90002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMULHU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VMULHU.VX + if ((opcode & 0xfc00707f) == 0x90006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VMULHU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VMV1R.V + if ((opcode & 0xfe0ff07f) == 0x9e003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VMV1R.V", vpr[a.vd], vpr[a.vs2]); + return buff; + } + + // rv_v, VMV2R.V + if ((opcode & 0xfe0ff07f) == 0x9e00b057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VMV2R.V", vpr[a.vd], vpr[a.vs2]); + return buff; + } + + // rv_v, VMV4R.V + if ((opcode & 0xfe0ff07f) == 0x9e01b057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VMV4R.V", vpr[a.vd], vpr[a.vs2]); + return buff; + } + + // rv_v, VMV8R.V + if ((opcode & 0xfe0ff07f) == 0x9e03b057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VMV8R.V", vpr[a.vd], vpr[a.vs2]); + return buff; + } + + // rv_v, VMV.S.X + if ((opcode & 0xfff0707f) == 0x42006057) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VMV.S.X", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VMV.V.I + if ((opcode & 0xfff0707f) == 0x5e003057) { + a.vd = FX(opcode, 11, 7); + a.imm = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, 0x%x(%d)", "VMV.V.I", vpr[a.vd], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5)); + return buff; + } + + // rv_v, VMV.V.V + if ((opcode & 0xfff0707f) == 0x5e000057) { + a.vd = FX(opcode, 11, 7); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VMV.V.V", vpr[a.vd], vpr[a.vs1]); + return buff; + } + + // rv_v, VMV.V.X + if ((opcode & 0xfff0707f) == 0x5e004057) { + a.vd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VMV.V.X", vpr[a.vd], gpr[a.rs1]); + return buff; + } + + // rv_v, VMV.X.S + if ((opcode & 0xfe0ff07f) == 0x42002057) { + a.rd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VMV.X.S", gpr[a.rd], vpr[a.vs2]); + return buff; + } + + // rv_v, VMXNOR.MM + if ((opcode & 0xfe00707f) == 0x7e002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMXNOR.MM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VMXOR.MM + if ((opcode & 0xfe00707f) == 0x6e002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VMXOR.MM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VNCLIP.WI + if ((opcode & 0xfc00707f) == 0xbc003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VNCLIP.WI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VNCLIP.WV + if ((opcode & 0xfc00707f) == 0xbc000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VNCLIP.WV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VNCLIP.WX + if ((opcode & 0xfc00707f) == 0xbc004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VNCLIP.WX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VNCLIPU.WI + if ((opcode & 0xfc00707f) == 0xb8003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VNCLIPU.WI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VNCLIPU.WV + if ((opcode & 0xfc00707f) == 0xb8000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VNCLIPU.WV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VNCLIPU.WX + if ((opcode & 0xfc00707f) == 0xb8004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VNCLIPU.WX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VNMSAC.VV + if ((opcode & 0xfc00707f) == 0xbc002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VNMSAC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VNMSAC.VX + if ((opcode & 0xfc00707f) == 0xbc006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VNMSAC.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VNMSUB.VV + if ((opcode & 0xfc00707f) == 0xac002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VNMSUB.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VNMSUB.VX + if ((opcode & 0xfc00707f) == 0xac006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VNMSUB.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VNSRA.WI + if ((opcode & 0xfc00707f) == 0xb4003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VNSRA.WI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VNSRA.WV + if ((opcode & 0xfc00707f) == 0xb4000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VNSRA.WV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VNSRA.WX + if ((opcode & 0xfc00707f) == 0xb4004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VNSRA.WX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VNSRL.WI + if ((opcode & 0xfc00707f) == 0xb0003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VNSRL.WI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VNSRL.WV + if ((opcode & 0xfc00707f) == 0xb0000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VNSRL.WV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VNSRL.WX + if ((opcode & 0xfc00707f) == 0xb0004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VNSRL.WX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VOR.VI + if ((opcode & 0xfc00707f) == 0x28003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VOR.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VOR.VV + if ((opcode & 0xfc00707f) == 0x28000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VOR.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VOR.VX + if ((opcode & 0xfc00707f) == 0x28004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VOR.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VREDAND.VS + if ((opcode & 0xfc00707f) == 0x4002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VREDAND.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VREDMAX.VS + if ((opcode & 0xfc00707f) == 0x1c002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VREDMAX.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VREDMAXU.VS + if ((opcode & 0xfc00707f) == 0x18002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VREDMAXU.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VREDMIN.VS + if ((opcode & 0xfc00707f) == 0x14002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VREDMIN.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VREDMINU.VS + if ((opcode & 0xfc00707f) == 0x10002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VREDMINU.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VREDOR.VS + if ((opcode & 0xfc00707f) == 0x8002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VREDOR.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VREDSUM.VS + if ((opcode & 0xfc00707f) == 0x2057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VREDSUM.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VREDXOR.VS + if ((opcode & 0xfc00707f) == 0xc002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VREDXOR.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VREM.VV + if ((opcode & 0xfc00707f) == 0x8c002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VREM.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VREM.VX + if ((opcode & 0xfc00707f) == 0x8c006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VREM.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VREMU.VV + if ((opcode & 0xfc00707f) == 0x88002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VREMU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VREMU.VX + if ((opcode & 0xfc00707f) == 0x88006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VREMU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VRGATHER.VI + if ((opcode & 0xfc00707f) == 0x30003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VRGATHER.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VRGATHER.VV + if ((opcode & 0xfc00707f) == 0x30000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VRGATHER.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VRGATHER.VX + if ((opcode & 0xfc00707f) == 0x30004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VRGATHER.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VRGATHEREI16.VV + if ((opcode & 0xfc00707f) == 0x38000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VRGATHEREI16.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VRSUB.VI + if ((opcode & 0xfc00707f) == 0xc003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VRSUB.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VRSUB.VX + if ((opcode & 0xfc00707f) == 0xc004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VRSUB.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VS1R.V + if ((opcode & 0xfff0707f) == 0x2800027) { + a.vs3 = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VS1R.V", vpr[a.vs3], gpr[a.rs1]); + return buff; + } + + // rv_v, VS2R.V + if ((opcode & 0xfff0707f) == 0x22800027) { + a.vs3 = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VS2R.V", vpr[a.vs3], gpr[a.rs1]); + return buff; + } + + // rv_v, VS4R.V + if ((opcode & 0xfff0707f) == 0x62800027) { + a.vs3 = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VS4R.V", vpr[a.vs3], gpr[a.rs1]); + return buff; + } + + // rv_v, VS8R.V + if ((opcode & 0xfff0707f) == 0xe2800027) { + a.vs3 = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VS8R.V", vpr[a.vs3], gpr[a.rs1]); + return buff; + } + + // rv_v, VSADD.VI + if ((opcode & 0xfc00707f) == 0x84003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VSADD.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VSADD.VV + if ((opcode & 0xfc00707f) == 0x84000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSADD.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VSADD.VX + if ((opcode & 0xfc00707f) == 0x84004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSADD.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSADDU.VI + if ((opcode & 0xfc00707f) == 0x80003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VSADDU.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VSADDU.VV + if ((opcode & 0xfc00707f) == 0x80000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSADDU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VSADDU.VX + if ((opcode & 0xfc00707f) == 0x80004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSADDU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSBC.VVM + if ((opcode & 0xfe00707f) == 0x48000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VSBC.VVM", vpr[a.vd], vpr[a.vs2], vpr[a.vs1]); + return buff; + } + + // rv_v, VSBC.VXM + if ((opcode & 0xfe00707f) == 0x48004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VSBC.VXM", vpr[a.vd], vpr[a.vs2], gpr[a.rs1]); + return buff; + } + + // rv_v, VSE16.V + if ((opcode & 0x1df0707f) == 0x5027) { + a.vs3 = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSE16.V", vpr[a.vs3], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSE32.V + if ((opcode & 0x1df0707f) == 0x6027) { + a.vs3 = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSE32.V", vpr[a.vs3], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSE64.V + if ((opcode & 0x1df0707f) == 0x7027) { + a.vs3 = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSE64.V", vpr[a.vs3], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSE8.V + if ((opcode & 0x1df0707f) == 0x27) { + a.vs3 = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSE8.V", vpr[a.vs3], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSETIVLI + if ((opcode & 0xc000707f) == 0xc0007057) { + a.imm = FX(opcode, 29, 20); + a.imm2 = FX(opcode, 19, 15); + a.rd = FX(opcode, 11, 7); + const char *vta_str, *vma_str, *lmul_str, *sew_str; + if (a.imm & 0b01000000) + vta_str = "ta"; + else + vta_str = "tu"; + if (a.imm & 0b10000000) + vma_str = "ma"; + else + vma_str = "mu"; + switch (a.imm & 0b00000111) { + case 0b101: lmul_str = "mf8"; break; + case 0b110: lmul_str = "mf4"; break; + case 0b111: lmul_str = "mf2"; break; + case 0b000: lmul_str = "m1"; break; + case 0b001: lmul_str = "m2"; break; + case 0b010: lmul_str = "m4"; break; + case 0b011: lmul_str = "m8"; break; + default: lmul_str = "reserved"; break; + } + switch ((a.imm & 0b00111000) >> 3) { + case 0b000: sew_str = "e8"; break; + case 0b001: sew_str = "e16"; break; + case 0b010: sew_str = "e32"; break; + case 0b011: sew_str = "e64"; break; + default: sew_str = "reserved"; break; + } + + snprintf(buff, sizeof(buff), "%-15s %s, %d, %s, %s, %s, %s", "VSETIVLI", gpr[a.rd], a.imm2, sew_str, lmul_str, vta_str, vma_str); + return buff; + } + + // rv_v, VSETVL + if ((opcode & 0xfe00707f) == 0x80007057) { + a.rd = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VSETVL", gpr[a.rd], gpr[a.rs2], gpr[a.rs1]); + return buff; + } + + // rv_v, VSETVLI + if ((opcode & 0x8000707f) == 0x7057) { + a.imm = FX(opcode, 30, 20); + a.rs1 = FX(opcode, 19, 15); + a.rd = FX(opcode, 11, 7); + const char *vta_str, *vma_str, *lmul_str, *sew_str; + if (a.imm & 0b01000000) + vta_str = "ta"; + else + vta_str = "tu"; + if (a.imm & 0b10000000) + vma_str = "ma"; + else + vma_str = "mu"; + switch (a.imm & 0b00000111) { + case 0b101: lmul_str = "mf8"; break; + case 0b110: lmul_str = "mf4"; break; + case 0b111: lmul_str = "mf2"; break; + case 0b000: lmul_str = "m1"; break; + case 0b001: lmul_str = "m2"; break; + case 0b010: lmul_str = "m4"; break; + case 0b011: lmul_str = "m8"; break; + default: lmul_str = "reserved"; break; + } + switch ((a.imm & 0b00111000) >> 3) { + case 0b000: sew_str = "e8"; break; + case 0b001: sew_str = "e16"; break; + case 0b010: sew_str = "e32"; break; + case 0b011: sew_str = "e64"; break; + default: sew_str = "reserved"; break; + } + + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s, %s", "VSETVLI", gpr[a.rd], gpr[a.rs1], sew_str, lmul_str, vta_str, vma_str); + return buff; + } + + // rv_v, VSEXT.VF2 + if ((opcode & 0xfc0ff07f) == 0x4803a057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VSEXT.VF2", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VSEXT.VF4 + if ((opcode & 0xfc0ff07f) == 0x4802a057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VSEXT.VF4", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VSEXT.VF8 + if ((opcode & 0xfc0ff07f) == 0x4801a057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VSEXT.VF8", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VSLIDE1DOWN.VX + if ((opcode & 0xfc00707f) == 0x3c006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSLIDE1DOWN.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSLIDE1UP.VX + if ((opcode & 0xfc00707f) == 0x38006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSLIDE1UP.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSLIDEDOWN.VI + if ((opcode & 0xfc00707f) == 0x3c003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VSLIDEDOWN.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VSLIDEDOWN.VX + if ((opcode & 0xfc00707f) == 0x3c004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSLIDEDOWN.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSLIDEUP.VI + if ((opcode & 0xfc00707f) == 0x38003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VSLIDEUP.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VSLIDEUP.VX + if ((opcode & 0xfc00707f) == 0x38004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSLIDEUP.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSLL.VI + if ((opcode & 0xfc00707f) == 0x94003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VSLL.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VSLL.VV + if ((opcode & 0xfc00707f) == 0x94000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSLL.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VSLL.VX + if ((opcode & 0xfc00707f) == 0x94004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSLL.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSM.V + if ((opcode & 0xfff0707f) == 0x2b00027) { + a.vs3 = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "VSM.V", vpr[a.vs3], gpr[a.rs1]); + return buff; + } + + // rv_v, VSMUL.VV + if ((opcode & 0xfc00707f) == 0x9c000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSMUL.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VSMUL.VX + if ((opcode & 0xfc00707f) == 0x9c004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSMUL.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSOXEI16.V + if ((opcode & 0x1c00707f) == 0xc005027) { + a.vs3 = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSOXEI16.V", vpr[a.vs3], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSOXEI32.V + if ((opcode & 0x1c00707f) == 0xc006027) { + a.vs3 = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSOXEI32.V", vpr[a.vs3], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSOXEI64.V + if ((opcode & 0x1c00707f) == 0xc007027) { + a.vs3 = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSOXEI64.V", vpr[a.vs3], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSOXEI8.V + if ((opcode & 0x1c00707f) == 0xc000027) { + a.vs3 = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSOXEI8.V", vpr[a.vs3], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSRA.VI + if ((opcode & 0xfc00707f) == 0xa4003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VSRA.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VSRA.VV + if ((opcode & 0xfc00707f) == 0xa4000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSRA.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VSRA.VX + if ((opcode & 0xfc00707f) == 0xa4004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSRA.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSRL.VI + if ((opcode & 0xfc00707f) == 0xa0003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VSRL.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VSRL.VV + if ((opcode & 0xfc00707f) == 0xa0000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSRL.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VSRL.VX + if ((opcode & 0xfc00707f) == 0xa0004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSRL.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSSE16.V + if ((opcode & 0x1c00707f) == 0x8005027) { + a.vs3 = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSSE16.V", vpr[a.vs3], gpr[a.rs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSSE32.V + if ((opcode & 0x1c00707f) == 0x8006027) { + a.vs3 = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSSE32.V", vpr[a.vs3], gpr[a.rs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSSE64.V + if ((opcode & 0x1c00707f) == 0x8007027) { + a.vs3 = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSSE64.V", vpr[a.vs3], gpr[a.rs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSSE8.V + if ((opcode & 0x1c00707f) == 0x8000027) { + a.vs3 = FX(opcode, 11, 7); + a.rs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSSE8.V", vpr[a.vs3], gpr[a.rs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSSRA.VI + if ((opcode & 0xfc00707f) == 0xac003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VSSRA.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VSSRA.VV + if ((opcode & 0xfc00707f) == 0xac000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSSRA.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VSSRA.VX + if ((opcode & 0xfc00707f) == 0xac004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSSRA.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSSRL.VI + if ((opcode & 0xfc00707f) == 0xa8003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VSSRL.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VSSRL.VV + if ((opcode & 0xfc00707f) == 0xa8000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSSRL.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VSSRL.VX + if ((opcode & 0xfc00707f) == 0xa8004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSSRL.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSSUB.VV + if ((opcode & 0xfc00707f) == 0x8c000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSSUB.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VSSUB.VX + if ((opcode & 0xfc00707f) == 0x8c004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSSUB.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSSUBU.VV + if ((opcode & 0xfc00707f) == 0x88000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSSUBU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VSSUBU.VX + if ((opcode & 0xfc00707f) == 0x88004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSSUBU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSUB.VV + if ((opcode & 0xfc00707f) == 0x8000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSUB.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VSUB.VX + if ((opcode & 0xfc00707f) == 0x8004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VSUB.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VSUXEI16.V + if ((opcode & 0x1c00707f) == 0x4005027) { + a.vs3 = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSUXEI16.V", vpr[a.vs3], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSUXEI32.V + if ((opcode & 0x1c00707f) == 0x4006027) { + a.vs3 = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSUXEI32.V", vpr[a.vs3], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSUXEI64.V + if ((opcode & 0x1c00707f) == 0x4007027) { + a.vs3 = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSUXEI64.V", vpr[a.vs3], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VSUXEI8.V + if ((opcode & 0x1c00707f) == 0x4000027) { + a.vs3 = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + a.nf = FX(opcode, 31, 29); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s, %s", "VSUXEI8.V", vpr[a.vs3], vpr[a.vs2], gpr[a.rs1], vm[a.vm], nf[a.nf]); + return buff; + } + + // rv_v, VWADD.VV + if ((opcode & 0xfc00707f) == 0xc4002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWADD.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWADD.VX + if ((opcode & 0xfc00707f) == 0xc4006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWADD.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWADD.WV + if ((opcode & 0xfc00707f) == 0xd4002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWADD.WV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWADD.WX + if ((opcode & 0xfc00707f) == 0xd4006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWADD.WX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWADDU.VV + if ((opcode & 0xfc00707f) == 0xc0002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWADDU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWADDU.VX + if ((opcode & 0xfc00707f) == 0xc0006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWADDU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWADDU.WV + if ((opcode & 0xfc00707f) == 0xd0002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWADDU.WV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWADDU.WX + if ((opcode & 0xfc00707f) == 0xd0006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWADDU.WX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMACC.VV + if ((opcode & 0xfc00707f) == 0xf4002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMACC.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMACC.VX + if ((opcode & 0xfc00707f) == 0xf4006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMACC.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMACCSU.VV + if ((opcode & 0xfc00707f) == 0xfc002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMACCSU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMACCSU.VX + if ((opcode & 0xfc00707f) == 0xfc006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMACCSU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMACCU.VV + if ((opcode & 0xfc00707f) == 0xf0002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMACCU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMACCU.VX + if ((opcode & 0xfc00707f) == 0xf0006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMACCU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMACCUS.VX + if ((opcode & 0xfc00707f) == 0xf8006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMACCUS.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMUL.VV + if ((opcode & 0xfc00707f) == 0xec002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMUL.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMUL.VX + if ((opcode & 0xfc00707f) == 0xec006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMUL.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMULSU.VV + if ((opcode & 0xfc00707f) == 0xe8002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMULSU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMULSU.VX + if ((opcode & 0xfc00707f) == 0xe8006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMULSU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMULU.VV + if ((opcode & 0xfc00707f) == 0xe0002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMULU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWMULU.VX + if ((opcode & 0xfc00707f) == 0xe0006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWMULU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWREDSUM.VS + if ((opcode & 0xfc00707f) == 0xc4000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWREDSUM.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWREDSUMU.VS + if ((opcode & 0xfc00707f) == 0xc0000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWREDSUMU.VS", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWSUB.VV + if ((opcode & 0xfc00707f) == 0xcc002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWSUB.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWSUB.VX + if ((opcode & 0xfc00707f) == 0xcc006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWSUB.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWSUB.WV + if ((opcode & 0xfc00707f) == 0xdc002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWSUB.WV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWSUB.WX + if ((opcode & 0xfc00707f) == 0xdc006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWSUB.WX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWSUBU.VV + if ((opcode & 0xfc00707f) == 0xc8002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWSUBU.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWSUBU.VX + if ((opcode & 0xfc00707f) == 0xc8006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWSUBU.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VWSUBU.WV + if ((opcode & 0xfc00707f) == 0xd8002057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWSUBU.WV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VWSUBU.WX + if ((opcode & 0xfc00707f) == 0xd8006057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VWSUBU.WX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VXOR.VI + if ((opcode & 0xfc00707f) == 0x2c003057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.imm = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d), %s", "VXOR.VI", vpr[a.vd], vpr[a.vs2], SIGN_EXTEND(a.imm, 5), SIGN_EXTEND(a.imm, 5), vm[a.vm]); + return buff; + } + + // rv_v, VXOR.VV + if ((opcode & 0xfc00707f) == 0x2c000057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VXOR.VV", vpr[a.vd], vpr[a.vs2], vpr[a.vs1], vm[a.vm]); + return buff; + } + + // rv_v, VXOR.VX + if ((opcode & 0xfc00707f) == 0x2c004057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.rs1 = FX(opcode, 19, 15); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s, %s", "VXOR.VX", vpr[a.vd], vpr[a.vs2], gpr[a.rs1], vm[a.vm]); + return buff; + } + + // rv_v, VZEXT.VF2 + if ((opcode & 0xfc0ff07f) == 0x48032057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VZEXT.VF2", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VZEXT.VF4 + if ((opcode & 0xfc0ff07f) == 0x48022057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VZEXT.VF4", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_v, VZEXT.VF8 + if ((opcode & 0xfc0ff07f) == 0x48012057) { + a.vd = FX(opcode, 11, 7); + a.vs2 = FX(opcode, 24, 20); + a.vm = FX(opcode, 25, 25); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "VZEXT.VF8", vpr[a.vd], vpr[a.vs2], vm[a.vm]); + return buff; + } + + // rv_zbb, XNOR + if ((opcode & 0xfe00707f) == 0x40004033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XNOR", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, XOR + if ((opcode & 0xfe00707f) == 0x4033) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.rs2 = FX(opcode, 24, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, %s", "XOR", gpr[a.rd], gpr[a.rs1], gpr[a.rs2]); + return buff; + } + + // rv_i, XORI + if ((opcode & 0x707f) == 0x4013) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + a.imm = FX(opcode, 31, 20); + snprintf(buff, sizeof(buff), "%-15s %s, %s, 0x%x(%d)", "XORI", gpr[a.rd], gpr[a.rs1], SIGN_EXTEND(a.imm, 12), SIGN_EXTEND(a.imm, 12)); + return buff; + } + + // rv64_zbb, ZEXT.H + if ((opcode & 0xfff0707f) == 0x800403b) { + a.rd = FX(opcode, 11, 7); + a.rs1 = FX(opcode, 19, 15); + snprintf(buff, sizeof(buff), "%-15s %s, %s", "ZEXT.H", gpr[a.rd], gpr[a.rs1]); + return buff; + } + + + snprintf(buff, sizeof(buff), "%08X ???", __builtin_bswap32(opcode)); return buff; } diff --git a/src/dynarec/rv64/rv64_printer.h b/src/dynarec/rv64/rv64_printer.h index e22a208..505e7ed 100644 --- a/src/dynarec/rv64/rv64_printer.h +++ b/src/dynarec/rv64/rv64_printer.h @@ -1,7 +1,7 @@ #ifndef _RV64_PRINTER_H_ #define _RV64_PRINTER_H_ #include -#include +#include const char* rv64_print(uint32_t data, uint64_t addr); diff --git a/src/dynarec/rv64/rv64_prolog.S b/src/dynarec/rv64/rv64_prolog.S index b209db9..86f21ce 100644 --- a/src/dynarec/rv64/rv64_prolog.S +++ b/src/dynarec/rv64/rv64_prolog.S @@ -1,70 +1,82 @@ -//arm prologue for dynarec -//Save stuff, prepare stack and register -//called with pointer to emu as 1st parameter -//and address to jump to as 2nd parameter +#define ASM_MAPPING 1 +#include "rv64_mapping.h" +#undef ASM_MAPPING .text .align 4 .global rv64_prolog + +// rv64_prolog(emu, jump_address) rv64_prolog: - //save all 18 used register - addi sp, sp, -(8 * 24) // 16 bytes aligned - sd ra, (sp) // save ra - sd x8, 8(sp) // save fp - sd x18, (2*8)(sp) - sd x19, (3*8)(sp) - sd x20, (4*8)(sp) - sd x21, (5*8)(sp) - sd x22, (6*8)(sp) - sd x23, (7*8)(sp) - sd x24, (8*8)(sp) - sd x25, (9*8)(sp) - sd x26, (10*8)(sp) - sd x27, (11*8)(sp) - sd x9, (12*8)(sp) - fsd f18, (13*8)(sp) - fsd f19, (14*8)(sp) - fsd f20, (15*8)(sp) - fsd f21, (16*8)(sp) - fsd f22, (17*8)(sp) - fsd f23, (18*8)(sp) - fsd f24, (19*8)(sp) - fsd f25, (20*8)(sp) - fsd f26, (21*8)(sp) - fsd f27, (22*8)(sp) - //setup emu -> register - ld x16, (a0) - ld x17, 8(a0) - ld x18, 16(a0) - ld x19, 24(a0) - ld x20, 32(a0) - ld x21, 40(a0) - ld x22, 48(a0) - ld x23, 56(a0) - ld x24, 64(a0) - ld x25, 72(a0) - ld x26, 80(a0) - ld x27, 88(a0) - ld x28, 96(a0) - ld x29, 104(a0) - ld x30, 112(a0) - ld x31, 120(a0) - ld x8, 128(a0) //xFlags - ld x7, 136(a0) // xRIP - // // adjust flags bit 11 -> bit 5 - andi x8, x8, ~(1<<5) // probably not usefull? - srli x5, x8, 11-5 - andi x5, x5, 1<<5 - or x8, x8, x5 - ld x5, 808(a0) // grab an old value of emu->xSPSave - sd sp, 808(a0) // save current sp to emu->xSPSave + + // 16 bytes aligned + addi sp, sp, -(8 * 24) + + // save callee-saved registers + sd ra, (0*8)(sp) + sd fp, (1*8)(sp) + sd s1, (2*8)(sp) + sd s2, (3*8)(sp) + sd s3, (4*8)(sp) + sd s4, (5*8)(sp) + sd s5, (6*8)(sp) + sd s6, (7*8)(sp) + sd s7, (8*8)(sp) + sd s8, (9*8)(sp) + sd s9, (10*8)(sp) + sd s10, (11*8)(sp) + sd s11, (12*8)(sp) + fsd fs2, (13*8)(sp) + fsd fs3, (14*8)(sp) + fsd fs4, (15*8)(sp) + fsd fs5, (16*8)(sp) + fsd fs6, (17*8)(sp) + fsd fs7, (18*8)(sp) + fsd fs8, (19*8)(sp) + fsd fs9, (20*8)(sp) + fsd fs10, (21*8)(sp) + fsd fs11, (22*8)(sp) + + // save a1 + mv t6, a1 + + /*** switch to box64 register naming convection ***/ + + // load x86 registers from emu + mv Emu, a0 + ld RAX, 0(Emu) + ld RCX, 8(Emu) + ld RDX, 16(Emu) + ld RBX, 24(Emu) + ld RSP, 32(Emu) + ld RBP, 40(Emu) + ld RSI, 48(Emu) + ld RDI, 56(Emu) + ld R8, 64(Emu) + ld R9, 72(Emu) + ld R10, 80(Emu) + ld R11, 88(Emu) + ld R12, 96(Emu) + ld R13, 104(Emu) + ld R14, 112(Emu) + ld R15, 120(Emu) + ld Flags, 128(Emu) + ld RIP, 136(Emu) + + // adjust flags bit 11 -> bit 5 + andi Flags, Flags, ~(1<<5) // probably not usefull? + srli t3, Flags, 11-5 + andi t3, t3, 1<<5 + or Flags, Flags, t3 + + ld t3, 808(Emu) // grab an old value of emu->xSPSave + sd sp, 808(Emu) // save current sp to emu->xSPSave + // push sentinel onto the stack - sd x5, -16(sp) + sd t3, -16(sp) sd zero, -8(sp) addi sp, sp, -16 - // setup xMASK - xori x5, x0, -1 - srli x5, x5, 32 + // jump to block - jalr a1 + jr t6 diff --git a/src/elfs/elfhacks.c b/src/elfs/elfhacks.c new file mode 100644 index 0000000..a750902 --- /dev/null +++ b/src/elfs/elfhacks.c @@ -0,0 +1,620 @@ +/** + * \file src/elfhacks.c + * \brief various ELF run-time hacks + * \author Pyry Haulos + * \date 2007-2008 + * For conditions of distribution and use, see copyright notice in elfhacks.h + */ + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "elfhacks.h" + +#ifndef __ELF_NATIVE_CLASS +#include "sys/reg.h" +#define __ELF_NATIVE_CLASS __WORDSIZE +#endif + +/** + * \addtogroup elfhacks + * \{ + */ + +#if defined(__GLIBC__) && !(defined(__riscv) || defined(__mips__) || defined(LA64_ABI_1)) +# define ABS_ADDR(obj, ptr) (ptr) +#else +# define ABS_ADDR(obj, ptr) ((obj->addr) + (ptr)) +#endif + +struct eh_iterate_callback_args { + eh_iterate_obj_callback_func callback; + void *arg; +}; + +int eh_check_addr(eh_obj_t *obj, const void *addr); +int eh_find_callback(struct dl_phdr_info *info, size_t size, void *argptr); +int eh_find_next_dyn(eh_obj_t *obj, ElfW_Sword tag, int i, ElfW(Dyn) **next); +int eh_init_obj(eh_obj_t *obj); + +int eh_set_rela_plt(eh_obj_t *obj, int p, const char *sym, void *val); +int eh_set_rel_plt(eh_obj_t *obj, int p, const char *sym, void *val); + +int eh_iterate_rela_plt(eh_obj_t *obj, int p, eh_iterate_rel_callback_func callback, void *arg); +int eh_iterate_rel_plt(eh_obj_t *obj, int p, eh_iterate_rel_callback_func callback, void *arg); +int eh_iterate_callback(struct dl_phdr_info *info, size_t size, void *argptr); + +int eh_find_sym_hash(eh_obj_t *obj, const char *name, eh_sym_t *sym); +int eh_find_sym_gnu_hash(eh_obj_t *obj, const char *name, eh_sym_t *sym); + +ElfW(Word) eh_hash_elf(const char *name); +Elf32_Word eh_hash_gnu(const char *name); + +int eh_find_callback(struct dl_phdr_info *info, size_t size, void *argptr) +{ + eh_obj_t *find = (eh_obj_t *) argptr; + + if (find->name == NULL) { + if (strcmp(info->dlpi_name, "")) + return 0; + } else if (fnmatch(find->name, info->dlpi_name, 0)) + return 0; + + if (find->name == NULL) /* TODO readlink? */ + find->name = "/proc/self/exe"; + else + find->name = info->dlpi_name; + find->addr = info->dlpi_addr; + + /* segment headers */ + find->phdr = info->dlpi_phdr; + find->phnum = info->dlpi_phnum; + + return 0; +} + +int eh_iterate_callback(struct dl_phdr_info *info, size_t size, void *argptr) +{ + struct eh_iterate_callback_args *args = argptr; + eh_obj_t obj; + int ret = 0; + + /* eh_init_obj needs phdr and phnum */ + obj.phdr = info->dlpi_phdr; + obj.phnum = info->dlpi_phnum; + obj.addr = info->dlpi_addr; + obj.name = info->dlpi_name; + + if ((ret = eh_init_obj(&obj))) { + if (ret == ENOTSUP) /* just skip */ + return 0; + return ret; + } + + if ((ret = args->callback(&obj, args->arg))) + return ret; + + if ((ret = eh_destroy_obj(&obj))) + return ret; + + return 0; +} + +int eh_iterate_obj(eh_iterate_obj_callback_func callback, void *arg) +{ + int ret; + struct eh_iterate_callback_args args; + + args.callback = callback; + args.arg = arg; + + if ((ret = dl_iterate_phdr(eh_iterate_callback, &args))) + return ret; + + return 0; +} + +int eh_find_obj(eh_obj_t *obj, const char *soname) +{ + /* This function uses glibc-specific dl_iterate_phdr(). + Another way could be parsing /proc/self/exe or using + pmap() on Solaris or *BSD */ + obj->phdr = NULL; + obj->name = soname; + dl_iterate_phdr(eh_find_callback, obj); + + if (!obj->phdr) + return EAGAIN; + + return eh_init_obj(obj); +} + +int eh_check_addr(eh_obj_t *obj, const void *addr) +{ + /* + Check that given address is inside program's + memory maps. PT_LOAD program headers tell us + where program has been loaded into. + */ + int p; + for (p = 0; p < obj->phnum; p++) { + if (obj->phdr[p].p_type == PT_LOAD) { + if (((ElfW(Addr)) addr < obj->phdr[p].p_memsz + obj->phdr[p].p_vaddr + obj->addr) && + ((ElfW(Addr)) addr >= obj->phdr[p].p_vaddr + obj->addr)) + return 0; + } + } + + return EINVAL; +} + +int eh_init_obj(eh_obj_t *obj) +{ + /* + ELF spec says in section header documentation, that: + "An object file may have only one dynamic section." + + Let's assume it means that object has only one PT_DYNAMIC + as well. + */ + int p; + obj->dynamic = NULL; + for (p = 0; p < obj->phnum; p++) { + if (obj->phdr[p].p_type == PT_DYNAMIC) { + if (obj->dynamic) + return ENOTSUP; + + obj->dynamic = (ElfW(Dyn) *) (obj->phdr[p].p_vaddr + obj->addr); + } + } + + if (!obj->dynamic) + return ENOTSUP; + + /* + ELF spec says that program is allowed to have more than one + .strtab but does not describe how string table indexes translate + to multiple string tables. + + And spec says that only one SHT_HASH is allowed, does it mean that + obj has only one DT_HASH? + + About .symtab it does not mention anything about if multiple + symbol tables are allowed or not. + + Maybe st_shndx is the key here? + */ + obj->strtab = NULL; + obj->hash = NULL; + obj->gnu_hash = NULL; + obj->symtab = NULL; + p = 0; + while (obj->dynamic[p].d_tag != DT_NULL) { + if (obj->dynamic[p].d_tag == DT_STRTAB) { + if (obj->strtab) + return ENOTSUP; + + obj->strtab = (const char *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr); + } else if (obj->dynamic[p].d_tag == DT_HASH) { + if (obj->hash) + return ENOTSUP; + + obj->hash = (ElfW(Word) *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr); + } else if (obj->dynamic[p].d_tag == DT_GNU_HASH) { + if (obj->gnu_hash) + return ENOTSUP; + + obj->gnu_hash = (Elf32_Word *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr); + } else if (obj->dynamic[p].d_tag == DT_SYMTAB) { + if (obj->symtab) + return ENOTSUP; + + obj->symtab = (ElfW(Sym) *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr); + } + p++; + } + + /* This is here to catch b0rken headers (vdso) */ + if ((eh_check_addr(obj, (const void *) obj->strtab)) | + (eh_check_addr(obj, (const void *) obj->symtab))) + return ENOTSUP; + + if (obj->hash) { + /* DT_HASH found */ + if (eh_check_addr(obj, (void *) obj->hash)) + obj->hash = NULL; + } else if (obj->gnu_hash) { + /* DT_GNU_HASH found */ + if (eh_check_addr(obj, (void *) obj->gnu_hash)) + obj->gnu_hash = NULL; + } + + return 0; +} + +int eh_find_sym(eh_obj_t *obj, const char *name, void **to) +{ + eh_sym_t sym; + + /* DT_GNU_HASH is faster ;) */ + if (obj->gnu_hash) { + if (!eh_find_sym_gnu_hash(obj, name, &sym)) { + *to = (void *) (sym.sym->st_value + obj->addr); + return 0; + } + } + + /* maybe it is in DT_HASH or DT_GNU_HASH is not present */ + if (obj->hash) { + if (!eh_find_sym_hash(obj, name, &sym)) { + *to = (void *) (sym.sym->st_value + obj->addr); + return 0; + } + } + + return EAGAIN; +} + +ElfW(Word) eh_hash_elf(const char *name) +{ + ElfW(Word) tmp, hash = 0; + const unsigned char *uname = (const unsigned char *) name; + int c; + + while ((c = *uname++) != '\0') { + hash = (hash << 4) + c; + if ((tmp = (hash & 0xf0000000)) != 0) { + hash ^= tmp >> 24; + hash ^= tmp; + } + } + + return hash; +} + +int eh_find_sym_hash(eh_obj_t *obj, const char *name, eh_sym_t *sym) +{ + ElfW(Word) hash, *chain; + ElfW(Sym) *esym; + unsigned int bucket_idx, idx; + + if (!obj->hash) + return ENOTSUP; + + if (obj->hash[0] == 0) + return EAGAIN; + + hash = eh_hash_elf(name); + /* + First item in DT_HASH is nbucket, second is nchain. + hash % nbucket gives us our bucket index. + */ + bucket_idx = obj->hash[2 + (hash % obj->hash[0])]; + chain = &obj->hash[2 + obj->hash[0] + bucket_idx]; + + idx = 0; + sym->sym = NULL; + + /* we have to check symtab[bucket_idx] first */ + esym = &obj->symtab[bucket_idx]; + if (esym->st_name) { + if (!strcmp(&obj->strtab[esym->st_name], name)) + sym->sym = esym; + } + + while ((sym->sym == NULL) && + (chain[idx] != STN_UNDEF)) { + if (chain[idx] >= obj->hash[1] /* nchain */) /* some ELF file contains broken chain! */ + break; + esym = &obj->symtab[chain[idx]]; + + if (esym->st_name) { + if (!strcmp(&obj->strtab[esym->st_name], name)) + sym->sym = esym; + } + + idx++; + } + + /* symbol not found */ + if (sym->sym == NULL) + return EAGAIN; + + sym->obj = obj; + sym->name = &obj->strtab[sym->sym->st_name]; + + return 0; +} + +Elf32_Word eh_hash_gnu(const char *name) +{ + Elf32_Word hash = 5381; + const unsigned char *uname = (const unsigned char *) name; + int c; + + while ((c = *uname++) != '\0') + hash = (hash << 5) + hash + c; + + return hash & 0xffffffff; +} + +int eh_find_sym_gnu_hash(eh_obj_t *obj, const char *name, eh_sym_t *sym) +{ + Elf32_Word *buckets, *chain_zero, *hasharr; + ElfW(Addr) *bitmask, bitmask_word; + Elf32_Word symbias, bitmask_nwords, bucket, + nbuckets, bitmask_idxbits, shift; + Elf32_Word hash, hashbit1, hashbit2; + ElfW(Sym) *esym; + + if (!obj->gnu_hash) + return ENOTSUP; + + if (obj->gnu_hash[0] == 0) + return EAGAIN; + + sym->sym = NULL; + + /* + Initialize our hash table stuff + + DT_GNU_HASH is(?): + [nbuckets] [symbias] [bitmask_nwords] [shift] + [bitmask_nwords * ElfW(Addr)] <- bitmask + [nbuckets * Elf32_Word] <- buckets + ...chains? - symbias... + */ + nbuckets = obj->gnu_hash[0]; + symbias = obj->gnu_hash[1]; + bitmask_nwords = obj->gnu_hash[2]; /* must be power of two */ + bitmask_idxbits = bitmask_nwords - 1; + shift = obj->gnu_hash[3]; + bitmask = (ElfW(Addr) *) &obj->gnu_hash[4]; + buckets = &obj->gnu_hash[4 + (__ELF_NATIVE_CLASS / 32) * bitmask_nwords]; + chain_zero = &buckets[nbuckets] - symbias; + + /* hash our symbol */ + hash = eh_hash_gnu(name); + + /* bitmask stuff... no idea really :D */ + bitmask_word = bitmask[(hash / __ELF_NATIVE_CLASS) & bitmask_idxbits]; + hashbit1 = hash & (__ELF_NATIVE_CLASS - 1); + hashbit2 = (hash >> shift) & (__ELF_NATIVE_CLASS - 1); + + /* wtf this does actually? */ + if (!((bitmask_word >> hashbit1) & (bitmask_word >> hashbit2) & 1)) + return EAGAIN; + + /* locate bucket */ + bucket = buckets[hash % nbuckets]; + if (bucket == 0) + return EAGAIN; + + /* and find match in chain */ + hasharr = &chain_zero[bucket]; + do { + if (((*hasharr ^ hash) >> 1) == 0) { + /* hash matches, but does the name? */ + esym = &obj->symtab[hasharr - chain_zero]; + if (esym->st_name) { + if (!strcmp(&obj->strtab[esym->st_name], name)) { + sym->sym = esym; + break; + } + } + } + } while ((*hasharr++ & 1u) == 0); + + /* symbol not found */ + if (sym->sym == NULL) + return EAGAIN; + + sym->obj = obj; + sym->name = &obj->strtab[sym->sym->st_name]; + + return 0; +} + +int eh_iterate_sym(eh_obj_t *obj, eh_iterate_sym_callback_func callback, void *arg) +{ + return ENOTSUP; +} + +int eh_find_next_dyn(eh_obj_t *obj, ElfW_Sword tag, int i, ElfW(Dyn) **next) +{ + /* first from i + 1 to end, then from start to i - 1 */ + int p; + *next = NULL; + + p = i + 1; + while (obj->dynamic[p].d_tag != DT_NULL) { + if (obj->dynamic[p].d_tag == tag) { + *next = &obj->dynamic[p]; + return 0; + } + p++; + } + + p = 0; + while ((obj->dynamic[i].d_tag != DT_NULL) && (p < i)) { + if (obj->dynamic[p].d_tag == tag) { + *next = &obj->dynamic[p]; + return 0; + } + p++; + } + + return EAGAIN; +} + +int eh_set_rela_plt(eh_obj_t *obj, int p, const char *sym, void *val) +{ + ElfW(Rela) *rela = (ElfW(Rela) *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr); + ElfW(Dyn) *relasize; + unsigned int i; + + /* DT_PLTRELSZ contains PLT relocs size in bytes */ + if (eh_find_next_dyn(obj, DT_PLTRELSZ, p, &relasize)) + return EINVAL; /* b0rken elf :/ */ + + for (i = 0; i < relasize->d_un.d_val / sizeof(ElfW(Rela)); i++) { + if (!obj->symtab[ELFW_R_SYM(rela[i].r_info)].st_name) + continue; + + if (!strcmp(&obj->strtab[obj->symtab[ELFW_R_SYM(rela[i].r_info)].st_name], sym)) + *((void **) (rela[i].r_offset + obj->addr)) = val; + } + + return 0; +} + +int eh_set_rel_plt(eh_obj_t *obj, int p, const char *sym, void *val) +{ + ElfW(Rel) *rel = (ElfW(Rel) *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr); + ElfW(Dyn) *relsize; + unsigned int i; + + if (eh_find_next_dyn(obj, DT_PLTRELSZ, p, &relsize)) + return EINVAL; /* b0rken elf :/ */ + + for (i = 0; i < relsize->d_un.d_val / sizeof(ElfW(Rel)); i++) { + if (!obj->symtab[ELFW_R_SYM(rel[i].r_info)].st_name) + continue; + + if (!strcmp(&obj->strtab[obj->symtab[ELFW_R_SYM(rel[i].r_info)].st_name], sym)) + *((void **) (rel[i].r_offset + obj->addr)) = val; + } + + return 0; +} + +int eh_set_rel(eh_obj_t *obj, const char *sym, void *val) +{ + /* + Elf spec states that object is allowed to have multiple + .rel.plt and .rela.plt tables, so we will support 'em - here. + */ + ElfW(Dyn) *pltrel; + int ret, p = 0; + + while (obj->dynamic[p].d_tag != DT_NULL) { + /* DT_JMPREL contains .rel.plt or .rela.plt */ + if (obj->dynamic[p].d_tag == DT_JMPREL) { + /* DT_PLTREL tells if it is Rela or Rel */ + eh_find_next_dyn(obj, DT_PLTREL, p, &pltrel); + + if (pltrel->d_un.d_val == DT_RELA) { + if ((ret = eh_set_rela_plt(obj, p, sym, val))) + return ret; + } else if (pltrel->d_un.d_val == DT_REL) { + if ((ret = eh_set_rel_plt(obj, p, sym, val))) + return ret; + } else + return EINVAL; + } + p++; + } + + return 0; +} + +int eh_iterate_rela_plt(eh_obj_t *obj, int p, eh_iterate_rel_callback_func callback, void *arg) +{ + ElfW(Rela) *rela = (ElfW(Rela) *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr); + ElfW(Dyn) *relasize; + eh_rel_t rel; + eh_sym_t sym; + unsigned int i, ret; + + rel.sym = &sym; + rel.rel = NULL; + rel.obj = obj; + + if (eh_find_next_dyn(obj, DT_PLTRELSZ, p, &relasize)) + return EINVAL; + + for (i = 0; i < relasize->d_un.d_val / sizeof(ElfW(Rela)); i++) { + rel.rela = &rela[i]; + sym.sym = &obj->symtab[ELFW_R_SYM(rel.rela->r_info)]; + if (sym.sym->st_name) + sym.name = &obj->strtab[sym.sym->st_name]; + else + sym.name = NULL; + + if ((ret = callback(&rel, arg))) + return ret; + } + + return 0; +} + +int eh_iterate_rel_plt(eh_obj_t *obj, int p, eh_iterate_rel_callback_func callback, void *arg) +{ + ElfW(Rel) *relp = (ElfW(Rel) *) ABS_ADDR(obj, obj->dynamic[p].d_un.d_ptr); + ElfW(Dyn) *relsize; + eh_rel_t rel; + eh_sym_t sym; + unsigned int i, ret; + + rel.sym = &sym; + rel.rela = NULL; + rel.obj = obj; + + if (eh_find_next_dyn(obj, DT_PLTRELSZ, p, &relsize)) + return EINVAL; + + for (i = 0; i < relsize->d_un.d_val / sizeof(ElfW(Rel)); i++) { + rel.rel = &relp[i]; + sym.sym = &obj->symtab[ELFW_R_SYM(rel.rel->r_info)]; + if (sym.sym->st_name) + sym.name = &obj->strtab[sym.sym->st_name]; + else + sym.name = NULL; + + if ((ret = callback(&rel, arg))) + return ret; + } + + return 0; +} + +int eh_iterate_rel(eh_obj_t *obj, eh_iterate_rel_callback_func callback, void *arg) +{ + ElfW(Dyn) *pltrel; + int ret, p = 0; + + while (obj->dynamic[p].d_tag != DT_NULL) { + if (obj->dynamic[p].d_tag == DT_JMPREL) { + eh_find_next_dyn(obj, DT_PLTREL, p, &pltrel); + + if (pltrel->d_un.d_val == DT_RELA) { + if ((ret = eh_iterate_rela_plt(obj, p, callback, arg))) + return ret; + } else if (pltrel->d_un.d_val == DT_REL) { + if ((ret = eh_iterate_rel_plt(obj, p, callback, arg))) + return ret; + } else + return EINVAL; + } + p++; + } + + return 0; +} + +int eh_destroy_obj(eh_obj_t *obj) +{ + obj->phdr = NULL; + + return 0; +} + +/** \} */ diff --git a/src/elfs/elfhash.c b/src/elfs/elfhash.c index fefb0e7..23431b0 100644 --- a/src/elfs/elfhash.c +++ b/src/elfs/elfhash.c @@ -18,14 +18,20 @@ #include "elfload_dump.h" #include "elfloader_private.h" -const char* GetSymbolVersion(elfheader_t* h, int version) +const char* GetSymbolVersion32(elfheader_t* h, int version) +#ifndef BOX32 +{ return NULL; } +#else + ; +#endif +const char* GetSymbolVersion64(elfheader_t* h, int version) { if(version<2) return NULL; /*if(version==1) return "*";*/ - if(h->VerNeed) { - Elf64_Verneed *ver = (Elf64_Verneed*)((uintptr_t)h->VerNeed + h->delta); + if(h->VerNeed._64) { + Elf64_Verneed *ver = (Elf64_Verneed*)((uintptr_t)h->VerNeed._64 + h->delta); while(ver) { Elf64_Vernaux *aux = (Elf64_Vernaux*)((uintptr_t)ver + ver->vn_aux); for(int j=0; jvn_cnt; ++j) { @@ -38,12 +44,22 @@ const char* GetSymbolVersion(elfheader_t* h, int version) } return GetParentSymbolVersion(h, version); // if symbol is "internal", use Def table instead } +const char* GetSymbolVersion(elfheader_t* h, int version) +{ + return box64_is32bits?GetSymbolVersion32(h, version):GetSymbolVersion64(h, version); +} -const char* GetParentSymbolVersion(elfheader_t* h, int index) +const char* GetParentSymbolVersion32(elfheader_t* h, int index) +#ifndef BOX32 +{ return NULL; } +#else + ; +#endif +const char* GetParentSymbolVersion64(elfheader_t* h, int index) { - if(!h->VerDef || (index<1)) + if(!h->VerDef._64 || (index<1)) return NULL; - Elf64_Verdef *def = (Elf64_Verdef*)((uintptr_t)h->VerDef + h->delta); + Elf64_Verdef *def = (Elf64_Verdef*)((uintptr_t)h->VerDef._64 + h->delta); while(def) { if(def->vd_ndx==index) { if(def->vd_cnt<1) @@ -57,26 +73,47 @@ const char* GetParentSymbolVersion(elfheader_t* h, int index) } return NULL; } +const char* GetParentSymbolVersion(elfheader_t* h, int version) +{ + return box64_is32bits?GetParentSymbolVersion32(h, version):GetParentSymbolVersion64(h, version); +} -Elf64_Half GetParentSymbolVersionFlag(elfheader_t* h, int index) +uint16_t GetParentSymbolVersionFlag32(elfheader_t* h, int index) +#ifndef BOX32 + { return (uint16_t)-1; } +#else + ; +#endif +uint16_t GetParentSymbolVersionFlag64(elfheader_t* h, int index) { - if(!h->VerDef || (index<1)) - return (Elf64_Half)-1; - Elf64_Verdef *def = (Elf64_Verdef*)((uintptr_t)h->VerDef + h->delta); + if(!h->VerDef._64 || (index<1)) + return (uint16_t)-1; + Elf64_Verdef *def = (Elf64_Verdef*)((uintptr_t)h->VerDef._64 + h->delta); while(def) { if(def->vd_ndx==index) { return def->vd_flags; } def = def->vd_next?((Elf64_Verdef*)((uintptr_t)def + def->vd_next)):NULL; } - return (Elf64_Half)-1; + return (uint16_t)-1; } -Elf64_Half GetSymbolVersionFlag(elfheader_t* h, int version) +uint16_t GetParentSymbolVersionFlag(elfheader_t* h, int index) +{ + return box64_is32bits?GetParentSymbolVersionFlag32(h, index):GetParentSymbolVersionFlag64(h, index); +} + +uint16_t GetSymbolVersionFlag32(elfheader_t* h, int version) +#ifndef BOX32 +{ return (uint16_t)-1; } +#else + ; +#endif +uint16_t GetSymbolVersionFlag64(elfheader_t* h, int version) { if(version<2) - return (Elf64_Half)-1; - if(h->VerNeed) { - Elf64_Verneed *ver = (Elf64_Verneed*)((uintptr_t)h->VerNeed + h->delta); + return (uint16_t)-1; + if(h->VerNeed._64) { + Elf64_Verneed *ver = (Elf64_Verneed*)((uintptr_t)h->VerNeed._64 + h->delta); while(ver) { Elf64_Vernaux *aux = (Elf64_Vernaux*)((uintptr_t)ver + ver->vn_aux); for(int j=0; jvn_cnt; ++j) { @@ -89,14 +126,23 @@ Elf64_Half GetSymbolVersionFlag(elfheader_t* h, int version) } return GetParentSymbolVersionFlag(h, version); // if symbol is "internal", use Def table instead } +uint16_t GetSymbolVersionFlag(elfheader_t* h, int index) { + return box64_is32bits?GetSymbolVersionFlag32(h, index):GetSymbolVersionFlag64(h, index); +} -int GetVersionIndice(elfheader_t* h, const char* vername) +int GetVersionIndice32(elfheader_t* h, const char* vername) +#ifndef BOX32 +{ return 0; } +#else + ; +#endif +int GetVersionIndice64(elfheader_t* h, const char* vername) { if(!vername) return 0; - if(h->VerDef) { - Elf64_Verdef *def = (Elf64_Verdef*)((uintptr_t)h->VerDef + h->delta); + if(h->VerDef._64) { + Elf64_Verdef *def = (Elf64_Verdef*)((uintptr_t)h->VerDef._64 + h->delta); while(def) { Elf64_Verdaux *aux = (Elf64_Verdaux*)((uintptr_t)def + def->vd_aux); if(!strcmp(h->DynStr+aux->vda_name, vername)) @@ -106,13 +152,23 @@ int GetVersionIndice(elfheader_t* h, const char* vername) } return 0; } +int GetVersionIndice(elfheader_t* h, const char* vername) +{ + return box64_is32bits?GetVersionIndice32(h, vername):GetVersionIndice64(h, vername); +} -int GetNeededVersionCnt(elfheader_t* h, const char* libname) +int GetNeededVersionCnt32(elfheader_t* h, const char* libname) +#ifndef BOX32 +{ return 0; } +#else + ; +#endif +int GetNeededVersionCnt64(elfheader_t* h, const char* libname) { if(!libname) return 0; - if(h->VerNeed) { - Elf64_Verneed *ver = (Elf64_Verneed*)((uintptr_t)h->VerNeed + h->delta); + if(h->VerNeed._64) { + Elf64_Verneed *ver = (Elf64_Verneed*)((uintptr_t)h->VerNeed._64 + h->delta); while(ver) { char *filename = h->DynStr + ver->vn_file; if(!strcmp(filename, libname)) @@ -122,13 +178,23 @@ int GetNeededVersionCnt(elfheader_t* h, const char* libname) } return 0; } +int GetNeededVersionCnt(elfheader_t* h, const char* libname) +{ + return box64_is32bits?GetNeededVersionCnt32(h, libname):GetNeededVersionCnt64(h, libname); +} -const char* GetNeededVersionString(elfheader_t* h, const char* libname, int idx) +const char* GetNeededVersionString32(elfheader_t* h, const char* libname, int idx) +#ifndef BOX32 +{ return NULL; } +#else + ; +#endif +const char* GetNeededVersionString64(elfheader_t* h, const char* libname, int idx) { if(!libname) - return 0; - if(h->VerNeed) { - Elf64_Verneed *ver = (Elf64_Verneed*)((uintptr_t)h->VerNeed + h->delta); + return NULL; + if(h->VerNeed._64) { + Elf64_Verneed *ver = (Elf64_Verneed*)((uintptr_t)h->VerNeed._64 + h->delta); while(ver) { char *filename = h->DynStr + ver->vn_file; Elf64_Vernaux *aux = (Elf64_Vernaux*)((uintptr_t)ver + ver->vn_aux); @@ -145,6 +211,10 @@ const char* GetNeededVersionString(elfheader_t* h, const char* libname, int idx) } return NULL; } +const char* GetNeededVersionString(elfheader_t* h, const char* libname, int idx) +{ + return box64_is32bits?GetNeededVersionString32(h, libname, idx):GetNeededVersionString64(h, libname, idx); +} int GetNeededVersionForLib(elfheader_t* h, const char* libname, const char* ver) { @@ -197,7 +267,7 @@ uint32_t old_elf_hash(const char* name) return h; } -Elf64_Sym* old_elf_lookup(elfheader_t* h, const char* symname, int ver, const char* vername, int local, int veropt) +static Elf64_Sym* old_elf_lookup(elfheader_t* h, const char* symname, int ver, const char* vername, int local, int veropt) { // Prepare hash table const uint32_t *hashtab = (uint32_t*)(h->hash + h->delta); @@ -209,16 +279,16 @@ Elf64_Sym* old_elf_lookup(elfheader_t* h, const char* symname, int ver, const ch const uint32_t hash = old_elf_hash(symname); // Search for it for (uint32_t i = buckets[hash % nbuckets]; i; i = chains[i]) { - const char* name = h->DynStr + h->DynSym[i].st_name; + const char* name = h->DynStr + h->DynSym._64[i].st_name; if (!strcmp(symname, name) && SymbolMatch(h, i, ver, vername, local, veropt)) { - return &h->DynSym[i]; + return &h->DynSym._64[i]; } } return NULL; } -void old_elf_hash_dump(elfheader_t* h) +static void old_elf_hash_dump(elfheader_t* h) { // Prepare hash table const uint32_t *hashtab = (uint32_t*)(h->hash + h->delta); @@ -229,12 +299,12 @@ void old_elf_hash_dump(elfheader_t* h) printf_log(LOG_NONE, "------------ Dump HASH from %s\n", h->name); printf_log(LOG_NONE, "Buckets[%d] = \n", nbuckets); for(uint32_t i=0; iDynStr + h->DynSym[buckets[i]].st_name; + const char* name = h->DynStr + h->DynSym._64[buckets[i]].st_name; printf_log(LOG_NONE, "%d: %s\n", buckets[i], name); } printf_log(LOG_NONE,"Chains[%d] = ", nchains); for (uint32_t i = 0; ignu_hash + h->delta); @@ -272,10 +342,10 @@ Elf64_Sym* new_elf_lookup(elfheader_t* h, const char* symname, int ver, const ch if (symidx < symoffset) return NULL; while(1) { - const char* name = h->DynStr + h->DynSym[symidx].st_name; + const char* name = h->DynStr + h->DynSym._64[symidx].st_name; const uint32_t symhash = chains[symidx-symoffset]; if ((hash|1) == (symhash|1) && !strcmp(name, symname) && SymbolMatch(h, symidx, ver, vername, local, veropt)) { - return &h->DynSym[symidx]; + return &h->DynSym._64[symidx]; } if(symhash&1) return NULL; @@ -283,7 +353,7 @@ Elf64_Sym* new_elf_lookup(elfheader_t* h, const char* symname, int ver, const ch } } -void new_elf_hash_dump(elfheader_t* h) +static void new_elf_hash_dump(elfheader_t* h) { // Prepare hash table const uint32_t *hashtab = (uint32_t*)(h->gnu_hash + h->delta); @@ -299,34 +369,39 @@ void new_elf_hash_dump(elfheader_t* h) printf_log(LOG_NONE, "Buckets[%d] offset=%d = \n", nbuckets, symoffset); for(uint32_t i=0; i=symoffset) { - const char* name = h->DynStr + h->DynSym[symidx].st_name; + const char* name = h->DynStr + h->DynSym._64[symidx].st_name; const uint32_t hash = chains[symidx-symoffset]; if(hash&1) symidx=0; else symidx++; - printf_log(LOG_NONE, " %s (%x) -> %d", name, hash, symidx); + printf_log_prefix(0, LOG_NONE, " %s (%x) -> %d", name, hash, symidx); } printf_log(LOG_NONE, "\n"); } printf_log(LOG_NONE, "\n===============\n"); } -Elf64_Sym* ElfLookup(elfheader_t* h, const char* symname, int ver, const char* vername, int local, int veropt) +#ifndef BOX32 +Elf32_Sym* ElfLookup32(elfheader_t* h, const char* symname, int ver, const char* vername, int local, int veropt) { return NULL; } +Elf32_Sym* ElfSymTabLookup32(elfheader_t* h, const char* symname) { return NULL; } +Elf32_Sym* ElfDynSymLookup32(elfheader_t* h, const char* symname) { return NULL; } +#endif +Elf64_Sym* ElfLookup64(elfheader_t* h, const char* symname, int ver, const char* vername, int local, int veropt) { if(h->gnu_hash) return new_elf_lookup(h, symname, ver, vername, local, veropt); return old_elf_lookup(h, symname, ver, vername, local, veropt); } -Elf64_Sym* ElfSymTabLookup(elfheader_t* h, const char* symname) +Elf64_Sym* ElfSymTabLookup64(elfheader_t* h, const char* symname) { - if(!h->SymTab) + if(!h->SymTab._64) return 0; for(size_t i=0; inumSymTab; ++i) { - Elf64_Sym* sym = &h->SymTab[i]; + Elf64_Sym* sym = &h->SymTab._64[i]; int type = ELF64_ST_TYPE(sym->st_info); if(type==STT_FUNC || type==STT_TLS || type==STT_OBJECT) { const char * name = h->StrTab+sym->st_name; @@ -337,12 +412,12 @@ Elf64_Sym* ElfSymTabLookup(elfheader_t* h, const char* symname) return NULL; } -Elf64_Sym* ElfDynSymLookup(elfheader_t* h, const char* symname) +Elf64_Sym* ElfDynSymLookup64(elfheader_t* h, const char* symname) { - if(!h->DynSym) + if(!h->DynSym._64) return 0; for(size_t i=0; inumDynSym; ++i) { - Elf64_Sym* sym = &h->DynSym[i]; + Elf64_Sym* sym = &h->DynSym._64[i]; int type = ELF64_ST_TYPE(sym->st_info); if(type==STT_FUNC || type==STT_TLS || type==STT_OBJECT) { const char * name = h->DynStr+sym->st_name; diff --git a/src/elfs/elfhash32.c b/src/elfs/elfhash32.c new file mode 100644 index 0000000..dcb231a --- /dev/null +++ b/src/elfs/elfhash32.c @@ -0,0 +1,224 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "custommem.h" +#include "box64version.h" +#include "elfloader.h" +#include "debug.h" +#include "elfload_dump.h" +#include "elfloader_private.h" + +static int SymbolMatch(elfheader_t* h, uint32_t i, int ver, const char* vername, int local, int veropt) +{ + int version = h->VerSym?((Elf32_Half*)((uintptr_t)h->VerSym+h->delta))[i]:-1; + if(version!=-1) version &=0x7fff; + const char* symvername = GetSymbolVersion(h, version); + Elf32_Half flags = GetSymbolVersionFlag(h, version); + if(ver==-1 || version==-1) + return 1; + if(version==0 && !local) + return 0; + if(version<2 && ver>1 && veropt) + return 1; + if(ver==0 && version<2) + return 1; + if(ver==1 && version<2) + return 1; + if(ver<2 && version>1 && flags==0) // flag is not WEAK, so global works + return 1; + if(ver<2 || !symvername) + return 0; + return strcmp(vername, symvername)?0:1; +} + +uint16_t GetParentSymbolVersionFlag32(elfheader_t* h, int index) +{ + if(!h->VerDef._32 || (index<1)) + return (uint16_t)-1; + Elf32_Verdef *def = (Elf32_Verdef*)((uintptr_t)h->VerDef._32 + h->delta); + while(def) { + if(def->vd_ndx==index) { + return def->vd_flags; + } + def = def->vd_next?((Elf32_Verdef*)((uintptr_t)def + def->vd_next)):NULL; + } + return (uint16_t)-1; +} + +uint16_t GetSymbolVersionFlag32(elfheader_t* h, int version) +{ + if(version<2) + return (uint16_t)-1; + if(h->VerNeed._32) { + Elf32_Verneed *ver = (Elf32_Verneed*)((uintptr_t)h->VerNeed._32 + h->delta); + while(ver) { + Elf32_Vernaux *aux = (Elf32_Vernaux*)((uintptr_t)ver + ver->vn_aux); + for(int j=0; jvn_cnt; ++j) { + if(aux->vna_other==version) + return aux->vna_flags; + aux = (Elf32_Vernaux*)((uintptr_t)aux + aux->vna_next); + } + ver = ver->vn_next?((Elf32_Verneed*)((uintptr_t)ver + ver->vn_next)):NULL; + } + } + return GetParentSymbolVersionFlag32(h, version); // if symbol is "internal", use Def table instead +} + + +static Elf32_Sym* old_elf_lookup(elfheader_t* h, const char* symname, int ver, const char* vername, int local, int veropt) +{ + // Prepare hash table + const uint32_t *hashtab = (uint32_t*)(h->hash + h->delta); + const uint32_t nbuckets = hashtab[0]; + const uint32_t nchains = hashtab[1]; + const uint32_t *buckets = &hashtab[2]; + const uint32_t *chains = &buckets[nbuckets]; + // get hash from symname to lookup + const uint32_t hash = old_elf_hash(symname); + // Search for it + for (uint32_t i = buckets[hash % nbuckets]; i; i = chains[i]) { + const char* name = h->DynStr + h->DynSym._32[i].st_name; + if (!strcmp(symname, name) && SymbolMatch(h, i, ver, vername, local, veropt)) { + return &h->DynSym._32[i]; + } + } + return NULL; +} + + +static void old_elf_hash_dump(elfheader_t* h) +{ + // Prepare hash table + const uint32_t *hashtab = (uint32_t*)(h->hash + h->delta); + const uint32_t nbuckets = hashtab[0]; + const uint32_t nchains = hashtab[1]; + const uint32_t *buckets = &hashtab[2]; + const uint32_t *chains = &buckets[nbuckets]; + printf_log(LOG_NONE, "------------ Dump HASH from %s\n", h->name); + printf_log(LOG_NONE, "Buckets[%d] = \n", nbuckets); + for(uint32_t i=0; iDynStr + h->DynSym._32[buckets[i]].st_name; + printf_log(LOG_NONE, "%d: %s\n", buckets[i], name); + } + printf_log(LOG_NONE,"Chains[%d] = ", nchains); + for (uint32_t i = 0; ignu_hash + h->delta); + const uint32_t nbuckets = hashtab[0]; + const uint32_t symoffset = hashtab[1]; + const uint32_t bloom_size = hashtab[2]; + const uint32_t bloom_shift = hashtab[3]; + const uint32_t *blooms = (uint32_t*)&hashtab[4]; + const uint32_t *buckets = (uint32_t*)&blooms[bloom_size]; + const uint32_t *chains = &buckets[nbuckets]; + // get hash from symname to lookup + const uint32_t hash = new_elf_hash(symname); + // early check with bloom: if at least one bit is not set, a symbol is surely missing. + uint32_t word = blooms[(hash/32)%bloom_size]; + uint32_t mask = 0 + | 1LL << (hash%32) + | 1LL << ((hash>>bloom_shift)%32); + if ((word & mask) != mask) { + return NULL; + } + // now look at the bucket chain for the symbol + uint32_t symidx = buckets[hash%nbuckets]; + if (symidx < symoffset) + return NULL; + while(1) { + const char* name = h->DynStr + h->DynSym._32[symidx].st_name; + const uint32_t symhash = chains[symidx-symoffset]; + if ((hash|1) == (symhash|1) && !strcmp(name, symname) && SymbolMatch(h, symidx, ver, vername, local, veropt)) { + return &h->DynSym._32[symidx]; + } + if(symhash&1) + return NULL; + symidx++; + } +} + +static void new_elf_hash_dump(elfheader_t* h) +{ + // Prepare hash table + const uint32_t *hashtab = (uint32_t*)(h->gnu_hash + h->delta); + const uint32_t nbuckets = hashtab[0]; + const uint32_t symoffset = hashtab[1]; + const uint32_t bloom_size = hashtab[2]; + const uint32_t bloom_shift = hashtab[3]; + const uint32_t *blooms = (uint32_t*)&hashtab[4]; + const uint32_t *buckets = (uint32_t*)&blooms[bloom_size]; + const uint32_t *chains = &buckets[nbuckets]; + printf_log(LOG_NONE, "===============Dump GNU_HASH from %s\n", h->name); + printf_log(LOG_NONE, "Bloom: size=%d, shift=%d\n", bloom_size, bloom_shift); + printf_log(LOG_NONE, "Buckets[%d] offset=%d = \n", nbuckets, symoffset); + for(uint32_t i=0; i=symoffset) { + const char* name = h->DynStr + h->DynSym._32[symidx].st_name; + const uint32_t hash = chains[symidx-symoffset]; + if(hash&1) + symidx=0; + else + symidx++; + printf_log(LOG_NONE, " %s (%x) -> %d", name, hash, symidx); + } + printf_log(LOG_NONE, "\n"); + } + printf_log(LOG_NONE, "\n===============\n"); +} + +Elf32_Sym* ElfLookup32(elfheader_t* h, const char* symname, int ver, const char* vername, int local, int veropt) +{ + if(h->gnu_hash) + return new_elf_lookup(h, symname, ver, vername, local, veropt); + return old_elf_lookup(h, symname, ver, vername, local, veropt); +} + +Elf32_Sym* ElfSymTabLookup32(elfheader_t* h, const char* symname) +{ + if(!h->SymTab._32) + return 0; + for(size_t i=0; inumSymTab; ++i) { + Elf32_Sym* sym = &h->SymTab._32[i]; + int type = ELF32_ST_TYPE(sym->st_info); + if(type==STT_FUNC || type==STT_TLS || type==STT_OBJECT) { + const char * name = h->StrTab+sym->st_name; + if(name && !strcmp(symname, name)) + return sym; + } + } + return NULL; +} + +Elf32_Sym* ElfDynSymLookup32(elfheader_t* h, const char* symname) +{ + if(!h->DynSym._32) + return 0; + for(size_t i=0; inumDynSym; ++i) { + Elf32_Sym* sym = &h->DynSym._32[i]; + int type = ELF32_ST_TYPE(sym->st_info); + if(type==STT_FUNC || type==STT_TLS || type==STT_OBJECT) { + const char * name = h->DynStr+sym->st_name; + if(name && !strcmp(symname, name)) + return sym; + } + } + return NULL; +} diff --git a/src/elfs/elfload_dump.c b/src/elfs/elfload_dump.c index 62cedcf..eb492b3 100644 --- a/src/elfs/elfload_dump.c +++ b/src/elfs/elfload_dump.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "box64version.h" #include "elfloader.h" @@ -9,18 +10,14 @@ #include "elfload_dump.h" #include "elfloader_private.h" -#ifndef SHT_CHECKSUM -#define SHT_CHECKSUM 0x6ffffff8 -#endif - -const char* DumpSection(Elf64_Shdr *s, char* SST) { +static const char* DumpSection(Elf64_Shdr *s, char* SST) { static char buff[400]; switch (s->sh_type) { case SHT_NULL: return "SHT_NULL"; #define GO(A) \ case A: \ - sprintf(buff, #A " Name=\"%s\"(%d) off=0x%lX, size=%ld, attr=0x%04lX, addr=%p(%02lX), link/info=%d/%d", \ + sprintf(buff, #A " Name=\"%s\"(%d) off=0x%" PRIX64 ", size=%" PRId64 ", attr=0x%04" PRIX64 ", addr=%p(%02" PRIX64 "), link/info=%d/%d", \ SST+s->sh_name, s->sh_name, s->sh_offset, s->sh_size, s->sh_flags, (void*)s->sh_addr, s->sh_addralign, s->sh_link, s->sh_info); \ break GO(SHT_PROGBITS); @@ -64,14 +61,14 @@ const char* DumpSection(Elf64_Shdr *s, char* SST) { return buff; } -const char* DumpDynamic(Elf64_Dyn *s) { +static const char* DumpDynamic(Elf64_Dyn *s) { static char buff[200]; switch (s->d_tag) { case DT_NULL: return "DT_NULL: End Dynamic Section"; #define GO(A, Add) \ case A: \ - sprintf(buff, #A " %s=0x%lX", (Add)?"Addr":"Val", (Add)?s->d_un.d_ptr:s->d_un.d_val); \ + sprintf(buff, #A " %s=0x%" PRIX64, (Add)?"Addr":"Val", (Add)?s->d_un.d_ptr:s->d_un.d_val); \ break GO(DT_NEEDED, 0); GO(DT_PLTRELSZ, 0); @@ -143,18 +140,18 @@ const char* DumpDynamic(Elf64_Dyn *s) { #endif #undef GO default: - sprintf(buff, "0x%lX unknown type", s->d_tag); + sprintf(buff, "0x%" PRIX64 " unknown type", s->d_tag); } return buff; } -const char* DumpPHEntry(Elf64_Phdr *e) +static const char* DumpPHEntry(Elf64_Phdr *e) { static char buff[500]; memset(buff, 0, sizeof(buff)); switch(e->p_type) { case PT_NULL: sprintf(buff, "type: %s", "PT_NULL"); break; - #define GO(T) case T: sprintf(buff, "type: %s, Off=%lx vaddr=%p paddr=%p filesz=%lu memsz=%lu flags=%x align=%lu", #T, e->p_offset, (void*)e->p_vaddr, (void*)e->p_paddr, e->p_filesz, e->p_memsz, e->p_flags, e->p_align); break + #define GO(T) case T: sprintf(buff, "type: %s, Off=%" PRIx64 " vaddr=%p paddr=%p filesz=%" PRIu64 " memsz=%" PRIu64 " flags=%x align=%" PRIu64, #T, e->p_offset, (void*)e->p_vaddr, (void*)e->p_paddr, e->p_filesz, e->p_memsz, e->p_flags, e->p_align); break GO(PT_LOAD); GO(PT_DYNAMIC); GO(PT_INTERP); @@ -170,12 +167,14 @@ const char* DumpPHEntry(Elf64_Phdr *e) GO(PT_GNU_RELRO); #endif #undef GO - default: sprintf(buff, "type: %x, Off=%lx vaddr=%p paddr=%p filesz=%lu memsz=%lu flags=%x align=%lu", e->p_type, e->p_offset, (void*)e->p_vaddr, (void*)e->p_paddr, e->p_filesz, e->p_memsz, e->p_flags, e->p_align); break; + default: sprintf(buff, "type: %x, Off=%" PRIx64 " vaddr=%p paddr=%p filesz=%" PRIu64 " memsz=%" PRIu64 " flags=%x align=%" PRIu64, e->p_type, e->p_offset, (void*)e->p_vaddr, (void*)e->p_paddr, e->p_filesz, e->p_memsz, e->p_flags, e->p_align); break; } return buff; } - -const char* DumpRelType(int t) +#ifndef BOX32 +const char* DumpRelType32(int t) { return NULL; } +#endif +const char* DumpRelType64(int t) { static char buff[50]; memset(buff, 0, sizeof(buff)); @@ -229,30 +228,36 @@ const char* DumpRelType(int t) return buff; } -const char* DumpSym(elfheader_t *h, Elf64_Sym* sym, int version) +static const char* DumpSym(elfheader_t *h, Elf64_Sym* sym, int version) { static char buff[4096]; const char* vername = (version==-1)?"(none)":((version==0)?"*local*":((version==1)?"*global*":GetSymbolVersion(h, version))); int veropt = GetSymbolVersionFlag(h, version)?0:1; memset(buff, 0, sizeof(buff)); - sprintf(buff, "\"%s\", value=%p, size=%ld, info/other=%d/%d index=%d (%sver=%d/%s)", + sprintf(buff, "\"%s\", value=%p, size=%" PRIi64 ", info/other=%d/%d index=%d (%sver=%d/%s)", h->DynStr+sym->st_name, (void*)sym->st_value, sym->st_size, sym->st_info, sym->st_other, sym->st_shndx, veropt?"opt":"", version, vername); return buff; } -const char* SymName(elfheader_t *h, Elf64_Sym* sym) +#ifndef BOX32 +const char* SymName32(elfheader_t *h, Elf32_Sym* sym) { return NULL; } +#endif +const char* SymName64(elfheader_t *h, Elf64_Sym* sym) { return h->DynStr+sym->st_name; } -const char* IdxSymName(elfheader_t *h, int sym) +static const char* IdxSymName(elfheader_t *h, int sym) { - return h->DynStr+h->DynSym[sym].st_name; + return h->DynStr+h->DynSym._64[sym].st_name; } -void DumpMainHeader(Elf64_Ehdr *header, elfheader_t *h) +#ifndef BOX32 +void DumpMainHeader32(Elf32_Ehdr *header, elfheader_t *h) { } +#endif +void DumpMainHeader64(Elf64_Ehdr *header, elfheader_t *h) { - if(box64_dump) { + if(BOX64ENV(dump)) { printf_dump(LOG_NEVER, "ELF Dump main header\n"); printf_dump(LOG_NEVER, " Entry point = %p\n", (void*)header->e_entry); printf_dump(LOG_NEVER, " Program Header table offset = %p\n", (void*)header->e_phoff); @@ -266,110 +271,142 @@ void DumpMainHeader(Elf64_Ehdr *header, elfheader_t *h) printf_dump(LOG_NEVER, "ELF Dump PEntries (%zu)\n", h->numPHEntries); for (size_t i=0; inumPHEntries; ++i) - printf_dump(LOG_NEVER, " PHEntry %04zu : %s\n", i, DumpPHEntry(h->PHEntries+i)); + printf_dump(LOG_NEVER, " PHEntry %04zu : %s\n", i, DumpPHEntry(h->PHEntries._64+i)); printf_dump(LOG_NEVER, "ELF Dump PEntries ====\n"); printf_dump(LOG_NEVER, "ELF Dump Sections (%zu)\n", h->numSHEntries); for (size_t i=0; inumSHEntries; ++i) - printf_dump(LOG_NEVER, " Section %04zu : %s\n", i, DumpSection(h->SHEntries+i, h->SHStrTab)); + printf_dump(LOG_NEVER, " Section %04zu : %s\n", i, DumpSection(h->SHEntries._64+i, h->SHStrTab)); printf_dump(LOG_NEVER, "ELF Dump Sections ====\n"); } } - -void DumpSymTab(elfheader_t *h) +#ifndef BOX32 +void DumpSymTab32(elfheader_t *h) { } +#endif +void DumpSymTab64(elfheader_t *h) { - if(box64_dump && h->SymTab) { + if (BOX64ENV(dump) && h->SymTab._64) { const char* name = ElfName(h); printf_dump(LOG_NEVER, "ELF Dump SymTab(%zu)=\n", h->numSymTab); for (size_t i=0; inumSymTab; ++i) - printf_dump(LOG_NEVER, " %s:SymTab[%zu] = \"%s\", value=%p, size=%ld, info/other=%d/%d index=%d\n", name, - i, h->StrTab+h->SymTab[i].st_name, (void*)h->SymTab[i].st_value, h->SymTab[i].st_size, - h->SymTab[i].st_info, h->SymTab[i].st_other, h->SymTab[i].st_shndx); + printf_dump(LOG_NEVER, " %s:SymTab[%zu] = \"%s\", value=%p, size=%ld, info/other=%d/%d index=%d\n", name, + i, h->StrTab+h->SymTab._64[i].st_name, (void*)h->SymTab._64[i].st_value, h->SymTab._64[i].st_size, + h->SymTab._64[i].st_info, h->SymTab._64[i].st_other, h->SymTab._64[i].st_shndx); printf_dump(LOG_NEVER, "ELF Dump SymTab=====\n"); } } -void DumpDynamicSections(elfheader_t *h) +#ifndef BOX32 +void DumpDynamicSections32(elfheader_t *h) { } +#endif +void DumpDynamicSections64(elfheader_t *h) { - if(box64_dump && h->Dynamic) { + if (BOX64ENV(dump) && h->Dynamic._64) { printf_dump(LOG_NEVER, "ELF Dump Dynamic(%zu)=\n", h->numDynamic); for (size_t i=0; inumDynamic; ++i) - printf_dump(LOG_NEVER, " Dynamic %04zu : %s\n", i, DumpDynamic(h->Dynamic+i)); + printf_dump(LOG_NEVER, " Dynamic %04zu : %s\n", i, DumpDynamic(h->Dynamic._64+i)); printf_dump(LOG_NEVER, "ELF Dump Dynamic=====\n"); } } -void DumpDynSym(elfheader_t *h) +#ifndef BOX32 +void DumpDynSym32(elfheader_t *h) { } +#endif +void DumpDynSym64(elfheader_t *h) { - if(box64_dump && h->DynSym) { + if (BOX64ENV(dump) && h->DynSym._64) { const char* name = ElfName(h); printf_dump(LOG_NEVER, "ELF Dump DynSym(%zu)=\n", h->numDynSym); for (size_t i=0; inumDynSym; ++i) { int version = h->VerSym?((Elf64_Half*)((uintptr_t)h->VerSym+h->delta))[i]:-1; - printf_dump(LOG_NEVER, " %s:DynSym[%zu] = %s\n", name, i, DumpSym(h, h->DynSym+i, version)); + printf_dump(LOG_NEVER, " %s:DynSym[%zu] = %s\n", name, i, DumpSym(h, h->DynSym._64+i, version)); } printf_dump(LOG_NEVER, "ELF Dump DynSym=====\n"); } } +void DumpDynamicNeeded32(elfheader_t *h) +#ifndef BOX32 + { } +#else + ; +#endif void DumpDynamicNeeded(elfheader_t *h) { - if(box64_dump && h->DynStrTab) { + if(box64_is32bits) + DumpDynamicNeeded32(h); + else if (BOX64ENV(dump) && h->DynStrTab) { printf_dump(LOG_NEVER, "ELF Dump DT_NEEDED=====\n"); for (size_t i=0; inumDynamic; ++i) - if(h->Dynamic[i].d_tag==DT_NEEDED) { - printf_dump(LOG_NEVER, " Needed : %s\n", h->DynStrTab+h->Dynamic[i].d_un.d_val + h->delta); + if(h->Dynamic._64[i].d_tag==DT_NEEDED) { + printf_dump(LOG_NEVER, " Needed : %s\n", h->DynStrTab+h->Dynamic._64[i].d_un.d_val + h->delta); } printf_dump(LOG_NEVER, "ELF Dump DT_NEEDED=====\n"); } } +void DumpDynamicRPath32(elfheader_t *h) +#ifndef BOX32 + {} +#else + ; +#endif void DumpDynamicRPath(elfheader_t *h) { - if(box64_dump && h->DynStrTab) { + if(box64_is32bits) + DumpDynamicRPath32(h); + else if (BOX64ENV(dump) && h->DynStrTab) { printf_dump(LOG_NEVER, "ELF Dump DT_RPATH/DT_RUNPATH=====\n"); for (size_t i=0; inumDynamic; ++i) { - if(h->Dynamic[i].d_tag==DT_RPATH) { - printf_dump(LOG_NEVER, " RPATH : %s\n", h->DynStrTab+h->Dynamic[i].d_un.d_val + h->delta); + if(h->Dynamic._64[i].d_tag==DT_RPATH) { + printf_dump(LOG_NEVER, " RPATH : %s\n", h->DynStrTab+h->Dynamic._64[i].d_un.d_val + h->delta); } - if(h->Dynamic[i].d_tag==DT_RUNPATH) { - printf_dump(LOG_NEVER, " RUNPATH : %s\n", h->DynStrTab+h->Dynamic[i].d_un.d_val + h->delta); + if(h->Dynamic._64[i].d_tag==DT_RUNPATH) { + printf_dump(LOG_NEVER, " RUNPATH : %s\n", h->DynStrTab+h->Dynamic._64[i].d_un.d_val + h->delta); } } printf_dump(LOG_NEVER, "=====ELF Dump DT_RPATH/DT_RUNPATH\n"); } } -void DumpRelTable(elfheader_t *h, int cnt, Elf64_Rel *rel, const char* name) +#ifndef BOX32 +void DumpRelTable32(elfheader_t *h, int cnt, Elf32_Rel *rel, const char* name) { } +#endif +void DumpRelTable64(elfheader_t *h, int cnt, Elf64_Rel *rel, const char* name) { - if(box64_dump) { + if (BOX64ENV(dump)) { const char* elfname = ElfName(h); printf_dump(LOG_NEVER, "ELF Dump %s Table(%d) @%p\n", name, cnt, rel); for (int i = 0; irela) { + if (BOX64ENV(dump) && h->rela) { const char* elfname = ElfName(h); printf_dump(LOG_NEVER, "ELF Dump %s Table(%d) @%p\n", name, cnt, rela); for (int i = 0; irelr) { + if (BOX64ENV(dump) && h->relr) { const char* elfname = ElfName(h); printf_dump(LOG_NEVER, "ELF Dump %s Table(%d) @%p\n", name, cnt, relr); for (int i = 0; isz) n = sz; int fill = 16-sz; for (int j = 0; j127)?'.':d[j]); + printf_dump_prefix(0, LOG_NEVER, "%c", (d[j]<32 || d[j]>127)?'.':d[j]); for (int j = 0; j +#include +#include +#include + +#include "box64version.h" +#include "elfloader.h" +#include "debug.h" +#include "elfload_dump.h" +#include "elfloader_private.h" +#include "box32.h" + +static const char* DumpSection(Elf32_Shdr *s, char* SST) { + static char buff[400]; + switch (s->sh_type) { + case SHT_NULL: + return "SHT_NULL"; + #define GO(A) \ + case A: \ + sprintf(buff, #A " Name=\"%s\"(%d) off=0x%X, size=%d, attr=0x%04X, addr=%p(%02X), link/info=%d/%d", \ + SST+s->sh_name, s->sh_name, s->sh_offset, s->sh_size, s->sh_flags, from_ptrv(s->sh_addr), s->sh_addralign, s->sh_link, s->sh_info); \ + break + GO(SHT_PROGBITS); + GO(SHT_SYMTAB); + GO(SHT_STRTAB); + GO(SHT_RELA); + GO(SHT_HASH); + GO(SHT_DYNAMIC); + GO(SHT_NOTE); + GO(SHT_NOBITS); + GO(SHT_REL); + GO(SHT_SHLIB); + GO(SHT_DYNSYM); + GO(SHT_INIT_ARRAY); + GO(SHT_FINI_ARRAY); + GO(SHT_PREINIT_ARRAY); + GO(SHT_GROUP); + GO(SHT_SYMTAB_SHNDX); + GO(SHT_NUM); + GO(SHT_LOPROC); + GO(SHT_HIPROC); + GO(SHT_LOUSER); + GO(SHT_HIUSER); + #if defined(SHT_GNU_versym) && defined(SHT_GNU_ATTRIBUTES) + GO(SHT_GNU_versym); + GO(SHT_GNU_ATTRIBUTES); + GO(SHT_GNU_HASH); + GO(SHT_GNU_LIBLIST); + GO(SHT_CHECKSUM); + GO(SHT_LOSUNW); + //GO(SHT_SUNW_move); + GO(SHT_SUNW_COMDAT); + GO(SHT_SUNW_syminfo); + GO(SHT_GNU_verdef); + GO(SHT_GNU_verneed); + #endif + #undef GO + default: + sprintf(buff, "0x%X unknown type", s->sh_type); + } + return buff; +} + +static const char* DumpDynamic(Elf32_Dyn *s) { + static char buff[200]; + switch (s->d_tag) { + case DT_NULL: + return "DT_NULL: End Dynamic Section"; + #define GO(A, Add) \ + case A: \ + sprintf(buff, #A " %s=0x%X", (Add)?"Addr":"Val", (Add)?s->d_un.d_ptr:s->d_un.d_val); \ + break + GO(DT_NEEDED, 0); + GO(DT_PLTRELSZ, 0); + GO(DT_PLTGOT, 1); + GO(DT_HASH, 1); + GO(DT_STRTAB, 1); + GO(DT_SYMTAB, 1); + GO(DT_RELA, 1); + GO(DT_RELASZ, 0); + GO(DT_RELAENT, 0); + GO(DT_STRSZ, 0); + GO(DT_SYMENT, 0); + GO(DT_INIT, 1); + GO(DT_FINI, 1); + GO(DT_SONAME, 0); + GO(DT_RPATH, 0); + GO(DT_SYMBOLIC, 0); + GO(DT_REL, 1); + GO(DT_RELSZ, 0); + GO(DT_RELENT, 0); + GO(DT_PLTREL, 0); + GO(DT_DEBUG, 0); + GO(DT_TEXTREL, 0); + GO(DT_JMPREL, 1); + GO(DT_BIND_NOW, 1); + GO(DT_INIT_ARRAY, 1); + GO(DT_FINI_ARRAY, 1); + GO(DT_INIT_ARRAYSZ, 0); + GO(DT_FINI_ARRAYSZ, 0); + GO(DT_RUNPATH, 0); + GO(DT_FLAGS, 0); + GO(DT_ENCODING, 0); + #if defined(DT_NUM) && defined(DT_TLSDESC_PLT) + GO(DT_NUM, 0); + GO(DT_VALRNGLO, 0); + GO(DT_GNU_PRELINKED, 0); + GO(DT_GNU_CONFLICTSZ, 0); + GO(DT_GNU_LIBLISTSZ, 0); + GO(DT_CHECKSUM, 0); + GO(DT_PLTPADSZ, 0); + GO(DT_MOVEENT, 0); + GO(DT_MOVESZ, 0); + GO(DT_FEATURE_1, 0); + GO(DT_POSFLAG_1, 0); + GO(DT_SYMINSZ, 0); + GO(DT_SYMINENT, 0); + GO(DT_ADDRRNGLO, 0); + GO(DT_GNU_HASH, 0); + GO(DT_TLSDESC_PLT, 0); + GO(DT_TLSDESC_GOT, 0); + GO(DT_GNU_CONFLICT, 0); + GO(DT_GNU_LIBLIST, 0); + GO(DT_CONFIG, 0); + GO(DT_DEPAUDIT, 0); + GO(DT_AUDIT, 0); + GO(DT_PLTPAD, 0); + GO(DT_MOVETAB, 0); + GO(DT_SYMINFO, 0); + GO(DT_VERSYM, 0); + GO(DT_RELACOUNT, 0); + GO(DT_RELCOUNT, 0); + GO(DT_FLAGS_1, 0); + GO(DT_VERDEF, 0); + GO(DT_VERDEFNUM, 0); + GO(DT_VERNEED, 0); + GO(DT_VERNEEDNUM, 0); + GO(DT_AUXILIARY, 0); + GO(DT_FILTER, 0); + #endif + #undef GO + default: + sprintf(buff, "0x%X unknown type", s->d_tag); + } + return buff; +} + +static const char* DumpPHEntry(Elf32_Phdr *e) +{ + static char buff[500]; + memset(buff, 0, sizeof(buff)); + switch(e->p_type) { + case PT_NULL: sprintf(buff, "type: %s", "PT_NULL"); break; + #define GO(T) case T: sprintf(buff, "type: %s, Off=%x vaddr=%p paddr=%p filesz=%u memsz=%u flags=%x align=%u", #T, e->p_offset, from_ptrv(e->p_vaddr), from_ptrv(e->p_paddr), e->p_filesz, e->p_memsz, e->p_flags, e->p_align); break + GO(PT_LOAD); + GO(PT_DYNAMIC); + GO(PT_INTERP); + GO(PT_NOTE); + GO(PT_SHLIB); + GO(PT_PHDR); + GO(PT_TLS); + #ifdef PT_NUM + GO(PT_NUM); + GO(PT_LOOS); + GO(PT_GNU_EH_FRAME); + GO(PT_GNU_STACK); + GO(PT_GNU_RELRO); + #endif + #undef GO + default: sprintf(buff, "type: %x, Off=%x vaddr=%p paddr=%p filesz=%u memsz=%u flags=%x align=%u", e->p_type, e->p_offset, from_ptrv(e->p_vaddr), from_ptrv(e->p_paddr), e->p_filesz, e->p_memsz, e->p_flags, e->p_align); break; + } + return buff; +} + +const char* DumpRelType32(int t) +{ + static char buff[50]; + memset(buff, 0, sizeof(buff)); + switch(t) { + #define GO(T) case T: sprintf(buff, "type: %s", #T); break + GO(R_386_NONE); + GO(R_386_32); + GO(R_386_PC32); + GO(R_386_GOT32); + GO(R_386_PLT32); + GO(R_386_COPY); + GO(R_386_GLOB_DAT); + GO(R_386_JMP_SLOT); + GO(R_386_RELATIVE); + GO(R_386_GOTOFF); + GO(R_386_GOTPC); + GO(R_386_PC8); + GO(R_386_TLS_TPOFF); + GO(R_386_TLS_GD_32); + GO(R_386_TLS_DTPMOD32); + GO(R_386_TLS_DTPOFF32); + GO(R_386_TLS_TPOFF32); + #undef GO + default: sprintf(buff, "type: 0x%x (unknown)", t); break; + } + return buff; +} + +static const char* DumpSym(elfheader_t *h, Elf32_Sym* sym, int version) +{ + static char buff[4096]; + const char* vername = (version==-1)?"(none)":((version==0)?"*local*":((version==1)?"*global*":GetSymbolVersion(h, version))); + memset(buff, 0, sizeof(buff)); + sprintf(buff, "\"%s\", value=%p, size=%d, info/other=%d/%d index=%d (ver=%d/%s)", + h->DynStr+sym->st_name, from_ptrv(sym->st_value), sym->st_size, + sym->st_info, sym->st_other, sym->st_shndx, version, vername); + return buff; +} + +const char* SymName32(elfheader_t *h, Elf32_Sym* sym) +{ + return h->DynStr+sym->st_name; +} +static const char* IdxSymName(elfheader_t *h, int sym) +{ + return h->DynStr+h->DynSym._32[sym].st_name; +} + +void DumpMainHeader32(Elf32_Ehdr *header, elfheader_t *h) +{ + if (BOX64ENV(dump)) { + printf_dump(LOG_NEVER, "ELF Dump main header\n"); + printf_dump(LOG_NEVER, " Entry point = %p\n", from_ptrv(header->e_entry)); + printf_dump(LOG_NEVER, " Program Header table offset = %p\n", from_ptrv(header->e_phoff)); + printf_dump(LOG_NEVER, " Section Header table offset = %p\n", from_ptrv(header->e_shoff)); + printf_dump(LOG_NEVER, " Flags = 0x%X\n", header->e_flags); + printf_dump(LOG_NEVER, " ELF Header size = %d\n", header->e_ehsize); + printf_dump(LOG_NEVER, " Program Header Entry num/size = %d(%d)/%d\n", h->numPHEntries, header->e_phnum, header->e_phentsize); + printf_dump(LOG_NEVER, " Section Header Entry num/size = %d(%d)/%d\n", h->numSHEntries, header->e_shnum, header->e_shentsize); + printf_dump(LOG_NEVER, " Section Header index num = %d(%d)\n", h->SHIdx, header->e_shstrndx); + printf_dump(LOG_NEVER, "ELF Dump ==========\n"); + + printf_dump(LOG_NEVER, "ELF Dump PEntries (%d)\n", h->numSHEntries); + for (int i=0; inumPHEntries; ++i) + printf_dump(LOG_NEVER, " PHEntry %04d : %s\n", i, DumpPHEntry(h->PHEntries._32+i)); + printf_dump(LOG_NEVER, "ELF Dump PEntries ====\n"); + + printf_dump(LOG_NEVER, "ELF Dump Sections (%d)\n", h->numSHEntries); + for (int i=0; inumSHEntries; ++i) + printf_dump(LOG_NEVER, " Section %04d : %s\n", i, DumpSection(h->SHEntries._32+i, h->SHStrTab)); + printf_dump(LOG_NEVER, "ELF Dump Sections ====\n"); + } +} + +void DumpSymTab32(elfheader_t *h) +{ + if (BOX64ENV(dump) && h->SymTab._32) { + const char* name = ElfName(h); + printf_dump(LOG_NEVER, "ELF Dump SymTab(%zu)=\n", h->numSymTab); + for (size_t i=0; inumSymTab; ++i) + printf_dump(LOG_NEVER, " %s:SymTab[%zu] = \"%s\", value=%p, size=%d, info/other=%d/%d index=%d\n", name, + i, h->StrTab+h->SymTab._32[i].st_name, from_ptrv(h->SymTab._32[i].st_value), h->SymTab._32[i].st_size, + h->SymTab._32[i].st_info, h->SymTab._32[i].st_other, h->SymTab._32[i].st_shndx); + printf_dump(LOG_NEVER, "ELF Dump SymTab=====\n"); + } +} + +void DumpDynamicSections32(elfheader_t *h) +{ + if (BOX64ENV(dump) && h->Dynamic._32) { + printf_dump(LOG_NEVER, "ELF Dump Dynamic(%d)=\n", h->numDynamic); + for (size_t i=0; inumDynamic; ++i) + printf_dump(LOG_NEVER, " Dynamic %04d : %s\n", i, DumpDynamic(h->Dynamic._32+i)); + printf_dump(LOG_NEVER, "ELF Dump Dynamic=====\n"); + } +} + +void DumpDynSym32(elfheader_t *h) +{ + if (BOX64ENV(dump) && h->DynSym._32) { + const char* name = ElfName(h); + printf_dump(LOG_NEVER, "ELF Dump DynSym(%zu)=\n", h->numDynSym); + for (size_t i=0; inumDynSym; ++i) { + int version = h->VerSym?((Elf32_Half*)((uintptr_t)h->VerSym+h->delta))[i]:-1; + printf_dump(LOG_NEVER, " %s:DynSym[%zu] = %s\n", name, i, DumpSym(h, h->DynSym._32+i, version)); + } + printf_dump(LOG_NEVER, "ELF Dump DynSym=====\n"); + } +} + +void DumpDynamicNeeded32(elfheader_t *h) +{ + if (BOX64ENV(dump) && h->DynStrTab) { + printf_dump(LOG_NEVER, "ELF Dump DT_NEEDED=====\n"); + for (size_t i=0; inumDynamic; ++i) + if(h->Dynamic._32[i].d_tag==DT_NEEDED) { + printf_dump(LOG_NEVER, " Needed : %s\n", h->DynStrTab+h->Dynamic._32[i].d_un.d_val + h->delta); + } + printf_dump(LOG_NEVER, "ELF Dump DT_NEEDED=====\n"); + } +} + +void DumpDynamicRPath32(elfheader_t *h) +{ + if (BOX64ENV(dump) && h->DynStrTab) { + printf_dump(LOG_NEVER, "ELF Dump DT_RPATH/DT_RUNPATH=====\n"); + for (size_t i=0; inumDynamic; ++i) { + if(h->Dynamic._32[i].d_tag==DT_RPATH) { + printf_dump(LOG_NEVER, " RPATH : %s\n", h->DynStrTab+h->Dynamic._32[i].d_un.d_val + h->delta); + } + if(h->Dynamic._32[i].d_tag==DT_RUNPATH) { + printf_dump(LOG_NEVER, " RUNPATH : %s\n", h->DynStrTab+h->Dynamic._32[i].d_un.d_val + h->delta); + } + } + printf_dump(LOG_NEVER, "=====ELF Dump DT_RPATH/DT_RUNPATH\n"); + } +} + +void DumpRelTable32(elfheader_t *h, int cnt, Elf32_Rel *rel, const char* name) +{ + if (BOX64ENV(dump)) { + const char* elfname = ElfName(h); + printf_dump(LOG_NEVER, "ELF Dump %s Table(%d) @%p\n", name, cnt, rel); + for (int i = 0; irela) { + const char* elfname = ElfName(h); + printf_dump(LOG_NEVER, "ELF Dump %s Table(%d) @%p\n", name, cnt, rela); + for (int i = 0; irelr) { + const char* elfname = ElfName(h); + printf_dump(LOG_NEVER, "ELF Dump %s Table(%d) @%p\n", name, cnt, relr); + for (int i = 0; i #include #include +#include #ifndef _DLFCN_H #include #endif +#include "os.h" #include "custommem.h" #include "box64version.h" #include "elfloader.h" @@ -21,18 +23,23 @@ #include "elfload_dump.h" #include "elfloader_private.h" #include "librarian.h" -#include "x64run.h" #include "bridge.h" +#include "alternate.h" #include "wrapper.h" #include "box64context.h" #include "library.h" #include "x64emu.h" +#include "box64cpu.h" +#include "box64cpu_util.h" #include "box64stack.h" #include "callback.h" #include "box64stack.h" #include "wine_tools.h" #include "dictionnary.h" #include "symbols.h" +#include "cleanup.h" +#include "globalsymbols.h" +#include "elfhacks.h" #ifdef DYNAREC #include "dynablock.h" #endif @@ -41,12 +48,14 @@ #include "../tools/bridge_private.h" #include "x64tls.h" -void* my__IO_2_1_stderr_ = NULL; -void* my__IO_2_1_stdin_ = NULL; -void* my__IO_2_1_stdout_ = NULL; +void* my__IO_2_1_stderr_ = (void*)1; +void* my__IO_2_1_stdin_ = (void*)2; +void* my__IO_2_1_stdout_ = (void*)3; + +uintptr_t pltResolver64 = ~0LL; // return the index of header (-1 if it doesn't exist) -int getElfIndex(box64context_t* ctx, elfheader_t* head) { +static int getElfIndex(box64context_t* ctx, elfheader_t* head) { for (int i=0; ielfsize; ++i) if(ctx->elfs[i]==head) return i; @@ -55,7 +64,7 @@ int getElfIndex(box64context_t* ctx, elfheader_t* head) { elfheader_t* LoadAndCheckElfHeader(FILE* f, const char* name, int exec) { - elfheader_t *h = ParseElfHeader(f, name, exec); + elfheader_t *h = box64_is32bits?ParseElfHeader32(f, name, exec):ParseElfHeader64(f, name, exec); if(!h) return NULL; @@ -63,12 +72,12 @@ elfheader_t* LoadAndCheckElfHeader(FILE* f, const char* name, int exec) h->path = (char*)box_malloc(1); h->path[0] = '\0'; } - + h->refcnt = 0; h->file = f; h->fileno = fileno(f); - + return h; } @@ -80,22 +89,22 @@ void FreeElfHeader(elfheader_t** head) if(my_context) RemoveElfHeader(my_context, h); - box_free(h->PHEntries); - box_free(h->SHEntries); - box_free(h->SHStrTab); - box_free(h->StrTab); - box_free(h->Dynamic); - box_free(h->DynStr); - box_free(h->SymTab); - box_free(h->DynSym); + actual_free(h->PHEntries._64); //_64 or _32 doesn't mater for free, it's the same address + actual_free(h->SHEntries._64); + actual_free(h->SHStrTab); + actual_free(h->StrTab); + actual_free(h->Dynamic._64); + actual_free(h->DynStr); + actual_free(h->SymTab._64); + actual_free(h->DynSym._64); FreeElfMemory(h); - box_free(h->name); - box_free(h->path); + actual_free(h->name); + actual_free(h->path); if(h->file) fclose(h->file); - box_free(h); + actual_free(h); *head = NULL; } @@ -105,14 +114,24 @@ int CalcLoadAddr(elfheader_t* head) head->memsz = 0; head->paddr = head->vaddr = ~(uintptr_t)0; head->align = box64_pagesize; - for (size_t i=0; inumPHEntries; ++i) - if(head->PHEntries[i].p_type == PT_LOAD) { - if(head->paddr > (uintptr_t)head->PHEntries[i].p_paddr) - head->paddr = (uintptr_t)head->PHEntries[i].p_paddr; - if(head->vaddr > (uintptr_t)head->PHEntries[i].p_vaddr) - head->vaddr = (uintptr_t)head->PHEntries[i].p_vaddr; - } - + if(box64_is32bits) { + for (size_t i=0; inumPHEntries; ++i) + if(head->PHEntries._32[i].p_type == PT_LOAD) { + if(head->paddr > (uintptr_t)head->PHEntries._32[i].p_paddr) + head->paddr = (uintptr_t)head->PHEntries._32[i].p_paddr; + if(head->vaddr > (uintptr_t)head->PHEntries._32[i].p_vaddr) + head->vaddr = (uintptr_t)head->PHEntries._32[i].p_vaddr; + } + } else { + for (size_t i=0; inumPHEntries; ++i) + if(head->PHEntries._64[i].p_type == PT_LOAD) { + if(head->paddr > (uintptr_t)head->PHEntries._64[i].p_paddr) + head->paddr = (uintptr_t)head->PHEntries._64[i].p_paddr; + if(head->vaddr > (uintptr_t)head->PHEntries._64[i].p_vaddr) + head->vaddr = (uintptr_t)head->PHEntries._64[i].p_vaddr; + } + } + if(head->vaddr==~(uintptr_t)0 || head->paddr==~(uintptr_t)0) { printf_log(LOG_NONE, "Error: v/p Addr for Elf Load not set\n"); return 1; @@ -120,31 +139,58 @@ int CalcLoadAddr(elfheader_t* head) head->stacksz = 1024*1024; //1M stack size default? head->stackalign = 16; // default align for stack - for (size_t i=0; inumPHEntries; ++i) { - if(head->PHEntries[i].p_type == PT_LOAD) { - uintptr_t phend = head->PHEntries[i].p_vaddr - head->vaddr + head->PHEntries[i].p_memsz; - if(phend > head->memsz) - head->memsz = phend; - if(head->PHEntries[i].p_align > head->align) - head->align = head->PHEntries[i].p_align; - } - if(head->PHEntries[i].p_type == PT_GNU_STACK) { - if(head->stacksz < head->PHEntries[i].p_memsz) - head->stacksz = head->PHEntries[i].p_memsz; - if(head->stackalign < head->PHEntries[i].p_align) - head->stackalign = head->PHEntries[i].p_align; + if(box64_is32bits) + for (size_t i=0; inumPHEntries; ++i) { + if(head->PHEntries._32[i].p_type == PT_LOAD) { + uintptr_t phend = head->PHEntries._32[i].p_vaddr - head->vaddr + head->PHEntries._32[i].p_memsz; + if(phend > head->memsz) + head->memsz = phend; + if(head->PHEntries._32[i].p_align > head->align) + head->align = head->PHEntries._32[i].p_align; + } + if(head->PHEntries._32[i].p_type == PT_GNU_STACK) { + if(head->stacksz < head->PHEntries._32[i].p_memsz) + head->stacksz = head->PHEntries._32[i].p_memsz; + if(head->stackalign < head->PHEntries._32[i].p_align) + head->stackalign = head->PHEntries._32[i].p_align; + } + if(head->PHEntries._32[i].p_type == PT_TLS) { + head->tlsaddr = head->PHEntries._32[i].p_vaddr; + head->tlssize = head->PHEntries._32[i].p_memsz; + head->tlsfilesize = head->PHEntries._32[i].p_filesz; + head->tlsalign = head->PHEntries._32[i].p_align; + // force alignement... + if(head->tlsalign>1) + while(head->tlssize&(head->tlsalign-1)) + head->tlssize++; + } } - if(head->PHEntries[i].p_type == PT_TLS) { - head->tlsaddr = head->PHEntries[i].p_vaddr; - head->tlssize = head->PHEntries[i].p_memsz; - head->tlsfilesize = head->PHEntries[i].p_filesz; - head->tlsalign = head->PHEntries[i].p_align; - // force alignement... - if(head->tlsalign>1) - while(head->tlssize&(head->tlsalign-1)) - head->tlssize++; + else + for (size_t i=0; inumPHEntries; ++i) { + if(head->PHEntries._64[i].p_type == PT_LOAD) { + uintptr_t phend = head->PHEntries._64[i].p_vaddr - head->vaddr + head->PHEntries._64[i].p_memsz; + if(phend > head->memsz) + head->memsz = phend; + if(head->PHEntries._64[i].p_align > head->align) + head->align = head->PHEntries._64[i].p_align; + } + if(head->PHEntries._64[i].p_type == PT_GNU_STACK) { + if(head->stacksz < head->PHEntries._64[i].p_memsz) + head->stacksz = head->PHEntries._64[i].p_memsz; + if(head->stackalign < head->PHEntries._64[i].p_align) + head->stackalign = head->PHEntries._64[i].p_align; + } + if(head->PHEntries._64[i].p_type == PT_TLS) { + head->tlsaddr = head->PHEntries._64[i].p_vaddr; + head->tlssize = head->PHEntries._64[i].p_memsz; + head->tlsfilesize = head->PHEntries._64[i].p_filesz; + head->tlsalign = head->PHEntries._64[i].p_align; + // force alignement... + if(head->tlsalign>1) + while(head->tlssize&(head->tlsalign-1)) + head->tlssize++; + } } - } printf_log(LOG_DEBUG, "Elf Addr(v/p)=%p/%p Memsize=0x%zx (align=0x%zx)\n", (void*)head->vaddr, (void*)head->paddr, head->memsz, head->align); printf_log(LOG_DEBUG, "Elf Stack Memsize=%zu (align=%zu)\n", head->stacksz, head->stackalign); printf_log(LOG_DEBUG, "Elf TLS Memsize=%zu (align=%zu)\n", head->tlssize, head->tlsalign); @@ -165,23 +211,31 @@ const char* ElfPath(elfheader_t* head) return head->path; } +int AllocLoadElfMemory32(box64context_t* context, elfheader_t* head, int mainbin) +#ifndef BOX32 +{ return 1; } +#else + ; +#endif int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) { + if(box64_is32bits) + return AllocLoadElfMemory32(context, head, mainbin); uintptr_t offs = 0; loadProtectionFromMap(); - int log_level = box64_load_addr?LOG_INFO:LOG_DEBUG; + int log_level = BOX64ENV(load_addr)?LOG_INFO:LOG_DEBUG; head->multiblock_n = 0; // count PHEntrie with LOAD uintptr_t max_align = head->align-1; - for (size_t i=0; inumPHEntries; ++i) - if(head->PHEntries[i].p_type == PT_LOAD && head->PHEntries[i].p_flags) { + for (size_t i=0; inumPHEntries; ++i) + if(head->PHEntries._64[i].p_type == PT_LOAD && head->PHEntries._64[i].p_flags) { ++head->multiblock_n; } - if(!head->vaddr && box64_load_addr) { - offs = (uintptr_t)find47bitBlockNearHint((void*)((box64_load_addr+max_align)&~max_align), head->memsz+head->align, max_align); - box64_load_addr = offs + head->memsz; - box64_load_addr = (box64_load_addr+0x10ffffffLL)&~0xffffffLL; + if(!head->vaddr && BOX64ENV(load_addr)) { + offs = (uintptr_t)find47bitBlockNearHint((void*)((BOX64ENV(load_addr)+max_align)&~max_align), head->memsz+head->align, max_align); + BOX64ENV(load_addr) = offs + head->memsz; + BOX64ENV(load_addr) = (BOX64ENV(load_addr)+0x10ffffffLL)&~0xffffffLL; } if(!offs && !head->vaddr) offs = (uintptr_t)find47bitBlockElf(head->memsz+head->align, mainbin, max_align); // limit to 47bits... @@ -191,25 +245,32 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) void* image = NULL; if(!head->vaddr) { sz += head->align; - raw = mmap64((void*)offs, sz, 0, MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0); + raw = InternalMmap((void*)offs, sz, 0, MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0); image = (void*)(((uintptr_t)raw+max_align)&~max_align); } else { - image = raw = mmap64((void*)head->vaddr, sz, 0, MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0); + image = raw = InternalMmap((void*)head->vaddr, sz, 0, MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0); + if(head->vaddr&(box64_pagesize-1)) { + // load address might be lower + if((uintptr_t)image == (head->vaddr&~(box64_pagesize-1))) { + image = (void*)head->vaddr; + sz += ((uintptr_t)image)-((uintptr_t)raw); + } + } } if(image!=MAP_FAILED && !head->vaddr && image!=(void*)offs) { printf_log(LOG_INFO, "%s: Mmap64 for (@%p 0x%zx) for elf \"%s\" returned %p(%p/0x%zx) instead\n", (((uintptr_t)image)&max_align)?"Error":"Warning", (void*)(head->vaddr?head->vaddr:offs), head->memsz, head->name, image, raw, head->align); offs = (uintptr_t)image; if(((uintptr_t)image)&max_align) { - munmap(raw, sz); + InternalMunmap(raw, sz); return 1; // that's an error, alocated memory is not aligned properly } } if(image==MAP_FAILED || image!=(void*)(head->vaddr?head->vaddr:offs)) { printf_log(LOG_NONE, "%s cannot create memory map (@%p 0x%zx) for elf \"%s\"", (image==MAP_FAILED)?"Error:":"Warning:", (void*)(head->vaddr?head->vaddr:offs), head->memsz, head->name); if(image==MAP_FAILED) { - printf_log(LOG_NONE, " error=%d/%s\n", errno, strerror(errno)); + printf_log_prefix(0, LOG_NONE, " error=%d/%s\n", errno, strerror(errno)); } else { - printf_log(LOG_NONE, " got %p\n", image); + printf_log_prefix(0, LOG_NONE, " got %p\n", image); } if(image==MAP_FAILED) return 1; @@ -230,19 +291,20 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) head->memory = (char*)0xffffffffffffffff; int n = 0; for (size_t i=0; inumPHEntries; ++i) { - if(head->PHEntries[i].p_type == PT_LOAD && head->PHEntries[i].p_flags) { - Elf64_Phdr * e = &head->PHEntries[i]; + if(head->PHEntries._64[i].p_type == PT_LOAD && head->PHEntries._64[i].p_flags) { + Elf64_Phdr * e = &head->PHEntries._64[i]; head->multiblocks[n].flags = e->p_flags; head->multiblocks[n].offs = e->p_offset; head->multiblocks[n].paddr = e->p_paddr + offs; head->multiblocks[n].size = e->p_filesz; head->multiblocks[n].align = e->p_align; - uint8_t prot = ((e->p_flags & PF_R)?PROT_READ:0)|((e->p_flags & PF_W)?PROT_WRITE:0)|((e->p_flags & PF_X)?PROT_EXEC:0); + // HACK: Mark all the code pages writable in unittest mode because some tests mix code and (writable) data... + uint8_t prot = ((e->p_flags & PF_R)?PROT_READ:0)|(((e->p_flags & PF_W) || box64_unittest_mode)?PROT_WRITE:0)|((e->p_flags & PF_X)?PROT_EXEC:0); // check if alignment is correct uintptr_t balign = head->multiblocks[n].align-1; - if(balign<4095) balign = 4095; - head->multiblocks[n].asize = (e->p_memsz+(e->p_paddr&balign)+4095)&~4095; + if (balign < (box64_pagesize - 1)) balign = box64_pagesize - 1; + head->multiblocks[n].asize = (e->p_memsz + (e->p_paddr & balign) + (box64_pagesize - 1)) & ~(box64_pagesize - 1); int try_mmap = 1; if(e->p_paddr&balign) try_mmap = 0; @@ -255,10 +317,10 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) if(e->p_alignmultiblocks[n].size, head->multiblocks[n].asize, (void*)head->multiblocks[n].paddr, head->name); - void* p = mmap64( - (void*)head->multiblocks[n].paddr, - head->multiblocks[n].size, + printf_dump(log_level, "Mmaping 0x%lx(0x%lx) bytes @%p with prot %x for Elf \"%s\"\n", head->multiblocks[n].size, head->multiblocks[n].asize, (void*)head->multiblocks[n].paddr, prot, head->name); + void* p = InternalMmap( + (void*)head->multiblocks[n].paddr, + head->multiblocks[n].size, prot, MAP_PRIVATE|MAP_FIXED, //((prot&PROT_WRITE)?MAP_SHARED:MAP_PRIVATE)|MAP_FIXED, head->fileno, @@ -280,8 +342,8 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) size_t asize = head->multiblocks[n].asize+(head->multiblocks[n].paddr-paddr); void* p = MAP_FAILED; if(paddr==(paddr&~(box64_pagesize-1)) && (asize==ALIGN(asize))) { - printf_dump(log_level, "Mmapping 0x%zx (0x%zx) bytes @%p, will read 0x%zx @%p for Elf \"%s\"\n", asize, e->p_memsz, (void*)paddr, e->p_filesz, (void*)head->multiblocks[n].paddr, head->name); - p = mmap64( + printf_dump(log_level, "Allocating 0x%zx (0x%zx) bytes @%p, will read 0x%zx @%p for Elf \"%s\"\n", asize, e->p_memsz, (void*)paddr, e->p_filesz, (void*)head->multiblocks[n].paddr, head->name); + p = InternalMmap( (void*)paddr, asize, prot|PROT_WRITE, @@ -304,7 +366,7 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) } if(new_size>0) { printf_dump(log_level, "Allocating 0x%zx (0x%zx/0x%zx) bytes @%p, will read 0x%zx @%p for Elf \"%s\"\n", ALIGN(new_size), paddr, e->p_memsz, (void*)new_addr, e->p_filesz, (void*)head->multiblocks[n].paddr, head->name); - p = mmap64( + p = InternalMmap( (void*)new_addr, ALIGN(new_size), prot|PROT_WRITE, @@ -316,7 +378,7 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) p = (void*)paddr; } else { p = (void*)paddr; - printf_dump(log_level, "Will read 0x%zx @%p for Elf \"%s\"\n", e->p_filesz, (void*)head->multiblocks[n].paddr, head->name); + printf_dump(log_level, "Will read 0x%zx @%p for Elf \"%s\"\n", e->p_filesz, (void*)head->multiblocks[n].paddr, head->name); } } if(p==MAP_FAILED || p!=(void*)paddr) { @@ -341,7 +403,7 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) mprotect((void*)paddr, asize, prot); } #ifdef DYNAREC - if(box64_dynarec && (e->p_flags & PF_X)) { + if(BOX64ENV(dynarec) && (e->p_flags & PF_X)) { dynarec_log(LOG_DEBUG, "Add ELF eXecutable Memory %p:%p\n", head->multiblocks[n].p, (void*)head->multiblocks[n].asize); addDBFromAddressRange((uintptr_t)head->multiblocks[n].p, head->multiblocks[n].asize); } @@ -350,8 +412,8 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) head->memory = (char*)head->multiblocks[n].p; ++n; } - if(head->PHEntries[i].p_type == PT_TLS) { - Elf64_Phdr * e = &head->PHEntries[i]; + if(head->PHEntries._64[i].p_type == PT_TLS) { + Elf64_Phdr * e = &head->PHEntries._64[i]; char* dest = (char*)(context->tlsdata+context->tlssize+head->tlsbase); printf_log(LOG_DEBUG, "Loading TLS block #%zu @%p (0x%zx/0x%zx)\n", i, dest, e->p_filesz, e->p_memsz); if(e->p_filesz) { @@ -366,12 +428,15 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) memset(dest+e->p_filesz, 0, e->p_memsz - e->p_filesz); } } - + // record map + RecordEnvMappings((uintptr_t)head->image, head->memsz, head->fileno); // can close the elf file now! fclose(head->file); head->file = NULL; head->fileno = -1; + PatchLoadedDynamicSection(head); + return 0; } @@ -381,7 +446,7 @@ void FreeElfMemory(elfheader_t* head) #ifdef DYNAREC for(int i=0; imultiblock_n; ++i) { dynarec_log(LOG_INFO, "Free DynaBlocks %p-%p for %s\n", head->multiblocks[i].p, head->multiblocks[i].p+head->multiblocks[i].asize, head->path); - if(box64_dynarec) + if(BOX64ENV(dynarec)) cleanDBFromAddressRange((uintptr_t)head->multiblocks[i].p, head->multiblocks[i].asize, 1); freeProtection((uintptr_t)head->multiblocks[i].p, head->multiblocks[i].asize); } @@ -391,7 +456,7 @@ void FreeElfMemory(elfheader_t* head) // we only need to free the overall mmap, no need to free individual part as they are inside the big one if(head->raw && head->raw_size) { dynarec_log(LOG_INFO, "Unmap elf memory %p-%p for %s\n", head->raw, head->raw+head->raw_size, head->path); - munmap(head->raw, head->raw_size); + InternalMunmap(head->raw, head->raw_size); } freeProtection((uintptr_t)head->raw, head->raw_size); } @@ -400,7 +465,7 @@ int isElfHasNeededVer(elfheader_t* head, const char* libname, elfheader_t* verne { if(!verneeded || !head) return 1; - if(!head->VerDef || !verneeded->VerNeed) + if(!head->VerDef._64 || !verneeded->VerNeed._64) return 1; int cnt = GetNeededVersionCnt(verneeded, libname); for (int i=0; iSymTab && addr>=(uintptr_t)h->SymTab && addr<(uintptr_t)&h->SymTab[h->numSymTab]) + if(h->SymTab._64 && addr>=(uintptr_t)h->SymTab._64 && addr<(uintptr_t)&h->SymTab._64[h->numSymTab]) return 1; - if(h->DynSym && addr>=(uintptr_t)h->DynSym && addr<(uintptr_t)&h->DynSym[h->numDynSym]) + if(h->DynSym._64 && addr>=(uintptr_t)h->DynSym._64 && addr<(uintptr_t)&h->DynSym._64[h->numDynSym]) return 1; return 0; } @@ -431,11 +496,11 @@ static elfheader_t* FindElfSymbol(box64context_t *context, Elf64_Sym* sym) for (int i=0; ielfsize; ++i) if(IsSymInElfSpace(context->elfs[i], sym)) return context->elfs[i]; - + return NULL; } -int FindR64COPYRel(elfheader_t* h, const char* name, uintptr_t *offs, uint64_t** p, size_t size, int version, const char* vername, int veropt) +static int FindR64COPYRel(elfheader_t* h, const char* name, uintptr_t *offs, uint64_t** p, size_t size, int version, const char* vername, int veropt) { if(!h) return 0; @@ -445,8 +510,8 @@ int FindR64COPYRel(elfheader_t* h, const char* name, uintptr_t *offs, uint64_t** int cnt = h->relasz / h->relaent; for (int i=0; iDynSym[ELF64_R_SYM(rela[i].r_info)]; - const char* symname = SymName(h, sym); + Elf64_Sym *sym = &h->DynSym._64[ELF64_R_SYM(rela[i].r_info)]; + const char* symname = SymName64(h, sym); if((t==R_X86_64_COPY) && symname && !strcmp(symname, name) && (sym->st_size==size)) { int version2 = h->VerSym?((Elf64_Half*)((uintptr_t)h->VerSym+h->delta))[ELF64_R_SYM(rela[i].r_info)]:-1; if(version2!=-1) version2 &= 0x7fff; @@ -464,7 +529,7 @@ int FindR64COPYRel(elfheader_t* h, const char* name, uintptr_t *offs, uint64_t** return 0; } -int RelocateElfREL(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head, int cnt, Elf64_Rel *rel) +static int RelocateElfREL(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head, int cnt, Elf64_Rel *rel) { printf_log(LOG_NONE, "Error: REL type of Relocation unsupported (only RELA)\n"); return 1; @@ -483,7 +548,7 @@ EXPORT uintptr_t my__dl_tlsdesc_undefweak(x64emu_t* emu) return td->arg; } -void GrabX64CopyMainElfReloc(elfheader_t* head) +static void GrabX64CopyMainElfReloc(elfheader_t* head) { if(head->rela) { int cnt = head->relasz / head->relaent; @@ -492,8 +557,8 @@ void GrabX64CopyMainElfReloc(elfheader_t* head) for (int i=0; iDynSym[ELF64_R_SYM(rela[i].r_info)]; - const char* symname = SymName(head, sym); + Elf64_Sym *sym = &head->DynSym._64[ELF64_R_SYM(rela[i].r_info)]; + const char* symname = SymName64(head, sym); int version = head->VerSym?((Elf64_Half*)((uintptr_t)head->VerSym+head->delta))[ELF64_R_SYM(rela[i].r_info)]:-1; if(version!=-1) version &=0x7fff; const char* vername = GetSymbolVersion(head, version); @@ -505,21 +570,6 @@ void GrabX64CopyMainElfReloc(elfheader_t* head) } } } -void CheckGNUUniqueBindings(elfheader_t* head) -{ - if(head->rela) { - int cnt = head->relasz / head->relaent; - Elf64_Rela* rela = (Elf64_Rela *)(head->rela + head->delta); - printf_dump(LOG_DEBUG, "Checking for symbol with STB_GNU_UNIQUE bindingsfor %s\n", head->name); - for (int i=0; ignuunique = 1; - return; // can stop searching - } - } - } -} static elfheader_t* checkElfLib(elfheader_t* h, library_t* lib) { @@ -531,15 +581,15 @@ static elfheader_t* checkElfLib(elfheader_t* h, library_t* lib) return h; } -int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head, int cnt, Elf64_Rela *rela, int* need_resolv) +static int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head, int cnt, Elf64_Rela *rela, int* need_resolv) { int ret_ok = 0; for (int i=0; iDynSym[ELF64_R_SYM(rela[i].r_info)]; + Elf64_Sym *sym = &head->DynSym._64[ELF64_R_SYM(rela[i].r_info)]; int bind = ELF64_ST_BIND(sym->st_info); //uint64_t ndx = sym->st_shndx; - const char* symname = SymName(head, sym); + const char* symname = SymName64(head, sym); uint64_t *p = (uint64_t*)(rela[i].r_offset + head->delta); uintptr_t offs = 0; uintptr_t end = 0; @@ -554,7 +604,11 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbin Elf64_Sym* elfsym = NULL; int vis = ELF64_ST_VISIBILITY(sym->st_other); if(vis==STV_PROTECTED) { - elfsym = ElfDynSymLookup(head, symname); + elfsym = ElfDynSymLookup64(head, symname); + if(elfsym) { + offs = elfsym->st_value + head->delta; + end = offs + elfsym->st_size; + } printf_log(LOG_DEBUG, "Symbol %s from %s is PROTECTED\n", symname, head->name); } else { if(bind==STB_GNU_UNIQUE) { @@ -566,7 +620,7 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbin offs = sym->st_value + head->delta; end = offs + sym->st_size; } else { - elfsym = ElfDynSymLookup(head, symname); + elfsym = ElfDynSymLookup64(head, symname); if(elfsym && elfsym->st_shndx) { offs = elfsym->st_value + head->delta; end = offs + elfsym->st_size; @@ -594,12 +648,13 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbin uint64_t* globp; uintptr_t tmp = 0; intptr_t delta; + int global; switch(t) { case R_X86_64_NONE: break; case R_X86_64_PC32: // should be "S + A - P" with S=symbol offset, A=addend and P=place of the storage unit, write a word32 - // can be ignored + // can be ignored (so *p = offs + addend - p) break; case R_X86_64_RELATIVE: printf_dump(LOG_NEVER, "Apply %s R_X86_64_RELATIVE @%p (%p -> %p)\n", BindSym(bind), p, *(void**)p, (void*)(head->delta+ rela[i].r_addend)); @@ -636,13 +691,17 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbin } break; case R_X86_64_GLOB_DAT: - if(GetSymbolStartEnd(my_context->globdata, symname, &globoffs, &globend, version, vername, 1, veropt)) { + if((global = GetSymbolStartEnd(my_context->globdata, symname, &globoffs, &globend, version, vername, 1, veropt))) { globp = (uint64_t*)globoffs; - printf_dump(LOG_NEVER, "Apply %s R_X86_64_GLOB_DAT with R_X86_64_COPY @%p/%p (%p/%p -> %p/%p) size=%zd on sym=%s (%sver=%d/%s) \n", - BindSym(bind), p, globp, (void*)(p?(*p):0), + printf_dump(LOG_NEVER, "Apply %s R_X86_64_GLOB_DAT with R_X86_64_COPY @%p/%p (%p/%p -> %p/%p) size=%zd on sym=%s (%sver=%d/%s) \n", + BindSym(bind), p, globp, (void*)(p?(*p):0), (void*)(globp?(*globp):0), (void*)offs, (void*)globoffs, sym->st_size, symname, veropt?"opt":"", version, vername?vername:"(none)"); sym_elf = my_context->elfs[0]; *p = globoffs; + #ifndef STATICBUILD + if(global==2) + addGlobalRef(p, symname); + #endif } else { if (!offs) { if(strcmp(symname, "__gmon_start__") && strcmp(symname, "data_start") && strcmp(symname, "__data_start") && strcmp(symname, "collector_func_load")) @@ -657,9 +716,9 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbin case R_X86_64_JUMP_SLOT: // apply immediatly for gobject closure marshal or for LOCAL binding. Also, apply immediatly if it doesn't jump in the got tmp = (uintptr_t)(*p); - if (bind==STB_LOCAL - || ((symname && strstr(symname, "g_cclosure_marshal_")==symname)) - || ((symname && strstr(symname, "__pthread_unwind_next")==symname)) + if (bind==STB_LOCAL + || ((symname && strstr(symname, "g_cclosure_marshal_")==symname)) + || ((symname && strstr(symname, "__pthread_unwind_next")==symname)) || !tmp || !((tmp>=head->plt && tmpplt_end) || (tmp>=head->gotplt && tmpgotplt_end)) || !need_resolv @@ -669,13 +728,13 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbin if(bind==STB_WEAK) { printf_log(LOG_INFO, "Warning: Weak Symbol %s not found, cannot apply R_X86_64_JUMP_SLOT @%p (%p)\n", symname, p, *(void**)p); } else { - printf_log(LOG_NONE, "Error: Symbol %s not found, cannot apply R_X86_64_JUMP_SLOT @%p (%p) in %s\n", symname, p, *(void**)p, head->name); + printf_log(LOG_NONE, "Error: Symbol %s not found, cannot apply R_X86_64_JUMP_SLOT @%p (%p) in %s (%sver=%d / %s)\n", symname, p, *(void**)p, head->name, veropt?"opt":"", version, vername?vername:"(none)"); ret_ok = 1; } // return -1; } else { if(p) { - printf_dump(LOG_NEVER, "Apply %s R_X86_64_JUMP_SLOT @%p with sym=%s (%p -> %p / %s (%sver=%d / %s))\n", + printf_dump(LOG_NEVER, "Apply %s R_X86_64_JUMP_SLOT @%p with sym=%s (%p -> %p / %s (%sver=%d / %s))\n", BindSym(bind), p, symname, *(void**)p, (void*)(offs+rela[i].r_addend), sym_elf?sym_elf->name:"native", veropt?"opt":"", version, vername?vername:"(none)"); *p = offs + rela[i].r_addend; if(sym_elf && sym_elf!=last_elf && sym_elf!=head) last_elf = checkElfLib(head, sym_elf->lib); @@ -684,7 +743,7 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbin } } } else { - printf_dump(LOG_NEVER, "Preparing (if needed) %s R_X86_64_JUMP_SLOT @%p (0x%lx->0x%0lx) with sym=%s to be apply later (addend=%ld)\n", + printf_dump(LOG_NEVER, "Preparing (if needed) %s R_X86_64_JUMP_SLOT @%p (0x%lx->0x%0lx) with sym=%s to be apply later (addend=%ld)\n", BindSym(bind), p, *p, *p+head->delta, symname, rela[i].r_addend); *p += head->delta; *need_resolv = 1; @@ -695,7 +754,7 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbin if(offs!=globoffs) { offs = globoffs; sym_elf = my_context->elfs[0]; - elfsym = ElfDynSymLookup(sym_elf, symname); + elfsym = ElfDynSymLookup64(sym_elf, symname); } } if (!offs && !elfsym) { @@ -703,7 +762,7 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbin if(bind==STB_GLOBAL) ret_ok = 1; } else { - printf_dump(LOG_NEVER, "Apply %s R_X86_64_64 @%p with sym=%s (%sver=%d/%s) addend=0x%lx (%p -> %p)\n", + printf_dump(LOG_NEVER, "Apply %s R_X86_64_64 @%p with sym=%s (%sver=%d/%s) addend=0x%lx (%p -> %p)\n", BindSym(bind), p, symname, veropt?"opt":"", version, vername?vername:"(none)", rela[i].r_addend, *(void**)p, (void*)(offs+rela[i].r_addend/*+*(uint64_t*)p*/)); *p /*+*/= offs+rela[i].r_addend; if(sym_elf && sym_elf!=last_elf && sym_elf!=head) last_elf = checkElfLib(head, sym_elf->lib); @@ -718,11 +777,11 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbin } if(sym_elf) { delta = *(int64_t*)p; - printf_dump(LOG_NEVER, "Applying %s %s on %s @%p (%ld -> %ld+%ld+%ld, size=%ld)\n", BindSym(bind), DumpRelType(t), symname, p, delta, sym_elf->tlsbase, (int64_t)offs, rela[i].r_addend, end-offs); + printf_dump(LOG_NEVER, "Applying %s %s on %s @%p (%ld -> %ld+%ld+%ld, size=%ld)\n", BindSym(bind), DumpRelType64(t), symname, p, delta, sym_elf->tlsbase, (int64_t)offs, rela[i].r_addend, end-offs); *p = (uintptr_t)((int64_t)offs + rela[i].r_addend + sym_elf->tlsbase); if(sym_elf && sym_elf!=last_elf && sym_elf!=head) last_elf = checkElfLib(head, sym_elf->lib); } else { - printf_log(LOG_INFO, "Warning, cannot apply %s %s on %s @%p (%ld), no elf_header found\n", BindSym(bind), DumpRelType(t), symname, p, (int64_t)offs); + printf_log(LOG_INFO, "Warning, cannot apply %s %s on %s @%p (%ld), no elf_header found\n", BindSym(bind), DumpRelType64(t), symname, p, (int64_t)offs); } } break; @@ -779,13 +838,13 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbin } break; default: - printf_log(LOG_INFO, "Warning, don't know of to handle rela #%d %s on %s\n", i, DumpRelType(ELF64_R_TYPE(rela[i].r_info)), symname); + printf_log(LOG_INFO, "Warning, don't know of to handle rela #%d %s on %s\n", i, DumpRelType64(ELF64_R_TYPE(rela[i].r_info)), symname); } } return bindnow?ret_ok:0; } -int RelocateElfRELR(elfheader_t *head, int cnt, Elf64_Relr *relr) { +static int RelocateElfRELR(elfheader_t *head, int cnt, Elf64_Relr *relr) { Elf64_Addr *where = NULL; for (int i = 0; i < cnt; i++) { Elf64_Relr p = relr[i]; @@ -805,7 +864,13 @@ int RelocateElfRELR(elfheader_t *head, int cnt, Elf64_Relr *relr) { return 0; } -int RelocateElf(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head) +int RelocateElf32(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head) +#ifndef BOX32 +{ return -1; } +#else + ; +#endif +int RelocateElf64(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head) { if((head->flags&DF_BIND_NOW) && !bindnow) { bindnow = 1; @@ -813,29 +878,39 @@ int RelocateElf(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, e } if(head->relr) { int cnt = head->relrsz / head->relrent; - DumpRelRTable(head, cnt, (Elf64_Relr *)(head->relr + head->delta), "RelR"); + DumpRelRTable64(head, cnt, (Elf64_Relr *)(head->relr + head->delta), "RelR"); printf_dump(LOG_DEBUG, "Applying %d Relocation(s) without Addend for %s bindnow=%d, deepbind=%d\n", cnt, head->name, bindnow, deepbind); if(RelocateElfRELR(head, cnt, (Elf64_Relr *)(head->relr + head->delta))) return -1; } if(head->rel) { int cnt = head->relsz / head->relent; - DumpRelTable(head, cnt, (Elf64_Rel *)(head->rel + head->delta), "Rel"); + DumpRelTable64(head, cnt, (Elf64_Rel *)(head->rel + head->delta), "Rel"); printf_dump(LOG_DEBUG, "Applying %d Relocation(s) for %s bindnow=%d, deepbind=%d\n", cnt, head->name, bindnow, deepbind); if(RelocateElfREL(maplib, local_maplib, bindnow, deepbind, head, cnt, (Elf64_Rel *)(head->rel + head->delta))) return -1; } if(head->rela) { int cnt = head->relasz / head->relaent; - DumpRelATable(head, cnt, (Elf64_Rela *)(head->rela + head->delta), "RelA"); + DumpRelATable64(head, cnt, (Elf64_Rela *)(head->rela + head->delta), "RelA"); printf_dump(LOG_DEBUG, "Applying %d Relocation(s) with Addend for %s bindnow=%d, deepbind=%d\n", cnt, head->name, bindnow, deepbind); if(RelocateElfRELA(maplib, local_maplib, bindnow, deepbind, head, cnt, (Elf64_Rela *)(head->rela + head->delta), NULL)) return -1; } return 0; } +int RelocateElf(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head) +{ + return box64_is32bits?RelocateElf32(maplib, local_maplib, bindnow, deepbind, head):RelocateElf64(maplib, local_maplib, bindnow, deepbind, head); +} -int RelocateElfPlt(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head) +int RelocateElfPlt32(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head) +#ifndef BOX32 +{ return -1; } +#else + ; +#endif +int RelocateElfPlt64(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head) { int need_resolver = 0; if((head->flags&DF_BIND_NOW) && !bindnow) { @@ -845,34 +920,38 @@ int RelocateElfPlt(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind if(head->pltrel) { int cnt = head->pltsz / head->pltent; if(head->pltrel==DT_REL) { - DumpRelTable(head, cnt, (Elf64_Rel *)(head->jmprel + head->delta), "PLT"); + DumpRelTable64(head, cnt, (Elf64_Rel *)(head->jmprel + head->delta), "PLT"); printf_dump(LOG_DEBUG, "Applying %d PLT Relocation(s) for %s bindnow=%d, deepbind=%d\n", cnt, head->name, bindnow, deepbind); if(RelocateElfREL(maplib, local_maplib, bindnow, deepbind, head, cnt, (Elf64_Rel *)(head->jmprel + head->delta))) return -1; } else if(head->pltrel==DT_RELA) { - DumpRelATable(head, cnt, (Elf64_Rela *)(head->jmprel + head->delta), "PLT"); + DumpRelATable64(head, cnt, (Elf64_Rela *)(head->jmprel + head->delta), "PLT"); printf_dump(LOG_DEBUG, "Applying %d PLT Relocation(s) with Addend for %s bindnow=%d, deepbind=%d\n", cnt, head->name, bindnow, deepbind); if(RelocateElfRELA(maplib, local_maplib, bindnow, deepbind, head, cnt, (Elf64_Rela *)(head->jmprel + head->delta), &need_resolver)) return -1; } if(need_resolver) { - if(pltResolver==(uintptr_t)-1) { - pltResolver = AddBridge(my_context->system, vFE, PltResolver, 0, "PltResolver"); + if(pltResolver64==(uintptr_t)-1) { + pltResolver64 = AddBridge(my_context->system, vFE, PltResolver64, 0, "PltResolver"); } if(head->pltgot) { - *(uintptr_t*)(head->pltgot+head->delta+16) = pltResolver; + *(uintptr_t*)(head->pltgot+head->delta+16) = pltResolver64; *(uintptr_t*)(head->pltgot+head->delta+8) = (uintptr_t)head; printf_dump(LOG_DEBUG, "PLT Resolver injected in plt.got at %p\n", (void*)(head->pltgot+head->delta+16)); } else if(head->got) { - *(uintptr_t*)(head->got+head->delta+16) = pltResolver; + *(uintptr_t*)(head->got+head->delta+16) = pltResolver64; *(uintptr_t*)(head->got+head->delta+8) = (uintptr_t)head; printf_dump(LOG_DEBUG, "PLT Resolver injected in got at %p\n", (void*)(head->got+head->delta+16)); } } } - + return 0; } +int RelocateElfPlt(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head) +{ + return box64_is32bits?RelocateElfPlt32(maplib, local_maplib, bindnow, deepbind, head):RelocateElfPlt64(maplib, local_maplib, bindnow, deepbind, head); +} void CalcStack(elfheader_t* elf, uint64_t* stacksz, size_t* stackalign) { @@ -882,49 +961,12 @@ void CalcStack(elfheader_t* elf, uint64_t* stacksz, size_t* stackalign) *stackalign = elf->stackalign; } -Elf64_Sym* GetFunction(elfheader_t* h, const char* name) -{ - // TODO: create a hash on named to avoid this loop - for (size_t i=0; inumSymTab; ++i) { - int type = ELF64_ST_TYPE(h->SymTab[i].st_info); - if(type==STT_FUNC) { - const char * symname = h->StrTab+h->SymTab[i].st_name; - if(strcmp(symname, name)==0) { - return h->SymTab+i; - } - } - } - return NULL; -} - -Elf64_Sym* GetElfObject(elfheader_t* h, const char* name) -{ - for (size_t i=0; inumSymTab; ++i) { - int type = ELF64_ST_TYPE(h->SymTab[i].st_info); - if(type==STT_OBJECT) { - const char * symname = h->StrTab+h->SymTab[i].st_name; - if(strcmp(symname, name)==0) { - return h->SymTab+i; - } - } - } - return NULL; -} - - -uintptr_t GetFunctionAddress(elfheader_t* h, const char* name) -{ - Elf64_Sym* sym = GetFunction(h, name); - if(sym) return sym->st_value; - return 0; -} - uintptr_t GetEntryPoint(lib_t* maplib, elfheader_t* h) { (void)maplib; uintptr_t ep = h->entrypoint + h->delta; printf_log(LOG_DEBUG, "Entry Point is %p\n", (void*)ep); - if(box64_dump) { + if (BOX64ENV(dump)) { printf_dump(LOG_NEVER, "(short) Dump of Entry point\n"); int sz = 64; uintptr_t lastbyte = GetLastByte(h); @@ -945,13 +987,23 @@ uintptr_t GetLastByte(elfheader_t* h) #endif void checkHookedSymbols(elfheader_t* h); // in mallochook.c +void AddSymbols32(lib_t *maplib, elfheader_t* h) +#ifndef BOX32 +{ } +#else + ; +#endif void AddSymbols(lib_t *maplib, elfheader_t* h) { - //if(box64_dump && h->hash) old_elf_hash_dump(h); - //if(box64_dump && h->gnu_hash) new_elf_hash_dump(h); - if(box64_dump && h->DynSym) DumpDynSym(h); - if(h==my_context->elfs[0]) - GrabX64CopyMainElfReloc(h); + if(box64_is32bits) { + AddSymbols32(maplib, h); + } else { + // if(BOX64ENV(dump) && h->hash) old_elf_hash_dump(h); + // if(BOX64ENV(dump) && h->gnu_hash) new_elf_hash_dump(h); + if (BOX64ENV(dump) && h->DynSym._64) DumpDynSym64(h); + if (h==my_context->elfs[0]) + GrabX64CopyMainElfReloc(h); + } #ifndef STATICBUILD checkHookedSymbols(h); #endif @@ -977,9 +1029,10 @@ int LoadNeededLibs(elfheader_t* h, lib_t *maplib, int local, int bindnow, int de return 0; DumpDynamicRPath(h); // update RPATH first - for (size_t i=0; inumDynamic; ++i) - if(h->Dynamic[i].d_tag==DT_RPATH || h->Dynamic[i].d_tag==DT_RUNPATH) { - char *rpathref = h->DynStrTab+h->delta+h->Dynamic[i].d_un.d_val; + for (size_t i=0; inumDynamic; ++i) { + int tag = box64_is32bits?h->Dynamic._32[i].d_tag:h->Dynamic._64[i].d_tag; + if(tag==DT_RPATH || tag==DT_RUNPATH) { + char *rpathref = h->DynStrTab+h->delta+(box64_is32bits?h->Dynamic._32[i].d_un.d_val:h->Dynamic._64[i].d_un.d_val); char* rpath = rpathref; while(strstr(rpath, "$ORIGIN")) { char* origin = box_strdup(h->path); @@ -1024,7 +1077,7 @@ int LoadNeededLibs(elfheader_t* h, lib_t *maplib, int local, int bindnow, int de box_free(platform); } if(strchr(rpath, '$')) { - printf_log(LOG_INFO, "BOX64: Warning, RPATH with $ variable not supported yet (%s)\n", rpath); + printf_log(LOG_INFO, "Warning, RPATH with $ variable not supported yet (%s)\n", rpath); } else { printf_log(LOG_DEBUG, "Prepending path \"%s\" to BOX64_LD_LIBRARY_PATH\n", rpath); PrependList(&box64->box64_ld_lib, rpath, 1); @@ -1032,23 +1085,32 @@ int LoadNeededLibs(elfheader_t* h, lib_t *maplib, int local, int bindnow, int de if(rpath!=rpathref) box_free(rpath); } - + } DumpDynamicNeeded(h); int cnt = 0; // count the number of needed libs, and also grab soname for (size_t i=0; inumDynamic; ++i) { - if(h->Dynamic[i].d_tag==DT_NEEDED) + int tag = box64_is32bits?h->Dynamic._32[i].d_tag:h->Dynamic._64[i].d_tag; + if(tag==DT_NEEDED) ++cnt; - if(h->Dynamic[i].d_tag==DT_SONAME) - h->soname = h->DynStrTab+h->delta+h->Dynamic[i].d_un.d_val; + if(tag==DT_SONAME) + h->soname = h->DynStrTab+h->delta+(box64_is32bits?h->Dynamic._32[i].d_un.d_val:h->Dynamic._64[i].d_un.d_val); } + #ifndef ANDROID + if(box64_is32bits && strstr(h->name, "lsteamclient.dll.so")) + ++cnt; + #endif h->needed = new_neededlib(cnt); if(h == my_context->elfs[0]) my_context->neededlibs = h->needed; int j=0; for (size_t i=0; inumDynamic; ++i) - if(h->Dynamic[i].d_tag==DT_NEEDED) - h->needed->names[j++] = h->DynStrTab+h->delta+h->Dynamic[i].d_un.d_val; + if((box64_is32bits?h->Dynamic._32[i].d_tag:h->Dynamic._64[i].d_tag)==DT_NEEDED) + h->needed->names[j++] = h->DynStrTab+h->delta+(box64_is32bits?h->Dynamic._32[i].d_un.d_val:h->Dynamic._64[i].d_un.d_val); + #ifndef ANDROID + if(box64_is32bits && strstr(h->name, "lsteamclient.dll.so")) + h->needed->names[j++] = "libgcc_s.so.1"; + #endif if(h==my_context->elfs[0] && box64_addlibs.size) { for(int i=0; iname); @@ -1058,19 +1120,24 @@ int LoadNeededLibs(elfheader_t* h, lib_t *maplib, int local, int bindnow, int de // TODO: Add LD_LIBRARY_PATH and RPATH handling if(AddNeededLib(maplib, local, bindnow, deepbind, h->needed, h, box64, emu)) { printf_log(LOG_INFO, "Error loading one of needed lib\n"); - if(!allow_missing_libs) + if(!BOX64ENV(allow_missing_libs)) return 1; //error... } return 0; } +needed_libs_t* GetELfNeededLibs(elfheader_t* h) +{ + return h?h->needed:NULL; +} + int ElfCheckIfUseTCMallocMinimal(elfheader_t* h) { if(!h) return 0; for (size_t i=0; inumDynamic; ++i) - if(h->Dynamic[i].d_tag==DT_NEEDED) { - char *needed = h->DynStrTab+h->delta+h->Dynamic[i].d_un.d_val; + if((box64_is32bits?h->Dynamic._32[i].d_tag:h->Dynamic._64[i].d_tag)==DT_NEEDED) { + char *needed = h->DynStrTab+h->delta+(box64_is32bits?h->Dynamic._32[i].d_un.d_val:h->Dynamic._64[i].d_un.d_val); if(!strcmp(needed, "libtcmalloc_minimal.so.4")) // tcmalloc needs to be the 1st lib loaded return 1; else if(!strcmp(needed, "libtcmalloc_minimal.so.0")) // tcmalloc needs to be the 1st lib loaded @@ -1081,14 +1148,15 @@ int ElfCheckIfUseTCMallocMinimal(elfheader_t* h) return 0; } -void RefreshElfTLS(elfheader_t* h) +void RefreshElfTLS(elfheader_t* h, x64emu_t* emu) { + refreshTLSData(emu); if(h->tlsfilesize) { char* dest = (char*)(my_context->tlsdata+my_context->tlssize+h->tlsbase); printf_dump(LOG_DEBUG, "Refreshing main TLS block @%p from %p:0x%lx\n", dest, (void*)h->tlsaddr, h->tlsfilesize); memcpy(dest, (void*)(h->tlsaddr+h->delta), h->tlsfilesize); - if (pthread_getspecific(my_context->tlskey)) { - tlsdatasize_t* ptr = getTLSData(my_context); + if (emu->tlsdata) { + tlsdatasize_t* ptr = emu->tlsdata; // refresh in tlsdata too dest = (char*)(ptr->data+h->tlsbase); printf_dump(LOG_DEBUG, "Refreshing active TLS block @%p from %p:0x%lx\n", dest, (void*)h->tlsaddr, h->tlssize-h->tlsfilesize); @@ -1111,10 +1179,9 @@ void RunElfInit(elfheader_t* h, x64emu_t *emu) if(!h || h->init_done) return; // reset Segs Cache - memset(emu->segs_serial, 0, sizeof(emu->segs_serial)); uintptr_t p = h->initentry + h->delta; // Refresh no-file part of TLS in case default value changed - RefreshElfTLS(h); + RefreshElfTLS(h, emu); // check if in deferredInit if(my_context->deferredInit) { if(my_context->deferredInitSz==my_context->deferredInitCap) { @@ -1133,15 +1200,32 @@ void RunElfInit(elfheader_t* h, x64emu_t *emu) RunElfInit(lib_elf, emu); } printf_dump(LOG_DEBUG, "Calling Init for %s @%p\n", ElfName(h), (void*)p); - if(h->initentry) - RunFunctionWithEmu(emu, 0, p, 3, my_context->argc, my_context->argv, my_context->envv); + if(h->initentry) { + if(box64_is32bits) + RunFunctionWithEmu(emu, 0, p, 3, my_context->argc, my_context->argv32, my_context->envv32); + else + RunFunctionWithEmu(emu, 0, p, 3, my_context->argc, my_context->argv, my_context->envv); + } printf_dump(LOG_DEBUG, "Done Init for %s\n", ElfName(h)); // and check init array now - Elf64_Addr *addr = (Elf64_Addr*)(h->initarray + h->delta); - for (size_t i=0; iinitarray_sz; ++i) { - if(addr[i]) { - printf_dump(LOG_DEBUG, "Calling Init[%zu] for %s @%p\n", i, ElfName(h), (void*)addr[i]); - RunFunctionWithEmu(emu, 0, (uintptr_t)addr[i], 3, my_context->argc, my_context->argv, my_context->envv); + #ifdef BOX32 + if(box64_is32bits) { + Elf32_Addr *addr = (Elf32_Addr*)(h->initarray + h->delta); + for (size_t i=0; iinitarray_sz; ++i) { + if(addr[i]) { + printf_dump(LOG_DEBUG, "Calling Init[%zu] for %s @%p\n", i, ElfName(h), from_ptrv(addr[i])); + RunFunctionWithEmu(emu, 0, (uintptr_t)addr[i], 3, my_context->argc, my_context->argv32, my_context->envv32); + } + } + } else + #endif + { + Elf64_Addr *addr = (Elf64_Addr*)(h->initarray + h->delta); + for (size_t i=0; iinitarray_sz; ++i) { + if(addr[i]) { + printf_dump(LOG_DEBUG, "Calling Init[%zu] for %s @%p\n", i, ElfName(h), (void*)addr[i]); + RunFunctionWithEmu(emu, 0, (uintptr_t)addr[i], 3, my_context->argc, my_context->argv, my_context->envv); + } } } @@ -1183,10 +1267,21 @@ void RunElfFini(elfheader_t* h, x64emu_t *emu) printf_log(LOG_DEBUG, "Android does not support Fini for %s\n", ElfName(h)); #else // first check fini array - Elf64_Addr *addr = (Elf64_Addr*)(h->finiarray + h->delta); - for (int i=h->finiarray_sz-1; i>=0; --i) { - printf_dump(LOG_DEBUG, "Calling Fini[%d] for %s @%p\n", i, ElfName(h), (void*)addr[i]); - RunFunctionWithEmu(emu, 0, (uintptr_t)addr[i], 0); + #ifdef BOX32 + if(box64_is32bits) { + Elf32_Addr *addr = (Elf32_Addr*)(h->finiarray + h->delta); + for (int i=h->finiarray_sz-1; i>=0; --i) { + printf_dump(LOG_DEBUG, "Calling Fini[%d] for %s @%p\n", i, ElfName(h), from_ptrv(addr[i])); + RunFunctionWithEmu(emu, 0, (uintptr_t)addr[i], 0); + } + } else + #endif + { + Elf64_Addr *addr = (Elf64_Addr*)(h->finiarray + h->delta); + for (int i=h->finiarray_sz-1; i>=0; --i) { + printf_dump(LOG_DEBUG, "Calling Fini[%d] for %s @%p\n", i, ElfName(h), (void*)addr[i]); + RunFunctionWithEmu(emu, 0, (uintptr_t)addr[i], 0); + } } // then the "old-style" fini if(h->finientry) { @@ -1232,7 +1327,7 @@ int IsAddressInElfSpace(const elfheader_t* h, uintptr_t addr) uintptr_t end = (uintptr_t)h->multiblocks[i].p + h->multiblocks[i].asize - 1; if(base && addr>=base && addr<=end) return 1; - + } return 0; } @@ -1241,7 +1336,7 @@ elfheader_t* FindElfAddress(box64context_t *context, uintptr_t addr) for (int i=0; ielfsize; ++i) if(IsAddressInElfSpace(context->elfs[i], addr)) return context->elfs[i]; - + return NULL; } @@ -1258,7 +1353,7 @@ const char* FindNearestSymbolName(elfheader_t* h, void* p, uintptr_t* start, uin if(!h) { if(getProtection((uintptr_t)p)&(PROT_READ)) { uintptr_t adj_p = ((uintptr_t)p)&~(sizeof(onebridge_t)-1); - if(*(uint8_t*)(adj_p)==0xCC && *(uint8_t*)(adj_p+1)=='S' && *(uint8_t*)(adj_p+2)=='C') { + if (*(uint8_t*)(adj_p) == 0xCC && IsBridgeSignature(*(uint8_t*)(adj_p + 1), *(uint8_t*)(adj_p + 2))) { ret = getBridgeName((void*)adj_p); if(ret) { if(start) @@ -1268,34 +1363,43 @@ const char* FindNearestSymbolName(elfheader_t* h, void* p, uintptr_t* start, uin } } } + if(!ret) { + const char* filename = NULL; + uintptr_t start_map = 0; + if(IsAddrFileMapped(addr, &filename, &start_map)) { + if(start) *start = start_map; + if(sz) *sz = SizeFileMapped(addr); + ret = filename; + } + } return ret; } if(!h || h->fini_done) return ret; for (size_t i=0; inumSymTab && distance!=0; ++i) { - const char * symname = h->StrTab+h->SymTab[i].st_name; - uintptr_t offs = h->SymTab[i].st_value + h->delta; + const char * symname = box64_is32bits?(h->StrTab+h->SymTab._32[i].st_name):(h->StrTab+h->SymTab._64[i].st_name); + uintptr_t offs = (box64_is32bits?h->SymTab._32[i].st_value:h->SymTab._64[i].st_value) + h->delta; if(offs<=addr) { if(distance>addr-offs) { distance = addr-offs; ret = symname; s = offs; - size = h->SymTab[i].st_size; + size = box64_is32bits?h->SymTab._32[i].st_size:h->SymTab._64[i].st_size; } } } for (size_t i=0; inumDynSym && distance!=0; ++i) { - const char * symname = h->DynStr+h->DynSym[i].st_name; - uintptr_t offs = h->DynSym[i].st_value + h->delta; + const char * symname = h->DynStr+(box64_is32bits?h->DynSym._32[i].st_name:h->DynSym._64[i].st_name); + uintptr_t offs = (box64_is32bits?h->DynSym._32[i].st_value:h->DynSym._64[i].st_value) + h->delta; if(offs<=addr) { if(distance>addr-offs) { distance = addr-offs; ret = symname; s = offs; - size = h->DynSym[i].st_size; + size = box64_is32bits?h->DynSym._32[i].st_size:h->DynSym._64[i].st_size; } } } @@ -1349,9 +1453,9 @@ int SameVersionedSymbol(const char* name1, int ver1, const char* vername1, int v return 0; } -void* GetDTatOffset(box64context_t* context, unsigned long int index, unsigned long int offset) +void* GetDTatOffset(x64emu_t* emu, unsigned long int index, unsigned long int offset) { - return (void*)((char*)GetTLSPointer(context, context->elfs[index])+offset); + return (void*)((char*)GetTLSPointer(emu, emu->context->elfs[index])+offset); } int32_t GetTLSBase(elfheader_t* h) @@ -1364,11 +1468,12 @@ uint32_t GetTLSSize(elfheader_t* h) return h?h->tlssize:0; } -void* GetTLSPointer(box64context_t* context, elfheader_t* h) +void* GetTLSPointer(x64emu_t* emu, elfheader_t* h) { if(!h || !h->tlssize) return NULL; - tlsdatasize_t* ptr = getTLSData(context); + refreshTLSData(emu); // needed? + tlsdatasize_t* ptr = emu->tlsdata; return ptr->data+h->tlsbase; } @@ -1376,32 +1481,143 @@ void* GetDynamicSection(elfheader_t* h) { if(!h) return NULL; - return h->Dynamic; + return box64_is32bits?((void*)h->Dynamic._32):((void*)h->Dynamic._64); } -#ifdef DYNAREC -dynablock_t* GetDynablocksFromAddress(box64context_t *context, uintptr_t addr) +typedef struct { + void* addr; + size_t size; +} dynamic_info_t; + +static int GetLoadedDynamicInfo(elfheader_t* h, dynamic_info_t* info) { - (void)context; - // if we are here, the there is not block in standard "space" - /*dynablocklist_t* ret = getDBFromAddress(addr); - if(ret) { - return ret; - }*/ - if(box64_dynarec_forced) { - addDBFromAddressRange(addr, 1); - return getDB(addr); - } - //check if address is in an elf... if yes, grant a block (should I warn) - Dl_info info; - if(dladdr((void*)addr, &info)) { - dynarec_log(LOG_INFO, "Address %p is in a native Elf memory space (function \"%s\" in %s)\n", (void*)addr, info.dli_sname, info.dli_fname); - return NULL; + if(!h) return 0; + if(box64_is32bits) { + for(int i = 0; i < h->numPHEntries; i++) { + if(h->PHEntries._32[i].p_type == PT_DYNAMIC) { + info->addr = (void*)(h->delta + h->PHEntries._32[i].p_vaddr); + info->size = h->PHEntries._32[i].p_memsz; + return 1; + } + } + } else { + for(int i = 0; i < h->numPHEntries; i++) { + if(h->PHEntries._64[i].p_type == PT_DYNAMIC) { + info->addr = (void*)(h->delta + h->PHEntries._64[i].p_vaddr); + info->size = h->PHEntries._64[i].p_memsz; + return 1; + } + } } - dynarec_log(LOG_INFO, "Address %p not found in Elf memory and is not a native call wrapper\n", (void*)addr); + return 0; +} + +void* GetLoadedDynamicSection(elfheader_t* h) +{ + dynamic_info_t info; + if(GetLoadedDynamicInfo(h, &info)) + return info.addr; return NULL; } + +static int isDynamicTagPointer(int tag) +{ + switch(tag) { + case DT_PLTGOT: + case DT_HASH: + case DT_STRTAB: + case DT_SYMTAB: + case DT_RELA: + case DT_REL: + case DT_RELR: + case DT_DEBUG: + case DT_JMPREL: + case DT_INIT: + case DT_FINI: + case DT_INIT_ARRAY: + case DT_FINI_ARRAY: + case DT_PREINIT_ARRAY: + case DT_VERNEED: + case DT_VERDEF: + case DT_VERSYM: +#ifdef DT_GNU_HASH + case DT_GNU_HASH: +#else + case 0x6ffffef5: #endif +#ifdef DT_TLSDESC_PLT + case DT_TLSDESC_PLT: +#else + case 0x6ffffef6: +#endif +#ifdef DT_TLSDESC_GOT + case DT_TLSDESC_GOT: +#else + case 0x6ffffef7: +#endif + return 1; + default: + return 0; + } +} + +void PatchLoadedDynamicSection(elfheader_t* h) +{ + if(!h || !h->delta || h->dynamic_patched) + return; + + dynamic_info_t dyninfo; + if(!GetLoadedDynamicInfo(h, &dyninfo)) + return; + + uintptr_t dyn_addr = (uintptr_t)dyninfo.addr; + uintptr_t dyn_size = dyninfo.size; + + uintptr_t page_addr = dyn_addr & ~(box64_pagesize - 1); + uintptr_t page_end = (dyn_addr + dyn_size + box64_pagesize - 1) & ~(box64_pagesize - 1); + + int need_restore = 0; + for(uintptr_t page = page_addr; page < page_end; page += box64_pagesize) { + uint32_t old_prot = getProtection(page); + if(old_prot && !(old_prot & PROT_WRITE)) { + if(mprotect((void*)page, box64_pagesize, (old_prot | PROT_WRITE) & ~PROT_CUSTOM)) { + for(uintptr_t restore = page_addr; restore < page; restore += box64_pagesize) { + uint32_t restore_prot = getProtection(restore); + if(restore_prot && !(restore_prot & PROT_WRITE)) + mprotect((void*)restore, box64_pagesize, restore_prot & ~PROT_CUSTOM); + } + return; + } + need_restore = 1; + } + } + + if(box64_is32bits) { + Elf32_Dyn* dyn = (Elf32_Dyn*)dyn_addr; + for(int j = 0; dyn[j].d_tag != DT_NULL; j++) { + if(isDynamicTagPointer(dyn[j].d_tag) && dyn[j].d_un.d_ptr) { + dyn[j].d_un.d_ptr += h->delta; + } + } + } else { + Elf64_Dyn* dyn = (Elf64_Dyn*)dyn_addr; + for(int j = 0; dyn[j].d_tag != DT_NULL; j++) { + if(isDynamicTagPointer(dyn[j].d_tag) && dyn[j].d_un.d_ptr) { + dyn[j].d_un.d_ptr += h->delta; + } + } + } + + if(need_restore) { + for(uintptr_t page = page_addr; page < page_end; page += box64_pagesize) { + uint32_t old_prot = getProtection(page); + if(old_prot && !(old_prot & PROT_WRITE)) + mprotect((void*)page, box64_pagesize, old_prot & ~PROT_CUSTOM); + } + } + + h->dynamic_patched = 1; +} typedef struct my_dl_phdr_info_s { void* dlpi_addr; @@ -1451,7 +1667,16 @@ static void* find_dl_iterate_phdr_Fct(void* fct) } #undef SUPER +EXPORT int my32_dl_iterate_phdr(x64emu_t *emu, void* F, void *data) +#ifdef BOX32 +; +#else +{ + return -1; +} +#endif EXPORT int my_dl_iterate_phdr(x64emu_t *emu, void* F, void *data) { + if(box64_is32bits) return my32_dl_iterate_phdr(emu, F, data); printf_log(LOG_DEBUG, "Call to partially implemented dl_iterate_phdr(%p, %p)\n", F, data); box64context_t *context = GetEmuContext(emu); const char* empty = ""; @@ -1461,7 +1686,7 @@ EXPORT int my_dl_iterate_phdr(x64emu_t *emu, void* F, void *data) { my_dl_phdr_info_t info; info.dlpi_addr = GetElfDelta(context->elfs[idx]); info.dlpi_name = idx?context->elfs[idx]->name:empty; //1st elf is program, and this one doesn't get a name - info.dlpi_phdr = context->elfs[idx]->PHEntries; + info.dlpi_phdr = context->elfs[idx]->PHEntries._64; info.dlpi_phnum = context->elfs[idx]->numPHEntries; if((ret = dl_iterate_phdr_callback(emu, F, &info, sizeof(info), data))) { return ret; @@ -1473,42 +1698,52 @@ EXPORT int my_dl_iterate_phdr(x64emu_t *emu, void* F, void *data) { return ret; } +void ResetSpecialCaseMainElf32(elfheader_t* h) +#ifndef BOX32 +{ } +#else + ; +#endif void ResetSpecialCaseMainElf(elfheader_t* h) { + if(box64_is32bits) { + ResetSpecialCaseMainElf32(h); + return; + } Elf64_Sym *sym = NULL; for (size_t i=0; inumDynSym; ++i) { - if(h->DynSym[i].st_info == 17) { - sym = h->DynSym+i; + if(h->DynSym._64[i].st_info == 17) { + sym = h->DynSym._64+i; const char * symname = h->DynStr+sym->st_name; if(strcmp(symname, "_IO_2_1_stderr_")==0 && ((void*)sym->st_value+h->delta)) { memcpy((void*)sym->st_value+h->delta, stderr, sym->st_size); my__IO_2_1_stderr_ = (void*)sym->st_value+h->delta; - printf_log(LOG_DEBUG, "BOX64: Set @_IO_2_1_stderr_ to %p\n", my__IO_2_1_stderr_); + printf_log(LOG_DEBUG, "Set @_IO_2_1_stderr_ to %p\n", my__IO_2_1_stderr_); } else if(strcmp(symname, "_IO_2_1_stdin_")==0 && ((void*)sym->st_value+h->delta)) { memcpy((void*)sym->st_value+h->delta, stdin, sym->st_size); my__IO_2_1_stdin_ = (void*)sym->st_value+h->delta; - printf_log(LOG_DEBUG, "BOX64: Set @_IO_2_1_stdin_ to %p\n", my__IO_2_1_stdin_); + printf_log(LOG_DEBUG, "Set @_IO_2_1_stdin_ to %p\n", my__IO_2_1_stdin_); } else if(strcmp(symname, "_IO_2_1_stdout_")==0 && ((void*)sym->st_value+h->delta)) { memcpy((void*)sym->st_value+h->delta, stdout, sym->st_size); my__IO_2_1_stdout_ = (void*)sym->st_value+h->delta; - printf_log(LOG_DEBUG, "BOX64: Set @_IO_2_1_stdout_ to %p\n", my__IO_2_1_stdout_); + printf_log(LOG_DEBUG, "Set @_IO_2_1_stdout_ to %p\n", my__IO_2_1_stdout_); } else if(strcmp(symname, "_IO_stderr_")==0 && ((void*)sym->st_value+h->delta)) { memcpy((void*)sym->st_value+h->delta, stderr, sym->st_size); my__IO_2_1_stderr_ = (void*)sym->st_value+h->delta; - printf_log(LOG_DEBUG, "BOX64: Set @_IO_stderr_ to %p\n", my__IO_2_1_stderr_); + printf_log(LOG_DEBUG, "Set @_IO_stderr_ to %p\n", my__IO_2_1_stderr_); } else if(strcmp(symname, "_IO_stdin_")==0 && ((void*)sym->st_value+h->delta)) { memcpy((void*)sym->st_value+h->delta, stdin, sym->st_size); my__IO_2_1_stdin_ = (void*)sym->st_value+h->delta; - printf_log(LOG_DEBUG, "BOX64: Set @_IO_stdin_ to %p\n", my__IO_2_1_stdin_); + printf_log(LOG_DEBUG, "Set @_IO_stdin_ to %p\n", my__IO_2_1_stdin_); } else if(strcmp(symname, "_IO_stdout_")==0 && ((void*)sym->st_value+h->delta)) { memcpy((void*)sym->st_value+h->delta, stdout, sym->st_size); my__IO_2_1_stdout_ = (void*)sym->st_value+h->delta; - printf_log(LOG_DEBUG, "BOX64: Set @_IO_stdout_ to %p\n", my__IO_2_1_stdout_); + printf_log(LOG_DEBUG, "Set @_IO_stdout_ to %p\n", my__IO_2_1_stdout_); } } } @@ -1564,12 +1799,12 @@ void ElfAttachLib(elfheader_t* head, library_t* lib) head->lib = lib; } -Elf64_Sym* ElfLocateSymbol(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +static Elf64_Sym* ElfLocateSymbol(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) { - Elf64_Sym* sym = ElfLookup(head, symname, *ver, *vername, local, *veropt); + Elf64_Sym* sym = ElfLookup64(head, symname, *ver, *vername, local, *veropt); if(!sym) return NULL; if(head->VerSym && !*veropt) { - int idx = ((uintptr_t)sym - (uintptr_t)head->DynSym)/sizeof(Elf64_Sym); + int idx = ((uintptr_t)sym - (uintptr_t)head->DynSym._64)/sizeof(Elf64_Sym); int version = ((Elf64_Half*)((uintptr_t)head->VerSym+head->delta))[idx]; if(version!=-1) version &=0x7fff; const char* symvername = GetSymbolVersion(head, version); @@ -1589,7 +1824,13 @@ Elf64_Sym* ElfLocateSymbol(elfheader_t* head, uintptr_t *offs, uintptr_t *end, c return sym; } -void* ElfGetLocalSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +void* ElfGetLocalSymbolStartEnd32(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +#ifndef BOX32 +{ return NULL; } +#else + ; +#endif +void* ElfGetLocalSymbolStartEnd64(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) { Elf64_Sym* sym = ElfLocateSymbol(head, offs, end, symname, ver, vername, local, veropt); if(!sym) return NULL; @@ -1599,7 +1840,18 @@ void* ElfGetLocalSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *e if(end) *end = sym->st_value + head->delta + sym->st_size; return sym; } -void* ElfGetGlobalSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +void* ElfGetLocalSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +{ + return box64_is32bits?ElfGetLocalSymbolStartEnd32(head, offs, end, symname, ver, vername, local, veropt):ElfGetLocalSymbolStartEnd64(head, offs, end, symname, ver, vername, local, veropt); +} + +void* ElfGetGlobalSymbolStartEnd32(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +#ifndef BOX32 +{ return NULL; } +#else + ; +#endif +void* ElfGetGlobalSymbolStartEnd64(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) { Elf64_Sym* sym = ElfLocateSymbol(head, offs, end, symname, ver, vername, local, veropt); if(!sym) return NULL; @@ -1609,7 +1861,18 @@ void* ElfGetGlobalSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t * if(end) *end = sym->st_value + head->delta + sym->st_size; return sym; } -void* ElfGetWeakSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +void* ElfGetGlobalSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +{ + return box64_is32bits?ElfGetGlobalSymbolStartEnd32(head, offs, end, symname, ver, vername, local, veropt):ElfGetGlobalSymbolStartEnd64(head, offs, end, symname, ver, vername, local, veropt); +} + +void* ElfGetWeakSymbolStartEnd32(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +#ifndef BOX32 +{ return NULL; } +#else + ; +#endif +void* ElfGetWeakSymbolStartEnd64(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) { Elf64_Sym* sym = ElfLocateSymbol(head, offs, end, symname, ver, vername, local, veropt); if(!sym) return NULL; @@ -1619,9 +1882,39 @@ void* ElfGetWeakSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *en if(end) *end = sym->st_value + head->delta + sym->st_size; return sym; } -int ElfGetSymTabStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname) +void* ElfGetWeakSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +{ + return box64_is32bits?ElfGetWeakSymbolStartEnd32(head, offs, end, symname, ver, vername, local, veropt):ElfGetWeakSymbolStartEnd64(head, offs, end, symname, ver, vername, local, veropt); +} + +void* ElfGetSymbolStartEnd32(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +#ifndef BOX32 +{ return NULL; } +#else + ; +#endif +void* ElfGetSymbolStartEnd64(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +{ + Elf64_Sym* sym = ElfLocateSymbol(head, offs, end, symname, ver, vername, local, veropt); + if(!sym) return NULL; + if(offs) *offs = sym->st_value + head->delta; + if(end) *end = sym->st_value + head->delta + sym->st_size; + return sym; +} +void* ElfGetSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +{ + return box64_is32bits?ElfGetSymbolStartEnd32(head, offs, end, symname, ver, vername, local, veropt):ElfGetSymbolStartEnd64(head, offs, end, symname, ver, vername, local, veropt); +} + +int ElfGetSymTabStartEnd32(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname) +#ifndef BOX32 +{ return 0; } +#else + ; +#endif +int ElfGetSymTabStartEnd64(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname) { - Elf64_Sym* sym = ElfSymTabLookup(head, symname); + Elf64_Sym* sym = ElfSymTabLookup64(head, symname); if(!sym) return 0; if(!sym->st_shndx) return 0; if(!sym->st_size) return 0; //needed? @@ -1629,32 +1922,52 @@ int ElfGetSymTabStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *end, con if(end) *end = sym->st_value + head->delta + sym->st_size; return 1; } +int ElfGetSymTabStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname) +{ + return box64_is32bits?ElfGetSymTabStartEnd32(head, offs, end, symname):ElfGetSymTabStartEnd64(head, offs, end, symname); +} + +int NeededLibs(elfheader_t* h) +{ + if(!h) return 0; + int cnt = 0; + // count the number of needed libs, and also grab soname + for (size_t i=0; inumDynamic; ++i) { + int tag = box64_is32bits?h->Dynamic._32[i].d_tag:h->Dynamic._64[i].d_tag; + if(tag==DT_NEEDED) + ++cnt; + } + return cnt; +} typedef struct search_symbol_s{ const char* name; - void* addr; - void* lib; + void* addr; } search_symbol_t; -int dl_iterate_phdr_findsymbol(struct dl_phdr_info* info, size_t size, void* data) + +int dl_iterate_phdr_findsymbol(eh_obj_t* obj, search_symbol_t* s) { - search_symbol_t* s = (search_symbol_t*)data; + // special case for dlsym -- it's not a versionned symbol in libMangoHud_shim.so. + if (!fnmatch("*libMangoHud_shim.so*", obj->name, 0) && !strcmp(s->name, "dlsym")) { + eh_find_sym(obj, "dlsym", &s->addr); + eh_destroy_obj(obj); + return !!s->addr; + } - for(int j = 0; jdlpi_phnum; ++j) { - if (info->dlpi_phdr[j].p_type == PT_DYNAMIC) { - ElfW(Sym)* sym = NULL; - ElfW(Word) sym_cnt = 0; + for (int j = 0; j < obj->phnum; ++j) { + if (obj->phdr[j].p_type == PT_DYNAMIC) { ElfW(Verdef)* verdef = NULL; ElfW(Word) verdef_cnt = 0; - char *strtab = NULL; - ElfW(Dyn)* dyn = (ElfW(Dyn)*)(info->dlpi_addr + info->dlpi_phdr[j].p_vaddr); //Dynamic Section + char* strtab = NULL; + ElfW(Dyn)* dyn = (ElfW(Dyn)*)(obj->addr + obj->phdr[j].p_vaddr); // grab the needed info - while(dyn->d_tag != DT_NULL) { - switch(dyn->d_tag) { + while (dyn->d_tag != DT_NULL) { + switch (dyn->d_tag) { case DT_STRTAB: - strtab = (char *)(dyn->d_un.d_ptr); + strtab = (char*)(dyn->d_un.d_ptr); break; case DT_VERDEF: - verdef = (ElfW(Verdef)*)(info->dlpi_addr + dyn->d_un.d_ptr); + verdef = (ElfW(Verdef)*)(obj->addr + dyn->d_un.d_ptr); break; case DT_VERDEFNUM: verdef_cnt = dyn->d_un.d_val; @@ -1662,47 +1975,31 @@ int dl_iterate_phdr_findsymbol(struct dl_phdr_info* info, size_t size, void* dat } ++dyn; } - if(strtab && verdef && verdef_cnt) { - if((uintptr_t)strtab < (uintptr_t)info->dlpi_addr) // this test is need for linux-vdso on PI and some other OS (looks like a bug to me) - strtab=(char*)((uintptr_t)strtab + info->dlpi_addr); - // Look fr all defined versions now - ElfW(Verdef)* v = verdef; - while(v) { - ElfW(Verdaux)* vda = (ElfW(Verdaux)*)(((uintptr_t)v) + v->vd_aux); - if(v->vd_version>0 && !v->vd_flags) - for(int i=0; ivd_cnt; ++i) { - const char* vername = (strtab+vda->vda_name); - if(vername && vername[0] && (s->addr = dlvsym(s->lib, s->name, vername))) { - printf_log(/*LOG_DEBUG*/LOG_INFO, "Found symbol with version %s, value = %p\n", vername, s->addr); - return 1; // stop searching - } - vda = (ElfW(Verdaux)*)(((uintptr_t)vda) + vda->vda_next); - } - v = v->vd_next?(ElfW(Verdef)*)((uintptr_t)v + v->vd_next):NULL; + + if (strtab && verdef && verdef_cnt) { + eh_find_sym(obj, s->name, &s->addr); + if (s->addr) { + eh_destroy_obj(obj); + return 1; } } } } + + eh_destroy_obj(obj); return 0; } void* GetNativeSymbolUnversioned(void* lib, const char* name) { - // try to find "name" in loaded elf, whithout checking for the symbol version (like dlsym, but no version check) search_symbol_t s; s.name = name; s.addr = NULL; - if(lib) - s.lib = lib; - else - s.lib = my_context->box64lib; - printf_log(LOG_INFO, "Look for %s in loaded elfs\n", name); - dl_iterate_phdr(dl_iterate_phdr_findsymbol, &s); + eh_iterate_obj((eh_iterate_obj_callback_func)dl_iterate_phdr_findsymbol, &s); return s.addr; } -uintptr_t pltResolver = ~0LL; -EXPORT void PltResolver(x64emu_t* emu) +EXPORT void PltResolver64(x64emu_t* emu) { uintptr_t addr = Pop64(emu); int slot = (int)Pop64(emu); @@ -1710,13 +2007,13 @@ EXPORT void PltResolver(x64emu_t* emu) library_t* lib = h->lib; lib_t* local_maplib = GetMaplib(lib); int deepbind = GetDeepBind(lib); - printf_dump(LOG_DEBUG, "PltResolver: Addr=%p, Slot=%d Return=%p(%s): elf is %s (VerSym=%p, deepbind=%d, local_maplib=%p) func param: %p, %p...\n", (void*)addr, slot, *(void**)(R_RSP), getAddrFunctionName(*(uintptr_t*)R_RSP),h->name, h->VerSym, deepbind, local_maplib, (void*)R_RDI, (void*)R_RSI); + printf_dump(LOG_DEBUG, "PltResolver64: Addr=%p, Slot=%d Return=%p(%s): elf is %s (VerSym=%p, deepbind=%d, local_maplib=%p) func param: %p, %p...\n", (void*)addr, slot, *(void**)(R_RSP), getAddrFunctionName(*(uintptr_t*)R_RSP),h->name, h->VerSym, deepbind, local_maplib, (void*)R_RDI, (void*)R_RSI); Elf64_Rela * rel = (Elf64_Rela *)(h->jmprel + h->delta) + slot; - Elf64_Sym *sym = &h->DynSym[ELF64_R_SYM(rel->r_info)]; + Elf64_Sym *sym = &h->DynSym._64[ELF64_R_SYM(rel->r_info)]; int bind = ELF64_ST_BIND(sym->st_info); - const char* symname = SymName(h, sym); + const char* symname = SymName64(h, sym); int version = h->VerSym?((Elf64_Half*)((uintptr_t)h->VerSym+h->delta))[ELF64_R_SYM(rel->r_info)]:-1; if(version!=-1) version &= 0x7fff; const char* vername = GetSymbolVersion(h, version); @@ -1728,7 +2025,7 @@ EXPORT void PltResolver(x64emu_t* emu) Elf64_Sym *elfsym = NULL; if(bind==STB_LOCAL) { - elfsym = ElfDynSymLookup(h, symname); + elfsym = ElfDynSymLookup64(h, symname); if(elfsym && elfsym->st_shndx) { offs = elfsym->st_value + h->delta; end = offs + elfsym->st_size; @@ -1755,11 +2052,17 @@ EXPORT void PltResolver(x64emu_t* emu) GetGlobalSymbolStartEnd(local_maplib, symname, &offs, &end, h, version, vername, veropt, (void**)&elfsym); } if (!offs) { - printf_log(LOG_NONE, "Error: PltResolver: Symbol %s %s(%sver %d: %s%s%s) not found, cannot apply R_X86_64_JUMP_SLOT %p (%p) in %s (local_maplib=%p, global maplib=%p, deepbind=%d)\n", (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":""), symname, veropt?"opt":"", version, symname, vername?"@":"", vername?vername:"", p, *(void**)p, h->name, local_maplib, my_context->maplib, deepbind); + printf_log(LOG_NONE, "Error: PltResolver: Symbol %s %s(%sver %d: %s%s%s) not found, cannot apply R_X86_64_JUMP_SLOT %p in %s (local_maplib=%p, global maplib=%p, deepbind=%d)\n", (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":""), symname, veropt?"opt":"", version, symname, vername?"@":"", vername?vername:"", p, (h && h->name)?h->name:"???", local_maplib, my_context->maplib, deepbind); emu->quit = 1; + R_RIP = 0; //stop.... return; } else { elfheader_t* sym_elf = FindElfSymbol(my_context, elfsym); + if(elfsym && (elfsym->st_info&0xf)==STT_GNU_IFUNC) { + // this is an IFUNC, needs to evaluate the function first! + printf_dump(LOG_DEBUG, " Indirect function, will call the resolver now at %p\n", (void*)offs); + offs = RunFunction(offs, 0); + } offs = (uintptr_t)getAlternate((void*)offs); if(p) { @@ -1774,3 +2077,33 @@ EXPORT void PltResolver(x64emu_t* emu) // jmp to function R_RIP = offs; } + +const char* getAddrFunctionName(uintptr_t addr) +{ + static char rets[8][1000]; + static int idx = 0; + char* ret = rets[idx]; + idx = (idx + 1) & 7; + uint64_t sz = 0; + uintptr_t start = 0; + elfheader_t* elf = FindElfAddress(my_context, addr); + const char* symbname = FindNearestSymbolName(elf, (void*)addr, &start, &sz); + if (!sz) sz = 0x100; // arbitrary value... + if (symbname && (addr >= start) && (addr < (start + sz))) { + if (symbname[0] == '\0') + sprintf(ret, "%s + 0x%lx + 0x%lx", ElfName(elf), start - (uintptr_t)GetBaseAddress(elf), addr - start); + else if (addr == start) + sprintf(ret, "%s/%s", ElfName(elf), symbname); + else + sprintf(ret, "%s/%s + 0x%lx", ElfName(elf), symbname, addr - start); + } else { + if (elf) { + sprintf(ret, "%s + 0x%lx", ElfName(elf), addr - (uintptr_t)GetBaseAddress(elf)); + } else if(IsAddrFileMapped(addr, &symbname, &start)) { + sprintf(ret, "%s+0x%lx", symbname, addr-start); + } else { + sprintf(ret, "???"); + } + } + return ret; +} diff --git a/src/elfs/elfloader32.c b/src/elfs/elfloader32.c new file mode 100644 index 0000000..4e88b65 --- /dev/null +++ b/src/elfs/elfloader32.c @@ -0,0 +1,966 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef _DLFCN_H +#include +#endif + +#include "custommem.h" +#include "box64version.h" +#include "elfloader.h" +#include "debug.h" +#include "elfload_dump.h" +#include "elfloader_private.h" +#include "librarian.h" +#include "bridge.h" +#include "alternate.h" +#include "wrapper.h" +#include "box64context.h" +#include "library.h" +#include "x64emu.h" +#include "box64stack.h" +#include "callback.h" +#include "box64stack.h" +#include "box64cpu_util.h" +#include "wine_tools.h" +#include "dictionnary.h" +#include "symbols.h" +#ifdef DYNAREC +#include "dynablock.h" +#endif +#include "../emu/x64emu_private.h" +#include "../emu/x64run_private.h" +#include "../tools/bridge_private.h" +#include "x64tls.h" +#include "box32.h" + +ptr_t pltResolver32 = ~(ptr_t)0; + +extern void* my__IO_2_1_stderr_; +extern void* my__IO_2_1_stdin_ ; +extern void* my__IO_2_1_stdout_; + +// return the index of header (-1 if it doesn't exist) +static int getElfIndex(box64context_t* ctx, elfheader_t* head) { + for (int i=0; ielfsize; ++i) + if(ctx->elfs[i]==head) + return i; + return -1; +} + +static elfheader_t* checkElfLib(elfheader_t* h, library_t* lib) +{ + if(h && lib) { + if(!h->needed) + h->needed = new_neededlib(1); + add1libref_neededlib(h->needed, lib); + } + return h; +} + +static Elf32_Sym* ElfLocateSymbol(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +{ + Elf32_Sym* sym = ElfLookup32(head, symname, *ver, *vername, local, *veropt); + if(!sym) return NULL; + if(head->VerSym && !*veropt) { + int idx = ((uintptr_t)sym - (uintptr_t)head->DynSym._32)/sizeof(Elf32_Sym); + int version = ((Elf32_Half*)((uintptr_t)head->VerSym+head->delta))[idx]; + if(version!=-1) version &=0x7fff; + const char* symvername = GetSymbolVersion(head, version); + Elf32_Half flags = GetSymbolVersionFlag(head, version); + if(version>1 && *ver<2 && (flags==0)) { + *ver = version; + *vername = symvername; + *veropt = 1; + } else if(flags==0 && !*veropt && version>1 && *ver>1 && !strcmp(symvername, *vername)) { + *veropt = 1; + } + } + if(!sym->st_shndx) return NULL; + int vis = ELF32_ST_VISIBILITY(sym->st_other); + if(vis==STV_HIDDEN && !local) + return NULL; + return sym; +} + + +static void GrabX32CopyMainElfReloc(elfheader_t* head) +{ + if(head->rel) { + int cnt = head->relsz / head->relent; + Elf32_Rel* rel = (Elf32_Rel *)(head->rel + head->delta); + printf_dump(LOG_DEBUG, "Grabbing R_386_COPY Relocation(s) in advance for %s\n", head->name); + for (int i=0; iDynSym._32[ELF32_R_SYM(rel[i].r_info)]; + const char* symname = SymName32(head, sym); + int version = head->VerSym?((Elf32_Half*)((uintptr_t)head->VerSym+head->delta))[ELF32_R_SYM(rel[i].r_info)]:-1; + if(version!=-1) version &=0x7fff; + const char* vername = GetSymbolVersion(head, version); + Elf32_Half flags = GetSymbolVersionFlag(head, version); + int veropt = flags?0:1; + uintptr_t offs = sym->st_value + head->delta; + AddUniqueSymbol(my_context->globdata, symname, offs, sym->st_size, version, vername, veropt); + } + } + } +} + +void checkHookedSymbols(elfheader_t* h); +void AddSymbols32(lib_t *maplib, elfheader_t* h) +{ + // if(BOX64ENV(dump) && h->hash) old_elf_hash_dump(h); + // if(BOX64ENV(dump) && h->gnu_hash) new_elf_hash_dump(h); + if (BOX64ENV(dump) && h->DynSym._32) DumpDynSym32(h); + if(h==my_context->elfs[0]) + GrabX32CopyMainElfReloc(h); + #ifndef STATICBUILD + checkHookedSymbols(h); + #endif +} + +int AllocLoadElfMemory32(box64context_t* context, elfheader_t* head, int mainbin) +{ + ptr_t offs = 0; + loadProtectionFromMap(); + int log_level = BOX64ENV(load_addr)?LOG_INFO:LOG_DEBUG; + + head->multiblock_n = 0; // count PHEntrie with LOAD + uintptr_t max_align = (box64_pagesize-1); + for (size_t i=0; inumPHEntries; ++i) + if(head->PHEntries._32[i].p_type == PT_LOAD && head->PHEntries._32[i].p_flags) { + ++head->multiblock_n; + } + + if(!head->vaddr && BOX64ENV(load_addr)) { + offs = to_ptrv(find31bitBlockNearHint((void*)BOX64ENV(load_addr), head->memsz, max_align)); + BOX64ENV(load_addr) = offs + head->memsz; + BOX64ENV(load_addr) = (BOX64ENV(load_addr)+0x10ffffff)&~0xffffff; + } + if(!offs && !head->vaddr) + offs = (uintptr_t)find31bitBlockElf(head->memsz, mainbin, max_align); + // prereserve the whole elf image, without populating + size_t sz = head->memsz; + void* raw = NULL; + void* image = NULL; + if(!head->vaddr) { + sz += head->align; + raw = mmap64(from_ptrv(offs), sz, 0, MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0); + image = (void*)(((uintptr_t)raw+max_align)&~max_align); + } else { + image = raw = mmap64(from_ptrv(head->vaddr), sz, 0, MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0); + if(from_ptr(head->vaddr)&(box64_pagesize-1)) { + // load address might be lower + if((uintptr_t)image == (from_ptr(head->vaddr)&~(box64_pagesize-1))) { + image = from_ptrv(head->vaddr); + sz += ((uintptr_t)image)-((uintptr_t)raw); + } + } + } + if(image!=MAP_FAILED && !head->vaddr && image!=from_ptrv(offs)) { + printf_log(LOG_INFO, "%s: Mmap64 for (@%p 0x%zx) for elf \"%s\" returned %p(%p/0x%zx) instead\n", (((uintptr_t)image)&max_align)?"Error":"Warning", from_ptrv(head->vaddr?head->vaddr:offs), head->memsz, head->name, image, raw, head->align); + offs = to_ptrv(image); + if(((uintptr_t)image)&max_align) { + munmap(raw, sz); + return 1; // that's an error, alocated memory is not aligned properly + } + } + if(image==MAP_FAILED || image!=from_ptrv(head->vaddr?head->vaddr:offs)) { + printf_log(LOG_NONE, "%s cannot create memory map (@%p 0x%zx) for elf \"%s\"", (image==MAP_FAILED)?"Error:":"Warning:", from_ptrv(head->vaddr?head->vaddr:offs), head->memsz, head->name); + if(image==MAP_FAILED) { + printf_log_prefix(0, LOG_NONE, " error=%d/%s\n", errno, strerror(errno)); + } else { + printf_log_prefix(0, LOG_NONE, " got %p\n", image); + } + if(image==MAP_FAILED) + return 1; + offs = to_ptrv(image)-head->vaddr; + } + printf_dump(log_level, "Pre-allocated 0x%zx byte at %p for %s\n", head->memsz, image, head->name); + head->delta = offs; + printf_dump(log_level, "Delta of %p (vaddr=%p) for Elf \"%s\"\n", from_ptrv(offs), from_ptrv(head->vaddr), head->name); + + head->image = image; + head->raw = raw; + head->raw_size = sz; + setProtection_elf((uintptr_t)raw, sz, 0); + + head->multiblocks = (multiblock_t*)box_calloc(head->multiblock_n, sizeof(multiblock_t)); + head->tlsbase = AddTLSPartition(context, head->tlssize); + // and now, create all individual blocks + head->memory = (char*)0xffffffff; + int n = 0; + for (size_t i=0; inumPHEntries; ++i) { + if(head->PHEntries._32[i].p_type == PT_LOAD && head->PHEntries._32[i].p_flags) { + Elf32_Phdr * e = &head->PHEntries._32[i]; + + head->multiblocks[n].flags = e->p_flags; + head->multiblocks[n].offs = e->p_offset; + head->multiblocks[n].paddr = e->p_paddr + offs; + head->multiblocks[n].size = e->p_filesz; + head->multiblocks[n].align = e->p_align; + uint8_t prot = PROT_READ|PROT_WRITE|((e->p_flags & PF_X)?PROT_EXEC:0); + // check if alignment is correct + uintptr_t balign = head->multiblocks[n].align-1; + if(balign<4095) balign = 4095; + head->multiblocks[n].asize = (e->p_memsz+(e->p_paddr&balign)+4095)&~4095; + int try_mmap = 1; + if(e->p_paddr&balign) + try_mmap = 0; + if(e->p_offset&(box64_pagesize-1)) + try_mmap = 0; + if(ALIGN(e->p_memsz)!=ALIGN(e->p_filesz)) + try_mmap = 0; + if(!e->p_filesz) + try_mmap = 0; + if(e->p_alignmultiblocks[n].size, head->multiblocks[n].asize, (void*)head->multiblocks[n].paddr, head->name); + void* p = mmap64( + (void*)head->multiblocks[n].paddr, + head->multiblocks[n].size, + prot, + MAP_PRIVATE|MAP_FIXED, //((prot&PROT_WRITE)?MAP_SHARED:MAP_PRIVATE)|MAP_FIXED, + head->fileno, + e->p_offset + ); + if(p==MAP_FAILED || p!=(void*)head->multiblocks[n].paddr) { + try_mmap = 0; + printf_dump(log_level, "Mapping failed, using regular mmap+read"); + } else { + if(e->p_memsz>e->p_filesz && (prot&PROT_WRITE)) + memset((void*)((uintptr_t)p + e->p_filesz), 0, e->p_memsz-e->p_filesz); + setProtection_elf((uintptr_t)p, head->multiblocks[n].asize, prot); + head->multiblocks[n].p = p; + + } + } + if(!try_mmap) { + uintptr_t paddr = head->multiblocks[n].paddr&~balign; + size_t asize = head->multiblocks[n].asize; + void* p = MAP_FAILED; + if(paddr==(paddr&~(box64_pagesize-1)) && (asize==ALIGN(asize))) { + printf_dump(log_level, "Allocating 0x%zx (0x%zx) bytes @%p, will read 0x%zx @%p for Elf \"%s\"\n", asize, e->p_memsz, (void*)paddr, e->p_filesz, (void*)head->multiblocks[n].paddr, head->name); + p = mmap64( + (void*)paddr, + asize, + prot|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, + -1, + 0 + ); + } else { + // difference in pagesize, so need to mmap only what needed to be... + //check startint point + uintptr_t new_addr = paddr&~(box64_pagesize-1); // new_addr might be smaller than paddr + ssize_t new_size = asize + (paddr-new_addr); // so need new_size to compensate + while(getProtection(new_addr) && (new_size>0)) {// but then, there might be some overlap + uintptr_t diff = ALIGN(new_addr+1) - new_addr; // next page + if(diff<(size_t)new_size) + new_size -= diff; + else + new_size = 0; + new_addr = ALIGN(new_addr+1); + } + if(new_size>0) { + printf_dump(log_level, "Allocating 0x%zx (0x%zx/0x%zx) bytes @%p, will read 0x%zx @%p for Elf \"%s\"\n", ALIGN(new_size), paddr, e->p_memsz, (void*)new_addr, e->p_filesz, (void*)head->multiblocks[n].paddr, head->name); + p = mmap64( + (void*)new_addr, + ALIGN(new_size), + prot|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, + -1, + 0 + ); + if(p==(void*)new_addr) + p = (void*)paddr; + } else { + p = (void*)paddr; + printf_dump(log_level, "Will read 0x%zx @%p for Elf \"%s\"\n", e->p_filesz, (void*)head->multiblocks[n].paddr, head->name); + } + } + if(p==MAP_FAILED || p!=(void*)paddr) { + printf_log(LOG_NONE, "Cannot create memory map (@%p 0x%zx/0x%zx) for elf \"%s\"", (void*)paddr, asize, balign, head->name); + if(p==MAP_FAILED) { + printf_log(LOG_NONE, " error=%d/%s\n", errno, strerror(errno)); + } else { + printf_log(LOG_NONE, " got %p\n", p); + } + return 1; + } + setProtection_elf((uintptr_t)p, asize, prot); + head->multiblocks[n].p = p; + if(e->p_filesz) { + fseeko64(head->file, head->multiblocks[n].offs, SEEK_SET); + if(fread((void*)head->multiblocks[n].paddr, head->multiblocks[n].size, 1, head->file)!=1) { + printf_log(LOG_NONE, "Cannot read elf block (@%p 0x%zx/0x%zx) for elf \"%s\"\n", (void*)head->multiblocks[n].offs, head->multiblocks[n].asize, balign, head->name); + return 1; + } + } + if(!(prot&PROT_WRITE) && (paddr==(paddr&(box64_pagesize-1)) && (asize==ALIGN(asize)))) + mprotect((void*)paddr, asize, prot); + } +#ifdef DYNAREC + if(BOX64ENV(dynarec) && (e->p_flags & PF_X)) { + dynarec_log(LOG_DEBUG, "Add ELF eXecutable Memory %p:%p\n", head->multiblocks[n].p, (void*)head->multiblocks[n].asize); + addDBFromAddressRange((uintptr_t)head->multiblocks[n].p, head->multiblocks[n].asize); + } +#endif + if((uintptr_t)head->memory>(uintptr_t)head->multiblocks[n].p) + head->memory = (char*)head->multiblocks[n].p; + ++n; + } + if(head->PHEntries._32[i].p_type == PT_TLS) { + Elf32_Phdr * e = &head->PHEntries._32[i]; + char* dest = (char*)(context->tlsdata+context->tlssize+head->tlsbase); + printf_log(LOG_DEBUG, "Loading TLS block #%zu @%p (0x%zx/0x%zx)\n", i, dest, e->p_filesz, e->p_memsz); + if(e->p_filesz) { + fseeko64(head->file, e->p_offset, SEEK_SET); + if(fread(dest, e->p_filesz, 1, head->file)!=1) { + printf_log(LOG_NONE, "Fail to read PT_TLS part #%zu (size=%zd)\n", i, e->p_filesz); + return 1; + } + } + // zero'd difference between filesz and memsz + if(e->p_filesz != e->p_memsz) + memset(dest+e->p_filesz, 0, e->p_memsz - e->p_filesz); + } + } + // record map + RecordEnvMappings((uintptr_t)head->image, head->memsz, head->fileno); + // can close the elf file now! + fclose(head->file); + head->file = NULL; + head->fileno = -1; + + PatchLoadedDynamicSection(head); + + return 0; +} + +static int IsSymInElfSpace(const elfheader_t* h, Elf32_Sym* sym) +{ + if(!h || !sym) + return 0; + uintptr_t addr = (uintptr_t)sym; + if(h->SymTab._32 && addr>=(uintptr_t)h->SymTab._32 && addr<(uintptr_t)&h->SymTab._32[h->numSymTab]) + return 1; + if(h->DynSym._32 && addr>=(uintptr_t)h->DynSym._32 && addr<(uintptr_t)&h->DynSym._32[h->numDynSym]) + return 1; + return 0; +} +static elfheader_t* FindElfSymbol(box64context_t *context, Elf32_Sym* sym) +{ + if(!sym) + return NULL; + for (int i=0; ielfsize; ++i) + if(IsSymInElfSpace(context->elfs[i], sym)) + return context->elfs[i]; + + return NULL; +} + +void GrabR386CopyMainElfReloc(elfheader_t* head) +{ + if(head->rel) { + int cnt = head->relsz / head->relent; + Elf32_Rel* rel = (Elf32_Rel *)(head->rel + head->delta); + printf_dump(LOG_DEBUG, "Grabbing R_386_COPY Relocation(s) in advance for %s\n", head->name); + for (int i=0; iDynSym._32[ELF32_R_SYM(rel[i].r_info)]; + const char* symname = SymName32(head, sym); + int version = head->VerSym?((Elf32_Half*)((uintptr_t)head->VerSym+head->delta))[ELF32_R_SYM(rel[i].r_info)]:-1; + if(version!=-1) version &=0x7fff; + const char* vername = GetSymbolVersion(head, version); + Elf32_Half flags = GetSymbolVersionFlag(head, version); + int veropt = flags?0:1; + uintptr_t offs = sym->st_value + head->delta; + AddUniqueSymbol(my_context->globdata, symname, offs, sym->st_size, version, vername, veropt); + } + } + } +} + + +static int FindR386COPYRel(elfheader_t* h, const char* name, ptr_t *offs, uint32_t** p, size_t size, int version, const char* vername, int veropt) +{ + if(!h) + return 0; + if(!h->rel) + return 0; + if(h->relent) { + Elf32_Rel * rel = (Elf32_Rel *)(h->rel + h->delta); + int cnt = h->relsz / h->relent; + for (int i=0; iDynSym._32[ELF32_R_SYM(rel[i].r_info)]; + const char* symname = SymName32(h, sym); + if((t==R_386_COPY) && symname && !strcmp(symname, name) && (sym->st_size==size)) { + int version2 = h->VerSym?((Elf32_Half*)((uintptr_t)h->VerSym+h->delta))[ELF32_R_SYM(rel[i].r_info)]:-1; + if(version2!=-1) version2 &= 0x7fff; + if(version && !version2) version2=-1; // match a versioned symbol against a global "local" symbol + const char* vername2 = GetSymbolVersion(h, version2); + Elf32_Half flags = GetSymbolVersionFlag(h, version2); + int veropt2 = flags?0:1; + if(SameVersionedSymbol(name, version, vername, veropt, symname, version2, vername2, veropt2)) { + if(offs) *offs = sym->st_value + h->delta; + if(p) *p = (uint32_t*)(rel[i].r_offset + h->delta); + return 1; + } + } + } + } + return 0; +} + +static int RelocateElfREL(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head, int cnt, Elf32_Rel *rel, int* need_resolv) +{ + int ret_ok = 0; + for (int i=0; iDynSym._32[ELF32_R_SYM(rel[i].r_info)]; + int bind = ELF32_ST_BIND(sym->st_info); + //uint32_t ndx = sym->st_shndx; + const char* symname = SymName32(head, sym); + uint32_t *p = (uint32_t*)(rel[i].r_offset + head->delta); + uintptr_t offs = 0; + uintptr_t end = 0; + size_t size = sym->st_size; + elfheader_t* sym_elf = NULL; + elfheader_t* last_elf = NULL; + int version = head->VerSym?((Elf32_Half*)((uintptr_t)head->VerSym+head->delta))[ELF32_R_SYM(rel[i].r_info)]:-1; + if(version!=-1) version &=0x7fff; + const char* vername = GetSymbolVersion(head, version); + Elf32_Half flags = GetSymbolVersionFlag(head, version); + int veropt = flags?0:1; + Elf32_Sym* elfsym = NULL; + int vis = ELF64_ST_VISIBILITY(sym->st_other); + if(vis==STV_PROTECTED) { + elfsym = ElfDynSymLookup32(head, symname); + if(elfsym) { + offs = elfsym->st_value + head->delta; + end = offs + elfsym->st_size; + } + printf_log(LOG_DEBUG, "Symbol %s from %s is PROTECTED\n", symname, head->name); + } else { + if(bind==STB_GNU_UNIQUE) { + GetGlobalSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername, veropt, (void**)&elfsym); + if(!offs && !end && local_maplib) + GetGlobalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername, veropt, (void**)&elfsym); + } else if(bind==STB_LOCAL) { + if(!symname || !symname[0]) { + offs = sym->st_value + head->delta; + end = offs + sym->st_size; + } else { + elfsym = ElfDynSymLookup32(head, symname); + if(elfsym && elfsym->st_shndx) { + offs = elfsym->st_value + head->delta; + end = offs + elfsym->st_size; + } + if(!offs && !end && local_maplib && deepbind) + GetLocalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername, veropt, (void**)&elfsym); + if(!offs && !end) + GetLocalSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername, veropt, (void**)&elfsym); + if(!offs && !end && local_maplib && !deepbind) + GetLocalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername, veropt, (void**)&elfsym); + } + } else { + if(!offs && !end && local_maplib && deepbind) + GetGlobalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername, veropt, (void**)&elfsym); + if(!offs && !end) + GetGlobalSymbolStartEnd(maplib, symname, &offs, &end, head, version, vername, veropt, (void**)&elfsym); + if(!offs && !end && local_maplib && !deepbind) + GetGlobalSymbolStartEnd(local_maplib, symname, &offs, &end, head, version, vername, veropt, (void**)&elfsym); + } + } + sym_elf = FindElfSymbol(my_context, elfsym); + if(elfsym && (ELF32_ST_TYPE(elfsym->st_info)==STT_TLS)) + offs = elfsym->st_value; + uintptr_t globoffs, globend; + uint32_t* globp; + uintptr_t tmp = 0; + intptr_t delta; + switch(t) { + case R_386_NONE: + // can be ignored + printf_dump(LOG_NEVER, "Ignoring [%d] %s %p (%p)\n", i, DumpRelType32(t), p, from_ptrv(p?(*p):0)); + break; + case R_386_PC32: + if (!offs) { + printf_log(LOG_NONE, "Error: Global Symbol %s not found, cannot apply R_386_PC32 %p (%p) in %s\n", symname, p, from_ptrv(*p), head->name); + ret_ok = 1; + } + if(offs) + printf_dump(LOG_NEVER, "Apply [%d] %s R_386_PC32 %p with sym=%s (ver=%d/%s), (%p -> %p/%p)\n", i, (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":"Global"), p, symname, version, vername?vername:"(none)", from_ptrv(*(ptr_t*)p), from_ptrv(*(ptr_t*)p+(offs-to_ptrv(p))), from_ptrv(offs)); + offs = (offs - to_ptrv(p)); + *p += offs; + break; + case R_386_RELATIVE: + printf_dump(LOG_NEVER, "Apply [%d] %s R_386_RELATIVE %p (%p -> %p)\n", i, (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":"Global"), p, from_ptrv(*p), (void*)((*p)+head->delta)); + *p += head->delta; + break; + case R_386_COPY: + globoffs = offs; + globend = end; + offs = end = 0; + if(!offs && local_maplib && deepbind) + GetNoSelfSymbolStartEnd(local_maplib, symname, &offs, &end, head, size, version, vername, veropt, NULL); + if(!offs) + GetNoSelfSymbolStartEnd(maplib, symname, &offs, &end, head, size, version, vername, veropt, NULL); + if(!offs && local_maplib && !deepbind) + GetNoSelfSymbolStartEnd(local_maplib, symname, &offs, &end, head, size, version, vername, veropt, NULL); + if(!offs) {offs = globoffs; end = globend;} + if(offs) { + // add r_addend to p? + printf_dump(LOG_NEVER, "Apply R_386_COPY @%p with sym=%s (%sver=%d/%s), @%p size=%d\n", p, symname, veropt?"opt":"", version, vername?vername:"(none)", from_ptrv(offs), sym->st_size); + if(p!=from_ptrv(offs)) + memmove(p, from_ptrv(offs), sym->st_size); + sym_elf = FindElfAddress(my_context, offs); + if(sym_elf && sym_elf!=last_elf && sym_elf!=head) last_elf = checkElfLib(head, sym_elf->lib); + } else { + printf_log(LOG_NONE, "Error: Symbol %s not found, cannot apply REL R_386_COPY @%p (%p) in %s\n", symname, p, from_ptrv(*p), head->name); + } + break; + case R_386_GLOB_DAT: + if(GetSymbolStartEnd(my_context->globdata, symname, &globoffs, &globend, version, vername, 1, veropt)) { + globp = (uint32_t*)globoffs; + printf_dump(LOG_NEVER, "Apply %s R_386_GLOB_DAT with R_386_COPY @%p/%p (%p/%p -> %p/%p) size=%d on sym=%s (%sver=%d/%s) \n", + BindSymFriendly(bind), p, globp, from_ptrv(p?(*p):0), + from_ptrv(globp?(*globp):0), (void*)offs, (void*)globoffs, sym->st_size, symname, veropt?"opt":"", version, vername?vername:"(none)"); + sym_elf = my_context->elfs[0]; + *p = globoffs; + } else { + if (!offs) { + if(strcmp(symname, "__gmon_start__") && strcmp(symname, "data_start") && strcmp(symname, "__data_start") && strcmp(symname, "collector_func_load")) + printf_log((bind==STB_WEAK)?LOG_DEBUG:LOG_NONE, "%s: Global Symbol %s not found, cannot apply R_386_GLOB_DAT @%p (%p) in %s\n", (bind==STB_WEAK)?"Warning":"Error", symname, p, *(void**)p, head->name); + } else { + printf_dump(LOG_NEVER, "Apply %s R_386_GLOB_DAT @%p (%p -> %p) on sym=%s (%sver=%d/%s, elf=%s)\n", BindSymFriendly(bind), p, from_ptrv(p?(*p):0), from_ptrv(offs), symname, veropt?"opt":"", version, vername?vername:"(none)", sym_elf?sym_elf->name:"(native)"); + *p = offs; + if(sym_elf && sym_elf!=last_elf && sym_elf!=head) last_elf = checkElfLib(head, sym_elf->lib); + } + } + break; + case R_386_JMP_SLOT: + // apply immediatly for gobject closure marshal or for LOCAL binding. Also, apply immediatly if it doesn't jump in the got + tmp = (uintptr_t)(*p); + if (bind==STB_LOCAL + || ((symname && strstr(symname, "g_cclosure_marshal_")==symname)) + || ((symname && strstr(symname, "__pthread_unwind_next")==symname)) + || !tmp + || !((tmp>=head->plt && tmpplt_end) || (tmp>=head->gotplt && tmpgotplt_end)) + || !need_resolv + || bindnow + ) { + if (!offs) { + if(bind==STB_WEAK) { + printf_log(LOG_INFO, "Warning: Weak Symbol %s not found, cannot apply R_386_JMP_SLOT %p (%p)\n", symname, p, from_ptrv(*p)); + } else { + printf_log(LOG_NONE, "Error: Symbol %s not found, cannot apply R_386_JMP_SLOT %p (%p) in %s\n", symname, p, from_ptrv(*p), head->name); + ret_ok = 1; + } + } else { + if(p) { + printf_dump(LOG_NEVER, "Apply %s R_386_JMP_SLOT %p with sym=%s(%s%s%s) (%p -> %p)\n", (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":"Global"), p, symname, symname, vername?"@":"", vername?vername:"", from_ptrv(*p), from_ptrv(offs)); + *p = offs; + } else { + printf_log(LOG_NONE, "Warning, Symbol %s found, but Jump Slot Offset is NULL \n", symname); + } + } + } else { + printf_dump(LOG_NEVER, "Preparing (if needed) %s R_386_JMP_SLOT %p (0x%x->0x%0x) with sym=%s(%s%s%s/version %d) to be apply later\n", (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":"Global"), p, *p, *p+head->delta, symname, symname, vername?"@":"", vername?vername:"", version); + *p += head->delta; + *need_resolv = 1; + } + break; + case R_386_32: + if(GetSymbolStartEnd(my_context->globdata, symname, &globoffs, &globend, version, vername, 1, veropt)) { + if(offs!=globoffs) { + offs = globoffs; + sym_elf = my_context->elfs[0]; + elfsym = ElfDynSymLookup32(sym_elf, symname); + } + } + if (!offs) { + if(strcmp(symname, "__gmon_start__") && strcmp(symname, "data_start") && strcmp(symname, "__data_start")) { + printf_log(LOG_NONE, "%s: Symbol sym=%s(%s%s%s/version %d) not found, cannot apply R_386_32 %p (%p) in %s\n", (bind==STB_GLOBAL)?"Error":"Warning", symname, symname, vername?"@":"", vername?vername:"", version, p, from_ptrv(*p), head->name); + if(bind==STB_GLOBAL) + ret_ok = 1; + } + } else { + printf_dump(LOG_NEVER, "Apply %s R_386_32 %p with sym=%s (ver=%d/%s) (%p -> %p)\n", (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":"Global"), p, symname, version, vername?vername:"(none)", from_ptrv(*p), from_ptrv(offs+*p)); + *p += offs; + } + break; + case R_386_TLS_TPOFF: + // Negated offset in static TLS block + { + if(!symname || !symname[0]) { + sym_elf = head; + offs = sym->st_value; + } + if(sym_elf) { + delta = *(int32_t*)p; + printf_dump(LOG_NEVER, "Applying %s %s on %s @%p (%d -> %d+%d, size=%d)\n", (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":"Global"), DumpRelType32(t), symname, p, delta, sym_elf->tlsbase, (int32_t)offs, end-offs); + *p = (uintptr_t)((int32_t)offs + sym_elf->tlsbase); + } else { + printf_log(LOG_INFO, "Warning, cannot apply %s %s on %s @%p (%d), no elf_header found\n", (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":"Global"), DumpRelType32(t), symname, p, (int32_t)offs); + } + } + break; + case R_386_TLS_TPOFF32: + // Non-negated offset in static TLS block??? + { + if(!symname || !symname[0]) { + sym_elf = head; + offs = sym->st_value; + } + if(sym_elf) { + delta = *(int32_t*)p; + printf_dump(LOG_NEVER, "Applying %s %s on %s @%p (%d -> %d+%d, size=%d)\n", (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":"Global"), DumpRelType32(t), symname, p, delta, -sym_elf->tlsbase, (int32_t)offs, end-offs); + *p = (uintptr_t)((int32_t)offs - sym_elf->tlsbase); + } else { + printf_log(LOG_INFO, "Warning, cannot apply %s %s on %s @%p (%d), no elf_header found\n", (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":"Global"), DumpRelType32(t), symname, p, (int32_t)offs); + } + } + break; + case R_386_TLS_DTPMOD32: + // ID of module containing symbol + if(!symname || symname[0]=='\0' || bind==STB_LOCAL) { + offs = getElfIndex(my_context, head); + sym_elf = head; + } else { + offs = getElfIndex(my_context, sym_elf); + } + if(p) { + printf_dump(LOG_NEVER, "Apply %s %s %p with sym=%s (%p -> %p)\n", "R_386_TLS_DTPMOD32", (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":"Global"), p, symname, from_ptrv(*p), from_ptrv(offs)); + *p = offs; + } else { + printf_log(LOG_NONE, "Warning, Symbol %s or Elf not found, but R_386_TLS_DTPMOD32 Slot Offset is NULL \n", symname); + } + break; + case R_386_TLS_DTPOFF32: + // Offset in TLS block + if (!offs && !end) { + if(bind==STB_WEAK) { + printf_log(LOG_INFO, "Warning: Weak Symbol %s not found, cannot apply R_386_TLS_DTPOFF32 %p (%p)\n", symname, p, from_ptrv(*p)); + } else { + printf_log(LOG_NONE, "Error: Symbol %s not found, cannot apply R_386_TLS_DTPOFF32 %p (%p) in %s\n", symname, p, from_ptrv(*p), head->name); + } + } else { + if(!symname || !symname[0]) { + offs = (uintptr_t)((intptr_t)(head->tlsaddr + head->delta) - (intptr_t)offs); // negative offset + } + if(p) { + printf_dump(LOG_NEVER, "Apply %s R_386_TLS_DTPOFF32 %p with sym=%s (ver=%d/%s) (%zd -> %zd)\n", (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":"Global"), p, symname, version, vername?vername:"(none)", (intptr_t)*p, (intptr_t)offs); + *p = offs; + } else { + printf_log(LOG_NONE, "Warning, Symbol %s found, but R_386_TLS_DTPOFF32 Slot Offset is NULL \n", symname); + } + } + break; + default: + printf_log(LOG_INFO, "Warning, don't know of to handle rel #%d %s (%p) for %s\n", i, DumpRelType32(ELF32_R_TYPE(rel[i].r_info)), p, symname?symname:"(nil)"); + } + } + return bindnow?ret_ok:0; +} + +static int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head, int cnt, Elf32_Rela *rela, int* need_resolv) +{ + printf_log(LOG_NONE, "Error: RELA type of Relocation unsupported (only REL)\n"); + return 1; +} + +static int RelocateElfRELR(elfheader_t *head, int cnt, Elf32_Relr *relr) +{ + printf_log(LOG_NONE, "Error: RELR type of Relocation unsupported (only REL)\n"); + return 1; +} + +int RelocateElf32(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head) +{ + if(0 && (head->flags&DF_BIND_NOW) && !bindnow) { // disable for now, needs more symbol in a fow libs like gtk and nss3 + bindnow = 1; + printf_log(LOG_DEBUG, "Forcing %s to Bind Now\n", head->name); + } + if(head->relr) { + int cnt = head->relrsz / head->relrent; + DumpRelRTable32(head, cnt, (Elf32_Relr *)(head->relr + head->delta), "RelR"); + printf_log(LOG_DEBUG, "Applying %d Relocation(s) with Addend for %s\n", cnt, head->name); + if(RelocateElfRELR(head, cnt, (Elf32_Relr *)(head->relr + head->delta))) + return -1; + } + if(head->rel) { + int cnt = head->relsz / head->relent; + DumpRelTable32(head, cnt, (Elf32_Rel *)(head->rel + head->delta), "Rel"); + printf_log(LOG_DEBUG, "Applying %d Relocation(s) for %s\n", cnt, head->name); + if(RelocateElfREL(maplib, local_maplib, bindnow, deepbind, head, cnt, (Elf32_Rel *)(head->rel + head->delta), NULL)) + return -1; + } + if(head->rela) { + int cnt = head->relasz / head->relaent; + DumpRelATable32(head, cnt, (Elf32_Rela *)(head->rela + head->delta), "RelA"); + printf_log(LOG_DEBUG, "Applying %d Relocation(s) with Addend for %s\n", cnt, head->name); + if(RelocateElfRELA(maplib, local_maplib, bindnow, deepbind, head, cnt, (Elf32_Rela *)(head->rela + head->delta), NULL)) + return -1; + } + return 0; +} + +int RelocateElfPlt32(lib_t *maplib, lib_t *local_maplib, int bindnow, int deepbind, elfheader_t* head) +{ + int need_resolver = 0; + if(0 && (head->flags&DF_BIND_NOW) && !bindnow) { // disable for now, needs more symbol in a fow libs like gtk and nss3 + bindnow = 1; + printf_log(LOG_DEBUG, "Forcing %s to Bind Now\n", head->name); + } + if(head->pltrel) { + int cnt = head->pltsz / head->pltent; + if(head->pltrel==DT_REL) { + DumpRelTable32(head, cnt, (Elf32_Rel *)(head->jmprel + head->delta), "PLT"); + printf_log(LOG_DEBUG, "Applying %d PLT Relocation(s) for %s\n", cnt, head->name); + if(RelocateElfREL(maplib, local_maplib, bindnow, deepbind, head, cnt, (Elf32_Rel *)(head->jmprel + head->delta), &need_resolver)) + return -1; + } else if(head->pltrel==DT_RELA) { + DumpRelATable32(head, cnt, (Elf32_Rela *)(head->jmprel + head->delta), "PLT"); + printf_log(LOG_DEBUG, "Applying %d PLT Relocation(s) with Addend for %s\n", cnt, head->name); + if(RelocateElfRELA(maplib, local_maplib, bindnow, deepbind, head, cnt, (Elf32_Rela *)(head->jmprel + head->delta), &need_resolver)) + return -1; + } + if(need_resolver) { + if(pltResolver32==~(ptr_t)0) { + pltResolver32 = AddBridge(my_context->system, vFEv, PltResolver32, 0, "(PltResolver)"); + } + if(head->pltgot) { + *(ptr_t*)from_ptrv(head->pltgot+head->delta+8) = pltResolver32; + *(ptr_t*)from_ptrv(head->pltgot+head->delta+4) = to_ptrv(head); + printf_log(LOG_DEBUG, "PLT Resolver injected in plt.got at %p\n", from_ptrv(head->pltgot+head->delta+8)); + } else if(head->got) { + *(ptr_t*)from_ptrv(head->got+head->delta+8) = pltResolver32; + *(ptr_t*)from_ptrv(head->got+head->delta+4) = to_ptrv(head); + printf_log(LOG_DEBUG, "PLT Resolver injected in got at %p\n", from_ptrv(head->got+head->delta+8)); + } + } + } + return 0; +} + +void ResetSpecialCaseMainElf32(elfheader_t* h) +{ + Elf32_Sym *sym = NULL; + for (uint32_t i=0; inumDynSym; ++i) { + if(h->DynSym._32[i].st_info == 17) { + sym = h->DynSym._32+i; + const char * symname = h->DynStr+sym->st_name; + if(strcmp(symname, "_IO_2_1_stderr_")==0 && (from_ptrv(sym->st_value+h->delta))) { + memcpy(from_ptrv(sym->st_value+h->delta), stderr, sym->st_size); + my__IO_2_1_stderr_ = from_ptrv(sym->st_value+h->delta); + printf_log(LOG_DEBUG, "Set @_IO_2_1_stderr_ to %p\n", my__IO_2_1_stderr_); + } else + if(strcmp(symname, "_IO_2_1_stdin_")==0 && (from_ptrv(sym->st_value+h->delta))) { + memcpy(from_ptrv(sym->st_value+h->delta), stdin, sym->st_size); + my__IO_2_1_stdin_ = from_ptrv(sym->st_value+h->delta); + printf_log(LOG_DEBUG, "Set @_IO_2_1_stdin_ to %p\n", my__IO_2_1_stdin_); + } else + if(strcmp(symname, "_IO_2_1_stdout_")==0 && (from_ptrv(sym->st_value+h->delta))) { + memcpy(from_ptrv(sym->st_value+h->delta), stdout, sym->st_size); + my__IO_2_1_stdout_ = from_ptrv(sym->st_value+h->delta); + printf_log(LOG_DEBUG, "Set @_IO_2_1_stdout_ to %p\n", my__IO_2_1_stdout_); + } else + if(strcmp(symname, "_IO_stderr_")==0 && (from_ptrv(sym->st_value+h->delta))) { + memcpy(from_ptrv(sym->st_value+h->delta), stderr, sym->st_size); + my__IO_2_1_stderr_ = from_ptrv(sym->st_value+h->delta); + printf_log(LOG_DEBUG, "Set @_IO_stderr_ to %p\n", my__IO_2_1_stderr_); + } else + if(strcmp(symname, "_IO_stdin_")==0 && (from_ptrv(sym->st_value+h->delta))) { + memcpy(from_ptrv(sym->st_value+h->delta), stdin, sym->st_size); + my__IO_2_1_stdin_ = from_ptrv(sym->st_value+h->delta); + printf_log(LOG_DEBUG, "Set @_IO_stdin_ to %p\n", my__IO_2_1_stdin_); + } else + if(strcmp(symname, "_IO_stdout_")==0 && (from_ptrv(sym->st_value+h->delta))) { + memcpy(from_ptrv(sym->st_value+h->delta), stdout, sym->st_size); + my__IO_2_1_stdout_ = from_ptrv(sym->st_value+h->delta); + printf_log(LOG_DEBUG, "Set @_IO_stdout_ to %p\n", my__IO_2_1_stdout_); + } + } + } +} + +void* ElfGetLocalSymbolStartEnd32(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +{ + Elf32_Sym* sym = ElfLocateSymbol(head, offs, end, symname, ver, vername, local, veropt); + if(!sym) return NULL; + int bind = ELF32_ST_BIND(sym->st_info); + if(bind!=STB_LOCAL) return 0; + if(offs) *offs = sym->st_value + head->delta; + if(end) *end = sym->st_value + head->delta + sym->st_size; + return sym; +} + +void* ElfGetGlobalSymbolStartEnd32(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +{ + Elf32_Sym* sym = ElfLocateSymbol(head, offs, end, symname, ver, vername, local, veropt); + if(!sym) return NULL; + int bind = ELF32_ST_BIND(sym->st_info); + if(bind!=STB_GLOBAL && bind!=STB_GNU_UNIQUE) return 0; + if(offs) *offs = sym->st_value + head->delta; + if(end) *end = sym->st_value + head->delta + sym->st_size; + return sym; +} + +void* ElfGetWeakSymbolStartEnd32(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +{ + Elf32_Sym* sym = ElfLocateSymbol(head, offs, end, symname, ver, vername, local, veropt); + if(!sym) return NULL; + int bind = ELF32_ST_BIND(sym->st_info); + if(bind!=STB_WEAK) return 0; + if(offs) *offs = sym->st_value + head->delta; + if(end) *end = sym->st_value + head->delta + sym->st_size; + return sym; +} + +void* ElfGetSymbolStartEnd32(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt) +{ + Elf32_Sym* sym = ElfLocateSymbol(head, offs, end, symname, ver, vername, local, veropt); + if(!sym) return NULL; + if(offs) *offs = sym->st_value + head->delta; + if(end) *end = sym->st_value + head->delta + sym->st_size; + return sym; +} + +int ElfGetSymTabStartEnd32(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname) +{ + Elf32_Sym* sym = ElfSymTabLookup32(head, symname); + if(!sym) return 0; + if(!sym->st_shndx) return 0; + if(!sym->st_size) return 0; //needed? + if(offs) *offs = sym->st_value + head->delta; + if(end) *end = sym->st_value + head->delta + sym->st_size; + return 1; +} + +EXPORT void PltResolver32(x64emu_t* emu) +{ + ptr_t addr = Pop32(emu); + int slot = (int)Pop32(emu); + elfheader_t *h = (elfheader_t*)from_ptrv(addr); + library_t* lib = h->lib; + lib_t* local_maplib = GetMaplib(lib); + int deepbind = GetDeepBind(lib); + printf_dump(LOG_DEBUG, "PltResolver32: Addr=%p, Slot=%d Return=%p: elf is %s (VerSym=%p)\n", from_ptrv(addr), slot, *(ptr_t*)from_ptrv(R_ESP), h->name, h->VerSym); + + Elf32_Rel * rel = (Elf32_Rel *)(from_ptrv(h->jmprel + h->delta + slot)); + + Elf32_Sym *sym = &h->DynSym._32[ELF32_R_SYM(rel->r_info)]; + int bind = ELF32_ST_BIND(sym->st_info); + const char* symname = SymName32(h, sym); + int version = h->VerSym?((Elf32_Half*)((uintptr_t)h->VerSym+h->delta))[ELF32_R_SYM(rel->r_info)]:-1; + if(version!=-1) version &= 0x7fff; + const char* vername = GetSymbolVersion(h, version); + Elf32_Half flags = GetSymbolVersionFlag(h, version); + int veropt = flags?0:1; + ptr_t *p = (uint32_t*)from_ptrv(rel->r_offset + h->delta); + uintptr_t offs = 0; + uintptr_t end = 0; + + Elf32_Sym *elfsym = NULL; + if(bind==STB_LOCAL) { + elfsym = ElfDynSymLookup32(h, symname); + if(elfsym && elfsym->st_shndx) { + offs = elfsym->st_value + h->delta; + end = offs + elfsym->st_size; + } + if(!offs && !end && local_maplib && deepbind) + GetLocalSymbolStartEnd(local_maplib, symname, &offs, &end, h, version, vername, veropt, (void**)&elfsym); + if(!offs && !end) + GetLocalSymbolStartEnd(my_context->maplib, symname, &offs, &end, h, version, vername, veropt, (void**)&elfsym); + if(!offs && !end && local_maplib && !deepbind) + GetLocalSymbolStartEnd(local_maplib, symname, &offs, &end, h, version, vername, veropt, (void**)&elfsym); + } else if(bind==STB_WEAK) { + if(local_maplib && deepbind) + GetGlobalWeakSymbolStartEnd(local_maplib, symname, &offs, &end, h, version, vername, veropt, (void**)&elfsym); + else + GetGlobalWeakSymbolStartEnd(my_context->maplib, symname, &offs, &end, h, version, vername, veropt, (void**)&elfsym); + if(!offs && !end && local_maplib && !deepbind) + GetGlobalWeakSymbolStartEnd(local_maplib, symname, &offs, &end, h, version, vername, veropt, (void**)&elfsym); + } else { + if(!offs && !end && local_maplib && deepbind) + GetGlobalSymbolStartEnd(local_maplib, symname, &offs, &end, h, version, vername, veropt, (void**)&elfsym); + if(!offs && !end) + GetGlobalSymbolStartEnd(my_context->maplib, symname, &offs, &end, h, version, vername, veropt, (void**)&elfsym); + if(!offs && !end && local_maplib && !deepbind) + GetGlobalSymbolStartEnd(local_maplib, symname, &offs, &end, h, version, vername, veropt, (void**)&elfsym); + } + + if (!offs) { + printf_log(LOG_NONE, "Error: PltResolver32: Symbol %s(ver %d: %s%s%s) not found, cannot apply R_386_JMP_SLOT %p (%p) in %s\n", symname, version, symname, vername?"@":"", vername?vername:"", p, from_ptrv(*p), h->name); + emu->quit = 1; + return; + } else { + elfheader_t* sym_elf = FindElfSymbol(my_context, elfsym); + if(elfsym && (elfsym->st_info&0xf)==STT_GNU_IFUNC) { + // this is an IFUNC, needs to evaluate the function first! + printf_dump(LOG_DEBUG, " Indirect function, will call the resolver now at %p\n", from_ptrv(offs)); + offs = (ptr_t)RunFunction(offs, 0); + } + offs = (uintptr_t)getAlternate(from_ptrv(offs)); + + if(p) { + printf_dump(LOG_DEBUG, " Apply %s R_386_JMP_SLOT %p with sym=%s(ver %d: %s%s%s) (%p -> %p / %s)\n", (bind==STB_LOCAL)?"Local":((bind==STB_WEAK)?"Weak":"Global"), p, symname, version, symname, vername?"@":"", vername?vername:"",from_ptrv(*p), from_ptrv(offs), ElfName(FindElfAddress(my_context, offs))); + *p = offs; + } else { + printf_log(LOG_NONE, "PltResolver32: Warning, Symbol %s(ver %d: %s%s%s) found, but Jump Slot Offset is NULL \n", symname, version, symname, vername?"@":"", vername?vername:""); + } + } + + // jmp to function + R_EIP = offs; +} + + +typedef struct my_dl_phdr_info_32_s { + ptr_t dlpi_addr; //void* + ptr_t dlpi_name; //const char* + ptr_t dlpi_phdr; //Elf32_Phdr* + Elf32_Half dlpi_phnum; +} my_dl_phdr_info_32_t; + +static int dl_iterate_phdr_callback(x64emu_t *emu, void* F, my_dl_phdr_info_32_t *info, size_t size, void* data) +{ + int ret = RunFunctionWithEmu(emu, 0, (uintptr_t)F, 3, to_ptrv(info), to_ulong(size), to_ptrv(data)); + return ret; +} + +EXPORT int my32_dl_iterate_phdr(x64emu_t *emu, void* F, void *data) { + printf_log(LOG_DEBUG, "Call to partially implemented 32bits dl_iterate_phdr(%p, %p)\n", F, data); + box64context_t *context = GetEmuContext(emu); + const char* empty = ""; + int ret = 0; + for (int idx=0; idxelfsize; ++idx) { + if(context->elfs[idx]) { + static my_dl_phdr_info_32_t info; + info.dlpi_addr = to_ptrv(GetElfDelta(context->elfs[idx])); + info.dlpi_name = to_ptrv((void*)(idx?context->elfs[idx]->name:empty)); //1st elf is program, and this one doesn't get a name + info.dlpi_phdr = to_ptrv(context->elfs[idx]->PHEntries._32); + info.dlpi_phnum = context->elfs[idx]->numPHEntries; + if((ret = dl_iterate_phdr_callback(emu, F, &info, sizeof(info), data))) { + return ret; + } + } + } + // not iterationg on native libs + return ret; +} diff --git a/src/elfs/elfloader_private.h b/src/elfs/elfloader_private.h index d813488..62780f4 100644 --- a/src/elfs/elfloader_private.h +++ b/src/elfs/elfloader_private.h @@ -7,6 +7,7 @@ typedef struct cleanup_s cleanup_t; #include #include "elfloader.h" +#include "box32.h" typedef struct multiblock_s { void* p; @@ -22,27 +23,48 @@ typedef struct elfheader_s { char* name; char* path; // Resolved path to file char* soname; // soname of the elf - size_t numPHEntries; - Elf64_Phdr *PHEntries; - size_t numSHEntries; - Elf64_Shdr *SHEntries; + uint16_t numPHEntries; + union { + Elf64_Phdr* _64; + Elf32_Phdr* _32; + } PHEntries; + uint16_t numSHEntries; + union { + Elf64_Shdr* _64; + Elf32_Shdr* _32; + } SHEntries; size_t SHIdx; size_t numSST; char* SHStrTab; char* StrTab; - Elf64_Sym* SymTab; + union { + Elf64_Sym* _64; + Elf32_Sym* _32; + } SymTab; size_t numSymTab; char* DynStr; - Elf64_Sym* DynSym; + union { + Elf64_Sym* _64; + Elf32_Sym* _32; + } DynSym; size_t numDynSym; - Elf64_Dyn* Dynamic; + union { + Elf64_Dyn* _64; + Elf32_Dyn* _32; + } Dynamic; size_t numDynamic; char* DynStrTab; size_t szDynStrTab; - Elf64_Half* VerSym; - Elf64_Verneed* VerNeed; + uint16_t* VerSym; + union { + Elf64_Verneed* _64; + Elf32_Verneed* _32; + } VerNeed; int szVerNeed; - Elf64_Verdef* VerDef; + union { + Elf64_Verdef* _64; + Elf32_Verdef* _32; + } VerDef; int szVerDef; int e_type; uint32_t flags; @@ -106,6 +128,7 @@ typedef struct elfheader_s { int refcnt; // ref count for the elf int malloc_hook_2; // this elf hook malloc, hacking it int gnuunique; // set if contains some STB_GNU_UNIQUE binding, preventing dlclose to unload the lib + int dynamic_patched; char* memory; // char* and not void* to allow math on memory pointer multiblock_t* multiblocks; @@ -123,6 +146,7 @@ typedef struct elfheader_s { } elfheader_t; +#ifndef R_X86_64_NONE #define R_X86_64_NONE 0 /* No reloc */ #define R_X86_64_64 1 /* Direct 64 bit */ #define R_X86_64_PC32 2 /* PC relative 32 bit signed */ @@ -166,31 +190,38 @@ typedef struct elfheader_s { /* 40 Reserved was R_X86_64_PLT32_BND */ #define R_X86_64_GOTPCRELX 41 /* Load from 32 bit signed pc relative offset to GOT entry without REX prefix, relaxable. */ #define R_X86_64_REX_GOTPCRELX 42 /* Load from 32 bit signed pc relative offset to GOT entry with REX prefix, relaxable. */ +#endif #define R_X86_64_NUM 43 #ifndef STB_GNU_UNIQUE #define STB_GNU_UNIQUE 10 #endif +#ifndef ELF32_ST_VISIBILITY +#define ELF32_ST_VISIBILITY(o) ((o) & 0x03) +#endif + #ifndef ELF64_ST_VISIBILITY -#define ELF64_ST_VISIBILITY(o) ((o) & 0x03) +#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o) #endif -elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec); +elfheader_t* ParseElfHeader32(FILE* f, const char* name, int exec); +elfheader_t* ParseElfHeader64(FILE* f, const char* name, int exec); const char* BindSym(int bind); +const char* BindSymFriendly(int bind); -Elf64_Half GetSymbolVersionFlag(elfheader_t* h, int index); +uint16_t GetSymbolVersionFlag(elfheader_t* h, int index); uint32_t old_elf_hash(const char* name); -Elf64_Sym* old_elf_lookup(elfheader_t* h, const char* symname, int ver, const char* vername, int local, int veropt); -void old_elf_hash_dump(elfheader_t* h); uint32_t new_elf_hash(const char *name); -Elf64_Sym* new_elf_lookup(elfheader_t* h, const char* symname, int ver, const char* vername, int local, int veropt); -void new_elf_hash_dump(elfheader_t* h); -Elf64_Sym* ElfLookup(elfheader_t* h, const char* symname, int ver, const char* vername, int local, int veropt); -Elf64_Sym* ElfSymTabLookup(elfheader_t* h, const char* symname); -Elf64_Sym* ElfDynSymLookup(elfheader_t* h, const char* symname); +Elf32_Sym* ElfLookup32(elfheader_t* h, const char* symname, int ver, const char* vername, int local, int veropt); +Elf32_Sym* ElfSymTabLookup32(elfheader_t* h, const char* symname); +Elf32_Sym* ElfDynSymLookup32(elfheader_t* h, const char* symname); + +Elf64_Sym* ElfLookup64(elfheader_t* h, const char* symname, int ver, const char* vername, int local, int veropt); +Elf64_Sym* ElfSymTabLookup64(elfheader_t* h, const char* symname); +Elf64_Sym* ElfDynSymLookup64(elfheader_t* h, const char* symname); #endif //__ELFLOADER_PRIVATE_H_ diff --git a/src/elfs/elfparser.c b/src/elfs/elfparser.c index 49fea7a..7f88a8a 100644 --- a/src/elfs/elfparser.c +++ b/src/elfs/elfparser.c @@ -17,7 +17,7 @@ #define DT_GNU_HASH 0x6ffffef5 #endif -int LoadSH(FILE *f, Elf64_Shdr *s, void** SH, const char* name, uint32_t type) +static int LoadSH(FILE *f, Elf64_Shdr *s, void** SH, const char* name, uint32_t type) { if(type && (s->sh_type != type)) { printf_log(LOG_INFO, "Section Header \"%s\" (off=%ld, size=%ld) has incorect type (%d != %d)\n", name, s->sh_offset, s->sh_size, s->sh_type, type); @@ -36,7 +36,7 @@ int LoadSH(FILE *f, Elf64_Shdr *s, void** SH, const char* name, uint32_t type) return 0; } -int FindSection(Elf64_Shdr *s, int n, char* SHStrTab, const char* name) +static int FindSection(Elf64_Shdr *s, int n, char* SHStrTab, const char* name) { for (int i=0; inumSHEntries) { // now read all section headers printf_dump(LOG_DEBUG, "Read %zu Section header\n", h->numSHEntries); - h->SHEntries = (Elf64_Shdr*)box_calloc(h->numSHEntries, sizeof(Elf64_Shdr)); + h->SHEntries._64 = (Elf64_Shdr*)box_calloc(h->numSHEntries, sizeof(Elf64_Shdr)); fseeko64(f, header.e_shoff ,SEEK_SET); - if(fread(h->SHEntries, sizeof(Elf64_Shdr), h->numSHEntries, f)!=h->numSHEntries) { + if(fread(h->SHEntries._64, sizeof(Elf64_Shdr), h->numSHEntries, f)!=h->numSHEntries) { FreeElfHeader(&h); printf_log(LOG_INFO, "Cannot read all Section Header\n"); return NULL; @@ -156,14 +159,14 @@ elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec) if(h->numPHEntries == PN_XNUM) { printf_dump(LOG_DEBUG, "Read number of Program Header in 1st Section\n"); // read 1st section header and grab actual number from here - h->numPHEntries = h->SHEntries[0].sh_info; + h->numPHEntries = h->SHEntries._64[0].sh_info; } } printf_dump(LOG_DEBUG, "Read %zu Program header\n", h->numPHEntries); - h->PHEntries = (Elf64_Phdr*)box_calloc(h->numPHEntries, sizeof(Elf64_Phdr)); + h->PHEntries._64 = (Elf64_Phdr*)box_calloc(h->numPHEntries, sizeof(Elf64_Phdr)); fseeko64(f, header.e_phoff ,SEEK_SET); - if(fread(h->PHEntries, sizeof(Elf64_Phdr), h->numPHEntries, f)!=h->numPHEntries) { + if(fread(h->PHEntries._64, sizeof(Elf64_Phdr), h->numPHEntries, f)!=h->numPHEntries) { FreeElfHeader(&h); printf_log(LOG_INFO, "Cannot read all Program Header\n"); return NULL; @@ -172,7 +175,7 @@ elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec) if(header.e_shentsize && header.e_shnum) { if(h->SHIdx == SHN_XINDEX) { printf_dump(LOG_DEBUG, "Read number of String Table in 1st Section\n"); - h->SHIdx = h->SHEntries[0].sh_link; + h->SHIdx = h->SHEntries._64[0].sh_link; } if(h->SHIdx > h->numSHEntries) { printf_log(LOG_INFO, "Incoherent Section String Table Index : %zu / %zu\n", h->SHIdx, h->numSHEntries); @@ -181,23 +184,23 @@ elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec) } // load Section table printf_dump(LOG_DEBUG, "Loading Sections Table String (idx = %zu)\n", h->SHIdx); - if(LoadSH(f, h->SHEntries+h->SHIdx, (void*)&h->SHStrTab, ".shstrtab", SHT_STRTAB)) { + if(LoadSH(f, h->SHEntries._64+h->SHIdx, (void*)&h->SHStrTab, ".shstrtab", SHT_STRTAB)) { FreeElfHeader(&h); return NULL; } - if(box64_dump) DumpMainHeader(&header, h); + if (BOX64ENV(dump)) DumpMainHeader64(&header, h); - LoadNamedSection(f, h->SHEntries, h->numSHEntries, h->SHStrTab, ".strtab", "SymTab Strings", SHT_STRTAB, (void**)&h->StrTab, NULL); - LoadNamedSection(f, h->SHEntries, h->numSHEntries, h->SHStrTab, ".symtab", "SymTab", SHT_SYMTAB, (void**)&h->SymTab, &h->numSymTab); - if(box64_dump && h->SymTab) DumpSymTab(h); + LoadNamedSection(f, h->SHEntries._64, h->numSHEntries, h->SHStrTab, ".strtab", "SymTab Strings", SHT_STRTAB, (void**)&h->StrTab, NULL); + LoadNamedSection(f, h->SHEntries._64, h->numSHEntries, h->SHStrTab, ".symtab", "SymTab", SHT_SYMTAB, (void**)&h->SymTab._64, &h->numSymTab); + if (BOX64ENV(dump) && h->SymTab._64) DumpSymTab64(h); - LoadNamedSection(f, h->SHEntries, h->numSHEntries, h->SHStrTab, ".dynamic", "Dynamic", SHT_DYNAMIC, (void**)&h->Dynamic, &h->numDynamic); - if(box64_dump && h->Dynamic) DumpDynamicSections(h); + LoadNamedSection(f, h->SHEntries._64, h->numSHEntries, h->SHStrTab, ".dynamic", "Dynamic", SHT_DYNAMIC, (void**)&h->Dynamic._64, &h->numDynamic); + if (BOX64ENV(dump) && h->Dynamic._64) DumpDynamicSections64(h); // grab DT_REL & DT_RELA stuffs // also grab the DT_STRTAB string table { for (size_t i=0; inumDynamic; ++i) { - Elf64_Dyn d = h->Dynamic[i]; + Elf64_Dyn d = h->Dynamic._64[i]; Elf64_Word val = d.d_un.d_val; Elf64_Addr ptr = d.d_un.d_ptr; switch (d.d_tag) { @@ -281,7 +284,7 @@ elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec) printf_dump(LOG_DEBUG, "The DT_VERNEEDNUM is %d\n", h->szVerNeed); break; case DT_VERNEED: - h->VerNeed = (Elf64_Verneed*)ptr; + h->VerNeed._64 = (Elf64_Verneed*)ptr; printf_dump(LOG_DEBUG, "The DT_VERNEED is at address %p\n", h->VerNeed); break; case DT_VERDEFNUM: @@ -289,7 +292,7 @@ elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec) printf_dump(LOG_DEBUG, "The DT_VERDEFNUM is %d\n", h->szVerDef); break; case DT_VERDEF: - h->VerDef = (Elf64_Verdef*)ptr; + h->VerDef._64 = (Elf64_Verdef*)ptr; printf_dump(LOG_DEBUG, "The DT_VERDEF is at address %p\n", h->VerDef); break; case DT_FLAGS: @@ -340,57 +343,57 @@ elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec) printf_dump(LOG_DEBUG, "PLT Table @%p (type=%ld 0x%zx/0x%0x)\n", (void*)h->jmprel, h->pltrel, h->pltsz, h->pltent); } if(h->DynStrTab && h->szDynStrTab) { - //DumpDynamicNeeded(h); cannot dump now, it's not loaded yet + //DumpDynamicNeeded64(h); cannot dump now, it's not loaded yet } } // look for PLT Offset - int ii = FindSection(h->SHEntries, h->numSHEntries, h->SHStrTab, ".got.plt"); + int ii = FindSection(h->SHEntries._64, h->numSHEntries, h->SHStrTab, ".got.plt"); if(ii) { - h->gotplt = h->SHEntries[ii].sh_addr; - h->gotplt_end = h->gotplt + h->SHEntries[ii].sh_size; + h->gotplt = h->SHEntries._64[ii].sh_addr; + h->gotplt_end = h->gotplt + h->SHEntries._64[ii].sh_size; printf_dump(LOG_DEBUG, "The GOT.PLT Table is at address %p\n", (void*)h->gotplt); } - ii = FindSection(h->SHEntries, h->numSHEntries, h->SHStrTab, ".got"); + ii = FindSection(h->SHEntries._64, h->numSHEntries, h->SHStrTab, ".got"); if(ii) { - h->got = h->SHEntries[ii].sh_addr; - h->got_end = h->got + h->SHEntries[ii].sh_size; + h->got = h->SHEntries._64[ii].sh_addr; + h->got_end = h->got + h->SHEntries._64[ii].sh_size; printf_dump(LOG_DEBUG, "The GOT Table is at address %p..%p\n", (void*)h->got, (void*)h->got_end); } - ii = FindSection(h->SHEntries, h->numSHEntries, h->SHStrTab, ".plt"); + ii = FindSection(h->SHEntries._64, h->numSHEntries, h->SHStrTab, ".plt"); if(ii) { - h->plt = h->SHEntries[ii].sh_addr; - h->plt_end = h->plt + h->SHEntries[ii].sh_size; + h->plt = h->SHEntries._64[ii].sh_addr; + h->plt_end = h->plt + h->SHEntries._64[ii].sh_size; printf_dump(LOG_DEBUG, "The PLT Table is at address %p..%p\n", (void*)h->plt, (void*)h->plt_end); } // grab version of symbols - ii = FindSection(h->SHEntries, h->numSHEntries, h->SHStrTab, ".gnu.version"); + ii = FindSection(h->SHEntries._64, h->numSHEntries, h->SHStrTab, ".gnu.version"); if(ii) { - h->VerSym = (Elf64_Half*)(h->SHEntries[ii].sh_addr); + h->VerSym = (Elf64_Half*)(h->SHEntries._64[ii].sh_addr); printf_dump(LOG_DEBUG, "The .gnu.version is at address %p\n", h->VerSym); } // grab .text for main code - ii = FindSection(h->SHEntries, h->numSHEntries, h->SHStrTab, ".text"); + ii = FindSection(h->SHEntries._64, h->numSHEntries, h->SHStrTab, ".text"); if(ii) { - h->text = (uintptr_t)(h->SHEntries[ii].sh_addr); - h->textsz = h->SHEntries[ii].sh_size; + h->text = (uintptr_t)(h->SHEntries._64[ii].sh_addr); + h->textsz = h->SHEntries._64[ii].sh_size; printf_dump(LOG_DEBUG, "The .text is at address %p, and is %zu big\n", (void*)h->text, h->textsz); } - ii = FindSection(h->SHEntries, h->numSHEntries, h->SHStrTab, ".eh_frame"); + ii = FindSection(h->SHEntries._64, h->numSHEntries, h->SHStrTab, ".eh_frame"); if(ii) { - h->ehframe = (uintptr_t)(h->SHEntries[ii].sh_addr); - h->ehframe_end = h->ehframe + h->SHEntries[ii].sh_size; + h->ehframe = (uintptr_t)(h->SHEntries._64[ii].sh_addr); + h->ehframe_end = h->ehframe + h->SHEntries._64[ii].sh_size; printf_dump(LOG_DEBUG, "The .eh_frame section is at address %p..%p\n", (void*)h->ehframe, (void*)h->ehframe_end); } - ii = FindSection(h->SHEntries, h->numSHEntries, h->SHStrTab, ".eh_frame_hdr"); + ii = FindSection(h->SHEntries._64, h->numSHEntries, h->SHStrTab, ".eh_frame_hdr"); if(ii) { - h->ehframehdr = (uintptr_t)(h->SHEntries[ii].sh_addr); + h->ehframehdr = (uintptr_t)(h->SHEntries._64[ii].sh_addr); printf_dump(LOG_DEBUG, "The .eh_frame_hdr section is at address %p\n", (void*)h->ehframehdr); } - LoadNamedSection(f, h->SHEntries, h->numSHEntries, h->SHStrTab, ".dynstr", "DynSym Strings", SHT_STRTAB, (void**)&h->DynStr, NULL); - LoadNamedSection(f, h->SHEntries, h->numSHEntries, h->SHStrTab, ".dynsym", "DynSym", SHT_DYNSYM, (void**)&h->DynSym, &h->numDynSym); + LoadNamedSection(f, h->SHEntries._64, h->numSHEntries, h->SHStrTab, ".dynstr", "DynSym Strings", SHT_STRTAB, (void**)&h->DynStr, NULL); + LoadNamedSection(f, h->SHEntries._64, h->numSHEntries, h->SHStrTab, ".dynsym", "DynSym", SHT_DYNSYM, (void**)&h->DynSym, &h->numDynSym); } - + return h; } @@ -406,3 +409,16 @@ const char* BindSym(int bind) sprintf(tmp, "??? 0x%x", bind); return tmp; } + +const char* BindSymFriendly(int bind) +{ + switch(bind) { + case STB_GLOBAL: return "Global"; + case STB_WEAK: return "Weak"; + case STB_LOCAL: return "Local"; + case STB_GNU_UNIQUE: return "Unique"; + } + static char tmp[50]; + sprintf(tmp, "??? 0x%x", bind); + return tmp; +} diff --git a/src/elfs/elfparser32.c b/src/elfs/elfparser32.c new file mode 100755 index 0000000..3a3f66c --- /dev/null +++ b/src/elfs/elfparser32.c @@ -0,0 +1,468 @@ +#define _GNU_SOURCE +#include +#include +#include +#include + +#include "box64version.h" +#include "elfloader.h" +#include "debug.h" +#include "elfload_dump.h" +#include "elfloader_private.h" +#include "box32.h" + +#ifndef PN_XNUM +#define PN_XNUM (0xffff) +#endif + +static int LoadSH(FILE *f, Elf32_Shdr *s, void** SH, const char* name, uint32_t type) +{ + if(type && (s->sh_type != type)) { + printf_log(LOG_INFO, "Section Header \"%s\" (off=%d, size=%d) has incorect type (%d != %d)\n", name, s->sh_offset, s->sh_size, s->sh_type, type); + return -1; + } + if (type==SHT_SYMTAB && s->sh_size%sizeof(Elf32_Sym)) { + printf_log(LOG_INFO, "Section Header \"%s\" (off=%d, size=%d) has size (not multiple of %ld)\n", name, s->sh_offset, s->sh_size, sizeof(Elf32_Sym)); + } + *SH = actual_calloc(1, s->sh_size); + fseeko64(f, s->sh_offset ,SEEK_SET); + if(fread(*SH, s->sh_size, 1, f)!=1) { + printf_log(LOG_INFO, "Cannot read Section Header \"%s\" (off=%d, size=%d)\n", name, s->sh_offset, s->sh_size); + return -1; + } + + return 0; +} + +static int FindSection(Elf32_Shdr *s, int n, char* SHStrTab, const char* name) +{ + for (int i=0; iname = box_strdup(name); + h->entrypoint = header.e_entry; + h->numPHEntries = header.e_phnum; + h->numSHEntries = header.e_shnum; + h->SHIdx = header.e_shstrndx; + h->e_type = header.e_type; + if(header.e_shentsize && header.e_shnum) { + // special cases for nums + if(h->numSHEntries == 0) { + printf_log(LOG_DEBUG, "Read number of Sections in 1st Section\n"); + // read 1st section header and grab actual number from here + fseeko64(f, header.e_shoff, SEEK_SET); + Elf32_Shdr section; + if(fread(§ion, sizeof(Elf32_Shdr), 1, f)!=1) { + actual_free(h); + printf_log(LOG_INFO, "Cannot read Initial Section Header\n"); + return NULL; + } + h->numSHEntries = section.sh_size; + } + // now read all section headers + printf_log(LOG_DEBUG, "Read %d Section header\n", h->numSHEntries); + h->SHEntries._32 = (Elf32_Shdr*)actual_calloc(h->numSHEntries, sizeof(Elf32_Shdr)); + fseeko64(f, header.e_shoff ,SEEK_SET); + if(fread(h->SHEntries._32, sizeof(Elf32_Shdr), h->numSHEntries, f)!=h->numSHEntries) { + FreeElfHeader(&h); + printf_log(LOG_INFO, "Cannot read all Section Header\n"); + return NULL; + } + + if(h->numPHEntries == PN_XNUM) { + printf_log(LOG_DEBUG, "Read number of Program Header in 1st Section\n"); + // read 1st section header and grab actual number from here + h->numPHEntries = h->SHEntries._32[0].sh_info; + } + } + + printf_log(LOG_DEBUG, "Read %d Program header\n", h->numPHEntries); + h->PHEntries._32 = (Elf32_Phdr*)actual_calloc(h->numPHEntries, sizeof(Elf32_Phdr)); + fseeko64(f, header.e_phoff ,SEEK_SET); + if(fread(h->PHEntries._32, sizeof(Elf32_Phdr), h->numPHEntries, f)!=h->numPHEntries) { + FreeElfHeader(&h); + printf_log(LOG_INFO, "Cannot read all Program Header\n"); + return NULL; + } + + if(header.e_shentsize && header.e_shnum) { + if(h->SHIdx == SHN_XINDEX) { + printf_log(LOG_DEBUG, "Read number of String Table in 1st Section\n"); + h->SHIdx = h->SHEntries._32[0].sh_link; + } + if(h->SHIdx > h->numSHEntries) { + printf_log(LOG_INFO, "Incoherent Section String Table Index : %d / %d\n", h->SHIdx, h->numSHEntries); + FreeElfHeader(&h); + return NULL; + } + // load Section table + printf_log(LOG_DEBUG, "Loading Sections Table String (idx = %d)\n", h->SHIdx); + if(LoadSH(f, h->SHEntries._32+h->SHIdx, (void*)&h->SHStrTab, ".shstrtab", SHT_STRTAB)) { + FreeElfHeader(&h); + return NULL; + } + if (BOX64ENV(dump)) DumpMainHeader32(&header, h); + + LoadNamedSection(f, h->SHEntries._32, h->numSHEntries, h->SHStrTab, ".strtab", "SymTab Strings", SHT_STRTAB, (void**)&h->StrTab, NULL); + LoadNamedSection(f, h->SHEntries._32, h->numSHEntries, h->SHStrTab, ".symtab", "SymTab", SHT_SYMTAB, (void**)&h->SymTab._32, &h->numSymTab); + if (BOX64ENV(dump) && h->SymTab._32) DumpSymTab32(h); + + LoadNamedSection(f, h->SHEntries._32, h->numSHEntries, h->SHStrTab, ".dynamic", "Dynamic", SHT_DYNAMIC, (void**)&h->Dynamic._32, &h->numDynamic); + if (BOX64ENV(dump) && h->Dynamic._32) DumpDynamicSections32(h); + // grab DT_REL & DT_RELA stuffs + // also grab the DT_STRTAB string table + { + for (size_t i=0; inumDynamic; ++i) { + Elf32_Dyn d = h->Dynamic._32[i]; + Elf32_Word val = d.d_un.d_val; + Elf32_Addr ptr = d.d_un.d_ptr; + switch (d.d_tag) { + case DT_REL: + h->rel = ptr; + break; + case DT_RELSZ: + h->relsz = val; + break; + case DT_RELENT: + h->relent = val; + break; + case DT_RELA: + h->rela = ptr; + break; + case DT_RELASZ: + h->relasz = val; + break; + case DT_RELAENT: + h->relaent = val; + break; + case DT_RELR: + h->relr = ptr; + break; + case DT_RELRSZ: + h->relrsz = val; + break; + case DT_RELRENT: + h->relrent = val; + break; + case DT_PLTGOT: + h->pltgot = ptr; + break; + case DT_PLTREL: + h->pltrel = val; + break; + case DT_PLTRELSZ: + h->pltsz = val; + break; + case DT_JMPREL: + h->jmprel = ptr; + break; + case DT_STRTAB: + h->DynStrTab = (char *)from_ptr(ptr); + break; + case DT_STRSZ: + h->szDynStrTab = val; + break; + case DT_INIT: // Entry point + h->initentry = ptr; + printf_log(LOG_DEBUG, "The DT_INIT is at address %p\n", from_ptrv(h->initentry)); + break; + case DT_INIT_ARRAY: + h->initarray = ptr; + printf_log(LOG_DEBUG, "The DT_INIT_ARRAY is at address %p\n", from_ptrv(h->initarray)); + break; + case DT_INIT_ARRAYSZ: + h->initarray_sz = val / sizeof(Elf32_Addr); + printf_log(LOG_DEBUG, "The DT_INIT_ARRAYSZ is %d\n", h->initarray_sz); + break; + case DT_PREINIT_ARRAYSZ: + #ifndef ANDROID + if(val) + printf_log(LOG_NONE, "Warning, PreInit Array (size=%d) present and ignored!\n", val); + #endif + break; + case DT_FINI: // Exit hook + h->finientry = ptr; + printf_log(LOG_DEBUG, "The DT_FINI is at address %p\n", from_ptrv(h->finientry)); + break; + case DT_FINI_ARRAY: + h->finiarray = ptr; + printf_log(LOG_DEBUG, "The DT_FINI_ARRAY is at address %p\n", from_ptrv(h->finiarray)); + break; + case DT_FINI_ARRAYSZ: + h->finiarray_sz = val / sizeof(Elf32_Addr); + printf_log(LOG_DEBUG, "The DT_FINI_ARRAYSZ is %d\n", h->finiarray_sz); + break; + case DT_VERNEEDNUM: + h->szVerNeed = val; + printf_log(LOG_DEBUG, "The DT_VERNEEDNUM is %d\n", h->szVerNeed); + break; + case DT_VERNEED: + h->VerNeed._32 = (Elf32_Verneed*)from_ptr(ptr); + printf_log(LOG_DEBUG, "The DT_VERNEED is at address %p\n", h->VerNeed); + break; + case DT_VERDEFNUM: + h->szVerDef = val; + printf_log(LOG_DEBUG, "The DT_VERDEFNUM is %d\n", h->szVerDef); + break; + case DT_VERDEF: + h->VerDef._32 = (Elf32_Verdef*)from_ptr(ptr); + printf_log(LOG_DEBUG, "The DT_VERDEF is at address %p\n", h->VerDef); + break; + case DT_HASH: + h->hash = ptr; + printf_dump(LOG_DEBUG, "The DT_HASH is at address %p\n", (void*)h->hash); + break; + case DT_GNU_HASH: + h->gnu_hash = ptr; + printf_dump(LOG_DEBUG, "The DT_GNU_HASH is at address %p\n", (void*)h->gnu_hash); + break; + } + } + if(h->rel) { + if(h->relent != sizeof(Elf32_Rel)) { + printf_log(LOG_NONE, "Rel Table Entry size invalid (0x%x should be 0x%lx)\n", h->relent, sizeof(Elf32_Rel)); + FreeElfHeader(&h); + return NULL; + } + printf_log(LOG_DEBUG, "Rel Table @%p (0x%x/0x%x)\n", from_ptrv(h->rel), h->relsz, h->relent); + } + if(h->rela) { + if(h->relaent != sizeof(Elf32_Rela)) { + printf_log(LOG_NONE, "RelA Table Entry size invalid (0x%x should be 0x%lx)\n", h->relaent, sizeof(Elf32_Rela)); + FreeElfHeader(&h); + return NULL; + } + printf_log(LOG_DEBUG, "RelA Table @%p (0x%x/0x%x)\n", from_ptrv(h->rela), h->relasz, h->relaent); + } + if(h->jmprel) { + if(h->pltrel == DT_REL) { + h->pltent = sizeof(Elf32_Rel); + } else if(h->pltrel == DT_RELA) { + h->pltent = sizeof(Elf32_Rela); + } else { + printf_log(LOG_NONE, "PLT Table type is unknown (size = 0x%x, type=%d)\n", h->pltsz, h->pltrel); + FreeElfHeader(&h); + return NULL; + } + if((h->pltsz / h->pltent)*h->pltent != h->pltsz) { + printf_log(LOG_NONE, "PLT Table Entry size invalid (0x%x, ent=0x%x, type=%d)\n", h->pltsz, h->pltent, h->pltrel); + FreeElfHeader(&h); + return NULL; + } + printf_log(LOG_DEBUG, "PLT Table @%p (type=%d 0x%x/0x%0x)\n", from_ptrv(h->jmprel), h->pltrel, h->pltsz, h->pltent); + } + if(h->DynStrTab && h->szDynStrTab) { + //DumpDynamicNeeded32(h); cannot dump now, it's not loaded yet + } + } + // look for PLT Offset + int ii = FindSection(h->SHEntries._32, h->numSHEntries, h->SHStrTab, ".got.plt"); + if(ii) { + h->gotplt = h->SHEntries._32[ii].sh_addr; + h->gotplt_end = h->gotplt + h->SHEntries._32[ii].sh_size; + printf_log(LOG_DEBUG, "The GOT.PLT Table is at address %p\n", from_ptrv(h->gotplt)); + } + ii = FindSection(h->SHEntries._32, h->numSHEntries, h->SHStrTab, ".got"); + if(ii) { + h->got = h->SHEntries._32[ii].sh_addr; + h->got_end = h->got + h->SHEntries._32[ii].sh_size; + printf_log(LOG_DEBUG, "The GOT Table is at address %p..%p\n", from_ptrv(h->got), from_ptrv(h->got_end)); + } + ii = FindSection(h->SHEntries._32, h->numSHEntries, h->SHStrTab, ".plt"); + if(ii) { + h->plt = h->SHEntries._32[ii].sh_addr; + h->plt_end = h->plt + h->SHEntries._32[ii].sh_size; + printf_log(LOG_DEBUG, "The PLT Table is at address %p..%p\n", from_ptrv(h->plt), from_ptrv(h->plt_end)); + } + // grab version of symbols + ii = FindSection(h->SHEntries._32, h->numSHEntries, h->SHStrTab, ".gnu.version"); + if(ii) { + h->VerSym = (Elf32_Half*)from_ptrv(h->SHEntries._32[ii].sh_addr); + printf_log(LOG_DEBUG, "The .gnu.version is at address %p\n", h->VerSym); + } + // grab .text for main code + ii = FindSection(h->SHEntries._32, h->numSHEntries, h->SHStrTab, ".text"); + if(ii) { + h->text = (uintptr_t)(h->SHEntries._32[ii].sh_addr); + h->textsz = h->SHEntries._32[ii].sh_size; + printf_log(LOG_DEBUG, "The .text is at address %p, and is %d big\n", from_ptrv(h->text), h->textsz); + } + + LoadNamedSection(f, h->SHEntries._32, h->numSHEntries, h->SHStrTab, ".dynstr", "DynSym Strings", SHT_STRTAB, (void**)&h->DynStr, NULL); + LoadNamedSection(f, h->SHEntries._32, h->numSHEntries, h->SHStrTab, ".dynsym", "DynSym", SHT_DYNSYM, (void**)&h->DynSym, &h->numDynSym); + } + + return h; +} + +const char* GetParentSymbolVersion32(elfheader_t* h, int index) +{ + if(!h->VerDef._32 || (index<1)) + return NULL; + Elf32_Verdef *def = (Elf32_Verdef*)((uintptr_t)h->VerDef._32 + h->delta); + while(def) { + if(def->vd_ndx==index) { + if(def->vd_cnt<1) + return NULL; + /*if(def->vd_flags&VER_FLG_BASE) + return NULL;*/ + Elf32_Verdaux *aux = (Elf32_Verdaux*)((uintptr_t)def + def->vd_aux); + return h->DynStr+aux->vda_name; // return Parent, so 1st aux + } + def = def->vd_next?((Elf32_Verdef*)((uintptr_t)def + def->vd_next)):NULL; + } + return NULL; +} + +const char* GetSymbolVersion32(elfheader_t* h, int version) +{ + version&=0x7fff; // remove bit15 that switch between hidden/public + if(!h->VerNeed._32 || (version<2)) + return NULL; + /*if(version==1) + return "*";*/ + Elf32_Verneed *ver = (Elf32_Verneed*)((uintptr_t)h->VerNeed._32 + h->delta); + while(ver) { + Elf32_Vernaux *aux = (Elf32_Vernaux*)((uintptr_t)ver + ver->vn_aux); + for(int j=0; jvn_cnt; ++j) { + if(aux->vna_other==version) + return h->DynStr+aux->vna_name; + aux = (Elf32_Vernaux*)((uintptr_t)aux + aux->vna_next); + } + ver = ver->vn_next?((Elf32_Verneed*)((uintptr_t)ver + ver->vn_next)):NULL; + } + return GetParentSymbolVersion32(h, version); // if symbol is "internal", use Def table instead +} + +int GetVersionIndice32(elfheader_t* h, const char* vername) +{ + if(!vername) + return 0; + if(h->VerDef._32) { + Elf32_Verdef *def = (Elf32_Verdef*)((uintptr_t)h->VerDef._32 + h->delta); + while(def) { + Elf32_Verdaux *aux = (Elf32_Verdaux*)((uintptr_t)def + def->vd_aux); + if(!strcmp(h->DynStr+aux->vda_name, vername)) + return def->vd_ndx; + def = def->vd_next?((Elf32_Verdef*)((uintptr_t)def + def->vd_next)):NULL; + } + } + return 0; +} + +int GetNeededVersionCnt32(elfheader_t* h, const char* libname) +{ + if(!libname) + return 0; + if(h->VerNeed._32) { + Elf32_Verneed *ver = (Elf32_Verneed*)((uintptr_t)h->VerNeed._32 + h->delta); + while(ver) { + char *filename = h->DynStr + ver->vn_file; + Elf32_Vernaux *aux = (Elf32_Vernaux*)((uintptr_t)ver + ver->vn_aux); + if(!strcmp(filename, libname)) + return ver->vn_cnt; + ver = ver->vn_next?((Elf32_Verneed*)((uintptr_t)ver + ver->vn_next)):NULL; + } + } + return 0; +} + +const char* GetNeededVersionString32(elfheader_t* h, const char* libname, int idx) +{ + if(!libname) + return 0; + if(h->VerNeed._32) { + Elf32_Verneed *ver = (Elf32_Verneed*)((uintptr_t)h->VerNeed._32 + h->delta); + while(ver) { + char *filename = h->DynStr + ver->vn_file; + Elf32_Vernaux *aux = (Elf32_Vernaux*)((uintptr_t)ver + ver->vn_aux); + if(!strcmp(filename, libname)) { + for(int j=0; jvn_cnt; ++j) { + if(j==idx) + return h->DynStr+aux->vna_name; + aux = (Elf32_Vernaux*)((uintptr_t)aux + aux->vna_next); + } + return NULL; // idx out of bound, return NULL... + } + ver = ver->vn_next?((Elf32_Verneed*)((uintptr_t)ver + ver->vn_next)):NULL; + } + } + return NULL; +} diff --git a/src/emu/entrypoint.c b/src/emu/entrypoint.c new file mode 100644 index 0000000..927ac0d --- /dev/null +++ b/src/emu/entrypoint.c @@ -0,0 +1,142 @@ +#include "debug.h" +#include "x64run_private.h" +#include "box64cpu.h" +#include "box64cpu_util.h" +#include "elfloader.h" +#include "box32.h" + +#ifdef ANDROID +void EXPORT my___libc_init(x64emu_t* emu, void* raw_args , void (*onexit)(void) , int (*main)(int, char**, char**), void const * const structors ) +{ + //TODO: register fini + // let's cheat and set all args... + SetRDX(emu, (uintptr_t)my_context->envv); + SetRSI(emu, (uintptr_t)my_context->argv); + SetRDI(emu, (uintptr_t)my_context->argc); + + printf_log(LOG_DEBUG, "Transfert to main(%d, %p, %p)=>%p from __libc_init\n", my_context->argc, my_context->argv, my_context->envv, main); + // should call structors->preinit_array and structors->init_array! + // call main and finish + Push64(emu, GetRBP(emu)); // set frame pointer + SetRBP(emu, GetRSP(emu)); // save RSP + SetRSP(emu, GetRSP(emu)&~0xFLL); // Align RSP + PushExit(emu); + R_RIP=(uintptr_t)main; + + DynaRun(emu); + + SetRSP(emu, GetRBP(emu)); // restore RSP + SetRBP(emu, Pop64(emu)); // restore RBP + emu->quit = 1; // finished! +} +#else +EXPORT int32_t my___libc_start_main(x64emu_t* emu, int (*main) (int, char * *, char * *), int argc, char * * ubp_av, void (*init) (void), void (*fini) (void), void (*rtld_fini) (void), void (* stack_end)) +{ + (void)argc; (void)ubp_av; (void)fini; (void)rtld_fini; (void)stack_end; + + if(init) { + uintptr_t old_rsp = GetRSP(emu); + uintptr_t old_rbp = GetRBP(emu); // should not be needed, but seems to be without dynarec + Push64(emu, GetRBP(emu)); // set frame pointer + SetRBP(emu, GetRSP(emu)); // save RSP + SetRSP(emu, GetRSP(emu)&~0xFLL); // Align RSP + PushExit(emu); + SetRDX(emu, (uint64_t)my_context->envv); + SetRSI(emu, (uint64_t)my_context->argv); + SetRDI(emu, (uint64_t)my_context->argc); + R_RIP=(uint64_t)*init; + printf_dump(LOG_DEBUG, "Calling init(%p) from __libc_start_main\n", *init); + DynaRun(emu); + if(emu->error) // any error, don't bother with more + return 0; + SetRSP(emu, GetRBP(emu)); // restore RSP + SetRBP(emu, Pop64(emu)); // restore RBP + SetRSP(emu, old_rsp); + SetRBP(emu, old_rbp); + emu->quit = 0; + } else { + if(my_context->elfs[0]) { + printf_dump(LOG_DEBUG, "Calling init from main elf\n"); + RunElfInit(my_context->elfs[0], emu); + } + } + if(my_context->elfs[0]) { + MarkElfInitDone(my_context->elfs[0]); + } + printf_log(LOG_DEBUG, "Transfert to main(%d, %p, %p)=>%p from __libc_start_main\n", my_context->argc, my_context->argv, my_context->envv, main); + // call main and finish + Push64(emu, GetRBP(emu)); // set frame pointer + SetRBP(emu, GetRSP(emu)); // save RSP + SetRSP(emu, GetRSP(emu)&~0xFLL); // Align RSP + PushExit(emu); + SetRDX(emu, (uint64_t)my_context->envv); + SetRSI(emu, (uint64_t)my_context->argv); + SetRDI(emu, (uint64_t)my_context->argc); + R_RIP=(uint64_t)main; + + DynaRun(emu); + + if(!emu->quit) { + SetRSP(emu, GetRBP(emu)); // restore RSP + SetRBP(emu, Pop64(emu)); // restore RBP + emu->quit = 1; // finished! + } + return (int)GetEAX(emu); +} +#ifdef BOX32 +#ifdef ANDROID +void EXPORT my32___libc_init(x64emu_t* emu, void* raw_args , void (*onexit)(void) , int (*main)(int, char**, char**), void const * const structors ) +{ + //TODO: register fini + // let's cheat and set all args... + Push_32(emu, (uint32_t)my_context->envv32); + Push_32(emu, (uint32_t)my_context->argv32); + Push_32(emu, (uint32_t)my_context->argc); + + printf_log(LOG_DEBUG, "Transfert to main(%d, %p, %p)=>%p from __libc_init\n", my_context->argc, my_context->argv, my_context->envv, main); + // should call structors->preinit_array and structors->init_array! + // call main and finish + PushExit_32(emu); + R_EIP=to_ptrv(main); + + DynaRun(emu); + + emu->quit = 1; // finished! +} +#else +int32_t EXPORT my32___libc_start_main(x64emu_t* emu, int *(main) (int, char * *, char * *), int argc, char * * ubp_av, void (*init) (void), void (*fini) (void), void (*rtld_fini) (void), void (* stack_end)) +{ + // let's cheat and set all args... + Push_32(emu, my_context->envv32); + Push_32(emu, my_context->argv32); + Push_32(emu, my_context->argc); + if(init) { + PushExit_32(emu); + R_EIP=to_ptrv(*init); + printf_log(LOG_DEBUG, "Calling init(%p) from __libc_start_main\n", *init); + DynaRun(emu); + if(emu->error) // any error, don't bother with more + return 0; + emu->quit = 0; + } else { + if(my_context->elfs[0]) { + printf_dump(LOG_DEBUG, "Calling init from main elf\n"); + RunElfInit(my_context->elfs[0], emu); + } + } + if(my_context->elfs[0]) { + MarkElfInitDone(my_context->elfs[0]); + } + printf_log(LOG_DEBUG, "Transfert to main(%d, %p, %p)=>%p from __libc_start_main\n", my_context->argc, my_context->argv, my_context->envv, main); + // call main and finish + PushExit_32(emu); + R_EIP=to_ptrv(main); + + DynaRun(emu); + + emu->quit = 1; // finished! + return 0; +} +#endif +#endif +#endif diff --git a/src/emu/modrm.h b/src/emu/modrm.h index 2f2cd1f..e18212a 100644 --- a/src/emu/modrm.h +++ b/src/emu/modrm.h @@ -10,10 +10,12 @@ #define F64 *(uint64_t*)(addr+=8, addr-8) #define F64S *(int64_t*)(addr+=8, addr-8) #define PK(a) *(uint8_t*)(addr+a) +#define PARITY(x) (((emu->x64emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0) + #ifdef DYNAREC -#define STEP if(step) return 0; -#define STEP2 if(step) {R_RIP = addr; return 0;} -#define STEP3 if(*step) (*step)++; +#define STEP if(step && !ACCESS_FLAG(F_TF)) return 0; else if((emu->old_ip>>12)!=(addr>>12)) CheckExec(emu, addr); +#define STEP2 if(step && !ACCESS_FLAG(F_TF)) {R_RIP = addr; return 0;} else if((emu->old_ip>>12)!=(addr>>12)) CheckExec(emu, addr); +#define STEP3 if(*step) (*step)++; else if((emu->old_ip>>12)!=(addr>>12)) CheckExec(emu, addr); #else #define STEP #define STEP2 @@ -26,29 +28,18 @@ #define GETE8(D) oped=TestEd8(test, &addr, rex, nextop, D) #define GETET(D) oped=TestEdt(test, &addr, rex, nextop, D) #define GETE8xw(D) oped=TestEd8xw(test, rex.w, &addr, rex, nextop, D) -#define GETED32(D) oped=TestEd32O(test, &addr, rex, nextop, D, 0) -#define GETED_OFFS(D, O) oped=TestEdO(test, &addr, rex, nextop, D, O) -#define GETED_OFFS_16(O) oped=TestEd16off(test, &addr, rex, nextop, O) #define GETGD opgd=GetGd(test->emu, &addr, rex, nextop) #define GETEB(D) oped=TestEb(test, &addr, rex, nextop, D) -#define GETEB32(D) oped=TestEb32O(test, &addr, rex, nextop, D, 0) -#define GETEB_OFFS(D, O) oped=TestEbO(test, &addr, rex, nextop, D, O) #define GETGB opgd=GetGb(test->emu, &addr, rex, nextop) #define GETEW(D) oped=TestEw(test, &addr, rex, nextop, D) -#define GETEW32(D) oped=TestEw32O(test, &addr, rex, nextop, D, 0) -#define GETEW_OFFS(D, O) oped=TestEdO(test, &addr, rex, nextop, D, O) -#define GETEW_OFFS_16(O) oped=TestEw16off(test, &addr, rex, nextop, O) #define GETGW opgd=GetGw(test->emu, &addr, rex, nextop) #define GETEX(D) opex=TestEx(test, &addr, rex, nextop, D, 16) #define GETEX4(D) opex=TestEx(test, &addr, rex, nextop, D, 4) #define GETEX8(D) opex=TestEx(test, &addr, rex, nextop, D, 8) -#define GETEX32(D) opex=TestEx32O(test, &addr, rex, nextop, D, 0) -#define GETEX_OFFS(D, O) opex=TestExO(test, &addr, rex, nextop, D, O) #define GETGX opgx=GetGx(test->emu, &addr, rex, nextop) #define GETGY opgy=GetGy(test->emu, &addr, rex, nextop) #define GETEY opey=TestEy(test, &addr, rex, nextop) #define GETEM(D) opem=TestEm(test, &addr, rex, nextop, D) -#define GETEM32(D) opem=TestEm32O(test, &addr, rex, nextop, D, 0) #define GETGM opgm=GetGm(test->emu, &addr, rex, nextop) #define GETVX opvx=&test->emu->xmm[vex.v] #define GETVY opvy=&test->emu->ymm[vex.v] @@ -59,29 +50,18 @@ #define GETE8(D) GETED(D) #define GETET(D) GETED(D) #define GETE8xw(D) GETED(D) -#define GETED32(D) oped=GetEd32O(emu, &addr, rex, nextop, D, 0) -#define GETED_OFFS(D, O) oped=GetEdO(emu, &addr, rex, nextop, D, O) -#define GETED_OFFS_16(O) oped=GetEd16off(emu, &addr, rex, nextop, O) #define GETGD opgd=GetGd(emu, &addr, rex, nextop) #define GETEB(D) oped=GetEb(emu, &addr, rex, nextop, D) -#define GETEB32(D) oped=GetEb32O(emu, &addr, rex, nextop, D, 0) -#define GETEB_OFFS(D, O) oped=GetEbO(emu, &addr, rex, nextop, D, O) #define GETGB opgd=GetGb(emu, &addr, rex, nextop) #define GETEW(D) oped=GetEw(emu, &addr, rex, nextop, D) -#define GETEW32(D) oped=GetEw32O(emu, &addr, rex, nextop, D, 0) -#define GETEW_OFFS(D, O) oped=GetEdO(emu, &addr, rex, nextop, D, O) -#define GETEW_OFFS_16(O) oped=GetEw16off(emu, &addr, rex, nextop, O) #define GETGW opgd=GetGw(emu, &addr, rex, nextop) #define GETEX(D) opex=GetEx(emu, &addr, rex, nextop, D) #define GETEX4(D) GETEX(D) #define GETEX8(D) GETEX(D) -#define GETEX32(D) opex=GetEx32O(emu, &addr, rex, nextop, D, 0) -#define GETEX_OFFS(D, O) opex=GetExO(emu, &addr, rex, nextop, D, O) #define GETGX opgx=GetGx(emu, &addr, rex, nextop) #define GETGY opgy=GetGy(emu, &addr, rex, nextop) #define GETEY opey=(opex>=&emu->xmm[0] && opex<=&emu->xmm[15])?((sse_regs_t*)((uintptr_t)opex+offsetof(x64emu_t, ymm)-offsetof(x64emu_t, xmm))):((sse_regs_t*)((uintptr_t)opex+16)) #define GETEM(D) opem=GetEm(emu, &addr, rex, nextop, D) -#define GETEM32(D) opem=GetEm32O(emu, &addr, rex, nextop, D, 0) #define GETGM opgm=GetGm(emu, &addr, rex, nextop) #define GETVX opvx=&emu->xmm[vex.v] #define GETVY opvy=&emu->ymm[vex.v] @@ -103,16 +83,37 @@ #define EM opem #define GM opgm #define FAKEED(D) GetEd(emu, &addr, rex, nextop, D) -#define FAKEED32(D) GetEd32O(emu, &addr, rex, nextop, D, 0) #define GETEA(D) GetEA(emu, &addr, rex, nextop, D) -#define GETEA32(D) GetEA32(emu, &addr, rex, nextop, D) #define _GETED(D) oped=GetEd(emu, &addr, rex, nextop, D) -#define _GETED32(D) oped=GetEd32O(emu, &addr, rex, nextop, D, 0) #define _GETEB(D) oped=GetEb(emu, &addr, rex, nextop, D) #define _GETEX(D) opex=GetEx(emu, &addr, rex, nextop, D) #define MODREG ((nextop&0xC0)==0xC0) +#if defined(__riscv) +#define NAN_PROPAGATION(dest, src, break_or_continue) \ + if (isnan(dest)) { \ + break_or_continue; \ + } else if (isnan(src)) { \ + (dest) = (src); \ + break_or_continue; \ + } +#else +#define NAN_PROPAGATION(dest, src, break_or_continue) +#endif + +#define MARK_NAN_VF_2(A, B) for(int idx=0; idx<4; ++idx) mask_nan[idx] = isnanf(A->f[idx]) || isnanf(B->f[idx]) +#define CHECK_NAN_VF(A) for(int idx=0; idx<4; ++idx) if(!mask_nan[idx] && isnanf(A->f[idx])) A->f[idx] = -NAN + +#define MARK_NAN_VD_2(A, B) for(int idx=0; idx<2; ++idx) mask_nan[idx] = isnan(A->d[idx]) || isnan(B->d[idx]) +#define CHECK_NAN_VD(A) for(int idx=0; idx<2; ++idx) if(!mask_nan[idx] && isnan(A->d[idx])) A->d[idx] = -NAN + +#define MARK_NAN_F_2(A, B) is_nan = isnanf(A->f[0]) || isnanf(B->f[0]) +#define CHECK_NAN_F(A) if(!is_nan && isnanf(A->f[0])) A->f[0] = -NAN + +#define MARK_NAN_D_2(A, B) is_nan = isnan(A->d[0]) || isnan(B->d[0]) +#define CHECK_NAN_D(A) if(!is_nan && isnan(A->d[0])) A->d[0] = -NAN + #define GOCOND(BASE, PREFIX, COND, NOTCOND, POST)\ case BASE+0x0: \ PREFIX \ diff --git a/src/emu/x64emu.c b/src/emu/x64emu.c index f086529..4e18fe2 100644 --- a/src/emu/x64emu.c +++ b/src/emu/x64emu.c @@ -3,21 +3,20 @@ #include #include #include -#include -#include -#include +#include +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" +#include "box64cpu.h" +#include "box64cpu_util.h" #include "x64emu_private.h" #include "x87emu_private.h" #include "box64context.h" -#include "x64run.h" #include "x64run_private.h" #include "callback.h" #include "bridge.h" -#include "elfs/elfloader_private.h" #ifdef HAVE_TRACE #include "x64trace.h" #endif @@ -30,12 +29,6 @@ #warning Architecture cannot follow SSE Flush to 0 flag #endif -typedef struct cleanup_s { - void* f; - int arg; - void* a; -} cleanup_t; - static uint32_t x86emu_parity_tab[8] = { 0x96696996, @@ -64,11 +57,34 @@ static void internalX64Setup(x64emu_t* emu, box64context_t *context, uintptr_t s // set default value R_RIP = start; R_RSP = (stack + stacksize) & ~7; // align stack start, always + #ifdef BOX32 + if(box64_is32bits) { + if(stack>=0x100000000LL) { + printf_log(LOG_NONE, "Stack pointer too high (%p), aborting\n", (void*)stack); + abort(); + } + if(R_RSP>=0x100000000LL) { // special case, stack is just a bit too high + R_RSP = 0x100000000LL - 16; + } + } + #endif // fake init of segments... - emu->segs[_CS] = 0x33; - emu->segs[_DS] = emu->segs[_ES] = emu->segs[_SS] = 0x2b; - emu->segs[_FS] = 0x43; - emu->segs[_GS] = default_gs; + if(box64_is32bits) { + emu->segs[_CS] = 0x23; + emu->segs[_DS] = emu->segs[_ES] = emu->segs[_SS] = 0x2b; + emu->segs[_FS] = default_fs; + emu->segs[_GS] = 0x33; + } else { + emu->segs[_CS] = 0x33; + emu->segs[_DS] = emu->segs[_ES] = emu->segs[_SS] = 0x2b; + emu->segs[_FS] = 0; + emu->segs[_GS] = 0; + } + // init segments + for(int i=0; i<16; i++) { + emu->segldt[i].limit = (uintptr_t)-1LL; + } + memcpy(emu->seggdt, context->seggdt, sizeof(emu->seggdt)); // setup fpu regs reset_fpu(emu); emu->mxcsr.x32 = 0x1f80; @@ -77,21 +93,21 @@ static void internalX64Setup(x64emu_t* emu, box64context_t *context, uintptr_t s EXPORTDYN x64emu_t *NewX64Emu(box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack) { - printf_log(LOG_DEBUG, "Allocate a new X86_64 Emu, with EIP=%p and Stack=%p/0x%X\n", (void*)start, (void*)stack, stacksize); + printf_log(LOG_DEBUG, "Allocate a new X86_64 Emu, with %cIP=%p and Stack=%p/0x%X%s\n", box64_is32bits?'E':'R', (void*)start, (void*)stack, stacksize, ownstack?" owned":""); - x64emu_t *emu = (x64emu_t*)box_calloc(1, sizeof(x64emu_t)); + x64emu_t *emu = (x64emu_t*)actual_calloc(1, sizeof(x64emu_t)); internalX64Setup(emu, context, start, stack, stacksize, ownstack); return emu; } -x64emu_t *NewX64EmuFromStack(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack) +x64emu_t *NewX64EmuFromStack(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize) { printf_log(LOG_DEBUG, "New X86_64 Emu from stack, with EIP=%p and Stack=%p/0x%X\n", (void*)start, (void*)stack, stacksize); - internalX64Setup(emu, context, start, stack, stacksize, ownstack); - + internalX64Setup(emu, context, start, stack, stacksize, 0); + return emu; } @@ -127,66 +143,20 @@ void SetTraceEmu(uintptr_t start, uintptr_t end) } #endif -void AddCleanup(x64emu_t *emu, void *p) -{ - (void)emu; - - if(my_context->clean_sz == my_context->clean_cap) { - my_context->clean_cap += 32; - my_context->cleanups = (cleanup_t*)box_realloc(my_context->cleanups, sizeof(cleanup_t)*my_context->clean_cap); - } - my_context->cleanups[my_context->clean_sz].arg = 0; - my_context->cleanups[my_context->clean_sz].a = NULL; - my_context->cleanups[my_context->clean_sz++].f = p; -} - -void AddCleanup1Arg(x64emu_t *emu, void *p, void* a, elfheader_t* h) -{ - (void)emu; - if(!h) - return; - - if(h->clean_sz == h->clean_cap) { - h->clean_cap += 32; - h->cleanups = (cleanup_t*)box_realloc(h->cleanups, sizeof(cleanup_t)*h->clean_cap); - } - h->cleanups[h->clean_sz].arg = 1; - h->cleanups[h->clean_sz].a = a; - h->cleanups[h->clean_sz++].f = p; -} - -void CallCleanup(x64emu_t *emu, elfheader_t* h) -{ - printf_log(LOG_DEBUG, "Calling atexit registered functions for elf: %p/%s\n", h, h?h->name:"(nil)"); - if(!h) - return; - for(int i=h->clean_sz-1; i>=0; --i) { - printf_log(LOG_DEBUG, "Call cleanup #%d\n", i); - RunFunctionWithEmu(emu, 0, (uintptr_t)(h->cleanups[i].f), h->cleanups[i].arg, h->cleanups[i].a ); - // now remove the cleanup - if(i!=h->clean_sz-1) - memmove(h->cleanups+i, h->cleanups+i+1, (h->clean_sz-i-1)*sizeof(cleanup_t)); - --h->clean_sz; - } -} - -void CallAllCleanup(x64emu_t *emu) -{ - printf_log(LOG_DEBUG, "Calling atexit registered functions\n"); - for(int i=my_context->clean_sz-1; i>=0; --i) { - printf_log(LOG_DEBUG, "Call cleanup #%d\n", i); - --my_context->clean_sz; - RunFunctionWithEmu(emu, 0, (uintptr_t)(my_context->cleanups[i].f), my_context->cleanups[i].arg, my_context->cleanups[i].a ); - } - box_free(my_context->cleanups); - my_context->cleanups = NULL; -} - static void internalFreeX64(x64emu_t* emu) { if(emu && emu->stack2free) { - if(!internal_munmap(emu->stack2free, emu->size_stack)) - freeProtection((uintptr_t)emu->stack2free, emu->size_stack); + munmap(emu->stack2free, emu->size_stack); + freeProtection((uintptr_t)emu->stack2free, emu->size_stack); + } + #ifdef BOX32 + if(emu->res_state_32) + actual_free(emu->res_state_32); + emu->res_state_32 = NULL; + #endif + if(emu->tlsdata) { + free_tlsdatasize(emu->tlsdata); + emu->tlsdata = NULL; } } @@ -198,13 +168,14 @@ void FreeX64Emu(x64emu_t **emu) printf_log(LOG_DEBUG, "%04d|Free a X86_64 Emu (%p)\n", GetTID(), *emu); if((*emu)->test.emu) { + (*emu)->test.emu->tlsdata = NULL; // unlink the tlsdata first internalFreeX64((*emu)->test.emu); - box_free((*emu)->test.emu); + actual_free((*emu)->test.emu); (*emu)->test.emu = NULL; } internalFreeX64(*emu); - box_free(*emu); + actual_free(*emu); *emu = NULL; } @@ -224,7 +195,9 @@ void CloneEmu(x64emu_t *newemu, const x64emu_t* emu) memcpy(&newemu->eflags, &emu->eflags, sizeof(emu->eflags)); newemu->old_ip = emu->old_ip; memcpy(newemu->segs, emu->segs, sizeof(emu->segs)); - memset(newemu->segs_serial, 0, sizeof(newemu->segs_serial)); + memcpy(newemu->segs_offs, emu->segs_offs, sizeof(emu->segs_offs)); + memcpy(newemu->seggdt, emu->seggdt, sizeof(newemu->seggdt)); + memcpy(newemu->segldt, emu->segldt, sizeof(newemu->segldt)); memcpy(newemu->x87, emu->x87, sizeof(emu->x87)); memcpy(newemu->mmx, emu->mmx, sizeof(emu->mmx)); memcpy(newemu->fpu_ld, emu->fpu_ld, sizeof(emu->fpu_ld)); @@ -237,19 +210,13 @@ void CloneEmu(x64emu_t *newemu, const x64emu_t* emu) memcpy(newemu->xmm, emu->xmm, sizeof(emu->xmm)); memcpy(newemu->ymm, emu->ymm, sizeof(emu->ymm)); newemu->df = emu->df; - newemu->df_sav = emu->df_sav; newemu->op1 = emu->op1; newemu->op2 = emu->op2; newemu->res = emu->res; - newemu->op1_sav = emu->op1_sav; - newemu->res_sav = emu->res_sav; newemu->mxcsr = emu->mxcsr; newemu->quit = emu->quit; newemu->error = emu->error; - // adapt R_RSP to new stack frame - uintptr_t oldst = (uintptr_t)((emu->init_stack)?emu->init_stack:emu->context->stack); - uintptr_t newst = (uintptr_t)((newemu->init_stack)?newemu->init_stack:newemu->context->stack); - newemu->regs[_SP].q[0] = emu->regs[_SP].q[0] + (intptr_t)(newst - oldst); + newemu->x64emu_parity_tab = emu->x64emu_parity_tab; } void CopyEmu(x64emu_t *newemu, const x64emu_t* emu) @@ -259,7 +226,6 @@ void CopyEmu(x64emu_t *newemu, const x64emu_t* emu) memcpy(&newemu->eflags, &emu->eflags, sizeof(emu->eflags)); newemu->old_ip = emu->old_ip; memcpy(newemu->segs, emu->segs, sizeof(emu->segs)); - memcpy(newemu->segs_serial, emu->segs_serial, sizeof(emu->segs_serial)); memcpy(newemu->segs_offs, emu->segs_offs, sizeof(emu->segs_offs)); memcpy(newemu->x87, emu->x87, sizeof(emu->x87)); memcpy(newemu->mmx, emu->mmx, sizeof(emu->mmx)); @@ -273,12 +239,9 @@ void CopyEmu(x64emu_t *newemu, const x64emu_t* emu) newemu->top = emu->top; newemu->fpu_stack = emu->fpu_stack; newemu->df = emu->df; - newemu->df_sav = emu->df_sav; newemu->op1 = emu->op1; newemu->op2 = emu->op2; newemu->res = emu->res; - newemu->op1_sav = emu->op1_sav; - newemu->res_sav = emu->res_sav; newemu->mxcsr = emu->mxcsr; newemu->quit = emu->quit; newemu->error = emu->error; @@ -325,10 +288,14 @@ void SetEBP(x64emu_t *emu, uint32_t v) { R_EBP = v; } -//void SetESP(x64emu_t *emu, uint32_t v) -//{ -// R_ESP = v; -//} +void SetESP(x64emu_t *emu, uint32_t v) +{ + R_ESP = v; +} +void SetEIP(x64emu_t *emu, uint32_t v) +{ + R_EIP = v; +} void SetRAX(x64emu_t *emu, uint64_t v) { R_RAX = v; @@ -373,15 +340,14 @@ uint64_t GetRBP(x64emu_t *emu) { return R_RBP; } -/*void SetFS(x64emu_t *emu, uint16_t v) +void SetFS(x64emu_t *emu, uint16_t v) { emu->segs[_FS] = v; - emu->segs_serial[_FS] = 0; } uint16_t GetFS(x64emu_t *emu) { return emu->segs[_FS]; -}*/ +} void ResetFlags(x64emu_t *emu) @@ -391,7 +357,11 @@ void ResetFlags(x64emu_t *emu) const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip, int is32bits) { + #ifdef WIN32 static char buff[4096]; + #else + static __thread char buff[4096]; + #endif static const char* regname[] = {"RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI", " R8", " R9", "R10", "R11", "R12", "R13", "R14", "R15"}; static const char* regname32[]={"EAX", "ECX", "EDX", "EBX", "ESP", "EBP", "ESI", "EDI"}; @@ -399,7 +369,7 @@ const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip, int is32bits) char tmp[160]; buff[0] = '\0'; #ifdef HAVE_TRACE - if(trace_emm) { + if(BOX64ENV(trace_emm)) { // do emm reg if needed for(int i=0; i<8; ++i) { sprintf(tmp, "mm%d:%016lx", i, emu->mmx[i].q); @@ -407,10 +377,10 @@ const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip, int is32bits) if ((i&3)==3) strcat(buff, "\n"); else strcat(buff, " "); } } - if(trace_xmm) { + if(BOX64ENV(trace_xmm)) { // do xmm reg if needed for(int i=0; i<(is32bits?8:16); ++i) { - if (trace_regsdiff && (emu->old_xmm[i].q[0] != emu->xmm[i].q[0] || emu->old_xmm[i].q[1] != emu->xmm[i].q[1])) { + if (BOX64ENV(trace_regsdiff) && (emu->old_xmm[i].q[0] != emu->xmm[i].q[0] || emu->old_xmm[i].q[1] != emu->xmm[i].q[1])) { sprintf(tmp, "\e[1;35m%02d:%016lx-%016lx\e[m", i, emu->xmm[i].q[1], emu->xmm[i].q[0]); emu->old_xmm[i].q[0] = emu->xmm[i].q[0]; emu->old_xmm[i].q[1] = emu->xmm[i].q[1]; @@ -418,8 +388,8 @@ const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip, int is32bits) sprintf(tmp, "%02d:%016lx-%016lx", i, emu->xmm[i].q[1], emu->xmm[i].q[0]); } strcat(buff, tmp); - if(box64_avx) { - if (trace_regsdiff && (emu->old_ymm[i].q[0] != emu->ymm[i].q[0] || emu->old_ymm[i].q[1] != emu->ymm[i].q[1])) { + if(BOX64ENV(avx)) { + if (BOX64ENV(trace_regsdiff) && (emu->old_ymm[i].q[0] != emu->ymm[i].q[0] || emu->old_ymm[i].q[1] != emu->ymm[i].q[1])) { sprintf(tmp, "\e[1;35m-%016lx-%016lx\e[m", emu->ymm[i].q[1], emu->ymm[i].q[0]); emu->old_ymm[i].q[0] = emu->ymm[i].q[0]; emu->old_ymm[i].q[1] = emu->ymm[i].q[1]; @@ -428,7 +398,7 @@ const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip, int is32bits) } strcat(buff, tmp); } - if(box64_avx) + if(BOX64ENV(avx)) if ((i&1)==1) strcat(buff, "\n"); else strcat(buff, " "); else if ((i&3)==3) strcat(buff, "\n"); else strcat(buff, " "); @@ -440,14 +410,14 @@ const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip, int is32bits) int stack = emu->fpu_stack; if(stack>8) stack = 8; for (int i=0; isw.f.F87_C3, emu->sw.f.F87_C2, emu->sw.f.F87_C1, emu->sw.f.F87_C0); + sprintf(tmp, " C3210 = %d%d%d%d CW=%x", emu->sw.f.F87_C3, emu->sw.f.F87_C2, emu->sw.f.F87_C1, emu->sw.f.F87_C0, emu->cw.x16); strcat(buff, tmp); strcat(buff, "\n"); } @@ -457,46 +427,52 @@ const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip, int is32bits) if(i!=_GS) strcat(buff, " "); } + sprintf(tmp, " FSBASE=%p", (void*)emu->segs_offs[_FS]); + strcat(buff, tmp); + sprintf(tmp, " GSBASE=%p", (void*)emu->segs_offs[_GS]); + strcat(buff, tmp); strcat(buff, "\n"); if(is32bits) for (int i=_AX; i<=_RDI; ++i) { #ifdef HAVE_TRACE - if (trace_regsdiff && (emu->regs[i].dword[0] != emu->oldregs[i].q[0])) { + if (BOX64ENV(trace_regsdiff) && (emu->regs[i].dword[0] != emu->oldregs[i].q[0])) { sprintf(tmp, "\e[1;35m%s=%08x\e[m ", regname32[i], emu->regs[i].dword[0]); emu->oldregs[i].q[0] = emu->regs[i].dword[0]; } else { - sprintf(tmp, "%s=%08x ", regname32[i], emu->regs[i].dword[0]); + sprintf(tmp, "%s%s=%08x ", emu->regs[i].dword[1]?"*":"", regname32[i], emu->regs[i].dword[0]); } #else - sprintf(tmp, "%s=%08x ", regname[i], emu->regs[i].dword[0]); + sprintf(tmp, "%s%s=%08x ", emu->regs[i].dword[1]?"*":"", regname[i], emu->regs[i].dword[0]); #endif strcat(buff, tmp); if(i==_RBX) { if(emu->df) { #define FLAG_CHAR(f) (ACCESS_FLAG(F_##f##F)) ? #f : "?" - sprintf(tmp, "flags=%s%s%s%s%s%s%s\n", FLAG_CHAR(O), FLAG_CHAR(D), FLAG_CHAR(S), FLAG_CHAR(Z), FLAG_CHAR(A), FLAG_CHAR(P), FLAG_CHAR(C)); + sprintf(tmp, " flags=%s%s%s%s%s%s%s\n", FLAG_CHAR(O), FLAG_CHAR(D), FLAG_CHAR(S), FLAG_CHAR(Z), FLAG_CHAR(A), FLAG_CHAR(P), FLAG_CHAR(C)); strcat(buff, tmp); #undef FLAG_CHAR } else { #define FLAG_CHAR(f) (ACCESS_FLAG(F_##f##F)) ? #f : "-" - sprintf(tmp, "FLAGS=%s%s%s%s%s%s%s\n", FLAG_CHAR(O), FLAG_CHAR(D), FLAG_CHAR(S), FLAG_CHAR(Z), FLAG_CHAR(A), FLAG_CHAR(P), FLAG_CHAR(C)); + sprintf(tmp, " FLAGS=%s%s%s%s%s%s%s\n", FLAG_CHAR(O), FLAG_CHAR(D), FLAG_CHAR(S), FLAG_CHAR(Z), FLAG_CHAR(A), FLAG_CHAR(P), FLAG_CHAR(C)); strcat(buff, tmp); #undef FLAG_CHAR } + } else { + strcat(buff, " "); } } else for (int i=_AX; i<=_R15; ++i) { #ifdef HAVE_TRACE - if (trace_regsdiff && (emu->regs[i].q[0] != emu->oldregs[i].q[0])) { - sprintf(tmp, "\e[1;35m%s=%016lx\e[m ", regname[i], emu->regs[i].q[0]); + if (BOX64ENV(trace_regsdiff) && (emu->regs[i].q[0] != emu->oldregs[i].q[0])) { + sprintf(tmp, "\e[1;35m%s=%016" PRIx64 "\e[m ", regname[i], emu->regs[i].q[0]); emu->oldregs[i].q[0] = emu->regs[i].q[0]; } else { - sprintf(tmp, "%s=%016lx ", regname[i], emu->regs[i].q[0]); + sprintf(tmp, "%s=%016" PRIx64, regname[i], emu->regs[i].q[0]); } #else - sprintf(tmp, "%s=%016lx ", regname[i], emu->regs[i].q[0]); + sprintf(tmp, "%s=%016" PRIx64, regname[i], emu->regs[i].q[0]); #endif strcat(buff, tmp); @@ -504,24 +480,26 @@ const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip, int is32bits) if(i==4) { if(emu->df) { #define FLAG_CHAR(f) (ACCESS_FLAG(F_##f##F)) ? #f : "?" - sprintf(tmp, "flags=%s%s%s%s%s%s%s\n", FLAG_CHAR(O), FLAG_CHAR(D), FLAG_CHAR(S), FLAG_CHAR(Z), FLAG_CHAR(A), FLAG_CHAR(P), FLAG_CHAR(C)); + sprintf(tmp, " flags=%s%s%s%s%s%s%s\n", FLAG_CHAR(O), FLAG_CHAR(D), FLAG_CHAR(S), FLAG_CHAR(Z), FLAG_CHAR(A), FLAG_CHAR(P), FLAG_CHAR(C)); strcat(buff, tmp); #undef FLAG_CHAR } else { #define FLAG_CHAR(f) (ACCESS_FLAG(F_##f##F)) ? #f : "-" - sprintf(tmp, "FLAGS=%s%s%s%s%s%s%s\n", FLAG_CHAR(O), FLAG_CHAR(D), FLAG_CHAR(S), FLAG_CHAR(Z), FLAG_CHAR(A), FLAG_CHAR(P), FLAG_CHAR(C)); + sprintf(tmp, " FLAGS=%s%s%s%s%s%s%s\n", FLAG_CHAR(O), FLAG_CHAR(D), FLAG_CHAR(S), FLAG_CHAR(Z), FLAG_CHAR(A), FLAG_CHAR(P), FLAG_CHAR(C)); strcat(buff, tmp); #undef FLAG_CHAR } } else { strcat(buff, "\n"); } - } + } else { + strcat(buff, " "); + } } if(is32bits) - sprintf(tmp, "EIP=%08lx ", ip); + sprintf(tmp, "EIP=%08" PRIx64 " ", ip); else - sprintf(tmp, "RIP=%016lx ", ip); + sprintf(tmp, "RIP=%016" PRIx64 " ", ip); strcat(buff, tmp); return buff; } @@ -533,33 +511,45 @@ void StopEmu(x64emu_t* emu, const char* reason, int is32bits) // dump stuff... printf_log(LOG_NONE, "==== CPU Registers ====\n%s\n", DumpCPURegs(emu, R_RIP, is32bits)); printf_log(LOG_NONE, "======== Stack ========\nStack is from %lX to %lX\n", R_RBP, R_RSP); - if (R_RBP == R_RSP) { - printf_log(LOG_NONE, "RBP = RSP: leaf function detected; next 128 bytes should be either data or random.\n"); + if(emu->segs[_CS]==0x23) { + if (R_EBP == R_ESP) { + printf_log(LOG_NONE, "EBP = ESP: leaf function detected; next 128 bytes should be either data or random.\n"); + } else { + // TODO: display stack if operation should be allowed (to avoid crashes) + /* for (uint64_t *sp = R_RBP; sp >= R_RSP; --sp) { + } */ + } } else { - // TODO: display stack if operation should be allowed (to avoid crashes) - /* for (uint64_t *sp = R_RBP; sp >= R_RSP; --sp) { - } */ + if (R_RBP == R_RSP) { + printf_log(LOG_NONE, "RBP = RSP: leaf function detected; next 128 bytes should be either data or random.\n"); + } else { + // TODO: display stack if operation should be allowed (to avoid crashes) + /* for (uint64_t *sp = R_RBP; sp >= R_RSP; --sp) { + } */ + } } printf_log(LOG_NONE, "Old IP: %tX\n", emu->old_ip); #ifdef HAVE_TRACE - printf_log(LOG_NONE, "%s\n", DecodeX64Trace(my_context->dec, emu->old_ip)); + if(box64_is32bits) { + if(my_context->dec32) + printf_log(LOG_NONE, "%s\n", DecodeX64Trace(my_context->dec32, emu->old_ip, 1)); + } else { + if(my_context->dec) + printf_log(LOG_NONE, "%s\n", DecodeX64Trace(my_context->dec, emu->old_ip, 1)); + } #endif } void UnimpOpcode(x64emu_t* emu, int is32bits) { - R_RIP = emu->old_ip; - - int tid = syscall(SYS_gettid); - printf_log(LOG_NONE, "%04d|%p: Unimplemented %sOpcode (%02X %02X %02X %02X) %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", + int tid = GetTID(); + printf_log(LOG_INFO, "%04d|%p: Unimplemented %sOpcode (%02X %02X %02X %02X) %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", tid, (void*)emu->old_ip, is32bits?"32bits ":"", Peek(emu, -4), Peek(emu, -3), Peek(emu, -2), Peek(emu, -1), Peek(emu, 0), Peek(emu, 1), Peek(emu, 2), Peek(emu, 3), Peek(emu, 4), Peek(emu, 5), Peek(emu, 6), Peek(emu, 7), Peek(emu, 8), Peek(emu, 9), Peek(emu,10), Peek(emu,11), Peek(emu,12), Peek(emu,13), Peek(emu,14)); - emu->quit=1; - emu->error |= ERR_UNIMPL; } void EmuCall(x64emu_t* emu, uintptr_t addr) @@ -570,20 +560,39 @@ void EmuCall(x64emu_t* emu, uintptr_t addr) uint64_t old_rsi = R_RSI; uint64_t old_rbp = R_RBP; uint64_t old_rip = R_RIP; + x64flags_t old_eflags = emu->eflags; + // save defered flags + deferred_flags_t old_df = emu->df; + multiuint_t old_op1 = emu->op1; + multiuint_t old_op2 = emu->op2; + multiuint_t old_res = emu->res; //Push64(emu, GetRBP(emu)); // set frame pointer //SetRBP(emu, GetRSP(emu)); // save RSP - R_RSP -= 200; - R_RSP &= ~63LL; - PushExit(emu); + //R_RSP -= 200; + //R_RSP &= ~63LL; + #ifdef BOX32 + if(box64_is32bits) + PushExit_32(emu); + else + #endif + PushExit(emu); R_RIP = addr; emu->df = d_none; - Run(emu, 0); + emu->flags.need_jmpbuf = 1; + EmuRun(emu, 0); emu->quit = 0; // reset Quit flags... emu->df = d_none; if(emu->flags.quitonlongjmp && emu->flags.longjmp) { if(emu->flags.quitonlongjmp==1) emu->flags.longjmp = 0; // don't change anything because of the longjmp } else { + // restore defered flags + emu->df = old_df; + emu->op1 = old_op1; + emu->op2 = old_op2; + emu->res = old_res; + // and the old registers + emu->eflags = old_eflags; R_RBX = old_rbx; R_RDI = old_rdi; R_RSI = old_rsi; @@ -593,109 +602,6 @@ void EmuCall(x64emu_t* emu, uintptr_t addr) } } -#if defined(RV64) -static size_t readBinarySizeFromFile(const char* fname) -{ - if (access(fname, R_OK) != 0) return -1; - FILE* fp = fopen(fname, "r"); - if (fp == NULL) return -1; - - char b[sizeof(uint64_t)] = { 0 }, tmp; - ssize_t n = fread(b, 1, sizeof(b), fp); - if (n <= 0) return -1; - - for (ssize_t i = 0; i < n / 2; i++) { - tmp = b[n - i - 1]; - b[n - i - 1] = b[i]; - b[i] = tmp; - } - return *(uint64_t*)b; -} - -static inline uint64_t readCycleCounter() -{ - uint64_t val; - asm volatile("rdtime %0" - : "=r"(val)); - return val; -} - -static inline uint64_t readFreq() -{ - static size_t val = -1; - - val = readBinarySizeFromFile("/sys/firmware/devicetree/base/cpus/timebase-frequency"); - if (val != (size_t)-1) return val; - - // fallback to rdtime + sleep - struct timespec ts; - ts.tv_sec = 0; - ts.tv_nsec = 50000000; // 50 milliseconds - uint64_t cycles = readCycleCounter(); - nanosleep(&ts, NULL); - // round to MHz - val = (size_t)round(((double)(readCycleCounter() - cycles) * 20) / 1e6) * 1e6; - return (uint64_t)val; -} -#elif defined(ARM64) -static inline uint64_t readCycleCounter() -{ - uint64_t val; - asm volatile("mrs %0, cntvct_el0" - : "=r"(val)); - return val; -} -static inline uint64_t readFreq() -{ - uint64_t val; - asm volatile("mrs %0, cntfrq_el0" - : "=r"(val)); - return val; -} -#endif - -uint64_t ReadTSC(x64emu_t* emu) -{ - (void)emu; - - // Hardware counter, per architecture -#if defined(ARM64) || defined(RV64) - if (!box64_rdtsc) return readCycleCounter(); -#endif - // fall back to gettime... -#if !defined(NOGETCLOCK) - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC_COARSE, &ts); - return (uint64_t)(ts.tv_sec) * 1000000000LL + ts.tv_nsec; -#else - struct timeval tv; - gettimeofday(&tv, NULL); - return (uint64_t)(tv.tv_sec) * 1000000 + tv.tv_usec; -#endif -} - -uint64_t ReadTSCFrequency(x64emu_t* emu) -{ - (void)emu; - // Hardware counter, per architecture -#if defined(ARM64) || defined(RV64) - if (!box64_rdtsc) return readFreq(); -#endif - // fall back to get time -#if !defined(NOGETCLOCK) - return 1000000000LL; -#else - return 1000000; -#endif -} - -void ResetSegmentsCache(x64emu_t *emu) -{ - if(!emu) - return; - memset(emu->segs_serial, 0, sizeof(emu->segs_serial)); -} - void applyFlushTo0(x64emu_t* emu) { #ifdef __x86_64__ @@ -715,5 +621,1025 @@ void applyFlushTo0(x64emu_t* emu) #else __builtin_aarch64_set_fpcr(fpcr); #endif + #else + // This does not applies to RISC-V and LoongArch, as they don't have flush to zero #endif } + +#define PARITY(x) (((emu->x64emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0) +#define XOR2(x) (((x) ^ ((x) >> 1)) & 0x1) +void UpdateFlags(x64emu_t* emu) +{ + uint64_t cc; + uint64_t lo, hi; + uint64_t bc; + uint64_t cnt; + + switch (emu->df) { + case d_none: + return; + case d_add8: + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x100, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op1.u8 & emu->op2.u8) | ((~emu->res.u8) & (emu->op1.u8 | emu->op2.u8)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_add8b: + CONDITIONAL_SET_FLAG(((uint16_t)emu->op1.u8 + emu->op2.u8) & 0x100, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op1.u8 & emu->op2.u8) | ((~emu->res.u8) & (emu->op1.u8 | emu->op2.u8)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_add16: + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x10000, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op1.u16 & emu->op2.u16) | ((~emu->res.u16) & (emu->op1.u16 | emu->op2.u16)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_add16b: + CONDITIONAL_SET_FLAG(((uint32_t)emu->op1.u16 + emu->op2.u16) & 0x10000, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op1.u16 & emu->op2.u16) | ((~emu->res.u16) & (emu->op1.u16 | emu->op2.u16)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_add32: + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x100000000LL, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op1.u32 & emu->op2.u32) | ((~emu->res.u32) & (emu->op1.u32 | emu->op2.u32)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_add32b: + lo = (emu->op2.u32 & 0xFFFF) + (emu->op1.u32 & 0xFFFF); + hi = (lo >> 16) + (emu->op2.u32 >> 16) + (emu->op1.u32 >> 16); + CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op1.u32 & emu->op2.u32) | ((~emu->res.u32) & (emu->op1.u32 | emu->op2.u32)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_add64: + lo = (emu->op2.u64 & 0xFFFFFFFF) + (emu->op1.u64 & 0xFFFFFFFF); + hi = (lo >> 32) + (emu->op2.u64 >> 32) + (emu->op1.u64 >> 32); + CONDITIONAL_SET_FLAG(hi & 0x100000000L, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op1.u64 & emu->op2.u64) | ((~emu->res.u64) & (emu->op1.u64 | emu->op2.u64)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 62), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_and8: + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + break; + case d_and16: + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + break; + case d_and32: + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + break; + case d_and64: + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(emu->res.u64 == 0, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + break; + case d_dec8: + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u8 & (~emu->op1.u8 | 1)) | (~emu->op1.u8 & 1); + CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_dec16: + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u16 & (~emu->op1.u16 | 1)) | (~emu->op1.u16 & 1); + CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_dec32: + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u32 & (~emu->op1.u32 | 1)) | (~emu->op1.u32 & 1); + CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_dec64: + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u64 & (~emu->op1.u64 | 1LL)) | (~emu->op1.u64 & 1LL); + CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_inc8: + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = ((1 & emu->op1.u8) | (~emu->res.u8)) & (1 | emu->op1.u8); + CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_inc16: + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (1 & emu->op1.u16) | ((~emu->res.u16) & (1 | emu->op1.u16)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_inc32: + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (1 & emu->op1.u32) | ((~emu->res.u32) & (1 | emu->op1.u32)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_inc64: + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (1LL & emu->op1.u64) | ((~emu->res.u64) & (1LL | emu->op1.u64)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 62), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_imul8: + lo = emu->res.u16 & 0xff; + hi = (emu->res.u16 >> 8) & 0xff; + if (((lo & 0x80) == 0 && hi == 0x00) || ((lo & 0x80) != 0 && hi == 0xFF)) { + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_OF); + } else { + SET_FLAG(F_CF); + SET_FLAG(F_OF); + } + if (!BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((emu->res.u8 >> 7) & 1, F_SF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + } + break; + case d_imul16: + lo = (uint16_t)emu->res.u32; + hi = (uint16_t)(emu->res.u32 >> 16); + if (((lo & 0x8000) == 0 && hi == 0x00) || ((lo & 0x8000) != 0 && hi == 0xFFFF)) { + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_OF); + } else { + SET_FLAG(F_CF); + SET_FLAG(F_OF); + } + if (!BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((emu->res.u16 >> 15) & 1, F_SF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + } + break; + case d_imul32: + if ((((emu->res.u32 & 0x80000000) == 0) && emu->op1.u32 == 0x00) || (((emu->res.u32 & 0x80000000) != 0) && emu->op1.u32 == 0xFFFFFFFF)) { + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_OF); + } else { + SET_FLAG(F_CF); + SET_FLAG(F_OF); + } + if (!BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((emu->res.u32 >> 31) & 1, F_SF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + } + break; + case d_imul64: + if (((emu->res.u64 & 0x8000000000000000LL) == 0 && emu->op1.u64 == 0x00) || ((emu->res.u64 & 0x8000000000000000LL) != 0 && emu->op1.u64 == 0xFFFFFFFFFFFFFFFFLL)) { + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_OF); + } else { + SET_FLAG(F_CF); + SET_FLAG(F_OF); + } + if (!BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((emu->res.u64 >> 63) & 1, F_SF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + } + break; + case d_mul8: + hi = (emu->res.u16 >> 8) & 0xff; + if (hi == 0) { + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_OF); + } else { + SET_FLAG(F_CF); + SET_FLAG(F_OF); + } + if (!BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((emu->res.u8 >> 7) & 1, F_SF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + } + break; + case d_mul16: + hi = (uint16_t)(emu->res.u32 >> 16); + if (hi == 0) { + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_OF); + } else { + SET_FLAG(F_CF); + SET_FLAG(F_OF); + } + if (!BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((emu->res.u16 >> 15) & 1, F_SF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + } + break; + case d_mul32: + if (emu->op1.u32 == 0) { + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_OF); + } else { + SET_FLAG(F_CF); + SET_FLAG(F_OF); + } + if (!BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((emu->res.u32 >> 31) & 1, F_SF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + } + break; + case d_mul64: + if (emu->op1.u64 == 0) { + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_OF); + } else { + SET_FLAG(F_CF); + SET_FLAG(F_OF); + } + if (!BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((emu->res.u64 >> 63) & 1, F_SF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + } + break; + case d_or8: + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + break; + case d_or16: + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + break; + case d_or32: + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + break; + case d_or64: + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + break; + case d_neg8: + CONDITIONAL_SET_FLAG(emu->op1.u8, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = emu->res.u8 | emu->op1.u8; + CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_neg16: + CONDITIONAL_SET_FLAG(emu->op1.u16, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = emu->res.u16 | emu->op1.u16; + CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_neg32: + CONDITIONAL_SET_FLAG(emu->op1.u32, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = emu->res.u32 | emu->op1.u32; + CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_neg64: + CONDITIONAL_SET_FLAG(emu->op1.u64, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = emu->res.u64 | emu->op1.u64; + CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_shl8: + cnt = emu->op2.u8 & 0x1f; + if (cnt > 0) { + cc = emu->op1.u8 & (1 << (8 - cnt)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG(((emu->res.u8 >> 7) ^ ACCESS_FLAG(F_CF)) & 0x01, F_OF); + SET_FLAG(F_AF); + } else { + CONDITIONAL_SET_FLAG(XOR2(emu->op1.u8 >> 6), F_OF); + CLEAR_FLAG(F_AF); + } + } + break; + case d_shl16: + cnt = emu->op2.u16 & 0x1f; + if (cnt > 0) { + cc = emu->op1.u16 & (1 << (16 - cnt)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG(((emu->res.u16 >> 15) ^ ACCESS_FLAG(F_CF)) & 0x01, F_OF); + SET_FLAG(F_AF); + } else { + CONDITIONAL_SET_FLAG(XOR2(emu->op1.u16 >> 14), F_OF); + CLEAR_FLAG(F_AF); + } + } + break; + case d_shl32: + cnt = emu->op2.u32 & 0x1f; + if (cnt > 0) { + cc = emu->op1.u32 & (1 << (32 - cnt)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG(((emu->res.u32 >> 31) ^ ACCESS_FLAG(F_CF)) & 0x01, F_OF); + SET_FLAG(F_AF); + } else { + CONDITIONAL_SET_FLAG(XOR2(emu->op1.u32 >> 30), F_OF); + CLEAR_FLAG(F_AF); + } + } + break; + case d_shl64: + if (emu->op2.u64 > 0) { + cc = emu->op1.u64 & (1LL << (64 - emu->op2.u64)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG(((emu->res.u64 >> 63) ^ ACCESS_FLAG(F_CF)) & 0x01, F_OF); + SET_FLAG(F_AF); + } else { + CONDITIONAL_SET_FLAG(XOR2(emu->op1.u64 >> 62), F_OF); + CLEAR_FLAG(F_AF); + } + } + break; + case d_sar8: + if (emu->op2.u8) { + cc = (emu->op1.i8 >> (emu->op2.u8 - 1)) & 1; + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CLEAR_FLAG(F_OF); + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); + } + break; + case d_sar16: + if (emu->op2.u16) { + cc = (emu->op1.i16 >> (emu->op2.u16 - 1)) & 1; + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + CLEAR_FLAG(F_OF); + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); + } + break; + case d_sar32: + if (emu->op2.u32) { + cc = emu->op1.u32 & (1 << (emu->op2.u32 - 1)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + CLEAR_FLAG(F_OF); + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); + } + break; + case d_sar64: + if (emu->op2.u64) { + cc = emu->op1.u64 & (1LL << (emu->op2.u64 - 1)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + CLEAR_FLAG(F_OF); + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); + } + break; + case d_shr8: + cnt = emu->op2.u8 & 0x1f; + if (cnt > 0) { + cc = emu->op1.u8 & (1 << (cnt - 1)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((emu->res.u8 >> 6) & 0x1, F_OF); + SET_FLAG(F_AF); + } else { + CONDITIONAL_SET_FLAG((emu->op1.u8 >> 7) & 0x1, F_OF); + CLEAR_FLAG(F_AF); + } + } + break; + case d_shr16: + cnt = emu->op2.u16 & 0x1f; + if (cnt > 0) { + cc = emu->op1.u16 & (1 << (cnt - 1)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((emu->res.u16 >> 14) & 0x1, F_OF); + SET_FLAG(F_AF); + } else { + CONDITIONAL_SET_FLAG((emu->op1.u16 >> 15) & 0x1, F_OF); + CLEAR_FLAG(F_AF); + } + } + if (cnt == 1) { + CONDITIONAL_SET_FLAG(emu->op1.u16 & 0x8000, F_OF); + } + break; + case d_shr32: + cnt = emu->op2.u32 & 0x1f; + if (cnt > 0) { + cc = emu->op1.u32 & (1 << (cnt - 1)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((emu->res.u32 >> 30) & 0x1, F_OF); + SET_FLAG(F_AF); + } else { + CONDITIONAL_SET_FLAG((emu->op1.u32 >> 31) & 0x1, F_OF); + CLEAR_FLAG(F_AF); + } + } + break; + case d_shr64: + cnt = emu->op2.u64; + if (cnt > 0) { + cc = emu->op1.u64 & (1LL << (cnt - 1)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((emu->res.u64 >> 62) & 0x1, F_OF); + SET_FLAG(F_AF); + } else { + CONDITIONAL_SET_FLAG((emu->op1.u64 >> 63) & 0x1, F_OF); + CLEAR_FLAG(F_AF); + } + } + break; + case d_shrd16: + cnt = emu->op2.u16; + if (cnt > 0) { + cc = emu->op1.u16 & (1 << (cnt - 1)); + if (cnt > 15 && BOX64ENV(cputype)) + cc = 0; + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + } + if BOX64ENV (cputype) { + CONDITIONAL_SET_FLAG(XOR2(emu->res.u16 >> 14), F_OF); + } else { + CONDITIONAL_SET_FLAG(((emu->res.u16 >> (16 - (cnt & 15))) ^ (emu->op1.u16 >> 15)) & 1, F_OF); + } + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); + break; + case d_shrd32: + cnt = emu->op2.u32; + if (cnt > 0) { + cc = emu->op1.u32 & (1 << (cnt - 1)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if BOX64ENV (cputype) { + CONDITIONAL_SET_FLAG(XOR2(emu->res.u32 >> 30), F_OF); + } else { + CONDITIONAL_SET_FLAG(((emu->res.u32 >> (32 - cnt)) ^ (emu->op1.u32 >> 31)) & 1, F_OF); + } + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); + } + break; + case d_shrd64: + cnt = emu->op2.u64; + if (cnt > 0) { + cc = emu->op1.u64 & (1LL << (cnt - 1)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if BOX64ENV (cputype) { + CONDITIONAL_SET_FLAG(XOR2(emu->res.u64 >> 62), F_OF); + } else { + CONDITIONAL_SET_FLAG(((emu->res.u64 >> (64 - cnt)) ^ (emu->op1.u64 >> 63)) & 1, F_OF); + } + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); + } + break; + case d_shld16: + cnt = emu->op2.u16; + if (cnt > 0) { + cc = emu->op1.u16 & (1 << (16 - cnt)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if BOX64ENV (cputype) { + if (cnt > 15) + CONDITIONAL_SET_FLAG(ACCESS_FLAG(F_CF), F_OF); + else + CONDITIONAL_SET_FLAG((ACCESS_FLAG(F_CF) ^ (emu->res.u16 >> 15)) & 1, F_OF); + } else { + CONDITIONAL_SET_FLAG(XOR2(emu->op1.u16 >> 14), F_OF); + } + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); + } + break; + case d_shld32: + cnt = emu->op2.u32; + if (cnt > 0) { + cc = emu->op1.u32 & (1 << (32 - cnt)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if BOX64ENV (cputype) { + CONDITIONAL_SET_FLAG((ACCESS_FLAG(F_CF) ^ (emu->res.u32 >> 31)) & 1, F_OF); + } else { + CONDITIONAL_SET_FLAG(XOR2(emu->op1.u32 >> 30), F_OF); + } + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); + } + break; + case d_shld64: + cnt = emu->op2.u64; + if (cnt > 0) { + cc = emu->op1.u64 & (1LL << (64 - cnt)); + CONDITIONAL_SET_FLAG(cc, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + if BOX64ENV (cputype) { + CONDITIONAL_SET_FLAG((ACCESS_FLAG(F_CF) ^ (emu->res.u64 >> 63)) & 1, F_OF); + } else { + CONDITIONAL_SET_FLAG(XOR2(emu->op1.u64 >> 62), F_OF); + } + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); + } + break; + case d_sub8: + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u8 & (~emu->op1.u8 | emu->op2.u8)) | (~emu->op1.u8 & emu->op2.u8); + CONDITIONAL_SET_FLAG(bc & 0x80, F_CF); + CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_sub16: + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u16 & (~emu->op1.u16 | emu->op2.u16)) | (~emu->op1.u16 & emu->op2.u16); + CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); + CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_sub32: + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u32 & (~emu->op1.u32 | emu->op2.u32)) | (~emu->op1.u32 & emu->op2.u32); + CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF); + CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_sub64: + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u64 & (~emu->op1.u64 | emu->op2.u64)) | (~emu->op1.u64 & emu->op2.u64); + CONDITIONAL_SET_FLAG(bc & 0x8000000000000000LL, F_CF); + CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_xor8: + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + break; + case d_xor16: + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + break; + case d_xor32: + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + break; + case d_xor64: + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + break; + case d_cmp8: + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG((emu->res.u8 & 0xff) == 0, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u8 & (~emu->op1.u8 | emu->op2.u8)) | (~emu->op1.u8 & emu->op2.u8); + CONDITIONAL_SET_FLAG(bc & 0x80, F_CF); + CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_cmp16: + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u16 & (~emu->op1.u16 | emu->op2.u16)) | (~emu->op1.u16 & emu->op2.u16); + CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); + CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_cmp32: + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u32 & (~emu->op1.u32 | emu->op2.u32)) | (~emu->op1.u32 & emu->op2.u32); + CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF); + CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_cmp64: + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u64 & (~emu->op1.u64 | emu->op2.u64)) | (~emu->op1.u64 & emu->op2.u64); + CONDITIONAL_SET_FLAG(bc & 0x8000000000000000LL, F_CF); + CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_tst8: + CLEAR_FLAG(F_OF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + CLEAR_FLAG(F_CF); + break; + case d_tst16: + CLEAR_FLAG(F_OF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + CLEAR_FLAG(F_CF); + break; + case d_tst32: + CLEAR_FLAG(F_OF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + CLEAR_FLAG(F_CF); + break; + case d_tst64: + CLEAR_FLAG(F_OF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + CLEAR_FLAG(F_CF); + break; + case d_adc8: + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x100, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op1.u8 & emu->op2.u8) | ((~emu->res.u8) & (emu->op1.u8 | emu->op2.u8)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_adc8b: + if (emu->res.u8 == (emu->op1.u8 + emu->op2.u8)) { + lo = (uint32_t)(emu->op1.u8) + (emu->op2.u8); + } else { + lo = 1 + (uint32_t)(emu->op1.u8) + (emu->op2.u8); + } + CONDITIONAL_SET_FLAG(lo & 0x100, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u8, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op1.u8 & emu->op2.u8) | ((~emu->res.u8) & (emu->op1.u8 | emu->op2.u8)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_adc16: + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x10000, F_CF); + CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op1.u16 & emu->op2.u16) | ((~emu->res.u16) & (emu->op1.u16 | emu->op2.u16)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_adc16b: + if (emu->res.u16 == (emu->op1.u16 + emu->op2.u16)) { + lo = (uint32_t)(emu->op1.u16) + (emu->op2.u16); + } else { + lo = 1 + (uint32_t)(emu->op1.u16) + (emu->op2.u16); + } + CONDITIONAL_SET_FLAG(lo & 0x10000, F_CF); + CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op1.u16 & emu->op2.u16) | ((~emu->res.u16) & (emu->op1.u16 | emu->op2.u16)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_adc32: + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x100000000L, F_CF); + CONDITIONAL_SET_FLAG((emu->res.u32 & 0xffffffff) == 0, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op1.u32 & emu->op2.u32) | ((~emu->res.u32) & (emu->op1.u32 | emu->op2.u32)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_adc32b: + if (emu->res.u32 == (emu->op1.u32 + emu->op2.u32)) { + lo = (emu->op1.u32 & 0xFFFF) + (emu->op2.u32 & 0xFFFF); + } else { + lo = 1 + (emu->op1.u32 & 0xFFFF) + (emu->op2.u32 & 0xFFFF); + } + hi = (lo >> 16) + (emu->op1.u32 >> 16) + (emu->op2.u32 >> 16); + CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op2.u32 & emu->op1.u32) | ((~emu->res.u32) & (emu->op2.u32 | emu->op1.u32)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_adc64: + if (emu->res.u64 == (emu->op1.u64 + emu->op2.u64)) { + lo = (emu->op1.u64 & 0xFFFFFFFF) + (emu->op2.u64 & 0xFFFFFFFF); + } else { + lo = 1 + (emu->op1.u64 & 0xFFFFFFFF) + (emu->op2.u64 & 0xFFFFFFFF); + } + hi = (lo >> 32) + (emu->op1.u64 >> 32) + (emu->op2.u64 >> 32); + CONDITIONAL_SET_FLAG(hi & 0x100000000L, F_CF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + cc = (emu->op2.u64 & emu->op1.u64) | ((~emu->res.u64) & (emu->op2.u64 | emu->op1.u64)); + CONDITIONAL_SET_FLAG(XOR2(cc >> 62), F_OF); + CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); + break; + case d_sbb8: + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); + CONDITIONAL_SET_FLAG((emu->res.u8 & 0xff) == 0, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u8 & (~emu->op1.u8 | emu->op2.u8)) | (~emu->op1.u8 & emu->op2.u8); + CONDITIONAL_SET_FLAG(bc & 0x80, F_CF); + CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_sbb16: + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); + CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u16 & (~emu->op1.u16 | emu->op2.u16)) | (~emu->op1.u16 & emu->op2.u16); + CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); + CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_sbb32: + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u32 & (~emu->op1.u32 | emu->op2.u32)) | (~emu->op1.u32 & emu->op2.u32); + CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF); + CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_sbb64: + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(emu->res.u8), F_PF); + bc = (emu->res.u64 & (~emu->op1.u64 | emu->op2.u64)) | (~emu->op1.u64 & emu->op2.u64); + CONDITIONAL_SET_FLAG(bc & 0x8000000000000000LL, F_CF); + CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF); + CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); + break; + case d_rol8: + if (BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((emu->res.u8 + (emu->res.u8 >> 7)) & 1, F_OF); + else + CONDITIONAL_SET_FLAG(XOR2(emu->op1.u8 >> 6), F_OF); + CONDITIONAL_SET_FLAG(emu->res.u8 & 0x1, F_CF); + break; + case d_rol16: + if (BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((emu->res.u16 + (emu->res.u16 >> 15)) & 1, F_OF); + else + CONDITIONAL_SET_FLAG(XOR2(emu->op1.u16 >> 14), F_OF); + CONDITIONAL_SET_FLAG(emu->res.u16 & 0x1, F_CF); + break; + case d_rol32: + if (BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((emu->res.u32 + (emu->res.u32 >> 31)) & 1, F_OF); + else + CONDITIONAL_SET_FLAG(XOR2(emu->op1.u32 >> 30), F_OF); + CONDITIONAL_SET_FLAG(emu->res.u32 & 0x1, F_CF); + break; + case d_rol64: + if (BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((emu->res.u64 + (emu->res.u64 >> 63)) & 1, F_OF); + else + CONDITIONAL_SET_FLAG(XOR2(emu->op1.u64 >> 62), F_OF); + CONDITIONAL_SET_FLAG(emu->res.u64 & 0x1, F_CF); + break; + case d_ror8: + if (BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG(XOR2(emu->res.u8 >> 6), F_OF); + else + CONDITIONAL_SET_FLAG(((emu->op1.u8 >> 7) ^ emu->op1.u8) & 1, F_OF); + CONDITIONAL_SET_FLAG(emu->res.u8 & (1 << 7), F_CF); + break; + case d_ror16: + if (BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG(XOR2(emu->res.u16 >> 14), F_OF); + else + CONDITIONAL_SET_FLAG(((emu->op1.u16 >> 15) ^ emu->op1.u16) & 1, F_OF); + CONDITIONAL_SET_FLAG(emu->res.u16 & (1 << 15), F_CF); + break; + case d_ror32: + if (BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG(XOR2(emu->res.u32 >> 30), F_OF); + else + CONDITIONAL_SET_FLAG(((emu->op1.u32 >> 31) ^ emu->op1.u32) & 1, F_OF); + CONDITIONAL_SET_FLAG(emu->res.u32 & (1 << 31), F_CF); + break; + case d_ror64: + if (BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG(XOR2(emu->res.u64 >> 62), F_OF); + else + CONDITIONAL_SET_FLAG(((emu->op1.u64 >> 63) ^ emu->op1.u64) & 1, F_OF); + CONDITIONAL_SET_FLAG(emu->res.u64 & (1LL << 63), F_CF); + break; + + case d_unknown: + printf_log(LOG_NONE, "%p trying to evaluate Unknown deferred Flags\n", (void*)R_RIP); + break; + } + RESET_FLAGS(emu); +} + +void free_tlsdatasize(void* p) +{ + if(!p) + return; + tlsdatasize_t *data = (tlsdatasize_t*)p; + actual_free(data->ptr); + actual_free(p); +} + +uintptr_t GetSegmentBaseEmu(x64emu_t* emu, int seg) +{ + if(emu->segs[seg]) { + emu->segs_offs[seg] = (uintptr_t)GetSegmentBase(emu, emu->segs[seg]); + //printf_log(LOG_DEBUG, "%04d|GetSegmentBaseEmu seg=%d(%x), offs=%p\n", GetTID(), seg, emu->segs[seg], (void*)emu->segs_offs[seg]); + } + + return emu->segs_offs[seg]; +} diff --git a/src/emu/x64emu_private.h b/src/emu/x64emu_private.h index bef4a9a..1f4ed2d 100644 --- a/src/emu/x64emu_private.h +++ b/src/emu/x64emu_private.h @@ -2,9 +2,13 @@ #define __X86EMU_PRIVATE_H_ #include "regs.h" +#include "os.h" +#include "box64context.h" -typedef struct box64context_s box64context_t; typedef struct x64_ucontext_s x64_ucontext_t; +#ifdef BOX32 +typedef struct i386_ucontext_s i386_ucontext_t; +#endif #define ERR_UNIMPL 1 #define ERR_DIVBY0 2 @@ -33,28 +37,25 @@ typedef struct x64emu_s x64emu_t; typedef struct x64test_s { x64emu_t* emu; + x64emu_t* ref; uintptr_t memaddr; int memsize; int test; int clean; - int notest; uint8_t mem[32]; } x64test_t; +#define FLAGS_NO_TF 7 typedef struct emu_flags_s { uint32_t need_jmpbuf:1; // need a new jmpbuff for signal handling uint32_t quitonlongjmp:2; // quit if longjmp is called uint32_t quitonexit:2; // quit if exit/_exit is called uint32_t longjmp:1; // if quit because of longjmp uint32_t jmpbuf_ready:1; // the jmpbuf in the emu is ok and don't need refresh + uint32_t no_tf:1; // no TF on current opcode (to manage the delay of application of the flag) } emu_flags_t; -#ifdef ANDROID -#include -#define JUMPBUFF sigjmp_buf -#else -#define JUMPBUFF struct __jmp_buf_tag -#endif +#define N_SCRATCH 200 typedef struct x64emu_s { // cpu @@ -73,7 +74,7 @@ typedef struct x64emu_s { x87control_t cw; uint16_t dummy_cw; // align... mmxcontrol_t mxcsr; - #ifdef RV64 // it would be better to use a dedicated register for this like arm64 xSavedSP, but we're running of of free registers. + #ifdef RV64 // it would be better to use a dedicated register for this like arm64 xSavedSP, but we're running out of free registers. uintptr_t xSPSave; // sp base value of current dynarec frame, used by call/ret optimization to reset stack when unmatch. #endif fpu_ld_t fpu_ld[8]; // for long double emulation / 80bits fld fst @@ -87,15 +88,11 @@ typedef struct x64emu_s { multiuint_t op1; multiuint_t op2; multiuint_t res; - multiuint_t op1_sav; // for dec/inc deferred flags, to be able to compute CF - multiuint_t res_sav; - deferred_flags_t df_sav; uint32_t *x64emu_parity_tab; // helper // segments uint16_t segs[6]; // only 32bits value? uint16_t dummy_seg6, dummy_seg7; // to stay aligned uintptr_t segs_offs[6]; // computed offset associate with segment - uint32_t segs_serial[6]; // are seg offset clean (not 0) or does they need to be re-computed (0)? For GS, serial need to be the same as context->sel_serial // parent context box64context_t *context; // cpu helpers @@ -109,14 +106,17 @@ typedef struct x64emu_s { forkpty_t* forkpty_info; emu_flags_t flags; x64test_t test; // used for dynarec testing + // scratch stack, used for alignment of double and 64bits ints on arm. 200 elements should be enough + __int128_t dummy_align; // here to have scratch 128bits aligned + uint64_t scratch[N_SCRATCH]; + + // Warning, offsetof(x64emu_t, xxx) will be too big for fields below. #ifdef HAVE_TRACE sse_regs_t old_xmm[16]; sse_regs_t old_ymm[16]; reg64_t oldregs[16]; uintptr_t prev2_ip; #endif - // scratch stack, used for alignment of double and 64bits ints on arm. 200 elements should be enough - uint64_t scratch[200]; // local stack, do be deleted when emu is freed void* stack2free; // this is the stack to free (can be NULL) void* init_stack; // initial stack (owned or not) @@ -126,9 +126,30 @@ typedef struct x64emu_s { uintptr_t old_savedsp; #endif - x64_ucontext_t *uc_link; // to handle setcontext - + #ifdef _WIN32 + uint64_t win64_teb; + #endif + // local selector handling + base_segment_t segldt[16]; + base_segment_t seggdt[16]; // hacky + tlsdatasize_t *tlsdata; + // other informations int type; // EMUTYPE_xxx define + #ifdef BOX32 + int libc_err; // copy of errno from libc + int libc_herr; // copy of h_errno from libc + unsigned short libctype[384]; // copy from __ctype_b address might be too high + const unsigned short* ref_ctype; + const unsigned short* ctype; + int libctolower[384]; // copy from __ctype_b_tolower address might be too high + const int* ref_tolower; + const int* tolower; + int libctoupper[384]; // copy from __ctype_b_toupper address might be too high + const int* ref_toupper; + const int* toupper; + void* res_state_32; //32bits version of res_state + void* res_state_64; + #endif } x64emu_t; #define EMUTYPE_NONE 0 diff --git a/src/emu/x64int3.c b/src/emu/x64int3.c index 3dd818e..764b89d 100644 --- a/src/emu/x64int3.c +++ b/src/emu/x64int3.c @@ -6,27 +6,28 @@ #include #include #include -#include #include #include -#include #include #include #include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" +#include "box64cpu.h" #include "x64emu_private.h" #include "x64run_private.h" +#include "x64int_private.h" #include "x87emu_private.h" #include "x64primop.h" #include "x64trace.h" #include "wrapper.h" #include "box64context.h" #include "librarian.h" -#include "signals.h" +#include "emit_signals.h" #include "tools/bridge_private.h" #include @@ -58,7 +59,7 @@ x64emu_t* x64emu_fork(x64emu_t* emu, int forktype) // error... } else if(v!=0) { // execute atforks parent functions - for (int i=0; iatfork_sz; --i) + for (int i=0; iatfork_sz; ++i) if(my_context->atforks[i].parent) EmuCall(emu, my_context->atforks[i].parent); if(forktype==3) { @@ -66,9 +67,8 @@ x64emu_t* x64emu_fork(x64emu_t* emu, int forktype) waitpid(v, NULL, WEXITED); } } else if(v==0) { - ResetSegmentsCache(emu); // execute atforks child functions - for (int i=0; iatfork_sz; --i) + for (int i=0; iatfork_sz; ++i) if(my_context->atforks[i].child) EmuCall(emu, my_context->atforks[i].child); } @@ -76,6 +76,22 @@ x64emu_t* x64emu_fork(x64emu_t* emu, int forktype) return emu; } + +void print_wrapper_name(int level, x64emu_t* emu) +{ + onebridge_t* bridge = (onebridge_t*)(R_RIP&~(sizeof(onebridge_t)-1)); + if (IsBridgeSignature(bridge->S, bridge->C)) { + const char* name = NULL; + if(bridge->func) + name = GetNativeName(bridge->name_or_func); + else + name = bridge->name_or_func; + printf_log(level, "calling %s\n", name?name:"????"); + } else { + printf_log(level, "Could found the function name for fnc=%p\n", bridge->f); + } +} + static uint64_t F64(uintptr_t* addr) { uint64_t ret = *(uint64_t*)*addr; *addr+=8; @@ -86,11 +102,24 @@ static uint8_t Peek8(uintptr_t addr, uintptr_t offset) return *(uint8_t*)(addr+offset); } +void x64Print(x64emu_t* emu, char* buff, size_t buffsz, const char* func, int tid, wrapper_t w); + +static void concatString(char* buff, int len, void* s, const char* trail) +{ + char tmp[len]; + if(!s) snprintf(tmp, len-1, "%p%s", s, trail); + else snprintf(tmp, len-1, "%p\"%s\"%s", s, (char*)s, trail); + strncat(buff, tmp, len); +} + void x64Int3(x64emu_t* emu, uintptr_t* addr) { + if(box64_is32bits) { + x86Int3(emu,addr); + return; + } onebridge_t* bridge = (onebridge_t*)(*addr-1); - if(Peek8(*addr, 0)=='S' && Peek8(*addr, 1)=='C') // Signature for "Out of x86 door" - { + if (IsBridgeSignature(bridge->S, bridge->C)) { // Signature for "Out of x86 door" *addr += 2; uintptr_t a = F64(addr); if(a==0) { @@ -102,21 +131,22 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) wrapper_t w = bridge->w; a = F64(addr); R_RIP = *addr; - /* This party can be used to trace only 1 specific lib (but it is quite slow) + /* This part can be used to trace only 1 specific lib (but it is quite slow) elfheader_t *h = FindElfAddress(my_context, *(uintptr_t*)(R_ESP)); int have_trace = 0; if(h && strstr(ElfName(h), "libMiles")) have_trace = 1;*/ - if(box64_log>=LOG_DEBUG || cycle_log) { + if(BOX64ENV(log)>=LOG_DEBUG || BOX64ENV(rolling_log)) { + int e = errno; int tid = GetTID(); char t_buff[256] = "\0"; char buff2[64] = "\0"; char buff3[64] = "\0"; int cycle_line = my_context->current_line; - if(cycle_log) { - my_context->current_line = (my_context->current_line+1)%cycle_log; + if(BOX64ENV(rolling_log)) { + my_context->current_line = (my_context->current_line+1)%BOX64ENV(rolling_log); } - char* buff = cycle_log?my_context->log_call[cycle_line]:t_buff; - char* buffret = cycle_log?my_context->log_ret[cycle_line]:NULL; + char* buff = BOX64ENV(rolling_log)?(my_context->log_call+256*cycle_line):t_buff; + char* buffret = BOX64ENV(rolling_log)?(my_context->log_ret+128*cycle_line):NULL; if(buffret) buffret[0] = '\0'; char *tmp; int post = 0; @@ -124,17 +154,18 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) uint64_t *pu64 = NULL; uint32_t *pu32 = NULL; uint8_t *pu8 = NULL; - const char *s = bridge->name; + const char *s = (bridge->func)?GetNativeName(bridge->name_or_func):bridge->name_or_func; if(!s) s = GetNativeName((void*)a); - if(a==(uintptr_t)PltResolver) { - if(cycle_log) { + if(a==(uintptr_t)PltResolver64) { + post = 100; + if(BOX64ENV(rolling_log)) { uintptr_t addr = *((uint64_t*)(R_RSP)); int slot = *((uint64_t*)(R_RSP+8)); elfheader_t *h = (elfheader_t*)addr; Elf64_Rela * rel = (Elf64_Rela *)(h->jmprel + h->delta) + slot; - Elf64_Sym *sym = &h->DynSym[ELF64_R_SYM(rel->r_info)]; - const char* symname = SymName(h, sym); + Elf64_Sym *sym = &h->DynSym._64[ELF64_R_SYM(rel->r_info)]; + const char* symname = SymName64(h, sym); snprintf(buff, 256, "%04d|PltResolver \"%s\"", tid, symname?symname:"???"); } else { snprintf(buff, 256, "%s", " ... "); @@ -153,7 +184,7 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) perr = 2; } else if (!strcmp(s, "__openat64") || !strcmp(s, "openat64") || !strcmp(s, "__openat64_2")) { tmp = (char*)(R_RSI); - snprintf(buff, 256, "%04d|%p: Calling %s(%d, \"%s\", %d (,%d))", tid, *(void**)(R_RSP), s, (int)R_EDI, (tmp)?tmp:"(nil)", (int)(R_EDX), (int)(R_ECX)); + snprintf(buff, 256, "%04d|%p: Calling %s(%d, \"%s\", %d (,%d))", tid, *(void**)(R_RSP), s, S_EDI, (tmp)?tmp:"(nil)", (int)(R_EDX), (int)(R_ECX)); perr = 1; } else if (!strcmp(s, "readlink")) { tmp = (char*)(R_RDI); @@ -171,6 +202,11 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) tmp = (char*)(R_RDI); snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)"); perr = 2; + } else if (strstr(s, "popen")==s) { + tmp = (char*)(R_RDI); + char* tmp2 = (char*)(R_RSI); + snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)", (tmp2)?tmp2:"nil"); + perr = 5; } else if (!strcmp(s, "read") || !strcmp(s, "my_read")) { snprintf(buff, 256, "%04d|%p: Calling %s(%d, %p, %zu)", tid, *(void**)(R_RSP), s, R_EDI, (void*)R_RSI, R_RDX); pu8 = (uint8_t*)R_RSI; @@ -191,11 +227,14 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) snprintf(buff, 256, "%04d|%p: Calling %s(%d, %p, %d)", tid, *(void**)(R_RSP), s, R_EDI, pu32, R_EDX); perr = 1; post = 6; + } else if (!strcmp(s, "ioctl")) { + snprintf(buff, 256, "%04d|%p: Calling %s(%d, 0x%x, %p)", tid, *(void**)(R_RSP), s, S_EDI, R_ESI, (void*)R_RDX); + perr = 1; } else if (!strcmp(s, "lseek64")) { - snprintf(buff, 256, "%04d|%p: Calling %s(%d, %ld, %d)", tid, *(void**)(R_RSP), s, (int)R_EDI, (int64_t)R_RSI, (int)R_EDX); + snprintf(buff, 256, "%04d|%p: Calling %s(%d, %ld, %d)", tid, *(void**)(R_RSP), s, S_EDI, (int64_t)R_RSI, S_EDX); perr = 1; } else if (!strcmp(s, "lseek")) { - snprintf(buff, 256, "%04d|%p: Calling %s(%d, %ld, %d)", tid, *(void**)(R_RSP), s, (int)R_EDI, (int64_t)R_RSI, (int)R_EDX); + snprintf(buff, 256, "%04d|%p: Calling %s(%d, %ld, %d)", tid, *(void**)(R_RSP), s, S_EDI, (int64_t)R_RSI, S_EDX); perr = 1; } else if (!strcmp(s, "recvmsg")) { snprintf(buff, 256, "%04d|%p: Calling %s(%d, %p, 0x%x)", tid, *(void**)(R_RSP), s, R_EDI, (void*)R_RSI, R_EDX); @@ -206,9 +245,15 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) } else if (!strcmp(s, "fgetxattr")) { snprintf(buff, 256, "%04d|%p: Calling %s(%d, \"%s\", %p, 0x%zx)", tid, *(void**)(R_RSP), s, R_EDI, (char*)R_RSI, (void*)R_RDX, R_RCX); perr = 1; + } else if (!strcmp(s, "connect")) { + snprintf(buff, 256, "%04d|%p: Calling %s(%d, %p, %d)", tid, *(void**)(R_RSP), s, R_EDI, (void*)R_RSI, R_EDX); + perr = 1; } else if (strstr(s, "puts")==s) { tmp = (char*)(R_RDI); snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)"); + } else if (!strcmp(s, "syscall")) { + snprintf(buff, 256, "%04d|%p: Calling %s(%d, %p, %p....)", tid, *(void**)(R_RSP), s, S_EDI, (void*)R_RSI, (void*)R_RDX); + perr = 1; } else if (strstr(s, "strlen")==s) { tmp = (char*)(R_RDI); snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)"); @@ -221,6 +266,10 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)"); } else if (strstr(s, "setenv")==s) { snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\", \"%s\", %d)", tid, *(void**)(R_RSP), s, (char*)R_RDI, (char*)R_RSI, R_EDX); + } else if (strstr(s, "unsetenv")==s) { + snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (char*)R_RDI); + } else if (strstr(s, "putenv")==s) { + snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (char*)R_RDI); } else if (!strcmp(s, "poll")) { struct pollfd* pfd = (struct pollfd*)(R_RDI); snprintf(buff, 256, "%04d|%p: Calling %s(%p[%d/%d/%d, ...], %d, %d)", tid, *(void**)(R_RSP), s, pfd, pfd->fd, pfd->events, pfd->revents, R_ESI, R_EDX); @@ -249,6 +298,8 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) } else if (!strcmp(s, "vfprintf") || !strcmp(s, "my_vfprintf")) { tmp = (char*)((R_RSI>2)?R_RSI:R_RDX); snprintf(buff, 256, "%04d|%p: Calling %s(%p, \"%s\", ...)", tid, *(void**)(R_RSP), s, (void*)R_RDI, (tmp)?tmp:"(nil)"); + } else if (!strcmp(s, "g_source_set_name")) { + snprintf(buff, 256, "%04d|%p: Calling %s(%p, \"%s\")", tid, *(void**)(R_RSP), s, (void*)R_RDI, (char*)R_RSI); } else if (!strcmp(s, "getcwd")) { post = 2; snprintf(buff, 256, "%04d|%p: Calling %s(%p, %zu)", tid, *(void**)(R_RSP), s, (void*)R_RDI, R_RSI); @@ -256,6 +307,15 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) tmp = (char*)(R_RDI); perr = 1; snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\", %d)", tid, *(void**)(R_RSP), s, tmp?tmp:"nil", R_ESI); + } else if (!strcmp(s, "dbus_message_new_method_call")) { + snprintf(buff, 256, "%04d|%p: Calling %s(", tid, *(void**)(R_RSP), s); + concatString(buff, 256, (void*)R_RDI, ", "); + concatString(buff, 256, (void*)R_RSI, ", "); + concatString(buff, 256, (void*)R_RDX, ", "); + concatString(buff, 256, (void*)R_RCX,")"); + } else if (!strcmp(s, "xcb_wait_for_event") || !strcmp(s, "xcb_poll_for_queued_event") || !strcmp(s, "xcb_poll_for_event")) { + post = 9; + snprintf(buff, 256, "%04d|%p: Calling %s(%p)", tid, *(void**)(R_RSP), s, (void*)R_RDI); } else if (!strcmp(s, "glXGetProcAddress") || !strcmp(s, "SDL_GL_GetProcAddress") || !strcmp(s, "glXGetProcAddressARB")) { tmp = (char*)(R_RDI); snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)"); @@ -282,8 +342,8 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) } else if (!strcmp(s, "ov_read")) { snprintf(buff, 256, "%04d|%p: Calling %s(%p, %p, %d, %d, %d, %d, %p)", tid, *(void**)(R_RSP), s, (void*)R_RDI, (void*)R_RSI, R_EDX, R_ECX, R_R8d, R_R9d, *(void**)(R_RSP+8)); } else if (!strcmp(s, "mmap64") || !strcmp(s, "mmap")) { - snprintf(buff, 256, "%04d|%p: Calling %s(%p, 0x%lx, 0x%x, 0x%x, %d, %ld)", tid, *(void**)(R_RSP), s, - (void*)R_RDI, R_RSI, (int)(R_RDX), (int)R_RCX, (int)R_R8, R_R9); + snprintf(buff, 256, "%04d|%p: Calling %s(%p, 0x%lx, 0x%x, 0x%x, %d, %ld)", tid, *(void**)(R_RSP), s, + (void*)R_RDI, R_RSI, (int)(R_RDX), (int)(S_RCX), (int)(S_R8), R_R9); perr = 3; } else if (!strcmp(s, "sscanf")) { tmp = (char*)(R_RSI); @@ -291,10 +351,18 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) } else if (!strcmp(s, "__isoc99_fscanf")) { tmp = (char*)(R_RSI); snprintf(buff, 256, "%04d|%p: Calling %s(%p, \"%s\" (,%p))", tid, *(void**)(R_RSP), s, (void*)R_RDI, (tmp)?tmp:"(nil)", (void*)(R_RDX)); + } else if (!strcmp(s, "inotify_add_watch")) { + tmp = (char*)(R_RSI); + snprintf(buff, 256, "%04d|%p: Calling %s(%d, \"%s\" , 0x%x)", tid, *(void**)(R_RSP), s, R_EDI, (tmp)?tmp:"(nil)", R_EDX); + perr = 1; + } else if (!strcmp(s, "__xstat64")) { + tmp = (char*)(R_RSI); + snprintf(buff, 256, "%04d|%p: Calling %s(%d, \"%s\" , %p)", tid, *(void**)(R_RSP), s, R_EDI, (tmp)?tmp:"(nil)", (void*)R_RDX); + perr = 1; } else if (!strcmp(s, "XCreateWindow")) { tmp = (char*)(R_RSI); snprintf(buff, 256, "%04d|%p: Calling %s(%p, %p, %d, %d, %u, %u, %u, %d, %u, %p, 0x%lx, %p)", tid, *(void**)(R_RSP), s, - (void*)R_RDI, (void*)R_RSI, (int)R_EDX, (int)R_ECX, R_R8d, R_R9d, + (void*)R_RDI, (void*)R_RSI, S_EDX, S_ECX, R_R8d, R_R9d, (uint32_t)*(uint64_t*)(R_RSP+8), (int)*(uint64_t*)(R_RSP+16), (uint32_t)*(uint64_t*)(R_RSP+24), (void*)*(uint64_t*)(R_RSP+32), (unsigned long)*(uint64_t*)(R_RSP+40), (void*)*(uint64_t*)(R_RSP+48)); @@ -302,15 +370,20 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) pu32 = (uint32_t*)(R_RDI); post = 7; snprintf(buff, 256, "%04d|%p: Calling %s(%p, 0x%X)", tid, *(void**)(R_RSP), s, (void*)R_RDI, R_ESI); + } else if(!strcmp(s, "__errno_location")) { + snprintf(buff, 255, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), s); + perr = 4; } else { - snprintf(buff, 256, "%04d|%p: Calling %s(0x%lX, 0x%lX, 0x%lX, ...)", tid, *(void**)(R_RSP), s, R_RDI, R_RSI, R_RDX); + x64Print(emu, buff, 256, s, tid, w); } - if(!cycle_log) { + if(!BOX64ENV(rolling_log)) { mutex_lock(&emu->context->mutex_trace); - printf_log(LOG_NONE, "%s =>", buff); + printf_log_prefix(0, LOG_NONE, "%s =>", buff); mutex_unlock(&emu->context->mutex_trace); } + errno = e; w(emu, a); // some function never come back, so unlock the mutex first! + e = errno; if(post) switch(post) { // Only ever 2 for now... case 1: snprintf(buff2, 64, " [%llu sec %llu nsec]", pu64?pu64[0]:~0ull, pu64?pu64[1]:~0ull); @@ -344,49 +417,71 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) snprintf(buff2, 64, "[%s%s] ", buff5, (n==S_EAX)?"":"..."); } break; + case 9: if(R_RAX) { + uint8_t type = *(uint8_t*)(R_RAX); + snprintf(buff2, 64, "[type=%d]", type); + } + break; + case 100: + snprintf(buff2, 64, "[function: %p]", (void*)R_RIP); + break; } - if(perr==1 && ((int)R_EAX)<0) - snprintf(buff3, 64, " (errno=%d:\"%s\")", errno, strerror(errno)); + if(perr==1 && (S_EAX)<0) + snprintf(buff3, 64, " (errno=%d:\"%s\")", e, strerror(e)); else if(perr==2 && R_EAX==0) - snprintf(buff3, 64, " (errno=%d:\"%s\")", errno, strerror(errno)); - else if(perr==3 && ((int64_t)R_RAX)==-1) - snprintf(buff3, 64, " (errno=%d:\"%s\")", errno, strerror(errno)); + snprintf(buff3, 64, " (errno=%d:\"%s\")", e, strerror(e)); + else if(perr==3 && (S_RAX)==-1) + snprintf(buff3, 64, " (errno=%d:\"%s\")", e, strerror(e)); + else if(perr==4) + snprintf(buff3, 64, " (errno=%d:\"%s\")", e, strerror(e)); + else if(perr==5 && R_RAX==0) + snprintf(buff3, 64, " (errno=%d:\"%s\")", e, strerror(e)); - if(cycle_log) - snprintf(buffret, 128, "0x%lX%s%s", R_RAX, buff2, buff3); + if(BOX64ENV(rolling_log)) + snprintf(buffret, 127, "0x%lX%s%s", R_RAX, buff2, buff3); else { mutex_lock(&emu->context->mutex_trace); - printf_log(LOG_NONE, " return 0x%lX%s%s\n", R_RAX, buff2, buff3); + printf_log_prefix(0, LOG_NONE, " return 0x%lX%s%s\n", R_RAX, buff2, buff3); mutex_unlock(&emu->context->mutex_trace); } + errno = e; } else w(emu, a); } return; } - if(!box64_ignoreint3 && my_context->signals[SIGTRAP]) - emit_signal(emu, SIGTRAP, (void*)R_RIP, 128); - else { + if(Peek8(*addr, -1)!=0xCC) { + // why this happens?! + printf_log(LOG_DEBUG, "%04d|Warning, x64int3 with no CC opcode at %p?\n", GetTID(), (void*)R_RIP); + return; + } + if(!BOX64ENV(ignoreint3) && my_context->signals[X64_SIGTRAP]) { + R_RIP = *addr; // update RIP + EmitSignal(emu, X64_SIGTRAP, NULL, 3); + } else { printf_log(LOG_DEBUG, "%04d|Warning, ignoring unsupported Int 3 call @%p\n", GetTID(), (void*)R_RIP); R_RIP = *addr; } //emu->quit = 1; } -int GetTID() -{ - return syscall(SYS_gettid); -} - -void print_cycle_log(int loglevel) { - if(cycle_log) { - printf_log(LOG_INFO, "Last calls\n"); - int j = (my_context->current_line+1)%cycle_log; - for (int i=0; ilog_call[k][0]) { - printf_log(loglevel, "%s => return %s\n", my_context->log_call[k], my_context->log_ret[k]); +void print_rolling_log(int loglevel) { + if(BOX64ENV(rolling_log)) { + printf_log(loglevel, "Last calls\n"); + int j = (my_context->current_line+1)%BOX64ENV(rolling_log); + for (int i=0; ilog_call[256*k+0]) { + printf_log(loglevel, "%s => return %s\n", my_context->log_call+256*k, my_context->log_ret+128*k); } } } -} \ No newline at end of file +} + +#ifndef BOX32 +void x86Int3(x64emu_t* emu, uintptr_t* addr) +{ + printf_log(LOG_NONE, "Error: Calling 32bits wrapped function without box32 support built in\n"); + abort(); +} +#endif diff --git a/src/emu/x64int_private.h b/src/emu/x64int_private.h new file mode 100644 index 0000000..3cb3030 --- /dev/null +++ b/src/emu/x64int_private.h @@ -0,0 +1,11 @@ +#ifndef __X64INT_PRIVATE_H_ +#define __X64INT_PRIVATE_H_ + +void x64Syscall(x64emu_t *emu); +void x64Syscall_linux(x64emu_t *emu); +void x64Int3(x64emu_t* emu, uintptr_t* addr); +x64emu_t* x64emu_fork(x64emu_t* e, int forktype); +void x86Syscall(x64emu_t *emu); //32bits syscall +void x86Int3(x64emu_t* emu, uintptr_t* addr); + +#endif // __X64INT_PRIVATE_H_ diff --git a/src/emu/x64primop.c b/src/emu/x64primop.c index 72485ca..74bc3f9 100644 --- a/src/emu/x64primop.c +++ b/src/emu/x64primop.c @@ -103,6 +103,9 @@ #include "x64emu_private.h" #include "x64run_private.h" +#include "env.h" + +extern box64env_t box64env; /*------------------------- Global Variables ------------------------------*/ @@ -189,7 +192,7 @@ Implements the AAM instruction and side effects. ****************************************************************************/ uint16_t aam16(x64emu_t *emu, uint8_t d, uint8_t base) { - uint16_t h, l; + uint16_t h, l; RESET_FLAGS(emu); @@ -203,7 +206,7 @@ uint16_t aam16(x64emu_t *emu, uint8_t d, uint8_t base) CONDITIONAL_SET_FLAG(l & 0x80, F_SF); CONDITIONAL_SET_FLAG((l&0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF); - return l; + return l; } /**************************************************************************** @@ -352,7 +355,7 @@ uint16_t cmp16(x64emu_t *emu, uint16_t d, uint16_t s) CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ - bc = (res & (~d | s)) | (~d & s); + bc = (res & (~d | s)) | (~d & s); CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); @@ -458,70 +461,74 @@ Implements the RCL instruction and side effects. ****************************************************************************/ uint8_t rcl8(x64emu_t *emu, uint8_t d, uint8_t s) { - unsigned int res, cnt, mask, cf; + unsigned int res, cnt, mask, cf; CHECK_FLAGS(emu); s = s&0x1f; - /* s is the rotate distance. It varies from 0 - 8. */ + /* s is the rotate distance. It varies from 0 - 8. */ /* have - CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0 + CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0 - want to rotate through the carry by "s" bits. We could - loop, but that's inefficient. So the width is 9, - and we split into three parts: + want to rotate through the carry by "s" bits. We could + loop, but that's inefficient. So the width is 9, + and we split into three parts: - The new carry flag (was B_n) - the stuff in B_n-1 .. B_0 - the stuff in B_7 .. B_n+1 + The new carry flag (was B_n) + the stuff in B_n-1 .. B_0 + the stuff in B_7 .. B_n+1 - The new rotate is done mod 9, and given this, - for a rotation of n bits (mod 9) the new carry flag is - then located n bits from the MSB. The low part is - then shifted up cnt bits, and the high part is or'd - in. Using CAPS for new values, and lowercase for the - original values, this can be expressed as: + The new rotate is done mod 9, and given this, + for a rotation of n bits (mod 9) the new carry flag is + then located n bits from the MSB. The low part is + then shifted up cnt bits, and the high part is or'd + in. Using CAPS for new values, and lowercase for the + original values, this can be expressed as: - IF n > 0 - 1) CF <- b_(8-n) - 2) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 - 3) B_(n-1) <- cf - 4) B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1)) + IF n > 0 + 1) CF <- b_(8-n) + 2) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 + 3) B_(n-1) <- cf + 4) B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1)) */ res = d; if ((cnt = s % 9) != 0) { - /* extract the new CARRY FLAG. */ - /* CF <- b_(8-n) */ - cf = (d >> (8 - cnt)) & 0x1; - - /* get the low stuff which rotated - into the range B_7 .. B_cnt */ - /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 */ - /* note that the right hand side done by the mask */ + /* extract the new CARRY FLAG. */ + /* CF <- b_(8-n) */ + cf = (d >> (8 - cnt)) & 0x1; + + /* get the low stuff which rotated + into the range B_7 .. B_cnt */ + /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 */ + /* note that the right hand side done by the mask */ res = (d << cnt) & 0xff; - /* now the high stuff which rotated around - into the positions B_cnt-2 .. B_0 */ - /* B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1)) */ - /* shift it downward, 7-(n-2) = 9-n positions. - and mask off the result before or'ing in. - */ - mask = (1 << (cnt - 1)) - 1; - res |= (d >> (9 - cnt)) & mask; + /* now the high stuff which rotated around + into the positions B_cnt-2 .. B_0 */ + /* B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1)) */ + /* shift it downward, 7-(n-2) = 9-n positions. + and mask off the result before or'ing in. + */ + mask = (1 << (cnt - 1)) - 1; + res |= (d >> (9 - cnt)) & mask; - /* if the carry flag was set, or it in. */ + /* if the carry flag was set, or it in. */ if (ACCESS_FLAG(F_CF)) { /* carry flag is set */ - /* B_(n-1) <- cf */ - res |= 1 << (cnt - 1); - } - /* set the new carry flag, based on the variable "cf" */ + /* B_(n-1) <- cf */ + res |= 1 << (cnt - 1); + } + /* set the new carry flag, based on the variable "cf" */ CONDITIONAL_SET_FLAG(cf, F_CF); - /* OVERFLOW is set *IFF* cnt==1, then it is the - xor of CF and the most significant bit. Blecck. */ - if(cnt == 1) - CONDITIONAL_SET_FLAG((cf ^ (res >> 7)) & 0x1, F_OF); - - } + /* OVERFLOW is set *IFF* cnt==1, then it is the + xor of CF and the most significant bit. Blecck. */ + if(BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((cf ^ (res >> 7)) & 0x1, F_OF); + else + CONDITIONAL_SET_FLAG((XOR2(d >> 6)), F_OF); + } else if(s) { + if(BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((ACCESS_FLAG(F_CF) ^ (res >> 7)) & 0x1, F_OF); + } return (uint8_t)res; } @@ -541,8 +548,14 @@ uint16_t rcl16(x64emu_t *emu, uint16_t d, uint8_t s) res |= 1 << (cnt - 1); } CONDITIONAL_SET_FLAG(cf, F_CF); - if(cnt == 1) - CONDITIONAL_SET_FLAG((cf ^ (res >> 15)) & 0x1, F_OF); + if(BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((cf ^ (res >> 15)) & 0x1, F_OF); + else + CONDITIONAL_SET_FLAG((XOR2(d >> 14)), F_OF); + } else if(s) { + res = d; + if(BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((ACCESS_FLAG(F_CF) ^ (res >> 15)) & 0x1, F_OF); } return (uint16_t)res; } @@ -563,8 +576,10 @@ uint32_t rcl32(x64emu_t *emu, uint32_t d, uint8_t s) res |= 1 << (cnt - 1); } CONDITIONAL_SET_FLAG(cf, F_CF); - if(cnt == 1) - CONDITIONAL_SET_FLAG((cf ^ (res >> 31)) & 0x1, F_OF); + if(BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((cf ^ (res >> 31)) & 0x1, F_OF); + else + CONDITIONAL_SET_FLAG((XOR2(d >> 30)), F_OF); } return res; } @@ -585,8 +600,10 @@ uint64_t rcl64(x64emu_t *emu, uint64_t d, uint8_t s) res |= 1LL << (cnt - 1); } CONDITIONAL_SET_FLAG(cf, F_CF); - if(cnt == 1) - CONDITIONAL_SET_FLAG((cf ^ (res >> 63)) & 0x1, F_OF); + if(BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((cf ^ (res >> 63)) & 0x1, F_OF); + else + CONDITIONAL_SET_FLAG((XOR2(d >> 62)), F_OF); } return res; } @@ -602,75 +619,78 @@ uint8_t rcr8(x64emu_t *emu, uint8_t d, uint8_t s) s = s&0x1f; /* rotate right through carry */ - /* - s is the rotate distance. It varies from 0 - 8. - d is the byte object rotated. - - have - - CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0 - - The new rotate is done mod 9, and given this, - for a rotation of n bits (mod 9) the new carry flag is - then located n bits from the LSB. The low part is - then shifted up cnt bits, and the high part is or'd - in. Using CAPS for new values, and lowercase for the - original values, this can be expressed as: - - IF n > 0 - 1) CF <- b_(n-1) - 2) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n) - 3) B_(8-n) <- cf - 4) B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0) + /* + s is the rotate distance. It varies from 0 - 8. + d is the byte object rotated. + + have + + CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0 + + The new rotate is done mod 9, and given this, + for a rotation of n bits (mod 9) the new carry flag is + then located n bits from the LSB. The low part is + then shifted up cnt bits, and the high part is or'd + in. Using CAPS for new values, and lowercase for the + original values, this can be expressed as: + + IF n > 0 + 1) CF <- b_(n-1) + 2) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n) + 3) B_(8-n) <- cf + 4) B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0) */ res = d; if ((cnt = s % 9) != 0) { - /* extract the new CARRY FLAG. */ - /* CF <- b_(n-1) */ - if (cnt == 1) { - cf = d & 0x1; - /* note hackery here. Access_flag(..) evaluates to either - 0 if flag not set - non-zero if flag is set. - doing access_flag(..) != 0 casts that into either + /* extract the new CARRY FLAG. */ + /* CF <- b_(n-1) */ + ocf = ACCESS_FLAG(F_CF) != 0; + /* OVERFLOW is set *IFF* cnt==1, then it is the + xor of CF and the most significant bit. Blecck. */ + /* parenthesized... */ + if(!BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((ocf ^ (d >> 7)) & 0x1, F_OF); + if (cnt == 1) { + cf = d & 0x1; + /* note hackery here. Access_flag(..) evaluates to either + 0 if flag not set + non-zero if flag is set. + doing access_flag(..) != 0 casts that into either 0..1 in any representation of the flags register - (i.e. packed bit array or unpacked.) - */ - ocf = ACCESS_FLAG(F_CF) != 0; - /* OVERFLOW is set *IFF* cnt==1, then it is the - xor of CF and the most significant bit. Blecck. */ - /* parenthesized... */ - CONDITIONAL_SET_FLAG((ocf ^ (d >> 7)) & 0x1, - F_OF); - } else - cf = (d >> (cnt - 1)) & 0x1; - - /* B_(8-(n+1)) .. B_(0) <- b_(7) .. b_n */ - /* note that the right hand side done by the mask - This is effectively done by shifting the - object to the right. The result must be masked, - in case the object came in and was treated - as a negative number. Needed??? */ - - mask = (1 << (8 - cnt)) - 1; - res = (d >> cnt) & mask; - - /* now the high stuff which rotated around - into the positions B_cnt-2 .. B_0 */ - /* B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0) */ - /* shift it downward, 7-(n-2) = 9-n positions. - and mask off the result before or'ing in. - */ - res |= (d << (9 - cnt)); - - /* if the carry flag was set, or it in. */ + (i.e. packed bit array or unpacked.) + */ + } else + cf = (d >> (cnt - 1)) & 0x1; + + /* B_(8-(n+1)) .. B_(0) <- b_(7) .. b_n */ + /* note that the right hand side done by the mask + This is effectively done by shifting the + object to the right. The result must be masked, + in case the object came in and was treated + as a negative number. Needed??? */ + + mask = (1 << (8 - cnt)) - 1; + res = (d >> cnt) & mask; + + /* now the high stuff which rotated around + into the positions B_cnt-2 .. B_0 */ + /* B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0) */ + /* shift it downward, 7-(n-2) = 9-n positions. + and mask off the result before or'ing in. + */ + res |= (d << (9 - cnt)); + + /* if the carry flag was set, or it in. */ if (ACCESS_FLAG(F_CF)) { /* carry flag is set */ - /* B_(8-n) <- cf */ - res |= 1 << (8 - cnt); - } - /* set the new carry flag, based on the variable "cf" */ + /* B_(8-n) <- cf */ + res |= 1 << (8 - cnt); + } + /* set the new carry flag, based on the variable "cf" */ CONDITIONAL_SET_FLAG(cf, F_CF); + } + if(s && BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((XOR2(res >> 6)), F_OF); return (uint8_t)res; } @@ -684,11 +704,11 @@ uint16_t rcr16(x64emu_t *emu, uint16_t d, uint8_t s) /* rotate right through carry */ res = d; if ((cnt = s % 17) != 0) { + ocf = ACCESS_FLAG(F_CF) != 0; + if(!BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((ocf ^ (d >> 15)) & 0x1, F_OF); if (cnt == 1) { cf = d & 0x1; - ocf = ACCESS_FLAG(F_CF) != 0; - CONDITIONAL_SET_FLAG((ocf ^ (d >> 15)) & 0x1, - F_OF); } else cf = (d >> (cnt - 1)) & 0x1; mask = (1 << (16 - cnt)) - 1; @@ -699,6 +719,8 @@ uint16_t rcr16(x64emu_t *emu, uint16_t d, uint8_t s) } CONDITIONAL_SET_FLAG(cf, F_CF); } + if(s && BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((XOR2(res >> 14)), F_OF); return (uint16_t)res; } @@ -712,13 +734,14 @@ uint32_t rcr32(x64emu_t *emu, uint32_t d, uint8_t s) /* rotate right through carry */ res = d; if ((cnt = s) != 0) { + ocf = ACCESS_FLAG(F_CF) != 0; + if(!BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((ocf ^ (d >> 31)) & 0x1, F_OF); if (cnt == 1) { cf = d & 0x1; - ocf = ACCESS_FLAG(F_CF) != 0; - CONDITIONAL_SET_FLAG((ocf ^ (d >> 31)) & 0x1, - F_OF); - } else + } else { cf = (d >> (cnt - 1)) & 0x1; + } mask = (1 << (32 - cnt)) - 1; res = (d >> cnt) & mask; if (cnt != 1) @@ -728,6 +751,8 @@ uint32_t rcr32(x64emu_t *emu, uint32_t d, uint8_t s) } CONDITIONAL_SET_FLAG(cf, F_CF); } + if(s && BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((XOR2(res >> 30)), F_OF); return res; } @@ -741,13 +766,14 @@ uint64_t rcr64(x64emu_t *emu, uint64_t d, uint8_t s) /* rotate right through carry */ res = d; if ((cnt = s) != 0) { + ocf = ACCESS_FLAG(F_CF) != 0; + if(!BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((ocf ^ (d >> 63)) & 0x1, F_OF); if (cnt == 1) { cf = d & 0x1; - ocf = ACCESS_FLAG(F_CF) != 0; - CONDITIONAL_SET_FLAG((ocf ^ (d >> 63)) & 0x1, - F_OF); - } else + } else { cf = (d >> (cnt - 1)) & 0x1; + } mask = (1LL << (64 - cnt)) - 1; res = (d >> cnt) & mask; if (cnt != 1) @@ -757,6 +783,8 @@ uint64_t rcr64(x64emu_t *emu, uint64_t d, uint8_t s) } CONDITIONAL_SET_FLAG(cf, F_CF); } + if(s && BOX64ENV(cputype)) + CONDITIONAL_SET_FLAG((XOR2(res >> 62)), F_OF); return res; } /**************************************************************************** @@ -769,16 +797,16 @@ uint8_t rol8(x64emu_t *emu, uint8_t d, uint8_t s) s = s&0x1f; if(!s) return d; + CHECK_FLAGS(emu); + /* OF flag is set if s == 1; OF = CF _XOR_ MSB of result */ + + if(!BOX64ENV(cputype)) CONDITIONAL_SET_FLAG(XOR2(d>>6), F_OF); if((cnt = s % 8) != 0) { d = (d << cnt) + ((d >> (8 - cnt)) & ((1 << cnt) - 1)); } - CHECK_FLAGS(emu); - /* OF flag is set if s == 1; OF = CF _XOR_ MSB of result */ - if(s == 1) { - CONDITIONAL_SET_FLAG((d + (d >> 7)) & 1, F_OF); - } + if(BOX64ENV(cputype)) CONDITIONAL_SET_FLAG((d + (d >> 7)) & 1, F_OF); /* set new CF; note that it is the LSB of the result */ CONDITIONAL_SET_FLAG(d & 0x1, F_CF); @@ -792,18 +820,15 @@ uint16_t rol16(x64emu_t *emu, uint16_t d, uint8_t s) s = s&0x1f; if(!s) return d; + CHECK_FLAGS(emu); + if(!BOX64ENV(cputype)) CONDITIONAL_SET_FLAG(XOR2(d>>14), F_OF); if((cnt = s % 16) != 0) { d = (d << cnt) + ((d >> (16 - cnt)) & ((1 << cnt) - 1)); } - CHECK_FLAGS(emu); - /* OF flag is set if s == 1; OF = CF _XOR_ MSB of result */ - if(s == 1) { - CONDITIONAL_SET_FLAG((d + (d >> 15)) & 1, F_OF); - } + if(BOX64ENV(cputype)) CONDITIONAL_SET_FLAG((d + (d >> 15)) & 1, F_OF); - /* set new CF; note that it is the LSB of the result */ CONDITIONAL_SET_FLAG(d & 0x1, F_CF); return d; @@ -815,18 +840,15 @@ uint32_t rol32(x64emu_t *emu, uint32_t d, uint8_t s) s = s&0x1f; if(!s) return d; + CHECK_FLAGS(emu); + if(!BOX64ENV(cputype)) CONDITIONAL_SET_FLAG(XOR2(d>>30), F_OF); if((cnt = s % 32) != 0) { d = (d << cnt) + ((d >> (32 - cnt)) & ((1 << cnt) - 1)); } - CHECK_FLAGS(emu); - /* OF flag is set if s == 1; OF = CF _XOR_ MSB of result */ - if(s == 1) { - CONDITIONAL_SET_FLAG((d + (d >> 31)) & 1, F_OF); - } + if(BOX64ENV(cputype)) CONDITIONAL_SET_FLAG((d + (d >> 31)) & 1, F_OF); - /* set new CF; note that it is the LSB of the result */ CONDITIONAL_SET_FLAG(d & 0x1, F_CF); return d; @@ -838,18 +860,15 @@ uint64_t rol64(x64emu_t *emu, uint64_t d, uint8_t s) s = s&0x3f; if(!s) return d; + CHECK_FLAGS(emu); + if(!BOX64ENV(cputype)) CONDITIONAL_SET_FLAG(XOR2(d>>62), F_OF); if((cnt = s % 64) != 0) { d = (d << cnt) + ((d >> (64 - cnt)) & ((1L << cnt) - 1)); } - CHECK_FLAGS(emu); - /* OF flag is set if s == 1; OF = CF _XOR_ MSB of result */ - if(s == 1) { - CONDITIONAL_SET_FLAG((d + (d >> 63)) & 1, F_OF); - } + if(BOX64ENV(cputype)) CONDITIONAL_SET_FLAG((d + (d >> 63)) & 1, F_OF); - /* set new CF; note that it is the LSB of the result */ CONDITIONAL_SET_FLAG(d & 0x1, F_CF); return d; @@ -865,16 +884,15 @@ uint8_t ror8(x64emu_t *emu, uint8_t d, uint8_t s) s = s&0x1f; if(!s) return d; + CHECK_FLAGS(emu); + + if(!BOX64ENV(cputype)) CONDITIONAL_SET_FLAG(((d >> 7)^d)&1, F_OF); if((cnt = s % 8) != 0) { - d = (d << (8 - cnt)) + ((d >> (cnt)) & ((1 << (8 - cnt)) - 1)); + d = (d << (8 - cnt)) + ((d >> (cnt)) & ((1 << (8 - cnt)) - 1)); } - CHECK_FLAGS(emu); - /* OF flag is set if s == 1; OF = MSB _XOR_ (M-1)SB of result */ - if(s == 1) { - CONDITIONAL_SET_FLAG(XOR2(d >> 6), F_OF); - } + if(BOX64ENV(cputype)) CONDITIONAL_SET_FLAG(XOR2(d >> 6), F_OF); /* set new CF; note that it is the MSB of the result */ CONDITIONAL_SET_FLAG(d & (1 << 7), F_CF); @@ -888,16 +906,15 @@ uint16_t ror16(x64emu_t *emu, uint16_t d, uint8_t s) s = s&0x1f; if(!s) return d; + CHECK_FLAGS(emu); + + if(!BOX64ENV(cputype)) CONDITIONAL_SET_FLAG(((d >> 15)^d)&1, F_OF); if((cnt = s % 16) != 0) { - d = (d << (16 - cnt)) + ((d >> (cnt)) & ((1 << (16 - cnt)) - 1)); + d = (d << (16 - cnt)) + ((d >> (cnt)) & ((1 << (16 - cnt)) - 1)); } - CHECK_FLAGS(emu); - /* OF flag is set if s == 1; OF = MSB _XOR_ (M-1)SB of result */ - if(s == 1) { - CONDITIONAL_SET_FLAG(XOR2(d >> 14), F_OF); - } + if(BOX64ENV(cputype)) CONDITIONAL_SET_FLAG(XOR2(d >> 14), F_OF); /* set new CF; note that it is the MSB of the result */ CONDITIONAL_SET_FLAG(d & (1 << 15), F_CF); @@ -911,16 +928,15 @@ uint32_t ror32(x64emu_t *emu, uint32_t d, uint8_t s) s = s&0x1f; if(!s) return d; + CHECK_FLAGS(emu); + + if(!BOX64ENV(cputype)) CONDITIONAL_SET_FLAG(((d >> 31)^d)&1, F_OF); if((cnt = s % 32) != 0) { - d = (d << (32 - cnt)) + ((d >> (cnt)) & ((1 << (32 - cnt)) - 1)); + d = (d << (32 - cnt)) + ((d >> (cnt)) & ((1 << (32 - cnt)) - 1)); } - CHECK_FLAGS(emu); - /* OF flag is set if s == 1; OF = MSB _XOR_ (M-1)SB of result */ - if(s == 1) { - CONDITIONAL_SET_FLAG(XOR2(d >> 30), F_OF); - } + if(BOX64ENV(cputype)) CONDITIONAL_SET_FLAG(XOR2(d >> 30), F_OF); /* set new CF; note that it is the MSB of the result */ CONDITIONAL_SET_FLAG(d & (1 << 31), F_CF); @@ -934,19 +950,18 @@ uint64_t ror64(x64emu_t *emu, uint64_t d, uint8_t s) s = s&0x3f; if(!s) return d; + CHECK_FLAGS(emu); + + if(!BOX64ENV(cputype)) CONDITIONAL_SET_FLAG(((d >> 63)^d)&1, F_OF); if((cnt = s % 64) != 0) { - d = (d << (64 - cnt)) + ((d >> (cnt)) & ((1L << (64 - cnt)) - 1L)); + d = (d << (64 - cnt)) + ((d >> (cnt)) & ((1L << (64 - cnt)) - 1L)); } - CHECK_FLAGS(emu); - /* OF flag is set if s == 1; OF = MSB _XOR_ (M-1)SB of result */ - if(s == 1) { - CONDITIONAL_SET_FLAG(XOR2(d >> 62), F_OF); - } + if(BOX64ENV(cputype)) CONDITIONAL_SET_FLAG(XOR2(d >> 62), F_OF); /* set new CF; note that it is the MSB of the result */ - CONDITIONAL_SET_FLAG(d & (1L << 63), F_CF); + CONDITIONAL_SET_FLAG(d & (1LL << 63), F_CF); return d; } @@ -964,33 +979,39 @@ uint16_t shld16 (x64emu_t *emu, uint16_t d, uint16_t fill, uint8_t s) return d; RESET_FLAGS(emu); if (s < 16) { - if (cnt > 0) { - res = (d << cnt) | (fill >> (16-cnt)); - cf = d & (1 << (16 - cnt)); - CONDITIONAL_SET_FLAG(cf, F_CF); - CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); - } else { - res = d; - } - if (cnt == 1) { - CONDITIONAL_SET_FLAG(((res ^ d) >> 15)&1, F_OF); - } else { - CONDITIONAL_SET_FLAG((d >> 15)&1, F_OF); - } + res = (d << cnt) | (fill >> (16-cnt)); + cf = d & (1 << (16 - cnt)); + CONDITIONAL_SET_FLAG(cf, F_CF); + CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); + CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } else { res = (fill << (cnt)) | (d >> (16 - cnt)); if(s==16) cf = d & 1; else cf = fill & (1 << (16 - cnt)); - CONDITIONAL_SET_FLAG(cf, F_CF); + if(BOX64ENV(cputype) && (s>16)) { + CLEAR_FLAG(F_CF); + } else { + CONDITIONAL_SET_FLAG(cf, F_CF); + } CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); - CLEAR_FLAG(F_OF); } + if (BOX64ENV(cputype)) { + if(s>15) + CONDITIONAL_SET_FLAG(ACCESS_FLAG(F_CF), F_OF); + else + CONDITIONAL_SET_FLAG((ACCESS_FLAG(F_CF) ^ (res>>15))&1, F_OF); + } else { + CONDITIONAL_SET_FLAG(XOR2(d>>14), F_OF); + } + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); return (uint16_t)res; } @@ -1013,11 +1034,15 @@ uint32_t shld32 (x64emu_t *emu, uint32_t d, uint32_t fill, uint8_t s) } else { res = d; } - if (cnt == 1) { - CONDITIONAL_SET_FLAG(((res ^ d) >> 31)&1, F_OF); + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((ACCESS_FLAG(F_CF) ^ (res>>31))&1, F_OF); } else { - CONDITIONAL_SET_FLAG((d >> 31)&1, F_OF); + CONDITIONAL_SET_FLAG(XOR2(d>>30), F_OF); } + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); return res; } @@ -1040,11 +1065,15 @@ uint64_t shld64 (x64emu_t *emu, uint64_t d, uint64_t fill, uint8_t s) } else { res = d; } - if (cnt == 1) { - CONDITIONAL_SET_FLAG(((res ^ d) >> 63)&1, F_OF); + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG((ACCESS_FLAG(F_CF) ^ (res>>63))&1, F_OF); } else { - CONDITIONAL_SET_FLAG((d >> 63)&1, F_OF); + CONDITIONAL_SET_FLAG(XOR2(d>>62), F_OF); } + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); return res; } @@ -1073,22 +1102,20 @@ uint16_t shrd16 (x64emu_t *emu, uint16_t d, uint16_t fill, uint8_t s) res = d; } - if (cnt == 1) { - CONDITIONAL_SET_FLAG(((res ^ d) >> 15)&1, F_OF); - } else { - CONDITIONAL_SET_FLAG((d >> 15)&1, F_OF); - } } else { if(s==16) cf = d & (1 << 15); else cf = fill & (1 << (cnt - 1)); res = (fill >> cnt) | (d << (16 - cnt)); - CONDITIONAL_SET_FLAG(cf, F_CF); + if(BOX64ENV(cputype) && (s>16)) { + CLEAR_FLAG(F_CF); + } else { + CONDITIONAL_SET_FLAG(cf, F_CF); + } CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); - CLEAR_FLAG(F_OF); #if 0 res = 0; CLEAR_FLAG(F_CF); @@ -1097,7 +1124,16 @@ uint16_t shrd16 (x64emu_t *emu, uint16_t d, uint16_t fill, uint8_t s) CLEAR_FLAG(F_SF); CLEAR_FLAG(F_PF); #endif - } + } + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG(XOR2(res>>14), F_OF); + } else { + CONDITIONAL_SET_FLAG((fill^(d>>15))&1, F_OF); + } + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); return (uint16_t)res; } @@ -1120,11 +1156,15 @@ uint32_t shrd32 (x64emu_t *emu, uint32_t d, uint32_t fill, uint8_t s) } else { res = d; } - if (cnt == 1) { - CONDITIONAL_SET_FLAG(((res ^ d) >> 31)&1, F_OF); + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG(XOR2(res>>30), F_OF); } else { - CONDITIONAL_SET_FLAG((d >> 31)&1, F_OF); + CONDITIONAL_SET_FLAG((fill^(d>>31))&1, F_OF); } + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); return res; } @@ -1148,11 +1188,15 @@ uint64_t shrd64 (x64emu_t *emu, uint64_t d, uint64_t fill, uint8_t s) } else { res = d; } - if (cnt == 1) { - CONDITIONAL_SET_FLAG(((res ^ d) >> 63)&1, F_OF); + if (BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG(XOR2(res>>62), F_OF); } else { - CONDITIONAL_SET_FLAG((d >> 63)&1, F_OF); + CONDITIONAL_SET_FLAG((fill^(d>>63))&1, F_OF); } + if (BOX64ENV(cputype)) + SET_FLAG(F_AF); + else + CLEAR_FLAG(F_AF); return res; } /**************************************************************************** @@ -1161,8 +1205,8 @@ Implements the SBB instruction and side effects. ****************************************************************************/ uint8_t sbb8(x64emu_t *emu, uint8_t d, uint8_t s) { - uint32_t res; /* all operands in native machine order */ - uint32_t bc; + uint32_t res; /* all operands in native machine order */ + uint32_t bc; CHECK_FLAGS(emu); if (ACCESS_FLAG(F_CF)) @@ -1183,18 +1227,17 @@ uint8_t sbb8(x64emu_t *emu, uint8_t d, uint8_t s) uint16_t sbb16(x64emu_t *emu, uint16_t d, uint16_t s) { - uint32_t res; /* all operands in native machine order */ - uint32_t bc; + uint32_t res; /* all operands in native machine order */ + uint32_t bc; CHECK_FLAGS(emu); if (ACCESS_FLAG(F_CF)) - res = d - s - 1; - else { - res = d - s; - } - CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); - CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); + res = d - s - 1; + else + res = d - s; + CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); + CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | s)) | (~d & s); @@ -1211,13 +1254,12 @@ uint32_t sbb32(x64emu_t *emu, uint32_t d, uint32_t s) CHECK_FLAGS(emu); if (ACCESS_FLAG(F_CF)) - res = d - s - 1; - else { - res = d - s; - } - CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(!res, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); + res = d - s - 1; + else + res = d - s; + CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(!res, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | s)) | (~d & s); @@ -1234,13 +1276,12 @@ uint64_t sbb64(x64emu_t *emu, uint64_t d, uint64_t s) CHECK_FLAGS(emu); if (ACCESS_FLAG(F_CF)) - res = d - s - 1; - else { - res = d - s; - } - CONDITIONAL_SET_FLAG(res & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(!res, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); + res = d - s - 1; + else + res = d - s; + CONDITIONAL_SET_FLAG(res & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(!res, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); /* calculate the borrow chain. See note at top */ bc = (res & (~d | s)) | (~d & s); @@ -1256,32 +1297,32 @@ Implements the TEST instruction and side effects. ****************************************************************************/ void test8(x64emu_t *emu, uint8_t d, uint8_t s) { - uint32_t res; /* all operands in native machine order */ + uint8_t res; /* all operands in native machine order */ RESET_FLAGS(emu); - res = d & s; + res = d & s; CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_AF); /* AF == dont care */ + CLEAR_FLAG(F_CF); CONDITIONAL_SET_FLAG(res & 0x80, F_SF); - CONDITIONAL_SET_FLAG(res == 0, F_ZF); + CONDITIONAL_SET_FLAG(!res, F_ZF); CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); - CLEAR_FLAG(F_AF); /* AF == dont care */ - CLEAR_FLAG(F_CF); } void test16(x64emu_t *emu, uint16_t d, uint16_t s) { - uint32_t res; /* all operands in native machine order */ + uint16_t res; /* all operands in native machine order */ RESET_FLAGS(emu); res = d & s; CLEAR_FLAG(F_OF); - CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(res == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); CLEAR_FLAG(F_AF); /* AF == dont care */ CLEAR_FLAG(F_CF); + CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); + CONDITIONAL_SET_FLAG(!res, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } void test32(x64emu_t *emu, uint32_t d, uint32_t s) @@ -1292,11 +1333,11 @@ void test32(x64emu_t *emu, uint32_t d, uint32_t s) res = d & s; CLEAR_FLAG(F_OF); - CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(res == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); CLEAR_FLAG(F_AF); /* AF == dont care */ CLEAR_FLAG(F_CF); + CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); + CONDITIONAL_SET_FLAG(!res, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } void test64(x64emu_t *emu, uint64_t d, uint64_t s) @@ -1307,31 +1348,38 @@ void test64(x64emu_t *emu, uint64_t d, uint64_t s) res = d & s; CLEAR_FLAG(F_OF); - CONDITIONAL_SET_FLAG(res & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(res == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); CLEAR_FLAG(F_AF); /* AF == dont care */ CLEAR_FLAG(F_CF); + CONDITIONAL_SET_FLAG(res & 0x8000000000000000LL, F_SF); + CONDITIONAL_SET_FLAG(!res, F_ZF); + CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF); } /**************************************************************************** REMARKS: Implements the IDIV instruction and side effects. ****************************************************************************/ + void idiv8(x64emu_t *emu, uint8_t s) { - int32_t dvd, quot, mod; - RESET_FLAGS(emu); + int32_t dvd, quot, mod; + if(BOX64ENV(cputype)) { + CHECK_FLAGS(emu); + SET_FLAG(F_AF); + CLEAR_FLAG(F_PF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_SF); + } dvd = (int16_t)R_AX; if (s == 0) { INTR_RAISE_DIV0(emu); - return; + return; } div_t p = div(dvd, (int8_t)s); quot = p.quot; mod = p.rem; - if (abs(quot) > 0x7f) { + if ((int8_t)quot != quot) { INTR_RAISE_DIV0(emu); return; } @@ -1342,6 +1390,13 @@ void idiv8(x64emu_t *emu, uint8_t s) void idiv16(x64emu_t *emu, uint16_t s) { int32_t dvd, quot, mod; + if(BOX64ENV(cputype)) { + CHECK_FLAGS(emu); + SET_FLAG(F_AF); + CLEAR_FLAG(F_PF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_SF); + } dvd = (((int32_t)R_DX) << 16) | R_AX; if (s == 0) { @@ -1351,14 +1406,10 @@ void idiv16(x64emu_t *emu, uint16_t s) div_t p = div(dvd, (int16_t)s); quot = p.quot; mod = p.rem; - if (abs(quot) > 0x7fff) { + if ((int16_t)quot != quot) { INTR_RAISE_DIV0(emu); return; } - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_SF); - CONDITIONAL_SET_FLAG(quot == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF); R_AX = (uint16_t)quot; R_DX = (uint16_t)mod; @@ -1367,7 +1418,13 @@ void idiv16(x64emu_t *emu, uint16_t s) void idiv32(x64emu_t *emu, uint32_t s) { int64_t dvd, quot, mod; - RESET_FLAGS(emu); + if(BOX64ENV(cputype)) { + CHECK_FLAGS(emu); + SET_FLAG(F_AF); + CLEAR_FLAG(F_PF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_SF); + } dvd = (((int64_t)R_EDX) << 32) | R_EAX; if (s == 0) { @@ -1377,15 +1434,10 @@ void idiv32(x64emu_t *emu, uint32_t s) ldiv_t p = ldiv(dvd, (int32_t)s); quot = p.quot; mod = p.rem; - if (labs(quot) > 0x7fffffff) { + if ((int32_t)quot != quot) { INTR_RAISE_DIV0(emu); return; } - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - CLEAR_FLAG(F_SF); - SET_FLAG(F_ZF); - CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF); R_RAX = (uint32_t)quot; R_RDX = (uint32_t)mod; @@ -1394,7 +1446,13 @@ void idiv32(x64emu_t *emu, uint32_t s) void idiv64(x64emu_t *emu, uint64_t s) { __int128 dvd, quot, mod; - RESET_FLAGS(emu); + if(BOX64ENV(cputype)) { + CHECK_FLAGS(emu); + SET_FLAG(F_AF); + CLEAR_FLAG(F_PF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_SF); + } dvd = (((__int128)R_RDX) << 64) | R_RAX; if (s == 0) { @@ -1403,15 +1461,10 @@ void idiv64(x64emu_t *emu, uint64_t s) } quot = dvd/(int64_t)s; mod = dvd%(int64_t)s; - if ((quot > 0x7fffffffffffffffLL) || (quot < -0x7fffffffffffffffLL)) { + if ((int64_t)quot != quot) { INTR_RAISE_DIV0(emu); return; } - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - CLEAR_FLAG(F_SF); - SET_FLAG(F_ZF); - CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF); R_RAX = (uint64_t)quot; R_RDX = (uint64_t)mod; @@ -1425,17 +1478,29 @@ void div8(x64emu_t *emu, uint8_t s) { uint32_t dvd, div, mod; RESET_FLAGS(emu); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_OF); + if(BOX64ENV(cputype)) { + SET_FLAG(F_AF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_PF); + } else { + CLEAR_FLAG(F_AF); + SET_FLAG(F_ZF); + SET_FLAG(F_PF); + } dvd = R_AX; - if (s == 0) { + if (s == 0) { INTR_RAISE_DIV0(emu); - return; - } + return; + } div = dvd / (uint8_t)s; mod = dvd % (uint8_t)s; if (div > 0xff) { INTR_RAISE_DIV0(emu); - return; + return; } R_AL = (uint8_t)div; R_AH = (uint8_t)mod; @@ -1445,22 +1510,30 @@ void div16(x64emu_t *emu, uint16_t s) { uint32_t dvd, div, mod; RESET_FLAGS(emu); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_OF); + if(BOX64ENV(cputype)) { + SET_FLAG(F_AF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_PF); + } else { + CLEAR_FLAG(F_AF); + SET_FLAG(F_ZF); + SET_FLAG(F_PF); + } dvd = (((uint32_t)R_DX) << 16) | R_AX; if (s == 0) { INTR_RAISE_DIV0(emu); - return; - } + return; + } div = dvd / (uint16_t)s; mod = dvd % (uint16_t)s; if (div > 0xffff) { INTR_RAISE_DIV0(emu); return; } - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_SF); - CONDITIONAL_SET_FLAG(div == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF); R_AX = (uint16_t)div; R_DX = (uint16_t)mod; @@ -1470,6 +1543,18 @@ void div32(x64emu_t *emu, uint32_t s) { uint64_t dvd, div, mod; RESET_FLAGS(emu); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_OF); + if(BOX64ENV(cputype)) { + SET_FLAG(F_AF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_PF); + } else { + CLEAR_FLAG(F_AF); + SET_FLAG(F_ZF); + SET_FLAG(F_PF); + } dvd = (((uint64_t)R_EDX) << 32) | R_EAX; if (s == 0) { @@ -1482,11 +1567,6 @@ void div32(x64emu_t *emu, uint32_t s) INTR_RAISE_DIV0(emu); return; } - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - CLEAR_FLAG(F_SF); - SET_FLAG(F_ZF); - CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF); R_RAX = (uint32_t)div; R_RDX = (uint32_t)mod; @@ -1496,6 +1576,18 @@ void div64(x64emu_t *emu, uint64_t s) { __int128 dvd, div, mod; RESET_FLAGS(emu); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_OF); + if(BOX64ENV(cputype)) { + SET_FLAG(F_AF); + CLEAR_FLAG(F_ZF); + CLEAR_FLAG(F_PF); + } else { + CLEAR_FLAG(F_AF); + SET_FLAG(F_ZF); + SET_FLAG(F_PF); + } dvd = (((__int128)R_RDX) << 64) | R_RAX; if (s == 0) { @@ -1508,11 +1600,6 @@ void div64(x64emu_t *emu, uint64_t s) INTR_RAISE_DIV0(emu); return; } - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - CLEAR_FLAG(F_SF); - SET_FLAG(F_ZF); - CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF); R_RAX = (uint64_t)div; R_RDX = (uint64_t)mod; diff --git a/src/emu/x64primop.h b/src/emu/x64primop.h index 83f8b00..2ad7d29 100644 --- a/src/emu/x64primop.h +++ b/src/emu/x64primop.h @@ -16,7 +16,7 @@ uint64_t adc64 (x64emu_t *emu, uint64_t d, uint64_t s); static inline uint8_t add8(x64emu_t *emu, uint8_t d, uint8_t s) { - emu->res.u16 = d + s; + emu->res.u16 = (uint16_t)d + s; emu->op1.u8 = d; emu->op2.u8 = s; emu->df = d_add8; @@ -25,7 +25,7 @@ static inline uint8_t add8(x64emu_t *emu, uint8_t d, uint8_t s) static inline uint16_t add16(x64emu_t *emu, uint16_t d, uint16_t s) { - emu->res.u32 = d + s; + emu->res.u32 = (uint32_t)d + s; emu->op1.u16 = d; emu->op2.u16 = s; emu->df = d_add16; @@ -89,103 +89,78 @@ uint64_t cmp64 (x64emu_t *emu, uint64_t d, uint64_t s); uint8_t daa8 (x64emu_t *emu, uint8_t d); uint8_t das8 (x64emu_t *emu, uint8_t d); -#define CF_SAV() \ - if(emu->df>=d_dec8 && emu->df<=d_inc64) { \ - emu->df_sav = d_none; \ - } else if(emu->dfdf>d_inc64i) {\ - emu->df_sav = emu->df; \ - emu->op1_sav = emu->op1; \ - emu->res_sav = emu->res; \ - } - static inline uint8_t dec8(x64emu_t *emu, uint8_t d) { - CF_SAV(); + CHECK_FLAGS(emu); //need to grab CF in case it's needed emu->res.u8 = d - 1; emu->op1.u8 = d; - emu->df = d_dec8i; + emu->df = d_dec8; return emu->res.u8; } static inline uint16_t dec16(x64emu_t *emu, uint16_t d) { - CF_SAV(); + CHECK_FLAGS(emu); //need to grab CF in case it's needed emu->res.u16 = d - 1; emu->op1.u16 = d; - emu->df = d_dec16i; + emu->df = d_dec16; return emu->res.u16; } static inline uint32_t dec32(x64emu_t *emu, uint32_t d) { - CF_SAV(); + CHECK_FLAGS(emu); //need to grab CF in case it's needed emu->res.u32 = d - 1; emu->op1.u32 = d; - emu->df = d_dec32i; + emu->df = d_dec32; return emu->res.u32; } static inline uint64_t dec64(x64emu_t *emu, uint64_t d) { - CF_SAV(); + CHECK_FLAGS(emu); //need to grab CF in case it's needed emu->res.u64 = d - 1; emu->op1.u64 = d; - emu->df = d_dec64i; + emu->df = d_dec64; return emu->res.u64; } static inline uint8_t inc8(x64emu_t *emu, uint8_t d) { - CF_SAV(); + CHECK_FLAGS(emu); //need to grab CF in case it's needed emu->res.u8 = d + 1; emu->op1.u8 = d; - emu->df = d_inc8i; + emu->df = d_inc8; return emu->res.u8; } static inline uint16_t inc16(x64emu_t *emu, uint16_t d) { - CF_SAV(); + CHECK_FLAGS(emu); //need to grab CF in case it's needed emu->res.u16 = d + 1; emu->op1.u16 = d; - emu->df = d_inc16i; + emu->df = d_inc16; return emu->res.u16; } static inline uint32_t inc32(x64emu_t *emu, uint32_t d) { - /*if(emu->df == d_shr32) { - // workaround for some wine trickery - uint32_t cnt = emu->op2.u32; - if (cnt > 0) { - uint32_t cc = emu->op1.u32 & (1 << (cnt - 1)); - CONDITIONAL_SET_FLAG(cc, F_CF); - } - }*/ - CF_SAV(); + CHECK_FLAGS(emu); //need to grab CF in case it's needed emu->res.u32 = d + 1; emu->op1.u32 = d; - emu->df = d_inc32i; + emu->df = d_inc32; return emu->res.u32; } static inline uint64_t inc64(x64emu_t *emu, uint64_t d) { - /*if(emu->df == d_shr64) { - // workaround for some wine trickery - uint64_t cnt = emu->op2.u64; - if (cnt > 0) { - uint64_t cc = emu->op1.u64 & (1LL << (cnt - 1)); - CONDITIONAL_SET_FLAG(cc, F_CF); - } - }*/ - CF_SAV(); + CHECK_FLAGS(emu); //need to grab CF in case it's needed emu->res.u64 = d + 1; emu->op1.u64 = d; - emu->df = d_inc64i; + emu->df = d_inc64; return emu->res.u64; } #undef CF_SAV @@ -201,7 +176,6 @@ static inline uint16_t or16(x64emu_t *emu, uint16_t d, uint16_t s) { emu->res.u16 = d | s; emu->df = d_or16; - /* set the carry flag to be bit 8 */ return emu->res.u16; } @@ -221,7 +195,7 @@ static inline uint64_t or64(x64emu_t *emu, uint64_t d, uint64_t s) static inline uint8_t neg8(x64emu_t *emu, uint8_t s) { - emu->res.u8 = (uint8_t)-s; + emu->res.i8 = -(int8_t)s; emu->op1.u8 = s; emu->df = d_neg8; return emu->res.u8; @@ -229,7 +203,7 @@ static inline uint8_t neg8(x64emu_t *emu, uint8_t s) static inline uint16_t neg16(x64emu_t *emu, uint16_t s) { - emu->res.u16 = (uint16_t)-s; + emu->res.i16 = -(int16_t)s; emu->op1.u16 = s; emu->df = d_neg16; return emu->res.u16; @@ -237,7 +211,7 @@ static inline uint16_t neg16(x64emu_t *emu, uint16_t s) static inline uint32_t neg32(x64emu_t *emu, uint32_t s) { - emu->res.u32 = (uint32_t)-s; + emu->res.i32 = -(int32_t)s; emu->op1.u32 = s; emu->df = d_neg32; return emu->res.u32; @@ -245,7 +219,7 @@ static inline uint32_t neg32(x64emu_t *emu, uint32_t s) static inline uint64_t neg64(x64emu_t *emu, uint64_t s) { - emu->res.u64 = (uint64_t)-s; + emu->res.i64 = -(int64_t)s; emu->op1.u64 = s; emu->df = d_neg64; return emu->res.u64; @@ -306,12 +280,11 @@ static inline uint8_t shl8(x64emu_t *emu, uint8_t d, uint8_t s) { if(s&0x1f) { s &= 0x1f; - if(s!=1) CHECK_FLAGS(emu); // for OF, need to find something more elegant here, using sav stuffs emu->df = d_shl8; emu->op1.u8 = d; emu->op2.u8 = s; - emu->res.u8 = d << s; + emu->res.u8 = (s>7) ? 0 : (d<res.u8; } else @@ -322,12 +295,11 @@ static inline uint16_t shl16(x64emu_t *emu, uint16_t d, uint8_t s) { if(s&0x1f) { s &= 0x1f; - if(s!=1) CHECK_FLAGS(emu); // for OF, need to find something more elegant here, using sav stuffs emu->df = d_shl16; emu->op1.u16 = d; emu->op2.u16 = s; - emu->res.u16 = d << s; + emu->res.u16 = (s>15) ? 0 : (d<res.u16; } else return d; @@ -337,7 +309,6 @@ static inline uint32_t shl32(x64emu_t *emu, uint32_t d, uint8_t s) { if(s&0x1f) { s &= 0x1f; - if(s!=1) CHECK_FLAGS(emu); // for OF, need to find something more elegant here, using sav stuffs emu->df = d_shl32; emu->op1.u32 = d; @@ -353,7 +324,6 @@ static inline uint64_t shl64(x64emu_t *emu, uint64_t d, uint8_t s) { if(s&0x3f) { s &= 0x3f; - if(s!=1) CHECK_FLAGS(emu); // for OF, need to find something more elegant here, using sav stuffs emu->df = d_shl64; emu->op1.u64 = d; @@ -369,12 +339,11 @@ static inline uint8_t shr8(x64emu_t *emu, uint8_t d, uint8_t s) { if(s&0x1f) { s &= 0x1f; - if(s!=1) CHECK_FLAGS(emu); // for OF, need to find something more elegant here, using sav stuffs emu->df = d_shr8; emu->op1.u8 = d; emu->op2.u8 = s; - emu->res.u8 = d >> s; + emu->res.u8 = (s>7) ? 0 : (d>>s); return emu->res.u8; } else @@ -385,12 +354,11 @@ static inline uint16_t shr16(x64emu_t *emu, uint16_t d, uint8_t s) { if(s&0x1f) { s &= 0x1f; - if(s!=1) CHECK_FLAGS(emu); // for OF, need to find something more elegant here, using sav stuffs emu->df = d_shr16; emu->op1.u16 = d; emu->op2.u16 = s; - emu->res.u16 = d >> s; + emu->res.u16 = (s>15) ? 0 : (d>>s); return emu->res.u16; } else @@ -401,7 +369,6 @@ static inline uint32_t shr32(x64emu_t *emu, uint32_t d, uint8_t s) { if(s&0x1f) { s &= 0x1f; - if(s!=1) CHECK_FLAGS(emu); // for OF, need to find something more elegant here, using sav stuffs emu->df = d_shr32; emu->op1.u32 = d; @@ -417,7 +384,6 @@ static inline uint64_t shr64(x64emu_t *emu, uint64_t d, uint8_t s) { if(s&0x3f) { s &= 0x3f; - if(s!=1) CHECK_FLAGS(emu); // for OF, need to find something more elegant here, using sav stuffs emu->df = d_shr64; emu->op1.u64 = d; @@ -433,12 +399,14 @@ static inline uint8_t sar8(x64emu_t *emu, uint8_t d, uint8_t s) { if(s&0x1f) { s &= 0x1f; - if(s!=1) CHECK_FLAGS(emu); // for OF, need to find something more elegant here, using sav stuffs emu->df = d_sar8; emu->op1.u8 = d; emu->op2.u8 = s; - emu->res.u8 = (uint8_t)(((int8_t)d)>>s); + if (s > 7) + emu->res.u8 = (d&0x80) ? 0xff : 0; + else + emu->res.u8 = (uint8_t)(((int8_t)d)>>s); return emu->res.u8; } else @@ -449,12 +417,14 @@ static inline uint16_t sar16(x64emu_t *emu, uint16_t d, uint8_t s) { if(s&0x1f) { s &= 0x1f; - if(s!=1) CHECK_FLAGS(emu); // for OF, need to find something more elegant here, using sav stuffs emu->df = d_sar16; emu->op1.u16 = d; emu->op2.u16 = s; - emu->res.u16 = (uint16_t)(((int16_t)d)>>s); + if (s > 15) + emu->res.u16 = (d&0x8000) ? 0xffff : 0; + else + emu->res.u16 = (uint16_t)(((int16_t)d)>>s); return emu->res.u16; } else @@ -465,7 +435,6 @@ static inline uint32_t sar32(x64emu_t *emu, uint32_t d, uint8_t s) { if(s&0x1f) { s &= 0x1f; - if(s!=1) CHECK_FLAGS(emu); // for OF, need to find something more elegant here, using sav stuffs emu->df = d_sar32; emu->op1.u32 = d; @@ -481,7 +450,6 @@ static inline uint64_t sar64(x64emu_t *emu, uint64_t d, uint8_t s) { if(s&0x3f) { s &= 0x3f; - if(s!=1) CHECK_FLAGS(emu); // for OF, need to find something more elegant here, using sav stuffs emu->df = d_sar64; emu->op1.u64 = d; @@ -565,28 +533,31 @@ static inline uint64_t xor64(x64emu_t *emu, uint64_t d, uint64_t s) static inline void imul8(x64emu_t *emu, uint8_t s) { + if (BOX64ENV(cputype)) CHECK_FLAGS(emu); emu->df = d_imul8; - R_AX = emu->res.u16 = (int16_t)(int8_t)R_AL * (int8_t)s; + R_AX = emu->res.u16 = ((int16_t)(int8_t)R_AL) * (int8_t)s; } static inline void imul16_eax(x64emu_t *emu, uint16_t s) { + if (BOX64ENV(cputype)) CHECK_FLAGS(emu); emu->df = d_imul16; - emu->res.u32 = (int32_t)(int16_t)R_AX * (int16_t)s; + emu->res.u32 = ((int32_t)(int16_t)R_AX) * (int16_t)s; R_AX = (uint16_t)emu->res.u32; R_DX = (uint16_t)(emu->res.u32 >> 16); } static inline uint16_t imul16(x64emu_t *emu, uint16_t op1, uint16_t op2) { + if (BOX64ENV(cputype)) CHECK_FLAGS(emu); emu->df = d_imul16; - emu->res.u32 = (int32_t)(int16_t)op1 * (int16_t)op2; + emu->res.u32 = ((int32_t)(int16_t)op1) * (int16_t)op2; return emu->res.u16; } static inline void imul32_direct(uint32_t *res_lo, uint32_t* res_hi,uint32_t d, uint32_t s) { - int64_t res = (int64_t)(int32_t)d * (int32_t)s; + uint64_t res = ((int64_t)(int32_t)d) * (int32_t)s; *res_lo = (uint32_t)res; *res_hi = (uint32_t)(res >> 32); @@ -594,6 +565,7 @@ static inline void imul32_direct(uint32_t *res_lo, uint32_t* res_hi,uint32_t d, static inline uint32_t imul32(x64emu_t *emu, uint32_t op1, uint32_t op2) { + if (BOX64ENV(cputype)) CHECK_FLAGS(emu); emu->df = d_imul32; uint32_t _res, _op1; imul32_direct(&_res,&_op1,op1,op2); @@ -604,15 +576,16 @@ static inline uint32_t imul32(x64emu_t *emu, uint32_t op1, uint32_t op2) static inline void imul32_eax(x64emu_t *emu, uint32_t s) { + if (BOX64ENV(cputype)) CHECK_FLAGS(emu); emu->df = d_imul32; - imul32_direct(&R_EAX,&R_EDX,R_EAX,s); - emu->res.u32 = R_EAX; - emu->op1.u32 = R_EDX; + imul32_direct(&emu->res.u32,&emu->op1.u32,R_EAX,s); + R_EAX = emu->res.u32; + R_EDX = emu->op1.u32; } static inline void imul64_direct(uint64_t *res_lo, uint64_t* res_hi,uint64_t d, uint64_t s) { - __int128 res = (__int128)(int64_t)d * (int64_t)s; + unsigned __int128 res = ((__int128)(int64_t)d) * (int64_t)s; *res_lo = (uint64_t)res; *res_hi = (uint64_t)(res >> 64); @@ -620,6 +593,7 @@ static inline void imul64_direct(uint64_t *res_lo, uint64_t* res_hi,uint64_t d, static inline uint64_t imul64(x64emu_t *emu, uint64_t op1, uint64_t op2) { + if (BOX64ENV(cputype)) CHECK_FLAGS(emu); emu->df = d_imul64; imul64_direct(&emu->res.u64,&emu->op1.u64,op1,op2); return emu->res.u64; @@ -627,20 +601,23 @@ static inline uint64_t imul64(x64emu_t *emu, uint64_t op1, uint64_t op2) static inline void imul64_rax(x64emu_t *emu, uint64_t s) { + if (BOX64ENV(cputype)) CHECK_FLAGS(emu); emu->df = d_imul64; - imul64_direct(&R_RAX,&R_RDX,R_RAX,s); - emu->res.u64 = R_RAX; - emu->op1.u64 = R_RDX; + imul64_direct(&emu->res.u64,&emu->op1.u64,R_RAX,s); + R_RAX = emu->res.u64; + R_RDX = emu->op1.u64; } static inline void mul8(x64emu_t *emu, uint8_t s) { + if (BOX64ENV(cputype)) CHECK_FLAGS(emu); emu->df = d_mul8; R_AX = emu->res.u16 = (uint16_t)(R_AL) * s; } static inline void mul16(x64emu_t *emu, uint16_t s) { + if (BOX64ENV(cputype)) CHECK_FLAGS(emu); emu->df = d_mul16; emu->res.u32 = (uint32_t)R_AX * s; R_AX = (uint16_t)emu->res.u32; @@ -649,6 +626,7 @@ static inline void mul16(x64emu_t *emu, uint16_t s) static inline void mul32_eax(x64emu_t *emu, uint32_t s) { + if (BOX64ENV(cputype)) CHECK_FLAGS(emu); emu->df = d_mul32; uint64_t res = (uint64_t)R_EAX * s; emu->res.u32 = R_EAX = (uint32_t)res; @@ -657,6 +635,7 @@ static inline void mul32_eax(x64emu_t *emu, uint32_t s) static inline void mul64_rax(x64emu_t *emu, uint64_t s) { + if (BOX64ENV(cputype)) CHECK_FLAGS(emu); emu->df = d_mul64; unsigned __int128 res = (unsigned __int128)R_RAX * s; emu->res.u64 = R_RAX = (uint64_t)res; diff --git a/src/emu/x64printer.c b/src/emu/x64printer.c new file mode 100644 index 0000000..bc751da --- /dev/null +++ b/src/emu/x64printer.c @@ -0,0 +1,7378 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.5.0.24) * + *******************************************************************/ +#include +#include +#include +#include +#include +#include "x64emu.h" +#include "x64emu_private.h" +#include "wrapper.h" + +#define PRIp "p" +#define PRIf "f" +#define PRILf "Lf" +#define PRIs "s" + +void x64Print(x64emu_t* emu, char* buff, size_t buffsz, const char* func, int tid, wrapper_t w) +{ +#ifdef HAVE_TRACE + if (0) { + } else if (w == vFv) { + snprintf(buff, buffsz, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), func); + } else if (w == vFc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi8 ")", tid, *(void**)(R_RSP), func, (int8_t)R_RDI); + } else if (w == vFw) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi16 ")", tid, *(void**)(R_RSP), func, (int16_t)R_RDI); + } else if (w == vFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == vFC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint8_t)R_RDI); + } else if (w == vFW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI); + } else if (w == vFu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == vFU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI); + } else if (w == vFf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0]); + } else if (w == vFd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0]); + } else if (w == vFl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI); + } else if (w == vFL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI); + } else if (w == vFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == cFv) { + snprintf(buff, buffsz, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), func); + } else if (w == cFc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi8 ")", tid, *(void**)(R_RSP), func, (int8_t)R_RDI); + } else if (w == cFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == cFu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == cFf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0]); + } else if (w == cFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == wFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == iFv) { + snprintf(buff, buffsz, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), func); + } else if (w == iFc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi8 ")", tid, *(void**)(R_RSP), func, (int8_t)R_RDI); + } else if (w == iFw) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi16 ")", tid, *(void**)(R_RSP), func, (int16_t)R_RDI); + } else if (w == iFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == iFI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ")", tid, *(void**)(R_RSP), func, (int64_t)R_RDI); + } else if (w == iFC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint8_t)R_RDI); + } else if (w == iFW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI); + } else if (w == iFu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == iFU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI); + } else if (w == iFf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0]); + } else if (w == iFd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0]); + } else if (w == iFD) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8))); + } else if (w == iFl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI); + } else if (w == iFL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI); + } else if (w == iFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == IFv) { + snprintf(buff, buffsz, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), func); + } else if (w == IFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == IFI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ")", tid, *(void**)(R_RSP), func, (int64_t)R_RDI); + } else if (w == IFf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0]); + } else if (w == IFd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0]); + } else if (w == IFD) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8))); + } else if (w == IFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == CFv) { + snprintf(buff, buffsz, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), func); + } else if (w == CFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == CFW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI); + } else if (w == CFu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == CFU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI); + } else if (w == CFl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI); + } else if (w == CFL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI); + } else if (w == CFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == WFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == WFW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI); + } else if (w == WFu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == WFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == uFv) { + snprintf(buff, buffsz, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), func); + } else if (w == uFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == uFC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint8_t)R_RDI); + } else if (w == uFu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == uFU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI); + } else if (w == uFd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0]); + } else if (w == uFL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI); + } else if (w == uFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == UFv) { + snprintf(buff, buffsz, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), func); + } else if (w == UFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == UFu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == UFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == fFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == fFf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0]); + } else if (w == fFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == dFv) { + snprintf(buff, buffsz, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), func); + } else if (w == dFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == dFu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == dFd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0]); + } else if (w == dFL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI); + } else if (w == dFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == DFD) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8))); + } else if (w == lFv) { + snprintf(buff, buffsz, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), func); + } else if (w == lFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == lFu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == lFD) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8))); + } else if (w == lFl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI); + } else if (w == lFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == LFv) { + snprintf(buff, buffsz, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), func); + } else if (w == LFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == LFu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == LFd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0]); + } else if (w == LFL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI); + } else if (w == LFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == pFv) { + snprintf(buff, buffsz, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), func); + } else if (w == pFw) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi16 ")", tid, *(void**)(R_RSP), func, (int16_t)R_RDI); + } else if (w == pFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == pFC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint8_t)R_RDI); + } else if (w == pFW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI); + } else if (w == pFu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == pFU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI); + } else if (w == pFd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0]); + } else if (w == pFl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI); + } else if (w == pFL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI); + } else if (w == pFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == pFV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)(R_RSP + 8)); + } else if (w == pFA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == SFv) { + snprintf(buff, buffsz, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), func); + } else if (w == SFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == HFi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == HFu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == HFp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == vFEi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == vFEp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == vFcc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi8 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (int8_t)R_RDI, (int8_t)R_RSI); + } else if (w == vFww) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi16 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (int16_t)R_RDI, (int16_t)R_RSI); + } else if (w == vFii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI); + } else if (w == vFiI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int64_t)R_RSI); + } else if (w == vFiW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint16_t)R_RSI); + } else if (w == vFiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI); + } else if (w == vFiU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint64_t)R_RSI); + } else if (w == vFif) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].f[0]); + } else if (w == vFid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].d[0]); + } else if (w == vFip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI); + } else if (w == vFWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI, (uint16_t)R_RSI); + } else if (w == vFWp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI, (void*)R_RSI); + } else if (w == vFuc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int8_t)R_RSI); + } else if (w == vFuw) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int16_t)R_RSI); + } else if (w == vFui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI); + } else if (w == vFuI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int64_t)R_RSI); + } else if (w == vFuC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint8_t)R_RSI); + } else if (w == vFuW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint16_t)R_RSI); + } else if (w == vFuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI); + } else if (w == vFuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint64_t)R_RSI); + } else if (w == vFuf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0]); + } else if (w == vFud) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].d[0]); + } else if (w == vFul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI); + } else if (w == vFuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uintptr_t)R_RSI); + } else if (w == vFup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI); + } else if (w == vFUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint32_t)R_RSI); + } else if (w == vFfi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], (int32_t)R_RDI); + } else if (w == vFfC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], (uint8_t)R_RDI); + } else if (w == vFff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFfp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], (void*)R_RDI); + } else if (w == vFdd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == vFlu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (uint32_t)R_RSI); + } else if (w == vFlp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI); + } else if (w == vFLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uint32_t)R_RSI); + } else if (w == vFLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI); + } else if (w == vFLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI); + } else if (w == vFpc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int8_t)R_RSI); + } else if (w == vFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == vFpI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int64_t)R_RSI); + } else if (w == vFpC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI); + } else if (w == vFpW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI); + } else if (w == vFpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == vFpU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI); + } else if (w == vFpf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0]); + } else if (w == vFpd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0]); + } else if (w == vFpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI); + } else if (w == vFpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI); + } else if (w == vFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == vFpA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == cFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == cFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == wFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == iFEi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == iFEu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI); + } else if (w == iFEf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0]); + } else if (w == iFEd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0]); + } else if (w == iFEL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI); + } else if (w == iFEp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == iFwp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int16_t)R_RDI, (void*)R_RSI); + } else if (w == iFii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI); + } else if (w == iFiI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int64_t)R_RSI); + } else if (w == iFiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint8_t)R_RSI); + } else if (w == iFiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI); + } else if (w == iFiU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint64_t)R_RSI); + } else if (w == iFil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI); + } else if (w == iFiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uintptr_t)R_RSI); + } else if (w == iFip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI); + } else if (w == iFWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI, (uint16_t)R_RSI); + } else if (w == iFui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI); + } else if (w == iFuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI); + } else if (w == iFuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uintptr_t)R_RSI); + } else if (w == iFup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI); + } else if (w == iFUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint64_t)R_RSI); + } else if (w == iFUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (void*)R_RSI); + } else if (w == iFli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (int32_t)R_RSI); + } else if (w == iFlp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI); + } else if (w == iFLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (int32_t)R_RSI); + } else if (w == iFLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uint32_t)R_RSI); + } else if (w == iFLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI); + } else if (w == iFLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI); + } else if (w == iFpc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int8_t)R_RSI); + } else if (w == iFpw) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int16_t)R_RSI); + } else if (w == iFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == iFpI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int64_t)R_RSI); + } else if (w == iFpC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI); + } else if (w == iFpW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI); + } else if (w == iFpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == iFpU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI); + } else if (w == iFpf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0]); + } else if (w == iFpd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0]); + } else if (w == iFpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI); + } else if (w == iFpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI); + } else if (w == iFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == iFpV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)(R_RSP + 8)); + } else if (w == iFpA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == IFEf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0]); + } else if (w == IFEd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0]); + } else if (w == IFED) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8))); + } else if (w == IFEp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == IFip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI); + } else if (w == IFII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int64_t)R_RDI, (int64_t)R_RSI); + } else if (w == IFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == IFpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == IFpd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0]); + } else if (w == IFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == CFip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI); + } else if (w == CFCi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu8 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint8_t)R_RDI, (int32_t)R_RSI); + } else if (w == CFui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI); + } else if (w == CFuW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint16_t)R_RSI); + } else if (w == CFuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI); + } else if (w == CFuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint64_t)R_RSI); + } else if (w == CFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == CFpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == CFpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI); + } else if (w == CFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == WFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == WFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == uFEp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == uFii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI); + } else if (w == uFiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI); + } else if (w == uFip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI); + } else if (w == uFui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI); + } else if (w == uFuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI); + } else if (w == uFuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uintptr_t)R_RSI); + } else if (w == uFup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI); + } else if (w == uFUi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (int32_t)R_RSI); + } else if (w == uFUL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI); + } else if (w == uFUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (void*)R_RSI); + } else if (w == uFpw) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int16_t)R_RSI); + } else if (w == uFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == uFpC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI); + } else if (w == uFpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == uFpU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI); + } else if (w == uFpf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0]); + } else if (w == uFpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI); + } else if (w == uFpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI); + } else if (w == uFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == UFEp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == UFii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI); + } else if (w == UFuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI); + } else if (w == UFUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint64_t)R_RSI); + } else if (w == UFUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (void*)R_RSI); + } else if (w == UFdi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], (int32_t)R_RDI); + } else if (w == UFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == UFpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == UFpU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI); + } else if (w == UFpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI); + } else if (w == UFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == fFEf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0]); + } else if (w == fFEp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == fFif) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].f[0]); + } else if (w == fFfi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], (int32_t)R_RDI); + } else if (w == fFff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == fFfD) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRILf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], LD2localLD((void*)(R_RSP + 8))); + } else if (w == fFfp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], (void*)R_RDI); + } else if (w == fFpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == fFpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI); + } else if (w == fFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == dFEd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0]); + } else if (w == dFid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].d[0]); + } else if (w == dFud) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].d[0]); + } else if (w == dFdi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], (int32_t)R_RDI); + } else if (w == dFdd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == dFdD) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRILf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], LD2localLD((void*)(R_RSP + 8))); + } else if (w == dFdp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], (void*)R_RDI); + } else if (w == dFll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (intptr_t)R_RSI); + } else if (w == dFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == dFpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == dFpd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0]); + } else if (w == dFpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI); + } else if (w == dFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == DFiD) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRILf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, LD2localLD((void*)(R_RSP + 8))); + } else if (w == DFDi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8)), (int32_t)R_RDI); + } else if (w == DFDD) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ", %" PRILf ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8)), LD2localLD((void*)(R_RSP + 24))); + } else if (w == DFDp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ", %" PRIp ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8)), (void*)R_RDI); + } else if (w == DFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == lFEi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == lFii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI); + } else if (w == lFiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uintptr_t)R_RSI); + } else if (w == lFip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI); + } else if (w == lFui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI); + } else if (w == lFDD) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ", %" PRILf ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8)), LD2localLD((void*)(R_RSP + 24))); + } else if (w == lFll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (intptr_t)R_RSI); + } else if (w == lFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == lFpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == lFpd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0]); + } else if (w == lFpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI); + } else if (w == lFpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI); + } else if (w == lFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == LFEL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI); + } else if (w == LFEp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == LFUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint64_t)R_RSI); + } else if (w == LFUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (void*)R_RSI); + } else if (w == LFLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (int32_t)R_RSI); + } else if (w == LFLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uint32_t)R_RSI); + } else if (w == LFLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI); + } else if (w == LFLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI); + } else if (w == LFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == LFpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == LFpU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI); + } else if (w == LFpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI); + } else if (w == LFpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI); + } else if (w == LFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == pFEi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI); + } else if (w == pFEl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI); + } else if (w == pFEL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI); + } else if (w == pFEp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == pFEA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI); + } else if (w == pFii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI); + } else if (w == pFiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI); + } else if (w == pFip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI); + } else if (w == pFiV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)(R_RSP + 8)); + } else if (w == pFui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI); + } else if (w == pFuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI); + } else if (w == pFul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI); + } else if (w == pFuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uintptr_t)R_RSI); + } else if (w == pFup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI); + } else if (w == pFdu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], (uint32_t)R_RDI); + } else if (w == pFdd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == pFli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (int32_t)R_RSI); + } else if (w == pFll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (intptr_t)R_RSI); + } else if (w == pFlp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI); + } else if (w == pFLc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (int8_t)R_RSI); + } else if (w == pFLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (int32_t)R_RSI); + } else if (w == pFLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uint32_t)R_RSI); + } else if (w == pFLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI); + } else if (w == pFLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI); + } else if (w == pFpc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int8_t)R_RSI); + } else if (w == pFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == pFpI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int64_t)R_RSI); + } else if (w == pFpC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI); + } else if (w == pFpW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI); + } else if (w == pFpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == pFpU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI); + } else if (w == pFpd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0]); + } else if (w == pFpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI); + } else if (w == pFpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI); + } else if (w == pFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == SFip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI); + } else if (w == SFpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == HFII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int64_t)R_RDI, (int64_t)R_RSI); + } else if (w == HFll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (intptr_t)R_RSI); + } else if (w == HFpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == vFEip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI); + } else if (w == vFEpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == vFEpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == vFEpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == vFEpV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)(R_RSP + 8)); + } else if (w == vFEpA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == vFccc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi8 ", %" PRIi8 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (int8_t)R_RDI, (int8_t)R_RSI, (int8_t)R_RDX); + } else if (w == vFwww) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi16 ", %" PRIi16 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (int16_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX); + } else if (w == vFiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFiif) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0]); + } else if (w == vFiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == vFiII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX); + } else if (w == vFiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == vFiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == vFiUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX); + } else if (w == vFiff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFidd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == vFilu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX); + } else if (w == vFill) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); + } else if (w == vFilp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); + } else if (w == vFipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == vFipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == vFipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == vFipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == vFCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint8_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX); + } else if (w == vFWWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ", %" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX); + } else if (w == vFucc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi8 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int8_t)R_RSI, (int8_t)R_RDX); + } else if (w == vFuww) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi16 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX); + } else if (w == vFuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFuiI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX); + } else if (w == vFuiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == vFuiU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX); + } else if (w == vFuif) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0]); + } else if (w == vFuid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0]); + } else if (w == vFuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == vFuII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX); + } else if (w == vFuWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX); + } else if (w == vFuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFuuC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint8_t)R_RDX); + } else if (w == vFuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == vFuuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX); + } else if (w == vFuuf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0]); + } else if (w == vFuud) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0]); + } else if (w == vFuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == vFuUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX); + } else if (w == vFuff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFufp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], (void*)R_RSI); + } else if (w == vFudd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == vFull) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); + } else if (w == vFulp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); + } else if (w == vFuLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == vFupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == vFupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == vFfff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == vFfpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], (void*)R_RDI, (void*)R_RSI); + } else if (w == vFddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); + } else if (w == vFdpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], (void*)R_RDI, (void*)R_RSI); + } else if (w == vFDpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8)), (void*)R_RDI, (void*)R_RSI); + } else if (w == vFlii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFlip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == vFllp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); + } else if (w == vFlpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == vFLup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == vFLpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == vFLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == vFLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == vFpcu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi8 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int8_t)R_RSI, (uint32_t)R_RDX); + } else if (w == vFpww) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi16 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX); + } else if (w == vFpic) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int8_t)R_RDX); + } else if (w == vFpii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFpiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX); + } else if (w == vFpiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == vFpiU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX); + } else if (w == vFpif) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0]); + } else if (w == vFpid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0]); + } else if (w == vFpiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == vFpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == vFpCu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX); + } else if (w == vFpui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFpuI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int64_t)R_RDX); + } else if (w == vFpuC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint8_t)R_RDX); + } else if (w == vFpuW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint16_t)R_RDX); + } else if (w == vFpuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == vFpuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX); + } else if (w == vFpuf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0]); + } else if (w == vFpud) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0]); + } else if (w == vFpul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX); + } else if (w == vFpuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == vFpup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == vFpUi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFpUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX); + } else if (w == vFpUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX); + } else if (w == vFpUf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, emu->xmm[0].f[0]); + } else if (w == vFpUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX); + } else if (w == vFpff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFpdu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], (uint32_t)R_RSI); + } else if (w == vFpdd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == vFpdp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], (void*)R_RSI); + } else if (w == vFpll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); + } else if (w == vFplL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == vFplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); + } else if (w == vFpLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFpLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX); + } else if (w == vFpLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == vFpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == vFppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == vFppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == vFppU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX); + } else if (w == vFppf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0]); + } else if (w == vFppd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0]); + } else if (w == vFppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); + } else if (w == vFppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == vFppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == vFppV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); + } else if (w == vFppA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == cFpdp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], (void*)R_RSI); + } else if (w == wFppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == iFEiw) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int16_t)R_RSI); + } else if (w == iFEiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI); + } else if (w == iFEip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI); + } else if (w == iFEWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI, (uint16_t)R_RSI); + } else if (w == iFEup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI); + } else if (w == iFEUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint64_t)R_RSI); + } else if (w == iFEpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == iFEpU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI); + } else if (w == iFEpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI); + } else if (w == iFEpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == iFEpV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)(R_RSP + 8)); + } else if (w == iFEpA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == iFwww) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi16 ", %" PRIi16 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (int16_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX); + } else if (w == iFwpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi16 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int16_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == iFiwC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi16 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int16_t)R_RSI, (uint8_t)R_RDX); + } else if (w == iFiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFiiI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX); + } else if (w == iFiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == iFiil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX); + } else if (w == iFiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == iFiII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX); + } else if (w == iFiCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX); + } else if (w == iFiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == iFiuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == iFiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == iFiUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX); + } else if (w == iFiUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint64_t)R_RSI, (void*)R_RDX); + } else if (w == iFidd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == iFill) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); + } else if (w == iFilp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); + } else if (w == iFiLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFiLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == iFipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == iFipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == iFipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == iFipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == iFCuW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu8 ", %" PRIu32 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint8_t)R_RDI, (uint32_t)R_RSI, (uint16_t)R_RDX); + } else if (w == iFuwp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int16_t)R_RSI, (void*)R_RDX); + } else if (w == iFuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == iFuWp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint16_t)R_RSI, (void*)R_RDX); + } else if (w == iFuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == iFuuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX); + } else if (w == iFuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == iFuLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == iFuLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == iFupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == iFupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == iFupL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == iFupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == iFfff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == iFLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == iFLpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == iFLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == iFLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == iFpwp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int16_t)R_RSI, (void*)R_RDX); + } else if (w == iFpii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFpiI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX); + } else if (w == iFpiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX); + } else if (w == iFpiW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint16_t)R_RDX); + } else if (w == iFpiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == iFpiU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX); + } else if (w == iFpid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0]); + } else if (w == iFpil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX); + } else if (w == iFpiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == iFpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == iFpIi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFpIp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int64_t)R_RSI, (void*)R_RDX); + } else if (w == iFpCu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX); + } else if (w == iFpCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX); + } else if (w == iFpWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX); + } else if (w == iFpWu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint32_t)R_RDX); + } else if (w == iFpWp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX); + } else if (w == iFpui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFpuC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint8_t)R_RDX); + } else if (w == iFpuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == iFpuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX); + } else if (w == iFpul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX); + } else if (w == iFpuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == iFpup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == iFpUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX); + } else if (w == iFpUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX); + } else if (w == iFpUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX); + } else if (w == iFpfu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0], (uint32_t)R_RSI); + } else if (w == iFpff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == iFpdd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == iFpli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFpll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); + } else if (w == iFplL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == iFplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); + } else if (w == iFpLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFpLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX); + } else if (w == iFpLf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, emu->xmm[0].f[0]); + } else if (w == iFpLl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (intptr_t)R_RDX); + } else if (w == iFpLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == iFpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == iFppc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int8_t)R_RDX); + } else if (w == iFppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == iFppI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX); + } else if (w == iFppC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint8_t)R_RDX); + } else if (w == iFppW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint16_t)R_RDX); + } else if (w == iFppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == iFppU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX); + } else if (w == iFppf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0]); + } else if (w == iFppd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0]); + } else if (w == iFppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); + } else if (w == iFppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == iFppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == IFiIi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); + } else if (w == IFIII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int64_t)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX); + } else if (w == IFIUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int64_t)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX); + } else if (w == IFUUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX); + } else if (w == IFpIi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); + } else if (w == IFppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == IFppI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX); + } else if (w == CFipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == CFuUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX); + } else if (w == CFuff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == CFppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == WFpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == WFppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == uFEpW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI); + } else if (w == uFEpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == uFEpU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI); + } else if (w == uFEpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == uFiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == uFiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == uFilp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); + } else if (w == uFipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == uFipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == uFipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == uFuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == uFuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == uFuCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX); + } else if (w == uFuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == uFuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == uFufp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], (void*)R_RSI); + } else if (w == uFupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == uFupU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint64_t)R_RDX); + } else if (w == uFupL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == uFupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == uFUCL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu8 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint8_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == uFUWL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu16 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint16_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == uFUuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == uFUUL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint64_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == uFUpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == uFpii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == uFpiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == uFpif) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0]); + } else if (w == uFpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == uFpCi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX); + } else if (w == uFpWi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX); + } else if (w == uFpWu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint32_t)R_RDX); + } else if (w == uFpWf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, emu->xmm[0].f[0]); + } else if (w == uFpWp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX); + } else if (w == uFpui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); + } else if (w == uFpuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == uFpuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX); + } else if (w == uFpuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == uFpup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == uFpUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX); + } else if (w == uFpUL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == uFpUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX); + } else if (w == uFpfu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0], (uint32_t)R_RSI); + } else if (w == uFpff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == uFpli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == uFplu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX); + } else if (w == uFpLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX); + } else if (w == uFpLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == uFpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == uFppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == uFppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == uFppU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX); + } else if (w == uFppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == uFppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == UFppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == fFuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == fFfff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == fFffp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], (void*)R_RDI); + } else if (w == fFlpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); + } else if (w == fFppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == fFppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == fFppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == dFuud) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0]); + } else if (w == dFddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); + } else if (w == dFddp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], (void*)R_RDI); + } else if (w == dFlpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); + } else if (w == dFpii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == dFpdd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == dFppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == dFppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == dFppd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0]); + } else if (w == dFppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == DFDDD) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ", %" PRILf ", %" PRILf ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8)), LD2localLD((void*)(R_RSP + 24)), LD2localLD((void*)(R_RSP + 40))); + } else if (w == DFppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == DFppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == lFiIL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int64_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == lFili) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == lFipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == lFipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == lFlll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); + } else if (w == lFlLl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIu64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (uintptr_t)R_RSI, (intptr_t)R_RDX); + } else if (w == lFpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == lFpup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == lFpli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == lFpLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX); + } else if (w == lFpLd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, emu->xmm[0].d[0]); + } else if (w == lFpLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == lFpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == lFppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == lFppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == lFppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); + } else if (w == lFppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == lFppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == LFEpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == LFEpA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == LFipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == LFuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); + } else if (w == LFlpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); + } else if (w == LFLii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == LFLLl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI, (intptr_t)R_RDX); + } else if (w == LFLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == LFLpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == LFLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == LFpii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == LFpiU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX); + } else if (w == LFpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == LFpCi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX); + } else if (w == LFpWp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX); + } else if (w == LFpui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); + } else if (w == LFpuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == LFpup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == LFpli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == LFplL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == LFpLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == LFpLC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint8_t)R_RDX); + } else if (w == LFpLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == LFpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == LFppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == LFppC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint8_t)R_RDX); + } else if (w == LFppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == LFppU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX); + } else if (w == LFppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); + } else if (w == LFppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == LFppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == pFEip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI); + } else if (w == pFEiV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)(R_RSP + 8)); + } else if (w == pFEup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI); + } else if (w == pFEuV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)(R_RSP + 8)); + } else if (w == pFEuA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI); + } else if (w == pFEpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI); + } else if (w == pFEpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == pFEpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI); + } else if (w == pFEpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == pFEpV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)(R_RSP + 8)); + } else if (w == pFEpA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == pFiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == pFiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == pFiid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0]); + } else if (w == pFiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == pFiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == pFiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == pFiLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == pFipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == pFipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == pFipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == pFCuW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu8 ", %" PRIu32 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint8_t)R_RDI, (uint32_t)R_RSI, (uint16_t)R_RDX); + } else if (w == pFWWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ", %" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX); + } else if (w == pFuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == pFuCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX); + } else if (w == pFuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); + } else if (w == pFuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == pFulu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX); + } else if (w == pFulp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); + } else if (w == pFupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == pFupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == pFupl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); + } else if (w == pFupL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == pFupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == pFdip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], (int32_t)R_RDI, (void*)R_RSI); + } else if (w == pFddu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], (uint32_t)R_RDI); + } else if (w == pFddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); + } else if (w == pFdLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], (uintptr_t)R_RDI, (uintptr_t)R_RSI); + } else if (w == pFDip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8)), (int32_t)R_RDI, (void*)R_RSI); + } else if (w == pFlpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == pFLiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == pFLup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == pFLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == pFLpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == pFLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == pFpcU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi8 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int8_t)R_RSI, (uint64_t)R_RDX); + } else if (w == pFpii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == pFpiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == pFpid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0]); + } else if (w == pFpil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX); + } else if (w == pFpiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == pFpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == pFpCi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX); + } else if (w == pFpWi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX); + } else if (w == pFpWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX); + } else if (w == pFpWp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX); + } else if (w == pFpui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); + } else if (w == pFpuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == pFpuf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0]); + } else if (w == pFpul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX); + } else if (w == pFpuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == pFpup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == pFpdu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], (uint32_t)R_RSI); + } else if (w == pFpdd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == pFplc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int8_t)R_RDX); + } else if (w == pFplu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX); + } else if (w == pFpll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); + } else if (w == pFplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); + } else if (w == pFpLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == pFpLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX); + } else if (w == pFpLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == pFpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == pFppc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int8_t)R_RDX); + } else if (w == pFppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == pFppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == pFppf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0]); + } else if (w == pFppd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0]); + } else if (w == pFppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); + } else if (w == pFppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == pFppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == pFppA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == SFEpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI); + } else if (w == SFpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == vFEipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == vFEipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); + } else if (w == vFEipA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == vFELLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == vFEpii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFEpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == vFEpiV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)(R_RSP + 8)); + } else if (w == vFEpup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == vFEpuV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)(R_RSP + 8)); + } else if (w == vFEpuA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == vFEpUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX); + } else if (w == vFEpLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFEpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == vFEppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == vFEppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == vFEppV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); + } else if (w == vFEppA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == vFcccc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi8 ", %" PRIi8 ", %" PRIi8 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (int8_t)R_RDI, (int8_t)R_RSI, (int8_t)R_RDX, (int8_t)R_RCX); + } else if (w == vFwwww) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi16 ", %" PRIi16 ", %" PRIi16 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (int16_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX); + } else if (w == vFiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == vFiiCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX, (void*)R_RCX); + } else if (w == vFiill) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); + } else if (w == vFiIII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX); + } else if (w == vFiuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == vFiuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFiulp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); + } else if (w == vFiupV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == vFiUUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX); + } else if (w == vFifff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == vFiddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); + } else if (w == vFilip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == vFilpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == vFilpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFipup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == vFipll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); + } else if (w == vFippL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == vFippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFCCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint8_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX); + } else if (w == vFWWWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ", %" PRIu16 ", %" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint16_t)R_RCX); + } else if (w == vFuccc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi8 ", %" PRIi8 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int8_t)R_RSI, (int8_t)R_RDX, (int8_t)R_RCX); + } else if (w == vFuwww) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi16 ", %" PRIi16 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX); + } else if (w == vFuiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFuiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == vFuiII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX); + } else if (w == vFuiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFuiuC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX); + } else if (w == vFuiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFuiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == vFuiUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX); + } else if (w == vFuifi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0], (int32_t)R_RDX); + } else if (w == vFuiff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFuidd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == vFuilp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); + } else if (w == vFuipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == vFuipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == vFuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFuIII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX); + } else if (w == vFuWWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu16 ", %" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint16_t)R_RCX); + } else if (w == vFuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFuuiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFuuil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX); + } else if (w == vFuuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == vFuuCu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu8 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint8_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFuuCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint8_t)R_RDX, (void*)R_RCX); + } else if (w == vFuuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFuuuf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, emu->xmm[0].f[0]); + } else if (w == vFuuud) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, emu->xmm[0].d[0]); + } else if (w == vFuuul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX); + } else if (w == vFuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == vFuuUl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX, (intptr_t)R_RCX); + } else if (w == vFuuff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFuuli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFuupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == vFuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFuUui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFuUup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == vFuUUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX); + } else if (w == vFufff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == vFuddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); + } else if (w == vFuluU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX); + } else if (w == vFullC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uint8_t)R_RCX); + } else if (w == vFullp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); + } else if (w == vFulpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == vFulpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFupii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFuppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == vFuppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == vFuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFUUpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == vFffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); + } else if (w == vFdddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == vFlfpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, emu->xmm[0].f[0], (void*)R_RSI, (intptr_t)R_RDX); + } else if (w == vFldpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, emu->xmm[0].d[0], (void*)R_RSI, (intptr_t)R_RDX); + } else if (w == vFllii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFlppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); + } else if (w == vFLiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFLuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFLppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == vFLppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); + } else if (w == vFpwwu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi16 ", %" PRIi16 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFpiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFpiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFpiiU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX); + } else if (w == vFpiid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[0].d[0]); + } else if (w == vFpiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == vFpiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFpiuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == vFpiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == vFpiUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFpidd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == vFpiLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFpiLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == vFpipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == vFpipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == vFpipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFpCuW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu32 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX); + } else if (w == vFpuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFpuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == vFpuCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX); + } else if (w == vFpuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFpuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == vFpufi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], (int32_t)R_RDX); + } else if (w == vFpudd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == vFpuli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFpuLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == vFpupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == vFpupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFpUuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFpUup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == vFpUUi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFpUUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFpUUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (void*)R_RCX); + } else if (w == vFpUpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFpfff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == vFpdii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFpdup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == vFpddu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (uint32_t)R_RSI); + } else if (w == vFpddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); + } else if (w == vFpdlL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], (intptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == vFpldi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, emu->xmm[0].d[0], (int32_t)R_RDX); + } else if (w == vFplll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); + } else if (w == vFpllL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == vFplpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFpLii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFpLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == vFpLuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFpLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == vFpLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == vFpLpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == vFpLpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == vFpLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == vFpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFppiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFppid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, emu->xmm[0].d[0]); + } else if (w == vFppil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX); + } else if (w == vFppiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == vFppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == vFppui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == vFppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == vFppfi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0], (int32_t)R_RDX); + } else if (w == vFppff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFppdu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], (uint32_t)R_RDX); + } else if (w == vFppdd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == vFppdp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], (void*)R_RDX); + } else if (w == vFpplL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == vFpplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); + } else if (w == vFppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == vFppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == vFpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == vFpppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == vFpppd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].d[0]); + } else if (w == vFpppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); + } else if (w == vFpppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == vFpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFpppV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == cFpiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == cFpipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFEiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); + } else if (w == iFEiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == iFEipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == iFEipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); + } else if (w == iFEipA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == iFEupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == iFEupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == iFEpii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFEpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == iFEpiV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)(R_RSP + 8)); + } else if (w == iFEpiA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == iFEpui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFEpup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == iFEpUi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFEpLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFEpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); + } else if (w == iFEppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == iFEppd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0]); + } else if (w == iFEppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == iFEppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == iFEppV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); + } else if (w == iFEppA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == iFwwww) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi16 ", %" PRIi16 ", %" PRIi16 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (int16_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX); + } else if (w == iFwppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi16 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int16_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFiiII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX); + } else if (w == iFiiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFiill) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); + } else if (w == iFiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFiIIi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFiIIu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFiWii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu16 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFiuwp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIi16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (int16_t)R_RDX, (void*)R_RCX); + } else if (w == iFiuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFiuuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX); + } else if (w == iFiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == iFiupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == iFiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFilli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFiLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFipWp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint16_t)R_RDX, (void*)R_RCX); + } else if (w == iFipui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFipuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX); + } else if (w == iFipup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == iFipLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFipLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFipLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == iFippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFippu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == iFippl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); + } else if (w == iFippL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFIUIU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIu64 ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int64_t)R_RDI, (uint64_t)R_RSI, (int64_t)R_RDX, (uint64_t)R_RCX); + } else if (w == iFuiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == iFuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFuWWp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu16 ", %" PRIu16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (void*)R_RCX); + } else if (w == iFuuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == iFuupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFuupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == iFuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFupLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == iFuppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFuppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == iFuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == iFLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFpwww) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi16 ", %" PRIi16 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX); + } else if (w == iFpwpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi16 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int16_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFpiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFpiiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX); + } else if (w == iFpiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpiid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[0].d[0]); + } else if (w == iFpiiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFpiIi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFpiCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX, (void*)R_RCX); + } else if (w == iFpiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpiuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == iFpili) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFpild) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].d[0]); + } else if (w == iFpiLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFpipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFpipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == iFpIip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFpCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX); + } else if (w == iFpCCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (void*)R_RCX); + } else if (w == iFpCuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpCpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFpCpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpCpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFpWWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint16_t)R_RCX); + } else if (w == iFpWWu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu16 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpWpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFpuwp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int16_t)R_RDX, (void*)R_RCX); + } else if (w == iFpuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFpuiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpuiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFpuWp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint16_t)R_RDX, (void*)R_RCX); + } else if (w == iFpuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFpuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpuuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX); + } else if (w == iFpuul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX); + } else if (w == iFpuuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == iFpuUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX, (void*)R_RCX); + } else if (w == iFpufp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], (void*)R_RDX); + } else if (w == iFpuLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFpuLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpuLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == iFpupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFpupC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint8_t)R_RCX); + } else if (w == iFpupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpupU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint64_t)R_RCX); + } else if (w == iFpupl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); + } else if (w == iFpupL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFpupV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == iFpUip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFpUup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == iFpUUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpUUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX); + } else if (w == iFpULp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == iFpUpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFpdip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], (int32_t)R_RSI, (void*)R_RDX); + } else if (w == iFplii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFplip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFplll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); + } else if (w == iFpllp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); + } else if (w == iFplpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFplpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFpLii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFpLiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFpLCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint8_t)R_RDX, (void*)R_RCX); + } else if (w == iFpLui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFpLuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpLup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == iFpLlp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); + } else if (w == iFpLLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == iFpLpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFpLpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpLpf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, emu->xmm[0].f[0]); + } else if (w == iFpLpd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, emu->xmm[0].d[0]); + } else if (w == iFpLpD) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRILf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, LD2localLD((void*)(R_RSP + 8))); + } else if (w == iFpLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFppcc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi8 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int8_t)R_RDX, (int8_t)R_RCX); + } else if (w == iFppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFppiI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int64_t)R_RCX); + } else if (w == iFppiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFppiU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX); + } else if (w == iFppiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFppIi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFppIL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFppCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX); + } else if (w == iFppuw) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int16_t)R_RCX); + } else if (w == iFppui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFppuf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, emu->xmm[0].f[0]); + } else if (w == iFppul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX); + } else if (w == iFppuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == iFppdi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], (int32_t)R_RDX); + } else if (w == iFppdd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == iFppdp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], (void*)R_RDX); + } else if (w == iFppli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFppll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); + } else if (w == iFpplL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); + } else if (w == iFppLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFppLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == iFppLl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX); + } else if (w == iFppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == iFpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFpppC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint8_t)R_RCX); + } else if (w == iFpppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == iFpppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == IFEpIi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); + } else if (w == IFIIIu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int64_t)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX, (uint32_t)R_RCX); + } else if (w == IFIUUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int64_t)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX); + } else if (w == IFUIUI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi64 ", %" PRIu64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (int64_t)R_RSI, (uint64_t)R_RDX, (int64_t)R_RCX); + } else if (w == IFpIip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == IFppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == IFppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == CFuuff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == CFpLLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == CFppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == uFEipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == uFEupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == uFEpup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == uFEppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == uFiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == uFiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == uFifff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == uFuipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == uFuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == uFuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == uFupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == uFuppU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint64_t)R_RCX); + } else if (w == uFuppd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].d[0]); + } else if (w == uFuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == uFUiLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == uFUCLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu8 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint8_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == uFUWLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu16 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint16_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == uFUuLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == uFUULp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint64_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == uFULip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == uFULui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == uFULpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == uFUpLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == uFUpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == uFLpUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (void*)R_RCX); + } else if (w == uFLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == uFpiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == uFpiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == uFpipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == uFpipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == uFpipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == uFpCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX); + } else if (w == uFpuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == uFpuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == uFpuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == uFpuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == uFpupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == uFpupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == uFpupL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == uFpupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == uFpUuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == uFpUuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX); + } else if (w == uFpUUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX); + } else if (w == uFpULu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == uFpULp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == uFpUpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == uFplup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == uFpLUL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint64_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == uFpLpU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint64_t)R_RCX); + } else if (w == uFpLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == uFpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == uFppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == uFppiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == uFppiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == uFppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == uFppui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == uFppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == uFppuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX); + } else if (w == uFppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == uFppUL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == uFpplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); + } else if (w == uFppLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == uFppLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == uFppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == uFppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == uFpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == uFpppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == uFpppU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint64_t)R_RCX); + } else if (w == uFpppd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].d[0]); + } else if (w == uFpppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == uFpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == UFpUui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == UFppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == UFppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == dFpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == lFEipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); + } else if (w == lFEpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == lFEppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == lFEppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == lFiiLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == lFiipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == lFipiI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int64_t)R_RCX); + } else if (w == lFipil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX); + } else if (w == lFipLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == lFipLI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int64_t)R_RCX); + } else if (w == lFipLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == lFipLl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX); + } else if (w == lFipLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == lFipLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == lFippL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == lFpili) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == lFpilp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); + } else if (w == lFpipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == lFpuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == lFplip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == lFplup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == lFplpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == lFplpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == lFpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == lFppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == lFppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == lFpplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); + } else if (w == lFppLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == lFppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == lFpppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); + } else if (w == lFpppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == lFpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == LFEppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); + } else if (w == LFEppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == LFipLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == LFippL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == LFippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == LFuipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == LFpipl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); + } else if (w == LFpCii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == LFpupL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == LFplLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == LFpLCL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu8 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint8_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == LFpLuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == LFpLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == LFpLpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == LFpLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == LFpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == LFppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == LFppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == LFpplu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == LFpplL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == LFppLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == LFppLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == LFppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == LFppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == LFpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == LFpppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == LFpppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); + } else if (w == LFpppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == LFpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFEipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == pFEipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); + } else if (w == pFEuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); + } else if (w == pFEupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == pFELpV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); + } else if (w == pFELpA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == pFEpii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == pFEpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == pFEpiV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)(R_RSP + 8)); + } else if (w == pFEpCL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == pFEppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); + } else if (w == pFEppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == pFEppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == pFEppV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); + } else if (w == pFEppA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == pFiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFiiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == pFiiLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == pFiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == pFiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFifff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == pFiddu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (uint32_t)R_RSI); + } else if (w == pFillu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == pFippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == pFippu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == pFippl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); + } else if (w == pFippL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == pFippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFuuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == pFuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFuddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); + } else if (w == pFudlL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].d[0], (intptr_t)R_RSI, (uintptr_t)R_RDX); + } else if (w == pFulli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFullu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFupii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); + } else if (w == pFdipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == pFdddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == pFDipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8)), (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == pFlfff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == pFLiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == pFLLup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == pFLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFpiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFpiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFpiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == pFpiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFpiUL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == pFpiLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFpiLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFpiLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == pFpipc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int8_t)R_RCX); + } else if (w == pFpipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == pFpipd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, emu->xmm[0].d[0]); + } else if (w == pFpipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == pFpipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFpCip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == pFpCuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFpWWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint16_t)R_RCX); + } else if (w == pFpuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFpuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == pFpuCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX); + } else if (w == pFpuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFpuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == pFpudd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == pFpuLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == pFpupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == pFpupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == pFpupL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == pFpupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFplil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX); + } else if (w == pFplip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == pFplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); + } else if (w == pFplpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFpLii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFpLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == pFpLuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFpLup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == pFpLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == pFpLpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == pFpLpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); + } else if (w == pFpLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == pFpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFppiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFppiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == pFppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == pFppCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint8_t)R_RDX, (void*)R_RCX); + } else if (w == pFppWp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint16_t)R_RDX, (void*)R_RCX); + } else if (w == pFppui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == pFppdd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == pFppll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); + } else if (w == pFpplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); + } else if (w == pFppLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == pFppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == pFpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == pFpppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == pFpppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == pFpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFEiipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == vFEiipA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFEippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFEpipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == vFEpipA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFEpuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == vFEpuuV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)(R_RSP + 8)); + } else if (w == vFEpuuA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == vFEpupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFEpupV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == vFEpupA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFEpLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == vFEppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == vFEppiV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)(R_RSP + 8)); + } else if (w == vFEppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); + } else if (w == vFEppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == vFEppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == vFEpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == vFEpppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == vFEpppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == vFEpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFiiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFiiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == vFiiuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFiillu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFiilll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFiipll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFiIIII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8); + } else if (w == vFiuiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFiuipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == vFiuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFiulpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFiUUUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8); + } else if (w == vFiffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); + } else if (w == vFidddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == vFilill) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFilipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == vFilipl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi32 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == vFipipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == vFipipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFipupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == vFucccc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi8 ", %" PRIi8 ", %" PRIi8 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int8_t)R_RSI, (int8_t)R_RDX, (int8_t)R_RCX, (int8_t)R_R8); + } else if (w == vFuwwww) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi16 ", %" PRIi16 ", %" PRIi16 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX, (int16_t)R_R8); + } else if (w == vFuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFuiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFuiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFuiiCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (void*)R_R8); + } else if (w == vFuiiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFuiill) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFuiIII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8); + } else if (w == vFuiuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFuiuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFuiuCi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu8 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (int32_t)R_R8); + } else if (w == vFuiuCu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu8 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFuiuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFuiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFuiupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == vFuiUUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8); + } else if (w == vFuifff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == vFuiddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); + } else if (w == vFuipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFuipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFuipup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFuippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFuIIII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8); + } else if (w == vFuCCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8); + } else if (w == vFuCuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu8 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFuCuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu8 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFuWWWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu16 ", %" PRIu16 ", %" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8); + } else if (w == vFuuiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFuuiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFuuiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFuuiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFuuiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFuuifi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, emu->xmm[0].f[0], (int32_t)R_RCX); + } else if (w == vFuuipC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint8_t)R_R8); + } else if (w == vFuuipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == vFuuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFuuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFuuuiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFuuuil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFuuuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFuuuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFuuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFuuuli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8); + } else if (w == vFuuull) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFuulll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFuullp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8); + } else if (w == vFuupii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFuuppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == vFuUUUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8); + } else if (w == vFuffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); + } else if (w == vFudddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == vFullpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == vFupiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFupupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == vFupupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFuplii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFuppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFupppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == vFupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFfffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0]); + } else if (w == vFddddp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], (void*)R_RDI); + } else if (w == vFluipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFlplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == vFLpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == vFLpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFpwwWW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi16 ", %" PRIi16 ", %" PRIu16 ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8); + } else if (w == vFpiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFpiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFpiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFpiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFpiiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFpiiff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFpiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFpiipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)(R_RSP + 8)); + } else if (w == vFpiuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFpiUUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFpiUUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (void*)R_R8); + } else if (w == vFpilpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFpipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFpipiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFpippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == vFpippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFpuiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFpuiil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFpuiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFpuill) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFpuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFpuipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)(R_RSP + 8)); + } else if (w == vFpuipA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFpuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFpuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFpuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFpuddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); + } else if (w == vFpulul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi64 ", %" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFpulll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFpupiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFpupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFpUuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFpUUuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFpUUup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFpUUUi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (int32_t)R_R8); + } else if (w == vFpUUUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFpUUUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (void*)R_R8); + } else if (w == vFpfffi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], (int32_t)R_RSI); + } else if (w == vFpffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); + } else if (w == vFpdull) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); + } else if (w == vFpddii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFpdddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == vFpddpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (void*)R_RSI, (void*)R_RDX); + } else if (w == vFpliip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFpluul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFplplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (void*)R_R8); + } else if (w == vFpLiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFpLiiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); + } else if (w == vFpLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == vFpLLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == vFpLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFpLpiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); + } else if (w == vFpLppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == vFpLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFppiic) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int8_t)R_R8); + } else if (w == vFppiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFppiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFppiid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, emu->xmm[0].d[0]); + } else if (w == vFppiiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); + } else if (w == vFppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFppiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFppiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFppiff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFppidd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == vFppipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == vFppipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == vFppipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFppWui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu16 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint16_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFppuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFppuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFppuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFppuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFppudd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == vFppupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == vFppupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == vFppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFppfff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == vFppddp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], (void*)R_RDX); + } else if (w == vFpplll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); + } else if (w == vFppLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == vFppLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == vFppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFpppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFpppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFpppui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == vFpppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFpppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == vFpppff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFpppfp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].f[0], (void*)R_RCX); + } else if (w == vFpppdd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == vFpppdp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].d[0], (void*)R_RCX); + } else if (w == vFppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == vFppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == vFppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == vFppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFEiipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == iFEiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFEiipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == iFEiipA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFEipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFEippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFEippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFEpiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFEpipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFEpipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFEpipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == iFEpipA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFEpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFEpLpV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == iFEpLpA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFEppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFEppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFEppiV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)(R_RSP + 8)); + } else if (w == iFEppiA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFEppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == iFEpplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); + } else if (w == iFEpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == iFEpppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == iFEpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFEpppV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == iFEpppA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == iFiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFiiiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFiiipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == iFiiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFiiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFiuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFiuuuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint64_t)R_R8); + } else if (w == iFiuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFiuUip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFiuppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFillLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == iFiLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFipiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFipiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFipipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFipipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == iFipuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFipuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFipupL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == iFipLup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFippuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFippLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == iFippLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == iFipppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFuiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFuuuuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint64_t)R_R8); + } else if (w == iFuuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFuuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFuupid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, emu->xmm[0].d[0]); + } else if (w == iFuupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFupupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFuppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == iFupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFLppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFLpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpwwww) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi16 ", %" PRIi16 ", %" PRIi16 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX, (int16_t)R_R8); + } else if (w == iFpwppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi16 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int16_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFpiiiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); + } else if (w == iFpiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFpiiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFpiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFpiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpiuwp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int16_t)R_RCX, (void*)R_R8); + } else if (w == iFpiuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFpiuLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpiUUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8); + } else if (w == iFpiLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFpiLuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFpipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpipiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFpipiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); + } else if (w == iFpipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFpiplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (void*)R_R8); + } else if (w == iFpippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFpippW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint16_t)R_R8); + } else if (w == iFpippL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == iFpippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpCCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8); + } else if (w == iFpCCpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu8 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == iFpCupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpCpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFpCpCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIp ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX, (uint8_t)R_RCX, (void*)R_R8); + } else if (w == iFpuiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFpuill) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); + } else if (w == iFpuipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == iFpuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpuuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFpuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFpuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFpuuLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == iFpuuLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == iFpuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpulup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFpulpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpuLup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFpuLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == iFpuLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpupui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpupuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFpupuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint64_t)R_R8); + } else if (w == iFpupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFpupLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFpupLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == iFpuppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFpuppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == iFpuppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == iFpuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpUiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFpUiUi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpUupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFplupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFplluu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFpLiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFpLilp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8); + } else if (w == iFpLiLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpLipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFpLipC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint8_t)R_R8); + } else if (w == iFpLuLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpLlpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpLLii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpLLup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFpLpii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpLpiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); + } else if (w == iFpLpuL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8); + } else if (w == iFpLpup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFpLpLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpLppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFpLppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == iFpLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFppiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFppiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFppiif) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, emu->xmm[0].f[0]); + } else if (w == iFppiiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); + } else if (w == iFppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFppiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFppiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFppiLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == iFppipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFppipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == iFppipl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == iFppipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFppIII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8); + } else if (w == iFppWpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu16 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint16_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFppuwp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int16_t)R_RCX, (void*)R_R8); + } else if (w == iFppuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFppuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFppuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFppuLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == iFppuLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == iFppupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFppupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == iFppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFppUup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFpplii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFppllp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8); + } else if (w == iFpplpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFppLiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); + } else if (w == iFppLup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFppLLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == iFppLpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFppLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == iFppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpppiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFpppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFpppui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFpppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFpppUi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint64_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpppLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == iFpppLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8); + } else if (w == iFpppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == iFppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == iFppppd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, emu->xmm[0].d[0]); + } else if (w == iFppppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == iFppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == iFppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == IFpLIII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8); + } else if (w == IFppIII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8); + } else if (w == uFEiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == uFEippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == uFEpipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == uFEpupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == uFEpppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == uFEpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == uFEpppV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == uFiuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == uFiuppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == uFipupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFipLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == uFULCLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu8 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI, (uint8_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == uFULWLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu16 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI, (uint16_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == uFULuLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == uFULULU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI, (uint64_t)R_RDX, (uintptr_t)R_RCX, (uint64_t)R_R8); + } else if (w == uFULLUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8); + } else if (w == uFUpUpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == uFLpppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == uFpiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFpCCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8); + } else if (w == uFpWuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == uFpuuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == uFpuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == uFpuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == uFpuupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == uFpuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFpupuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == uFpuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFpULuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uint64_t)R_R8); + } else if (w == uFpUppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFpLuUL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX, (uintptr_t)R_R8); + } else if (w == uFpLLUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8); + } else if (w == uFpLpLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == uFpLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == uFppiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == uFppiUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX, (void*)R_R8); + } else if (w == uFppiLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8); + } else if (w == uFppipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFppuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == uFppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFpplip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == uFpplpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFppLLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8); + } else if (w == uFppLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == uFppLpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == uFppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFpppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == uFpppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == uFpppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == uFpppLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8); + } else if (w == uFpppLU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint64_t)R_R8); + } else if (w == uFpppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == uFppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == uFppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == uFppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == UFuiCiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu8 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == fFlplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == fFppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == dFlplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == dFppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == lFEippL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == lFEuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == lFEppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == lFipiIi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int64_t)R_RCX, (int32_t)R_R8); + } else if (w == lFipili) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8); + } else if (w == lFipLli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8); + } else if (w == lFipLlL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == lFipLLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == lFipLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == lFpuipC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint8_t)R_R8); + } else if (w == lFpuuLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == lFppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == lFpplLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == lFpplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == lFppLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == lFppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == LFELppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == LFEpLpV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == LFEppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); + } else if (w == LFEpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == LFuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == LFLpppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == LFpuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == LFpuupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == LFplplL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == LFplplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (void*)R_R8); + } else if (w == LFpLuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == LFpLLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == LFpLpuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == LFpLpLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == LFpLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == LFpLppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == LFpLppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == LFpLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == LFppuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == LFpplLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == LFpplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == LFppLuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == LFppLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == LFppLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == LFpppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == LFppplL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == LFppplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (void*)R_R8); + } else if (w == LFppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == LFppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFEiLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFEuipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == pFEuipA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFEpiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFEpipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); + } else if (w == pFEpipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFEpupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFEpUpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFEpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFEppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFEppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == pFEppdd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == pFEppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); + } else if (w == pFEpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); + } else if (w == pFEpppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); + } else if (w == pFEpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFEpppV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); + } else if (w == pFEpppA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == pFiiupL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == pFipipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == pFipipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFuiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == pFuiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFuuiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFuuupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == pFuupuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == pFudddp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], (void*)R_RSI); + } else if (w == pFuLdii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ", %" PRIf ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uintptr_t)R_RSI, emu->xmm[0].d[0], (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == pFupLpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == pFupLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == pFddddu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], (uint32_t)R_RDI); + } else if (w == pFLuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFLLLiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == pFLpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == pFpiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == pFpiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFpiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == pFpiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == pFpiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFpiCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8); + } else if (w == pFpiuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == pFpiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFpiLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFpipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == pFpipiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); + } else if (w == pFpipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFpipup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == pFpippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == pFpippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFpCiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == pFpuiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == pFpuiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFpuuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFpuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == pFpuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == pFpuupL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == pFpuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFpuLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFpuppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == pFpuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFpfffi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], (int32_t)R_RSI); + } else if (w == pFpdddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == pFplppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFpLiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == pFpLipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFpLLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFpLLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == pFpLpii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == pFpLpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFpLpuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == pFpLpup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == pFpLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFppiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == pFppiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == pFppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFppiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == pFppiLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == pFppipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == pFppipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFppCip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu8 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint8_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFppWpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu16 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint16_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFppuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFppuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == pFppuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == pFppuLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == pFppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFppddu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], (uint32_t)R_RDX); + } else if (w == pFppLuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == pFppLLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == pFppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFpppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); + } else if (w == pFpppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFpppui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); + } else if (w == pFpppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == pFpppli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8); + } else if (w == pFpppLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); + } else if (w == pFppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == pFppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == pFppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == pFppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == xFlplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == XFlplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == vFEiiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFEpiwpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi16 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int16_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFEpiLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFEpippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFEpuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFEpuipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)(R_RSP + 8)); + } else if (w == vFEpuipA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFEpuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFEpLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFEppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFEpppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == vFEppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == vFiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFiiiuil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9); + } else if (w == vFiiilpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFiiuilp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (intptr_t)R_R8, (void*)R_R9); + } else if (w == vFiffiff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], (int32_t)R_RSI, emu->xmm[2].f[0], emu->xmm[3].f[0]); + } else if (w == vFiddidd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI, emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == vFilipli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi32 ", %" PRIp ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (int32_t)R_R9); + } else if (w == vFiliplu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi32 ", %" PRIp ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (uint32_t)R_R9); + } else if (w == vFipiplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9); + } else if (w == vFCCCCff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint8_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFuiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFuiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFuiiuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFuiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == vFuiIIII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8, (int64_t)R_R9); + } else if (w == vFuiuiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFuiuiiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint8_t)R_R9); + } else if (w == vFuiuiil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9); + } else if (w == vFuiuiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFuiuiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFuiuiuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint64_t)R_R9); + } else if (w == vFuiuCip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu8 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFuiuuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFuiuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFuiupii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFuiupiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFuiUUUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (uint64_t)R_R9); + } else if (w == vFuiffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); + } else if (w == vFuidddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == vFuipiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == vFuCuuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu8 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFuuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFuuiuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFuuiuil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9); + } else if (w == vFuuiuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFuuiuCu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu8 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint8_t)R_R8, (uint32_t)R_R9); + } else if (w == vFuuiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == vFuuippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFuuuiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFuuuiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == vFuuuipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFuuuipC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint8_t)R_R9); + } else if (w == vFuuuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFuuuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFuuuuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFuuuull) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9); + } else if (w == vFuuuppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFuuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFuuffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); + } else if (w == vFuudddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == vFuupiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFuupupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFuuplii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFuffiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == vFufffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0]); + } else if (w == vFuddiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == vFulluUC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIu32 ", %" PRIu64 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX, (uint64_t)R_R8, (uint8_t)R_R9); + } else if (w == vFupiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFupupip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFuppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == vFuppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFUUpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFffffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0]); + } else if (w == vFdddddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); + } else if (w == vFdddppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); + } else if (w == vFlfplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, emu->xmm[0].f[0], (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == vFldplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, emu->xmm[0].d[0], (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == vFlplplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9); + } else if (w == vFlpplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (intptr_t)R_R9); + } else if (w == vFpwwllc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi16 ", %" PRIi16 ", %" PRIi64 ", %" PRIi64 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (int8_t)R_R9); + } else if (w == vFpiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFpiiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFpiiuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFpiilli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9); + } else if (w == vFpiippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFpiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFpiUuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == vFpiLppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFpipiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFpipipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFpipipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)(R_RSP + 8)); + } else if (w == vFpipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFpuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFpuiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFpuiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFpuuuiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFpuuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == vFpuuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFpuupuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFpuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFpudddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == vFpuLuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFpupiUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint64_t)R_R8, (uint32_t)R_R9); + } else if (w == vFpupuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFpupupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == vFpuppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFpupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFpUiUup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == vFpUipup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == vFpUuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == vFpUUiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == vFpdddii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], (int32_t)R_RSI, (int32_t)R_RDX); + } else if (w == vFpddddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0]); + } else if (w == vFpddddp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], (void*)R_RSI); + } else if (w == vFpLiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFpLiiiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9); + } else if (w == vFpLiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFpLLLLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9); + } else if (w == vFpLpLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9); + } else if (w == vFpLpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFppiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFppiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFppiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFppiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFppilpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFppipLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == vFppippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFppippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFppCCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9); + } else if (w == vFppuiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFppuiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFppuiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFppuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFppuUUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (uint64_t)R_R9); + } else if (w == vFppupii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFppuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFppffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); + } else if (w == vFppdidd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], (int32_t)R_RDX, emu->xmm[1].d[0], emu->xmm[2].d[0]); + } else if (w == vFppdddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == vFpplplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9); + } else if (w == vFpplppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFpplppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFppLppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFppLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFpppiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFpppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFpppiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); + } else if (w == vFpppiff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFpppipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFpppipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == vFpppipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFpppuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFpppuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFpppuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == vFpppuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == vFpppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFppppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == vFpppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == vFpppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == vFpppppU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint64_t)R_R9); + } else if (w == vFpppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == vFpppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == cFppLppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFEiippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFEiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFEiLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == iFEipiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFEippLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == iFElpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFEpiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFEpiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFEpiipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)(R_RSP + 8)); + } else if (w == iFEpilpV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)(R_RSP + 8)); + } else if (w == iFEpipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFEpippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFEpIppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int64_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFEpuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFEpuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFEpUppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFEppipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFEppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFEppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == iFEppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFEppppV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)(R_RSP + 8)); + } else if (w == iFiiiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFiiiuwp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int16_t)R_R8, (void*)R_R9); + } else if (w == iFiippiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); + } else if (w == iFiWiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu16 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFiuuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFiuuupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == iFiuuUpU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX, (void*)R_R8, (uint64_t)R_R9); + } else if (w == iFiuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFiuUuUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (uint64_t)R_R8, (uint32_t)R_R9); + } else if (w == iFilpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFiLpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFipipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFipippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFipuIup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIi64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int64_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFipupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFipuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFipppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == iFippppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFuiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFuuIiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int64_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFuuuuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFuuuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFuupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFupupLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == iFupuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFupLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == iFdipppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == iFDipppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRILf ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, LD2localLD((void*)(R_RSP + 8)), (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); + } else if (w == iFllllpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFlpippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFLpppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == iFpiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == iFpiiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); + } else if (w == iFpiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFpiiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpiiuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == iFpiiuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); + } else if (w == iFpiiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpiiLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFpiipcc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi8 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int8_t)R_R8, (int8_t)R_R9); + } else if (w == iFpiipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == iFpiipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFpiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpiIIIi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8, (int32_t)R_R9); + } else if (w == iFpiCCpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu8 ", %" PRIu8 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == iFpiuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFpiuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpipipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFpipipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpipupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpipLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpippip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFpippup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFpipppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == iFpipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpCiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpCpipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == iFpWipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFpWCupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu8 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint8_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpWpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpuiCpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIu8 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpuiLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpuippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpuuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == iFpuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == iFpuuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFpuuupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == iFpuuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpuuLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpuupuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == iFpuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpuLuLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9); + } else if (w == iFpuLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpupupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFpupupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpupLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == iFpupLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpupppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == iFpupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpUiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpUuuLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == iFpUUUup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFpUUUUp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (void*)R_R9); + } else if (w == iFpdpipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == iFpLiiiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9); + } else if (w == iFpLiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFpLiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == iFpLipLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9); + } else if (w == iFpLIppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int64_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpLuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpLuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpLupip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFpLuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpLLLLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9); + } else if (w == iFpLLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9); + } else if (w == iFpLLLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == iFpLLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpLpipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFpLpLui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); + } else if (w == iFpLpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpLppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == iFpLpppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == iFpLpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == iFppiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFppiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFppiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppiuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == iFppiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppilpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == iFppipiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9); + } else if (w == iFppipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFppippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFppippu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == iFppippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppIppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppCupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu8 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint8_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppuiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == iFppuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppuIII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8, (int64_t)R_R9); + } else if (w == iFppuupL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == iFppuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppufff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == iFppulup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFppulll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9); + } else if (w == iFppuLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppupip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFppupui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); + } else if (w == iFppupul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (intptr_t)R_R9); + } else if (w == iFppuppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == iFppuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppdidd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], (int32_t)R_RDX, emu->xmm[1].d[0], emu->xmm[2].d[0]); + } else if (w == iFpplupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpplppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFppLiWL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu16 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (uint16_t)R_R8, (uintptr_t)R_R9); + } else if (w == iFppLupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppLLiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9); + } else if (w == iFppLLup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFppLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == iFppLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpppiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFpppipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFpppipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == iFpppipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpppuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == iFpppuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == iFpppuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFpppuLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == iFpppupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == iFpppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppplLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == iFpppLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFpppLpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFpppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFppppiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); + } else if (w == iFppppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == iFppppui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); + } else if (w == iFppppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == iFppppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFppppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == iFpppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFpppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == iFpppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == iFpppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFEiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFEiuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFEpippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == uFEpippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFEpCppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFEpuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == uFEpppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); + } else if (w == uFEpppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == uFipuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == uFupuufp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, emu->xmm[0].f[0], (void*)R_R8); + } else if (w == uFuppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFULCLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu8 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI, (uint8_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == uFULWLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu16 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI, (uint16_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == uFULuLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == uFULULLU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uintptr_t)R_RSI, (uint64_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uint64_t)R_R9); + } else if (w == uFUpUpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == uFpiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFpiuppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == uFpWuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFpWuuCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu32 ", %" PRIu32 ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint8_t)R_R8, (void*)R_R9); + } else if (w == uFpuippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFpuuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == uFpuuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFpuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFpuUppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFpupupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == uFpupupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFpupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == uFppuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == uFppuupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == uFppLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == uFppLppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == uFpppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFpppLUL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint64_t)R_R8, (uintptr_t)R_R9); + } else if (w == uFpppLLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9); + } else if (w == uFpppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFppppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == uFppppLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9); + } else if (w == uFppppLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9); + } else if (w == uFppppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == uFpppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == uFpppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == fFlfplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, emu->xmm[0].f[0], (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); + } else if (w == fFpppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == dFpppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == lFEippLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); + } else if (w == lFEpippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == lFipipLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9); + } else if (w == lFipLipu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == lFipLipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == lFipLpLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9); + } else if (w == lFpipill) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9); + } else if (w == lFpuuLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == lFpluuic) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int8_t)R_R9); + } else if (w == lFppuppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == lFppLipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == lFpppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == LFEuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == LFELpppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == LFEpuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == LFEpLppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == LFEppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); + } else if (w == LFpipipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == LFplplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (intptr_t)R_R9); + } else if (w == LFpLippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == LFpLLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9); + } else if (w == LFppipLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == LFpplplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9); + } else if (w == LFppLLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == LFppLpLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9); + } else if (w == LFppLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == pFELpppV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)(R_RSP + 8)); + } else if (w == pFELpApp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFEpiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFEpippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == pFEpippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFEpuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFEpuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFEpuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFEppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFEppupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == pFEppLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == pFEpppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == pFEpppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); + } else if (w == pFEppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); + } else if (w == pFEppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); + } else if (w == pFiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == pFiiiiid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, emu->xmm[0].d[0]); + } else if (w == pFipippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFWCiWCi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ", %" PRIu8 ", %" PRIi32 ", %" PRIu16 ", %" PRIu8 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX, (uint16_t)R_RCX, (uint8_t)R_R8, (int32_t)R_R9); + } else if (w == pFuCCCCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (void*)R_R9); + } else if (w == pFuuipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == pFuuuiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == pFuuuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == pFuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == pFuuuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == pFuuppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == pFuppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFdddddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); + } else if (w == pFLppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFpiiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); + } else if (w == pFpiiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFpiiCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9); + } else if (w == pFpiiuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == pFpiipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == pFpiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFpiLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9); + } else if (w == pFpipipL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == pFpipipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFpipuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == pFpippip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == pFpipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFpuuiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == pFpuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == pFpuuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == pFpuuupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == pFpupuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); + } else if (w == pFpupuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == pFpuppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == pFpupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFplpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFpLuLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFpLuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFpLpLuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == pFpLpLLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9); + } else if (w == pFpLppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == pFpLppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == pFpLppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == pFpLpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == pFppiiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == pFppiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFppiIll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int64_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9); + } else if (w == pFppiCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9); + } else if (w == pFppiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFppilpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFppiLll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9); + } else if (w == pFppipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == pFppippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == pFppippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFppuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == pFppuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFppuLli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9); + } else if (w == pFppupLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9); + } else if (w == pFppuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFpplplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9); + } else if (w == pFpplppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFppLpuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); + } else if (w == pFpppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == pFpppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFpppLii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == pFpppLui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); + } else if (w == pFppppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); + } else if (w == pFppppiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9); + } else if (w == pFpppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == pFpppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == pFpppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFEiipupV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)(R_RSP + 8)); + } else if (w == vFEpuipuV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)(R_RSP + 8)); + } else if (w == vFEpuuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFEpuLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFEpupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFEppippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFEpppLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == vFEpppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFEppppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == vFEppppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); + } else if (w == vFEpppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == vFiiiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFiiuilil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == vFiiffffp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], (void*)R_RDX); + } else if (w == vFiuulipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFiupuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFilipliu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIi32 ", %" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFilulipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi64 ", %" PRIu32 ", %" PRIi64 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFCCCCfff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint8_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == vFuiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFuiiiiiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint8_t*)(R_RSP + 8)); + } else if (w == vFuiiiuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuiuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFuiuiiiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint8_t*)(R_RSP + 8)); + } else if (w == vFuiuiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuiuiiuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint64_t*)(R_RSP + 8)); + } else if (w == vFuiuCiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu8 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFuiupiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFuiupuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuipiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFuipffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); + } else if (w == vFuipdddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == vFuuiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFuuiiiiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint8_t*)(R_RSP + 8)); + } else if (w == vFuuiiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFuuiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuuiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuuiCiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu8 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFuuiCiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu8 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFuuiuiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFuuiuiiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint8_t*)(R_RSP + 8)); + } else if (w == vFuuipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuuuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFuuuiiCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint8_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuuuiuil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == vFuuuiupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFuuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFuuuulll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == vFuuuffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); + } else if (w == vFuuudddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == vFuuffiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFuuddiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == vFuulfplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].f[0], (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9); + } else if (w == vFuuldplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].d[0], (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9); + } else if (w == vFuulluup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuupiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFuuppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFuuppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuffffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0]); + } else if (w == vFudddddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); + } else if (w == vFlfplfpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, emu->xmm[0].f[0], (void*)R_RSI, (intptr_t)R_RDX, emu->xmm[1].f[0], (void*)R_RCX, (intptr_t)R_R8); + } else if (w == vFldpldpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, emu->xmm[0].d[0], (void*)R_RSI, (intptr_t)R_RDX, emu->xmm[1].d[0], (void*)R_RCX, (intptr_t)R_R8); + } else if (w == vFlliiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFlplplff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, emu->xmm[0].f[0], emu->xmm[1].f[0]); + } else if (w == vFlplpldd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, emu->xmm[0].d[0], emu->xmm[1].d[0]); + } else if (w == vFlpplppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == vFLpuLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpiiiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpiiliip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpiiLiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpiipCpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu8 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint8_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpipipiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFpippppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFpuiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpuipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFpuuUUuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFpuupupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFpuupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpupiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFpupuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpuppipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpupppui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFpUiUiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpUuuUip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint64_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpUUUUuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFpfffppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == vFpddiidd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == vFpdddddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); + } else if (w == vFplilppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpLiiiLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFpLiiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFpLiiuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFpLiLiLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpLLiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpLLuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFpLLpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpLpiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFpLppipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFppcuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi8 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int8_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFppiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFppiipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFppiipuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFppiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFppilppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFppipiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFppipipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFppipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFppuiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFppuuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFppuupii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFppupipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFppUuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFppddddu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], (uint32_t)R_RDX); + } else if (w == vFppddpiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); + } else if (w == vFpplplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == vFpplpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFppLpppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFppLpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFpppiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFpppiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpppiupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFpppippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFpppffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); + } else if (w == vFppppiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFppppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFppppiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFpppppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFpppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == vFppppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == vFppppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == vFppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == cFppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFElppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFEpipupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFEpupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFEpUuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFEpLiLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFEpLiLpV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)(R_RSP + 8)); + } else if (w == iFEpLpiiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9); + } else if (w == iFEppiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == iFEppupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); + } else if (w == iFEppuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFEppLpIu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int64_t)R_R8, (uint32_t)R_R9); + } else if (w == iFEpppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFEpppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == iFEpppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFiippppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFiuuuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFiupuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFiupuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFipupupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFippuIup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int64_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFipppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFuiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFuippLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFuupuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFuupppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFuuppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFupupppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == iFpiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpiiiuwp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int16_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpiipiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpiipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpiuiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpiuuuiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == iFpiuLiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpiupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpiLipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpiLuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpiLuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpipiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpipippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpippLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpippppW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint16_t*)(R_RSP + 8)); + } else if (w == iFpippppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpIIpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpCiiuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == iFpWCiWCi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu8 ", %" PRIi32 ", %" PRIu16 ", %" PRIu8 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint8_t)R_RDX, (int32_t)R_RCX, (uint16_t)R_R8, (uint8_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpWppppW) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu16 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint16_t*)(R_RSP + 8)); + } else if (w == iFpWppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpuiCuCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIu8 ", %" PRIu32 ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (uint32_t)R_R8, (uint8_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpuiuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpupiLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == iFpupuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpupupui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpuppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpllpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpLiiiiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == iFpLiiuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpLipipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpLipupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == iFpLpiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpLpiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == iFpLpiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpLpLuLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpLpLpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpLpLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpLpLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpLppiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpLppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFppiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppiiLll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == iFppiipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFppiipiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == iFppipiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFppipiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppipipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppipLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppippip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppipppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFppipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppuipiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == iFppuippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppupupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == iFppupupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppliupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppLiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppLiWwL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu16 ", %" PRIi16 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (uint16_t)R_R8, (int16_t)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == iFppLippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppLuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFppLLupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppLLLLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == iFppLpLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == iFppLpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpppiiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpppiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpppipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpppippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpppippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpppuiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFpppuupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == iFpppulup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpppLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppppilp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppppipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppppIip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int64_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppppupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == iFppppdpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, emu->xmm[0].d[0], (void*)R_R8, (uint32_t)R_R9); + } else if (w == iFppppLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpppppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpppppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFppppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFppppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == iFppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFEiiuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFEiipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFEpiuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFEpuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFEpppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == uFiiiuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == uFuippppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFpippppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFpuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == uFpuuuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFpuuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFpuupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFppiuppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == uFppiuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFppuiupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == uFppuuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFpppLLpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == uFppppLiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == uFppppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == uFppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == fFpppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == fFppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == dFpppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == dFppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == lFpppplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == LFEppLppU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint64_t)R_R9); + } else if (w == LFEpppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); + } else if (w == LFpLLuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == LFpLLppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == LFpLppuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == LFppLpLpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == LFppLppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFEpupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFEpLiiiI) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int64_t)R_R9); + } else if (w == pFEpLiiil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9); + } else if (w == pFEppLipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == pFEppppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == pFEpppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); + } else if (w == pFifffppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); + } else if (w == pFWpppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFuuuiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFuupupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFfiiiiid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, emu->xmm[1].d[0]); + } else if (w == pFduuulul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (uint32_t)R_R8, (intptr_t)R_R9); + } else if (w == pFpiiiiid) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, emu->xmm[0].d[0]); + } else if (w == pFpiiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpiipipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpiiplui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi64 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFpiipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpiuLdii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu64 ", %" PRIf ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, emu->xmm[0].d[0], (int32_t)R_R8, (int32_t)R_R9); + } else if (w == pFpipiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpipippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpWppWpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIp ", %" PRIp ", %" PRIu16 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint16_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpuiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFpupiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpupLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpuppipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpuppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFplppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpLLppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpLpipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpLpLLiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == pFpLppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpLppLLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFppiiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFppiiCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(uint8_t*)(R_RSP + 8)); + } else if (w == pFppiipup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFppiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFppiLiLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFppipipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFppipLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFppuipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFppuippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFppuuupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == pFppuuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFppuLLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFppupuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == pFppliuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpplipup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFppLLiLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFppLLlip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFppLLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpppccci) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi8 ", %" PRIi8 ", %" PRIi8 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int8_t)R_RCX, (int8_t)R_R8, (int8_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFpppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFpppCCCi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFpppuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpppuuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFpppupuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == pFpppupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpppuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFpppfffi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], (int32_t)R_RCX); + } else if (w == pFpppdddi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], (int32_t)R_RCX); + } else if (w == pFpppllli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFpppLLLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFppppiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFppppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFppppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFppppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == pFppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFELippppV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, (void*)(R_RSP + 8)); + } else if (w == vFELupippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFELpAippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFEpuppppV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, (void*)(R_RSP + 8)); + } else if (w == vFEppupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFEppLippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFEppLpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFEpppippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFEpppuipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, (void*)(R_RSP + 8)); + } else if (w == vFEpppLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFEppppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFEpppppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == vFiiiiuuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFiilliilp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFiilluulp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFiupuiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFiupuuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFuiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFuiiiiiiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16)); + } else if (w == vFuiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFuiiipiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFuiuiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFuiuiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFuiuiiiuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint64_t*)(R_RSP + 16)); + } else if (w == vFuiuiiCuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint8_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint64_t*)(R_RSP + 16)); + } else if (w == vFuiuiuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == vFuCCCCfff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); + } else if (w == vFuuiiiiiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16)); + } else if (w == vFuuiiiuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFuuiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFuuiiuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFuuiuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFuuiuiiiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16)); + } else if (w == vFuuiuiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFuuuiiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == vFuuuiuCil) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu8 ", %" PRIi32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint8_t)R_R9, *(int32_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16)); + } else if (w == vFuuuipipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFuuuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == vFuuuulppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16)); + } else if (w == vFuuufffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0]); + } else if (w == vFuulfplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].f[0], (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == vFuuldplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].d[0], (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == vFuullfpll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, emu->xmm[0].f[0], (void*)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == vFuulldpll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, emu->xmm[0].d[0], (void*)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == vFuullppll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16)); + } else if (w == vFffffffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0]); + } else if (w == vFLLLpLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFpiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFpiiiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFpiiiipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFpiiiuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFpiUuupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFpiLLiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFpiLpiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == vFpuiULipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFpudddddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); + } else if (w == vFpuppippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFpuppLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); + } else if (w == vFpUiUiupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFpUuuUUUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint64_t)R_R8, (uint64_t)R_R9, *(uint64_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == vFpliicppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi8 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int8_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFpLiiiLii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFpLLLiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFpLpLpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFpLppiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFppiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFppipipiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == vFppipppui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFppippppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFppippppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFppuuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFppuppiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFppuppiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == vFpplpLplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFpplppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFpplppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFppLLiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFpppiipui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFpppipppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == vFpppuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFpppuulll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16)); + } else if (w == vFpppLpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFppppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFpppppuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == vFppppppui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); + } else if (w == vFpppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); + } else if (w == vFpppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFEuipuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFEpippppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFEpuuLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFEpUUuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFEppipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFEpppiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == iFEpppLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFEppppipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFEppppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFEpppppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == iFEppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFiiupiupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == iFiipppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFiuuCCuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFiuuuupip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFipippppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFuiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFuuuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFupipppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFdiippppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8)); + } else if (w == iFpiiiuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpiiupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpipiipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpippiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == iFpippuuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == iFpippuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpCCWWpWu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu8 ", %" PRIu16 ", %" PRIu16 ", %" PRIp ", %" PRIu16 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8, (void*)R_R9, *(uint16_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFpWCuWCuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu16 ", %" PRIu8 ", %" PRIu32 ", %" PRIu16 ", %" PRIu8 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint16_t)R_RSI, (uint8_t)R_RDX, (uint32_t)R_RCX, (uint16_t)R_R8, (uint8_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFpuiipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpuippLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpuCiuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu8 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint8_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFpuuiiuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFpuuipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpuuuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == iFpuuupupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFpuupuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpuuppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpuuppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpuLLLppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); + } else if (w == iFpupupuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpupppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpUuuLpUu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uint64_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFpduuulul) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIu32 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (uint32_t)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == iFpLiiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpLIIIppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpLLiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpLLLiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == iFpLLppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpLpiLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpLpipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpLpLpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpLppLpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpLpppupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFpLpppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFppiiipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFppillppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFppipiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == iFppIIIppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFppuiiuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFppuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFppuppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFppLpLpLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == iFppLpLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpppiiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == iFpppiiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpppipipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == iFppppiiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFppppiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFppppippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFppppuplu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFpppppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpppppLpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFppppppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == iFppppppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFpppppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == iFpppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == CFuiifpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[0].f[0], (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFEipupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFEpuuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFEppupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFEpppuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFEppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFuipppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == uFuupuuiuf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), emu->xmm[0].f[0]); + } else if (w == uFulpppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == uFpuupupuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == uFpupuuuCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint8_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == uFpupLpupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == uFppuuuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == uFppuuuppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == uFppuppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == uFpppLppLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == uFppppuppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == uFpppppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == fFppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); + } else if (w == fFpppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); + } else if (w == dFppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); + } else if (w == dFpppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); + } else if (w == LFELpupupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); + } else if (w == LFEpuuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == LFpLpuuLLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == LFppLpLpLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == LFppLppLpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == pFEupLLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFEpiipupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFEpiipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFEpiuCppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu8 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFEpuLpupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFEppLiiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFEpppuipV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, (void*)(R_RSP + 8)); + } else if (w == pFEpppppiV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, (void*)(R_RSP + 8)); + } else if (w == pFEppppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFEppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == pFiippipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFiupppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFuiiiuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == pFuCCCCpWw) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIp ", %" PRIu16 ", %" PRIi16 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (void*)R_R9, *(uint16_t*)(R_RSP + 8), *(int16_t*)(R_RSP + 16)); + } else if (w == pFuupupipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFpiiiiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == pFpipiuiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFpuuuuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFpuuuupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFpuLdiiLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, emu->xmm[0].d[0], (int32_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8)); + } else if (w == pFpupLLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFpupppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFplpppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFpLuLpLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFpLpipLup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFpLpLLiLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == pFpLppuLLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFpLppLLiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); + } else if (w == pFppiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == pFpppipipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == pFppplippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFppppuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFpppppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFEpuuuippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFEpuppippV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), (void*)(R_RSP + 16)); + } else if (w == vFEpuppippA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFEppuipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFEpppuippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFEpppLLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFEppppippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFiiiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFiiiiiiill) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); + } else if (w == vFiiiiillli) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFiiilllilp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFiupuiuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFiupuuuuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFuiiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFuiiiiiiiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24)); + } else if (w == vFuiiiiiuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFuiiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFuiuiiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFuiuiiiCuU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ", %" PRIu32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint8_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint64_t*)(R_RSP + 24)); + } else if (w == vFuiupuffup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, emu->xmm[0].f[0], emu->xmm[1].f[0], (uint32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuuiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFuuiiiiiiC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24)); + } else if (w == vFuuiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFuuiuiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFuuiuiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFuuuiiiiCp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu8 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFuuuuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == vFuuuulplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); + } else if (w == vFuulfplplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].f[0], (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFuuldplplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].d[0], (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFuullfplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, emu->xmm[0].f[0], (void*)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16)); + } else if (w == vFuulldplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, emu->xmm[0].d[0], (void*)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16)); + } else if (w == vFuullpplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); + } else if (w == vFuulpplplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFuupuuiuuf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), emu->xmm[0].f[0]); + } else if (w == vFuffffffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0]); + } else if (w == vFullfplfpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].f[0], (void*)R_RCX, (intptr_t)R_R8, emu->xmm[1].f[0], (void*)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == vFulldpldpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].d[0], (void*)R_RCX, (intptr_t)R_R8, emu->xmm[1].d[0], (void*)R_R9, *(intptr_t*)(R_RSP + 8)); + } else if (w == vFullpplppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); + } else if (w == vFffCCCCfff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], (uint8_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0]); + } else if (w == vFddddddddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0], emu->xmm[6].d[0], emu->xmm[7].d[0], *(double*)(R_RSP + 8)); + } else if (w == vFpiuippppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFpiLLpiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFpiLpLiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFpipiuiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFpuuCiuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu8 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == vFpuuuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == vFpuppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFpLiiipiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFpLpLpLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFpLpppippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFppiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFppiiiiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFppiiiiupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFppiupiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFppippDpDc) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRILf ", %" PRIp ", %" PRILf ", %" PRIi8 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, LD2localLD((void*)(R_RSP + 8)), (void*)R_R9, LD2localLD((void*)(R_RSP + 24)), *(int8_t*)(R_RSP + 40)); + } else if (w == vFppipppiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFppuippiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFppuuiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFppuuiiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == vFppuppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFppupppiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFppupppiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == vFppupppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFppUUuUUUU) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint32_t)R_R8, (uint64_t)R_R9, *(uint64_t*)(R_RSP + 8), *(uint64_t*)(R_RSP + 16), *(uint64_t*)(R_RSP + 24)); + } else if (w == vFppddddudd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIu32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], (uint32_t)R_RDX, emu->xmm[4].d[0], emu->xmm[5].d[0]); + } else if (w == vFpplpppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFpppiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFpppiiiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFpppffffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0]); + } else if (w == vFppppiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFppppipiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); + } else if (w == vFpppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); + } else if (w == vFppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); + } else if (w == vFppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFEpiiiiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == iFEppiipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFEppuppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFEpppupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFEppplPPPP) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFEppppLppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFEpppppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFEppppppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == iFEppPPPPPP) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == iFiuuuppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == iFuiiuuiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFuiiupiiup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFuuppuuppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == iFdddpppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); + } else if (w == iFpiuippppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == iFpiLiiipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFpiLLLiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFpuuuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == iFpuuuuuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFpuuuuduup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, emu->xmm[0].d[0], (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpuuuLiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFpuuuLpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFpuuppupuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == iFpduuuLuLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == iFpLiuiiLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); + } else if (w == iFpLLiiuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == iFpLpiiuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == iFpLpLpLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFpLpppupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFpLppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFppiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == iFppipiiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == iFppippippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFppuLLpupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFppupuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == iFppuppuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == iFppupppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFppLiipiiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); + } else if (w == iFppLLupppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); + } else if (w == iFppLpiuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFpppiiipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFpppippipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == iFpppLLLupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFpppLppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFppppiiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFppppLpLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFpppppiIII) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int64_t*)(R_RSP + 8), *(int64_t*)(R_RSP + 16), *(int64_t*)(R_RSP + 24)); + } else if (w == iFpppppLupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFppppppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFppppppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == iFppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == uFEipuppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == uFEppuipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == uFEpppufppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIf ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, emu->xmm[0].f[0], (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == uFuulpiuiuf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), emu->xmm[0].f[0]); + } else if (w == uFpuupuppuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == uFppLpLuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == uFppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == fFppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); + } else if (w == fFpppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); + } else if (w == dFppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); + } else if (w == dFpppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); + } else if (w == lFpppipiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == lFpppippppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == LFEppppppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == LFpLiiiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == LFpLiiuuuLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); + } else if (w == pFEpiipiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFEpiipuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFEpiippupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFEpLiiuuLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == pFEppuippuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); + } else if (w == pFEpppppiiV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), (void*)(R_RSP + 16)); + } else if (w == pFEpppppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == pFEpppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == pFuupuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == pFpiiiiuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); + } else if (w == pFpLpLLipui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == pFpLppLLiLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == pFppupppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == pFpppiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == pFpppuipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == pFpppppiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFEiuppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFEpuppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFEpppuipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFEppplliupi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == vFEpppLuLpLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFEppppppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == vFiiiiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFiiiiiiiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); + } else if (w == vFiiiiiiiiui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFiiiiiiiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); + } else if (w == vFiiillliiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFuiiiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFuiiiiiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFuiiiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFuiuiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFuuiiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFuuiiiiiuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFuuiiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFuuiuiiiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFuuuuuuuCCC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24), *(uint8_t*)(R_RSP + 32)); + } else if (w == vFuuuuuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); + } else if (w == vFuuuullplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32)); + } else if (w == vFuulfplplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].f[0], (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); + } else if (w == vFuulfpplfpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].f[0], (void*)R_RCX, (void*)R_R8, (intptr_t)R_R9, emu->xmm[1].f[0], *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16)); + } else if (w == vFuuldplplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].d[0], (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); + } else if (w == vFuuldppldpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].d[0], (void*)R_RCX, (void*)R_R8, (intptr_t)R_R9, emu->xmm[1].d[0], *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16)); + } else if (w == vFuulpplplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32)); + } else if (w == vFuulppplppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32)); + } else if (w == vFuupuiupuuf) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), emu->xmm[0].f[0]); + } else if (w == vFuffiiffiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[2].f[0], emu->xmm[3].f[0], (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFuddiiddiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[2].d[0], emu->xmm[3].d[0], (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); + } else if (w == vFullfplplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].f[0], (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); + } else if (w == vFulldplplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].d[0], (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); + } else if (w == vFullpplplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32)); + } else if (w == vFffffffffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8), *(float*)(R_RSP + 16)); + } else if (w == vFpiuippppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFpipipippip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFpuuuupupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFpuupuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); + } else if (w == vFppiiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFppiiiiupip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFppipipippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFppuipppiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFppuuuiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFppuuuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); + } else if (w == vFppuuppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFppuuppppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFppuppuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFppupppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFppdddddddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0], emu->xmm[6].d[0], emu->xmm[7].d[0]); + } else if (w == vFppppiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFppppppppii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == vFppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32)); + } else if (w == vFpppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32)); + } else if (w == vFpppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFEipiipippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); + } else if (w == iFEpiiiiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFEpuppupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFEpupppLppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); + } else if (w == iFEppLuppupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFEppppppipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFEpppppppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == iFiuuupppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); + } else if (w == iFuiiiuuiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFpiiupWWupL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu16 ", %" PRIu16 ", %" PRIu32 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint16_t)R_R9, *(uint16_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32)); + } else if (w == iFpiiuppppWp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint16_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFpiiLiiipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFpiLLiiipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFpiLLdduudd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIf ", %" PRIf ", %" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, emu->xmm[0].d[0], emu->xmm[1].d[0], (uint32_t)R_R8, (uint32_t)R_R9, emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == iFpipiipippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == iFpCuWCCCCup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu32 ", %" PRIu16 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(uint8_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFpuuLiuiiLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32)); + } else if (w == iFpLLpiiuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == iFpLpLUUUUpL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint64_t)R_R8, (uint64_t)R_R9, *(uint64_t*)(R_RSP + 8), *(uint64_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32)); + } else if (w == iFppuuiiuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); + } else if (w == iFppuppppupu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); + } else if (w == iFppLLiiLWpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIu16 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uint16_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == iFppLpLLpLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFppLpLpLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFpppiiipipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == iFpppLLipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFpppppiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFpppppppipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == iFpppppppppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); + } else if (w == uFpuuuuuuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == uFpddpippppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIf ", %" PRIf ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == uFpppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == lFpLppdddddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); + } else if (w == pFEiuppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == pFEpiiiiiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == pFEpiipWWupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu16 ", %" PRIu16 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint16_t)R_R8, (uint16_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == pFEpippppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == pFEpuppupppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); + } else if (w == pFpuupuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); + } else if (w == pFpupLLLLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == pFplllllllll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(intptr_t*)(R_RSP + 24), *(intptr_t*)(R_RSP + 32)); + } else if (w == pFppippLLLip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == pFppuiipuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == pFppuuLLuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == pFpppiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == pFpppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFEppLpLpLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == vFiiiiillliip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == vFiiiiilllilp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == vFuiiiiiiiuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == vFuiiiiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == vFuiiiillliip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == vFuiuiiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == vFuuiiiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == vFuuullfplfpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, emu->xmm[0].f[0], (void*)R_R9, *(intptr_t*)(R_RSP + 8), emu->xmm[1].f[0], *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); + } else if (w == vFuuulldpldpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, emu->xmm[0].d[0], (void*)R_R9, *(intptr_t*)(R_RSP + 8), emu->xmm[1].d[0], *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); + } else if (w == vFuuullpplppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(intptr_t*)(R_RSP + 40)); + } else if (w == vFuuupupppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == vFuuffiiffiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], (int32_t)R_RDX, (int32_t)R_RCX, emu->xmm[2].f[0], emu->xmm[3].f[0], (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuufffffffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8)); + } else if (w == vFuuddiiddiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RDX, (int32_t)R_RCX, emu->xmm[2].d[0], emu->xmm[3].d[0], (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); + } else if (w == vFuulfplplfpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].f[0], (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), emu->xmm[1].f[0], *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); + } else if (w == vFuuldplpldpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].d[0], (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), emu->xmm[1].d[0], *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); + } else if (w == vFuulpplplppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(intptr_t*)(R_RSP + 40)); + } else if (w == vFuUuuuuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40)); + } else if (w == vFuffffffffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8), *(float*)(R_RSP + 16)); + } else if (w == vFUufffffffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint64_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8)); + } else if (w == vFpiiiiiiiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40)); + } else if (w == vFpiLLpiiiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == vFpiLpLiiiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == vFpipipiipiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40)); + } else if (w == vFpupuuupupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == vFppiiiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == vFppiiiiipiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == vFppiiiiupiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == vFppiiiiddddi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], *(int32_t*)(R_RSP + 8)); + } else if (w == vFppiipppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == vFppuuiiiiuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == vFppuuppiiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40)); + } else if (w == vFppuupppiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == vFppupipiuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40)); + } else if (w == vFppupppuiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == vFppddddddddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0], emu->xmm[6].d[0], emu->xmm[7].d[0], *(double*)(R_RSP + 8)); + } else if (w == vFpppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40)); + } else if (w == vFppppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40)); + } else if (w == vFppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == iFEiipppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFEpLppiiiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); + } else if (w == iFEppLpLpLLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFEpppupppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFEpppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == iFuiiiiuuiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == iFuppipipippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == iFpiiLLiiipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == iFpippupppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == iFpuppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == iFpLipiiiippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == iFpLLpiiuuiiL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40)); + } else if (w == iFppippipppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == iFppuupLiupii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == iFppuppLLpupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == iFppLLupppLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == iFpppiiuuiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40)); + } else if (w == iFpppippppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == iFpppppiiuupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == uFEpLuupppLuV) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), (void*)(R_RSP + 32)); + } else if (w == uFEpLuppppLup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == uFEpLuppppLuA) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == uFEppppppuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == uFpuuuuuuuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == uFppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == fFppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40)); + } else if (w == dFppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40)); + } else if (w == pFEpiipppiupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == pFEpipppppppi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == pFEppiiLpppip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); + } else if (w == pFEppuiipuuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); + } else if (w == pFpppppppuipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == pFppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == vFuiiiiiiiiuUC) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu64 ", %" PRIu8 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint64_t*)(R_RSP + 40), *(uint8_t*)(R_RSP + 48)); + } else if (w == vFuiiiiiiiuuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == vFuuiiiiiiiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48)); + } else if (w == vFuuiiiiiiiuip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == vFuuiiiiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == vFuuuuuuuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48)); + } else if (w == vFuuuuullfplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), emu->xmm[0].f[0], *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(intptr_t*)(R_RSP + 40)); + } else if (w == vFuuuuulldplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), emu->xmm[0].d[0], *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(intptr_t*)(R_RSP + 40)); + } else if (w == vFuuuuullpplpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(intptr_t*)(R_RSP + 48)); + } else if (w == vFuullfplplfpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, emu->xmm[0].f[0], (void*)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), emu->xmm[1].f[0], *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32)); + } else if (w == vFuulldplpldpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, emu->xmm[0].d[0], (void*)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), emu->xmm[1].d[0], *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32)); + } else if (w == vFuullpplplppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(intptr_t*)(R_RSP + 48)); + } else if (w == vFffffffffffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8), *(float*)(R_RSP + 16), *(float*)(R_RSP + 24), *(float*)(R_RSP + 32)); + } else if (w == vFpiLLpiiiipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); + } else if (w == vFpiLLpLiiiipi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); + } else if (w == vFpiLpLiiiipui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); + } else if (w == vFpupppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == vFpLiiuuuiupLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == vFppiiiiiiiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48)); + } else if (w == vFppiiiiddddii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); + } else if (w == vFppiipppiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); + } else if (w == vFppuuppuiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); + } else if (w == vFppuupppiiiiu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48)); + } else if (w == vFppdddddddddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0], emu->xmm[6].d[0], emu->xmm[7].d[0], *(double*)(R_RSP + 8), *(double*)(R_RSP + 16)); + } else if (w == vFpppiiiiiiuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); + } else if (w == vFpppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40), *(uintptr_t*)(R_RSP + 48)); + } else if (w == vFppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40), *(uintptr_t*)(R_RSP + 48)); + } else if (w == vFpppppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(uintptr_t*)(R_RSP + 48)); + } else if (w == vFpppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == iFEpLppiiiiuui) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == iFEpppuppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == iFpiLlliLppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == iFpiLppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == iFpCCCWCWCCCWp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu16 ", %" PRIu8 ", %" PRIu16 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu16 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint16_t)R_R8, (uint8_t)R_R9, *(uint16_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24), *(uint8_t*)(R_RSP + 32), *(uint16_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == iFpLLlliLppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == iFpLpuuLpLpppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(uintptr_t*)(R_RSP + 48)); + } else if (w == iFpLpppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == iFppLlliLppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == iFpppipipiipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); + } else if (w == iFpppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == uFpuupppppuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48)); + } else if (w == uFpppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == pFEpLiiuuLipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); + } else if (w == pFEppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); + } else if (w == pFWWiCCCCiipup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu16 ", %" PRIu16 ", %" PRIi32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint16_t)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(uint8_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == pFppippLLLiLpp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == pFppuuppppuppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == pFpppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == vFEpppppppuippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == vFuiiiiiiiiiuup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == vFuuuuuuuuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56)); + } else if (w == vFuuullfplplfpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, emu->xmm[0].f[0], (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24), emu->xmm[1].f[0], *(void**)(R_RSP + 32), *(intptr_t*)(R_RSP + 40)); + } else if (w == vFuuulldplpldpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, emu->xmm[0].d[0], (void*)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24), emu->xmm[1].d[0], *(void**)(R_RSP + 32), *(intptr_t*)(R_RSP + 40)); + } else if (w == vFuuullpplplfpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), emu->xmm[0].f[0], *(void**)(R_RSP + 40), *(intptr_t*)(R_RSP + 48)); + } else if (w == vFuuullpplpldpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), emu->xmm[0].d[0], *(void**)(R_RSP + 40), *(intptr_t*)(R_RSP + 48)); + } else if (w == vFuuullpplplppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(intptr_t*)(R_RSP + 56)); + } else if (w == vFuUuuuuuuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56)); + } else if (w == vFuffffffffffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8), *(float*)(R_RSP + 16), *(float*)(R_RSP + 24), *(float*)(R_RSP + 32)); + } else if (w == vFpiLLLiiiiiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56)); + } else if (w == vFpippppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == vFpLppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == vFppiiiiiiuiuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56)); + } else if (w == vFppuuppiiiiuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56)); + } else if (w == vFppuupppuiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56)); + } else if (w == vFppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40), *(uintptr_t*)(R_RSP + 48), *(uintptr_t*)(R_RSP + 56)); + } else if (w == vFpppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(uintptr_t*)(R_RSP + 48), *(uintptr_t*)(R_RSP + 56)); + } else if (w == vFppppppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(uintptr_t*)(R_RSP + 56)); + } else if (w == vFppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == iFiuuuuiiuuuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56)); + } else if (w == iFddddpppddpppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[4].d[0], emu->xmm[5].d[0], (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); + } else if (w == iFpiiuppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == iFpippuuuiipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == iFpLLlliiLppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == iFppppppLLLLupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == uFippuuuulllipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(intptr_t*)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == uFpppppuupppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == LFEpLiiuuuiupLp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); + } else if (w == pFppLppppiiLpip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == pFpppppppuipppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == pFppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); + } else if (w == vFippppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64)); + } else if (w == vFuuuullfplplfpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, emu->xmm[0].f[0], *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), emu->xmm[1].f[0], *(void**)(R_RSP + 40), *(intptr_t*)(R_RSP + 48)); + } else if (w == vFuuuulldplpldpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, emu->xmm[0].d[0], *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), emu->xmm[1].d[0], *(void**)(R_RSP + 40), *(intptr_t*)(R_RSP + 48)); + } else if (w == vFuuuullpplplppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(intptr_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(intptr_t*)(R_RSP + 64)); + } else if (w == vFuuulllfplplfpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, emu->xmm[0].f[0], *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), emu->xmm[1].f[0], *(void**)(R_RSP + 40), *(intptr_t*)(R_RSP + 48)); + } else if (w == vFuuullldplpldpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, emu->xmm[0].d[0], *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), emu->xmm[1].d[0], *(void**)(R_RSP + 40), *(intptr_t*)(R_RSP + 48)); + } else if (w == vFuuulllpplplppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(intptr_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(intptr_t*)(R_RSP + 64)); + } else if (w == vFuullllfplplfpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, emu->xmm[0].f[0], *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), emu->xmm[1].f[0], *(void**)(R_RSP + 40), *(intptr_t*)(R_RSP + 48)); + } else if (w == vFuulllldplpldpl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIf ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, emu->xmm[0].d[0], *(void**)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), emu->xmm[1].d[0], *(void**)(R_RSP + 40), *(intptr_t*)(R_RSP + 48)); + } else if (w == vFuullllpplplppl) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIi64 ", %" PRIp ", %" PRIp ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(intptr_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(intptr_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(intptr_t*)(R_RSP + 64)); + } else if (w == vFuffiiffiiffiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[2].f[0], emu->xmm[3].f[0], (int32_t)R_RCX, (int32_t)R_R8, emu->xmm[4].f[0], emu->xmm[5].f[0], (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFuddiiddiiddiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[2].d[0], emu->xmm[3].d[0], (int32_t)R_RCX, (int32_t)R_R8, emu->xmm[4].d[0], emu->xmm[5].d[0], (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == vFppiipppiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64)); + } else if (w == vFppuupppiiiiuii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64)); + } else if (w == vFpppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(uintptr_t*)(R_RSP + 48), *(uintptr_t*)(R_RSP + 56), *(uintptr_t*)(R_RSP + 64)); + } else if (w == vFppppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(uintptr_t*)(R_RSP + 56), *(uintptr_t*)(R_RSP + 64)); + } else if (w == vFpppppppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(uintptr_t*)(R_RSP + 64)); + } else if (w == vFpppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64)); + } else if (w == iFpipppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64)); + } else if (w == iFppupppLLLLpupp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64)); + } else if (w == iFpppwwWWwwWWpuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi16 ", %" PRIi16 ", %" PRIu16 ", %" PRIu16 ", %" PRIi16 ", %" PRIi16 ", %" PRIu16 ", %" PRIu16 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int16_t)R_RCX, (int16_t)R_R8, (uint16_t)R_R9, *(uint16_t*)(R_RSP + 8), *(int16_t*)(R_RSP + 16), *(int16_t*)(R_RSP + 24), *(uint16_t*)(R_RSP + 32), *(uint16_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(uint32_t*)(R_RSP + 56), *(uint32_t*)(R_RSP + 64)); + } else if (w == vFuiiiiiuiiiiilll) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(intptr_t*)(R_RSP + 56), *(intptr_t*)(R_RSP + 64), *(intptr_t*)(R_RSP + 72)); + } else if (w == vFuuiiiiuuiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(int32_t*)(R_RSP + 72)); + } else if (w == vFfffffffffffffff) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8), *(float*)(R_RSP + 16), *(float*)(R_RSP + 24), *(float*)(R_RSP + 32), *(float*)(R_RSP + 40), *(float*)(R_RSP + 48), *(float*)(R_RSP + 56)); + } else if (w == vFpUUUUUUUUUUUuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (uint64_t)R_R9, *(uint64_t*)(R_RSP + 8), *(uint64_t*)(R_RSP + 16), *(uint64_t*)(R_RSP + 24), *(uint64_t*)(R_RSP + 32), *(uint64_t*)(R_RSP + 40), *(uint64_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56), *(uint32_t*)(R_RSP + 64), *(uint32_t*)(R_RSP + 72)); + } else if (w == vFpppippppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); + } else if (w == vFpppppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(uintptr_t*)(R_RSP + 64), *(uintptr_t*)(R_RSP + 72)); + } else if (w == vFppppppppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(uintptr_t*)(R_RSP + 72)); + } else if (w == vFppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); + } else if (w == iFuupiupuuppuppup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(uint32_t*)(R_RSP + 64), *(void**)(R_RSP + 72)); + } else if (w == uFpuupppppuupuuuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56), *(uint32_t*)(R_RSP + 64), *(uint32_t*)(R_RSP + 72)); + } else if (w == pFpuiippppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); + } else if (w == pFppipppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); + } else if (w == pFppupppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); + } else if (w == pFppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); + } else if (w == vFuppppppppppppplp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIi64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(intptr_t*)(R_RSP + 72), *(void**)(R_RSP + 80)); + } else if (w == vFpppppppppppLLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(uintptr_t*)(R_RSP + 48), *(uintptr_t*)(R_RSP + 56), *(uintptr_t*)(R_RSP + 64), *(uintptr_t*)(R_RSP + 72), *(uintptr_t*)(R_RSP + 80)); + } else if (w == vFpppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(uintptr_t*)(R_RSP + 64), *(uintptr_t*)(R_RSP + 72), *(uintptr_t*)(R_RSP + 80)); + } else if (w == vFppppppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(uintptr_t*)(R_RSP + 72), *(uintptr_t*)(R_RSP + 80)); + } else if (w == vFpppppppppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(uintptr_t*)(R_RSP + 80)); + } else if (w == vFpppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80)); + } else if (w == iFpiiuppppWppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu16 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint16_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80)); + } else if (w == iFpppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80)); + } else if (w == pFpipppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80)); + } else if (w == pFppipipipipipipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(void**)(R_RSP + 64), *(int32_t*)(R_RSP + 72), *(void**)(R_RSP + 80)); + } else if (w == pFppupupupupupupup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(uint32_t*)(R_RSP + 56), *(void**)(R_RSP + 64), *(uint32_t*)(R_RSP + 72), *(void**)(R_RSP + 80)); + } else if (w == pFpppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80)); + } else if (w == vFuuuuiiiiuuiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(int32_t*)(R_RSP + 72), *(int32_t*)(R_RSP + 80), *(int32_t*)(R_RSP + 88)); + } else if (w == vFppiiiiddddiiiiiuu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56)); + } else if (w == vFpppuppiipppuUUUpi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint64_t*)(R_RSP + 56), *(uint64_t*)(R_RSP + 64), *(uint64_t*)(R_RSP + 72), *(void**)(R_RSP + 80), *(int32_t*)(R_RSP + 88)); + } else if (w == vFppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(uintptr_t*)(R_RSP + 72), *(uintptr_t*)(R_RSP + 80), *(uintptr_t*)(R_RSP + 88)); + } else if (w == vFpppppppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(uintptr_t*)(R_RSP + 80), *(uintptr_t*)(R_RSP + 88)); + } else if (w == vFppppppppppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(uintptr_t*)(R_RSP + 88)); + } else if (w == pFppippipipipipipip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(void**)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(void**)(R_RSP + 72), *(int32_t*)(R_RSP + 80), *(void**)(R_RSP + 88)); + } else if (w == vFppuiiiiipuiiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(int32_t*)(R_RSP + 72), *(int32_t*)(R_RSP + 80), *(int32_t*)(R_RSP + 88), *(int32_t*)(R_RSP + 96)); + } else if (w == vFppuuiiiipuuiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(int32_t*)(R_RSP + 72), *(int32_t*)(R_RSP + 80), *(int32_t*)(R_RSP + 88), *(int32_t*)(R_RSP + 96)); + } else if (w == vFpppipppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96)); + } else if (w == vFpppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(uintptr_t*)(R_RSP + 80), *(uintptr_t*)(R_RSP + 88), *(uintptr_t*)(R_RSP + 96)); + } else if (w == vFppppppppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(uintptr_t*)(R_RSP + 88), *(uintptr_t*)(R_RSP + 96)); + } else if (w == vFpppppppppppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(uintptr_t*)(R_RSP + 96)); + } else if (w == iFpppppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96)); + } else if (w == LFpppppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96)); + } else if (w == pFippppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96)); + } else if (w == pFpupppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96)); + } else if (w == vFpiiiiiiiiiiiiiiiiii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(int32_t*)(R_RSP + 72), *(int32_t*)(R_RSP + 80), *(int32_t*)(R_RSP + 88), *(int32_t*)(R_RSP + 96), *(int32_t*)(R_RSP + 104)); + } else if (w == vFpppppppppppppppLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(uintptr_t*)(R_RSP + 80), *(uintptr_t*)(R_RSP + 88), *(uintptr_t*)(R_RSP + 96), *(uintptr_t*)(R_RSP + 104)); + } else if (w == vFppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(uintptr_t*)(R_RSP + 88), *(uintptr_t*)(R_RSP + 96), *(uintptr_t*)(R_RSP + 104)); + } else if (w == vFpppppppppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(uintptr_t*)(R_RSP + 96), *(uintptr_t*)(R_RSP + 104)); + } else if (w == vFppppppppppppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(uintptr_t*)(R_RSP + 104)); + } else if (w == pFiiiippppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104)); + } else if (w == pFppppppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104)); + } else if (w == vFpppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(uintptr_t*)(R_RSP + 96), *(uintptr_t*)(R_RSP + 104), *(uintptr_t*)(R_RSP + 112)); + } else if (w == vFppppppppppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(uintptr_t*)(R_RSP + 104), *(uintptr_t*)(R_RSP + 112)); + } else if (w == vFpppppppppppppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(uintptr_t*)(R_RSP + 112)); + } else if (w == pFpupupppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112)); + } else if (w == vFppppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(uintptr_t*)(R_RSP + 104), *(uintptr_t*)(R_RSP + 112), *(uintptr_t*)(R_RSP + 120)); + } else if (w == vFpppppppppppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(uintptr_t*)(R_RSP + 112), *(uintptr_t*)(R_RSP + 120)); + } else if (w == vFppppppppppppppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(uintptr_t*)(R_RSP + 120)); + } else if (w == vFppppppppppppppppppLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(uintptr_t*)(R_RSP + 104), *(uintptr_t*)(R_RSP + 112), *(uintptr_t*)(R_RSP + 120), *(uintptr_t*)(R_RSP + 128)); + } else if (w == vFpppppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(uintptr_t*)(R_RSP + 112), *(uintptr_t*)(R_RSP + 120), *(uintptr_t*)(R_RSP + 128)); + } else if (w == vFppppppppppppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(uintptr_t*)(R_RSP + 120), *(uintptr_t*)(R_RSP + 128)); + } else if (w == iFpppppppppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128)); + } else if (w == vFppppppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(uintptr_t*)(R_RSP + 120), *(uintptr_t*)(R_RSP + 128), *(uintptr_t*)(R_RSP + 136)); + } else if (w == vFpppppppppppppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(uintptr_t*)(R_RSP + 128), *(uintptr_t*)(R_RSP + 136)); + } else if (w == vFppppppppppppppppppppppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(uintptr_t*)(R_RSP + 136)); + } else if (w == uFippuuuuiiiiuuiiiiiiiipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIu32 ", %" PRIu32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(int32_t*)(R_RSP + 72), *(int32_t*)(R_RSP + 80), *(int32_t*)(R_RSP + 88), *(int32_t*)(R_RSP + 96), *(int32_t*)(R_RSP + 104), *(int32_t*)(R_RSP + 112), *(int32_t*)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136)); + } else if (w == vFpppppppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(uintptr_t*)(R_RSP + 128), *(uintptr_t*)(R_RSP + 136), *(uintptr_t*)(R_RSP + 144)); + } else if (w == vFppppppppppppppppppppppLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(uintptr_t*)(R_RSP + 136), *(uintptr_t*)(R_RSP + 144)); + } else if (w == vFpppppppppppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144)); + } else if (w == vFpppppppppppppppppppLLLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(uintptr_t*)(R_RSP + 112), *(uintptr_t*)(R_RSP + 120), *(uintptr_t*)(R_RSP + 128), *(uintptr_t*)(R_RSP + 136), *(uintptr_t*)(R_RSP + 144), *(uintptr_t*)(R_RSP + 152)); + } else if (w == vFppppppppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(uintptr_t*)(R_RSP + 136), *(uintptr_t*)(R_RSP + 144), *(uintptr_t*)(R_RSP + 152)); + } else if (w == vFppppppppppppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152)); + } else if (w == pFpupuupppppppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ", %" PRIp ", %" PRIu32 ", %" PRIu32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152)); + } else if (w == vFppppppppppppppppppppppLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(uintptr_t*)(R_RSP + 136), *(uintptr_t*)(R_RSP + 144), *(uintptr_t*)(R_RSP + 152), *(uintptr_t*)(R_RSP + 160)); + } else if (w == vFpppppppppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(uintptr_t*)(R_RSP + 144), *(uintptr_t*)(R_RSP + 152), *(uintptr_t*)(R_RSP + 160)); + } else if (w == iFpppppppppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(uintptr_t*)(R_RSP + 144), *(uintptr_t*)(R_RSP + 152), *(uintptr_t*)(R_RSP + 160)); + } else if (w == vFpppppppppppppppppppppLLLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(uintptr_t*)(R_RSP + 128), *(uintptr_t*)(R_RSP + 136), *(uintptr_t*)(R_RSP + 144), *(uintptr_t*)(R_RSP + 152), *(uintptr_t*)(R_RSP + 160), *(uintptr_t*)(R_RSP + 168)); + } else if (w == vFppppppppppppppppppppppLLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(uintptr_t*)(R_RSP + 136), *(uintptr_t*)(R_RSP + 144), *(uintptr_t*)(R_RSP + 152), *(uintptr_t*)(R_RSP + 160), *(uintptr_t*)(R_RSP + 168)); + } else if (w == vFpppppppppppppppppppppppLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(uintptr_t*)(R_RSP + 144), *(uintptr_t*)(R_RSP + 152), *(uintptr_t*)(R_RSP + 160), *(uintptr_t*)(R_RSP + 168)); + } else if (w == vFppppppppppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(uintptr_t*)(R_RSP + 152), *(uintptr_t*)(R_RSP + 160), *(uintptr_t*)(R_RSP + 168)); + } else if (w == iFppppppppppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(uintptr_t*)(R_RSP + 152), *(uintptr_t*)(R_RSP + 160), *(uintptr_t*)(R_RSP + 168)); + } else if (w == vFpppppppppppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(uintptr_t*)(R_RSP + 160), *(uintptr_t*)(R_RSP + 168), *(uintptr_t*)(R_RSP + 176)); + } else if (w == iFpppppppppppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(uintptr_t*)(R_RSP + 160), *(uintptr_t*)(R_RSP + 168), *(uintptr_t*)(R_RSP + 176)); + } else if (w == vFppppppppppppppppppppppppppLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(void**)(R_RSP + 160), *(uintptr_t*)(R_RSP + 168), *(uintptr_t*)(R_RSP + 176), *(uintptr_t*)(R_RSP + 184)); + } else if (w == vFpppppppppppppppppppppppppppppLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(void**)(R_RSP + 160), *(void**)(R_RSP + 168), *(void**)(R_RSP + 176), *(void**)(R_RSP + 184), *(uintptr_t*)(R_RSP + 192), *(uintptr_t*)(R_RSP + 200), *(uintptr_t*)(R_RSP + 208), *(uintptr_t*)(R_RSP + 216)); + } else if (w == vFpppppppppppppppppppppppppppppLLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(void**)(R_RSP + 160), *(void**)(R_RSP + 168), *(void**)(R_RSP + 176), *(void**)(R_RSP + 184), *(uintptr_t*)(R_RSP + 192), *(uintptr_t*)(R_RSP + 200), *(uintptr_t*)(R_RSP + 208), *(uintptr_t*)(R_RSP + 216), *(uintptr_t*)(R_RSP + 224)); + } else if (w == vFppppppppppppppppppppppppppppppLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(void**)(R_RSP + 160), *(void**)(R_RSP + 168), *(void**)(R_RSP + 176), *(void**)(R_RSP + 184), *(void**)(R_RSP + 192), *(uintptr_t*)(R_RSP + 200), *(uintptr_t*)(R_RSP + 208), *(uintptr_t*)(R_RSP + 216), *(uintptr_t*)(R_RSP + 224)); + } else if (w == iFpppppppppppppppppppppppppppppppppp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(void**)(R_RSP + 160), *(void**)(R_RSP + 168), *(void**)(R_RSP + 176), *(void**)(R_RSP + 184), *(void**)(R_RSP + 192), *(void**)(R_RSP + 200), *(void**)(R_RSP + 208), *(void**)(R_RSP + 216), *(void**)(R_RSP + 224)); + } else if (w == vFpppppppppppppppppppppppppppppppLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(void**)(R_RSP + 160), *(void**)(R_RSP + 168), *(void**)(R_RSP + 176), *(void**)(R_RSP + 184), *(void**)(R_RSP + 192), *(void**)(R_RSP + 200), *(uintptr_t*)(R_RSP + 208), *(uintptr_t*)(R_RSP + 216), *(uintptr_t*)(R_RSP + 224), *(uintptr_t*)(R_RSP + 232)); + } else if (w == vFppppppppppppppppppppppppppppppLLLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(void**)(R_RSP + 160), *(void**)(R_RSP + 168), *(void**)(R_RSP + 176), *(void**)(R_RSP + 184), *(void**)(R_RSP + 192), *(uintptr_t*)(R_RSP + 200), *(uintptr_t*)(R_RSP + 208), *(uintptr_t*)(R_RSP + 216), *(uintptr_t*)(R_RSP + 224), *(uintptr_t*)(R_RSP + 232), *(uintptr_t*)(R_RSP + 240)); + } else if (w == vFppppppppppppppppppppppppppppppppLLLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(void**)(R_RSP + 160), *(void**)(R_RSP + 168), *(void**)(R_RSP + 176), *(void**)(R_RSP + 184), *(void**)(R_RSP + 192), *(void**)(R_RSP + 200), *(void**)(R_RSP + 208), *(uintptr_t*)(R_RSP + 216), *(uintptr_t*)(R_RSP + 224), *(uintptr_t*)(R_RSP + 232), *(uintptr_t*)(R_RSP + 240), *(uintptr_t*)(R_RSP + 248), *(uintptr_t*)(R_RSP + 256)); + } else if (w == vFppppppppppppppppppppppppppppppppppLLLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(void**)(R_RSP + 160), *(void**)(R_RSP + 168), *(void**)(R_RSP + 176), *(void**)(R_RSP + 184), *(void**)(R_RSP + 192), *(void**)(R_RSP + 200), *(void**)(R_RSP + 208), *(void**)(R_RSP + 216), *(void**)(R_RSP + 224), *(uintptr_t*)(R_RSP + 232), *(uintptr_t*)(R_RSP + 240), *(uintptr_t*)(R_RSP + 248), *(uintptr_t*)(R_RSP + 256), *(uintptr_t*)(R_RSP + 264), *(uintptr_t*)(R_RSP + 272)); + } else if (w == vFpppppppppppppppppppppppppppppppppppLLLLLL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(void**)(R_RSP + 160), *(void**)(R_RSP + 168), *(void**)(R_RSP + 176), *(void**)(R_RSP + 184), *(void**)(R_RSP + 192), *(void**)(R_RSP + 200), *(void**)(R_RSP + 208), *(void**)(R_RSP + 216), *(void**)(R_RSP + 224), *(void**)(R_RSP + 232), *(uintptr_t*)(R_RSP + 240), *(uintptr_t*)(R_RSP + 248), *(uintptr_t*)(R_RSP + 256), *(uintptr_t*)(R_RSP + 264), *(uintptr_t*)(R_RSP + 272), *(uintptr_t*)(R_RSP + 280)); +#if defined(NOALIGN) + } else if (w == iFipipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); +#endif +#if !defined(NOALIGN) + } else if (w == iFELp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (void*)R_RSI); + } else if (w == iFEppu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); + } else if (w == iFEiiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); + } else if (w == iFEipii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFEipiip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); + } else if (w == iFEipipp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); +#endif +#if !defined(STATICBUILD) + } else if (w == iFEpu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint32_t)R_RSI); + } else if (w == iFlip) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi64 ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (intptr_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); + } else if (w == iFLLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); + } else if (w == iFLLii) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (uintptr_t)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); + } else if (w == WFpLLu) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIu32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); + } else if (w == pFpLLi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); + } else if (w == iFEipup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); + } else if (w == iFEiipup) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); + } else if (w == iFEpipppL) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); + } else if (w == iFiiULippp) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); + } else if (w == lFpLpdddddd) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu64 ", %" PRIp ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); +#endif + } + else +#endif // HAVE_TRACE + { + snprintf(buff, buffsz, "%04d|%p: Calling %s(0x%lX, 0x%lX, 0x%lX, ...)", tid, *(void**)(R_RSP), func, R_RDI, R_RSI, R_RDX); + } +} diff --git a/src/emu/x64run.c b/src/emu/x64run.c index 01eda2a..98b3388 100644 --- a/src/emu/x64run.c +++ b/src/emu/x64run.c @@ -4,30 +4,33 @@ #include #include #include -#include #include #include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64stack.h" +#include "box64cpu_util.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" #include "x64trace.h" #include "x87emu_private.h" #include "box64context.h" -#include "bridge.h" -#include "signals.h" +#include "alternate.h" +#include "emit_signals.h" +#include "mysignal.h" #ifdef DYNAREC #include "../dynarec/native_lock.h" #endif +#ifdef HAVE_TRACE +#include "elfloader.h" +#endif #include "modrm.h" -int my_setcontext(x64emu_t* emu, void* ucp); - #ifdef TEST_INTERPRETER int RunTest(x64test_t *test) #else @@ -51,10 +54,9 @@ int Run(x64emu_t *emu, int step) #endif uintptr_t addr = R_RIP; rex_t rex = {0}; - int rep; // 0 none, 1=F2 prefix, 2=F3 prefix int unimp = 0; int is32bits = (emu->segs[_CS]==0x23); - int tf_next = 0; + int tf = ACCESS_FLAG(F_TF); if(emu->quit) return 0; @@ -68,6 +70,7 @@ int Run(x64emu_t *emu, int step) #ifdef TEST_INTERPRETER test->memsize = 0; #else + CheckExec(emu, R_RIP); x64emurun: while(1) #endif @@ -82,26 +85,104 @@ int Run(x64emu_t *emu, int step) #endif emu->old_ip = addr; + #ifndef TEST_INTERPRETER + // check the TRACE flag before going to next + if(tf) { + if(emu->flags.no_tf) + emu->flags.no_tf = 0; + else { + R_RIP = addr; + EmitSignal(emu, X64_SIGTRAP, (void*)addr, 1); + if(emu->quit) goto fini; + } + } +#endif + opcode = F8; - rep = 0; - while((opcode==0xF2) || (opcode==0xF3) || (opcode==0x3E) || (opcode==0x26)) { + rex.rex = 0; + rex.seg = 0; + rex.offset = 0; + rex.is32bits = is32bits; + rex.is66 = 0; + rex.is67 = 0; + rex.isf0 = 0; + rex.rep = 0; + while((opcode==0xF2) || (opcode==0xF3) || (opcode==0xF0) + || (opcode==0x3E) || (opcode==0x26) || (opcode==0x2e) || (opcode==0x36) + || (opcode==0x64) || (opcode==0x65) || (opcode==0x66) || (opcode==0x67) + || (!is32bits && (opcode>=0x40 && opcode<=0x4f))) { switch (opcode) { - case 0xF2: rep = 1; break; - case 0xF3: rep = 2; break; - case 0x3E: - case 0x26: /* ignored*/ break; + case 0xF0: rex.isf0 = 1; rex.rex = 0; break; + case 0xF2: rex.rep = 1; rex.rex = 0; break; + case 0xF3: rex.rep = 2; rex.rex = 0; break; + case 0x26: /* ES: */ + case 0x2E: /* CS: */ + case 0x36: /* SS; */ + case 0x3E: /* DS; */ + rex.seg = 0; rex.rex = 0; break; + case 0x64: rex.seg = _FS; rex.rex = 0; break; + case 0x65: rex.seg = _GS; rex.rex = 0; break; + case 0x66: rex.is66 = 1; rex.rex = 0; break; + case 0x67: rex.is67 = 1; rex.rex = 0; break; + case 0x40 ... 0x4F: rex.rex = opcode; break; } opcode = F8; } - rex.rex = 0; - rex.is32bits = is32bits; - if(!is32bits) - while(opcode>=0x40 && opcode<=0x4f) { - rex.rex = opcode; - opcode = F8; - } + if(rex.seg) + #ifdef TEST_INTERPRETER + rex.offset = GetSegmentBaseEmu(test->ref, rex.seg); + #else + rex.offset = GetSegmentBaseEmu(emu, rex.seg); + #endif + + if(rex.isf0) { + /* LOCK prefix */ + if(rex.is66 && !rex.w) { + #ifdef TEST_INTERPRETER + if(!(addr = Test66F0(test, rex, addr-1))) + unimp = 1; + #else + if(!(addr = Run66F0(emu, rex, addr-1))) { + unimp = 1; + goto fini; + } + #endif + } else { + #ifdef TEST_INTERPRETER + if(!(addr = TestF0(test, rex, addr-1))) + unimp = 1; + #else + if(!(addr = RunF0(emu, rex, addr-1))) { + unimp = 1; + goto fini; + } + #endif + } + #ifndef TEST_INTERPRETER + if(emu->quit) { + R_RIP = addr; + goto fini; + } + #endif + } else if(rex.is66) { + /* 16bits prefix */ + #ifdef TEST_INTERPRETER + if(!(addr = Test66(test, rex, addr-1, &step))) + unimp = 1; + #else + if(!(addr = Run66(emu, rex, addr-1, &step))) { + unimp = 1; + goto fini; + } + if(emu->quit) { + R_RIP = addr; + goto fini; + } + tf = ACCESS_FLAG(F_TF); + #endif + } else switch(opcode) { #define GO(B, OP) \ @@ -152,29 +233,28 @@ int Run(x64emu_t *emu, int step) GO(0x00, add) /* ADD 0x00 -> 0x05 */ case 0x06: /* PUSH ES */ if(!rex.is32bits) { - unimp = 1; + unimp = 2; goto fini; } Push32(emu, emu->segs[_ES]); // even if a segment is a 16bits, a 32bits push/pop is done break; case 0x07: /* POP ES */ if(!rex.is32bits) { - unimp = 1; + unimp = 2; goto fini; } emu->segs[_ES] = Pop32(emu); // no check, no use.... - emu->segs_serial[_ES] = 0; break; GO(0x08, or) /* OR 0x08 -> 0x0D */ case 0x0E: /* PUSH CS */ if(!rex.is32bits) { - unimp = 1; + unimp = 2; goto fini; } Push32(emu, emu->segs[_CS]); // even if a segment is a 16bits, a 32bits push/pop is done break; case 0x0F: /* More instructions */ - switch(rep) { + switch(rex.rep) { case 1: #ifdef TEST_INTERPRETER if(!(addr = TestF20F(test, rex, addr, &step))) @@ -191,10 +271,10 @@ int Run(x64emu_t *emu, int step) break; case 2: #ifdef TEST_INTERPRETER - if(!(addr = TestF30F(test, rex, addr))) + if(!(addr = TestF30F(test, rex, addr, &step))) unimp = 1; #else - if(!(addr = RunF30F(emu, rex, addr))) { + if(!(addr = RunF30F(emu, rex, addr, &step))) { unimp = 1; goto fini; } @@ -229,41 +309,40 @@ int Run(x64emu_t *emu, int step) case 0x16: /* PUSH SS */ if(!rex.is32bits) { - unimp = 1; + unimp = 2; goto fini; } Push32(emu, emu->segs[_SS]); // even if a segment is a 16bits, a 32bits push/pop is done break; case 0x17: /* POP SS */ if(!rex.is32bits) { - unimp = 1; + unimp = 2; goto fini; } emu->segs[_SS] = Pop32(emu); // no check, no use.... - emu->segs_serial[_SS] = 0; + tf = 0; break; case 0x1E: /* PUSH DS */ if(!rex.is32bits) { - unimp = 1; + unimp = 2; goto fini; } Push32(emu, emu->segs[_DS]); // even if a segment is a 16bits, a 32bits push/pop is done break; case 0x1F: /* POP DS */ if(!rex.is32bits) { - unimp = 1; + unimp = 2; goto fini; } emu->segs[_DS] = Pop32(emu); // no check, no use.... - emu->segs_serial[_DS] = 0; break; case 0x27: /* DAA */ if(rex.is32bits) { R_AL = daa8(emu, R_AL); } else { - unimp = 1; + unimp = 2; goto fini; } break; @@ -271,7 +350,7 @@ int Run(x64emu_t *emu, int step) if(rex.is32bits) { R_AL = das8(emu, R_AL); } else { - unimp = 1; + unimp = 2; goto fini; } break; @@ -283,7 +362,7 @@ int Run(x64emu_t *emu, int step) if(rex.is32bits) { R_AX = aaa16(emu, R_AX); } else { - unimp = 1; + unimp = 2; goto fini; } break; @@ -331,7 +410,7 @@ int Run(x64emu_t *emu, int step) if(rex.is32bits) { R_AX = aas16(emu, R_AX); } else { - emit_signal(emu, SIGILL, (void*)R_RIP, 0); + unimp = 2; goto fini; } break; @@ -392,7 +471,7 @@ int Run(x64emu_t *emu, int step) case 0x5E: case 0x5F: /* POP Reg */ tmp8u = (opcode&7)+(rex.b<<3); - emu->regs[tmp8u].q[0] = is32bits?Pop32(emu):Pop64(emu); + emu->regs[tmp8u].q[0] = rex.is32bits?Pop32(emu):Pop64(emu); break; case 0x60: /* PUSHAD */ if(rex.is32bits) { @@ -406,7 +485,7 @@ int Run(x64emu_t *emu, int step) Push32(emu, R_ESI); Push32(emu, R_EDI); } else { - unimp = 1; + unimp = 2; goto fini; } break; @@ -421,16 +500,19 @@ int Run(x64emu_t *emu, int step) R_ECX = Pop32(emu); R_EAX = Pop32(emu); } else { - unimp = 1; + unimp = 2; goto fini; } break; case 0x62: /* BOUND Gd, Ed */ - if(rex.is32bits) { - nextop = F8; - FAKEED(0); + nextop = F8; + if(rex.is32bits && !MODREG) { + GETGD; + int* bounds = (int*)GETEA(0); + if((GD->sdword[0]sdword[0]>bounds[1])) + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xb09d); } else { - unimp = 1; + unimp = 2; goto fini; } break; @@ -452,72 +534,7 @@ int Run(x64emu_t *emu, int step) GD->sdword[0] = ED->sdword[0]; // meh? } break; - case 0x64: /* FS: prefix */ - #ifdef TEST_INTERPRETER - if(!(addr = Test64(test, rex, _FS, addr))) - unimp = 1; - #else - if(!(addr = Run64(emu, rex, _FS, addr))) { - unimp = 1; - goto fini; - } - if(emu->quit) { - R_RIP = addr; - goto fini; - } - is32bits = (emu->segs[_CS]==0x23); - if(is32bits) - running32bits = 1; - #endif - break; - case 0x65: /* GS: prefix */ - #ifdef TEST_INTERPRETER - if(!(addr = Test64(test, rex, _GS, addr))) - unimp = 1; - #else - if(!(addr = Run64(emu, rex, _GS, addr))) { - unimp = 1; - goto fini; - } - if(emu->quit) { - R_RIP = addr; - goto fini; - } - is32bits = (emu->segs[_CS]==0x23); - if(is32bits) - running32bits = 1; - #endif - break; - case 0x66: /* 16bits prefix */ - #ifdef TEST_INTERPRETER - if(!(addr = Test66(test, rex, rep, addr))) - unimp = 1; - #else - if(!(addr = Run66(emu, rex, rep, addr))) { - unimp = 1; - goto fini; - } - if(emu->quit) { - R_RIP = addr; - goto fini; - } - #endif - break; - case 0x67: /* reduce EASize prefix */ - #ifdef TEST_INTERPRETER - if(!(addr = Test67(test, rex, rep, addr))) - unimp = 1; - #else - if(!(addr = Run67(emu, rex, rep, addr))) { - unimp = 1; - goto fini; - } - if(emu->quit) { - R_RIP = addr; - goto fini; - } - #endif - break; + case 0x68: /* Push Id */ if(rex.is32bits) Push32(emu, F32); @@ -557,26 +574,25 @@ int Run(x64emu_t *emu, int step) case 0x6D: /* INSD DX */ case 0x6E: /* OUTSB DX */ case 0x6F: /* OUTSD DX */ - #ifndef TEST_INTERPRETER - emit_signal(emu, SIGSEGV, (void*)R_RIP, 0); +#ifndef TEST_INTERPRETER + if(rex.is32bits && BOX64ENV(ignoreint3)) + { + } else { + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); + } STEP; - #else - test->notest = 1; #endif break; GOCOND(0x70 , tmp8s = F8S; CHECK_FLAGS(emu); - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif , addr += tmp8s; ,,STEP2 ) /* Jxx Ib */ case 0x82: if(!rex.is32bits) { - unimp = 1; + unimp = 2; goto fini; } // fallthru @@ -776,16 +792,25 @@ int Run(x64emu_t *emu, int step) case 0x8C: /* MOV Ed, Seg */ nextop = F8; GETED(0); + tmp8u = (nextop&0x38)>>3; + if(tmp8u>5) { + unimp = 2; + goto fini; + } if(MODREG) - ED->q[0] = emu->segs[((nextop&0x38)>>3)]; + ED->q[0] = emu->segs[tmp8u]; else - ED->word[0] = emu->segs[((nextop&0x38)>>3)]; + ED->word[0] = emu->segs[tmp8u]; break; case 0x8D: /* LEA Gd,M */ nextop = F8; + if(MODREG) { + unimp = 2; + goto fini; + } GETGD; tmp64u = GETEA(0); - if(rex.w) + if (rex.w && !rex.is67) GD->q[0] = tmp64u; else GD->q[0] = tmp64u&0xffffffff; @@ -793,27 +818,45 @@ int Run(x64emu_t *emu, int step) case 0x8E: /* MOV Seg, Ew */ nextop = F8; GETED(0); - emu->segs[((nextop&0x38)>>3)] = ED->word[0]; - emu->segs_serial[((nextop&0x38)>>3)] = 0; + tmp8u = (nextop&0x38)>>3; + if((tmp8u>5) || (tmp8u==1)) { + unimp = 2; + goto fini; + } + emu->segs[tmp8u] = ED->word[0]; + if(((tmp8u==_FS) || (tmp8u==_GS)) && emu->segs[tmp8u]) + GetSegmentBaseEmu(emu, tmp8u); // refresh segs_offs + if(tmp8u==_SS && tf) // disable trace when SS is accessed + emu->flags.no_tf = 1; break; case 0x8F: /* POP Ed */ nextop = F8; - if(MODREG) { - emu->regs[(nextop&7)+(rex.b<<3)].q[0] = rex.is32bits?Pop32(emu):Pop64(emu); - } else { - if(rex.is32bits) { - tmp32u = Pop32(emu); // this order allows handling POP [ESP] and variant - GETED(0); - R_ESP -= 4; // to prevent issue with SEGFAULT - ED->dword[0] = tmp32u; - R_ESP += 4; - } else { - tmp64u = Pop64(emu); // this order allows handling POP [ESP] and variant - GETED(0); - R_RSP -= sizeof(void*); // to prevent issue with SEGFAULT - ED->q[0] = tmp64u; - R_RSP += sizeof(void*); - } + switch((nextop>>3)&7) { + case 0: + if(MODREG) { + emu->regs[(nextop&7)+(rex.b<<3)].q[0] = rex.is32bits?Pop32(emu):Pop64(emu); + } else { + if(rex.is32bits) { + tmp32u = Pop32(emu); // this order allows handling POP [ESP] and variant + GETED(0); + R_ESP -= 4; // to prevent issue with SEGFAULT + ED->dword[0] = tmp32u; + R_ESP += 4; + } else { + tmp64u = Pop64(emu); // this order allows handling POP [ESP] and variant + GETED(0); + R_RSP -= sizeof(void*); // to prevent issue with SEGFAULT + ED->q[0] = tmp64u; + R_RSP += sizeof(void*); + } + } + break; + case 3: + unimp = 2; + goto fini; + default: + unimp = 1; + goto fini; } break; case 0x90: /* NOP or XCHG R8, RAX*/ @@ -852,7 +895,31 @@ int Run(x64emu_t *emu, int step) else R_RDX=(R_EAX & 0x80000000)?0x00000000FFFFFFFFLL:0x0000000000000000LL; break; - + case 0x9A: /* CALL FAR seg:off*/ + if(is32bits) { + uint32_t new_addr = (rex.is32bits && rex.is66)?(F16):(F32); + uint16_t new_cs = F16; + Push32(emu, emu->segs[_CS]); + Push32(emu, addr); + #ifndef TEST_INTERPRETER + if((new_cs&3)!=3) { + // R_RIP doesn't advance + printf_log(LOG_INFO, "Warning, unexpected new_cs=0x%x at %p\n", new_cs, (void*)R_RIP); + R_RSP-=(rex.w?4:8)*2; + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); // GP if trying to change priv level + goto fini; + } + emu->segs[_CS] = new_cs; + addr = new_addr; + if(is32bits!=(emu->segs[_CS]==0x23)) { + is32bits = (emu->segs[_CS]==0x23); + } + #endif + } else { + unimp = 2; + goto fini; + } + STEP2; case 0x9B: /* FWAIT */ break; case 0x9C: /* PUSHF */ @@ -863,12 +930,11 @@ int Run(x64emu_t *emu, int step) Push64(emu, emu->eflags.x64); break; case 0x9D: /* POPF */ - if(ACCESS_FLAG(F_TF) && !tf_next) - --tf_next; - emu->eflags.x64 = (((rex.is32bits?Pop32(emu):Pop64(emu)) & 0x3F7FD7)/* & (0xffff-40)*/ ) | 0x202; // mask off res2 and res3 and on res1 + emu->eflags.x64 = (((rex.is32bits?Pop32(emu):Pop64(emu)) & 0x3E7FD7)/* & (0xffff-40)*/ ) | 0x202; // mask off res2 and res3 and on res1 RESET_FLAGS(emu); - if(ACCESS_FLAG(F_TF)) - ++tf_next; + if(!tf && ACCESS_FLAG(F_TF)) + emu->flags.no_tf = 1; // delay the effect to next opcode + tf = ACCESS_FLAG(F_TF); break; case 0x9E: /* SAHF */ CHECK_FLAGS(emu); @@ -885,40 +951,57 @@ int Run(x64emu_t *emu, int step) R_AH = (uint8_t)emu->eflags.x64; break; case 0xA0: /* MOV AL,Ob */ - if(rex.is32bits) - R_AL = *(uint8_t*)(uintptr_t)F32; + if(rex.is32bits && rex.is67) + R_AL = *(uint8_t*)(uintptr_t)(ptr_t)(rex.offset+F16S); + else if(rex.is32bits || rex.is67) + R_AL = *(uint8_t*)(uintptr_t)(ptr_t)(F32+rex.offset); else - R_AL = *(uint8_t*)F64; + R_AL = *(uint8_t*)(F64+rex.offset); break; case 0xA1: /* MOV EAX,Od */ - if(rex.is32bits) - R_EAX = *(int32_t*)(uintptr_t)F32; - else { + if(rex.is32bits && rex.is67) + R_EAX = *(uint32_t*)(uintptr_t)(ptr_t)(rex.offset+F16S); + else if(rex.is32bits || rex.is67) { if(rex.w) - R_RAX = *(uint64_t*)F64; + R_RAX = *(int64_t*)(uintptr_t)(ptr_t)(F32+rex.offset); + else { + R_EAX = *(int32_t*)(uintptr_t)(ptr_t)(F32+rex.offset); + if(!rex.is32bits) + R_RAX = R_EAX; + } + } else { + if(rex.w) + R_RAX = *(uint64_t*)(F64+rex.offset); else - R_RAX = *(uint32_t*)F64; + R_RAX = *(uint32_t*)(F64+rex.offset); } break; case 0xA2: /* MOV Ob,AL */ - if(rex.is32bits) - *(uint8_t*)(uintptr_t)F32 = R_AL; + if(rex.is32bits && rex.is67) + *(uint8_t*)(uintptr_t)(ptr_t)(rex.offset+F16S) = R_AL; + else if(rex.is32bits || rex.is67) + *(uint8_t*)(uintptr_t)(ptr_t)(F32+rex.offset) = R_AL; else - *(uint8_t*)F64 = R_AL; + *(uint8_t*)(F64+rex.offset) = R_AL; break; case 0xA3: /* MOV Od,EAX */ - if(rex.is32bits) - *(uint32_t*)(uintptr_t)F32 = R_EAX; - else { + if(rex.is32bits && rex.is67) + *(uint32_t*)(uintptr_t)(ptr_t)(rex.offset+F16S) = R_EAX; + else if(rex.is32bits || rex.is67) { + if(rex.w) + *(uint64_t*)(uintptr_t)(ptr_t)(F32+rex.offset) = R_RAX; + else + *(uint32_t*)(uintptr_t)(ptr_t)(F32+rex.offset) = R_EAX; + } else { if(rex.w) - *(uint64_t*)F64 = R_RAX; + *(uint64_t*)(F64+rex.offset) = R_RAX; else - *(uint32_t*)F64 = R_EAX; + *(uint32_t*)(F64+rex.offset) = R_EAX; } break; case 0xA4: /* MOVSB */ tmp8s = ACCESS_FLAG(F_DF)?-1:+1; - tmp64u = (rep)?R_RCX:1L; + tmp64u = (rex.rep)?R_RCX:1L; while(tmp64u) { #ifndef TEST_INTERPRETER *(uint8_t*)R_RDI = *(uint8_t*)R_RSI; @@ -927,12 +1010,12 @@ int Run(x64emu_t *emu, int step) R_RSI += tmp8s; --tmp64u; } - if(rep) + if(rex.rep) R_RCX = tmp64u; break; case 0xA5: /* (REP) MOVSD */ tmp8s = ACCESS_FLAG(F_DF)?-1:+1; - tmp64u = (rep)?R_RCX:1L; + tmp64u = (rex.rep)?R_RCX:1L; if(rex.w) { tmp8s *= 8; while(tmp64u) { @@ -954,12 +1037,12 @@ int Run(x64emu_t *emu, int step) R_RSI += tmp8s; } } - if(rep) + if(rex.rep) R_RCX = tmp64u; break; case 0xA6: /* (REPZ/REPNE) CMPSB */ tmp8s = ACCESS_FLAG(F_DF)?-1:+1; - switch(rep) { + switch(rex.rep) { case 1: if(R_RCX) { while(R_RCX) { @@ -1001,7 +1084,7 @@ int Run(x64emu_t *emu, int step) tmp8s = ACCESS_FLAG(F_DF)?-8:+8; else tmp8s = ACCESS_FLAG(F_DF)?-4:+4; - switch(rep) { + switch(rex.rep) { case 1: if(R_RCX) { if(rex.w) { @@ -1084,7 +1167,7 @@ int Run(x64emu_t *emu, int step) case 0xAA: /* (REP) STOSB */ tmp8s = ACCESS_FLAG(F_DF)?-1:+1; - tmp64u = (rep)?R_RCX:1L; + tmp64u = (rex.rep)?R_RCX:1L; while(tmp64u) { #ifndef TEST_INTERPRETER *(uint8_t*)R_RDI = R_AL; @@ -1092,7 +1175,7 @@ int Run(x64emu_t *emu, int step) R_RDI += tmp8s; --tmp64u; } - if(rep) + if(rex.rep) R_RCX = tmp64u; break; case 0xAB: /* (REP) STOSD */ @@ -1100,7 +1183,7 @@ int Run(x64emu_t *emu, int step) tmp8s = ACCESS_FLAG(F_DF)?-8:+8; else tmp8s = ACCESS_FLAG(F_DF)?-4:+4; - tmp64u = (rep)?R_RCX:1L; + tmp64u = (rex.rep)?R_RCX:1L; if((rex.w)) while(tmp64u) { #ifndef TEST_INTERPRETER @@ -1115,18 +1198,18 @@ int Run(x64emu_t *emu, int step) R_RDI += tmp8s; --tmp64u; } - if(rep) + if(rex.rep) R_RCX = tmp64u; break; case 0xAC: /* LODSB */ tmp8s = ACCESS_FLAG(F_DF)?-1:+1; - tmp64u = (rep)?R_RCX:1L; + tmp64u = (rex.rep)?R_RCX:1L; while(tmp64u) { R_AL = *(uint8_t*)R_RSI; R_RSI += tmp8s; --tmp64u; } - if(rep) + if(rex.rep) R_RCX = tmp64u; break; case 0xAD: /* (REP) LODSD */ @@ -1134,7 +1217,7 @@ int Run(x64emu_t *emu, int step) tmp8s = ACCESS_FLAG(F_DF)?-8:+8; else tmp8s = ACCESS_FLAG(F_DF)?-4:+4; - tmp64u = (rep)?R_RCX:1L; + tmp64u = (rex.rep)?R_RCX:1L; if((rex.w)) while(tmp64u) { R_RAX = *(uint64_t*)R_RSI; @@ -1147,12 +1230,12 @@ int Run(x64emu_t *emu, int step) R_RSI += tmp8s; --tmp64u; } - if(rep) + if(rex.rep) R_RCX = tmp64u; break; case 0xAE: /* (REPZ/REPNE) SCASB */ tmp8s = ACCESS_FLAG(F_DF)?-1:+1; - switch(rep) { + switch(rex.rep) { case 1: if(R_RCX) { while(R_RCX) { @@ -1187,7 +1270,7 @@ int Run(x64emu_t *emu, int step) tmp8s = ACCESS_FLAG(F_DF)?-8:+8; else tmp8s = ACCESS_FLAG(F_DF)?-4:+4; - switch(rep) { + switch(rex.rep) { case 1: if(R_RCX) { if(rex.w) { @@ -1333,24 +1416,17 @@ int Run(x64emu_t *emu, int step) addr = rex.is32bits?Pop32(emu):Pop64(emu); R_RSP += tmp16u; STEP2 - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; case 0xC3: /* RET */ addr = rex.is32bits?Pop32(emu):Pop64(emu); STEP2 - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; case 0xC4: /* LES Gd,Ed */ nextop = F8; if(rex.is32bits && !(MODREG)) { GETED(0); GETGD; - emu->segs[_ES] = *(__uint16_t*)(((char*)ED)+4); - emu->segs_serial[_ES] = 0; + emu->segs[_ES] = *(uint16_t*)(((char*)ED) + 4); GD->dword[0] = *(uint32_t*)ED; } else { vex_t vex = {0}; @@ -1384,8 +1460,7 @@ int Run(x64emu_t *emu, int step) if(rex.is32bits && !(MODREG)) { GETED(0); GETGD; - emu->segs[_DS] = *(__uint16_t*)(((char*)ED)+4); - emu->segs_serial[_DS] = 0; + emu->segs[_DS] = *(uint16_t*)(((char*)ED) + 4); GD->dword[0] = *(uint32_t*)ED; } else { vex_t vex = {0}; @@ -1416,18 +1491,31 @@ int Run(x64emu_t *emu, int step) case 0xC6: /* MOV Eb,Ib */ nextop = F8; GETEB(1); - EB->byte[0] = F8; + switch((nextop>>3)&7) { + case 0: EB->byte[0] = F8; break; + case 7: unimp = 2; goto fini; + default: + unimp = 1; + goto fini; + } break; case 0xC7: /* MOV Ed,Id */ nextop = F8; GETED(4); - if(rex.w) - ED->q[0] = F32S64; - else - if(MODREG) - ED->q[0] = F32; - else - ED->dword[0] = F32; + switch((nextop>>3)&7) { + case 0: + if(rex.w) + ED->q[0] = F32S64; + else + if(MODREG) + ED->q[0] = F32; + else + ED->dword[0] = F32; + break; + default: + unimp = 1; + goto fini; + } break; case 0xC8: /* ENTER Iw,Ib */ tmp16u = F16; @@ -1463,102 +1551,157 @@ int Run(x64emu_t *emu, int step) break; case 0xCA: /* FAR RETN */ tmp16u = F16; - if(rex.is32bits) { + if(rex.is32bits || !rex.w) { addr = Pop32(emu); emu->segs[_CS] = Pop32(emu); // no check, no use.... } else { addr = Pop64(emu); emu->segs[_CS] = Pop64(emu); // no check, no use.... } - emu->segs_serial[_CS] = 0; R_RSP += tmp16u; - // need to check status of CS register! + is32bits = (R_CS==0x23); // checking if CS changed + #ifndef TEST_INTERPRETER + if(is32bits) + running32bits = 1; + #endif STEP2; break; case 0xCB: /* FAR RET */ - if(rex.is32bits) { + if(rex.is32bits || !rex.w) { addr = Pop32(emu); - emu->segs[_CS] = Pop32(emu); // no check, no use.... + emu->segs[_CS] = Pop32(emu); // no check.... } else { addr = Pop64(emu); - emu->segs[_CS] = Pop64(emu); // no check, no use.... + emu->segs[_CS] = Pop64(emu); // no check.... } - emu->segs_serial[_CS] = 0; - // need to check status of CS register! + is32bits = (R_CS==0x23); // checking if CS changed + #ifndef TEST_INTERPRETER + if(is32bits) + running32bits = 1; + #endif STEP2; break; case 0xCC: /* INT 3 */ + R_RIP = addr; // update RIP #ifndef TEST_INTERPRETER - x64Int3(emu, &addr); + EmuInt3(emu, &addr); if(emu->quit) goto fini; // R_RIP is up to date when returning from x64Int3 addr = R_RIP; - #else - test->notest = 1; #endif break; case 0xCD: /* INT n */ tmp8u = F8; + #ifdef _WIN32 + #ifndef TEST_INTERPRETER + EmitInterruption(emu, tmp8u, (void*)R_RIP); + STEP; + addr = R_RIP; + #endif + #else // this is a privilege opcode... if(box64_wine && tmp8u==0x2D) { // lets ignore the INT 2D printf_log(LOG_DEBUG, "INT 2D called\n"); - emit_interruption(emu, 0x2d, (void*)R_RIP); + EmitInterruption(emu, 0x2d, (void*)R_RIP); } else if(box64_wine && tmp8u==0x2c) { printf_log(LOG_DEBUG, "INT 2c called\n"); - emit_interruption(emu, 0x2c, (void*)R_RIP); + EmitInterruption(emu, 0x2c, (void*)R_RIP); } else if(box64_wine && tmp8u==0x29) { // INT 29 is __fastfail printf_log(LOG_DEBUG, "INT 29 called => __fastfail(0x%x)\n", R_ECX); - emit_interruption(emu, 0x29, (void*)R_RIP); + EmitInterruption(emu, 0x29, (void*)R_RIP); } else if (tmp8u==0x80) { + R_RIP = addr; + if(tf) emu->flags.no_tf = 1; // 32bits syscall #ifndef TEST_INTERPRETER - x86Syscall(emu); - STEP; - #else - test->notest = 1; + EmuX86Syscall(emu); + STEP2; + #endif + } else if (tmp8u==0x03) { + R_RIP = addr; + #ifndef TEST_INTERPRETER + EmitSignal(emu, X64_SIGTRAP, NULL, 3); + STEP2; #endif } else { + if(rex.is32bits && tmp8u==0x04) { + R_RIP = addr; + } #ifndef TEST_INTERPRETER - emit_signal(emu, SIGSEGV, (void*)R_RIP, 0); - STEP; - #else - test->notest = 1; + EmitInterruption(emu, tmp8u, (void*)R_RIP); + STEP2; #endif } + #endif break; case 0xCE: /* INTO */ if(!rex.is32bits) { - unimp = 1; + unimp = 2; goto fini; } emu->old_ip = R_RIP; + R_RIP = addr; #ifndef TEST_INTERPRETER CHECK_FLAGS(emu); if(ACCESS_FLAG(F_OF)) - emit_signal(emu, SIGSEGV, (void*)R_RIP, 128); - STEP; + EmitInterruption(emu, 4, (void*)R_RIP); + STEP2; #endif break; case 0xCF: /* IRET */ - addr = rex.is32bits?Pop32(emu):Pop64(emu); - emu->segs[_CS] = (rex.is32bits?Pop32(emu):Pop64(emu))&0xffff; - emu->segs_serial[_CS] = 0; - emu->eflags.x64 = (((rex.is32bits?Pop32(emu):Pop64(emu)) & 0x3F7FD7)/* & (0xffff-40)*/ ) | 0x2; // mask off res2 and res3 and on res1 - tmp64u = rex.is32bits?Pop32(emu):Pop64(emu); //RSP - emu->segs[_SS] = (rex.is32bits?Pop32(emu):Pop64(emu))&0xffff; - emu->segs_serial[_SS] = 0; - R_RSP = tmp64u; - RESET_FLAGS(emu); - R_RIP = addr; + { + uintptr_t new_addr = (!rex.w)?Pop32(emu):Pop64(emu); + uint32_t new_cs = ((!rex.w)?Pop32(emu):Pop64(emu))&0xffff; + #ifndef TEST_INTERPRETER + if((new_cs&3)!=3) { + // R_RIP doesn't advance + printf_log(LOG_INFO, "Warning, unexpected new_cs=0x%x at %p\n", new_cs, (void*)R_RIP); + R_RSP-=(rex.w?4:8)*2; + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); // GP if trying to change priv level + goto fini; + } + #endif + RESET_FLAGS(emu); + uint64_t new_flags = ((((!rex.w)?Pop32(emu):Pop64(emu)) & 0x3E7FD7)/* & (0xffff-40)*/ ) | 0x2; // mask off res2 and res3 and on res1 and RF + if(!is32bits || (is32bits && (new_cs!=0x23))) { + uintptr_t new_sp = (!rex.w)?Pop32(emu):Pop64(emu); + uint32_t new_ss = ((!rex.w)?Pop32(emu):Pop64(emu))&0xffff; + if(!new_ss || ((new_ss&3)!=3)) { + // R_RIP doesn't advance + printf_log(LOG_INFO, "Warning, unexpected new_ss=0x%x at %p\n", new_cs, (void*)R_RIP); + R_RSP-=(rex.w?4:8)*5; + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); // GPF + goto fini; + } + R_RSP = new_sp; + emu->segs[_SS] = new_ss; + } + emu->eflags.x64 = new_flags; + tf = ACCESS_FLAG(F_TF); + emu->segs[_CS] = new_cs; + addr = new_addr; + R_RIP = addr; + if(is32bits!=(emu->segs[_CS]==0x23)) { + is32bits = (emu->segs[_CS]==0x23); + if(is32bits) { + // Zero upper part of the 32bits regs + R_RAX = R_EAX; + R_RBX = R_EBX; + R_RCX = R_ECX; + R_RDX = R_EDX; + R_RSP = R_ESP; + R_RBP = R_EBP; + R_RSI = R_ESI; + R_RDI = R_EDI; + } + #ifndef TEST_INTERPRETER + if(is32bits) + running32bits = 1; + #endif + } + } STEP; - is32bits = (emu->segs[_CS]==0x23); - #ifndef TEST_INTERPRETER - if(is32bits) - running32bits = 1; - #else - test->notest = 1; - #endif break; case 0xD0: /* GRP2 Eb,1 */ case 0xD2: /* GRP2 Eb,CL */ @@ -1622,7 +1765,7 @@ int Run(x64emu_t *emu, int step) if(rex.is32bits) { R_AX = aam16(emu, R_AL, F8); } else { - unimp = 1; + unimp = 2; goto fini; }; break; @@ -1630,7 +1773,7 @@ int Run(x64emu_t *emu, int step) if(rex.is32bits) { R_AX = aad16(emu, R_AX, F8); } else { - unimp = 1; + unimp = 2; goto fini; }; break; @@ -1639,12 +1782,12 @@ int Run(x64emu_t *emu, int step) CHECK_FLAGS(emu); R_AL = ACCESS_FLAG(F_CF)?0xff:0x00; } else { - unimp = 1; + unimp = 2; goto fini; }; break; case 0xD7: /* XLAT */ - R_AL = *(uint8_t*)(R_RBX + R_AL); + R_AL = *(uint8_t*)(rex.offset + R_RBX + R_AL); break; case 0xD8: /* x87 opcodes */ #ifdef TEST_INTERPRETER @@ -1769,30 +1912,71 @@ int Run(x64emu_t *emu, int step) case 0xE0: /* LOOPNZ */ CHECK_FLAGS(emu); tmp8s = F8S; - --R_RCX; // don't update flags - if(R_RCX && !ACCESS_FLAG(F_ZF)) - addr += tmp8s; + if(rex.is32bits && rex.is67) { + --R_CX; // don't update flags + if(R_CX && !ACCESS_FLAG(F_ZF)) + addr += tmp8s; + } else if(rex.is32bits || rex.is67) { + --R_ECX; // don't update flags + if(rex.is67) emu->regs[_CX].dword[1] = 0; + if(R_ECX && !ACCESS_FLAG(F_ZF)) + addr += tmp8s; + } else { + --R_RCX; // don't update flags + if(R_RCX && !ACCESS_FLAG(F_ZF)) + addr += tmp8s; + } STEP2 break; case 0xE1: /* LOOPZ */ CHECK_FLAGS(emu); tmp8s = F8S; - --R_RCX; // don't update flags - if(R_RCX && ACCESS_FLAG(F_ZF)) - addr += tmp8s; + if(rex.is32bits && rex.is67) { + --R_CX; // don't update flags + if(R_CX && ACCESS_FLAG(F_ZF)) + addr += tmp8s; + } else if(rex.is32bits || rex.is67) { + --R_ECX; // don't update flags + if(rex.is67) emu->regs[_CX].dword[1] = 0; + if(R_ECX && ACCESS_FLAG(F_ZF)) + addr += tmp8s; + } else { + --R_RCX; // don't update flags + if(R_RCX && ACCESS_FLAG(F_ZF)) + addr += tmp8s; + } STEP2 break; case 0xE2: /* LOOP */ tmp8s = F8S; - --R_RCX; // don't update flags - if(R_RCX) - addr += tmp8s; + if(rex.is32bits && rex.is67) { + --R_CX; // don't update flags + if(R_CX) + addr += tmp8s; + } else if(rex.is32bits || rex.is67) { + --R_ECX; // don't update flags + if(rex.is67) emu->regs[_CX].dword[1] = 0; + if(R_ECX) + addr += tmp8s; + } else { + --R_RCX; // don't update flags + if(R_RCX) + addr += tmp8s; + } STEP2 break; case 0xE3: /* JRCXZ */ tmp8s = F8S; - if(!R_RCX) - addr += tmp8s; + if(rex.is32bits && rex.is67) { + if(!R_CX) + addr += tmp8s; + } else if(rex.is32bits || rex.is67) { + if(!R_ECX) + addr += tmp8s; + } else { + if(!R_RCX) + addr += tmp8s; + } STEP2 break; case 0xE4: /* IN AL, XX */ @@ -1801,14 +1985,15 @@ int Run(x64emu_t *emu, int step) case 0xE7: /* OUT XX, EAX */ // this is a privilege opcode... #ifndef TEST_INTERPRETER - emit_signal(emu, SIGSEGV, (void*)R_RIP, 0); + (void)F8; + if(rex.is32bits && BOX64ENV(ignoreint3)) + {} else + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); STEP; - #else - test->notest = 1; #endif break; case 0xE8: /* CALL Id */ - tmp32s = F32S; // call is relative + tmp32s = (rex.is32bits && rex.is66)?(F16S):(F32S); // call is relative if(rex.is32bits) Push32(emu, addr); else @@ -1819,30 +2004,57 @@ int Run(x64emu_t *emu, int step) addr += tmp32s; addr = (uintptr_t)getAlternate((void*)addr); STEP2 - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; case 0xE9: /* JMP Id */ - tmp32s = F32S; // jmp is relative + tmp32s = (rex.is32bits && rex.is66)?(F16S):(F32S); // jmp is relative if(rex.is32bits) addr = (uint32_t)(addr+tmp32s); else addr += tmp32s; addr = (uintptr_t)getAlternate((void*)addr); STEP2 - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; - + case 0xEA: /* JMP FAR seg:off*/ + if(is32bits) { + uint32_t new_addr = (rex.is32bits && rex.is66)?(F16):(F32); + uint16_t new_cs = F16; + #ifndef TEST_INTERPRETER + if((new_cs&3)!=3) { + // R_RIP doesn't advance + printf_log(LOG_INFO, "Warning, unexpected new_cs=0x%x at %p\n", new_cs, (void*)R_RIP); + R_RSP-=(rex.w?4:8)*2; + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); // GP if trying to change priv level + goto fini; + } + emu->segs[_CS] = new_cs; + addr = new_addr; + if(is32bits!=(emu->segs[_CS]==0x23)) { + is32bits = (emu->segs[_CS]==0x23); + if(is32bits) { + // Zero upper part of the 32bits regs + R_RAX = R_EAX; + R_RBX = R_EBX; + R_RCX = R_ECX; + R_RDX = R_EDX; + R_RSP = R_ESP; + R_RBP = R_EBP; + R_RSI = R_ESI; + R_RDI = R_EDI; + } + if(is32bits) + running32bits = 1; + } + #endif + } else { + unimp = 2; + goto fini; + } + STEP2 + break; case 0xEB: /* JMP Ib */ tmp32s = F8S; // jump is relative addr += tmp32s; STEP2 - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; case 0xEC: /* IN AL, DX */ case 0xED: /* IN EAX, DX */ @@ -1850,42 +2062,34 @@ int Run(x64emu_t *emu, int step) case 0xEF: /* OUT DX, EAX */ // this is a privilege opcode... #ifndef TEST_INTERPRETER - emit_signal(emu, SIGSEGV, (void*)R_RIP, 0); + if(rex.is32bits && BOX64ENV(ignoreint3)) + {} else + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); STEP; - #else - test->notest = 1; - #endif - break; - case 0xF0: /* LOCK prefix */ - #ifdef TEST_INTERPRETER - if(!(addr = TestF0(test, rex, addr))) - unimp = 1; - #else - if(!(addr = RunF0(emu, rex, addr))) { - unimp = 1; - goto fini; - } - if(emu->quit) { - R_RIP = addr; - goto fini; - } #endif break; + case 0xF1: /* INT1 */ emu->old_ip = R_RIP; #ifndef TEST_INTERPRETER - emit_signal(emu, SIGSEGV, (void*)R_RIP, 128); + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 128); #endif break; case 0xF4: /* HLT */ // this is a privilege opcode... #ifndef TEST_INTERPRETER - emit_signal(emu, SIGSEGV, (void*)R_RIP, 0); - STEP; - #else - test->notest = 1; + if (!box64_unittest_mode) { + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); + STEP; + } else #endif + { + CHECK_FLAGS(emu); + printf_log(LOG_DEBUG, "HLT encountered in interpreter, exiting\n"); + emu->quit = 1; + goto fini; + } break; case 0xF5: /* CMC */ CHECK_FLAGS(emu); @@ -1914,17 +2118,18 @@ int Run(x64emu_t *emu, int step) imul8(emu, EB->byte[0]); break; case 6: /* DIV Eb */ + #ifndef TEST_INTERPRETER if(!EB->byte[0]) - emit_div0(emu, (void*)R_RIP, 0); + EmitDiv0(emu, (void*)R_RIP, 1); + #endif div8(emu, EB->byte[0]); break; case 7: /* IDIV Eb */ + #ifndef TEST_INTERPRETER if(!EB->byte[0]) - emit_div0(emu, (void*)R_RIP, 0); - idiv8(emu, EB->byte[0]); - #ifdef TEST_INTERPRETER - test->notest = 1; + EmitDiv0(emu, (void*)R_RIP, 1); #endif + idiv8(emu, EB->byte[0]); break; } break; @@ -1952,17 +2157,18 @@ int Run(x64emu_t *emu, int step) imul64_rax(emu, ED->q[0]); break; case 6: /* DIV Ed */ + #ifndef TEST_INTERPRETER if(!ED->q[0]) - emit_div0(emu, (void*)R_RIP, 0); + EmitDiv0(emu, (void*)R_RIP, 1); + #endif div64(emu, ED->q[0]); break; case 7: /* IDIV Ed */ + #ifndef TEST_INTERPRETER if(!ED->q[0]) - emit_div0(emu, (void*)R_RIP, 0); - idiv64(emu, ED->q[0]); - #ifdef TEST_INTERPRETER - test->notest = 1; + EmitDiv0(emu, (void*)R_RIP, 1); #endif + idiv64(emu, ED->q[0]); break; } } else { @@ -1995,15 +2201,19 @@ int Run(x64emu_t *emu, int step) emu->regs[_DX].dword[1] = 0; break; case 6: /* DIV Ed */ + #ifndef TEST_INTERPRETER if(!ED->dword[0]) - emit_div0(emu, (void*)R_RIP, 0); + EmitDiv0(emu, (void*)R_RIP, 1); + #endif div32(emu, ED->dword[0]); //emu->regs[_AX].dword[1] = 0; // already put high regs to 0 //emu->regs[_DX].dword[1] = 0; break; case 7: /* IDIV Ed */ + #ifndef TEST_INTERPRETER if(!ED->dword[0]) - emit_div0(emu, (void*)R_RIP, 0); + EmitDiv0(emu, (void*)R_RIP, 1); + #endif idiv32(emu, ED->dword[0]); //emu->regs[_AX].dword[1] = 0; //emu->regs[_DX].dword[1] = 0; @@ -2021,19 +2231,17 @@ int Run(x64emu_t *emu, int step) break; case 0xFA: /* CLI */ // this is a privilege opcode - emit_signal(emu, SIGSEGV, (void*)R_RIP, 0); + if(rex.is32bits && BOX64ENV(ignoreint3)) + {} else + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); STEP; - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; case 0xFB: /* STI */ // this is a privilege opcode - emit_signal(emu, SIGSEGV, (void*)R_RIP, 0); + if(rex.is32bits && BOX64ENV(ignoreint3)) + {} else + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); STEP; - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; case 0xFC: /* CLD */ CLEAR_FLAG(F_DF); @@ -2085,43 +2293,60 @@ int Run(x64emu_t *emu, int step) GETE8(0); if(rex.is32bits) { tmp64u = (uintptr_t)ED->dword[0]; + tmp64u = (uintptr_t)getAlternate((void*)tmp64u); Push32(emu, addr); } else { - tmp64u = (uintptr_t)getAlternate((void*)ED->q[0]); + tmp64u = ED->q[0]; + tmp64u = (uintptr_t)getAlternate((void*)tmp64u); Push64(emu, addr); } + #ifdef HAVE_TRACE + if(!tmp64u) { + printf_log(LOG_INFO, "Warning, calling to NULL address from x64addr=%p/%s\n", R_RIP, getAddrFunctionName(R_RIP)); + } + #endif addr = tmp64u; STEP2 - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; case 3: /* CALL FAR Ed */ GETET(0); if(MODREG) { printf_log(LOG_NONE, "Illegal Opcode %p: (%02X %02X %02X %02X) %02X %02X %02X %02X\n", (void*)R_RIP, PK(-6), PK(-5), PK(-4), PK(-3), opcode, nextop, PK(0), PK(1)); - emit_signal(emu, SIGILL, (void*)R_RIP, 0); + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); goto fini; } else { if(rex.is32bits || !rex.w) { Push32(emu, R_CS); Push32(emu, addr); - addr = (uintptr_t)getAlternate((void*)(uintptr_t)ED->dword[0]); + addr = (uintptr_t)ED->dword[0]; R_CS = ED->word[2]; } else { Push64(emu, R_CS); Push64(emu, addr); - addr = (uintptr_t)getAlternate((void*)ED->q[0]); + addr = ED->q[0]; R_CS = (ED+1)->word[0]; } + addr = (uintptr_t)getAlternate((void*)addr); STEP2; - is32bits = (emu->segs[_CS]==0x23); - #ifndef TEST_INTERPRETER - if(is32bits) - running32bits = 1; - #else - test->notest = 1; - #endif + if(is32bits!=(emu->segs[_CS]==0x23)) { + is32bits = (emu->segs[_CS]==0x23); + if(is32bits) { + // Zero upper part of the 32bits regs + R_RAX = R_EAX; + R_RBX = R_EBX; + R_RCX = R_ECX; + R_RDX = R_EDX; + R_RSP = R_ESP; + R_RBP = R_EBP; + R_RSI = R_ESI; + R_RDI = R_EDI; + addr = addr & 0xffffffff; // including IP + } + #ifndef TEST_INTERPRETER + if(is32bits) + running32bits = 1; + #endif + } } break; case 4: /* JMP NEAR Ed */ @@ -2129,29 +2354,49 @@ int Run(x64emu_t *emu, int step) if(rex.is32bits) addr = (uintptr_t)ED->dword[0]; else - addr = (uintptr_t)getAlternate((void*)ED->q[0]); + addr = (uintptr_t)ED->q[0]; + addr = (uintptr_t)getAlternate((void*)addr); + #ifdef HAVE_TRACE + if(!addr) { + printf_log(LOG_INFO, "Warning, jumping to NULL address from x64addr=%p/%s\n", R_RIP, getAddrFunctionName(R_RIP)); + } + #endif STEP2 break; case 5: /* JMP FAR Ed */ GETET(0); if(MODREG) { printf_log(LOG_NONE, "Illegal Opcode %p: (%02X %02X %02X %02X) %02X %02X %02X %02X\n", (void*)R_RIP, PK(-6), PK(-5), PK(-4), PK(-3), opcode, nextop, PK(0), PK(1)); - emit_signal(emu, SIGILL, (void*)R_RIP, 0); + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); goto fini; } else { if(rex.is32bits || !rex.w) { - addr = (uintptr_t)getAlternate((void*)(uintptr_t)ED->dword[0]); + addr = (uintptr_t)ED->dword[0]; R_CS = ED->word[2]; } else { - addr = (uintptr_t)getAlternate((void*)ED->q[0]); + addr = ED->q[0]; R_CS = (ED+1)->word[0]; } + addr = (uintptr_t)getAlternate((void*)addr); STEP2; - is32bits = (emu->segs[_CS]==0x23); - #ifndef TEST_INTERPRETER - if(is32bits) - running32bits = 1; - #endif + if(is32bits!=(emu->segs[_CS]==0x23)) { + is32bits = (emu->segs[_CS]==0x23); + if(is32bits) { + // Zero upper part of the 32bits regs + R_RAX = R_EAX; + R_RBX = R_EBX; + R_RCX = R_ECX; + R_RDX = R_EDX; + R_RSP = R_ESP; + R_RBP = R_EBP; + R_RSI = R_ESI; + R_RDI = R_EDI; + } + #ifndef TEST_INTERPRETER + if(is32bits) + running32bits = 1; + #endif + } } break; case 6: /* Push Ed */ @@ -2165,8 +2410,7 @@ int Run(x64emu_t *emu, int step) } break; default: - printf_log(LOG_NONE, "Illegal Opcode %p: (%02X %02X %02X %02X) %02X %02X %02X %02X %02X %02X\n", (void*)R_RIP, PK(-6), PK(-5), PK(-4), PK(-3), opcode, nextop, PK(0), PK(1), PK(2), PK(3)); - emit_signal(emu, SIGILL, (void*)R_RIP, 0); + unimp = 2; goto fini; } break; @@ -2174,18 +2418,6 @@ int Run(x64emu_t *emu, int step) unimp = 1; goto fini; } -#ifndef TEST_INTERPRETER - // check the TRACE flag before going to next - if(ACCESS_FLAG(F_TF)) { - if(tf_next) { - tf_next = 0; - } else { - R_RIP = addr; - emit_signal(emu, SIGTRAP, (void*)addr, 1); - if(emu->quit) goto fini; - } - } -#endif R_RIP = addr; } @@ -2193,18 +2425,21 @@ int Run(x64emu_t *emu, int step) fini: #ifndef TEST_INTERPRETER // check the TRACE flag before going to out, in case it's a step by step scenario - if(!emu->quit && !emu->fork && !emu->uc_link && ACCESS_FLAG(F_TF)) { + if(!emu->quit && !emu->fork && ACCESS_FLAG(F_TF)) { R_RIP = addr; - emit_signal(emu, SIGTRAP, (void*)addr, 1); + EmitSignal(emu, X64_SIGTRAP, (void*)addr, 1); if(emu->quit) goto fini; } #endif if(emu->segs[_CS]!=0x33 && emu->segs[_CS]!=0x23) printf_log(LOG_NONE, "Warning, CS is not default value: 0x%x\n", emu->segs[_CS]); #ifndef TEST_INTERPRETER - printf_log(LOG_DEBUG, "End of X86 run (%p), RIP=%p, Stack=%p, unimp=%d, emu->fork=%d, emu->uc_link=%p, emu->quit=%d\n", emu, (void*)R_RIP, (void*)R_RSP, unimp, emu->fork, emu->uc_link, emu->quit); + printf_log(LOG_DEBUG, "End of X86 run (%p), RIP=%p, Stack=%p, unimp=%d, emu->fork=%d, emu->quit=%d\n", emu, (void*)R_RIP, (void*)R_RSP, unimp, emu->fork, emu->quit); if(unimp) { - emu->quit = 1; - UnimpOpcode(emu, is32bits); + //emu->quit = 1; + if(unimp==1 && !(emu->error&ERR_ILLEGAL)) + UnimpOpcode(emu, is32bits); + emu->error &= ~ERR_ILLEGAL; + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); } // fork handling if(emu->fork) { @@ -2212,18 +2447,11 @@ if(emu->segs[_CS]!=0x33 && emu->segs[_CS]!=0x23) printf_log(LOG_NONE, "Warning, int forktype = emu->fork; emu->quit = 0; emu->fork = 0; - emu = x64emu_fork(emu, forktype); + emu = EmuFork(emu, forktype); if(step) return 0; goto x64emurun; } - // setcontext handling - else if(emu->quit && emu->uc_link) { - emu->quit = 0; - my_setcontext(emu, emu->uc_link); - addr = R_RIP; - goto x64emurun; - } #else if(unimp) { printf_log(LOG_INFO, "Warning, inimplemented opcode in Test Interpreter\n"); diff --git a/src/emu/x64run0f.c b/src/emu/x64run0f.c index 4f12e61..387ccad 100644 --- a/src/emu/x64run0f.c +++ b/src/emu/x64run0f.c @@ -5,14 +5,15 @@ #include #include #include -#include #include #include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64stack.h" +#include "box64cpu_util.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,8 +22,10 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" +#include "emit_signals.h" #include "x64shaext.h" +#include "freq.h" +#include "random.h" #ifdef DYNAREC #include "custommem.h" #include "../dynarec/native_lock.h" @@ -47,6 +50,7 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) reg64_t *oped, *opgd; sse_regs_t *opex, *opgx, eax1; mmx87_regs_t *opem, *opgm, eam1; + uint8_t maskps[4]; #ifdef TEST_INTERPRETER x64emu_t *emu = test->emu; @@ -82,20 +86,42 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) default: return 0; } - } else - return 0; + } else { + nextop = F8; + switch((nextop>>3)&7) { + case 0: /* SLDT Ew */ + GETEW(0); + if(MODREG) + ED->q[0] = 0; + else + EW->word[0] = 0; + break; + default: + return 0; + } + } break; case 0x01: /* XGETBV, SGDT, etc... */ nextop = F8; GETED(0); if(MODREG) switch(nextop) { + case 0xC8: /* MONITOR */ + // this is a privilege opcode... + #ifndef TEST_INTERPRETER + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0); + #endif + break; + case 0xC9: /* MWAIT */ + // this is a privilege opcode... + #ifndef TEST_INTERPRETER + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0); + #endif + break; case 0xD0: if(R_RCX) { #ifndef TEST_INTERPRETER - emit_signal(emu, SIGILL, (void*)R_RIP, 0); - #else - test->notest = 1; + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); #endif } else { R_RAX = 0b111; // x87 & SSE & AVX for now @@ -119,9 +145,6 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) R_RAX = tmp64u & 0xffffffff; R_RDX = tmp64u >> 32; R_RCX = helper_getcpu(emu); - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; default: return 0; @@ -152,18 +175,31 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) } break; + case 0x03: /* LSL */ + nextop = F8; + GETED(0); + GETGD; + CHECK_FLAGS(emu); + tmp8u = ED->word[0]>>3; + tmp8s = !!(ED->word[0]&2); + if (tmp8u>0x10 || !tmp8s?emu->segldt[tmp8u].present:my_context->seggdt[tmp8u].present) { + CLEAR_FLAG(F_ZF); + } else { + GD->dword[0] = tmp8s?emu->segldt[tmp8u].limit:my_context->seggdt[tmp8u].limit; + SET_FLAG(F_ZF); + } + break; + case 0x05: /* SYSCALL */ #ifndef TEST_INTERPRETER R_RIP = addr; - x64Syscall(emu); - #else - test->notest = 1; + EmuX64Syscall(emu); #endif break; case 0x06: /* CLTS */ // this is a privilege opcode... #ifndef TEST_INTERPRETER - emit_signal(emu, SIGSEGV, (void*)R_RIP, 0); + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); #endif break; @@ -171,17 +207,13 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) case 0x09: /* WBINVD */ // this is a privilege opcode... #ifndef TEST_INTERPRETER - emit_signal(emu, SIGSEGV, (void*)R_RIP, 0); - #else - test->notest = 1; + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); #endif break; case 0x0B: /* UD2 */ #ifndef TEST_INTERPRETER - emit_signal(emu, SIGILL, (void*)R_RIP, 0); - #else - test->notest = 1; + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); #endif break; @@ -189,18 +221,22 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) nextop = F8; GETED(0); switch((nextop>>3)&7) { + case 0: //PREFETCH? + __builtin_prefetch((void*)ED, 0, 0); + break; case 1: //PREFETCHW __builtin_prefetch((void*)ED, 1, 0); break; - default: //??? - return 0; + case 2: //PREFETCHWT1 + __builtin_prefetch((void*)ED, 1, 0); + break; + default: //NOP + break; } break; case 0x0E: /* FEMMS */ #ifndef TEST_INTERPRETER - emit_signal(emu, SIGILL, (void*)R_RIP, 0); - #else - test->notest = 1; + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); #endif break; @@ -220,16 +256,20 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) nextop = F8; GETEX(0); GETGX; - if(MODREG) /* MOVHLPS Gx,Ex */ + if(MODREG) /* MOVHLPS Gx, Ex */ GX->q[0] = EX->q[1]; else - GX->q[0] = EX->q[0]; /* MOVLPS Gx,Ex */ + GX->q[0] = EX->q[0]; /* MOVLPS Gx, Ex */ break; - case 0x13: /* MOVLPS Ex,Gx */ + case 0x13: /* MOVLPS Ex, Gx */ nextop = F8; - GETEX(0); - GETGX; - EX->q[0] = GX->q[0]; + if(MODREG) { + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); + } else { + GETEX(0); + GETGX; + EX->q[0] = GX->q[0]; + } break; case 0x14: /* UNPCKLPS Gx, Ex */ nextop = F8; @@ -277,6 +317,12 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) } break; + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: case 0x1F: /* NOP (multi-byte) */ nextop = F8; FAKEED(0); @@ -286,8 +332,13 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) case 0x22: /* MOV cxR, REG */ case 0x23: /* MOV drX, REG */ // this is a privilege opcode... + nextop = F8; #ifndef TEST_INTERPRETER - emit_signal(emu, SIGSEGV, (void*)R_RIP, 0); + tmp8u = (rex.r*8)+(nextop>>3&7); + if((((opcode==20) || (opcode==22)) && ((tmp8u==1) || (tmp8u==5) || (tmp8u==6) || (tmp8u==7) || (tmp8u>8))) || (((opcode==0x21) || (opcode==0x23)) && rex.r)) { + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); + } else + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0); #endif break; @@ -314,10 +365,14 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) break; case 0x2B: /* MOVNTPS Ex,Gx */ nextop = F8; - GETEX(0); - GETGX; - EX->q[0] = GX->q[0]; - EX->q[1] = GX->q[1]; + if(MODREG) { + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); + } else { + GETEX(0); + GETGX; + EX->q[0] = GX->q[0]; + EX->q[1] = GX->q[1]; + } break; case 0x2C: /* CVTTPS2PI Gm, Ex */ nextop = F8; @@ -374,7 +429,7 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) nextop = F8; GETEX(0); GETGX; - if(isnan(GX->f[0]) || isnan(EX->f[0])) { + if(isnanf(GX->f[0]) || isnanf(EX->f[0])) { SET_FLAG(F_ZF); SET_FLAG(F_PF); SET_FLAG(F_CF); } else if(isgreater(GX->f[0], EX->f[0])) { CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_PF); CLEAR_FLAG(F_CF); @@ -385,15 +440,37 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) } CLEAR_FLAG(F_OF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_SF); break; - + case 0x30: /* WRMSR */ + // this is a privilege opcode... + #ifndef TEST_INTERPRETER + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0); + #endif + break; case 0x31: /* RDTSC */ tmp64u = ReadTSC(emu); if(box64_rdtsc_shift) tmp64u<<=box64_rdtsc_shift; R_RDX = tmp64u>>32; R_RAX = tmp64u&0xFFFFFFFF; - #ifdef TEST_INTERPRETER - test->notest = 1; + break; + case 0x32: /* RDMSR */ + // priviledge instruction + #ifndef TEST_INTERPRETER + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); + STEP; + #endif + break; + + case 0x34: /* SYSENTER */ + #ifndef TEST_INTERPRETER + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); + STEP; + #endif + break; + case 0x35: /* SYSEXIT */ + #ifndef TEST_INTERPRETER + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); + STEP; #endif break; @@ -543,7 +620,7 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) GETEM(0); GETGM; for (int i=0; i<8; ++i) { - GM->sb[i] = abs(EM->sb[i]); + GM->ub[i] = abs(EM->sb[i]); } break; case 0x1D: /* PABSW Gm, Em */ @@ -551,7 +628,7 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) GETEM(0); GETGM; for (int i=0; i<4; ++i) { - GM->sw[i] = abs(EM->sw[i]); + GM->uw[i] = abs(EM->sw[i]); } break; case 0x1E: /* PABSD Gm, Em */ @@ -559,7 +636,7 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) GETEM(0); GETGM; for (int i=0; i<2; ++i) { - GM->sd[i] = abs(EM->sd[i]); + GM->ud[i] = abs(EM->sd[i]); } break; @@ -666,7 +743,7 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) case 0x3F: #ifndef TEST_INTERPRETER - emit_signal(emu, SIGILL, (void*)R_RIP, 0); + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); #endif break; GOCOND(0x40 @@ -692,7 +769,10 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) GETEX(0); GETGX; for(int i=0; i<4; ++i) - GX->f[i] = sqrtf(EX->f[i]); + if (isnan(EX->f[i])) + GX->f[i] = EX->f[i]; + else + GX->f[i] = (EX->f[i] < 0) ? (-NAN) : sqrtf(EX->f[i]); break; case 0x52: /* RSQRTPS Gx, Ex */ nextop = F8; @@ -710,33 +790,28 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) else GX->f[i] = 1.0f/sqrtf(EX->f[i]); } - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; case 0x53: /* RCPPS Gx, Ex */ nextop = F8; GETEX(0); GETGX; for(int i=0; i<4; ++i) - GX->f[i] = 1.0f/EX->f[i]; - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif + if (isnan(EX->f[i])) + GX->f[i] = EX->f[i]; + else + GX->f[i] = 1.0f / EX->f[i]; break; case 0x54: /* ANDPS Gx, Ex */ nextop = F8; GETEX(0); GETGX; - for(int i=0; i<4; ++i) - GX->ud[i] &= EX->ud[i]; + GX->u128 &= EX->u128; break; case 0x55: /* ANDNPS Gx, Ex */ nextop = F8; GETEX(0); GETGX; - for(int i=0; i<4; ++i) - GX->ud[i] = (~GX->ud[i]) & EX->ud[i]; + GX->u128 = (~GX->u128) & EX->u128; break; case 0x56: /* ORPS Gx, Ex */ nextop = F8; @@ -756,15 +831,21 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) nextop = F8; GETEX(0); GETGX; - for(int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { + maskps[i] = isnanf(GX->f[i]) || isnanf(EX->f[i]); GX->f[i] += EX->f[i]; + if(isnanf(GX->f[i]) && !maskps[i]) GX->ud[i] |= 0x80000000; + } break; case 0x59: /* MULPS Gx, Ex */ nextop = F8; GETEX(0); GETGX; - for(int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { + maskps[i] = isnanf(GX->f[i]) || isnanf(EX->f[i]); GX->f[i] *= EX->f[i]; + if(isnanf(GX->f[i]) && !maskps[i]) GX->ud[i] |= 0x80000000; + } break; case 0x5A: /* CVTPS2PD Gx, Ex */ nextop = F8; @@ -786,15 +867,18 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) nextop = F8; GETEX(0); GETGX; - for(int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { + maskps[i] = isnanf(GX->f[i]) || isnanf(EX->f[i]); GX->f[i] -= EX->f[i]; + if(isnanf(GX->f[i]) && !maskps[i]) GX->ud[i] |= 0x80000000; + } break; case 0x5D: /* MINPS Gx, Ex */ nextop = F8; GETEX(0); GETGX; for(int i=0; i<4; ++i) { - if (isnan(GX->f[i]) || isnan(EX->f[i]) || isless(EX->f[i], GX->f[i])) + if (isnan(GX->f[i]) || isnan(EX->f[i]) || islessequal(EX->f[i], GX->f[i])) GX->f[i] = EX->f[i]; } break; @@ -802,15 +886,18 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) nextop = F8; GETEX(0); GETGX; - for(int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { + maskps[i] = isnanf(GX->f[i]) || isnanf(EX->f[i]); GX->f[i] /= EX->f[i]; + if(isnanf(GX->f[i]) && !maskps[i]) GX->ud[i] |= 0x80000000; + } break; case 0x5F: /* MAXPS Gx, Ex */ nextop = F8; GETEX(0); GETGX; for(int i=0; i<4; ++i) { - if (isnan(GX->f[i]) || isnan(EX->f[i]) || isgreater(EX->f[i], GX->f[i])) + if (isnan(GX->f[i]) || isnan(EX->f[i]) || isgreaterequal(EX->f[i], GX->f[i])) GX->f[i] = EX->f[i]; } break; @@ -1089,11 +1176,8 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) break; GOCOND(0x80 , tmp32s = F32S; CHECK_FLAGS(emu); - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif , addr += tmp32s; - ,, + ,,STEP3 ) /* 0x80 -> 0x8F Jxx */ //STEP3 GOCOND(0x90 , nextop = F8; CHECK_FLAGS(emu); @@ -1113,33 +1197,31 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) emu->segs[_FS] = Pop32(emu); else emu->segs[_FS] = Pop64(emu); - emu->segs_serial[_FS] = 0; + if(emu->segs[_FS]) + GetSegmentBaseEmu(emu, _FS); // refresh segs_offs break; case 0xA2: /* CPUID */ tmp32u = R_EAX; my_cpuid(emu, tmp32u); - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; case 0xA3: /* BT Ed,Gd */ CHECK_FLAGS(emu); nextop = F8; GETED(0); GETGD; - tmp32s = GD->sdword[0]; - tmp8u=tmp32s&(rex.w?63:31); - tmp32s >>= (rex.w?6:5); + tmp64s = rex.w?GD->sq[0]:GD->sdword[0]; + tmp8u=tmp64s&(rex.w?63:31); + tmp64s >>= (rex.w?6:5); if(!MODREG) { #ifdef TEST_INTERPRETER - test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:2))); + test->memaddr=((test->memaddr)+(tmp64s<<(rex.w?3:2))); if(rex.w) *(uint64_t*)test->mem = *(uint64_t*)test->memaddr; else *(uint32_t*)test->mem = *(uint32_t*)test->memaddr; #else - ED=(reg64_t*)(((uintptr_t)(ED))+(tmp32s<<(rex.w?3:2))); + ED=(reg64_t*)(((uintptr_t)(ED))+(tmp64s<<(rex.w?3:2))); #endif } if(rex.w) { @@ -1194,7 +1276,8 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) emu->segs[_GS] = Pop32(emu); else emu->segs[_GS] = Pop64(emu); - emu->segs_serial[_FS] = 0; + if(emu->segs[_GS]) + GetSegmentBaseEmu(emu, _GS); // refresh segs_offs break; case 0xAB: /* BTS Ed,Gd */ @@ -1270,24 +1353,24 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) #ifdef TEST_INTERPRETER emu->sw.f.F87_TOP = emu->top&7; #else - if(rex.w) - fpu_fxsave64(emu, ED); - else + if(rex.is32bits) fpu_fxsave32(emu, ED); + else + fpu_fxsave64(emu, ED); #endif break; case 1: /* FXRSTOR Ed */ _GETED(0); - if(rex.w) - fpu_fxrstor64(emu, ED); - else + if(rex.is32bits) fpu_fxrstor32(emu, ED); + else + fpu_fxrstor64(emu, ED); break; case 2: /* LDMXCSR Md */ GETED(0); emu->mxcsr.x32 = ED->dword[0]; #ifndef TEST_INTERPRETER - if(box64_sse_flushto0) + if(BOX64ENV(sse_flushto0)) applyFlushTo0(emu); #endif break; @@ -1300,19 +1383,16 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) #ifdef TEST_INTERPRETER emu->sw.f.F87_TOP = emu->top&7; #else - fpu_xsave(emu, ED, rex.is32bits); + fpu_xsave(emu, ED, rex.w?0:1); #endif break; case 5: /* XRSTOR Ed */ _GETED(0); - fpu_xrstor(emu, ED, rex.is32bits); + fpu_xrstor(emu, ED, rex.w?0:1); break; case 7: /* CLFLUSH Ed */ _GETED(0); - #if defined(DYNAREC) && !defined(TEST_INTERPRETER) - if(box64_dynarec) - cleanDBFromAddressRange((uintptr_t)ED, 8, 0); - #endif + __sync_synchronize(); break; default: return 0; @@ -1356,7 +1436,6 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) ED->q[0] = GD->dword[0]; else ED->dword[0] = GD->dword[0]; - R_RAX = R_EAX; // to erase upper part of RAX } else { R_RAX = ED->dword[0]; } @@ -1542,16 +1621,16 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) ED->dword[1] = 0; } break; - case 0xBC: /* BSF Ed,Gd */ + case 0xBC: /* BSF Gd,Ed */ RESET_FLAGS(emu); nextop = F8; GETED(0); GETGD; + tmp8u = 0; if(rex.w) { tmp64u = ED->q[0]; if(tmp64u) { CLEAR_FLAG(F_ZF); - tmp8u = 0; while(!(tmp64u&(1LL<q[0] = tmp8u; } else { @@ -1561,19 +1640,26 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) tmp32u = ED->dword[0]; if(tmp32u) { CLEAR_FLAG(F_ZF); - tmp8u = 0; while(!(tmp32u&(1<q[0] = tmp8u; } else { SET_FLAG(F_ZF); } } + if(!BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG(PARITY(tmp8u), F_PF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_OF); + } break; - case 0xBD: /* BSR Ed,Gd */ + case 0xBD: /* BSR Gd,Ed */ RESET_FLAGS(emu); nextop = F8; GETED(0); GETGD; + tmp8u = 0; if(rex.w) { tmp64u = ED->q[0]; if(tmp64u) { @@ -1595,6 +1681,13 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) SET_FLAG(F_ZF); } } + if(!BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG(PARITY(tmp8u), F_PF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_OF); + } break; case 0xBE: /* MOVSX Gd,Eb */ nextop = F8; @@ -1707,16 +1800,22 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) case 0xC7: CHECK_FLAGS(emu); nextop = F8; + if(MODREG) { + return 0; // register mode is Undefined Instruction + } GETE8xw(0); switch((nextop>>3)&7) { - case 1: /* CMPXCHG8B Eq */ + case 1: /* CMPXCHG8B Eq / CMPXCHG16B Eq */ if(rex.w) { + if(((uintptr_t)ED)&0xf) { + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); // GPF + } tmp64u = ED->q[0]; tmp64u2= ED->q[1]; if(R_RAX == tmp64u && R_RDX == tmp64u2) { SET_FLAG(F_ZF); - ED->q[0] = R_EBX; - ED->q[1] = R_ECX; + ED->q[0] = R_RBX; + ED->q[1] = R_RCX; } else { CLEAR_FLAG(F_ZF); R_RAX = tmp64u; @@ -1749,9 +1848,12 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) else { ED->dword[0] = get_random32(); if(MODREG) - ED->dword[1] = 1; + ED->dword[1] = 0; } break; + case 7: /* RDPID Ed */ + ED->q[0] = helper_getcpu(emu); + break; default: return 0; } @@ -1910,14 +2012,12 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) nextop = F8; GETEM(0); GETGM; - if(EM->q>31) { - for(int i=0; i<2; ++i) - GM->sd[i] = (GM->sd[i]<0)?-1:0; - } else { + if(EM->q>31) + tmp8u = 31; + else tmp8u = EM->ub[0]; - for(int i=0; i<2; ++i) - GM->sd[i] >>= tmp8u; - } + for(int i=0; i<2; ++i) + GM->sd[i] >>= tmp8u; break; case 0xE3: /* PAVGW Gm, Em */ nextop = F8; @@ -2024,7 +2124,7 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) else { tmp8u = EM->ub[0]; for(int i=0; i<4; ++i) - GM->sw[i] <<= tmp8u; + GM->uw[i] <<= tmp8u; } break; case 0xF2: /* PSLLD Gm, Em */ @@ -2036,7 +2136,7 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) else { tmp8u = EM->ub[0]; for(int i=0; i<2; ++i) - GM->sd[i] <<= tmp8u; + GM->ud[i] <<= tmp8u; } break; case 0xF3: /* PSLLQ Gm, Em */ diff --git a/src/emu/x64run64.c b/src/emu/x64run64.c deleted file mode 100644 index fe8da3e..0000000 --- a/src/emu/x64run64.c +++ /dev/null @@ -1,891 +0,0 @@ -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "box64stack.h" -#include "x64emu.h" -#include "x64run.h" -#include "x64emu_private.h" -#include "x64run_private.h" -#include "x64primop.h" -#include "x64trace.h" -#include "x87emu_private.h" -#include "box64context.h" -#include "bridge.h" - -#include "modrm.h" - -#ifdef TEST_INTERPRETER -uintptr_t Test64(x64test_t *test, rex_t rex, int seg, uintptr_t addr) -#else -uintptr_t Run64(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr) -#endif -{ - uint8_t opcode; - uint8_t nextop; - uint8_t tmp8u; (void)tmp8u; - int16_t tmp16s; (void)tmp16s; - uint16_t tmp16u; (void)tmp16u; - int32_t tmp32s; - uint32_t tmp32u; - uint64_t tmp64u; - reg64_t *oped, *opgd; - sse_regs_t *opex, *opgx; - int rep; - #ifdef TEST_INTERPRETER - x64emu_t* emu = test->emu; - #endif - uintptr_t tlsdata = GetSegmentBaseEmu(emu, seg); - - opcode = F8; - // REX prefix before the F0 are ignored - rex.rex = 0; - if(!rex.is32bits) - while(opcode>=0x40 && opcode<=0x4f) { - rex.rex = opcode; - opcode = F8; - } - rep = 0; - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - if(!rex.is32bits) - while(opcode>=0x40 && opcode<=0x4f) { - rex.rex = opcode; - opcode = F8; - } - - switch(opcode) { - #define GO(B, OP) \ - case B+0: \ - nextop = F8; \ - GETEB_OFFS(0, tlsdata); \ - GETGB; \ - EB->byte[0] = OP##8(emu, EB->byte[0], GB); \ - break; \ - case B+1: \ - nextop = F8; \ - GETED_OFFS(0, tlsdata); \ - GETGD; \ - if(rex.w) \ - ED->q[0] = OP##64(emu, ED->q[0], GD->q[0]); \ - else { \ - if(MODREG) \ - ED->q[0] = OP##32(emu, ED->dword[0], GD->dword[0]); \ - else \ - ED->dword[0] = OP##32(emu, ED->dword[0], GD->dword[0]); \ - } \ - break; \ - case B+2: \ - nextop = F8; \ - GETEB_OFFS(0, tlsdata); \ - GETGB; \ - GB = OP##8(emu, GB, EB->byte[0]); \ - break; \ - case B+3: \ - nextop = F8; \ - GETED_OFFS(0, tlsdata); \ - GETGD; \ - if(rex.w) \ - GD->q[0] = OP##64(emu, GD->q[0], ED->q[0]); \ - else \ - GD->q[0] = OP##32(emu, GD->dword[0], ED->dword[0]); \ - break; \ - case B+4: \ - R_AL = OP##8(emu, R_AL, F8); \ - break; \ - case B+5: \ - if(rex.w) \ - R_RAX = OP##64(emu, R_RAX, F32S64); \ - else \ - R_RAX = OP##32(emu, R_EAX, F32); \ - break; - - GO(0x00, add) /* ADD 0x00 -> 0x05 */ - GO(0x08, or) /* OR 0x08 -> 0x0D */ - GO(0x10, adc) /* ADC 0x10 -> 0x15 */ - GO(0x18, sbb) /* SBB 0x18 -> 0x1D */ - GO(0x20, and) /* AND 0x20 -> 0x25 */ - GO(0x28, sub) /* SUB 0x28 -> 0x2D */ - GO(0x30, xor) /* XOR 0x30 -> 0x35 */ - #undef GO - case 0x0F: - opcode = F8; - switch(opcode) { - - case 0x10: - switch(rep) { - case 0: /* MOVUPS Gx, FS:Ex */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - GX->u128 = EX->u128; - break; - case 1: /* MOVSD Gx, FS:Ex */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - GX->q[0] = EX->q[0]; - if(!MODREG) { - // EX is not a register - GX->q[1] = 0; - } - break; - case 2: /* MOVSS Gx, FS:Ex */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - GX->ud[0] = EX->ud[0]; - if(!MODREG) { - // EX is not a register (reg to reg only move 31:0) - GX->ud[1] = GX->ud[2] = GX->ud[3] = 0; - } - break; - default: - return 0; - } - break; - case 0x11: - switch(rep) { - case 0: /* MOVUPS FS:Ex, Gx */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - EX->u128 = GX->u128; - break; - case 1: /* MOVSD Ex, Gx */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - EX->q[0] = GX->q[0]; - break; - case 2: /* MOVSS FS:Ex, Gx */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - EX->ud[0] = GX->ud[0]; - break; - default: - return 0; - } - break; - case 0x28: - switch(rep) { - case 0: /* MOVAPS Gx, FS:Ex */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - GX->u128 = EX->u128; - break; - default: - return 0; - } - break; - case 0x29: /* MOVAPS FS:Ex,Gx */ - switch(rep) { - case 0: - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - EX->q[0] = GX->q[0]; - EX->q[1] = GX->q[1]; - break; - default: - return 0; - } - break; - - case 0x58: - switch(rep) { - case 2: /* ADDSS Gx, FS:Ex */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - GX->f[0] += EX->f[0]; - break; - - default: - return 0; - } - break; - case 0x59: - switch(rep) { - case 2: /* MULSS Gx, FS:Ex */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - GX->f[0] *= EX->f[0]; - break; - - default: - return 0; - } - break; - case 0x5A: - switch(rep) { - case 2: /* CVTSS2SD Gx, FS:Ex */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - GX->d[0] = EX->f[0]; - break; - - default: - return 0; - } - break; - - case 0x6F: - switch(rep) { - case 2: /* MOVDQU Gx, FS:Ex */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - memcpy(GX, EX, 16); // unaligned... - break; - - default: - return 0; - } - break; - - case 0xAF: - switch(rep) { - case 0: /* IMUL Gd, FS:Ed */ - nextop = F8; - GETED_OFFS(0, tlsdata); - GETGD; - if(rex.w) - GD->q[0] = imul64(emu, GD->q[0], ED->q[0]); - else - GD->q[0] = imul32(emu, GD->dword[0], ED->dword[0]); - break; - default: - return 0; - } - break; - - case 0xB6: - switch(rep) { - case 0: /* MOVZX Gd, FS:Eb */ - nextop = F8; - GETEB_OFFS(0, tlsdata); - GETGD; - GD->q[0] = EB->byte[0]; - break; - default: - return 0; - } - break; - case 0xB7: - switch(rep) { - case 0: /* MOVZX Gd, FS:Ew */ - nextop = F8; - GETEW_OFFS(0, tlsdata); - GETGD; - GD->q[0] = EW->word[0]; - break; - default: - return 0; - } - break; - - case 0xBA: - nextop = F8; - switch((nextop>>3)&7) { - case 4: /* BT Ed,Ib */ - CHECK_FLAGS(emu); - GETED_OFFS(1, tlsdata); - tmp8u = F8; - if(rex.w) { - tmp8u&=63; - if(ED->q[0] & (1LL<dword[0] & (1<q[0] & (1LL<q[0] ^= (1LL<dword[0] & (1<dword[0] ^= (1<dword[1] = 0; - } - break; - case 6: /* BTR Ed, Ib */ - CHECK_FLAGS(emu); - GETED_OFFS(1, tlsdata); - tmp8u = F8; - if(rex.w) { - tmp8u&=63; - if(ED->q[0] & (1LL<q[0] ^= (1LL<dword[0] & (1<dword[0] ^= (1<dword[1] = 0; - } - break; - case 7: /* BTC Ed, Ib */ - CHECK_FLAGS(emu); - GETED_OFFS(1, tlsdata); - tmp8u = F8; - if(rex.w) { - tmp8u&=63; - if(ED->q[0] & (1LL<q[0] ^= (1LL<dword[0] & (1<dword[0] ^= (1<dword[1] = 0; - } - break; - - default: - return 0; - } - break; - - default: - return 0; - } - break; - - case 0x38: - nextop = F8; - GETEB_OFFS(0, tlsdata); - GETGB; - cmp8(emu, EB->byte[0], GB); - break; - case 0x39: - nextop = F8; - GETED_OFFS(0, tlsdata); - GETGD; - if(rex.w) - cmp64(emu, ED->q[0], GD->q[0]); - else - cmp32(emu, ED->dword[0], GD->dword[0]); - break; - - case 0x3B: - nextop = F8; - GETED_OFFS(0, tlsdata); - GETGD; - if(rex.w) - cmp64(emu, GD->q[0], ED->q[0]); - else - cmp32(emu, GD->dword[0], ED->dword[0]); - break; - - - case 0x63: /* MOVSXD Gd, FS:Ed */ - nextop = F8; - GETED_OFFS(0, tlsdata); - GETGD; - if(rex.is32bits) { - // ARPL here - // faking to always happy... - SET_FLAG(F_ZF); - } else { - if(rex.w) - GD->sq[0] = ED->sdword[0]; - else - if(MODREG) - GD->q[0] = ED->dword[0]; // not really a sign extension - else - GD->sdword[0] = ED->sdword[0]; // meh? - } - break; - case 0x64: /* FS: prefix */ - #ifdef TEST_INTERPRETER - return Test64(test, rex, _FS, addr); - #else - return Run64(emu, rex, _FS, addr); - #endif - break; - case 0x65: /* GS: prefix */ - #ifdef TEST_INTERPRETER - return Test64(test, rex, _GS, addr); - #else - return Run64(emu, rex, _GS, addr); - #endif - break; - case 0x66: - return Run6664(emu, rex, seg, addr); - case 0x67: - if(rex.is32bits) - return Run6764_32(emu, rex, seg, seg, addr); - else - return 0; - - case 0x80: /* GRP Eb,Ib */ - nextop = F8; - GETEB_OFFS(1, tlsdata); - tmp8u = F8; - switch((nextop>>3)&7) { - case 0: EB->byte[0] = add8(emu, EB->byte[0], tmp8u); break; - case 1: EB->byte[0] = or8(emu, EB->byte[0], tmp8u); break; - case 2: EB->byte[0] = adc8(emu, EB->byte[0], tmp8u); break; - case 3: EB->byte[0] = sbb8(emu, EB->byte[0], tmp8u); break; - case 4: EB->byte[0] = and8(emu, EB->byte[0], tmp8u); break; - case 5: EB->byte[0] = sub8(emu, EB->byte[0], tmp8u); break; - case 6: EB->byte[0] = xor8(emu, EB->byte[0], tmp8u); break; - case 7: cmp8(emu, EB->byte[0], tmp8u); break; - } - break; - case 0x81: /* GRP Ed,Id */ - case 0x83: /* GRP Ed,Ib */ - nextop = F8; - GETED_OFFS((opcode==0x81)?4:1, tlsdata); - if(opcode==0x81) { - tmp32s = F32S; - } else { - tmp32s = F8S; - } - if(rex.w) { - tmp64u = (uint64_t)(int64_t)tmp32s; - switch((nextop>>3)&7) { - case 0: ED->q[0] = add64(emu, ED->q[0], tmp64u); break; - case 1: ED->q[0] = or64(emu, ED->q[0], tmp64u); break; - case 2: ED->q[0] = adc64(emu, ED->q[0], tmp64u); break; - case 3: ED->q[0] = sbb64(emu, ED->q[0], tmp64u); break; - case 4: ED->q[0] = and64(emu, ED->q[0], tmp64u); break; - case 5: ED->q[0] = sub64(emu, ED->q[0], tmp64u); break; - case 6: ED->q[0] = xor64(emu, ED->q[0], tmp64u); break; - case 7: cmp64(emu, ED->q[0], tmp64u); break; - } - } else { - tmp32u = (uint32_t)tmp32s; - if(MODREG) - switch((nextop>>3)&7) { - case 0: ED->q[0] = add32(emu, ED->dword[0], tmp32u); break; - case 1: ED->q[0] = or32(emu, ED->dword[0], tmp32u); break; - case 2: ED->q[0] = adc32(emu, ED->dword[0], tmp32u); break; - case 3: ED->q[0] = sbb32(emu, ED->dword[0], tmp32u); break; - case 4: ED->q[0] = and32(emu, ED->dword[0], tmp32u); break; - case 5: ED->q[0] = sub32(emu, ED->dword[0], tmp32u); break; - case 6: ED->q[0] = xor32(emu, ED->dword[0], tmp32u); break; - case 7: cmp32(emu, ED->dword[0], tmp32u); break; - } - else - switch((nextop>>3)&7) { - case 0: ED->dword[0] = add32(emu, ED->dword[0], tmp32u); break; - case 1: ED->dword[0] = or32(emu, ED->dword[0], tmp32u); break; - case 2: ED->dword[0] = adc32(emu, ED->dword[0], tmp32u); break; - case 3: ED->dword[0] = sbb32(emu, ED->dword[0], tmp32u); break; - case 4: ED->dword[0] = and32(emu, ED->dword[0], tmp32u); break; - case 5: ED->dword[0] = sub32(emu, ED->dword[0], tmp32u); break; - case 6: ED->dword[0] = xor32(emu, ED->dword[0], tmp32u); break; - case 7: cmp32(emu, ED->dword[0], tmp32u); break; - } - } - break; - - case 0x86: /* XCHG Eb,Gb */ - nextop = F8; -#if defined(DYNAREC) && !defined(TEST_INTERPRETER) - GETEB_OFFS(0, tlsdata); - GETGB; - if(MODREG) { // reg / reg: no lock - tmp8u = GB; - GB = EB->byte[0]; - EB->byte[0] = tmp8u; - } else { - GB = native_lock_xchg_b(EB, GB); - } - // dynarec use need it's own mecanism -#else - GETEB_OFFS(0, tlsdata); - GETGB; - if(!MODREG) - pthread_mutex_lock(&my_context->mutex_lock); // XCHG always LOCK (but when accessing memory only) - tmp8u = GB; - GB = EB->byte[0]; - EB->byte[0] = tmp8u; - if(!MODREG) - pthread_mutex_unlock(&my_context->mutex_lock); -#endif - break; - - case 0x88: /* MOV FS:Eb,Gb */ - nextop = F8; - GETEB_OFFS(0, tlsdata); - GETGB; - EB->byte[0] = GB; - break; - case 0x89: /* MOV FS:Ed,Gd */ - nextop = F8; - GETED_OFFS(0, tlsdata); - GETGD; - if(rex.w) { - ED->q[0] = GD->q[0]; - } else { - if(MODREG) - ED->q[0] = GD->dword[0]; - else - ED->dword[0] = GD->dword[0]; - } - break; - case 0x8A: /* MOV Gb, FS:Eb */ - nextop = F8; - GETEB_OFFS(0, tlsdata); - GETGB; - GB = EB->byte[0]; - break; - case 0x8B: /* MOV Gd, FS:Ed */ - nextop = F8; - GETED_OFFS(0, tlsdata); - GETGD; - if(rex.w) - GD->q[0] = ED->q[0]; - else - GD->q[0] = ED->dword[0]; - break; - - case 0x8D: /* LEA Gd,M */ - nextop = F8; - GETGD; - tmp64u = GETEA(0); - if(rex.w) - GD->q[0] = tmp64u; - else - GD->q[0] = tmp64u&0xffffffff; - break; - case 0x8E: /* MOV Seg, Seg:Ew */ - nextop = F8; - GETED_OFFS(0, tlsdata); - emu->segs[((nextop&0x38)>>3)] = ED->word[0]; - emu->segs_serial[((nextop&0x38)>>3)] = 0; - break; - case 0x8F: /* POP FS:Ed */ - nextop = F8; - if(MODREG) { - emu->regs[(nextop&7)+(rex.b<<3)].q[0] = Pop64(emu); - } else { - if(rex.is32bits) { - tmp32u = Pop32(emu); // this order allows handling POP [ESP] and variant - GETED_OFFS(0, tlsdata); - R_ESP -= 4; // to prevent issue with SEGFAULT - ED->dword[0] = tmp32u; - R_ESP += 4; - } else { - tmp64u = Pop64(emu); // this order allows handling POP [ESP] and variant - GETED_OFFS(0, tlsdata); - R_RSP -= sizeof(void*); // to prevent issue with SEGFAULT - ED->q[0] = tmp64u; - R_RSP += sizeof(void*); - } - } - break; - case 0x90: /* NOP */ - break; - - case 0xA1: /* MOV EAX,FS:Od */ - if(rex.is32bits) { - tmp32s = F32S; - R_EAX = *(uint32_t*)(tlsdata+tmp32s); - } else { - tmp64u = F64; - if(rex.w) - R_RAX = *(uint64_t*)(tlsdata+tmp64u); - else - R_RAX = *(uint32_t*)(tlsdata+tmp64u); - } - break; - - case 0xA3: /* MOV FS:Od,EAX */ - if(rex.is32bits) { - tmp32s = F32S; - *(uint32_t*)(uintptr_t)(tlsdata+tmp32s) = R_EAX; - } else { - tmp64u = F64; - if(rex.w) - *(uint64_t*)(tlsdata+tmp64u) = R_RAX; - else - *(uint32_t*)(tlsdata+tmp64u) = R_EAX; - } - break; - - case 0xC6: /* MOV FS:Eb, Ib */ - nextop = F8; - GETEB_OFFS(1, tlsdata); - EB->byte[0] = F8; - break; - case 0xC7: /* MOV FS:Ed, Id */ - nextop = F8; - GETED_OFFS(4, tlsdata); - if(rex.w) - ED->q[0] = F32S64; - else - if(MODREG) - ED->q[0] = F32; - else - ED->dword[0] = F32; - break; - - case 0xD1: /* GRP2 Ed,1 */ - case 0xD3: /* GRP2 Ed,CL */ - nextop = F8; - GETED_OFFS(0, tlsdata); - tmp8u = (opcode==0xD1)?1:R_CL; - if(rex.w) { - switch((nextop>>3)&7) { - case 0: ED->q[0] = rol64(emu, ED->q[0], tmp8u); break; - case 1: ED->q[0] = ror64(emu, ED->q[0], tmp8u); break; - case 2: ED->q[0] = rcl64(emu, ED->q[0], tmp8u); break; - case 3: ED->q[0] = rcr64(emu, ED->q[0], tmp8u); break; - case 4: - case 6: ED->q[0] = shl64(emu, ED->q[0], tmp8u); break; - case 5: ED->q[0] = shr64(emu, ED->q[0], tmp8u); break; - case 7: ED->q[0] = sar64(emu, ED->q[0], tmp8u); break; - } - } else { - if(MODREG) - switch((nextop>>3)&7) { - case 0: ED->q[0] = rol32(emu, ED->dword[0], tmp8u); break; - case 1: ED->q[0] = ror32(emu, ED->dword[0], tmp8u); break; - case 2: ED->q[0] = rcl32(emu, ED->dword[0], tmp8u); break; - case 3: ED->q[0] = rcr32(emu, ED->dword[0], tmp8u); break; - case 4: - case 6: ED->q[0] = shl32(emu, ED->dword[0], tmp8u); break; - case 5: ED->q[0] = shr32(emu, ED->dword[0], tmp8u); break; - case 7: ED->q[0] = sar32(emu, ED->dword[0], tmp8u); break; - } - else - switch((nextop>>3)&7) { - case 0: ED->dword[0] = rol32(emu, ED->dword[0], tmp8u); break; - case 1: ED->dword[0] = ror32(emu, ED->dword[0], tmp8u); break; - case 2: ED->dword[0] = rcl32(emu, ED->dword[0], tmp8u); break; - case 3: ED->dword[0] = rcr32(emu, ED->dword[0], tmp8u); break; - case 4: - case 6: ED->dword[0] = shl32(emu, ED->dword[0], tmp8u); break; - case 5: ED->dword[0] = shr32(emu, ED->dword[0], tmp8u); break; - case 7: ED->dword[0] = sar32(emu, ED->dword[0], tmp8u); break; - } - } - break; - - case 0xEB: /* JMP Ib */ - tmp32s = F8S; // jump is relative - addr += tmp32s; - break; - - case 0xF7: /* GRP3 Ed(,Id) */ - nextop = F8; - tmp8u = (nextop>>3)&7; - GETED_OFFS((tmp8u<2)?4:0, tlsdata); - if(rex.w) { - switch(tmp8u) { - case 0: - case 1: /* TEST Ed,Id */ - tmp64u = F32S64; - test64(emu, ED->q[0], tmp64u); - break; - case 2: /* NOT Ed */ - ED->q[0] = not64(emu, ED->q[0]); - break; - case 3: /* NEG Ed */ - ED->q[0] = neg64(emu, ED->q[0]); - break; - case 4: /* MUL RAX,Ed */ - mul64_rax(emu, ED->q[0]); - break; - case 5: /* IMUL RAX,Ed */ - imul64_rax(emu, ED->q[0]); - break; - case 6: /* DIV Ed */ - div64(emu, ED->q[0]); - break; - case 7: /* IDIV Ed */ - idiv64(emu, ED->q[0]); - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif - break; - } - } else { - switch(tmp8u) { - case 0: - case 1: /* TEST Ed,Id */ - tmp32u = F32; - test32(emu, ED->dword[0], tmp32u); - break; - case 2: /* NOT Ed */ - if(MODREG) - ED->q[0] = not32(emu, ED->dword[0]); - else - ED->dword[0] = not32(emu, ED->dword[0]); - break; - case 3: /* NEG Ed */ - if(MODREG) - ED->q[0] = neg32(emu, ED->dword[0]); - else - ED->dword[0] = neg32(emu, ED->dword[0]); - break; - case 4: /* MUL EAX,Ed */ - mul32_eax(emu, ED->dword[0]); - emu->regs[_AX].dword[1] = 0; - break; - case 5: /* IMUL EAX,Ed */ - imul32_eax(emu, ED->dword[0]); - emu->regs[_AX].dword[1] = 0; - break; - case 6: /* DIV Ed */ - div32(emu, ED->dword[0]); - //emu->regs[_AX].dword[1] = 0; // already put high regs to 0 - //emu->regs[_DX].dword[1] = 0; - break; - case 7: /* IDIV Ed */ - idiv32(emu, ED->dword[0]); - //emu->regs[_AX].dword[1] = 0; - //emu->regs[_DX].dword[1] = 0; - break; - } - } - break; - - case 0xFF: /* GRP 5 Ed */ - nextop = F8; - GETED_OFFS(0, tlsdata); - switch((nextop>>3)&7) { - case 0: /* INC Ed */ - if(rex.w) - ED->q[0] = inc64(emu, ED->q[0]); - else { - if(MODREG) - ED->q[0] = inc32(emu, ED->dword[0]); - else - ED->dword[0] = inc32(emu, ED->dword[0]); - } - break; - case 1: /* DEC Ed */ - if(rex.w) - ED->q[0] = dec64(emu, ED->q[0]); - else { - if(MODREG) - ED->q[0] = dec32(emu, ED->dword[0]); - else - ED->dword[0] = dec32(emu, ED->dword[0]); - } - break; - case 2: /* CALL NEAR Ed */ - if(rex.is32bits) { - tmp64u = (uintptr_t)getAlternate((void*)(uintptr_t)ED->dword[0]); - Push32(emu, addr); - } else { - tmp64u = (uintptr_t)getAlternate((void*)ED->q[0]); - Push64(emu, addr); - } - addr = tmp64u; - break; - case 3: /* CALL FAR Ed */ - if(MODREG) { - printf_log(LOG_NONE, "Illegal Opcode %p: %02X %02X %02X %02X\n", (void*)R_RIP, opcode, nextop, PK(2), PK(3)); - emu->quit=1; - emu->error |= ERR_ILLEGAL; - return 0; - } else { - if(rex.is32bits || !rex.w) { - Push32(emu, R_CS); - Push32(emu, addr); - R_RIP = addr = ED->dword[0]; - R_CS = ED->word[2]; - } else { - Push64(emu, R_CS); - Push64(emu, addr); - R_RIP = addr = ED->q[0]; - R_CS = (ED+1)->word[0]; - } - return 0; // exit loop to recompute new CS... - } - break; - case 4: /* JMP NEAR Ed */ - if(rex.is32bits) - addr = (uintptr_t)getAlternate((void*)(uintptr_t)ED->dword[0]); - else - addr = (uintptr_t)getAlternate((void*)ED->q[0]); - break; - case 5: /* JMP FAR Ed */ - if(MODREG) { - printf_log(LOG_NONE, "Illegal Opcode %p: 0x%02X 0x%02X %02X %02X\n", (void*)R_RIP, opcode, nextop, PK(2), PK(3)); - emu->quit=1; - emu->error |= ERR_ILLEGAL; - return 0; - } else { - if(rex.is32bits || !rex.w) { - R_RIP = addr = ED->dword[0]; - R_CS = ED->word[2]; - } else { - R_RIP = addr = ED->q[0]; - R_CS = (ED+1)->word[0]; - } - } - break; - case 6: /* Push Ed */ - if(rex.is32bits) { - tmp32u = ED->dword[0]; - Push32(emu, tmp32u); // avoid potential issue with push [esp+...] - } else { - tmp64u = ED->q[0]; // rex.w ignored - Push64(emu, tmp64u); // avoid potential issue with push [esp+...] - } - break; - default: - printf_log(LOG_NONE, "Illegal Opcode %p: %02X %02X %02X %02X %02X %02X\n",(void*)R_RIP, opcode, nextop, PK(2), PK(3), PK(4), PK(5)); - emu->quit=1; - emu->error |= ERR_ILLEGAL; - return 0; - } - break; - default: - return 0; - } - return addr; -} diff --git a/src/emu/x64run66.c b/src/emu/x64run66.c index 89aec17..8379b67 100644 --- a/src/emu/x64run66.c +++ b/src/emu/x64run66.c @@ -8,17 +8,19 @@ #include #include +#include "x64_signals.h" #include "debug.h" #include "box64stack.h" +#include "box64cpu_util.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" #include "x64trace.h" #include "x87emu_private.h" #include "box64context.h" -#include "bridge.h" +#include "alternate.h" +#include "emit_signals.h" #ifdef DYNAREC #include "../dynarec/native_lock.h" #endif @@ -26,9 +28,9 @@ #include "modrm.h" #ifdef TEST_INTERPRETER -uintptr_t Test66(x64test_t *test, rex_t rex, int rep, uintptr_t addr) +uintptr_t Test66(x64test_t *test, rex_t rex, uintptr_t addr, int *step) #else -uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) +uintptr_t Run66(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) #endif { uint8_t opcode; @@ -47,21 +49,6 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) opcode = F8; - while((opcode==0x2E) || (opcode==0x36) || (opcode==0x26) || (opcode==0x66)) // ignoring CS:, SS:, ES: or multiple 0x66 - opcode = F8; - - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - rex.rex = 0; - if(!rex.is32bits) - while(opcode>=0x40 && opcode<=0x4f) { - rex.rex = opcode; - opcode = F8; - } - switch(opcode) { #define GO(B, OP) \ case B+0: \ @@ -123,11 +110,10 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) return 0; } emu->segs[_ES] = Pop16(emu); - emu->segs_serial[_ES] = 0; break; case 0x0F: /* more opcdes */ - switch(rep) { + switch(rex.rep) { case 0: #ifdef TEST_INTERPRETER return Test660F(test, rex, addr); @@ -136,9 +122,9 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) #endif case 1: #ifdef TEST_INTERPRETER - return Test66F20F(test, rex, addr); + return Test66F20F(test, rex, addr, step); #else - return Run66F20F(emu, rex, addr); + return Run66F20F(emu, rex, addr, step); #endif case 2: #ifdef TEST_INTERPRETER @@ -160,7 +146,6 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) return 0; } emu->segs[_DS] = Pop16(emu); // no check, no use.... - emu->segs_serial[_DS] = 0; break; case 0x39: @@ -218,7 +203,8 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) case 0x55: case 0x56: case 0x57: /* PUSH Reg */ - tmp16u = emu->regs[opcode&7].word[0]; + tmp8u = (opcode&7)+(rex.b<<3); + tmp16u = emu->regs[tmp8u].word[0]; Push16(emu, tmp16u); break; case 0x58: @@ -229,7 +215,7 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) case 0x5D: case 0x5E: case 0x5F: /* POP Reg */ - tmp8u = opcode&7; + tmp8u = (opcode&7)+(rex.b<<3); emu->regs[tmp8u].word[0] = Pop16(emu); break; case 0x60: /* PUSHA */ @@ -262,18 +248,12 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) } break; - case 0x64: /* FS: */ - #ifdef TEST_INTERPRETER - return Test6664(test, rex, _FS, addr); - #else - return Run6664(emu, rex, _FS, addr); - #endif - case 0x65: /* GS: */ - #ifdef TEST_INTERPRETER - return Test6664(test, rex, _GS, addr); - #else - return Run6664(emu, rex, _GS, addr); - #endif + case 0x63: /* MOVSXD Gw,Ew */ + nextop = F8; + GETEW(0); + GETGW; + GW->sword[0] = EW->sword[0]; + break; case 0x68: /* PUSH u16 */ tmp16u = F16; @@ -291,7 +271,10 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) GW->word[0] = imul16(emu, EW->word[0], tmp16u); } break; - + case 0x6A: /* PUSH u8 */ + tmp16s = F8S; + Push16(emu, tmp16s); + break; case 0x6B: /* IMUL Gw,Ew,Ib */ nextop = F8; GETEW(1); @@ -304,6 +287,18 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) GW->word[0] = imul16(emu, EW->word[0], (uint16_t)tmp16s); } break; + case 0x6C: /* INSB DX */ + case 0x6D: /* INSW DX */ + case 0x6E: /* OUTSB DX */ + case 0x6F: /* OUTSW DX */ +#ifndef TEST_INTERPRETER + if(rex.is32bits && BOX64ENV(ignoreint3)) + { + } else { + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); + } + #endif + break; case 0x70: case 0x71: @@ -409,13 +404,21 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) case 0x8E: /* MOV Seg,Ew */ nextop = F8; GETEW(0); - emu->segs[((nextop&0x38)>>3)] = EW->word[0]; - emu->segs_serial[((nextop&0x38)>>3)] = 0; + tmp8u = (nextop&0x38)>>3; + if((tmp8u>5) || (tmp8u==1)) { + return 0; + } + emu->segs[tmp8u] = ED->word[0]; + if(((tmp8u==_FS) || (tmp8u==_GS)) && emu->segs[tmp8u]) + GetSegmentBaseEmu(emu, tmp8u); // refresh segs_offs + /*if(tmp8u==_SS && tf) // disable trace when SS is accessed + no_tf = 1;*/ //TODO? break; case 0x8F: /* POP Ew */ nextop = F8; + tmp16u = Pop16(emu); // to handle pop [RSP] stuffs GETEW(0); - EW->word[0] = Pop16(emu); + EW->word[0] = tmp16u; break; case 0x90: /* NOP or XCHG R8d, AX*/ case 0x91: @@ -458,28 +461,28 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) case 0xA1: /* MOV EAX,Od */ if(rex.is32bits) { - R_AX = *(uint16_t*)(uintptr_t)F32; + R_AX = *(uint16_t*)(uintptr_t)(ptr_t)(F32+rex.offset); } else { if(rex.w) - R_RAX = *(uint64_t*)F64; + R_RAX = *(uint64_t*)(F64+rex.offset); else - R_AX = *(uint16_t*)F64; + R_AX = *(uint16_t*)(F64+rex.offset); } break; case 0xA3: /* MOV Od,EAX */ if(rex.is32bits) { - *(uint16_t*)(uintptr_t)F32 = R_AX; + *(uint16_t*)(uintptr_t)(ptr_t)(F32+rex.offset) = R_AX; } else { if(rex.w) - *(uint64_t*)F64 = R_RAX; + *(uint64_t*)(F64+rex.offset) = R_RAX; else - *(uint16_t*)F64 = R_AX; + *(uint16_t*)(F64+rex.offset) = R_AX; } break; case 0xA4: /* (REP) MOVSB */ tmp8s = ACCESS_FLAG(F_DF)?-1:+1; - tmp64u = (rep)?R_RCX:1L; + tmp64u = (rex.rep)?R_RCX:1L; while(tmp64u) { #ifndef TEST_INTERPRETER *(uint8_t*)R_RDI = *(uint8_t*)R_RSI; @@ -488,12 +491,12 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) R_RSI += tmp8s; --tmp64u; } - if(rep) + if(rex.rep) R_RCX = tmp64u; break; case 0xA5: /* (REP) MOVSW */ tmp8s = ACCESS_FLAG(F_DF)?-1:+1; - tmp64u = (rep)?R_RCX:1L; + tmp64u = (rex.rep)?R_RCX:1L; if(rex.w) { tmp8s *= 8; while(tmp64u) { @@ -511,7 +514,7 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) R_RSI += tmp8s; } } - if(rep) + if(rex.rep) R_RCX = tmp64u; break; @@ -520,7 +523,7 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) tmp8s = ACCESS_FLAG(F_DF)?-8:+8; else tmp8s = ACCESS_FLAG(F_DF)?-2:+2; - switch(rep) { + switch(rex.rep) { case 1: if(R_RCX) { if(rex.w) { @@ -604,7 +607,7 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) tmp8s = ACCESS_FLAG(F_DF)?-8:+8; else tmp8s = ACCESS_FLAG(F_DF)?-2:+2; - tmp64u = (rep)?R_RCX:1L; + tmp64u = (rex.rep)?R_RCX:1L; if((rex.w)) while(tmp64u) { #ifndef TEST_INTERPRETER @@ -621,7 +624,7 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) R_RDI += tmp8s; --tmp64u; } - if(rep) + if(rex.rep) R_RCX = tmp64u; break; case 0xAD: /* (REP) LODSW */ @@ -629,7 +632,7 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) tmp8s = ACCESS_FLAG(F_DF)?-8:+8; else tmp8s = ACCESS_FLAG(F_DF)?-2:+2; - tmp64u = (rep)?R_RCX:1L; + tmp64u = (rex.rep)?R_RCX:1L; if((rex.w)) while(tmp64u) { R_RAX = *(uint64_t*)R_RSI; @@ -642,7 +645,7 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) R_RSI += tmp8s; --tmp64u; } - if(rep) + if(rex.rep) R_RCX = tmp64u; break; @@ -651,7 +654,7 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) tmp8s = ACCESS_FLAG(F_DF)?-8:+8; else tmp8s = ACCESS_FLAG(F_DF)?-2:+2; - switch(rep) { + switch(rex.rep) { case 1: if(R_RCX) { if(rex.w) { @@ -726,8 +729,8 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) GETEW(1); tmp8u = F8 /*& 0x1f*/; switch((nextop>>3)&7) { - case 0: EW->word[0] = rol16(emu, EW->word[0], tmp8u); break; - case 1: EW->word[0] = ror16(emu, EW->word[0], tmp8u); break; + case 0: tmp8u2=ACCESS_FLAG(F_OF); EW->word[0] = rol16(emu, EW->word[0], tmp8u); break; + case 1: tmp8u2=ACCESS_FLAG(F_OF); EW->word[0] = ror16(emu, EW->word[0], tmp8u); break; case 2: EW->word[0] = rcl16(emu, EW->word[0], tmp8u); break; case 3: EW->word[0] = rcr16(emu, EW->word[0], tmp8u); break; case 4: @@ -735,6 +738,7 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) case 5: EW->word[0] = shr16(emu, EW->word[0], tmp8u); break; case 7: EW->word[0] = sar16(emu, EW->word[0], tmp8u); break; } + if (!BOX64ENV(cputype) && ((nextop>>3)&7) <= 1 && ((tmp8u&0x1f)>1)) CONDITIONAL_SET_FLAG(tmp8u2, F_OF); break; case 0xC7: /* MOV Ew,Iw */ @@ -806,15 +810,51 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) return Run66DD(emu, rex, addr); #endif + case 0xE4: /* IN AL, XX */ + case 0xE5: /* IN AX, XX */ + case 0xE6: /* OUT XX, AL */ + case 0xE7: /* OUT XX, AX */ + // this is a privilege opcode... + #ifndef TEST_INTERPRETER + F8; + if(rex.is32bits && BOX64ENV(ignoreint3)) + {} else + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); + #endif + break; case 0xE8: /* CALL Id */ - tmp32s = F32S; // call is relative + tmp32s = (rex.is32bits)?F16S:F32S; // call is relative if(rex.is32bits) Push32(emu, addr); else Push64(emu, addr); addr += tmp32s; break; + case 0xE9: /* JMP Id */ + tmp32s = (rex.is32bits)?(F16S):(F32S); // jmp is relative + if(rex.is32bits) + addr = (uint32_t)(addr+tmp32s); + else + addr += tmp32s; + addr = (uintptr_t)getAlternate((void*)addr); + break; + + case 0xEB: /* JMP Ib */ + tmp32s = F8S; // jump is relative + addr += tmp32s; + break; + case 0xEC: /* IN AL, DX */ + case 0xED: /* IN AX, DX */ + case 0xEE: /* OUT DX, AL */ + case 0xEF: /* OUT DX, AX */ + // this is a privilege opcode... + #ifndef TEST_INTERPRETER + if(rex.is32bits && BOX64ENV(ignoreint3)) + {} else + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); + #endif + break; case 0xF0: /* LOCK: */ #ifdef TEST_INTERPRETER return Test66F0(test, rex, addr); @@ -850,9 +890,6 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) break; case 7: /* IDIV Ed */ idiv64(emu, ED->q[0]); - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; } } else { diff --git a/src/emu/x64run660f.c b/src/emu/x64run660f.c index 84ed4e2..faf9c90 100644 --- a/src/emu/x64run660f.c +++ b/src/emu/x64run660f.c @@ -5,21 +5,25 @@ #include #include #include -#include #include #include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" #include "x64trace.h" #include "x87emu_private.h" #include "box64context.h" +#include "emit_signals.h" #include "bridge.h" +#ifdef DYNAREC +#include "custommem.h" +#endif #include "modrm.h" #include "x64compstrings.h" @@ -63,9 +67,8 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) int64_t tmp64s, i64[4]; float tmpf; double tmpd; - #ifndef NOALIGN int is_nan; - #endif + int mask_nan[4]; reg64_t *oped, *opgd; sse_regs_t *opex, *opgx, eax1, *opex2, eax2; mmx87_regs_t *opem, *opgm; @@ -134,15 +137,19 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 0x12: /* MOVLPD Gx, Eq */ nextop = F8; - GETE8(0); - GETGX; - GX->q[0] = ED->q[0]; + if(!MODREG) { + GETE8(0); + GETGX; + GX->q[0] = ED->q[0]; + } break; case 0x13: /* MOVLPD Eq, Gx */ nextop = F8; - GETE8(0); - GETGX; - ED->q[0] = GX->q[0]; + if(!MODREG) { + GETE8(0); + GETGX; + ED->q[0] = GX->q[0]; + } break; case 0x14: /* UNPCKLPD Gx, Ex */ nextop = F8; @@ -159,17 +166,28 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 0x16: /* MOVHPD Gx, Ed */ nextop = F8; - GETE8(0); - GETGX; - GX->q[1] = ED->q[0]; + if(!MODREG) { + GETE8(0); + GETGX; + GX->q[1] = ED->q[0]; + } break; case 0x17: /* MOVHPD Ed, Gx */ nextop = F8; - GETE8(0); - GETGX; - ED->q[0] = GX->q[1]; + if(!MODREG) { + GETE8(0); + GETGX; + ED->q[0] = GX->q[1]; + } break; + case 0x18: + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: case 0x1F: /* NOP (multi-byte) */ nextop = F8; FAKEED(0); @@ -198,10 +216,12 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 0x2B: /* MOVNTPD Ex, Gx */ nextop = F8; - GETEX(0); - GETGX; - EX->q[0] = GX->q[0]; - EX->q[1] = GX->q[1]; + if(!MODREG) { + GETEX(0); + GETGX; + EX->q[0] = GX->q[0]; + EX->q[1] = GX->q[1]; + } break; case 0x2C: /* CVTTPD2PI Gm, Ex */ nextop = F8; @@ -541,10 +561,12 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 0x2A: /* MOVNTDQA Gx, Ex */ nextop = F8; - GETEX(0); - GETGX; - GX->q[0] = EX->q[0]; - GX->q[1] = EX->q[1]; + if(!MODREG) { + GETEX(0); + GETGX; + GX->q[0] = EX->q[0]; + GX->q[1] = EX->q[1]; + } break; case 0x2B: /* PACKUSDW Gx, Ex */ nextop = F8; @@ -698,6 +720,15 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) GX->ud[1] = 0; break; + case 0x82: /* INVPCID */ + nextop = F8; + GETED(0); + // this is a privilege opcode... + #ifndef TEST_INTERPRETER + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0); + #endif + break; + case 0xDB: /* AESIMC Gx, Ex */ nextop = F8; GETEX(0); @@ -827,7 +858,7 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) tmp64u2 = GD->q[0] + ED->q[0]; } tmp64u = (tmp64u >> 32) + (GD->q[0] >> 32) + (ED->q[0] >> 32); - CONDITIONAL_SET_FLAG(tmp64u & 0x100000000L, F_CF); + CONDITIONAL_SET_FLAG(tmp64u & 0x100000000LL, F_CF); GD->q[0] = tmp64u2; } else { if (ACCESS_FLAG(F_CF)) @@ -835,6 +866,7 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) else GD->q[0] = (uint64_t)GD->dword[0] + ED->dword[0]; CONDITIONAL_SET_FLAG(GD->q[0] & 0x100000000LL, F_CF); + GD->dword[1] = 0; } break; default: @@ -966,7 +998,7 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) } break; - case 0x0C: /* PBLENDPS Gx, Ex, Ib */ + case 0x0C: /* BLENDPS Gx, Ex, Ib */ nextop = F8; GETEX(1); GETGX; @@ -976,7 +1008,7 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) GX->ud[i] = EX->ud[i]; } break; - case 0x0D: /* PBLENDPD Gx, Ex, Ib */ + case 0x0D: /* BLENDPD Gx, Ex, Ib */ nextop = F8; GETEX(1); GETGX; @@ -1260,12 +1292,12 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) GETEX(0); GETGX; for (int i=0; i<2; ++i) { - #ifndef NOALIGN - if(EX->d[i]<0.0) // on x86, default nan are negative - GX->d[i] = -NAN; // but input NAN are not touched (so sqrt(+nan) -> +nan) + if(EX->d[i]<0.0) // on x86, default nan are negative + GX->d[i] = -NAN; // but input NAN are not touched (so sqrt(+nan) -> +nan) + else if(isnan(EX->d[i])) + GX->d[i] = EX->d[i]; else - #endif - GX->d[i] = sqrt(EX->d[i]); + GX->d[i] = sqrt(EX->d[i]); } break; @@ -1301,29 +1333,21 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) nextop = F8; GETEX(0); GETGX; + MARK_NAN_VD_2(GX, EX); for(int i=0; i<2; ++i) { - #ifndef NOALIGN - // add generate a -NAN only if doing inf + -inf - if((isinf(GX->d[i]) && isinf(EX->d[i]) && (EX->q[i]&0x8000000000000000LL)!=(GX->q[i]&0x8000000000000000LL))) - GX->d[i] = -NAN; - else - #endif GX->d[i] += EX->d[i]; } + CHECK_NAN_VD(GX); break; case 0x59: /* MULPD Gx, Ex */ nextop = F8; GETEX(0); GETGX; + MARK_NAN_VD_2(GX, EX); for(int i=0; i<2; ++i) { - #ifndef NOALIGN - // mul generate a -NAN only if doing (+/-)inf * (+/-)0 - if((isinf(GX->d[i]) && EX->d[i]==0.0) || (isinf(EX->d[i]) && GX->d[i]==0.0)) - GX->d[i] = -NAN; - else - #endif GX->d[i] *= EX->d[i]; } + CHECK_NAN_VD(GX); break; case 0x5A: /* CVTPD2PS Gx, Ex */ nextop = F8; @@ -1370,23 +1394,19 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) nextop = F8; GETEX(0); GETGX; + MARK_NAN_VD_2(GX, EX); for(int i=0; i<2; ++i) { - #ifndef NOALIGN - // sub generate a -NAN only if doing inf - inf - if((isinf(GX->d[i]) && isinf(EX->d[i]) && (EX->q[i]&0x8000000000000000LL)==(GX->q[i]&0x8000000000000000LL))) - GX->d[i] = -NAN; - else - #endif GX->d[i] -= EX->d[i]; } + CHECK_NAN_VD(GX); break; case 0x5D: /* MINPD Gx, Ex */ nextop = F8; GETEX(0); GETGX; - if (isnan(GX->d[0]) || isnan(EX->d[0]) || isless(EX->d[0], GX->d[0])) + if (isnan(GX->d[0]) || isnan(EX->d[0]) || islessequal(EX->d[0], GX->d[0])) GX->d[0] = EX->d[0]; - if (isnan(GX->d[1]) || isnan(EX->d[1]) || isless(EX->d[1], GX->d[1])) + if (isnan(GX->d[1]) || isnan(EX->d[1]) || islessequal(EX->d[1], GX->d[1])) GX->d[1] = EX->d[1]; break; case 0x5E: /* DIVPD Gx, Ex */ @@ -1394,23 +1414,19 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) GETEX(0); GETGX; for (int i=0; i<2; ++i) { - #ifndef NOALIGN is_nan = isnan(GX->d[i]) || isnan(EX->d[i]); - #endif GX->d[i] /= EX->d[i]; - #ifndef NOALIGN if(!is_nan && isnan(GX->d[i])) GX->d[i] = -NAN; - #endif } break; case 0x5F: /* MAXPD Gx, Ex */ nextop = F8; GETEX(0); GETGX; - if (isnan(GX->d[0]) || isnan(EX->d[0]) || isgreater(EX->d[0], GX->d[0])) + if (isnan(GX->d[0]) || isnan(EX->d[0]) || isgreaterequal(EX->d[0], GX->d[0])) GX->d[0] = EX->d[0]; - if (isnan(GX->d[1]) || isnan(EX->d[1]) || isgreater(EX->d[1], GX->d[1])) + if (isnan(GX->d[1]) || isnan(EX->d[1]) || isgreaterequal(EX->d[1], GX->d[1])) GX->d[1] = EX->d[1]; break; case 0x60: /* PUNPCKLBW Gx,Ex */ @@ -1640,17 +1656,9 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) case 3: /* PSRLDQ Ex, Ib */ tmp8u = F8; if(tmp8u>15) - {EX->q[0] = EX->q[1] = 0;} - else if (tmp8u!=0) { - tmp8u*=8; - if (tmp8u < 64) { - EX->q[0] = (EX->q[0] >> tmp8u) | (EX->q[1] << (64 - tmp8u)); - EX->q[1] = (EX->q[1] >> tmp8u); - } else { - EX->q[0] = EX->q[1] >> (tmp8u - 64); - EX->q[1] = 0; - } - } + EX->u128 = 0; + else if (tmp8u) + EX->u128 >>= (tmp8u<<3); break; case 6: /* PSLLQ Ex, Ib */ tmp8u = F8; @@ -1662,17 +1670,9 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) case 7: /* PSLLDQ Ex, Ib */ tmp8u = F8; if(tmp8u>15) - {EX->q[0] = EX->q[1] = 0;} - else if (tmp8u!=0) { - tmp8u*=8; - if (tmp8u < 64) { - EX->q[1] = (EX->q[1] << tmp8u) | (EX->q[0] >> (64 - tmp8u)); - EX->q[0] = (EX->q[0] << tmp8u); - } else { - EX->q[1] = EX->q[0] << (tmp8u - 64); - EX->q[0] = 0; - } - } + EX->u128 = 0; + else if (tmp8u) + EX->u128 <<= (tmp8u<<3); break; default: return 0; @@ -1699,55 +1699,73 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) for (int i=0; i<4; ++i) GX->ud[i] = (GX->ud[i]==EX->ud[i])?0xffffffff:0; break; + + case 0x78: /* EXTRQ Ex, ib, ib */ + // AMD only + nextop = F8; + if(!BOX64ENV(cputype) || (nextop&0xC0)>>3) { + #ifndef TEST_INTERPRETER + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); + #endif + } else { + //TODO: test /0 + GETEX(2); + tmp8s = F8&0x3f; + tmp8u = F8&0x3f; + EX->q[0]>>=tmp8u; + EX->q[0]&=((1<<(tmp8s+1))-1); + } + break; + case 0x79: /* EXTRQ Ex, Gx */ + // AMD only + nextop = F8; + if(!BOX64ENV(cputype) || !(MODREG)) { + #ifndef TEST_INTERPRETER + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); + #endif + } else { + //TODO: test/r + GETGX; + GETEX(2); + tmp8s = EX->ub[0]&0x3f; + tmp8u = EX->ub[1]&0x3f; + GX->q[0]>>=tmp8u; + GX->q[0]&=((1<<(tmp8s+1))-1); + } + break; case 0x7C: /* HADDPD Gx, Ex */ nextop = F8; GETEX(0); GETGX; - #ifndef NOALIGN is_nan = isnan(GX->d[0]) || isnan(GX->d[1]); - #endif GX->d[0] += GX->d[1]; - #ifndef NOALIGN if(!is_nan && isnan(GX->d[0])) GX->d[0] = -NAN; - #endif if(EX==GX) { GX->d[1] = GX->d[0]; } else { - #ifndef NOALIGN is_nan = isnan(EX->d[0]) || isnan(EX->d[1]); - #endif GX->d[1] = EX->d[0] + EX->d[1]; - #ifndef NOALIGN if(!is_nan && isnan(GX->d[1])) GX->d[1] = -NAN; - #endif } break; case 0x7D: /* HSUBPD Gx, Ex */ nextop = F8; GETEX(0); GETGX; - #ifndef NOALIGN is_nan = isnan(GX->d[0]) || isnan(GX->d[1]); - #endif GX->d[0] -= GX->d[1]; - #ifndef NOALIGN if(!is_nan && isnan(GX->d[0])) GX->d[0] = -NAN; - #endif if(EX==GX) { GX->d[1] = GX->d[0]; } else { - #ifndef NOALIGN is_nan = isnan(EX->d[0]) || isnan(EX->d[1]); - #endif GX->d[1] = EX->d[0] - EX->d[1]; - #ifndef NOALIGN if(!is_nan && isnan(GX->d[1])) GX->d[1] = -NAN; - #endif } break; case 0x7E: /* MOVD Ed, Gx */ @@ -1781,7 +1799,15 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) tmp32s >>= (rex.w?6:4); if(!MODREG) { + #ifdef TEST_INTERPRETER + test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:1))); + if(rex.w) + *(uint64_t*)test->mem = *(uint64_t*)test->memaddr; + else + *(uint16_t*)test->mem = *(uint16_t*)test->memaddr; + #else EW=(reg64_t*)(((uintptr_t)(EW))+(tmp32s<<(rex.w?3:1))); + #endif } if(rex.w) { if(EW->q[0] & (1LL<>= (rex.w?6:4); if(!MODREG) { + #ifdef TEST_INTERPRETER + test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:1))); + if(rex.w) + *(uint64_t*)test->mem = *(uint64_t*)test->memaddr; + else + *(uint16_t*)test->mem = *(uint16_t*)test->memaddr; + #else EW=(reg64_t*)(((uintptr_t)(EW))+(tmp32s<<(rex.w?3:1))); + #endif } if(rex.w) { if(EW->q[0] & (1LL<word[0] = shrd16(emu, EW->word[0], GW->word[0], tmp8u); break; - + case 0xAE: /* Grp Ed (SSE) */ + nextop = F8; + if(MODREG) + switch(nextop) { + default: + return 0; + } + else + switch((nextop>>3)&7) { + case 6: /* CLWB Ed */ + _GETED(0); + __sync_synchronize(); + break; + case 7: /* CLFLUSHOPT Ed */ + _GETED(0); + __sync_synchronize(); + break; + default: + return 0; + } + break; case 0xAF: /* IMUL Gw,Ew */ nextop = F8; GETEW(0); @@ -2034,12 +2088,20 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) nextop = F8; GETEW(0); GETGW; - tmp64s = rex.w?GW->sq[0]:GW->sword[0]; - tmp8u=tmp64s&(rex.w?63:15); - tmp64s >>= (rex.w?6:4); + tmp32s = rex.w?GW->sdword[0]:GW->sword[0]; + tmp8u=tmp32s&(rex.w?63:15); + tmp32s >>= (rex.w?6:4); if(!MODREG) { - EW=(reg64_t*)(((uintptr_t)(EW))+(tmp64s<<(rex.w?3:1))); + #ifdef TEST_INTERPRETER + test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:1))); + if(rex.w) + *(uint64_t*)test->mem = *(uint64_t*)test->memaddr; + else + *(uint16_t*)test->mem = *(uint16_t*)test->memaddr; + #else + EW=(reg64_t*)(((uintptr_t)(EW))+(tmp32s<<(rex.w?3:1))); + #endif } if(rex.w) { if(EW->q[0] & (1LL<word[0] ^= (1<q[0]; if(tmp64u) { CLEAR_FLAG(F_ZF); - tmp8u = 0; while(!(tmp64u&(1LL<q[0] = tmp8u; } else { @@ -2074,19 +2136,26 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) tmp16u = EW->word[0]; if(tmp16u) { CLEAR_FLAG(F_ZF); - tmp8u = 0; while(!(tmp16u&(1<word[0] = tmp8u; } else { SET_FLAG(F_ZF); } } + if(!BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG(PARITY(tmp8u), F_PF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_OF); + } break; case 0xBD: /* BSR Ew,Gw */ CHECK_FLAGS(emu); nextop = F8; GETEW(0); GETGW; + tmp8u = 0; if(rex.w) { tmp64u = EW->q[0]; if(tmp64u) { @@ -2108,6 +2177,13 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) SET_FLAG(F_ZF); } } + if(!BOX64ENV(cputype)) { + CONDITIONAL_SET_FLAG(PARITY(tmp8u), F_PF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_OF); + } break; case 0xBE: /* MOVSX Gw,Eb */ nextop = F8; @@ -2123,9 +2199,9 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) GETEW(0); GETGW; if(rex.w) - GW->sq[0] = EB->sword[0]; + GW->sq[0] = EW->sword[0]; else - GW->sword[0] = EB->sword[0]; + GW->sword[0] = EW->sword[0]; break; case 0xC1: /* XADD Gw,Ew */ // Xchange and Add @@ -2200,15 +2276,18 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) if(rex.w) { emu->regs[tmp8u].q[0] = __builtin_bswap64(emu->regs[tmp8u].q[0]); } else { - emu->regs[tmp8u].word[0] = __builtin_bswap16(emu->regs[tmp8u].word[0]); + // this is undefined behaviour + emu->regs[tmp8u].word[0] = 0; } break; case 0xD0: /* ADDSUBPD Gx, Ex */ nextop = F8; GETEX(0); GETGX; + MARK_NAN_VD_2(GX, EX); GX->d[0] -= EX->d[0]; GX->d[1] += EX->d[1]; + CHECK_NAN_VD(GX); break; case 0xD1: /* PSRLW Gx, Ex */ nextop = F8; @@ -2389,22 +2468,24 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) nextop = F8; GETEX(0); GETGX; - if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>0x7fffffff) - GX->sd[0] = 0x80000000; + if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>(double)0x7fffffff) + GX->ud[0] = 0x80000000; else GX->sd[0] = EX->d[0]; - if(isnan(EX->d[1]) || isinf(EX->d[1]) || EX->d[1]>0x7fffffff) - GX->sd[1] = 0x80000000; + if(isnan(EX->d[1]) || isinf(EX->d[1]) || EX->d[1]>(double)0x7fffffff) + GX->ud[1] = 0x80000000; else GX->sd[1] = EX->d[1]; GX->q[1] = 0; break; case 0xE7: /* MOVNTDQ Ex, Gx */ nextop = F8; - GETEX(0); - GETGX; - EX->q[0] = GX->q[0]; - EX->q[1] = GX->q[1]; + if(!MODREG) { + GETEX(0); + GETGX; + EX->q[0] = GX->q[0]; + EX->q[1] = GX->q[1]; + } break; case 0xE8: /* PSUBSB Gx,Ex */ nextop = F8; diff --git a/src/emu/x64run6664.c b/src/emu/x64run6664.c deleted file mode 100644 index 299f7f7..0000000 --- a/src/emu/x64run6664.c +++ /dev/null @@ -1,185 +0,0 @@ -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "box64stack.h" -#include "x64emu.h" -#include "x64run.h" -#include "x64emu_private.h" -#include "x64run_private.h" -#include "x64primop.h" -#include "x64trace.h" -#include "x87emu_private.h" -#include "box64context.h" -#include "bridge.h" - -#include "modrm.h" - -#ifdef TEST_INTERPRETER -uintptr_t Test6664(x64test_t *test, rex_t rex, int seg, uintptr_t addr) -#else -uintptr_t Run6664(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr) -#endif -{ - uint8_t opcode; - uint8_t nextop; - uint16_t tmp16u; - int16_t tmp16s; - uint64_t tmp64u; - reg64_t *oped, *opgd; - sse_regs_t *opex, *opgx; - #ifdef TEST_INTERPRETER - x64emu_t* emu = test->emu; - #endif - uintptr_t tlsdata = GetSegmentBaseEmu(emu, seg); - - opcode = F8; - // REX prefix before the F0 are ignored - rex.rex = 0; - if(!rex.is32bits) - while(opcode>=0x40 && opcode<=0x4f) { - rex.rex = opcode; - opcode = F8; - } - - switch(opcode) { - - case 0x0F: - opcode = F8; - switch(opcode) { - - case 0x11: /* MOVUPD Ex, Gx */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - memcpy(EX, GX, 16); // unaligned... - break; - - case 0x2E: /* UCOMISD Gx, Ex */ - // no special check... - case 0x2F: /* COMISD Gx, Ex */ - RESET_FLAGS(emu); - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - if(isnan(GX->d[0]) || isnan(EX->d[0])) { - SET_FLAG(F_ZF); SET_FLAG(F_PF); SET_FLAG(F_CF); - } else if(isgreater(GX->d[0], EX->d[0])) { - CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_PF); CLEAR_FLAG(F_CF); - } else if(isless(GX->d[0], EX->d[0])) { - CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_PF); SET_FLAG(F_CF); - } else { - SET_FLAG(F_ZF); CLEAR_FLAG(F_PF); CLEAR_FLAG(F_CF); - } - CLEAR_FLAG(F_OF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_SF); - break; - - case 0x6F: /* MOVDQA Gx, Ex */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - GX->q[0] = EX->q[0]; - GX->q[1] = EX->q[1]; - break; - - case 0x7F: /* MOVDQA Ex,Gx */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - EX->q[0] = GX->q[0]; - EX->q[1] = GX->q[1]; - break; - - case 0xD6: /* MOVQ Ex,Gx */ - nextop = F8; - GETEX_OFFS(0, tlsdata); - GETGX; - EX->q[0] = GX->q[0]; - if(MODREG) - EX->q[1] = 0; - break; - - default: - return 0; - } - break; - - case 0x39: /* CMP FS:Ew,Gw */ - nextop = F8; - GETEW_OFFS(0, tlsdata); - GETGW; - if (rex.w) - cmp64(emu, EW->q[0], GW->q[0]); - else - cmp16(emu, EW->word[0], GW->word[0]); - break; - - case 0x83: /* GRP3 Ew,Ib */ - nextop = F8; - GETEW_OFFS((opcode==0x81)?2:1, tlsdata); - GETGW; - if(opcode==0x81) - tmp16u = F16; - else { - tmp16s = F8S; - tmp16u = (uint16_t)tmp16s; - } - switch((nextop>>3)&7) { - case 0: EW->word[0] = add16(emu, EW->word[0], tmp16u); break; - case 1: EW->word[0] = or16(emu, EW->word[0], tmp16u); break; - case 2: EW->word[0] = adc16(emu, EW->word[0], tmp16u); break; - case 3: EW->word[0] = sbb16(emu, EW->word[0], tmp16u); break; - case 4: EW->word[0] = and16(emu, EW->word[0], tmp16u); break; - case 5: EW->word[0] = sub16(emu, EW->word[0], tmp16u); break; - case 6: EW->word[0] = xor16(emu, EW->word[0], tmp16u); break; - case 7: cmp16(emu, EW->word[0], tmp16u); break; - } - break; - - case 0x89: /* MOV FS:Ew,Gw */ - nextop = F8; - GETEW_OFFS(0, tlsdata); - GETGW; - if(rex.w) - EW->q[0] = GW->q[0]; - else - EW->word[0] = GW->word[0]; - break; - case 0x8B: /* MOV Gw,FS:Ew */ - nextop = F8; - GETEW_OFFS(0, tlsdata); - GETGW; - if(rex.w) - GW->q[0] = EW->q[0]; - else - GW->word[0] = EW->word[0]; - break; - case 0x8D: /* LEA Gw,M */ - nextop = F8; - GETGW; - tmp64u = GETEA(0); - if(rex.w) - GW->q[0] = tmp64u; - else - GW->word[0] = (uint16_t)tmp64u; - break; - case 0xC7: /* MOV FS:Ew,Iw */ - nextop = F8; - GETEW_OFFS(2, tlsdata); - if(rex.w) - EW->q[0] = F16S; - else - EW->word[0] = F16; - break; - default: - return 0; - } - return addr; -} diff --git a/src/emu/x64run66d9.c b/src/emu/x64run66d9.c index 84b554d..a7b1a33 100644 --- a/src/emu/x64run66d9.c +++ b/src/emu/x64run66d9.c @@ -11,7 +11,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" diff --git a/src/emu/x64run66dd.c b/src/emu/x64run66dd.c index 7f768aa..b167306 100644 --- a/src/emu/x64run66dd.c +++ b/src/emu/x64run66dd.c @@ -11,7 +11,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" diff --git a/src/emu/x64run66f0.c b/src/emu/x64run66f0.c index 7e6fc5d..1a14158 100644 --- a/src/emu/x64run66f0.c +++ b/src/emu/x64run66f0.c @@ -11,7 +11,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -33,9 +32,11 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr) { uint8_t opcode; uint8_t nextop; + uint8_t tmp8u, tmp8u2; int16_t tmp16s; uint16_t tmp16u, tmp16u2; int32_t tmp32s; + uint32_t tmp32u, tmp32u2; int64_t tmp64s; uint64_t tmp64u, tmp64u2; reg64_t *oped, *opgd; @@ -46,16 +47,6 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr) x64emu_t* emu = test->emu; #endif opcode = F8; - // REX prefix before the F0 are ignored - rex.rex = 0; - uintptr_t addr_entry = addr; - if(!rex.is32bits) - while(opcode>=0x40 && opcode<=0x4f) { - rex.rex = opcode; - opcode = F8; - } - - if(rex.w) return RunF0(emu, rex, addr_entry); switch(opcode) { @@ -65,6 +56,10 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xB1: /* CMPXCHG Ew,Gw */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETEW(0); GETGW; #if defined(DYNAREC) && !defined(TEST_INTERPRETER) @@ -90,8 +85,169 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr) #endif break; + case 0xBA: + CHECK_FLAGS(emu); + nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } + GETEW(0); + tmp8u = F8; + switch((nextop>>3)&7) { + case 4: /* BT Ed,Ib */ + emu->error |= ERR_ILLEGAL; + return 0; + case 5: /* BTS Ew, Ib */ +#if defined(DYNAREC) && !defined(TEST_INTERPRETER) + tmp8u &= 15; + if ((uintptr_t)ED & 1) { + do { + tmp32u = native_lock_read_b(ED + (tmp8u >> 3)); + if (tmp32u & (1 << (tmp8u & 7))) { + SET_FLAG(F_CF); + tmp32s = 0; + } else { + tmp32u ^= (1 << (tmp8u & 7)); + tmp32s = native_lock_write_b(ED + (tmp8u >> 3), tmp32u); + CLEAR_FLAG(F_CF); + } + } while (tmp32s); + } else { + do { + tmp32u = native_lock_read_h(ED); + if (tmp32u & (1 << tmp8u)) { + SET_FLAG(F_CF); + tmp32s = 0; + } else { + tmp32u ^= (1 << tmp8u); + tmp32s = native_lock_write_h(ED, tmp32u); + CLEAR_FLAG(F_CF); + } + } while (tmp32s); + } +#else + pthread_mutex_lock(&my_context->mutex_lock); + tmp8u &= 15; + if (ED->dword[0] & (1 << tmp8u)) { + SET_FLAG(F_CF); + } else { + ED->dword[0] ^= (1 << tmp8u); + CLEAR_FLAG(F_CF); + } + pthread_mutex_unlock(&my_context->mutex_lock); +#endif + if (BOX64ENV(dynarec_test)) { + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_PF); + } + break; + case 6: /* BTR Ew, Ib */ +#if defined(DYNAREC) && !defined(TEST_INTERPRETER) + tmp8u &= 15; + if ((uintptr_t)ED & 1) { + do { + tmp32u = native_lock_read_b(ED + (tmp8u >> 3)); + if (tmp32u & (1 << (tmp8u & 7))) { + SET_FLAG(F_CF); + tmp32u ^= (1 << (tmp8u & 7)); + tmp32s = native_lock_write_b(ED + (tmp8u >> 3), tmp32u); + } else { + CLEAR_FLAG(F_CF); + tmp32s = 0; + } + } while (tmp32s); + } else { + do { + tmp32u = native_lock_read_h(ED); + if (tmp32u & (1 << tmp8u)) { + SET_FLAG(F_CF); + tmp32u ^= (1 << tmp8u); + tmp32s = native_lock_write_h(ED, tmp32u); + } else { + CLEAR_FLAG(F_CF); + tmp32s = 0; + } + } while (tmp32s); + } +#else + pthread_mutex_lock(&my_context->mutex_lock); + tmp8u &= 15; + if (ED->dword[0] & (1 << tmp8u)) { + SET_FLAG(F_CF); + } else { + ED->dword[0] ^= (1 << tmp8u); + CLEAR_FLAG(F_CF); + } + pthread_mutex_unlock(&my_context->mutex_lock); +#endif + if (BOX64ENV(dynarec_test)) { + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_PF); + } + break; + case 7: /* BTC Ew, Ib */ +#if defined(DYNAREC) && !defined(TEST_INTERPRETER) + tmp8u &= 15; + if ((uintptr_t)ED & 1) { + do { + tmp32u = native_lock_read_b(ED + (tmp8u >> 3)); + if (tmp32u & (1 << (tmp8u & 7))) { + SET_FLAG(F_CF); + tmp32s = 0; + } else { + CLEAR_FLAG(F_CF); + } + tmp32u ^= (1 << (tmp8u & 7)); + tmp32s = native_lock_write_b(ED + (tmp8u >> 3), tmp32u); + } while (tmp32s); + } else { + do { + tmp32u = native_lock_read_h(ED); + if (tmp32u & (1 << tmp8u)) { + SET_FLAG(F_CF); + tmp32s = 0; + } else { + CLEAR_FLAG(F_CF); + } + tmp32u ^= (1 << tmp8u); + tmp32s = native_lock_write_h(ED, tmp32u); + } while (tmp32s); + } +#else + pthread_mutex_lock(&my_context->mutex_lock); + tmp8u &= 15; + if (ED->dword[0] & (1 << tmp8u)) { + SET_FLAG(F_CF); + } else { + ED->dword[0] ^= (1 << tmp8u); + CLEAR_FLAG(F_CF); + } + pthread_mutex_unlock(&my_context->mutex_lock); +#endif + if (BOX64ENV(dynarec_test)) { + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_PF); + } + break; + default: + emu->error |= ERR_ILLEGAL; + return 0; + } + break; + case 0xC1: /* XADD Gw,Ew */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETEW(0); GETGW; #if defined(DYNAREC) && !defined(TEST_INTERPRETER) @@ -127,44 +283,30 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr) #define GO(B, OP) \ case B+1: \ nextop = F8; \ + if(MODREG) { \ + emu->error |= ERR_ILLEGAL; \ + return 0; \ + } \ GETEW(0); \ GETGW; \ do { \ tmp16u = native_lock_read_h(ED); \ tmp16u = OP##16(emu, tmp16u, GW->word[0]); \ } while (native_lock_write_h(ED, tmp16u)); \ - break; \ - case B+3: \ - nextop = F8; \ - GETEW(0); \ - GETGW; \ - GW->word[0] = OP##16(emu, GW->word[0], EW->word[0]); \ - break; \ - case B+5: \ - R_AX = OP##16(emu, R_AX, F16); \ break; #else #define GO(B, OP) \ case B+1: \ nextop = F8; \ + if(MODREG) { \ + emu->error |= ERR_ILLEGAL; \ + return 0; \ + } \ GETEW(0); \ GETGW; \ - pthread_mutex_lock(&my_context->mutex_lock); \ + pthread_mutex_lock(&my_context->mutex_lock); \ EW->word[0] = OP##16(emu, EW->word[0], GW->word[0]); \ - pthread_mutex_unlock(&my_context->mutex_lock); \ - break; \ - case B+3: \ - nextop = F8; \ - GETEW(0); \ - GETGW; \ - pthread_mutex_lock(&my_context->mutex_lock); \ - GW->word[0] = OP##16(emu, GW->word[0], EW->word[0]); \ - pthread_mutex_unlock(&my_context->mutex_lock); \ - break; \ - case B+5: \ - pthread_mutex_lock(&my_context->mutex_lock); \ - R_AX = OP##16(emu, R_AX, F16); \ - pthread_mutex_unlock(&my_context->mutex_lock); \ + pthread_mutex_unlock(&my_context->mutex_lock); \ break; #endif GO(0x00, add) /* ADD 0x00 -> 0x05 */ @@ -179,32 +321,24 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0x81: /* GRP Ew,Iw */ case 0x83: /* GRP Ew,Ib */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETEW((opcode==0x83)?1:2); tmp16s = (opcode==0x83)?(F8S):(F16S); tmp16u = (uint16_t)tmp16s; #if defined(DYNAREC) && !defined(TEST_INTERPRETER) - if(MODREG) - switch((nextop>>3)&7) { - case 0: EW->word[0] = add16(emu, EW->word[0], tmp16u); break; - case 1: EW->word[0] = or16(emu, EW->word[0], tmp16u); break; - case 2: EW->word[0] = adc16(emu, EW->word[0], tmp16u); break; - case 3: EW->word[0] = sbb16(emu, EW->word[0], tmp16u); break; - case 4: EW->word[0] = and16(emu, EW->word[0], tmp16u); break; - case 5: EW->word[0] = sub16(emu, EW->word[0], tmp16u); break; - case 6: EW->word[0] = xor16(emu, EW->word[0], tmp16u); break; - case 7: cmp16(emu, EW->word[0], tmp16u); break; - } - else - switch((nextop>>3)&7) { - case 0: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = add16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; - case 1: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = or16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; - case 2: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = adc16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; - case 3: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = sbb16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; - case 4: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = and16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; - case 5: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = sub16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; - case 6: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = xor16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; - case 7: cmp16(emu, EW->word[0], tmp16u); break; - } + switch((nextop>>3)&7) { + case 0: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = add16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; + case 1: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = or16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; + case 2: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = adc16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; + case 3: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = sbb16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; + case 4: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = and16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; + case 5: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = sub16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; + case 6: do { tmp16u2 = native_lock_read_h(EW); tmp16u2 = xor16(emu, tmp16u2, tmp16u);} while(native_lock_write_h(ED, tmp16u2)); break; + case 7: emu->error |= ERR_ILLEGAL; return 0; + } #else pthread_mutex_lock(&my_context->mutex_lock); switch((nextop>>3)&7) { @@ -215,19 +349,61 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr) case 4: EW->word[0] = and16(emu, EW->word[0], tmp16u); break; case 5: EW->word[0] = sub16(emu, EW->word[0], tmp16u); break; case 6: EW->word[0] = xor16(emu, EW->word[0], tmp16u); break; - case 7: cmp16(emu, EW->word[0], tmp16u); break; + case 7: emu->error |= ERR_ILLEGAL; return 0; } pthread_mutex_unlock(&my_context->mutex_lock); #endif break; + case 0xF7: /* GRP3 Ed(,Id) */ + nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } + GETEW((((nextop>>3)&7)<2)?2:0); + switch((nextop>>3)&7) { + case 2: /* NOT Ed */ +#if defined(DYNAREC) && !defined(TEST_INTERPRETER) + if(rex.w) + do { + tmp64u = native_lock_read_dd(ED); + tmp64u = not64(emu, tmp64u); + } while(native_lock_write_dd(ED, tmp64u)); + else { + do { + tmp16u = native_lock_read_h(ED); + tmp16u = not16(emu, tmp16u); + } while(native_lock_write_h(ED, tmp16u)); + } +#else + if(rex.w) { + pthread_mutex_lock(&my_context->mutex_lock); + ED->q[0] = not64(emu, ED->q[0]); + pthread_mutex_unlock(&my_context->mutex_lock); + } else { + pthread_mutex_lock(&my_context->mutex_lock); + ED->word[0] = not16(emu, ED->dword[0]); + pthread_mutex_unlock(&my_context->mutex_lock); + } +#endif + break; + default: + return 0; + } + break; + case 0xFF: /* GRP 5 Ed */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETEW(0); switch((nextop>>3)&7) { case 0: /* INC Ed */ #if defined(DYNAREC) && !defined(TEST_INTERPRETER) - if((uintptr_t)EW&1) { + if(((uintptr_t)EW)&1) { //meh. do { tmp16u = EW->word[0]; @@ -239,11 +415,13 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr) } else { do { tmp16u = native_lock_read_h(EW); - } while(native_lock_write_h(EW, inc16(emu, tmp16u))); + tmp16u = inc16(emu, tmp16u); + } while(native_lock_write_h(EW, tmp16u)); } -#else + #else pthread_mutex_lock(&my_context->mutex_lock); - EW->word[0] = inc16(emu, EW->word[0]); + tmp64u2 = EW->word[0]; + tmp16u = EW->word[0] = inc16(emu, EW->word[0]); pthread_mutex_unlock(&my_context->mutex_lock); #endif break; @@ -251,7 +429,8 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr) #if defined(DYNAREC) && !defined(TEST_INTERPRETER) do { tmp16u = native_lock_read_h(EW); - } while(native_lock_write_h(EW, dec16(emu, tmp16u))); + tmp16u = dec16(emu, tmp16u); + } while(native_lock_write_h(EW, tmp16u)); #else pthread_mutex_lock(&my_context->mutex_lock); ED->word[0] = dec16(emu, ED->word[0]); @@ -259,10 +438,8 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr) #endif break; default: - printf_log(LOG_NONE, "Illegal Opcode 0xF0 0xFF 0x%02X 0x%02X\n", nextop, PK(0)); - emu->quit=1; emu->error |= ERR_ILLEGAL; - break; + return 0; } break; default: diff --git a/src/emu/x64run66f20f.c b/src/emu/x64run66f20f.c index a4ad443..9546202 100644 --- a/src/emu/x64run66f20f.c +++ b/src/emu/x64run66f20f.c @@ -12,7 +12,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -25,9 +24,9 @@ #include "x64compstrings.h" #ifdef TEST_INTERPRETER -uintptr_t Test66F20F(x64test_t *test, rex_t rex, uintptr_t addr) +uintptr_t Test66F20F(x64test_t *test, rex_t rex, uintptr_t addr, int *step) #else -uintptr_t Run66F20F(x64emu_t *emu, rex_t rex, uintptr_t addr) +uintptr_t Run66F20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) #endif { uint8_t opcode; @@ -61,6 +60,7 @@ uintptr_t Run66F20F(x64emu_t *emu, rex_t rex, uintptr_t addr) switch(opcode) { case 0xF1: // CRC32 Gd, Ew + if (rex.w) return RunF20F(emu, rex, addr-2, step); nextop = F8; GETEW(0); GETGD; diff --git a/src/emu/x64run66f30f.c b/src/emu/x64run66f30f.c index dd466ad..f8dc5de 100644 --- a/src/emu/x64run66f30f.c +++ b/src/emu/x64run66f30f.c @@ -12,7 +12,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -56,6 +55,85 @@ uintptr_t Run66F30F(x64emu_t *emu, rex_t rex, uintptr_t addr) switch(opcode) { + case 0xB8: /* POPCNT Gw,Ew */ + nextop = F8; + GETEW(0); + GETGW; + if(rex.w) + GD->q[0] = __builtin_popcountl(ED->q[0]); + else + GD->word[0] = __builtin_popcount(ED->word[0]); + RESET_FLAGS(emu); + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_PF); + CONDITIONAL_SET_FLAG(GD->word[0]==0, F_ZF); + break; + + case 0xBC: /* TZCNT Ew,Gw */ + CHECK_FLAGS(emu); + nextop = F8; + GETEW(0); + GETGW; + if(rex.w) { + tmp64u = ED->q[0]; + if(tmp64u) { + tmp8u = 0; + while(!(tmp64u&(1LL<q[0] = tmp8u; + CONDITIONAL_SET_FLAG(tmp8u==0, F_ZF); + CLEAR_FLAG(F_CF); + } else { + CLEAR_FLAG(F_ZF); + SET_FLAG(F_CF); + GD->q[0] = 64; + } + } else { + tmp32u = ED->word[0]; + if(tmp32u) { + tmp8u = 0; + while(!(tmp32u&(1<word[0] = tmp8u; + CONDITIONAL_SET_FLAG(tmp8u==0, F_ZF); + CLEAR_FLAG(F_CF); + } else { + CLEAR_FLAG(F_ZF); + SET_FLAG(F_CF); + GD->word[0] = 16; + } + } + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_PF); + if(!BOX64ENV(cputype)) + CLEAR_FLAG(F_OF); + break; + case 0xBD: /* LZCNT Ew,Gw */ + CHECK_FLAGS(emu); + nextop = F8; + GETEW(0); + GETGW; + if(rex.w) { + tmp64u = ED->q[0]; + tmp8u = (tmp64u)?__builtin_clzl(tmp64u):64; + CONDITIONAL_SET_FLAG(tmp8u==0, F_ZF); + CONDITIONAL_SET_FLAG(tmp8u==64, F_CF); + GD->q[0] = tmp8u; + } else { + tmp32u = EW->word[0]; + tmp8u = (tmp32u)?__builtin_clz(tmp32u<<16):16; + CONDITIONAL_SET_FLAG(tmp8u==0, F_ZF); + CONDITIONAL_SET_FLAG(tmp8u==16, F_CF); + GD->word[0] = tmp8u; + } + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_PF); + if(!BOX64ENV(cputype)) + CLEAR_FLAG(F_OF); + break; default: return 0; diff --git a/src/emu/x64run67.c b/src/emu/x64run67.c deleted file mode 100644 index f808517..0000000 --- a/src/emu/x64run67.c +++ /dev/null @@ -1,552 +0,0 @@ -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "box64stack.h" -#include "x64emu.h" -#include "x64run.h" -#include "x64emu_private.h" -#include "x64run_private.h" -#include "x64primop.h" -#include "x64trace.h" -#include "x87emu_private.h" -#include "box64context.h" -#include "bridge.h" - -#include "modrm.h" - -#ifdef TEST_INTERPRETER -uintptr_t Test67(x64test_t *test, rex_t rex, int rep, uintptr_t addr) -#else -uintptr_t Run67(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) -#endif -{ - uint8_t opcode; - uint8_t nextop; - int8_t tmp8s; - uint8_t tmp8u; - uint32_t tmp32u; - int32_t tmp32s; - uint64_t tmp64u; - reg64_t *oped, *opgd; - #ifdef TEST_INTERPRETER - x64emu_t* emu = test->emu; - #endif - if(rex.is32bits) - #ifdef TEST_INTERPRETER - return Test67_32(test, rex, rep, addr); - #else - return Run67_32(emu, rex, rep, addr); - #endif - - opcode = F8; - - while(opcode==0x67) - opcode = F8; - - // REX prefix before the 67 are ignored - rex.rex = 0; - while(opcode>=0x40 && opcode<=0x4f) { - rex.rex = opcode; - opcode = F8; - } - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - switch(opcode) { - #define GO(B, OP) \ - case B+0: \ - nextop = F8; \ - GETEB32(0); \ - GETGB; \ - EB->byte[0] = OP##8(emu, EB->byte[0], GB); \ - break; \ - case B+1: \ - nextop = F8; \ - GETED32(0); \ - GETGD; \ - if(rex.w) \ - ED->q[0] = OP##64(emu, ED->q[0], GD->q[0]); \ - else { \ - if(MODREG) \ - ED->q[0] = OP##32(emu, ED->dword[0], GD->dword[0]); \ - else \ - ED->dword[0] = OP##32(emu, ED->dword[0], GD->dword[0]); \ - } \ - break; \ - case B+2: \ - nextop = F8; \ - GETEB32(0); \ - GETGB; \ - GB = OP##8(emu, GB, EB->byte[0]); \ - break; \ - case B+3: \ - nextop = F8; \ - GETED32(0); \ - GETGD; \ - if(rex.w) \ - GD->q[0] = OP##64(emu, GD->q[0], ED->q[0]); \ - else \ - GD->q[0] = OP##32(emu, GD->dword[0], ED->dword[0]); \ - break; \ - case B+4: \ - R_AL = OP##8(emu, R_AL, F8); \ - break; \ - case B+5: \ - if(rex.w) \ - R_RAX = OP##64(emu, R_RAX, F32S64); \ - else \ - R_RAX = OP##32(emu, R_EAX, F32); \ - break; - - GO(0x00, add) /* ADD 0x00 -> 0x05 */ - GO(0x08, or) /* OR 0x08 -> 0x0D */ - case 0x0F: - #ifdef TEST_INTERPRETER - return Test670F(test, rex, rep, addr); - #else - return Run670F(emu, rex, rep, addr); - #endif - GO(0x10, adc) /* ADC 0x10 -> 0x15 */ - GO(0x18, sbb) /* SBB 0x18 -> 0x1D */ - GO(0x20, and) /* AND 0x20 -> 0x25 */ - GO(0x28, sub) /* SUB 0x28 -> 0x2D */ - GO(0x30, xor) /* XOR 0x30 -> 0x35 */ - #undef GO - case 0x38: - nextop = F8; - GETEB32(0); - GETGB; - cmp8(emu, EB->byte[0], GB); - break; - case 0x39: - nextop = F8; - GETED32(0); - GETGD; - if(rex.w) - cmp64(emu, ED->q[0], GD->q[0]); - else - cmp32(emu, ED->dword[0], GD->dword[0]); - break; - case 0x3A: - nextop = F8; - GETEB32(0); - GETGB; - cmp8(emu, GB, EB->byte[0]); - break; - case 0x3B: - nextop = F8; - GETED32(0); - GETGD; - if(rex.w) - cmp64(emu, GD->q[0], ED->q[0]); - else - cmp32(emu, GD->dword[0], ED->dword[0]); - break; - case 0x3C: - R_AL = cmp8(emu, R_AL, F8); - break; - case 0x3D: - if(rex.w) - cmp64(emu, R_RAX, F32S64); - else - cmp32(emu, R_EAX, F32); - break; - - case 0x63: /* MOVSXD Gd,Ed */ - nextop = F8; - GETED32(0); - GETGD; - if(rex.w) - GD->sq[0] = ED->sdword[0]; - else - if(MODREG) - GD->q[0] = ED->dword[0]; // not really a sign extension - else - GD->sdword[0] = ED->sdword[0]; // meh? - break; - - case 0x66: - #ifdef TEST_INTERPRETER - return Test6766(test, rex, rep, addr); - #else - return Run6766(emu, rex, rep, addr); - #endif - - case 0x80: /* GRP Eb,Ib */ - nextop = F8; - GETEB32(1); - tmp8u = F8; - switch((nextop>>3)&7) { - case 0: EB->byte[0] = add8(emu, EB->byte[0], tmp8u); break; - case 1: EB->byte[0] = or8(emu, EB->byte[0], tmp8u); break; - case 2: EB->byte[0] = adc8(emu, EB->byte[0], tmp8u); break; - case 3: EB->byte[0] = sbb8(emu, EB->byte[0], tmp8u); break; - case 4: EB->byte[0] = and8(emu, EB->byte[0], tmp8u); break; - case 5: EB->byte[0] = sub8(emu, EB->byte[0], tmp8u); break; - case 6: EB->byte[0] = xor8(emu, EB->byte[0], tmp8u); break; - case 7: cmp8(emu, EB->byte[0], tmp8u); break; - } - break; - case 0x81: /* GRP Ed,Id */ - case 0x83: /* GRP Ed,Ib */ - nextop = F8; - GETED32((opcode==0x81)?4:1); - if(opcode==0x81) { - tmp32s = F32S; - } else { - tmp32s = F8S; - } - if(rex.w) { - tmp64u = (uint64_t)(int64_t)tmp32s; - switch((nextop>>3)&7) { - case 0: ED->q[0] = add64(emu, ED->q[0], tmp64u); break; - case 1: ED->q[0] = or64(emu, ED->q[0], tmp64u); break; - case 2: ED->q[0] = adc64(emu, ED->q[0], tmp64u); break; - case 3: ED->q[0] = sbb64(emu, ED->q[0], tmp64u); break; - case 4: ED->q[0] = and64(emu, ED->q[0], tmp64u); break; - case 5: ED->q[0] = sub64(emu, ED->q[0], tmp64u); break; - case 6: ED->q[0] = xor64(emu, ED->q[0], tmp64u); break; - case 7: cmp64(emu, ED->q[0], tmp64u); break; - } - } else { - tmp32u = (uint32_t)tmp32s; - if(MODREG) - switch((nextop>>3)&7) { - case 0: ED->q[0] = add32(emu, ED->dword[0], tmp32u); break; - case 1: ED->q[0] = or32(emu, ED->dword[0], tmp32u); break; - case 2: ED->q[0] = adc32(emu, ED->dword[0], tmp32u); break; - case 3: ED->q[0] = sbb32(emu, ED->dword[0], tmp32u); break; - case 4: ED->q[0] = and32(emu, ED->dword[0], tmp32u); break; - case 5: ED->q[0] = sub32(emu, ED->dword[0], tmp32u); break; - case 6: ED->q[0] = xor32(emu, ED->dword[0], tmp32u); break; - case 7: cmp32(emu, ED->dword[0], tmp32u); break; - } - else - switch((nextop>>3)&7) { - case 0: ED->dword[0] = add32(emu, ED->dword[0], tmp32u); break; - case 1: ED->dword[0] = or32(emu, ED->dword[0], tmp32u); break; - case 2: ED->dword[0] = adc32(emu, ED->dword[0], tmp32u); break; - case 3: ED->dword[0] = sbb32(emu, ED->dword[0], tmp32u); break; - case 4: ED->dword[0] = and32(emu, ED->dword[0], tmp32u); break; - case 5: ED->dword[0] = sub32(emu, ED->dword[0], tmp32u); break; - case 6: ED->dword[0] = xor32(emu, ED->dword[0], tmp32u); break; - case 7: cmp32(emu, ED->dword[0], tmp32u); break; - } - } - break; - - case 0x88: /* MOV Eb,Gb */ - nextop = F8; - GETEB32(0); - GETGB; - EB->byte[0] = GB; - break; - case 0x89: /* MOV Ed,Gd */ - nextop = F8; - GETED32(0); - GETGD; - if(rex.w) { - ED->q[0] = GD->q[0]; - } else { - //if ED is a reg, than the opcode works like movzx - if(MODREG) - ED->q[0] = GD->dword[0]; - else - ED->dword[0] = GD->dword[0]; - } - break; - case 0x8A: /* MOV Gb,Eb */ - nextop = F8; - GETEB32(0); - GETGB; - GB = EB->byte[0]; - break; - case 0x8B: /* MOV Gd,Ed */ - nextop = F8; - GETED32(0); - GETGD; - if(rex.w) - GD->q[0] = ED->q[0]; - else - GD->q[0] = ED->dword[0]; - break; - - case 0x8D: /* LEA Gd,M */ - nextop = F8; - _GETED32(0); - GETGD; - if(rex.w) - GD->q[0] = (uint64_t)ED; - else - GD->q[0] = ((uintptr_t)ED)&0xffffffff; - break; - - case 0xC1: /* GRP2 Ed,Ib */ - nextop = F8; - GETED32(1); - tmp8u = F8/* & 0x1f*/; // masking done in each functions - if(rex.w) { - switch((nextop>>3)&7) { - case 0: ED->q[0] = rol64(emu, ED->q[0], tmp8u); break; - case 1: ED->q[0] = ror64(emu, ED->q[0], tmp8u); break; - case 2: ED->q[0] = rcl64(emu, ED->q[0], tmp8u); break; - case 3: ED->q[0] = rcr64(emu, ED->q[0], tmp8u); break; - case 4: - case 6: ED->q[0] = shl64(emu, ED->q[0], tmp8u); break; - case 5: ED->q[0] = shr64(emu, ED->q[0], tmp8u); break; - case 7: ED->q[0] = sar64(emu, ED->q[0], tmp8u); break; - } - } else { - if(MODREG) - switch((nextop>>3)&7) { - case 0: ED->q[0] = rol32(emu, ED->dword[0], tmp8u); break; - case 1: ED->q[0] = ror32(emu, ED->dword[0], tmp8u); break; - case 2: ED->q[0] = rcl32(emu, ED->dword[0], tmp8u); break; - case 3: ED->q[0] = rcr32(emu, ED->dword[0], tmp8u); break; - case 4: - case 6: ED->q[0] = shl32(emu, ED->dword[0], tmp8u); break; - case 5: ED->q[0] = shr32(emu, ED->dword[0], tmp8u); break; - case 7: ED->q[0] = sar32(emu, ED->dword[0], tmp8u); break; - } - else - switch((nextop>>3)&7) { - case 0: ED->dword[0] = rol32(emu, ED->dword[0], tmp8u); break; - case 1: ED->dword[0] = ror32(emu, ED->dword[0], tmp8u); break; - case 2: ED->dword[0] = rcl32(emu, ED->dword[0], tmp8u); break; - case 3: ED->dword[0] = rcr32(emu, ED->dword[0], tmp8u); break; - case 4: - case 6: ED->dword[0] = shl32(emu, ED->dword[0], tmp8u); break; - case 5: ED->dword[0] = shr32(emu, ED->dword[0], tmp8u); break; - case 7: ED->dword[0] = sar32(emu, ED->dword[0], tmp8u); break; - } - } - break; - - case 0xC4: /* LES Gd,Ed */ - nextop = F8; - if(rex.is32bits && !(MODREG)) { - return 0; - } else { - if(rex.is32bits) { - return 0; - } - vex_t vex = {0}; - vex.rex = rex; - tmp8u = nextop; - vex.m = tmp8u&0b00011111; - vex.rex.b = (tmp8u&0b00100000)?0:1; - vex.rex.x = (tmp8u&0b01000000)?0:1; - vex.rex.r = (tmp8u&0b10000000)?0:1; - tmp8u = F8; - vex.p = tmp8u&0b00000011; - vex.l = (tmp8u>>2)&1; - vex.v = ((~tmp8u)>>3)&0b1111; - vex.rex.w = (tmp8u>>7)&1; - #ifdef TEST_INTERPRETER - addr = Test67AVX(test, vex, addr); - #else - addr = Run67AVX(emu, vex, addr); - #endif - } - break; - case 0xC5: /* LDS Gd,Ed */ - nextop = F8; - if(rex.is32bits && !(MODREG)) { - return 0; - } else { - if(rex.is32bits) { - return 0; - } - vex_t vex = {0}; - vex.rex = rex; - tmp8u = nextop; - vex.p = tmp8u&0b00000011; - vex.l = (tmp8u>>2)&1; - vex.v = ((~tmp8u)>>3)&0b1111; - vex.rex.r = (tmp8u&0b10000000)?0:1; - vex.rex.b = 0; - vex.rex.x = 0; - vex.rex.w = 0; - vex.m = VEX_M_0F; - #ifdef TEST_INTERPRETER - addr = Test67AVX(test, vex, addr); - #else - addr = Run67AVX(emu, vex, addr); - #endif - } - break; - case 0xC6: /* MOV Eb,Ib */ - nextop = F8; - GETEB32(1); - EB->byte[0] = F8; - break; - case 0xC7: /* MOV Ed,Id */ - nextop = F8; - GETED32(4); - if(rex.w) - ED->q[0] = F32S64; - else - if(MODREG) - ED->q[0] = F32; - else - ED->dword[0] = F32; - break; - - case 0xE0: /* LOOPNZ */ - CHECK_FLAGS(emu); - tmp8s = F8S; - --R_ECX; // don't update flags - if(R_ECX && !ACCESS_FLAG(F_ZF)) - addr += tmp8s; - break; - case 0xE1: /* LOOPZ */ - CHECK_FLAGS(emu); - tmp8s = F8S; - --R_ECX; // don't update flags - if(R_ECX && ACCESS_FLAG(F_ZF)) - addr += tmp8s; - break; - case 0xE2: /* LOOP */ - tmp8s = F8S; - --R_ECX; // don't update flags - if(R_ECX) - addr += tmp8s; - break; - case 0xE3: /* JECXZ Ib */ - tmp8s = F8S; - if(!R_ECX) - addr += tmp8s; - break; - - case 0xE8: /* CALL Id */ - tmp32s = F32S; // call is relative - Push64(emu, addr); - addr += tmp32s; - break; - - case 0xF7: /* GRP3 Ed(,Id) */ - nextop = F8; - tmp8u = (nextop>>3)&7; - GETED32((tmp8u<2)?4:0); - if(rex.w) { - switch(tmp8u) { - case 0: - case 1: /* TEST Ed,Id */ - tmp64u = F32S64; - test64(emu, ED->q[0], tmp64u); - break; - case 2: /* NOT Ed */ - ED->q[0] = not64(emu, ED->q[0]); - break; - case 3: /* NEG Ed */ - ED->q[0] = neg64(emu, ED->q[0]); - break; - case 4: /* MUL RAX,Ed */ - mul64_rax(emu, ED->q[0]); - break; - case 5: /* IMUL RAX,Ed */ - imul64_rax(emu, ED->q[0]); - break; - case 6: /* DIV Ed */ - div64(emu, ED->q[0]); - break; - case 7: /* IDIV Ed */ - idiv64(emu, ED->q[0]); - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif - break; - } - } else { - switch(tmp8u) { - case 0: - case 1: /* TEST Ed,Id */ - tmp32u = F32; - test32(emu, ED->dword[0], tmp32u); - break; - case 2: /* NOT Ed */ - if(MODREG) - ED->q[0] = not32(emu, ED->dword[0]); - else - ED->dword[0] = not32(emu, ED->dword[0]); - break; - case 3: /* NEG Ed */ - if(MODREG) - ED->q[0] = neg32(emu, ED->dword[0]); - else - ED->dword[0] = neg32(emu, ED->dword[0]); - break; - case 4: /* MUL EAX,Ed */ - mul32_eax(emu, ED->dword[0]); - emu->regs[_AX].dword[1] = 0; - emu->regs[_DX].dword[1] = 0; - break; - case 5: /* IMUL EAX,Ed */ - imul32_eax(emu, ED->dword[0]); - emu->regs[_AX].dword[1] = 0; - emu->regs[_DX].dword[1] = 0; - break; - case 6: /* DIV Ed */ - div32(emu, ED->dword[0]); - //emu->regs[_AX].dword[1] = 0; - //emu->regs[_DX].dword[1] = 0; - break; - case 7: /* IDIV Ed */ - idiv32(emu, ED->dword[0]); - //emu->regs[_AX].dword[1] = 0; - //emu->regs[_DX].dword[1] = 0; - break; - } - } - break; - - case 0xFF: - nextop = F8; - switch((nextop>>3)&7) { - case 0: /* INC Ed */ - GETED32(0); - if(rex.w) - ED->q[0] = inc64(emu, ED->q[0]); - else { - if(MODREG) - ED->q[0] = inc32(emu, ED->dword[0]); - else - ED->dword[0] = inc32(emu, ED->dword[0]); - } - break; - case 1: /* DEC Ed */ - GETED32(0); - if(rex.w) - ED->q[0] = dec64(emu, ED->q[0]); - else { - if(MODREG) - ED->q[0] = dec32(emu, ED->dword[0]); - else - ED->dword[0] = dec32(emu, ED->dword[0]); - } - break; - case 2: /* CALL NEAR Ed */ - GETED32(0); - tmp64u = (uintptr_t)getAlternate((void*)ED->q[0]); - Push64(emu, addr); - addr = tmp64u; - break; - default: - return 0; - } - break; - default: - return 0; - } - return addr; -} \ No newline at end of file diff --git a/src/emu/x64run670f.c b/src/emu/x64run670f.c deleted file mode 100644 index 0b3f149..0000000 --- a/src/emu/x64run670f.c +++ /dev/null @@ -1,165 +0,0 @@ -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "box64stack.h" -#include "x64emu.h" -#include "x64run.h" -#include "x64emu_private.h" -#include "x64run_private.h" -#include "x64primop.h" -#include "x64trace.h" -#include "x87emu_private.h" -#include "box64context.h" -#include "bridge.h" -#include "signals.h" -#ifdef DYNAREC -#include "../dynarec/native_lock.h" -#endif - -#include "modrm.h" -#include "x64compstrings.h" - -#ifdef TEST_INTERPRETER -uintptr_t Test670F(x64test_t *test, rex_t rex, int rep, uintptr_t addr) -#else -uintptr_t Run670F(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) -#endif -{ - (void)rep; - uint8_t opcode; - uint8_t nextop; - uint8_t tmp8u; (void)tmp8u; - int8_t tmp8s; (void)tmp8s; - int32_t tmp32s, tmp32s2; (void)tmp32s; (void)tmp32s2; - uint32_t tmp32u, tmp32u2; (void)tmp32u; (void)tmp32u2; - uint64_t tmp64u, tmp64u2; (void)tmp64u; (void)tmp64u2; - reg64_t *oped, *opgd; (void)oped; (void)opgd; - sse_regs_t *opex, *opgx, eax1; (void)eax1; - mmx87_regs_t *opem, *opgm, eam1; (void)opem; (void)opgm; (void)eam1; - - #ifdef TEST_INTERPRETER - x64emu_t* emu = test->emu; - #endif - opcode = F8; - - switch(opcode) { - - case 0x11: - switch(rep) { - case 0: /* MOVUPS Ex,Gx */ - nextop = F8; - GETEX32(0); - GETGX; - EX->u128 = GX->u128; - break; - default: - return 0; - } - break; - - case 0x29: /* MOVAPS Ex,Gx */ - nextop = F8; - GETEX32(0); - GETGX; - EX->q[0] = GX->q[0]; - EX->q[1] = GX->q[1]; - break; - - case 0x2E: - // same for now - case 0x2F: - switch(rep) { - case 0: /* (U)COMISS Gx, Ex */ - RESET_FLAGS(emu); - nextop = F8; - GETEX32(0); - GETGX; - if(isnan(GX->f[0]) || isnan(EX->f[0])) { - SET_FLAG(F_ZF); SET_FLAG(F_PF); SET_FLAG(F_CF); - } else if(isgreater(GX->f[0], EX->f[0])) { - CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_PF); CLEAR_FLAG(F_CF); - } else if(isless(GX->f[0], EX->f[0])) { - CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_PF); SET_FLAG(F_CF); - } else { - SET_FLAG(F_ZF); CLEAR_FLAG(F_PF); CLEAR_FLAG(F_CF); - } - CLEAR_FLAG(F_OF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_SF); - break; - default: - return 0; - } - break; - - case 0x6F: - switch(rep) { - case 0: /* MOVQ Gm, Em */ - nextop = F8; - GETEM32(0); - GETGM; - GM->q = EM->q; - break; - case 2: /* MOVDQU Gx, Ex */ - nextop = F8; - GETEX32(0); - GETGX; - memcpy(GX, EX, 16); // unaligned... - break; - default: - return 0; - } - break; - - case 0x7F: - switch(rep) { - case 0: /* MOVQ Em, Gm */ - nextop = F8; - GETEM32(0); - GETGM; - EM->q = GM->q; - break; - default: - return 0; - } - break; - - case 0xB6: /* MOVZX Gd,Eb */ - nextop = F8; - GETEB32(0); - GETGD; - GD->q[0] = EB->byte[0]; - break; - - case 0xB9: - switch(rep) { - case 0: /* UD1 Ed */ - nextop = F8; - FAKEED32(0); - #ifndef TEST_INTERPRETER - emit_signal(emu, SIGILL, (void*)R_RIP, 0); - #endif - break; - default: - return 0; - } - break; - - case 0xB7: /* MOVZX Gd,Ew */ - nextop = F8; - GETEW32(0); - GETGD; - GD->q[0] = EW->word[0]; - break; - - default: - return 0; - } - return addr; -} diff --git a/src/emu/x64run6764_32.c b/src/emu/x64run6764_32.c deleted file mode 100644 index c17481c..0000000 --- a/src/emu/x64run6764_32.c +++ /dev/null @@ -1,116 +0,0 @@ -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "box64stack.h" -#include "x64emu.h" -#include "x64run.h" -#include "x64emu_private.h" -#include "x64run_private.h" -#include "x64primop.h" -#include "x64trace.h" -#include "x87emu_private.h" -#include "box64context.h" -#include "bridge.h" - -#include "modrm.h" - -#ifdef TEST_INTERPRETER -uintptr_t Test6764_32(x64test_t *test, rex_t rex, int rep, int seg, uintptr_t addr) -#else -uintptr_t Run6764_32(x64emu_t *emu, rex_t rex, int rep, int seg, uintptr_t addr) -#endif -{ - (void)rep; - uint8_t opcode; - uint8_t nextop; - int8_t tmp8s; - uint8_t tmp8u; - uint32_t tmp32u; - int32_t tmp32s; - uint64_t tmp64u; - reg64_t *oped, *opgd; - #ifdef TEST_INTERPRETER - x64emu_t* emu = test->emu; - #endif - uintptr_t tlsdata = GetSegmentBaseEmu(emu, seg); - opcode = F8; - - while(opcode==0x67) - opcode = F8; - - rex.rex = 0; - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - switch(opcode) { - - case 0x89: /* MOV FS:Ed, Gd */ - nextop = F8; - GETED_OFFS_16(tlsdata); - GETGD; - ED->dword[0] = GD->dword[0]; - break; - - case 0x8B: /* MOV Gd, FS:Ed */ - nextop = F8; - GETED_OFFS_16(tlsdata); - GETGD; - GD->dword[0] = ED->dword[0]; - break; - - case 0x8F: /* POP FS:Ed */ - nextop = F8; - GETED_OFFS_16(tlsdata); - ED->dword[0] = Pop32(emu); - break; - - case 0xA1: /* MOV EAX, FS:Od */ - tmp32u = F16; - #ifdef TEST_INTERPRETER - test->memaddr = tlsdata + tmp32u; - test->memsize = 4; - R_EAX = *(uint32_t*)(test->mem); - #else - R_EAX = *(uint32_t*)(tlsdata + tmp32u); - #endif - break; - - case 0xA3: /* MOV FS:Od,EAX */ - tmp32u = F16; - #ifdef TEST_INTERPRETER - test->memaddr = tlsdata + tmp32u; - test->memsize = 4; - *(uint32_t*)(test->mem) = R_EAX; - #else - *(uint32_t*)(tlsdata + tmp32u) = R_EAX; - #endif - break; - - case 0xFF: - nextop = F8; - GETEW_OFFS_16(tlsdata); - switch((nextop>>3)&7) { - case 6: // Push Ed - tmp32u = ED->dword[0]; - Push32(emu, tmp32u); - break; - default: - return 0; - } - break; - - default: - return 0; - } - return addr; -} diff --git a/src/emu/x64run6766.c b/src/emu/x64run6766.c deleted file mode 100644 index 080abf9..0000000 --- a/src/emu/x64run6766.c +++ /dev/null @@ -1,122 +0,0 @@ -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "box64stack.h" -#include "x64emu.h" -#include "x64run.h" -#include "x64emu_private.h" -#include "x64run_private.h" -#include "x64primop.h" -#include "x64trace.h" -#include "x87emu_private.h" -#include "box64context.h" -#include "bridge.h" -#ifdef DYNAREC -#include "../dynarec/native_lock.h" -#endif - -#include "modrm.h" - -#ifdef TEST_INTERPRETER -uintptr_t Test6766(x64test_t *test, rex_t rex, int rep, uintptr_t addr) -#else -uintptr_t Run6766(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) -#endif -{ - // Hmmmm.... - (void)rep; - uint8_t opcode; - uint8_t nextop; (void)nextop; - int8_t tmp8s; (void)tmp8s; - uint8_t tmp8u, tmp8u2; (void)tmp8u; (void)tmp8u2; - int16_t tmp16s; (void)tmp16s; - uint16_t tmp16u, tmp16u2; (void)tmp16u; (void)tmp16u2; - int32_t tmp32s; (void)tmp32s; - int64_t tmp64s; (void)tmp64s; - uint64_t tmp64u, tmp64u2, tmp64u3; (void)tmp64u; (void)tmp64u2; (void)tmp64u3; - reg64_t *oped, *opgd; (void)oped; (void)opgd; - #ifdef TEST_INTERPRETER - x64emu_t* emu = test->emu; - #endif - opcode = F8; - - while((opcode==0x2E) || (opcode==0x66)) // ignoring CS: or multiple 0x66 - opcode = F8; - - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - // REX prefix before the 66 are ignored - rex.rex = 0; - if(!rex.is32bits) - while(opcode>=0x40 && opcode<=0x4f) { - rex.rex = opcode; - opcode = F8; - } - - switch(opcode) { - - case 0x0F: /* more opcodes */ - #ifdef TEST_INTERPRETER - return Test67660F(test, rex, addr); - #else - return Run67660F(emu, rex, addr); - #endif - - case 0x81: /* GRP3 Ew,Iw */ - case 0x83: /* GRP3 Ew,Ib */ - nextop = F8; - GETEW32((opcode==0x81)?2:1); - GETGW; - if(opcode==0x81) - tmp16u = F16; - else { - tmp16s = F8S; - tmp16u = (uint16_t)tmp16s; - } - switch((nextop>>3)&7) { - case 0: EW->word[0] = add16(emu, EW->word[0], tmp16u); break; - case 1: EW->word[0] = or16(emu, EW->word[0], tmp16u); break; - case 2: EW->word[0] = adc16(emu, EW->word[0], tmp16u); break; - case 3: EW->word[0] = sbb16(emu, EW->word[0], tmp16u); break; - case 4: EW->word[0] = and16(emu, EW->word[0], tmp16u); break; - case 5: EW->word[0] = sub16(emu, EW->word[0], tmp16u); break; - case 6: EW->word[0] = xor16(emu, EW->word[0], tmp16u); break; - case 7: cmp16(emu, EW->word[0], tmp16u); break; - } - break; - - case 0x89: /* MOV Ew,Gw */ - nextop = F8; - GETEW32(0); - GETGW; - if(rex.w) - EW->q[0] = GW->q[0]; - else - EW->word[0] = GW->word[0]; - break; - - case 0x8D: /* LEA Gw,M */ - nextop = F8; - GETGW; - tmp64u = GETEA32(0); - if(rex.w) - GW->q[0] = tmp64u; - else - GW->word[0] = (uint16_t)tmp64u; - break; - - default: - return 0; - } - return addr; -} diff --git a/src/emu/x64run67660f.c b/src/emu/x64run67660f.c deleted file mode 100644 index a58df7c..0000000 --- a/src/emu/x64run67660f.c +++ /dev/null @@ -1,93 +0,0 @@ -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "box64stack.h" -#include "x64emu.h" -#include "x64run.h" -#include "x64emu_private.h" -#include "x64run_private.h" -#include "x64primop.h" -#include "x64trace.h" -#include "x87emu_private.h" -#include "box64context.h" -#include "bridge.h" - -#include "modrm.h" - -#ifdef TEST_INTERPRETER -uintptr_t Test67660F(x64test_t *test, rex_t rex, uintptr_t addr) -#else -uintptr_t Run67660F(x64emu_t *emu, rex_t rex, uintptr_t addr) -#endif -{ - uint8_t opcode; - uint8_t nextop; - int8_t tmp8s; (void)tmp8s; - uint8_t tmp8u; (void)tmp8u; - int16_t tmp16s; (void)tmp16s; - uint16_t tmp16u; (void)tmp16u; - int32_t tmp32s; (void)tmp32s; - uint32_t tmp32u; (void)tmp32u; - int64_t tmp64s; (void)tmp64s; - uint64_t tmp64u; (void)tmp64u; - reg64_t *oped, *opgd; (void)oped; (void)opgd; - sse_regs_t *opex, *opgx; - #ifdef TEST_INTERPRETER - x64emu_t* emu = test->emu; - #endif - opcode = F8; - - switch(opcode) { - - case 0x6F: /* MOVDQA Gx,Ex */ - nextop = F8; - GETEX32(0); - GETGX; - GX->q[0] = EX->q[0]; - GX->q[1] = EX->q[1]; - break; - - case 0x76: /* PCMPEQD Gx,Ex */ - nextop = F8; - GETEX32(0); - GETGX; - for (int i=0; i<4; ++i) - GX->ud[i] = (GX->ud[i]==EX->ud[i])?0xffffffff:0; - break; - - case 0x7E: /* MOVD Ed, Gx */ - nextop = F8; - GETED32(0); - GETGX; - if(rex.w) - ED->q[0] = GX->q[0]; - else { - if(MODREG) - ED->q[0] = GX->ud[0]; - else - ED->dword[0] = GX->ud[0]; - } - break; - - case 0xD6: /* MOVQ Ex,Gx */ - nextop = F8; - GETEX32(0); - GETGX; - EX->q[0] = GX->q[0]; - if(MODREG) - EX->q[1] = 0; - break; - - default: - return 0; - } - return addr; -} diff --git a/src/emu/x64run67_32.c b/src/emu/x64run67_32.c deleted file mode 100644 index a1df3ba..0000000 --- a/src/emu/x64run67_32.c +++ /dev/null @@ -1,100 +0,0 @@ -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "box64stack.h" -#include "x64emu.h" -#include "x64run.h" -#include "x64emu_private.h" -#include "x64run_private.h" -#include "x64primop.h" -#include "x64trace.h" -#include "x87emu_private.h" -#include "box64context.h" -#include "bridge.h" - -#include "modrm.h" - -#ifdef TEST_INTERPRETER -uintptr_t Test67_32(x64test_t *test, rex_t rex, int rep, uintptr_t addr) -#else -uintptr_t Run67_32(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr) -#endif -{ - uint8_t opcode; - uint8_t nextop; - int8_t tmp8s; - uint8_t tmp8u; - uint32_t tmp32u; - int32_t tmp32s; - uint64_t tmp64u; - reg64_t *oped, *opgd; - #ifdef TEST_INTERPRETER - x64emu_t* emu = test->emu; - #endif - opcode = F8; - - while(opcode==0x67) - opcode = F8; - - rex.rex = 0; - while((opcode==0xF2) || (opcode==0xF3)) { - rep = opcode-0xF1; - opcode = F8; - } - - switch(opcode) { - - case 0x64: /* FS: prefix */ - #ifdef TEST_INTERPRETER - return Test6764_32(test, rex, rep, _FS, addr); - #else - return Run6764_32(emu, rex, rep, _FS, addr); - #endif - break; - case 0x65: /* GS: prefix */ - #ifdef TEST_INTERPRETER - return Test6764_32(test, rex, rep, _GS, addr); - #else - return Run6764_32(emu, rex, rep, _GS, addr); - #endif - break; - - case 0xE0: /* LOOPNZ */ - CHECK_FLAGS(emu); - tmp8s = F8S; - --R_CX; // don't update flags - if(R_CX && !ACCESS_FLAG(F_ZF)) - addr += tmp8s; - break; - case 0xE1: /* LOOPZ */ - CHECK_FLAGS(emu); - tmp8s = F8S; - --R_CX; // don't update flags - if(R_CX && ACCESS_FLAG(F_ZF)) - addr += tmp8s; - break; - case 0xE2: /* LOOP */ - tmp8s = F8S; - --R_CX; // don't update flags - if(R_CX) - addr += tmp8s; - break; - case 0xE3: /* JECXZ Ib */ - tmp8s = F8S; - if(!R_CX) - addr += tmp8s; - break; - - default: - return 0; - } - return addr; -} \ No newline at end of file diff --git a/src/emu/x64run67avx.c b/src/emu/x64run67avx.c deleted file mode 100644 index c19a22f..0000000 --- a/src/emu/x64run67avx.c +++ /dev/null @@ -1,106 +0,0 @@ -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "box64stack.h" -#include "x64emu.h" -#include "x64run.h" -#include "x64emu_private.h" -#include "x64run_private.h" -#include "x64primop.h" -#include "x64trace.h" -#include "x87emu_private.h" -#include "box64context.h" -#include "my_cpuid.h" -#include "bridge.h" -#include "signals.h" -#include "x64shaext.h" -#ifdef DYNAREC -#include "custommem.h" -#include "../dynarec/native_lock.h" -#endif - -#include "modrm.h" - -static const char* avx_prefix_string(uint16_t p) -{ - switch(p) { - case VEX_P_NONE: return "0"; - case VEX_P_66: return "66"; - case VEX_P_F2: return "F2"; - case VEX_P_F3: return "F3"; - default: return "??"; - } -} -static const char* avx_map_string(uint16_t m) -{ - switch(m) { - case VEX_M_NONE: return "0"; - case VEX_M_0F: return "0F"; - case VEX_M_0F38: return "0F38"; - case VEX_M_0F3A: return "0F3A"; - default: return "??"; - } -} - -#ifdef TEST_INTERPRETER -uintptr_t Test67AVX(x64test_t *test, vex_t vex, uintptr_t addr) -#else -uintptr_t Run67AVX(x64emu_t *emu, vex_t vex, uintptr_t addr) -#endif -{ - uint8_t opcode; - uint8_t nextop; - uint8_t tmp8u; - int8_t tmp8s; - int32_t tmp32s, tmp32s2; - uint32_t tmp32u, tmp32u2; - uint64_t tmp64u, tmp64u2; - int64_t tmp64s; - reg64_t *oped, *opgd, *opvd; - sse_regs_t *opex, *opgx, *opvx, eax1; - sse_regs_t *opey, *opgy, *opvy, eay1; - -#ifdef TEST_INTERPRETER - x64emu_t *emu = test->emu; -#endif - opcode = F8; - - rex_t rex = vex.rex; - - if( (vex.m==VEX_M_0F38) && (vex.p==VEX_P_F2)) - switch(opcode) { - - case 0xF6: /* MULX Gd, Vd, Ed (,RDX) */ - nextop = F8; - GETED32(0); - GETGD; - GETVD; - if(rex.w) { - unsigned __int128 res = (unsigned __int128)R_RDX * ED->q[0]; - VD->q[0] = res&0xFFFFFFFFFFFFFFFFLL; - GD->q[0] = res>>64; - } else { - tmp64u = (uint64_t)R_EDX * ED->dword[0]; - VD->q[0] = tmp64u&0xFFFFFFFF; - GD->q[0] = tmp64u>>32; - } - break; - - default: addr = 0; - } - else addr = 0; - - if(!addr) - printf_log(LOG_INFO, "Unimplemented 67 AVX opcode size %d prefix %s map %s opcode %02X ", 128< +#define _GNU_SOURCE /* See feature_test_macros(7) */ #include #include #include @@ -9,1135 +8,30 @@ #include #endif +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" -#include "x64run_private.h" +#include "box64cpu.h" +#include "box64cpu_util.h" #include "x64emu_private.h" +#include "x64run_private.h" #include "box64context.h" -#include "x64run.h" #include "librarian.h" -#include "elfloader.h" +#include "symbolfuncs.h" #ifdef HAVE_TRACE #include "x64trace.h" #endif #include "x64tls.h" #include "bridge.h" - -#define PARITY(x) (((emu->x64emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0) -#define XOR2(x) (((x) ^ ((x)>>1)) & 0x1) - -#ifdef ANDROID -void EXPORT my___libc_init(x64emu_t* emu, void* raw_args , void (*onexit)(void) , int (*main)(int, char**, char**), void const * const structors ) -{ - //TODO: register fini - // let's cheat and set all args... - SetRDX(emu, (uintptr_t)my_context->envv); - SetRSI(emu, (uintptr_t)my_context->argv); - SetRDI(emu, (uintptr_t)my_context->argc); - - printf_log(LOG_DEBUG, "Transfert to main(%d, %p, %p)=>%p from __libc_init\n", my_context->argc, my_context->argv, my_context->envv, main); - // should call structors->preinit_array and structors->init_array! - // call main and finish - Push64(emu, GetRBP(emu)); // set frame pointer - SetRBP(emu, GetRSP(emu)); // save RSP - SetRSP(emu, GetRSP(emu)&~0xFLL); // Align RSP - PushExit(emu); - R_RIP=(uintptr_t)main; - - DynaRun(emu); - - SetRSP(emu, GetRBP(emu)); // restore RSP - SetRBP(emu, Pop64(emu)); // restore RBP - emu->quit = 1; // finished! -} +#ifdef BOX32 +#include "box32.h" #else -int32_t EXPORT my___libc_start_main(x64emu_t* emu, int (*main) (int, char * *, char * *), int argc, char * * ubp_av, void (*init) (void), void (*fini) (void), void (*rtld_fini) (void), void (* stack_end)) -{ - (void)argc; (void)ubp_av; (void)fini; (void)rtld_fini; (void)stack_end; - - if(init) { - uintptr_t old_rsp = GetRSP(emu); - uintptr_t old_rbp = GetRBP(emu); // should not be needed, but seems to be without dynarec - Push64(emu, GetRBP(emu)); // set frame pointer - SetRBP(emu, GetRSP(emu)); // save RSP - SetRSP(emu, GetRSP(emu)&~0xFLL); // Align RSP - PushExit(emu); - SetRDX(emu, (uint64_t)my_context->envv); - SetRSI(emu, (uint64_t)my_context->argv); - SetRDI(emu, (uint64_t)my_context->argc); - R_RIP=(uint64_t)*init; - printf_dump(LOG_DEBUG, "Calling init(%p) from __libc_start_main\n", *init); - DynaRun(emu); - if(emu->error) // any error, don't bother with more - return 0; - SetRSP(emu, GetRBP(emu)); // restore RSP - SetRBP(emu, Pop64(emu)); // restore RBP - SetRSP(emu, old_rsp); - SetRBP(emu, old_rbp); - emu->quit = 0; - } else { - if(my_context->elfs[0]) { - printf_dump(LOG_DEBUG, "Calling init from main elf\n"); - RunElfInit(my_context->elfs[0], emu); - } - } - if(my_context->elfs[0]) { - MarkElfInitDone(my_context->elfs[0]); - } - printf_log(LOG_DEBUG, "Transfert to main(%d, %p, %p)=>%p from __libc_start_main\n", my_context->argc, my_context->argv, my_context->envv, main); - // call main and finish - Push64(emu, GetRBP(emu)); // set frame pointer - SetRBP(emu, GetRSP(emu)); // save RSP - SetRSP(emu, GetRSP(emu)&~0xFLL); // Align RSP - PushExit(emu); - SetRDX(emu, (uint64_t)my_context->envv); - SetRSI(emu, (uint64_t)my_context->argv); - SetRDI(emu, (uint64_t)my_context->argc); - R_RIP=(uint64_t)main; - - DynaRun(emu); - - if(!emu->quit) { - SetRSP(emu, GetRBP(emu)); // restore RSP - SetRBP(emu, Pop64(emu)); // restore RBP - emu->quit = 1; // finished! - } - return (int)GetEAX(emu); -} +#define from_ptrv(A) ((void*)(uintptr_t)(A)) #endif -const char* GetNativeName(void* p) -{ - static char buff[500] = {0}; - { - const char* n = getBridgeName(p); - if(n) - return n; - } - Dl_info info; - if(dladdr(p, &info)==0) { - const char *ret = GetNameOffset(my_context->maplib, p); - if(ret) - return ret; - sprintf(buff, "%s(%p)", "???", p); - return buff; - } else { - if(info.dli_sname) { - strcpy(buff, info.dli_sname); - if(info.dli_fname) { - strcat(buff, "("); strcat(buff, info.dli_fname); strcat(buff, ")"); - } - } else { - sprintf(buff, "%s(%s+%p)", "???", info.dli_fname, (void*)(p-info.dli_fbase)); - return buff; - } - } - return buff; -} -void UpdateFlags(x64emu_t *emu) -{ - uint64_t cc; - uint64_t lo, hi; - uint64_t bc; - uint64_t cnt; - - switch(emu->df) { - case d_none: - return; - case d_add8: - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x100, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u16 & 0xff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x80, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - - cc = (emu->op1.u8 & emu->op2.u8) | ((~emu->res.u8) & (emu->op1.u8 | emu->op2.u8)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_add16: - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x10000, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u32 & 0xffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - cc = (emu->op1.u16 & emu->op2.u16) | ((~emu->res.u16) & (emu->op1.u16 | emu->op2.u16)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_add32: - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x100000000LL, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u64 & 0xffffffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - cc = (emu->op1.u32 & emu->op2.u32) | ((~emu->res.u32) & (emu->op1.u32 | emu->op2.u32)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_add32b: - lo = (emu->op2.u32 & 0xFFFF) + (emu->op1.u32 & 0xFFFF); - hi = (lo >> 16) + (emu->op2.u32 >> 16) + (emu->op1.u32 >> 16); - CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - cc = (emu->op1.u32 & emu->op2.u32) | ((~emu->res.u32) & (emu->op1.u32 | emu->op2.u32)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_add64: - lo = (emu->op2.u64 & 0xFFFFFFFF) + (emu->op1.u64 & 0xFFFFFFFF); - hi = (lo >> 32) + (emu->op2.u64 >> 32) + (emu->op1.u64 >> 32); - CONDITIONAL_SET_FLAG(hi & 0x100000000L, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - cc = (emu->op1.u64 & emu->op2.u64) | ((~emu->res.u64) & (emu->op1.u64 | emu->op2.u64)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 62), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_and8: - CLEAR_FLAG(F_OF); - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u8 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - break; - case d_and16: - CLEAR_FLAG(F_OF); - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u16 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - break; - case d_and32: - CLEAR_FLAG(F_OF); - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u32 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - break; - case d_and64: - CLEAR_FLAG(F_OF); - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u64 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - break; - case d_dec8: - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG((emu->res.u8) == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - bc = (emu->res.u8 & (~emu->op1.u8 | 1)) | (~emu->op1.u8 & 1); - CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_dec16: - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG((emu->res.u16) == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - bc = (emu->res.u16 & (~emu->op1.u16 | 1)) | (~emu->op1.u16 & 1); - CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_dec32: - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - bc = (emu->res.u32 & (~emu->op1.u32 | 1)) | (~emu->op1.u32 & 1); - CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_dec64: - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - bc = (emu->res.u64 & (~emu->op1.u64 | 1)) | (~emu->op1.u64 & 1); - CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_inc8: - CONDITIONAL_SET_FLAG((emu->res.u8 & 0xff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - cc = ((1 & emu->op1.u8) | (~emu->res.u8)) & (1 | emu->op1.u8); - CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_inc16: - CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - cc = (1 & emu->op1.u16) | ((~emu->res.u16) & (1 | emu->op1.u16)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_inc32: - CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - cc = (1 & emu->op1.u32) | ((~emu->res.u32) & (1 | emu->op1.u32)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_inc64: - CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - cc = (1 & emu->op1.u64) | ((~emu->res.u64) & (1 | emu->op1.u64)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 62), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_imul8: - lo = emu->res.u16 & 0xff; - hi = (emu->res.u16>>8)&0xff; - if (((lo & 0x80) == 0 && hi == 0x00) || - ((lo & 0x80) != 0 && hi == 0xFF)) { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } else { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } - if(box64_dynarec_test) { - // to avoid noise in tests - CLEAR_FLAG(F_SF); - CLEAR_FLAG(F_ZF); - CLEAR_FLAG(F_AF); - CLEAR_FLAG(F_PF); - } - break; - case d_imul16: - lo = (uint16_t)emu->res.u32; - hi = (uint16_t)(emu->res.u32 >> 16); - if (((lo & 0x8000) == 0 && hi == 0x00) || - ((lo & 0x8000) != 0 && hi == 0xFFFF)) { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } else { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } - if(box64_dynarec_test) { - // to avoid noise in tests - CLEAR_FLAG(F_SF); - CLEAR_FLAG(F_ZF); - CLEAR_FLAG(F_AF); - CLEAR_FLAG(F_PF); - } - break; - case d_imul32: - if ((((emu->res.u32 & 0x80000000) == 0) && emu->op1.u32 == 0x00) || - (((emu->res.u32 & 0x80000000) != 0) && emu->op1.u32 == 0xFFFFFFFF)) { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } else { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } - if(box64_dynarec_test) { - // to avoid noise in tests - CLEAR_FLAG(F_SF); - CLEAR_FLAG(F_ZF); - CLEAR_FLAG(F_AF); - CLEAR_FLAG(F_PF); - } - break; - case d_imul64: - if (((emu->res.u64 & 0x8000000000000000LL) == 0 && emu->op1.u64 == 0x00) || - ((emu->res.u64 & 0x8000000000000000LL) != 0 && emu->op1.u64 == 0xFFFFFFFFFFFFFFFFLL)) { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } else { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } - if(box64_dynarec_test) { - // to avoid noise in tests - CLEAR_FLAG(F_SF); - CLEAR_FLAG(F_ZF); - CLEAR_FLAG(F_AF); - CLEAR_FLAG(F_PF); - } - break; - case d_mul8: - lo = emu->res.u16 & 0xff; - hi = (emu->res.u16>>8)&0xff; - if (hi == 0) { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } else { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } - if(box64_dynarec_test) { - // to avoid noise in tests - CLEAR_FLAG(F_SF); - CLEAR_FLAG(F_ZF); - CLEAR_FLAG(F_AF); - CLEAR_FLAG(F_PF); - } - break; - case d_mul16: - lo = (uint16_t)emu->res.u32; - hi = (uint16_t)(emu->res.u32 >> 16); - if (hi == 0) { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } else { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } - if(box64_dynarec_test) { - // to avoid noise in tests - CLEAR_FLAG(F_SF); - CLEAR_FLAG(F_ZF); - CLEAR_FLAG(F_AF); - CLEAR_FLAG(F_PF); - } - break; - case d_mul32: - if (emu->op1.u32 == 0) { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } else { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } - if(box64_dynarec_test) { - // to avoid noise in tests - CLEAR_FLAG(F_SF); - CLEAR_FLAG(F_ZF); - CLEAR_FLAG(F_AF); - CLEAR_FLAG(F_PF); - } - break; - case d_mul64: - if (emu->op1.u64 == 0) { - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_OF); - } else { - SET_FLAG(F_CF); - SET_FLAG(F_OF); - } - if(box64_dynarec_test) { - // to avoid noise in tests - CLEAR_FLAG(F_SF); - CLEAR_FLAG(F_ZF); - CLEAR_FLAG(F_AF); - CLEAR_FLAG(F_PF); - } - break; - case d_or8: - CLEAR_FLAG(F_OF); - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u8 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - break; - case d_or16: - CLEAR_FLAG(F_OF); - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u16 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - break; - case d_or32: - CLEAR_FLAG(F_OF); - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u32 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - break; - case d_or64: - CLEAR_FLAG(F_OF); - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u64 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - break; - case d_neg8: - CONDITIONAL_SET_FLAG(emu->op1.u8 != 0, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u8 & 0xff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - bc = emu->res.u8 | emu->op1.u8; - CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_neg16: - CONDITIONAL_SET_FLAG(emu->op1.u16 != 0, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - bc = emu->res.u16 | emu->op1.u16; - CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_neg32: - CONDITIONAL_SET_FLAG(emu->op1.u32 != 0, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - bc = emu->res.u32 | emu->op1.u32; - CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_neg64: - CONDITIONAL_SET_FLAG(emu->op1.u64 != 0, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - bc = emu->res.u64 | emu->op1.u64; - CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_shl8: - cnt = emu->op2.u8 & 0x1f; - if (cnt > 0) { - cc = emu->op1.u8 & (1 << (8 - cnt)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u8 & 0xff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - if (cnt == 1) { - CONDITIONAL_SET_FLAG((((emu->res.u8 & 0x80) == 0x80) ^(ACCESS_FLAG(F_CF) != 0)), F_OF); - } else { - CLEAR_FLAG(F_OF); - } - if(box64_dynarec_test) { - CLEAR_FLAG(F_AF); - } - } - break; - case d_shl16: - cnt = emu->op2.u16 & 0x1f; - if (cnt > 0) { - cc = emu->op1.u16 & (1 << (16 - cnt)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - if (cnt == 1) { - CONDITIONAL_SET_FLAG(((!!(emu->res.u16 & 0x8000)) ^(ACCESS_FLAG(F_CF) != 0)), F_OF); - } else { - CLEAR_FLAG(F_OF); - } - if(box64_dynarec_test) { - CLEAR_FLAG(F_AF); - } - } - break; - case d_shl32: - cnt = emu->op2.u32 & 0x1f; - if (cnt > 0) { - cc = emu->op1.u32 & (1 << (32 - cnt)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - if (cnt == 1) { - CONDITIONAL_SET_FLAG(((!!(emu->res.u32 & 0x80000000)) ^ - (ACCESS_FLAG(F_CF) != 0)), F_OF); - } else { - CLEAR_FLAG(F_OF); - } - if(box64_dynarec_test) { - CLEAR_FLAG(F_AF); - } - } - break; - case d_shl64: - if (emu->op2.u64 > 0) { - cc = emu->op1.u64 & (1LL << (64 - emu->op2.u64)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - if (emu->op2.u64 == 1) { - CONDITIONAL_SET_FLAG(((!!(emu->res.u64 & 0x8000000000000000LL)) ^ - (ACCESS_FLAG(F_CF) != 0)), F_OF); - } else { - CLEAR_FLAG(F_OF); - } - if(box64_dynarec_test) { - CLEAR_FLAG(F_AF); - } - } - break; - case d_sar8: - if(emu->op2.u8) { - cc = (emu->op1.i8 >> (emu->op2.u8 - 1)) & 1; - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u8 & 0xff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - if(emu->op2.u8==1) - CLEAR_FLAG(F_OF); - if(box64_dynarec_test) { - CLEAR_FLAG(F_AF); - } - } - break; - case d_sar16: - if(emu->op2.u16) { - cc = (emu->op1.i16 >> (emu->op2.u16 - 1)) & 1; - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - if(emu->op2.u16==1) - CLEAR_FLAG(F_OF); - if(box64_dynarec_test) { - CLEAR_FLAG(F_AF); - } - } - break; - case d_sar32: - if(emu->op2.u32) { - cc = emu->op1.u32 & (1 << (emu->op2.u32 - 1)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u32 & 0xffffffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - if(emu->op2.u32==1) - CLEAR_FLAG(F_OF); - if(box64_dynarec_test) { - CLEAR_FLAG(F_AF); - } - } - break; - case d_sar64: - if(emu->op2.u64) { - cc = emu->op1.u64 & (1LL << (emu->op2.u64 - 1)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG(emu->res.u64 == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - if(emu->op2.u64==1) - CLEAR_FLAG(F_OF); - if(box64_dynarec_test) { - CLEAR_FLAG(F_AF); - } - } - break; - case d_shr8: - cnt = emu->op2.u8 & 0x1f; - if (cnt > 0) { - cc = emu->op1.u8 & (1 << (cnt - 1)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u8 & 0xff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - if(box64_dynarec_test) { - CLEAR_FLAG(F_AF); - } - } - if (cnt == 1) { - CONDITIONAL_SET_FLAG(emu->op1.u8 & 0x80, F_OF); - } - break; - case d_shr16: - cnt = emu->op2.u16 & 0x1f; - if (cnt > 0) { - cc = emu->op1.u16 & (1 << (cnt - 1)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - if(box64_dynarec_test) { - CLEAR_FLAG(F_AF); - } - } - if (cnt == 1) { - CONDITIONAL_SET_FLAG(emu->op1.u16 & 0x8000, F_OF); - } - break; - case d_shr32: - cnt = emu->op2.u32 & 0x1f; - if (cnt > 0) { - cc = emu->op1.u32 & (1 << (cnt - 1)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u32 & 0xffffffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - if(box64_dynarec_test) { - CLEAR_FLAG(F_AF); - } - } - if (cnt == 1) { - CONDITIONAL_SET_FLAG(emu->op1.u32 & 0x80000000, F_OF); - } - break; - case d_shr64: - cnt = emu->op2.u64; - if (cnt > 0) { - cc = emu->op1.u64 & (1LL << (cnt - 1)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - if (cnt == 1) { - CONDITIONAL_SET_FLAG(emu->op1.u64 & 0x8000000000000000LL, F_OF); - } - if(box64_dynarec_test) { - CLEAR_FLAG(F_AF); - } - } - break; - case d_shrd16: - cnt = emu->op2.u16; - if (cnt > 0) { - cc = emu->op1.u16 & (1 << (cnt - 1)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - if (cnt == 1) { - CONDITIONAL_SET_FLAG((emu->op1.u16 ^ emu->res.u16) & 0x8000, F_OF); - } - } - break; - case d_shrd32: - cnt = emu->op2.u32; - if (cnt > 0) { - cc = emu->op1.u32 & (1 << (cnt - 1)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - if (cnt == 1) { - CONDITIONAL_SET_FLAG((emu->op1.u32 ^ emu->res.u32) & 0x80000000, F_OF); - } - } - break; - case d_shrd64: - cnt = emu->op2.u64; - if (cnt > 0) { - cc = emu->op1.u64 & (1LL << (cnt - 1)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - if (cnt == 1) { - CONDITIONAL_SET_FLAG((emu->op1.u64 ^ emu->res.u64) & 0x8000000000000000LL, F_OF); - } - } - break; - case d_shld16: - cnt = emu->op2.u16; - if (cnt > 0) { - cc = emu->op1.u16 & (1 << (16 - cnt)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u16, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - if (cnt == 1) { - CONDITIONAL_SET_FLAG((emu->op1.u16 ^ emu->res.u16) & 0x8000, F_OF); - } else { - CLEAR_FLAG(F_OF); - } - } - break; - case d_shld32: - cnt = emu->op2.u32; - if (cnt > 0) { - cc = emu->op1.u32 & (1 << (32 - cnt)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - if (cnt == 1) { - CONDITIONAL_SET_FLAG((emu->op1.u32 ^ emu->res.u32) & 0x80000000, F_OF); - } else { - CLEAR_FLAG(F_OF); - } - } - break; - case d_shld64: - cnt = emu->op2.u64; - if (cnt > 0) { - cc = emu->op1.u64 & (1LL << (64 - cnt)); - CONDITIONAL_SET_FLAG(cc, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - if (cnt == 1) { - CONDITIONAL_SET_FLAG((emu->op1.u64 ^ emu->res.u64) & 0x8000000000000000LL, F_OF); - } else { - CLEAR_FLAG(F_OF); - } - } - break; - case d_sub8: - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG((emu->res.u8 & 0xff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - bc = (emu->res.u8 & (~emu->op1.u8 | emu->op2.u8)) | (~emu->op1.u8 & emu->op2.u8); - CONDITIONAL_SET_FLAG(bc & 0x80, F_CF); - CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_sub16: - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - bc = (emu->res.u16 & (~emu->op1.u16 | emu->op2.u16)) | (~emu->op1.u16 & emu->op2.u16); - CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); - CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_sub32: - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - bc = (emu->res.u32 & (~emu->op1.u32 | emu->op2.u32)) | (~emu->op1.u32 & emu->op2.u32); - CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF); - CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_sub64: - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - bc = (emu->res.u64 & (~emu->op1.u64 | emu->op2.u64)) | (~emu->op1.u64 & emu->op2.u64); - CONDITIONAL_SET_FLAG(bc & 0x8000000000000000LL, F_CF); - CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_xor8: - CLEAR_FLAG(F_OF); - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u8 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - break; - case d_xor16: - CLEAR_FLAG(F_OF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u16 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - break; - case d_xor32: - CLEAR_FLAG(F_OF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u32 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - break; - case d_xor64: - CLEAR_FLAG(F_OF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u64 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - CLEAR_FLAG(F_CF); - CLEAR_FLAG(F_AF); - break; - case d_cmp8: - CLEAR_FLAG(F_CF); - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG((emu->res.u8 & 0xff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - bc = (emu->res.u8 & (~emu->op1.u8 | emu->op2.u8)) | (~emu->op1.u8 & emu->op2.u8); - CONDITIONAL_SET_FLAG(bc & 0x80, F_CF); - CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_cmp16: - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - bc = (emu->res.u16 & (~emu->op1.u16 | emu->op2.u16)) | (~emu->op1.u16 & emu->op2.u16); - CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); - CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_cmp32: - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - bc = (emu->res.u32 & (~emu->op1.u32 | emu->op2.u32)) | (~emu->op1.u32 & emu->op2.u32); - CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF); - CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_cmp64: - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - bc = (emu->res.u64 & (~emu->op1.u64 | emu->op2.u64)) | (~emu->op1.u64 & emu->op2.u64); - CONDITIONAL_SET_FLAG(bc & 0x8000000000000000LL, F_CF); - CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_tst8: - CLEAR_FLAG(F_OF); - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u8 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - CLEAR_FLAG(F_CF); - break; - case d_tst16: - CLEAR_FLAG(F_OF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u16 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - CLEAR_FLAG(F_CF); - break; - case d_tst32: - CLEAR_FLAG(F_OF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u32 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - CLEAR_FLAG(F_CF); - break; - case d_tst64: - CLEAR_FLAG(F_OF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(emu->res.u64 == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - CLEAR_FLAG(F_CF); - break; - case d_adc8: - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x100, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u8 & 0xff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - cc = (emu->op1.u8 & emu->op2.u8) | ((~emu->res.u8) & (emu->op1.u8 | emu->op2.u8)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_adc16: - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x10000, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - cc = (emu->op1.u16 & emu->op2.u16) | ((~emu->res.u16) & (emu->op1.u16 | emu->op2.u16)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_adc32: - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x100000000L, F_CF); - CONDITIONAL_SET_FLAG((emu->res.u32 & 0xffffffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - cc = (emu->op1.u32 & emu->op2.u32) | ((~emu->res.u32) & (emu->op1.u32 | emu->op2.u32)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_adc32b: - if(emu->res.u32 == (emu->op1.u32+emu->op2.u32)) { - lo = (emu->op1.u32 & 0xFFFF) + (emu->op2.u32 & 0xFFFF); - } else { - lo = 1 + (emu->op1.u32 & 0xFFFF) + (emu->op2.u32 & 0xFFFF); - } - hi = (lo >> 16) + (emu->op1.u32 >> 16) + (emu->op2.u32 >> 16); - CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - cc = (emu->op2.u32 & emu->op1.u32) | ((~emu->res.u32) & (emu->op2.u32 | emu->op1.u32)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_adc64: - if(emu->res.u64 == (emu->op1.u64+emu->op2.u64)) { - lo = (emu->op1.u64 & 0xFFFFFFFF) + (emu->op2.u64 & 0xFFFFFFFF); - } else { - lo = 1 + (emu->op1.u64 & 0xFFFFFFFF) + (emu->op2.u64 & 0xFFFFFFFF); - } - hi = (lo >> 32) + (emu->op1.u64 >> 32) + (emu->op2.u64 >> 32); - CONDITIONAL_SET_FLAG(hi & 0x100000000L, F_CF); - CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - cc = (emu->op2.u64 & emu->op1.u64) | ((~emu->res.u64) & (emu->op2.u64 | emu->op1.u64)); - CONDITIONAL_SET_FLAG(XOR2(cc >> 62), F_OF); - CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); - break; - case d_sbb8: - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x80, F_SF); - CONDITIONAL_SET_FLAG((emu->res.u8 & 0xff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u8 & 0xff), F_PF); - bc = (emu->res.u8 & (~emu->op1.u8 | emu->op2.u8)) | (~emu->op1.u8 & emu->op2.u8); - CONDITIONAL_SET_FLAG(bc & 0x80, F_CF); - CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_sbb16: - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x8000, F_SF); - CONDITIONAL_SET_FLAG((emu->res.u16 & 0xffff) == 0, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u16 & 0xff), F_PF); - bc = (emu->res.u16 & (~emu->op1.u16 | emu->op2.u16)) | (~emu->op1.u16 & emu->op2.u16); - CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); - CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_sbb32: - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x80000000, F_SF); - CONDITIONAL_SET_FLAG(!emu->res.u32, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u32 & 0xff), F_PF); - bc = (emu->res.u32 & (~emu->op1.u32 | emu->op2.u32)) | (~emu->op1.u32 & emu->op2.u32); - CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF); - CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_sbb64: - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x8000000000000000LL, F_SF); - CONDITIONAL_SET_FLAG(!emu->res.u64, F_ZF); - CONDITIONAL_SET_FLAG(PARITY(emu->res.u64 & 0xff), F_PF); - bc = (emu->res.u64 & (~emu->op1.u64 | emu->op2.u64)) | (~emu->op1.u64 & emu->op2.u64); - CONDITIONAL_SET_FLAG(bc & 0x8000000000000000LL, F_CF); - CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF); - CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); - break; - case d_rol8: - if(emu->op2.u8 == 1) { - CONDITIONAL_SET_FLAG((emu->res.u8 + (emu->res.u8 >> 7)) & 1, F_OF); - } - CONDITIONAL_SET_FLAG(emu->res.u8 & 0x1, F_CF); - break; - case d_rol16: - if(emu->op2.u16 == 1) { - CONDITIONAL_SET_FLAG((emu->res.u16 + (emu->res.u16 >> 15)) & 1, F_OF); - } - CONDITIONAL_SET_FLAG(emu->res.u16 & 0x1, F_CF); - break; - case d_rol32: - if(emu->op2.u32 == 1) { - CONDITIONAL_SET_FLAG((emu->res.u32 + (emu->res.u32 >> 31)) & 1, F_OF); - } - CONDITIONAL_SET_FLAG(emu->res.u32 & 0x1, F_CF); - break; - case d_rol64: - if(emu->op2.u64 == 1) { - CONDITIONAL_SET_FLAG((emu->res.u64 + (emu->res.u64 >> 63)) & 1, F_OF); - } - CONDITIONAL_SET_FLAG(emu->res.u64 & 0x1, F_CF); - break; - case d_ror8: - if(emu->op2.u8 == 1) { - CONDITIONAL_SET_FLAG(XOR2(emu->res.u8 >> 6), F_OF); - } - CONDITIONAL_SET_FLAG(emu->res.u8 & (1 << 7), F_CF); - break; - case d_ror16: - if(emu->op2.u16 == 1) { - CONDITIONAL_SET_FLAG(XOR2(emu->res.u16 >> 14), F_OF); - } - CONDITIONAL_SET_FLAG(emu->res.u16 & (1 << 15), F_CF); - break; - case d_ror32: - if(emu->op2.u32 == 1) { - CONDITIONAL_SET_FLAG(XOR2(emu->res.u32 >> 30), F_OF); - } - CONDITIONAL_SET_FLAG(emu->res.u32 & (1 << 31), F_CF); - break; - case d_ror64: - if(emu->op2.u64 == 1) { - CONDITIONAL_SET_FLAG(XOR2(emu->res.u64 >> 62), F_OF); - } - CONDITIONAL_SET_FLAG(emu->res.u64 & (1L << 63), F_CF); - break; - - case d_unknown: - printf_log(LOG_NONE, "Box64: %p trying to evaluate Unknown deferred Flags\n", (void*)R_RIP); - break; - - case d_dec8i: - case d_dec16i: - case d_dec32i: - case d_dec64i: - case d_inc8i: - case d_inc16i: - case d_inc32i: - case d_inc64i: - { - deferred_flags_t df = emu->df - (d_dec8i - d_dec8); - if(emu->df_sav!=d_none) { - // compute CF - multiuint_t op1 = emu->op1; - multiuint_t res = emu->res; - emu->df = emu->df_sav; - emu->op1 = emu->op1_sav; - emu->res = emu->res_sav; - emu->df_sav = d_none; - UpdateFlags(emu); - emu->op1 = op1; - emu->res = res; - } - emu->df = df; - } - UpdateFlags(emu); - break; - } - RESET_FLAGS(emu); -} - -uintptr_t GetSegmentBaseEmu(x64emu_t* emu, int seg) -{ - if(emu->segs_serial[seg] != emu->context->sel_serial) { - emu->segs_offs[seg] = (uintptr_t)GetSegmentBase(emu->segs[seg]); - emu->segs_serial[seg] = emu->context->sel_serial; - } - return emu->segs_offs[seg]; -} - - -const char* getAddrFunctionName(uintptr_t addr) -{ - static char ret[1000]; - uint64_t sz = 0; - uintptr_t start = 0; - elfheader_t* elf = FindElfAddress(my_context, addr); - const char* symbname = FindNearestSymbolName(elf, (void*)addr, &start, &sz); - if(!sz) sz=0x100; // arbitrary value... - if(symbname && addr>=start && (addr<(start+sz) || !sz)) { - if(symbname[0]=='\0') - sprintf(ret, "%s + 0x%lx + 0x%lx", ElfName(elf), start - (uintptr_t)GetBaseAddress(elf), addr - start); - else if(addr==start) - sprintf(ret, "%s/%s", ElfName(elf), symbname); - else - sprintf(ret, "%s/%s + 0x%lx", ElfName(elf), symbname, addr - start); - } else { - if(elf) { - sprintf(ret, "%s + 0x%lx", ElfName(elf), addr - (uintptr_t)GetBaseAddress(elf)); - } else - sprintf(ret, "???"); - } - return ret; -} - -int printFunctionAddr(uintptr_t nextaddr, const char* text) -{ - uint64_t sz = 0; - uintptr_t start = 0; - const char* symbname = FindNearestSymbolName(FindElfAddress(my_context, nextaddr), (void*)nextaddr, &start, &sz); - if(!sz) sz=0x100; // arbitrary value... - if(symbname && nextaddr>=start && (nextaddr<(start+sz) || !sz)) { - if(nextaddr==start) - printf_log(LOG_NONE, " (%s%s:%s)", text, ElfName(FindElfAddress(my_context, nextaddr)), symbname); - else - printf_log(LOG_NONE, " (%s%s:%s + 0x%lx)", text, ElfName(FindElfAddress(my_context, nextaddr)), symbname, nextaddr - start); - return 1; - } - return 0; -} #ifdef HAVE_TRACE -extern uint64_t start_cnt; #define PK(a) (*(uint8_t*)(ip+a)) #define PKS(a) (*(int8_t*)(ip+a)) #define PK32(a) (*(int32_t*)((uint8_t*)(ip+a))) @@ -1146,17 +40,17 @@ extern uint64_t start_cnt; void PrintTrace(x64emu_t* emu, uintptr_t ip, int dynarec) { int is32bits = (emu->segs[_CS]==0x23); - if(start_cnt) --start_cnt; - if(!start_cnt && my_context->dec && ( - (trace_end == 0) + if(BOX64ENV(start_cnt)) SET_BOX64ENV(start_cnt, BOX64ENV(start_cnt)-1); + if(!BOX64ENV(start_cnt) && my_context->dec && ( + (trace_end == 0) || ((ip >= trace_start) && (ip < trace_end))) ) { - int tid = syscall(SYS_gettid); + int tid = GetTID(); mutex_lock(&my_context->mutex_trace); #ifdef DYNAREC if((my_context->trace_tid != tid) || (my_context->trace_dynarec!=dynarec)) { printf_log(LOG_NONE, "Thread %04d| (%s) ", tid, dynarec?"dyn":"int"); - printFunctionAddr(ip, "here: "); - printf_log(LOG_NONE, "\n"); + PrintFunctionAddr(ip, "here: "); + printf_log_prefix(0, LOG_NONE, "\n"); my_context->trace_tid = tid; my_context->trace_dynarec = dynarec; } @@ -1169,19 +63,19 @@ void PrintTrace(x64emu_t* emu, uintptr_t ip, int dynarec) #endif printf_log(LOG_NONE, "%s", DumpCPURegs(emu, ip, is32bits)); if(R_RIP==0) { - printf_log(LOG_NONE, "Running at NULL address\n"); + printf_log_prefix(0, LOG_NONE, "Running at NULL address\n"); mutex_unlock(&my_context->mutex_trace); return; } - if(PK(0)==0xcc && PK(1)=='S' && PK(2)=='C') { + if (PK(0) == 0xcc && IsBridgeSignature(PK(1), PK(2))) { uint64_t a = *(uint64_t*)(ip+3); if(a==0) { - printf_log(LOG_NONE, "%p: Exit x86emu\n", (void*)ip); + printf_log_prefix(0, LOG_NONE, "%p: Exit x86emu\n", (void*)ip); } else { - printf_log(LOG_NONE, "%p: Native call to %p => %s\n", (void*)ip, (void*)a, GetNativeName(*(void**)(ip+11))); + printf_log_prefix(0, LOG_NONE, "%p: Native call to %p => %s\n", (void*)ip, (void*)a, GetNativeName(*(void**)(ip+11))); } } else { - printf_log(LOG_NONE, "%s", DecodeX64Trace(is32bits?my_context->dec32:my_context->dec, ip)); + printf_log_prefix(0, LOG_NONE, "%s", DecodeX64Trace(is32bits ? my_context->dec32 : my_context->dec, ip, 1)); uint8_t peek = PK(0); rex_t rex = {0}; if(!is32bits && peek>=0x40 && peek<=0x4f) { @@ -1191,55 +85,86 @@ void PrintTrace(x64emu_t* emu, uintptr_t ip, int dynarec) } if(peek==0xC3 || peek==0xC2 || (peek==0xF3 && PK(1)==0xC3)) { if(is32bits) { - printf_log(LOG_NONE, " => %p", (void*)(uintptr_t)*(uint32_t*)(R_RSP)); - printFunctionAddr(*(uint32_t*)(R_RSP), "=> "); + printf_log_prefix(0, LOG_NONE, " => %p", (void*)(uintptr_t)*(uint32_t*)(R_RSP)); + PrintFunctionAddr(*(uint32_t*)(R_RSP), "=> "); } else { - printf_log(LOG_NONE, " => %p", *(void**)(R_RSP)); - printFunctionAddr(*(uintptr_t*)(R_RSP), "=> "); + printf_log_prefix(0, LOG_NONE, " => %p", *(void**)(R_RSP)); + PrintFunctionAddr(*(uintptr_t*)(R_RSP), "=> "); } } else if(peek==0x57 && rex.b) { - printf_log(LOG_NONE, " => STACK_TOP: %p", *(void**)(R_RSP)); - printFunctionAddr(ip, "here: "); - } else if((peek==0x55 /*|| peek==0x53*/) && !is32bits) { - if(!printFunctionAddr(*(uintptr_t*)(R_RSP), " STACK_TOP: ")) - printf_log(LOG_NONE, " STACK_TOP: %p ", (void*)*(uintptr_t*)(R_RSP)); - } else if((peek==0x55 || peek==0x56) && is32bits) { - if(!printFunctionAddr(*(uint32_t*)(R_RSP), " STACK_TOP: ")) - printf_log(LOG_NONE, " STACK_TOP: %p ", (void*)(uintptr_t)*(uint32_t*)(R_RSP)); + printf_log_prefix(0, LOG_NONE, " => STACK_TOP: %p", *(void**)(R_RSP)); + PrintFunctionAddr(ip, "here: "); + } else if((peek==0x55 || (peek==0x53 && rex.rex==0x40)) && !is32bits) { + if(!PrintFunctionAddr(*(uintptr_t*)(R_RSP), " STACK_TOP: ")) + printf_log_prefix(0, LOG_NONE, " STACK_TOP: %p ", (void*)*(uintptr_t*)(R_RSP)); + } else if((peek==0x55 || peek==0x56 || peek==0x53 || peek==0x57) && is32bits) { + if(!PrintFunctionAddr(*(uint32_t*)(R_RSP), " STACK_TOP: ")) + printf_log_prefix(0, LOG_NONE, " STACK_TOP: %p ", (void*)(uintptr_t)*(uint32_t*)(R_RSP)); } else if(peek==0xF3 && PK(1)==0x0F && PK(2)==0x1E && PK(3)==0xFA && !is32bits) { - printFunctionAddr(*(uintptr_t*)(R_RSP), " STACK_TOP: "); + uintptr_t nextaddr = *(uintptr_t*)(R_RSP); + if(!PrintFunctionAddr(nextaddr, "=> ")) + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); + } else if((peek==0x81 || peek==0x83) && PK(1)==0xEC /*&& is32bits*/) { + uintptr_t nextaddr = is32bits?(*(ptr_t*)from_ptrv(R_ESP)):(*(uintptr_t*)R_RSP); + if(!PrintFunctionAddr(nextaddr, "STACK_TOP: ")) + printf_log_prefix(0, LOG_NONE, " STACK_TOP: %p", (void*)nextaddr); } else if(peek==0xE8 || peek==0xE9) { // Call & Jmp uintptr_t nextaddr = ip + 5 + PK32(1); - printFunctionAddr(nextaddr, "=> "); + PrintFunctionAddr(nextaddr, "=> "); } else if(peek==0xFF) { if(PK(1)==0x25) { uintptr_t nextaddr = is32bits?(*(uint32_t*)(uintptr_t)PK32(2)):(*(uintptr_t*)(ip + 6 + PK32(2))); - if(!printFunctionAddr(nextaddr, "=> ")) - printf_log(LOG_NONE, " => %p", (void*)nextaddr); + if(!PrintFunctionAddr(nextaddr, "=> ")) + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); } else if(PK(1)==0x15) { uintptr_t nextaddr = is32bits?(*(uint32_t*)(uintptr_t)PK32(2)):(*(uintptr_t*)(ip + 6 + PK32(2))); - if(!printFunctionAddr(nextaddr, "=> ")) - printf_log(LOG_NONE, " => %p", (void*)nextaddr); + if(!PrintFunctionAddr(nextaddr, "=> ")) + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); } else if(PK(1)==0x60) { uintptr_t nextaddr = *(uintptr_t*)(R_RAX+PK(2)); - if(!printFunctionAddr(nextaddr, "=> ")) - printf_log(LOG_NONE, " => %p", (void*)nextaddr); + if(!PrintFunctionAddr(nextaddr, "=> ")) + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); + } else if(PK(1)==0xE0) { + uintptr_t nextaddr = R_RAX; + if(is32bits) nextaddr &= 0xffffffff; + if(!PrintFunctionAddr(nextaddr, "=> ")) + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); } else if((PK(1)==0x14) && (PK(2)==0x25)) { uintptr_t nextaddr = is32bits?(*(uint32_t*)(uintptr_t)PK32(3)):(*(uintptr_t*)(uintptr_t)PK32(3)); - printf_log(LOG_NONE, " => %p", (void*)nextaddr); - printFunctionAddr(nextaddr, "=> "); + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); + PrintFunctionAddr(nextaddr, "=> "); } else if((PK(1)==0x14) && (PK(2)==0xC2) && rex.rex==0x41) { uintptr_t nextaddr = *(uintptr_t*)(R_R10 + R_RAX*8); - printf_log(LOG_NONE, " => %p", (void*)nextaddr); - printFunctionAddr(nextaddr, "=> "); + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); + PrintFunctionAddr(nextaddr, "=> "); } else if(PK(1)==0xE1 && rex.rex==0x41) { uintptr_t nextaddr = R_R9; - printf_log(LOG_NONE, " => %p", (void*)nextaddr); - printFunctionAddr(nextaddr, "=> "); + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); + PrintFunctionAddr(nextaddr, "=> "); + } else if(is32bits && PK(1)==0xA3) { + uintptr_t nextaddr = *(ptr_t*)from_ptrv(R_EBX + PK32(2)); + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); + PrintFunctionAddr(nextaddr, "=> "); + } else if(PK(1)==0x92) { + uintptr_t nextaddr = is32bits?(*(ptr_t*)from_ptrv(R_EDX + PK32(2))):(*(uintptr_t*)(R_RDX + PK32(2))); + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); + PrintFunctionAddr(nextaddr, "=> "); + } else if(PK(1)==0x50) { + uintptr_t nextaddr = is32bits?(*(ptr_t*)from_ptrv(R_EAX + PK(2))):(*(uintptr_t*)(R_RAX + PK(2))); + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); + PrintFunctionAddr(nextaddr, "=> "); + } else if(PK(1)==0x52) { + uintptr_t nextaddr = is32bits?(*(ptr_t*)from_ptrv(R_EDX + PK(2))):(*(uintptr_t*)(R_RDX + PK(2))); + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); + PrintFunctionAddr(nextaddr, "=> "); + } else if(is32bits && PK(1)==0x10) { + uintptr_t nextaddr = *(ptr_t*)from_ptrv(R_EAX); + printf_log_prefix(0, LOG_NONE, " => %p", (void*)nextaddr); + PrintFunctionAddr(nextaddr, "=> "); } } - printf_log(LOG_NONE, "\n"); + printf_log_prefix(0, LOG_NONE, "\n"); } mutex_unlock(&my_context->mutex_trace); } @@ -1308,8 +233,9 @@ reg64_t* GetECommon_32(x64emu_t* emu, uintptr_t* addr, uint8_t m, uint32_t base) return (reg64_t*)(uintptr_t)base; } } -reg64_t* GetEw16_32(x64emu_t *emu, uintptr_t* addr, uint8_t m, uint32_t base) +reg64_t* GetECommon_16(x64emu_t *emu, uintptr_t* addr, uint8_t m, uint32_t offset) { + uint16_t base = 0; switch(m&7) { case 0: base+= R_BX+R_SI; break; case 1: base+= R_BX+R_DI; break; @@ -1317,106 +243,108 @@ reg64_t* GetEw16_32(x64emu_t *emu, uintptr_t* addr, uint8_t m, uint32_t base) case 3: base+= R_BP+R_DI; break; case 4: base+= R_SI; break; case 5: base+= R_DI; break; - case 6: base+= R_BP; break; + case 6: if((m>>6)&3) base += R_BP; else base += F16S(addr); break; case 7: base+= R_BX; break; } switch((m>>6)&3) { - case 0: if((m&7)==6) base= F16S(addr); break; case 1: base += F8S(addr); break; case 2: base += F16S(addr); break; + // case 0 is already dealt with on case 6 // case 3 is C0..C7, already dealt with } - return (reg64_t*)(uintptr_t)base; + return (reg64_t*)(uintptr_t)(offset+base); } -reg64_t* GetECommon(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta) +reg64_t* GetECommon_64(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta, uintptr_t base) { - if(rex.is32bits) - return GetECommon_32(emu, addr, m, 0); if (m<=7) { if(m==0x4) { uint8_t sib = F8(addr); - uintptr_t base = ((sib&0x7)==5)?((uint64_t)(int64_t)F32S(addr)):(emu->regs[(sib&0x7)+(rex.b<<3)].q[0]); // base + base += ((sib&0x7)==5)?((uint64_t)(int64_t)F32S(addr)):(emu->regs[(sib&0x7)+(rex.b<<3)].q[0]); // base base += (emu->sbiidx[((sib>>3)&7)+(rex.x<<3)]->sq[0] << (sib>>6)); return (reg64_t*)base; } else if (m==0x5) { //disp32 - int32_t base = F32S(addr); + base += F32S(addr); return (reg64_t*)(base+*addr+delta); } - return (reg64_t*)(emu->regs[m+(rex.b<<3)].q[0]); + return (reg64_t*)(base + emu->regs[m+(rex.b<<3)].q[0]); } else { - uintptr_t base; if((m&7)==4) { uint8_t sib = F8(addr); - base = emu->regs[(sib&0x7)+(rex.b<<3)].q[0]; // base + base += emu->regs[(sib&0x7)+(rex.b<<3)].q[0]; // base base += (emu->sbiidx[((sib>>3)&7)+(rex.x<<3)]->sq[0] << (sib>>6)); } else { - base = emu->regs[(m&0x7)+(rex.b<<3)].q[0]; + base += emu->regs[(m&0x7)+(rex.b<<3)].q[0]; } base+=(m&0x80)?F32S(addr):F8S(addr); return (reg64_t*)base; } } -reg64_t* GetECommonO(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta, uintptr_t base) +reg64_t* GetECommon32O(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta, uintptr_t base) { - if(rex.is32bits) - return GetECommon_32(emu, addr, m, base); if (m<=7) { if(m==0x4) { uint8_t sib = F8(addr); - base += ((sib&0x7)==5)?((uint64_t)(int64_t)F32S(addr)):(emu->regs[(sib&0x7)+(rex.b<<3)].q[0]); // base - base += (emu->sbiidx[((sib>>3)&7)+(rex.x<<3)]->sq[0] << (sib>>6)); + base += ((sib&0x7)==5)?((uint64_t)(int64_t)F32S(addr)):(emu->regs[(sib&0x7)+(rex.b<<3)].dword[0]); // base + base += (emu->sbiidx[((sib>>3)&7)+(rex.x<<3)]->sdword[0] << (sib>>6)); return (reg64_t*)base; } else if (m==0x5) { //disp32 base += F32S(addr); - return (reg64_t*)(base+*addr+delta); + return (reg64_t*)(base+(*addr)+delta); } - return (reg64_t*)(base + emu->regs[m+(rex.b<<3)].q[0]); + return (reg64_t*)(uintptr_t)(base + emu->regs[m+(rex.b<<3)].dword[0]); } else { if((m&7)==4) { uint8_t sib = F8(addr); - base += emu->regs[(sib&0x7)+(rex.b<<3)].q[0]; // base - base += (emu->sbiidx[((sib>>3)&7)+(rex.x<<3)]->sq[0] << (sib>>6)); + base += emu->regs[(sib&0x7)+(rex.b<<3)].dword[0]; // base + base += (emu->sbiidx[((sib>>3)&7)+(rex.x<<3)]->sdword[0] << (sib>>6)); } else { - base += emu->regs[(m&0x7)+(rex.b<<3)].q[0]; + base += emu->regs[(m&0x7)+(rex.b<<3)].dword[0]; } base+=(m&0x80)?F32S(addr):F8S(addr); return (reg64_t*)base; } } -reg64_t* GetECommon32O(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta, uintptr_t base) +reg64_t* GetECommon(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta) { + if(rex.is32bits && rex.is67) + return GetECommon_16(emu, addr, m, rex.offset); if(rex.is32bits) - return GetEw16_32(emu, addr, m, base); + return GetECommon_32(emu, addr, m, rex.offset); + if(rex.is67) + return GetECommon32O(emu, addr, rex, m, delta, rex.offset); if (m<=7) { if(m==0x4) { uint8_t sib = F8(addr); - base += ((sib&0x7)==5)?((uint64_t)(int64_t)F32S(addr)):(emu->regs[(sib&0x7)+(rex.b<<3)].dword[0]); // base - base += (emu->sbiidx[((sib>>3)&7)+(rex.x<<3)]->sdword[0] << (sib>>6)); + uintptr_t base = ((sib&0x7)==5)?((uint64_t)(int64_t)F32S(addr)):(emu->regs[(sib&0x7)+(rex.b<<3)].q[0]); // base + base += (emu->sbiidx[((sib>>3)&7)+(rex.x<<3)]->sq[0] << (sib>>6)); + base += rex.offset; return (reg64_t*)base; } else if (m==0x5) { //disp32 - base += F32S(addr); - return (reg64_t*)(base+(*addr)+delta); + int32_t base = F32S(addr); + base += rex.offset; + return (reg64_t*)(base+*addr+delta); } - return (reg64_t*)(uintptr_t)(base + emu->regs[m+(rex.b<<3)].dword[0]); + return (reg64_t*)(emu->regs[m+(rex.b<<3)].q[0]+rex.offset); } else { + uintptr_t base; if((m&7)==4) { uint8_t sib = F8(addr); - base += emu->regs[(sib&0x7)+(rex.b<<3)].dword[0]; // base - base += (emu->sbiidx[((sib>>3)&7)+(rex.x<<3)]->sdword[0] << (sib>>6)); + base = emu->regs[(sib&0x7)+(rex.b<<3)].q[0]; // base + base += (emu->sbiidx[((sib>>3)&7)+(rex.x<<3)]->sq[0] << (sib>>6)); } else { - base += emu->regs[(m&0x7)+(rex.b<<3)].dword[0]; + base = emu->regs[(m&0x7)+(rex.b<<3)].q[0]; } base+=(m&0x80)?F32S(addr):F8S(addr); + base += rex.offset; return (reg64_t*)base; } } reg64_t* GetEb(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { - // rex ignored here uint8_t m = v&0xC7; // filter Eb if(m>=0xC0) { if(rex.rex) { @@ -1430,7 +358,6 @@ reg64_t* GetEb(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t del reg64_t* TestEb(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { - // rex ignored here uint8_t m = v&0xC7; // filter Eb if(m>=0xC0) { if(rex.rex) { @@ -1448,40 +375,6 @@ reg64_t* TestEb(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t } } -reg64_t* GetEbO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) -{ - // rex ignored here - uint8_t m = v&0xC7; // filter Eb - if(m>=0xC0) { - if(rex.rex) { - return &emu->regs[(m&0x07)+(rex.b<<3)]; - } else { - int lowhigh = (m&4)>>2; - return (reg64_t *)(((char*)(&emu->regs[(m&0x03)]))+lowhigh); //? - } - } else return GetECommonO(emu, addr, rex, m, delta, offset); -} - -reg64_t* TestEbO(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) -{ - // rex ignored here - uint8_t m = v&0xC7; // filter Eb - if(m>=0xC0) { - if(rex.rex) { - return &test->emu->regs[(m&0x07)+(rex.b<<3)]; - } else { - int lowhigh = (m&4)>>2; - return (reg64_t *)(((char*)(&test->emu->regs[(m&0x03)]))+lowhigh); //? - } - } else { - reg64_t* ret = GetECommonO(test->emu, addr, rex, m, delta, offset); - test->memsize = 1; - test->memaddr = (uintptr_t)ret; - test->mem[0] = ret->byte[0]; - return (reg64_t*)test->mem; - } -} - reg64_t* GetEd(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { uint8_t m = v&0xC7; // filter Ed @@ -1508,6 +401,11 @@ reg64_t* TestEd(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t } reg64_t* TestEd4(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { + if(rex.is67 && rex.is32bits) { + printf_log(LOG_NONE, "Need 32bits 67 prefix TestEd4x\n"); + test->emu->quit = 1; + return NULL; + } uint8_t m = v&0xC7; // filter Ed if(m>=0xC0) { return &test->emu->regs[(m&0x07)+(rex.b<<3)]; @@ -1521,6 +419,11 @@ reg64_t* TestEd4(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t } reg64_t* TestEd8(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { + if(rex.is67 && rex.is32bits) { + printf_log(LOG_NONE, "Need 32bits 67 prefix TestEd8\n"); + test->emu->quit = 1; + return NULL; + } uint8_t m = v&0xC7; // filter Ed if(m>=0xC0) { return &test->emu->regs[(m&0x07)+(rex.b<<3)]; @@ -1534,6 +437,11 @@ reg64_t* TestEd8(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t } reg64_t* TestEdt(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { + if(rex.is67 && rex.is32bits) { + printf_log(LOG_NONE, "Need 32bits 67 prefix TestEdt\n"); + test->emu->quit = 1; + return NULL; + } uint8_t m = v&0xC7; // filter Ed if(m>=0xC0) { return &test->emu->regs[(m&0x07)+(rex.b<<3)]; @@ -1547,6 +455,11 @@ reg64_t* TestEdt(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t } reg64_t* TestEd8xw(x64test_t *test, int w, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { + if(rex.is67 && rex.is32bits) { + printf_log(LOG_NONE, "Need 32bits 67 prefix TestEd4xw\n"); + test->emu->quit = 1; + return NULL; + } uint8_t m = v&0xC7; // filter Ed if(m>=0xC0) { return &test->emu->regs[(m&0x07)+(rex.b<<3)]; @@ -1562,6 +475,11 @@ reg64_t* TestEd8xw(x64test_t *test, int w, uintptr_t* addr, rex_t rex, uint8_t v } reg64_t* TestEw(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { + if(rex.is67 && rex.is32bits) { + printf_log(LOG_NONE, "Need 32bits 67 prefix TestEw\n"); + test->emu->quit = 1; + return NULL; + } uint8_t m = v&0xC7; // filter Ed if(m>=0xC0) { return &test->emu->regs[(m&0x07)+(rex.b<<3)]; @@ -1577,14 +495,6 @@ reg64_t* TestEw(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t } } -uintptr_t GetEA(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) -{ - uint8_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return (uintptr_t)&emu->regs[(m&0x07)+(rex.b<<3)]; - } else return (uintptr_t)GetECommon(emu, addr, rex, m, delta); -} - uintptr_t GetEA32(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { uint8_t m = v&0xC7; // filter Ed @@ -1593,91 +503,27 @@ uintptr_t GetEA32(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t } else return (uintptr_t)GetECommon32O(emu, addr, rex, m, delta, 0); } -reg64_t* GetEdO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) -{ - uint8_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return &emu->regs[(m&0x07)+(rex.b<<3)]; - } else return GetECommonO(emu, addr, rex, m, delta, offset); -} - -reg64_t* TestEdO(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) -{ - uint8_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return &test->emu->regs[(m&0x07)+(rex.b<<3)]; - } else { - reg64_t* ret = GetECommonO(test->emu, addr, rex, m, delta, offset); - test->memsize = 4<memaddr = (uintptr_t)ret; - if(rex.w) - *(uint64_t*)test->mem = ret->q[0]; - else - *(uint32_t*)test->mem = ret->dword[0]; - return (reg64_t*)test->mem; - } -} - -reg64_t* GetEd32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) +uintptr_t GetEA32_16(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { uint8_t m = v&0xC7; // filter Ed if(m>=0xC0) { - return &emu->regs[(m&0x07)+(rex.b<<3)]; - } else return GetECommon32O(emu, addr, rex, m, delta, offset); + return (uintptr_t)&emu->regs[(m&0x07)+(rex.b<<3)]; + } else return (uintptr_t)GetECommon_16(emu, addr, m, rex.offset); } -reg64_t* TestEd32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) +uintptr_t GetEA(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { + rex.offset = 0; // no segment offset in Effective Address computation + if(rex.is67 && rex.is32bits) + return GetEA32_16(emu, addr, rex, v, delta); + if(rex.is67) + return GetEA32(emu, addr, rex, v, delta); uint8_t m = v&0xC7; // filter Ed if(m>=0xC0) { - return &test->emu->regs[(m&0x07)+(rex.b<<3)]; - } else { - reg64_t* ret = GetECommon32O(test->emu, addr, rex, m, delta, offset); - test->memsize = 4<memaddr = (uintptr_t)ret; - if(rex.w) - *(uint64_t*)test->mem = ret->q[0]; - else - *(uint32_t*)test->mem = ret->dword[0]; - return (reg64_t*)test->mem; - } -} - -reg64_t* GetEb32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) -{ - uint8_t m = v&0xC7; // filter Eb - if(m>=0xC0) { - if(rex.rex) { - return &emu->regs[(m&0x07)+(rex.b<<3)]; - } else { - int lowhigh = (m&4)>>2; - return (reg64_t *)(((char*)(&emu->regs[(m&0x03)]))+lowhigh); //? - } - } else return GetECommon32O(emu, addr, rex, m, delta, offset); -} - -reg64_t* TestEb32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) -{ - uint8_t m = v&0xC7; // filter Eb - if(m>=0xC0) { - if(rex.rex) { - return &test->emu->regs[(m&0x07)+(rex.b<<3)]; - } else { - int lowhigh = (m&4)>>2; - return (reg64_t *)(((char*)(&test->emu->regs[(m&0x03)]))+lowhigh); //? - } - } else { - reg64_t* ret = GetECommon32O(test->emu, addr, rex, m, delta, offset); - test->memsize = 1; - test->memaddr = (uintptr_t)ret; - test->mem[0] = ret->byte[0]; - return (reg64_t*)test->mem; - } + return (uintptr_t)&emu->regs[(m&0x07)+(rex.b<<3)]; + } else return (uintptr_t)GetECommon(emu, addr, rex, m, delta); } -#define GetEw GetEd -#define TestEw TestEd - reg64_t* GetEw16(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v) { (void)rex; @@ -1703,7 +549,7 @@ reg64_t* GetEw16(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v) case 2: base += F16S(addr); break; // case 3 is C0..C7, already dealt with } - return (reg64_t*)base; + return (reg64_t*)(base+rex.offset); } } @@ -1734,138 +580,19 @@ reg64_t* TestEw16(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v) // case 3 is C0..C7, already dealt with } test->memsize = 2; - *(uint16_t*)test->mem = *(uint16_t*)base; - test->memaddr = (uintptr_t)base; - return (reg64_t*)test->mem; - } -} - -reg64_t* GetEw16off(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uintptr_t offset) -{ - (void)rex; - - uint32_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return &emu->regs[(m&0x07)]; - } else { - uint32_t base = 0; - switch(m&7) { - case 0: base = R_BX+R_SI; break; - case 1: base = R_BX+R_DI; break; - case 2: base = R_BP+R_SI; break; - case 3: base = R_BP+R_DI; break; - case 4: base = R_SI; break; - case 5: base = R_DI; break; - case 6: base = R_BP; break; - case 7: base = R_BX; break; - } - switch((m>>6)&3) { - case 0: if((m&7)==6) base = F16S(addr); break; - case 1: base += F8S(addr); break; - case 2: base += F16S(addr); break; - // case 3 is C0..C7, already dealt with - } - return (reg64_t*)(base+offset); - } -} - -reg64_t* GetEd16off(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uintptr_t offset) -{ - (void)rex; - - uint32_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return &emu->regs[(m&0x07)]; - } else { - uint32_t base = 0; - switch(m&7) { - case 0: base = R_BX+R_SI; break; - case 1: base = R_BX+R_DI; break; - case 2: base = R_BP+R_SI; break; - case 3: base = R_BP+R_DI; break; - case 4: base = R_SI; break; - case 5: base = R_DI; break; - case 6: base = R_BP; break; - case 7: base = R_BX; break; - } - switch((m>>6)&3) { - case 0: if((m&7)==6) base = F16S(addr); break; - case 1: base += F8S(addr); break; - case 2: base += F16S(addr); break; - // case 3 is C0..C7, already dealt with - } - return (reg64_t*)(base+offset); - } -} - -reg64_t* TestEw16off(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uintptr_t offset) -{ - (void)rex; - x64emu_t* emu = test->emu; - - uint32_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return &emu->regs[(m&0x07)]; - } else { - uint32_t base = 0; - switch(m&7) { - case 0: base = R_BX+R_SI; break; - case 1: base = R_BX+R_DI; break; - case 2: base = R_BP+R_SI; break; - case 3: base = R_BP+R_DI; break; - case 4: base = R_SI; break; - case 5: base = R_DI; break; - case 6: base = R_BP; break; - case 7: base = R_BX; break; - } - switch((m>>6)&3) { - case 0: if((m&7)==6) base = F16S(addr); break; - case 1: base += F8S(addr); break; - case 2: base += F16S(addr); break; - // case 3 is C0..C7, already dealt with - } - test->memsize = 2; - *(uint16_t*)test->mem = *(uint16_t*)(base+offset); - test->memaddr = (uintptr_t)(base+offset); - return (reg64_t*)test->mem; - } -} - -reg64_t* TestEd16off(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uintptr_t offset) -{ - (void)rex; - x64emu_t* emu = test->emu; - - uint32_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return &emu->regs[(m&0x07)]; - } else { - uint32_t base = 0; - switch(m&7) { - case 0: base = R_BX+R_SI; break; - case 1: base = R_BX+R_DI; break; - case 2: base = R_BP+R_SI; break; - case 3: base = R_BP+R_DI; break; - case 4: base = R_SI; break; - case 5: base = R_DI; break; - case 6: base = R_BP; break; - case 7: base = R_BX; break; - } - switch((m>>6)&3) { - case 0: if((m&7)==6) base = F16S(addr); break; - case 1: base += F8S(addr); break; - case 2: base += F16S(addr); break; - // case 3 is C0..C7, already dealt with - } - test->memsize = 4; - *(uint32_t*)test->mem = *(uint32_t*)(base+offset); - test->memaddr = (uintptr_t)(base+offset); + *(uint16_t*)test->mem = *(uint16_t*)(base+rex.offset); + test->memaddr = (uintptr_t)(base+rex.offset); return (reg64_t*)test->mem; } } mmx87_regs_t* GetEm(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { + if(rex.is67 && rex.is32bits) { + printf_log(LOG_INFO, "Needed is67 32bits GetEm\n"); + emu->quit = 1; + return NULL; + } uint8_t m = v&0xC7; // filter Ed if(m>=0xC0) { return &emu->mmx[m&0x07]; @@ -1888,6 +615,11 @@ mmx87_regs_t* TestEm(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uin sse_regs_t* GetEx(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta) { + if(rex.is67 && rex.is32bits) { + printf_log(LOG_INFO, "Needed is67 32bits GetEx\n"); + emu->quit = 1; + return NULL; + } uint8_t m = v&0xC7; // filter Ed if(m>=0xC0) { return &emu->xmm[(m&0x07)+(rex.b<<3)]; @@ -1923,74 +655,6 @@ sse_regs_t* TestEy(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v) } } -sse_regs_t* GetExO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) -{ - uint8_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return &emu->xmm[(m&0x07)+(rex.b<<3)]; - } else return (sse_regs_t*)GetECommonO(emu, addr, rex, m, delta, offset); -} - -sse_regs_t* TestExO(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) -{ - uint8_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return &test->emu->xmm[(m&0x07)+(rex.b<<3)]; - } else { - sse_regs_t* ret = (sse_regs_t*)GetECommonO(test->emu, addr, rex, m, delta, offset); - test->memsize = 16; - ((uint64_t*)test->mem)[0] = ret->q[0]; - ((uint64_t*)test->mem)[1] = ret->q[1]; - test->memaddr = (uintptr_t)ret; - return (sse_regs_t*)test->mem; - } -} - -sse_regs_t* GetEx32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) -{ - uint8_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return &emu->xmm[(m&0x07)+(rex.b<<3)]; - } else return (sse_regs_t*)GetECommon32O(emu, addr, rex, m, delta, offset); -} - -sse_regs_t* TestEx32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) -{ - uint8_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return &test->emu->xmm[(m&0x07)+(rex.b<<3)]; - } else { - sse_regs_t* ret = (sse_regs_t*)GetECommon32O(test->emu, addr, rex, m, delta, offset); - test->memsize = 16; - ((uint64_t*)test->mem)[0] = ret->q[0]; - ((uint64_t*)test->mem)[1] = ret->q[1]; - test->memaddr = (uintptr_t)ret; - return (sse_regs_t*)test->mem; - } -} - -mmx87_regs_t* GetEm32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) -{ - uint8_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return &emu->mmx[(m&0x07)]; - } else return (mmx87_regs_t*)GetECommon32O(emu, addr, rex, m, delta, offset); -} - -mmx87_regs_t* TestEm32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset) -{ - uint8_t m = v&0xC7; // filter Ed - if(m>=0xC0) { - return &test->emu->mmx[(m&0x07)]; - } else { - mmx87_regs_t* ret = (mmx87_regs_t*)GetECommon32O(test->emu, addr, rex, m, delta, offset); - test->memsize = 8; - *(uint64_t*)test->mem = ret->q; - test->memaddr = (uintptr_t)ret; - return (mmx87_regs_t*)test->mem; - } -} - reg64_t* GetGd(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v) { return &emu->regs[((v&0x38)>>3)+(rex.r<<3)]; diff --git a/src/emu/x64run_private.h b/src/emu/x64run_private.h index 45a6865..46bc052 100644 --- a/src/emu/x64run_private.h +++ b/src/emu/x64run_private.h @@ -5,7 +5,8 @@ #include "regs.h" #include "x64emu_private.h" #include "box64context.h" -typedef struct x64emu_s x64emu_t; +#include "symbolfuncs.h" +#include "x64emu.h" typedef struct rex_s { union { @@ -18,7 +19,13 @@ typedef struct rex_s { unsigned int s:4; }; }; - int is32bits; + uint16_t is32bits:1; + uint16_t is66:1; + uint16_t is67:1; + uint16_t isf0:1; + uint16_t seg:3; //seg is 0-5, but 0 is CS, so will always be no-offset + uint16_t rep:2; // 0 none, 1=F2 prefix, 2=F3 prefix + uint64_t offset; } rex_t; #define VEX_P_NONE 0 @@ -37,64 +44,12 @@ typedef struct vex_s { uint16_t m:5; // opcode map } vex_t; -static inline uint8_t Peek(x64emu_t *emu, int offset){return *(uint8_t*)(R_RIP + offset);} - -#ifdef TEST_INTERPRETER -#define Push16(E, V) do{E->regs[_SP].q[0] -=2; test->memsize = 2; *(uint16_t*)test->mem = (V); test->memaddr = E->regs[_SP].q[0];}while(0) -#define Push32(E, V) do{E->regs[_SP].q[0] -=4; test->memsize = 4; *(uint32_t*)test->mem = (V); test->memaddr = E->regs[_SP].q[0];}while(0) -#define Push64(E, V) do{E->regs[_SP].q[0] -=8; test->memsize = 8; *(uint64_t*)test->mem = (V); test->memaddr = E->regs[_SP].q[0];}while(0) -#else -static inline void Push16(x64emu_t *emu, uint16_t v) -{ - R_RSP -= 2; - *((uint16_t*)R_RSP) = v; -} - -static inline void Push32(x64emu_t *emu, uint32_t v) -{ - R_RSP -= 4; - *((uint32_t*)R_RSP) = v; -} - -static inline void Push64(x64emu_t *emu, uint64_t v) -{ - R_RSP -= 8; - *((uint64_t*)R_RSP) = v; -} -#endif - -static inline uint16_t Pop16(x64emu_t *emu) -{ - uint16_t* st = (uint16_t*)R_RSP; - R_RSP += 2; - return *st; -} - -static inline uint32_t Pop32(x64emu_t *emu) -{ - uint32_t* st = (uint32_t*)R_RSP; - R_RSP += 4; - return *st; -} - -static inline uint64_t Pop64(x64emu_t *emu) -{ - uint64_t* st = (uint64_t*)R_RSP; - R_RSP += 8; - return *st; -} - -static inline void PushExit(x64emu_t* emu) -{ - R_RSP -= 8; - *((uint64_t*)R_RSP) = my_context->exit_bridge; -} - // the op code definition can be found here: http://ref.x86asm.net/geek32.html reg64_t* GetECommon(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta); reg64_t* GetECommonO(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta, uintptr_t offset); reg64_t* GetECommon32O(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta, uintptr_t offset); +reg64_t* GetECommon32O_16(x64emu_t* emu, uintptr_t* addr, rex_t rex, uint8_t m, uint8_t delta, uintptr_t offset); reg64_t* GetEb(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta); reg64_t* TestEb(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta); reg64_t* GetEbO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset); @@ -102,11 +57,14 @@ reg64_t* TestEbO(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t reg64_t* GetEd(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta); reg64_t* TestEd(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta); reg64_t* TestEd4(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta); +reg64_t* TestEd4O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset); reg64_t* TestEd8(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta); +reg64_t* TestEd8O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset); reg64_t* TestEd8xw(x64test_t *test, int w, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta); reg64_t* TestEdt(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta); uintptr_t GetEA(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta); uintptr_t GetEA32(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta); +uintptr_t GetEA32_16(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta); reg64_t* GetEdO(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset); reg64_t* TestEdO(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset); reg64_t* GetEd32O(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset); @@ -141,28 +99,17 @@ mmx87_regs_t* TestEm32O(x64test_t *test, uintptr_t* addr, rex_t rex, uint8_t v, sse_regs_t* GetGx(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v); sse_regs_t* GetGy(x64emu_t *emu, uintptr_t* addr, rex_t rex, uint8_t v); -void UpdateFlags(x64emu_t *emu); - #define CHECK_FLAGS(emu) if(emu->df) UpdateFlags(emu) #define RESET_FLAGS(emu) emu->df = d_none uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step); -uintptr_t Run64(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr); -uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr); +uintptr_t Run66(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step); uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr); -uintptr_t Run66F20F(x64emu_t *emu, rex_t rex, uintptr_t addr); +uintptr_t Run66F20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step); uintptr_t Run66F30F(x64emu_t *emu, rex_t rex, uintptr_t addr); -uintptr_t Run6664(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr); uintptr_t Run66D9(x64emu_t *emu, rex_t rex, uintptr_t addr); uintptr_t Run66DD(x64emu_t *emu, rex_t rex, uintptr_t addr); uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr); -uintptr_t Run67(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr); -uintptr_t Run67AVX(x64emu_t *emu, vex_t vex, uintptr_t addr); -uintptr_t Run67_32(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr); -uintptr_t Run6764_32(x64emu_t *emu, rex_t rex, int rep, int seg, uintptr_t addr); -uintptr_t Run670F(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr); -uintptr_t Run6766(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr); -uintptr_t Run67660F(x64emu_t *emu, rex_t rex, uintptr_t addr); uintptr_t RunD8(x64emu_t *emu, rex_t rex, uintptr_t addr); uintptr_t RunD9(x64emu_t *emu, rex_t rex, uintptr_t addr); uintptr_t RunDA(x64emu_t *emu, rex_t rex, uintptr_t addr); @@ -173,7 +120,7 @@ uintptr_t RunDE(x64emu_t *emu, rex_t rex, uintptr_t addr); uintptr_t RunDF(x64emu_t *emu, rex_t rex, uintptr_t addr); uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr); uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step); -uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr); +uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step); uintptr_t RunAVX(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step); uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step); uintptr_t RunAVX_0F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step); @@ -188,22 +135,13 @@ uintptr_t RunAVX_F30F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step); uintptr_t RunAVX_F30F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step); uintptr_t Test0F(x64test_t *test, rex_t rex, uintptr_t addr, int *step); -uintptr_t Test64(x64test_t *test, rex_t rex, int seg, uintptr_t addr); -uintptr_t Test66(x64test_t *test, rex_t rex, int rep, uintptr_t addr); +uintptr_t Test66(x64test_t *test, rex_t rex, uintptr_t addr, int *step); uintptr_t Test660F(x64test_t *test, rex_t rex, uintptr_t addr); -uintptr_t Test66F20F(x64test_t *test, rex_t rex, uintptr_t addr); +uintptr_t Test66F20F(x64test_t *test, rex_t rex, uintptr_t addr, int *step); uintptr_t Test66F30F(x64test_t *test, rex_t rex, uintptr_t addr); -uintptr_t Test6664(x64test_t *test, rex_t rex, int seg, uintptr_t addr); uintptr_t Test66D9(x64test_t *test, rex_t rex, uintptr_t addr); uintptr_t Test66DD(x64test_t *test, rex_t rex, uintptr_t addr); uintptr_t Test66F0(x64test_t *test, rex_t rex, uintptr_t addr); -uintptr_t Test67(x64test_t *test, rex_t rex, int rep, uintptr_t addr); -uintptr_t Test67AVX(x64test_t *test, vex_t vex, uintptr_t addr); -uintptr_t Test67_32(x64test_t *test, rex_t rex, int rep, uintptr_t addr); -uintptr_t Test6764_32(x64test_t *test, rex_t rex, int rep, int seg, uintptr_t addr); -uintptr_t Test670F(x64test_t *test, rex_t rex, int rep, uintptr_t addr); -uintptr_t Test6766(x64test_t *test, rex_t rex, int rep, uintptr_t addr); -uintptr_t Test67660F(x64test_t *test, rex_t rex, uintptr_t addr); uintptr_t TestD8(x64test_t *test, rex_t rex, uintptr_t addr); uintptr_t TestD9(x64test_t *test, rex_t rex, uintptr_t addr); uintptr_t TestDA(x64test_t *test, rex_t rex, uintptr_t addr); @@ -214,7 +152,7 @@ uintptr_t TestDE(x64test_t *test, rex_t rex, uintptr_t addr); uintptr_t TestDF(x64test_t *test, rex_t rex, uintptr_t addr); uintptr_t TestF0(x64test_t *test, rex_t rex, uintptr_t addr); uintptr_t TestF20F(x64test_t *test, rex_t rex, uintptr_t addr, int *step); -uintptr_t TestF30F(x64test_t *test, rex_t rex, uintptr_t addr); +uintptr_t TestF30F(x64test_t *test, rex_t rex, uintptr_t addr, int *step); uintptr_t TestAVX(x64test_t *test, vex_t vex, uintptr_t addr, int *step); uintptr_t TestAVX_0F(x64test_t *test, vex_t vex, uintptr_t addr, int *step); uintptr_t TestAVX_0F38(x64test_t *test, vex_t vex, uintptr_t addr, int *step); @@ -228,19 +166,6 @@ uintptr_t TestAVX_F20F3A(x64test_t *test, vex_t vex, uintptr_t addr, int *step); uintptr_t TestAVX_F30F38(x64test_t *test, vex_t vex, uintptr_t addr, int *step); uintptr_t TestAVX_F30F3A(x64test_t *test, vex_t vex, uintptr_t addr, int *step); -void x64Syscall(x64emu_t *emu); -void x64Int3(x64emu_t* emu, uintptr_t* addr); -x64emu_t* x64emu_fork(x64emu_t* e, int forktype); -void x86Syscall(x64emu_t *emu); //32bits syscall - -uintptr_t GetSegmentBaseEmu(x64emu_t* emu, int seg); -#define GetGSBaseEmu(emu) GetSegmentBaseEmu(emu, _GS) -#define GetFSBaseEmu(emu) GetSegmentBaseEmu(emu, _FS) -#define GetESBaseEmu(emu) GetSegmentBaseEmu(emu, _ES) -#define GetDSBaseEmu(emu) GetSegmentBaseEmu(emu, _DS) - -const char* GetNativeName(void* p); - #ifdef HAVE_TRACE void PrintTrace(x64emu_t* emu, uintptr_t ip, int dynarec); #endif diff --git a/src/emu/x64runavx.c b/src/emu/x64runavx.c index a4e3fc3..6a39e5a 100644 --- a/src/emu/x64runavx.c +++ b/src/emu/x64runavx.c @@ -12,7 +12,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,7 +20,6 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" #include "x64shaext.h" #ifdef DYNAREC #include "custommem.h" diff --git a/src/emu/x64runavx0f.c b/src/emu/x64runavx0f.c index 7bf0c30..fa45d68 100644 --- a/src/emu/x64runavx0f.c +++ b/src/emu/x64runavx0f.c @@ -5,14 +5,14 @@ #include #include #include -#include #include #include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,7 +21,7 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" +#include "emit_signals.h" #include "x64shaext.h" #ifdef DYNAREC #include "custommem.h" @@ -30,11 +30,6 @@ #include "modrm.h" -#ifdef __clang__ -extern int isinff(float); -extern int isnanf(float); -#endif - #ifdef TEST_INTERPRETER uintptr_t TestAVX_0F(x64test_t *test, vex_t vex, uintptr_t addr, int *step) #else @@ -52,6 +47,8 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) reg64_t *oped, *opgd; sse_regs_t *opex, *opgx, *opvx, eax1; sse_regs_t *opey, *opgy, *opvy, eay1; + uint8_t maskps[4]; + uint8_t nanmask[4]; #ifdef TEST_INTERPRETER x64emu_t *emu = test->emu; @@ -88,6 +85,9 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGY; EY->q[0] = GY->q[0]; EY->q[1] = GY->q[1]; + } else if(MODREG) { + GETEY; + EY->u128 = 0; } break; case 0x12: @@ -105,9 +105,13 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) break; case 0x13: /* VMOVLPS Ex, Gx */ nextop = F8; - GETEX(0); - GETGX; - EX->q[0] = GX->q[0]; + if(MODREG) { + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); + } else { + GETEX(0); + GETGX; + EX->q[0] = GX->q[0]; + } break; case 0x14: /* VUNPCKLPS Gx, Vx, Ex */ nextop = F8; @@ -147,7 +151,7 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GY->u128 = 0; break; case 0x16: - nextop = F8; + nextop = F8; GETEX(0); GETGX; GETVX; @@ -155,7 +159,7 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) if(MODREG) { /* VMOVLHPS Gx, Vx, Ex */ GX->q[1] = EX->q[0]; } else { - GX->q[1] = EX->q[0]; /* MOVHPS Gx,Ex */ + GX->q[1] = EX->q[0]; /* VMOVHPS Gx, Vx, Ex */ } GX->q[0] = VX->q[0]; GY->u128 = 0; @@ -165,6 +169,10 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEX(0); GETGX; EX->q[0] = GX->q[1]; + if(MODREG) { + GETEY; + EY->u128 = 0; + } break; case 0x28: /* VMOVAPS Gx, Ex */ @@ -193,20 +201,27 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGY; EY->q[0] = GY->q[0]; EY->q[1] = GY->q[1]; + } else if(MODREG) { + GETEY; + EY->u128 = 0; } break; case 0x2B: /* VMOVNTPS Ex,Gx */ nextop = F8; - GETEX(0); - GETGX; - EX->q[0] = GX->q[0]; - EX->q[1] = GX->q[1]; - if(vex.l) { - GETEY; - GETGY; - EY->q[0] = GY->q[0]; - EY->q[1] = GY->q[1]; + if(MODREG) { + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); + } else { + GETEX(0); + GETGX; + EX->q[0] = GX->q[0]; + EX->q[1] = GX->q[1]; + if(vex.l) { + GETEY; + GETGY; + EY->q[0] = GY->q[0]; + EY->q[1] = GY->q[1]; + } } break; @@ -245,12 +260,18 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) nextop = F8; GETEX(0); GETGX; GETGY; - for(int i=0; i<4; ++i) - GX->f[i] = (EX->f[i]<0)?(-NAN):sqrtf(EX->f[i]); + for (int i = 0; i < 4; ++i) + if (isnan(EX->f[i])) + GX->f[i] = EX->f[i]; + else + GX->f[i] = (EX->f[i] < 0) ? (-NAN) : sqrtf(EX->f[i]); if(vex.l) { GETEY; - for(int i=0; i<4; ++i) - GY->f[i] = (EY->f[i]<0)?(-NAN):sqrtf(EY->f[i]); + for (int i = 0; i < 4; ++i) + if (isnan(EY->f[i])) + GY->f[i] = EY->f[i]; + else + GY->f[i] = (EY->f[i] < 0) ? (-NAN) : sqrtf(EY->f[i]); } else GY->u128 = 0; break; @@ -260,7 +281,9 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETGY; for(int i=0; i<4; ++i) { - if(EX->f[i]==0) + if (isnan(EX->f[i])) + GX->f[i] = EX->f[i]; + else if (EX->f[i] == 0) GX->f[i] = 1.0f/EX->f[i]; else if (EX->f[i]<0) GX->f[i] = -NAN; @@ -274,7 +297,9 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) if(vex.l) { GETEY; for(int i=0; i<4; ++i) { - if(EY->f[i]==0) + if (isnan(EY->f[i])) + GY->f[i] = EY->f[i]; + else if (EY->f[i] == 0) GY->f[i] = 1.0f/EY->f[i]; else if (EY->f[i]<0) GY->f[i] = -NAN; @@ -287,25 +312,25 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) } } else GY->u128 = 0; - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; case 0x53: /* VRCPPS Gx, Ex */ nextop = F8; GETEX(0); GETGX; GETGY; for(int i=0; i<4; ++i) - GX->f[i] = 1.0f/EX->f[i]; + if (isnan(EX->f[i])) + GX->f[i] = EX->f[i]; + else + GX->f[i] = 1.0f / EX->f[i]; if(vex.l) { GETEY; for(int i=0; i<4; ++i) - GY->f[i] = 1.0f/EY->f[i]; + if (isnan(EY->f[i])) + GY->f[i] = EY->f[i]; + else + GY->f[i] = 1.0f / EY->f[i]; } else GY->u128 = 0; - #ifdef TEST_INTERPRETER - test->notest = 1; - #endif break; case 0x54: /* VANDPS Gx, Vx, Ex */ nextop = F8; @@ -372,13 +397,31 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; - for(int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { + if (isnan(VX->f[i]) || isnan(EX->f[i])) { + if (isnan(VX->f[i])) + GX->f[i] = VX->f[i]; + else + GX->f[i] = EX->f[i]; + continue; + } GX->f[i] = VX->f[i] + EX->f[i]; + if(isnan(GX->f[i])) GX->f[i] = -NAN; + } if(vex.l) { GETEY; GETVY; - for(int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { + if (isnan(VY->f[i]) || isnan(EY->f[i])) { + if (isnan(VY->f[i])) + GY->f[i] = VY->f[i]; + else + GY->f[i] = EY->f[i]; + continue; + } GY->f[i] = VY->f[i] + EY->f[i]; + if(isnan(GY->f[i])) GY->f[i] = -NAN; + } } else GY->u128 = 0; break; @@ -388,13 +431,31 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; - for(int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { + if (isnan(VX->f[i]) || isnan(EX->f[i])) { + if (isnan(VX->f[i])) + GX->f[i] = VX->f[i]; + else + GX->f[i] = EX->f[i]; + continue; + } GX->f[i] = VX->f[i] * EX->f[i]; + if (isnan(GX->f[i])) GX->ud[i] |= 0x80000000; + } if(vex.l) { GETEY; GETVY; - for(int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { + if (isnan(VY->f[i]) || isnan(EY->f[i])) { + if (isnan(VY->f[i])) + GY->f[i] = VY->f[i]; + else + GY->f[i] = EY->f[i]; + continue; + } GY->f[i] = VY->f[i] * EY->f[i]; + if (isnan(GY->f[i])) GY->ud[i] |= 0x80000000; + } } else GY->u128 = 0; break; @@ -403,8 +464,7 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEX(0); GETGX; GETGY; - if(vex.l) { - GETEY; + if (vex.l) { GY->d[1] = EX->f[3]; GY->d[0] = EX->f[2]; } else @@ -436,13 +496,31 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; - for(int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { + if (isnan(VX->f[i]) || isnan(EX->f[i])) { + if (isnan(VX->f[i])) + GX->f[i] = VX->f[i]; + else + GX->f[i] = EX->f[i]; + continue; + } GX->f[i] = VX->f[i] - EX->f[i]; + if (isnan(GX->f[i])) GX->ud[i] |= 0x80000000; + } if(vex.l) { GETEY; GETVY; - for(int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { + if (isnan(VY->f[i]) || isnan(EY->f[i])) { + if (isnan(VY->f[i])) + GY->f[i] = VY->f[i]; + else + GY->f[i] = EY->f[i]; + continue; + } GY->f[i] = VY->f[i] - EY->f[i]; + if (isnan(GY->f[i])) GY->ud[i] |= 0x80000000; + } } else GY->u128 = 0; break; @@ -453,7 +531,7 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETVX; GETGY; for(int i=0; i<4; ++i) - if (isnanf(VX->f[i]) || isnanf(EX->f[i]) || isgreater(VX->f[i], EX->f[i])) + if (isnanf(VX->f[i]) || isnanf(EX->f[i]) || islessequal(EX->f[i], VX->f[i])) GX->f[i] = EX->f[i]; else GX->f[i] = VX->f[i]; @@ -461,7 +539,7 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEY; GETVY; for(int i=0; i<4; ++i) - if (isnanf(VY->f[i]) || isnanf(EY->f[i]) || isgreater(VY->f[i], EY->f[i])) + if (isnanf(VY->f[i]) || isnanf(EY->f[i]) || islessequal(EY->f[i], VY->f[i])) GY->f[i] = EY->f[i]; else GY->f[i] = VY->f[i]; @@ -474,13 +552,31 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; - for(int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { + if (isnan(VX->f[i]) || isnan(EX->f[i])) { + if (isnan(VX->f[i])) + GX->f[i] = VX->f[i]; + else + GX->f[i] = EX->f[i]; + continue; + } GX->f[i] = VX->f[i] / EX->f[i]; + if (isnan(GX->f[i])) GX->ud[i] |= 0x80000000; + } if(vex.l) { GETEY; GETVY; - for(int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { + if (isnan(VY->f[i]) || isnan(EY->f[i])) { + if (isnan(VY->f[i])) + GY->f[i] = VY->f[i]; + else + GY->f[i] = EY->f[i]; + continue; + } GY->f[i] = VY->f[i] / EY->f[i]; + if (isnan(GY->f[i])) GY->ud[i] |= 0x80000000; + } } else GY->u128 = 0; break; @@ -491,7 +587,7 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETVX; GETGY; for(int i=0; i<4; ++i) - if (isnanf(VX->f[i]) || isnanf(EX->f[i]) || isgreater(EX->f[i], VX->f[i])) + if (isnanf(VX->f[i]) || isnanf(EX->f[i]) || isgreaterequal(EX->f[i], VX->f[i])) GX->f[i] = EX->f[i]; else GX->f[i] = VX->f[i]; @@ -499,7 +595,7 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEY; GETVY; for(int i=0; i<4; ++i) - if (isnanf(VY->f[i]) || isnanf(EY->f[i]) || isgreater(EY->f[i], VY->f[i])) + if (isnanf(VY->f[i]) || isnanf(EY->f[i]) || isgreaterequal(EY->f[i], VY->f[i])) GY->f[i] = EY->f[i]; else GY->f[i] = VY->f[i]; @@ -511,13 +607,13 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) case 0x77: if(!vex.l) { // VZEROUPPER if(vex.v!=0) { - emit_signal(emu, SIGILL, (void*)R_RIP, 0); + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); } else { memset(emu->ymm, 0, sizeof(sse_regs_t)*((vex.rex.is32bits)?8:16)); } } else { // VZEROALL if(vex.v!=0) { - emit_signal(emu, SIGILL, (void*)R_RIP, 0); + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); } else { memset(emu->xmm, 0, sizeof(sse_regs_t)*((vex.rex.is32bits)?8:16)); memset(emu->ymm, 0, sizeof(sse_regs_t)*((vex.rex.is32bits)?8:16)); @@ -535,7 +631,7 @@ uintptr_t RunAVX_0F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETED(0); emu->mxcsr.x32 = ED->dword[0]; #ifndef TEST_INTERPRETER - if(box64_sse_flushto0) + if(BOX64ENV(sse_flushto0)) applyFlushTo0(emu); #endif break; diff --git a/src/emu/x64runavx0f38.c b/src/emu/x64runavx0f38.c index 11e324c..50736ff 100644 --- a/src/emu/x64runavx0f38.c +++ b/src/emu/x64runavx0f38.c @@ -5,14 +5,14 @@ #include #include #include -#include #include #include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,7 +21,7 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" +#include "emit_signals.h" #ifdef DYNAREC #include "custommem.h" #include "../dynarec/native_lock.h" @@ -61,24 +61,27 @@ uintptr_t RunAVX_0F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) case 0xF2: /* ANDN Gd, Vd, Ed */ nextop = F8; - if(vex.l) emit_signal(emu, SIGILL, (void*)R_RIP, 0); + if(vex.l) EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); + ResetFlags(emu); GETGD; GETED(0); GETVD; if(rex.w) GD->q[0] = ED->q[0] & ~VD->q[0]; - else { - if(MODREG) - GD->q[0] = ED->dword[0] & ~VD->dword[0]; - else - GD->dword[0] = ED->dword[0] & ~VD->dword[0]; - } + else + GD->q[0] = ED->dword[0] & ~VD->dword[0]; + CONDITIONAL_SET_FLAG(GD->q[0]==0, F_ZF); + CONDITIONAL_SET_FLAG(rex.w?(GD->q[0]>>63):(GD->dword[0]>>31), F_SF); + CLEAR_FLAG(F_CF); + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_AF); // Undef + CLEAR_FLAG(F_PF); // Undef break; case 0xF3: nextop = F8; switch((nextop>>3)&7) { case 1: /* BLSR Vd, Ed */ - if(vex.l) emit_signal(emu, SIGILL, (void*)R_RIP, 0); + if(vex.l) EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); ResetFlags(emu); GETVD; GETED(0); @@ -86,17 +89,19 @@ uintptr_t RunAVX_0F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) if(rex.w) VD->q[0] = ED->q[0] & (ED->q[0]-1LL); else - VD->dword[0] = ED->dword[0] & (ED->dword[0]-1); - if(MODREG && !rex.w) - VD->dword[1] = 0; - CONDITIONAL_SET_FLAG(rex.w?(VD->q[0]==0):(VD->dword[0]==0), F_ZF); + VD->q[0] = ED->dword[0] & (ED->dword[0]-1); + CONDITIONAL_SET_FLAG(VD->q[0]==0, F_ZF); CONDITIONAL_SET_FLAG(rex.w?(VD->q[0]>>63):(VD->dword[0]>>31), F_SF); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_AF); // Undef - CLEAR_FLAG(F_PF); // Undef + if(BOX64ENV(cputype)) { + CLEAR_FLAG(F_PF); + } else { + CONDITIONAL_SET_FLAG(PARITY(VD->byte[0] & 0xff), F_PF); + } break; case 2: /* BLSMSK Vd, Ed */ - if(vex.l) emit_signal(emu, SIGILL, (void*)R_RIP, 0); + if(vex.l) EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); ResetFlags(emu); GETVD; GETED(0); @@ -104,32 +109,40 @@ uintptr_t RunAVX_0F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) if(rex.w) VD->q[0] = ED->q[0] ^ (ED->q[0]-1LL); else - VD->dword[0] = ED->dword[0] ^ (ED->dword[0]-1); - if(MODREG && !rex.w) - VD->dword[1] = 0; + VD->q[0] = ED->dword[0] ^ (ED->dword[0]-1); CONDITIONAL_SET_FLAG(rex.w?(VD->q[0]>>63):(VD->dword[0]>>31), F_SF); CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_OF); - CLEAR_FLAG(F_AF); // Undef - CLEAR_FLAG(F_PF); // Undef + // Undef flags + CLEAR_FLAG(F_AF); + if(BOX64ENV(cputype)) { + CLEAR_FLAG(F_PF); + } else { + CONDITIONAL_SET_FLAG(PARITY(VD->byte[0] & 0xff), F_PF); + } break; case 3: /* BLSI Vd, Ed */ - if(vex.l) emit_signal(emu, SIGILL, (void*)R_RIP, 0); + if(vex.l) EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); ResetFlags(emu); GETVD; GETED(0); - CONDITIONAL_SET_FLAG(rex.w?(ED->q[0]==0):(ED->dword[0]==0), F_CF); + CONDITIONAL_SET_FLAG(rex.w?(ED->q[0]!=0):(ED->dword[0]!=0), F_CF); if(rex.w) VD->sq[0] = ED->sq[0] & (-ED->sq[0]); else VD->sdword[0] = ED->sdword[0] & (-ED->sdword[0]); - if(MODREG && !rex.w) + if(!rex.w) VD->dword[1] = 0; CONDITIONAL_SET_FLAG(rex.w?(VD->q[0]==0):(VD->dword[0]==0), F_ZF); CONDITIONAL_SET_FLAG(rex.w?(VD->q[0]>>63):(VD->dword[0]>>31), F_SF); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_AF); // Undef - CLEAR_FLAG(F_PF); // Undef + if(BOX64ENV(cputype)) { + CLEAR_FLAG(F_PF); + } else { + CONDITIONAL_SET_FLAG(PARITY(VD->byte[0] & 0xff), F_PF); + } + break; default: return 0; @@ -138,7 +151,7 @@ uintptr_t RunAVX_0F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) case 0xF5: /* BZHI Gd, Ed, Vd */ nextop = F8; - if(vex.l) emit_signal(emu, SIGILL, (void*)R_RIP, 0); + if(vex.l) EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); GETGD; GETED(0); GETVD; @@ -153,15 +166,20 @@ uintptr_t RunAVX_0F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) CONDITIONAL_SET_FLAG((tmp32u>31), F_CF); } CONDITIONAL_SET_FLAG(rex.w?(GD->q[0]==0):(GD->dword[0]==0), F_ZF); - CONDITIONAL_SET_FLAG(rex.w?(VD->q[0]>>63):(VD->dword[0]>>31), F_SF); + CONDITIONAL_SET_FLAG(rex.w?(GD->q[0]>>63):(GD->dword[0]>>31), F_SF); CLEAR_FLAG(F_OF); - CLEAR_FLAG(F_AF); // Undef - CLEAR_FLAG(F_PF); // Undef + // UD flags + CLEAR_FLAG(F_AF); + if(BOX64ENV(cputype)) { + CLEAR_FLAG(F_PF); + } else { + CONDITIONAL_SET_FLAG(PARITY(VD->byte[0] & 0xff), F_PF); + } break; case 0xF7: /* BEXTR Gd, Ed, Vd */ nextop = F8; - if(vex.l) emit_signal(emu, SIGILL, (void*)R_RIP, 0); + if(vex.l) EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); ResetFlags(emu); GETGD; GETED(0); diff --git a/src/emu/x64runavx660f.c b/src/emu/x64runavx660f.c index 071547e..5570a97 100644 --- a/src/emu/x64runavx660f.c +++ b/src/emu/x64runavx660f.c @@ -5,14 +5,14 @@ #include #include #include -#include #include #include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,7 +21,7 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" +#include "emit_signals.h" #include "x64shaext.h" #ifdef DYNAREC #include "custommem.h" @@ -49,6 +49,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) sse_regs_t *opex, *opgx, *opvx, eax1; sse_regs_t *opey, *opgy, *opvy, eay1; int is_nan; + int mask_nan[4]; #ifdef TEST_INTERPRETER @@ -60,7 +61,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) switch(opcode) { - case 0x10: /* MOVUPD Gx, Ex */ + case 0x10: /* VMOVUPD Gx, Ex */ nextop = F8; GETEX(0); GETGX; @@ -72,7 +73,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) } else GY->u128 = 0; break; - case 0x11: /* MOVUPD Ex, Gx */ + case 0x11: /* VMOVUPD Ex, Gx */ nextop = F8; GETEX(0); GETGX; @@ -81,23 +82,30 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEY; GETGY; memcpy(EY, GY, 16); // unaligned... + } else if(MODREG) { + GETEY; + EY->u128 = 0; } break; case 0x12: /* VMOVLPD Gx, Vx, Eq */ nextop = F8; - GETE8(0); - GETGX; - GETVX; - GETGY; - GX->q[0] = ED->q[0]; - GX->q[1] = VX->q[1]; - GY->u128 = 0; + if(!MODREG) { + GETE8(0); + GETGX; + GETVX; + GETGY; + GX->q[0] = ED->q[0]; + GX->q[1] = VX->q[1]; + GY->u128 = 0; + } break; case 0x13: /* VMOVLPD Eq, Gx */ nextop = F8; - GETE8(0); - GETGX; - ED->q[0] = GX->q[0]; + if(!MODREG) { + GETE8(0); + GETGX; + ED->q[0] = GX->q[0]; + } break; case 0x14: /* VUNPCKLPD Gx, Vx, Ex */ nextop = F8; @@ -127,19 +135,23 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) break; case 0x16: /* VMOVHPD Gx, Vx, Ed */ nextop = F8; - GETE8(0); - GETGX; - GETVX; - GX->q[1] = ED->q[0]; - GX->q[0] = VX->q[0]; - GETGY; - GY->u128 = 0; + if(!MODREG) { + GETE8(0); + GETGX; + GETVX; + GX->q[1] = ED->q[0]; + GX->q[0] = VX->q[0]; + GETGY; + GY->u128 = 0; + } break; case 0x17: /* VMOVHPD Ed, Gx */ nextop = F8; - GETE8(0); - GETGX; - ED->q[0] = GX->q[1]; + if(!MODREG) { + GETE8(0); + GETGX; + ED->q[0] = GX->q[1]; + } break; case 0x28: /* VMOVAPD Gx, Ex */ @@ -167,20 +179,25 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGY; EY->q[0] = GY->q[0]; EY->q[1] = GY->q[1]; + } else if(MODREG) { + GETEY; + EY->u128 = 0; } break; case 0x2B: /* MOVNTPD Ex, Gx */ nextop = F8; - GETEX(0); - GETGX; - EX->q[0] = GX->q[0]; - EX->q[1] = GX->q[1]; - if(vex.l) { - GETGY; - GETEY; - EY->q[0] = GY->q[0]; - EY->q[1] = GY->q[1]; + if(!MODREG) { + GETEX(0); + GETGX; + EX->q[0] = GX->q[0]; + EX->q[1] = GX->q[1]; + if(vex.l) { + GETGY; + GETEY; + EY->q[0] = GY->q[0]; + EY->q[1] = GY->q[1]; + } } break; @@ -220,22 +237,18 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEX(0); GETGX; GETGY; for (int i=0; i<2; ++i) { - #ifndef NOALIGN if(EX->d[i]<0.0) // on x86, default nan are negative GX->d[i] = -NAN; // but input NAN are not touched (so sqrt(+nan) -> +nan) else - #endif - GX->d[i] = sqrt(EX->d[i]); + GX->d[i] = sqrt(EX->d[i]); } if(vex.l) { GETEY; for (int i=0; i<2; ++i) { - #ifndef NOALIGN if(EY->d[i]<0.0) GY->d[i] = -NAN; else - #endif - GY->d[i] = sqrt(EY->d[i]); + GY->d[i] = sqrt(EY->d[i]); } } else GY->u128 = 0; @@ -306,14 +319,20 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEX(0); GETGX; GETVX; - GX->d[0] = VX->d[0] + EX->d[0]; - GX->d[1] = VX->d[1] + EX->d[1]; + MARK_NAN_VD_2(VX, EX); + for(int i=0; i<2; ++i) { + GX->d[i] = VX->d[i] + EX->d[i]; + } + CHECK_NAN_VD(GX); GETGY; if(vex.l) { GETEY; GETVY; - GY->d[0] = VY->d[0] + EY->d[0]; - GY->d[1] = VY->d[1] + EY->d[1]; + MARK_NAN_VD_2(VY, EY); + for(int i=0; i<2; ++i) { + GY->d[i] = VY->d[i] + EY->d[i]; + } + CHECK_NAN_VD(GY); } else { GY->u128 = 0; } @@ -324,27 +343,19 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; + MARK_NAN_VD_2(VX, EX); for(int i=0; i<2; ++i) { - #ifndef NOALIGN - // mul generate a -NAN only if doing (+/-)inf * (+/-)0 - if((isinf(VX->d[i]) && EX->d[i]==0.0) || (isinf(EX->d[i]) && VX->d[i]==0.0)) - GX->d[i] = -NAN; - else - #endif GX->d[i] = VX->d[i] * EX->d[i]; } + CHECK_NAN_VD(GX); if(vex.l) { GETEY; GETVY; + MARK_NAN_VD_2(VY, EY); for(int i=0; i<2; ++i) { - #ifndef NOALIGN - // mul generate a -NAN only if doing (+/-)inf * (+/-)0 - if((isinf(VY->d[i]) && EY->d[i]==0.0) || (isinf(EY->d[i]) && VY->d[i]==0.0)) - GY->d[i] = -NAN; - else - #endif GY->d[i] = VY->d[i] * EY->d[i]; } + CHECK_NAN_VD(GY); } else GY->u128 = 0; break; @@ -434,14 +445,18 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEX(0); GETGX; GETVX; + MARK_NAN_VD_2(VX, EX); GX->d[0] = VX->d[0] - EX->d[0]; GX->d[1] = VX->d[1] - EX->d[1]; + CHECK_NAN_VD(GX); GETGY; if(vex.l) { GETEY; GETVY; + MARK_NAN_VD_2(VY, EY); GY->d[0] = VY->d[0] - EY->d[0]; GY->d[1] = VY->d[1] - EY->d[1]; + CHECK_NAN_VD(GY); } else { GY->u128 = 0; } @@ -453,7 +468,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETVX; GETGY; for(int i=0; i<2; ++i) - if (isnan(VX->d[i]) || isnan(EX->d[i]) || isgreater(VX->d[i], EX->d[i])) + if (isnan(VX->d[i]) || isnan(EX->d[i]) || islessequal(EX->d[i], VX->d[i])) GX->d[i] = EX->d[i]; else GX->d[i] = VX->d[i]; @@ -461,7 +476,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEY; GETVY; for(int i=0; i<2; ++i) - if (isnan(VY->d[i]) || isnan(EY->d[i]) || isgreater(VY->d[i], EY->d[i])) + if (isnan(VY->d[i]) || isnan(EY->d[i]) || islessequal(EY->d[i], VY->d[i])) GY->d[i] = EY->d[i]; else GY->d[i] = VY->d[i]; @@ -474,29 +489,19 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; + MARK_NAN_VD_2(VX, EX); for (int i=0; i<2; ++i) { - #ifndef NOALIGN - is_nan = isnan(VX->d[i]) || isnan(EX->d[i]); - #endif GX->d[i] = VX->d[i] / EX->d[i]; - #ifndef NOALIGN - if(!is_nan && isnan(GX->d[i])) - GX->d[i] = -NAN; - #endif } + CHECK_NAN_VD(GX); if(vex.l) { GETEY; GETVY; + MARK_NAN_VD_2(VY, EY); for (int i=0; i<2; ++i) { - #ifndef NOALIGN - is_nan = isnan(VY->d[i]) || isnan(EY->d[i]); - #endif GY->d[i] = VY->d[i] / EY->d[i]; - #ifndef NOALIGN - if(!is_nan && isnan(GY->d[i])) - GY->d[i] = -NAN; - #endif } + CHECK_NAN_VD(GY); } else GY->u128 = 0; break; @@ -507,7 +512,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETVX; GETGY; for(int i=0; i<2; ++i) - if (isnan(VX->d[i]) || isnan(EX->d[i]) || isgreater(EX->d[i], VX->d[i])) + if (isnan(VX->d[i]) || isnan(EX->d[i]) || isgreaterequal(EX->d[i], VX->d[i])) GX->d[i] = EX->d[i]; else GX->d[i] = VX->d[i]; @@ -515,7 +520,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEY; GETVY; for(int i=0; i<2; ++i) - if (isnan(VY->d[i]) || isnan(EY->d[i]) || isgreater(EY->d[i], VY->d[i])) + if (isnan(VY->d[i]) || isnan(EY->d[i]) || isgreaterequal(EY->d[i], VY->d[i])) GY->d[i] = EY->d[i]; else GY->d[i] = VY->d[i]; @@ -845,7 +850,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEY; GY->q[0] = EY->q[0]; GY->q[1] = EY->q[1]; - } else + } else GY->u128 = 0; break; case 0x70: /* VPSHUFD Gx,Ex,Ib */ @@ -861,7 +866,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) for (int i=0; i<4; ++i) GY->ud[i] = EY->ud[(tmp8u>>(i*2))&3]; } else - memset(GY, 0, 16); + GY->u128 = 0; if(EX==GX) {eax1 = *GX; EX = &eax1;} // copy is needed for (int i=0; i<4; ++i) GX->ud[i] = EX->ud[(tmp8u>>(i*2))&3]; @@ -976,29 +981,17 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) case 3: /* VPSRLDQ Vx, Ex, Ib */ tmp8u = F8; if(tmp8u>15) VX->u128 = 0; - else if (tmp8u!=0) { - u8=tmp8u*8; - if (u8 < 64) { - VX->q[0] = (EX->q[0] >> u8) | (EX->q[1] << (64 - u8)); - VX->q[1] = (EX->q[1] >> u8); - } else { - VX->q[0] = EX->q[1] >> (u8 - 64); - VX->q[1] = 0; - } - } else VX->u128 = EX->u128; + else if (tmp8u) + VX->u128 = EX->u128 >> (tmp8u<<3); + else + VX->u128 = EX->u128; if(vex.l) { GETEY; if(tmp8u>15) VY->u128 = 0; - else if (tmp8u!=0) { - u8=tmp8u*8; - if (u8 < 64) { - VY->q[0] = (EY->q[0] >> u8) | (EY->q[1] << (64 - u8)); - VY->q[1] = (EY->q[1] >> u8); - } else { - VY->q[0] = EY->q[1] >> (u8 - 64); - VY->q[1] = 0; - } - } else VY->u128 = EY->u128; + else if (tmp8u) + VY->u128 = EY->u128 >> (tmp8u<<3); + else + VY->u128 = EY->u128; } break; case 6: /* VPSLLQ Vx, Ex, Ib */ @@ -1016,30 +1009,16 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) case 7: /* VPSLLDQ Vx, Ex, Ib */ tmp8u = F8; if(tmp8u>15) VX->u128 = 0; - else if (tmp8u!=0) { - u8=tmp8u<<3; - if (u8 < 64) { - VX->q[1] = (EX->q[1] << u8) | (EX->q[0] >> (64 - u8)); - VX->q[0] = (EX->q[0] << u8); - } else { - VX->q[1] = EX->q[0] << (u8 - 64); - VX->q[0] = 0; - } - } else + else if (tmp8u!=0) + VX->u128 = EX->u128 << (tmp8u<<3); + else VX->u128 = EX->u128; if(vex.l) { GETEY; if(tmp8u>15) VY->u128 = 0; - else if (tmp8u!=0) { - u8=tmp8u<<3; - if (u8 < 64) { - VY->q[1] = (EY->q[1] << u8) | (EY->q[0] >> (64 - u8)); - VY->q[0] = (EY->q[0] << u8); - } else { - VY->q[1] = EY->q[0] << (u8 - 64); - VY->q[0] = 0; - } - } else + else if (tmp8u) + VY->u128 = EY->u128 << (tmp8u<<3); + else VY->u128 = EY->u128; } break; @@ -1107,25 +1086,17 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) eax1 = *EX; EX = &eax1; } - #ifndef NOALIGN is_nan = isnan(VX->d[0]) || isnan(VX->d[1]); - #endif GX->d[0] = VX->d[0] + VX->d[1]; - #ifndef NOALIGN if(!is_nan && isnan(GX->d[0])) GX->d[0] = -NAN; - #endif if(EX==VX) { GX->d[1] = GX->d[0]; } else { - #ifndef NOALIGN is_nan = isnan(EX->d[0]) || isnan(EX->d[1]); - #endif GX->d[1] = EX->d[0] + EX->d[1]; - #ifndef NOALIGN if(!is_nan && isnan(GX->d[1])) GX->d[1] = -NAN; - #endif } if(vex.l) { if(GY==EY) { @@ -1133,25 +1104,17 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) EY = &eay1; } GETVY; - #ifndef NOALIGN is_nan = isnan(VY->d[0]) || isnan(VY->d[1]); - #endif GY->d[0] = VY->d[0] + VY->d[1]; - #ifndef NOALIGN if(!is_nan && isnan(GY->d[0])) GY->d[0] = -NAN; - #endif if(EY==VY) { GY->d[1] = GY->d[0]; } else { - #ifndef NOALIGN is_nan = isnan(EY->d[0]) || isnan(EY->d[1]); - #endif GY->d[1] = EY->d[0] + EY->d[1]; - #ifndef NOALIGN if(!is_nan && isnan(GY->d[1])) GY->d[1] = -NAN; - #endif } } else GY->u128 = 0; @@ -1167,25 +1130,17 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) eax1 = *EX; EX = &eax1; } - #ifndef NOALIGN is_nan = isnan(VX->d[0]) || isnan(VX->d[1]); - #endif GX->d[0] = VX->d[0] - VX->d[1]; - #ifndef NOALIGN if(!is_nan && isnan(GX->d[0])) GX->d[0] = -NAN; - #endif if(EX==VX) { GX->d[1] = GX->d[0]; } else { - #ifndef NOALIGN is_nan = isnan(EX->d[0]) || isnan(EX->d[1]); - #endif GX->d[1] = EX->d[0] - EX->d[1]; - #ifndef NOALIGN if(!is_nan && isnan(GX->d[1])) GX->d[1] = -NAN; - #endif } if(vex.l) { if(GY==EY) { @@ -1193,25 +1148,17 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) EY = &eay1; } GETVY; - #ifndef NOALIGN is_nan = isnan(VY->d[0]) || isnan(VY->d[1]); - #endif GY->d[0] = VY->d[0] - VY->d[1]; - #ifndef NOALIGN if(!is_nan && isnan(GY->d[0])) GY->d[0] = -NAN; - #endif if(EY==VY) { GY->d[1] = GY->d[0]; } else { - #ifndef NOALIGN is_nan = isnan(EY->d[0]) || isnan(EY->d[1]); - #endif GY->d[1] = EY->d[0] - EY->d[1]; - #ifndef NOALIGN if(!is_nan && isnan(GY->d[1])) GY->d[1] = -NAN; - #endif } } else GY->u128 = 0; @@ -1240,7 +1187,10 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEY; EY->q[0] = GY->q[0]; EY->q[1] = GY->q[1]; - } // no upper raz? + } else if(MODREG) { + GETEY; + EY->u128 = 0; + } break; case 0xC2: /* VCMPPD Gx, Vx, Ex, Ib */ @@ -1347,13 +1297,17 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; + MARK_NAN_VD_2(VX, EX); GX->d[0] = VX->d[0] - EX->d[0]; GX->d[1] = VX->d[1] + EX->d[1]; + CHECK_NAN_VD(GX); if(vex.l) { GETEY; GETVY; + MARK_NAN_VD_2(VY, EY); GY->d[0] = VY->d[0] - EY->d[0]; GY->d[1] = VY->d[1] + EY->d[1]; + CHECK_NAN_VD(GY); } else GY->u128 = 0; break; @@ -1367,7 +1321,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) else {tmp8u=tmp64u; for (int i=0; i<8; ++i) GX->uw[i] = VX->uw[i] >> tmp8u;} if(vex.l) { - GETEY; GETVY; + GETVY; if(tmp64u>15) GY->u128 = 0; else {tmp8u=tmp64u; for (int i=0; i<8; ++i) GY->uw[i] = VY->uw[i] >> tmp8u;} @@ -1384,7 +1338,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) else {tmp8u=tmp64u; for (int i=0; i<4; ++i) GX->ud[i] = VX->ud[i] >> tmp8u;} if(vex.l) { - GETEY; GETVY; + GETVY; if(tmp64u>31) GY->u128 = 0; else {tmp8u=tmp64u; for (int i=0; i<4; ++i) GY->ud[i] = VY->ud[i] >> tmp8u;} @@ -1401,7 +1355,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) else {tmp8u=tmp64u; for (int i=0; i<2; ++i) GX->q[i] = VX->q[i] >> tmp8u;} if(vex.l) { - GETEY; GETVY; + GETVY; if(tmp64u>63) GY->u128 = 0; else {tmp8u=tmp64u; for (int i=0; i<2; ++i) GY->q[i] = VY->q[i] >> tmp8u;} @@ -1452,7 +1406,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) EY->u128 = 0; } break; - case 0xD7: /* PMOVMSKB Gd,Ex */ + case 0xD7: /* VPMOVMSKB Gd,Ex */ nextop = F8; if(MODREG) { GETEX(0); @@ -1638,7 +1592,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) for (int i=0; i<8; ++i) GX->sw[i] = VX->sw[i] >> tmp8u; if(vex.l) { - GETEY; GETVY; + GETVY; for (int i=0; i<8; ++i) GY->sw[i] = VY->sw[i] >> tmp8u; } else @@ -1714,22 +1668,22 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEX(0); GETGX; GETGY; - if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>0x7fffffff) - GX->sd[0] = 0x80000000; + if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>(double)0x7fffffff) + GX->ud[0] = 0x80000000; else GX->sd[0] = EX->d[0]; - if(isnan(EX->d[1]) || isinf(EX->d[1]) || EX->d[1]>0x7fffffff) - GX->sd[1] = 0x80000000; + if(isnan(EX->d[1]) || isinf(EX->d[1]) || EX->d[1]>(double)0x7fffffff) + GX->ud[1] = 0x80000000; else GX->sd[1] = EX->d[1]; if(vex.l) { GETEY; - if(isnan(EY->d[0]) || isinf(EY->d[0]) || EY->d[0]>0x7fffffff) - GX->sd[2] = 0x80000000; + if(isnan(EY->d[0]) || isinf(EY->d[0]) || EY->d[0]>(double)0x7fffffff) + GX->ud[2] = 0x80000000; else GX->sd[2] = EY->d[0]; - if(isnan(EY->d[1]) || isinf(EY->d[1]) || EY->d[1]>0x7fffffff) - GX->sd[3] = 0x80000000; + if(isnan(EY->d[1]) || isinf(EY->d[1]) || EY->d[1]>(double)0x7fffffff) + GX->ud[3] = 0x80000000; else GX->sd[3] = EY->d[1]; } else @@ -1738,18 +1692,20 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) break; case 0xE7: /* VMOVNTDQ Ex, Gx */ nextop = F8; - GETEX(0); - GETGX; - EX->q[0] = GX->q[0]; - EX->q[1] = GX->q[1]; - if(vex.l) { - GETEY; - GETGY; - EY->q[0] = GY->q[0]; - EY->q[1] = GY->q[1]; + if(!MODREG) { + GETEX(0); + GETGX; + EX->q[0] = GX->q[0]; + EX->q[1] = GX->q[1]; + if(vex.l) { + GETEY; + GETGY; + EY->q[0] = GY->q[0]; + EY->q[1] = GY->q[1]; + } } break; - case 0xE8: /* VSUBSB Gx, Vx, Ex */ + case 0xE8: /* VPSUBSB Gx, Vx, Ex */ nextop = F8; GETEX(0); GETGX; @@ -1902,11 +1858,11 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) else {tmp8u=EX->ub[0]; for (int i=0; i<8; ++i) GX->uw[i] = VX->uw[i]<q[0]>15) + GETVY; + if(EX->q[0]>15) GY->u128 = 0; else - {tmp8u=EY->ub[0]; for (int i=0; i<8; ++i) GY->uw[i] = VY->uw[i]<uw[i] = VY->uw[i]<u128 = 0; break; @@ -1919,11 +1875,11 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) else {tmp8u=EX->ub[0]; for (int i=0; i<4; ++i) GX->ud[i] = VX->ud[i]<q[0]>31) + GETVY; + if(EX->q[0]>31) GY->u128 = 0; else - {tmp8u=EY->ub[0]; for (int i=0; i<4; ++i) GY->ud[i] = VY->ud[i]<ud[i] = VY->ud[i]<u128 = 0; break; @@ -1936,11 +1892,11 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) else {tmp8u=EX->ub[0]; for (int i=0; i<2; ++i) GX->q[i] = VX->q[i]<q[0]>63) + GETVY; + if(EX->q[0]>63) GY->u128 = 0; else - {tmp8u=EY->ub[0]; for (int i=0; i<2; ++i) GY->q[i] = VY->q[i]<q[i] = VY->q[i]<u128 = 0; break; @@ -2000,7 +1956,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) case 0xF7: /* VMASKMOVDQU Gx, Ex */ nextop = F8; if(vex.l) { - emit_signal(emu, SIGILL, (void*)R_RIP, 0); + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); } GETEX(0); GETGX; @@ -2011,7 +1967,7 @@ uintptr_t RunAVX_660F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) } // no raz of upper ymm break; - case 0xF8: /* VSUBB Gx, Vx, Ex */ + case 0xF8: /* VPSUBB Gx, Vx, Ex */ nextop = F8; GETEX(0); GETGX; diff --git a/src/emu/x64runavx660f38.c b/src/emu/x64runavx660f38.c index 084a323..f53c4b7 100644 --- a/src/emu/x64runavx660f38.c +++ b/src/emu/x64runavx660f38.c @@ -5,14 +5,14 @@ #include #include #include -#include #include #include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,7 +21,7 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" +#include "emit_signals.h" #include "x64shaext.h" #ifdef DYNAREC #include "custommem.h" @@ -472,23 +472,21 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) nextop = F8; GETEX(0); GETGX; - if(vex.l) {GETEY; GETGY;} - // ZF - u8 = 0; - for(int i=0; i<4 && !u8; ++i) - u8 |= ((EX->ud[i]>>31)&(GX->ud[i]>>31)); - if(vex.l && !u8) - for(int i=0; i<4 && !u8; ++i) - u8 |= ((EY->ud[i]>>31)&(GY->ud[i]>>31)); + RESET_FLAGS(emu); + u8 = 0; tmp8u = 0; + for(int i=0; i<4; ++i) { + if((GX->ud[i]&EX->ud[i])>>31) u8 = 1; + if(((~GX->ud[i])&EX->ud[i])>>31) tmp8u = 1; + } + if(vex.l) { + GETEY; GETGY; + for(int i=0; i<4; ++i) { + if((GY->ud[i]&EY->ud[i])>>31) u8 = 1; + if(((~GY->ud[i])&EY->ud[i])>>31) tmp8u = 1; + } + } CONDITIONAL_SET_FLAG(!u8, F_ZF); - // CF - u8 = 0; - for(int i=0; i<4 && !u8; ++i) - u8 |= ((EX->ud[i]>>31)&((~GX->ud[i])>>31)); - if(vex.l && !u8) - for(int i=0; i<4 && !u8; ++i) - u8 |= ((EY->ud[i]>>31)&((~GY->ud[i])>>31)); - CONDITIONAL_SET_FLAG(!u8, F_CF); + CONDITIONAL_SET_FLAG(!tmp8u, F_CF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_SF); @@ -498,23 +496,21 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) nextop = F8; GETEX(0); GETGX; - if(vex.l) {GETEY; GETGY;} - // ZF - u8 = 0; - for(int i=0; i<2 && !u8; ++i) - u8 |= ((EX->q[i]>>63)&(GX->q[i]>>63)); - if(vex.l && !u8) - for(int i=0; i<2 && !u8; ++i) - u8 |= ((EY->q[i]>>63)&(GY->q[i]>>63)); + RESET_FLAGS(emu); + u8 = 0; tmp8u = 0; + for(int i=0; i<2; ++i) { + if((GX->q[i]&EX->q[i])>>63) u8 = 1; + if(((~GX->q[i])&EX->q[i])>>63) tmp8u = 1; + } + if(vex.l) { + GETEY; GETGY; + for(int i=0; i<2; ++i) { + if((GY->q[i]&EY->q[i])>>63) u8 = 1; + if(((~GY->q[i])&EY->q[i])>>63) tmp8u = 1; + } + } CONDITIONAL_SET_FLAG(!u8, F_ZF); - // CF - u8 = 0; - for(int i=0; i<2 && !u8; ++i) - u8 |= ((EX->q[i]>>63)&((~GX->q[i])>>63)); - if(vex.l && !u8) - for(int i=0; i<2 && !u8; ++i) - u8 |= ((EY->q[i]>>63)&((~GY->q[i])>>63)); - CONDITIONAL_SET_FLAG(!u8, F_CF); + CONDITIONAL_SET_FLAG(!tmp8u, F_CF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_SF); @@ -543,7 +539,7 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEY; GETGY; GETVY; - if(!vex.l) emit_signal(emu, SIGILL, (void*)R_RIP, 0); + if(!vex.l) EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); if(GX==EX) { eax1 = *EX; EX = &eax1; @@ -572,8 +568,8 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) RESET_FLAGS(emu); if(vex.l) { GETEY; GETGY; - CONDITIONAL_SET_FLAG(!(GY->u128&EY->u128), F_ZF); - CONDITIONAL_SET_FLAG(!((~GY->u128)&EY->u128), F_CF); + CONDITIONAL_SET_FLAG(!(GY->u128&EY->u128) && !(GX->u128&EX->u128), F_ZF); + CONDITIONAL_SET_FLAG(!((~GY->u128)&EY->u128) && !((~GX->u128)&EX->u128), F_CF); } else { CONDITIONAL_SET_FLAG(!(GX->u128&EX->u128), F_ZF); CONDITIONAL_SET_FLAG(!((~GX->u128)&EX->u128), F_CF); @@ -781,17 +777,19 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) break; case 0x2A: /* VMOVNTDQA Gx, Ex */ nextop = F8; - GETEX(0); - GETGX; - GETGY; - GX->q[0] = EX->q[0]; - GX->q[1] = EX->q[1]; - if(vex.l) { - GETEY; - GY->q[0] = EY->q[0]; - GY->q[1] = EY->q[1]; - } else - GY->u128 = 0; + if(!MODREG) { + GETEX(0); + GETGX; + GETGY; + GX->q[0] = EX->q[0]; + GX->q[1] = EX->q[1]; + if(vex.l) { + GETEY; + GY->q[0] = EY->q[0]; + GY->q[1] = EY->q[1]; + } else + GY->u128 = 0; + } break; case 0x2B: /* VPACKUSDW Gx, Vx, Ex */ nextop = F8; @@ -829,6 +827,8 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) break; case 0x2C: /*VMASKMOVPS Gx, Vx, Ex */ nextop = F8; + if(MODREG) + return 0; GETEX(0); GETGX; GETVX; @@ -845,6 +845,8 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) break; case 0x2D: /*VMASKMOVPD Gx, Vx, Ex */ nextop = F8; + if(MODREG) + return 0; GETEX(0); GETGX; GETVX; @@ -861,6 +863,8 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) break; case 0x2E: /*VMASKMOVPS Ex, Vx, Gx */ nextop = F8; + if(MODREG) + return 0; GETEX(0); GETGX; GETVX; @@ -881,6 +885,8 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) break; case 0x2F: /*VMASKMOVPD Ex, Vx, Gx */ nextop = F8; + if(MODREG) + return 0; GETEX(0); GETGX; GETVX; @@ -986,7 +992,7 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEY; GETGY; GETVY; - if(!vex.l) emit_signal(emu, SIGILL, (void*)R_RIP, 0); + if(!vex.l) EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); if(GX==EX) { eax1 = *EX; EX = &eax1; @@ -1157,7 +1163,7 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) } else GY->u128 = 0; break; - case 0x41: /* PHMINPOSUW Gx, Ex */ + case 0x41: /* VPHMINPOSUW Gx, Ex */ nextop = F8; GETEX(0); GETGX; @@ -1322,7 +1328,7 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GY->u128 = 0; break; - case 0x8C: /*VMASKMOVD/Q Gx, Vx, Ex */ + case 0x8C: /*VPMASKMOVD/Q Gx, Vx, Ex */ nextop = F8; GETEX(0); GETGX; @@ -1350,7 +1356,7 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GY->u128 = 0; } break; - case 0x8E: /*VMASKMOVD/Q Ex, Vx, Gx */ + case 0x8E: /*VPMASKMOVD/Q Ex, Vx, Gx */ nextop = F8; GETEX(0); GETGX; @@ -1378,11 +1384,11 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) } break; - case 0x90: /* VPGATHERDD Gx, VSIB, Vx */ + case 0x90: /* VPGATHERDD/VPGATHERDQ Gx, VSIB, Vx */ case 0x92: /* VGATHERDPD/VGATHERDPS Gx, VSIB, Vx */ nextop = F8; if(((nextop&7)!=4) || MODREG) { - emit_signal(emu, SIGILL, (void*)R_RIP, 0); + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); } GETGX; GETVX; @@ -1412,13 +1418,17 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) if(rex.w) { for(int i=0; i<2; ++i) if(VX->q[i]) { - GX->q[i] = *(uint64_t*)(tmp64u + (EX->sd[i]<sd[i]<q[i] = *(uint64_t*)data_addr; VX->q[i] = 0; } } else { for(int i=0; i<4; ++i) if(VX->ud[i]) { - GX->ud[i] = *(uint32_t*)(tmp64u + (EX->sd[i]<sd[i]<ud[i] = *(uint32_t*)data_addr; VX->ud[i] = 0; } } @@ -1432,24 +1442,28 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) if(rex.w) { for(int i=0; i<2; ++i) if(VY->q[i]) { - GY->q[i] = *(uint64_t*)(tmp64u + (EX->sd[2+i]<sd[2+i]<q[i] = *(uint64_t*)data_addr; VY->q[i] = 0; } } else { for(int i=0; i<4; ++i) if(VY->ud[i]) { - GY->ud[i] = *(uint32_t*)(tmp64u + (EY->sd[i]<sd[i]<ud[i] = *(uint32_t*)data_addr; VY->ud[i] = 0; } } } else GY->u128 = 0; break; - case 0x91: /* VPGATHERQD Gx, VSIB, Vx */ + case 0x91: /* VPGATHERQD/VPGATHERQQ Gx, VSIB, Vx */ case 0x93: /* VGATHERQPD/VGATHERQPS Gx, VSIB, Vx */ nextop = F8; if(((nextop&7)!=4) || MODREG) { - emit_signal(emu, SIGILL, (void*)R_RIP, 0); + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); } GETGX; GETVX; @@ -1482,13 +1496,17 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) if(rex.w) { for(int i=0; i<2; ++i) if(VX->q[i]) { - GX->q[i] = *(uint64_t*)(tmp64u + (EX->sq[i]<sq[i]<q[i] = *(uint64_t*)data_addr; VX->q[i] = 0; } } else { for(int i=0; i<(vex.l?4:2); ++i) if(VX->ud[i]) { - GX->ud[i] = *(uint32_t*)(tmp64u + (((i>1)?EY->sq[i-2]:EX->sq[i])<1)?EY->sq[i-2]:EX->sq[i])<ud[i] = *(uint32_t*)data_addr; VX->ud[i] = 0; } } @@ -1501,7 +1519,9 @@ uintptr_t RunAVX_660F38(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) if(rex.w) { for(int i=0; i<2; ++i) if(VY->q[i]) { - GY->q[i] = *(uint64_t*)(tmp64u + (EY->sq[i]<sq[i]<q[i] = *(uint64_t*)data_addr; VY->q[i] = 0; } } else { diff --git a/src/emu/x64runavx660f3a.c b/src/emu/x64runavx660f3a.c index 4a5ea45..5c0a978 100644 --- a/src/emu/x64runavx660f3a.c +++ b/src/emu/x64runavx660f3a.c @@ -5,14 +5,14 @@ #include #include #include -#include #include #include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,7 +21,7 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" +#include "emit_signals.h" #include "x64shaext.h" #include "x64compstrings.h" #ifdef DYNAREC @@ -99,7 +99,7 @@ uintptr_t RunAVX_660F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGY; GETEY; u8 = F8; - if(!vex.l) emit_signal(emu, SIGILL, (void*)R_RIP, 0); + if(!vex.l) EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); if(GX==EX) { eax1 = *EX; EX = &eax1; @@ -175,44 +175,6 @@ uintptr_t RunAVX_660F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) } else GY->u128 = 0; break; - case 0x06: /* VPERM2F128 Gx, Vx, Ex, Imm8 */ - nextop = F8; - GETEX(1); - GETGX; - GETVX; - GETEY; - GETGY; - GETVY; - u8 = F8; - if(!vex.l) emit_signal(emu, SIGILL, (void*)R_RIP, 0); - if(GX==EX) { - eax1 = *EX; - EX = &eax1; - eay1 = *EY; - EY = &eay1; - } - if(GX==VX) { - eax2 = *VX; - VX = &eax2; - eay2 = *VY; - VY = &eay2; - } - switch(u8&0x0f) { - case 0 : GX->u128 = VX->u128; break; - case 1 : GX->u128 = VY->u128; break; - case 2 : GX->u128 = EX->u128; break; - case 3 : GX->u128 = EY->u128; break; - default: GX->u128 = 0; break; - } - switch((u8>>4)&0x0f) { - case 0 : GY->u128 = VX->u128; break; - case 1 : GY->u128 = VY->u128; break; - case 2 : GY->u128 = EX->u128; break; - case 3 : GY->u128 = EY->u128; break; - default: GY->u128 = 0; break; - } - break; - case 0x08: // VROUNDPS Gx, Ex, u8 nextop = F8; GETEX(1); @@ -535,7 +497,7 @@ uintptr_t RunAVX_660F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GY->u128 = VY->u128; } break; - case 0x19: /* VEXTRACT128 Ex, Gx, imm8 */ + case 0x19: /* VEXTRACTF128 Ex, Gx, imm8 */ nextop = F8; GETEX(1); GETGX; @@ -685,18 +647,8 @@ uintptr_t RunAVX_660F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) tmpd += VX->d[1]*EX->d[1]; GX->d[0] = (tmp8u&(1<<(0)))?tmpd:0.0; GX->d[1] = (tmp8u&(1<<(1)))?tmpd:0.0; - if(vex.l) { - GETEY; - GETVY; - tmpd = 0.0; - if(tmp8u&(1<<(4+0))) - tmpd += VY->d[0]*EY->d[0]; - if(tmp8u&(1<<(4+1))) - tmpd += VY->d[1]*EY->d[1]; - GY->d[0] = (tmp8u&(1<<(0)))?tmpd:0.0; - GY->d[1] = (tmp8u&(1<<(1)))?tmpd:0.0; - } else - GY->u128 = 0; + // no 256bits form, for some reason + GY->u128 = 0; break; case 0x42: /* VMPSADBW Gx, Vx, Ex, Ib */ nextop = F8; @@ -768,6 +720,7 @@ uintptr_t RunAVX_660F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GY->u128 = 0; break; + case 0x06: /* VPERM2F128 Gx, Vx, Ex, Imm8 */ case 0x46: /* VPERM2I128 Gx, Vx, Ex, Imm8 */ nextop = F8; GETEX(1); @@ -777,7 +730,7 @@ uintptr_t RunAVX_660F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGY; GETVY; u8 = F8; - if(!vex.l) emit_signal(emu, SIGILL, (void*)R_RIP, 0); + if(!vex.l) EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); if(GX==EX) { eax1 = *EX; EX = &eax1; @@ -790,14 +743,14 @@ uintptr_t RunAVX_660F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) eay2 = *VY; VY = &eay2; } - switch(u8&0x0f) { + switch(u8&0b1011) { case 0 : GX->u128 = VX->u128; break; case 1 : GX->u128 = VY->u128; break; case 2 : GX->u128 = EX->u128; break; case 3 : GX->u128 = EY->u128; break; default: GX->u128 = 0; break; } - switch((u8>>4)&0x0f) { + switch((u8>>4)&0b1011) { case 0 : GY->u128 = VX->u128; break; case 1 : GY->u128 = VY->u128; break; case 2 : GY->u128 = EX->u128; break; @@ -840,7 +793,7 @@ uintptr_t RunAVX_660F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) } else GY->u128 = 0; break; - case 0x4C: /* VBLENDPVB Gx, Vx, Ex, XMM/u8 */ + case 0x4C: /* VPBLENDVB Gx, Vx, Ex, XMM/u8 */ nextop = F8; GETEX(1); GETGX; @@ -875,8 +828,8 @@ uintptr_t RunAVX_660F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) } else { emu->xmm[0].q[1] = emu->xmm[0].q[0] = 0; emu->xmm[0].uw[0] = tmp32u; - emu->ymm[0].u128 = 0; } + emu->ymm[0].u128 = 0; break; case 0x61: /* VPCMPESTRI */ nextop = F8; @@ -905,8 +858,8 @@ uintptr_t RunAVX_660F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) } else { emu->xmm[0].q[1] = emu->xmm[0].q[0] = 0; emu->xmm[0].uw[0] = tmp32u; - emu->ymm[0].u128 = 0; } + emu->ymm[0].u128 = 0; break; case 0x63: /* VPCMPISTRI */ nextop = F8; diff --git a/src/emu/x64runavxf20f.c b/src/emu/x64runavxf20f.c index a6224f5..621bde2 100644 --- a/src/emu/x64runavxf20f.c +++ b/src/emu/x64runavxf20f.c @@ -12,7 +12,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,7 +20,6 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" #include "x64shaext.h" #ifdef DYNAREC #include "custommem.h" @@ -49,6 +47,7 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) sse_regs_t *opex, *opgx, *opvx, eax1; sse_regs_t *opey, *opgy, *opvy, eay1; int is_nan; + int mask_nan[4]; #ifdef TEST_INTERPRETER @@ -116,15 +115,15 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) case 0x2C: /* VCVTTSD2SI Gd, Ex */ nextop = F8; - GETEX(0); + _GETEX(0); GETGD; if(rex.w) - if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>0x7fffffffffffffffLL) + if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>=(double)0x7fffffffffffffffLL) GD->q[0] = 0x8000000000000000LL; else GD->sq[0] = EX->d[0]; else { - if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>0x7fffffff) + if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>(double)0x7fffffff) GD->dword[0] = 0x80000000; else GD->sdword[0] = EX->d[0]; @@ -133,10 +132,10 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) break; case 0x2D: /* VCVTSD2SI Gd, Ex */ nextop = F8; - GETEX(0); + _GETEX(0); GETGD; if(rex.w) { - if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>0x7fffffffffffffffLL) + if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>=(double)0x7fffffffffffffffLL) GD->q[0] = 0x8000000000000000LL; else switch(emu->mxcsr.f.MXCSR_RC) { @@ -158,7 +157,7 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) break; } } else { - if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>0x7fffffff) + if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>(double)0x7fffffff) GD->dword[0] = 0x80000000; else switch(emu->mxcsr.f.MXCSR_RC) { @@ -189,6 +188,8 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; if(EX->d[0]<0.0 ) GX->d[0] = -NAN; + else if(isnan(EX->d[0])) + GX->d[0] = EX->d[0]; else GX->d[0] = sqrt(EX->d[0]); GX->q[1] = VX->q[1]; @@ -197,27 +198,25 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) case 0x58: /* VADDSD Gx, Vx, Ex */ nextop = F8; - GETEX(0); + _GETEX(0); GETGX; GETVX; GETGY; + MARK_NAN_D_2(VX, EX); GX->d[0] = VX->d[0] + EX->d[0]; + CHECK_NAN_D(GX); GX->q[1] = VX->q[1]; GY->u128 = 0; break; case 0x59: /* VMULSD Gx, Vx, Ex */ nextop = F8; - GETEX(0); + _GETEX(0); GETGX; GETVX; GETGY; - #ifndef NOALIGN - // mul generate a -NAN only if doing (+/-)inf * (+/-)0 - if((isinf(GX->d[0]) && EX->d[0]==0.0) || (isinf(EX->d[0]) && GX->d[0]==0.0)) - GX->d[0] = -NAN; - else - #endif + MARK_NAN_D_2(VX, EX); GX->d[0] = VX->d[0] * EX->d[0]; + CHECK_NAN_D(GX); if(GX!=VX) { GX->q[1] = VX->q[1]; } @@ -225,7 +224,7 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) break; case 0x5A: /* VCVTSD2SS Gx, Vx, Ex */ nextop = F8; - GETEX(0); + _GETEX(0); GETGX; GETVX; GETGY; @@ -237,7 +236,7 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) case 0x5C: /* VSUBSD Gx, Vx, Ex */ nextop = F8; - GETEX(0); + _GETEX(0); GETGX; GETVX; GETGY; @@ -251,9 +250,7 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; - if (VX->d[0] == 0.0 && EX->d[0] == 0.0) - GX->d[0] = EX->d[0]; - else if (isnan(VX->d[0]) || isnan(EX->d[0]) || isgreater(VX->d[0], EX->d[0])) + if (isnan(VX->d[0]) || isnan(EX->d[0]) || islessequal(EX->d[0], VX->d[0])) GX->d[0] = EX->d[0]; else GX->d[0] = VX->d[0]; @@ -283,9 +280,7 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; - if (VX->d[0] == 0.0 && EX->d[0] == 0.0) - GX->d[0] = EX->d[0]; - else if (isnan(VX->d[0]) || isnan(EX->d[0]) || isgreater(EX->d[0], VX->d[0])) + if (isnan(VX->d[0]) || isnan(EX->d[0]) || isgreaterequal(EX->d[0], VX->d[0])) GX->d[0] = EX->d[0]; else GX->d[0] = VX->d[0]; @@ -333,30 +328,44 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) eax1 = *EX; EX = &eax1; } - GX->f[0] = VX->f[0] + VX->f[1]; - GX->f[1] = VX->f[2] + VX->f[3]; + mask_nan[0] = isnanf(VX->f[0]) || isnanf(VX->f[1]); + mask_nan[1] = isnanf(VX->f[2]) || isnanf(VX->f[3]); + GX->f[0] = isnan(VX->f[0]) ? VX->f[0] : (isnan(VX->f[1]) ? VX->f[1] : (VX->f[0] + VX->f[1])); + GX->f[1] = isnan(VX->f[2]) ? VX->f[2] : (isnan(VX->f[3]) ? VX->f[3] : (VX->f[2] + VX->f[3])); if(EX==VX) { GX->f[2] = GX->f[0]; GX->f[3] = GX->f[1]; + mask_nan[2] = mask_nan[0]; + mask_nan[3] = mask_nan[1]; } else { - GX->f[2] = EX->f[0] + EX->f[1]; - GX->f[3] = EX->f[2] + EX->f[3]; + mask_nan[2] = isnanf(EX->f[0]) || isnanf(EX->f[1]); + mask_nan[3] = isnanf(EX->f[2]) || isnanf(EX->f[3]); + GX->f[2] = isnan(EX->f[0]) ? EX->f[0] : (isnan(EX->f[1]) ? EX->f[1] : (EX->f[0] + EX->f[1])); + GX->f[3] = isnan(EX->f[2]) ? EX->f[2] : (isnan(EX->f[3]) ? EX->f[3] : (EX->f[2] + EX->f[3])); } + CHECK_NAN_VF(GX); if(vex.l) { if(GY==EY) { eay1 = *EY; EY = &eay1; } GETVY; - GY->f[0] = VY->f[0] + VY->f[1]; - GY->f[1] = VY->f[2] + VY->f[3]; + mask_nan[0] = isnanf(VY->f[0]) || isnanf(VY->f[1]); + mask_nan[1] = isnanf(VY->f[2]) || isnanf(VY->f[3]); + GY->f[0] = isnan(VY->f[0]) ? VY->f[0] : (isnan(VY->f[1]) ? VY->f[1] : (VY->f[0] + VY->f[1])); + GY->f[1] = isnan(VY->f[2]) ? VY->f[2] : (isnan(VY->f[3]) ? VY->f[3] : (VY->f[2] + VY->f[3])); if(EY==VY) { GY->f[2] = GY->f[0]; GY->f[3] = GY->f[1]; + mask_nan[2] = mask_nan[0]; + mask_nan[3] = mask_nan[1]; } else { - GY->f[2] = EY->f[0] + EY->f[1]; - GY->f[3] = EY->f[2] + EY->f[3]; + mask_nan[2] = isnanf(EY->f[0]) || isnanf(EY->f[1]); + mask_nan[3] = isnanf(EY->f[2]) || isnanf(EY->f[3]); + GY->f[2] = isnan(EY->f[0]) ? EY->f[0] : (isnan(EY->f[1]) ? EY->f[1] : (EY->f[0] + EY->f[1])); + GY->f[3] = isnan(EY->f[2]) ? EY->f[2] : (isnan(EY->f[3]) ? EY->f[3] : (EY->f[2] + EY->f[3])); } + CHECK_NAN_VF(GY); } else GY->u128 = 0; break; @@ -367,38 +376,51 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETVX; GETGY; GETEY; - if(GX==EX) { + if (GX == EX) { eax1 = *EX; EX = &eax1; } - GX->f[0] = VX->f[0] - VX->f[1]; - GX->f[1] = VX->f[2] - VX->f[3]; - if(EX==VX) { + mask_nan[0] = isnanf(VX->f[0]) || isnanf(VX->f[1]); + mask_nan[1] = isnanf(VX->f[2]) || isnanf(VX->f[3]); + GX->f[0] = isnan(VX->f[0]) ? VX->f[0] : (isnan(VX->f[1]) ? VX->f[1] : (VX->f[0] - VX->f[1])); + GX->f[1] = isnan(VX->f[2]) ? VX->f[2] : (isnan(VX->f[3]) ? VX->f[3] : (VX->f[2] - VX->f[3])); + if (EX == VX) { GX->f[2] = GX->f[0]; GX->f[3] = GX->f[1]; + mask_nan[2] = mask_nan[0]; + mask_nan[3] = mask_nan[1]; } else { - GX->f[2] = EX->f[0] - EX->f[1]; - GX->f[3] = EX->f[2] - EX->f[3]; + mask_nan[2] = isnanf(EX->f[0]) || isnanf(EX->f[1]); + mask_nan[3] = isnanf(EX->f[2]) || isnanf(EX->f[3]); + GX->f[2] = isnan(EX->f[0]) ? EX->f[0] : (isnan(EX->f[1]) ? EX->f[1] : (EX->f[0] - EX->f[1])); + GX->f[3] = isnan(EX->f[2]) ? EX->f[2] : (isnan(EX->f[3]) ? EX->f[3] : (EX->f[2] - EX->f[3])); } - if(vex.l) { - if(GY==EY) { + CHECK_NAN_VF(GX); + if (vex.l) { + if (GY == EY) { eay1 = *EY; EY = &eay1; } GETVY; - GY->f[0] = VY->f[0] - VY->f[1]; - GY->f[1] = VY->f[2] - VY->f[3]; - if(EY==VY) { + mask_nan[0] = isnanf(VY->f[0]) || isnanf(VY->f[1]); + mask_nan[1] = isnanf(VY->f[2]) || isnanf(VY->f[3]); + GY->f[0] = isnan(VY->f[0]) ? VY->f[0] : (isnan(VY->f[1]) ? VY->f[1] : (VY->f[0] - VY->f[1])); + GY->f[1] = isnan(VY->f[2]) ? VY->f[2] : (isnan(VY->f[3]) ? VY->f[3] : (VY->f[2] - VY->f[3])); + if (EY == VY) { GY->f[2] = GY->f[0]; GY->f[3] = GY->f[1]; + mask_nan[2] = mask_nan[0]; + mask_nan[3] = mask_nan[1]; } else { - GY->f[2] = EY->f[0] - EY->f[1]; - GY->f[3] = EY->f[2] - EY->f[3]; + mask_nan[2] = isnanf(EY->f[0]) || isnanf(EY->f[1]); + mask_nan[3] = isnanf(EY->f[2]) || isnanf(EY->f[3]); + GY->f[2] = isnan(EY->f[0]) ? EY->f[0] : (isnan(EY->f[1]) ? EY->f[1] : (EY->f[0] - EY->f[1])); + GY->f[3] = isnan(EY->f[2]) ? EY->f[2] : (isnan(EY->f[3]) ? EY->f[3] : (EY->f[2] - EY->f[3])); } + CHECK_NAN_VF(GY); } else GY->u128 = 0; break; - case 0xC2: /* VCMPSD Gx, Vx, Ex, Ib */ nextop = F8; GETEX(1); @@ -438,17 +460,21 @@ uintptr_t RunAVX_F20F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; - GX->f[0] = VX->f[0] - EX->f[0]; - GX->f[1] = VX->f[1] + EX->f[1]; - GX->f[2] = VX->f[2] - EX->f[2]; - GX->f[3] = VX->f[3] + EX->f[3]; + MARK_NAN_VF_2(VX, EX); + GX->f[0] = isnan(VX->f[0]) ? VX->f[0] : (isnan(EX->f[0]) ? EX->f[0] : (VX->f[0] - EX->f[0])); + GX->f[1] = isnan(VX->f[1]) ? VX->f[1] : (isnan(EX->f[1]) ? EX->f[1] : (VX->f[1] + EX->f[1])); + GX->f[2] = isnan(VX->f[2]) ? VX->f[2] : (isnan(EX->f[2]) ? EX->f[2] : (VX->f[2] - EX->f[2])); + GX->f[3] = isnan(VX->f[3]) ? VX->f[3] : (isnan(EX->f[3]) ? EX->f[3] : (VX->f[3] + EX->f[3])); + CHECK_NAN_VF(GX); if(vex.l) { GETEY; GETVY; - GY->f[0] = VY->f[0] - EY->f[0]; - GY->f[1] = VY->f[1] + EY->f[1]; - GY->f[2] = VY->f[2] - EY->f[2]; - GY->f[3] = VY->f[3] + EY->f[3]; + MARK_NAN_VF_2(VY, EY); + GY->f[0] = isnan(VY->f[0]) ? VY->f[0] : (isnan(EY->f[0]) ? EY->f[0] : (VY->f[0] - EY->f[0])); + GY->f[1] = isnan(VY->f[1]) ? VY->f[1] : (isnan(EY->f[1]) ? EY->f[1] : (VY->f[1] + EY->f[1])); + GY->f[2] = isnan(VY->f[2]) ? VY->f[2] : (isnan(EY->f[2]) ? EY->f[2] : (VY->f[2] - EY->f[2])); + GY->f[3] = isnan(VY->f[3]) ? VY->f[3] : (isnan(EY->f[3]) ? EY->f[3] : (VY->f[3] + EY->f[3])); + CHECK_NAN_VF(GY); } else GY->u128 = 0; break; diff --git a/src/emu/x64runavxf20f38.c b/src/emu/x64runavxf20f38.c index 0575409..cf6d728 100644 --- a/src/emu/x64runavxf20f38.c +++ b/src/emu/x64runavxf20f38.c @@ -12,7 +12,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,7 +20,6 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" #ifdef DYNAREC #include "custommem.h" #include "../dynarec/native_lock.h" diff --git a/src/emu/x64runavxf20f3a.c b/src/emu/x64runavxf20f3a.c index dc8142d..22225d4 100644 --- a/src/emu/x64runavxf20f3a.c +++ b/src/emu/x64runavxf20f3a.c @@ -12,7 +12,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,7 +20,6 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" #ifdef DYNAREC #include "custommem.h" #include "../dynarec/native_lock.h" @@ -69,9 +67,7 @@ uintptr_t RunAVX_F20F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GD->q[0] = (ED->q[0] << (64 - u8)) + ((ED->q[0] >> (u8)) & ((1L << (64 - u8)) - 1L)); } else { u8 &= 0x1f; - ED->dword[0] = (ED->dword[0] << (32 - u8)) + ((ED->dword[0] >> (u8)) & ((1 << (32 - u8)) - 1)); - if(MODREG) - ED->dword[1] = 0; + GD->q[0] = (ED->dword[0] << (32 - u8)) + ((ED->dword[0] >> (u8)) & ((1 << (32 - u8)) - 1)); } break; diff --git a/src/emu/x64runavxf30f.c b/src/emu/x64runavxf30f.c index 89c0bad..fb710d7 100644 --- a/src/emu/x64runavxf30f.c +++ b/src/emu/x64runavxf30f.c @@ -9,10 +9,10 @@ #include #include +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,7 +21,6 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" #include "x64shaext.h" #ifdef DYNAREC #include "custommem.h" @@ -30,11 +29,6 @@ #include "modrm.h" -#ifdef __clang__ -extern int isinff(float); -extern int isnanf(float); -#endif - #ifdef TEST_INTERPRETER uintptr_t TestAVX_F30F(x64test_t *test, vex_t vex, uintptr_t addr, int *step) #else @@ -107,7 +101,7 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GY->u128 = 0; break; - case 0x16: /* MOVSHDUP Gx, Ex */ + case 0x16: /* VMOVSHDUP Gx, Ex */ nextop = F8; GETEX(0); GETGX; @@ -142,12 +136,12 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEX(0); GETGD; if (rex.w) { - if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>(float)0x7fffffffffffffffLL) + if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>=(float)0x7fffffffffffffffLL) GD->q[0] = 0x8000000000000000LL; else GD->sq[0] = EX->f[0]; } else { - if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>0x7fffffff) + if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>=(float)0x7fffffff) GD->dword[0] = 0x80000000; else GD->sdword[0] = EX->f[0]; @@ -159,7 +153,7 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETEX(0); GETGD; if(rex.w) { - if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>(float)0x7fffffffffffffffLL) + if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>=(float)0x7fffffffffffffffLL) GD->q[0] = 0x8000000000000000LL; else switch(emu->mxcsr.f.MXCSR_RC) { @@ -216,6 +210,8 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; if(EX->f[0]<0.0 ) GX->f[0] = -NAN; + else if(isnanf(EX->f[0])) + GX->f[0] = EX->f[0]; else GX->f[0] = sqrt(EX->f[0]); if(GX!=VX) { @@ -228,7 +224,16 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) nextop = F8; GETEX(0); GETGX; GETVX; GETGY; - GX->f[0] = 1.0f/sqrtf(EX->f[0]); + if(EX->f[0]==0) + GX->f[0] = 1.0f/EX->f[0]; + else if (EX->f[0]<0) + GX->f[0] = -NAN; + else if (isnan(EX->f[0])) + GX->f[0] = EX->f[0]; + else if (isinf(EX->f[0])) + GX->f[0] = 0.0; + else + GX->f[0] = 1.0f/sqrtf(EX->f[0]); if(GX!=VX) { GX->ud[1] = VX->ud[1]; GX->q[1] = VX->q[1]; @@ -253,7 +258,9 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; + MARK_NAN_F_2(VX, EX); GX->f[0] = VX->f[0] + EX->f[0]; + CHECK_NAN_F(GX); if(GX!=VX) { GX->ud[1] = VX->ud[1]; GX->q[1] = VX->q[1]; @@ -266,7 +273,9 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; + MARK_NAN_F_2(VX, EX); GX->f[0] = VX->f[0] * EX->f[0]; + CHECK_NAN_F(GX); if(GX!=VX) { GX->ud[1] = VX->ud[1]; GX->q[1] = VX->q[1]; @@ -335,9 +344,7 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; - if (VX->f[0] == 0.0 && EX->f[0] == 0.0) - GX->f[0] = EX->f[0]; - else if (isnan(VX->f[0]) || isnan(EX->f[0]) || isgreater(VX->f[0], EX->f[0])) + if (isnan(VX->f[0]) || isnan(EX->f[0]) || islessequal(EX->f[0], VX->f[0])) GX->f[0] = EX->f[0]; else GX->f[0] = VX->f[0]; @@ -353,11 +360,13 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; + MARK_NAN_F_2(VX, EX); GX->f[0] = VX->f[0] / EX->f[0]; if(GX!=VX) { GX->ud[1] = VX->ud[1]; GX->q[1] = VX->q[1]; } + CHECK_NAN_F(GX); GY->u128 = 0; break; case 0x5F: /* VMAXSS Gx, Vx, Ex */ @@ -366,9 +375,7 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGX; GETVX; GETGY; - if (VX->f[0] == 0.0 && EX->f[0] == 0.0) - GX->f[0] = EX->f[0]; - else if (isnan(VX->f[0]) || isnan(EX->f[0]) || isgreater(EX->f[0], VX->f[0])) + if (isnan(VX->f[0]) || isnan(EX->f[0]) || isgreaterequal(EX->f[0], VX->f[0])) GX->f[0] = EX->f[0]; else GX->f[0] = VX->f[0]; @@ -420,7 +427,7 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GY->u128 = 0; break; - case 0x7E: /* MOVQ Gx, Ex */ + case 0x7E: /* VMOVQ Gx, Ex */ nextop = F8; GETEX(0); GETGX; @@ -438,7 +445,10 @@ uintptr_t RunAVX_F30F(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step) GETGY; GETEY; memcpy(EY, GY, 16); - } // no ymm raz here it seems + } else if(MODREG) { + GETEY; + EY->u128 = 0; + } break; case 0xC2: /* VCMPSS Gx, Vx, Ex, Ib */ diff --git a/src/emu/x64runavxf30f38.c b/src/emu/x64runavxf30f38.c index a2ed522..975977d 100644 --- a/src/emu/x64runavxf30f38.c +++ b/src/emu/x64runavxf30f38.c @@ -12,7 +12,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,7 +20,6 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" #ifdef DYNAREC #include "custommem.h" #include "../dynarec/native_lock.h" diff --git a/src/emu/x64runavxf30f3a.c b/src/emu/x64runavxf30f3a.c index c5dc9a1..9bd0b9f 100644 --- a/src/emu/x64runavxf30f3a.c +++ b/src/emu/x64runavxf30f3a.c @@ -12,7 +12,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -21,7 +20,6 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" -#include "signals.h" #ifdef DYNAREC #include "custommem.h" #include "../dynarec/native_lock.h" diff --git a/src/emu/x64rund8.c b/src/emu/x64rund8.c index fcd0b0e..ffd988e 100644 --- a/src/emu/x64rund8.c +++ b/src/emu/x64rund8.c @@ -1,4 +1,5 @@ #define _GNU_SOURCE +#include #include #include #include @@ -11,12 +12,12 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" #include "x64trace.h" #include "x87emu_private.h" +#include "x87emu_setround.h" #include "box64context.h" #include "bridge.h" @@ -34,6 +35,7 @@ uintptr_t RunD8(x64emu_t *emu, rex_t rex, uintptr_t addr) #ifdef TEST_INTERPRETER x64emu_t*emu = test->emu; #endif + int oldround = fpu_setround(emu); nextop = F8; if(MODREG) @@ -48,6 +50,7 @@ uintptr_t RunD8(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xC6: case 0xC7: /* FADD */ ST0.d += ST(nextop&7).d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 0xC8: case 0xC9: @@ -58,6 +61,7 @@ uintptr_t RunD8(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xCE: case 0xCF: /* FMUL */ ST0.d *= ST(nextop&7).d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 0xD0: case 0xD1: @@ -89,6 +93,7 @@ uintptr_t RunD8(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xE6: case 0xE7: /* FSUB */ ST0.d -= ST(nextop&7).d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 0xE8: case 0xE9: @@ -99,6 +104,7 @@ uintptr_t RunD8(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xEE: case 0xEF: /* FSUBR */ ST0.d = ST(nextop&7).d - ST0.d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 0xF0: case 0xF1: @@ -109,6 +115,7 @@ uintptr_t RunD8(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xF6: case 0xF7: /* FDIV */ ST0.d /= ST(nextop&7).d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 0xF8: case 0xF9: @@ -119,18 +126,22 @@ uintptr_t RunD8(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xFE: case 0xFF: /* FDIVR */ ST0.d = ST(nextop&7).d / ST0.d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; default: + fesetround(oldround); return 0; } else switch((nextop>>3)&7) { case 0: /* FADD ST0, float */ GETE4(0); ST0.d += *(float*)ED; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 1: /* FMUL ST0, float */ GETE4(0); ST0.d *= *(float*)ED; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 2: /* FCOM ST0, float */ GETE4(0); @@ -144,21 +155,27 @@ uintptr_t RunD8(x64emu_t *emu, rex_t rex, uintptr_t addr) case 4: /* FSUB ST0, float */ GETE4(0); ST0.d -= *(float*)ED; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 5: /* FSUBR ST0, float */ GETE4(0); ST0.d = *(float*)ED - ST0.d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 6: /* FDIV ST0, float */ GETE4(0); ST0.d /= *(float*)ED; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 7: /* FDIVR ST0, float */ GETE4(0); ST0.d = *(float*)ED / ST0.d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; default: + fesetround(oldround); return 0; } - return addr; -} \ No newline at end of file + fesetround(oldround); + return addr; +} diff --git a/src/emu/x64rund9.c b/src/emu/x64rund9.c index df39ed3..6f0faa8 100644 --- a/src/emu/x64rund9.c +++ b/src/emu/x64rund9.c @@ -1,4 +1,5 @@ #define _GNU_SOURCE +#include #include #include #include @@ -11,12 +12,12 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" #include "x64trace.h" #include "x87emu_private.h" +#include "x87emu_setround.h" #include "box64context.h" #include "bridge.h" @@ -33,6 +34,7 @@ uintptr_t RunD9(x64emu_t *emu, rex_t rex, uintptr_t addr) uint64_t ll; float f; reg64_t *oped; + int oldround; #ifdef TEST_INTERPRETER x64emu_t*emu = test->emu; #endif @@ -123,70 +125,57 @@ uintptr_t RunD9(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 0xF0: /* F2XM1 */ - ST0.d = exp2(ST0.d) - 1.0; + if (ST0.d == 0) + break; + // Using the expm1 instead of exp2(ST0)-1 can avoid losing precision much, + // expecially when ST0 is close to zero (which loses the precise when -1). + // printf("%a, %a\n", LN2 * ST0.d, expm1(LN2 * ST0.d)); + ST0.d = expm1(LN2 * ST0.d); + // = 2^ST0 - 1 + error. (in math) break; case 0xF1: /* FYL2X */ ST(1).d *= log2(ST0.d); fpu_do_pop(emu); break; case 0xF2: /* FPTAN */ + oldround = fpu_setround(emu); ST0.d = tan(ST0.d); + fesetround(oldround); fpu_do_push(emu); ST0.d = 1.0; emu->sw.f.F87_C2 = 0; break; case 0xF3: /* FPATAN */ + oldround = fpu_setround(emu); ST1.d = atan2(ST1.d, ST0.d); + fesetround(oldround); fpu_do_pop(emu); break; case 0xF4: /* FXTRACT */ - ST0.d = frexp(ST0.d, &tmp32s); fpu_do_push(emu); - ST0.d = tmp32s; - break; - - case 0xF8: /* FPREM */ - { - int e0, e1; - frexp(ST0.d, &e0); - frexp(ST1.d, &e1); - tmp32s = e0 - e1; - } - if(tmp32s<64) - { - ll = (int64_t)floor(ST0.d/ST1.d); - ST0.d = ST0.d - (ST1.d*ll); - emu->sw.f.F87_C2 = 0; - emu->sw.f.F87_C1 = (ll&1)?1:0; - emu->sw.f.F87_C3 = (ll&2)?1:0; - emu->sw.f.F87_C0 = (ll&4)?1:0; + if(isnan(ST1.d)) { + ST0.d = ST1.d; + } else if(isinf(ST1.d)) { + ST0.d = ST1.d; + ST1.d = INFINITY; + } else if(ST1.d==0.0) { + ST0.d = ST1.d; + ST1.d = -INFINITY; } else { - ll = (int64_t)(floor((ST0.d/ST1.d))/exp2(tmp32s - 32)); - ST0.d = ST0.d - ST1.d*ll*exp2(tmp32s - 32); - emu->sw.f.F87_C2 = 1; + // LD80bits doesn't have implicit "1" bit, so need to adjust for that + ST0.d = frexp(ST1.d, &tmp32s)*2; + ST1.d = tmp32s-1; } break; + case 0xF5: /* FPREM1 */ // get exponant(ST(0))-exponant(ST(1)) in temp32s - { - int e0, e1; - frexp(ST0.d, &e0); - frexp(ST1.d, &e1); - tmp32s = e0 - e1; - } - if(tmp32s<64) - { - ll = (int64_t)round(ST0.d/ST1.d); - ST0.d = ST0.d - (ST1.d*ll); - emu->sw.f.F87_C2 = 0; - emu->sw.f.F87_C1 = (ll&1)?1:0; - emu->sw.f.F87_C3 = (ll&2)?1:0; - emu->sw.f.F87_C0 = (ll&4)?1:0; - } else { - ll = (int64_t)(trunc((ST0.d/ST1.d))/exp2(tmp32s - 32)); - ST0.d = ST0.d - ST1.d*ll*exp2(tmp32s - 32); - emu->sw.f.F87_C2 = 1; - } + ll = (int64_t)round(ST0.d/ST1.d); + ST0.d = ST0.d - (ST1.d*ll); + emu->sw.f.F87_C2 = 0; + emu->sw.f.F87_C1 = (ll&1)?1:0; + emu->sw.f.F87_C3 = (ll&2)?1:0; + emu->sw.f.F87_C0 = (ll&4)?1:0; break; case 0xF6: /* FDECSTP */ emu->top=(emu->top-1)&7; // this will probably break a few things @@ -197,16 +186,32 @@ uintptr_t RunD9(x64emu_t *emu, rex_t rex, uintptr_t addr) else emu->top=(emu->top+1)&7; // this will probably break a few things break; + case 0xF8: /* FPREM */ + ll = (int64_t)trunc(ST0.d/ST1.d); + ST0.d = ST0.d - (ST1.d*ll); + emu->sw.f.F87_C2 = 0; + emu->sw.f.F87_C1 = (ll&1)?1:0; + emu->sw.f.F87_C3 = (ll&2)?1:0; + emu->sw.f.F87_C0 = (ll&4)?1:0; + break; case 0xF9: /* FYL2XP1 */ - ST(1).d *= log2(ST0.d + 1.0); + // Using the log1p instead of log2(ST0+1) can avoid losing precision much, + // expecially when ST0 is close to zero (which loses the precise when +1). + ST(1).d = (ST(1).d * log1p(ST0.d)) / M_LN2; + // = ST1 * log2(ST0 + 1) + error. (in math) fpu_do_pop(emu); break; case 0xFA: /* FSQRT */ + oldround = fpu_setround(emu); ST0.d = sqrt(ST0.d); + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; + fesetround(oldround); break; case 0xFB: /* FSINCOS */ fpu_do_push(emu); + oldround = fpu_setround(emu); sincos(ST1.d, &ST1.d, &ST0.d); + fesetround(oldround); emu->sw.f.F87_C2 = 0; break; case 0xFC: /* FRNDINT */ @@ -214,15 +219,28 @@ uintptr_t RunD9(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 0xFD: /* FSCALE */ // this could probably be done by just altering the exponant part of the float... - if(ST0.d!=0.0) - ST0.d *= exp2(trunc(ST1.d)); + if (ST1.d > INT32_MAX) + tmp32s = INT32_MAX; + else if (ST1.d < INT32_MIN) + tmp32s = INT32_MIN; + else + tmp32s = ST1.d; + if(ST0.d!=0.0) { + oldround = fpu_setround(emu); + ST0.d = ldexp(ST0.d, tmp32s); + fesetround(oldround); + } break; case 0xFE: /* FSIN */ + oldround = fpu_setround(emu); ST0.d = sin(ST0.d); + fesetround(oldround); emu->sw.f.F87_C2 = 0; break; case 0xFF: /* FCOS */ + oldround = fpu_setround(emu); ST0.d = cos(ST0.d); + fesetround(oldround); emu->sw.f.F87_C2 = 0; break; @@ -238,11 +256,15 @@ uintptr_t RunD9(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 2: /* FST Ed, ST0 */ GETE4(0); + oldround = fpu_setround(emu); *(float*)ED = ST0.d; + fesetround(oldround); break; case 3: /* FSTP Ed, ST0 */ GETE4(0); + oldround = fpu_setround(emu); *(float*)ED = ST0.d; + fesetround(oldround); fpu_do_pop(emu); break; case 4: /* FLDENV m */ @@ -270,5 +292,5 @@ uintptr_t RunD9(x64emu_t *emu, rex_t rex, uintptr_t addr) default: return 0; } - return addr; -} \ No newline at end of file + return addr; +} diff --git a/src/emu/x64runda.c b/src/emu/x64runda.c index aed775f..59278b1 100644 --- a/src/emu/x64runda.c +++ b/src/emu/x64runda.c @@ -1,4 +1,5 @@ #define _GNU_SOURCE +#include #include #include #include @@ -11,12 +12,12 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" #include "x64trace.h" #include "x87emu_private.h" +#include "x87emu_setround.h" #include "box64context.h" #include "bridge.h" @@ -94,15 +95,18 @@ uintptr_t RunDA(x64emu_t *emu, rex_t rex, uintptr_t addr) default: return 0; - } else + } else { + int oldround = fpu_setround(emu); switch((nextop>>3)&7) { case 0: /* FIADD ST0, Ed int */ GETE4(0); ST0.d += ED->sdword[0]; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 1: /* FIMUL ST0, Ed int */ GETE4(0); ST0.d *= ED->sdword[0]; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 2: /* FICOM ST0, Ed int */ GETE4(0); @@ -116,19 +120,25 @@ uintptr_t RunDA(x64emu_t *emu, rex_t rex, uintptr_t addr) case 4: /* FISUB ST0, Ed int */ GETE4(0); ST0.d -= ED->sdword[0]; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 5: /* FISUBR ST0, Ed int */ GETE4(0); ST0.d = (double)ED->sdword[0] - ST0.d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 6: /* FIDIV ST0, Ed int */ GETE4(0); ST0.d /= ED->sdword[0]; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 7: /* FIDIVR ST0, Ed int */ GETE4(0); ST0.d = (double)ED->sdword[0] / ST0.d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; } + fesetround(oldround); + } return addr; -} \ No newline at end of file +} diff --git a/src/emu/x64rundb.c b/src/emu/x64rundb.c index 9fdae84..5e12fa6 100644 --- a/src/emu/x64rundb.c +++ b/src/emu/x64rundb.c @@ -1,4 +1,5 @@ #define _GNU_SOURCE +#include #include #include #include @@ -11,12 +12,12 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" #include "x64trace.h" #include "x87emu_private.h" +#include "x87emu_setround.h" #include "box64context.h" #include "bridge.h" @@ -35,6 +36,7 @@ uintptr_t RunDB(x64emu_t *emu, rex_t rex, uintptr_t addr) x64emu_t*emu = test->emu; #endif + int oldround = fpu_setround(emu); nextop = F8; if(MODREG) switch(nextop) { @@ -128,6 +130,7 @@ uintptr_t RunDB(x64emu_t *emu, rex_t rex, uintptr_t addr) break; default: + fesetround(oldround); return 0; } else switch((nextop>>3)&7) { @@ -172,14 +175,16 @@ uintptr_t RunDB(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 7: /* FSTP tbyte */ GETET(0); - if(ST0.q!=STld(0).uref) - D2LD(&ST0.d, ED); - else + if(STld(0).uref && (ST0.q==STld(0).uref)) memcpy(ED, &STld(0).ld, 10); + else + D2LD(&ST0.d, ED); fpu_do_pop(emu); break; default: + fesetround(oldround); return 0; } - return addr; + fesetround(oldround); + return addr; } diff --git a/src/emu/x64rundc.c b/src/emu/x64rundc.c index 6d9ff07..99b12c7 100644 --- a/src/emu/x64rundc.c +++ b/src/emu/x64rundc.c @@ -11,12 +11,12 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" #include "x64trace.h" #include "x87emu_private.h" +#include "x87emu_setround.h" #include "box64context.h" #include "bridge.h" @@ -34,6 +34,7 @@ uintptr_t RunDC(x64emu_t *emu, rex_t rex, uintptr_t addr) x64emu_t*emu = test->emu; #endif + int oldround = fpu_setround(emu); nextop = F8; if(MODREG) switch(nextop) { @@ -46,6 +47,7 @@ uintptr_t RunDC(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xC6: case 0xC7: /* FADD */ ST(nextop&7).d += ST0.d; + if(!emu->cw.f.C87_PC) ST(nextop&7).d = (float)ST(nextop&7).d; break; case 0xC8: case 0xC9: @@ -56,6 +58,7 @@ uintptr_t RunDC(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xCE: case 0xCF: /* FMUL */ ST(nextop&7).d *= ST0.d; + if(!emu->cw.f.C87_PC) ST(nextop&7).d = (float)ST(nextop&7).d; break; case 0xD0: case 0xD1: @@ -87,6 +90,7 @@ uintptr_t RunDC(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xE6: case 0xE7: /* FSUBR */ ST(nextop&7).d = ST0.d -ST(nextop&7).d; + if(!emu->cw.f.C87_PC) ST(nextop&7).d = (float)ST(nextop&7).d; break; case 0xE8: case 0xE9: @@ -97,6 +101,7 @@ uintptr_t RunDC(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xEE: case 0xEF: /* FSUB */ ST(nextop&7).d -= ST0.d; + if(!emu->cw.f.C87_PC) ST(nextop&7).d = (float)ST(nextop&7).d; break; case 0xF0: case 0xF1: @@ -107,6 +112,7 @@ uintptr_t RunDC(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xF6: case 0xF7: /* FDIVR */ ST(nextop&7).d = ST0.d / ST(nextop&7).d; + if(!emu->cw.f.C87_PC) ST(nextop&7).d = (float)ST(nextop&7).d; break; case 0xF8: case 0xF9: @@ -117,17 +123,21 @@ uintptr_t RunDC(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xFE: case 0xFF: /* FDIV */ ST(nextop&7).d /= ST0.d; + if(!emu->cw.f.C87_PC) ST(nextop&7).d = (float)ST(nextop&7).d; break; default: + fesetround(oldround); return 0; } else { GETE8(0); switch((nextop>>3)&7) { case 0: /* FADD ST0, double */ ST0.d += *(double*)ED; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 1: /* FMUL ST0, double */ ST0.d *= *(double*)ED; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 2: /* FCOM ST0, double */ fpu_fcom(emu, *(double*)ED); @@ -138,19 +148,25 @@ uintptr_t RunDC(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 4: /* FSUB ST0, double */ ST0.d -= *(double*)ED; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 5: /* FSUBR ST0, double */ ST0.d = *(double*)ED - ST0.d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 6: /* FDIV ST0, double */ ST0.d /= *(double*)ED; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 7: /* FDIVR ST0, double */ ST0.d = *(double*)ED / ST0.d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; default: + fesetround(oldround); return 0; } } - return addr; + fesetround(oldround); + return addr; } diff --git a/src/emu/x64rundd.c b/src/emu/x64rundd.c index 5aa2339..d7e6f74 100644 --- a/src/emu/x64rundd.c +++ b/src/emu/x64rundd.c @@ -11,7 +11,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -161,4 +160,4 @@ uintptr_t RunDD(x64emu_t *emu, rex_t rex, uintptr_t addr) return 0; } return addr; -} \ No newline at end of file +} diff --git a/src/emu/x64runde.c b/src/emu/x64runde.c index 4cb5e4a..7e23c49 100644 --- a/src/emu/x64runde.c +++ b/src/emu/x64runde.c @@ -1,4 +1,5 @@ #define _GNU_SOURCE +#include #include #include #include @@ -11,12 +12,12 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" #include "x64trace.h" #include "x87emu_private.h" +#include "x87emu_setround.h" #include "box64context.h" #include "bridge.h" @@ -34,6 +35,7 @@ uintptr_t RunDE(x64emu_t *emu, rex_t rex, uintptr_t addr) x64emu_t*emu = test->emu; #endif + int oldround = fpu_setround(emu); nextop = F8; if(MODREG) switch(nextop) { @@ -46,6 +48,7 @@ uintptr_t RunDE(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xC6: case 0xC7: ST(nextop&7).d += ST0.d; + if(!emu->cw.f.C87_PC) ST(nextop&7).d = (float)ST(nextop&7).d; fpu_do_pop(emu); break; case 0xC8: /* FMULP STx, ST0 */ @@ -57,6 +60,7 @@ uintptr_t RunDE(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xCE: case 0xCF: ST(nextop&7).d *= ST0.d; + if(!emu->cw.f.C87_PC) ST(nextop&7).d = (float)ST(nextop&7).d; fpu_do_pop(emu); break; case 0xD0: @@ -89,6 +93,7 @@ uintptr_t RunDE(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xE6: case 0xE7: ST(nextop&7).d = ST0.d - ST(nextop&7).d; + if(!emu->cw.f.C87_PC) ST(nextop&7).d = (float)ST(nextop&7).d; fpu_do_pop(emu); break; case 0xE8: /* FSUBP STx, ST0 */ @@ -100,6 +105,7 @@ uintptr_t RunDE(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xEE: case 0xEF: ST(nextop&7).d -= ST0.d; + if(!emu->cw.f.C87_PC) ST(nextop&7).d = (float)ST(nextop&7).d; fpu_do_pop(emu); break; case 0xF0: /* FDIVRP STx, ST0 */ @@ -111,6 +117,7 @@ uintptr_t RunDE(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xF6: case 0xF7: ST(nextop&7).d = ST0.d / ST(nextop&7).d; + if(!emu->cw.f.C87_PC) ST(nextop&7).d = (float)ST(nextop&7).d; fpu_do_pop(emu); break; case 0xF8: /* FDIVP STx, ST0 */ @@ -122,39 +129,58 @@ uintptr_t RunDE(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xFE: case 0xFF: ST(nextop&7).d /= ST0.d; + if(!emu->cw.f.C87_PC) ST(nextop&7).d = (float)ST(nextop&7).d; fpu_do_pop(emu); break; default: + fesetround(oldround); return 0; } else switch((nextop>>3)&7) { case 0: /* FIADD ST0, Ew int */ GETEW(0); ST0.d += EW->sword[0]; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 1: /* FIMUL ST0, Ew int */ GETEW(0); ST0.d *= EW->sword[0]; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; + break; + case 2: /* FICOM ST0, Ew int */ + GETEW(0); + fpu_fcom(emu, EW->sword[0]); + break; + case 3: /* FICOMP ST0, Ew int */ + GETEW(0); + fpu_fcom(emu, EW->sword[0]); + fpu_do_pop(emu); break; case 4: /* FISUB ST0, Ew int */ GETEW(0); ST0.d -= EW->sword[0]; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 5: /* FISUBR ST0, Ew int */ GETEW(0); ST0.d = (double)EW->sword[0] - ST0.d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 6: /* FIDIV ST0, Ew int */ GETEW(0); ST0.d /= EW->sword[0]; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; case 7: /* FIDIVR ST0, Ew int */ GETEW(0); ST0.d = (double)EW->sword[0] / ST0.d; + if(!emu->cw.f.C87_PC) ST0.d = (float)ST0.d; break; default: + fesetround(oldround); return 0; } - return addr; -} \ No newline at end of file + fesetround(oldround); + return addr; +} diff --git a/src/emu/x64rundf.c b/src/emu/x64rundf.c index dfedb29..dbf4800 100644 --- a/src/emu/x64rundf.c +++ b/src/emu/x64rundf.c @@ -11,7 +11,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" diff --git a/src/emu/x64runf0.c b/src/emu/x64runf0.c index 0f6c929..6d8a1e7 100644 --- a/src/emu/x64runf0.c +++ b/src/emu/x64runf0.c @@ -11,7 +11,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -20,6 +19,8 @@ #include "box64context.h" #include "my_cpuid.h" #include "bridge.h" +#include "x64_signals.h" +#include "emit_signals.h" #ifdef DYNAREC #include "../dynarec/native_lock.h" #endif @@ -40,6 +41,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) int64_t tmp64s; uint64_t tmp64u, tmp64u2; reg64_t *oped, *opgd; + x64flags_t eflags; #ifdef USE_CAS uint64_t tmpcas; #endif @@ -48,59 +50,62 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) #endif opcode = F8; - while((opcode==0x36) || (opcode==0x2E) || (opcode==0x3E) || (opcode==0x26)) - opcode = F8; - - // REX prefix before the F0 are ignored - rex.rex = 0; - if(!rex.is32bits) - while(opcode>=0x40 && opcode<=0x4f) { - rex.rex = opcode; - opcode = F8; - } switch(opcode) { #if defined(DYNAREC) && !defined(TEST_INTERPRETER) - #define GO(B, OP) \ + #define GO(B, OP, F) \ case B+0: \ nextop = F8; \ + if(MODREG) { \ + emu->error |= ERR_ILLEGAL; \ + return 0; \ + } \ GETEB(0); \ GETGB; \ + if(F) {CHECK_FLAGS(emu); eflags=emu->eflags;} \ do { \ + if(F) emu->eflags = eflags; \ tmp8u = native_lock_read_b(EB); \ tmp8u = OP##8(emu, tmp8u, GB); \ } while (native_lock_write_b(EB, tmp8u)); \ break; \ case B+1: \ nextop = F8; \ + if(MODREG) { \ + emu->error |= ERR_ILLEGAL; \ + return 0; \ + } \ GETED(0); \ GETGD; \ + if(F) {CHECK_FLAGS(emu); eflags=emu->eflags;} \ if(((uintptr_t)ED)&(3<q[0]; \ - tmp64u = OP##64(emu, tmp64u, GD->q[0]); \ - } while (native_lock_write_b(ED, tmp8u)); \ - ED->q[0] = tmp64u; \ - } else { \ - do { \ - tmp8u = native_lock_read_b(ED); \ - tmp32u = ED->dword[0]; \ - tmp32u = OP##32(emu, tmp32u, GD->dword[0]); \ - } while (native_lock_write_b(ED, tmp8u)); \ - ED->dword[0] = tmp32u; \ - if(MODREG) \ - ED->dword[1] = 0; \ - } \ + if(rex.w) { \ + do { \ + if(F) emu->eflags = eflags; \ + tmp8u = native_lock_read_b(ED); \ + tmp64u = ED->q[0]; \ + tmp64u = OP##64(emu, tmp64u, GD->q[0]); \ + } while (native_lock_write_b(ED, tmp8u)); \ + ED->q[0] = tmp64u; \ + } else { \ + do { \ + if(F) emu->eflags = eflags; \ + tmp8u = native_lock_read_b(ED); \ + tmp32u = ED->dword[0]; \ + tmp32u = OP##32(emu, tmp32u, GD->dword[0]); \ + } while (native_lock_write_b(ED, tmp8u)); \ + ED->dword[0] = tmp32u; \ + } \ } else { \ if(rex.w) { \ do { \ + if(F) emu->eflags = eflags; \ tmp64u = native_lock_read_dd(ED); \ tmp64u = OP##64(emu, tmp64u, GD->q[0]); \ } while (native_lock_write_dd(ED, tmp64u)); \ } else { \ do { \ + if(F) emu->eflags = eflags; \ tmp32u = native_lock_read_d(ED); \ tmp32u = OP##32(emu, tmp32u, GD->dword[0]); \ } while (native_lock_write_d(ED, tmp32u)); \ @@ -108,35 +113,15 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) ED->dword[1] = 0; \ } \ } \ - break; \ - case B+2: \ - nextop = F8; \ - GETEB(0); \ - GETGB; \ - GB = OP##8(emu, GB, EB->byte[0]); \ - break; \ - case B+3: \ - nextop = F8; \ - GETED(0); \ - GETGD; \ - if(rex.w) \ - GD->q[0] = OP##64(emu, GD->q[0], ED->q[0]); \ - else \ - GD->q[0] = OP##32(emu, GD->dword[0], ED->dword[0]); \ - break; \ - case B+4: \ - R_AL = OP##8(emu, R_AL, F8); \ - break; \ - case B+5: \ - if(rex.w) \ - R_RAX = OP##64(emu, R_RAX, F32S64); \ - else \ - R_RAX = OP##32(emu, R_EAX, F32); \ break; #else - #define GO(B, OP) \ + #define GO(B, OP, F) \ case B+0: \ nextop = F8; \ + if(MODREG) { \ + emu->error |= ERR_ILLEGAL; \ + return 0; \ + } \ GETEB(0); \ GETGB; \ pthread_mutex_lock(&my_context->mutex_lock); \ @@ -145,58 +130,27 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) break; \ case B+1: \ nextop = F8; \ + if(MODREG) { \ + emu->error |= ERR_ILLEGAL; \ + return 0; \ + } \ GETED(0); \ GETGD; \ pthread_mutex_lock(&my_context->mutex_lock); \ if(rex.w) \ ED->q[0] = OP##64(emu, ED->q[0], GD->q[0]); \ else \ - if(MODREG) \ - ED->q[0] = OP##32(emu, ED->dword[0], GD->dword[0]); \ - else \ - ED->dword[0] = OP##32(emu, ED->dword[0], GD->dword[0]); \ - pthread_mutex_unlock(&my_context->mutex_lock); \ - break; \ - case B+2: \ - nextop = F8; \ - GETEB(0); \ - GETGB; \ - pthread_mutex_lock(&my_context->mutex_lock); \ - GB = OP##8(emu, GB, EB->byte[0]); \ - pthread_mutex_unlock(&my_context->mutex_lock); \ - break; \ - case B+3: \ - nextop = F8; \ - GETED(0); \ - GETGD; \ - pthread_mutex_lock(&my_context->mutex_lock); \ - if(rex.w) \ - GD->q[0] = OP##64(emu, GD->q[0], ED->q[0]); \ - else \ - GD->q[0] = OP##32(emu, GD->dword[0], ED->dword[0]); \ - pthread_mutex_unlock(&my_context->mutex_lock); \ - break; \ - case B+4: \ - pthread_mutex_lock(&my_context->mutex_lock); \ - R_AL = OP##8(emu, R_AL, F8); \ - pthread_mutex_unlock(&my_context->mutex_lock); \ - break; \ - case B+5: \ - pthread_mutex_lock(&my_context->mutex_lock); \ - if(rex.w) \ - R_RAX = OP##64(emu, R_RAX, F32S64); \ - else \ - R_RAX = OP##32(emu, R_EAX, F32); \ - pthread_mutex_unlock(&my_context->mutex_lock); \ + ED->dword[0] = OP##32(emu, ED->dword[0], GD->dword[0]); \ + pthread_mutex_unlock(&my_context->mutex_lock); \ break; #endif - GO(0x00, add) /* ADD 0x00 -> 0x05 */ - GO(0x08, or) /* OR 0x08 -> 0x0D */ - GO(0x10, adc) /* ADC 0x10 -> 0x15 */ - GO(0x18, sbb) /* SBB 0x18 -> 0x1D */ - GO(0x20, and) /* AND 0x20 -> 0x25 */ - GO(0x28, sub) /* SUB 0x28 -> 0x2D */ - GO(0x30, xor) /* XOR 0x30 -> 0x35 */ + GO(0x00, add, 0) /* ADD 0x00 -> 0x05 */ + GO(0x08, or, 0) /* OR 0x08 -> 0x0D */ + GO(0x10, adc, 1) /* ADC 0x10 -> 0x15 */ + GO(0x18, sbb, 1) /* SBB 0x18 -> 0x1D */ + GO(0x20, and, 0) /* AND 0x20 -> 0x25 */ + GO(0x28, sub, 0) /* SUB 0x28 -> 0x2D */ + GO(0x30, xor, 0) /* XOR 0x30 -> 0x35 */ #undef GO case 0x0f: opcode = F8; @@ -205,67 +159,51 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xAB: /* BTS Ed,Gd */ CHECK_FLAGS(emu); nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETED(0); GETGD; tmp64s = rex.w?GD->sq[0]:GD->sdword[0]; tmp8u=tmp64s&(rex.w?63:31); tmp64s >>= (rex.w?6:5); - if(!MODREG) - { - #ifdef TEST_INTERPRETER - test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:2))); - if(rex.w) - *(uint64_t*)test->mem = *(uint64_t*)test->memaddr; - else - *(uint32_t*)test->mem = *(uint32_t*)test->memaddr; - #else - ED=(reg64_t*)(((uintptr_t)(ED))+(tmp64s<<(rex.w?3:2))); - #endif - } + #ifdef TEST_INTERPRETER + test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:2))); + if(rex.w) + *(uint64_t*)test->mem = *(uint64_t*)test->memaddr; + else + *(uint32_t*)test->mem = *(uint32_t*)test->memaddr; + #else + ED=(reg64_t*)(((uintptr_t)(ED))+(tmp64s<<(rex.w?3:2))); + #endif #if defined(DYNAREC) && !defined(TEST_INTERPRETER) if(rex.w) { tmp8u&=63; - if(MODREG) { - if(ED->q[0] & (1LL<q[0] |= (1LL<dword[0] & (1<dword[0] |= (1<dword[1] = 0; - } else - do { - tmp32u = native_lock_read_d(ED); - if(tmp32u & (1<mutex_lock); @@ -285,16 +223,24 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) ED->dword[0] |= (1<dword[1] = 0; } pthread_mutex_unlock(&my_context->mutex_lock); #endif + if(BOX64ENV(dynarec_test)) { + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_PF); + } break; case 0xB0: /* CMPXCHG Eb,Gb */ CHECK_FLAGS(emu); nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETGB; GETEB(0); #if defined(DYNAREC) && !defined(TEST_INTERPRETER) @@ -321,10 +267,14 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 0xB1: /* CMPXCHG Ed,Gd */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETED(0); GETGD; #if defined(DYNAREC) && !defined(TEST_INTERPRETER) - if(rex.w) + if(rex.w) { if(((uintptr_t)ED)&7) { do { tmp64u = ED->q[0] & ~0xffLL; @@ -350,7 +300,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) tmp32s = 0; } } while(tmp32s); - else { + } else { if(((uintptr_t)ED)&3) { do { tmp32u = ED->q[0] & ~0xffLL; @@ -373,12 +323,10 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) tmp32s = native_lock_write_d(ED, GD->dword[0]); } else { R_EAX = tmp32u; + emu->regs[_AX].dword[1] = 0; tmp32s = 0; } - } while(tmp32s); - emu->regs[_AX].dword[1] = 0; - if(MODREG) - ED->dword[1] = 0; + } while (tmp32s); } #else pthread_mutex_lock(&my_context->mutex_lock); @@ -395,10 +343,8 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) ED->dword[0] = GD->dword[0]; } else { R_EAX = ED->dword[0]; + emu->regs[_AX].dword[1] = 0; } - emu->regs[_AX].dword[1] = 0; - if(MODREG) - ED->dword[1] = 0; } pthread_mutex_unlock(&my_context->mutex_lock); #endif @@ -407,23 +353,24 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xB3: /* BTR Ed,Gd */ CHECK_FLAGS(emu); nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETED(0); GETGD; tmp64s = rex.w?GD->sq[0]:GD->sdword[0]; tmp8u=tmp64s&(rex.w?63:31); tmp64s >>= (rex.w?6:5); - if(!MODREG) - { - #ifdef TEST_INTERPRETER - test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:2))); - if(rex.w) - *(uint64_t*)test->mem = *(uint64_t*)test->memaddr; - else - *(uint32_t*)test->mem = *(uint32_t*)test->memaddr; - #else - ED=(reg64_t*)(((uintptr_t)(ED))+(tmp64s<<(rex.w?3:2))); - #endif - } + #ifdef TEST_INTERPRETER + test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:2))); + if(rex.w) + *(uint64_t*)test->mem = *(uint64_t*)test->memaddr; + else + *(uint32_t*)test->mem = *(uint32_t*)test->memaddr; + #else + ED=(reg64_t*)(((uintptr_t)(ED))+(tmp64s<<(rex.w?3:2))); + #endif tmp8u&=rex.w?63:31; #if defined(DYNAREC) && !defined(TEST_INTERPRETER) if(rex.w) @@ -450,8 +397,6 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) tmp32s = 0; } } while(tmp32s); - if(MODREG) - ED->dword[1] = 0; } #else pthread_mutex_lock(&my_context->mutex_lock); @@ -467,34 +412,27 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) ED->dword[0] ^= (1<dword[1] = 0; } pthread_mutex_unlock(&my_context->mutex_lock); #endif + if(BOX64ENV(dynarec_test)) { + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_PF); + } break; case 0xBA: nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } switch((nextop>>3)&7) { case 4: /* BT Ed,Ib */ - CHECK_FLAGS(emu); - GETED(1); - tmp8u = F8; - if(rex.w) { - tmp8u&=63; - if(ED->q[0] & (1LL<dword[0] & (1<error |= ERR_ILLEGAL; + return 0; case 5: /* BTS Ed, Ib */ CHECK_FLAGS(emu); GETED(1); @@ -562,6 +500,12 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) } pthread_mutex_unlock(&my_context->mutex_lock); #endif + if(BOX64ENV(dynarec_test)) { + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_PF); + } break; case 6: /* BTR Ed, Ib */ CHECK_FLAGS(emu); @@ -614,6 +558,12 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) } pthread_mutex_unlock(&my_context->mutex_lock); #endif + if(BOX64ENV(dynarec_test)) { + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_PF); + } break; case 7: /* BTC Ed, Ib */ CHECK_FLAGS(emu); @@ -633,15 +583,27 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) } while(tmp32s); } else { tmp8u&=31; - do { - tmp32u = native_lock_read_d(ED); - if(tmp32u & (1<>3)); + if(tmp32u & (1<<(tmp8u&7))) + SET_FLAG(F_CF); + else + CLEAR_FLAG(F_CF); + tmp32u ^= (1<<(tmp8u&7)); + tmp32s = native_lock_write_b(ED+(tmp8u>>3), tmp32u); + } while(tmp32s); + } else { + do { + tmp32u = native_lock_read_d(ED); + if(tmp32u & (1<mutex_lock); @@ -662,12 +624,88 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) } pthread_mutex_unlock(&my_context->mutex_lock); #endif + if(BOX64ENV(dynarec_test)) { + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_PF); + } break; default: return 0; } break; + case 0xBB: /* BTC Ed,Gd */ + CHECK_FLAGS(emu); + nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } + GETED(0); + GETGD; + tmp64s = rex.w?GD->sq[0]:GD->sdword[0]; + tmp8u=tmp64s&(rex.w?63:31); + tmp64s >>= (rex.w?6:5); + #ifdef TEST_INTERPRETER + test->memaddr=((test->memaddr)+(tmp32s<<(rex.w?3:2))); + if(rex.w) + *(uint64_t*)test->mem = *(uint64_t*)test->memaddr; + else + *(uint32_t*)test->mem = *(uint32_t*)test->memaddr; + #else + ED=(reg64_t*)(((uintptr_t)(ED))+(tmp64s<<(rex.w?3:2))); + #endif + tmp8u&=rex.w?63:31; +#if defined(DYNAREC) && !defined(TEST_INTERPRETER) + if(rex.w) + do { + tmp64u = native_lock_read_dd(ED); + if(tmp64u & (1LL<mutex_lock); + if(rex.w) { + if(ED->q[0] & (1<q[0] ^= (1<dword[0] & (1<dword[0] ^= (1<mutex_lock); +#endif + if(BOX64ENV(dynarec_test)) { + CLEAR_FLAG(F_OF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_PF); + } + break; case 0xC0: /* XADD Gb,Eb */ nextop = F8; @@ -689,6 +727,10 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 0xC1: /* XADD Gd,Ed */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETED(0); GETGD; #if defined(DYNAREC) && !defined(TEST_INTERPRETER) @@ -713,8 +755,6 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) } while(native_lock_write_d(ED, tmp32u2)); } GD->q[0] = tmp32u; - if(MODREG) - ED->dword[1] = 0; } #else pthread_mutex_lock(&my_context->mutex_lock); @@ -727,10 +767,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) tmp32u = ED->dword[0]; tmp32u2 = add32(emu, tmp32u, GD->dword[0]); GD->q[0] = tmp32u; - if(MODREG) - ED->q[0] = tmp32u2; - else - ED->dword[0] = tmp32u2; + ED->dword[0] = tmp32u2; } pthread_mutex_unlock(&my_context->mutex_lock); #endif @@ -738,16 +775,23 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xC7: /* CMPXCHG8B Gq */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETE8xw(0); switch((nextop>>3)&7) { case 1: + if(rex.w && ((uintptr_t)ED)&0xf) { + EmitSignal(emu, X64_SIGSEGV, (void*)R_RIP, 0xbad0); // GPF + } CHECK_FLAGS(emu); GETGD; #if defined(DYNAREC) && !defined(TEST_INTERPRETER) if (rex.w) { #if defined(__riscv) || defined(__loongarch64) #if defined(__loongarch64) - if (la64_scq) { + if (cpuext.scq) { do { native_lock_read_dq(&tmp64u, &tmp64u2, ED); if (R_RAX == tmp64u && R_RDX == tmp64u2) { @@ -812,36 +856,58 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) } } while(tmp32s); #endif - } else + } else { if(((uintptr_t)ED)&0x7) { + #ifdef __loongarch64 + tmp64u = R_EAX | (((uint64_t)R_EDX)<<32); + tmp64u2 = R_EBX | (((uint64_t)R_ECX)<<32); + do { + uint64_t tmp64u3 = native_lock_read_dd((void*)(((uintptr_t)ED)&~7LL)); + uint64_t tmp64u4 = ED->q[0]; + if(tmp64u4==tmp64u) { + tmp32s = native_lock_write_dd((void*)(((uintptr_t)ED)&~7LL), tmp64u2); + if(!tmp32s) { + native_lock_store_dd(ED, tmp64u2); + SET_FLAG(F_ZF); + } + } else { + tmp32s = 0; + CLEAR_FLAG(F_ZF); + R_RAX = tmp64u4&0xffffffff; + R_RDX = (tmp64u4>>32)&0xffffffff; + } + } while(tmp32s); + #else + tmp64u = R_EAX | (((uint64_t)R_EDX)<<32); do { native_lock_get_b(ED); - tmp64u = ED->q[0]; - if((R_EAX == (tmp64u&0xffffffff)) && (R_EDX == ((tmp64u>>32)&0xffffffff))) { + tmp64u2 = ED->q[0]; + if(tmp64u == tmp64u2) { SET_FLAG(F_ZF); tmp32s = native_lock_write_b(ED, emu->regs[_BX].byte[0]); if(!tmp32s) ED->q[0] = R_EBX|(((uint64_t)R_ECX)<<32); } else { CLEAR_FLAG(F_ZF); - R_RAX = tmp64u&0xffffffff; - R_RDX = (tmp64u>>32)&0xffffffff; + R_RAX = tmp64u2&0xffffffff; + R_RDX = (tmp64u2>>32)&0xffffffff; tmp32s = 0; } } while(tmp32s); - } else - do { - tmp64u = native_lock_read_dd(ED); - if((R_EAX == (tmp64u&0xffffffff)) && (R_EDX == ((tmp64u>>32)&0xffffffff))) { + #endif + } else { + tmp64u = R_EAX | (((uint64_t)R_EDX)<<32); + tmp64u2 = R_EBX | (((uint64_t)R_ECX)<<32); + tmp64u2 = (uint64_t)native_lock_storeifref2(ED, (void*)tmp64u2, (void*)tmp64u); + if(tmp64u2==tmp64u) { SET_FLAG(F_ZF); - tmp32s = native_lock_write_dd(ED, R_EBX|(((uint64_t)R_ECX)<<32)); } else { CLEAR_FLAG(F_ZF); - R_RAX = tmp64u&0xffffffff; - R_RDX = (tmp64u>>32)&0xffffffff; - tmp32s = 0; + R_RAX = tmp64u2&0xffffffff; + R_RDX = (tmp64u2>>32)&0xffffffff; } - } while(tmp32s); + } + } #else pthread_mutex_lock(&my_context->mutex_lock); if(rex.w) { @@ -888,27 +954,24 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) } break; - case 0x66: - #ifdef TEST_INTERPRETER - return Test66F0(test, rex, addr); - #else - return Run66F0(emu, rex, addr); // more opcode F0 66 and 66 F0 is the same - #endif - case 0x80: /* GRP Eb,Ib */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETEB(1); tmp8u = F8; #if defined(DYNAREC) && !defined(TEST_INTERPRETER) switch((nextop>>3)&7) { case 0: do { tmp8u2 = native_lock_read_b(EB); tmp8u2 = add8(emu, tmp8u2, tmp8u);} while(native_lock_write_b(EB, tmp8u2)); break; case 1: do { tmp8u2 = native_lock_read_b(EB); tmp8u2 = or8(emu, tmp8u2, tmp8u);} while(native_lock_write_b(EB, tmp8u2)); break; - case 2: do { tmp8u2 = native_lock_read_b(EB); tmp8u2 = adc8(emu, tmp8u2, tmp8u);} while(native_lock_write_b(EB, tmp8u2)); break; - case 3: do { tmp8u2 = native_lock_read_b(EB); tmp8u2 = sbb8(emu, tmp8u2, tmp8u);} while(native_lock_write_b(EB, tmp8u2)); break; + case 2: CHECK_FLAGS(emu); eflags=emu->eflags; do { emu->eflags=eflags; tmp8u2 = native_lock_read_b(EB); tmp8u2 = adc8(emu, tmp8u2, tmp8u);} while(native_lock_write_b(EB, tmp8u2)); break; + case 3: CHECK_FLAGS(emu); eflags=emu->eflags; do { emu->eflags=eflags; tmp8u2 = native_lock_read_b(EB); tmp8u2 = sbb8(emu, tmp8u2, tmp8u);} while(native_lock_write_b(EB, tmp8u2)); break; case 4: do { tmp8u2 = native_lock_read_b(EB); tmp8u2 = and8(emu, tmp8u2, tmp8u);} while(native_lock_write_b(EB, tmp8u2)); break; case 5: do { tmp8u2 = native_lock_read_b(EB); tmp8u2 = sub8(emu, tmp8u2, tmp8u);} while(native_lock_write_b(EB, tmp8u2)); break; case 6: do { tmp8u2 = native_lock_read_b(EB); tmp8u2 = xor8(emu, tmp8u2, tmp8u);} while(native_lock_write_b(EB, tmp8u2)); break; - case 7: cmp8(emu, EB->byte[0], tmp8u); break; + case 7: emu->error |= ERR_ILLEGAL; return 0; } #else pthread_mutex_lock(&my_context->mutex_lock); @@ -920,7 +983,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) case 4: EB->byte[0] = and8(emu, EB->byte[0], tmp8u); break; case 5: EB->byte[0] = sub8(emu, EB->byte[0], tmp8u); break; case 6: EB->byte[0] = xor8(emu, EB->byte[0], tmp8u); break; - case 7: cmp8(emu, EB->byte[0], tmp8u); break; + case 7: emu->error |= ERR_ILLEGAL; return 0; } pthread_mutex_unlock(&my_context->mutex_lock); #endif @@ -928,6 +991,10 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0x81: /* GRP Ed,Id */ case 0x83: /* GRP Ed,Ib */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETED((opcode==0x81)?4:1); if(opcode==0x83) { tmp64s = F8S; @@ -935,52 +1002,39 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) } else tmp64u = F32S64; #if defined(DYNAREC) && !defined(TEST_INTERPRETER) - if(rex.w) { + if(rex.w) switch((nextop>>3)&7) { case 0: do { tmp64u2 = native_lock_read_dd(ED); tmp64u2 = add64(emu, tmp64u2, tmp64u);} while(native_lock_write_dd(ED, tmp64u2)); break; case 1: do { tmp64u2 = native_lock_read_dd(ED); tmp64u2 = or64(emu, tmp64u2, tmp64u);} while(native_lock_write_dd(ED, tmp64u2)); break; - case 2: do { tmp64u2 = native_lock_read_dd(ED); tmp64u2 = adc64(emu, tmp64u2, tmp64u);} while(native_lock_write_dd(ED, tmp64u2)); break; - case 3: do { tmp64u2 = native_lock_read_dd(ED); tmp64u2 = sbb64(emu, tmp64u2, tmp64u);} while(native_lock_write_dd(ED, tmp64u2)); break; + case 2: CHECK_FLAGS(emu); eflags=emu->eflags; do { emu->eflags=eflags; tmp64u2 = native_lock_read_dd(ED); tmp64u2 = adc64(emu, tmp64u2, tmp64u);} while(native_lock_write_dd(ED, tmp64u2)); break; + case 3: CHECK_FLAGS(emu); eflags=emu->eflags; do { emu->eflags=eflags; tmp64u2 = native_lock_read_dd(ED); tmp64u2 = sbb64(emu, tmp64u2, tmp64u);} while(native_lock_write_dd(ED, tmp64u2)); break; case 4: do { tmp64u2 = native_lock_read_dd(ED); tmp64u2 = and64(emu, tmp64u2, tmp64u);} while(native_lock_write_dd(ED, tmp64u2)); break; case 5: do { tmp64u2 = native_lock_read_dd(ED); tmp64u2 = sub64(emu, tmp64u2, tmp64u);} while(native_lock_write_dd(ED, tmp64u2)); break; case 6: do { tmp64u2 = native_lock_read_dd(ED); tmp64u2 = xor64(emu, tmp64u2, tmp64u);} while(native_lock_write_dd(ED, tmp64u2)); break; - case 7: cmp64(emu, ED->q[0], tmp64u); break; + case 7: emu->error |= ERR_ILLEGAL; return 0; + } + else + switch((nextop>>3)&7) { + case 0: if(((uintptr_t)ED)&3) { + // unaligned case + do { tmp32u2 = native_lock_read_b(ED); tmp32u2=ED->dword[0]; tmp32u2 = add32(emu, tmp32u2, tmp64u);} while(native_lock_write_b(ED, tmp32u2)); ED->dword[0]=tmp32u2; break; + } else { + do { tmp32u2 = native_lock_read_d(ED); tmp32u2 = add32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; } + case 1: do { tmp32u2 = native_lock_read_d(ED); tmp32u2 = or32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; + case 2: CHECK_FLAGS(emu); eflags=emu->eflags; do { emu->eflags=eflags; tmp32u2 = native_lock_read_d(ED); tmp32u2 = adc32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; + case 3: CHECK_FLAGS(emu); eflags=emu->eflags; do { emu->eflags=eflags; tmp32u2 = native_lock_read_d(ED); tmp32u2 = sbb32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; + case 4: do { tmp32u2 = native_lock_read_d(ED); tmp32u2 = and32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; + case 5: if(((uintptr_t)ED)&3) { + // unaligned case + do { tmp32u2 = native_lock_read_b(ED); tmp32u2=ED->dword[0]; tmp32u2 = sub32(emu, tmp32u2, tmp64u);} while(native_lock_write_b(ED, tmp32u2)); ED->dword[0]=tmp32u2; break; + } else { + do { tmp32u2 = native_lock_read_d(ED); tmp32u2 = sub32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; } + case 6: do { tmp32u2 = native_lock_read_d(ED); tmp32u2 = xor32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; + case 7: emu->error |= ERR_ILLEGAL; return 0; } - } else { - if(MODREG) - switch((nextop>>3)&7) { - case 0: ED->q[0] = add32(emu, ED->dword[0], tmp64u); break; - case 1: ED->q[0] = or32(emu, ED->dword[0], tmp64u); break; - case 2: ED->q[0] = adc32(emu, ED->dword[0], tmp64u); break; - case 3: ED->q[0] = sbb32(emu, ED->dword[0], tmp64u); break; - case 4: ED->q[0] = and32(emu, ED->dword[0], tmp64u); break; - case 5: ED->q[0] = sub32(emu, ED->dword[0], tmp64u); break; - case 6: ED->q[0] = xor32(emu, ED->dword[0], tmp64u); break; - case 7: cmp32(emu, ED->dword[0], tmp64u); break; - } - else - switch((nextop>>3)&7) { - case 0: if(((uintptr_t)ED)&3) { - // unaligned case - do { tmp32u2 = native_lock_read_b(ED); tmp32u2=ED->dword[0]; tmp32u2 = add32(emu, tmp32u2, tmp64u);} while(native_lock_write_b(ED, tmp32u2)); ED->dword[0]=tmp32u2; break; - } else { - do { tmp32u2 = native_lock_read_d(ED); tmp32u2 = add32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; } - case 1: do { tmp32u2 = native_lock_read_d(ED); tmp32u2 = or32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; - case 2: do { tmp32u2 = native_lock_read_d(ED); tmp32u2 = adc32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; - case 3: do { tmp32u2 = native_lock_read_d(ED); tmp32u2 = sbb32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; - case 4: do { tmp32u2 = native_lock_read_d(ED); tmp32u2 = and32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; - case 5: if(((uintptr_t)ED)&3) { - // unaligned case - do { tmp32u2 = native_lock_read_b(ED); tmp32u2=ED->dword[0]; tmp32u2 = sub32(emu, tmp32u2, tmp64u);} while(native_lock_write_b(ED, tmp32u2)); ED->dword[0]=tmp32u2; break; - } else { - do { tmp32u2 = native_lock_read_d(ED); tmp32u2 = sub32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; } - case 6: do { tmp32u2 = native_lock_read_d(ED); tmp32u2 = xor32(emu, tmp32u2, tmp64u);} while(native_lock_write_d(ED, tmp32u2)); break; - case 7: cmp32(emu, ED->dword[0], tmp64u); break; - } - } #else pthread_mutex_lock(&my_context->mutex_lock); - if(rex.w) { + if(rex.w) switch((nextop>>3)&7) { case 0: ED->q[0] = add64(emu, ED->q[0], tmp64u); break; case 1: ED->q[0] = or64(emu, ED->q[0], tmp64u); break; @@ -989,105 +1043,80 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) case 4: ED->q[0] = and64(emu, ED->q[0], tmp64u); break; case 5: ED->q[0] = sub64(emu, ED->q[0], tmp64u); break; case 6: ED->q[0] = xor64(emu, ED->q[0], tmp64u); break; - case 7: cmp64(emu, ED->q[0], tmp64u); break; + case 7: emu->error |= ERR_ILLEGAL; return 0; + } + else + switch((nextop>>3)&7) { + case 0: ED->dword[0] = add32(emu, ED->dword[0], tmp64u); break; + case 1: ED->dword[0] = or32(emu, ED->dword[0], tmp64u); break; + case 2: ED->dword[0] = adc32(emu, ED->dword[0], tmp64u); break; + case 3: ED->dword[0] = sbb32(emu, ED->dword[0], tmp64u); break; + case 4: ED->dword[0] = and32(emu, ED->dword[0], tmp64u); break; + case 5: ED->dword[0] = sub32(emu, ED->dword[0], tmp64u); break; + case 6: ED->dword[0] = xor32(emu, ED->dword[0], tmp64u); break; + case 7: emu->error |= ERR_ILLEGAL; return 0; } - } else { - if((nextop&0xC0)==0xC0) - switch((nextop>>3)&7) { - case 0: ED->q[0] = add32(emu, ED->dword[0], tmp64u); break; - case 1: ED->q[0] = or32(emu, ED->dword[0], tmp64u); break; - case 2: ED->q[0] = adc32(emu, ED->dword[0], tmp64u); break; - case 3: ED->q[0] = sbb32(emu, ED->dword[0], tmp64u); break; - case 4: ED->q[0] = and32(emu, ED->dword[0], tmp64u); break; - case 5: ED->q[0] = sub32(emu, ED->dword[0], tmp64u); break; - case 6: ED->q[0] = xor32(emu, ED->dword[0], tmp64u); break; - case 7: cmp32(emu, ED->dword[0], tmp64u); break; - } - else - switch((nextop>>3)&7) { - case 0: ED->dword[0] = add32(emu, ED->dword[0], tmp64u); break; - case 1: ED->dword[0] = or32(emu, ED->dword[0], tmp64u); break; - case 2: ED->dword[0] = adc32(emu, ED->dword[0], tmp64u); break; - case 3: ED->dword[0] = sbb32(emu, ED->dword[0], tmp64u); break; - case 4: ED->dword[0] = and32(emu, ED->dword[0], tmp64u); break; - case 5: ED->dword[0] = sub32(emu, ED->dword[0], tmp64u); break; - case 6: ED->dword[0] = xor32(emu, ED->dword[0], tmp64u); break; - case 7: cmp32(emu, ED->dword[0], tmp64u); break; - } - } pthread_mutex_unlock(&my_context->mutex_lock); #endif break; case 0x86: /* XCHG Eb,Gb */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } #if defined(DYNAREC) && !defined(TEST_INTERPRETER) GETEB(0); GETGB; - if(MODREG) { // reg / reg: no lock - tmp8u = GB; - GB = EB->byte[0]; - EB->byte[0] = tmp8u; - } else { - do { - tmp8u = native_lock_read_b(EB); - } while(native_lock_write_b(EB, GB)); - GB = tmp8u; - } + do { + tmp8u = native_lock_read_b(EB); + } while(native_lock_write_b(EB, GB)); + GB = tmp8u; #else GETEB(0); GETGB; - if(!MODREG) - pthread_mutex_lock(&my_context->mutex_lock); // XCHG always LOCK (but when accessing memory only) + pthread_mutex_lock(&my_context->mutex_lock); // XCHG always LOCK (but when accessing memory only) tmp8u = GB; GB = EB->byte[0]; EB->byte[0] = tmp8u; - if(!MODREG) - pthread_mutex_unlock(&my_context->mutex_lock); + pthread_mutex_unlock(&my_context->mutex_lock); #endif break; case 0x87: /* XCHG Ed,Gd */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } #if defined(DYNAREC) && !defined(TEST_INTERPRETER) GETED(0); GETGD; - if(MODREG) { - if(rex.w) { - tmp64u = GD->q[0]; - GD->q[0] = ED->q[0]; - ED->q[0] = tmp64u; + if(rex.w) { + if((uintptr_t)ED&7) { + // unaligned + do { + tmp64u = ED->q[0] & 0xffffffffffffff00LL; + tmp64u |= native_lock_read_b(ED); + + } while(native_lock_write_b(ED, GD->byte[0])); + ED->q[0] = GD->q[0]; + GD->q[0] = tmp64u; } else { - tmp32u = GD->dword[0]; - GD->q[0] = ED->dword[0]; - ED->q[0] = tmp32u; + GD->q[0] = native_lock_xchg_dd(ED, GD->q[0]); } } else { - if(rex.w) { - if((uintptr_t)ED&7) { - // unaligned - do { - tmp64u = ED->q[0] & 0xffffffffffffff00LL; - tmp64u |= native_lock_read_b(ED); - - } while(native_lock_write_b(ED, GD->byte[0])); - ED->q[0] = GD->q[0]; - GD->q[0] = tmp64u; - } else { - GD->q[0] = native_lock_xchg_dd(ED, GD->q[0]); - } + if((uintptr_t)ED&3) { + // unaligned + do { + tmp32u = ED->dword[0] & 0xffffff00; + tmp32u |= native_lock_read_b(ED); + + } while(native_lock_write_b(ED, GD->byte[0])); + ED->dword[0] = GD->dword[0]; + GD->dword[0] = tmp32u; } else { - if((uintptr_t)ED&3) { - // unaligned - do { - tmp32u = ED->dword[0] & 0xffffff00; - tmp32u |= native_lock_read_b(ED); - - } while(native_lock_write_b(ED, GD->byte[0])); - ED->dword[0] = GD->dword[0]; - GD->dword[0] = tmp32u; - } else { - GD->dword[0] = native_lock_xchg_d(ED, GD->dword[0]); - } + GD->dword[0] = native_lock_xchg_d(ED, GD->dword[0]); } } #else @@ -1101,10 +1130,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) } else { tmp32u = GD->dword[0]; GD->q[0] = ED->dword[0]; - if(MODREG) - ED->q[0] = tmp32u; - else - ED->dword[0] = tmp32u; + ED->dword[0] = tmp32u; } pthread_mutex_unlock(&my_context->mutex_lock); #endif @@ -1112,6 +1138,10 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xF6: /* GRP3 Eb(,Ib) */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } tmp8u = (nextop>>3)&7; GETEB((tmp8u<2)?1:0); switch(tmp8u) { @@ -1125,6 +1155,44 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) pthread_mutex_lock(&my_context->mutex_lock); EB->byte[0] = not8(emu, EB->byte[0]); pthread_mutex_unlock(&my_context->mutex_lock); +#endif + break; + default: + return 0; + } + break; + case 0xF7: /* GRP3 Ed(,Id) */ + nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } + tmp8u = (nextop>>3)&7; + GETED((tmp8u<2)?4:0); + switch(tmp8u) { + case 2: /* NOT Ed */ +#if defined(DYNAREC) && !defined(TEST_INTERPRETER) + if(rex.w) + do { + tmp64u = native_lock_read_dd(ED); + tmp64u = not64(emu, tmp64u); + } while(native_lock_write_dd(ED, tmp64u)); + else { + do { + tmp32u = native_lock_read_d(ED); + tmp32u = not32(emu, tmp32u); + } while(native_lock_write_d(ED, tmp32u)); + } +#else + if(rex.w) { + pthread_mutex_lock(&my_context->mutex_lock); + ED->q[0] = not64(emu, ED->q[0]); + pthread_mutex_unlock(&my_context->mutex_lock); + } else { + pthread_mutex_lock(&my_context->mutex_lock); + ED->dword[0] = not32(emu, ED->dword[0]); + pthread_mutex_unlock(&my_context->mutex_lock); + } #endif break; default: @@ -1134,6 +1202,10 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xFE: /* GRP 5 Eb */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETED(0); switch((nextop>>3)&7) { case 0: /* INC Eb */ @@ -1159,14 +1231,16 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) #endif break; default: - printf_log(LOG_NONE, "Illegal Opcode 0xF0 0xFE 0x%02X 0x%02X\n", nextop, PK(0)); - emu->quit=1; emu->error |= ERR_ILLEGAL; - break; + return 0; } break; case 0xFF: /* GRP 5 Ed */ nextop = F8; + if(MODREG) { + emu->error |= ERR_ILLEGAL; + return 0; + } GETED(0); switch((nextop>>3)&7) { case 0: /* INC Ed */ @@ -1200,17 +1274,13 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) tmp32u = native_lock_read_d(ED); } while(native_lock_write_d(ED, inc32(emu, tmp32u))); } - if(MODREG) ED->dword[1] = 0; } #else pthread_mutex_lock(&my_context->mutex_lock); if(rex.w) { ED->q[0] = inc64(emu, ED->q[0]); } else { - if(MODREG) - ED->q[0] = inc32(emu, ED->dword[0]); - else - ED->dword[0] = inc32(emu, ED->dword[0]); + ED->dword[0] = inc32(emu, ED->dword[0]); } pthread_mutex_unlock(&my_context->mutex_lock); #endif @@ -1232,32 +1302,38 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) tmp64u = native_lock_read_dd(ED); } while(native_lock_write_dd(ED, dec64(emu, tmp64u))); else { - do { - tmp32u = native_lock_read_d(ED); - } while(native_lock_write_d(ED, dec32(emu, tmp32u))); - if(MODREG) ED->dword[1] = 0; + if((uintptr_t)ED&3) { + //meh. + do { + tmp32u = ED->dword[0]; + tmp32u &=~0xff; + tmp32u |= native_lock_read_b(ED); + tmp32u = dec32(emu, tmp32u); + } while(native_lock_write_b(ED, tmp32u&0xff)); + ED->dword[0] = tmp32u; + } else { + do { + tmp32u = native_lock_read_d(ED); + } while(native_lock_write_d(ED, dec32(emu, tmp32u))); + } } #else pthread_mutex_lock(&my_context->mutex_lock); if(rex.w) { ED->q[0] = dec64(emu, ED->q[0]); } else { - if(MODREG) - ED->q[0] = dec32(emu, ED->dword[0]); - else - ED->dword[0] = dec32(emu, ED->dword[0]); + ED->dword[0] = dec32(emu, ED->dword[0]); } pthread_mutex_unlock(&my_context->mutex_lock); #endif break; default: - printf_log(LOG_NONE, "Illegal Opcode 0xF0 0xFF 0x%02X 0x%02X\n", nextop, PK(0)); - emu->quit=1; emu->error |= ERR_ILLEGAL; - break; + return 0; } break; default: + emu->error |= ERR_ILLEGAL; return 0; } return addr; diff --git a/src/emu/x64runf20f.c b/src/emu/x64runf20f.c index 92292f3..26beaf3 100644 --- a/src/emu/x64runf20f.c +++ b/src/emu/x64runf20f.c @@ -5,14 +5,14 @@ #include #include #include -#include #include #include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" @@ -20,6 +20,7 @@ #include "x87emu_private.h" #include "box64context.h" #include "bridge.h" +#include "emit_signals.h" #include "modrm.h" @@ -35,12 +36,12 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) uint8_t tmp8u; int32_t tmp32s; int64_t tmp64s0, tmp64s1; + uint64_t tmp64u; reg64_t *oped, *opgd; sse_regs_t *opex, *opgx, eax1; mmx87_regs_t *opgm; - #ifndef NOALIGN + int mask_nan[4]; int is_nan; - #endif #ifdef TEST_INTERPRETER x64emu_t*emu = test->emu; #endif @@ -87,18 +88,25 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) GX->d[0] = ED->sdword[0]; } break; - + case 0x2B: /* MOVNTSD Ex, Gx */ + nextop = F8; + if(!MODREG) { + GETEX8(0); + GETGX; + EX->q[0] = GX->q[0]; + } + break; case 0x2C: /* CVTTSD2SI Gd, Ex */ nextop = F8; _GETEX(0); GETGD; if(rex.w) - if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>0x7fffffffffffffffLL) + if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>=(double)0x7fffffffffffffffLL) GD->q[0] = 0x8000000000000000LL; else GD->sq[0] = EX->d[0]; else { - if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>0x7fffffff) + if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>(double)0x7fffffff) GD->dword[0] = 0x80000000; else GD->sdword[0] = EX->d[0]; @@ -110,7 +118,7 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) _GETEX(0); GETGD; if(rex.w) { - if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>0x7fffffffffffffffLL) + if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>=(double)0x7fffffffffffffffLL) GD->q[0] = 0x8000000000000000LL; else switch(emu->mxcsr.f.MXCSR_RC) { @@ -132,7 +140,7 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) break; } } else { - if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>0x7fffffff) + if(isnan(EX->d[0]) || isinf(EX->d[0]) || EX->d[0]>(double)0x7fffffff) GD->dword[0] = 0x80000000; else switch(emu->mxcsr.f.MXCSR_RC) { @@ -201,6 +209,8 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) GETGX; if(EX->d[0]<0.0 ) GX->d[0] = -NAN; + else if(isnan(EX->d[0])) + GX->d[0] = EX->d[0]; else GX->d[0] = sqrt(EX->d[0]); break; @@ -209,25 +219,24 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) nextop = F8; _GETEX(0); GETGX; - #ifndef NOALIGN - // add generate a -NAN only if doing inf + -inf - if((isinf(GX->d[0]) && isinf(EX->d[0]) && (EX->q[0]&0x8000000000000000LL)!=(GX->q[0]&0x8000000000000000LL))) - GX->d[0] = -NAN; - else - #endif - GX->d[0] += EX->d[0]; + MARK_NAN_D_2(GX, EX); + { + NAN_PROPAGATION(GX->d[0], EX->d[0], break); + GX->d[0] += EX->d[0]; + } + CHECK_NAN_D(GX); break; case 0x59: /* MULSD Gx, Ex */ nextop = F8; _GETEX(0); GETGX; - #ifndef NOALIGN - // mul generate a -NAN only if doing (+/-)inf * (+/-)0 - if((isinf(GX->d[0]) && EX->d[0]==0.0) || (isinf(EX->d[0]) && GX->d[0]==0.0)) - GX->d[0] = -NAN; - else - #endif - GX->d[0] *= EX->d[0]; + // mul generate a -NAN only if doing (+/-)inf * (+/-)0 + MARK_NAN_D_2(GX, EX); + { + NAN_PROPAGATION(GX->d[0], EX->d[0], break); + GX->d[0] *= EX->d[0]; + } + CHECK_NAN_D(GX); break; case 0x5A: /* CVTSD2SS Gx, Ex */ nextop = F8; @@ -240,43 +249,34 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) nextop = F8; _GETEX(0); GETGX; - #ifndef NOALIGN - // sub generate a -NAN only if doing inf - inf - if((isinf(GX->d[0]) && isinf(EX->d[0]) && (EX->q[0]&0x8000000000000000LL)==(GX->q[0]&0x8000000000000000LL))) - GX->d[0] = -NAN; - else - #endif - GX->d[0] -= EX->d[0]; + MARK_NAN_D_2(GX, EX); + { + NAN_PROPAGATION(GX->d[0], EX->d[0], break); + GX->d[0] -= EX->d[0]; + } + CHECK_NAN_D(GX); break; case 0x5D: /* MINSD Gx, Ex */ nextop = F8; _GETEX(0); GETGX; - if (GX->d[0] == 0.0 && EX->d[0] == 0.0) - GX->d[0] = EX->d[0]; - if (isnan(GX->d[0]) || isnan(EX->d[0]) || isless(EX->d[0], GX->d[0])) + if (isnan(GX->d[0]) || isnan(EX->d[0]) || islessequal(EX->d[0], GX->d[0])) GX->d[0] = EX->d[0]; break; case 0x5E: /* DIVSD Gx, Ex */ nextop = F8; _GETEX(0); GETGX; - #ifndef NOALIGN - is_nan = isnan(GX->d[0]) || isnan(EX->d[0]); - #endif + MARK_NAN_D_2(GX, EX); + NAN_PROPAGATION(GX->d[0], EX->d[0], break); GX->d[0] /= EX->d[0]; - #ifndef NOALIGN - if(!is_nan && isnan(GX->d[0])) - GX->d[0] = -NAN; - #endif + CHECK_NAN_D(GX); break; case 0x5F: /* MAXSD Gx, Ex */ nextop = F8; _GETEX(0); GETGX; - if (GX->d[0] == 0.0 && EX->d[0] == 0.0) - GX->d[0] = EX->d[0]; - if (isnan(GX->d[0]) || isnan(EX->d[0]) || isgreater(EX->d[0], GX->d[0])) + if (isnan(GX->d[0]) || isnan(EX->d[0]) || isgreaterequal(EX->d[0], GX->d[0])) GX->d[0] = EX->d[0]; break; @@ -296,33 +296,82 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) } break; + case 0x78: /* INSERTQ Gx, Ex, ib, ib */ + // AMD only + nextop = F8; + if(!BOX64ENV(cputype) || !(MODREG)) { + #ifndef TEST_INTERPRETER + EmitSignal(emu, X64_SIGILL, (void*)R_RIP, 0); + #endif + } else { + //TODO: test /r + GETGX; + GETEX(2); + tmp8s = F8&0x3f; + tmp8u = F8&0x3f; + tmp64u = (1<<(tmp8s+1))-1; + GX->q[0] &=~(tmp64u<q[0] |= (EX->q[0]&tmp64u)<ub[8]&0x3f; + tmp8s = EX->ub[9]&0x3f; + tmp64u = (1<<(tmp8s+1))-1; + GX->q[0] &=~(tmp64u<q[0] |= (EX->q[0]&tmp64u)<f[0]) || isnanf(GX->f[1]); + mask_nan[1] = isnanf(GX->f[2]) || isnanf(GX->f[3]); GX->f[0] += GX->f[1]; GX->f[1] = GX->f[2] + GX->f[3]; if(EX==GX) { - GX->f[2] = GX->f[0]; - GX->f[3] = GX->f[1]; + GX->q[1] = GX->q[0]; + mask_nan[2] = mask_nan[0]; + mask_nan[3] = mask_nan[1]; } else { + mask_nan[2] = isnanf(EX->f[0]) || isnanf(EX->f[1]); + mask_nan[3] = isnanf(EX->f[2]) || isnanf(EX->f[3]); GX->f[2] = EX->f[0] + EX->f[1]; GX->f[3] = EX->f[2] + EX->f[3]; } + CHECK_NAN_VF(GX); break; case 0x7D: /* HSUBPS Gx, Ex */ nextop = F8; _GETEX(0); GETGX; + mask_nan[0] = isnanf(GX->f[0]) || isnanf(GX->f[1]); + mask_nan[1] = isnanf(GX->f[2]) || isnanf(GX->f[3]); GX->f[0] -= GX->f[1]; GX->f[1] = GX->f[2] - GX->f[3]; if(EX==GX) { - GX->f[2] = GX->f[0]; - GX->f[3] = GX->f[1]; + GX->q[1] = GX->q[0]; + mask_nan[2] = mask_nan[0]; + mask_nan[3] = mask_nan[1]; } else { + mask_nan[2] = isnanf(EX->f[0]) || isnanf(EX->f[1]); + mask_nan[3] = isnanf(EX->f[2]) || isnanf(EX->f[3]); GX->f[2] = EX->f[0] - EX->f[1]; GX->f[3] = EX->f[2] - EX->f[3]; } + CHECK_NAN_VF(GX); break; GOCOND(0x80 @@ -330,7 +379,17 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) , addr += tmp32s; ,,STEP3 ) /* 0x80 -> 0x8F Jxx */ - + + case 0xA5: // ignore F2 prefix + case 0xB7: + case 0xBA: + case 0xBC: // this one is still BSR, not TZCNT + #ifdef TEST_INTERPRETER + return Test0F(test, rex, addr-1, step); + #else + return Run0F(emu, rex, addr-1, step); + #endif + case 0xC2: /* CMPSD Gx, Ex, Ib */ nextop = F8; _GETEX(1); @@ -354,10 +413,12 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) nextop = F8; _GETEX(0); GETGX; + MARK_NAN_VF_2(GX, EX); GX->f[0] -= EX->f[0]; GX->f[1] += EX->f[1]; GX->f[2] -= EX->f[2]; GX->f[3] += EX->f[3]; + CHECK_NAN_VF(GX); break; case 0xD6: /* MOVDQ2Q Gm, Ex */ diff --git a/src/emu/x64runf30f.c b/src/emu/x64runf30f.c index d42586f..7d8e12f 100644 --- a/src/emu/x64runf30f.c +++ b/src/emu/x64runf30f.c @@ -9,24 +9,25 @@ #include #include +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64run_private.h" #include "x64primop.h" #include "x64trace.h" #include "x87emu_private.h" #include "box64context.h" +#include "emit_signals.h" #include "bridge.h" #include "modrm.h" #ifdef TEST_INTERPRETER -uintptr_t TestF30F(x64test_t *test, rex_t rex, uintptr_t addr) +uintptr_t TestF30F(x64test_t *test, rex_t rex, uintptr_t addr, int* step) #else -uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) +uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr, int* step) #endif { uint8_t opcode; @@ -42,11 +43,7 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) #ifdef TEST_INTERPRETER x64emu_t*emu = test->emu; #endif - - #ifdef __clang__ - extern int isinff(float); - extern int isnanf(float); - #endif + int is_nan; opcode = F8; @@ -75,7 +72,7 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) GX->ud[1] = GX->ud[0] = EX->ud[0]; GX->ud[3] = GX->ud[2] = EX->ud[2]; break; - + case 0x16: /* MOVSHDUP Gx, Ex */ nextop = F8; GETEX(0); @@ -98,18 +95,25 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) else GX->f[0] = ED->sdword[0]; break; - + case 0x2B: /* MOVNTSS Ex Gx */ + nextop = F8; + if(!MODREG) { + GETEX4(0); + GETGX; + EX->ud[0] = GX->ud[0]; + } + break; case 0x2C: /* CVTTSS2SI Gd, Ex */ nextop = F8; GETEX(0); GETGD; if (rex.w) { - if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>(float)0x7fffffffffffffffLL) + if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>=(float)0x7fffffffffffffffLL) GD->q[0] = 0x8000000000000000LL; else GD->sq[0] = EX->f[0]; } else { - if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>0x7fffffff) + if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>=(float)0x7fffffff) GD->dword[0] = 0x80000000; else GD->sdword[0] = EX->f[0]; @@ -121,7 +125,7 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) GETEX(0); GETGD; if(rex.w) { - if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>(float)0x7fffffffffffffffLL) + if(isnanf(EX->f[0]) || isinff(EX->f[0]) || EX->f[0]>=(float)0x7fffffffffffffffLL) GD->q[0] = 0x8000000000000000LL; else switch(emu->mxcsr.f.MXCSR_RC) { @@ -171,7 +175,7 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) GD->dword[1] = 0; } break; - + case 0x38: /* MAP 0F38 */ opcode = F8; switch(opcode) { @@ -185,13 +189,12 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) if (ACCESS_FLAG(F_OF)) { tmp64u = 1 + (GD->q[0] & 0xFFFFFFFF) + (ED->q[0] & 0xFFFFFFFF); tmp64u2 = 1 + GD->q[0] + ED->q[0]; - } - else { + } else { tmp64u = (GD->q[0] & 0xFFFFFFFF) + (ED->q[0] & 0xFFFFFFFF); tmp64u2 = GD->q[0] + ED->q[0]; - } + } tmp64u = (tmp64u >> 32) + (GD->q[0] >> 32) + (ED->q[0] >> 32); - CONDITIONAL_SET_FLAG(tmp64u & 0x100000000L, F_OF); + CONDITIONAL_SET_FLAG(tmp64u & 0x100000000LL, F_OF); GD->q[0] = tmp64u2; } else { if (ACCESS_FLAG(F_OF)) @@ -199,6 +202,7 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) else GD->q[0] = (uint64_t)GD->dword[0] + ED->dword[0]; CONDITIONAL_SET_FLAG(GD->q[0] & 0x100000000LL, F_OF); + GD->dword[1] = 0; } break; @@ -207,22 +211,47 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) } break; + GOCOND(0x40 + , nextop = F8; + GETED(0); + GETGD; + CHECK_FLAGS(emu); + , if(rex.w) {GD->q[0] = ED->q[0]; } else {GD->q[0] = ED->dword[0];} + , if(!rex.w) GD->dword[1] = 0; + , + ) /* 0x40 -> 0x4F CMOVxx Gd,Ed */ // conditional move, no sign + case 0x51: /* SQRTSS Gx, Ex */ nextop = F8; GETEX(0); GETGX; - GX->f[0] = sqrtf(EX->f[0]); + if (EX->f[0]<0) + GX->f[0] = -NAN; + else if (isnanf(EX->f[0])) + GX->f[0] = EX->f[0]; + else + GX->f[0] = sqrtf(EX->f[0]); break; case 0x52: /* RSQRTSS Gx, Ex */ nextop = F8; GETEX(0); GETGX; - GX->f[0] = 1.0f/sqrtf(EX->f[0]); + if(EX->f[0]==0) + GX->f[0] = 1.0f/EX->f[0]; + else if (EX->f[0]<0) + GX->f[0] = -NAN; + else if (isnan(EX->f[0])) + GX->f[0] = EX->f[0]; + else if (isinf(EX->f[0])) + GX->f[0] = 0.0; + else + GX->f[0] = 1.0f/sqrtf(EX->f[0]); break; case 0x53: /* RCPSS Gx, Ex */ nextop = F8; GETEX(0); GETGX; + NAN_PROPAGATION(GX->f[0], EX->f[0], break); GX->f[0] = 1.0f/EX->f[0]; break; @@ -230,13 +259,19 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) nextop = F8; GETEX(0); GETGX; + MARK_NAN_F_2(GX, EX); + NAN_PROPAGATION(GX->f[0], EX->f[0], break); GX->f[0] += EX->f[0]; + CHECK_NAN_F(GX); break; case 0x59: /* MULSS Gx, Ex */ nextop = F8; GETEX(0); GETGX; + MARK_NAN_F_2(GX, EX); + NAN_PROPAGATION(GX->f[0], EX->f[0], break); GX->f[0] *= EX->f[0]; + CHECK_NAN_F(GX); break; case 0x5A: /* CVTSS2SD Gx, Ex */ nextop = F8; @@ -264,26 +299,30 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) nextop = F8; GETEX(0); GETGX; + NAN_PROPAGATION(GX->f[0], EX->f[0], break); GX->f[0] -= EX->f[0]; break; case 0x5D: /* MINSS Gx, Ex */ nextop = F8; GETEX(0); GETGX; - if(isnan(GX->f[0]) || isnan(EX->f[0]) || isless(EX->f[0], GX->f[0])) + if(isnan(GX->f[0]) || isnan(EX->f[0]) || islessequal(EX->f[0], GX->f[0])) GX->f[0] = EX->f[0]; break; case 0x5E: /* DIVSS Gx, Ex */ nextop = F8; GETEX(0); GETGX; + MARK_NAN_F_2(GX, EX); + NAN_PROPAGATION(GX->f[0], EX->f[0], break); GX->f[0] /= EX->f[0]; + CHECK_NAN_F(GX); break; case 0x5F: /* MAXSS Gx, Ex */ nextop = F8; GETEX(0); GETGX; - if (isnan(GX->f[0]) || isnan(EX->f[0]) || isgreater(EX->f[0], GX->f[0])) + if (isnan(GX->f[0]) || isnan(EX->f[0]) || isgreaterequal(EX->f[0], GX->f[0])) GX->f[0] = EX->f[0]; break; @@ -323,6 +362,40 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) memcpy(EX, GX, 16); // unaligned... break; + case 0xAE: + nextop = F8; + switch((nextop>>3)&7) { + case 0: /* RDFSBASE */ + case 1: /* RDGSBASE */ + if(!rex.is32bits && MODREG) { + GETED(0); + int seg = _FS+((nextop>>3)&7); + uintptr_t addr = emu->segs_offs[seg]; + if(rex.w) + ED->q[0] = addr; + else { + ED->dword[0] = addr; + ED->dword[1] = 0; + } + } else { + return 0; + } + break; + case 2: /* WRFSBASE */ + case 3: /* WRGSBASE */ + if(!rex.is32bits && MODREG) { + GETED(0); + int seg = _FS+((nextop>>3)&7)-2; + uintptr_t base = rex.w?ED->q[0]:ED->dword[0]; + emu->segs_offs[seg] = base; + } else { + return 0; + } + break; + default: return 0; + } + break; + case 0xB8: /* POPCNT Gd,Ed */ nextop = F8; GETED(0); @@ -334,13 +407,20 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) RESET_FLAGS(emu); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_SF); - CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_PF); CONDITIONAL_SET_FLAG(GD->q[0]==0, F_ZF); break; + case 0xA5: // ignore F3 prefix + case 0xBA: + #ifdef TEST_INTERPRETER + return Test0F(test, rex, addr-1, step); + #else + return Run0F(emu, rex, addr-1, step); + #endif + case 0xBC: /* TZCNT Ed,Gd */ CHECK_FLAGS(emu); nextop = F8; @@ -373,7 +453,12 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) GD->q[0] = 32; } } - break; + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_SF); + CLEAR_FLAG(F_PF); + if(!BOX64ENV(cputype)) + CLEAR_FLAG(F_OF); + break; case 0xBD: /* LZCNT Ed,Gd */ CHECK_FLAGS(emu); nextop = F8; @@ -391,6 +476,11 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) CONDITIONAL_SET_FLAG(tmp8u==32, F_CF); } GD->q[0] = tmp8u; + CLEAR_FLAG(F_PF); + CLEAR_FLAG(F_AF); + CLEAR_FLAG(F_SF); + if(!BOX64ENV(cputype)) + CLEAR_FLAG(F_OF); break; case 0xC2: /* CMPSS Gx, Ex, Ib */ @@ -422,7 +512,7 @@ uintptr_t RunF30F(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0xE6: /* CVTDQ2PD Gx, Ex */ nextop = F8; - GETEX(0); + GETEX8(0); GETGX; GX->d[1] = EX->sd[1]; GX->d[0] = EX->sd[0]; diff --git a/src/emu/x64syscall.c b/src/emu/x64syscall.c index 9e30045..b851a0e 100644 --- a/src/emu/x64syscall.c +++ b/src/emu/x64syscall.c @@ -20,11 +20,14 @@ #include #include #include +#include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" +#include "box64cpu.h" #include "x64emu_private.h" #include "x64run_private.h" //#include "x64primop.h" @@ -33,7 +36,10 @@ #include "box64context.h" #include "callback.h" #include "signals.h" +#include "emit_signals.h" #include "x64tls.h" +#include "elfloader.h" +#include "x64int_private.h" typedef struct x64_sigaction_s x64_sigaction_t; typedef struct x64_stack_s x64_stack_t; @@ -46,6 +52,7 @@ extern int fchmodat (int __fd, const char *__file, mode_t __mode, int __flag); int of_convert(int flag); int32_t my_open(x64emu_t* emu, void* pathname, int32_t flags, uint32_t mode); ssize_t my_readlink(x64emu_t* emu, void* path, void* buf, size_t sz); +int my_readlinkat(x64emu_t* emu, int fd, void* path, void* buf, size_t bufsize); int my_stat(x64emu_t *emu, void* filename, void* buf); int my_lstat(x64emu_t *emu, void* filename, void* buf); int my_fstat(x64emu_t *emu, int fd, void* buf); @@ -62,6 +69,7 @@ void* my_mremap(x64emu_t* emu, void* old_addr, size_t old_size, size_t new_size, int32_t my_epoll_ctl(x64emu_t* emu, int32_t epfd, int32_t op, int32_t fd, void* event); int32_t my_epoll_wait(x64emu_t* emu, int32_t epfd, void* events, int32_t maxevents, int32_t timeout); int32_t my_epoll_pwait(x64emu_t* emu, int32_t epfd, void* events, int32_t maxevents, int32_t timeout, const sigset_t *sigmask); +int32_t my_epoll_pwait2(x64emu_t* emu, int epfd, void* events, int maxevents, struct timespec *timeout, sigset_t * sigmask); #endif pid_t my_vfork(x64emu_t* emu); int32_t my_fcntl(x64emu_t* emu, int32_t a, int32_t b, void* c); @@ -101,6 +109,7 @@ static const scwrap_t syscallwrap[] = { [16] = {__NR_ioctl, 3}, [17] = {__NR_pread64, 4}, [18] = {__NR_pwrite64, 4}, + [19] = {__NR_readv, 3}, [20] = {__NR_writev, 3}, #ifdef __NR_access [21] = {__NR_access, 2}, @@ -140,7 +149,7 @@ static const scwrap_t syscallwrap[] = { #endif //[58] = {__NR_vfork, 0}, //[59] = {__NR_execve, 3}, - [60] = {__NR_exit, 1}, // Nees wrapping? + [60] = {__NR_exit, 1}, // Needs wrapping? [61] = {__NR_wait4, 4}, [62] = {__NR_kill, 2 }, //[63] = {__NR_uname, 1}, // Needs wrapping, use old_utsname @@ -148,6 +157,7 @@ static const scwrap_t syscallwrap[] = { //[72] = {__NR_fnctl, 3}, // Needs wrapping, and not always defined anyway [73] = {__NR_flock, 2}, [74] = {__NR_fsync, 1}, + [77] = {__NR_ftruncate, 2}, #ifdef __NR_getdents [78] = {__NR_getdents, 3}, #endif @@ -183,6 +193,9 @@ static const scwrap_t syscallwrap[] = { [118] = {__NR_getresuid, 3}, [120] = {__NR_getresgid, 3}, [121] = {__NR_getpgid, 1}, + [122] = {__NR_setfsuid, 1}, + [123] = {__NR_setfsgid, 1}, + [124] = {__NR_getsid, 1}, [125] = {__NR_capget, 2}, [126] = {__NR_capset, 2}, [127] = {__NR_rt_sigpending, 2}, @@ -191,6 +204,8 @@ static const scwrap_t syscallwrap[] = { #ifdef __NR_mknod [133] = {__NR_mknod, 3}, #endif + [137] = {__NR_statfs, 2}, + [138] = {__NR_fstatfs, 2}, [140] = {__NR_getpriority, 2}, [145] = {__NR_sched_getscheduler, 1}, [148] = {__NR_sched_rr_get_interval, 2}, @@ -203,7 +218,11 @@ static const scwrap_t syscallwrap[] = { [160] = {__NR_setrlimit, 2}, #endif [161] = {__NR_chroot, 1}, + [165] = {__NR_mount, 5}, [186] = {__NR_gettid, 0 }, //0xBA + [194] = {__NR_listxattr, 3}, + [195] = {__NR_llistxattr, 3}, + [196] = {__NR_flistxattr, 3}, [200] = {__NR_tkill, 2 }, #ifdef __NR_time [201] = {__NR_time, 1}, @@ -254,14 +273,15 @@ static const scwrap_t syscallwrap[] = { [264] = {__NR_renameat, 4}, #endif [266] = {__NR_symlinkat, 3}, - [267] = {__NR_readlinkat, 4}, + //[267] = {__NR_readlinkat, 4}, [268] = {__NR_fchmodat, 3}, [270] = {__NR_pselect6, 6}, [272] = {__NR_unshare, 1}, [273] = {__NR_set_robust_list, 2}, [274] = {__NR_get_robust_list, 3}, + [280] = {__NR_utimensat, 4}, #ifdef NOALIGN - [281] = {__NR_epoll_pwait, 6}, + [281] = {__NR_epoll_pwait, 5}, #endif //[282] = {__NR__signalfd, 3}, #ifdef _NR_eventfd @@ -271,7 +291,9 @@ static const scwrap_t syscallwrap[] = { [288] = {__NR_accept4, 4}, [289] = {__NR_signalfd4, 4}, // this one might need some wrapping [290] = {__NR_eventfd2, 2}, + #ifdef NOALIGN [291] = {__NR_epoll_create1, 1}, + #endif [292] = {__NR_dup3, 3}, [293] = {__NR_pipe2, 2}, [294] = {__NR_inotify_init1, 1}, @@ -285,6 +307,7 @@ static const scwrap_t syscallwrap[] = { //[317] = {__NR_seccomp, 3}, [318] = {__NR_getrandom, 3}, [319] = {__NR_memfd_create, 2}, + //[323] = {__NR_userfaultfd, 1}, //disable for now [324] = {__NR_membarrier, 2}, #ifdef __NR_copy_file_range // TODO: call back if unavailable? @@ -294,9 +317,33 @@ static const scwrap_t syscallwrap[] = { // TODO: implement fallback if __NR_statx is not defined [332] = {__NR_statx, 5}, #endif + #ifdef __NR_io_uring_setup + [425] = {__NR_io_uring_setup, 2}, + #endif + #ifdef __NR_io_uring_enter + [426] = {__NR_io_uring_enter, 6}, + #endif + #ifdef __NR_io_uring_register + [427] = {__NR_io_uring_register, 4}, + #endif #ifdef __NR_fchmodat4 [434] = {__NR_fchmodat4, 4}, #endif + #ifdef __NR_faccessat2 + [439] = {__NR_faccessat2, 4}, + #endif + #if defined(__NR_epoll_pwait2) && defined(NOALIGN) + [441] = {__NR_epoll_pwait2, 5}, + #endif + #ifdef __NR_landlock_create_ruleset + [444] = {__NR_landlock_create_ruleset, 3}, + #endif + #ifdef __NR_landlock_add_rule + [445] = {__NR_landlock_add_rule, 4}, + #endif + #ifdef __NR_landlock_restrict_self + [446] = {__NR_landlock_restrict_self, 2}, + #endif //[449] = {__NR_futex_waitv, 5}, }; @@ -386,36 +433,64 @@ typedef struct old_utsname_s { // int xss; //}; -static int clone_fn(void* arg) +typedef struct clone_s { + x64emu_t* emu; + void* stack2free; + void* tls; +} clone_t; + +static int clone_fn_syscall(void* arg) { - x64emu_t *emu = (x64emu_t*)arg; + clone_t* args = arg; + x64emu_t *emu = args->emu; + thread_forget_emu(); thread_set_emu(emu); + //TODO: do something with TLS. Refresh libc tls with that? R_RAX = 0; DynaRun(emu); int ret = R_EAX; FreeX64Emu(&emu); - my_context->stack_clone_used = 0; - return ret; + void* stack2free = args->stack2free; + box_free(args); + if(my_context->stack_clone_used && !stack2free) + my_context->stack_clone_used = 0; + if(stack2free) + box_free(stack2free); // this free the stack, so it will crash very soon! + _exit(ret); } void EXPORT x64Syscall(x64emu_t *emu) +{ + // check if it's a wine process, then filter the syscall (simulate SECCMP) + if(box64_wine && !box64_is32bits) { + //64bits only here... + uintptr_t ret_addr = R_RIP-2; + if(/*ret_addr<0x700000000000LL &&*/ (my_context->signals[X64_SIGSYS]>2) && !FindElfAddress(my_context, ret_addr)) { + // not a linux elf, not a syscall to setup x86_64 arch. Signal SIGSYS + EmitSignal(emu, X64_SIGSYS, (void*)ret_addr, R_EAX&0xffff); // what are the parameters? + return; + } + } + return x64Syscall_linux(emu); +} +void EXPORT x64Syscall_linux(x64emu_t *emu) { RESET_FLAGS(emu); uint32_t s = R_EAX; // EAX? (syscalls only go up to 547 anyways) int log = 0; char t_buff[256] = "\0"; char t_buffret[128] = "\0"; - char buff2[64] = "\0"; + char buff2[128] = "\0"; char* buff = NULL; char* buffret = NULL; - if(box64_log>=LOG_DEBUG || cycle_log) { + if(BOX64ENV(log) >= LOG_DEBUG || BOX64ENV(rolling_log)) { log = 1; - buff = cycle_log?my_context->log_call[my_context->current_line]:t_buff; - buffret = cycle_log?my_context->log_ret[my_context->current_line]:t_buffret; - if(cycle_log) - my_context->current_line = (my_context->current_line+1)%cycle_log; + buff = BOX64ENV(rolling_log)?(my_context->log_call+256*my_context->current_line):t_buff; + buffret = BOX64ENV(rolling_log)?(my_context->log_ret+128*my_context->current_line):t_buffret; + if(BOX64ENV(rolling_log)) + my_context->current_line = (my_context->current_line+1)%BOX64ENV(rolling_log); snprintf(buff, 255, "%04d|%p: Calling syscall 0x%02X (%d) %p %p %p %p %p %p", GetTID(), (void*)R_RIP, s, s, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_R10, (void*)R_R8, (void*)R_R9); - if(!cycle_log) + if(!BOX64ENV(rolling_log)) printf_log(LOG_NONE, "%s", buff); } // check wrapper first @@ -424,21 +499,34 @@ void EXPORT x64Syscall(x64emu_t *emu) int sc = syscallwrap[s].nats; switch(syscallwrap[s].nbpars) { case 0: S_RAX = syscall(sc); break; - case 1: S_RAX = syscall(sc, R_RDI); break; - case 2: if(s==33) {if(log) snprintf(buff2, 63, " [sys_access(\"%s\", %ld)]", (char*)R_RDI, R_RSI);}; S_RAX = syscall(sc, R_RDI, R_RSI); break; - case 3: if(s==42) {if(log) snprintf(buff2, 63, " [sys_connect(%d, %p[type=%d], %d)]", R_EDI, (void*)R_RSI, *(unsigned short*)R_RSI, R_EDX);}; if(s==258) {if(log) snprintf(buff2, 63, " [sys_mkdirat(%d, %s, 0x%x]", R_EDI, (char*)R_RSI, R_EDX);}; S_RAX = syscall(sc, R_RDI, R_RSI, R_RDX); break; + case 1: + if(s==80) {if(log) snprintf(buff2, 127, " [sys_chdir(\"%s\")]", (char*)R_RDI);}; + S_RAX = syscall(sc, R_RDI); + break; + case 2: + if(s==33) {if(log) snprintf(buff2, 127, " [sys_access(\"%s\", %ld)]", (char*)R_RDI, R_RSI);}; + S_RAX = syscall(sc, R_RDI, R_RSI); + break; + case 3: + if(s==42) {if(log) snprintf(buff2, 127, " [sys_connect(%d, %p[type=%d], %d)]", R_EDI, (void*)R_RSI, *(unsigned short*)R_RSI, R_EDX);}; + if(s==258) {if(log) snprintf(buff2, 127, " [sys_mkdirat(%d, %s, 0x%x]", R_EDI, (char*)R_RSI, R_EDX);}; + S_RAX = syscall(sc, R_RDI, R_RSI, R_RDX); + break; case 4: S_RAX = syscall(sc, R_RDI, R_RSI, R_RDX, R_R10); break; - case 5: S_RAX = syscall(sc, R_RDI, R_RSI, R_RDX, R_R10, R_R8); break; + case 5: + if(s==165) {if(log) snprintf(buff2, 127, " [sys_mount(%s, %s, %s, 0x%lx, %s]", (char*)R_RDI, (char*)R_RSI, (char*)R_RDX, R_R10, R_R8?(char*)R_R8:"(nil)");}; + S_RAX = syscall(sc, R_RDI, R_RSI, R_RDX, R_R10, R_R8); + break; case 6: S_RAX = syscall(sc, R_RDI, R_RSI, R_RDX, R_R10, R_R8, R_R9); break; default: printf_log(LOG_NONE, "ERROR, Unimplemented syscall wrapper (%d, %d)\n", s, syscallwrap[s].nbpars); emu->quit = 1; return; } - if(S_RAX==-1 && errno>0) + if(S_EAX==-1 && errno>0) S_RAX = -errno; if(log) snprintf(buffret, 127, "0x%x%s", R_EAX, buff2); - if(log && !cycle_log) printf_log(LOG_NONE, "=> %s\n", buffret); + if(log && !BOX64ENV(rolling_log)) printf_log(LOG_NONE, "=> %s\n", buffret); return; } switch (s) { @@ -453,7 +541,7 @@ void EXPORT x64Syscall(x64emu_t *emu) S_RAX = -errno; break; case 2: // sys_open - if(s==5) {if (log) snprintf(buff2, 63, " [sys_open(\"%s\", %d, %d)]", (char*)R_RDI, of_convert(R_ESI), R_EDX);}; + if (log) snprintf(buff2, 127, "[sys_open \"%s\", 0x%x]", (char*)R_RDI, of_convert(R_ESI)); //S_RAX = open((void*)R_EDI, of_convert(R_ESI), R_EDX); S_RAX = my_open(emu, (void*)R_RDI, of_convert(R_ESI), R_EDX); if(S_RAX==-1) @@ -538,6 +626,7 @@ void EXPORT x64Syscall(x64emu_t *emu) S_RAX = pipe((void*)R_RDI); if(S_RAX==-1) S_RAX = -errno; + else if(log) printf_log(LOG_INFO, "[%d, %d]", ((int*)R_RDI)[0], ((int*)R_RDI)[1]); break; #endif #ifndef __NR_select @@ -568,38 +657,28 @@ void EXPORT x64Syscall(x64emu_t *emu) } else { if(R_RSI) { + uint64_t flags = R_RDI; void* stack_base = (void*)R_RSI; int stack_size = 0; - if(!R_RSI) { - // allocate a new stack... - int currstack = 0; - if((R_RSP>=(uintptr_t)emu->init_stack) && (R_RSP<=((uintptr_t)emu->init_stack+emu->size_stack))) - currstack = 1; - stack_size = (currstack && emu->size_stack)?emu->size_stack:(1024*1024); - stack_base = mmap(NULL, stack_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_GROWSDOWN, -1, 0); - // copy value from old stack to new stack - if(currstack) - memcpy(stack_base, emu->init_stack, stack_size); - else { - int size_to_copy = (uintptr_t)emu->init_stack + emu->size_stack - (R_RSP); - memcpy(stack_base+stack_size-size_to_copy, (void*)R_RSP, size_to_copy); - } - } + uintptr_t sp = R_RSI; x64emu_t * newemu = NewX64Emu(emu->context, R_RIP, (uintptr_t)stack_base, stack_size, (R_RSI)?0:1); SetupX64Emu(newemu, emu); - //CloneEmu(newemu, emu); - Push64(newemu, 0); - PushExit(newemu); + CloneEmu(newemu, emu); + clone_t* args = box_calloc(1, sizeof(clone_t)); + newemu->regs[_SP].q[0] = sp; // setup new stack pointer + args->emu = newemu; + if(flags&CLONE_SETTLS) args->tls = (void*)R_R9; void* mystack = NULL; if(my_context->stack_clone_used) { - mystack = box_malloc(1024*1024); // stack for own process... memory leak, but no practical way to remove it + args->stack2free = mystack = box_malloc(1024*1024); // stack for own process... } else { if(!my_context->stack_clone) my_context->stack_clone = box_malloc(1024*1024); mystack = my_context->stack_clone; my_context->stack_clone_used = 1; } - int64_t ret = clone(clone_fn, (void*)((uintptr_t)mystack+1024*1024), R_RDI, newemu, R_RDX, R_R8, R_R10); + flags&=~CLONE_SETTLS; // to be handled differently + int64_t ret = clone(clone_fn_syscall, (void*)((uintptr_t)mystack+1024*1024), flags, args, R_RDX, R_R8, R_R10); S_RAX = ret; } else @@ -716,6 +795,10 @@ void EXPORT x64Syscall(x64emu_t *emu) S_RAX = -errno; break; #endif + case 175: // sys_init_module + // huh? + S_RAX = -EPERM; + break; #ifndef __NR_time case 201: // sys_time R_RAX = (uintptr_t)time((void*)R_RDI); @@ -733,8 +816,10 @@ void EXPORT x64Syscall(x64emu_t *emu) #if !defined(__NR_epoll_ctl) || !defined(NOALIGN) case 233: S_RAX = my_epoll_ctl(emu, S_EDI, S_ESI, S_EDX, (void*)R_R10); - if(S_RAX==-1) + if(S_RAX==-1) { S_RAX = -errno; + if(log) snprintf(buff2, 127, "[err=%d/%s]", errno, strerror(errno)); + } break; #endif #ifndef __NR_inotify_init @@ -746,13 +831,15 @@ void EXPORT x64Syscall(x64emu_t *emu) #endif #ifndef NOALIGN case 257: + if (log) snprintf(buff2, 127, "[sys_openat %d, \"%s\", 0x%x]", S_EDI, (char*)R_RSI, of_convert(R_EDX)); S_RAX = syscall(__NR_openat, S_EDI, (void*)R_RSI, of_convert(S_EDX), R_R10d); if(S_RAX==-1) S_RAX = -errno; break; #endif case 262: - S_RAX = my_fstatat(emu, S_RDI, (char*)R_RSI, (void*)R_RDX, S_R10d); + S_RAX = my_fstatat(emu, S_EDI, (char*)R_RSI, (void*)R_RDX, S_R10d); + if (log) snprintf(buff2, 127, "[sys_fstatat %d, \"%s\", %p, 0x%x]", S_EDI, (char*)R_RSI, (void*)R_RDX, S_R10d); if(S_RAX==-1) S_RAX = -errno; break; @@ -763,8 +850,14 @@ void EXPORT x64Syscall(x64emu_t *emu) S_RAX = -errno; break; #endif + case 267: // sys_readlinkat + if(log) snprintf(buff2, 127, " [sys_readlinkat(%d, \"%s\"...]", S_EDI, (char*)R_RSI); + S_RAX = my_readlinkat(emu, S_EDI, (void*)R_RSI, (void*)R_RDX, R_R10); + if(S_RAX==-1) + S_RAX = -errno; + break; #ifndef NOALIGN - case 281: // sys_epool_pwait + case 281: // sys_epoll_pwait S_RAX = my_epoll_pwait(emu, S_EDI, (void*)R_RSI, S_EDX, S_R10d, (void*)R_R8); if(S_RAX==-1) S_RAX = -errno; @@ -773,10 +866,11 @@ void EXPORT x64Syscall(x64emu_t *emu) case 282: // sys_signalfd // need to mask SIGSEGV { + //TODO: convert the sigset from x64! sigset_t * set = (sigset_t *)R_RSI; if(sigismember(set, SIGSEGV)) { sigdelset(set, SIGSEGV); - printf_log(LOG_INFO, "Warning, signalfd on SIGSEGV unsuported\n"); + printf_log(LOG_INFO, "Warning, signalfd on SIGSEGV unsupported\n"); } S_RAX = signalfd(S_EDI, set, 0); if(S_RAX==-1) @@ -790,6 +884,13 @@ void EXPORT x64Syscall(x64emu_t *emu) S_RAX = -errno; break; #endif + #ifndef NOALIGN + case 291: // sys__epoll_create1 + S_RAX = epoll_create1(of_convert(S_EDI)); + if(S_RAX==-1) + S_RAX = -errno; + break; + #endif case 317: // sys_seccomp R_RAX = 0; // ignoring call break; @@ -803,22 +904,38 @@ void EXPORT x64Syscall(x64emu_t *emu) S_RAX = -errno; break; #endif + #ifndef __NR_faccessat2 + case 439: + S_RAX = faccessat(S_EDI, (void*)R_RSI, (mode_t)R_RDX, S_R10d); + if(S_RAX==-1) + S_RAX = -errno; + break; + #endif + #if !defined(__NR_epoll_pwait2) || !defined(NOALIGN) + case 441: // sys_epoll_pwait2 + S_RAX = my_epoll_pwait2(emu, S_EDI, (void*)R_RSI, S_EDX, (void*)S_R10, (void*)R_R8); + if(S_RAX==-1) + S_RAX = -errno; + break; + #endif case 449: - #ifdef __NR_futex_waitv - if(box64_futex_waitv) - S_RAX = syscall(__NR_futex_waitv, R_RDI, R_RSI, R_RDX, R_R10, R_R8); - else + #if defined(__NR_futex_waitv) && !defined(BAD_SIGNAL) + S_RAX = syscall(__NR_futex_waitv, R_RDI, R_RSI, R_RDX, R_R10, R_R8); + #else + S_RAX = -ENOSYS; #endif - S_RAX = -ENOSYS; break; default: - printf_log(LOG_INFO, "Error: Unsupported Syscall 0x%02Xh (%d)\n", s, s); - emu->quit = 1; - emu->error |= ERR_UNIMPL; - return; + printf_log(LOG_INFO, "Warning: Unsupported Syscall 0x%02Xh (%d)\n", s, s); + S_RAX = -ENOSYS; + break; + } + if(log) { + if(BOX64ENV(rolling_log)) + snprintf(buffret, 127, "0x%lx%s", R_RAX, buff2); + else + printf_log_prefix(0, LOG_NONE, "=> 0x%lx%s\n", R_RAX, buff2); } - if(log) snprintf(buffret, 127, "0x%lx%s", R_RAX, buff2); - if(log && !cycle_log) printf_log(LOG_NONE, "=> %s\n", buffret); } #define stack(n) (R_RSP+8+n) @@ -923,6 +1040,7 @@ long EXPORT my_syscall(x64emu_t *emu) { void* stack_base = (void*)R_RDX; int stack_size = 0; + uintptr_t sp = R_RDX; if(!stack_base) { // allocate a new stack... int currstack = 0; @@ -931,18 +1049,19 @@ long EXPORT my_syscall(x64emu_t *emu) stack_size = (currstack)?emu->size_stack:(1024*1024); stack_base = mmap(NULL, stack_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_GROWSDOWN, -1, 0); // copy value from old stack to new stack - if(currstack) + if(currstack) { memcpy(stack_base, emu->init_stack, stack_size); - else { + sp = (uintptr_t)emu->init_stack + R_RSP - (uintptr_t)stack_base; + } else { int size_to_copy = (uintptr_t)emu->init_stack + emu->size_stack - (R_RSP); memcpy(stack_base+stack_size-size_to_copy, (void*)R_RSP, size_to_copy); + sp = (uintptr_t)stack_base+stack_size-size_to_copy; } } x64emu_t * newemu = NewX64Emu(emu->context, R_RIP, (uintptr_t)stack_base, stack_size, (R_RDX)?0:1); SetupX64Emu(newemu, emu); - //CloneEmu(newemu, emu); - Push64(newemu, 0); - PushExit(newemu); + CloneEmu(newemu, emu); + newemu->regs[_SP].q[0] = sp; // setup new stack pointer void* mystack = NULL; if(my_context->stack_clone_used) { mystack = box_malloc(1024*1024); // stack for own process... memory leak, but no practical way to remove it @@ -953,7 +1072,7 @@ long EXPORT my_syscall(x64emu_t *emu) my_context->stack_clone_used = 1; } // x86_64 raw clone is long clone(unsigned long flags, void *stack, int *parent_tid, int *child_tid, unsigned long tls); - long ret = clone(clone_fn, (void*)((uintptr_t)mystack+1024*1024), R_ESI, newemu, R_RCX, R_R9, R_R8); + long ret = clone(clone_fn_syscall, (void*)((uintptr_t)mystack+1024*1024), R_ESI, newemu, R_RCX, R_R9, R_R8); return ret; } else @@ -1023,10 +1142,18 @@ long EXPORT my_syscall(x64emu_t *emu) case 160: return setrlimit(S_ESI, (void*)R_RDX); #endif + case 175: // sys_init_module + // huh? + errno = -EPERM; + return -1; #ifndef __NR_time case 201: // sys_time return (intptr_t)time((void*)R_RSI); #endif + #ifndef __NR_epoll_create + case 213: + return epoll_create(S_ESI); + #endif #if !defined(__NR_epoll_wait) || !defined(NOALIGN) case 232: return my_epoll_wait(emu, S_ESI, (void*)R_RDX, S_ECX, S_R8d); @@ -1049,18 +1176,20 @@ long EXPORT my_syscall(x64emu_t *emu) case 264: return renameat(S_RSI, (const char*)R_RDX, S_ECX, (const char*)R_R8); #endif + case 267: // sys_readlinkat + return my_readlinkat(emu, S_RSI, (void*)R_RDX, (void*)R_RCX, R_R8); #ifndef NOALIGN - case 281: // sys_epool_pwait + case 281: // sys_epoll_pwait return my_epoll_pwait(emu, S_ESI, (void*)R_RDX, S_ECX, S_R8d, (void*)R_R9); - break; #endif case 282: // sys_signalfd // need to mask SIGSEGV { + //TODO: convert sigset from x64 sigset_t * set = (sigset_t *)R_RDX; if(sigismember(set, SIGSEGV)) { sigdelset(set, SIGSEGV); - printf_log(LOG_INFO, "Warning, signalfd on SIGSEGV unsuported\n"); + printf_log(LOG_INFO, "Warning, signalfd on SIGSEGV unsupported\n"); } return signalfd(S_ESI, set, 0); } @@ -1069,23 +1198,32 @@ long EXPORT my_syscall(x64emu_t *emu) case 284: // sys_eventfd return eventfd(S_ESI, 0); #endif + #ifndef NOALIGN + case 291: // sys__epoll_create1 + return epoll_create1(of_convert(S_EDI)); + #endif case 317: // sys_seccomp return 0; // ignoring call #ifndef __NR_fchmodat4 case 434: return fchmodat(S_ESI, (void*)R_RDX, (mode_t)R_RCX, S_R8d); #endif + #ifndef __NR_faccessat2 + case 439: + return faccessat(S_ESI, (void*)R_RDX, (mode_t)R_RCX, S_R8d); + #endif + #if !defined(__NR_epoll_pwait2) || !defined(NOALIGN) + case 441: + return my_epoll_pwait2(emu, S_ESI, (void*)R_RDX, S_ECX, (void*)S_R8, (void*)R_R9); + break; + #endif case 449: - #ifdef __NR_futex_waitv - if(box64_futex_waitv) - return syscall(__NR_futex_waitv, R_RSI, R_RDX, R_RCX, R_R8, R_R9); - else + #if defined(__NR_futex_waitv) && !defined(BAD_SIGNAL) + return syscall(__NR_futex_waitv, R_RSI, R_RDX, R_RCX, R_R8, R_R9); + #else + errno = ENOSYS; + return -1; #endif - { - errno = ENOSYS; - return -1; - } - break; default: if(!(warned&(1<segs[_CS]==0x23)?"x86":"x64" ,(void*)ref->old_ip, - ((uint8_t*)ref->old_ip)[0], ((uint8_t*)ref->old_ip)[1], ((uint8_t*)ref->old_ip)[2], ((uint8_t*)ref->old_ip)[3], - ((uint8_t*)ref->old_ip)[4], ((uint8_t*)ref->old_ip)[5], ((uint8_t*)ref->old_ip)[6], ((uint8_t*)ref->old_ip)[7] - ); - printf_log(LOG_NONE, "DIFF: Dynarec | Interpreter\n----------------------\n"); + zydis_dec_t* dec = (ref->segs[_CS] == 0x23) ? my_context->dec32 : my_context->dec; + + printf_log(LOG_NONE, "Warning, difference between %s Interpreter and Dynarec in %p", + (ref->segs[_CS] == 0x23) ? "x86" : "x64", (void*)ref->old_ip); + if (dec) { + printf_log_prefix(0, LOG_NONE, " (%s)\n", DecodeX64Trace(dec, ref->old_ip, 1)); + } else { + printf_log_prefix(0, LOG_NONE, "(%02x %02x %02x %02x %02x %02x %02x %02x)\n", + ((uint8_t*)ref->old_ip)[0], ((uint8_t*)ref->old_ip)[1], ((uint8_t*)ref->old_ip)[2], ((uint8_t*)ref->old_ip)[3], + ((uint8_t*)ref->old_ip)[4], ((uint8_t*)ref->old_ip)[5], ((uint8_t*)ref->old_ip)[6], ((uint8_t*)ref->old_ip)[7]); + } + printf_log(LOG_NONE, "------------------------------------------------\n"); + printf_log(LOG_NONE, "DIFF: Dynarec | Interpreter\n"); + printf_log(LOG_NONE, "------------------------------------------------\n"); + // printf_log(LOG_NONE, "%s\n", DumpCPURegs(ref, ref->old_ip, ref->segs[_CS]==0x23)); } -#define BANNER if(!banner) {banner=1; print_banner(ref);} +#define BANNER(A) if(!banner) {duplicate=is_duplicate(ref->old_ip); banner=1; if(!duplicate) print_banner(ref);} if(!duplicate) { A } void x64test_check(x64emu_t* ref, uintptr_t ip) { int banner = 0; + int duplicate = 0; x64test_t* test = &ref->test; x64emu_t* emu = test->emu; + if(memcmp(ref->regs, emu->regs, sizeof(emu->regs))) { static const char* regname[] = {"RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI", " R8", " R9", "R10", "R11", "R12", "R13", "R14", "R15"}; - BANNER; + BANNER( for(int i=0; i<16; ++i) { if(ref->regs[i].q[0]!=emu->regs[i].q[0]) { printf_log(LOG_NONE, "%s: %016zx | %016zx\n", regname[i], ref->regs[i].q[0], emu->regs[i].q[0]); } - } + }) } if(ip!=emu->ip.q[0]) { - BANNER; - printf_log(LOG_NONE, "RIP: %016zx | %016zx\n", ip, emu->ip.q[0]); + BANNER(printf_log(LOG_NONE, "RIP: %016zx | %016zx\n", ip, emu->ip.q[0]);) } // flags are volatile, so don't test them //memcpy(&ref->eflags, &emu->eflags, sizeof(emu->eflags)); - if(memcmp(ref->segs, emu->segs, sizeof(emu->segs))) { + if(!duplicate && memcmp(ref->segs, emu->segs, sizeof(emu->segs))) { static const char* segname[] = {"ES", "CS", "SS", "DS", "FS", "GS"}; - BANNER; + BANNER( for(int i=0; i<6; ++i) { if(ref->segs[i]!=emu->segs[i]) { printf_log(LOG_NONE, "%s: %04x | %04x\n", segname[i], ref->segs[i], emu->segs[i]); } - } + }) } if(ref->top != emu->top) { - BANNER; - printf_log(LOG_NONE, "X87 TOP: %d | %d\n", ref->top, emu->top); + BANNER(printf_log(LOG_NONE, "X87 TOP: %d | %d\n", ref->top, emu->top);) } if(ref->fpu_stack != emu->fpu_stack) { - BANNER; - printf_log(LOG_NONE, "X87 STACK: %d | %d\n", ref->fpu_stack, emu->fpu_stack); + BANNER(printf_log(LOG_NONE, "X87 STACK: %d | %d\n", ref->fpu_stack, emu->fpu_stack);) } - if(ref->fpu_stack && memcmp(ref->x87, emu->x87, sizeof(emu->x87))) { + if(ref->fpu_stack && !duplicate && memcmp(ref->x87, emu->x87, sizeof(emu->x87))) { // need to check each regs, unused one might have different left over value for(int i=0; ifpu_stack; ++i) { if(ref->x87[(ref->top+i)&7].d != emu->x87[(emu->top+i)&7].d) { - BANNER; - printf_log(LOG_NONE, "ST%d: %g | %g\n", i, ref->x87[(ref->top+i)&7].d, emu->x87[(emu->top+i)&7].d); + BANNER( + printf_log(LOG_NONE, "ST%d: %g(0x%lx) | %g(0x%lx)\n", i, ref->x87[(ref->top+i)&7].d, ref->x87[(ref->top+i)&7].q, emu->x87[(emu->top+i)&7].d, emu->x87[(emu->top+i)&7].q); + ) } } } //memcpy(ref->fpu_ld, emu->fpu_ld, sizeof(emu->fpu_ld)); //memcpy(ref->fpu_ll, emu->fpu_ll, sizeof(emu->fpu_ll)); if(ref->fpu_tags != emu->fpu_tags) { - BANNER; - printf_log(LOG_NONE, "X87 TAGS: %x | %x\n", ref->fpu_tags, emu->fpu_tags); + BANNER(printf_log(LOG_NONE, "X87 TAGS: %x | %x\n", ref->fpu_tags, emu->fpu_tags);) } if(ref->cw.x16 != emu->cw.x16) { - BANNER; - printf_log(LOG_NONE, "X87 CW: %x | %x\n", ref->cw.x16, emu->cw.x16); + BANNER(printf_log(LOG_NONE, "X87 CW: %x | %x\n", ref->cw.x16, emu->cw.x16);) } if(ref->sw.x16 != emu->sw.x16) { - BANNER; - printf_log(LOG_NONE, "X87 SW: %x | %x\n", ref->sw.x16, emu->sw.x16); + BANNER(printf_log(LOG_NONE, "X87 SW: %x | %x\n", ref->sw.x16, emu->sw.x16);) } - if(memcmp(ref->mmx, emu->mmx, sizeof(emu->mmx))) { - BANNER; + if(!duplicate && memcmp(ref->mmx, emu->mmx, sizeof(emu->mmx))) { + BANNER( for(int i=0; i<8; ++i) { if(ref->mmx[i].q!=emu->mmx[i].q) { printf_log(LOG_NONE, "EMM[%d]: %016x | %016x\n", i, ref->mmx[i].q, emu->mmx[i].q); } - } + }) } if(ref->mxcsr.x32 != emu->mxcsr.x32) { - BANNER; - printf_log(LOG_NONE, "MXCSR: %x | %x\n", ref->mxcsr.x32, emu->mxcsr.x32); + BANNER(printf_log(LOG_NONE, "MXCSR: %x | %x\n", ref->mxcsr.x32, emu->mxcsr.x32);) } - if(box64_avx) - if(memcmp(ref->ymm, emu->ymm, sizeof(emu->ymm))) { - BANNER; + if(BOX64ENV(avx)) + if(!duplicate && memcmp(ref->ymm, emu->ymm, sizeof(emu->ymm))) { + BANNER( for(int i=0; i<16; ++i) { if(ref->ymm[i].u128!=emu->ymm[i].u128) { printf_log(LOG_NONE, "YMM[%02d]: %016zx-%016zx | %016zx-%016zx\n", i, ref->ymm[i].q[1], ref->ymm[i].q[0], emu->ymm[i].q[1], emu->ymm[i].q[0]); } - } + }) } - if(memcmp(ref->xmm, emu->xmm, sizeof(emu->xmm))) { - BANNER; + if(!duplicate && memcmp(ref->xmm, emu->xmm, sizeof(emu->xmm))) { + BANNER( for(int i=0; i<16; ++i) { if(ref->xmm[i].u128!=emu->xmm[i].u128) { printf_log(LOG_NONE, "XMM[%02d]: %016zx-%016zx | %016zx-%016zx\n", i, ref->xmm[i].q[1], ref->xmm[i].q[0], emu->xmm[i].q[1], emu->xmm[i].q[0]); } - } + }) } if(test->memsize) { - if(memcmp(test->mem, (void*)test->memaddr, test->memsize)) { - BANNER; - printf_log(LOG_NONE, "MEM: @%p :", (void*)test->memaddr); + if(!duplicate && memcmp(test->mem, (void*)test->memaddr, test->memsize)) { + BANNER( + printf_log(LOG_NONE, "MEM: @%p :\n", (void*)test->memaddr); for(int i=0; imemsize; ++i) - printf_log(LOG_NONE, " %02x", ((uint8_t*)test->memaddr)[i]); - printf_log(LOG_NONE, " |"); + printf_log_prefix(0, LOG_NONE, " %02x", ((uint8_t*)test->memaddr)[i]); + printf_log_prefix(0, LOG_NONE, "\n"); for(int i=0; imemsize; ++i) - printf_log(LOG_NONE, " %02x", test->mem[i]); - printf_log(LOG_NONE, "\n"); + printf_log_prefix(0, LOG_NONE, " %02x", test->mem[i]); + printf_log_prefix(0, LOG_NONE, "\n"); + ) } } - if(banner) // there was an error, re-sync! + if(banner) { // there was an error, re-sync! CopyEmu(emu, ref); + emu->tlsdata = ref->tlsdata; + } } #undef BANNER @@ -152,35 +174,25 @@ void x64test_step(x64emu_t* ref, uintptr_t ip) // check if test is a valid emu struct if(!test->emu) { test->emu = NewX64Emu(my_context, ip, (uintptr_t)ref->init_stack, ref->size_stack, 0); + test->ref = ref; CopyEmu(test->emu, ref); + test->emu->tlsdata = ref->tlsdata; } else { - if (box64_dynarec_test == 2 && test->test && test->clean) - pthread_mutex_unlock(&mutex_global_test); // check if IP is same, else, sync uintptr_t prev_ip = test->emu->ip.q[0]; if(test->clean) x64test_check(ref, ip); if(ip != prev_ip || !test->test || !test->clean) { CopyEmu(test->emu, ref); + test->emu->tlsdata = ref->tlsdata; + test->ref = ref; } } // do a dry single step test->memsize = 0; test->clean = 1; - test->notest = 0; ref->old_ip = ip; - if (box64_dynarec_test == 2) pthread_mutex_lock(&mutex_global_test); RunTest(test); - if (box64_dynarec_test == 2 && test->notest) pthread_mutex_unlock(&mutex_global_test); // this will be analyzed next step } - -void x64test_init() -{ - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK); - pthread_mutex_init(&mutex_global_test, &attr); - pthread_mutexattr_destroy(&attr); -} diff --git a/src/emu/x64tls.c b/src/emu/x64tls.c index 78f83c7..e5d82a1 100644 --- a/src/emu/x64tls.c +++ b/src/emu/x64tls.c @@ -5,12 +5,16 @@ #include #include +#include "os.h" #include "debug.h" #include "box64context.h" #include "x64emu.h" #include "x64emu_private.h" #include "x64tls.h" #include "elfloader.h" +#ifdef BOX32 +#include "box32.h" +#endif typedef struct thread_area_s { @@ -58,7 +62,7 @@ uint32_t my_set_thread_area_32(x64emu_t* emu, thread_area_32_t* td) if(idx==-1) { // find a free one for (int i=9; i<15 && idx==-1; ++i) - if(!my_context->segtls[i].present) + if(!my_context->seggdt[i].present) idx=i; if(idx==-1) { errno = ESRCH; @@ -71,7 +75,7 @@ uint32_t my_set_thread_area_32(x64emu_t* emu, thread_area_32_t* td) return (uint32_t)-1; } if(isempty) { - memset(&my_context->segtls[td->entry_number], 0, sizeof(base_segment_t)); + memset(&my_context->seggdt[td->entry_number], 0, sizeof(base_segment_t)); return 0; } if((idx<9 || idx>15)) { @@ -79,19 +83,17 @@ uint32_t my_set_thread_area_32(x64emu_t* emu, thread_area_32_t* td) return (uint32_t)-1; } - my_context->segtls[idx].base = td->base_addr; - my_context->segtls[idx].limit = td->limit; - my_context->segtls[idx].present = 1; - my_context->segtls[idx].is32bits = 1; - if(!my_context->segtls[idx].key_init) { - pthread_key_create(&my_context->segtls[idx].key, NULL); - my_context->segtls[idx].key_init = 1; + my_context->seggdt[idx].base = td->base_addr; + my_context->seggdt[idx].limit = td->limit; + my_context->seggdt[idx].present = 1; + my_context->seggdt[idx].is32bits = 1; + if(idx>5) { + emu->seggdt[idx].base = td->base_addr; + emu->seggdt[idx].limit = td->limit; + emu->seggdt[idx].present = 1; + emu->seggdt[idx].is32bits = 1; } - pthread_setspecific(my_context->segtls[idx].key, (void*)my_context->segtls[idx].base); - - ResetSegmentsCache(emu); - return 0; } @@ -118,18 +120,19 @@ uint32_t my_modify_ldt(x64emu_t* emu, int op, thread_area_t* td, int size) return (uint32_t)-1; } - /* - my_context->segtls[idx].base = td->base_addr; - my_context->segtls[idx].limit = td->limit; - pthread_setspecific(my_context->segtls[idx].key, (void*)my_context->segtls[idx].base); - */ - - ResetSegmentsCache(emu); + if(box64_is32bits) { + emu->segldt[idx].base = td->base_addr; + emu->segldt[idx].limit = td->limit; + emu->segldt[idx].present = 1; + if((emu->segs[_FS]>>3)==idx) + emu->segs_offs[_FS] =emu->segldt[idx].base; + if((emu->segs[_GS]>>3)==idx) + emu->segs_offs[_GS] =emu->segldt[idx].base; + } return 0; } -static void* GetSeg43Base(); static const char* arch_prctl_param(int code) { static char ret[10] = {0}; @@ -162,21 +165,27 @@ int my_arch_prctl(x64emu_t *emu, int code, void* addr) errno = 0; switch(code) { case ARCH_GET_GS: - *(void**)addr = GetSegmentBase(emu->segs[_GS]); + *(uintptr_t*)addr = GetSegmentBaseEmu(emu, _GS); return 0; case ARCH_GET_FS: - *(void**)addr = GetSegmentBase(emu->segs[_FS]); + *(uintptr_t*)addr = GetSegmentBaseEmu(emu, _FS); return 0; case ARCH_SET_FS: case ARCH_SET_GS: seg=(code==ARCH_SET_FS)?_FS:_GS; int idx = -1; + if(emu->segs[_CS]!=0x23) { + // 64bits version, simply using FSGSBASE.... + emu->segs[seg] = 0; + emu->segs_offs[seg] = (uintptr_t)addr; + return 0; + } // search if it's a TLS base - if(GetSeg43Base()==addr) + if(GetSeg43Base(emu)==addr) idx = 0x43>>3; // Is this search only occurs when seg==0? for (int i=9; i<15 && idx==-1; ++i) - if(my_context->segtls[i].present && my_context->segtls[i].base==(uintptr_t)addr) + if(my_context->seggdt[i].present && my_context->seggdt[i].base==(uintptr_t)addr) idx=i; // found... if(idx!=-1) { @@ -193,17 +202,15 @@ int my_arch_prctl(x64emu_t *emu, int code, void* addr) errno = EINVAL; return -1; } - emu->segs_serial[seg] = 0; - my_context->segtls[idx].base = (uintptr_t)addr; - my_context->segtls[idx].limit = 0; - my_context->segtls[idx].present = 1; - if(idx>8 && !my_context->segtls[idx].key_init) { - pthread_key_create(&my_context->segtls[idx].key, NULL); - my_context->segtls[idx].key_init = 1; + my_context->seggdt[idx].base = (uintptr_t)addr; + my_context->seggdt[idx].limit = 0; + my_context->seggdt[idx].present = 1; + if(idx>5) { + emu->seggdt[idx].base = (uintptr_t)addr; + emu->seggdt[idx].limit = 0; + emu->seggdt[idx].present = 1; } - if(my_context->segtls[idx].key_init) - pthread_setspecific(my_context->segtls[idx].key, addr); - ResetSegmentsCache(emu); + emu->segs_offs[seg] = (uintptr_t)addr; return 0; case ARCH_GET_XCOMP_SUPP: case ARCH_GET_XCOMP_PERM: @@ -220,10 +227,11 @@ int my_arch_prctl(x64emu_t *emu, int code, void* addr) #define POS_TLS 0x200 +#define POS_TLS_32 0x50 /* tls record should looks like: void* tcb 0x00 - void* dtv 0x08 + void* dts 0x08 void* self 0x10 int multiple 0x18 int gscope 0x1c @@ -246,7 +254,7 @@ static int sizeDTS(box64context_t* context) } static int sizeTLSData(int s) { - uint32_t mask = 0xffff/*box64_nogtk?0xffff:0x1fff*/; // x86_64 does the mapping per 64K blocks, so it makes sense to have it this large + uint32_t mask = 0xffff/*BOX64ENV(nogtk)?0xffff:0x1fff*/; // x86_64 does the mapping per 64K blocks, so it makes sense to have it this large return (s+mask)&~mask; } @@ -255,32 +263,53 @@ static tlsdatasize_t* setupTLSData(box64context_t* context) // Setup the GS segment: int dtssize = sizeDTS(context); int datasize = sizeTLSData(context->tlssize); - void *ptr_oversized = (char*)box_malloc(dtssize+POS_TLS+datasize); + void *ptr_oversized = (char*)actual_malloc(dtssize+(box64_is32bits?POS_TLS_32:POS_TLS)+datasize); void *ptr = (void*)((uintptr_t)ptr_oversized + datasize); memcpy((void*)((uintptr_t)ptr-context->tlssize), context->tlsdata, context->tlssize); - tlsdatasize_t *data = (tlsdatasize_t*)box_calloc(1, sizeof(tlsdatasize_t)); + tlsdatasize_t *data = (tlsdatasize_t*)actual_calloc(1, sizeof(tlsdatasize_t)); data->data = ptr; data->tlssize = context->tlssize; data->ptr = ptr_oversized; data->n_elfs = context->elfsize; - pthread_setspecific(context->tlskey, data); - // copy canary... - memset((void*)((uintptr_t)ptr), 0, POS_TLS+dtssize); // set to 0 remining bytes - memcpy((void*)((uintptr_t)ptr+0x28), context->canary, sizeof(void*)); // put canary in place - uintptr_t tlsptr = (uintptr_t)ptr; - memcpy((void*)((uintptr_t)ptr+0x0), &tlsptr, sizeof(void*)); - memcpy((void*)((uintptr_t)ptr+0x10), &tlsptr, sizeof(void*)); // set tcb and self same address - uintptr_t dtp = (uintptr_t)ptr+POS_TLS; - memcpy((void*)(tlsptr+sizeof(void*)), &dtp, sizeof(void*)); - if(dtssize) { - for (int i=0; ielfsize; ++i) { - // set pointer - dtp = (uintptr_t)ptr + GetTLSBase(context->elfs[i]); - *(uint64_t*)((uintptr_t)ptr+POS_TLS+i*16) = dtp; - *(uint64_t*)((uintptr_t)ptr+POS_TLS+i*16+8) = i; // index + #ifdef BOX32 + if(box64_is32bits) { + // copy canary... + memset((void*)((uintptr_t)ptr), 0, POS_TLS_32+dtssize); // set to 0 remining bytes + memcpy((void*)((uintptr_t)ptr+0x14), context->canary, 4); // put canary in place + ptr_t tlsptr = to_ptrv(ptr); + memcpy((void*)((uintptr_t)ptr+0x0), &tlsptr, 4); + ptr_t dtp = to_ptrv(ptr+POS_TLS_32); + memcpy(from_ptrv(tlsptr+0x4), &dtp, 4); + if(dtssize) { + for (int i=0; ielfsize; ++i) { + // set pointer + dtp = to_ptrv(ptr + GetTLSBase(context->elfs[i])); + memcpy((void*)((uintptr_t)ptr+POS_TLS_32+i*8), &dtp, 4); + memcpy((void*)((uintptr_t)ptr+POS_TLS_32+i*8+4), &i, 4); // index + } } + memcpy((void*)((uintptr_t)ptr+0x10), &context->vsyscall, 4); // address of vsyscall + } else + #endif + { + // copy canary... + memset((void*)((uintptr_t)ptr), 0, POS_TLS+dtssize); // set to 0 remining bytes + memcpy((void*)((uintptr_t)ptr+0x28), context->canary, sizeof(void*)); // put canary in place + uintptr_t tlsptr = (uintptr_t)ptr; + memcpy((void*)((uintptr_t)ptr+0x0), &tlsptr, sizeof(void*)); + memcpy((void*)((uintptr_t)ptr+0x10), &tlsptr, sizeof(void*)); // set tcb and self same address + uintptr_t dtp = (uintptr_t)ptr+POS_TLS; + memcpy((void*)(tlsptr+sizeof(void*)), &dtp, sizeof(void*)); + if(dtssize) { + for (int i=0; ielfsize; ++i) { + // set pointer + dtp = (uintptr_t)ptr + GetTLSBase(context->elfs[i]); + *(uint64_t*)((uintptr_t)ptr+POS_TLS+i*16) = dtp; + *(uint64_t*)((uintptr_t)ptr+POS_TLS+i*16+8) = i; // index + } + } + memcpy((void*)((uintptr_t)ptr+0x20), &context->vsyscall, sizeof(void*)); // address of vsyscall } - memcpy((void*)((uintptr_t)ptr+0x20), &context->vsyscall, sizeof(void*)); // address of vsyscall return data; } @@ -317,13 +346,22 @@ static void* resizeTLSData(box64context_t *context, void* oldptr) } // adjust DTS if(oldata->n_elfs!=context->elfsize) { - uintptr_t dtp = (uintptr_t)ptr+POS_TLS; - for (int i=oldata->n_elfs; ielfsize; ++i) { - // set pointer - dtp = (uintptr_t)ptr + GetTLSBase(context->elfs[i]); - *(uint64_t*)((uintptr_t)ptr+POS_TLS+i*16) = dtp; - *(uint64_t*)((uintptr_t)ptr+POS_TLS+i*16+8) = i; // index - } + #ifdef BOX32 + if(box64_is32bits) + for (int i=oldata->n_elfs; ielfsize; ++i) { + // set pointer + ptr_t dtp = to_ptrv(ptr + GetTLSBase(context->elfs[i])); + memcpy((void*)((uintptr_t)ptr+POS_TLS_32+i*8), &dtp, 4); + memcpy((void*)((uintptr_t)ptr+POS_TLS_32+i*8+4), &i, 4); // index + } + else + #endif + for (int i=oldata->n_elfs; ielfsize; ++i) { + // set pointer + uintptr_t dtp = (uintptr_t)ptr + GetTLSBase(context->elfs[i]); + *(uint64_t*)((uintptr_t)ptr+POS_TLS+i*16) = dtp; + *(uint64_t*)((uintptr_t)ptr+POS_TLS+i*16+8) = i; // index + } oldata->n_elfs = context->elfsize; } mutex_unlock(&context->mutex_tls); @@ -331,42 +369,32 @@ static void* resizeTLSData(box64context_t *context, void* oldptr) } } -tlsdatasize_t* getTLSData(box64context_t *context) +void refreshTLSData(x64emu_t* emu) { tlsdatasize_t* ptr = NULL; + uintptr_t old_offs = (uintptr_t)(emu->tlsdata?emu->tlsdata->data:NULL); if(!ptr) - if ((ptr = (tlsdatasize_t*)pthread_getspecific(context->tlskey)) == NULL) { - ptr = (tlsdatasize_t*)fillTLSData(context); + if ((ptr = emu->tlsdata) == NULL) { + ptr = (tlsdatasize_t*)fillTLSData(emu->context); + } + if(ptr->tlssize != emu->context->tlssize) + ptr = (tlsdatasize_t*)resizeTLSData(emu->context, ptr); + emu->tlsdata = ptr; + if(emu->test.emu) emu->test.emu->tlsdata = ptr; + uintptr_t new_offs = (uintptr_t)(emu->tlsdata?emu->tlsdata->data:NULL); + // update if needed + if(old_offs && (old_offs!=new_offs)) { + for(int i=0; i<6; ++i) + if(emu->segs_offs[i]==old_offs) + emu->segs_offs[i] = new_offs; + } else if(!old_offs && new_offs) { + if(box64_is32bits) { + if(emu->segs[_GS]==0x33) { + emu->segs_offs[_GS] = new_offs; + } + } else { + emu->segs_offs[_FS] = new_offs; + emu->segs[_FS] = 0; } - if(ptr->tlssize != context->tlssize) - ptr = (tlsdatasize_t*)resizeTLSData(context, ptr); - return ptr; -} - -static void* GetSeg43Base() -{ - tlsdatasize_t* ptr = getTLSData(my_context); - return ptr->data; -} - -void* GetSegmentBase(uint32_t desc) -{ - if(!desc) { - printf_log(LOG_NONE, "Warning, accessing segment NULL\n"); - return NULL; - } - int base = desc>>3; - if(base==0x8 && !my_context->segtls[base].key_init) - return GetSeg43Base(); - if(base>15) { - printf_log(LOG_NONE, "Warning, accessing segment unknown 0x%x or unset\n", desc); - return NULL; - } - if(my_context->segtls[base].key_init) { - void* ptr = pthread_getspecific(my_context->segtls[base].key); - return ptr; } - - void* ptr = (void*)my_context->segtls[base].base; - return ptr; } diff --git a/src/emu/x64trace.c b/src/emu/x64trace.c index 415a268..6515795 100644 --- a/src/emu/x64trace.c +++ b/src/emu/x64trace.c @@ -1,158 +1,257 @@ #include #include #include -#include #include "debug.h" #include "x64trace.h" #include "box64context.h" -#include "x86zydis.h" #include "x64emu_private.h" +#ifdef HAVE_TRACE +#ifdef ZYDIS3 +#include "x86zydis.h" +#else +#include +#endif + +/* We cannot use -typedef ZyanStatus (*PFNZydisDecoderInit)(ZydisDecoder* decoder, ZydisMachineMode machine_mode, - ZydisAddressWidth address_width); +#if ZYDIS_VERSION_MAJOR(ZYDIS_VERSION) == 4 +... to check the version, as it's defineed with typecasts, for details, see: https://github.com/zyantific/zydis/pull/577 +*/ + +#ifndef ZYDIS3 // Zydis 4.x +typedef ZyanStatus (*PFNZydisDecoderInit)(ZydisDecoder* decoder, ZydisMachineMode machine_mode, ZydisStackWidth stack_width); typedef ZyanStatus (*PFNZydisFormatterInit)(ZydisFormatter* formatter, ZydisFormatterStyle style); +typedef ZyanStatus (*PFNZydisDecoderDecodeFull)(const ZydisDecoder* decoder, const void* buffer, ZyanUSize length, ZydisDecodedInstruction* instruction, ZydisDecodedOperand* operands); +typedef ZyanStatus (*PFNZydisFormatterFormatInstruction)(const ZydisFormatter* formatter, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operands, ZyanU8 operand_count, char* buffer, ZyanUSize length, ZyanU64 runtime_address, void* user_data); + +typedef struct zydis_s { + void* lib; + PFNZydisDecoderInit ZydisDecoderInit; + PFNZydisFormatterInit ZydisFormatterInit; + PFNZydisDecoderDecodeFull ZydisDecoderDecodeFull; + PFNZydisFormatterFormatInstruction ZydisFormatterFormatInstruction; +} zydis_t; + +typedef struct zydis_dec_s { + ZydisDecoder decoder; + ZydisFormatter formatter; + ZydisDecodedInstruction instruction; + ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT]; + PFNZydisDecoderDecodeFull ZydisDecoderDecodeFull; + PFNZydisFormatterFormatInstruction ZydisFormatterFormatInstruction; +} zydis_dec_t; -typedef ZyanStatus (*PFNZydisDecoderDecodeBuffer)(const ZydisDecoder* decoder, - const void* buffer, ZyanUSize length, ZydisDecodedInstruction* instruction); +#else -typedef ZyanStatus (*PFNZydisFormatterFormatInstruction)(const ZydisFormatter* formatter, - const ZydisDecodedInstruction* instruction, char* buffer, ZyanUSize length, - ZyanU64 runtime_address); +typedef ZyanStatus (*PFNZydisDecoderInit)(ZydisDecoder* decoder, ZydisMachineMode machine_mode, ZydisAddressWidth address_width); +typedef ZyanStatus (*PFNZydisFormatterInit)(ZydisFormatter* formatter, ZydisFormatterStyle style); +typedef ZyanStatus (*PFNZydisDecoderDecodeBuffer)(const ZydisDecoder* decoder, const void* buffer, ZyanUSize length, ZydisDecodedInstruction* instruction); +typedef ZyanStatus (*PFNZydisFormatterFormatInstruction)(const ZydisFormatter* formatter, const ZydisDecodedInstruction* instruction, char* buffer, ZyanUSize length, ZyanU64 runtime_address); typedef struct zydis_s { - void* lib; - PFNZydisDecoderInit ZydisDecoderInit; - PFNZydisFormatterInit ZydisFormatterInit; + void* lib; + PFNZydisDecoderInit ZydisDecoderInit; + PFNZydisFormatterInit ZydisFormatterInit; PFNZydisDecoderDecodeBuffer ZydisDecoderDecodeBuffer; PFNZydisFormatterFormatInstruction ZydisFormatterFormatInstruction; } zydis_t; typedef struct zydis_dec_s { - ZydisDecoder decoder; - ZydisFormatter formatter; + ZydisDecoder decoder; + ZydisFormatter formatter; ZydisDecodedInstruction instruction; PFNZydisDecoderDecodeBuffer ZydisDecoderDecodeBuffer; PFNZydisFormatterFormatInstruction ZydisFormatterFormatInstruction; } zydis_dec_t; -int InitX64Trace(box64context_t *context) +#endif + +#else +typedef struct zydis_s { + int dummy; +} zydis_t; + +typedef struct zydis_dec_s { + int dummy; +} zydis_dec_t; +#endif + +int InitX64Trace(box64context_t* context) { - #ifndef HAVE_TRACE +#ifndef HAVE_TRACE return 1; - #else - if(context->zydis) +#else + if (context->zydis) return 0; context->zydis = (zydis_t*)box_calloc(1, sizeof(zydis_t)); - if(!context->zydis) + if (!context->zydis) return 1; - context->zydis->lib = dlopen("libZydis.so", RTLD_LAZY); - if(!context->zydis->lib) { + #ifndef ZYDIS3 + context->zydis->lib = dlopen("libZydis.so.4", RTLD_LAZY); + #else + context->zydis->lib = dlopen("libZydis.so.3", RTLD_LAZY); + #endif + if(!context->zydis->lib) + context->zydis->lib = dlopen("libZydis.so", RTLD_LAZY); + if (!context->zydis->lib) { printf_log(LOG_INFO, "Failed to open libZydis: %s\n", dlerror()); return 1; } - #define GO(f) context->zydis->f = (PFN##f)dlsym(context->zydis->lib, #f);\ - if(!context->zydis->f) {printf_log(LOG_INFO, "Fail to load Zydis function %s\n", #f); dlclose(context->zydis->lib); context->zydis->lib=NULL; return 1;} +#define GO(f) \ + context->zydis->f = (PFN##f)dlsym(context->zydis->lib, #f); \ + if (!context->zydis->f) { \ + printf_log(LOG_INFO, "Fail to load Zydis function %s\n", #f); \ + dlclose(context->zydis->lib); \ + context->zydis->lib = NULL; \ + return 1; \ + } GO(ZydisDecoderInit); GO(ZydisFormatterInit); +#ifndef ZYDIS3 + GO(ZydisDecoderDecodeFull); +#else GO(ZydisDecoderDecodeBuffer); +#endif GO(ZydisFormatterFormatInstruction); - #undef GO +#undef GO context->dec = InitX64TraceDecoder(context); context->dec32 = InitX86TraceDecoder(context); return 0; - #endif +#endif } -void DeleteX64Trace(box64context_t *context) +void DeleteX64Trace(box64context_t* context) { - #ifdef HAVE_TRACE - if(!context->zydis) +#ifdef HAVE_TRACE + if (!context->zydis) return; - if(context->zydis->lib) + if (context->zydis->lib) dlclose(context->zydis->lib); box_free(context->zydis); context->zydis = NULL; - #endif +#endif } -zydis_dec_t* InitX86TraceDecoder(box64context_t *context) +zydis_dec_t* InitX86TraceDecoder(box64context_t* context) { - #ifndef HAVE_TRACE +#ifndef HAVE_TRACE return NULL; - #else - if(!context->zydis) +#else + if (!context->zydis) return NULL; - zydis_dec_t *dec = (zydis_dec_t*)box_calloc(1, sizeof(zydis_dec_t)); + zydis_dec_t* dec = (zydis_dec_t*)box_calloc(1, sizeof(zydis_dec_t)); +#ifndef ZYDIS3 + dec->ZydisDecoderDecodeFull = context->zydis->ZydisDecoderDecodeFull; + dec->ZydisFormatterFormatInstruction = context->zydis->ZydisFormatterFormatInstruction; + context->zydis->ZydisDecoderInit(&dec->decoder, ZYDIS_MACHINE_MODE_LEGACY_32, ZYDIS_STACK_WIDTH_32); + context->zydis->ZydisFormatterInit(&dec->formatter, ZYDIS_FORMATTER_STYLE_INTEL); +#else dec->ZydisDecoderDecodeBuffer = context->zydis->ZydisDecoderDecodeBuffer; dec->ZydisFormatterFormatInstruction = context->zydis->ZydisFormatterFormatInstruction; context->zydis->ZydisDecoderInit(&dec->decoder, ZYDIS_MACHINE_MODE_LEGACY_32, ZYDIS_ADDRESS_WIDTH_32); context->zydis->ZydisFormatterInit(&dec->formatter, ZYDIS_FORMATTER_STYLE_INTEL); - +#endif return dec; - #endif +#endif } -void DeleteX86TraceDecoder(zydis_dec_t **dec) +void DeleteX86TraceDecoder(zydis_dec_t** dec) { - #ifdef HAVE_TRACE +#ifdef HAVE_TRACE box_free(*dec); *dec = NULL; - #endif +#endif } -zydis_dec_t* InitX64TraceDecoder(box64context_t *context) +zydis_dec_t* InitX64TraceDecoder(box64context_t* context) { - #ifndef HAVE_TRACE +#ifndef HAVE_TRACE return NULL; - #else - if(!context->zydis) +#else + if (!context->zydis) return NULL; - zydis_dec_t *dec = (zydis_dec_t*)box_calloc(1, sizeof(zydis_dec_t)); + zydis_dec_t* dec = (zydis_dec_t*)box_calloc(1, sizeof(zydis_dec_t)); +#ifndef ZYDIS3 + dec->ZydisDecoderDecodeFull = context->zydis->ZydisDecoderDecodeFull; + dec->ZydisFormatterFormatInstruction = context->zydis->ZydisFormatterFormatInstruction; + context->zydis->ZydisDecoderInit(&dec->decoder, ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_STACK_WIDTH_64); + context->zydis->ZydisFormatterInit(&dec->formatter, ZYDIS_FORMATTER_STYLE_INTEL); +#else dec->ZydisDecoderDecodeBuffer = context->zydis->ZydisDecoderDecodeBuffer; dec->ZydisFormatterFormatInstruction = context->zydis->ZydisFormatterFormatInstruction; context->zydis->ZydisDecoderInit(&dec->decoder, ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_ADDRESS_WIDTH_64); context->zydis->ZydisFormatterInit(&dec->formatter, ZYDIS_FORMATTER_STYLE_INTEL); - +#endif return dec; - #endif +#endif } -void DeleteX64TraceDecoder(zydis_dec_t **dec) +void DeleteX64TraceDecoder(zydis_dec_t** dec) { - #ifdef HAVE_TRACE +#ifdef HAVE_TRACE box_free(*dec); *dec = NULL; - #endif +#endif } -const char* DecodeX64Trace(zydis_dec_t *dec, uintptr_t p) +const char* DecodeX64Trace(zydis_dec_t* dec, uintptr_t p, int withhex) { - #ifndef HAVE_TRACE +#ifndef HAVE_TRACE return "???"; - #else +#else static char buff[512]; - if(ZYAN_SUCCESS(dec->ZydisDecoderDecodeBuffer(&dec->decoder, (char*)p, 15, - &dec->instruction))) { +#ifndef ZYDIS3 + if (ZYAN_SUCCESS(dec->ZydisDecoderDecodeFull(&dec->decoder, (char*)p, 15, + &dec->instruction, dec->operands))) +#else + if (ZYAN_SUCCESS(dec->ZydisDecoderDecodeBuffer(&dec->decoder, (char*)p, 15, + &dec->instruction))) +#endif + { char tmp[511]; - buff[0]='\0'; - for (int i=0; iinstruction.length; ++i) { - sprintf(tmp, "%02X ", *((unsigned char*)p+i)); - strcat(buff, tmp); + buff[0] = '\0'; + if (withhex) { + for (int i = 0; i < dec->instruction.length; ++i) { + sprintf(tmp, "%02X ", *((unsigned char*)p + i)); + strcat(buff, tmp); + } } - #if 0 - const /*ZydisFormatterToken*/void* token; - dec->ZydisFormatterTokenizeInstruction(&dec->formatter, &dec->instruction, tmp, sizeof(tmp), p, &token); - dec->PrintTokenizedInstruction(token); - #else - dec->ZydisFormatterFormatInstruction(&dec->formatter, &dec->instruction, tmp, sizeof(tmp),p); - #endif - strcat(buff, tmp); +#ifndef ZYDIS3 + dec->ZydisFormatterFormatInstruction(&dec->formatter, &dec->instruction, dec->operands, dec->instruction.operand_count, tmp, sizeof(tmp), p, ZYAN_NULL); +#else + dec->ZydisFormatterFormatInstruction(&dec->formatter, &dec->instruction, tmp, sizeof(tmp), p); +#endif + strncat(buff, tmp, sizeof(buff)-1); } else { - sprintf(buff, "Decoder failed @%p", (void*)p); + snprintf(buff, sizeof(buff), "Decoder failed @%p: ", (void*)p); + if (withhex) { + char tmp[10]; + for (int i = 0; i < 15; ++i) { + sprintf(tmp, "%02X ", *((unsigned char*)p + i)); + strcat(buff, tmp); + } + } } return buff; - #endif +#endif +} + +int OpcodeOK(zydis_dec_t* dec, uintptr_t p) +{ +#ifndef HAVE_TRACE + return 1; +#else +#ifndef ZYDIS3 + if (ZYAN_SUCCESS(dec->ZydisDecoderDecodeFull(&dec->decoder, (char*)p, 15, + &dec->instruction, dec->operands))) +#else + if (ZYAN_SUCCESS(dec->ZydisDecoderDecodeBuffer(&dec->decoder, (char*)p, 15, + &dec->instruction))) +#endif + return 1; + return 0; +#endif } diff --git a/src/emu/x86int3.c b/src/emu/x86int3.c new file mode 100755 index 0000000..6629396 --- /dev/null +++ b/src/emu/x86int3.c @@ -0,0 +1,504 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "x64_signals.h" +#include "os.h" +#include "debug.h" +#include "box64stack.h" +#include "x64emu.h" +#include "x64emu_private.h" +#include "x64run_private.h" +#include "x87emu_private.h" +#include "x64primop.h" +#include "x64trace.h" +#include "wrapper32.h" +#include "box32context.h" +#include "librarian.h" +#include "emit_signals.h" +#include "tools/bridge_private.h" + +#include +#include "elfloader.h" +#include "elfload_dump.h" +#include "elfs/elfloader_private.h" + +typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); + +static uint64_t F64(uintptr_t* addr) { + uint64_t ret = *(uint64_t*)*addr; + *addr+=8; + return ret; +} +static uint8_t Peek8(uintptr_t addr, uintptr_t offset) +{ + return *(uint8_t*)(addr+offset); +} + +extern int errno; +void x86Int3(x64emu_t* emu, uintptr_t* addr) +{ + onebridge_t* bridge = (onebridge_t*)(*addr-1); + if (IsBridgeSignature(Peek8(*addr, 0), Peek8(*addr, 1))) { // Signature for "Out of x86 door" + *addr += 2; + uintptr_t a = F64(addr); + if(a==0) { + R_RIP = *addr; + //printf_log(LOG_INFO, "%p:Exit x86 emu (emu=%p)\n", *(void**)(R_ESP), emu); + emu->quit=1; // normal quit + } else { + RESET_FLAGS(emu); + wrapper_t w = bridge->w; + a = F64(addr); + R_RIP = *addr; + /* This party can be used to trace only 1 specific lib (but it is quite slow) + elfheader_t *h = FindElfAddress(my_context, *(uintptr_t*)(R_ESP)); + int have_trace = 0; + if(h && strstr(ElfName(h), "libMiles")) have_trace = 1;*/ + if(BOX64ENV(log)>=LOG_DEBUG || BOX64ENV(rolling_log)) { + int tid = GetTID(); + char t_buff[256] = "\0"; + char buff2[64] = "\0"; + char buff3[64] = "\0"; + int cycle_line = my_context->current_line; + if(BOX64ENV(rolling_log)) { + my_context->current_line = (my_context->current_line+1)%BOX64ENV(rolling_log); + } + char* buff = BOX64ENV(rolling_log)?(my_context->log_call+256*cycle_line):t_buff; + char* buffret = BOX64ENV(rolling_log)?(my_context->log_ret+128*cycle_line):NULL; + if(buffret) buffret[0] = '\0'; + char *tmp; + int post = 0; + int perr = 0; + int ret_fmt = 0; + uint64_t *pu64 = NULL; + uint32_t *pu32 = NULL; + uint8_t *pu8 = NULL; + const char *s = (bridge->func)?GetNativeName(bridge->name_or_func):bridge->name_or_func; + if(!s) + s = GetNativeName((void*)a); + if(a==(uintptr_t)PltResolver32) { + if(BOX64ENV(rolling_log)) { + ptr_t addr = *((uint32_t*)from_ptrv(R_ESP)); + int slot = *((uint32_t*)from_ptrv(R_ESP+4)); + elfheader_t *h = (elfheader_t*)from_ptrv(addr); + Elf32_Rel * rel = (Elf32_Rel *)from_ptrv(h->jmprel + h->delta + slot); + Elf32_Sym *sym = &h->DynSym._32[ELF32_R_SYM(rel->r_info)]; + const char* symname = SymName32(h, sym); + snprintf(buff, 256, "%04d|PltResolver \"%s\"", tid, symname?symname:"???"); + } else { + snprintf(buff, 256, "%s", " ... "); + } + } else + if(strstr(s, "SDL_PollEvent")==s) { + snprintf(buff, 255, "%04d|%p: Calling %s(%p)", tid, from_ptriv(R_ESP), (char *)s, from_ptriv(R_ESP+4)); + pu8 = from_ptriv(R_ESP+4); + post = 10; + } else if(strstr(s, "SDL_RWFromFile")==s || strstr(s, "SDL_RWFromFile")==s) { + snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\", \"%s\")", tid, from_ptriv(R_ESP), (char *)s, (char *)from_ptriv(R_ESP+4), (char *)from_ptriv(R_ESP+8)); + } else if(strstr(s, "SDL_WarpMouse")==s) { + snprintf(buff, 255, "%04d|%p: Calling %s(%hd, %hd)", tid, from_ptriv(R_ESP), (char *)s, *(uint16_t*)from_ptr(R_ESP+4), *(uint16_t*)from_ptr(R_ESP+8)); + } else if(strstr(s, "glColor4f")==s) { + snprintf(buff, 255, "%04d|%p: Calling %s(%f, %f, %f, %f)", tid, from_ptriv(R_ESP), (char *)s, *(float*)from_ptr(R_ESP+4), *(float*)from_ptr(R_ESP+8), *(float*)from_ptr(R_ESP+12), *(float*)from_ptr(R_ESP+16)); + } else if(strstr(s, "glTexCoord2f")==s) { + snprintf(buff, 255, "%04d|%p: Calling %s(%f, %f)", tid, from_ptriv(R_ESP), (char *)s, *(float*)from_ptr(R_ESP+4), *(float*)from_ptr(R_ESP+8)); + } else if(strstr(s, "glVertex2f")==s) { + snprintf(buff, 255, "%04d|%p: Calling %s(%f, %f)", tid, from_ptriv(R_ESP), (char *)s, *(float*)from_ptr(R_ESP+4), *(float*)from_ptr(R_ESP+8)); + } else if(strstr(s, "glVertex3f")==s) { + snprintf(buff, 255, "%04d|%p: Calling %s(%f, %f, %f)", tid, from_ptriv(R_ESP), (char *)s, *(float*)from_ptr(R_ESP+4), *(float*)from_ptr(R_ESP+8), *(float*)from_ptr(R_ESP+12)); + } else if(strstr(s, "__open64")==s || strcmp(s, "open64")==0) { + snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\", %d, %d)", tid, from_ptriv(R_ESP), (char *)s, (char *)from_ptriv(R_ESP+4), *(int*)from_ptr(R_ESP+8), *(int*)from_ptr(R_ESP+12)); + perr = 1; + } else if(!strcmp(s, "opendir")) { + snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\")", tid, from_ptriv(R_ESP), (char *)s, (char *)from_ptriv(R_ESP+4)); + perr = 2; + } else if(strstr(s, "__open")==s || !strcmp(s, "open") || !strcmp(s, "my_open64")) { + tmp = from_ptriv(R_ESP+4); + snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\", %d (,%d))", tid, from_ptriv(R_ESP), (char *)s, (tmp)?tmp:"(nil)", *(int*)from_ptr(R_ESP+8), *(int*)from_ptr(R_ESP+12)); + perr = 1; + } else if(!strcmp(s, "shm_open")) { + tmp = from_ptriv(R_ESP+4); + snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\", %d, %d)", tid, from_ptriv(R_ESP), (char *)s, (tmp)?tmp:"(nil)", *(int*)from_ptr(R_ESP+8), *(int*)from_ptr(R_ESP+12)); + perr = 1; + } else if(strcmp(s, "mkdir")==0) { + tmp = from_ptriv(R_ESP+4); + snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\", %d)", tid, from_ptriv(R_ESP), (char *)s, (tmp)?tmp:"(nil)", *(int*)from_ptr(R_ESP+8)); + perr = 1; + } else if(!strcmp(s, "fopen")) { + snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\", \"%s\")", tid, from_ptriv(R_ESP), (char *)s, (char *)from_ptriv(R_ESP+4), (char *)from_ptriv(R_ESP+8)); + perr = 2; + } else if(!strcmp(s, "freopen")) { + snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\", \"%s\", %p)", tid, from_ptriv(R_ESP), (char *)s, (char *)from_ptriv(R_ESP+4), (char *)from_ptriv(R_ESP+8), from_ptriv(R_ESP+12)); + perr = 2; + } else if(!strcmp(s, "fopen64")) { + snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\", \"%s\")", tid, from_ptriv(R_ESP), (char *)s, (char *)from_ptriv(R_ESP+4), (char *)from_ptriv(R_ESP+8)); + perr = 2; + } else if(!strcmp(s, "chdir")) { + pu32=(uint32_t*)from_ptrv(R_ESP+4); + snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\")", tid, from_ptriv(R_ESP), (char *)s, pu32?((pu32==(uint32_t*)1)?"/1/":(char*)(uintptr_t)(*pu32)):"/0/"); + } else if(!strcmp(s, "poll")) { + pu32=from_ptrv(*(ptr_t*)from_ptrv(R_ESP+4)); + char tmp[50]; + char tmp2[50] = {0}; + uint32_t n = from_ptri(uint32_t, R_ESP+8); + for(uint32_t ii=0; iicontext->mutex_trace); + printf_log(LOG_NONE, "%s =>", buff); + mutex_unlock(&emu->context->mutex_trace); + } + w(emu, a); // some function never come back, so unlock the mutex first! + if(post) + switch(post) { + case 1: snprintf(buff2, 63, " [%d sec %d nsec]", pu32?pu32[0]:-1u, pu32?pu32[1]:-1u); + break; + case 2: snprintf(buff2, 63, "(%s)", R_EAX?((char*)from_ptr(R_EAX)):"nil"); + break; + case 3: snprintf(buff2, 63, "(%s)", pu32?((char*)pu32):"nil"); + break; + case 4: snprintf(buff2, 63, " (%f)", ST0.d); + break; + case 5: { + uint32_t* p = (uint32_t*)from_ptrv(R_EAX); + if(p) + snprintf(buff2, 63, " size=%dx%d, pitch=%d, pixels=%p", p[2], p[3], p[4], p+5); + else + snprintf(buff2, 63, "NULL Surface"); + } + break; + case 6: snprintf(buff2, 63, "(%S)", pu32?((wchar_t*)pu32):L"nil"); + break; + case 7: if(R_EAX) snprintf(buff2, 63, " (error=\"%s\")", strerror(R_EAX)); break; + case 8: if(!R_EAX) snprintf(buff2, 63, " [%p]", from_ptrv(*pu32)); break; + case 9: if(errno) snprintf(buff2, 63, " (errno=%d/\"%s\")", errno, strerror(errno)); else snprintf(buff2, 63, " (errno=0)"); break; + break; + case 10: if(R_EAX) + switch(*pu8) { + case 4: + snprintf(buff2, 63, " [type=%hhd, x=%hd, y=%hd, relx=%+hd, rely=%+hd]", *pu8, *(uint16_t*)(pu8+4), *(uint16_t*)(pu8+6), *(int16_t*)(pu8+8), *(int16_t*)(pu8+10)); + break; + default: + snprintf(buff2, 63, " [type=%hhd]", *pu8); + } + break; + case 11: snprintf(buff2, 63, " [%d / %d / %d /%d]", pu32[0], pu32[1], pu32[2], pu32[3]); + break; + case 12: if(R_EAX>0) { + char tmp[50]; + char tmp2[50] = {0}; + uint32_t n = from_ptri(uint32_t, R_ESP+8); + for(uint32_t ii=0; ii>16); + strncat(tmp2, tmp, 49); + } + snprintf(buff2, 63, "[%s]", tmp2); + } + break; + case 13: if(R_EAX==0x25E) + snprintf(buff2, 63, "%s", "here"); + break; + case 14: snprintf(buff2, 63, " [%d]", *(int*)pu32); + break; + } + if(perr==1 && (S_EAX)<0) + snprintf(buff3, 63, " (errno=%d:\"%s\")", errno, strerror(errno)); + else if(perr==2 && R_EAX==0) + snprintf(buff3, 63, " (errno=%d:\"%s\")", errno, strerror(errno)); + else if(perr==3 && (S_EAX)==-1) + snprintf(buff3, 63, " (errno=%d:\"%s\")", errno, strerror(errno)); + else if(perr==4) + snprintf(buff3, 63, " (errno=%d:\"%s\")", errno, strerror(errno)); + if(BOX64ENV(rolling_log)) { + if(ret_fmt==1) + snprintf(buffret, 127, "%d%s%s", S_EAX, buff2, buff3); + else + snprintf(buffret, 127, "0x%X%s%s", R_EAX, buff2, buff3); + } else { + mutex_lock(&emu->context->mutex_trace); + if(ret_fmt==1) + printf_log_prefix(0, LOG_NONE, " return %d%s%s\n", S_EAX, buff2, buff3); + else + printf_log_prefix(0, LOG_NONE, " return 0x%X%s%s\n", R_EAX, buff2, buff3); + mutex_unlock(&emu->context->mutex_trace); + } + } else + w(emu, a); + } + return; + } + if(!BOX64ENV(ignoreint3) && my_context->signals[X64_SIGTRAP]) { + R_RIP = *addr; // update RIP + EmitSignal(emu, X64_SIGTRAP, NULL, 3); + } else { + printf_log(LOG_DEBUG, "%04d|Warning, ignoring unsupported Int 3 call @%p\n", GetTID(), (void*)R_RIP); + R_RIP = *addr; + } + //emu->quit = 1; +} diff --git a/src/emu/x86syscall.c b/src/emu/x86syscall.c index 1d28a98..6b0625a 100755 --- a/src/emu/x86syscall.c +++ b/src/emu/x86syscall.c @@ -26,7 +26,6 @@ #include "debug.h" #include "box64stack.h" #include "x64emu.h" -#include "x64run.h" #include "x64emu_private.h" #include "x64trace.h" #include "myalign.h" @@ -127,7 +126,7 @@ static const scwrap_t syscallwrap[] = { //{ 185, __NR_capset, 2}, //{ 186, __NR_sigaltstack, 2 }, // neeed wrap or something? //{ 191, __NR_ugetrlimit, 2 }, -// { 192, __NR_mmap2, 6}, + //{ 192, __NR_mmap2, 6}, //{ 195, __NR_stat64, 2 }, // need proprer wrap because of structure size change //{ 196, __NR_lstat64, 2 }, // need proprer wrap because of structure size change //{ 197, __NR_fstat64, 2 }, // need proprer wrap because of structure size change @@ -266,7 +265,7 @@ void EXPORT x86Syscall(x64emu_t *emu) R_EAX = R_EBX; // faking the syscall here, we don't want to really terminate the thread now break; /*case 123: // SYS_modify_ldt - R_EAX = my_modify_ldt(emu, R_EBX, (thread_area_t*)(uintptr_t)R_ECX, R_EDX); + R_EAX = my32_modify_ldt(emu, R_EBX, (thread_area_t*)(uintptr_t)R_ECX, R_EDX); if(R_EAX==0xffffffff && errno>0) R_EAX = (uint32_t)-errno; break;*/ diff --git a/src/emu/x86syscall_32.c b/src/emu/x86syscall_32.c new file mode 100644 index 0000000..142df69 --- /dev/null +++ b/src/emu/x86syscall_32.c @@ -0,0 +1,780 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include + +#include /* For SYS_xxx definitions */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef __NR_socketcall +#include +#include +#endif +#include +#include +#include + +#include "os.h" +#include "debug.h" +#include "box64stack.h" +#include "x64emu.h" +#include "box64cpu.h" +#include "x64emu_private.h" +#include "x64trace.h" +#include "myalign32.h" +#include "box64context.h" +#include "callback.h" +#include "signals.h" +#include "x64tls.h" +#include "box32.h" +#include "converter32.h" +#include "custommem.h" + + +// Syscall table for x86_64 can be found +typedef struct scwrap_s { + uint32_t x86s; + int nats; + int nbpars; +} scwrap_t; + +static const scwrap_t syscallwrap[] = { + #ifdef __NR_fork + { 2, __NR_fork, 1 }, + #endif + //{ 3, __NR_read, 3 }, // wrapped so SA_RESTART can be handled by libc + //{ 4, __NR_write, 3 }, // same + //{ 5, __NR_open, 3 }, // flags need transformation + //{ 6, __NR_close, 1 }, // wrapped so SA_RESTART can be handled by libc + #ifdef __NR_waitpid + { 7, __NR_waitpid, 3 }, + #endif + //{ 10, __NR_unlink, 1 }, + //{ 12, __NR_chdir, 1 }, + //{ 13, __NR_time, 1 }, + //{ 15, __NR_chmod, 2 }, + //{ 19, __NR_lseek, 3 }, + //{ 20, __NR_getpid, 0 }, + //{ 24, __NR_getuid, 0 }, + //{ 33, __NR_access, 2 }, + //{ 37, __NR_kill, 2 }, + //{ 38, __NR_rename, 2 }, + //{ 39, __NR_mkdir, 2 }, + //{ 40, __NR_rmdir, 1 }, + //{ 41, __NR_dup, 1 }, + #ifdef __NR_pipe + { 42, __NR_pipe, 1 }, + #endif + //{ 45, __NR_brk, 1 }, + //{ 47, __NR_getgid, 0 }, + //{ 49, __NR_geteuid, 0 }, + //{ 50, __NR_getegid, 0 }, + //{ 54, __NR_ioctl, 3 }, // should be wrapped to allow SA_RESTART handling by libc, but syscall is only 3 arguments, ioctl can be 5 + //{ 55, __NR_fcntl, 3 }, // wrapped to allow filter of F_SETFD + //{ 60, __NR_umask, 1 }, + //{ 63, __NR_dup2, 2 }, + //{ 64, __NR_getppid, 0 }, + //{ 66, __NR_setsid, 0 }, + //{ 75, __NR_setrlimit, 2 }, + //{ 76, __NR_getrlimit, 2 }, + //{ 77, __NR_getrusage, 2 }, + //{ 78, __NR_gettimeofday, 2 }, + //{ 83, __NR_symlink, 2 }, + //{ 82, __NR_select, 5 }, + //{ 85, __NR_readlink, 3 }, + //{ 90, __NR_old_mmap, 1 }, + //{ 91, __NR_munmap, 2 }, + //{ 94, __NR_fchmod, 2 }, + //{ 99, __NR_statfs, 2 }, + //{ 102, __NR_socketcall, 2 }, + //{ 104, __NR_setitimer, 3 }, + //{ 105, __NR_getitimer, 2 }, + //{ 106, __NR_newstat, 2 }, + //{ 106, __NR_stat, 2 }, + //{ 107, __NR_newlstat, 2 }, + //{ 107, __NR_lstat, 2 }, + //{ 108, __NR_newfstat, 2 }, + //{ 108, __NR_fstat, 2 }, + //{ 109, __NR_olduname, 1 }, + //{ 110, __NR_iopl, 1 }, + //{ 114, __NR_wait4, 4 }, //TODO: check struct rusage alignment + //{ 117, __NR_ipc, 6 }, + //{ 119, __NR_sigreturn, 0}, + //{ 120, __NR_clone, 5 }, // need works + //{ 122, __NR_uname, 1 }, + //{ 123, __NR_modify_ldt }, + //{ 125, __NR_mprotect, 3 }, + //{ 136, __NR_personality, 1 }, + //{ 140, __NR__llseek, 5 }, + //{ 141, __NR_getdents, 3 }, + //{ 142, __NR__newselect, 5 }, + //{ 143, __NR_flock, 2 }, + //{ 144, __NR_msync, 3 }, + //{ 145, __NR_readv, 3 }, + //{ 146, __NR_writev, 3 }, + //{ 148, __NR_fdatasync, 1 }, + //{ 149, __NR__sysctl, 1 }, // need wrapping? + //{ 156, __NR_sched_setscheduler, 3 }, + //{ 157, __NR_sched_getscheduler, 1 }, + //{ 158, __NR_sched_yield, 0 }, + //{ 162, __NR_nanosleep, 2 }, + //{ 164, __NR_setresuid, 3 }, + //{ 168, __NR_poll, 3 }, // wrapped to allow SA_RESTART wrapping by libc + { 172, __NR_prctl, 5 }, + //{ 173, __NR_rt_sigreturn, 0 }, + //{ 175, __NR_rt_sigprocmask, 4 }, + //{ 179, __NR_rt_sigsuspend, 2 }, + //{ 183, __NR_getcwd, 2 }, + //{ 184, __NR_capget, 2}, + //{ 185, __NR_capset, 2}, + //{ 186, __NR_sigaltstack, 2 }, // neeed wrap or something? + //{ 191, __NR_ugetrlimit, 2 }, + //{ 192, __NR_mmap2, 6}, + //{ 195, __NR_stat64, 2 }, // need proprer wrap because of structure size change + //{ 196, __NR_lstat64, 2 }, // need proprer wrap because of structure size change + //{ 197, __NR_fstat64, 2 }, // need proprer wrap because of structure size change + //{ 199, __NR_getuid32, 0 }, + //{ 200, __NR_getgid32, 0 }, + //{ 201, __NR_geteuid32, 0 }, + //{ 202, __NR_getegid32, 0 }, + //{ 208, __NR_setresuid32, 3 }, + //{ 209, __NR_getresuid32, 3 }, + //{ 210, __NR_setresgid32, 3 }, + //{ 211, __NR_getresgid32, 3 }, + //{ 220, __NR_getdents64, 3 }, + //{ 221, __NR_fcntl64, 3 }, + { 224, __NR_gettid, 0 }, + //{ 240, __NR_futex, 6 }, // needs wrapping for the optionnal timespec part + //{ 241, __NR_sched_setaffinity, 3 }, + //{ 242, __NR_sched_getaffinity, 3 }, + //{ 243, __NR_set_thread_area, 1 }, + //{ 252, __NR_exit_group, 1 }, + //{ 254, __NR_epoll_create, 1 }, + //{ 255, __NR_epoll_ctl, 4 }, + //{ 256, __NR_epoll_wait, 4 }, + //{ 265, __NR_clock_gettime, 2 }, + //{ 266, __NR_clock_getres, 2 }, + { 270, __NR_tgkill, 3 }, + //{ 271, __NR_utimes, 2 }, + //{ 291, __NR_inotify_init, 0}, + //{ 292, __NR_inotify_add_watch, 3}, + //{ 293, __NR_inotify_rm_watch, 2}, + //{ 311, __NR_set_robust_list, 2 }, + //{ 312, __NR_get_robust_list, 4 }, // need wrapping of 3rd arg + //{ 318, __NR_getcpu, 3}, + //{ 328, __NR_eventfd2, 2}, + //{ 329, __NR_epoll_create1, 1 }, + //{ 331, __NR_pipe2, 2}, + //{ 332, __NR_inotify_init1, 1}, + //{ 355, __NR_getrandom, 3 }, + //{ 356, __NR_memfd_create, 2}, + //{ 449, __NR_futex_waitv, 5}, +}; + +struct mmap_arg_struct { + ulong_t addr; + ulong_t len; + ulong_t prot; + ulong_t flags; + ulong_t fd; + ulong_t offset; +}; + +#undef st_atime +#undef st_ctime +#undef st_mtime + +struct x64_pt_regs { + long ebx; + long ecx; + long edx; + long esi; + long edi; + long ebp; + long eax; + int xds; + int xes; + int xfs; + int xgs; + long orig_eax; + long eip; + int xcs; + long eflags; + long esp; + int xss; +}; + +#ifndef __NR_olduname +struct oldold_utsname { + char sysname[9]; + char nodename[9]; + char release[9]; + char version[9]; + char machine[9]; +}; +#endif +struct old_utsname { + char sysname[65]; + char nodename[65]; + char release[65]; + char version[65]; + char machine[65]; +}; + +struct i386_user_desc { + unsigned int entry_number; + unsigned long base_addr; + unsigned int limit; + unsigned int seg_32bit:1; + unsigned int contents:2; + unsigned int read_exec_only:1; + unsigned int limit_in_pages:1; + unsigned int seg_not_present:1; + unsigned int useable:1; +}; + +struct i386_robust_list { + ptr_t next; // struct i386_robust_list * +}; +struct i386_robust_list_head { + struct i386_robust_list list; + long_t futex_offset; + ptr_t list_op_pending; // struct robust_list * +}; + +typedef struct i386_stack_s i386_stack_t; + +typedef struct i386_linux_dirent_s { + uint32_t d_ino; + uint32_t d_off; + uint16_t d_reclen; + char d_name[]; +} i386_linux_dirent_t; + +typedef struct native_linux_dirent { + unsigned long d_ino; + unsigned long d_off; + unsigned short d_reclen; + char d_name[]; +} native_linux_dirent_t; + +int32_t my_open(x64emu_t* emu, void* pathname, int32_t flags, uint32_t mode); +int32_t my32_execve(x64emu_t* emu, const char* path, ptr_t argv[], ptr_t envp[]); +ssize_t my32_read(int fd, void* buf, size_t count); +void* my32_mmap64(x64emu_t* emu, void *addr, size_t length, int prot, int flags, int fd, int64_t offset); +int my32_munmap(x64emu_t* emu, void* addr, unsigned long length); +int my32_sigaltstack(x64emu_t* emu, const i386_stack_t* ss, i386_stack_t* oss); +pid_t my_vfork(x64emu_t* emu); + +#ifndef FUTEX_LOCK_PI2 +#define FUTEX_LOCK_PI2 13 +#endif + +typedef struct clone_s { + x64emu_t* emu; + void* stack2free; +} clone_t; + +static int clone32_fn(void* arg) +{ + clone_t* args = arg; + x64emu_t *emu = args->emu; + printf_log(LOG_DEBUG, "%04d|New clone32_fn starting with emu=%p (R_ESP=%p)\n", GetTID(), arg, from_ptrv(R_ESP)); + thread_forget_emu(); + thread_set_emu(emu); + R_EAX = 0; + DynaRun(emu); + int ret = S_EAX; + printf_log(LOG_DEBUG, "%04d|clone32_fn ending with ret=%d (emu=%p)\n", GetTID(), ret, arg); + FreeX64Emu(&emu); + void* stack2free = args->stack2free; + box_free(args); + if(my_context->stack_clone_used && !stack2free) + my_context->stack_clone_used = 0; + if(stack2free) + box_free(stack2free); // this free the stack, so it will crash very soon! + _exit(ret); +} + + +void EXPORT x86Syscall(x64emu_t *emu) +{ + uint32_t s = R_EAX; + printf_log(LOG_DEBUG, "%04d|%p: Calling 32bits syscall 0x%02X (%d) %p %p %p %p %p", GetTID(), (void*)R_RIP, s, s, (void*)(uintptr_t)R_EBX, (void*)(uintptr_t)R_ECX, (void*)(uintptr_t)R_EDX, (void*)(uintptr_t)R_ESI, (void*)(uintptr_t)R_EDI); + // check wrapper first + int cnt = sizeof(syscallwrap) / sizeof(scwrap_t); + void* tmp; + size_t tmps; + for (int i=0; iquit = 1; + return; + } + if(R_EAX==0xffffffff && errno>0) + R_EAX = (uint32_t)-errno; + printf_log(LOG_DEBUG, " => 0x%x\n", R_EAX); + return; + } + } + switch (s) { + case 1: // sys_exit + emu->quit = 1; + emu->exit = 1; + //R_EAX = syscall(__NR_exit, R_EBX); // the syscall should exit only current thread + R_EAX = R_EBX; // faking the syscall here, we don't want to really terminate the thread now + break; + #ifndef __NR_fork + case 2: + S_EAX = fork(); + if(S_EAX==-1) + S_EAX = -errno; + break; + #endif + case 3: // sys_read + S_EAX = to_long(my32_read((int)R_EBX, from_ptrv(R_ECX), from_ulong(R_EDX))); + break; + case 4: // sys_write + S_EAX = to_long(write((int)R_EBX, from_ptrv(R_ECX), from_ulong(R_EDX))); + break; + case 5: // sys_open + if(s==5) {printf_log(LOG_DEBUG, " => sys_open(\"%s\", %d, %d)", (char*)from_ptrv(R_EBX), of_convert32(R_ECX), R_EDX);}; + //S_EAX = open((void*)R_EBX, of_convert32(R_ECX), R_EDX); + S_EAX = my_open(emu, from_ptrv(R_EBX), of_convert32(R_ECX), R_EDX); + break; + case 6: // sys_close + S_EAX = close((int)R_EBX); + break; +#ifndef __NR_waitpid + case 7: //sys_waitpid + S_EAX = waitpid((pid_t)R_EBX, (int*)from_ptrv(R_ECX), S_EDX); + if(S_EAX==-1 && errno>0) + S_EAX = -errno; + break; +#endif + #ifndef __NR_fork + case 42: + S_EAX = pipe(from_ptrv(R_EBX)); + if(S_EAX==-1) + S_EAX = -errno; + break; + #endif + case 90: // old_mmap + { + struct mmap_arg_struct *st = from_ptrv(R_EBX); + R_EAX = to_ptrv(my32_mmap64(emu, from_ptrv(st->addr), st->len, st->prot, st->flags, st->fd, st->offset)); + } + if(S_EAX==-1 && errno>0) + S_EAX = -errno; + break; + case 91: // munmap + S_EAX = my32_munmap(emu, from_ptrv(R_EBX), (unsigned long)R_ECX); + if(S_EAX==-1 && errno>0) + S_EAX = -errno; + break; + case 120: // sys_clone + // x86 raw syscall is long clone(unsigned long flags, void *stack, int *parent_tid, unsigned long tls, int *child_tid); + // so flags=R_EBX, stack=R_ECX, parent_tid=R_EDX, child_tid=R_ESI, tls=R_EDI + if((R_EBX&~0xff)==0x4100) { + // this is a case of vfork... + S_RAX = my_vfork(emu); + if(S_RAX==-1) + S_RAX = -errno; + } else { + if(R_ECX) + { + void* stack_base = from_ptrv(R_ECX); + int stack_size = 0; + uintptr_t sp = R_ECX; + x64emu_t * newemu = NewX64Emu(emu->context, R_EIP, (uintptr_t)stack_base, stack_size, 0); + SetupX64Emu(newemu, emu); + CloneEmu(newemu, emu); + newemu->regs[_SP].q[0] = sp; // setup new stack pointer + void* mystack = NULL; + clone_t* args = box_calloc(1, sizeof(clone_t)); + args->emu = newemu; + if(my_context->stack_clone_used) { + args->stack2free = mystack = box_malloc(1024*1024); // stack for own process... + } else { + if(!my_context->stack_clone) + my_context->stack_clone = box_malloc(1024*1024); + mystack = my_context->stack_clone; + my_context->stack_clone_used = 1; + } + int64_t ret = clone(clone32_fn, (void*)((uintptr_t)mystack+1024*1024), R_EBX, args, R_EDX, R_EDI, R_ESI); + S_RAX = ret; + } + else + #ifdef NOALIGN + S_RAX = syscall(__NR_clone, R_EBX, R_ECX, R_EDX, R_ESI, R_EDI); + #else + S_RAX = syscall(__NR_clone, R_EBX, R_ECX, R_EDX, R_EDI, R_ESI); // invert R_ESI/R_EDI on Aarch64 and most other + #endif + } + break; + /*case 123: // SYS_modify_ldt + R_EAX = my32_modify_ldt(emu, R_EBX, (thread_area_t*)(uintptr_t)R_ECX, R_EDX); + if(R_EAX==0xffffffff && errno>0) + R_EAX = (uint32_t)-errno; + break;*/ + case 141: { // getdents + native_linux_dirent_t* dirent_buffer = box_malloc(sizeof(native_linux_dirent_t) * (unsigned int)R_EDX); + S_EAX = syscall(__NR_getdents64, (unsigned)R_EBX, dirent_buffer, (unsigned int)R_EDX); + if (S_EAX == -1) { + if (errno > 0) S_EAX = -errno; + } else { + size_t total = 0; + size_t off = 0; + while (off < (size_t)S_EAX) { + native_linux_dirent_t* d = (native_linux_dirent_t*)((char*)dirent_buffer + off); + size_t reclen = sizeof(i386_linux_dirent_t) + strlen(d->d_name) + 1; + reclen = (reclen + 3) & ~3; // align to 4 bytes + if (total + reclen > (size_t)R_EDX) + break; // no more space + i386_linux_dirent_t* d32 = (i386_linux_dirent_t*)((char*)from_ptrv(R_ECX) + total); + d32->d_ino = (uint32_t)d->d_ino; + d32->d_off = (uint32_t)d->d_off; + d32->d_reclen = (uint16_t)reclen; + strcpy(d32->d_name, d->d_name); + total += reclen; + off += d->d_reclen; + } + S_EAX = total; + } + box_free(dirent_buffer); + break; + } + case 186: // sigaltstack + S_EAX = my32_sigaltstack(emu, from_ptrv(R_EBX), from_ptrv(R_ECX)); + if(S_EAX==-1 && errno>0) + S_EAX = -errno; + break; + case 192: // mmap2 + R_EAX = to_ptrv(my32_mmap64(emu, from_ptrv(R_EBX), (unsigned long)R_ECX, R_EDX, R_ESI, R_EDI, R_EBP)); + break; + case 240: // futex + { + struct_LL_t tspec; + int need_tspec = 1; + switch(R_ECX&FUTEX_CMD_MASK) { + case FUTEX_WAIT: + case FUTEX_WAIT_BITSET: + case FUTEX_LOCK_PI: + case FUTEX_LOCK_PI2: + case FUTEX_WAIT_REQUEUE_PI: + need_tspec = 1; + break; + case FUTEX_CMP_REQUEUE_PI: + case FUTEX_UNLOCK_PI: + case FUTEX_TRYLOCK_PI: + case FUTEX_WAKE_BITSET: + case FUTEX_WAKE_OP: + case FUTEX_REQUEUE: + case FUTEX_CMP_REQUEUE: + case FUTEX_FD: + case FUTEX_WAKE: + default: need_tspec = 0; + } + if(need_tspec && R_ESI) + from_struct_LL(&tspec, R_ESI); + else + need_tspec = 0; + S_EAX = syscall(__NR_futex, R_EBX, R_ECX, R_EDX, need_tspec?&tspec:from_ptrv(R_ESI), R_EDI, R_EBP); + if(S_EAX==-1 && errno>0) + R_EAX = (uint32_t)-errno; + } + break; + case 243: // set_thread_area + R_EAX = my_set_thread_area_32(emu, (thread_area_32_t*)(uintptr_t)R_EBX); + if(R_EAX==0xffffffff && errno>0) + R_EAX = (uint32_t)-errno; + break; + case 312: // get_robust_list + { + static struct i386_robust_list_head h; + ulong_t *arg2 = from_ptrv(R_EDX); + ptr_t* arg1 = from_ptrv(R_ECX); + tmp = arg1?(from_ptrv(*arg1)):NULL; + tmps = arg2?(from_ulong(*arg2)):0; + tmp = R_ECX?from_ptrv(*(ptr_t*)from_ptrv(R_ECX)):NULL; + tmps = R_EDX?from_ulong(*(ulong_t*)from_ptrv(R_EDX)):0; + R_EAX = syscall(__NR_get_robust_list, S_EBX, arg1?(&tmp):NULL, arg2?(&tmps):NULL); + if(!R_EAX) { + if(arg1) { + h.list.next = (*(void**)tmp==tmp)?to_ptrv(&h):to_ptrv(*(void**)tmp); // set head + h.futex_offset = to_long(((long*)tmp)[1]); + h.list_op_pending = to_ptrv(((void**)tmp)[2]); + *arg1 = to_ptrv(&h); // should wrap all the structures, and keep it alive... + } + if(arg2) *arg2 = to_ulong(tmps/2); // it's 2 times smaller in x86 + } else if(R_EAX==0xffffffff && errno>0) + R_EAX = (uint32_t)-errno; + } + break; + case 449: + #if defined(__NR_futex_waitv) && !defined(BAD_SIGNAL) + S_RAX = syscall(__NR_futex_waitv, R_EBX, R_ECX, R_EDX, R_ESI, R_EDI); + #else + S_RAX = -ENOSYS; + #endif + break; + default: + printf_log(LOG_INFO, "Warning: Unsupported Syscall 0x%02Xh (%d)\n", s, s); + R_EAX = (uint32_t)-ENOSYS; + return; + } + printf_log(LOG_DEBUG, " => 0x%x\n", R_EAX); +} + +#ifdef BOX32 +#define stack(n) (b[(n)/4]) +#define i32(n) (int32_t)stack(n) +#define u32(n) (uint32_t)stack(n) +#define p(n) from_ptrv(stack(n)) + +uint32_t EXPORT my32_syscall(x64emu_t *emu, uint32_t s, ptr_t* b) +{ + static uint64_t warned[10] = {0}; + printf_log(LOG_DEBUG, "%p: Calling libc syscall 0x%02X (%d) %p %p %p %p %p\n", from_ptrv(R_EIP), s, s, from_ptrv(u32(0)), from_ptrv(u32(4)), from_ptrv(u32(8)), from_ptrv(u32(12)), from_ptrv(u32(16))); + // check wrapper first + int cnt = sizeof(syscallwrap) / sizeof(scwrap_t); + size_t tmps; + void* tmp; + int ret; + for (int i=0; iquit = 1; + return 0; + } + } + } + switch (s) { + case 1: // __NR_exit + emu->quit = 1; + return u32(0); // faking the syscall here, we don't want to really terminate the program now + #ifndef __NR_fork + case 2: + return fork(); + #endif + case 3: // sys_read + return (uint32_t)to_long(my32_read(i32(0), p(4), u32(8))); + case 4: // sys_write + return (uint32_t)to_long(write(i32(0), p(4), u32(8))); + case 5: // sys_open + return my_open(emu, p(0), of_convert32(u32(4)), u32(8)); + case 6: // sys_close + return (uint32_t)close(i32(0)); + case 11: // execve + return (uint32_t)my32_execve(emu, p(0), p(4), p(8)); + #ifndef __NR_fork + case 42: + S_EAX = pipe(p(0)); + if(S_EAX==-1) + S_EAX = -errno; + break; + #endif + case 91: // munmap + return (uint32_t)my32_munmap(emu, p(0), u32(4)); +#if 0 + case 120: // clone + // x86 raw syscall is long clone(unsigned long flags, void *stack, int *parent_tid, unsigned long tls, int *child_tid); + // so flags=u(0), stack=p(4), parent_tid=p(8), tls=p(12), child_tid=p(16) + if(p(4)) + { + void* stack_base = p(4); + int stack_size = 0; + if(!stack_base) { + // allocate a new stack... + int currstack = 0; + if((R_ESP>=(uintptr_t)emu->init_stack) && (R_ESP<=((uintptr_t)emu->init_stack+emu->size_stack))) + currstack = 1; + stack_size = (currstack)?emu->size_stack:(1024*1024); + stack_base = mmap(NULL, stack_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_GROWSDOWN, -1, 0); + // copy value from old stack to new stack + if(currstack) + memcpy(stack_base, emu->init_stack, stack_size); + else { + int size_to_copy = (uintptr_t)emu->init_stack + emu->size_stack - (R_ESP); + memcpy(stack_base+stack_size-size_to_copy, (void*)R_ESP, size_to_copy); + } + } + x64emu_t * newemu = NewX86Emu(emu->context, R_EIP, (uintptr_t)stack_base, stack_size, (p(4))?0:1); + SetupX86Emu(newemu); + CloneEmu(newemu, emu); + Push32(newemu, 0); + PushExit(newemu); + void* mystack = NULL; + if(my32_context->stack_clone_used) { + mystack = malloc(1024*1024); // stack for own process... memory leak, but no practical way to remove it + } else { + if(!my32_context->stack_clone) + my32_context->stack_clone = malloc(1024*1024); + mystack = my32_context->stack_clone; + my32_context->stack_clone_used = 1; + } + // x86_64 raw clone is long clone(unsigned long flags, void *stack, int *parent_tid, int *child_tid, unsigned long tls); + long ret = clone(clone_fn, (void*)((uintptr_t)mystack+1024*1024), u32(0), newemu, p(8), p(12), p(16)); + return (uint32_t)ret; + } + else + return (uint32_t)syscall(__NR_clone, u32(0), p(4), p(8), p(12), p(16)); + break; + case 123: // SYS_modify_ldt + return my32_modify_ldt(emu, i32(0), (thread_area_t*)p(4), i32(8)); + case 125: // mprotect + return (uint32_t)my32_mprotect(emu, p(0), u32(4), i32(8)); + case 174: // sys_rt_sigaction + return (uint32_t)my32_sigaction(emu, i32(0), (x86_sigaction_t*)p(4), (x86_sigaction_t*)p(8)); +#endif + case 186: // sigaltstack + return my32_sigaltstack(emu, p(0), p(4)); + case 192: // mmap2 + return to_ptrv(my32_mmap64(emu, p(0), u32(4), i32(8), i32(12), i32(16), u32(20))); + case 240: // futex + { + struct_LL_t tspec; + int need_tspec = 1; + switch(u32(4)&FUTEX_CMD_MASK) { + case FUTEX_WAIT: + case FUTEX_WAIT_BITSET: + case FUTEX_LOCK_PI: + case FUTEX_LOCK_PI2: + case FUTEX_WAIT_REQUEUE_PI: + need_tspec = 1; + break; + case FUTEX_CMP_REQUEUE_PI: + case FUTEX_UNLOCK_PI: + case FUTEX_TRYLOCK_PI: + case FUTEX_WAKE_BITSET: + case FUTEX_WAKE_OP: + case FUTEX_REQUEUE: + case FUTEX_CMP_REQUEUE: + case FUTEX_FD: + case FUTEX_WAKE: + default: need_tspec = 0; + } + if(need_tspec && u32(12)) + from_struct_LL(&tspec, u32(12)); + else + need_tspec = 0; + return syscall(__NR_futex, p(0), i32(4), u32(8), need_tspec?(&tspec):p(12), p(16), u32(20)); + } + break; + case 243: // set_thread_area + return my_set_thread_area_32(emu, (thread_area_32_t*)p(0)); +#if 0 + case 254: // epoll_create + return my32_epoll_create(emu, i32(0)); + case 255: // epoll_ctl + return my32_epoll_ctl(emu, i32(0), i32(4), i32(8), p(12)); + case 256: // epoll_wait + return my32_epoll_wait(emu, i32(0), p(4), i32(8), i32(12)); + case 270: //_NR_tgkill + /*if(!u32(8))*/ { + //printf("tgkill(%u, %u, %u) => ", u32(0), u32(4), u32(8)); + uint32_t ret = (uint32_t)syscall(__NR_tgkill, u32(0), u32(4), u32(8)); + //printf("%u (errno=%d)\n", ret, (ret==(uint32_t)-1)?errno:0); + return ret; + }/* else { + printf_log(LOG_INFO, "Warning: ignoring libc Syscall tgkill (%u, %u, %u)\n", u32(0), u32(4), u32(8)); + }*/ + return 0; +#endif + case 312: // get_robust_list + { + // will wrap only head for now + static uint8_t i386_nothing[0x14] = {0}; // for faking steamcmd use of get_robust_list + static struct i386_robust_list_head h; + ulong_t *arg2 = p(8); + ptr_t* arg1 = p(4); + tmp = arg1?(from_ptrv(*arg1)):NULL; + tmps = arg2?(from_ulong(*arg2)):0; + ret = syscall(__NR_get_robust_list, u32(0), arg1?(&tmp):NULL, arg2?(&tmps):NULL); + if(!ret) { + if(box64_steamcmd || 1) { + h.list.next = to_ptrv(&h); + h.futex_offset = -0x14; + h.list_op_pending = 0; + *arg1 = to_ptrv(&h); + *arg2 = 12; + } else { + if(arg1) { + h.list.next = to_ptrv(((void**)tmp)[0]);//(*(void**)tmp==tmp)?to_ptrv(&h):to_ptrv(*(void**)tmp); // set head + h.futex_offset = to_long(((long*)tmp)[1]); + h.list_op_pending = to_ptrv(((void**)tmp)[2]); + *arg1 = to_ptrv(&h); // should wrap all the structures, and keep it alive... + } + if(arg2) *arg2 = to_ulong(tmps/2); // it's 2 times smaller in x86 + } + } + } + return ret; +#if 0 +#ifndef NOALIGN + case 329: // epoll_create1 + return my32_epoll_create1(emu, of_convert32(i32(0))); +#endif +#ifndef __NR_getrandom + case 355: // getrandom + return (uint32_t)my32_getrandom(emu, p(0), u32(4), u32(8)); +#endif +#ifndef __NR_memfd_create + case 356: // memfd_create + return (uint32_t)my32_memfd_create(emu, p(0), u32(4)); +#endif +#endif + case 449: + //futex_waitv(struct futex_waitv *waiters, unsigned int nr_futexes, unsigned int flags, struct timespec *timeout, clockid_t clockid) + //This syscall supports only 64bit sized timeout structs + // the struct futex_waitv is also the same for 32bits and 64bits address space (with 64bits sized address) + #if defined(__NR_futex_waitv) && !defined(BAD_SIGNAL) + return syscall(__NR_futex_waitv, p(0), u32(4), u32(8), p(12), u32(16)); + #else + errno = ENOSYS; + return -1; + #endif + default: + if((s>>6)>6]&(1<<(s&0x3f)))) { + printf_log(LOG_INFO, "Warning: Unsupported libc Syscall 0x%02X (%d)\n", s, s); + warned[s>>6] |= (1<<(s&0x3f)); + } + } else + printf_log(LOG_INFO, "Warning: Unsupported libc Syscall 0x%02X (%d)\n", s, s); + errno = ENOSYS; + return -1; + } + return 0; +} +#endif //BOX32 diff --git a/src/emu/x87emu_private.c b/src/emu/x87emu_private.c index c54f80d..e42909a 100644 --- a/src/emu/x87emu_private.c +++ b/src/emu/x87emu_private.c @@ -7,6 +7,7 @@ #include "debug.h" #include "x64emu_private.h" #include "x87emu_private.h" +#include "bitutils.h" //#include "x64run_private.h" void fpu_do_free(x64emu_t* emu, int i) @@ -81,7 +82,7 @@ void fpu_fbld(x64emu_t* emu, uint8_t* s) { // long double (80bits) -> double (64bits) void LD2D(void* ld, void* d) { - if(box64_x87_no80bits) { + if(BOX64ENV(x87_no80bits)) { *(uint64_t*)d = *(uint64_t*)ld; return; } @@ -99,39 +100,31 @@ void LD2D(void* ld, void* d) val.f.ud[1] = *(uint32_t*)(char*)(ld+4); val.b = *(int16_t*)((char*)ld+8); #endif - int32_t exp64 = (((uint32_t)(val.b&0x7fff) - BIAS80) + BIAS64); - int32_t exp64final = exp64&0x7ff; // do specific value first (0, infinite...) // bit 63 is "integer part" - // bit 62 is sign if((uint32_t)(val.b&0x7fff)==0x7fff) { // infinity and nans - int t = 0; //nan - switch((val.f.ud[1]>>30)) { - case 0: if((val.f.ud[1]&(1<<29))==0) t = 1; - break; - case 2: if((val.f.ud[1]&(1<<29))==0) t = 1; - break; - } + int t = (val.f.q&0x7fffffffffffffffLL)?0:1; if(t) { // infinite - result.d = HUGE_VAL; - } else { // NaN - result.ud[1] = 0x7ff << 20; + result.ud[1] = (val.b>>4) << 20; result.ud[0] = 0; + } else { // NaN + result.ud[1] = (val.b>>4) << 20 | ((val.f.q>>(63-20))&0x000fffff); + result.ud[0] = (val.f.q>>(63-56))&0xffffffff; + if(!(result.q&0x000fffffffffffffLL)) + result.q |= 1; } - if(val.b&0x8000) - result.ud[1] |= 0x80000000; *(uint64_t*)d = result.q; return; } + int32_t exp64 = (((uint32_t)(val.b&0x7fff) - BIAS80) + BIAS64); + int32_t exp64final = exp64&0x7ff; if(((uint32_t)(val.b&0x7fff)==0) || (exp64<-1074)) { //if(val.f.q==0) // zero //if(val.f.q!=0) // denormal, but that's to small value for double - uint64_t r = 0; - if(val.b&0x8000) - r |= 0x8000000000000000L; + uint64_t r = (val.b&0x8000)?0x8000000000000000LL:0LL; *(uint64_t*)d = r; return; } @@ -168,7 +161,7 @@ void LD2D(void* ld, void* d) // double (64bits) -> long double (80bits) void D2LD(void* d, void* ld) { - if(box64_x87_no80bits) { + if(BOX64ENV(x87_no80bits)) { *(uint64_t*)ld = *(uint64_t*)d; return; } @@ -184,10 +177,7 @@ void D2LD(void* d, void* ld) if((s.q&0x7fffffffffffffffL)==0) { // zero... val.f.q = 0; - if(s.ud[1]&0x8000) - val.b = 0x8000; - else - val.b = 0; + val.b = (s.ud[1]&0x80000000)?0x8000:0; memcpy(ld, &val, 10); return; } @@ -203,14 +193,14 @@ void D2LD(void* d, void* ld) if(mant80==0x0) mant80final = 0x8000000000000000L; //infinity else - mant80final = 0xc000000000000000L; //(quiet)NaN + mant80final |= 0x8000000000000000L; //(quiet)NaN } else { if(exp80!=0){ mant80final |= 0x8000000000000000L; exp80final += (BIAS80 - BIAS64); - } else if(mant80final!=0) { - // denormals -> normal - exp80final = BIAS80-1023; + } else { + // denormals -> normal (the case of 0 has been dealt with already) + exp80final = BIAS80-BIAS64; int one = __builtin_clz(mant80final) + 1; exp80final -= one; mant80final<<=one; @@ -225,7 +215,7 @@ void D2LD(void* d, void* ld) double FromLD(void* ld) { - if(box64_x87_no80bits) + if(BOX64ENV(x87_no80bits)) return *(double*)ld; double ret; // cannot add = 0; it break factorio (issue when calling fmodl) LD2D(ld, &ret); @@ -255,7 +245,7 @@ void fpu_loadenv(x64emu_t* emu, char* p, int b16) emu->sw.x16 = *p16++; // tagword: 2bits*8 // tags... (only full = 0b11 / free = 0b00) - emu->fpu_tags = ~*(p16++); + emu->fpu_tags = *(p16++); // intruction pointer: 16bits // data (operand) pointer: 16bits // last opcode: 11bits save: 16bits restaured (1st and 2nd opcode only) @@ -264,8 +254,8 @@ void fpu_loadenv(x64emu_t* emu, char* p, int b16) emu->cw.x16 = *p32++; emu->sw.x16 = *p32++; // tagword: 2bits*8 - // tags... (only full = 0b11 / free = 0b00) - emu->fpu_tags = ~*(p32++); + // tags... (only free = 0b11 / full = 0b00) + emu->fpu_tags = *(p32++); // intruction pointer: 16bits // data (operand) pointer: 16bits // last opcode: 11bits save: 16bits restaured (1st and 2nd opcode only) @@ -282,14 +272,14 @@ void fpu_savenv(x64emu_t* emu, char* p, int b16) *p16++ = emu->sw.x16; // tagword: 2bits*8 // tags... - *p16++ = ~emu->fpu_tags; + *p16++ = emu->fpu_tags; } else { uint32_t* p32 = (uint32_t*)p; *p32++ = emu->cw.x16; *p32++ = emu->sw.x16; // tagword: 2bits*8 // tags... - *p32++ = ~emu->fpu_tags; + *p32++ = emu->fpu_tags; } // other stuff are not pushed.... @@ -311,8 +301,8 @@ typedef struct xsave32_s { uint32_t MxCsr; /* 018 */ uint32_t MxCsr_Mask; /* 01c */ sse_regs_t FloatRegisters[8];/* 020 */ // fpu/mmx are store in 128bits here - sse_regs_t XmmRegisters[16]; /* 0a0 */ - uint8_t Reserved4[96]; /* 1a0 */ + sse_regs_t XmmRegisters[8]; /* 0a0 */ + uint8_t Reserved4[56*4]; /* 120 */ } xsave32_t; typedef struct xsave64_s { uint16_t ControlWord; /* 000 */ @@ -354,12 +344,12 @@ void fpu_fxsave32(x64emu_t* emu, void* ed) for(int i=0; i<8; ++i) memcpy(&p->FloatRegisters[i].q[0], (immx[i], sizeof(mmx87_regs_t)); // copy SSE regs - for(int i=0; i<16; ++i) - memcpy(&p->XmmRegisters[i], &emu->xmm[i], 16); + memcpy(p->XmmRegisters, emu->xmm, 8*16); } void fpu_fxsave64(x64emu_t* emu, void* ed) { + // the subtelties of the REX.W are not handled in fxsave64/fxrstor64 xsave64_t *p = (xsave64_t*)ed; // should save flags & all int top = emu->top&7; @@ -381,8 +371,7 @@ void fpu_fxsave64(x64emu_t* emu, void* ed) for(int i=0; i<8; ++i) memcpy(&p->FloatRegisters[i].q[0], (immx[i], sizeof(mmx87_regs_t)); // copy SSE regs - for(int i=0; i<16; ++i) - memcpy(&p->XmmRegisters[i], &emu->xmm[i], 16); + memcpy(p->XmmRegisters, emu->xmm, 16*16); } void fpu_fxrstor32(x64emu_t* emu, void* ed) @@ -391,7 +380,7 @@ void fpu_fxrstor32(x64emu_t* emu, void* ed) emu->cw.x16 = p->ControlWord; emu->sw.x16 = p->StatusWord; emu->mxcsr.x32 = p->MxCsr; - if(box64_sse_flushto0) + if(BOX64ENV(sse_flushto0)) applyFlushTo0(emu); emu->top = emu->sw.f.F87_TOP; uint8_t tags = p->TagWord; @@ -406,17 +395,17 @@ void fpu_fxrstor32(x64emu_t* emu, void* ed) for(int i=0; i<8; ++i) memcpy((immx[i], &p->FloatRegisters[i].q[0], sizeof(mmx87_regs_t)); // copy SSE regs - for(int i=0; i<16; ++i) - memcpy(&emu->xmm[i], &p->XmmRegisters[i], 16); + memcpy(emu->xmm, p->XmmRegisters, 8*16); } void fpu_fxrstor64(x64emu_t* emu, void* ed) { + // the subtelties of the REX.W are not handled in fxsave64/fxrstor64 xsave64_t *p = (xsave64_t*)ed; emu->cw.x16 = p->ControlWord; emu->sw.x16 = p->StatusWord; emu->mxcsr.x32 = p->MxCsr; - if(box64_sse_flushto0) + if(BOX64ENV(sse_flushto0)) applyFlushTo0(emu); emu->top = emu->sw.f.F87_TOP; uint8_t tags = p->TagWord; @@ -431,8 +420,7 @@ void fpu_fxrstor64(x64emu_t* emu, void* ed) for(int i=0; i<8; ++i) memcpy((immx[i], &p->FloatRegisters[i].q[0], sizeof(mmx87_regs_t)); // copy SSE regs - for(int i=0; i<16; ++i) - memcpy(&emu->xmm[i], &p->XmmRegisters[i], 16); + memcpy(emu->xmm, p->XmmRegisters, 16*16); } typedef struct xsaveheader_s { @@ -446,7 +434,7 @@ void fpu_xsave_mask(x64emu_t* emu, void* ed, int is32bits, uint64_t mask) xsave64_t *p = (xsave64_t*)ed; xsaveheader_t *h = (xsaveheader_t*)(p+1); uint32_t rfbm = (0b111&mask); - h->xstate_bv =(h->xstate_bv&~0b111)|rfbm; + h->xstate_bv =(h->xstate_bv&~mask)|rfbm; h->xcomp_bv = 0; if(h->xstate_bv&0b001) { int top = emu->top&7; @@ -473,13 +461,11 @@ void fpu_xsave_mask(x64emu_t* emu, void* ed, int is32bits, uint64_t mask) } // copy SSE regs if(h->xstate_bv&0b10) { - for(int i=0; i<(is32bits?8:16); ++i) - memcpy(&p->XmmRegisters[i], &emu->xmm[i], 16); + memcpy(&p->XmmRegisters[0], &emu->xmm[0], 16*(is32bits?8:16)); } if(h->xstate_bv&0b100) { sse_regs_t* avx = (sse_regs_t*)(h+1); - for(int i=0; i<(is32bits?8:16); ++i) - memcpy(&avx[i], &emu->ymm[i], 16); + memcpy(&avx[0], &emu->ymm[0], 16*(is32bits?8:16)); } } @@ -491,10 +477,14 @@ void fpu_xsave(x64emu_t* emu, void* ed, int is32bits) void fpu_xrstor(x64emu_t* emu, void* ed, int is32bits) { + uint64_t mask = R_EAX | (((uint64_t)R_EDX)<<32); + return fpu_xrstor_mask(emu, ed, is32bits, mask); +} + +void fpu_xrstor_mask(x64emu_t* emu, void* ed, int is32bits, uint64_t mask) { xsave64_t *p = (xsave64_t*)ed; xsaveheader_t *h = (xsaveheader_t*)(p+1); int compressed = (h->xcomp_bv>>63); - uint64_t mask = R_EAX | (((uint64_t)R_EDX)<<32); uint32_t rfbm = (0b111&mask); uint32_t to_restore = rfbm & h->xstate_bv; uint32_t to_init = rfbm & ~h->xstate_bv; @@ -503,7 +493,7 @@ void fpu_xrstor(x64emu_t* emu, void* ed, int is32bits) emu->cw.x16 = p->ControlWord; emu->sw.x16 = p->StatusWord; emu->mxcsr.x32 = p->MxCsr; - if(box64_sse_flushto0) + if(BOX64ENV(sse_flushto0)) applyFlushTo0(emu); emu->top = emu->sw.f.F87_TOP; uint8_t tags = p->TagWord; @@ -525,20 +515,16 @@ void fpu_xrstor(x64emu_t* emu, void* ed, int is32bits) } if(to_restore&0b010) { // copy SSE regs - for(int i=0; i<(is32bits?8:16); ++i) - memcpy(&emu->xmm[i], &p->XmmRegisters[i], 16); + memcpy(&emu->xmm[0], &p->XmmRegisters[0], 16*(is32bits?8:16)); } else if(to_init&0b010) { - for(int i=0; i<(is32bits?8:16); ++i) - memset(&emu->xmm[i], 0, 16); + memset(&emu->xmm[0], 0, 16*(is32bits?8:16)); } if(to_restore&0b100) { // copy AVX upper part of regs sse_regs_t* avx = (sse_regs_t*)(h+1); - for(int i=0; i<(is32bits?8:16); ++i) - memcpy(&emu->ymm[i], &avx[i], 16); + memcpy(&emu->ymm[0], &avx[0], 16*(is32bits?8:16)); } else if(to_init&0b100) { - for(int i=0; i<(is32bits?8:16); ++i) - memset(&emu->ymm[i], 0, 16); + memset(&emu->ymm[0], 0, 16*(is32bits?8:16)); } } @@ -566,9 +552,14 @@ uint32_t cvtf16_32(uint16_t v) f32_t ret = {0}; ret.sign = in.sign; ret.fraction = in.fraction<<13; - if(!in.exponant) + if(!in.exponant) { ret.exponant = 0; - else if(in.exponant==0b11111) + if (in.fraction) { + int8_t s = 23 - (15 - LeadingZeros16(in.fraction)); + ret.exponant = 126 - s; + ret.fraction = in.fraction << s; + } + } else if(in.exponant==0b11111) ret.exponant = 0b11111111; else { int e = in.exponant - 15; @@ -585,17 +576,22 @@ uint16_t cvtf32_16(uint32_t v, uint8_t rounding) if(!in.exponant) { // zero and denormals ret.exponant = 0; - ret.fraction = in.fraction>>13; + if(in.fraction && ((rounding==1 && ret.sign) || ((rounding==2) && !ret.sign))) + ret.fraction = 1; // rounding artifact + else + ret.fraction = 0; // no way a 32bits denormal is something else the 0 in 16bits return ret.u16; } else if(in.exponant==0b11111111) { // nan and infinites ret.exponant = 0b11111; ret.fraction = in.fraction; + if(in.fraction && !ret.fraction) + ret.fraction = 0b1000000000; return ret.u16; } else { // regular numbers int e = in.exponant - 127; - uint16_t f = (in.fraction>>13); + uint16_t f = (in.fraction>>13)|0b10000000000; // add back implicit msb uint16_t r = in.fraction&0b1111111111111; switch(rounding) { case 0: // nearest even @@ -611,15 +607,25 @@ uint16_t cvtf32_16(uint32_t v, uint8_t rounding) case 3: // truncate break; } - if(f>0b1111111111) { + if(f>0b11111111111) { // implicit msb included ++e; f>>=1; } - // remove msb, it's implicit + // remove implicit msb + if(f) { + while(!(f&0b10000000000)) { + f<<=1; + --e; + } + } + // there is no msb to remove, as it's implicit and was not added back before if(!f) e = -15; else if(e<-14) { // flush to zero - e = -15; f = 0; + f >>= (-15-e); + e = -15; + if((rounding==1 && ret.sign) || ((rounding==2) && !ret.sign)) + f = 1; // rounding artifact } else if(e>15) { if((rounding==1 && !in.sign) || (rounding==2 && in.sign) || (rounding==3)) { @@ -631,7 +637,7 @@ uint16_t cvtf32_16(uint32_t v, uint8_t rounding) f=0; e = 16; } - } + } else f&=0b1111111111; // remove implicit msb (bit 11) ret.fraction = f; ret.exponant = e+15; } diff --git a/src/emu/x87emu_private.h b/src/emu/x87emu_private.h index 74758ac..ff42d44 100644 --- a/src/emu/x87emu_private.h +++ b/src/emu/x87emu_private.h @@ -219,6 +219,7 @@ void fpu_fxrstor64(x64emu_t* emu, void* ed); void fpu_xsave(x64emu_t* emu, void* ed, int is32bits); void fpu_xsave_mask(x64emu_t* emu, void* ed, int is32bits, uint64_t mask); void fpu_xrstor(x64emu_t* emu, void* ed, int is32bits); +void fpu_xrstor_mask(x64emu_t* emu, void* ed, int is32bits, uint64_t mask); uint32_t cvtf16_32(uint16_t v); uint16_t cvtf32_16(uint32_t v, uint8_t rounding); diff --git a/src/emu/x87emu_setround.h b/src/emu/x87emu_setround.h new file mode 100644 index 0000000..4791c3e --- /dev/null +++ b/src/emu/x87emu_setround.h @@ -0,0 +1,29 @@ +#ifndef __SETROUND_H__ +#define __SETROUND_H__ +#pragma STDC FENV_ACCESS ON +#include +#include +#include "x64emu.h" +#include "x64emu_private.h" +// set the rounding mode to the emulator's one, and return the old one +static inline int fpu_setround(x64emu_t* emu) { + int ret = fegetround(); + int rounding_direction; + switch (emu->cw.f.C87_RD) { + case ROUND_Nearest: + rounding_direction = FE_TONEAREST; + break; + case ROUND_Down: + rounding_direction = FE_DOWNWARD; + break; + case ROUND_Up: + rounding_direction = FE_UPWARD; + break; + case ROUND_Chop: + rounding_direction = FE_TOWARDZERO; + break; + } + fesetround(rounding_direction); + return ret; +} +#endif \ No newline at end of file diff --git a/src/git_head.h b/src/git_head.h deleted file mode 100644 index 87ce2b4..0000000 --- a/src/git_head.h +++ /dev/null @@ -1 +0,0 @@ -#define GITREV "c91fc87" diff --git a/src/include/alternate.h b/src/include/alternate.h new file mode 100644 index 0000000..e0f62b1 --- /dev/null +++ b/src/include/alternate.h @@ -0,0 +1,10 @@ +#ifndef __ALTERNATE_H__ +#define __ALTERNATE_H__ + +int hasAlternate(void* addr); +void* getAlternate(void* addr); +void addAlternate(void* addr, void* alt); +void addCheckAlternate(void* addr, void* alt); +void cleanAlternate(void); + +#endif //__ALTERNATE_H__ diff --git a/src/include/backtrace.h b/src/include/backtrace.h new file mode 100644 index 0000000..b098d77 --- /dev/null +++ b/src/include/backtrace.h @@ -0,0 +1,6 @@ +#ifndef __BACKTRACE_H_ +#define __BACKTRACE_H_ + +void ShowNativeBT(int log_minimum); + +#endif // __BACKTRACE_H_ \ No newline at end of file diff --git a/src/include/bitutils.h b/src/include/bitutils.h index 50622da..a392528 100644 --- a/src/include/bitutils.h +++ b/src/include/bitutils.h @@ -4,7 +4,9 @@ extern const uint8_t deBruijn64tab[64]; extern const uint8_t lead0tab[16]; +extern const uint8_t lead0tab8[256]; int TrailingZeros64(uint64_t x); +int LeadingZeros16(uint16_t x); #endif //__BITUTILS_H_ diff --git a/src/include/box32.h b/src/include/box32.h new file mode 100644 index 0000000..22e5f4f --- /dev/null +++ b/src/include/box32.h @@ -0,0 +1,115 @@ +#ifndef __BOX32_64__H_ +#define __BOX32_64__H_ + +#include +#include + +#ifndef BOX32_DEF +#define BOX32_DEF +typedef uint32_t ptr_t; +typedef int32_t long_t; +typedef uint32_t ulong_t; +#endif + +#define TEST32 +#define TEST_ABORT + +static inline uintptr_t from_ptr(ptr_t p) { + return (uintptr_t)p; +} +static inline void* from_ptrv(ptr_t p) { + return (void*)(uintptr_t)p; +} +static inline long long from_long(long_t l) { + return (long long)l; +} +static inline unsigned long long from_ulong(ulong_t l) { + return (unsigned long long)l; +} +uintptr_t from_hash(ulong_t l); +uintptr_t from_hash_d(ulong_t l); +#ifdef TEST32 +#include "debug.h" +void box64_abort(); + +static inline ptr_t to_ptr(uintptr_t p) { + if(p!=0xffffffffffffffffLL && (p>>32)) { + printf_log(LOG_NONE, "Warning, uintptr_t %p is not a 32bits value\n", (void*)p); + #ifdef TEST_ABORT + box64_abort(); + #endif + } + return (ptr_t)p; +} +static inline ptr_t to_ptrv(void* p2) { + uintptr_t p = (uintptr_t)p2; + if(p!=0xffffffffffffffffLL && (p>>32)) { + printf_log(LOG_NONE, "Warning, pointer %p is not a 32bits value\n", p2); + #ifdef TEST_ABORT + box64_abort(); + #endif + } + return (ptr_t)p; +} +static inline long_t to_long(long long l) { + long_t ret = (long_t)l; + if(l!=ret) + printf_log(LOG_NONE, "Warning, long %ld is not a 32bits value\n", l); + return ret; +} +static inline ulong_t to_ulong(unsigned long long l) { + if(l!=0xffffffffffffffffLL && (l>>32)) + printf_log(LOG_NONE, "Warning, ulong %p is not a 32bits value\n", (void*)l); + return (ulong_t)l; +} +#else //TEST32 +static inline ptr_t to_ptr(uintptr_t p) { + return (ptr_t)p; +} +static inline ptr_t to_ptrv(void* p) { + return (ptr_t)(uintptr_t)p; +} +static inline long_t to_long(long long l) { + return (long_t)l; +} +static inline ulong_t to_ulong(unsigned long long l) { + return (ulong_t)l; +} +#endif //TEST32 + +static inline ptr_t to_ptr_silent(uintptr_t p) { + return (ptr_t)p; +} +static inline ptr_t to_ptrv_silent(void* p) { + return (ptr_t)(uintptr_t)p; +} +// indirect l -> T +#define from_ptri(T, l) *(T*)from_ptr(l) +// indirect l -> void* +static inline void* from_ptriv(ptr_t l) { + return from_ptrv(from_ptri(ptr_t, l)); +} +static inline ptr_t to_ulong_silent(unsigned long l) { + return (ulong_t)l; +} + +ulong_t to_hash(uintptr_t p); +ulong_t to_hash_d(uintptr_t p); +static inline ulong_t to_hashv(void* p) {return to_hash((uintptr_t)p);} +static inline ulong_t to_hashv_d(uintptr_t p) {return to_hash_d((uintptr_t)p);} + +void* from_locale(ptr_t l); +void* from_locale_d(ptr_t l); +ptr_t to_locale(void* p); +ptr_t to_locale_d(void* p); + +char* from_cstring(ptr_t p); +ptr_t to_cstring(char* p); +ptr_t to_cstring_d(char* p); + +void init_hash_helper(); +void fini_hash_helper(); + +typedef struct x86emu_s x86emu_t; + +#endif //__BOX32_64__H_ diff --git a/src/include/box32_inputevent.h b/src/include/box32_inputevent.h new file mode 100644 index 0000000..aa7623b --- /dev/null +++ b/src/include/box32_inputevent.h @@ -0,0 +1,22 @@ +#ifndef __BOX32_INPUTEVENT_H__ +#define __BOX32_INPUTEVENT_H__ + +#include +#include "box32.h" + +// check if fd is an input event, and will register it to the list if it is +void addInputEventFD(int fd); +// return 1 if fd is registered as an input event +int isFDInputEvent(int fd); +// remove fd if it was registered as input event +void removeInputEventFD(int fd); + +typedef struct my_input_event_32_s { + ulong_t sec; + ulong_t usec; + uint16_t type; + uint16_t code; + int value; +} my_input_event_32_t; + +#endif // __BOX32_INPUTEVENT_H__ \ No newline at end of file diff --git a/src/include/box32context.h b/src/include/box32context.h new file mode 100644 index 0000000..fac7a6f --- /dev/null +++ b/src/include/box32context.h @@ -0,0 +1,7 @@ +#ifndef __BOX32CONTEXT_H_ +#define __BOX32CONTEXT_H_ + +#include "box32.h" +#include "box64context.h" + +#endif//__BOX32CONTEXT_H_ \ No newline at end of file diff --git a/src/include/box64context.h b/src/include/box64context.h index b870672..5b8549f 100644 --- a/src/include/box64context.h +++ b/src/include/box64context.h @@ -1,18 +1,26 @@ #ifndef __BOX64CONTEXT_H_ #define __BOX64CONTEXT_H_ #include -#include + +#include "mypthread.h" #include "pathcoll.h" #include "dictionnary.h" #ifdef DYNAREC #include "dynarec/native_lock.h" #endif +#ifndef BOX32_DEF +#define BOX32_DEF +typedef uint32_t ptr_t; +typedef int32_t long_t; +typedef uint32_t ulong_t; +#endif #ifdef DYNAREC // disabling for now, seems to have a negative impact on performances //#define USE_CUSTOM_MUTEX #endif + typedef struct elfheader_s elfheader_t; typedef struct cleanup_s cleanup_t; typedef struct x64emu_s x64emu_t; @@ -26,8 +34,9 @@ typedef struct kh_defaultversion_s kh_defaultversion_t; typedef struct kh_mapsymbols_s kh_mapsymbols_t; typedef struct library_s library_t; typedef struct linkmap_s linkmap_t; +typedef struct linkmap32_s linkmap32_t; typedef struct kh_threadstack_s kh_threadstack_t; -typedef struct rbtree rbtree; +typedef struct rbtree rbtree_t; typedef struct atfork_fnc_s { uintptr_t prepare; uintptr_t parent; @@ -44,7 +53,11 @@ typedef struct kh_dynablocks_s kh_dynablocks_t; typedef void* (*procaddress_t)(const char* name); typedef void* (*vkprocaddess_t)(void* instance, const char* name); +#ifdef LA64_ABI_1 +#define MAX_SIGNAL 128 +#else #define MAX_SIGNAL 64 +#endif typedef struct tlsdatasize_s { int tlssize; @@ -75,13 +88,12 @@ void add1libref_neededlib(needed_libs_t* needed, library_t* lib); typedef struct base_segment_s { uintptr_t base; uint64_t limit; - pthread_key_t key; uint8_t present; uint8_t is32bits; - uint8_t key_init; } base_segment_t; typedef struct box64context_s { + uint32_t tick; // for dynarec age path_collection_t box64_path; // PATH env. variable path_collection_t box64_ld_lib; // LD_LIBRARY_PATH env. variable @@ -90,16 +102,16 @@ typedef struct box64context_s { int x64trace; int trace_tid; - uint32_t sel_serial; // will be increment each time selectors changes - zydis_t *zydis; // dlopen the zydis dissasembler void* box64lib; // dlopen on box64 itself int argc; char** argv; + ptr_t argv32; int envc; char** envv; + ptr_t envv32; int orig_argc; char** orig_argv; @@ -108,6 +120,7 @@ typedef struct box64context_s { char* box64path; // path of current box64 executable char* box86path; // path of box86 executable (if present) char* bashpath; // path of x86_64 bash (defined with BOX64_BASH or by running bash directly) + char* pythonpath; // path of x86_64 python3 (defined with BOX64_PYTHON3) uint64_t stacksz; size_t stackalign; @@ -124,7 +137,7 @@ typedef struct box64context_s { uintptr_t ep; // entry point lib_t *maplib; // lib and symbols handling - lib_t *local_maplib; // libs and symbols openned has local (only collection of libs, no symbols) + lib_t *local_maplib; // libs and symbols opened has local (only collection of libs, no symbols) dic_t *versym; // dictionnary of versioned symbols kh_mapsymbols_t *globdata; // GLOBAL_DAT relocation for COPY mapping in main elf kh_mapsymbols_t *uniques; // symbols with STB_GNU_UNIQUE bindings @@ -139,6 +152,8 @@ typedef struct box64context_s { kh_symbolmap_t *almymap; // link to the mysymbolmap if libOpenAL kh_symbolmap_t *vkwrappers; // the map of wrapper for VulkanProcs (TODO: check SDL2) kh_symbolmap_t *vkmymap; // link to the mysymbolmap of libGL + kh_symbolmap_t *cudawrappers; // the map of wrapper for cuda + kh_symbolmap_t *mycuda; // link to the mysymbolmap of cuda vkprocaddess_t vkprocaddress; #ifndef DYNAREC @@ -162,7 +177,7 @@ typedef struct box64context_s { pthread_mutex_t mutex_bridge; #endif uintptr_t max_db_size; // the biggest (in x86_64 instructions bytes) built dynablock - rbtree* db_sizes; + rbtree_t* db_sizes; int trace_dynarec; pthread_mutex_t mutex_lock; // this is for the Test interpreter #if defined(__riscv) || defined(__loongarch64) @@ -174,7 +189,9 @@ typedef struct box64context_s { library_t *sdl1mixerlib; library_t *sdl2lib; library_t *sdl2mixerlib; + library_t *libx11; linkmap_t *linkmap; + linkmap32_t *linkmap32; void* sdl1allocrw; // SDL1 AllocRW/FreeRW function void* sdl1freerw; void* sdl2allocrw; // SDL2 AllocRW/FreeRW function @@ -185,10 +202,9 @@ typedef struct box64context_s { int deferredInitSz; int deferredInitCap; - pthread_key_t tlskey; // then tls key to have actual tlsdata void* tlsdata; // the initial global tlsdata int64_t tlssize; // wanted size of tlsdata - base_segment_t segtls[16]; + base_segment_t seggdt[16]; uintptr_t *auxval_start; @@ -196,6 +212,8 @@ typedef struct box64context_s { int clean_sz; int clean_cap; + void* video_mem; + zydis_dec_t *dec; // trace zydis_dec_t *dec32; // trace @@ -218,21 +236,25 @@ typedef struct box64context_s { int stack_clone_used; // rolling logs - char* *log_call; - char* *log_ret; + char* log_call; // is a large string composed of slices of 256 chars + char* log_ret; // is a large string composed of sloces of 128 chars int current_line; } box64context_t; #ifndef USE_CUSTOM_MUTEX -#define mutex_lock(A) pthread_mutex_lock(A) -#define mutex_trylock(A) pthread_mutex_trylock(A) -#define mutex_unlock(A) pthread_mutex_unlock(A) +#define mutex_lock(A) pthread_mutex_lock(A) +#define mutex_trylock(A) pthread_mutex_trylock(A) +#define mutex_unlock(A) pthread_mutex_unlock(A) #else -int GetTID(void); -#define mutex_lock(A) {uint32_t tid = (uint32_t)GetTID(); while(native_lock_storeifnull_d(A, tid)) sched_yield();} -#define mutex_trylock(A) native_lock_storeifnull_d(A, (uint32_t)GetTID()) -#define mutex_unlock(A) native_lock_storeifref_d(A, 0, (uint32_t)GetTID()) +#define mutex_lock(A) \ + do { \ + uint32_t tid = (uint32_t)GetTID(); \ + while (native_lock_storeifnull_d(A, tid)) \ + sched_yield(); \ + } while (0) +#define mutex_trylock(A) native_lock_storeifnull_d(A, (uint32_t)GetTID()) +#define mutex_unlock(A) native_lock_storeifref_d(A, 0, (uint32_t)GetTID()) #endif extern box64context_t *my_context; // global context @@ -243,7 +265,7 @@ void FreeBox64Context(box64context_t** context); // Cycle log handling void freeCycleLog(box64context_t* ctx); void initCycleLog(box64context_t* context); -void print_cycle_log(int loglevel); +void print_rolling_log(int loglevel); // return the index of the added header int AddElfHeader(box64context_t* ctx, elfheader_t* head); @@ -255,10 +277,9 @@ int AddTLSPartition(box64context_t* context, int tlssize); // defined in fact in threads.c void thread_set_emu(x64emu_t* emu); +void thread_forget_emu(); x64emu_t* thread_get_emu(void); -// unlock mutex that are locked by current thread (for signal handling). Return a mask of unlock mutex -int unlockMutex(void); // relock the muxtex that were unlocked void relockMutex(int locks); diff --git a/src/include/box64cpu.h b/src/include/box64cpu.h new file mode 100644 index 0000000..1154185 --- /dev/null +++ b/src/include/box64cpu.h @@ -0,0 +1,13 @@ +#ifndef __BOX64CPU_H_ +#define __BOX64CPU_H_ + +typedef struct x64emu_s x64emu_t; + +int Run(x64emu_t *emu, int step); +void EmuRun(x64emu_t* emu, int use_dynarec); +void EmuCall(x64emu_t* emu, uintptr_t addr); +void StopEmu(x64emu_t* emu, const char* reason, int is32bits); +void DynaRun(x64emu_t *emu); +void DynaCall(x64emu_t* emu, uintptr_t addr); + +#endif // __BOX64CPU_H_ diff --git a/src/include/box64cpu_util.h b/src/include/box64cpu_util.h new file mode 100644 index 0000000..9f774a1 --- /dev/null +++ b/src/include/box64cpu_util.h @@ -0,0 +1,111 @@ +#ifndef __BOX64CPU_UTIL_H_ +#define __BOX64CPU_UTIL_H_ + +#include +#include "emu/x64emu_private.h" +#include "box64context.h" +#include "regs.h" + +static inline uint8_t Peek(x64emu_t *emu, int offset) +{ + return *(uint8_t*)(R_RIP + offset); +} + +#ifdef TEST_INTERPRETER +#define Push16(E, V) do{E->regs[_SP].q[0] -=2; test->memsize = 2; *(uint16_t*)test->mem = (V); test->memaddr = E->regs[_SP].q[0];}while(0) +#define Push32(E, V) do{E->regs[_SP].q[0] -=4; test->memsize = 4; *(uint32_t*)test->mem = (V); test->memaddr = E->regs[_SP].q[0];}while(0) +#define Push64(E, V) do{E->regs[_SP].q[0] -=8; test->memsize = 8; *(uint64_t*)test->mem = (V); test->memaddr = E->regs[_SP].q[0];}while(0) +#else +static inline void Push16(x64emu_t *emu, uint16_t v) +{ + R_RSP -= 2; + *((uint16_t*)R_RSP) = v; +} + +static inline void Push_32(x64emu_t *emu, uint32_t v) +{ + R_ESP -= 4; + *((uint32_t*)(uintptr_t)R_ESP) = v; +} + +static inline void Push32(x64emu_t *emu, uint32_t v) +{ + R_RSP -= 4; + *((uint32_t*)R_RSP) = v; +} + +static inline void Push64(x64emu_t *emu, uint64_t v) +{ + R_RSP -= 8; + *((uint64_t*)R_RSP) = v; +} +#endif + +static inline uint16_t Pop16(x64emu_t *emu) +{ + uint16_t* st = (uint16_t*)R_RSP; + R_RSP += 2; + return *st; +} + +static inline uint32_t Pop_32(x64emu_t *emu) +{ + uint32_t* st = (uint32_t*)(uintptr_t)R_RSP; + R_ESP += 4; + return *st; +} + +static inline uint32_t Pop32(x64emu_t *emu) +{ + uint32_t* st = (uint32_t*)R_RSP; + R_RSP += 4; + return *st; +} + +static inline uint64_t Pop64(x64emu_t *emu) +{ + uint64_t* st = (uint64_t*)R_RSP; + R_RSP += 8; + return *st; +} + +static inline void PushExit(x64emu_t* emu) +{ + R_RSP -= 8; + *((uint64_t*)R_RSP) = my_context->exit_bridge; +} + +#ifdef BOX32 +static inline void PushExit_32(x64emu_t* emu) +{ + R_ESP -= 4; + *((ptr_t*)(uintptr_t)R_ESP) = my_context->exit_bridge; +} +#endif + +uint32_t GetEAX(x64emu_t *emu); +uint64_t GetRAX(x64emu_t *emu); +void SetEAX(x64emu_t *emu, uint32_t v); +void SetEBX(x64emu_t *emu, uint32_t v); +void SetECX(x64emu_t *emu, uint32_t v); +void SetEDX(x64emu_t *emu, uint32_t v); +void SetEDI(x64emu_t *emu, uint32_t v); +void SetESI(x64emu_t *emu, uint32_t v); +void SetEBP(x64emu_t *emu, uint32_t v); +void SetESP(x64emu_t *emu, uint32_t v); +void SetEIP(x64emu_t *emu, uint32_t v); +void SetRAX(x64emu_t *emu, uint64_t v); +void SetRBX(x64emu_t *emu, uint64_t v); +void SetRCX(x64emu_t *emu, uint64_t v); +void SetRDX(x64emu_t *emu, uint64_t v); +void SetRDI(x64emu_t *emu, uint64_t v); +void SetRSI(x64emu_t *emu, uint64_t v); +void SetRBP(x64emu_t *emu, uint64_t v); +void SetRSP(x64emu_t *emu, uint64_t v); +void SetRIP(x64emu_t *emu, uint64_t v); +void SetFS(x64emu_t *emu, uint16_t v); +uint16_t GetFS(x64emu_t *emu); +uint64_t GetRSP(x64emu_t *emu); +uint64_t GetRBP(x64emu_t *emu); + +#endif // __BOX64CPU_UTIL_H_ diff --git a/src/include/bridge.h b/src/include/bridge.h index a01a5b6..44ffbc1 100644 --- a/src/include/bridge.h +++ b/src/include/bridge.h @@ -12,20 +12,25 @@ void FreeBridge(bridge_t** bridge); uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name); uintptr_t CheckBridged(bridge_t* bridge, void* fnc); +uintptr_t CheckBridged2(bridge_t* bridge, void* fnc, void* fnc2); +uintptr_t AddBridge2(bridge_t* bridge, wrapper_t w, void* fnc, void* fnc2, int N, const char* name); uintptr_t AddCheckBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name); +uintptr_t AddCheckBridge2(bridge_t* bridge, wrapper_t w, void* fnc, void* fnc2, int N, const char* name); uintptr_t AddAutomaticBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name); +uintptr_t AddAutomaticBridgeAlt(bridge_t* bridge, wrapper_t w, void* fnc, void* alt, int N, const char* name); void* GetNativeFnc(uintptr_t fnc); void* GetNativeFncOrFnc(uintptr_t fnc); +void* GetNativeOrAlt(void* fnc, void* alt); uintptr_t AddVSyscall(bridge_t* bridge, int num); -int hasAlternate(void* addr); -void* getAlternate(void* addr); -void addAlternate(void* addr, void* alt); -void cleanAlternate(void); const char* getBridgeName(void* addr); +void* getBridgeFnc2(void* addr); void init_bridge_helper(void); void fini_bridge_helper(void); -#endif //__BRIDGE_H_ \ No newline at end of file +// Is what pointed at addr a native call? And if yes, to what function? +int isNativeCallInternal(uintptr_t addr, int is32bits, uintptr_t* calladdress, uint16_t* retn); + +#endif //__BRIDGE_H_ diff --git a/src/include/callback.h b/src/include/callback.h index 48d360c..502a9dc 100644 --- a/src/include/callback.h +++ b/src/include/callback.h @@ -7,6 +7,7 @@ typedef struct x64emu_s x64emu_t; uint64_t RunFunction(uintptr_t fnc, int nargs, ...); uint64_t RunFunctionFmt(uintptr_t fnc, const char* fmt, ...); +double RunFunctionFmtD(uintptr_t fnc, const char* fmt, ...); // save all modified register uint64_t RunSafeFunction(uintptr_t fnc, int nargs, ...); // use emu state to run function diff --git a/src/include/cleanup.h b/src/include/cleanup.h new file mode 100644 index 0000000..99c13b3 --- /dev/null +++ b/src/include/cleanup.h @@ -0,0 +1,13 @@ +#ifndef __CLEANUP_H_ +#define __CLEANUP_H_ + +#include "elfloader.h" + +typedef struct x64emu_s x64emu_t; + +void AddCleanup(x64emu_t *emu, void *p); +void AddCleanup1Arg(x64emu_t *emu, void *p, void* a, elfheader_t* h); +void CallCleanup(x64emu_t *emu, elfheader_t* h); +void CallAllCleanup(x64emu_t *emu); + +#endif // __CLEANUP_H_ \ No newline at end of file diff --git a/src/include/complext.h b/src/include/complext.h index 695bb87..27336ca 100644 --- a/src/include/complext.h +++ b/src/include/complext.h @@ -45,12 +45,18 @@ static inline void from_complex(x64emu_t* emu, complex_t v) { emu->xmm[0].d[0]=v.r; emu->xmm[1].d[0]=v.i; } +#ifdef ANDROID +static inline void from_complexl(x64emu_t* emu, complexl_t v) { + memcpy(&emu->xmm[0], &v, 16*2); // what if AVX is present? +} +#else static inline void from_complexl(x64emu_t* emu, complexl_t v) { fpu_do_push(emu); fpu_do_push(emu); ST0.d=FromLD(&v.r); ST(1).d=FromLD(&v.i); } +#endif static inline void from_complexk(x64emu_t* emu, complex_t v) { fpu_do_push(emu); fpu_do_push(emu); diff --git a/src/include/core.h b/src/include/core.h index c9fec47..c94eb57 100644 --- a/src/include/core.h +++ b/src/include/core.h @@ -10,4 +10,6 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf int emulate(x64emu_t* emu, elfheader_t* elf_header); +int unittest(int argc, const char** argv); + #endif // __CORE_H \ No newline at end of file diff --git a/src/include/custommem.h b/src/include/custommem.h index dda2105..ae4d66e 100644 --- a/src/include/custommem.h +++ b/src/include/custommem.h @@ -7,9 +7,16 @@ typedef struct box64context_s box64context_t; void* customMalloc(size_t size); +void* customMalloc32(size_t size); void* customCalloc(size_t n, size_t size); +void* customCalloc32(size_t n, size_t size); void* customRealloc(void* p, size_t size); +void* customRealloc32(void* p, size_t size); +void* customMemAligned(size_t align, size_t size); +void* customMemAligned32(size_t align, size_t size); void customFree(void* p); +void customFree32(void* p); +size_t customGetUsableSize(void* p); #define kcalloc customCalloc #define kmalloc customMalloc @@ -18,32 +25,47 @@ void customFree(void* p); #define ALIGN(p) (((p)+box64_pagesize-1)&~(box64_pagesize-1)) +#ifndef MAP_32BIT +#define MAP_32BIT 0x40 +#endif + #ifdef DYNAREC typedef struct dynablock_s dynablock_t; +typedef struct mmaplist_s mmaplist_t; +typedef struct DynaCacheBlock_s DynaCacheBlock_t; // custom protection flag to mark Page that are Write protected for Dynarec purpose -uintptr_t AllocDynarecMap(size_t size); +uintptr_t AllocDynarecMap(uintptr_t x64_addr, size_t size, int is_new); void FreeDynarecMap(uintptr_t addr); +mmaplist_t* NewMmaplist(); +void DelMmaplist(mmaplist_t* list); +int MmaplistHasNew(mmaplist_t* list, int clear); +int MmaplistNBlocks(mmaplist_t* list); +void MmaplistFillBlocks(mmaplist_t* list, DynaCacheBlock_t* blocks); +void MmaplistAddNBlocks(mmaplist_t* list, int nblocks); +int MmaplistAddBlock(mmaplist_t* list, int fd, off_t offset, void* orig, size_t size, intptr_t delta_map, uintptr_t mapping_start); void addDBFromAddressRange(uintptr_t addr, size_t size); -void cleanDBFromAddressRange(uintptr_t addr, size_t size, int destroy); // Will return 1 if at least 1 db in the address range -int isDBFromAddressRange(uintptr_t addr, size_t size); +int cleanDBFromAddressRange(uintptr_t addr, size_t size, int destroy); dynablock_t* getDB(uintptr_t idx); int getNeedTest(uintptr_t idx); int addJumpTableIfDefault64(void* addr, void* jmp); // return 1 if write was succesfull int setJumpTableIfRef64(void* addr, void* jmp, void* ref); // return 1 if write was succesfull void setJumpTableDefault64(void* addr); +int setJumpTableDefaultIfRef64(void* addr, void* jmp); void setJumpTableDefaultRef64(void* addr, void* jmp); int isJumpTableDefault64(void* addr); uintptr_t getJumpTable64(void); +uintptr_t getJumpTable48(void); uintptr_t getJumpTable32(void); uintptr_t getJumpTableAddress64(uintptr_t addr); uintptr_t getJumpAddress64(uintptr_t addr); #ifdef SAVE_MEM +#define JMPTABL_SHIFTMAX JMPTABL_SHIFT4 #define JMPTABL_SHIFT4 16 -#define JMPTABL_SHIFT3 14 +#define JMPTABL_SHIFT3 16 #define JMPTABL_SHIFT2 12 #define JMPTABL_SHIFT1 12 #define JMPTABL_SHIFT0 10 @@ -58,10 +80,11 @@ uintptr_t getJumpAddress64(uintptr_t addr); #define JMPTABLE_MASK1 ((1< +#include + +#include "os.h" +#include "hostext.h" +#include "sysinfo.h" typedef struct box64context_s box64context_t; -extern int box64_log; // log level -extern int box64_dump; // dump elf or not -extern int box64_dynarec_log; -extern int box64_dynarec; +extern box64env_t box64env; +extern box64env_t* cur_box64env; + extern uintptr_t box64_pagesize; -extern uintptr_t box64_load_addr; -extern int box64_dynarec_test; -extern int box64_maxcpu; -extern int box64_mmap32; -extern int box64_ignoreint3; extern int box64_rdtsc; -extern int box64_rdtsc_1ghz; extern uint8_t box64_rdtsc_shift; +extern int box64_is32bits; +extern int box64_isAddressSpace32; +extern int box64_nolibs; #ifdef DYNAREC -extern int box64_dynarec_dump; -extern int box64_dynarec_trace; -extern int box64_dynarec_forced; -extern uintptr_t box64_nodynarec_start, box64_nodynarec_end; -extern uintptr_t box64_dynarec_test_start, box64_dynarec_test_end; -extern int box64_dynarec_bigblock; -extern int box64_dynarec_forward; -extern int box64_dynarec_strongmem; -extern int box64_dynarec_fastnan; -extern int box64_dynarec_fastround; -extern int box64_dynarec_x87double; -extern int box64_dynarec_div0; -extern int box64_dynarec_safeflags; -extern int box64_dynarec_callret; -extern int box64_dynarec_bleeding_edge; -extern int box64_dynarec_tbb; -extern int box64_dynarec_wait; -extern int box64_dynarec_missing; -extern int box64_dynarec_aligned_atomics; -#ifdef ARM64 -extern int arm64_asimd; -extern int arm64_aes; -extern int arm64_pmull; -extern int arm64_crc32; -extern int arm64_atomics; -extern int arm64_sha1; -extern int arm64_sha2; -extern int arm64_uscat; -extern int arm64_flagm; -extern int arm64_flagm2; -extern int arm64_frintts; -extern int arm64_rndr; -#elif defined(RV64) -extern int rv64_zba; -extern int rv64_zbb; -extern int rv64_zbc; -extern int rv64_zbs; -extern int rv64_vector; -extern int rv64_xtheadba; -extern int rv64_xtheadbb; -extern int rv64_xtheadbs; -extern int rv64_xtheadcondmov; -extern int rv64_xtheadmemidx; -extern int rv64_xtheadmempair; -extern int rv64_xtheadfmemidx; -extern int rv64_xtheadmac; -extern int rv64_xtheadfmv; -#elif defined(LA64) -extern int la64_lbt; -extern int la64_lam_bh; -extern int la64_lamcas; -extern int la64_scq; +extern cpu_ext_t cpuext; #endif -#endif -extern int box64_libcef; -extern int box64_jvm; -extern int box64_unityplayer; -extern int box64_sdl2_jguid; -extern int dlsym_error; // log dlsym error -extern int cycle_log; // if using rolling logs #ifdef HAVE_TRACE -extern int trace_xmm; // include XMM reg in trace? -extern int trace_emm; // include EMM reg in trace? -extern int trace_regsdiff; // colorize standard registers on changes extern uintptr_t trace_start, trace_end; extern char* trace_func; -extern char* trace_init; -extern char* box64_trace; -extern uint64_t start_cnt; #endif -extern int box64_nosandbox; -extern int box64_inprocessgpu; -extern int box64_cefdisablegpu; -extern int box64_cefdisablegpucompositor; -extern int box64_maxcpu_immutable; -extern int box64_malloc_hack; -extern int box64_dummy_crashhandler; -extern int box64_sse_flushto0; -extern int box64_x87_no80bits; -extern int box64_sync_rounding; -extern int box64_sse42; -extern int box64_avx; -extern int box64_avx2; -extern int allow_missing_libs; extern int box64_mapclean; -extern int box64_prefer_wrapped; -extern int box64_prefer_emulated; extern int box64_steam; +extern int box64_steamcmd; extern int box64_wine; extern int box64_musl; -extern int box64_nopulse; // disabling the use of wrapped pulseaudio -extern int box64_nogtk; // disabling the use of wrapped gtk -extern int box64_novulkan; // disabling the use of wrapped vulkan -extern int box64_showsegv; // show sigv, even if a signal handler is present -extern int box64_showbt; // show a backtrace if a signal is caught extern int box64_isglibc234; // is the program linked with glibc 2.34+ -extern int box64_futex_waitv; -extern int box64_x11threads; -extern int box64_x11glx; -extern char* box64_libGL; +extern int box64_unittest_mode; extern uintptr_t fmod_smc_start, fmod_smc_end; // to handle libfmod (from Unreal) SMC (self modifying code) -extern uint32_t default_gs; -extern int jit_gdb; // launch gdb when a segfault is trapped +extern uint32_t default_gs, default_fs; extern int box64_tcmalloc_minimal; // when using tcmalloc_minimal +extern sysinfo_t box64_sysinfo; #define LOG_NONE 0 #define LOG_INFO 1 #define LOG_DEBUG 2 #define LOG_NEVER 3 #define LOG_VERBOSE 3 -void printf_ftrace(const char* fmt, ...); -#define printf_log(L, ...) do {if((L)<=box64_log) {printf_ftrace(__VA_ARGS__);}} while(0) +#define printf_log_prefix(prefix, L, ...) \ + do { \ + if ((L) <= BOX64ENV(log)) { PrintfFtrace(prefix + (prefix && (L) == LOG_NONE), __VA_ARGS__); } \ + } while (0) + +#define printf_log(L, ...) printf_log_prefix(1, L, __VA_ARGS__) + +#define printf_dump_prefix(prefix, L, ...) \ + do { \ + if (BOX64ENV(dump) || ((L) <= BOX64ENV(log))) { PrintfFtrace(prefix, __VA_ARGS__); } \ + } while (0) + +#define printf_dump(L, ...) printf_dump_prefix(1, L, __VA_ARGS__) + +#define printf_dlsym_prefix(prefix, L, ...) \ + do { \ + if (BOX64ENV(dlsym_error) || BOX64ENV(dump) || ((L) <= BOX64ENV(log))) { PrintfFtrace(prefix, __VA_ARGS__); } \ + } while (0) + +#define printf_dlsym_dump(L, ...) printf_dlsym_dump_prefix(1, L, __VA_ARGS__) -#define printf_dump(L, ...) do {if(box64_dump || ((L)<=box64_log)) {printf_ftrace(__VA_ARGS__);}} while(0) +#define printf_dlsym_dump_prefix(prefix, L, ...) \ + do { \ + if (BOX64ENV(dlsym_error) || ((L) <= BOX64ENV(log))) { PrintfFtrace(prefix, __VA_ARGS__); } \ + } while (0) -#define printf_dlsym(L, ...) do {if(dlsym_error || ((L)<=box64_log)) {printf_ftrace(__VA_ARGS__);}} while(0) +#define printf_dlsym(L, ...) printf_dlsym_prefix(1, L, __VA_ARGS__) + +#define dynarec_log_prefix(prefix, L, ...) \ + do { \ + if ((L) <= BOX64ENV(dynarec_log)) { PrintfFtrace(prefix, __VA_ARGS__); } \ + } while (0) + +#define dynarec_log(L, ...) dynarec_log_prefix(1, L, __VA_ARGS__) -#define dynarec_log(L, ...) do {if((L)<=box64_dynarec_log) {printf_ftrace(__VA_ARGS__);}} while(0) #define EXPORT __attribute__((visibility("default"))) #ifdef BUILD_DYNAMIC @@ -144,6 +85,7 @@ void printf_ftrace(const char* fmt, ...); #define EXPORTDYN #endif +#ifndef _WIN32 // TODO: better wow64 support? #ifndef STATICBUILD void init_malloc_hook(void); #endif @@ -156,7 +98,7 @@ void init_malloc_hook(void); #define box_strdup strdup #define box_realpath realpath #else -extern size_t(*box_malloc_usable_size)(void*); +extern size_t (*box_malloc_usable_size)(void*); extern void* __libc_malloc(size_t); extern void* __libc_realloc(void*, size_t); extern void* __libc_calloc(size_t, size_t); @@ -170,5 +112,38 @@ extern void* __libc_memalign(size_t, size_t); extern char* box_strdup(const char* s); extern char* box_realpath(const char* path, char* ret); #endif +#else +#define box_malloc WinMalloc +#define box_realloc WinRealloc +#define box_calloc WinCalloc +#define box_free WinFree +#endif + +//use actual_XXXX for internal memory that should be in 32bits space when box32 is active +//use box_XXX for internal memory that doesn't need anything special +#ifdef BOX32 +int isCustomAddr(void* p); +void* box32_calloc(size_t n, size_t s); +void* box32_malloc(size_t s); +void* box32_realloc(void* p, size_t s); +void box32_free(void* p); +void* box32_memalign(size_t align, size_t s); +size_t box32_malloc_usable_size(void* p); +char* box32_strdup(const char* s); + +#define actual_calloc(A, B) (box64_is32bits?box32_calloc(A, B):box_calloc(A, B)) +#define actual_malloc(A) (box64_is32bits?box32_malloc(A):box_malloc(A)) +#define actual_realloc(A, B) (box64_is32bits?box32_realloc(A, B):box_realloc(A, B)) +#define actual_free(A) (box64_is32bits?box32_free(A):box_free(A)) +#define actual_memalign(A, B) (box64_is32bits?box32_memalign(A, B):box_memalign(A, B)) +#define actual_malloc_usable_size(A) (box64_is32bits?box32_malloc_usable_size(A):box_malloc_usable_size(A)) +#else +#define actual_calloc(A, B) box_calloc(A, B) +#define actual_malloc(A) box_malloc(A) +#define actual_realloc(A, B) box_realloc(A, B) +#define actual_free(A) box_free(A) +#define actual_memalign(A, B) box_memalign(A, B) +#define actual_malloc_usable_size(A) box_malloc_usable_size(A) +#endif #endif //__DEBUG_H_ diff --git a/src/include/dynablock.h b/src/include/dynablock.h index 757ca4a..44ce6a1 100644 --- a/src/include/dynablock.h +++ b/src/include/dynablock.h @@ -5,7 +5,7 @@ typedef struct x64emu_s x64emu_t; typedef struct dynablock_s dynablock_t; uint32_t X31_hash_code(void* addr, int len); -void FreeDynablock(dynablock_t* db, int need_lock); +void FreeDynablock(dynablock_t* db, int need_lock, int need_remove); void MarkDynablock(dynablock_t* db); void MarkRangeDynablock(dynablock_t* db, uintptr_t addr, uintptr_t size); int FreeRangeDynablock(dynablock_t* db, uintptr_t addr, uintptr_t size); @@ -20,5 +20,13 @@ dynablock_t* DBAlternateBlock(x64emu_t* emu, uintptr_t addr, uintptr_t filladdr, // for use in signal handler void cancelFillBlock(void); +void dynablock_leave_runtime(dynablock_t* db); + +// clear instruction cache on a range +void ClearCache(void* start, size_t len); + +uintptr_t getX64Address(dynablock_t* db, uintptr_t native_addr); +int getX64AddressInst(dynablock_t* db, uintptr_t x64pc); +uintptr_t getX64InstAddress(dynablock_t* db, int inst); #endif //__DYNABLOCK_H_ \ No newline at end of file diff --git a/src/include/dynarec.h b/src/include/dynarec.h deleted file mode 100644 index bf72349..0000000 --- a/src/include/dynarec.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __DYNAREC_H_ -#define __DYNAREC_H_ - -typedef struct x64emu_s x64emu_t; - -void DynaCall(x64emu_t* emu, uintptr_t addr); // try to use DynaRec... Fallback to EmuCall if no dynarec available - -void x64test_init(); -void x64test_step(x64emu_t* ref, uintptr_t ip); -void x64test_check(x64emu_t* ref, uintptr_t ip); - -#endif // __DYNAREC_H_ \ No newline at end of file diff --git a/src/include/dynarec_native.h b/src/include/dynarec_native.h index dd5218f..f3f2bd7 100644 --- a/src/include/dynarec_native.h +++ b/src/include/dynarec_native.h @@ -5,25 +5,11 @@ typedef struct dynablock_s dynablock_t; typedef struct x64emu_s x64emu_t; typedef struct instsize_s instsize_t; - -//#define USE_CUSTOM_MEM -#ifdef USE_CUSTOM_MEM -#define dynaMalloc customMalloc -#define dynaCalloc customCalloc -#define dynaRealloc customRealloc -#define dynaFree customFree -#else -#define dynaMalloc box_malloc -#define dynaCalloc box_calloc -#define dynaRealloc box_realloc -#define dynaFree box_free -#endif - #define MAX_INSTS 32760 void addInst(instsize_t* insts, size_t* size, int x64_size, int native_size); void CancelBlock64(int need_lock); -void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bits); +dynablock_t* FillBlock64(uintptr_t addr, int alternate, int is32bits, int inst_max, int is_new); -#endif //__DYNAREC_ARM_H_ \ No newline at end of file +#endif //__DYNAREC_ARM_H_ diff --git a/src/include/elfhacks.h b/src/include/elfhacks.h new file mode 100644 index 0000000..57d1e5a --- /dev/null +++ b/src/include/elfhacks.h @@ -0,0 +1,199 @@ +/** + * \file src/elfhacks.h + * \brief elfhacks application interface + * \author Pyry Haulos + * \date 2007-2008 + */ + +/* elfhacks.h -- Various ELF run-time hacks + version 0.4.1, March 9th, 2008 + + Copyright (C) 2007-2008 Pyry Haulos + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Pyry Haulos +*/ +#pragma once +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +//#define __PUBLIC __attribute__ ((visibility ("default"))) +#define __PUBLIC + +#if UINTPTR_MAX == 0xffffffffffffffff +# define __elf64 +#else +# define __elf32 +#endif + +#ifdef __elf64 +# define ELFW_R_SYM ELF64_R_SYM +# define ElfW_Sword Elf64_Sxword +#else +# ifdef __elf32 +# define ELFW_R_SYM ELF32_R_SYM +# define ElfW_Sword Elf32_Sword +# else +# error neither __elf32 nor __elf64 is defined +# endif +#endif + +/** + * \defgroup elfhacks elfhacks + * Elfhacks is a collection of functions that aim for retvieving + * or modifying progam's dynamic linking information at run-time. + * \{ + */ + +/** + * \brief elfhacks program object + */ +typedef struct { + /** file name */ + const char *name; + /** base address in memory */ + ElfW(Addr) addr; + /** program headers */ + const ElfW(Phdr) *phdr; + /** number of program headers */ + ElfW(Half) phnum; + /** .dynamic */ + ElfW(Dyn) *dynamic; + /** .symtab */ + ElfW(Sym) *symtab; + /** .strtab */ + const char *strtab; + /** symbol hash table (DT_HASH) */ + ElfW(Word) *hash; + /** symbol hash table (DT_GNU_HASH) */ + Elf32_Word *gnu_hash; +} eh_obj_t; + +/** + * \brief elfhacks symbol + */ +typedef struct { + /** symbol name */ + const char *name; + /** corresponding ElfW(Sym) */ + ElfW(Sym) *sym; + /** elfhacks object this symbol is associated to */ + eh_obj_t *obj; +} eh_sym_t; + +/** + * \brief elfhacks relocation + */ +typedef struct { + /** symbol this relocation is associated to */ + eh_sym_t *sym; + /** corresponding ElfW(Rel) (NULL if this is Rela) */ + ElfW(Rel) *rel; + /** corresponding ElfW(Rela) (NULL if this is Rel) */ + ElfW(Rela) *rela; + /** elfhacks program object */ + eh_obj_t *obj; +} eh_rel_t; + +/** + * \brief Iterate objects callback + */ +typedef int (*eh_iterate_obj_callback_func)(eh_obj_t *obj, void *arg); +/** + * \brief Iterate symbols callback + */ +typedef int (*eh_iterate_sym_callback_func)(eh_sym_t *sym, void *arg); +/** + * \brief Iterate relocations callback + */ +typedef int (*eh_iterate_rel_callback_func)(eh_rel_t *rel, void *arg); + +/** + * \brief Initializes eh_obj_t for given soname + * + * Matching is done using fnmatch() so wildcards and other standard + * filename metacharacters and expressions work. + * + * If soname is NULL, this function returns the main program object. + * \param obj elfhacks object + * \param soname object's soname (see /proc/pid/maps) or NULL for main + * \return 0 on success otherwise a positive error code +*/ +__PUBLIC int eh_find_obj(eh_obj_t *obj, const char *soname); + +/** + * \brief Walk through list of objects + * \param callback callback function + * \param arg argument passed to callback function + * \return 0 on success otherwise an error code + */ +__PUBLIC int eh_iterate_obj(eh_iterate_obj_callback_func callback, void *arg); + +/** + * \brief Finds symbol in object's .dynsym and retrvieves its value. + * \param obj elfhacks program object + * \param name symbol to find + * \param to returned value + * \return 0 on success otherwise a positive error code +*/ +__PUBLIC int eh_find_sym(eh_obj_t *obj, const char *name, void **to); + +/** + * \brief Walk through list of symbols in object + * \param obj elfhacks program object + * \param callback callback function + * \param arg argument passed to callback function + * \return 0 on success otherwise an error code + */ +__PUBLIC int eh_iterate_sym(eh_obj_t *obj, eh_iterate_sym_callback_func callback, void *arg); + +/** + * \brief Iterates through object's .rel.plt and .rela.plt and sets every + * occurrence of some symbol to the specified value. + * \param obj elfhacks program object + * \param sym symbol to replace + * \param val new value + * \return 0 on success otherwise a positive error code +*/ +__PUBLIC int eh_set_rel(eh_obj_t *obj, const char *sym, void *val); + +/** + * \brief Walk through object's .rel.plt and .rela.plt + * \param obj elfhacks program object + * \param callback callback function + * \param arg argument passed to callback function + */ +__PUBLIC int eh_iterate_rel(eh_obj_t *obj, eh_iterate_rel_callback_func callback, void *arg); + +/** + * \brief Destroy eh_obj_t object. + * \param obj elfhacks program object + * \return 0 on success otherwise a positive error code +*/ +__PUBLIC int eh_destroy_obj(eh_obj_t *obj); + +/** \} */ + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/src/include/elfload_dump.h b/src/include/elfload_dump.h index ad2ecd7..848a281 100644 --- a/src/include/elfload_dump.h +++ b/src/include/elfload_dump.h @@ -3,23 +3,31 @@ typedef struct elfheader_s elfheader_t; -const char* DumpSection(Elf64_Shdr *s, char* SST); -const char* DumpDynamic(Elf64_Dyn *s); -const char* DumpPHEntry(Elf64_Phdr *e); -const char* DumpSym(elfheader_t *h, Elf64_Sym* sym, int version); -const char* DumpRelType(int t); -const char* SymName(elfheader_t *h, Elf64_Sym* sym); -const char* IdxSymName(elfheader_t *h, int sym); -void DumpMainHeader(Elf64_Ehdr *header, elfheader_t *h); -void DumpSymTab(elfheader_t *h); -void DumpDynamicSections(elfheader_t *h); +const char* SymName32(elfheader_t *h, Elf32_Sym* sym); +const char* SymName64(elfheader_t *h, Elf64_Sym* sym); +const char* DumpRelType32(int t); +const char* DumpRelType64(int t); +void DumpMainHeader32(Elf32_Ehdr *header, elfheader_t *h); +void DumpMainHeader64(Elf64_Ehdr *header, elfheader_t *h); +void DumpSymTab32(elfheader_t *h); +void DumpSymTab64(elfheader_t *h); +void DumpDynamicSections32(elfheader_t *h); +void DumpDynamicSections64(elfheader_t *h); void DumpDynamicNeeded(elfheader_t *h); void DumpDynamicRPath(elfheader_t *h); -void DumpDynSym(elfheader_t *h); -void DumpRelTable(elfheader_t *h, int cnt, Elf64_Rel *rel, const char* name); -void DumpRelATable(elfheader_t *h, int cnt, Elf64_Rela *rela, const char* name); -void DumpRelRTable(elfheader_t *h, int cnt, Elf64_Relr *relr, const char *name); +void DumpDynSym32(elfheader_t *h); +void DumpDynSym64(elfheader_t *h); +void DumpRelTable32(elfheader_t *h, int cnt, Elf32_Rel *rel, const char* name); +void DumpRelTable64(elfheader_t *h, int cnt, Elf64_Rel *rel, const char* name); +void DumpRelATable32(elfheader_t *h, int cnt, Elf32_Rela *rela, const char* name); +void DumpRelATable64(elfheader_t *h, int cnt, Elf64_Rela *rela, const char* name); +void DumpRelRTable32(elfheader_t *h, int cnt, Elf32_Relr *relr, const char *name); +void DumpRelRTable64(elfheader_t *h, int cnt, Elf64_Relr *relr, const char *name); void DumpBinary(char* p, int sz); +#ifndef SHT_CHECKSUM +#define SHT_CHECKSUM 0x6ffffff8 +#endif + #endif //ELFLOADER_DUMP_H \ No newline at end of file diff --git a/src/include/elfloader.h b/src/include/elfloader.h index 770709c..d5071d5 100644 --- a/src/include/elfloader.h +++ b/src/include/elfloader.h @@ -45,17 +45,18 @@ int CalcLoadAddr(elfheader_t* head); int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin); void FreeElfMemory(elfheader_t* head); int isElfHasNeededVer(elfheader_t* head, const char* libname, elfheader_t* verneeded); -void GrabX64CopyMainElfReloc(elfheader_t* head); int RelocateElf(lib_t *maplib, lib_t* local_maplib, int bindnow, int deepbind, elfheader_t* head); int RelocateElfPlt(lib_t *maplib, lib_t* local_maplib, int bindnow, int deepbind, elfheader_t* head); void CalcStack(elfheader_t* h, uint64_t* stacksz, size_t* stackalign); uintptr_t GetEntryPoint(lib_t* maplib, elfheader_t* h); uintptr_t GetLastByte(elfheader_t* h); void AddSymbols(lib_t *maplib, elfheader_t* h); +int NeededLibs(elfheader_t* h); int LoadNeededLibs(elfheader_t* h, lib_t *maplib, int local, int bindnow, int deepbind, box64context_t *box64, x64emu_t* emu); +needed_libs_t* GetELfNeededLibs(elfheader_t* h); uintptr_t GetElfInit(elfheader_t* h); uintptr_t GetElfFini(elfheader_t* h); -void RefreshElfTLS(elfheader_t* h); +void RefreshElfTLS(elfheader_t* h, x64emu_t* emu); void RunElfInit(elfheader_t* h, x64emu_t *emu); void RunElfFini(elfheader_t* h, x64emu_t *emu); void RunDeferredElfInit(x64emu_t *emu); @@ -68,14 +69,13 @@ elfheader_t* FindElfAddress(box64context_t *context, uintptr_t addr); const char* FindNearestSymbolName(elfheader_t* h, void* p, uintptr_t* start, uint64_t* sz); int32_t GetTLSBase(elfheader_t* h); uint32_t GetTLSSize(elfheader_t* h); -void* GetTLSPointer(box64context_t* context, elfheader_t* h); -void* GetDTatOffset(box64context_t* context, unsigned long int index, unsigned long int offset); -#ifdef DYNAREC -dynablock_t* GetDynablocksFromAddress(box64context_t *context, uintptr_t addr); -#endif +void* GetTLSPointer(x64emu_t* emu, elfheader_t* h); +void* GetDTatOffset(x64emu_t* emu, unsigned long int index, unsigned long int offset); void ResetSpecialCaseMainElf(elfheader_t* h); void CreateMemorymapFile(box64context_t* context, int fd); void* GetDynamicSection(elfheader_t* h); +void* GetLoadedDynamicSection(elfheader_t* h); +void PatchLoadedDynamicSection(elfheader_t* h); int ElfCheckIfUseTCMallocMinimal(elfheader_t* h); // return 1 if tcmalloc is used @@ -91,10 +91,18 @@ int GetNeededVersionForLib(elfheader_t* h, const char* libname, const char* ver) void* ElfGetLocalSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *sz, const char* symname, int* ver, const char** vername, int local, int* veropt); void* ElfGetGlobalSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *sz, const char* symname, int* ver, const char** vername, int local, int* veropt); void* ElfGetWeakSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *sz, const char* symname, int* ver, const char** vername, int local, int* veropt); +void* ElfGetSymbolStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname, int* ver, const char** vername, int local, int* veropt); int ElfGetSymTabStartEnd(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname); +int ElfGetSymTabStartEnd32(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname); +int ElfGetSymTabStartEnd64(elfheader_t* head, uintptr_t *offs, uintptr_t *end, const char* symname); void* GetNativeSymbolUnversioned(void* lib, const char* name); void AddMainElfToLinkmap(elfheader_t* lib); +void PltResolver32(x64emu_t* emu); +void PltResolver64(x64emu_t* emu); + +const char* getAddrFunctionName(uintptr_t addr); + #endif //__ELF_LOADER_H_ diff --git a/src/include/emit_signals.h b/src/include/emit_signals.h new file mode 100644 index 0000000..ed211fd --- /dev/null +++ b/src/include/emit_signals.h @@ -0,0 +1,14 @@ +#ifndef __EMIT_SIGNALS_H_ +#define __EMIT_SIGNALS_H_ + +#include + +typedef struct x64emu_s x64emu_t; + +void EmitSignal(x64emu_t* emu, int sig, void* addr, int code); +void EmitInterruption(x64emu_t* emu, int num, void* addr); +void EmitWineInt(x64emu_t* emu, int num, void* addr); +void EmitDiv0(x64emu_t* emu, void* addr, int code); +void CheckExec(x64emu_t* emu, uintptr_t addr); + +#endif // __EMIT_SIGNALS_H_ \ No newline at end of file diff --git a/src/include/env.h b/src/include/env.h new file mode 100644 index 0000000..3e61e22 --- /dev/null +++ b/src/include/env.h @@ -0,0 +1,252 @@ +#ifndef __ENV_H +#define __ENV_H + +#include +#include + +#define BOX64ENV(name) (box64env.name) +#define BOX64DRENV(name) ((dyn->env && dyn->env->is_##name##_overridden)?dyn->env->name:box64env.name) +#define SET_BOX64ENV(name, value) \ + do { \ + box64env.name = (value); \ + box64env.is_any_overridden = 1; \ + box64env.is_##name##_overridden = 1; \ + } while (0) +#define SET_BOX64ENV_IF_EMPTY(name, value) \ + do { \ + if (!box64env.is_##name##_overridden) { \ + SET_BOX64ENV(name, value); \ + } \ + } while (0) + +/* + INTEGER(NAME, name, default, min, max, wine) + INTEGER64(NAME, name, default, wine) + BOOLEAN(NAME, name, default, wine) + ADDRESS(NAME, name, wine) + STRING(NAME, name, wine) +*/ + +#ifdef _WIN32 +#define DEFAULT_LOG_LEVEL (LOG_INFO) +#define BOX64_NOBANNER_DEFAULT (0) +#else +extern char* ftrace_name; +#define DEFAULT_LOG_LEVEL (ftrace_name ? LOG_INFO : (isatty(fileno(stdout)) ? LOG_INFO : LOG_NONE)) +#define BOX64_NOBANNER_DEFAULT (isatty(fileno(stdout)) ? 0 : 1) +#endif + +#define ENVSUPER1() \ + STRING(BOX64_ADDLIBS, addlibs, 0) \ + BOOLEAN(BOX64_AES, aes, 1, 1) \ + BOOLEAN(BOX64_ALLOWMISSINGLIBS, allow_missing_libs, 0, 0) \ + STRING(BOX64_ARCH, arch, 0) \ + STRING(BOX64_ARGS, args, 0) \ + STRING(BOX64_BASH, bash, 0) \ + STRING(BOX64_PYTHON3, python3, 0) \ + INTEGER(BOX64_CPUTYPE, cputype, 0, 0, 1, 1) \ + BOOLEAN(BOX64_CRASHHANDLER, dummy_crashhandler, 1, 0) \ + BOOLEAN(BOX64_DLSYM_ERROR, dlsym_error, 0, 0) \ + BOOLEAN(BOX64_DUMP, dump, 0, 1) \ + BOOLEAN(BOX64_DYNAREC_ALIGNED_ATOMICS, dynarec_aligned_atomics, 0, 1) \ + INTEGER(BOX64_DYNAREC_BIGBLOCK, dynarec_bigblock, 2, 0, 3, 1) \ + BOOLEAN(BOX64_DYNAREC_BLEEDING_EDGE, dynarec_bleeding_edge, 1, 0) \ + INTEGER(BOX64_DYNAREC_CALLRET, dynarec_callret, 0, 0, 2, 1) \ + BOOLEAN(BOX64_DYNAREC_DF, dynarec_df, 1, 1) \ + INTEGER(BOX64_DYNAREC_DIRTY, dynarec_dirty, 0, 0, 2, 0) \ + BOOLEAN(BOX64_DYNAREC_HOTPAGE_ALT, dynarec_hotpage_alt, 1, 0) \ + BOOLEAN(BOX64_DYNAREC_NOHOTPAGE, dynarec_nohotpage, 0, 0) \ + BOOLEAN(BOX64_DYNAREC_DIV0, dynarec_div0, 0, 1) \ + INTEGER(BOX64_DYNAREC_DUMP, dynarec_dump, 0, 0, 2, 1) \ + STRING(BOX64_DYNAREC_DUMP_RANGE, dynarec_dump_range, 1) \ + BOOLEAN(BOX64_DYNAREC_FASTNAN, dynarec_fastnan, 1, 1) \ + INTEGER(BOX64_DYNAREC_FASTROUND, dynarec_fastround, 1, 0, 2, 1) \ + INTEGER(BOX64_DYNAREC_FORWARD, dynarec_forward, 128, 0, 1024, 1) \ + STRING(BOX64_DYNAREC_GDBJIT, dynarec_gdbjit_str, 0) \ + INTEGER(BOX64_DYNAREC_LOG, dynarec_log, 0, 0, 3, 1) \ + INTEGER(BOX64_DYNAREC_MISSING, dynarec_missing, 0, 0, 2, 1) \ + BOOLEAN(BOX64_DYNAREC_NATIVEFLAGS, dynarec_nativeflags, 1, 1) \ + STRING(BOX64_DYNAREC_NOHOSTEXT, dynarec_nohostext, 0) \ + INTEGER(BOX64_DYNAREC_PAUSE, dynarec_pause, 0, 0, 3, 1) \ + BOOLEAN(BOX64_DYNAREC_PERFMAP, dynarec_perf_map, 0, 0) \ + INTEGER(BOX64_DYNAREC_SAFEFLAGS, dynarec_safeflags, 1, 0, 2, 1) \ + INTEGER(BOX64_DYNAREC_STRONGMEM, dynarec_strongmem, 0, 0, 3, 1) \ + BOOLEAN(BOX64_DYNAREC_TBB, dynarec_tbb, 1, 0) \ + STRING(BOX64_DYNAREC_TEST, dynarec_test_str, 1) \ + BOOLEAN(BOX64_DYNAREC_TEST_NODUP, dynarec_test_nodup, 0, 1) \ + BOOLEAN(BOX64_DYNAREC_TEST_NODUMP, dynarec_test_nodump, 1, 1) \ + BOOLEAN(BOX64_DYNAREC_TRACE, dynarec_trace, 0, 0) \ + BOOLEAN(BOX64_DYNAREC_VOLATILE_METADATA, dynarec_volatile_metadata, 1, 0) \ + BOOLEAN(BOX64_DYNAREC_WAIT, dynarec_wait, 1, 1) \ + INTEGER(BOX64_DYNAREC_WEAKBARRIER, dynarec_weakbarrier, 1, 0, 2, 1) \ + INTEGER(BOX64_DYNAREC_X87DOUBLE, dynarec_x87double, 0, 0, 2, 1) \ + BOOLEAN(BOX64_DYNAREC_INTERP_SIGNAL, dynarec_interp_signal, 0, 0) \ + BOOLEAN(BOX64_DYNAREC_PURGE, dynarec_purge, 0, 0) \ + INTEGER(BOX64_DYNAREC_PURGE_AGE, dynarec_purge_age, 4096, 10, 65536, 0) \ + BOOLEAN(BOX64_NODYNAREC_DELAY, nodynarec_delay, 0, 1) \ + STRING(BOX64_EMULATED_LIBS, emulated_libs, 0) \ + INTEGER(BOX64_DYNAREC_NOARCH, dynarec_noarch, 0, 0, 2, 1) \ + STRING(BOX64_ENV, env, 0) \ + STRING(BOX64_ENV1, env1, 0) \ + STRING(BOX64_ENV2, env2, 0) \ + STRING(BOX64_ENV3, env3, 0) \ + STRING(BOX64_ENV4, env4, 0) \ + STRING(BOX64_ENV5, env5, 0) \ + BOOLEAN(BOX64_EXIT, exit, 0, 0) \ + BOOLEAN(BOX64_FIX_64BIT_INODES, fix_64bit_inodes, 0, 0) \ + BOOLEAN(BOX64_IGNOREINT3, ignoreint3, 0, 0) \ + STRING(BOX64_INSERT_ARGS, insert_args, 0) \ + BOOLEAN(BOX64_INPROCESSGPU, inprocessgpu, 0, 0) \ + INTEGER(BOX64_JITGDB, jitgdb, 0, 0, 3, 0) \ + BOOLEAN(BOX64_JVM, jvm, 1, 0) \ + STRING(BOX64_LD_LIBRARY_PATH, ld_library_path, 0) \ + BOOLEAN(BOX64_LIBCEF, libcef, 0, 0) \ + STRING(BOX64_LIBGL, libgl, 0) \ + ADDRESS(BOX64_LOAD_ADDR, load_addr, 0) \ + INTEGER(BOX64_LOG, log, DEFAULT_LOG_LEVEL, 0, 3, 1) \ + INTEGER(BOX64_MALLOC_HACK, malloc_hack, 0, 0, 2, 0) \ + INTEGER(BOX64_MAXCPU, new_maxcpu, 0, 0, 100, 1) \ + BOOLEAN(BOX64_MMAP32, mmap32, 1, 0) \ + BOOLEAN(BOX64_NOBANNER, nobanner, BOX64_NOBANNER_DEFAULT, 1) \ + STRING(BOX64_NODYNAREC, nodynarec, 1) \ + BOOLEAN(BOX64_NOGTK, nogtk, 0, 0) \ + BOOLEAN(BOX64_NOPULSE, nopulse, 0, 0) \ + BOOLEAN(BOX64_NORCFILES, noenvfiles, 0, 0) \ + BOOLEAN(BOX64_NOSANDBOX, nosandbox, 0, 0) \ + BOOLEAN(BOX64_NOSIGSEGV, nosigsegv, 0, 0) \ + BOOLEAN(BOX64_NOSIGILL, nosigill, 0, 0) \ + BOOLEAN(BOX64_NOVULKAN, novulkan, 0, 0) \ + STRING(BOX64_PATH, path, 0) \ + BOOLEAN(BOX64_PCLMULQDQ, pclmulqdq, 1, 1) \ + BOOLEAN(BOX64_PREFER_EMULATED, prefer_emulated, 0, 0) \ + BOOLEAN(BOX64_PREFER_WRAPPED, prefer_wrapped, 0, 0) \ + STRING(BOX64_PROFILE, profile, 1) \ + STRING(BOX64_RCFILE, envfile, 0) \ + BOOLEAN(BOX64_RDTSC_1GHZ, rdtsc_1ghz, 0, 0) \ + BOOLEAN(BOX64_RESERVE_HIGH, reserve_high, 0, 0) \ + INTEGER(BOX64_ROLLING_LOG, cycle_log, 0, 0, 2048, 0) \ + BOOLEAN(BOX64_SDL2_JGUID, sdl2_jguid, 0, 0) \ + BOOLEAN(BOX64_SHAEXT, shaext, 1, 1) \ + BOOLEAN(BOX64_SHOWBT, showbt, 0, 0) \ + BOOLEAN(BOX64_SHOWSEGV, showsegv, 0, 0) \ + BOOLEAN(BOX64_SSE_FLUSHTO0, sse_flushto0, 0, 1) \ + BOOLEAN(BOX64_SSE42, sse42, 1, 1) \ + BOOLEAN(BOX64_STEAM_VULKAN, steam_vulkan, 0, 0) \ + BOOLEAN(BOX64_SYNC_ROUNDING, sync_rounding, 0, 0) \ + BOOLEAN(BOX64_TRACE_COLOR, trace_regsdiff, 0, 0) \ + BOOLEAN(BOX64_TRACE_EMM, trace_emm, 0, 0) \ + STRING(BOX64_TRACE_FILE, trace_file, 0) \ + STRING(BOX64_TRACE_INIT, trace_init, 0) \ + INTEGER64(BOX64_TRACE_START, start_cnt, 0, 0) \ + BOOLEAN(BOX64_TRACE_XMM, trace_xmm, 0, 0) \ + STRING(BOX64_TRACE, trace, 0) \ + BOOLEAN(BOX64_UNITY, unity, 0, 0) \ + BOOLEAN(BOX64_UNITYPLAYER, unityplayer, 1, 0) \ + BOOLEAN(BOX64_WRAP_EGL, wrap_egl, 0, 0) \ + BOOLEAN(BOX64_X11GLX, x11glx, 1, 0) \ + BOOLEAN(BOX64_X11SYNC, x11sync, 0, 0) \ + BOOLEAN(BOX64_X11THREADS, x11threads, 0, 0) \ + BOOLEAN(BOX64_X87_NO80BITS, x87_no80bits, 0, 1) \ + BOOLEAN(BOX64_NOPERSONA32BITS, nopersona32bits, 0, 0) \ + INTEGER(BOX64_DYNACACHE, dynacache, 2, 0, 2, 0) \ + STRING(BOX64_DYNACACHE_FOLDER, dynacache_folder, 0) \ + INTEGER(BOX64_DYNACACHE_MIN, dynacache_min, 350, 0, 10240, 0) + +#if defined(ARM64) +#define ENVSUPER2() \ + INTEGER(BOX64_AVX, avx, 2, 0, 2, 1) +#else +#define ENVSUPER2() \ + INTEGER(BOX64_AVX, avx, 0, 0, 2, 1) +#endif + +#ifdef DYNAREC +#define ENVSUPER3() \ + BOOLEAN(BOX64_DYNAREC, dynarec, 1, 1) +#else +#define ENVSUPER3() \ + BOOLEAN(BOX64_DYNAREC, dynarec, 0, 1) +#endif + +#define ENVSUPER() \ + ENVSUPER1() \ + ENVSUPER2() \ + ENVSUPER3() + +typedef struct box64env_s { +#define INTEGER(NAME, name, default, min, max, wine) int name; +#define INTEGER64(NAME, name, default, wine) int64_t name; +#define BOOLEAN(NAME, name, default, wine) int name; +#define ADDRESS(NAME, name, wine) uintptr_t name; +#define STRING(NAME, name, wine) char* name; + ENVSUPER() +#undef INTEGER +#undef INTEGER64 +#undef BOOLEAN +#undef ADDRESS +#undef STRING + +#define INTEGER(NAME, name, default, min, max, wine) uint64_t is_##name##_overridden : 1; +#define INTEGER64(NAME, name, default, wine) uint64_t is_##name##_overridden : 1; +#define BOOLEAN(NAME, name, default, wine) uint64_t is_##name##_overridden : 1; +#define ADDRESS(NAME, name, wine) uint64_t is_##name##_overridden : 1; +#define STRING(NAME, name, wine) uint64_t is_##name##_overridden : 1; + ENVSUPER() +#undef INTEGER +#undef INTEGER64 +#undef BOOLEAN +#undef ADDRESS +#undef STRING + + int priority; + /******** Custom ones ********/ + int maxcpu; + int dynarec_test; + int avx2; + int rolling_log; + int dynarec_perf_map_fd; + int dynarec_gdbjit; + uintptr_t dynarec_test_start; + uintptr_t dynarec_test_end; + uintptr_t nodynarec_start; + uintptr_t nodynarec_end; + uintptr_t dynarec_gdbjit_start; + uintptr_t dynarec_gdbjit_end; + uintptr_t dynarec_dump_range_start; + uintptr_t dynarec_dump_range_end; + + uint64_t is_any_overridden : 1; + uint64_t is_dynarec_perf_map_fd_overridden : 1; +} box64env_t; + +typedef struct mmaplist_s mmaplist_t; +#ifdef DYNAREC +typedef struct blocklist_s blocklist_t; + +typedef struct DynaCacheBlock_s { + blocklist_t* block; + size_t size; + size_t free_size; +} DynaCacheBlock_t; +#endif + +void InitializeEnvFiles(); +int ApplyEnvFileEntry(const char* name); +const char* GetLastApplyEntryName(); +void InitializeEnv(); +void LoadEnvVariables(); +void PrintEnvVariables(box64env_t* env, int level); +void RecordEnvMappings(uintptr_t addr, size_t length, int fd); +void WillRemoveMapping(uintptr_t addr, size_t length); +void RemoveMapping(uintptr_t addr, size_t length); +box64env_t* GetCurEnvByAddr(uintptr_t addr); +int IsAddrFileMapped(uintptr_t addr, const char** filename, uintptr_t* start); +size_t SizeFileMapped(uintptr_t addr); +mmaplist_t* GetMmaplistByAddr(uintptr_t addr); +int IsAddrNeedReloc(uintptr_t addr); +void SerializeAllMapping(); +void DynaCacheList(const char* name); +void DynaCacheClean(); +int IsAddrMappingLoadAndClean(uintptr_t addr); + +#endif // __ENV_H diff --git a/src/include/fileutils.h b/src/include/fileutils.h index 858c632..72b1bfd 100644 --- a/src/include/fileutils.h +++ b/src/include/fileutils.h @@ -3,13 +3,6 @@ #include "pathcoll.h" -#define IS_EXECUTABLE (1<<0) -#define IS_FILE (1<<1) - - -// 0 : doesn't exist, 1: Does exist -int FileExist(const char* filename, int flags); - // find a file, using Path if needed, resolving symlinks char* ResolveFile(const char* filename, path_collection_t* paths); // find a file, using Path if needed, NOT resolving symlinks @@ -18,14 +11,14 @@ char* ResolveFileSoft(const char* filename, path_collection_t* paths); // 1: if file is an x86 elf, 0: if not (or not found) int FileIsX86ELF(const char* filename); int FileIsX64ELF(const char* filename); +int FileIsX64X86ELF(const char* filename); int FileIsShell(const char* filename); +int FileIsPython(const char* filename); +size_t FileSize(const char* filename); // return temp folder (will return /tmp if nothing is correct) const char* GetTmpDir(void); -// will lower case the string and return a copy. Nothing fancy here, just A..Z transformed to a..z, rest is untouched -char* LowerCase(const char* s); - #if defined(RPI) || defined(RK3399) || defined(RK3326) void sanitize_mojosetup_gtk_background(void); #endif diff --git a/src/include/freq.h b/src/include/freq.h new file mode 100644 index 0000000..fe94bef --- /dev/null +++ b/src/include/freq.h @@ -0,0 +1,11 @@ +#ifndef __FREQ_H_ +#define __FREQ_H_ + +#include + +typedef struct x64emu_s x64emu_t; + +uint64_t ReadTSC(x64emu_t* emu); +uint64_t ReadTSCFrequency(x64emu_t* emu); + +#endif // __FREQ_H_ \ No newline at end of file diff --git a/src/include/gdbjit.h b/src/include/gdbjit.h new file mode 100644 index 0000000..f8cb971 --- /dev/null +++ b/src/include/gdbjit.h @@ -0,0 +1,35 @@ +#ifndef __GDBJIT_H__ +#define __GDBJIT_H__ + +#if defined(DYNAREC) && defined(GDBJIT) +#include +#include +#include + +typedef struct gdbjit_block_s { + char filename[32]; + FILE* file; + GDB_CORE_ADDR start; + GDB_CORE_ADDR end; + uintptr_t x64start; + size_t alloced; + size_t nlines; + struct gdb_line_mapping lines[0]; +} gdbjit_block_t; + + +void GdbJITNewBlock(gdbjit_block_t* block, GDB_CORE_ADDR start, GDB_CORE_ADDR end, uintptr_t x64start); +gdbjit_block_t* GdbJITBlockAddLine(gdbjit_block_t* block, GDB_CORE_ADDR addr, const char* line); +void GdbJITBlockReady(gdbjit_block_t* block); +void GdbJITBlockCleanup(gdbjit_block_t* block); + +#else + +#define GdbJITNewBlock(a, b, c, d) +#define GdbJITBlockAddLine(a, b, c) NULL +#define GdbJITBlockReady(a) +#define GdbJITBlockCleanup(a) + +#endif + +#endif // __GDBJIT_H__ diff --git a/src/include/globalsymbols.h b/src/include/globalsymbols.h index 6344d5b..6cb58cc 100644 --- a/src/include/globalsymbols.h +++ b/src/include/globalsymbols.h @@ -1,9 +1,12 @@ #ifndef _GLOBAL_SYMBOLS_H_ #define _GLOBAL_SYMBOLS_H_ +void addGlobalRef(void* p, const char* symname); + //GTK stuff void my_checkGlobalGdkDisplay(void); void my_setGlobalGThreadsInit(void); +void addGlobalGdkDisplayRef(void* p); //void** my_GetGTKDisplay(void); void** my_GetGthreadsGotInitialized(void); // defined in wrappedgthread2 @@ -16,6 +19,16 @@ void my_updateGlobalTInfo(void); void my_checkGlobalOpt(void); void my_updateGlobalOpt(void); +#ifdef BOX32 +// NCurse / TInfo +void my32_checkGlobalTInfo(void); +void my32_updateGlobalTInfo(void); + +// getopt +void my32_checkGlobalOpt(void); +void my32_updateGlobalOpt(void); +#endif + // libxslt void my_checkGlobalXslt(void); void my_updateGlobalXslt(void); diff --git a/src/include/gltools.h b/src/include/gltools.h index 07bd74f..36b4660 100644 --- a/src/include/gltools.h +++ b/src/include/gltools.h @@ -7,6 +7,10 @@ typedef void* (*glprocaddress_t)(const char* name); void freeGLProcWrapper(box64context_t* context); -void* getGLProcAddress(x64emu_t* emu, glprocaddress_t procaddr, const char* rname); +void* getGLProcAddress(x64emu_t* emu, const char* my, glprocaddress_t procaddr, const char* rname); + +#ifdef BOX32 +void* getGLProcAddress32(x64emu_t* emu, const char* my, glprocaddress_t procaddr, const char* rname); +#endif #endif //__GL_TOOLS_H__ \ No newline at end of file diff --git a/src/include/gtkclass.h b/src/include/gtkclass.h index 9960d74..b41d67a 100644 --- a/src/include/gtkclass.h +++ b/src/include/gtkclass.h @@ -50,6 +50,26 @@ typedef struct my_GObjectClass_s void* pdummy[6]; } my_GObjectClass_t; +typedef struct my_GTypeModule_s +{ + my_GObject_t parent_instance; + uint32_t use_count; + void* type_infos; // GSList + void* interface_infos; // GSList + char *name; +} my_GTypeModule_t; + +typedef struct my_GTypeModuleClass_s +{ + my_GObjectClass_t parent_class; + int (*load) (my_GTypeModule_t* module); + void (*unload) (my_GTypeModule_t* module); + void (*reserved1) (void); + void (*reserved2) (void); + void (*reserved3) (void); + void (*reserved4) (void); +} my_GTypeModuleClass_t; + typedef struct my_GInitiallyUnowned_s { my_GTypeInstance_t g_type_instance; @@ -409,6 +429,23 @@ typedef struct my_GtkActionClass_s void (*_gtk_reserved4) (void); } my_GtkActionClass_t; +typedef struct my_GtkDrawingArea3_s +{ + my_GtkWidget3_t parent; + void* draw_data; +} my_GtkDrawingArea3_t; + +typedef struct my_GtkDrawingArea3Class_s +{ + my_GtkWidget3Class_t parent_class; + + /* Padding for future expansion */ + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); + void (*_gtk_reserved4) (void); +} my_GtkDrawingArea3Class_t; + typedef struct my_GtkMisc2_s { my_GtkWidget2_t parent; @@ -554,10 +591,6 @@ typedef struct my_GtkBin2_s typedef struct my_GtkBin2Class_s { my_GtkContainer2Class_t parent_class; - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); } my_GtkBin2Class_t; typedef struct my_GtkBin3_s @@ -1267,6 +1300,122 @@ typedef struct my_GtkFixed3Class_s void* padding[8]; } my_GtkFixed3Class_t; +typedef struct my_GtkNotebook2_s +{ + my_GtkContainer2_t parent; + void* cur_page; + void* children; + void* first_tab; + void* focus_tab; + void* menu; + void* event_window; + uint32_t timer; + uint16_t tab_hborder; + uint16_t tab_vborder; + uint32_t show_tabs : 1; + uint32_t homogeneous : 1; + uint32_t show_border : 1; + uint32_t tab_pos : 2; + uint32_t scrollable : 1; + uint32_t in_child : 3; + uint32_t click_child : 3; + uint32_t button : 2; + uint32_t need_timer : 1; + uint32_t child_has_focus : 1; + uint32_t have_visible_child : 1; + uint32_t focus_out : 1; + uint32_t has_before_previous: 1; + uint32_t has_before_next : 1; + uint32_t has_after_previous : 1; + uint32_t has_after_next : 1; +} my_GtkNotebook2_t; + +typedef struct my_GtkNotebook2Class_s +{ + my_GtkContainer2Class_t parent_class; + void (* switch_page) (void* notebook, void* page, uint32_t page_num); + int (* select_page) (void* notebook, int move_focus); + int (* focus_tab) (void* notebook, int type); + int (* change_current_page)(void* notebook, int offset); + void (* move_focus_out) (void* notebook, int direction); + int (* reorder_tab) (void* notebook, int direction, int move_to_last); + int (* insert_page) (void* notebook, void* child, void* tab_label, void* menu_label, int position); + void*(* create_window) (void* notebook, void* page, int x, int y); + void (*_gtk_reserved1) (void); +} my_GtkNotebook2Class_t; + +typedef struct my_GtkCellRenderer2_s +{ + my_GtkObject_t parent; + float xalign; + float yalign; + int width; + int height; + uint16_t xpad; + uint16_t ypad; + uint32_t mode : 2; + uint32_t visible : 1; + uint32_t is_expander : 1; + uint32_t is_expanded : 1; + uint32_t cell_background_set : 1; + uint32_t sensitive : 1; + uint32_t editing : 1; +} my_GtkCellRenderer2_t; + +typedef struct my_GtkCellRenderer2Class_s +{ + my_GtkObjectClass_t parent_class; + void (* get_size) (void* cell, void* widget, void* cell_area, int* x_offset, int* y_offset, int* width, int* height); + void (* render) (void* cell, void* window, void* widget, void* background_area, void* cell_area, void* expose_area, int flags); + int (* activate) (void* cell, void* event, void* widget, void* path, void* background_area, void* cell_area, int flags); + void* (* start_editing) (void* cell, void* event, void* widget, void* path, void* background_area, void* cell_area, int flags); + void (* editing_canceled) (void* cell); + void (* editing_started) (void* cell, void* editable, void* path); + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); +} my_GtkCellRenderer2Class_t; + +typedef struct my_PangoColor_s +{ + uint16_t red; + uint16_t green; + uint16_t blue; +} my_PangoColor_t; + +typedef struct my_GtkCellRendererText2_s +{ + my_GtkCellRenderer2_t parent; + void* text; + void* font; + double font_scale; + my_PangoColor_t foreground; + my_PangoColor_t background; + void* extra_attrs; + int underline_style; + int rise; + int fixed_height_rows; + uint32_t strikethrough : 1; + uint32_t editable : 1; + uint32_t scale_set : 1; + uint32_t foreground_set : 1; + uint32_t background_set : 1; + uint32_t underline_set : 1; + uint32_t rise_set : 1; + uint32_t strikethrough_set : 1; + uint32_t editable_set : 1; + uint32_t calc_fixed_height : 1; +} my_GtkCellRendererText2_t; + +typedef struct my_GtkCellRendererText2Class_s +{ + my_GtkCellRenderer2Class_t parent_class; + void (* edited) (void* cell_renderer_text, void* path, void* new_text); + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); + void (*_gtk_reserved4) (void); +} my_GtkCellRendererText2Class_t; + typedef struct my_GDBusObjectManagerClient_s { my_GObject_t parent; @@ -1281,6 +1430,24 @@ typedef struct my_GDBusObjectManagerClientClass_s void* padding[8]; } my_GDBusObjectManagerClientClass_t; +typedef struct my_GDBusInterfaceSkeleton_s +{ + my_GObject_t parent; + void* priv; +} my_GDBusInterfaceSkeleton_t; + +typedef struct my_GDBusInterfaceSkeletonClass_s +{ + my_GObjectClass_t parent; + void* (*get_info) (void* interface_); + void* (*get_vtable) (void* interface_); + void* (*get_properties) (void* interface_); + void (*flush) (void* interface_); + void* vfunc_padding[8]; + int (*g_authorize_method) (void* interface_, void* invocation); + void* signal_padding[8]; +} my_GDBusInterfaceSkeletonClass_t; + typedef struct my_AtkObject_s { my_GObject_t parent; @@ -2104,6 +2271,40 @@ typedef struct my_GstAudioFilterClass_s { void* _gst_reserved[20]; } my_GstAudioFilterClass_t; +typedef struct my_GstBufferPool_s { + my_GstObject_t object; + int flushing; + void* priv; //GstBufferPoolPrivate + void* _gst_reserved[4]; +} my_GstBufferPool_t; + +typedef struct my_GstBufferPoolClass_s { + my_GstObjectClass_t object_class; + void* (*get_options) (void* pool); + int (*set_config) (void* pool, void* config); + int (*start) (void* pool); + int (*stop) (void* pool); + int (*acquire_buffer) (void* pool, void* buffer, void* params); + int (*alloc_buffer) (void* pool, void* buffer, void* params); + void (*reset_buffer) (void* pool, void* buffer); + void (*release_buffer) (void* pool, void* buffer); + void (*free_buffer) (void* pool, void* buffer); + void (*flush_start) (void* pool); + void (*flush_stop) (void* pool); + void* _gst_reserved[4 - 2]; +} my_GstBufferPoolClass_t; + +typedef struct my_GstVideoBufferPool_s +{ + my_GstBufferPool_t bufferpool; + void* priv; //GstVideoBufferPoolPrivate +} my_GstVideoBufferPool_t; + +typedef struct my_GstVideoBufferPoolClass_s +{ + my_GstBufferPoolClass_t parent; +} my_GstVideoBufferPoolClass_t; + typedef struct my_GDBusProxy_s { my_GObject_t parent; @@ -2181,6 +2382,7 @@ typedef struct my_GtkTypeInfo_s { my_GTypeValueTable_t* findFreeGTypeValueTable(my_GTypeValueTable_t* fcts); my_GTypeInfo_t* findFreeGTypeInfo(my_GTypeInfo_t* fcts, size_t parent); my_GtkTypeInfo_t* findFreeGtkTypeInfo(my_GtkTypeInfo_t* fcts, size_t parent); +void* find_class_init_Fct(void* fct, size_t parent); void InitGTKClass(bridge_t *bridge); void FiniGTKClass(void); @@ -2190,6 +2392,7 @@ GTKCLASS(GObject) \ GTKCLASS(GInitiallyUnowned) \ GTKCLASS(GApplication) \ GTKCLASS(GtkApplication) \ +GTKCLASS(GtkDrawingArea3) \ GTKCLASS(GtkObject) \ GTKCLASS(GtkWidget2) \ GTKCLASS(GtkWidget3) \ @@ -2234,8 +2437,12 @@ GTKCLASS(GtkEventController) \ GTKCLASS(GtkGesture) \ GTKCLASS(GtkGestureSingle) \ GTKCLASS(GtkGestureLongPress) \ +GTKCLASS(GtkNotebook2) \ +GTKCLASS(GtkCellRenderer2) \ +GTKCLASS(GtkCellRendererText2) \ GTKCLASS(MetaFrames2) \ GTKCLASS(GDBusObjectManagerClient) \ +GTKCLASS(GDBusInterfaceSkeleton) \ GTKCLASS(AtkObject) \ GTKCLASS(AtkUtil) \ GTKCLASS(GstObject) \ @@ -2262,6 +2469,8 @@ GTKCLASS(GstGLBaseSrc) \ GTKCLASS(GstAudioDecoder) \ GTKCLASS(GstVideoFilter) \ GTKCLASS(GstAudioFilter) \ +GTKCLASS(GstBufferPool) \ +GTKCLASS(GstVideoBufferPool) \ GTKIFACE(GstURIHandler) \ #define GTKCLASS(A) void Set##A##ID(size_t id); @@ -2277,6 +2486,8 @@ void AutoBridgeGtk(void*(*ref)(size_t), void(*unref)(void*)); void* wrapCopyGTKClass(void* cl, size_t type); void* unwrapCopyGTKClass(void* klass, size_t type); +void wrapGTKClass(void* cl, size_t type); +void unwrapGTKClass(void* klass, size_t type); void unwrapGTKInterface(void* cl, size_t type); void* wrapCopyGTKInterface(void* cl, size_t type); @@ -2287,20 +2498,6 @@ void bridgeGTKInstance(void* cl, size_t type); void addRegisteredClass(size_t klass, char* name); -typedef struct my_signal_s { - uint64_t sign; // signature - void* data; - uintptr_t c_handler; - uintptr_t destroy; -} my_signal_t; -// some random sign to identify a my_signal_t -#define SIGN 0xFB3405EB4510AA00LL - -my_signal_t* new_mysignal(void* f, void* data, void* destroy); -void my_signal_delete(my_signal_t* sig); -int my_signal_is_valid(void* sig); -int my_signal_cb(void* a, void* b, void* c, void* d); - void my_add_signal_offset(size_t klass, uint32_t offset, int n); #endif //__GTKCLASS_H__ diff --git a/src/include/hostext.h b/src/include/hostext.h new file mode 100644 index 0000000..0b36876 --- /dev/null +++ b/src/include/hostext.h @@ -0,0 +1,54 @@ +#ifndef __HOSTEXT_H__ +#define __HOSTEXT_H__ + +#include + +typedef union cpu_ext_s { + struct { +#ifdef ARM64 + uint64_t atomics : 1; // it's important this is the 1st bit + uint64_t asimd : 1; + uint64_t aes : 1; + uint64_t pmull : 1; + uint64_t crc32 : 1; + uint64_t sha1 : 1; + uint64_t sha2 : 1; + uint64_t uscat : 1; + uint64_t flagm : 1; + uint64_t flagm2 : 1; + uint64_t frintts : 1; + uint64_t afp : 1; + uint64_t rndr : 1; +#elif defined(RV64) + uint64_t vlen : 8; // Not *8, 8bits should be enugh? that's 2048 vector + uint64_t zba : 1; + uint64_t zbb : 1; + uint64_t zbc : 1; + uint64_t zbs : 1; + uint64_t vector : 1; // rvv 1.0 or xtheadvector + uint64_t xtheadvector : 1; + uint64_t xtheadba : 1; + uint64_t xtheadbb : 1; + uint64_t xtheadbs : 1; + uint64_t xtheadcondmov : 1; + uint64_t xtheadmemidx : 1; + uint64_t xtheadmempair : 1; + uint64_t xtheadfmemidx : 1; + uint64_t xtheadmac : 1; + uint64_t xtheadfmv : 1; +#elif defined(LA64) + uint64_t lbt : 1; // it's important it's stay the 1st bit + uint64_t lam_bh : 1; + uint64_t lamcas : 1; + uint64_t scq : 1; + uint64_t frecipe : 1; + uint64_t lasx : 1; +#endif + }; + uint64_t x; +} cpu_ext_t; + +int DetectHostCpuFeatures(void); +void PrintHostCpuFeatures(void); + +#endif //__HOSTEXT_H__ \ No newline at end of file diff --git a/src/include/json.h b/src/include/json.h new file mode 100644 index 0000000..8513341 --- /dev/null +++ b/src/include/json.h @@ -0,0 +1,3505 @@ +/* + The latest version of this library is available on GitHub; + https://github.com/sheredom/json.h. +*/ + +/* + This is free and unencumbered software released into the public domain. + + Anyone is free to copy, modify, publish, use, compile, sell, or + distribute this software, either in source code form or as a compiled + binary, for any purpose, commercial or non-commercial, and by any + means. + + In jurisdictions that recognize copyright laws, the author or authors + of this software dedicate any and all copyright interest in the + software to the public domain. We make this dedication for the benefit + of the public at large and to the detriment of our heirs and + successors. We intend this dedication to be an overt act of + relinquishment in perpetuity of all present and future rights to this + software under copyright law. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + For more information, please refer to . +*/ + +#ifndef SHEREDOM_JSON_H_INCLUDED +#define SHEREDOM_JSON_H_INCLUDED + +#if defined(_MSC_VER) +#pragma warning(push) + +/* disable warning: no function prototype given: converting '()' to '(void)' */ +#pragma warning(disable : 4255) + +/* disable warning: '__cplusplus' is not defined as a preprocessor macro, + * replacing with '0' for '#if/#elif' */ +#pragma warning(disable : 4668) + +/* disable warning: 'bytes padding added after construct' */ +#pragma warning(disable : 4820) +#endif + +#include +#include + +#if defined(__TINYC__) +#define JSON_ATTRIBUTE(a) __attribute((a)) +#else +#define JSON_ATTRIBUTE(a) __attribute__((a)) +#endif + +#if defined(_MSC_VER) || defined(__WATCOMC__) +#define json_weak __inline +#elif defined(__clang__) || defined(__GNUC__) || defined(__TINYC__) +#define json_weak JSON_ATTRIBUTE(weak) +#else +#error Non clang, non gcc, non MSVC, non tcc, non WATCOM compiler found! +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct json_value_s; +struct json_parse_result_s; + +enum json_parse_flags_e { + json_parse_flags_default = 0, + + /* allow trailing commas in objects and arrays. For example, both [true,] and + {"a" : null,} would be allowed with this option on. */ + json_parse_flags_allow_trailing_comma = 0x1, + + /* allow unquoted keys for objects. For example, {a : null} would be allowed + with this option on. */ + json_parse_flags_allow_unquoted_keys = 0x2, + + /* allow a global unbracketed object. For example, a : null, b : true, c : {} + would be allowed with this option on. */ + json_parse_flags_allow_global_object = 0x4, + + /* allow objects to use '=' instead of ':' between key/value pairs. For + example, a = null, b : true would be allowed with this option on. */ + json_parse_flags_allow_equals_in_object = 0x8, + + /* allow that objects don't have to have comma separators between key/value + pairs. */ + json_parse_flags_allow_no_commas = 0x10, + + /* allow c-style comments (either variants) to be ignored in the input JSON + file. */ + json_parse_flags_allow_c_style_comments = 0x20, + + /* deprecated flag, unused. */ + json_parse_flags_deprecated = 0x40, + + /* record location information for each value. */ + json_parse_flags_allow_location_information = 0x80, + + /* allow strings to be 'single quoted'. */ + json_parse_flags_allow_single_quoted_strings = 0x100, + + /* allow numbers to be hexadecimal. */ + json_parse_flags_allow_hexadecimal_numbers = 0x200, + + /* allow numbers like +123 to be parsed. */ + json_parse_flags_allow_leading_plus_sign = 0x400, + + /* allow numbers like .0123 or 123. to be parsed. */ + json_parse_flags_allow_leading_or_trailing_decimal_point = 0x800, + + /* allow Infinity, -Infinity, NaN, -NaN. */ + json_parse_flags_allow_inf_and_nan = 0x1000, + + /* allow multi line string values. */ + json_parse_flags_allow_multi_line_strings = 0x2000, + + /* allow simplified JSON to be parsed. Simplified JSON is an enabling of a set + of other parsing options. */ + json_parse_flags_allow_simplified_json = + (json_parse_flags_allow_trailing_comma | + json_parse_flags_allow_unquoted_keys | + json_parse_flags_allow_global_object | + json_parse_flags_allow_equals_in_object | + json_parse_flags_allow_no_commas), + + /* allow JSON5 to be parsed. JSON5 is an enabling of a set of other parsing + options. */ + json_parse_flags_allow_json5 = + (json_parse_flags_allow_trailing_comma | + json_parse_flags_allow_unquoted_keys | + json_parse_flags_allow_c_style_comments | + json_parse_flags_allow_single_quoted_strings | + json_parse_flags_allow_hexadecimal_numbers | + json_parse_flags_allow_leading_plus_sign | + json_parse_flags_allow_leading_or_trailing_decimal_point | + json_parse_flags_allow_inf_and_nan | + json_parse_flags_allow_multi_line_strings) +}; + +/* Parse a JSON text file, returning a pointer to the root of the JSON + * structure. json_parse performs 1 call to malloc for the entire encoding. + * Returns 0 if an error occurred (malformed JSON input, or malloc failed). */ +json_weak struct json_value_s *json_parse(const void *src, size_t src_size); + +/* Parse a JSON text file, returning a pointer to the root of the JSON + * structure. json_parse performs 1 call to alloc_func_ptr for the entire + * encoding. Returns 0 if an error occurred (malformed JSON input, or malloc + * failed). If an error occurred, the result struct (if not NULL) will explain + * the type of error, and the location in the input it occurred. If + * alloc_func_ptr is null then malloc is used. */ +json_weak struct json_value_s * +json_parse_ex(const void *src, size_t src_size, size_t flags_bitset, + void *(*alloc_func_ptr)(void *, size_t), void *user_data, + struct json_parse_result_s *result); + +/* Extracts a value and all the data that makes it up into a newly created + * value. json_extract_value performs 1 call to malloc for the entire encoding. + */ +json_weak struct json_value_s * +json_extract_value(const struct json_value_s *value); + +/* Extracts a value and all the data that makes it up into a newly created + * value. json_extract_value performs 1 call to alloc_func_ptr for the entire + * encoding. If alloc_func_ptr is null then malloc is used. */ +json_weak struct json_value_s * +json_extract_value_ex(const struct json_value_s *value, + void *(*alloc_func_ptr)(void *, size_t), void *user_data); + +/* Write out a minified JSON utf-8 string. This string is an encoding of the + * minimal string characters required to still encode the same data. + * json_write_minified performs 1 call to malloc for the entire encoding. Return + * 0 if an error occurred (malformed JSON input, or malloc failed). The out_size + * parameter is optional as the utf-8 string is null terminated. */ +json_weak void *json_write_minified(const struct json_value_s *value, + size_t *out_size); + +/* Write out a pretty JSON utf-8 string. This string is encoded such that the + * resultant JSON is pretty in that it is easily human readable. The indent and + * newline parameters allow a user to specify what kind of indentation and + * newline they want (two spaces / three spaces / tabs? \r, \n, \r\n ?). Both + * indent and newline can be NULL, indent defaults to two spaces (" "), and + * newline defaults to linux newlines ('\n' as the newline character). + * json_write_pretty performs 1 call to malloc for the entire encoding. Return 0 + * if an error occurred (malformed JSON input, or malloc failed). The out_size + * parameter is optional as the utf-8 string is null terminated. */ +json_weak void *json_write_pretty(const struct json_value_s *value, + const char *indent, const char *newline, + size_t *out_size); + +/* Reinterpret a JSON value as a string. Returns null is the value was not a + * string. */ +json_weak struct json_string_s * +json_value_as_string(struct json_value_s *const value); + +/* Reinterpret a JSON value as a number. Returns null is the value was not a + * number. */ +json_weak struct json_number_s * +json_value_as_number(struct json_value_s *const value); + +/* Reinterpret a JSON value as an object. Returns null is the value was not an + * object. */ +json_weak struct json_object_s * +json_value_as_object(struct json_value_s *const value); + +/* Reinterpret a JSON value as an array. Returns null is the value was not an + * array. */ +json_weak struct json_array_s * +json_value_as_array(struct json_value_s *const value); + +/* Whether the value is true. */ +json_weak int json_value_is_true(const struct json_value_s *const value); + +/* Whether the value is false. */ +json_weak int json_value_is_false(const struct json_value_s *const value); + +/* Whether the value is null. */ +json_weak int json_value_is_null(const struct json_value_s *const value); + +/* The various types JSON values can be. Used to identify what a value is. */ +typedef enum json_type_e { + json_type_string, + json_type_number, + json_type_object, + json_type_array, + json_type_true, + json_type_false, + json_type_null + +} json_type_t; + +/* A JSON string value. */ +typedef struct json_string_s { + /* utf-8 string */ + const char *string; + /* The size (in bytes) of the string */ + size_t string_size; + +} json_string_t; + +/* A JSON string value (extended). */ +typedef struct json_string_ex_s { + /* The JSON string this extends. */ + struct json_string_s string; + + /* The character offset for the value in the JSON input. */ + size_t offset; + + /* The line number for the value in the JSON input. */ + size_t line_no; + + /* The row number for the value in the JSON input, in bytes. */ + size_t row_no; + +} json_string_ex_t; + +/* A JSON number value. */ +typedef struct json_number_s { + /* ASCII string containing representation of the number. */ + const char *number; + /* the size (in bytes) of the number. */ + size_t number_size; + +} json_number_t; + +/* an element of a JSON object. */ +typedef struct json_object_element_s { + /* the name of this element. */ + struct json_string_s *name; + /* the value of this element. */ + struct json_value_s *value; + /* the next object element (can be NULL if the last element in the object). */ + struct json_object_element_s *next; + +} json_object_element_t; + +/* a JSON object value. */ +typedef struct json_object_s { + /* a linked list of the elements in the object. */ + struct json_object_element_s *start; + /* the number of elements in the object. */ + size_t length; + +} json_object_t; + +/* an element of a JSON array. */ +typedef struct json_array_element_s { + /* the value of this element. */ + struct json_value_s *value; + /* the next array element (can be NULL if the last element in the array). */ + struct json_array_element_s *next; + +} json_array_element_t; + +/* a JSON array value. */ +typedef struct json_array_s { + /* a linked list of the elements in the array. */ + struct json_array_element_s *start; + /* the number of elements in the array. */ + size_t length; + +} json_array_t; + +/* a JSON value. */ +typedef struct json_value_s { + /* a pointer to either a json_string_s, json_number_s, json_object_s, or. */ + /* json_array_s. Should be cast to the appropriate struct type based on what. + */ + /* the type of this value is. */ + void *payload; + /* must be one of json_type_e. If type is json_type_true, json_type_false, or. + */ + /* json_type_null, payload will be NULL. */ + size_t type; + +} json_value_t; + +/* a JSON value (extended). */ +typedef struct json_value_ex_s { + /* the JSON value this extends. */ + struct json_value_s value; + + /* the character offset for the value in the JSON input. */ + size_t offset; + + /* the line number for the value in the JSON input. */ + size_t line_no; + + /* the row number for the value in the JSON input, in bytes. */ + size_t row_no; + +} json_value_ex_t; + +/* a parsing error code. */ +enum json_parse_error_e { + /* no error occurred (huzzah!). */ + json_parse_error_none = 0, + + /* expected either a comma or a closing '}' or ']' to close an object or. */ + /* array! */ + json_parse_error_expected_comma_or_closing_bracket, + + /* colon separating name/value pair was missing! */ + json_parse_error_expected_colon, + + /* expected string to begin with '"'! */ + json_parse_error_expected_opening_quote, + + /* invalid escaped sequence in string! */ + json_parse_error_invalid_string_escape_sequence, + + /* invalid number format! */ + json_parse_error_invalid_number_format, + + /* invalid value! */ + json_parse_error_invalid_value, + + /* reached end of buffer before object/array was complete! */ + json_parse_error_premature_end_of_buffer, + + /* string was malformed! */ + json_parse_error_invalid_string, + + /* a call to malloc, or a user provider allocator, failed. */ + json_parse_error_allocator_failed, + + /* the JSON input had unexpected trailing characters that weren't part of the. + JSON value. */ + json_parse_error_unexpected_trailing_characters, + + /* the JSON has too many nested objects & arrays - to prevent a stack + overflow, the library only supports recursion up to JSON_MAX_RECURSION */ + json_parse_error_recursion, + + /* catch-all error for everything else that exploded (real bad chi!). */ + json_parse_error_unknown +}; + +/* error report from json_parse_ex(). */ +typedef struct json_parse_result_s { + /* the error code (one of json_parse_error_e). */ + size_t error; + + /* the character offset for the error in the JSON input. */ + size_t error_offset; + + /* the line number for the error in the JSON input. */ + size_t error_line_no; + + /* the row number for the error, in bytes. */ + size_t error_row_no; + +} json_parse_result_t; + +#ifdef __cplusplus +} /* extern "C". */ +#endif + +#include + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + +#if defined(_MSC_VER) && (_MSC_VER < 1920) +#define json_uintmax_t unsigned __int64 +#else +#include +#define json_uintmax_t uintmax_t +#endif + +#if defined(_MSC_VER) +#define json_strtoumax _strtoui64 +#else +#define json_strtoumax strtoumax +#endif + +#if defined(__cplusplus) && (__cplusplus >= 201103L) +#define json_null nullptr +#else +#define json_null 0 +#endif + +#if defined(__clang__) +#pragma clang diagnostic push + +/* we do one big allocation via malloc, then cast aligned slices of this for. */ +/* our structures - we don't have a way to tell the compiler we know what we. */ +/* are doing, so disable the warning instead! */ +#pragma clang diagnostic ignored "-Wcast-align" + +/* We use C style casts everywhere. */ +#pragma clang diagnostic ignored "-Wold-style-cast" + +/* We need long long for strtoull. */ +#pragma clang diagnostic ignored "-Wc++11-long-long" + +/* Who cares if nullptr doesn't work with C++98, we don't use it there! */ +#pragma clang diagnostic ignored "-Wc++98-compat" +#pragma clang diagnostic ignored "-Wc++98-compat-pedantic" + +#if __has_warning("-Wunsafe-buffer-usage") +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" +#endif + +#elif defined(_MSC_VER) +#pragma warning(push) + +/* disable 'function selected for inline expansion' warning. */ +#pragma warning(disable : 4711) + +/* disable '#pragma warning: there is no warning number' warning. */ +#pragma warning(disable : 4619) + +/* disable 'warning number not a valid compiler warning' warning. */ +#pragma warning(disable : 4616) + +/* disable 'Compiler will insert Spectre mitigation for memory load if + * /Qspectre. */ +/* switch specified' warning. */ +#pragma warning(disable : 5045) +#endif + +/* set recursion limit for recursing nested arrays & objects */ +#ifndef JSON_MAX_RECURSION +#define JSON_MAX_RECURSION 1000 +#endif + +struct json_parse_state_s { + const char *src; + size_t size; + size_t offset; + size_t flags_bitset; + char *data; + char *dom; + size_t dom_size; + size_t data_size; + size_t line_no; /* line counter for error reporting. */ + size_t line_offset; /* (offset-line_offset) is the character number (in + bytes). */ + size_t error; + size_t recursion; +}; + +json_weak int json_hexadecimal_digit(const char c); +int json_hexadecimal_digit(const char c) { + if ('0' <= c && c <= '9') { + return c - '0'; + } + if ('a' <= c && c <= 'f') { + return c - 'a' + 10; + } + if ('A' <= c && c <= 'F') { + return c - 'A' + 10; + } + return -1; +} + +json_weak int json_hexadecimal_value(const char *c, const unsigned long size, + unsigned long *result); +int json_hexadecimal_value(const char *c, const unsigned long size, + unsigned long *result) { + const char *p; + int digit; + + if (size > sizeof(unsigned long) * 2) { + return 0; + } + + *result = 0; + for (p = c; (unsigned long)(p - c) < size; ++p) { + *result <<= 4; + digit = json_hexadecimal_digit(*p); + if (digit < 0 || digit > 15) { + return 0; + } + *result |= (unsigned char)digit; + } + return 1; +} + +json_weak int json_skip_whitespace(struct json_parse_state_s *state); +int json_skip_whitespace(struct json_parse_state_s *state) { + size_t offset = state->offset; + const size_t size = state->size; + const char *const src = state->src; + + if (offset >= state->size) { + return 0; + } + + /* the only valid whitespace according to ECMA-404 is ' ', '\n', '\r' and + * '\t'. */ + switch (src[offset]) { + default: + return 0; + case ' ': + case '\r': + case '\t': + case '\n': + break; + } + + do { + switch (src[offset]) { + default: + /* Update offset. */ + state->offset = offset; + return 1; + case ' ': + case '\r': + case '\t': + break; + case '\n': + state->line_no++; + state->line_offset = offset; + break; + } + + offset++; + } while (offset < size); + + /* Update offset. */ + state->offset = offset; + return 1; +} + +json_weak int json_skip_c_style_comments(struct json_parse_state_s *state); +int json_skip_c_style_comments(struct json_parse_state_s *state) { + /* to have a C-style comment we need at least 2 characters of space */ + if ((state->offset + 2) > state->size) { + return 0; + } + + /* do we have a comment? */ + if ('/' == state->src[state->offset]) { + if ('/' == state->src[state->offset + 1]) { + /* we had a comment of the form // */ + + /* skip first '/' */ + state->offset++; + + /* skip second '/' */ + state->offset++; + + while (state->offset < state->size) { + switch (state->src[state->offset]) { + default: + /* skip the character in the comment */ + state->offset++; + break; + case '\n': + /* if we have a newline, our comment has ended! Skip the newline */ + state->offset++; + + /* we entered a newline, so move our line info forward */ + state->line_no++; + state->line_offset = state->offset; + return 1; + } + } + + /* we reached the end of the JSON file! */ + return 1; + } else if ('*' == state->src[state->offset + 1]) { + /* we had a comment in the C-style long form */ + + /* skip '/' */ + state->offset++; + + /* skip '*' */ + state->offset++; + + while (state->offset + 1 < state->size) { + if (('*' == state->src[state->offset]) && + ('/' == state->src[state->offset + 1])) { + /* we reached the end of our comment! */ + state->offset += 2; + return 1; + } else if ('\n' == state->src[state->offset]) { + /* we entered a newline, so move our line info forward */ + state->line_no++; + state->line_offset = state->offset; + } + + /* skip character within comment */ + state->offset++; + } + + /* comment wasn't ended correctly which is a failure */ + return 1; + } + } + + /* we didn't have any comment, which is ok too! */ + return 0; +} + +json_weak int json_skip_all_skippables(struct json_parse_state_s *state); +int json_skip_all_skippables(struct json_parse_state_s *state) { + /* skip all whitespace and other skippables until there are none left. note + * that the previous version suffered from read past errors should. the + * stream end on json_skip_c_style_comments eg. '{"a" ' with comments flag. + */ + + int did_consume = 0; + const size_t size = state->size; + + if (json_parse_flags_allow_c_style_comments & state->flags_bitset) { + do { + if (state->offset == size) { + state->error = json_parse_error_premature_end_of_buffer; + return 1; + } + + did_consume = json_skip_whitespace(state); + + /* This should really be checked on access, not in front of every call. + */ + if (state->offset >= size) { + state->error = json_parse_error_premature_end_of_buffer; + return 1; + } + + did_consume |= json_skip_c_style_comments(state); + } while (0 != did_consume); + } else { + do { + if (state->offset == size) { + state->error = json_parse_error_premature_end_of_buffer; + return 1; + } + + did_consume = json_skip_whitespace(state); + } while (0 != did_consume); + } + + if (state->offset == size) { + state->error = json_parse_error_premature_end_of_buffer; + return 1; + } + + return 0; +} + +json_weak int json_get_value_size(struct json_parse_state_s *state, + int is_global_object); + +json_weak int json_get_string_size(struct json_parse_state_s *state, + size_t is_key); +int json_get_string_size(struct json_parse_state_s *state, size_t is_key) { + size_t offset = state->offset; + const size_t size = state->size; + size_t data_size = 0; + const char *const src = state->src; + const int is_single_quote = '\'' == src[offset]; + const char quote_to_use = is_single_quote ? '\'' : '"'; + const size_t flags_bitset = state->flags_bitset; + unsigned long codepoint; + unsigned long high_surrogate = 0; + + if ((json_parse_flags_allow_location_information & flags_bitset) != 0 && + is_key != 0) { + state->dom_size += sizeof(struct json_string_ex_s); + } else { + state->dom_size += sizeof(struct json_string_s); + } + + if ('"' != src[offset]) { + /* if we are allowed single quoted strings check for that too. */ + if (!((json_parse_flags_allow_single_quoted_strings & flags_bitset) && + is_single_quote)) { + state->error = json_parse_error_expected_opening_quote; + state->offset = offset; + return 1; + } + } + + /* skip leading '"' or '\''. */ + offset++; + + while ((offset < size) && (quote_to_use != src[offset])) { + /* add space for the character. */ + data_size++; + + switch (src[offset]) { + default: + break; + case '\0': + case '\t': + state->error = json_parse_error_invalid_string; + state->offset = offset; + return 1; + } + + if ('\\' == src[offset]) { + /* skip reverse solidus character. */ + offset++; + + if (offset == size) { + state->error = json_parse_error_premature_end_of_buffer; + state->offset = offset; + return 1; + } + + switch (src[offset]) { + default: + state->error = json_parse_error_invalid_string_escape_sequence; + state->offset = offset; + return 1; + case '"': + case '\\': + case '/': + case 'b': + case 'f': + case 'n': + case 'r': + case 't': + /* all valid characters! */ + offset++; + break; + case 'u': + if (!(offset + 5 < size)) { + /* invalid escaped unicode sequence! */ + state->error = json_parse_error_invalid_string_escape_sequence; + state->offset = offset; + return 1; + } + + codepoint = 0; + if (!json_hexadecimal_value(&src[offset + 1], 4, &codepoint)) { + /* escaped unicode sequences must contain 4 hexadecimal digits! */ + state->error = json_parse_error_invalid_string_escape_sequence; + state->offset = offset; + return 1; + } + + /* Valid sequence! + * see: https://en.wikipedia.org/wiki/UTF-8#Invalid_code_points. + * 1 7 U + 0000 U + 007F 0xxxxxxx. + * 2 11 U + 0080 U + 07FF 110xxxxx + * 10xxxxxx. + * 3 16 U + 0800 U + FFFF 1110xxxx + * 10xxxxxx 10xxxxxx. + * 4 21 U + 10000 U + 10FFFF 11110xxx + * 10xxxxxx 10xxxxxx 10xxxxxx. + * Note: the high and low surrogate halves used by UTF-16 (U+D800 + * through U+DFFF) and code points not encodable by UTF-16 (those after + * U+10FFFF) are not legal Unicode values, and their UTF-8 encoding must + * be treated as an invalid byte sequence. */ + + if (high_surrogate != 0) { + /* we previously read the high half of the \uxxxx\uxxxx pair, so now + * we expect the low half. */ + if (codepoint >= 0xdc00 && + codepoint <= 0xdfff) { /* low surrogate range. */ + data_size += 3; + high_surrogate = 0; + } else { + state->error = json_parse_error_invalid_string_escape_sequence; + state->offset = offset; + return 1; + } + } else if (codepoint <= 0x7f) { + data_size += 0; + } else if (codepoint <= 0x7ff) { + data_size += 1; + } else if (codepoint >= 0xd800 && + codepoint <= 0xdbff) { /* high surrogate range. */ + /* The codepoint is the first half of a "utf-16 surrogate pair". so we + * need the other half for it to be valid: \uHHHH\uLLLL. */ + if (offset + 11 > size || '\\' != src[offset + 5] || + 'u' != src[offset + 6]) { + state->error = json_parse_error_invalid_string_escape_sequence; + state->offset = offset; + return 1; + } + high_surrogate = codepoint; + } else if (codepoint >= 0xd800 && + codepoint <= 0xdfff) { /* low surrogate range. */ + /* we did not read the other half before. */ + state->error = json_parse_error_invalid_string_escape_sequence; + state->offset = offset; + return 1; + } else { + data_size += 2; + } + /* escaped codepoints after 0xffff are supported in json through utf-16 + * surrogate pairs: \uD83D\uDD25 for U+1F525. */ + + offset += 5; + break; + } + } else if (('\r' == src[offset]) || ('\n' == src[offset])) { + if (!(json_parse_flags_allow_multi_line_strings & flags_bitset)) { + /* invalid escaped unicode sequence! */ + state->error = json_parse_error_invalid_string_escape_sequence; + state->offset = offset; + return 1; + } + + offset++; + } else { + /* skip character (valid part of sequence). */ + offset++; + } + } + + /* If the offset is equal to the size, we had a non-terminated string! */ + if (offset == size) { + state->error = json_parse_error_premature_end_of_buffer; + state->offset = offset - 1; + return 1; + } + + /* skip trailing '"' or '\''. */ + offset++; + + /* add enough space to store the string. */ + state->data_size += data_size; + + /* one more byte for null terminator ending the string! */ + state->data_size++; + + /* update offset. */ + state->offset = offset; + + return 0; +} + +json_weak int is_valid_unquoted_key_char(const char c); +int is_valid_unquoted_key_char(const char c) { + return (('0' <= c && c <= '9') || ('a' <= c && c <= 'z') || + ('A' <= c && c <= 'Z') || ('_' == c)); +} + +json_weak int json_get_key_size(struct json_parse_state_s *state); +int json_get_key_size(struct json_parse_state_s *state) { + const size_t flags_bitset = state->flags_bitset; + + if (json_parse_flags_allow_unquoted_keys & flags_bitset) { + size_t offset = state->offset; + const size_t size = state->size; + const char *const src = state->src; + size_t data_size = state->data_size; + + /* if we are allowing unquoted keys, first grok for a quote... */ + if ('"' == src[offset]) { + /* ... if we got a comma, just parse the key as a string as normal. */ + return json_get_string_size(state, 1); + } else if ((json_parse_flags_allow_single_quoted_strings & flags_bitset) && + ('\'' == src[offset])) { + /* ... if we got a comma, just parse the key as a string as normal. */ + return json_get_string_size(state, 1); + } else { + while ((offset < size) && is_valid_unquoted_key_char(src[offset])) { + offset++; + data_size++; + } + + /* one more byte for null terminator ending the string! */ + data_size++; + + if (json_parse_flags_allow_location_information & flags_bitset) { + state->dom_size += sizeof(struct json_string_ex_s); + } else { + state->dom_size += sizeof(struct json_string_s); + } + + /* update offset. */ + state->offset = offset; + + /* update data_size. */ + state->data_size = data_size; + + return 0; + } + } else { + /* we are only allowed to have quoted keys, so just parse a string! */ + return json_get_string_size(state, 1); + } +} + +json_weak int json_get_object_size(struct json_parse_state_s *state, + int is_global_object); +int json_get_object_size(struct json_parse_state_s *state, + int is_global_object) { + const size_t flags_bitset = state->flags_bitset; + const char *const src = state->src; + const size_t size = state->size; + size_t elements = 0; + int allow_comma = 0; + int found_closing_brace = 0; + + if (++state->recursion > JSON_MAX_RECURSION) { + // recursion error + state->error = json_parse_error_recursion; + return 1; + } + + if (is_global_object) { + /* if we found an opening '{' of an object, we actually have a normal JSON + * object at the root of the DOM... */ + if (!json_skip_all_skippables(state) && '{' == state->src[state->offset]) { + /* . and we don't actually have a global object after all! */ + is_global_object = 0; + } + } + + if (!is_global_object) { + if ('{' != src[state->offset]) { + state->error = json_parse_error_unknown; + --state->recursion; + return 1; + } + + /* skip leading '{'. */ + state->offset++; + } + + state->dom_size += sizeof(struct json_object_s); + + if ((state->offset == size) && !is_global_object) { + state->error = json_parse_error_premature_end_of_buffer; + --state->recursion; + return 1; + } + + do { + if (!is_global_object) { + if (json_skip_all_skippables(state)) { + state->error = json_parse_error_premature_end_of_buffer; + --state->recursion; + return 1; + } + + if ('}' == src[state->offset]) { + /* skip trailing '}'. */ + state->offset++; + + found_closing_brace = 1; + + /* finished the object! */ + break; + } + } else { + /* we don't require brackets, so that means the object ends when the input + * stream ends! */ + if (json_skip_all_skippables(state)) { + break; + } + } + + /* if we parsed at least one element previously, grok for a comma. */ + if (allow_comma) { + if (',' == src[state->offset]) { + /* skip comma. */ + state->offset++; + allow_comma = 0; + } else if (json_parse_flags_allow_no_commas & flags_bitset) { + /* we don't require a comma, and we didn't find one, which is ok! */ + allow_comma = 0; + } else { + /* otherwise we are required to have a comma, and we found none. */ + state->error = json_parse_error_expected_comma_or_closing_bracket; + --state->recursion; + return 1; + } + + if (json_parse_flags_allow_trailing_comma & flags_bitset) { + continue; + } else { + if (json_skip_all_skippables(state)) { + state->error = json_parse_error_premature_end_of_buffer; + --state->recursion; + return 1; + } + } + } + + if (json_get_key_size(state)) { + /* key parsing failed! */ + state->error = json_parse_error_invalid_string; + --state->recursion; + return 1; + } + + if (json_skip_all_skippables(state)) { + state->error = json_parse_error_premature_end_of_buffer; + --state->recursion; + return 1; + } + + if (json_parse_flags_allow_equals_in_object & flags_bitset) { + const char current = src[state->offset]; + if ((':' != current) && ('=' != current)) { + state->error = json_parse_error_expected_colon; + --state->recursion; + return 1; + } + } else { + if (':' != src[state->offset]) { + state->error = json_parse_error_expected_colon; + --state->recursion; + return 1; + } + } + + /* skip colon. */ + state->offset++; + + if (json_skip_all_skippables(state)) { + state->error = json_parse_error_premature_end_of_buffer; + --state->recursion; + return 1; + } + + if (json_get_value_size(state, /* is_global_object = */ 0)) { + /* value parsing failed! */ + --state->recursion; + return 1; + } + + /* successfully parsed a name/value pair! */ + elements++; + allow_comma = 1; + } while (state->offset < size); + + if ((state->offset == size) && !is_global_object && !found_closing_brace) { + state->error = json_parse_error_premature_end_of_buffer; + --state->recursion; + return 1; + } + + state->dom_size += sizeof(struct json_object_element_s) * elements; + --state->recursion; + + return 0; +} + +json_weak int json_get_array_size(struct json_parse_state_s *state); +int json_get_array_size(struct json_parse_state_s *state) { + const size_t flags_bitset = state->flags_bitset; + size_t elements = 0; + int allow_comma = 0; + const char *const src = state->src; + const size_t size = state->size; + + if (++state->recursion > JSON_MAX_RECURSION) { + // recursion error + state->error = json_parse_error_recursion; + return 1; + } + + if ('[' != src[state->offset]) { + /* expected array to begin with leading '['. */ + state->error = json_parse_error_unknown; + --state->recursion; + return 1; + } + + /* skip leading '['. */ + state->offset++; + + state->dom_size += sizeof(struct json_array_s); + + while (state->offset < size) { + if (json_skip_all_skippables(state)) { + state->error = json_parse_error_premature_end_of_buffer; + --state->recursion; + return 1; + } + + if (']' == src[state->offset]) { + /* skip trailing ']'. */ + state->offset++; + + state->dom_size += sizeof(struct json_array_element_s) * elements; + + /* finished the object! */ + --state->recursion; + return 0; + } + + /* if we parsed at least once element previously, grok for a comma. */ + if (allow_comma) { + if (',' == src[state->offset]) { + /* skip comma. */ + state->offset++; + allow_comma = 0; + } else if (!(json_parse_flags_allow_no_commas & flags_bitset)) { + state->error = json_parse_error_expected_comma_or_closing_bracket; + --state->recursion; + return 1; + } + + if (json_parse_flags_allow_trailing_comma & flags_bitset) { + allow_comma = 0; + continue; + } else { + if (json_skip_all_skippables(state)) { + state->error = json_parse_error_premature_end_of_buffer; + --state->recursion; + return 1; + } + } + } + + if (json_get_value_size(state, /* is_global_object = */ 0)) { + /* value parsing failed! */ + --state->recursion; + return 1; + } + + /* successfully parsed an array element! */ + elements++; + allow_comma = 1; + } + + /* we consumed the entire input before finding the closing ']' of the array! + */ + state->error = json_parse_error_premature_end_of_buffer; + --state->recursion; + return 1; +} + +json_weak int json_get_number_size(struct json_parse_state_s *state); +int json_get_number_size(struct json_parse_state_s *state) { + const size_t flags_bitset = state->flags_bitset; + size_t offset = state->offset; + const size_t size = state->size; + int had_leading_digits = 0; + const char *const src = state->src; + + state->dom_size += sizeof(struct json_number_s); + + if ((json_parse_flags_allow_hexadecimal_numbers & flags_bitset) && + (offset + 1 < size) && ('0' == src[offset]) && + (('x' == src[offset + 1]) || ('X' == src[offset + 1]))) { + /* skip the leading 0x that identifies a hexadecimal number. */ + offset += 2; + + /* consume hexadecimal digits. */ + while ((offset < size) && (('0' <= src[offset] && src[offset] <= '9') || + ('a' <= src[offset] && src[offset] <= 'f') || + ('A' <= src[offset] && src[offset] <= 'F'))) { + offset++; + } + } else { + int found_sign = 0; + int inf_or_nan = 0; + + if ((offset < size) && + (('-' == src[offset]) || + ((json_parse_flags_allow_leading_plus_sign & flags_bitset) && + ('+' == src[offset])))) { + /* skip valid leading '-' or '+'. */ + offset++; + + found_sign = 1; + } + + if (json_parse_flags_allow_inf_and_nan & flags_bitset) { + const char inf[9] = "Infinity"; + const size_t inf_strlen = sizeof(inf) - 1; + const char nan[4] = "NaN"; + const size_t nan_strlen = sizeof(nan) - 1; + + if (offset + inf_strlen < size) { + int found = 1; + size_t i; + for (i = 0; i < inf_strlen; i++) { + if (inf[i] != src[offset + i]) { + found = 0; + break; + } + } + + if (found) { + /* We found our special 'Infinity' keyword! */ + offset += inf_strlen; + + inf_or_nan = 1; + } + } + + if (offset + nan_strlen < size) { + int found = 1; + size_t i; + for (i = 0; i < nan_strlen; i++) { + if (nan[i] != src[offset + i]) { + found = 0; + break; + } + } + + if (found) { + /* We found our special 'NaN' keyword! */ + offset += nan_strlen; + + inf_or_nan = 1; + } + } + + if (inf_or_nan) { + if (offset < size) { + switch (src[offset]) { + default: + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'e': + case 'E': + /* cannot follow an inf or nan with digits! */ + state->error = json_parse_error_invalid_number_format; + state->offset = offset; + return 1; + } + } + } + } + + if (found_sign && !inf_or_nan && (offset < size) && + !('0' <= src[offset] && src[offset] <= '9')) { + /* check if we are allowing leading '.'. */ + if (!(json_parse_flags_allow_leading_or_trailing_decimal_point & + flags_bitset) || + ('.' != src[offset])) { + /* a leading '-' must be immediately followed by any digit! */ + state->error = json_parse_error_invalid_number_format; + state->offset = offset; + return 1; + } + } + + if ((offset < size) && ('0' == src[offset])) { + /* skip valid '0'. */ + offset++; + + /* we need to record whether we had any leading digits for checks later. + */ + had_leading_digits = 1; + + if ((offset < size) && ('0' <= src[offset] && src[offset] <= '9')) { + /* a leading '0' must not be immediately followed by any digit! */ + state->error = json_parse_error_invalid_number_format; + state->offset = offset; + return 1; + } + } + + /* the main digits of our number next. */ + while ((offset < size) && ('0' <= src[offset] && src[offset] <= '9')) { + offset++; + + /* we need to record whether we had any leading digits for checks later. + */ + had_leading_digits = 1; + } + + if ((offset < size) && ('.' == src[offset])) { + offset++; + + if ((offset >= size) || !('0' <= src[offset] && src[offset] <= '9')) { + if (!(json_parse_flags_allow_leading_or_trailing_decimal_point & + flags_bitset) || + !had_leading_digits) { + /* a decimal point must be followed by at least one digit. */ + state->error = json_parse_error_invalid_number_format; + state->offset = offset; + return 1; + } + } + + /* a decimal point can be followed by more digits of course! */ + while ((offset < size) && ('0' <= src[offset] && src[offset] <= '9')) { + offset++; + } + } + + if ((offset < size) && ('e' == src[offset] || 'E' == src[offset])) { + /* our number has an exponent! Skip 'e' or 'E'. */ + offset++; + + if ((offset < size) && ('-' == src[offset] || '+' == src[offset])) { + /* skip optional '-' or '+'. */ + offset++; + } + + if ((offset < size) && !('0' <= src[offset] && src[offset] <= '9')) { + /* an exponent must have at least one digit! */ + state->error = json_parse_error_invalid_number_format; + state->offset = offset; + return 1; + } + + /* consume exponent digits. */ + do { + offset++; + } while ((offset < size) && ('0' <= src[offset] && src[offset] <= '9')); + } + } + + if (offset < size) { + switch (src[offset]) { + case ' ': + case '\t': + case '\r': + case '\n': + case '}': + case ',': + case ']': + /* all of the above are ok. */ + break; + case '=': + if (json_parse_flags_allow_equals_in_object & flags_bitset) { + break; + } + + state->error = json_parse_error_invalid_number_format; + state->offset = offset; + return 1; + default: + state->error = json_parse_error_invalid_number_format; + state->offset = offset; + return 1; + } + } + + state->data_size += offset - state->offset; + + /* one more byte for null terminator ending the number string! */ + state->data_size++; + + /* update offset. */ + state->offset = offset; + + return 0; +} + +json_weak int json_get_value_size(struct json_parse_state_s *state, + int is_global_object); +int json_get_value_size(struct json_parse_state_s *state, + int is_global_object) { + const size_t flags_bitset = state->flags_bitset; + const char *const src = state->src; + size_t offset; + const size_t size = state->size; + + if (json_parse_flags_allow_location_information & flags_bitset) { + state->dom_size += sizeof(struct json_value_ex_s); + } else { + state->dom_size += sizeof(struct json_value_s); + } + + if (is_global_object) { + return json_get_object_size(state, /* is_global_object = */ 1); + } else { + if (json_skip_all_skippables(state)) { + state->error = json_parse_error_premature_end_of_buffer; + return 1; + } + + /* can cache offset now. */ + offset = state->offset; + + switch (src[offset]) { + case '"': + return json_get_string_size(state, 0); + case '\'': + if (json_parse_flags_allow_single_quoted_strings & flags_bitset) { + return json_get_string_size(state, 0); + } else { + /* invalid value! */ + state->error = json_parse_error_invalid_value; + return 1; + } + case '{': + return json_get_object_size(state, /* is_global_object = */ 0); + case '[': + return json_get_array_size(state); + case '-': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + return json_get_number_size(state); + case '+': + if (json_parse_flags_allow_leading_plus_sign & flags_bitset) { + return json_get_number_size(state); + } else { + /* invalid value! */ + state->error = json_parse_error_invalid_number_format; + return 1; + } + case '.': + if (json_parse_flags_allow_leading_or_trailing_decimal_point & + flags_bitset) { + return json_get_number_size(state); + } else { + /* invalid value! */ + state->error = json_parse_error_invalid_number_format; + return 1; + } + default: + if ((offset + 4) <= size && 't' == src[offset + 0] && + 'r' == src[offset + 1] && 'u' == src[offset + 2] && + 'e' == src[offset + 3]) { + state->offset += 4; + return 0; + } else if ((offset + 5) <= size && 'f' == src[offset + 0] && + 'a' == src[offset + 1] && 'l' == src[offset + 2] && + 's' == src[offset + 3] && 'e' == src[offset + 4]) { + state->offset += 5; + return 0; + } else if ((offset + 4) <= size && 'n' == state->src[offset + 0] && + 'u' == state->src[offset + 1] && + 'l' == state->src[offset + 2] && + 'l' == state->src[offset + 3]) { + state->offset += 4; + return 0; + } else if ((json_parse_flags_allow_inf_and_nan & flags_bitset) && + (offset + 3) <= size && 'N' == src[offset + 0] && + 'a' == src[offset + 1] && 'N' == src[offset + 2]) { + return json_get_number_size(state); + } else if ((json_parse_flags_allow_inf_and_nan & flags_bitset) && + (offset + 8) <= size && 'I' == src[offset + 0] && + 'n' == src[offset + 1] && 'f' == src[offset + 2] && + 'i' == src[offset + 3] && 'n' == src[offset + 4] && + 'i' == src[offset + 5] && 't' == src[offset + 6] && + 'y' == src[offset + 7]) { + return json_get_number_size(state); + } + + /* invalid value! */ + state->error = json_parse_error_invalid_value; + return 1; + } + } +} + +json_weak void json_parse_value(struct json_parse_state_s *state, + int is_global_object, + struct json_value_s *value); + +json_weak void json_parse_string(struct json_parse_state_s *state, + struct json_string_s *string); +void json_parse_string(struct json_parse_state_s *state, + struct json_string_s *string) { + size_t offset = state->offset; + size_t bytes_written = 0; + const char *const src = state->src; + const char quote_to_use = '\'' == src[offset] ? '\'' : '"'; + char *data = state->data; + unsigned long high_surrogate = 0; + unsigned long codepoint; + + string->string = data; + + /* skip leading '"' or '\''. */ + offset++; + + while (quote_to_use != src[offset]) { + if ('\\' == src[offset]) { + /* skip the reverse solidus. */ + offset++; + + switch (src[offset++]) { + default: + return; /* we cannot ever reach here. */ + case 'u': { + codepoint = 0; + if (!json_hexadecimal_value(&src[offset], 4, &codepoint)) { + return; /* this shouldn't happen as the value was already validated. + */ + } + + offset += 4; + + if (codepoint <= 0x7fu) { + data[bytes_written++] = (char)codepoint; /* 0xxxxxxx. */ + } else if (codepoint <= 0x7ffu) { + data[bytes_written++] = + (char)(0xc0u | (codepoint >> 6)); /* 110xxxxx. */ + data[bytes_written++] = + (char)(0x80u | (codepoint & 0x3fu)); /* 10xxxxxx. */ + } else if (codepoint >= 0xd800 && + codepoint <= 0xdbff) { /* high surrogate. */ + high_surrogate = codepoint; + continue; /* we need the low half to form a complete codepoint. */ + } else if (codepoint >= 0xdc00 && + codepoint <= 0xdfff) { /* low surrogate. */ + /* combine with the previously read half to obtain the complete + * codepoint. */ + const unsigned long surrogate_offset = + 0x10000u - (0xD800u << 10) - 0xDC00u; + codepoint = (high_surrogate << 10) + codepoint + surrogate_offset; + high_surrogate = 0; + data[bytes_written++] = + (char)(0xF0u | (codepoint >> 18)); /* 11110xxx. */ + data[bytes_written++] = + (char)(0x80u | ((codepoint >> 12) & 0x3fu)); /* 10xxxxxx. */ + data[bytes_written++] = + (char)(0x80u | ((codepoint >> 6) & 0x3fu)); /* 10xxxxxx. */ + data[bytes_written++] = + (char)(0x80u | (codepoint & 0x3fu)); /* 10xxxxxx. */ + } else { + /* we assume the value was validated and thus is within the valid + * range. */ + data[bytes_written++] = + (char)(0xe0u | (codepoint >> 12)); /* 1110xxxx. */ + data[bytes_written++] = + (char)(0x80u | ((codepoint >> 6) & 0x3fu)); /* 10xxxxxx. */ + data[bytes_written++] = + (char)(0x80u | (codepoint & 0x3fu)); /* 10xxxxxx. */ + } + } break; + case '"': + data[bytes_written++] = '"'; + break; + case '\\': + data[bytes_written++] = '\\'; + break; + case '/': + data[bytes_written++] = '/'; + break; + case 'b': + data[bytes_written++] = '\b'; + break; + case 'f': + data[bytes_written++] = '\f'; + break; + case 'n': + data[bytes_written++] = '\n'; + break; + case 'r': + data[bytes_written++] = '\r'; + break; + case 't': + data[bytes_written++] = '\t'; + break; + case '\r': + data[bytes_written++] = '\r'; + + /* check if we have a "\r\n" sequence. */ + if ('\n' == src[offset]) { + data[bytes_written++] = '\n'; + offset++; + } + + break; + case '\n': + data[bytes_written++] = '\n'; + break; + } + } else { + /* copy the character. */ + data[bytes_written++] = src[offset++]; + } + } + + /* skip trailing '"' or '\''. */ + offset++; + + /* record the size of the string. */ + string->string_size = bytes_written; + + /* add null terminator to string. */ + data[bytes_written++] = '\0'; + + /* move data along. */ + state->data += bytes_written; + + /* update offset. */ + state->offset = offset; +} + +json_weak void json_parse_key(struct json_parse_state_s *state, + struct json_string_s *string); +void json_parse_key(struct json_parse_state_s *state, + struct json_string_s *string) { + if (json_parse_flags_allow_unquoted_keys & state->flags_bitset) { + const char *const src = state->src; + char *const data = state->data; + size_t offset = state->offset; + + /* if we are allowing unquoted keys, check for quoted anyway... */ + if (('"' == src[offset]) || ('\'' == src[offset])) { + /* ... if we got a quote, just parse the key as a string as normal. */ + json_parse_string(state, string); + } else { + size_t size = 0; + + string->string = state->data; + + while (is_valid_unquoted_key_char(src[offset])) { + data[size++] = src[offset++]; + } + + /* add null terminator to string. */ + data[size] = '\0'; + + /* record the size of the string. */ + string->string_size = size++; + + /* move data along. */ + state->data += size; + + /* update offset. */ + state->offset = offset; + } + } else { + /* we are only allowed to have quoted keys, so just parse a string! */ + json_parse_string(state, string); + } +} + +json_weak void json_parse_object(struct json_parse_state_s *state, + int is_global_object, + struct json_object_s *object); +void json_parse_object(struct json_parse_state_s *state, int is_global_object, + struct json_object_s *object) { + const size_t flags_bitset = state->flags_bitset; + const size_t size = state->size; + const char *const src = state->src; + size_t elements = 0; + int allow_comma = 0; + struct json_object_element_s *previous = json_null; + + if (is_global_object) { + /* if we skipped some whitespace, and then found an opening '{' of an. */ + /* object, we actually have a normal JSON object at the root of the DOM... + */ + if ('{' == src[state->offset]) { + /* . and we don't actually have a global object after all! */ + is_global_object = 0; + } + } + + if (!is_global_object) { + /* skip leading '{'. */ + state->offset++; + } + + (void)json_skip_all_skippables(state); + + /* reset elements. */ + elements = 0; + + while (state->offset < size) { + struct json_object_element_s *element = json_null; + struct json_string_s *string = json_null; + struct json_value_s *value = json_null; + + if (!is_global_object) { + (void)json_skip_all_skippables(state); + + if ('}' == src[state->offset]) { + /* skip trailing '}'. */ + state->offset++; + + /* finished the object! */ + break; + } + } else { + if (json_skip_all_skippables(state)) { + /* global object ends when the file ends! */ + break; + } + } + + /* if we parsed at least one element previously, grok for a comma. */ + if (allow_comma) { + if (',' == src[state->offset]) { + /* skip comma. */ + state->offset++; + allow_comma = 0; + continue; + } + } + + element = (struct json_object_element_s *)state->dom; + + state->dom += sizeof(struct json_object_element_s); + + if (json_null == previous) { + /* this is our first element, so record it in our object. */ + object->start = element; + } else { + previous->next = element; + } + + previous = element; + + if (json_parse_flags_allow_location_information & flags_bitset) { + struct json_string_ex_s *string_ex = + (struct json_string_ex_s *)state->dom; + state->dom += sizeof(struct json_string_ex_s); + + string_ex->offset = state->offset; + string_ex->line_no = state->line_no; + string_ex->row_no = state->offset - state->line_offset; + + string = &(string_ex->string); + } else { + string = (struct json_string_s *)state->dom; + state->dom += sizeof(struct json_string_s); + } + + element->name = string; + + (void)json_parse_key(state, string); + + (void)json_skip_all_skippables(state); + + /* skip colon or equals. */ + state->offset++; + + (void)json_skip_all_skippables(state); + + if (json_parse_flags_allow_location_information & flags_bitset) { + struct json_value_ex_s *value_ex = (struct json_value_ex_s *)state->dom; + state->dom += sizeof(struct json_value_ex_s); + + value_ex->offset = state->offset; + value_ex->line_no = state->line_no; + value_ex->row_no = state->offset - state->line_offset; + + value = &(value_ex->value); + } else { + value = (struct json_value_s *)state->dom; + state->dom += sizeof(struct json_value_s); + } + + element->value = value; + + json_parse_value(state, /* is_global_object = */ 0, value); + + /* successfully parsed a name/value pair! */ + elements++; + allow_comma = 1; + } + + /* if we had at least one element, end the linked list. */ + if (previous) { + previous->next = json_null; + } + + if (0 == elements) { + object->start = json_null; + } + + object->length = elements; +} + +json_weak void json_parse_array(struct json_parse_state_s *state, + struct json_array_s *array); +void json_parse_array(struct json_parse_state_s *state, + struct json_array_s *array) { + const char *const src = state->src; + const size_t size = state->size; + size_t elements = 0; + int allow_comma = 0; + struct json_array_element_s *previous = json_null; + + /* skip leading '['. */ + state->offset++; + + (void)json_skip_all_skippables(state); + + /* reset elements. */ + elements = 0; + + do { + struct json_array_element_s *element = json_null; + struct json_value_s *value = json_null; + + (void)json_skip_all_skippables(state); + + if (']' == src[state->offset]) { + /* skip trailing ']'. */ + state->offset++; + + /* finished the array! */ + break; + } + + /* if we parsed at least one element previously, grok for a comma. */ + if (allow_comma) { + if (',' == src[state->offset]) { + /* skip comma. */ + state->offset++; + allow_comma = 0; + continue; + } + } + + element = (struct json_array_element_s *)state->dom; + + state->dom += sizeof(struct json_array_element_s); + + if (json_null == previous) { + /* this is our first element, so record it in our array. */ + array->start = element; + } else { + previous->next = element; + } + + previous = element; + + if (json_parse_flags_allow_location_information & state->flags_bitset) { + struct json_value_ex_s *value_ex = (struct json_value_ex_s *)state->dom; + state->dom += sizeof(struct json_value_ex_s); + + value_ex->offset = state->offset; + value_ex->line_no = state->line_no; + value_ex->row_no = state->offset - state->line_offset; + + value = &(value_ex->value); + } else { + value = (struct json_value_s *)state->dom; + state->dom += sizeof(struct json_value_s); + } + + element->value = value; + + json_parse_value(state, /* is_global_object = */ 0, value); + + /* successfully parsed an array element! */ + elements++; + allow_comma = 1; + } while (state->offset < size); + + /* end the linked list. */ + if (previous) { + previous->next = json_null; + } + + if (0 == elements) { + array->start = json_null; + } + + array->length = elements; +} + +json_weak void json_parse_number(struct json_parse_state_s *state, + struct json_number_s *number); +void json_parse_number(struct json_parse_state_s *state, + struct json_number_s *number) { + const size_t flags_bitset = state->flags_bitset; + size_t offset = state->offset; + const size_t size = state->size; + size_t bytes_written = 0; + const char *const src = state->src; + char *data = state->data; + + number->number = data; + + if (json_parse_flags_allow_hexadecimal_numbers & flags_bitset) { + if (('0' == src[offset]) && + (('x' == src[offset + 1]) || ('X' == src[offset + 1]))) { + /* consume hexadecimal digits. */ + while ((offset < size) && + (('0' <= src[offset] && src[offset] <= '9') || + ('a' <= src[offset] && src[offset] <= 'f') || + ('A' <= src[offset] && src[offset] <= 'F') || + ('x' == src[offset]) || ('X' == src[offset]))) { + data[bytes_written++] = src[offset++]; + } + } + } + + while (offset < size) { + int end = 0; + + switch (src[offset]) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '.': + case 'e': + case 'E': + case '+': + case '-': + data[bytes_written++] = src[offset++]; + break; + default: + end = 1; + break; + } + + if (0 != end) { + break; + } + } + + if (json_parse_flags_allow_inf_and_nan & flags_bitset) { + const size_t inf_strlen = 8; /* = strlen("Infinity");. */ + const size_t nan_strlen = 3; /* = strlen("NaN");. */ + + if (offset + inf_strlen < size) { + if ('I' == src[offset]) { + size_t i; + /* We found our special 'Infinity' keyword! */ + for (i = 0; i < inf_strlen; i++) { + data[bytes_written++] = src[offset++]; + } + } + } + + if (offset + nan_strlen < size) { + if ('N' == src[offset]) { + size_t i; + /* We found our special 'NaN' keyword! */ + for (i = 0; i < nan_strlen; i++) { + data[bytes_written++] = src[offset++]; + } + } + } + } + + /* record the size of the number. */ + number->number_size = bytes_written; + /* add null terminator to number string. */ + data[bytes_written++] = '\0'; + /* move data along. */ + state->data += bytes_written; + /* update offset. */ + state->offset = offset; +} + +json_weak void json_parse_value(struct json_parse_state_s *state, + int is_global_object, + struct json_value_s *value); +void json_parse_value(struct json_parse_state_s *state, int is_global_object, + struct json_value_s *value) { + const size_t flags_bitset = state->flags_bitset; + const char *const src = state->src; + const size_t size = state->size; + size_t offset; + + (void)json_skip_all_skippables(state); + + /* cache offset now. */ + offset = state->offset; + + if (is_global_object) { + value->type = json_type_object; + value->payload = state->dom; + state->dom += sizeof(struct json_object_s); + json_parse_object(state, /* is_global_object = */ 1, + (struct json_object_s *)value->payload); + } else { + switch (src[offset]) { + case '"': + case '\'': + value->type = json_type_string; + value->payload = state->dom; + state->dom += sizeof(struct json_string_s); + json_parse_string(state, (struct json_string_s *)value->payload); + break; + case '{': + value->type = json_type_object; + value->payload = state->dom; + state->dom += sizeof(struct json_object_s); + json_parse_object(state, /* is_global_object = */ 0, + (struct json_object_s *)value->payload); + break; + case '[': + value->type = json_type_array; + value->payload = state->dom; + state->dom += sizeof(struct json_array_s); + json_parse_array(state, (struct json_array_s *)value->payload); + break; + case '-': + case '+': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '.': + value->type = json_type_number; + value->payload = state->dom; + state->dom += sizeof(struct json_number_s); + json_parse_number(state, (struct json_number_s *)value->payload); + break; + default: + if ((offset + 4) <= size && 't' == src[offset + 0] && + 'r' == src[offset + 1] && 'u' == src[offset + 2] && + 'e' == src[offset + 3]) { + value->type = json_type_true; + value->payload = json_null; + state->offset += 4; + } else if ((offset + 5) <= size && 'f' == src[offset + 0] && + 'a' == src[offset + 1] && 'l' == src[offset + 2] && + 's' == src[offset + 3] && 'e' == src[offset + 4]) { + value->type = json_type_false; + value->payload = json_null; + state->offset += 5; + } else if ((offset + 4) <= size && 'n' == src[offset + 0] && + 'u' == src[offset + 1] && 'l' == src[offset + 2] && + 'l' == src[offset + 3]) { + value->type = json_type_null; + value->payload = json_null; + state->offset += 4; + } else if ((json_parse_flags_allow_inf_and_nan & flags_bitset) && + (offset + 3) <= size && 'N' == src[offset + 0] && + 'a' == src[offset + 1] && 'N' == src[offset + 2]) { + value->type = json_type_number; + value->payload = state->dom; + state->dom += sizeof(struct json_number_s); + json_parse_number(state, (struct json_number_s *)value->payload); + } else if ((json_parse_flags_allow_inf_and_nan & flags_bitset) && + (offset + 8) <= size && 'I' == src[offset + 0] && + 'n' == src[offset + 1] && 'f' == src[offset + 2] && + 'i' == src[offset + 3] && 'n' == src[offset + 4] && + 'i' == src[offset + 5] && 't' == src[offset + 6] && + 'y' == src[offset + 7]) { + value->type = json_type_number; + value->payload = state->dom; + state->dom += sizeof(struct json_number_s); + json_parse_number(state, (struct json_number_s *)value->payload); + } + break; + } + } +} + +struct json_value_s * +json_parse_ex(const void *src, size_t src_size, size_t flags_bitset, + void *(*alloc_func_ptr)(void *user_data, size_t size), + void *user_data, struct json_parse_result_s *result) { + struct json_parse_state_s state; + void *allocation; + struct json_value_s *value; + size_t total_size; + int input_error; + + if (result) { + result->error = json_parse_error_none; + result->error_offset = 0; + result->error_line_no = 0; + result->error_row_no = 0; + } + + if (json_null == src) { + /* invalid src pointer was null! */ + return json_null; + } + + state.src = (const char *)src; + state.size = src_size; + state.offset = 0; + state.line_no = 1; + state.line_offset = 0; + state.error = json_parse_error_none; + state.dom_size = 0; + state.data_size = 0; + state.flags_bitset = flags_bitset; + state.recursion = 0; + + input_error = json_get_value_size( + &state, (int)(json_parse_flags_allow_global_object & state.flags_bitset)); + + if (0 == input_error) { + json_skip_all_skippables(&state); + + if (state.offset != state.size) { + /* our parsing didn't have an error, but there are characters remaining in + * the input that weren't part of the JSON! */ + + state.error = json_parse_error_unexpected_trailing_characters; + input_error = 1; + } + } + + if (input_error) { + /* parsing value's size failed (most likely an invalid JSON DOM!). */ + if (result) { + result->error = state.error; + result->error_offset = state.offset; + result->error_line_no = state.line_no; + result->error_row_no = state.offset - state.line_offset; + } + return json_null; + } + + /* our total allocation is the combination of the dom and data sizes (we. */ + /* first encode the structure of the JSON, and then the data referenced by. */ + /* the JSON values). */ + total_size = state.dom_size + state.data_size; + + if (json_null == alloc_func_ptr) { + allocation = malloc(total_size); + } else { + allocation = alloc_func_ptr(user_data, total_size); + } + + if (json_null == allocation) { + /* malloc failed! */ + if (result) { + result->error = json_parse_error_allocator_failed; + result->error_offset = 0; + result->error_line_no = 0; + result->error_row_no = 0; + } + + return json_null; + } + + /* reset offset so we can reuse it. */ + state.offset = 0; + + /* reset the line information so we can reuse it. */ + state.line_no = 1; + state.line_offset = 0; + + state.dom = (char *)allocation; + state.data = state.dom + state.dom_size; + + if (json_parse_flags_allow_location_information & state.flags_bitset) { + struct json_value_ex_s *value_ex = (struct json_value_ex_s *)state.dom; + state.dom += sizeof(struct json_value_ex_s); + + value_ex->offset = state.offset; + value_ex->line_no = state.line_no; + value_ex->row_no = state.offset - state.line_offset; + + value = &(value_ex->value); + } else { + value = (struct json_value_s *)state.dom; + state.dom += sizeof(struct json_value_s); + } + + json_parse_value( + &state, (int)(json_parse_flags_allow_global_object & state.flags_bitset), + value); + + return (struct json_value_s *)allocation; +} + +struct json_value_s *json_parse(const void *src, size_t src_size) { + return json_parse_ex(src, src_size, json_parse_flags_default, json_null, + json_null, json_null); +} + +struct json_extract_result_s { + size_t dom_size; + size_t data_size; +}; + +struct json_value_s *json_extract_value(const struct json_value_s *value) { + return json_extract_value_ex(value, json_null, json_null); +} + +json_weak struct json_extract_result_s +json_extract_get_number_size(const struct json_number_s *const number); +json_weak struct json_extract_result_s +json_extract_get_string_size(const struct json_string_s *const string); +json_weak struct json_extract_result_s +json_extract_get_object_size(const struct json_object_s *const object); +json_weak struct json_extract_result_s +json_extract_get_array_size(const struct json_array_s *const array); +json_weak struct json_extract_result_s +json_extract_get_value_size(const struct json_value_s *const value); + +struct json_extract_result_s +json_extract_get_number_size(const struct json_number_s *const number) { + struct json_extract_result_s result; + result.dom_size = sizeof(struct json_number_s); + result.data_size = number->number_size; + return result; +} + +struct json_extract_result_s +json_extract_get_string_size(const struct json_string_s *const string) { + struct json_extract_result_s result; + result.dom_size = sizeof(struct json_string_s); + result.data_size = string->string_size + 1; + return result; +} + +struct json_extract_result_s +json_extract_get_object_size(const struct json_object_s *const object) { + struct json_extract_result_s result; + size_t i; + const struct json_object_element_s *element = object->start; + + result.dom_size = sizeof(struct json_object_s) + + (sizeof(struct json_object_element_s) * object->length); + result.data_size = 0; + + for (i = 0; i < object->length; i++) { + const struct json_extract_result_s string_result = + json_extract_get_string_size(element->name); + const struct json_extract_result_s value_result = + json_extract_get_value_size(element->value); + + result.dom_size += string_result.dom_size; + result.data_size += string_result.data_size; + + result.dom_size += value_result.dom_size; + result.data_size += value_result.data_size; + + element = element->next; + } + + return result; +} + +struct json_extract_result_s +json_extract_get_array_size(const struct json_array_s *const array) { + struct json_extract_result_s result; + size_t i; + const struct json_array_element_s *element = array->start; + + result.dom_size = sizeof(struct json_array_s) + + (sizeof(struct json_array_element_s) * array->length); + result.data_size = 0; + + for (i = 0; i < array->length; i++) { + const struct json_extract_result_s value_result = + json_extract_get_value_size(element->value); + + result.dom_size += value_result.dom_size; + result.data_size += value_result.data_size; + + element = element->next; + } + + return result; +} + +struct json_extract_result_s +json_extract_get_value_size(const struct json_value_s *const value) { + struct json_extract_result_s result = {0, 0}; + + switch (value->type) { + default: + break; + case json_type_object: + result = json_extract_get_object_size( + (const struct json_object_s *)value->payload); + break; + case json_type_array: + result = json_extract_get_array_size( + (const struct json_array_s *)value->payload); + break; + case json_type_number: + result = json_extract_get_number_size( + (const struct json_number_s *)value->payload); + break; + case json_type_string: + result = json_extract_get_string_size( + (const struct json_string_s *)value->payload); + break; + } + + result.dom_size += sizeof(struct json_value_s); + + return result; +} + +struct json_extract_state_s { + char *dom; + char *data; +}; + +json_weak void json_extract_copy_value(struct json_extract_state_s *const state, + const struct json_value_s *const value); +void json_extract_copy_value(struct json_extract_state_s *const state, + const struct json_value_s *const value) { + struct json_string_s *string; + struct json_number_s *number; + struct json_object_s *object; + struct json_array_s *array; + struct json_value_s *new_value; + + memcpy(state->dom, value, sizeof(struct json_value_s)); + new_value = (struct json_value_s *)state->dom; + state->dom += sizeof(struct json_value_s); + new_value->payload = state->dom; + + if (json_type_string == value->type) { + memcpy(state->dom, value->payload, sizeof(struct json_string_s)); + string = (struct json_string_s *)state->dom; + state->dom += sizeof(struct json_string_s); + + memcpy(state->data, string->string, string->string_size + 1); + string->string = state->data; + state->data += string->string_size + 1; + } else if (json_type_number == value->type) { + memcpy(state->dom, value->payload, sizeof(struct json_number_s)); + number = (struct json_number_s *)state->dom; + state->dom += sizeof(struct json_number_s); + + memcpy(state->data, number->number, number->number_size); + number->number = state->data; + state->data += number->number_size; + } else if (json_type_object == value->type) { + struct json_object_element_s *element; + size_t i; + + memcpy(state->dom, value->payload, sizeof(struct json_object_s)); + object = (struct json_object_s *)state->dom; + state->dom += sizeof(struct json_object_s); + + element = object->start; + object->start = (struct json_object_element_s *)state->dom; + + for (i = 0; i < object->length; i++) { + struct json_value_s *previous_value; + struct json_object_element_s *previous_element; + + memcpy(state->dom, element, sizeof(struct json_object_element_s)); + element = (struct json_object_element_s *)state->dom; + state->dom += sizeof(struct json_object_element_s); + + string = element->name; + memcpy(state->dom, string, sizeof(struct json_string_s)); + string = (struct json_string_s *)state->dom; + state->dom += sizeof(struct json_string_s); + element->name = string; + + memcpy(state->data, string->string, string->string_size + 1); + string->string = state->data; + state->data += string->string_size + 1; + + previous_value = element->value; + element->value = (struct json_value_s *)state->dom; + json_extract_copy_value(state, previous_value); + + previous_element = element; + element = element->next; + + if (element) { + previous_element->next = (struct json_object_element_s *)state->dom; + } + } + } else if (json_type_array == value->type) { + struct json_array_element_s *element; + size_t i; + + memcpy(state->dom, value->payload, sizeof(struct json_array_s)); + array = (struct json_array_s *)state->dom; + state->dom += sizeof(struct json_array_s); + + element = array->start; + array->start = (struct json_array_element_s *)state->dom; + + for (i = 0; i < array->length; i++) { + struct json_value_s *previous_value; + struct json_array_element_s *previous_element; + + memcpy(state->dom, element, sizeof(struct json_array_element_s)); + element = (struct json_array_element_s *)state->dom; + state->dom += sizeof(struct json_array_element_s); + + previous_value = element->value; + element->value = (struct json_value_s *)state->dom; + json_extract_copy_value(state, previous_value); + + previous_element = element; + element = element->next; + + if (element) { + previous_element->next = (struct json_array_element_s *)state->dom; + } + } + } +} + +struct json_value_s *json_extract_value_ex(const struct json_value_s *value, + void *(*alloc_func_ptr)(void *, + size_t), + void *user_data) { + void *allocation; + struct json_extract_result_s result; + struct json_extract_state_s state; + size_t total_size; + + if (json_null == value) { + /* invalid value was null! */ + return json_null; + } + + result = json_extract_get_value_size(value); + total_size = result.dom_size + result.data_size; + + if (json_null == alloc_func_ptr) { + allocation = malloc(total_size); + } else { + allocation = alloc_func_ptr(user_data, total_size); + } + + state.dom = (char *)allocation; + state.data = state.dom + result.dom_size; + + json_extract_copy_value(&state, value); + + return (struct json_value_s *)allocation; +} + +struct json_string_s *json_value_as_string(struct json_value_s *const value) { + if (value->type != json_type_string) { + return json_null; + } + + return (struct json_string_s *)value->payload; +} + +struct json_number_s *json_value_as_number(struct json_value_s *const value) { + if (value->type != json_type_number) { + return json_null; + } + + return (struct json_number_s *)value->payload; +} + +struct json_object_s *json_value_as_object(struct json_value_s *const value) { + if (value->type != json_type_object) { + return json_null; + } + + return (struct json_object_s *)value->payload; +} + +struct json_array_s *json_value_as_array(struct json_value_s *const value) { + if (value->type != json_type_array) { + return json_null; + } + + return (struct json_array_s *)value->payload; +} + +int json_value_is_true(const struct json_value_s *const value) { + return value->type == json_type_true; +} + +int json_value_is_false(const struct json_value_s *const value) { + return value->type == json_type_false; +} + +int json_value_is_null(const struct json_value_s *const value) { + return value->type == json_type_null; +} + +json_weak int +json_write_minified_get_value_size(const struct json_value_s *value, + size_t *size); + +json_weak int json_write_get_number_size(const struct json_number_s *number, + size_t *size); +int json_write_get_number_size(const struct json_number_s *number, + size_t *size) { + json_uintmax_t parsed_number; + size_t i; + + if (number->number_size >= 2) { + switch (number->number[1]) { + default: + break; + case 'x': + case 'X': + /* the number is a json_parse_flags_allow_hexadecimal_numbers hexadecimal + * so we have to do extra work to convert it to a non-hexadecimal for JSON + * output. */ + parsed_number = json_strtoumax(number->number, json_null, 0); + + i = 0; + + while (0 != parsed_number) { + parsed_number /= 10; + i++; + } + + *size += i; + return 0; + } + } + + /* check to see if the number has leading/trailing decimal point. */ + i = 0; + + /* skip any leading '+' or '-'. */ + if ((i < number->number_size) && + (('+' == number->number[i]) || ('-' == number->number[i]))) { + i++; + } + + /* check if we have infinity. */ + if ((i < number->number_size) && ('I' == number->number[i])) { + const char *inf = "Infinity"; + size_t k; + + for (k = i; k < number->number_size; k++) { + const char c = *inf++; + + /* Check if we found the Infinity string! */ + if ('\0' == c) { + break; + } else if (c != number->number[k]) { + break; + } + } + + if ('\0' == *inf) { + /* Inf becomes 1.7976931348623158e308 because JSON can't support it. */ + *size += 22; + + /* if we had a leading '-' we need to record it in the JSON output. */ + if ('-' == number->number[0]) { + *size += 1; + } + } + + return 0; + } + + /* check if we have nan. */ + if ((i < number->number_size) && ('N' == number->number[i])) { + const char *nan = "NaN"; + size_t k; + + for (k = i; k < number->number_size; k++) { + const char c = *nan++; + + /* Check if we found the NaN string! */ + if ('\0' == c) { + break; + } else if (c != number->number[k]) { + break; + } + } + + if ('\0' == *nan) { + /* NaN becomes 1 because JSON can't support it. */ + *size += 1; + + return 0; + } + } + + /* if we had a leading decimal point. */ + if ((i < number->number_size) && ('.' == number->number[i])) { + /* 1 + because we had a leading decimal point. */ + *size += 1; + goto cleanup; + } + + for (; i < number->number_size; i++) { + const char c = number->number[i]; + if (!('0' <= c && c <= '9')) { + break; + } + } + + /* if we had a trailing decimal point. */ + if ((i + 1 == number->number_size) && ('.' == number->number[i])) { + /* 1 + because we had a trailing decimal point. */ + *size += 1; + goto cleanup; + } + +cleanup: + *size += number->number_size; /* the actual string of the number. */ + + /* if we had a leading '+' we don't record it in the JSON output. */ + if ('+' == number->number[0]) { + *size -= 1; + } + + return 0; +} + +json_weak int json_write_get_string_size(const struct json_string_s *string, + size_t *size); +int json_write_get_string_size(const struct json_string_s *string, + size_t *size) { + size_t i; + for (i = 0; i < string->string_size; i++) { + switch (string->string[i]) { + case '"': + case '\\': + case '\b': + case '\f': + case '\n': + case '\r': + case '\t': + *size += 2; + break; + default: + *size += 1; + break; + } + } + + *size += 2; /* need to encode the surrounding '"' characters. */ + + return 0; +} + +json_weak int +json_write_minified_get_array_size(const struct json_array_s *array, + size_t *size); +int json_write_minified_get_array_size(const struct json_array_s *array, + size_t *size) { + struct json_array_element_s *element; + + *size += 2; /* '[' and ']'. */ + + if (1 < array->length) { + *size += array->length - 1; /* ','s seperate each element. */ + } + + for (element = array->start; json_null != element; element = element->next) { + if (json_write_minified_get_value_size(element->value, size)) { + /* value was malformed! */ + return 1; + } + } + + return 0; +} + +json_weak int +json_write_minified_get_object_size(const struct json_object_s *object, + size_t *size); +int json_write_minified_get_object_size(const struct json_object_s *object, + size_t *size) { + struct json_object_element_s *element; + + *size += 2; /* '{' and '}'. */ + + *size += object->length; /* ':'s seperate each name/value pair. */ + + if (1 < object->length) { + *size += object->length - 1; /* ','s seperate each element. */ + } + + for (element = object->start; json_null != element; element = element->next) { + if (json_write_get_string_size(element->name, size)) { + /* string was malformed! */ + return 1; + } + + if (json_write_minified_get_value_size(element->value, size)) { + /* value was malformed! */ + return 1; + } + } + + return 0; +} + +json_weak int +json_write_minified_get_value_size(const struct json_value_s *value, + size_t *size); +int json_write_minified_get_value_size(const struct json_value_s *value, + size_t *size) { + switch (value->type) { + default: + /* unknown value type found! */ + return 1; + case json_type_number: + return json_write_get_number_size((struct json_number_s *)value->payload, + size); + case json_type_string: + return json_write_get_string_size((struct json_string_s *)value->payload, + size); + case json_type_array: + return json_write_minified_get_array_size( + (struct json_array_s *)value->payload, size); + case json_type_object: + return json_write_minified_get_object_size( + (struct json_object_s *)value->payload, size); + case json_type_true: + *size += 4; /* the string "true". */ + return 0; + case json_type_false: + *size += 5; /* the string "false". */ + return 0; + case json_type_null: + *size += 4; /* the string "null". */ + return 0; + } +} + +json_weak char *json_write_minified_value(const struct json_value_s *value, + char *data); + +json_weak char *json_write_number(const struct json_number_s *number, + char *data); +char *json_write_number(const struct json_number_s *number, char *data) { + json_uintmax_t parsed_number, backup; + size_t i; + + if (number->number_size >= 2) { + switch (number->number[1]) { + default: + break; + case 'x': + case 'X': + /* The number is a json_parse_flags_allow_hexadecimal_numbers hexadecimal + * so we have to do extra work to convert it to a non-hexadecimal for JSON + * output. */ + parsed_number = json_strtoumax(number->number, json_null, 0); + + /* We need a copy of parsed number twice, so take a backup of it. */ + backup = parsed_number; + + i = 0; + + while (0 != parsed_number) { + parsed_number /= 10; + i++; + } + + /* Restore parsed_number to its original value stored in the backup. */ + parsed_number = backup; + + /* Now use backup to take a copy of i, or the length of the string. */ + backup = i; + + do { + *(data + i - 1) = '0' + (char)(parsed_number % 10); + parsed_number /= 10; + i--; + } while (0 != parsed_number); + + data += backup; + + return data; + } + } + + /* check to see if the number has leading/trailing decimal point. */ + i = 0; + + /* skip any leading '-'. */ + if ((i < number->number_size) && + (('+' == number->number[i]) || ('-' == number->number[i]))) { + i++; + } + + /* check if we have infinity. */ + if ((i < number->number_size) && ('I' == number->number[i])) { + const char *inf = "Infinity"; + size_t k; + + for (k = i; k < number->number_size; k++) { + const char c = *inf++; + + /* Check if we found the Infinity string! */ + if ('\0' == c) { + break; + } else if (c != number->number[k]) { + break; + } + } + + if ('\0' == *inf++) { + const char *dbl_max; + + /* if we had a leading '-' we need to record it in the JSON output. */ + if ('-' == number->number[0]) { + *data++ = '-'; + } + + /* Inf becomes 1.7976931348623158e308 because JSON can't support it. */ + for (dbl_max = "1.7976931348623158e308"; '\0' != *dbl_max; dbl_max++) { + *data++ = *dbl_max; + } + + return data; + } + } + + /* check if we have nan. */ + if ((i < number->number_size) && ('N' == number->number[i])) { + const char *nan = "NaN"; + size_t k; + + for (k = i; k < number->number_size; k++) { + const char c = *nan++; + + /* Check if we found the NaN string! */ + if ('\0' == c) { + break; + } else if (c != number->number[k]) { + break; + } + } + + if ('\0' == *nan++) { + /* NaN becomes 0 because JSON can't support it. */ + *data++ = '0'; + return data; + } + } + + /* if we had a leading decimal point. */ + if ((i < number->number_size) && ('.' == number->number[i])) { + i = 0; + + /* skip any leading '+'. */ + if ('+' == number->number[i]) { + i++; + } + + /* output the leading '-' if we had one. */ + if ('-' == number->number[i]) { + *data++ = '-'; + i++; + } + + /* insert a '0' to fix the leading decimal point for JSON output. */ + *data++ = '0'; + + /* and output the rest of the number as normal. */ + for (; i < number->number_size; i++) { + *data++ = number->number[i]; + } + + return data; + } + + for (; i < number->number_size; i++) { + const char c = number->number[i]; + if (!('0' <= c && c <= '9')) { + break; + } + } + + /* if we had a trailing decimal point. */ + if ((i + 1 == number->number_size) && ('.' == number->number[i])) { + i = 0; + + /* skip any leading '+'. */ + if ('+' == number->number[i]) { + i++; + } + + /* output the leading '-' if we had one. */ + if ('-' == number->number[i]) { + *data++ = '-'; + i++; + } + + /* and output the rest of the number as normal. */ + for (; i < number->number_size; i++) { + *data++ = number->number[i]; + } + + /* insert a '0' to fix the trailing decimal point for JSON output. */ + *data++ = '0'; + + return data; + } + + i = 0; + + /* skip any leading '+'. */ + if ('+' == number->number[i]) { + i++; + } + + for (; i < number->number_size; i++) { + *data++ = number->number[i]; + } + + return data; +} + +json_weak char *json_write_string(const struct json_string_s *string, + char *data); +char *json_write_string(const struct json_string_s *string, char *data) { + size_t i; + + *data++ = '"'; /* open the string. */ + + for (i = 0; i < string->string_size; i++) { + switch (string->string[i]) { + case '"': + *data++ = '\\'; /* escape the control character. */ + *data++ = '"'; + break; + case '\\': + *data++ = '\\'; /* escape the control character. */ + *data++ = '\\'; + break; + case '\b': + *data++ = '\\'; /* escape the control character. */ + *data++ = 'b'; + break; + case '\f': + *data++ = '\\'; /* escape the control character. */ + *data++ = 'f'; + break; + case '\n': + *data++ = '\\'; /* escape the control character. */ + *data++ = 'n'; + break; + case '\r': + *data++ = '\\'; /* escape the control character. */ + *data++ = 'r'; + break; + case '\t': + *data++ = '\\'; /* escape the control character. */ + *data++ = 't'; + break; + default: + *data++ = string->string[i]; + break; + } + } + + *data++ = '"'; /* close the string. */ + + return data; +} + +json_weak char *json_write_minified_array(const struct json_array_s *array, + char *data); +char *json_write_minified_array(const struct json_array_s *array, char *data) { + struct json_array_element_s *element = json_null; + + *data++ = '['; /* open the array. */ + + for (element = array->start; json_null != element; element = element->next) { + if (element != array->start) { + *data++ = ','; /* ','s seperate each element. */ + } + + data = json_write_minified_value(element->value, data); + + if (json_null == data) { + /* value was malformed! */ + return json_null; + } + } + + *data++ = ']'; /* close the array. */ + + return data; +} + +json_weak char *json_write_minified_object(const struct json_object_s *object, + char *data); +char *json_write_minified_object(const struct json_object_s *object, + char *data) { + struct json_object_element_s *element = json_null; + + *data++ = '{'; /* open the object. */ + + for (element = object->start; json_null != element; element = element->next) { + if (element != object->start) { + *data++ = ','; /* ','s seperate each element. */ + } + + data = json_write_string(element->name, data); + + if (json_null == data) { + /* string was malformed! */ + return json_null; + } + + *data++ = ':'; /* ':'s seperate each name/value pair. */ + + data = json_write_minified_value(element->value, data); + + if (json_null == data) { + /* value was malformed! */ + return json_null; + } + } + + *data++ = '}'; /* close the object. */ + + return data; +} + +json_weak char *json_write_minified_value(const struct json_value_s *value, + char *data); +char *json_write_minified_value(const struct json_value_s *value, char *data) { + switch (value->type) { + default: + /* unknown value type found! */ + return json_null; + case json_type_number: + return json_write_number((struct json_number_s *)value->payload, data); + case json_type_string: + return json_write_string((struct json_string_s *)value->payload, data); + case json_type_array: + return json_write_minified_array((struct json_array_s *)value->payload, + data); + case json_type_object: + return json_write_minified_object((struct json_object_s *)value->payload, + data); + case json_type_true: + data[0] = 't'; + data[1] = 'r'; + data[2] = 'u'; + data[3] = 'e'; + return data + 4; + case json_type_false: + data[0] = 'f'; + data[1] = 'a'; + data[2] = 'l'; + data[3] = 's'; + data[4] = 'e'; + return data + 5; + case json_type_null: + data[0] = 'n'; + data[1] = 'u'; + data[2] = 'l'; + data[3] = 'l'; + return data + 4; + } +} + +void *json_write_minified(const struct json_value_s *value, size_t *out_size) { + size_t size = 0; + char *data = json_null; + char *data_end = json_null; + + if (json_null == value) { + return json_null; + } + + if (json_write_minified_get_value_size(value, &size)) { + /* value was malformed! */ + return json_null; + } + + size += 1; /* for the '\0' null terminating character. */ + + data = (char *)malloc(size); + + if (json_null == data) { + /* malloc failed! */ + return json_null; + } + + data_end = json_write_minified_value(value, data); + + if (json_null == data_end) { + /* bad chi occurred! */ + free(data); + return json_null; + } + + /* null terminated the string. */ + *data_end = '\0'; + + if (json_null != out_size) { + *out_size = size; + } + + return data; +} + +json_weak int json_write_pretty_get_value_size(const struct json_value_s *value, + size_t depth, size_t indent_size, + size_t newline_size, + size_t *size); + +json_weak int json_write_pretty_get_array_size(const struct json_array_s *array, + size_t depth, size_t indent_size, + size_t newline_size, + size_t *size); +int json_write_pretty_get_array_size(const struct json_array_s *array, + size_t depth, size_t indent_size, + size_t newline_size, size_t *size) { + struct json_array_element_s *element; + + *size += 1; /* '['. */ + + if (0 < array->length) { + /* if we have any elements we need to add a newline after our '['. */ + *size += newline_size; + + *size += array->length - 1; /* ','s seperate each element. */ + + for (element = array->start; json_null != element; + element = element->next) { + /* each element gets an indent. */ + *size += (depth + 1) * indent_size; + + if (json_write_pretty_get_value_size(element->value, depth + 1, + indent_size, newline_size, size)) { + /* value was malformed! */ + return 1; + } + + /* each element gets a newline too. */ + *size += newline_size; + } + + /* since we wrote out some elements, need to add a newline and indentation. + */ + /* to the trailing ']'. */ + *size += depth * indent_size; + } + + *size += 1; /* ']'. */ + + return 0; +} + +json_weak int +json_write_pretty_get_object_size(const struct json_object_s *object, + size_t depth, size_t indent_size, + size_t newline_size, size_t *size); +int json_write_pretty_get_object_size(const struct json_object_s *object, + size_t depth, size_t indent_size, + size_t newline_size, size_t *size) { + struct json_object_element_s *element; + + *size += 1; /* '{'. */ + + if (0 < object->length) { + *size += newline_size; /* need a newline next. */ + + *size += object->length - 1; /* ','s seperate each element. */ + + for (element = object->start; json_null != element; + element = element->next) { + /* each element gets an indent and newline. */ + *size += (depth + 1) * indent_size; + *size += newline_size; + + if (json_write_get_string_size(element->name, size)) { + /* string was malformed! */ + return 1; + } + + *size += 3; /* seperate each name/value pair with " : ". */ + + if (json_write_pretty_get_value_size(element->value, depth + 1, + indent_size, newline_size, size)) { + /* value was malformed! */ + return 1; + } + } + + *size += depth * indent_size; + } + + *size += 1; /* '}'. */ + + return 0; +} + +json_weak int json_write_pretty_get_value_size(const struct json_value_s *value, + size_t depth, size_t indent_size, + size_t newline_size, + size_t *size); +int json_write_pretty_get_value_size(const struct json_value_s *value, + size_t depth, size_t indent_size, + size_t newline_size, size_t *size) { + switch (value->type) { + default: + /* unknown value type found! */ + return 1; + case json_type_number: + return json_write_get_number_size((struct json_number_s *)value->payload, + size); + case json_type_string: + return json_write_get_string_size((struct json_string_s *)value->payload, + size); + case json_type_array: + return json_write_pretty_get_array_size( + (struct json_array_s *)value->payload, depth, indent_size, newline_size, + size); + case json_type_object: + return json_write_pretty_get_object_size( + (struct json_object_s *)value->payload, depth, indent_size, + newline_size, size); + case json_type_true: + *size += 4; /* the string "true". */ + return 0; + case json_type_false: + *size += 5; /* the string "false". */ + return 0; + case json_type_null: + *size += 4; /* the string "null". */ + return 0; + } +} + +json_weak char *json_write_pretty_value(const struct json_value_s *value, + size_t depth, const char *indent, + const char *newline, char *data); + +json_weak char *json_write_pretty_array(const struct json_array_s *array, + size_t depth, const char *indent, + const char *newline, char *data); +char *json_write_pretty_array(const struct json_array_s *array, size_t depth, + const char *indent, const char *newline, + char *data) { + size_t k, m; + struct json_array_element_s *element; + + *data++ = '['; /* open the array. */ + + if (0 < array->length) { + for (k = 0; '\0' != newline[k]; k++) { + *data++ = newline[k]; + } + + for (element = array->start; json_null != element; + element = element->next) { + if (element != array->start) { + *data++ = ','; /* ','s seperate each element. */ + + for (k = 0; '\0' != newline[k]; k++) { + *data++ = newline[k]; + } + } + + for (k = 0; k < depth + 1; k++) { + for (m = 0; '\0' != indent[m]; m++) { + *data++ = indent[m]; + } + } + + data = json_write_pretty_value(element->value, depth + 1, indent, newline, + data); + + if (json_null == data) { + /* value was malformed! */ + return json_null; + } + } + + for (k = 0; '\0' != newline[k]; k++) { + *data++ = newline[k]; + } + + for (k = 0; k < depth; k++) { + for (m = 0; '\0' != indent[m]; m++) { + *data++ = indent[m]; + } + } + } + + *data++ = ']'; /* close the array. */ + + return data; +} + +json_weak char *json_write_pretty_object(const struct json_object_s *object, + size_t depth, const char *indent, + const char *newline, char *data); +char *json_write_pretty_object(const struct json_object_s *object, size_t depth, + const char *indent, const char *newline, + char *data) { + size_t k, m; + struct json_object_element_s *element; + + *data++ = '{'; /* open the object. */ + + if (0 < object->length) { + for (k = 0; '\0' != newline[k]; k++) { + *data++ = newline[k]; + } + + for (element = object->start; json_null != element; + element = element->next) { + if (element != object->start) { + *data++ = ','; /* ','s seperate each element. */ + + for (k = 0; '\0' != newline[k]; k++) { + *data++ = newline[k]; + } + } + + for (k = 0; k < depth + 1; k++) { + for (m = 0; '\0' != indent[m]; m++) { + *data++ = indent[m]; + } + } + + data = json_write_string(element->name, data); + + if (json_null == data) { + /* string was malformed! */ + return json_null; + } + + /* " : "s seperate each name/value pair. */ + *data++ = ' '; + *data++ = ':'; + *data++ = ' '; + + data = json_write_pretty_value(element->value, depth + 1, indent, newline, + data); + + if (json_null == data) { + /* value was malformed! */ + return json_null; + } + } + + for (k = 0; '\0' != newline[k]; k++) { + *data++ = newline[k]; + } + + for (k = 0; k < depth; k++) { + for (m = 0; '\0' != indent[m]; m++) { + *data++ = indent[m]; + } + } + } + + *data++ = '}'; /* close the object. */ + + return data; +} + +json_weak char *json_write_pretty_value(const struct json_value_s *value, + size_t depth, const char *indent, + const char *newline, char *data); +char *json_write_pretty_value(const struct json_value_s *value, size_t depth, + const char *indent, const char *newline, + char *data) { + switch (value->type) { + default: + /* unknown value type found! */ + return json_null; + case json_type_number: + return json_write_number((struct json_number_s *)value->payload, data); + case json_type_string: + return json_write_string((struct json_string_s *)value->payload, data); + case json_type_array: + return json_write_pretty_array((struct json_array_s *)value->payload, depth, + indent, newline, data); + case json_type_object: + return json_write_pretty_object((struct json_object_s *)value->payload, + depth, indent, newline, data); + case json_type_true: + data[0] = 't'; + data[1] = 'r'; + data[2] = 'u'; + data[3] = 'e'; + return data + 4; + case json_type_false: + data[0] = 'f'; + data[1] = 'a'; + data[2] = 'l'; + data[3] = 's'; + data[4] = 'e'; + return data + 5; + case json_type_null: + data[0] = 'n'; + data[1] = 'u'; + data[2] = 'l'; + data[3] = 'l'; + return data + 4; + } +} + +void *json_write_pretty(const struct json_value_s *value, const char *indent, + const char *newline, size_t *out_size) { + size_t size = 0; + size_t indent_size = 0; + size_t newline_size = 0; + char *data = json_null; + char *data_end = json_null; + + if (json_null == value) { + return json_null; + } + + if (json_null == indent) { + indent = " "; /* default to two spaces. */ + } + + if (json_null == newline) { + newline = "\n"; /* default to linux newlines. */ + } + + while ('\0' != indent[indent_size]) { + ++indent_size; /* skip non-null terminating characters. */ + } + + while ('\0' != newline[newline_size]) { + ++newline_size; /* skip non-null terminating characters. */ + } + + if (json_write_pretty_get_value_size(value, 0, indent_size, newline_size, + &size)) { + /* value was malformed! */ + return json_null; + } + + size += 1; /* for the '\0' null terminating character. */ + + data = (char *)malloc(size); + + if (json_null == data) { + /* malloc failed! */ + return json_null; + } + + data_end = json_write_pretty_value(value, 0, indent, newline, data); + + if (json_null == data_end) { + /* bad chi occurred! */ + free(data); + return json_null; + } + + /* null terminated the string. */ + *data_end = '\0'; + + if (json_null != out_size) { + *out_size = size; + } + + return data; +} + +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif + +#endif /* SHEREDOM_JSON_H_INCLUDED. */ \ No newline at end of file diff --git a/src/include/khash.h b/src/include/khash.h index 9d20a0e..15db67e 100644 --- a/src/include/khash.h +++ b/src/include/khash.h @@ -142,6 +142,7 @@ typedef unsigned long khint64_t; #else typedef unsigned long long khint64_t; #endif +typedef __uint128_t khint128_t; #ifdef _MSC_VER #define kh_inline __inline @@ -217,6 +218,22 @@ static const double __ac_HASH_UPPER = 0.77; h->size = h->n_occupied = 0; \ } \ } \ + SCOPE khint_t kh_hash_##name(khkey_t key) { \ + return __hash_func(key); \ + } \ + SCOPE khint_t kh_get_##name##_with_hash(const kh_##name##_t *h, khkey_t key, khint_t hash) { \ + if (h->n_buckets) { \ + khint_t k = hash, i, last, mask, step = 0; \ + mask = h->n_buckets - 1; \ + i = k & mask; \ + last = i; \ + while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \ + i = (i + (++step)) & mask; \ + if (i == last) return h->n_buckets; \ + } \ + return __ac_iseither(h->flags, i)? h->n_buckets : i; \ + } else return 0; \ + } \ SCOPE khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key) \ { \ if (h->n_buckets) { \ @@ -377,6 +394,16 @@ static const double __ac_HASH_UPPER = 0.77; @abstract 64-bit integer comparison function */ #define kh_int64_hash_equal(a, b) ((a) == (b)) +/*! @function + @abstract 128-bit integer hash function + @param key The integer [khint128_t] + @return The hash value [khint_t] + */ +#define kh_int128_hash_func(key) (khint32_t)((key)>>100^(key)>>66^(key)>>33^(key)^(key)<<11) +/*! @function + @abstract 128-bit integer comparison function + */ +#define kh_int128_hash_equal(a, b) ((a) == (b)) /*! @function @abstract const char* hash function @param s Pointer to a null terminated string @@ -462,6 +489,24 @@ static kh_inline khint_t __ac_Wang_hash(khint_t key) */ #define kh_put(name, h, k, r) kh_put_##name(h, k, r) +/*! @function + @abstract Hash a key. + @param name Name of the hash table [symbol] + @param key Key [type of keys] + @return Hash value [khint_t] + */ +#define kh_hash(name, key) kh_hash_##name(key) + +/*! @function + @abstract Retrieve a key from the hash table with a given hash value. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + @param k Key [type of keys] + @param hash Hash value [khint_t] + @return Iterator to the found element, or kh_end(h) if the element is absent [khint_t] + */ +#define kh_get_with_hash(name, h, k, hash) kh_get_##name##_with_hash(h, k, hash) + /*! @function @abstract Retrieve a key from the hash table. @param name Name of the hash table [symbol] @@ -552,6 +597,21 @@ static kh_inline khint_t __ac_Wang_hash(khint_t key) code; \ } } +/*! @function + @abstract Iterate over the entries in the hash table + @param h Pointer to the hash table [khash_t(name)*] + @param kvar Variable to which key will be assigned + @param vvar Variable to which value will be assigned + @param code Block of code to execute + */ +#define kh_foreach_ref(h, kvar, rvar, code) { khint_t __i; \ + for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \ + if (!kh_exist(h,__i)) continue; \ + (kvar) = kh_key(h,__i); \ + (rvar) = &kh_val(h,__i); \ + code; \ + } } + /*! @function @abstract Iterate over the entries in the hash table @param h Pointer to the hash table [khash_t(name)*] @@ -647,7 +707,34 @@ static kh_inline khint_t __ac_Wang_hash(khint_t key) #define KHASH_MAP_IMPL_INT64(name, khval_t) \ __KHASH_IMPL(name, , khint64_t, khval_t, 1, kh_int64_hash_func, kh_int64_hash_equal) -typedef const char *kh_cstr_t; +/*! @function + @abstract Instantiate a hash map containing 128-bit integer keys + @param name Name of the hash table [symbol] + */ +#define KHASH_SET_INIT_INT128(name) \ + KHASH_INIT(name, khint128_t, char, 0, kh_int128_hash_func, kh_int128_hash_equal) + +#define KHASH_SET_DECLARE_INT128(name) \ + KHASH_DECLARE(name, khint128_t, char) + +#define KHASH_SET_IMPL_INT128(name) \ + __KHASH_IMPL(name, , khint128_t, char, 0, kh_int128_hash_func, kh_int128_hash_equal) + +/*! @function + @abstract Instantiate a hash map containing 128-bit integer keys + @param name Name of the hash table [symbol] + @param khval_t Type of values [type] + */ +#define KHASH_MAP_INIT_INT128(name, khval_t) \ + KHASH_INIT(name, khint128_t, khval_t, 1, kh_int128_hash_func, kh_int128_hash_equal) + +#define KHASH_MAP_DECLARE_INT128(name, khval_t) \ + KHASH_DECLARE(name, khint128_t, khval_t) + +#define KHASH_MAP_IMPL_INT128(name, khval_t) \ + __KHASH_IMPL(name, , khint128_t, khval_t, 1, kh_int128_hash_func, kh_int128_hash_equal) + + typedef const char *kh_cstr_t; /*! @function @abstract Instantiate a hash map containing const char* keys @param name Name of the hash table [symbol] diff --git a/src/include/libdl.h b/src/include/libdl.h new file mode 100644 index 0000000..9f8504a --- /dev/null +++ b/src/include/libdl.h @@ -0,0 +1,16 @@ +#ifndef __LIBDL_H__ +#define __LIBDL_H__ + +typedef enum my_hookedlib_type_s { + VulkanOverlay = 0 +} my_hookedlib_type_t; + +typedef struct my_hookedlib_s { + void* self; // reference to itself + const char* fullpath; // to find repeted lib + int ref; // nb of reference; + my_hookedlib_type_t type; + void* priv; +} my_hookedlib_t; + +#endif //__LIBDL_H__ \ No newline at end of file diff --git a/src/include/librarian.h b/src/include/librarian.h index 74a9437..836b053 100644 --- a/src/include/librarian.h +++ b/src/include/librarian.h @@ -30,12 +30,14 @@ void promoteLocalLibGlobal(library_t* lib); int isLibLocal(library_t* lib); uintptr_t FindGlobalSymbol(lib_t *maplib, const char* name, int version, const char* vername, int veropt); int GetNoSelfSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, size_t size, int version, const char* vername, int veropt, void** elfsym); +int GetNextSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, size_t size, int version, const char* vername, int veropt, void** elfsym); int GetGlobalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, int version, const char* vername, int veropt, void** elfsym); int GetGlobalWeakSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t *self, int version, const char* vername, int veropt, void** elfsym); int GetGlobalNoWeakSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, int version, const char* vername, int veropt, void** elfsym); int GetLocalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t *self, int version, const char* vername, int veropt, void** elfsym); elfheader_t* GetGlobalSymbolElf(lib_t *maplib, const char* name, int version, const char* vername, int veropt); int IsGlobalNoWeakSymbolInNative(lib_t *maplib, const char* name, int version, const char* vername, int veropt); +int GetAnySymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, int version, const char* vername, int veropt); int GetSymTabStartEnd(lib_t* maplib, const char* name, uintptr_t* start, uintptr_t* end); void MapLibRemoveLib(lib_t* maplib, library_t* lib); diff --git a/src/include/my_cpuid.h b/src/include/my_cpuid.h index f017d44..4da1a77 100644 --- a/src/include/my_cpuid.h +++ b/src/include/my_cpuid.h @@ -4,7 +4,4 @@ typedef struct x64emu_s x64emu_t; void my_cpuid(x64emu_t* emu, uint32_t tmp32u); -uint32_t helper_getcpu(x64emu_t* emu); // get the numa/cpu id actually running -uint32_t get_random32(); -uint64_t get_random64(); -#endif //__MY_CPUID_H__ \ No newline at end of file +#endif //__MY_CPUID_H__ diff --git a/src/include/myalign.h b/src/include/myalign.h index c29237d..d87b6c7 100644 --- a/src/include/myalign.h +++ b/src/include/myalign.h @@ -2,6 +2,8 @@ #define __MY_ALIGN__H_ #include +#include "mysignal.h" + typedef struct x64_va_list_s { unsigned int gp_offset; unsigned int fp_offset; @@ -135,7 +137,7 @@ typdef struct { #define CREATE_SYSV_VALIST(A) \ va_list sysv_varargs = (va_list)A // not creating CONVERT_VALIST(A) on purpose -// this one will create a VA_LIST from x64_va_list using only GPRS and 100 stack element +// this one will create a VA_LIST from x64_va_list using only GPRS (NOFLOAT) and 100 stack element #define CREATE_VALIST_FROM_VALIST(VA, SCRATCH) \ va_list sysv_varargs; \ { \ @@ -179,6 +181,8 @@ void myStackAlignValist(x64emu_t* emu, const char* fmt, uint64_t* mystack, x64_v void myStackAlignWValist(x64emu_t* emu, const char* fmt, uint64_t* mystack, x64_va_list_t va); void myStackAlignScanfValist(x64emu_t* emu, const char* fmt, uint64_t* mystack, x64_va_list_t va); void myStackAlignScanfWValist(x64emu_t* emu, const char* fmt, uint64_t* mystack, x64_va_list_t va); +void myStackAlignGVariantNewVa(x64emu_t* emu, const char* fmt, uint64_t* scratch, x64_va_list_t* b); +void myStackAlignGVariantNew(x64emu_t* emu, const char* fmt, uint64_t* st, uint64_t* mystack, int pos); #endif struct x64_stat64 { /* x86_64 arm64 */ @@ -216,8 +220,11 @@ void* align_xcb_connection(void* src); void unalign_xcb_connection(void* src, void* dst); void* add_xcb_connection(void* src); void del_xcb_connection(void* src); +void register_xcb_display(void* d, void* xcb); +void unregister_xcb_display(void* d); uintptr_t getVArgs(x64emu_t* emu, int pos, uintptr_t* b, int N); +void setVArgs(x64emu_t* emu, int pos, uintptr_t* b, int N, uintptr_t a); // longjmp / setjmp typedef struct jump_buff_x64_s { @@ -235,10 +242,87 @@ typedef struct __jmp_buf_tag_s { jump_buff_x64_t __jmpbuf; int __mask_was_saved; #ifdef ANDROID - sigset_t __saved_mask; + union { + sigset_t __saved_mask; + sigset64_t __saved_mask64; + }; #else __sigset_t __saved_mask; #endif } __jmp_buf_tag_t; +struct x64_user_fpregs_struct +{ + unsigned short int cwd; + unsigned short int swd; + unsigned short int ftw; + unsigned short int fop; + unsigned long long int rip; + unsigned long long int rdp; + unsigned int mxcsr; + unsigned int mxcr_mask; + unsigned int st_space[32]; /* 8*16 bytes, x87 reg rounded to 16bytes */ + unsigned int xmm_space[64]; /* 16*16 bytes for each XMM-reg */ + unsigned int padding[24]; +}; + +struct x64_user_regs_struct +{ + unsigned long long int r15; + unsigned long long int r14; + unsigned long long int r13; + unsigned long long int r12; + unsigned long long int rbp; + unsigned long long int rbx; + unsigned long long int r11; + unsigned long long int r10; + unsigned long long int r9; + unsigned long long int r8; + unsigned long long int rax; + unsigned long long int rcx; + unsigned long long int rdx; + unsigned long long int rsi; + unsigned long long int rdi; + unsigned long long int orig_rax; + unsigned long long int rip; + unsigned long long int cs; + unsigned long long int eflags; + unsigned long long int rsp; + unsigned long long int ss; + unsigned long long int fs_base; + unsigned long long int gs_base; + unsigned long long int ds; + unsigned long long int es; + unsigned long long int fs; + unsigned long long int gs; +}; + +typedef struct my_x64_user_s +{ + struct x64_user_regs_struct regs; + int u_fpvalid; + struct x64_user_fpregs_struct i387; + unsigned long long int u_tsize; + unsigned long long int u_dsize; + unsigned long long int u_ssize; + unsigned long long int start_code; + unsigned long long int start_stack; + long long int signal; + int reserved; + union + { + struct user_regs_struct* u_ar0; + unsigned long long int __u_ar0_word; + }; + union + { + struct user_fpregs_struct* u_fpstate; + unsigned long long int __u_fpstate_word; + }; + unsigned long long int magic; + char u_comm [32]; + unsigned long long int u_debugreg [8]; +} my_x64_user_t; + + #endif //__MY_ALIGN__H_ diff --git a/src/include/myalign32.h b/src/include/myalign32.h new file mode 100755 index 0000000..7a42273 --- /dev/null +++ b/src/include/myalign32.h @@ -0,0 +1,718 @@ +#ifndef __MY_ALIGN32__H_ +#define __MY_ALIGN32__H_ +#include +#include +#include "box32.h" + +#define X64_VA_MAX_REG (6*8) +#define X64_VA_MAX_XMM ((6*8)+(8*16)) + +#define ALIGN64_16(A) (uint64_t*)((((uintptr_t)A)+15)&~15LL) + +#ifdef __x86_64__ +// x86_64, 6 64bits general regs and 16 or 8? 128bits float regs +/* +For reference, here is the x86_64 va_list structure +typedef struct { + unsigned int gp_offset; + unsigned int fp_offset; + void *overflow_arg_area; + void *reg_save_area; +} va_list[1]; +*/ +#define CREATE_SYSV_VALIST_32(A) \ + va_list sysv_varargs; \ + sysv_varargs->gp_offset=X64_VA_MAX_REG; \ + sysv_varargs->fp_offset=X64_VA_MAX_XMM; \ + sysv_varargs->reg_save_area=(A); \ + sysv_varargs->overflow_arg_area=A + +#define CONVERT_VALIST_32(A) \ + va_list sysv_varargs; \ + sysv_varargs->gp_offset=X64_VA_MAX_REG; \ + sysv_varargs->fp_offset=X64_VA_MAX_XMM; \ + sysv_varargs->reg_save_area=(A); \ + sysv_varargs->overflow_arg_area=A + + + +#elif defined(__aarch64__) +// aarch64: 8 64bits general regs and 8 128bits float regs +/* +va_list declared as +typedef struct va_list { + void * stack; // next stack param + void * gr_top; // end of GP arg reg save area + void * vr_top; // end of FP/SIMD arg reg save area + int gr_offs; // offset from gr_top to next GP register arg + int vr_offs; // offset from vr_top to next FP/SIMD register arg +} va_list; +*/ +#define CREATE_SYSV_VALIST_32(A) \ + va_list sysv_varargs; \ + sysv_varargs.__gr_offs=(8*8); \ + sysv_varargs.__vr_offs=(8*16); \ + sysv_varargs.__stack=(A); + +#define CONVERT_VALIST_32(A) \ + va_list sysv_varargs; \ + sysv_varargs.__gr_offs=(8*8); \ + sysv_varargs.__vr_offs=(8*16); \ + sysv_varargs.__stack=(A); + + +#elif defined(__loongarch64) || defined(__powerpc64__) || defined(__riscv) +#define CREATE_SYSV_VALIST_32(A) \ + va_list sysv_varargs = (va_list)A + +#define CREATE_VALIST_FROM_VALIST_32(VA, SCRATCH) \ + va_list sysv_varargs = (va_list)A + +#else +#error Unknown architecture! +#endif + +#define VARARGS_32 sysv_varargs +#define PREPARE_VALIST_32 CREATE_SYSV_VALIST_32(emu->scratch) +#define VARARGS_32_(A) sysv_varargs +#define PREPARE_VALIST_32_(A) CREATE_SYSV_VALIST_32(A) + +void myStackAlign32(const char* fmt, uint32_t* st, uint64_t* mystack); +size_t myStackAlignScanf32(const char* fmt, uint32_t* st, uint64_t* mystack, size_t nb_elem); // return the number of long/ptr_t conversion pending +void myStackAlignScanf32_final(const char* fmt, uint32_t* st, uint64_t* mystack, size_t nb_elem, int n); // convert the long/ptr_t scanf results +size_t myStackAlignScanfW32(const char* fmt, uint32_t* st, uint64_t* mystack, size_t nb_elem); +void myStackAlignScanfW32_final(const char* fmt, uint32_t* st, uint64_t* mystack, size_t nb_elem, int n); +void myStackAlignW32(const char* fmt, uint32_t* st, uint64_t* mystack); + +void* align_xcb_connection32(void* src); +void unalign_xcb_connection32(void* src, void* dst); +void* add_xcb_connection32(void* src); +void del_xcb_connection32(void* src); + +void UnalignStat64_32(const void* source, void* dest); +void UnalignStat64_32_t64(const void* source, void* dest); + +void UnalignStatFS_32(const void* source, void* dest); +void UnalignStatFS64_32(const void* source, void* dest); +#if 0 +void UnalignOggVorbis(void* dest, void* source); // Arm -> x86 +void AlignOggVorbis(void* dest, void* source); // x86 -> Arm + +void UnalignVorbisDspState(void* dest, void* source); // Arm -> x86 +void AlignVorbisDspState(void* dest, void* source); // x86 -> Arm + +void UnalignVorbisBlock(void* dest, void* source); // Arm -> x86 +void AlignVorbisBlock(void* dest, void* source); // x86 -> Arm +#endif +void UnalignEpollEvent32(void* dest, void* source, int nbr); // Arm -> x86 +void AlignEpollEvent32(void* dest, void* source, int nbr); // x86 -> Arm +#if 0 +void UnalignSmpegInfo(void* dest, void* source); // Arm -> x86 +void AlignSmpegInfo(void* dest, void* source); // x86 -> Arm +#endif +// stat64 is packed on i386, not on arm (and possibly other structures) +#undef st_atime +#undef st_atime_nsec +#undef st_mtime +#undef st_mtime_nsec +#undef st_ctime +#undef st_ctime_nsec +struct i386_stat64 { + uint64_t st_dev; + uint8_t __pad0[4]; + uint32_t __st_ino; + uint32_t st_mode; + uint32_t st_nlink; + uint32_t st_uid; + uint32_t st_gid; + uint64_t st_rdev; + uint8_t __pad3[4]; + int64_t st_size; + uint32_t st_blksize; + uint64_t st_blocks; + uint32_t st_atime; + uint32_t st_atime_nsec; + uint32_t st_mtime; + uint32_t st_mtime_nsec; + uint32_t st_ctime; + uint32_t st_ctime_nsec; + uint64_t st_ino; +} __attribute__((packed, aligned(4))); // important for this one + +struct i386_stat64_t64 { + uint64_t st_dev; + uint64_t st_ino; + uint32_t st_mode; + uint32_t st_nlink; + uint32_t st_uid; + uint32_t st_gid; + uint64_t st_rdev; + int64_t st_size; + uint32_t st_blksize; + int64_t st_blocks; + uint64_t st_atime; + uint64_t st_atime_nsec; + uint64_t st_mtime; + uint64_t st_mtime_nsec; + uint64_t st_ctime; + uint64_t st_ctime_nsec; + uint32_t __reserved4; + uint32_t __reserved5; +} __attribute__((packed, aligned(4))); // important for this one + +struct i386_fsid { + int val[2]; +}; + +struct i386_statfs { + uint32_t f_type; + uint32_t f_bsize; + uint32_t f_blocks; + uint32_t f_bfree; + uint32_t f_bavail; + uint32_t f_files; + uint32_t f_ffree; + struct i386_fsid f_fsid; + uint32_t f_namelen; + uint32_t f_frsize; + uint32_t f_flags; + uint32_t f_spare[4]; +}; + +struct i386_statfs64 { + long_t f_type; + long_t f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + struct i386_fsid f_fsid; + long_t f_namelen; + long_t f_frsize; + long_t f_flags; + long_t f_spare[4]; +}; + +struct i386_statvfs64 { + ulong_t f_bsize; + ulong_t f_frsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + uint64_t f_favail; + ulong_t f_fsid; + int __f_unused; + ulong_t f_flag; + ulong_t f_namemax; + unsigned int f_type; + int __f_spare[5]; +}; + +struct i386_statvfs { + ulong_t f_bsize; + ulong_t f_frsize; + uint32_t f_blocks; + uint32_t f_bfree; + uint32_t f_bavail; + uint32_t f_files; + uint32_t f_ffree; + uint32_t f_favail; + ulong_t f_fsid; + int __f_unused; + ulong_t f_flag; + ulong_t f_namemax; + unsigned int f_type; + int __f_spare[5]; +}; + +void UnalignStatVFS_32(const void* source, void* dest); +void UnalignStatVFS64_32(const void* source, void* dest); + +struct i386_dirent +{ + ulong_t d_ino; + ulong_t d_off; + uint16_t d_reclen; + uint8_t d_type; + char d_name[256]; +}; +void UnalignDirent_32(const void* source, void* dest); + +#if 0 +typedef struct { + unsigned char *data; + int storage; + int fill; + int returned; + + int unsynced; + int headerbytes; + int bodybytes; +} ogg_sync_state; + +typedef struct { + unsigned char *body_data; /* bytes from packet bodies */ + long body_storage; /* storage elements allocated */ + long body_fill; /* elements stored; fill mark */ + long body_returned; /* elements of fill returned */ + + + int *lacing_vals; /* The values that will go to the segment table */ + int64_t *granule_vals; /* granulepos values for headers. Not compact + this way, but it is simple coupled to the + lacing fifo */ + long lacing_storage; + long lacing_fill; + long lacing_packet; + long lacing_returned; + + unsigned char header[282]; /* working space for header encode */ + int header_fill; + + int e_o_s; /* set when we have buffered the last packet in the + logical bitstream */ + int b_o_s; /* set after we've written the initial page + of a logical bitstream */ + long serialno; + long pageno; + int64_t packetno; /* sequence number for decode; the framing + knows where there's a hole in the data, + but we need coupling so that the codec + (which is in a separate abstraction + layer) also knows about the gap */ + int64_t granulepos; + +} ogg_stream_state; + +typedef struct vorbis_dsp_state { + int analysisp; + ptr_t vi; //vorbis_info + + ptr_t pcm; //float** + ptr_t pcmret; // float** + int pcm_storage; + int pcm_current; + int pcm_returned; + + int preextrapolate; + int eofflag; + + long lW; + long W; + long nW; + long centerW; + + int64_t granulepos; + int64_t sequence; + + int64_t glue_bits; + int64_t time_bits; + int64_t floor_bits; + int64_t res_bits; + + void *backend_state; +} vorbis_dsp_state; + +typedef struct { + long endbyte; + int endbit; + + unsigned char *buffer; + unsigned char *ptr; + long storage; +} oggpack_buffer; + +typedef struct vorbis_block { + /* necessary stream state for linking to the framing abstraction */ + float **pcm; /* this is a pointer into local storage */ + oggpack_buffer opb; + + long lW; + long W; + long nW; + int pcmend; + int mode; + + int eofflag; + int64_t granulepos; + int64_t sequence; + vorbis_dsp_state *vd; /* For read-only access of configuration */ + + /* local storage to avoid remallocing; it's up to the mapping to + structure it */ + void *localstore; + long localtop; + long localalloc; + long totaluse; + struct alloc_chain *reap; + + /* bitmetrics for the frame */ + long glue_bits; + long time_bits; + long floor_bits; + long res_bits; + + void *internal; + +} vorbis_block; + +typedef struct { + size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource); + int (*seek_func) (void *datasource, int64_t offset, int whence); + int (*close_func) (void *datasource); + long (*tell_func) (void *datasource); +} ov_callbacks; + +typedef struct OggVorbis { + void *datasource; /* Pointer to a FILE *, etc. */ + int seekable; + int64_t offset; + int64_t end; + ogg_sync_state oy; + + /* If the FILE handle isn't seekable (eg, a pipe), only the current + stream appears */ + int links; + int64_t *offsets; + int64_t *dataoffsets; + long *serialnos; + int64_t *pcmlengths; /* overloaded to maintain binary + compatibility; x2 size, stores both + beginning and end values */ + void *vi; //vorbis_info + void *vc; //vorbis_comment + + /* Decoding working state local storage */ + int64_t pcm_offset; + int ready_state; + long current_serialno; + int current_link; + + double bittrack; + double samptrack; + + ogg_stream_state os; /* take physical pages, weld into a logical + stream of packets */ + vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ + vorbis_block vb; /* local working space for packet->PCM decode */ + + ov_callbacks callbacks; + +} OggVorbis; + +typedef struct my_SMPEG_Info_s { + int has_audio; + int has_video; + int width; + int height; + int current_frame; + double current_fps; + char audio_string[80]; + int audio_current_frame; + uint32_t current_offset; + uint32_t total_size; + double current_time; + double total_time; +} my_SMPEG_Info_t; + +typedef struct __attribute__((packed)) x86_ftsent_s { + struct x86_ftsent_s *fts_cycle; + struct x86_ftsent_s *fts_parent; + struct x86_ftsent_s *fts_link; + long fts_number; + void *fts_pointer; + char *fts_accpath; + char *fts_path; + int fts_errno; + int fts_symfd; + uint16_t fts_pathlen; + uint16_t fts_namelen; + uintptr_t fts_ino; + uint64_t fts_dev; + uint32_t fts_nlink; + int16_t fts_level; + uint16_t fts_info; + uint16_t fts_flags; + uint16_t fts_instr; + struct stat *fts_statp; + char fts_name[1]; +} x86_ftsent_t; + +void UnalignFTSENT(void* dest, void* source); // Arm -> x86 +void AlignFTSENT(void* dest, void* source); // x86 -> Arm +#endif +typedef struct my_flock64_s { + uint16_t l_type; + uint16_t l_whence; + int64_t l_start; + int64_t l_len; + int l_pid; +} my_flock64_t; + +typedef struct __attribute__((packed, aligned(4))) x86_flock64_s { // alignment needed here to avoid 8bytes align before the start + uint16_t l_type; + uint16_t l_whence; + int64_t l_start; + int64_t l_len; + int l_pid; +} x86_flock64_t; + +void UnalignFlock64_32(void* dest, void* source); // Arm -> x86 +void AlignFlock64_32(void* dest, void* source); // x86 -> Arm + +typedef struct __attribute__((packed, aligned(4))) i386_flock_s +{ + short int l_type; + short int l_whence; + long_t l_start; + long_t l_len; + int l_pid; +} i386_flock_t; + +void UnalignFlock_32(void* dest, void* source); // Arm -> x86 +void AlignFlock_32(void* dest, void* source); // x86 -> Arm + +#if 0 +// defined in wrapperlibc.c +int of_convert(int); // x86->arm +int of_unconvert(int); // arm->x86 + +typedef struct my_GValue_s +{ + int g_type; + union { + int v_int; + int64_t v_int64; + uint64_t v_uint64; + float v_float; + double v_double; + void* v_pointer; + } data[2]; +} my_GValue_t; + +void alignNGValue(my_GValue_t* v, void* value, int n); +void unalignNGValue(void* value, my_GValue_t* v, int n); +#endif + +int of_convert32(int a); +int of_unconvert32(int a); + +struct i386_addrinfo +{ + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + uint32_t ai_addrlen; + ptr_t ai_addr; // struct sockaddr * + ptr_t ai_canonname; // char * + ptr_t ai_next; // struct addrinfo * +}; + +struct i386_hostent { + ptr_t h_name; // char * + ptr_t h_aliases; // char ** + int h_addrtype; + int h_length; + ptr_t h_addr_list;// char ** +}; + +struct i386_servent { + ptr_t s_name; // char * + ptr_t s_aliases; // char ** + int s_port; + ptr_t s_proto; // char * +}; + +struct i386_iovec +{ + ptr_t iov_base; // void * + ulong_t iov_len; +}; + +struct i386_msghdr +{ + ptr_t msg_name; // void * + uint32_t msg_namelen; + ptr_t msg_iov; // struct i386_iovec * + uint32_t msg_iovlen; + ptr_t msg_control; // void * + ulong_t msg_controllen; + int msg_flags; +}; + +struct i386_mmsghdr { + struct i386_msghdr msg_hdr; + unsigned int msg_len; +}; + +// Some docs show cmsg_len as a socklen_t (so uint32_t), but thsi not true, it's a size_t (kernel_size_t) +struct i386_cmsghdr +{ + ulong_t cmsg_len; + int cmsg_level; + int cmsg_type; +}; + +void AlignIOV_32(void* dest, void* source); // x86 -> Native +void UnalignIOV_32(void* dest, void* source); // Native -> x86 + +void AlignMsgHdr_32(void* dest, void* dest_iov, void* dest_cmsg, void* source, int convert_control); // x86 -> Native +void UnalignMsgHdr_32(void* dest, void* source); // back to Native -> x86 + +struct i386_passwd +{ + ptr_t pw_name; // char* + ptr_t pw_passwd; // char* + __uid_t pw_uid; + __gid_t pw_gid; + ptr_t pw_gecos; // char* + ptr_t pw_dir; // char* + ptr_t pw_shell; // char* +} __attribute__((packed, aligned(4))); + +struct i386_group +{ + ptr_t gr_name; // char * + ptr_t gr_passwd; // char * + __gid_t gr_gid; + ptr_t gr_mem; // char ** +} __attribute__((packed, aligned(4))); + +typedef struct my_regex_s +{ + void* buffer; //struct re_dfa_t + size_t allocated; + size_t used; + unsigned long int syntax; + char* fastmap; + unsigned char* translate; + size_t re_nsub; + unsigned flags; + /* + unsigned can_be_null : 1; + unsigned regs_allocated : 2; + unsigned fastmap_accurate : 1; + unsigned no_sub : 1; + unsigned not_bol : 1; + unsigned not_eol : 1; + unsigned newline_anchor : 1; + */ +} my_regex_t; + +typedef struct my_regex_32_s +{ + ptr_t buffer; //struct re_dfa_t + ulong_t allocated; + ulong_t used; + ulong_t syntax; + ptr_t fastmap; //char* + ptr_t translate; //unsigned char* + ulong_t re_nsub; + unsigned flags; + /* + unsigned can_be_null : 1; + unsigned regs_allocated : 2; + unsigned fastmap_accurate : 1; + unsigned no_sub : 1; + unsigned not_bol : 1; + unsigned not_eol : 1; + unsigned newline_anchor : 1; + */ +} my_regex_32_t; + +void convert_regext_to_32(void* d, void* s); +void convert_regext_to_64(void* d, void* s); + +typedef struct my_ns_msg_32_s { + ptr_t _msg; //const unsigned char *_ + ptr_t _eom; //const unsigned char *_ + uint16_t _id; + uint16_t _flags; + uint16_t _counts[4]; + ptr_t _sections[4];//const unsigned char *_ + uint32_t _sect; + int _rrnum; + ptr_t _msg_ptr; //const unsigned char * +} my_ns_msg_32_t; + +typedef struct my_ns_rr_32_s { + char name[1025]; + uint16_t type; + uint16_t rr_class; + uint32_t ttl; + uint16_t rdlength; + ptr_t rdata; //const unsigned char * +} my_ns_rr_32_t; + +struct my_obstack_chunk_32_t +{ + ptr_t limit; //char * + ptr_t prev; //struct _obstack_chunk * + char contents[4]; +}; + +struct my_obstack_32_t +{ + long_t chunk_size; + ptr_t chunk; //struct _obstack_chunk * + ptr_t object_base; //char* + ptr_t next_free; //char* + ptr_t chunk_limit; //char* + union + { + int tempint; + ptr_t tempptr; //void* + } temp; + int alignment_mask; + ptr_t chunkfun; //struct _obstack_chunk *(*chunkfun) (void *, long); + ptr_t freefun; //void (*freefun) (void *, struct _obstack_chunk *); + ptr_t extra_arg;//void * + unsigned use_extra_arg : 1; + unsigned maybe_empty_object : 1; + unsigned alloc_failed : 1; +}; + +void convert_obstack_to_32(void* d, void* s); +void convert_obstack_to_64(void* d, void* s); + +typedef struct i386_ifmap_s { + ulong_t mem_start; + ulong_t mem_end; + unsigned short base_addr; + unsigned char irq; + unsigned char dma; + unsigned char port; +} i386_ifmap_t; + +typedef struct i386_ifreq_s { + char i386_ifr_name[16]; /* Interface name */ + union { + struct sockaddr i386_ifr_addr; + struct sockaddr i386_ifr_dstaddr; + struct sockaddr i386_ifr_broadaddr; + struct sockaddr i386_ifr_netmask; + struct sockaddr i386_ifr_hwaddr; + short i386_ifr_flags; + int i386_ifr_ifindex; + int i386_ifr_metric; + int i386_ifr_mtu; + i386_ifmap_t i386_ifr_map; + char i386_ifr_slave[16]; + char i386_ifr_newname[16]; + ptr_t i386_ifr_data; // char* + }; +} i386_ifreq_t; + +typedef struct i386_ifconf_s { + int ifc_len; + union { + ptr_t i386_ifc_buf; // char* + ptr_t i386_ifc_req; // i386_ifreq_t* + }; +} i386_ifconf_t; + +#endif//__MY_ALIGN32__H_ diff --git a/src/include/mypthread.h b/src/include/mypthread.h new file mode 100644 index 0000000..ce9ea86 --- /dev/null +++ b/src/include/mypthread.h @@ -0,0 +1,29 @@ +#ifndef __MYPTHREAD_H_ +#define __MYPTHREAD_H_ + +#ifndef _WIN32 +#include +#else +#include + +NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *); +NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *); +BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *); +NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *); + +typedef void* pthread_key_t; +typedef void* pthread_mutexattr_t; +#define pthread_mutex_t RTL_CRITICAL_SECTION +#define pthread_mutex_init(x, y) RtlInitializeCriticalSection(x) +#define pthread_mutex_lock(x) RtlEnterCriticalSection(x) +#define pthread_mutex_unlock(x) RtlLeaveCriticalSection(x) +#define pthread_mutex_trylock(x) !RtlTryEnterCriticalSection(x) + +#define pthread_mutex_destroy(x) 0 +#define pthread_mutexattr_init(x) 0 +#define pthread_mutexattr_destroy(x) 0 +#define pthread_mutexattr_settype(x, y) 0 +#define pthread_atfork(a, b, c) 0 +#endif + +#endif // __MYPTHREAD_H_ \ No newline at end of file diff --git a/src/include/mysignal.h b/src/include/mysignal.h new file mode 100644 index 0000000..d31689a --- /dev/null +++ b/src/include/mysignal.h @@ -0,0 +1,23 @@ +#ifndef __MYSIGNAL_H_ +#define __MYSIGNAL_H_ + +#ifndef _WIN32 +#include +#else +typedef struct { + int a; +} sigset_t; + +typedef sigset_t __sigset_t; + +#define sigfillset(x) + +#define SIGILL 4 +#define SIGTRAP 5 +#define SIGSEGV 11 + +#undef pthread_sigmask +#define pthread_sigmask(a, b, c) 0 +#endif + +#endif // __MYSIGNAL_H_ \ No newline at end of file diff --git a/src/include/os.h b/src/include/os.h new file mode 100644 index 0000000..5b61b13 --- /dev/null +++ b/src/include/os.h @@ -0,0 +1,134 @@ +#ifndef __OS_H_ +#define __OS_H_ + +#include +#include + +#ifndef _WIN32 +#include +#include +#else +#include +typedef __int64 ssize_t; +#define dlsym(a, b) NULL +#define box_strdup(a) strdup(a) + +#define PROT_READ 0x1 +#define PROT_WRITE 0x2 +#define PROT_EXEC 0x4 + +#define MAP_FAILED ((void*)-1) +#define MAP_PRIVATE 0x02 +#define MAP_FIXED 0x10 +#define MAP_ANONYMOUS 0x20 +#define MAP_32BIT 0x40 +#define MAP_NORESERVE 0 + +void* mmap(void* addr, size_t length, int prot, int flags, int fd, off_t offset); +int munmap(void* addr, size_t length); +int mprotect(void* addr, size_t len, int prot); + +void x86Int(void* emu, int code); + +void* WinMalloc(size_t size); +void* WinRealloc(void* ptr, size_t size); +void* WinCalloc(size_t nmemb, size_t size); +void WinFree(void* ptr); +#endif + +void* InternalMmap(void* addr, unsigned long length, int prot, int flags, int fd, ssize_t offset); +int InternalMunmap(void* addr, unsigned long length); + +int GetTID(void); +int SchedYield(void); + +void EmuX64Syscall(void* emu); +void EmuX64Syscall_linux(void* emu); +void EmuX86Syscall(void* emu); + +void* GetSeg43Base(void* emu); +void* GetSegmentBase(void* emu, uint32_t desc); + +// These functions only applies to Linux -------------------------- +int IsBridgeSignature(char s, char c); +int IsNativeCall(uintptr_t addr, int is32bits, uintptr_t* calladdress, uint16_t* retn); +void EmuInt3(void* emu, void* addr); +void* EmuFork(void* emu, int forktype); + +void PersonalityAddrLimit32Bit(void); + +int IsAddrElfOrFileMapped(uintptr_t addr); +const char* GetNativeName(void* p); +const char* GetBridgeName(void* p); +// ---------------------------------------------------------------- + +#ifndef _WIN32 +#include +#define LongJmp longjmp +#define SigSetJmp sigsetjmp +#else +#define LongJmp(a, b) +#define SigSetJmp(a, b) 0 +#endif + +#ifndef _WIN32 +#include +#define NEW_JUMPBUFF(name) \ + static __thread JUMPBUFF name +#ifdef ANDROID +#define JUMPBUFF sigjmp_buf +#define GET_JUMPBUFF(name) name +#else +#define JUMPBUFF struct __jmp_buf_tag +#define GET_JUMPBUFF(name) &name +#endif +#else +#define JUMPBUFF int +#define NEW_JUMPBUFF(name) +#define GET_JUMPBUFF(name) NULL +#endif + +#define PROT_READ 0x1 +#define PROT_WRITE 0x2 +#define PROT_EXEC 0x4 + +#if defined(__clang__) && !defined(_WIN32) +extern int isinff(float); +extern int isnanf(float); +#elif defined(_WIN32) +#define isnanf isnan +#define isinff isinf +#endif + +void PrintfFtrace(int prefix, const char* fmt, ...); + +void* GetEnv(const char* name); + +#define IS_EXECUTABLE (1 << 0) +#define IS_FILE (1 << 1) + +// 0 : doesn't exist, 1: does exist. +int FileExist(const char* filename, int flags); +int MakeDir(const char* folder); // return 1 for success, 0 else + +#ifdef _WIN32 +#define BOXFILE_BUFSIZE 4096 +typedef struct { + HANDLE hFile; + char buffer[BOXFILE_BUFSIZE]; + size_t buf_pos; + size_t buf_size; + int eof; +} BOXFILE; + +BOXFILE* box_fopen(const char* filename, const char* mode); +char* box_fgets(char* str, int num, BOXFILE* stream); +int box_fclose(BOXFILE* stream); +#else +#define BOXFILE FILE +#define box_fopen fopen +#define box_fgets fgets +#define box_fclose fclose +#endif + +#endif //__OS_H_ diff --git a/src/include/pe_tools.h b/src/include/pe_tools.h new file mode 100644 index 0000000..d52f143 --- /dev/null +++ b/src/include/pe_tools.h @@ -0,0 +1,13 @@ +#ifndef __PE_TOOLS_H__ +#define __PE_TOOLS_H__ + +// Parse the PE file and extract the volatile metadata, which contains volatile opcode entries and volatile ranges. +void ParseVolatileMetadata(char* filename, void* addr); + +// Check if a given address is contained within the volatile ranges. +int VolatileRangesContains(uintptr_t addr); + +// Check if a given address is contained within the volatile opcode entries. +int VolatileOpcodesHas(uintptr_t addr); + +#endif // __PE_TOOLS_H__ diff --git a/src/include/perfmap.h b/src/include/perfmap.h new file mode 100644 index 0000000..574b3f2 --- /dev/null +++ b/src/include/perfmap.h @@ -0,0 +1,6 @@ +#ifndef __PERFMAP_H__ +#define __PERFMAP_H__ + +void writePerfMap(uintptr_t func_addr, uintptr_t code_addr, size_t code_size, const char* inst_name); + +#endif // __PERFMAP_H__ \ No newline at end of file diff --git a/src/include/random.h b/src/include/random.h new file mode 100644 index 0000000..6852edc --- /dev/null +++ b/src/include/random.h @@ -0,0 +1,5 @@ +#ifndef __RANDOM_H_ +#define __RANDOM_H_ +uint32_t get_random32(void); +uint64_t get_random64(void); +#endif //__RANDOM_H_ diff --git a/src/include/rbtree.h b/src/include/rbtree.h index c210d55..6d93c31 100644 --- a/src/include/rbtree.h +++ b/src/include/rbtree.h @@ -1,19 +1,331 @@ -#include +/* + * The primary function of red-black trees in Box64 is to provide an O(log n) method for managing memory mappings. + * This provides a mechanism that allows retrieving the memory range or associated data based on an address. + * Unlike standard red-black trees, each node here includes two additional fields, "start" and "end," to denote a specific memory range. + * + * Box64 currently uses seven red-black trees, each serving distinct purposes: + * + * 1. memprot: + * Tracks memory protection flags (PROT_READ, PROT_WRITE, PROT_EXEC, PROT_CUSTOM) for each memory range. + * + * 2. mapallmem: + * Mirrors `/proc/self/maps`, tracking all memory allocations to prevent overlaps. + * Data field indicates allocation type: + * - MEM_ALLOCATED - Box64's custom allocator and direct mmap64() syscalls + * - MEM_RESERVED - reserved for box32_dynarec_mmap + * - MEM_MMAP - mmap from emulated code + * - MEM_BOX - mmap from Box64 native code + * - MEM_STACK - thread stacks + * - MEM_EXTERNAL - memory found in /proc/self/maps not allocated by Box64 + * - MEM_ELF - ELF binaries and shared libraries + * + * 3. blockstree: + * Contains memory ranges for a free-list (blocklist_s). Each node represents a different free-list. + * The data field stores the index of that free-list in the array `p_blocks` (i.e., the array that holds each free-list pointer). + * + * Free-list structure managed by each blocklist_t: + * ┌────────┬────────┬───────────────────────────────┬────────┬────────┐ + * │ m.prev │ m.next │ PAYLOAD │ n.prev │ n.next │ + * │ 0 │ offs │ (allocsize - 2·sizeof(mark)) │ offs │ 0 │ + * └────────┴────────┴───────────────────────────────┴────────┴────────┘ + * ↑ ↑ + * p (free-list start) p + allocsize (free-list end) + * + * 4. db_sizes: + * Tracks, for each dynablock size, how many dynablocks of exactly that size currently exist (per-size count). + * + * 5. envmap: + * Maps each live memory range to its mapping_t, which contains: + * - the file’s lowercase name, + * - a pointer to that file’s per-file box64env_t, + * - and the base address; + * indicating which module owns that range. + * + * 6. rbt_dynmem: + * Maps dynarec memory ranges to chunk pointers (blocklist_t*) for O(log n) lookup. + * Structure: Each mmaplist_t contains a dynamically-sized array of chunk pointers (blocklist_t**). + * + * [ mmaplist0 ] → [ mmaplist1 ] → [ mmaplist2 ] → … + * │ │ │ + * chunks[0] chunks[0] chunks[0] (each chunk[i] is a blocklist_t*) + * chunks[1] chunks[1] chunks[1] + * ... ... ... + * chunks[n-1] chunks[n-1] chunks[n-1] (array grows dynamically as needed) + * + * 7. volatileRanges: + * Tracks every “volatile” region inside a loaded PE module. + * + * Before the introduction of the red-black tree in Box64, the rationale for memory management was a sparse array, which takes O(n) complexity for accessing data. + * After transitioning from a sparse array to a red-black tree, the memory usage has decreased slightly for processes that consumed a lot of RAM (for example, Steam uses about 100 MB less memory, and each Wine process uses about 15 MB less). + * + * Note that each rbnode is allocated via customMalloc. Since each rbtree node is 56 bytes, + * it's handled by the bitmap allocator (map64_customMalloc) which provides 64-byte blocks, + * resulting in 8 bytes of internal fragmentation per node (14% overhead). + */ #ifndef RBTREE_H #define RBTREE_H -typedef struct rbtree rbtree; +#include + +typedef struct rbtree rbtree_t; + +/** + * rbtree_init() - Initializes a new red-black tree. + * @name: The name of the red-black tree. If null, the default name "(rbtree)" is assigned. + * + * This function allocates memory for a new red-black tree and initializes its properties. + * Return: A pointer to the newly created red-black tree. + */ +rbtree_t* rbtree_init(const char* name); + +/** + * rbtree_delete() - Deletes an entire red-black tree. + * @tree: Pointer to the red-black tree to delete. + * + * This function recursively deletes all nodes in the red-black tree starting from the root + * and then frees the memory of the tree structure itself via delete_rbnode(). + */ +void rbtree_delete(rbtree_t* tree); + +/** + * rb_get() - Retrieves data associated with a specific address in the red-black tree. + * @tree: Pointer to the red-black tree from which data is to be retrieved. + * @addr: The memory address used as a key to find the corresponding node in the tree. + * + * This function searches the red-black tree for a node that corresponds to the specified address. + * Return: The data associated with the address if found; otherwise, 0. + */ +uint32_t rb_get(rbtree_t* tree, uintptr_t addr); + +/** + * rb_get_64() - Retrieves data associated with a specific address in the red-black tree. + * @tree: Pointer to the red-black tree from which data is to be retrieved. + * @addr: The memory address used as a key to find the corresponding node in the tree. + * + * This function searches the red-black tree for a node that corresponds to the specified address. + * Return: The 64bits data associated with the address if found; otherwise, 0. + */ +uint64_t rb_get_64(rbtree_t* tree, uintptr_t addr); + +/** + * rb_get_end() - Searches for a node within a specified address range in a red-black tree and retrieves its data and end address. + * @tree: Pointer to the red-black tree to be searched. + * @addr: The address to search for within the nodes of the red-black tree. + * @val: Pointer to store the data of the node that contains the address if found. + * @end: Pointer to store the end address of the node that contains the address, or the start of the next node if not found, or UINTPTR_MAX if no next node exists. + * + * This function traverses the red-black tree starting from the root, searching for a node where the 'addr' falls between the node's start and end addresses (exclusive of end). + * If such a node is found, the function stores the node's data in '*val' and the node's end address in '*end', then returns 1 to indicate success. + * If no such node is found, the function sets '*val' to 0 and '*end' to the start address of the next node in the tree structure or to UINTPTR_MAX if there is no subsequent node. + * Return: 1 if a node containing the address is found, otherwise 0. + */ +int rb_get_end(rbtree_t* tree, uintptr_t addr, uint32_t* val, uintptr_t* end); + +/** + * rb_get_end_64() - Searches for a node within a specified address range in a red-black tree and retrieves its data and end address. + * @tree: Pointer to the red-black tree to be searched. + * @addr: The address to search for within the nodes of the red-black tree. + * @val: Pointer to store the data of the node that contains the address if found. + * @end: Pointer to store the end address of the node that contains the address, or the start of the next node if not found, or UINTPTR_MAX if no next node exists. + * + * This function traverses the red-black tree starting from the root, searching for a node where the 'addr' falls between the node's start and end addresses (exclusive of end). + * If such a node is found, the function stores the node's data in '*val' and the node's end address in '*end', then returns 1 to indicate success. + * If no such node is found, the function sets '*val' to 0 and '*end' to the start address of the next node in the tree structure or to UINTPTR_MAX if there is no subsequent node. + * Return: 1 if a node containing the address is found, otherwise 0. + */ +int rb_get_end_64(rbtree_t* tree, uintptr_t addr, uint64_t* val, uintptr_t* end); + +/** + * rb_set() - Set an address range in a red-black tree. + * @tree: Pointer to the red-black tree where the address range will be set. + * @start: The starting address of the range to be set. + * @end: The ending address of the range to be set. + * @data: The data value to associate with the address range. + * + * This function adds a new address range with associated data to the red-black tree. + * However, it is not always necessary to create a new node for each new address. + * If the range is adjacent to the existing nodes with the same data, the existing nodes will be extended to contain the new address. + * +---------+---------+---------+ +---------+---------+ + * | data A | | data A | + * +---------+---------+---------+ +---------+---------+ + * + * || + * \||/ + * \/ + * + * +---------+---------+---------+---------+---------+ + * | data A | + * +---------+---------+---------+---------+---------+ + * + * If the range overlaps with existing nodes, it will merge or modify nodes to maintain non-overlapping, contiguous ranges. + * This includes extending, splitting, or merging nodes based on the overlap conditions and data consistency. + * It handles multiple edge cases: + * 1. Overlap with same data: The existing node will be extended. + * + * (Case 1: Partial Overlap) + * +---------+---------+---------+---------+---------+ + * | data A | + * +---------+---------+---------+---------+---------+ + * ^..... overlap .....^ + * +---------+---------+---------+---------+---------+ + * | data A | + * +---------+---------+---------+---------+---------+ + * + * || + * \||/ Extend A + * \/ + * + * +---------+---------+---------+---------+---------+---------+---------+ + * | data A | + * +---------+---------+---------+---------+---------+---------+---------+ + * + * (Case 2: Overlap on Both Ends) + * +---------+---------+---------+---------+---------+ + * | data A | + * +---------+---------+---------+---------+---------+ + * ^..... overlap .....^ + * +---------+---------+---------+ + * | data A | + * +---------+---------+---------+ + * + * || + * \||/ Do nothing + * \/ + * + * +---------+---------+---------+---------+---------+ + * | data A | + * +---------+---------+---------+---------+---------+ + * + * + * 2. Overlap with different data: The overlapped part will be overwritten with the data from the new address range. + * The following graph shows that memory B is going to be added to the red-black tree where memory B overlaps with the existing node memory A. + * + * (Case 1: Overlap on Both Ends) + * +---------+---------+---------+---------+---------+ + * | data A | + * +---------+---------+---------+---------+---------+ + * ^..... overlap .....^ + * +---------+---------+---------+ + * | data B | + * +---------+---------+---------+ + * + * || + * \||/ Split the existing node into three new nodes + * \/ + * + * +---------+ +---------+---------+---------+ +---------+ + * | data A | | data B | | data A | + * +---------+ +---------+---------+---------+ +---------+ + * + * (Case 2: Partial Overlap) + * +---------+---------+---------+---------+---------+ + * | data A | + * +---------+---------+---------+---------+---------+ + * ^..... overlap .....^ + * +---------+---------+---------+---------+---------+ + * | data B | + * +---------+---------+---------+---------+---------+ + * + * || + * \||/ Adjust A by changing the pointers to exclude the segments that overlap with B + * \/ + * + * +---------+---------+ +---------+---------+---------+---------+---------+ + * | data A | | data B | + * +---------+---------+ +---------+---------+---------+---------+---------+ + * + * (Case 3: Complete Encapsulation) + * +---------+---------+---------+ + * | data A | + * +---------+---------+---------+ + * + * || + * \||/ Remove A entirely + * \/ + * +---------+---------+---------+---------+---------+ + * | data B | + * +---------+---------+---------+---------+---------+ + * + * The function ensures the tree remains balanced and correctly represents the address space with minimal nodes. + * + * Return: 0 on success, or -1 on failure. + */ +int rb_set(rbtree_t* tree, uintptr_t start, uintptr_t end, uint32_t data); + + +/** + * rb_set_64() - Set an address range in a red-black tree. + * @tree: Pointer to the red-black tree where the address range will be set. + * @start: The starting address of the range to be set. + * @end: The ending address of the range to be set. + * @data: The data value to associate with the address range. + * + * This function adds a new address range with associated data to the red-black tree. + */ + +int rb_set_64(rbtree_t* tree, uintptr_t start, uintptr_t end, uint64_t data); + +/** + * rb_unset() - Removes a range of values from the red-black tree. + * @tree: Pointer to the red-black tree. + * @start: The start address of the range to remove. + * @end: The end address of the range to remove. + * + * This function removes or adjusts nodes in the red-black tree that overlap with the specified + * range [start, end). It traverses the tree to find overlapping nodes, removes entire nodes + * that are completely within the range, and modifies nodes that partially overlap by adjusting + * their start or end values accordingly. + * + * Return: 0 on success. + */ +int rb_unset(rbtree_t* tree, uintptr_t start, uintptr_t end); + +/** + * rb_inc() - Increment by 1 an address range in a red-black tree. Create the node if needed. + * @tree: Pointer to the red-black tree where the address range will be set. + * @start: The starting address of the range to be set. + * @end: The ending address of the range to be set. + * + * Return: The new value for the node. + */ +uint64_t rb_inc(rbtree_t* tree, uintptr_t start, uintptr_t end); + +/** + * rb_dec() - Decrement by 1 an address range in a red-black tree. Do not create the node if absent. Delete the node if data == 0. + * @tree: Pointer to the red-black tree where the address range will be set. + * @start: The starting address of the range to be set. + * @end: The ending address of the range to be set. + * + * Return: The new value for the node (or 0 if absent / removed). + */ +uint64_t rb_dec(rbtree_t* tree, uintptr_t start, uintptr_t end); -rbtree* init_rbtree(); -void delete_rbtree(rbtree *tree); +/** + * rb_get_rightmost() - Retrieves the start value of the right-most node in a red-black tree. + * @tree: Pointer to the red-black tree whose right-most node's start value is to be retrieved. + * + * This function traverses the red-black tree from the root to the right-most node, which is the node + * with the highest key value in the tree. + * Return: The start value of the right-most node if the tree is not empty; otherwise, 0. + */ +uintptr_t rb_get_rightmost(rbtree_t* tree); -uint32_t rb_get(rbtree *tree, uintptr_t addr); -int rb_get_end(rbtree* tree, uintptr_t addr, uint32_t* val, uintptr_t* end); -int rb_set(rbtree *tree, uintptr_t start, uintptr_t end, uint32_t data); -int rb_unset(rbtree *tree, uintptr_t start, uintptr_t end); -uintptr_t rb_get_righter(rbtree *tree); +/** + * rb_get_leftmost() - Retrieves the start value of the left-most node in a red-black tree. + * @tree: Pointer to the red-black tree whose left-most node's start value is to be retrieved. + * + * This function traverses the red-black tree from the root to the left-most node, which is the node + * with the lowest key value in the tree. + * Return: The start value of the left-most node if the tree is not empty; otherwise, 0. + */ +uintptr_t rb_get_leftmost(rbtree_t* tree); -void print_rbtree(const rbtree *tree); +/** + * @brief Print a rbtree (for debugging purpose) + * + * @param tree + */ +void rbtree_print(const rbtree_t* tree); #endif // RBTREE_H diff --git a/src/include/rcfile.h b/src/include/rcfile.h deleted file mode 100644 index 3c8218c..0000000 --- a/src/include/rcfile.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __RCFILE_H__ -#define __RCFILE_H__ - -void LoadRCFile(const char* filename); -void DeleteParams(void); -void ApplyParams(const char* name); -const char* GetLastApplyName(); - -#endif //__RCFILE_H__ \ No newline at end of file diff --git a/src/include/regs.h b/src/include/regs.h index 3cfcdc5..c7cb2f5 100644 --- a/src/include/regs.h +++ b/src/include/regs.h @@ -42,7 +42,9 @@ typedef enum { typedef enum { d_none = 0, d_add8, + d_add8b, // using 8bits res d_add16, + d_add16b, // using 16bits res d_add32, // using 64bits res d_add32b, // using 32bits res d_add64, @@ -103,7 +105,9 @@ typedef enum { d_tst32, d_tst64, d_adc8, + d_adc8b, d_adc16, + d_adc16b, d_adc32, d_adc32b, d_adc64, @@ -119,14 +123,6 @@ typedef enum { d_ror16, d_ror32, d_ror64, - d_dec8i, // interpreter version, to handle the CF flags that is untouched - d_dec16i, - d_dec32i, - d_dec64i, - d_inc8i, - d_inc16i, - d_inc32i, - d_inc64i, d_shrd16, d_shrd32, d_shrd64, @@ -251,6 +247,12 @@ typedef union { } f; uint16_t x16; } x87control_t; +/* +Precision Controls: 00b = 24bits, 01b=reserved, 10b=53bits and 11b=64bits +The precision-control bits only affect the results of the following floating-point instructions: FADD, FADDP, FIADD, +FSUB, FSUBP, FISUB, FSUBR, FSUBRP, FISUBR, FMUL, FMULP, FIMUL, FDIV, FDIVP, FIDIV, FDIVR, FDIVRP, FIDIVR, +and FSQRT. +*/ typedef union { struct __attribute__ ((__packed__)) { @@ -319,6 +321,7 @@ typedef union { #define R_R13 emu->regs[_R13].q[0] #define R_R14 emu->regs[_R14].q[0] #define R_R15 emu->regs[_R15].q[0] +#define R_EIP emu->ip.dword[0] #define R_EAX emu->regs[_AX].dword[0] #define R_EBX emu->regs[_BX].dword[0] #define R_ECX emu->regs[_CX].dword[0] diff --git a/src/include/sdl1align32.h b/src/include/sdl1align32.h new file mode 100644 index 0000000..83b0e7b --- /dev/null +++ b/src/include/sdl1align32.h @@ -0,0 +1,591 @@ +#ifndef __MY_SDL1ALIGN32_H_ +#define __MY_SDL1ALIGN32_H_ +#include +#include "box32.h" + +typedef struct my_SDL_Rect_s +{ + int16_t x; + int16_t y; + uint16_t w; + uint16_t h; +} my_SDL_Rect_t; + +typedef struct my_SDL_Color_s +{ + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t unused; +} my_SDL_Color_t; + +typedef struct my_SDL_Palette_s +{ + int ncolors; + my_SDL_Color_t *colors; +} my_SDL_Palette_t; + +typedef struct my_SDL_PixelFormat_s +{ + my_SDL_Palette_t *palette; + uint8_t BitsPerPixel; + uint8_t BytesPerPixel; + uint8_t Rloss; + uint8_t Gloss; + uint8_t Bloss; + uint8_t Aloss; + uint8_t Rshift; + uint8_t Gshift; + uint8_t Bshift; + uint8_t Ashift; + uint32_t Rmask; + uint32_t Gmask; + uint32_t Bmask; + uint32_t Amask; + uint32_t colorkey; + uint8_t alpha; +} my_SDL_PixelFormat_t; + +typedef struct my_SDL_Surface_s +{ + uint32_t flags; + my_SDL_PixelFormat_t *format; + int w; + int h; + uint16_t pitch; + void *pixels; + int offset; + void* hwdata; //struct private_hwdata + my_SDL_Rect_t clip_rect; + uint32_t unused1; + uint32_t locked; + void *map; + unsigned int format_version; + int refcount; +} my_SDL_Surface_t; + +// x86 version (packed, 32bits pointers and long) + +typedef struct my_SDL_Rect_32_s +{ + int16_t x; + int16_t y; + uint16_t w; + uint16_t h; +} my_SDL_Rect_32_t; + +typedef struct my_SDL_Color_32_s +{ + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t unused; +} my_SDL_Color_32_t; + +typedef struct my_SDL_Palette_32_s +{ + int ncolors; + ptr_t colors; // my_SDL_Color_t* +} my_SDL_Palette_32_t; + +typedef struct my_SDL_PixelFormat_32_s +{ + ptr_t palette; // my_SDL_Palette_t * + uint8_t BitsPerPixel; + uint8_t BytesPerPixel; + uint8_t Rloss; + uint8_t Gloss; + uint8_t Bloss; + uint8_t Aloss; + uint8_t Rshift; + uint8_t Gshift; + uint8_t Bshift; + uint8_t Ashift; + uint32_t Rmask; + uint32_t Gmask; + uint32_t Bmask; + uint32_t Amask; + uint32_t colorkey; + uint8_t alpha; +} my_SDL_PixelFormat_32_t; + +typedef struct my_SDL_Surface_32_s +{ + uint32_t flags; + ptr_t format; // my_SDL_PixelFormat_t * + int w; + int h; + uint16_t pitch; + uint16_t dummy; + ptr_t pixels; // void * + int offset; + ptr_t hwdata; //struct private_hwdata* + my_SDL_Rect_t clip_rect; + uint32_t unused1; + uint32_t locked; + ptr_t map; // void * + unsigned int format_version; + int refcount; +} my_SDL_Surface_32_t; + +void inplace_SDL_Surface_to_64(void* a); +void inplace_SDL_Surface_to_32(void* a); +void inplace_SDL_PixelFormat_to_64(void* a); +void inplace_SDL_PixelFormat_to_64_nopalette(void* a); +void inplace_SDL_PixelFormat_to_32(void* a); +void inplace_SDL_Palette_to_64(void* a); +void inplace_SDL_Palette_to_32(void* a); + +typedef struct my_SDL_keysym_s +{ + uint8_t scancode; + int sym; + int mod; + uint16_t unicode; +} my_SDL_keysym_t; + +typedef struct my_SDL_keysym_32_s +{ + uint8_t scancode; + int sym; + int mod; + uint16_t unicode; +} my_SDL_keysym_32_t; + + +typedef enum my_SDL_EventType_s +{ + SDL_NOEVENT, + SDL_ACTIVEEVENT, + SDL_KEYDOWN, + SDL_KEYUP, + SDL_MOUSEMOTION, + SDL_MOUSEBUTTONDOWN, + SDL_MOUSEBUTTONUP, + SDL_JOYAXISMOTION, + SDL_JOYBALLMOTION, + SDL_JOYHATMOTION, + SDL_JOYBUTTONDOWN, + SDL_JOYBUTTONUP, + SDL_QUIT, + SDL_SYSWMEVENT, + SDL_EVENT_RESERVEDA, + SDL_EVENT_RESERVEDB, + SDL_VIDEORESIZE, + SDL_VIDEOEXPOSE, + SDL_EVENT_RESERVED2, + SDL_EVENT_RESERVED3, + SDL_EVENT_RESERVED4, + SDL_EVENT_RESERVED5, + SDL_EVENT_RESERVED6, + SDL_EVENT_RESERVED7, + SDL_USEREVENT = 24, + SDL_NUMEVENTS = 32 +} my_SDL_EventType_t; + +typedef struct my_SDL_ActiveEvent_s +{ + uint8_t type; + uint8_t gain; + uint8_t state; +} my_SDL_ActiveEvent_t; + +typedef struct my_SDL_KeyboardEvent_s +{ + uint8_t type; + uint8_t which; + uint8_t state; + my_SDL_keysym_t keysym; +} my_SDL_KeyboardEvent_t; + +typedef struct my_SDL_MouseMotionEvent_s +{ + uint8_t type; + uint8_t which; + uint8_t state; + uint16_t x; + uint16_t y; + int16_t xrel; + int16_t yrel; +} my_SDL_MouseMotionEvent_t; + +typedef struct my_SDL_MouseButtonEvent_s +{ + uint8_t type; + uint8_t which; + uint8_t button; + uint8_t state; + uint16_t x; + uint16_t y; +} my_SDL_MouseButtonEvent_t; + +typedef struct my_SDL_JoyAxisEvent_s +{ + uint8_t type; + uint8_t which; + uint8_t axis; + int16_t value; +} my_SDL_JoyAxisEvent_t; + +typedef struct my_SDL_JoyBallEvent_s +{ + uint8_t type; + uint8_t which; + uint8_t ball; + int16_t xrel; + int16_t yrel; +} my_SDL_JoyBallEvent_t; + +typedef struct my_SDL_JoyHatEvent_s +{ + uint8_t type; + uint8_t which; + uint8_t hat; + uint8_t value; +} my_SDL_JoyHatEvent_t; + +typedef struct my_SDL_JoyButtonEvent_s +{ + uint8_t type; + uint8_t which; + uint8_t button; + uint8_t state; +} my_SDL_JoyButtonEvent_t; + +typedef struct my_SDL_ResizeEvent_s +{ + uint8_t type; + int w; + int h; +} my_SDL_ResizeEvent_t; + +typedef struct my_SDL_ExposeEvent_s +{ + uint8_t type; +} my_SDL_ExposeEvent_t; + +typedef struct my_SDL_QuitEvent_s +{ + uint8_t type; +} my_SDL_QuitEvent_t; + +typedef struct my_SDL_UserEvent_s +{ + uint8_t type; + int code; + void *data1; + void *data2; +} my_SDL_UserEvent_t; + +typedef struct my_SDL_version_s { + uint8_t major; + uint8_t minor; + uint8_t patch; +} my_SDL_version_t; + +typedef struct my_SDL_SysWMinfo_s { + my_SDL_version_t version; + int subsystem; + union { + struct { + void* display; + void* window; + void (*lock_func)(void); + void (*unlock_func)(void); + void* fswindow; + void* wmwindow; + void* gfxdisplay; + } x11; + } info; +} my_SDL_SysWMinfo_t; + +typedef union my_XEvent_s { + int Type; + long pad[24]; +} my_XEvent_t; + +typedef struct my_SDL_SysWMmsg_s +{ + my_SDL_version_t version; + int subsystem; + union { + my_XEvent_t xevent; + } event; +} my_SDL_SysWMmsg_t; + + +typedef struct my_SDL_SysWMEvent_s +{ + uint8_t type; + my_SDL_SysWMmsg_t *msg; +} my_SDL_SysWMEvent_t; + +typedef union my_SDL_Event_s +{ + uint8_t type; + my_SDL_ActiveEvent_t active; + my_SDL_KeyboardEvent_t key; + my_SDL_MouseMotionEvent_t motion; + my_SDL_MouseButtonEvent_t button; + my_SDL_JoyAxisEvent_t jaxis; + my_SDL_JoyBallEvent_t jball; + my_SDL_JoyHatEvent_t jhat; + my_SDL_JoyButtonEvent_t jbutton; + my_SDL_ResizeEvent_t resize; + my_SDL_ExposeEvent_t expose; + my_SDL_QuitEvent_t quit; + my_SDL_UserEvent_t user; + my_SDL_SysWMEvent_t syswm; +} my_SDL_Event_t; + +typedef struct my_SDL_ActiveEvent_32_s +{ + uint8_t type; + uint8_t gain; + uint8_t state; +} my_SDL_ActiveEvent_32_t; + +typedef struct my_SDL_KeyboardEvent_32_s +{ + uint8_t type; + uint8_t which; + uint8_t state; + my_SDL_keysym_32_t keysym; +} my_SDL_KeyboardEvent_32_t; + +typedef struct my_SDL_MouseMotionEvent_32_s +{ + uint8_t type; + uint8_t which; + uint8_t state; + uint16_t x; + uint16_t y; + int16_t xrel; + int16_t yrel; +} my_SDL_MouseMotionEvent_32_t; + +typedef struct my_SDL_MouseButtonEvent_32_s +{ + uint8_t type; + uint8_t which; + uint8_t button; + uint8_t state; + uint16_t x; + uint16_t y; +} my_SDL_MouseButtonEvent_32_t; + +typedef struct my_SDL_JoyAxisEvent_32_s +{ + uint8_t type; + uint8_t which; + uint8_t axis; + int16_t value; +} my_SDL_JoyAxisEvent_32_t; + +typedef struct my_SDL_JoyBallEvent_32_s +{ + uint8_t type; + uint8_t which; + uint8_t ball; + int16_t xrel; + int16_t yrel; +} my_SDL_JoyBallEvent_32_t; + +typedef struct my_SDL_JoyHatEvent_32_s +{ + uint8_t type; + uint8_t which; + uint8_t hat; + uint8_t value; +} my_SDL_JoyHatEvent_32_t; + +typedef struct my_SDL_JoyButtonEvent_32_s +{ + uint8_t type; + uint8_t which; + uint8_t button; + uint8_t state; +} my_SDL_JoyButtonEvent_32_t; + +typedef struct my_SDL_ResizeEvent_32_s +{ + uint8_t type; + int w; + int h; +} my_SDL_ResizeEvent_32_t; + +typedef struct my_SDL_ExposeEvent_32_s +{ + uint8_t type; +} my_SDL_ExposeEvent_32_t; + +typedef struct my_SDL_QuitEvent_32_s +{ + uint8_t type; +} my_SDL_QuitEvent_32_t; + +typedef struct my_SDL_UserEvent_32_s +{ + uint8_t type; + int code; + ptr_t data1; //void* + ptr_t data2; //void* +} my_SDL_UserEvent_32_t; + +typedef struct my_SDL_version_32_s { + uint8_t major; + uint8_t minor; + uint8_t patch; +} my_SDL_version_32_t; + +typedef struct my_SDL_SysWMinfo_32_s { + my_SDL_version_32_t version; + int subsystem; + union { + struct { + ptr_t display; //void* + ptr_t window; //void* + ptr_t lock_func;//void (*lock_func)(void); + ptr_t unlock_func;//void (*unlock_func)(void); + ptr_t fswindow; //void* + ptr_t wmwindow; //void* + ptr_t gfxdisplay; //void* + } x11; + } info; +} my_SDL_SysWMinfo_32_t; + +typedef union my_XEvent_32_s { + int Type; + long_t pad[24]; +} my_XEvent_32_t; + +typedef struct my_SDL_SysWMmsg_32_s +{ + my_SDL_version_32_t version; + int subsystem; + union { + my_XEvent_32_t xevent; + } event; +} my_SDL_SysWMmsg_32_t; + + +typedef struct my_SDL_SysWMEvent_32_s +{ + uint8_t type; + ptr_t msg; //my_SDL_SysWMmsg_t* +} my_SDL_SysWMEvent_32_t; + +typedef union my_SDL_Event_32_s +{ + uint8_t type; + my_SDL_ActiveEvent_32_t active; + my_SDL_KeyboardEvent_32_t key; + my_SDL_MouseMotionEvent_32_t motion; + my_SDL_MouseButtonEvent_32_t button; + my_SDL_JoyAxisEvent_32_t jaxis; + my_SDL_JoyBallEvent_32_t jball; + my_SDL_JoyHatEvent_32_t jhat; + my_SDL_JoyButtonEvent_32_t jbutton; + my_SDL_ResizeEvent_32_t resize; + my_SDL_ExposeEvent_32_t expose; + my_SDL_QuitEvent_32_t quit; + my_SDL_UserEvent_32_t user; + my_SDL_SysWMEvent_32_t syswm; +} my_SDL_Event_32_t; + + +void convert_SDL_Event_to_32(void* dst, const void* src); +void convert_SDL_Event_to_64(void* dst, const void* src); + +// simplified RWops +typedef struct my_SDL_RWops_s { + void* seek; //sdl1_seek + void* read; //sdl1_read + void* write; //sdl1_write + void* close; //sdl1_close + uint32_t type; + void* hidden[3]; // not converting hidden, just moving it +} my_SDL_RWops_t; + +typedef struct my_SDL_RWops_32_s { + ptr_t seek; //sdl1_seek + ptr_t read; //sdl1_read + ptr_t write; //sdl1_write + ptr_t close; //sdl1_close + uint32_t type; + void* hidden[3]; // not converting hidden, just moving it +} my_SDL_RWops_32_t; + +void inplace_SDL_RWops_to_64(void* a); +void inplace_SDL_RWops_to_32(void* a); + +typedef struct my_SDL_VideoInfo_s { + uint32_t hw_available:1; + uint32_t wm_available:1; + uint32_t UnusedBits1:6; + uint32_t UnusedBits2:1; + uint32_t blit_hw:1; + uint32_t blit_hw_CC:1; + uint32_t blit_hw_A:1; + uint32_t blit_sw:1; + uint32_t blit_sw_CC:1; + uint32_t blit_sw_A:1; + uint32_t blit_fill:1; + uint32_t UnusedBits3:16; + uint32_t video_mem; + my_SDL_PixelFormat_t *vfmt; + int current_w; + int current_h; +} my_SDL_VideoInfo_t; + +typedef struct my_SDL_VideoInfo_32_s { + uint32_t hw_available:1; + uint32_t wm_available:1; + uint32_t UnusedBits1:6; + uint32_t UnusedBits2:1; + uint32_t blit_hw:1; + uint32_t blit_hw_CC:1; + uint32_t blit_hw_A:1; + uint32_t blit_sw:1; + uint32_t blit_sw_CC:1; + uint32_t blit_sw_A:1; + uint32_t blit_fill:1; + uint32_t UnusedBits3:16; + uint32_t video_mem; + ptr_t vfmt; // my_SDL_PixelFormat_t * + int current_w; + int current_h; +} my_SDL_VideoInfo_32_t; + +typedef struct my_SDL_AudioCVT_s { + int needed; + uint16_t src_format; + uint16_t dest_format; + double rate_incr; + uint8_t *buf; + int len; + int len_cvt; + int len_mult; + double len_ratio; + void (*filters[10])(struct my_SDL_AudioCVT_s *cvt, uint16_t format); + int filter_index; +} my_SDL_AudioCVT_t; + +typedef struct my_SDL_AudioCVT_32_s { + int needed; + uint16_t src_format; + uint16_t dest_format; + double rate_incr; + ptr_t buf; //uint8_t * + int len; + int len_cvt; + int len_mult; + double len_ratio; + ptr_t filters[10]; //void (*filters[10])(struct my_SDL_AudioCVT_s *cvt, uint16_t format); + int filter_index; +} my_SDL_AudioCVT_32_t; + +void convert_AudioCVT_to_32(void* d, void* s); +void convert_AudioCVT_to_64(void* d, void* s); + +#endif//__MY_SDL1ALIGN32_H_ \ No newline at end of file diff --git a/src/include/sdl2align32.h b/src/include/sdl2align32.h new file mode 100644 index 0000000..91f54ea --- /dev/null +++ b/src/include/sdl2align32.h @@ -0,0 +1,910 @@ +#ifndef __MY_SDL2ALIGN32_H_ +#define __MY_SDL2ALIGN32_H_ +#include +#include "box32.h" + +typedef struct my_SDL2_DisplayMode_s { + uint32_t format; + int w; + int h; + int refresh_rate; + void* driverdata; +} my_SDL2_DisplayMode_t; + +typedef struct my_SDL2_DisplayMode_32_s { + uint32_t format; + int w; + int h; + int refresh_rate; + ptr_t driverdata; +} my_SDL2_DisplayMode_32_t; + +typedef struct SDL2_CommonEvent_s { + uint32_t type; + uint32_t timestamp; +} my_SDL2_CommonEvent_t; + +typedef struct SDL2_DisplayEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t display; + uint8_t event; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int32_t data1; +} my_SDL2_DisplayEvent_t; + +typedef struct SDL2_WindowEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint8_t event; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int32_t data1; + int32_t data2; +} my_SDL2_WindowEvent_t; + +typedef struct SDL2_Keysym_s { + int32_t scancode; + int32_t sym; + uint16_t mod; + uint32_t unused; +} my_SDL2_Keysym_t; + +typedef struct SDL2_KeyboardEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint8_t state; + uint8_t repeat; + uint8_t padding2; + uint8_t padding3; + my_SDL2_Keysym_t keysym; +} my_SDL2_KeyboardEvent_t; + +typedef struct SDL2_TextEditingEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + char text[32]; + int32_t start; + int32_t length; +} my_SDL2_TextEditingEvent_t; + + +typedef struct SDL2_TextEditingExtEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + char* text; + int32_t start; + int32_t length; +} my_SDL2_TextEditingExtEvent_t; + +typedef struct SDL2_TextInputEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + char text[32]; +} my_SDL2_TextInputEvent_t; + +typedef struct SDL2_MouseMotionEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint32_t which; + uint32_t state; + int32_t x; + int32_t y; + int32_t xrel; + int32_t yrel; +} my_SDL2_MouseMotionEvent_t; + +typedef struct SDL2_MouseButtonEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint32_t which; + uint8_t button; + uint8_t state; + uint8_t clicks; + uint8_t padding1; + int32_t x; + int32_t y; +} my_SDL2_MouseButtonEvent_t; + +typedef struct SDL2_MouseWheelEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint32_t which; + int32_t x; + int32_t y; + uint32_t direction; + float preciseX; + float preciseY; + int32_t mouseX; + int32_t mouseY; +} my_SDL2_MouseWheelEvent_t; + +typedef struct SDL2_JoyAxisEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t axis; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int16_t value; + uint16_t padding4; +} my_SDL2_JoyAxisEvent_t; + + +typedef struct SDL2_JoyBallEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t ball; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int16_t xrel; + int16_t yrel; +} my_SDL2_JoyBallEvent_t; + +typedef struct SDL2_JoyHatEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t hat; + uint8_t value; + uint8_t padding1; + uint8_t padding2; +} my_SDL2_JoyHatEvent_t; + +typedef struct SDL2_JoyButtonEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t button; + uint8_t state; + uint8_t padding1; + uint8_t padding2; +} my_SDL2_JoyButtonEvent_t; + +typedef struct SDL2_JoyDeviceEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; +} my_SDL2_JoyDeviceEvent_t; + + +typedef struct SDL2_JoyBatteryEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + int32_t level; +} my_SDL2_JoyBatteryEvent_t; + +typedef struct SDL2_ControllerAxisEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t axis; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int16_t value; + uint16_t padding4; +} my_SDL2_ControllerAxisEvent_t; + + +typedef struct SDL2_ControllerButtonEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t button; + uint8_t state; + uint8_t padding1; + uint8_t padding2; +} my_SDL2_ControllerButtonEvent_t; + + +typedef struct SDL2_ControllerDeviceEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; +} my_SDL2_ControllerDeviceEvent_t; + +typedef struct SDL2_ControllerTouchpadEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + int32_t touchpad; + int32_t finger; + float x; + float y; + float pressure; +} my_SDL2_ControllerTouchpadEvent_t; + +typedef struct SDL2_ControllerSensorEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + int32_t sensor; + float data[3]; + uint64_t timestamp_us; +} my_SDL2_ControllerSensorEvent_t; + +typedef struct SDL2_AudioDeviceEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t which; + uint8_t iscapture; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; +} my_SDL2_AudioDeviceEvent_t; + +typedef struct SDL2_TouchFingerEvent_s { + uint32_t type; + uint32_t timestamp; + int64_t touchId; + int64_t fingerId; + float x; + float y; + float dx; + float dy; + float pressure; + uint32_t windowID; +} my_SDL2_TouchFingerEvent_t; + +typedef struct SDL2_MultiGestureEvent_s { + uint32_t type; + uint32_t timestamp; + int64_t touchId; + float dTheta; + float dDist; + float x; + float y; + uint16_t numFingers; + uint16_t padding; +} my_SDL2_MultiGestureEvent_t; + + +typedef struct SDL2_DollarGestureEvent_s { + uint32_t type; + uint32_t timestamp; + int64_t touchId; + int64_t gestureId; + uint32_t numFingers; + float error; + float x; + float y; +} my_SDL2_DollarGestureEvent_t; + +typedef struct SDL2_DropEvent_s { + uint32_t type; + uint32_t timestamp; + char* file; + uint32_t windowID; +} my_SDL2_DropEvent_t; + +typedef struct SDL2_SensorEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + float data[6]; + uint64_t timestamp_us; +} my_SDL2_SensorEvent_t; + + +typedef struct SDL2_QuitEvent_s { + uint32_t type; + uint32_t timestamp; +} my_SDL2_QuitEvent_t; + + +typedef struct SDL2_UserEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + int32_t code; + void* data1; + void* data2; +} my_SDL2_UserEvent_t; + +typedef struct SDL2_SysWMEvent_s { + uint32_t type; + uint32_t timestamp; + void* msg; +} my_SDL2_SysWMEvent_t; + + +typedef union my_SDL2_Event_s { + uint32_t type; + my_SDL2_CommonEvent_t common; + my_SDL2_DisplayEvent_t display; + my_SDL2_WindowEvent_t window; + my_SDL2_KeyboardEvent_t key; + my_SDL2_TextEditingEvent_t edit; + my_SDL2_TextEditingExtEvent_t editExt; + my_SDL2_TextInputEvent_t text; + my_SDL2_MouseMotionEvent_t motion; + my_SDL2_MouseButtonEvent_t button; + my_SDL2_MouseWheelEvent_t wheel; + my_SDL2_JoyAxisEvent_t jaxis; + my_SDL2_JoyBallEvent_t jball; + my_SDL2_JoyHatEvent_t jhat; + my_SDL2_JoyButtonEvent_t jbutton; + my_SDL2_JoyDeviceEvent_t jdevice; + my_SDL2_JoyBatteryEvent_t jbattery; + my_SDL2_ControllerAxisEvent_t caxis; + my_SDL2_ControllerButtonEvent_t cbutton; + my_SDL2_ControllerDeviceEvent_t cdevice; + my_SDL2_ControllerTouchpadEvent_t ctouchpad; + my_SDL2_ControllerSensorEvent_t csensor; + my_SDL2_AudioDeviceEvent_t adevice; + my_SDL2_SensorEvent_t sensor; + my_SDL2_QuitEvent_t quit; + my_SDL2_UserEvent_t user; + my_SDL2_SysWMEvent_t syswm; + my_SDL2_TouchFingerEvent_t tfinger; + my_SDL2_MultiGestureEvent_t mgesture; + my_SDL2_DollarGestureEvent_t dgesture; + my_SDL2_DropEvent_t drop; +} my_SDL2_Event_t; + +typedef struct SDL2_CommonEvent_32_s { + uint32_t type; + uint32_t timestamp; +} my_SDL2_CommonEvent_32_t; + +typedef struct SDL2_DisplayEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t display; + uint8_t event; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int32_t data1; +} my_SDL2_DisplayEvent_32_t; + +typedef struct SDL2_WindowEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint8_t event; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int32_t data1; + int32_t data2; +} my_SDL2_WindowEvent_32_t; + +typedef struct SDL2_Keysym_32_s { + int32_t scancode; + int32_t sym; + uint16_t mod; + uint32_t unused; +} my_SDL2_Keysym_32_t; + +typedef struct SDL2_KeyboardEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint8_t state; + uint8_t repeat; + uint8_t padding2; + uint8_t padding3; + my_SDL2_Keysym_32_t keysym; +} my_SDL2_KeyboardEvent_32_t; + +typedef struct SDL2_TextEditingEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + char text[32]; + int32_t start; + int32_t length; +} my_SDL2_TextEditingEvent_32_t; + + +typedef struct SDL2_TextEditingExtEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + ptr_t text; //char* + int32_t start; + int32_t length; +} my_SDL2_TextEditingExtEvent_32_t; + +typedef struct SDL2_TextInputEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + char text[32]; +} my_SDL2_TextInputEvent_32_t; + +typedef struct SDL2_MouseMotionEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint32_t which; + uint32_t state; + int32_t x; + int32_t y; + int32_t xrel; + int32_t yrel; +} my_SDL2_MouseMotionEvent_32_t; + +typedef struct SDL2_MouseButtonEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint32_t which; + uint8_t button; + uint8_t state; + uint8_t clicks; + uint8_t padding1; + int32_t x; + int32_t y; +} my_SDL2_MouseButtonEvent_32_t; + +typedef struct SDL2_MouseWheelEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint32_t which; + int32_t x; + int32_t y; + uint32_t direction; + float preciseX; + float preciseY; + int32_t mouseX; + int32_t mouseY; +} my_SDL2_MouseWheelEvent_32_t; + +typedef struct SDL2_JoyAxisEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t axis; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int16_t value; + uint16_t padding4; +} my_SDL2_JoyAxisEvent_32_t; + + +typedef struct SDL2_JoyBallEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t ball; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int16_t xrel; + int16_t yrel; +} my_SDL2_JoyBallEvent_32_t; + +typedef struct SDL2_JoyHatEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t hat; + uint8_t value; + uint8_t padding1; + uint8_t padding2; +} my_SDL2_JoyHatEvent_32_t; + +typedef struct SDL2_JoyButtonEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t button; + uint8_t state; + uint8_t padding1; + uint8_t padding2; +} my_SDL2_JoyButtonEvent_32_t; + +typedef struct SDL2_JoyDeviceEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; +} my_SDL2_JoyDeviceEvent_32_t; + + +typedef struct SDL2_JoyBatteryEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + int32_t level; +} my_SDL2_JoyBatteryEvent_32_t; + +typedef struct SDL2_ControllerAxisEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t axis; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int16_t value; + uint16_t padding4; +} my_SDL2_ControllerAxisEvent_32_t; + + +typedef struct SDL2_ControllerButtonEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t button; + uint8_t state; + uint8_t padding1; + uint8_t padding2; +} my_SDL2_ControllerButtonEvent_32_t; + + +typedef struct SDL2_ControllerDeviceEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; +} my_SDL2_ControllerDeviceEvent_32_t; + +typedef struct SDL2_ControllerTouchpadEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + int32_t touchpad; + int32_t finger; + float x; + float y; + float pressure; +} my_SDL2_ControllerTouchpadEvent_32_t; + +typedef struct SDL2_ControllerSensorEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + int32_t sensor; + float data[3]; + uint64_t timestamp_us; +} my_SDL2_ControllerSensorEvent_32_t; + +typedef struct SDL2_AudioDeviceEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t which; + uint8_t iscapture; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; +} my_SDL2_AudioDeviceEvent_32_t; + +typedef struct SDL2_TouchFingerEvent_32_s { + uint32_t type; + uint32_t timestamp; + int64_t touchId; + int64_t fingerId; + float x; + float y; + float dx; + float dy; + float pressure; + uint32_t windowID; +} my_SDL2_TouchFingerEvent_32_t; + +typedef struct SDL2_MultiGestureEvent_32_s { + uint32_t type; + uint32_t timestamp; + int64_t touchId; + float dTheta; + float dDist; + float x; + float y; + uint16_t numFingers; + uint16_t padding; +} my_SDL2_MultiGestureEvent_32_t; + + +typedef struct SDL2_DollarGestureEvent_32_s { + uint32_t type; + uint32_t timestamp; + int64_t touchId; + int64_t gestureId; + uint32_t numFingers; + float error; + float x; + float y; +} my_SDL2_DollarGestureEvent_32_t; + +typedef struct SDL2_DropEvent_32_s { + uint32_t type; + uint32_t timestamp; + ptr_t file; + uint32_t windowID; +} my_SDL2_DropEvent_32_t; + +typedef struct SDL2_SensorEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + float data[6]; + uint64_t timestamp_us; +} my_SDL2_SensorEvent_32_t; + + +typedef struct SDL2_QuitEvent_32_s { + uint32_t type; + uint32_t timestamp; +} my_SDL2_QuitEvent_32_t; + + +typedef struct SDL2_UserEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + int32_t code; + ptr_t data1; + ptr_t data2; +} my_SDL2_UserEvent_32_t; + +typedef struct SDL2_SysWMEvent_32_s { + uint32_t type; + uint32_t timestamp; + ptr_t msg; +} my_SDL2_SysWMEvent_32_t; + + +typedef union my_SDL2_Event_32_s { + uint32_t type; + my_SDL2_CommonEvent_32_t common; + my_SDL2_DisplayEvent_32_t display; + my_SDL2_WindowEvent_32_t window; + my_SDL2_KeyboardEvent_32_t key; + my_SDL2_TextEditingEvent_32_t edit; + my_SDL2_TextEditingExtEvent_32_t editExt; + my_SDL2_TextInputEvent_32_t text; + my_SDL2_MouseMotionEvent_32_t motion; + my_SDL2_MouseButtonEvent_32_t button; + my_SDL2_MouseWheelEvent_32_t wheel; + my_SDL2_JoyAxisEvent_32_t jaxis; + my_SDL2_JoyBallEvent_32_t jball; + my_SDL2_JoyHatEvent_32_t jhat; + my_SDL2_JoyButtonEvent_32_t jbutton; + my_SDL2_JoyDeviceEvent_32_t jdevice; + my_SDL2_JoyBatteryEvent_32_t jbattery; + my_SDL2_ControllerAxisEvent_32_t caxis; + my_SDL2_ControllerButtonEvent_32_t cbutton; + my_SDL2_ControllerDeviceEvent_32_t cdevice; + my_SDL2_ControllerTouchpadEvent_32_t ctouchpad; + my_SDL2_ControllerSensorEvent_32_t csensor; + my_SDL2_AudioDeviceEvent_32_t adevice; + my_SDL2_SensorEvent_32_t sensor; + my_SDL2_QuitEvent_32_t quit; + my_SDL2_UserEvent_32_t user; + my_SDL2_SysWMEvent_32_t syswm; + my_SDL2_TouchFingerEvent_32_t tfinger; + my_SDL2_MultiGestureEvent_32_t mgesture; + my_SDL2_DollarGestureEvent_32_t dgesture; + my_SDL2_DropEvent_32_t drop; +} my_SDL2_Event_32_t; + +typedef enum SDL2_EventType { + SDL2_FIRSTEVENT = 0, + SDL2_QUIT = 0x100, + SDL2_APP_TERMINATING, + SDL2_APP_LOWMEMORY, + SDL2_APP_WILLENTERBACKGROUND, + SDL2_APP_DIDENTERBACKGROUND, + SDL2_APP_WILLENTERFOREGROUND, + SDL2_APP_DIDENTERFOREGROUND, + SDL2_LOCALECHANGED, + SDL2_DISPLAYEVENT = 0x150, + SDL2_WINDOWEVENT = 0x200, + SDL2_SYSWMEVENT, + SDL2_KEYDOWN = 0x300, + SDL2_KEYUP, + SDL2_TEXTEDITING, + SDL2_TEXTINPUT, + SDL2_KEYMAPCHANGED, + SDL2_TEXTEDITING_EXT, + SDL2_MOUSEMOTION = 0x400, + SDL2_MOUSEBUTTONDOWN, + SDL2_MOUSEBUTTONUP, + SDL2_MOUSEWHEEL, + SDL2_JOYAXISMOTION = 0x600, + SDL2_JOYBALLMOTION, + SDL2_JOYHATMOTION, + SDL2_JOYBUTTONDOWN, + SDL2_JOYBUTTONUP, + SDL2_JOYDEVICEADDED, + SDL2_JOYDEVICEREMOVED, + SDL2_JOYBATTERYUPDATED, + SDL2_CONTROLLERAXISMOTION = 0x650, + SDL2_CONTROLLERBUTTONDOWN, + SDL2_CONTROLLERBUTTONUP, + SDL2_CONTROLLERDEVICEADDED, + SDL2_CONTROLLERDEVICEREMOVED, + SDL2_CONTROLLERDEVICEREMAPPED, + SDL2_CONTROLLERTOUCHPADDOWN, + SDL2_CONTROLLERTOUCHPADMOTION, + SDL2_CONTROLLERTOUCHPADUP, + SDL2_CONTROLLERSENSORUPDATE, + SDL2_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3, + SDL2_CONTROLLERSTEAMHANDLEUPDATED, + SDL2_FINGERDOWN = 0x700, + SDL2_FINGERUP, + SDL2_FINGERMOTION, + SDL2_DOLLARGESTURE = 0x800, + SDL2_DOLLARRECORD, + SDL2_MULTIGESTURE, + SDL2_CLIPBOARDUPDATE = 0x900, + SDL2_DROPFILE = 0x1000, + SDL2_DROPTEXT, + SDL2_DROPBEGIN, + SDL2_DROPCOMPLETE, + SDL2_AUDIODEVICEADDED = 0x1100, + SDL2_AUDIODEVICEREMOVED, + SDL2_SENSORUPDATE = 0x1200, + SDL2_RENDER_TARGETS_RESET = 0x2000, + SDL2_RENDER_DEVICE_RESET, + SDL2_POLLSENTINEL = 0x7F00, + SDL2_USEREVENT = 0x8000, + SDL2_LASTEVENT = 0xFFFF +} SDL2_EventType; + +typedef struct my_SDL2_Palette_s { + int ncolors; + void* colors; + uint32_t version; + int refcount; +} my_SDL2_Palette_t; + +typedef struct my_SDL2_PixelFormat_s { + uint32_t format; + my_SDL2_Palette_t* palette; + uint8_t BitsPerPixel; + uint8_t BytesPerPixel; + uint8_t padding[2]; + uint32_t Rmask; + uint32_t Gmask; + uint32_t Bmask; + uint32_t Amask; + uint8_t Rloss; + uint8_t Gloss; + uint8_t Bloss; + uint8_t Aloss; + uint8_t Rshift; + uint8_t Gshift; + uint8_t Bshift; + uint8_t Ashift; + int refcount; + struct my_SDL2_PixelFormat_s* next; +} my_SDL2_PixelFormat_t; + +typedef struct my_SDL2_Rect_s { + int x, y; + int w, h; +} my_SDL2_Rect_t; + +typedef struct my_SDL2_Surface_s { + uint32_t flags; + my_SDL2_PixelFormat_t* format; + int w, h; + int pitch; + void* pixels; + void* userdata; + int locked; + void* list_blitmap; + my_SDL2_Rect_t clip_rect; + void* map; + int refcount; +} my_SDL2_Surface_t; + +typedef struct my_SDL2_Palette_32_s { + int ncolors; + ptr_t colors; + uint32_t version; + int refcount; +} my_SDL2_Palette_32_t; + +typedef struct my_SDL2_PixelFormat_32_s { + uint32_t format; + ptr_t palette; + uint8_t BitsPerPixel; + uint8_t BytesPerPixel; + uint8_t padding[2]; + uint32_t Rmask; + uint32_t Gmask; + uint32_t Bmask; + uint32_t Amask; + uint8_t Rloss; + uint8_t Gloss; + uint8_t Bloss; + uint8_t Aloss; + uint8_t Rshift; + uint8_t Gshift; + uint8_t Bshift; + uint8_t Ashift; + int refcount; + ptr_t next; +} my_SDL2_PixelFormat_32_t; + +// used to mirror the pixelformat on x86 side, as the one in native side is a global static used by SDL2 and so cannot be inplace shrinked +typedef struct my_SDL2_PixelFormat_32_ext_s { + my_SDL2_PixelFormat_32_t fmt; + my_SDL2_PixelFormat_t* ref; + struct my_SDL2_PixelFormat_32_ext_s* next; +} my_SDL2_PixelFormat_32_ext_t; + +typedef struct my_SDL2_Rect_32_s { + int x, y; + int w, h; +} my_SDL2_Rect_32_t; + +typedef struct my_SDL2_Surface_32_s { + uint32_t flags; + ptr_t format; + int w, h; + int pitch; + ptr_t pixels; + ptr_t userdata; + int locked; + ptr_t list_blitmap; + my_SDL2_Rect_32_t clip_rect; + ptr_t map; + int refcount; +} my_SDL2_Surface_32_t; + +// simplified RWops +typedef struct my_SDL2_RWops_s { + void* size; + void* seek; + void* read; + void* write; + void* close; + uint32_t type; + void* hidden[3]; +} my_SDL2_RWops_t; + +typedef struct my_SDL2_RWops_32_s { + ptr_t size; + ptr_t seek; + ptr_t read; + ptr_t write; + ptr_t close; + uint32_t type; + ptr_t hidden[3]; // not converting hidden, just moving it +} my_SDL2_RWops_32_t; + +void inplace_SDL2_DisplayMode_to_64(void* a); +void inplace_SDL2_DisplayMode_to_32(void* a); +void convert_SDL2_DisplayMode_to_64(void* dst_, void* src_); +void convert_SDL2_DisplayMode_to_32(void* dst_, void* src_); + +void convert_SDL2_Event_to_64(void* dst_, const void* src_); +void convert_SDL2_Event_to_32(void* dst_, const void* src_); +void inplace_SDL2_Event_shrink(void* e); +void inplace_SDL2_Event_enlarge(void* e); + +void inplace_SDL2_Palette_to_32(void* a); +void inplace_SDL2_PixelFormat_to_32(void* a); +void* replace_SDL2_PixelFormat_to_32_ext(void* a); +void inplace_SDL2_Surface_to_32(void* a); +void inplace_SDL2_Palette_to_64(void* a); +void inplace_SDL2_PixelFormat_to_64(void* a); +void* replace_SDL2_PixelFormat_to_64_ext(void* a); +void inplace_SDL2_Surface_to_64(void* a); + +void inplace_SDL2_RWops_to_32(void* a); +void inplace_SDL2_RWops_to_64(void* a); + +#endif // __MY_SDL2ALIGN32_H_ \ No newline at end of file diff --git a/src/include/sdl2rwops.h b/src/include/sdl2rwops.h index 1b13c09..bdc54a9 100644 --- a/src/include/sdl2rwops.h +++ b/src/include/sdl2rwops.h @@ -2,6 +2,9 @@ #define __SDL2RWOPS_H__ typedef struct SDL2_RWops_s SDL2_RWops_t; // the actual SDL2 SDL_RWops +#ifdef BOX32 +typedef struct my_SDL2_RWops_32_s my_SDL2_RWops_32_t; +#endif typedef struct x64emu_s x64emu_t; typedef SDL2_RWops_t* (*sdl2_allocrw)(void); @@ -23,10 +26,14 @@ SDL2_RWops_t* AddNativeRW2(x64emu_t* emu, SDL2_RWops_t* ops); SDL2_RWops_t* RWNativeStart2(x64emu_t* emu, SDL2_RWops_t* ops); // put native RW functions, wrapping the emulated (callback style) ones if needed void RWNativeEnd2(SDL2_RWops_t* ops); // put emulated function back in place int isRWops(SDL2_RWops_t* ops); // 1 if ops seems to be a valid RWops, 0 if not +#ifdef BOX32 +int isRWops32(my_SDL2_RWops_32_t* ops); +#endif int64_t RWNativeSeek2(SDL2_RWops_t *ops, int64_t offset, int32_t whence); -uint32_t RWNativeRead2(SDL2_RWops_t* ops, void* ptr, uint32_t size, uint32_t maxnum); -int32_t RWNativeWrite2(SDL2_RWops_t *ops, const void *ptr, int32_t size, int32_t num); +int64_t RWNativeSize2(SDL2_RWops_t *ops); +size_t RWNativeRead2(SDL2_RWops_t* ops, void* ptr, size_t size, size_t maxnum); +size_t RWNativeWrite2(SDL2_RWops_t *ops, const void *ptr, size_t size, size_t num); int32_t RWNativeClose2(SDL2_RWops_t* ops); #endif diff --git a/src/include/signals.h b/src/include/signals.h index deda21f..9c8bba1 100644 --- a/src/include/signals.h +++ b/src/include/signals.h @@ -1,9 +1,23 @@ #ifndef __SIGNALS_H__ #define __SIGNALS_H__ -#include +#include + +#include "x64_signals.h" +#include "box64context.h" typedef void (*sighandler_t)(int); +#ifdef ANDROID +typedef struct x64_sigaction_s { + int sa_flags; + union { + sighandler_t _sa_handler; + void (*_sa_sigaction)(int, siginfo_t *, void *); + } _u; + sigset_t sa_mask; + void (*sa_restorer)(void); +} x64_sigaction_t; +#else typedef struct x64_sigaction_s { union { sighandler_t _sa_handler; @@ -13,6 +27,7 @@ typedef struct x64_sigaction_s { uint32_t sa_flags; void (*sa_restorer)(void); } x64_sigaction_t; +#endif typedef struct x64_sigaction_restorer_s { union { @@ -24,6 +39,29 @@ typedef struct x64_sigaction_restorer_s { sigset_t sa_mask; } x64_sigaction_restorer_t; +#ifdef BOX32 +typedef struct __attribute__((packed)) i386_sigaction_s { + union { + ptr_t _sa_handler; // sighandler_t + ptr_t _sa_sigaction; //void (*_sa_sigaction)(int, siginfo_t *, void *); + } _u; + sigset_t sa_mask; + uint32_t sa_flags; + ptr_t sa_restorer; //void (*sa_restorer)(void); +} i386_sigaction_t; + +typedef struct __attribute__((packed)) i386_sigaction_restorer_s { + union { + ptr_t _sa_handler; //sighandler_t + ptr_t _sa_sigaction; //void (*_sa_sigaction)(int, siginfo_t *, void *); + } _u; + uint32_t sa_flags; + ptr_t sa_restorer; //void (*sa_restorer)(void); + sigset_t sa_mask; +} i386_sigaction_restorer_t; + +#endif + sighandler_t my_signal(x64emu_t* emu, int signum, sighandler_t handler); sighandler_t my___sysv_signal(x64emu_t* emu, int signum, sighandler_t handler); sighandler_t my_sysv_signal(x64emu_t* emu, int signum, sighandler_t handler); @@ -36,8 +74,4 @@ int my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigaction_resto void init_signal_helper(box64context_t* context); void fini_signal_helper(void); -void emit_signal(x64emu_t* emu, int sig, void* addr, int code); -void emit_interruption(x64emu_t* emu, int num, void* addr); -void emit_div0(x64emu_t* emu, void* addr, int code); - #endif //__SIGNALS_H__ diff --git a/src/include/symbolfuncs.h b/src/include/symbolfuncs.h new file mode 100644 index 0000000..ba99f92 --- /dev/null +++ b/src/include/symbolfuncs.h @@ -0,0 +1,8 @@ +#ifndef __SYMBOLFUNCS_H__ +#define __SYMBOLFUNCS_H__ + +#include + +int PrintFunctionAddr(uintptr_t nextaddr, const char* text); // 0 if nothing was found + +#endif // __SYMBOLFUNCS_H__ \ No newline at end of file diff --git a/src/include/sysinfo.h b/src/include/sysinfo.h new file mode 100644 index 0000000..c75853c --- /dev/null +++ b/src/include/sysinfo.h @@ -0,0 +1,25 @@ +#ifndef __SYSINFO_H_ +#define __SYSINFO_H_ +#include +#include + +typedef struct x64emu_s x64emu_t; +typedef struct sysinfo_s { + uint64_t frequency; + uint64_t ncpu; + uint64_t bogomips; + char* cpuname; + + uint64_t box64_ncpu; + char* box64_cpuname; + + uint32_t emulated_frequency : 1; + uint32_t read_frequency : 1; + uint32_t read_ncpu : 1; + uint32_t read_bogomips : 1; + uint32_t read_cpuname : 1; +} sysinfo_t; + +void InitializeSystemInfo(void); +uint32_t helper_getcpu(x64emu_t* emu); +#endif //__SYSINFO_H_ \ No newline at end of file diff --git a/src/include/threads.h b/src/include/threads.h index 8ed0e4c..3a906c7 100644 --- a/src/include/threads.h +++ b/src/include/threads.h @@ -1,19 +1,44 @@ -#ifndef _THREADS_H_ -#define _THREADS_H_ +#ifndef _BOX64_THREADS_H_ +#define _BOX64_THREADS_H_ +#include typedef struct box64context_s box64context_t; typedef struct x64emu_s x64emu_t; +typedef struct emuthread_s { + uintptr_t fnc; + void* arg; + x64emu_t* emu; + int join; + int is32bits; + uintptr_t self; + ulong_t hself; + int cancel_cap, cancel_size; + void** cancels; +} emuthread_t; + void CleanStackSize(box64context_t* context); void init_pthread_helper(void); void fini_pthread_helper(box64context_t* context); void clean_current_emuthread(void); +#ifdef BOX32 +void init_pthread_helper_32(void); +void fini_pthread_helper_32(box64context_t* context); +#endif // prepare an "emuthread structure" in pet and return address of function pointer for a "thread creation routine" void* my_prepare_thread(x64emu_t *emu, void* f, void* arg, int ssize, void** pet); //check and unlock if a mutex is locked by current thread (works only for PTHREAD_MUTEX_ERRORCHECK typed mutex) int checkUnlockMutex(void* m); +//check if a mutex is locked by current thread (works only for PTHREAD_MUTEX_ERRORCHECK typed mutex) +int checkNolockMutex(void* m); + +#ifdef BAD_PKILL +void add_thread(void* t, emuthread_t* et); +void del_thread(void* t); +emuthread_t* get_thread(void* t); +#endif -#endif //_THREADS_H_ \ No newline at end of file +#endif //_BOX64_THREADS_H_ \ No newline at end of file diff --git a/src/include/vulkanoverlay.h b/src/include/vulkanoverlay.h new file mode 100644 index 0000000..9258b37 --- /dev/null +++ b/src/include/vulkanoverlay.h @@ -0,0 +1,8 @@ +#ifndef __VULKANOVERLAY_H__ +#define __VULKANOVERLAY_H__ + +void* LoadVulkanOverlay(const char* path, int flags); +void* GetSymbolVulkanOverlay(void* g, const char* sym); +int FreeVulkanOverlay(void* g); + +#endif //__VULKANOVERLAY_H__ \ No newline at end of file diff --git a/src/include/wine_tools.h b/src/include/wine_tools.h index 5c60fec..d8cefcb 100644 --- a/src/include/wine_tools.h +++ b/src/include/wine_tools.h @@ -10,4 +10,6 @@ void* get_wine_prereserve(void); void dynarec_wine_prereserve(void); #endif +void DetectUnityPlayer(char* filename); + #endif //__WINE_TOOLS_H__ diff --git a/src/include/x64_signals.h b/src/include/x64_signals.h new file mode 100644 index 0000000..08583b9 --- /dev/null +++ b/src/include/x64_signals.h @@ -0,0 +1,177 @@ +#ifndef __X64_SIGNALS_H__ +#define __X64_SIGNALS_H__ + +#include + +#define X64_SIGHUP 1 +#define X64_SIGINT 2 +#define X64_SIGQUIT 3 +#define X64_SIGILL 4 +#define X64_SIGTRAP 5 +#define X64_SIGABRT 6 +#define X64_SIGIOT 6 +#define X64_SIGBUS 7 +#define X64_SIGFPE 8 +#define X64_SIGKILL 9 +#define X64_SIGUSR1 10 +#define X64_SIGSEGV 11 +#define X64_SIGUSR2 12 +#define X64_SIGPIPE 13 +#define X64_SIGALRM 14 +#define X64_SIGTERM 15 +#define X64_SIGSTKFLT 16 +#define X64_SIGCHLD 17 +#define X64_SIGCONT 18 +#define X64_SIGSTOP 19 +#define X64_SIGTSTP 20 +#define X64_SIGTTIN 21 +#define X64_SIGTTOU 22 +#define X64_SIGURG 23 +#define X64_SIGXCPU 24 +#define X64_SIGXFSZ 25 +#define X64_SIGVTALRM 26 +#define X64_SIGPROF 27 +#define X64_SIGWINCH 28 +#define X64_SIGIO 29 +#define X64_SIGPWR 30 +#define X64_SIGSYS 31 + +#if !defined(NEED_SIG_CONV) && X64_SIGHUP != SIGHUP + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGINT != SIGINT + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGQUIT != SIGQUIT + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGILL != SIGILL + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGTRAP != SIGTRAP + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGABRT != SIGABRT + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGIOT != SIGIOT + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGBUS != SIGBUS + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGFPE != SIGFPE + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGKILL != SIGKILL + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGUSR1 != SIGUSR1 + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGSEGV != SIGSEGV + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGUSR2 != SIGUSR2 + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGPIPE != SIGPIPE + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGALRM != SIGALRM + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGTERM != SIGTERM + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGSTKFLT != SIGSTKFLT + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGCHLD != SIGCHLD + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGCONT != SIGCONT + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGSTOP != SIGSTOP + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGTSTP != SIGTSTP + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGTTIN != SIGTTIN + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGTTOU != SIGTTOU + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGURG != SIGURG + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGXCPU != SIGXCPU + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGXFSZ != SIGXFSZ + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGVTALRM != SIGVTALRM + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGPROF != SIGPROF + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGWINCH != SIGWINCH + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGIO != SIGIO + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGPWR != SIGPWR + #define NEED_SIG_CONV +#endif +#if !defined(NEED_SIG_CONV) && X64_SIGSYS != SIGSYS + #define NEED_SIG_CONV +#endif + +#ifdef NEED_SIG_CONV +int signal_to_x64(int sig); +int signal_from_x64(int sig); +#define SUPER_SIGNAL \ +GO(SIGHUP) \ +GO(SIGINT) \ +GO(SIGQUIT) \ +GO(SIGILL) \ +GO(SIGTRAP) \ +GO(SIGABRT) \ +GO(SIGIOT) \ +GO(SIGBUS) \ +GO(SIGFPE) \ +GO(SIGKILL) \ +GO(SIGUSR1) \ +GO(SIGSEGV) \ +GO(SIGUSR2) \ +GO(SIGPIPE) \ +GO(SIGALRM) \ +GO(SIGTERM) \ +GO(SIGSTKFLT) \ +GO(SIGCHLD) \ +GO(SIGCONT) \ +GO(SIGSTOP) \ +GO(SIGTSTP) \ +GO(SIGTTIN) \ +GO(SIGTTOU) \ +GO(SIGURG) \ +GO(SIGXCPU) \ +GO(SIGXFSZ) \ +GO(SIGVTALRM) \ +GO(SIGPROF) \ +GO(SIGWINCH) \ +GO(SIGIO) \ +GO(SIGPWR) \ +GO(SIGSYS) +#else +#define signal_to_x64(A) A +#define signal_from_x64(A) A +#endif + +#endif //__X64_SIGNALS_H__ \ No newline at end of file diff --git a/src/include/x64emu.h b/src/include/x64emu.h index 5591823..9b06b41 100644 --- a/src/include/x64emu.h +++ b/src/include/x64emu.h @@ -1,65 +1,35 @@ #ifndef __X86EMU_H_ #define __X86EMU_H_ +#include + typedef struct x64emu_s x64emu_t; typedef struct box64context_s box64context_t; typedef struct elfheader_s elfheader_t; x64emu_t *NewX64Emu(box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack); -x64emu_t *NewX64EmuFromStack(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack); +x64emu_t *NewX64EmuFromStack(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize); void SetupX64Emu(x64emu_t *emu, x64emu_t *ref); void FreeX64Emu(x64emu_t **x64emu); void FreeX64EmuFromStack(x64emu_t **emu); void CloneEmu(x64emu_t *newemu, const x64emu_t* emu); void CopyEmu(x64emu_t *newemu, const x64emu_t* emu); void SetTraceEmu(uintptr_t trace_start, uintptr_t trace_end); +void print_wrapper_name(int level, x64emu_t* emu); box64context_t* GetEmuContext(x64emu_t* emu); -uint32_t GetEAX(x64emu_t *emu); -uint64_t GetRAX(x64emu_t *emu); -void SetEAX(x64emu_t *emu, uint32_t v); -void SetEBX(x64emu_t *emu, uint32_t v); -void SetECX(x64emu_t *emu, uint32_t v); -void SetEDX(x64emu_t *emu, uint32_t v); -void SetEDI(x64emu_t *emu, uint32_t v); -void SetESI(x64emu_t *emu, uint32_t v); -void SetEBP(x64emu_t *emu, uint32_t v); -//void SetESP(x64emu_t *emu, uint32_t v); -void SetRAX(x64emu_t *emu, uint64_t v); -void SetRBX(x64emu_t *emu, uint64_t v); -void SetRCX(x64emu_t *emu, uint64_t v); -void SetRDX(x64emu_t *emu, uint64_t v); -void SetRDI(x64emu_t *emu, uint64_t v); -void SetRSI(x64emu_t *emu, uint64_t v); -void SetRBP(x64emu_t *emu, uint64_t v); -void SetRSP(x64emu_t *emu, uint64_t v); -void SetRIP(x64emu_t *emu, uint64_t v); -//void SetFS(x64emu_t *emu, uint16_t v); -//uint16_t GetFS(x64emu_t *emu); -uint64_t GetRSP(x64emu_t *emu); -uint64_t GetRBP(x64emu_t *emu); void ResetFlags(x64emu_t *emu); -void ResetSegmentsCache(x64emu_t *emu); const char* DumpCPURegs(x64emu_t* emu, uintptr_t ip, int is32bits); -void StopEmu(x64emu_t* emu, const char* reason, int is32bits); -void EmuCall(x64emu_t* emu, uintptr_t addr); -void AddCleanup(x64emu_t *emu, void *p); -void AddCleanup1Arg(x64emu_t *emu, void *p, void* a, elfheader_t* h); -void CallCleanup(x64emu_t *emu, elfheader_t* h); -void CallAllCleanup(x64emu_t *emu); void UnimpOpcode(x64emu_t* emu, int is32bits); -uint64_t ReadTSC(x64emu_t* emu); -uint64_t ReadTSCFrequency(x64emu_t* emu); - double FromLD(void* ld); // long double (80bits pointer) -> double long double LD2localLD(void* ld); // long double (80bits pointer) -> long double (80 or 128bits) void LD2D(void* ld, void* d); // long double (80bits) -> double (64bits) void D2LD(void* d, void* ld); // double (64bits) -> long double (64bits) -int printFunctionAddr(uintptr_t nextaddr, const char* text); // 0 if nothing was found -const char* getAddrFunctionName(uintptr_t addr); +uintptr_t GetSegmentBaseEmu(x64emu_t* emu, int seg); +void UpdateFlags(x64emu_t* emu); -#endif //__X86EMU_H_ \ No newline at end of file +#endif //__X86EMU_H_ diff --git a/src/include/x64run.h b/src/include/x64run.h deleted file mode 100644 index b6c9e96..0000000 --- a/src/include/x64run.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef __X64RUN_H_ -#define __X64RUN_H_ -#include - -typedef struct x64emu_s x64emu_t; -typedef struct x64test_s x64test_t; -int Run(x64emu_t *emu, int step); // 0 if run was successfull, 1 if error in x86 world -int RunTest(x64test_t *test); -void DynaRun(x64emu_t *emu); - -uint32_t LibSyscall(x64emu_t *emu); -void PltResolver(x64emu_t* emu); -extern uintptr_t pltResolver; -int GetTID(void); - -#endif //__X64RUN_H_ \ No newline at end of file diff --git a/src/include/x64test.h b/src/include/x64test.h new file mode 100644 index 0000000..be417ce --- /dev/null +++ b/src/include/x64test.h @@ -0,0 +1,10 @@ +#ifndef __X64TEST_H_ +#define __X64TEST_H_ + +typedef struct x64test_s x64test_t; +int RunTest(x64test_t* test); + +void x64test_step(x64emu_t* ref, uintptr_t ip); +void x64test_check(x64emu_t* ref, uintptr_t ip); + +#endif // __X64TEST_H_ diff --git a/src/include/x64tls.h b/src/include/x64tls.h index 66f0d9e..c9d579b 100644 --- a/src/include/x64tls.h +++ b/src/include/x64tls.h @@ -7,8 +7,7 @@ typedef struct thread_area_32_s thread_area_32_t; uint32_t my_set_thread_area_32(x64emu_t* emu, thread_area_32_t* td); uint32_t my_modify_ldt(x64emu_t* emu, int op, thread_area_t* td, int size); -tlsdatasize_t* getTLSData(box64context_t *context); -void* GetSegmentBase(uint32_t desc); +void refreshTLSData(x64emu_t* emu); int my_arch_prctl(x64emu_t *emu, int code, void* addr); diff --git a/src/include/x64trace.h b/src/include/x64trace.h index e7c3efd..74e092d 100644 --- a/src/include/x64trace.h +++ b/src/include/x64trace.h @@ -13,6 +13,7 @@ void DeleteX86TraceDecoder(zydis_dec_t **dec); zydis_dec_t* InitX64TraceDecoder(box64context_t *context); void DeleteX64TraceDecoder(zydis_dec_t **dec); -const char* DecodeX64Trace(zydis_dec_t *dec, uintptr_t p); +const char* DecodeX64Trace(zydis_dec_t* dec, uintptr_t p, int withhex); +int OpcodeOK(zydis_dec_t* dec, uintptr_t p); #endif //__X64TRACE_H_ \ No newline at end of file diff --git a/src/librarian/globalsymbols.c b/src/librarian/globalsymbols.c index fb561b6..812d177 100644 --- a/src/librarian/globalsymbols.c +++ b/src/librarian/globalsymbols.c @@ -13,6 +13,7 @@ #include "box64context.h" #include "librarian.h" #include "library.h" +#include "globalsymbols.h" // workaround for Globals symbols @@ -37,24 +38,18 @@ } -// *********** GTK ***************** -EXPORT void* gdk_display = NULL; // in case it's used... - -void my_checkGlobalGdkDisplay() +void addGlobalRef(void* p, const char* symname) { - uintptr_t globoffs, globend; - GLOB(gdk_display, NULL) + if(!strcmp(symname, "gdk_display") && !BOX64ENV(nogtk)) + addGlobalGdkDisplayRef(p); } -void my_setGlobalGThreadsInit() -{ - int val = 1; - uintptr_t globoffs, globend; - if (GetGlobalNoWeakSymbolStartEnd(my_context->maplib, "g_threads_got_initialized", &globoffs, &globend, -1, NULL, 0, NULL)) { - printf_log(LOG_DEBUG, "Global g_threads_got_initialized workaround, @%p <= %d\n", (void*)globoffs, val); - memcpy((void*)globoffs, &val, sizeof(val)); - } -} +// *********** GTK ***************** +EXPORT void* gdk_display = NULL; // in case it's used... + +static void** gdk_display_refs = NULL; +static size_t gdk_display_cap = 0; +static size_t gdk_display_size = 0; char* getGDKX11LibName(); void** my_GetGTKDisplay() @@ -70,19 +65,58 @@ void** my_GetGTKDisplay() return s; } +void my_checkGlobalGdkDisplay() +{ + uintptr_t globoffs, globend; + void** p_gdk_display = &gdk_display; + my_GetGTKDisplay(); // make sure to refresh gdk_display + printf_log(LOG_DEBUG, "Refreshing Glbal gdk_diplay with %p\n", gdk_display); + GLOB(p_gdk_display, NULL) + // also check referenced addresses + for(size_t i=0; imaplib, "g_threads_got_initialized", &globoffs, &globend, -1, NULL, 0, NULL)) { + printf_log(LOG_DEBUG, "Global g_threads_got_initialized workaround, @%p <= %d\n", (void*)globoffs, val); + memcpy((void*)globoffs, &val, sizeof(val)); + } +} + // **************** NCurses **************** -EXPORT int COLS; -EXPORT int LINES; -EXPORT int TABSIZE; -EXPORT void* curscr; -EXPORT void* newscr; -EXPORT void* stdscr; -EXPORT void* acs_map[128]; -EXPORT void* UP; -EXPORT void* BC; -EXPORT uint8_t PC; -EXPORT uint16_t ospeed; -EXPORT void* ttytype; +EXPORT int COLS = 0; +EXPORT int LINES = 0; +EXPORT int TABSIZE = 0; +EXPORT void* curscr = NULL; +EXPORT void* newscr = NULL; +EXPORT void* stdscr = NULL; +EXPORT void* acs_map[64] = {0}; +EXPORT void* UP = NULL; +EXPORT void* BC = NULL; +EXPORT uint8_t PC = 0; +EXPORT uint16_t ospeed = 0; +EXPORT void* ttytype[32] = {0}; +EXPORT void* cur_term = NULL; void my_checkGlobalTInfo() { @@ -99,6 +133,7 @@ void my_checkGlobalTInfo() GLOB(PC, NULL) GLOB(ospeed, NULL) GLOB(ttytype, NULL) + GLOB(cur_term, NULL) } void my_updateGlobalTInfo() @@ -116,6 +151,7 @@ void my_updateGlobalTInfo() TOGLOB(PC, NULL) TOGLOB(ospeed, NULL) TOGLOB(ttytype, NULL) + TOGLOB(cur_term, NULL) } // **************** getopts **************** diff --git a/src/librarian/globalsymbols32.c b/src/librarian/globalsymbols32.c new file mode 100644 index 0000000..b74d498 --- /dev/null +++ b/src/librarian/globalsymbols32.c @@ -0,0 +1,108 @@ +#define _GNU_SOURCE +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "callback.h" +#include "box32context.h" +#include "librarian.h" +#include "library.h" + +// workaround for Globals symbols + +#define GLOB(A, B, C) \ + if (GetGlobalNoWeakSymbolStartEnd(my_context->maplib, #A, &globoffs, &globend, -1, NULL, 0, NULL)) { \ + printf_log(LOG_DEBUG, "Global " #A " workaround, @%p <- %p\n", (void*)globoffs, &A); \ + memcpy((void*)globoffs, &A, C); \ + } \ + if (B && GetGlobalNoWeakSymbolStartEnd(my_context->maplib, #A, &globoffs, &globend, 2, B, 1, NULL)) { \ + printf_log(LOG_DEBUG, "Global " #A " workaround, @%p <- %p\n", (void*)globoffs, &A); \ + memcpy((void*)globoffs, &A, C); \ + } + +#define TOGLOB(A, B, C) \ + if (GetGlobalNoWeakSymbolStartEnd(my_context->maplib, #A, &globoffs, &globend, -1, NULL, 0, NULL)) { \ + printf_log(LOG_DEBUG, "Global " #A " workaround, @%p -> %p\n", (void*)globoffs, &A); \ + memcpy(&A, (void*)globoffs, C); \ + } \ + if (B && GetGlobalNoWeakSymbolStartEnd(my_context->maplib, #A, &globoffs, &globend, 2, B, 1, NULL)) { \ + printf_log(LOG_DEBUG, "Global " #A " workaround, @%p -> %p\n", (void*)globoffs, &A); \ + memcpy(&A, (void*)globoffs, C); \ + } + + +// **************** NCurses **************** +extern int COLS; +extern int LINES; +extern int TABSIZE; +extern void* curscr; +extern void* newscr; +extern void* stdscr; +extern void* acs_map[64]; +extern void* UP; +extern void* BC; +extern uint8_t PC; +extern uint16_t ospeed; +extern void* ttytype[32]; + +void my32_checkGlobalTInfo() +{ + uintptr_t globoffs, globend; + GLOB(COLS, NULL, sizeof(int)) + GLOB(LINES, NULL, sizeof(int)) + GLOB(TABSIZE, NULL, sizeof(int)) + GLOB(curscr, NULL, sizeof(ptr_t)) + GLOB(newscr, NULL, sizeof(ptr_t)) + GLOB(stdscr, NULL, sizeof(ptr_t)) + GLOB(acs_map, NULL, sizeof(ptr_t)) + GLOB(UP, NULL, sizeof(ptr_t)) + GLOB(BC, NULL, sizeof(ptr_t)) + GLOB(PC, NULL, sizeof(uint8_t)) + GLOB(ospeed, NULL, sizeof(uint16_t)) + GLOB(ttytype, NULL, sizeof(ptr_t)) +} + +void my32_updateGlobalTInfo() +{ + uintptr_t globoffs, globend; + TOGLOB(COLS, NULL, sizeof(int)) + TOGLOB(LINES, NULL, sizeof(int)) + TOGLOB(TABSIZE, NULL, sizeof(int)) + TOGLOB(curscr, NULL, sizeof(ptr_t)) + TOGLOB(newscr, NULL, sizeof(ptr_t)) + TOGLOB(stdscr, NULL, sizeof(ptr_t)) + TOGLOB(acs_map, NULL, sizeof(ptr_t)) + TOGLOB(UP, NULL, sizeof(ptr_t)) + TOGLOB(BC, NULL, sizeof(ptr_t)) + TOGLOB(PC, NULL, sizeof(uint8_t)) + TOGLOB(ospeed, NULL, sizeof(uint16_t)) + TOGLOB(ttytype, NULL, sizeof(ptr_t)) +} + +// **************** getopts **************** +extern char *optarg; +extern int optind, opterr, optopt; + +void my32_updateGlobalOpt() +{ + uintptr_t globoffs, globend; + TOGLOB(optarg, "GLIBC_2.2.5", sizeof(ptr_t)); + TOGLOB(optind, "GLIBC_2.2.5", sizeof(int)); + TOGLOB(opterr, "GLIBC_2.2.5", sizeof(int)); + TOGLOB(optopt, "GLIBC_2.2.5", sizeof(int)); +} + +void my32_checkGlobalOpt() +{ + uintptr_t globoffs, globend; + GLOB(optarg, "GLIBC_2.2.5", sizeof(ptr_t)); + GLOB(optind, "GLIBC_2.2.5", sizeof(int)); + GLOB(opterr, "GLIBC_2.2.5", sizeof(int)); + GLOB(optopt, "GLIBC_2.2.5", sizeof(int)); +} diff --git a/src/librarian/librarian.c b/src/librarian/librarian.c index 56a0fff..f33ddff 100644 --- a/src/librarian/librarian.c +++ b/src/librarian/librarian.c @@ -12,6 +12,9 @@ #include "x64emu.h" #include "box64context.h" #include "elfloader.h" +#ifdef BOX32 +#include "box32.h" +#endif #include "bridge.h" @@ -254,15 +257,31 @@ static int AddNeededLib_add(lib_t** maplib, int local, needed_libs_t* needed, in if (lib->type == LIB_EMULATED) { // Need to add library to the linkmap (put here so the link is ordered) - linkmap_t *lm = addLinkMapLib(lib); - if(!lm) { - // Crashed already - printf_dump(LOG_DEBUG, "Failure to add lib linkmap\n"); - return 1; + #ifdef BOX32 + if(box64_is32bits) { + linkmap32_t *lm = addLinkMapLib32(lib); + if(!lm) { + // Crashed already + printf_dump(LOG_DEBUG, "Failure to add lib linkmap\n"); + return 1; + } + lm->l_addr = (Elf32_Addr)to_ptrv(GetElfDelta(lib->e.elf)); + lm->l_name = to_cstring(lib->name); + lm->l_ld = to_ptrv(GetLoadedDynamicSection(lib->e.elf)); + } else + #endif + { + linkmap_t *lm = addLinkMapLib(lib); + if(!lm) { + // Crashed already + printf_dump(LOG_DEBUG, "Failure to add lib linkmap\n"); + return 1; + } + lm->l_addr = (Elf64_Addr)GetElfDelta(lib->e.elf); + lm->l_name = lib->name; + lm->l_ld = GetLoadedDynamicSection(lib->e.elf); } - lm->l_addr = (Elf64_Addr)GetElfDelta(lib->e.elf); - lm->l_name = lib->name; - lm->l_ld = GetDynamicSection(lib->e.elf); + //TODO: it seems to never be removed! } IncRefCount(lib, emu); return 0; @@ -335,14 +354,8 @@ int AddNeededLib(lib_t* maplib, int local, int bindnow, int deepbind, needed_lib printf_log(LOG_INFO, "Error initializing needed lib %s\n", needed->names[i]); ret = 1; } - // error while loadind lib, unload... - if(ret) { - int n = needed->size; - for (int i=0; ilibs[n-i-1], emu); - } // all done - if(allow_missing_libs) return 0; + if(BOX64ENV(allow_missing_libs)) return 0; return ret; } EXPORTDYN @@ -351,7 +364,7 @@ void RemoveNeededLib(lib_t* maplib, int local, needed_libs_t* needed, box64conte if(!needed) // no needed libs, no problems return; for(int i=0; isize; ++i) { - if(box64_log>=LOG_DEBUG && needed->libs[i]) + if (BOX64ENV(log)>=LOG_DEBUG && needed->libs[i]) printf_dump(LOG_DEBUG, "Will remove after failed init %s\n", needed->names[i]); AddNeededLib_remove(maplib, local, &needed->libs[i], box64, emu); } @@ -443,6 +456,102 @@ int GetNoSelfSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, u // nope, not found return weak; } +static int isLibPreloaded(library_t* lib) +{ + if(my_context->preload) + for(int i=0; ipreload->size; ++i) + if(my_context->preload->libs[i] == lib) + return 1; + return 0; +} +int GetNextSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, size_t size, int version, const char* vername, int veropt, void** elfsym) +{ + assert(self); // need self for this one + int weak = 0; + int next = 0; + void* sym; + // search in needed libs from preloaded first, in order + if(my_context->preload) + for(int i=0; ipreload->size; ++i) { + if(next) { + if(GetLibGlobalSymbolStartEnd(my_context->preload->libs[i], name, start, end, size, &weak, &version, &vername, 0, &veropt, elfsym)) { + return 1; + } + if(GetLibWeakSymbolStartEnd(my_context->preload->libs[i], name, start, end, size, &weak, &version, &vername, 0, &veropt, elfsym)) { + return 1; + } + } + if(self==GetElf(my_context->preload->libs[i])) { + next = 1; + } + } + if(maplib==my_context->maplib) { + if(next) { + if((sym = ElfGetGlobalSymbolStartEnd(my_context->elfs[0], start, end, name, &version, &vername, 0, &veropt))) { + if(elfsym) *elfsym = sym; + return 1; + } + if((sym = ElfGetWeakSymbolStartEnd(my_context->elfs[0], start, end, name, &version, &vername, 0, &veropt))) { + if(elfsym) *elfsym = sym; + return 1; + } + } + if(self==my_context->elfs[0]) { + next = 1; + } + } + // build a lib list loaded after "self" + needed_libs_t* libs = copy_neededlib(GetELfNeededLibs(self)); + if(!libs) libs = new_neededlib(0); + int idx = 0; + while(idx!=libs->size) { + int cnt = GetNeededLibsN(libs->libs[idx]); + for(int i=0; ilibs[idx], i); + if(lib && lib->name) + add1lib_neededlib_name(libs, lib, lib->name); + } + ++idx; + } + // add remainling libs to the list + if(maplib) { + for(int i=0; ilibsz && !next; ++i) if(!isLibPreloaded(maplib->libraries[i])) { + if(next && maplib->libraries[i]) { + add1lib_neededlib_name(libs, maplib->libraries[i], maplib->libraries[i]->name); + } else + if(self==GetElf(maplib->libraries[i])) + next = 1; + } + } + // search the list + for(int i=0; isize; ++i) { + if(GetLibGlobalSymbolStartEnd(libs->libs[i], name, start, end, size, &weak, &version, &vername, 0, &veropt, elfsym)) { + free_neededlib(libs); + return 1; + } + if(GetLibWeakSymbolStartEnd(libs->libs[i], name, start, end, size, &weak, &version, &vername, 0, &veropt, elfsym)) { + free_neededlib(libs); + return 1; + } + } + + // search in global symbols + if(maplib) { + for(int i=0; ilibsz; ++i) if(!isLibPreloaded(maplib->libraries[i])) { + if(next) { + if(GetLibGlobalSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, &version, &vername, 0, &veropt, elfsym)) { + return 1; + } + if(GetLibWeakSymbolStartEnd(maplib->libraries[i], name, start, end, size, &weak, &version, &vername, 0, &veropt, elfsym)) { + return 1; + } + } + if(self==GetElf(maplib->libraries[i])) + next = 1; + } + } + return 0; +} static int GetGlobalSymbolStartEnd_internal(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, elfheader_t* self, int* version, const char** vername, int* veropt, void** elfsym) { int weak = 0; @@ -492,7 +601,7 @@ int GetGlobalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, u if(GetGlobalSymbolStartEnd_internal(maplib, name, start, end, self, &version, &vername, &veropt, elfsym)) { if(start && end && *end==*start) { // object is of 0 sized, try to see an "_END" object of null size uintptr_t start2, end2; - char* buff = (char*)malloc(strlen(name) + strlen("_END") + 1); + char* buff = (char*)box_malloc(strlen(name) + strlen("_END") + 1); strcpy(buff, name); strcat(buff, "_END"); if(GetGlobalSymbolStartEnd_internal(maplib, buff, &start2, &end2, self, &version, &vername, &veropt, elfsym)) { @@ -505,13 +614,13 @@ int GetGlobalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, u } #ifndef STATICBUILD // some special case symbol, defined inside box64 itself - if(!strcmp(name, "gdk_display") && !box64_nogtk) { + if(!box64_is32bits &&!strcmp(name, "gdk_display") && !BOX64ENV(nogtk)) { *start = (uintptr_t)my_GetGTKDisplay(); *end = *start+sizeof(void*); printf_log(LOG_INFO, "Using global gdk_display for gdk-x11 (%p:%p)\n", start, *(void**)start); return 1; } - if(!strcmp(name, "g_threads_got_initialized") && !box64_nogtk) { + if(!box64_is32bits && !strcmp(name, "g_threads_got_initialized") && !BOX64ENV(nogtk)) { *start = (uintptr_t)my_GetGthreadsGotInitialized(); *end = *start+sizeof(int); printf_log(LOG_INFO, "Using global g_threads_got_initialized for gthread2 (%p:%p)\n", start, *(void**)start); @@ -565,7 +674,7 @@ int GetGlobalWeakSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* star if(GetGlobalWeakSymbolStartEnd_internal(maplib, name, start, end, self, &version, &vername, &veropt, elfsym)) { if(start && end && *end==*start) { // object is of 0 sized, try to see an "_END" object of null size uintptr_t start2, end2; - char* buff = (char*)malloc(strlen(name) + strlen("_END") + 1); + char* buff = (char*)box_malloc(strlen(name) + strlen("_END") + 1); strcpy(buff, name); strcat(buff, "_END"); if(GetGlobalWeakSymbolStartEnd_internal(maplib, buff, &start2, &end2, self, &version, &vername, &veropt, elfsym)) { @@ -578,14 +687,14 @@ int GetGlobalWeakSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* star } #ifndef STATICBUILD // some special case symbol, defined inside box64 itself - if(!strcmp(name, "gdk_display") && !box64_nogtk) { + if(!box64_is32bits && !strcmp(name, "gdk_display") && !BOX64ENV(nogtk)) { *start = (uintptr_t)my_GetGTKDisplay(); *end = *start+sizeof(void*); if(elfsym) *elfsym = NULL; printf_log(LOG_INFO, "Using global gdk_display for gdk-x11 (%p:%p)\n", start, *(void**)start); return 1; } - if(!strcmp(name, "g_threads_got_initialized") && !box64_nogtk) { + if(!box64_is32bits && !strcmp(name, "g_threads_got_initialized") && !BOX64ENV(nogtk)) { *start = (uintptr_t)my_GetGthreadsGotInitialized(); *end = *start+sizeof(int); if(elfsym) *elfsym = NULL; @@ -703,16 +812,34 @@ int GetLocalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, ui return 0; } -int GetSymTabStartEnd(lib_t* maplib, const char* name, uintptr_t* start, uintptr_t* end) +int GetAnySymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, uintptr_t* end, int version, const char* vername, int veropt) { if(!maplib) return 0; for(int i=0; ilibsz; ++i) { elfheader_t* h = GetElf(maplib->libraries[i]); - if(h && ElfGetSymTabStartEnd(h, start, end, name)) + if(h && ElfGetSymbolStartEnd(h, start, end, name, &version, &vername, 1, &veropt)) return 1; } return 0; + +} + +int GetSymTabStartEnd(lib_t* maplib, const char* name, uintptr_t* start, uintptr_t* end) +{ + if(!maplib) + return 0; + for(int i=0; ilibsz; ++i) { + elfheader_t* h = GetElf(maplib->libraries[i]); + if(box64_is32bits) { + if(h && ElfGetSymTabStartEnd32(h, start, end, name)) + return 1; + } else { + if(h && ElfGetSymTabStartEnd64(h, start, end, name)) + return 1; + } + } + return 0; } diff --git a/src/librarian/library.c b/src/librarian/library.c index a4f3196..0400d16 100644 --- a/src/librarian/library.c +++ b/src/librarian/library.c @@ -40,6 +40,16 @@ #endif #undef GO +#ifdef BOX32 +#define GO(P, N) int wrapped##N##_init32(library_t* lib, box64context_t *box64); \ + void wrapped##N##_fini32(library_t* lib); +#ifdef STATICBUILD +#include "library_list_static_32.h" +#else +#include "library_list_32.h" +#endif +#undef GO +#endif #define GO(P, N) {P, wrapped##N##_init, wrapped##N##_fini}, wrappedlib_t wrappedlibs[] = { @@ -50,6 +60,17 @@ wrappedlib_t wrappedlibs[] = { #endif }; #undef GO +#define GO(P, N) {P, wrapped##N##_init32, wrapped##N##_fini32}, +wrappedlib_t wrappedlibs32[] = { +#ifdef BOX32 +#ifdef STATICBUILD +#include "library_list_static_32.h" +#else +#include "library_list_32.h" +#endif +#endif +}; +#undef GO KHASH_MAP_IMPL_STR(symbolmap, symbol1_t) KHASH_MAP_IMPL_STR(symbol2map, symbol2_t) @@ -154,6 +175,8 @@ int EmuLib_GetWeak(library_t* lib, const char* name, uintptr_t *offs, uintptr_t void* sym; if((sym = ElfGetWeakSymbolStartEnd(lib->e.elf, &start, &end, name, version, vername, local, veropt))) { + if(asked_size && asked_size!=end-start) + return 0; *offs = start; *sz = end-start; *weak = 1; @@ -192,6 +215,8 @@ int EmuLib_GetGlobal(library_t* lib, const char* name, uintptr_t *offs, uintptr_ void* sym; if((sym = ElfGetGlobalSymbolStartEnd(lib->e.elf, &start, &end, name, version, vername, local, veropt))) { + if(asked_size && asked_size!=end-start) + return 0; *offs = start; *sz = end-start; *weak = 0; @@ -211,6 +236,8 @@ int EmuLib_GetLocal(library_t* lib, const char* name, uintptr_t *offs, uintptr_t void* sym; if((sym = ElfGetLocalSymbolStartEnd(lib->e.elf, &start, &end, name, version, vername, local, veropt))) { + if(asked_size && asked_size!=end-start) + return 0; *offs = start; *sz = end-start; *weak = 0; @@ -232,18 +259,21 @@ int DummyLib_GetLocal(library_t* lib, const char* name, uintptr_t *offs, uintptr } static void initWrappedLib(library_t *lib, box64context_t* context) { - int nb = sizeof(wrappedlibs) / sizeof(wrappedlib_t); + int nb = (box64_is32bits?sizeof(wrappedlibs32):sizeof(wrappedlibs)) / sizeof(wrappedlib_t); for (int i=0; iname, wrappedlibs[i].name)==0) { - if(wrappedlibs[i].init(lib, context)) { - // error! - const char* error_str = dlerror(); - if(error_str) // don't print the message if there is no error string from last error - printf_log(LOG_NONE, "Error initializing native %s (last dlerror is %s)\n", lib->name, error_str); + wrappedlib_t* w = box64_is32bits?(&wrappedlibs32[i]):(&wrappedlibs[i]); + if(strcmp(lib->name, w->name)==0) { + int err = w->init(lib, context); + if (err) { + if (err == -1) { + const char* error_str = dlerror(); + if (error_str) // don't print the message if there is no error string from last error + printf_log(LOG_NONE, "Error initializing native %s (last dlerror is %s)\n", lib->name, error_str); + } return; // non blocker... } printf_dump(LOG_INFO, "Using native(wrapped) %s\n", lib->name); - lib->fini = wrappedlibs[i].fini; + lib->fini = w->fini; lib->getglobal = WrappedLib_GetGlobal; lib->getweak = WrappedLib_GetWeak; lib->getlocal = WrappedLib_GetLocal; @@ -258,13 +288,13 @@ static void initWrappedLib(library_t *lib, box64context_t* context) { linkmap_t *lm = addLinkMapLib(lib); if(!lm) { // Crashed already - printf_dump(LOG_DEBUG, "Failure to add lib %s linkmap\n", lib->name); + printf_dlsym_dump(LOG_DEBUG, "Failure to add lib %s linkmap\n", lib->name); break; } struct link_map real_lm; #ifndef ANDROID if(dlinfo(lib->w.lib, RTLD_DI_LINKMAP, &real_lm)) { - printf_dump(LOG_DEBUG, "Failed to dlinfo lib %s\n", lib->name); + printf_dlsym_dump(LOG_DEBUG, "Failed to dlinfo lib %s\n", lib->name); } #endif lm->l_addr = real_lm.l_addr; @@ -286,7 +316,7 @@ static int loadEmulatedLib(const char* libname, library_t *lib, box64context_t* } elfheader_t *elf_header = LoadAndCheckElfHeader(f, libname, 0); if(!elf_header) { - printf_dump(LOG_DEBUG, "Error: reading elf header of %s\n", libname); // this one can be too alarming... + printf_dlsym_dump(LOG_DEBUG, "Error: reading elf header of %s\n", libname); // this one can be too alarming... fclose(f); return 0; } @@ -328,31 +358,43 @@ static int loadEmulatedLib(const char* libname, library_t *lib, box64context_t* } printf_dump(LOG_INFO, "Using emulated %s\n", libname); + int env_changed = 0; #ifdef DYNAREC - if(libname && box64_dynarec_bleeding_edge && strstr(libname, "libmonobdwgc-2.0.so")) { + if(libname && BOX64ENV(dynarec_bleeding_edge) && strstr(libname, "libmonobdwgc-2.0.so")) { printf_dump(LOG_INFO, "MonoBleedingEdge detected, disable Dynarec BigBlock and enable Dynarec StrongMem\n"); - box64_dynarec_bigblock = 0; - box64_dynarec_strongmem = 1; + SET_BOX64ENV(dynarec_bigblock, 0); + SET_BOX64ENV(dynarec_strongmem, 1); + env_changed = 1; + } + if(libname && BOX64ENV(unityplayer) && strstr(libname, "UnityPlayer.so")) { + printf_dump(LOG_INFO, "UnityPlayer detected, applying Unity settings\n"); + SET_BOX64ENV(unity, 1); + env_changed = 1; } - if(libname && box64_dynarec_tbb && strstr(libname, "libtbb.so")) { + if(libname && BOX64ENV(dynarec_tbb) && strstr(libname, "libtbb.so")) { printf_dump(LOG_INFO, "libtbb detected, enable Dynarec StrongMem\n"); - box64_dynarec_strongmem = 3; + SET_BOX64ENV(dynarec_strongmem, 1); + env_changed = 1; } #endif - if(libname && box64_jvm && strstr(libname, "libjvm.so")) { + if(libname && BOX64ENV(jvm) && strstr(libname, "libjvm.so")) { #ifdef DYNAREC printf_dump(LOG_INFO, "libjvm detected, disable Dynarec BigBlock and enable Dynarec StrongMem, hide SSE 4.2\n"); - box64_dynarec_bigblock = 0; - box64_dynarec_strongmem = 1; + SET_BOX64ENV(dynarec_bigblock, 0); + SET_BOX64ENV(dynarec_strongmem, 1); + SET_BOX64ENV(dynarec_safeflags, 2); // for example, SlayTheSpire requires safeflags=2 on the REPZ SCASD opcode #else printf_dump(LOG_INFO, "libjvm detected, hide SSE 4.2\n"); #endif - box64_sse42 = 0; + SET_BOX64ENV(sse42, 0); + env_changed = 1; } - if(libname && box64_libcef && strstr(libname, "libcef.so")) { - printf_dump(LOG_INFO, "libcef detected, using malloc_hack_2\n"); - box64_malloc_hack = 2; + if(libname && BOX64ENV(libcef) && strstr(libname, "libcef.so")) { + printf_dump(LOG_INFO, "libcef detected, using malloc_hack=2\n"); + SET_BOX64ENV(malloc_hack, 2); + env_changed = 1; } + if (env_changed) PrintEnvVariables(&box64env, LOG_INFO); return 1; } return 0; @@ -362,7 +404,7 @@ static void initEmulatedLib(const char* path, library_t *lib, box64context_t* co { char libname[MAX_PATH]; strcpy(libname, path); - int found = FileIsX64ELF(libname); + int found = box64_is32bits?FileIsX86ELF(libname):FileIsX64ELF(libname); if(found) if(loadEmulatedLib(libname, lib, context, verneeded)) return; @@ -371,14 +413,14 @@ static void initEmulatedLib(const char* path, library_t *lib, box64context_t* co { strcpy(libname, context->box64_ld_lib.paths[i]); strcat(libname, path); - if(FileIsX64ELF(libname)) + if(box64_is32bits?FileIsX86ELF(libname):FileIsX64ELF(libname)) if(loadEmulatedLib(libname, lib, context, verneeded)) return; // also try x86_64 variant strcpy(libname, context->box64_ld_lib.paths[i]); - strcat(libname, "x86_64/"); + strcat(libname, box64_is32bits?"i386/":"x86_64/"); strcat(libname, path); - if(FileIsX64ELF(libname)) + if(box64_is32bits?FileIsX86ELF(libname):FileIsX64ELF(libname)) if(loadEmulatedLib(libname, lib, context, verneeded)) return; } @@ -405,12 +447,20 @@ static const char* essential_libs[] = { "libxcb-image.so.0", "libxcb-keysyms.so.1", "libxcb-xtest.so.0", "libxcb-glx.so.0", "libxcb-dri2.so.0", "libxcb-dri3.so.0", "libXtst.so.6", "libXt.so.6", "libXcomposite.so.1", "libXdamage.so.1", "libXmu.so.6", "libxkbcommon.so.0", "libxkbcommon-x11.so.0", "libpulse-simple.so.0", "libpulse.so.0", "libvulkan.so.1", "libvulkan.so", - "ld-linux-x86-64.so.2", "crashhandler.so", "libtcmalloc_minimal.so.0", "libtcmalloc_minimal.so.4", "libanl.so.1" + "ld-linux-x86-64.so.2", "crashhandler.so", "libtcmalloc_minimal.so.0", "libtcmalloc_minimal.so.4", "libanl.so.1", + "ld-linux.so.2", "ld-linux.so.3", "libthread_db.so.1" +}; +static const char* essential_libs_egl[] = { + "libEGL.so", "libGLESv2.so" }; static int isEssentialLib(const char* name) { for (unsigned int i=0; ipath = box_realpath(path, NULL); if(!lib->path) lib->path = box_strdup(path); - if(box64_libGL && !strcmp(path, box64_libGL)) + if(BOX64ENV(libgl) && !strcmp(path, BOX64ENV(libgl))) lib->name = box_strdup("libGL.so.1"); else lib->name = Path2Name(path); lib->nbdot = NbDot(lib->name); lib->type = LIB_UNNKNOW; - printf_dump(LOG_DEBUG, "Simplified name is \"%s\"\n", lib->name); - if(box64_nopulse) { + printf_dlsym_dump(LOG_DEBUG, "Simplified name is \"%s\"\n", lib->name); + if(BOX64ENV(nopulse)) { if(strstr(lib->name, "libpulse.so")==lib->name || strstr(lib->name, "libpulse-simple.so")==lib->name) { box_free(lib->name); box_free(lib->path); @@ -462,7 +512,7 @@ library_t *NewLibrary(const char* path, box64context_t* context, elfheader_t* ve return NULL; } } - if(box64_novulkan) { + if(BOX64ENV(novulkan)) { if(strstr(lib->name, "libvulkan.so")==lib->name) { box_free(lib->name); box_free(lib->path); @@ -473,9 +523,9 @@ library_t *NewLibrary(const char* path, box64context_t* context, elfheader_t* ve } int notwrapped = FindInCollection(lib->name, &context->box64_emulated_libs); int essential = isEssentialLib(lib->name); - if(!notwrapped && box64_prefer_emulated && !essential) + if(!notwrapped && BOX64ENV(prefer_emulated) && !essential) notwrapped = 1; - int precise = (!box64_prefer_wrapped && !essential && path && strchr(path, '/'))?1:0; + int precise = (!BOX64ENV(prefer_wrapped) && !essential && path && strchr(path, '/'))?1:0; if(!notwrapped && precise && strstr(path, "libtcmalloc_minimal.so")) precise = 0; // allow native version for tcmalloc_minimum /* @@ -582,7 +632,7 @@ void Free1Library(library_t **the_lib, x64emu_t* emu) FiniLibrary(lib, emu); - printf_dump(LOG_DEBUG, "Free1Library %s\n", lib->name?:"???"); + printf_dlsym_dump(LOG_DEBUG, "Free1Library %s\n", lib->name?:"???"); // remove lib from maplib/local_maplib... if(my_context) { MapLibRemoveLib(my_context->maplib, lib); @@ -673,12 +723,24 @@ int IsSameLib(library_t* lib, const char* path) ret=1; } else { char rpath[PATH_MAX]; - box_realpath(path, rpath); + (void) box_realpath(path, rpath); if(!strcmp(rpath, lib->path)) ret=1; if(lib->type==LIB_EMULATED && lib->e.elf->path && !strcmp(lib->e.elf->path, rpath)) { ret=1; } + /** + * EasyAntiCheat would use memfd to create a library on the fly, the real path will be something like + * /memfd:2a87dfdb-d3d2-f6db-46be-dabbbd (deleted) + * In this case, handle it by checking the original path. + */ + if (strlen(rpath) >= strlen("/memfd:") && strncmp(rpath, "/memfd:", strlen("/memfd:")) == 0) { + if (!strcmp(path, lib->path)) + ret = 1; + if (lib->type == LIB_EMULATED && lib->e.elf->path && !strcmp(lib->e.elf->path, path)) { + ret = 1; + } + } } if(!ret) { int n = NbDot(name); @@ -789,10 +851,10 @@ static int getSymbolInDataMaps(library_t*lib, const char* name, int noweak, uint if(lib->w.altmy) strcpy(buff, lib->w.altmy); else - strcpy(buff, "my_"); + strcpy(buff, box64_is32bits?"my32_":"my_"); strcat(buff, name); #ifdef STATICBUILD - symbol = kh_value(lib->w.mydatamap, k).addr; + symbol = (void*)kh_value(lib->w.mydatamap, k).addr; #else symbol = dlsym(my_context->box64lib, buff); #endif @@ -814,9 +876,10 @@ static int getSymbolInDataMaps(library_t*lib, const char* name, int noweak, uint } static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, uintptr_t *addr, uintptr_t *size, int* weak) { + const khint_t hash = kh_hash(symbolmap, name); void* symbol; // check in mysymbolmap - khint_t k = kh_get(symbolmap, lib->w.mysymbolmap, name); + khint_t k = kh_get_with_hash(symbolmap, lib->w.mysymbolmap, name, hash); if (k!=kh_end(lib->w.mysymbolmap)) { symbol1_t *s = &kh_value(lib->w.mysymbolmap, k); if(!s->resolved) { @@ -824,7 +887,7 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui if(lib->w.altmy) strcpy(buff, lib->w.altmy); else - strcpy(buff, "my_"); + strcpy(buff, box64_is32bits?"my32_":"my_"); strcat(buff, name); #ifdef STATICBUILD symbol = (void*)s->addr; @@ -835,8 +898,14 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui printf_log(LOG_NONE, "Warning, function %s not found\n", buff); return 0; } - s->addr = AddBridge(lib->w.bridge, s->w, symbol, 0, name); - s->resolved = 1; + void* s2 = dlsym(lib->w.lib, name); + if(s2) { + s->addr = AddBridge2(lib->w.bridge, s->w, symbol, s2, 0, name); + // don't resolve the symbol here, it may change + } else { + s->addr = AddBridge(lib->w.bridge, s->w, symbol, 0, name); + s->resolved = 1; + } } *addr = s->addr; *size = sizeof(void*); @@ -844,7 +913,7 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui return 1; } // check in stsymbolmap (return struct...) - k = kh_get(symbolmap, lib->w.stsymbolmap, name); + k = kh_get_with_hash(symbolmap, lib->w.stsymbolmap, name, hash); if (k!=kh_end(lib->w.stsymbolmap)) { symbol1_t *s = &kh_value(lib->w.stsymbolmap, k); if(!s->resolved) { @@ -852,7 +921,7 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui if(lib->w.altmy) strcpy(buff, lib->w.altmy); else - strcpy(buff, "my_"); + strcpy(buff, box64_is32bits?"my32_":"my_"); strcat(buff, name); #ifdef STATICBUILD symbol = (void*)s->addr; @@ -863,7 +932,7 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui printf_log(LOG_NONE, "Warning, function %s not found\n", buff); return 0; } - s->addr = AddBridge(lib->w.bridge, s->w, symbol, sizeof(void*), name); + s->addr = AddBridge(lib->w.bridge, s->w, symbol, box64_is32bits?4:sizeof(void*), name); s->resolved = 1; } *addr = s->addr; @@ -872,7 +941,7 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui return 1; } // check in symbolmap - k = kh_get(symbolmap, lib->w.symbolmap, name); + k = kh_get_with_hash(symbolmap, lib->w.symbolmap, name, hash); if (k!=kh_end(lib->w.symbolmap)) { symbol1_t *s = &kh_value(lib->w.symbolmap, k); if(!s->resolved) { @@ -909,7 +978,7 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui } if(!noweak) { // check in wmysymbolmap - khint_t k = kh_get(symbolmap, lib->w.wmysymbolmap, name); + khint_t k = kh_get_with_hash(symbolmap, lib->w.wmysymbolmap, name, hash); if (k!=kh_end(lib->w.wmysymbolmap)) { symbol1_t *s = &kh_value(lib->w.wmysymbolmap, k); if(!s->resolved) { @@ -917,7 +986,7 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui if(lib->w.altmy) strcpy(buff, lib->w.altmy); else - strcpy(buff, "my_"); + strcpy(buff, box64_is32bits?"my32_":"my_"); strcat(buff, name); #ifdef STATICBUILD symbol = (void*)s->addr; @@ -928,15 +997,21 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui printf_log(LOG_NONE, "Warning, function %s not found\n", buff); return 0; } + void* s2 = dlsym(lib->w.lib, name); + if(s2) { + s->addr = AddBridge2(lib->w.bridge, s->w, symbol, s2, 0, name); + // don't resolve the symbol here, it may change + } else { s->addr = AddBridge(lib->w.bridge, s->w, symbol, 0, name); s->resolved = 1; } + } *addr = s->addr; *size = sizeof(void*); *weak = 1; return 1; } - k = kh_get(symbolmap, lib->w.wsymbolmap, name); + k = kh_get_with_hash(symbolmap, lib->w.wsymbolmap, name, hash); if (k!=kh_end(lib->w.wsymbolmap)) { symbol1_t *s = &kh_value(lib->w.wsymbolmap, k); if(!s->resolved) { @@ -973,7 +1048,9 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui } } // check in symbol2map - k = kh_get(symbol2map, lib->w.symbol2map, name); + // + // NOTE: symbol2map & symbolmap share the same hash function, so we can use the same hash + k = kh_get_with_hash(symbol2map, lib->w.symbol2map, name, hash); if (k!=kh_end(lib->w.symbol2map)) { symbol2_t *s = &kh_value(lib->w.symbol2map, k); if(!noweak || !s->weak) @@ -1074,6 +1151,64 @@ int GetDeepBind(library_t* lib) return lib->deepbind; } +#ifdef BOX32 +linkmap32_t* getLinkMapLib32(library_t* lib) +{ + linkmap32_t* lm = my_context->linkmap32; + while(lm) { + if(lm->l_lib == lib) + return lm; + lm = (linkmap32_t*)from_ptrv(lm->l_next); + } + return NULL; +} +linkmap32_t* getLinkMapElf32(elfheader_t* h) +{ + linkmap32_t* lm = my_context->linkmap32; + while(lm) { + if(lm->l_lib && lm->l_lib->type==LIB_EMULATED && lm->l_lib->e.elf == h) + return lm; + lm = (linkmap32_t*)from_ptrv(lm->l_next); + } + return NULL; +} +linkmap32_t* addLinkMapLib32(library_t* lib) +{ + if(!my_context->linkmap32) { + my_context->linkmap32 = (linkmap32_t*)actual_calloc(1, sizeof(linkmap32_t)); + my_context->linkmap32->l_lib = lib; + return my_context->linkmap32; + } + linkmap32_t* lm = my_context->linkmap32; + while(lm->l_next) + lm = (linkmap32_t*)from_ptrv(lm->l_next); + lm->l_next = to_ptrv(actual_calloc(1, sizeof(linkmap32_t))); + linkmap32_t* l_next = (linkmap32_t*)from_ptrv(lm->l_next); + l_next->l_lib = lib; + l_next->l_prev = to_ptrv(lm); + return l_next; +} +void removeLinkMapLib32(library_t* lib) +{ + linkmap32_t* lm = getLinkMapLib32(lib); + if(!lm) return; + if(lm->l_next) + ((linkmap32_t*)from_ptrv(lm->l_next))->l_prev = lm->l_prev; + if(lm->l_prev) + ((linkmap32_t*)from_ptrv(lm->l_prev))->l_next = lm->l_next; + actual_free(lm); +} + +void AddMainElfToLinkmap32(elfheader_t* elf) +{ + linkmap32_t* lm = addLinkMapLib32(NULL); // main elf will have a null lib link + + lm->l_addr = (Elf32_Addr)to_ptrv(GetElfDelta(elf)); + lm->l_name = to_cstring(my_context->fullpath); + lm->l_ld = to_ptrv(GetLoadedDynamicSection(elf)); +} +#endif + linkmap_t* getLinkMapLib(library_t* lib) { linkmap_t* lm = my_context->linkmap; @@ -1097,14 +1232,14 @@ linkmap_t* getLinkMapElf(elfheader_t* h) linkmap_t* addLinkMapLib(library_t* lib) { if(!my_context->linkmap) { - my_context->linkmap = (linkmap_t*)box_calloc(1, sizeof(linkmap_t)); + my_context->linkmap = (linkmap_t*)actual_calloc(1, sizeof(linkmap_t)); my_context->linkmap->l_lib = lib; return my_context->linkmap; } linkmap_t* lm = my_context->linkmap; while(lm->l_next) lm = lm->l_next; - lm->l_next = (linkmap_t*)box_calloc(1, sizeof(linkmap_t)); + lm->l_next = (linkmap_t*)actual_calloc(1, sizeof(linkmap_t)); lm->l_next->l_lib = lib; lm->l_next->l_prev = lm; return lm->l_next; @@ -1117,7 +1252,7 @@ void removeLinkMapLib(library_t* lib) lm->l_next->l_prev = lm->l_prev; if(lm->l_prev) lm->l_prev->l_next = lm->l_next; - box_free(lm); + actual_free(lm); } void AddMainElfToLinkmap(elfheader_t* elf) @@ -1126,28 +1261,28 @@ void AddMainElfToLinkmap(elfheader_t* elf) lm->l_addr = (Elf64_Addr)GetElfDelta(elf); lm->l_name = my_context->fullpath; - lm->l_ld = GetDynamicSection(elf); + lm->l_ld = GetLoadedDynamicSection(elf); } needed_libs_t* new_neededlib(int n) { - needed_libs_t* ret = (needed_libs_t*)calloc(1, sizeof(needed_libs_t)); + needed_libs_t* ret = (needed_libs_t*)box_calloc(1, sizeof(needed_libs_t)); ret->cap = ret->size = n; ret->init_size = n; - ret->libs = (library_t**)calloc(n, sizeof(library_t*)); - ret->names = (char**)calloc(n, sizeof(char*)); + ret->libs = (library_t**)box_calloc(n, sizeof(library_t*)); + ret->names = (char**)box_calloc(n, sizeof(char*)); return ret; } void free_neededlib(needed_libs_t* needed) { if(!needed) return; - free(needed->libs); - free(needed->names); + box_free(needed->libs); + box_free(needed->names); needed->libs = NULL; needed->names = NULL; needed->cap = needed->size = 0; - free(needed); + box_free(needed); } void add1_neededlib(needed_libs_t* needed) { @@ -1156,8 +1291,8 @@ void add1_neededlib(needed_libs_t* needed) if(needed->size+1<=needed->cap) return; needed->cap = needed->size+1; - needed->libs = (library_t**)realloc(needed->libs, needed->cap*sizeof(library_t*)); - needed->names = (char**)realloc(needed->names, needed->cap*sizeof(char*)); + needed->libs = (library_t**)box_realloc(needed->libs, needed->cap*sizeof(library_t*)); + needed->names = (char**)box_realloc(needed->names, needed->cap*sizeof(char*)); needed->size++; needed->init_size++; } @@ -1172,8 +1307,8 @@ void add1lib_neededlib(needed_libs_t* needed, library_t* lib, const char* name) // add it if(needed->size==needed->cap) { needed->cap = needed->size+1; - needed->libs = (library_t**)realloc(needed->libs, needed->cap*sizeof(library_t*)); - needed->names = (char**)realloc(needed->names, needed->cap*sizeof(char*)); + needed->libs = (library_t**)box_realloc(needed->libs, needed->cap*sizeof(library_t*)); + needed->names = (char**)box_realloc(needed->names, needed->cap*sizeof(char*)); } needed->libs[needed->size] = lib; needed->names[needed->size] = (char*)name; @@ -1191,8 +1326,8 @@ void add1lib_neededlib_name(needed_libs_t* needed, library_t* lib, const char* n // add it if(needed->size==needed->cap) { needed->cap = needed->size+1; - needed->libs = (library_t**)realloc(needed->libs, needed->cap*sizeof(library_t*)); - needed->names = (char**)realloc(needed->names, needed->cap*sizeof(char*)); + needed->libs = (library_t**)box_realloc(needed->libs, needed->cap*sizeof(library_t*)); + needed->names = (char**)box_realloc(needed->names, needed->cap*sizeof(char*)); } needed->libs[needed->size] = lib; needed->names[needed->size] = (char*)name; @@ -1210,8 +1345,8 @@ void add1libref_neededlib(needed_libs_t* needed, library_t* lib) // add it if(needed->size==needed->cap) { needed->cap = needed->size+4; - needed->libs = (library_t**)realloc(needed->libs, needed->cap*sizeof(library_t*)); - needed->names = (char**)realloc(needed->names, needed->cap*sizeof(char*)); + needed->libs = (library_t**)box_realloc(needed->libs, needed->cap*sizeof(library_t*)); + needed->names = (char**)box_realloc(needed->names, needed->cap*sizeof(char*)); } needed->libs[needed->size] = lib; needed->names[needed->size] = (char*)lib->name; @@ -1222,12 +1357,12 @@ needed_libs_t* copy_neededlib(needed_libs_t* needed) { if(!needed) return NULL; - needed_libs_t* ret = (needed_libs_t*)calloc(1, sizeof(needed_libs_t)); + needed_libs_t* ret = (needed_libs_t*)box_calloc(1, sizeof(needed_libs_t)); ret->cap = needed->cap; ret->size = needed->size; ret->init_size = needed->init_size; - ret->libs = (library_t**)calloc(ret->cap, sizeof(library_t*)); - ret->names = (char**)calloc(ret->cap, sizeof(char*)); + ret->libs = (library_t**)box_calloc(ret->cap, sizeof(library_t*)); + ret->names = (char**)box_calloc(ret->cap, sizeof(char*)); memcpy(ret->libs, needed->libs, ret->size*sizeof(library_t*)); memcpy(ret->names, needed->names, ret->size*sizeof(char*)); return ret; diff --git a/src/librarian/library_private.h b/src/librarian/library_private.h index a13df4a..bd69a36 100644 --- a/src/librarian/library_private.h +++ b/src/librarian/library_private.h @@ -78,7 +78,7 @@ typedef struct elib_s { typedef struct library_s { char* name; // <> path char* path; // original path - int8_t nbdot; // nombre of "." after .so + int8_t nbdot; // number of "." after .so int8_t type; // 0: native(wrapped) 1: emulated(elf) -1: undetermined uint8_t deepbind; wrappedlib_fini_t fini; @@ -133,11 +133,29 @@ typedef struct linkmap_s { library_t* l_lib; } linkmap_t; +#ifdef BOX32 +typedef struct linkmap32_s { + // actual struct link_map + Elf32_Addr l_addr; + ptr_t l_name; // char* + ptr_t l_ld; //Elf64_Dyn* + ptr_t l_next, l_prev; // struct linkmap32_s * + // custom + library_t* l_lib; + +} linkmap32_t; +#endif linkmap_t* getLinkMapLib(library_t* lib); linkmap_t* getLinkMapElf(elfheader_t* h); linkmap_t* addLinkMapLib(library_t* lib); void removeLinkMapLib(library_t* lib); +#ifdef BOX32 +linkmap32_t* getLinkMapLib32(library_t* lib); +linkmap32_t* getLinkMapElf32(elfheader_t* h); +linkmap32_t* addLinkMapLib32(library_t* lib); +void removeLinkMapLib32(library_t* lib); +#endif int FiniLibrary(library_t* lib, x64emu_t* emu); void Free1Library(library_t **lib, x64emu_t* emu); diff --git a/src/librarian/symbols.c b/src/librarian/symbols.c index d8cbdb3..4f8987b 100644 --- a/src/librarian/symbols.c +++ b/src/librarian/symbols.c @@ -227,15 +227,36 @@ void AddUniqueSymbol(kh_mapsymbols_t *mapsymbols, const char* name, uintptr_t ad v->syms[idx].sym.offs = addr; v->syms[idx].sym.sz = sz; v->syms[idx].veropt = veropt; + printf_dump(LOG_DEBUG, " Adding unique %s (ver:%d/%s%s) with offert=%p sz=%d\n", name, ver, vername?vername:"(none)", veropt?" veropt":"", (void*)addr, sz); } +#ifndef STATICBUILD +void** my_GetGTKDisplay(); +void** my_GetGthreadsGotInitialized(); +#endif int GetSymbolStartEnd(kh_mapsymbols_t* mapsymbols, const char* name, uintptr_t* start, uintptr_t* end, int ver, const char* vername, int local, int veropt) { if(!mapsymbols) return 0; khint_t k = kh_get(mapsymbols, mapsymbols, name); - if(k==kh_end(mapsymbols)) + if(k==kh_end(mapsymbols)) { + #ifndef STATICBUILD + // some special case symbol, defined inside box64 itself + if(!box64_is32bits && !strcmp(name, "gdk_display") && !BOX64ENV(nogtk)) { + *start = (uintptr_t)my_GetGTKDisplay(); + *end = *start+sizeof(void*); + printf_log(LOG_INFO, "Using global gdk_display for gdk-x11 (%p:%p)\n", start, *(void**)start); + return 2; + } + if(!box64_is32bits && !strcmp(name, "g_threads_got_initialized") && !BOX64ENV(nogtk)) { + *start = (uintptr_t)my_GetGthreadsGotInitialized(); + *end = *start+sizeof(int); + printf_log(LOG_INFO, "Using global g_threads_got_initialized for gthread2 (%p:%p)\n", start, *(void**)start); + return 2; + } + #endif return 0; + } versymbols_t * v = &kh_val(mapsymbols, k); versymbol_t* s = MatchVersion(v, ver, vername, 0, local, veropt); if(s) { diff --git a/src/library_list.h b/src/library_list.h index bb9caaa..d87b7e5 100644 --- a/src/library_list.h +++ b/src/library_list.h @@ -13,6 +13,7 @@ GO("libOpenGL.so.0", libgl) GO("libGLU.so.1", libglu) GO("libGLX.so.0", libglx) GO("libGLX.so", libglx) +GO("libGLX_nvidia.so.0", libglxnvidia) GO("libGLESv2.so.2", glesv2) GO("libGLESv2.so", glesv2) GO("libX11.so.6", libx11) @@ -73,6 +74,7 @@ GO("libxcb-icccm.so.4", libxcbicccm) GO("libxcb-util.so.1", libxcbutil) GO("libxcb-render-util.so.0", libxcbrenderutil) GO("libxcb-render.so.0", libxcbrender) +GO("libxcb-res.so.0", libxcbres) GO("libxcb-sync.so.1", libxcbsync) GO("libxcb-xinerama.so.0", libxcbxinerama) GO("libxcb-xinput.so.0", libxcbxinput) @@ -80,6 +82,7 @@ GO("libxcb-xkb.so.1", libxcbxkb) //GO("libxcb-present.so.0", libxcbpresent) GO("libXtst.so.6", libxtst) GO("libXt.so.6", libxt) +GO("libXaw.so.7", libxaw) GO("libXcomposite.so.1", libxcomposite) GO("libXdamage.so.1", libxdamage) GO("libXpresent.so.1", libxpresent) @@ -95,6 +98,7 @@ GO("openal.so", openal) GO("libalut.so.0", alut) GO("libalure.so.1", alure) GO("libOpenCL.so.1", opencl) +GO("libOpenCL.so", opencl) //GO("libjpeg.so.8", libjpeg) //GO("libjpeg.so.62", libjpeg62) //GO("libturbojpeg.so.0", turbojpeg) @@ -108,6 +112,7 @@ GO("libdbus-1.so.3", dbus) GO("libdecor-0.so.0", decor0) //GO("libiconv.so.2", iconv) GO("libdrm.so.2", libdrm) +GO("libdrm_amdgpu.so.1", libdrmamdgpu) GO("libexpat.so.1", expat) GO("libexpat.so", expat) GO("libcrypto.so.1", crypto) @@ -160,7 +165,9 @@ GO("libpango-1.0.so", pango) //GO("libnm-util.so.2", libnm) GO("libibus-1.0.so.5", libibus) GO("libfontconfig.so.1", fontconfig) +GO("libfontconfig.so", fontconfig) GO("libharfbuzz.so.0", libharfbuzz) +GO("libharfbuzz-subset.so.0", harfbuzzsubset) GO("libbz2.so.1", bz2) GO("liblzma.so.5", lzma) GO("libSM.so.6", libsm) @@ -182,12 +189,18 @@ GO("libtbbbind_2_5.so", tbbbind) GO("libtcmalloc_minimal.so.0", tcmallocminimal) GO("libtcmalloc_minimal.so.4", tcmallocminimal) GO("libpcre.so.3", libpcre) +GO("libpcre2-16.so.0", libpcre216) GO("libvulkan.so.1", vulkan) GO("libvulkan.so", vulkan) GO("libgbm.so.1", gbm) GO("libgomp.so.1", gomp) GO("libcap.so.2", cap) -//GO("libnsl.so.1", nsl) +GO("libpcap.so.0.8", pcap) +GO("libpcap.so.0", pcap) +GO("libcuda.so.1", cuda) +GO("libcuda.so", cuda) +GO("libnvidia-ml.so", nvml) +GO("libnvidia-ml.so.1", nvml) GO("libkrb5.so.3", krb5) GO("libgssapi_krb5.so.2", gssapikrb5) GO("libgssapi.so.3", gssapi) @@ -251,6 +264,10 @@ GO("libicuuc.so.73", icuuc73) GO("libicui18n.so.73", icui18n73) GO("libicuuc.so.74", icuuc74) GO("libicui18n.so.74", icui18n74) +GO("libicuuc.so.75", icuuc75) +GO("libicui18n.so.75", icui18n75) +GO("libicuuc.so.76", icuuc76) +GO("libicui18n.so.76", icui18n76) GO("libidn2.so.0", idn2) GO("libpam.so.0", pam) GO("libanl.so.1", anl) @@ -262,14 +279,19 @@ GO("libnettle.so.8", libnettle8) GO("libunistring.so.2", libunistring2) GO("libhogweed.so.6", libhogweed6) GO("libsqlite3.so.0", libsqlite3) +GO("libtiff.so.5", libtiff5) +GO("libbrotlidec.so", brotlidec) +GO("libbrotlidec.so.1", brotlidec) +GO("libzstd.so.1", zstd) +GO("libzstd.so", zstd) -#ifdef ANDROID GO("libc.so", libc) GO("libm.so", libm) GO("libbsd.so", libbsd) GO("libdl.so", libdl) GO("libpthread.so", libpthread) GO("libcups.so", libcups) +GO("libcupsimage.so", libcupsimage) GO("liblber-2.4.so", lber) GO("libldap_r-2.4.so", ldapr) GO("libpng16.so", png16) @@ -287,8 +309,6 @@ GO("libXau.so", libxau) GO("libXxf86vm.so", libxxf86vm) GO("libXinerama.so", xinerama) GO("libXrandr.so", libxrandr) -GO("libxrandr.so", libxrandr) -GO("libXext.so", libxext) GO("libXfixes.so", libxfixes) GO("libXcursor.so", libxcursor) GO("libXrender.so", libxrender) @@ -296,10 +316,8 @@ GO("libXft.so", libxft) GO("libXi.so", libxi) GO("libXss.so", libxss) GO("libXpm.so", libxpm) -GO("libXau.so", libxau) GO("libXdmcp.so", libxdmcp) GO("libX11-xcb.so", libx11xcb) -GO("libxcb.so", libxcb) GO("libxcb-xfixes.so", libxcbxfixes) GO("libxcb-shape.so", libxcbshape) GO("libxcb-shm.so", libxcbshm) @@ -318,9 +336,9 @@ GO("libxcb-render.so", libxcbrender) GO("libxcb-sync.so", libxcbsync) GO("libxcb-xinerama.so", libxcbxinerama) GO("libxcb-xkb.so", libxcbxkb) -//GO("libxcb-present.so", libxcbpresent) GO("libXtst.so", libxtst) GO("libXt.so", libxt) +GO("libXaw.so", libxaw) GO("libXcomposite.so", libxcomposite) GO("libXdamage.so", libxdamage) GO("libXpresent.so", libxpresent) @@ -355,7 +373,6 @@ GO("libvorbis.so", libvorbis) GO("libogg.so", libogg) GO("libFLAC.so", flac) GO("libz.so", libz) -GO("libandroid-shmem.so", androidshmem) GO("libgobject-2.0.so", gobject2) GO("libglib-2.0.so", glib2) GO("libgtk-3.so", gtk3) @@ -366,12 +383,20 @@ GO("libgmodule-2.0.so", gmodule2) GO("libgtk-x11-2.0.so", gtkx112) GO("libgdk-x11-2.0.so", gdkx112) GO("libpangocairo-1.0.so", pangocairo) -#else +GO("libblas.so.3", libblas) +GO("libblas.so", libblas) +GO("liblapack.so.3", liblapack) +GO("liblapack.so", liblapack) +#ifdef ANDROID +GO("libandroid-shmem.so", androidshmem) +#endif + GO("libc.so.6", libc) GO("libm.so.6", libm) GO("libdl.so.2", libdl) GO("libpthread.so.0", libpthread) GO("libcups.so.2", libcups) +GO("libcupsimage.so.2", libcupsimage) GO("liblber-2.4.so.2", lber) GO("libldap_r-2.4.so.2", ldapr) GO("libpng16.so.16", png16) @@ -382,7 +407,15 @@ GO("libgnutls.so.30", gnutls) GO("libmpg123.so.0", mpg123) //GO("libtiff.so.5", libtiff) GO("libxml2.so.2", xml2) -#endif +GO("libgpgme.so.11", libgpgme) + +GO("libavutil.so.56", libavutil56) +GO("libavformat.so.58", libavformat58) +GO("libavcodec.so.58", libavcodec58) + +GO("libavahi-client.so.3", avahiclient) +GO("libavahi-common.so.3", avahicommon) + #ifdef TERMUX GO("libiconv.so", iconv) GO("libtermux-exec.so", termuxexec) @@ -392,4 +425,4 @@ GO("libandroid-support.so", androidsupport) GO("ld-linux-x86-64.so.2", ldlinux) //GO("libunwind.so.8", unwind) -GO("crashhandler.so", crashhandler) +//GO("crashhandler.so", crashhandler) diff --git a/src/library_list_32.h b/src/library_list_32.h new file mode 100644 index 0000000..48c05bb --- /dev/null +++ b/src/library_list_32.h @@ -0,0 +1,115 @@ +#ifndef GO +#error Nope +#endif + +GO("libpthread.so.0", libpthread) +GO("librt.so.1", librt) +#ifdef ANDROID +GO("libc.so", libc) +GO("libm.so", libm) +GO("libdl.so", libdl) +#else +GO("libc.so.6", libc) +GO("libm.so.6", libm) +GO("libdl.so.2", libdl) +#endif +GO("libresolv.so.2", libresolv) +GO("libresolv.so", libresolv) +GO("libselinux.so.1", selinux) +GO("libselinux.so", selinux) +GO("libblkid.so.1", blkid) +GO("libblkid.so", blkid) +GO("libmount.so.1", mount) +GO("libmount.so", mount) + +GO("ld-linux.so.3", ldlinux) +GO("ld-linux.so.2", ldlinux) + +GO("libGL.so", libgl) +GO("libGL.so.1", libgl) +GO("libGLX_nvidia.so.0", libglxnvidia) +GO("libGLU.so.1", libglu) +GO("libSDL-1.2.so.0", sdl1) +GO("libSDL2-2.0.so.0", sdl2) +GO("libSDL2_image-2.0.so.0", sdl2image) +GO("libSDL2_image.so", sdl2image) +GO("libasound.so.2", libasound) +GO("libasound.so", libasound) +GO("libfreetype.so.6", freetype) +GO("libfontconfig.so.1", fontconfig) +GO("libEGL.so", libegl) +GO("libEGL.so.1", libegl) +GO("libGLX.so", libglx) +GO("libGLX.so.0", libglx) + +GO("libX11.so", libx11) +GO("libXdamage.so", libxdamage) +GO("libXext.so", libxext) +GO("libXfixes.so", libxfixes) +GO("libXrender.so", libxrender) +GO("libXcursor.so", libxcursor) +GO("libXcomposite.so", libxcomposite) +GO("libXi.so", libxi) +GO("libXrandr.so", libxrandr) +GO("libxrandr.so", libxrandr) +GO("libXss.so", libxss) +GO("libXxf86vm.so", libxxf86vm) +GO("libXinerama.so", xinerama) + +GO("libX11.so.6", libx11) +GO("libXdamage.so.1", libxdamage) +GO("libXext.so.6", libxext) +GO("libXfixes.so.3", libxfixes) +GO("libXrender.so.1", libxrender) +GO("libXcomposite.so.1", libxcomposite) +GO("libXcursor.so.1", libxcursor) +GO("libXi.so.6", libxi) +GO("libXrandr.so.2", libxrandr) +GO("libxrandr.so.2", libxrandr) +GO("libXss.so.1", libxss) +GO("libXxf86vm.so.1", libxxf86vm) +GO("libXinerama.so.1", xinerama) + +GO("libX11-xcb.so.1", libx11xcb) +GO("libX11-xcb.so", libx11xcb) +GO("libxcb.so.1", libxcb) +GO("libxcb.so", libxcb) +GO("libxcb-res.so.0", libxcbres) +GO("libxcb-res.so", libxcbres) + +GO("libgnutls.so", gnutls) +GO("libgnutls.so.30", gnutls) +GO("libopenal.so.1", openal) +GO("libopenal.so.0", openal) +GO("libopenal.so", openal) +GO("libopenal-soft.so.1", openal) +GO("openal.so", openal) + +GO("libexpat.so.1", expat) +GO("libexpat.so", expat) + +GO("libudev.so.0", udev0) +GO("libudev.so.1", udev1) +GO("libudev.so", udev1) +GO("libuuid.so.1", libuuid) +GO("libcairo.so.2", cairo) +GO("libcairo.so", cairo) +GO("libdrm.so.2", libdrm) +GO("libdrm.so", libdrm) +GO("libvdpau.so.1", libvdpau) +GO("libvdpau.so", libvdpau) +GO("libnsl.so.1", nsl) +GO("libnsl.so", nsl) +GO("libcups.so.2", libcups) +GO("libcups.so", libcups) +GO("libgbm.so.1", gbm) +GO("libgbm.so", gbm) +GO("libdbus-1.so.3", dbus) +GO("libcurl.so.4", curl) +GO("libcurl-gnutls.so.4", curl) +GO("libcurl.so.3", curl) + +//GO("crashhandler.so", crashhandler) +GO("libtcmalloc_minimal.so.0", tcmallocminimal) +GO("libtcmalloc_minimal.so.4", tcmallocminimal) +GO("libtcmalloc.so.0", tcmallocminimal) diff --git a/src/library_list_static.h b/src/library_list_static.h index dfb2111..85f4607 100644 --- a/src/library_list_static.h +++ b/src/library_list_static.h @@ -6,7 +6,7 @@ GO("libc.musl-x86_64.so.1", libcmusl) #ifdef ANDROID GO("libpthread.so", libpthread) GO("librt.so", librt) -GO("libbsd.so", libbsd) +//GO("libbsd.so", libbsd) GO("libc.so", libc) GO("libm.so", libm) GO("libdl.so", libdl) @@ -14,7 +14,7 @@ GO("libresolv.so", libresolv) #else GO("libpthread.so.0", libpthread) GO("librt.so.1", librt) -GO("libbsd.so.0", libbsd) +//GO("libbsd.so.0", libbsd) GO("libc.so.6", libc) GO("libm.so.6", libm) GO("libdl.so.2", libdl) diff --git a/src/library_list_static_32.h b/src/library_list_static_32.h new file mode 100644 index 0000000..071be64 --- /dev/null +++ b/src/library_list_static_32.h @@ -0,0 +1,11 @@ +#ifndef GO +#error Nope +#endif + +GO("libpthread.so.0", libpthread) +GO("librt.so.1", librt) +GO("libc.so.6", libc) +GO("libm.so.6", libm) +GO("libdl.so.2", libdl) +GO("ld-linux.so.2", ldlinux) +GO("ld-linux.so.3", ldlinux) diff --git a/src/libtools/auxval.c b/src/libtools/auxval.c index 789902d..1e4b604 100644 --- a/src/libtools/auxval.c +++ b/src/libtools/auxval.c @@ -49,8 +49,25 @@ unsigned long real_getauxval(unsigned long type) return 0; } +#ifdef BOX32 +EXPORT unsigned long my32_getauxval(x64emu_t* emu, unsigned long type) +{ + ptr_t* p = (ptr_t*)emu->context->auxval_start; + while(*p) { + if(*p == type) + return p[1]; + p+=2; + } + return 0; +} +#endif + EXPORT unsigned long my_getauxval(x64emu_t* emu, unsigned long type) { + #ifdef BOX32 + if(box64_is32bits) + return my32_getauxval(emu, type); + #endif uintptr_t* p = emu->context->auxval_start; while(*p) { if(*p == type) diff --git a/src/libtools/box32_inputevent.c b/src/libtools/box32_inputevent.c new file mode 100644 index 0000000..d1f1379 --- /dev/null +++ b/src/libtools/box32_inputevent.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include + +#include "box32_inputevent.h" +#include "debug.h" +#include "box32.h" + +#ifndef MAX_PATH +#define MAX_PATH 4096 +#endif + +#define NEVENTS 64 +#if 0 +static int n_event_path = 0; +static char* event_path[NEVENTS] = {0}; +#endif +static int n_event_fd = 0; +static int event_fd[NEVENTS] = {-1}; + +void addInputEventFD(int fd) +{ + if(fd<0) return; + char fullname[MAX_PATH] = {0}; + char buf[128]; + sprintf(buf, "/proc/self/fd/%d", fd); + ssize_t r = readlink(buf, fullname, sizeof(fullname) - 1); + if(r<0) return; + #define INPUT_EVENT "/dev/input/event" + if(strstr(fullname, INPUT_EVENT)==fullname) + if(n_event_fd +#include + +#include "debug.h" +#include "x64emu.h" +#include "emu/x64run_private.h" +#include "custommem.h" + +#define OPCODE_READ (1<<0) +#define OPCODE_WRITE (1<<1) +#define OPCODE_STACK (1<<2) + +#define MODREG ((nextop&0xC0)==0xC0) + +int decode_avx(uint8_t* addr, int idx, vex_t vex) +{ + return 0; +} + +int decode_0f(uint8_t* addr, int idx, rex_t rex) +{ + uint8_t nextop; + switch(addr[idx++]) { + case 0x00: + return OPCODE_READ; + case 0x01: + return OPCODE_WRITE; + case 0x10: + case 0x12: + case 0x14: + case 0x15: + case 0x16: + case 0x28: + case 0x2A: + case 0x2C: + case 0x2D: + case 0x2E: + case 0x2F: + case 0x50 ... 0x6B: + case 0x6E: + case 0x6F: + case 0x70: + case 0x74: + case 0x75: + case 0x76: + case 0xA3: + case 0xAF: + case 0xB6: + case 0xB7: + case 0xBC: + case 0xBD: + case 0xBE: + case 0xBF: + case 0xC2: + case 0xC4 ... 0xC6: + case 0xD1 ... 0xD5: + case 0xD7 ... 0xE5: + case 0xE8 ... 0xEF: + case 0xF1 ... 0xFE: + nextop = addr[idx++]; + return (MODREG)?0:OPCODE_READ; + case 0x11: + case 0x13: + case 0x17: + case 0x29: + case 0x2B: + case 0x7E: + case 0x7F: + case 0x90 ... 0x9F: + case 0xAE: + case 0xC3: + case 0xE7: + nextop = addr[idx++]; + return (MODREG)?0:OPCODE_WRITE; + case 0x71: + case 0x72: + case 0x73: + case 0xA4: + case 0xA5: + case 0xAB: + case 0xAC: + case 0xAD: + case 0xB0: + case 0xB1: + case 0xB3: + case 0xBA: + case 0xBB: + case 0xC0: + case 0xC1: + case 0xC7: + nextop = addr[idx++]; + return (MODREG)?0:(OPCODE_READ|OPCODE_WRITE); + case 0xA0: + case 0xA8: + return OPCODE_WRITE|OPCODE_STACK; + case 0xA1: + case 0xA9: + return OPCODE_READ|OPCODE_STACK; + case 0x38: //todo + return 0; + case 0x3A: //todo + return 0; + } + return 0; +} +int decode_660f(uint8_t* addr, int idx, rex_t rex) +{ + return 0; +} +int decode_f20f(uint8_t* addr, int idx, rex_t rex) +{ + return 0; +} +int decode_f30f(uint8_t* addr, int idx, rex_t rex) +{ + return 0; +} + +int decode_opcode(uintptr_t rip, int is32bits) +{ + if(!(getProtection(rip)&PROT_READ)) + return 0; + // check if opcode is one that write to memory... pretty crude for now. + uint8_t* addr = (uint8_t*)rip; + int idx = 0; + rex_t rex = {0}; + int is66 = 0, is67 = 0, rep = 0; + int lock = 0; + vex_t vex = {0}; + uint8_t nextop; + if(is32bits) { + rex.is32bits = 1; + while(addr[idx]==0x66 || addr[idx]==0xF2 || addr[idx]==0xF3 || (addr[idx]==0x2E)|| (addr[idx]==0x3E) || (addr[idx]==0x26)|| (addr[idx]==0x36) || (addr[idx]==0xf0) || (addr[idx]==0x64)|| (addr[idx]==0x65)) { + switch(addr[idx++]) { + case 0x66: is66=1; break; + case 0xF0: lock=1; break; + case 0xF2: rep=1; break; + case 0xF3: rep=2; break; + } + } + } else { + while((addr[idx]>=0x40 && addr[idx]<0x4f) || (addr[idx]==0x66 || addr[idx]==0xF2 || addr[idx]==0xF3 || (addr[idx]==0x3E) || (addr[idx]==0x26) || (addr[idx]==0xf0)) || (addr[idx]==0x64)|| (addr[idx]==0x65)) { + switch(addr[idx++]) { + case 0x66: is66=1; break; + case 0xF0: lock=1; break; + case 0xF2: rep=1; break; + case 0xF3: rep=2; break; + case 0x40 ... 0x4f: rex.rex = addr[idx-1]; break; + } + } + } + if((addr[idx]==0xC4 || addr[idx]==0xC5) && (!is32bits || ((addr[idx+1]&0xc0)!=0xc0))) { + uint8_t tmp8u; + switch(addr[idx++]) { + case 0xC4: + vex.rex = rex; + tmp8u = nextop; + vex.m = tmp8u&0b00011111; + vex.rex.b = (tmp8u&0b00100000)?0:1; + vex.rex.x = (tmp8u&0b01000000)?0:1; + vex.rex.r = (tmp8u&0b10000000)?0:1; + tmp8u = addr[idx++]; + vex.p = tmp8u&0b00000011; + vex.l = (tmp8u>>2)&1; + vex.v = ((~tmp8u)>>3)&0b1111; + vex.rex.w = (tmp8u>>7)&1; + break; + case 0xC5: + vex.rex = rex; + tmp8u = nextop; + vex.p = tmp8u&0b00000011; + vex.l = (tmp8u>>2)&1; + vex.v = ((~tmp8u)>>3)&0b1111; + vex.rex.r = (tmp8u&0b10000000)?0:1; + vex.rex.b = 0; + vex.rex.x = 0; + vex.rex.w = 0; + vex.m = VEX_M_0F; + break; + } + return decode_avx(addr, idx, vex); + } + switch(addr[idx++]) { + case 0x00: + case 0x01: + case 0x08: + case 0x09: + case 0x10: + case 0x11: + case 0x18: + case 0x19: + case 0x20: + case 0x21: + case 0x28: + case 0x29: + case 0x30: + case 0x31: + case 0x86: + case 0x87: + case 0x88: + case 0x89: + case 0x8C: + case 0xC0: + case 0xC1: + case 0xC6: + case 0xC7: + case 0xD0: + case 0xD1: + case 0xD2: + case 0xD3: + nextop = addr[idx++]; + return (MODREG)?0:(OPCODE_WRITE|OPCODE_READ); + case 0x02: + case 0x03: + case 0x0a: + case 0x0b: + case 0x12: + case 0x13: + case 0x1a: + case 0x1b: + case 0x22: + case 0x23: + case 0x2a: + case 0x2b: + case 0x32: + case 0x33: + case 0x38: + case 0x39: + case 0x3a: + case 0x3b: + case 0x63: + case 0x69: + case 0x6B: + case 0x84: + case 0x85: + case 0x8A: + case 0x8B: + case 0x8E: + nextop = addr[idx++]; + return (MODREG)?0:(OPCODE_READ); + case 0x06: + case 0x0E: + case 0x16: + case 0x1E: + case 0x60: + return is32bits?(OPCODE_WRITE|OPCODE_STACK):0; + case 0x07: + case 0x17: + case 0x1F: + case 0x61: + return is32bits?(OPCODE_READ|OPCODE_STACK):0; + case 0x50 ... 0x57: + case 0x68: + case 0x6A: + case 0x9C: + case 0xC8: + case 0xE8: + return OPCODE_WRITE|OPCODE_STACK; + case 0x58 ... 0x5F: + case 0x9D: + case 0xC2: + case 0xC3: + case 0xC9: + case 0xCA: + case 0xCB: + case 0xCF: + return OPCODE_READ|OPCODE_STACK; + case 0x80 ... 0x83: + nextop = addr[idx++]; + return (MODREG)?0:(((((nextop>>3)&7)!=7)?OPCODE_WRITE:0)|OPCODE_READ); + case 0x8F: + nextop = addr[idx++]; + return ((MODREG)?0:(OPCODE_WRITE))|OPCODE_READ|OPCODE_STACK; + case 0xA0: + case 0xA1: + case 0xA6: + case 0xA7: + case 0xAC: + case 0xAD: + case 0xAE: + case 0xAF: + case 0xD7: + return OPCODE_READ; + case 0xA2: + case 0xA3: + case 0xA4: + case 0xA5: + case 0xAA: + case 0xAB: + return OPCODE_WRITE; + case 0xF6: + case 0xF7: + nextop = addr[idx++]; + if(MODREG) return 0; + switch((nextop>>3)&7) { + case 2: + case 3: + return OPCODE_WRITE; + default: + return OPCODE_READ; + } + case 0xFE: + case 0xFF: + nextop = addr[idx++]; + if(MODREG) return 0; + switch((nextop>>3)&7) { + case 0: + case 1: + return OPCODE_WRITE; + case 2: + case 3: + case 6: + return OPCODE_READ|OPCODE_WRITE|OPCODE_STACK; + default: + return OPCODE_READ; + } + + case 0x0F: + if(is66) return decode_660f(addr, idx, rex); + if(rep==1) return decode_f20f(addr, idx, rex); + if(rep==2) return decode_f30f(addr, idx, rex); + return decode_0f(addr, idx, rex); + case 0xD8 ... 0xDF: + nextop = addr[idx++]; + if(nextop<0xC0) { + switch(addr[idx-2]) { + case 0xD8: + case 0xDA: + case 0xDC: + case 0xDE: + return OPCODE_READ; + case 0xD9: + switch((nextop>>3)&7) { + case 0: + case 4: + case 5: + return OPCODE_READ; + case 2: + case 3: + case 6: + case 7: + return OPCODE_WRITE; + } + return 0; + case 0xDB: + switch((nextop>>3)&7) { + case 0: + case 1: + case 2: + case 3: + case 7: + return OPCODE_WRITE; + case 5: + return OPCODE_READ; + } + return 0; + case 0xDF: + switch((nextop>>3)&7) { + case 0: + case 4: + case 5: + return OPCODE_READ; + case 1: + case 2: + case 3: + case 6: + case 7: + return OPCODE_WRITE; + } + } + } + return 0; + + } + return 0; +} + +int write_opcode(uintptr_t rip, uintptr_t native_ip, int is32bits) +{ + // TODO, on ARM64, RiSCV and LoongArch, it would be easier to analyse the opcode at the native IP instead, as opcode that write to memory are more limited in quantity + return (decode_opcode(rip, is32bits)&OPCODE_WRITE)?1:0; +} diff --git a/src/libtools/libc_net32.c b/src/libtools/libc_net32.c new file mode 100644 index 0000000..c54e805 --- /dev/null +++ b/src/libtools/libc_net32.c @@ -0,0 +1,775 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "box64stack.h" +#include "x64emu.h" +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "callback.h" +#include "librarian.h" +#include "emu/x64emu_private.h" +#include "box32context.h" +#include "myalign32.h" +#include "fileutils.h" +#include "globalsymbols.h" +#include "box32.h" +#include "converter32.h" +#include "custommem.h" + +EXPORT ssize_t my32_recvmsg(x64emu_t* emu, int socket, struct i386_msghdr* msg, int flags) +{ + struct iovec iov[msg->msg_iovlen]; + struct msghdr m; + uint8_t buff[msg->msg_controllen+256]; + AlignMsgHdr_32(&m, iov, buff, msg, 0); + ssize_t ret = recvmsg(socket, &m, flags); + if(ret>0) + UnalignMsgHdr_32(msg, &m); + return ret; +} + +EXPORT ssize_t my32_sendmsg(x64emu_t* emu, int socket, struct i386_msghdr* msg, int flags) +{ + struct iovec iov[msg->msg_iovlen]; + struct msghdr m; + uint8_t buff[msg->msg_controllen+256]; + AlignMsgHdr_32(&m, iov, buff, msg, 1); + ssize_t ret = sendmsg(socket, &m, flags); + UnalignMsgHdr_32(msg, &m); + return ret; +} + +EXPORT int my32_recvmmsg(x64emu_t* emu, int socket, struct i386_mmsghdr* msgs, uint32_t vlen, uint32_t flags, void* timeout) +{ + struct mmsghdr m[vlen]; + uint32_t iovlen = 0; + size_t ctrlen = 0; + for(uint32_t i=0; iiovlen) iovlen = msgs[i].msg_hdr.msg_iovlen; + if(msgs[i].msg_hdr.msg_controllen>ctrlen) ctrlen = msgs[i].msg_hdr.msg_controllen; + m[i].msg_len = msgs[i].msg_len; + } + struct iovec iov[vlen][iovlen]; + uint8_t buff[vlen][ctrlen+256]; + for(uint32_t i=0; iiovlen) iovlen = msgs[i].msg_hdr.msg_iovlen; + if(msgs[i].msg_hdr.msg_controllen>ctrlen) ctrlen = msgs[i].msg_hdr.msg_controllen; + m[i].msg_len = msgs[i].msg_len; + } + struct iovec iov[vlen][iovlen]; + uint8_t buff[vlen][ctrlen+256]; + for(uint32_t i=0; icmsg_len < sizeof(struct i386_cmsghdr)) + return NULL; + // compute next + cmsg = (struct i386_cmsghdr*)(((uintptr_t)cmsg) + ((cmsg->cmsg_len+3)&~3)); + // check it still inside limits + if((uintptr_t)(cmsg+1) > mhdr->msg_control+mhdr->msg_controllen) + return NULL; + if((uintptr_t)(cmsg)+cmsg->cmsg_len > mhdr->msg_control+mhdr->msg_controllen) + return NULL; + return cmsg; +} + +EXPORT int my32_getaddrinfo(x64emu_t* emu, void* node, void* service, struct i386_addrinfo* hints, ptr_t* res) +{ + struct addrinfo* hints_ = (struct addrinfo*)hints; // only first part is used, wich is identical + struct addrinfo* p = {0}; + int ret = getaddrinfo(node, service, hints_, &p); + if(!ret && p) { + // counting the number of "next" + struct addrinfo* p2 = p; + int idx = 0; + while(p2) {++idx; p2 = p2->ai_next;} + // doing the malloc! + void* r = actual_malloc(idx*sizeof(struct i386_addrinfo)+sizeof(void*)); + ptr_t p3 = to_ptrv(r); + *res = p3; + p2 = p; + for(int i=0; iai_flags = p2->ai_flags; + dest->ai_family = p2->ai_family; + dest->ai_socktype = p2->ai_socktype; + dest->ai_protocol = p2->ai_protocol; + dest->ai_addrlen = p2->ai_addrlen; + dest->ai_addr = to_ptrv(p2->ai_addr); + dest->ai_canonname = to_cstring(p2->ai_canonname); + p2 = p2->ai_next; + dest->ai_next = p2?p3:0; + } + } else + *res = 0; + return ret; +} + +EXPORT void my32_freeaddrinfo(x64emu_t* emu, void* a) { + if(!a) return; + void* orig = *(void**)(a+sizeof(struct i386_addrinfo)); + freeaddrinfo(orig); + actual_free(a); +} + +EXPORT void* my32_gethostbyname(x64emu_t* emu, const char* a) +{ + static struct i386_hostent ret = {0}; + static ptr_t strings[128] = {0}; + struct hostent* h = gethostbyname(a); + if(!h) return NULL; + // convert... + ret.h_name = to_cstring(h->h_name); + ret.h_addrtype = h->h_addrtype; + ret.h_length = h->h_length; + ptr_t s = to_ptrv(&strings); + int idx = 0; + ret.h_aliases = h->h_aliases?s:0; + if(h->h_aliases) { + char** p = h->h_aliases; + while(*p) { + strings[idx++] = to_cstring(*p); + ++p; + } + strings[idx++] = 0; + } + ret.h_addr_list = h->h_addr_list?to_ptrv(&strings[idx]):0; + if(h->h_addr_list) { + char** p = h->h_addr_list; + while(*p) { + strings[idx++] = to_ptrv(*p); + ++p; + } + strings[idx++] = 0; + } + // done + emu->libc_herr = h_errno; + return &ret; +} + +EXPORT int my32_gethostbyname_r(x64emu_t* emu, void* name, struct i386_hostent* ret, void* buff, size_t buflen, ptr_t* result, int* h_err) +{ + struct hostent ret_l = {0}; + struct hostent *result_l = NULL; + int r = gethostbyname_r(name, &ret_l, buff, buflen, &result_l, h_err); + if(!result_l) + *result = 0; + else + *result = to_ptrv(ret); + // convert result, all memory allocated should be in program space + if(result_l) { + ret->h_name = to_cstring(result_l->h_name); + ret->h_addrtype = result_l->h_addrtype; + ret->h_length = result_l->h_length; + int idx = 0; + ret->h_aliases = to_ptrv(result_l->h_aliases); + if(result_l->h_aliases) { + char** p = result_l->h_aliases; + ptr_t* strings = from_ptrv(ret->h_aliases); + while(*p) { + strings[idx++] = to_cstring(*p); + ++p; + } + strings[idx++] = 0; + } + idx = 0; + ret->h_addr_list = to_ptrv(result_l->h_addr_list); + if(result_l->h_addr_list) { + char** p = result_l->h_addr_list; + ptr_t* strings = from_ptrv(ret->h_addr_list); + while(*p) { + strings[idx++] = to_ptrv(*p); + ++p; + } + strings[idx++] = 0; + } + } + return r; +} + +EXPORT int my32_gethostbyname2_r(x64emu_t* emu, void* name, int af, struct i386_hostent* ret, void* buff, size_t buflen, ptr_t* result, int* h_err) +{ + struct hostent ret_l = {0}; + struct hostent *result_l = NULL; + int r = gethostbyname2_r(name, af, &ret_l, buff, buflen, &result_l, h_err); + if(!result_l) + *result = 0; + else + *result = to_ptrv(ret); + // convert result, all memory allocated should be in program space + if(result_l) { + ret->h_name = to_cstring(result_l->h_name); + ret->h_addrtype = result_l->h_addrtype; + ret->h_length = result_l->h_length; + int idx = 0; + ret->h_aliases = to_ptrv(result_l->h_aliases); + if(result_l->h_aliases) { + char** p = result_l->h_aliases; + ptr_t* strings = from_ptrv(ret->h_aliases); + while(*p) { + strings[idx++] = to_cstring(*p); + ++p; + } + strings[idx++] = 0; + } + idx = 0; + ret->h_addr_list = to_ptrv(result_l->h_addr_list); + if(result_l->h_addr_list) { + char** p = result_l->h_addr_list; + ptr_t* strings = from_ptrv(ret->h_addr_list); + while(*p) { + strings[idx++] = to_ptrv(*p); + ++p; + } + strings[idx++] = 0; + } + } + return r; +} + +EXPORT void* my32_gethostbyaddr(x64emu_t* emu, const char* a, uint32_t len, int type) +{ + static struct i386_hostent ret = {0}; + static ptr_t strings[128] = {0}; + struct hostent* h = gethostbyaddr(a, len, type); + if(!h) return NULL; + // convert... + ret.h_name = to_cstring(h->h_name); + ret.h_addrtype = h->h_addrtype; + ret.h_length = h->h_length; + ptr_t s = to_ptrv(&strings); + int idx = 0; + ret.h_aliases = h->h_aliases?s:0; + if(h->h_aliases) { + char** p = h->h_aliases; + while(*p) { + strings[idx++] = to_cstring(*p); + ++p; + } + strings[idx++] = 0; + } + ret.h_addr_list = h->h_addr_list?to_ptrv(&strings[idx]):0; + if(h->h_addr_list) { + char** p = h->h_addr_list; + while(*p) { + strings[idx++] = to_ptrv(*p); + ++p; + } + strings[idx++] = 0; + } + // done + emu->libc_herr = h_errno; + return &ret; +} + +EXPORT int my32_gethostbyaddr_r(x64emu_t* emu, void* addr, uint32_t len, int type, struct i386_hostent* ret, void* buff, size_t buflen, ptr_t* result, int* h_err) +{ + struct hostent ret_l = {0}; + struct hostent *result_l = NULL; + int r = gethostbyaddr_r(addr, len, type, &ret_l, buff, buflen, &result_l, h_err); + if(!result_l) + *result = 0; + else + *result = to_ptrv(ret); + // convert result, all memory allocated should be in program space + if(result_l) { + ret->h_name = to_cstring(result_l->h_name); + ret->h_addrtype = result_l->h_addrtype; + ret->h_length = result_l->h_length; + int idx = 0; + ret->h_aliases = to_ptrv(result_l->h_aliases); + if(result_l->h_aliases) { + char** p = result_l->h_aliases; + ptr_t* strings = from_ptrv(ret->h_aliases); + while(*p) { + strings[idx++] = to_cstring(*p); + ++p; + } + strings[idx++] = 0; + } + ret->h_addr_list = to_ptrv(result_l->h_addr_list); + idx = 0; + if(result_l->h_addr_list) { + char** p = result_l->h_addr_list; + ptr_t* strings = from_ptrv(ret->h_addr_list); + while(*p) { + strings[idx++] = to_ptrv(*p); + ++p; + } + strings[idx++] = 0; + } + } + return r; +} + +EXPORT void* my32_getservbyname(x64emu_t* emu, void* name, void* proto) +{ + static struct i386_servent ret = {0}; + static ptr_t strings[128] = {0}; + struct servent* s = getservbyname(name, proto); + if(!s) return NULL; + // convert... + ret.s_name = to_cstring(s->s_name); + ret.s_port = s->s_port; + ret.s_proto = to_cstring(s->s_proto); + ptr_t strs = to_ptrv(&strings); + int idx = 0; + ret.s_aliases = s->s_aliases?strs:0; + if(s->s_aliases) { + char** p = s->s_aliases; + while(*p) { + strings[idx++] = to_cstring(*p); + ++p; + } + strings[idx++] = 0; + } + // done + emu->libc_herr = h_errno; + return &ret; +} + +struct i386_ifaddrs +{ + ptr_t ifa_next; // struct ifaddrs * + ptr_t ifa_name; // char * + uint32_t ifa_flags; + ptr_t ifa_addr; // struct sockaddr * + ptr_t ifa_netmask;// struct sockaddr * + ptr_t ifa_ifu; // union of struct sockaddr + ptr_t ifa_data; // void * +}; + +EXPORT int my32_getifaddrs(x64emu_t* emu, void** res) +{ + int ret = getifaddrs((void*)res); + if(!ret) { + // convert the chained list of ifaddrs to i386 (narrowed) in place + struct ifaddrs* p = *res; + while(p) { + struct i386_ifaddrs *i386 = (struct i386_ifaddrs*)p; + struct ifaddrs* next = p->ifa_next; + i386->ifa_next = to_ptrv(p->ifa_next); + i386->ifa_name = to_cstring(p->ifa_name); + i386->ifa_flags = p->ifa_flags; + i386->ifa_addr = to_ptrv(p->ifa_addr); + i386->ifa_netmask = to_ptrv(p->ifa_netmask); + i386->ifa_ifu = (i386->ifa_flags&IFF_BROADCAST)?to_ptrv(p->ifa_broadaddr):to_ptrv(p->ifa_dstaddr); + i386->ifa_data = to_ptrv(p->ifa_data); + p = next; + } + } + return ret; +} + +EXPORT void* my32___h_errno_location(x64emu_t* emu) +{ + // TODO: Find a better way to do this + // cannot use __thread as it makes the address not 32bits + emu->libc_herr = h_errno; + return &emu->libc_herr; +} + +struct protoent_32 +{ + ptr_t p_name; //char* + ptr_t p_aliases;// char** + int p_proto; +}; + +EXPORT void* my32_getprotobyname(x64emu_t* emu, void* name) +{ + static struct protoent_32 my_protoent = {0}; + static ptr_t strings[256]; + struct protoent *ret = getprotobyname(name); + if(!ret) + return NULL; + my_protoent.p_name = to_cstring(ret->p_name); + my_protoent.p_proto = ret->p_proto; + if(ret->p_aliases) { + my_protoent.p_aliases = to_ptrv(&strings); + int i = 0; + while(ret->p_aliases[i]) { + strings[i] = to_cstring(ret->p_aliases[i]); + ++i; + } + strings[i] = 0; + } else + my_protoent.p_aliases = 0; + + return &my_protoent; +} + +EXPORT int my32_getprotobyname_r(x64emu_t* emu, void* name,struct protoent_32* ret, void* buff, size_t buflen, ptr_t* result) +{ + struct protoent ret_l = {0}; + struct protoent *result_l = NULL; + int r = getprotobyname_r(name, &ret_l, buff, buflen, &result_l); + if(!result_l) + *result = 0; + else + *result = to_ptrv(ret); + // convert result, all memory allocated should be in program space + if(result_l) { + ret->p_name = to_cstring(result_l->p_name); + int idx = 0; + if(result_l->p_aliases) { + char** p = result_l->p_aliases; + ptr_t* strings = from_ptrv(ret->p_aliases); + while(*p) { + strings[idx++] = to_cstring(*p); + ++p; + } + strings[idx++] = 0; + } + ret->p_aliases = to_ptrv(result_l->p_aliases); + ret->p_proto = result_l->p_proto; + } + return r; +} + +EXPORT int my32_getprotobynumber_r(x64emu_t* emu, int proto,struct protoent_32* ret, void* buff, size_t buflen, ptr_t* result) +{ + struct protoent ret_l = {0}; + struct protoent *result_l = NULL; + int r = getprotobynumber_r(proto, &ret_l, buff, buflen, &result_l); + if(!result_l) + *result = 0; + else + *result = to_ptrv(ret); + // convert result, all memory allocated should be in program space + if(result_l) { + ret->p_name = to_cstring(result_l->p_name); + int idx = 0; + if(result_l->p_aliases) { + char** p = result_l->p_aliases; + ptr_t* strings = from_ptrv(ret->p_aliases); + while(*p) { + strings[idx++] = to_cstring(*p); + ++p; + } + strings[idx++] = 0; + } + ret->p_aliases = to_ptrv(result_l->p_aliases); + ret->p_proto = result_l->p_proto; + } + return r; +} + +typedef struct my_res_state_32_s { + int retrans; + int retry; + ulong_t options; + int nscount; + struct sockaddr_in + nsaddr_list[3]; + unsigned short id; + /* 2 byte hole here. */ + ptr_t dnsrch[7]; //char* + char defdname[256]; + ulong_t pfcode; + unsigned ndots:4; + unsigned nsort:4; + unsigned ipv6_unavail:1; + unsigned unused:23; + struct { + struct in_addr addr; + uint32_t mask; + } sort_list[10]; + /* 4 byte hole here on 64-bit architectures. */ + ptr_t __glibc_unused_qhook; //void* + ptr_t __glibc_unused_rhook; //void* + int res_h_errno; + int _vcsock; + unsigned int _flags; + /* 4 byte hole here on 64-bit architectures. */ + union { + char pad[52]; /* On an i386 this means 512b total. */ + struct { + uint16_t nscount; + uint16_t nsmap[3]; + int nssocks[3]; + uint16_t nscount6; + uint16_t nsinit; + ptr_t nsaddrs[3]; //struct sockaddr_in6* + unsigned int __glibc_reserved[2]; + } _ext; + } _u; +} my_res_state_32_t; + +void* convert_res_state_to_32(void* d, void* s) +{ + if(!d || !s) return NULL; + struct __res_state* src = s; + my_res_state_32_t* dst = d; + + dst->retrans = src->retrans; + dst->retry = src->retry; + dst->options = to_ulong(src->options); + memmove(dst->nsaddr_list, src->nsaddr_list, sizeof(dst->nsaddr_list)); + dst->id = src->id; + for(int i=0; i<7; ++i) + dst->dnsrch[i] = to_ptrv(src->dnsrch[i]); + memmove(dst->defdname, src->defdname, sizeof(dst->defdname)); + dst->pfcode = to_ulong(src->pfcode); + dst->ndots = src->ndots; + dst->nsort = src->nsort; + dst->ipv6_unavail = src->ipv6_unavail; + dst->unused = src->unused; + memmove(dst->sort_list, src->sort_list, sizeof(dst->sort_list)); + dst->__glibc_unused_qhook = to_ptrv(src->__glibc_unused_qhook); + dst->__glibc_unused_rhook = to_ptrv(src->__glibc_unused_rhook); + dst->res_h_errno = src->res_h_errno; + dst->_vcsock = src->_vcsock; + dst->_flags = src->_flags; + memmove(dst->_u.pad, src->_u.pad, sizeof(dst->_u.pad)); + + return dst; +} + +void* convert_res_state_to_64(void* d, void* s) +{ + if(!d || !s) return NULL; + my_res_state_32_t* src = s; + struct __res_state* dst = d; + + memmove(dst->_u.pad, src->_u.pad, sizeof(dst->_u.pad)); + dst->_flags = src->_flags; + dst->_vcsock = src->_vcsock; + dst->res_h_errno = src->res_h_errno; + dst->__glibc_unused_rhook = from_ptrv(src->__glibc_unused_rhook); + dst->__glibc_unused_qhook = from_ptrv(src->__glibc_unused_qhook); + memmove(dst->sort_list, src->sort_list, sizeof(dst->sort_list)); + dst->unused = src->unused; + dst->ipv6_unavail = src->ipv6_unavail; + dst->nsort = src->nsort; + dst->ndots = src->ndots; + dst->pfcode = from_ulong(src->pfcode); + memmove(dst->defdname, src->defdname, sizeof(dst->defdname)); + for(int i=6; i>=0; --i) + dst->dnsrch[i] = from_ptrv(src->dnsrch[i]); + dst->id = src->id; + memmove(dst->nsaddr_list, src->nsaddr_list, sizeof(dst->nsaddr_list)); + dst->options = from_ulong(src->options); + dst->retry = src->retry; + dst->retrans = src->retrans; + + return dst; +} + +EXPORT void* my32___res_state(x64emu_t* emu) +{ + if(emu->res_state_64) // update res? + convert_res_state_to_64(emu->res_state_64, emu->res_state_32); + void* ret = __res_state(); + if(!ret) + return ret; + if(emu->res_state_64!=ret) { + if(!emu->res_state_32) + emu->res_state_32 = actual_calloc(1, sizeof(my_res_state_32_t)); + emu->res_state_64 = ret; + } + convert_res_state_to_32(emu->res_state_32, emu->res_state_64); + return emu->res_state_32; +} + +/*EXPORT void my32___res_iclose(x64emu_t* emu, void* s, int f) +{ + if(emu->res_state_64==s) { + emu->res_state_64 = NULL; + actual_free(emu->res_state_32); + emu->res_state_32 = NULL; + } + __res_iclose(s, f); +}*/ + +EXPORT int my32_res_query(x64emu_t* emu, void* dname, int class, int type, void* answer, int anslen) +{ + convert_res_state_to_64(emu->res_state_64, emu->res_state_32); + int ret = res_query(dname, class, type, answer, anslen); + emu->libc_herr = h_errno; + return ret; +} + +EXPORT int my32_res_search(x64emu_t* emu, void* dname, int class, int type, void* answer, int anslen) +{ + convert_res_state_to_64(emu->res_state_64, emu->res_state_32); + int ret = res_search(dname, class, type, answer, anslen); + emu->libc_herr = h_errno; + return ret; +} + +void convert_ns_msg_to_32(void* d, void* s) +{ + if(!d || !s) return; + ns_msg* src = s; + my_ns_msg_32_t* dst = d; + dst->_msg = to_ptrv((void*)src->_msg); + dst->_eom = to_ptrv((void*)src->_eom); + dst->_id = src->_id; + dst->_flags = src->_flags; + for(int i=0; i<4; ++i) + dst->_counts[i] = src->_counts[i]; + for(int i=0; i<4; ++i) + dst->_sections[i] = to_ptrv((void*)src->_sections[i]); + dst->_sect = src->_sect; + dst->_rrnum = src->_rrnum; + dst->_msg_ptr = to_ptrv((void*)src->_msg_ptr); +} +void convert_ns_msg_to_64(void* d, void* s) +{ + if(!d || !s) return; + my_ns_msg_32_t* src = s; + ns_msg* dst = d; + dst->_msg_ptr = from_ptrv(src->_msg_ptr); + dst->_rrnum = src->_rrnum; + dst->_sect = src->_sect; + for(int i=3; i>=0; --i) + dst->_sections[i] = from_ptrv(src->_sections[i]); + for(int i=3; i>=0; --i) + dst->_counts[i] = src->_counts[i]; + dst->_flags = src->_flags; + dst->_id = src->_id; + dst->_eom = from_ptrv(src->_eom); + dst->_msg = from_ptrv(src->_msg); +} + + +EXPORT int my32_ns_initparse(x64emu_t* emu, void* msg, int len, my_ns_msg_32_t* handle) +{ + ns_msg handle_l = {0}; + int ret = ns_initparse(msg, len, &handle_l); + convert_ns_msg_to_32(handle, &handle_l); + return ret; +} + +void convert_ns_rr_to_32(void* d, void* s) +{ + if(!d || !s) return; + ns_rr* src = s; + my_ns_rr_32_t* dst = d; + memcpy(dst->name, src->name, sizeof(dst->name)); + dst->type = src->type; + dst->rr_class = src->rr_class; + dst->ttl = src->ttl; + dst->rdlength = src->rdlength; + dst->rdata = to_ptrv((void*)src->rdata); +} +void convert_ns_rr_to_64(void* d, void* s) +{ + if(!d || !s) return; + my_ns_rr_32_t* src = s; + ns_rr* dst = d; + dst->rdata = from_ptrv(src->rdata); + dst->rdlength = src->rdlength; + dst->ttl = src->ttl; + dst->rr_class = src->rr_class; + dst->type = src->type; + memcpy(dst->name, src->name, sizeof(dst->name)); +} + +EXPORT int my32_ns_parserr(x64emu_t* emu, my_ns_msg_32_t* handle, uint32_t section, int rrnum, my_ns_rr_32_t* rr) +{ + ns_msg handle_l = {0}; + ns_rr rr_l = {0}; + convert_ns_msg_to_64(&handle_l, handle); + convert_ns_rr_to_64(&rr_l, rr); + int ret = ns_parserr(&handle_l, section, rrnum, &rr_l); + convert_ns_rr_to_32(rr, &rr_l); + convert_ns_msg_to_32(handle, &handle_l); + return ret; +} + +EXPORT struct in6_addr my32_in6addr_any; +EXPORT struct in6_addr my32_in6addr_loopback; + +void libc32_net_init() +{ + my32_in6addr_any = in6addr_any; + my32_in6addr_loopback = in6addr_loopback; +} + +int ioctl_cgifconf(x64emu_t* emu, int fd, void* arg) +{ + i386_ifconf_t *i386_conf = (i386_ifconf_t*)arg; + if(!i386_conf->i386_ifc_buf) + { + return ioctl(fd, SIOCGIFCONF, i386_conf); + } + else + { + struct ifconf conf; + conf.ifc_len = i386_conf->ifc_len; + conf.ifc_buf = from_ptrv(i386_conf->i386_ifc_buf); + int ret = ioctl(fd, SIOCGIFCONF, &conf); + if(ret<0) return ret; + i386_ifreq_t *i386_reqs = (i386_ifreq_t*)conf.ifc_buf; + struct ifreq *reqs = conf.ifc_req; + for(int i=0; i*sizeof(struct ifreq)ifc_len = conf.ifc_len * sizeof(i386_ifreq_t) / sizeof(struct ifreq); + return ret; + } +} diff --git a/src/libtools/libdl.c b/src/libtools/libdl.c new file mode 100644 index 0000000..b38cf51 --- /dev/null +++ b/src/libtools/libdl.c @@ -0,0 +1,122 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "libdl.h" +#include "box64context.h" +#include "debug.h" +#include "x64emu.h" +#include "elfloader.h" +#include "fileutils.h" +#include "emu/x64emu_private.h" +#include "elfhacks.h" + +#include "vulkanoverlay.h" + +static my_hookedlib_t* hooked_libs = NULL; +static uint32_t hooked_cap = 0; +static uint32_t hooked_size = 0; + +#define HOOKLIB 0x1000 + +static void* AddNewHookedLib(void* priv, const char* path, my_hookedlib_type_t type) +{ + if(hooked_size==hooked_cap) { + hooked_cap+=4; + hooked_libs = realloc(hooked_libs, hooked_cap*sizeof(my_hookedlib_t)); + } + printf_log(LOG_INFO, "Adding Hooked Lib %d: %s\n", hooked_size, path); + uint32_t i = hooked_size++; + hooked_libs[i].fullpath = box_strdup(path); + hooked_libs[i].self = (void*)((uintptr_t)HOOKLIB + i); + hooked_libs[i].ref = 1; + hooked_libs[i].type = type; + hooked_libs[i].priv = priv; + return hooked_libs[i].self; +} + +static int RemoveHookedLib(uint32_t i) +{ + my_hookedlib_type_t type = hooked_libs[i].type; + void* priv = hooked_libs[i].priv; + box_free((void*)hooked_libs[i].fullpath); + hooked_libs[i].fullpath = NULL; + hooked_libs[i].self = NULL; + while(hooked_size && !hooked_libs[hooked_size-1].self) + --hooked_size; + if(type==VulkanOverlay) + return FreeVulkanOverlay(priv); + return 0; +} + +static void*(*real_dlopen)(const char*, int) = NULL; +static int (*real_dlclose)(void*) = NULL; +static void* (*real_dlsym)(void*, const char*) = NULL; + +EXPORT void* dlopen(const char* path, int flags) +{ + if (!real_dlopen) real_dlopen = GetNativeSymbolUnversioned(RTLD_NEXT, "dlopen"); + + // will look only for libs loaded with full path (and only on 64bits for now) + if(path && strchr(path, '/') && (/*(box64_is32bits && FileIsX86ELF(path)) ||*/ (!box64_is32bits && FileIsX64ELF(path)))) { + printf_log(LOG_INFO, "Hooked dlopen(%s, 0x%x) on x64 lib\n", path, flags); + + //check if already wrapped, to add a new ref (unless flags is RTLD_NOLOAD) + for(uint32_t i=0; i=HOOKLIB && (uintptr_t)handle=HOOKLIB && (uintptr_t)handle +#include + +#include "debug.h" +#include "box32context.h" +#include "wrapper32.h" +#include "library.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "converter32.h" +#include "my_x11_defs.h" +#include "my_x11_defs_32.h" +#include "my_x11_conv.h" +#include "myalign32.h" + +typedef struct Visuals_s { + my_Visual_t* _64; + my_Visual_32_t* _32; + int ref; // 0 is 64, 1 is 32 +} Visuals_t; +KHASH_MAP_INIT_INT(visuals, Visuals_t); + +#define N_DISPLAY 16 +my_XDisplay_t* my32_Displays_64[N_DISPLAY] = {0}; +struct my_XFreeFuncs_32 my32_free_funcs_32[N_DISPLAY] = {0}; +struct my_XLockPtrs_32 my32_lock_fns_32[N_DISPLAY] = {0}; +my_XDisplay_32_t my32_Displays_32[N_DISPLAY] = {0}; +kh_visuals_t* my32_Displays_Visuals[N_DISPLAY] = {0}; +void* my32_XCB_Display[N_DISPLAY] = {0}; + +void* getDisplay(void* d) +{ + if(!d) return d; + for(int i=0; iext_data = to_ptrv(src->ext_data); + dst->display = to_ptrv(FindDisplay(src->display)); + dst->root = to_ulong(src->root); + dst->width = src->width; + dst->height = src->height; + dst->mwidth = src->mwidth; + dst->mheight = src->mheight; + dst->ndepths = src->ndepths; + dst->depths = to_ptrv(src->depths); + dst->root_depth = src->root_depth; + dst->root_visual = to_ptrv(src->root_visual); + dst->default_gc = to_ptrv(src->default_gc); + dst->cmap = to_ulong(src->cmap); + dst->white_pixel = to_ulong(src->white_pixel); + dst->black_pixel = to_ulong(src->black_pixel); + dst->max_maps = src->max_maps; + dst->min_maps = src->min_maps; + dst->backing_store = src->backing_store; + dst->save_unders = src->save_unders; + dst->root_input_mask = to_long(src->root_input_mask); +} +void convert_Screen_to_64(void* d, void* s) +{ + my_Screen_t* dst = d; + my_Screen_32_t* src = s; + dst->root_input_mask = from_long(src->root_input_mask); + dst->save_unders = src->save_unders; + dst->backing_store = src->backing_store; + dst->min_maps = src->min_maps; + dst->max_maps = src->max_maps; + dst->black_pixel = from_ulong(src->black_pixel); + dst->white_pixel = from_ulong(src->white_pixel); + dst->cmap = from_ulong(src->cmap); + dst->default_gc = from_ptrv(src->default_gc); + dst->root_visual = from_ptrv(src->root_visual); + dst->root_depth = src->root_depth; + dst->depths = from_ptrv(src->depths); + dst->ndepths = src->ndepths; + dst->mheight = src->mheight; + dst->mwidth = src->mwidth; + dst->height = src->height; + dst->width = src->width; + dst->root = from_ulong(src->root); + dst->display = getDisplay(from_ptrv(src->display)); + dst->ext_data = from_ptrv(src->ext_data); +} + +void internal_convert_Visual_to_32(void* d, void* s) +{ + my_Visual_t* src = s; + my_Visual_32_t* dst = d; + dst->ext_data = to_ptrv(src->ext_data); + dst->visualid = to_ulong(src->visualid); + dst->c_class = src->c_class; + dst->red_mask = to_ulong(src->red_mask); + dst->green_mask = to_ulong(src->green_mask); + dst->blue_mask = to_ulong(src->blue_mask); + dst->bits_per_rgb = src->bits_per_rgb; + dst->map_entries = src->map_entries; +} +void internal_convert_Visual_to_64(void* d, void* s) +{ + my_Visual_32_t* src = s; + my_Visual_t* dst = d; + dst->map_entries = src->map_entries; + dst->bits_per_rgb = src->bits_per_rgb; + dst->blue_mask = from_ulong(src->blue_mask); + dst->green_mask = from_ulong(src->green_mask); + dst->red_mask = from_ulong(src->red_mask); + dst->c_class = src->c_class; + dst->visualid = from_ulong(src->visualid); + dst->ext_data = from_ptrv(src->ext_data); +} + +my_Visual_32_t* getVisual32(int N, my_Visual_t* a) +{ + if(!a) return NULL; + uint32_t key = a->visualid; + khint_t k = kh_get(visuals, my32_Displays_Visuals[N], key); + Visuals_t* ret = NULL; + if(k==kh_end(my32_Displays_Visuals[N])) { + int r; + k = kh_put(visuals, my32_Displays_Visuals[N], key, &r); + ret = &kh_value(my32_Displays_Visuals[N], k); + ret->_32 = calloc(1, sizeof(my_Visual_32_t)); + ret->_64 = a; + ret->ref = 0; + internal_convert_Visual_to_32(ret->_32, ret->_64); + } else + ret = &kh_value(my32_Displays_Visuals[N], k); + return ret->_32; +} +my_Visual_t* getVisual64(int N, my_Visual_32_t* a) +{ + if(!a) return NULL; + uint32_t key = a->visualid; + khint_t k = kh_get(visuals, my32_Displays_Visuals[N], key); + Visuals_t* ret = NULL; + if(k==kh_end(my32_Displays_Visuals[N])) { + // workaround for already "64" Visual + // needed for retrocityrampge (probably other) + // TODO: fix the underlying issue + if(!a->ext_data && !a->visualid) + return (my_Visual_t*)a; + int r; + k = kh_put(visuals, my32_Displays_Visuals[N], key, &r); + ret = &kh_value(my32_Displays_Visuals[N], k); + ret->_64 = calloc(1, sizeof(my_Visual_t)); + ret->_32 = a; + ret->ref = 1; + internal_convert_Visual_to_64(ret->_64, ret->_32); + } else + ret = &kh_value(my32_Displays_Visuals[N], k); + return ret->_64; +} + +void* get_display_screen(int idx, void* a) +{ + my_XDisplay_t* dpy = my32_Displays_64[idx]; + my_XDisplay_32_t* dpy32 = &my32_Displays_32[idx]; + my_Screen_32_t* screens32 = from_ptrv(dpy32->screens); + for(int i=0; inscreens; ++i) + if(&screens32[i] == a) + return &dpy->screens[i]; + return a; +} + +void* convert_Visual_to_32(void* dpy, void* a) +{ + if(!dpy) return a; + for(int i=0; ilibx11) { + // the lib has not be loaded directly... need to open it! leaking the lib handle... + #ifdef ANDROID + my_dlopen(thread_get_emu(), "libX11.so", RTLD_NOW); + #else + my_dlopen(thread_get_emu(), "libX11.so.6", RTLD_NOW); + #endif + } + my_XDisplay_t* dpy = (my_XDisplay_t*)d; + // look for a free slot, or a display already there + my_XDisplay_32_t* ret = NULL; + struct my_XFreeFuncs_32 *free_funcs = NULL; + struct my_XLockPtrs_32 *lock_fns = NULL; + for(int i=0; ifree_funcs = (dpy->free_funcs)?to_ptrv(free_funcs):0; + lock_fns = &my32_lock_fns_32[i]; + ret->lock_fns = (dpy->lock_fns)?to_ptrv(lock_fns):0; + my32_Displays_Visuals[i] = kh_init(visuals); + } + } + if(!ret) { + printf_log(LOG_INFO, "No more slot available for libX11 Display!"); + return d; + } + + bridge_t* system = my_context->libx11->w.bridge; + + // partial copy... + + #define GO(A, W)\ + if(dpy->A) \ + ret->A = AddCheckBridge(system, W, dpy->A, 0, #A); \ + + #define GO2(A, B, W) \ + if(dpy->A && dpy->A->B) \ + A->B = AddCheckBridge(system, W, dpy->A->B, 0, #B "_" #A); \ + + ret->vendor = to_cstring(dpy->vendor); + ret->fd = dpy->fd; + ret->conn_checker = dpy->conn_checker; + ret->proto_major_version = dpy->proto_major_version; + ret->proto_minor_version = dpy->proto_minor_version; + ret->resource_base = to_ulong(dpy->resource_base); + ret->resource_mask = to_ulong(dpy->resource_mask); + ret->resource_id = to_ulong(dpy->resource_id); + ret->xdefaults = to_cstring(dpy->xdefaults); + ret->resource_shift = dpy->resource_shift; + ret->byte_order = dpy->byte_order; + ret->bitmap_unit = dpy->bitmap_unit; + ret->bitmap_pad = dpy->bitmap_pad; + ret->bitmap_bit_order = dpy->bitmap_bit_order; + ret->display_name = to_cstring(dpy->display_name); + ret->default_screen = dpy->default_screen; + ret->nscreens = dpy->nscreens; + if(dpy->screens) { + my_Screen_32_t* screens = calloc(dpy->nscreens, sizeof(my_Screen_32_t)); + ret->screens = to_ptrv(screens); + for(int i=0; inscreens; ++i) { + convert_Screen_to_32(screens+i, dpy->screens+i); + screens[i].root_visual = to_ptrv(getVisual32(i, dpy->screens[i].root_visual)); + } + } else + ret->screens = 0; + + GO2(free_funcs, atoms, vFp_32) + GO2(free_funcs, modifiermap, iFp_32) + GO2(free_funcs, key_bindings, vFp_32) + GO2(free_funcs, context_db, vFp_32) + GO2(free_funcs, defaultCCCs, vFp_32) + GO2(free_funcs, clientCmaps, vFp_32) + GO2(free_funcs, intensityMaps, vFp_32) + GO2(free_funcs, im_filters, vFp_32) + GO2(free_funcs, xkb, vFp_32) + GO(resource_alloc, LFp_32) + GO(synchandler, iFp_32) + //TODO: ext_procs? + //TODO: event_vec? + //TODO: wire_vec? + //TODO: async_handlers? + GO2(lock_fns, lock_display, vFX_32) + GO2(lock_fns, unlock_display, vFX_32) + GO(idlist_alloc, vFppi_32) + //TODO: error_vec? + //TODO: flushes + //TODO: im_fd_info? + //TODO: conn_watchers + GO(savedsynchandler, iFp_32) + //TODO: generic_event_vec? + //TODO: generic_event_copy_vec? + + + #undef GO + #undef GO2 + + return ret; +} + +void delDisplay(void* d) +{ + for(int i=0; iref) free(v->_64); else free(v->_32)); + kh_destroy(visuals, my32_Displays_Visuals[i]); + my32_Displays_Visuals[i] = NULL; + if(my32_XCB_Display[i]) { + del_xcb_connection32(my32_XCB_Display[i]); + my32_XCB_Display[i] = NULL; + } + return; + } + } +} + +void regXCBDisplay(void* d, void* xcb) +{ if(!my_context->libx11) { + // the lib has not be loaded directly... need to open it! leaking the lib handle... + #ifdef ANDROID + my_dlopen(thread_get_emu(), "libX11.so", RTLD_NOW); + #else + my_dlopen(thread_get_emu(), "libX11.so.6", RTLD_NOW); + #endif + } + my_XDisplay_t* dpy = (my_XDisplay_t*)d; + for(int i=0; irequest = src->request; + // num lock + dst->num_lock = src->num_lock; + // sync screens + if(dst->nscreens!=src->nscreens) { + my_Screen_32_t* screens = from_ptrv(dst->screens); + dst->nscreens = src->nscreens; + screens = realloc(screens, dst->nscreens*sizeof(my_Screen_32_t)); + dst->screens = to_ptrv(screens); + for(int i=0; inscreens; ++i) + convert_Screen_to_32(screens+i, src->screens+i); + } + // functions + bridge_t* system = my_context->libx11->w.bridge; + int N = -1; + for(int i=0; ifree_funcs = (src->free_funcs)?to_ptrv(free_funcs):0; + struct my_XLockPtrs_32 *lock_fns = &my32_lock_fns_32[N]; + dst->lock_fns = (src->lock_fns)?to_ptrv(lock_fns):0; + #define GO(A, W)\ + if(src->A) \ + dst->A = AddCheckBridge(system, W, src->A, 0, #A); \ + + #define GO2(A, B, W) \ + if(src->A && src->A->B) \ + A->B = AddCheckBridge(system, W, src->A->B, 0, #B "_" #A); \ + + GO2(free_funcs, atoms, vFp_32) + GO2(free_funcs, modifiermap, iFp_32) + GO2(free_funcs, key_bindings, vFp_32) + GO2(free_funcs, context_db, vFp_32) + GO2(free_funcs, defaultCCCs, vFp_32) + GO2(free_funcs, clientCmaps, vFp_32) + GO2(free_funcs, intensityMaps, vFp_32) + GO2(free_funcs, im_filters, vFp_32) + GO2(free_funcs, xkb, vFp_32) + GO(resource_alloc, LFp_32) + GO(synchandler, iFp_32) + //TODO: ext_procs? + //TODO: event_vec? + //TODO: wire_vec? + //TODO: async_handlers? + GO2(lock_fns, lock_display, vFX_32) + GO2(lock_fns, unlock_display, vFX_32) + GO(idlist_alloc, vFppi_32) + //TODO: error_vec? + //TODO: flushes + //TODO: im_fd_info? + //TODO: conn_watchers + GO(savedsynchandler, iFp_32) + //TODO: generic_event_vec? + //TODO: generic_event_copy_vec? + + #undef GO + #undef GO2 +} + +void convert_XWMints_to_64(void* d, void* s) +{ + my_XWMHints_t* dst = d; + my_XWMHints_32_t* src = s; + long flags = from_long(src->flags); + // reverse order + if(flags&XWMHint_WindowGroupHint) dst->window_group = from_ulong(src->window_group); + if(flags&XWMHint_IconMaskHint) dst->icon_mask = from_ulong(src->icon_mask); + if(flags&XWMHint_IconPositionHint) {dst->icon_y = src->icon_y; dst->icon_x = src->icon_x;} + if(flags&XWMHint_IconWindowHint) dst->icon_window = from_ulong(src->icon_window); + if(flags&XWMHint_IconPixmapHint) dst->icon_pixmap = from_ulong(src->icon_pixmap); + if(flags&XWMHint_StateHint) dst->initial_state = src->initial_state; + if(flags&XWMHint_InputHint) dst->input = src->input; + + dst->flags = flags; +} +void inplace_enlarge_wmhints(void* hints) +{ + if(!hints) return; + my_XWMHints_32_t* src = hints; + my_XWMHints_t* dst = hints; + long flags = from_long(src->flags); + // reverse order + if(flags&XWMHint_WindowGroupHint) dst->window_group = from_ulong(src->window_group); + if(flags&XWMHint_IconMaskHint) dst->icon_mask = from_ulong(src->icon_mask); + if(flags&XWMHint_IconPositionHint) {dst->icon_y = src->icon_y; dst->icon_x = src->icon_x;} + if(flags&XWMHint_IconWindowHint) dst->icon_window = from_ulong(src->icon_window); + if(flags&XWMHint_IconPixmapHint) dst->icon_pixmap = from_ulong(src->icon_pixmap); + if(flags&XWMHint_StateHint) dst->initial_state = src->initial_state; + if(flags&XWMHint_InputHint) dst->input = src->input; + + dst->flags = flags; +} +void inplace_shrink_wmhints(void* hints) +{ + if(!hints) return; + my_XWMHints_t* src = hints; + my_XWMHints_32_t* dst = hints; + long_t flags = to_long(src->flags); + // forward order + if(flags&XWMHint_InputHint) dst->input = src->input; + if(flags&XWMHint_StateHint) dst->initial_state = src->initial_state; + if(flags&XWMHint_IconPixmapHint) dst->icon_pixmap = to_ulong(src->icon_pixmap); + if(flags&XWMHint_IconWindowHint) dst->icon_window = to_ulong(src->icon_window); + if(flags&XWMHint_IconPositionHint) {dst->icon_y = src->icon_y; dst->icon_x = src->icon_x;} + if(flags&XWMHint_IconMaskHint) dst->icon_mask = to_ulong(src->icon_mask); + if(flags&XWMHint_WindowGroupHint) dst->window_group = to_ulong(src->window_group); + + dst->flags = flags; +} + +void convert_XSizeHints_to_64(void* d, void *s) +{ + //XSizeHints is a long flag and 17*int... + long flags = to_long(*(long_t*)s); + memcpy(d+8, s+4, 17*4); + *(long*)d = flags; +} +void inplace_enlarge_wmsizehints(void* hints) +{ + //XSizeHints is a long flag and 17*int... + long flags = to_long(*(long_t*)hints); + memmove(hints+8, hints+4, 17*4); + *(long*)hints = flags; +} +void inplace_shrink_wmsizehints(void* hints) +{ + //XSizeHints is a long flag and 17*int... + long_t flags = from_long(*(long*)hints); + memmove(hints+4, hints+8, 17*4); + *(long_t*)hints = flags; +} + +void convert_XWindowAttributes_to_32(void* dpy, void* d, void* s) +{ + my_XWindowAttributes_t* src = s; + my_XWindowAttributes_32_t* dst = d; + dst->x = src->x; + dst->y = src->y; + dst->width = src->width; + dst->height = src->height; + dst->border_width = src->border_width; + dst->depth = src->depth; + dst->visual = to_ptrv(convert_Visual_to_32(dpy, src->visual)); + dst->root = to_ulong(src->root); + dst->c_class = src->c_class; + dst->bit_gravity = src->bit_gravity; + dst->win_gravity = src->win_gravity; + dst->backing_store = src->backing_store; + dst->backing_planes = to_ulong(src->backing_planes); + dst->backing_pixel = to_ulong(src->backing_pixel); + dst->save_under = src->save_under; + dst->colormap = to_ulong(src->colormap); + dst->map_installed = src->map_installed; + dst->map_state = src->map_state; + dst->all_event_masks = to_long(src->all_event_masks); + dst->your_event_mask = to_long(src->your_event_mask); + dst->do_not_propagate_mask = to_long(src->do_not_propagate_mask); + dst->override_redirect = src->override_redirect; + dst->screen = to_ptrv(src->screen); +} + +void inplace_XModifierKeymap_shrink(void* a) +{ + my_XModifierKeymap_32_t *d = a; + my_XModifierKeymap_t* s = a; + + d->max_keypermod = s->max_keypermod; + d->modifiermap = to_ptrv(s->modifiermap); +} +void inplace_XModifierKeymap_enlarge(void* a) +{ + my_XModifierKeymap_t *d = a; + my_XModifierKeymap_32_t* s = a; + + d->modifiermap = from_ptrv(s->modifiermap); + d->max_keypermod = s->max_keypermod; +} + +void convert_XVisualInfo_to_32(void* dpy, my_XVisualInfo_32_t* dst, my_XVisualInfo_t* src) +{ + dst->visual = to_ptrv(convert_Visual_to_32(dpy, src->visual)); + dst->visualid = to_ulong(src->visualid); + dst->screen = src->screen; + dst->depth = src->depth; + dst->c_class = src->c_class; + dst->red_mask = to_ulong(src->red_mask); + dst->green_mask = to_ulong(src->green_mask); + dst->blue_mask = to_ulong(src->blue_mask); + dst->colormap_size = src->colormap_size; + dst->bits_per_rgb = src->bits_per_rgb; +} +void convert_XVisualInfo_to_64_novisual(void* dpy, my_XVisualInfo_t* dst, my_XVisualInfo_32_t* src) +{ + dst->bits_per_rgb = src->bits_per_rgb; + dst->colormap_size = src->colormap_size; + dst->blue_mask = from_ulong(src->blue_mask); + dst->green_mask = from_ulong(src->green_mask); + dst->red_mask = from_ulong(src->red_mask); + dst->c_class = src->c_class; + dst->depth = src->depth; + dst->screen = src->screen; + dst->visualid = from_ulong(src->visualid); + dst->visual = NULL; +} +void convert_XVisualInfo_to_64(void* dpy, my_XVisualInfo_t* dst, my_XVisualInfo_32_t* src) +{ + dst->bits_per_rgb = src->bits_per_rgb; + dst->colormap_size = src->colormap_size; + dst->blue_mask = from_ulong(src->blue_mask); + dst->green_mask = from_ulong(src->green_mask); + dst->red_mask = from_ulong(src->red_mask); + dst->c_class = src->c_class; + dst->depth = src->depth; + dst->screen = src->screen; + dst->visualid = from_ulong(src->visualid); + dst->visual = convert_Visual_to_64(dpy, from_ptrv(src->visual)); +} +void inplace_XVisualInfo_shrink(void* dpy, void *a) +{ + if(!a) return; + my_XVisualInfo_t *src = a; + my_XVisualInfo_32_t* dst = a; + + convert_XVisualInfo_to_32(dpy, dst, src); +} +void inplace_XVisualInfo_enlarge(void* dpy, void *a) +{ + if(!a) return; + my_XVisualInfo_32_t *src = a; + my_XVisualInfo_t* dst = a; + + convert_XVisualInfo_to_64(dpy, dst, src); +} + +void inplace_XdbeVisualInfo_shrink(void* a) +{ + if(!a) return; + my_XdbeVisualInfo_t *src = a; + my_XdbeVisualInfo_32_t* dst = a; + + dst->visual = to_ulong(src->visual); + dst->depth = src->depth; + dst->perflevel = src->perflevel; +} +void inplace_XdbeScreenVisualInfo_shrink(void* a) +{ + if(!a) return; + my_XdbeScreenVisualInfo_t *src = a; + my_XdbeScreenVisualInfo_32_t* dst = a; + + for(int i=0; icount; ++i) + inplace_XdbeVisualInfo_shrink(src->visinfo+i); + dst->count = src->count; + dst->visinfo = to_ptrv(src->visinfo); +} +void inplace_XdbeVisualInfo_enlarge(void* a) +{ + if(!a) return; + my_XdbeVisualInfo_32_t *src = a; + my_XdbeVisualInfo_t* dst = a; + + dst->perflevel = src->perflevel; + dst->depth = src->depth; + dst->visual = from_ulong(src->visual); +} +void inplace_XdbeScreenVisualInfo_enlarge(void* a) +{ + if(!a) return; + my_XdbeScreenVisualInfo_32_t *src = a; + my_XdbeScreenVisualInfo_t* dst = a; + + dst->visinfo = from_ptrv(src->visinfo); + dst->count = src->count; + for(int i=dst->count-1; i>=0; --i) + inplace_XdbeVisualInfo_enlarge(dst->visinfo+i); +} + +void inplace_XExtDisplayInfo_shrink(void* a) +{ + if(!a) return; + my_XExtDisplayInfo_t* src = a; + my_XExtDisplayInfo_32_t* dst = a; + + dst->next = to_ptrv(src->next); + dst->display = to_ptrv(FindDisplay(src->display)); + dst->codes = to_ptrv(src->codes); + dst->data = to_ptrv(src->data); +} +void inplace_XExtDisplayInfo_enlarge(void* a) +{ + if(!a) return; + my_XExtDisplayInfo_32_t* src = a; + my_XExtDisplayInfo_t* dst = a; + + dst->data = from_ptrv(src->data); + dst->codes = from_ptrv(src->codes); + dst->display = getDisplay(from_ptrv(src->display)); + dst->next = from_ptrv(src->next); +} + +void convert_XExtensionInfo_to_32(void* d, void* s) +{ + if(!s || !d) return; + my_XExtensionInfo_t* src = s; + my_XExtensionInfo_32_t* dst = d; + + my_XExtDisplayInfo_t* head = src->head; + while(head) { + my_XExtDisplayInfo_t* next = head->next; + inplace_XExtDisplayInfo_shrink(head); + head = next; + } + dst->head = to_ptrv(src->head); + dst->cur = to_ptrv(src->cur); + dst->ndisplays = src->ndisplays; +} +void convert_XExtensionInfo_to_64(void* d, void* s) +{ + if(!d || !s) return; + my_XExtensionInfo_32_t* src = s; + my_XExtensionInfo_t* dst = d; + + dst->ndisplays = src->ndisplays; + dst->cur = from_ptrv(src->cur); + dst->head = from_ptrv(src->head); + my_XExtDisplayInfo_t* head = dst->head; + while(head) { + inplace_XExtDisplayInfo_enlarge(head); + head = head->next; + } +} +void* inplace_XExtensionInfo_shrink(void* a) +{ + if(a) + convert_XExtensionInfo_to_32(a, a); + return a; +} +void* inplace_XExtensionInfo_enlarge(void* a) +{ + if(a) + convert_XExtensionInfo_to_64(a, a); + return a; +} + +void convert_XFontProp_to_32(my_XFontProp_32_t* dst, my_XFontProp_t* src) +{ + dst->name = to_ulong(src->name); + dst->card32 = to_ulong(src->card32); +} +void inplace_XFontProp_shrink(void* a) +{ + if(!a) return; + my_XFontProp_t* src = a; + my_XFontProp_32_t* dst = a; + convert_XFontProp_to_32(dst, src); +} +void convert_XFontProp_to_64(my_XFontProp_t* dst, my_XFontProp_32_t* src) +{ + dst->card32 = from_ulong(src->card32); + dst->name = from_ulong(src->name); +} +void inplace_XFontProp_enlarge(void* a) +{ + if(!a) return; + my_XFontProp_32_t* src = a; + my_XFontProp_t* dst = a; + convert_XFontProp_to_64(dst, src); +} +void inplace_XFontStruct_shrink(void* a) +{ + if(!a) return; + my_XFontStruct_t* src = a; + my_XFontStruct_32_t* dst = a; + + my_XFontProp_32_t* properties_s = (my_XFontProp_32_t*)src->properties; + for(int i=0; in_properties; ++i) + convert_XFontProp_to_32(properties_s+i, src->properties+i); + + dst->ext_data = to_ptrv(src->ext_data); + dst->fid = to_ulong(src->fid); + dst->direction = src->direction; + dst->min_char_or_byte2 = src->min_char_or_byte2; + dst->max_char_or_byte2 = src->max_char_or_byte2; + dst->min_byte1 = src->min_byte1; + dst->max_byte1 = src->max_byte1; + dst->all_chars_exist = src->all_chars_exist; + dst->default_char = src->default_char; + dst->n_properties = src->n_properties; + dst->properties = to_ptrv(src->properties); + memmove(&dst->min_bounds, &src->min_bounds, sizeof(dst->min_bounds)); + memmove(&dst->max_bounds, &src->max_bounds, sizeof(dst->max_bounds)); + dst->per_char = to_ptrv(src->per_char); + dst->ascent = src->ascent; + dst->descent = src->descent; +} +void inplace_XFontStruct_enlarge(void* a) +{ + if(!a) return; + my_XFontStruct_32_t* src = a; + my_XFontStruct_t* dst = a; + + dst->descent = src->descent; + dst->ascent = src->ascent; + dst->per_char = from_ptrv(src->per_char); + memmove(&dst->max_bounds, &src->max_bounds, sizeof(dst->max_bounds)); + memmove(&dst->min_bounds, &src->min_bounds, sizeof(dst->min_bounds)); + dst->properties = from_ptrv(src->properties); + dst->n_properties = src->n_properties; + dst->default_char = src->default_char; + dst->all_chars_exist = src->all_chars_exist; + dst->max_byte1 = src->max_byte1; + dst->min_byte1 = src->min_byte1; + dst->max_char_or_byte2 = src->max_char_or_byte2; + dst->min_char_or_byte2 = src->min_char_or_byte2; + dst->direction = src->direction; + dst->fid = from_ulong(src->fid); + dst->ext_data = from_ptrv(src->ext_data); + + my_XFontProp_32_t* properties_s = (my_XFontProp_32_t*)dst->properties; + for(int i=dst->n_properties-1; i>=0; --i) + convert_XFontProp_to_64(dst->properties+i, properties_s+i); +} + +void convert_XSetWindowAttributes_to_64(my_XSetWindowAttributes_t* dst, my_XSetWindowAttributes_32_t* src) +{ + dst->background_pixmap = from_ulong(src->background_pixmap); + dst->background_pixel = from_ulong(src->background_pixel); + dst->border_pixmap = from_ulong(src->border_pixmap); + dst->border_pixel = from_ulong(src->border_pixel); + dst->bit_gravity = src->bit_gravity; + dst->win_gravity = src->win_gravity; + dst->backing_store = from_ulong(src->backing_store); + dst->backing_planes = from_ulong(src->backing_planes); + dst->backing_pixel = src->backing_pixel; + dst->save_under = src->save_under; + dst->event_mask = from_long(src->event_mask); + dst->do_not_propagate_mask = from_long(src->do_not_propagate_mask); + dst->override_redirect = src->override_redirect; + dst->colormap = from_ulong(src->colormap); + dst->cursor = from_ulong(src->cursor); +} + +void* inplace_XImage_shrink(void* a) +{ + if(!a) return NULL; + WrapXImage(a, a); + return a; +} +void* inplace_XImage_enlarge(void* a) +{ + if(!a) return NULL; + UnwrapXImage(a, a); + return a; +} + +void convert_XRRModeInfo_to_32(void* d, const void* s) +{ + my_XRRModeInfo_32_t *dst = d; + const my_XRRModeInfo_t *src = s; + dst->id = to_ulong(src->id); + dst->width = src->width; + dst->height = src->height; + dst->dotClock = to_ulong(src->dotClock); + dst->hSyncStart = src->hSyncStart; + dst->hSyncEnd = src->hSyncEnd; + dst->hTotal = src->hTotal; + dst->hSkew = src->hSkew; + dst->vSyncStart = src->vSyncStart; + dst->vSyncEnd = src->vSyncEnd; + dst->vTotal = src->vTotal; + dst->name = to_ptrv(src->name); + dst->nameLength = src->nameLength; + dst->modeFlags = to_ulong(src->modeFlags); +} + +void convert_XRRModeInfo_to_64(void* d, const void* s) +{ + my_XRRModeInfo_t *dst = d; + const my_XRRModeInfo_32_t *src = s; + dst->modeFlags = from_ulong(src->modeFlags); + dst->nameLength = src->nameLength; + dst->name = from_ptrv(src->name); + dst->vTotal = src->vTotal; + dst->vSyncEnd = src->vSyncEnd; + dst->vSyncStart = src->vSyncStart; + dst->hSkew = src->hSkew; + dst->hTotal = src->hTotal; + dst->hSyncEnd = src->hSyncEnd; + dst->hSyncStart = src->hSyncStart; + dst->dotClock = from_ulong(src->dotClock); + dst->height = src->height; + dst->width = src->width; + dst->id = from_ulong(src->id); +} + +void inplace_XRRScreenResources_shrink(void* s) +{ + if(!s) return; + my_XRRScreenResources_32_t *dst = s; + my_XRRScreenResources_t *src = s; + // shrinking, so forward... + for(int i=0; incrtc; ++i) + ((XID_32*)src->crtcs)[i] = to_ulong(src->crtcs[i]); + for(int i=0; inoutput; ++i) + ((XID_32*)src->outputs)[i] = to_ulong(src->outputs[i]); + for(int i=0; inmode; ++i) + convert_XRRModeInfo_to_32(&((my_XRRModeInfo_32_t*)src->modes)[i], &src->modes[i]); + dst->timestamp = to_ulong(src->timestamp); + dst->configTimestamp = to_ulong(src->configTimestamp); + dst->ncrtc = src->ncrtc; + dst->crtcs = to_ptrv(src->crtcs); + dst->noutput = src->noutput; + dst->outputs = to_ptrv(src->outputs); + dst->nmode = src->nmode; + dst->modes = to_ptrv(src->modes); +} + +void inplace_XRRScreenResources_enlarge(void* s) +{ + if(!s) return; + my_XRRScreenResources_t *dst = s; + my_XRRScreenResources_32_t *src = s; + // enlarge, so backward... + int nmode = src->nmode; + int noutput = src->noutput; + int ncrtc = src->ncrtc; + dst->modes = from_ptrv(src->modes); + dst->nmode = src->nmode; + dst->outputs = from_ptrv(src->outputs); + dst->noutput = src->noutput; + dst->crtcs = from_ptrv(src->crtcs); + dst->ncrtc = src->ncrtc; + dst->configTimestamp = to_ulong(src->configTimestamp); + dst->timestamp = to_ulong(src->timestamp); + for(int i=nmode-1; i>=0; --i) + convert_XRRModeInfo_to_64(&dst->modes[i], &((my_XRRModeInfo_32_t*)dst->modes)[i]); + for(int i=noutput-1; i>=0; --i) + dst->outputs[i] = from_ulong(((XID_32*)dst->outputs)[i]); + for(int i=ncrtc-1; i>=0; --i) + dst->crtcs[i] = from_ulong(((XID_32*)dst->crtcs)[i]); +} + +void inplace_XRRCrtcInfo_shrink(void* s) +{ + if(!s) return; + my_XRRCrtcInfo_32_t *dst = s; + my_XRRCrtcInfo_t *src = s; + for(int i=0; inoutput; ++i) + ((XID_32*)src->outputs)[i] = to_ulong(src->outputs[i]); + for(int i=0; inpossible; ++i) + ((XID_32*)src->possible)[i] = to_ulong(src->possible[i]); + dst->timestamp = to_ulong(src->timestamp); + dst->x = src->x; + dst->y = src->y; + dst->width = src->width; + dst->height = src->height; + dst->mode = to_ulong(src->mode); + dst->rotation = src->rotation; + dst->noutput = src->noutput; + dst->outputs = to_ptrv(src->outputs); + dst->rotations = src->rotations; + dst->npossible = src->npossible; + dst->possible = to_ptrv(src->possible); +} + +void inplace_XRROutputInfo_shrink(void* s) +{ + if(!s) return; + my_XRROutputInfo_32_t *dst = s; + my_XRROutputInfo_t *src = s; + for(int i=0; incrtc; ++i) + ((XID_32*)src->crtcs)[i] = to_ulong(src->crtcs[i]); + for(int i=0; inclone; ++i) + ((XID_32*)src->clones)[i] = to_ulong(src->clones[i]); + for(int i=0; inmode; ++i) + ((XID_32*)src->modes)[i] = to_ulong(src->modes[i]); + dst->timestamp = to_ulong(src->timestamp); + dst->crtc = src->crtc; + dst->name = to_ptrv(src->name); + dst->nameLen = src->nameLen; + dst->mm_width = to_ulong(src->mm_width); + dst->mm_height = to_ulong(src->mm_height); + dst->connection = src->connection; + dst->subpixel_order = src->subpixel_order; + dst->ncrtc = src->ncrtc; + dst->crtcs = to_ptrv(src->crtcs); + dst->nclone = src->nclone; + dst->clones = to_ptrv(src->clones); + dst->nmode = src->nmode; + dst->npreferred = src->npreferred; + dst->modes = to_ptrv(src->modes); +} + +void inplace_XRRProviderInfo_shrink(void* a) +{ + if(!a) return; + my_XRRProviderInfo_32_t *dst = a; + my_XRRProviderInfo_t* src = a; + + for(int i=0; incrtcs; ++i) + ((ulong_t*)src->crtcs)[i] = to_ulong(src->crtcs[i]); + for(int i=0; inoutputs; ++i) + ((ulong_t*)src->outputs)[i] = to_ulong(src->outputs[i]); + for(int i=0; inassociatedproviders; ++i) + ((ulong_t*)src->associated_providers)[i] = to_ulong(src->associated_providers[i]); + dst->capabilities = src->capabilities; + dst->ncrtcs = src->ncrtcs; + dst->crtcs = to_ptrv(src->crtcs); + dst->noutputs = src->noutputs; + dst->outputs = to_ptrv(src->outputs); + dst->name = to_ptrv(src->name); + dst->nassociatedproviders = src->nassociatedproviders; + dst->associated_providers = to_ptrv(src->associated_providers); + dst->associated_capability = to_ptrv(src->associated_capability); + dst->nameLen = src->nameLen; +} +void inplace_XRRProviderInfo_enlarge(void* a) +{ + if(!a) return; + my_XRRProviderInfo_t *dst = a; + my_XRRProviderInfo_32_t* src = a; + + dst->nameLen = src->nameLen; + dst->associated_capability = from_ptrv(src->associated_capability); + dst->associated_providers = from_ptrv(src->associated_providers); + dst->nassociatedproviders = src->nassociatedproviders; + dst->name = from_ptrv(src->name); + dst->outputs = from_ptrv(src->outputs); + dst->noutputs = src->noutputs; + dst->crtcs = from_ptrv(src->crtcs); + dst->ncrtcs = src->ncrtcs; + dst->capabilities = src->capabilities; + for(int i=dst->ncrtcs-1; i>=0; --i) + dst->crtcs[i] = from_ulong(((ulong_t*)dst->crtcs)[i]); + for(int i=dst->noutputs-1; i>=0; --i) + dst->outputs[i] = from_ulong(((ulong_t*)dst->outputs)[i]); + for(int i=dst->nassociatedproviders-1; i>=0; --i) + dst->associated_providers[i] = from_ulong(((ulong_t*)dst->associated_providers)[i]); +} + +void inplace_XRRProviderResources_shrink(void* a) +{ + if(!a) return; + my_XRRProviderResources_32_t* dst = a; + my_XRRProviderResources_t* src = a; + + for(int i=0; inproviders; ++i) + ((ulong_t*)src->providers)[i] = to_ulong(src->providers[i]); + dst->timestamp = to_long(src->timestamp); + dst->nproviders = src->nproviders; + dst->providers = to_ptrv(src->providers); +} +void inplace_XRRProviderResources_enlarge(void* a) +{ + if(!a) return; + my_XRRProviderResources_t* dst = a; + my_XRRProviderResources_32_t* src = a; + + dst->timestamp = from_long(src->timestamp); + dst->nproviders = src->nproviders; + dst->providers = from_ptrv(src->providers); + for(int i=dst->nproviders-1; i>=0; --i) + dst->providers[i] = from_ulong(((ulong_t*)dst->providers)[i]); +} + +void* inplace_XRRPropertyInfo_shrink(void* a) +{ + if(!a) return NULL; + my_XRRPropertyInfo_t* src = a; + my_XRRPropertyInfo_32_t* dst = a; + + for(int i=0; inum_values; ++i) + ((long_t*)src->values)[i] = to_long(src->values[i]); + dst->pending = src->pending; + dst->range = src->range; + dst->immutable = src->immutable; + dst->num_values = src->num_values; + dst->values = to_ptrv(src->values); + + return a; +} + +void inplace_XIDeviceInfo_shrink(void* a, int n) +{ + if(!a || !n) return; + my_XIDeviceInfo_32_t* dst = a; + my_XIDeviceInfo_t* src = a; + + for(int i=0; ideviceid = src->deviceid; + dst->name = to_ptrv(src->name); + dst->use = src->use; + dst->attachment = src->attachment; + dst->enabled = src->enabled; + for(int j=0; jnum_classes; ++j) + ((ptr_t*)src->classes)[j] = to_ptrv(src->classes[j]); + dst->num_classes = src->num_classes; + dst->classes = to_ptrv(src->classes); + } + // mark last record, even on only 1 record, thos last 2 uint32_t are free + dst->deviceid = 0; + dst->name = 0; +} + +int inplace_XIDeviceInfo_enlarge(void* a) +{ + if(!a) return 0; + my_XIDeviceInfo_t* dst = a; + my_XIDeviceInfo_32_t* src = a; + int n = 0; + while(src[n].deviceid && src[n].name) ++n; + src+=n-1; + dst+=n-1; + for(int i=n-1; i>=0; --i, --src, --dst) { + dst->classes = from_ptrv(src->classes); + dst->num_classes = src->num_classes; + dst->enabled = src->enabled; + dst->attachment = src->attachment; + dst->use = src->use; + dst->name = from_ptrv(src->name); + dst->deviceid = src->deviceid; + for(int j=dst->num_classes-1; j>=0; --j) + dst->classes[j] = from_ptrv(((ptr_t*)dst->classes)[j]); + } + return n; +} + +void* inplace_XDevice_shrink(void* a) +{ + if(!a) return a; + my_XDevice_t* src = a; + my_XDevice_32_t* dst = a; + + dst->device_id = to_ulong(src->device_id); + dst->num_classes = src->num_classes; + dst->classes = to_ptrv(src->classes); + + return a; +} +void* inplace_XDevice_enlarge(void* a) +{ + if(!a) return a; + my_XDevice_32_t* src = a; + my_XDevice_t* dst = a; + + dst->classes = from_ptrv(src->classes); + dst->num_classes = src->num_classes; + dst->device_id = from_ulong(src->device_id); + + return a; +} +void* inplace_XDeviceState_shrink(void* a) +{ + if(!a) return a; + my_XDeviceState_t* src = a; + my_XDeviceState_32_t* dst = a; + + dst->device_id = to_ulong(src->device_id); + dst->num_classes = src->num_classes; + dst->data = to_ptrv(src->data); + + return a; +} +void* inplace_XDeviceState_enlarge(void* a) +{ + if(!a) return a; + my_XDeviceState_32_t* src = a; + my_XDeviceState_t* dst = a; + + dst->data = from_ptrv(src->data); + dst->num_classes = src->num_classes; + dst->device_id = from_ulong(src->device_id); + + return a; +} + +void convert_XShmSegmentInfo_to_32(void* d, void* s) +{ + my_XShmSegmentInfo_t* src = s; + my_XShmSegmentInfo_32_t* dst = d; + dst->shmseg = to_ulong(src->shmseg); + dst->shmid = src->shmid; + dst->shmaddr = to_ptrv(src->shmaddr); + dst->readOnly = src->readOnly; +} +void convert_XShmSegmentInfo_to_64(void* d, void* s) +{ + my_XShmSegmentInfo_32_t* src = s; + my_XShmSegmentInfo_t* dst = d; + dst->readOnly = src->readOnly; + dst->shmaddr = from_ptrv(src->shmaddr); + dst->shmid = src->shmid; + dst->shmseg = from_ulong(src->shmseg); +} +void* inplace_XkbNamesRec_shrink(void* a) +{ + if(a) { + my_XkbNamesRec_t* src = a; + my_XkbNamesRec_32_t* dst = a; + + for(int i=0; inum_rg; ++i) + src->radio_groups[i] = to_ulong(src->radio_groups[i]); + dst->keycodes = to_ulong(src->keycodes); + dst->geometry = to_ulong(src->geometry); + dst->symbols = to_ulong(src->symbols); + dst->types = to_ulong(src->types); + dst->compat = to_ulong(src->compat); + for(int i=0; i<16; ++i) + dst->vmods[i] = to_ulong(src->vmods[i]); + for(int i=0; i<32; ++i) + dst->indicators[i] = to_ulong(src->indicators[i]); + for(int i=0; i<4; ++i) + dst->groups[i] = to_ulong(src->groups[i]); + dst->keys = to_ptrv(src->keys); + dst->key_aliases = to_ptrv(src->key_aliases); + dst->radio_groups = to_ptrv(src->radio_groups); + dst->phys_symbols = to_ulong(src->phys_symbols); + dst->num_keys = src->num_keys; + dst->num_key_aliases = src->num_key_aliases; + dst->num_rg = src->num_rg; + } + return a; +} +void* inplace_XkbNamesRec_enlarge(void* a) +{ + if(a) { + my_XkbNamesRec_32_t* src = a; + my_XkbNamesRec_t* dst = a; + + dst->num_rg = src->num_rg; + dst->num_key_aliases = src->num_key_aliases; + dst->num_keys = src->num_keys; + dst->phys_symbols = from_ulong(src->phys_symbols); + dst->radio_groups = from_ptrv(src->radio_groups); + dst->key_aliases = from_ptrv(src->key_aliases); + for(int i=4-1; i>=0; --i) + dst->groups[i] = from_ulong(src->groups[i]); + for(int i=32-1; i>=0; --i) + dst->indicators[i] = from_ulong(src->indicators[i]); + for(int i=16-1; i>=0; --i) + dst->vmods[i] = from_ulong(src->vmods[i]); + dst->compat = from_ulong(src->compat); + dst->types = from_ulong(src->types); + dst->symbols = from_ulong(src->symbols); + dst->geometry = from_ulong(src->geometry); + dst->keys = from_ptrv(src->keys); + dst->keycodes = from_ulong(src->keycodes); + + for(int i=src->num_rg-1; i>=0; --i) + dst->radio_groups[i] = from_ulong(dst->radio_groups[i]); + } + return a; +} + +void* inplace_XkbClientMapRec_shrink(void* a) +{ + if(a) { + my_XkbClientMapRec_t* src = a; + my_XkbClientMapRec_32_t* dst = a; + dst->size_types = src->size_types; + dst->num_types = src->num_types; + dst->types = to_ptrv(src->types); + dst->size_syms = src->size_syms; + dst->num_syms = src->num_syms; + dst->syms = to_ptrv(src->syms); + dst->key_sym_map = to_ptrv(src->key_sym_map); + dst->modmap = to_ptrv(src->modmap); + } + return a; +} +void* inplace_XkbClientMapRec_enlarge(void* a) +{ + if(a) { + my_XkbClientMapRec_32_t* src = a; + my_XkbClientMapRec_t* dst = a; + dst->modmap = from_ptrv(src->modmap); + dst->key_sym_map = from_ptrv(src->key_sym_map); + dst->syms = from_ptrv(src->syms); + dst->num_syms = src->num_syms; + dst->size_syms = src->size_syms; + dst->types = from_ptrv(src->types); + dst->num_types = src->num_types; + dst->size_types = src->size_types; + } + return a; +} + +void* inplace_XkbDescRec_shrink(void* a) +{ + if(a) { + my_XkbDescRec_t* src = a; + my_XkbDescRec_32_t* dst = a; + + dst->display = to_ptrv(FindDisplay(src->display)); + dst->flags = src->flags; + dst->device_spec = src->device_spec; + dst->min_key_code = src->min_key_code; + dst->max_key_code = src->max_key_code; + dst->ctrls = to_ptrv(src->ctrls); + dst->server = to_ptrv(src->server); + dst->map = to_ptrv(inplace_XkbClientMapRec_shrink(src->map)); + dst->indicators = to_ptrv(src->indicators); + dst->names = to_ptrv(inplace_XkbNamesRec_shrink(src->names)); + dst->compat = to_ptrv(src->compat); + dst->geom = to_ptrv(src->geom); + } + return a; +} +void* inplace_XkbDescRec_enlarge(void* a) +{ + if(a) { + my_XkbDescRec_32_t* src = a; + my_XkbDescRec_t* dst = a; + + dst->geom = from_ptrv(src->geom); + dst->compat = from_ptrv(src->compat); + dst->names = inplace_XkbNamesRec_enlarge(from_ptrv(src->names)); + dst->indicators = from_ptrv(src->indicators); + dst->map = inplace_XkbClientMapRec_enlarge(from_ptrv(src->map)); + dst->server = from_ptrv(src->server); + dst->ctrls = from_ptrv(src->ctrls); + dst->max_key_code = src->max_key_code; + dst->min_key_code = src->min_key_code; + dst->device_spec = src->device_spec; + dst->flags = src->flags; + dst->display = getDisplay(from_ptrv(src->display)); + } + return a; +} + +void convert_XAnyClassInfo_to_32(void* d, void* s) +{ + if(!d || !s) return; + my_XAnyClassInfo_t* src = s; + my_XAnyClassInfo_32_t* dst = d; + int len = src->length; + switch(src->c_class) { + case 2: //ValuatorClass + { + my_XValuatorInfo_t* src = s; + my_XValuatorInfo_32_t* dst = d; + dst->c_class = to_ulong(src->c_class); + dst->length = src->length; + dst->num_axes = src->num_axes; + dst->mode = src->mode; + dst->motion_buffer = to_ulong(src->motion_buffer); + dst->axes = to_ptrv(src->axes); + } + break; + case 0: //KeyClass + case 1: //ButtonClass + case 3: //FeedbackClass + case 4: //ProximityClass + case 5: //FocusClass + case 6: //OtherClass + case 7: //AttachClass + default: + dst->c_class = to_ulong(src->c_class); + memmove(d+4, s+8, len-4); + } + +} +void convert_XAnyClassInfo_to_64(void* d, void* s) +{ + if(!d || !s) return; + my_XAnyClassInfo_32_t* src = s; + my_XAnyClassInfo_t* dst = d; + + int len = src->length; + switch(src->c_class) { + case 2: //ValuatorClass + { + my_XValuatorInfo_32_t* src = s; + my_XValuatorInfo_t* dst = d; + dst->axes = from_ptrv(src->axes); + dst->motion_buffer = from_ulong(src->motion_buffer); + dst->mode = src->mode; + dst->num_axes = src->num_axes; + dst->length = src->length; + dst->c_class = from_ulong(src->c_class); + } + break; + case 0: //KeyClass + case 1: //ButtonClass + case 3: //FeedbackClass + case 4: //ProximityClass + case 5: //FocusClass + case 6: //OtherClass + case 7: //AttachClass + default: + memmove(d+8, s+4, len-4); + dst->c_class = from_ulong(src->c_class); + } +} +void* inplace_XAnyClassInfo_shrink(void* a) +{ + if(a) + convert_XAnyClassInfo_to_32(a, a); + return a; +} +void* inplace_XAnyClassInfo_enlarge(void* a) +{ + if(a) + convert_XAnyClassInfo_to_64(a, a); + return a; +} + +void* inplace_XDeviceInfo_shrink(void* a, int n) +{ + if(a) { + my_XDeviceInfo_t* src = a; + my_XDeviceInfo_32_t* dst = a; + + for(int i=0; iinputclassinfo; + for(int j=0; jnum_classes; ++j) { + my_XAnyClassInfo_32_t* dst_c = p; + my_XAnyClassInfo_t* src_c = p; + int len = src_c->length; + convert_XAnyClassInfo_to_32(dst_c, src_c); + p += len; + } + dst->id = to_ulong(src->id); + dst->type = to_ulong(src->type); + dst->name = to_ptrv(src->name); + dst->num_classes = src->num_classes; + dst->use = src->use; + dst->inputclassinfo = to_ptrv(src->inputclassinfo); + } + // mark last record, even on only 1 record, thos last 2 uint32_t are free + dst->inputclassinfo = 0; + dst->name = 0; + + } + return a; +} +void* inplace_XDeviceInfo_enlarge(void* a) +{ + if(a) { + my_XDeviceInfo_32_t* src = a; + my_XDeviceInfo_t* dst = a; + int n = 0; + while(src[n].inputclassinfo && src[n].name) ++n; + src+=n-1; + dst+=n-1; + for(int i=n-1; i>=0; --i, --src, --dst) { + dst->inputclassinfo = from_ptrv(src->inputclassinfo); + dst->use = src->use; + dst->num_classes = src->num_classes; + dst->name = from_ptrv(src->name); + dst->type = from_ulong(src->type); + dst->id = from_ulong(src->id); + for(int j=dst->num_classes-1; j>=0; --j) { + void* p = dst->inputclassinfo; + my_XAnyClassInfo_t* dst_c = p; + my_XAnyClassInfo_32_t* src_c = p; + for(int k=0; klength; + dst_c = p; + src_c = p; + } + convert_XAnyClassInfo_to_64(dst_c, src_c); + } + } + } + return a; +} + + +void* inplace_XFilters_shrink(void* a) +{ + if(a) { + my_XFilters_t* src = a; + my_XFilters_32_t* dst = a; + dst->nfilter = src->nfilter; + char** filter = src->filter; + dst->filter = to_ptrv(filter); + dst->nalias = src->nalias; + dst->alias = to_ptrv(src->alias); + for(int i=0; infilter; ++i) + ((ptr_t*)(filter))[i] = to_ptrv(filter[i]); + } + return a; +} +void* inplace_XFilters_enlarge(void* a) +{ + if(a) { + my_XFilters_t* dst = a; + my_XFilters_32_t* src = a; + dst->alias = from_ptrv(src->alias); + dst->nalias = src->nalias; + dst->filter = from_ptrv(src->filter); + dst->nfilter = src->nfilter; + char** filter = dst->filter; + for(int i=dst->nfilter-1; i>=0; --i) + filter[i] = from_ptrv(((ptr_t*)(filter))[i]); + } + return a; +} + +void* inplace_XRRMonitorInfo_shrink(void* a, int n) +{ + if(a) { + my_XRRMonitorInfo_t* src = a; + my_XRRMonitorInfo_32_t* dst = a; + for(int i=0; inoutput; ++j) + ((ulong_t*)src->outputs)[j] = to_ulong(src->outputs[j]); + dst->name = to_ulong(src->name); + dst->primary = src->primary; + dst->automatic = src->automatic; + dst->noutput = src->noutput; + dst->x = src->x; + dst->y = src->y; + dst->width = src->width; + dst->height = src->height; + dst->mwidth = src->mwidth; + dst->mheight = src->mheight; + dst->outputs = to_ptrv(src->outputs); + src++; + dst++; + } + dst->name = 0; // mark the last record... + } + return a; +} + +void* inplace_XRRMonitorInfo_enlarge(void* a, int n) +{ + if(a) { + my_XRRMonitorInfo_32_t* src = a; + my_XRRMonitorInfo_t* dst = a; + src+=n-1; + dst+=n-1; + for(int i=n-1; i>=0; --i, --src, --dst) { + for(int j=dst->noutput-1; j>=0; --j) + ((unsigned long*)dst->outputs)[j] = from_ulong(dst->outputs[j]); + dst->outputs = from_ptrv(src->outputs); + dst->mheight = src->mheight; + dst->mwidth = src->mwidth; + dst->height = src->height; + dst->width = src->width; + dst->y = src->y; + dst->x = src->x; + dst->noutput = src->noutput; + dst->automatic = src->automatic; + dst->primary = src->primary; + dst->name = from_ulong(src->name); + } + } + return a; +} + +void* inplace_XRRCrtcTransformAttributes_shrink(void* a) +{ + if(a) { + my_XRRCrtcTransformAttributes_t* src = a; + my_XRRCrtcTransformAttributes_32_t* dst = a; + dst->pendingTransform = src->pendingTransform; + dst->pendingFilter = to_ptrv(src->pendingFilter); + dst->pendingNparams = src->pendingNparams; + dst->pendingParams = to_ptrv(src->pendingParams); + dst->currentTransform = src->currentTransform; + dst->currentFilter = to_ptrv(src->currentFilter); + dst->currentNparams = src->currentNparams; + dst->currentParams = to_ptrv(src->currentParams); + } + return a; +} \ No newline at end of file diff --git a/src/libtools/my_x11_conv.h b/src/libtools/my_x11_conv.h new file mode 100644 index 0000000..080fe86 --- /dev/null +++ b/src/libtools/my_x11_conv.h @@ -0,0 +1,130 @@ +#ifndef MY_X11_CONV +#define MY_X11_CONV +#include + +#include "box32.h" +#include "converter32.h" +#include "my_x11_defs.h" +#include "my_x11_defs_32.h" + +void convertXEvent(my_XEvent_32_t* dst, my_XEvent_t* src); +void unconvertXEvent(my_XEvent_t* dst, my_XEvent_32_t* src); +void inplace_XEventData_shring(my_XEvent_t* evt); +void inplace_XEventData_enlarge(my_XEvent_t* evt); +void convert_XErrorEvent_to_32(void* d, void* s); +void convert_XErrorEvent_to_64(void* d, void* s); + +// Add a new Native Display*, return a 32bits one +void* addDisplay(void* d); +// Find a Native Diplay* and return the 32bits one +void* FindDisplay(void* d); +// return the Native Display from a 32bits one +void* getDisplay(void* d); +// removed a 32bits Display and associated ressources +void delDisplay(void* d); +// refresh the 32bits from the 64bits version +void refreshDisplay(void* dpy); +// register an xcb for a display +void regXCBDisplay(void* d, void* xcb); + +void convert_Screen_to_32(void* d, void* s); +void* getScreen64(void* dpy, void* a); + +void* convert_Visual_to_32(void* dpy, void* a); +void* convert_Visual_to_64(void* dpy, void* a); + +void convert_XWMints_to_64(void* d, void* s); +void inplace_enlarge_wmhints(void* hints); +void inplace_shrink_wmhints(void* hints); +void convert_XSizeHints_to_64(void* d, void *s); +void inplace_enlarge_wmsizehints(void* hints); +void inplace_shrink_wmsizehints(void* hints); + +void convert_XWindowAttributes_to_32(void* dpy, void* d, void* s); + +void inplace_XModifierKeymap_shrink(void* a); +void inplace_XModifierKeymap_enlarge(void* a); + +void convert_XVisualInfo_to_32(void* dpy, my_XVisualInfo_32_t* dst, my_XVisualInfo_t* src); +void convert_XVisualInfo_to_64(void* dpy, my_XVisualInfo_t* dst, my_XVisualInfo_32_t* src); +void convert_XVisualInfo_to_64_novisual(void* dpy, my_XVisualInfo_t* dst, my_XVisualInfo_32_t* src); +void inplace_XVisualInfo_shrink(void* dpy, void *a); +void inplace_XVisualInfo_enlarge(void* dpy, void *a); + +void inplace_XdbeVisualInfo_shrink(void* a); +void inplace_XdbeScreenVisualInfo_shrink(void* a); +void inplace_XdbeVisualInfo_enlarge(void* a); +void inplace_XdbeScreenVisualInfo_enlarge(void* a); + +void inplace_XExtDisplayInfo_shrink(void* a); +void inplace_XExtDisplayInfo_enlarge(void* a); +void convert_XExtensionInfo_to_32(void* d, void* s); +void convert_XExtensionInfo_to_64(void* d, void* s); +void* inplace_XExtensionInfo_shrink(void* a); +void* inplace_XExtensionInfo_enlarge(void* a); + +void convert_XFontProp_to_32(my_XFontProp_32_t* dst, my_XFontProp_t* src); +void convert_XFontProp_to_64(my_XFontProp_t* dst, my_XFontProp_32_t* src); +void inplace_XFontProp_shrink(void* a); +void inplace_XFontProp_enlarge(void* a); +void inplace_XFontStruct_shrink(void* a); +void inplace_XFontStruct_enlarge(void* a); + +void convert_XSetWindowAttributes_to_64(my_XSetWindowAttributes_t* dst, my_XSetWindowAttributes_32_t* src); + +void WrapXImage(void* d, void* s); //define in wrappedx11.c because it contains callbacks +void UnwrapXImage(void* d, void* s); +void* inplace_XImage_shrink(void* a); +void* inplace_XImage_enlarge(void* a); + +void convert_XRRModeInfo_to_32(void* d, const void* s); +void convert_XRRModeInfo_to_64(void* d, const void* s); +void inplace_XRRScreenResources_shrink(void* s); +void inplace_XRRScreenResources_enlarge(void* s); +void inplace_XRRCrtcInfo_shrink(void* s); +void inplace_XRROutputInfo_shrink(void* s); +void inplace_XRRProviderInfo_shrink(void* a); +void inplace_XRRProviderInfo_enlarge(void* a); +void inplace_XRRProviderResources_shrink(void* a); +void inplace_XRRProviderResources_enlarge(void* a); +void* inplace_XRRPropertyInfo_shrink(void* a); + +void inplace_XIDeviceInfo_shrink(void* a, int n); +int inplace_XIDeviceInfo_enlarge(void* a); + +void* inplace_XDevice_shrink(void* a); +void* inplace_XDevice_enlarge(void* a); +void* inplace_XDeviceState_shrink(void* a); +void* inplace_XDeviceState_enlarge(void* a); + +void register_XDevice_events(my_XDevice_t* a); +void unregister_XDevice_events(my_XDevice_t* a); +void register_XFixes_events(int event_base); +void unregister_XFixes_events(); +void register_XRandR_events(int event_base); +void unregister_XRandR_events(); +void register_Xkb_events(int event_base); +void unregister_Xkb_events(); + +void convert_XShmSegmentInfo_to_32(void* d, void* s); +void convert_XShmSegmentInfo_to_64(void* d, void* s); + +void* inplace_XkbDescRec_shrink(void* a); +void* inplace_XkbDescRec_enlarge(void* a); + +void convert_XAnyClassInfo_to_32(void* d, void* s); +void convert_XAnyClassInfo_to_64(void* d, void* s); +void* inplace_XAnyClassInfo_shrink(void* a); +void* inplace_XAnyClassInfo_enlarge(void* a); +void* inplace_XDeviceInfo_shrink(void* a, int n); +void* inplace_XDeviceInfo_enlarge(void* a); + +void* inplace_XFilters_shrink(void* a); +void* inplace_XFilters_enlarge(void* a); + +void* inplace_XRRMonitorInfo_shrink(void* a, int n); +void* inplace_XRRMonitorInfo_enlarge(void* a, int n); + +void* inplace_XRRCrtcTransformAttributes_shrink(void* a); + +#endif//MY_X11_CONV \ No newline at end of file diff --git a/src/libtools/my_x11_defs.h b/src/libtools/my_x11_defs.h new file mode 100644 index 0000000..b546200 --- /dev/null +++ b/src/libtools/my_x11_defs.h @@ -0,0 +1,2013 @@ +#ifndef MY_X11_DEFS +#define MY_X11_DEFS +#include + +typedef unsigned long XID; + +typedef struct XImageSave_s { + int anyEmu; + void* create; + void* destroy; + void* get; + void* put; + void* sub; + void* add; +} XImageSave_t; + +typedef struct ximage_s { + void*(*create_image)( + void* /* display */, + void* /* visual */, + uint32_t /* depth */, + int32_t /* format */, + int32_t /* offset */, + void* /* data */, + uint32_t /* width */, + uint32_t /* height */, + int32_t /* bitmap_pad */, + int32_t /* bytes_per_line */); + int32_t (*destroy_image) (void*); + uintptr_t (*get_pixel) (void*, int32_t, int32_t); + int32_t (*put_pixel) (void*, int32_t, int32_t, uintptr_t); + void*(*sub_image) (void*, int32_t, int32_t, uint32_t, uint32_t); //sub_image return a new XImage that need bridging => custom wrapper + int32_t (*add_pixel) (void*, intptr_t); +} ximage_t; + +typedef struct _XImage { + int32_t width, height; /* size of image */ + int32_t xoffset; /* number of pixels offset in X direction */ + int32_t format; /* XYBitmap, XYPixmap, ZPixmap */ + void* data; /* pointer to image data */ + int32_t byte_order; /* data byte order, LSBFirst, MSBFirst */ + int32_t bitmap_unit; /* quant. of scanline 8, 16, 32 */ + int32_t bitmap_bit_order; /* LSBFirst, MSBFirst */ + int32_t bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */ + int32_t depth; /* depth of image */ + int32_t bytes_per_line; /* accelarator to next line */ + int32_t bits_per_pixel; /* bits per pixel (ZPixmap) */ + uintptr_t red_mask; /* bits in z arrangment */ + uintptr_t green_mask; + uintptr_t blue_mask; + void* obdata; /* hook for the object routines to hang on */ + ximage_t f; + +} XImage; + +struct my_XFreeFuncs { + void* atoms; + void* modifiermap; + void* key_bindings; + void* context_db; + void* defaultCCCs; + void* clientCmaps; + void* intensityMaps; + void* im_filters; + void* xkb; +}; + +struct my_XExten { + struct my_XExten *next; + void* codes; // XExtCodes + void* create_GC; // CreateGCType + void* copy_GC; // CopyGCType + void* flush_GC; // FlushGCType + void* free_GC; // FreeGCType + void* create_Font; // CreateFontType + void* free_Font; // FreeFontType + void* close_display; // CloseDisplayType + void* error; // ErrorType + void* error_string; // ErrorStringType + char *name; + void* error_values; // PrintErrorType + void* before_flush; // BeforeFlushType + struct my_XExten *next_flush; +}; + +struct my_XInternalAsync { + struct my_XInternalAsync *next; + int (*handler)(void*, void*, char*, int, void*); + void* data; +}; + +struct my_XLockPtrs { + void (*lock_display)(void* dpy); + void (*unlock_display)(void *dpy); +}; + +struct my_XConnectionInfo { + int fd; + void* read_callback; // _XInternalConnectionProc + void* call_data; + void* *watch_data; + struct my_XConnectionInfo *next; +}; + +struct my_XConnWatchInfo { + void* fn; // XConnectionWatchProc + void* client_data; + struct _XConnWatchInfo *next; +}; + +typedef struct my_Visual_s { + void* ext_data; //XExtData* + XID visualid; + int c_class; + unsigned long red_mask, green_mask, blue_mask; + int bits_per_rgb; + int map_entries; +} my_Visual_t; + +typedef struct my_Screen_s { + void* ext_data; //XExtData * + struct my_XDisplay_s *display; + XID root; + int width, height; + int mwidth, mheight; + int ndepths; + void* depths; //Depth * + int root_depth; /* bits per pixel */ + my_Visual_t* root_visual; + void* default_gc; //GC == struct _XGC* + XID cmap; + unsigned long white_pixel; + unsigned long black_pixel; + int max_maps, min_maps; + int backing_store; + int save_unders; + long root_input_mask; +} my_Screen_t; + +typedef struct my_XDisplay_s +{ + void *ext_data; + struct my_XFreeFuncs *free_funcs; + int fd; + int conn_checker; + int proto_major_version; + int proto_minor_version; + char *vendor; + XID resource_base; + XID resource_mask; + XID resource_id; + int resource_shift; + XID (*resource_alloc)(void*); + int byte_order; + int bitmap_unit; + int bitmap_pad; + int bitmap_bit_order; + int nformats; + void *pixmap_format; + int vnumber; + int release; + void *head, *tail; + int qlen; + unsigned long last_request_read; + unsigned long request; + char *last_req; + char *buffer; + char *bufptr; + char *bufmax; + unsigned max_request_size; + void* *db; + int (*synchandler)(void*); + char *display_name; + int default_screen; + int nscreens; + my_Screen_t *screens; + unsigned long motion_buffer; + volatile unsigned long flags; + int min_keycode; + int max_keycode; + void *keysyms; + void *modifiermap; + int keysyms_per_keycode; + char *xdefaults; + char *scratch_buffer; + unsigned long scratch_length; + int ext_number; + struct my_XExten *ext_procs; + int (*event_vec[128])(void *, void *, void *); + int (*wire_vec[128])(void *, void *, void *); + XID lock_meaning; + void* lock; + struct my_XInternalAsync *async_handlers; + unsigned long bigreq_size; + struct my_XLockPtrs *lock_fns; + void (*idlist_alloc)(void *, void *, int); + void* key_bindings; + XID cursor_font; + void* *atoms; + unsigned int mode_switch; + unsigned int num_lock; + void* context_db; + int (**error_vec)(void*, void*, void*); + struct { + void* defaultCCCs; + void* clientCmaps; + void* perVisualIntensityMaps; + } cms; + void* im_filters; + void* qfree; + unsigned long next_event_serial_num; + struct my_XExten *flushes; + struct my_XConnectionInfo *im_fd_info; + int im_fd_length; + struct my_XConnWatchInfo *conn_watchers; + int watcher_count; + void* filedes; + int (*savedsynchandler)(void *); + XID resource_max; + int xcmisc_opcode; + void* *xkb_info; + void* *trans_conn; + void* *xcb; + unsigned int next_cookie; + int (*generic_event_vec[128])(void*, void*, void*); + int (*generic_event_copy_vec[128])(void*, void*, void*); + void *cookiejar; + unsigned long last_request_read_upper32bit; // 64bits only + unsigned long request_upper32bit; // 64bits only + void* error_threads; + void* exit_handler; + void* exit_handler_data; +} my_XDisplay_t; + +typedef struct my_XSetWindowAttributes_s { + XID background_pixmap; + unsigned long background_pixel; + XID border_pixmap; + unsigned long border_pixel; + int bit_gravity; + int win_gravity; + int backing_store; + unsigned long backing_planes; + unsigned long backing_pixel; + int save_under; + long event_mask; + long do_not_propagate_mask; + int override_redirect; + XID colormap; + XID cursor; +} my_XSetWindowAttributes_t; + +typedef struct my_XKeyEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID root; + XID subwindow; + unsigned long time; + int x, y; + int x_root, y_root; + unsigned int state; + unsigned int keycode; + int same_screen; +} my_XKeyEvent_t; +typedef my_XKeyEvent_t my_XKeyPressedEvent_t; +typedef my_XKeyEvent_t my_XKeyReleasedEvent_t; + +typedef struct my_XButtonEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID root; + XID subwindow; + unsigned long time; + int x, y; + int x_root, y_root; + unsigned int state; + unsigned int button; + int same_screen; +} my_XButtonEvent_t; +typedef my_XButtonEvent_t my_XButtonPressedEvent_t; +typedef my_XButtonEvent_t my_XButtonReleasedEvent_t; + +typedef struct my_XMotionEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID root; + XID subwindow; + unsigned long time; + int x, y; + int x_root, y_root; + unsigned int state; + char is_hint; + int same_screen; +} my_XMotionEvent_t; +typedef my_XMotionEvent_t my_XPointerMovedEvent_t; + +typedef struct my_XCrossingEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID root; + XID subwindow; + unsigned long time; + int x, y; + int x_root, y_root; + int mode; + int detail; + int same_screen; + int focus; + unsigned int state; +} my_XCrossingEvent_t; + +typedef my_XCrossingEvent_t my_XEnterWindowEvent_t; +typedef my_XCrossingEvent_t my_XLeaveWindowEvent_t; + +typedef struct my_XFocusChangeEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + int mode; + int detail; +} my_XFocusChangeEvent_t; +typedef my_XFocusChangeEvent_t my_XFocusInEvent_t; +typedef my_XFocusChangeEvent_t my_XFocusOutEvent_t; + +typedef struct my_XKeymapEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + char key_vector[32]; +} my_XKeymapEvent_t; + +typedef struct my_XExposeEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + int x, y; + int width, height; + int count; +} my_XExposeEvent_t; + +typedef struct my_XGraphicsExposeEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID drawable; + int x, y; + int width, height; + int count; + int major_code; + int minor_code; +} my_XGraphicsExposeEvent_t; + +typedef struct my_XNoExposeEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID drawable; + int major_code; + int minor_code; +} my_XNoExposeEvent_t; + +typedef struct my_XVisibilityEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + int state; +} my_XVisibilityEvent_t; + +typedef struct my_XCreateWindowEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID parent; + XID window; + int x, y; + int width, height; + int border_width; + int override_redirect; +} my_XCreateWindowEvent_t; + +typedef struct my_XDestroyWindowEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; +} my_XDestroyWindowEvent_t; + +typedef struct my_XUnmapEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; + int from_configure; +} my_XUnmapEvent_t; + +typedef struct my_XMapEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; + int override_redirect; +} my_XMapEvent_t; + +typedef struct my_XMapRequestEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID parent; + XID window; +} my_XMapRequestEvent_t; + +typedef struct my_XReparentEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; + XID parent; + int x, y; + int override_redirect; +} my_XReparentEvent_t; + +typedef struct my_XConfigureEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; + int x, y; + int width, height; + int border_width; + XID above; + int override_redirect; +} my_XConfigureEvent_t; + +typedef struct my_XGravityEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; + int x, y; +} my_XGravityEvent_t; + +typedef struct my_XResizeRequestEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + int width, height; +} my_XResizeRequestEvent_t; + +typedef struct my_XConfigureRequestEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID parent; + XID window; + int x, y; + int width, height; + int border_width; + XID above; + int detail; + unsigned long value_mask; +} my_XConfigureRequestEvent_t; + +typedef struct my_XCirculateEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID event; + XID window; + int place; +} my_XCirculateEvent_t; + +typedef struct my_XCirculateRequestEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID parent; + XID window; + int place; +} my_XCirculateRequestEvent_t; + +typedef struct my_XPropertyEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID atom; + unsigned long time; + int state; +} my_XPropertyEvent_t; + +typedef struct my_XSelectionClearEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID selection; + unsigned long time; +} my_XSelectionClearEvent_t; + +typedef struct my_XSelectionRequestEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID owner; + XID requestor; + XID selection; + XID target; + XID property; + unsigned long time; +} my_XSelectionRequestEvent_t; + +typedef struct my_XSelectionEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID requestor; + XID selection; + XID target; + XID property; + unsigned long time; +} my_XSelectionEvent_t; + +typedef struct my_XColormapEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID colormap; + int c_new; + int state; +} my_XColormapEvent_t; + +typedef struct my_XClientMessageEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + XID message_type; + int format; + union { + char b[20]; + short s[10]; + long l[5]; + } data; +} my_XClientMessageEvent_t; + +typedef struct my_XMappingEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; + int request; + int first_keycode; + int count; +} my_XMappingEvent_t; + +typedef struct my_XErrorEvent_s +{ + int type; + my_XDisplay_t *display; + XID resourceid; + unsigned long serial; + unsigned char error_code; + unsigned char request_code; + unsigned char minor_code; +} my_XErrorEvent_t; + +typedef struct my_XAnyEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + XID window; +} my_XAnyEvent_t; + +typedef struct my_XGenericEvent_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + int extension; + int evtype; +} my_XGenericEvent_t; + +typedef struct my_XGenericEventCookie_s +{ + int type; + unsigned long serial; + int send_event; + my_XDisplay_t *display; + int extension; + int evtype; + unsigned int cookie; + void *data; +} my_XGenericEventCookie_t; + +typedef union my_XEvent_s { + int type; + my_XAnyEvent_t xany; + my_XKeyEvent_t xkey; + my_XButtonEvent_t xbutton; + my_XMotionEvent_t xmotion; + my_XCrossingEvent_t xcrossing; + my_XFocusChangeEvent_t xfocus; + my_XExposeEvent_t xexpose; + my_XGraphicsExposeEvent_t xgraphicsexpose; + my_XNoExposeEvent_t xnoexpose; + my_XVisibilityEvent_t xvisibility; + my_XCreateWindowEvent_t xcreatewindow; + my_XDestroyWindowEvent_t xdestroywindow; + my_XUnmapEvent_t xunmap; + my_XMapEvent_t xmap; + my_XMapRequestEvent_t xmaprequest; + my_XReparentEvent_t xreparent; + my_XConfigureEvent_t xconfigure; + my_XGravityEvent_t xgravity; + my_XResizeRequestEvent_t xresizerequest; + my_XConfigureRequestEvent_t xconfigurerequest; + my_XCirculateEvent_t xcirculate; + my_XCirculateRequestEvent_t xcirculaterequest; + my_XPropertyEvent_t xproperty; + my_XSelectionClearEvent_t xselectionclear; + my_XSelectionRequestEvent_t xselectionrequest; + my_XSelectionEvent_t xselection; + my_XColormapEvent_t xcolormap; + my_XClientMessageEvent_t xclient; + my_XMappingEvent_t xmapping; + my_XErrorEvent_t xerror; + my_XKeymapEvent_t xkeymap; + my_XGenericEvent_t xgeneric; + my_XGenericEventCookie_t xcookie; + long pad[24]; +} my_XEvent_t; + +#define XEVT_KeyPress 2 +#define XEVT_KeyRelease 3 +#define XEVT_ButtonPress 4 +#define XEVT_ButtonRelease 5 +#define XEVT_MotionNotify 6 +#define XEVT_EnterNotify 7 +#define XEVT_LeaveNotify 8 +#define XEVT_FocusIn 9 +#define XEVT_FocusOut 10 +#define XEVT_KeymapNotify 11 +#define XEVT_Expose 12 +#define XEVT_GraphicsExpose 13 +#define XEVT_NoExpose 14 +#define XEVT_VisibilityNotify 15 +#define XEVT_CreateNotify 16 +#define XEVT_DestroyNotify 17 +#define XEVT_UnmapNotify 18 +#define XEVT_MapNotify 19 +#define XEVT_MapRequest 20 +#define XEVT_ReparentNotify 21 +#define XEVT_ConfigureNotify 22 +#define XEVT_ConfigureRequest 23 +#define XEVT_GravityNotify 24 +#define XEVT_ResizeRequest 25 +#define XEVT_CirculateNotify 26 +#define XEVT_CirculateRequest 27 +#define XEVT_PropertyNotify 28 +#define XEVT_SelectionClear 29 +#define XEVT_SelectionRequest 30 +#define XEVT_SelectionNotify 31 +#define XEVT_ColormapNotify 32 +#define XEVT_ClientMessage 33 +#define XEVT_MappingNotify 34 +#define XEVT_GenericEvent 35 + + +// WMHints +typedef struct my_XWMHints_s { + long flags; + int input; + int initial_state; + XID icon_pixmap; + XID icon_window; + int icon_x; + int icon_y; + XID icon_mask; + XID window_group; +} my_XWMHints_t; + +#define XWMHint_InputHint (1L << 0) +#define XWMHint_StateHint (1L << 1) +#define XWMHint_IconPixmapHint (1L << 2) +#define XWMHint_IconWindowHint (1L << 3) +#define XWMHint_IconPositionHint (1L << 4) +#define XWMHint_IconMaskHint (1L << 5) +#define XWMHint_WindowGroupHint (1L << 6) +#define XWMHint_XUrgencyHint (1L << 8) + +typedef struct my_XRRModeInfo_s { + XID id; + unsigned int width; + unsigned int height; + unsigned long dotClock; + unsigned int hSyncStart; + unsigned int hSyncEnd; + unsigned int hTotal; + unsigned int hSkew; + unsigned int vSyncStart; + unsigned int vSyncEnd; + unsigned int vTotal; + char *name; + unsigned int nameLength; + unsigned long modeFlags; +} my_XRRModeInfo_t; + + +typedef struct my_XRRScreenResources_s { + unsigned long timestamp; + unsigned long configTimestamp; + int ncrtc; + XID *crtcs; + int noutput; + XID *outputs; + int nmode; + my_XRRModeInfo_t *modes; +} my_XRRScreenResources_t; + +typedef struct my_XRRCrtcInfo_s { + unsigned long timestamp; + int x, y; + unsigned int width, height; + XID mode; + uint16_t rotation; + int noutput; + XID *outputs; + uint16_t rotations; + int npossible; + XID *possible; +} my_XRRCrtcInfo_t; + +typedef struct my_XRROutputInfo_s { + unsigned long timestamp; + XID crtc; + char *name; + int nameLen; + unsigned long mm_width; + unsigned long mm_height; + uint16_t connection; + uint16_t subpixel_order; + int ncrtc; + XID *crtcs; + int nclone; + XID *clones; + int nmode; + int npreferred; + XID *modes; +} my_XRROutputInfo_t; + +// Window Attribute +typedef struct my_XWindowAttributes_s { + int x, y; + int width, height; + int border_width; + int depth; + void* visual; //Visual* + XID root; + int c_class; + int bit_gravity; + int win_gravity; + int backing_store; + unsigned long backing_planes; + unsigned long backing_pixel; + int save_under; + XID colormap; + int map_installed; + int map_state; + long all_event_masks; + long your_event_mask; + long do_not_propagate_mask; + int override_redirect; + void* screen; //Screen* +} my_XWindowAttributes_t; + +typedef struct my_XVisualInfo_s { + my_Visual_t* visual; + unsigned long visualid; + int screen; + int depth; + int c_class; + unsigned long red_mask; + unsigned long green_mask; + unsigned long blue_mask; + int colormap_size; + int bits_per_rgb; +} my_XVisualInfo_t; + +typedef struct my_XModifierKeymap_s { + int max_keypermod; + uint8_t* modifiermap; +} my_XModifierKeymap_t; + + +typedef struct my_XdbeVisualInfo_s +{ + XID visual; + int depth; + int perflevel; +} my_XdbeVisualInfo_t; + +typedef struct my_XdbeScreenVisualInfo_s +{ + int count; + my_XdbeVisualInfo_t* visinfo; +} my_XdbeScreenVisualInfo_t; + +typedef struct my_XF86VidModeModeInfo_s +{ + unsigned int dotclock; + unsigned short hdisplay; + unsigned short hsyncstart; + unsigned short hsyncend; + unsigned short htotal; + unsigned short hskew; + unsigned short vdisplay; + unsigned short vsyncstart; + unsigned short vsyncend; + unsigned short vtotal; + unsigned int flags; + int privsize; + int* tc_private; +} my_XF86VidModeModeInfo_t; + +typedef struct my_XColor_s { + unsigned long pixel; + unsigned short red, green, blue; + char flags; + char pad; +} my_XColor_t; + +typedef struct my_XRRProviderInfo_s { + unsigned int capabilities; + int ncrtcs; + XID* crtcs; + int noutputs; + XID* outputs; + char* name; + int nassociatedproviders; + XID* associated_providers; + unsigned int* associated_capability; + int nameLen; +} my_XRRProviderInfo_t; + +typedef struct my_XRRProviderResources_t { + unsigned long timestamp; + int nproviders; + XID* providers; +} my_XRRProviderResources_t; + +typedef struct my_XIAnyClassInfo_s +{ + int type; + int sourceid; +} my_XIAnyClassInfo_t; + +typedef struct my_XIDeviceInfo_s +{ + int deviceid; + char* name; + int use; + int attachment; + int enabled; + int num_classes; + my_XIAnyClassInfo_t** classes; +} my_XIDeviceInfo_t; + +typedef struct my_XIEventMask_s { + int deviceid; + int mask_len; + unsigned char* mask; +} my_XIEventMask_t; + +typedef struct my_XInputClassInfo_s { + unsigned char input_class; + unsigned char event_type_base; +} my_XInputClassInfo_t; + +typedef struct my_XDevice_s { + XID device_id; + int num_classes; + my_XInputClassInfo_t* classes; +} my_XDevice_t; + +typedef struct my_XDeviceKeyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; //Display* + XID window; + XID deviceid; + XID root; + XID subwindow; + unsigned long time; + int x, y; + int x_root; + int y_root; + unsigned int state; + unsigned int keycode; + int same_screen; + unsigned int device_state; + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; +} my_XDeviceKeyEvent_t; +typedef my_XDeviceKeyEvent_t my_XDeviceButtonEvent_t; +typedef struct my_XDeviceMotionEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; //Display* + XID window; + XID deviceid; + XID root; + XID subwindow; + unsigned long time; + int x, y; + int x_root; + int y_root; + unsigned int state; + char is_hint; + int same_screen; + unsigned int device_state; + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; +} my_XDeviceMotionEvent_t; +typedef struct my_XDeviceFocusChangeEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; //Display* + XID window; + XID deviceid; + int mode; + int detail; + unsigned long time; +} my_XDeviceFocusChangeEvent_t; +typedef struct my_XProximityNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; //Display* + XID window; + XID deviceid; + XID root; + XID subwindow; + unsigned long time; + int x, y; + int x_root; + int y_root; + unsigned int state; + int same_screen; + unsigned int device_state; + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; +} my_XProximityNotifyEvent_t; +typedef struct my_XDeviceStateNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; //Display* + XID window; + XID deviceid; + unsigned long time; + int num_classes; + char data[64]; +} my_XDeviceStateNotifyEvent_t; +typedef struct my_XDeviceMappingEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + XID deviceid; + unsigned long time; + int request; + int first_keycode; + int count; +} my_XDeviceMappingEvent_t; +typedef struct my_XChangeDeviceNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + XID deviceid; + unsigned long time; + int request; +} my_XChangeDeviceNotifyEvent_t; +typedef struct my_XDevicePresenceNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + unsigned long time; + int devchange; + XID deviceid; + XID control; +} my_XDevicePresenceNotifyEvent_t; +typedef struct my_XDevicePropertyNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + unsigned long time; + XID deviceid; + XID atom; + int state; +} my_XDevicePropertyNotifyEvent_t; +typedef struct my_XInputClass_s { + unsigned char class; + unsigned char length; +} my_XInputClass_t; +typedef struct my_XDeviceState_s { + XID device_id; + int num_classes; + my_XInputClass_t* data; +} my_XDeviceState_t; + +typedef struct my_XFixesSelectionNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + int subtype; + XID owner; + XID selection; + unsigned long timestamp; + unsigned long selection_timestamp; +} my_XFixesSelectionNotifyEvent_t; +typedef struct my_XFixesCursorNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + int subtype; + unsigned long cursor_serial; + unsigned long timestamp; + XID cursor_name; +} my_XFixesCursorNotifyEvent_t; + +typedef struct my_XRRScreenChangeNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + XID root; + unsigned long timestamp; + unsigned long config_timestamp; + uint16_t size_index; + uint16_t subpixel_order; + uint16_t rotation; + int width; + int height; + int mwidth; + int mheight; +} my_XRRScreenChangeNotifyEvent_t; +typedef struct my_XRRNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + int subtype; +} my_XRRNotifyEvent_t; +typedef struct my_XRROutputChangeNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + int subtype; + XID output; + XID crtc; + XID mode; + uint16_t rotation; + uint16_t connection; + uint16_t subpixel_order; +} my_XRROutputChangeNotifyEvent_t; +typedef struct my_XRRCrtcChangeNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + int subtype; + XID crtc; + XID mode; + uint16_t rotation; + int x, y; + unsigned int width, height; +} my_XRRCrtcChangeNotifyEvent_t; +typedef struct my_XRROutputPropertyNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + int subtype; + XID output; + XID property; + unsigned long timestamp; + int state; +} my_XRROutputPropertyNotifyEvent_t; +typedef struct my_XRRProviderChangeNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + int subtype; + XID provider; + unsigned long timestamp; + unsigned int current_role; +} my_XRRProviderChangeNotifyEvent_t; +typedef struct my_XRRProviderPropertyNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + int subtype; + XID provider; + XID property; + unsigned long timestamp; + int state; +} my_XRRProviderPropertyNotifyEvent_t; +typedef struct my_XRRResourceChangeNotifyEvent_s +{ + int type; + unsigned long serial; + int send_event; + void* display; + XID window; + int subtype; + unsigned long timestamp; +} my_XRRResourceChangeNotifyEvent_t; + +typedef struct my_XcursorCursors_s { + void* dpy; //Display* + int ref; + int ncursor; + void* cursors; //Cursor* +} my_XcursorCursors_t; + +typedef struct my_XcursorImage_s { + uint32_t version; + uint32_t size; + uint32_t width; + uint32_t height; + uint32_t xhot; + uint32_t yhot; + uint32_t delay; + void* pixels; +} my_XcursorImage_t; + +typedef struct my_XcursorImages_s { + int nimage; + my_XcursorImage_t** images; + char* name; +} my_XcursorImages_t; + +typedef struct my_XExtCodes_s { + int extension; + int major_opcode; + int first_event; + int first_error; +} my_XExtCodes_t; + +typedef struct my_XExtDisplayInfo_s { + struct my_XExtDisplayInfo_s *next; + void* display; //Didsplay* + my_XExtCodes_t *codes; + void* data; +} my_XExtDisplayInfo_t; + +typedef struct my_XExtensionInfo_s { + my_XExtDisplayInfo_t *head; + my_XExtDisplayInfo_t *cur; + int ndisplays; +} my_XExtensionInfo_t; + +typedef struct my_XCharStruct_s { + short lbearing; + short rbearing; + short width; + short ascent; + short descent; + unsigned short attributes; +} my_XCharStruct_t; + +typedef struct my_XFontProp_s { + XID name; + unsigned long card32; +} my_XFontProp_t; + +typedef struct my_XFontStruct_s { + void* ext_data; //XExtData* + XID fid; + unsigned direction; + unsigned min_char_or_byte2; + unsigned max_char_or_byte2; + unsigned min_byte1; + unsigned max_byte1; + int all_chars_exist; + unsigned default_char; + int n_properties; + my_XFontProp_t* properties; + my_XCharStruct_t min_bounds; + my_XCharStruct_t max_bounds; + my_XCharStruct_t* per_char; + int ascent; + int descent; +} my_XFontStruct_t; + +typedef struct my_XExtensionHooks_s { + int (*create_gc)(void* dpy, void* gc, my_XExtCodes_t* e); + int (*copy_gc)(void* dpy, void* gc, my_XExtCodes_t* e); + int (*flush_gc)(void* dpy, void* gc, my_XExtCodes_t* e); + int (*free_gc)(void* dpy, void* gc, my_XExtCodes_t* e); + int (*create_font)(void* dpy, my_XFontStruct_t* f, my_XExtCodes_t* e); + int (*free_font)(void* dpy, my_XFontStruct_t* f, my_XExtCodes_t* e); + int (*close_display)(void* dpy, my_XExtCodes_t* e); + int (*wire_to_event)(void* dpy, my_XEvent_t* evt, void* xEvent); + int (*event_to_wire)(void* dpy, my_XEvent_t* evt, void* xEvent); + int (*error)(void* dpy, void* xError, my_XExtCodes_t* e, int* n); + char*(*error_string)(void* dpy, int, my_XExtCodes_t* e, char* s, int n); +} my_XExtensionHooks_t; + +typedef struct my_XRRPropertyInfo_s { + int pending; + int range; + int immutable; + int num_values; + long* values; +} my_XRRPropertyInfo_t; + +typedef struct my_XShmSegmentInfo_s { + XID shmseg; + int shmid; + char* shmaddr; + int readOnly; +} my_XShmSegmentInfo_t; + +typedef struct my_XkbNamesRec_s { + XID keycodes; + XID geometry; + XID symbols; + XID types; + XID compat; + XID vmods[16]; + XID indicators[32]; + XID groups[4]; + void* keys; //XkbKeyNameRec* as array[xkb->max_key_code + 1] + void* key_aliases; //XkbKeyAliasRec* as array[num_key_aliases] + XID* radio_groups; + XID phys_symbols; + unsigned char num_keys; + unsigned char num_key_aliases; + unsigned short num_rg; +} my_XkbNamesRec_t; + +typedef struct my_XkbClientMapRec_s { + unsigned char size_types; + unsigned char num_types; + void* types; //XkbKeyTypePtr + unsigned short size_syms; + unsigned short num_syms; + void* syms; //KeySym* + void* key_sym_map; //XkbSymMapPtr + unsigned char* modmap; +} my_XkbClientMapRec_t; + +typedef struct my_XkbDescRec_s { + my_XDisplay_t* display; + unsigned short flags; + unsigned short device_spec; + uint8_t min_key_code; + uint8_t max_key_code; + void* ctrls; //XkbControlsPtr + void* server; //XkbServerMapPtr + my_XkbClientMapRec_t* map; //XkbClientMapPtr + void* indicators; //XkbIndicatorPtr + my_XkbNamesRec_t* names; + void* compat; //XkbCompatMapPtr + void* geom; //XkbGeometryPtr +} my_XkbDescRec_t; + +typedef struct my_XmbTextItem_s { + void* chars; //char* + int nchars; + int delta; + void* font_set; //XFontSet +} my_XmbTextItem_t; + +typedef struct my_XwcTextItem_s { + void* chars; //wchar_t* + int nchars; + int delta; + void* font_set; //XFontSet +} my_XwcTextItem_t; + +typedef struct my_XAnyClassinfo_s { + XID c_class; + int length; +} my_XAnyClassInfo_t; + +typedef struct my_XKeyInfo_s +{ + XID c_class; + int length; + unsigned short min_keycode; + unsigned short max_keycode; + unsigned short num_keys; +} my_XKeyInfo_t; +typedef struct my_XButtonInfo_s +{ + XID c_class; + int length; + short num_buttons; +} my_XButtonInfo_t; +typedef struct my_XValuatorInfo_s +{ + XID c_class; + int length; + unsigned char num_axes; + unsigned char mode; + unsigned long motion_buffer; + void* axes; //XAxisInfoPtr +} my_XValuatorInfo_t; + +typedef struct my_XDeviceInfo_s +{ + XID id; + XID type; + char* name; + int num_classes; + int use; + my_XAnyClassInfo_t* inputclassinfo; +} my_XDeviceInfo_t; + +typedef struct my_XTimeCoord_s { + unsigned long time; + short x, y; +} my_XTimeCoord_t; + +typedef struct my_XDeviceTimeCoord_s { + unsigned long time; + int* data; +} my_XDeviceTimeCoord_t; + +typedef struct my_XFixesCursorImage_s { + short x, y; + unsigned short width, height; + unsigned short xhot, yhot; + unsigned long cursor_serial; + unsigned long* pixels; + XID atom; /* Version >= 2 only */ + void* name; /* Version >= 2 only */ +} my_XFixesCursorImage_t; + +typedef struct my_XFilters_s { + int nfilter; + char **filter; + int nalias; + short *alias; +} my_XFilters_t; + +typedef struct my__XRRMonitorInfo_s { + XID name; + int primary; + int automatic; + int noutput; + int x; + int y; + int width; + int height; + int mwidth; + int mheight; + XID* outputs; +} my_XRRMonitorInfo_t; + +typedef struct my_XkbAnyEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + unsigned long time; + int xkb_type; + unsigned int device; +} my_XkbAnyEvent_t; + +typedef struct my_XkbNewKeyboardNotify_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + unsigned long time; + int xkb_type; + int device; + int old_device; + int min_key_code; + int max_key_code; + int old_min_key_code; + int old_max_key_code; + unsigned int changed; + char req_major; + char req_minor; +} my_XkbNewKeyboardNotifyEvent_t; + +typedef struct my_XkbMapNotifyEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + unsigned long time; + int xkb_type; + int device; + unsigned int changed; + unsigned int flags; + int first_type; + int num_types; + uint8_t min_key_code; + uint8_t max_key_code; + uint8_t first_key_sym; + uint8_t first_key_act; + uint8_t first_key_behavior; + uint8_t first_key_explicit; + uint8_t first_modmap_key; + uint8_t first_vmodmap_key; + int num_key_syms; + int num_key_acts; + int num_key_behaviors; + int num_key_explicit; + int num_modmap_keys; + int num_vmodmap_keys; + unsigned int vmods; +} my_XkbMapNotifyEvent_t; + +typedef struct my_XkbStateNotifyEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + unsigned long time; + int xkb_type; + int device; + unsigned int changed; + int group; + int base_group; + int latched_group; + int locked_group; + unsigned int mods; + unsigned int base_mods; + unsigned int latched_mods; + unsigned int locked_mods; + int compat_state; + unsigned char grab_mods; + unsigned char compat_grab_mods; + unsigned char lookup_mods; + unsigned char compat_lookup_mods; + int ptr_buttons; + uint8_t keycode; + char event_type; + char req_major; + char req_minor; +} my_XkbStateNotifyEvent_t; + +typedef struct my_XkbControlsNotify_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + unsigned long time; + int xkb_type; + int device; + unsigned int changed_ctrls; + unsigned int enabled_ctrls; + unsigned int enabled_ctrl_changes; + int num_groups; + uint8_t keycode; + char event_type; + char req_major; + char req_minor; +} my_XkbControlsNotifyEvent_t; + +typedef struct my_XkbIndicatorNotify_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + unsigned long time; + int xkb_type; + int device; + unsigned int changed; + unsigned int state; +} my_XkbIndicatorNotifyEvent_t; + +typedef struct my_XkbNamesNotify_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + unsigned long time; + int xkb_type; + int device; + unsigned int changed; + int first_type; + int num_types; + int first_lvl; + int num_lvls; + int num_aliases; + int num_radio_groups; + unsigned int changed_vmods; + unsigned int changed_groups; + unsigned int changed_indicators; + int first_key; + int num_keys; +} my_XkbNamesNotifyEvent_t; + +typedef struct my_XkbCompatMapNotify_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + unsigned long time; + int xkb_type; + int device; + unsigned int changed_groups; + int first_si; + int num_si; + int num_total_si; +} my_XkbCompatMapNotifyEvent_t; + +typedef struct my_XkbBellNotify_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + unsigned long time; + int xkb_type; + int device; + int percent; + int pitch; + int duration; + int bell_class; + int bell_id; + XID name; + XID window; + int event_only; +} my_XkbBellNotifyEvent_t; + +typedef struct my_XkbActionMessage_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + unsigned long time; + int xkb_type; + int device; + uint8_t keycode; + int press; + int key_event_follows; + int group; + unsigned int mods; + char message[6+1]; +} my_XkbActionMessageEvent_t; + +typedef struct my_XkbAccessXNotify_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + unsigned long time; + int xkb_type; + int device; + int detail; + int keycode; + int sk_delay; + int debounce_delay; +} my_XkbAccessXNotifyEvent_t; + +typedef struct my_XkbExtensionDeviceNotify_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + unsigned long time; + int xkb_type; + int device; + unsigned int reason; + unsigned int supported; + unsigned int unsupported; + int first_btn; + int num_btns; + unsigned int leds_defined; + unsigned int led_state; + int led_class; + int led_id; +} my_XkbExtensionDeviceNotifyEvent_t; + +typedef union my_XkbEvent_s { + int type; + my_XkbAnyEvent_t any; + my_XkbNewKeyboardNotifyEvent_t new_kbd; + my_XkbMapNotifyEvent_t map; + my_XkbStateNotifyEvent_t state; + my_XkbControlsNotifyEvent_t ctrls; + my_XkbIndicatorNotifyEvent_t indicators; + my_XkbNamesNotifyEvent_t names; + my_XkbCompatMapNotifyEvent_t compat; + my_XkbBellNotifyEvent_t bell; + my_XkbActionMessageEvent_t message; + my_XkbAccessXNotifyEvent_t accessx; + my_XkbExtensionDeviceNotifyEvent_t device; + my_XEvent_t core; +} my_XkbEvent_t; + +typedef struct my_XIEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t*display; + int extension; + int evtype; + unsigned long time; +} my_XIEvent_t; + +typedef struct my_XIHierarchyInfo_s { + int deviceid; + int attachment; + int use; + int enabled; + int flags; +} my_XIHierarchyInfo_t; + +typedef struct my_XIButtonState_s { + int mask_len; + unsigned char *mask; +} my_XIButtonState_t; + +typedef struct my_XIValuatorState_s { + int mask_len; + unsigned char *mask; + double *values; +} my_XIValuatorState_t; + +typedef struct my_XIModifierState_s { + int base; + int latched; + int locked; + int effective; +} my_XIModifierState_t; + +typedef struct my_XIHierarchyEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + int extension; + int evtype; + unsigned long time; + int flags; + int num_info; + my_XIHierarchyInfo_t* info; +} my_XIHierarchyEvent_t; + +typedef struct my_XIDeviceChangedEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + int extension; + int evtype; + unsigned long time; + int deviceid; + int sourceid; + int reason; + int num_classes; + my_XIAnyClassInfo_t** classes; +} my_XIDeviceChangedEvent_t; + +typedef struct my_XIDeviceEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + int extension; + int evtype; + unsigned long time; + int deviceid; + int sourceid; + int detail; + XID root; + XID event; + XID child; + double root_x; + double root_y; + double event_x; + double event_y; + int flags; + my_XIButtonState_t buttons; + my_XIValuatorState_t valuators; + my_XIModifierState_t mods; + my_XIModifierState_t group; +} my_XIDeviceEvent_t; + +typedef struct my_XIRawEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + int extension; + int evtype; + unsigned long time; + int deviceid; + int sourceid; + int detail; + int flags; + my_XIValuatorState_t valuators; + double* raw_values; +} my_XIRawEvent_t; + +typedef struct my_XIEnterEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + int extension; + int evtype; + unsigned long time; + int deviceid; + int sourceid; + int detail; + XID root; + XID event; + XID child; + double root_x; + double root_y; + double event_x; + double event_y; + int mode; + int focus; + int same_screen; + my_XIButtonState_t buttons; + my_XIModifierState_t mods; + my_XIModifierState_t group; +} my_XIEnterEvent_t; +// Leave, FocusIn and FocusOut are like Enter + +typedef struct my_XIPropertyEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t*display; + int extension; + int evtype; + unsigned long time; + int deviceid; + XID property; + int what; +} my_XIPropertyEvent_t; + +typedef struct my_XITouchOwnershipEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t*display; + int extension; + int evtype; + unsigned long time; + int deviceid; + int sourceid; + unsigned int touchid; + XID root; + XID event; + XID child; + int flags; +} my_XITouchOwnershipEvent_t; + +typedef struct my_XIBarrierEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t*display; + int extension; + int evtype; + unsigned long time; + int deviceid; + int sourceid; + XID event; + XID root; + double root_x; + double root_y; + double dx; + double dy; + int dtime; + int flags; + XID barrier; + uint32_t eventid; +} my_XIBarrierEvent_t; + +typedef struct my_XIGesturePinchEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + int extension; + int evtype; + unsigned long time; + int deviceid; + int sourceid; + int detail; + XID root; + XID event; + XID child; + double root_x; + double root_y; + double event_x; + double event_y; + double delta_x; + double delta_y; + double delta_unaccel_x; + double delta_unaccel_y; + double scale; + double delta_angle; + int flags; + my_XIModifierState_t mods; + my_XIModifierState_t group; +} my_XIGesturePinchEvent_t; + +typedef struct my_XIGestureSwipeEvent_s { + int type; + unsigned long serial; + int send_event; + my_XDisplay_t* display; + int extension; + int evtype; + unsigned long time; + int deviceid; + int sourceid; + int detail; + XID root; + XID event; + XID child; + double root_x; + double root_y; + double event_x; + double event_y; + double delta_x; + double delta_y; + double delta_unaccel_x; + double delta_unaccel_y; + int flags; + my_XIModifierState_t mods; + my_XIModifierState_t group; +} my_XIGestureSwipeEvent_t; + +#define XI_DeviceChanged 1 +#define XI_KeyPress 2 +#define XI_KeyRelease 3 +#define XI_ButtonPress 4 +#define XI_ButtonRelease 5 +#define XI_Motion 6 +#define XI_Enter 7 +#define XI_Leave 8 +#define XI_FocusIn 9 +#define XI_FocusOut 10 +#define XI_HierarchyChanged 11 +#define XI_PropertyEvent 12 +#define XI_RawKeyPress 13 +#define XI_RawKeyRelease 14 +#define XI_RawButtonPress 15 +#define XI_RawButtonRelease 16 +#define XI_RawMotion 17 +#define XI_TouchBegin 18 /* XI 2.2 */ +#define XI_TouchUpdate 19 +#define XI_TouchEnd 20 +#define XI_TouchOwnership 21 +#define XI_RawTouchBegin 22 +#define XI_RawTouchUpdate 23 +#define XI_RawTouchEnd 24 +#define XI_BarrierHit 25 /* XI 2.3 */ +#define XI_BarrierLeave 26 +#define XI_GesturePinchBegin 27 /* XI 2.4 */ +#define XI_GesturePinchUpdate 28 +#define XI_GesturePinchEnd 29 +#define XI_GestureSwipeBegin 30 +#define XI_GestureSwipeUpdate 31 +#define XI_GestureSwipeEnd 32 + +typedef struct my__XTransform_s { + int matrix[3][3]; +} my_XTransform_t; + +typedef struct my_XRRCrtcTransformAttributes_s { + my_XTransform_t pendingTransform; + char* pendingFilter; + int pendingNparams; + int* pendingParams; + my_XTransform_t currentTransform; + char* currentFilter; + int currentNparams; + int* currentParams; +} my_XRRCrtcTransformAttributes_t; + +#endif//MY_X11_DEFS \ No newline at end of file diff --git a/src/libtools/my_x11_defs_32.h b/src/libtools/my_x11_defs_32.h new file mode 100644 index 0000000..87ef4a9 --- /dev/null +++ b/src/libtools/my_x11_defs_32.h @@ -0,0 +1,1903 @@ +#ifndef MY_X11_DEFS_32 +#define MY_X11_DEFS_32 +#include +#include "box32.h" + +typedef ulong_t XID_32; + +typedef struct ximage_32_s { + ptr_t create_image; + ptr_t destroy_image; + ptr_t get_pixel; + ptr_t put_pixel; + ptr_t sub_image; + ptr_t add_pixel; +} ximage_32_t; + +typedef struct _XImage_32 { + int32_t width, height; + int32_t xoffset; + int32_t format; + ptr_t data; + int byte_order; + int bitmap_unit; + int bitmap_bit_order; + int bitmap_pad; + int depth; + int bytes_per_line; + int bits_per_pixel; + ulong_t red_mask; + ulong_t green_mask; + ulong_t blue_mask; + ptr_t obdata; + ximage_32_t f; +} XImage_32; + +struct my_XFreeFuncs_32 { + ptr_t atoms; // void* + ptr_t modifiermap; // void* + ptr_t key_bindings; // void* + ptr_t context_db; // void* + ptr_t defaultCCCs; // void* + ptr_t clientCmaps; // void* + ptr_t intensityMaps; // void* + ptr_t im_filters; // void* + ptr_t xkb; // void* +}; + +struct my_XExten_32 { + ptr_t next; //struct my_XExten * + ptr_t codes; // XExtCodes + ptr_t create_GC; // CreateGCType + ptr_t copy_GC; // CopyGCType + ptr_t flush_GC; // FlushGCType + ptr_t free_GC; // FreeGCType + ptr_t create_Font; // CreateFontType + ptr_t free_Font; // FreeFontType + ptr_t close_display; // CloseDisplayType + ptr_t error; // ErrorType + ptr_t error_string; // ErrorStringType + ptr_t name; //char* + ptr_t error_values; // PrintErrorType + ptr_t before_flush; // BeforeFlushType + ptr_t next_flush; //struct my_XExten * +}; + +struct my_XInternalAsync_32 { + ptr_t next; //struct my_XInternalAsync_32 * + ptr_t handler; //int (*handler)(void*, void*, char*, int, void*); + ptr_t data; //void* +}; + +struct my_XLockPtrs_32 { + ptr_t lock_display;// void (*lock_display)(void* dpy); + ptr_t unlock_display;// void (*unlock_display)(void *dpy); +}; + +struct my_XConnectionInfo_32 { + int fd; + ptr_t read_callback; // _XInternalConnectionProc + ptr_t call_data; + ptr_t watch_data; // void** + struct my_XConnectionInfo *next; +}; + +struct my_XConnWatchInfo_32 { + ptr_t fn; // XConnectionWatchProc + ptr_t client_data; + ptr_t next; //struct _XConnWatchInfo * +}; + +typedef struct my_Visual_32_s { + ptr_t ext_data; //XExtData* + XID_32 visualid; + int c_class; + ulong_t red_mask, green_mask, blue_mask; + int bits_per_rgb; + int map_entries; +} my_Visual_32_t; + +typedef struct my_Screen_32_s { + ptr_t ext_data; //XExtData * + ptr_t display; //struct my_XDisplay_s * + XID_32 root; + int width, height; + int mwidth, mheight; + int ndepths; + ptr_t depths; //Depth * + int root_depth; /* bits per pixel */ + ptr_t root_visual; //Visual * + ptr_t default_gc; //GC == struct _XGC* + XID_32 cmap; + ulong_t white_pixel; + ulong_t black_pixel; + int max_maps, min_maps; + int backing_store; + int save_unders; + long_t root_input_mask; +} my_Screen_32_t; + +typedef struct my_XDisplay_32_s +{ + ptr_t ext_data; //void * //offset = 0x00 + ptr_t free_funcs; //struct my_XFreeFuncs_32 * + int fd; + int conn_checker; + int proto_major_version; //offset = 0x10 + int proto_minor_version; + ptr_t vendor; //char * + XID_32 resource_base; + XID_32 resource_mask; // offset = 0x20 + XID_32 resource_id; + int resource_shift; + ptr_t resource_alloc;//XID_32 (*resource_alloc)(void*); + int byte_order; // offset = 0x30 + int bitmap_unit; + int bitmap_pad; + int bitmap_bit_order; + int nformats; //offset = 0x40 + ptr_t pixmap_format; //void * + int vnumber; + int release; + ptr_t head, tail; //ofsset = 0x50 + int qlen; + ulong_t last_request_read; + ulong_t request; //offset = 0x60 + ptr_t last_req; //char * + ptr_t buffer; //char * + ptr_t bufptr; //char * + ptr_t bufmax; //char * //offset = 0x70 + unsigned max_request_size; + ptr_t db; //void* * + ptr_t synchandler; //int (*synchandler)(void*); + ptr_t display_name;//char * //offset = 0x80 + int default_screen; + int nscreens; + ptr_t screens;//void * + ulong_t motion_buffer; //offset = 0x90 + volatile ulong_t flags; + int min_keycode; + int max_keycode; + ptr_t keysyms; //void * //offset = 0xA0 + ptr_t modifiermap; //void * + int keysyms_per_keycode; + ptr_t xdefaults; //char * + ptr_t scratch_buffer; //char * //offset = 0xB0 + ulong_t scratch_length; + int ext_number; + ptr_t ext_procs; //struct my_XExten * + ptr_t event_vec[128]; //int (*event_vec[128])(void *, void *, void *); // start at 0xC0 + ptr_t wire_vec[128]; //int (*wire_vec[128])(void *, void *, void *); + XID_32 lock_meaning; //offset = 0x4C0 + ptr_t lock; //void* + ptr_t async_handlers; //struct my_XInternalAsync * + ulong_t bigreq_size; + ptr_t lock_fns; //struct my_XLockPtrs * //offset = 0x4D0 + ptr_t idlist_alloc; //void (*idlist_alloc)(void *, void *, int); + ptr_t key_bindings; //void* + XID_32 cursor_font; + ptr_t atoms; //void* * + unsigned int mode_switch; + unsigned int num_lock; + ptr_t context_db; //void* + ptr_t error_vec; //int (**error_vec)(void*, void*, void*); + struct { + ptr_t defaultCCCs; //void* + ptr_t clientCmaps; //void* + ptr_t perVisualIntensityMaps; //void* + } cms; + ptr_t im_filters; //void* + ptr_t qfree; //void* + ulong_t next_event_32_serial_num; + ptr_t flushes; //struct my_XExten * + ptr_t im_fd_info; //struct my_XConnectionInfo * + int im_fd_length; + ptr_t conn_watchers; //struct my_XConnWatchInfo * + int watcher_count; + ptr_t filedes; //void* + ptr_t savedsynchandler; //int (*savedsynchandler)(void *); + XID_32 resource_max; + int xcmisc_opcode; + ptr_t xkb_info; //void* * + ptr_t trans_conn; //void* * + ptr_t xcb; //void* * + unsigned int next_cookie; + ptr_t generic_event_vec[128]; //int (*generic_event_vec[128])(void*, void*, void*); + ptr_t generic_event_copy_vec[128]; //int (*generic_event_copy_vec[128])(void*, void*, void*); + ptr_t cookiejar; //void * + ptr_t error_threads; //void * + ptr_t exit_handler; //void * + ptr_t exit_handler_data; //void * +} my_XDisplay_32_t; + +typedef struct my_XSetWindowAttributes_32_s { + XID_32 background_pixmap; + ulong_t background_pixel; + XID_32 border_pixmap; + ulong_t border_pixel; + int bit_gravity; + int win_gravity; + int backing_store; + ulong_t backing_planes; + ulong_t backing_pixel; + int save_under; + long_t event_mask; + long_t do_not_propagate_mask; + int override_redirect; + XID_32 colormap; + XID_32 cursor; +} my_XSetWindowAttributes_32_t; + +// Events + +typedef struct my_XKeyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 root; + XID_32 subwindow; + ulong_t time; + int x, y; + int x_root, y_root; + unsigned int state; + unsigned int keycode; + int same_screen; +} my_XKeyEvent_32_t; +typedef my_XKeyEvent_32_t my_XKeyPressedEvent_32_t; +typedef my_XKeyEvent_32_t my_XKeyReleasedEvent_32_t; + +typedef struct my_XButtonEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 root; + XID_32 subwindow; + ulong_t time; + int x, y; + int x_root, y_root; + unsigned int state; + unsigned int button; + int same_screen; +} my_XButtonEvent_32_t; +typedef my_XButtonEvent_32_t my_XButtonPressedEvent_32_t; +typedef my_XButtonEvent_32_t my_XButtonReleasedEvent_32_t; + +typedef struct my_XMotionEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 root; + XID_32 subwindow; + ulong_t time; + int x, y; + int x_root, y_root; + unsigned int state; + char is_hint; + int same_screen; +} my_XMotionEvent_32_t; +typedef my_XMotionEvent_32_t my_XPointerMovedEvent_32_t; + +typedef struct my_XCrossingEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 root; + XID_32 subwindow; + ulong_t time; + int x, y; + int x_root, y_root; + int mode; + int detail; + int same_screen; + int focus; + unsigned int state; +} my_XCrossingEvent_32_t; + +typedef my_XCrossingEvent_32_t my_XEnterWindowEvent_32_t; +typedef my_XCrossingEvent_32_t my_XLeaveWindowEvent_32_t; + +typedef struct my_XFocusChangeEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + int mode; + int detail; +} my_XFocusChangeEvent_32_t; +typedef my_XFocusChangeEvent_32_t my_XFocusInEvent_32_t; +typedef my_XFocusChangeEvent_32_t my_XFocusOutEvent_32_t; + +typedef struct my_XKeymapEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + char key_vector[32]; +} my_XKeymapEvent_32_t; + +typedef struct my_XExposeEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + int x, y; + int width, height; + int count; +} my_XExposeEvent_32_t; + +typedef struct my_XGraphicsExposeEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 drawable; + int x, y; + int width, height; + int count; + int major_code; + int minor_code; +} my_XGraphicsExposeEvent_32_t; + +typedef struct my_XNoExposeEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 drawable; + int major_code; + int minor_code; +} my_XNoExposeEvent_32_t; + +typedef struct my_XVisibilityEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + int state; +} my_XVisibilityEvent_32_t; + +typedef struct my_XCreateWindowEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 parent; + XID_32 window; + int x, y; + int width, height; + int border_width; + int override_redirect; +} my_XCreateWindowEvent_32_t; + +typedef struct my_XDestroyWindowEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; +} my_XDestroyWindowEvent_32_t; + +typedef struct my_XUnmapEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; + int from_configure; +} my_XUnmapEvent_32_t; + +typedef struct my_XMapEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; + int override_redirect; +} my_XMapEvent_32_t; + +typedef struct my_XMapRequestEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 parent; + XID_32 window; +} my_XMapRequestEvent_32_t; + +typedef struct my_XReparentEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; + XID_32 parent; + int x, y; + int override_redirect; +} my_XReparentEvent_32_t; + +typedef struct my_XConfigureEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; + int x, y; + int width, height; + int border_width; + XID_32 above; + int override_redirect; +} my_XConfigureEvent_32_t; + +typedef struct my_XGravityEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; + int x, y; +} my_XGravityEvent_32_t; + +typedef struct my_XResizeRequestEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + int width, height; +} my_XResizeRequestEvent_32_t; + +typedef struct my_XConfigureRequestEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 parent; + XID_32 window; + int x, y; + int width, height; + int border_width; + XID_32 above; + int detail; + ulong_t value_mask; +} my_XConfigureRequestEvent_32_t; + +typedef struct my_XCirculateEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 event; + XID_32 window; + int place; +} my_XCirculateEvent_32_t; + +typedef struct my_XCirculateRequestEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 parent; + XID_32 window; + int place; +} my_XCirculateRequestEvent_32_t; + +typedef struct my_XPropertyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 atom; + ulong_t time; + int state; +} my_XPropertyEvent_32_t; + +typedef struct my_XSelectionClearEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 selection; + ulong_t time; +} my_XSelectionClearEvent_32_t; + +typedef struct my_XSelectionRequestEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 owner; + XID_32 requestor; + XID_32 selection; + XID_32 target; + XID_32 property; + ulong_t time; +} my_XSelectionRequestEvent_32_t; + +typedef struct my_XSelectionEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 requestor; + XID_32 selection; + XID_32 target; + XID_32 property; + ulong_t time; +} my_XSelectionEvent_32_t; + +typedef struct my_XColormapEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 colormap; + int c_new; + int state; +} my_XColormapEvent_32_t; + +typedef struct my_XClientMessageEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 message_type; + int format; + union { + char b[20]; + short s[10]; + long_t l[5]; + } data; +} my_XClientMessageEvent_32_t; + +typedef struct my_XMappingEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + int request; + int first_keycode; + int count; +} my_XMappingEvent_32_t; + +typedef struct my_XErrorEvent_32_s +{ + int type; + ptr_t display; //Display* + XID_32 resourceid; + ulong_t serial; + unsigned char error_code; + unsigned char request_code; + unsigned char minor_code; +} my_XErrorEvent_32_t; + +typedef struct my_XAnyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; +} my_XAnyEvent_32_t; + +typedef struct my_XGenericEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + int extension; + int evtype; +} my_XGenericEvent_32_t; + +typedef struct my_XGenericEventCookie_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + int extension; + int evtype; + unsigned int cookie; + ptr_t data; //void* +} my_XGenericEventCookie_32_t; + +typedef union my_XEvent_32_s { + int type; + my_XAnyEvent_32_t xany; + my_XKeyEvent_32_t xkey; + my_XButtonEvent_32_t xbutton; + my_XMotionEvent_32_t xmotion; + my_XCrossingEvent_32_t xcrossing; + my_XFocusChangeEvent_32_t xfocus; + my_XExposeEvent_32_t xexpose; + my_XGraphicsExposeEvent_32_t xgraphicsexpose; + my_XNoExposeEvent_32_t xnoexpose; + my_XVisibilityEvent_32_t xvisibility; + my_XCreateWindowEvent_32_t xcreatewindow; + my_XDestroyWindowEvent_32_t xdestroywindow; + my_XUnmapEvent_32_t xunmap; + my_XMapEvent_32_t xmap; + my_XMapRequestEvent_32_t xmaprequest; + my_XReparentEvent_32_t xreparent; + my_XConfigureEvent_32_t xconfigure; + my_XGravityEvent_32_t xgravity; + my_XResizeRequestEvent_32_t xresizerequest; + my_XConfigureRequestEvent_32_t xconfigurerequest; + my_XCirculateEvent_32_t xcirculate; + my_XCirculateRequestEvent_32_t xcirculaterequest; + my_XPropertyEvent_32_t xproperty; + my_XSelectionClearEvent_32_t xselectionclear; + my_XSelectionRequestEvent_32_t xselectionrequest; + my_XSelectionEvent_32_t xselection; + my_XColormapEvent_32_t xcolormap; + my_XClientMessageEvent_32_t xclient; + my_XMappingEvent_32_t xmapping; + my_XErrorEvent_32_t xerror; + my_XKeymapEvent_32_t xkeymap; + my_XGenericEvent_32_t xgeneric; + my_XGenericEventCookie_32_t xcookie; + long_t pad[24]; +} my_XEvent_32_t; + +// WMHints +typedef struct my_XWMHints_32_s { + long_t flags; + int input; + int initial_state; + XID_32 icon_pixmap; + XID_32 icon_window; + int icon_x; + int icon_y; + XID_32 icon_mask; + XID_32 window_group; +} my_XWMHints_32_t; + +typedef struct my_XRRModeInfo_32_s { + XID_32 id; + unsigned int width; + unsigned int height; + ulong_t dotClock; + unsigned int hSyncStart; + unsigned int hSyncEnd; + unsigned int hTotal; + unsigned int hSkew; + unsigned int vSyncStart; + unsigned int vSyncEnd; + unsigned int vTotal; + ptr_t name; //char* + unsigned int nameLength; + ulong_t modeFlags; +} my_XRRModeInfo_32_t; + + +typedef struct my_XRRScreenResources_32_s { + ulong_t timestamp; + ulong_t configTimestamp; + int ncrtc; + ptr_t crtcs; //XID_32* + int noutput; + ptr_t outputs; //XID_32* + int nmode; + ptr_t modes; //my_XRRModeInfo_32_t * +} my_XRRScreenResources_32_t; + +typedef struct my_XRRCrtcInfo_32_s { + ulong_t timestamp; + int x, y; + unsigned int width, height; + XID_32 mode; + uint16_t rotation; + int noutput; + ptr_t outputs; //XID_32* + uint16_t rotations; + int npossible; + ptr_t possible; //XID_32* +} my_XRRCrtcInfo_32_t; + +typedef struct my_XRROutputInfo_32_s { + ulong_t timestamp; + XID_32 crtc; + ptr_t name; //char* + int nameLen; + ulong_t mm_width; + ulong_t mm_height; + uint16_t connection; + uint16_t subpixel_order; + int ncrtc; + ptr_t crtcs; //XID_32* + int nclone; + ptr_t clones; //XID_32* + int nmode; + int npreferred; + ptr_t modes; //XID_32* +} my_XRROutputInfo_32_t; + +typedef struct my_XWindowAttributes_32_s { + int x, y; + int width, height; + int border_width; + int depth; + ptr_t visual; //Visual* + XID_32 root; + int c_class; + int bit_gravity; + int win_gravity; + int backing_store; + ulong_t backing_planes; + ulong_t backing_pixel; + int save_under; + XID_32 colormap; + int map_installed; + int map_state; + long_t all_event_masks; + long_t your_event_mask; + long_t do_not_propagate_mask; + int override_redirect; + ptr_t screen; //Screen* +} my_XWindowAttributes_32_t; + +typedef struct my_XVisualInfo_32_s { + ptr_t visual; //Visual* + ulong_t visualid; + int screen; + int depth; + int c_class; + ulong_t red_mask; + ulong_t green_mask; + ulong_t blue_mask; + int colormap_size; + int bits_per_rgb; +} my_XVisualInfo_32_t; + +typedef struct my_XModifierKeymap_32_s { + int max_keypermod; + ptr_t modifiermap; //uint8_t* +} my_XModifierKeymap_32_t; + +typedef struct my_XdbeVisualInfo_32_s +{ + XID_32 visual; + int depth; + int perflevel; +} my_XdbeVisualInfo_32_t; + +typedef struct my_XdbeScreenVisualInfo_32_s +{ + int count; + ptr_t visinfo; //my_XdbeVisualInfo_t* +} my_XdbeScreenVisualInfo_32_t; + +typedef struct my_XF86VidModeModeInfo_32_s +{ + unsigned int dotclock; + unsigned short hdisplay; + unsigned short hsyncstart; + unsigned short hsyncend; + unsigned short htotal; + unsigned short hskew; + unsigned short vdisplay; + unsigned short vsyncstart; + unsigned short vsyncend; + unsigned short vtotal; + unsigned int flags; + int privsize; + ptr_t tc_private; +} my_XF86VidModeModeInfo_32_t; + +typedef struct my_XColor_32_s { + ulong_t pixel; + unsigned short red, green, blue; + char flags; + char pad; +} my_XColor_32_t; + +typedef struct my_XRRProviderInfo_32_s { + unsigned int capabilities; + int ncrtcs; + ptr_t crtcs; //XID* + int noutputs; + ptr_t outputs; //XID* + ptr_t name; //char* + int nassociatedproviders; + ptr_t associated_providers; //XID* + ptr_t associated_capability; //unsigned int* + int nameLen; +} my_XRRProviderInfo_32_t; + +typedef struct my_XRRProviderResources_32_t { + ulong_t timestamp; + int nproviders; + ptr_t providers; //XID* +} my_XRRProviderResources_32_t; + +typedef struct my_XIAnyClassInfo_32_s +{ + int type; + int sourceid; +} my_XIAnyClassInfo_32_t; + +typedef struct my_XIDeviceInfo_32_s +{ + int deviceid; + ptr_t name; //char* + int use; + int attachment; + int enabled; + int num_classes; + ptr_t classes; //my_XIAnyClassInfo_t** +} my_XIDeviceInfo_32_t; + +typedef struct my_XIEventMask_32_s { + int deviceid; + int mask_len; + ptr_t mask; //unsigned char* +} my_XIEventMask_32_t; + +typedef struct my_XInputClassInfo_32_s { + unsigned char input_class; + unsigned char event_type_base; +} my_XInputClassInfo_32_t; + +typedef struct my_XDevice_32_s { + XID_32 device_id; + int num_classes; + ptr_t classes; //my_XInputClassInfo_t* +} my_XDevice_32_t; + +typedef struct my_XDeviceKeyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 deviceid; + XID_32 root; + XID_32 subwindow; + ulong_t time; + int x, y; + int x_root; + int y_root; + unsigned int state; + unsigned int keycode; + int same_screen; + unsigned int device_state; + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; +} my_XDeviceKeyEvent_32_t; +typedef my_XDeviceKeyEvent_32_t my_XDeviceButtonEvent_32_t; +typedef struct my_XDeviceMotionEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 deviceid; + XID_32 root; + XID_32 subwindow; + ulong_t time; + int x, y; + int x_root; + int y_root; + unsigned int state; + char is_hint; + int same_screen; + unsigned int device_state; + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; +} my_XDeviceMotionEvent_32_t; +typedef struct my_XDeviceFocusChangeEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 deviceid; + int mode; + int detail; + ulong_t time; +} my_XDeviceFocusChangeEvent_32_t; +typedef struct my_XProximityNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 deviceid; + XID_32 root; + XID_32 subwindow; + ulong_t time; + int x, y; + int x_root; + int y_root; + unsigned int state; + int same_screen; + unsigned int device_state; + unsigned char axes_count; + unsigned char first_axis; + int axis_data[6]; +} my_XProximityNotifyEvent_32_t; +typedef struct my_XDeviceStateNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; //Display* + XID_32 window; + XID_32 deviceid; + ulong_t time; + int num_classes; + char data[64]; +} my_XDeviceStateNotifyEvent_32_t; +typedef struct my_XDeviceMappingEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + XID_32 deviceid; + ulong_t time; + int request; + int first_keycode; + int count; +} my_XDeviceMappingEvent_32_t; +typedef struct my_XChangeDeviceNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + XID_32 deviceid; + ulong_t time; + int request; +} my_XChangeDeviceNotifyEvent_32_t; +typedef struct my_XDevicePresenceNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + ulong_t time; + int devchange; + XID_32 deviceid; + XID_32 control; +} my_XDevicePresenceNotifyEvent_32_t; +typedef struct my_XDevicePropertyNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + ulong_t time; + XID_32 deviceid; + XID_32 atom; + int state; +} my_XDevicePropertyNotifyEvent_32_t; +typedef struct my_XInputClass_32_s { + unsigned char class; + unsigned char length; +} my_XInputClass_32_t; +typedef struct my_XDeviceState_32_s { + XID_32 device_id; + int num_classes; + ptr_t data; //my_XInputClass_32_t* +} my_XDeviceState_32_t; + +typedef struct my_XFixesSelectionNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + int subtype; + ulong_t selection_timestamp; + XID_32 owner; + XID_32 selection; + ulong_t timestamp; +} my_XFixesSelectionNotifyEvent_32_t; +typedef struct my_XFixesCursorNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + int subtype; + ulong_t cursor_serial; + ulong_t timestamp; + XID_32 cursor_name; +} my_XFixesCursorNotifyEvent_32_t; + +typedef struct my_XRRScreenChangeNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + XID_32 root; + ulong_t timestamp; + ulong_t config_timestamp; + uint16_t size_index; + uint16_t subpixel_order; + uint16_t rotation; + int width; + int height; + int mwidth; + int mheight; +} my_XRRScreenChangeNotifyEvent_32_t; +typedef struct my_XRRNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + int subtype; +} my_XRRNotifyEvent_32_t; +typedef struct my_XRROutputChangeNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + int subtype; + XID_32 output; + XID_32 crtc; + XID_32 mode; + uint16_t rotation; + uint16_t connection; + uint16_t subpixel_order; +} my_XRROutputChangeNotifyEvent_32_t; +typedef struct my_XRRCrtcChangeNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + int subtype; + XID_32 crtc; + XID_32 mode; + uint16_t rotation; + int x, y; + unsigned int width, height; +} my_XRRCrtcChangeNotifyEvent_32_t; +typedef struct my_XRROutputPropertyNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + int subtype; + XID_32 output; + XID_32 property; + ulong_t timestamp; + int state; +} my_XRROutputPropertyNotifyEvent_32_t; +typedef struct my_XRRProviderChangeNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + int subtype; + XID_32 provider; + ulong_t timestamp; + unsigned int current_role; +} my_XRRProviderChangeNotifyEvent_32_t; +typedef struct my_XRRProviderPropertyNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + int subtype; + XID_32 provider; + XID_32 property; + ulong_t timestamp; + int state; +} my_XRRProviderPropertyNotifyEvent_32_t; +typedef struct my_XRRResourceChangeNotifyEvent_32_s +{ + int type; + ulong_t serial; + int send_event; + ptr_t display; + XID_32 window; + int subtype; + ulong_t timestamp; +} my_XRRResourceChangeNotifyEvent_32_t; + +typedef struct my_XcursorCursors_32_s { + ptr_t dpy; //Display* + int ref; + int ncursor; + ptr_t cursors; //Cursor* +} my_XcursorCursors_32_t; + +typedef struct my_XcursorImage_32_s { + uint32_t version; + uint32_t size; + uint32_t width; + uint32_t height; + uint32_t xhot; + uint32_t yhot; + uint32_t delay; + ptr_t pixels; //XcursorPixel* +} my_XcursorImage_32_t; + +typedef struct my_XcursorImages_32_s { + int nimage; + ptr_t images; //my_XcursorImage_t** + ptr_t name; //char* +} my_XcursorImages_32_t; + +typedef struct my_XExtCodes_32_s { + int extension; + int major_opcode; + int first_event; + int first_error; +} my_XExtCodes_32_t; + +typedef struct my_XExtDisplayInfo_32_s { + ptr_t next; //struct my_XExtDisplayInfo_s* + ptr_t display; //Didsplay* + ptr_t codes; //my_XExtCodes_t* + ptr_t data; //void* +} my_XExtDisplayInfo_32_t; + +typedef struct my_XExtensionInfo_32_s { + ptr_t head; //my_XExtDisplayInfo_t* + ptr_t cur; //my_XExtDisplayInfo_t* + int ndisplays; +} my_XExtensionInfo_32_t; + +typedef struct my_XCharStruct_32_t { + short lbearing; + short rbearing; + short width; + short ascent; + short descent; + unsigned short attributes; +} my_XCharStruct_32_t; + +typedef struct my_XFontProp_32_s { + XID_32 name; + ulong_t card32; +} my_XFontProp_32_t; + +typedef struct my_XFontStruct_32_s { + ptr_t ext_data; //XExtData* + XID_32 fid; + unsigned direction; + unsigned min_char_or_byte2; + unsigned max_char_or_byte2; + unsigned min_byte1; + unsigned max_byte1; + int all_chars_exist; + unsigned default_char; + int n_properties; + ptr_t properties; //my_XFontProp_t* + my_XCharStruct_32_t min_bounds; + my_XCharStruct_32_t max_bounds; + ptr_t per_char; //my_XCharStruct_t* + int ascent; + int descent; +} my_XFontStruct_32_t; + +typedef struct my_XExtensionHooks_32_s { + ptr_t create_gc; //int (*create_gc)(void* dpy, void* gc, my_XExtCodes_t* e); + ptr_t copy_gc; //int (*copy_gc)(void* dpy, void* gc, my_XExtCodes_t* e); + ptr_t flush_gc; //int (*flush_gc)(void* dpy, void* gc, my_XExtCodes_t* e); + ptr_t free_gc; //int (*free_gc)(void* dpy, void* gc, my_XExtCodes_t* e); + ptr_t create_font; //int (*create_font)(void* dpy, my_XFontStruct_t* f, my_XExtCodes_t* e); + ptr_t free_font; //int (*free_font)(void* dpy, my_XFontStruct_t* f, my_XExtCodes_t* e); + ptr_t close_display; //int (*close_display)(void* dpy, my_XExtCodes_t* e); + ptr_t wire_to_event; //int (*wire_to_event)(void* dpy, my_XEvent_t* evt, void* xEvent); + ptr_t event_to_wire; //int (*event_to_wire)(void* dpy, my_XEvent_t* evt, void* xEvent); + ptr_t error; //int (*error)(void* dpy, void* xError, my_XExtCodes_t* e, int* n); + ptr_t error_string; //char*(*error_string)(void* dpy, int, my_XExtCodes_t* e, char* s, int n); +} my_XExtensionHooks_32_t; + +typedef struct my_XRRPropertyInfo_32_s { + int pending; + int range; + int immutable; + int num_values; + ptr_t values; //long* +} my_XRRPropertyInfo_32_t; + +typedef struct my_XShmSegmentInfo_32_s { + XID_32 shmseg; + int shmid; + ptr_t shmaddr; + int readOnly; +} my_XShmSegmentInfo_32_t; + +typedef struct my_XkbNamesRec_32_s { + XID_32 keycodes; + XID_32 geometry; + XID_32 symbols; + XID_32 types; + XID_32 compat; + XID_32 vmods[16]; + XID_32 indicators[32]; + XID_32 groups[4]; + ptr_t keys; //XkbKeyNameRec* as array[xkb->max_key_code + 1] + ptr_t key_aliases; //XkbKeyAliasRec* as array[num_key_aliases] + ptr_t radio_groups; //XID* + XID_32 phys_symbols; + unsigned char num_keys; + unsigned char num_key_aliases; + unsigned short num_rg; +} my_XkbNamesRec_32_t; + +typedef struct my_XkbClientMapRec_32_s { + unsigned char size_types; + unsigned char num_types; + ptr_t types; //XkbKeyTypePtr + unsigned short size_syms; + unsigned short num_syms; + ptr_t syms; //KeySym* + ptr_t key_sym_map; //XkbSymMapPtr + ptr_t modmap; //unsigned char* +} my_XkbClientMapRec_32_t; + +typedef struct my_XkbDescRec_32_s { + ptr_t display; //my_XDisplay_32_t* + unsigned short flags; + unsigned short device_spec; + uint8_t min_key_code; + uint8_t max_key_code; + ptr_t ctrls; //XkbControlsPtr + ptr_t server; //XkbServerMapPtr + ptr_t map; //XkbClientMapPtr + ptr_t indicators; //XkbIndicatorPtr + ptr_t names; //my_XkbNamesRec_32_t* + ptr_t compat; //XkbCompatMapPtr + ptr_t geom; //XkbGeometryPtr +} my_XkbDescRec_32_t; + +typedef struct my_XmbTextItem_32_s { + ptr_t chars; //char* + int nchars; + int delta; + ptr_t font_set; //XFontSet +} my_XmbTextItem_32_t; + +typedef struct my_XwcTextItem_32_s { + ptr_t chars; //wchar_t* + int nchars; + int delta; + ptr_t font_set; //XFontSet +} my_XwcTextItem_32_t; + +// virtual structure +typedef struct my_XFontSet_32_s { + void* fontset; // the actual fontset + ptr_t** names; // arrays of array of names + int names_size; // size of names + ptr_t** fonts; // array of array of fonts + int fonts_size; // soze of fonts +} my_XFontSet_32_t; + +typedef struct my_XAnyClassinfo_32_s { + XID_32 c_class; + int length; +} my_XAnyClassInfo_32_t; + +typedef struct my_XKeyInfo_32_s +{ + XID_32 c_class; + int length; + unsigned short min_keycode; + unsigned short max_keycode; + unsigned short num_keys; +} my_XKeyInfo_32_t; +typedef struct my_XButtonInfo_32_s +{ + XID_32 c_class; + int length; + short num_buttons; +} my_XButtonInfo_32_t; +typedef struct my_XValuatorInfo_32_s +{ + XID_32 c_class; + int length; + unsigned char num_axes; + unsigned char mode; + ulong_t motion_buffer; + ptr_t axes; //XAxisInfoPtr +} my_XValuatorInfo_32_t; + +typedef struct my_XDeviceInfo_32_s +{ + XID_32 id; + XID_32 type; + ptr_t name; //char* + int num_classes; + int use; + ptr_t inputclassinfo; //my_XAnyClassInfo_32_t* +} my_XDeviceInfo_32_t; + +typedef struct my_XTimeCoord_32_s { + ulong_t time; + short x, y; +} my_XTimeCoord_32_t; + +typedef struct my_XDeviceTimeCoord_32_s { + ulong_t time; + ptr_t data; //int* +} my_XDeviceTimeCoord_32_t; + +typedef struct my_XFixesCursorImage_32_s { + short x, y; + unsigned short width, height; + unsigned short xhot, yhot; + ulong_t cursor_serial; + ptr_t pixels; //unsigned long* + XID_32 atom; /* Version >= 2 only */ + ptr_t name; /* Version >= 2 only */ +} my_XFixesCursorImage_32_t; + +typedef struct my_XFilters_32_s { + int nfilter; + ptr_t filter; //char ** + int nalias; + ptr_t alias; //short * +} my_XFilters_32_t; + +typedef struct my__XRRMonitorInfo_32_s { + XID_32 name; + int primary; + int automatic; + int noutput; + int x; + int y; + int width; + int height; + int mwidth; + int mheight; + ptr_t outputs; //XID* +} my_XRRMonitorInfo_32_t; + +typedef struct my_XkbAnyEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; //my_XDisplay_t* + ulong_t time; + int xkb_type; + unsigned int device; +} my_XkbAnyEvent_32_t; + +typedef struct my_XkbNewKeyboardNotify_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; //my_XDisplay_t* + ulong_t time; + int xkb_type; + int device; + int old_device; + int min_key_code; + int max_key_code; + int old_min_key_code; + int old_max_key_code; + unsigned int changed; + char req_major; + char req_minor; +} my_XkbNewKeyboardNotifyEvent_32_t; + +typedef struct my_XkbMapNotifyEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; //my_XDisplay_t* + ulong_t time; + int xkb_type; + int device; + unsigned int changed; + unsigned int flags; + int first_type; + int num_types; + uint8_t min_key_code; + uint8_t max_key_code; + uint8_t first_key_sym; + uint8_t first_key_act; + uint8_t first_key_behavior; + uint8_t first_key_explicit; + uint8_t first_modmap_key; + uint8_t first_vmodmap_key; + int num_key_syms; + int num_key_acts; + int num_key_behaviors; + int num_key_explicit; + int num_modmap_keys; + int num_vmodmap_keys; + unsigned int vmods; +} my_XkbMapNotifyEvent_32_t; + +typedef struct my_XkbStateNotifyEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; //my_XDisplay_t* + ulong_t time; + int xkb_type; + int device; + unsigned int changed; + int group; + int base_group; + int latched_group; + int locked_group; + unsigned int mods; + unsigned int base_mods; + unsigned int latched_mods; + unsigned int locked_mods; + int compat_state; + unsigned char grab_mods; + unsigned char compat_grab_mods; + unsigned char lookup_mods; + unsigned char compat_lookup_mods; + int ptr_buttons; + uint8_t keycode; + char event_type; + char req_major; + char req_minor; +} my_XkbStateNotifyEvent_32_t; + +typedef struct my_XkbControlsNotify_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; //my_XDisplay_t* + ulong_t time; + int xkb_type; + int device; + unsigned int changed_ctrls; + unsigned int enabled_ctrls; + unsigned int enabled_ctrl_changes; + int num_groups; + uint8_t keycode; + char event_type; + char req_major; + char req_minor; +} my_XkbControlsNotifyEvent_32_t; + +typedef struct my_XkbIndicatorNotify_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; //my_XDisplay_t* + ulong_t time; + int xkb_type; + int device; + unsigned int changed; + unsigned int state; +} my_XkbIndicatorNotifyEvent_32_t; + +typedef struct my_XkbNamesNotify_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; //my_XDisplay_t* + ulong_t time; + int xkb_type; + int device; + unsigned int changed; + int first_type; + int num_types; + int first_lvl; + int num_lvls; + int num_aliases; + int num_radio_groups; + unsigned int changed_vmods; + unsigned int changed_groups; + unsigned int changed_indicators; + int first_key; + int num_keys; +} my_XkbNamesNotifyEvent_32_t; + +typedef struct my_XkbCompatMapNotify_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; //my_XDisplay_t* + ulong_t time; + int xkb_type; + int device; + unsigned int changed_groups; + int first_si; + int num_si; + int num_total_si; +} my_XkbCompatMapNotifyEvent_32_t; + +typedef struct my_XkbBellNotify_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; //my_XDisplay_t* + ulong_t time; + int xkb_type; + int device; + int percent; + int pitch; + int duration; + int bell_class; + int bell_id; + XID_32 name; + XID_32 window; + int event_only; +} my_XkbBellNotifyEvent_32_t; + +typedef struct my_XkbActionMessage_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; //my_XDisplay_t* + ulong_t time; + int xkb_type; + int device; + uint8_t keycode; + int press; + int key_event_follows; + int group; + unsigned int mods; + char message[6+1]; +} my_XkbActionMessageEvent_32_t; + +typedef struct my_XkbAccessXNotify_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; //my_XDisplay_t* + ulong_t time; + int xkb_type; + int device; + int detail; + int keycode; + int sk_delay; + int debounce_delay; +} my_XkbAccessXNotifyEvent_32_t; + +typedef struct my_XkbExtensionDeviceNotify_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; //my_XDisplay_t* + ulong_t time; + int xkb_type; + int device; + unsigned int reason; + unsigned int supported; + unsigned int unsupported; + int first_btn; + int num_btns; + unsigned int leds_defined; + unsigned int led_state; + int led_class; + int led_id; +} my_XkbExtensionDeviceNotifyEvent_32_t; + +typedef union my_XkbEvent_32_s { + int type; + my_XkbAnyEvent_32_t any; + my_XkbNewKeyboardNotifyEvent_32_t new_kbd; + my_XkbMapNotifyEvent_32_t map; + my_XkbStateNotifyEvent_32_t state; + my_XkbControlsNotifyEvent_32_t ctrls; + my_XkbIndicatorNotifyEvent_32_t indicators; + my_XkbNamesNotifyEvent_32_t names; + my_XkbCompatMapNotifyEvent_32_t compat; + my_XkbBellNotifyEvent_32_t bell; + my_XkbActionMessageEvent_32_t message; + my_XkbAccessXNotifyEvent_32_t accessx; + my_XkbExtensionDeviceNotifyEvent_32_t device; + my_XEvent_32_t core; +} my_XkbEvent_32_t; + +typedef struct my_XIEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; + int extension; + int evtype; + ulong_t time; +} my_XIEvent_32_t; + +typedef struct my_XIButtonState_32_s { + int mask_len; + ptr_t mask; //unsigned char* +} my_XIButtonState_32_t; + +typedef struct my_XIValuatorState_32_s { + int mask_len; + ptr_t mask; //unsigned char* + ptr_t values; //double* +} my_XIValuatorState_32_t; + +typedef struct my_XIHierarchyEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; + int extension; + int evtype; + ulong_t time; + int flags; + int num_info; + ptr_t info; //my_XIHierarchyInfo_t* +} my_XIHierarchyEvent_32_t; + +typedef struct my_XIDeviceChangedEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; + int extension; + int evtype; + ulong_t time; + int deviceid; + int sourceid; + int reason; + int num_classes; + ptr_t classes; //my_XIAnyClassInfo_t** +} my_XIDeviceChangedEvent_32_t; + +typedef struct my_XIDeviceEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; + int extension; + int evtype; + ulong_t time; + int deviceid; + int sourceid; + int detail; + XID_32 root; + XID_32 event; + XID_32 child; + double root_x; + double root_y; + double event_x; + double event_y; + int flags; + my_XIButtonState_32_t buttons; + my_XIValuatorState_32_t valuators; + my_XIModifierState_t mods; + my_XIModifierState_t group; +} __attribute__((packed)) my_XIDeviceEvent_32_t; + +typedef struct my_XIRawEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; + int extension; + int evtype; + ulong_t time; + int deviceid; + int sourceid; + int detail; + int flags; + my_XIValuatorState_32_t valuators; + ptr_t raw_values; //double* +} my_XIRawEvent_32_t; + +typedef struct my_XIEnterEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; + int extension; + int evtype; + ulong_t time; + int deviceid; + int sourceid; + int detail; + XID root; + XID event; + XID child; + double root_x; + double root_y; + double event_x; + double event_y; + int mode; + int focus; + int same_screen; + my_XIButtonState_32_t buttons; + my_XIModifierState_t mods; + my_XIModifierState_t group; +} __attribute__((packed)) my_XIEnterEvent_32_t; +// Leave, FocusIn and FocusOut are like Enter + +typedef struct my_XIPropertyEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; + int extension; + int evtype; + ulong_t time; + int deviceid; + XID_32 property; + int what; +} my_XIPropertyEvent_32_t; + +typedef struct my_XITouchOwnershipEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; + int extension; + int evtype; + ulong_t time; + int deviceid; + int sourceid; + unsigned int touchid; + XID_32 root; + XID_32 event; + XID_32 child; + int flags; +} my_XITouchOwnershipEvent_32_t; + +typedef struct my_XIBarrierEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; + int extension; + int evtype; + ulong_t time; + int deviceid; + int sourceid; + XID_32 event; + XID_32 root; + double root_x; + double root_y; + double dx; + double dy; + int dtime; + int flags; + XID_32 barrier; + uint32_t eventid; +} __attribute__((packed)) my_XIBarrierEvent_32_t; + +typedef struct my_XIGesturePinchEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; + int extension; + int evtype; + ulong_t time; + int deviceid; + int sourceid; + int detail; + XID_32 root; + XID_32 event; + XID_32 child; + double root_x; + double root_y; + double event_x; + double event_y; + double delta_x; + double delta_y; + double delta_unaccel_x; + double delta_unaccel_y; + double scale; + double delta_angle; + int flags; + my_XIModifierState_t mods; + my_XIModifierState_t group; +} __attribute__((packed)) my_XIGesturePinchEvent_32_t; + +typedef struct my_XIGestureSwipeEvent_32_s { + int type; + ulong_t serial; + int send_event; + ptr_t display; + int extension; + int evtype; + ulong_t time; + int deviceid; + int sourceid; + int detail; + XID_32 root; + XID_32 event; + XID_32 child; + double root_x; + double root_y; + double event_x; + double event_y; + double delta_x; + double delta_y; + double delta_unaccel_x; + double delta_unaccel_y; + int flags; + my_XIModifierState_t mods; + my_XIModifierState_t group; +} __attribute__((packed)) my_XIGestureSwipeEvent_32_t; + +typedef struct my_XRRCrtcTransformAttributes_32_s { + my_XTransform_t pendingTransform; + ptr_t pendingFilter; //char* + int pendingNparams; + ptr_t pendingParams; //int* + my_XTransform_t currentTransform; + ptr_t currentFilter; //char* + int currentNparams; + ptr_t currentParams; //int* +} my_XRRCrtcTransformAttributes_32_t; + +#endif//MY_X11_DEFS_32 \ No newline at end of file diff --git a/src/libtools/my_x11_xevent.c b/src/libtools/my_x11_xevent.c new file mode 100644 index 0000000..d49d158 --- /dev/null +++ b/src/libtools/my_x11_xevent.c @@ -0,0 +1,1891 @@ +#include +#include +#include + +#include "debug.h" +#include "box32context.h" +#include "wrapper32.h" +#include "library.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "converter32.h" +#include "my_x11_defs.h" +#include "my_x11_defs_32.h" +#include "my_x11_conv.h" + +typedef void(*convertXEvent_to_32)(my_XEvent_32_t* dst, my_XEvent_t* src); +typedef void(*convertXEvent_to_64)(my_XEvent_t* dst, my_XEvent_32_t* src); + +typedef struct reg_event_s { + uint32_t event; + convertXEvent_to_32 to32; + convertXEvent_to_64 to64; +} reg_event_t; +typedef struct register_events_s { + void* id; + uint32_t start_event; + uint32_t end_event; + size_t n; + reg_event_t* events; + struct register_events_s* next; +} register_events_t; + +static register_events_t* register_events_head = NULL; + +extern int my32_xinput_opcode; + +void convertXEvent(my_XEvent_32_t* dst, my_XEvent_t* src) +{ + if(!src->type) { + // This is an XErrorEvent, and it's different! + dst->xerror.type = src->xerror.type; + dst->xerror.display = to_ptrv(FindDisplay(src->xerror.display)); + dst->xerror.resourceid = to_ulong(src->xerror.resourceid); + dst->xerror.serial = to_ulong(src->xerror.serial); + dst->xerror.error_code = src->xerror.error_code; + dst->xerror.request_code = src->xerror.request_code; + dst->xerror.minor_code = src->xerror.minor_code; + return; + } + // convert the XAnyEvent first, as it's a common set + int type = src->type; + dst->type = src->type; + dst->xany.serial = to_ulong(src->xany.serial); + dst->xany.send_event = src->xany.serial; + dst->xany.display = to_ptrv(FindDisplay(src->xany.display)); + if(type!=XEVT_GenericEvent) + dst->xany.window = to_ulong(src->xany.window); + switch(type) { + case XEVT_KeyPress: + case XEVT_KeyRelease: + dst->xkey.root = to_ulong(src->xkey.root); + dst->xkey.subwindow = to_ulong(src->xkey.subwindow); + dst->xkey.time = to_ulong(src->xkey.time); + dst->xkey.x = src->xkey.x; + dst->xkey.y = src->xkey.y; + dst->xkey.x_root = src->xkey.x_root; + dst->xkey.y_root = src->xkey.y_root; + dst->xkey.state = src->xkey.state; + dst->xkey.keycode = src->xkey.keycode; + dst->xkey.same_screen = src->xkey.same_screen; + break; + case XEVT_ButtonPress: + case XEVT_ButtonRelease: + dst->xbutton.root = to_ulong(src->xbutton.root); + dst->xbutton.subwindow = to_ulong(src->xbutton.subwindow); + dst->xbutton.time = to_ulong(src->xbutton.time); + dst->xbutton.x = src->xbutton.x; + dst->xbutton.y = src->xbutton.y; + dst->xbutton.x_root = src->xbutton.x_root; + dst->xbutton.y_root = src->xbutton.y_root; + dst->xbutton.state = src->xbutton.state; + dst->xbutton.button = src->xbutton.button; + dst->xbutton.same_screen = src->xbutton.same_screen; + break; + case XEVT_MotionNotify: + dst->xmotion.root = to_ulong(src->xmotion.root); + dst->xmotion.subwindow = to_ulong(src->xmotion.subwindow); + dst->xmotion.time = to_ulong(src->xmotion.time); + dst->xmotion.x = src->xmotion.x; + dst->xmotion.y = src->xmotion.y; + dst->xmotion.x_root = src->xmotion.x_root; + dst->xmotion.y_root = src->xmotion.y_root; + dst->xmotion.state = src->xmotion.state; + dst->xmotion.is_hint = src->xmotion.is_hint; + dst->xmotion.same_screen = src->xmotion.same_screen; + break; + case XEVT_EnterNotify: + case XEVT_LeaveNotify: + dst->xcrossing.root = to_ulong(src->xcrossing.root); + dst->xcrossing.subwindow = to_ulong(src->xcrossing.subwindow); + dst->xcrossing.time = to_ulong(src->xcrossing.time); + dst->xcrossing.x = src->xcrossing.x; + dst->xcrossing.y = src->xcrossing.y; + dst->xcrossing.x_root = src->xcrossing.x_root; + dst->xcrossing.y_root = src->xcrossing.y_root; + dst->xcrossing.mode = src->xcrossing.mode; + dst->xcrossing.detail = src->xcrossing.detail; + dst->xcrossing.same_screen = src->xcrossing.same_screen; + dst->xcrossing.focus = src->xcrossing.focus; + dst->xcrossing.state = src->xcrossing.state; + break; + case XEVT_FocusIn: + case XEVT_FocusOut: + dst->xfocus.mode = src->xfocus.mode; + dst->xfocus.detail = src->xfocus.detail; + break; + case XEVT_KeymapNotify: + memcpy(dst->xkeymap.key_vector, src->xkeymap.key_vector, 32); + break; + case XEVT_Expose: + dst->xexpose.x = src->xexpose.x; + dst->xexpose.y = src->xexpose.y; + dst->xexpose.width = src->xexpose.width; + dst->xexpose.height = src->xexpose.height; + dst->xexpose.count = src->xexpose.count; + break; + case XEVT_GraphicsExpose: + dst->xgraphicsexpose.x = src->xgraphicsexpose.x; + dst->xgraphicsexpose.y = src->xgraphicsexpose.y; + dst->xgraphicsexpose.width = src->xgraphicsexpose.width; + dst->xgraphicsexpose.height = src->xgraphicsexpose.height; + dst->xgraphicsexpose.count = src->xgraphicsexpose.count; + dst->xgraphicsexpose.major_code = src->xgraphicsexpose.major_code; + dst->xgraphicsexpose.minor_code = src->xgraphicsexpose.minor_code; + break; + case XEVT_NoExpose: + dst->xnoexpose.major_code = src->xnoexpose.major_code; + dst->xnoexpose.minor_code = src->xnoexpose.minor_code; + break; + case XEVT_VisibilityNotify: + dst->xvisibility.state = src->xvisibility.state; + break; + case XEVT_CreateNotify: + dst->xcreatewindow.window = to_ulong(src->xcreatewindow.window); + dst->xcreatewindow.x = src->xcreatewindow.x; + dst->xcreatewindow.y = src->xcreatewindow.y; + dst->xcreatewindow.width = src->xcreatewindow.width; + dst->xcreatewindow.height = src->xcreatewindow.height; + dst->xcreatewindow.border_width = src->xcreatewindow.border_width; + dst->xcreatewindow.override_redirect = src->xcreatewindow.override_redirect; + break; + case XEVT_DestroyNotify: + dst->xdestroywindow.window = to_ulong(src->xdestroywindow.window); + break; + case XEVT_UnmapNotify: + dst->xunmap.window = to_ulong(src->xunmap.window); + dst->xunmap.from_configure = src->xunmap.from_configure; + break; + case XEVT_MapNotify: + dst->xmap.window = to_ulong(src->xmap.window); + dst->xmap.override_redirect = src->xmap.override_redirect; + break; + case XEVT_MapRequest: + dst->xmaprequest.window = to_ulong(src->xmaprequest.window); + break; + case XEVT_ReparentNotify: + dst->xreparent.window = to_ulong(src->xreparent.window); + dst->xreparent.parent = to_ulong(src->xreparent.parent); + dst->xreparent.x = src->xreparent.x; + dst->xreparent.y = src->xreparent.y; + dst->xreparent.override_redirect = src->xreparent.override_redirect; + break; + case XEVT_ConfigureNotify: + dst->xconfigure.window = to_ulong(src->xconfigure.window); + dst->xconfigure.x = src->xconfigure.x; + dst->xconfigure.y = src->xconfigure.y; + dst->xconfigure.width = src->xconfigure.width; + dst->xconfigure.height = src->xconfigure.height; + dst->xconfigure.border_width = src->xconfigure.border_width; + dst->xconfigure.above = to_ulong(src->xconfigure.above); + dst->xconfigure.override_redirect = src->xconfigure.override_redirect; + break; + case XEVT_ConfigureRequest: + dst->xconfigurerequest.window = to_ulong(src->xconfigurerequest.window); + dst->xconfigurerequest.x = src->xconfigurerequest.x; + dst->xconfigurerequest.y = src->xconfigurerequest.y; + dst->xconfigurerequest.width = src->xconfigurerequest.width; + dst->xconfigurerequest.height = src->xconfigurerequest.height; + dst->xconfigurerequest.border_width = src->xconfigurerequest.border_width; + dst->xconfigurerequest.above = to_ulong(src->xconfigurerequest.above); + dst->xconfigurerequest.detail = src->xconfigurerequest.detail; + dst->xconfigurerequest.value_mask = to_ulong(src->xconfigurerequest.value_mask); + break; + case XEVT_GravityNotify: + dst->xgravity.window = to_ulong(src->xgravity.window); + dst->xgravity.x = src->xgravity.x; + dst->xgravity.y = src->xgravity.y; + break; + case XEVT_ResizeRequest: + dst->xresizerequest.width = src->xresizerequest.width; + dst->xresizerequest.height = src->xresizerequest.height; + break; + case XEVT_CirculateNotify: + dst->xcirculate.window = to_ulong(src->xcirculate.window); + dst->xcirculate.place = src->xcirculate.place; + break; + case XEVT_CirculateRequest: + dst->xcirculaterequest.window = to_ulong(src->xcirculaterequest.window); + dst->xcirculaterequest.place = src->xcirculaterequest.place; + break; + case XEVT_PropertyNotify: + dst->xproperty.atom = to_ulong(src->xproperty.atom); + dst->xproperty.time = to_ulong(src->xproperty.time); + dst->xproperty.state = src->xproperty.state; + break; + case XEVT_SelectionClear: + dst->xselectionclear.selection = to_ulong(src->xselectionclear.selection); + dst->xselectionclear.time = to_ulong(src->xselectionclear.time); + break; + case XEVT_SelectionRequest: + dst->xselectionrequest.requestor = to_ulong(src->xselectionrequest.requestor); + dst->xselectionrequest.selection = to_ulong(src->xselectionrequest.selection); + dst->xselectionrequest.target = to_ulong(src->xselectionrequest.target); + dst->xselectionrequest.property = to_ulong(src->xselectionrequest.property); + dst->xselectionrequest.time = to_ulong(src->xselectionrequest.time); + break; + case XEVT_SelectionNotify: + dst->xselection.selection = to_ulong(src->xselection.selection); + dst->xselection.target = to_ulong(src->xselection.target); + dst->xselection.property = to_ulong(src->xselection.property); + dst->xselection.time = to_ulong(src->xselection.time); + break; + case XEVT_ColormapNotify: + dst->xcolormap.colormap = to_ulong(src->xcolormap.colormap); + dst->xcolormap.c_new = src->xcolormap.c_new; + dst->xcolormap.state = src->xcolormap.state; + break; + case XEVT_ClientMessage: + dst->xclient.message_type = to_ulong(src->xclient.message_type); + dst->xclient.format = src->xclient.format; + if(src->xclient.format==32) + for(int i=0; i<5; ++i) { + if(((src->xclient.data.l[i]&0xffffffff80000000LL))==0xffffffff80000000LL) + dst->xclient.data.l[i] = to_ulong(src->xclient.data.l[i]&0xffffffff); // negative value... + else + dst->xclient.data.l[i] = to_ulong(src->xclient.data.l[i]); + } + else + memcpy(dst->xclient.data.b, src->xclient.data.b, 20); + break; + case XEVT_MappingNotify: + dst->xmapping.request = src->xmapping.request; + dst->xmapping.first_keycode = src->xmapping.first_keycode; + dst->xmapping.count = src->xmapping.count; + break; + case XEVT_GenericEvent: + dst->xcookie.extension = src->xcookie.extension; + dst->xcookie.evtype = src->xcookie.evtype; + dst->xcookie.cookie = src->xcookie.cookie; + dst->xcookie.data = to_ptrv_silent(src->xcookie.data); // in case data are not initialized + break; + default: { + register_events_t* head = register_events_head; + while(head) { + if((uint32_t)type>=head->start_event && (uint32_t)type<=head->end_event) { + for(size_t i=0; in; ++i) + if((uint32_t)type==head->events[i].event) { + head->events[i].to32(dst, src); + return; + } + } + head = head->next; + } + printf_log(LOG_INFO, "Warning, unsupported 32bits XEvent type=%d\n", type); + } + } +} +void unconvertXEvent(my_XEvent_t* dst, my_XEvent_32_t* src) +{ + if(!src->type) { + // This is an XErrorEvent, and it's different! + dst->xerror.type = src->xerror.type; + dst->xerror.display = getDisplay(from_ptrv(src->xerror.display)); + dst->xerror.resourceid = from_ulong(src->xerror.resourceid); + dst->xerror.serial = from_ulong(src->xerror.serial); + dst->xerror.error_code = src->xerror.error_code; + dst->xerror.request_code = src->xerror.request_code; + dst->xerror.minor_code = src->xerror.minor_code; + return; + } + // convert the XAnyEvent first, as it's a common set + int type = src->type; + dst->type = src->type; + if(type!=XEVT_GenericEvent) + dst->xany.window = from_ulong(src->xany.window); + dst->xany.display = getDisplay(from_ptrv(src->xany.display)); + dst->xany.send_event = src->xany.serial; + dst->xany.serial = from_ulong(src->xany.serial); + switch(type) { + case XEVT_KeyPress: + case XEVT_KeyRelease: + dst->xkey.root = from_ulong(src->xkey.root); + dst->xkey.subwindow = from_ulong(src->xkey.subwindow); + dst->xkey.time = from_ulong(src->xkey.time); + dst->xkey.x = src->xkey.x; + dst->xkey.y = src->xkey.y; + dst->xkey.x_root = src->xkey.x_root; + dst->xkey.y_root = src->xkey.y_root; + dst->xkey.state = src->xkey.state; + dst->xkey.keycode = src->xkey.keycode; + dst->xkey.same_screen = src->xkey.same_screen; + break; + case XEVT_ButtonPress: + case XEVT_ButtonRelease: + dst->xbutton.root = from_ulong(src->xbutton.root); + dst->xbutton.subwindow = from_ulong(src->xbutton.subwindow); + dst->xbutton.time = from_ulong(src->xbutton.time); + dst->xbutton.x = src->xbutton.x; + dst->xbutton.y = src->xbutton.y; + dst->xbutton.x_root = src->xbutton.x_root; + dst->xbutton.y_root = src->xbutton.y_root; + dst->xbutton.state = src->xbutton.state; + dst->xbutton.button = src->xbutton.button; + dst->xbutton.same_screen = src->xbutton.same_screen; + break; + case XEVT_MotionNotify: + dst->xmotion.root = from_ulong(src->xmotion.root); + dst->xmotion.subwindow = from_ulong(src->xmotion.subwindow); + dst->xmotion.time = from_ulong(src->xmotion.time); + dst->xmotion.x = src->xmotion.x; + dst->xmotion.y = src->xmotion.y; + dst->xmotion.x_root = src->xmotion.x_root; + dst->xmotion.y_root = src->xmotion.y_root; + dst->xmotion.state = src->xmotion.state; + dst->xmotion.is_hint = src->xmotion.is_hint; + dst->xmotion.same_screen = src->xmotion.same_screen; + break; + case XEVT_EnterNotify: + case XEVT_LeaveNotify: + dst->xcrossing.root = from_ulong(src->xcrossing.root); + dst->xcrossing.subwindow = from_ulong(src->xcrossing.subwindow); + dst->xcrossing.time = from_ulong(src->xcrossing.time); + dst->xcrossing.x = src->xcrossing.x; + dst->xcrossing.y = src->xcrossing.y; + dst->xcrossing.x_root = src->xcrossing.x_root; + dst->xcrossing.y_root = src->xcrossing.y_root; + dst->xcrossing.mode = src->xcrossing.mode; + dst->xcrossing.detail = src->xcrossing.detail; + dst->xcrossing.same_screen = src->xcrossing.same_screen; + dst->xcrossing.focus = src->xcrossing.focus; + dst->xcrossing.state = src->xcrossing.state; + break; + case XEVT_FocusIn: + case XEVT_FocusOut: + dst->xfocus.mode = src->xfocus.mode; + dst->xfocus.detail = src->xfocus.detail; + break; + case XEVT_KeymapNotify: + memcpy(dst->xkeymap.key_vector, src->xkeymap.key_vector, 32); + break; + case XEVT_Expose: + dst->xexpose.x = src->xexpose.x; + dst->xexpose.y = src->xexpose.y; + dst->xexpose.width = src->xexpose.width; + dst->xexpose.height = src->xexpose.height; + dst->xexpose.count = src->xexpose.count; + break; + case XEVT_GraphicsExpose: + dst->xgraphicsexpose.x = src->xgraphicsexpose.x; + dst->xgraphicsexpose.y = src->xgraphicsexpose.y; + dst->xgraphicsexpose.width = src->xgraphicsexpose.width; + dst->xgraphicsexpose.height = src->xgraphicsexpose.height; + dst->xgraphicsexpose.count = src->xgraphicsexpose.count; + dst->xgraphicsexpose.major_code = src->xgraphicsexpose.major_code; + dst->xgraphicsexpose.minor_code = src->xgraphicsexpose.minor_code; + break; + case XEVT_NoExpose: + dst->xnoexpose.major_code = src->xnoexpose.major_code; + dst->xnoexpose.minor_code = src->xnoexpose.minor_code; + break; + case XEVT_VisibilityNotify: + dst->xvisibility.state = src->xvisibility.state; + break; + case XEVT_CreateNotify: + dst->xcreatewindow.window = from_ulong(src->xcreatewindow.window); + dst->xcreatewindow.x = src->xcreatewindow.x; + dst->xcreatewindow.y = src->xcreatewindow.y; + dst->xcreatewindow.width = src->xcreatewindow.width; + dst->xcreatewindow.height = src->xcreatewindow.height; + dst->xcreatewindow.border_width = src->xcreatewindow.border_width; + dst->xcreatewindow.override_redirect = src->xcreatewindow.override_redirect; + break; + case XEVT_DestroyNotify: + dst->xdestroywindow.window = from_ulong(src->xdestroywindow.window); + break; + case XEVT_UnmapNotify: + dst->xunmap.window = from_ulong(src->xunmap.window); + dst->xunmap.from_configure = src->xunmap.from_configure; + break; + case XEVT_MapNotify: + dst->xmap.window = from_ulong(src->xmap.window); + dst->xmap.override_redirect = src->xmap.override_redirect; + break; + case XEVT_MapRequest: + dst->xmaprequest.window = from_ulong(src->xmaprequest.window); + break; + case XEVT_ReparentNotify: + dst->xreparent.window = from_ulong(src->xreparent.window); + dst->xreparent.parent = from_ulong(src->xreparent.parent); + dst->xreparent.x = src->xreparent.x; + dst->xreparent.y = src->xreparent.y; + dst->xreparent.override_redirect = src->xreparent.override_redirect; + break; + case XEVT_ConfigureNotify: + dst->xconfigure.window = from_ulong(src->xconfigure.window); + dst->xconfigure.x = src->xconfigure.x; + dst->xconfigure.y = src->xconfigure.y; + dst->xconfigure.width = src->xconfigure.width; + dst->xconfigure.height = src->xconfigure.height; + dst->xconfigure.border_width = src->xconfigure.border_width; + dst->xconfigure.above = from_ulong(src->xconfigure.above); + dst->xconfigure.override_redirect = src->xconfigure.override_redirect; + break; + case XEVT_ConfigureRequest: + dst->xconfigurerequest.window = from_ulong(src->xconfigurerequest.window); + dst->xconfigurerequest.x = src->xconfigurerequest.x; + dst->xconfigurerequest.y = src->xconfigurerequest.y; + dst->xconfigurerequest.width = src->xconfigurerequest.width; + dst->xconfigurerequest.height = src->xconfigurerequest.height; + dst->xconfigurerequest.border_width = src->xconfigurerequest.border_width; + dst->xconfigurerequest.above = from_ulong(src->xconfigurerequest.above); + dst->xconfigurerequest.detail = src->xconfigurerequest.detail; + dst->xconfigurerequest.value_mask = from_ulong(src->xconfigurerequest.value_mask); + break; + case XEVT_GravityNotify: + dst->xgravity.window = from_ulong(src->xgravity.window); + dst->xgravity.x = src->xgravity.x; + dst->xgravity.y = src->xgravity.y; + break; + case XEVT_ResizeRequest: + dst->xresizerequest.width = src->xresizerequest.width; + dst->xresizerequest.height = src->xresizerequest.height; + break; + case XEVT_CirculateNotify: + dst->xcirculate.window = from_ulong(src->xcirculate.window); + dst->xcirculate.place = src->xcirculate.place; + break; + case XEVT_CirculateRequest: + dst->xcirculaterequest.window = from_ulong(src->xcirculaterequest.window); + dst->xcirculaterequest.place = src->xcirculaterequest.place; + break; + case XEVT_PropertyNotify: + dst->xproperty.atom = from_ulong(src->xproperty.atom); + dst->xproperty.time = from_ulong(src->xproperty.time); + dst->xproperty.state = src->xproperty.state; + break; + case XEVT_SelectionClear: + dst->xselectionclear.selection = from_ulong(src->xselectionclear.selection); + dst->xselectionclear.time = from_ulong(src->xselectionclear.time); + break; + case XEVT_SelectionRequest: + dst->xselectionrequest.requestor = from_ulong(src->xselectionrequest.requestor); + dst->xselectionrequest.selection = from_ulong(src->xselectionrequest.selection); + dst->xselectionrequest.target = from_ulong(src->xselectionrequest.target); + dst->xselectionrequest.property = from_ulong(src->xselectionrequest.property); + dst->xselectionrequest.time = from_ulong(src->xselectionrequest.time); + break; + case XEVT_SelectionNotify: + dst->xselection.selection = from_ulong(src->xselection.selection); + dst->xselection.target = from_ulong(src->xselection.target); + dst->xselection.property = from_ulong(src->xselection.property); + dst->xselection.time = from_ulong(src->xselection.time); + break; + case XEVT_ColormapNotify: + dst->xcolormap.colormap = from_ulong(src->xcolormap.colormap); + dst->xcolormap.c_new = src->xcolormap.c_new; + dst->xcolormap.state = src->xcolormap.state; + break; + case XEVT_ClientMessage: + dst->xclient.message_type = from_ulong(src->xclient.message_type); + dst->xclient.format = src->xclient.format; + if(src->xclient.format==32) + for(int i=0; i<5; ++i) dst->xclient.data.l[i] = from_ulong(src->xclient.data.l[i]); + else + memcpy(dst->xclient.data.b, src->xclient.data.b, 20); + break; + case XEVT_MappingNotify: + dst->xmapping.request = src->xmapping.request; + dst->xmapping.first_keycode = src->xmapping.first_keycode; + dst->xmapping.count = src->xmapping.count; + break; + case XEVT_GenericEvent: + dst->xcookie.extension = src->xcookie.extension; + dst->xcookie.evtype = src->xcookie.evtype; + dst->xcookie.cookie = src->xcookie.cookie; + dst->xcookie.data = from_ptrv(src->xcookie.data); + break; + + default: { + register_events_t* head = register_events_head; + while(head) { + if((uint32_t)type>=head->start_event && (uint32_t)type<=head->end_event) { + for(size_t i=0; in; ++i) + if((uint32_t)type==head->events[i].event) { + head->events[i].to64(dst, src); + return; + } + } + head = head->next; + } + printf_log(LOG_INFO, "Warning, unsupported 32bits (un)XEvent type=%d\n", type); + } + } +} + +void inplace_XEventData_shring(my_XEvent_t* evt) +{ + if(!evt || evt->type!=XEVT_GenericEvent) + return; + if(my32_xinput_opcode && evt->xcookie.extension==my32_xinput_opcode) { + //XInput2 event + // convert Generic event 1st, as it's common + my_XIEvent_t *s = evt->xcookie.data; + my_XIEvent_32_t* d = evt->xcookie.data; + d->type = s->type; + d->serial = to_ulong(s->serial); + d->send_event = s->send_event; + d->display = to_ptrv(FindDisplay(s->display)); + d->extension = s->extension; + d->evtype = s->evtype; + d->time = to_ulong(s->time); + switch(evt->xcookie.evtype) { + case XI_DeviceChanged: { + my_XIDeviceChangedEvent_t* s = evt->xcookie.data; + my_XIDeviceChangedEvent_32_t* d = evt->xcookie.data; + d->deviceid = s->deviceid; + d->sourceid = s->sourceid; + d->reason = s->reason; + for(int j=0; jnum_classes; ++j) + ((ptr_t*)s->classes)[j] = to_ptrv(s->classes[j]); + d->num_classes = s->num_classes; + d->classes = to_ptrv(s->classes); + } + break; + case XI_KeyPress: + case XI_KeyRelease: + case XI_ButtonPress: + case XI_ButtonRelease: + case XI_Motion: + case XI_TouchBegin: + case XI_TouchUpdate: + case XI_TouchEnd: + { + my_XIDeviceEvent_t* s = evt->xcookie.data; + my_XIDeviceEvent_32_t* d = evt->xcookie.data; + d->deviceid = s->deviceid; + d->sourceid = s->sourceid; + d->detail = s->detail; + d->root = to_ulong(s->root); + d->event = to_ulong(s->event); + d->child = to_ulong(s->child); + d->root_x = s->root_x; + d->root_y = s->root_y; + d->event_x = s->event_x; + d->event_y = s->event_y; + d->flags = s->flags; + d->buttons.mask_len = s->buttons.mask_len; + d->buttons.mask = to_ptrv(s->buttons.mask); + d->valuators.mask_len = s->valuators.mask_len; + d->valuators.mask = to_ptrv(s->valuators.mask); + d->valuators.values = to_ptrv(s->valuators.values); + d->mods = s->mods; + d->group = s->group; + } + break; + case XI_Enter: + case XI_Leave: + case XI_FocusIn: + case XI_FocusOut: + { + my_XIEnterEvent_t* s = evt->xcookie.data; + my_XIEnterEvent_32_t* d = evt->xcookie.data; + d->deviceid = s->deviceid; + d->sourceid = s->sourceid; + d->detail = s->detail; + d->root = to_ulong(s->root); + d->event = to_ulong(s->event); + d->child = to_ulong(s->child); + d->root_x = s->root_x; + d->root_y = s->root_y; + d->event_x = s->event_x; + d->event_y = s->event_y; + d->mode = s->mode; + d->focus = s->focus; + d->same_screen = s->same_screen; + d->buttons.mask_len = s->buttons.mask_len; + d->buttons.mask = to_ptrv(s->buttons.mask); + d->mods = s->mods; + d->group = s->group; + } + break; + case XI_HierarchyChanged: { + my_XIHierarchyEvent_t* s = evt->xcookie.data; + my_XIHierarchyEvent_32_t* d = evt->xcookie.data; + d->flags = s->flags; + d->num_info = s->num_info; + d->info = to_ptrv(s->info); + } + break; + case XI_RawKeyPress: + case XI_RawKeyRelease: + case XI_RawButtonPress: + case XI_RawButtonRelease: + case XI_RawMotion: + case XI_RawTouchBegin: + case XI_RawTouchUpdate: + case XI_RawTouchEnd: + { + my_XIRawEvent_t* s = evt->xcookie.data; + my_XIRawEvent_32_t* d = evt->xcookie.data; + d->deviceid = s->deviceid; + d->sourceid = s->sourceid; + d->detail = s->detail; + d->flags = s->flags; + d->valuators.mask_len = s->valuators.mask_len; + d->valuators.mask = to_ptrv(s->valuators.mask); + d->valuators.values = to_ptrv(s->valuators.values); + d->raw_values = to_ptrv(s->raw_values); + } + break; + case XI_PropertyEvent: { + my_XIPropertyEvent_t* s = evt->xcookie.data; + my_XIPropertyEvent_32_t* d = evt->xcookie.data; + d->deviceid = s->deviceid; + d->property = to_ulong(s->property); + d->what = s->what; + } + break; + case XI_TouchOwnership: { + my_XITouchOwnershipEvent_t* s = evt->xcookie.data; + my_XITouchOwnershipEvent_32_t* d = evt->xcookie.data; + d->deviceid = s->deviceid; + d->sourceid = s->sourceid; + d->touchid = s->touchid; + d->root = to_ulong(s->root); + d->event = to_ulong(s->event); + d->child = to_ulong(s->child); + d->flags = s->flags; + } + break; + case XI_BarrierHit: + case XI_BarrierLeave: + { + my_XIBarrierEvent_t* s = evt->xcookie.data; + my_XIBarrierEvent_32_t* d = evt->xcookie.data; + d->deviceid = s->deviceid; + d->sourceid = s->sourceid; + d->event = to_ulong(s->event); + d->root = to_ulong(s->root); + d->root_x = s->root_x; + d->root_y = s->root_y; + d->dx = s->dx; + d->dy = s->dy; + d->dtime = s->dtime; + d->flags = s->flags; + d->barrier = to_ulong(s->barrier); + d->eventid = s->eventid; + } + break; + case XI_GesturePinchBegin: + case XI_GesturePinchUpdate: + case XI_GesturePinchEnd: + { + my_XIGesturePinchEvent_t* s = evt->xcookie.data; + my_XIGesturePinchEvent_32_t* d = evt->xcookie.data; + d->deviceid = s->deviceid; + d->sourceid = s->sourceid; + d->detail = s->detail; + d->root = to_ulong(s->root); + d->event = to_ulong(s->event); + d->child = to_ulong(s->child); + d->root_x = s->root_x; + d->root_y = s->root_y; + d->event_x = s->event_x; + d->event_y = s->event_y; + d->delta_x = s->delta_x; + d->delta_y = s->delta_y; + d->delta_unaccel_x = s->delta_unaccel_x; + d->delta_unaccel_y = s->delta_unaccel_y; + d->scale = s->scale; + d->delta_angle = s->delta_angle; + d->flags = s->flags; + d->mods = s->mods; + d->group = s->group; + } + break; + case XI_GestureSwipeBegin: + case XI_GestureSwipeUpdate: + case XI_GestureSwipeEnd: + { + my_XIGestureSwipeEvent_t* s = evt->xcookie.data; + my_XIGestureSwipeEvent_32_t* d = evt->xcookie.data; + d->deviceid = s->deviceid; + d->sourceid = s->sourceid; + d->detail = s->detail; + d->root = to_ulong(s->root); + d->event = to_ulong(s->event); + d->child = to_ulong(s->child); + d->root_x = s->root_x; + d->root_y = s->root_y; + d->event_x = s->event_x; + d->event_y = s->event_y; + d->delta_x = s->delta_x; + d->delta_y = s->delta_y; + d->delta_unaccel_x = s->delta_unaccel_x; + d->delta_unaccel_y = s->delta_unaccel_y; + d->flags = s->flags; + d->mods = s->mods; + d->group = s->group; + } + break; + default: + printf_log(LOG_INFO, "Warning, unsupported 32bits XIEvent type=%d\n", evt->xcookie.evtype); + break; + } + } +} +void inplace_XEventData_enlarge(my_XEvent_t* evt) +{ + if(!evt || evt->type!=XEVT_GenericEvent) + return; + if(my32_xinput_opcode && evt->xcookie.extension==my32_xinput_opcode) { + switch(evt->xcookie.evtype) { + case XI_DeviceChanged: { + my_XIDeviceChangedEvent_32_t* s = evt->xcookie.data; + my_XIDeviceChangedEvent_t* d = evt->xcookie.data; + d->classes = from_ptrv(s->classes); + d->num_classes = s->num_classes; + d->sourceid = s->sourceid; + d->deviceid = s->deviceid; + d->reason = s->reason; + for(int j=d->num_classes-1; j>=0; --j) + d->classes[j] = from_ptrv(((ptr_t*)d->classes)[j]); + } + break; + case XI_KeyPress: + case XI_KeyRelease: + case XI_ButtonPress: + case XI_ButtonRelease: + case XI_Motion: + case XI_TouchBegin: + case XI_TouchUpdate: + case XI_TouchEnd: + { + my_XIDeviceEvent_32_t* s = evt->xcookie.data; + my_XIDeviceEvent_t* d = evt->xcookie.data; + d->group = s->group; + d->mods = s->mods; + d->valuators.values = from_ptrv(s->valuators.values); + d->valuators.mask = from_ptrv(s->valuators.mask); + d->valuators.mask_len = s->valuators.mask_len; + d->buttons.mask = from_ptrv(s->buttons.mask); + d->buttons.mask_len = s->buttons.mask_len; + d->flags = s->flags; + d->event_y = s->event_y; + d->event_x = s->event_x; + d->root_y = s->root_y; + d->root_x = s->root_x; + d->child = from_ulong(s->child); + d->event = from_ulong(s->event); + d->root = from_ulong(s->root); + d->detail = s->detail; + d->sourceid = s->sourceid; + d->deviceid = s->deviceid; + } + break; + case XI_Enter: + case XI_Leave: + case XI_FocusIn: + case XI_FocusOut: + { + my_XIEnterEvent_32_t* s = evt->xcookie.data; + my_XIEnterEvent_t* d = evt->xcookie.data; + d->group = s->group; + d->mods = s->mods; + d->buttons.mask = from_ptrv(s->buttons.mask); + d->buttons.mask_len = s->buttons.mask_len; + d->same_screen = s->same_screen; + d->focus = s->focus; + d->mode = s->mode; + d->event_y = s->event_y; + d->event_x = s->event_x; + d->root_y = s->root_y; + d->root_x = s->root_x; + d->child = from_ulong(s->child); + d->event = from_ulong(s->event); + d->root = from_ulong(s->root); + d->detail = s->detail; + d->sourceid = s->sourceid; + d->deviceid = s->deviceid; + } + break; + case XI_HierarchyChanged: { + my_XIHierarchyEvent_32_t* s = evt->xcookie.data; + my_XIHierarchyEvent_t* d = evt->xcookie.data; + d->info = from_ptrv(s->info); + d->num_info = s->num_info; + d->flags = s->flags; + } + break; + case XI_RawKeyPress: + case XI_RawKeyRelease: + case XI_RawButtonPress: + case XI_RawButtonRelease: + case XI_RawMotion: + case XI_RawTouchBegin: + case XI_RawTouchUpdate: + case XI_RawTouchEnd: + { + my_XIRawEvent_32_t* s = evt->xcookie.data; + my_XIRawEvent_t* d = evt->xcookie.data; + d->raw_values = from_ptrv(s->raw_values); + d->valuators.values = from_ptrv(s->valuators.values); + d->valuators.mask = from_ptrv(s->valuators.mask); + d->valuators.mask_len = s->valuators.mask_len; + d->flags = s->flags; + d->detail = s->detail; + d->sourceid = s->sourceid; + d->deviceid = s->deviceid; + } + break; + case XI_PropertyEvent: { + my_XIPropertyEvent_32_t* s = evt->xcookie.data; + my_XIPropertyEvent_t* d = evt->xcookie.data; + d->what = s->what; + d->property = from_ulong(s->property); + d->deviceid = s->deviceid; + } + break; + case XI_TouchOwnership: { + my_XITouchOwnershipEvent_32_t* s = evt->xcookie.data; + my_XITouchOwnershipEvent_t* d = evt->xcookie.data; + d->flags = s->flags; + d->child = from_ulong(s->child); + d->event = from_ulong(s->event); + d->root = from_ulong(s->root); + d->touchid = s->touchid; + d->sourceid = s->sourceid; + d->deviceid = s->deviceid; + } + break; + case XI_BarrierHit: + case XI_BarrierLeave: + { + my_XIBarrierEvent_32_t* s = evt->xcookie.data; + my_XIBarrierEvent_t* d = evt->xcookie.data; + d->eventid = s->eventid; + d->barrier = from_ulong(s->barrier); + d->flags = s->flags; + d->dtime = s->dtime; + d->dy = s->dy; + d->dx = s->dx; + d->root_y = s->root_y; + d->root_x = s->root_x; + d->root = from_ulong(s->root); + d->event = from_ulong(s->event); + d->sourceid = s->sourceid; + d->deviceid = s->deviceid; + } + break; + case XI_GesturePinchBegin: + case XI_GesturePinchUpdate: + case XI_GesturePinchEnd: + { + my_XIGesturePinchEvent_32_t* s = evt->xcookie.data; + my_XIGesturePinchEvent_t* d = evt->xcookie.data; + d->group = s->group; + d->mods = s->mods; + d->flags = s->flags; + d->delta_angle = s->delta_angle; + d->scale = s->scale; + d->delta_unaccel_y = s->delta_unaccel_y; + d->delta_unaccel_x = s->delta_unaccel_x; + d->delta_y = s->delta_y; + d->delta_x = s->delta_x; + d->event_y = s->event_y; + d->event_x = s->event_x; + d->root_y = s->root_y; + d->root_x = s->root_x; + d->child = from_ulong(s->child); + d->event = from_ulong(s->event); + d->root = from_ulong(s->root); + d->detail = s->detail; + d->sourceid = s->sourceid; + d->deviceid = s->deviceid; + } + break; + case XI_GestureSwipeBegin: + case XI_GestureSwipeUpdate: + case XI_GestureSwipeEnd: + { + my_XIGestureSwipeEvent_32_t* s = evt->xcookie.data; + my_XIGestureSwipeEvent_t* d = evt->xcookie.data; + d->group = s->group; + d->mods = s->mods; + d->flags = s->flags; + d->delta_unaccel_y = s->delta_unaccel_y; + d->delta_unaccel_x = s->delta_unaccel_x; + d->delta_y = s->delta_y; + d->delta_x = s->delta_x; + d->event_y = s->event_y; + d->event_x = s->event_x; + d->root_y = s->root_y; + d->root_x = s->root_x; + d->child = from_ulong(s->child); + d->event = from_ulong(s->event); + d->root = from_ulong(s->root); + d->detail = s->detail; + d->sourceid = s->sourceid; + d->deviceid = s->deviceid; + } + break; + default: + printf_log(LOG_INFO, "Warning, unsupported 32bits (un)XIEvent type=%d\n", evt->xcookie.evtype); + break; + } + //XInput2 event + // convert Generic event last, as it's common and on top of the structure + my_XIEvent_32_t* s = evt->xcookie.data; + my_XIEvent_t *d = evt->xcookie.data; + d->time = from_ulong(s->time); + d->evtype = s->evtype; + d->extension = s->extension; + d->display = getDisplay(from_ptrv(s->display)); + d->send_event = s->send_event; + d->serial = from_ulong(s->serial); + d->type = s->type; + } +} + +void convert_XErrorEvent_to_32(void* d, void* s) +{ + my_XErrorEvent_t* src = s; + my_XErrorEvent_32_t* dst = d; + dst->type = src->type; + dst->display = to_ptrv(FindDisplay(src->display)); + dst->resourceid = to_ulong(src->resourceid); + dst->serial = to_ulong(src->serial); + dst->error_code = src->error_code; + dst->request_code = src->request_code; + dst->minor_code = src->minor_code; +} +void convert_XErrorEvent_to_64(void* d, void* s) +{ + my_XErrorEvent_32_t* src = s; + my_XErrorEvent_t* dst = d; + dst->minor_code = src->minor_code; + dst->request_code = src->request_code; + dst->error_code = src->error_code; + dst->serial = from_ulong(src->serial); + dst->resourceid = from_ulong(src->resourceid); + dst->display = getDisplay(from_ptrv(src->display)); + dst->type = src->type; +} + +void convert_XDeviceKeyEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XDeviceKeyEvent_t* src = (my_XDeviceKeyEvent_t*)s; + my_XDeviceKeyEvent_32_t* dst = (my_XDeviceKeyEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + dst->deviceid = to_ulong(src->deviceid); + dst->root = to_ulong(src->root); + dst->subwindow = to_ulong(src->subwindow); + dst->time = to_ulong(src->time); + dst->x = src->x; + dst->y = src->y; + dst->x_root = src->x_root; + dst->y_root = src->y_root; + dst->state = src->state; + dst->keycode = src->keycode; + dst->same_screen = src->same_screen; + dst->device_state = src->device_state; + dst->axes_count = src->axes_count; + dst->first_axis = src->first_axis; + dst->axis_data[0] = src->axis_data[0]; + dst->axis_data[1] = src->axis_data[1]; + dst->axis_data[2] = src->axis_data[2]; + dst->axis_data[3] = src->axis_data[3]; + dst->axis_data[4] = src->axis_data[4]; + dst->axis_data[5] = src->axis_data[5]; +} +void convert_XDeviceKeyEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XDeviceKeyEvent_32_t* src = (my_XDeviceKeyEvent_32_t*)s; + my_XDeviceKeyEvent_t* dst = (my_XDeviceKeyEvent_t*)d; + + dst->axis_data[5] = src->axis_data[5]; + dst->axis_data[4] = src->axis_data[4]; + dst->axis_data[3] = src->axis_data[3]; + dst->axis_data[2] = src->axis_data[2]; + dst->axis_data[1] = src->axis_data[1]; + dst->axis_data[0] = src->axis_data[0]; + dst->first_axis = src->first_axis; + dst->axes_count = src->axes_count; + dst->device_state = src->device_state; + dst->same_screen = src->same_screen; + dst->keycode = src->keycode; + dst->state = src->state; + dst->y_root = src->y_root; + dst->x_root = src->x_root; + dst->y = src->y; + dst->x = src->x; + dst->time = from_ulong(src->time); + dst->subwindow = from_ulong(src->subwindow); + dst->root = from_ulong(src->root); + dst->deviceid = from_ulong(src->deviceid); + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} +void convert_XDeviceMotionEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XDeviceMotionEvent_t* src = (my_XDeviceMotionEvent_t*)s; + my_XDeviceMotionEvent_32_t* dst = (my_XDeviceMotionEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + dst->deviceid = to_ulong(src->deviceid); + dst->root = to_ulong(src->root); + dst->subwindow = to_ulong(src->subwindow); + dst->time = to_ulong(src->time); + dst->x = src->x; + dst->y = src->y; + dst->x_root = src->x_root; + dst->y_root = src->y_root; + dst->state = src->state; + dst->is_hint = src->is_hint; + dst->same_screen = src->same_screen; + dst->device_state = src->device_state; + dst->axes_count = src->axes_count; + dst->first_axis = src->first_axis; + dst->axis_data[0] = src->axis_data[0]; + dst->axis_data[1] = src->axis_data[1]; + dst->axis_data[2] = src->axis_data[2]; + dst->axis_data[3] = src->axis_data[3]; + dst->axis_data[4] = src->axis_data[4]; + dst->axis_data[5] = src->axis_data[5]; +} +void convert_XDeviceMotionEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XDeviceMotionEvent_32_t* src = (my_XDeviceMotionEvent_32_t*)s; + my_XDeviceMotionEvent_t* dst = (my_XDeviceMotionEvent_t*)d; + + dst->axis_data[5] = src->axis_data[5]; + dst->axis_data[4] = src->axis_data[4]; + dst->axis_data[3] = src->axis_data[3]; + dst->axis_data[2] = src->axis_data[2]; + dst->axis_data[1] = src->axis_data[1]; + dst->axis_data[0] = src->axis_data[0]; + dst->first_axis = src->first_axis; + dst->axes_count = src->axes_count; + dst->device_state = src->device_state; + dst->same_screen = src->same_screen; + dst->is_hint = src->is_hint; + dst->state = src->state; + dst->y_root = src->y_root; + dst->x_root = src->x_root; + dst->y = src->y; + dst->x = src->x; + dst->time = from_ulong(src->time); + dst->subwindow = from_ulong(src->subwindow); + dst->root = from_ulong(src->root); + dst->deviceid = from_ulong(src->deviceid); + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} +void convert_XDeviceFocusEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XDeviceFocusChangeEvent_t* src = (my_XDeviceFocusChangeEvent_t*)s; + my_XDeviceFocusChangeEvent_32_t* dst = (my_XDeviceFocusChangeEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + dst->deviceid = to_ulong(src->deviceid); + dst->mode = src->mode; + dst->detail = src->detail; + dst->time = to_ulong(src->time); +} +void convert_XDeviceFocusEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XDeviceFocusChangeEvent_32_t* src = (my_XDeviceFocusChangeEvent_32_t*)s; + my_XDeviceFocusChangeEvent_t* dst = (my_XDeviceFocusChangeEvent_t*)d; + + dst->time = from_ulong(src->time); + dst->detail = src->detail; + dst->mode = src->mode; + dst->deviceid = from_ulong(src->deviceid); + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} +void convert_XProximityNotifyEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XProximityNotifyEvent_t* src = (my_XProximityNotifyEvent_t*)s; + my_XProximityNotifyEvent_32_t* dst = (my_XProximityNotifyEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + dst->deviceid = to_ulong(src->deviceid); + dst->root = to_ulong(src->root); + dst->subwindow = to_ulong(src->subwindow); + dst->time = to_ulong(src->time); + dst->x = src->x; + dst->y = src->y; + dst->x_root = src->x_root; + dst->y_root = src->y_root; + dst->state = src->state; + dst->same_screen = src->same_screen; + dst->device_state = src->device_state; + dst->axes_count = src->axes_count; + dst->first_axis = src->first_axis; + dst->axis_data[0] = src->axis_data[0]; + dst->axis_data[1] = src->axis_data[1]; + dst->axis_data[2] = src->axis_data[2]; + dst->axis_data[3] = src->axis_data[3]; + dst->axis_data[4] = src->axis_data[4]; + dst->axis_data[5] = src->axis_data[5]; +} +void convert_XProximityNotifyEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XProximityNotifyEvent_32_t* src = (my_XProximityNotifyEvent_32_t*)s; + my_XProximityNotifyEvent_t* dst = (my_XProximityNotifyEvent_t*)d; + + dst->axis_data[5] = src->axis_data[5]; + dst->axis_data[4] = src->axis_data[4]; + dst->axis_data[3] = src->axis_data[3]; + dst->axis_data[2] = src->axis_data[2]; + dst->axis_data[1] = src->axis_data[1]; + dst->axis_data[0] = src->axis_data[0]; + dst->first_axis = src->first_axis; + dst->axes_count = src->axes_count; + dst->device_state = src->device_state; + dst->same_screen = src->same_screen; + dst->state = src->state; + dst->y_root = src->y_root; + dst->x_root = src->x_root; + dst->y = src->y; + dst->x = src->x; + dst->time = from_ulong(src->time); + dst->subwindow = from_ulong(src->subwindow); + dst->root = from_ulong(src->root); + dst->deviceid = from_ulong(src->deviceid); + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} +void convert_XDeviceStateNotifyEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XDeviceStateNotifyEvent_t* src = (my_XDeviceStateNotifyEvent_t*)s; + my_XDeviceStateNotifyEvent_32_t* dst = (my_XDeviceStateNotifyEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + dst->deviceid = to_ulong(src->deviceid); + dst->time = to_ulong(src->time); + memmove(dst->data, src->data, 64); +} +void convert_XDeviceStateNotifyEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XDeviceStateNotifyEvent_32_t* src = (my_XDeviceStateNotifyEvent_32_t*)s; + my_XDeviceStateNotifyEvent_t* dst = (my_XDeviceStateNotifyEvent_t*)d; + + memmove(dst->data, src->data, 64); + dst->time = from_ulong(src->time); + dst->deviceid = from_ulong(src->deviceid); + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} +void convert_XDeviceMappingEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XDeviceMappingEvent_t* src = (my_XDeviceMappingEvent_t*)s; + my_XDeviceMappingEvent_32_t* dst = (my_XDeviceMappingEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + dst->deviceid = to_ulong(src->deviceid); + dst->time = to_ulong(src->time); + dst->request = src->request; + dst->first_keycode = src->first_keycode; + dst->count = src->count; +} +void convert_XDeviceMappingEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XDeviceMappingEvent_32_t* src = (my_XDeviceMappingEvent_32_t*)s; + my_XDeviceMappingEvent_t* dst = (my_XDeviceMappingEvent_t*)d; + + dst->count = src->count; + dst->first_keycode = src->first_keycode; + dst->request = src->request; + dst->time = from_ulong(src->time); + dst->deviceid = from_ulong(src->deviceid); + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} +void convert_XChangeDeviceNotifyEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XChangeDeviceNotifyEvent_t* src = (my_XChangeDeviceNotifyEvent_t*)s; + my_XChangeDeviceNotifyEvent_32_t* dst = (my_XChangeDeviceNotifyEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + dst->deviceid = to_ulong(src->deviceid); + dst->time = to_ulong(src->time); + dst->request = src->request; +} +void convert_XChangeDeviceNotifyEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XChangeDeviceNotifyEvent_32_t* src = (my_XChangeDeviceNotifyEvent_32_t*)s; + my_XChangeDeviceNotifyEvent_t* dst = (my_XChangeDeviceNotifyEvent_t*)d; + + dst->request = src->request; + dst->time = from_ulong(src->time); + dst->deviceid = from_ulong(src->deviceid); + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} +void convert_XDevicePresenceNotifyEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XDevicePresenceNotifyEvent_t* src = (my_XDevicePresenceNotifyEvent_t*)s; + my_XDevicePresenceNotifyEvent_32_t* dst = (my_XDevicePresenceNotifyEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + dst->time = to_ulong(src->time); + dst->devchange = src->devchange; + dst->deviceid = to_ulong(src->deviceid); + dst->control = to_ulong(src->control); +} +void convert_XDevicePresenceNotifyEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XDevicePresenceNotifyEvent_32_t* src = (my_XDevicePresenceNotifyEvent_32_t*)s; + my_XDevicePresenceNotifyEvent_t* dst = (my_XDevicePresenceNotifyEvent_t*)d; + + dst->control = from_ulong(src->control); + dst->deviceid = from_ulong(src->deviceid); + dst->devchange = src->devchange; + dst->time = from_ulong(src->time); + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} +void convert_XDevicePropertyNotifyEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XDevicePropertyNotifyEvent_t* src = (my_XDevicePropertyNotifyEvent_t*)s; + my_XDevicePropertyNotifyEvent_32_t* dst = (my_XDevicePropertyNotifyEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + dst->time = to_ulong(src->time); + dst->deviceid = to_ulong(src->deviceid); + dst->atom = to_ulong(src->atom); + dst->state = src->state; +} +void convert_XDevicePropertyNotifyEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XDevicePropertyNotifyEvent_32_t* src = (my_XDevicePropertyNotifyEvent_32_t*)s; + my_XDevicePropertyNotifyEvent_t* dst = (my_XDevicePropertyNotifyEvent_t*)d; + + dst->state = src->state; + dst->atom = from_ulong(src->atom); + dst->deviceid = from_ulong(src->deviceid); + dst->time = from_ulong(src->time); + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} +void register_XDevice_events(my_XDevice_t* a) +{ + if(!a) return; + // search if device is already in list + register_events_t* head = register_events_head; + while(head) { + if(head->id == a) + return; // found, nothing to do.... + head = head->next; + } + // counts events + int n=0; + for(int i=0; inum_classes; ++i) + switch(a->classes[i].input_class) { + case 0: n+=2; break; //KeyClass + case 1: n+=2; break; //ButtonClass + case 2: n+=1; break; //ValuatorClass + case 5: n+=2; break; //FocusClass + case 4: n+=2; break; //ProximityClass + case 6: n+=4; break; //OtherClass + } + // check if there is something to notify + if(!n) return; + // create a new event list + register_events_t* events = box_malloc(sizeof(register_events_t)+n*sizeof(reg_event_t)); + events->id = a; + events->n = n; + events->events = (reg_event_t*)(events+1); + n = 0; + for(int i=0; inum_classes; ++i) { + switch(a->classes[i].input_class) { + case 0: //KeyClass + events->events[n].event = a->classes[i].event_type_base+0; + events->events[n].to32 = convert_XDeviceKeyEvent_to_32; + events->events[n].to64 = convert_XDeviceKeyEvent_to_64; + ++n; + events->events[n].event = a->classes[i].event_type_base+1; + events->events[n].to32 = convert_XDeviceKeyEvent_to_32; + events->events[n].to64 = convert_XDeviceKeyEvent_to_64; + ++n; + break; + case 1: //ButtonClass + events->events[n].event = a->classes[i].event_type_base+0; + events->events[n].to32 = convert_XDeviceKeyEvent_to_32; + events->events[n].to64 = convert_XDeviceKeyEvent_to_64; + ++n; + events->events[n].event = a->classes[i].event_type_base+1; + events->events[n].to32 = convert_XDeviceKeyEvent_to_32; + events->events[n].to64 = convert_XDeviceKeyEvent_to_64; + ++n; + break; + case 2: //ValuatorClass + events->events[n].event = a->classes[i].event_type_base+0; + events->events[n].to32 = convert_XDeviceMotionEvent_to_32; + events->events[n].to64 = convert_XDeviceMotionEvent_to_64; + ++n; + break; + case 5: //FocusClass + events->events[n].event = a->classes[i].event_type_base+0; + events->events[n].to32 = convert_XDeviceFocusEvent_to_32; + events->events[n].to64 = convert_XDeviceFocusEvent_to_64; + ++n; + events->events[n].event = a->classes[i].event_type_base+1; + events->events[n].to32 = convert_XDeviceFocusEvent_to_32; + events->events[n].to64 = convert_XDeviceFocusEvent_to_64; + ++n; + break; + case 4: //ProximityClass + events->events[n].event = a->classes[i].event_type_base+0; + events->events[n].to32 = convert_XProximityNotifyEvent_to_32; + events->events[n].to64 = convert_XProximityNotifyEvent_to_64; + ++n; + events->events[n].event = a->classes[i].event_type_base+1; + events->events[n].to32 = convert_XProximityNotifyEvent_to_32; + events->events[n].to64 = convert_XProximityNotifyEvent_to_64; + ++n; + break; + case 6: //OtherClass + events->events[n].event = a->classes[i].event_type_base+0; + events->events[n].to32 = convert_XDeviceStateNotifyEvent_to_32; + events->events[n].to64 = convert_XDeviceStateNotifyEvent_to_64; + ++n; + events->events[n].event = a->classes[i].event_type_base+1; + events->events[n].to32 = convert_XDeviceMappingEvent_to_32; + events->events[n].to64 = convert_XDeviceMappingEvent_to_64; + ++n; + events->events[n].event = a->classes[i].event_type_base+2; + events->events[n].to32 = convert_XChangeDeviceNotifyEvent_to_32; + events->events[n].to64 = convert_XChangeDeviceNotifyEvent_to_64; + ++n; + //+3 would be DeviceKeyStateNotify + //+4 wpuld be DeviceButtonStateNotify + //+5 would be DevicePresenceNotify + events->events[n].event = a->classes[i].event_type_base+6; + events->events[n].to32 = convert_XDevicePropertyNotifyEvent_to_32; + events->events[n].to64 = convert_XDevicePropertyNotifyEvent_to_64; + ++n; + break; + } + } + events->start_event = events->end_event = events->events[0].event; + for(int i=1; istart_event>events->events[i].event) events->start_event = events->events[i].event; + if(events->end_eventevents[i].event) events->end_event = events->events[i].event; + } + events->next = register_events_head; + register_events_head = events; +} +void unregister_XDevice_events(my_XDevice_t* a) +{ + if(!a) return; + register_events_t* prev = NULL; + register_events_t* head = register_events_head; + while(head) { + if(head->id == a) { + if(!prev) + register_events_head = head->next; + else + prev->next = head->next; + box_free(head); + return; + } + prev = head; + head = head->next; + } +} + +void convert_XFixesSelectionNotifyEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XFixesSelectionNotifyEvent_t* src = (my_XFixesSelectionNotifyEvent_t*)s; + my_XFixesSelectionNotifyEvent_32_t* dst = (my_XFixesSelectionNotifyEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + dst->subtype = src->subtype; + dst->owner = to_ulong(src->owner); + dst->selection = to_ulong(src->selection); + dst->timestamp = to_ulong(src->timestamp); + dst->selection_timestamp = to_ulong(src->selection_timestamp); +} +void convert_XFixesSelectionNotifyEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XFixesSelectionNotifyEvent_32_t* src = (my_XFixesSelectionNotifyEvent_32_t*)s; + my_XFixesSelectionNotifyEvent_t* dst = (my_XFixesSelectionNotifyEvent_t*)d; + + dst->selection_timestamp = from_ulong(src->selection_timestamp); + dst->timestamp = from_ulong(src->timestamp); + dst->selection = from_ulong(src->selection); + dst->owner = from_ulong(src->owner); + dst->subtype = src->subtype; + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} +void convert_XFixesCursorNotifyEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XFixesCursorNotifyEvent_t* src = (my_XFixesCursorNotifyEvent_t*)s; + my_XFixesCursorNotifyEvent_32_t* dst = (my_XFixesCursorNotifyEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + dst->subtype = src->subtype; + dst->cursor_serial = to_ulong(src->cursor_serial); + dst->timestamp = to_ulong(src->timestamp); + dst->cursor_name = to_ulong(src->cursor_name); +} +void convert_XFixesCursorNotifyEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XFixesCursorNotifyEvent_32_t* src = (my_XFixesCursorNotifyEvent_32_t*)s; + my_XFixesCursorNotifyEvent_t* dst = (my_XFixesCursorNotifyEvent_t*)d; + + dst->cursor_serial = from_ulong(src->cursor_serial); + dst->timestamp = from_ulong(src->timestamp); + dst->cursor_name = from_ulong(src->cursor_name); + dst->subtype = src->subtype; + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} + +#define XFIXES (void*)1LL + +void register_XFixes_events(int event_base) +{ + // search if device is already in list + register_events_t* head = register_events_head; + while(head) { + if(head->id == XFIXES) + return; // found, nothing to do.... + head = head->next; + } + int n = 2; // 2 events to register! + // create a new event list + register_events_t* events = box_malloc(sizeof(register_events_t)+n*sizeof(reg_event_t)); + events->id = XFIXES; + events->n = n; + events->events = (reg_event_t*)(events+1); + + events->events[0].event = event_base+0; + events->events[0].to32 = convert_XFixesSelectionNotifyEvent_to_32; + events->events[0].to64 = convert_XFixesSelectionNotifyEvent_to_64; + events->events[1].event = event_base+1; + events->events[1].to32 = convert_XFixesCursorNotifyEvent_to_32; + events->events[1].to64 = convert_XFixesCursorNotifyEvent_to_64; + + events->start_event = events->events[0].event; + events->end_event = events->events[1].event; + events->next = register_events_head; + register_events_head = events; +} +void unregister_XFixes_events() +{ + register_events_t* prev = NULL; + register_events_t* head = register_events_head; + while(head) { + if(head->id == XFIXES) { + if(!prev) + register_events_head = head->next; + else + prev->next = head->next; + box_free(head); + return; + } + prev = head; + head = head->next; + } +} + +void convert_XRRScreenChangeNotifyEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XRRScreenChangeNotifyEvent_t* src = (my_XRRScreenChangeNotifyEvent_t*)s; + my_XRRScreenChangeNotifyEvent_32_t* dst = (my_XRRScreenChangeNotifyEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + dst->root = to_ulong(src->root); + dst->timestamp = to_ulong(src->timestamp); + dst->config_timestamp = to_ulong(src->config_timestamp); + dst->size_index = src->size_index; + dst->subpixel_order = src->subpixel_order; + dst->rotation = src->rotation; + dst->width = src->width; + dst->height = src->height; + dst->mwidth = src->mwidth; + dst->mheight = src->mheight; +} +void convert_XRRScreenChangeNotifyEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XRRScreenChangeNotifyEvent_32_t* src = (my_XRRScreenChangeNotifyEvent_32_t*)s; + my_XRRScreenChangeNotifyEvent_t* dst = (my_XRRScreenChangeNotifyEvent_t*)d; + + dst->mheight = src->mheight; + dst->mwidth = src->mwidth; + dst->height = src->height; + dst->width = src->width; + dst->rotation = src->rotation; + dst->subpixel_order = src->subpixel_order; + dst->size_index = src->size_index; + dst->config_timestamp = from_ulong(src->config_timestamp); + dst->timestamp = from_ulong(src->timestamp); + dst->root = from_ulong(src->root); + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} +void convert_XRRNotifyEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XRRNotifyEvent_t* src = (my_XRRNotifyEvent_t*)s; + my_XRRNotifyEvent_32_t* dst = (my_XRRNotifyEvent_32_t*)d; + + //dst->type = src->type; + //dst->serial = src->serial; + //dst->send_event = src->send_event; + //dst->display = src->display; + //dst->window = src->window; + int subtype = src->subtype; + dst->subtype = src->subtype; + switch (subtype) { + case 0: { + my_XRROutputChangeNotifyEvent_t* src = (my_XRROutputChangeNotifyEvent_t*)s; + my_XRROutputChangeNotifyEvent_32_t* dst = (my_XRROutputChangeNotifyEvent_32_t*)d; + dst->output = to_long(src->output); + dst->crtc = to_long(src->crtc); + dst->mode = to_long(src->mode); + dst->rotation = src->rotation; + dst->connection = src->connection; + dst->subpixel_order = src->subpixel_order; + } break; + case 1: { + my_XRRCrtcChangeNotifyEvent_t* src = (my_XRRCrtcChangeNotifyEvent_t*)s; + my_XRRCrtcChangeNotifyEvent_32_t* dst = (my_XRRCrtcChangeNotifyEvent_32_t*)d; + dst->crtc = to_ulong(src->crtc); + dst->mode = to_ulong(src->mode); + dst->rotation = src->rotation; + dst->x = src->x; + dst->y = src->y; + dst->width = src->width; + dst->height = src->height; + } break; + case 2: { + my_XRROutputPropertyNotifyEvent_t* src = (my_XRROutputPropertyNotifyEvent_t*)s; + my_XRROutputPropertyNotifyEvent_32_t* dst = (my_XRROutputPropertyNotifyEvent_32_t*)d; + dst->output = to_ulong(src->output); + dst->property = to_ulong(src->property); + dst->timestamp = to_ulong(src->timestamp); + dst->state = src->state; + } break; + case 3: { + my_XRRProviderChangeNotifyEvent_t* src = (my_XRRProviderChangeNotifyEvent_t*)s; + my_XRRProviderChangeNotifyEvent_32_t* dst = (my_XRRProviderChangeNotifyEvent_32_t*)d; + dst->provider = to_ulong(src->provider); + dst->timestamp = to_ulong(src->timestamp); + dst->current_role = src->current_role; + } break; + case 4: { + my_XRRProviderPropertyNotifyEvent_t* src = (my_XRRProviderPropertyNotifyEvent_t*)s; + my_XRRProviderPropertyNotifyEvent_32_t* dst = (my_XRRProviderPropertyNotifyEvent_32_t*)d; + dst->provider = to_ulong(src->provider); + dst->property = to_ulong(src->property); + dst->timestamp = to_ulong(src->timestamp); + dst->state = src->state; + } break; + case 5: { + my_XRRResourceChangeNotifyEvent_t* src = (my_XRRResourceChangeNotifyEvent_t*)s; + my_XRRResourceChangeNotifyEvent_32_t* dst = (my_XRRResourceChangeNotifyEvent_32_t*)d; + dst->timestamp = to_ulong(src->timestamp); + } break; + } +} +void convert_XRRNotifyEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XRRNotifyEvent_32_t* src = (my_XRRNotifyEvent_32_t*)s; + my_XRRNotifyEvent_t* dst = (my_XRRNotifyEvent_t*)d; + int subtype = src->subtype; + switch (subtype) { + case 0: { + my_XRROutputChangeNotifyEvent_32_t* src = (my_XRROutputChangeNotifyEvent_32_t*)s; + my_XRROutputChangeNotifyEvent_t* dst = (my_XRROutputChangeNotifyEvent_t*)d; + dst->output = from_long(src->output); + dst->crtc = from_long(src->crtc); + dst->mode = from_long(src->mode); + dst->rotation = src->rotation; + dst->connection = src->connection; + dst->subpixel_order = src->subpixel_order; + } break; + case 1: { + my_XRRCrtcChangeNotifyEvent_32_t* src = (my_XRRCrtcChangeNotifyEvent_32_t*)s; + my_XRRCrtcChangeNotifyEvent_t* dst = (my_XRRCrtcChangeNotifyEvent_t*)d; + dst->crtc = from_ulong(src->crtc); + dst->mode = from_ulong(src->mode); + dst->rotation = src->rotation; + dst->x = src->x; + dst->y = src->y; + dst->width = src->width; + dst->height = src->height; + } break; + case 2: { + my_XRROutputPropertyNotifyEvent_32_t* src = (my_XRROutputPropertyNotifyEvent_32_t*)s; + my_XRROutputPropertyNotifyEvent_t* dst = (my_XRROutputPropertyNotifyEvent_t*)d; + dst->output = from_ulong(src->output); + dst->property = from_ulong(src->property); + dst->timestamp = from_ulong(src->timestamp); + dst->state = src->state; + } break; + case 3: { + my_XRRProviderChangeNotifyEvent_32_t* src = (my_XRRProviderChangeNotifyEvent_32_t*)s; + my_XRRProviderChangeNotifyEvent_t* dst = (my_XRRProviderChangeNotifyEvent_t*)d; + dst->provider = from_ulong(src->provider); + dst->timestamp = from_ulong(src->timestamp); + dst->current_role = src->current_role; + } break; + case 4: { + my_XRRProviderPropertyNotifyEvent_32_t* src = (my_XRRProviderPropertyNotifyEvent_32_t*)s; + my_XRRProviderPropertyNotifyEvent_t* dst = (my_XRRProviderPropertyNotifyEvent_t*)d; + dst->provider = from_ulong(src->provider); + dst->property = from_ulong(src->property); + dst->timestamp = from_ulong(src->timestamp); + dst->state = src->state; + } break; + case 5: { + my_XRRResourceChangeNotifyEvent_32_t* src = (my_XRRResourceChangeNotifyEvent_32_t*)s; + my_XRRResourceChangeNotifyEvent_t* dst = (my_XRRResourceChangeNotifyEvent_t*)d; + dst->timestamp = from_ulong(src->timestamp); + } break; + } + dst->subtype = src->subtype; + //dst->window = src->window; + //dst->display = src->display; + //dst->send_event = src->send_event; + //dst->serial = src->serial; + //dst->type = src->type; +} + +void register_XRandR_events(int event_base) +{ + void* a = (void*)2LL; + // search if device is already in list + register_events_t* head = register_events_head; + while(head) { + if(head->id == a) + return; // found, nothing to do.... + head = head->next; + } + int n = 2; // 2 events to register!, but second one as 6+1 subtypes + // create a new event list + register_events_t* events = box_malloc(sizeof(register_events_t)+n*sizeof(reg_event_t)); + events->id = a; + events->n = n; + events->events = (reg_event_t*)(events+1); + + events->events[0].event = event_base+0; + events->events[0].to32 = convert_XRRScreenChangeNotifyEvent_to_32; + events->events[0].to64 = convert_XRRScreenChangeNotifyEvent_to_64; + events->events[1].event = event_base+1; + events->events[1].to32 = convert_XRRNotifyEvent_to_32; + events->events[1].to64 = convert_XRRNotifyEvent_to_64; + + events->start_event = events->events[0].event; + events->end_event = events->events[1].event; + events->next = register_events_head; + register_events_head = events; +} + +void unregister_XRandR_events() +{ + void* a = (void*)2LL; + register_events_t* prev = NULL; + register_events_t* head = register_events_head; + while(head) { + if(head->id == a) { + if(!prev) + register_events_head = head->next; + else + prev->next = head->next; + box_free(head); + return; + } + prev = head; + head = head->next; + } +} + +void convert_XkbEvent_to_32(my_XEvent_32_t* d, my_XEvent_t* s) +{ + my_XkbEvent_t* src = (my_XkbEvent_t*)s; + my_XkbEvent_32_t* dst = (my_XkbEvent_32_t*)d; + // convert XkbAnyEvent first, as it's the common part + int subtype = src->any.xkb_type; + //dst->any.type = src->any.type; + //dst->any.serial = src->any.serial; + //dst->any.send_event = src->any.send_event; + //dst->any.display = src->any.display; + dst->any.time = to_ulong(src->any.time); + dst->any.xkb_type = src->any.xkb_type; + dst->any.device = src->any.device; + // only XkbBellNotifyEvent need special conversion + switch(subtype) { + case 8: + dst->bell.percent = src->bell.percent; + dst->bell.pitch = src->bell.pitch; + dst->bell.duration = src->bell.duration; + dst->bell.bell_class = src->bell.bell_class; + dst->bell.bell_id = src->bell.bell_id; + dst->bell.name = to_ulong(src->bell.name); + dst->bell.window = to_ulong(src->bell.window); + dst->bell.event_only = src->bell.event_only; + break; + default: + memcpy(&dst->any.device, &src->any.device, sizeof(my_XkbEvent_32_t)-offsetof(my_XkbEvent_32_t, any.device)); + break; + } +} + +void convert_XkbEvent_to_64(my_XEvent_t* d, my_XEvent_32_t* s) +{ + my_XkbEvent_32_t* src = (my_XkbEvent_32_t*)s; + my_XkbEvent_t* dst = (my_XkbEvent_t*)d; + // convert XkbAnyEvent first, as it's the common part + int subtype = src->any.xkb_type; + //dst->any.type = src->any.type; + //dst->any.serial = src->any.serial; + //dst->any.send_event = src->any.send_event; + //dst->any.display = src->any.display; + dst->any.time = from_ulong(src->any.time); + dst->any.xkb_type = src->any.xkb_type; + dst->any.device = src->any.device; + // only XkbBellNotifyEvent need special conversion + switch(subtype) { + case 8: + dst->bell.percent = src->bell.percent; + dst->bell.pitch = src->bell.pitch; + dst->bell.duration = src->bell.duration; + dst->bell.bell_class = src->bell.bell_class; + dst->bell.bell_id = src->bell.bell_id; + dst->bell.name = from_ulong(src->bell.name); + dst->bell.window = from_ulong(src->bell.window); + dst->bell.event_only = src->bell.event_only; + break; + default: + memcpy(&dst->any.device, &src->any.device, sizeof(my_XkbEvent_t)-offsetof(my_XkbEvent_t, any.device)); + break; + } +} + +#define XKB (void*)3LL + +void register_Xkb_events(int event_base) +{ + // search if device is already in list + register_events_t* head = register_events_head; + while(head) { + if(head->id == XKB) + return; // found, nothing to do.... + head = head->next; + } + int n = 1; // 1 event to register!, but there are 12 subevent actualy + // create a new event list + register_events_t* events = box_malloc(sizeof(register_events_t)+n*sizeof(reg_event_t)); + events->id = XKB; + events->n = n; + events->events = (reg_event_t*)(events+1); + + events->events[0].event = event_base+0; + events->events[0].to32 = convert_XkbEvent_to_32; + events->events[0].to64 = convert_XkbEvent_to_64; + + events->start_event = events->events[0].event; + events->end_event = events->events[0].event; + events->next = register_events_head; + register_events_head = events; +} + +void unregister_Xkb_events() +{ + register_events_t* prev = NULL; + register_events_t* head = register_events_head; + while(head) { + if(head->id == XKB) { + if(!prev) + register_events_head = head->next; + else + prev->next = head->next; + box_free(head); + return; + } + prev = head; + head = head->next; + } +} diff --git a/src/libtools/my_xcb_defs.h b/src/libtools/my_xcb_defs.h new file mode 100644 index 0000000..997f02c --- /dev/null +++ b/src/libtools/my_xcb_defs.h @@ -0,0 +1,114 @@ +#include +#include + +#define MUTEX_SIZE_X64 40 +typedef struct my_xcb_ext_s { + pthread_mutex_t lock; + struct lazyreply *extensions; + int extensions_size; +} my_xcb_ext_t; + +typedef struct x64_xcb_ext_s { + uint8_t lock[MUTEX_SIZE_X64]; + struct lazyreply *extensions; + int extensions_size; +} x64_xcb_ext_t; + +typedef struct my_xcb_xid_s { + pthread_mutex_t lock; + uint32_t last; + uint32_t base; + uint32_t max; + uint32_t inc; +} my_xcb_xid_t; + +typedef struct x64_xcb_xid_s { + uint8_t lock[MUTEX_SIZE_X64]; + uint32_t last; + uint32_t base; + uint32_t max; + uint32_t inc; +} x64_xcb_xid_t; + +typedef struct my_xcb_fd_s { + int fd[16]; + int nfd; + int ifd; +} my_xcb_fd_t; + +typedef struct my_xcb_in_s { + pthread_cond_t event_cond; + int reading; + char queue[4096]; + int queue_len; + uint64_t request_expected; + uint64_t request_read; + uint64_t request_completed; + struct reply_list *current_reply; + struct reply_list **current_reply_tail; + void* replies; + struct event_list *events; + struct event_list **events_tail; + struct reader_list *readers; + struct special_list *special_waiters; + struct pending_reply *pending_replies; + struct pending_reply **pending_replies_tail; + my_xcb_fd_t in_fd; + struct xcb_special_event *special_events; +} my_xcb_in_t; + +typedef struct x64_xcb_out_s { + pthread_cond_t cond; + int writing; + pthread_cond_t socket_cond; + void (*return_socket)(void *closure); + void *socket_closure; + int socket_moving; + char queue[16384]; + int queue_len; + uint64_t request; + uint64_t request_written; + uint8_t reqlenlock[MUTEX_SIZE_X64]; + int maximum_request_length_tag; + uint32_t maximum_request_length; + my_xcb_fd_t out_fd; +} x64_xcb_out_t; + +typedef struct my_xcb_out_s { + pthread_cond_t cond; + int writing; + pthread_cond_t socket_cond; + void (*return_socket)(void *closure); + void *socket_closure; + int socket_moving; + char queue[16384]; + int queue_len; + uint64_t request; + uint64_t request_written; + pthread_mutex_t reqlenlock; + int maximum_request_length_tag; + uint32_t maximum_request_length; + my_xcb_fd_t out_fd; +} my_xcb_out_t; + +typedef struct my_xcb_connection_s { + int has_error; + void *setup; + int fd; + pthread_mutex_t iolock; + my_xcb_in_t in; + my_xcb_out_t out; + my_xcb_ext_t ext; + my_xcb_xid_t xid; +} my_xcb_connection_t; + +typedef struct x64_xcb_connection_s { + int has_error; + void *setup; + int fd; + uint8_t iolock[MUTEX_SIZE_X64]; + my_xcb_in_t in; + x64_xcb_out_t out; + x64_xcb_ext_t ext; + x64_xcb_xid_t xid; +} x64_xcb_connection_t; diff --git a/src/libtools/myalign.c b/src/libtools/myalign.c index 123aa65..efea899 100644 --- a/src/libtools/myalign.c +++ b/src/libtools/myalign.c @@ -123,6 +123,21 @@ void myStackAlign(x64emu_t* emu, const char* fmt, uint64_t* st, uint64_t* mystac mystack++; memcpy(mystack, st, 16); st+=2; mystack+=2; + #elif defined(ANDROID) + // there is 128bits long double on native and x64 side + // need to align stacks to 128bits boundaries + if((((uintptr_t)mystack)&0xf)!=0) + mystack++; + if(xmm) { + memcpy(mystack, &emu->xmm[x++], 16); + st+=2; mystack+=2; + --xmm; + } else { + if((((uintptr_t)st)&0xf)!=0) + st++; + memcpy(mystack, st, 16); + st+=2; mystack+=2; + } #else // there is 128bits long double on ARM64, but they need 128bit alignment if((((uintptr_t)mystack)&0xf)!=0) @@ -366,6 +381,21 @@ void myStackAlignW(x64emu_t* emu, const char* fmt, uint64_t* st, uint64_t* mysta mystack++; memcpy(mystack, st, 16); st+=2; mystack+=2; + #elif defined(ANDROID) + // there is 128bits long double on native and x64 side + // need to align stacks to 128bits boundaries + if((((uintptr_t)mystack)&0xf)!=0) + mystack++; + if(xmm) { + memcpy(mystack, &emu->xmm[x++], 16); + st+=2; mystack+=2; + --xmm; + } else { + if((((uintptr_t)st)&0xf)!=0) + st++; + memcpy(mystack, st, 16); + st+=2; mystack+=2; + } #else // there is 128bits long double on ARM64, but they need 128bit alignment if((((uintptr_t)mystack)&0xf)!=0) @@ -624,6 +654,14 @@ uintptr_t getVArgs(x64emu_t* emu, int pos, uintptr_t* b, int N) return emu->regs[regs_abi[pos+N]].q[0]; } +void setVArgs(x64emu_t* emu, int pos, uintptr_t* b, int N, uintptr_t a) +{ + if((pos+N)>5) + b[pos+N-6] = a; + else + emu->regs[regs_abi[pos+N]].q[0] = a; +} + #ifndef CONVERT_VALIST void myStackAlignValist(x64emu_t* emu, const char* fmt, uint64_t* mystack, x64_va_list_t va) { @@ -735,6 +773,20 @@ void myStackAlignValist(x64emu_t* emu, const char* fmt, uint64_t* mystack, x64_v mystack++; memcpy(mystack, st, 16); st+=2; mystack+=2; + #elif defined(ANDROID) + // there is 128bits long double on native and x64 side + // need to align stacks to 128bits boundaries + if((((uintptr_t)mystack)&0xf)!=0) + mystack++; + if(fprsreg_save_area); + uint64_t* frp = (uint64_t*)((*b)->reg_save_area + X64_VA_MAX_REG); -#define MUTEX_SIZE_X64 40 -typedef struct my_xcb_ext_s { - pthread_mutex_t lock; - struct lazyreply *extensions; - int extensions_size; -} my_xcb_ext_t; - -typedef struct x64_xcb_ext_s { - uint8_t lock[MUTEX_SIZE_X64]; - struct lazyreply *extensions; - int extensions_size; -} x64_xcb_ext_t; + int idx = 0; + int gr_offs = ((*b)->gp_offset) / 8; + int fr_offs = ((*b)->fp_offset - X64_VA_MAX_REG) / 8; -typedef struct my_xcb_xid_s { - pthread_mutex_t lock; - uint32_t last; - uint32_t base; - uint32_t max; - uint32_t inc; -} my_xcb_xid_t; + int oa_offs = 0; + const char *p = fmt; + int state = 0; + int inblocks = 0; + int tmp; -typedef struct x64_xcb_xid_s { - uint8_t lock[MUTEX_SIZE_X64]; - uint32_t last; - uint32_t base; - uint32_t max; - uint32_t inc; -} x64_xcb_xid_t; + do { + switch(state) { + case 0: // Nothing + switch(*p) { + case 'b': // gboolean + case 'y': // guchar + case 'n': // gint16 + case 'q': // guint16 + case 'i': // gint32 + case 'u': // guint32 + case 'h': // gint32 + case 's': // const gchar* + case 'o': + case 'g': + case 'v': // GVariant* + case '*': // GVariant* of any type + case '?': // GVariant* of basic type + case 'r': // GVariant* of tuple type + case 'x': // gint64 + case 't': // guint64 + if (gr_offs >= (X64_VA_MAX_REG / 8)) + scratch[idx++] = ((uint64_t*)((*b)->overflow_arg_area))[oa_offs++]; + else + scratch[idx++] = grp[gr_offs++]; + break; + case 'd': // gdouble + if (fr_offs >= ((X64_VA_MAX_XMM - X64_VA_MAX_REG) / 8)) { + scratch[idx++] = ((uint64_t*)((*b)->overflow_arg_area))[oa_offs++]; + } else { + scratch[idx++] = frp[fr_offs]; + fr_offs += 2; + } + break; + case '{': + case '(': ++inblocks; break; + case '}': + case ')': --inblocks; break; + case 'a': state = 1; break; // GVariantBuilder* or GVariantIter** + case 'm': state = 2; break; // maybe types + case '@': state = 3; break; // GVariant* of type [type] + case '^': state = 4; break; // pointer value + case '&': break; // pointer: do nothing + } + break; + case 1: // Arrays + switch(*p) { + case '{': + case '(': ++tmp; break; + case '}': + case ')': --tmp; break; + } + if (*p == 'a') break; + if (tmp == 0) { + if (gr_offs >= (X64_VA_MAX_REG / 8)) + scratch[idx++] = ((uint64_t*)((*b)->overflow_arg_area))[oa_offs++]; + else + scratch[idx++] = grp[gr_offs++]; + state = 0; + } + break; + case 2: // Maybe-types + switch(*p) { + case 'b': // gboolean + case 'y': // guchar + case 'n': // gint16 + case 'q': // guint16 + case 'i': // gint32 + case 'u': // guint32 + case 'h': // gint32 + case 'x': // gint64 + case 't': // guint64 + case 'd': // gdouble + case '{': + case '}': + case '(': + case ')': + // Add a gboolean or gboolean*, no char increment + if (gr_offs >= (X64_VA_MAX_REG / 8)) + scratch[idx++] = ((uint64_t*)((*b)->overflow_arg_area))[oa_offs++]; + else + scratch[idx++] = grp[gr_offs++]; + --p; + state = 0; + break; + case 'a': // GVariantBuilder* or GVariantIter** + case 's': // const gchar* + case 'o': + case 'g': + case 'v': // GVariant* + case '@': // GVariant* of type [type] + case '*': // GVariant* of any type + case '?': // GVariant* of basic type + case 'r': // GVariant* of tuple type + case '&': // pointer + case '^': // pointer value + // Just maybe-NULL + --p; + state = 0; + break; -typedef struct my_xcb_fd_s { - int fd[16]; - int nfd; - int ifd; -} my_xcb_fd_t; + default: // Default to add a gboolean & reinit state? + if (gr_offs >= (X64_VA_MAX_REG / 8)) + scratch[idx++] = ((uint64_t*)((*b)->overflow_arg_area))[oa_offs++]; + else + scratch[idx++] = grp[gr_offs++]; + --p; + state = 0; + } + break; + case 3: // GVariant* + switch(*p) { + case '{': + case '(': ++tmp; break; + case '}': + case ')': --tmp; break; + case 'a': // GVariantBuilder* or GVariantIter** + do { ++p; } while(*p == 'a'); // Use next character which is not an array (array definition) + switch(*p) { + case '{': + case '(': ++tmp; break; + case '}': + case ')': --tmp; break; + } + break; + } + if (tmp == 0) { + if (gr_offs >= (X64_VA_MAX_REG / 8)) + scratch[idx++] = ((uint64_t*)((*b)->overflow_arg_area))[oa_offs++]; + else + scratch[idx++] = grp[gr_offs++]; + state = 0; + } + break; + case 4: // ^ + if (*p == 'a') state = 5; + else if (*p == '&') state = 8; + else state = 0; //??? + break; + case 5: // ^a + if ((*p == 's') || (*p == 'o') || (*p == 'y')) { + if (gr_offs >= (X64_VA_MAX_REG / 8)) + scratch[idx++] = ((uint64_t*)((*b)->overflow_arg_area))[oa_offs++]; + else + scratch[idx++] = grp[gr_offs++]; + state = 0; + } else if (*p == '&') state = 6; + else if (*p == 'a') state = 7; + else state = 0; //??? + break; + case 6: // ^a& + if ((*p == 's') || (*p == 'o')) { + if (gr_offs >= (X64_VA_MAX_REG / 8)) + scratch[idx++] = ((uint64_t*)((*b)->overflow_arg_area))[oa_offs++]; + else + scratch[idx++] = grp[gr_offs++]; + state = 0; + } else if (*p == 'a') state = 7; + else state = 0; //??? + break; + case 7: // ^aa / ^a&a + if (*p == 'y') { + if (gr_offs >= (X64_VA_MAX_REG / 8)) + scratch[idx++] = ((uint64_t*)((*b)->overflow_arg_area))[oa_offs++]; + else + scratch[idx++] = grp[gr_offs++]; + state = 0; + } else state = 0; //??? + break; + case 8: // ^& + if (*p == 'a') state = 9; + else state = 0; //??? + break; + case 9: // ^&a + if (*p == 'y') { + if (gr_offs >= (X64_VA_MAX_REG / 8)) + scratch[idx++] = ((uint64_t*)((*b)->overflow_arg_area))[oa_offs++]; + else + scratch[idx++] = grp[gr_offs++]; + state = 0; + } else state = 0; //??? + break; + } + ++p; + } while (*p && (inblocks || state)); +} -typedef struct my_xcb_in_s { - pthread_cond_t event_cond; - int reading; - char queue[4096]; - int queue_len; - uint64_t request_expected; - uint64_t request_read; - uint64_t request_completed; - struct reply_list *current_reply; - struct reply_list **current_reply_tail; - void* replies; - struct event_list *events; - struct event_list **events_tail; - struct reader_list *readers; - struct special_list *special_waiters; - struct pending_reply *pending_replies; - struct pending_reply **pending_replies_tail; - my_xcb_fd_t in_fd; - struct xcb_special_event *special_events; -} my_xcb_in_t; +void myStackAlignGVariantNew(x64emu_t* emu, const char* fmt, uint64_t* st, uint64_t* mystack, int pos) +{ + if (!fmt) + return; -typedef struct x64_xcb_out_s { - pthread_cond_t cond; - int writing; - pthread_cond_t socket_cond; - void (*return_socket)(void *closure); - void *socket_closure; - int socket_moving; - char queue[16384]; - int queue_len; - uint64_t request; - uint64_t request_written; - uint8_t reqlenlock[40]; - int maximum_request_length_tag; - uint32_t maximum_request_length; - my_xcb_fd_t out_fd; -} x64_xcb_out_t; + int x = 0; + const char *p = fmt; + int state = 0; + int inblocks = 0; + int tmp; + int xmm = R_EAX; -typedef struct my_xcb_out_s { - pthread_cond_t cond; - int writing; - pthread_cond_t socket_cond; - void (*return_socket)(void *closure); - void *socket_closure; - int socket_moving; - char queue[16384]; - int queue_len; - uint64_t request; - uint64_t request_written; - pthread_mutex_t reqlenlock; - int maximum_request_length_tag; - uint32_t maximum_request_length; - my_xcb_fd_t out_fd; -} my_xcb_out_t; + do { + switch(state) { + case 0: // Nothing + switch(*p) { + case 'b': // gboolean + case 'y': // guchar + case 'n': // gint16 + case 'q': // guint16 + case 'i': // gint32 + case 'u': // guint32 + case 'h': // gint32 + case 's': // const gchar* + case 'o': + case 'g': + case 'v': // GVariant* + case '*': // GVariant* of any type + case '?': // GVariant* of basic type + case 'r': // GVariant* of tuple type + case 'x': // gint64 + case 't': // guint64 + if (pos < 6) + *mystack = emu->regs[regs_abi[pos++]].q[0]; + else + *mystack = *st; + ++mystack; + ++st; + break; + case 'd': // gdouble + if (xmm) { + *mystack = emu->xmm[x++].q[0]; + --xmm; + mystack++; + } else { + *mystack = *st; + st++; + mystack++; + } + break; + case '{': + case '(': ++inblocks; break; + case '}': + case ')': --inblocks; break; + case 'a': state = 1; break; // GVariantBuilder* or GVariantIter** + case 'm': state = 2; break; // maybe types + case '@': state = 3; break; // GVariant* of type [type] + case '^': state = 4; break; // pointer value + case '&': break; // pointer: do nothing + } + break; + case 1: // Arrays + switch(*p) { + case '{': + case '(': ++tmp; break; + case '}': + case ')': --tmp; break; + } + if (*p == 'a') break; + if (tmp == 0) { + if (pos < 6) + *mystack = emu->regs[regs_abi[pos++]].q[0]; + else + *mystack = *st; + ++mystack; + ++st; + state = 0; + } + break; + case 2: // Maybe-types + switch(*p) { + case 'b': // gboolean + case 'y': // guchar + case 'n': // gint16 + case 'q': // guint16 + case 'i': // gint32 + case 'u': // guint32 + case 'h': // gint32 + case 'x': // gint64 + case 't': // guint64 + case 'd': // gdouble + case '{': + case '}': + case '(': + case ')': + // Add a gboolean or gboolean*, no char increment + if (pos < 6) + *mystack = emu->regs[regs_abi[pos++]].q[0]; + else + *mystack = *st; + ++mystack; + ++st; + --p; + state = 0; + break; + case 'a': // GVariantBuilder* or GVariantIter** + case 's': // const gchar* + case 'o': + case 'g': + case 'v': // GVariant* + case '@': // GVariant* of type [type] + case '*': // GVariant* of any type + case '?': // GVariant* of basic type + case 'r': // GVariant* of tuple type + case '&': // pointer + case '^': // pointer value + // Just maybe-NULL + --p; + state = 0; + break; + + default: // Default to add a gboolean & reinit state? + if (pos < 6) + *mystack = emu->regs[regs_abi[pos++]].q[0]; + else + *mystack = *st; + ++mystack; + ++st; + --p; + state = 0; + } + break; + case 3: // GVariant* + switch(*p) { + case '{': + case '(': ++tmp; break; + case '}': + case ')': --tmp; break; + case 'a': // GVariantBuilder* or GVariantIter** + do { ++p; } while(*p == 'a'); // Use next character which is not an array (array definition) + switch(*p) { + case '{': + case '(': ++tmp; break; + case '}': + case ')': --tmp; break; + } + break; + } + if (tmp == 0) { + if (pos < 6) + *mystack = emu->regs[regs_abi[pos++]].q[0]; + else + *mystack = *st; + ++mystack; + ++st; + state = 0; + } + break; + case 4: // ^ + if (*p == 'a') state = 5; + else if (*p == '&') state = 8; + else state = 0; //??? + break; + case 5: // ^a + if ((*p == 's') || (*p == 'o') || (*p == 'y')) { + if (pos < 6) + *mystack = emu->regs[regs_abi[pos++]].q[0]; + else + *mystack = *st; + ++mystack; + ++st; + state = 0; + } else if (*p == '&') state = 6; + else if (*p == 'a') state = 7; + else state = 0; //??? + break; + case 6: // ^a& + if ((*p == 's') || (*p == 'o')) { + if (pos < 6) + *mystack = emu->regs[regs_abi[pos++]].q[0]; + else + *mystack = *st; + ++mystack; + ++st; + state = 0; + } else if (*p == 'a') state = 7; + else state = 0; //??? + break; + case 7: // ^aa / ^a&a + if (*p == 'y') { + if (pos < 6) + *mystack = emu->regs[regs_abi[pos++]].q[0]; + else + *mystack = *st; + ++mystack; + ++st; + state = 0; + } else state = 0; //??? + break; + case 8: // ^& + if (*p == 'a') state = 9; + else state = 0; //??? + break; + case 9: // ^&a + if (*p == 'y') { + if (pos < 6) + *mystack = emu->regs[regs_abi[pos++]].q[0]; + else + *mystack = *st; + ++mystack; + ++st; + state = 0; + } else state = 0; //??? + break; + } + ++p; + } while (*p && (inblocks || state)); +} -typedef struct my_xcb_connection_s { - int has_error; - void *setup; - int fd; - pthread_mutex_t iolock; - my_xcb_in_t in; - my_xcb_out_t out; - my_xcb_ext_t ext; - my_xcb_xid_t xid; -} my_xcb_connection_t; +#endif -typedef struct x64_xcb_connection_s { - int has_error; - void *setup; - int fd; - uint8_t iolock[MUTEX_SIZE_X64]; - my_xcb_in_t in; - x64_xcb_out_t out; - x64_xcb_ext_t ext; - x64_xcb_xid_t xid; -} x64_xcb_connection_t; +#include "my_xcb_defs.h" #define NXCB 8 -my_xcb_connection_t* my_xcb_connects[NXCB] = {0}; -x64_xcb_connection_t x64_xcb_connects[NXCB] = {0}; +static my_xcb_connection_t* my_xcb_connects[NXCB] = {0}; +static x64_xcb_connection_t x64_xcb_connects[NXCB] = {0}; +static void* xcb_display[NXCB] = {0}; void* align_xcb_connection(void* src) { @@ -1263,7 +1640,7 @@ void* align_xcb_connection(void* src) dest = add_xcb_connection(src); #else if(!dest) { - printf_log(LOG_NONE, "BOX64: Error, xcb_connect %p not found\n", src); + printf_log(LOG_NONE, "Error, xcb_connect %p not found\n", src); abort(); } #endif @@ -1338,10 +1715,11 @@ void* add_xcb_connection(void* src) for(int i=0; i +#include +#include +#include +#include +#include +#include +#include +#include + +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "debug.h" +#include "box32.h" + +void myStackAlign32(const char* fmt, uint32_t* st, uint64_t* mystack) +{ + if(!fmt) + return; + // loop... + const char* p = fmt; + int state = 0; + double d; + long double ld; + while(*p) + { + switch(state) { + case 0: + switch(*p) { + case '%': state = 1; ++p; break; + default: + ++p; + } + break; + case 1: // normal + case 2: // l + case 3: // ll + case 4: // L + switch(*p) { + case '%': state = 0; ++p; break; //%% = back to 0 + case 'l': ++state; if (state>3) state=3; ++p; break; + case 'z': state = 2; ++p; break; + case 'L': state = 4; ++p; break; + case 'a': + case 'A': + case 'e': + case 'E': + case 'g': + case 'G': + case 'F': + case 'f': state += 10; break; // float + case 'd': + case 'i': + case 'n': + case 'o': state += 20; break; // int + case 'x': + case 'X': + case 'u': state += 40; break; // uint + case 'h': ++p; break; // ignored... + case '\'': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '.': + case '#': + case '+': + case '-': ++p; break; // formating, ignored + case 'm': state = 0; ++p; break; // no argument + case 'p': + case 'S': + case 's': state = 30; break; // pointers + case '$': ++p; break; // should issue a warning, it's not handled... + case '*': *(mystack++) = *(st++); ++p; break; // fetch an int in the stack.... + case ' ': state=0; ++p; break; + default: + state=20; // other stuff, put an int... + } + break; + case 11: //double + case 12: //%lg, still double + case 13: //%llg, still double + case 23: // 64bits int + case 43: // 64bits uint + *(uint64_t*)mystack = *(uint64_t*)st; + st+=2; mystack+=1; + state = 0; + ++p; + break; + case 22: // long int + *(int64_t*)mystack = from_long(*(long_t*)st); + st+=1; mystack+=1; + state = 0; + ++p; + break; + case 42: // long uint + *(uint64_t*)mystack = from_ulong(*(ulong_t*)st); + st+=1; mystack+=1; + state = 0; + ++p; + break; + case 14: //%LG long double + #ifdef HAVE_LD80BITS + memcpy(mystack, st, 10); + st+=3; mystack+=2; + #else + LD2D((void*)st, &d); + ld = d; + if(((uintptr_t)mystack)&0xf) // align the long double + mystack++; + memcpy(mystack, &ld, 16); + st+=3; mystack+=2; + #endif + state = 0; + ++p; + break; + case 30: //pointer + *(uintptr_t*)mystack = from_ptr(*st); + st++; mystack+=1; + state = 0; + ++p; + break; + case 20: // fallback + case 21: + case 24: // normal int / pointer + case 40: + case 41: + *mystack = *st; + ++mystack; + ++st; + state = 0; + ++p; + break; + default: + // whattt? + state = 0; + } + } +} + +size_t myStackAlignScanf32(const char* fmt, uint32_t* st, uint64_t* mystack, size_t nb_elem) +{ + + if(!fmt) + return 0; + // loop... + const char* p = fmt; + size_t conv = 0; + int state = 0; + int ign = 0; + uint64_t* saved = mystack; + while(*p) + { + switch(state) { + case 0: + ign = 0; + switch(*p) { + case '%': state = 1; ++p; break; + default: + ++p; + } + break; + case 1: // normal + case 2: // l + case 3: // ll + case 4: // L + case 5: // z + switch(*p) { + case '%': state = 0; ++p; break; //%% = back to 0 + case 'l': ++state; if (state>3) state=3; ++p; break; + case 'L': state = 4; ++p; break; + case 'z': state = 5; ++p; break; + case 'a': + case 'A': + case 'e': + case 'E': + case 'g': + case 'G': + case 'F': + case 'f': state += 10; break; // float + case 'd': + case 'i': + case 'n': + case 'o': state += 20; break; // int + case 'u': + case 'x': + case 'X': state += 40; break; // usigned int + case 'h': ++p; break; // ignored... + case '\'': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '.': + case '#': + case '+': + case '-': ++p; break; // formating, ignored + case '[': state += 60; ++p; break; + case 'm': state = 0; ++p; break; // no argument + case 'p': state = 30; break; // pointers + case 'S': + case 's': state = 50; break; // string + case '$': ++p; break; // should issue a warning, it's not handled... + case '*': ign=1; ++p; break; // ignore arg + case ' ': state=0; ++p; break; + default: + state=20; // other stuff, put an int... + } + break; + case 22: // long uint + case 25: // size_t int + case 42: // long uint + case 45: + case 30: // pointer + if(!ign) { + ++conv; + saved[nb_elem-conv] = 0; + *mystack = (uintptr_t)&saved[nb_elem-conv]; + ++st; + ++mystack; + } + state = 0; + ++p; + break; + + case 11: //double + case 12: //%lg, still double + case 13: //%llg, still double + case 14: //%Lg long double + case 15: //%zg + case 20: // fallback + case 21: + case 23: // 64bits int + case 24: // normal int / pointer + case 40: + case 41: + case 43: + case 44: + case 50: + if(!ign) { + *mystack = *st; + ++st; + ++mystack; + } + state = 0; + ++p; + break; + case 61: + switch(*p) { + case ']': state = 50; break; + case '\\': ++p; if(*p) ++p; break; + default: ++p; break; + } + break; + default: + // whaaaat? + state = 0; + } + } + return conv; +} + +void myStackAlignScanf32_final(const char* fmt, uint32_t* st, uint64_t* mystack, size_t nb_elem, int n) +{ + + if(!fmt || n<=0) + return; + // loop... + const char* p = fmt; + size_t conv = 0; + int state = 0; + int ign = 0; + uint64_t* saved = mystack; + while(*p) + { + switch(state) { + case 0: + ign = 0; + switch(*p) { + case '%': state = 1; ++p; break; + default: + ++p; + } + break; + case 1: // normal + case 2: // l + case 3: // ll + case 4: // L + case 5: // z + switch(*p) { + case '%': state = 0; ++p; break; //%% = back to 0 + case 'l': ++state; if (state>3) state=3; ++p; break; + case 'L': state = 4; ++p; break; + case 'z': state = 5; ++p; break; + case 'a': + case 'A': + case 'e': + case 'E': + case 'g': + case 'G': + case 'F': + case 'f': state += 10; break; // float + case 'd': + case 'i': + case 'n': + case 'o': state += 20; break; // int + case 'u': + case 'x': + case 'X': state += 40; break; // usigned int + case 'h': ++p; break; // ignored... + case '\'': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '.': + case '#': + case '+': + case '-': ++p; break; // formating, ignored + case '[': state += 60; ++p; break; + case 'm': state = 0; ++p; break; // no argument + case 'p': state = 30; break; // pointers + case 'S': + case 's': state = 50; break; // strings + case '$': ++p; break; // should issue a warning, it's not handled... + case '*': ign=1; ++p; break; // ignore arg + case ' ': state=0; ++p; break; + default: + state=20; // other stuff, put an int... + } + break; + case 22: // long int + case 25: // size_t int + case 42: // long uint + case 45: + case 30: // pointer + if(!ign) { + ++conv; + if((state==22) || (state==25)) { + long_t* dst = from_ptrv(*st); + *dst = saved[nb_elem-conv]; // not using to_long on purpose + } else if(state==30) { + ptr_t* dst = from_ptrv(*st); + *dst = to_ptr(saved[nb_elem-conv]); + } else { + ulong_t* dst = from_ptrv(*st); + *dst = saved[nb_elem-conv]; //not using to to_ulong on pupose + } + ++st; + ++mystack; + if(!--n) return; + } + state = 0; + ++p; + break; + + case 11: //double + case 12: //%lg, still double + case 13: //%llg, still double + case 14: //%Lg long double + case 15: //%zg + case 20: // fallback + case 21: + case 23: // 64bits int + case 24: // normal int / pointer + case 40: + case 41: + case 43: + case 44: + case 50: + if(!ign) { + *mystack = *st; + ++st; + ++mystack; + } + state = 0; + ++p; + if(!--n) return; + break; + case 61: + switch(*p) { + case ']': state = 50; break; + case '\\': ++p; if(*p) ++p; break; + default: ++p; break; + } + break; + default: + // whaaaat? + state = 0; + } + } +} + +size_t myStackAlignScanfW32(const char* fmt, uint32_t* st, uint64_t* mystack, size_t nb_elem) +{ + + if(!fmt) + return 0; + // loop... + const wchar_t* p = (const wchar_t*)fmt; + int state = 0; + size_t conv = 0; + int ign = 0; + uint64_t* saved = mystack; + while(*p) + { + switch(state) { + case 0: + ign = 0; + switch(*p) { + case '%': state = 1; ++p; break; + default: + ++p; + } + break; + case 1: // normal + case 2: // l + case 3: // ll + case 4: // L + case 5: // z + switch(*p) { + case '%': state = 0; ++p; break; //%% = back to 0 + case 'l': ++state; if (state>3) state=3; ++p; break; + case 'L': state = 4; ++p; break; + case 'z': state = 5; ++p; break; + case 'a': + case 'A': + case 'e': + case 'E': + case 'g': + case 'G': + case 'F': + case 'f': state += 10; break; // float + case 'd': + case 'i': + case 'n': + case 'o': state += 20; break; // int + case 'u': + case 'x': + case 'X': state += 40; break; // usigned int + case 'h': ++p; break; // ignored... + case '\'': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '.': + case '#': + case '+': + case '-': ++p; break; // formating, ignored + case 'm': state = 0; ++p; break; // no argument + case 'p': state = 30; break; // pointers + case 'S': + case 's': state = 50; break; // strings + case '$': ++p; break; // should issue a warning, it's not handled... + case '*': ign=1; ++p; break; // ignore arg + case ' ': state=0; ++p; break; + default: + state=20; // other stuff, put an int... + } + break; + case 22: // long uint + case 25: // size_t int + case 42: // long uint + case 45: + case 30: // pointer + if(!ign) { + ++conv; + saved[nb_elem-conv] = 0; + *mystack = (uintptr_t)&saved[nb_elem-conv]; + ++st; + ++mystack; + } + state = 0; + ++p; + break; + + case 11: //double + case 12: //%lg, still double + case 13: //%llg, still double + case 14: //%Lg long double + case 15: //%zg + case 20: // fallback + case 21: + case 23: // 64bits int + case 24: // normal int / pointer + case 40: + case 41: + case 43: + case 44: + case 50: + if(!ign) { + *mystack = *st; + ++st; + ++mystack; + } + state = 0; + ++p; + break; + default: + // whaaaat? + state = 0; + } + } + return conv; +} + +void myStackAlignScanfW32_final(const char* fmt, uint32_t* st, uint64_t* mystack, size_t nb_elem, int n) +{ + + if(!fmt || n<=0) + return; + // loop... + const wchar_t* p = (const wchar_t*)fmt; + int state = 0; + size_t conv = 0; + int ign = 0; + uint64_t* saved = mystack; + while(*p) + { + switch(state) { + case 0: + ign = 0; + switch(*p) { + case '%': state = 1; ++p; break; + default: + ++p; + } + break; + case 1: // normal + case 2: // l + case 3: // ll + case 4: // L + case 5: // z + switch(*p) { + case '%': state = 0; ++p; break; //%% = back to 0 + case 'l': ++state; if (state>3) state=3; ++p; break; + case 'L': state = 4; ++p; break; + case 'z': state = 5; ++p; break; + case 'a': + case 'A': + case 'e': + case 'E': + case 'g': + case 'G': + case 'F': + case 'f': state += 10; break; // float + case 'd': + case 'i': + case 'n': + case 'o': state += 20; break; // int + case 'u': + case 'x': + case 'X': state += 40; break; // usigned int + case 'h': ++p; break; // ignored... + case '\'': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '.': + case '#': + case '+': + case '-': ++p; break; // formating, ignored + case 'm': state = 0; ++p; break; // no argument + case 'p': state = 30; break; // pointers + case 'S': + case 's': state = 50; break; // string + case '$': ++p; break; // should issue a warning, it's not handled... + case '*': ign=1; ++p; break; // ignore arg + case ' ': state=0; ++p; break; + default: + state=20; // other stuff, put an int... + } + break; + case 22: // long uint + case 25: // size_t int + case 42: // long uint + case 45: + case 30: // pointer + if(!ign) { + ++conv; + if(state==22 || state==0x25) { + int32_t* dst = from_ptrv(*st); + *dst = to_long(saved[nb_elem-conv]); + } else if(state==30) { + ptr_t* dst = from_ptrv(*st); + *dst = to_ptr(saved[nb_elem-conv]); + } else { + uint32_t* dst = from_ptrv(*st); + *dst = to_ulong(saved[nb_elem-conv]); + } + ++st; + ++mystack; + } + state = 0; + ++p; + if(!--n) return; + break; + + case 11: //double + case 12: //%lg, still double + case 13: //%llg, still double + case 14: //%Lg long double + case 15: //%zg + case 20: // fallback + case 21: + case 23: // 64bits int + case 24: // normal int / pointer + case 40: + case 41: + case 43: + case 44: + case 50: + if(!ign) { + *mystack = *st; + ++st; + ++mystack; + } + state = 0; + ++p; + if(!--n) return; + break; + default: + // whaaaat? + state = 0; + } + } +} + +void myStackAlignW32(const char* fmt, uint32_t* st, uint64_t* mystack) +{ + // loop... + const wchar_t* p = (const wchar_t*)fmt; + int state = 0; + double d; + long double ld; + while(*p) + { + switch(state) { + case 0: + switch(*p) { + case '%': state = 1; ++p; break; + default: + ++p; + } + break; + case 1: // normal + case 2: // l + case 3: // ll + case 4: // L + switch(*p) { + case '%': state = 0; ++p; break; //%% = back to 0 + case 'l': ++state; if (state>3) state=3; ++p; break; + case 'z': state = 2; ++p; break; + case 'L': state = 4; ++p; break; + case 'a': + case 'A': + case 'e': + case 'E': + case 'g': + case 'G': + case 'F': + case 'f': state += 10; break; // float + case 'd': + case 'i': + case 'o': state += 20; break; // int + case 'x': + case 'X': + case 'u': state += 40; break; // uint + case 'h': ++p; break; // ignored... + case '\'': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '.': + case '+': + case '-': ++p; break; // formating, ignored + case 'm': state = 0; ++p; break; // no argument + case 'n': + case 'p': + case 'S': + case 's': state = 30; break; // pointers + case '$': ++p; break; // should issue a warning, it's not handled... + case '*': *(mystack++) = *(st++); ++p; break; // fetch an int in the stack.... + case ' ': state=0; ++p; break; + default: + state=20; // other stuff, put an int... + } + break; + case 11: //double + case 12: //%lg, still double + case 13: //%llg, still double + case 23: // 64bits int + case 43: // 64bits uint + *(uint64_t*)mystack = *(uint64_t*)st; + st+=2; mystack+=1; + state = 0; + ++p; + break; + case 22: // long int + *(int64_t*)mystack = from_long(*(long_t*)st); + st+=1; mystack+=1; + state = 0; + ++p; + break; + case 42: // long uint + *(uint64_t*)mystack = from_ulong(*(ulong_t*)st); + st+=1; mystack+=1; + state = 0; + ++p; + break; + case 14: //%LG long double + #ifdef HAVE_LD80BITS + memcpy(mystack, st, 10); + st+=3; mystack+=2; + #else + LD2D((void*)st, &d); + if(((uintptr_t)mystack)&0xf) // align the long double + mystack++; + ld = d; + memcpy(mystack, &ld, 16); + st+=3; mystack+=2; + #endif + state = 0; + ++p; + break; + case 30: //pointer + *(uintptr_t*)mystack = from_ptr(*st); + st++; mystack+=1; + state = 0; + ++p; + break; + case 20: // fallback + case 21: + case 24: // normal int / pointer + case 40: + case 41: + *mystack = *st; + ++mystack; + ++st; + state = 0; + ++p; + break; + default: + // whattt? + state = 0; + } + } +} + + +#if 0 + +typedef struct __attribute__((packed, aligned(4))) { + unsigned char *body_data; + long body_storage; + long body_fill; + long body_returned; + + + int *lacing_vals; + int64_t *granule_vals; + long lacing_storage; + long lacing_fill; + long lacing_packet; + long lacing_returned; + + unsigned char header[282]; + int header_fill __attribute__ ((aligned (4))); + + int e_o_s; + int b_o_s; + long serialno; + long pageno; + int64_t packetno; + int64_t granulepos; + +} ogg_stream_state_x64; + +typedef struct __attribute__((packed, aligned(4))) vorbis_dsp_state_x64 { + int analysisp; + void *vi; //vorbis_info + + float **pcm; + float **pcmret; + int pcm_storage; + int pcm_current; + int pcm_returned; + + int preextrapolate; + int eofflag; + + long lW; + long W; + long nW; + long centerW; + + int64_t granulepos; + int64_t sequence; + + int64_t glue_bits; + int64_t time_bits; + int64_t floor_bits; + int64_t res_bits; + + void *backend_state; +} vorbis_dsp_state_x64; + +typedef struct __attribute__((packed, aligned(4))) { + long endbyte; + int endbit; + + unsigned char *buffer; + unsigned char *ptr; + long storage; +} oggpack_buffer_x64; + +typedef struct __attribute__((packed, aligned(4))) vorbis_block_x64 { + + float **pcm; + oggpack_buffer_x64 opb; + + long lW; + long W; + long nW; + int pcmend; + int mode; + + int eofflag; + int64_t granulepos; + int64_t sequence; + void *vd; + + void *localstore; + long localtop; + long localalloc; + long totaluse; + void *reap; + + long glue_bits; + long time_bits; + long floor_bits; + long res_bits; + + void *internal; + +} vorbis_block_x64; + +typedef struct __attribute__((packed, aligned(4))) OggVorbis_x64 { + void *datasource; /* Pointer to a FILE *, etc. */ + int seekable; + int64_t offset; + int64_t end; + ogg_sync_state oy; + + /* If the FILE handle isn't seekable (eg, a pipe), only the current + stream appears */ + int links; + int64_t *offsets; + int64_t *dataoffsets; + long *serialnos; + int64_t *pcmlengths; /* overloaded to maintain binary + compatibility; x2 size, stores both + beginning and end values */ + void *vi; //vorbis_info + void *vc; //vorbis_comment + + /* Decoding working state local storage */ + int64_t pcm_offset; + int ready_state; + long current_serialno; + int current_link; + + double bittrack; + double samptrack; + + ogg_stream_state_x64 os; /* take physical pages, weld into a logical + stream of packets */ + vorbis_dsp_state_x64 vd; /* central working state for the packet->PCM decoder */ + vorbis_block_x64 vb; /* local working space for packet->PCM decode */ + + ov_callbacks callbacks; + +} OggVorbis_x64; + +#define TRANSFERT \ +GO(datasource) \ +GO(seekable) \ +GO(offset) \ +GO(end) \ +GOM(oy, sizeof(ogg_sync_state)) \ +GO(links) \ +GO(offsets) \ +GO(dataoffsets) \ +GO(serialnos) \ +GO(pcmlengths) \ +GO(vi) \ +GO(vc) \ +GO(pcm_offset) \ +GO(ready_state) \ +GO(current_serialno) \ +GO(current_link) \ +GOM(bittrack, 16) \ +GO(os.body_data) \ +GO(os.body_storage) \ +GO(os.body_fill) \ +GO(os.body_returned) \ +GO(os.lacing_vals) \ +GO(os.granule_vals) \ +GO(os.lacing_storage) \ +GO(os.lacing_fill) \ +GO(os.lacing_packet) \ +GO(os.lacing_returned) \ +GOM(os.header, 282) \ +GO(os.header_fill) \ +GO(os.e_o_s) \ +GO(os.b_o_s) \ +GO(os.serialno) \ +GO(os.pageno) \ +GO(os.packetno) \ +GO(os.granulepos) \ +GO(vd.analysisp) \ +GO(vd.vi) \ +GO(vd.pcm) \ +GO(vd.pcmret) \ +GO(vd.pcm_storage) \ +GO(vd.pcm_current) \ +GO(vd.pcm_returned) \ +GO(vd.preextrapolate) \ +GO(vd.eofflag) \ +GO(vd.lW) \ +GO(vd.W) \ +GO(vd.nW) \ +GO(vd.centerW) \ +GO(vd.granulepos) \ +GO(vd.sequence) \ +GO(vd.glue_bits) \ +GO(vd.time_bits) \ +GO(vd.floor_bits) \ +GO(vd.res_bits) \ +GO(vd.backend_state) \ +GO(vb.pcm) \ +GO(vb.opb.endbyte) \ +GO(vb.opb.endbit) \ +GO(vb.opb.buffer) \ +GO(vb.opb.ptr) \ +GO(vb.opb.storage) \ +GO(vb.lW) \ +GO(vb.W) \ +GO(vb.nW) \ +GO(vb.pcmend) \ +GO(vb.mode) \ +GO(vb.eofflag) \ +GO(vb.granulepos) \ +GO(vb.sequence) \ +GO(vb.localstore) \ +GO(vb.localtop) \ +GO(vb.localalloc) \ +GO(vb.totaluse) \ +GO(vb.reap) \ +GO(vb.glue_bits) \ +GO(vb.time_bits) \ +GO(vb.floor_bits) \ +GO(vb.res_bits) \ +GO(vb.internal) \ +GOM(callbacks, sizeof(ov_callbacks)) + +void AlignOggVorbis(void* dest, void* source) +{ + // Arm -> x64 + OggVorbis_x64* src = (OggVorbis_x64*)source; + OggVorbis* dst = (OggVorbis*)dest; + + #define GO(A) dst->A = src->A; + #define GOM(A, S) memcpy(&dst->A, &src->A, S); + TRANSFERT + #undef GO + #undef GOM + dst->vb.vd = (src->vb.vd == &src->vd)?&dst->vd:(vorbis_dsp_state*)src->vb.vd; +} +void UnalignOggVorbis(void* dest, void* source) +{ + // x64 -> Arm + OggVorbis_x64* dst = (OggVorbis_x64*)dest; + OggVorbis* src = (OggVorbis*)source; + + #define GO(A) dst->A = src->A; + #define GOM(A, S) memcpy(&dst->A, &src->A, S); + TRANSFERT + #undef GO + #undef GOM + dst->vb.vd = (src->vb.vd == &src->vd)?&dst->vd:(vorbis_dsp_state_x64*)src->vb.vd; +} +#undef TRANSFERT + +#define TRANSFERT \ +GO(analysisp) \ +GO(vi) \ +GO(pcm) \ +GO(pcmret) \ +GO(pcm_storage) \ +GO(pcm_current) \ +GO(pcm_returned) \ +GO(preextrapolate) \ +GO(eofflag) \ +GO(lW) \ +GO(W) \ +GO(nW) \ +GO(centerW) \ +GO(granulepos) \ +GO(sequence) \ +GO(glue_bits) \ +GO(time_bits) \ +GO(floor_bits) \ +GO(res_bits) \ +GO(backend_state) + +void UnalignVorbisDspState(void* dest, void* source) +{ + // Arm -> x64 + #define GO(A) ((vorbis_dsp_state_x64*)dest)->A = ((vorbis_dsp_state*)source)->A; + #define GOM(A, S) memcpy(&((vorbis_dsp_state_x64*)dest)->A, &((vorbis_dsp_state*)source)->A, S); + TRANSFERT + #undef GO + #undef GOM +} +void AlignVorbisDspState(void* dest, void* source) +{ + // x64 -> Arm + #define GO(A) ((vorbis_dsp_state*)dest)->A = ((vorbis_dsp_state_x64*)source)->A; + #define GOM(A, S) memcpy(&((vorbis_dsp_state*)dest)->A, &((vorbis_dsp_state_x64*)source)->A, S); + TRANSFERT + #undef GO + #undef GOM +} +#undef TRANSFERT + +#define TRANSFERT \ +GO(pcm) \ +GO(opb.endbyte) \ +GO(opb.endbit) \ +GO(opb.buffer) \ +GO(opb.ptr) \ +GO(opb.storage) \ +GO(lW) \ +GO(W) \ +GO(nW) \ +GO(pcmend) \ +GO(mode) \ +GO(eofflag) \ +GO(granulepos) \ +GO(sequence) \ +GO(vd) \ +GO(localstore) \ +GO(localtop) \ +GO(localalloc) \ +GO(totaluse) \ +GO(reap) \ +GO(glue_bits) \ +GO(time_bits) \ +GO(floor_bits) \ +GO(res_bits) \ +GO(internal) + +void UnalignVorbisBlock(void* dest, void* source) +{ + // Arm -> x64 + #define GO(A) ((vorbis_block_x64*)dest)->A = ((vorbis_block*)source)->A; + #define GOM(A, S) memcpy(&((vorbis_block_x64*)dest)->A, &((vorbis_block*)source)->A, S); + TRANSFERT + #undef GO + #undef GOM +} +void AlignVorbisBlock(void* dest, void* source) +{ + // x64 -> Arm + #define GO(A) ((vorbis_block*)dest)->A = ((vorbis_block_x64*)source)->A; + #define GOM(A, S) memcpy(&((vorbis_block*)dest)->A, &((vorbis_block_x64*)source)->A, S); + TRANSFERT + #undef GO + #undef GOM +} + +#undef TRANSFERT +#endif +typedef union __attribute__((packed, aligned(4))) i386_epoll_data { + ptr_t ptr; //void* + int fd; + uint32_t u32; + uint64_t u64; +} i386_epoll_data_t; + +struct __attribute__((packed, aligned(4))) i386_epoll_event { + uint32_t events; + i386_epoll_data_t data; +}; +// Arm -> i386 +void UnalignEpollEvent32(void* dest, void* source, int nbr) +{ + struct i386_epoll_event *i386_struct = (struct i386_epoll_event*)dest; + struct epoll_event *arm_struct = (struct epoll_event*)source; + while(nbr) { + i386_struct->events = arm_struct->events; + i386_struct->data.u64 = arm_struct->data.u64; + ++i386_struct; + ++arm_struct; + --nbr; + } +} + +// i386 -> Arm +void AlignEpollEvent32(void* dest, void* source, int nbr) +{ + struct i386_epoll_event *i386_struct = (struct i386_epoll_event*)source; + struct epoll_event *arm_struct = (struct epoll_event*)dest; + while(nbr) { + arm_struct->events = i386_struct->events; + arm_struct->data.u64 = i386_struct->data.u64; + ++i386_struct; + ++arm_struct; + --nbr; + } +} +#if 0 +typedef struct __attribute__((packed, aligned(4))) x64_SMPEG_Info_s { + int has_audio; + int has_video; + int width; + int height; + int current_frame; + double current_fps; + char audio_string[80]; + int audio_current_frame; + uint32_t current_offset; + uint32_t total_size; + double current_time; + double total_time; +} x64_SMPEG_Info_t; + +#define TRANSFERT \ +GO(has_audio) \ +GO(has_video) \ +GO(width) \ +GO(height) \ +GO(current_frame) \ +GO(current_fps) \ +GOM(audio_string, 80) \ +GO(audio_current_frame) \ +GO(current_offset) \ +GO(total_size) \ +GO(current_time) \ +GO(total_time) + + +// Arm -> x64 +void UnalignSmpegInfo(void* dest, void* source) +{ + #define GO(A) ((x64_SMPEG_Info_t*)dest)->A = ((my_SMPEG_Info_t*)source)->A; + #define GOM(A, S) memcpy(&((x64_SMPEG_Info_t*)dest)->A, &((my_SMPEG_Info_t*)source)->A, S); + TRANSFERT + #undef GO + #undef GOM +} +// x64 -> Arm +void AlignSmpegInfo(void* dest, void* source) +{ + #define GO(A) ((my_SMPEG_Info_t*)dest)->A = ((x64_SMPEG_Info_t*)source)->A; + #define GOM(A, S) memcpy(&((my_SMPEG_Info_t*)dest)->A, &((x64_SMPEG_Info_t*)source)->A, S); + TRANSFERT + #undef GO + #undef GOM +} +#undef TRANSFERT + +#define TRANSFERT \ +GOV(fts_cycle) \ +GOV(fts_parent) \ +GOV(fts_link) \ +GO(fts_number) \ +GO(fts_pointer) \ +GO(fts_accpath) \ +GO(fts_path) \ +GO(fts_errno) \ +GO(fts_symfd) \ +GO(fts_pathlen) \ +GO(fts_namelen) \ +GO(fts_ino) \ +GO(fts_dev) \ +GO(fts_nlink) \ +GO(fts_level) \ +GO(fts_info) \ +GO(fts_flags) \ +GO(fts_instr) \ +GO(fts_statp) \ +GOM(fts_name, sizeof(void*)) + +// Arm -> x64 +void UnalignFTSENT(void* dest, void* source) +{ + #define GO(A) ((x64_ftsent_t*)dest)->A = ((FTSENT*)source)->A; + #define GOV(A) ((x64_ftsent_t*)dest)->A = (void*)((FTSENT*)source)->A; + #define GOM(A, S) memcpy(&((x64_ftsent_t*)dest)->A, &((FTSENT*)source)->A, S); + TRANSFERT + #undef GO + #undef GOV + #undef GOM +} +// x64 -> Arm +void AlignFTSENT(void* dest, void* source) +{ + #define GO(A) ((FTSENT*)dest)->A = ((x64_ftsent_t*)source)->A; + #define GOV(A) ((FTSENT*)dest)->A = (void*)((x64_ftsent_t*)source)->A; + #define GOM(A, S) memcpy(&((FTSENT*)dest)->A, &((x64_ftsent_t*)source)->A, S); + TRANSFERT + #undef GO + #undef GOV + #undef GOM +} +#undef TRANSFERT + +void alignNGValue(my_GValue_t* v, void* value, int n) +{ + while(n) { + v->g_type = *(int*)value; + memcpy(v->data, value+4, 2*sizeof(double)); + ++v; + value+=4+2*sizeof(double); + --n; + } +} +void unalignNGValue(void* value, my_GValue_t* v, int n) +{ + while(n) { + *(int*)value = v->g_type; + memcpy(value+4, v->data, 2*sizeof(double)); + ++v; + value+=4+2*sizeof(double); + --n; + } +} +#endif + +// x86 -> Native +void AlignIOV_32(void* dest, void* source) +{ + struct iovec* d = dest; + struct i386_iovec* s = source; + + d->iov_base = from_ptrv(s->iov_base); + d->iov_len = s->iov_len; +} + +// Native -> x86 +void UnalignIOV_32(void* dest, void* source) +{ + struct iovec* s = source; + struct i386_iovec* d = dest; + + d->iov_base = to_ptrv(s->iov_base); + d->iov_len = s->iov_len; +} + +void* my32___cmsg_nxthdr(struct i386_msghdr* mhdr, struct i386_cmsghdr* cmsg); + +// x86 -> Native +void AlignMsgHdr_32(void* dest, void* dest_iov, void* dest_cmsg, void* source, int convert_control) +{ + struct iovec* iov = dest_iov; + struct msghdr* d = dest; + struct i386_msghdr* s = source; + struct i386_iovec* s_iov = from_ptrv(s->msg_iov); + d->msg_name = from_ptrv(s->msg_name); + d->msg_namelen = s->msg_namelen; + d->msg_iov = iov; + // TODO: check if iovlen is too big + for(uint32_t i=0; imsg_iovlen; ++i) { + AlignIOV_32(d->msg_iov+i, s_iov+i); + } + d->msg_iovlen = s->msg_iovlen; + d->msg_controllen = s->msg_controllen; + if(convert_control) { + if(s->msg_control) { + d->msg_control = dest_cmsg; + struct i386_cmsghdr* cmsg = (s->msg_controllen)?from_ptrv(s->msg_control):NULL; + struct cmsghdr* dcmsg = dest_cmsg; + while(cmsg) { + dcmsg->cmsg_len = from_ulong(cmsg->cmsg_len); + dcmsg->cmsg_level = cmsg->cmsg_level; + dcmsg->cmsg_type = cmsg->cmsg_type; + if(cmsg->cmsg_len) { + dcmsg->cmsg_len += 4; + memcpy(CMSG_DATA(dcmsg), cmsg+1, cmsg->cmsg_len-sizeof(struct i386_cmsghdr)); + d->msg_controllen += 4; + } + struct cmsghdr* next = (struct cmsghdr*)(((uintptr_t)dcmsg) + ((dcmsg->cmsg_len+7)&~7)); + cmsg = my32___cmsg_nxthdr(s, cmsg); + uintptr_t next_diff = (uintptr_t)next-((uintptr_t)dcmsg+dcmsg->cmsg_len); + if(cmsg) + d->msg_controllen+=next_diff; + dcmsg = next; + + } + } else + d->msg_control = NULL; + } else { + if(d->msg_controllen) d->msg_controllen+=4; + d->msg_control = (s->msg_control)?dest_cmsg:NULL; + if(d->msg_control) memset(d->msg_control, 0, d->msg_controllen); + } + d->msg_flags = s->msg_flags; +} + +void UnalignMsgHdr_32(void* dest, void* source) +{ + struct msghdr* s = source; + struct i386_msghdr* d = dest; + struct iovec* s_iov = s->msg_iov; + struct i386_iovec* d_iov = from_ptrv(d->msg_iov); + d->msg_name = to_ptrv(s->msg_name); + d->msg_namelen = s->msg_namelen; + // TODO: check if iovlen is too big + for(uint32_t i=0; imsg_iovlen; ++i) { + UnalignIOV_32(d_iov+i, s_iov+i); + } + d->msg_iovlen = s->msg_iovlen; + d->msg_controllen = s->msg_controllen; + if(s->msg_control) { + struct i386_cmsghdr* dcmsg = from_ptrv(d->msg_control); + struct cmsghdr* scmsg = (s->msg_controllen)?s->msg_control:NULL; + while(scmsg) { + dcmsg->cmsg_len = to_ulong(scmsg->cmsg_len); + dcmsg->cmsg_level = scmsg->cmsg_level; + dcmsg->cmsg_type = scmsg->cmsg_type; + if(dcmsg->cmsg_len) { + dcmsg->cmsg_len -= 4; + memcpy(dcmsg+1, CMSG_DATA(scmsg), dcmsg->cmsg_len-sizeof(struct i386_cmsghdr)); + d->msg_controllen -= 4; + } + dcmsg = (struct i386_cmsghdr*)(((uintptr_t)dcmsg) + ((dcmsg->cmsg_len+3)&~3)); + scmsg = CMSG_NXTHDR(s, scmsg); + } + } else + d->msg_control = 0; + d->msg_flags = s->msg_flags; +} + +#define TRANSFERT \ +GO(l_type) \ +GO(l_whence) \ +GO(l_start) \ +GO(l_len) \ +GO(l_pid) + +// Arm -> x86 +void UnalignFlock_32(void* dest, void* source) +{ + #define GO(A) ((i386_flock_t*)dest)->A = ((my_flock64_t*)source)->A; + TRANSFERT + #undef GO +} + +// x86 -> Arm +void AlignFlock_32(void* dest, void* source) +{ + #define GO(A) ((my_flock64_t*)dest)->A = ((i386_flock_t*)source)->A; + TRANSFERT + #undef GO +} +#undef TRANSFERT + +void convert_regext_to_32(void* d, void* s) +{ + my_regex_32_t* dst = d; + my_regex_t* src = s; + + dst->buffer = to_ptrv(src->buffer); + dst->allocated = to_ulong(src->allocated); + dst->used = to_ulong(src->used); + dst->syntax = to_ulong(src->syntax); + dst->fastmap = to_ptrv(src->fastmap); + dst->translate = to_ptrv(src->translate); + dst->re_nsub = to_ulong(src->re_nsub); + dst->flags = src->flags; +} + +void convert_regext_to_64(void* d, void* s) +{ + my_regex_t* dst = d; + my_regex_32_t* src = s; + + dst->buffer = from_ptrv(src->buffer); + dst->allocated = from_ulong(src->allocated); + dst->used = from_ulong(src->used); + dst->syntax = from_ulong(src->syntax); + dst->fastmap = from_ptrv(src->fastmap); + dst->translate = from_ptrv(src->translate); + dst->re_nsub = from_ulong(src->re_nsub); + dst->flags = src->flags; +} + +void* inplace_obstack_chunk_shrink(void* a) +{ + if(a) { + struct my_obstack_chunk_32_t* dst = a; + struct _obstack_chunk* src = a; + dst->limit = to_ptrv(src->limit); + dst->prev = to_ptrv(src->prev); + memcpy(dst->contents, src->contents, sizeof(dst->contents)); + } + return a; +} +void* inplace_obstack_chunk_enlarge(void* a) +{ + if(a) { + struct my_obstack_chunk_32_t* src = a; + struct _obstack_chunk* dst = a; + memcpy(dst->contents, src->contents, sizeof(dst->contents)); + dst->prev = from_ptrv(src->prev); + dst->limit = from_ptrv(src->limit); + } + return a; +} + +void convert_obstack_to_32(void* d, void* s) +{ + if(!d || !s) return; + struct my_obstack_32_t* dst = d; + struct obstack *src = s; + // chunks + struct _obstack_chunk* chunk = src->chunk; + while(chunk) { + struct _obstack_chunk* prev = chunk->prev; + inplace_obstack_chunk_shrink(chunk); + chunk = prev; + } + // struture + dst->chunk_size = to_long(src->chunk_size); + dst->chunk = to_ptrv(src->chunk); + dst->object_base = to_ptrv(src->object_base); + dst->next_free = to_ptrv(src->next_free); + dst->chunk_limit = to_ptrv(src->chunk_limit); + dst->temp.tempptr = to_ptrv(src->temp.tempptr); + dst->chunkfun = to_ptrv(src->chunkfun); + dst->freefun = to_ptrv(src->freefun); + dst->extra_arg = to_ptrv(src->extra_arg); + dst->use_extra_arg = src->use_extra_arg; + dst->maybe_empty_object = src->maybe_empty_object; + dst->alloc_failed = src->alloc_failed; +} +void convert_obstack_to_64(void* d, void* s) +{ + if(!d || !s) return; + struct my_obstack_32_t* src = s; + struct obstack *dst = d; + // struture + dst->alloc_failed = src->alloc_failed; + dst->maybe_empty_object = src->maybe_empty_object; + dst->use_extra_arg = src->use_extra_arg; + dst->extra_arg = from_ptrv(src->extra_arg); + dst->freefun = from_ptrv(src->freefun); + dst->chunkfun = from_ptrv(src->chunkfun); + dst->temp.tempptr = from_ptrv(src->temp.tempptr); + dst->chunk_limit = from_ptrv(src->chunk_limit); + dst->next_free = from_ptrv(src->next_free); + dst->object_base = from_ptrv(src->object_base); + dst->chunk = from_ptrv(src->chunk); + dst->chunk_size = from_long(src->chunk_size); + // chunks + struct _obstack_chunk* chunk = dst->chunk; + while(chunk) { + struct _obstack_chunk* prev = chunk->prev; + inplace_obstack_chunk_enlarge(chunk); + chunk = prev; + } +} diff --git a/src/libtools/myalign64_32.c b/src/libtools/myalign64_32.c new file mode 100755 index 0000000..a1d411d --- /dev/null +++ b/src/libtools/myalign64_32.c @@ -0,0 +1,227 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "box32.h" + +void UnalignStat64_32(const void* source, void* dest) +{ + struct i386_stat64 *i386st = (struct i386_stat64*)dest; + struct stat *st = (struct stat*) source; + + memset(i386st->__pad0, 0, sizeof(i386st->__pad0)); + memset(i386st->__pad3, 0, sizeof(i386st->__pad3)); + i386st->st_dev = st->st_dev; + i386st->__st_ino = st->st_ino; + i386st->st_mode = st->st_mode; + i386st->st_nlink = st->st_nlink; + i386st->st_uid = st->st_uid; + i386st->st_gid = st->st_gid; + i386st->st_rdev = st->st_rdev; + i386st->st_size = st->st_size; + i386st->st_blksize = st->st_blksize; + i386st->st_blocks = st->st_blocks; + i386st->st_atime = st->st_atime; + i386st->st_atime_nsec = st->st_atime_nsec; + i386st->st_mtime = st->st_mtime; + i386st->st_mtime_nsec = st->st_mtime_nsec; + i386st->st_ctime = st->st_ctime; + i386st->st_ctime_nsec = st->st_ctime_nsec; + i386st->st_ino = st->st_ino; +} + +void UnalignStat64_32_t64(const void* source, void* dest) +{ + struct i386_stat64_t64 *i386st = (struct i386_stat64_t64*)dest; + struct stat *st = (struct stat*) source; + + i386st->st_dev = st->st_dev; + i386st->st_ino = st->st_ino; + i386st->st_mode = st->st_mode; + i386st->st_nlink = st->st_nlink; + i386st->st_uid = st->st_uid; + i386st->st_gid = st->st_gid; + i386st->st_rdev = st->st_rdev; + i386st->st_size = st->st_size; + i386st->st_blksize = st->st_blksize; + i386st->st_blocks = st->st_blocks; + i386st->st_atime = st->st_atime; + i386st->st_atime_nsec = st->st_atime_nsec; + i386st->st_mtime = st->st_mtime; + i386st->st_mtime_nsec = st->st_mtime_nsec; + i386st->st_ctime = st->st_ctime; + i386st->st_ctime_nsec = st->st_ctime_nsec; +} + +struct native_fsid { + int val[2]; +}; + +struct native_statfs64 { + long f_type; + long f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + struct native_fsid f_fsid; + long f_namelen; + long f_frsize; + long f_flags; + long f_spare[4]; +}; // f_flags is not always defined, but then f_spare is [5] in that case + +void UnalignStatFS64_32(const void* source, void* dest) +{ + struct i386_statfs64 *i386st = (struct i386_statfs64*)dest; + struct native_statfs64 *st = (struct native_statfs64*) source; + + i386st->f_type = to_long(st->f_type); + i386st->f_bsize = to_long(st->f_bsize); + i386st->f_blocks = st->f_blocks; + i386st->f_bfree = st->f_bfree; + i386st->f_bavail = st->f_bavail; + i386st->f_files = st->f_files; + i386st->f_ffree = st->f_ffree; + memcpy(&i386st->f_fsid, &st->f_fsid, sizeof(i386st->f_fsid)); + i386st->f_namelen = to_long(st->f_namelen); + i386st->f_frsize = to_long(st->f_frsize); + i386st->f_flags = to_long(st->f_flags); + i386st->f_spare[0] = to_long(st->f_spare[0]); + i386st->f_spare[1] = to_long(st->f_spare[1]); + i386st->f_spare[2] = to_long(st->f_spare[2]); + i386st->f_spare[3] = to_long(st->f_spare[3]); +} + +void UnalignStatFS_32(const void* source, void* dest) +{ + struct i386_statfs *i386st = (struct i386_statfs*)dest; + struct native_statfs64 *st = (struct native_statfs64*) source; + + i386st->f_type = st->f_type; + i386st->f_bsize = st->f_bsize; + i386st->f_blocks = st->f_blocks; + i386st->f_bfree = st->f_bfree; + i386st->f_bavail = st->f_bavail; + i386st->f_files = st->f_files; + i386st->f_ffree = st->f_ffree; + memcpy(&i386st->f_fsid, &st->f_fsid, sizeof(i386st->f_fsid)); + i386st->f_namelen = st->f_namelen; + i386st->f_frsize = st->f_frsize; + i386st->f_flags = st->f_flags; + i386st->f_spare[0] = st->f_spare[0]; + i386st->f_spare[1] = st->f_spare[1]; + i386st->f_spare[2] = st->f_spare[2]; + i386st->f_spare[3] = st->f_spare[3]; +} + +struct native_statvfs { + unsigned long int f_bsize; + unsigned long int f_frsize; +#ifndef ANDROID + __fsblkcnt64_t f_blocks; + __fsblkcnt64_t f_bfree; + __fsblkcnt64_t f_bavail; + __fsfilcnt64_t f_files; + __fsfilcnt64_t f_ffree; + __fsfilcnt64_t f_favail; +#else + fsblkcnt_t f_blocks; + fsblkcnt_t f_bfree; + fsblkcnt_t f_bavail; + fsblkcnt_t f_files; + fsblkcnt_t f_ffree; + fsblkcnt_t f_favail; +#endif + unsigned long int f_fsid; +#ifdef _STATVFSBUF_F_UNUSED + int __f_unused; +#endif + unsigned long int f_flag; + unsigned long int f_namemax; + unsigned int f_type; + int __f_spare[5]; +}; + +void UnalignStatVFS64_32(const void* source, void* dest) +{ + struct i386_statvfs64 *i386st = (struct i386_statvfs64*)dest; + struct native_statvfs *st = (struct native_statvfs*) source; + + i386st->f_bsize = st->f_bsize; + i386st->f_frsize = st->f_frsize; + i386st->f_blocks = st->f_blocks; + i386st->f_bfree = st->f_bfree; + i386st->f_bavail = st->f_bavail; + i386st->f_files = st->f_files; + i386st->f_ffree = st->f_ffree; + i386st->f_favail = st->f_favail; + i386st->f_fsid = st->f_fsid; + i386st->f_flag = st->f_flag; + i386st->f_namemax = st->f_namemax; + i386st->f_type = st->f_type; +} + +void UnalignStatVFS_32(const void* source, void* dest) +{ + struct i386_statvfs *i386st = (struct i386_statvfs*)dest; + struct native_statvfs *st = (struct native_statvfs*) source; + + i386st->f_bsize = st->f_bsize; + i386st->f_frsize = st->f_frsize; + i386st->f_blocks = st->f_blocks; + i386st->f_bfree = st->f_bfree; + i386st->f_bavail = st->f_bavail; + i386st->f_files = st->f_files; + i386st->f_ffree = st->f_ffree; + i386st->f_favail = st->f_favail; + i386st->f_fsid = st->f_fsid; + i386st->f_flag = st->f_flag; + i386st->f_namemax = st->f_namemax; + i386st->f_type = st->f_type; +} + +void UnalignDirent_32(const void* source, void* dest) +{ + struct i386_dirent* i386d = (struct i386_dirent*)dest; + struct dirent* d = (struct dirent*)source; + + i386d->d_ino = d->d_ino ^ (d->d_ino >> 32); + i386d->d_off = d->d_off; + i386d->d_reclen = d->d_reclen - 8; + i386d->d_type = d->d_type; + memcpy(i386d->d_name, d->d_name, d->d_reclen - (8+2+1)); +} + +#define TRANSFERT \ +GO(l_type) \ +GO(l_whence) \ +GO(l_start) \ +GO(l_len) \ +GO(l_pid) + +// Arm -> x86 +void UnalignFlock64_32(void* dest, void* source) +{ + #define GO(A) ((x86_flock64_t*)dest)->A = ((my_flock64_t*)source)->A; + TRANSFERT + #undef GO +} + +// x86 -> Arm +void AlignFlock64_32(void* dest, void* source) +{ + #define GO(A) ((my_flock64_t*)dest)->A = ((x86_flock64_t*)source)->A; + TRANSFERT + #undef GO +} +#undef TRANSFERT diff --git a/src/libtools/myalignxcb32.c b/src/libtools/myalignxcb32.c new file mode 100644 index 0000000..60f28c4 --- /dev/null +++ b/src/libtools/myalignxcb32.c @@ -0,0 +1,221 @@ +#include +#include +#include + +#include "debug.h" +#include "myalign32.h" +#include "threads32.h" +#include "my_xcb_defs.h" + +typedef struct my_xcb_ext_32_s { + fake_phtread_mutex_t lock; + ptr_t extensions; //struct lazyreply * + int extensions_size; +} my_xcb_ext_32_t; + +typedef struct my_xcb_xid_32_s { + fake_phtread_mutex_t lock; + uint32_t last; + uint32_t base; + uint32_t max; + uint32_t inc; +} my_xcb_xid_32_t; + +typedef struct my_xcb_out_32_s { + pthread_cond_t cond; + int writing; + pthread_cond_t socket_cond; + ptr_t return_socket;//void (*return_socket)(void *closure); + ptr_t socket_closure;//void * + int socket_moving; + char queue[16384]; + int queue_len; + uint64_t request; + uint64_t request_written; + fake_phtread_mutex_t reqlenlock; + int maximum_request_length_tag; + uint32_t maximum_request_length; + my_xcb_fd_t out_fd; +} my_xcb_out_32_t; + +typedef struct my_xcb_in_32_s { + pthread_cond_t event_cond; + int reading; + char queue[4096]; + int queue_len; + uint64_t request_expected; + uint64_t request_read; + uint64_t request_completed; + ptr_t current_reply;//struct reply_list * + ptr_t current_reply_tail;//struct reply_list ** + ptr_t replies;//void* + ptr_t events;//struct event_list * + ptr_t events_tail;//struct event_list ** + ptr_t readers;//struct reader_list * + ptr_t special_waiters;//struct special_list * + ptr_t pending_replies;//struct pending_reply * + ptr_t pending_replies_tail;//struct pending_reply ** + my_xcb_fd_t in_fd; + ptr_t special_events;//struct xcb_special_event * +} my_xcb_in_32_t; + +typedef struct my_xcb_connection_32_s { + int has_error; + ptr_t setup; //void * + int fd; + fake_phtread_mutex_t iolock; + my_xcb_in_32_t in; + my_xcb_out_32_t out; + my_xcb_ext_32_t ext; + my_xcb_xid_32_t xid; +} my_xcb_connection_32_t; + +#define NXCB 32 +static my_xcb_connection_t* my_xcb_connects[NXCB] = {0}; +static my_xcb_connection_32_t i386_xcb_connects[NXCB] = {0}; +static my_xcb_connection_t* tmp_xcb_connect = NULL; +static my_xcb_connection_32_t i386_tmp_xcb_connect = {0}; + +void* temp_xcb_connection32(void* src); + +void* align_xcb_connection32(void* src) +{ + if(!src) + return src; + // find it + my_xcb_connection_t * dest = NULL; + for(int i=0; ihas_error = source->has_error; + dest->setup = from_ptrv(source->setup); + dest->fd = source->fd; + //memcpy(&dest->iolock, source->iolock, MUTEX_SIZE_X64); + //dest->in = source->in; + //dest->out = source->out; + //memcpy(&dest->ext.lock, source->ext.lock, MUTEX_SIZE_X64); + dest->ext.extensions = from_ptrv(source->ext.extensions); + dest->ext.extensions_size = source->ext.extensions_size; + //memcpy(&dest->xid.lock, source->xid.lock, MUTEX_SIZE_X64); + dest->xid.base = source->xid.base; + dest->xid.inc = source->xid.inc; + dest->xid.last = source->xid.last; + dest->xid.max = source->xid.last; + #endif + return dest; +} + +static void setup_mutex(fake_phtread_mutex_t* mutex, pthread_mutex_t* src) +{ + memset(mutex, 0, sizeof(*mutex)); + mutex->__kind = KIND_SIGN; + mutex->real_mutex = to_ptrv(src); +} + +void unalign_xcb_connection32(void* src, void* dst) +{ + if(!src || !dst || src==dst) + return; + // update values + my_xcb_connection_t* source = src; + my_xcb_connection_32_t* dest = dst; + dest->has_error = source->has_error; + dest->setup = to_ptrv(source->setup); + dest->fd = source->fd; + setup_mutex(&dest->iolock, &source->iolock); + dest->in.event_cond = source->in.event_cond; + dest->in.reading = source->in.reading; + memcpy(dest->in.queue, source->in.queue, sizeof(dest->in.queue)); + dest->in.queue_len = source->in.queue_len; + dest->in.request_expected = source->in.request_expected; + dest->in.request_read = source->in.request_read; + dest->in.request_completed = source->in.request_completed; + dest->in.current_reply = to_ptrv(source->in.current_reply); + dest->in.current_reply_tail = to_ptrv(source->in.current_reply_tail); + dest->in.replies = to_ptrv(source->in.replies); + dest->in.events = to_ptrv(source->in.events); + dest->in.events_tail = to_ptrv(source->in.events_tail); + dest->in.readers = to_ptrv(source->in.readers); + dest->in.special_waiters = to_ptrv(source->in.special_waiters); + dest->in.pending_replies = to_ptrv(source->in.pending_replies); + dest->in.pending_replies_tail = to_ptrv(source->in.pending_replies_tail); + dest->in.in_fd = source->in.in_fd; + dest->in.special_events = to_ptrv(source->in.special_events); + setup_mutex(&dest->out.reqlenlock, &source->out.reqlenlock); + dest->out.cond = source->out.cond; + dest->out.maximum_request_length = source->out.maximum_request_length; + dest->out.maximum_request_length_tag = source->out.maximum_request_length_tag; + dest->out.out_fd = source->out.out_fd; + memcpy(dest->out.queue, source->out.queue, sizeof(dest->out.queue)); + dest->out.queue_len = source->out.queue_len; + dest->out.request = source->out.request; + dest->out.request_written = source->out.request_written; + dest->out.return_socket = to_ptrv(source->out.return_socket); + dest->out.socket_closure = to_ptrv(source->out.socket_closure); + dest->out.socket_cond = source->out.socket_cond; + dest->out.socket_moving = source->out.socket_moving; + dest->out.writing = source->out.writing; + setup_mutex(&dest->ext.lock, &source->ext.lock); + dest->ext.extensions = to_ptrv(source->ext.extensions); + dest->ext.extensions_size = source->ext.extensions_size; + setup_mutex(&dest->xid.lock, &source->xid.lock); + dest->xid.base = source->xid.base; + dest->xid.inc = source->xid.inc; + dest->xid.last = source->xid.last; + dest->xid.max = source->xid.last; +} + +void* add_xcb_connection32(void* src) +{ + if(!src) + return src; + // check if already exist + for(int i=0; iscratch); + PREPARE_VALIST_32; + int r = obstack_vprintf(&obstack_l, (const char*)fmt, VARARGS_32); + convert_obstack_to_32(obstack, &obstack_l); + return r; +} +#endif #endif EXPORT void* my_obstack_alloc_failed_handler = NULL; diff --git a/src/libtools/sdl1align32.c b/src/libtools/sdl1align32.c new file mode 100644 index 0000000..008a65c --- /dev/null +++ b/src/libtools/sdl1align32.c @@ -0,0 +1,313 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "debug.h" +#include "box32.h" +#include "sdl1align32.h" + + +void inplace_SDL_Palette_to_64(void* a) { + if(!a) return; + my_SDL_Palette_32_t* src = a; + my_SDL_Palette_t* dst = a; + dst->colors = from_ptrv(src->colors); +} +void inplace_SDL_Palette_to_32(void* a) { + if(!a) return; + my_SDL_Palette_t* src = a; + my_SDL_Palette_32_t* dst = a; + dst->colors = to_ptrv(src->colors); +} +void inplace_SDL_PixelFormat_to_64_nopalette(void* a) { + if(!a) return; + my_SDL_PixelFormat_32_t* src = a; + my_SDL_PixelFormat_t* dst = a; + memmove(&dst->BitsPerPixel, &src->BitsPerPixel, sizeof(my_SDL_PixelFormat_t)-offsetof(my_SDL_PixelFormat_t, BitsPerPixel)); + dst->palette = from_ptrv(src->palette); +} +void inplace_SDL_PixelFormat_to_64(void* a) { + if(!a) return; + my_SDL_PixelFormat_32_t* src = a; + my_SDL_PixelFormat_t* dst = a; + memmove(&dst->BitsPerPixel, &src->BitsPerPixel, sizeof(my_SDL_PixelFormat_t)-offsetof(my_SDL_PixelFormat_t, BitsPerPixel)); + dst->palette = from_ptrv(src->palette); + inplace_SDL_Palette_to_64(dst->palette); +} +void inplace_SDL_PixelFormat_to_32(void* a) { + if(!a) return; + my_SDL_PixelFormat_t* src = a; + my_SDL_PixelFormat_32_t* dst = a; + inplace_SDL_Palette_to_32(src->palette); + dst->palette = to_ptrv(src->palette); + memmove(&dst->BitsPerPixel, &src->BitsPerPixel, sizeof(my_SDL_PixelFormat_32_t)-offsetof(my_SDL_PixelFormat_32_t, BitsPerPixel)); +} + +void inplace_SDL_Surface_to_64(void* a) { + if(!a) return; + my_SDL_Surface_32_t* src = a; + my_SDL_Surface_t* dst = a; + dst->refcount = src->refcount; + dst->format_version = src->format_version; + dst->map = from_ptrv(src->map); + dst->locked = src->locked; + dst->unused1 = src->unused1; + memmove(&dst->clip_rect, &src->clip_rect, sizeof(dst->clip_rect)); + dst->hwdata = from_ptrv(src->hwdata); + dst->offset = src->offset; + dst->pixels = from_ptrv(src->pixels); + dst->pitch = src->pitch; + dst->h = src->h; + dst->w = src->w; + dst->format = from_ptrv(src->format); + inplace_SDL_PixelFormat_to_64(dst->format); +} +void inplace_SDL_Surface_to_32(void* a) { + if(!a) return; + my_SDL_Surface_t* src = a; + my_SDL_Surface_32_t* dst = a; + inplace_SDL_PixelFormat_to_32(src->format); + dst->format = to_ptrv(src->format); + dst->w = src->w; + dst->h = src->h; + dst->pitch = src->pitch; + dst->pixels = to_ptrv(src->pixels); + dst->offset = src->offset; + dst->hwdata = to_ptrv(src->hwdata); + memmove(&dst->clip_rect, &src->clip_rect, sizeof(dst->clip_rect)); + dst->unused1 = src->unused1; + dst->locked = src->locked; + dst->map = to_ptrv(src->map); + dst->format_version = src->format_version; + dst->refcount = src->refcount; +} + + +void convert_SDL_Event_to_32(void* dst_, const void* src_) +{ + if(!src_|| !dst_) return; + const my_SDL_Event_t *src = src_; + my_SDL_Event_32_t* dst = dst_; + dst->type = src->type; + switch(src->type) { + case SDL_ACTIVEEVENT: + dst->active.gain = src->active.gain; + dst->active.state = src->active.state; + break; + case SDL_KEYUP: + case SDL_KEYDOWN: + dst->key.keysym.mod = src->key.keysym.mod; + dst->key.keysym.scancode = src->key.keysym.scancode; + dst->key.keysym.sym = src->key.keysym.sym; + dst->key.keysym.unicode = src->key.keysym.unicode; + dst->key.state = src->key.state; + dst->key.which = dst->key.which; + break; + case SDL_MOUSEMOTION: + dst->motion.state = src->motion.state; + dst->motion.which = src->motion.which; + dst->motion.x = src->motion.x; + dst->motion.y = src->motion.y; + dst->motion.xrel = src->motion.xrel; + dst->motion.yrel = src->motion.yrel; + break; + case SDL_MOUSEBUTTONUP: + case SDL_MOUSEBUTTONDOWN: + dst->button.button = src->button.button; + dst->button.state = src->button.state; + dst->button.which = src->button.which; + dst->button.x = src->button.x; + dst->button.y = src->button.y; + break; + case SDL_JOYAXISMOTION: + dst->jaxis.axis = src->jaxis.axis; + dst->jaxis.value = src->jaxis.value; + dst->jaxis.which = src->jaxis.which; + break; + case SDL_JOYBALLMOTION: + dst->jball.ball = src->jball.ball; + dst->jball.which = src->jball.which; + dst->jball.xrel = src->jball.xrel; + dst->jball.yrel = src->jball.yrel; + break; + case SDL_JOYHATMOTION: + dst->jhat.hat = src->jhat.hat; + dst->jhat.value = src->jhat.value; + dst->jhat.which = src->jhat.which; + break; + case SDL_JOYBUTTONUP: + case SDL_JOYBUTTONDOWN: + dst->jbutton.button = src->jbutton.button; + dst->jbutton.state = src->jbutton.state; + dst->jbutton.which = src->jbutton.which; + break; + case SDL_VIDEORESIZE: + dst->resize.h = src->resize.h; + dst->resize.w = src->resize.w; + break; + case SDL_VIDEOEXPOSE: + case SDL_QUIT: + break; + case SDL_USEREVENT: + dst->user.code = src->user.code; + dst->user.data1 = to_ptrv(src->user.data1); + dst->user.data2 = to_ptrv(src->user.data2); + break; + case SDL_SYSWMEVENT: + printf_log(LOG_NONE, "TODO: Convert SDL_SYSWMEVENT\n"); + abort(); + break; + default: + printf_log(LOG_INFO, "Warning, unsupported SDL1.2 event %d\n", src->type); + memcpy(dst, src, sizeof(my_SDL_Event_32_t)); + } +} +void convert_SDL_Event_to_64(void* dst_, const void* src_) +{ + if(!src_|| !dst_) return; + const my_SDL_Event_32_t *src = src_; + my_SDL_Event_t* dst = dst_; + dst->type = src->type; + switch(src->type) { + case SDL_ACTIVEEVENT: + dst->active.gain = src->active.gain; + dst->active.state = src->active.state; + break; + case SDL_KEYUP: + case SDL_KEYDOWN: + dst->key.keysym.mod = src->key.keysym.mod; + dst->key.keysym.scancode = src->key.keysym.scancode; + dst->key.keysym.sym = src->key.keysym.sym; + dst->key.keysym.unicode = src->key.keysym.unicode; + dst->key.state = src->key.state; + dst->key.which = dst->key.which; + break; + case SDL_MOUSEMOTION: + dst->motion.state = src->motion.state; + dst->motion.which = src->motion.which; + dst->motion.x = src->motion.x; + dst->motion.y = src->motion.y; + dst->motion.xrel = src->motion.xrel; + dst->motion.yrel = src->motion.yrel; + break; + case SDL_MOUSEBUTTONUP: + case SDL_MOUSEBUTTONDOWN: + dst->button.button = src->button.button; + dst->button.state = src->button.state; + dst->button.which = src->button.which; + dst->button.x = src->button.x; + dst->button.y = src->button.y; + break; + case SDL_JOYAXISMOTION: + dst->jaxis.axis = src->jaxis.axis; + dst->jaxis.value = src->jaxis.value; + dst->jaxis.which = src->jaxis.which; + break; + case SDL_JOYBALLMOTION: + dst->jball.ball = src->jball.ball; + dst->jball.which = src->jball.which; + dst->jball.xrel = src->jball.xrel; + dst->jball.yrel = src->jball.yrel; + break; + case SDL_JOYHATMOTION: + dst->jhat.hat = src->jhat.hat; + dst->jhat.value = src->jhat.value; + dst->jhat.which = src->jhat.which; + break; + case SDL_JOYBUTTONUP: + case SDL_JOYBUTTONDOWN: + dst->jbutton.button = src->jbutton.button; + dst->jbutton.state = src->jbutton.state; + dst->jbutton.which = src->jbutton.which; + break; + case SDL_VIDEORESIZE: + dst->resize.h = src->resize.h; + dst->resize.w = src->resize.w; + break; + case SDL_VIDEOEXPOSE: + case SDL_QUIT: + break; + case SDL_USEREVENT: + dst->user.code = src->user.code; + dst->user.data1 = from_ptrv(src->user.data1); + dst->user.data2 = from_ptrv(src->user.data2); + break; + case SDL_SYSWMEVENT: + printf_log(LOG_NONE, "TODO: Convert SDL_SYSWMEVENT\n"); + abort(); + break; + default: + printf_log(LOG_INFO, "Warning, unsupported SDL1.2 (un)event %d\n", src->type); + memcpy(dst, src, sizeof(my_SDL_Event_32_t)); + } +} + +void inplace_SDL_RWops_to_64(void* a) +{ + if(!a) return; + my_SDL_RWops_32_t* src = a; + my_SDL_RWops_t* dst = a; + memmove(&dst->hidden, &src->hidden, sizeof(dst->hidden)); + dst->type = src->type; + dst->close = from_ptrv(src->close); + dst->write = from_ptrv(src->write); + dst->read = from_ptrv(src->read); + dst->seek = from_ptrv(src->seek); + +} +void inplace_SDL_RWops_to_32(void* a) +{ + if(!a) return; + my_SDL_RWops_t* src = a; + my_SDL_RWops_32_t* dst = a; + dst->seek = to_ptrv(src->seek); + dst->read = to_ptrv(src->read); + dst->write = to_ptrv(src->write); + dst->close = to_ptrv(src->close); + dst->type = src->type; + memmove(&dst->hidden, &src->hidden, sizeof(dst->hidden)); +} + +void convert_AudioCVT_to_32(void* d, void* s) +{ + my_SDL_AudioCVT_32_t* dst = d; + my_SDL_AudioCVT_t* src = s; + dst->needed = src->needed; + dst->src_format = src->src_format; + dst->dest_format = src->dest_format; + dst->rate_incr = src->rate_incr; + dst->buf = to_ptrv(src->buf); + dst->len = src->len; + dst->len_cvt = src->len_cvt; + dst->len_mult = src->len_mult; + dst->len_ratio = src->len_ratio; + for(int i=0; i<10; ++i) + dst->filters[i] = to_ptrv(src->filters[i]); + dst->filter_index = src->filter_index; +} +void convert_AudioCVT_to_64(void* d, void* s) +{ + my_SDL_AudioCVT_t* dst = d; + my_SDL_AudioCVT_32_t* src = s; + dst->needed = src->needed; + dst->src_format = src->src_format; + dst->dest_format = src->dest_format; + dst->rate_incr = src->rate_incr; + dst->buf = from_ptrv(src->buf); + dst->len = src->len; + dst->len_cvt = src->len_cvt; + dst->len_mult = src->len_mult; + dst->len_ratio = src->len_ratio; + for(int i=0; i<10; ++i) + dst->filters[i] = from_ptrv(src->filters[i]); + dst->filter_index = src->filter_index; +} diff --git a/src/libtools/sdl1rwops.c b/src/libtools/sdl1rwops.c index ec3f8ab..b9ccbd3 100644 --- a/src/libtools/sdl1rwops.c +++ b/src/libtools/sdl1rwops.c @@ -6,8 +6,11 @@ #include "sdl1rwops.h" #include "debug.h" #include "wrapper.h" +#ifdef BOX32 +#include "wrapper32.h" +#include "sdl1align32.h" +#endif #include "box64context.h" -#include "x64run.h" #include "x64emu.h" #include "emu/x64emu_private.h" #include "librarian/library_private.h" @@ -51,21 +54,70 @@ typedef struct SDL1_RWops_s { } hidden; } SDL1_RWops_t; +#ifdef BOX32 +#define SUPER() \ + if (box64_is32bits) { \ + GO(seek, iFpii_32) \ + GO(read, iFppii_32) \ + GO(write, iFppii_32) \ + GO(close, iFp_32) \ + } else { \ + GO(seek, iFpii) \ + GO(read, iFppii) \ + GO(write, iFppii) \ + GO(close, iFp) \ + } +#else +#define SUPER() \ + GO(seek, iFpii) \ + GO(read, iFppii) \ + GO(write, iFppii) \ + GO(close, iFp) +#endif EXPORT int32_t my_native_seek(SDL1_RWops_t *context, int32_t offset, int32_t whence) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL_RWops_to_64(context); + int ret = context->hidden.my.orig->seek(context->hidden.my.orig, offset, whence); + inplace_SDL_RWops_to_32(context); + return ret; + } + #endif return context->hidden.my.orig->seek(context->hidden.my.orig, offset, whence); } EXPORT int32_t my_native_read(SDL1_RWops_t *context, void *ptr, int32_t size, int32_t maxnum) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL_RWops_to_64(context); + int ret = context->hidden.my.orig->read(context->hidden.my.orig, ptr, size, maxnum); + inplace_SDL_RWops_to_32(context); + return ret; + } + #endif return context->hidden.my.orig->read(context->hidden.my.orig, ptr, size, maxnum); } EXPORT int32_t my_native_write(SDL1_RWops_t *context, const void *ptr, int32_t size, int32_t num) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL_RWops_to_64(context); + int ret = context->hidden.my.orig->write(context->hidden.my.orig, ptr, size, num); + inplace_SDL_RWops_to_32(context); + return ret; + } + #endif return context->hidden.my.orig->write(context->hidden.my.orig, ptr, size, num); } EXPORT int32_t my_native_close(SDL1_RWops_t *context) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL_RWops_to_64(context); + } + #endif int32_t ret = context->hidden.my.orig->close(context->hidden.my.orig); context->hidden.my.custom_free(context); return ret; @@ -109,10 +161,7 @@ SDL1_RWops_t* AddNativeRW(x64emu_t* emu, SDL1_RWops_t* ops) fnc = AddCheckBridge(system, W, my_native_##A, 0, NULL); \ newrw->A = (sdl1_##A)fnc; - GO(seek, iFpii) - GO(read, iFppii) - GO(write, iFppii) - GO(close, iFp) + SUPER() #undef GO @@ -137,10 +186,7 @@ SDL1_RWops_t* RWNativeStart(x64emu_t* emu, SDL1_RWops_t* ops) #define GO(A, W) \ newrw->A = my_emulated_##A; - GO(seek, iFpii) - GO(read, iFppii) - GO(write, iFppii) - GO(close, iFp) + SUPER() #undef GO diff --git a/src/libtools/sdl2align32.c b/src/libtools/sdl2align32.c new file mode 100644 index 0000000..2f90fde --- /dev/null +++ b/src/libtools/sdl2align32.c @@ -0,0 +1,659 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "debug.h" +#include "box32.h" +#include "sdl2align32.h" + +void inplace_SDL2_DisplayMode_to_64(void* a) +{ + if (!a) return; + my_SDL2_DisplayMode_32_t* src = a; + my_SDL2_DisplayMode_t* dst = a; + dst->driverdata = from_ptrv(src->driverdata); +} + +void inplace_SDL2_DisplayMode_to_32(void* a) +{ + if (!a) return; + my_SDL2_DisplayMode_t* src = a; + my_SDL2_DisplayMode_32_t* dst = a; + dst->driverdata = to_ptrv(src->driverdata); +} + +void convert_SDL2_DisplayMode_to_32(void* dst_, void* src_) +{ + if (!src_ || !dst_) return; + my_SDL2_DisplayMode_t* src = src_; + my_SDL2_DisplayMode_32_t* dst = dst_; + dst->format = src->format; + dst->w = src->w; + dst->h = src->h; + dst->refresh_rate = src->refresh_rate; + dst->driverdata = to_ptrv(src->driverdata); +} + +void convert_SDL2_DisplayMode_to_64(void* dst_, void* src_) +{ + if (!src_ || !dst_) return; + my_SDL2_DisplayMode_32_t* src = src_; + my_SDL2_DisplayMode_t* dst = dst_; + dst->format = src->format; + dst->w = src->w; + dst->h = src->h; + dst->refresh_rate = src->refresh_rate; + dst->driverdata = from_ptrv(src->driverdata); +} + +void convert_SDL2_Event_to_64(void* dst_, const void* src_) +{ + // in reverse order so it can be done inplace... + if (!src_ || !dst_) return; + const my_SDL2_Event_32_t* src = src_; + my_SDL2_Event_t* dst = dst_; + switch (src->type) { + case SDL2_WINDOWEVENT: + dst->window.data2 = src->window.data2; + dst->window.data1 = src->window.data1; + dst->window.padding3 = src->window.padding3; + dst->window.padding2 = src->window.padding2; + dst->window.padding1 = src->window.padding1; + dst->window.event = src->window.event; + dst->window.windowID = src->window.windowID; + dst->window.timestamp = src->window.timestamp; + dst->window.type = src->window.type; + break; + case SDL2_MOUSEMOTION: + dst->motion.yrel = src->motion.yrel; + dst->motion.xrel = src->motion.xrel; + dst->motion.y = src->motion.y; + dst->motion.x = src->motion.x; + dst->motion.state = src->motion.state; + dst->motion.which = src->motion.which; + dst->motion.windowID = src->motion.windowID; + dst->motion.timestamp = src->motion.timestamp; + dst->motion.type = src->motion.type; + break; + case SDL2_MOUSEBUTTONDOWN: + case SDL2_MOUSEBUTTONUP: + dst->button.y = src->button.y; + dst->button.x = src->button.x; + dst->button.padding1 = src->button.padding1; + dst->button.clicks = src->button.clicks; + dst->button.state = src->button.state; + dst->button.button = src->button.button; + dst->button.which = src->button.which; + dst->button.windowID = src->button.windowID; + dst->button.timestamp = src->button.timestamp; + dst->button.type = src->button.type; + break; + case SDL2_AUDIODEVICEADDED: + case SDL2_AUDIODEVICEREMOVED: + dst->adevice.padding3 = src->adevice.padding3; + dst->adevice.padding2 = src->adevice.padding2; + dst->adevice.padding1 = src->adevice.padding1; + dst->adevice.iscapture = src->adevice.iscapture; + dst->adevice.which = src->adevice.which; + dst->adevice.timestamp = src->adevice.timestamp; + dst->adevice.type = src->adevice.type; + break; + case SDL2_KEYDOWN: + case SDL2_KEYUP: + dst->key.keysym.unused = src->key.keysym.unused; + dst->key.keysym.mod = src->key.keysym.mod; + dst->key.keysym.sym = src->key.keysym.sym; + dst->key.keysym.scancode = src->key.keysym.scancode; + dst->key.padding3 = src->key.padding3; + dst->key.padding2 = src->key.padding2; + dst->key.repeat = src->key.repeat; + dst->key.state = src->key.state; + dst->key.windowID = src->key.windowID; + dst->key.timestamp = src->key.timestamp; + dst->key.type = src->key.type; + break; + case SDL2_TEXTEDITING: + dst->edit.length = src->edit.length; + dst->edit.start = src->edit.start; + memcpy(dst->edit.text, src->edit.text, 32); + dst->edit.windowID = src->edit.windowID; + dst->edit.timestamp = src->edit.timestamp; + dst->edit.type = src->edit.type; + break; + case SDL2_TEXTINPUT: + memcpy(dst->text.text, src->text.text, 32); + dst->text.windowID = src->text.windowID; + dst->text.timestamp = src->text.timestamp; + dst->text.type = src->text.type; + break; + case SDL2_MOUSEWHEEL: + dst->wheel.mouseY = src->wheel.mouseY; + dst->wheel.mouseX = src->wheel.mouseX; + dst->wheel.preciseY = src->wheel.preciseY; + dst->wheel.preciseX = src->wheel.preciseX; + dst->wheel.direction = src->wheel.direction; + dst->wheel.y = src->wheel.y; + dst->wheel.x = src->wheel.x; + dst->wheel.which = src->wheel.which; + dst->wheel.windowID = src->wheel.windowID; + dst->wheel.timestamp = src->wheel.timestamp; + dst->wheel.type = src->wheel.type; + break; + case SDL2_POLLSENTINEL: + dst->common.timestamp = src->common.timestamp; + dst->common.type = src->common.type; + break; + case SDL2_DISPLAYEVENT: + dst->display.data1 = src->display.data1; + dst->display.padding3 = src->display.padding3; + dst->display.padding2 = src->display.padding2; + dst->display.padding1 = src->display.padding1; + dst->display.event = src->display.event; + dst->display.display = src->display.display; + dst->display.timestamp = src->display.timestamp; + dst->display.type = src->display.type; + break; + case SDL2_JOYDEVICEADDED: + dst->jdevice.which = src->jdevice.which; + dst->jdevice.timestamp = src->jdevice.timestamp; + dst->jdevice.type = src->jdevice.type; + break; + case SDL2_CONTROLLERDEVICEADDED: + dst->cdevice.which = src->cdevice.which; + dst->cdevice.timestamp = src->cdevice.timestamp; + dst->cdevice.type = src->cdevice.type; + break; + case SDL2_JOYAXISMOTION: + dst->jaxis.padding4 = src->jaxis.padding4; + dst->jaxis.value = src->jaxis.value; + dst->jaxis.padding3 = src->jaxis.padding3; + dst->jaxis.padding2 = src->jaxis.padding2; + dst->jaxis.padding1 = src->jaxis.padding1; + dst->jaxis.axis = src->jaxis.axis; + dst->jaxis.which = src->jaxis.which; + dst->jaxis.timestamp = src->jaxis.timestamp; + dst->jaxis.type = src->jaxis.type; + break; + case SDL2_CONTROLLERAXISMOTION: + dst->caxis.padding4 = src->caxis.padding4; + dst->caxis.value = src->caxis.value; + dst->caxis.padding3 = src->caxis.padding3; + dst->caxis.padding2 = src->caxis.padding2; + dst->caxis.padding1 = src->caxis.padding1; + dst->caxis.axis = src->caxis.axis; + dst->caxis.which = src->caxis.which; + dst->caxis.timestamp = src->caxis.timestamp; + dst->caxis.type = src->caxis.type; + break; + case SDL2_QUIT: + dst->quit.timestamp = src->quit.timestamp; + dst->quit.type = src->quit.type; + break; + case SDL2_CLIPBOARDUPDATE: + dst->common.timestamp = src->common.timestamp; + dst->common.type = src->common.type; + break; + case SDL2_JOYBUTTONDOWN: + case SDL2_JOYBUTTONUP: + dst->jbutton.type = src->jbutton.type; + dst->jbutton.timestamp = src->jbutton.timestamp; + dst->jbutton.which = src->jbutton.which; + dst->jbutton.button = src->jbutton.button; + dst->jbutton.state = src->jbutton.state; + dst->jbutton.padding1 = src->jbutton.padding1; + dst->jbutton.padding2 = src->jbutton.padding2; + break; + case SDL2_CONTROLLERBUTTONDOWN: + case SDL2_CONTROLLERBUTTONUP: + dst->cbutton.type = src->cbutton.type; + dst->cbutton.timestamp = src->cbutton.timestamp; + dst->cbutton.which = src->cbutton.which; + dst->cbutton.button = src->cbutton.button; + dst->cbutton.state = src->cbutton.state; + dst->cbutton.padding1 = src->cbutton.padding1; + dst->cbutton.padding2 = src->cbutton.padding2; + break; + case SDL2_SYSWMEVENT: + dst->syswm.type = src->syswm.type; + dst->syswm.timestamp = src->syswm.timestamp; + dst->syswm.msg = from_ptrv(src->syswm.msg); + break; + default: + printf_log(LOG_INFO, "Warning, unsuported SDL2 event %d\n", src->type); + if(dst_!=src_) + memmove(dst, src, sizeof(my_SDL2_Event_32_t)); + } +} +void convert_SDL2_Event_to_32(void* dst_, const void* src_) +{ + if (!src_ || !dst_) return; + const my_SDL2_Event_t* src = src_; + my_SDL2_Event_32_t* dst = dst_; + dst->type = src->type; + switch (src->type) { + case SDL2_WINDOWEVENT: + dst->window.type = src->window.type; + dst->window.timestamp = src->window.timestamp; + dst->window.windowID = src->window.windowID; + dst->window.event = src->window.event; + dst->window.padding1 = src->window.padding1; + dst->window.padding2 = src->window.padding2; + dst->window.padding3 = src->window.padding3; + dst->window.data1 = src->window.data1; + dst->window.data2 = src->window.data2; + break; + case SDL2_MOUSEMOTION: + dst->motion.type = src->motion.type; + dst->motion.timestamp = src->motion.timestamp; + dst->motion.windowID = src->motion.windowID; + dst->motion.which = src->motion.which; + dst->motion.state = src->motion.state; + dst->motion.x = src->motion.x; + dst->motion.y = src->motion.y; + dst->motion.xrel = src->motion.xrel; + dst->motion.yrel = src->motion.yrel; + break; + case SDL2_MOUSEBUTTONDOWN: + case SDL2_MOUSEBUTTONUP: + dst->button.type = src->button.type; + dst->button.timestamp = src->button.timestamp; + dst->button.windowID = src->button.windowID; + dst->button.which = src->button.which; + dst->button.button = src->button.button; + dst->button.state = src->button.state; + dst->button.clicks = src->button.clicks; + dst->button.padding1 = src->button.padding1; + dst->button.x = src->button.x; + dst->button.y = src->button.y; + break; + case SDL2_AUDIODEVICEADDED: + case SDL2_AUDIODEVICEREMOVED: + dst->adevice.type = src->adevice.type; + dst->adevice.timestamp = src->adevice.timestamp; + dst->adevice.which = src->adevice.which; + dst->adevice.iscapture = src->adevice.iscapture; + dst->adevice.padding1 = src->adevice.padding1; + dst->adevice.padding2 = src->adevice.padding2; + dst->adevice.padding3 = src->adevice.padding3; + break; + case SDL2_KEYDOWN: + case SDL2_KEYUP: + dst->key.type = src->key.type; + dst->key.timestamp = src->key.timestamp; + dst->key.windowID = src->key.windowID; + dst->key.state = src->key.state; + dst->key.repeat = src->key.repeat; + dst->key.padding2 = src->key.padding2; + dst->key.padding3 = src->key.padding3; + dst->key.keysym.scancode = src->key.keysym.scancode; + dst->key.keysym.sym = src->key.keysym.sym; + dst->key.keysym.mod = src->key.keysym.mod; + dst->key.keysym.unused = src->key.keysym.unused; + break; + case SDL2_TEXTEDITING: + dst->edit.type = src->edit.type; + dst->edit.timestamp = src->edit.timestamp; + dst->edit.windowID = src->edit.windowID; + memcpy(dst->edit.text, src->edit.text, 32); + dst->edit.start = src->edit.start; + dst->edit.length = src->edit.length; + break; + case SDL2_TEXTINPUT: + dst->text.type = src->text.type; + dst->text.timestamp = src->text.timestamp; + dst->text.windowID = src->text.windowID; + memcpy(dst->text.text, src->text.text, 32); + break; + case SDL2_MOUSEWHEEL: + dst->wheel.type = src->wheel.type; + dst->wheel.timestamp = src->wheel.timestamp; + dst->wheel.windowID = src->wheel.windowID; + dst->wheel.which = src->wheel.which; + dst->wheel.x = src->wheel.x; + dst->wheel.y = src->wheel.y; + dst->wheel.direction = src->wheel.direction; + dst->wheel.preciseX = src->wheel.preciseX; + dst->wheel.preciseY = src->wheel.preciseY; + dst->wheel.mouseX = src->wheel.mouseX; + dst->wheel.mouseY = src->wheel.mouseY; + break; + case SDL2_POLLSENTINEL: + dst->common.type = src->common.type; + dst->common.timestamp = src->common.timestamp; + break; + case SDL2_DISPLAYEVENT: + dst->display.type = src->display.type; + dst->display.timestamp = src->display.timestamp; + dst->display.display = src->display.display; + dst->display.event = src->display.event; + dst->display.padding1 = src->display.padding1; + dst->display.padding2 = src->display.padding2; + dst->display.padding3 = src->display.padding3; + dst->display.data1 = src->display.data1; + break; + case SDL2_JOYDEVICEADDED: + dst->jdevice.type = src->jdevice.type; + dst->jdevice.timestamp = src->jdevice.timestamp; + dst->jdevice.which = src->jdevice.which; + break; + case SDL2_CONTROLLERDEVICEADDED: + dst->cdevice.type = src->cdevice.type; + dst->cdevice.timestamp = src->cdevice.timestamp; + dst->cdevice.which = src->cdevice.which; + break; + case SDL2_JOYAXISMOTION: + dst->jaxis.type = src->jaxis.type; + dst->jaxis.timestamp = src->jaxis.timestamp; + dst->jaxis.which = src->jaxis.which; + dst->jaxis.axis = src->jaxis.axis; + dst->jaxis.padding1 = src->jaxis.padding1; + dst->jaxis.padding2 = src->jaxis.padding2; + dst->jaxis.padding3 = src->jaxis.padding3; + dst->jaxis.value = src->jaxis.value; + dst->jaxis.padding4 = src->jaxis.padding4; + break; + case SDL2_CONTROLLERAXISMOTION: + dst->caxis.type = src->caxis.type; + dst->caxis.timestamp = src->caxis.timestamp; + dst->caxis.which = src->caxis.which; + dst->caxis.axis = src->caxis.axis; + dst->caxis.padding1 = src->caxis.padding1; + dst->caxis.padding2 = src->caxis.padding2; + dst->caxis.padding3 = src->caxis.padding3; + dst->caxis.value = src->caxis.value; + dst->caxis.padding4 = src->caxis.padding4; + break; + case SDL2_QUIT: + dst->quit.type = src->quit.type; + dst->quit.timestamp = src->quit.timestamp; + break; + case SDL2_CLIPBOARDUPDATE: + dst->common.type = src->common.type; + dst->common.timestamp = src->common.timestamp; + break; + case SDL2_JOYBUTTONDOWN: + case SDL2_JOYBUTTONUP: + dst->jbutton.type = src->jbutton.type; + dst->jbutton.timestamp = src->jbutton.timestamp; + dst->jbutton.which = src->jbutton.which; + dst->jbutton.button = src->jbutton.button; + dst->jbutton.state = src->jbutton.state; + dst->jbutton.padding1 = src->jbutton.padding1; + dst->jbutton.padding2 = src->jbutton.padding2; + break; + case SDL2_CONTROLLERBUTTONDOWN: + case SDL2_CONTROLLERBUTTONUP: + dst->cbutton.type = src->cbutton.type; + dst->cbutton.timestamp = src->cbutton.timestamp; + dst->cbutton.which = src->cbutton.which; + dst->cbutton.button = src->cbutton.button; + dst->cbutton.state = src->cbutton.state; + dst->cbutton.padding1 = src->cbutton.padding1; + dst->cbutton.padding2 = src->cbutton.padding2; + break; + case SDL2_SYSWMEVENT: + dst->syswm.type = src->syswm.type; + dst->syswm.timestamp = src->syswm.timestamp; + dst->syswm.msg = to_ptrv_silent(src->syswm.msg); // msg would need translation probably! + break; + default: + printf_log(LOG_INFO, "Warning, unsuported SDL2 event %d\n", src->type); + if(dst_!=src_) + memmove(dst, src, sizeof(my_SDL2_Event_32_t)); + } +} + +void inplace_SDL2_Event_shrink(void* e) +{ + if(!e) return; + convert_SDL2_Event_to_32(e, e); +} +void inplace_SDL2_Event_enlarge(void* e) +{ + if(!e) return; + convert_SDL2_Event_to_64(e, e); +} + +void inplace_SDL2_Palette_to_32(void* a) +{ + if (!a) return; + my_SDL2_Palette_t* src = a; + my_SDL2_Palette_32_t* dst = a; + dst->ncolors = src->ncolors; + dst->colors = to_ptrv(src->colors); + dst->version = src->version; + dst->refcount = src->refcount; +} +#define SDL2_PIXELFORMAT_SIGN 0xBADC0FEE +void inplace_SDL2_PixelFormat_to_32(void* a) +{ + while (a) { + my_SDL2_PixelFormat_t* src = a; + my_SDL2_PixelFormat_32_t* dst = a; + if(*(uint32_t*)(dst+1) != SDL2_PIXELFORMAT_SIGN) { + dst->format = src->format; + inplace_SDL2_Palette_to_32(src->palette); + dst->palette = to_ptrv(src->palette); + dst->BitsPerPixel = src->BitsPerPixel; + dst->BytesPerPixel = src->BytesPerPixel; + dst->Rmask = src->Rmask; + dst->Gmask = src->Gmask; + dst->Bmask = src->Bmask; + dst->Amask = src->Amask; + dst->Rloss = src->Rloss; + dst->Gloss = src->Gloss; + dst->Bloss = src->Bloss; + dst->Aloss = src->Aloss; + dst->Rshift = src->Rshift; + dst->Gshift = src->Gshift; + dst->Bshift = src->Bshift; + dst->Ashift = src->Ashift; + dst->refcount = src->refcount; + a = (void*)src->next; + dst->next = to_ptrv(src->next); + // put a signature to avoid muultiple unpack because of the next handling + *(uint32_t*)(dst+1) = SDL2_PIXELFORMAT_SIGN; + } else a = from_ptrv(dst->next); + } +} + +// used to mirror the pixelformat on x86 side, as the one in native side is a global static used by SDL2 and so cannot be inplace shrinked +// TODO: the pixelformats are leaking. There is no mecanism to remove them +// test of refcount should be done when surface are removed to delete the format, in sync with SDL2 +static my_SDL2_PixelFormat_32_ext_t* pixelformat_head = NULL; + +static my_SDL2_PixelFormat_32_ext_t* find_pixelformat_ext(my_SDL2_PixelFormat_t* a) +{ + my_SDL2_PixelFormat_32_ext_t* head = pixelformat_head; + while(head) { + if(head->ref == a) + return head; + head = head->next; + } + return NULL; +} + +void* replace_SDL2_PixelFormat_to_32_ext(void* a) +{ + if(!a) return NULL; + my_SDL2_PixelFormat_t* src = a; + my_SDL2_PixelFormat_32_ext_t* dst = find_pixelformat_ext(src); + if(dst) return dst; + // create a new one + dst = calloc(1, sizeof(my_SDL2_PixelFormat_32_ext_t)+(src->palette?sizeof(my_SDL2_Palette_32_t):0)); // not using box_calloc as we want this to be 32bits + // copye the values + dst->ref = src; + dst->fmt.format = src->format; + if(src->palette) { + my_SDL2_Palette_32_t* pal = (void*)((uintptr_t)dst)+sizeof(my_SDL2_PixelFormat_32_ext_t); + dst->fmt.palette = to_ptrv(pal); + pal->ncolors = src->palette->ncolors; + pal->colors = to_ptrv(src->palette->colors); + pal->version = src->palette->version; + pal->refcount = src->palette->refcount; + } else dst->fmt.palette = 0; + dst->fmt.BitsPerPixel = src->BitsPerPixel; + dst->fmt.BytesPerPixel = src->BytesPerPixel; + dst->fmt.Rmask = src->Rmask; + dst->fmt.Gmask = src->Gmask; + dst->fmt.Bmask = src->Bmask; + dst->fmt.Amask = src->Amask; + dst->fmt.Rloss = src->Rloss; + dst->fmt.Gloss = src->Gloss; + dst->fmt.Bloss = src->Bloss; + dst->fmt.Aloss = src->Aloss; + dst->fmt.Rshift = src->Rshift; + dst->fmt.Gshift = src->Gshift; + dst->fmt.Bshift = src->Bshift; + dst->fmt.Ashift = src->Ashift; + dst->fmt.refcount = src->refcount; + dst->fmt.next = to_ptrv(src->next); + // insert at head and return the value + dst->next = pixelformat_head; + pixelformat_head = dst; + return dst; +} + +void* replace_SDL2_PixelFormat_to_64_ext(void* a) +{ + if(!a) return a; + my_SDL2_PixelFormat_32_ext_t* dst = a; + return dst->ref; +} + +void inplace_SDL2_Surface_to_32(void* a) +{ + if (!a) return; + my_SDL2_Surface_t* src = a; + my_SDL2_Surface_32_t* dst = a; + dst->flags = src->flags; + #if 0 + inplace_SDL2_PixelFormat_to_32(src->format); + dst->format = to_ptrv(src->format); + #else + dst->format = to_ptrv(replace_SDL2_PixelFormat_to_32_ext(src->format)); + #endif + dst->w = src->w; + dst->h = src->h; + dst->pitch = src->pitch; + dst->pixels = to_ptrv(src->pixels); + dst->userdata = to_ptrv(src->userdata); + dst->locked = src->locked; + dst->list_blitmap = to_ptrv(src->list_blitmap); + dst->clip_rect.x = src->clip_rect.x; + dst->clip_rect.y = src->clip_rect.y; + dst->clip_rect.w = src->clip_rect.w; + dst->clip_rect.h = src->clip_rect.h; + dst->map = to_ptrv(src->map); + dst->refcount = src->refcount; +} + + +void inplace_SDL2_Palette_to_64(void* a) +{ + if (!a) return; + my_SDL2_Palette_32_t* src = a; + my_SDL2_Palette_t* dst = a; + dst->refcount = src->refcount; + dst->version = src->version; + dst->colors = from_ptrv(src->colors); + dst->ncolors = src->ncolors; +} + +void inplace_SDL2_PixelFormat_to_64(void* a) +{ + while (a) { + my_SDL2_PixelFormat_32_t* src = a; + my_SDL2_PixelFormat_t* dst = a; + // check signatue + if(*(uint32_t*)(src+1) == SDL2_PIXELFORMAT_SIGN) { + uintptr_t p = (uintptr_t)(src->next); + a = (void*)p; + dst->next = from_ptrv(src->next); + dst->refcount = src->refcount; + dst->Ashift = src->Ashift; + dst->Bshift = src->Bshift; + dst->Gshift = src->Gshift; + dst->Rshift = src->Rshift; + dst->Aloss = src->Aloss; + dst->Bloss = src->Bloss; + dst->Gloss = src->Gloss; + dst->Rloss = src->Rloss; + dst->Amask = src->Amask; + dst->Bmask = src->Bmask; + dst->Gmask = src->Gmask; + dst->Rmask = src->Rmask; + dst->BytesPerPixel = src->BytesPerPixel; + dst->BitsPerPixel = src->BitsPerPixel; + p = (uintptr_t)(src->palette); + inplace_SDL2_Palette_to_64((void*)p); + dst->palette = from_ptrv(src->palette); + dst->format = src->format; + } else a = dst->next; // already 64bits! + } +} + +void inplace_SDL2_Surface_to_64(void* a) +{ + if (!a) return; + my_SDL2_Surface_32_t* src = a; + my_SDL2_Surface_t* dst = a; + dst->refcount = src->refcount; + dst->map = from_ptrv(src->map); + dst->clip_rect.h = src->clip_rect.h; + dst->clip_rect.w = src->clip_rect.w; + dst->clip_rect.y = src->clip_rect.y; + dst->clip_rect.x = src->clip_rect.x; + dst->list_blitmap = from_ptrv(src->list_blitmap); + dst->locked = src->locked; + dst->userdata = from_ptrv(src->userdata); + dst->pixels = from_ptrv(src->pixels); + dst->pitch = src->pitch; + dst->h = src->h; + dst->w = src->w; + #if 0 + uintptr_t p = (uintptr_t)(src->format); + inplace_SDL2_PixelFormat_to_64((void*)p); + dst->format = from_ptrv(src->format); + #else + dst->format = replace_SDL2_PixelFormat_to_64_ext(from_ptrv(src->format)); + #endif + dst->flags = src->flags; +} + +void inplace_SDL2_RWops_to_32(void* a) +{ + if (!a) return; + my_SDL2_RWops_t* src = a; + my_SDL2_RWops_32_t* dst = a; + dst->size = to_ptrv(src->size); + dst->seek = to_ptrv(src->seek); + dst->read = to_ptrv(src->read); + dst->write = to_ptrv(src->write); + dst->close = to_ptrv(src->close); + dst->type = src->type; + memmove(&dst->hidden, &src->hidden, sizeof(dst->hidden)); +} + +void inplace_SDL2_RWops_to_64(void* a) +{ + if(!a) return; + my_SDL2_RWops_32_t* src = a; + my_SDL2_RWops_t* dst = a; + memmove(&dst->hidden, &src->hidden, sizeof(dst->hidden)); + dst->type = src->type; + dst->close = from_ptrv(src->close); + dst->write = from_ptrv(src->write); + dst->read = from_ptrv(src->read); + dst->seek = from_ptrv(src->seek); + dst->size = from_ptrv(src->size); +} \ No newline at end of file diff --git a/src/libtools/sdl2rwops.c b/src/libtools/sdl2rwops.c index 1273d36..350ade3 100644 --- a/src/libtools/sdl2rwops.c +++ b/src/libtools/sdl2rwops.c @@ -6,8 +6,11 @@ #include "sdl2rwops.h" #include "debug.h" #include "wrapper.h" +#ifdef BOX32 +#include "wrapper32.h" +#include "sdl2align32.h" +#endif #include "box64context.h" -#include "x64run.h" #include "x64emu.h" #include "emu/x64emu_private.h" #include "librarian/library_private.h" @@ -19,8 +22,8 @@ typedef struct SDL2_RWops_s SDL2_RWops_t; typedef int64_t (*sdl2_size)(SDL2_RWops_t *context); typedef int64_t (*sdl2_seek)(SDL2_RWops_t *context, int64_t offset, int32_t whence); -typedef int32_t (*sdl2_read)(SDL2_RWops_t *context, void *ptr, int32_t size, int32_t maxnum); -typedef int32_t (*sdl2_write)(SDL2_RWops_t *context, const void *ptr, int32_t size, int32_t num); +typedef size_t (*sdl2_read)(SDL2_RWops_t *context, void *ptr, size_t size, size_t maxnum); +typedef size_t (*sdl2_write)(SDL2_RWops_t *context, const void *ptr, size_t size, size_t num); typedef int32_t (*sdl2_close)(SDL2_RWops_t *context); #define BOX64RW 0x79 // random signature value @@ -51,57 +54,162 @@ typedef struct SDL2_RWops_s { SDL2_RWops_t *orig; sdl2_freerw custom_free; } my; + #ifdef BOX32 + struct { + my_SDL2_RWops_32_t *orig; + sdl2_freerw custom_free; + } my32; + #endif } hidden; } SDL2_RWops_t; -#define SUPER() \ - GO(size, IFp) \ - GO(seek, IFpIi) \ - GO(read, iFppii) \ - GO(write, iFppii) \ - GO(close, iFp) +#ifdef BOX32 +#define SUPER() \ + if (box64_is32bits) { \ + GO(size, IFp_32) \ + GO(seek, IFpIi_32) \ + GO(read, iFppii_32) \ + GO(write, iFppii_32) \ + GO(close, iFp_32) \ + } else { \ + GO(size, IFp) \ + GO(seek, IFpIi) \ + GO(read, iFppii) \ + GO(write, iFppii) \ + GO(close, iFp) \ + } +#else +#define SUPER() \ + GO(size, IFp) \ + GO(seek, IFpIi) \ + GO(read, iFppii) \ + GO(write, iFppii) \ + GO(close, iFp) +#endif EXPORT int64_t my2_native_size(SDL2_RWops_t *context) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL2_RWops_to_64(context); + int64_t ret = context->hidden.my.orig->size(context->hidden.my.orig); + inplace_SDL2_RWops_to_32(context); + return ret; + } + #endif return context->hidden.my.orig->size(context->hidden.my.orig); } EXPORT int64_t my2_native_seek(SDL2_RWops_t *context, int64_t offset, int32_t whence) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL2_RWops_to_64(context); + int64_t ret = context->hidden.my.orig->seek(context->hidden.my.orig, offset, whence); + inplace_SDL2_RWops_to_32(context); + return ret; + } + #endif return context->hidden.my.orig->seek(context->hidden.my.orig, offset, whence); } -EXPORT int32_t my2_native_read(SDL2_RWops_t *context, void *ptr, int32_t size, int32_t maxnum) +EXPORT size_t my2_native_read(SDL2_RWops_t *context, void *ptr, size_t size, size_t maxnum) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL2_RWops_to_64(context); + size_t ret = context->hidden.my.orig->read(context->hidden.my.orig, ptr, size, maxnum); + inplace_SDL2_RWops_to_32(context); + return ret; + } + #endif return context->hidden.my.orig->read(context->hidden.my.orig, ptr, size, maxnum); } -EXPORT int32_t my2_native_write(SDL2_RWops_t *context, const void *ptr, int32_t size, int32_t num) +EXPORT size_t my2_native_write(SDL2_RWops_t *context, const void *ptr, size_t size, size_t num) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL2_RWops_to_64(context); + size_t ret = context->hidden.my.orig->write(context->hidden.my.orig, ptr, size, num); + inplace_SDL2_RWops_to_32(context); + return ret; + } + #endif return context->hidden.my.orig->write(context->hidden.my.orig, ptr, size, num); } EXPORT int32_t my2_native_close(SDL2_RWops_t *context) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL2_RWops_to_64(context); + } + #endif int32_t ret = context->hidden.my.orig->close(context->hidden.my.orig); context->hidden.my.custom_free(context); return ret; } EXPORT int64_t my2_emulated_size(SDL2_RWops_t *context) { + #ifdef BOX32 + if(box64_is32bits) { + if(GetNativeFnc(context->hidden.my32.orig->size) == my2_native_size) + return my2_native_size(context->hidden.my.orig); + uintptr_t f = context->hidden.my32.orig->size; + int64_t ret = (int64_t)RunFunctionFmt(f, "p", context->hidden.my32.orig); + return ret; + } + #endif return (int64_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->size, "p", context->hidden.my.orig); } EXPORT int64_t my2_emulated_seek(SDL2_RWops_t *context, int64_t offset, int32_t whence) { + #ifdef BOX32 + if(box64_is32bits) { + if(GetNativeFnc(context->hidden.my32.orig->seek) == my2_native_seek) + return my2_native_seek(context->hidden.my.orig, offset, whence); + uintptr_t f = context->hidden.my32.orig->seek; + int64_t ret = (int64_t)RunFunctionFmt(f, "pIi", context->hidden.my32.orig, offset, whence); + return ret; + } + #endif return (int64_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->seek, "pIi", context->hidden.my.orig, offset, whence); } -EXPORT int32_t my2_emulated_read(SDL2_RWops_t *context, void *ptr, int32_t size, int32_t maxnum) +EXPORT size_t my2_emulated_read(SDL2_RWops_t *context, void *ptr, size_t size, size_t maxnum) { - return (int32_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->read, "ppii", context->hidden.my.orig, ptr, size, maxnum); + #ifdef BOX32 + if(box64_is32bits) { + if(GetNativeFnc(context->hidden.my32.orig->read) == my2_native_read) + return my2_native_read(context->hidden.my.orig, ptr, size, maxnum); + uintptr_t f = context->hidden.my32.orig->read; + size_t ret = (size_t)RunFunctionFmt(f, "ppLL", context->hidden.my32.orig, ptr, size, maxnum); + return ret; + } + #endif + return (size_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->read, "ppLL", context->hidden.my.orig, ptr, size, maxnum); } -EXPORT int32_t my2_emulated_write(SDL2_RWops_t *context, const void *ptr, int32_t size, int32_t num) +EXPORT size_t my2_emulated_write(SDL2_RWops_t *context, const void *ptr, size_t size, size_t num) { - return (int32_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->write, "ppii", context->hidden.my.orig, ptr, size, num); + #ifdef BOX32 + if(box64_is32bits) { + if(GetNativeFnc(context->hidden.my32.orig->write) == my2_native_write) + return my2_native_write(context->hidden.my.orig, ptr, size, num); + uintptr_t f = context->hidden.my32.orig->write; + size_t ret = (size_t)RunFunctionFmt(f, "ppLL", context->hidden.my32.orig, ptr, size, num); + return ret; + } + #endif + return (size_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->write, "ppLL", context->hidden.my.orig, ptr, size, num); } EXPORT int32_t my2_emulated_close(SDL2_RWops_t *context) { - int ret = (int32_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->close, "p", context->hidden.my.orig); + int ret = 0; + #ifdef BOX32 + if(box64_is32bits) { + if(GetNativeFnc(context->hidden.my32.orig->close) == my2_native_close) + return my2_native_close(context->hidden.my.orig); + uintptr_t f = context->hidden.my32.orig->close; + ret = (size_t)RunFunctionFmt(f, "p", context->hidden.my32.orig); + } else + #endif + ret = (int32_t)RunFunctionFmt((uintptr_t)context->hidden.my.orig->close, "p", context->hidden.my.orig); context->hidden.my.custom_free(context); return ret; } @@ -213,16 +321,40 @@ int isRWops(SDL2_RWops_t* ops) return 0; return 1; } +#ifdef BOX32 +int isRWops32(my_SDL2_RWops_32_t* ops) +{ + if(!ops) + return 0; + #define GO(A, W) \ + if(!ops->A || (uintptr_t)ops->A < 0x1000) return 0; + + SUPER() + + #undef GO + // check if all then hidden content is just full of 0 + if(ops->hidden[0]==0 && ops->hidden[1]==0 && ops->hidden[2]==0) + return 0; + // check the type (not sure it's a good check here) + if (ops->type>5 && ops->type!=BOX64RW) + return 0; + return 1; +} +#endif int64_t RWNativeSeek2(SDL2_RWops_t *ops, int64_t offset, int32_t whence) { return ops->seek(ops, offset, whence); } -uint32_t RWNativeRead2(SDL2_RWops_t* ops, void* ptr, uint32_t size, uint32_t maxnum) +int64_t RWNativeSize2(SDL2_RWops_t *ops) +{ + return ops->size(ops); +} +size_t RWNativeRead2(SDL2_RWops_t* ops, void* ptr, size_t size, size_t maxnum) { return ops->read(ops, ptr, size, maxnum); } -int32_t RWNativeWrite2(SDL2_RWops_t *ops, const void *ptr, int32_t size, int32_t num) +size_t RWNativeWrite2(SDL2_RWops_t *ops, const void *ptr, size_t size, size_t num) { return ops->write(ops, ptr, size, num); } diff --git a/src/libtools/signal32.c b/src/libtools/signal32.c new file mode 100644 index 0000000..03e40fc --- /dev/null +++ b/src/libtools/signal32.c @@ -0,0 +1,995 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef ANDROID +#include +#endif + +#include "x64_signals.h" +#include "os.h" +#include "box32context.h" +#include "debug.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "emu/x64run_private.h" +#include "signals.h" +#include "box64stack.h" +#include "box64cpu.h" +#include "callback.h" +#include "elfloader.h" +#include "threads.h" +#include "emu/x87emu_private.h" +#include "custommem.h" +#include "bridge.h" +#ifdef DYNAREC +#include "dynablock.h" +#include "../dynarec/dynablock_private.h" +#include "dynarec_native.h" +#if defined(ARM64) +#include "dynarec/arm64/arm64_mapping.h" +#define CONTEXT_REG(P, X) P->uc_mcontext.regs[X] +#define CONTEXT_PC(P) P->uc_mcontext.pc +#elif defined(LA64) +#include "dynarec/la64/la64_mapping.h" +#define CONTEXT_REG(P, X) P->uc_mcontext.__gregs[X] +#define CONTEXT_PC(P) P->uc_mcontext.__pc; +#elif defined(RV64) +#include "dynarec/rv64/rv64_mapping.h" +#define CONTEXT_REG(P, X) P->uc_mcontext.__gregs[X] +#define CONTEXT_PC(P) P->uc_mcontext.__gregs[REG_PC] +#else +#error Unsupported Architecture +#endif //arch +#endif + + +/* Definitions taken from the kernel headers. */ +enum +{ + I386_GS = 0, +# define I386_GS I386_GS + I386_FS, +# define I386_FS I386_FS + I386_ES, +# define I386_ES I386_ES + I386_DS, +# define I386_DS I386_DS + I386_EDI, +# define I386_EDI I386_EDI + I386_ESI, +# define I386_ESI I386_ESI + I386_EBP, +# define I386_EBP I386_EBP + I386_ESP, +# define I386_ESP I386_ESP + I386_EBX, +# define I386_EBX I386_EBX + I386_EDX, +# define I386_EDX I386_EDX + I386_ECX, +# define I386_ECX I386_ECX + I386_EAX, +# define I386_EAX I386_EAX + I386_TRAPNO, +# define I386_TRAPNO I386_TRAPNO + I386_ERR, +# define I386_ERR I386_ERR + I386_EIP, +# define I386_EIP I386_EIP + I386_CS, +# define I386_CS I386_CS + I386_EFL, +# define I386_EFL I386_EFL + I386_UESP, +# define I386_UESP I386_UESP + I386_SS +# define I386_SS I386_SS +}; + +typedef uint32_t i386_gregset_t[19]; +struct i386_fpreg +{ + uint16_t significand[4]; + uint16_t exponent; +}__attribute__((packed)); + +struct i386_fpxreg +{ + unsigned short significand[4]; + unsigned short exponent; + unsigned short padding[3]; +}__attribute__((packed)); + +struct i386_xmmreg +{ + uint32_t element[4]; +}__attribute__((packed)); + +struct i386_fpstate +{ + /* Regular FPU environment. */ + uint32_t cw; + uint32_t sw; + uint32_t tag; + uint32_t ipoff; + uint32_t cssel; + uint32_t dataoff; + uint32_t datasel; + struct i386_fpreg _st[8]; + uint32_t status_magic; + /* FXSR FPU environment. */ + uint32_t _fxsr_env[6]; + uint32_t mxcsr; + uint32_t reserved; + struct i386_fpxreg _fxsr_st[8]; + struct i386_xmmreg _xmm[8]; + uint32_t padding[56]; +}__attribute__((packed)); + +typedef struct i386_fpstate *i386_fpregset_t; + +static void save_fpreg(x64emu_t* emu, struct i386_fpstate* state) +{ + emu->sw.f.F87_TOP = emu->top&7; + state->sw = emu->sw.x16; + state->cw = emu->cw.x16; + // save SSE and MMX regs + fpu_fxsave32(emu, &state->_fxsr_env); +} +static void load_fpreg(x64emu_t* emu, struct i386_fpstate* state) +{ + // copy SSE and MMX regs + fpu_fxrstor32(emu, &state->_fxsr_env); + emu->cw.x16 = state->cw; + emu->sw.x16 = state->sw; + emu->top = emu->sw.f.F87_TOP&7; +} + +typedef struct + { + ptr_t ss_sp; + int ss_flags; + long_t ss_size; + } i386_stack_t; + +typedef struct x64_stack_s +{ + void *ss_sp; + int ss_flags; + size_t ss_size; +} x64_stack_t; + + +/* +another way to see the sigcontext +struct sigcontext +{ + unsigned short gs, __gsh; + unsigned short fs, __fsh; + unsigned short es, __esh; + unsigned short ds, __dsh; + unsigned long edi; + unsigned long esi; + unsigned long ebp; + unsigned long esp; + unsigned long ebx; + unsigned long edx; + unsigned long ecx; + unsigned long eax; + unsigned long trapno; + unsigned long err; + unsigned long eip; + unsigned short cs, __csh; + unsigned long eflags; + unsigned long esp_at_signal; + unsigned short ss, __ssh; + struct _fpstate * fpstate; + unsigned long oldmask; + unsigned long cr2; +}; +*/ +typedef struct + { + i386_gregset_t gregs; + ptr_t fpregs; //i386_fpregset_t + uint32_t oldmask; + uint32_t cr2; + } i386_mcontext_t; + +// /!\ signal sig_set is different than glibc __sig_set +#define _NSIG_WORDS (64 / 32) +typedef unsigned long i386_old_sigset_t; +typedef struct { + unsigned long sig[_NSIG_WORDS]; +} i386_sigset_t; + +struct i386_xsave_hdr_struct { + uint64_t xstate_bv; + uint64_t reserved1[2]; + uint64_t reserved2[5]; +}; + +struct i386_xstate { + /* + * Applications need to refer to fpstate through fpstate pointer + * in sigcontext. Not here directly. + */ + struct i386_fpstate fpstate; + struct i386_xsave_hdr_struct xsave_hdr; + /* new processor state extensions will go here */ +} __attribute__ ((aligned (64))); + +struct i386_xstate_cntxt { + ptr_t xstate; //struct i386_xstate *xstate; + uint32_t size; + uint32_t lmask; + uint32_t hmask; +}; + +typedef struct i386_ucontext_s +{ + uint32_t uc_flags; + ptr_t uc_link; //struct i386_ucontext_s *uc_link; + i386_stack_t uc_stack; + i386_mcontext_t uc_mcontext; + i386_sigset_t uc_sigmask; + /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */ + int unused[32 - (sizeof (sigset_t) / sizeof (int))]; + //struct i386_xstate_cntxt uc_xstate; + struct i386_xstate xstate; +} i386_ucontext_t; + +typedef struct i386_sigframe_s { + ptr_t pretcode; // pointer to retcode + int sig; + i386_mcontext_t cpustate; + struct i386_xstate fpstate; + ptr_t extramask[64-1]; + char retcode[8]; +} i386_sigframe_t; + +struct kernel_sigaction { + void (*k_sa_handler) (int); + unsigned long sa_flags; + void (*sa_restorer) (void); + unsigned long sa_mask; + unsigned long sa_mask2; +}; + +typedef union my_sigval32 +{ + int sival_int; + ptr_t sival_ptr; +} my_sigval32_t; + +typedef struct __attribute__((packed, aligned(4))) my_siginfo32_s +{ + int si_signo; + int si_errno; + int si_code; + union { + int _pad[128/sizeof(int)-3]; + struct { + __pid_t __si_pid; + __uid_t __si_uid; + } _kill; + struct { + int si_tid; + int __si_overrun; + my_sigval32_t si_sigval; + } _timer; + struct { + __pid_t __si_pid; + __uid_t __si_uid; + my_sigval32_t si_sigval; + } _rt; + struct { + __pid_t __si_pid; + __uid_t __si_uid; + int __si_status; + int32_t __si_utime; + int32_t __si_stime; + } _sigchld; + struct { + ptr_t __si_addr; + __SI_SIGFAULT_ADDL + int16_t __si_addr_lsb; + union { + struct { + ptr_t _lower; + ptr_t _upper; + } _addr_bnd; + uint32_t _pkey; + } _bounds; + } _sigfault; + struct + { + int32_t __si_band; + int32_t __si_fd; + } _sigpoll; + struct + { + ptr_t _call_addr; + int32_t _syscall; + uint32_t _arch; + } _sigsys; + } _sifields; +} my_siginfo32_t; + +x64_stack_t* sigstack_getstack(); +int my_sigaltstack(x64emu_t* emu, const x64_stack_t* ss, x64_stack_t* oss); +EXPORT int my32_sigaltstack(x64emu_t* emu, const i386_stack_t* ss, i386_stack_t* oss) +{ + x64_stack_t ss_ = {0}; + x64_stack_t oss_ = {0}; + if(ss) { + ss_.ss_flags = ss->ss_flags; + ss_.ss_sp = from_ptrv(ss->ss_sp); + ss_.ss_size = ss->ss_size; + } + int ret = my_sigaltstack(emu, ss?(&ss_):NULL, oss?(&oss_):NULL); + if(!ret && oss) { + oss->ss_flags = oss_.ss_flags; + oss->ss_sp = to_ptrv(oss_.ss_sp); + oss->ss_size = oss_.ss_size; + } + return ret; +} + + +uint32_t RunFunctionHandler32(int* exit, int dynarec, i386_ucontext_t* sigcontext, ptr_t fnc, int nargs, ...) +{ + if(fnc==0 || fnc==1) { + va_list va; + va_start (va, nargs); + int sig = va_arg(va, int); + va_end (va); + printf_log(LOG_NONE, "%04d|Warning, calling Signal %d function handler %s\n", GetTID(), sig, fnc ? "SIG_IGN" : "SIG_DFL"); + if(fnc==0) { + printf_log(LOG_NONE, "Unhandled signal caught, aborting\n"); + abort(); + } + return 0; + } +#ifdef HAVE_TRACE + uintptr_t old_start = trace_start, old_end = trace_end; +#if 0 + trace_start = 0; trace_end = 1; // disabling trace, globably for now... +#endif +#endif + x64emu_t *emu = thread_get_emu(); + #ifdef DYNAREC + if (BOX64ENV(dynarec_test)) + emu->test.test = 0; + #endif + + int align = nargs&1; + + R_ESP -= nargs * sizeof(ptr_t); + + uint32_t *p = (uint32_t*)from_ptrv(R_ESP); + + va_list va; + va_start (va, nargs); + for (int i=0; iflags.quitonlongjmp; + emu->flags.quitonlongjmp = 2; + int old_cs = R_CS; + R_CS = 0x23; + + if(dynarec) + DynaCall(emu, fnc); + else + EmuCall(emu, fnc); + + if(!emu->flags.longjmp) + R_ESP+=nargs*sizeof(ptr_t); + + if(!emu->flags.longjmp && R_CS==0x23) + R_CS = old_cs; + + emu->flags.quitonlongjmp = oldquitonlongjmp; + + #ifdef DYNAREC + if (BOX64ENV(dynarec_test)) { + emu->test.test = 0; + emu->test.clean = 0; + } +#endif + + if(emu->flags.longjmp) { + // longjmp inside signal handler, lets grab all relevent value and do the actual longjmp in the signal handler + emu->flags.longjmp = 0; + if(sigcontext) { + sigcontext->uc_mcontext.gregs[I386_EAX] = R_EAX; + sigcontext->uc_mcontext.gregs[I386_ECX] = R_ECX; + sigcontext->uc_mcontext.gregs[I386_EDX] = R_EDX; + sigcontext->uc_mcontext.gregs[I386_EDI] = R_EDI; + sigcontext->uc_mcontext.gregs[I386_ESI] = R_ESI; + sigcontext->uc_mcontext.gregs[I386_EBP] = R_EBP; + sigcontext->uc_mcontext.gregs[I386_ESP] = R_ESP; + sigcontext->uc_mcontext.gregs[I386_EBX] = R_EBX; + sigcontext->uc_mcontext.gregs[I386_EIP] = R_EIP; + // flags + sigcontext->uc_mcontext.gregs[I386_EFL] = emu->eflags.x64; + // get segments + sigcontext->uc_mcontext.gregs[I386_CS] = R_CS; + sigcontext->uc_mcontext.gregs[I386_DS] = R_DS; + sigcontext->uc_mcontext.gregs[I386_ES] = R_ES; + sigcontext->uc_mcontext.gregs[I386_SS] = R_SS; + sigcontext->uc_mcontext.gregs[I386_FS] = R_FS; + sigcontext->uc_mcontext.gregs[I386_GS] = R_GS; + } else { + printf_log(LOG_NONE, "Warning, longjmp in signal but no sigcontext to change\n"); + } + } + if(exit) + *exit = emu->exit; + + uint32_t ret = R_EAX; + +#ifdef HAVE_TRACE + trace_start = old_start; trace_end = old_end; +#endif + + return ret; +} +void convert_siginfo_to_32(void* d, void* s, int sig) +{ + if(!s || !d) return; + my_siginfo32_t* dst = d; + siginfo_t* src = s; + + dst->si_signo = src->si_signo; + dst->si_errno = src->si_errno; + dst->si_code = src->si_code; + memcpy(&dst->_sifields, &src->_sifields, sizeof(siginfo_t) - offsetof(siginfo_t, _sifields)); + if(sig==X64_SIGILL || sig==X64_SIGFPE || sig==X64_SIGSEGV || sig==X64_SIGBUS) + dst->_sifields._sigfault.__si_addr = to_ptr(((uintptr_t)src->si_addr)&0xffffffff); // in case addr is not a 32bits value... + if(sig==X64_SIGCHLD) { + dst->_sifields._sigchld.__si_pid = src->si_pid; + dst->_sifields._sigchld.__si_uid = src->si_uid; + dst->_sifields._sigchld.__si_status = src->si_status; + dst->_sifields._sigchld.__si_stime = src->si_stime; + dst->_sifields._sigchld.__si_utime = src->si_utime; + } + // TODO: convert si_sigval when needed +} + +void relockMutex(int locks); +int unlockMutex(); + +int write_opcode(uintptr_t rip, uintptr_t native_ip, int is32bits); +#define is_memprot_locked (1<<1) +#define is_dyndump_locked (1<<8) +void my_sigactionhandler_oldcode_32(x64emu_t* emu, int32_t sig, int simple, siginfo_t* info, void * ucntx, int* old_code, void* cur_db) +{ + int Locks = unlockMutex(); + int log_minimum = (BOX64ENV(showsegv))?LOG_NONE:((sig==X64_SIGSEGV && my_context->is_sigaction[sig])?LOG_DEBUG:LOG_INFO); + + printf_log(LOG_DEBUG, "Sigactionhanlder32 for signal #%d called (jump to %p/%s)\n", sig, (void*)my_context->signals[sig], GetNativeName((void*)my_context->signals[sig])); + + uintptr_t restorer = my_context->restorer[sig]; + // get that actual ESP first! + if(!emu) + emu = thread_get_emu(); + uintptr_t frame = R_ESP; +#if defined(DYNAREC) + dynablock_t* db = (dynablock_t*)cur_db;//FindDynablockFromNativeAddress(pc); + ucontext_t *p = (ucontext_t *)ucntx; + void* pc = NULL; + if(p) { + pc = (void*)CONTEXT_PC(p); + if(db) + frame = from_ptr((ptr_t)CONTEXT_REG(p, xRSP)); + } +#else + (void)ucntx; (void)cur_db; + void* pc = NULL; +#endif + // setup libc context stack frame, on caller stack + frame = frame&~15; + + // stack tracking + x64_stack_t *new_ss = my_context->onstack[sig]?sigstack_getstack():NULL; + int used_stack = 0; + if(new_ss) { + if(new_ss->ss_flags == SS_ONSTACK) { // already using it! + frame = from_ptr(((ptr_t)emu->regs[_SP].q[0] - 128) & ~0x0f); + } else { + frame = from_ptr(((uintptr_t)new_ss->ss_sp + new_ss->ss_size - 16) & ~0x0f); + used_stack = 1; + new_ss->ss_flags = SS_ONSTACK; + } + } else { + frame -= 0x200; // redzone + } + + // TODO: do I need to really setup 2 stack frame? That doesn't seems right! + // setup stack frame + frame -= 512+64+16*16; + void* xstate = (void*)frame; + frame -= sizeof(my_siginfo32_t); + my_siginfo32_t* info2 = (my_siginfo32_t*)frame; + convert_siginfo_to_32(info2, info, sig); + // try to fill some sigcontext.... + frame -= sizeof(i386_ucontext_t); + i386_ucontext_t *sigcontext = (i386_ucontext_t*)frame; + // get general register + sigcontext->uc_mcontext.gregs[I386_EAX] = R_EAX; + sigcontext->uc_mcontext.gregs[I386_ECX] = R_ECX; + sigcontext->uc_mcontext.gregs[I386_EDX] = R_EDX; + sigcontext->uc_mcontext.gregs[I386_EDI] = R_EDI; + sigcontext->uc_mcontext.gregs[I386_ESI] = R_ESI; + sigcontext->uc_mcontext.gregs[I386_EBP] = R_EBP; + sigcontext->uc_mcontext.gregs[I386_ESP] = R_ESP; + sigcontext->uc_mcontext.gregs[I386_EBX] = R_EBX; + sigcontext->uc_mcontext.gregs[I386_EIP] = R_EIP;//emu->old_ip; // old_ip should be more accurate as the "current" IP, but it's not always up-to-date + // flags + sigcontext->uc_mcontext.gregs[I386_EFL] = emu->eflags.x64; + CLEAR_FLAG(F_TF); // now clear TF flags inside the signal handler + // get segments + sigcontext->uc_mcontext.gregs[I386_CS] = R_CS; + sigcontext->uc_mcontext.gregs[I386_DS] = R_DS; + sigcontext->uc_mcontext.gregs[I386_ES] = R_ES; + sigcontext->uc_mcontext.gregs[I386_SS] = R_SS; + sigcontext->uc_mcontext.gregs[I386_FS] = R_FS; + sigcontext->uc_mcontext.gregs[I386_GS] = R_GS; + // get FloatPoint status + sigcontext->uc_mcontext.fpregs = to_ptrv(xstate);//(struct x64_libc_fpstate*)&sigcontext->xstate; + fpu_xsave_mask(emu, xstate, 1, 0b111); + memcpy(&sigcontext->xstate, xstate, sizeof(sigcontext->xstate)); + ((struct i386_fpstate*)xstate)->status_magic = 0x46505853; // magic number to signal an XSTATE type of fpregs + // get signal mask + + if(new_ss) { + sigcontext->uc_stack.ss_sp = to_ptrv(new_ss->ss_sp); + sigcontext->uc_stack.ss_size = new_ss->ss_size; + sigcontext->uc_stack.ss_flags = new_ss->ss_flags; + } else + sigcontext->uc_stack.ss_flags = SS_DISABLE; + // Try to guess some X64_TRAPNO + /* + TRAP_x86_DIVIDE = 0, // Division by zero exception + TRAP_x86_TRCTRAP = 1, // Single-step exception + TRAP_x86_NMI = 2, // NMI interrupt + TRAP_x86_BPTFLT = 3, // Breakpoint exception + TRAP_x86_OFLOW = 4, // Overflow exception + TRAP_x86_BOUND = 5, // Bound range exception + TRAP_x86_PRIVINFLT = 6, // Invalid opcode exception + TRAP_x86_DNA = 7, // Device not available exception + TRAP_x86_DOUBLEFLT = 8, // Double fault exception + TRAP_x86_FPOPFLT = 9, // Coprocessor segment overrun + TRAP_x86_TSSFLT = 10, // Invalid TSS exception + TRAP_x86_SEGNPFLT = 11, // Segment not present exception + TRAP_x86_STKFLT = 12, // Stack fault + TRAP_x86_PROTFLT = 13, // General protection fault + TRAP_x86_PAGEFLT = 14, // Page fault + TRAP_x86_ARITHTRAP = 16, // Floating point exception + TRAP_x86_ALIGNFLT = 17, // Alignment check exception + TRAP_x86_MCHK = 18, // Machine check exception + TRAP_x86_CACHEFLT = 19 // SIMD exception (via SIGFPE) if CPU is SSE capable otherwise Cache flush exception (via SIGSEV) + */ + uint32_t prot = getProtection((uintptr_t)info->si_addr); + uint32_t mmapped = memExist((uintptr_t)info->si_addr); + uint32_t sysmapped = (info->si_addr<(void*)box64_pagesize)?1:mmapped; + uint32_t real_prot = 0; + int skip = 1; // in case sigjump is used to restore exectuion, 1 will switch to interpreter, 3 will switch to dynarec + if(prot&PROT_READ) real_prot|=PROT_READ; + if(prot&PROT_WRITE) real_prot|=PROT_WRITE; + if(prot&PROT_EXEC) real_prot|=PROT_WRITE; + if(prot&PROT_DYNAREC) real_prot|=PROT_WRITE; + sigcontext->uc_mcontext.gregs[I386_ERR] = 0; + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 0; + if(sig==X64_SIGBUS) + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 17; + else if(sig==X64_SIGSEGV) { + if((uintptr_t)info->si_addr == sigcontext->uc_mcontext.gregs[I386_EIP]) { + if(info->si_errno==0xbad0) { + //bad opcode + sigcontext->uc_mcontext.gregs[I386_ERR] = 0; + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 13; + info2->si_code = 128; + info2->si_errno = 0; + info2->_sifields._sigfault.__si_addr = 0; + } else if (info->si_errno==0xecec) { + // no excute bit on segment + sigcontext->uc_mcontext.gregs[I386_ERR] = 0x14|((sysmapped && !(real_prot&PROT_READ))?0:1); + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 14; + if(!mmapped) info2->si_code = 1; + info2->si_errno = 0; + }else { + sigcontext->uc_mcontext.gregs[I386_ERR] = 0x14|((sysmapped && !(real_prot&PROT_READ))?0:1); + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 14; + } + } else { + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 14; + sigcontext->uc_mcontext.gregs[I386_ERR] = 4|((sysmapped && !(real_prot&PROT_READ))?0:1); + if(write_opcode(sigcontext->uc_mcontext.gregs[I386_EIP], (uintptr_t)pc, 1)) + sigcontext->uc_mcontext.gregs[I386_ERR] |= 2; + } + if(info->si_code == SEGV_ACCERR && old_code) + *old_code = -1; + if(info->si_errno==0x1234) { + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 13; + info2->si_errno = 0; + } else if(info->si_errno==0xdead) { + // INT x + uint8_t int_n = info->si_code; + info2->si_errno = 0; + info2->si_code = 128; + info2->_sifields._sigfault.__si_addr = 0; + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 13; + skip = 3; // can resume in dynarec + // some special cases... + if(int_n==3) { + info2->si_signo = X64_SIGTRAP; + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 3; + sigcontext->uc_mcontext.gregs[I386_ERR] = 0; + } else if(int_n==0x04) { + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 4; + sigcontext->uc_mcontext.gregs[I386_ERR] = 0; + } else if (int_n==0x29 || int_n==0x2c || int_n==0x2d) { + sigcontext->uc_mcontext.gregs[I386_ERR] = 0x02|(int_n<<3); + } else { + sigcontext->uc_mcontext.gregs[I386_ERR] = 0x0a|(int_n<<3); + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 13; + } + } else if(info->si_errno==0xcafe) { //divide by 0 + info2->si_errno = 0; + sigcontext->uc_mcontext.gregs[I386_ERR] = 0; + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 0; + info2->si_signo = X64_SIGFPE; + skip = 3; // can resume in dynarec + } + } else if(sig==X64_SIGFPE) { + if (info->si_code == FPE_INTOVF) + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 4; + else + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 19; + skip = 3; + } else if(sig==X64_SIGILL) { + info2->si_code = 2; + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = 6; + info2->_sifields._sigfault.__si_addr = sigcontext->uc_mcontext.gregs[I386_EIP]; + } else if(sig==X64_SIGTRAP) { + if(info->si_code==1) { //single step + info2->si_code = 2; + info2->_sifields._sigfault.__si_addr = sigcontext->uc_mcontext.gregs[I386_EIP]; + } else + info2->si_code = 128; + sigcontext->uc_mcontext.gregs[I386_TRAPNO] = info->si_code; + sigcontext->uc_mcontext.gregs[I386_ERR] = 0; + } else { + skip = 3; // other signal can resume in interpretor + } + //TODO: SIGABRT generate what? + printf_log((sig==10)?LOG_DEBUG:log_minimum, "Signal32 %d: si_addr=%p, TRAPNO=%d, ERR=%d, RIP=%p, prot:%x, mmaped:%d\n", sig, from_ptrv(info2->_sifields._sigfault.__si_addr), sigcontext->uc_mcontext.gregs[I386_TRAPNO], sigcontext->uc_mcontext.gregs[I386_ERR],from_ptrv(sigcontext->uc_mcontext.gregs[I386_EIP]), prot, mmapped); + // call the signal handler + i386_ucontext_t sigcontext_copy = *sigcontext; + // save old value from emu + #define GO(A) uint32_t old_##A = R_##A + GO(EAX); + GO(EDI); + GO(ESI); + GO(EDX); + GO(ECX); + GO(EBP); + #undef GO + // set stack pointer + R_ESP = frame; + // set frame pointer + R_EBP = sigcontext->uc_mcontext.gregs[I386_EBP]; + + int exits = 0; + int ret; + int dynarec = 0; + #ifdef DYNAREC + if(sig!=X64_SIGSEGV && !(Locks&is_dyndump_locked) && !(Locks&is_memprot_locked)) + dynarec = BOX64ENV(dynarec_interp_signal)?0:1; + #endif + ret = RunFunctionHandler32(&exits, dynarec, sigcontext, my_context->signals[info2->si_signo], 3, info2->si_signo, info2, sigcontext); + // restore old value from emu + if(used_stack) // release stack + new_ss->ss_flags = 0; + #define GO(A) R_##A = old_##A + GO(EAX); + GO(EDI); + GO(ESI); + GO(EDX); + GO(ECX); + GO(EBP); + #undef GO + + if(memcmp(sigcontext, &sigcontext_copy, sizeof(i386_ucontext_t))) { + if(emu->jmpbuf) { + #define GO(R) emu->regs[_##R].q[0]=sigcontext->uc_mcontext.gregs[I386_E##R] + GO(AX); + GO(CX); + GO(DX); + GO(DI); + GO(SI); + GO(BP); + GO(SP); + GO(BX); + #undef GO + if((skip==1) && (emu->ip.q[0]!=sigcontext->uc_mcontext.gregs[I386_EIP])) + skip = 3; // if it jumps elsewhere, it can resume with dynarec... + emu->ip.q[0]=sigcontext->uc_mcontext.gregs[I386_EIP]; + // flags + emu->eflags.x64=sigcontext->uc_mcontext.gregs[I386_EFL]; + // get segments + #define GO(S) if(emu->segs[_##S]!=sigcontext->uc_mcontext.gregs[I386_##S]) emu->segs[_##S]=sigcontext->uc_mcontext.gregs[I386_##S] + GO(CS); + GO(DS); + GO(ES); + GO(SS); + GO(GS); + GO(FS); + #undef GO + printf_log((sig==10)?LOG_DEBUG:log_minimum, "Context has been changed in Sigactionhanlder, doing siglongjmp to resume emu at %p, RSP=%p (resume with %s)\n", (void*)R_RIP, (void*)R_RSP, (skip==3)?"Dynarec":"Interp"); + if(old_code) + *old_code = -1; // re-init the value to allow another segfault at the same place + //relockMutex(Locks); // do not relock mutex, because of the siglongjmp, whatever was running is canceled + #ifdef DYNAREC + if(Locks & is_dyndump_locked) + CancelBlock64(1); + #endif + #ifdef RV64 + emu->xSPSave = emu->old_savedsp; + #endif + #ifdef DYNAREC + dynablock_leave_runtime((dynablock_t*)cur_db); + #endif + #ifdef ANDROID + siglongjmp(*emu->jmpbuf, skip); + #else + siglongjmp(emu->jmpbuf, skip); + #endif + } + printf_log(LOG_INFO, "Warning, context has been changed in Sigactionhanlder%s\n", (sigcontext->uc_mcontext.gregs[I386_EIP]!=sigcontext_copy.uc_mcontext.gregs[I386_EIP])?" (EIP changed)":""); + } + // restore regs... + #define GO(R) R_##R=sigcontext->uc_mcontext.gregs[I386_##R] + GO(EAX); + GO(ECX); + GO(EDX); + GO(EDI); + GO(ESI); + GO(EBP); + GO(ESP); + GO(EBX); + #undef GO + emu->eflags.x64=sigcontext->uc_mcontext.gregs[I386_EFL]; + #define GO(R) R_##R=sigcontext->uc_mcontext.gregs[I386_##R] + GO(CS); + GO(DS); + GO(ES); + GO(SS); + GO(GS); + GO(FS); + #undef GO + + printf_log(LOG_DEBUG, "Sigactionhanlder main function returned (exit=%d, restorer=%p)\n", exits, (void*)restorer); + if(exits) { + //relockMutex(Locks); // the thread will exit, so no relock there + #ifdef DYNAREC + if(Locks & is_dyndump_locked) + CancelBlock64(1); + #endif + exit(ret); + } + if(restorer) + RunFunctionHandler32(&exits, 0, NULL, restorer, 0); + relockMutex(Locks); +} + +void my32_sigactionhandler(int32_t sig, siginfo_t* info, void * ucntx) +{ + #ifdef DYNAREC + ucontext_t *p = (ucontext_t *)ucntx; + #ifdef ARM64 + void * pc = (void*)p->uc_mcontext.pc; + #elif defined(LA64) + void * pc = (void*)p->uc_mcontext.__pc; + #elif defined(RV64) + void * pc = (void*)p->uc_mcontext.__gregs[0]; + #else + #error Unsupported architecture + #endif + dynablock_t* db = FindDynablockFromNativeAddress(pc); + #else + void* db = NULL; + #endif + + my_sigactionhandler_oldcode_32(NULL, sig, 0, info, ucntx, NULL, db); +} + + +EXPORT int my32_sigaction(x64emu_t* emu, int signum, const i386_sigaction_t *act, i386_sigaction_t *oldact) +{ + printf_log(LOG_DEBUG, "Sigaction(signum=%d, act=%p(f=%p, flags=0x%x), old=%p)\n", signum, act, act?from_ptrv(act->_u._sa_handler):NULL, act?act->sa_flags:0, oldact); + if(signum<0 || signum>MAX_SIGNAL) { + errno = EINVAL; + return -1; + } + + if(signum==X64_SIGSEGV && emu->context->no_sigsegv) + return 0; + + if(signum==X64_SIGILL && emu->context->no_sigill) + return 0; + struct sigaction newact = {0}; + struct sigaction old = {0}; + uintptr_t old_handler = my_context->signals[signum]; + if(act) { + newact.sa_mask = act->sa_mask; + newact.sa_flags = act->sa_flags&~0x04000000; // No sa_restorer... + if(act->sa_flags&0x04) { + my_context->signals[signum] = (uintptr_t)act->_u._sa_sigaction; + my_context->is_sigaction[signum] = 1; + if(act->_u._sa_handler!=0 && act->_u._sa_handler!=(ptr_t)1) { + newact.sa_sigaction = my32_sigactionhandler; + } else + newact.sa_sigaction = from_ptrv(act->_u._sa_sigaction); + } else { + my_context->signals[signum] = (uintptr_t)act->_u._sa_handler; + my_context->is_sigaction[signum] = 0; + if(act->_u._sa_handler!=0 && act->_u._sa_handler!=(ptr_t)1) { + newact.sa_flags|=0x04; + newact.sa_sigaction = my32_sigactionhandler; + } else + newact.sa_handler = from_ptrv(act->_u._sa_handler); + } + my_context->restorer[signum] = (act->sa_flags&0x04000000)?(uintptr_t)act->sa_restorer:0; + my_context->onstack[signum] = (act->sa_flags&SA_ONSTACK)?1:0; + } + int ret = 0; + if(signum!=X64_SIGSEGV && signum!=X64_SIGBUS && signum!=X64_SIGILL && signum!=X64_SIGABRT) + ret = sigaction(signal_from_x64(signum), act?&newact:NULL, oldact?&old:NULL); + if(oldact) { + oldact->sa_flags = old.sa_flags; + oldact->sa_mask = old.sa_mask; + if(old.sa_flags & 0x04) + oldact->_u._sa_sigaction = to_ptrv(old.sa_sigaction); //TODO should wrap... + else + oldact->_u._sa_handler = to_ptrv(old.sa_handler); //TODO should wrap... + if(oldact->_u._sa_sigaction == to_ptrv(my32_sigactionhandler) && old_handler) + oldact->_u._sa_sigaction = to_ptr(old_handler); + oldact->sa_restorer = 0; // no handling for now... + } + return ret; +} +EXPORT int my32___sigaction(x64emu_t* emu, int signum, const i386_sigaction_t *act, i386_sigaction_t *oldact) +__attribute__((alias("my32_sigaction"))); + +EXPORT int my32_getcontext(x64emu_t* emu, void* ucp) +{ +// printf_log(LOG_NONE, "Warning: call to partially implemented getcontext\n"); + i386_ucontext_t *u = (i386_ucontext_t*)ucp; + // stack traking + u->uc_stack.ss_sp = 0; + u->uc_stack.ss_size = 0; // this need to filled + // get general register + u->uc_mcontext.gregs[I386_EAX] = R_EAX; + u->uc_mcontext.gregs[I386_ECX] = R_ECX; + u->uc_mcontext.gregs[I386_EDX] = R_EDX; + u->uc_mcontext.gregs[I386_EDI] = R_EDI; + u->uc_mcontext.gregs[I386_ESI] = R_ESI; + u->uc_mcontext.gregs[I386_EBP] = R_EBP; + u->uc_mcontext.gregs[I386_EIP] = *(uint32_t*)from_ptrv(R_ESP); + u->uc_mcontext.gregs[I386_ESP] = R_ESP+4; + u->uc_mcontext.gregs[I386_EBX] = R_EBX; + // get segments + u->uc_mcontext.gregs[I386_GS] = R_GS; + u->uc_mcontext.gregs[I386_FS] = R_FS; + u->uc_mcontext.gregs[I386_ES] = R_ES; + u->uc_mcontext.gregs[I386_DS] = R_DS; + u->uc_mcontext.gregs[I386_CS] = R_CS; + u->uc_mcontext.gregs[I386_SS] = R_SS; + // get FloatPoint status + u->uc_mcontext.fpregs = to_ptrv(ucp + 236); // magic offset of fpregs in an actual i386 u_context + fpu_savenv(emu, from_ptrv(u->uc_mcontext.fpregs), 1); // it seems getcontext only save fpu env, not fpu regs + // get signal mask + sigprocmask(SIG_SETMASK, NULL, (sigset_t*)&u->uc_sigmask); + + return 0; +} + +EXPORT int my32_setcontext(x64emu_t* emu, void* ucp) +{ +// printf_log(LOG_NONE, "Warning: call to partially implemented setcontext\n"); + i386_ucontext_t *u = (i386_ucontext_t*)ucp; + // stack tracking + emu->init_stack = from_ptrv(u->uc_stack.ss_sp); + emu->size_stack = from_ulong(u->uc_stack.ss_size); + // set general register + R_RAX = u->uc_mcontext.gregs[I386_EAX]; + R_RCX = u->uc_mcontext.gregs[I386_ECX]; + R_RDX = u->uc_mcontext.gregs[I386_EDX]; + R_RDI = u->uc_mcontext.gregs[I386_EDI]; + R_RSI = u->uc_mcontext.gregs[I386_ESI]; + R_RBP = u->uc_mcontext.gregs[I386_EBP]; + R_RIP = u->uc_mcontext.gregs[I386_EIP]; + R_RSP = u->uc_mcontext.gregs[I386_ESP]; + R_RBX = u->uc_mcontext.gregs[I386_EBX]; + // get segments + R_GS = u->uc_mcontext.gregs[I386_GS]; + R_FS = u->uc_mcontext.gregs[I386_FS]; + R_ES = u->uc_mcontext.gregs[I386_ES]; + R_DS = u->uc_mcontext.gregs[I386_DS]; + R_CS = u->uc_mcontext.gregs[I386_CS]; + R_SS = u->uc_mcontext.gregs[I386_SS]; + // set FloatPoint status + fpu_loadenv(emu, from_ptrv(u->uc_mcontext.fpregs), 1); + // set signal mask + sigprocmask(SIG_SETMASK, (sigset_t*)&u->uc_sigmask, NULL); + + errno = 0; + return R_EAX; +} + +void vFEv_32(x64emu_t *emu, uintptr_t fnc); +EXPORT void my32_start_context(x64emu_t* emu) +{ + // this is call indirectly by swapcontext from a makecontext, and will link context or just exit + i386_ucontext_t *u = (i386_ucontext_t*)from_ptriv(R_EBX); + if(u) + my32_setcontext(emu, u); + else + emu->quit = 1; +} + +EXPORT void my32_makecontext(x64emu_t* emu, void* ucp, void* fnc, int32_t argc, int32_t* argv) +{ +// printf_log(LOG_NONE, "Warning: call to unimplemented makecontext\n"); + i386_ucontext_t *u = (i386_ucontext_t*)ucp; + // setup stack + u->uc_mcontext.gregs[I386_ESP] = to_ptr(u->uc_stack.ss_sp + u->uc_stack.ss_size - 4); + // setup the function + u->uc_mcontext.gregs[I386_EIP] = to_ptrv(fnc); + uint32_t* esp = (uint32_t*)from_ptr(u->uc_mcontext.gregs[I386_ESP]); + // setup return to private start_context uc_link + *esp = u->uc_link; + u->uc_mcontext.gregs[I386_EBX] = (uintptr_t)esp; + --esp; + // setup args + for (int i=0; isystem, vFEv_32, my32_start_context, 0, "my_start_context");//my_context->exit_bridge;//to_ptr(my_context->exit_bridge); + u->uc_mcontext.gregs[I386_ESP] = (uintptr_t)esp; +} + +EXPORT int my32_swapcontext(x64emu_t* emu, void* ucp1, void* ucp2) +{ +// printf_log(LOG_NONE, "Warning: call to unimplemented swapcontext\n"); + // grab current context in ucp1 + my32_getcontext(emu, ucp1); + // activate ucp2 + my32_setcontext(emu, ucp2); + return 0; +} diff --git a/src/libtools/signal_private.h b/src/libtools/signal_private.h new file mode 100644 index 0000000..8923119 --- /dev/null +++ b/src/libtools/signal_private.h @@ -0,0 +1,229 @@ +#ifndef __SIGNAL_PRIVATE_H__ +#define __SIGNAL_PRIVATE_H__ + +typedef uint64_t x64_gregset_t[23]; +enum +{ + X64_R8 = 0, +# define X64_R8 X64_R8 + X64_R9, +# define X64_R9 X64_R9 + X64_R10, +# define X64_R10 X64_R10 + X64_R11, +# define X64_R11 X64_R11 + X64_R12, +# define X64_R12 X64_R12 + X64_R13, +# define X64_R13 X64_R13 + X64_R14, +# define X64_R14 X64_R14 + X64_R15, +# define X64_R15 X64_R15 + X64_RDI, +# define X64_RDI X64_RDI + X64_RSI, +# define X64_RSI X64_RSI + X64_RBP, +# define X64_RBP X64_RBP + X64_RBX, +# define X64_RBX X64_RBX + X64_RDX, +# define X64_RDX X64_RDX + X64_RAX, +# define X64_RAX X64_RAX + X64_RCX, +# define X64_RCX X64_RCX + X64_RSP, +# define X64_RSP X64_RSP + X64_RIP, +# define X64_RIP X64_RIP + X64_EFL, +# define X64_EFL X64_EFL + X64_CSGSFS, /* Actually short cs, gs, fs, ss. */ +# define X64_CSGSFS X64_CSGSFS + X64_ERR, +# define X64_ERR X64_ERR + X64_TRAPNO, +# define X64_TRAPNO X64_TRAPNO + X64_OLDMASK, +# define X64_OLDMASK X64_OLDMASK + X64_CR2 +# define X64_CR2 X64_CR2 +}; + +struct x64_fpreg +{ + uint64_t value; +}__attribute__((packed)); + +struct x64_fpxreg +{ + unsigned short significand[4]; + unsigned short exponent; + unsigned short padding[3]; +}__attribute__((packed)); + +struct x64_xmmreg +{ + uint32_t element[4]; +}__attribute__((packed)); + +struct x64_fpstate +{ + /* Regular FPU environment. */ + uint16_t cw; + uint16_t sw; + uint16_t tw; + uint16_t fop; + uint64_t rip; + uint64_t rdp; + uint32_t mxcsr; + uint32_t mxcsr_mask; + struct x64_fpreg _st[8]; + struct x64_xmmreg _xmm[16]; + uint32_t res[24]; +}__attribute__((packed)); + +typedef struct x64_fpstate *x64_fpregset_t; + +typedef struct x64_stack_s +{ + void *ss_sp; + int ss_flags; + size_t ss_size; +} x64_stack_t; + +struct sigcontext_x64 +{ + uint64_t r8; + uint64_t r9; + uint64_t r10; + uint64_t r11; + uint64_t r12; + uint64_t r13; + uint64_t r14; + uint64_t r15; + uint64_t di; + uint64_t si; + uint64_t bp; + uint64_t bx; + uint64_t dx; + uint64_t ax; + uint64_t cx; + uint64_t sp; + uint64_t ip; + uint64_t flags; + uint64_t cs; + uint64_t gs; + uint64_t fs; + uint64_t ss; + uint64_t err; + uint64_t trapno; + uint64_t oldmask; + uint64_t cr2; + uint64_t fpstate; /* Zero when no FPU/extended context */ + uint64_t reserved1[8]; +}; + +struct x64_sigcontext +{ + uint64_t r8; + uint64_t r9; + uint64_t r10; + uint64_t r11; + uint64_t r12; + uint64_t r13; + uint64_t r14; + uint64_t r15; + uint64_t rdi; + uint64_t rsi; + uint64_t rbp; + uint64_t rbx; + uint64_t rdx; + uint64_t rax; + uint64_t rcx; + uint64_t rsp; + uint64_t rip; + uint64_t eflags; /* RFLAGS */ + uint16_t cs; + uint16_t gs; + uint16_t fs; + union { + uint16_t ss; /* If UC_SIGCONTEXT_SS */ + uint16_t __pad0; /* Alias name for old (!UC_SIGCONTEXT_SS) user-space */ + }; + uint64_t err; + uint64_t trapno; + uint64_t oldmask; + uint64_t cr2; + struct x64_fpstate *fpstate; /* Zero when no FPU context */ + uint64_t reserved1[8]; +}; + +struct x64_libc_fpstate +{ + /* 64-bit FXSAVE format. */ + uint16_t cwd; + uint16_t swd; + uint16_t ftw; + uint16_t fop; + uint64_t rip; + uint64_t rdp; + uint32_t mxcsr; + uint32_t mxcr_mask; + struct x64_fpxreg st[8]; + struct x64_xmmreg xmm[16]; + uint32_t res1[24]; +}; + +typedef struct x64_mcontext_s +{ + x64_gregset_t gregs; + struct x64_libc_fpstate *fpregs; + uint64_t res[8]; +} x64_mcontext_t; + +// /!\ signal sig_set is different than glibc __sig_set +#ifndef ANDROID +#define _NSIG_WORDS (1024 / (sizeof(unsigned long int)*8)) +#endif + +typedef struct { + unsigned long int sig[_NSIG_WORDS]; +} x64_sigset_t; + +typedef struct x64_ucontext_s +{ + uint64_t uc_flags; + struct x64_ucontext_s* uc_link; + x64_stack_t uc_stack; + x64_mcontext_t uc_mcontext; + x64_sigset_t uc_sigmask; + struct x64_libc_fpstate xstate; + #ifndef ANDROID + uint64_t ssp[4]; + #endif +} x64_ucontext_t; + +typedef struct x64_sigframe_s { + uintptr_t pretcode; // pointer to retcode + int sig; + x64_mcontext_t cpustate; + struct x64_libc_fpstate xstate; + uintptr_t extramask[64-1]; + char retcode[8]; +} x64_sigframe_t; + +struct kernel_sigaction { + void (*k_sa_handler) (int); + unsigned long sa_flags; + void (*sa_restorer) (void); + unsigned long sa_mask; + unsigned long sa_mask2; +}; + +x64_stack_t* sigstack_getstack(); +uint64_t RunFunctionHandler(x64emu_t* emu, int* exit, int dynarec, x64_ucontext_t* sigcontext, uintptr_t fnc, int nargs, ...); + +#endif //__SIGNAL_PRIVATE_H__ \ No newline at end of file diff --git a/src/libtools/signals.c b/src/libtools/signals.c index 3bb2bc0..19891c9 100644 --- a/src/libtools/signals.c +++ b/src/libtools/signals.c @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include @@ -17,6 +16,9 @@ #include #endif +#include "x64_signals.h" +#include "os.h" +#include "backtrace.h" #include "box64context.h" #include "debug.h" #include "x64emu.h" @@ -24,237 +26,39 @@ #include "emu/x64run_private.h" #include "signals.h" #include "box64stack.h" -#include "dynarec.h" +#include "box64cpu.h" #include "callback.h" -#include "x64run.h" #include "elfloader.h" #include "threads.h" #include "emu/x87emu_private.h" #include "custommem.h" +#include "bridge.h" +#include "khash.h" +#include "x64trace.h" #ifdef DYNAREC #include "dynablock.h" #include "../dynarec/dynablock_private.h" #include "dynarec_native.h" +#include "dynarec/dynarec_arch.h" +#include "gdbjit.h" +#if defined(ARM64) +#include "dynarec/arm64/arm64_mapping.h" +#define CONTEXT_REG(P, X) (P)->uc_mcontext.regs[X] +#define CONTEXT_PC(P) (P)->uc_mcontext.pc +#elif defined(LA64) +#include "dynarec/la64/la64_mapping.h" +#define CONTEXT_REG(P, X) (P)->uc_mcontext.__gregs[X] +#define CONTEXT_PC(P) (P)->uc_mcontext.__pc; +#elif defined(RV64) +#include "dynarec/rv64/rv64_mapping.h" +#define CONTEXT_REG(P, X) (P)->uc_mcontext.__gregs[X] +#define CONTEXT_PC(P) (P)->uc_mcontext.__gregs[REG_PC] +#else +#error Unsupported Architecture +#endif //arch #endif - -typedef uint64_t x64_gregset_t[23]; -enum -{ - X64_R8 = 0, -# define X64_R8 X64_R8 - X64_R9, -# define X64_R9 X64_R9 - X64_R10, -# define X64_R10 X64_R10 - X64_R11, -# define X64_R11 X64_R11 - X64_R12, -# define X64_R12 X64_R12 - X64_R13, -# define X64_R13 X64_R13 - X64_R14, -# define X64_R14 X64_R14 - X64_R15, -# define X64_R15 X64_R15 - X64_RDI, -# define X64_RDI X64_RDI - X64_RSI, -# define X64_RSI X64_RSI - X64_RBP, -# define X64_RBP X64_RBP - X64_RBX, -# define X64_RBX X64_RBX - X64_RDX, -# define X64_RDX X64_RDX - X64_RAX, -# define X64_RAX X64_RAX - X64_RCX, -# define X64_RCX X64_RCX - X64_RSP, -# define X64_RSP X64_RSP - X64_RIP, -# define X64_RIP X64_RIP - X64_EFL, -# define X64_EFL X64_EFL - X64_CSGSFS, /* Actually short cs, gs, fs, __pad0. */ -# define X64_CSGSFS X64_CSGSFS - X64_ERR, -# define X64_ERR X64_ERR - X64_TRAPNO, -# define X64_TRAPNO X64_TRAPNO - X64_OLDMASK, -# define X64_OLDMASK X64_OLDMASK - X64_CR2 -# define X64_CR2 X64_CR2 -}; - -struct x64_fpreg -{ - uint64_t value; -}__attribute__((packed)); - -struct x64_fpxreg -{ - unsigned short significand[4]; - unsigned short exponent; - unsigned short padding[3]; -}__attribute__((packed)); - -struct x64_xmmreg -{ - uint32_t element[4]; -}__attribute__((packed)); - -struct x64_fpstate -{ - /* Regular FPU environment. */ - uint16_t cw; - uint16_t sw; - uint16_t tw; - uint16_t fop; - uint64_t rip; - uint64_t rdp; - uint32_t mxcsr; - uint32_t mxcsr_mask; - struct x64_fpreg _st[8]; - struct x64_xmmreg _xmm[16]; - uint32_t res[24]; -}__attribute__((packed)); - -typedef struct x64_fpstate *x64_fpregset_t; - -typedef struct x64_stack_s -{ - void *ss_sp; - int ss_flags; - size_t ss_size; -} x64_stack_t; - -struct sigcontext_x64 -{ - uint64_t r8; - uint64_t r9; - uint64_t r10; - uint64_t r11; - uint64_t r12; - uint64_t r13; - uint64_t r14; - uint64_t r15; - uint64_t di; - uint64_t si; - uint64_t bp; - uint64_t bx; - uint64_t dx; - uint64_t ax; - uint64_t cx; - uint64_t sp; - uint64_t ip; - uint64_t flags; - uint64_t cs; - uint64_t gs; - uint64_t fs; - uint64_t ss; - uint64_t err; - uint64_t trapno; - uint64_t oldmask; - uint64_t cr2; - uint64_t fpstate; /* Zero when no FPU/extended context */ - uint64_t reserved1[8]; -}; - -struct x64_sigcontext -{ - uint64_t r8; - uint64_t r9; - uint64_t r10; - uint64_t r11; - uint64_t r12; - uint64_t r13; - uint64_t r14; - uint64_t r15; - uint64_t rdi; - uint64_t rsi; - uint64_t rbp; - uint64_t rbx; - uint64_t rdx; - uint64_t rax; - uint64_t rcx; - uint64_t rsp; - uint64_t rip; - uint64_t eflags; /* RFLAGS */ - uint16_t cs; - uint16_t gs; - uint16_t fs; - union { - uint16_t ss; /* If UC_SIGCONTEXT_SS */ - uint16_t __pad0; /* Alias name for old (!UC_SIGCONTEXT_SS) user-space */ - }; - uint64_t err; - uint64_t trapno; - uint64_t oldmask; - uint64_t cr2; - struct x64_fpstate *fpstate; /* Zero when no FPU context */ - uint64_t reserved1[8]; -}; - -struct x64_libc_fpstate -{ - /* 64-bit FXSAVE format. */ - uint16_t cwd; - uint16_t swd; - uint16_t ftw; - uint16_t fop; - uint64_t rip; - uint64_t rdp; - uint32_t mxcsr; - uint32_t mxcr_mask; - struct x64_fpxreg st[8]; - struct x64_xmmreg xmm[16]; - uint32_t res1[24]; -}; - -typedef struct x64_mcontext_s -{ - x64_gregset_t gregs; - struct x64_libc_fpstate *fpregs; - uint64_t res[8]; -} x64_mcontext_t; - -// /!\ signal sig_set is different than glibc __sig_set -#define _NSIG_WORDS (128 / sizeof(unsigned long int)) - -typedef struct { - unsigned long int sig[_NSIG_WORDS]; -} x64_sigset_t; - -typedef struct x64_ucontext_s -{ - uint64_t uc_flags; - struct x64_ucontext_s* uc_link; - x64_stack_t uc_stack; - x64_mcontext_t uc_mcontext; - x64_sigset_t uc_sigmask; - struct x64_libc_fpstate xstate; - uint64_t ssp[4]; -} x64_ucontext_t; - -typedef struct x64_sigframe_s { - uintptr_t pretcode; // pointer to retcode - int sig; - x64_mcontext_t cpustate; - struct x64_libc_fpstate xstate; - uintptr_t extramask[64-1]; - char retcode[8]; -} x64_sigframe_t; - -struct kernel_sigaction { - void (*k_sa_handler) (int); - unsigned long sa_flags; - void (*sa_restorer) (void); - unsigned long sa_mask; - unsigned long sa_mask2; -}; +#include "signal_private.h" static void sigstack_destroy(void* p) { @@ -269,6 +73,16 @@ static void sigstack_key_alloc() { pthread_key_create(&sigstack_key, sigstack_destroy); } +x64_stack_t* sigstack_getstack() { + return (x64_stack_t*)pthread_getspecific(sigstack_key); +} + +#ifndef DYNAREC +typedef void dynablock_t; +dynablock_t* FindDynablockFromNativeAddress(void* addr) {return NULL;} +uintptr_t getX64Address(dynablock_t* db, uintptr_t pc) {return 0;} +#endif + // this allow handling "safe" function that just abort if accessing a bad address static __thread JUMPBUFF signal_jmpbuf; #ifdef ANDROID @@ -282,14 +96,14 @@ static __thread int signal_jmpbuf_active = 0; //1<<1 is mutex_prot, 1<<8 is mutex_dyndump #define is_memprot_locked (1<<1) #define is_dyndump_locked (1<<8) -uint64_t RunFunctionHandler(int* exit, int dynarec, x64_ucontext_t* sigcontext, uintptr_t fnc, int nargs, ...) +uint64_t RunFunctionHandler(x64emu_t* emu, int* exit, int dynarec, x64_ucontext_t* sigcontext, uintptr_t fnc, int nargs, ...) { if(fnc==0 || fnc==1) { va_list va; va_start (va, nargs); int sig = va_arg(va, int); va_end (va); - printf_log(LOG_NONE, "%04d|BOX64: Warning, calling Signal %d function handler %s\n", GetTID(), sig, fnc?"SIG_IGN":"SIG_DFL"); + printf_log(LOG_NONE, "%04d|Warning, calling Signal %d function handler %s\n", GetTID(), sig, fnc?"SIG_IGN":"SIG_DFL"); if(fnc==0) { printf_log(LOG_NONE, "Unhandled signal caught, aborting\n"); abort(); @@ -302,22 +116,13 @@ uint64_t RunFunctionHandler(int* exit, int dynarec, x64_ucontext_t* sigcontext, trace_start = 0; trace_end = 1; // disabling trace, globably for now... #endif #endif -#ifndef USE_CUSTOM_MEM - // because a signal can interupt a malloc-like function - // Dynarec cannot be used in signal handling unless custom malloc is used - dynarec = 0; -#endif - - x64emu_t *emu = thread_get_emu(); + if(!emu) + emu = thread_get_emu(); #ifdef DYNAREC - if(box64_dynarec_test) + if (BOX64ENV(dynarec_test)) emu->test.test = 0; #endif - /*SetFS(emu, default_fs);*/ - for (int i=0; i<6; ++i) - emu->segs_serial[i] = 0; - int align = nargs&1; if(nargs>6) @@ -345,8 +150,6 @@ uint64_t RunFunctionHandler(int* exit, int dynarec, x64_ucontext_t* sigcontext, int old_cs = R_CS; R_CS = 0x33; - emu->eflags.x64 &= ~(1<flags.quitonlongjmp = oldquitonlongjmp; #ifdef DYNAREC - if(box64_dynarec_test) { + if (BOX64ENV(dynarec_test)) { emu->test.test = 0; emu->test.clean = 0; } - #endif +#endif if(emu->flags.longjmp) { // longjmp inside signal handler, lets grab all relevent value and do the actual longjmp in the signal handler @@ -391,7 +194,7 @@ uint64_t RunFunctionHandler(int* exit, int dynarec, x64_ucontext_t* sigcontext, // flags sigcontext->uc_mcontext.gregs[X64_EFL] = emu->eflags.x64; // get segments - sigcontext->uc_mcontext.gregs[X64_CSGSFS] = ((uint64_t)(R_CS)) | (((uint64_t)(R_GS))<<16) | (((uint64_t)(R_FS))<<32); + sigcontext->uc_mcontext.gregs[X64_CSGSFS] = ((uint64_t)(R_CS)) | (((uint64_t)(R_GS))<<16) | (((uint64_t)(R_FS))<<32) | (((uint64_t)(R_SS))<<48) ; } else { printf_log(LOG_NONE, "Warning, longjmp in signal but no sigcontext to change\n"); } @@ -440,6 +243,7 @@ EXPORT int my_sigaltstack(x64emu_t* emu, const x64_stack_t* ss, x64_stack_t* oss printf_log(LOG_DEBUG, "%04d|sigaltstack called ss=%p[flags=0x%x, sp=%p, ss=0x%lx], oss=%p\n", GetTID(), ss, ss->ss_flags, ss->ss_sp, ss->ss_size, oss); if(ss->ss_flags && ss->ss_flags!=SS_DISABLE && ss->ss_flags!=SS_ONSTACK) { errno = EINVAL; + signal_jmpbuf_active = 0; return -1; } @@ -462,54 +266,18 @@ EXPORT int my_sigaltstack(x64emu_t* emu, const x64_stack_t* ss, x64_stack_t* oss return 0; } - #ifdef DYNAREC -uintptr_t getX64Address(dynablock_t* db, uintptr_t arm_addr) -{ - uintptr_t x64addr = (uintptr_t)db->x64_addr; - uintptr_t armaddr = (uintptr_t)db->block; - int i = 0; - do { - int x64sz = 0; - int armsz = 0; - do { - x64sz+=db->instsize[i].x64; - armsz+=db->instsize[i].nat*4; - ++i; - } while((db->instsize[i-1].x64==15) || (db->instsize[i-1].nat==15)); - // if the opcode is a NOP on ARM side (so armsz==0), it cannot be an address to find - if(armsz) { - if((arm_addr>=armaddr) && (arm_addr<(armaddr+armsz))) - return x64addr; - armaddr+=armsz; - x64addr+=x64sz; - } else - x64addr+=x64sz; - } while(db->instsize[i].x64 || db->instsize[i].nat); - return x64addr; -} x64emu_t* getEmuSignal(x64emu_t* emu, ucontext_t* p, dynablock_t* db) { -#if defined(ARM64) - if(db && p->uc_mcontext.regs[0]>0x10000) { - emu = (x64emu_t*)p->uc_mcontext.regs[0]; - } -#elif defined(LA64) - if(db && p->uc_mcontext.__gregs[4]>0x10000) { - emu = (x64emu_t*)p->uc_mcontext.__gregs[4]; - } -#elif defined(RV64) - if(db && p->uc_mcontext.__gregs[10]>0x10000) { - emu = (x64emu_t*)p->uc_mcontext.__gregs[10]; - } -#else -#error Unsupported Architecture -#endif //arch + if(db && CONTEXT_REG(p, xEmu)>0x10000) { + emu = (x64emu_t*)CONTEXT_REG(p, xEmu); + } return emu; } #endif - -void adjustregs(x64emu_t* emu) { +int write_opcode(uintptr_t rip, uintptr_t native_ip, int is32bits); +void adjustregs(x64emu_t* emu, void* pc) { + if(!pc) return; // tests some special cases uint8_t* mem = (uint8_t*)R_RIP; rex_t rex = {0}; @@ -532,25 +300,26 @@ void adjustregs(x64emu_t* emu) { } ++idx; } - dynarec_log(LOG_INFO, "Checking opcode: rex=%02hhx is32bits=%d, rep=%d is66=%d %02hhX %02hhX %02hhX %02hhX\n", rex.rex, rex.is32bits, rep, is66, mem[idx+0], mem[idx+1], mem[idx+2], mem[idx+3]); + dynarec_log(LOG_INFO, "Checking opcode: at %p rex=%02hhx is32bits=%d, rep=%d is66=%d %02hhX %02hhX %02hhX %02hhX\n", (void*)R_RIP, rex.rex, rex.is32bits, rep, is66, mem[idx+0], mem[idx+1], mem[idx+2], mem[idx+3]); #ifdef DYNAREC #ifdef ARM64 - if(mem[idx+0]==0xA4) { - // (rep) movsb, read done, write not... - if(emu->eflags.f._F_DF) - R_RSI++; - else - R_RSI--; + if(mem[idx+0]==0xA4 || mem[idx+0]==0xA5) { + uint32_t opcode = *(uint32_t*)pc; + // (rep) movsX, read done, write not... so opcode is a STR?_S9_postindex(A, B, C) with C to be substracted to RSI + // xx111000000iiiiiiiii01nnnnnttttt xx = size, iiiiiiiii = signed offset, t = value, n = address + if((opcode & 0b00111111111000000000110000000000)==0b00111000000000000000010000000000) { + int offset = (opcode>>12)&0b111111111; + offset<<=31-9; + offset>>=31-9; // sign extend + dynarec_log(LOG_INFO, "\tAdjusting RSI: %d\n", -offset); + R_RSI -= offset; + } return; } - if(mem[idx+0]==0xA5) { - // (rep) movsd, read done, write not... - int step = (emu->eflags.f._F_DF)?-1:+1; - if(rex.w) step*=8; - else if(is66) step *=2; - else step*=4; - R_RSI-=step; - return; + if(mem[idx+0]==0x8F && (mem[idx+1]&0xc0)!=0xc0) { + // POP Ed, issue on write address, restore RSP as in before the pop + dynarec_log(LOG_INFO, "\tAdjusting RSP: %d\n", -(is66?2:(rex.is32bits?4:8))); + R_RSP -= is66?2:(rex.is32bits?4:8); } #elif defined(LA64) #elif defined(RV64) @@ -562,78 +331,162 @@ void adjustregs(x64emu_t* emu) { void copyUCTXreg2Emu(x64emu_t* emu, ucontext_t* p, uintptr_t ip) { #ifdef DYNAREC -#ifdef ARM64 - emu->regs[_AX].q[0] = p->uc_mcontext.regs[10]; - emu->regs[_CX].q[0] = p->uc_mcontext.regs[11]; - emu->regs[_DX].q[0] = p->uc_mcontext.regs[12]; - emu->regs[_BX].q[0] = p->uc_mcontext.regs[13]; - emu->regs[_SP].q[0] = p->uc_mcontext.regs[14]; - emu->regs[_BP].q[0] = p->uc_mcontext.regs[15]; - emu->regs[_SI].q[0] = p->uc_mcontext.regs[16]; - emu->regs[_DI].q[0] = p->uc_mcontext.regs[17]; - emu->regs[_R8].q[0] = p->uc_mcontext.regs[18]; - emu->regs[_R9].q[0] = p->uc_mcontext.regs[19]; - emu->regs[_R10].q[0] = p->uc_mcontext.regs[20]; - emu->regs[_R11].q[0] = p->uc_mcontext.regs[21]; - emu->regs[_R12].q[0] = p->uc_mcontext.regs[22]; - emu->regs[_R13].q[0] = p->uc_mcontext.regs[23]; - emu->regs[_R14].q[0] = p->uc_mcontext.regs[24]; - emu->regs[_R15].q[0] = p->uc_mcontext.regs[25]; + #define GO(R) emu->regs[_##R].q[0] = CONTEXT_REG(p, x##R) + GO(RAX); + GO(RCX); + GO(RDX); + GO(RBX); + GO(RSP); + GO(RBP); + GO(RSI); + GO(RDI); + GO(R8); + GO(R9); + GO(R10); + GO(R11); + GO(R12); + GO(R13); + GO(R14); + GO(R15); + #undef GO emu->ip.q[0] = ip; - emu->eflags.x64 = p->uc_mcontext.regs[26]; -#elif defined(LA64) - emu->regs[_AX].q[0] = p->uc_mcontext.__gregs[12]; - emu->regs[_CX].q[0] = p->uc_mcontext.__gregs[13]; - emu->regs[_DX].q[0] = p->uc_mcontext.__gregs[14]; - emu->regs[_BX].q[0] = p->uc_mcontext.__gregs[15]; - emu->regs[_SP].q[0] = p->uc_mcontext.__gregs[16]; - emu->regs[_BP].q[0] = p->uc_mcontext.__gregs[17]; - emu->regs[_SI].q[0] = p->uc_mcontext.__gregs[18]; - emu->regs[_DI].q[0] = p->uc_mcontext.__gregs[19]; - emu->regs[_R8].q[0] = p->uc_mcontext.__gregs[23]; - emu->regs[_R9].q[0] = p->uc_mcontext.__gregs[24]; - emu->regs[_R10].q[0] = p->uc_mcontext.__gregs[25]; - emu->regs[_R11].q[0] = p->uc_mcontext.__gregs[26]; - emu->regs[_R12].q[0] = p->uc_mcontext.__gregs[27]; - emu->regs[_R13].q[0] = p->uc_mcontext.__gregs[28]; - emu->regs[_R14].q[0] = p->uc_mcontext.__gregs[29]; - emu->regs[_R15].q[0] = p->uc_mcontext.__gregs[30]; - emu->ip.q[0] = ip; - emu->eflags.x64 = p->uc_mcontext.__gregs[31]; -#elif defined(RV64) - emu->regs[_AX].q[0] = p->uc_mcontext.__gregs[16]; - emu->regs[_CX].q[0] = p->uc_mcontext.__gregs[17]; - emu->regs[_DX].q[0] = p->uc_mcontext.__gregs[18]; - emu->regs[_BX].q[0] = p->uc_mcontext.__gregs[19]; - emu->regs[_SP].q[0] = p->uc_mcontext.__gregs[20]; - emu->regs[_BP].q[0] = p->uc_mcontext.__gregs[21]; - emu->regs[_SI].q[0] = p->uc_mcontext.__gregs[22]; - emu->regs[_DI].q[0] = p->uc_mcontext.__gregs[23]; - emu->regs[_R8].q[0] = p->uc_mcontext.__gregs[24]; - emu->regs[_R9].q[0] = p->uc_mcontext.__gregs[25]; - emu->regs[_R10].q[0] = p->uc_mcontext.__gregs[26]; - emu->regs[_R11].q[0] = p->uc_mcontext.__gregs[27]; - emu->regs[_R12].q[0] = p->uc_mcontext.__gregs[28]; - emu->regs[_R13].q[0] = p->uc_mcontext.__gregs[29]; - emu->regs[_R14].q[0] = p->uc_mcontext.__gregs[30]; - emu->regs[_R15].q[0] = p->uc_mcontext.__gregs[31]; - emu->ip.q[0] = ip; - emu->eflags.x64 = p->uc_mcontext.__gregs[8]; -#else -#error Unsupported architecture +#ifdef LA64 + // TODO: move to ADJUST_ARCH + if (cpuext.lbt) { + #ifndef LA64_ABI_1 + struct lbt_context* lbt_ctx = NULL; + struct sctx_info* info = (struct sctx_info*)p->uc_mcontext.__extcontext; + while (info->magic && !lbt_ctx) { + if (info->magic == LBT_CTX_MAGIC) + lbt_ctx = (struct lbt_context*)((uintptr_t)info + sizeof(struct sctx_info)); + else + info = (struct sctx_info*)((uintptr_t)info + info->size); + } + + if (lbt_ctx) { + uint64_t flags = CONTEXT_REG(p, xFlags) & ~0b100011010101; + flags = flags | (lbt_ctx->eflags & 0b100011010101); + emu->eflags.x64 = flags; + } else { + printf_log(LOG_NONE, "Are you on a non-LBT kernel? Use BOX64_DYNAREC_NOHOSTEXT=lbt to prevent Box64 from using it.\n"); + emu->eflags.x64 = CONTEXT_REG(p, xFlags); + } + #else + uint64_t flags = CONTEXT_REG(p, xFlags) & ~0b100011010101; + flags = flags | (*(uint32_t*)(((struct sigcontext*)&p->uc_mcontext)->sc_reserved) & 0b100011010101); + emu->eflags.x64 = flags; + #endif + } else #endif + emu->eflags.x64 = CONTEXT_REG(p, xFlags); #endif } -int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) +KHASH_SET_INIT_INT64(unaligned) +static kh_unaligned_t *unaligned = NULL; +static kh_unaligned_t *autosmc = NULL; + +void add_unaligned_address(uintptr_t addr) +{ + if(!unaligned) + unaligned = kh_init(unaligned); + khint_t k; + int ret; + k = kh_put(unaligned, unaligned, addr, &ret); // just add +} + +int is_addr_unaligned(uintptr_t addr) +{ + if(!unaligned) + return 0; + khint_t k = kh_get(unaligned, unaligned, addr); + return (k==kh_end(unaligned))?0:1; +} + +void add_autosmc_address(uintptr_t addr) +{ + if(!autosmc) + autosmc = kh_init(unaligned); + khint_t k; + int ret; + k = kh_put(unaligned, autosmc, addr, &ret); // just add +} + +int is_addr_autosmc(uintptr_t addr) +{ + if(!autosmc) + return 0; + khint_t k = kh_get(unaligned, autosmc, addr); + return (k==kh_end(autosmc))?0:1; +} + +#ifdef DYNAREC +int nUnalignedRange(uintptr_t start, size_t size) +{ + if(!unaligned) + return 0; + int n = 0; + uintptr_t end = start + size -1; + uintptr_t addr; + kh_foreach_key(unaligned, addr, + if(addr>=start && addr<=end) + ++n; + ); + return n; +} +void getUnalignedRange(uintptr_t start, size_t size, uintptr_t addrs[]) +{ + if(!unaligned) + return; + int n = 0; + uintptr_t end = start + size -1; + uintptr_t addr; + kh_foreach_key(unaligned, addr, + if(addr>=start && addr<=end) + addrs[n++] = addr; + ); +} + +int mark_db_unaligned(dynablock_t* db, uintptr_t x64pc) +{ + add_unaligned_address(x64pc); + db->hash++; // dirty the block + MarkDynablock(db); // and mark it +if(BOX64ENV(showsegv)) printf_log(LOG_INFO, "Marked db %p as dirty, and address %p as needing unaligned handling\n", db, (void*)x64pc); + return 2; // marked, exit handling... +} + +int mark_db_autosmc(dynablock_t* db, uintptr_t x64pc) +{ + add_autosmc_address(x64pc); + db->hash++; // dirty the block + MarkDynablock(db); // and mark it +if(BOX64ENV(showsegv)) printf_log(LOG_INFO, "Marked db %p as dirty, and address %p as creating internal SMC\n", db, (void*)x64pc); + return 2; // marked, exit handling... +} + +#endif + +#ifdef DYNAREC +#ifdef ARM64 +#include "dynarec/arm64/arm64_printer.h" +#elif RV64 +#include "dynarec/rv64/rv64_printer.h" +#endif +#endif +int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd, dynablock_t* db, uintptr_t x64pc, int is32bits) { if((uintptr_t)pc<0x10000) return 0; +#ifdef DYNAREC + if(ARCH_UNALIGNED(db, x64pc)) + /*return*/ mark_db_unaligned(db, x64pc); // don't force an exit for now +#endif #ifdef ARM64 ucontext_t *p = (ucontext_t *)ucntx; uint32_t opcode = *(uint32_t*)pc; struct fpsimd_context *fpsimd = (struct fpsimd_context *)_fpsimd; - //printf_log(LOG_INFO, "Checking SIGBUS special casses with pc=%p, opcode=%x, fpsimd=%p\n", pc, opcode, fpsimd); + //printf_log(LOG_INFO, "Checking SIGBUS special cases with pc=%p, opcode=%x, fpsimd=%p\n", pc, opcode, fpsimd); if((opcode&0b10111111110000000000000000000000)==0b10111001000000000000000000000000) { // this is STR int scale = (opcode>>30)&3; @@ -642,6 +495,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) uint64_t offset = (opcode>>10)&0b111111111111; offset<<=scale; volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[dest] + offset); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); uint64_t value = p->uc_mcontext.regs[val]; if(scale==3 && (((uintptr_t)addr)&3)==0) { for(int i=0; i<2; ++i) @@ -661,6 +515,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) if((offset>>(9-1))&1) offset |= (0xffffffffffffffffll<<9); volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[dest] + offset); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); uint64_t value = p->uc_mcontext.regs[val]; if(size==8 && (((uintptr_t)addr)&3)==0) { for(int i=0; i<2; ++i) @@ -685,6 +540,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) int val = opcode&31; int dest = (opcode>>5)&31; volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[dest] + offset); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); __uint128_t value = fpsimd->vregs[val]; if(scale>2 && (((uintptr_t)addr)&3)==0) { for(int i=0; i<(1<<(scale-2)); ++i) @@ -710,6 +566,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) int val = opcode&31; int dest = (opcode>>5)&31; volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[dest] + offset); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); __uint128_t value = fpsimd->vregs[val]; if(scale>2 && (((uintptr_t)addr)&3)==0) { for(int i=0; i<(1<<(scale-2)); ++i) @@ -734,6 +591,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) int val = opcode&31; int dest = (opcode>>5)&31; volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[dest] + offset); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); __uint128_t value = 0; if(scale>2 && (((uintptr_t)addr)&3)==0) { for(int i=0; i<(1<<(scale-2)); ++i) @@ -760,6 +618,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) int val = opcode&31; int dest = (opcode>>5)&31; volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[dest] + offset); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); __uint128_t value = 0; if(scale>2 && (((uintptr_t)addr)&3)==0) { for(int i=0; i<(1<<(scale-2)); ++i) @@ -779,6 +638,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) uint64_t offset = (opcode>>10)&0b111111111111; offset<<=scale; volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[dest] + offset); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); uint64_t value = 0; if(scale==3 && (((uintptr_t)addr)&3)==0) { for(int i=0; i<2; ++i) @@ -799,6 +659,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) if((offset>>(9-1))&1) offset |= (0xffffffffffffffffll<<9); volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[dest] + offset); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); uint64_t value = 0; if(size==8 && (((uintptr_t)addr)&3)==0) { for(int i=0; i<2; ++i) @@ -818,6 +679,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) uint64_t offset = (opcode>>10)&0b111111111111; offset<<=scale; volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[dest] + offset); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); uint64_t value = p->uc_mcontext.regs[val]; for(int i=0; i<(1<>(i*8))&0xff; @@ -832,6 +694,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) if((offset>>(9-1))&1) offset |= (0xffffffffffffffffll<<9); volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[dest] + offset); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); uint64_t value = p->uc_mcontext.regs[val]; for(int i=0; i<2; ++i) addr[i] = (value>>(i*8))&0xff; @@ -850,6 +713,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) return 0; // only LSL is supported uint64_t offset = p->uc_mcontext.regs[dest2]<uc_mcontext.regs[dest] + offset); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); uint64_t value = p->uc_mcontext.regs[val]; for(int i=0; i<(1<>(i*8))&0xff; @@ -867,6 +731,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) offset |= (0xffffffffffffffffll<<7); offset <<= scale; uintptr_t addr= p->uc_mcontext.regs[dest] + offset; + if(is32bits) addr = addr&0xffffffff; if((((uintptr_t)addr)&3)==0) { ((volatile uint32_t*)addr)[0] = p->uc_mcontext.regs[val1]; ((volatile uint32_t*)addr)[1] = p->uc_mcontext.regs[val2]; @@ -889,6 +754,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) offset |= (0xffffffffffffffffll<<7); offset <<= scale; uintptr_t addr= p->uc_mcontext.regs[dest] + offset; + if(is32bits) addr = addr&0xffffffff; if((((uintptr_t)addr)&3)==0) { for(int i=0; i<4; ++i) ((volatile uint32_t*)addr)[0+i] = (fpsimd->vregs[val1]>>(i*32))&0xffffffff; @@ -909,6 +775,7 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) int val = opcode&31; int dest = (opcode>>5)&31; volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[dest]); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); uint64_t value = fpsimd->vregs[val]>>(idx*64); if((((uintptr_t)addr)&3)==0) { for(int i=0; i<2; ++i) @@ -919,70 +786,207 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) p->uc_mcontext.pc+=4; // go to next opcode return 1; } + if((opcode&0b10111111111000000000110000000000) == 0b10111000010000000000010000000000) { + // this is a LDR postoffset + int size = 1<<((opcode>>30)&3); + int val = opcode&31; + int dest = (opcode>>5)&31; + int64_t offset = (opcode>>12)&0b111111111; + if((offset>>(9-1))&1) + offset |= (0xffffffffffffffffll<<9); + volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[dest]); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); + uint64_t value = 0; + if(size==8 && (((uintptr_t)addr)&3)==0) { + for(int i=0; i<2; ++i) + value |= ((uint64_t)((volatile uint32_t*)addr)[i]) << (i*32); + } else + for(int i=0; iuc_mcontext.regs[val] = value; + p->uc_mcontext.regs[dest] += offset; + p->uc_mcontext.pc+=4; // go to next opcode + return 1; + } + if((opcode&0b10111111111000000000110000000000) == 0b10111000000000000000010000000000) { + // this is a STR postoffset + int size = 1<<((opcode>>30)&3); + int val = opcode&31; + int src = (opcode>>5)&31; + int64_t offset = (opcode>>12)&0b111111111; + if((offset>>(9-1))&1) + offset |= (0xffffffffffffffffll<<9); + volatile uint8_t* addr = (void*)(p->uc_mcontext.regs[src]); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); + uint64_t value = p->uc_mcontext.regs[val]; + if(size==8 && (((uintptr_t)addr)&3)==0) { + for(int i=0; i<2; ++i) + ((volatile uint32_t*)addr)[i] = (value>>(i*32))&0xffffffff; + } else + for(int i=0; i>(i*8))&0xff; + p->uc_mcontext.regs[src] += offset; + p->uc_mcontext.pc+=4; // go to next opcode + return 1; + } else { + printf_log(LOG_INFO, "Unsupported SIGBUS special cases with pc=%p, opcode=%x (%s)\n", pc, opcode, arm64_print(opcode, (uintptr_t)pc)); + } +#elif RV64 +#define GET_FIELD(v, high, low) (((v) >> low) & ((1ULL << (high - low + 1)) - 1)) +#define SIGN_EXT(val, val_sz) (((int32_t)(val) << (32 - (val_sz))) >> (32 - (val_sz))) + + ucontext_t *p = (ucontext_t *)ucntx; + uint32_t inst = *(uint32_t*)pc; + + uint32_t funct3 = GET_FIELD(inst, 14, 12); + uint32_t opcode = GET_FIELD(inst, 6, 0); + if ((opcode == 0b0100011 || opcode == 0b0100111 /* F */) && (funct3 == 0b010 /* (F)SW */ || funct3 == 0b011 /* (F)SD */ || funct3 == 0b001 /* SH */)) { + int val = (inst >> 20) & 0x1f; + int dest = (inst >> 15) & 0x1f; + int64_t imm = (GET_FIELD(inst, 31, 25) << 5) | (GET_FIELD(inst, 11, 7)); + imm = SIGN_EXT(imm, 12); + volatile uint8_t *addr = (void *)(p->uc_mcontext.__gregs[dest] + imm); + if(is32bits) addr = (uint8_t*)(((uintptr_t)addr)&0xffffffff); + uint64_t value = opcode == 0b0100011 ? p->uc_mcontext.__gregs[val] : p->uc_mcontext.__fpregs.__d.__f[val<<1]; + for(int i = 0; i < (funct3 == 0b010 ? 4 : funct3 == 0b011 ? 8 : 2); ++i) { + addr[i] = (value >> (i * 8)) & 0xff; + } + p->uc_mcontext.__gregs[0] += 4; // pc += 4 + return 1; + } else { + printf_log(LOG_NONE, "Unsupported SIGBUS special cases with pc=%p, opcode=%x (%s)\n", pc, inst, rv64_print(inst, (uintptr_t)pc)); + } + +#undef GET_FIELD +#undef SIGN_EXT #endif return 0; +#undef CHECK +} + +#ifdef USE_CUSTOM_MUTEX +extern uint32_t mutex_prot; +extern uint32_t mutex_blocks; +#else +extern pthread_mutex_t mutex_prot; +extern pthread_mutex_t mutex_blocks; +#endif + +// unlock mutex that are locked by current thread (for signal handling). Return a mask of unlock mutex +int unlockMutex() +{ + int ret = 0; + int i; + #ifdef USE_CUSTOM_MUTEX + uint32_t tid = (uint32_t)GetTID(); + #define GO(A, B) \ + i = (native_lock_storeifref2_d(&A, 0, tid) == tid); \ + if (i) { \ + ret |= (1 << B); \ + } + #else + #define GO(A, B) \ + i = checkUnlockMutex(&A); \ + if (i) { \ + ret |= (1 << B); \ + } + #endif + + GO(mutex_blocks, 0) + GO(mutex_prot, 1) + + GO(my_context->mutex_trace, 7) + #ifdef DYNAREC + GO(my_context->mutex_dyndump, 8) + #else + GO(my_context->mutex_lock, 8) + #endif + GO(my_context->mutex_tls, 9) + GO(my_context->mutex_thread, 10) + GO(my_context->mutex_bridge, 11) + #undef GO + + return ret; +} +int checkMutex(uint32_t mask) +{ + int ret = 0; + int i; + #ifdef USE_CUSTOM_MUTEX + uint32_t tid = (uint32_t)GetTID(); + #define GO(A, B) \ + if(mask&(1<mutex_trace, 7) + #ifdef DYNAREC + GO(my_context->mutex_dyndump, 8) + #else + GO(my_context->mutex_lock, 8) + #endif + GO(my_context->mutex_tls, 9) + GO(my_context->mutex_thread, 10) + GO(my_context->mutex_bridge, 11) + #undef GO + + return ret; } -void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void * ucntx, int* old_code, void* cur_db) +#ifdef BOX32 +void my_sigactionhandler_oldcode_32(x64emu_t* emu, int32_t sig, int simple, siginfo_t* info, void * ucntx, int* old_code, void* cur_db); +#endif +void my_sigactionhandler_oldcode_64(x64emu_t* emu, int32_t sig, int simple, siginfo_t* info, void * ucntx, int* old_code, void* cur_db) { int Locks = unlockMutex(); + int log_minimum = (BOX64ENV(showsegv))?LOG_NONE:LOG_DEBUG; printf_log(LOG_DEBUG, "Sigactionhanlder for signal #%d called (jump to %p/%s)\n", sig, (void*)my_context->signals[sig], GetNativeName((void*)my_context->signals[sig])); uintptr_t restorer = my_context->restorer[sig]; // get that actual ESP first! - x64emu_t *emu = thread_get_emu(); + if(!emu) + emu = thread_get_emu(); uintptr_t frame = R_RSP; #if defined(DYNAREC) -#if defined(ARM64) - dynablock_t* db = (dynablock_t*)cur_db;//FindDynablockFromNativeAddress(pc); - ucontext_t *p = (ucontext_t *)ucntx; - void* pc = NULL; - if(p) { - pc = (void*)p->uc_mcontext.pc; - if(db) - frame = (uintptr_t)p->uc_mcontext.regs[10+_SP]; - } -#elif defined(LA64) - dynablock_t* db = (dynablock_t*)cur_db;//FindDynablockFromNativeAddress(pc); - ucontext_t *p = (ucontext_t *)ucntx; - void* pc = NULL; - if(p) { - pc = (void*)p->uc_mcontext.__pc; - if(db) - frame = (uintptr_t)p->uc_mcontext.__gregs[12+_SP]; - } -#elif defined(RV64) dynablock_t* db = (dynablock_t*)cur_db;//FindDynablockFromNativeAddress(pc); ucontext_t *p = (ucontext_t *)ucntx; void* pc = NULL; if(p) { - pc = (void*)p->uc_mcontext.__gregs[0]; + pc = (void*)CONTEXT_PC(p); if(db) - frame = (uintptr_t)p->uc_mcontext.__gregs[16+_SP]; + frame = (uintptr_t)CONTEXT_REG(p, xRSP); } -#else -#error Unsupported architecture -#endif #else (void)ucntx; (void)cur_db; + void* pc = NULL; #endif - // setup libc context stack frame, on caller stack - frame = frame&~15; // stack tracking x64_stack_t *new_ss = my_context->onstack[sig]?(x64_stack_t*)pthread_getspecific(sigstack_key):NULL; int used_stack = 0; if(new_ss) { if(new_ss->ss_flags == SS_ONSTACK) { // already using it! - frame = (uintptr_t)emu->regs[_SP].q[0]; + frame = ((uintptr_t)emu->regs[_SP].q[0] - 128ULL) & ~0x0fULL; } else { - frame = (uintptr_t)(((uintptr_t)new_ss->ss_sp + new_ss->ss_size - 16) & ~0x0f); + frame = (uintptr_t)(((uintptr_t)new_ss->ss_sp + new_ss->ss_size - 16ULL) & ~0x0fULL); used_stack = 1; new_ss->ss_flags = SS_ONSTACK; } } else { - frame -= 0x200; // redzone + frame = frame&~15ULL; + frame -= 0x200ULL; // redzone } // TODO: do I need to really setup 2 stack frame? That doesn't seems right! @@ -1012,81 +1016,32 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void sigcontext->uc_mcontext.gregs[X64_RBP] = R_RBP; sigcontext->uc_mcontext.gregs[X64_RSP] = R_RSP; sigcontext->uc_mcontext.gregs[X64_RBX] = R_RBX; - sigcontext->uc_mcontext.gregs[X64_RIP] = R_RIP;//emu->old_ip; // old_ip should be more accurate as the "current" IP, but it's not always up-to-date + sigcontext->uc_mcontext.gregs[X64_RIP] = R_RIP; // flags - sigcontext->uc_mcontext.gregs[X64_EFL] = emu->eflags.x64; + sigcontext->uc_mcontext.gregs[X64_EFL] = emu->eflags.x64 | (1<uc_mcontext.gregs[X64_CSGSFS] = ((uint64_t)(R_CS)) | (((uint64_t)(R_GS))<<16) | (((uint64_t)(R_FS))<<32); -#if defined(DYNAREC) -#if defined(ARM64) - if(db && p) { - sigcontext->uc_mcontext.gregs[X64_RAX] = p->uc_mcontext.regs[10]; - sigcontext->uc_mcontext.gregs[X64_RCX] = p->uc_mcontext.regs[11]; - sigcontext->uc_mcontext.gregs[X64_RDX] = p->uc_mcontext.regs[12]; - sigcontext->uc_mcontext.gregs[X64_RBX] = p->uc_mcontext.regs[13]; - sigcontext->uc_mcontext.gregs[X64_RSP] = p->uc_mcontext.regs[14]; - sigcontext->uc_mcontext.gregs[X64_RBP] = p->uc_mcontext.regs[15]; - sigcontext->uc_mcontext.gregs[X64_RSI] = p->uc_mcontext.regs[16]; - sigcontext->uc_mcontext.gregs[X64_RDI] = p->uc_mcontext.regs[17]; - sigcontext->uc_mcontext.gregs[X64_R8] = p->uc_mcontext.regs[18]; - sigcontext->uc_mcontext.gregs[X64_R9] = p->uc_mcontext.regs[19]; - sigcontext->uc_mcontext.gregs[X64_R10] = p->uc_mcontext.regs[20]; - sigcontext->uc_mcontext.gregs[X64_R11] = p->uc_mcontext.regs[21]; - sigcontext->uc_mcontext.gregs[X64_R12] = p->uc_mcontext.regs[22]; - sigcontext->uc_mcontext.gregs[X64_R13] = p->uc_mcontext.regs[23]; - sigcontext->uc_mcontext.gregs[X64_R14] = p->uc_mcontext.regs[24]; - sigcontext->uc_mcontext.gregs[X64_R15] = p->uc_mcontext.regs[25]; - sigcontext->uc_mcontext.gregs[X64_RIP] = getX64Address(db, (uintptr_t)pc); - } -#elif defined(LA64) - if(db && p) { - sigcontext->uc_mcontext.gregs[X64_RAX] = p->uc_mcontext.__gregs[12]; - sigcontext->uc_mcontext.gregs[X64_RCX] = p->uc_mcontext.__gregs[13]; - sigcontext->uc_mcontext.gregs[X64_RDX] = p->uc_mcontext.__gregs[14]; - sigcontext->uc_mcontext.gregs[X64_RBX] = p->uc_mcontext.__gregs[15]; - sigcontext->uc_mcontext.gregs[X64_RSP] = p->uc_mcontext.__gregs[16]; - sigcontext->uc_mcontext.gregs[X64_RBP] = p->uc_mcontext.__gregs[17]; - sigcontext->uc_mcontext.gregs[X64_RSI] = p->uc_mcontext.__gregs[18]; - sigcontext->uc_mcontext.gregs[X64_RDI] = p->uc_mcontext.__gregs[19]; - sigcontext->uc_mcontext.gregs[X64_R8] = p->uc_mcontext.__gregs[23]; - sigcontext->uc_mcontext.gregs[X64_R9] = p->uc_mcontext.__gregs[24]; - sigcontext->uc_mcontext.gregs[X64_R10] = p->uc_mcontext.__gregs[25]; - sigcontext->uc_mcontext.gregs[X64_R11] = p->uc_mcontext.__gregs[26]; - sigcontext->uc_mcontext.gregs[X64_R12] = p->uc_mcontext.__gregs[27]; - sigcontext->uc_mcontext.gregs[X64_R13] = p->uc_mcontext.__gregs[28]; - sigcontext->uc_mcontext.gregs[X64_R14] = p->uc_mcontext.__gregs[29]; - sigcontext->uc_mcontext.gregs[X64_R15] = p->uc_mcontext.__gregs[30]; - sigcontext->uc_mcontext.gregs[X64_RIP] = getX64Address(db, (uintptr_t)pc); - } -#elif defined(RV64) - if(db && p) { - sigcontext->uc_mcontext.gregs[X64_RAX] = p->uc_mcontext.__gregs[16]; - sigcontext->uc_mcontext.gregs[X64_RCX] = p->uc_mcontext.__gregs[17]; - sigcontext->uc_mcontext.gregs[X64_RDX] = p->uc_mcontext.__gregs[18]; - sigcontext->uc_mcontext.gregs[X64_RBX] = p->uc_mcontext.__gregs[19]; - sigcontext->uc_mcontext.gregs[X64_RSP] = p->uc_mcontext.__gregs[20]; - sigcontext->uc_mcontext.gregs[X64_RBP] = p->uc_mcontext.__gregs[21]; - sigcontext->uc_mcontext.gregs[X64_RSI] = p->uc_mcontext.__gregs[22]; - sigcontext->uc_mcontext.gregs[X64_RDI] = p->uc_mcontext.__gregs[23]; - sigcontext->uc_mcontext.gregs[X64_R8] = p->uc_mcontext.__gregs[24]; - sigcontext->uc_mcontext.gregs[X64_R9] = p->uc_mcontext.__gregs[25]; - sigcontext->uc_mcontext.gregs[X64_R10] = p->uc_mcontext.__gregs[26]; - sigcontext->uc_mcontext.gregs[X64_R11] = p->uc_mcontext.__gregs[27]; - sigcontext->uc_mcontext.gregs[X64_R12] = p->uc_mcontext.__gregs[28]; - sigcontext->uc_mcontext.gregs[X64_R13] = p->uc_mcontext.__gregs[29]; - sigcontext->uc_mcontext.gregs[X64_R14] = p->uc_mcontext.__gregs[30]; - sigcontext->uc_mcontext.gregs[X64_R15] = p->uc_mcontext.__gregs[31]; - sigcontext->uc_mcontext.gregs[X64_RIP] = getX64Address(db, (uintptr_t)pc); + sigcontext->uc_mcontext.gregs[X64_CSGSFS] = ((uint64_t)(R_CS)) | (((uint64_t)(R_GS))<<16) | (((uint64_t)(R_FS))<<32) | (((uint64_t)(R_SS))<<48); + if(R_CS==0x23) { + // trucate regs to 32bits, just in case + #define GO(R) sigcontext->uc_mcontext.gregs[X64_R##R]&=0xFFFFFFFF + GO(AX); + GO(CX); + GO(DX); + GO(DI); + GO(SI); + GO(BP); + GO(SP); + GO(BX); + GO(IP); + #undef GO } -#else -#error Unsupported architecture -#endif -#endif // get FloatPoint status sigcontext->uc_mcontext.fpregs = xstate;//(struct x64_libc_fpstate*)&sigcontext->xstate; fpu_xsave_mask(emu, xstate, 0, 0b111); memcpy(&sigcontext->xstate, xstate, sizeof(sigcontext->xstate)); ((struct x64_fpstate*)xstate)->res[12] = 0x46505853; // magic number to signal an XSTATE type of fpregs + ((struct x64_fpstate*)xstate)->res[13] = 0; // offset to xstate after this? // get signal mask if(new_ss) { @@ -1118,63 +1073,109 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void TRAP_x86_CACHEFLT = 19 // SIMD exception (via SIGFPE) if CPU is SSE capable otherwise Cache flush exception (via SIGSEV) */ uint32_t prot = getProtection((uintptr_t)info->si_addr); - if(sig==SIGBUS) + uint32_t mmapped = memExist((uintptr_t)info->si_addr); + uint32_t sysmapped = (info->si_addr<(void*)box64_pagesize)?1:mmapped; + uint32_t real_prot = 0; + int skip = 1; // in case sigjump is used to restore exectuion, 1 will switch to interpreter, 3 will switch to dynarec + if(prot&PROT_READ) real_prot|=PROT_READ; + if(prot&PROT_WRITE) real_prot|=PROT_WRITE; + if(prot&PROT_EXEC) real_prot|=PROT_WRITE; + if(prot&PROT_DYNAREC) real_prot|=PROT_WRITE; + sigcontext->uc_mcontext.gregs[X64_ERR] = 0; + sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 0; + if(sig==X64_SIGBUS) sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 17; - else if(sig==SIGSEGV) { + else if(sig==X64_SIGSEGV) { if((uintptr_t)info->si_addr == sigcontext->uc_mcontext.gregs[X64_RIP]) { - sigcontext->uc_mcontext.gregs[X64_ERR] = (info->si_errno==0x1234)?0:((info->si_errno==0xdead)?(0x2|(info->si_code<<3)):0x0010); // execution flag issue (probably), unless it's a #GP(0) - sigcontext->uc_mcontext.gregs[X64_TRAPNO] = ((info->si_code==SEGV_ACCERR) || (info->si_errno==0x1234) || (info->si_errno==0xdead) || ((uintptr_t)info->si_addr==0))?13:14; - } else if(info->si_code==SEGV_ACCERR && !(prot&PROT_WRITE)) { - sigcontext->uc_mcontext.gregs[X64_ERR] = 0x0002; // write flag issue - if(labs((intptr_t)info->si_addr-(intptr_t)sigcontext->uc_mcontext.gregs[X64_RSP])<16) - sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 12; // stack overflow probably - else + if(info->si_errno==0xbad0) { + //bad opcode + sigcontext->uc_mcontext.gregs[X64_ERR] = 0; + sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 13; + info2->si_code = 128; + info2->si_errno = 0; + info2->si_addr = NULL; + } else if (info->si_errno==0xecec) { + // no excute bit on segment + sigcontext->uc_mcontext.gregs[X64_ERR] = 0x14|((sysmapped && !(real_prot&PROT_READ))?0:1); + sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 14; + if(!mmapped) info2->si_code = 1; + info2->si_errno = 0; + } else if (info->si_errno==0xb09d) { + // bound exception + sigcontext->uc_mcontext.gregs[X64_ERR] = 0; + sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 5; + info2->si_errno = 0; + }else { + sigcontext->uc_mcontext.gregs[X64_ERR] = 0x14|((sysmapped && !(real_prot&PROT_READ))?0:1); sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 14; + } } else { - sigcontext->uc_mcontext.gregs[X64_TRAPNO] = (info->si_code == SEGV_ACCERR)?13:14; - //X64_ERR seems to be INT:8 CODE:8. So for write access segfault it's 0x0002 For a read it's 0x0004 (and 8 for exec). For an int 2d it could be 0x2D01 for example - sigcontext->uc_mcontext.gregs[X64_ERR] = 0x0004; // read error? there is no execute control in box64 anyway + sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 14; + sigcontext->uc_mcontext.gregs[X64_ERR] = 4|((sysmapped && !(real_prot&PROT_READ))?0:1); + if(write_opcode(sigcontext->uc_mcontext.gregs[X64_RIP], (uintptr_t)pc, (R_CS==0x23))) + sigcontext->uc_mcontext.gregs[X64_ERR] |= 2; } if(info->si_code == SEGV_ACCERR && old_code) *old_code = -1; if(info->si_errno==0x1234) { + sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 13; info2->si_errno = 0; } else if(info->si_errno==0xdead) { // INT x - uint8_t int_n = info2->si_code; + uint8_t int_n = info->si_code; info2->si_errno = 0; - info2->si_code = info->si_code; + info2->si_code = 128; info2->si_addr = NULL; + sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 13; + skip = 3; // can resume in dynarec // some special cases... if(int_n==3) { - info2->si_signo = SIGTRAP; + info2->si_signo = X64_SIGTRAP; sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 3; sigcontext->uc_mcontext.gregs[X64_ERR] = 0; - sigcontext->uc_mcontext.gregs[X64_RIP]+=2; // segfault after the INT } else if(int_n==0x04) { sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 4; sigcontext->uc_mcontext.gregs[X64_ERR] = 0; - sigcontext->uc_mcontext.gregs[X64_RIP]+=2; // segfault after the INT } else if (int_n==0x29 || int_n==0x2c || int_n==0x2d) { sigcontext->uc_mcontext.gregs[X64_ERR] = 0x02|(int_n<<3); } else { sigcontext->uc_mcontext.gregs[X64_ERR] = 0x0a|(int_n<<3); + sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 13; } - } else if(info->si_errno==0xcafe) { + } else if(info->si_errno==0xcafe) { // divide by 0 info2->si_errno = 0; + sigcontext->uc_mcontext.gregs[X64_ERR] = 0; sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 0; - info2->si_signo = SIGFPE; + info2->si_signo = X64_SIGFPE; + skip = 3; // can resume in dynarec } - } else if(sig==SIGFPE) { + } else if(sig==X64_SIGFPE) { if (info->si_code == FPE_INTOVF) sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 4; else sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 19; - } else if(sig==SIGILL) + skip = 3; + } else if(sig==X64_SIGILL) { + info2->si_code = 2; sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 6; - else if(sig==SIGTRAP) + info2->si_addr = (void*)sigcontext->uc_mcontext.gregs[X64_RIP]; + } else if(sig==X64_SIGTRAP) { + if(info->si_code==1) { //single step + info2->si_code = 2; + info2->si_addr = (void*)sigcontext->uc_mcontext.gregs[X64_RIP]; + } else + info2->si_code = 128; sigcontext->uc_mcontext.gregs[X64_TRAPNO] = info->si_code; + sigcontext->uc_mcontext.gregs[X64_ERR] = 0; + } else { + skip = 3; // other signal can resume in dynarec + } //TODO: SIGABRT generate what? + printf_log((sig==10)?LOG_DEBUG:log_minimum, "Signal %d: si_addr=%p, TRAPNO=%d, ERR=%d, RIP=%p, prot=%x, mmapped:%d\n", sig, (void*)info2->si_addr, sigcontext->uc_mcontext.gregs[X64_TRAPNO], sigcontext->uc_mcontext.gregs[X64_ERR],sigcontext->uc_mcontext.gregs[X64_RIP], prot, mmapped); + #ifdef DYNAREC + if(sig==3) + SerializeAllMapping(); // Signal Interupt: it's a good time to serialize the mappings if needed + #endif // call the signal handler x64_ucontext_t sigcontext_copy = *sigcontext; // save old value from emu @@ -1197,10 +1198,10 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void int ret; int dynarec = 0; #ifdef DYNAREC - if(sig!=SIGSEGV && !(Locks&is_dyndump_locked) && !(Locks&is_memprot_locked)) - dynarec = 1; + if(!(sig==X64_SIGSEGV || (Locks&is_dyndump_locked) || (Locks&is_memprot_locked))) + dynarec = BOX64ENV(dynarec_interp_signal)?0:1; #endif - ret = RunFunctionHandler(&exits, dynarec, sigcontext, my_context->signals[info2->si_signo], 3, info2->si_signo, info2, sigcontext); + ret = RunFunctionHandler(emu, &exits, dynarec, sigcontext, my_context->signals[info2->si_signo], 3, info2->si_signo, info2, sigcontext); // restore old value from emu if(used_stack) // release stack new_ss->ss_flags = 0; @@ -1237,8 +1238,9 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void GO(R14); GO(R15); #undef GO + if((skip==1) && (emu->ip.q[0]!=sigcontext->uc_mcontext.gregs[X64_RIP])) + skip = 3; // if it jumps elsewhere, it can resume with dynarec... emu->ip.q[0]=sigcontext->uc_mcontext.gregs[X64_RIP]; - sigcontext->uc_mcontext.gregs[X64_RIP] = R_RIP; // flags emu->eflags.x64=sigcontext->uc_mcontext.gregs[X64_EFL]; // get segments @@ -1250,14 +1252,12 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void GO(GS); seg = (sigcontext->uc_mcontext.gregs[X64_CSGSFS] >> 32)&0xffff; GO(FS); + seg = (sigcontext->uc_mcontext.gregs[X64_CSGSFS] >> 48)&0xffff; + GO(SS); #undef GO - for(int i=0; i<6; ++i) - emu->segs_serial[i] = 0; - printf_log(LOG_DEBUG, "Context has been changed in Sigactionhanlder, doing siglongjmp to resume emu at %p\n", (void*)R_RIP); + printf_log((sig==10)?LOG_DEBUG:log_minimum, "Context has been changed in Sigactionhanlder, doing siglongjmp to resume emu at %p, RSP=%p (resume with %s)\n", (void*)R_RIP, (void*)R_RSP, (skip==3)?"Dynarec":"Interp"); if(old_code) *old_code = -1; // re-init the value to allow another segfault at the same place - if(used_stack) // release stack - new_ss->ss_flags = 0; //relockMutex(Locks); // do not relock mutex, because of the siglongjmp, whatever was running is canceled #ifdef DYNAREC if(Locks & is_dyndump_locked) @@ -1266,10 +1266,13 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void #ifdef RV64 emu->xSPSave = emu->old_savedsp; #endif + #ifdef DYNAREC + dynablock_leave_runtime((dynablock_t*)cur_db); + #endif #ifdef ANDROID - siglongjmp(*emu->jmpbuf, 1); + siglongjmp(*emu->jmpbuf, skip); #else - siglongjmp(emu->jmpbuf, 1); + siglongjmp(emu->jmpbuf, skip); #endif } printf_log(LOG_INFO, "Warning, context has been changed in Sigactionhanlder%s\n", (sigcontext->uc_mcontext.gregs[X64_RIP]!=sigcontext_copy.uc_mcontext.gregs[X64_RIP])?" (EIP changed)":""); @@ -1297,12 +1300,14 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void emu->eflags.x64=sigcontext->uc_mcontext.gregs[X64_EFL]; uint16_t seg; seg = (sigcontext->uc_mcontext.gregs[X64_CSGSFS] >> 0)&0xffff; - #define GO(S) emu->segs[_##S]=seg; emu->segs_serial[_##S] = 0; + #define GO(S) emu->segs[_##S]=seg; GO(CS); seg = (sigcontext->uc_mcontext.gregs[X64_CSGSFS] >> 16)&0xffff; GO(GS); seg = (sigcontext->uc_mcontext.gregs[X64_CSGSFS] >> 32)&0xffff; GO(FS); + seg = (sigcontext->uc_mcontext.gregs[X64_CSGSFS] >> 48)&0xffff; + GO(SS); #undef GO printf_log(LOG_DEBUG, "Sigactionhanlder main function returned (exit=%d, restorer=%p)\n", exits, (void*)restorer); @@ -1315,10 +1320,107 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void exit(ret); } if(restorer) - RunFunctionHandler(&exits, 0, NULL, restorer, 0); + RunFunctionHandler(emu, &exits, 0, NULL, restorer, 0); relockMutex(Locks); } +void my_sigactionhandler_oldcode(x64emu_t* emu, int32_t sig, int simple, siginfo_t* info, void * ucntx, int* old_code, void* cur_db, uintptr_t x64pc) +{ + #define GO(A) uintptr_t old_##A = R_##A; + GO(RAX); + GO(RBX); + GO(RCX); + GO(RDX); + GO(RBP); + GO(RSP); + GO(RDI); + GO(RSI); + GO(R8); + GO(R9); + GO(R10); + GO(R11); + GO(R12); + GO(R13); + GO(R14); + GO(R15); + GO(RIP); + #undef GO + x64flags_t old_eflags; + deferred_flags_t old_df; + multiuint_t old_op1; + multiuint_t old_op2; + multiuint_t old_res; + sse_regs_t old_xmm[16]; + sse_regs_t old_ymm[16]; + mmx87_regs_t old_mmx[8]; + mmx87_regs_t old_x87[8]; + uint32_t old_top = emu->top; + uint16_t old_segs[6]; + uintptr_t old_segs_offs[6]; + memcpy(old_xmm, emu->xmm, sizeof(old_xmm)); + memcpy(old_ymm, emu->ymm, sizeof(old_ymm)); + memcpy(old_mmx, emu->mmx, sizeof(old_mmx)); + memcpy(old_x87, emu->x87, sizeof(old_x87)); + memcpy(old_segs, emu->segs, sizeof(old_segs)); + memcpy(old_segs_offs, emu->segs_offs, sizeof(old_segs_offs)); + #define GO(A) old_##A = emu->A + GO(eflags); + GO(df); + GO(op1); + GO(op2); + GO(res); + #undef GO + #ifdef DYNAREC + dynablock_t* db = cur_db; + if(db && ucntx) { + void * pc =(void*)CONTEXT_PC((ucontext_t*)ucntx); + copyUCTXreg2Emu(emu, ucntx, x64pc); + adjustregs(emu, pc); + if(db && db->arch_size) + ARCH_ADJUST(db, emu, ucntx, x64pc); + } + #endif + #ifdef BOX32 + if(box64_is32bits) { + my_sigactionhandler_oldcode_32(emu, sig, simple, info, ucntx, old_code, cur_db); + } else + #endif + my_sigactionhandler_oldcode_64(emu, sig, simple, info, ucntx, old_code, cur_db); + #define GO(A) R_##A = old_##A + GO(RAX); + GO(RBX); + GO(RCX); + GO(RDX); + GO(RBP); + GO(RSP); + GO(RDI); + GO(RSI); + GO(R8); + GO(R9); + GO(R10); + GO(R11); + GO(R12); + GO(R13); + GO(R14); + GO(R15); + GO(RIP); + #undef GO + #define GO(A) emu->A = old_##A + GO(eflags); + GO(df); + GO(op1); + GO(op2); + GO(res); + #undef GO + memcpy(emu->xmm, old_xmm, sizeof(old_xmm)); + memcpy(emu->ymm, old_ymm, sizeof(old_ymm)); + memcpy(emu->mmx, old_mmx, sizeof(old_mmx)); + memcpy(emu->x87, old_x87, sizeof(old_x87)); + memcpy(emu->segs, old_segs, sizeof(old_segs)); + memcpy(emu->segs_offs, old_segs_offs, sizeof(old_segs_offs)); + emu->top = old_top; +} + extern void* current_helper; #define USE_SIGNAL_MUTEX #ifdef USE_SIGNAL_MUTEX @@ -1339,20 +1441,18 @@ extern int box64_exit_code; void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx) { - // sig==SIGSEGV || sig==SIGBUS || sig==SIGILL || sig==SIGABRT here! - int log_minimum = (box64_showsegv)?LOG_NONE:((sig==SIGSEGV && my_context->is_sigaction[sig])?LOG_DEBUG:LOG_INFO); + sig = signal_to_x64(sig); + // sig==X64_SIGSEGV || sig==X64_SIGBUS || sig==X64_SIGILL || sig==X64_SIGABRT here! + int log_minimum = (BOX64ENV(showsegv))?LOG_NONE:((((sig==X64_SIGSEGV) || (sig==X64_SIGILL)) && my_context->is_sigaction[sig])?LOG_DEBUG:LOG_INFO); if(signal_jmpbuf_active) { signal_jmpbuf_active = 0; longjmp(SIG_JMPBUF, 1); } - if((sig==SIGSEGV || sig==SIGBUS) && box64_quit) { - printf_log(LOG_INFO, "Sigfault/Segbus while quitting, exiting silently\n"); - _exit(box64_exit_code); // Hack, segfault while quiting, exit silently - } ucontext_t *p = (ucontext_t *)ucntx; void* addr = (void*)info->si_addr; // address that triggered the issue void* rsp = NULL; x64emu_t* emu = thread_get_emu(); + int tid = GetTID(); #ifdef __aarch64__ void * pc = (void*)p->uc_mcontext.pc; struct fpsimd_context *fpsimd = NULL; @@ -1386,100 +1486,174 @@ void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx) void* fpsimd = NULL; #warning Unhandled architecture #endif - if((sig==SIGBUS) && (addr!=pc) && sigbus_specialcases(info, ucntx, pc, fpsimd)) { - // special case fixed, restore everything and just continues - if(box64_log>=LOG_DEBUG || box64_showsegv) { - static void* old_pc[2] = {0}; - static int old_pc_i = 0; - if(old_pc[0]!=pc && old_pc[1]!=pc) { - old_pc[old_pc_i++] = pc; - if(old_pc_i==2) - old_pc_i = 0; - printf_log(LOG_INFO, "Special unalinged cased fixed @%p, opcode=%08x (addr=%p)\n", pc, *(uint32_t*)pc, addr); + dynablock_t* db = NULL; + int db_searched = 0; + uintptr_t x64pc = (uintptr_t)-1; + x64pc = R_RIP; + if(((sig==X64_SIGBUS) && ((addr!=pc) || ((sig==X64_SIGSEGV) && emu->segs[_CS]==0x23 && ((uintptr_t)addr>>32)==0xffffffff))) +#ifdef RV64 + || ((sig==X64_SIGSEGV) && (addr==pc) && (info->si_code==2) && (!checkMutex(is_memprot_locked) && getProtection_fast((uintptr_t)addr)==(PROT_READ|PROT_WRITE|PROT_EXEC))) +#endif + ) + { + db = FindDynablockFromNativeAddress(pc); + if(db) + x64pc = getX64Address(db, (uintptr_t)pc); + db_searched = 1; + int fixed = 0; + if((fixed=sigbus_specialcases(info, ucntx, pc, fpsimd, db, x64pc, emu->segs[_CS]==0x23))) { + // special case fixed, restore everything and just continues + if (BOX64ENV(log)>=LOG_DEBUG || BOX64ENV(showsegv)) { + static void* old_pc[2] = {0}; + static int old_pc_i = 0; + if(old_pc[0]!=pc && old_pc[1]!=pc) { + old_pc[old_pc_i++] = pc; + if(old_pc_i==2) + old_pc_i = 0; + uint8_t* x64 = (uint8_t*)x64pc; + if(db) + printf_log(LOG_INFO, "Special unaligned case fixed @%p, opcode=%08x (addr=%p, db=%p, x64pc=%p[%02hhX %02hhX %02hhX %02hhX %02hhX])\n", pc, *(uint32_t*)pc, addr, db, x64pc, x64[0], x64[1], x64[2], x64[3], x64[4], x64[5]); + else + printf_log(LOG_INFO, "Special unaligned case fixed @%p, opcode=%08x (addr=%p)\n", pc, *(uint32_t*)pc, addr); + } } + return; } - return; } + #ifdef ARCH_NOP + if(sig==X64_SIGILL) { + if(!db_searched) { + db = FindDynablockFromNativeAddress(pc); + if(db) + x64pc = getX64Address(db, (uintptr_t)pc); // this will be incorect in the case of the callret! + db_searched = 1; + } + if(db && db->callret_size) { + int is_callrets = 0; + int type_callret = 0; + for(int i=0; icallret_size && !is_callrets; ++i) + if(pc==(db->block+db->callrets[i].offs)) { + is_callrets = 1; + type_callret = db->callrets[i].type; + } + if(is_callrets) { + if(!type_callret) { + // adjust x64pc for "ret" type + x64pc = CONTEXT_REG(p, xRIP); + } + // check if block is still valid + int is_hotpage = checkInHotPage(x64pc); + uint32_t hash = (db->gone || is_hotpage)?0:X31_hash_code(db->x64_addr, db->x64_size); + if(!db->gone && !is_hotpage && hash==db->hash) { + dynarec_log(LOG_INFO, "Dynablock (%p, x64addr=%p, always_test=%d) is clean, %s continuing at %p (%p)!\n", db, db->x64_addr, db->always_test, type_callret?"self-loop":"ret from callret", (void*)x64pc, (void*)addr); + // it's good! go next opcode + CONTEXT_PC(p)+=4; + if(db->always_test) + protectDB((uintptr_t)db->x64_addr, 1); + else { + if(db->callret_size) { + // mark all callrets to NOP + for(int i=0; icallret_size; ++i) + *(uint32_t*)(db->block+db->callrets[i].offs) = ARCH_NOP; + ClearCache(db->block, db->size); + } + protectDBJumpTable((uintptr_t)db->x64_addr, db->x64_size, db->block, db->jmpnext); + for(int i=0; isep_size; ++i) { + uint32_t x64_offs = db->sep[i].x64_offs; + uint32_t nat_offs = db->sep[i].nat_offs; + if(addJumpTableIfDefault64(db->x64_addr+x64_offs, (db->always_test)?db->jmpnext:(db->block+nat_offs))) + db->sep[i].active = 1; + else + db->sep[i].active = 0; + } + } + return; + } else { + // dynablock got dirty! need to get out of it!!! + if(emu->jmpbuf) { + copyUCTXreg2Emu(emu, p, x64pc); + // only copy as it's a return address, so there is just the "epilog" to mimic here on "ret" type. "loop" type need everything + if(type_callret) { + adjustregs(emu, pc); + if(db && db->arch_size) + ARCH_ADJUST(db, emu, p, x64pc); + } + dynarec_log(LOG_INFO, "Dynablock (%p, x64addr=%p) %s, getting out at %s %p (%p)!\n", db, db->x64_addr, is_hotpage?"in HotPage":"dirty", getAddrFunctionName(R_RIP), (void*)R_RIP, type_callret?"self-loop":"ret from callret", (void*)addr); + emu->test.clean = 0; + // use "3" to regen a dynablock at current pc (else it will first do an interp run) + dynablock_leave_runtime(db); + #ifdef ANDROID + siglongjmp(*(JUMPBUFF*)emu->jmpbuf, 3); + #else + siglongjmp(emu->jmpbuf, 3); + #endif + } + dynarec_log(LOG_INFO, "Warning, Dirty %s (%p for db %p/%p) detected, but jmpbuffer not ready!\n", type_callret?"self-loop":"ret from callret", (void*)addr, db, (void*)db->x64_addr); + } + } + } + } + #endif int Locks = unlockMutex(); uint32_t prot = getProtection((uintptr_t)addr); #ifdef BAD_SIGNAL // try to see if the si_code makes sense // the RK3588 tend to need a special Kernel that seems to have a weird behaviour sometimes - if((sig==SIGSEGV) && (addr) && (info->si_code == 1) && prot&(PROT_READ|PROT_WRITE|PROT_EXEC)) { + if((sig==X64_SIGSEGV) && (addr) && (info->si_code == 1) && getMmapped((uintptr_t)addr)) { printf_log(LOG_DEBUG, "Workaround for suspicious si_code for %p / prot=0x%hhx\n", addr, prot); info->si_code = 2; } #endif #ifdef DYNAREC - if((Locks & is_dyndump_locked) && ((sig==SIGSEGV) || (sig==SIGBUS)) && current_helper) { - printf_log(LOG_INFO, "FillBlock triggered a %s at %p from %p\n", (sig==SIGSEGV)?"segfault":"bus error", addr, pc); + if((Locks & is_dyndump_locked) && ((sig==X64_SIGSEGV) || (sig==X64_SIGBUS)) && current_helper) { + printf_log(LOG_INFO, "FillBlock triggered a %s at %p from %p\n", (sig==X64_SIGSEGV)?"segfault":"bus error", addr, pc); CancelBlock64(0); relockMutex(Locks); cancelFillBlock(); // Segfault inside a Fillblock, cancel it's creation... // cancelFillBlock does not return } - dynablock_t* db = NULL; - int db_searched = 0; - if ((sig==SIGSEGV) && (addr) && (info->si_code == SEGV_ACCERR) && (prot&PROT_DYNAREC)) { + if ((sig==X64_SIGSEGV) && (addr) && (info->si_code == SEGV_ACCERR) && (prot&PROT_DYNAREC)) { lock_signal(); // check if SMC inside block - db = FindDynablockFromNativeAddress(pc); - db_searched = 1; - static uintptr_t repeated_page = 0; - dynarec_log(LOG_DEBUG, "SIGSEGV with Access error on %p for %p , db=%p(%p), prot=0x%hhx (old page=%p)\n", pc, addr, db, db?((void*)db->x64_addr):NULL, prot, (void*)repeated_page); - static int repeated_count = 0; - if(repeated_page == ((uintptr_t)addr&~(box64_pagesize-1))) { - ++repeated_count; // Access eoor multiple time on same page, disable dynarec on this page a few time... - dynarec_log(LOG_DEBUG, "Detecting a Hotpage at %p (%d)\n", (void*)repeated_page, repeated_count); - SetHotPage(repeated_page); - } else { - repeated_page = (uintptr_t)addr&~(box64_pagesize-1); - repeated_count = 0; + if(!db_searched) { + db = FindDynablockFromNativeAddress(pc); + if(db) + x64pc = getX64Address(db, (uintptr_t)pc); + db_searched = 1; } // access error, unprotect the block (and mark them dirty) unprotectDB((uintptr_t)addr, 1, 1); // unprotect 1 byte... But then, the whole page will be unprotected - int db_need_test = db?getNeedTest((uintptr_t)db->x64_addr):0; + CheckHotPage((uintptr_t)addr, prot); + int db_need_test = (db && !BOX64ENV(dynarec_dirty))?getNeedTest((uintptr_t)db->x64_addr):0; if(db && ((addr>=db->x64_addr && addr<(db->x64_addr+db->x64_size)) || db_need_test)) { emu = getEmuSignal(emu, p, db); // dynablock got auto-dirty! need to get out of it!!! if(emu->jmpbuf) { - copyUCTXreg2Emu(emu, p, getX64Address(db, (uintptr_t)pc)); - adjustregs(emu); -#ifdef ARM64 - //TODO: Need proper SIMD/x87 register traking! - /*if(fpsimd) { - emu->xmm[0].u128 = fpsimd->vregs[0]; - emu->xmm[1].u128 = fpsimd->vregs[1]; - emu->xmm[2].u128 = fpsimd->vregs[2]; - emu->xmm[3].u128 = fpsimd->vregs[3]; - }*/ -#elif defined(LA64) - /*if(fpsimd) { - emu->xmm[0].u128 = fpsimd->vregs[0]; - emu->xmm[1].u128 = fpsimd->vregs[1]; - emu->xmm[2].u128 = fpsimd->vregs[2]; - emu->xmm[3].u128 = fpsimd->vregs[3]; - }*/ -#elif defined(RV64) - /*if(fpsimd) { - emu->xmm[0].u128 = fpsimd->vregs[0]; - emu->xmm[1].u128 = fpsimd->vregs[1]; - emu->xmm[2].u128 = fpsimd->vregs[2]; - emu->xmm[3].u128 = fpsimd->vregs[3]; - }*/ -#else -#error Unsupported architecture -#endif - if(addr>=db->x64_addr && addr<(db->x64_addr+db->x64_size)) { - dynarec_log(LOG_INFO, "Auto-SMC detected, getting out of current Dynablock (%p, x64addr=%p, need_test=%d/%d/%d)!\n", db, db->x64_addr, db_need_test, db->dirty, db->always_test); - } else { - dynarec_log(LOG_INFO, "Dynablock (%p, x64addr=%p, need_test=%d/%d/%d) unprotected, getting out at %p (%p)!\n", db, db->x64_addr, db_need_test, db->dirty, db->always_test, (void*)R_RIP, (void*)addr); + uintptr_t x64pc = getX64Address(db, (uintptr_t)pc); + copyUCTXreg2Emu(emu, p, x64pc); + adjustregs(emu, pc); + if(db && db->arch_size) + ARCH_ADJUST(db, emu, p, x64pc); + int autosmc = (addr>=db->x64_addr && addr<(db->x64_addr+db->x64_size)); + if(autosmc && BOX64ENV(dynarec_dirty)) { + // check if current block should be cut there + int inst = getX64AddressInst(db, (uintptr_t)pc); + // is it the last instruction + uintptr_t next = getX64InstAddress(db, inst+1); + if(next!=(uintptr_t)-1LL) { + // there is a next, so lets mark the address and dirty the block + mark_db_autosmc(db, x64pc); + } + } + dynarec_log(LOG_INFO, "Dynablock (%p, x64addr=%p, need_test=%d/%d/%d) %s, getting out at %p (%p)!\n", db, db->x64_addr, db_need_test, db->dirty, db->always_test, autosmc?"Auto-SMC":"unprotected", (void*)R_RIP, (void*)addr); //relockMutex(Locks); unlock_signal(); if(Locks & is_dyndump_locked) CancelBlock64(1); emu->test.clean = 0; + // will restore unblocked Signal flags too + dynablock_leave_runtime(db); #ifdef ANDROID siglongjmp(*(JUMPBUFF*)emu->jmpbuf, 2); #else @@ -1490,21 +1664,34 @@ void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx) } // done if((prot&PROT_WRITE)/*|| (prot&PROT_DYNAREC)*/) { - unlock_signal(); + if(BOX64ENV(dynarec_log)) { + char tmp[128] = {0}; + zydis_dec_t* dec = emu->segs[_CS] == 0x23 ? my_context->dec32 : my_context->dec; + if (dec) + snprintf(tmp, 127, " %sopcode=%s; native opcode=%08x", (emu->segs[_CS] == 0x23) ? "x86" : "x64", DecodeX64Trace(dec, x64pc, 1), *(uint32_t*)pc); + else + snprintf(tmp, 127, " %sopcode=%02X %02X %02X %02X %02X %02X %02X %02X (opcode=%08x)", (emu->segs[_CS] == 0x23) ? "x86" : "x64", ((uint8_t*)x64pc)[0], ((uint8_t*)x64pc)[1], ((uint8_t*)x64pc)[2], ((uint8_t*)x64pc)[3], ((uint8_t*)x64pc)[4], ((uint8_t*)x64pc)[5], ((uint8_t*)x64pc)[6], ((uint8_t*)x64pc)[7], *(uint32_t*)pc); + dynarec_log(LOG_INFO, "Writting from %04d|%p(%s, native=%s) to %p using %s\n", GetTID(), (void*)x64pc, getAddrFunctionName(x64pc), db?"Dynablock":GetNativeName(pc),(void*)addr, tmp); + } // if there is no write permission, don't return and continue to program signal handling + unlock_signal(); relockMutex(Locks); return; } unlock_signal(); - } else if ((sig==SIGSEGV) && (addr) && (info->si_code == SEGV_ACCERR) && ((prot&(PROT_READ|PROT_WRITE))==(PROT_READ|PROT_WRITE))) { + } else if ((sig==X64_SIGSEGV) && (addr) && (info->si_code == SEGV_ACCERR) && ((prot&(PROT_READ|PROT_WRITE))==(PROT_READ|PROT_WRITE))) { lock_signal(); - db = FindDynablockFromNativeAddress(pc); - db_searched = 1; + if(!db_searched) { + db = FindDynablockFromNativeAddress(pc); + if(db) + x64pc = getX64Address(db, (uintptr_t)pc); + db_searched = 1; + } if(db && db->x64_addr>= addr && (db->x64_addr+db->x64_size)si_code == SEGV_ACCERR) && (prot&PROT_DYNAREC_R)) { + } else if ((sig==X64_SIGSEGV) && (addr) && (info->si_code == SEGV_ACCERR) && (prot&PROT_DYNAREC_R)) { // unprotect and continue to signal handler, because Write is not there on purpose unprotectDB((uintptr_t)addr, 1, 1); // unprotect 1 byte... But then, the whole page will be unprotected } - if(!db_searched) + if(!db_searched) { db = FindDynablockFromNativeAddress(pc); -#else - void* db = NULL; + if(db) + x64pc = getX64Address(db, (uintptr_t)pc); + db_searched = 1; + } #endif + if((sig==X64_SIGSEGV || sig==X64_SIGBUS) && box64_quit) { + printf_log(LOG_INFO, "Sigfault/Segbus while quitting, exiting silently\n"); + _exit(box64_exit_code); // Hack, segfault while quiting, exit silently + } static int old_code = -1; static void* old_pc = 0; static void* old_addr = 0; static int old_tid = 0; static uint32_t old_prot = 0; - int tid = GetTID(); - int mapped = getMmapped((uintptr_t)addr); - const char* signame = (sig==SIGSEGV)?"SIGSEGV":((sig==SIGBUS)?"SIGBUS":((sig==SIGILL)?"SIGILL":"SIGABRT")); + int mapped = memExist((uintptr_t)addr); + const char* signame = (sig==X64_SIGSEGV)?"SIGSEGV":((sig==X64_SIGBUS)?"SIGBUS":((sig==X64_SIGILL)?"SIGILL":"SIGABRT")); + rsp = (void*)R_RSP; +#if defined(DYNAREC) + if(db && CONTEXT_REG(p, xEmu)>0x10000) { + emu = (x64emu_t*)CONTEXT_REG(p, xEmu); + } + if(db) { + rsp = (void*)CONTEXT_REG(p, xRSP); + } +#endif //DYNAREC + if(!db && (sig==X64_SIGSEGV) && ((uintptr_t)addr==(x64pc-1))) + x64pc--; if(old_code==info->si_code && old_pc==pc && old_addr==addr && old_tid==tid && old_prot==prot) { - printf_log(log_minimum, "%04d|Double %s (code=%d, pc=%p, addr=%p, prot=%02x)!\n", tid, signame, old_code, old_pc, old_addr, prot); + printf_log(log_minimum, "%04d|Double %s (code=%d, pc=%p, x64pc=%p, addr=%p, prot=%02x)!\n", tid, signame, old_code, old_pc, x64pc, old_addr, prot); exit(-1); } else { - if((sig==SIGSEGV) && (info->si_code == SEGV_ACCERR) && ((prot&~PROT_CUSTOM)==(PROT_READ|PROT_WRITE) || (prot&~PROT_CUSTOM)==(PROT_READ|PROT_WRITE|PROT_EXEC))) { + if((sig==X64_SIGSEGV) && (info->si_code == SEGV_ACCERR) && ((prot&~PROT_CUSTOM)==(PROT_READ|PROT_WRITE) || (prot&~PROT_CUSTOM)==(PROT_READ|PROT_WRITE|PROT_EXEC))) { static uintptr_t old_addr = 0; #ifdef DYNAREC - if((prot==(PROT_READ|PROT_WRITE|PROT_EXEC)) && isDBFromAddressRange(((uintptr_t)addr)&~(box64_pagesize-1), box64_pagesize)) { - printf_log(/*LOG_DEBUG*/LOG_INFO, "%04d| Strange SIGSEGV with Access error on %p for %p with DynaBlock(s) in range, db=%p, Lock=0x%x)\n", tid, pc, addr, db, Locks); - cleanDBFromAddressRange(((uintptr_t)addr)&~(box64_pagesize-1), box64_pagesize, 0); - refreshProtection((uintptr_t)addr); - relockMutex(Locks); - return; - } + if(prot==(PROT_READ|PROT_WRITE|PROT_EXEC)) + if(cleanDBFromAddressRange(((uintptr_t)addr)&~(box64_pagesize-1), box64_pagesize, 0)) { + printf_log(/*LOG_DEBUG*/LOG_INFO, "%04d| Strange SIGSEGV with Access error on %p for %p with DynaBlock(s) in range, db=%p, Lock=0x%x)\n", tid, pc, addr, db, Locks); + refreshProtection((uintptr_t)addr); + relockMutex(Locks); + return; + } #endif printf_log(/*LOG_DEBUG*/LOG_INFO, "%04d| Strange SIGSEGV with Access error on %p for %p%s, db=%p, prot=0x%x (old_addr=%p, Lock=0x%x)\n", tid, pc, addr, mapped?" mapped":"", db, prot, (void*)old_addr, Locks); if(!(old_addr==(uintptr_t)addr && old_prot==prot) || mapped) { @@ -1595,55 +1801,33 @@ dynarec_log(/*LOG_DEBUG*/LOG_INFO, "Repeated SIGSEGV with Access error on %p for old_addr = addr; old_tid = tid; old_prot = prot; - const char* name = (log_minimum<=box64_log)?GetNativeName(pc):NULL; - uintptr_t x64pc = (uintptr_t)-1; + const char* name = NULL; const char* x64name = NULL; - const char* elfname = NULL; - // Adjust RIP for special case of NULL function run - if(sig==SIGSEGV && R_RIP==0x1 && (uintptr_t)info->si_addr==0x0) - R_RIP = 0x0; - x64pc = R_RIP; - rsp = (void*)R_RSP; -#if defined(DYNAREC) -#if defined(ARM64) - if(db) { - x64pc = getX64Address(db, (uintptr_t)pc); - rsp = (void*)p->uc_mcontext.regs[10+_SP]; - } -#elif defined(LA64) - if(db && p->uc_mcontext.__gregs[4]>0x10000) { - emu = (x64emu_t*)p->uc_mcontext.__gregs[4]; - } - if(db) { - x64pc = getX64Address(db, (uintptr_t)pc); - rsp = (void*)p->uc_mcontext.__gregs[12+_SP]; - } -#elif defined(RV64) - if(db && p->uc_mcontext.__gregs[10]>0x10000) { - emu = (x64emu_t*)p->uc_mcontext.__gregs[10]; - } - if(db) { - x64pc = getX64Address(db, (uintptr_t)pc); - rsp = (void*)p->uc_mcontext.__gregs[16+_SP]; - } -#else -#error Unsupported Architecture -#endif //arch -#endif //DYNAREC - if(!db && (sig==SIGSEGV) && ((uintptr_t)addr==(x64pc-1))) - x64pc--; - if(log_minimum<=box64_log) { + if (log_minimum<=BOX64ENV(log)) { signal_jmpbuf_active = 1; if(sigsetjmp(SIG_JMPBUF, 1)) { // segfault while gathering function name... + name = "???"; } else - x64name = getAddrFunctionName(x64pc); + name = GetNativeName(pc); signal_jmpbuf_active = 0; + } + // Adjust RIP for special case of NULL function run + if(sig==X64_SIGSEGV && R_RIP==0x1 && (uintptr_t)info->si_addr==0x0) + R_RIP = 0x0; + if(log_minimum<=BOX64ENV(log)) { elfheader_t* elf = FindElfAddress(my_context, x64pc); - if(elf) - elfname = ElfName(elf); + { + signal_jmpbuf_active = 1; + if(sigsetjmp(SIG_JMPBUF, 1)) { + // segfault while gathering function name... + x64name = "?"; + } else + x64name = getAddrFunctionName(x64pc); + signal_jmpbuf_active = 0; + } } - if(jit_gdb) { + if(BOX64ENV(jitgdb)) { pid_t pid = getpid(); int v = vfork(); // is this ok in a signal handler??? if(v<0) { @@ -1651,7 +1835,7 @@ dynarec_log(/*LOG_DEBUG*/LOG_INFO, "Repeated SIGSEGV with Access error on %p for } else if(v) { // parent process, the one that have the segfault volatile int waiting = 1; - printf("Waiting for %s (pid %d)...\n", (jit_gdb==2)?"gdbserver":"gdb", pid); + printf("Waiting for %s (pid %d)...\n", (BOX64ENV(jitgdb)==2)?"gdbserver":"gdb", pid); while(waiting) { // using gdb, use "set waiting=0" to stop waiting... usleep(1000); @@ -1659,34 +1843,26 @@ dynarec_log(/*LOG_DEBUG*/LOG_INFO, "Repeated SIGSEGV with Access error on %p for } else { char myarg[50] = {0}; sprintf(myarg, "%d", pid); - if(jit_gdb==2) + if(BOX64ENV(jitgdb)==2) execlp("gdbserver", "gdbserver", "127.0.0.1:1234", "--attach", myarg, (char*)NULL); - else if(jit_gdb==3) + else if(BOX64ENV(jitgdb)==3) execlp("lldb", "lldb", "-p", myarg, (char*)NULL); else execlp("gdb", "gdb", "-pid", myarg, (char*)NULL); exit(-1); } } - print_cycle_log(log_minimum); + print_rolling_log(log_minimum); - if((box64_showbt || sig==SIGABRT) && log_minimum<=box64_log) { + if((BOX64ENV(showbt) || sig==X64_SIGABRT) && log_minimum<=BOX64ENV(log)) { // show native bt - #define BT_BUF_SIZE 100 + ShowNativeBT(log_minimum); + +#define BT_BUF_SIZE 100 int nptrs; void *buffer[BT_BUF_SIZE]; char **strings; -#ifndef ANDROID - nptrs = backtrace(buffer, BT_BUF_SIZE); - strings = backtrace_symbols(buffer, nptrs); - if(strings) { - for (int j = 0; j < nptrs; j++) - printf_log(log_minimum, "NativeBT: %s\n", strings[j]); - free(strings); - } else - printf_log(log_minimum, "NativeBT: none (%d/%s)\n", errno, strerror(errno)); -#endif extern int my_backtrace_ip(x64emu_t* emu, void** buffer, int size); // in wrappedlibc extern char** my_backtrace_symbols(x64emu_t* emu, uintptr_t* buffer, int size); // save and set real RIP/RSP @@ -1742,196 +1918,121 @@ dynarec_log(/*LOG_DEBUG*/LOG_INFO, "Repeated SIGSEGV with Access error on %p for #undef GO } - if(log_minimum<=box64_log) { + if(log_minimum<=BOX64ENV(log)) { static const char* reg_name[] = {"RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI", " R8", " R9","R10","R11", "R12","R13","R14","R15"}; static const char* seg_name[] = {"ES", "CS", "SS", "DS", "FS", "GS"}; int shown_regs = 0; #ifdef DYNAREC + #ifdef GDBJIT + if(db && BOX64ENV(dynarec_gdbjit) == 3) GdbJITBlockReady(db->gdbjit_block); + #endif uint32_t hash = 0; if(db) hash = X31_hash_code(db->x64_addr, db->x64_size); - printf_log(log_minimum, "%04d|%s @%p (%s) (x64pc=%p/%s:\"%s\", rsp=%p, stack=%p:%p own=%p fp=%p), for accessing %p (code=%d/prot=%x), db=%p(%p:%p/%p:%p/%s:%s, hash:%x/%x) handler=%p", - GetTID(), signame, pc, name, (void*)x64pc, elfname?:"???", x64name?:"???", rsp, + printf_log(log_minimum, "%04d|%s @%p (%s) (x64pc=%p/\"%s\", rsp=%p, stack=%p:%p own=%p fp=%p), for accessing %p (code=%d/prot=%x), db=%p(%p:%p/%p:%p/%s:%s, hash:%x/%x) handler=%p", + GetTID(), signame, pc, name, (void*)x64pc, x64name?:"???", rsp, emu->init_stack, emu->init_stack+emu->size_stack, emu->stack2free, (void*)R_RBP, addr, info->si_code, prot, db, db?db->block:0, db?(db->block+db->size):0, db?db->x64_addr:0, db?(db->x64_addr+db->x64_size):0, getAddrFunctionName((uintptr_t)(db?db->x64_addr:0)), - (db?getNeedTest((uintptr_t)db->x64_addr):0)?"need_stest":"clean", db?db->hash:0, hash, + (db && (db->hash!=hash))?"dirty":((db?getNeedTest((uintptr_t)db->x64_addr):0)?"needs_test":"clean"), db?db->hash:0, hash, (void*)my_context->signals[sig]); -#if defined(ARM64) - if(db) { - shown_regs = 1; - for (int i=0; i<16; ++i) { - if(!(i%4)) printf_log(log_minimum, "\n"); - printf_log(log_minimum, "%s:0x%016llx ", reg_name[i], p->uc_mcontext.regs[10+i]); - } - printf_log(log_minimum, "\n"); - for (int i=0; i<6; ++i) - printf_log(log_minimum, "%s:0x%04x ", seg_name[i], emu->segs[i]); - } - if(rsp!=addr && getProtection((uintptr_t)rsp-4*8) && getProtection((uintptr_t)rsp+4*8)) - for (int i=-4; i<4; ++i) { - printf_log(log_minimum, "%sRSP%c0x%02x:0x%016lx", (i%4)?" ":"\n", i<0?'-':'+', abs(i)*8, *(uintptr_t*)(rsp+i*8)); - } -#elif defined(RV64) - if(db) { - shown_regs = 1; - for (int i=0; i<16; ++i) { - if(!(i%4)) printf_log(log_minimum, "\n"); - printf_log(log_minimum, "%s:0x%016llx ", reg_name[i], p->uc_mcontext.__gregs[16+i]); - } - printf_log(log_minimum, "\n"); - for (int i=0; i<6; ++i) - printf_log(log_minimum, "%s:0x%04x ", seg_name[i], emu->segs[i]); - } - if(rsp!=addr && getProtection((uintptr_t)rsp-4*8) && getProtection((uintptr_t)rsp+4*8)) - for (int i=-4; i<4; ++i) { - printf_log(log_minimum, "%sRSP%c0x%02x:0x%016lx", (i%4)?" ":"\n", i<0?'-':'+', abs(i)*8, *(uintptr_t*)(rsp+i*8)); - } -#elif defined(LA64) - if(db) { - shown_regs = 1; - for (int i=0; i<16; ++i) { - if(!(i%4)) printf_log(log_minimum, "\n"); - printf_log(log_minimum, "%s:0x%016llx ", reg_name[i], p->uc_mcontext.__gregs[12+i]); - } - printf_log(log_minimum, "\n"); - for (int i=0; i<6; ++i) - printf_log(log_minimum, "%s:0x%04x ", seg_name[i], emu->segs[i]); - } - if(rsp!=addr && getProtection((uintptr_t)rsp-4*8) && getProtection((uintptr_t)rsp+4*8)) - for (int i=-4; i<4; ++i) { - printf_log(log_minimum, "%sRSP%c0x%02x:0x%016lx", (i%4)?" ":"\n", i<0?'-':'+', abs(i)*8, *(uintptr_t*)(rsp+i*8)); + if(db) { + shown_regs = 1; + for (int i=0; i<16; ++i) { + if(!(i%4)) printf_log_prefix(0, log_minimum, "\n"); + printf_log_prefix(0, log_minimum, "%s:0x%016llx ", reg_name[i], CONTEXT_REG(p, TO_NAT(i))); + } + printf_log_prefix(0, log_minimum, "\n"); + for (int i=0; i<6; ++i) + printf_log_prefix(0, log_minimum, "%s:0x%04x ", seg_name[i], emu->segs[i]); + printf_log_prefix(0, log_minimum, "FSBASE=%p ", emu->segs_offs[_FS]); + printf_log_prefix(0, log_minimum, "GSBASE=%p", emu->segs_offs[_GS]); } + if(rsp!=addr && getProtection((uintptr_t)rsp-4*8) && getProtection((uintptr_t)rsp+4*8)) + for (int i=-4; i<4; ++i) { + printf_log_prefix(0, log_minimum, "%sRSP%c0x%02x:0x%016lx", (i%4)?" ":"\n", i<0?'-':'+', abs(i)*8, *(uintptr_t*)(rsp+i*8)); + } #else - #warning TODO -#endif -#else - printf_log(log_minimum, "%04d|%s @%p (%s) (x64pc=%p/%s:\"%s\", rsp=%p), for accessing %p (code=%d)", GetTID(), signame, pc, name, (void*)x64pc, elfname?:"???", x64name?:"???", rsp, addr, info->si_code); + printf_log(log_minimum, "%04d|%s @%p (%s) (x64pc=%p/\"%s\", rsp=%p), for accessing %p (code=%d)", GetTID(), signame, pc, name, (void*)x64pc, x64name?:"???", rsp, addr, info->si_code); #endif if(!shown_regs) { for (int i=0; i<16; ++i) { - if(!(i%4)) printf_log(log_minimum, "\n"); - printf_log(log_minimum, "%s:0x%016llx ", reg_name[i], emu->regs[i].q[0]); + if(!(i%4)) printf_log_prefix(0, log_minimum, "\n"); + printf_log_prefix(0, log_minimum, "%s:0x%016llx ", reg_name[i], emu->regs[i].q[0]); } - printf_log(log_minimum, "\n"); for (int i=0; i<6; ++i) - printf_log(log_minimum, "%s:0x%04x ", seg_name[i], emu->segs[i]); + printf_log_prefix(0, log_minimum, "%s:0x%04x ", seg_name[i], emu->segs[i]); + printf_log_prefix(0, log_minimum, "FSBASE=%p ", emu->segs_offs[_FS]); + printf_log_prefix(0, log_minimum, "GSBASE=%p", emu->segs_offs[_GS]); + printf_log_prefix(0, log_minimum, "\n"); } - if(sig==SIGILL) { - printf_log(log_minimum, " opcode=%02X %02X %02X %02X %02X %02X %02X %02X (%02X %02X %02X %02X %02X)\n", ((uint8_t*)pc)[0], ((uint8_t*)pc)[1], ((uint8_t*)pc)[2], ((uint8_t*)pc)[3], ((uint8_t*)pc)[4], ((uint8_t*)pc)[5], ((uint8_t*)pc)[6], ((uint8_t*)pc)[7], ((uint8_t*)x64pc)[0], ((uint8_t*)x64pc)[1], ((uint8_t*)x64pc)[2], ((uint8_t*)x64pc)[3], ((uint8_t*)x64pc)[4]); - } else if(sig==SIGBUS) { - printf_log(log_minimum, " x86opcode=%02X %02X %02X %02X %02X %02X %02X %02X (opcode=%08x)\n", ((uint8_t*)x64pc)[0], ((uint8_t*)x64pc)[1], ((uint8_t*)x64pc)[2], ((uint8_t*)x64pc)[3], ((uint8_t*)x64pc)[4], ((uint8_t*)x64pc)[5], ((uint8_t*)x64pc)[6], ((uint8_t*)x64pc)[7], *(uint32_t*)pc); + zydis_dec_t* dec = emu->segs[_CS] == 0x23 ? my_context->dec32 : my_context->dec; + if(sig==X64_SIGILL) { + printf_log_prefix(0, log_minimum, " opcode=%02X %02X %02X %02X %02X %02X %02X %02X ", ((uint8_t*)pc)[0], ((uint8_t*)pc)[1], ((uint8_t*)pc)[2], ((uint8_t*)pc)[3], ((uint8_t*)pc)[4], ((uint8_t*)pc)[5], ((uint8_t*)pc)[6], ((uint8_t*)pc)[7]); + if (dec) + printf_log_prefix(0, log_minimum, "(%s)\n", DecodeX64Trace(dec, x64pc, 1)); + else + printf_log_prefix(0, log_minimum, "(%02X %02X %02X %02X %02X)\n", ((uint8_t*)x64pc)[0], ((uint8_t*)x64pc)[1], ((uint8_t*)x64pc)[2], ((uint8_t*)x64pc)[3], ((uint8_t*)x64pc)[4]); + } else if(sig==X64_SIGBUS || (sig==X64_SIGSEGV && (x64pc!=(uintptr_t)addr) && (pc!=addr) && (getProtection_fast(x64pc)&PROT_READ) && (getProtection_fast((uintptr_t)pc)&PROT_READ))) { + if (dec) + printf_log_prefix(0, log_minimum, " %sopcode=%s; native opcode=%08x\n", (emu->segs[_CS] == 0x23) ? "x86" : "x64", DecodeX64Trace(dec, x64pc, 1), *(uint32_t*)pc); + else + printf_log_prefix(0, log_minimum, " %sopcode=%02X %02X %02X %02X %02X %02X %02X %02X (opcode=%08x)\n", (emu->segs[_CS] == 0x23) ? "x86" : "x64", ((uint8_t*)x64pc)[0], ((uint8_t*)x64pc)[1], ((uint8_t*)x64pc)[2], ((uint8_t*)x64pc)[3], ((uint8_t*)x64pc)[4], ((uint8_t*)x64pc)[5], ((uint8_t*)x64pc)[6], ((uint8_t*)x64pc)[7], *(uint32_t*)pc); } else { - printf_log(log_minimum, "\n"); + printf_log_prefix(0, log_minimum, "\n"); } } } relockMutex(Locks); if(my_context->signals[sig] && my_context->signals[sig]!=1) { - my_sigactionhandler_oldcode(sig, my_context->is_sigaction[sig]?0:1, info, ucntx, &old_code, db); + my_sigactionhandler_oldcode(emu, sig, my_context->is_sigaction[sig]?0:1, info, ucntx, &old_code, db, x64pc); return; } // no handler (or double identical segfault) // set default and that's it, instruction will restart and default segfault handler will be called... - if(my_context->signals[sig]!=1 || sig==SIGSEGV || sig==SIGILL || sig==SIGFPE || sig==SIGABRT) { - signal(sig, (void*)my_context->signals[sig]); + if(my_context->signals[sig]!=1 || sig==X64_SIGSEGV || sig==X64_SIGILL || sig==X64_SIGFPE || sig==X64_SIGABRT) { + signal(signal_from_x64(sig), (void*)my_context->signals[sig]); } } void my_sigactionhandler(int32_t sig, siginfo_t* info, void * ucntx) { + sig = signal_to_x64(sig); + void* pc = NULL; #ifdef DYNAREC ucontext_t *p = (ucontext_t *)ucntx; - #ifdef ARM64 - void * pc = (void*)p->uc_mcontext.pc; - #elif defined(LA64) - void * pc = (void*)p->uc_mcontext.__pc; - #elif defined(RV64) - void * pc = (void*)p->uc_mcontext.__gregs[0]; - #else - #error Unsupported architecture + pc = (void*)CONTEXT_PC(p); #endif dynablock_t* db = FindDynablockFromNativeAddress(pc); - #else - void* db = NULL; + x64emu_t* emu = thread_get_emu(); + uintptr_t x64pc = R_RIP; + if(db) + x64pc = getX64Address(db, (uintptr_t)pc); + #ifdef DYNAREC + if(db && !x64pc) { + printf_log(LOG_INFO, "Warning, ingnoring incoherent dynablock found for address %p (opcode=%x). db=%p(x64_addr=%p-%p, block:%p-%p)\n", pc, *(uint32_t*)pc, db, (void*)db->x64_addr, (void*)db->x64_addr+db->x64_size, db->actual_block, db->actual_block+db->size); + db = NULL; + x64pc = R_RIP; + } #endif - - my_sigactionhandler_oldcode(sig, 0, info, ucntx, NULL, db); -} - -#ifndef DYNAREC -#define box64_dynarec_dump 0 -#endif - -void emit_signal(x64emu_t* emu, int sig, void* addr, int code) -{ - siginfo_t info = {0}; - info.si_signo = sig; - info.si_errno = (sig==SIGSEGV)?0x1234:0; // Mark as a sign this is a #GP(0) (like privileged instruction) - info.si_code = code; - info.si_addr = addr; - const char* x64name = NULL; - const char* elfname = NULL; - if(box64_log>LOG_INFO || box64_dynarec_dump || box64_showsegv) { - x64name = getAddrFunctionName(R_RIP); - elfheader_t* elf = FindElfAddress(my_context, R_RIP); - if(elf) - elfname = ElfName(elf); - printf_log(LOG_NONE, "Emit Signal %d at IP=%p(%s / %s) / addr=%p, code=%d\n", sig, (void*)R_RIP, x64name?x64name:"???", elfname?elfname:"?", addr, code); - if(sig==SIGILL) { - uint8_t* mem = (uint8_t*)R_RIP; - printf_log(LOG_NONE, "SIGILL: Opcode at ip is %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx\n", mem[0], mem[1], mem[2], mem[3], mem[4], mem[5]); - } + if(BOX64ENV(showsegv) && (sig!=10 || BOX64ENV(log)>LOG_INFO)) { + printf_log(LOG_INFO, "%04d|sigaction handler for sig %d, pc=%p, x64pc=%p, db=%p%s", GetTID(), sig, pc, x64pc, db, db?"":"\n"); + #ifdef DYNAREC + if(db) + printf_log_prefix(0, LOG_INFO, "(x64_addr=%p-%p, block:%p-%p)\n", (void*)db->x64_addr, (void*)db->x64_addr+db->x64_size, db->actual_block, db->actual_block+db->size); + #endif } - my_sigactionhandler_oldcode(sig, 0, &info, NULL, NULL, NULL); -} - -void emit_interruption(x64emu_t* emu, int num, void* addr) -{ - siginfo_t info = {0}; - info.si_signo = SIGSEGV; - info.si_errno = 0xdead; - info.si_code = num; - info.si_addr = addr; - const char* x64name = NULL; - const char* elfname = NULL; - if(box64_log>LOG_INFO || box64_dynarec_dump || box64_showsegv) { - x64name = getAddrFunctionName(R_RIP); - elfheader_t* elf = FindElfAddress(my_context, R_RIP); - if(elf) - elfname = ElfName(elf); - printf_log(LOG_NONE, "Emit Interruption 0x%x at IP=%p(%s / %s) / addr=%p\n", num, (void*)R_RIP, x64name?x64name:"???", elfname?elfname:"?", addr); - } - my_sigactionhandler_oldcode(SIGSEGV, 0, &info, NULL, NULL, NULL); -} - -void emit_div0(x64emu_t* emu, void* addr, int code) -{ - siginfo_t info = {0}; - info.si_signo = SIGSEGV; - info.si_errno = 0xcafe; - info.si_code = code; - info.si_addr = addr; - const char* x64name = NULL; - const char* elfname = NULL; - if(box64_log>LOG_INFO || box64_dynarec_dump || box64_showsegv) { - x64name = getAddrFunctionName(R_RIP); - elfheader_t* elf = FindElfAddress(my_context, R_RIP); - if(elf) - elfname = ElfName(elf); - printf_log(LOG_NONE, "Emit Divide by 0 at IP=%p(%s / %s) / addr=%p\n", (void*)R_RIP, x64name?x64name:"???", elfname?elfname:"?", addr); - } - my_sigactionhandler_oldcode(SIGSEGV, 0, &info, NULL, NULL, NULL); + my_sigactionhandler_oldcode(emu, sig, 0, info, ucntx, NULL, db, x64pc); } - +#define MY_SIGHANDLER ((signum==X64_SIGSEGV || signum==X64_SIGBUS || signum==X64_SIGILL || signum==X64_SIGABRT)?my_box64signalhandler:my_sigactionhandler) EXPORT sighandler_t my_signal(x64emu_t* emu, int signum, sighandler_t handler) { if(signum<0 || signum>MAX_SIGNAL) return SIG_ERR; - if(signum==SIGSEGV && emu->context->no_sigsegv) + if(signum==X64_SIGSEGV && emu->context->no_sigsegv) return 0; // create a new handler @@ -1940,21 +2041,21 @@ EXPORT sighandler_t my_signal(x64emu_t* emu, int signum, sighandler_t handler) my_context->restorer[signum] = 0; my_context->onstack[signum] = 0; - if(signum==SIGSEGV || signum==SIGBUS || signum==SIGILL || signum==SIGABRT) + if(signum==X64_SIGSEGV || signum==X64_SIGBUS || signum==X64_SIGILL || signum==X64_SIGABRT) return 0; if(handler!=NULL && handler!=(sighandler_t)1) { struct sigaction newact = {0}; struct sigaction oldact = {0}; newact.sa_flags = 0x04; - newact.sa_sigaction = my_sigactionhandler; - sigaction(signum, &newact, &oldact); + newact.sa_sigaction = MY_SIGHANDLER; + sigaction(signal_from_x64(signum), &newact, &oldact); return oldact.sa_handler; } else - return signal(signum, handler); + return signal(signal_from_x64(signum), handler); } EXPORT sighandler_t my___sysv_signal(x64emu_t* emu, int signum, sighandler_t handler) __attribute__((alias("my_signal"))); -EXPORT sighandler_t my_sysv_signal(x64emu_t* emu, int signum, sighandler_t handler) __attribute__((alias("my_signal"))); // not completly exact +EXPORT sighandler_t my_sysv_signal(x64emu_t* emu, int signum, sighandler_t handler) __attribute__((alias("my_signal"))); // not completely exact int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x64_sigaction_t *oldact) { @@ -1964,10 +2065,10 @@ int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x return -1; } - if(signum==SIGSEGV && emu->context->no_sigsegv) + if(signum==X64_SIGSEGV && emu->context->no_sigsegv) return 0; - if(signum==SIGILL && emu->context->no_sigill) + if(signum==X64_SIGILL && emu->context->no_sigill) return 0; struct sigaction newact = {0}; struct sigaction old = {0}; @@ -1979,7 +2080,7 @@ int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x my_context->signals[signum] = (uintptr_t)act->_u._sa_sigaction; my_context->is_sigaction[signum] = 1; if(act->_u._sa_handler!=NULL && act->_u._sa_handler!=(sighandler_t)1) { - newact.sa_sigaction = my_sigactionhandler; + newact.sa_sigaction = MY_SIGHANDLER; } else newact.sa_sigaction = act->_u._sa_sigaction; } else { @@ -1987,7 +2088,7 @@ int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x my_context->is_sigaction[signum] = 0; if(act->_u._sa_handler!=NULL && act->_u._sa_handler!=(sighandler_t)1) { newact.sa_flags|=0x04; - newact.sa_sigaction = my_sigactionhandler; + newact.sa_sigaction = MY_SIGHANDLER; } else newact.sa_handler = act->_u._sa_handler; } @@ -1995,8 +2096,8 @@ int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x my_context->onstack[signum] = (act->sa_flags&SA_ONSTACK)?1:0; } int ret = 0; - if(signum!=SIGSEGV && signum!=SIGBUS && signum!=SIGILL && signum!=SIGABRT) - ret = sigaction(signum, act?&newact:NULL, oldact?&old:NULL); + if(signum!=X64_SIGSEGV && signum!=X64_SIGBUS && signum!=X64_SIGILL && signum!=X64_SIGABRT) + ret = sigaction(signal_from_x64(signum), act?&newact:NULL, oldact?&old:NULL); if(oldact) { oldact->sa_flags = old.sa_flags; oldact->sa_mask = old.sa_mask; @@ -2004,7 +2105,7 @@ int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x oldact->_u._sa_sigaction = old.sa_sigaction; //TODO should wrap... else oldact->_u._sa_handler = old.sa_handler; //TODO should wrap... - if((uintptr_t)oldact->_u._sa_sigaction == (uintptr_t)my_sigactionhandler && old_handler) + if((uintptr_t)oldact->_u._sa_sigaction == (uintptr_t)MY_SIGHANDLER && old_handler) oldact->_u._sa_sigaction = (void*)old_handler; oldact->sa_restorer = NULL; // no handling for now... } @@ -2021,7 +2122,7 @@ int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigactio return -1; } - if(signum==SIGSEGV && emu->context->no_sigsegv) + if(signum==X64_SIGSEGV && emu->context->no_sigsegv) return 0; // TODO, how to handle sigsetsize>4?! if(signum==32 || signum==33) { @@ -2036,7 +2137,7 @@ int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigactio my_context->signals[signum] = (uintptr_t)act->_u._sa_sigaction; my_context->is_sigaction[signum] = 1; if(act->_u._sa_handler!=NULL && act->_u._sa_handler!=(sighandler_t)1) { - newact.k_sa_handler = (void*)my_sigactionhandler; + newact.k_sa_handler = (void*)MY_SIGHANDLER; } else { newact.k_sa_handler = (void*)act->_u._sa_sigaction; } @@ -2045,7 +2146,7 @@ int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigactio my_context->is_sigaction[signum] = 0; if(act->_u._sa_handler!=NULL && act->_u._sa_handler!=(sighandler_t)1) { newact.sa_flags|=0x4; - newact.k_sa_handler = (void*)my_sigactionhandler; + newact.k_sa_handler = (void*)MY_SIGHANDLER; } else { newact.k_sa_handler = act->_u._sa_handler; } @@ -2079,7 +2180,7 @@ int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigactio if(act->sa_flags&0x04) { if(act->_u._sa_handler!=NULL && act->_u._sa_handler!=(sighandler_t)1) { my_context->signals[signum] = (uintptr_t)act->_u._sa_sigaction; - newact.sa_sigaction = my_sigactionhandler; + newact.sa_sigaction = MY_SIGHANDLER; } else { newact.sa_sigaction = act->_u._sa_sigaction; } @@ -2087,7 +2188,7 @@ int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigactio if(act->_u._sa_handler!=NULL && act->_u._sa_handler!=(sighandler_t)1) { my_context->signals[signum] = (uintptr_t)act->_u._sa_handler; my_context->is_sigaction[signum] = 0; - newact.sa_sigaction = my_sigactionhandler; + newact.sa_sigaction = MY_SIGHANDLER; newact.sa_flags|=0x4; } else { newact.sa_handler = act->_u._sa_handler; @@ -2102,8 +2203,8 @@ int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigactio } int ret = 0; - if(signum!=SIGSEGV && signum!=SIGBUS && signum!=SIGILL && signum!=SIGABRT) - ret = sigaction(signum, act?&newact:NULL, oldact?&old:NULL); + if(signum!=X64_SIGSEGV && signum!=X64_SIGBUS && signum!=X64_SIGILL && signum!=X64_SIGABRT) + ret = sigaction(signal_from_x64(signum), act?&newact:NULL, oldact?&old:NULL); if(oldact && ret==0) { oldact->sa_flags = old.sa_flags; memcpy(&oldact->sa_mask, &old.sa_mask, (sigsetsize>8)?8:sigsetsize); @@ -2118,6 +2219,7 @@ int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigactio EXPORT sighandler_t my_sigset(x64emu_t* emu, int signum, sighandler_t handler) { + signum = signal_from_x64(signum); // emulated SIG_HOLD if(handler == (sighandler_t)2) { x64_sigaction_t oact; @@ -2164,14 +2266,14 @@ EXPORT int my_getcontext(x64emu_t* emu, void* ucp) u->uc_mcontext.gregs[X64_R14] = R_R14; u->uc_mcontext.gregs[X64_R15] = R_R15; // get segments - u->uc_mcontext.gregs[X64_CSGSFS] = ((uint64_t)(R_CS)) | (((uint64_t)(R_GS))<<16) | (((uint64_t)(R_FS))<<32); + u->uc_mcontext.gregs[X64_CSGSFS] = ((uint64_t)(R_CS)) | (((uint64_t)(R_GS))<<16) | (((uint64_t)(R_FS))<<32) | (((uint64_t)(R_SS))<<48); // get FloatPoint status - u->uc_mcontext.fpregs = &u->xstate; - fpu_fxsave64(emu, &u->xstate); + u->uc_mcontext.fpregs = ucp + 408; + fpu_savenv(emu, (void*)u->uc_mcontext.fpregs, 1); + *(uint32_t*)(ucp + 432) = emu->mxcsr.x32; + // get signal mask sigprocmask(SIG_SETMASK, NULL, (sigset_t*)&u->uc_sigmask); - // ensure uc_link is properly initialized - u->uc_link = emu->uc_link; return 0; } @@ -2205,18 +2307,28 @@ EXPORT int my_setcontext(x64emu_t* emu, void* ucp) R_CS = (u->uc_mcontext.gregs[X64_CSGSFS]>> 0)&0xffff; R_GS = (u->uc_mcontext.gregs[X64_CSGSFS]>>16)&0xffff; R_FS = (u->uc_mcontext.gregs[X64_CSGSFS]>>32)&0xffff; + R_SS = (u->uc_mcontext.gregs[X64_CSGSFS]>>48)&0xffff; // set FloatPoint status - fpu_fxrstor64(emu, &u->xstate); + fpu_loadenv(emu, (void*)u->uc_mcontext.fpregs, 1); + emu->mxcsr.x32 = *(uint32_t*)(ucp + 432); // set signal mask sigprocmask(SIG_SETMASK, (sigset_t*)&u->uc_sigmask, NULL); - // set uc_link - emu->uc_link = u->uc_link; errno = 0; return R_EAX; } +void vFEv(x64emu_t *emu, uintptr_t fnc); +EXPORT void my_start_context(x64emu_t* emu) +{ + // this is call indirectly by swapcontext from a makecontext, and will link context or just exit + x64_ucontext_t *u = *(x64_ucontext_t**)R_RBX; + if(u) + my_setcontext(emu, u); + else + emu->quit = 1; +} -EXPORT int my_makecontext(x64emu_t* emu, void* ucp, void* fnc, int32_t argc, int64_t* argv) +EXPORT void my_makecontext(x64emu_t* emu, void* ucp, void* fnc, int32_t argc, int64_t* argv) { // printf_log(LOG_NONE, "Warning: call to unimplemented makecontext\n"); x64_ucontext_t *u = (x64_ucontext_t*)ucp; @@ -2224,15 +2336,19 @@ EXPORT int my_makecontext(x64emu_t* emu, void* ucp, void* fnc, int32_t argc, int uintptr_t* rsp = (uintptr_t*)(u->uc_stack.ss_sp + u->uc_stack.ss_size - sizeof(uintptr_t)); // setup the function u->uc_mcontext.gregs[X64_RIP] = (intptr_t)fnc; + // setup return to private start_context uc_link + *rsp = (uintptr_t)u->uc_link; + u->uc_mcontext.gregs[X64_RBX] = (uintptr_t)rsp; + --rsp; // setup args int n = 3; int j = 0; int regs_abi[] = {_DI, _SI, _DX, _CX, _R8, _R9}; for (int i=0; iregs[regs_abi[n++]].q[0]; + v = emu->regs[regs_abi[n++]].dword[0]; else v = argv[j++]; // push value @@ -2250,12 +2366,44 @@ EXPORT int my_makecontext(x64emu_t* emu, void* ucp, void* fnc, int32_t argc, int } // push the return value --rsp; - *rsp = my_context->exit_bridge; + *rsp = AddCheckBridge(my_context->system, vFEv, my_start_context, 0, "my_start_context");//my_context->exit_bridge; u->uc_mcontext.gregs[X64_RSP] = (uintptr_t)rsp; +} - return 0; +void box64_abort() { + if(BOX64ENV(showbt) && LOG_INFO<=BOX64ENV(log)) { + // show native bt + #define BT_BUF_SIZE 100 + int nptrs; + void *buffer[BT_BUF_SIZE]; + char **strings; + x64emu_t* emu = thread_get_emu(); + +#ifndef ANDROID + nptrs = backtrace(buffer, BT_BUF_SIZE); + strings = backtrace_symbols(buffer, nptrs); + if(strings) { + for (int j = 0; j < nptrs; j++) + printf_log(LOG_INFO, "NativeBT: %s\n", strings[j]); + free(strings); + } else + printf_log(LOG_INFO, "NativeBT: none (%d/%s)\n", errno, strerror(errno)); +#endif + extern int my_backtrace_ip(x64emu_t* emu, void** buffer, int size); // in wrappedlibc + extern char** my_backtrace_symbols(x64emu_t* emu, uintptr_t* buffer, int size); + nptrs = my_backtrace_ip(emu, buffer, BT_BUF_SIZE); + strings = my_backtrace_symbols(emu, (uintptr_t*)buffer, nptrs); + if(strings) { + for (int j = 0; j < nptrs; j++) + printf_log(LOG_INFO, "EmulatedBT: %s\n", strings[j]); + free(strings); + } else + printf_log(LOG_INFO, "EmulatedBT: none\n"); + } + abort(); } + EXPORT int my_swapcontext(x64emu_t* emu, void* ucp1, void* ucp2) { // printf_log(LOG_NONE, "Warning: call to unimplemented swapcontext\n"); @@ -2265,6 +2413,7 @@ EXPORT int my_swapcontext(x64emu_t* emu, void* ucp1, void* ucp2) my_setcontext(emu, ucp2); return 0; } + #ifdef USE_SIGNAL_MUTEX static void atfork_child_dynarec_prot(void) { @@ -2310,3 +2459,24 @@ void fini_signal_helper() signal(SIGILL, SIG_DFL); signal(SIGABRT, SIG_DFL); } + +#ifdef NEED_SIG_CONV +int signal_to_x64(int sig) +{ + #define GO(A) case A: return X64_##A; + switch(sig) { + SUPER_SIGNAL + } + #undef GO + return sig; +} +int signal_from_x64(int sig) +{ + #define GO(A) case X64_##A: return A; + switch(sig) { + SUPER_SIGNAL + } + #undef GO + return sig; +} +#endif diff --git a/src/libtools/static_libc.h b/src/libtools/static_libc.h index 802d8dc..da62b51 100644 --- a/src/libtools/static_libc.h +++ b/src/libtools/static_libc.h @@ -93,6 +93,7 @@ void cfree(void* p) {free(p);} //extern char* clnt_sperrno(enum clnt_stat); extern int __close(int); extern int __connect(int, void*, uint32_t); +extern size_t __confstr_chk(int name, char * buf, size_t len, size_t buflen); extern double copysign(double, double); extern float copysignf(float, float); extern long double copysignl(long double, long double); @@ -100,9 +101,10 @@ extern int __dup2(int, int); extern void* __duplocale(void*); extern int __endmntent(void*); extern void __explicit_bzero_chk(void*, size_t, size_t); +extern void error(int status, int errnum, const char *format, ...); extern size_t __fbufsize(void*); -extern size_t __fdelt_chk(size_t); -extern void* __fgets_chk(void*, size_t, int, void*); +extern long int __fdelt_chk(long int); +extern char* __fgets_chk(char*, size_t, int, FILE*); extern int __finite(double); extern int finite(double); extern int __finitef(float); @@ -114,19 +116,20 @@ extern void _flushlbf(); extern size_t __fpending(void*); extern void __fpurge(void*); extern int __freadable(void*); -extern size_t __fread_chk(void*, size_t, size_t, size_t, void*); +extern size_t __fread_chk(void*, size_t, size_t, size_t, FILE*); extern int __freading(void*); -extern size_t __fread_unlocked_chk(void*, size_t, size_t, size_t, void*); +extern size_t __fread_unlocked_chk(void*, size_t, size_t, size_t, FILE*); extern void __freelocale(void*); extern int __fseeko64(void*, ssize_t, int); extern int __fsetlocking(void*, int); extern ssize_t __ftello64(void*); extern int __fwritable(void*); extern int __fwriting(void*); -extern void* __getcwd_chk(void*, size_t, size_t); -extern int __getgroups_chk(int, void*, size_t); +extern char* __getcwd_chk(char*, size_t, size_t); +extern int __getgroups_chk(int, __gid_t*, size_t); extern void* __getmntent_r(void*, void*, void*, int); //extern int getnetname(char *); +extern int __getpagesize(); extern int __getpid(void); //extern int getpublickey (const char *, char *); extern int __getrlimit(int, void*); @@ -188,11 +191,12 @@ extern void* __libc_valloc(size_t); extern int64_t __lseek(int, int64_t, int); extern int __madvise(void*, size_t, int); extern size_t __mbrtowc(void*, void*, size_t, void*); -extern size_t __mbsnrtowcs_chk(void*, void*, size_t, size_t, void*, size_t); -extern size_t __mbsrtowcs_chk(void*, void*, size_t, void*, size_t); -extern size_t __mbstowcs_chk(void*, void*, size_t, size_t); +extern size_t __mbsnrtowcs_chk(wchar_t*, const char**, size_t, size_t, mbstate_t*, size_t); +extern size_t __mbsrtowcs_chk(wchar_t*, const char**, size_t, mbstate_t*, size_t); +extern size_t __mbstowcs_chk(wchar_t*, const char*, size_t, size_t); extern void _mcount(void*, void*); -extern void* __memcpy_chk(void*, void*, uint32_t, size_t); +extern void _mcleanup(); +extern void* __memcpy_chk(void*, void*, size_t, size_t); extern void* __memmove_chk(void*, void*, size_t, size_t); extern void* __mempcpy_chk(void*, void*, size_t, size_t); extern void* __memset_chk(void*, int, size_t, size_t); @@ -202,18 +206,21 @@ extern int __nanosleep(void*, void*); //extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *); extern void* __newlocale(int, void*, void*); extern void __nl_langinfo_l(uint32_t, void*); -extern int __open_2(void*, int); -extern int __open64_2(void*, int); -extern int __openat_2(int, void*, int); -extern int __openat64_2(int, void*, int); +extern int __open_2(const char*, int); +extern int __open64_2(const char*, int); +extern int __openat_2(int, const char*, int); +extern int __openat64_2(int, const char*, int); extern int __pipe(void*); //extern int pmap_set(size_t, size_t, int, int); //extern int pmap_unset(size_t, size_t); extern int __poll(void*, size_t, int); -extern int __poll_chk(void*, uint32_t, int, size_t); -extern int __ppoll_chk(void*, uint32_t, void*, void*, size_t); +extern int __poll_chk(struct pollfd*, size_t, int, size_t); +extern int __ppoll_chk(struct pollfd*, size_t, const struct timespec *, const __sigset_t *, size_t); extern ssize_t __pread64(int, void*, size_t, int64_t); extern ssize_t __pread_chk(int, void*, size_t, ssize_t, size_t); +#ifndef LA64 +extern ssize_t __pread64_chk(int, void*, size_t, ssize_t, size_t); +#endif //extern void __sF(int, void*); //extern void __assert2(int, void*); //extern void pthread_kill_other_threads_np(); @@ -226,6 +233,7 @@ extern void __res_iclose(void*, int); extern int __res_init(); extern void __res_nclose(void*); extern int __res_ninit(void*); +extern int res_nsearch(void* statp, const char *dname, int class_, int type, char* answer, int anslen); extern void* __res_state(); //extern int _rpc_dtablesize(); //extern void* __rpc_thread_svc_max_pollfd(); @@ -250,19 +258,20 @@ extern int __signbitl(long double); extern int __sigsuspend(void*); extern int __sigtimedwait(void*, void*, void*); extern int __socket(int, int, int); -extern void* __stpcpy_chk(void*, void*, size_t); -extern void* __stpncpy_chk(void*, void*, size_t, size_t); +extern char* __stpcpy_chk(char *, const char *, long unsigned int); +extern char* __stpncpy_chk(char *, const char *, long unsigned int, long unsigned int); extern int __strcasecmp(void*, void*); extern void* __strcasestr(void*, void*); -extern void* __strcat_chk(void*, void*, size_t); +extern char* __strcat_chk(char *, const char *, long unsigned int); extern int __strcoll_l(void*, void*, void*); -extern void* __strcpy_chk(void*, void*, size_t); +extern void* __strcpy_chk(char *, const char *, long unsigned int); extern void* __strdup(void*); extern void* __strerror_r(int, void*, size_t); extern long strfmon_l(void*, size_t, void*, void*, ...); extern size_t __strftime_l(void*, size_t, void*, void*, size_t); -extern void* __strncat_chk(void*, void*, size_t, size_t); -extern void* __strncpy_chk(void*, void*, size_t, size_t); +extern size_t __strlcpy_chk(char*, const char*, size_t, size_t); +extern void* __strncat_chk(char *, const char *, long unsigned int, long unsigned int); +extern void* __strncpy_chk(char *, const char *, long unsigned int, long unsigned int); extern void* __strndup(void*, size_t); extern double __strtod_internal(void*, void*, int); extern double __strtod_l(void*, void*, void*); @@ -294,19 +303,21 @@ extern void* __uselocale(void*); extern int user2netname(char *, const uid_t, const char *); extern int __wait(void*); extern int __waitpid(int, void*, int); +extern size_t __wcrtomb_chk(char * s, wchar_t wchar, mbstate_t * ps, size_t buflen); extern int __wcscasecmp_l(void*, void*, void*); -extern void* __wcscat_chk(void*, void*, size_t); +extern wchar_t* __wcscat_chk(wchar_t*, const wchar_t*, size_t); extern int __wcscoll_l(void*, void*, void*); -extern void* __wcscpy_chk(void*, void*, size_t); +extern wchar_t* __wcscpy_chk(wchar_t*, const wchar_t*, size_t); extern size_t __wcsftime_l(void*, size_t, void*, void*, void*); -extern void* __wcsncat_chk(void*, void*, size_t, size_t); -extern void* __wcsncpy_chk(void*, void*, size_t, size_t); +extern wchar_t* __wcsncat_chk(wchar_t*, const wchar_t*, size_t, size_t); +extern wchar_t* __wcsncpy_chk(wchar_t*, const wchar_t*, size_t, size_t); +extern size_t __wcsrtombs_chk(char * dest, const wchar_t * * src, size_t len, mbstate_t * ps, size_t destlen); extern size_t __wcsxfrm_l(void*, void*, size_t, size_t); -extern int __wctomb_chk(void* uint32_t, size_t); +extern int __wctomb_chk(char*, wchar_t, size_t); extern size_t __wctype_l(void*, void*); -extern void* __wmemcpy_chk(void*, void*, size_t, size_t); -extern void* __wmemmove_chk(void*, void*, size_t, size_t); -extern void* __wmemset_chk(void* uint32_t, size_t, size_t); +extern wchar_t* __wmemcpy_chk(wchar_t*, const wchar_t*, size_t, size_t); +extern wchar_t* __wmemmove_chk(wchar_t*, const wchar_t*, size_t, size_t); +extern wchar_t* __wmemset_chk(wchar_t*, wchar_t, size_t, size_t); extern ssize_t __write(int, void*, size_t); extern int __xpg_strerror_r(int __errnum, char *__buf, size_t __buflen); extern int __xpg_sigpause(int __sig); @@ -317,3 +328,4 @@ extern char *__xpg_basename(char *__path); void* dummy_pFLp(size_t a, void* b) {} void* dummy_pFpLLp(void* a, size_t b, size_t c, void* d) {} void* dummy__ZnwmSt11align_val_tRKSt9nothrow_t(size_t a, size_t b, void* c) {} +extern void __monstartup(unsigned long, unsigned long); diff --git a/src/libtools/static_threads.h b/src/libtools/static_threads.h index 62240fb..f764e6c 100644 --- a/src/libtools/static_threads.h +++ b/src/libtools/static_threads.h @@ -5,6 +5,7 @@ typedef struct x64_unwind_buff_s x64_unwind_buff_t; typedef union my_mutexattr_s my_mutexattr_t; typedef union my_barrierattr_s my_barrierattr_t; typedef union my_condattr_s my_condattr_t; +typedef struct pthread_cond_old_s pthread_cond_old_t; int my_pthread_atfork(x64emu_t *emu, void* prepare, void* parent, void* child); int my_pthread_attr_destroy(x64emu_t* emu, void* attr); int my_pthread_attr_getstack(x64emu_t* emu, void* attr, void** stackaddr, size_t* stacksize); @@ -56,6 +57,7 @@ int my_pthread_mutexattr_getrobust(x64emu_t* emu, my_mutexattr_t *attr, void* p) int my_pthread_mutexattr_init(x64emu_t* emu, my_mutexattr_t *attr); int my___pthread_mutexattr_init(x64emu_t* emu, my_mutexattr_t *attr); int my_pthread_mutexattr_setkind_np(x64emu_t* emu, my_mutexattr_t *attr, int k); +int my_pthread_mutexattr_setprioceiling(x64emu_t* emu, my_mutexattr_t *attr, int p); int my_pthread_mutexattr_setprotocol(x64emu_t* emu, my_mutexattr_t *attr, int p); int my_pthread_mutexattr_setpshared(x64emu_t* emu, my_mutexattr_t *attr, int p); int my_pthread_mutexattr_settype(x64emu_t* emu, my_mutexattr_t *attr, int t); @@ -72,6 +74,7 @@ int my_pthread_condattr_setpshared(x64emu_t* emu, my_condattr_t* c, int p); int my_pthread_cond_init(x64emu_t* emu, pthread_cond_t *pc, my_condattr_t* c); int my_pthread_cond_destroy(x64emu_t* emu, pthread_cond_t *pc); int my_pthread_cond_broadcast(x64emu_t* emu, pthread_cond_t *pc); +int my_pthread_cond_signal(x64emu_t* emu, pthread_cond_t* cond); int my_pthread_barrierattr_destroy(x64emu_t* emu, my_barrierattr_t* b); int my_pthread_barrierattr_getpshared(x64emu_t* emu, my_barrierattr_t* b, void* p); int my_pthread_barrierattr_init(x64emu_t* emu, my_barrierattr_t* b); @@ -83,4 +86,21 @@ void my___pthread_unwind_next(x64emu_t* emu, x64_unwind_buff_t* buff); void my__pthread_cleanup_push_defer(x64emu_t* emu, void* buffer, void* routine, void* arg); void my__pthread_cleanup_push(x64emu_t* emu, void* buffer, void* routine, void* arg); void my__pthread_cleanup_pop_restore(x64emu_t* emu, void* buffer, int exec); -void my__pthread_cleanup_pop(x64emu_t* emu, void* buffer, int exec); \ No newline at end of file +void my__pthread_cleanup_pop(x64emu_t* emu, void* buffer, int exec); +int my_pthread_cond_broadcast_old(x64emu_t* emu, pthread_cond_old_t* cond); +int my_pthread_cond_destroy_old(x64emu_t* emu, pthread_cond_old_t* cond); +int my_pthread_cond_init_old(x64emu_t* emu, pthread_cond_old_t* cond, void* attr); +int my_pthread_cond_signal_old(x64emu_t* emu, pthread_cond_old_t* cond); +int my_pthread_cond_timedwait_old(x64emu_t* emu, pthread_cond_old_t* cond, void* mutex, void* abstime); +int my_pthread_cond_wait_old(x64emu_t* emu, pthread_cond_old_t* cond, void* mutex); +int my_pthread_getaffinity_np_old(x64emu_t* emu, pthread_t thread, void* cpuset); +int my_pthread_setaffinity_np_old(x64emu_t* emu, pthread_t thread, void* cpuset); +int my_pthread_attr_setaffinity_np_old(x64emu_t* emu, pthread_attr_t* attr, void* cpuset); + + +extern int __pthread_mutexattr_destroy(pthread_mutexattr_t *attr); +extern int __pthread_mutexattr_init(pthread_mutexattr_t *attr); +extern int __pthread_mutexattr_settype(pthread_mutexattr_t *attr, int t); +extern int __pthread_mutex_init(pthread_mutex_t *m, pthread_mutexattr_t *att); +extern int pthread_mutexattr_getkind_np(pthread_mutexattr_t *attr, void* p); +extern int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int k); \ No newline at end of file diff --git a/src/libtools/threads.c b/src/libtools/threads.c index 074068c..dc480f0 100644 --- a/src/libtools/threads.c +++ b/src/libtools/threads.c @@ -4,31 +4,35 @@ #include #include #include -#include #include #include -#include -#include +#include "x64_signals.h" +#include "os.h" #include "debug.h" #include "box64context.h" #include "threads.h" #include "emu/x64emu_private.h" -#include "x64run.h" #include "x64emu.h" #include "box64stack.h" +#include "box64cpu.h" +#include "box64cpu_util.h" #include "callback.h" #include "custommem.h" #include "khash.h" #include "emu/x64run_private.h" #include "x64trace.h" -#include "dynarec.h" #include "bridge.h" #include "myalign.h" +#include "x64tls.h" #ifdef DYNAREC #include "dynablock.h" #include "dynarec/native_lock.h" #endif +#ifdef BOX32 +#include "box32.h" +#include "threads32.h" +#endif //void _pthread_cleanup_push_defer(void* buffer, void* routine, void* arg); // declare hidden functions //void _pthread_cleanup_pop_restore(void* buffer, int exec); @@ -36,6 +40,7 @@ typedef void (*vFppp_t)(void*, void*, void*); typedef void (*vFpi_t)(void*, int); typedef int (*iFppip_t)(void*, void*, int, void*); typedef int (*iFli_t)(long unsigned int, int); +typedef struct emuthread_s emuthread_t; static vFppp_t real_pthread_cleanup_push_defer = NULL; static vFpi_t real_pthread_cleanup_pop_restore = NULL; @@ -62,9 +67,6 @@ typedef struct x64_unwind_buff_s { typedef void(*vFv_t)(); KHASH_MAP_INIT_INT64(threadstack, threadstack_t*) -#ifndef ANDROID -KHASH_MAP_INIT_INT64(cancelthread, __pthread_unwind_buf_t*) -#endif void CleanStackSize(box64context_t* context) { @@ -78,8 +80,10 @@ void CleanStackSize(box64context_t* context) mutex_unlock(&context->mutex_thread); } -void FreeStackSize(kh_threadstack_t* map, uintptr_t attr) +void FreeStackSize(uintptr_t attr) { + kh_threadstack_t* map = my_context->stacksizes; + if(!map) return; mutex_lock(&my_context->mutex_thread); khint_t k = kh_get(threadstack, map, attr); if(k!=kh_end(map)) { @@ -89,26 +93,30 @@ void FreeStackSize(kh_threadstack_t* map, uintptr_t attr) mutex_unlock(&my_context->mutex_thread); } -void AddStackSize(kh_threadstack_t* map, uintptr_t attr, void* stack, size_t stacksize) +void AddStackSize(uintptr_t attr, void* stack, size_t stacksize) { + if(!my_context->stacksizes) + my_context->stacksizes = kh_init(threadstack); + kh_threadstack_t* map = my_context->stacksizes; khint_t k; int ret; mutex_lock(&my_context->mutex_thread); k = kh_put(threadstack, map, attr, &ret); - threadstack_t* ts = kh_value(map, k) = (threadstack_t*)box_calloc(1, sizeof(threadstack_t)); + if(ret) kh_value(map, k) = (threadstack_t*)box_calloc(1, sizeof(threadstack_t)); + threadstack_t* ts = kh_value(map, k); ts->stack = stack; ts->stacksize = stacksize; mutex_unlock(&my_context->mutex_thread); } // return stack from attr (or from current emu if attr is not found..., wich is wrong but approximate enough?) -int GetStackSize(x64emu_t* emu, uintptr_t attr, void** stack, size_t* stacksize) +int GetStackSize(uintptr_t attr, void** stack, size_t* stacksize) { - if(emu->context->stacksizes && attr) { + if(my_context->stacksizes && attr) { mutex_lock(&my_context->mutex_thread); - khint_t k = kh_get(threadstack, emu->context->stacksizes, attr); - if(k!=kh_end(emu->context->stacksizes)) { - threadstack_t* ts = kh_value(emu->context->stacksizes, k); + khint_t k = kh_get(threadstack, my_context->stacksizes, attr); + if(k!=kh_end(my_context->stacksizes)) { + threadstack_t* ts = kh_value(my_context->stacksizes, k); *stack = ts->stack; *stacksize = ts->stacksize; mutex_unlock(&my_context->mutex_thread); @@ -116,38 +124,73 @@ int GetStackSize(x64emu_t* emu, uintptr_t attr, void** stack, size_t* stacksize) } mutex_unlock(&my_context->mutex_thread); } - // should a Warning be emitted? - *stack = emu->init_stack; - *stacksize = emu->size_stack; return 0; } void my_longjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p, int32_t __val); +#ifdef BOX32 +void my32_longjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p, int32_t __val); +#endif -typedef struct emuthread_s { - uintptr_t fnc; - void* arg; - x64emu_t* emu; - int cancel_cap, cancel_size; - x64_unwind_buff_t **cancels; -} emuthread_t; +#ifdef BAD_PKILL +// tracking of threads that are alive +KHASH_MAP_INIT_INT64(threads, emuthread_t*) +static pthread_mutex_t threads_mutex = PTHREAD_MUTEX_INITIALIZER; +static kh_threads_t* threads_alive = NULL; + +void add_thread(void* t, emuthread_t* et) +{ + pthread_mutex_lock(&threads_mutex); + if(!threads_alive) + threads_alive = kh_init(threads); + khint_t k; + int ret; + k = kh_put(threads, threads_alive, (uintptr_t)t, &ret); + kh_value(threads_alive, k) = et; + pthread_mutex_unlock(&threads_mutex); +} +void del_thread(void* t) +{ + pthread_mutex_lock(&threads_mutex); + if(threads_alive) { + khint_t k; + k = kh_get(threads, threads_alive, (uintptr_t)t); + if(k!=kh_end(threads_alive)) + kh_del(threads, threads_alive, k); + } + pthread_mutex_unlock(&threads_mutex); +} +emuthread_t* get_thread(void* t) +{ + emuthread_t* ret = NULL; + pthread_mutex_lock(&threads_mutex); + if(threads_alive) { + khint_t k; + k = kh_get(threads, threads_alive, (uintptr_t)t); + if(k!=kh_end(threads_alive)) + ret = kh_value(threads_alive, k); + } + pthread_mutex_unlock(&threads_mutex); + return ret; +} +#endif static pthread_key_t thread_key; -static void emuthread_destroy(void* p) +void emuthread_destroy(void* p) { emuthread_t *et = (emuthread_t*)p; if(!et) return; - // check tlsdata - /*void* ptr; - if (my_context && (ptr = pthread_getspecific(my_context->tlskey)) != NULL) - free_tlsdatasize(ptr);*/ - // free x64emu - if(et) { - FreeX64Emu(&et->emu); - box_free(et); - } + #ifdef BOX32 + if(et->is32bits && !et->join && et->fnc) + to_hash_d(et->self); + #endif + FreeX64Emu(&et->emu); + #ifdef BAD_PKILL + del_thread((void*)et->self); + #endif + box_free(et); } static void emuthread_cancel(void* p) @@ -158,19 +201,32 @@ static void emuthread_cancel(void* p) // check cancels threads for(int i=et->cancel_size-1; i>=0; --i) { et->emu->flags.quitonlongjmp = 0; - my_longjmp(et->emu, et->cancels[i]->__cancel_jmp_buf, 1); + et->emu->quit = 0; + #ifdef BOX32 + if(et->is32bits) + my32_longjmp(et->emu, ((i386_unwind_buff_t*)et->cancels[i])->__cancel_jmp_buf, 1); + else + #endif + my_longjmp(et->emu, ((x64_unwind_buff_t*)et->cancels[i])->__cancel_jmp_buf, 1); DynaRun(et->emu); // will return after a __pthread_unwind_next() } + #ifdef BOX32 + /*if(box64_is32bits) + to_hash_d(et->self);*/ // not removing hash for old pthread_t + #endif box_free(et->cancels); et->cancels=NULL; et->cancel_size = et->cancel_cap = 0; } - +void thread_forget_emu() +{ + pthread_setspecific(thread_key, NULL); +} void thread_set_emu(x64emu_t* emu) { emuthread_t *et = (emuthread_t*)pthread_getspecific(thread_key); if(!emu) { - if(et) box_free(et); + if(et) emuthread_destroy(et); pthread_setspecific(thread_key, NULL); return; } @@ -182,6 +238,18 @@ void thread_set_emu(x64emu_t* emu) } et->emu = emu; et->emu->type = EMUTYPE_MAIN; + #ifdef BOX32 + if(box64_is32bits) { + et->is32bits = 1; + et->self = (uintptr_t)pthread_self(); + et->hself = to_hash(et->self); + } + #endif + #ifdef BAD_PKILL + if(!et->self) + et->self = (uintptr_t)pthread_self(); + add_thread((void*)et->self, et); + #endif pthread_setspecific(thread_key, et); } @@ -189,28 +257,39 @@ x64emu_t* thread_get_emu() { emuthread_t *et = (emuthread_t*)pthread_getspecific(thread_key); if(!et) { - int stacksize = 2*1024*1024; - // try to get stack size of the thread - pthread_attr_t attr; - if(!pthread_getattr_np(pthread_self(), &attr)) { - size_t stack_size; - void *stack_addr; - if(!pthread_attr_getstack(&attr, &stack_addr, &stack_size)) - if(stack_size) - stacksize = stack_size; - pthread_attr_destroy(&attr); - } - void* stack = internal_mmap(NULL, stacksize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_GROWSDOWN, -1, 0); + // this should not happens. So if it happens, use a small stack + int stacksize = 256*1024; + void* stack = NULL; + if(box64_is32bits) + stack = mmap64(NULL, stacksize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_32BIT, -1, 0); + else + stack = InternalMmap(NULL, stacksize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_GROWSDOWN, -1, 0); if(stack!=MAP_FAILED) - setProtection((uintptr_t)stack, stacksize, PROT_READ|PROT_WRITE); - x64emu_t *emu = NewX64Emu(my_context, 0, (uintptr_t)stack, stacksize, 1); + setProtection_stack((uintptr_t)stack, stacksize, PROT_READ|PROT_WRITE); + x64emu_t *emu = NewX64Emu(my_context, my_context->exit_bridge, (uintptr_t)stack, stacksize, 1); SetupX64Emu(emu, NULL); + refreshTLSData(emu); thread_set_emu(emu); return emu; } return et->emu; } +emuthread_t* thread_get_et() +{ + return (emuthread_t*)pthread_getspecific(thread_key); +} + +void thread_set_et(emuthread_t* et) +{ + #ifdef BAD_PKILL + if(et && !et->self) + et->self = (uintptr_t)pthread_self(); + add_thread((void*)(et?et->self:pthread_self()), et); + #endif + pthread_setspecific(thread_key, et); +} + static void* pthread_routine(void* p) { // free current emuthread if it exist @@ -228,13 +307,17 @@ static void* pthread_routine(void* p) et->emu->type = EMUTYPE_MAIN; // setup callstack and run... x64emu_t* emu = et->emu; - ResetSegmentsCache(emu); + #ifdef BAD_PKILL + if(!et->self) + et->self = (uintptr_t)pthread_self(); + add_thread((void*)et->self, et); + #endif + refreshTLSData(emu); Push64(emu, 0); // PUSH 0 (backtrace marker: return address is 0) Push64(emu, 0); // PUSH BP R_RBP = R_RSP; // MOV BP, SP R_RSP -= 64; // Guard zone - if(R_RSP&0x8) // align if needed (shouldn't be) - R_RSP-=8; + R_RSP &= ~15LL; PushExit(emu); R_RIP = et->fnc; R_RDI = (uintptr_t)et->arg; @@ -259,7 +342,7 @@ static void* pthread_routine(void* p) EXPORT int my_pthread_attr_destroy(x64emu_t* emu, void* attr) { if(emu->context->stacksizes) - FreeStackSize(emu->context->stacksizes, (uintptr_t)attr); + FreeStackSize((uintptr_t)attr); PTHREAD_ATTR_ALIGN(attr); int ret = pthread_attr_destroy(PTHREAD_ATTR(attr)); // no unaligned, it's destroyed @@ -269,19 +352,16 @@ EXPORT int my_pthread_attr_destroy(x64emu_t* emu, void* attr) EXPORT int my_pthread_attr_getstack(x64emu_t* emu, void* attr, void** stackaddr, size_t* stacksize) { PTHREAD_ATTR_ALIGN(attr); - int ret = pthread_attr_getstack(PTHREAD_ATTR(attr), stackaddr, stacksize); - // no need to unalign, it's const for attr - if (ret==0) - GetStackSize(emu, (uintptr_t)attr, stackaddr, stacksize); + int ret = 0; + if(!GetStackSize((uintptr_t)attr, stackaddr, stacksize)) + ret = pthread_attr_getstack(PTHREAD_ATTR(attr), stackaddr, stacksize); +//printf_log(LOG_INFO, "pthread_attr_getstack gives (%d) %p 0x%zx\n", ret, *stackaddr, *stacksize); return ret; } EXPORT int my_pthread_attr_setstack(x64emu_t* emu, void* attr, void* stackaddr, size_t stacksize) { - if(!emu->context->stacksizes) { - emu->context->stacksizes = kh_init(threadstack); - } - AddStackSize(emu->context->stacksizes, (uintptr_t)attr, stackaddr, stacksize); + AddStackSize((uintptr_t)attr, stackaddr, stacksize); //Don't call actual setstack... //return pthread_attr_setstack(attr, stackaddr, stacksize); PTHREAD_ATTR_ALIGN(attr); @@ -315,14 +395,17 @@ EXPORT int my_pthread_attr_getguardsize(x64emu_t* emu, pthread_attr_t* attr, siz PTHREAD_ATTR_ALIGN(attr); return pthread_attr_getguardsize(PTHREAD_ATTR(attr), size); } -#ifndef TERMUX EXPORT int my_pthread_attr_getinheritsched(x64emu_t* emu, pthread_attr_t* attr, int* sched) { +#ifndef TERMUX (void)emu; PTHREAD_ATTR_ALIGN(attr); return pthread_attr_getinheritsched(PTHREAD_ATTR(attr), sched); -} +#else + (void)emu; (void)attr; (void)sched; + return 0; #endif +} EXPORT int my_pthread_attr_getschedparam(x64emu_t* emu, pthread_attr_t* attr, void* param) { (void)emu; @@ -341,20 +424,25 @@ EXPORT int my_pthread_attr_getscope(x64emu_t* emu, pthread_attr_t* attr, int* sc PTHREAD_ATTR_ALIGN(attr); return pthread_attr_getscope(PTHREAD_ATTR(attr), scope); } -EXPORT int my_pthread_attr_getstackaddr(x64emu_t* emu, pthread_attr_t* attr, void* addr) +EXPORT int my_pthread_attr_getstackaddr(x64emu_t* emu, pthread_attr_t* attr, void** addr) { (void)emu; size_t size; PTHREAD_ATTR_ALIGN(attr); - return pthread_attr_getstack(PTHREAD_ATTR(attr), addr, &size); - //return pthread_attr_getstackaddr(getAlignedAttr(attr), addr); + int ret = 0; + if(!GetStackSize((uintptr_t)attr, addr, &size )) + ret = pthread_attr_getstack(PTHREAD_ATTR(attr), addr, &size); +//printf_log(LOG_INFO, "pthread_attr_getstackaddr gives %p\n", *addr); + return ret; } EXPORT int my_pthread_attr_getstacksize(x64emu_t* emu, pthread_attr_t* attr, size_t* size) { (void)emu; void* addr; PTHREAD_ATTR_ALIGN(attr); - int ret = pthread_attr_getstack(PTHREAD_ATTR(attr), &addr, size); + int ret = 0; + if(!GetStackSize((uintptr_t)attr, &addr, size )) + ret = pthread_attr_getstack(PTHREAD_ATTR(attr), &addr, size); if(!*size) *size = 2*1024*1024; //return pthread_attr_getstacksize(getAlignedAttr(attr), size); @@ -377,6 +465,10 @@ EXPORT int my_pthread_attr_setaffinity_np(x64emu_t* emu, pthread_attr_t* attr, s PTHREAD_ATTR_UNALIGN(attr); return ret; } +EXPORT int my_pthread_attr_setaffinity_np_old(x64emu_t* emu, pthread_attr_t* attr, void* cpuset) +{ + return my_pthread_attr_setaffinity_np(emu, attr, 128, cpuset); +} #endif EXPORT int my_pthread_attr_setdetachstate(x64emu_t* emu, pthread_attr_t* attr, int state) { @@ -394,16 +486,19 @@ EXPORT int my_pthread_attr_setguardsize(x64emu_t* emu, pthread_attr_t* attr, siz PTHREAD_ATTR_UNALIGN(attr); return ret; } -#ifndef TERMUX EXPORT int my_pthread_attr_setinheritsched(x64emu_t* emu, pthread_attr_t* attr, int sched) { +#ifndef TERMUX (void)emu; PTHREAD_ATTR_ALIGN(attr); int ret = pthread_attr_setinheritsched(PTHREAD_ATTR(attr), sched); PTHREAD_ATTR_UNALIGN(attr); return ret; -} +#else + (void)emu; (void)attr; (void)sched; + return 0; #endif +} EXPORT int my_pthread_attr_setschedparam(x64emu_t* emu, pthread_attr_t* attr, void* param) { (void)emu; @@ -431,11 +526,10 @@ EXPORT int my_pthread_attr_setscope(x64emu_t* emu, pthread_attr_t* attr, int sco EXPORT int my_pthread_attr_setstackaddr(x64emu_t* emu, pthread_attr_t* attr, void* addr) { size_t size = 2*1024*1024; - my_pthread_attr_getstacksize(emu, attr, &size); - PTHREAD_ATTR_ALIGN(attr); - int ret = pthread_attr_setstack(PTHREAD_ATTR(attr), addr, size); - PTHREAD_ATTR_UNALIGN(attr); - return ret; + void* pp = NULL; + GetStackSize((uintptr_t)attr, &pp, &size); + AddStackSize((uintptr_t)attr, addr, size); + return 0; //return pthread_attr_setstackaddr(getAlignedAttr(attr), addr); } #ifndef ANDROID @@ -451,6 +545,7 @@ EXPORT int my_pthread_getattr_np(x64emu_t* emu, pthread_t thread_id, pthread_att } void* stack = emu->init_stack; size_t sz = emu->size_stack; +//printf_log(LOG_INFO, "pthread_getattr_np called for self, stack=%p, sz=%lx\n", stack, sz); if (!sz) { // get default stack size pthread_attr_t attr; @@ -459,7 +554,7 @@ EXPORT int my_pthread_getattr_np(x64emu_t* emu, pthread_t thread_id, pthread_att pthread_attr_destroy(&attr); // should stack be adjusted? } - AddStackSize(emu->context->stacksizes, (uintptr_t)attr, stack, sz); + AddStackSize((uintptr_t)attr, stack, sz); } return ret; } @@ -496,15 +591,15 @@ EXPORT int my_pthread_create(x64emu_t *emu, void* t, void* attr, void* start_rou if(pthread_attr_getstacksize(PTHREAD_ATTR(attr), &stsize)==0) stacksize = stsize; } - if(GetStackSize(emu, (uintptr_t)attr, &attr_stack, &attr_stacksize)) + if(GetStackSize((uintptr_t)attr, &attr_stack, &attr_stacksize)) { stack = attr_stack; stacksize = attr_stacksize; own = 0; } else { - stack = internal_mmap(NULL, stacksize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_GROWSDOWN, -1, 0); + stack = InternalMmap(NULL, stacksize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_GROWSDOWN, -1, 0); if(stack!=MAP_FAILED) - setProtection((uintptr_t)stack, stacksize, PROT_READ|PROT_WRITE); + setProtection_stack((uintptr_t)stack, stacksize, PROT_READ|PROT_WRITE); own = 1; } @@ -516,10 +611,18 @@ EXPORT int my_pthread_create(x64emu_t *emu, void* t, void* attr, void* start_rou et->fnc = (uintptr_t)start_routine; et->arg = arg; #ifdef DYNAREC - if(box64_dynarec) { + if(BOX64ENV(dynarec)) { // pre-creation of the JIT code for the entry point of the thread DBGetBlock(emu, (uintptr_t)start_routine, 1, 0); // function wrapping are 64bits only on box64 } + if(BOX64ENV(nodynarec_delay)) { + static int num_threads = 0; + ++num_threads; + if(num_threads==2 && BOX64ENV(nodynarec_start)) { + BOX64ENV(nodynarec_start) = 0; + BOX64ENV(nodynarec_end) = 0; + } + } #endif // create thread PTHREAD_ATTR_ALIGN(attr); @@ -531,9 +634,9 @@ EXPORT int my_pthread_create(x64emu_t *emu, void* t, void* attr, void* start_rou void* my_prepare_thread(x64emu_t *emu, void* f, void* arg, int ssize, void** pet) { int stacksize = (ssize)?ssize:(2*1024*1024); //default stack size is 2Mo - void* stack = internal_mmap(NULL, stacksize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_GROWSDOWN, -1, 0); - if(stack!=MAP_FAILED) - setProtection((uintptr_t)stack, stacksize, PROT_READ|PROT_WRITE); + void* stack = InternalMmap(NULL, stacksize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_GROWSDOWN, -1, 0); + if(stack!=MAP_FAILED) + setProtection_stack((uintptr_t)stack, stacksize, PROT_READ|PROT_WRITE); emuthread_t *et = (emuthread_t*)box_calloc(1, sizeof(emuthread_t)); x64emu_t *emuthread = NewX64Emu(emu->context, (uintptr_t)f, (uintptr_t)stack, stacksize, 1); SetupX64Emu(emuthread, emu ); @@ -542,7 +645,7 @@ void* my_prepare_thread(x64emu_t *emu, void* f, void* arg, int ssize, void** pet et->fnc = (uintptr_t)f; et->arg = arg; #ifdef DYNAREC - if(box64_dynarec) { + if(BOX64ENV(dynarec)) { // pre-creation of the JIT code for the entry point of the thread DBGetBlock(emu, (uintptr_t)f, 1, 0); // function wrapping are 64bits only on box64 } @@ -637,10 +740,10 @@ static void* findcleanup_routineFct(void* fct) // key_dtor #define GO(A) \ -static uintptr_t my_key_dtor_fct_##A = 0; \ -static void my_key_dtor_##A(void* a) \ +static uintptr_t my_key_dtor_fct_##A = 0; \ +static void my_key_dtor_##A(void* a) \ { \ - RunFunction(my_key_dtor_fct_##A, 1, a);\ + RunFunction(my_key_dtor_fct_##A, 1, a); \ } SUPER() #undef GO @@ -663,28 +766,36 @@ static void* findkey_dtorFct(void* fct) // custom implementation of pthread_once... int EXPORT my_pthread_once(x64emu_t* emu, int* once, void* cb) { - if(*once) // quick test first - return 0; - // slow test now - #ifdef DYNAREC - int old = native_lock_xchg_d(once, 1); - #else - int old = *once; // outside of the mutex in case once is badly formed - mutex_lock(&my_context->mutex_lock); - old = *once; - *once = 1; - mutex_unlock(&my_context->mutex_lock); - #endif - if(old) + if(*once==1) // quick test first return 0; - // make some room and align R_RSP before doing the call (maybe it would be simpler to just use Callback functions) - Push64(emu, R_RBP); // push rbp - R_RBP = R_RSP; // mov rbp, rsp - R_RSP -= 0x200; - R_RSP &= ~63LL; - DynaCall(emu, (uintptr_t)cb); // using DynaCall, speedup wine 7.21 initialisation - R_RSP = R_RBP; // mov rsp, rbp - R_RBP = Pop64(emu); // pop rbp + if(__sync_bool_compare_and_swap(once, 0, 2)) { + // can run the function + // make some room and align R_RSP before doing the call (maybe it would be simpler to just use Callback functions) + Push64(emu, R_RBP); // push rbp + R_RBP = R_RSP; // mov rbp, rsp + R_RSP &= ~63LL; + + DynaCall(emu, (uintptr_t)cb); // using DynaCall, speedup wine 7.21 initialisation + + R_RSP = R_RBP; // mov rsp, rbp + R_RBP = Pop64(emu); // pop rbp + *once = 1; + __sync_synchronize(); + } else { + // nope, functionis running, wait until it's done + // this is a workaround for an issue in some EA Launcher programs, + // were some sort of deadlock happens on a pthread_once for wine's register_builtins + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC_COARSE, &ts); + uint64_t t = ts.tv_sec*1000000000LL + ts.tv_nsec; + while(*once!=1) { + sched_yield(); + clock_gettime(CLOCK_MONOTONIC_COARSE, &ts); + if((ts.tv_sec*1000000000LL + ts.tv_nsec)-t>10*1000000LL) // if wait last for more than 10ms, force as completed + *once = 1; + __sync_synchronize(); + } + } return 0; } EXPORT int my___pthread_once(x64emu_t* emu, void* once, void* cb) __attribute__((alias("my_pthread_once"))); @@ -778,6 +889,11 @@ EXPORT int my_pthread_getaffinity_np(x64emu_t* emu, pthread_t thread, size_t cpu return ret; } +EXPORT int my_pthread_getaffinity_np_old(x64emu_t* emu, pthread_t thread, void* cpuset) +{ + return my_pthread_getaffinity_np(emu, thread, 128, cpuset); +} + EXPORT int my_pthread_setaffinity_np(x64emu_t* emu, pthread_t thread, size_t cpusetsize, void* cpuset) { @@ -789,6 +905,10 @@ EXPORT int my_pthread_setaffinity_np(x64emu_t* emu, pthread_t thread, size_t cpu return ret; } +EXPORT int my_pthread_setaffinity_np_old(x64emu_t* emu, pthread_t thread, void* cpuset) +{ + return my_pthread_setaffinity_np(emu, thread, 128, cpuset); +} #endif //EXPORT int my_pthread_attr_setaffinity_np(x64emu_t* emu, void* attr, uint32_t cpusetsize, void* cpuset) @@ -804,19 +924,29 @@ EXPORT int my_pthread_setaffinity_np(x64emu_t* emu, pthread_t thread, size_t cpu EXPORT int my_pthread_kill(x64emu_t* emu, void* thread, int sig) { + sig = signal_from_x64(sig); // should ESCHR result be filtered, as this is expected to be the 2.34 behaviour? (void)emu; // check for old "is everything ok?" if(thread==NULL && sig==0) return pthread_kill(pthread_self(), 0); + #ifdef BAD_PKILL + if(sig==0 && thread!=(void*)pthread_self()) + return get_thread(thread)?0:ESRCH; + #endif return pthread_kill((pthread_t)thread, sig); } EXPORT int my_pthread_kill_old(x64emu_t* emu, void* thread, int sig) { + sig = signal_from_x64(sig); // check for old "is everything ok?" if((thread==NULL) && (sig==0)) return real_phtread_kill_old(pthread_self(), 0); + #ifdef BAD_PKILL + if(sig==0 && thread!=(void*)pthread_self()) + return get_thread(thread)?0:ESRCH; + #endif return real_phtread_kill_old((pthread_t)thread, sig); } @@ -850,16 +980,20 @@ EXPORT int my_pthread_mutexattr_getkind_np(x64emu_t* emu, my_mutexattr_t *attr, attr->x86 = mattr.x86; return ret; } -#ifndef TERMUX EXPORT int my_pthread_mutexattr_getprotocol(x64emu_t* emu, my_mutexattr_t *attr, void* p) { +#ifndef TERMUX + (void)emu; my_mutexattr_t mattr = {0}; mattr.x86 = attr->x86; int ret = pthread_mutexattr_getprotocol(&mattr.nat, p); attr->x86 = mattr.x86; return ret; -} +#else + (void)emu; (void)attr; (void)p; + return 0; #endif +} EXPORT int my_pthread_mutexattr_gettype(x64emu_t* emu, my_mutexattr_t *attr, void* p) { my_mutexattr_t mattr = {0}; @@ -896,16 +1030,34 @@ EXPORT int my_pthread_mutexattr_setkind_np(x64emu_t* emu, my_mutexattr_t *attr, attr->x86 = mattr.x86; return ret; } -#ifndef TERMUX +EXPORT int my_pthread_mutexattr_setprioceiling(x64emu_t* emu, my_mutexattr_t *attr, int p) +{ +#if !defined(TERMUX) && !defined(ANDROID) + (void)emu; + my_mutexattr_t mattr = {0}; + mattr.x86 = attr->x86; + int ret = pthread_mutexattr_setprioceiling(&mattr.nat, p); + attr->x86 = mattr.x86; + return ret; +#else + (void)emu; (void)attr; (void)p; + return 0; +#endif +} EXPORT int my_pthread_mutexattr_setprotocol(x64emu_t* emu, my_mutexattr_t *attr, int p) { +#ifndef TERMUX + (void)emu; my_mutexattr_t mattr = {0}; mattr.x86 = attr->x86; int ret = pthread_mutexattr_setprotocol(&mattr.nat, p); attr->x86 = mattr.x86; return ret; -} +#else + (void)emu; (void)attr; (void)p; + return 0; #endif +} EXPORT int my_pthread_mutexattr_setpshared(x64emu_t* emu, my_mutexattr_t *attr, int p) { my_mutexattr_t mattr = {0}; @@ -1045,6 +1197,68 @@ EXPORT int my_pthread_cond_broadcast(x64emu_t* emu, pthread_cond_t *pc) } #endif +typedef struct pthread_cond_old_s { + pthread_cond_t* cond; +} pthread_cond_old_t; + +static pthread_cond_t* get_cond(pthread_cond_old_t* cond) { + if(!cond->cond) { + pthread_cond_t* newcond = box_calloc(1, sizeof(pthread_cond_t)); + #ifdef DYNAREC + if(native_lock_storeifnull(&cond->cond, newcond)) + box_free(newcond); + #else + static pthread_mutex_t mutex_cond = PTHREAD_MUTEX_INITIALIZER; + pthread_mutex_lock(&mutex_cond); + if(!cond->cond) + cond->cond = newcond; + else + box_free(newcond); + #endif + } + return cond->cond; +} + +EXPORT int my_pthread_cond_broadcast_old(x64emu_t* emu, pthread_cond_old_t* cond) +{ + (void)emu; + pthread_cond_t * c = get_cond(cond); + return pthread_cond_broadcast(c); +} +EXPORT int my_pthread_cond_destroy_old(x64emu_t* emu, pthread_cond_old_t* cond) +{ + (void)emu; + pthread_cond_t * c = get_cond(cond); + int ret = pthread_cond_destroy(c); + box_free(cond->cond); + return ret; +} +EXPORT int my_pthread_cond_init_old(x64emu_t* emu, pthread_cond_old_t* cond, void* attr) +{ + (void)emu; + pthread_cond_t *c = get_cond(cond); + return pthread_cond_init(c, (const pthread_condattr_t*)attr); +} +EXPORT int my_pthread_cond_signal_old(x64emu_t* emu, pthread_cond_old_t* cond) +{ + (void)emu; + pthread_cond_t * c = get_cond(cond); + return pthread_cond_signal(c); +} +EXPORT int my_pthread_cond_timedwait_old(x64emu_t* emu, pthread_cond_old_t* cond, void* mutex, void* abstime) +{ + (void)emu; + pthread_cond_t * c = get_cond(cond); + return pthread_cond_timedwait(c, mutex, (const struct timespec*)abstime); + #undef T +} +EXPORT int my_pthread_cond_wait_old(x64emu_t* emu, pthread_cond_old_t* cond, void* mutex) +{ + (void)emu; + pthread_cond_t * c = get_cond(cond); + return pthread_cond_wait(c, mutex); +} + typedef union my_barrierattr_s { int x86; pthread_barrierattr_t nat; @@ -1097,6 +1311,10 @@ EXPORT int my_pthread_barrier_init(x64emu_t* emu, pthread_barrier_t* bar, my_bar void init_pthread_helper() { + #ifdef BOX32 + if(box64_is32bits) + init_pthread_helper_32(); + #endif real_pthread_cleanup_push_defer = (vFppp_t)dlsym(NULL, "_pthread_cleanup_push_defer"); real_pthread_cleanup_pop_restore = (vFpi_t)dlsym(NULL, "_pthread_cleanup_pop_restore"); real_pthread_cond_clockwait = (iFppip_t)dlsym(NULL, "pthread_cond_clockwait"); @@ -1109,6 +1327,8 @@ void init_pthread_helper() real_phtread_kill_old = (iFli_t)dlvsym(NULL, "pthread_kill", buff); } } + if(!real_phtread_kill_old) + real_phtread_kill_old = (iFli_t)dlvsym(NULL, "pthread_kill", "GLIBC_2.2.5"); if(!real_phtread_kill_old) { printf_log(LOG_INFO, "Warning, older then 2.34 pthread_kill not found, using current one\n"); real_phtread_kill_old = (iFli_t)pthread_kill; @@ -1129,6 +1349,10 @@ void clean_current_emuthread() void fini_pthread_helper(box64context_t* context) { + #ifdef BOX32 + if(box64_is32bits) + fini_pthread_helper_32(context); + #endif CleanStackSize(context); clean_current_emuthread(); } @@ -1142,3 +1366,16 @@ int checkUnlockMutex(void* m) } return 0; } + +int checkNolockMutex(void* m) +{ + pthread_mutex_t* mutex = (pthread_mutex_t*)m; + int ret = pthread_mutex_trylock(mutex); + if(ret==0) { + pthread_mutex_unlock(mutex); + return 0; + } + if(ret == EDEADLK) + return 1; + return 0; +} diff --git a/src/libtools/threads32.c b/src/libtools/threads32.c new file mode 100755 index 0000000..de5f4c1 --- /dev/null +++ b/src/libtools/threads32.c @@ -0,0 +1,1100 @@ +// __USE_UNIX98 is needed for sttype / gettype definition +#define __USE_UNIX98 +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include + +#include "os.h" +#include "debug.h" +#include "box32context.h" +#include "threads.h" +#include "emu/x64emu_private.h" +#include "tools/bridge_private.h" +#include "x64emu.h" +#include "box64stack.h" +#include "box64cpu.h" +#include "box64cpu_util.h" +#include "callback.h" +#include "custommem.h" +#include "khash.h" +#include "emu/x64run_private.h" +#include "x64trace.h" +#include "bridge.h" +#include "threads32.h" +#include "x64tls.h" +#include "x64_signals.h" +#ifdef DYNAREC +#include "dynablock.h" +#endif + +#ifndef MAP_32BIT +#define MAP_32BIT 0x40 +#endif + +typedef void (*vFppp_t)(void*, void*, void*); +typedef void (*vFpi_t)(void*, int); +typedef int (*iFv_t)(void); +typedef int (*iFLi_t)(unsigned long, int); +//starting with glibc 2.34+, those 2 functions are in libc.so as versioned symbol only +// So use dlsym to get the symbol unversioned, as simple link will not work. +static vFppp_t real_pthread_cleanup_push_defer = NULL; +static vFpi_t real_pthread_cleanup_pop_restore = NULL; +// with glibc 2.34+, pthread_kill changed behaviour and might break some program, so using old version if possible +// it will be pthread_kill@GLIBC_2.0+, need to be found, while it's GLIBC_2.0 on i386 +static iFLi_t real_phtread_kill_old = NULL; +static iFv_t real_pthread_yield = NULL; +// those function can be used simply +void _pthread_cleanup_push(void* buffer, void* routine, void* arg); // declare hidden functions +void _pthread_cleanup_pop(void* buffer, int exec); + +typedef struct threadstack_s { + void* stack; + size_t stacksize; +} threadstack_t; + +// those are define in thread.c +emuthread_t* thread_get_et(); +void thread_set_et(emuthread_t* et); +void emuthread_destroy(void* p); + +static pthread_attr_t* get_attr(void* attr); +static void del_attr(void* attr); + +typedef void(*vFv_t)(); + +KHASH_MAP_INIT_INT(threadstack, threadstack_t) + +void CleanStackSize(box64context_t* context); +void FreeStackSize(uintptr_t attr); +void AddStackSize(uintptr_t attr, void* stack, size_t stacksize); +int GetStackSize(uintptr_t attr, void** stack, size_t* stacksize); + +void my32_longjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p, int32_t __val); + +static void emuthread_cancel(void* p) +{ + emuthread_t *et = (emuthread_t*)p; + if(!et) + return; + // check cancels threads + uintptr_t rax = et->emu->regs[_AX].q[0]; + for(int i=et->cancel_size-1; i>=0; --i) { + et->emu->flags.quitonlongjmp = 0; + et->emu->quit = 0; + my32_longjmp(et->emu, ((i386_unwind_buff_t*)et->cancels[i])->__cancel_jmp_buf, 1); + DynaRun(et->emu); // will return after a __pthread_unwind_next() + } + et->emu->regs[_AX].q[0] = rax; + box_free(et->cancels); + et->cancels=NULL; + et->cancel_size = et->cancel_cap = 0; +} + +static void* pthread_routine(void* p) +{ + // free current emuthread if it exist + { + void* t = thread_get_et(); + if(t) { + // not sure how this could happens + printf_log(LOG_INFO, "Clean of an existing ET for Thread %04d\n", GetTID()); + emuthread_destroy(t); + } + } + // call the function + emuthread_t *et = (emuthread_t*)p; + thread_set_et(et); + et->is32bits = 1; + et->emu->type = EMUTYPE_MAIN; + et->self = (uintptr_t)pthread_self(); + et->hself = to_hash(et->self); + // setup callstack and run... + x64emu_t* emu = et->emu; + refreshTLSData(emu); + Push_32(emu, 0); // PUSH 0 (backtrace marker: return address is 0) + Push_32(emu, 0); // PUSH BP + R_EBP = R_ESP; // MOV BP, SP + R_ESP -= 32; // guard area + R_ESP &=~15; + R_ESP -= 3*4; // prepare alignment + Push_32(emu, to_ptrv(et->arg)); + PushExit_32(emu); + R_EIP = to_ptr(et->fnc); + pthread_cleanup_push(emuthread_cancel, p); + DynaRun(et->emu); + pthread_cleanup_pop(0); + void* ret = from_ptrv(R_EAX); + return ret; +} + +EXPORT int my32_pthread_attr_destroy(x64emu_t* emu, void* attr) +{ + if(my_context->stacksizes) + FreeStackSize((uintptr_t)attr); + int ret = pthread_attr_destroy(get_attr(attr)); + del_attr(attr); + return ret; +} + +EXPORT int my32_pthread_attr_getstack(x64emu_t* emu, void* attr, void** stackaddr, size_t* stacksize) +{ + int ret = pthread_attr_getstack(get_attr(attr), stackaddr, stacksize); + if (ret==0) + GetStackSize((uintptr_t)attr, stackaddr, stacksize); + return ret; +} + +EXPORT int my32_pthread_attr_setstack(x64emu_t* emu, void* attr, void* stackaddr, size_t stacksize) +{ + AddStackSize((uintptr_t)attr, stackaddr, stacksize); + //Don't call actual setstack... + //return pthread_attr_setstack(attr, stackaddr, stacksize); + return pthread_attr_setstacksize(get_attr(attr), stacksize); +} + +EXPORT int my32_pthread_create(x64emu_t *emu, void* t, void* attr, void* start_routine, void* arg) +{ + size_t stacksize = 2*1024*1024; //default stack size is 2Mo + void* attr_stack; + size_t attr_stacksize; + int own; + void* stack = NULL; + pthread_attr_t* my_attr = NULL; + pthread_attr_t actual_attr; + + if(attr) { + size_t stsize; + static size_t minsize = 0; + if(!minsize) { + minsize = PTHREAD_STACK_MIN; + if(minsize<512*1024) minsize = 512*1024; + } + if(pthread_attr_getstacksize(get_attr(attr), &stsize)==0) + stacksize = stsize; + if(stacksize1*1024*1024) + pthread_attr_setstacksize(get_attr(attr), 1*1024*1024); + } else { + my_attr = &actual_attr; + pthread_attr_init(my_attr); + pthread_attr_setstacksize(my_attr, 1*1024*1024); + } + if(GetStackSize((uintptr_t)attr, &attr_stack, &attr_stacksize)) + { + stack = attr_stack; + stacksize = attr_stacksize; + own = 0; + if((uintptr_t)stack>=0x100000000LL) { + printf_log(LOG_INFO, "Address of Stack for thread too high (%p), allocationg a new one\n", stack); + stack = NULL; + } + } + if(!stack) { + //stack = malloc(stacksize); + stack = box_mmap(NULL, stacksize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_32BIT, -1, 0); + setProtection_stack((uintptr_t)stack, stacksize, PROT_READ|PROT_WRITE); + own = 1; + } + + if((uintptr_t)stack>=0x100000000LL) { + if(own) { + box_munmap(stack, stacksize); + freeProtection((uintptr_t)stack, stacksize); + } + return EAGAIN; + } + + emuthread_t *et = (emuthread_t*)box_calloc(1, sizeof(emuthread_t)); + x64emu_t *emuthread = NewX64Emu(my_context, (uintptr_t)start_routine, (uintptr_t)stack, stacksize, own); + SetupX64Emu(emuthread, emu); + et->emu = emuthread; + et->fnc = (uintptr_t)start_routine; + et->arg = arg; + if(!attr) + et->join = 1; + else { + int j; + pthread_attr_getdetachstate(get_attr(attr), &j); + if(j==PTHREAD_CREATE_JOINABLE) + et->join = 1; + else + et->join = 0; + } + #ifdef DYNAREC + if(BOX64ENV(dynarec)) { + // pre-creation of the JIT code for the entry point of the thread + DBGetBlock(emu, (uintptr_t)start_routine, 1, 1); + } + if(BOX64ENV(nodynarec_delay)) { + static int num_threads = 0; + ++num_threads; + if(num_threads==2 && BOX64ENV(nodynarec_start)) { + BOX64ENV(nodynarec_start) = 0; + BOX64ENV(nodynarec_end) = 0; + } + } + #endif + // create thread + int ret = pthread_create((pthread_t*)t, my_attr?my_attr:get_attr(attr), + pthread_routine, et); + if(my_attr) pthread_attr_destroy(my_attr); + return ret; +} + +EXPORT int my32_pthread_detach(x64emu_t* emu, pthread_t p) +{ + if(pthread_equal(p ,pthread_self())) { + emuthread_t *et = (emuthread_t*)thread_get_et(); + if(et) + et->join = 0; + } + return pthread_detach(p); +} + +void* my32_prepare_thread(x64emu_t *emu, void* f, void* arg, int ssize, void** pet) +{ + int stacksize = (ssize)?ssize:(2*1024*1024); //default stack size is 2Mo + //void* stack = malloc(stacksize); + void* stack = mmap64(NULL, stacksize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_32BIT, -1, 0); + emuthread_t *et = (emuthread_t*)box_calloc(1, sizeof(emuthread_t)); + x64emu_t *emuthread = NewX64Emu(emu->context, (uintptr_t)f, (uintptr_t)stack, stacksize, 1); + SetupX64Emu(emuthread, emu); + et->emu = emuthread; + et->fnc = (uintptr_t)f; + et->arg = arg; + #ifdef DYNAREC + if(BOX64ENV(dynarec)) { + // pre-creation of the JIT code for the entry point of the thread + dynablock_t *current = NULL; + DBGetBlock(emu, (uintptr_t)f, 1, 1); + } + #endif + *pet = et; + return pthread_routine; +} + +void my32_longjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p, int32_t __val); + +EXPORT void my32___pthread_register_cancel(x64emu_t* emu, i386_unwind_buff_t* buff) +{ + buff = (i386_unwind_buff_t*)from_ptr(R_EAX); // param is in fact on register + emuthread_t *et = (emuthread_t*)thread_get_et(); + if(et->cancel_cap == et->cancel_size) { + et->cancel_cap+=8; + et->cancels = box_realloc(et->cancels, sizeof(i386_unwind_buff_t*)*et->cancel_cap); + } + et->cancels[et->cancel_size++] = buff; +} + +EXPORT void my32___pthread_unregister_cancel(x64emu_t* emu, i386_unwind_buff_t* buff) +{ + emuthread_t *et = (emuthread_t*)thread_get_et(); + for (int i=et->cancel_size-1; i>=0; --i) { + if(et->cancels[i] == buff) { + if(i!=et->cancel_size-1) + memmove(et->cancels+i, et->cancels+i+1, sizeof(i386_unwind_buff_t*)*(et->cancel_size-i-1)); + et->cancel_size--; + return; + } + } +} + +#define X86_RWLOCK_SIZE 32 +EXPORT int my32_pthread_rwlock_init(void* rdlock, void* attr) +{ + // the structure is bigger, but the "active" part should be the same size, so just save/restoore the padding at init + uint8_t buff[sizeof(pthread_rwlock_t)]; + if(rdlock && sizeof(pthread_rwlock_t)>X86_RWLOCK_SIZE) { + memcpy(buff, rdlock+X86_RWLOCK_SIZE, sizeof(pthread_rwlock_t)-X86_RWLOCK_SIZE); + } + int ret = pthread_rwlock_init(rdlock, attr); + if(rdlock && sizeof(pthread_rwlock_t)>X86_RWLOCK_SIZE) { + memcpy(rdlock+X86_RWLOCK_SIZE, buff, sizeof(pthread_rwlock_t)-X86_RWLOCK_SIZE); + } + return ret; +} +EXPORT int my32___pthread_rwlock_init(void*, void*) __attribute__((alias("my32_pthread_rwlock_init"))); + +EXPORT int my32_pthread_rwlock_destroy(void* rdlock) +{ + // the structure is bigger, but the "active" part should be the same size, so just save/restore the padding at init + uint8_t buff[sizeof(pthread_rwlock_t)]; + if(rdlock && sizeof(pthread_rwlock_t)>X86_RWLOCK_SIZE) { + memcpy(buff, rdlock+X86_RWLOCK_SIZE, sizeof(pthread_rwlock_t)-X86_RWLOCK_SIZE); + } + int ret = pthread_rwlock_destroy(rdlock); + if(rdlock && sizeof(pthread_rwlock_t)>X86_RWLOCK_SIZE) { + memcpy(rdlock+X86_RWLOCK_SIZE, buff, sizeof(pthread_rwlock_t)-X86_RWLOCK_SIZE); + } + return ret; +} + +EXPORT void my32___pthread_unwind_next(x64emu_t* emu, void* p) +{ + emu->quit = 1; +} + +KHASH_MAP_INIT_INT(once, int) + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) \ +GO(5) \ +GO(6) \ +GO(7) \ +GO(8) \ +GO(9) \ +GO(10) \ +GO(11) \ +GO(12) \ +GO(13) \ +GO(14) \ +GO(15) \ +GO(16) \ +GO(17) \ +GO(18) \ +GO(19) \ +GO(20) \ +GO(21) \ +GO(22) \ +GO(23) \ +GO(24) \ +GO(25) \ +GO(26) \ +GO(27) \ +GO(28) \ +GO(29) + +// cleanup_routine +#define GO(A) \ +static uintptr_t my32_cleanup_routine_fct_##A = 0; \ +static void my32_cleanup_routine_##A(void* a) \ +{ \ + RunFunctionFmt(my32_cleanup_routine_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findcleanup_routineFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_cleanup_routine_fct_##A == (uintptr_t)fct) return my32_cleanup_routine_##A; + SUPER() + #undef GO + #define GO(A) if(my32_cleanup_routine_fct_##A == 0) {my32_cleanup_routine_fct_##A = (uintptr_t)fct; return my32_cleanup_routine_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for pthread cleanup_routine callback\n"); + return NULL; +} + +// key_destructor +#define GO(A) \ +static uintptr_t my32_key_destructor_fct_##A = 0; \ +static void my32_key_destructor_##A(void* a) \ +{ \ + RunFunctionFmt(my32_key_destructor_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findkey_destructorFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_key_destructor_fct_##A == (uintptr_t)fct) return my32_key_destructor_##A; + SUPER() + #undef GO + #define GO(A) if(my32_key_destructor_fct_##A == 0) {my32_key_destructor_fct_##A = (uintptr_t)fct; return my32_key_destructor_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for pthread key_destructor callback\n"); + return NULL; +} + +#undef SUPER + + +int EXPORT my32_pthread_once(x64emu_t* emu, int* once, void* cb) +{ + if(*once==1) // quick test first + return 0; + if(__sync_bool_compare_and_swap(once, 0, 2)) { + // make some room and align R_RSP before doing the call (maybe it would be simpler to just use Callback functions) + Push_32(emu, R_EBP); // push rbp + R_EBP = R_ESP; // mov rbp, rsp + R_ESP -= 0x200; + R_ESP &= ~63LL; + DynaCall(emu, (uintptr_t)cb); + R_ESP = R_EBP; // mov rsp, rbp + R_EBP = Pop32(emu); // pop rbp + *once = 1; + __sync_synchronize(); + } else { + // nope, functionis running, wait until it's done + // adding the same workaround as in 64bits version, just in case + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC_COARSE, &ts); + uint64_t t = ts.tv_sec*1000000000LL + ts.tv_nsec; + while(*once!=1) { + sched_yield(); + clock_gettime(CLOCK_MONOTONIC_COARSE, &ts); + if((ts.tv_sec*1000000000LL + ts.tv_nsec)-t>10*1000000LL) // if wait last for more than 10ms, force as completed + *once = 1; + __sync_synchronize(); + } + } + return 0; +} +EXPORT int my32___pthread_once(x64emu_t* emu, void* once, void* cb) __attribute__((alias("my32_pthread_once"))); + +EXPORT int my32_pthread_key_create(x64emu_t* emu, void* key, void* dtor) +{ + return pthread_key_create(key, findkey_destructorFct(dtor)); +} +EXPORT int my32___pthread_key_create(x64emu_t* emu, void* key, void* dtor) __attribute__((alias("my32_pthread_key_create"))); + +// phtread_cond_init with null attr seems to only write 1 (NULL) dword on x64, while it's 48 bytes on ARM. +// Not sure why as sizeof(pthread_cond_init) is 48 on both platform... But Neverwinter Night init seems to rely on that +// What about cond that are statically initialized? +// Note, this is is a versioned function (the pthread_cond_*), and this seems to correspond to an old behaviour + +KHASH_MAP_INIT_INT(mapcond, pthread_cond_t*); + +// should all access to that map be behind a mutex? +kh_mapcond_t *mapcond = NULL; + +static pthread_cond_t* add_cond(void* cond) +{ + if((((uintptr_t)cond)&7)==0) + return cond; + mutex_lock(&my_context->mutex_thread); + khint_t k; + int ret; + pthread_cond_t *c; + k = kh_put(mapcond, mapcond, (uintptr_t)cond, &ret); + if(!ret) + c = kh_value(mapcond, k); // already there... reinit an existing one? + else + c = kh_value(mapcond, k) = (pthread_cond_t*)box_calloc(1, sizeof(pthread_cond_t)); + //*(ptr_t*)cond = to_ptrv(cond); + mutex_unlock(&my_context->mutex_thread); + return c; +} +static pthread_cond_t* get_cond(void* cond) +{ + if((((uintptr_t)cond)&7)==0) + return cond; + pthread_cond_t* ret; + int r; + mutex_lock(&my_context->mutex_thread); + khint_t k = kh_get(mapcond, mapcond, (uintptr_t)cond); + if(k==kh_end(mapcond)) { + printf_log(LOG_DEBUG, "Note: phtread_cond not found, create a new empty one\n"); + ret = (pthread_cond_t*)box_calloc(1, sizeof(pthread_cond_t)); + k = kh_put(mapcond, mapcond, (uintptr_t)cond, &r); + kh_value(mapcond, k) = ret; + //*(ptr_t*)cond = to_ptrv(cond); + //pthread_cond_init(ret, NULL); + memcpy(ret, cond, sizeof(pthread_cond_t)); + } else + ret = kh_value(mapcond, k); + mutex_unlock(&my_context->mutex_thread); + return ret; +} +static void del_cond(void* cond) +{ + if((((uintptr_t)cond)&7)==0) + return; + if(!mapcond) + return; + mutex_lock(&my_context->mutex_thread); + khint_t k = kh_get(mapcond, mapcond, (uintptr_t)cond); + if(k==kh_end(mapcond)) { + box_free(kh_value(mapcond, k)); + kh_del(mapcond, mapcond, k); + } + mutex_unlock(&my_context->mutex_thread); +} + +typedef struct __attribute__((packed, aligned(4))) pthread_cond_2_0_s { + ptr_t cond; // pthread_cond_t* +} pthread_cond_2_0_t; + +static pthread_cond_t* get_cond_old(pthread_cond_2_0_t* cond) { + if(!cond->cond) { + ptr_t newcond = to_ptrv(box_calloc(1, sizeof(pthread_cond_t))); + #ifdef DYNAREC + if(native_lock_storeifnull_d(&cond->cond, newcond)) + box_free(from_ptrv(newcond)); + #else + static pthread_mutex_t mutex_cond = PTHREAD_MUTEX_INITIALIZER; + pthread_mutex_lock(&mutex_cond); + if(!cond->cond) + cond->cond = newcond; + else + box_free(from_ptrv(newcond)); + #endif + } + return from_ptrv(cond->cond); +} + +pthread_mutex_t* getAlignedMutex(pthread_mutex_t* m); + +EXPORT int my32_pthread_cond_broadcast(x64emu_t* emu, void* cond) +{ + pthread_cond_t * c = get_cond(cond); + return pthread_cond_broadcast(c); +} +EXPORT int my32_pthread_cond_broadcast_old(x64emu_t* emu, pthread_cond_2_0_t* cond) +{ + pthread_cond_t * c = get_cond_old(cond); + return pthread_cond_broadcast(c); +} + +EXPORT int my32_pthread_cond_destroy(x64emu_t* emu, void* cond) +{ + pthread_cond_t * c = get_cond(cond); + int ret = pthread_cond_destroy(c); + if(c!=cond) del_cond(cond); + return ret; +} +EXPORT int my32_pthread_cond_destroy_old(x64emu_t* emu, pthread_cond_2_0_t* cond) +{ + pthread_cond_t * c = get_cond_old(cond); + int ret = pthread_cond_destroy(c); + box_free(from_ptrv(cond->cond)); + return ret; +} + +EXPORT int my32_pthread_cond_init(x64emu_t* emu, void* cond, void* attr) +{ + pthread_cond_t *c = add_cond(cond); + return pthread_cond_init(c, (const pthread_condattr_t*)attr); +} +EXPORT int my32_pthread_cond_init_old(x64emu_t* emu, void* cond, pthread_cond_2_0_t* attr) +{ + pthread_cond_t *c = get_cond_old(cond); + return pthread_cond_init(c, (const pthread_condattr_t*)attr); +} + +EXPORT int my32_pthread_cond_signal(x64emu_t* emu, void* cond) +{ + pthread_cond_t * c = get_cond(cond); + return pthread_cond_signal(c); +} +EXPORT int my32_pthread_cond_signal_old(x64emu_t* emu, pthread_cond_2_0_t* cond) +{ + pthread_cond_t * c = get_cond_old(cond); + return pthread_cond_signal(c); +} + +EXPORT int my32_pthread_cond_timedwait_old(x64emu_t* emu, pthread_cond_2_0_t* cond, void* mutex, void* abstime) +{ + pthread_mutex_t* m = getAlignedMutex((pthread_mutex_t*)mutex); + pthread_cond_t * c = get_cond_old(cond); + struct timespec* atime = abstime; + while(atime->tv_nsec>1000000000LL) { + atime->tv_nsec-=1000000000LL; + ++atime->tv_sec; + } + return pthread_cond_timedwait(c, m, atime); +} +EXPORT int my32_pthread_cond_wait_old(x64emu_t* emu, pthread_cond_2_0_t* cond, void* mutex) +{ + pthread_mutex_t* m = getAlignedMutex((pthread_mutex_t*)mutex); + pthread_cond_t * c = get_cond_old(cond); + return pthread_cond_wait(c, m); +} + +EXPORT int my32_pthread_cond_timedwait(x64emu_t* emu, void* cond, void* mutex, void* abstime) +{ + pthread_mutex_t* m = getAlignedMutex((pthread_mutex_t*)mutex); + pthread_cond_t * c = get_cond(cond); + struct timespec* atime = abstime; + while(atime->tv_nsec>1000000000LL) { + atime->tv_nsec-=1000000000LL; + ++atime->tv_sec; + } + return pthread_cond_timedwait(c, m, atime); +} +EXPORT int my32_pthread_cond_wait(x64emu_t* emu, void* cond, void* mutex) +{ + pthread_mutex_t* m = getAlignedMutex((pthread_mutex_t*)mutex); + pthread_cond_t * c = get_cond(cond); + return pthread_cond_wait(c, m); +} + +EXPORT int my32_pthread_mutexattr_setkind_np(x64emu_t* emu, void* t, int kind) +{ + // does "kind" needs some type of translation? + return pthread_mutexattr_settype(t, kind); +} + +// pthread_attr_t on x86 is 36 bytes +static uint64_t ATTR_SIGN = 0xA055E10CDE98LL; // random signature +typedef struct my32_x86_attr_s { + uint64_t sign; + pthread_attr_t* attr; +} my32_x86_attr_t; + +static pthread_attr_t* get_attr(void* attr) +{ + if(!attr) + return NULL; + my32_x86_attr_t* my32_attr = (my32_x86_attr_t*)attr; + if(my32_attr->sign!=ATTR_SIGN) { + my32_attr->attr = (pthread_attr_t*)box_calloc(1, sizeof(pthread_attr_t)); + my32_attr->sign = ATTR_SIGN; + } + return my32_attr->attr; +} +static void del_attr(void* attr) +{ + if(!attr) + return; + my32_x86_attr_t* my32_attr = (my32_x86_attr_t*)attr; + if(my32_attr->sign==ATTR_SIGN) { + my32_attr->sign = 0; + box_free(my32_attr->attr); + } +} + +EXPORT int my32_pthread_attr_init(x64emu_t* emu, void* attr) +{ + my32_x86_attr_t* my32_attr = (my32_x86_attr_t*)attr; + my32_attr->sign = 0; //force init + return pthread_attr_init(get_attr(attr)); +} + +EXPORT int my32_pthread_getattr_np(x64emu_t* emu, uintptr_t th, void* attr) +{ + (void)emu; + int ret = pthread_getattr_np(th, get_attr(attr)); + if(!ret && th==pthread_self()) { + if(!emu->context->stacksizes) { + emu->context->stacksizes = kh_init(threadstack); + } + void* stack = emu->init_stack; + size_t sz = emu->size_stack; + //printf_log(LOG_INFO, "pthread_getattr_np called for self, stack=%p, sz=%lx\n", stack, sz); + if (!sz) { + // get default stack size + pthread_attr_t attr; + pthread_getattr_default_np(&attr); + pthread_attr_getstacksize(&attr, &sz); + pthread_attr_destroy(&attr); + // should stack be adjusted? + } + AddStackSize((uintptr_t)attr, stack, sz); + } + return ret; +} + +EXPORT int my32_pthread_attr_getdetachstate(x64emu_t* emu, void* attr, void* p) +{ + return pthread_attr_getdetachstate(get_attr(attr), p); +} +EXPORT int my32_pthread_attr_getguardsize(x64emu_t* emu, void* attr, void* p) +{ + return pthread_attr_getguardsize(get_attr(attr), p); +} +EXPORT int my32_pthread_attr_getinheritsched(x64emu_t* emu, void* attr, void* p) +{ + return pthread_attr_getinheritsched(get_attr(attr), p); +} +EXPORT int my32_pthread_attr_getschedparam(x64emu_t* emu, void* attr, void* p) +{ + return pthread_attr_getschedparam(get_attr(attr), p); +} +EXPORT int my32_pthread_attr_getschedpolicy(x64emu_t* emu, void* attr, void* p) +{ + return pthread_attr_getschedpolicy(get_attr(attr), p); +} +EXPORT int my32_pthread_attr_getscope(x64emu_t* emu, void* attr, void* p) +{ + return pthread_attr_getscope(get_attr(attr), p); +} +EXPORT int my32_pthread_attr_getstackaddr(x64emu_t* emu, void* attr, ptr_t* p) +{ + size_t size; + void* pp; + int ret = pthread_attr_getstack(get_attr(attr), &pp, &size); + *p = to_ptrv(pp); + return ret; +} +EXPORT int my32_pthread_attr_getstacksize(x64emu_t* emu, void* attr, ulong_t* p) +{ + size_t size; + void* pp; + int ret = pthread_attr_getstack(get_attr(attr), &pp, &size); + *p = to_ulong(size); + return ret; +} +EXPORT int my32_pthread_attr_setdetachstate(x64emu_t* emu, void* attr, int p) +{ + return pthread_attr_setdetachstate(get_attr(attr), p); +} +EXPORT int my32_pthread_attr_setguardsize(x64emu_t* emu, void* attr, size_t p) +{ + return pthread_attr_setguardsize(get_attr(attr), p); +} +EXPORT int my32_pthread_attr_setinheritsched(x64emu_t* emu, void* attr, int p) +{ + return pthread_attr_setinheritsched(get_attr(attr), p); +} +EXPORT int my32_pthread_attr_setschedparam(x64emu_t* emu, void* attr, void* param) +{ + int policy; + pthread_attr_getschedpolicy(get_attr(attr), &policy); + int pmin = sched_get_priority_min(policy); + int pmax = sched_get_priority_max(policy); + if(param) { + int p = *(int*)param; + if(p>=pmin && p<=pmax) + return pthread_attr_setschedparam(get_attr(attr), param); + } + printf_log(LOG_INFO, "Warning, call to pthread_attr_setschedparam(%p, %p[%d]) ignored\n", attr, param, param?(*(int*)param):-1); + return 0; // faking success +} +EXPORT int my32_pthread_attr_setschedpolicy(x64emu_t* emu, void* attr, int p) +{ + return pthread_attr_setschedpolicy(get_attr(attr), p); +} +EXPORT int my32_pthread_attr_setstackaddr(x64emu_t* emu, void* attr, void* p) +{ + size_t size = 2*1024*1024; + void* pp; + GetStackSize((uintptr_t)attr, &pp, &size); + AddStackSize((uintptr_t)attr, p, size); + + return 0; +} +EXPORT int my32_pthread_attr_setstacksize(x64emu_t* emu, void* attr, size_t p) +{ + if(p<0xc000 || (p&4095)) { + errno = EINVAL; + return -1; + } + size_t size; + void* pp = NULL; + GetStackSize((uintptr_t)attr, &pp, &size); + AddStackSize((uintptr_t)attr, pp, p); + // PTHREAD_STACK_MIN on x86 might be lower than the current platform... + if(p>=0xc000 && p<(size_t)PTHREAD_STACK_MIN && !(p&4095)) + p = PTHREAD_STACK_MIN; + return pthread_attr_setstacksize(get_attr(attr), p); +} + + +EXPORT int my32_pthread_attr_setscope(x64emu_t* emu, void* attr, int scope) +{ + if(scope!=PTHREAD_SCOPE_SYSTEM) printf_log(LOG_INFO, "Warning, scope of call to pthread_attr_setscope(...) changed from %d to PTHREAD_SCOPE_SYSTEM\n", scope); + return pthread_attr_setscope(get_attr(attr), PTHREAD_SCOPE_SYSTEM); + //The scope is either PTHREAD_SCOPE_SYSTEM or PTHREAD_SCOPE_PROCESS + // but PTHREAD_SCOPE_PROCESS doesn't seem supported on ARM linux, and PTHREAD_SCOPE_SYSTEM is default +} + +#ifndef ANDROID +EXPORT void my32__pthread_cleanup_push_defer(x64emu_t* emu, void* buffer, void* routine, void* arg) +{ + real_pthread_cleanup_push_defer(buffer, findcleanup_routineFct(routine), arg); +} + +EXPORT void my32__pthread_cleanup_push(x64emu_t* emu, void* buffer, void* routine, void* arg) +{ + _pthread_cleanup_push(buffer, findcleanup_routineFct(routine), arg); +} + +EXPORT void my32__pthread_cleanup_pop_restore(x64emu_t* emu, void* buffer, int exec) +{ + real_pthread_cleanup_pop_restore(buffer, exec); +} + +EXPORT void my32__pthread_cleanup_pop(x64emu_t* emu, void* buffer, int exec) +{ + _pthread_cleanup_pop(buffer, exec); +} + +// getaffinity_np (pthread or attr) hav an "old" version (glibc-2.3.3) that only have 2 args, cpusetsize is omited +EXPORT int my32_pthread_getaffinity_np(x64emu_t* emu, pthread_t thread, int cpusetsize, void* cpuset) +{ + if(cpusetsize>0x1000) { + // probably old version of the function, that didn't have cpusetsize.... + cpuset = from_ptrv(cpusetsize); + cpusetsize = sizeof(cpu_set_t); + } + + int ret = pthread_getaffinity_np(thread, cpusetsize, cpuset); + if(ret<0) { + printf_log(LOG_INFO, "Warning, pthread_getaffinity_np(%p, %d, %p) errored, with errno=%d\n", (void*)thread, cpusetsize, cpuset, errno); + } + + return ret; +} + +EXPORT int my32_pthread_setaffinity_np(x64emu_t* emu, pthread_t thread, int cpusetsize, void* cpuset) +{ + if(cpusetsize>0x1000) { + // probably old version of the function, that didn't have cpusetsize.... + cpuset = from_ptrv(cpusetsize); + cpusetsize = sizeof(cpu_set_t); + } + + int ret = pthread_setaffinity_np(thread, cpusetsize, cpuset); + if(ret<0) { + printf_log(LOG_INFO, "Warning, pthread_setaffinity_np(%p, %d, %p) errored, with errno=%d\n", (void*)thread, cpusetsize, cpuset, errno); + } + + return ret; +} + +EXPORT int my32_pthread_attr_setaffinity_np(x64emu_t* emu, void* attr, uint32_t cpusetsize, void* cpuset) +{ + if(cpusetsize>0x1000) { + // probably old version of the function, that didn't have cpusetsize.... + cpuset = from_ptrv(cpusetsize); + cpusetsize = sizeof(cpu_set_t); + } + + int ret = pthread_attr_setaffinity_np(attr, cpusetsize, cpuset); + if(ret<0) { + printf_log(LOG_INFO, "Warning, pthread_attr_setaffinity_np(%p, %d, %p) errored, with errno=%d\n", attr, cpusetsize, cpuset, errno); + } + + return ret; +} +#endif + +EXPORT int my32_pthread_kill(x64emu_t* emu, void* thread, int sig) +{ + sig = signal_from_x64(sig); + // should ESCHR result be filtered, as this is expected to be the 2.34 behaviour? + (void)emu; + // check for old "is everything ok?" + if(thread==NULL && sig==0) + return pthread_kill(pthread_self(), 0); + #ifdef BAD_PKILL + if(sig==0 && thread!=(void*)pthread_self()) + return get_thread(thread)?0:ESRCH; + #endif + return pthread_kill((pthread_t)thread, sig); +} + +EXPORT int my32_pthread_kill_old(x64emu_t* emu, void* thread, int sig) +{ + sig = signal_from_x64(sig); + // check for old "is everything ok?" + if((thread==NULL) && (sig==0)) + return real_phtread_kill_old(pthread_self(), 0); + #ifdef BAD_PKILL + if(sig==0 && thread!=(void*)pthread_self()) + return get_thread(thread)?0:ESRCH; + #endif + return real_phtread_kill_old((pthread_t)thread, sig); +} + +//EXPORT void my32_pthread_exit(x64emu_t* emu, void* retval) +//{ +// emu->quit = 1; // to be safe +// pthread_exit(retval); +//} + +// TODO: find a better way for mutex. It should be possible to use the actual mutex most of the time, especially for simple ones +// Having the mutex table behind a mutex is far from ideal! + +#include "threads32.h" + +pthread_mutex_t* createNewMutex() +{ + pthread_mutex_t* ret = (pthread_mutex_t*)box32_calloc(1, sizeof(pthread_mutex_t)); + return ret; +} +// init = 0: just get the mutex +// init = 1: get the mutex and init it with optional attr (attr will disallow native mutex) +pthread_mutex_t* getAlignedMutex(pthread_mutex_t* m) +{ + fake_phtread_mutex_t* fake = (fake_phtread_mutex_t*)m; + if(!fake->__lock && !fake->__count && !fake->__owner && !fake->__kind && !fake->i386__kind && !fake->real_mutex) { + printf_log(LOG_DEBUG, " (init t0) ", m); + fake->real_mutex = KIND_SIGN; + } + if(!fake->__lock && !fake->__count && !fake->__owner && !fake->__kind && fake->i386__kind==1 && !fake->real_mutex) { + // recusrive mutex should also work + printf_log(LOG_DEBUG, " (init t1) ", m); + fake->real_mutex = KIND_SIGN; + fake->__kind = 1; + fake->i386__kind = 0; + } + if(fake->real_mutex==KIND_SIGN) { + printf_log(LOG_DEBUG, " (t0: m=%p, l=%d) ", m, fake->__lock); + return m; // type 0 can fit... + } + if(fake->__kind==KIND_SIGN) { + printf_log(LOG_DEBUG, " (m=%p, l=%d) ", from_ptrv(fake->real_mutex), *(int*)from_ptrv(fake->real_mutex)); + return from_ptrv(fake->real_mutex); + } + // this should not appens! + printf_log(LOG_INFO, "Warning, fallback on aligned mutex %p\n", m); + fake->real_mutex = to_ptrv(createNewMutex()); + pthread_mutexattr_t attr = {0}; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, fake->i386__kind); + pthread_mutex_init(from_ptrv(fake->real_mutex), &attr); + pthread_mutexattr_destroy(&attr); + fake->__kind = KIND_SIGN; + printf_log(LOG_DEBUG, " (fb: m=%p) ", from_ptrv(fake->real_mutex)); + return from_ptrv(fake->real_mutex); +} +EXPORT int my32_pthread_mutex_destroy(pthread_mutex_t *m) +{ + fake_phtread_mutex_t* fake = (fake_phtread_mutex_t*)m; + if(fake->real_mutex==KIND_SIGN) { + //TODO: check if that save/restore is actually needed + uint8_t saved[sizeof(pthread_mutex_t)]; + memcpy(saved, fake+1, sizeof(pthread_mutex_t)-24); + int ret = pthread_mutex_destroy(m); + memcpy(fake+1, saved, sizeof(pthread_mutex_t)-24); + return ret; + } + if(fake->__kind!=KIND_SIGN) { + printf_log(LOG_NONE, "Warning, fallback on alligned mutex %p\n", m); + errno = EINVAL; + return -1; + } + pthread_mutex_t *n = from_ptrv(fake->real_mutex); + int ret = pthread_mutex_destroy(n); + box32_free(n); + fake->__kind = fake->i386__kind = -1; + return ret; +} + +EXPORT int my32_pthread_mutexattr_init(x64emu_t* emu, pthread_mutexattr_t* att) +{ + // mutexattr is 4 bytes on x86, but 8 on 64bits platforms... + uint32_t save = att?(((uint32_t*)att)[1]):0; + int ret = pthread_mutexattr_init(att); + if(att) ((uint32_t*)att)[1] = save; + return ret; +} + +EXPORT int my32___pthread_mutex_destroy(pthread_mutex_t *m) __attribute__((alias("my32_pthread_mutex_destroy"))); + +EXPORT int my32_pthread_mutex_init(pthread_mutex_t *m, pthread_mutexattr_t *att) +{ + fake_phtread_mutex_t* fake = (fake_phtread_mutex_t*)m; + /*if(!att) { + fake->__lock = 0; + fake->__count = 0; + fake->i386__kind = 0; + fake->__owner = 0; + fake->real_mutex = KIND_SIGN; + printf_log(LOG_DEBUG, " (init t0) "); + return 0; + }*/ + if(fake->__kind==KIND_SIGN) { + printf_log(LOG_DEBUG, "(reinit %p) ",from_ptrv(fake->real_mutex)); + return pthread_mutex_init(from_ptrv(fake->real_mutex), att); + } + fake->__lock = 0; + fake->__count = 0; + fake->__kind = KIND_SIGN; + fake->real_mutex = to_ptrv(createNewMutex()); + int ret = pthread_mutex_init(from_ptrv(fake->real_mutex), att); + fake->i386__kind = ((struct __pthread_mutex_s*)from_ptrv(fake->real_mutex))->__kind; + printf_log(LOG_DEBUG, "(init t%d %p) ", fake->i386__kind, from_ptrv(fake->real_mutex)); + return ret; +} +EXPORT int my32___pthread_mutex_init(pthread_mutex_t *m, pthread_mutexattr_t *att) __attribute__((alias("my32_pthread_mutex_init"))); + +EXPORT int my32_pthread_mutex_lock(pthread_mutex_t *m) +{ + return pthread_mutex_lock(getAlignedMutex(m)); +} +EXPORT int my32___pthread_mutex_lock(pthread_mutex_t *m) __attribute__((alias("my32_pthread_mutex_lock"))); + +EXPORT int my32_pthread_mutex_timedlock(pthread_mutex_t *m, const struct timespec * t) +{ + return pthread_mutex_timedlock(getAlignedMutex(m), t); +} + +EXPORT int my32_pthread_mutex_trylock(pthread_mutex_t *m) +{ + return pthread_mutex_trylock(getAlignedMutex(m)); +} +EXPORT int my32___pthread_mutex_trylock(pthread_mutex_t *m) __attribute__((alias("my32_pthread_mutex_trylock"))); + +EXPORT int my32_pthread_mutex_unlock(pthread_mutex_t *m) +{ + return pthread_mutex_unlock(getAlignedMutex(m)); +} +EXPORT int my32___pthread_mutex_unlock(pthread_mutex_t *m) __attribute__((alias("my32_pthread_mutex_unlock"))); + +EXPORT int my32_pthread_yield(x64emu_t* emu) +{ + return real_pthread_yield(); +} + +static int done = 0; +void init_pthread_helper_32() +{ + if(done) + return; + done = 1; + real_pthread_cleanup_push_defer = (vFppp_t)dlsym(NULL, "_pthread_cleanup_push_defer"); + real_pthread_cleanup_pop_restore = (vFpi_t)dlsym(NULL, "_pthread_cleanup_pop_restore"); + + // search for older symbol for pthread_kill + { + char buff[50]; + for(int i=0; i<34 && !real_phtread_kill_old; ++i) { + snprintf(buff, 50, "GLIBC_2.%d", i); + real_phtread_kill_old = (iFLi_t)dlvsym(NULL, "pthread_kill", buff); + } + } + if(!real_phtread_kill_old) { + printf_log(LOG_INFO, "Warning, older than 2.34 pthread_kill not found, using current one\n"); + real_phtread_kill_old = (iFLi_t)pthread_kill; + } + // pthread_yield (or sched_yield if not found) + real_pthread_yield = (iFv_t)dlsym(NULL, "pthread_yield"); + if(!real_pthread_yield) + real_pthread_yield = sched_yield; + + mapcond = kh_init(mapcond); +} + +void clean_current_emuthread_32() +{ + emuthread_t *et = (emuthread_t*)thread_get_et(); + if(et) { + emuthread_destroy(et); + thread_set_et(NULL); + } +} + +void fini_pthread_helper_32(box64context_t* context) +{ + if(!done) + return; + done = 0; + //CleanStackSize(context); + pthread_cond_t *cond; + kh_foreach_value(mapcond, cond, + pthread_cond_destroy(cond); + box_free(cond); + ); + kh_destroy(mapcond, mapcond); + mapcond = NULL; + + clean_current_emuthread_32(); +} diff --git a/src/libtools/threads32.h b/src/libtools/threads32.h new file mode 100644 index 0000000..9bdce01 --- /dev/null +++ b/src/libtools/threads32.h @@ -0,0 +1,41 @@ +#ifndef __THREADS_32_H_ +#define __THREADS_32_H_ +#include "box32.h" + +typedef struct fake_pthread_mutext_s { + int __lock; + unsigned int __count; + int __owner; + int i386__kind; + int __kind; + ptr_t real_mutex; +} fake_phtread_mutex_t; +#define KIND_SIGN 0xbad001 + +// longjmp / setjmp +typedef struct jump_buff_i386_s { + uint32_t save_ebx; + uint32_t save_esi; + uint32_t save_edi; + uint32_t save_ebp; + uint32_t save_esp; + uint32_t save_eip; +} jump_buff_i386_t; + +// sigset_t should have the same size on 32bits and 64bits machine (64bits) +typedef struct __attribute__((packed, aligned(4))) __jmp_buf_tag_i386_s { + jump_buff_i386_t __jmpbuf; + int __mask_was_saved; + sigset_t __saved_mask; +} __jmp_buf_tag_i386_t; + +typedef struct i386_unwind_buff_s { + struct { + jump_buff_i386_t __cancel_jmp_buf; + int __mask_was_saved; + } __cancel_jmp_buf[1]; + ptr_t __pad[2]; + ptr_t __pad3; +} __attribute__((packed, aligned(4))) i386_unwind_buff_t; + +#endif //__THREADS_32_H_ \ No newline at end of file diff --git a/src/libtools/vulkanoverlay.c b/src/libtools/vulkanoverlay.c new file mode 100644 index 0000000..9eb4020 --- /dev/null +++ b/src/libtools/vulkanoverlay.c @@ -0,0 +1,940 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "libdl.h" +#include "box64context.h" +#include "debug.h" +#include "x64emu.h" +#include "elfloader.h" +#include "fileutils.h" +#include "emu/x64emu_private.h" +#include "json.h" +#include "callback.h" +#include "bridge.h" +#include "khash.h" +#include "wrapper.h" +#include "alternate.h" +#include "myalign.h" + +#include "vulkanoverlay.h" + +typedef struct my_x64wrapper_s { + void* f; + uintptr_t* x64; +} my_x64wrapper_t; + +KHASH_MAP_INIT_STR(x64wrappers, my_x64wrapper_t) + +typedef struct my_vulkanoverlay_s { + void* handle; // internal my_dlopen handle + const char* lib_name; + struct { + char* name; + char* f; + } * functions; + size_t n_functions; + kh_x64wrappers_t* wrappers; + int idx; +} my_vulkanoverlay_t; + +void* my_dlopen(x64emu_t* emu, const char *filename, int flag); +int my_dlclose(x64emu_t* emu, void *handle); +void* my_dlsym(x64emu_t* emu, void *handle, const char *symbol); + +void* wrapVulkanSymbol(my_vulkanoverlay_t* v, const char* name, uintptr_t x64) +{ + if(!x64) return NULL; + if(!v) return NULL; + if(!v->wrappers) { + printf_log(LOG_INFO, "Warning: Wrapped Vulkan Overlay without Wrappers Hash\n"); + return NULL; + } + const char* rname = NULL; + for(size_t i=0; in_functions && !rname; ++i) + if(!strcmp(name, v->functions[i].f)) + rname = v->functions[i].name; + if(!rname) rname = name; + khint_t k = kh_get(x64wrappers, v->wrappers, name); + if(k==kh_end(v->wrappers)) { + printf_log(LOG_INFO, "Warning, unknown wrapper for %s in Vulkan Overlay\n", rname); + return NULL; + } + *kh_value(v->wrappers, k).x64 = x64; + return kh_value(v->wrappers, k).f; +} + +#define MAXN 4 +static my_vulkanoverlay_t overlays[MAXN] = {0}; + +my_vulkanoverlay_t* getNewVulkanOverlay() +{ + my_vulkanoverlay_t* v = NULL; + for(int i=0; iidx = i; + v->wrappers = kh_init(x64wrappers); + } + } + return v; +} + +void freeVulkanOverlay(my_vulkanoverlay_t* v) +{ + if(!v) return; + if(!v->wrappers) return; + size_t idx = v->idx; + my_x64wrapper_t* w; + kh_cstr_t k; + kh_foreach_ref(v->wrappers, k, w, *w->x64 = 0;); + kh_destroy(x64wrappers, v->wrappers); + box_free((void*)v->lib_name); + v->lib_name = NULL; + v->idx = 0; +} + +#define MAPNAME3(N,M) N##M +#define MAPNAME2(N,M) MAPNAME3(N,M) +#define MAPNAME(N) MAPNAME2(GO_,N) + +#define F1(A, B, N) RunFunctionFmt(my_##A##_fct_##N, B, a) +#define F2(A, B, N) RunFunctionFmt(my_##A##_fct_##N, B, a, b) +#define F3(A, B, N) RunFunctionFmt(my_##A##_fct_##N, B, a, b, c) +#define F4(A, B, N) RunFunctionFmt(my_##A##_fct_##N, B, a, b, c, d) +#define F5(A, B, N) RunFunctionFmt(my_##A##_fct_##N, B, a, b, c, d, e) +#define F6(A, B, N) RunFunctionFmt(my_##A##_fct_##N, B, a, b, c, d, e, f) +#define F7(A, B, N) RunFunctionFmt(my_##A##_fct_##N, B, a, b, c, d, e, f, g) +#define F8(A, B, N) RunFunctionFmt(my_##A##_fct_##N, B, a, b, c, d, e, f, g, h) +#define F9(A, B, N) RunFunctionFmt(my_##A##_fct_##N, B, a, b, c, d, e, f, g, h, i) +#define F10(A, B, N) RunFunctionFmt(my_##A##_fct_##N, B, a, b, c, d, e, f, g, h, i, j) +#define F11(A, B, N) RunFunctionFmt(my_##A##_fct_##N, B, a, b, c, d, e, f, g, h, i, j, k) +#define F15(A, B, N) RunFunctionFmt(my_##A##_fct_##N, B, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) + +#define GO_vFp(A, B, N) static void my_##A##_##N(void* a) {F1(A, #B +2, N);} +#define GO_vFpi(A, B, N) static void my_##A##_##N(void* a, int b) {F2(A, #B +2, N);} +#define GO_vFpp(A, B, N) static void my_##A##_##N(void* a, void* b) {F2(A, #B +2, N);} +#define GO_vFpf(A, B, N) static void my_##A##_##N(void* a, float b) {F2(A, #B +2, N);} +#define GO_vFpu(A, B, N) static void my_##A##_##N(void* a, uint32_t b) {F2(A, #B +2, N);} +#define GO_vFpU(A, B, N) static void my_##A##_##N(void* a, uint64_t b) {F2(A, #B +2, N);} +#define GO_vFpip(A, B, N) static void my_##A##_##N(void* a, int b, void* c) {F3(A, #B +2, N);} +#define GO_vFppi(A, B, N) static void my_##A##_##N(void* a, void* b, int c) {F3(A, #B +2, N);} +#define GO_vFppp(A, B, N) static void my_##A##_##N(void* a, void* b, void* c) {F3(A, #B +2, N);} +#define GO_vFpff(A, B, N) static void my_##A##_##N(void* a, float b, float c) {F3(A, #B +2, N);} +#define GO_vFpiU(A, B, N) static void my_##A##_##N(void* a, int b, uint64_t c) {F3(A, #B +2, N);} +#define GO_vFpUi(A, B, N) static void my_##A##_##N(void* a, uint64_t b, int c) {F3(A, #B +2, N);} +#define GO_vFppU(A, B, N) static void my_##A##_##N(void* a, void* b, uint64_t c) {F3(A, #B +2, N);} +#define GO_vFpup(A, B, N) static void my_##A##_##N(void* a, uint32_t b, void* c) {F3(A, #B +2, N);} +#define GO_vFpUp(A, B, N) static void my_##A##_##N(void* a, uint64_t b, void* c) {F3(A, #B +2, N);} +#define GO_vFpUf(A, B, N) static void my_##A##_##N(void* a, uint64_t b, float c) {F3(A, #B +2, N);} +#define GO_vFpUU(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint64_t c) {F3(A, #B +2, N);} +#define GO_vFpUu(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint32_t c) {F3(A, #B +2, N);} +#define GO_vFpuu(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint32_t c) {F3(A, #B +2, N);} +#define GO_vFpuW(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint16_t c) {F3(A, #B +2, N);} +#define GO_vFpipp(A, B, N) static void my_##A##_##N(void* a, int b, void* c, void* d) {F4(A, #B +2, N);} +#define GO_vFpppp(A, B, N) static void my_##A##_##N(void* a, void* b, void* c, void* d) {F4(A, #B +2, N);} +#define GO_vFpfff(A, B, N) static void my_##A##_##N(void* a, float b, float c, float d) {F4(A, #B +2, N);} +#define GO_vFpiup(A, B, N) static void my_##A##_##N(void* a, int b, uint32_t c, void* d) {F4(A, #B +2, N);} +#define GO_vFppLp(A, B, N) static void my_##A##_##N(void* a, void* b, size_t c, void* d) {F4(A, #B +2, N);} +#define GO_vFpupp(A, B, N) static void my_##A##_##N(void* a, uint32_t b, void* c, void* d) {F4(A, #B +2, N);} +#define GO_vFpUpp(A, B, N) static void my_##A##_##N(void* a, uint64_t b, void* c, void* d) {F4(A, #B +2, N);} +#define GO_vFpiUu(A, B, N) static void my_##A##_##N(void* a, int b, uint64_t c, uint32_t d) {F4(A, #B +2, N);} +#define GO_vFpUUi(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint64_t c, int d) {F4(A, #B +2, N);} +#define GO_vFpuup(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint32_t c, void* d) {F4(A, #B +2, N);} +#define GO_vFpUup(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint32_t c, void* d) {F4(A, #B +2, N);} +#define GO_vFpUUp(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint64_t c, void* d) {F4(A, #B +2, N);} +#define GO_vFpUUu(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint64_t c, uint32_t d) {F4(A, #B +2, N);} +#define GO_vFpUuu(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint32_t c, uint32_t d) {F4(A, #B +2, N);} +#define GO_vFpuuu(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint32_t c, uint32_t d) {F4(A, #B +2, N);} +#define GO_vFpippp(A, B, N) static void my_##A##_##N(void* a, int b, void* c, void* d, void* e) {F5(A, #B +2, N);} +#define GO_iFpUiUi(A, B, N) static void my_##A##_##N(void* a, uint64_t b, int c, uint64_t d, int e) {F5(A, #B +2, N);} +#define GO_vFpiUUp(A, B, N) static void my_##A##_##N(void* a, int b, uint64_t c, uint64_t d, void* e) {F5(A, #B +2, N);} +#define GO_vFpiUUu(A, B, N) static void my_##A##_##N(void* a, int b, uint64_t c, uint64_t d, uint32_t e) {F5(A, #B +2, N);} +#define GO_vFpupup(A, B, N) static void my_##A##_##N(void* a, uint32_t b, void* c, uint32_t d, void* e) {F5(A, #B +2, N);} +#define GO_vFpuupp(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint32_t c, void* d, void* e) {F5(A, #B +2, N);} +#define GO_vFpUUUi(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint64_t c, uint64_t d, int e) {F5(A, #B +2, N);} +#define GO_vFpUUUp(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint64_t c, uint64_t d, void* e) {F5(A, #B +2, N);} +#define GO_vFpuuup(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint32_t c, uint32_t d, void* e) {F5(A, #B +2, N);} +#define GO_vFpUUup(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint64_t c, uint32_t d, void* e) {F5(A, #B +2, N);} +#define GO_vFpuuuu(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint32_t c, uint32_t d, uint32_t e) {F5(A, #B +2, N);} +#define GO_vFpUuuu(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint32_t c, uint32_t d, uint32_t e) {F5(A, #B +2, N);} +#define GO_vFpUUUu(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint64_t c, uint64_t d, uint32_t e) {F5(A, #B +2, N);} +#define GO_vFpUUuu(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint64_t c, uint32_t d, uint32_t e) {F5(A, #B +2, N);} +#define GO_vFpuiiii(A, B, N) static void my_##A##_##N(void* a, uint32_t b, int c, int d, int e, int f) {F6(A, #B +2, N);} +#define GO_vFpupppp(A, B, N) static void my_##A##_##N(void* a, uint32_t b, void* c, void* d, void* e, void* f) {F6(A, #B +2, N);} +#define GO_vFpppppU(A, B, N) static void my_##A##_##N(void* a, void* b, void* c, void* d, void* e, uint64_t f) {F6(A, #B +2, N);} +#define GO_vFpUipup(A, B, N) static void my_##A##_##N(void* a, uint64_t b, int c, void* d, uint32_t e, void* f) {F6(A, #B +2, N);} +#define GO_vFpUiUup(A, B, N) static void my_##A##_##N(void* a, uint64_t b, int c, uint64_t d, uint32_t e, void* f) {F6(A, #B +2, N);} +#define GO_vFpuuppp(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint32_t c, void* d, void* e, void* f) {F6(A, #B +2, N);} +#define GO_vFpiUuup(A, B, N) static void my_##A##_##N(void* a, int b, uint64_t c, uint32_t d, uint32_t e, void* f) {F6(A, #B +2, N);} +#define GO_vFpUUiup(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint64_t c, int d, uint32_t e, void* f) {F6(A, #B +2, N);} +#define GO_vFpupiUu(A, B, N) static void my_##A##_##N(void* a, uint32_t b, void* c, int d, uint64_t e, uint32_t f) {F6(A, #B +2, N);} +#define GO_vFpuuuiu(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint32_t c, uint32_t d, int e, uint32_t f) {F6(A, #B +2, N);} +#define GO_vFpUuuup(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint32_t c, uint32_t d, uint32_t e, void* f) {F6(A, #B +2, N);} +#define GO_vFpupuuu(A, B, N) static void my_##A##_##N(void* a, uint32_t b, void* c, uint32_t d, uint32_t e, uint32_t f) {F6(A, #B +2, N);} +#define GO_vFpUiUiup(A, B, N) static void my_##A##_##N(void* a, uint64_t b, int c, uint64_t d, int e, uint32_t f, void* g) {F7(A, #B +2, N);} +#define GO_vFpuupppp(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint32_t c, void* d, void* e, void* f, void* g) {F7(A, #B +2, N);} +#define GO_vFppUuupp(A, B, N) static void my_##A##_##N(void* a, void* b, uint64_t c, uint32_t d, uint32_t e, void* f, void* g) {F7(A, #B +2, N);} +#define GO_vFpUuuUip(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint32_t c, uint32_t d, uint64_t e, int f, void* g) {F7(A, #B +2, N);} +#define GO_vFpupuuup(A, B, N) static void my_##A##_##N(void* a, uint32_t b, void* c, uint32_t d, uint32_t e, uint32_t f, void* g) {F7(A, #B +2, N);} +#define GO_vFpuuuuuu(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint32_t c, uint32_t d, uint32_t e, uint32_t f, uint32_t g) {F7(A, #B +2, N);} +#define GO_vFpuuUUuu(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint32_t c, uint64_t d, uint64_t e, uint32_t f, uint32_t g) {F7(A, #B +2, N);} +#define GO_vFpUUUUuu(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint64_t c, uint64_t d, uint64_t e, uint32_t f, uint32_t g) {F7(A, #B +2, N);} +#define GO_vFpiiiuipp(A, B, N) static void my_##A##_##N(void* a, int b, int c, int d, uint32_t e, int f, void* g, void* h) {F8(A, #B +2, N);} +#define GO_vFpUiUiupi(A, B, N) static void my_##A##_##N(void* a, uint64_t b, int c, uint64_t d, int e, uint32_t f, void* g, int h) {F8(A, #B +2, N);} +#define GO_vFpiUuupup(A, B, N) static void my_##A##_##N(void* a, int b, uint64_t c, uint32_t d, uint32_t e, void* f, uint32_t g, void* h) {F8(A, #B +2, N);} +#define GO_vFpuiULipp(A, B, N) static void my_##A##_##N(void* a, uint32_t b, int c, uint64_t d, size_t e, int f, void* g, void* h) {F8(A, #B +2, N);} +#define GO_vFpppppuuu(A, B, N) static void my_##A##_##N(void* a, void* b, void* c, void* d, void* e, uint32_t f, uint32_t g, uint32_t h) {F8(A, #B +2, N);} +#define GO_vFpUuuUUUu(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint32_t c, uint32_t d, uint64_t e, uint64_t f, uint64_t g, uint32_t h) {F8(A, #B +2, N);} +#define GO_vFppUUuUUUU(A, B, N) static void my_##A##_##N(void* a, void* b, uint64_t c, uint64_t d, uint32_t e, uint64_t f, uint64_t g, uint64_t h, uint64_t i) {F9(A, #B +2, N);} +#define GO_vFpuuuupupup(A, B, N) static void my_##A##_##N(void* a, uint32_t b, uint32_t c, uint32_t d, uint32_t e, void* f, uint32_t g, void* h, uint32_t i, void* j) {F10(A, #B +2, N);} +#define GO_vFpupuuupupup(A, B, N) static void my_##A##_##N(void* a, uint32_t b, void* c, uint32_t d, uint32_t e, uint32_t f, void* g, uint32_t h, void* i, uint32_t j, void* k) {F11(A, #B +2, N);} +#define GO_vFpUUUUUUUUUUUuuu(A, B, N) static void my_##A##_##N(void* a, uint64_t b, uint64_t c, uint64_t d, uint64_t e, uint64_t f, uint64_t g, uint64_t h, uint64_t i, uint64_t j, uint64_t k, uint64_t l, uint32_t m, uint32_t n, uint32_t o) {F15(A, #B +2, N);} +#define GO_iFp(A, B, N) static int my_##A##_##N(void* a) {return (int)F1(A, #B +2, N);} +#define GO_iFpp(A, B, N) static int my_##A##_##N(void* a, void* b) {return (int)F2(A, #B +2, N);} +#define GO_iFpu(A, B, N) static int my_##A##_##N(void* a, uint32_t b) {return (int)F2(A, #B +2, N);} +#define GO_iFpU(A, B, N) static int my_##A##_##N(void* a, uint64_t b) {return (int)F2(A, #B +2, N);} +#define GO_iFpip(A, B, N) static int my_##A##_##N(void* a, int b, void* c) {return (int)F3(A, #B +2, N);} +#define GO_iFppp(A, B, N) static int my_##A##_##N(void* a, void* b, void* c) {return (int)F3(A, #B +2, N);} +#define GO_iFpiU(A, B, N) static int my_##A##_##N(void* a, int b, uint64_t c) {return (int)F3(A, #B +2, N);} +#define GO_iFppU(A, B, N) static int my_##A##_##N(void* a, void* b, uint64_t c) {return (int)F3(A, #B +2, N);} +#define GO_iFpup(A, B, N) static int my_##A##_##N(void* a, uint32_t b, void* c) {return (int)F3(A, #B +2, N);} +#define GO_iFpUp(A, B, N) static int my_##A##_##N(void* a, uint64_t b, void* c) {return (int)F3(A, #B +2, N);} +#define GO_iFpUu(A, B, N) static int my_##A##_##N(void* a, uint64_t b, uint32_t c) {return (int)F3(A, #B +2, N);} +#define GO_iFpUU(A, B, N) static int my_##A##_##N(void* a, uint64_t b, uint64_t c) {return (int)F3(A, #B +2, N);} +#define GO_iFpiip(A, B, N) static int my_##A##_##N(void* a, int b, int c, void* d) {return (int)F4(A, #B +2, N);} +#define GO_iFpipp(A, B, N) static int my_##A##_##N(void* a, int b, void* c, void* d) {return (int)F4(A, #B +2, N);} +#define GO_iFpppp(A, B, N) static int my_##A##_##N(void* a, void* b, void* c, void* d) {return (int)F4(A, #B +2, N);} +#define GO_iFppip(A, B, N) static int my_##A##_##N(void* a, void* b, int c, void* d) {return (int)F4(A, #B +2, N);} +#define GO_iFpiup(A, B, N) static int my_##A##_##N(void* a, int b, uint32_t c, void* d) {return (int)F4(A, #B +2, N);} +#define GO_iFpUip(A, B, N) static int my_##A##_##N(void* a, uint64_t b, int c, void* d) {return (int)F4(A, #B +2, N);} +#define GO_iFppup(A, B, N) static int my_##A##_##N(void* a, void* b, uint32_t c, void* d) {return (int)F4(A, #B +2, N);} +#define GO_iFpupp(A, B, N) static int my_##A##_##N(void* a, uint32_t b, void* c, void* d) {return (int)F4(A, #B +2, N);} +#define GO_iFpUpp(A, B, N) static int my_##A##_##N(void* a, uint64_t b, void* c, void* d) {return (int)F4(A, #B +2, N);} +#define GO_iFpULp(A, B, N) static int my_##A##_##N(void* a, uint64_t b, size_t c, void* d) {return (int)F4(A, #B +2, N);} +#define GO_iFpuUp(A, B, N) static int my_##A##_##N(void* a, uint32_t b, uint64_t c, void* d) {return (int)F4(A, #B +2, N);} +#define GO_iFpupU(A, B, N) static int my_##A##_##N(void* a, uint32_t b, void* c, uint64_t d) {return (int)F4(A, #B +2, N);} +#define GO_iFpUup(A, B, N) static int my_##A##_##N(void* a, uint64_t b, uint32_t c, void* d) {return (int)F4(A, #B +2, N);} +#define GO_iFpUUu(A, B, N) static int my_##A##_##N(void* a, uint64_t b, uint64_t c, uint32_t d) {return (int)F4(A, #B +2, N);} +#define GO_iFpUUU(A, B, N) static int my_##A##_##N(void* a, uint64_t b, uint64_t c, uint64_t d) {return (int)F4(A, #B +2, N);} +#define GO_iFppppp(A, B, N) static int my_##A##_##N(void* a, void* b, void* c, void* d, void* e) {return (int)F5(A, #B +2, N);} +#define GO_iFpuppp(A, B, N) static int my_##A##_##N(void* a, uint32_t b, void* c, void* d, void* e) {return (int)F5(A, #B +2, N);} +#define GO_iFpUupp(A, B, N) static int my_##A##_##N(void* a, uint64_t b, uint32_t c, void* d, void* e) {return (int)F5(A, #B +2, N);} +#define GO_iFpiUUU(A, B, N) static int my_##A##_##N(void* a, int b, uint64_t c, uint64_t d, uint64_t e) {return (int)F5(A, #B +2, N);} +#define GO_iFpupuU(A, B, N) static int my_##A##_##N(void* a, uint32_t b, void* c, uint32_t d, uint64_t e) {return (int)F5(A, #B +2, N);} +#define GO_iFpUiipp(A, B, N) static int my_##A##_##N(void* a, uint64_t b, int c, int d, void* e, void* f) {return (int)F6(A, #B +2, N);} +#define GO_iFpUuuLp(A, B, N) static int my_##A##_##N(void* a, uint64_t b, uint32_t c, uint32_t d, size_t e, void* f) {return (int)F6(A, #B +2, N);} +#define GO_iFpUUUup(A, B, N) static int my_##A##_##N(void* a, uint64_t b, uint64_t c, uint64_t d, uint32_t e, void* f) {return (int)F6(A, #B +2, N);} +#define GO_iFpUUUUp(A, B, N) static int my_##A##_##N(void* a, uint64_t b, uint64_t c, uint64_t d, uint64_t e, void* f) {return (int)F6(A, #B +2, N);} +#define GO_iFpiiiuup(A, B, N) static int my_##A##_##N(void* a, int b, int c, int d, uint32_t e, uint32_t f, void* g) {return (int)F7(A, #B +2, N);} +#define GO_iFpupiLpL(A, B, N) static int my_##A##_##N(void* a, uint32_t b, void* c, int d, size_t e, void* f, size_t g) {return (int)F7(A, #B +2, N);} +#define GO_iFpiiiuuup(A, B, N) static int my_##A##_##N(void* a, int b, int c, int d, uint32_t e, uint32_t f, uint32_t g, void* h) {return (int)F8(A, #B +2, N);} +#define GO_iFpUuuLpUu(A, B, N) static int my_##A##_##N(void* a, uint64_t b, uint32_t c, uint32_t d, size_t e, void* f, uint64_t g, uint32_t h) {return (int)F8(A, #B +2, N);} +#define GO_uFpp(A, B, N) static uint32_t my_##A##_##N(void* a, void* b) {return (uint32_t)F2(A, #B +2, N);} +#define GO_uFpU(A, B, N) static uint32_t my_##A##_##N(void* a, uint64_t b) {return (uint32_t)F2(A, #B +2, N);} +#define GO_uFpup(A, B, N) static uint32_t my_##A##_##N(void* a, uint32_t b, void* c) {return (uint32_t)F3(A, #B +2, N);} +#define GO_uFpupp(A, B, N) static uint32_t my_##A##_##N(void* a, uint32_t b, void* c, void* d) {return (uint32_t)F4(A, #B +2, N);} +#define GO_uFpubp(A, B, N) static uint32_t my_##A##_##N(void* a, uint32_t b, void* c, void* d) {return (uint32_t)F4(A, #B +2, N);} +#define GO_UFpp(A, B, N) static uint64_t my_##A##_##N(void* a, void* b) {return (uint64_t)F2(A, #B +2, N);} +#define GO_UFpu(A, B, N) static uint64_t my_##A##_##N(void* a, uint32_t b) {return (uint64_t)F2(A, #B +2, N);} +#define GO_UFpUui(A, B, N) static uint64_t my_##A##_##N(void* a, uint64_t b, uint32_t c, int d) {return (uint64_t)F4(A, #B +2, N);} + +#define SUPER(A, B, C, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +B(A, C, N) + +#define DATA(A, B) +#define GO2(A, B, C) error TODO +#define GOM(A, B) +#define GO(A, B) \ +SUPER(A, MAPNAME(B), B, 0) \ +SUPER(A, MAPNAME(B), B, 1) \ +SUPER(A, MAPNAME(B), B, 2) \ +SUPER(A, MAPNAME(B), B, 3) \ +static uintptr_t* my_##A##_fcts[MAXN] = {&my_##A##_fct_0, &my_##A##_fct_1, &my_##A##_fct_2,&my_##A##_fct_3}; \ +static void* my_##A##_wrps[MAXN] = {my_##A##_0, my_##A##_1, my_##A##_2, my_##A##_3}; + +#include "wrapped/wrappedvulkan_private.h" + +#undef GO +#undef GOM +#undef GO2 +#undef DATA +#undef SUPER +#undef MAPNAME +#undef MAPNAME2 +#undef MAPNAME3 +#undef F14 +#undef F11 +#undef F10 +#undef F9 +#undef F8 +#undef F7 +#undef F6 +#undef F5 +#undef F4 +#undef F3 +#undef F2 + +typedef struct my_VkAllocationCallbacks_s { + void* pUserData; + void* pfnAllocation; + void* pfnReallocation; + void* pfnFree; + void* pfnInternalAllocation; + void* pfnInternalFree; +} my_VkAllocationCallbacks_t; + +static void bridge_VkAllocationCallbacks(my_VkAllocationCallbacks_t* src) +{ + if(!src) return; + if(src->pfnAllocation) AddAutomaticBridge(my_context->system, pFpLLi, src->pfnAllocation, 0, "vulkan_Allocation"); + if(src->pfnReallocation) AddAutomaticBridge(my_context->system, pFppLLi, src->pfnReallocation, 0, "vulkan_Reallocation"); + if(src->pfnFree) AddAutomaticBridge(my_context->system, vFpp, src->pfnFree, 0, "vulkan_Free"); + if(src->pfnInternalAllocation) AddAutomaticBridge(my_context->system, pFpLii, src->pfnInternalAllocation, 0, "vulkan_InternalAllocation"); + if(src->pfnInternalFree) AddAutomaticBridge(my_context->system, pFpLii, src->pfnInternalFree, 0, "vulkan_InternalFree"); +} + +typedef struct my_VkStruct_s { + int sType; + struct my_VkStruct_s* pNext; +} my_VkStruct_t; + +typedef struct my_VkDebugReportCallbackCreateInfoEXT_s { + int sType; + const void* pNext; + int flags; + void* pfnCallback; + void* pUserData; +} my_VkDebugReportCallbackCreateInfoEXT_t; + +typedef struct my_VkDebugUtilsMessengerCreateInfoEXT_s { + int sType; + const void* pNext; + int flags; + int messageSeverity; + int messageType; + void* pfnUserCallback; + void* pUserData; +} my_VkDebugUtilsMessengerCreateInfoEXT_t; + +typedef struct my_VkLayerInstanceLink_s { + struct my_VkLayerInstanceLink_s* pNext; + void* pfnNextGetInstanceProcAddr; + void* pfnNextGetPhysicalDeviceProcAddr; +} my_VkLayerInstanceLink_t; + +typedef struct my_VkNegotiateLayerInterface_s { + int sType; + void* pNext; + uint32_t loaderLayerInterfaceVersion; + void* pfnGetInstanceProcAddr; + void* pfnGetDeviceProcAddr; + void* pfnGetPhysicalDeviceProcAddr; +} my_VkNegotiateLayerInterface_t; + +typedef struct my_VkLayerInstanceCreateInfo_s { + int sType; // VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO + const void* pNext; + int function; + union { + my_VkLayerInstanceLink_t* pLayerInfo; + void* pfnSetInstanceLoaderData; //iFpp + struct { + void* pfnLayerCreateDevice; //iFppppppp (many callback, but should be ok) + void* pfnLayerDestroyDevice; //vFppp + } layerDevice; + uint32_t loaderFeatures; + } u; +} my_VkLayerInstanceCreateInfo_t; + +typedef struct my_VkLayerDeviceLink_s { + struct my_VkLayerDeviceLink_s* pNext; + void* pfnNextGetInstanceProcAddr; + void* pfnNextGetDeviceProcAddr; +} my_VkLayerDeviceLink_t; + +typedef struct my_VkLayerDeviceCreateInfo_s { + int sType; // VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO + const void* pNext; + int function; + union { + my_VkLayerDeviceLink_t* pLayerInfo; + void* pfnSetDeviceLoaderData; //iFpp + } u; +} my_VkLayerDeviceCreateInfo_t; + +void* my_GetVkProcAddr2(x64emu_t* emu, void* a, void* name, void*(*getaddr)(void* a, const char*)); +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) \ +GO(5) \ +GO(6) \ +GO(7) + +#define GO(N) \ +static void* my_getVkXXXXProcAddr_fct_##N = NULL; \ +static void* my_getVkXXXXProcAddr_##N(void* a, const char* b) \ +{ \ + return my_GetVkProcAddr2(thread_get_emu(), a, (void*)b, my_getVkXXXXProcAddr_fct_##N); \ +} +SUPER() +#undef GO +static void addAutoBridgeVkProcAddr(void* f) +{ + if(!f) return; + #define GO(N) if(my_getVkXXXXProcAddr_fct_##N==f) return; + SUPER() + #undef GO + #define GO(N) if(!my_getVkXXXXProcAddr_fct_##N) { \ + my_getVkXXXXProcAddr_fct_##N = f; \ + AddAutomaticBridgeAlt(my_context->system, pFpp, f, my_getVkXXXXProcAddr_##N, 0, "vulkan_layer_getinstanceprocaddr");\ + return; \ + } + SUPER() + #undef GO + printf_log(LOG_INFO, "Warning, no more slot for addAutoBridgeVkProcAddr\n"); +} +#undef SUPER + +void addBridgeVkLayerDeviceLink(my_VkLayerDeviceLink_t* p) { + while(p) { + addAutoBridgeVkProcAddr(p->pfnNextGetInstanceProcAddr); + addAutoBridgeVkProcAddr(p->pfnNextGetDeviceProcAddr); + p = p->pNext; + } +} +void addBridgeVkLayerInstanceLink(my_VkLayerInstanceLink_t* p) { + while(p) { + addAutoBridgeVkProcAddr(p->pfnNextGetInstanceProcAddr); + addAutoBridgeVkProcAddr(p->pfnNextGetPhysicalDeviceProcAddr); + p = p->pNext; + } +} + + +#define VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT 1000011000 +#define VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT 1000128004 +#define VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO 47 +#define VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO 48 +static void addBridgeCreateInfo(my_VkStruct_t* p) +{ + while(p) { + if(p->sType==VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT) { + my_VkDebugReportCallbackCreateInfoEXT_t* vk = (my_VkDebugReportCallbackCreateInfoEXT_t*)p; + AddAutomaticBridge(my_context->system, iFiiULippp, vk->pfnCallback, 0, "vulkan_debug"); + } else if(p->sType==VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT) { + my_VkDebugUtilsMessengerCreateInfoEXT_t* vk = (my_VkDebugUtilsMessengerCreateInfoEXT_t*)p; + AddAutomaticBridge(my_context->system, iFiipp, vk->pfnUserCallback, 0, "vulkan_debug"); + } else if(p->sType==VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO) { + my_VkLayerDeviceCreateInfo_t* vk = (my_VkLayerDeviceCreateInfo_t*)p; + switch(vk->function) { + case 0: + addBridgeVkLayerDeviceLink(vk->u.pLayerInfo); + break; + case 1: + AddAutomaticBridge(my_context->system, iFpp, vk->u.pfnSetDeviceLoaderData, 0, "vulkan_layer_setdeviceloaderdata"); + break; + } + } else if(p->sType==VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO) { + my_VkLayerInstanceCreateInfo_t* vk = (my_VkLayerInstanceCreateInfo_t*)p; + switch(vk->function) { + case 0: addBridgeVkLayerInstanceLink(vk->u.pLayerInfo); break; + case 1: AddAutomaticBridge(my_context->system, iFpp, vk->u.pfnSetInstanceLoaderData, 0, "vulkan_layer_setinstanceloaderdata"); break; + case 2: + AddAutomaticBridge(my_context->system, iFppppppp, vk->u.layerDevice.pfnLayerCreateDevice, 0, "vulkan_layer_createdevice"); + AddAutomaticBridge(my_context->system, vFppp, vk->u.layerDevice.pfnLayerDestroyDevice, 0, "vulkan_layer_destroydevice"); + break; + } + } + p = p->pNext; + } +} + +typedef struct my_VkXcbSurfaceCreateInfoKHR_s { + int sType; + const void* pNext; + uint32_t flags; + void** connection; + int window; +} my_VkXcbSurfaceCreateInfoKHR_t; + +#define SUPER(A) \ +GO(A, 0) \ +GO(A, 1) \ +GO(A, 2) \ +GO(A, 3) \ +static uintptr_t* my_##A##_fcts[MAXN] = {&my_##A##_fct_0, &my_##A##_fct_1, &my_##A##_fct_2,&my_##A##_fct_3}; \ +static void* my_##A##_wrps[MAXN] = {my_##A##_0, my_##A##_1, my_##A##_2, my_##A##_3}; + +//vkGetInstanceProcAddr +#define GO(B, A) \ +static uintptr_t my_vkGetInstanceProcAddr_fct_##A = 0; \ +static void* my_vkGetInstanceProcAddr_##A(void* a, void* b) \ +{ \ + printf_dlsym(LOG_DEBUG, "my_vkGetInstanceProcAddr_%d(%p, %s) =>", A, a, b); \ + uintptr_t addr = RunFunctionFmt(my_vkGetInstanceProcAddr_fct_##A, "pp", a, b); \ + printf_dlsym_prefix(0, LOG_DEBUG, " %p =>", (void*)addr); \ + void* ret = wrapVulkanSymbol(&overlays[A], b, addr); \ + printf_dlsym_prefix(0, LOG_DEBUG, " %p\n", ret); \ + return ret; \ +} +SUPER(vkGetInstanceProcAddr) +#undef GO +//vkGetDeviceProcAddr +#define GO(B, A) \ +static uintptr_t my_vkGetDeviceProcAddr_fct_##A = 0; \ +static void* my_vkGetDeviceProcAddr_##A(void* a, void* b) \ +{ \ + printf_dlsym(LOG_DEBUG, "my_vkGetDeviceProcAddr_%d(%p, %s)\n", A, a, b); \ + return wrapVulkanSymbol(&overlays[A], b, RunFunctionFmt(my_vkGetDeviceProcAddr_fct_##A, "pp", a, b)); \ +} +SUPER(vkGetDeviceProcAddr) +#undef GO +// All the CREATE +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static void* my_##A##_##N(void* a, void* b, my_VkAllocationCallbacks_t* c, void* d) \ +{ \ + bridge_VkAllocationCallbacks(c); \ + return (void*)RunFunctionFmt(my_##A##_fct_##N, "pppp", a, b, c, d); \ +} +#define CREATE(A) SUPER(A) +CREATE(vkAllocateMemory) +CREATE(vkCreateBuffer) +CREATE(vkCreateBufferView) +CREATE(vkCreateCommandPool) +CREATE(vkCreateDescriptorPool) +CREATE(vkCreateDescriptorSetLayout) +CREATE(vkCreateDescriptorUpdateTemplate) +CREATE(vkCreateDescriptorUpdateTemplateKHR) +//CREATE(vkCreateDevice) +CREATE(vkCreateDisplayPlaneSurfaceKHR) +CREATE(vkCreateEvent) +CREATE(vkCreateFence) +CREATE(vkCreateFramebuffer) +CREATE(vkCreateImage) +CREATE(vkCreateImageView) +CREATE(vkCreatePipelineCache) +CREATE(vkCreatePipelineLayout) +CREATE(vkCreateQueryPool) +CREATE(vkCreateRenderPass) +CREATE(vkCreateSampler) +CREATE(vkCreateSamplerYcbcrConversion) +CREATE(vkCreateSemaphore) +CREATE(vkCreateShaderModule) +CREATE(vkCreateSwapchainKHR) +CREATE(vkCreateWaylandSurfaceKHR) +CREATE(vkCreateXlibSurfaceKHR) +CREATE(vkCreateAndroidSurfaceKHR) +CREATE(vkCreateRenderPass2) +CREATE(vkCreateRenderPass2KHR) +CREATE(vkCreateValidationCacheEXT) +CREATE(vkCreateSamplerYcbcrConversionKHR) +CREATE(vkCreateVideoSessionKHR) +CREATE(vkCreateVideoSessionParametersKHR) +CREATE(vkCreatePrivateDataSlot) +CREATE(vkCreatePrivateDataSlotEXT) +CREATE(vkCreateAccelerationStructureKHR) +CREATE(vkCreateCuFunctionNVX) +CREATE(vkCreateCuModuleNVX) +CREATE(vkCreateIndirectCommandsLayoutNV) +CREATE(vkCreateAccelerationStructureNV) +CREATE(vkCreateOpticalFlowSessionNV) +CREATE(vkCreateMicromapEXT) +CREATE(vkCreateCudaFunctionNV) +CREATE(vkCreateCudaModuleNV) +CREATE(vkCreateHeadlessSurfaceEXT) +CREATE(vkCreateIndirectCommandsLayoutEXT) +CREATE(vkCreateIndirectExecutionSetEXT) +CREATE(vkCreatePipelineBinariesKHR) +CREATE(vkCreateTensorARM) +CREATE(vkCreateTensorViewARM) +CREATE(vkCreateDataGraphPipelineSessionARM) +CREATE(vkCreateDebugReportCallbackEXT) // needs better wrapping because of Debug callback? +CREATE(vkCreateDebugUtilsMessengerEXT) // Needs better wrapping? +CREATE(vkRegisterDeviceEventEXT) +CREATE(vkCreateWin32SurfaceKHR) +#undef CREATE +#undef GO +// DESTROY64 +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static void my_##A##_##N(void* a, uint64_t b, my_VkAllocationCallbacks_t* c) \ +{ \ + bridge_VkAllocationCallbacks(c); \ + RunFunctionFmt(my_##A##_fct_##N, "pUp", a, b, c); \ +} +#define DESTROY64(A) SUPER(A) +DESTROY64(vkDestroyShaderEXT) +DESTROY64(vkDestroyBuffer) +DESTROY64(vkDestroyBufferView) +DESTROY64(vkDestroyCommandPool) +DESTROY64(vkDestroyDescriptorPool) +DESTROY64(vkDestroyDescriptorSetLayout) +DESTROY64(vkDestroyDescriptorUpdateTemplate) +DESTROY64(vkDestroyDescriptorUpdateTemplateKHR) +DESTROY64(vkDestroyEvent) +DESTROY64(vkDestroyFence) +DESTROY64(vkDestroyFramebuffer) +DESTROY64(vkDestroyImage) +DESTROY64(vkDestroyImageView) +DESTROY64(vkDestroyPipeline) +DESTROY64(vkDestroyPipelineCache) +DESTROY64(vkDestroyPipelineLayout) +DESTROY64(vkDestroyQueryPool) +DESTROY64(vkDestroyRenderPass) +DESTROY64(vkDestroySampler) +DESTROY64(vkDestroySamplerYcbcrConversion) +DESTROY64(vkDestroySemaphore) +DESTROY64(vkDestroyShaderModule) +DESTROY64(vkDestroySwapchainKHR) +DESTROY64(vkFreeMemory) +DESTROY64(vkDestroySurfaceKHR) +DESTROY64(vkDestroySamplerYcbcrConversionKHR) +DESTROY64(vkDestroyValidationCacheEXT) +DESTROY64(vkDestroyVideoSessionKHR) +DESTROY64(vkDestroyVideoSessionParametersKHR) +DESTROY64(vkDestroyPrivateDataSlot) +DESTROY64(vkDestroyPrivateDataSlotEXT) +DESTROY64(vkDestroyAccelerationStructureKHR) +DESTROY64(vkDestroyDeferredOperationKHR) +DESTROY64(vkDestroyCuFunctionNVX) +DESTROY64(vkDestroyCuModuleNVX) +DESTROY64(vkDestroyIndirectCommandsLayoutNV) +DESTROY64(vkDestroyAccelerationStructureNV) +DESTROY64(vkDestroyOpticalFlowSessionNV) +DESTROY64(vkDestroyMicromapEXT) +DESTROY64(vkDestroyCudaFunctionNV) +DESTROY64(vkDestroyCudaModuleNV) +DESTROY64(vkDestroyIndirectCommandsLayoutEXT) +DESTROY64(vkDestroyIndirectExecutionSetEXT) +DESTROY64(vkDestroyPipelineBinaryKHR) +DESTROY64(vkDestroyTensorARM) +DESTROY64(vkDestroyTensorViewARM) +DESTROY64(vkDestroyDataGraphPipelineSessionARM) +#undef DESTROY64 +#undef GO +// DESTROY +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static void my_##A##_##N(void* a, void* b, my_VkAllocationCallbacks_t* c) \ +{ \ + bridge_VkAllocationCallbacks(c); \ + RunFunctionFmt(my_##A##_fct_##N, "ppp", a, b, c); \ +} +#define DESTROY(A) SUPER(A) +DESTROY(vkDestroyDebugUtilsMessengerEXT) +DESTROY(vkReleaseCapturedPipelineDataKHR) +DESTROY(vkDestroyDebugReportCallbackEXT) // needs better wrapping? +#undef DESTROY +#undef GO +//vkCreate*Pipelines +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static int my_##A##_##N(void* a, uint64_t b, uint32_t c, void* d, my_VkAllocationCallbacks_t* e, void* f) \ +{ \ + bridge_VkAllocationCallbacks(e); \ + return (int)RunFunctionFmt(my_##A##_fct_##N, "pUuppp", a, b, c, d, e, f); \ +} +SUPER(vkCreateComputePipelines) +SUPER(vkCreateGraphicsPipelines) +SUPER(vkCreateRayTracingPipelinesNV) +SUPER(vkCreateExecutionGraphPipelinesAMDX) + +#undef GO +// Simpler DESTROY +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static void my_##A##_##N(void* a, my_VkAllocationCallbacks_t* b) \ +{ \ + bridge_VkAllocationCallbacks(b); \ + RunFunctionFmt(my_##A##_fct_##N, "pp", a, b); \ +} +SUPER(vkDestroyDevice) +SUPER(vkDestroyInstance) +#undef GO +// vkGetPhysicalDeviceMemoryProperties +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static void my_##A##_##N(void* a, void* b) \ +{ \ + RunFunctionFmt(my_##A##_fct_##N, "pp", a, b); \ +} +SUPER(vkGetPhysicalDeviceProperties2) +#undef GO +//vkCreateDisplayModeKHR +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static int my_##A##_##N(void* a, uint64_t b, void* c, my_VkAllocationCallbacks_t* d, void* e) \ +{ \ + bridge_VkAllocationCallbacks(d); \ + return (int)RunFunctionFmt(my_##A##_fct_##N, "pUppp", a, b, c, d, e); \ +} +SUPER(vkCreateDisplayModeKHR) +SUPER(vkRegisterDisplayEventEXT) +#undef GO +//vkCreateSharedSwapchainsKHR +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static int my_##A##_##N(void* a, uint32_t b, void* c, my_VkAllocationCallbacks_t* d, void* e) \ +{ \ + bridge_VkAllocationCallbacks(d); \ + return (int)RunFunctionFmt(my_##A##_fct_##N, "puppp", a, b, c, d, e); \ +} +SUPER(vkCreateSharedSwapchainsKHR) +SUPER(vkCreateShadersEXT) +#undef GO +//CREATE 3p +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static int my_##A##_##N(void* a, my_VkAllocationCallbacks_t* b, void* c) \ +{ \ + bridge_VkAllocationCallbacks(b); \ + return (int)RunFunctionFmt(my_##A##_fct_##N, "ppp", a, b, c); \ +} +SUPER(vkCreateDeferredOperationKHR) +#undef GO +//vkCreateRayTracingPipelinesKHR +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static int my_##A##_##N(void* a, uint64_t b, uint64_t c, uint32_t d, void* e, my_VkAllocationCallbacks_t* f, void* g) \ +{ \ + bridge_VkAllocationCallbacks(f); \ + return (int)RunFunctionFmt(my_##A##_fct_##N, "pUUuppp", a, b, c, d, e, f, g); \ +} +SUPER(vkCreateRayTracingPipelinesKHR) +SUPER(vkCreateDataGraphPipelinesARM) +#undef GO +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static int my_##A##_##N(void* a, my_VkAllocationCallbacks_t* b, void* c) \ +{ \ + addBridgeCreateInfo(a); \ + bridge_VkAllocationCallbacks(b); \ + return (int)RunFunctionFmt(my_##A##_fct_##N, "ppp", a, b, c); \ +} +SUPER(vkCreateInstance) +#undef GO +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static int my_##A##_##N(void* a, void* b, my_VkAllocationCallbacks_t* c, void* d) \ +{ \ + addBridgeCreateInfo(b); \ + bridge_VkAllocationCallbacks(c); \ + return (int)RunFunctionFmt(my_##A##_fct_##N, "pppp", a, b, c, d); \ +} +SUPER(vkCreateDevice) +#undef GO +// vkCreateXcbSurfaceKHR +#define GO(A, N) \ +static uintptr_t my_##A##_fct_##N = 0; \ +static void* my_##A##_##N(void* a, void* b, my_VkAllocationCallbacks_t* c, void* d) \ +{ \ + bridge_VkAllocationCallbacks(c); \ + my_VkXcbSurfaceCreateInfoKHR_t* surfaceinfo = b; \ + void* old_conn = surfaceinfo->connection; \ + surfaceinfo->connection = add_xcb_connection(old_conn); \ + void* ret = (void*)RunFunctionFmt(my_##A##_fct_##N, "pppp", a, b, c, d); \ + surfaceinfo->connection = old_conn; \ + return ret; \ +} +SUPER(vkCreateXcbSurfaceKHR) +#undef GO + +#undef SUPER + +static json_value_t* json_find(json_object_t* object, const char* key) +{ + json_object_element_t *element = object->start; + while (element) { + if (strcmp(element->name->string, key) == 0) { + return element->value; + } + element = element->next; + } + return NULL; +} + +static void addVulkanSymbol(my_vulkanoverlay_t* v, const char* name, uintptr_t* x64, void* f) +{ + int ret; + khint_t k = kh_put(x64wrappers, v->wrappers, name, &ret); + kh_value(v->wrappers, k).x64 = x64; + kh_value(v->wrappers, k).f = f; +} + +void* LoadVulkanOverlay(const char* path, int flags) +{ + // find the local vulkan/implicit_layer.d + { + // simplified research pattern... + glob_t pglob = {0}; + char tmp[4096] = {0}; + if(getenv("XDG_CONFIG_HOME")) { + snprintf(tmp, sizeof(tmp)-1, "%s/vulkan/implicit_layer.d/*.json", getenv("XDG_CONFIG_HOME")); + } else if(getenv("HOME")) { + snprintf(tmp, sizeof(tmp)-1, "%s/.config/vulkan/implicit_layer.d/*.json", getenv("HOME")); + } + int flags = GLOB_APPEND; + if(strlen(tmp)) glob(tmp, 0, NULL, &pglob); else flags = 0; + if(getenv("XDG_CONFIG_DIRS")) { + snprintf(tmp, sizeof(tmp)-1, "%s/vulkan/implicit_layer.d/*.json", getenv("XDG_CONFIG_DIRS")); + } else { + snprintf(tmp, sizeof(tmp)-1, "/etc/xdg/vulkan/implicit_layer.d/*.json"); + } + glob(tmp, flags, NULL, &pglob); + flags = GLOB_APPEND; + tmp[0] = 0; + if(getenv("XDG_DATA_HOME")) { + snprintf(tmp, sizeof(tmp)-1, "%s/vulkan/implicit_layer.d/*.json", getenv("XDG_DATA_HOME")); + } else if(getenv("HOME")) { + snprintf(tmp, sizeof(tmp)-1, "%s/.local/share/vulkan/implicit_layer.d/*.json", getenv("HOME")); + } + glob(tmp, flags, NULL, &pglob); + // should also search XDG_DATA_DIRS, but it's a list, so a bit anoying to do... + + // now, look through all the json collected to find one that reference the lib + json_value_t* json = NULL; + for(size_t i=0; itype==json_type_object)) { + json_value_t* layer = json_find(json->payload, "layer"); + if(layer && (layer->type==json_type_object)) { + json_value_t* libpath = json_find(layer->payload, "library_path"); + if(libpath && libpath->type==json_type_string) { + json_string_t* string = libpath->payload; + if(!strcmp(string->string, path)) + keep = 1; + } + } + } + if(!keep) { + free(json); + json = NULL; + } + } + fclose(f); + box_free(src); + src = NULL; + f = NULL; + } + } + globfree(&pglob); + if(json) { + printf_log(LOG_INFO, "Found a keeper: %s\n", path); + my_vulkanoverlay_t* v = getNewVulkanOverlay(); + if(!v) { + printf_log(LOG_INFO, "Warning, no more slot for a new Vulkan Overlay (%s)\n", path); + } else { + json_value_t* layer = json_find(json->payload, "layer"); + json_value_t* functions = json_find(layer->payload, "functions"); + if(functions && functions->type==json_type_object) { + json_object_t* funcs = functions->payload; + // there is an array on transformed functions + v->functions = calloc(funcs->length, sizeof(v->functions[0])); + json_object_element_t* e = funcs->start; + uint32_t idx = 0; + while(e) { + if(e->value->type==json_type_string) { + v->functions[idx].name = box_strdup(e->name->string); + v->functions[idx].f = box_strdup(((json_string_t*)e->value->payload)->string); + ++idx; + } + e = e->next; + } + v->n_functions = idx; + } + printf_log(LOG_INFO, "\twith %d functions name overrides\n", v->n_functions); + } + // all done with json, it can be freed now + free(json); + json = NULL; + // my_dlopen it now + if(v) { + x64emu_t* emu = thread_get_emu(); + void* handle = my_dlopen(emu, path, flags); + if(!handle) { + printf_log(LOG_INFO, "\tFailed to open the lib\n"); + // there was an error, cancel... + freeVulkanOverlay(v); + return NULL; + } + v->handle = handle; + v->lib_name = box_strdup(strrchr(path, '/')+1); + #define DATA(A, B) + #define GO2(A, B,C) + #define GOM(A, B) addVulkanSymbol(v, #A, my_##A##_fcts[v->idx], my_##A##_wrps[v->idx]); + #define GO(A, B) addVulkanSymbol(v, #A, my_##A##_fcts[v->idx], my_##A##_wrps[v->idx]); + #include "wrapped/wrappedvulkan_private.h" + #undef GO + #undef GOM + #undef GO2 + #undef DATA + return v; + } + } + } + + return NULL; +} +void* GetSymbolVulkanOverlay(void* g, const char* sym) +{ + my_vulkanoverlay_t* v = g; + if(v) { + x64emu_t* emu = thread_get_emu(); + const char* name = NULL; + for(size_t i=0; in_functions && !name; ++i) { + if(!strcmp(v->functions[i].f, sym)) + name = v->functions[i].name; + } + if(!name) name = sym; + size_t idx = v->idx; + printf_log(LOG_INFO, "Hooked dlsym on VulkanOverlay[%d/%s] with function %s (%s)\n", idx, v->lib_name, sym, name); + if(!strcmp(name, "vkGetDeviceProcAddr")) { + uintptr_t x64 = (uintptr_t)my_dlsym(emu, v->handle, sym); + if(!x64) return NULL; + *my_vkGetDeviceProcAddr_fcts[idx] = x64; + return my_vkGetDeviceProcAddr_wrps[idx]; + } + if(!strcmp(name, "vkGetInstanceProcAddr")) { + uintptr_t x64 = (uintptr_t)my_dlsym(emu, v->handle, sym); + if(!x64) return NULL; + *my_vkGetInstanceProcAddr_fcts[idx] = x64; + return my_vkGetInstanceProcAddr_wrps[idx]; + } + + } + return NULL; +} +int FreeVulkanOverlay(void* g) +{ + my_vulkanoverlay_t* v = g; + if(v) { + if(v->n_functions) box_free(v->functions); + x64emu_t* emu = thread_get_emu(); + my_dlclose(emu, v->handle); + freeVulkanOverlay(v); + } + return 0; +} diff --git a/src/mallochook.c b/src/mallochook.c index 4c636dd..fd71d5b 100644 --- a/src/mallochook.c +++ b/src/mallochook.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "box64context.h" #include "debug.h" @@ -14,6 +15,7 @@ #include "elfs/elfloader_private.h" #include "custommem.h" #include "symbols.h" +#include "alternate.h" /* This file here is for handling overriding of malloc functions @@ -182,13 +184,83 @@ SUPER() #undef GO2 #undef GO +#ifdef BOX32 +int isCustomAddr(void* p); +// Check if entire allocation (ptr to ptr+size-1) fits within 32-bit address space +#define FITS_IN_32BIT(ptr, size) (((uintptr_t)(ptr) + (size)) <= 0x100000000ULL) +void* box32_calloc(size_t n, size_t s) +{ + void* ret = box_calloc(n, s); + if(ret && FITS_IN_32BIT(ret, n * s)) return ret; + box_free(ret); + malloc_trim(0); + ret = box_calloc(n, s); + if(ret && FITS_IN_32BIT(ret, n * s)) return ret; + box_free(ret); + return customCalloc32(n, s); +} +void* box32_malloc(size_t s) +{ + void* ret = box_malloc(s); + if(ret && FITS_IN_32BIT(ret, s)) return ret; + box_free(ret); + malloc_trim(0); + ret = box_malloc(s); + if(ret && FITS_IN_32BIT(ret, s)) return ret; + box_free(ret); + return customMalloc32(s); +} +void* box32_realloc(void* p, size_t s) +{ + if(isCustomAddr(p)) + return customRealloc32(p, s); + void* ret = box_realloc(p, s); + if(!ret) return NULL; + if(FITS_IN_32BIT(ret, s)) return ret; + malloc_trim(0); + void* newret = customMalloc32(s); + memcpy(newret, ret, s); + box_free(ret); + return newret; +} +void box32_free(void* p) +{ + if(isCustomAddr(p)) + customFree32(p); + else + box_free(p); +} +void* box32_memalign(size_t align, size_t s) +{ + void* ret = box_memalign(align, s); + if(ret && FITS_IN_32BIT(ret, s)) return ret; + box_free(ret); + malloc_trim(0); + return customMemAligned32(align, s); +} +size_t box32_malloc_usable_size(void* p) +{ + if(isCustomAddr(p)) + return customGetUsableSize(p); + else + return box_malloc_usable_size(p); +} + +char* box32_strdup(const char* s) { + char* ret = box32_calloc(1, strlen(s)+1); + memcpy(ret, s, strlen(s)); + return ret; +} + +#endif + // redefining all libc memory allocation routines EXPORT void* malloc(size_t l) { if(malloc_hack_2 && ALLOC && real_malloc) { return (void*)RunFunctionFmt(real_malloc, "L", l); } - return box_calloc(1, l); + return actual_calloc(1, l); } EXPORT void free(void* p) @@ -202,7 +274,7 @@ EXPORT void free(void* p) return; } } - box_free(p); + actual_free(p); } EXPORT void* calloc(size_t n, size_t s) @@ -210,7 +282,7 @@ EXPORT void* calloc(size_t n, size_t s) if(malloc_hack_2 && ALLOC && real_calloc) { return (void*)RunFunctionFmt(real_calloc, "LL", n,s); } - return box_calloc(n, s); + return actual_calloc(n, s); } EXPORT void* realloc(void* p, size_t s) @@ -222,7 +294,7 @@ EXPORT void* realloc(void* p, size_t s) ret = (void*)RunFunctionFmt(real_realloc, "pL", p, s); } else { // found! Will realloc using regular malloc then copy from old address as much as possible, but need to check size first - ret = box_malloc(s); + ret = actual_malloc(s); printf_log(LOG_DEBUG, "Malloc_Hack_2: hacking realloc(%p, %zu)", p, s); while(s && !(getProtection((uintptr_t)p+s)&PROT_READ)) {if(s>box64_pagesize) s-=box64_pagesize; else s=0;} memcpy(ret, p, s); @@ -233,23 +305,28 @@ EXPORT void* realloc(void* p, size_t s) } return ret; } - return box_realloc(p, s); + return actual_realloc(p, s); } -EXPORT void* aligned_alloc(size_t align, size_t size) +EXPORT void* memalign(size_t align, size_t size) { if(malloc_hack_2 && ALLOC && real_aligned_alloc) { return (void*)RunFunctionFmt(real_aligned_alloc, "LL", align, size); } - return box_memalign(align, size); + if(box64_is32bits && align==4) + align = sizeof(void*); + return actual_memalign(align, size); } -EXPORT void* memalign(size_t align, size_t size) +EXPORT void* aligned_alloc(size_t align, size_t size) { if(malloc_hack_2 && ALLOC && real_aligned_alloc) { return (void*)RunFunctionFmt(real_aligned_alloc, "LL", align, size); } - return box_memalign(align, size); + if(box64_is32bits && align==4) { + return memalign(align, size); + } + return actual_memalign(align, size); } EXPORT int posix_memalign(void** p, size_t align, size_t size) @@ -257,9 +334,11 @@ EXPORT int posix_memalign(void** p, size_t align, size_t size) if(malloc_hack_2 && ALLOC && real_posix_memalign) { return RunFunctionFmt(real_posix_memalign, "pLL", p, align, size); } - if(align%sizeof(void*) || pot(align)!=align) + if(box64_is32bits && align==4) + align = sizeof(void*); + if((align%sizeof(void*)) || (pot(align)!=align)) return EINVAL; - void* ret = box_memalign(align, size); + void* ret = actual_memalign(align, size); if(!ret) return ENOMEM; *p = ret; @@ -271,7 +350,7 @@ EXPORT void* valloc(size_t size) if(malloc_hack_2 && ALLOC && real_valloc) { return (void*)RunFunctionFmt(real_valloc, "L", size); } - return box_memalign(box64_pagesize, size); + return actual_memalign(box64_pagesize, size); } EXPORT void* pvalloc(size_t size) @@ -279,7 +358,7 @@ EXPORT void* pvalloc(size_t size) if(malloc_hack_2 && ALLOC && real_pvalloc) { return (void*)RunFunctionFmt(real_pvalloc, "L", size); } - return box_memalign(box64_pagesize, (size+box64_pagesize-1)&~(box64_pagesize-1)); + return actual_memalign(box64_pagesize, (size+box64_pagesize-1)&~(box64_pagesize-1)); } EXPORT void cfree(void* p) @@ -293,7 +372,7 @@ EXPORT void cfree(void* p) return; } } - box_free(p); + actual_free(p); } EXPORT size_t malloc_usable_size(void* p) @@ -302,7 +381,7 @@ EXPORT size_t malloc_usable_size(void* p) if(getMmapped((uintptr_t)p)) return RunFunctionFmt(real_malloc_usable_size, "p", p); } - return box_malloc_usable_size(p); + return actual_malloc_usable_size(p); } EXPORT void* my__Znwm(size_t sz) //operator new(size_t) @@ -310,7 +389,7 @@ EXPORT void* my__Znwm(size_t sz) //operator new(size_t) if(malloc_hack_2 && real__Znwm) { return (void*)RunFunctionFmt(real__Znwm, "L", sz); } - return box_malloc(sz); + return actual_malloc(sz); } EXPORT void* my__ZnwmRKSt9nothrow_t(size_t sz, void* p) //operator new(size_t, std::nothrow_t const&) @@ -318,7 +397,7 @@ EXPORT void* my__ZnwmRKSt9nothrow_t(size_t sz, void* p) //operator new(size_t, if(malloc_hack_2 && real__ZnwmRKSt9nothrow_t) { return (void*)RunFunctionFmt(real__ZnwmRKSt9nothrow_t, "Lp", sz, p); } - return box_malloc(sz); + return actual_malloc(sz); } EXPORT void* my__Znam(size_t sz) //operator new[](size_t) @@ -326,7 +405,7 @@ EXPORT void* my__Znam(size_t sz) //operator new[](size_t) if(malloc_hack_2 && real__Znam) { return (void*)RunFunctionFmt(real__Znam, "L", sz); } - return box_malloc(sz); + return actual_malloc(sz); } EXPORT void* my__ZnamRKSt9nothrow_t(size_t sz, void* p) //operator new[](size_t, std::nothrow_t const&) @@ -334,7 +413,7 @@ EXPORT void* my__ZnamRKSt9nothrow_t(size_t sz, void* p) //operator new[](size_ if(malloc_hack_2 && real__ZnamRKSt9nothrow_t) { return (void*)RunFunctionFmt(real__ZnamRKSt9nothrow_t, "Lp", sz, p); } - return box_malloc(sz); + return actual_malloc(sz); } @@ -349,7 +428,7 @@ EXPORT void my__ZdaPv(void* p) //operator delete[](void*) return; } } - box_free(p); + actual_free(p); } EXPORT void my__ZdaPvm(void* p, size_t sz) //operator delete[](void*, size_t) @@ -363,7 +442,7 @@ EXPORT void my__ZdaPvm(void* p, size_t sz) //operator delete[](void*, size_t) return; } } - box_free(p); + actual_free(p); } EXPORT void my__ZdaPvmSt11align_val_t(void* p, size_t sz, size_t align) //operator delete[](void*, unsigned long, std::align_val_t) @@ -377,7 +456,7 @@ EXPORT void my__ZdaPvmSt11align_val_t(void* p, size_t sz, size_t align) //oper return; } } - box_free(p); + actual_free(p); } EXPORT void my__ZdlPv(void* p) //operator delete(void*) @@ -391,7 +470,7 @@ EXPORT void my__ZdlPv(void* p) //operator delete(void*) return; } } - box_free(p); + actual_free(p); } EXPORT void my__ZdlPvm(void* p, size_t sz) //operator delete(void*, size_t) @@ -405,7 +484,7 @@ EXPORT void my__ZdlPvm(void* p, size_t sz) //operator delete(void*, size_t) return; } } - box_free(p); + actual_free(p); } EXPORT void* my__ZnwmSt11align_val_t(size_t sz, size_t align) //// operator new(unsigned long, std::align_val_t) @@ -413,7 +492,7 @@ EXPORT void* my__ZnwmSt11align_val_t(size_t sz, size_t align) //// operator new if(malloc_hack_2 && real__ZnwmSt11align_val_t) { return (void*)RunFunctionFmt(real__ZnwmSt11align_val_t, "LL", sz, align); } - return box_memalign(align, sz); + return actual_memalign(align, sz); } EXPORT void* my__ZnwmSt11align_val_tRKSt9nothrow_t(size_t sz, size_t align, void* p) //// operator new(unsigned long, std::align_val_t, std::nothrow_t const&) @@ -421,7 +500,7 @@ EXPORT void* my__ZnwmSt11align_val_tRKSt9nothrow_t(size_t sz, size_t align, void if(malloc_hack_2 && real__ZnwmSt11align_val_tRKSt9nothrow_t) { return (void*)RunFunctionFmt(real__ZnwmSt11align_val_tRKSt9nothrow_t, "LLp", sz, align, p); } - return box_memalign(align, sz); + return actual_memalign(align, sz); } EXPORT void* my__ZnamSt11align_val_t(size_t sz, size_t align) //// operator new[](unsigned long, std::align_val_t) @@ -429,7 +508,7 @@ EXPORT void* my__ZnamSt11align_val_t(size_t sz, size_t align) //// operator new if(malloc_hack_2 && real__ZnamSt11align_val_t) { return (void*)RunFunctionFmt(real__ZnamSt11align_val_t, "LL", sz, align); } - return box_memalign(align, sz); + return actual_memalign(align, sz); } EXPORT void* my__ZnamSt11align_val_tRKSt9nothrow_t(size_t sz, size_t align, void* p) //// operator new[](unsigned long, std::align_val_t, std::nothrow_t const&) @@ -437,7 +516,7 @@ EXPORT void* my__ZnamSt11align_val_tRKSt9nothrow_t(size_t sz, size_t align, void if(malloc_hack_2 && real__ZnamSt11align_val_tRKSt9nothrow_t) { return (void*)RunFunctionFmt(real__ZnamSt11align_val_tRKSt9nothrow_t, "LLp", sz, align, p); } - return box_memalign(align, sz); + return actual_memalign(align, sz); } EXPORT void my__ZdlPvRKSt9nothrow_t(void* p, void* n) //operator delete(void*, std::nothrow_t const&) @@ -451,7 +530,7 @@ EXPORT void my__ZdlPvRKSt9nothrow_t(void* p, void* n) //operator delete(void*, return; } } - box_free(p); + actual_free(p); } EXPORT void my__ZdaPvSt11align_val_tRKSt9nothrow_t(void* p, size_t align, void* n) //operator delete[](void*, std::align_val_t, std::nothrow_t const&) @@ -466,7 +545,7 @@ EXPORT void my__ZdaPvSt11align_val_tRKSt9nothrow_t(void* p, size_t align, void* return; } } - box_free(p); + actual_free(p); } EXPORT void my__ZdlPvmSt11align_val_t(void* p, size_t sz, size_t align) //operator delete(void*, unsigned long, std::align_val_t) @@ -480,7 +559,7 @@ EXPORT void my__ZdlPvmSt11align_val_t(void* p, size_t sz, size_t align) //oper return; } } - box_free(p); + actual_free(p); } EXPORT void my__ZdaPvRKSt9nothrow_t(void* p, void* n) //operator delete[](void*, std::nothrow_t const&) @@ -494,7 +573,7 @@ EXPORT void my__ZdaPvRKSt9nothrow_t(void* p, void* n) //operator delete[](void return; } } - box_free(p); + actual_free(p); } EXPORT void my__ZdaPvSt11align_val_t(void* p, size_t align) //operator delete[](void*, std::align_val_t) @@ -508,7 +587,7 @@ EXPORT void my__ZdaPvSt11align_val_t(void* p, size_t align) //operator delete[ return; } } - box_free(p); + actual_free(p); } EXPORT void my__ZdlPvSt11align_val_t(void* p, size_t align) //operator delete(void*, std::align_val_t) @@ -522,7 +601,7 @@ EXPORT void my__ZdlPvSt11align_val_t(void* p, size_t align) //operator delete( return; } } - box_free(p); + actual_free(p); } EXPORT void my__ZdlPvSt11align_val_tRKSt9nothrow_t(void* p, size_t align, void* n) //operator delete(void*, std::align_val_t, std::nothrow_t const&) @@ -536,92 +615,92 @@ EXPORT void my__ZdlPvSt11align_val_tRKSt9nothrow_t(void* p, size_t align, void* return; } } - box_free(p); + actual_free(p); } EXPORT void* my_tc_calloc(size_t n, size_t s) { - return box_calloc(n, s); + return actual_calloc(n, s); } EXPORT void my_tc_cfree(void* p) { - box_free(p); + actual_free(p); } EXPORT void my_tc_delete(void* p) { - box_free(p); + actual_free(p); } EXPORT void my_tc_deletearray(void* p) { - box_free(p); + actual_free(p); } EXPORT void my_tc_deletearray_nothrow(void* p, void* n) { - box_free(p); + actual_free(p); } EXPORT void my_tc_delete_nothrow(void* p, void* n) { - box_free(p); + actual_free(p); } EXPORT void my_tc_free(void* p) { - box_free(p); + actual_free(p); } EXPORT void* my_tc_malloc(size_t s) { - return box_calloc(1, s); + return actual_calloc(1, s); } EXPORT size_t my_tc_malloc_size(void* p) { - return box_malloc_usable_size(p); + return actual_malloc_usable_size(p); } EXPORT void* my_tc_new(size_t s) { - return box_calloc(1, s); + return actual_calloc(1, s); } EXPORT void* my_tc_new_nothrow(size_t s, void* n) { - return box_calloc(1, s); + return actual_calloc(1, s); } EXPORT void* my_tc_newarray(size_t s) { - return box_calloc(1, s); + return actual_calloc(1, s); } EXPORT void* my_tc_newarray_nothrow(size_t s, void* n) { - return box_calloc(1, s); + return actual_calloc(1, s); } EXPORT void* my_tc_pvalloc(size_t size) { - return box_memalign(box64_pagesize, (size+box64_pagesize-1)&~(box64_pagesize-1)); + return actual_memalign(box64_pagesize, (size+box64_pagesize-1)&~(box64_pagesize-1)); } EXPORT void* my_tc_valloc(size_t size) { - return box_memalign(box64_pagesize, size); + return actual_memalign(box64_pagesize, size); } EXPORT void* my_tc_memalign(size_t align, size_t size) { - return box_memalign(align, size); + return actual_memalign(align, size); } EXPORT void* my_tc_malloc_skip_new_handler_weak(size_t s) { - return box_calloc(1, s); + return actual_calloc(1, s); } EXPORT int my_tc_mallocopt(int param, int value) @@ -646,13 +725,13 @@ EXPORT int my_tc_set_new_mode(int mode) */ EXPORT void* my_tc_malloc_skip_new_handler(size_t s) { - return box_calloc(1, s); + return actual_calloc(1, s); } EXPORT void* my_tc_mallinfo(void* p) { // ignored, returning null stuffs - memset(p, 0, sizeof(size_t)*10); + memset(p, 0, (box64_is32bits?sizeof(ptr_t):sizeof(size_t))*10); return p; } @@ -660,7 +739,7 @@ EXPORT int my_tc_posix_memalign(void** p, size_t align, size_t size) { if(align%sizeof(void*) || pot(align)!=align) return EINVAL; - void* ret = box_memalign(align, size); + void* ret = actual_memalign(align, size); if(!ret) return ENOMEM; *p = ret; @@ -669,7 +748,7 @@ EXPORT int my_tc_posix_memalign(void** p, size_t align, size_t size) EXPORT void* my_tc_realloc(void* p, size_t s) { - return box_realloc(p, s); + return actual_realloc(p, s); } /* EXPORT int my_tc_version(int i) @@ -685,34 +764,34 @@ EXPORT void* my_safer_scalable_aligned_realloc(void* p, size_t size, size_t alig return NULL; } if(align <= 8) - return box_realloc(p, size); - size_t old_size = box_malloc_usable_size(p); + return actual_realloc(p, size); + size_t old_size = actual_malloc_usable_size(p); if(old_size>=size) return p; - void* new_p = box_memalign(align, size); + void* new_p = actual_memalign(align, size); memcpy(new_p, p, (old_size=size) return p; - void* new_p = box_memalign(align, size); + void* new_p = actual_memalign(align, size); memcpy(new_p, p, (old_sizenumSymTab; ++i) { - int type = ELF64_ST_TYPE(h->SymTab[i].st_info); - int sz = ELF64_ST_TYPE(h->SymTab[i].st_size); - if(type==STT_FUNC && sz) { - const char * symname = h->StrTab+h->SymTab[i].st_name; + int type = ELF64_ST_TYPE(h->SymTab._64[i].st_info); + int sz = ELF64_ST_TYPE(h->SymTab._64[i].st_size); + if((type==STT_FUNC) && sz && (h->SymTab._64[i].st_shndx!=0 && h->SymTab._64[i].st_shndx<=65521)) { + const char * symname = h->StrTab+h->SymTab._64[i].st_name; #define GO(A, B) if(!strcmp(symname, #A)) ++hooked; else if(!strcmp(symname, "__libc_" #A)) ++hooked; #define GO2(A, B) SUPER() @@ -790,14 +873,14 @@ void checkHookedSymbols(elfheader_t* h) } if(hooked<2) { for (size_t i=0; inumDynSym && hooked<2; ++i) { - const char * symname = h->DynStr+h->DynSym[i].st_name; - int bind = ELF64_ST_BIND(h->DynSym[i].st_info); - int type = ELF64_ST_TYPE(h->DynSym[i].st_info); - int vis = h->DynSym[i].st_other&0x3; + const char * symname = h->DynStr+h->DynSym._64[i].st_name; + int bind = ELF64_ST_BIND(h->DynSym._64[i].st_info); + int type = ELF64_ST_TYPE(h->DynSym._64[i].st_info); + int vis = h->DynSym._64[i].st_other&0x3; if((type==STT_FUNC) - && (vis==STV_DEFAULT || vis==STV_PROTECTED) && (h->DynSym[i].st_shndx!=0 && h->DynSym[i].st_shndx<=65521)) { - uintptr_t offs = h->DynSym[i].st_value + h->delta; - size_t sz = h->DynSym[i].st_size; + && (vis==STV_DEFAULT || vis==STV_PROTECTED) && (h->DynSym._64[i].st_shndx!=0 && h->DynSym._64[i].st_shndx<=65521)) { + uintptr_t offs = h->DynSym._64[i].st_value + h->delta; + size_t sz = h->DynSym._64[i].st_size; if(bind!=STB_LOCAL && bind!=STB_WEAK && sz>=sizeof(reloc_jmp_t)) { #define GO(A, B) if(!strcmp(symname, #A)) ++hooked; else if(!strcmp(symname, "__libc_" #A)) ++hooked; #define GO2(A, B) @@ -814,18 +897,18 @@ void checkHookedSymbols(elfheader_t* h) printf_log(LOG_INFO, "Redirecting overridden malloc%s from %s function for %s\n", malloc_hack_2?" with hack":"", hooked_symtab?"symtab":"dynsym", ElfName(h)); if(hooked_symtab) { for (size_t i=0; inumSymTab; ++i) { - int type = ELF64_ST_TYPE(h->SymTab[i].st_info); + int type = ELF64_ST_TYPE(h->SymTab._64[i].st_info); if(type==STT_FUNC) { - const char * symname = h->StrTab+h->SymTab[i].st_name; - uintptr_t offs = h->SymTab[i].st_value + h->delta; - size_t sz = h->SymTab[i].st_size; + const char * symname = h->StrTab+h->SymTab._64[i].st_name; + uintptr_t offs = h->SymTab._64[i].st_value + h->delta; + size_t sz = h->SymTab._64[i].st_size; #define GO(A, B) if(!strcmp(symname, "__libc_" #A)) {uintptr_t alt = AddCheckBridge(my_context->system, B, A, 0, #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, "__libc_" #A, h, NULL);} #define GO2(A, B) SUPER() #undef GO #undef GO2 #define GO(A, B) if(!strcmp(symname, #A)) {uintptr_t alt = AddCheckBridge(my_context->system, B, A, 0, #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, #A, h, &real_##A);} - #define GO2(A, B) if(!strcmp(symname, #A) && (box64_malloc_hack>1)) {uintptr_t alt = AddCheckBridge(my_context->system, B, my_##A, 0, "my_" #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, "my_" #A, h, &real_##A);} + #define GO2(A, B) if(!strcmp(symname, #A) && (BOX64ENV(malloc_hack)>1)) {uintptr_t alt = AddCheckBridge(my_context->system, B, my_##A, 0, "my_" #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, "my_" #A, h, &real_##A);} SUPER() #undef GO #undef GO2 @@ -833,14 +916,14 @@ void checkHookedSymbols(elfheader_t* h) } } else { for (size_t i=0; inumDynSym; ++i) { - const char * symname = h->DynStr+h->DynSym[i].st_name; - int bind = ELF64_ST_BIND(h->DynSym[i].st_info); - int type = ELF64_ST_TYPE(h->DynSym[i].st_info); - int vis = h->DynSym[i].st_other&0x3; + const char * symname = h->DynStr+h->DynSym._64[i].st_name; + int bind = ELF64_ST_BIND(h->DynSym._64[i].st_info); + int type = ELF64_ST_TYPE(h->DynSym._64[i].st_info); + int vis = h->DynSym._64[i].st_other&0x3; if((type==STT_FUNC) - && (vis==STV_DEFAULT || vis==STV_PROTECTED) && (h->DynSym[i].st_shndx!=0 && h->DynSym[i].st_shndx<=65521)) { - uintptr_t offs = h->DynSym[i].st_value + h->delta; - size_t sz = h->DynSym[i].st_size; + && (vis==STV_DEFAULT || vis==STV_PROTECTED) && (h->DynSym._64[i].st_shndx!=0 && h->DynSym._64[i].st_shndx<=65521)) { + uintptr_t offs = h->DynSym._64[i].st_value + h->delta; + size_t sz = h->DynSym._64[i].st_size; if(bind!=STB_LOCAL && bind!=STB_WEAK) { #define GO(A, B) if(!strcmp(symname, "__libc_" #A)) {uintptr_t alt = AddCheckBridge(my_context->system, B, A, 0, #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, "__libc_" #A, h, NULL);} #define GO2(A, B) @@ -848,7 +931,7 @@ void checkHookedSymbols(elfheader_t* h) #undef GO #undef GO2 #define GO(A, B) if(!strcmp(symname, #A)) {uintptr_t alt = AddCheckBridge(my_context->system, B, A, 0, #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, #A, h, &real_##A);} - #define GO2(A, B) if(!strcmp(symname, #A) && (box64_malloc_hack>1)) {uintptr_t alt = AddCheckBridge(my_context->system, B, my_##A, 0, "my_" #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, "my_" #A, h, &real_##A);} + #define GO2(A, B) if(!strcmp(symname, #A) && (BOX64ENV(malloc_hack)>1)) {uintptr_t alt = AddCheckBridge(my_context->system, B, my_##A, 0, "my_" #A); printf_log(LOG_DEBUG, "Redirecting %s function from %p (%s)\n", symname, (void*)offs, ElfName(h)); addRelocJmp((void*)offs, (void*)alt, sz, "my_" #A, h, &real_##A);} SUPER() #undef GO #undef GO2 @@ -856,7 +939,7 @@ void checkHookedSymbols(elfheader_t* h) } } } - if(box64_malloc_hack==2) + if(BOX64ENV(malloc_hack)==2) h->malloc_hook_2 = 1; } diff --git a/src/os/backtrace.c b/src/os/backtrace.c new file mode 100644 index 0000000..2d1261d --- /dev/null +++ b/src/os/backtrace.c @@ -0,0 +1,48 @@ +#include "backtrace.h" + +#if !defined(ANDROID) && !defined(_WIN32) + +#include +#include +#include +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" + +#define BT_BUF_SIZE 100 +void ShowNativeBT(int log_minimum) +{ + // grab current name + // and temporarily rename binary to original box64 + // to get exact backtrace + size_t boxpath_lenth = strlen(my_context->box64path) + 1; + char current_name[boxpath_lenth]; + memcpy(current_name, my_context->orig_argv[0], boxpath_lenth); + memcpy(my_context->orig_argv[0], my_context->box64path, boxpath_lenth); + // show native bt + int nptrs; + void* buffer[BT_BUF_SIZE]; + char** strings; + + nptrs = backtrace(buffer, BT_BUF_SIZE); + strings = backtrace_symbols(buffer, nptrs); + if (strings) { + for (int j = 0; j < nptrs; j++) + printf_log(log_minimum, "NativeBT: %s\n", strings[j]); + free(strings); + } else { + for (int j = 0; j < nptrs; j++) + printf_log(log_minimum, "NativeBT: %p\n", buffer[j]); + } + // restore modified name + memcpy(my_context->box64path, my_context->orig_argv[0], boxpath_lenth); +} +#undef BT_BUF_SIZE + +#else +void ShowNativeBT(int log_minimum) { } +#endif \ No newline at end of file diff --git a/src/os/emit_signal_wine.c b/src/os/emit_signal_wine.c new file mode 100644 index 0000000..6f8ee12 --- /dev/null +++ b/src/os/emit_signal_wine.c @@ -0,0 +1,64 @@ +/* + * Copyright 2022-2025 André Zwing + * Copyright 2023 Alexandre Julliard + */ +#include +#include + +#include "x64_signals.h" +#include "x64emu.h" +#include "debug.h" +#include "custommem.h" +#include "wine/compiler.h" + +void EmitSignal(x64emu_t* emu, int sig, void* addr, int code) +{ + EXCEPTION_RECORD rec; + + switch (sig) { + case X64_SIGILL: + printf_log(LOG_DEBUG, "SIGILL at %p with code %d\n", addr, code); + rec.ExceptionCode = STATUS_ILLEGAL_INSTRUCTION; + break; + case X64_SIGSEGV: + printf_log(LOG_DEBUG, "SIGSEGV at %p with code %d\n", addr, code); + rec.ExceptionCode = STATUS_ACCESS_VIOLATION; + break; + default: + printf_log(LOG_INFO, "Warning, unknown signal %d at %p with code %d\n", sig, addr, code); + rec.ExceptionCode = STATUS_ACCESS_VIOLATION; + break; + } + rec.ExceptionFlags = EXCEPTION_NONCONTINUABLE; + rec.ExceptionRecord = NULL; + rec.ExceptionAddress = addr; + rec.NumberParameters = 0; + RtlRaiseException(&rec); +} + +void CheckExec(x64emu_t* emu, uintptr_t addr) +{ +} + +void EmitDiv0(x64emu_t* emu, void* addr, int code) +{ + EXCEPTION_RECORD rec; + rec.ExceptionCode = EXCEPTION_INT_DIVIDE_BY_ZERO; + rec.ExceptionFlags = EXCEPTION_NONCONTINUABLE; + rec.ExceptionRecord = NULL; + rec.ExceptionAddress = addr; + rec.NumberParameters = 0; + RtlRaiseException(&rec); +} + +void EmuInt3(void* emu, void* addr) +{ + EXCEPTION_RECORD rec; + + rec.ExceptionCode = STATUS_BREAKPOINT; + rec.ExceptionFlags = 0; + rec.ExceptionRecord = NULL; + rec.ExceptionAddress = addr; + rec.NumberParameters = 0; + RtlRaiseException(&rec); +} diff --git a/src/os/emit_signals_linux.c b/src/os/emit_signals_linux.c new file mode 100644 index 0000000..78722fe --- /dev/null +++ b/src/os/emit_signals_linux.c @@ -0,0 +1,298 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef ANDROID +#include +#endif + +#include "x64_signals.h" +#include "box64context.h" +#include "custommem.h" +#include "debug.h" +#include "elfloader.h" +#include "emit_signals.h" +#include "emu/x64emu_private.h" +#include "emu/x87emu_private.h" +#include "regs.h" +#include "x64emu.h" +#include "signals.h" +#include "libtools/signal_private.h" +#include "box64cpu_util.h" + +void my_sigactionhandler_oldcode(x64emu_t* emu, int32_t sig, int simple, siginfo_t* info, void * ucntx, int* old_code, void* cur_db, uintptr_t x64pc); +void EmitSignal(x64emu_t* emu, int sig, void* addr, int code) +{ + siginfo_t info = { 0 }; + info.si_signo = sig; + info.si_errno = (sig == X64_SIGSEGV) ? 0x1234 : 0; // Mark as a sign this is a #GP(0) (like privileged instruction) + info.si_code = code; + if (sig == X64_SIGSEGV && code == 0xbad0) { + info.si_errno = 0xbad0; + info.si_code = 0; + } else if (sig == X64_SIGSEGV && code == 0xecec) { + info.si_errno = 0xecec; + info.si_code = SEGV_ACCERR; + } else if (sig == X64_SIGSEGV && code == 0xb09d) { + info.si_errno = 0xb09d; + info.si_code = 0; + } + info.si_addr = addr; + const char* x64name = NULL; + const char* elfname = NULL; + if (BOX64ENV(log) > LOG_INFO || BOX64ENV(dynarec_dump) || BOX64ENV(showsegv)) { + x64name = getAddrFunctionName(R_RIP); + elfheader_t* elf = FindElfAddress(my_context, R_RIP); + if (elf) + elfname = ElfName(elf); + printf_log(LOG_NONE, "%04d|Emit Signal %d at IP=%p(%s / %s) / addr=%p, code=0x%x\n", GetTID(), sig, (void*)R_RIP, x64name ? x64name : "???", elfname ? elfname : "?", addr, code); + if(sig==5) + printf_log(LOG_INFO, "\t Opcode (%02X %02X %02X %02X) %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", + Peek(emu, -4), Peek(emu, -3), Peek(emu, -2), Peek(emu, -1), + Peek(emu, 0), Peek(emu, 1), Peek(emu, 2), Peek(emu, 3), + Peek(emu, 4), Peek(emu, 5), Peek(emu, 6), Peek(emu, 7), + Peek(emu, 8), Peek(emu, 9), Peek(emu,10), Peek(emu,11), + Peek(emu,12), Peek(emu,13), Peek(emu,14)); + + print_rolling_log(LOG_INFO); + + if ((BOX64ENV(showbt) || sig == X64_SIGABRT) && BOX64ENV(log) >= LOG_INFO) { + // show native bt + #define BT_BUF_SIZE 100 + int nptrs; + void* buffer[BT_BUF_SIZE]; + char** strings; + + #ifndef ANDROID + nptrs = backtrace(buffer, BT_BUF_SIZE); + strings = backtrace_symbols(buffer, nptrs); + if (strings) { + for (int j = 0; j < nptrs; j++) + printf_log(LOG_INFO, "NativeBT: %s\n", strings[j]); + free(strings); + } else + printf_log(LOG_INFO, "NativeBT: none (%d/%s)\n", errno, strerror(errno)); + #endif + extern int my_backtrace_ip(x64emu_t * emu, void** buffer, int size); // in wrappedlibc + extern char** my_backtrace_symbols(x64emu_t * emu, uintptr_t * buffer, int size); + // save and set real RIP/RSP + nptrs = my_backtrace_ip(emu, buffer, BT_BUF_SIZE); + strings = my_backtrace_symbols(emu, (uintptr_t*)buffer, nptrs); + if (strings) { + for (int j = 0; j < nptrs; j++) + printf_log(LOG_INFO, "EmulatedBT: %s\n", strings[j]); + free(strings); + } else + printf_log(LOG_INFO, "EmulatedBT: none\n"); + } + printf_log(LOG_NONE, DumpCPURegs(emu, R_RIP, emu->segs[_CS] == 0x23)); + printf_log_prefix(0, LOG_NONE, "Emu Stack: %p 0x%lx%s\n", emu->init_stack, emu->size_stack, emu->stack2free ? " owned" : ""); + // if(!elf) { + // FILE* f = fopen("/proc/self/maps", "r"); + // if(f) { + // char line[1024]; + // while(!feof(f)) { + // char* ret = fgets(line, sizeof(line), f); + // printf_log(LOG_NONE, "\t%s", ret); + // } + // fclose(f); + // } + // } + if (sig == X64_SIGILL) { + uint8_t* mem = (uint8_t*)R_RIP; + printf_log(LOG_NONE, "SIGILL: Opcode at ip is %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx\n", mem[0], mem[1], mem[2], mem[3], mem[4], mem[5]); + } + } + my_sigactionhandler_oldcode(emu, sig, 0, &info, NULL, NULL, NULL, R_RIP); +} + +void CheckExec(x64emu_t* emu, uintptr_t addr) +{ + if (box64_pagesize != 4096) + return; // disabling the test, 4K pagesize simlation isn't good enough for this + while ((getProtection/*_fast*/(addr) & (PROT_EXEC | PROT_READ)) != (PROT_EXEC | PROT_READ)) { + R_RIP = addr; // incase there is a slight difference + EmitSignal(emu, X64_SIGSEGV, (void*)addr, 0xecec); + } +} + +void EmitInterruption(x64emu_t* emu, int num, void* addr) +{ + siginfo_t info = { 0 }; + info.si_signo = X64_SIGSEGV; + info.si_errno = 0xdead; + info.si_code = num; + info.si_addr = NULL; // addr; + const char* x64name = NULL; + const char* elfname = NULL; + if (BOX64ENV(log) > LOG_INFO || BOX64ENV(dynarec_dump) || BOX64ENV(showsegv)) { + x64name = getAddrFunctionName(R_RIP); + elfheader_t* elf = FindElfAddress(my_context, R_RIP); + if (elf) + elfname = ElfName(elf); + printf_log(LOG_NONE, "Emit Interruption 0x%x at IP=%p(%s / %s) / addr=%p\n", num, (void*)R_RIP, x64name ? x64name : "???", elfname ? elfname : "?", addr); + } + my_sigactionhandler_oldcode(emu, X64_SIGSEGV, 0, &info, NULL, NULL, NULL, R_RIP); +} + +void EmitDiv0(x64emu_t* emu, void* addr, int code) +{ + siginfo_t info = { 0 }; + info.si_signo = X64_SIGSEGV; + info.si_errno = 0xcafe; + info.si_code = code; + info.si_addr = addr; + const char* x64name = NULL; + const char* elfname = NULL; + if (BOX64ENV(log) > LOG_INFO || BOX64ENV(dynarec_dump) || BOX64ENV(showsegv)) { + x64name = getAddrFunctionName(R_RIP); + elfheader_t* elf = FindElfAddress(my_context, R_RIP); + if (elf) + elfname = ElfName(elf); + printf_log(LOG_NONE, "Emit Divide by 0 at IP=%p(%s / %s) / addr=%p\n", (void*)R_RIP, x64name ? x64name : "???", elfname ? elfname : "?", addr); + } + my_sigactionhandler_oldcode(emu, X64_SIGSEGV, 0, &info, NULL, NULL, NULL, R_RIP); +} + +void EmitWineInt(x64emu_t* emu, int num, void* addr) +{ + siginfo_t info = { 0 }; + info.si_signo = X64_SIGSEGV; + info.si_errno = 0xdead; + info.si_code = num; + info.si_addr = NULL; // addr; + const char* x64name = NULL; + const char* elfname = NULL; + if (BOX64ENV(log) > LOG_INFO || BOX64ENV(dynarec_dump) || BOX64ENV(showsegv)) { + x64name = getAddrFunctionName(R_RIP); + elfheader_t* elf = FindElfAddress(my_context, R_RIP); + if (elf) + elfname = ElfName(elf); + printf_log(LOG_NONE, "Emit Interruption 0x%x at IP=%p(%s / %s) / addr=%p\n", num, (void*)R_RIP, x64name ? x64name : "???", elfname ? elfname : "?", addr); + } + if(box64_is32bits) + my_sigactionhandler_oldcode(emu, X64_SIGSEGV, 0, &info, NULL, NULL, NULL, R_RIP); + else { + uintptr_t frame = R_RSP; + int sig = X64_SIGSEGV; + // stack tracking + x64_stack_t *new_ss = my_context->onstack[sig]?sigstack_getstack():NULL; + int used_stack = 0; + if(new_ss) { + if(new_ss->ss_flags == SS_ONSTACK) { // already using it! + frame = ((uintptr_t)emu->regs[_SP].q[0] - 128) & ~0x0f; + } else { + frame = (uintptr_t)(((uintptr_t)new_ss->ss_sp + new_ss->ss_size - 16) & ~0x0f); + used_stack = 1; + new_ss->ss_flags = SS_ONSTACK; + } + } else { + frame -= 0x200; // redzone + } + + // TODO: do I need to really setup 2 stack frame? That doesn't seems right! + // setup stack frame + frame -= 512+64+16*16; + void* xstate = (void*)frame; + frame -= sizeof(siginfo_t); + siginfo_t* info2 = (siginfo_t*)frame; + memcpy(info2, &info, sizeof(siginfo_t)); + // try to fill some sigcontext.... + frame -= sizeof(x64_ucontext_t); + x64_ucontext_t *sigcontext = (x64_ucontext_t*)frame; + // get general register + sigcontext->uc_mcontext.gregs[X64_R8] = R_R8; + sigcontext->uc_mcontext.gregs[X64_R9] = R_R9; + sigcontext->uc_mcontext.gregs[X64_R10] = R_R10; + sigcontext->uc_mcontext.gregs[X64_R11] = R_R11; + sigcontext->uc_mcontext.gregs[X64_R12] = R_R12; + sigcontext->uc_mcontext.gregs[X64_R13] = R_R13; + sigcontext->uc_mcontext.gregs[X64_R14] = R_R14; + sigcontext->uc_mcontext.gregs[X64_R15] = R_R15; + sigcontext->uc_mcontext.gregs[X64_RAX] = R_RAX; + sigcontext->uc_mcontext.gregs[X64_RCX] = R_RCX; + sigcontext->uc_mcontext.gregs[X64_RDX] = R_RDX; + sigcontext->uc_mcontext.gregs[X64_RDI] = R_RDI; + sigcontext->uc_mcontext.gregs[X64_RSI] = R_RSI; + sigcontext->uc_mcontext.gregs[X64_RBP] = R_RBP; + sigcontext->uc_mcontext.gregs[X64_RSP] = R_RSP; + sigcontext->uc_mcontext.gregs[X64_RBX] = R_RBX; + sigcontext->uc_mcontext.gregs[X64_RIP] = R_RIP; + // flags + ResetFlags(emu); + sigcontext->uc_mcontext.gregs[X64_EFL] = emu->eflags.x64; + // get segments + sigcontext->uc_mcontext.gregs[X64_CSGSFS] = ((uint64_t)(R_CS)) | (((uint64_t)(R_GS))<<16) | (((uint64_t)(R_FS))<<32) | (((uint64_t)(R_SS))<<48); + if(R_CS==0x23) { + // trucate regs to 32bits, just in case + #define GO(R) sigcontext->uc_mcontext.gregs[X64_R##R]&=0xFFFFFFFF + GO(AX); + GO(CX); + GO(DX); + GO(DI); + GO(SI); + GO(BP); + GO(SP); + GO(BX); + GO(IP); + #undef GO + } + // get FloatPoint status + sigcontext->uc_mcontext.fpregs = xstate;//(struct x64_libc_fpstate*)&sigcontext->xstate; + fpu_xsave_mask(emu, xstate, 0, 0b111); + memcpy(&sigcontext->xstate, xstate, sizeof(sigcontext->xstate)); + ((struct x64_fpstate*)xstate)->res[12] = 0x46505853; // magic number to signal an XSTATE type of fpregs + ((struct x64_fpstate*)xstate)->res[13] = 0; // offset to xstate after this? + // get signal mask + if(new_ss) { + sigcontext->uc_stack.ss_sp = new_ss->ss_sp; + sigcontext->uc_stack.ss_size = new_ss->ss_size; + sigcontext->uc_stack.ss_flags = new_ss->ss_flags; + } else + sigcontext->uc_stack.ss_flags = SS_DISABLE; + // prepare info2 + info2->si_errno = 0; + info2->si_code = 128; + info2->si_addr = NULL; + sigcontext->uc_mcontext.gregs[X64_TRAPNO] = 13; + sigcontext->uc_mcontext.gregs[X64_ERR] = 0x02|(num<<3); + int exits = 0; + int ret; + ret = RunFunctionHandler(emu, &exits, 2, sigcontext, my_context->signals[info2->si_signo], 3, info2->si_signo, info2, sigcontext); + if(used_stack) // release stack + new_ss->ss_flags = 0; + // restore values + // general regs + R_R8 = sigcontext->uc_mcontext.gregs[X64_R8]; + R_R9 = sigcontext->uc_mcontext.gregs[X64_R9]; + R_R10 = sigcontext->uc_mcontext.gregs[X64_R10]; + R_R11 = sigcontext->uc_mcontext.gregs[X64_R11]; + R_R12 = sigcontext->uc_mcontext.gregs[X64_R12]; + R_R13 = sigcontext->uc_mcontext.gregs[X64_R13]; + R_R14 = sigcontext->uc_mcontext.gregs[X64_R14]; + R_R15 = sigcontext->uc_mcontext.gregs[X64_R15]; + R_RAX = sigcontext->uc_mcontext.gregs[X64_RAX]; + R_RCX = sigcontext->uc_mcontext.gregs[X64_RCX]; + R_RDX = sigcontext->uc_mcontext.gregs[X64_RDX]; + R_RDI = sigcontext->uc_mcontext.gregs[X64_RDI]; + R_RSI = sigcontext->uc_mcontext.gregs[X64_RSI]; + R_RBP = sigcontext->uc_mcontext.gregs[X64_RBP]; + R_RSP = sigcontext->uc_mcontext.gregs[X64_RSP]; + R_RBX = sigcontext->uc_mcontext.gregs[X64_RBX]; + R_RIP = sigcontext->uc_mcontext.gregs[X64_RIP]; + // flags + emu->eflags.x64 = sigcontext->uc_mcontext.gregs[X64_EFL]; + // get segments + R_CS = sigcontext->uc_mcontext.gregs[X64_CSGSFS]&0xffff; + R_GS = (sigcontext->uc_mcontext.gregs[X64_CSGSFS]>>16)&0xffff; + R_FS = (sigcontext->uc_mcontext.gregs[X64_CSGSFS]>>32)&0xffff; + R_SS = (sigcontext->uc_mcontext.gregs[X64_CSGSFS]>>48)&0xffff; + // fpu + fpu_xrstor_mask(emu, xstate, 0, 0b111); + } +} + diff --git a/src/os/freq_linux.c b/src/os/freq_linux.c new file mode 100644 index 0000000..f89f276 --- /dev/null +++ b/src/os/freq_linux.c @@ -0,0 +1,130 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "freq.h" +#include "debug.h" + +#if defined(RV64) +static size_t readBinarySizeFromFile(const char* fname) +{ + if (access(fname, R_OK) != 0) return -1; + FILE* fp = fopen(fname, "r"); + if (fp == NULL) return -1; + + char b[sizeof(uint64_t)] = { 0 }, tmp; + ssize_t n = fread(b, 1, sizeof(b), fp); + if (n <= 0) return -1; + + for (ssize_t i = 0; i < n / 2; i++) { + tmp = b[n - i - 1]; + b[n - i - 1] = b[i]; + b[i] = tmp; + } + return *(uint64_t*)b; +} + +static inline uint64_t readCycleCounter() +{ + uint64_t val; + asm volatile("rdtime %0" + : "=r"(val)); + return val; +} + +static inline uint64_t readFreq() +{ + static size_t val = -1; + + val = readBinarySizeFromFile("/sys/firmware/devicetree/base/cpus/timebase-frequency"); + if (val != (size_t)-1) return val; + + // fallback to rdtime + sleep + struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = 50000000; // 50 milliseconds + uint64_t cycles = readCycleCounter(); + nanosleep(&ts, NULL); + // round to MHz + val = (size_t)round(((double)(readCycleCounter() - cycles) * 20) / 1e6) * 1e6; + return (uint64_t)val; +} +#elif defined(ARM64) +static inline uint64_t readCycleCounter() +{ + uint64_t val; + asm volatile("mrs %0, cntvct_el0" + : "=r"(val)); + return val; +} +static inline uint64_t readFreq() +{ + uint64_t val; + asm volatile("mrs %0, cntfrq_el0" + : "=r"(val)); + return val; +} +#elif defined(LA64) +static inline uint64_t readCycleCounter() +{ + uint64_t val; + asm volatile("rdtime.d %0, %1" + : "=r"(val) : "r"(0)); + return val; +} + +static inline uint64_t readFreq() +{ + static size_t val = -1; + + if (box64_sysinfo.read_frequency) return box64_sysinfo.frequency; + + struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = 50000000; // 50 milliseconds + uint64_t cycles = readCycleCounter(); + nanosleep(&ts, NULL); + // round to MHz + val = (size_t)round(((double)(readCycleCounter() - cycles) * 20) / 1e6) * 1e6; + return (uint64_t)val; +} +#endif + +uint64_t ReadTSC(x64emu_t* emu) +{ + (void)emu; + + // Hardware counter, per architecture +#if defined(ARM64) || defined(RV64) || defined(LA64) + if (!box64_rdtsc) return readCycleCounter(); +#endif + // fall back to gettime... +#if !defined(NOGETCLOCK) + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC_COARSE, &ts); + return (uint64_t)(ts.tv_sec) * 1000000000LL + ts.tv_nsec; +#else + struct timeval tv; + gettimeofday(&tv, NULL); + return (uint64_t)(tv.tv_sec) * 1000000 + tv.tv_usec; +#endif +} + +uint64_t ReadTSCFrequency(x64emu_t* emu) +{ + (void)emu; + // Hardware counter, per architecture +#if defined(ARM64) || defined(RV64) || defined(LA64) + if (!box64_rdtsc) return readFreq(); +#endif + // fall back to get time +#if !defined(NOGETCLOCK) + return 1000000000LL; +#else + return 1000000; +#endif +} diff --git a/src/os/freq_wine.c b/src/os/freq_wine.c new file mode 100644 index 0000000..9879b60 --- /dev/null +++ b/src/os/freq_wine.c @@ -0,0 +1,17 @@ +#include "freq.h" + +// TODO: box64_rdtsc? + +uint64_t ReadTSC(x64emu_t* emu) { + uint64_t val; + asm volatile("mrs %0, cntvct_el0" + : "=r"(val)); + return val; +} + +uint64_t ReadTSCFrequency(x64emu_t* emu) { + uint64_t val; + asm volatile("mrs %0, cntfrq_el0" + : "=r"(val)); + return val; +} \ No newline at end of file diff --git a/src/os/hostext_common.c b/src/os/hostext_common.c new file mode 100644 index 0000000..6e526d6 --- /dev/null +++ b/src/os/hostext_common.c @@ -0,0 +1,70 @@ +#include "debug.h" + +#ifdef DYNAREC +void PrintHostCpuFeatures(void) +{ +#ifdef ARM64 + printf_log(LOG_INFO, "Dynarec for ARM64, with extension: ASIMD"); + if(cpuext.aes) + printf_log_prefix(0, LOG_INFO, " AES"); + if(cpuext.crc32) + printf_log_prefix(0, LOG_INFO, " CRC32"); + if(cpuext.pmull) + printf_log_prefix(0, LOG_INFO, " PMULL"); + if(cpuext.atomics) + printf_log_prefix(0, LOG_INFO, " ATOMICS"); + if(cpuext.sha1) + printf_log_prefix(0, LOG_INFO, " SHA1"); + if(cpuext.sha2) + printf_log_prefix(0, LOG_INFO, " SHA2"); + if(cpuext.uscat) + printf_log_prefix(0, LOG_INFO, " USCAT"); + if(cpuext.flagm) + printf_log_prefix(0, LOG_INFO, " FLAGM"); + if(cpuext.flagm2) + printf_log_prefix(0, LOG_INFO, " FLAGM2"); + if(cpuext.frintts) + printf_log_prefix(0, LOG_INFO, " FRINT"); + if(cpuext.afp) + printf_log_prefix(0, LOG_INFO, " AFP"); + if(cpuext.rndr) + printf_log_prefix(0, LOG_INFO, " RNDR"); + printf_log_prefix(0, LOG_INFO, "\n"); +#elif defined(LA64) + printf_log(LOG_INFO, "Dynarec for LoongArch with extension LSX"); + if (cpuext.lasx) + printf_log_prefix(0, LOG_INFO, " LASX"); + if (cpuext.lbt) + printf_log_prefix(0, LOG_INFO, " LBT_X86"); + if (cpuext.lam_bh) + printf_log_prefix(0, LOG_INFO, " LAM_BH"); + if (cpuext.lamcas) + printf_log_prefix(0, LOG_INFO, " LAMCAS"); + if (cpuext.scq) + printf_log_prefix(0, LOG_INFO, " SCQ"); + if (cpuext.frecipe) + printf_log_prefix(0, LOG_INFO, " FRECIP"); + printf_log_prefix(0, LOG_INFO, "\n"); +#elif defined(RV64) + printf_log(LOG_INFO, "Dynarec for rv64g"); + if (cpuext.vector && !cpuext.xtheadvector) printf_log_prefix(0, LOG_INFO, "v"); + if (cpuext.zba) printf_log_prefix(0, LOG_INFO, "_zba"); + if (cpuext.zbb) printf_log_prefix(0, LOG_INFO, "_zbb"); + if (cpuext.zbc) printf_log_prefix(0, LOG_INFO, "_zbc"); + if (cpuext.zbs) printf_log_prefix(0, LOG_INFO, "_zbs"); + if (cpuext.vector && !cpuext.xtheadvector) printf_log_prefix(0, LOG_INFO, "_zvl%d", cpuext.vlen * 8); + if (cpuext.xtheadba) printf_log_prefix(0, LOG_INFO, "_xtheadba"); + if (cpuext.xtheadbb) printf_log_prefix(0, LOG_INFO, "_xtheadbb"); + if (cpuext.xtheadbs) printf_log_prefix(0, LOG_INFO, "_xtheadbs"); + if (cpuext.xtheadmempair) printf_log_prefix(0, LOG_INFO, "_xtheadmempair"); + if (cpuext.xtheadcondmov) printf_log_prefix(0, LOG_INFO, "_xtheadcondmov"); + if (cpuext.xtheadmemidx) printf_log_prefix(0, LOG_INFO, "_xtheadmemidx"); + // Disable the display since these are only detected but never used. + // if(cpuext.xtheadfmemidx) printf_log_prefix(0, LOG_INFO, " xtheadfmemidx"); + // if(cpuext.xtheadmac) printf_log_prefix(0, LOG_INFO, " xtheadmac"); + // if(cpuext.xtheadfmv) printf_log_prefix(0, LOG_INFO, " xtheadfmv"); + if (cpuext.xtheadvector) printf_log_prefix(0, LOG_INFO, "_xthvector"); + printf_log_prefix(0, LOG_INFO, "\n"); +#endif +} +#endif \ No newline at end of file diff --git a/src/os/hostext_linux.c b/src/os/hostext_linux.c new file mode 100644 index 0000000..db2bd38 --- /dev/null +++ b/src/os/hostext_linux.c @@ -0,0 +1,261 @@ +#include + +#include "auxval.h" +#include "debug.h" + + +#ifdef ARM64 +#include +#include +#endif + +#ifdef RV64 +#include +#include +#include +#include "dynarec/rv64/rv64_emitter.h" + + +// Detect RV64 extensions, by executing on of the opcode with a SIGILL signal handler + +static sigjmp_buf sigbuf = {0}; +typedef int (*iFiip_t)(int, int, void*); +static void detect_sigill(int sig) +{ + siglongjmp(sigbuf, 1); +} + +static int Check(void* block) +{ + static uint64_t buf[2] = {0}; + // Clear instruction cache + __clear_cache(block, block+box64_pagesize); + // Setup SIGILL signal handler + __sighandler_t old = signal(SIGILL, detect_sigill); + if(sigsetjmp(sigbuf, 1)) { + // didn't work, extension not present + signal(SIGILL, old); + return 0; + } + int result = ((iFiip_t)block)(0, 1, buf); + if (result != 42) { + // wrong result, extension not present + signal(SIGILL, old); + return 0; + } + // done... + signal(SIGILL, old); + return 1; +} + +void rv64Detect(void) +{ + // Alloc memory to execute stuffs + void* my_block = mmap(NULL, box64_pagesize, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); + if(my_block==(void*)-1) { + return; + } + uint32_t* block; + #define EMIT(A) *block = (A); ++block + + + // THead vendor extensions + block = (uint32_t*)my_block; + ADDI(A0, xZR, 40); + ADDI(A1, xZR, 1); + TH_ADDSL(A0, A0, A1, 1); + BR(xRA); + cpuext.xtheadba + = cpuext.xtheadbb + = cpuext.xtheadbs + = cpuext.xtheadcondmov + = cpuext.xtheadmemidx + = cpuext.xtheadmempair + = cpuext.xtheadfmemidx + = cpuext.xtheadmac + = cpuext.xtheadfmv = Check(my_block); + + // Official extensions + + if (!cpuext.xtheadba) { + // Test Zba with ADDUW + block = (uint32_t*)my_block; + ADDUW(A0, A0, A1); + ADDI(A0, xZR, 42); + BR(xRA); + cpuext.zba = Check(my_block); + // Test Zbb with ANDN + block = (uint32_t*)my_block; + ANDN(A0, A0, A1); + ADDI(A0, xZR, 42); + BR(xRA); + cpuext.zbb = Check(my_block); + // Test Zbc with CLMUL + block = (uint32_t*)my_block; + CLMUL(A0, A0, A1); + ADDI(A0, xZR, 42); + BR(xRA); + cpuext.zbc = Check(my_block); + // Test Zbs with BCLR + block = (uint32_t*)my_block; + BCLR(A0, A0, A1); + ADDI(A0, xZR, 42); + BR(xRA); + cpuext.zbs = Check(my_block); + } + + block = (uint32_t*)my_block; + CSRRS(xZR, xZR, 0xc22 /* vlenb */); + ADDI(A0, xZR, 42); + BR(xRA); + cpuext.vector = Check(my_block); + + if (cpuext.vector) { + block = (uint32_t*)my_block; + CSRRS(xZR, xZR, 0x00f /* vcsr */); // vcsr does not exists in xtheadvector + ADDI(A0, xZR, 42); + BR(xRA); + cpuext.xtheadvector = !Check(my_block); + } + + if (cpuext.vector) { + int vlenb = 0; + asm volatile("csrr %0, 0xc22" : "=r"(vlenb)); + cpuext.vlen = vlenb; + if (vlenb < 16) { + // we need vlen >= 128 + cpuext.vector = 0; + } + } + + // Finish + // Free the memory my_block + munmap(my_block, box64_pagesize); +} +#endif + +#ifdef DYNAREC +int DetectHostCpuFeatures(void) +{ + memset(&cpuext, 0, sizeof(cpu_ext_t)); + char* p = BOX64ENV(dynarec_nohostext); +#ifdef ARM64 + unsigned long hwcap = real_getauxval(AT_HWCAP); + if(!hwcap) + hwcap = HWCAP_ASIMD; + // first, check all needed extensions, lif half, edsp and fastmult + if ((hwcap & HWCAP_ASIMD) == 0) return 0; + if (p == NULL || p[0] != '1') { + if(hwcap&HWCAP_CRC32) + cpuext.crc32 = 1; + if(hwcap&HWCAP_PMULL) + cpuext.pmull = 1; + if(hwcap&HWCAP_AES) + cpuext.aes = 1; + if(hwcap&HWCAP_ATOMICS) + cpuext.atomics = 1; + #ifdef HWCAP_SHA1 + if(hwcap&HWCAP_SHA1) + cpuext.sha1 = 1; + #endif + #ifdef HWCAP_SHA2 + if(hwcap&HWCAP_SHA2) + cpuext.sha2 = 1; + #endif + #ifdef HWCAP_USCAT + if(hwcap&HWCAP_USCAT) + cpuext.uscat = 1; + #endif + #ifdef HWCAP_FLAGM + if(hwcap&HWCAP_FLAGM) + cpuext.flagm = 1; + #endif + unsigned long hwcap2 = real_getauxval(AT_HWCAP2); + #ifdef HWCAP2_FLAGM2 + if(hwcap2&HWCAP2_FLAGM2) + cpuext.flagm2 = 1; + #endif + #ifdef HWCAP2_FRINT + if(hwcap2&HWCAP2_FRINT) + cpuext.frintts = 1; + #endif + #ifdef HWCAP2_AFP + if(hwcap2&HWCAP2_AFP) + cpuext.afp = 1; + #endif + #ifdef HWCAP2_RNG + if(hwcap2&HWCAP2_RNG) + cpuext.rndr = 1; + #endif + if (p) { + p = strtok(p, ","); + while (p) { + if (!strcasecmp(p, "crc32")) cpuext.crc32 = 0; + if (!strcasecmp(p, "pmull")) cpuext.pmull = 0; + if (!strcasecmp(p, "aes")) cpuext.aes = 0; + if (!strcasecmp(p, "atomics")) cpuext.atomics = 0; + if (!strcasecmp(p, "sha1")) cpuext.sha1 = 0; + if (!strcasecmp(p, "sha2")) cpuext.sha2 = 0; + if (!strcasecmp(p, "uscat")) cpuext.uscat = 0; + if (!strcasecmp(p, "flagm")) cpuext.flagm = 0; + if (!strcasecmp(p, "flagm2")) cpuext.flagm2 = 0; + if (!strcasecmp(p, "frintts")) cpuext.frintts = 0; + if (!strcasecmp(p, "afp")) cpuext.afp = 0; + if (!strcasecmp(p, "rndr")) cpuext.rndr = 0; + p = strtok(NULL, ","); + } + } + } +#elif defined(LA64) + if (p == NULL || p[0] != '1') { + uint32_t cpucfg2 = 0, idx = 2; + asm volatile("cpucfg %0, %1" : "=r"(cpucfg2) : "r"(idx)); + if (!((cpucfg2 >> 6) & 0b1)) return 0; // LSX must present + + cpuext.lasx = (cpucfg2 >> 7) & 0b1; + cpuext.lbt = (cpucfg2 >> 18) & 0b1; + cpuext.frecipe = (cpucfg2 >> 25) & 0b1; + cpuext.lam_bh = (cpucfg2 >> 27) & 0b1; + cpuext.lamcas = (cpucfg2 >> 28) & 0b1; + cpuext.scq = (cpucfg2 >> 30) & 0b1; + if (p) { + p = strtok(p, ","); + while (p) { + if (!strcasecmp(p, "lasx")) cpuext.lasx = 0; + if (!strcasecmp(p, "lbt")) cpuext.lbt = 0; + if (!strcasecmp(p, "frecipe")) cpuext.frecipe = 0; + if (!strcasecmp(p, "lam_bh")) cpuext.lam_bh = 0; + if (!strcasecmp(p, "lamcas")) cpuext.lamcas = 0; + if (!strcasecmp(p, "scq")) cpuext.scq = 0; + p = strtok(NULL, ","); + } + } + } +#elif defined(RV64) + if (p == NULL || p[0] != '1') { + rv64Detect(); + if (p) { + p = strtok(p, ","); + while (p) { + if (!strcasecmp(p, "zba")) cpuext.zba = 0; + if (!strcasecmp(p, "zbb")) cpuext.zbb = 0; + if (!strcasecmp(p, "zbc")) cpuext.zbc = 0; + if (!strcasecmp(p, "zbs")) cpuext.zbs = 0; + if (!strcasecmp(p, "vector")) { + cpuext.vector = 0; + cpuext.xtheadvector = 0; + } + if (!strcasecmp(p, "xtheadba")) cpuext.xtheadba = 0; + if (!strcasecmp(p, "xtheadbb")) cpuext.xtheadbb = 0; + if (!strcasecmp(p, "xtheadbs")) cpuext.xtheadbs = 0; + if (!strcasecmp(p, "xtheadmemidx")) cpuext.xtheadmemidx = 0; + if (!strcasecmp(p, "xtheadmempair")) cpuext.xtheadmempair = 0; + if (!strcasecmp(p, "xtheadcondmov")) cpuext.xtheadcondmov = 0; + p = strtok(NULL, ","); + } + } + } +#endif + return 1; +} +#endif \ No newline at end of file diff --git a/src/os/hostext_wine.c b/src/os/hostext_wine.c new file mode 100644 index 0000000..3dd9551 --- /dev/null +++ b/src/os/hostext_wine.c @@ -0,0 +1,47 @@ +#include +#include + +#include "debug.h" +#include "wine/compiler.h" +#include "wine/debug.h" + +int DetectHostCpuFeatures(void) +{ + cpuext.asimd = 1; + if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) + cpuext.aes = cpuext.sha1 = cpuext.sha2 = cpuext.pmull = 1; + if (IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE)) + cpuext.crc32 = 1; + if (IsProcessorFeaturePresent(PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE)) + cpuext.atomics = 1; + + // Read from the registry to get the rest, consider as a success even if it fails + HKEY key; + ULONGLONG value; + DWORD size = sizeof(value); + if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", 0, KEY_READ, &key)) + return 1; + + if (RegQueryValueExA(key, "CP 4030" /* ID_AA64ISAR0_EL1 */, NULL, NULL, (LPBYTE)&value, &size) == ERROR_SUCCESS) { + // TS, bits[55:52] + cpuext.flagm = !!((value >> 52) & 0x1); + cpuext.flagm2 = !!((value >> 53) & 0x1); + // PRINTTS, bits[35:32] + cpuext.frintts = !!((value >> 32) & 0x1); + // RND, bits[63:60] + cpuext.rndr = !!((value >> 60) & 0x1); + } + size = sizeof(value); + if (RegQueryValueExA(key, "CP 4039" /* ID_AA64MMFR1_EL1 */, NULL, NULL, (LPBYTE)&value, &size) == ERROR_SUCCESS) { + // AFP, bits[47:44] + cpuext.afp = !!((value >> 44) & 0x1); + } + size = sizeof(value); + if (RegQueryValueExA(key, "CP 403A" /* ID_AA64MMFR2_EL1 */, NULL, NULL, (LPBYTE)&value, &size) == ERROR_SUCCESS) { + // AT, bits[35:32] + cpuext.uscat = !!((value >> 32) & 0x1); + } + + RegCloseKey(key); + return 1; +} diff --git a/src/os/my_cpuid.c b/src/os/my_cpuid.c new file mode 100644 index 0000000..52f2949 --- /dev/null +++ b/src/os/my_cpuid.c @@ -0,0 +1,572 @@ +#define _GNU_SOURCE +#include +#include + +#include "my_cpuid.h" +#include "../emu/x64emu_private.h" +#include "debug.h" +#include "freq.h" + +void my_cpuid(x64emu_t* emu, uint32_t tmp32u) +{ + emu->regs[_AX].dword[1] = emu->regs[_DX].dword[1] = emu->regs[_CX].dword[1] = emu->regs[_BX].dword[1] = 0; + int ncpu = box64_sysinfo.box64_ncpu; + if (!ncpu) ncpu = 1; + int ncluster = 1; + static int warned = 10; + if(BOX64ENV(cputype)) { + while(ncpu>256) { + ncluster++; // do cluster of 256 cpus... + if(ncpu>=256) + ncpu-=256; + else + ncpu=256; + } + } else { + while(ncpu>64) { + ncluster++; // do cluster of 64 cpus... + if(ncpu>=128) + ncpu-=64; + else + ncpu=64; + } + } + static char branding[3*4*4+1] = ""; + if(!branding[0]) { + strncpy(branding, box64_sysinfo.box64_cpuname, 3*4*4); + while(strlen(branding)<3*4*4) { + memmove(branding+1, branding, strlen(branding)+1); + branding[0] = ' '; + } + } + uint32_t subleaf = R_ECX; + //printf_log(LOG_INFO, "%04d|%p: cpuid leaf=0x%x (subleaf=0x%x)", GetTID(), (void*)R_RIP, tmp32u, subleaf); + switch(tmp32u) { + case 0x0: + // emulate a P4. TODO: Emulate a Core2? + R_RAX = BOX64ENV(cputype)?0x0000000f:0x00000016; + if(BOX64ENV(cputype)) { + // return AuthenticAMD + R_RBX = 0x68747541; + R_RCX = 0x444d4163; + R_RDX = 0x69746E65; + } else { + // return GenuineIntel + R_RBX = 0x756E6547; + R_RCX = 0x6C65746E; + R_RDX = 0x49656E69; + } + break; + case 0x1: + if(BOX64ENV(cputype)) { + R_RAX = (0xc<<0) | // stepping 0-3 + (0x1<<4) | // base model 4-7 + (0xf<<8) | // base familly 8-11 + (0x0<<12)| // reserved 12-15 + (0x7<<16)| // Extented model 16-19 + (0x8<<20)| // extended familly 20-27 + (0x0<<28)| // reserved 28-31 + 0 ; // family and all, simulating a Ryzen 5 type of cpu + } else { + R_RAX = (0x1<<0) | // stepping + (0x6<<4) | // model + (0x6<<8) | // familly + (0x0<<12)| // Processor type + (0x0<<14)| // reserved + (0x4<<16)| // extended model + (0x0<<20)| // extended familly + 0 ; // family and all, simulating Haswell type of cpu + } + R_RBX = 0 | (8<<0x8) | ((BOX64ENV(cputype)?0:ncluster)<<16); // Brand index, CLFlush (8), Max APIC ID (16-23), Local APIC ID (24-31) + /*{ + int cpu = sched_getcpu(); + if(cpu<0) cpu=0; + R_RAX |= cpu<<24; + }*/ + R_RDX = 1 // fpu + | 1<<1 // vme + | 1<<2 // debugging extension + | 1<<3 // pse + | 1<<4 // rdtsc + | 1<<5 // msr + | 1<<6 // pae + | 1<<7 // mcheck extension + | 1<<8 // cmpxchg8 + | 1<<11 // sep (sysenter & sysexit) + | 1<<12 // mtrr + | 1<<13 // pgb + | 1<<14 // mcheck arch + | 1<<15 // cmov + | 1<<16 // pat + | 1<<17 // pse36 + | 1<<19 // clflush (seems to be with SSE2) + | 1<<21 // DS, used with VMX, is that usefull? + | 1<<23 // mmx + | 1<<24 // fxsr (fxsave, fxrestore) + | 1<<25 // SSE + | 1<<26 // SSE2 + | (BOX64ENV(cputype)?0:1)<<28 // HT / Multi-core + ; + R_RCX = 1<<0 // SSE3 + | BOX64ENV(pclmulqdq)<<1 // PCLMULQDQ + | (BOX64ENV(cputype)?0:1)<<2 // DS 64bits + | 1<<3 // Monitor/MWait (priviledge instructions) + | (BOX64ENV(cputype)?0:1)<<5 // VMX //is that usefull + | 1<<9 // SSSE3 + | BOX64ENV(avx2)<<12 // fma + | 1<<13 // cx16 (cmpxchg16) + | 1<<19 // SSE4_1 + | BOX64ENV(sse42)<<20 // SSE4_2 can be hiden + | 1<<22 // MOVBE + | 1<<23 // POPCOUNT + | BOX64ENV(aes)<<25 // aesni + | BOX64ENV(avx)<<26 // xsave + | BOX64ENV(avx)<<27 // osxsave + | BOX64ENV(avx)<<28 // AVX + | BOX64ENV(avx)<<29 // F16C + | BOX64ENV(avx2)<<30 // RDRAND + | 0<<31 // Hypervisor guest running + ; + break; + case 0x2: + if(BOX64ENV(cputype)) { + // reserved + R_RAX = R_RBX = R_RCX = R_RDX = 0 ; + } else { + // TLB and Cache info. Sending 9th gen i3 info... + R_RAX = 0x76036301; + R_RBX = 0x00f0b6ff; + R_RCX = 0x00000000; + R_RDX = 0x00c30000; + } + break; + + case 0x4: + if(BOX64ENV(cputype)) { + // reserved + R_RAX = R_RBX = R_RCX = R_RDX = 0 ; + } else { + // Cache info + switch (subleaf) { + case 0: // L1 data cache + R_RAX = 0x4121 | ((ncpu-1)<<26); //type + (26-31):max cores per packages-1 + R_RBX = 0x01c0003f; // size + R_RCX = 63; + R_RDX = 0; + break; + case 1: // L1 inst cache + R_RAX = 0x4122 | ((ncpu-1)<<26); //type + R_RBX = 0x01c0003f; // size + R_RCX = 63; + R_RDX = 0; + break; + case 2: // L2 cache + R_RAX = 0x4143 | ((ncpu-1)<<26); //type + R_RBX = 0x00c0003f; // size + R_RCX = 1023; + R_RDX = 0; + break; + case 3: // L3 cache + R_RAX = 0x3c63 | ((ncpu-1)<<26); //type + R_RBX = 0x02c0003f; // size + R_RCX = 8191; + R_RDX = 6; + break; + default: + R_RAX = 0x00000000; + R_RBX = 0x00000000; + R_RCX = 0x00000000; + R_RDX = 0x00000000; + break; + } + } + break; + case 0x5: //mwait info + R_RAX = 0x40; + R_RBX = 0x40; + R_RCX = 1 | 2; + R_RDX = 0x11142120; + break; + case 0x3: // PSN + case 0x6: // thermal + case 0x8: // more extended capabilities + case 0x9: // direct cache access + case 0xA: // Architecture performance monitor + R_RAX = 0; + R_RBX = 0; + R_RCX = 0; + R_RDX = 0; + break; + case 0x7: + // extended bits... + if(subleaf==0) { + R_RAX = 0; + R_RBX = 1<<0 // FSGSBASE + | BOX64ENV(avx)<<3 // BMI1 + | BOX64ENV(avx2)<<5 //AVX2 + | (BOX64ENV(cputype)?0:1)<<6 // FDP_EXCPTN_ONLY + | 1<<7 // SMEP + | BOX64ENV(avx2)<<8 //BMI2 + | (BOX64ENV(cputype)?0:1)<<9 // Enhanced REP MOVSB // is it a good idea? + | 1<<10 //INVPCID (priviledge instruction + | (BOX64ENV(cputype)?0:1)<<13 // Deprecates FPU CS and FPU DS + | 0<<18 // RDSEED + | BOX64ENV(avx2)<<19 //ADX + | 1<<23 // CLFLUSHOPT + | 1<<24 // CLWB + | BOX64ENV(shaext)<<29 // SHA extension + ; + R_RCX = + (BOX64ENV(avx)&&BOX64ENV(aes))<<9 | //VAES + (BOX64ENV(avx2)&&BOX64ENV(pclmulqdq))<<10 | //VPCLMULQDQ. + 1<<22 | // RDPID + 0; + R_RDX = 0; + + } else {R_RAX = R_RCX = R_RBX = R_RDX = 0;} + break; + case 0xB: + if(BOX64ENV(cputype)) { + // reserved + R_RAX = R_RBX = R_RCX = R_RDX = 0 ; + } else { + // Extended Topology Enumeration Leaf + R_RAX = 0; + R_RBX = (subleaf==0)?1:((subleaf==1)?ncpu:0); + R_RCX |= (subleaf==0)?0x100:((subleaf==1)?0x200:0); + #ifdef WIN32 + int cpu = 0; + #else + int cpu = sched_getcpu(); + if(cpu<0) cpu=0; + #endif + R_RDX = cpu; + } + break; + case 0xC: + if(BOX64ENV(cputype)) { + // reserved + R_RAX = R_RBX = R_RCX = R_RDX = 0; + } else { + //? + R_RAX = R_RBX = R_RCX = R_RDX = 0; + } + break; + case 0xD: + // Processor Extended State Enumeration Main Leaf / Sub Leaf + switch(subleaf) { + case 0: + R_RAX = 0b111; // x87 SSE AVX saved + R_RBX = 512+64+16*16; // size of xsave/xrstor + R_RCX = 512+64+16*16; // maximum size of xsave area + R_RDX = 0; // more bits + break; + case 1: + R_RAX = 0; // XSAVEOPT (0) and XSAVEC (1), XGETBV with ECX=1 (2) XSAVES (3) and XFD (4) not supported yet + R_RCX = R_RBX = R_RDX = 0; + break; + case 2: + // componant 2: avx + R_RAX = 16*16; // size of the avx block + R_RBX = 512+64; // offset + R_RCX = 0; + R_RDX = 0; + break; + default: + R_RAX = R_RCX = R_RBX = R_RDX = 0; + break; + } + break; + case 0xE: //? + R_RAX = R_RCX = R_RBX = R_RDX = 0; + break; + case 0xF: + if(BOX64ENV(cputype)) { + // reserved + R_RAX = R_RBX = R_RCX = R_RDX = 0 ; + } else { + //L3 Cache + switch(subleaf) { + case 0: + R_RAX = 0; + R_RBX = 0; // maximum range of RMID of physical processor + R_RCX = 0; + R_RDX = 0; // bit 1 support L3 RDT Cache monitoring + break; + case 1: + R_RAX = 0; + R_RCX = 0; + R_RBX = 0; // Conversion factor + R_RDX = 0; // bit 0 = occupency monitoring + break; + default: R_RAX = R_RBX = R_RCX = R_RDX = 0; + } + } + break; + case 0x10: + case 0x11: + case 0x12: + case 0x13: + R_RAX = R_RBX = R_RCX = R_RDX = 0; + break; + case 0x14: + if(BOX64ENV(cputype)) { + // reserved + R_RAX = R_RBX = R_RCX = R_RDX = 0; + } else { + // Processor Trace Enumeration Main Leaf + switch(subleaf) { + case 0: // main leaf + R_RAX = 1; // max sub-leaf + R_RBX = 0xf; + R_RCX = 0x7; + R_RDX = 0; + break; + case 1: + R_RAX = 0x02490002; + R_RBX = 0x003f3fff; + R_RCX = 0; + R_RDX = 0; + break; + default: R_RAX = R_RBX = R_RCX = R_RDX = 0; + } + } + break; + case 0x15: + if(BOX64ENV(cputype)) { + // reserved + R_RAX = R_RBX = R_RCX = R_RDX = 0; + } else { + // TSC core frenquency + R_RAX = 0x02; // denominator + R_RBX = 0x120; // numerator + /*{ + uint64_t freq = ReadTSCFrequency(emu); + while(freq>100000000) { + freq/=10; + R_RAX *= 10; + } + R_RCX = freq; // nominal frequency in Hz + }*/ + R_RCX = 0; + R_RDX = 0; + } + break; + case 0x16: + if(BOX64ENV(cputype)) { + R_RAX = R_RBX = R_RCX = R_RDX = 0; + } else { + R_RAX = box64_sysinfo.frequency / 1000000; + R_RBX = box64_sysinfo.frequency / 1000000; + R_RCX = 100; + R_RDX = 0; + + } + break; + case 0x40000000 ... 0x400000FF: + // the Hypervisor interface, yeah we don't do this, see also the 31bit of ECX in leaf 0x1. + R_RAX = 0; + R_RBX = 0; + R_RCX = 0; + R_RDX = 0; + break; + case 0x80000000: // max extended + if(BOX64ENV(cputype)) { + R_RAX = 0x8000001a; + R_RBX = 0x68747541; + R_RCX = 0x444d4163; + R_RDX = 0x69746E65; + } else { + R_RAX = 0x80000008; + R_RBX = 0; + R_RCX = 0; + R_RDX = 0; + } + break; + case 0x80000001: //Extended Processor Signature and Feature Bits + if(BOX64ENV(cputype)) { + R_RAX = (0xc<<0) | // stepping 0-3 + (0x1<<4) | // base model 4-7 + (0xf<<8) | // base familly 8-11 + (0x0<<12)| // reserved 12-15 + (0x7<<16)| // Extented model 16-19 + (0x8<<20)| // extended familly 20-27 + (0x0<<28)| // reserved 28-31 + 0 ; // family and all, simulating a Ryzen 5 type of cpu + R_RBX = 0; //0-15 brandID, 16-27 reserved, 28-31 PkgType + R_RCX = 1<<0 // LAHF/SAHF + | 1<<1 // cmplegacy? + | 1<<2 // securevm + | 1<<5 // ABM (LZCNT) + | 1<<6 // SSE4a (extrq, instrq, movntss, movntsd) + //| 1<<7 // misaligned SSE + | 1<<8 // 3DNowPrefetch + //| 1<<10 // IBS + //| 1<<11 // XOP + //| 1<<16 // FMA4 + ; + R_RDX = 1 // fpu + | 1<<2 // debugging extension + | 1<<3 // pse + | 1<<4 // rdtsc + | 1<<5 // msr + | 1<<6 // pae + | 1<<8 // cmpxchg8 + | 1<<11 // sep (sysenter & sysexit) + | 1<<12 // mtrr + | 1<<13 // pge + | 1<<15 // cmov + | 1<<16 // pat + | 1<<17 // pse36 + | 1<<19 // clflush (seems to be with SSE2) + | 1<<20 // NX + | 1<<21 // DS, used with VMX, is that usefull? + | 1<<22 // MMXext + | 1<<23 // mmx + | 1<<24 // fxsr (fxsave, fxrestore) + //| 1<<25 // FFXSR + //| 1<<26 // Page1GB + | 1<<27 // RDTSCP + | 1<<29 //LM + //| 1<<30 //3DNowExt + //| 1<<31 //3DNow! + ; + } else { + R_RAX = 0; // reserved + R_RBX = 0; // reserved + R_RCX = (1<<0) // LAHF_LM + | (1<<5) // LZCNT + | (1<<8) // PREFETCHW + ; + R_RDX = 1 // x87 FPU + | (1<<8) // cx8: cmpxchg8b opcode + | (1<<11) // syscall + | (1<<15) // cmov: FCMOV opcodes + | (1<<20) // NX + | (1<<23) // mmx: MMX available + | (1<<24) // fxsave + | (1<<27) // rdtscp + | (1<<29); // long mode 64bits available + } + break; + case 0x80000002: // Brand part 1 (branding signature) + R_RAX = ((uint32_t*)branding)[0]; + R_RBX = ((uint32_t*)branding)[1]; + R_RCX = ((uint32_t*)branding)[2]; + R_RDX = ((uint32_t*)branding)[3]; + break; + case 0x80000003: // Brand part 2 + R_RAX = ((uint32_t*)branding)[4]; + R_RBX = ((uint32_t*)branding)[5]; + R_RCX = ((uint32_t*)branding)[6]; + R_RDX = ((uint32_t*)branding)[7]; + break; + case 0x80000004: // Brand part 3, with frequency + R_RAX = ((uint32_t*)branding)[8]; + R_RBX = ((uint32_t*)branding)[9]; + R_RCX = ((uint32_t*)branding)[10]; + R_RDX = ((uint32_t*)branding)[11]; + break; + case 0x80000005: + if(BOX64ENV(cputype)) { + //L1 cache and TLB + R_RAX = 0; + R_RBX = 0; + R_RCX = 0; + R_RDX = 0; + } else { + R_RAX = 0; + R_RBX = 0; + R_RCX = 0; + R_RDX = 0; + } + break; + case 0x80000006: // L2 cache line size and associativity + if(BOX64ENV(cputype)) { + R_RAX = 0; + R_RBX = 0; + R_RCX = 64 | (0x6<<12) | (256<<16); // bits: 0-7 line size, 15-12: assoc (using special encoding), 31-16: size in K //TODO: read info from /sys/devices/system/cpu/cpuX/cache/index2 + R_RDX = 0; + } else { + R_RAX = 0; + R_RBX = 0; + R_RCX = 64 | (0x6<<12) | (256<<16); // bits: 0-7 line size, 15-12: assoc (using special encoding), 31-16: size in K //TODO: read info from /sys/devices/system/cpu/cpuX/cache/index2 + R_RDX = 0; + } + break; + case 0x80000007: + if(BOX64ENV(cputype)) { + // Advanced Power Management Information + R_RAX = 0; + R_RBX = 0; + R_RCX = 0; + R_RDX = 0 | (1<<8); // Invariant TSC + } else { + // Invariant TSC + R_RAX = 0; + R_RBX = 0; + R_RCX = 0; + R_RDX = 0 /*| (1<<8)*/; // Invariant TSC + } + break; + case 0x80000008: + if(BOX64ENV(cputype)) { + // Address Size And Physical Core Count Information + R_RAX = 0; // 23-16 guest / 15-8 linear / 7-0 phys + R_RBX = 0; // reserved + R_RCX = ncpu-1; + R_RDX = 0; + } else { + // ? + R_RAX = 0x0000302e;//? + R_RBX = 0; + R_RCX = 0; + R_RDX = 0; + } + break; + case 0x8000000a: + if(BOX64ENV(cputype)) { + // SVM Revision and Feature Identification + R_RAX = 0; + R_RBX = 0; + R_RCX = 0; + R_RDX = 0; + } else { + // ? + R_RAX = 0; + R_RBX = 0; + R_RCX = 0; + R_RDX = 0; + } + break; + case 0x8000001a: + if(BOX64ENV(cputype)) { + // Performance Optimization Identifiers + R_RAX = 1<<0 // FP128 + | 1<<1 // MOVU + | 0; + R_RBX = 0; + R_RCX = 0; + R_RDX = 0; + } else { + // ? + R_RAX = 0; + R_RBX = 0; + R_RCX = 0; + R_RDX = 0; + } + break; + default: + if(warned) { + printf_log(LOG_INFO, "Warning, CPUID command %X unsupported (ECX=%08x)\n", tmp32u, R_RCX); + --warned; + if(!warned) + printf_log(LOG_INFO, "Stopped logging CPUID issues\n"); + } + R_RAX = 0; + R_RBX = 0; + R_RCX = 0; + R_RDX = 0; + } + //printf_log_prefix(0, LOG_INFO, " => EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n", R_RAX, R_RBX, R_RCX, R_RDX); +} diff --git a/src/os/os_linux.c b/src/os/os_linux.c new file mode 100644 index 0000000..5403294 --- /dev/null +++ b/src/os/os_linux.c @@ -0,0 +1,280 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "os.h" +#include "signals.h" +#include "emu/x64int_private.h" +#include "bridge.h" +#include "elfloader.h" +#include "env.h" +#include "debug.h" +#include "x64tls.h" +#include "librarian.h" +#include "emu/x64emu_private.h" + +int GetTID(void) +{ + return syscall(SYS_gettid); +} + +int SchedYield(void) +{ + return sched_yield(); +} + +int IsBridgeSignature(char s, char c) +{ + return s == 'S' && c == 'C'; +} + +void EmuInt3(void* emu, void* addr) +{ + return x64Int3((x64emu_t*)emu, (uintptr_t*)addr); +} + +int IsNativeCall(uintptr_t addr, int is32bits, uintptr_t* calladdress, uint16_t* retn) +{ + return isNativeCallInternal(addr, is32bits, calladdress, retn); +} + +void* EmuFork(void* emu, int forktype) +{ + return x64emu_fork((x64emu_t*)emu, forktype); +} + +void EmuX64Syscall(void* emu) +{ + x64Syscall((x64emu_t*)emu); +} + +void EmuX64Syscall_linux(void* emu) +{ + x64Syscall_linux((x64emu_t*)emu); +} + +void EmuX86Syscall(void* emu) +{ + x86Syscall((x64emu_t*)emu); +} + +extern int box64_is32bits; + +void* GetSeg43Base(void* emu) +{ + tlsdatasize_t* ptr = ((x64emu_t*)emu)->tlsdata; + return ptr?ptr->data:NULL; +} + +void* GetSegmentBase(void* emu, uint32_t desc) +{ + if (!desc) { + printf_log(LOG_NONE, "Warning, accessing segment NULL\n"); + return NULL; + } + int base = desc >> 3; + int is_ldt = !!(desc&4); + base_segment_t* segs = is_ldt?((x64emu_t*)emu)->segldt:((base>5)?((x64emu_t*)emu)->seggdt:my_context->seggdt); + if(!box64_nolibs) { + if (!box64_is32bits && (base == 0x8) ) + return GetSeg43Base((x64emu_t*)emu); + if (box64_is32bits && (base == 0x6)) + return GetSeg43Base((x64emu_t*)emu); + } + if (base > 15) { + printf_log(LOG_NONE, "Warning, accessing segment unknown 0x%x or unset\n", desc); + return NULL; + } + + void* ptr = (void*)segs[base].base; + return ptr; +} + +const char* GetBridgeName(void* p) +{ + return getBridgeName(p); +} + +const char* GetNativeName(void* p) +{ + static char buff[500] = { 0 }; + { + const char* n = GetBridgeName(p); + if (n) + return n; + } + Dl_info info; + if (dladdr(p, &info) == 0) { + const char* ret = GetNameOffset(my_context->maplib, p); + if (ret) + return ret; + sprintf(buff, "%s(%p)", "???", p); + return buff; + } else { + if (info.dli_sname) { + strcpy(buff, info.dli_sname); + if (info.dli_fname) { + strcat(buff, "("); + strcat(buff, info.dli_fname); + strcat(buff, ")"); + } + } else { + sprintf(buff, "%s(%s+%p)", "???", info.dli_fname, (void*)(p - info.dli_fbase)); + return buff; + } + } + return buff; +} + + +void PersonalityAddrLimit32Bit(void) +{ + personality(ADDR_LIMIT_32BIT); + #ifndef ANDROID + /*struct rlimit l; + if(getrlimit(RLIMIT_DATA, &l)<0) return; // failed + if(l.rlim_max>3*1024*1024*1024LL) { + l.rlim_cur = 3*1024*1024*1024LL; + setrlimit(RLIMIT_DATA, &l); + }*/ + // setting 32bits malloc options + mallopt(M_ARENA_TEST, 2); + mallopt(M_ARENA_MAX, 2); + mallopt(M_MMAP_THRESHOLD, 128*1024); + #endif +} + +int IsAddrElfOrFileMapped(uintptr_t addr) +{ + return FindElfAddress(my_context, addr) || IsAddrFileMapped(addr, NULL, NULL); +} + +void* InternalMmap(void* addr, unsigned long length, int prot, int flags, int fd, ssize_t offset) +{ +#if 1 // def STATICBUILD + void* ret = (void*)syscall(__NR_mmap, addr, length, prot, flags, fd, offset); +#else + static int grab = 1; + typedef void* (*pFpLiiiL_t)(void*, unsigned long, int, int, int, size_t); + static pFpLiiiL_t libc_mmap64 = NULL; + if (grab) { + libc_mmap64 = dlsym(RTLD_NEXT, "mmap64"); + } + void* ret = libc_mmap64(addr, length, prot, flags, fd, offset); +#endif + return ret; +} + +int InternalMunmap(void* addr, unsigned long length) +{ +#if 1 // def STATICBUILD + int ret = syscall(__NR_munmap, addr, length); +#else + static int grab = 1; + typedef int (*iFpL_t)(void*, unsigned long); + static iFpL_t libc_munmap = NULL; + if (grab) { + libc_munmap = dlsym(RTLD_NEXT, "munmap"); + } + int ret = libc_munmap(addr, length); +#endif + return ret; +} + +extern FILE* ftrace; +extern char* ftrace_name; +static int trace_fd = -1; + +static void checkFtrace() +{ + trace_fd = fileno(ftrace); + if (trace_fd < 0 || lseek(trace_fd, 0, SEEK_CUR) == (off_t)-1) { + ftrace = fopen(ftrace_name, "a"); + trace_fd = fileno(ftrace); + printf_log(LOG_INFO, "%04d|Recreated trace because fd was invalid\n", GetTID()); + } +} + +void PrintfFtrace(int prefix, const char* fmt, ...) +{ + if (ftrace_name) { + checkFtrace(); + } else if(trace_fd==-1) + trace_fd = fileno(ftrace); + // using a combinaison of (v)sprintf an write as it's re-entrant, not like (v)fprintf + + static const char* names[2] = { "BOX64", "BOX32" }; + + char tmp[8192]; + + if (prefix && (ftrace == stdout || ftrace == stderr)) { + if (prefix > 1) { + sprintf(tmp, "[\033[31m%s\033[0m] ", names[box64_is32bits]); + } else { + sprintf(tmp, "[%s] ", names[box64_is32bits]); + } + write(trace_fd, tmp, strlen(tmp)); + } + va_list args; + va_start(args, fmt); + vsprintf(tmp, fmt, args); + fflush(ftrace); + va_end(args); + write(trace_fd, tmp, strlen(tmp)); +} + +void* GetEnv(const char* name) +{ + return getenv(name); +} + +int FileExist(const char* filename, int flags) +{ + struct stat sb; + if (stat(filename, &sb) == -1) + return 0; + if (flags == -1) + return 1; + // check type of file? should be executable, or folder + if (flags & IS_FILE) { + if (!S_ISREG(sb.st_mode)) + return 0; + } else if (!S_ISDIR(sb.st_mode)) + return 0; + + if (flags & IS_EXECUTABLE) { + if ((sb.st_mode & S_IXUSR) != S_IXUSR) + return 0; // nope + } + return 1; +} + +int MakeDir(const char* folder) +{ + int ret = mkdir(folder, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + if(!ret || ret==EEXIST) + return 1; + return 0; +} + +size_t FileSize(const char* filename) +{ + struct stat sb; + if (stat(filename, &sb) == -1) + return 0; + // check type of file? should be executable, or folder + if (!S_ISREG(sb.st_mode)) + return 0; + return sb.st_size; +} diff --git a/src/os/os_wine.c b/src/os/os_wine.c new file mode 100644 index 0000000..14a6001 --- /dev/null +++ b/src/os/os_wine.c @@ -0,0 +1,262 @@ +#include +#include +#include +#include +#include + +#include "os.h" +#include "debug.h" +#include "wine/compiler.h" +#include "wine/debug.h" + +#define HandleToULong(h) ((ULONG)(ULONG_PTR)(h)) + +NTSTATUS WINAPI NtYieldExecution(void); + +int box64_isAddressSpace32 = 0; + +int GetTID(void) +{ + return HandleToULong(((HANDLE*)NtCurrentTeb())[9]); +} + +int SchedYield(void) +{ + return (NtYieldExecution() != STATUS_NO_YIELD_PERFORMED); +} + +int IsBridgeSignature(char s, char c) +{ + return FALSE; +} + +void* GetSeg43Base(void* emu) +{ + return NULL; +} + +void* GetSegmentBase(void* emu, uint32_t desc) +{ + printf_log(LOG_NONE, "GetSegmentBase does not apply to Wine dlls\n"); + return NULL; +} + +void* EmuFork(void* emu, int forktype) { return NULL; } + + +void EmuX64Syscall(void* emu) +{ + printf_log(LOG_NONE, "EmuX64Syscall NYI\n"); +} + +void EmuX64Syscall_linux(void* emu) +{ + printf_log(LOG_NONE, "EmuX64Syscall_linux NYI\n"); +} + +void EmuX86Syscall(void* emu) +{ + printf_log(LOG_NONE, "EmuX86Syscall NYI\n"); +} + +const char* GetBridgeName(void* p) +{ + return NULL; +} + +const char* GetNativeName(void* p) +{ + return NULL; +} + +void* GetNativeFnc(uintptr_t fnc) +{ + return NULL; +} + +void PersonalityAddrLimit32Bit(void) +{ +} + +int IsAddrElfOrFileMapped(uintptr_t addr) +{ + return 0; +} + + +int IsNativeCall(uintptr_t addr, int is32bits, uintptr_t* calladdress, uint16_t* retn) +{ + return 0; +} + + +ULONG_PTR default_zero_bits32 = 0x7fffffff; + +static uint32_t prot_unix_to_win32(uint32_t unx) +{ + if ((unx & (PROT_READ | PROT_WRITE | PROT_EXEC)) == (PROT_READ | PROT_WRITE | PROT_EXEC)) + return PAGE_EXECUTE_READWRITE; + if ((unx & (PROT_READ | PROT_EXEC)) == (PROT_READ | PROT_EXEC)) + return PAGE_EXECUTE_READ; + if ((unx & PROT_EXEC) == PROT_EXEC) + return PAGE_EXECUTE_READ; + if ((unx & (PROT_READ | PROT_WRITE)) == (PROT_READ | PROT_WRITE)) + return PAGE_READWRITE; + if ((unx & PROT_READ) == PROT_READ) + return PAGE_READONLY; + return 0; +} + +int mprotect(void* addr, size_t len, int prot) +{ + NTSTATUS ntstatus; + ULONG old_prot; + SIZE_T allocsize = len; + ntstatus = NtProtectVirtualMemory(NtCurrentProcess(), &addr, &allocsize, prot_unix_to_win32(prot), &old_prot); + if (ntstatus != STATUS_SUCCESS) { + return -1; + } + return 0; +} + +void* mmap(void* addr, size_t length, int prot, int flags, int fd, off_t offset) +{ + NTSTATUS ntstatus; + SIZE_T sz = length; + ULONG_PTR limit; + void* ret = NULL; + + if (addr != NULL) { + return MAP_FAILED; + } + if (fd && fd != -1) { + return MAP_FAILED; + } + if (offset) { + return MAP_FAILED; + } + + if (flags & MAP_32BIT) + limit = default_zero_bits32; + else + limit = 0; + + ntstatus = NtAllocateVirtualMemory(NtCurrentProcess(), &ret, limit, &sz, MEM_COMMIT | MEM_RESERVE, prot_unix_to_win32(prot)); + return ret; +} + +int munmap(void* addr, size_t length) +{ + int ret = 0; + if (NtFreeVirtualMemory(NtCurrentProcess(), &addr, &length, MEM_RELEASE)) + ret = -1; + return ret; +} + +void* InternalMmap(void* addr, unsigned long length, int prot, int flags, int fd, ssize_t offset) +{ + return mmap(addr, length, prot, flags, fd, offset); +} + +int InternalMunmap(void* addr, unsigned long length) +{ + return munmap(addr, length); +} + +void* WinMalloc(size_t size) +{ + void* ret; + ret = RtlAllocateHeap(GetProcessHeap(), 0, size); + return ret; +} + +void* WinRealloc(void* ptr, size_t size) +{ + void* ret; + if (!ptr) + return WinMalloc(size); + ret = RtlReAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, ptr, size); + return ret; +} + +void* WinCalloc(size_t nmemb, size_t size) +{ + void* ret; + ret = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, nmemb * size); + return ret; +} + +void WinFree(void* ptr) +{ + RtlFreeHeap(GetProcessHeap(), 0, ptr); +} + +void free(void* ptr) +{ + RtlFreeHeap(GetProcessHeap(), 0, ptr); +} + +int VolatileRangesContains(uintptr_t addr) +{ + return 0; +} + +int VolatileOpcodesHas(uintptr_t addr) +{ + return 0; +} + +void PrintfFtrace(int prefix, const char* fmt, ...) +{ + static char buf[1024] = { 0 }; + + char* p = buf; + p[0] = '\0'; + if (prefix) strcpy(p, prefix > 1 ? "[\033[31mBOX64\033[0m] " : "[BOX64] "); + va_list args; + va_start(args, fmt); + vsprintf(p + strlen(p), fmt, args); + va_end(args); + __wine_dbg_output(p); +} + +void* GetEnv(const char* name) +{ + static char buf[1024] = { 0 }; + int len = GetEnvironmentVariableA(name, buf, sizeof(buf)); + return len ? buf : NULL; +} + +int FileExist(const char* filename, int flags) +{ + DWORD attrs = GetFileAttributesA(filename); + if (attrs == INVALID_FILE_ATTRIBUTES) return 0; + if (flags == -1) return 1; + + if (flags & IS_FILE) { + if ((attrs & FILE_ATTRIBUTE_DIRECTORY) || (attrs & FILE_ATTRIBUTE_DEVICE) || (attrs & FILE_ATTRIBUTE_REPARSE_POINT)) { + return 0; + } + } else { + if (!(attrs & FILE_ATTRIBUTE_DIRECTORY)) + return 0; + } + + if (flags & IS_EXECUTABLE) { + printf_log(LOG_NONE, "Warning: Executable check not implemented for Windows\n"); + } + + return 1; +} + +int MakeDir(const char* folder) +{ + // TODO + return 0; +} + +size_t FileSize(const char* filename) +{ + // TODO + return 0; +} \ No newline at end of file diff --git a/src/os/perfmap.c b/src/os/perfmap.c new file mode 100644 index 0000000..753144d --- /dev/null +++ b/src/os/perfmap.c @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "debug.h" +#include "box64context.h" +#include "perfmap.h" + +#ifndef _WIN32 +#include "elfloader.h" + +void writePerfMap(uintptr_t func_addr, uintptr_t code_addr, size_t code_size, const char* inst_name) +{ + char pbuf[128]; + uint64_t sz = 0; + uintptr_t start = 0; + const char* symbname = FindNearestSymbolName(FindElfAddress(my_context, func_addr), (void*)func_addr, &start, &sz); + if(!symbname || !strcmp(symbname, "???")) + snprintf(pbuf, sizeof(pbuf), "0x%" PRIx64 " %" PRId64 " 0x%" PRIx64 ":%s\n", code_addr, code_size, func_addr, inst_name); + else + snprintf(pbuf, sizeof(pbuf), "0x%" PRIx64 " %" PRId64 " %s:%s\n", code_addr, code_size, symbname, inst_name); + (void)!write(BOX64ENV(dynarec_perf_map_fd), pbuf, strlen(pbuf)); +} +#else +void writePerfMap(uintptr_t func_addr, uintptr_t code_addr, size_t code_size, const char* inst_name) { } +#endif \ No newline at end of file diff --git a/src/os/random_linux.c b/src/os/random_linux.c new file mode 100644 index 0000000..30f9df2 --- /dev/null +++ b/src/os/random_linux.c @@ -0,0 +1,40 @@ +#include +#include +#include + +#include "x64emu.h" + +uint32_t fallback_random32(void) +{ + return random() ^ (random()<<1); +} + +uint32_t get_random32(void) +{ + uint32_t ret; + FILE* f = fopen("/dev/urandom", "rb"); + if(f) { + if(fread(&ret, sizeof(ret), 1, f)!=1) + ret = fallback_random32(); + fclose(f); + } else + ret = fallback_random32(); + return ret; +} +uint64_t fallback_random64(void) +{ + return random() ^ (((uint64_t)random())<<18) ^ (((uint64_t)random())<<41); +} + +uint64_t get_random64(void) +{ + uint64_t ret; + FILE* f = fopen("/dev/urandom", "rb"); + if(f) { + if(fread(&ret, sizeof(ret), 1, f)!=1) + ret = fallback_random64(); + fclose(f); + } else + ret = fallback_random64(); + return ret; +} diff --git a/src/os/random_wine.c b/src/os/random_wine.c new file mode 100644 index 0000000..fbf3259 --- /dev/null +++ b/src/os/random_wine.c @@ -0,0 +1,21 @@ +#include + +#include "my_cpuid.h" +#include "debug.h" +#include "build_info.h" + +NTSYSAPI ULONG WINAPI NtGetTickCount(VOID); +NTSYSAPI ULONG NTAPI RtlRandom(ULONG *seed); + +uint32_t get_random32(void) +{ + ULONG seed = NtGetTickCount(); + return RtlRandom(&seed); +} + +uint64_t get_random64(void) +{ + ULONG seed = NtGetTickCount(); + uint64_t tmp = RtlRandom(&seed); + return RtlRandom(&seed) | (tmp << 32); +} diff --git a/src/os/symbolfuncs_linux.c b/src/os/symbolfuncs_linux.c new file mode 100644 index 0000000..7fa1170 --- /dev/null +++ b/src/os/symbolfuncs_linux.c @@ -0,0 +1,20 @@ +#include "symbolfuncs.h" +#include "elfloader.h" +#include "debug.h" +#include "box64context.h" + +int PrintFunctionAddr(uintptr_t nextaddr, const char* text) +{ + uint64_t sz = 0; + uintptr_t start = 0; + const char* symbname = FindNearestSymbolName(FindElfAddress(my_context, nextaddr), (void*)nextaddr, &start, &sz); + if(!sz) sz=0x100; // arbitrary value... + if(symbname && nextaddr>=start && (nextaddr<(start+sz) || !sz)) { + if(nextaddr==start) + printf_log_prefix(0, LOG_NONE, " (%s%s:%s)", text, ElfName(FindElfAddress(my_context, nextaddr)), symbname); + else + printf_log_prefix(0, LOG_NONE, " (%s%s:%s + 0x%lx)", text, ElfName(FindElfAddress(my_context, nextaddr)), symbname, nextaddr - start); + return 1; + } + return 0; +} diff --git a/src/os/symbolfuncs_wine.c b/src/os/symbolfuncs_wine.c new file mode 100644 index 0000000..69533e0 --- /dev/null +++ b/src/os/symbolfuncs_wine.c @@ -0,0 +1,6 @@ +#include "symbolfuncs.h" + +int PrintFunctionAddr(uintptr_t nextaddr, const char* text) +{ + return 0; +} diff --git a/src/os/sysinfo.c b/src/os/sysinfo.c new file mode 100644 index 0000000..1e4719e --- /dev/null +++ b/src/os/sysinfo.c @@ -0,0 +1,231 @@ +#define _GNU_SOURCE +#include +#include +#include + +#include "debug.h" +#include "sysinfo.h" +#include "build_info.h" + +#ifdef _WIN32 +#include +#include "freq.h" +#endif + +#ifndef _WIN32 +static void readCpuinfo(sysinfo_t* info) +{ + memset(info, 0, sizeof(sysinfo_t)); + + if (getenv("BOX64_SYSINFO_CACHED")) { + // in case it's the x86_64 lscpu, prevent infinite loop + if (getenv("BOX64_SYSINFO_NCPU")) + info->ncpu = (uint64_t)strtol(getenv("BOX64_SYSINFO_NCPU"), NULL, 10); + else + info->ncpu = 1; + + if (getenv("BOX64_SYSINFO_CPUNAME")) { + size_t len = strlen(getenv("BOX64_SYSINFO_CPUNAME")); + info->cpuname = (char*)calloc(len + 1, 1); + strcpy(info->cpuname, getenv("BOX64_SYSINFO_CPUNAME")); + } else { + info->cpuname = (char*)malloc(20); + strcpy(info->cpuname, "Unknown CPU"); + } + info->read_ncpu = 1; + info->read_cpuname = 1; + if (getenv("BOX64_SYSINFO_FREQUENCY")) { + info->frequency = (uint64_t)strtol(getenv("BOX64_SYSINFO_FREQUENCY"), NULL, 10); + info->emulated_frequency = 0; + info->read_frequency = 1; + } else { + info->frequency = 1000000000; // 1GHz default + info->emulated_frequency = 1; + } + info->bogomips = info->frequency; + + return; + } + + info->emulated_frequency = 1; + int cpucore = 0; + while (1) { + char cpufreq[4096] = { 0 }; + sprintf(cpufreq, "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", cpucore); + FILE* f = fopen(cpufreq, "r"); + if (!f) break; + int r; + if (1 == fscanf(f, "%d", &r)) { + info->frequency = (uint64_t)r * 1000; + info->emulated_frequency = 0; + info->read_frequency = 1; + } + fclose(f); + ++cpucore; + } + + char line[4096] = { 0 }; + FILE* f = fopen("/proc/cpuinfo", "r"); + if (!f) goto lscpu; + + while (fgets(line, sizeof(line), f)) { + if (info->ncpu <= 1 && !info->read_frequency && strstr(line, "CPU MHz") != NULL) { + char* colon = strchr(line, ':'); + if (colon != NULL) { + float mhz; + if (sscanf(colon + 1, "%f", &mhz) == 1) { + info->frequency = (uint64_t)(mhz * 1e6); + info->emulated_frequency = 0; + info->read_frequency = 1; + } + } + } else if (info->ncpu <= 1 && (strstr(line, "Model Name") != NULL || strstr(line, "model name") != NULL)) { + // TODO: big.LITTLE handling? + char* colon = strchr(line, ':'); + if (colon != NULL) { + char* start = colon + 1; + while (start[0] == ' ' || start[0] == '\t') + ++start; + size_t len = strlen(start); + info->cpuname = (char*)calloc(len + 1, 1); + strcpy(info->cpuname, start); + char* newline = strchr(info->cpuname, '\n'); + if (newline) *newline = '\0'; + info->read_cpuname = 1; + } + } else if (!info->read_bogomips && strstr(line, "BogoMIPS") != NULL) { + char* colon = strchr(line, ':'); + if (colon != NULL) { + float bm; + if (sscanf(colon + 1, "%f", &bm) == 1) { + info->bogomips = (uint64_t)(bm * 1e6); + info->read_bogomips = 1; + } + } + } else if (strstr(line, "processor") != NULL) { + info->ncpu++; + } + } + if (info->ncpu) info->read_ncpu = 1; + fclose(f); + +lscpu: + if (!info->read_cpuname || !info->read_ncpu || !info->read_frequency) { + FILE* f = popen("lscpu", "r"); + if (!f) goto fallback; + while (fgets(line, sizeof(line), f)) { + if (!info->read_ncpu && strstr(line, "CPU(s):") != NULL) { + char* colon = strchr(line, ':'); + if (colon != NULL) { + int ncpu; + if (sscanf(colon + 1, "%d", &ncpu) == 1) { + info->ncpu = (uint64_t)ncpu; + info->read_ncpu = 1; + } + } + } else if (!info->read_cpuname && strstr(line, "Model name:") != NULL) { + char* colon = strchr(line, ':'); + if (colon != NULL) { + char* start = colon + 1; + while (start[0] == ' ' || start[0] == '\t') + ++start; + size_t len = strlen(start); + info->cpuname = (char*)calloc(len + 1, 1); + strcpy(info->cpuname, start); + char* newline = strchr(info->cpuname, '\n'); + if (newline) *newline = '\0'; + info->read_cpuname = 1; + } + } else if (!info->read_frequency && strstr(line, "CPU max MHz:") != NULL) { + char* colon = strchr(line, ':'); + if (colon != NULL) { + float mhz; + if (sscanf(colon + 1, "%f", &mhz) == 1) { + info->frequency = (uint64_t)(mhz * 1e6); + info->emulated_frequency = 0; + info->read_frequency = 1; + } + } + } + } + pclose(f); + } + +fallback: + if (!info->read_ncpu) info->ncpu = 1; + if (!info->read_cpuname) { + info->cpuname = (char*)malloc(20); + strcpy(info->cpuname, "Unknown CPU"); + } + if (!info->read_frequency) { + info->frequency = 1000000000; // 1GHz default + info->emulated_frequency = 1; + } + + if (!info->read_bogomips) { + info->bogomips = info->frequency; + } + + char str[64]; + sprintf(str, "%d", (info->ncpu) ? (int)info->ncpu : 1); + setenv("BOX64_SYSINFO_NCPU", str, 1); + setenv("BOX64_SYSINFO_CPUNAME", info->cpuname, 1); + sprintf(str, "%llu", info->frequency); + setenv("BOX64_SYSINFO_FREQUENCY", str, 1); + setenv("BOX64_SYSINFO_CACHED", "1", 1); + return; +} +#endif + +void InitializeSystemInfo(void) +{ +#ifndef _WIN32 + sysinfo_t info = { 0 }; + readCpuinfo(&box64_sysinfo); + + char branding[3 * 4 * 4 + 1]; + if (strstr(box64_sysinfo.cpuname, "MHz") || strstr(box64_sysinfo.cpuname, "GHz")) { + snprintf(branding, sizeof(branding), BOX64_BUILD_INFO_STRING_SHORT " on %.*s", 39, box64_sysinfo.cpuname); + } else { + if (box64_sysinfo.frequency > 1500000) { + snprintf(branding, sizeof(branding), BOX64_BUILD_INFO_STRING_SHORT " on %.*s @%1.2f GHz", 28, box64_sysinfo.cpuname, box64_sysinfo.frequency / 1000000000.); + } else { + snprintf(branding, sizeof(branding), BOX64_BUILD_INFO_STRING_SHORT " on %.*s @%04d MHz", 28, box64_sysinfo.cpuname, box64_sysinfo.frequency / 1000000); + } + } + box64_sysinfo.box64_cpuname = (char*)calloc(strlen(branding) + 1, 1); + strcpy(box64_sysinfo.box64_cpuname, branding); + +#else + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + box64_sysinfo.ncpu = sysinfo.dwNumberOfProcessors; + box64_sysinfo.frequency = ReadTSCFrequency(NULL); + box64_sysinfo.bogomips = box64_sysinfo.frequency; + box64_sysinfo.cpuname = (char*)WinMalloc(64); + strcpy(box64_sysinfo.cpuname, "Box64 Virtual CPU"); + box64_sysinfo.box64_cpuname = (char*)WinCalloc(strlen(BOX64_STR) + 1, 1); + strcpy(box64_sysinfo.box64_cpuname, BOX64_STR); + + box64_sysinfo.emulated_frequency = 0; +#endif + + box64_sysinfo.box64_ncpu = box64_sysinfo.ncpu; + if (BOX64ENV(maxcpu) && box64_sysinfo.ncpu > (uint64_t)BOX64ENV(maxcpu)) { + box64_sysinfo.box64_ncpu = (uint64_t)BOX64ENV(maxcpu); + } +} + +uint32_t helper_getcpu(x64emu_t* emu) +{ +#ifndef _WIN32 +#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) && !defined(ANDROID) +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 28) + uint32_t cpu, node; + if (!getcpu(&cpu, &node)) + return (node & 0xff) << 12 | (cpu & 0xff); +#endif +#endif +#endif + return box64_sysinfo.ncpu; +} \ No newline at end of file diff --git a/src/rv64detect.c b/src/rv64detect.c deleted file mode 100644 index 27ea2e5..0000000 --- a/src/rv64detect.c +++ /dev/null @@ -1,137 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "dynarec/rv64/rv64_emitter.h" - -// Detect RV64 extensions, by executing on of the opcode with a SIGILL signal handler - -static sigjmp_buf sigbuf = {0}; -typedef void(*vFiip_t)(int, int, void*); -static void detect_sigill(int sig) -{ - siglongjmp(sigbuf, 1); -} - -static int Check(void* block) -{ - static uint64_t buf[2] = {0}; - // Clear instruction cache - __clear_cache(block, block+box64_pagesize); - // Setup SIGILL signal handler - __sighandler_t old = signal(SIGILL, detect_sigill); - if(sigsetjmp(sigbuf, 1)) { - // didn't work, extension not present - signal(SIGILL, old); - return 0; - } - ((vFiip_t)block)(0, 1, buf); - // done... - signal(SIGILL, old); - return 1; -} - -void RV64_Detect_Function() -{ - // Alloc memory to execute stuffs - void* my_block = mmap(NULL, box64_pagesize, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); - if(my_block==(void*)-1) { - return; - } - uint32_t* block; - #define EMIT(A) *block = (A); ++block - - // Official extensions - - // Test Zba with ADDUW - block = (uint32_t*)my_block; - ADDUW(A0, A0, A1); - BR(xRA); - rv64_zba = Check(my_block); - // Test Zbb with ANDN - block = (uint32_t*)my_block; - ANDN(A0, A0, A1); - BR(xRA); - rv64_zbb = Check(my_block); - // Test Zbc with CLMUL - block = (uint32_t*)my_block; - CLMUL(A0, A0, A1); - BR(xRA); - rv64_zbc = Check(my_block); - // Test Zbs with BCLR - block = (uint32_t*)my_block; - BCLR(A0, A0, A1); - BR(xRA); - rv64_zbs = Check(my_block); - - // Test Vector v1.0 with CSRR zero, vcsr - block = (uint32_t*)my_block; - CSRRS(xZR, xZR, 0x00f); - BR(xRA); - rv64_vector = Check(my_block); // TODO: also check vlen >= 128 - - // THead vendor extensions - if (!rv64_zba) { - // Test XTheadBa with TH_ADDSL - block = (uint32_t*)my_block; - TH_ADDSL(A0, A0, A1, 1); - BR(xRA); - rv64_xtheadba = Check(my_block); - - // Test XTheadBb with TH_SRRI - block = (uint32_t*)my_block; - TH_SRRI(A0, A1, 1); - BR(xRA); - rv64_xtheadbb = Check(my_block); - - // Test XTheadBs with TH_TST - block = (uint32_t*)my_block; - TH_TST(A0, A1, 1); - BR(xRA); - rv64_xtheadbs = Check(my_block); - - // Test XTheadCondMov with TH_MVEQZ - block = (uint32_t*)my_block; - TH_MVEQZ(A0, A0, A1); - BR(xRA); - rv64_xtheadcondmov = Check(my_block); - - // Test XTheadMemIdx with TH_LBIA - block = (uint32_t*)my_block; - TH_LBIA(A0, A2, 1, 1); - BR(xRA); - rv64_xtheadmemidx = Check(my_block); - - // Test XTheadMemPair with TH_LDD - block = (uint32_t*)my_block; - TH_LDD(A0, A1, A2, 0); - BR(xRA); - rv64_xtheadmempair = Check(my_block); - - // Test XTheadFMemIdx with TH_FLRD - block = (uint32_t*)my_block; - TH_FLRD(A0, A2, xZR, 0); - BR(xRA); - rv64_xtheadfmemidx = Check(my_block); - - // Test XTheadMac with TH_MULA - block = (uint32_t*)my_block; - TH_MULA(A0, A0, A1); - BR(xRA); - rv64_xtheadmac = Check(my_block); - - // Test XTheadFmv with TH_FMV_X_HW - block = (uint32_t*)my_block; - TH_FMV_X_HW(A0, A1); - BR(xRA); - rv64_xtheadfmv = Check(my_block); - } - - // Finish - // Free the memory my_block - munmap(my_block, box64_pagesize); -} diff --git a/src/steam.c b/src/steam.c index 52461a3..1855779 100644 --- a/src/steam.c +++ b/src/steam.c @@ -4,6 +4,8 @@ #include #include #include +#include +#include #include "debug.h" #include "box64context.h" @@ -13,6 +15,53 @@ #define MAX_PATH 4096 #endif +static void create_lib_symlink(const char* lib) +{ + char file[MAX_PATH] = {0}; + char folder[MAX_PATH] = {0}; + char tmp[MAX_PATH] = {0}; + char* p = strrchr(lib, '/'); + if(!p) return; // no folder? + strcpy(file, p+1); + p = strrchr(file, '.'); + if(!p) return; //no '.' in name? + *p = '\0'; + strcpy(folder, lib); + *(strrchr(folder, '/')) = '\0'; + snprintf(tmp, sizeof(tmp), "%s/%s", folder, file); + if(FileExist(tmp, IS_FILE)) return; // already there + strcpy(file, strrchr(lib, '/')+1); + printf_log(LOG_DEBUG, "Creating symlinks %s -> %s\n", tmp, file); + symlink(file, tmp); +} + +static void create_libs_symlink(const char* folder) +{ + glob_t g = {0}; + char tmp[MAX_PATH] = {0}; + // start with lib*.so.X.X.XXX + snprintf(tmp, sizeof(tmp), "%s/lib*.so.*.*.*", folder); + if(!glob(tmp, 0, NULL, &g)) { + printf_log(LOG_DEBUG, "Creating symlinks for %s\n", folder); + for(ulong_t i=0; ibox86path?FileIsX86ELF(argv[nextarg]):0; int x64 = my_context->box64path?FileIsX64ELF(argv[nextarg]):0; + int sh = my_context->bashpath?FileIsShell(argv[nextarg]):0; // create the new argv array - const char** newargv = (const char**)box_calloc((argc-nextarg)+1+((x86 || x64)?1:0), sizeof(char*)); - if(x86 || x64) { - newargv[0] = x64?my_context->box64path:my_context->box86path; - printf_log(LOG_DEBUG, "argv[%d]=\"%s\"\n", 0, newargv[0]); + const char** newargv = (const char**)box_calloc((argc-nextarg)+1+((x86 || x64)?1:(sh?2:0)), sizeof(char*)); + if(x86 || x64 || sh) { + newargv[0] = x86?my_context->box86path:my_context->box64path; + printf_log(LOG_DEBUG, "argv[%d]=\"%s\"\n", 0, newargv[0]); + if(sh) { + newargv[1] = my_context->bashpath; + printf_log(LOG_DEBUG, "argv[%d]=\"%s\"\n", 1, newargv[1]); + } for(int i=nextarg; i +#include +#include +#include +#include +#include +#include +#include +#include + +#include "box64context.h" +#include "debug.h" +#include "core.h" +#include "fileutils.h" +#include "json.h" +#include "elfloader.h" +#include "x64emu.h" +#include "box64cpu.h" +#include "box64cpu_util.h" +#include "x64trace.h" +#include "build_info.h" + +#define NASM "nasm" +#define X86_64_LD "x86_64-linux-gnu-ld" + +extern box64context_t* my_context; +extern FILE* ftrace; + +uint64_t regs[16] = { 0 }; +uint64_t ymmregs[16][4] = { { 0 } }; +uint64_t flags = 0; + +bool check_regs[16] = { 0 }; +bool check_xmmregs[16] = { 0 }; +bool check_ymmregs[16] = { 0 }; +bool check_flags = false; + +int cputype = 0; + +const char* regname[] = { "RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI", "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15" }; + +#define MAX_MEMORY_REGIONS 32 +#define MAX_MEMORY_DATA 32 +#define MAX_MEMORY_DATA_SIZE 256 + +struct { + uint64_t start; + uint64_t size; +} memory_regions[MAX_MEMORY_REGIONS] = { { 0 } }; + +struct { + uint64_t start; + uint64_t size; + uint8_t data[MAX_MEMORY_DATA_SIZE]; +} memory_data[MAX_MEMORY_DATA] = { { 0 } }; + +static inline uint64_t fromstr(const char* str) +{ + int base = strlen(str) > 2 && (str[1] == 'x' || str[1] == 'X') ? 16 : 10; + return strtoull(str, NULL, base); +} + +static struct json_value_s* json_find(struct json_object_s* object, const char* key) +{ + struct json_object_element_s *element = object->start; + while (element) { + if (strcmp(element->name->string, key) == 0) { + return element->value; + } + element = element->next; + } + return NULL; +} + +static void json_fill_array(struct json_array_s* array, uint64_t* values) +{ + struct json_array_element_s* element = array->start; + int i = 0; + while (element) { + if (element->value->type == json_type_string) { + struct json_string_s* string = (struct json_string_s*)element->value->payload; + values[i] = fromstr(string->string); + i++; + } + element = element->next; + } +} + +static void loadTest(const char** filepath, const char* include_path) +{ + FILE* file = fopen(*filepath, "r"); + if (!file) { + printf_log(LOG_NONE, "Failed to open test file: %s\n", *filepath); + exit(1); + } + + // read file line by line + char line[1024]; + char json[4096] = { 0 }; + bool in_config = false; + while (fgets(line, sizeof(line), file)) { + if (!strcmp(line, "%ifdef CONFIG\n")) { + in_config = true; + continue; + } else if (!strcmp(line, "%endif\n")) { + in_config = false; + break; + } + if (in_config) { + strncat(json, line, sizeof(json) - strlen(json) - 1); + } + } + + fclose(file); + struct json_value_s *config = json_parse(json, strlen(json)); + if (!config || config->type != json_type_object) { + printf_log(LOG_NONE, "Failed to parse JSON configuration.\n"); + exit(1); + } + + + struct json_value_s* regdata = json_find(config->payload, "RegData"); + int i = 0; + +#define REG(name) \ + if (regdata && regdata->type == json_type_object) { \ + struct json_value_s* r##name = json_find(regdata->payload, #name); \ + if (r##name && r##name->type == json_type_string) { \ + struct json_string_s* string = (struct json_string_s*)r##name->payload; \ + regs[i] = fromstr(string->string); \ + check_regs[i] = true; \ + } \ + i++; \ + } + + REG(RAX); + REG(RCX); + REG(RDX); + REG(RBX); + REG(RSP); + REG(RBP); + REG(RSI); + REG(RDI); + REG(R8); + REG(R9); + REG(R10); + REG(R11); + REG(R12); + REG(R13); + REG(R14); + REG(R15); +#undef REG + + i = 0; + +#define REG(name) \ + if (regdata && regdata->type == json_type_object) { \ + struct json_value_s* r##name = json_find(regdata->payload, #name); \ + if (r##name && r##name->type == json_type_array) { \ + struct json_array_s* array = (struct json_array_s*)r##name->payload; \ + json_fill_array(array, ymmregs[i]); \ + check_xmmregs[i] = true; \ + if (array->length == 4) check_ymmregs[i] = true; \ + } \ + i++; \ + } + + REG(XMM0); + REG(XMM1); + REG(XMM2); + REG(XMM3); + REG(XMM4); + REG(XMM5); + REG(XMM6); + REG(XMM7); + REG(XMM8); + REG(XMM9); + REG(XMM10); + REG(XMM11); + REG(XMM12); + REG(XMM13); + REG(XMM14); + REG(XMM15); +#undef REG + + if (regdata && regdata->type == json_type_object) { + struct json_value_s* flags_value = json_find(regdata->payload, "Flags"); + if (flags_value && flags_value->type == json_type_string) { + struct json_string_s* string = (struct json_string_s*)flags_value->payload; + flags = fromstr(string->string); + check_flags = true; + } + } + + struct json_value_s* mode = json_find(config->payload, "Mode"); + if (mode && mode->type == json_type_string && !strcmp(((struct json_string_s*)mode->payload)->string, "32BIT")) { + box64_is32bits = true; + printf_log(LOG_INFO, "Test is in 32bits mode\n"); + } + + struct json_value_s* cputype_value = json_find(config->payload, "CpuType"); + if (cputype_value && cputype_value->type == json_type_string && !strcasecmp(((struct json_string_s*)cputype_value->payload)->string, "amd")) + cputype = 1; // 0 -> Intel[default], 1 -> AMD + else + cputype = 0; + + struct json_value_s* json_memory_regions = json_find(config->payload, "MemoryRegions"); + if (json_memory_regions && json_memory_regions->type == json_type_object) { + struct json_object_s* object = (struct json_object_s*)json_memory_regions->payload; + struct json_object_element_s* element = object->start; + i = 0; + while (element && i < MAX_MEMORY_REGIONS) { + struct json_string_s* element_key = element->name; + struct json_value_s* value = element->value; + assert(value->type == json_type_string); + struct json_string_s* element_value = (struct json_string_s*)value->payload; + memory_regions[i].start = fromstr(element_key->string); + memory_regions[i].size = fromstr(element_value->string); + i++; + element = element->next; + } + } + + struct json_value_s* json_memory_data = json_find(config->payload, "MemoryData"); + if (json_memory_data && json_memory_data->type == json_type_object) { + struct json_object_s* object = (struct json_object_s*)json_memory_data->payload; + struct json_object_element_s* element = object->start; + i = 0; + while (element && i < MAX_MEMORY_DATA) { + struct json_string_s* element_key = element->name; + struct json_value_s* value = element->value; + assert(value->type == json_type_string); + struct json_string_s* element_value = (struct json_string_s*)value->payload; + memory_data[i].start = fromstr(element_key->string); + uint8_t* data = (uint8_t*)element_value->string; + while (*data) { + if (*data == ' ') { + ++data; + continue; + } + if (*data == '0' && (*(data + 1) == 'x' || *(data + 1) == 'X')) { + data += 2; + } + uint8_t* lastbyte = data; + while (*lastbyte && *lastbyte != ' ' && *(lastbyte + 1) && *(lastbyte + 1) != ' ') { + lastbyte += 2; + } + size_t len = lastbyte - data; + if (len < 2) { + printf_log(LOG_NONE, "Invalid MemoryData item %s\n", element_key->string); + break; + } + lastbyte -= 2; + static uint8_t byte_str[3] = { 0 }; + while (lastbyte >= data) { + byte_str[0] = *lastbyte; + byte_str[1] = *(lastbyte + 1); + memory_data[i].data[memory_data[i].size] = (uint8_t)strtol((const char*)byte_str, NULL, 16); + memory_data[i].size++; + if (memory_data[i].size >= MAX_MEMORY_DATA_SIZE) { + printf_log(LOG_NONE, "MemoryData item %s too big (max=%d bytes)\n", element_key->string, MAX_MEMORY_DATA_SIZE); + break; + } + lastbyte -= 2; + } + data += len; + } + i++; + element = element->next; + } + } + +#define BINNAME "/tmp/binfileXXXXXX" + char* binname = box_malloc(strlen(BINNAME) + 1); + memcpy(binname, BINNAME, strlen(BINNAME) + 1); +#undef BINNAME + char objname[] = "/tmp/objfileXXXXXX"; + + int fd; + fd = mkstemp(objname); + close(fd); + + const char* nasm_cmd[] = { NASM, *filepath, box64_is32bits ? "-felf32" : "-felf64", "-o", objname, + include_path ? "-i" : NULL, include_path ? include_path : NULL, NULL }; + pid_t fork_result = fork(); + if (fork_result == 0) { + execvp(nasm_cmd[0], (char* const*)nasm_cmd); + exit(1); + } else { + int status; + waitpid(fork_result, &status, 0); + if (WIFEXITED(status) && WEXITSTATUS(status) != 0) { + printf_log(LOG_NONE, NASM " failed with exit code: %d\n", WEXITSTATUS(status)); + unlink(objname); + exit(1); + } + } + + close(mkstemp(binname)); + const char* ld_cmd[] = { X86_64_LD, objname, "-Ttext=0x10000", "-w", "-m", box64_is32bits ? "elf_i386" : "elf_x86_64", "-o", binname, NULL }; + + fork_result = fork(); + if (fork_result == 0) { + execvp(ld_cmd[0], (char* const*)ld_cmd); + exit(1); + } else { + int status; + waitpid(fork_result, &status, 0); + if (WIFEXITED(status) && WEXITSTATUS(status) != 0) { + printf_log(LOG_NONE, X86_64_LD " failed with exit code: %d\n", WEXITSTATUS(status)); + unlink(objname); + exit(1); + } + } + + printf_log(LOG_DEBUG, "Test binary compiled as %s\n", binname); + *filepath = binname; + + unlink(objname); + free(config); +} + +static void setupZydis(box64context_t* context) +{ +#ifdef HAVE_TRACE + if ((BOX64ENV(trace_init) && strcmp(BOX64ENV(trace_init), "0")) || (BOX64ENV(trace) && strcmp(BOX64ENV(trace), "0"))) { + context->x64trace = 1; + } + if (context->x64trace) { + printf_log(LOG_INFO, "Initializing Zydis lib\n"); + if (InitX64Trace(context)) { + printf_log(LOG_INFO, "Zydis init failed. No x86 trace activated\n"); + context->x64trace = 0; + } + } +#endif +} + +int unittest(int argc, const char** argv) +{ + if (argc < 3 || (strcmp(argv[1], "--test") && strcmp(argv[1], "-t"))) { + printf_log(LOG_NONE, "Usage: %s -t [-i ]\n", argv[0]); + return 0; + } + + const char* include_path = NULL; + if (argc > 4 && (!strcmp(argv[3], "-i") || !strcmp(argv[3], "--include"))) { + include_path = argv[4]; + } + + box64_pagesize = 4096; + LoadEnvVariables(); + InitializeSystemInfo(); + ftrace = stdout; + if (!BOX64ENV(nobanner)) PrintBox64Version(1); + +#ifdef DYNAREC + if (DetectHostCpuFeatures()) + PrintHostCpuFeatures(); + else { + printf_log(LOG_INFO, "Minimum CPU requirements not met, disabling DynaRec\n"); + SET_BOX64ENV(dynarec, 0); + } +#endif + + if (!box64env.is_cputype_overridden && cputype) SET_BOX64ENV(cputype, cputype); + + PrintEnvVariables(&box64env, LOG_INFO); + my_context = NewBox64Context(argc - 1); + + loadTest(&argv[2], include_path); // will modify argv[2] to point to the binary file + my_context->fullpath = box_strdup(argv[2]); + + FILE* f = fopen(my_context->fullpath, "rb"); + unlink(my_context->fullpath); + + elfheader_t* elf_header = LoadAndCheckElfHeader(f, my_context->fullpath, 1); + AddElfHeader(my_context, elf_header); + CalcLoadAddr(elf_header); + AllocLoadElfMemory(my_context, elf_header, 1); + + setupZydis(my_context); + my_context->ep = GetEntryPoint(my_context->maplib, elf_header); + + my_context->stack = (void*)0xC0000000; + my_context->stacksz = 4096; + mmap((void*)my_context->stack, my_context->stacksz, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); + mmap((void*)0xE0000000, 16 * 4096, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); + mmap((void*)0xE8000000, 32 * 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); + + for (int i = 0; i < MAX_MEMORY_REGIONS && memory_regions[i].size; ++i) { + if (!memory_regions[i].start) break; + mmap((void*)memory_regions[i].start, memory_regions[i].size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); + } + + for (int i = 0; i < MAX_MEMORY_DATA && memory_data[i].size; ++i) { + if (!memory_data[i].start) break; + if (!memory_data[i].size) continue; + memcpy((void*)memory_data[i].start, memory_data[i].data, memory_data[i].size); + } + + x64emu_t* emu = NewX64Emu(my_context, my_context->ep, + (uintptr_t)my_context->stack, my_context->stacksz, 0); + + ResetFlags(emu); + SetRIP(emu, my_context->ep); + DynaRun(emu); + + int retcode = 0; + for (int i = 0; i < 16; ++i) { + if (check_regs[i]) { + if (regs[i] != emu->regs[_RAX + i].q[0]) { + printf_log(LOG_NONE, "%-5s: expected %016zx, got %016zx\n", regname[i], regs[i], emu->regs[_RAX + i].q[0]); + retcode += 1; + } + } + } + + for (int i = 0; i < 16; ++i) { + if (check_xmmregs[i]) { + if (ymmregs[i][0] != emu->xmm[i].q[0] || ymmregs[i][1] != emu->xmm[i].q[1]) { + printf_log(LOG_NONE, "XMM%-2d: expected %016zx-%016zx, got %016zx-%016zx\n", i, ymmregs[i][1], ymmregs[i][0], emu->xmm[i].q[1], emu->xmm[i].q[0]); + retcode += 1; + } + } + if (check_ymmregs[i]) { + if (ymmregs[i][2] != emu->ymm[i].q[0] || ymmregs[i][3] != emu->ymm[i].q[1]) { + printf_log(LOG_NONE, "YMM%-2d: expected %016zx-%016zx, got %016zx-%016zx\n", i, ymmregs[i][3], ymmregs[i][2], emu->ymm[i].q[1], emu->ymm[i].q[0]); + retcode += 1; + } + } + } + + if (check_flags) { + if (flags != emu->eflags.x64) { + printf_log(LOG_NONE, "FLAGS: expected %016zx, got %016zx\n", flags, emu->eflags.x64); + retcode += 1; + } + } + + if (retcode == 0) + printf_log(LOG_INFO, "Passed\n"); + else + printf_log(LOG_NONE, "Failed with %d errors\n", retcode); + + + return retcode; +} diff --git a/src/tools/alternate.c b/src/tools/alternate.c new file mode 100644 index 0000000..223a9eb --- /dev/null +++ b/src/tools/alternate.c @@ -0,0 +1,47 @@ +#include "alternate.h" +#include "custommem.h" +#include "khash.h" + +// Alternate address handling +KHASH_MAP_INIT_INT64(alternate, void*) +static kh_alternate_t *my_alternates = NULL; + +int hasAlternate(void* addr) { + if(!my_alternates) + return 0; + khint_t k = kh_get(alternate, my_alternates, (uintptr_t)addr); + if(k==kh_end(my_alternates)) + return 0; + return 1; +} + +void* getAlternate(void* addr) { + if(!my_alternates) + return addr; + khint_t k = kh_get(alternate, my_alternates, (uintptr_t)addr); + if(k!=kh_end(my_alternates)) + return kh_value(my_alternates, k); + return addr; +} +void addAlternate(void* addr, void* alt) { + if(!my_alternates) { + my_alternates = kh_init(alternate); + } + int ret; + khint_t k = kh_put(alternate, my_alternates, (uintptr_t)addr, &ret); + if(!ret) // already there + return; + kh_value(my_alternates, k) = alt; +} + +void addCheckAlternate(void* addr, void* alt) { + if(!hasAlternate(addr)) + addAlternate(addr, alt); +} + +void cleanAlternate() { + if(my_alternates) { + kh_destroy(alternate, my_alternates); + my_alternates = NULL; + } +} diff --git a/src/tools/bitutils.c b/src/tools/bitutils.c index 7d4b3a3..9cad56b 100644 --- a/src/tools/bitutils.c +++ b/src/tools/bitutils.c @@ -19,4 +19,34 @@ int TrailingZeros64(uint64_t x) { const uint8_t lead0tab[16] = { //0b0000 0b0001 0b0010 0b0011 0b0100 0b0101 0b0110 0b0111 0b1000... 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3 -}; \ No newline at end of file +}; + +const uint8_t lead0tab8[256] = { + 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +int LeadingZeros16(uint16_t a) +{ + int count = 8; + if (0x100 <= a) { + count = 0; + a >>= 8; + } + count += lead0tab8[a]; + return count; +} diff --git a/src/tools/box32stack.c b/src/tools/box32stack.c new file mode 100644 index 0000000..70c473e --- /dev/null +++ b/src/tools/box32stack.c @@ -0,0 +1,140 @@ +#include +#include +#include +#include +#include + +#include "box64stack.h" +#include "box64context.h" +#include "elfloader.h" +#include "elfs/elfloader_private.h" +#include "debug.h" +#include "emu/x64emu_private.h" +#include "auxval.h" +#include "custommem.h" +#include "box32.h" + +static void PushString32(x64emu_t *emu, const char* s) +{ + int sz = strlen(s) + 1; + // round to 4 bytes boundary + R_ESP -= sz; + memcpy(from_ptrv(R_ESP), s, sz); +} + +static void Push32_32(x64emu_t *emu, uint32_t v) +{ + R_ESP -= 4; + *((uint32_t*)from_ptr(R_ESP)) = v; +} + + +EXPORTDYN +void SetupInitialStack32(x64emu_t *emu) +{ + // start with 0 + Push32_32(emu, 0); + // push program executed + PushString32(emu, emu->context->argv[0]); + uintptr_t p_arg0 = from_ptr(R_ESP); + // push envs + uintptr_t p_envv[emu->context->envc+1]; + for (int i=emu->context->envc-1; i>=0; --i) { + PushString32(emu, emu->context->envv[i]); + p_envv[i] = from_ptr(R_ESP); + } + p_envv[emu->context->envc] = 0; + // push args, also, free the argv[] string and point to the one in the main stack + uintptr_t p_argv[emu->context->argc]; + for (int i=emu->context->argc-1; i>=0; --i) { + PushString32(emu, emu->context->argv[i]); + p_argv[i] = R_ESP; + box_free(emu->context->argv[i]); + emu->context->argv[i] = (char*)p_argv[i]; + } + // align + uintptr_t tmp = from_ptr(R_ESP)&~(emu->context->stackalign-1); + memset((void*)tmp, 0, from_ptr(R_ESP)-tmp); + R_ESP=to_ptr(tmp); + + // push some AuxVector stuffs + PushString32(emu, "i686"); + uintptr_t p_i686 = from_ptr(R_ESP); + uintptr_t p_random = real_getauxval(25); + if(!p_random) { + for (int i=0; i<4; ++i) + Push32_32(emu, random()); + p_random = from_ptr(R_ESP); + } + // align + tmp = (R_ESP)&~(emu->context->stackalign-1); + memset((void*)tmp, 0, from_ptr(R_ESP)-tmp); + R_ESP=tmp; + + // push the AuxVector themselves + /* + 00: 00000000 + 03: 08048034 + 04: 00000020 + 05: 0000000b + 06: 00001000 + 07: f7fc0000 + 08: 00000000 + 09: 08049060 + 11: 000003e8 + 12: 000003e8 + 13: 000003e8 + 14: 000003e8 + 15: ffd8aa5b/i686 + 16: bfebfbff + 17: 00000064 + 23: 00000000 + 25: ffd8aa4b + 26: 00000000 + 31: ffd8bfeb/./testAuxVec + 32: f7fbfb40 + 33: f7fbf000 + */ + elfheader_t* main = my_context->elfs[0]; + Push32_32(emu, 0); Push32_32(emu, 0); //AT_NULL(0)=0 + Push32_32(emu, main->fileno); Push32_32(emu, 2); //AT_EXECFD=file desciptor of program + Push32_32(emu, (uintptr_t)main->PHEntries._32); Push32_32(emu, 3); //AT_PHDR(3)=address of the PH of the executable + Push32_32(emu, sizeof(Elf32_Phdr)); Push32_32(emu, 4); //AT_PHENT(4)=size of PH entry + Push32_32(emu, main->numPHEntries); Push32_32(emu, 5); //AT_PHNUM(5)=number of elf headers + Push32_32(emu, box64_pagesize); Push32_32(emu, 6); //AT_PAGESZ(6) + //Push32_32(emu, real_getauxval(7)); Push32_32(emu, 7); //AT_BASE(7)=ld-2.27.so start (in memory) + Push32_32(emu, 0); Push32_32(emu, 8); //AT_FLAGS(8)=0 + Push32_32(emu, R_EIP); Push32_32(emu, 9); //AT_ENTRY(9)=entrypoint + Push32_32(emu, from_ulong(real_getauxval(11))); Push32_32(emu, 11); //AT_UID(11) + Push32_32(emu, from_ulong(real_getauxval(12))); Push32_32(emu, 12); //AT_EUID(12) + Push32_32(emu, from_ulong(real_getauxval(13))); Push32_32(emu, 13); //AT_GID(13) + Push32_32(emu, from_ulong(real_getauxval(14))); Push32_32(emu, 14); //AT_EGID(14) + Push32_32(emu, p_i686); Push32_32(emu, 15); //AT_PLATFORM(15)=&"i686" + // Push HWCAP: + // FPU: 1<<0 ; VME: 1<<1 ; DE : 1<<2 ; PSE: 1<<3 ; TSC: 1<<4 ; MSR: 1<<5 ; PAE: 1<<6 ; MCE: 1<<7 + // CX8: 1<<8 ; APIC:1<<9 ; SEP: 1<<11; MTRR:1<<12; PGE: 1<<13; MCA: 1<<14; CMOV:1<<15 + // FCMOV:1<<16; MMX: 1<<23 + // OSFXR:1<<24; XMM: 1<<25;XMM2: 1<<26; AMD3D:1<<31 + Push32_32(emu, (1<<0) | (1<<1) | (1<<2) | (1<<3) | (1<<4) | (1<<8) | (1<<15) | (1<<16) | (1<<23) | (1<<25) | (1<<26)); + Push32_32(emu, 16); //AT_HWCAP(16)=... + //Push32_32(emu, sysconf(_SC_CLK_TCK)); Push32_32(emu, 17); //AT_CLKTCK(17)=times() frequency + Push32_32(emu, from_ulong(real_getauxval(23))); Push32_32(emu, 23); //AT_SECURE(23) + Push32_32(emu, p_random); Push32_32(emu, 25); //AT_RANDOM(25)=p_random + Push32_32(emu, 0); Push32_32(emu, 26); //AT_HWCAP2(26)=0 + Push32_32(emu, p_arg0); Push32_32(emu, 31); //AT_EXECFN(31)=p_arg0 + Push32_32(emu, emu->context->vsyscall); Push32_32(emu, 32); //AT_SYSINFO(32)=vsyscall + //Push32_32(emu, ); Push32_32(emu, 33); //AT_SYSINFO_EHDR(33)=address of vDSO + if(!emu->context->auxval_start) // store auxval start if needed + emu->context->auxval_start = (uintptr_t*)from_ptr(R_ESP); + + // push nil / envs / nil / args / argc + Push32_32(emu, 0); + for (int i=emu->context->envc-1; i>=0; --i) + Push32_32(emu, to_ptr(p_envv[i])); + emu->context->envv32 = R_ESP; + Push32_32(emu, 0); + for (int i=emu->context->argc-1; i>=0; --i) + Push32_32(emu, to_ptr(p_argv[i])); + emu->context->argv32 = R_ESP; + Push32_32(emu, emu->context->argc); +} diff --git a/src/tools/box64stack.c b/src/tools/box64stack.c index 7be31b4..2aebb84 100644 --- a/src/tools/box64stack.c +++ b/src/tools/box64stack.c @@ -6,10 +6,11 @@ #include "box64stack.h" #include "box64context.h" +#include "box64cpu_util.h" #include "elfloader.h" +#include "elfs/elfloader_private.h" #include "debug.h" #include "emu/x64emu_private.h" -#include "emu/x64run_private.h" #include "auxval.h" #include "custommem.h" @@ -22,12 +23,12 @@ int CalcStackSize(box64context_t *context) CalcStack(context->elfs[i], &context->stacksz, &context->stackalign); //if (posix_memalign((void**)&context->stack, context->stackalign, context->stacksz)) { - context->stack = internal_mmap(NULL, context->stacksz, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_GROWSDOWN, -1, 0); + context->stack = mmap(NULL, context->stacksz, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_GROWSDOWN, -1, 0); if (context->stack==(void*)-1) { printf_log(LOG_NONE, "Cannot allocate aligned memory (0x%lx/0x%zx) for stack\n", context->stacksz, context->stackalign); return 1; } else - setProtection((uintptr_t)context->stack, context->stacksz, PROT_READ|PROT_WRITE); + setProtection_stack((uintptr_t)context->stack, context->stacksz, PROT_READ|PROT_WRITE); //memset(context->stack, 0, context->stacksz); printf_log(LOG_DEBUG, "Stack is @%p size=0x%lx align=0x%zx\n", context->stack, context->stacksz, context->stackalign); @@ -42,16 +43,27 @@ void PushString(x64emu_t *emu, const char* s) memcpy((void*)R_RSP, s, sz); } +void SetupInitialStack32(x64emu_t *emu) +#ifndef BOX32 + { } +#else + ; +#endif EXPORTDYN void SetupInitialStack(x64emu_t *emu) { + if(box64_is32bits) { + SetupInitialStack32(emu); + return; + } // start with 0 Push64(emu, 0); // push program executed PushString(emu, emu->context->argv[0]); uintptr_t p_arg0 = R_RSP; // push envs - uintptr_t p_envv[emu->context->envc]; + uintptr_t p_envv[emu->context->envc+1]; + p_envv[emu->context->envc] = 0; for (int i=emu->context->envc-1; i>=0; --i) { PushString(emu, emu->context->envv[i]); box_free(emu->context->envv[i]); @@ -106,10 +118,12 @@ void SetupInitialStack(x64emu_t *emu) 31 0x7ffd5074efea 33 0x7ffd507e6000 */ + elfheader_t* main = my_context->elfs[0]; Push64(emu, 0); Push64(emu, 0); //AT_NULL(0)=0 - //Push64(emu, ); Push64(emu, 3); //AT_PHDR(3)=address of the PH of the executable - //Push64(emu, ); Push64(emu, 4); //AT_PHENT(4)=size of PH entry - //Push64(emu, ); Push64(emu, 5); //AT_PHNUM(5)=number of elf headers + Push64(emu, main->fileno); Push64(emu, 2); //AT_EXECFD=file desciptor of program + Push64(emu, (uintptr_t)main->PHEntries._64); Push64(emu, 3); //AT_PHDR(3)=address of the PH of the executable + Push64(emu, sizeof(Elf64_Phdr)); Push64(emu, 4); //AT_PHENT(4)=size of PH entry + Push64(emu, main->numPHEntries); Push64(emu, 5); //AT_PHNUM(5)=number of elf headers Push64(emu, box64_pagesize); Push64(emu, 6); //AT_PAGESZ(6) //Push64(emu, real_getauxval(7)); Push64(emu, 7); //AT_BASE(7)=ld-2.27.so start (in memory) Push64(emu, 0); Push64(emu, 8); //AT_FLAGS(8)=0 @@ -134,13 +148,16 @@ void SetupInitialStack(x64emu_t *emu) | 1<<30 // ia64 ); Push64(emu, 16); //AT_HWCAP(16)=... - //Push64(emu, sysconf(_SC_CLK_TCK)); Push64(emu, 17); //AT_CLKTCK(17)=times() frequency + Push64(emu, real_getauxval(17)); Push64(emu, 17); //AT_CLKTCK(17)=times() frequency Push64(emu, real_getauxval(23)); Push64(emu, 23); //AT_SECURE(23) Push64(emu, p_random); Push64(emu, 25); //AT_RANDOM(25)=p_random - Push64(emu, 0); Push64(emu, 26); //AT_HWCAP2(26)=0 + Push64(emu, 0 + | 1<<1 // FSGSBASE + ); Push64(emu, 26); //AT_HWCAP2(26)=... Push64(emu, p_arg0); Push64(emu, 31); //AT_EXECFN(31)=p_arg0 - Push64(emu, emu->context->vsyscall); Push64(emu, 32); //AT_SYSINFO(32)=vsyscall - //Push64(emu, 0); Push64(emu, 33); //AT_SYSINFO_EHDR(33)=address of vDSO + Push64(emu, 0); Push64(emu, 32); //AT_SYSINFO(32) not available in 64bits + //Push64(emu, (uintptr_t)CreatevDSO64()); Push64(emu, 33); //AT_SYSINFO_EHDR(33)=address of vDSO + if(!emu->context->auxval_start) // store auxval start if needed emu->context->auxval_start = (uintptr_t*)R_RSP; diff --git a/src/tools/bridge.c b/src/tools/bridge.c index 1c5bde9..0db4073 100644 --- a/src/tools/bridge.c +++ b/src/tools/bridge.c @@ -7,7 +7,8 @@ #include #include -#include +#include "os.h" +#include "wrappedlibs.h" #include "custommem.h" #include "bridge.h" #include "bridge_private.h" @@ -16,11 +17,15 @@ #include "x64emu.h" #include "box64context.h" #include "elfloader.h" +#include "alternate.h" #ifdef DYNAREC #include "dynablock.h" #endif +#ifdef BOX32 +#include "box32context.h" +#endif -KHASH_MAP_INIT_INT64(bridgemap, uintptr_t) +KHASH_MAP_INIT_INT128(bridgemap, uintptr_t) typedef struct brick_s brick_t; typedef struct brick_s { @@ -37,25 +42,25 @@ typedef struct bridge_s { kh_bridgemap_t *bridgemap; } bridge_t; -// from src/wrapped/wrappedlibc.c -void* my_mmap(x64emu_t* emu, void* addr, unsigned long length, int prot, int flags, int fd, int64_t offset); -int my_munmap(x64emu_t* emu, void* addr, unsigned long length); - brick_t* NewBrick(void* old) { brick_t* ret = (brick_t*)box_calloc(1, sizeof(brick_t)); - if(old) - old = old + NBRICK * sizeof(onebridge_t); - void* ptr = my_mmap(NULL, old, NBRICK * sizeof(onebridge_t), PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | 0x40 | MAP_ANONYMOUS, -1, 0); // 0x40 is MAP_32BIT + static void* load_addr_32bits = NULL; + if(box64_is32bits) + old = load_addr_32bits; + else { + if(old) + old = old + NBRICK * sizeof(onebridge_t); + } + void* ptr = box_mmap(old, NBRICK * sizeof(onebridge_t), PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | ((!box64_is32bits && box64_wine)?0:0x40) | MAP_ANONYMOUS, -1, 0); // 0x40 is MAP_32BIT if(ptr == MAP_FAILED) - ptr = my_mmap(NULL, NULL, NBRICK * sizeof(onebridge_t), PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | 0x40 | MAP_ANONYMOUS, -1, 0); + ptr = box_mmap(NULL, NBRICK * sizeof(onebridge_t), PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | ((!box64_is32bits && box64_wine)?0:0x40) | MAP_ANONYMOUS, -1, 0); if(ptr == MAP_FAILED) { printf_log(LOG_NONE, "Warning, cannot allocate 0x%lx aligned bytes for bridge, will probably crash later\n", NBRICK*sizeof(onebridge_t)); } - #ifdef DYNAREC - setProtection((uintptr_t)ptr, NBRICK * sizeof(onebridge_t), PROT_READ | PROT_WRITE | PROT_EXEC | PROT_NOPROT); - #endif + setProtection_box((uintptr_t)ptr, NBRICK * sizeof(onebridge_t), PROT_READ | PROT_WRITE | PROT_EXEC | PROT_NOPROT); dynarec_log(LOG_INFO, "New Bridge brick at %p (size 0x%zx)\n", ptr, NBRICK*sizeof(onebridge_t)); + if(box64_is32bits) load_addr_32bits = ptr + NBRICK*sizeof(onebridge_t); ret->b = ptr; return ret; } @@ -63,7 +68,14 @@ brick_t* NewBrick(void* old) bridge_t *NewBridge() { bridge_t *b = (bridge_t*)box_calloc(1, sizeof(bridge_t)); - b->head = NewBrick(NULL); + // before enable seccomp and bpf fileter, proton check if "syscall" address (from libc) is > 0x700000000000 + // it also test if an internal symbol "sc_seccomp" address's is also > 0x700000000000 before enabling seccomp syscall filter. + // This hack allow the test to pass, but only if the system has at least 47bits address space. + // it will not work on 39bits address space and will need more hacks there + void* load_addr = NULL; + if((!box64_is32bits && box64_wine && my_context->exit_bridge)) // a first bridge is create for system use, before box64_is32bits can be computed, so use exit_bridge to detect that + load_addr = (void*)0x700000000000LL; + b->head = NewBrick(load_addr); b->last = b->head; b->bridgemap = kh_init(bridgemap); @@ -77,7 +89,8 @@ void FreeBridge(bridge_t** bridge) while(b) { brick_t *n = b->next; dynarec_log(LOG_INFO, "FreeBridge brick at %p (size 0x%zx)\n", b->b, NBRICK*sizeof(onebridge_t)); - my_munmap(NULL, b->b, NBRICK*sizeof(onebridge_t)); + box_munmap(b->b, NBRICK*sizeof(onebridge_t)); + freeProtection((uintptr_t)b->b, NBRICK*sizeof(onebridge_t)); box_free(b); b = n; } @@ -86,12 +99,8 @@ void FreeBridge(bridge_t** bridge) *bridge = NULL; } -#ifdef HAVE_TRACE -void addBridgeName(void* addr, const char* name); -#endif - //static const char* default_bridge = "bridge???"; -uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name) +uintptr_t AddBridge2(bridge_t* bridge, wrapper_t w, void* fnc, void* fnc2, int N, const char* name) { brick_t *b = NULL; int sz = -1; @@ -107,7 +116,8 @@ uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* sz = b->sz; b->sz++; // add bridge to map, for fast recovery - khint_t k = kh_put(bridgemap, bridge->bridgemap, (uintptr_t)fnc, &ret); + khint128_t key = (uintptr_t)fnc | (khint128_t)((uintptr_t)fnc2)<<64; + khint_t k = kh_put(bridgemap, bridge->bridgemap, key, &ret); kh_value(bridge->bridgemap, k) = (uintptr_t)&b->b[sz].CC; mutex_unlock(&my_context->mutex_bridge); @@ -117,11 +127,17 @@ uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* b->b[sz].f = (uintptr_t)fnc; b->b[sz].C3 = N?0xC2:0xC3; b->b[sz].N = N; - b->b[sz].name = name/*?name:default_bridge*/; + b->b[sz].func = fnc2?1:0; + b->b[sz].name_or_func = fnc2?fnc2:(void*)name; return (uintptr_t)&b->b[sz].CC; } +uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name) +{ + return AddBridge2(bridge, w, fnc, NULL, N, name); +} + uintptr_t CheckBridged(bridge_t* bridge, void* fnc) { // check if function alread have a bridge (the function wrapper will not be tested) @@ -131,6 +147,16 @@ uintptr_t CheckBridged(bridge_t* bridge, void* fnc) return kh_value(bridge->bridgemap, k); } +uintptr_t CheckBridged2(bridge_t* bridge, void* fnc, void* fnc2) +{ + // check if function alread have a bridge (the function wrapper will not be tested) + khint128_t key = (uintptr_t)fnc | (khint128_t)((uintptr_t)fnc2)<<64; + khint_t k = kh_get(bridgemap, bridge->bridgemap, key); + if(k==kh_end(bridge->bridgemap)) + return 0; + return kh_value(bridge->bridgemap, k); +} + uintptr_t AddCheckBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name) { if(!fnc && w) @@ -141,6 +167,16 @@ uintptr_t AddCheckBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const return ret; } +uintptr_t AddCheckBridge2(bridge_t* bridge, wrapper_t w, void* fnc, void* fnc2, int N, const char* name) +{ + if(!fnc && w) + return 0; + uintptr_t ret = CheckBridged2(bridge, fnc, fnc2); + if(!ret) + ret = AddBridge2(bridge, w, fnc, fnc2, N, name); + return ret; +} + uintptr_t AddAutomaticBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name) { if(!fnc) @@ -155,22 +191,36 @@ uintptr_t AddAutomaticBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, co return ret; } -void* GetNativeFnc(uintptr_t fnc) +uintptr_t AddAutomaticBridgeAlt(bridge_t* bridge, wrapper_t w, void* fnc, void* alt, int N, const char* name) +{ + if(!fnc) + return 0; + uintptr_t ret = CheckBridged(bridge, alt); + if(!ret) + ret = AddBridge(bridge, w, alt, N, name); + if(!hasAlternate(fnc)) { + printf_log(LOG_DEBUG, "Adding AutomaticBridge for %p to %p\n", fnc, (void*)ret); + addAlternate(fnc, (void*)ret); + } + return ret; +} + +void* GetNativeOrAlt(void* fnc, void* alt) { if(!fnc) return NULL; // check if function exist in some loaded lib - if(!FindElfAddress(my_context, fnc)) { + if(!FindElfAddress(my_context, (uintptr_t)fnc)) { Dl_info info; - if(dladdr((void*)fnc, &info)) - return (void*)fnc; + if(dladdr(fnc, &info)) + return fnc; } - if(!getProtection(fnc)) - return NULL; + if(!getProtection((uintptr_t)fnc)) + return alt; // check if it's an indirect jump #define PK(a) *(uint8_t*)(fnc+a) #define PK32(a) *(uint32_t*)(fnc+a) if(PK(0)==0xff && PK(1)==0x25) { // "absolute" jump, maybe the GOT (it's a RIP+relative in fact) - uintptr_t a1 = fnc+6+(PK32(2)); // need to add a check to see if the address is from the GOT ! + uintptr_t a1 = (uintptr_t)fnc+6+(PK32(2)); // need to add a check to see if the address is from the GOT ! a1 = *(uintptr_t*)a1; if(a1 && a1>0x10000) { a1 = (uintptr_t)GetNativeFnc(a1); @@ -183,10 +233,13 @@ void* GetNativeFnc(uintptr_t fnc) // check if bridge exist onebridge_t *b = (onebridge_t*)fnc; if(b->CC != 0xCC || b->S!='S' || b->C!='C' || (b->C3!=0xC3 && b->C3!=0xC2)) - return NULL; // not a bridge?! + return alt; // not a bridge?! return (void*)b->f; } - +void* GetNativeFnc(uintptr_t fnc) +{ + return GetNativeOrAlt((void*)fnc, NULL); +} void* GetNativeFncOrFnc(uintptr_t fnc) { onebridge_t *b = (onebridge_t*)fnc; @@ -222,61 +275,109 @@ uintptr_t AddVSyscall(bridge_t* bridge, int num) const char* getBridgeName(void* addr) { + if(!memExist((uintptr_t)addr)) + return NULL; + if(!(getProtection((uintptr_t)addr)&PROT_READ)) + return NULL; onebridge_t* one = (onebridge_t*)(((uintptr_t)addr&~(sizeof(onebridge_t)-1))); // align to start of bridge - if(one->C3==0xC3 && one->S=='S' && one->C=='C') { + if (one->C3 == 0xC3 && IsBridgeSignature(one->S, one->C)) { if(one->w==NULL) return "ExitEmulation"; - else - return one->name; + else { + if(one->func) + return GetNativeName(one->name_or_func); + else + return one->name_or_func; + } } return NULL; } - -// Alternate address handling -KHASH_MAP_INIT_INT64(alternate, void*) -static kh_alternate_t *my_alternates = NULL; - -int hasAlternate(void* addr) { - if(!my_alternates) - return 0; - khint_t k = kh_get(alternate, my_alternates, (uintptr_t)addr); - if(k==kh_end(my_alternates)) - return 0; - return 1; +void* getBridgeFnc2(void* addr) +{ + if(!memExist((uintptr_t)addr)) + return NULL; + if(!(getProtection((uintptr_t)addr)&PROT_READ)) + return NULL; + onebridge_t* one = (onebridge_t*)(((uintptr_t)addr&~(sizeof(onebridge_t)-1))); // align to start of bridge + if (one->C3 == 0xC3 && IsBridgeSignature(one->S, one->C)) { + if(one->w==NULL) + return NULL; + else { + if(one->func) + return one->name_or_func; + else + return NULL; + } + } + return NULL; } -void* getAlternate(void* addr) { - if(!my_alternates) - return addr; - khint_t k = kh_get(alternate, my_alternates, (uintptr_t)addr); - if(k!=kh_end(my_alternates)) - return kh_value(my_alternates, k); - return addr; +void init_bridge_helper() +{ } -void addAlternate(void* addr, void* alt) { - if(!my_alternates) { - my_alternates = kh_init(alternate); - } - int ret; - khint_t k = kh_put(alternate, my_alternates, (uintptr_t)addr, &ret); - if(!ret) // already there - return; - kh_value(my_alternates, k) = alt; + +void fini_bridge_helper() +{ + cleanAlternate(); } -void cleanAlternate() { - if(my_alternates) { - kh_destroy(alternate, my_alternates); - my_alternates = NULL; +#ifdef BOX32 +int isNativeCall32(uintptr_t addr, uintptr_t* calladdress, uint16_t* retn) +{ +#define PK(a) *(uint8_t*)(addr+a) +#define PK32(a) *(uint32_t*)(addr+a) + + if(!addr || !getProtection(addr)) + return 0; + if(PK(0)==0xff && PK(1)==0x25) { // absolute jump, maybe the GOT + ptr_t a1 = (PK32(2)); // need to add a check to see if the address is from the GOT ! + addr = (uintptr_t)getAlternate(from_ptrv(a1)); } + if(addr<0x10000 || !getProtection(addr)) // too low, that is suspicious + return 0; + onebridge_t *b = (onebridge_t*)(addr); + if(b->CC==0xCC && b->S=='S' && b->C=='C' && b->w!=(wrapper_t)0 && b->f!=(uintptr_t)PltResolver32) { + // found ! + if(retn) *retn = (b->C3==0xC2)?b->N:0; + if(calladdress) *calladdress = addr+1; + return 1; + } + return 0; +#undef PK32 +#undef PK } - -void init_bridge_helper() +#else +int isNativeCall32(uintptr_t addr, uintptr_t* calladdress, uint16_t* retn) { + return 0; } +#endif -void fini_bridge_helper() +int isNativeCallInternal(uintptr_t addr, int is32bits, uintptr_t* calladdress, uint16_t* retn) { - cleanAlternate(); + if (is32bits) + return isNativeCall32(addr, calladdress, retn); + +#define PK(a) *(uint8_t*)(addr + a) +#define PK32(a) *(int32_t*)(addr + a) + + if (!addr || !getProtection(addr)) + return 0; + if (PK(0) == 0xff && PK(1) == 0x25) { // "absolute" jump, maybe the GOT (well, RIP relative in fact) + uintptr_t a1 = addr + 6 + (PK32(2)); // need to add a check to see if the address is from the GOT ! + addr = (uintptr_t)getAlternate(*(void**)a1); + } + if (!addr || !getProtection(addr)) + return 0; + onebridge_t* b = (onebridge_t*)(addr); + if (b->CC == 0xCC && IsBridgeSignature(b->S, b->C) && b->w != (wrapper_t)0 && b->f != (uintptr_t)PltResolver64) { + // found ! + if (retn) *retn = (b->C3 == 0xC2) ? b->N : 0; + if (calladdress) *calladdress = addr + 1; + return 1; + } + return 0; +#undef PK32 +#undef PK } diff --git a/src/tools/bridge_private.h b/src/tools/bridge_private.h index f59f587..f0ff3a3 100644 --- a/src/tools/bridge_private.h +++ b/src/tools/bridge_private.h @@ -14,7 +14,8 @@ typedef union onebridge_s { uintptr_t f; // the function for the wrapper uint8_t C3; // C2 or C3 ret uint16_t N; // N in case of C2 ret - const char* name; // name of the function bridged + uint8_t func; // 1 if name_or_func is actualy a function (so no name in that case) + void* name_or_func; // name of the function bridged }; struct { uint8_t B8; // B8 00 11 22 33 mov eax, num diff --git a/src/tools/callback.c b/src/tools/callback.c index 341a554..e5a8148 100644 --- a/src/tools/callback.c +++ b/src/tools/callback.c @@ -6,49 +6,81 @@ #include "debug.h" #include "x64emu.h" -#include "x64run.h" #include "emu/x64emu_private.h" #include "emu/x64run_private.h" #include "box64context.h" #include "box64stack.h" -#include "dynarec.h" +#include "box64cpu.h" +#include "box64cpu_util.h" +#ifdef BOX32 +#include "box32.h" +#include "emu/x87emu_private.h" +#endif EXPORTDYN uint64_t RunFunction(uintptr_t fnc, int nargs, ...) { x64emu_t *emu = thread_get_emu(); - int align = (nargs>6)?(((nargs-6)&1)):0; - int stackn = align + ((nargs>6)?(nargs-6):0); - - Push64(emu, R_RBP); // push rbp - R_RBP = R_RSP; // mov rbp, rsp + #ifdef BOX32 + if(box64_is32bits) { + Push_32(emu, R_RBP); // push ebp + R_RBP = R_ESP; // mov ebp, esp - R_RSP -= stackn*sizeof(void*); // need to push in reverse order + R_ESP -= nargs*4+(4-(nargs&3))*4; // need to push in reverse order - uint64_t *p = (uint64_t*)R_RSP; + ptr_t *p = (ptr_t*)from_ptrv(R_ESP); - va_list va; - va_start (va, nargs); - for (int i=0; iregs[nn[i]].q[0] = va_arg(va, uint64_t); - } else { - *p = va_arg(va, uint64_t); + va_list va; + va_start (va, nargs); + for (int i=0; i6)?(((nargs-6)&1)):0; + int stackn = align + ((nargs>6)?(nargs-6):0); + + Push64(emu, R_RBP); // push rbp + R_RBP = R_RSP; // mov rbp, rsp + + R_RSP -= stackn*sizeof(void*); // need to push in reverse order + + uint64_t *p = (uint64_t*)R_RSP; + + va_list va; + va_start (va, nargs); + for (int i=0; iregs[nn[i]].q[0] = va_arg(va, uint64_t); + } else { + *p = va_arg(va, uint64_t); + p++; + } + } + va_end (va); } - va_end (va); uintptr_t oldip = R_RIP; DynaCall(emu, fnc); if(oldip==R_RIP) { - R_RSP = R_RBP; // mov rsp, rbp - R_RBP = Pop64(emu); // pop rbp + #ifdef BOX32 + if(box64_is32bits) { + R_RSP = R_EBP; // mov esp, ebp + R_EBP = Pop_32(emu); // pop ebp + } + #endif + { + R_RSP = R_RBP; // mov rsp, rbp + R_RBP = Pop64(emu); // pop rbp + } } - uint64_t ret = R_RAX; + uint64_t ret = box64_is32bits?((uint64_t)R_EAX | ((uint64_t)R_EDX)<<32):R_RAX; return ret; } @@ -61,6 +93,27 @@ uint64_t RunFunctionFmt(uintptr_t fnc, const char* fmt, ...) int ni = 0; int ndf = 0; for (int i=0; fmt[i]; ++i) { + #ifdef BOX32 + if(box64_is32bits) + switch(fmt[i]) { + case 'd': + case 'I': + case 'U': nargs+=2; break; + case 'p': + case 'L': + case 'l': + case 'f': + case 'i': + case 'u': + case 'w': + case 'W': + case 'c': + case 'C': ++nargs; break; + default: + ++nargs; break; + } + else + #endif switch(fmt[i]) { case 'f': case 'd': if(ndf<8) ++ndf; else ++nargs; break; @@ -83,63 +136,289 @@ uint64_t RunFunctionFmt(uintptr_t fnc, const char* fmt, ...) ndf = 0; int align = nargs&1; int stackn = align + nargs; + int sizeof_ptr = sizeof(void*); + #ifdef BOX32 + if(box64_is32bits) { + Push_32(emu, R_EBP); // push ebp + R_RBP = R_ESP; // mov ebp, esp + sizeof_ptr = sizeof(ptr_t); + align = (4-(nargs&3))&3; + } else + #endif + { + Push64(emu, R_RBP); // push rbp + R_RBP = R_RSP; // mov rbp, rsp + } - Push64(emu, R_RBP); // push rbp - R_RBP = R_RSP; // mov rbp, rsp + R_RSP -= stackn*sizeof_ptr; // need to push in reverse order + + #ifdef BOX32 + if(box64_is32bits) { + ptr_t *p = (ptr_t*)from_ptrv(R_ESP); + + #define GO(c, B, B2, N) case c: *((B*)p) = va_arg(va, B2); p+=N; break + va_list va; + va_start (va, fmt); + for (int i=0; fmt[i]; ++i) { + switch(fmt[i]) { + GO('f', float, double, 1); + GO('d', double, double, 2); + case 'p': *((ptr_t*)p) = to_ptrv(va_arg(va, void*)); p+=1; break; + GO('i', int, int, 1); + GO('u', uint32_t, uint32_t, 1); + GO('I', int64_t, int64_t, 2); + GO('U', uint64_t, uint64_t, 2); + GO('L', uint32_t, uint64_t, 1); // long are 64bits on 64bits system + GO('l', int32_t, int64_t, 1); // but 32bits on 32bits system + GO('w', int16_t, int, 1); + GO('W', uint16_t, int, 1); + GO('c', int8_t, int, 1); + GO('C', uint8_t, int, 1); + default: + printf_log(LOG_NONE, "Error, unhandled arg %d: '%c' in RunFunctionFmt\n", i, fmt[i]); + *p = va_arg(va, uint32_t); + ++p; + break; + } + } + #undef GO + va_end (va); + } else + #endif + { + uint64_t *p = (uint64_t*)R_RSP; + + static const int nn[] = {_DI, _SI, _DX, _CX, _R8, _R9}; + #define GO(c, A, B, B2, C) case c: if(ni<6) emu->regs[nn[ni++]].A[0] = C va_arg(va, B2); else {*p = 0; *((B*)p) = va_arg(va, B2); ++p;}; break; + va_list va; + va_start (va, fmt); + for (int i=0; fmt[i]; ++i) { + switch(fmt[i]) { + case 'f': if(ndf<8) + emu->xmm[ndf++].f[0] = va_arg(va, double); // float are promoted to double in ... + else { + *p = 0; + *((float*)p) = va_arg(va, double); + ++p; + } + break; + case 'd': if(ndf<8) + emu->xmm[ndf++].d[0] = va_arg(va, double); + else { + *((double*)p) = va_arg(va, double); + ++p; + } + break; + GO('p', q, void*, void*, (uintptr_t)) + GO('i', sdword, int, int, ) + GO('u', dword, uint32_t, uint32_t, ) + GO('I', sq, int64_t, int64_t, ) + GO('U', q, uint64_t, uint64_t, ) + GO('L', q, uint64_t, uint64_t, ) + GO('l', sq, int64_t, int64_t, ) + GO('w', sword, int16_t, int, ) + GO('W', word, uint16_t, int, ) + GO('c', sbyte, int8_t, int, ) + GO('C', byte, uint8_t, int, ) + default: + printf_log(LOG_NONE, "Error, unhandled arg %d: '%c' in RunFunctionFmt\n", i, fmt[i]); + if(ni<6) emu->regs[nn[ni++]].q[0] = va_arg(va, uint64_t); else {*p = va_arg(va, uint64_t); ++p;}; + break; + } + } + #undef GO + va_end (va); + } - R_RSP -= stackn*sizeof(void*); // need to push in reverse order + uintptr_t oldip = R_RIP; + DynaCall(emu, fnc); - uint64_t *p = (uint64_t*)R_RSP; + if(oldip==R_RIP) { + #ifdef BOX32 + if(box64_is32bits) { + R_RSP = R_EBP; // mov esp, ebp + R_RBP = Pop_32(emu); // pop ebp + } else + #endif + { + R_RSP = R_RBP; // mov rsp, rbp + R_RBP = Pop64(emu); // pop rbp + } + } - static const int nn[] = {_DI, _SI, _DX, _CX, _R8, _R9}; - #define GO(c, A, B, B2, C) case c: if(ni<6) emu->regs[nn[ni++]].A[0] = C va_arg(va, B2); else {*p = 0; *((B*)p) = va_arg(va, B2); ++p;}; break; - va_list va; - va_start (va, fmt); + uint64_t ret = box64_is32bits?((uint64_t)R_EAX | ((uint64_t)R_EDX)<<32):R_RAX; + + return ret; +} + +EXPORTDYN +double RunFunctionFmtD(uintptr_t fnc, const char* fmt, ...) +{ + x64emu_t *emu = thread_get_emu(); + int nargs = 0; + int ni = 0; + int ndf = 0; for (int i=0; fmt[i]; ++i) { + #ifdef BOX32 + if(box64_is32bits) + switch(fmt[i]) { + case 'd': + case 'I': + case 'U': nargs+=2; break; + case 'p': + case 'L': + case 'l': + case 'f': + case 'i': + case 'u': + case 'w': + case 'W': + case 'c': + case 'C': ++nargs; break; + default: + ++nargs; break; + } + else + #endif switch(fmt[i]) { - case 'f': if(ndf<8) - emu->xmm[ndf++].f[0] = va_arg(va, double); // float are promoted to double in ... - else { - *p = 0; - *((float*)p) = va_arg(va, double); - ++p; - } - break; - case 'd': if(ndf<8) - emu->xmm[ndf++].d[0] = va_arg(va, double); - else { - *((double*)p) = va_arg(va, double); - ++p; - } - break; - GO('p', q, void*, void*, (uintptr_t)) - GO('i', sdword, int, int, ) - GO('u', dword, uint32_t, uint32_t, ) - GO('I', sq, int64_t, int64_t, ) - GO('U', q, uint64_t, uint64_t, ) - GO('L', q, uint64_t, uint64_t, ) - GO('l', sq, int64_t, int64_t, ) - GO('w', sword, int16_t, int, ) - GO('W', word, uint16_t, int, ) - GO('c', sbyte, int8_t, int, ) - GO('C', byte, uint8_t, int, ) + case 'f': + case 'd': if(ndf<8) ++ndf; else ++nargs; break; + case 'p': + case 'i': + case 'u': + case 'I': + case 'U': + case 'L': + case 'l': + case 'w': + case 'W': + case 'c': + case 'C': if(ni<6) ++ni; else ++nargs; break; default: - printf_log(LOG_NONE, "Error, unhandled arg %d: '%c' in RunFunctionFmt\n", i, fmt[i]); - if(ni<6) emu->regs[nn[ni++]].q[0] = va_arg(va, uint64_t); else {*p = va_arg(va, uint64_t); ++p;}; - break; + if(ni<6) ++ni; else ++nargs; break; } } - va_end (va); + ni = 0; + ndf = 0; + int align = nargs&1; + int stackn = align + nargs; + int sizeof_ptr = sizeof(void*); + #ifdef BOX32 + if(box64_is32bits) { + Push_32(emu, R_EBP); // push ebp + R_RBP = R_ESP; // mov ebp, esp + sizeof_ptr = sizeof(ptr_t); + align = (4-(nargs&3))&3; + } else + #endif + { + Push64(emu, R_RBP); // push rbp + R_RBP = R_RSP; // mov rbp, rsp + } + + R_RSP -= stackn*sizeof_ptr; // need to push in reverse order + + #ifdef BOX32 + if(box64_is32bits) { + ptr_t *p = (ptr_t*)from_ptrv(R_ESP); + + #define GO(c, B, B2, N) case c: *((B*)p) = va_arg(va, B2); p+=N; break + va_list va; + va_start (va, fmt); + for (int i=0; fmt[i]; ++i) { + switch(fmt[i]) { + GO('f', float, double, 1); + GO('d', double, double, 2); + case 'p': *((ptr_t*)p) = to_ptrv(va_arg(va, void*)); p+=1; break; + GO('i', int, int, 1); + GO('u', uint32_t, uint32_t, 1); + GO('I', int64_t, int64_t, 2); + GO('U', uint64_t, uint64_t, 2); + GO('L', uint32_t, uint64_t, 1); // long are 64bits on 64bits system + GO('l', int32_t, int64_t, 1); // but 32bits on 32bits system + GO('w', int16_t, int, 1); + GO('W', uint16_t, int, 1); + GO('c', int8_t, int, 1); + GO('C', uint8_t, int, 1); + default: + printf_log(LOG_NONE, "Error, unhandled arg %d: '%c' in RunFunctionFmt\n", i, fmt[i]); + *p = va_arg(va, uint32_t); + ++p; + break; + } + } + #undef GO + va_end (va); + } else + #endif + { + uint64_t *p = (uint64_t*)R_RSP; + + static const int nn[] = {_DI, _SI, _DX, _CX, _R8, _R9}; + #define GO(c, A, B, B2, C) case c: if(ni<6) emu->regs[nn[ni++]].A[0] = C va_arg(va, B2); else {*p = 0; *((B*)p) = va_arg(va, B2); ++p;}; break; + va_list va; + va_start (va, fmt); + for (int i=0; fmt[i]; ++i) { + switch(fmt[i]) { + case 'f': if(ndf<8) + emu->xmm[ndf++].f[0] = va_arg(va, double); // float are promoted to double in ... + else { + *p = 0; + *((float*)p) = va_arg(va, double); + ++p; + } + break; + case 'd': if(ndf<8) + emu->xmm[ndf++].d[0] = va_arg(va, double); + else { + *((double*)p) = va_arg(va, double); + ++p; + } + break; + GO('p', q, void*, void*, (uintptr_t)) + GO('i', sdword, int, int, ) + GO('u', dword, uint32_t, uint32_t, ) + GO('I', sq, int64_t, int64_t, ) + GO('U', q, uint64_t, uint64_t, ) + GO('L', q, uint64_t, uint64_t, ) + GO('l', sq, int64_t, int64_t, ) + GO('w', sword, int16_t, int, ) + GO('W', word, uint16_t, int, ) + GO('c', sbyte, int8_t, int, ) + GO('C', byte, uint8_t, int, ) + default: + printf_log(LOG_NONE, "Error, unhandled arg %d: '%c' in RunFunctionFmt\n", i, fmt[i]); + if(ni<6) emu->regs[nn[ni++]].q[0] = va_arg(va, uint64_t); else {*p = va_arg(va, uint64_t); ++p;}; + break; + } + } + #undef GO + va_end (va); + } uintptr_t oldip = R_RIP; DynaCall(emu, fnc); if(oldip==R_RIP) { - R_RSP = R_RBP; // mov rsp, rbp - R_RBP = Pop64(emu); // pop rbp + #ifdef BOX32 + if(box64_is32bits) { + R_RSP = R_EBP; // mov esp, ebp + R_RBP = Pop_32(emu); // pop ebp + } else + #endif + { + R_RSP = R_RBP; // mov rsp, rbp + R_RBP = Pop64(emu); // pop rbp + } } - - uint64_t ret = R_RAX; + double ret; + #ifdef BOX32 + if(box64_is32bits) { + ret = ST0.d; + fpu_do_pop(emu); + } else + #endif + ret = emu->xmm[0].d[0]; return ret; } @@ -148,6 +427,10 @@ EXPORTDYN uint64_t RunSafeFunction(uintptr_t fnc, int nargs, ...) { x64emu_t * emu = thread_get_emu(); + if(box64_is32bits) { + printf_log(LOG_NONE, "Calling RunSafeFunction in 32bits\n"); + abort(); + } int align = (nargs>6)?(((nargs-6)&1)):0; int stackn = align + ((nargs>6)?(nargs-6):0); @@ -168,9 +451,6 @@ uint64_t RunSafeFunction(uintptr_t fnc, int nargs, ...) multiuint_t old_op1 = emu->op1; multiuint_t old_op2 = emu->op2; multiuint_t old_res = emu->res; - multiuint_t old_op1_sav= emu->op1_sav; - multiuint_t old_res_sav= emu->res_sav; - deferred_flags_t old_df_sav= emu->df_sav; R_RSP -= stackn*sizeof(void*); // need to push in reverse order @@ -212,9 +492,6 @@ uint64_t RunSafeFunction(uintptr_t fnc, int nargs, ...) emu->op1 = old_op1; emu->op2 = old_op2; emu->res = old_res; - emu->op1_sav = old_op1_sav; - emu->res_sav = old_res_sav; - emu->df_sav = old_df_sav; return ret; } @@ -222,28 +499,48 @@ uint64_t RunSafeFunction(uintptr_t fnc, int nargs, ...) EXPORTDYN uint64_t RunFunctionWithEmu(x64emu_t *emu, int QuitOnLongJump, uintptr_t fnc, int nargs, ...) { - int align = (nargs>6)?(((nargs-6)&1)):0; - int stackn = align + ((nargs>6)?(nargs-6):0); + #ifdef BOX32 + if(box64_is32bits) { + Push_32(emu, R_RBP); // push ebp + R_RBP = R_ESP; // mov ebp, esp - Push64(emu, R_RBP); // push rbp - R_RBP = R_RSP; // mov rbp, rsp - - R_RSP -= stackn*sizeof(void*); // need to push in reverse order + R_ESP -= nargs*4 + ((4-(nargs&3))&3)*4; // need to push in reverse order - uint64_t *p = (uint64_t*)R_RSP; + ptr_t *p = (ptr_t*)from_ptrv(R_ESP); - va_list va; - va_start (va, nargs); - for (int i=0; iregs[nn[i]].q[0] = va_arg(va, uint64_t); - } else { - *p = va_arg(va, uint64_t); + va_list va; + va_start (va, nargs); + for (int i=0; i6)?(((nargs-6)&1)):0; + int stackn = align + ((nargs>6)?(nargs-6):0); + + Push64(emu, R_RBP); // push rbp + R_RBP = R_RSP; // mov rbp, rsp + + R_RSP -= stackn*sizeof(void*); // need to push in reverse order + + uint64_t *p = (uint64_t*)R_RSP; + + va_list va; + va_start (va, nargs); + for (int i=0; iregs[nn[i]].q[0] = va_arg(va, uint64_t); + } else { + *p = va_arg(va, uint64_t); + p++; + } + } + va_end (va); } - va_end (va); uintptr_t oldip = R_RIP; int old_quit = emu->quit; @@ -256,20 +553,29 @@ uint64_t RunFunctionWithEmu(x64emu_t *emu, int QuitOnLongJump, uintptr_t fnc, in if(oldip==R_RIP) { R_RSP = R_RBP; // restore stack only if EIP is the one expected (else, it means return value is not the one expected) - R_RBP = Pop64(emu); //Pop EBP + #ifdef BOX32 + if(box64_is32bits) + R_RBP = Pop_32(emu); //Pop EBP + else + #endif + R_RBP = Pop64(emu); //Pop EBP } emu->quit = old_quit; emu->flags.quitonlongjmp = oldlong; - return R_RAX; + return box64_is32bits?((uint64_t)R_EAX | ((uint64_t)R_EDX)<<32):R_RAX;; } EXPORTDYN uint64_t RunFunctionWindows(uintptr_t fnc, int nargs, ...) { x64emu_t *emu = thread_get_emu(); + if(box64_is32bits) { + printf_log(LOG_NONE, "Calling RunFunctionWindows in 32bits\n"); + abort(); + } int align = (nargs>4)?(((nargs-4)&1)):0; int stackn = align + ((nargs>4)?(nargs-4):0); @@ -306,4 +612,4 @@ uint64_t RunFunctionWindows(uintptr_t fnc, int nargs, ...) uint64_t ret = R_RAX; return ret; -} \ No newline at end of file +} diff --git a/src/tools/cleanup.c b/src/tools/cleanup.c new file mode 100644 index 0000000..f779b2f --- /dev/null +++ b/src/tools/cleanup.c @@ -0,0 +1,68 @@ +#include + +#include "cleanup.h" +#include "elfs/elfloader_private.h" +#include "box64context.h" +#include "debug.h" +#include "callback.h" + +typedef struct cleanup_s { + void* f; + int arg; + void* a; +} cleanup_t; + +void AddCleanup(x64emu_t *emu, void *p) +{ + (void)emu; + + if(my_context->clean_sz == my_context->clean_cap) { + my_context->clean_cap += 32; + my_context->cleanups = (cleanup_t*)box_realloc(my_context->cleanups, sizeof(cleanup_t)*my_context->clean_cap); + } + my_context->cleanups[my_context->clean_sz].arg = 0; + my_context->cleanups[my_context->clean_sz].a = NULL; + my_context->cleanups[my_context->clean_sz++].f = p; +} + +void AddCleanup1Arg(x64emu_t *emu, void *p, void* a, elfheader_t* h) +{ + (void)emu; + if (!h) + h = my_context->elfs[0]; + + if(h->clean_sz == h->clean_cap) { + h->clean_cap += 32; + h->cleanups = (cleanup_t*)box_realloc(h->cleanups, sizeof(cleanup_t)*h->clean_cap); + } + h->cleanups[h->clean_sz].arg = 1; + h->cleanups[h->clean_sz].a = a; + h->cleanups[h->clean_sz++].f = p; +} + +void CallCleanup(x64emu_t *emu, elfheader_t* h) +{ + printf_log(LOG_DEBUG, "Calling atexit registered functions for elf: %p/%s\n", h, h?h->name:"(nil)"); + if(!h) + return; + for(int i=h->clean_sz-1; i>=0; --i) { + printf_log(LOG_DEBUG, "Call cleanup #%d (args:%d, arg:%p)\n", i, h->cleanups[i].arg, h->cleanups[i].a); + RunFunctionWithEmu(emu, 0, (uintptr_t)(h->cleanups[i].f), h->cleanups[i].arg, h->cleanups[i].a ); + // now remove the cleanup + if(i!=h->clean_sz-1) + memmove(h->cleanups+i, h->cleanups+i+1, (h->clean_sz-i-1)*sizeof(cleanup_t)); + --h->clean_sz; + } +} + +void CallAllCleanup(x64emu_t *emu) +{ + printf_log(LOG_DEBUG, "Calling atexit registered functions\n"); + for(int i=my_context->clean_sz-1; i>=0; --i) { + printf_log(LOG_DEBUG, "Call cleanup #%d\n", i); + --my_context->clean_sz; + RunFunctionWithEmu(emu, 0, (uintptr_t)(my_context->cleanups[i].f), my_context->cleanups[i].arg, my_context->cleanups[i].a ); + } + box_free(my_context->cleanups); + my_context->cleanups = NULL; +} \ No newline at end of file diff --git a/src/tools/env.c b/src/tools/env.c new file mode 100644 index 0000000..548dec7 --- /dev/null +++ b/src/tools/env.c @@ -0,0 +1,1508 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(DYNAREC) && !defined(WIN32) +#include +#include +#endif + +#include "os.h" +#include "env.h" +#include "custommem.h" +#include "khash.h" +#include "debug.h" +#include "fileutils.h" +#include "box64context.h" +#include "rbtree.h" +#include "wine_tools.h" +#include "pe_tools.h" + +box64env_t box64env = { 0 }; + +KHASH_MAP_INIT_STR(box64env_entry, box64env_t) +static kh_box64env_entry_t* box64env_entries = NULL; +static kh_box64env_entry_t* box64env_entries_wildcard = NULL; + +mmaplist_t* NewMmaplist(); +void DelMmaplist(mmaplist_t* list); +#ifdef DYNAREC +int MmaplistHasNew(mmaplist_t* list, int clear); +int MmaplistIsDirty(mmaplist_t* list); +int MmaplistNBlocks(mmaplist_t* list); +size_t MmaplistTotalAlloc(mmaplist_t* list); +void MmaplistFillBlocks(mmaplist_t* list, DynaCacheBlock_t* blocks); +void MmaplistAddNBlocks(mmaplist_t* list, int nblocks); +int MmaplistAddBlock(mmaplist_t* list, int fd, off_t offset, void* orig, size_t size, intptr_t delta_map, uintptr_t mapping_start); +int nLockAddressRange(uintptr_t start, size_t size); +void getLockAddressRange(uintptr_t start, size_t size, uintptr_t addrs[]); +void addLockAddress(uintptr_t addr); +int nUnalignedRange(uintptr_t start, size_t size); +void getUnalignedRange(uintptr_t start, size_t size, uintptr_t addrs[]); +void add_unaligned_address(uintptr_t addr); +#endif + +static rbtree_t* envmap = NULL; + +static const char default_rcfile[] = +"[bash]\n" +"BOX64_LOG=0\n" +"\n" +"[deadcells]\n" +"BOX64_PREFER_EMULATED=1\n" +"\n" +"[dontstarve]\n" +"BOX64_EMULATED_LIBS=libSDL2-2.0.so.0\n" +"\n" +"[dota2]\n" +"BOX64_CRASHHANDLER=1\n" +"BOX64_DYNAREC_STRONGMEM=1\n" +"\n" +"[factorio]\n" +"BOX64_DYNAREC_FASTROUND=0\n" +"\n" +"[heroic]\n" +"BOX64_NOSANDBOX=1\n" +"BOX64_MALLOC_HACK=2\n" +"\n" +"[LotCG.x86_64]\n" +"BOX64_DYNAREC_FASTROUND=0\n" +"\n" +"[Mini Metro]\n" +"BOX64_ADDLIBS=stdc++.so.6\n" +"\n" +"[pressure-vessel-wrap]\n" +"BOX64_NOGTK=1\n" +"\n" +"[ShovelKnight]\n" +"BOX64_SDL2_JGUID=1\n" +"\n" +"[Soma.bin.x86_64]\n" +"BOX64_DYNAREC_FASTROUND=0\n" +"\n" +"[streaming_client]\n" +"BOX64_EMULATED_LIBS=libSDL2-2.0.so.0:libSDL2_ttf-2.0.so.0\n" +"\n" +"[steam-runtime-launcher-service]\n" +"BOX64_NOGTK=1\n" +; + +#ifdef _WIN32 +#define PATHSEP "\\" +#define HOME "USERPROFILE" +#else +#define PATHSEP "/" +#define HOME "HOME" +#endif + +char* LowerCase(const char* s) +{ + if (!s) + return NULL; + char* ret = box_calloc(1, strlen(s) + 1); + size_t i = 0; + while (*s) { + ret[i++] = (*s >= 'A' && *s <= 'Z') ? (*s - 'A' + 'a') : (*s); + ++s; + } + + return ret; +} + +static void addNewEnvVar(const char* s) +{ +#ifndef _WIN32 + if (!s) return; + char* p = box_strdup(s); + char* e = strchr(p, '='); + if (!e) { + printf_log(LOG_INFO, "Invalid specific env. var. '%s'\n", s); + box_free(p); + return; + } + *e = '\0'; + ++e; + setenv(p, e, 1); + box_free(p); +#endif +} + +static void parseRange(const char* s, uintptr_t* start, uintptr_t* end) +{ + if (!s) return; + if (!strchr(s, '-')) return; + if (sscanf(s, "%" PRId64 "-%" PRId64, start, end) == 2) return; + if (sscanf(s, "0x%" PRIX64 "-0x%" PRIX64, start, end) == 2) return; + if (sscanf(s, "0x%" PRIx64 "-0x%" PRIx64, start, end) == 2) return; + sscanf(s, "%" PRIx64 "-%" PRIx64, start, end); +} + +void AddNewLibs(const char* list); + +extern int box64_cycle_log_initialized; + +static void applyCustomRules() +{ + if (BOX64ENV(log) == LOG_NEVER) { + SET_BOX64ENV(log, BOX64ENV(log) - 1); + SET_BOX64ENV(dump, 1); + } + +#ifndef _WIN32 + if (box64env.is_cycle_log_overridden) { + box64env.rolling_log = BOX64ENV(cycle_log); + + if (BOX64ENV(rolling_log) == 1) { + box64env.rolling_log = 16; + } + if (BOX64ENV(rolling_log) && BOX64ENV(log) > LOG_INFO) { + box64env.rolling_log = 0; + } + if (!box64_cycle_log_initialized) initCycleLog(my_context); + } + + if (box64env.is_dynarec_gdbjit_str_overridden) { + if (strlen(box64env.dynarec_gdbjit_str) == 1) { + if (box64env.dynarec_gdbjit_str[0] >= '0' && box64env.dynarec_gdbjit_str[0] <= '3') + box64env.dynarec_gdbjit = box64env.dynarec_gdbjit_str[0] - '0'; + + box64env.dynarec_gdbjit_start = 0x0; + box64env.dynarec_gdbjit_end = 0x0; + } else if (strchr(box64env.dynarec_gdbjit_str, '-')) { + parseRange(box64env.dynarec_gdbjit_str, &box64env.dynarec_gdbjit_start, &box64env.dynarec_gdbjit_end); + if (box64env.dynarec_gdbjit_end > box64env.dynarec_gdbjit_start) { + box64env.dynarec_gdbjit = 2; + } else { + box64env.dynarec_gdbjit = 0; + } + } + } +#endif + + if (box64env.is_dynarec_test_str_overridden) { + if (strlen(box64env.dynarec_test_str) == 1) { + if (box64env.dynarec_test_str[0] >= '0' && box64env.dynarec_test_str[0] <= '1') + box64env.dynarec_test = box64env.dynarec_test_str[0] - '0'; + + box64env.dynarec_test_start = 0x0; + box64env.dynarec_test_end = 0x0; + } else if (strchr(box64env.dynarec_test_str, '-')) { + parseRange(box64env.dynarec_test_str, &box64env.dynarec_test_start, &box64env.dynarec_test_end); + if (box64env.dynarec_test_end > box64env.dynarec_test_start) { + box64env.dynarec_test = 1; + } else { + box64env.dynarec_test = 0; + } + } + } + + if (box64env.is_nodynarec_overridden) + parseRange(box64env.nodynarec, &box64env.nodynarec_start, &box64env.nodynarec_end); + + if (box64env.is_dynarec_dump_range_overridden) + parseRange(box64env.dynarec_dump_range, &box64env.dynarec_dump_range_start, &box64env.dynarec_dump_range_end); + + if (box64env.dynarec_test) { + SET_BOX64ENV(dynarec_fastnan, 0); + SET_BOX64ENV(dynarec_fastround, 0); + if (BOX64ENV(dynarec_x87double) == 0) + SET_BOX64ENV(dynarec_x87double, 1); + SET_BOX64ENV(dynarec_div0, 1); + SET_BOX64ENV(dynarec_callret, 0); +#if defined(RV64) || defined(LA64) + SET_BOX64ENV(dynarec_nativeflags, 0); +#endif + } + + if (box64env.is_profile_overridden) { + if (!strcasecmp(box64env.profile, "safest")) { + SET_BOX64ENV_IF_EMPTY(dynarec_fastnan, 0); + SET_BOX64ENV_IF_EMPTY(dynarec_fastround, 0); + SET_BOX64ENV_IF_EMPTY(dynarec_bigblock, 0); + SET_BOX64ENV_IF_EMPTY(dynarec_safeflags, 2); + SET_BOX64ENV_IF_EMPTY(dynarec_strongmem, 2); + } else if (!strcasecmp(box64env.profile, "safe")) { + SET_BOX64ENV_IF_EMPTY(dynarec_bigblock, 0); + SET_BOX64ENV_IF_EMPTY(dynarec_safeflags, 2); + SET_BOX64ENV_IF_EMPTY(dynarec_strongmem, 1); + } else if (!strcasecmp(box64env.profile, "default")) { + } else if (!strcasecmp(box64env.profile, "fast")) { + SET_BOX64ENV_IF_EMPTY(dynarec_callret, 1); + SET_BOX64ENV_IF_EMPTY(dynarec_bigblock, 3); + SET_BOX64ENV_IF_EMPTY(dynarec_safeflags, 0); + SET_BOX64ENV_IF_EMPTY(dynarec_strongmem, 1); + SET_BOX64ENV_IF_EMPTY(dynarec_dirty, 1); + SET_BOX64ENV_IF_EMPTY(dynarec_forward, 1024); + } else if (!strcasecmp(box64env.profile, "fastest")) { + SET_BOX64ENV_IF_EMPTY(dynarec_callret, 1); + SET_BOX64ENV_IF_EMPTY(dynarec_bigblock, 3); + SET_BOX64ENV_IF_EMPTY(dynarec_safeflags, 0); + SET_BOX64ENV_IF_EMPTY(dynarec_strongmem, 0); + SET_BOX64ENV_IF_EMPTY(dynarec_dirty, 1); + SET_BOX64ENV_IF_EMPTY(dynarec_forward, 1024); + } else { + static int warned = 0; + if (!warned) { + printf_log(LOG_INFO, "Warning, unknown choice for BOX64_PROFILE: %s, choices are: safest,safe,default,fast,fastest.\n", box64env.profile); + warned = 1; + } + } + } + + if (box64env.maxcpu == 0 || (box64env.new_maxcpu < box64env.maxcpu)) { + box64env.maxcpu = box64env.new_maxcpu; + } + +#ifndef _WIN32 + if (box64env.dynarec_perf_map) { + char pathname[32]; + snprintf(pathname, sizeof(pathname), "/tmp/perf-%d.map", getpid()); + SET_BOX64ENV(dynarec_perf_map_fd, open(pathname, O_CREAT | O_RDWR | O_APPEND, S_IRUSR | S_IWUSR)); + } + if (box64env.emulated_libs && my_context) { + AppendList(&my_context->box64_emulated_libs, box64env.emulated_libs, 0); + } + if (!box64env.libgl) { + const char *p = getenv("SDL_VIDEO_GL_DRIVER"); + if(p) SET_BOX64ENV(libgl, box_strdup(p)); + } +#endif + + if (box64env.avx == 2) { + box64env.avx = 1; + box64env.avx2 = 1; + } + +#ifndef _WIN32 + if (box64env.exit) exit(0); +#endif + + if (box64env.env) addNewEnvVar(box64env.env); + if (box64env.env1) addNewEnvVar(box64env.env1); + if (box64env.env2) addNewEnvVar(box64env.env2); + if (box64env.env3) addNewEnvVar(box64env.env3); + if (box64env.env4) addNewEnvVar(box64env.env4); + if (box64env.env5) addNewEnvVar(box64env.env5); + +#ifndef _WIN32 + if (box64env.addlibs) AddNewLibs(box64env.addlibs); +#endif +} + +static void trimStringInplace(char* s) +{ + if (!s) return; + // trim right space/tab + size_t len = strlen(s); + while (len && (s[len - 1] == ' ' || s[len - 1] == '\t' || s[len - 1] == '\n')) + s[--len] = '\0'; + // trim left space/tab + while (s[0] == ' ' || s[0] == '\t') + memmove(s, s + 1, strlen(s)); +} + +static void freeEnv(box64env_t* env) +{ +#define INTEGER(NAME, name, default, min, max, wine) +#define INTEGER64(NAME, name, default, wine) +#define BOOLEAN(NAME, name, default, wine) +#define ADDRESS(NAME, name, wine) +#define STRING(NAME, name, wine) box_free(env->name); + ENVSUPER() +#undef INTEGER +#undef INTEGER64 +#undef BOOLEAN +#undef ADDRESS +#undef STRING +} + +#ifdef ARM64 +#define ENV_ARCH "arm64" +#elif defined(RV64) +#define ENV_ARCH "rv64" +#elif defined(LA64) +#define ENV_ARCH "la64" +#elif defined(X86_64) +#define ENV_ARCH "x86_64" +#else +#warning "Unknown architecture for ENV_ARCH" +#define ENV_ARCH "unknown" +#endif + +static void pushNewEntry(const char* name, box64env_t* env, int wildcard) +{ + if (env->is_arch_overridden && *env->arch == '\0') env->is_arch_overridden = 0; + + // Arch specific but not match, ignore + if (env->is_arch_overridden && strcasecmp(env->arch, ENV_ARCH)) { + freeEnv(env); + return; + } + khint_t k; + kh_box64env_entry_t* khp = wildcard ? box64env_entries_wildcard : box64env_entries; + k = kh_get(box64env_entry, khp, name); + // No entry exist, add a new one + if (k == kh_end(khp)) { + int ret; + k = kh_put(box64env_entry, khp, box_strdup(name), &ret); + box64env_t* p = &kh_value(khp, k); + memcpy(p, env, sizeof(box64env_t)); + return; + } + + // Entry exists, replace it if the new one is arch specific or has higher priority + if (env->is_arch_overridden && !strcasecmp(env->arch, ENV_ARCH) || env->priority > kh_value(khp, k).priority) { + freeEnv(&kh_value(khp, k)); + box64env_t* p = &kh_value(khp, k); + memcpy(p, env, sizeof(box64env_t)); + return; + } + + // Entry exists, the new one is generic, replace it only if existing one is also generic + box64env_t* p = &kh_value(khp, k); + if (!p->is_arch_overridden) { + freeEnv(p); + box64env_t* p = &kh_value(khp, k); + memcpy(p, env, sizeof(box64env_t)); + } +} + +#ifdef ANDROID +static int shm_open(const char *name, int oflag, mode_t mode) { + return -1; +} +static int shm_unlink(const char *name) { + return -1; +} +#endif + +static void initializeEnvFile(const char* filename, int priority) +{ + if (box64env.noenvfiles) return; + + BOXFILE* f = NULL; + if (filename) + f = box_fopen(filename, "r"); +#ifndef _WIN32 + else { +#define TMP_MEMRCFILE "/box64_rcfile" + int tmp = shm_open(TMP_MEMRCFILE, O_RDWR | O_CREAT, S_IRWXU); + if(tmp<0) return; // error, bye bye + shm_unlink(TMP_MEMRCFILE); // remove the shm file, but it will still exist because it's currently in use + int dummy = write(tmp, default_rcfile, sizeof(default_rcfile)); + (void)dummy; + lseek(tmp, 0, SEEK_SET); + f = fdopen(tmp, "r"); + } +#endif + + if (!f) return; + + if (!box64env_entries) + box64env_entries = kh_init(box64env_entry); + if (!box64env_entries_wildcard) + box64env_entries_wildcard = kh_init(box64env_entry); + + box64env_t current_env = { 0 }; + current_env.priority = priority; + size_t linesize = 0, len = 0; + char* current_name = NULL; + bool is_wildcard_name = false; + char line[1024]; + while ((box_fgets(line, 1024, f)) != NULL) { + // remove comments + char* p = strchr(line, '#'); + if (p) *p = '\0'; + trimStringInplace(line); + len = strlen(line); + if (line[0] == '[' && strchr(line, ']')) { + // new entry, push the previous one + if (current_name) + pushNewEntry(current_name, ¤t_env, is_wildcard_name); + is_wildcard_name = (line[1] == '*' && line[(intptr_t)(strchr(line, ']') - line) - 1] == '*'); + memset(¤t_env, 0, sizeof(current_env)); + box_free(current_name); + current_name = LowerCase(line + (is_wildcard_name ? 2 : 1)); + *(strchr(current_name, ']') + 1 - (is_wildcard_name ? 2 : 1)) = '\0'; + trimStringInplace(current_name); + } else if (strchr(line, '=')) { + char* key = line; + char* val = strchr(key, '=') + 1; + *strchr(key, '=') = '\0'; + trimStringInplace(key); + trimStringInplace(val); +#ifdef _WIN32 +#define VALID(a) a +#else +#define VALID(a) 1 +#endif + +#define INTEGER(NAME, name, default, min, max, wine) \ + else if (!strcmp(key, #NAME) && VALID(wine)) \ + { \ + int v = strtol(val, &p, 0); \ + if (p != val && v >= min && v <= max) { \ + current_env.is_##name##_overridden = 1; \ + current_env.is_any_overridden = 1; \ + current_env.name = v; \ + } \ + } +#define INTEGER64(NAME, name, default, wine) \ + else if (!strcmp(key, #NAME) && VALID(wine)) \ + { \ + int64_t v = strtoll(val, &p, 0); \ + if (p != val) { \ + current_env.is_##name##_overridden = 1; \ + current_env.is_any_overridden = 1; \ + current_env.name = v; \ + } \ + } +#define BOOLEAN(NAME, name, default, wine) \ + else if (!strcmp(key, #NAME) && VALID(wine)) \ + { \ + if (strcmp(val, "0")) { \ + current_env.is_##name##_overridden = 1; \ + current_env.is_any_overridden = 1; \ + current_env.name = 1; \ + } else { \ + current_env.is_##name##_overridden = 1; \ + current_env.is_any_overridden = 1; \ + current_env.name = 0; \ + } \ + } +#define ADDRESS(NAME, name, wine) \ + else if (!strcmp(key, #NAME) && VALID(wine)) \ + { \ + uintptr_t v = (uintptr_t)strtoll(val, &p, 0); \ + if (p != val) { \ + current_env.is_##name##_overridden = 1; \ + current_env.is_any_overridden = 1; \ + current_env.name = v; \ + } \ + } +#define STRING(NAME, name, wine) \ + else if (!strcmp(key, #NAME) && VALID(wine)) \ + { \ + current_env.is_##name##_overridden = 1; \ + current_env.is_any_overridden = 1; \ + if (current_env.name) box_free(current_env.name); \ + current_env.name = strdup(val); \ + } + if (0) + ; + ENVSUPER() + else if (len && current_name) + { + printf_log(LOG_INFO, "BOX64ENV: Warning, unsupported %s=%s for [%s] in %s\n", key, val, current_name, filename); + } +#undef INTEGER +#undef INTEGER64 +#undef BOOLEAN +#undef ADDRESS +#undef STRING +#undef VALID + } + } + // push the last entry + if (current_name) { + pushNewEntry(current_name, ¤t_env, is_wildcard_name); + box_free(current_name); + } + box_fclose(f); +} + + +void InitializeEnvFiles() +{ + int priority = 0; +#ifndef _WIN32 // FIXME: this needs some consideration on Windows, so for now, only do it on Linux + if (BOX64ENV(envfile) && FileExist(BOX64ENV(envfile), IS_FILE)) + initializeEnvFile(BOX64ENV(envfile), priority++); +#ifndef TERMUX + else if (FileExist("/etc/box64.box64rc", IS_FILE)) + initializeEnvFile("/etc/box64.box64rc", priority++); + else if (FileExist("/data/data/com.termux/files/usr/glibc/etc/box64.box64rc", IS_FILE)) + initializeEnvFile("/data/data/com.termux/files/usr/glibc/etc/box64.box64rc", priority++); +#else + else if (FileExist("/data/data/com.termux/files/usr/etc/box64.box64rc", IS_FILE)) + initializeEnvFile("/data/data/com.termux/files/usr/etc/box64.box64rc", priority++); +#endif + else + initializeEnvFile(NULL, priority++); // load default rcfile +#endif + + char* p = GetEnv(HOME); + if (p) { + static char tmp[4096]; + strncpy(tmp, p, 4095); + strncat(tmp, PATHSEP ".box64rc", 4095); + if (FileExist(tmp, IS_FILE)) { + initializeEnvFile(tmp, priority++); + } + } +} + +static void internalApplyEnvFileEntry(const char* entryname, const box64env_t* env) +{ +#define INTEGER(NAME, name, default, min, max, wine) \ + if (env->is_##name##_overridden) { \ + box64env.name = env->name; \ + box64env.is_##name##_overridden = 1; \ + box64env.is_any_overridden = 1; \ + } +#define INTEGER64(NAME, name, default, wine) \ + if (env->is_##name##_overridden) { \ + box64env.name = env->name; \ + box64env.is_##name##_overridden = 1; \ + box64env.is_any_overridden = 1; \ + } +#define BOOLEAN(NAME, name, default, wine) \ + if (env->is_##name##_overridden) { \ + box64env.name = env->name; \ + box64env.is_##name##_overridden = 1; \ + box64env.is_any_overridden = 1; \ + } +#define ADDRESS(NAME, name, wine) \ + if (env->is_##name##_overridden) { \ + box64env.name = env->name; \ + box64env.is_##name##_overridden = 1; \ + box64env.is_any_overridden = 1; \ + } +#define STRING(NAME, name, wine) \ + if (env->is_##name##_overridden) { \ + box64env.name = env->name; \ + box64env.is_##name##_overridden = 1; \ + box64env.is_any_overridden = 1; \ + } + ENVSUPER() +#undef INTEGER +#undef INTEGER64 +#undef BOOLEAN +#undef ADDRESS +#undef STRING +} + +static char old_entryname[256] = ""; +int ApplyEnvFileEntry(const char* entryname) +{ + if (!entryname || !box64env_entries) return 0; + if (!strcasecmp(entryname, old_entryname)) return 0; + + int ret = 0; + strncpy(old_entryname, entryname, 255); + khint_t k1; + { + char* lowercase_entryname = LowerCase(entryname); + k1 = kh_get(box64env_entry, box64env_entries, lowercase_entryname); + box64env_t* env; + const char* k2; + // clang-format off + kh_foreach_ref(box64env_entries_wildcard, k2, env, + if (strstr(lowercase_entryname, k2)) { + internalApplyEnvFileEntry(entryname, env); + applyCustomRules(); + ret = 1; + } + ) + box_free(lowercase_entryname); + // clang-format on + } + if (k1 == kh_end(box64env_entries)) return ret; + + box64env_t* env = &kh_value(box64env_entries, k1); + internalApplyEnvFileEntry(entryname, env); + applyCustomRules(); + return 1; +} + +void LoadEnvVariables() +{ +#ifdef _WIN32 +#define INTEGER(NAME, name, default, min, max, wine) box64env.name = wine ? default : 0; +#define INTEGER64(NAME, name, default, wine) box64env.name = wine ? default : 0; +#define BOOLEAN(NAME, name, default, wine) box64env.name = wine ? default : 0; +#define ADDRESS(NAME, name, wine) box64env.name = 0; +#define STRING(NAME, name, wine) box64env.name = NULL; + ENVSUPER() +#undef INTEGER +#undef INTEGER64 +#undef BOOLEAN +#undef ADDRESS +#undef STRING +#else +#define INTEGER(NAME, name, default, min, max, wine) box64env.name = default; +#define INTEGER64(NAME, name, default, wine) box64env.name = default; +#define BOOLEAN(NAME, name, default, wine) box64env.name = default; +#define ADDRESS(NAME, name, wine) box64env.name = 0; +#define STRING(NAME, name, wine) box64env.name = NULL; + ENVSUPER() +#undef INTEGER +#undef INTEGER64 +#undef BOOLEAN +#undef ADDRESS +#undef STRING +#endif + char* p; + // load env vars from GetEnv() + +#ifdef _WIN32 +#define GETENV(name, wine) (wine ? GetEnv(name) : NULL); +#else +#define GETENV(name, wine) GetEnv(name) +#endif + +#define INTEGER(NAME, name, default, min, max, wine) \ + p = GETENV(#NAME, wine); \ + if (p) { \ + box64env.name = atoi(p); \ + if (box64env.name < min || box64env.name > max) { \ + box64env.name = default; \ + } else { \ + box64env.is_##name##_overridden = 1; \ + box64env.is_any_overridden = 1; \ + } \ + } +#define INTEGER64(NAME, name, default, wine) \ + p = GETENV(#NAME, wine); \ + if (p) { \ + box64env.name = atoll(p); \ + box64env.is_##name##_overridden = 1; \ + box64env.is_any_overridden = 1; \ + } +#define BOOLEAN(NAME, name, default, wine) \ + p = GETENV(#NAME, wine); \ + if (p) { \ + box64env.name = p[0] != '0'; \ + box64env.is_##name##_overridden = 1; \ + box64env.is_any_overridden = 1; \ + } +#define ADDRESS(NAME, name, wine) \ + p = GETENV(#NAME, wine); \ + if (p) { \ + char* endptr; \ + box64env.name = (uintptr_t)strtoll(p, &endptr, 0); \ + box64env.is_##name##_overridden = 1; \ + box64env.is_any_overridden = 1; \ + } +#define STRING(NAME, name, wine) \ + p = GETENV(#NAME, wine); \ + if (p && strcasecmp(#NAME, "BOX64_ARCH")) { \ + box64env.name = strdup(p); \ + box64env.is_##name##_overridden = 1; \ + box64env.is_any_overridden = 1; \ + } + ENVSUPER() +#undef INTEGER +#undef INTEGER64 +#undef BOOLEAN +#undef ADDRESS +#undef STRING + applyCustomRules(); +} + +void PrintEnvVariables(box64env_t* env, int level) +{ + if (env->is_any_overridden) printf_log(level, "BOX64ENV: Variables overridden:\n"); +#define INTEGER(NAME, name, default, min, max, wine) \ + if (env->is_##name##_overridden) \ + printf_log_prefix(0, level, "\t%s=%d\n", #NAME, env->name); +#define INTEGER64(NAME, name, default, wine) \ + if (env->is_##name##_overridden) \ + printf_log_prefix(0, level, "\t%s=%lld\n", #NAME, env->name); +#define BOOLEAN(NAME, name, default, wine) \ + if (env->is_##name##_overridden) \ + printf_log_prefix(0, level, "\t%s=%d\n", #NAME, env->name); +#define ADDRESS(NAME, name, wine) \ + if (env->is_##name##_overridden) \ + printf_log_prefix(0, level, "\t%s=%p\n", #NAME, (void*)env->name); +#define STRING(NAME, name, wine) \ + if (env->is_##name##_overridden) \ + printf_log_prefix(0, level, "\t%s=%s\n", #NAME, env->name); + ENVSUPER() +#undef INTEGER +#undef INTEGER64 +#undef BOOLEAN +#undef ADDRESS +#undef STRING + if(env->is_dynarec_test_str_overridden && env->dynarec_test) { + if(env->dynarec_test_end) + printf_log(level, "\tBOX64_DYNAREC_TEST on range %p-%p\n", (void*)box64env.dynarec_test_start, (void*)box64env.dynarec_test_end); + else + printf_log(level, "\tBOX64_DYNAREC_TEST activated\n"); + } + if(env->is_nodynarec_overridden && env->nodynarec_end) + printf_log(level, "\tBOX64_NODYNAREC on range %p-%p\n", (void*)box64env.nodynarec_start, (void*)box64env.nodynarec_end); + +} + +typedef struct mapping_s { + char* filename; + char* fullname; + box64env_t* env; + uintptr_t start; //lower address of the map for this file + mmaplist_t* mmaplist; +} mapping_t; + +KHASH_MAP_INIT_STR(mapping_entry, mapping_t*); +static kh_mapping_entry_t* mapping_entries = NULL; + +#if defined(DYNAREC) && !defined(WIN32) +void MmapDynaCache(mapping_t* mapping); +#endif + + +void RecordEnvMappings(uintptr_t addr, size_t length, int fd) +{ +#ifndef _WIN32 + if (!envmap) { envmap = rbtree_init("envmap"); } + if(!mapping_entries) mapping_entries = kh_init(mapping_entry); + + char* filename = NULL; + static char fullname[4096]; + if (fd > 0) { + static char buf[128]; + sprintf(buf, "/proc/self/fd/%d", fd); + ssize_t r = readlink(buf, fullname, sizeof(fullname) - 1); + if (r != -1) fullname[r] = 0; + + filename = strrchr(fullname, '/'); + } + if (!filename) return; + + char* lowercase_filename = LowerCase(filename); + + int ret; + mapping_t* mapping = NULL; + khint_t k = kh_get(mapping_entry, mapping_entries, fullname); + if(k == kh_end(mapping_entries)) { + // First time we see this file + if (box64_wine && BOX64ENV(unityplayer)) DetectUnityPlayer(lowercase_filename+1); + if (box64_wine && BOX64ENV(dynarec_volatile_metadata)) ParseVolatileMetadata(fullname, (void*)addr); + + mapping = box_calloc(1, sizeof(mapping_t)); + mapping->filename = box_strdup(lowercase_filename); + mapping->fullname = box_strdup(fullname); + mapping->start = addr; + k = kh_put(mapping_entry, mapping_entries, mapping->fullname, &ret); + kh_value(mapping_entries, k) = mapping; + if (box64env_entries) { + khint_t k = kh_get(box64env_entry, box64env_entries, mapping->filename); + if (k != kh_end(box64env_entries)) + mapping->env = &kh_value(box64env_entries, k); + } + dynarec_log(LOG_INFO, "Mapping %s (%s) in %p-%p\n", fullname, lowercase_filename, (void*)addr, (void*)(addr+length)); + #if defined(DYNAREC) && !defined(WIN32) + int dynacache = box64env.dynacache; + if(mapping->env && mapping->env->is_dynacache_overridden) + dynacache = mapping->env->dynacache; + if(dynacache) + MmapDynaCache(mapping); + #endif + } else + mapping = kh_value(mapping_entries, k); + + if(mapping && mapping->start>addr) { + dynarec_log(LOG_INFO, "Ignoring Mapping %s (%s) adjusted start: %p from %p\n", fullname, lowercase_filename, (void*)addr, (void*)(mapping->start)); + box_free(lowercase_filename); + return; + } + if(BOX64ENV(dynarec_log)) { + uintptr_t end; uintptr_t val; + if(rb_get_end_64(envmap, addr, &val, &end)) + if(endstart), (void*)(addr+length), (void*)end); + } + } + rb_set_64(envmap, addr, addr + length, (uint64_t)mapping); + if(mapping->env) { + printf_log(LOG_DEBUG, "Applied [%s] of range %p:%p\n", filename, addr, addr + length); + PrintEnvVariables(mapping->env, LOG_DEBUG); + } + box_free(lowercase_filename); +#endif +} + +#ifdef DYNAREC +const char* GetDynacacheFolder(mapping_t* mapping) +{ + static char folder[4096] = { 0 }; + if(mapping && mapping->env && mapping->env->is_dynacache_folder_overridden && mapping->env->dynacache_folder) { + if (FileExist(mapping->env->dynacache_folder, 0) || MakeDir(mapping->env->dynacache_folder)) { + strcpy(folder, mapping->env->dynacache_folder); + goto done; + } + } else if (box64env.dynacache_folder) { + if (FileExist(box64env.dynacache_folder, 0) || MakeDir(box64env.dynacache_folder)) { + strcpy(folder, box64env.dynacache_folder); + goto done; + } + } + + if(GetEnv("XDG_CACHE_HOME")) + strcpy(folder, GetEnv("XDG_CACHE_HOME")); + else if(GetEnv(HOME)) { + strcpy(folder, GetEnv(HOME)); + strcat(folder, PATHSEP); + strcat(folder, ".cache"); + if (!FileExist(folder, 0) && !MakeDir(folder)) + return NULL; + + } else + return NULL; + strcat(folder, PATHSEP); + strcat(folder, "box64"); + if (!FileExist(folder, 0) && !MakeDir(folder)) + return NULL; + +done: + if (folder[strlen(folder) - 1] != PATHSEP[0]) { + strcat(folder, PATHSEP); + } + return folder; +} + +/* + There is 3 version to change when evoling things, depending on what is changed: + 1. FILE_VERSION for the DynaCache infrastructure + 2. DYNAREC_VERSION for dynablock_t changes and other global dynarec change + 3. ARCH_VERSION for the architecture specific changes (and there is one per arch) + + An ARCH_VERSION of 0 means Unsupported and disable DynaCache. + Dynacache will ignore any DynaCache file not exactly matching those 3 version. + `box64 --dynacache-clean` can be used from command line to purge obsolete DyaCache files +*/ + +#define FILE_VERSION 2 +#define HEADER_SIGN "DynaCache" +#define SET_VERSION(MAJ, MIN, REV) (((MAJ)<<24)|((MIN)<<16)|(REV)) +#ifdef ARM64 +#define ARCH_VERSION SET_VERSION(0, 0, 12) +#elif defined(RV64) +#define ARCH_VERSION SET_VERSION(0, 0, 4) +#elif defined(LA64) +#define ARCH_VERSION SET_VERSION(0, 0, 5) +#else +#error meh! +#endif +#define DYNAREC_VERSION SET_VERSION(0, 1, 1) + +typedef struct DynaCacheHeader_s { + char sign[10]; //"DynaCache\0" + uint64_t file_version:16; + uint64_t dynarec_version:24; + uint64_t arch_version:24; + uint64_t cpuext; + uint64_t dynarec_settings; + size_t pagesize; + size_t codesize; + uintptr_t map_addr; + size_t map_len; + size_t file_length; + uint32_t filename_length; + uint32_t nblocks; + uint32_t nLockAddresses; + uint32_t nUnalignedAddresses; + char filename[]; +} DynaCacheHeader_t; + +#define DYNAREC_SETTINGS() \ + DS_GO(BOX64_DYNAREC_ALIGNED_ATOMICS, dynarec_aligned_atomics, 1) \ + DS_GO(BOX64_DYNAREC_BIGBLOCK, dynarec_bigblock, 2) \ + DS_GO(BOX64_DYNAREC_CALLRET, dynarec_callret, 2) \ + DS_GO(BOX64_DYNAREC_DF, dynarec_df, 1) \ + DS_GO(BOX64_DYNAREC_DIRTY, dynarec_dirty, 2) \ + DS_GO(BOX64_DYNAREC_DIV0, dynarec_div0, 1) \ + DS_GO(BOX64_DYNAREC_FASTNAN, dynarec_fastnan, 1) \ + DS_GO(BOX64_DYNAREC_FASTROUND, dynarec_fastround, 2) \ + DS_GO(BOX64_DYNAREC_FORWARD, dynarec_forward, 10) \ + DS_GO(BOX64_DYNAREC_NATIVEFLAGS, dynarec_nativeflags, 1) \ + DS_GO(BOX64_DYNAREC_SAFEFLAGS, dynarec_safeflags, 2) \ + DS_GO(BOX64_DYNAREC_STRONGMEM, dynarec_strongmem, 2) \ + DS_GO(BOX64_DYNAREC_VOLATILE_METADATA, dynarec_volatile_metadata, 1)\ + DS_GO(BOX64_DYNAREC_WEAKBARRIER, dynarec_weakbarrier, 2) \ + DS_GO(BOX64_DYNAREC_X87DOUBLE, dynarec_x87double, 2) \ + DS_GO(BOX64_DYNAREC_NOARCH, dynarec_noarch, 2) \ + DS_GO(BOX64_aes, aes, 1) \ + DS_GO(BOX64_PCLMULQDQ, pclmulqdq, 1) \ + DS_GO(BOX64_SHAEXT, shaext, 1) \ + DS_GO(BOX64_SSE42, sse42, 1) \ + DS_GO(BOX64_AVX, avx, 2) \ + DS_GO(BOX64_X87_NO80BITS, x87_no80bits, 1) \ + DS_GO(BOX64_RDTSC_1GHZ, rdtsc_1ghz, 1) \ + DS_GO(BOX64_SSE_FLUSHTO0, sse_flushto0, 1) \ + +#define DS_GO(A, B, C) uint64_t B:C; +typedef union dynarec_settings_s { + struct { + DYNAREC_SETTINGS() + }; + uint64_t x; +} dynarec_settings_t; +#undef DS_GO +uint64_t GetDynSetting(mapping_t* mapping) +{ + dynarec_settings_t settings = {0}; + #define DS_GO(A, B, C) settings.B = (mapping->env && mapping->env->is_##B##_overridden)?mapping->env->B:box64env.B; + DYNAREC_SETTINGS() + #undef DS_GO + return settings.x; +} +void PrintDynfSettings(int level, uint64_t s) +{ + dynarec_settings_t settings = {0}; + settings.x = s; + #define DS_GO(A, B, C) if(settings.B) printf_log_prefix(0, level, "\t\t" #A "=%d\n", settings.B); + DYNAREC_SETTINGS() + #undef DS_GO +} +#undef DYNAREC_SETTINGS + +char* MmaplistName(const char* filename, uint64_t dynarec_settings, const char* fullname) +{ + // names are FOLDER/filename-YYYYY-XXXXX.box64 + // Where XXXXX is the hash of the full name + // and YYYY is the Dynarec optim (in hex) + static char mapname[4096]; + snprintf(mapname, 4095-6, "%s-%llx-%u", filename, dynarec_settings, __ac_X31_hash_string(fullname)); + strcat(mapname, ".box64"); + return mapname; +} + +char* GetMmaplistName(mapping_t* mapping) +{ + return MmaplistName(mapping->filename+1, GetDynSetting(mapping), mapping->fullname); +} + +const char* NicePrintSize(size_t sz) +{ + static char buf[256]; + const char* units[] = {"", "kb", "Mb", "Gb"}; + size_t u, d; + int idx = 0; + size_t ratio = 0; + while(idx>ratio)<50) { + snprintf(buf, 255, "%zd.%zd%s", sz>>ratio, (sz>>(ratio-1))%10, units[idx]); + } else { + snprintf(buf, 255, "%zd%s", sz>>ratio, units[idx]); + } + return buf; +} + +void SerializeMmaplist(mapping_t* mapping) +{ + if(!DYNAREC_VERSION) + return; + if(mapping->env && mapping->env->is_dynacache_overridden && (mapping->env->dynacache!=1)) + return; + if((!mapping->env || !mapping->env->is_dynacache_overridden) && box64env.dynacache!=1) + return; + // don't do serialize for program that needs purge=1 + if(mapping->env && mapping->env->is_dynarec_purge_overridden && mapping->env->dynarec_purge) + return; + if((!mapping->env || !mapping->env->is_dynarec_purge_overridden) && box64env.dynarec_purge) + return; + // don't do serialize for program that needs dirty=1 + if(mapping->env && mapping->env->is_dynarec_dirty_overridden && mapping->env->dynarec_dirty) + return; + if((!mapping->env || !mapping->env->is_dynarec_dirty_overridden) && box64env.dynarec_dirty) + return; + const char* folder = GetDynacacheFolder(mapping); + if(!folder) return; // no folder, no serialize... + const char* name = GetMmaplistName(mapping); + if(!name) return; + char mapname[strlen(folder)+strlen(name)+1]; + strcpy(mapname, folder); + strcat(mapname, name); + size_t filesize = FileSize(mapping->fullname); + if(!filesize) { + dynarec_log(LOG_INFO, "DynaCache will not serialize cache for %s because filesize is 0\n", mapping->fullname); + return; // mmaped file as a 0 size... + } + // prepare header + int nblocks = MmaplistNBlocks(mapping->mmaplist); + if(!nblocks) { + dynarec_log(LOG_INFO, "DynaCache will not serialize cache for %s because nblocks is 0\n", mapping->fullname); + return; //How??? + } + size_t map_len = SizeFileMapped(mapping->start); + size_t nLockAddresses = nLockAddressRange(mapping->start, map_len); + size_t nUnaligned = nUnalignedRange(mapping->start, map_len); + size_t total = sizeof(DynaCacheHeader_t) + strlen(mapping->fullname) + 1 + nblocks*sizeof(DynaCacheBlock_t) + nLockAddresses*sizeof(uintptr_t) + nUnaligned*sizeof(uintptr_t);; + total = (total + box64_pagesize-1)&~(box64_pagesize-1); // align on pagesize + uint8_t all_header[total]; + memset(all_header, 0, total); + void* p = all_header; + DynaCacheHeader_t* header = p; + strcpy(header->sign, HEADER_SIGN); + header->file_version = FILE_VERSION; + header->dynarec_version = DYNAREC_VERSION; + header->arch_version = ARCH_VERSION; + header->dynarec_settings = GetDynSetting(mapping); + header->cpuext = cpuext.x; + header->pagesize = box64_pagesize; + header->codesize = MmaplistTotalAlloc(mapping->mmaplist); + header->map_addr = mapping->start; + header->file_length = filesize; + header->filename_length = strlen(mapping->fullname); + header->nblocks = MmaplistNBlocks(mapping->mmaplist); + header->map_len = map_len; + header->nLockAddresses = nLockAddresses; + header->nUnalignedAddresses = nUnaligned; + size_t dynacache_min = box64env.dynacache_min; + if(mapping->env && mapping->env->is_dynacache_min_overridden) + dynacache_min = mapping->env->dynacache_min; + if(dynacache_min*1024>header->codesize) { + dynarec_log(LOG_INFO, "DynaCache will not serialize cache for %s because there is not enough usefull code (%s)\n", mapping->fullname, NicePrintSize(header->codesize)); + return; // not enugh code, do no write + } + p += sizeof(DynaCacheHeader_t); // fullname + strcpy(p, mapping->fullname); + p += strlen(p) + 1; // blocks + DynaCacheBlock_t* blocks = p; + MmaplistFillBlocks(mapping->mmaplist, blocks); + p += nblocks*sizeof(DynaCacheBlock_t); + uintptr_t* lockAddresses = p; + p += nLockAddresses*sizeof(uintptr_t); + uintptr_t* unalignedAddresses = p; + if(nLockAddresses) + getLockAddressRange(mapping->start, map_len, lockAddresses); + if(nUnaligned) + getUnalignedRange(mapping->start, map_len, unalignedAddresses); + // all done, now just create the file and write all this down... + #ifndef WIN32 + unlink(mapname); + FILE* f = fopen(mapname, "wbx"); + if(!f) { + dynarec_log(LOG_INFO, "Cannot create cache file %s\n", mapname); + return; + } + if(fwrite(all_header, total, 1, f)!=1) { + dynarec_log(LOG_INFO, "Error writing Cache file (disk full?)\n"); + return; + } + for(int i=0; istart - header.map_addr; + dynarec_log(LOG_INFO, "Trying to load DynaCache for %s, with a delta_map=%zx\n", mapping->fullname, delta_map); + if(!mapping->mmaplist) + mapping->mmaplist = NewMmaplist(); + MmaplistAddNBlocks(mapping->mmaplist, header.nblocks); + for(int i=0; immaplist, fd, p, blocks[i].block, blocks[i].size, delta_map, mapping->start)) { + printf_log(LOG_NONE, "Error while doing relocation on a DynaCache (block %d)\n", i); + fclose(f); + return DCERR_RELOC; + } + p+=blocks[i].size; + } + for(size_t i=0; ifullname, header.nblocks); + } + fclose(f); + return DCERR_OK; +} +#endif + +void DynaCacheList(const char* filter) +{ + #ifndef WIN32 + const char* folder = GetDynacacheFolder(NULL); + if(!folder) { + printf_log(LOG_NONE, "DynaCache folder not found\n"); + return; + } + DIR* dir = opendir(folder); + if(!dir) { + printf_log(LOG_NONE, "Cannot open DynaCache folder\n"); + } + struct dirent* d = NULL; + int need_filter = (filter && strlen(filter)); + while(d = readdir(dir)) { + size_t l = strlen(d->d_name); + if(l>6 && !strcmp(d->d_name+l-6, ".box64")) { + if(need_filter && !strstr(d->d_name, filter)) + continue; + ReadDynaCache(folder, d->d_name, NULL, 1); + printf_log_prefix(0, LOG_NONE, "\n"); + } + } + closedir(dir); + #endif +} +void DynaCacheClean() +{ + #ifndef WIN32 + const char* folder = GetDynacacheFolder(NULL); + if(!folder) { + printf_log(LOG_NONE, "DynaCache folder not found\n"); + return; + } + DIR* dir = opendir(folder); + if(!dir) { + printf_log(LOG_NONE, "Cannot open DynaCache folder\n"); + } + struct dirent* d = NULL; + while(d = readdir(dir)) { + size_t l = strlen(d->d_name); + if(l>6 && !strcmp(d->d_name+l-6, ".box64")) { + int ret = ReadDynaCache(folder, d->d_name, NULL, 0); + if(ret) { + char filename[strlen(folder)+strlen(d->d_name)+1]; + strcpy(filename, folder); + strcat(filename, d->d_name); + size_t filesize = FileSize(filename); + if(!unlink(filename)) { + printf_log(LOG_NONE, "Removed %s for %s\n", d->d_name, NicePrintSize(filesize)); + } else { + printf_log(LOG_NONE, "Could not remove %d\n", d->d_name); + } + } + } + } + closedir(dir); + #endif +} +#ifndef WIN32 +void MmapDynaCache(mapping_t* mapping) +{ + if(!DYNAREC_VERSION) + return; + // no need to test dynacache enabled or not, it has already been done before this call + const char* folder = GetDynacacheFolder(mapping); + if(!folder) return; + const char* name = GetMmaplistName(mapping); + if(!name) return; + dynarec_log(LOG_DEBUG, "Looking for DynaCache %s in %s\n", name, folder); + ReadDynaCache(folder, name, mapping, 0); +} +#endif +#else +void SerializeMmaplist(mapping_t* mapping) {} +void DynaCacheList(const char* filter) { printf_log(LOG_NONE, "Dynarec not enable\n"); } +void DynaCacheClean() {} +#endif + +void WillRemoveMapping(uintptr_t addr, size_t length) +{ + #ifdef DYNAREC + if(!envmap) return; + mapping_t* mapping = (mapping_t*)rb_get_64(envmap, addr); + if(mapping) { + if(MmaplistHasNew(mapping->mmaplist, 1)) { + mutex_lock(&my_context->mutex_dyndump); + SerializeMmaplist(mapping); + mutex_unlock(&my_context->mutex_dyndump); + } + } + #endif +} + +void RemoveMapping(uintptr_t addr, size_t length) +{ + if(!envmap) return; + mapping_t* mapping = (mapping_t*)rb_get_64(envmap, addr); + rb_unset(envmap, addr, addr+length); + // quick check at next address + if(mapping) { + if(mapping == (mapping_t*)rb_get_64(envmap, addr+length)) + return; // still present, don't purge mapping + // Will traverse the tree to find any left over + uintptr_t start = rb_get_leftmost(envmap); + uintptr_t end; + uint64_t val; + do { + rb_get_end_64(envmap, start, &val, &end); + if((mapping_t*)val==mapping) + return; // found more occurance, exiting + start = end; + } while(end!=UINTPTR_MAX); + // no occurence found, delete mapping + dynarec_log(LOG_INFO, "Delete Mapping %s (%s) in %p(%p)-%p\n", mapping->fullname, mapping->filename, (void*)addr, (void*)mapping->start, (void*)(addr+length)); + khint_t k = kh_get(mapping_entry, mapping_entries, mapping->fullname); + if(k!=kh_end(mapping_entries)) + kh_del(mapping_entry, mapping_entries, k); + #ifdef DYNAREC + if(mapping->mmaplist) + DelMmaplist(mapping->mmaplist); + #endif + box_free(mapping->filename); + box_free(mapping->fullname); + box_free(mapping); + } +} + +void SerializeAllMapping() +{ +#ifdef DYNAREC + mapping_t* mapping; + mutex_lock(&my_context->mutex_dyndump); + kh_foreach_value(mapping_entries, mapping, + if(MmaplistHasNew(mapping->mmaplist, 1)) + SerializeMmaplist(mapping); + ); + mutex_unlock(&my_context->mutex_dyndump); +#endif +} + +box64env_t* GetCurEnvByAddr(uintptr_t addr) +{ + if (!envmap) return &box64env; + mapping_t* mapping = ((mapping_t*)rb_get_64(envmap, addr)); + if(!mapping) return &box64env; + box64env_t* env = mapping->env; + if(!env) return &box64env; + return env; +} + +mmaplist_t* GetMmaplistByAddr(uintptr_t addr) +{ + #ifdef DYNAREC + if (!envmap) return NULL; + mapping_t* mapping = ((mapping_t*)rb_get_64(envmap, addr)); + if(!mapping) return NULL; + mmaplist_t* list = mapping->mmaplist; + if(!list) + list = mapping->mmaplist = NewMmaplist(); + return list; + #else + return NULL; + #endif +} + + +int IsAddrFileMapped(uintptr_t addr, const char** filename, uintptr_t* start) +{ + if(!envmap) return 0; + mapping_t* mapping = ((mapping_t*)rb_get_64(envmap, addr)); + if(!mapping) return 0; + if(mapping->fullname) { + if(filename) *filename = mapping->fullname; + if(start) *start = mapping->start; + return 1; + } + return 0; +} + +size_t SizeFileMapped(uintptr_t addr) +{ + if(!envmap) return 0; + uint64_t val = 0; + uintptr_t end = 0; + if(rb_get_end_64(envmap, addr, &val, &end)) { + mapping_t* mapping = (mapping_t*)val; + if(mapping && (mapping->startstart; + } + return 0; +} + +int IsAddrNeedReloc(uintptr_t addr) +{ + box64env_t* env = GetCurEnvByAddr(addr); + // TODO: this seems quite wrong and should be refactored + int test = env->is_dynacache_overridden?env->dynacache:box64env.dynacache; + if(test!=1) + return 0; + uintptr_t end = env->nodynarec_end?env->nodynarec_end:box64env.nodynarec_end; + uintptr_t start = env->nodynarec_start?env->nodynarec_start:box64env.nodynarec_start; + if(end && addr>=start && addris_dynarec_dirty_overridden && env->dynarec_dirty) + return 0; + if((!env || !env->is_dynarec_dirty_overridden) && box64env.dynarec_dirty) + return 0; + #ifdef HAVE_TRACE + end = env->dynarec_test_end?env->dynarec_test_end:box64env.dynarec_test_end; + start = env->dynarec_test_start?env->dynarec_test_start:box64env.dynarec_test_start; + if(end && addr>=start && addris_dynarec_trace_overridden?env->dynarec_trace:box64env.dynarec_trace; + if(test && trace_end && addr>=trace_start && addrmmaplist) return 0; + if(MmaplistIsDirty(mapping->mmaplist)) return 0; + return 1; + #else + return 0; + #endif +} diff --git a/src/tools/fileutils.c b/src/tools/fileutils.c index 11dc690..a783718 100644 --- a/src/tools/fileutils.c +++ b/src/tools/fileutils.c @@ -20,27 +20,7 @@ static const char* x64lib = "\x7f" "ELF" "\x02" "\x01" "\x01" "\x03" "\x00" "\x static const char* bashsign= "#!/bin/bash"; static const char* shsign = "#!/bin/sh"; static const char* bashsign2="#!/usr/bin/env bash"; - -int FileExist(const char* filename, int flags) -{ - struct stat sb; - if (stat(filename, &sb) == -1) - return 0; - if(flags==-1) - return 1; - // check type of file? should be executable, or folder - if(flags&IS_FILE) { - if(!S_ISREG(sb.st_mode)) - return 0; - } else if(!S_ISDIR(sb.st_mode)) - return 0; - - if(flags&IS_EXECUTABLE) { - if((sb.st_mode&S_IXUSR)!=S_IXUSR) - return 0; // nope - } - return 1; -} +static const char* pythonsign="#!/usr/bin/env python3"; static char* ResolvePathInner(const char* path, int resolve_symlink) { if (resolve_symlink) { @@ -120,6 +100,29 @@ int FileIsX86ELF(const char* filename) return 0; } +int FileIsX64X86ELF(const char* filename) +{ + FILE *f = fopen(filename, "rb"); + if(!f) + return 0; + char head[20] = {0}; + int sz = fread(head, 20, 1, f); + fclose(f); + if(sz!=1) { + return 0; + } + head[7] = x64lib[7]; // this one changes + head[16]&=0xfe; + if(!memcmp(head, x86lib, 20)) + return 1; + head[8] = x64lib[8]; // AppImage customized this + head[9] = x64lib[9]; // and this one too + head[10] = x64lib[10]; // and that last one too + if(!memcmp(head, x64lib, 20)) + return 1; + return 0; +} + int FileIsShell(const char* filename) { FILE *f = fopen(filename, "rb"); @@ -139,6 +142,21 @@ int FileIsShell(const char* filename) return 0; } +int FileIsPython(const char* filename) +{ + FILE *f = fopen(filename, "rb"); + if(!f) + return 0; + char head[25] = {0}; + int sz = fread(head, strlen(pythonsign), 1, f); + fclose(f); + if(sz!=1) + return 0; + if(!strncmp(head, pythonsign, strlen(pythonsign))) + return 1; + return 0; +} + const char* GetTmpDir() { char *tmpdir; if ((tmpdir = getenv ("TMPDIR")) != NULL) return tmpdir; @@ -152,19 +170,6 @@ const char* GetTmpDir() { return "/tmp"; // meh... } -char* LowerCase(const char* s) { - if(!s) - return NULL; - char* ret = box_calloc(1, strlen(s)+1); - size_t i=0; - while(*s) { - ret[i++] = (*s>='A' && *s<='Z')?(*s-'A'+'a'):(*s); - ++s; - } - - return ret; -} - #if defined(RPI) || defined(RK3399) || defined(RK3326) void sanitize_mojosetup_gtk_background() { diff --git a/src/tools/gdbjit.c b/src/tools/gdbjit.c new file mode 100644 index 0000000..f1a3b0c --- /dev/null +++ b/src/tools/gdbjit.c @@ -0,0 +1,131 @@ +#ifdef GDBJIT +#include +#include +#include +#include +#include +#include "gdbjit.h" +#include "dynablock.h" +#include "debug.h" + + +/* GDB JIT Compilation Interface ----------------------------------------------- + * https://sourceware.org/gdb/current/onlinedocs/gdb.html/JIT-Interface.html + */ + +enum { + GDBJIT_NOACTION = 0, + GDBJIT_REGISTER, + GDBJIT_UNREGISTER +}; + +typedef struct gdbjit_code_entry_s { + struct gdbjit_code_entry_s* next_entry; + struct gdbjit_code_entry_s* prev_entry; + const char* symfile_addr; + uint64_t symfile_size; +} gdbjit_code_entry_t; + +typedef struct gdbjit_descriptor_s { + uint32_t version; + uint32_t action_flag; + gdbjit_code_entry_t* relevant_entry; + gdbjit_code_entry_t* first_entry; +} gdbjit_descriptor_t; + +/* GDB puts a breakpoint in this function. This can't be optimized out. */ +EXPORT void __attribute__((noinline)) __jit_debug_register_code() +{ + asm volatile("" ::: "memory"); +}; + +/* Make sure to specify the version statically, because the debugger may check + * the version before we can set it. + */ +EXPORT gdbjit_descriptor_t __jit_debug_descriptor = { 1, GDBJIT_NOACTION, NULL, NULL }; + +/* --------------------------------------------------------------------------- */ + +void GdbJITNewBlock(gdbjit_block_t* block, GDB_CORE_ADDR start, GDB_CORE_ADDR end, uintptr_t x64start) +{ + if (!block) return; + + size_t alloced = block->alloced; + memset(block, 0, sizeof(gdbjit_block_t)); + + strcpy(block->filename, "/tmp/box64gdbjit-XXXXXX.S"); + int fd = mkstemps(block->filename, 2); + block->file = fdopen(fd, "w"); + + block->start = start; + block->end = end; + block->x64start = x64start; + block->alloced = alloced; + block->nlines = 0; +} + +static size_t GdbJITLinesAvailable(gdbjit_block_t* block) +{ + if (!block) return 0; + + return block->alloced > block->nlines; +} + +#define GDBJIT_LINES_MAX_PREALLOC 64 + +static gdbjit_block_t* GdbJITMakeRoom(gdbjit_block_t* block) +{ + if (!block) return NULL; + + if (!GdbJITLinesAvailable(block)) { + size_t new_size = block->alloced + GDBJIT_LINES_MAX_PREALLOC; + block = box_realloc(block, sizeof(gdbjit_block_t) + new_size * sizeof(struct gdb_line_mapping)); + if (!block) return NULL; + block->alloced = new_size; + } + return block; +} + +gdbjit_block_t* GdbJITBlockAddLine(gdbjit_block_t* block, GDB_CORE_ADDR addr, const char* line) +{ + if (!block || !block->file) return NULL; + + block->nlines++; + block = GdbJITMakeRoom(block); + block->lines[block->nlines-1].pc = addr; + block->lines[block->nlines-1].line = block->nlines; + fprintf(block->file, "%s\n", line); + return block; +} + +void GdbJITBlockCleanup(gdbjit_block_t* block) { + if (block && block->file) { + fclose(block->file); + block->file = NULL; + } +} + +void GdbJITBlockReady(gdbjit_block_t* block) +{ + if (!block) return; + + if (block->nlines == 0) return; + + gdbjit_code_entry_t* entry = (gdbjit_code_entry_t*)box_malloc(sizeof(gdbjit_code_entry_t)); + if (!entry) return; + + entry->symfile_addr = (const char*)block; + entry->symfile_size = sizeof(gdbjit_block_t) + block->nlines * sizeof(struct gdb_line_mapping); + + if (__jit_debug_descriptor.first_entry) { + __jit_debug_descriptor.relevant_entry->next_entry = entry; + entry->prev_entry = __jit_debug_descriptor.relevant_entry; + } else { + __jit_debug_descriptor.first_entry = entry; + } + + __jit_debug_descriptor.relevant_entry = entry; + __jit_debug_descriptor.action_flag = GDBJIT_REGISTER; + __jit_debug_register_code(); +} +#endif diff --git a/src/tools/gtkclass.c b/src/tools/gtkclass.c index 34d1803..b88e884 100644 --- a/src/tools/gtkclass.c +++ b/src/tools/gtkclass.c @@ -6,18 +6,106 @@ #include "wrappedlibs.h" -#include "debug.h" -#include "wrapper.h" #include "bridge.h" +#include "alternate.h" +#include "debug.h" #include "callback.h" -#include "box64context.h" #include "librarian.h" #include "gtkclass.h" #include "library.h" -#include "custommem.h" -#include "khash.h" -int is_gtk3 = 0; +// This file takes ages to compile, and yet wrapper.h changed pretty often, remove +// the dependency and declare the functions and macros here to prevent the recompilation as much as possible. +// #include "wrapper.h" +/* +To generate this content again, you can use the following Python code: + +import re +file_path = 'path/to/box64/src/tools/gtkclass.c' +with open(file_path, 'r') as file: + content = file.read() +pattern = r' ([a-zA-Z]F[a-zA-Z]+)' +matches = re.findall(pattern, content) +unique_sorted_matches = sorted(set(matches)) +for match in unique_sorted_matches: + print(f'void {match}(x64emu_t *emu, uintptr_t fnc);') +*/ + +void UFp(x64emu_t* emu, uintptr_t fnc); +void iFL(x64emu_t* emu, uintptr_t fnc); +void iFp(x64emu_t* emu, uintptr_t fnc); +void iFpUU(x64emu_t* emu, uintptr_t fnc); +void iFpUup(x64emu_t* emu, uintptr_t fnc); +void iFpi(x64emu_t* emu, uintptr_t fnc); +void iFpii(x64emu_t* emu, uintptr_t fnc); +void iFpiii(x64emu_t* emu, uintptr_t fnc); +void iFpiiip(x64emu_t* emu, uintptr_t fnc); +void iFpip(x64emu_t* emu, uintptr_t fnc); +void iFpipLpp(x64emu_t* emu, uintptr_t fnc); +void iFpippp(x64emu_t* emu, uintptr_t fnc); +void iFpp(x64emu_t* emu, uintptr_t fnc); +void iFppLp(x64emu_t* emu, uintptr_t fnc); +void iFppU(x64emu_t* emu, uintptr_t fnc); +void iFppUup(x64emu_t* emu, uintptr_t fnc); +void iFppdd(x64emu_t* emu, uintptr_t fnc); +void iFppi(x64emu_t* emu, uintptr_t fnc); +void iFppii(x64emu_t* emu, uintptr_t fnc); +void iFppiiu(x64emu_t* emu, uintptr_t fnc); +void iFppp(x64emu_t* emu, uintptr_t fnc); +void iFpppi(x64emu_t* emu, uintptr_t fnc); +void iFpppp(x64emu_t* emu, uintptr_t fnc); +void iFppppp(x64emu_t* emu, uintptr_t fnc); +void iFpu(x64emu_t* emu, uintptr_t fnc); +void iFpupp(x64emu_t* emu, uintptr_t fnc); +void iFppppi(x64emu_t* emu, uintptr_t fnc); +void iFppppppi(x64emu_t* emu, uintptr_t fnc); +void pFL(x64emu_t* emu, uintptr_t fnc); +void pFLup(x64emu_t* emu, uintptr_t fnc); +void pFp(x64emu_t* emu, uintptr_t fnc); +void pFpLi(x64emu_t* emu, uintptr_t fnc); +void pFpLp(x64emu_t* emu, uintptr_t fnc); +void pFpi(x64emu_t* emu, uintptr_t fnc); +void pFpipp(x64emu_t* emu, uintptr_t fnc); +void pFpll(x64emu_t* emu, uintptr_t fnc); +void pFpp(x64emu_t* emu, uintptr_t fnc); +void pFppL(x64emu_t* emu, uintptr_t fnc); +void pFppp(x64emu_t* emu, uintptr_t fnc); +void pFppii(x64emu_t* emu, uintptr_t fnc); +void pFpppp(x64emu_t* emu, uintptr_t fnc); +void pFppppp(x64emu_t* emu, uintptr_t fnc); +void pFpppppp(x64emu_t* emu, uintptr_t fnc); +void pFppppppi(x64emu_t* emu, uintptr_t fnc); +void pFv(x64emu_t* emu, uintptr_t fnc); +void uFpp(x64emu_t* emu, uintptr_t fnc); +void vFLp(x64emu_t* emu, uintptr_t fnc); +void vFLup(x64emu_t* emu, uintptr_t fnc); +void vFp(x64emu_t* emu, uintptr_t fnc); +void vFpdd(x64emu_t* emu, uintptr_t fnc); +void vFpi(x64emu_t* emu, uintptr_t fnc); +void vFpii(x64emu_t* emu, uintptr_t fnc); +void vFpiii(x64emu_t* emu, uintptr_t fnc); +void vFpip(x64emu_t* emu, uintptr_t fnc); +void vFpipp(x64emu_t* emu, uintptr_t fnc); +void vFpipppp(x64emu_t* emu, uintptr_t fnc); +void vFpp(x64emu_t* emu, uintptr_t fnc); +void vFppdd(x64emu_t* emu, uintptr_t fnc); +void vFppi(x64emu_t* emu, uintptr_t fnc); +void vFppiipuu(x64emu_t* emu, uintptr_t fnc); +void vFppip(x64emu_t* emu, uintptr_t fnc); +void vFppp(x64emu_t* emu, uintptr_t fnc); +void vFpppp(x64emu_t* emu, uintptr_t fnc); +void vFppppp(x64emu_t* emu, uintptr_t fnc); +void vFpppppp(x64emu_t* emu, uintptr_t fnc); +void vFpppuu(x64emu_t* emu, uintptr_t fnc); +void vFppu(x64emu_t* emu, uintptr_t fnc); +void vFppupp(x64emu_t* emu, uintptr_t fnc); +void vFppuu(x64emu_t* emu, uintptr_t fnc); +void vFpu(x64emu_t* emu, uintptr_t fnc); +void vFpup(x64emu_t* emu, uintptr_t fnc); +void vFpupp(x64emu_t* emu, uintptr_t fnc); +void vFu(x64emu_t* emu, uintptr_t fnc); +void vFppppppp(x64emu_t* emu, uintptr_t fnc); +void vFppppppi(x64emu_t* emu, uintptr_t fnc); static bridge_t* my_bridge = NULL; static const char* (*g_type_name)(size_t) = NULL; @@ -60,21 +148,21 @@ static RET my_##NAME##_##A DEF \ } #define FIND(A, NAME) \ -static void* find_##NAME##_##A(void* fct) \ -{ \ - if(!fct) return fct; \ - void* tmp = GetNativeFnc((uintptr_t)fct); \ - if(tmp) return tmp; \ - if(my_##NAME##_##A##_fct_0 == (uintptr_t)fct) return my_##NAME##_##A##_0; \ - if(my_##NAME##_##A##_fct_1 == (uintptr_t)fct) return my_##NAME##_##A##_1; \ - if(my_##NAME##_##A##_fct_2 == (uintptr_t)fct) return my_##NAME##_##A##_2; \ - if(my_##NAME##_##A##_fct_3 == (uintptr_t)fct) return my_##NAME##_##A##_3; \ - if(my_##NAME##_##A##_fct_4 == (uintptr_t)fct) return my_##NAME##_##A##_4; \ - if(my_##NAME##_##A##_fct_5 == (uintptr_t)fct) return my_##NAME##_##A##_5; \ - if(my_##NAME##_##A##_fct_6 == (uintptr_t)fct) return my_##NAME##_##A##_6; \ - if(my_##NAME##_##A##_fct_7 == (uintptr_t)fct) return my_##NAME##_##A##_7; \ - if(my_##NAME##_##A##_fct_8 == (uintptr_t)fct) return my_##NAME##_##A##_8; \ - if(my_##NAME##_##A##_fct_9 == (uintptr_t)fct) return my_##NAME##_##A##_9; \ +static void* find_##NAME##_##A(wrapper_t W, void* fct) \ +{ \ + if(!fct) return fct; \ + void* tmp = GetNativeFnc((uintptr_t)fct); \ + if(tmp) {AddAutomaticBridge(my_bridge, W, fct, 0, #NAME "_" #A); return tmp;} \ + if(my_##NAME##_##A##_fct_0 == (uintptr_t)fct) return my_##NAME##_##A##_0; \ + if(my_##NAME##_##A##_fct_1 == (uintptr_t)fct) return my_##NAME##_##A##_1; \ + if(my_##NAME##_##A##_fct_2 == (uintptr_t)fct) return my_##NAME##_##A##_2; \ + if(my_##NAME##_##A##_fct_3 == (uintptr_t)fct) return my_##NAME##_##A##_3; \ + if(my_##NAME##_##A##_fct_4 == (uintptr_t)fct) return my_##NAME##_##A##_4; \ + if(my_##NAME##_##A##_fct_5 == (uintptr_t)fct) return my_##NAME##_##A##_5; \ + if(my_##NAME##_##A##_fct_6 == (uintptr_t)fct) return my_##NAME##_##A##_6; \ + if(my_##NAME##_##A##_fct_7 == (uintptr_t)fct) return my_##NAME##_##A##_7; \ + if(my_##NAME##_##A##_fct_8 == (uintptr_t)fct) return my_##NAME##_##A##_8; \ + if(my_##NAME##_##A##_fct_9 == (uintptr_t)fct) return my_##NAME##_##A##_9; \ if(my_##NAME##_##A##_fct_10 == (uintptr_t)fct) return my_##NAME##_##A##_10; \ if(my_##NAME##_##A##_fct_11 == (uintptr_t)fct) return my_##NAME##_##A##_11; \ if(my_##NAME##_##A##_fct_12 == (uintptr_t)fct) return my_##NAME##_##A##_12; \ @@ -105,46 +193,46 @@ static void* find_##NAME##_##A(void* fct) \ if(my_##NAME##_##A##_fct_37 == (uintptr_t)fct) return my_##NAME##_##A##_37; \ if(my_##NAME##_##A##_fct_38 == (uintptr_t)fct) return my_##NAME##_##A##_38; \ if(my_##NAME##_##A##_fct_39 == (uintptr_t)fct) return my_##NAME##_##A##_39; \ - if(my_##NAME##_##A##_fct_0 == 0) {my_##NAME##_##A##_fct_0 = (uintptr_t)fct; return my_##NAME##_##A##_0; } \ - if(my_##NAME##_##A##_fct_1 == 0) {my_##NAME##_##A##_fct_1 = (uintptr_t)fct; return my_##NAME##_##A##_1; } \ - if(my_##NAME##_##A##_fct_2 == 0) {my_##NAME##_##A##_fct_2 = (uintptr_t)fct; return my_##NAME##_##A##_2; } \ - if(my_##NAME##_##A##_fct_3 == 0) {my_##NAME##_##A##_fct_3 = (uintptr_t)fct; return my_##NAME##_##A##_3; } \ - if(my_##NAME##_##A##_fct_4 == 0) {my_##NAME##_##A##_fct_4 = (uintptr_t)fct; return my_##NAME##_##A##_4; } \ - if(my_##NAME##_##A##_fct_5 == 0) {my_##NAME##_##A##_fct_5 = (uintptr_t)fct; return my_##NAME##_##A##_5; } \ - if(my_##NAME##_##A##_fct_6 == 0) {my_##NAME##_##A##_fct_6 = (uintptr_t)fct; return my_##NAME##_##A##_6; } \ - if(my_##NAME##_##A##_fct_7 == 0) {my_##NAME##_##A##_fct_7 = (uintptr_t)fct; return my_##NAME##_##A##_7; } \ - if(my_##NAME##_##A##_fct_8 == 0) {my_##NAME##_##A##_fct_8 = (uintptr_t)fct; return my_##NAME##_##A##_8; } \ - if(my_##NAME##_##A##_fct_9 == 0) {my_##NAME##_##A##_fct_9 = (uintptr_t)fct; return my_##NAME##_##A##_9; } \ - if(my_##NAME##_##A##_fct_10 == 0) {my_##NAME##_##A##_fct_10 = (uintptr_t)fct; return my_##NAME##_##A##_10; } \ - if(my_##NAME##_##A##_fct_11 == 0) {my_##NAME##_##A##_fct_11 = (uintptr_t)fct; return my_##NAME##_##A##_11; } \ - if(my_##NAME##_##A##_fct_12 == 0) {my_##NAME##_##A##_fct_12 = (uintptr_t)fct; return my_##NAME##_##A##_12; } \ - if(my_##NAME##_##A##_fct_13 == 0) {my_##NAME##_##A##_fct_13 = (uintptr_t)fct; return my_##NAME##_##A##_13; } \ - if(my_##NAME##_##A##_fct_14 == 0) {my_##NAME##_##A##_fct_14 = (uintptr_t)fct; return my_##NAME##_##A##_14; } \ - if(my_##NAME##_##A##_fct_15 == 0) {my_##NAME##_##A##_fct_15 = (uintptr_t)fct; return my_##NAME##_##A##_15; } \ - if(my_##NAME##_##A##_fct_16 == 0) {my_##NAME##_##A##_fct_16 = (uintptr_t)fct; return my_##NAME##_##A##_16; } \ - if(my_##NAME##_##A##_fct_17 == 0) {my_##NAME##_##A##_fct_17 = (uintptr_t)fct; return my_##NAME##_##A##_17; } \ - if(my_##NAME##_##A##_fct_18 == 0) {my_##NAME##_##A##_fct_18 = (uintptr_t)fct; return my_##NAME##_##A##_18; } \ - if(my_##NAME##_##A##_fct_19 == 0) {my_##NAME##_##A##_fct_19 = (uintptr_t)fct; return my_##NAME##_##A##_19; } \ - if(my_##NAME##_##A##_fct_20 == 0) {my_##NAME##_##A##_fct_20 = (uintptr_t)fct; return my_##NAME##_##A##_20; } \ - if(my_##NAME##_##A##_fct_21 == 0) {my_##NAME##_##A##_fct_21 = (uintptr_t)fct; return my_##NAME##_##A##_21; } \ - if(my_##NAME##_##A##_fct_22 == 0) {my_##NAME##_##A##_fct_22 = (uintptr_t)fct; return my_##NAME##_##A##_22; } \ - if(my_##NAME##_##A##_fct_23 == 0) {my_##NAME##_##A##_fct_23 = (uintptr_t)fct; return my_##NAME##_##A##_23; } \ - if(my_##NAME##_##A##_fct_24 == 0) {my_##NAME##_##A##_fct_24 = (uintptr_t)fct; return my_##NAME##_##A##_24; } \ - if(my_##NAME##_##A##_fct_25 == 0) {my_##NAME##_##A##_fct_25 = (uintptr_t)fct; return my_##NAME##_##A##_25; } \ - if(my_##NAME##_##A##_fct_26 == 0) {my_##NAME##_##A##_fct_26 = (uintptr_t)fct; return my_##NAME##_##A##_26; } \ - if(my_##NAME##_##A##_fct_27 == 0) {my_##NAME##_##A##_fct_27 = (uintptr_t)fct; return my_##NAME##_##A##_27; } \ - if(my_##NAME##_##A##_fct_28 == 0) {my_##NAME##_##A##_fct_28 = (uintptr_t)fct; return my_##NAME##_##A##_28; } \ - if(my_##NAME##_##A##_fct_29 == 0) {my_##NAME##_##A##_fct_29 = (uintptr_t)fct; return my_##NAME##_##A##_29; } \ - if(my_##NAME##_##A##_fct_30 == 0) {my_##NAME##_##A##_fct_30 = (uintptr_t)fct; return my_##NAME##_##A##_30; } \ - if(my_##NAME##_##A##_fct_31 == 0) {my_##NAME##_##A##_fct_31 = (uintptr_t)fct; return my_##NAME##_##A##_31; } \ - if(my_##NAME##_##A##_fct_32 == 0) {my_##NAME##_##A##_fct_32 = (uintptr_t)fct; return my_##NAME##_##A##_32; } \ - if(my_##NAME##_##A##_fct_33 == 0) {my_##NAME##_##A##_fct_33 = (uintptr_t)fct; return my_##NAME##_##A##_33; } \ - if(my_##NAME##_##A##_fct_34 == 0) {my_##NAME##_##A##_fct_34 = (uintptr_t)fct; return my_##NAME##_##A##_34; } \ - if(my_##NAME##_##A##_fct_35 == 0) {my_##NAME##_##A##_fct_35 = (uintptr_t)fct; return my_##NAME##_##A##_35; } \ - if(my_##NAME##_##A##_fct_36 == 0) {my_##NAME##_##A##_fct_36 = (uintptr_t)fct; return my_##NAME##_##A##_36; } \ - if(my_##NAME##_##A##_fct_37 == 0) {my_##NAME##_##A##_fct_37 = (uintptr_t)fct; return my_##NAME##_##A##_37; } \ - if(my_##NAME##_##A##_fct_38 == 0) {my_##NAME##_##A##_fct_38 = (uintptr_t)fct; return my_##NAME##_##A##_38; } \ - if(my_##NAME##_##A##_fct_39 == 0) {my_##NAME##_##A##_fct_39 = (uintptr_t)fct; return my_##NAME##_##A##_39; } \ + if(my_##NAME##_##A##_fct_0 == 0) {my_##NAME##_##A##_fct_0 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_0, fct); return my_##NAME##_##A##_0; } \ + if(my_##NAME##_##A##_fct_1 == 0) {my_##NAME##_##A##_fct_1 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_1, fct); return my_##NAME##_##A##_1; } \ + if(my_##NAME##_##A##_fct_2 == 0) {my_##NAME##_##A##_fct_2 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_2, fct); return my_##NAME##_##A##_2; } \ + if(my_##NAME##_##A##_fct_3 == 0) {my_##NAME##_##A##_fct_3 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_3, fct); return my_##NAME##_##A##_3; } \ + if(my_##NAME##_##A##_fct_4 == 0) {my_##NAME##_##A##_fct_4 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_4, fct); return my_##NAME##_##A##_4; } \ + if(my_##NAME##_##A##_fct_5 == 0) {my_##NAME##_##A##_fct_5 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_5, fct); return my_##NAME##_##A##_5; } \ + if(my_##NAME##_##A##_fct_6 == 0) {my_##NAME##_##A##_fct_6 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_6, fct); return my_##NAME##_##A##_6; } \ + if(my_##NAME##_##A##_fct_7 == 0) {my_##NAME##_##A##_fct_7 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_7, fct); return my_##NAME##_##A##_7; } \ + if(my_##NAME##_##A##_fct_8 == 0) {my_##NAME##_##A##_fct_8 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_8, fct); return my_##NAME##_##A##_8; } \ + if(my_##NAME##_##A##_fct_9 == 0) {my_##NAME##_##A##_fct_9 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_9, fct); return my_##NAME##_##A##_9; } \ + if(my_##NAME##_##A##_fct_10 == 0) {my_##NAME##_##A##_fct_10 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_10, fct); return my_##NAME##_##A##_10; } \ + if(my_##NAME##_##A##_fct_11 == 0) {my_##NAME##_##A##_fct_11 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_11, fct); return my_##NAME##_##A##_11; } \ + if(my_##NAME##_##A##_fct_12 == 0) {my_##NAME##_##A##_fct_12 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_12, fct); return my_##NAME##_##A##_12; } \ + if(my_##NAME##_##A##_fct_13 == 0) {my_##NAME##_##A##_fct_13 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_13, fct); return my_##NAME##_##A##_13; } \ + if(my_##NAME##_##A##_fct_14 == 0) {my_##NAME##_##A##_fct_14 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_14, fct); return my_##NAME##_##A##_14; } \ + if(my_##NAME##_##A##_fct_15 == 0) {my_##NAME##_##A##_fct_15 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_15, fct); return my_##NAME##_##A##_15; } \ + if(my_##NAME##_##A##_fct_16 == 0) {my_##NAME##_##A##_fct_16 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_16, fct); return my_##NAME##_##A##_16; } \ + if(my_##NAME##_##A##_fct_17 == 0) {my_##NAME##_##A##_fct_17 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_17, fct); return my_##NAME##_##A##_17; } \ + if(my_##NAME##_##A##_fct_18 == 0) {my_##NAME##_##A##_fct_18 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_18, fct); return my_##NAME##_##A##_18; } \ + if(my_##NAME##_##A##_fct_19 == 0) {my_##NAME##_##A##_fct_19 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_19, fct); return my_##NAME##_##A##_19; } \ + if(my_##NAME##_##A##_fct_20 == 0) {my_##NAME##_##A##_fct_20 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_20, fct); return my_##NAME##_##A##_20; } \ + if(my_##NAME##_##A##_fct_21 == 0) {my_##NAME##_##A##_fct_21 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_21, fct); return my_##NAME##_##A##_21; } \ + if(my_##NAME##_##A##_fct_22 == 0) {my_##NAME##_##A##_fct_22 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_22, fct); return my_##NAME##_##A##_22; } \ + if(my_##NAME##_##A##_fct_23 == 0) {my_##NAME##_##A##_fct_23 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_23, fct); return my_##NAME##_##A##_23; } \ + if(my_##NAME##_##A##_fct_24 == 0) {my_##NAME##_##A##_fct_24 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_24, fct); return my_##NAME##_##A##_24; } \ + if(my_##NAME##_##A##_fct_25 == 0) {my_##NAME##_##A##_fct_25 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_25, fct); return my_##NAME##_##A##_25; } \ + if(my_##NAME##_##A##_fct_26 == 0) {my_##NAME##_##A##_fct_26 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_26, fct); return my_##NAME##_##A##_26; } \ + if(my_##NAME##_##A##_fct_27 == 0) {my_##NAME##_##A##_fct_27 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_27, fct); return my_##NAME##_##A##_27; } \ + if(my_##NAME##_##A##_fct_28 == 0) {my_##NAME##_##A##_fct_28 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_28, fct); return my_##NAME##_##A##_28; } \ + if(my_##NAME##_##A##_fct_29 == 0) {my_##NAME##_##A##_fct_29 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_29, fct); return my_##NAME##_##A##_29; } \ + if(my_##NAME##_##A##_fct_30 == 0) {my_##NAME##_##A##_fct_30 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_30, fct); return my_##NAME##_##A##_30; } \ + if(my_##NAME##_##A##_fct_31 == 0) {my_##NAME##_##A##_fct_31 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_31, fct); return my_##NAME##_##A##_31; } \ + if(my_##NAME##_##A##_fct_32 == 0) {my_##NAME##_##A##_fct_32 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_32, fct); return my_##NAME##_##A##_32; } \ + if(my_##NAME##_##A##_fct_33 == 0) {my_##NAME##_##A##_fct_33 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_33, fct); return my_##NAME##_##A##_33; } \ + if(my_##NAME##_##A##_fct_34 == 0) {my_##NAME##_##A##_fct_34 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_34, fct); return my_##NAME##_##A##_34; } \ + if(my_##NAME##_##A##_fct_35 == 0) {my_##NAME##_##A##_fct_35 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_35, fct); return my_##NAME##_##A##_35; } \ + if(my_##NAME##_##A##_fct_36 == 0) {my_##NAME##_##A##_fct_36 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_36, fct); return my_##NAME##_##A##_36; } \ + if(my_##NAME##_##A##_fct_37 == 0) {my_##NAME##_##A##_fct_37 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_37, fct); return my_##NAME##_##A##_37; } \ + if(my_##NAME##_##A##_fct_38 == 0) {my_##NAME##_##A##_fct_38 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_38, fct); return my_##NAME##_##A##_38; } \ + if(my_##NAME##_##A##_fct_39 == 0) {my_##NAME##_##A##_fct_39 = (uintptr_t)fct; addCheckAlternate((void*)my_##NAME##_##A##_fct_39, fct); return my_##NAME##_##A##_39; } \ printf_log(LOG_NONE, "Warning, no more slot for " #A " " #NAME " gtkclass callback\n"); \ return NULL; \ } @@ -285,7 +373,7 @@ static void wrapGObjectClass(my_GObjectClass_t* class) // unwrap (and use callback if not a native call anymore) static void unwrapGObjectClass(my_GObjectClass_t* class) { - #define GO(A, W) class->A = find_##A##_GObject (class->A) + #define GO(A, W) class->A = find_##A##_GObject (W, class->A) SUPERGO() #undef GO } @@ -338,7 +426,7 @@ static void wrapGInitiallyUnownedClass(my_GInitiallyUnownedClass_t* class) // unwrap (and use callback if not a native call anymore) static void unwrapGInitiallyUnownedClass(my_GInitiallyUnownedClass_t* class) { - #define GO(A, W) class->A = find_##A##_GInitiallyUnowned (class->A) + #define GO(A, W) class->A = find_##A##_GInitiallyUnowned (W, class->A) SUPERGO() #undef GO } @@ -406,7 +494,7 @@ static void wrapGApplicationClass(my_GApplicationClass_t* class) static void unwrapGApplicationClass(my_GApplicationClass_t* class) { unwrapGObjectClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GApplication (class->A) //SUPERGO() defined but not used + #define GO(A, W) class->A = find_##A##_GApplication (W, class->A) SUPERGO() #undef GO } @@ -452,7 +540,7 @@ static void wrapGtkApplicationClass(my_GtkApplicationClass_t* class) static void unwrapGtkApplicationClass(my_GtkApplicationClass_t* class) { unwrapGApplicationClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkApplication (class->A) + #define GO(A, W) class->A = find_##A##_GtkApplication (W, class->A) SUPERGO() #undef GO } @@ -499,7 +587,7 @@ static void wrapGtkObjectClass(my_GtkObjectClass_t* class) static void unwrapGtkObjectClass(my_GtkObjectClass_t* class) { unwrapGInitiallyUnownedClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkObject (class->A) + #define GO(A, W) class->A = find_##A##_GtkObject (W, class->A) SUPERGO() #undef GO } @@ -673,7 +761,7 @@ static void wrapGtkWidget2Class(my_GtkWidget2Class_t* class) static void unwrapGtkWidget2Class(my_GtkWidget2Class_t* class) { unwrapGtkObjectClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkWidget2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkWidget2 (W, class->A) SUPERGO() #undef GO } @@ -880,7 +968,7 @@ static void wrapGtkWidget3Class(my_GtkWidget3Class_t* class) static void unwrapGtkWidget3Class(my_GtkWidget3Class_t* class) { unwrapGInitiallyUnownedClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkWidget3 (class->A) + #define GO(A, W) class->A = find_##A##_GtkWidget3 (W, class->A) SUPERGO() #undef GO } @@ -940,7 +1028,7 @@ static void wrapGtkContainer2Class(my_GtkContainer2Class_t* class) static void unwrapGtkContainer2Class(my_GtkContainer2Class_t* class) { unwrapGtkWidget2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkContainer2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkContainer2 (W, class->A) SUPERGO() #undef GO } @@ -1002,7 +1090,7 @@ static void wrapGtkContainer3Class(my_GtkContainer3Class_t* class) static void unwrapGtkContainer3Class(my_GtkContainer3Class_t* class) { unwrapGtkWidget3Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkContainer3 (class->A) + #define GO(A, W) class->A = find_##A##_GtkContainer3 (W, class->A) SUPERGO() #undef GO } @@ -1056,7 +1144,7 @@ static void wrapGtkActionClass(my_GtkActionClass_t* class) static void unwrapGtkActionClass(my_GtkActionClass_t* class) { unwrapGObjectClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkAction (class->A) + #define GO(A, W) class->A = find_##A##_GtkAction (W, class->A) SUPERGO() #undef GO } @@ -1080,6 +1168,34 @@ static void bridgeGtkActionInstance(my_GtkAction_t* class) bridgeGObjectInstance(&class->parent); } +// ----- GtkDrawingArea3Class ------ + +// wrap (so bridge all calls, just in case) +static void wrapGtkDrawingArea3Class(my_GtkDrawingArea3Class_t* class) +{ + wrapGtkWidget3Class(&class->parent_class); +} +// unwrap (and use callback if not a native call anymore) +static void unwrapGtkDrawingArea3Class(my_GtkDrawingArea3Class_t* class) +{ + unwrapGtkWidget3Class(&class->parent_class); +} +// autobridge +static void bridgeGtkDrawingArea3Class(my_GtkDrawingArea3Class_t* class) +{ + bridgeGtkWidget3Class(&class->parent_class); +} + +static void unwrapGtkDrawingArea3Instance(my_GtkDrawingArea3_t* class) +{ + unwrapGtkWidget3Instance(&class->parent); +} +// autobridge +static void bridgeGtkDrawingArea3Instance(my_GtkDrawingArea3_t* class) +{ + bridgeGtkWidget3Instance(&class->parent); +} + // ----- GtkMisc2Class ------ // wrap (so bridge all calls, just in case) @@ -1107,6 +1223,7 @@ static void bridgeGtkMisc2Instance(my_GtkMisc2_t* class) { bridgeGtkWidget2Instance(&class->parent); } + // ----- GtkMisc3Class ------ // no wrapper x86 -> natives of callbacks @@ -1124,7 +1241,7 @@ static void wrapGtkMisc3Class(my_GtkMisc3Class_t* class) static void unwrapGtkMisc3Class(my_GtkMisc3Class_t* class) { unwrapGtkWidget3Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkMisc3 (class->A) + #define GO(A, W) class->A = find_##A##_GtkMisc3 (W, class->A) SUPERGO() #undef GO } @@ -1203,7 +1320,7 @@ static void wrapGtkLabel2Class(my_GtkLabel2Class_t* class) static void unwrapGtkLabel2Class(my_GtkLabel2Class_t* class) { unwrapGtkMisc2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkLabel2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkLabel2 (W, class->A) SUPERGO() #undef GO } @@ -1252,7 +1369,7 @@ static void wrapGtkLabel3Class(my_GtkLabel3Class_t* class) static void unwrapGtkLabel3Class(my_GtkLabel3Class_t* class) { unwrapGtkMisc3Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkLabel3 (class->A) + #define GO(A, W) class->A = find_##A##_GtkLabel3 (W, class->A) SUPERGO() #undef GO } @@ -1326,7 +1443,7 @@ static void wrapGtkTreeView2Class(my_GtkTreeView2Class_t* class) static void unwrapGtkTreeView2Class(my_GtkTreeView2Class_t* class) { unwrapGtkContainer2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkTreeView2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkTreeView2 (W, class->A) SUPERGO() #undef GO } @@ -1434,7 +1551,7 @@ static void wrapGtkWindow2Class(my_GtkWindow2Class_t* class) static void unwrapGtkWindow2Class(my_GtkWindow2Class_t* class) { unwrapGtkBin2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkWindow2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkWindow2 (W, class->A) SUPERGO() #undef GO } @@ -1487,7 +1604,7 @@ static void wrapGtkWindow3Class(my_GtkWindow3Class_t* class) static void unwrapGtkWindow3Class(my_GtkWindow3Class_t* class) { unwrapGtkBin3Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkWindow3 (class->A) + #define GO(A, W) class->A = find_##A##_GtkWindow3 (W, class->A) SUPERGO() #undef GO } @@ -1571,7 +1688,7 @@ static void wrapGtkListBoxClass(my_GtkListBoxClass_t* class) static void unwrapGtkListBoxClass(my_GtkListBoxClass_t* class) { unwrapGtkContainer3Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkListBoxClass (class->A) + #define GO(A, W) class->A = find_##A##_GtkListBoxClass (W, class->A) SUPERGO() #undef GO } @@ -1615,7 +1732,7 @@ static void wrapGtkListBoxRowClass(my_GtkListBoxRowClass_t* class) static void unwrapGtkListBoxRowClass(my_GtkListBoxRowClass_t* class) { unwrapGtkBin3Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkListBoxRowClass (class->A) + #define GO(A, W) class->A = find_##A##_GtkListBoxRowClass (W, class->A) SUPERGO() #undef GO } @@ -1749,6 +1866,159 @@ static void bridgeMetaFrames2Instance(my_MetaFrames2_t* class) { bridgeGtkWindow2Instance(&class->parent); } +// ----- GtkNotebook2Class ------ +WRAPPER(GtkNotebook2Class, switch_page, void, (void* notebook, void* page, uint32_t page_num), "ppp", notebook, page, page_num); +WRAPPER(GtkNotebook2Class, select_page, int, (void* notebook, int move_focus), "pi", notebook, move_focus); +WRAPPER(GtkNotebook2Class, focus_tab, int, (void* notebook, int type), "pi", notebook, type); +WRAPPER(GtkNotebook2Class, change_current_page, int, (void* notebook, int offset), "pi", notebook, offset); +WRAPPER(GtkNotebook2Class, move_focus_out,void , (void* notebook, int direction), "pi", notebook, direction); +WRAPPER(GtkNotebook2Class, reorder_tab, int, (void* notebook, int direction, int move_to_last), "pii", notebook, direction, move_to_last); +WRAPPER(GtkNotebook2Class, insert_page, int, (void* notebook, void* child, void* tab_label, void* menu_label, int position), "ppppi", notebook, child, tab_label, menu_label, position); +WRAPPER(GtkNotebook2Class, create_window, void*, (void* notebook, void* page, int x, int y), "ppii", notebook, page, x, y); + +#define SUPERGO() \ + GO(switch_page, vFppp); \ + GO(select_page, iFpi); \ + GO(focus_tab, iFpi); \ + GO(change_current_page, iFpi); \ + GO(move_focus_out, vFpi); \ + GO(reorder_tab, iFpii); \ + GO(insert_page, iFppppi); \ + GO(create_window, pFppii); \ + +// wrap (so bridge all calls, just in case) +static void wrapGtkNotebook2Class(my_GtkNotebook2Class_t* class) +{ + wrapGtkContainer2Class(&class->parent_class); + #define GO(A, W) class->A = reverse_##A##_GtkNotebook2Class (W, class->A) + SUPERGO() + #undef GO +} +// unwrap (and use callback if not a native call anymore) +static void unwrapGtkNotebook2Class(my_GtkNotebook2Class_t* class) +{ + unwrapGtkContainer2Class(&class->parent_class); + #define GO(A, W) class->A = find_##A##_GtkNotebook2Class (W, class->A) + SUPERGO() + #undef GO +} +// autobridge +static void bridgeGtkNotebook2Class(my_GtkNotebook2Class_t* class) +{ + bridgeGtkContainer2Class(&class->parent_class); + #define GO(A, W) autobridge_##A##_GtkNotebook2Class (W, class->A) + SUPERGO() + #undef GO +} + +#undef SUPERGO + +static void unwrapGtkNotebook2Instance(my_GtkNotebook2_t* class) +{ + unwrapGtkContainer2Instance(&class->parent); +} +// autobridge +static void bridgeGtkNotebook2Instance(my_GtkNotebook2_t* class) +{ + bridgeGtkContainer2Instance(&class->parent); +} + +// ----- GtkCellRenderer2Class ------ +WRAPPER(GtkCellRenderer2Class, get_size, void, (void* cell, void* widget, void* cell_area, int* x_offset, int* y_offset, int* width, int* height), "ppppppp", cell, widget, cell_area, x_offset, y_offset, width, height); +WRAPPER(GtkCellRenderer2Class, render, void, (void* cell, void* window, void* widget, void* background_area, void* cell_area, void* expose_area, int flags), "ppppppi", cell, window, widget, background_area, cell_area, expose_area, flags); +WRAPPER(GtkCellRenderer2Class, activate, int, (void* cell, void* event, void* widget, void* path, void* background_area, void* cell_area, int flags), "ppppppi", cell, event, widget, path, background_area, cell_area, flags); +WRAPPER(GtkCellRenderer2Class, start_editing, void*, (void* cell, void* event, void* widget, void* path, void* background_area, void* cell_area, int flags), "ppppppi", cell, event, widget, path, background_area, cell_area, flags); +WRAPPER(GtkCellRenderer2Class, editing_canceled, void, (void* cell), "p", cell); +WRAPPER(GtkCellRenderer2Class, editing_started, void, (void* cell, void* editable, void* path), "ppp", cell, editable, path); + +#define SUPERGO() \ + GO(get_size, vFppppppp); \ + GO(render, vFppppppi); \ + GO(activate, iFppppppi); \ + GO(start_editing, pFppppppi); \ + GO(editing_canceled, vFp); \ + GO(editing_started, vFppp); \ + +// wrap (so bridge all calls, just in case) +static void wrapGtkCellRenderer2Class(my_GtkCellRenderer2Class_t* class) +{ + wrapGtkObjectClass(&class->parent_class); + #define GO(A, W) class->A = reverse_##A##_GtkCellRenderer2Class (W, class->A) + SUPERGO() + #undef GO +} +// unwrap (and use callback if not a native call anymore) +static void unwrapGtkCellRenderer2Class(my_GtkCellRenderer2Class_t* class) +{ + unwrapGtkObjectClass(&class->parent_class); + #define GO(A, W) class->A = find_##A##_GtkCellRenderer2Class (W, class->A) + SUPERGO() + #undef GO +} +// autobridge +static void bridgeGtkCellRenderer2Class(my_GtkCellRenderer2Class_t* class) +{ + bridgeGtkObjectClass(&class->parent_class); + #define GO(A, W) autobridge_##A##_GtkCellRenderer2Class (W, class->A) + SUPERGO() + #undef GO +} + +#undef SUPERGO + +static void unwrapGtkCellRenderer2Instance(my_GtkCellRenderer2_t* class) +{ + unwrapGtkObjectInstance(&class->parent); +} +// autobridge +static void bridgeGtkCellRenderer2Instance(my_GtkCellRenderer2_t* class) +{ + bridgeGtkObjectInstance(&class->parent); +} + +// ----- GtkCellRendererText2Class ------ +WRAPPER(GtkCellRendererText2Class, edited, void, (void* cell_renderer_text, void* path, void* new_text), "ppp", cell_renderer_text, path, new_text); + +#define SUPERGO() \ + GO(edited, vFppp); \ + +// wrap (so bridge all calls, just in case) +static void wrapGtkCellRendererText2Class(my_GtkCellRendererText2Class_t* class) +{ + wrapGtkCellRenderer2Class(&class->parent_class); + #define GO(A, W) class->A = reverse_##A##_GtkCellRendererText2Class (W, class->A) + SUPERGO() + #undef GO +} +// unwrap (and use callback if not a native call anymore) +static void unwrapGtkCellRendererText2Class(my_GtkCellRendererText2Class_t* class) +{ + unwrapGtkCellRenderer2Class(&class->parent_class); + #define GO(A, W) class->A = find_##A##_GtkCellRendererText2Class (W, class->A) + SUPERGO() + #undef GO +} +// autobridge +static void bridgeGtkCellRendererText2Class(my_GtkCellRendererText2Class_t* class) +{ + bridgeGtkCellRenderer2Class(&class->parent_class); + #define GO(A, W) autobridge_##A##_GtkCellRendererText2Class (W, class->A) + SUPERGO() + #undef GO +} + +#undef SUPERGO + +static void unwrapGtkCellRendererText2Instance(my_GtkCellRendererText2_t* class) +{ + unwrapGtkCellRenderer2Instance(&class->parent); +} +// autobridge +static void bridgeGtkCellRendererText2Instance(my_GtkCellRendererText2_t* class) +{ + bridgeGtkCellRenderer2Instance(&class->parent); +} + // ----- GDBusObjectManagerClientClass ------ // wrapper x86 -> natives of callbacks WRAPPER(GDBusObjectManagerClient,interface_proxy_signal, void, (void* manager, void* object_proxy, void* interface_proxy, void* sender_name, void* signal_name, void* parameters), "pppppp", manager, object_proxy, interface_proxy, sender_name, signal_name, parameters); @@ -1771,7 +2041,7 @@ static void wrapGDBusObjectManagerClientClass(my_GDBusObjectManagerClientClass_t static void unwrapGDBusObjectManagerClientClass(my_GDBusObjectManagerClientClass_t* class) { unwrapGObjectClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GDBusObjectManagerClient (class->A) + #define GO(A, W) class->A = find_##A##_GDBusObjectManagerClient (W, class->A) SUPERGO() #undef GO } @@ -1796,6 +2066,59 @@ static void bridgeGDBusObjectManagerClientInstance(my_GDBusObjectManagerClient_t bridgeGObjectInstance(&class->parent); } +// ----- GDBusInterfaceSkeletonClass ------ +// wrapper x86 -> natives of callbacks +WRAPPER(GDBusInterfaceSkeleton,get_info, void*, (void* interface_), "p", interface_); +WRAPPER(GDBusInterfaceSkeleton,get_vtable, void*,(void* interface_), "p", interface_); +WRAPPER(GDBusInterfaceSkeleton,get_properties, void*, (void* interface_), "p", interface_); +WRAPPER(GDBusInterfaceSkeleton,flush, void, (void* interface_), "p", interface_); +WRAPPER(GDBusInterfaceSkeleton,g_authorize_method, int, (void* interface_, void* invocation), "pp", interface_, invocation); + +#define SUPERGO() \ + GO(get_info, pFp); \ + GO(get_vtable, pFp); \ + GO(get_properties, pFp); \ + GO(flush, vFp); \ + GO(g_authorize_method, iFpp); \ + + +// wrap (so bridge all calls, just in case) +static void wrapGDBusInterfaceSkeletonClass(my_GDBusInterfaceSkeletonClass_t* class) +{ + wrapGObjectClass(&class->parent); + #define GO(A, W) class->A = reverse_##A##_GDBusInterfaceSkeleton (W, class->A) + SUPERGO() + #undef GO +} +// unwrap (and use callback if not a native call anymore) +static void unwrapGDBusInterfaceSkeletonClass(my_GDBusInterfaceSkeletonClass_t* class) +{ + unwrapGObjectClass(&class->parent); + #define GO(A, W) class->A = find_##A##_GDBusInterfaceSkeleton (W, class->A) + SUPERGO() + #undef GO +} +// autobridge +static void bridgeGDBusInterfaceSkeletonClass(my_GDBusInterfaceSkeletonClass_t* class) +{ + bridgeGObjectClass(&class->parent); + #define GO(A, W) autobridge_##A##_GDBusInterfaceSkeleton (W, class->A) + SUPERGO() + #undef GO +} + +#undef SUPERGO + +static void unwrapGDBusInterfaceSkeletonInstance(my_GDBusInterfaceSkeleton_t* class) +{ + unwrapGObjectInstance(&class->parent); +} +// autobridge +static void bridgeGDBusInterfaceSkeletonInstance(my_GDBusInterfaceSkeleton_t* class) +{ + bridgeGObjectInstance(&class->parent); +} + // ----- GtkButton2Class ------ // wrapper x86 -> natives of callbacks WRAPPER(GtkButton2, pressed, void, (void* button), "p", button); @@ -1826,7 +2149,7 @@ static void wrapGtkButton2Class(my_GtkButton2Class_t* class) static void unwrapGtkButton2Class(my_GtkButton2Class_t* class) { unwrapGtkBin2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkButton2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkButton2 (W, class->A) SUPERGO() #undef GO } @@ -1881,7 +2204,7 @@ static void wrapGtkButton3Class(my_GtkButton3Class_t* class) static void unwrapGtkButton3Class(my_GtkButton3Class_t* class) { unwrapGtkBin3Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkButton3 (class->A) + #define GO(A, W) class->A = find_##A##_GtkButton3 (W, class->A) SUPERGO() #undef GO } @@ -1928,7 +2251,7 @@ static void wrapGtkComboBox2Class(my_GtkComboBox2Class_t* class) static void unwrapGtkComboBox2Class(my_GtkComboBox2Class_t* class) { unwrapGtkBin2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkComboBox2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkComboBox2 (W, class->A) SUPERGO() #undef GO } @@ -1973,7 +2296,7 @@ static void wrapGtkToggleButton2Class(my_GtkToggleButton2Class_t* class) static void unwrapGtkToggleButton2Class(my_GtkToggleButton2Class_t* class) { unwrapGtkButton2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkToggleButton2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkToggleButton2 (W, class->A) SUPERGO() #undef GO } @@ -2018,7 +2341,7 @@ static void wrapGtkToggleButton3Class(my_GtkToggleButton3Class_t* class) static void unwrapGtkToggleButton3Class(my_GtkToggleButton3Class_t* class) { unwrapGtkButton3Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkToggleButton3 (class->A) + #define GO(A, W) class->A = find_##A##_GtkToggleButton3 (W, class->A) SUPERGO() #undef GO } @@ -2063,7 +2386,7 @@ static void wrapGtkCheckButton2Class(my_GtkCheckButton2Class_t* class) static void unwrapGtkCheckButton2Class(my_GtkCheckButton2Class_t* class) { unwrapGtkToggleButton2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkCheckButton2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkCheckButton2 (W, class->A) SUPERGO() #undef GO } @@ -2108,7 +2431,7 @@ static void wrapGtkCheckButton3Class(my_GtkCheckButton3Class_t* class) static void unwrapGtkCheckButton3Class(my_GtkCheckButton3Class_t* class) { unwrapGtkToggleButton3Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkCheckButton3 (class->A) + #define GO(A, W) class->A = find_##A##_GtkCheckButton3 (W, class->A) SUPERGO() #undef GO } @@ -2149,7 +2472,7 @@ static void wrapGtkMenuButton3Class(my_GtkMenuButton3Class_t* class) static void unwrapGtkMenuButton3Class(my_GtkMenuButton3Class_t* class) { unwrapGtkToggleButton3Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkMenuButton3 (class->A) + #define GO(A, W) class->A = find_##A##_GtkMenuButton3 (W, class->A) SUPERGO() #undef GO } @@ -2211,7 +2534,7 @@ static void wrapGtkEntry2Class(my_GtkEntry2Class_t* class) static void unwrapGtkEntry2Class(my_GtkEntry2Class_t* class) { unwrapGtkWidget2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkEntry2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkEntry2 (W, class->A) SUPERGO() #undef GO } @@ -2263,7 +2586,7 @@ static void wrapGtkSpinButton2Class(my_GtkSpinButton2Class_t* class) static void unwrapGtkSpinButton2Class(my_GtkSpinButton2Class_t* class) { unwrapGtkEntry2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkSpinButton2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkSpinButton2 (W, class->A) SUPERGO() #undef GO } @@ -2311,7 +2634,7 @@ static void wrapGtkProgress2Class(my_GtkProgress2Class_t* class) static void unwrapGtkProgress2Class(my_GtkProgress2Class_t* class) { unwrapGtkWidget2Class(&class->parent); - #define GO(A, W) class->A = find_##A##_GtkProgress2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkProgress2 (W, class->A) SUPERGO() #undef GO } @@ -2353,7 +2676,7 @@ static void wrapGtkProgressBar2Class(my_GtkProgressBar2Class_t* class) static void unwrapGtkProgressBar2Class(my_GtkProgressBar2Class_t* class) { unwrapGtkProgress2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkProgressBar2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkProgressBar2 (W, class->A) SUPERGO() #undef GO } @@ -2397,7 +2720,7 @@ static void wrapGtkFrame2Class(my_GtkFrame2Class_t* class) static void unwrapGtkFrame2Class(my_GtkFrame2Class_t* class) { unwrapGtkBin2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkFrame2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkFrame2 (W, class->A) SUPERGO() #undef GO } @@ -2457,7 +2780,7 @@ static void wrapGtkMenuShell2Class(my_GtkMenuShell2Class_t* class) static void unwrapGtkMenuShell2Class(my_GtkMenuShell2Class_t* class) { unwrapGtkContainer2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkMenuShell2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkMenuShell2 (W, class->A) SUPERGO() #undef GO } @@ -2499,7 +2822,7 @@ static void wrapGtkMenuBar2Class(my_GtkMenuBar2Class_t* class) static void unwrapGtkMenuBar2Class(my_GtkMenuBar2Class_t* class) { unwrapGtkMenuShell2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkMenuBar2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkMenuBar2 (W, class->A) SUPERGO() #undef GO } @@ -2567,7 +2890,7 @@ static void wrapGtkTextView2Class(my_GtkTextView2Class_t* class) static void unwrapGtkTextView2Class(my_GtkTextView2Class_t* class) { unwrapGtkContainer2Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkTextView2 (class->A) + #define GO(A, W) class->A = find_##A##_GtkTextView2 (W, class->A) SUPERGO() #undef GO } @@ -2637,7 +2960,7 @@ static void wrapGtkTextView3Class(my_GtkTextView3Class_t* class) static void unwrapGtkTextView3Class(my_GtkTextView3Class_t* class) { unwrapGtkContainer3Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkTextView3 (class->A) + #define GO(A, W) class->A = find_##A##_GtkTextView3 (W, class->A) SUPERGO() #undef GO } @@ -2679,7 +3002,7 @@ static void wrapGtkGrid3Class(my_GtkGrid3Class_t* class) static void unwrapGtkGrid3Class(my_GtkGrid3Class_t* class) { unwrapGtkContainer3Class(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkGrid3 (class->A) + #define GO(A, W) class->A = find_##A##_GtkGrid3 (W, class->A) SUPERGO() #undef GO } @@ -2733,7 +3056,7 @@ static void wrapGtkEventControllerClass(my_GtkEventControllerClass_t* class) static void unwrapGtkEventControllerClass(my_GtkEventControllerClass_t* class) { unwrapGObjectClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkEventController (class->A) + #define GO(A, W) class->A = find_##A##_GtkEventController (W, class->A) SUPERGO() #undef GO } @@ -2787,7 +3110,7 @@ static void wrapGtkGestureClass(my_GtkGestureClass_t* class) static void unwrapGtkGestureClass(my_GtkGestureClass_t* class) { unwrapGtkEventControllerClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkGesture (class->A) + #define GO(A, W) class->A = find_##A##_GtkGesture (W, class->A) SUPERGO() #undef GO } @@ -2859,7 +3182,7 @@ static void wrapGtkGestureLongPressClass(my_GtkGestureLongPressClass_t* class) static void unwrapGtkGestureLongPressClass(my_GtkGestureLongPressClass_t* class) { unwrapGtkGestureSingleClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GtkGestureLongPress (class->A) + #define GO(A, W) class->A = find_##A##_GtkGestureLongPress (W, class->A) SUPERGO() #undef GO } @@ -2953,7 +3276,7 @@ static void wrapAtkObjectClass(my_AtkObjectClass_t* class) static void unwrapAtkObjectClass(my_AtkObjectClass_t* class) { unwrapGObjectClass(&class->parent); - #define GO(A, W) class->A = find_##A##_AtkObject (class->A) + #define GO(A, W) class->A = find_##A##_AtkObject (W, class->A) SUPERGO() #undef GO } @@ -3009,7 +3332,7 @@ static void wrapAtkUtilClass(my_AtkUtilClass_t* class) static void unwrapAtkUtilClass(my_AtkUtilClass_t* class) { unwrapGObjectClass(&class->parent); - #define GO(A, W) class->A = find_##A##_AtkUtil (class->A) + #define GO(A, W) class->A = find_##A##_AtkUtil (W, class->A) SUPERGO() #undef GO } @@ -3053,7 +3376,7 @@ static void wrapGstObjectClass(my_GstObjectClass_t* class) static void unwrapGstObjectClass(my_GstObjectClass_t* class) { unwrapGInitiallyUnownedClass(&class->parent); - #define GO(A, W) class->A = find_##A##_GstObject (class->A) + #define GO(A, W) class->A = find_##A##_GstObject (W, class->A) SUPERGO() #undef GO } @@ -3099,7 +3422,7 @@ static void wrapGstAllocatorClass(my_GstAllocatorClass_t* class) static void unwrapGstAllocatorClass(my_GstAllocatorClass_t* class) { unwrapGstObjectClass(&class->parent); - #define GO(A, W) class->A = find_##A##_GstAllocator (class->A) + #define GO(A, W) class->A = find_##A##_GstAllocator (W, class->A) SUPERGO() #undef GO } @@ -3134,7 +3457,7 @@ WRAPPER(GstAllocatorInstance, mem_unmap_full, void ,(void* mem, void* info), "pp static void unwrapGstAllocatorInstance(my_GstAllocator_t* class) { unwrapGstObjectInstance(&class->parent); - #define GO(A, W) class->A = find_##A##_GstAllocatorInstance (class->A) + #define GO(A, W) class->A = find_##A##_GstAllocatorInstance (W, class->A) SUPERGO() #undef GO } @@ -3175,7 +3498,7 @@ static void wrapGstTaskPoolClass(my_GstTaskPoolClass_t* class) static void unwrapGstTaskPoolClass(my_GstTaskPoolClass_t* class) { unwrapGstObjectClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstTaskPool (class->A) + #define GO(A, W) class->A = find_##A##_GstTaskPool (W, class->A) SUPERGO() #undef GO } @@ -3249,7 +3572,7 @@ static void wrapGstElementClass(my_GstElementClass_t* class) static void unwrapGstElementClass(my_GstElementClass_t* class) { unwrapGstObjectClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstElement (class->A) + #define GO(A, W) class->A = find_##A##_GstElement (W, class->A) SUPERGO() #undef GO } @@ -3308,7 +3631,7 @@ static void wrapGstBinClass(my_GstBinClass_t* class) static void unwrapGstBinClass(my_GstBinClass_t* class) { unwrapGstElementClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstBin (class->A) + #define GO(A, W) class->A = find_##A##_GstBin (W, class->A) SUPERGO() #undef GO } @@ -3394,7 +3717,7 @@ static void wrapGstBaseTransformClass(my_GstBaseTransformClass_t* class) static void unwrapGstBaseTransformClass(my_GstBaseTransformClass_t* class) { unwrapGstElementClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstBaseTransform (class->A) + #define GO(A, W) class->A = find_##A##_GstBaseTransform (W, class->A) SUPERGO() #undef GO } @@ -3477,7 +3800,7 @@ static void wrapGstVideoDecoderClass(my_GstVideoDecoderClass_t* class) static void unwrapGstVideoDecoderClass(my_GstVideoDecoderClass_t* class) { unwrapGstElementClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstVideoDecoder (class->A) + #define GO(A, W) class->A = find_##A##_GstVideoDecoder (W, class->A) SUPERGO() #undef GO } @@ -3556,7 +3879,7 @@ static void wrapGstVideoEncoderClass(my_GstVideoEncoderClass_t* class) static void unwrapGstVideoEncoderClass(my_GstVideoEncoderClass_t* class) { unwrapGstElementClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstVideoEncoder (class->A) + #define GO(A, W) class->A = find_##A##_GstVideoEncoder (W, class->A) SUPERGO() #undef GO } @@ -3633,7 +3956,7 @@ static void wrapGstBaseSinkClass(my_GstBaseSinkClass_t* class) static void unwrapGstBaseSinkClass(my_GstBaseSinkClass_t* class) { unwrapGstElementClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstBaseSink (class->A) + #define GO(A, W) class->A = find_##A##_GstBaseSink (W, class->A) SUPERGO() #undef GO } @@ -3677,7 +4000,7 @@ static void wrapGstVideoSinkClass(my_GstVideoSinkClass_t* class) static void unwrapGstVideoSinkClass(my_GstVideoSinkClass_t* class) { unwrapGstBaseSinkClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstVideoSink (class->A) + #define GO(A, W) class->A = find_##A##_GstVideoSink (W, class->A) SUPERGO() #undef GO } @@ -3723,7 +4046,7 @@ static void wrapGstGLBaseFilterClass(my_GstGLBaseFilterClass_t* class) static void unwrapGstGLBaseFilterClass(my_GstGLBaseFilterClass_t* class) { unwrapGstBaseTransformClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstGLBaseFilter (class->A) + #define GO(A, W) class->A = find_##A##_GstGLBaseFilter (W, class->A) SUPERGO() #undef GO } @@ -3773,7 +4096,7 @@ static void wrapGstGLFilterClass(my_GstGLFilterClass_t* class) static void unwrapGstGLFilterClass(my_GstGLFilterClass_t* class) { unwrapGstGLBaseFilterClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstGLFilter (class->A) + #define GO(A, W) class->A = find_##A##_GstGLFilter (W, class->A) SUPERGO() #undef GO } @@ -3859,7 +4182,7 @@ static void wrapGstAggregatorClass(my_GstAggregatorClass_t* class) static void unwrapGstAggregatorClass(my_GstAggregatorClass_t* class) { unwrapGstElementClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstAggregator (class->A) + #define GO(A, W) class->A = find_##A##_GstAggregator (W, class->A) SUPERGO() #undef GO } @@ -3907,7 +4230,7 @@ static void wrapGstVideoAggregatorClass(my_GstVideoAggregatorClass_t* class) static void unwrapGstVideoAggregatorClass(my_GstVideoAggregatorClass_t* class) { unwrapGstAggregatorClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstVideoAggregator (class->A) + #define GO(A, W) class->A = find_##A##_GstVideoAggregator (W, class->A) SUPERGO() #undef GO } @@ -3951,7 +4274,7 @@ static void wrapGstPadClass(my_GstPadClass_t* class) static void unwrapGstPadClass(my_GstPadClass_t* class) { unwrapGstObjectClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstPad (class->A) + #define GO(A, W) class->A = find_##A##_GstPad (W, class->A) SUPERGO() #undef GO } @@ -4014,8 +4337,8 @@ WRAPPER(GstPadInstance, eventfullfunc, int , (void* pad, void* parent, void* static void unwrapGstPadInstance(my_GstPad_t* class) { unwrapGstObjectInstance(&class->parent); - #define GO(A, W) class->A = find_##A##_GstPadInstance (class->A) - #define GO2(B, A, W) class->B.A = find_##A##_GstPadInstance (class->B.A) + #define GO(A, W) class->A = find_##A##_GstPadInstance (W, class->A) + #define GO2(B, A, W) class->B.A = find_##A##_GstPadInstance (W, class->B.A) SUPERGO() #undef GO2 #undef GO @@ -4052,7 +4375,7 @@ static void wrapGstAggregatorPadClass(my_GstAggregatorPadClass_t* class) static void unwrapGstAggregatorPadClass(my_GstAggregatorPadClass_t* class) { unwrapGstPadClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstAggregatorPad (class->A) + #define GO(A, W) class->A = find_##A##_GstAggregatorPad (W, class->A) SUPERGO() #undef GO } @@ -4102,7 +4425,7 @@ static void wrapGstVideoAggregatorPadClass(my_GstVideoAggregatorPadClass_t* clas static void unwrapGstVideoAggregatorPadClass(my_GstVideoAggregatorPadClass_t* class) { unwrapGstAggregatorPadClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstVideoAggregatorPad (class->A) + #define GO(A, W) class->A = find_##A##_GstVideoAggregatorPad (W, class->A) SUPERGO() #undef GO } @@ -4181,7 +4504,7 @@ static void wrapGstBaseSrcClass(my_GstBaseSrcClass_t* class) static void unwrapGstBaseSrcClass(my_GstBaseSrcClass_t* class) { unwrapGstElementClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstBaseSrc (class->A) + #define GO(A, W) class->A = find_##A##_GstBaseSrc (W, class->A) SUPERGO() #undef GO } @@ -4227,7 +4550,7 @@ static void wrapGstPushSrcClass(my_GstPushSrcClass_t* class) static void unwrapGstPushSrcClass(my_GstPushSrcClass_t* class) { unwrapGstBaseSrcClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstPushSrc (class->A) + #define GO(A, W) class->A = find_##A##_GstPushSrc (W, class->A) SUPERGO() #undef GO } @@ -4273,7 +4596,7 @@ static void wrapGstGLBaseSrcClass(my_GstGLBaseSrcClass_t* class) static void unwrapGstGLBaseSrcClass(my_GstGLBaseSrcClass_t* class) { unwrapGstPushSrcClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstGLBaseSrc (class->A) + #define GO(A, W) class->A = find_##A##_GstGLBaseSrc (W, class->A) SUPERGO() #undef GO } @@ -4349,7 +4672,7 @@ static void wrapGstAudioDecoderClass(my_GstAudioDecoderClass_t* class) static void unwrapGstAudioDecoderClass(my_GstAudioDecoderClass_t* class) { unwrapGstElementClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstAudioDecoder (class->A) + #define GO(A, W) class->A = find_##A##_GstAudioDecoder (W, class->A) SUPERGO() #undef GO } @@ -4395,7 +4718,7 @@ static void wrapGstVideoFilterClass(my_GstVideoFilterClass_t* class) static void unwrapGstVideoFilterClass(my_GstVideoFilterClass_t* class) { unwrapGstBaseTransformClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstVideoFilter (class->A) + #define GO(A, W) class->A = find_##A##_GstVideoFilter (W, class->A) SUPERGO() #undef GO } @@ -4437,7 +4760,7 @@ static void wrapGstAudioFilterClass(my_GstAudioFilterClass_t* class) static void unwrapGstAudioFilterClass(my_GstAudioFilterClass_t* class) { unwrapGstBaseTransformClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GstAudioFilter (class->A) + #define GO(A, W) class->A = find_##A##_GstAudioFilter (W, class->A) SUPERGO() #undef GO } @@ -4460,6 +4783,108 @@ static void bridgeGstAudioFilterInstance(my_GstAudioFilter_t* class) { bridgeGstBaseTransformInstance(&class->parent); } +// ----- GstBufferPoolClass ------ +// wrapper x86 -> natives of callbacks +WRAPPER(GstBufferPool, get_options, void*,(void* pool), "p", pool); +WRAPPER(GstBufferPool, set_config, int ,(void* pool, void* config), "pp", pool, config); +WRAPPER(GstBufferPool, start, int ,(void* pool), "p", pool); +WRAPPER(GstBufferPool, stop, int ,(void* pool), "p", pool); +WRAPPER(GstBufferPool, acquire_buffer, int ,(void* pool, void* buffer, void* params), "ppp", pool, buffer, params); +WRAPPER(GstBufferPool, alloc_buffer, int ,(void* pool, void* buffer, void* params), "ppp", pool, buffer, params); +WRAPPER(GstBufferPool, reset_buffer, void ,(void* pool, void* buffer), "pp", pool, buffer); +WRAPPER(GstBufferPool, release_buffer, void ,(void* pool, void* buffer), "pp", pool, buffer); +WRAPPER(GstBufferPool, free_buffer, void ,(void* pool, void* buffer), "pp", pool, buffer); +WRAPPER(GstBufferPool, flush_start, void ,(void* pool), "p", pool); +WRAPPER(GstBufferPool, flush_stop, void ,(void* pool), "p", pool); + +#define SUPERGO() \ + GO(get_options, pFp); \ + GO(set_config, iFpp); \ + GO(start, iFp); \ + GO(stop, iFp); \ + GO(acquire_buffer, iFppp); \ + GO(alloc_buffer, iFppp); \ + GO(reset_buffer, vFpp); \ + GO(release_buffer, vFpp); \ + GO(free_buffer, vFpp); \ + GO(flush_start, vFp); \ + GO(flush_stop, vFp); \ + +// wrap (so bridge all calls, just in case) +static void wrapGstBufferPoolClass(my_GstBufferPoolClass_t* class) +{ + wrapGstObjectClass(&class->object_class); + #define GO(A, W) class->A = reverse_##A##_GstBufferPool (W, class->A) + SUPERGO() + #undef GO +} +// unwrap (and use callback if not a native call anymore) +static void unwrapGstBufferPoolClass(my_GstBufferPoolClass_t* class) +{ + unwrapGstObjectClass(&class->object_class); + #define GO(A, W) class->A = find_##A##_GstBufferPool (W, class->A) + SUPERGO() + #undef GO +} +// autobridge +static void bridgeGstBufferPoolClass(my_GstBufferPoolClass_t* class) +{ + bridgeGstObjectClass(&class->object_class); + #define GO(A, W) autobridge_##A##_GstBufferPool (W, class->A) + SUPERGO() + #undef GO +} +#undef SUPERGO + +static void unwrapGstBufferPoolInstance(my_GstBufferPool_t* class) +{ + unwrapGstObjectInstance(&class->object); +} +// autobridge +static void bridgeGstBufferPoolInstance(my_GstBufferPool_t* class) +{ + bridgeGstObjectInstance(&class->object); +} +// ----- GstVideoBufferPoolClass ------ +// wrapper x86 -> natives of callbacks + +#define SUPERGO() \ + +// wrap (so bridge all calls, just in case) +static void wrapGstVideoBufferPoolClass(my_GstVideoBufferPoolClass_t* class) +{ + wrapGstBufferPoolClass(&class->parent); + #define GO(A, W) class->A = reverse_##A##_GstVideoBufferPool (W, class->A) + SUPERGO() + #undef GO +} +// unwrap (and use callback if not a native call anymore) +static void unwrapGstVideoBufferPoolClass(my_GstVideoBufferPoolClass_t* class) +{ + unwrapGstBufferPoolClass(&class->parent); + #define GO(A, W) class->A = find_##A##_GstVideoBufferPool (W, class->A) + SUPERGO() + #undef GO +} +// autobridge +static void bridgeGstVideoBufferPoolClass(my_GstVideoBufferPoolClass_t* class) +{ + bridgeGstBufferPoolClass(&class->parent); + #define GO(A, W) autobridge_##A##_GstBufferPool (W, class->A) + SUPERGO() + #undef GO +} +#undef SUPERGO + +static void unwrapGstVideoBufferPoolInstance(my_GstVideoBufferPool_t* class) +{ + unwrapGstBufferPoolInstance(&class->bufferpool); +} +// autobridge +static void bridgeGstVideoBufferPoolInstance(my_GstVideoBufferPool_t* class) +{ + bridgeGstBufferPoolInstance(&class->bufferpool); +} // ----- GDBusProxyClass ------ // wrapper x86 -> natives of callbacks WRAPPER(GDBusProxy, g_properties_changed, void, (void* proxy, void* changed_properties, const char* const* invalidated_properties), "ppp", proxy, changed_properties, invalidated_properties); @@ -4481,7 +4906,7 @@ static void wrapGDBusProxyClass(my_GDBusProxyClass_t* class) static void unwrapGDBusProxyClass(my_GDBusProxyClass_t* class) { unwrapGObjectClass(&class->parent_class); - #define GO(A, W) class->A = find_##A##_GDBusProxy (class->A) + #define GO(A, W) class->A = find_##A##_GDBusProxy (W, class->A) SUPERGO() #undef GO } @@ -4530,7 +4955,7 @@ static void wrapGstURIHandlerInterface(my_GstURIHandlerInterface_t* iface) static void unwrapGstURIHandlerInterface(my_GstURIHandlerInterface_t* iface) { // parent don't need wrazpping - #define GO(A, W) iface->A = find_##A##_GstURIHandler (iface->A) + #define GO(A, W) iface->A = find_##A##_GstURIHandler (W, iface->A) SUPERGO() #undef GO } @@ -4573,7 +4998,7 @@ int checkRegisteredClass(size_t klass) } // g_type_class_peek_parent -static void wrapGTKClass(void* cl, size_t type) +void wrapGTKClass(void* cl, size_t type) { #define GTKIFACE(A) #define GTKCLASS(A) \ @@ -4583,7 +5008,7 @@ static void wrapGTKClass(void* cl, size_t type) printf_log(LOG_DEBUG, "wrapGTKClass(%p, %zd (%s))\n", cl, type, g_type_name(type)); GTKCLASSES() - if(type==8) {} // GInterface have no structure + if(type<0x35) {} // GInterface (8) and other simple opbjects have no structure else { if(my_MetaFrames2==(size_t)-1 && !strcmp(g_type_name(type), "MetaFrames")) { my_MetaFrames2 = type; @@ -4595,7 +5020,7 @@ static void wrapGTKClass(void* cl, size_t type) #undef GTKIFACE } -static void unwrapGTKClass(void* cl, size_t type) +void unwrapGTKClass(void* cl, size_t type) { #define GTKIFACE(A) #define GTKCLASS(A) \ @@ -4603,11 +5028,11 @@ static void unwrapGTKClass(void* cl, size_t type) unwrap##A##Class((my_##A##Class_t*)cl); \ else - printf_log(LOG_DEBUG, "unwrapGTKClass(%p, %zd (%s))\n", cl, type, g_type_name(type)); + printf_log(LOG_DEBUG, "...unwrapGTKClass(%p, %zd (%s))\n", cl, type, g_type_name(type)); GTKCLASSES() - if(type==8) {} // GInterface have no structure + if(type<0x35) {} // GInterface (8) and other simple opbjects have no structure else - {} // else no warning, one is enough... + printf_log(LOG_NONE, "Warning: fail to unwrapGTKClass for type %zx (%s)\n", type, g_type_name(type)); #undef GTKCLASS #undef GTKIFACE } @@ -4622,9 +5047,9 @@ static void bridgeGTKClass(void* cl, size_t type) printf_log(LOG_DEBUG, "bridgeGTKClass(%p, %zd (%s))\n", cl, type, g_type_name(type)); GTKCLASSES() - if(type==8) {} // GInterface have no structure + if(type<0x35) {} // GInterface (8) and other simple opbjects have no structure else { - printf_log(LOG_NONE, "Warning, AutoBridge GTK Class with unknown class type 0w%zx (%s)\n", type, g_type_name(type)); + printf_log(LOG_NONE, "Warning, AutoBridge GTK Class with unknown class type 0x%zx (%s)\n", type, g_type_name(type)); } #undef GTKCLASS #undef GTKIFACE @@ -4640,7 +5065,7 @@ static void wrapGTKInterface(void* cl, size_t type) printf_log(LOG_DEBUG, "wrapGTKInterface(%p, %zd (%s))\n", cl, type, g_type_name(type)); GTKCLASSES() - if(type==8) {} // GInterface have no structure + if(type<0x35) {} // GInterface (8) and other simple opbjects have no structure else { printf_log(LOG_NONE, "Warning, Custom Interface initializer with unknown class type 0x%zx (%s)\n", type, g_type_name(type)); } @@ -4658,7 +5083,7 @@ void unwrapGTKInterface(void* cl, size_t type) printf_log(LOG_DEBUG, "unwrapGTKInterface(%p, %zd (%s))\n", cl, type, g_type_name(type)); GTKCLASSES() - if(type==8) {} // GInterface have no structure + if(type<0x35) {} // GInterface (8) and other simple opbjects have no structure else {} // else no warning, one is enough... #undef GTKIFACE @@ -4675,7 +5100,7 @@ static void bridgeGTKInterface(void* cl, size_t type) printf_log(LOG_DEBUG, "bridgeGTKInterface(%p, %zd (%s))\n", cl, type, g_type_name(type)); GTKCLASSES() - if(type==8) {} // GInterface have no structure + if(type<0x35) {} // GInterface (8) and other simple opbjects have no structure else { printf_log(LOG_NONE, "Warning, AutoBridge GTK Interface with unknown class type 0x%zx (%s)\n", type, g_type_name(type)); } @@ -4693,7 +5118,7 @@ void unwrapGTKInstance(void* cl, size_t type) printf_log(LOG_DEBUG, "unwrapGTKInstance(%p, %zd (%s))\n", cl, type, g_type_name(type)); GTKCLASSES() - if(type==8) {} // GInterface have no structure + if(type<0x35) {} // GInterface (8) and other simple opbjects have no structure else {} // else no warning, one is enough... #undef GTKCLASS @@ -4710,7 +5135,7 @@ void bridgeGTKInstance(void* cl, size_t type) printf_log(LOG_DEBUG, "bridgeGTKInstance(%p, %zd (%s))\n", cl, type, g_type_name(type)); GTKCLASSES() - if(type==8) {} // GInterface have no structure + if(type<0x35) {} // GInterface (8) and other simple opbjects have no structure else { printf_log(LOG_NONE, "Warning, AutoBridge GTK Class with unknown class type 0w%zx (%s)\n", type, g_type_name(type)); } @@ -4746,7 +5171,7 @@ void* unwrapCopyGTKClass(void* klass, size_t type) #define GTKIFACE(A) #define GTKCLASS(A) if(type==my_##A) sz = sizeof(my_##A##Class_t); else GTKCLASSES() - if(type==8) {} // GInterface have no structure + if(type<0x35) {} // GInterface (8) and other simple opbjects have no structure else { printf_log(LOG_NONE, "Warning, unwrapCopyGTKClass called with unknown class type 0x%zx (%s)\n", type, g_type_name(type)); return klass; @@ -4779,7 +5204,7 @@ void* unwrapCopyGTKInterface(void* iface, size_t type) #define GTKIFACE(A) if(type==my_##A) sz = sizeof(my_##A##Interface_t); else #define GTKCLASS(A) GTKCLASSES() - if(type==8) {} // GInterface have no structure + if(type<0x35) {} // GInterface (8) and other simple opbjects have no structure else { printf_log(LOG_NONE, "Warning, unwrapCopyGTKInterface called with unknown class type 0x%zx (%s)\n", type, g_type_name(type)); return iface; @@ -4801,39 +5226,12 @@ void* unwrapCopyGTKInterface(void* iface, size_t type) // gtk_type_class -#define GO(A) \ -static void* my_gclassallu_ref_##A = NULL; \ -static my_GClassAll_t my_gclassallu_##A; - -SUPER() -#undef GO void* wrapCopyGTKClass(void* klass, size_t type) { if(!klass) return klass; while(checkRegisteredClass(type)) type = g_type_parent(type); printf_log(LOG_DEBUG, "wrapCopyGTKClass(%p, %zd (%s))\n", klass, type, g_type_name(type)); - #define GO(A) if(klass == my_gclassallu_ref_##A) return &my_gclassallu_##A; - SUPER() - #undef GO - // check if class is the exact type we know - int sz = 0; - #define GTKIFACE(A) - #define GTKCLASS(A) if(type==my_##A) sz = sizeof(my_##A##Class_t); else - GTKCLASSES() - if(type==8) {} // GInterface have no structure - else { - if(my_MetaFrames2==(size_t)-1 && !strcmp(g_type_name(type), "MetaFrames")) { - my_MetaFrames2 = type; - sz = sizeof(my_MetaFrames2Class_t); - } else { - printf_log(LOG_NONE, "Warning, wrapCopyGTKClass called with unknown class type 0x%zx (%s)\n", type, g_type_name(type)); - return klass; - } - } - #undef GTKIFACE - #undef GTKCLASS - (void)sz; bridgeGTKClass(klass, type); return klass; } @@ -4844,27 +5242,6 @@ void* wrapCopyGTKInterface(void* iface, size_t type) while(checkRegisteredClass(type)) type = g_type_parent(type); printf_log(LOG_DEBUG, "wrapCopyGTKInterface(%p, %zd (%s))\n", iface, type, g_type_name(type)); - #define GO(A) if(iface == my_gclassallu_ref_##A) return &my_gclassallu_##A; - SUPER() - #undef GO - // check if class is the exact type we know - int sz = 0; - #define GTKIFACE(A) if(type==my_##A) sz = sizeof(my_##A##Interface_t); else - #define GTKCLASS(A) - GTKCLASSES() - if(type==8) {} // GInterface have no structure - else { - if(my_MetaFrames2==(size_t)-1 && !strcmp(g_type_name(type), "MetaFrames")) { - my_MetaFrames2 = type; - sz = sizeof(my_MetaFrames2Class_t); - } else { - printf_log(LOG_NONE, "Warning, wrapCopyGTKInterface called with unknown class type 0x%zx (%s)\n", type, g_type_name(type)); - return iface; - } - } - #undef GTKIFACE - #undef GTKCLASS - (void)sz; bridgeGTKInterface(iface, type); return iface; } @@ -5166,10 +5543,90 @@ static void* find_signal7_Fct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for GTypeInfo signal7 callback\n"); return NULL; } -static const wrapper_t wrappers[] = {pFpp, pFppp, pFpppp, pFpppp, pFppppp, pFpppppp}; +// signal8 ... +#define GO(A) \ + static uintptr_t my_signal8_fct_##A = 0; \ + static void* my_signal8_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g) \ + { \ + return (void*)RunFunctionFmt(my_signal8_fct_##A, "ppppppp", a, b, c, d, e, f, g); \ + } +SUPER() +#undef GO +static void* find_signal8_Fct(void* fct) +{ + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_signal8_fct_##A == (uintptr_t)fct) return my_signal8_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_signal8_fct_##A == 0) { \ + my_signal8_fct_##A = (uintptr_t)fct; \ + return my_signal8_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for GTypeInfo signal8 callback\n"); + return NULL; +} +// signal9 ... +#define GO(A) \ + static uintptr_t my_signal9_fct_##A = 0; \ + static void* my_signal9_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g) \ + { \ + return (void*)RunFunctionFmt(my_signal9_fct_##A, "ppppppp", a, b, c, d, e, f, g); \ + } +SUPER() +#undef GO +static void* find_signal9_Fct(void* fct) +{ + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_signal9_fct_##A == (uintptr_t)fct) return my_signal9_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_signal9_fct_##A == 0) { \ + my_signal9_fct_##A = (uintptr_t)fct; \ + return my_signal9_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for GTypeInfo signal9 callback\n"); + return NULL; +} +// signal10 ... +#define GO(A) \ + static uintptr_t my_signal10_fct_##A = 0; \ + static void* my_signal10_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g) \ + { \ + return (void*)RunFunctionFmt(my_signal10_fct_##A, "ppppppp", a, b, c, d, e, f, g); \ + } +SUPER() +#undef GO +static void* find_signal10_Fct(void* fct) +{ + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_signal10_fct_##A == (uintptr_t)fct) return my_signal10_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_signal10_fct_##A == 0) { \ + my_signal10_fct_##A = (uintptr_t)fct; \ + return my_signal10_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for GTypeInfo signal10 callback\n"); + return NULL; +} typedef void* (*finder_t)(void*); -static const finder_t finders[] = {find_signal2_Fct, find_signal3_Fct, find_signal4_Fct, find_signal5_Fct, find_signal6_Fct, find_signal7_Fct}; -#define MAX_SIGNAL_N 7 +static const finder_t finders[] = { find_signal2_Fct, find_signal3_Fct, find_signal4_Fct, find_signal5_Fct, find_signal6_Fct, find_signal7_Fct, find_signal8_Fct, find_signal9_Fct, find_signal10_Fct }; +#define MAX_SIGNAL_N (10 - 2) // ---- GTypeInfo ---- // let's handle signal with offset, that are used to wrap custom signal function @@ -5214,10 +5671,13 @@ void my_unwrap_signal_offset(void* klass) printf_log(LOG_DEBUG, "my_unwrap_signal_offset(%p) type=0x%zx with %d signals with offset\n", klass, itype, p->sz); for(int i=0; isz; ++i) { void** f = (void**)((uintptr_t)klass + p->a[i].offset); - if(!GetNativeFnc((uintptr_t)*f)) { + void* new_f = GetNativeFnc((uintptr_t)*f); + if(!new_f) { // Not a native function: autobridge it - void* new_f = finders[p->a[i].n-2](f); - printf_log(LOG_DEBUG, "Unwrapping %p -> %p (with alternate)\n", *f, new_f); + new_f = finders[p->a[i].n](f); + } + if(new_f != *f) { + printf_log(LOG_DEBUG, "Unwrapping %p[%p: offset=0x%x, n=%d] -> %p (with alternate)\n", *f, f, p->a[i].offset, p->a[i].n, new_f); if(!hasAlternate(new_f)) addAlternate(new_f, *f); *f = new_f; @@ -5284,23 +5744,21 @@ static size_t parent_class_init_##A = 0; \ static int my_class_init_##A(void* a, void* b) \ { \ printf_log(LOG_DEBUG, "Custom Class init %d for class %p (parent=%p:%s)\n", A, a, (void*)parent_class_init_##A, g_type_name(parent_class_init_##A));\ - int ret = RunFunctionFmt(my_class_init_fct_##A, "pp", a, b);\ + int ret = RunFunctionFmt(my_class_init_fct_##A, "pp", a, b); \ size_t type = parent_class_init_##A; \ while(checkRegisteredClass(type)) \ type = g_type_parent(type); \ unwrapGTKClass(a, type); \ - bridgeGTKClass(a, type); \ my_unwrap_signal_offset(a); \ if(!strcmp(g_type_name(type), "AtkUtil")) { \ - my_AtkUtilClass_t* p = (my_AtkUtilClass_t*)g_type_class_peek(type);\ + my_AtkUtilClass_t* p = (my_AtkUtilClass_t*)g_type_class_peek(type); \ unwrapGTKClass(p, type); \ - bridgeGTKClass(p, type); \ } \ return ret; \ } SUPER() #undef GO -static void* find_class_init_Fct(void* fct, size_t parent) +void* find_class_init_Fct(void* fct, size_t parent) { if(!fct) return fct; if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); @@ -5318,7 +5776,7 @@ static void* find_class_init_Fct(void* fct, size_t parent) static uintptr_t my_class_finalize_fct_##A = 0; \ static int my_class_finalize_##A(void* a, void* b) \ { \ - return RunFunctionFmt(my_class_finalize_fct_##A, "pp", a, b); \ + return RunFunctionFmt(my_class_finalize_fct_##A, "pp", a, b); \ } SUPER() #undef GO @@ -5404,23 +5862,22 @@ SUPER() #undef GO // Then the static functions callback that may be used with the structure #define GO(A) \ -static int fct_gtk_parent_##A = 0 ; \ -static uintptr_t fct_gtk_class_init_##A = 0; \ -static int my_gtk_class_init_##A(void* g_class) { \ +static int fct_gtk_parent_##A = 0 ; \ +static uintptr_t fct_gtk_class_init_##A = 0; \ +static int my_gtk_class_init_##A(void* g_class) { \ printf_log(LOG_DEBUG, "Calling fct_gtk_class_init_" #A " wrapper\n"); \ - int ret = (int)RunFunctionFmt(fct_gtk_class_init_##A, "p", g_class);\ + int ret = (int)RunFunctionFmt(fct_gtk_class_init_##A, "p", g_class); \ unwrapGTKClass(g_class, fct_gtk_parent_##A); \ - bridgeGTKClass(g_class, fct_gtk_parent_##A); \ return ret; \ -} \ -static uintptr_t fct_gtk_object_init_##A = 0; \ -static int my_gtk_object_init_##A(void* object, void* data) { \ - printf_log(LOG_DEBUG, "Calling fct_gtk_object_init_" #A " wrapper\n"); \ - return (int)RunFunctionFmt(fct_gtk_object_init_##A, "pp", object, data);\ -} \ -static uintptr_t fct_gtk_base_class_init_##A = 0; \ -static int my_gtk_base_class_init_##A(void* instance, void* data) { \ - printf_log(LOG_DEBUG, "Calling fct_gtk_base_class_init_" #A " wrapper\n"); \ +} \ +static uintptr_t fct_gtk_object_init_##A = 0; \ +static int my_gtk_object_init_##A(void* object, void* data) { \ + printf_log(LOG_DEBUG, "Calling fct_gtk_object_init_" #A " wrapper\n"); \ + return (int)RunFunctionFmt(fct_gtk_object_init_##A, "pp", object, data); \ +} \ +static uintptr_t fct_gtk_base_class_init_##A = 0; \ +static int my_gtk_base_class_init_##A(void* instance, void* data) { \ + printf_log(LOG_DEBUG, "Calling fct_gtk_base_class_init_" #A " wrapper\n"); \ return (int)RunFunctionFmt(fct_gtk_base_class_init_##A, "pp", instance, data); \ } @@ -5439,16 +5896,17 @@ my_GtkTypeInfo_t* findFreeGtkTypeInfo(my_GtkTypeInfo_t* fcts, size_t parent) my_gtktypeinfo_##A.type_name = fcts->type_name; \ my_gtktypeinfo_##A.object_size = fcts->object_size; \ my_gtktypeinfo_##A.class_size = fcts->class_size; \ - my_gtktypeinfo_##A.class_init_func = (fcts->class_init_func)?((GetNativeFnc((uintptr_t)fcts->class_init_func))?GetNativeFnc((uintptr_t)fcts->class_init_func):my_gtk_class_init_##A):NULL; \ + my_gtktypeinfo_##A.class_init_func = (fcts->class_init_func)?((GetNativeFnc((uintptr_t)fcts->class_init_func))?GetNativeFnc((uintptr_t)fcts->class_init_func):(void*)my_gtk_class_init_##A):NULL; \ fct_gtk_class_init_##A = (uintptr_t)fcts->class_init_func; \ - my_gtktypeinfo_##A.object_init_func = (fcts->object_init_func)?((GetNativeFnc((uintptr_t)fcts->object_init_func))?GetNativeFnc((uintptr_t)fcts->object_init_func):my_gtk_object_init_##A):NULL; \ + my_gtktypeinfo_##A.object_init_func = (fcts->object_init_func)?((GetNativeFnc((uintptr_t)fcts->object_init_func))?GetNativeFnc((uintptr_t)fcts->object_init_func):(void*)my_gtk_object_init_##A):NULL; \ fct_gtk_object_init_##A = (uintptr_t)fcts->object_init_func; \ my_gtktypeinfo_##A.reserved_1 = fcts->reserved_1; \ my_gtktypeinfo_##A.reserved_2 = fcts->reserved_2; \ - my_gtktypeinfo_##A.base_class_init_func = (fcts->base_class_init_func)?((GetNativeFnc((uintptr_t)fcts->base_class_init_func))?GetNativeFnc((uintptr_t)fcts->base_class_init_func):my_gtk_base_class_init_##A):NULL; \ + my_gtktypeinfo_##A.base_class_init_func = (fcts->base_class_init_func)?((GetNativeFnc((uintptr_t)fcts->base_class_init_func))?GetNativeFnc((uintptr_t)fcts->base_class_init_func):(void*)my_gtk_base_class_init_##A):NULL; \ fct_gtk_base_class_init_##A = (uintptr_t)fcts->base_class_init_func; \ return &my_gtktypeinfo_##A; \ } + SUPER() #undef GO printf_log(LOG_NONE, "Warning, no more slot for GtkTypeInfo callback\n"); @@ -5525,74 +5983,3 @@ void SetGTypeParent(void* f) g_type_parent = f; } -my_signal_t* new_mysignal(void* f, void* data, void* destroy) -{ - my_signal_t* sig = (my_signal_t*)box_calloc(1, sizeof(my_signal_t)); - sig->sign = SIGN; - sig->c_handler = (uintptr_t)f; - sig->destroy = (uintptr_t)destroy; - sig->data = data; - int ret; - kh_put(signalmap, my_signalmap, (uintptr_t)sig, &ret); - return sig; -} -void my_signal_delete(my_signal_t* sig) -{ - khint_t k = kh_get(signalmap, my_signalmap, (uintptr_t)sig); - if(k!=kh_end(my_signalmap)) { - kh_del(signalmap, my_signalmap, k); - } else { - printf_log(LOG_NONE, "Warning, my_signal_delete called with an unrefereced signal!\n"); - } - uintptr_t d = sig->destroy; - if(d) { - RunFunctionFmt(d, "p", sig->data); - } - printf_log(LOG_DEBUG, "gtk Data deleted, sig=%p, data=%p, destroy=%p\n", sig, sig->data, (void*)d); - box_free(sig); -} -int my_signal_is_valid(void* sig) -{ - khint_t k = kh_get(signalmap, my_signalmap, (uintptr_t)sig); - if(k!=kh_end(my_signalmap)) { - /*if(((my_signal_t*)c)->sign == SIGN) - return 1; - else - printf_log(LOG_NONE, "Warning, incohrent my_signal_t structure referenced\n");*/ - return 1; - } - return 0; -} - -int my_signal_cb(void* a, void* b, void* c, void* d) -{ - // signal can have many signature... so first job is to find the data! - // hopefully, no callback have more than 4 arguments... - my_signal_t* sig = NULL; - int i = 0; - if(my_signal_is_valid(a)) { - sig = (my_signal_t*)a; - i = 1; - } - if(!sig && my_signal_is_valid(b)) { - sig = (my_signal_t*)b; - i = 2; - } - if(!sig && my_signal_is_valid(c)) { - sig = (my_signal_t*)c; - i = 3; - } - if(!sig && my_signal_is_valid(d)) { - sig = (my_signal_t*)d; - i = 4; - } - printf_log(LOG_DEBUG, "gtk Signal called, sig=%p, NArgs=%d\n", sig, i); - switch(i) { - case 1: return (int)RunFunctionFmt(sig->c_handler, "p", sig->data); - case 2: return (int)RunFunctionFmt(sig->c_handler, "pp", a, sig->data); - case 3: return (int)RunFunctionFmt(sig->c_handler, "ppp", a, b, sig->data); - case 4: return (int)RunFunctionFmt(sig->c_handler, "pppp", a, b, c, sig->data); - } - printf_log(LOG_NONE, "Warning, Gtk signal callback but no data found!"); - return 0; -} diff --git a/src/tools/my_cpuid.c b/src/tools/my_cpuid.c deleted file mode 100644 index 48a163a..0000000 --- a/src/tools/my_cpuid.c +++ /dev/null @@ -1,533 +0,0 @@ -#define _GNU_SOURCE -#include -#include -#include -#include - -#include "my_cpuid.h" -#include "../emu/x64emu_private.h" -#include "debug.h" -#include "x64emu.h" - -int get_cpuMhz() -{ - int MHz = 0; - char *p = NULL; - if((p=getenv("BOX64_CPUMHZ"))) { - MHz = atoi(p); - return MHz; - } - char cpumhz[200]; - sprintf(cpumhz, "%d", MHz?:1000); - setenv("BOX64_CPUMHZ", cpumhz, 1); // set temp value incase box64 gets recursively called - - int cpucore = 0; - while(cpucore!=-1) { - char cpufreq[4096]; - sprintf(cpufreq, "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", cpucore); - FILE *f = fopen(cpufreq, "r"); - if(f) { - int r; - if(1==fscanf(f, "%d", &r)) { - r /= 1000; - if(MHz0) { - // worked! (unless it's saying "lscpu: command not found" or something like that) - if(!strstr(tmp, "lscpu")) { - // trim ending - while(strlen(tmp) && tmp[strlen(tmp)-1]=='\n') - tmp[strlen(tmp)-1] = 0; - // incase multiple cpu type are present, there will be multiple lines - while(strchr(tmp, '\n')) - *strchr(tmp,'\n') = ' '; - // cut the float part (so '.' or ','), it's not needed - if(strchr(tmp, '.')) - *strchr(tmp, '.')= '\0'; - if(strchr(tmp, ',')) - *strchr(tmp, ',')= '\0'; - int mhz; - if(sscanf(tmp, "%d", &mhz)==1) - MHz = mhz; - } - } - } - } - #endif - if(!MHz) - MHz = 1000; // default to 1Ghz... - sprintf(cpumhz, "%d", MHz); - setenv("BOX64_CPUMHZ", cpumhz, 1); // set actual value - return MHz; -} -static int nCPU = 0; -static double bogoMips = 100.; - -void grabNCpu() { - nCPU = 1; // default number of CPU to 1 - FILE *f = fopen("/proc/cpuinfo", "r"); - ssize_t dummy; - if(f) { - nCPU = 0; - int bogo = 0; - size_t len = 500; - char* line = malloc(len); - while ((dummy = getline(&line, &len, f)) != (ssize_t)-1) { - if(!strncmp(line, "processor\t", strlen("processor\t"))) - ++nCPU; - if(!bogo && !strncmp(line, "BogoMIPS\t", strlen("BogoMIPS\t"))) { - // grab 1st BogoMIPS - float tmp; - if(sscanf(line, "BogoMIPS\t: %g", &tmp)==1) { - bogoMips = tmp; - bogo = 1; - } - } - } - free(line); - fclose(f); - if(!nCPU) nCPU=1; - } -} -int getNCpu() -{ - if(!nCPU) - grabNCpu(); - if(box64_maxcpu && nCPU>box64_maxcpu) - return box64_maxcpu; - return nCPU; -} - -double getBogoMips() -{ - if(!nCPU) - grabNCpu(); - return bogoMips; -} - -const char* getCpuName() -{ - static char name[200] = "Unknown CPU"; - static int done = 0; - if(done) - return name; - done = 1; - char *p = NULL; - if((p=getenv("BOX64_CPUNAME"))) { - strcpy(name, p); - return name; - } - setenv("BOX64_CPUNAME", name, 1); // temporary set - #ifndef STATICBUILD - FILE* f = popen("lscpu | grep \"Model name:\" | sed -r 's/Model name:\\s{1,}//g'", "r"); - if(f) { - char tmp[200] = ""; - ssize_t s = fread(tmp, 1, 200, f); - pclose(f); - if(s>0) { - // worked! (unless it's saying "lscpu: command not found" or something like that) - if(!strstr(tmp, "lscpu")) { - // trim ending - while(strlen(tmp) && tmp[strlen(tmp)-1]=='\n') - tmp[strlen(tmp)-1] = 0; - // incase multiple cpu type are present, there will be multiple lines - while(strchr(tmp, '\n')) - *strchr(tmp,'\n') = ' '; - strncpy(name, tmp, 199); - } - setenv("BOX64_CPUNAME", name, 1); - return name; - } - } - // failled, try to get architecture at least - f = popen("lscpu | grep \"Architecture:\" | sed -r 's/Architecture:\\s{1,}//g'", "r"); - if(f) { - char tmp[200] = ""; - ssize_t s = fread(tmp, 1, 200, f); - pclose(f); - if(s>0) { - // worked! - // trim ending - while(strlen(tmp) && tmp[strlen(tmp)-1]=='\n') - tmp[strlen(tmp)-1] = 0; - // incase multiple cpu type are present, there will be multiple lines - while(strchr(tmp, '\n')) - *strchr(tmp,'\n') = ' '; - snprintf(name, 199, "unknown %s cpu", tmp); - setenv("BOX64_CPUNAME", name, 1); - return name; - } - } - #endif - // Nope, bye - return name; -} - -const char* getBoxCpuName() -{ - static char branding[3*4*4+1] = ""; - static int done = 0; - if(!done) { - done = 1; - const char* name = getCpuName(); - if(strstr(name, "MHz") || strstr(name, "GHz")) { - // name already have the speed in it - snprintf(branding, sizeof(branding), "Box64 on %.*s", 39, name); - } else { - unsigned int MHz = get_cpuMhz(); - if(MHz>1500) { // swiches to GHz display... - snprintf(branding, sizeof(branding), "Box64 on %.*s @%1.2f GHz", 28, name, MHz/1000.); - } else { - snprintf(branding, sizeof(branding), "Box64 on %.*s @%04d MHz", 28, name, MHz); - } - } - } - return branding; -} - -void my_cpuid(x64emu_t* emu, uint32_t tmp32u) -{ - emu->regs[_AX].dword[1] = emu->regs[_DX].dword[1] = emu->regs[_CX].dword[1] = emu->regs[_BX].dword[1] = 0; - int ncpu = getNCpu(); - if(!ncpu) ncpu = 1; - int ncluster = 1; - while(ncpu>64) { - ncluster++; // do cluster of 64 cpus... - if(ncpu>=128) - ncpu-=64; - else - ncpu=64; - } - static char branding[3*4*4+1] = ""; - if(!branding[0]) { - strcpy(branding, getBoxCpuName()); - while(strlen(branding)<3*4*4) { - memmove(branding+1, branding, strlen(branding)+1); - branding[0] = ' '; - } - } - switch(tmp32u) { - case 0x0: - // emulate a P4. TODO: Emulate a Core2? - R_EAX = 0x0000000f;//was 0x15 before, but something seems wrong for leaf 0x15, and cpu-z take that as pure cpu speed... - // return GenuineIntel - R_EBX = 0x756E6547; - R_EDX = 0x49656E69; - R_ECX = 0x6C65746E; - break; - case 0x1: - R_EAX = (0x1<<0) | // stepping - (0x6<<4) | // model - (0x6<<8) | // familly - (0x0<<12)| // Processor type - (0x0<<14)| // reserved - (0x4<<16)| // extended model - (0x0<<20)| // extended familly - - 0 ; // family and all, simulating Haswell type of cpu - R_EBX = 0 | (8<<0x8) | (ncluster<<16); // Brand index, CLFlush (8), Max APIC ID (16-23), Local APIC ID (24-31) - /*{ - int cpu = sched_getcpu(); - if(cpu<0) cpu=0; - R_EAX |= cpu<<24; - }*/ - R_EDX = 1 // fpu - | 1<<2 // debugging extension - | 1<<4 // rdtsc - | 1<<8 // cmpxchg8 - | 1<<11 // sep (sysenter & sysexit) - | 1<<15 // cmov - | 1<<19 // clflush (seems to be with SSE2) - | 1<<23 // mmx - | 1<<24 // fxsr (fxsave, fxrestore) - | 1<<25 // SSE - | 1<<26 // SSE2 - | 1<<28 // HT / Multi-core - ; - R_ECX = 1<<0 // SSE3 - | 1<<1 // PCLMULQDQ - | 1<<9 // SSSE3 - | box64_avx2<<12 // fma - | 1<<13 // cx16 (cmpxchg16) - | 1<<19 // SSE4_1 - | box64_sse42<<20 // SSE4_2 can be hiden - | 1<<22 // MOVBE - | 1<<23 // POPCOUNT - | 1<<25 // aesni - | box64_avx<<26 // xsave - | box64_avx<<27 // osxsave - | box64_avx<<28 // AVX - | box64_avx<<29 // F16C - | box64_avx2<<30 // RDRAND - ; - break; - case 0x2: // TLB and Cache info. Sending 1st gen P4 info... - R_EAX = 0x665B5001; - R_EBX = 0x00000000; - R_ECX = 0x00000000; - R_EDX = 0x007A7000; - break; - - case 0x4: // Cache info - switch (R_ECX) { - case 0: // L1 data cache - R_EAX = (1 | (1<<5) | (1<<8) | ((ncpu-1)<<26)); //type + (26-31):max cores per packages-1 - R_EBX = (63 | (7<<22)); // size - R_ECX = 63; - R_EDX = 1; - break; - case 1: // L1 inst cache - R_EAX = (2 | (1<<5) | (1<<8)); //type - R_EBX = (63 | (7<<22)); // size - R_ECX = 63; - R_EDX = 1; - break; - case 2: // L2 cache - R_EAX = (3 | (2<<5) | (1<<8)); //type - R_EBX = (63 | (15<<22)); // size - R_ECX = 4095; - R_EDX = 1; - break; - - default: - R_EAX = 0x00000000; - R_EBX = 0x00000000; - R_ECX = 0x00000000; - R_EDX = 0x00000000; - break; - } - break; - case 0x5: //mwait info - R_EAX = 0; - R_EBX = 0; - R_ECX = 1 | 2; - R_EDX = 0; - break; - case 0x3: // PSN - case 0x6: // thermal - case 0x8: // more extended capabilities - case 0x9: // direct cache access - case 0xA: // Architecture performance monitor - R_EAX = 0; - R_EBX = 0; - R_ECX = 0; - R_EDX = 0; - break; - case 0x7: // extended bits... - if(R_ECX==0) { - R_EAX = 0; - R_EBX = - box64_avx<<3 | // BMI1 - box64_avx2<<5 | //AVX2 - box64_avx2<<8 | //BMI2 - box64_avx2<<19 | //ADX - 1<<29| // SHA extension - 0; - R_RCX = - box64_avx<<9 | //VAES - box64_avx2<<10 | //VPCLMULQDQ. - 0; - R_RDX = 0; - - } else {R_EAX = R_ECX = R_EBX = R_EDX = 0;} - break; - case 0xB: // Extended Topology Enumeration Leaf - //TODO! - R_EAX = 0; - R_EBX = 0; - break; - case 0xC: //? - R_EAX = 0; - break; - case 0xD: // Processor Extended State Enumeration Main Leaf / Sub Leaf - switch(R_CX) { - case 0: - R_EAX = 0b111; // x87 SSE AVX saved - R_EBX = 512+64+16*16; // size of xsave/xrstor - R_ECX = 512+64+16*16; // same - R_EDX = 0; // more bits - break; - case 1: - R_EAX = 0; // XSAVEOPT (0) and XSAVEC (1), XGETBV with ECX=1 (2) XSAVES (3) and XFD (4) not supported yet - R_ECX = R_EBX = R_EDX = 0; - break; - case 2: - // componant 2: avx - R_EAX = 16*16; // size of the avx block - R_EBX = 512+64; // offset - R_ECX = 0; - R_EDX = 0; - break; - default: - R_EAX = R_ECX = R_EBX = R_EDX = 0; - break; - } - break; - case 0xE: //? - R_EAX = 0; - break; - case 0xF: //L3 Cache - switch(R_ECX) { - case 0: - R_EAX = 0; - R_EBX = 0; // maximum range of RMID of physical processor - R_ECX = 0; - R_EDX = 0; // bit 1 support L3 RDT Cache monitoring - break; - case 1: - R_EAX = 0; - R_EBX = 0; // Conversion factor - R_EDX = 0; // bit 0 = occupency monitoring - break; - default: R_EAX = 0; - } - break; - case 0x14: // Processor Trace Enumeration Main Leaf - switch(R_ECX) { - case 0: // main leaf - R_EAX = 0; // max sub-leaf - R_EBX = 0; - R_ECX = 0; - R_EDX = 0; - break; - default: R_EAX = 0; - } - break; - case 0x15: // TSC core frenquency - R_EAX = 1; // denominator - R_EBX = 1; // numerator - { - uint64_t freq = ReadTSCFrequency(emu); - while(freq>100000000) { - freq/=10; - R_EAX *= 10; - } - R_ECX = freq; // nominal frequency in Hz - } - R_EDX = 0; - break; - - case 0x80000000: // max extended - R_EAX = 0x80000005; // was 0x80000007 before, but L2 cache description 0x80000006 is not correct and make some AC games to assert about l2 cache value coherency... - break; - case 0x80000001: //Extended Processor Signature and Feature Bits - R_EAX = 0; // reserved - R_EBX = 0; // reserved - R_ECX = (1<<0) // LAHF_LM - | (1<<5) // LZCNT - | (1<<8) // PREFETCHW - ; - R_EDX = 1 // x87 FPU - | (1<<8) // cx8: cmpxchg8b opcode - | (1<<11) // syscall - | (1<<15) // cmov: FCMOV opcodes - | (1<<23) // mmx: MMX available - | (1<<24) // fxsave - | (1<<27) // rdtscp - | (1<<29); // long mode 64bits available - break; - case 0x80000002: // Brand part 1 (branding signature) - R_EAX = ((uint32_t*)branding)[0]; - R_EBX = ((uint32_t*)branding)[1]; - R_ECX = ((uint32_t*)branding)[2]; - R_EDX = ((uint32_t*)branding)[3]; - break; - case 0x80000003: // Brand part 2 - R_EAX = ((uint32_t*)branding)[4]; - R_EBX = ((uint32_t*)branding)[5]; - R_ECX = ((uint32_t*)branding)[6]; - R_EDX = ((uint32_t*)branding)[7]; - break; - case 0x80000004: // Brand part 3, with frequency - R_EAX = ((uint32_t*)branding)[8]; - R_EBX = ((uint32_t*)branding)[9]; - R_ECX = ((uint32_t*)branding)[10]; - R_EDX = ((uint32_t*)branding)[11]; - break; - case 0x80000005: - R_EAX = 0; - R_EBX = 0; - R_ECX = 0; - R_EDX = 0; - break; - case 0x80000006: // L2 cache line size and associativity - R_EAX = 0; - R_EBX = 0; - R_ECX = 64 | (0x6<<12) | (256<<16); // bits: 0-7 line size, 15-12: assoc (using special encoding), 31-16: size in K //TODO: read info from /sys/devices/system/cpu/cpuX/cache/index2 - R_EDX = 0; - break; - case 0x80000007: // Invariant TSC - R_EAX = 0; - R_EBX = 0; - R_ECX = 0; - R_EDX = 0 | (1<<8); // Invariant TSC - break; - default: - printf_log(LOG_INFO, "Warning, CPUID command %X unsupported (ECX=%08x)\n", tmp32u, R_ECX); - R_EAX = 0; - R_EBX = 0; - R_ECX = 0; - R_EDX = 0; - } -} - -uint32_t helper_getcpu(x64emu_t* emu) { - #if defined(__GLIBC__) && defined(__GLIBC_MINOR__) && !defined(ANDROID) - #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 28) - uint32_t cpu, node; - if(!getcpu(&cpu, &node)) - return (node&0xff)<<12 | (cpu&0xff); - #endif - #endif - return 0; -} - -uint32_t fallback_random32() -{ - return random() ^ (random()<<1); -} - -uint32_t get_random32() -{ - uint32_t ret; - FILE* f = fopen("/dev/urandom", "rb"); - if(f) { - if(fread(&ret, sizeof(ret), 1, f)!=1) - ret = fallback_random32(); - fclose(f); - } else - ret = fallback_random32(); - return ret; -} -uint64_t fallback_random64() -{ - return random() ^ (((uint64_t)random())<<18) ^ (((uint64_t)random())<<41); -} - -uint64_t get_random64() -{ - uint64_t ret; - FILE* f = fopen("/dev/urandom", "rb"); - if(f) { - if(fread(&ret, sizeof(ret), 1, f)!=1) - ret = fallback_random64(); - fclose(f); - } else - ret = fallback_random64(); - return ret; -} diff --git a/src/tools/pe_tools.c b/src/tools/pe_tools.c new file mode 100644 index 0000000..4d57faa --- /dev/null +++ b/src/tools/pe_tools.c @@ -0,0 +1,330 @@ +#include +#include +#include +#include +#include +#include + +#include "debug.h" +#include "khash.h" +#include "rbtree.h" + +typedef uint8_t BYTE; +typedef uint16_t WORD; +typedef uint32_t DWORD; +typedef int32_t LONG; +typedef uint32_t ULONG; +typedef uint64_t ULONGLONG; + +#define IMAGE_DOS_SIGNATURE 0x5A4D +#define IMAGE_NT_SIGNATURE 0x00004550 +#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 +#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10B +#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20B + +typedef struct _IMAGE_DOS_HEADER { + WORD e_magic; + WORD e_cblp; + WORD e_cp; + WORD e_crlc; + WORD e_cparhdr; + WORD e_minalloc; + WORD e_maxalloc; + WORD e_ss; + WORD e_sp; + WORD e_csum; + WORD e_ip; + WORD e_cs; + WORD e_lfarlc; + WORD e_ovno; + WORD e_res[4]; + WORD e_oemid; + WORD e_oeminfo; + WORD e_res2[10]; + LONG e_lfanew; +} IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER; + +typedef struct _IMAGE_FILE_HEADER { + WORD Machine; + WORD NumberOfSections; + DWORD TimeDateStamp; + DWORD PointerToSymbolTable; + DWORD NumberOfSymbols; + WORD SizeOfOptionalHeader; + WORD Characteristics; +} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; + +typedef struct _IMAGE_DATA_DIRECTORY { + DWORD VirtualAddress; + DWORD Size; +} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY; + +typedef struct _IMAGE_OPTIONAL_HEADER64 { + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + ULONGLONG ImageBase; + DWORD SectionAlignment; + DWORD FileAlignment; + WORD MajorOperatingSystemVersion; + WORD MinorOperatingSystemVersion; + WORD MajorImageVersion; + WORD MinorImageVersion; + WORD MajorSubsystemVersion; + WORD MinorSubsystemVersion; + DWORD Win32VersionValue; + DWORD SizeOfImage; + DWORD SizeOfHeaders; + DWORD CheckSum; + WORD Subsystem; + WORD DllCharacteristics; + ULONGLONG SizeOfStackReserve; + ULONGLONG SizeOfStackCommit; + ULONGLONG SizeOfHeapReserve; + ULONGLONG SizeOfHeapCommit; + DWORD LoaderFlags; + DWORD NumberOfRvaAndSizes; + IMAGE_DATA_DIRECTORY DataDirectory[16]; +} IMAGE_OPTIONAL_HEADER64, *PIMAGE_OPTIONAL_HEADER64; + +typedef struct _IMAGE_NT_HEADERS64 { + DWORD Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER64 OptionalHeader; +} IMAGE_NT_HEADERS64, *PIMAGE_NT_HEADERS64; + +typedef struct _IMAGE_SECTION_HEADER { + BYTE Name[8]; + union { + DWORD PhysicalAddress; + DWORD VirtualSize; + } Misc; + DWORD VirtualAddress; + DWORD SizeOfRawData; + DWORD PointerToRawData; + DWORD PointerToRelocations; + DWORD PointerToLinenumbers; + WORD NumberOfRelocations; + WORD NumberOfLinenumbers; + DWORD Characteristics; +} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER; + +typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY64 { + DWORD Size; + DWORD TimeDateStamp; + WORD MajorVersion; + WORD MinorVersion; + DWORD GlobalFlagsClear; + DWORD GlobalFlagsSet; + DWORD CriticalSectionDefaultTimeout; + ULONGLONG DeCommitFreeBlockThreshold; + ULONGLONG DeCommitTotalFreeThreshold; + ULONGLONG LockPrefixTable; + ULONGLONG MaximumAllocationSize; + ULONGLONG VirtualMemoryThreshold; + ULONGLONG ProcessAffinityMask; + DWORD ProcessHeapFlags; + WORD CSDVersion; + WORD DependentLoadFlags; + ULONGLONG EditList; + ULONGLONG SecurityCookie; + ULONGLONG SEHandlerTable; + ULONGLONG SEHandlerCount; + ULONGLONG GuardCFCheckFunctionPointer; + ULONGLONG GuardCFDispatchFunctionPointer; + ULONGLONG GuardCFFunctionTable; + ULONGLONG GuardCFFunctionCount; + DWORD GuardFlags; + ULONGLONG CodeIntegrity; + ULONGLONG GuardAddressTakenIatEntryTable; + ULONGLONG GuardAddressTakenIatEntryCount; + ULONGLONG GuardLongJumpTargetTable; + ULONGLONG GuardLongJumpTargetCount; + ULONGLONG DynamicValueRelocTable; + ULONGLONG CHPEMetadataPointer; + ULONGLONG GuardRFFailureRoutine; + ULONGLONG GuardRFFailureRoutineFunctionPointer; + DWORD DynamicValueRelocTableOffset; + WORD DynamicValueRelocTableSection; + WORD Reserved2; + ULONGLONG GuardRFVerifyStackPointerFunctionPointer; + DWORD HotPatchTableOffset; + DWORD Reserved3; + ULONGLONG EnclaveConfigurationPointer; + ULONGLONG VolatileMetadataPointer; + ULONGLONG GuardEHContinuationTable; + ULONGLONG GuardEHContinuationCount; + ULONGLONG GuardXFGCheckFunctionPointer; + ULONGLONG GuardXFGDispatchFunctionPointer; + ULONGLONG GuardXFGTableDispatchFunctionPointer; + ULONGLONG CastGuardOsDeterminedFailureMode; + ULONGLONG GuardMemcpyFunctionPointer; +} IMAGE_LOAD_CONFIG_DIRECTORY64, *PIMAGE_LOAD_CONFIG_DIRECTORY64; + +typedef struct _IMAGE_VOLATILE_METADATA { + DWORD Size; + DWORD Version; + DWORD VolatileAccessTable; + DWORD VolatileAccessTableSize; + DWORD VolatileInfoRangeTable; + DWORD VolatileInfoRangeTableSize; +} IMAGE_VOLATILE_METADATA, *PIMAGE_VOLATILE_METADATA; + +typedef struct _IMAGE_VOLATILE_RVA_METADATA { + ULONG Rva; +} IMAGE_VOLATILE_RVA_METADATA, *PIMAGE_VOLATILE_RVA_METADATA; + +typedef struct _IMAGE_VOLATILE_RANGE_METADATA { + ULONG Rva; + ULONG Size; +} IMAGE_VOLATILE_RANGE_METADATA, *PIMAGE_VOLATILE_RANGE_METADATA; + +KHASH_SET_INIT_STR(string); +KHASH_SET_INIT_INT64(volatileopcode); + +static kh_volatileopcode_t* volatileOpcodes = NULL; // never freed +static rbtree_t* volatileRanges = NULL; // never freed + +DWORD RVAToFileOffset(PIMAGE_SECTION_HEADER sections, DWORD numberOfSections, DWORD rva, BYTE* fileBuffer, size_t fileSize) +{ + for (DWORD i = 0; i < numberOfSections; i++) { + PIMAGE_SECTION_HEADER section = §ions[i]; + if (rva >= section->VirtualAddress && rva < section->VirtualAddress + section->SizeOfRawData) { + DWORD offset = rva - section->VirtualAddress + section->PointerToRawData; + if (offset < fileSize) { + return offset; + } + } + } + return 0; +} + +void ParseVolatileMetadata(char* filename, void* addr) +{ + if (!volatileOpcodes) volatileOpcodes = kh_init(volatileopcode); + if (!volatileRanges) volatileRanges = rbtree_init("volatileRanges"); + + char* baseName = strrchr(filename, '/'); + if (!baseName) + return; + else + baseName++; + + IMAGE_DOS_HEADER* dosHeader = (IMAGE_DOS_HEADER*)addr; + if (dosHeader->e_magic != IMAGE_DOS_SIGNATURE) return; + + PIMAGE_NT_HEADERS64 ntHeaders64 = (PIMAGE_NT_HEADERS64)(addr + dosHeader->e_lfanew); + if (ntHeaders64->Signature != IMAGE_NT_SIGNATURE || ntHeaders64->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC) return; + + int numberOfSections = ntHeaders64->FileHeader.NumberOfSections; + if (numberOfSections <= 0) { + return; + } + IMAGE_DATA_DIRECTORY loadConfigDir = ntHeaders64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG]; + if (loadConfigDir.VirtualAddress == 0 || loadConfigDir.Size == 0) { + return; + } + + PIMAGE_SECTION_HEADER sectionHeaders = (PIMAGE_SECTION_HEADER)((void*)ntHeaders64 + sizeof(IMAGE_NT_HEADERS64)); // immediately follows the optional header, if any. + DWORD loadConfigOffset = RVAToFileOffset(sectionHeaders, numberOfSections, loadConfigDir.VirtualAddress, (BYTE*)addr, ntHeaders64->OptionalHeader.SizeOfImage); + if (loadConfigOffset == 0) { + return; + } + + FILE* file = fopen(filename, "rb"); + if (!file) { + return; + } + + fseek(file, 0, SEEK_END); + long size = ftell(file); + fseek(file, 0, SEEK_SET); + + char* buffer = (char*)malloc(size); + if (!buffer) { + fclose(file); + return; + } + + if ((long)fread(buffer, 1, size, file) != size) { + free(buffer); + fclose(file); + return; + } + fclose(file); + + PIMAGE_LOAD_CONFIG_DIRECTORY64 loadConfig = (PIMAGE_LOAD_CONFIG_DIRECTORY64)(buffer + loadConfigOffset); + if (loadConfig->Size < offsetof(IMAGE_LOAD_CONFIG_DIRECTORY64, VolatileMetadataPointer) + sizeof(ULONGLONG)) { + free(buffer); + return; + } + DWORD volatileMetadataPointer = (DWORD)(loadConfig->VolatileMetadataPointer - ntHeaders64->OptionalHeader.ImageBase); + if (volatileMetadataPointer == 0) { + free(buffer); + return; + } + + DWORD volatileMetadataOffset = RVAToFileOffset(sectionHeaders, numberOfSections, volatileMetadataPointer, (BYTE*)buffer, ntHeaders64->OptionalHeader.SizeOfImage); + if (volatileMetadataOffset == 0) { + free(buffer); + return; + } + + PIMAGE_VOLATILE_METADATA volatileMetadata = (PIMAGE_VOLATILE_METADATA)(buffer + volatileMetadataOffset); + if (volatileMetadata->VolatileAccessTable && volatileMetadata->VolatileAccessTableSize) { + printf_log(LOG_INFO, "Parsing volatile metadata of file %s loaded at %p\n", baseName, addr); + + DWORD volatileAccessTableOffset = RVAToFileOffset(sectionHeaders, numberOfSections, volatileMetadata->VolatileAccessTable, (BYTE*)buffer, ntHeaders64->OptionalHeader.SizeOfImage); + if (volatileAccessTableOffset == 0) { + free(buffer); + return; + } + + DWORD numEntries = volatileMetadata->VolatileAccessTableSize / sizeof(IMAGE_VOLATILE_RVA_METADATA); + PIMAGE_VOLATILE_RVA_METADATA volatileAccessTable = (PIMAGE_VOLATILE_RVA_METADATA)(buffer + volatileAccessTableOffset); + + for (DWORD i = 0; i < numEntries; i++) { + ULONGLONG entry = volatileAccessTable[i].Rva + (ULONGLONG)addr; + int ret; + khint_t _ = kh_put(volatileopcode, volatileOpcodes, entry, &ret); + printf_log(LOG_DEBUG, "Volatile access table [%d]: %08lx\n", i, entry); + } + } + + if (volatileMetadata->VolatileInfoRangeTable && volatileMetadata->VolatileInfoRangeTableSize) { + DWORD volatileInfoRangeTableOffset = RVAToFileOffset(sectionHeaders, numberOfSections, volatileMetadata->VolatileInfoRangeTable, (BYTE*)buffer, ntHeaders64->OptionalHeader.SizeOfImage); + if (volatileInfoRangeTableOffset == 0) { + free(buffer); + return; + } + + DWORD numEntries = volatileMetadata->VolatileInfoRangeTableSize / sizeof(IMAGE_VOLATILE_RANGE_METADATA); + PIMAGE_VOLATILE_RANGE_METADATA volatileRangeMetadata = (PIMAGE_VOLATILE_RANGE_METADATA)(buffer + volatileInfoRangeTableOffset); + + for (DWORD i = 0; i < numEntries; i++) { + ULONGLONG rva = volatileRangeMetadata[i].Rva + (ULONGLONG)addr; + ULONGLONG size = volatileRangeMetadata[i].Size; + rb_set(volatileRanges, rva, rva + size, 1); + printf_log(LOG_DEBUG, "Volatile range metadata [%d]: %08lx-%08lx\n", i, rva, rva + size); + } + } + free(buffer); + return; +} + +int VolatileRangesContains(uintptr_t addr) +{ + if (!volatileRanges) return 0; + return rb_get(volatileRanges, addr) != 0; +} + +int VolatileOpcodesHas(uintptr_t addr) +{ + if (!volatileOpcodes) return 0; + return kh_get(volatileopcode, volatileOpcodes, addr) != kh_end(volatileOpcodes); +} diff --git a/src/tools/rbtree.c b/src/tools/rbtree.c index 257a404..bb7e663 100644 --- a/src/tools/rbtree.c +++ b/src/tools/rbtree.c @@ -1,6 +1,8 @@ +#include #include #include #include +#include #ifdef RBTREE_TEST #define rbtreeMalloc malloc @@ -21,29 +23,38 @@ typedef struct rbnode { struct rbnode *left, *right, *parent; uintptr_t start, end; - uint32_t data; + uint64_t data; uint8_t meta; } rbnode; -typedef struct rbtree { +struct rbtree { rbnode *root; - int is_unstable; -} rbtree; + const char* name; + bool is_unstable; + // Cache + rbnode *rightmost; + rbnode *leftmost; + // TODO: Refine the naming scheme +}; -rbtree* init_rbtree() { - rbtree* tree = rbtreeMalloc(sizeof(rbtree)); +rbtree_t* rbtree_init(const char* name) { + rbtree_t* tree = rbtreeMalloc(sizeof(rbtree_t)); tree->root = NULL; - tree->is_unstable = 0; + tree->is_unstable = false; + tree->name = name?name:"(rbtree)"; + tree->rightmost = NULL; + tree->leftmost = NULL; return tree; } -void delete_rbnode(rbnode *root) { +static inline void delete_rbnode(rbnode *root) { if (!root) return; delete_rbnode(root->left); delete_rbnode(root->right); rbtreeFree(root); } -void delete_rbtree(rbtree *tree) { + +void rbtree_delete(rbtree_t *tree) { delete_rbnode(tree->root); rbtreeFree(tree); } @@ -52,8 +63,8 @@ void delete_rbtree(rbtree *tree) { #define IS_BLACK 0x2 // Make sure prev is either the rightmost node before start or the leftmost range after start -int add_range_next_to(rbtree *tree, rbnode *prev, uintptr_t start, uintptr_t end, uint32_t data) { -// printf("Adding %lX-%lX:%hhX next to %p\n", start, end, data, prev); +static int add_range_next_to(rbtree_t *tree, rbnode *prev, uintptr_t start, uintptr_t end, uint64_t data) { +// printf("Adding %lx-%lx:%hhx next to %p\n", start, end, data, prev); rbnode *node = rbtreeMalloc(sizeof(*node)); if (!node) return -1; node->start = start; @@ -63,17 +74,25 @@ int add_range_next_to(rbtree *tree, rbnode *prev, uintptr_t start, uintptr_t end node->right = NULL; if (tree->is_unstable) { - printf_log(LOG_NONE, "Warning, unstable Red-Black tree; trying to add a node anyways\n"); + printf_log(LOG_NONE, "Warning, unstable Red-Black tree \"%s\"; trying to add a node anyways\n", tree->name); } - tree->is_unstable = 1; + tree->is_unstable = true; if (!tree->root) { node->parent = NULL; node->meta = IS_BLACK; tree->root = node; - tree->is_unstable = 0; + tree->is_unstable = false; + tree->leftmost = node; + tree->rightmost = node; return 0; } + + // Update cache + if (start < tree->leftmost->start) // new left most + tree->leftmost = node; + else if (start > tree->rightmost->start) // new right most + tree->rightmost = node; node->parent = prev; if (prev->start < start) { @@ -88,15 +107,15 @@ int add_range_next_to(rbtree *tree, rbnode *prev, uintptr_t start, uintptr_t end if (!node->parent) { node->meta = IS_BLACK; tree->root = node; - tree->is_unstable = 0; + tree->is_unstable = false; return 0; } if (node->parent->meta & IS_BLACK) { - tree->is_unstable = 0; + tree->is_unstable = false; return 0; } if (!node->parent->parent) { - tree->is_unstable = 0; + tree->is_unstable = false; return 0; // Cannot happen as the root is black, unless the tree is unstable } if (node->parent->meta & IS_LEFT) { @@ -157,7 +176,7 @@ int add_range_next_to(rbtree *tree, rbnode *prev, uintptr_t start, uintptr_t end z->left->parent = z; } if (!y->parent) tree->root = y; - tree->is_unstable = 0; + tree->is_unstable = false; return 0; } } else { @@ -218,26 +237,16 @@ int add_range_next_to(rbtree *tree, rbnode *prev, uintptr_t start, uintptr_t end z->right->parent = z; } if (!y->parent) tree->root = y; - tree->is_unstable = 0; + tree->is_unstable = false; return 0; } } } - tree->is_unstable = 0; + tree->is_unstable = false; return -1; // unreachable } -int add_range(rbtree *tree, uintptr_t start, uintptr_t end, uint32_t data) { -// printf("add_range\n"); - rbnode *cur = tree->root, *prev = NULL; - while (cur) { - prev = cur; - if (cur->start < start) cur = cur->right; - else cur = cur->left; - } - return add_range_next_to(tree, prev, start, end, data); -} -rbnode *find_addr(rbtree *tree, uintptr_t addr) { +static rbnode *find_addr(rbtree_t *tree, uintptr_t addr) { rbnode *node = tree->root; while (node) { if ((node->start <= addr) && (node->end > addr)) return node; @@ -247,14 +256,21 @@ rbnode *find_addr(rbtree *tree, uintptr_t addr) { return NULL; } +static rbnode *succ_node(rbnode *node); +static rbnode *pred_node(rbnode *node); // node must be a valid node in the tree -int remove_node(rbtree *tree, rbnode *node) { -// printf("Removing %p\n", node); print_rbtree(tree); fflush(stdout); +static int remove_node(rbtree_t *tree, rbnode *node) { +// printf("Removing %p\n", node); rbtree_print(tree); fflush(stdout); if (tree->is_unstable) { printf_log(LOG_NONE, "Warning, unstable Red-Black tree; trying to add a node anyways\n"); } - tree->is_unstable = 1; - + tree->is_unstable = true; + // Update cache + if (node == tree->leftmost) + tree->leftmost = succ_node(node); + else if (node == tree->rightmost) + tree->rightmost = pred_node(node); + if (node->left && node->right) { // Swap node and its successor // Do NOT free the successor as a reference to it can exist @@ -299,7 +315,7 @@ int remove_node(rbtree *tree, rbnode *node) { if (!parent) { tree->root = child; child->meta |= IS_BLACK; // Needs to be an or - tree->is_unstable = 0; + tree->is_unstable = false; return 0; } else if (node->meta & IS_LEFT) { child->meta |= IS_LEFT; @@ -312,7 +328,7 @@ int remove_node(rbtree *tree, rbnode *node) { if (!parent) { tree->root = NULL; rbtreeFree(node); - tree->is_unstable = 0; + tree->is_unstable = false; return 0; } else if (node->meta & IS_LEFT) { parent->left = NULL; @@ -323,7 +339,7 @@ int remove_node(rbtree *tree, rbnode *node) { // Node has been removed, now to fix the tree if (!(node->meta & IS_BLACK)) { rbtreeFree(node); - tree->is_unstable = 0; + tree->is_unstable = false; return 0; } rbtreeFree(node); @@ -392,7 +408,7 @@ int remove_node(rbtree *tree, rbnode *node) { } if (!y->parent) tree->root = y; node->right->meta |= IS_BLACK; - tree->is_unstable = 0; + tree->is_unstable = false; return 0; } } else if (!node->left || (node->left->meta & IS_BLACK)) { // case2_l: @@ -486,7 +502,7 @@ int remove_node(rbtree *tree, rbnode *node) { } if (!y->parent) tree->root = y; node->left->meta |= IS_BLACK; - tree->is_unstable = 0; + tree->is_unstable = false; return 0; } } else if (!node->right || (node->right->meta & IS_BLACK)) { // case2_r: @@ -524,19 +540,11 @@ int remove_node(rbtree *tree, rbnode *node) { } if (child) child->meta |= IS_BLACK; - tree->is_unstable = 0; + tree->is_unstable = false; return 0; } -rbnode *first_node(rbtree *tree) { - rbnode *node = tree->root, *prev = node; - while (node) { - prev = node; - node = node->left; - } - return prev; -} -rbnode *pred_node(rbnode *node) { +static rbnode *pred_node(rbnode *node) { if (!node) return NULL; if (node->left) { node = node->left; @@ -547,7 +555,8 @@ rbnode *pred_node(rbnode *node) { return node->parent; } } -rbnode *succ_node(rbnode *node) { + +static rbnode *succ_node(rbnode *node) { if (!node) return NULL; if (node->right) { node = node->right; @@ -559,13 +568,23 @@ rbnode *succ_node(rbnode *node) { } } -uint32_t rb_get(rbtree *tree, uintptr_t addr) { +uint32_t rb_get(rbtree_t *tree, uintptr_t addr) { + if (tree->leftmost && addr < tree->leftmost->start) return 0; + if (tree->rightmost && addr > tree->rightmost->end) return 0; rbnode *node = find_addr(tree, addr); if (node) return node->data; - else return 0; + return 0; +} + +uint64_t rb_get_64(rbtree_t *tree, uintptr_t addr) { + if (tree->leftmost && addr < tree->leftmost->start) return 0; + if (tree->rightmost && addr > tree->rightmost->end) return 0; + rbnode *node = find_addr(tree, addr); + if (node) return node->data; + return 0; } -int rb_get_end(rbtree* tree, uintptr_t addr, uint32_t* val, uintptr_t* end) { +int rb_get_end(rbtree_t* tree, uintptr_t addr, uint32_t* val, uintptr_t* end) { rbnode *node = tree->root, *next = NULL; while (node) { if ((node->start <= addr) && (node->end > addr)) { @@ -589,11 +608,35 @@ int rb_get_end(rbtree* tree, uintptr_t addr, uint32_t* val, uintptr_t* end) { return 0; } -int rb_set(rbtree *tree, uintptr_t start, uintptr_t end, uint32_t data) { -// printf("rb_set( "); print_rbtree(tree); printf(" , 0x%lX, 0x%lX, %hhu);\n", start, end, data); fflush(stdout); -dynarec_log(LOG_DEBUG, "set 0x%lX, 0x%lX, 0x%x\n", start, end, data); +int rb_get_end_64(rbtree_t* tree, uintptr_t addr, uint64_t* val, uintptr_t* end) { + rbnode *node = tree->root, *next = NULL; + while (node) { + if ((node->start <= addr) && (node->end > addr)) { + *val = node->data; + *end = node->end; + return 1; + } + if (node->end <= addr) { + node = node->right; + } else { + next = node; + node = node->left; + } + } + *val = 0; + if (next) { + *end = next->start; + } else { + *end = (uintptr_t)-1; + } + return 0; +} + +int rb_set_64(rbtree_t *tree, uintptr_t start, uintptr_t end, uint64_t data) { +// printf("rb_set( "); rbtree_print(tree); printf(" , 0x%lx, 0x%lx, %hhu);\n", start, end, data); fflush(stdout); +dynarec_log(LOG_DEBUG, "set %s: 0x%lx, 0x%lx, 0x%x\n", tree->name, start, end, data); if (!tree->root) { - return add_range(tree, start, end, data); + return add_range_next_to(tree, NULL, start, end, data); } rbnode *node = tree->root, *prev = NULL, *last = NULL; @@ -722,9 +765,13 @@ dynarec_log(LOG_DEBUG, "set 0x%lX, 0x%lX, 0x%x\n", start, end, data); return add_range_next_to(tree, last->left ? pred_node(last) : last, start, end, data); } -int rb_unset(rbtree *tree, uintptr_t start, uintptr_t end) { -// printf("rb_unset( "); print_rbtree(tree); printf(" , 0x%lX, 0x%lX);\n", start, end); fflush(stdout); -dynarec_log(LOG_DEBUG, "rb_unset(tree, 0x%lX, 0x%lX);\n", start, end); +int rb_set(rbtree_t *tree, uintptr_t start, uintptr_t end, uint32_t data) { + return rb_set_64(tree, start, end, data); +} + +int rb_unset(rbtree_t *tree, uintptr_t start, uintptr_t end) { +// printf("rb_unset( "); rbtree_print(tree); printf(" , 0x%lx, 0x%lx);\n", start, end); fflush(stdout); +dynarec_log(LOG_DEBUG, "unset: %s 0x%lx, 0x%lx);\n", tree->name, start, end); if (!tree->root) return 0; rbnode *node = tree->root, *prev = NULL, *next = NULL; @@ -767,7 +814,9 @@ dynarec_log(LOG_DEBUG, "rb_unset(tree, 0x%lX, 0x%lX);\n", start, end); } else if (prev->end == end) { prev->end = start; return 0; - } // else fallthrough + } else { + prev->end = start; + } } while (next && (next->start < end) && (next->end <= end)) { // Remove the entire node @@ -782,134 +831,478 @@ dynarec_log(LOG_DEBUG, "rb_unset(tree, 0x%lX, 0x%lX);\n", start, end); return 0; } -uintptr_t rb_get_righter(rbtree* tree) -{ -dynarec_log(LOG_DEBUG, "rb_get_righter(tree);\n"); - if (!tree->root) return 0; +uint64_t rb_inc(rbtree_t *tree, uintptr_t start, uintptr_t end) { + // printf("rb_inc( "); rbtree_print(tree); printf(" , 0x%lx, 0x%lx);\n", start, end); fflush(stdout); + dynarec_log(LOG_DEBUG, "inc %s: 0x%lx, 0x%lx\n", tree->name, start, end); + if (!tree->root) { + add_range_next_to(tree, NULL, start, end, 1); + return 1; + } + + rbnode *node = tree->root, *prev = NULL, *last = NULL; + while (node) { + if (node->start < start) { + prev = node; + node = node->right; + } else if (node->start == start) { + if (node->left) { + prev = node->left; + while (prev->right) prev = prev->right; + } + if (node->right) { + last = node->right; + while (last->left) last = last->left; + } + break; + } else { + last = node; + node = node->left; + } + } - rbnode *node = tree->root; + // prev is the largest node starting strictly before start, or NULL if there is none + // node is the node starting exactly at start, or NULL if there is none + // last is the smallest node starting strictly after start, or NULL if there is none + // Note that prev may contain start + + uint64_t data = (node?node->data:0)+1; + + if (prev && (prev->end >= start) && (prev->data == data)) { + // Merge with prev + if (end <= prev->end) return data; // Nothing to do! + + if (node && (node->end > end)) { + node->start = end; + prev->end = end; + return data; + } else if (node && (node->end == end)) { + remove_node(tree, node); + prev->end = end; + return data; + } else if (node) { + remove_node(tree, node); + } + while (last && (last->start < end) && (last->end <= end)) { + // Remove the entire node + node = last; + last = succ_node(last); + remove_node(tree, node); + } + if (last && (last->start <= end) && (last->data == data)) { + // Merge node and last + prev->end = last->end; + remove_node(tree, last); + return data; + } + if (last && (last->start < end)) last->start = end; + prev->end = end; + return data; + } else if (prev && (prev->end > start)) { + if (prev->end > end) { + // Split in three + // Note that here, succ(prev) = last and node = NULL + int ret; + ret = add_range_next_to(tree, prev->right ? last : prev, end, prev->end, prev->data); + ret = ret ? ret : add_range_next_to(tree, prev->right ? succ_node(prev) : prev, start, end, data); + prev->end = start; + return ret; + } + // Cut prev and continue + prev->end = start; + } + + if (node) { + // Change node + if (node->end >= end) { + if (node->data == data) return 0; // Nothing to do! + // Cut node + if (node->end > end) { + int ret = add_range_next_to(tree, node->right ? last : node, end, node->end, node->data); + node->end = end; + node->data = data; + return ret; + } + // Fallthrough + } + + // Overwrite and extend node + while (last && (last->start < end) && (last->end <= end)) { + // Remove the entire node + prev = last; + last = succ_node(last); + remove_node(tree, prev); + } + if (last && (last->start <= end) && (last->data == data)) { + // Merge node and last + remove_node(tree, node); + last->start = start; + return data; + } + if (last && (last->start < end)) last->start = end; + if (node->end < end) node->end = end; + node->data = data; + return data; + } + + while (last && (last->start < end) && (last->end <= end)) { + // Remove the entire node + node = last; + last = succ_node(last); + remove_node(tree, node); + } + if (!last) { + // Add a new node next to prev, the largest node of the tree + // It exists since the tree is nonempty + return add_range_next_to(tree, prev, start, end, data); + } + if ((last->start <= end) && (last->data == data)) { + // Extend + last->start = start; + return data; + } else if (last->start < end) { + // Cut + last->start = end; + } + // Probably 'last->left ? prev : last' is enough + add_range_next_to(tree, last->left ? pred_node(last) : last, start, end, data); + return data; +} + +uint64_t rb_dec(rbtree_t *tree, uintptr_t start, uintptr_t end) { + // printf("rb_dec( "); rbtree_print(tree); printf(" , 0x%lx, 0x%lx);\n", start, end); fflush(stdout); + dynarec_log(LOG_DEBUG, "dec %s: 0x%lx, 0x%lx\n", tree->name, start, end); + if (!tree->root) { + return 0; + } + + rbnode *node = tree->root, *prev = NULL, *last = NULL; while (node) { - if(!node->right) - return node->start; - node = node->right; + if (node->start < start) { + prev = node; + node = node->right; + } else if (node->start == start) { + if (node->left) { + prev = node->left; + while (prev->right) prev = prev->right; + } + if (node->right) { + last = node->right; + while (last->left) last = last->left; + } + break; + } else { + last = node; + node = node->left; + } } - return 0; + + // prev is the largest node starting strictly before start, or NULL if there is none + // node is the node starting exactly at start, or NULL if there is none + // last is the smallest node starting strictly after start, or NULL if there is none + // Note that prev may contain start + + uint64_t data = (node?node->data:0); + if(!data) return data; + --data; + if(!data) { + // delete the node... + if (node) { + if (node->end > end) { + node->start = end; + return 0; + } else if (node->end == end) { + remove_node(tree, node); + return 0; + } else { + remove_node(tree, node); + } + } else if (prev && (prev->end > start)) { + if (prev->end > end) { + // Split prev + int ret = add_range_next_to(tree, prev->right ? last : prev, end, prev->end, prev->data); + prev->end = start; + return ret; + } else if (prev->end == end) { + prev->end = start; + return 0; + } // else fallthrough + } + while (last && (last->start < end) && (last->end <= end)) { + // Remove the entire node + node = last; + last = succ_node(last); + remove_node(tree, node); + } + if (last && (last->start < end)) { + // last->end > end: cut the node + last->start = end; + } + return 0; + } + + if (prev && (prev->end >= start) && (prev->data == data)) { + // Merge with prev + if (end <= prev->end) return data; // Nothing to do! + + if (node && (node->end > end)) { + node->start = end; + prev->end = end; + return data; + } else if (node && (node->end == end)) { + remove_node(tree, node); + prev->end = end; + return data; + } else if (node) { + remove_node(tree, node); + } + while (last && (last->start < end) && (last->end <= end)) { + // Remove the entire node + node = last; + last = succ_node(last); + remove_node(tree, node); + } + if (last && (last->start <= end) && (last->data == data)) { + // Merge node and last + prev->end = last->end; + remove_node(tree, last); + return data; + } + if (last && (last->start < end)) last->start = end; + prev->end = end; + return data; + } else if (prev && (prev->end > start)) { + if (prev->end > end) { + // Split in three + // Note that here, succ(prev) = last and node = NULL + int ret; + ret = add_range_next_to(tree, prev->right ? last : prev, end, prev->end, prev->data); + ret = ret ? ret : add_range_next_to(tree, prev->right ? succ_node(prev) : prev, start, end, data); + prev->end = start; + return ret; + } + // Cut prev and continue + prev->end = start; + } + + if (node) { + // Change node + if (node->end >= end) { + if (node->data == data) return 0; // Nothing to do! + // Cut node + if (node->end > end) { + int ret = add_range_next_to(tree, node->right ? last : node, end, node->end, node->data); + node->end = end; + node->data = data; + return ret; + } + // Fallthrough + } + + // Overwrite and extend node + while (last && (last->start < end) && (last->end <= end)) { + // Remove the entire node + prev = last; + last = succ_node(last); + remove_node(tree, prev); + } + if (last && (last->start <= end) && (last->data == data)) { + // Merge node and last + remove_node(tree, node); + last->start = start; + return data; + } + if (last && (last->start < end)) last->start = end; + if (node->end < end) node->end = end; + node->data = data; + return data; + } + + while (last && (last->start < end) && (last->end <= end)) { + // Remove the entire node + node = last; + last = succ_node(last); + remove_node(tree, node); + } + if (!last) { + // Add a new node next to prev, the largest node of the tree + // It exists since the tree is nonempty + return add_range_next_to(tree, prev, start, end, data); + } + if ((last->start <= end) && (last->data == data)) { + // Extend + last->start = start; + return data; + } else if (last->start < end) { + // Cut + last->start = end; + } + // Probably 'last->left ? prev : last' is enough + add_range_next_to(tree, last->left ? pred_node(last) : last, start, end, data); + return data; +} + +uintptr_t rb_get_rightmost(rbtree_t* tree) +{ +dynarec_log(LOG_DEBUG, "rb_get_rightmost(%s);\n", tree->name); + if (!tree->root) return 0; + return tree->rightmost->start; +} + +uintptr_t rb_get_leftmost(rbtree_t* tree) +{ +dynarec_log(LOG_DEBUG, "rb_get_leftmost(%s);\n", tree->name); + if (!tree->root) return 0; + return tree->leftmost->start; } #include -void print_rbnode(const rbnode *node, unsigned depth, uintptr_t minstart, uintptr_t maxend, unsigned *bdepth) { +#if 0 +#define printf_log(L, ...) printf(__VA_ARGS__) +#define LOG_NONE 0 +#endif +static void print_rbnode(const rbnode *node, unsigned depth, uintptr_t minstart, uintptr_t maxend, unsigned *bdepth) { if (!node) { if (!*bdepth || *bdepth == depth + 1) { *bdepth = depth + 1; - printf("[%u]", depth); + printf_log(LOG_NONE, "[%u]", depth); } else - printf("", depth); + printf_log(LOG_NONE, "", depth); return; } if (node->start < minstart) { - printf(""); + printf_log(LOG_NONE, ""); return; } if (node->end > maxend) { - printf(""); + printf_log(LOG_NONE, ""); return; } - printf("("); + printf_log(LOG_NONE, "("); if (node->left && !(node->left->meta & IS_LEFT)) { - printf(""); + printf_log(LOG_NONE, ""); } else if (node->left && (node->left->parent != node)) { - printf("", node->left->parent, node); + printf_log(LOG_NONE, "", node->left->parent, node); } else if (node->left && !(node->meta & IS_BLACK) && !(node->left->meta & IS_BLACK)) { - printf(" "); + printf_log(LOG_NONE, " "); print_rbnode(node->left, depth + ((node->meta & IS_BLACK) ? 1 : 0), minstart, node->start, bdepth); } else { print_rbnode(node->left, depth + ((node->meta & IS_BLACK) ? 1 : 0), minstart, node->start, bdepth); } - printf(", (%c/%p) %lX-%lX: %hhu, ", node->meta & IS_BLACK ? 'B' : 'R', node, node->start, node->end, node->data); + printf_log(LOG_NONE, ", (%c/%p) %lx-%lx: %" PRIu64 ", ", node->meta & IS_BLACK ? 'B' : 'R', node, node->start, node->end, node->data); if (node->right && (node->right->meta & IS_LEFT)) { - printf(""); + printf_log(LOG_NONE, ""); } else if (node->right && (node->right->parent != node)) { - printf("", node->right->parent, node); + printf_log(LOG_NONE, "", node->right->parent, node); } else if (node->right && !(node->meta & IS_BLACK) && !(node->right->meta & IS_BLACK)) { - printf(" "); + printf_log(LOG_NONE, " "); print_rbnode(node->right, depth + ((node->meta & IS_BLACK) ? 1 : 0), node->end, maxend, bdepth); } else { print_rbnode(node->right, depth + ((node->meta & IS_BLACK) ? 1 : 0), node->end, maxend, bdepth); } - printf(")"); + printf_log(LOG_NONE, ")"); +} + +static void cache_check(const rbtree_t *tree) { + if (!tree || !tree->root) + return; + // find right most + rbnode *right_node = tree->root; + while (right_node->right) + right_node = right_node->right; + + if (tree->rightmost != right_node){ + printf_log(LOG_NONE, "\n"); + return; + } + + // find left most + rbnode *left_node = tree->root; + while (left_node->left) + left_node = left_node->left; + + if (tree->leftmost != left_node){ + printf_log(LOG_NONE, "\n"); + return; + } + + printf_log(LOG_NONE, " \n"); } -void print_rbtree(const rbtree *tree) { + +void rbtree_print(const rbtree_t *tree) { if (!tree) { - printf("\n"); + printf_log(LOG_NONE, "\n"); return; } + if (tree->name) + printf_log(LOG_NONE, "tree name: %s\n", tree->name); if (tree->root && tree->root->parent) { - printf("Root has parent\n"); + printf_log(LOG_NONE, "Root has parent\n"); return; } if (tree->root && !(tree->root->meta & IS_BLACK)) { - printf("Root is red\n"); + printf_log(LOG_NONE, "Root is red\n"); return; } + cache_check(tree); unsigned bdepth = 0; print_rbnode(tree->root, 0, 0, (uintptr_t)-1, &bdepth); - printf("\n"); + printf_log(LOG_NONE, "\n"); } #ifdef RBTREE_TEST int main() { - rbtree* tree = init_rbtree(); - print_rbtree(tree); fflush(stdout); + rbtree_t* tree = rbtree_init("test"); + rbtree_print(tree); fflush(stdout); /*int ret; ret = rb_set(tree, 0x43, 0x44, 0x01); - printf("%d; ", ret); print_rbtree(tree); fflush(stdout); + printf("%d; ", ret); rbtree_print(tree); fflush(stdout); ret = rb_set(tree, 0x42, 0x43, 0x01); - printf("%d; ", ret); print_rbtree(tree); fflush(stdout); + printf("%d; ", ret); rbtree_print(tree); fflush(stdout); ret = rb_set(tree, 0x41, 0x42, 0x01); - printf("%d; ", ret); print_rbtree(tree); fflush(stdout); + printf("%d; ", ret); rbtree_print(tree); fflush(stdout); ret = rb_set(tree, 0x40, 0x41, 0x01); - printf("%d; ", ret); print_rbtree(tree); fflush(stdout); + printf("%d; ", ret); rbtree_print(tree); fflush(stdout); ret = rb_set(tree, 0x20, 0x40, 0x03); - printf("%d; ", ret); print_rbtree(tree); fflush(stdout); + printf("%d; ", ret); rbtree_print(tree); fflush(stdout); ret = rb_set(tree, 0x10, 0x20, 0x01); - printf("%d; ", ret); print_rbtree(tree); fflush(stdout); + printf("%d; ", ret); rbtree_print(tree); fflush(stdout); uint32_t val = rb_get(tree, 0x33); printf("0x33 has attribute %hhu\n", val); fflush(stdout);*/ /* rbnode *node = find_addr(tree, 0x33); printf("0x33 is at %p: ", node); print_rbnode(node, 0); printf("\n"); fflush(stdout); ret = remove_node(tree, node); - printf("%d; ", ret); print_rbtree(tree); fflush(stdout); + printf("%d; ", ret); rbtree_print(tree); fflush(stdout); node = find_addr(tree, 0x20); printf("0x20 is at %p\n", node); node = find_addr(tree, 0x1F); printf("0x1F is at %p: ", node); print_rbnode(node, 0); printf("\n"); fflush(stdout); ret = remove_node(tree, node); - printf("%d; ", ret); print_rbtree(tree); fflush(stdout); */ + printf("%d; ", ret); rbtree_print(tree); fflush(stdout); */ /* ret = rb_set(tree, 0x15, 0x42, 0x00); - printf("%d; ", ret); print_rbtree(tree); fflush(stdout); */ + printf("%d; ", ret); rbtree_print(tree); fflush(stdout); */ /*rb_unset(tree, 0x15, 0x42); - print_rbtree(tree); fflush(stdout);*/ + rbtree_print(tree); fflush(stdout);*/ - // tree->root = node27; print_rbtree(tree); fflush(stdout); - // rb_set(tree, 2, 3, 1); print_rbtree(tree); fflush(stdout); - // add_range_next_to(tree, node24, 0x0E7000, 0x0E8000, 69); print_rbtree(tree); fflush(stdout); - // print_rbtree(tree); fflush(stdout); + // tree->root = node27; rbtree_print(tree); fflush(stdout); + // rb_set(tree, 2, 3, 1); rbtree_print(tree); fflush(stdout); + // add_range_next_to(tree, node24, 0x0E7000, 0x0E8000, 69); rbtree_print(tree); fflush(stdout); + // rbtree_print(tree); fflush(stdout); // uint32_t val = rb_get(tree, 0x11003000); // printf("0x11003000 has attribute %hhu\n", val); fflush(stdout); - // remove_node(tree, node0); print_rbtree(tree); fflush(stdout); - // add_range_next_to(tree, node1, 0x0E7000, 0x0E8000, 69); print_rbtree(tree); fflush(stdout); + // remove_node(tree, node0); rbtree_print(tree); fflush(stdout); + // add_range_next_to(tree, node1, 0x0E7000, 0x0E8000, 69); rbtree_print(tree); fflush(stdout); rb_set(tree, 0x130000, 0x140000, 7); - print_rbtree(tree); fflush(stdout); + rbtree_print(tree); fflush(stdout); rb_set(tree, 0x141000, 0x142000, 135); - print_rbtree(tree); fflush(stdout); + rbtree_print(tree); fflush(stdout); rb_set(tree, 0x140000, 0x141000, 135); - print_rbtree(tree); fflush(stdout); + rbtree_print(tree); fflush(stdout); rb_set(tree, 0x140000, 0x141000, 7); - print_rbtree(tree); fflush(stdout); + rbtree_print(tree); fflush(stdout); rb_set(tree, 0x140000, 0x141000, 135); - print_rbtree(tree); fflush(stdout); + rbtree_print(tree); fflush(stdout); uint32_t val = rb_get(tree, 0x141994); printf("0x141994 has attribute %hhu\n", val); fflush(stdout); - delete_rbtree(tree); + rbtree_delete(tree); } #endif diff --git a/src/tools/rcfile.c b/src/tools/rcfile.c deleted file mode 100644 index 26f3aab..0000000 --- a/src/tools/rcfile.c +++ /dev/null @@ -1,730 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "rcfile.h" -#include "box64context.h" -#include "fileutils.h" -#include "pathcoll.h" -#include "x64emu.h" -#ifdef HAVE_TRACE -#include "x64trace.h" -#endif -#include "custommem.h" -#include "khash.h" - -// This file handle the box64rc files -// file are basicaly ini file, with section [XXXX] defining the name of the process -// and BOX64_XXXX=YYYY entry like the env. var. variables - -// default rcfile -static const char default_rcfile[] = -"[bash]\n" -"BOX64_LOG=0\n" -"\n" -"[deadcells]\n" -"BOX64_PREFER_EMULATED=1\n" -"\n" -"[dontstarve]\n" -"BOX64_EMULATED_LIBS=libSDL2-2.0.so.0\n" -"\n" -"[dota2]\n" -"BOX64_CRASHHANDLER=1\n" -"BOX64_DYNAREC_STRONGMEM=1\n" -"\n" -"[factorio]\n" -"BOX64_DYNAREC_FASTROUND=0\n" -"\n" -"[heroic]\n" -"BOX64_NOSANDBOX=1\n" -"BOX64_MALLOC_HACK=2\n" -"\n" -"[LotCG.x86_64]\n" -"BOX64_DYNAREC_FASTROUND=0\n" -"\n" -"[Mini Metro]\n" -"BOX64_ADDLIBS=stdc++.so.6\n" -"\n" -"[pressure-vessel-wrap]\n" -"BOX64_NOGTK=1\n" -"\n" -"[ShovelKnight]\n" -"BOX64_SDL2_JGUID=1\n" -"\n" -"[Soma.bin.x86_64]\n" -"BOX64_DYNAREC_FASTROUND=0\n" -"\n" -"[streaming_client]\n" -"BOX64_EMULATED_LIBS=libSDL2-2.0.so.0:libSDL2_ttf-2.0.so.0\n" -"\n" -"[steam-runtime-check-requirements]\n" -"BOX64_EXIT=1\n" -"\n" -"[steam-runtime-launcher-service]\n" -"BOX64_EXIT=1\n" -; - -// list of all entries -#define SUPER1() \ -ENTRYINTPOS(BOX64_ROLLING_LOG, new_cycle_log) \ -ENTRYSTRING_(BOX64_LD_LIBRARY_PATH, ld_library_path) \ -ENTRYSTRING_(BOX64_PATH, box64_path) \ -ENTRYSTRING_(BOX64_TRACE_FILE, trace_file) \ -ENTRYADDR(BOX64_LOAD_ADDR, box64_load_addr) \ -ENTRYINT(BOX64_LOG, box64_log, 0, 3, 2) \ -ENTRYBOOL(BOX64_DUMP, box64_dump) \ -ENTRYBOOL(BOX64_DLSYM_ERROR, dlsym_error) \ -CENTRYBOOL(BOX64_NOSIGSEGV, no_sigsegv) \ -CENTRYBOOL(BOX64_NOSIGILL, no_sigill) \ -ENTRYBOOL(BOX64_SHOWSEGV, box64_showsegv) \ -ENTRYBOOL(BOX64_SHOWBT, box64_showbt) \ -ENTRYBOOL(BOX64_MMAP32, box64_mmap32) \ -ENTRYBOOL(BOX64_IGNOREINT3, box64_ignoreint3) \ -IGNORE(BOX64_RDTSC) \ -ENTRYBOOL(BOX64_X11THREADS, box64_x11threads) \ -ENTRYBOOL(BOX64_X11GLX, box64_x11glx) \ -ENTRYDSTRING(BOX64_LIBGL, box64_libGL) \ -ENTRYBOOL(BOX64_SSE_FLUSHTO0, box64_sse_flushto0) \ -ENTRYBOOL(BOX64_X87_NO80BITS, box64_x87_no80bits) \ -ENTRYBOOL(BOX64_SYNC_ROUNDING, box64_sync_rounding) \ -ENTRYSTRING_(BOX64_EMULATED_LIBS, emulated_libs) \ -ENTRYBOOL(BOX64_ALLOWMISSINGLIBS, allow_missing_libs) \ -ENTRYBOOL(BOX64_PREFER_WRAPPED, box64_prefer_wrapped) \ -ENTRYBOOL(BOX64_PREFER_EMULATED, box64_prefer_emulated) \ -ENTRYBOOL(BOX64_CRASHHANDLER, box64_dummy_crashhandler) \ -ENTRYBOOL(BOX64_NOPULSE, box64_nopulse) \ -ENTRYBOOL(BOX64_NOGTK, box64_nogtk) \ -ENTRYBOOL(BOX64_NOVULKAN, box64_novulkan) \ -ENTRYBOOL(BOX64_RDTSC_1GHZ, box64_rdtsc_1ghz) \ -ENTRYBOOL(BOX64_SSE42, box64_sse42) \ -ENTRYINT(BOX64_AVX, new_avx, 0, 2, 2) \ -ENTRYBOOL(BOX64_FUTEX_WAITV, box64_futex_waitv) \ -ENTRYSTRING_(BOX64_BASH, bash) \ -ENTRYINT(BOX64_JITGDB, jit_gdb, 0, 3, 2) \ -ENTRYBOOL(BOX64_NOSANDBOX, box64_nosandbox) \ -ENTRYBOOL(BOX64_INPROCESSGPU, box64_inprocessgpu) \ -ENTRYBOOL(BOX64_CEFDISABLEGPU, box64_cefdisablegpu) \ -ENTRYBOOL(BOX64_CEFDISABLEGPUCOMPOSITOR, box64_cefdisablegpucompositor)\ -ENTRYBOOL(BOX64_EXIT, want_exit) \ -ENTRYBOOL(BOX64_LIBCEF, box64_libcef) \ -ENTRYBOOL(BOX64_JVM, box64_jvm) \ -ENTRYBOOL(BOX64_UNITYPLAYER, box64_unityplayer) \ -ENTRYBOOL(BOX64_SDL2_JGUID, box64_sdl2_jguid) \ -ENTRYINT(BOX64_MALLOC_HACK, box64_malloc_hack, 0, 2, 2) \ -ENTRYINTPOS(BOX64_MAXCPU, new_maxcpu) \ -ENTRYSTRING_(BOX64_ADDLIBS, new_addlibs) \ -ENTRYSTRING_(BOX64_ENV, new_env) \ -ENTRYSTRING_(BOX64_ENV1, new_env1) \ -ENTRYSTRING_(BOX64_ENV2, new_env2) \ -ENTRYSTRING_(BOX64_ENV3, new_env3) \ -ENTRYSTRING_(BOX64_ENV4, new_env4) \ -ENTRYBOOL(BOX64_RESERVE_HIGH, new_reserve_high) \ - -#ifdef HAVE_TRACE -#define SUPER2() \ -ENTRYSTRING_(BOX64_TRACE, trace) \ -ENTRYULONG(BOX64_TRACE_START, start_cnt) \ -ENTRYSTRING_(BOX64_TRACE_INIT, trace_init) \ -ENTRYBOOL(BOX64_TRACE_XMM, trace_xmm) \ -ENTRYBOOL(BOX64_TRACE_EMM, trace_emm) \ -ENTRYBOOL(BOX64_TRACE_COLOR, trace_regsdiff) \ - -#else -#define SUPER2() \ -IGNORE(BOX64_TRACE) \ -IGNORE(BOX64_TRACE_START) \ -IGNORE(BOX64_TRACE_INIT) \ -IGNORE(BOX64_TRACE_XMM) \ -IGNORE(BOX64_TRACE_EMM) \ -IGNORE(BOX64_TRACE_COLOR) \ - -#endif - -#ifdef DYNAREC -#define SUPER3() \ -ENTRYBOOL(BOX64_DYNAREC, box64_dynarec) \ -ENTRYINT(BOX64_DYNAREC_DUMP, box64_dynarec_dump, 0, 2, 2) \ -ENTRYINT(BOX64_DYNAREC_LOG, box64_dynarec_log, 0, 3, 2) \ -ENTRYINT(BOX64_DYNAREC_BIGBLOCK, box64_dynarec_bigblock, 0, 3, 2) \ -ENTRYSTRING_(BOX64_DYNAREC_FORWARD, box64_dynarec_forward) \ -ENTRYINT(BOX64_DYNAREC_STRONGMEM, box64_dynarec_strongmem, 0, 4, 3) \ -ENTRYBOOL(BOX64_DYNAREC_X87DOUBLE, box64_dynarec_x87double) \ -ENTRYBOOL(BOX64_DYNAREC_DIV0, box64_dynarec_div0) \ -ENTRYBOOL(BOX64_DYNAREC_FASTNAN, box64_dynarec_fastnan) \ -ENTRYBOOL(BOX64_DYNAREC_FASTROUND, box64_dynarec_fastround) \ -ENTRYINT(BOX64_DYNAREC_SAFEFLAGS, box64_dynarec_safeflags, 0, 2, 2) \ -ENTRYBOOL(BOX64_DYNAREC_CALLRET, box64_dynarec_callret) \ -ENTRYBOOL(BOX64_DYNAREC_BLEEDING_EDGE, box64_dynarec_bleeding_edge) \ -ENTRYBOOL(BOX64_DYNAREC_JVM, box64_dynarec_jvm) \ -ENTRYBOOL(BOX64_DYNAREC_TBB, box64_dynarec_tbb) \ -IGNORE(BOX64_DYNAREC_HOTPAGE) \ -IGNORE(BOX64_DYNAREC_FASTPAGE) \ -ENTRYBOOL(BOX64_DYNAREC_ALIGNED_ATOMICS, box64_dynarec_aligned_atomics) \ -ENTRYBOOL(BOX64_DYNAREC_WAIT, box64_dynarec_wait) \ -ENTRYSTRING_(BOX64_NODYNAREC, box64_nodynarec) \ -ENTRYSTRING_(BOX64_DYNAREC_TEST, box64_dynarec_test) \ -ENTRYBOOL(BOX64_DYNAREC_MISSING, box64_dynarec_missing) \ - -#else -#define SUPER3() \ -IGNORE(BOX64_DYNAREC) \ -IGNORE(BOX64_DYNAREC_DUMP) \ -IGNORE(BOX64_DYNAREC_LOG) \ -IGNORE(BOX64_DYNAREC_BIGBLOCK) \ -IGNORE(BOX64_DYNAREC_FORWARD) \ -IGNORE(BOX64_DYNAREC_STRONGMEM) \ -IGNORE(BOX64_DYNAREC_X87DOUBLE) \ -IGNORE(BOX64_DYNAREC_DIV0) \ -IGNORE(BOX64_DYNAREC_FASTNAN) \ -IGNORE(BOX64_DYNAREC_FASTROUND) \ -IGNORE(BOX64_DYNAREC_SAFEFLAGS) \ -IGNORE(BOX64_DYNAREC_CALLRET) \ -IGNORE(BOX64_DYNAREC_BLEEDING_EDGE) \ -IGNORE(BOX64_DYNAREC_JVM) \ -IGNORE(BOX64_DYNAREC_TBB) \ -IGNORE(BOX64_DYNAREC_HOTPAGE) \ -IGNORE(BOX64_DYNAREC_FASTPAGE) \ -IGNORE(BOX64_DYNAREC_ALIGNED_ATOMICS) \ -IGNORE(BOX64_DYNAREC_WAIT) \ -IGNORE(BOX64_NODYNAREC) \ -IGNORE(BOX64_DYNAREC_TEST) \ -IGNORE(BOX64_DYNAREC_MISSING) \ - -#endif - -#if defined(HAVE_TRACE) && defined(DYNAREC) -#define SUPER4() \ -ENTRYBOOL(BOX64_DYNAREC_TRACE, box64_dynarec_trace) \ - -#else -#define SUPER4() \ -IGNORE(BOX64_DYNAREC_TRACE) \ - -#endif - -#define SUPER() \ -SUPER1() \ -SUPER2() \ -SUPER3() \ -SUPER4() - -typedef struct my_params_s { -// is present part -#define ENTRYBOOL(NAME, name) uint8_t is_##name##_present:1; -#define CENTRYBOOL(NAME, name) uint8_t is_##name##_present:1; -#define ENTRYINT(NAME, name, minval, maxval, bits) uint8_t is_##name##_present:1; -#define ENTRYINTPOS(NAME, name) uint8_t is_##name##_present:1; -#define ENTRYSTRING(NAME, name) uint8_t is_##name##_present:1; -#define ENTRYSTRING_(NAME, name) uint8_t is_##name##_present:1; -#define ENTRYDSTRING(NAME, name) uint8_t is_##name##_present:1; -#define ENTRYADDR(NAME, name) uint8_t is_##name##_present:1; -#define ENTRYULONG(NAME, name) uint8_t is_##name##_present:1; -#define IGNORE(NAME) -SUPER() -// done -#undef ENTRYBOOL -#undef CENTRYBOOL -#undef ENTRYINT -#undef ENTRYINTPOS -#undef ENTRYSTRING -#undef ENTRYSTRING_ -#undef ENTRYDSTRING -#undef ENTRYADDR -#undef ENTRYULONG -// the actual fields, in two steps to regroup bit fields together -#define ENTRYBOOL(NAME, name) uint8_t name:1; -#define CENTRYBOOL(NAME, name) uint8_t name:1; -#define ENTRYINT(NAME, name, minval, maxval, bits) uint8_t name:bits; -#define ENTRYINTPOS(NAME, name) -#define ENTRYSTRING(NAME, name) -#define ENTRYSTRING_(NAME, name) -#define ENTRYDSTRING(NAME, name) -#define ENTRYADDR(NAME, name) -#define ENTRYULONG(NAME, name) -SUPER() -// done -#undef ENTRYBOOL -#undef CENTRYBOOL -#undef ENTRYINT -#undef ENTRYINTPOS -#undef ENTRYSTRING -#undef ENTRYSTRING_ -#undef ENTRYDSTRING -#undef ENTRYADDR -#undef ENTRYULONG -#define ENTRYBOOL(NAME, name) -#define CENTRYBOOL(NAME, name) -#define ENTRYINT(NAME, name, minval, maxval, bits) -#define ENTRYINTPOS(NAME, name) uint32_t name; -#define ENTRYSTRING(NAME, name) char* name; -#define ENTRYSTRING_(NAME, name) char* name; -#define ENTRYDSTRING(NAME, name) char* name; -#define ENTRYADDR(NAME, name) uintptr_t name; -#define ENTRYULONG(NAME, name) uint64_t name; -SUPER() -// done -#undef ENTRYBOOL -#undef CENTRYBOOL -#undef ENTRYINT -#undef ENTRYINTPOS -#undef ENTRYSTRING -#undef ENTRYSTRING_ -#undef ENTRYDSTRING -#undef ENTRYADDR -#undef ENTRYULONG -} my_params_t; - -KHASH_MAP_INIT_STR(params, my_params_t) - -static kh_params_t *params = NULL; - -static void clearParam(my_params_t* param) -{ - #define ENTRYBOOL(NAME, name) - #define CENTRYBOOL(NAME, name) - #define ENTRYINT(NAME, name, minval, maxval, bits) - #define ENTRYINTPOS(NAME, name) - #define ENTRYSTRING(NAME, name) free(param->name); - #define ENTRYSTRING_(NAME, name) free(param->name); - #define ENTRYDSTRING(NAME, name) free(param->name); - #define ENTRYADDR(NAME, name) - #define ENTRYULONG(NAME, name) - SUPER() - #undef ENTRYBOOL - #undef CENTRYBOOL - #undef ENTRYINT - #undef ENTRYINTPOS - #undef ENTRYSTRING - #undef ENTRYSTRING_ - #undef ENTRYDSTRING - #undef ENTRYADDR - #undef ENTRYULONG -} - -static void addParam(const char* name, my_params_t* param) -{ - khint_t k; - k = kh_get(params, params, name); - if(k==kh_end(params)) { - int ret; - k = kh_put(params, params, box_strdup(name), &ret); - } else { - clearParam(&kh_value(params, k)); - } - my_params_t *p = &kh_value(params, k); - memcpy(p, param, sizeof(my_params_t)); -} - -static void trimString(char* s) -{ - if(!s) - return; - // trim right space/tab - size_t len = strlen(s); - while(len && (s[len-1]==' ' || s[len-1]=='\t' || s[len-1]=='\n')) - s[--len] = '\0'; - // trim left space/tab - while(s[0]==' ' || s[0]=='\t') - memmove(s, s+1, strlen(s)); -} - -#ifdef ANDROID -static int shm_open(const char *name, int oflag, mode_t mode) { - return -1; -} -static int shm_unlink(const char *name) { - return -1; -} -#endif - -void LoadRCFile(const char* filename) -{ - FILE *f = NULL; - if(filename) - f = fopen(filename, "r"); - else { - #define TMP_MEMRCFILE "/box64_rcfile" - int tmp = shm_open(TMP_MEMRCFILE, O_RDWR | O_CREAT, S_IRWXU); - if(tmp<0) return; // error, bye bye - shm_unlink(TMP_MEMRCFILE); // remove the shm file, but it will still exist because it's currently in use - int dummy = write(tmp, default_rcfile, sizeof(default_rcfile)); - (void)dummy; - lseek(tmp, 0, SEEK_SET); - f = fdopen(tmp, "r"); - } - if(!f) { - printf_log(LOG_INFO, "Cannot open RC file %s\n", filename); - return; - } - // init the hash table if needed - if(!params) - params = kh_init(params); - // prepare to parse the file - char* line = NULL; - size_t lsize = 0; - my_params_t current_param = {0}; - char* current_name = NULL; - int dummy; - size_t len; - char* p; - // parsing - while ((dummy = getline(&line, &lsize, f)) != -1) { - // remove comments - if((p=strchr(line, '#'))) - *p = '\0'; - trimString(line); - len = strlen(line); - // check the line content - if(line[0]=='[' && strchr(line, ']')) { - // new entry, will need to add current one - if(current_name) - addParam(current_name, ¤t_param); - // prepare a new entry - memset(¤t_param, 0, sizeof(current_param)); - free(current_name); - current_name = LowerCase(line+1); - *strchr(current_name, ']') = '\0'; - trimString(current_name); - } else if(strchr(line, '=')) { - // actual parameters - //get the key and val - char* key = line; - char* val = strchr(key, '=')+1; - *strchr(key, '=') = '\0'; - trimString(key); - trimString(val); - // extract, check and set arg - #define ENTRYINT(NAME, name, minval, maxval, bits) \ - else if(!strcmp(key, #NAME)) { \ - int v = strtol(val, &p, 0); \ - if(p!=val && v>=minval && v<=maxval) { \ - current_param.is_##name##_present = 1; \ - current_param.name = v; \ - } \ - } - #define ENTRYBOOL(NAME, name) ENTRYINT(NAME, name, 0, 1, 1) - #define CENTRYBOOL(NAME, name) ENTRYBOOL(NAME, name) - #define ENTRYINTPOS(NAME, name) \ - else if(!strcmp(key, #NAME)) { \ - int v = strtol(val, &p, 0); \ - if(p!=val) { \ - current_param.is_##name##_present = 1; \ - current_param.name = v; \ - } \ - } - #define ENTRYSTRING(NAME, name) \ - else if(!strcmp(key, #NAME)) { \ - current_param.is_##name##_present = 1; \ - if(current_param.name) free(current_param.name); \ - current_param.name = box_strdup(val); \ - } - #define ENTRYSTRING_(NAME, name) ENTRYSTRING(NAME, name) - #define ENTRYDSTRING(NAME, name) ENTRYSTRING(NAME, name) - #define ENTRYADDR(NAME, name) \ - else if(!strcmp(key, #NAME)) { \ - uintptr_t v = strtoul(val, &p, 0); \ - if(p!=val) { \ - current_param.is_##name##_present = 1; \ - current_param.name = v; \ - } \ - } - #define ENTRYULONG(NAME, name) \ - else if(!strcmp(key, #NAME)) { \ - uint64_t v = strtoull(val, &p, 0); \ - if(p!=val) { \ - current_param.is_##name##_present = 1; \ - current_param.name = v; \ - } \ - } - #undef IGNORE - #define IGNORE(NAME) else if(!strcmp(key, #NAME)) ; - if(0) ; - SUPER() - else if(len && current_name) { - printf_log(LOG_INFO, "Warning, unsupported %s=%s for [%s] in %s\n", key, val, current_name, filename); - } - #undef ENTRYBOOL - #undef CENTRYBOOL - #undef ENTRYINT - #undef ENTRYINTPOS - #undef ENTRYSTRING - #undef ENTRYSTRING_ - #undef ENTRYDSTRING - #undef ENTRYADDR - #undef ENTRYULONG - #undef IGNORE - #define IGNORE(NAME) - } - } - // last entry to be pushed too - if(current_name) { - addParam(current_name, ¤t_param); - free(current_name); - } - free(line); - fclose(f); - printf_log(LOG_INFO, "Params database has %d entries\n", kh_size(params)); -} - -void DeleteParams() -{ - if(!params) - return; - - // free strings - my_params_t* p; - // need to free duplicated strings - kh_foreach_value_ref(params, p, clearParam(p)); - const char* key; - kh_foreach_key(params, key, free((void*)key)); - // free the hash itself - kh_destroy(params, params); - params = NULL; -} - -extern int ftrace_has_pid; -extern FILE* ftrace; -extern char* ftrace_name; -void openFTrace(const char* newtrace); -void addNewEnvVar(const char* s); -void AddNewLibs(const char* libs); -void computeRDTSC(); -void my_reserveHighMem(); -#ifdef DYNAREC -void GatherDynarecExtensions(); -#endif -#ifdef HAVE_TRACE -void setupTraceInit(); -void setupTrace(); -#endif -static char old_name[256] = ""; -const char* GetLastApplyName() -{ - return old_name; -} -void ApplyParams(const char* name) -{ - if(!name || !params) - return; - int new_cycle_log = cycle_log; - int new_maxcpu = box64_maxcpu; - int new_avx = box64_avx2?2:box64_avx; - int box64_dynarec_jvm = box64_jvm; - int new_reserve_high = 0; - if(!strcmp(name, old_name)) { - return; - } - strncpy(old_name, name, 255); - khint_t k; - { - char* lname = LowerCase(name); - k = kh_get(params, params, lname); - free(lname); - } - if(k == kh_end(params)) - return; - my_params_t* param = &kh_value(params, k); - int want_exit = 0; - #ifdef DYNAREC - int olddynarec = box64_dynarec; - #endif - printf_log(LOG_INFO, "Apply RC params for %s\n", name); - #define ENTRYINT(NAME, name, minval, maxval, bits) if(param->is_##name##_present) {name = param->name; printf_log(LOG_INFO, "Applying %s=%d\n", #NAME, param->name);} - #define ENTRYBOOL(NAME, name) ENTRYINT(NAME, name, 0, 1, 1) - #define CENTRYBOOL(NAME, name) if(param->is_##name##_present) {my_context->name = param->name; printf_log(LOG_INFO, "Applying %s=%d\n", #NAME, param->name);} - #define ENTRYINTPOS(NAME, name) if(param->is_##name##_present) {name = param->name; printf_log(LOG_INFO, "Applying %s=%d\n", #NAME, param->name);} - #define ENTRYSTRING(NAME, name) if(param->is_##name##_present) {name = param->name; printf_log(LOG_INFO, "Applying %s=%s\n", #NAME, param->name);} - #define ENTRYSTRING_(NAME, name) - #define ENTRYDSTRING(NAME, name) if(param->is_##name##_present) {if(name) free(name); name = box_strdup(param->name); printf_log(LOG_INFO, "Applying %s=%s\n", #NAME, param->name);} - #define ENTRYADDR(NAME, name) if(param->is_##name##_present) {name = param->name; printf_log(LOG_INFO, "Applying %s=%zd\n", #NAME, param->name);} - #define ENTRYULONG(NAME, name) if(param->is_##name##_present) {name = param->name; printf_log(LOG_INFO, "Applying %s=%lld\n", #NAME, param->name);} - SUPER() - #undef ENTRYBOOL - #undef CENTRYBOOL - #undef ENTRYINT - #undef ENTRYINTPOS - #undef ENTRYSTRING - #undef ENTRYSTRING_ - #undef ENTRYDSTRING - #undef ENTRYADDR - #undef ENTRYULONG - // now handle the manuel entry (the one with ending underscore) - if(want_exit) - exit(0); - if(new_cycle_log==1) - new_cycle_log = 16; - if(new_cycle_log!=cycle_log) { - freeCycleLog(my_context); - cycle_log = new_cycle_log; - initCycleLog(my_context); - } - if(new_reserve_high) - my_reserveHighMem(); - if(param->is_new_avx_present) { - if(!new_avx) { - printf_log(LOG_INFO, "Hidding AVX extension\n"); - box64_avx = 0; box64_avx2 = 0; - } else if(new_avx==1) { - printf_log(LOG_INFO, "Exposing AVX extension\n"); - box64_avx = 1; box64_avx2 = 0; - } else if(new_avx==2) { - printf_log(LOG_INFO, "Exposing AVX/AVX2 extensions\n"); - box64_avx = 1; box64_avx2 = 1; - } - } - if(param->is_box64_rdtsc_1ghz_present) - computeRDTSC(); - #ifdef DYNAREC - if(param->is_box64_dynarec_jvm_present && !param->is_box64_jvm_present) - box64_jvm = box64_dynarec_jvm; - #endif - if(!box64_maxcpu_immutable) { - if(new_maxcpu!=box64_maxcpu && box64_maxcpu && box64_maxcpuis_ld_library_path_present) AppendList(&my_context->box64_ld_lib, param->ld_library_path, 1); - if(param->is_box64_path_present) AppendList(&my_context->box64_path, param->box64_path, 1); - if(param->is_trace_file_present) { - // open a new ftrace... - printf_log(LOG_INFO, "Applying %s=%s\n", "BOX64_TRACE_FILE", param->trace_file); - if(ftrace_name) { - fclose(ftrace); - } - openFTrace(param->trace_file); - } - if(param->is_emulated_libs_present) { - AppendList(&my_context->box64_emulated_libs, param->emulated_libs, 0); - printf_log(LOG_INFO, "Applying %s=%s\n", "BOX64_EMULATED_LIBS", param->emulated_libs); - } - if(param->is_new_addlibs_present) { - AddNewLibs(param->new_addlibs); - } - if(param->is_new_env_present) { - addNewEnvVar(param->new_env); - printf_log(LOG_INFO, "Applying %s=%s\n", "BOX64_ENV", param->new_env); - } - if(param->is_new_env1_present) { - addNewEnvVar(param->new_env1); - printf_log(LOG_INFO, "Applying %s=%s\n", "BOX64_ENV1", param->new_env1); - } - if(param->is_new_env2_present) { - addNewEnvVar(param->new_env2); - printf_log(LOG_INFO, "Applying %s=%s\n", "BOX64_ENV2", param->new_env2); - } - if(param->is_new_env3_present) { - addNewEnvVar(param->new_env3); - printf_log(LOG_INFO, "Applying %s=%s\n", "BOX64_ENV3", param->new_env3); - } - if(param->is_new_env4_present) { - addNewEnvVar(param->new_env4); - printf_log(LOG_INFO, "Applying %s=%s\n", "BOX64_ENV4", param->new_env4); - } - if(param->is_bash_present && FileIsX64ELF(param->bash)) { - if(my_context->bashpath) - free(my_context->bashpath); - my_context->bashpath = box_strdup(param->bash); - printf_log(LOG_INFO, "Applying %s=%s\n", "BOX64_BASH", param->bash); - } - #ifdef HAVE_TRACE - int old_x64trace = my_context->x64trace; - if(param->is_trace_present) { - char*p = param->trace; - if (strcmp(p, "0")) { - my_context->x64trace = 1; - box64_trace = p; - } - printf_log(LOG_INFO, "Applying %s=%s\n", "BOX64_TRACE", param->trace); - } - if(param->is_trace_init_present) { - char* p = param->trace_init; - if (strcmp(p, "0")) { - my_context->x64trace = 1; - trace_init = p; - } - printf_log(LOG_INFO, "Applying %s=%s\n", "BOX64_TRACE_INIT", param->trace_init); - } - if(my_context->x64trace && !old_x64trace) { - printf_log(LOG_INFO, "Initializing Zydis lib\n"); - if(InitX64Trace(my_context)) { - printf_log(LOG_INFO, "Zydis init failed, no x86 trace activated\n"); - my_context->x64trace = 0; - } - } - if(param->is_trace_init_present) - setupTraceInit(); - if(param->is_trace_present) - setupTrace(); - #endif - #ifdef DYNAREC - if(param->is_box64_nodynarec_present) { - uintptr_t no_start = 0, no_end = 0; - int ok = 0; - if(sscanf(param->box64_nodynarec, "0x%lX-0x%lX", &no_start, &no_end)==2) - ok = 1; - if(!ok && sscanf(param->box64_nodynarec, "%lx-%lx", &no_start, &no_end)==2) - ok = 1; - if(!ok && sscanf(param->box64_nodynarec, "%ld-%ld", &no_start, &no_end)==2) - ok = 1; - if(ok && no_end>no_start) { - box64_nodynarec_start = no_start; - box64_nodynarec_end = no_end; - printf_log(LOG_INFO, "Appling BOX64_NODYNAREC=%p-%p\n", (void*)box64_nodynarec_start, (void*)box64_nodynarec_end); - } else { - printf_log(LOG_INFO, "Ignoring BOX64_NODYNAREC=%s (%p-%p)\n", param->box64_nodynarec, (void*)box64_nodynarec_start, (void*)box64_nodynarec_end); - } - } - if(param->is_box64_dynarec_test_present) { - uintptr_t no_start = 0, no_end = 0; - if(strlen(param->box64_dynarec_test)==1) { - box64_dynarec_test = param->box64_dynarec_test[0]-'0'; - box64_dynarec_test_start = 0x0; - box64_dynarec_test_end = 0x0; - if(box64_dynarec_test>2) box64_dynarec_test = 0; - } else { - int ok = 0; - if(sscanf(param->box64_dynarec_test, "0x%lX-0x%lX", &no_start, &no_end)==2) - ok = 1; - if(!ok && sscanf(param->box64_dynarec_test, "%lx-%lx", &no_start, &no_end)==2) - ok = 1; - if(!ok && sscanf(param->box64_dynarec_test, "%ld-%ld", &no_start, &no_end)==2) - ok = 1; - if(ok && no_end>no_start) { - box64_dynarec_test = 1; - box64_dynarec_test_start = no_start; - box64_dynarec_test_end = no_end; - printf_log(LOG_INFO, "Appling BOX64_DYNAREC_TEST=%p-%p\n", (void*)box64_dynarec_test_start, (void*)box64_dynarec_test_end); - } else { - box64_dynarec_test = 0; - printf_log(LOG_INFO, "Ignoring BOX64_DYNAREC_TEST=%s (%p-%p)\n", param->box64_dynarec_test, (void*)box64_dynarec_test_start, (void*)box64_dynarec_test_end); - } - } - } - if(param->is_box64_dynarec_forward_present) { - int forward = 0; - if(sscanf(param->box64_dynarec_forward, "%d", &forward)==1) { - box64_dynarec_forward = forward; - printf_log(LOG_INFO, "Appling BOX64_DYNAREC_FORWARD=%d\n", box64_dynarec_forward); - } - } - if(!olddynarec && box64_dynarec) - GatherDynarecExtensions(); - if(param->is_box64_dynarec_test_present && box64_dynarec_test) { - box64_dynarec_fastnan = 0; - box64_dynarec_fastround = 0; - box64_dynarec_x87double = 1; - box64_dynarec_div0 = 1; - box64_dynarec_callret = 0; - } - #endif - if(box64_log==3) { - box64_log = 2; - box64_dump = 1; - } -} diff --git a/src/tools/wine_tools.c b/src/tools/wine_tools.c index 0933325..1d89f2a 100644 --- a/src/tools/wine_tools.c +++ b/src/tools/wine_tools.c @@ -15,7 +15,14 @@ typedef struct wine_prereserve_s void* addr; size_t size; } wine_prereserve_t; - +#ifdef BOX32 +typedef struct wine_prereserve_32_s +{ + ptr_t addr; + ulong_t size; +} wine_prereserve_32_t; +#include "box32.h" +#endif // only the prereseve argument is reserved, not the other zone that wine-preloader reserve static wine_prereserve_t my_wine_reserve[] = {{(void*)0x00010000, 0x00008000}, {(void*)0x00110000, 0x30000000}, {(void*)0x7f000000, 0x03000000}, {0, 0}, {0, 0}}; @@ -33,7 +40,7 @@ static int get_prereserve(const char* reserve, void** addr, size_t* size) else if(*reserve>='A' && *reserve<='F') r=r*16+(*reserve)-'A'+10; else if(*reserve>='a' && *reserve<='f') r=r*16+(*reserve)-'a'+10; else if(*reserve=='-') {if(first) {*addr=(void*)(r&~(box64_pagesize-1)); r=0; first=0;} else {printf_log(LOG_NONE, "Warning, Wine prereserve badly formatted\n"); return 0;}} - else {printf_log(LOG_NONE, "Warning, Wine prereserve badly formatted\n"); return 0;} + else {printf_log(LOG_INFO, "Warning, Wine prereserve badly formatted\n"); return 0;} ++reserve; } *size = r; @@ -57,6 +64,16 @@ static void add_no_overlap(void* addr, size_t size) my_wine_reserve[idx].size = size; } +static void remove_prereserve(int idx) +{ + while(my_wine_reserve[idx].size) { + my_wine_reserve[idx].addr = my_wine_reserve[idx+1].addr; + my_wine_reserve[idx].size = my_wine_reserve[idx+1].size; + ++idx; + } +} + +void preserve_highest32(); void wine_prereserve(const char* reserve) { init_custommem_helper(my_context); @@ -69,17 +86,24 @@ void wine_prereserve(const char* reserve) int idx = 0; while(my_wine_reserve[idx].addr && my_wine_reserve[idx].size) { - if(!isBlockFree(my_wine_reserve[idx].addr, my_wine_reserve[idx].size)) { - printf_log(LOG_NONE, "Warning, prereserve of %p:0x%lx is not free\n", my_wine_reserve[idx].addr, my_wine_reserve[idx].size); - my_wine_reserve[idx].addr = NULL; - my_wine_reserve[idx].size = 0; + void* ret = NULL; + int isfree = isBlockFree(my_wine_reserve[idx].addr, my_wine_reserve[idx].size); + if(isfree) ret=mmap(my_wine_reserve[idx].addr, my_wine_reserve[idx].size, 0, MAP_FIXED|MAP_PRIVATE|MAP_ANON|MAP_NORESERVE, -1, 0); else ret = NULL; + if(!isfree || (ret!=my_wine_reserve[idx].addr)) { + if(addr>=(void*)0x10000LL) + printf_log(LOG_INFO, "Warning, prereserve of %p:0x%lx is not free\n", my_wine_reserve[idx].addr, my_wine_reserve[idx].size); + if(ret) + munmap(ret, my_wine_reserve[idx].size); + remove_prereserve(idx); } else { setProtection_mmap((uintptr_t)my_wine_reserve[idx].addr, my_wine_reserve[idx].size, 0); - printf_log(LOG_DEBUG, "WINE prereserve of %p:0x%lx done\n", my_wine_reserve[idx].addr, my_wine_reserve[idx].size); + printf_log(/*LOG_DEBUG*/LOG_INFO, "WINE prereserve of %p:0x%lx done\n", my_wine_reserve[idx].addr, my_wine_reserve[idx].size); ++idx; } } + preserve_highest32(); + wine_preloaded = 1; } @@ -87,7 +111,17 @@ void* get_wine_prereserve() { if(!wine_preloaded) wine_prereserve(NULL); - return (void*)my_wine_reserve; + #ifdef BOX32 + if(box64_is32bits) { + static wine_prereserve_32_t my_wine_reserve_32[5]; + for(int i=0; i<5; ++i) { + my_wine_reserve_32[i].addr = to_ptrv(my_wine_reserve[i].addr); + my_wine_reserve_32[i].size = to_ulong(my_wine_reserve[i].size); + } + return &my_wine_reserve_32; + } else + #endif + return &my_wine_reserve; } #ifdef DYNAREC @@ -104,3 +138,18 @@ void dynarec_wine_prereserve() #endif } #endif + +void DetectUnityPlayer(char* filename) +{ + static int unityplayer_detected = 0; + if (filename && BOX64ENV(unityplayer) && !unityplayer_detected && !strcmp(filename, "unityplayer.dll")) { + printf_log(LOG_INFO, "Detected UnityPlayer.dll\n"); +#ifdef DYNAREC + if (!BOX64ENV(unity)) { + SET_BOX64ENV(unity, 1); + PrintEnvVariables(&box64env, LOG_INFO); + } +#endif + unityplayer_detected = 1; + } +} diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt deleted file mode 100644 index 96915cb..0000000 --- a/src/wrapped/generated/functions_list.txt +++ /dev/null @@ -1,5767 +0,0 @@ -#() vFE -#() vFv -#() vFc -#() vFw -#() vFi -#() vFC -#() vFW -#() vFu -#() vFU -#() vFf -#() vFd -#() vFl -#() vFL -#() vFp -#() vFS -#() vFb -#() cFv -#() cFi -#() cFu -#() cFf -#() cFp -#() wFp -#() iFE -#() iFv -#() iFw -#() iFi -#() iFI -#() iFC -#() iFW -#() iFu -#() iFU -#() iFf -#() iFd -#() iFD -#() iFl -#() iFL -#() iFp -#() iFO -#() iFS -#() iFP -#() iFb -#() IFv -#() IFi -#() IFI -#() IFf -#() IFd -#() IFp -#() CFv -#() CFi -#() CFC -#() CFW -#() CFu -#() CFl -#() CFL -#() CFp -#() WFi -#() WFW -#() WFu -#() WFp -#() uFv -#() uFi -#() uFu -#() uFd -#() uFl -#() uFL -#() uFp -#() uFb -#() UFv -#() UFu -#() UFp -#() fFi -#() fFf -#() fFp -#() dFv -#() dFi -#() dFu -#() dFd -#() dFL -#() dFp -#() lFE -#() lFv -#() lFi -#() lFu -#() lFl -#() lFp -#() LFv -#() LFi -#() LFu -#() LFd -#() LFL -#() LFp -#() pFE -#() pFv -#() pFw -#() pFi -#() pFC -#() pFW -#() pFu -#() pFU -#() pFd -#() pFl -#() pFL -#() pFp -#() pFV -#() pFA -#() pFb -#() HFi -#() HFp -#() xFx -#() XFX -#() vWp -#() iWp -#() uWp -#() fWp -#() vFEi -#() vFEp -#() vFcc -#() vFww -#() vFii -#() vFiW -#() vFiu -#() vFiU -#() vFif -#() vFid -#() vFil -#() vFiL -#() vFip -#() vFWW -#() vFWp -#() vFuc -#() vFuw -#() vFui -#() vFuC -#() vFuW -#() vFuu -#() vFuU -#() vFuf -#() vFud -#() vFul -#() vFuL -#() vFup -#() vFUi -#() vFfi -#() vFfC -#() vFff -#() vFfp -#() vFdd -#() vFlu -#() vFlp -#() vFLu -#() vFLL -#() vFLp -#() vFpc -#() vFpi -#() vFpI -#() vFpC -#() vFpW -#() vFpu -#() vFpU -#() vFpf -#() vFpd -#() vFpl -#() vFpL -#() vFpp -#() vFpV -#() vFpS -#() vFSi -#() vFbi -#() vFbu -#() vFbU -#() vFbp -#() cFpi -#() cFpp -#() wFpi -#() iFEi -#() iFEf -#() iFEd -#() iFEL -#() iFEp -#() iFwp -#() iFii -#() iFiI -#() iFiC -#() iFiu -#() iFil -#() iFiL -#() iFip -#() iFiS -#() iFui -#() iFuu -#() iFuL -#() iFup -#() iFUp -#() iFli -#() iFlp -#() iFLi -#() iFLu -#() iFLL -#() iFLp -#() iFpw -#() iFpi -#() iFpI -#() iFpC -#() iFpW -#() iFpu -#() iFpU -#() iFpf -#() iFpd -#() iFpl -#() iFpL -#() iFpp -#() iFpO -#() iFSi -#() IFEi -#() IFEf -#() IFEd -#() IFEp -#() IFip -#() IFII -#() IFpi -#() IFpu -#() IFpd -#() IFpp -#() CFip -#() CFCi -#() CFui -#() CFuW -#() CFuu -#() CFuL -#() CFpi -#() CFpu -#() CFpL -#() CFpp -#() WFpi -#() WFpp -#() uFEp -#() uFii -#() uFiu -#() uFip -#() uFui -#() uFuu -#() uFup -#() uFuM -#() uFpw -#() uFpi -#() uFpC -#() uFpu -#() uFpU -#() uFpf -#() uFpl -#() uFpL -#() uFpp -#() uFbu -#() UFEp -#() UFuu -#() UFUp -#() UFpi -#() UFpU -#() UFpp -#() fFEf -#() fFEp -#() fFif -#() fFfi -#() fFff -#() fFfD -#() fFfp -#() fFpu -#() fFpp -#() fFbu -#() dFEd -#() dFid -#() dFdi -#() dFdd -#() dFdD -#() dFdp -#() dFll -#() dFpi -#() dFpu -#() dFpd -#() dFpp -#() DFDi -#() DFDD -#() DFDp -#() DFpp -#() lFEi -#() lFii -#() lFip -#() lFui -#() lFll -#() lFpi -#() lFpd -#() lFpl -#() lFpp -#() LFEL -#() LFEp -#() LFii -#() LFuu -#() LFUp -#() LFLi -#() LFLL -#() LFLp -#() LFpi -#() LFpu -#() LFpL -#() LFpp -#() pFEi -#() pFEL -#() pFEp -#() pFii -#() pFiI -#() pFiu -#() pFip -#() pFiV -#() pFui -#() pFuu -#() pFup -#() pFUU -#() pFdi -#() pFdd -#() pFli -#() pFll -#() pFlp -#() pFLi -#() pFLC -#() pFLu -#() pFLL -#() pFLp -#() pFpi -#() pFpC -#() pFpW -#() pFpu -#() pFpU -#() pFpd -#() pFpl -#() pFpL -#() pFpp -#() pFSi -#() pFbC -#() pFbu -#() pFbp -#() HFII -#() HFll -#() HFpi -#() HFpp -#() xFxx -#() XFXX -#() iWpi -#() iWpu -#() iWpf -#() iWpp -#() uWpu -#() pWEp -#() pWpu -#() vFEpi -#() vFEpu -#() vFEpp -#() vFEpV -#() vFEpA -#() vFccc -#() vFwww -#() vFiii -#() vFiif -#() vFiip -#() vFiui -#() vFiuu -#() vFiuU -#() vFiup -#() vFiff -#() vFidd -#() vFilu -#() vFill -#() vFilp -#() vFiLL -#() vFipi -#() vFipu -#() vFipL -#() vFipp -#() vFCCC -#() vFWWW -#() vFucc -#() vFuww -#() vFuii -#() vFuiu -#() vFuiU -#() vFuif -#() vFuid -#() vFuil -#() vFuiL -#() vFuip -#() vFuWW -#() vFuui -#() vFuuC -#() vFuuu -#() vFuuU -#() vFuuf -#() vFuud -#() vFuuL -#() vFuup -#() vFuff -#() vFufp -#() vFudd -#() vFull -#() vFulp -#() vFuLL -#() vFuLp -#() vFupu -#() vFupp -#() vFfff -#() vFfpp -#() vFddd -#() vFdpp -#() vFlii -#() vFlip -#() vFllp -#() vFlpp -#() vFLup -#() vFLpL -#() vFLpp -#() vFpic -#() vFpii -#() vFpiI -#() vFpiC -#() vFpiu -#() vFpiU -#() vFpif -#() vFpid -#() vFpiL -#() vFpip -#() vFpui -#() vFpuI -#() vFpuW -#() vFpuu -#() vFpuU -#() vFpuf -#() vFpud -#() vFpuL -#() vFpup -#() vFpUi -#() vFpUu -#() vFpUU -#() vFpUf -#() vFpUp -#() vFpff -#() vFpdu -#() vFpdd -#() vFpdp -#() vFpll -#() vFplp -#() vFpLi -#() vFpLu -#() vFpLL -#() vFpLp -#() vFppi -#() vFppu -#() vFppU -#() vFppf -#() vFppd -#() vFppl -#() vFppL -#() vFppp -#() vFppV -#() cFpdp -#() wFppp -#() iFEiw -#() iFEip -#() iFEWW -#() iFEup -#() iFEUU -#() iFELp -#() iFEpi -#() iFEpU -#() iFEpL -#() iFEpp -#() iFEpV -#() iFEpA -#() iFESp -#() iFwww -#() iFwpp -#() iFiwC -#() iFiii -#() iFiiI -#() iFiiu -#() iFiil -#() iFiip -#() iFiiO -#() iFiCC -#() iFiui -#() iFiuu -#() iFiup -#() iFill -#() iFilp -#() iFiLi -#() iFiLp -#() iFiLN -#() iFipi -#() iFipu -#() iFipL -#() iFipp -#() iFipO -#() iFCuW -#() iFuwp -#() iFuip -#() iFuWp -#() iFuui -#() iFuuu -#() iFuup -#() iFuLL -#() iFuLp -#() iFupi -#() iFupu -#() iFupL -#() iFupp -#() iFfff -#() iFLip -#() iFLpp -#() iFpwp -#() iFpii -#() iFpiI -#() iFpiC -#() iFpiW -#() iFpiu -#() iFpiU -#() iFpid -#() iFpil -#() iFpiL -#() iFpip -#() iFpIi -#() iFpII -#() iFpCp -#() iFpWp -#() iFpui -#() iFpuC -#() iFpuu -#() iFpuU -#() iFpul -#() iFpuL -#() iFpup -#() iFpUu -#() iFpUU -#() iFpUp -#() iFpfu -#() iFpff -#() iFpdd -#() iFpli -#() iFpll -#() iFplp -#() iFpLi -#() iFpLu -#() iFpLl -#() iFpLL -#() iFpLp -#() iFppi -#() iFppI -#() iFppC -#() iFppW -#() iFppu -#() iFppU -#() iFppd -#() iFppl -#() iFppL -#() iFppp -#() iFpOu -#() iFpOM -#() iFSpL -#() iFbpp -#() IFiIi -#() IFpIi -#() IFppi -#() IFppI -#() IFSIi -#() CFipp -#() CFuff -#() CFuLu -#() CFppp -#() WFppp -#() uFEpW -#() uFEpu -#() uFEpU -#() uFEpp -#() uFiuu -#() uFilp -#() uFipu -#() uFipL -#() uFuii -#() uFuip -#() uFuuu -#() uFuup -#() uFufp -#() uFupu -#() uFupp -#() uFpii -#() uFpiu -#() uFpip -#() uFpCi -#() uFpWi -#() uFpWu -#() uFpWf -#() uFpWp -#() uFpui -#() uFpuu -#() uFpuL -#() uFpup -#() uFpfu -#() uFpli -#() uFpLu -#() uFpLL -#() uFpLp -#() uFppi -#() uFppu -#() uFppL -#() uFppp -#() uFbWW -#() uFbWu -#() uFbuC -#() uFbuW -#() uFbuu -#() uFbuU -#() uFbup -#() UFUii -#() UFUUU -#() UFpiU -#() UFppi -#() fFuii -#() fFfff -#() fFffp -#() fFppi -#() fFppL -#() fFppp -#() dFuud -#() dFddd -#() dFddp -#() dFpii -#() dFpdd -#() dFppi -#() dFppu -#() dFppd -#() dFppp -#() DFppi -#() DFppp -#() lFili -#() lFilL -#() lFipi -#() lFipL -#() lFlll -#() lFpli -#() lFpLu -#() lFpLp -#() lFppi -#() lFppu -#() lFppL -#() lFppp -#() lFSpl -#() LFEpA -#() LFipL -#() LFuui -#() LFLii -#() LFLLl -#() LFLLL -#() LFLpu -#() LFLpL -#() LFpii -#() LFpCi -#() LFpuL -#() LFpup -#() LFpLi -#() LFpLL -#() LFpLp -#() LFppi -#() LFppu -#() LFppL -#() LFppp -#() LFSpL -#() pFEip -#() pFEiV -#() pFEup -#() pFEuV -#() pFEpi -#() pFEpu -#() pFEpp -#() pFEpV -#() pFEpA -#() pFiii -#() pFiiu -#() pFiip -#() pFiIi -#() pFiLL -#() pFipi -#() pFipL -#() pFipp -#() pFCuW -#() pFWWW -#() pFuip -#() pFuui -#() pFuuu -#() pFulu -#() pFulp -#() pFupi -#() pFupu -#() pFupl -#() pFupL -#() pFupp -#() pFdip -#() pFdUU -#() pFddi -#() pFddd -#() pFDip -#() pFlpi -#() pFLup -#() pFLLp -#() pFLpi -#() pFLpp -#() pFpii -#() pFpiu -#() pFpid -#() pFpil -#() pFpiL -#() pFpip -#() pFpCi -#() pFpCu -#() pFpWi -#() pFpWW -#() pFpWp -#() pFpui -#() pFpuu -#() pFpuL -#() pFpup -#() pFpUi -#() pFpUu -#() pFpdu -#() pFpdd -#() pFplC -#() pFplu -#() pFpll -#() pFplp -#() pFpLi -#() pFpLu -#() pFpLL -#() pFpLp -#() pFppi -#() pFppI -#() pFppC -#() pFppu -#() pFppU -#() pFppf -#() pFppl -#() pFppL -#() pFppp -#() pFppA -#() pFpOM -#() pFpbi -#() pFSpl -#() pFbCC -#() pFbuu -#() pFbup -#() pFbUp -#() pFbpi -#() pFbpu -#() pFbpp -#() vWpup -#() iWEip -#() iWEpp -#() iWpiu -#() iWpip -#() iWpui -#() iWpuu -#() iWpup -#() iWppu -#() iWppp -#() uWpui -#() uWpup -#() vFEiip -#() vFEipp -#() vFEipV -#() vFEipA -#() vFELLp -#() vFEpii -#() vFEpip -#() vFEpiA -#() vFEpup -#() vFEpUp -#() vFEppp -#() vFEppV -#() vFEppA -#() vFcccc -#() vFwwww -#() vFiiii -#() vFiiip -#() vFiiCp -#() vFiill -#() vFiipV -#() vFiuip -#() vFiuuu -#() vFiulp -#() vFiupV -#() vFifff -#() vFiddd -#() vFilip -#() vFilll -#() vFilpu -#() vFilpp -#() vFiLLL -#() vFipii -#() vFipup -#() vFipll -#() vFippL -#() vFippp -#() vFCCCC -#() vFWWWW -#() vFuccc -#() vFuwww -#() vFuiii -#() vFuiiu -#() vFuiip -#() vFuiui -#() vFuiuC -#() vFuiuu -#() vFuiup -#() vFuifi -#() vFuiff -#() vFuidd -#() vFuill -#() vFuilp -#() vFuiLL -#() vFuipi -#() vFuipu -#() vFuipp -#() vFuWWW -#() vFuuii -#() vFuuiu -#() vFuuil -#() vFuuip -#() vFuuCu -#() vFuuCp -#() vFuuui -#() vFuuuu -#() vFuuuf -#() vFuuud -#() vFuuul -#() vFuuup -#() vFuuff -#() vFuuli -#() vFuulp -#() vFuuLl -#() vFuupi -#() vFuupp -#() vFufff -#() vFuddd -#() vFuluL -#() vFullC -#() vFulll -#() vFullp -#() vFulpi -#() vFulpu -#() vFulpp -#() vFuLui -#() vFuLup -#() vFuLLL -#() vFupii -#() vFuppi -#() vFuppu -#() vFUUpi -#() vFffff -#() vFdddd -#() vFllii -#() vFLuui -#() vFLppi -#() vFpiii -#() vFpiiu -#() vFpiid -#() vFpiip -#() vFpiui -#() vFpiuu -#() vFpiuL -#() vFpiup -#() vFpiUu -#() vFpiUU -#() vFpifi -#() vFpipi -#() vFpipu -#() vFpipp -#() vFpIdi -#() vFpCuW -#() vFpuii -#() vFpuip -#() vFpuuu -#() vFpuup -#() vFpufi -#() vFpudd -#() vFpupu -#() vFpupp -#() vFpUuu -#() vFpUup -#() vFpUUi -#() vFpUUu -#() vFpUUp -#() vFpUpp -#() vFpfff -#() vFpdii -#() vFpdup -#() vFpddu -#() vFpddd -#() vFplll -#() vFplpp -#() vFpLii -#() vFpLuu -#() vFpLLL -#() vFpLpL -#() vFpLpp -#() vFppii -#() vFppiu -#() vFppid -#() vFppil -#() vFppiL -#() vFppip -#() vFppui -#() vFppuu -#() vFppup -#() vFppfi -#() vFppff -#() vFppdu -#() vFppdd -#() vFppdp -#() vFpplp -#() vFppLL -#() vFppLp -#() vFpppi -#() vFpppu -#() vFpppd -#() vFpppl -#() vFpppL -#() vFpppp -#() cFpipp -#() iFEiip -#() iFEiiN -#() iFEipp -#() iFEipV -#() iFEipA -#() iFEupu -#() iFEupp -#() iFEpii -#() iFEpip -#() iFEpiV -#() iFEpiA -#() iFEpui -#() iFEpup -#() iFEpUi -#() iFEpUp -#() iFEpLi -#() iFEpLp -#() iFEppi -#() iFEppd -#() iFEppL -#() iFEppp -#() iFEppV -#() iFEppA -#() iFEpOu -#() iFwwww -#() iFwppp -#() iFiiii -#() iFiiiu -#() iFiiip -#() iFiiiN -#() iFiiui -#() iFiill -#() iFiipi -#() iFiipp -#() iFiWii -#() iFiuwp -#() iFiuup -#() iFiupp -#() iFilli -#() iFillu -#() iFiLpL -#() iFipii -#() iFipip -#() iFipWp -#() iFipui -#() iFipuL -#() iFipLi -#() iFipLu -#() iFipLp -#() iFippi -#() iFippu -#() iFippL -#() iFippp -#() iFipON -#() iFuiup -#() iFuipp -#() iFuWWp -#() iFuuuu -#() iFuupi -#() iFuupp -#() iFupLp -#() iFuppi -#() iFuppu -#() iFuppp -#() iFLppp -#() iFpwww -#() iFpwpp -#() iFpiii -#() iFpiiu -#() iFpiid -#() iFpiiL -#() iFpiip -#() iFpiuu -#() iFpiuL -#() iFpiup -#() iFpiUp -#() iFpild -#() iFpipi -#() iFpipu -#() iFpipL -#() iFpipp -#() iFpipV -#() iFpIip -#() iFpCCC -#() iFpCpi -#() iFpCpp -#() iFpWWu -#() iFpWpp -#() iFpuwp -#() iFpuii -#() iFpuiL -#() iFpuip -#() iFpuui -#() iFpuuu -#() iFpuul -#() iFpuuL -#() iFpuup -#() iFpuUp -#() iFpuLL -#() iFpuLp -#() iFpupi -#() iFpupC -#() iFpupu -#() iFpupU -#() iFpupL -#() iFpupp -#() iFpupV -#() iFpUip -#() iFpUup -#() iFpUUU -#() iFpULp -#() iFpUpp -#() iFpdip -#() iFplii -#() iFplip -#() iFplpi -#() iFplpp -#() iFpLii -#() iFpLiL -#() iFpLip -#() iFpLuu -#() iFpLup -#() iFpLlp -#() iFpLLu -#() iFpLLL -#() iFpLLp -#() iFpLpi -#() iFpLpf -#() iFpLpd -#() iFpLpD -#() iFpLpL -#() iFpLpp -#() iFppii -#() iFppiu -#() iFppiU -#() iFppiL -#() iFppip -#() iFppIL -#() iFppCC -#() iFppuw -#() iFppui -#() iFppuu -#() iFppuL -#() iFppup -#() iFppdd -#() iFppdp -#() iFppli -#() iFppll -#() iFpplL -#() iFpplp -#() iFppLi -#() iFppLL -#() iFppLp -#() iFpppi -#() iFpppC -#() iFpppu -#() iFpppL -#() iFpppp -#() iFbupp -#() IFEpIi -#() IFipUI -#() IFipUp -#() IFpIip -#() IFppii -#() IFppip -#() IFSIii -#() CFuuff -#() CFpiii -#() CFpLLi -#() CFppip -#() CFbupp -#() uFEipp -#() uFEupp -#() uFEpup -#() uFEppp -#() uFiiii -#() uFiiuu -#() uFifff -#() uFuuuu -#() uFpiip -#() uFpipu -#() uFpipL -#() uFpipp -#() uFpCCC -#() uFpuip -#() uFpuup -#() uFpupi -#() uFpupu -#() uFpupp -#() uFpubp -#() uFppiu -#() uFppip -#() uFppuu -#() uFpplp -#() uFppLp -#() uFpppi -#() uFpppu -#() uFpppL -#() uFpppp -#() uFbipp -#() uFbCWp -#() uFbuWp -#() uFbuuC -#() uFbuuu -#() uFbuup -#() UFpUui -#() UFppii -#() UFppip -#() UFbipp -#() dFpppp -#() lFEipV -#() lFEpip -#() lFEppL -#() lFEppp -#() lFiiLu -#() lFiipL -#() lFipil -#() lFipLi -#() lFipLI -#() lFipLu -#() lFipLl -#() lFipLL -#() lFipLp -#() lFippL -#() lFpili -#() lFpilp -#() lFpuip -#() lFplip -#() lFplpp -#() lFpLpp -#() lFppii -#() lFppip -#() lFpppL -#() lFpppp -#() LFEppL -#() LFEppp -#() LFipLL -#() LFippL -#() LFippp -#() LFuipL -#() LFpCii -#() LFpupL -#() LFpLCL -#() LFpLLp -#() LFpLpL -#() LFpLpp -#() LFppii -#() LFppip -#() LFppLu -#() LFppLL -#() LFppLp -#() LFpppi -#() LFpppL -#() LFpppp -#() pFEipp -#() pFEuup -#() pFEupp -#() pFELpV -#() pFELpA -#() pFEpii -#() pFEpip -#() pFEpuL -#() pFEppi -#() pFEppp -#() pFEppV -#() pFiiii -#() pFiiiu -#() pFiiuu -#() pFiiup -#() pFiiLp -#() pFiipi -#() pFiIIi -#() pFillu -#() pFipii -#() pFipip -#() pFippi -#() pFippu -#() pFippL -#() pFippp -#() pFuuii -#() pFuuip -#() pFuuuu -#() pFullu -#() pFupii -#() pFuppp -#() pFffff -#() pFdipp -#() pFdddd -#() pFDipp -#() pFlfff -#() pFLiip -#() pFLLup -#() pFLLpp -#() pFLppp -#() pFpiii -#() pFpiiu -#() pFpiip -#() pFpiuu -#() pFpiLi -#() pFpiLL -#() pFpipi -#() pFpipd -#() pFpipL -#() pFpipp -#() pFpCip -#() pFpWWW -#() pFpuii -#() pFpuip -#() pFpuuu -#() pFpuup -#() pFpudd -#() pFpuLL -#() pFpupi -#() pFpupu -#() pFpupp -#() pFpdIU -#() pFpddi -#() pFplil -#() pFplip -#() pFplpl -#() pFplpp -#() pFpLii -#() pFpLip -#() pFpLup -#() pFpLLp -#() pFpLpi -#() pFpLpl -#() pFpLpL -#() pFpLpp -#() pFppii -#() pFppiu -#() pFppiL -#() pFppip -#() pFppCp -#() pFppWp -#() pFppuu -#() pFppuL -#() pFppup -#() pFppUU -#() pFppdd -#() pFppll -#() pFpplp -#() pFppLi -#() pFppLL -#() pFppLp -#() pFpppi -#() pFpppu -#() pFpppL -#() pFpppp -#() pFpbii -#() pFSppi -#() pFbCuW -#() pFbCuu -#() pFbuWp -#() pFbuuC -#() pFbuuu -#() pFbuup -#() pFbpWp -#() pFbpup -#() pFbppu -#() pFbppU -#() vWpiiu -#() vWpuup -#() iWEpip -#() iWEpup -#() iWEppu -#() iWEppp -#() iWpiii -#() iWpiuu -#() iWpuiu -#() iWpuip -#() iWpuup -#() iWpupu -#() iWpupp -#() iWppuu -#() iWpppu -#() iWpppp -#() vFEiipV -#() vFEiipA -#() vFEippp -#() vFEpipV -#() vFEpipA -#() vFEpuup -#() vFEpuuV -#() vFEpupp -#() vFEpupA -#() vFEpLLp -#() vFEppip -#() vFEppiV -#() vFEppuu -#() vFEppup -#() vFEpppi -#() vFEpppp -#() vFiiiii -#() vFiiiiu -#() vFiiipi -#() vFiiuii -#() vFiiuup -#() vFiillu -#() vFiilll -#() vFiipii -#() vFiipll -#() vFiuiip -#() vFiuipi -#() vFiuuuu -#() vFiulpp -#() vFiffff -#() vFidddd -#() vFilill -#() vFilipi -#() vFilipl -#() vFillll -#() vFiLLLL -#() vFipipu -#() vFipipp -#() vFipupi -#() vFucccc -#() vFuwwww -#() vFuiiii -#() vFuiiiu -#() vFuiiip -#() vFuiiCp -#() vFuiiup -#() vFuiill -#() vFuiuii -#() vFuiuip -#() vFuiuCi -#() vFuiuCu -#() vFuiuuu -#() vFuiuup -#() vFuiupi -#() vFuifff -#() vFuiddd -#() vFuilll -#() vFuiLLL -#() vFuipii -#() vFuipip -#() vFuipup -#() vFuippp -#() vFuCCCC -#() vFuCuip -#() vFuCuup -#() vFuWWWW -#() vFuuiii -#() vFuuiiu -#() vFuuiip -#() vFuuiui -#() vFuuiuu -#() vFuuiup -#() vFuuifi -#() vFuuipC -#() vFuuipu -#() vFuuipp -#() vFuuuii -#() vFuuuiu -#() vFuuuil -#() vFuuuip -#() vFuuuui -#() vFuuuuu -#() vFuuuup -#() vFuuuli -#() vFuuull -#() vFuulll -#() vFuullp -#() vFuupii -#() vFuuppu -#() vFuffff -#() vFudddd -#() vFulill -#() vFullll -#() vFullpu -#() vFuLLLL -#() vFupiii -#() vFupupi -#() vFupupp -#() vFuplii -#() vFuppip -#() vFupppu -#() vFupppp -#() vFfffff -#() vFddddp -#() vFluipp -#() vFLpppi -#() vFLpppp -#() vFpiiii -#() vFpiiiI -#() vFpiiiu -#() vFpiiip -#() vFpiiII -#() vFpiiuu -#() vFpiiup -#() vFpiiff -#() vFpiipp -#() vFpiIiI -#() vFpiIII -#() vFpiuuu -#() vFpiUUu -#() vFpiUUp -#() vFpilpp -#() vFpipii -#() vFpippi -#() vFpippp -#() vFpuiip -#() vFpuipp -#() vFpuuuu -#() vFpuuup -#() vFpuupp -#() vFpuddd -#() vFpupiu -#() vFpupup -#() vFpUuuu -#() vFpUUuu -#() vFpUUup -#() vFpUUUi -#() vFpUUUu -#() vFpUUUp -#() vFpfffi -#() vFpffff -#() vFpdiII -#() vFpddii -#() vFpdddd -#() vFpddpp -#() vFpluul -#() vFplppp -#() vFpLLLL -#() vFpLLpp -#() vFpLpiL -#() vFppiii -#() vFppiiu -#() vFppiip -#() vFppiui -#() vFppiup -#() vFppiff -#() vFppidd -#() vFppipi -#() vFppipp -#() vFppWui -#() vFppuii -#() vFppuui -#() vFppuuu -#() vFppuup -#() vFppudd -#() vFppupi -#() vFppupu -#() vFppupp -#() vFppfff -#() vFppddp -#() vFppLLL -#() vFppLpL -#() vFpppii -#() vFpppip -#() vFpppui -#() vFpppuu -#() vFpppup -#() vFpppff -#() vFpppdd -#() vFpppLp -#() vFppppi -#() vFppppu -#() vFppppL -#() vFppppp -#() iFEiipp -#() iFEiipV -#() iFEiipA -#() iFEipip -#() iFEippi -#() iFEippL -#() iFEippp -#() iFEpiii -#() iFEpipi -#() iFEpipp -#() iFEpipV -#() iFEpipA -#() iFEpUup -#() iFEpLpp -#() iFEpLpV -#() iFEpLpA -#() iFEppii -#() iFEppip -#() iFEppiV -#() iFEppiA -#() iFEpplp -#() iFEpppi -#() iFEpppL -#() iFEpppp -#() iFEpppV -#() iFEpppA -#() iFiiipu -#() iFiiipp -#() iFiiupp -#() iFiuuuu -#() iFiuuup -#() iFiuLip -#() iFillLL -#() iFipiii -#() iFipiup -#() iFipipi -#() iFipipu -#() iFipuip -#() iFipuui -#() iFipLup -#() iFippuu -#() iFippLi -#() iFippLp -#() iFipppi -#() iFipppp -#() iFuuupp -#() iFuppLp -#() iFLppip -#() iFLpppp -#() iFpwwww -#() iFpwppp -#() iFpiiii -#() iFpiiiu -#() iFpiiiL -#() iFpiiip -#() iFpiiui -#() iFpiiuu -#() iFpiipi -#() iFpiipp -#() iFpiIip -#() iFpiuwp -#() iFpiuuu -#() iFpiUUU -#() iFpipii -#() iFpipiu -#() iFpipiL -#() iFpipip -#() iFpippi -#() iFpippW -#() iFpippp -#() iFpCCCC -#() iFpCupp -#() iFpCpip -#() iFpuill -#() iFpuipi -#() iFpuipp -#() iFpuuip -#() iFpuuui -#() iFpuuup -#() iFpuuLL -#() iFpuupp -#() iFpulup -#() iFpulpp -#() iFpuLpL -#() iFpuLpp -#() iFpupui -#() iFpupuu -#() iFpupuU -#() iFpupup -#() iFpuppL -#() iFpuppp -#() iFpUiUi -#() iFpUupp -#() iFplupp -#() iFplluu -#() iFpLiup -#() iFpLilp -#() iFpLiLi -#() iFpLlpp -#() iFpLLii -#() iFpLLup -#() iFpLLpp -#() iFpLpii -#() iFpLpiL -#() iFpLpuL -#() iFpLpup -#() iFpLpLi -#() iFpLppi -#() iFpLppL -#() iFpLppp -#() iFppiiu -#() iFppiiL -#() iFppiip -#() iFppiuu -#() iFppiup -#() iFppiLi -#() iFppiLL -#() iFppipi -#() iFppipu -#() iFppipp -#() iFppuwp -#() iFppuip -#() iFppuuu -#() iFppuup -#() iFppupi -#() iFppupu -#() iFppupp -#() iFppUup -#() iFpplii -#() iFppllp -#() iFpplpp -#() iFppLup -#() iFppLpi -#() iFppLpL -#() iFppLpp -#() iFpppii -#() iFpppip -#() iFpppui -#() iFpppup -#() iFpppUi -#() iFpppLi -#() iFpppLL -#() iFpppLp -#() iFppppi -#() iFppppu -#() iFppppl -#() iFppppL -#() iFppppp -#() IFppIII -#() uFEippp -#() uFEpipp -#() uFEppuu -#() uFEpppp -#() uFEpppV -#() uFiuuuu -#() uFiuppi -#() uFipipp -#() uFipLpp -#() uFuiiii -#() uFLpppL -#() uFpCCCC -#() uFpWuip -#() uFpuuui -#() uFpuuuu -#() uFpuupp -#() uFpupuu -#() uFpuppp -#() uFppipp -#() uFppuup -#() uFppupp -#() uFpplip -#() uFppLpp -#() uFppppL -#() uFppppp -#() uFbCuuu -#() uFbCuup -#() uFbuuWW -#() uFbuuup -#() UFuiiii -#() lFEuipp -#() lFipili -#() lFipLli -#() lFipLlL -#() lFipLLi -#() lFipLpp -#() lFpuipC -#() lFpuuLL -#() lFppupp -#() lFppllp -#() lFppLpL -#() lFppLpp -#() LFELppi -#() LFEpppp -#() LFuiCiu -#() LFLpppL -#() LFpuipp -#() LFpuppi -#() LFpLuuu -#() LFpLLLp -#() LFpLpuu -#() LFpLppL -#() LFpLppp -#() LFppLLp -#() LFppLpL -#() LFpppii -#() LFppppp -#() pFEpiii -#() pFEpipL -#() pFEpipp -#() pFEpipV -#() pFEpipA -#() pFEpupp -#() pFEpUpp -#() pFEpLpp -#() pFEppii -#() pFEppip -#() pFEppLp -#() pFEpppi -#() pFEpppu -#() pFEpppp -#() pFEpppV -#() pFEpppA -#() pFiiiii -#() pFiiipL -#() pFipipL -#() pFipipp -#() pFuiiiu -#() pFuiupp -#() pFuuiip -#() pFuuupu -#() pFuupuu -#() pFudddp -#() pFupLpl -#() pFupLpL -#() pFddddi -#() pFLuppp -#() pFLpppi -#() pFpiiii -#() pFpiiip -#() pFpiiuu -#() pFpiipi -#() pFpiipL -#() pFpiipp -#() pFpiCCC -#() pFpiuuu -#() pFpiuup -#() pFpiupp -#() pFpiLip -#() pFpipip -#() pFpipup -#() pFpippi -#() pFpippp -#() pFpuiii -#() pFpuiip -#() pFpuuip -#() pFpuuuu -#() pFpuuup -#() pFpuupp -#() pFpuLpp -#() pFpuppu -#() pFpuppp -#() pFpUdii -#() pFpfffi -#() pFpdddd -#() pFplppp -#() pFpLiii -#() pFpLLip -#() pFpLLLp -#() pFpLpii -#() pFpLpip -#() pFpLpup -#() pFppiii -#() pFppiiu -#() pFppiip -#() pFppiup -#() pFppipi -#() pFppipp -#() pFppWpp -#() pFppuip -#() pFppuuu -#() pFppuup -#() pFppupp -#() pFppddu -#() pFppLii -#() pFppLLi -#() pFppLpp -#() pFpppii -#() pFpppip -#() pFpppui -#() pFpppup -#() pFpppli -#() pFpppLi -#() pFppppi -#() pFppppu -#() pFppppL -#() pFppppp -#() pFbuWWW -#() pFbuuWW -#() pFbuuup -#() pFbupii -#() pFbpuii -#() pFbpppp -#() iWEpiup -#() iWEpipp -#() iWpiiii -#() iWpiupu -#() iWpuiii -#() iWpuiup -#() iWpuupu -#() iWpuupp -#() iWpupuu -#() iWpupup -#() iWpuppu -#() iWpuppp -#() iWpppuu -#() iWpppup -#() iWppppp -#() vFEiiipp -#() vFEpiwpp -#() vFEpiLpp -#() vFEpippp -#() vFEpuipp -#() vFEpuipV -#() vFEpupup -#() vFEpuppp -#() vFEpLLpp -#() vFEppipV -#() vFEppipA -#() vFEppupp -#() vFEppppp -#() vFiiiiii -#() vFiiiuil -#() vFiiilpi -#() vFiiuilp -#() vFiffiff -#() vFiddidd -#() vFilipli -#() vFiliplu -#() vFillill -#() vFipiplp -#() vFCCCCff -#() vFuiiiii -#() vFuiiiip -#() vFuiiuii -#() vFuiiuup -#() vFuiuiii -#() vFuiuiiC -#() vFuiuiil -#() vFuiuiip -#() vFuiuiuu -#() vFuiuiuL -#() vFuiuCip -#() vFuiuuip -#() vFuiuuuu -#() vFuiupii -#() vFuiupiu -#() vFuiffff -#() vFuidddd -#() vFuillll -#() vFuiLLLL -#() vFuipiup -#() vFuCuuip -#() vFuuiiii -#() vFuuiiiu -#() vFuuiuii -#() vFuuiuil -#() vFuuiuip -#() vFuuiuCu -#() vFuuiuup -#() vFuuippp -#() vFuuuiii -#() vFuuuiup -#() vFuuuipi -#() vFuuuipC -#() vFuuuipp -#() vFuuuuii -#() vFuuuuip -#() vFuuuuuu -#() vFuuuull -#() vFuuuppi -#() vFuuuppp -#() vFuuffff -#() vFuudddd -#() vFuupiii -#() vFuupupp -#() vFuuplii -#() vFuffiip -#() vFufffff -#() vFuddiip -#() vFullill -#() vFulluLC -#() vFupiiii -#() vFupupip -#() vFuppppu -#() vFuppppp -#() vFUUpppp -#() vFffffff -#() vFdddddd -#() vFdddppp -#() vFpiiiii -#() vFpiiipp -#() vFpiiuuu -#() vFpiippi -#() vFpiippp -#() vFpiUuup -#() vFpipipp -#() vFpipipV -#() vFpipppi -#() vFpipppp -#() vFpuiiii -#() vFpuiiiu -#() vFpuiipp -#() vFpuuuiu -#() vFpuuuup -#() vFpuuupp -#() vFpuupuu -#() vFpuuppp -#() vFpudddd -#() vFpupiUu -#() vFpupuuu -#() vFpupupu -#() vFpuppuu -#() vFpupppp -#() vFpUiUup -#() vFpUipup -#() vFpUuuup -#() vFpUUiup -#() vFpdddii -#() vFpddddd -#() vFpddddp -#() vFppiiii -#() vFppiiip -#() vFppiiuu -#() vFppiipi -#() vFppiipp -#() vFppilpp -#() vFppipLp -#() vFppippi -#() vFppippp -#() vFppuiii -#() vFppuiiu -#() vFppuiip -#() vFppuuuu -#() vFppuUUU -#() vFppupii -#() vFppuppp -#() vFppffff -#() vFppdidd -#() vFppdddd -#() vFpplppi -#() vFpplppp -#() vFppLppi -#() vFppLppp -#() vFpppiii -#() vFpppiip -#() vFpppiui -#() vFpppiff -#() vFpppipu -#() vFpppuii -#() vFpppuuu -#() vFppppii -#() vFpppppi -#() vFpppppu -#() vFpppppU -#() vFpppppL -#() vFpppppp -#() cFppLppi -#() iFEiippi -#() iFEiippp -#() iFEiLLLL -#() iFEippLp -#() iFElpppp -#() iFEpiipp -#() iFEpiipV -#() iFEpilpV -#() iFEpippi -#() iFEpIppp -#() iFEpuppp -#() iFEpUppp -#() iFEppppi -#() iFEppppp -#() iFiiiiip -#() iFiiiipp -#() iFiiiuwp -#() iFiWiipi -#() iFiuUuUu -#() iFilpppp -#() iFiLpppi -#() iFipiipi -#() iFipipip -#() iFipippp -#() iFipuIup -#() iFipupup -#() iFipuppp -#() iFipppLp -#() iFippppp -#() iFdipppL -#() iFDipppL -#() iFlpippp -#() iFLpppii -#() iFpiiiii -#() iFpiiiiu -#() iFpiiiip -#() iFpiiipp -#() iFpiiuii -#() iFpiiuui -#() iFpiiupp -#() iFpiipip -#() iFpiippp -#() iFpiCCpu -#() iFpiuuup -#() iFpiuupp -#() iFpipiii -#() iFpipipi -#() iFpipipp -#() iFpipupp -#() iFpipLpp -#() iFpippip -#() iFpippup -#() iFpipppp -#() iFpCiipp -#() iFpCpipu -#() iFpWipip -#() iFpWpppp -#() iFpuiCpp -#() iFpuippp -#() iFpuuuuu -#() iFpuuuup -#() iFpuuupu -#() iFpuuupp -#() iFpuuLpp -#() iFpuupuu -#() iFpuuppp -#() iFpuLLpp -#() iFpupuui -#() iFpupLpL -#() iFpupLpp -#() iFpUiipp -#() iFpUuuLp -#() iFpUUUup -#() iFpUUUUp -#() iFpdpipp -#() iFpLiiiL -#() iFpLiiip -#() iFpLiiuu -#() iFpLipLu -#() iFpLuipp -#() iFpLuupp -#() iFpLupip -#() iFpLLLLL -#() iFpLLppp -#() iFpLpipi -#() iFpLppii -#() iFpLpppL -#() iFpLpppp -#() iFppiiii -#() iFppiiip -#() iFppiipi -#() iFppiipp -#() iFppiupp -#() iFppilpp -#() iFppipii -#() iFppipiL -#() iFppipip -#() iFppippi -#() iFppippu -#() iFppippp -#() iFppIppp -#() iFppuiii -#() iFppuIII -#() iFppuupp -#() iFppuLpp -#() iFppupip -#() iFppuppp -#() iFppdidd -#() iFpplupp -#() iFpplppi -#() iFppLupp -#() iFppLLiL -#() iFppLLup -#() iFppLLpp -#() iFppLpLp -#() iFppLppp -#() iFpppiuu -#() iFpppipi -#() iFpppipu -#() iFpppipp -#() iFpppuii -#() iFpppuup -#() iFpppupu -#() iFpppupp -#() iFpppLpp -#() iFppppii -#() iFppppiu -#() iFppppip -#() iFppppup -#() iFppppLp -#() iFpppppi -#() iFpppppL -#() iFpppppp -#() uFEiippp -#() uFEiuppp -#() uFEpippp -#() uFEpCppp -#() uFEpuppp -#() uFuuuuuu -#() uFupuufp -#() uFuppppp -#() uFpiuppu -#() uFpWuipp -#() uFpWuuCp -#() uFpuippp -#() uFpuuuup -#() uFpuuupp -#() uFpuuppp -#() uFpupupu -#() uFpupppp -#() uFppippp -#() uFppuuup -#() uFppuupu -#() uFppLppL -#() uFpppppi -#() uFpppppp -#() uFbippup -#() uFbCuuWW -#() uFbuuiup -#() UFbippup -#() lFEpippp -#() lFipipLu -#() lFipLipu -#() lFipLipp -#() lFipLpLL -#() lFpipill -#() lFpuuLLp -#() lFpplllp -#() lFppLipp -#() lFpppLpp -#() LFEupppp -#() LFELpppi -#() LFEpippp -#() LFEppppi -#() LFpipipi -#() LFpLippp -#() LFpLLLLL -#() LFppLLpL -#() LFppLpLL -#() LFSpLiip -#() pFEpiupp -#() pFEpippp -#() pFEpuipp -#() pFEpuupp -#() pFEpuppp -#() pFEpLLiN -#() pFEppupi -#() pFEppLLp -#() pFEpppLp -#() pFEppppi -#() pFEppppp -#() pFEppppV -#() pFEppApp -#() pFiiiiii -#() pFiiiiid -#() pFipippp -#() pFWCiWCi -#() pFuCCCCp -#() pFuuipip -#() pFuuuiip -#() pFuuuuii -#() pFuuuuuu -#() pFuuuuup -#() pFuuppuu -#() pFuppppp -#() pFdddddd -#() pFpiiiiu -#() pFpiiipp -#() pFpiiCCC -#() pFpiiuup -#() pFpiUUUU -#() pFpipipp -#() pFpippip -#() pFpipppp -#() pFpuiiip -#() pFpuuuuu -#() pFpuuupu -#() pFpupuui -#() pFpuppip -#() pFpupppp -#() pFplpppp -#() pFpLuLpp -#() pFpLpLLi -#() pFpLppii -#() pFpLppip -#() pFpLppup -#() pFppiiii -#() pFppiipp -#() pFppiCCC -#() pFppiupp -#() pFppilpp -#() pFppipip -#() pFppippi -#() pFppippp -#() pFppuupp -#() pFppuppp -#() pFpplplp -#() pFpplppp -#() pFpppupp -#() pFpppLii -#() pFpppLui -#() pFppppii -#() pFpppppi -#() pFpppppu -#() pFpppppp -#() pFSpiiii -#() pFbCuuCC -#() pFbCuuup -#() pFbuuwwu -#() pFbuuuuu -#() pFbuuUUU -#() pFbpupii -#() iWEpuuip -#() iWEppppp -#() iWpiiiip -#() iWpiiuii -#() iWpiuppu -#() iWpuiiii -#() iWpppppi -#() iWpppppu -#() vFEpiiipp -#() vFEpipppp -#() vFEpuipuV -#() vFEppippp -#() vFEpppppp -#() vFiiiiiip -#() vFiiiiuup -#() vFiiuilil -#() vFiiffffp -#() vFiuulipi -#() vFiupuuup -#() vFilipliu -#() vFilulipi -#() vFCCCCfff -#() vFuiiiiii -#() vFuiiiiiC -#() vFuiiiuip -#() vFuiiiuup -#() vFuiuiiii -#() vFuiuiiiC -#() vFuiuiiip -#() vFuiuiiuL -#() vFuiuCiuu -#() vFuiupiiu -#() vFuiupuip -#() vFuipiiii -#() vFuipffff -#() vFuipdddd -#() vFuuiiiii -#() vFuuiiiiC -#() vFuuiiiiu -#() vFuuiiiip -#() vFuuiiuup -#() vFuuiCiui -#() vFuuiCiuu -#() vFuuiuiii -#() vFuuiuiiC -#() vFuuipppp -#() vFuuuiiii -#() vFuuuiiCp -#() vFuuuiuii -#() vFuuuiuil -#() vFuuuiupi -#() vFuuuuuuu -#() vFuuuulll -#() vFuuuffff -#() vFuuudddd -#() vFuuffiip -#() vFuuddiip -#() vFuulluup -#() vFuupiiii -#() vFuuppppu -#() vFuuppppp -#() vFuffffff -#() vFudddddd -#() vFlipuiip -#() vFlliiiip -#() vFpiiiipp -#() vFpiiliip -#() vFpiiLiip -#() vFpiipCpp -#() vFpiipppp -#() vFpipipii -#() vFpippppu -#() vFpuuuuuu -#() vFpuuUUuu -#() vFpuupupu -#() vFpuupppp -#() vFpupuuup -#() vFpupppui -#() vFpUiUiup -#() vFpUuuUip -#() vFpUUUUuu -#() vFpddiidd -#() vFpdddddd -#() vFpLiLiLp -#() vFpLpiipi -#() vFppiiiii -#() vFppiiiip -#() vFppiiipi -#() vFppiipii -#() vFppiipuu -#() vFppiippp -#() vFppilppi -#() vFppiLiLp -#() vFppipiip -#() vFppipipp -#() vFppipppp -#() vFppCuupp -#() vFppuiiip -#() vFppuupii -#() vFppUuupp -#() vFppddddu -#() vFppddpiu -#() vFpplpppi -#() vFppLpppi -#() vFppLpppp -#() vFpppiiii -#() vFpppiipi -#() vFpppiipp -#() vFpppiupi -#() vFpppippi -#() vFpppuuuu -#() vFpppffff -#() vFppppiip -#() vFppppiui -#() vFppppipi -#() vFpppppip -#() vFppppppu -#() vFppppppp -#() iFEpupppp -#() iFEpUuppp -#() iFEpLiLpp -#() iFEpLiLpV -#() iFEppuppp -#() iFEppLpIi -#() iFEpppiiu -#() iFEpppppL -#() iFEpppppp -#() iFiiiiiip -#() iFipupupi -#() iFippuIup -#() iFipppppp -#() iFpiiiiii -#() iFpiiiuwp -#() iFpiiiuup -#() iFpiiuuiu -#() iFpiipppp -#() iFpiuiipp -#() iFpiuLiii -#() iFpiupppp -#() iFpiLuupp -#() iFpiLuppp -#() iFpipiiip -#() iFpipipip -#() iFpipippp -#() iFpippLpp -#() iFpippppW -#() iFpippppp -#() iFpIIpppp -#() iFpWCiWCi -#() iFpWppppW -#() iFpWppppp -#() iFpuiCuCp -#() iFpuiuupp -#() iFpupiLpL -#() iFpupuuui -#() iFpupuupp -#() iFpupupui -#() iFpuppppp -#() iFpllpppp -#() iFpLiiiiL -#() iFpLiiuui -#() iFpLipipi -#() iFpLipupu -#() iFpLpiiii -#() iFpLpiiuu -#() iFpLpiipi -#() iFpLppiii -#() iFppiiiip -#() iFppiiuup -#() iFppiiLll -#() iFppiipii -#() iFppiipiL -#() iFppipiii -#() iFppipiip -#() iFppipipp -#() iFppippip -#() iFppipppi -#() iFppipppp -#() iFppuipiL -#() iFppuippp -#() iFppuuppp -#() iFppupupp -#() iFppliupp -#() iFppLiipp -#() iFppLippp -#() iFppLuuii -#() iFpppiiuu -#() iFpppiiup -#() iFpppiuwu -#() iFpppippi -#() iFpppippp -#() iFpppuiii -#() iFpppLppp -#() iFppppilp -#() iFppppipp -#() iFppppIip -#() iFppppdpu -#() iFpppppip -#() iFpppppLp -#() iFppppppu -#() iFppppppp -#() uFEiipppp -#() uFEpiippp -#() uFEpuuppp -#() uFEpppppp -#() uFiiiuuuu -#() uFuippppp -#() uFpippppp -#() uFpuuuupp -#() uFpuuuppp -#() uFpuupppp -#() uFppiuppi -#() uFppiuppp -#() uFppuuuup -#() uFppppppp -#() uFbCuuuuu -#() uFbuuuwwu -#() uFbuupwwC -#() LFEppLppU -#() LFEpppppu -#() LFpLLuupp -#() LFpLLppuu -#() pFEpupppp -#() pFEpLiiil -#() pFEppuipp -#() pFEppppip -#() pFEpppppi -#() pFifffppp -#() pFWpppppp -#() pFuuuiiip -#() pFuupupup -#() pFfiiiiid -#() pFdiiiIiI -#() pFpiiiiid -#() pFpiiippp -#() pFpiiUdii -#() pFpiipppp -#() pFpipippp -#() pFpWppWpp -#() pFpuLpipp -#() pFpupiipp -#() pFpuppipp -#() pFpuppppp -#() pFplppppp -#() pFpLLppup -#() pFpLpipip -#() pFpLpLLiL -#() pFpLppiip -#() pFpLppLLi -#() pFppiiipp -#() pFppiiCCC -#() pFppiippp -#() pFppipipp -#() pFppipLpp -#() pFppuippp -#() pFppuuupp -#() pFppuuppp -#() pFppuLLip -#() pFppupuuu -#() pFppliuip -#() pFpplipup -#() pFppLipip -#() pFppLLiLi -#() pFpppccci -#() pFpppiiii -#() pFpppCCCi -#() pFpppuipp -#() pFpppuuui -#() pFpppuupp -#() pFpppupii -#() pFpppupup -#() pFpppuppp -#() pFpppfffi -#() pFpppdddi -#() pFpppllli -#() pFpppLLLi -#() pFppppiii -#() pFppppuuu -#() pFpppppuu -#() pFppppppu -#() pFppppppp -#() pFbCuwwWW -#() pFbCuWCCC -#() pFbCuuwwp -#() pFbCpWWup -#() iWpiiuuuu -#() iWpuiiiip -#() iWpuiiuii -#() iWpuipupp -#() iWpuuuppu -#() iWpupuufu -#() iWpppuppp -#() vFEiippppV -#() vFEiupippp -#() vFEipAippp -#() vFEppipppp -#() vFEppLippp -#() vFEpppippp -#() vFEpppuipV -#() vFEpppppuu -#() vFiiiiuuip -#() vFiilliilp -#() vFiilluulp -#() vFiupuiuup -#() vFiupuuuup -#() vFuiiiiiii -#() vFuiiiiiiC -#() vFuiiiiuup -#() vFuiiipiup -#() vFuiuiiiii -#() vFuiuiiiip -#() vFuiuiiiuL -#() vFuiuiiCuL -#() vFuiuiuuuu -#() vFuCCCCfff -#() vFuuiiiiiC -#() vFuuiiiuip -#() vFuuiiiuup -#() vFuuiiuupp -#() vFuuiuiiii -#() vFuuiuiiiC -#() vFuuiuiiip -#() vFuuuiiiiu -#() vFuuuiuCil -#() vFuuuipipp -#() vFuuuuuuuu -#() vFuuufffff -#() vFffffffff -#() vFpiiiiiii -#() vFpiiiiiip -#() vFpiiiipii -#() vFpiUuupup -#() vFpippiiuu -#() vFpippiipi -#() vFpuiULipp -#() vFpudddddd -#() vFpuppippp -#() vFpuppLLLL -#() vFpUiUiupi -#() vFpUuuUUUu -#() vFpLppiipi -#() vFppiiiiii -#() vFppiiipii -#() vFppipipiu -#() vFppipppui -#() vFppippppi -#() vFppippppp -#() vFppuuiiii -#() vFppuppiii -#() vFppuppiiu -#() vFpplppppi -#() vFpplppppp -#() vFppLpLpLp -#() vFpppipppu -#() vFpppuiiii -#() vFppppiipi -#() vFpppppuuu -#() vFpppppppp -#() iFEuipuupp -#() iFEpippppp -#() iFEpuuLppp -#() iFEpUUuppp -#() iFEppipppp -#() iFEppppipp -#() iFiiiiiiip -#() iFiiupiupi -#() iFiuuCCuup -#() iFiuuuupip -#() iFipippppp -#() iFuuuuuuuu -#() iFdiippppL -#() iFpiiiuuup -#() iFpipiipip -#() iFpippuuii -#() iFpippuupp -#() iFpCCWWpWu -#() iFpWCuWCuu -#() iFpuiipppp -#() iFpuippLpp -#() iFpuuiiiii -#() iFpuuipppp -#() iFpuuupupu -#() iFpuupuupp -#() iFpuuppiip -#() iFpuuppppp -#() iFpupppppp -#() iFpUuuLpUu -#() iFpduuulul -#() iFpLLiippp -#() iFpLLLiipi -#() iFpLLppppp -#() iFpLpipppp -#() iFpLppLpip -#() iFpLpppupu -#() iFpLpppppp -#() iFppiiipip -#() iFppillppp -#() iFppippppp -#() iFppIIIppp -#() iFppuiiuuu -#() iFppuuuuuu -#() iFppuppppp -#() iFpppiiipi -#() iFpppiiipp -#() iFpppipipi -#() iFppppiiup -#() iFppppippp -#() iFpppppupp -#() iFppppppii -#() iFpppppppi -#() iFpppppppp -#() iFbWWipppp -#() iFbupppWWu -#() CFuiifpppp -#() uFEipipppp -#() uFEpiupppp -#() uFEppipppp -#() uFEpppuppp -#() uFEppppppp -#() uFuipppppp -#() uFuupuuiuf -#() uFulpppppp -#() uFpuupupuu -#() uFpupuuuCp -#() uFppuuuupp -#() uFppuuuppu -#() uFppuppppp -#() uFpppppupp -#() uFbCuuuCup -#() uFbWWWWWWp -#() LFELpupupu -#() LFEpiupppp -#() LFpLpuuLLu -#() pFEiplllpp -#() pFEipLLLpp -#() pFEpiuCppp -#() pFEppLiiip -#() pFEpppuipV -#() pFEpppppiV -#() pFEppppppi -#() pFEppppppp -#() pFiippipip -#() pFiupppppp -#() pFuiiiuuuu -#() pFuCCCCpWw -#() pFuupupipp -#() pFpiiiiiuu -#() pFpiiuuupp -#() pFpiUdiiUi -#() pFpipiiiip -#() pFpuuuuupp -#() pFpuuuupup -#() pFpupLLLpp -#() pFpupppppp -#() pFplpppppp -#() pFpLuLpLip -#() pFpLpipLup -#() pFpLpLLiLi -#() pFpLppuLLp -#() pFpLppLLiL -#() pFppiiiiii -#() pFpppipipi -#() pFppplippp -#() pFppppuppp -#() pFpppppupp -#() pFbCCuuwwC -#() pFbCuwwWWu -#() pFbWWiCpup -#() pFbuuWWCuu -#() pFbuuupwwp -#() pFbdwwWWui -#() iWEpuuiipp -#() iWEpuuuipp -#() iWpuipuppp -#() vFEpiiiuipp -#() vFEpippippV -#() vFEpippippA -#() vFEpuuuippp -#() vFEppiipppp -#() vFEpppiippp -#() vFEppppippp -#() vFiiiiiiiii -#() vFiiiiiiill -#() vFiiiiillli -#() vFiiilllilp -#() vFiupuiuuup -#() vFiupuuuuup -#() vFuiiiiiiii -#() vFuiiiiiiiC -#() vFuiiiiiuip -#() vFuiiiiiuup -#() vFuiuiiiiip -#() vFuiuiiiCuL -#() vFuiupuffup -#() vFuuiiiiiii -#() vFuuiiiiiiC -#() vFuuiiiiuup -#() vFuuiuiiiii -#() vFuuiuiiiip -#() vFuuuiiiiCp -#() vFuuuuuuuuu -#() vFuupuuiuuf -#() vFuffffffff -#() vFffCCCCfff -#() vFddddddddd -#() vFpiuippppi -#() vFpipiuiipp -#() vFpipppiipi -#() vFpuuuuuuuu -#() vFpLpppippp -#() vFppiiiiiii -#() vFppiiiiipi -#() vFppiiiiupi -#() vFppiiipiii -#() vFppiupiiii -#() vFppippDpDC -#() vFppipppiii -#() vFppipppiip -#() vFppuippiip -#() vFppuuiiiii -#() vFppuuiiiiu -#() vFppuppiiii -#() vFppupppiii -#() vFppupppiiu -#() vFppupppiip -#() vFppUUuUUUU -#() vFppddddudd -#() vFpplpppppi -#() vFpppiiiiii -#() vFpppffffff -#() vFppppipiip -#() vFpppppippp -#() iFEpiiiiipi -#() iFEppuppppp -#() iFEpppipppp -#() iFEppplPPPP -#() iFEpppppupp -#() iFEppPPPPPP -#() iFiiiiiiiip -#() iFiiiipiiip -#() iFipiipippi -#() iFdddpppppp -#() iFpipippppi -#() iFpipLpiiip -#() iFpuuuuuuuu -#() iFpuuuuduup -#() iFpuuuLiiip -#() iFpuuuLpppp -#() iFpduuuLuLp -#() iFpLiuiiLLL -#() iFpLLiiuuii -#() iFpLpiiuuii -#() iFpLpppupup -#() iFpLppppppp -#() iFppiiiiiii -#() iFppippippp -#() iFppuLLpupp -#() iFppuppuuuu -#() iFppupppupp -#() iFppLpiuppp -#() iFpppiiipip -#() iFpppiiuuii -#() iFpppiipiiu -#() iFpppippipi -#() iFpppLLLupp -#() iFpppLppupp -#() iFppppiiupp -#() iFpppppLupp -#() iFppppppupp -#() iFppppppppu -#() iFppppppppp -#() uFEipippppp -#() uFEpppufppp -#() uFuulpiuiuf -#() uFpuupuppuu -#() uFppLpLuppp -#() uFppppppppp -#() lFpppipiipp -#() lFpppippppp -#() LFEppppppii -#() LFpLiiuuuLL -#() pFEppiiuuLi -#() pFEppuippuu -#() pFEpppppiiV -#() pFEpppppppi -#() pFEpppppppp -#() pFuupuuuuuu -#() pFpiiiiuuuu -#() pFpLpLLipui -#() pFpLppLLiLi -#() pFppiiiiiip -#() pFppipppppp -#() pFpppiiiiii -#() pFpppuipppp -#() pFpppppiipp -#() pFbiiCpWWup -#() pFbCuWCCuuu -#() pFbuuwwWWww -#() pFbupuuuuup -#() pFbppppuuCC -#() iWEpuuiippu -#() iWEpuuuiipp -#() iWpiuuupipu -#() iWpuiuuipip -#() iWppppupiii -#() vFEiippppppp -#() vFEpippppppp -#() vFEpppiipppp -#() vFiiiiiiiiii -#() vFiiiiiiiiiu -#() vFiiiiiiiiui -#() vFiiiiiiiiuu -#() vFiiillliiip -#() vFuiiiiiiiii -#() vFuiiiiiiiip -#() vFuiiiiiiuup -#() vFuiuiiiiuup -#() vFuuiiiiiiii -#() vFuuiiiiiuip -#() vFuuiiiiiuup -#() vFuuiuiiiiip -#() vFuuuuuuuCCC -#() vFuuuuuuuuuu -#() vFuupuiupuuf -#() vFuffiiffiip -#() vFuddiiddiip -#() vFffffffffff -#() vFpiuippppip -#() vFpuupuuuuuu -#() vFppiiiiiiii -#() vFppiiiiipip -#() vFppiiiiupip -#() vFppiippppii -#() vFppuipppiip -#() vFppuuuiiiii -#() vFppuuuuuuuu -#() vFppuuppiiii -#() vFppuuppppii -#() vFppuppuiiii -#() vFppupppiiii -#() vFppdddddddd -#() vFppppppppii -#() vFpppppppppp -#() iFEpiiiiippp -#() iFEpupppLppL -#() iFEppppppipp -#() iFiiiiiiiiip -#() iFpiipiiipip -#() iFpippddiidd -#() iFpCuWCCCCup -#() iFpuuLiuiiLL -#() iFpLLpiiuuii -#() iFpLpLUUUUpL -#() iFppuuiiiiii -#() iFppuuiiuupi -#() iFpppiiipipi -#() iFpppLLipppp -#() iFpppppiiuup -#() iFpppppppipi -#() iFpppppppppu -#() uFpddpippppp -#() uFpppppppppp -#() lFpLppdddddd -#() pFEiippppppp -#() pFEpiiiiiipp -#() pFEpippppppp -#() pFpupLLLLLpp -#() pFplllllllll -#() pFppippLLLip -#() pFppuiipuuii -#() pFppuuLLuppp -#() pFpppiiiiiii -#() pFpppppppppp -#() pFbCuWCCuuCW -#() pFbuwwWWuCuu -#() pFbuuuwwwwWW -#() pFbuuuWWWCCi -#() iWEpuipupppp -#() iWEpuuiiuipp -#() iWEpuuuuiipp -#() vFEpuuuupupup -#() vFiiiiillliip -#() vFiiiiilllilp -#() vFuiiiiiiiiip -#() vFuiiiiiiiuip -#() vFuiiiiiiiuup -#() vFuiiiillliip -#() vFuiuiiiiiuup -#() vFuuiiiiiiuup -#() vFuuupupppppp -#() vFuuffiiffiip -#() vFuufffffffff -#() vFuuddiiddiip -#() vFuffffffffff -#() vFuLuuuuuuuuu -#() vFLufffffffff -#() vFpipipiipiii -#() vFpipppiiiipi -#() vFpupuuupupup -#() vFppiiiiiiiii -#() vFppiiiiipiii -#() vFppiiiiupiii -#() vFppiiiiddddi -#() vFppiipppiiii -#() vFppuuiiiiuii -#() vFppuuppiiiiu -#() vFppuupppiiii -#() vFppupipiuuuu -#() vFppupppuiiii -#() vFppppppppppp -#() iFEiipppppppp -#() iFEpppipppppp -#() iFEppppiiiiuu -#() iFEpppppppppp -#() iFiiiiiiiiiip -#() iFpiippiiipip -#() iFpippupppppp -#() iFpuppppppppp -#() iFpLipiiiippp -#() iFpLLpiiuuiiL -#() iFppippipppip -#() iFppuppLLpupp -#() iFpppiiuuiiuu -#() iFpppppiiuupp -#() uFEpLiupppLuV -#() uFEpLippppLup -#() uFEpLippppLuA -#() uFEppppppippp -#() uFppppppppppp -#() pFEpipppppppi -#() pFEppiiLpppip -#() pFEppuiipuuii -#() pFpppppppuipp -#() pFppppppppppp -#() iWEpuipuppppp -#() iWEpuuiiuippu -#() iWEpuuuuuiipp -#() vFuiiiiiiiiuLC -#() vFuiiiiiiiuuip -#() vFuuiiiiiiiiui -#() vFuuiiiiiiiiuu -#() vFuuiiiiiiiuip -#() vFuuiiiiiiiuup -#() vFuuuuuuuuuuuu -#() vFffffffffffff -#() vFpipppiiiipii -#() vFpippppiiiipi -#() vFpupppppppppp -#() vFppiiiiddddii -#() vFppiiuuuiupup -#() vFppiipppiiiii -#() vFppuuppuiiiii -#() vFppuupppiiiiu -#() vFpppiiiiiiiii -#() vFpppiiiiiiuii -#() vFpppppppppppp -#() iFEpppippppppp -#() iFEppppiiiiuui -#() iFpipllipppppp -#() iFpipppppppppp -#() iFpCCCWCWCCCWp -#() iFpLLlliLppppp -#() iFpppllipppppp -#() iFpppppppppppp -#() pFEppiiuuuipii -#() pFEppppppppppp -#() pFWWiCCCCiipup -#() pFppiiuuuiupLp -#() pFppippLLLiLpp -#() pFppuuppppuppp -#() pFpppppppppppp -#() pFbCuuWWwwCCup -#() pFbuuuWWWWWWWW -#() vFEpppppppiippp -#() vFuiiiiiiiiiuup -#() vFuuuuuuuuuuuuu -#() vFuffffffffffff -#() vFuLuuuuuuuuuuu -#() vFpipppiiiiiiuu -#() vFpippppppppppp -#() vFpuppppppppppp -#() vFppiiiiiiiiiii -#() vFppiiiiiiuiuii -#() vFppuuppiiiiuii -#() vFppuupppuiiiii -#() vFppppppppppppp -#() iFddddpppddpppp -#() iFpippuuuiipppp -#() iFpupiiiipppppp -#() iFppppppLLLLupp -#() uFippuuuulllipp -#() uFpppppuupppppp -#() uFbCuuwwWWWWuup -#() pFpuupppwwwwWWC -#() pFppLppppiiLpip -#() pFpppppppuipppp -#() pFppppppppppppp -#() vFippppppppppppp -#() vFuffiiffiiffiip -#() vFuddiiddiiddiip -#() vFppiipppiiiiiii -#() vFppuupppiiiiuii -#() iFpipppppppppppp -#() iFppupppLLLLpupp -#() iFpppwwWWwwWWpuu -#() pFbpCpppwwwwwwWW -#() vFuiiiiiuiiiiilll -#() vFuuiiiiuuiiiiiii -#() vFfffffffffffffff -#() vFpUUUUUUUUUUUuuu -#() vFpppippppppppppp -#() vFppppppppppppppp -#() pFpuiippppppppppp -#() pFppipppppppppppp -#() pFppppppppppppppp -#() vFpppppppppppppppp -#() iFpppppppppppppppp -#() pFppipipipipipipip -#() pFpppppppppppppppp -#() pFbuuWWWWWWwwCCCuu -#() vFuuuiiiiiuiiiiilll -#() vFuuuuiiiiuuiiiiiii -#() vFppiiiiddddiiiiiuu -#() vFpppuppiipppuUUUpi -#() pFppippipipipipipip -#() pFbuuuuuwwuuuuUUUup -#() vFppuiiiiipuiiiiiiii -#() vFpppipppppppppppppp -#() iFpppppppppppppppppp -#() LFpppppppppppppppppp -#() pFippppppppppppppppp -#() pFpupppppppppppppppp -#() vFpiiiiiiiiiiiiiiiiii -#() uFbWWWCCCCCCCCWCCCCCC -#() pFiiiippppppppppppppp -#() pFpippppppppppppppppp -#() pFpupupppppppppppppppp -#() iFpppppppppppppppppppppp -#() uFippuuuuiiiiuuiiiiiiiipp -#() vFpppppppppppppppppppppppp -#() pFpupuupppppppppppppppppppp -#() iFpppppppppppppppppppppppppppppppppp -#defined(HAVE_LD80BITS) DFD -#defined(HAVE_LD80BITS) DFY -#defined(HAVE_LD80BITS) lFD -#defined(HAVE_LD80BITS) YFY -#defined(HAVE_LD80BITS) IFED -#defined(HAVE_LD80BITS) DFiD -#defined(HAVE_LD80BITS) lFDD -#defined(HAVE_LD80BITS) YFYY -#defined(HAVE_LD80BITS) vFDpp -#defined(HAVE_LD80BITS) DFDDD -#!defined(HAVE_LD80BITS) KFK -#!defined(HAVE_LD80BITS) KFy -#!defined(HAVE_LD80BITS) lFK -#!defined(HAVE_LD80BITS) yFy -#!defined(HAVE_LD80BITS) IFEK -#!defined(HAVE_LD80BITS) KFiK -#!defined(HAVE_LD80BITS) KFKK -#!defined(HAVE_LD80BITS) KFKp -#!defined(HAVE_LD80BITS) lFKK -#!defined(HAVE_LD80BITS) yFyy -#!defined(HAVE_LD80BITS) vFKpp -#!defined(HAVE_LD80BITS) KFKKK -#defined(NOALIGN) iFipiip -#!defined(NOALIGN) iFEppu -#!defined(NOALIGN) iFEiiip -#!defined(NOALIGN) iFEipii -#!defined(NOALIGN) iFEipiip -#!defined(STATICBUILD) iFlip -#!defined(STATICBUILD) iFLLi -#!defined(STATICBUILD) iFLLiW -#!defined(STATICBUILD) iFEipup -#!defined(STATICBUILD) iFEiipup -#!defined(STATICBUILD) iFpipppL -#() vFEv -> vFE -#() iFEv -> iFE -#() lFEv -> lFE -#() pFEv -> pFE -#() iFEvpp -> iFEpp -#() pFEppv -> pFEpp -#() iFEpvpp -> iFEppp -#() iFEpvvppp -> iFEpppp -#() iFEpuvvppp -> iFEpuppp -wrappedalure: -wrappedalut: -wrappedanl: -wrappedatk: -- vFp: - - atk_focus_tracker_init -- uFp: - - atk_add_focus_tracker -- uFpp: - - atk_add_global_event_listener - - atk_add_key_event_listener -wrappedatkbridge: -wrappedatomic: -wrappedatspi: -- pFppp: - - atspi_event_listener_new -wrappedayatanaappindicator3: -wrappedbz2: -- iFp: - - BZ2_bzCompressEnd - - BZ2_bzDecompress - - BZ2_bzDecompressEnd -- iFpi: - - BZ2_bzCompress -- iFpii: - - BZ2_bzDecompressInit -- iFpiii: - - BZ2_bzCompressInit -wrappedcairo: -- pFp: - - cairo_xcb_device_get_connection -- iFpppp: - - cairo_set_user_data - - cairo_surface_set_user_data -wrappedcairogobject: -wrappedcap: -wrappedcrashhandler: -wrappedcrypto: -- vFp: - - CRYPTO_set_id_callback - - CRYPTO_set_locking_callback -- pFp: - - sk_new -- vFpp: - - X509_STORE_CTX_set_verify_cb - - X509_STORE_set_verify_cb - - sk_pop_free -- iFpp: - - BIO_meth_set_create - - BIO_meth_set_ctrl - - BIO_meth_set_destroy - - BIO_meth_set_gets - - BIO_meth_set_puts - - BIO_meth_set_read - - BIO_meth_set_write -- pFpp: - - OPENSSL_sk_pop_free -- iFppp: - - ASN1_i2d_bio -- pFpppp: - - ASN1_d2i_bio - - PEM_read_bio_DHparams - - PEM_read_bio_DSAPrivateKey - - PEM_read_bio_DSA_PUBKEY - - PEM_read_bio_ECPrivateKey - - PEM_read_bio_EC_PUBKEY - - PEM_read_bio_PKCS7 - - PEM_read_bio_PUBKEY - - PEM_read_bio_PrivateKey - - PEM_read_bio_RSAPrivateKey - - PEM_read_bio_RSA_PUBKEY - - PEM_read_bio_X509 - - PEM_read_bio_X509_AUX - - PEM_read_bio_X509_CERT_PAIR - - PEM_read_bio_X509_CRL - - PEM_read_bio_X509_REQ -- iFpiipp: - - ENGINE_ctrl -- iFpplppi: - - ENGINE_ctrl_cmd -- iFppppipp: - - PEM_write_bio_DSAPrivateKey - - PEM_write_bio_ECPrivateKey - - PEM_write_bio_PrivateKey - - PEM_write_bio_RSAPrivateKey -wrappedcrypto3: -- vFp: - - CRYPTO_set_id_callback - - CRYPTO_set_locking_callback -- pFp: - - OPENSSL_sk_new -- vFpp: - - X509_STORE_CTX_set_verify_cb -- pFpp: - - OPENSSL_sk_pop_free -- vFppp: - - EVP_MD_do_all_provided -- iFppp: - - ASN1_i2d_bio -- iFppV: - - BIO_printf -- vFiipV: - - ERR_set_error -- vFiipA: - - ERR_vset_error -- pFpppp: - - ASN1_d2i_bio - - PEM_read_DHparams - - PEM_read_bio_DSAPrivateKey - - PEM_read_bio_DSA_PUBKEY - - PEM_read_bio_ECPrivateKey - - PEM_read_bio_EC_PUBKEY - - PEM_read_bio_PKCS7 - - PEM_read_bio_RSAPrivateKey - - PEM_read_bio_RSA_PUBKEY - - PEM_read_bio_X509 - - PEM_read_bio_X509_AUX - - PEM_read_bio_X509_CERT_PAIR - - PEM_read_bio_X509_CRL - - PEM_read_bio_X509_REQ -- iFpiipp: - - ENGINE_ctrl -- iFpplppi: - - ENGINE_ctrl_cmd -- iFppppipp: - - PEM_write_bio_DSAPrivateKey - - PEM_write_bio_ECPrivateKey - - PEM_write_bio_RSAPrivateKey -wrappedcurl: -- iFpup: - - curl_multi_setopt -- uFpup: - - curl_easy_setopt - - curl_share_setopt -wrappedd3dadapter9: -- pWp: - - D3DAdapter9GetProc -- iWip: - - dummy_d3d -wrappeddbus: -- vFppp: - - dbus_connection_remove_filter - - dbus_timeout_set_data - - dbus_watch_set_data -- iFpiV: - - dbus_message_append_args -- iFpiA: - - dbus_message_append_args_valist -- vFpppp: - - dbus_connection_set_dispatch_status_function - - dbus_connection_set_wakeup_main_function - - dbus_server_set_new_connection_function -- iFpipp: - - dbus_connection_set_data - - dbus_message_set_data - - dbus_pending_call_set_data - - dbus_server_set_data -- iFppip: - - dbus_message_get_args -- iFppiA: - - dbus_message_get_args_valist -- iFpppp: - - dbus_connection_add_filter - - dbus_connection_register_fallback - - dbus_pending_call_set_notify -- iFppppp: - - dbus_connection_try_register_fallback - - dbus_connection_try_register_object_path -- iFpppppp: - - dbus_connection_set_timeout_functions - - dbus_connection_set_watch_functions - - dbus_server_set_timeout_functions - - dbus_server_set_watch_functions -wrappeddbusglib1: -- vFppp: - - dbus_g_type_collection_value_iterate - - dbus_g_type_map_value_iterate -- vFpppp: - - dbus_g_proxy_disconnect_signal -- vFppppp: - - dbus_g_proxy_connect_signal -- pFpppppiV: - - dbus_g_proxy_begin_call -- pFpppppiiV: - - dbus_g_proxy_begin_call_with_timeout -wrappeddbusmenuglib: -- vFppp: - - dbusmenu_menuitem_foreach - - dbusmenu_menuitem_send_about_to_show -- iFppp: - - dbusmenu_client_add_type_handler -wrappeddecor0: -wrappedevent21: -- vFpiwpp: - - event_set -wrappedexpat: -- vFpp: - - XML_SetAttlistDeclHandler - - XML_SetCharacterDataHandler - - XML_SetCommentHandler - - XML_SetDefaultHandler - - XML_SetDefaultHandlerExpand - - XML_SetElementDeclHandler - - XML_SetEndCdataSectionHandler - - XML_SetEndDoctypeDeclHandler - - XML_SetEndElementHandler - - XML_SetEndNamespaceDeclHandler - - XML_SetEntityDeclHandler - - XML_SetExternalEntityRefHandler - - XML_SetNotStandaloneHandler - - XML_SetNotationDeclHandler - - XML_SetProcessingInstructionHandler - - XML_SetSkippedEntityHandler - - XML_SetStartCdataSectionHandler - - XML_SetStartDoctypeDeclHandler - - XML_SetStartElementHandler - - XML_SetStartNamespaceDeclHandler - - XML_SetUnparsedEntityDeclHandler - - XML_SetXmlDeclHandler -- vFppp: - - XML_SetElementHandler - - XML_SetNamespaceDeclHandler - - XML_SetUnknownEncodingHandler -wrappedfaudio: -- vFpp: - - FAudio_UnregisterForCallbacks -- uFpp: - - FAudio_RegisterForCallbacks -- vFppp: - - FAudio_SetEngineProcedureEXT -- uFpCppp: - - FAudioCOMConstructWithCustomAllocatorEXT -- uFpuppp: - - FAudioCreateReverb9WithCustomAllocatorEXT - - FAudioCreateReverbWithCustomAllocatorEXT - - FAudioCreateVolumeMeterWithCustomAllocatorEXT -- uFpuuppp: - - FAudioCreateWithCustomAllocatorEXT -- uFpppuppp: - - FAPOFX_CreateFXWithCustomAllocatorEXT -- uFpppufppp: - - FAudio_CreateSourceVoice -wrappedflac: -- iFppPPPPPP: - - FLAC__metadata_chain_read_with_callbacks -- iFpppppppppp: - - FLAC__stream_decoder_init_stream -wrappedfontconfig: -- pFpV: - - FcObjectSetBuild - - FcPatternBuild -- pFpA: - - FcObjectSetVaBuild - - FcPatternVaBuild -wrappedfreebl3: -wrappedfreetype: -- iFpp: - - FT_New_Library -- iFppp: - - FT_Outline_Decompose -- iFpplp: - - FT_Open_Face -- iFpuuLppp: - - FTC_Manager_New -wrappedgbm: -- vFppp: - - gbm_bo_set_user_data -wrappedgconf2: -- uFpppppp: - - gconf_client_notify_add -wrappedgcrypt: -- uFpppV: - - gcry_sexp_build -wrappedgdk3: -- vFpp: - - gdk_init - - gdk_threads_set_lock_functions -- iFpp: - - gdk_init_check -- uFpp: - - gdk_threads_add_idle -- vFppp: - - gdk_event_handler_set - - gdk_window_add_filter - - gdk_window_remove_filter -- iFiipp: - - gdk_input_add -- uFippp: - - gdk_threads_add_idle_full -- iFiippp: - - gdk_input_add_full -- uFiuppp: - - gdk_threads_add_timeout_full -wrappedgdkpixbuf2: -- pFpiiiiiipp: - - gdk_pixbuf_new_from_data -wrappedgdkx112: -- vFpp: - - gdk_init -- iFpp: - - gdk_init_check -- vFppp: - - gdk_event_handler_set - - gdk_window_add_filter - - gdk_window_remove_filter -- iFiipp: - - gdk_input_add -- iFiippp: - - gdk_input_add_full -- uFiuppp: - - gdk_threads_add_timeout_full -wrappedgio2: -- vFppp: - - g_simple_async_result_set_op_res_gpointer - - g_task_return_pointer -- vFippp: - - g_bus_get -- vFppip: - - g_simple_async_result_run_in_thread -- vFpppp: - - g_dbus_connection_close - - g_dbus_connection_flush - - g_simple_async_report_gerror_in_idle - - g_simple_async_report_take_gerror_in_idle -- uFpppp: - - g_dbus_connection_add_filter -- LFpppp: - - g_cancellable_connect -- pFpppp: - - g_simple_async_result_new - - g_simple_async_result_new_from_error - - g_simple_async_result_new_take_error - - g_task_new -- vFpippp: - - g_async_initable_init_async -- vFpuipV: - - g_task_return_new_error -- vFppipV: - - g_simple_async_result_set_error -- vFppipA: - - g_simple_async_result_set_error_va -- pFppppV: - - g_initable_new -- pFppApp: - - g_initable_new_valist -- vFpipppp: - - g_dbus_connection_new_for_address -- vFiippppV: - - g_async_initable_new_async -- vFiupippp: - - g_async_initable_newv_async -- vFipAippp: - - g_async_initable_new_valist_async -- vFppipppp: - - g_dbus_connection_new -- vFppLippp: - - g_input_stream_read_async -- vFpppuipV: - - g_simple_async_report_error_in_idle -- uFipipppp: - - g_bus_watch_name -- uFppipppp: - - g_bus_own_name_on_connection - - g_bus_watch_name_on_connection -- uFppppppp: - - g_dbus_connection_register_object -- pFpppuipV: - - g_simple_async_result_new_error -- vFppiipppp: - - g_dbus_connection_send_message_with_reply -- vFpppiippp: - - g_dbus_proxy_call -- uFipippppp: - - g_bus_own_name -- vFiippppppp: - - g_dbus_proxy_new_for_bus -- vFpippppppp: - - g_dbus_proxy_new -- vFpppiipppp: - - g_dbus_proxy_call_with_unix_fd_list -- pFiippppppp: - - g_dbus_object_manager_client_new_for_bus_sync -- uFppppppippp: - - g_dbus_connection_signal_subscribe -- vFpppppppiippp: - - g_dbus_connection_call -wrappedglesv2: -wrappedglib2: -- vFp: - - g_atexit -- pFp: - - g_completion_new - - g_main_context_get_poll_func - - g_private_new - - g_ptr_array_new_with_free_func - - g_set_print_handler - - g_set_printerr_handler -- vFpp: - - g_array_set_clear_func - - g_array_sort - - g_completion_set_compare - - g_list_free_full - - g_main_context_set_poll_func - - g_ptr_array_set_free_func - - g_ptr_array_sort - - g_slist_free_full - - g_source_set_funcs - - g_thread_foreach -- vFpV: - - g_print - - g_printerr -- iFpp: - - g_source_remove_by_funcs_user_data -- iFpV: - - g_printf -- iFpA: - - g_vprintf -- uFpp: - - g_idle_add -- LFpA: - - g_printf_string_upper_bound -- pFup: - - g_ptr_array_new_full -- pFpu: - - g_source_new -- pFpp: - - g_hash_table_new - - g_list_sort - - g_log_set_default_handler - - g_slist_sort - - g_strjoinv - - g_variant_new_parsed_va -- pFpV: - - g_build_filename - - g_markup_printf_escaped - - g_strconcat - - g_strdup_printf - - g_strjoin - - g_variant_new -- pFpA: - - g_markup_vprintf_escaped - - g_strdup_vprintf -- vFppp: - - g_array_sort_with_data - - g_hash_table_foreach - - g_list_foreach - - g_option_context_add_main_entries - - g_option_group_set_parse_hooks - - g_ptr_array_foreach - - g_ptr_array_sort_with_data - - g_queue_foreach - - g_static_private_set -- vFppV: - - g_string_append_printf - - g_string_printf - - g_variant_builder_add - - g_variant_get -- vFppA: - - g_string_append_vprintf - - g_string_vprintf -- iFppV: - - g_fprintf - - g_sprintf -- iFppA: - - g_vasprintf - - g_vfprintf - - g_vsprintf -- uFipp: - - g_child_watch_add -- uFupp: - - g_timeout_add - - g_timeout_add_seconds -- uFppp: - - g_hash_table_foreach_remove - - g_hash_table_foreach_steal -- pFppp: - - g_hash_table_find - - g_list_find_custom - - g_list_insert_sorted - - g_list_sort_with_data - - g_node_copy_deep - - g_once_impl - - g_queue_find_custom - - g_slist_find_custom - - g_slist_foreach - - g_slist_insert_sorted - - g_slist_sort_with_data - - g_thread_new - - g_variant_new_va -- pFppV: - - g_build_path -- vFpipV: - - g_log -- vFpipA: - - g_logv -- vFpupp: - - g_datalist_id_set_data_full -- vFpppp: - - g_source_set_callback -- iFpLpV: - - g_snprintf -- iFpLpA: - - g_vsnprintf -- uFippp: - - g_idle_add_full -- uFpipp: - - g_io_add_watch - - g_log_set_handler -- pFpipp: - - g_markup_parse_context_new -- pFpipV: - - g_error_new -- pFpipA: - - g_error_new_valist -- pFpupp: - - g_datalist_id_dup_data -- pFpLpp: - - g_bytes_new_with_free_func -- pFppip: - - g_thread_create -- pFpppp: - - g_hash_table_new_full - - g_list_insert_sorted_with_data - - g_slist_insert_sorted_with_data - - g_thread_try_new -- vFpiLpp: - - g_qsort_with_data -- vFppipV: - - g_set_error -- uFiippp: - - g_child_watch_add_full -- uFiuppp: - - g_timeout_add_full - - g_timeout_add_seconds_full -- pFppppp: - - g_option_group_new -- vFpiiipp: - - g_node_traverse -- iFpupppp: - - g_datalist_id_replace_data -- uFpiippp: - - g_io_add_watch_full -- pFppuipp: - - g_variant_new_from_data -- pFppLiiip: - - g_thread_create_full -- iFpppipppp: - - g_spawn_async -- iFpppipppppp: - - g_spawn_sync -- iFpppippppppp: - - g_spawn_async_with_pipes -wrappedgmodule2: -wrappedgmp: -- vFppp: - - __gmp_get_memory_functions - - __gmp_set_memory_functions -wrappedgnutls: -- vFp: - - gnutls_global_set_log_function -- vFpp: - - gnutls_transport_set_pull_function - - gnutls_transport_set_pull_timeout_function - - gnutls_transport_set_push_function -wrappedgobject2: -- pFL: - - g_type_value_table_peek -- pFp: - - g_type_class_peek_parent -- vFpp: - - g_closure_set_marshal -- iFpp: - - g_param_type_register_static -- pFpp: - - g_value_array_sort -- vFiip: - - g_value_register_transform_func -- vFLLp: - - g_type_add_interface_static -- vFpup: - - g_object_class_install_properties -- vFppp: - - g_closure_add_finalize_notifier - - g_closure_remove_finalize_notifier - - g_object_weak_ref - - g_signal_override_class_handler -- vFppV: - - g_object_get - - g_object_set -- vFppA: - - g_object_get_valist - - g_object_set_valist -- LFppp: - - g_boxed_type_register_static -- pFLpV: - - g_object_new -- pFLpA: - - g_object_new_valist -- pFppp: - - g_cclosure_new - - g_cclosure_new_swap - - g_value_array_sort_with_data -- pFppV: - - g_object_connect -- vFpuuV: - - g_signal_emit -- vFpupp: - - g_param_spec_set_qdata_full -- vFpupA: - - g_signal_emit_valist -- vFpppp: - - g_object_set_data_full - - g_object_set_qdata_full -- LFLppi: - - g_type_register_static -- LFupppp: - - g_signal_add_emission_hook -- LFLpppi: - - g_type_register_fundamental -- LFppppi: - - g_signal_connect_object -- LFpppppu: - - g_signal_connect_data -- uFpiupppp: - - g_signal_handlers_block_matched - - g_signal_handlers_disconnect_matched - - g_signal_handlers_unblock_matched -- LFLpupupu: - - g_type_register_static_simple -- LFpiupppp: - - g_signal_handler_find -- uFpLiupppLuV: - - g_signal_new -- uFpLippppLup: - - g_signal_newv -- uFpLippppLuA: - - g_signal_new_valist -wrappedgomp: -- vFppuu: - - GOMP_parallel -wrappedgssapi: -wrappedgssapikrb5: -wrappedgstallocators: -wrappedgstapp: -wrappedgstaudio: -wrappedgstbase: -- vFppp: - - gst_collect_pads_set_buffer_function - - gst_collect_pads_set_clip_function - - gst_collect_pads_set_event_function - - gst_collect_pads_set_function - - gst_collect_pads_set_query_function -- pFppupi: - - gst_collect_pads_add_pad -wrappedgstcheck: -wrappedgstcontroller: -wrappedgstfft: -wrappedgstgl: -- pFup: - - gst_gl_context_default_get_proc_address -- vFppp: - - gst_gl_context_thread_add - - gst_gl_window_send_message -- vFppV: - - gst_gl_insert_debug_marker -- pFuup: - - gst_gl_context_get_proc_address_with_platform -- vFpppp: - - gst_gl_window_set_close_callback - - gst_gl_window_set_draw_callback - - gst_gl_window_set_resize_callback -- iFpppp: - - gst_gl_framebuffer_draw_to_texture -- iFppppp: - - gst_gl_filter_render_to_target -wrappedgstnet: -wrappedgstpbutils: -wrappedgstreamer: -- pFA: - - gst_tag_list_new_valist -- vFpp: - - gst_init -- pFpp: - - gst_plugin_load_file -- pFpV: - - _gst_element_error_printf - - gst_caps_features_new - - gst_make_element_message_details - - gst_tag_list_new -- pFpA: - - gst_caps_features_new_valist -- vFppp: - - gst_pad_sticky_events_foreach - - gst_structure_filter_and_map_in_place - - gst_tag_list_foreach -- vFppV: - - gst_bin_add_many - - gst_caps_set_simple - - gst_structure_remove_fields - - gst_structure_set -- vFppA: - - gst_caps_set_simple_valist - - gst_structure_remove_fields_valist - - gst_structure_set_valist -- iFppp: - - gst_buffer_foreach_meta - - gst_caps_foreach - - gst_element_foreach_sink_pad - - gst_init_check - - gst_structure_foreach -- iFppV: - - gst_element_link_many - - gst_structure_get -- iFppA: - - gst_info_vasprintf - - gst_structure_get_valist -- uFppp: - - gst_bus_add_watch -- pFppp: - - gst_task_new -- pFppV: - - gst_caps_new_simple - - gst_structure_new -- pFppA: - - gst_structure_new_valist -- vFpipV: - - gst_tag_list_add - - gst_tag_list_add_values -- vFpipA: - - gst_tag_list_add_valist - - gst_tag_list_add_valist_values -- vFpppp: - - gst_bus_set_sync_handler - - gst_mini_object_set_qdata - - gst_pad_set_activate_function_full - - gst_pad_set_activatemode_function_full - - gst_pad_set_chain_function_full - - gst_pad_set_event_function_full - - gst_pad_set_getrange_function_full - - gst_pad_set_iterate_internal_links_function_full - - gst_pad_set_link_function_full - - gst_pad_set_query_function_full -- iFpppp: - - gst_iterator_fold - - gst_pad_start_task -- pFppip: - - gst_registry_feature_filter -- pFpppV: - - gst_pad_create_stream_id_printf -- pFpppA: - - gst_pad_create_stream_id_printf_valist -- uFpippp: - - gst_bus_add_watch_full -- LFpippp: - - gst_pad_add_probe -- pFiplllpp: - - gst_buffer_new_wrapped_full -- pFipLLLpp: - - gst_memory_new_wrapped -- pFpuLpipp: - - gst_util_array_binary_search -- vFpippippV: - - gst_debug_log -- vFpippippA: - - gst_debug_log_valist -- iFppuppppp: - - gst_type_find_register -- iFiipppppppp: - - gst_plugin_register_static -wrappedgstriff: -wrappedgstrtp: -wrappedgstrtsp: -wrappedgstsdp: -wrappedgsttag: -wrappedgstvideo: -wrappedgthread2: -- vFp: - - g_thread_init - - g_thread_init_with_errorcheck_mutexes -wrappedgtk3: -- pFi: - - gtk_type_class -- vFpp: - - gtk_builder_connect_signals - - gtk_init -- vFpA: - - gtk_style_context_get_style_valist -- iFLp: - - gtk_type_unique -- iFpp: - - gtk_init_check -- pFuV: - - gtk_tree_store_new -- vFpiA: - - gtk_style_context_get_valist -- vFppp: - - gtk_builder_connect_signals_full - - gtk_clipboard_request_text - - gtk_container_forall - - gtk_container_foreach - - gtk_menu_attach_to_widget -- vFppV: - - gtk_dialog_add_buttons - - gtk_message_dialog_format_secondary_markup - - gtk_message_dialog_format_secondary_text - - gtk_style_context_get - - gtk_tree_store_set - - gtk_widget_style_get -- vFppA: - - gtk_tree_store_set_valist -- uFupp: - - gtk_timeout_add -- vFppiV: - - gtk_list_store_insert_with_values -- vFpppi: - - gtk_enumerate_printers -- vFpppp: - - gtk_object_set_data_full - - gtk_print_job_send - - gtk_stock_set_translate_func - - gtk_tree_sortable_set_default_sort_func - - gtk_tree_view_set_search_equal_func -- iFpppp: - - gtk_text_iter_backward_find_char - - gtk_text_iter_forward_find_char -- vFpippp: - - gtk_tree_sortable_set_sort_func -- vFpuppp: - - gtk_file_filter_add_custom -- vFppppp: - - gtk_tree_view_column_set_cell_data_func -- iFppuppp: - - gtk_clipboard_set_with_data - - gtk_clipboard_set_with_owner -- iFpppppp: - - gtk_init_with_args -- vFpppppuu: - - gtk_menu_popup -- pFppppppi: - - gtk_toolbar_insert_stock -- pFppppppp: - - gtk_toolbar_append_item - - gtk_toolbar_prepend_item -- LFppppppii: - - gtk_signal_connect_full -- pFpppppppi: - - gtk_toolbar_insert_item -- pFpippppppp: - - gtk_toolbar_append_element - - gtk_toolbar_prepend_element -- pFpipppppppi: - - gtk_toolbar_insert_element -wrappedgtkx112: -- fFp: - - gtk_spin_button_get_value_as_float -- pFi: - - gtk_type_class -- vFpp: - - gtk_builder_connect_signals - - gtk_init -- iFpp: - - gtk_init_check - - gtk_type_unique -- pFiV: - - gtk_list_store_new - - gtk_tree_store_new -- pFpi: - - gtk_type_check_object_cast -- vFppp: - - gtk_builder_connect_signals_full - - gtk_clipboard_request_text - - gtk_container_forall - - gtk_container_foreach - - gtk_menu_attach_to_widget - - gtk_tree_model_foreach - - gtk_tree_selection_selected_foreach -- vFppV: - - gtk_dialog_add_buttons - - gtk_list_store_set - - gtk_message_dialog_format_secondary_markup - - gtk_message_dialog_format_secondary_text - - gtk_tree_model_get - - gtk_widget_style_get -- vFppA: - - gtk_list_store_set_valist - - gtk_tree_model_get_valist - - gtk_widget_style_get_valist -- uFupp: - - gtk_timeout_add -- pFppp: - - gtk_link_button_set_uri_hook -- vFppiV: - - gtk_list_store_insert_with_values -- vFppup: - - gtk_action_group_add_actions -- vFpppi: - - gtk_enumerate_printers -- vFpppp: - - gtk_clipboard_request_contents - - gtk_object_set_data_full - - gtk_print_job_send - - gtk_stock_set_translate_func - - gtk_tree_sortable_set_default_sort_func - - gtk_tree_view_set_search_equal_func -- iFpppp: - - gtk_text_iter_backward_find_char - - gtk_text_iter_forward_find_char -- LFpppp: - - gtk_signal_connect -- vFpippp: - - gtk_tree_sortable_set_sort_func -- vFpuppp: - - gtk_file_filter_add_custom -- vFppupp: - - gtk_action_group_add_actions_full -- vFppppp: - - gtk_cell_layout_set_cell_data_func - - gtk_tree_view_column_set_cell_data_func -- vFpuipuV: - - gtk_binding_entry_add_signal -- iFppuppp: - - gtk_clipboard_set_with_data - - gtk_clipboard_set_with_owner -- iFpppppp: - - gtk_init_with_args -- uFiipppp: - - gtk_input_add_full -- vFpppppuu: - - gtk_menu_popup -- pFppppppi: - - gtk_toolbar_insert_stock -- pFppppppp: - - gtk_toolbar_append_item - - gtk_toolbar_prepend_item -- LFppppppii: - - gtk_signal_connect_full -- pFpppppppi: - - gtk_toolbar_insert_item -- pFpippppppp: - - gtk_toolbar_append_element - - gtk_toolbar_prepend_element -- pFpipppppppi: - - gtk_toolbar_insert_element -wrappedicui18n64: -wrappedicui18n66: -wrappedicui18n67: -wrappedicui18n72: -wrappedicui18n73: -wrappedicui18n74: -wrappedicuuc64: -wrappedicuuc66: -wrappedicuuc67: -wrappedicuuc72: -wrappedicuuc73: -wrappedicuuc74: -wrappedidn2: -wrappedkrb5: -- iFppppppipp: - - krb5_get_init_creds_password -wrappedlber: -- iFppip: - - ber_sockbuf_add_io -wrappedlcms2: -wrappedldapr: -- iFpppppupp: - - ldap_sasl_interactive_bind_s -wrappedldlinux: -- pFp: - - __tls_get_addr -wrappedlibasound: -- iFp: - - snd_dlclose - - snd_lib_error_set_handler -- vFpp: - - snd_mixer_elem_set_callback -- pFppp: - - snd_dlsym -- iFpipp: - - snd_async_add_handler -- iFpppp: - - snd_async_add_pcm_handler -- pFpipL: - - snd_dlopen -wrappedlibbsd: -wrappedlibc: -- vFv: - - _Jv_RegisterClasses - - __cxa_pure_virtual - - __stack_chk_fail -- vFi: - - exit -- vFp: - - _ITM_deregisterTMCloneTable - - __cxa_finalize -- iFv: - - fork - - vfork -- iFi: - - iopl -- iFp: - - _setjmp - - atexit - - getcontext - - register_printf_type - - setcontext - - setjmp - - stime - - uname -- IFi: - - sysconf -- lFv: - - syscall -- lFi: - - __sysconf -- LFL: - - getauxval -- pFp: - - __deregister_frame_info - - mallinfo -- vFpi: - - __longjmp_chk - - _longjmp - - _obstack_newchunk - - longjmp - - siglongjmp -- vFpu: - - _ITM_registerTMCloneTable -- vFpp: - - __register_frame_info - - _obstack_free - - obstack_free - - tdestroy - - twalk -- vFpV: - - warn - - warnx -- iFip: - - fstat - - fstat64 -- iFup: - - setrlimit -- iFpi: - - __sigsetjmp - - backtrace - - sigsetjmp -- iFpL: - - munmap -- iFpp: - - __vprintf_chk - - dl_iterate_phdr - - execv - - execvp - - lstat - - lstat64 - - sigaltstack - - stat - - stat64 - - swapcontext -- iFpV: - - __isoc99_scanf - - execl - - execle - - execlp - - printf - - wprintf -- iFpA: - - __isoc99_vscanf - - vprintf - - vscanf - - vwprintf -- iFSp: - - _IO_file_stat -- pFip: - - __sysv_signal - - bsd_signal - - signal - - sigset - - sysv_signal -- pFpi: - - backtrace_symbols -- pFpp: - - __realpath_chk - - fopen - - fopen64 - - realpath -- vFipV: - - err - - errx - - syslog -- vFipA: - - vsyslog -- vFpii: - - backtrace_symbols_fd -- vFpup: - - _ITM_addUserCommitAction -- iFiip: - - __fxstat - - __fxstat64 -- iFiiN: - - __fcntl - - fcntl - - fcntl64 -- iFipp: - - __lxstat - - __lxstat64 - - __sigaction - - __xstat - - __xstat64 - - getopt - - register_printf_specifier - - sigaction -- iFipV: - - __printf_chk - - dprintf -- iFipA: - - vdprintf -- iFpLi: - - mprotect -- iFppi: - - ftw - - ftw64 -- iFppp: - - __cxa_atexit - - __cxa_thread_atexit_impl - - __vfprintf_chk - - __vsscanf - - execve -- iFppV: - - __asprintf - - __isoc23_fscanf - - __isoc23_sscanf - - __isoc99_fscanf - - __isoc99_sscanf - - __isoc99_swscanf - - asprintf - - fprintf - - fscanf - - fwprintf - - sprintf - - sscanf - - swscanf -- iFppA: - - __isoc99_vfscanf - - __isoc99_vsscanf - - __isoc99_vswscanf - - obstack_vprintf - - vasprintf - - vfprintf - - vfscanf - - vfwprintf - - vsprintf - - vsscanf - - vswscanf -- iFpOu: - - __open - - open - - open64 -- lFipV: - - __wprintf_chk -- lFppL: - - readlink -- LFppL: - - strlcat - - strlcpy -- pFpip: - - fts64_open - - fts_open -- pFppp: - - tdelete - - tfind - - tsearch -- pFppV: - - fopencookie -- vFiipV: - - __syslog_chk -- vFiipA: - - __vsyslog_chk -- vFpLLp: - - qsort -- vFpppp: - - __libc_init -- iFiiip: - - epoll_ctl -- iFiiiN: - - semctl -- iFiipV: - - __dprintf_chk -- iFiipA: - - __vdprintf_chk -- iFipii: - - epoll_wait -- iFipup: - - __xmknod -- iFippi: - - fstatat - - fstatat64 -- iFippL: - - readlinkat -- iFpipp: - - __vasprintf_chk - - glob - - glob64 -- iFpipV: - - __asprintf_chk - - __fprintf_chk - - __fwprintf_chk -- iFpipA: - - __vfwprintf_chk -- iFpLpV: - - __snprintf - - snprintf - - swprintf -- iFpLpA: - - __vsnprintf - - vsnprintf - - vswprintf -- iFppii: - - nftw64 -- iFppiV: - - makecontext -- iFpppp: - - __register_atfork - - __vsprintf_chk - - scandir - - scandir64 -- lFuipp: - - ptrace -- vFpLLpp: - - qsort_r -- iFiipup: - - __xmknodat -- iFiippi: - - __fxstatat - - __fxstatat64 -- iFiLLLL: - - prctl -- iFipiip: - - epoll_pwait -- iFipppp: - - getopt_long - - getopt_long_only - - scandirat -- iFpilpV: - - __sprintf_chk -- iFpuppp: - - __vswprintf_chk -- iFpLLpp: - - _obstack_begin -- pFpLLiN: - - mremap -- pFppLLp: - - bsearch -- pFpppLp: - - lfind - - lsearch -- iFpLiLpp: - - __vsnprintf_chk -- iFpLiLpV: - - __snprintf_chk - - __swprintf_chk -- iFpppppp: - - posix_spawn - - posix_spawnp -- pFpLiiil: - - mmap - - mmap64 -- iFpippppp: - - __libc_start_main -- iFppipppp: - - clone -wrappedlibcmusl: -wrappedlibcrypt: -wrappedlibcups: -- vFpp: - - cupsSetPasswordCB2 -- iFuipuupp: - - cupsEnumDests -wrappedlibdl: -- iFp: - - dlclose -- pFv: - - dlerror -- iFpp: - - _dl_find_object - - dladdr -- pFpi: - - dlopen -- pFpp: - - dlsym -- iFpip: - - dlinfo -- pFppi: - - dlmopen -- pFppp: - - dlvsym -- iFpppi: - - dladdr1 -wrappedlibdrm: -- vFpV: - - drmMsg -wrappedlibegl: -- pFp: - - eglGetProcAddress -wrappedlibform: -wrappedlibformw: -wrappedlibformw6: -wrappedlibfuse: -- iFpp: - - fuse_reply_entry -- iFppd: - - fuse_reply_attr -- iFppp: - - fuse_reply_create -- iFpppp: - - fuse_opt_parse -- pFppLp: - - fuse_lowlevel_new -- iFippLp: - - fuse_main_real -- LFppLppU: - - fuse_add_direntry -wrappedlibgl: -- iFi: - - glXSwapIntervalMESA -- pFp: - - glGetVkProcAddrNV - - glXGetProcAddress - - glXGetProcAddressARB -- vFpp: - - glDebugMessageCallback - - glDebugMessageCallbackAMD - - glDebugMessageCallbackARB - - glDebugMessageCallbackKHR -- iFpp: - - eglDebugMessageControlKHR -- vFipp: - - glProgramCallbackMESA -- vFppi: - - glXSwapIntervalEXT -- vFppp: - - eglSetBlobCacheFuncsANDROID -wrappedlibglu: -- vFpip: - - gluNurbsCallback - - gluQuadricCallback - - gluTessCallback -wrappedlibglx: -- pFp: - - glXGetProcAddress - - glXGetProcAddressARB -wrappedlibharfbuzz: -- vFp: - - hb_draw_funcs_destroy - - hb_font_funcs_destroy -- pFp: - - hb_unicode_funcs_reference -- pFpp: - - hb_ft_face_create -- vFppp: - - hb_font_set_funcs_data -- pFppp: - - hb_face_create_for_tables -- vFpppp: - - hb_buffer_set_message_func - - hb_draw_funcs_set_close_path_func - - hb_draw_funcs_set_cubic_to_func - - hb_draw_funcs_set_line_to_func - - hb_draw_funcs_set_move_to_func - - hb_draw_funcs_set_quadratic_to_func - - hb_font_funcs_set_font_h_extents_func - - hb_font_funcs_set_font_v_extents_func - - hb_font_funcs_set_glyph_contour_point_func - - hb_font_funcs_set_glyph_extents_func - - hb_font_funcs_set_glyph_from_name_func - - hb_font_funcs_set_glyph_func - - hb_font_funcs_set_glyph_h_advance_func - - hb_font_funcs_set_glyph_h_advances_func - - hb_font_funcs_set_glyph_h_kerning_func - - hb_font_funcs_set_glyph_h_origin_func - - hb_font_funcs_set_glyph_name_func - - hb_font_funcs_set_glyph_shape_func - - hb_font_funcs_set_glyph_v_advance_func - - hb_font_funcs_set_glyph_v_advances_func - - hb_font_funcs_set_glyph_v_kerning_func - - hb_font_funcs_set_glyph_v_origin_func - - hb_font_funcs_set_nominal_glyph_func - - hb_font_funcs_set_nominal_glyphs_func - - hb_font_funcs_set_variation_glyph_func - - hb_font_set_funcs - - hb_unicode_funcs_set_combining_class_func - - hb_unicode_funcs_set_compose_func - - hb_unicode_funcs_set_decompose_compatibility_func - - hb_unicode_funcs_set_decompose_func - - hb_unicode_funcs_set_eastasian_width_func - - hb_unicode_funcs_set_general_category_func - - hb_unicode_funcs_set_mirroring_func - - hb_unicode_funcs_set_script_func -- iFppppi: - - hb_blob_set_user_data - - hb_buffer_set_user_data - - hb_face_set_user_data - - hb_font_funcs_set_user_data - - hb_font_set_user_data - - hb_unicode_funcs_set_user_data -- pFpuupp: - - hb_blob_create - - hb_blob_create_or_fail -wrappedlibhogweed6: -wrappedlibibus: -- vFpippp: - - ibus_bus_current_input_context_async - - ibus_bus_get_global_engine_async - - ibus_bus_list_active_engines_async - - ibus_bus_list_engines_async - - ibus_input_context_get_engine_async -- vFppippp: - - ibus_bus_create_input_context_async - - ibus_bus_set_global_engine_async - - ibus_config_get_values_async -- vFpppippp: - - ibus_config_get_value_async -- vFpuuuippp: - - ibus_input_context_process_key_event_async -- vFppppippp: - - ibus_config_set_value_async -wrappedlibice: -- pFp: - - IceSetErrorHandler - - IceSetIOErrorHandler -- iFpp: - - IceAddConnectionWatch - - IceRemoveConnectionWatch -wrappedlibm: -- iFv: - - fegetround -- iFi: - - fesetround -- iFf: - - lrintf -- iFd: - - lrint -- IFf: - - llrintf -- IFd: - - llrint -- IFD: - - llrintl -- IFK: - - llrintl -- fFf: - - __acosf_finite - - __acoshf_finite - - __asinf_finite - - __coshf_finite - - __exp2f_finite - - __expf_finite - - __log10f_finite - - __log2f_finite - - __logf_finite - - __sinhf_finite - - __sqrtf_finite - - nearbyintf - - pow10f - - rintf -- dFd: - - __acos_finite - - __acosh_finite - - __asin_finite - - __cosh_finite - - __exp2_finite - - __exp_finite - - __log10_finite - - __log2_finite - - __log_finite - - __sinh_finite - - __sqrt_finite - - nearbyint - - pow10 - - rint -- DFD: - - pow10l -- KFK: - - pow10l -- fFff: - - __atan2f_finite - - __fmodf_finite - - __hypotf_finite - - __powf_finite -- dFdd: - - __atan2_finite - - __fmod_finite - - __hypot_finite - - __pow_finite -wrappedlibncurses: -- pFv: - - initscr -- iFpV: - - printw -- iFppA: - - vwprintw -- iFiipV: - - mvprintw -- iFpiipV: - - mvwprintw -wrappedlibncurses6: -- pFv: - - initscr -- iFpV: - - printw -- iFppV: - - wprintw -- iFppA: - - vwprintw -- iFiipV: - - mvprintw -- iFpiipV: - - mvwprintw -wrappedlibncursesw: -- pFv: - - initscr -- iFpV: - - printw -- iFppV: - - wprintw -- iFppA: - - vwprintw -- iFiipV: - - mvprintw -- iFpiipV: - - mvwprintw -wrappedlibncursesw6: -- pFv: - - initscr -- iFpV: - - printw -- iFppA: - - vwprintw -- iFiipV: - - mvprintw -- iFpiipV: - - mvwprintw -wrappedlibnettle8: -wrappedlibnuma: -wrappedlibogg: -wrappedlibpanel: -wrappedlibpci: -wrappedlibpcre: -wrappedlibpthread: -- vFp: - - __pthread_register_cancel - - __pthread_unregister_cancel - - __pthread_unwind_next -- iFL: - - pthread_key_delete -- iFp: - - __pthread_mutexattr_destroy - - __pthread_mutexattr_init - - pthread_attr_destroy - - pthread_attr_init - - pthread_barrierattr_destroy - - pthread_barrierattr_init - - pthread_cond_broadcast - - pthread_cond_destroy - - pthread_cond_signal - - pthread_condattr_destroy - - pthread_condattr_init - - pthread_getattr_default_np - - pthread_mutexattr_destroy - - pthread_mutexattr_init - - pthread_setattr_default_np -- vFpi: - - _pthread_cleanup_pop - - _pthread_cleanup_pop_restore -- iFLp: - - pthread_getattr_np -- iFpi: - - __pthread_mutexattr_settype - - pthread_attr_setdetachstate - - pthread_attr_setinheritsched - - pthread_attr_setschedpolicy - - pthread_attr_setscope - - pthread_barrierattr_setpshared - - pthread_condattr_setclock - - pthread_condattr_setpshared - - pthread_kill - - pthread_kill@GLIBC_2.2.5 - - pthread_mutexattr_setkind_np - - pthread_mutexattr_setprotocol - - pthread_mutexattr_setpshared - - pthread_mutexattr_setrobust - - pthread_mutexattr_settype -- iFpL: - - pthread_attr_setguardsize - - pthread_attr_setstacksize -- iFpp: - - __pthread_key_create - - __pthread_mutex_init - - __pthread_once - - pthread_attr_getdetachstate - - pthread_attr_getguardsize - - pthread_attr_getinheritsched - - pthread_attr_getschedparam - - pthread_attr_getschedpolicy - - pthread_attr_getscope - - pthread_attr_getstackaddr - - pthread_attr_getstacksize - - pthread_attr_setschedparam - - pthread_attr_setstackaddr - - pthread_barrierattr_getpshared - - pthread_cond_init - - pthread_cond_wait - - pthread_condattr_getclock - - pthread_condattr_getpshared - - pthread_key_create - - pthread_mutex_init - - pthread_mutexattr_getkind_np - - pthread_mutexattr_getprotocol - - pthread_mutexattr_getrobust - - pthread_mutexattr_gettype - - pthread_once -- vFppp: - - _pthread_cleanup_push - - _pthread_cleanup_push_defer -- iFpLp: - - pthread_attr_setaffinity_np - - pthread_getaffinity_np - - pthread_setaffinity_np -- iFppu: - - pthread_barrier_init -- iFppL: - - pthread_attr_setstack -- iFppp: - - __pthread_atfork - - pthread_atfork - - pthread_attr_getstack - - pthread_cond_timedwait -- iFppip: - - pthread_cond_clockwait -- iFpppp: - - pthread_create -wrappedlibresolv: -wrappedlibrt: -- iFp: - - aio_read - - aio_read64 - - aio_write - - aio_write64 -- iFip: - - aio_cancel -- iFupp: - - timer_create -- iFipip: - - lio_listio -wrappedlibsm: -- pFp: - - SmcSetErrorHandler -- iFppp: - - SmcRequestSaveYourselfPhase2 -- iFpipp: - - SmcInteractRequest -- pFppiiLpppip: - - SmcOpenConnection -wrappedlibsndfile: -- iFp: - - sf_close -- pFpipp: - - sf_open_virtual -wrappedlibsqlite3: -wrappedlibssh2: -wrappedlibssl: -- pFp: - - SSL_get_verify_callback -- vFpp: - - SSL_CTX_sess_set_new_cb - - SSL_CTX_set_client_cert_cb - - SSL_CTX_set_cookie_generate_cb - - SSL_CTX_set_cookie_verify_cb - - SSL_CTX_set_default_passwd_cb - - SSL_set_psk_client_callback - - SSL_set_psk_server_callback - - SSL_set_psk_use_session_callback -- vFpip: - - SSL_CTX_set_verify - - SSL_set_verify -- vFppp: - - SSL_CTX_set_alpn_select_cb - - SSL_CTX_set_cert_verify_callback - - SSL_CTX_set_next_proto_select_cb -- lFpip: - - SSL_CTX_callback_ctrl - - SSL_callback_ctrl -- iFlpppp: - - SSL_get_ex_new_index -wrappedlibssl3: -- pFp: - - SSL_CTX_get_default_passwd_cb - - SSL_CTX_get_verify_callback - - SSL_get_verify_callback -- vFpp: - - SSL_CTX_set_client_cert_cb - - SSL_CTX_set_default_passwd_cb - - SSL_CTX_set_keylog_callback - - SSL_CTX_set_msg_callback - - SSL_set_msg_callback - - SSL_set_psk_client_callback -- vFpip: - - SSL_CTX_set_verify - - SSL_set_verify -- vFppp: - - SSL_CTX_set_alpn_select_cb - - SSL_CTX_set_cert_verify_callback - - SSL_CTX_set_next_proto_select_cb -- lFpip: - - SSL_CTX_callback_ctrl - - SSL_callback_ctrl -- iFlpppp: - - SSL_get_ex_new_index -wrappedlibtasn1: -wrappedlibtinfo: -- iFpip: - - tputs -wrappedlibtinfo6: -- iFpip: - - tputs -wrappedlibunistring2: -wrappedlibusb1: -- iFp: - - libusb_cancel_transfer - - libusb_submit_transfer -- pFi: - - libusb_alloc_transfer -- iFpiiiiippp: - - libusb_hotplug_register_callback -wrappedlibuuid: -wrappedlibva: -- pFppp: - - vaSetErrorCallback - - vaSetInfoCallback -wrappedlibvadrm: -wrappedlibvawayland: -wrappedlibvax11: -wrappedlibvdpau: -- iFpipp: - - vdp_device_create_x11 -wrappedlibvorbis: -wrappedlibx11: -- iFp: - - XDestroyImage - - XInitImage -- pFp: - - XOpenDisplay - - XSetErrorHandler - - XSetIOErrorHandler -- vFpp: - - _XDeqAsyncHandler -- pFiV: - - XVaCreateNestedList -- pFpi: - - XSynchronize -- pFpp: - - XSetAfterFunction -- pFpV: - - XCreateIC - - XSetICValues - - XSetIMValues -- iFppp: - - XAddConnectionWatch - - XRemoveConnectionWatch -- pFpip: - - XESetCloseDisplay - - XESetError - - XESetEventToWire - - XESetWireToEvent -- pFpuL: - - _XGetRequest -- iFpppp: - - XCheckIfEvent - - XIfEvent - - XPeekIfEvent -- iFppppp: - - XQueryExtension -- iFpppppp: - - XRegisterIMInstantiateCallback - - XUnregisterIMInstantiateCallback -- pFppiiuuLi: - - XGetImage -- iFppppiiiiuu: - - XPutImage -- pFppuiipuuii: - - XCreateImage -- pFppiiuuuipii: - - XGetSubImage -wrappedlibx11xcb: -- pFp: - - XGetXCBConnection -wrappedlibxau: -wrappedlibxcb: -- vFp: - - xcb_disconnect -- pFpp: - - xcb_connect -wrappedlibxcbcursor: -wrappedlibxcbdri2: -wrappedlibxcbdri3: -wrappedlibxcbglx: -wrappedlibxcbicccm: -wrappedlibxcbimage: -wrappedlibxcbkeysyms: -wrappedlibxcbpresent: -wrappedlibxcbrandr: -wrappedlibxcbrender: -wrappedlibxcbrenderutil: -wrappedlibxcbshape: -wrappedlibxcbshm: -wrappedlibxcbsync: -wrappedlibxcbutil: -wrappedlibxcbxfixes: -wrappedlibxcbxinerama: -wrappedlibxcbxinput: -wrappedlibxcbxkb: -wrappedlibxcbxtest: -wrappedlibxcomposite: -wrappedlibxcursor: -wrappedlibxdamage: -wrappedlibxdmcp: -wrappedlibxext: -- pFp: - - XSetExtensionErrorHandler -- iFpppiiu: - - XShmGetImage -- pFppppip: - - XextAddDisplay -- pFppuippuu: - - XShmCreateImage -- iFppppiiiiuui: - - XShmPutImage -wrappedlibxfixes: -wrappedlibxft: -wrappedlibxi: -wrappedlibxmu: -wrappedlibxpm: -wrappedlibxpresent: -wrappedlibxrandr: -wrappedlibxrender: -wrappedlibxss: -wrappedlibxt: -- vFpp: - - XtAppSetErrorHandler - - XtAppSetErrorMsgHandler - - XtAppSetWarningHandler - - XtAppSetWarningMsgHandler -- lFppp: - - XtAppAddWorkProc -- vFpuipp: - - XtAddEventHandler - - XtAddRawEventHandler -- lFpippp: - - XtAppAddInput -wrappedlibxtst: -- iFpppp: - - XRecordEnableContext - - XRecordEnableContextAsync -wrappedlibxxf86vm: -wrappedlibz: -- iFp: - - deflateEnd - - inflateEnd -- iFpi: - - inflate -- iFppi: - - inflateInit_ -- iFpipi: - - deflateInit_ - - inflateInit2_ -- iFpippi: - - inflateBackInit_ -- iFpiiiiipi: - - deflateInit2_ -wrappedlzma: -- vFp: - - lzma_end -- vFpp: - - lzma_index_end -- iFpi: - - lzma_code -- iFpU: - - lzma_alone_decoder -- iFpp: - - lzma_alone_encoder - - lzma_raw_decoder - - lzma_raw_encoder - - lzma_stream_encoder_mt -- iFpui: - - lzma_easy_encoder -- iFpUi: - - lzma_stream_decoder -- iFppi: - - lzma_stream_encoder -- iFpppL: - - lzma_properties_decode -- iFpppppL: - - lzma_index_buffer_decode -- iFpupppLppL: - - lzma_stream_buffer_decode -wrappedmpg123: -- iFpppp: - - mpg123_replace_reader_handle - - mpg123_replace_reader_handle_64 -wrappednotify: -wrappednsl: -wrappednspr4: -- iFpp: - - PR_CallOnce -- iFppp: - - PR_CallOnceWithArg -wrappednss3: -- vFp: - - PK11_SetPasswordFunc - - PORT_SetUCS2_ASCIIConversionFunction -- iFpp: - - CERT_RegisterAlternateOCSPAIAInfoCallBack - - NSS_RegisterShutdown -- iFpIppp: - - CERT_PKIXVerifyCert -wrappednssutil3: -wrappedopenal: -- vFv: - - alRequestFoldbackStop -- pFp: - - alGetProcAddress -- pFpp: - - alcGetProcAddress -- vFiiipp: - - alRequestFoldbackStart -wrappedopencl: -- pFpuppp: - - clCreateContextFromType -- iFpupppp: - - clBuildProgram -- pFpupppp: - - clCreateContext -wrappedp11kit: -wrappedpam: -wrappedpango: -- vFpp: - - pango_attribute_init -wrappedpangocairo: -wrappedpangoft2: -wrappedplc4: -wrappedplds4: -wrappedpng16: -- vFpp: - - png_set_read_user_transform_fn -- vFppp: - - png_set_read_fn -- vFpppp: - - png_set_error_fn - - png_set_write_fn -- pFpppp: - - png_create_read_struct -- vFppppp: - - png_set_progressive_read_fn -- pFppppppp: - - png_create_read_struct_2 - - png_create_write_struct_2 -wrappedpsl5: -wrappedpulse: -- vFp: - - pa_mainloop_free - - pa_threaded_mainloop_free -- iFp: - - pa_signal_init -- pFp: - - pa_mainloop_get_api - - pa_threaded_mainloop_get_api -- vFpp: - - pa_signal_set_destroy -- pFpp: - - pa_context_new -- vFppp: - - pa_context_set_event_callback - - pa_context_set_state_callback - - pa_context_set_subscribe_callback - - pa_mainloop_api_once - - pa_mainloop_set_poll_func - - pa_stream_set_buffer_attr_callback - - pa_stream_set_event_callback - - pa_stream_set_latency_update_callback - - pa_stream_set_moved_callback - - pa_stream_set_overflow_callback - - pa_stream_set_read_callback - - pa_stream_set_started_callback - - pa_stream_set_state_callback - - pa_stream_set_suspended_callback - - pa_stream_set_underflow_callback - - pa_stream_set_write_callback -- pFipp: - - pa_signal_new -- pFppp: - - pa_context_drain - - pa_context_exit_daemon - - pa_context_get_card_info_list - - pa_context_get_client_info_list - - pa_context_get_module_info_list - - pa_context_get_server_info - - pa_context_get_sink_info_list - - pa_context_get_sink_input_info_list - - pa_context_get_source_info_list - - pa_context_get_source_output_info_list - - pa_context_new_with_proplist - - pa_ext_device_restore_read_formats_all - - pa_ext_device_restore_set_subscribe_cb - - pa_stream_drain - - pa_stream_flush - - pa_stream_prebuf - - pa_stream_trigger - - pa_stream_update_timing_info -- iFppip: - - pa_context_connect -- iFpppV: - - pa_proplist_setf -- pFpipp: - - pa_ext_device_restore_subscribe - - pa_stream_cork -- pFpupp: - - pa_context_get_card_info_by_index - - pa_context_get_client_info - - pa_context_get_sink_info_by_index - - pa_context_get_sink_input_info - - pa_context_get_source_info_by_index - - pa_context_get_source_output_info - - pa_context_subscribe - - pa_context_unload_module - - pa_stream_update_sample_rate -- pFpUpp: - - pa_context_rttime_new -- pFpppp: - - pa_context_get_sink_info_by_name - - pa_context_get_source_info_by_name - - pa_context_proplist_remove - - pa_context_set_default_sink - - pa_context_set_default_source - - pa_context_set_name - - pa_stream_proplist_remove - - pa_stream_set_buffer_attr - - pa_stream_set_name -- pFpiupp: - - pa_ext_device_restore_read_formats -- pFpippp: - - pa_context_proplist_update - - pa_stream_proplist_update -- pFpuipp: - - pa_context_set_sink_input_mute - - pa_context_set_sink_mute_by_index - - pa_context_set_source_mute_by_index -- pFpuupp: - - pa_context_move_sink_input_by_index - - pa_context_move_source_output_by_index -- pFpuppp: - - pa_context_set_card_profile_by_index - - pa_context_set_sink_input_volume - - pa_context_set_sink_port_by_index - - pa_context_set_sink_volume_by_index - - pa_context_set_source_port_by_index - - pa_context_set_source_volume_by_index -- pFppppp: - - pa_context_load_module - - pa_context_set_sink_port_by_name - - pa_context_set_source_volume_by_name -- iFppLpIi: - - pa_stream_write -- pFpiuCppp: - - pa_ext_device_restore_save_formats -wrappedpulsemainloopglib: -- pFp: - - pa_glib_mainloop_get_api -wrappedpulsesimple: -wrappedsdl1: -- vFp: - - SDL_KillThread - - SDL_SetEventFilter - - SDL_UnloadObject -- iFv: - - SDL_Has3DNow - - SDL_Has3DNowExt - - SDL_HasAltiVec - - SDL_HasMMX - - SDL_HasMMXExt - - SDL_HasRDTSC - - SDL_HasSSE - - SDL_HasSSE2 -- iFp: - - SDL_GetWMInfo - - SDL_RemoveTimer -- uFp: - - SDL_ReadBE16 - - SDL_ReadBE32 - - SDL_ReadLE16 - - SDL_ReadLE32 -- UFp: - - SDL_ReadBE64 - - SDL_ReadLE64 -- pFv: - - SDL_GetEventFilter -- pFp: - - SDL_GL_GetProcAddress - - SDL_LoadObject -- iFup: - - SDL_SetTimer -- iFpp: - - SDL_OpenAudio -- uFpW: - - SDL_WriteBE16 - - SDL_WriteLE16 -- uFpu: - - SDL_WriteBE32 - - SDL_WriteLE32 -- uFpU: - - SDL_WriteBE64 - - SDL_WriteLE64 -- pFpi: - - SDL_LoadBMP_RW - - SDL_RWFromConstMem - - SDL_RWFromFP - - SDL_RWFromMem -- pFpp: - - SDL_CreateThread - - SDL_LoadFunction - - SDL_RWFromFile -- iFppi: - - SDL_SaveBMP_RW -- pFupp: - - SDL_AddTimer -- pFpippp: - - SDL_LoadWAV_RW -wrappedsdl1image: -- pFp: - - IMG_LoadBMP_RW - - IMG_LoadCUR_RW - - IMG_LoadGIF_RW - - IMG_LoadICO_RW - - IMG_LoadJPG_RW - - IMG_LoadLBM_RW - - IMG_LoadPCX_RW - - IMG_LoadPNG_RW - - IMG_LoadPNM_RW - - IMG_LoadTGA_RW - - IMG_LoadTIF_RW - - IMG_LoadWEBP_RW - - IMG_LoadXCF_RW - - IMG_LoadXPM_RW - - IMG_LoadXV_RW -- pFpi: - - IMG_Load_RW -- pFpip: - - IMG_LoadTyped_RW -wrappedsdl1mixer: -- vFp: - - Mix_ChannelFinished - - Mix_HookMusicFinished -- pFp: - - Mix_LoadMUS_RW -- vFpp: - - Mix_HookMusic - - Mix_SetPostMix -- iFip: - - Mix_UnregisterEffect -- pFpi: - - Mix_LoadWAV_RW -- pFpii: - - Mix_LoadMUSType_RW -- iFippp: - - Mix_RegisterEffect -wrappedsdl1net: -wrappedsdl1sound: -- pFpppu: - - Sound_NewSample -wrappedsdl1ttf: -- pFpii: - - TTF_OpenFontRW -- pFpiii: - - TTF_OpenFontIndexRW -wrappedsdl2: -% G SDL_JoystickGUID UU -- vFp: - - SDL_UnloadObject -- iFv: - - SDL_Has3DNow - - SDL_HasAVX - - SDL_HasAVX2 - - SDL_HasAVX512F - - SDL_HasAltiVec - - SDL_HasMMX - - SDL_HasNEON - - SDL_HasRDTSC - - SDL_HasSSE - - SDL_HasSSE2 - - SDL_HasSSE3 - - SDL_HasSSE41 - - SDL_HasSSE42 -- iFp: - - SDL_RWclose - - SDL_RemoveTimer - - SDL_SaveAllDollarTemplates -- IFp: - - SDL_RWtell -- uFp: - - SDL_ReadBE16 - - SDL_ReadBE32 - - SDL_ReadLE16 - - SDL_ReadLE32 - - SDL_ReadU8 -- UFp: - - SDL_ReadBE64 - - SDL_ReadLE64 -- LFp: - - SDL_GetThreadID -- pFv: - - SDL_GetBasePath - - SDL_Vulkan_GetVkGetInstanceProcAddr -- pFp: - - SDL_GL_GetProcAddress - - SDL_LoadObject -- vFpp: - - SDL_AddEventWatch - - SDL_DelEventWatch - - SDL_LogGetOutputFunction - - SDL_LogSetOutputFunction - - SDL_SetEventFilter -- vFpV: - - SDL_Log -- iFip: - - SDL_SaveDollarTemplate -- iFWW: - - SDL_IsJoystickNintendoSwitchPro - - SDL_IsJoystickPS4 - - SDL_IsJoystickSteamController - - SDL_IsJoystickXbox360 - - SDL_IsJoystickXboxOne -- iFUU: - - SDL_IsJoystickHIDAPI - - SDL_IsJoystickXInput -- iFpi: - - SDL_GameControllerAddMappingsFromRW -- iFpp: - - SDL_GetEventFilter - - SDL_OpenAudio -- uFpW: - - SDL_WriteBE16 - - SDL_WriteLE16 -- uFpu: - - SDL_WriteBE32 - - SDL_WriteLE32 - - SDL_WriteU8 -- uFpU: - - SDL_WriteBE64 - - SDL_WriteLE64 -- pFpi: - - SDL_LoadBMP_RW - - SDL_RWFromConstMem - - SDL_RWFromFP - - SDL_RWFromMem -- pFpp: - - SDL_LoadFunction - - SDL_RWFromFile -- vFipV: - - SDL_LogCritical - - SDL_LogDebug - - SDL_LogError - - SDL_LogInfo - - SDL_LogVerbose - - SDL_LogWarn -- iFupu: - - SDL_DYNAPI_entry -- iFupp: - - SDL_TLSSet -- iFppi: - - SDL_SaveBMP_RW -- iFppV: - - SDL_sscanf -- IFpIi: - - SDL_RWseek -- pFupp: - - SDL_AddTimer -- pFppi: - - SDL_LoadFile_RW -- pFppp: - - SDL_CreateThread -- vFpuup: - - SDL_qsort -- iFpLpp: - - SDL_vsnprintf -- iFpLpV: - - SDL_snprintf -- uFppuu: - - SDL_RWread - - SDL_RWwrite -- vFGpppp: - - SDL_GetJoystickGUIDInfo -- iFpippi: - - SDL_OpenAudioDevice -- pFpippp: - - SDL_LoadWAV_RW -% vFGpppp -wrappedsdl2image: -- pFp: - - IMG_LoadBMP_RW - - IMG_LoadCUR_RW - - IMG_LoadGIF_RW - - IMG_LoadICO_RW - - IMG_LoadJPG_RW - - IMG_LoadLBM_RW - - IMG_LoadPCX_RW - - IMG_LoadPNG_RW - - IMG_LoadPNM_RW - - IMG_LoadTGA_RW - - IMG_LoadTIF_RW - - IMG_LoadWEBP_RW - - IMG_LoadXCF_RW - - IMG_LoadXPM_RW - - IMG_LoadXV_RW -- pFpi: - - IMG_Load_RW -- iFppi: - - IMG_SavePNG_RW -- pFpip: - - IMG_LoadTyped_RW -- pFppi: - - IMG_LoadTexture_RW -- pFppip: - - IMG_LoadTextureTyped_RW -wrappedsdl2mixer: -- vFp: - - Mix_ChannelFinished - - Mix_HookMusicFinished -- vFpp: - - Mix_HookMusic - - Mix_SetPostMix -- iFiw: - - MinorityMix_SetPosition -- iFip: - - Mix_UnregisterEffect -- pFpi: - - Mix_LoadMUS_RW - - Mix_LoadWAV_RW -- pFpii: - - Mix_LoadMUSType_RW -- iFippp: - - Mix_RegisterEffect -wrappedsdl2net: -wrappedsdl2ttf: -- pFpii: - - TTF_OpenFontRW -- pFpiii: - - TTF_OpenFontIndexRW -wrappedsecret1: -wrappedselinux: -wrappedsmime3: -- iFpp: - - SEC_PKCS12DecoderValidateBags -- iFppp: - - SEC_PKCS12Encode -- iFpipp: - - CERT_DecodeCertPackage -- pFpppp: - - SEC_PKCS12CreateExportContext -- pFpppppppp: - - SEC_PKCS12DecoderStart -- pFppppppppppp: - - NSS_CMSEncoder_Start -wrappedsmpeg: -- pFppi: - - SMPEG_new_rwops -- vFpppp: - - SMPEG_setdisplay -wrappedsmpeg2: -- vFpppp: - - SMPEG_setdisplay -- pFppii: - - SMPEG_new_rwops -wrappedsoftokn3: -wrappedssl3: -wrappedtbbbind: -- vFv: - - __TBB_internal_destroy_system_topology -- vFp: - - __TBB_internal_deallocate_binding_handler -- vFpi: - - __TBB_internal_apply_affinity - - __TBB_internal_restore_affinity -- iFiii: - - __TBB_internal_get_default_concurrency -- pFiiii: - - __TBB_internal_allocate_binding_handler -- vFLpppp: - - __TBB_internal_initialize_system_topology -wrappedtbbmalloc: -- vFp: - - scalable_aligned_free -- LFp: - - scalable_msize -- LFpp: - - safer_scalable_msize -- pFLL: - - scalable_aligned_malloc - - scalable_calloc -- pFpp: - - safer_scalable_free -- pFpLL: - - scalable_aligned_realloc -- pFpLp: - - safer_scalable_realloc -- pFpLLp: - - safer_scalable_aligned_realloc -wrappedtbbmallocproxy: -- vFp: - - _ZdaPv - - _ZdlPv - - __RML_close_factory -- pFL: - - _Znam - - _Znwm -- vFpp: - - _ZdaPvRKSt9nothrow_t - - _ZdlPvRKSt9nothrow_t - - __TBB_call_with_my_server_info -- pFLp: - - _ZnamRKSt9nothrow_t - - _ZnwmRKSt9nothrow_t -- iFipp: - - __TBB_internal_find_original_malloc -- iFppi: - - __RML_open_factory -- iFppp: - - __TBB_make_rml_server -wrappedtcmallocminimal: -- pFp: - - mallinfo -- iFpL: - - munmap -- pFpLiiil: - - mmap - - mmap64 -wrappedudev0: -wrappedudev1: -- vFpp: - - udev_set_log_fn -wrappedunwind: -- iFp: - - _ULx86_64_step -- iFpp: - - _ULx86_64_get_proc_info - - _ULx86_64_init_local -- iFpip: - - _ULx86_64_get_reg -wrappedutil: -- iFpppp: - - forkpty -wrappedvorbisfile: -- iFppplPPPP: - - ov_open_callbacks - - ov_test_callbacks -wrappedvulkan: -- vFpp: - - vkDestroyDevice - - vkDestroyInstance - - vkGetPhysicalDeviceMemoryProperties - - vkGetPhysicalDeviceProperties -- pFpp: - - vkGetDeviceProcAddr - - vkGetInstanceProcAddr -- vFpUp: - - vkDestroyAccelerationStructureKHR - - vkDestroyAccelerationStructureNV - - vkDestroyBuffer - - vkDestroyBufferView - - vkDestroyCommandPool - - vkDestroyCuFunctionNVX - - vkDestroyCuModuleNVX - - vkDestroyCudaFunctionNV - - vkDestroyCudaModuleNV - - vkDestroyDeferredOperationKHR - - vkDestroyDescriptorPool - - vkDestroyDescriptorSetLayout - - vkDestroyDescriptorUpdateTemplate - - vkDestroyDescriptorUpdateTemplateKHR - - vkDestroyEvent - - vkDestroyFence - - vkDestroyFramebuffer - - vkDestroyImage - - vkDestroyImageView - - vkDestroyIndirectCommandsLayoutNV - - vkDestroyMicromapEXT - - vkDestroyOpticalFlowSessionNV - - vkDestroyPipeline - - vkDestroyPipelineCache - - vkDestroyPipelineLayout - - vkDestroyPrivateDataSlot - - vkDestroyPrivateDataSlotEXT - - vkDestroyQueryPool - - vkDestroyRenderPass - - vkDestroySampler - - vkDestroySamplerYcbcrConversion - - vkDestroySamplerYcbcrConversionKHR - - vkDestroySemaphore - - vkDestroyShaderEXT - - vkDestroyShaderModule - - vkDestroySurfaceKHR - - vkDestroySwapchainKHR - - vkDestroyValidationCacheEXT - - vkDestroyVideoSessionKHR - - vkDestroyVideoSessionParametersKHR -- vFppp: - - vkDestroyDebugReportCallbackEXT - - vkDestroyDebugUtilsMessengerEXT -- iFpUp: - - vkFreeMemory -- iFppp: - - vkCreateDeferredOperationKHR - - vkCreateInstance - - vkGetPhysicalDeviceDisplayPropertiesKHR -- iFpUup: - - vkGetDisplayPlaneCapabilitiesKHR -- iFpppp: - - vkAllocateMemory - - vkCreateAccelerationStructureKHR - - vkCreateAccelerationStructureNV - - vkCreateAndroidSurfaceKHR - - vkCreateBuffer - - vkCreateBufferView - - vkCreateCommandPool - - vkCreateCuFunctionNVX - - vkCreateCuModuleNVX - - vkCreateCudaFunctionNV - - vkCreateCudaModuleNV - - vkCreateDebugReportCallbackEXT - - vkCreateDebugUtilsMessengerEXT - - vkCreateDescriptorPool - - vkCreateDescriptorSetLayout - - vkCreateDescriptorUpdateTemplate - - vkCreateDescriptorUpdateTemplateKHR - - vkCreateDevice - - vkCreateDisplayPlaneSurfaceKHR - - vkCreateEvent - - vkCreateFence - - vkCreateFramebuffer - - vkCreateHeadlessSurfaceEXT - - vkCreateImage - - vkCreateImageView - - vkCreateIndirectCommandsLayoutNV - - vkCreateMicromapEXT - - vkCreateOpticalFlowSessionNV - - vkCreatePipelineCache - - vkCreatePipelineLayout - - vkCreatePrivateDataSlot - - vkCreatePrivateDataSlotEXT - - vkCreateQueryPool - - vkCreateRenderPass - - vkCreateRenderPass2 - - vkCreateRenderPass2KHR - - vkCreateSampler - - vkCreateSamplerYcbcrConversion - - vkCreateSamplerYcbcrConversionKHR - - vkCreateSemaphore - - vkCreateShaderModule - - vkCreateSwapchainKHR - - vkCreateValidationCacheEXT - - vkCreateVideoSessionKHR - - vkCreateVideoSessionParametersKHR - - vkCreateWaylandSurfaceKHR - - vkCreateXcbSurfaceKHR - - vkCreateXlibSurfaceKHR - - vkRegisterDeviceEventEXT -- vFpupup: - - vkUpdateDescriptorSets -- iFpuppp: - - vkCreateShadersEXT - - vkCreateSharedSwapchainsKHR -- iFpUppp: - - vkCreateDisplayModeKHR - - vkRegisterDisplayEventEXT -- iFpUuppp: - - vkCreateComputePipelines - - vkCreateExecutionGraphPipelinesAMDX - - vkCreateGraphicsPipelines - - vkCreateRayTracingPipelinesNV -- iFpUUuppp: - - vkCreateRayTracingPipelinesKHR -- vFpiiiuipp: - - vkGetPhysicalDeviceSparseImageFormatProperties -- vFpuuuupupup: - - vkCmdPipelineBarrier -wrappedwaylandclient: -- iFppp: - - wl_proxy_add_listener -wrappedwaylandcursor: -wrappedwaylandegl: -wrappedxinerama: -wrappedxkbcommon: -wrappedxkbcommonx11: -wrappedxkbregistry: -wrappedxml2: -- vFp: - - xmlSetExternalEntityLoader -- iFp: - - xmlParseDocument -- pFv: - - __xmlGenericError - - __xmlStructuredError - - xmlGetExternalEntityLoader -- vFpp: - - xmlHashFree - - xmlSetGenericErrorFunc - - xmlSetStructuredErrorFunc -- pFpp: - - xmlHashCopy -- vFppp: - - xmlHashScan - - xmlHashScanFull - - xmlSchemaSetParserStructuredErrors - - xmlSchemaSetValidStructuredErrors - - xmlTextReaderSetErrorHandler -- iFppp: - - xmlHashRemoveEntry - - xmlXPathRegisterFunc -- pFppp: - - xmlNewCharEncodingHandler -- vFpppp: - - xmlSchemaSetParserErrors - - xmlSchemaSetValidErrors -- iFpppp: - - xmlHashRemoveEntry2 - - xmlHashUpdateEntry - - xmlRegisterInputCallbacks - - xmlRegisterOutputCallbacks -- iFpppV: - - xmlTextWriterWriteFormatAttribute -- iFpppA: - - xmlTextWriterWriteVFormatAttribute -- pFpppi: - - xmlParserInputBufferCreateIO -- pFpppp: - - xmlOutputBufferCreateIO -- iFppppp: - - xmlHashRemoveEntry3 - - xmlHashUpdateEntry2 -- pFppppi: - - xmlSaveToIO -- vFpppppp: - - xmlHashScan3 - - xmlHashScanFull3 -- iFpppppp: - - xmlHashUpdateEntry3 -- pFpppppi: - - xmlCreateIOParserCtxt - - xmlReaderForIO -- pFppppppi: - - xmlCtxtReadIO -wrappedxshmfence: -wrappedxslt: -- vFv: - - xsltInit -- vFp: - - xsltSetLoaderFunc -- vFpp: - - xsltSetCtxtSortFunc -- iFppp: - - xsltRegisterExtModuleFunction - - xsltSetSecurityPrefs -- iFpppp: - - xsltRegisterExtFunction diff --git a/src/wrapped/generated/wrappedaluredefs.h b/src/wrapped/generated/wrappedaluredefs.h deleted file mode 100644 index 25481eb..0000000 --- a/src/wrapped/generated/wrappedaluredefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedalureDEFS_H_ -#define __wrappedalureDEFS_H_ - - -#endif // __wrappedalureDEFS_H_ diff --git a/src/wrapped/generated/wrappedaluretypes.h b/src/wrapped/generated/wrappedaluretypes.h deleted file mode 100644 index 6026c99..0000000 --- a/src/wrapped/generated/wrappedaluretypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedalureTYPES_H_ -#define __wrappedalureTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedalureTYPES_H_ diff --git a/src/wrapped/generated/wrappedalureundefs.h b/src/wrapped/generated/wrappedalureundefs.h deleted file mode 100644 index 35d1876..0000000 --- a/src/wrapped/generated/wrappedalureundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedalureUNDEFS_H_ -#define __wrappedalureUNDEFS_H_ - - -#endif // __wrappedalureUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedalutdefs.h b/src/wrapped/generated/wrappedalutdefs.h deleted file mode 100644 index 932f9b4..0000000 --- a/src/wrapped/generated/wrappedalutdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedalutDEFS_H_ -#define __wrappedalutDEFS_H_ - - -#endif // __wrappedalutDEFS_H_ diff --git a/src/wrapped/generated/wrappedaluttypes.h b/src/wrapped/generated/wrappedaluttypes.h deleted file mode 100644 index fd59c67..0000000 --- a/src/wrapped/generated/wrappedaluttypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedalutTYPES_H_ -#define __wrappedalutTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedalutTYPES_H_ diff --git a/src/wrapped/generated/wrappedalutundefs.h b/src/wrapped/generated/wrappedalutundefs.h deleted file mode 100644 index 837ffbd..0000000 --- a/src/wrapped/generated/wrappedalutundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedalutUNDEFS_H_ -#define __wrappedalutUNDEFS_H_ - - -#endif // __wrappedalutUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedanldefs.h b/src/wrapped/generated/wrappedanldefs.h deleted file mode 100644 index 6c72df2..0000000 --- a/src/wrapped/generated/wrappedanldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedanlDEFS_H_ -#define __wrappedanlDEFS_H_ - - -#endif // __wrappedanlDEFS_H_ diff --git a/src/wrapped/generated/wrappedanltypes.h b/src/wrapped/generated/wrappedanltypes.h deleted file mode 100644 index 4c56eb3..0000000 --- a/src/wrapped/generated/wrappedanltypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedanlTYPES_H_ -#define __wrappedanlTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedanlTYPES_H_ diff --git a/src/wrapped/generated/wrappedanlundefs.h b/src/wrapped/generated/wrappedanlundefs.h deleted file mode 100644 index ed0ba39..0000000 --- a/src/wrapped/generated/wrappedanlundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedanlUNDEFS_H_ -#define __wrappedanlUNDEFS_H_ - - -#endif // __wrappedanlUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedatkbridgedefs.h b/src/wrapped/generated/wrappedatkbridgedefs.h deleted file mode 100644 index a7aa9e4..0000000 --- a/src/wrapped/generated/wrappedatkbridgedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedatkbridgeDEFS_H_ -#define __wrappedatkbridgeDEFS_H_ - - -#endif // __wrappedatkbridgeDEFS_H_ diff --git a/src/wrapped/generated/wrappedatkbridgetypes.h b/src/wrapped/generated/wrappedatkbridgetypes.h deleted file mode 100644 index fc55a5e..0000000 --- a/src/wrapped/generated/wrappedatkbridgetypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedatkbridgeTYPES_H_ -#define __wrappedatkbridgeTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedatkbridgeTYPES_H_ diff --git a/src/wrapped/generated/wrappedatkbridgeundefs.h b/src/wrapped/generated/wrappedatkbridgeundefs.h deleted file mode 100644 index 2549ad2..0000000 --- a/src/wrapped/generated/wrappedatkbridgeundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedatkbridgeUNDEFS_H_ -#define __wrappedatkbridgeUNDEFS_H_ - - -#endif // __wrappedatkbridgeUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedatkdefs.h b/src/wrapped/generated/wrappedatkdefs.h deleted file mode 100644 index e540828..0000000 --- a/src/wrapped/generated/wrappedatkdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedatkDEFS_H_ -#define __wrappedatkDEFS_H_ - - -#endif // __wrappedatkDEFS_H_ diff --git a/src/wrapped/generated/wrappedatktypes.h b/src/wrapped/generated/wrappedatktypes.h deleted file mode 100644 index 98cae43..0000000 --- a/src/wrapped/generated/wrappedatktypes.h +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedatkTYPES_H_ -#define __wrappedatkTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef uint32_t (*uFp_t)(void*); -typedef uint32_t (*uFpp_t)(void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(atk_focus_tracker_init, vFp_t) \ - GO(atk_add_focus_tracker, uFp_t) \ - GO(atk_add_global_event_listener, uFpp_t) \ - GO(atk_add_key_event_listener, uFpp_t) - -#endif // __wrappedatkTYPES_H_ diff --git a/src/wrapped/generated/wrappedatkundefs.h b/src/wrapped/generated/wrappedatkundefs.h deleted file mode 100644 index c100ca4..0000000 --- a/src/wrapped/generated/wrappedatkundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedatkUNDEFS_H_ -#define __wrappedatkUNDEFS_H_ - - -#endif // __wrappedatkUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedatomicdefs.h b/src/wrapped/generated/wrappedatomicdefs.h deleted file mode 100644 index 7c0be63..0000000 --- a/src/wrapped/generated/wrappedatomicdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedatomicDEFS_H_ -#define __wrappedatomicDEFS_H_ - - -#endif // __wrappedatomicDEFS_H_ diff --git a/src/wrapped/generated/wrappedatomictypes.h b/src/wrapped/generated/wrappedatomictypes.h deleted file mode 100644 index b7ef882..0000000 --- a/src/wrapped/generated/wrappedatomictypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedatomicTYPES_H_ -#define __wrappedatomicTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedatomicTYPES_H_ diff --git a/src/wrapped/generated/wrappedatomicundefs.h b/src/wrapped/generated/wrappedatomicundefs.h deleted file mode 100644 index 6a71a44..0000000 --- a/src/wrapped/generated/wrappedatomicundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedatomicUNDEFS_H_ -#define __wrappedatomicUNDEFS_H_ - - -#endif // __wrappedatomicUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedatspidefs.h b/src/wrapped/generated/wrappedatspidefs.h deleted file mode 100644 index d798384..0000000 --- a/src/wrapped/generated/wrappedatspidefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedatspiDEFS_H_ -#define __wrappedatspiDEFS_H_ - - -#endif // __wrappedatspiDEFS_H_ diff --git a/src/wrapped/generated/wrappedatspitypes.h b/src/wrapped/generated/wrappedatspitypes.h deleted file mode 100644 index 0293ae9..0000000 --- a/src/wrapped/generated/wrappedatspitypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedatspiTYPES_H_ -#define __wrappedatspiTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFppp_t)(void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(atspi_event_listener_new, pFppp_t) - -#endif // __wrappedatspiTYPES_H_ diff --git a/src/wrapped/generated/wrappedatspiundefs.h b/src/wrapped/generated/wrappedatspiundefs.h deleted file mode 100644 index 216cda2..0000000 --- a/src/wrapped/generated/wrappedatspiundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedatspiUNDEFS_H_ -#define __wrappedatspiUNDEFS_H_ - - -#endif // __wrappedatspiUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedayatanaappindicator3defs.h b/src/wrapped/generated/wrappedayatanaappindicator3defs.h deleted file mode 100644 index f5a970d..0000000 --- a/src/wrapped/generated/wrappedayatanaappindicator3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedayatanaappindicator3DEFS_H_ -#define __wrappedayatanaappindicator3DEFS_H_ - - -#endif // __wrappedayatanaappindicator3DEFS_H_ diff --git a/src/wrapped/generated/wrappedayatanaappindicator3types.h b/src/wrapped/generated/wrappedayatanaappindicator3types.h deleted file mode 100644 index ac9dfa4..0000000 --- a/src/wrapped/generated/wrappedayatanaappindicator3types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedayatanaappindicator3TYPES_H_ -#define __wrappedayatanaappindicator3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedayatanaappindicator3TYPES_H_ diff --git a/src/wrapped/generated/wrappedayatanaappindicator3undefs.h b/src/wrapped/generated/wrappedayatanaappindicator3undefs.h deleted file mode 100644 index 35c9f4e..0000000 --- a/src/wrapped/generated/wrappedayatanaappindicator3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedayatanaappindicator3UNDEFS_H_ -#define __wrappedayatanaappindicator3UNDEFS_H_ - - -#endif // __wrappedayatanaappindicator3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedbz2defs.h b/src/wrapped/generated/wrappedbz2defs.h deleted file mode 100644 index 7a94209..0000000 --- a/src/wrapped/generated/wrappedbz2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedbz2DEFS_H_ -#define __wrappedbz2DEFS_H_ - - -#endif // __wrappedbz2DEFS_H_ diff --git a/src/wrapped/generated/wrappedbz2types.h b/src/wrapped/generated/wrappedbz2types.h deleted file mode 100644 index cad85bc..0000000 --- a/src/wrapped/generated/wrappedbz2types.h +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedbz2TYPES_H_ -#define __wrappedbz2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFp_t)(void*); -typedef int32_t (*iFpi_t)(void*, int32_t); -typedef int32_t (*iFpii_t)(void*, int32_t, int32_t); -typedef int32_t (*iFpiii_t)(void*, int32_t, int32_t, int32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(BZ2_bzCompressEnd, iFp_t) \ - GO(BZ2_bzDecompress, iFp_t) \ - GO(BZ2_bzDecompressEnd, iFp_t) \ - GO(BZ2_bzCompress, iFpi_t) \ - GO(BZ2_bzDecompressInit, iFpii_t) \ - GO(BZ2_bzCompressInit, iFpiii_t) - -#endif // __wrappedbz2TYPES_H_ diff --git a/src/wrapped/generated/wrappedbz2undefs.h b/src/wrapped/generated/wrappedbz2undefs.h deleted file mode 100644 index 0285da9..0000000 --- a/src/wrapped/generated/wrappedbz2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedbz2UNDEFS_H_ -#define __wrappedbz2UNDEFS_H_ - - -#endif // __wrappedbz2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedcairodefs.h b/src/wrapped/generated/wrappedcairodefs.h deleted file mode 100644 index 3146a80..0000000 --- a/src/wrapped/generated/wrappedcairodefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcairoDEFS_H_ -#define __wrappedcairoDEFS_H_ - - -#endif // __wrappedcairoDEFS_H_ diff --git a/src/wrapped/generated/wrappedcairogobjectdefs.h b/src/wrapped/generated/wrappedcairogobjectdefs.h deleted file mode 100644 index 950015a..0000000 --- a/src/wrapped/generated/wrappedcairogobjectdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcairogobjectDEFS_H_ -#define __wrappedcairogobjectDEFS_H_ - - -#endif // __wrappedcairogobjectDEFS_H_ diff --git a/src/wrapped/generated/wrappedcairogobjecttypes.h b/src/wrapped/generated/wrappedcairogobjecttypes.h deleted file mode 100644 index a7e969b..0000000 --- a/src/wrapped/generated/wrappedcairogobjecttypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcairogobjectTYPES_H_ -#define __wrappedcairogobjectTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedcairogobjectTYPES_H_ diff --git a/src/wrapped/generated/wrappedcairogobjectundefs.h b/src/wrapped/generated/wrappedcairogobjectundefs.h deleted file mode 100644 index 4f3da1b..0000000 --- a/src/wrapped/generated/wrappedcairogobjectundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcairogobjectUNDEFS_H_ -#define __wrappedcairogobjectUNDEFS_H_ - - -#endif // __wrappedcairogobjectUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedcairotypes.h b/src/wrapped/generated/wrappedcairotypes.h deleted file mode 100644 index 4020471..0000000 --- a/src/wrapped/generated/wrappedcairotypes.h +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcairoTYPES_H_ -#define __wrappedcairoTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(cairo_xcb_device_get_connection, pFp_t) \ - GO(cairo_set_user_data, iFpppp_t) \ - GO(cairo_surface_set_user_data, iFpppp_t) - -#endif // __wrappedcairoTYPES_H_ diff --git a/src/wrapped/generated/wrappedcairoundefs.h b/src/wrapped/generated/wrappedcairoundefs.h deleted file mode 100644 index a3042b4..0000000 --- a/src/wrapped/generated/wrappedcairoundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcairoUNDEFS_H_ -#define __wrappedcairoUNDEFS_H_ - - -#endif // __wrappedcairoUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedcapdefs.h b/src/wrapped/generated/wrappedcapdefs.h deleted file mode 100644 index 57c78f1..0000000 --- a/src/wrapped/generated/wrappedcapdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcapDEFS_H_ -#define __wrappedcapDEFS_H_ - - -#endif // __wrappedcapDEFS_H_ diff --git a/src/wrapped/generated/wrappedcaptypes.h b/src/wrapped/generated/wrappedcaptypes.h deleted file mode 100644 index 3d18ce3..0000000 --- a/src/wrapped/generated/wrappedcaptypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcapTYPES_H_ -#define __wrappedcapTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedcapTYPES_H_ diff --git a/src/wrapped/generated/wrappedcapundefs.h b/src/wrapped/generated/wrappedcapundefs.h deleted file mode 100644 index 87967b4..0000000 --- a/src/wrapped/generated/wrappedcapundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcapUNDEFS_H_ -#define __wrappedcapUNDEFS_H_ - - -#endif // __wrappedcapUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedcrashhandlerdefs.h b/src/wrapped/generated/wrappedcrashhandlerdefs.h deleted file mode 100644 index 36c4d36..0000000 --- a/src/wrapped/generated/wrappedcrashhandlerdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcrashhandlerDEFS_H_ -#define __wrappedcrashhandlerDEFS_H_ - - -#endif // __wrappedcrashhandlerDEFS_H_ diff --git a/src/wrapped/generated/wrappedcrashhandlertypes.h b/src/wrapped/generated/wrappedcrashhandlertypes.h deleted file mode 100644 index 2acab70..0000000 --- a/src/wrapped/generated/wrappedcrashhandlertypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcrashhandlerTYPES_H_ -#define __wrappedcrashhandlerTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedcrashhandlerTYPES_H_ diff --git a/src/wrapped/generated/wrappedcrashhandlerundefs.h b/src/wrapped/generated/wrappedcrashhandlerundefs.h deleted file mode 100644 index 3fb6554..0000000 --- a/src/wrapped/generated/wrappedcrashhandlerundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcrashhandlerUNDEFS_H_ -#define __wrappedcrashhandlerUNDEFS_H_ - - -#endif // __wrappedcrashhandlerUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedcrypto3defs.h b/src/wrapped/generated/wrappedcrypto3defs.h deleted file mode 100644 index c6874fb..0000000 --- a/src/wrapped/generated/wrappedcrypto3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcrypto3DEFS_H_ -#define __wrappedcrypto3DEFS_H_ - - -#endif // __wrappedcrypto3DEFS_H_ diff --git a/src/wrapped/generated/wrappedcrypto3types.h b/src/wrapped/generated/wrappedcrypto3types.h deleted file mode 100644 index 175bea5..0000000 --- a/src/wrapped/generated/wrappedcrypto3types.h +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcrypto3TYPES_H_ -#define __wrappedcrypto3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef void* (*pFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef void* (*pFpp_t)(void*, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef int32_t (*iFppV_t)(void*, void*, ...); -typedef void (*vFiipV_t)(int32_t, int32_t, void*, ...); -typedef void (*vFiipA_t)(int32_t, int32_t, void*, va_list); -typedef void* (*pFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFpiipp_t)(void*, int32_t, int32_t, void*, void*); -typedef int32_t (*iFpplppi_t)(void*, void*, intptr_t, void*, void*, int32_t); -typedef int32_t (*iFppppipp_t)(void*, void*, void*, void*, int32_t, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(CRYPTO_set_id_callback, vFp_t) \ - GO(CRYPTO_set_locking_callback, vFp_t) \ - GO(OPENSSL_sk_new, pFp_t) \ - GO(X509_STORE_CTX_set_verify_cb, vFpp_t) \ - GO(OPENSSL_sk_pop_free, pFpp_t) \ - GO(EVP_MD_do_all_provided, vFppp_t) \ - GO(ASN1_i2d_bio, iFppp_t) \ - GO(BIO_printf, iFppV_t) \ - GO(ERR_set_error, vFiipV_t) \ - GO(ERR_vset_error, vFiipA_t) \ - GO(ASN1_d2i_bio, pFpppp_t) \ - GO(PEM_read_DHparams, pFpppp_t) \ - GO(PEM_read_bio_DSAPrivateKey, pFpppp_t) \ - GO(PEM_read_bio_DSA_PUBKEY, pFpppp_t) \ - GO(PEM_read_bio_ECPrivateKey, pFpppp_t) \ - GO(PEM_read_bio_EC_PUBKEY, pFpppp_t) \ - GO(PEM_read_bio_PKCS7, pFpppp_t) \ - GO(PEM_read_bio_RSAPrivateKey, pFpppp_t) \ - GO(PEM_read_bio_RSA_PUBKEY, pFpppp_t) \ - GO(PEM_read_bio_X509, pFpppp_t) \ - GO(PEM_read_bio_X509_AUX, pFpppp_t) \ - GO(PEM_read_bio_X509_CERT_PAIR, pFpppp_t) \ - GO(PEM_read_bio_X509_CRL, pFpppp_t) \ - GO(PEM_read_bio_X509_REQ, pFpppp_t) \ - GO(ENGINE_ctrl, iFpiipp_t) \ - GO(ENGINE_ctrl_cmd, iFpplppi_t) \ - GO(PEM_write_bio_DSAPrivateKey, iFppppipp_t) \ - GO(PEM_write_bio_ECPrivateKey, iFppppipp_t) \ - GO(PEM_write_bio_RSAPrivateKey, iFppppipp_t) - -#endif // __wrappedcrypto3TYPES_H_ diff --git a/src/wrapped/generated/wrappedcrypto3undefs.h b/src/wrapped/generated/wrappedcrypto3undefs.h deleted file mode 100644 index 1e82efc..0000000 --- a/src/wrapped/generated/wrappedcrypto3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcrypto3UNDEFS_H_ -#define __wrappedcrypto3UNDEFS_H_ - - -#endif // __wrappedcrypto3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedcryptodefs.h b/src/wrapped/generated/wrappedcryptodefs.h deleted file mode 100644 index 2a2f3c2..0000000 --- a/src/wrapped/generated/wrappedcryptodefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcryptoDEFS_H_ -#define __wrappedcryptoDEFS_H_ - - -#endif // __wrappedcryptoDEFS_H_ diff --git a/src/wrapped/generated/wrappedcryptotypes.h b/src/wrapped/generated/wrappedcryptotypes.h deleted file mode 100644 index 6a9de7b..0000000 --- a/src/wrapped/generated/wrappedcryptotypes.h +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcryptoTYPES_H_ -#define __wrappedcryptoTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef void* (*pFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef int32_t (*iFpp_t)(void*, void*); -typedef void* (*pFpp_t)(void*, void*); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef void* (*pFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFpiipp_t)(void*, int32_t, int32_t, void*, void*); -typedef int32_t (*iFpplppi_t)(void*, void*, intptr_t, void*, void*, int32_t); -typedef int32_t (*iFppppipp_t)(void*, void*, void*, void*, int32_t, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(CRYPTO_set_id_callback, vFp_t) \ - GO(CRYPTO_set_locking_callback, vFp_t) \ - GO(sk_new, pFp_t) \ - GO(X509_STORE_CTX_set_verify_cb, vFpp_t) \ - GO(X509_STORE_set_verify_cb, vFpp_t) \ - GO(sk_pop_free, vFpp_t) \ - GO(BIO_meth_set_create, iFpp_t) \ - GO(BIO_meth_set_ctrl, iFpp_t) \ - GO(BIO_meth_set_destroy, iFpp_t) \ - GO(BIO_meth_set_gets, iFpp_t) \ - GO(BIO_meth_set_puts, iFpp_t) \ - GO(BIO_meth_set_read, iFpp_t) \ - GO(BIO_meth_set_write, iFpp_t) \ - GO(OPENSSL_sk_pop_free, pFpp_t) \ - GO(ASN1_i2d_bio, iFppp_t) \ - GO(ASN1_d2i_bio, pFpppp_t) \ - GO(PEM_read_bio_DHparams, pFpppp_t) \ - GO(PEM_read_bio_DSAPrivateKey, pFpppp_t) \ - GO(PEM_read_bio_DSA_PUBKEY, pFpppp_t) \ - GO(PEM_read_bio_ECPrivateKey, pFpppp_t) \ - GO(PEM_read_bio_EC_PUBKEY, pFpppp_t) \ - GO(PEM_read_bio_PKCS7, pFpppp_t) \ - GO(PEM_read_bio_PUBKEY, pFpppp_t) \ - GO(PEM_read_bio_PrivateKey, pFpppp_t) \ - GO(PEM_read_bio_RSAPrivateKey, pFpppp_t) \ - GO(PEM_read_bio_RSA_PUBKEY, pFpppp_t) \ - GO(PEM_read_bio_X509, pFpppp_t) \ - GO(PEM_read_bio_X509_AUX, pFpppp_t) \ - GO(PEM_read_bio_X509_CERT_PAIR, pFpppp_t) \ - GO(PEM_read_bio_X509_CRL, pFpppp_t) \ - GO(PEM_read_bio_X509_REQ, pFpppp_t) \ - GO(ENGINE_ctrl, iFpiipp_t) \ - GO(ENGINE_ctrl_cmd, iFpplppi_t) \ - GO(PEM_write_bio_DSAPrivateKey, iFppppipp_t) \ - GO(PEM_write_bio_ECPrivateKey, iFppppipp_t) \ - GO(PEM_write_bio_PrivateKey, iFppppipp_t) \ - GO(PEM_write_bio_RSAPrivateKey, iFppppipp_t) - -#endif // __wrappedcryptoTYPES_H_ diff --git a/src/wrapped/generated/wrappedcryptoundefs.h b/src/wrapped/generated/wrappedcryptoundefs.h deleted file mode 100644 index 0604af4..0000000 --- a/src/wrapped/generated/wrappedcryptoundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcryptoUNDEFS_H_ -#define __wrappedcryptoUNDEFS_H_ - - -#endif // __wrappedcryptoUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedcurldefs.h b/src/wrapped/generated/wrappedcurldefs.h deleted file mode 100644 index 6e2dd59..0000000 --- a/src/wrapped/generated/wrappedcurldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcurlDEFS_H_ -#define __wrappedcurlDEFS_H_ - - -#endif // __wrappedcurlDEFS_H_ diff --git a/src/wrapped/generated/wrappedcurltypes.h b/src/wrapped/generated/wrappedcurltypes.h deleted file mode 100644 index 145009e..0000000 --- a/src/wrapped/generated/wrappedcurltypes.h +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcurlTYPES_H_ -#define __wrappedcurlTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFpup_t)(void*, uint32_t, void*); -typedef uint32_t (*uFpup_t)(void*, uint32_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(curl_multi_setopt, iFpup_t) \ - GO(curl_easy_setopt, uFpup_t) \ - GO(curl_share_setopt, uFpup_t) - -#endif // __wrappedcurlTYPES_H_ diff --git a/src/wrapped/generated/wrappedcurlundefs.h b/src/wrapped/generated/wrappedcurlundefs.h deleted file mode 100644 index 1b785a4..0000000 --- a/src/wrapped/generated/wrappedcurlundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedcurlUNDEFS_H_ -#define __wrappedcurlUNDEFS_H_ - - -#endif // __wrappedcurlUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedd3dadapter9defs.h b/src/wrapped/generated/wrappedd3dadapter9defs.h deleted file mode 100644 index 80a0f1b..0000000 --- a/src/wrapped/generated/wrappedd3dadapter9defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedd3dadapter9DEFS_H_ -#define __wrappedd3dadapter9DEFS_H_ - - -#endif // __wrappedd3dadapter9DEFS_H_ diff --git a/src/wrapped/generated/wrappedd3dadapter9types.h b/src/wrapped/generated/wrappedd3dadapter9types.h deleted file mode 100644 index c09cdf3..0000000 --- a/src/wrapped/generated/wrappedd3dadapter9types.h +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedd3dadapter9TYPES_H_ -#define __wrappedd3dadapter9TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pWp_t)(void*); -typedef int32_t (*iWip_t)(int32_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(D3DAdapter9GetProc, pWp_t) \ - GO(dummy_d3d, iWip_t) - -#endif // __wrappedd3dadapter9TYPES_H_ diff --git a/src/wrapped/generated/wrappedd3dadapter9undefs.h b/src/wrapped/generated/wrappedd3dadapter9undefs.h deleted file mode 100644 index d6dd2eb..0000000 --- a/src/wrapped/generated/wrappedd3dadapter9undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedd3dadapter9UNDEFS_H_ -#define __wrappedd3dadapter9UNDEFS_H_ - - -#endif // __wrappedd3dadapter9UNDEFS_H_ diff --git a/src/wrapped/generated/wrappeddbusdefs.h b/src/wrapped/generated/wrappeddbusdefs.h deleted file mode 100644 index 28ece64..0000000 --- a/src/wrapped/generated/wrappeddbusdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappeddbusDEFS_H_ -#define __wrappeddbusDEFS_H_ - - -#endif // __wrappeddbusDEFS_H_ diff --git a/src/wrapped/generated/wrappeddbusglib1defs.h b/src/wrapped/generated/wrappeddbusglib1defs.h deleted file mode 100644 index bf9d1ef..0000000 --- a/src/wrapped/generated/wrappeddbusglib1defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappeddbusglib1DEFS_H_ -#define __wrappeddbusglib1DEFS_H_ - - -#endif // __wrappeddbusglib1DEFS_H_ diff --git a/src/wrapped/generated/wrappeddbusglib1types.h b/src/wrapped/generated/wrappeddbusglib1types.h deleted file mode 100644 index a6b57cf..0000000 --- a/src/wrapped/generated/wrappeddbusglib1types.h +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappeddbusglib1TYPES_H_ -#define __wrappeddbusglib1TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFppp_t)(void*, void*, void*); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef void (*vFppppp_t)(void*, void*, void*, void*, void*); -typedef void* (*pFpppppiV_t)(void*, void*, void*, void*, void*, int32_t, ...); -typedef void* (*pFpppppiiV_t)(void*, void*, void*, void*, void*, int32_t, int32_t, ...); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(dbus_g_type_collection_value_iterate, vFppp_t) \ - GO(dbus_g_type_map_value_iterate, vFppp_t) \ - GO(dbus_g_proxy_disconnect_signal, vFpppp_t) \ - GO(dbus_g_proxy_connect_signal, vFppppp_t) \ - GO(dbus_g_proxy_begin_call, pFpppppiV_t) \ - GO(dbus_g_proxy_begin_call_with_timeout, pFpppppiiV_t) - -#endif // __wrappeddbusglib1TYPES_H_ diff --git a/src/wrapped/generated/wrappeddbusglib1undefs.h b/src/wrapped/generated/wrappeddbusglib1undefs.h deleted file mode 100644 index c77048c..0000000 --- a/src/wrapped/generated/wrappeddbusglib1undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappeddbusglib1UNDEFS_H_ -#define __wrappeddbusglib1UNDEFS_H_ - - -#endif // __wrappeddbusglib1UNDEFS_H_ diff --git a/src/wrapped/generated/wrappeddbusmenuglibdefs.h b/src/wrapped/generated/wrappeddbusmenuglibdefs.h deleted file mode 100644 index e8e738c..0000000 --- a/src/wrapped/generated/wrappeddbusmenuglibdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappeddbusmenuglibDEFS_H_ -#define __wrappeddbusmenuglibDEFS_H_ - - -#endif // __wrappeddbusmenuglibDEFS_H_ diff --git a/src/wrapped/generated/wrappeddbusmenuglibtypes.h b/src/wrapped/generated/wrappeddbusmenuglibtypes.h deleted file mode 100644 index c795e24..0000000 --- a/src/wrapped/generated/wrappeddbusmenuglibtypes.h +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappeddbusmenuglibTYPES_H_ -#define __wrappeddbusmenuglibTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFppp_t)(void*, void*, void*); -typedef int32_t (*iFppp_t)(void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(dbusmenu_menuitem_foreach, vFppp_t) \ - GO(dbusmenu_menuitem_send_about_to_show, vFppp_t) \ - GO(dbusmenu_client_add_type_handler, iFppp_t) - -#endif // __wrappeddbusmenuglibTYPES_H_ diff --git a/src/wrapped/generated/wrappeddbusmenuglibundefs.h b/src/wrapped/generated/wrappeddbusmenuglibundefs.h deleted file mode 100644 index 93f1f96..0000000 --- a/src/wrapped/generated/wrappeddbusmenuglibundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappeddbusmenuglibUNDEFS_H_ -#define __wrappeddbusmenuglibUNDEFS_H_ - - -#endif // __wrappeddbusmenuglibUNDEFS_H_ diff --git a/src/wrapped/generated/wrappeddbustypes.h b/src/wrapped/generated/wrappeddbustypes.h deleted file mode 100644 index c19729f..0000000 --- a/src/wrapped/generated/wrappeddbustypes.h +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappeddbusTYPES_H_ -#define __wrappeddbusTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFppp_t)(void*, void*, void*); -typedef int32_t (*iFpiV_t)(void*, int32_t, ...); -typedef int32_t (*iFpiA_t)(void*, int32_t, va_list); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*); -typedef int32_t (*iFppip_t)(void*, void*, int32_t, void*); -typedef int32_t (*iFppiA_t)(void*, void*, int32_t, va_list); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFppppp_t)(void*, void*, void*, void*, void*); -typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(dbus_connection_remove_filter, vFppp_t) \ - GO(dbus_timeout_set_data, vFppp_t) \ - GO(dbus_watch_set_data, vFppp_t) \ - GO(dbus_message_append_args, iFpiV_t) \ - GO(dbus_message_append_args_valist, iFpiA_t) \ - GO(dbus_connection_set_dispatch_status_function, vFpppp_t) \ - GO(dbus_connection_set_wakeup_main_function, vFpppp_t) \ - GO(dbus_server_set_new_connection_function, vFpppp_t) \ - GO(dbus_connection_set_data, iFpipp_t) \ - GO(dbus_message_set_data, iFpipp_t) \ - GO(dbus_pending_call_set_data, iFpipp_t) \ - GO(dbus_server_set_data, iFpipp_t) \ - GO(dbus_message_get_args, iFppip_t) \ - GO(dbus_message_get_args_valist, iFppiA_t) \ - GO(dbus_connection_add_filter, iFpppp_t) \ - GO(dbus_connection_register_fallback, iFpppp_t) \ - GO(dbus_pending_call_set_notify, iFpppp_t) \ - GO(dbus_connection_try_register_fallback, iFppppp_t) \ - GO(dbus_connection_try_register_object_path, iFppppp_t) \ - GO(dbus_connection_set_timeout_functions, iFpppppp_t) \ - GO(dbus_connection_set_watch_functions, iFpppppp_t) \ - GO(dbus_server_set_timeout_functions, iFpppppp_t) \ - GO(dbus_server_set_watch_functions, iFpppppp_t) - -#endif // __wrappeddbusTYPES_H_ diff --git a/src/wrapped/generated/wrappeddbusundefs.h b/src/wrapped/generated/wrappeddbusundefs.h deleted file mode 100644 index e0e5f79..0000000 --- a/src/wrapped/generated/wrappeddbusundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappeddbusUNDEFS_H_ -#define __wrappeddbusUNDEFS_H_ - - -#endif // __wrappeddbusUNDEFS_H_ diff --git a/src/wrapped/generated/wrappeddecor0defs.h b/src/wrapped/generated/wrappeddecor0defs.h deleted file mode 100644 index 3f8696f..0000000 --- a/src/wrapped/generated/wrappeddecor0defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappeddecor0DEFS_H_ -#define __wrappeddecor0DEFS_H_ - - -#endif // __wrappeddecor0DEFS_H_ diff --git a/src/wrapped/generated/wrappeddecor0types.h b/src/wrapped/generated/wrappeddecor0types.h deleted file mode 100644 index 6fa92b9..0000000 --- a/src/wrapped/generated/wrappeddecor0types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappeddecor0TYPES_H_ -#define __wrappeddecor0TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappeddecor0TYPES_H_ diff --git a/src/wrapped/generated/wrappeddecor0undefs.h b/src/wrapped/generated/wrappeddecor0undefs.h deleted file mode 100644 index 8d7a76f..0000000 --- a/src/wrapped/generated/wrappeddecor0undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappeddecor0UNDEFS_H_ -#define __wrappeddecor0UNDEFS_H_ - - -#endif // __wrappeddecor0UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedevent21defs.h b/src/wrapped/generated/wrappedevent21defs.h deleted file mode 100644 index 8a79789..0000000 --- a/src/wrapped/generated/wrappedevent21defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedevent21DEFS_H_ -#define __wrappedevent21DEFS_H_ - - -#endif // __wrappedevent21DEFS_H_ diff --git a/src/wrapped/generated/wrappedevent21types.h b/src/wrapped/generated/wrappedevent21types.h deleted file mode 100644 index dcee212..0000000 --- a/src/wrapped/generated/wrappedevent21types.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedevent21TYPES_H_ -#define __wrappedevent21TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpiwpp_t)(void*, int32_t, int16_t, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(event_set, vFpiwpp_t) - -#endif // __wrappedevent21TYPES_H_ diff --git a/src/wrapped/generated/wrappedevent21undefs.h b/src/wrapped/generated/wrappedevent21undefs.h deleted file mode 100644 index e0cd3b7..0000000 --- a/src/wrapped/generated/wrappedevent21undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedevent21UNDEFS_H_ -#define __wrappedevent21UNDEFS_H_ - - -#endif // __wrappedevent21UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedexpatdefs.h b/src/wrapped/generated/wrappedexpatdefs.h deleted file mode 100644 index c142fbd..0000000 --- a/src/wrapped/generated/wrappedexpatdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedexpatDEFS_H_ -#define __wrappedexpatDEFS_H_ - - -#endif // __wrappedexpatDEFS_H_ diff --git a/src/wrapped/generated/wrappedexpattypes.h b/src/wrapped/generated/wrappedexpattypes.h deleted file mode 100644 index 958436d..0000000 --- a/src/wrapped/generated/wrappedexpattypes.h +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedexpatTYPES_H_ -#define __wrappedexpatTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpp_t)(void*, void*); -typedef void (*vFppp_t)(void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(XML_SetAttlistDeclHandler, vFpp_t) \ - GO(XML_SetCharacterDataHandler, vFpp_t) \ - GO(XML_SetCommentHandler, vFpp_t) \ - GO(XML_SetDefaultHandler, vFpp_t) \ - GO(XML_SetDefaultHandlerExpand, vFpp_t) \ - GO(XML_SetElementDeclHandler, vFpp_t) \ - GO(XML_SetEndCdataSectionHandler, vFpp_t) \ - GO(XML_SetEndDoctypeDeclHandler, vFpp_t) \ - GO(XML_SetEndElementHandler, vFpp_t) \ - GO(XML_SetEndNamespaceDeclHandler, vFpp_t) \ - GO(XML_SetEntityDeclHandler, vFpp_t) \ - GO(XML_SetExternalEntityRefHandler, vFpp_t) \ - GO(XML_SetNotStandaloneHandler, vFpp_t) \ - GO(XML_SetNotationDeclHandler, vFpp_t) \ - GO(XML_SetProcessingInstructionHandler, vFpp_t) \ - GO(XML_SetSkippedEntityHandler, vFpp_t) \ - GO(XML_SetStartCdataSectionHandler, vFpp_t) \ - GO(XML_SetStartDoctypeDeclHandler, vFpp_t) \ - GO(XML_SetStartElementHandler, vFpp_t) \ - GO(XML_SetStartNamespaceDeclHandler, vFpp_t) \ - GO(XML_SetUnparsedEntityDeclHandler, vFpp_t) \ - GO(XML_SetXmlDeclHandler, vFpp_t) \ - GO(XML_SetElementHandler, vFppp_t) \ - GO(XML_SetNamespaceDeclHandler, vFppp_t) \ - GO(XML_SetUnknownEncodingHandler, vFppp_t) - -#endif // __wrappedexpatTYPES_H_ diff --git a/src/wrapped/generated/wrappedexpatundefs.h b/src/wrapped/generated/wrappedexpatundefs.h deleted file mode 100644 index 7c0e0b4..0000000 --- a/src/wrapped/generated/wrappedexpatundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedexpatUNDEFS_H_ -#define __wrappedexpatUNDEFS_H_ - - -#endif // __wrappedexpatUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedfaudiodefs.h b/src/wrapped/generated/wrappedfaudiodefs.h deleted file mode 100644 index 6e118b8..0000000 --- a/src/wrapped/generated/wrappedfaudiodefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedfaudioDEFS_H_ -#define __wrappedfaudioDEFS_H_ - - -#endif // __wrappedfaudioDEFS_H_ diff --git a/src/wrapped/generated/wrappedfaudiotypes.h b/src/wrapped/generated/wrappedfaudiotypes.h deleted file mode 100644 index 1676f6f..0000000 --- a/src/wrapped/generated/wrappedfaudiotypes.h +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedfaudioTYPES_H_ -#define __wrappedfaudioTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpp_t)(void*, void*); -typedef uint32_t (*uFpp_t)(void*, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef uint32_t (*uFpCppp_t)(void*, uint8_t, void*, void*, void*); -typedef uint32_t (*uFpuppp_t)(void*, uint32_t, void*, void*, void*); -typedef uint32_t (*uFpuuppp_t)(void*, uint32_t, uint32_t, void*, void*, void*); -typedef uint32_t (*uFpppuppp_t)(void*, void*, void*, uint32_t, void*, void*, void*); -typedef uint32_t (*uFpppufppp_t)(void*, void*, void*, uint32_t, float, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(FAudio_UnregisterForCallbacks, vFpp_t) \ - GO(FAudio_RegisterForCallbacks, uFpp_t) \ - GO(FAudio_SetEngineProcedureEXT, vFppp_t) \ - GO(FAudioCOMConstructWithCustomAllocatorEXT, uFpCppp_t) \ - GO(FAudioCreateReverb9WithCustomAllocatorEXT, uFpuppp_t) \ - GO(FAudioCreateReverbWithCustomAllocatorEXT, uFpuppp_t) \ - GO(FAudioCreateVolumeMeterWithCustomAllocatorEXT, uFpuppp_t) \ - GO(FAudioCreateWithCustomAllocatorEXT, uFpuuppp_t) \ - GO(FAPOFX_CreateFXWithCustomAllocatorEXT, uFpppuppp_t) \ - GO(FAudio_CreateSourceVoice, uFpppufppp_t) - -#endif // __wrappedfaudioTYPES_H_ diff --git a/src/wrapped/generated/wrappedfaudioundefs.h b/src/wrapped/generated/wrappedfaudioundefs.h deleted file mode 100644 index f5e9c2a..0000000 --- a/src/wrapped/generated/wrappedfaudioundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedfaudioUNDEFS_H_ -#define __wrappedfaudioUNDEFS_H_ - - -#endif // __wrappedfaudioUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedflacdefs.h b/src/wrapped/generated/wrappedflacdefs.h deleted file mode 100644 index 752417c..0000000 --- a/src/wrapped/generated/wrappedflacdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedflacDEFS_H_ -#define __wrappedflacDEFS_H_ - - -#endif // __wrappedflacDEFS_H_ diff --git a/src/wrapped/generated/wrappedflactypes.h b/src/wrapped/generated/wrappedflactypes.h deleted file mode 100644 index 17fcd7a..0000000 --- a/src/wrapped/generated/wrappedflactypes.h +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedflacTYPES_H_ -#define __wrappedflacTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFppPPPPPP_t)(void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(FLAC__metadata_chain_read_with_callbacks, iFppPPPPPP_t) \ - GO(FLAC__stream_decoder_init_stream, iFpppppppppp_t) - -#endif // __wrappedflacTYPES_H_ diff --git a/src/wrapped/generated/wrappedflacundefs.h b/src/wrapped/generated/wrappedflacundefs.h deleted file mode 100644 index c4ea018..0000000 --- a/src/wrapped/generated/wrappedflacundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedflacUNDEFS_H_ -#define __wrappedflacUNDEFS_H_ - - -#endif // __wrappedflacUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedfontconfigdefs.h b/src/wrapped/generated/wrappedfontconfigdefs.h deleted file mode 100644 index db507ed..0000000 --- a/src/wrapped/generated/wrappedfontconfigdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedfontconfigDEFS_H_ -#define __wrappedfontconfigDEFS_H_ - - -#endif // __wrappedfontconfigDEFS_H_ diff --git a/src/wrapped/generated/wrappedfontconfigtypes.h b/src/wrapped/generated/wrappedfontconfigtypes.h deleted file mode 100644 index f3e8d29..0000000 --- a/src/wrapped/generated/wrappedfontconfigtypes.h +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedfontconfigTYPES_H_ -#define __wrappedfontconfigTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFpV_t)(void*, ...); -typedef void* (*pFpA_t)(void*, va_list); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(FcObjectSetBuild, pFpV_t) \ - GO(FcPatternBuild, pFpV_t) \ - GO(FcObjectSetVaBuild, pFpA_t) \ - GO(FcPatternVaBuild, pFpA_t) - -#endif // __wrappedfontconfigTYPES_H_ diff --git a/src/wrapped/generated/wrappedfontconfigundefs.h b/src/wrapped/generated/wrappedfontconfigundefs.h deleted file mode 100644 index 4bdce17..0000000 --- a/src/wrapped/generated/wrappedfontconfigundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedfontconfigUNDEFS_H_ -#define __wrappedfontconfigUNDEFS_H_ - - -#endif // __wrappedfontconfigUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedfreebl3defs.h b/src/wrapped/generated/wrappedfreebl3defs.h deleted file mode 100644 index 33db283..0000000 --- a/src/wrapped/generated/wrappedfreebl3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedfreebl3DEFS_H_ -#define __wrappedfreebl3DEFS_H_ - - -#endif // __wrappedfreebl3DEFS_H_ diff --git a/src/wrapped/generated/wrappedfreebl3types.h b/src/wrapped/generated/wrappedfreebl3types.h deleted file mode 100644 index 8468e9c..0000000 --- a/src/wrapped/generated/wrappedfreebl3types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedfreebl3TYPES_H_ -#define __wrappedfreebl3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedfreebl3TYPES_H_ diff --git a/src/wrapped/generated/wrappedfreebl3undefs.h b/src/wrapped/generated/wrappedfreebl3undefs.h deleted file mode 100644 index 88b22d7..0000000 --- a/src/wrapped/generated/wrappedfreebl3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedfreebl3UNDEFS_H_ -#define __wrappedfreebl3UNDEFS_H_ - - -#endif // __wrappedfreebl3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedfreetypedefs.h b/src/wrapped/generated/wrappedfreetypedefs.h deleted file mode 100644 index fc2eb27..0000000 --- a/src/wrapped/generated/wrappedfreetypedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedfreetypeDEFS_H_ -#define __wrappedfreetypeDEFS_H_ - - -#endif // __wrappedfreetypeDEFS_H_ diff --git a/src/wrapped/generated/wrappedfreetypetypes.h b/src/wrapped/generated/wrappedfreetypetypes.h deleted file mode 100644 index eb85cbb..0000000 --- a/src/wrapped/generated/wrappedfreetypetypes.h +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedfreetypeTYPES_H_ -#define __wrappedfreetypeTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFpp_t)(void*, void*); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef int32_t (*iFpplp_t)(void*, void*, intptr_t, void*); -typedef int32_t (*iFpuuLppp_t)(void*, uint32_t, uint32_t, uintptr_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(FT_New_Library, iFpp_t) \ - GO(FT_Outline_Decompose, iFppp_t) \ - GO(FT_Open_Face, iFpplp_t) \ - GO(FTC_Manager_New, iFpuuLppp_t) - -#endif // __wrappedfreetypeTYPES_H_ diff --git a/src/wrapped/generated/wrappedfreetypeundefs.h b/src/wrapped/generated/wrappedfreetypeundefs.h deleted file mode 100644 index 6b477c3..0000000 --- a/src/wrapped/generated/wrappedfreetypeundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedfreetypeUNDEFS_H_ -#define __wrappedfreetypeUNDEFS_H_ - - -#endif // __wrappedfreetypeUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgbmdefs.h b/src/wrapped/generated/wrappedgbmdefs.h deleted file mode 100644 index 7e23883..0000000 --- a/src/wrapped/generated/wrappedgbmdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgbmDEFS_H_ -#define __wrappedgbmDEFS_H_ - - -#endif // __wrappedgbmDEFS_H_ diff --git a/src/wrapped/generated/wrappedgbmtypes.h b/src/wrapped/generated/wrappedgbmtypes.h deleted file mode 100644 index c45641f..0000000 --- a/src/wrapped/generated/wrappedgbmtypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgbmTYPES_H_ -#define __wrappedgbmTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFppp_t)(void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gbm_bo_set_user_data, vFppp_t) - -#endif // __wrappedgbmTYPES_H_ diff --git a/src/wrapped/generated/wrappedgbmundefs.h b/src/wrapped/generated/wrappedgbmundefs.h deleted file mode 100644 index 9f4e891..0000000 --- a/src/wrapped/generated/wrappedgbmundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgbmUNDEFS_H_ -#define __wrappedgbmUNDEFS_H_ - - -#endif // __wrappedgbmUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgconf2defs.h b/src/wrapped/generated/wrappedgconf2defs.h deleted file mode 100644 index 56cf7ac..0000000 --- a/src/wrapped/generated/wrappedgconf2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgconf2DEFS_H_ -#define __wrappedgconf2DEFS_H_ - - -#endif // __wrappedgconf2DEFS_H_ diff --git a/src/wrapped/generated/wrappedgconf2types.h b/src/wrapped/generated/wrappedgconf2types.h deleted file mode 100644 index 356c651..0000000 --- a/src/wrapped/generated/wrappedgconf2types.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgconf2TYPES_H_ -#define __wrappedgconf2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef uint32_t (*uFpppppp_t)(void*, void*, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gconf_client_notify_add, uFpppppp_t) - -#endif // __wrappedgconf2TYPES_H_ diff --git a/src/wrapped/generated/wrappedgconf2undefs.h b/src/wrapped/generated/wrappedgconf2undefs.h deleted file mode 100644 index 806ab5b..0000000 --- a/src/wrapped/generated/wrappedgconf2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgconf2UNDEFS_H_ -#define __wrappedgconf2UNDEFS_H_ - - -#endif // __wrappedgconf2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgcryptdefs.h b/src/wrapped/generated/wrappedgcryptdefs.h deleted file mode 100644 index 47ea49c..0000000 --- a/src/wrapped/generated/wrappedgcryptdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgcryptDEFS_H_ -#define __wrappedgcryptDEFS_H_ - - -#endif // __wrappedgcryptDEFS_H_ diff --git a/src/wrapped/generated/wrappedgcrypttypes.h b/src/wrapped/generated/wrappedgcrypttypes.h deleted file mode 100644 index 07785d6..0000000 --- a/src/wrapped/generated/wrappedgcrypttypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgcryptTYPES_H_ -#define __wrappedgcryptTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef uint32_t (*uFpppV_t)(void*, void*, void*, ...); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gcry_sexp_build, uFpppV_t) - -#endif // __wrappedgcryptTYPES_H_ diff --git a/src/wrapped/generated/wrappedgcryptundefs.h b/src/wrapped/generated/wrappedgcryptundefs.h deleted file mode 100644 index 69c2e6f..0000000 --- a/src/wrapped/generated/wrappedgcryptundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgcryptUNDEFS_H_ -#define __wrappedgcryptUNDEFS_H_ - - -#endif // __wrappedgcryptUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgdk3defs.h b/src/wrapped/generated/wrappedgdk3defs.h deleted file mode 100644 index 2d2c754..0000000 --- a/src/wrapped/generated/wrappedgdk3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgdk3DEFS_H_ -#define __wrappedgdk3DEFS_H_ - - -#endif // __wrappedgdk3DEFS_H_ diff --git a/src/wrapped/generated/wrappedgdk3types.h b/src/wrapped/generated/wrappedgdk3types.h deleted file mode 100644 index 9fef466..0000000 --- a/src/wrapped/generated/wrappedgdk3types.h +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgdk3TYPES_H_ -#define __wrappedgdk3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpp_t)(void*, void*); -typedef int32_t (*iFpp_t)(void*, void*); -typedef uint32_t (*uFpp_t)(void*, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef int32_t (*iFiipp_t)(int32_t, int32_t, void*, void*); -typedef uint32_t (*uFippp_t)(int32_t, void*, void*, void*); -typedef int32_t (*iFiippp_t)(int32_t, int32_t, void*, void*, void*); -typedef uint32_t (*uFiuppp_t)(int32_t, uint32_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gdk_init, vFpp_t) \ - GO(gdk_threads_set_lock_functions, vFpp_t) \ - GO(gdk_init_check, iFpp_t) \ - GO(gdk_threads_add_idle, uFpp_t) \ - GO(gdk_event_handler_set, vFppp_t) \ - GO(gdk_window_add_filter, vFppp_t) \ - GO(gdk_window_remove_filter, vFppp_t) \ - GO(gdk_input_add, iFiipp_t) \ - GO(gdk_threads_add_idle_full, uFippp_t) \ - GO(gdk_input_add_full, iFiippp_t) \ - GO(gdk_threads_add_timeout_full, uFiuppp_t) - -#endif // __wrappedgdk3TYPES_H_ diff --git a/src/wrapped/generated/wrappedgdk3undefs.h b/src/wrapped/generated/wrappedgdk3undefs.h deleted file mode 100644 index 2b636c1..0000000 --- a/src/wrapped/generated/wrappedgdk3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgdk3UNDEFS_H_ -#define __wrappedgdk3UNDEFS_H_ - - -#endif // __wrappedgdk3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgdkpixbuf2defs.h b/src/wrapped/generated/wrappedgdkpixbuf2defs.h deleted file mode 100644 index b0f2a7e..0000000 --- a/src/wrapped/generated/wrappedgdkpixbuf2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgdkpixbuf2DEFS_H_ -#define __wrappedgdkpixbuf2DEFS_H_ - - -#endif // __wrappedgdkpixbuf2DEFS_H_ diff --git a/src/wrapped/generated/wrappedgdkpixbuf2types.h b/src/wrapped/generated/wrappedgdkpixbuf2types.h deleted file mode 100644 index 57e0d38..0000000 --- a/src/wrapped/generated/wrappedgdkpixbuf2types.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgdkpixbuf2TYPES_H_ -#define __wrappedgdkpixbuf2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFpiiiiiipp_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gdk_pixbuf_new_from_data, pFpiiiiiipp_t) - -#endif // __wrappedgdkpixbuf2TYPES_H_ diff --git a/src/wrapped/generated/wrappedgdkpixbuf2undefs.h b/src/wrapped/generated/wrappedgdkpixbuf2undefs.h deleted file mode 100644 index 0a6750f..0000000 --- a/src/wrapped/generated/wrappedgdkpixbuf2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgdkpixbuf2UNDEFS_H_ -#define __wrappedgdkpixbuf2UNDEFS_H_ - - -#endif // __wrappedgdkpixbuf2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgdkx112defs.h b/src/wrapped/generated/wrappedgdkx112defs.h deleted file mode 100644 index bd31682..0000000 --- a/src/wrapped/generated/wrappedgdkx112defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgdkx112DEFS_H_ -#define __wrappedgdkx112DEFS_H_ - - -#endif // __wrappedgdkx112DEFS_H_ diff --git a/src/wrapped/generated/wrappedgdkx112types.h b/src/wrapped/generated/wrappedgdkx112types.h deleted file mode 100644 index 4b36cbf..0000000 --- a/src/wrapped/generated/wrappedgdkx112types.h +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgdkx112TYPES_H_ -#define __wrappedgdkx112TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpp_t)(void*, void*); -typedef int32_t (*iFpp_t)(void*, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef int32_t (*iFiipp_t)(int32_t, int32_t, void*, void*); -typedef int32_t (*iFiippp_t)(int32_t, int32_t, void*, void*, void*); -typedef uint32_t (*uFiuppp_t)(int32_t, uint32_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gdk_init, vFpp_t) \ - GO(gdk_init_check, iFpp_t) \ - GO(gdk_event_handler_set, vFppp_t) \ - GO(gdk_window_add_filter, vFppp_t) \ - GO(gdk_window_remove_filter, vFppp_t) \ - GO(gdk_input_add, iFiipp_t) \ - GO(gdk_input_add_full, iFiippp_t) \ - GO(gdk_threads_add_timeout_full, uFiuppp_t) - -#endif // __wrappedgdkx112TYPES_H_ diff --git a/src/wrapped/generated/wrappedgdkx112undefs.h b/src/wrapped/generated/wrappedgdkx112undefs.h deleted file mode 100644 index 308cf82..0000000 --- a/src/wrapped/generated/wrappedgdkx112undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgdkx112UNDEFS_H_ -#define __wrappedgdkx112UNDEFS_H_ - - -#endif // __wrappedgdkx112UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgio2defs.h b/src/wrapped/generated/wrappedgio2defs.h deleted file mode 100644 index c9fad23..0000000 --- a/src/wrapped/generated/wrappedgio2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgio2DEFS_H_ -#define __wrappedgio2DEFS_H_ - - -#endif // __wrappedgio2DEFS_H_ diff --git a/src/wrapped/generated/wrappedgio2types.h b/src/wrapped/generated/wrappedgio2types.h deleted file mode 100644 index 0079010..0000000 --- a/src/wrapped/generated/wrappedgio2types.h +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgio2TYPES_H_ -#define __wrappedgio2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFppp_t)(void*, void*, void*); -typedef void (*vFippp_t)(int32_t, void*, void*, void*); -typedef void (*vFppip_t)(void*, void*, int32_t, void*); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef uint32_t (*uFpppp_t)(void*, void*, void*, void*); -typedef uintptr_t (*LFpppp_t)(void*, void*, void*, void*); -typedef void* (*pFpppp_t)(void*, void*, void*, void*); -typedef void (*vFpippp_t)(void*, int32_t, void*, void*, void*); -typedef void (*vFpuipV_t)(void*, uint32_t, int32_t, void*, ...); -typedef void (*vFppipV_t)(void*, void*, int32_t, void*, ...); -typedef void (*vFppipA_t)(void*, void*, int32_t, void*, va_list); -typedef void* (*pFppppV_t)(void*, void*, void*, void*, ...); -typedef void* (*pFppApp_t)(void*, void*, va_list, void*, void*); -typedef void (*vFpipppp_t)(void*, int32_t, void*, void*, void*, void*); -typedef void (*vFiippppV_t)(int32_t, int32_t, void*, void*, void*, void*, ...); -typedef void (*vFiupippp_t)(int32_t, uint32_t, void*, int32_t, void*, void*, void*); -typedef void (*vFipAippp_t)(int32_t, void*, va_list, int32_t, void*, void*, void*); -typedef void (*vFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*); -typedef void (*vFppLippp_t)(void*, void*, uintptr_t, int32_t, void*, void*, void*); -typedef void (*vFpppuipV_t)(void*, void*, void*, uint32_t, int32_t, void*, ...); -typedef uint32_t (*uFipipppp_t)(int32_t, void*, int32_t, void*, void*, void*, void*); -typedef uint32_t (*uFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*); -typedef uint32_t (*uFppppppp_t)(void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFpppuipV_t)(void*, void*, void*, uint32_t, int32_t, void*, ...); -typedef void (*vFppiipppp_t)(void*, void*, int32_t, int32_t, void*, void*, void*, void*); -typedef void (*vFpppiippp_t)(void*, void*, void*, int32_t, int32_t, void*, void*, void*); -typedef uint32_t (*uFipippppp_t)(int32_t, void*, int32_t, void*, void*, void*, void*, void*); -typedef void (*vFiippppppp_t)(int32_t, int32_t, void*, void*, void*, void*, void*, void*, void*); -typedef void (*vFpippppppp_t)(void*, int32_t, void*, void*, void*, void*, void*, void*, void*); -typedef void (*vFpppiipppp_t)(void*, void*, void*, int32_t, int32_t, void*, void*, void*, void*); -typedef void* (*pFiippppppp_t)(int32_t, int32_t, void*, void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFppppppippp_t)(void*, void*, void*, void*, void*, void*, int32_t, void*, void*, void*); -typedef void (*vFpppppppiippp_t)(void*, void*, void*, void*, void*, void*, void*, int32_t, int32_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(g_simple_async_result_set_op_res_gpointer, vFppp_t) \ - GO(g_task_return_pointer, vFppp_t) \ - GO(g_bus_get, vFippp_t) \ - GO(g_simple_async_result_run_in_thread, vFppip_t) \ - GO(g_dbus_connection_close, vFpppp_t) \ - GO(g_dbus_connection_flush, vFpppp_t) \ - GO(g_simple_async_report_gerror_in_idle, vFpppp_t) \ - GO(g_simple_async_report_take_gerror_in_idle, vFpppp_t) \ - GO(g_dbus_connection_add_filter, uFpppp_t) \ - GO(g_cancellable_connect, LFpppp_t) \ - GO(g_simple_async_result_new, pFpppp_t) \ - GO(g_simple_async_result_new_from_error, pFpppp_t) \ - GO(g_simple_async_result_new_take_error, pFpppp_t) \ - GO(g_task_new, pFpppp_t) \ - GO(g_async_initable_init_async, vFpippp_t) \ - GO(g_task_return_new_error, vFpuipV_t) \ - GO(g_simple_async_result_set_error, vFppipV_t) \ - GO(g_simple_async_result_set_error_va, vFppipA_t) \ - GO(g_initable_new, pFppppV_t) \ - GO(g_initable_new_valist, pFppApp_t) \ - GO(g_dbus_connection_new_for_address, vFpipppp_t) \ - GO(g_async_initable_new_async, vFiippppV_t) \ - GO(g_async_initable_newv_async, vFiupippp_t) \ - GO(g_async_initable_new_valist_async, vFipAippp_t) \ - GO(g_dbus_connection_new, vFppipppp_t) \ - GO(g_input_stream_read_async, vFppLippp_t) \ - GO(g_simple_async_report_error_in_idle, vFpppuipV_t) \ - GO(g_bus_watch_name, uFipipppp_t) \ - GO(g_bus_own_name_on_connection, uFppipppp_t) \ - GO(g_bus_watch_name_on_connection, uFppipppp_t) \ - GO(g_dbus_connection_register_object, uFppppppp_t) \ - GO(g_simple_async_result_new_error, pFpppuipV_t) \ - GO(g_dbus_connection_send_message_with_reply, vFppiipppp_t) \ - GO(g_dbus_proxy_call, vFpppiippp_t) \ - GO(g_bus_own_name, uFipippppp_t) \ - GO(g_dbus_proxy_new_for_bus, vFiippppppp_t) \ - GO(g_dbus_proxy_new, vFpippppppp_t) \ - GO(g_dbus_proxy_call_with_unix_fd_list, vFpppiipppp_t) \ - GO(g_dbus_object_manager_client_new_for_bus_sync, pFiippppppp_t) \ - GO(g_dbus_connection_signal_subscribe, uFppppppippp_t) \ - GO(g_dbus_connection_call, vFpppppppiippp_t) - -#endif // __wrappedgio2TYPES_H_ diff --git a/src/wrapped/generated/wrappedgio2undefs.h b/src/wrapped/generated/wrappedgio2undefs.h deleted file mode 100644 index f14e77a..0000000 --- a/src/wrapped/generated/wrappedgio2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgio2UNDEFS_H_ -#define __wrappedgio2UNDEFS_H_ - - -#endif // __wrappedgio2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedglesv2defs.h b/src/wrapped/generated/wrappedglesv2defs.h deleted file mode 100644 index 26d20e5..0000000 --- a/src/wrapped/generated/wrappedglesv2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedglesv2DEFS_H_ -#define __wrappedglesv2DEFS_H_ - - -#endif // __wrappedglesv2DEFS_H_ diff --git a/src/wrapped/generated/wrappedglesv2types.h b/src/wrapped/generated/wrappedglesv2types.h deleted file mode 100644 index 586fe02..0000000 --- a/src/wrapped/generated/wrappedglesv2types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedglesv2TYPES_H_ -#define __wrappedglesv2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedglesv2TYPES_H_ diff --git a/src/wrapped/generated/wrappedglesv2undefs.h b/src/wrapped/generated/wrappedglesv2undefs.h deleted file mode 100644 index 9362f42..0000000 --- a/src/wrapped/generated/wrappedglesv2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedglesv2UNDEFS_H_ -#define __wrappedglesv2UNDEFS_H_ - - -#endif // __wrappedglesv2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedglib2defs.h b/src/wrapped/generated/wrappedglib2defs.h deleted file mode 100644 index e203aa2..0000000 --- a/src/wrapped/generated/wrappedglib2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedglib2DEFS_H_ -#define __wrappedglib2DEFS_H_ - - -#endif // __wrappedglib2DEFS_H_ diff --git a/src/wrapped/generated/wrappedglib2types.h b/src/wrapped/generated/wrappedglib2types.h deleted file mode 100644 index fc81f77..0000000 --- a/src/wrapped/generated/wrappedglib2types.h +++ /dev/null @@ -1,181 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedglib2TYPES_H_ -#define __wrappedglib2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef void* (*pFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef void (*vFpV_t)(void*, ...); -typedef int32_t (*iFpp_t)(void*, void*); -typedef int32_t (*iFpV_t)(void*, ...); -typedef int32_t (*iFpA_t)(void*, va_list); -typedef uint32_t (*uFpp_t)(void*, void*); -typedef uintptr_t (*LFpA_t)(void*, va_list); -typedef void* (*pFup_t)(uint32_t, void*); -typedef void* (*pFpu_t)(void*, uint32_t); -typedef void* (*pFpp_t)(void*, void*); -typedef void* (*pFpV_t)(void*, ...); -typedef void* (*pFpA_t)(void*, va_list); -typedef void (*vFppp_t)(void*, void*, void*); -typedef void (*vFppV_t)(void*, void*, ...); -typedef void (*vFppA_t)(void*, void*, va_list); -typedef int32_t (*iFppV_t)(void*, void*, ...); -typedef int32_t (*iFppA_t)(void*, void*, va_list); -typedef uint32_t (*uFipp_t)(int32_t, void*, void*); -typedef uint32_t (*uFupp_t)(uint32_t, void*, void*); -typedef uint32_t (*uFppp_t)(void*, void*, void*); -typedef void* (*pFppp_t)(void*, void*, void*); -typedef void* (*pFppV_t)(void*, void*, ...); -typedef void (*vFpipV_t)(void*, int32_t, void*, ...); -typedef void (*vFpipA_t)(void*, int32_t, void*, va_list); -typedef void (*vFpupp_t)(void*, uint32_t, void*, void*); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFpLpV_t)(void*, uintptr_t, void*, ...); -typedef int32_t (*iFpLpA_t)(void*, uintptr_t, void*, va_list); -typedef uint32_t (*uFippp_t)(int32_t, void*, void*, void*); -typedef uint32_t (*uFpipp_t)(void*, int32_t, void*, void*); -typedef void* (*pFpipp_t)(void*, int32_t, void*, void*); -typedef void* (*pFpipV_t)(void*, int32_t, void*, ...); -typedef void* (*pFpipA_t)(void*, int32_t, void*, va_list); -typedef void* (*pFpupp_t)(void*, uint32_t, void*, void*); -typedef void* (*pFpLpp_t)(void*, uintptr_t, void*, void*); -typedef void* (*pFppip_t)(void*, void*, int32_t, void*); -typedef void* (*pFpppp_t)(void*, void*, void*, void*); -typedef void (*vFpiLpp_t)(void*, int32_t, uintptr_t, void*, void*); -typedef void (*vFppipV_t)(void*, void*, int32_t, void*, ...); -typedef uint32_t (*uFiippp_t)(int32_t, int32_t, void*, void*, void*); -typedef uint32_t (*uFiuppp_t)(int32_t, uint32_t, void*, void*, void*); -typedef void* (*pFppppp_t)(void*, void*, void*, void*, void*); -typedef void (*vFpiiipp_t)(void*, int32_t, int32_t, int32_t, void*, void*); -typedef int32_t (*iFpupppp_t)(void*, uint32_t, void*, void*, void*, void*); -typedef uint32_t (*uFpiippp_t)(void*, int32_t, int32_t, void*, void*, void*); -typedef void* (*pFppuipp_t)(void*, void*, uint32_t, int32_t, void*, void*); -typedef void* (*pFppLiiip_t)(void*, void*, uintptr_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFpppipppp_t)(void*, void*, void*, int32_t, void*, void*, void*, void*); -typedef int32_t (*iFpppipppppp_t)(void*, void*, void*, int32_t, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpppippppppp_t)(void*, void*, void*, int32_t, void*, void*, void*, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(g_atexit, vFp_t) \ - GO(g_completion_new, pFp_t) \ - GO(g_main_context_get_poll_func, pFp_t) \ - GO(g_private_new, pFp_t) \ - GO(g_ptr_array_new_with_free_func, pFp_t) \ - GO(g_set_print_handler, pFp_t) \ - GO(g_set_printerr_handler, pFp_t) \ - GO(g_array_set_clear_func, vFpp_t) \ - GO(g_array_sort, vFpp_t) \ - GO(g_completion_set_compare, vFpp_t) \ - GO(g_list_free_full, vFpp_t) \ - GO(g_main_context_set_poll_func, vFpp_t) \ - GO(g_ptr_array_set_free_func, vFpp_t) \ - GO(g_ptr_array_sort, vFpp_t) \ - GO(g_slist_free_full, vFpp_t) \ - GO(g_source_set_funcs, vFpp_t) \ - GO(g_thread_foreach, vFpp_t) \ - GO(g_print, vFpV_t) \ - GO(g_printerr, vFpV_t) \ - GO(g_source_remove_by_funcs_user_data, iFpp_t) \ - GO(g_printf, iFpV_t) \ - GO(g_vprintf, iFpA_t) \ - GO(g_idle_add, uFpp_t) \ - GO(g_printf_string_upper_bound, LFpA_t) \ - GO(g_ptr_array_new_full, pFup_t) \ - GO(g_source_new, pFpu_t) \ - GO(g_hash_table_new, pFpp_t) \ - GO(g_list_sort, pFpp_t) \ - GO(g_log_set_default_handler, pFpp_t) \ - GO(g_slist_sort, pFpp_t) \ - GO(g_strjoinv, pFpp_t) \ - GO(g_variant_new_parsed_va, pFpp_t) \ - GO(g_build_filename, pFpV_t) \ - GO(g_markup_printf_escaped, pFpV_t) \ - GO(g_strconcat, pFpV_t) \ - GO(g_strdup_printf, pFpV_t) \ - GO(g_strjoin, pFpV_t) \ - GO(g_variant_new, pFpV_t) \ - GO(g_markup_vprintf_escaped, pFpA_t) \ - GO(g_strdup_vprintf, pFpA_t) \ - GO(g_array_sort_with_data, vFppp_t) \ - GO(g_hash_table_foreach, vFppp_t) \ - GO(g_list_foreach, vFppp_t) \ - GO(g_option_context_add_main_entries, vFppp_t) \ - GO(g_option_group_set_parse_hooks, vFppp_t) \ - GO(g_ptr_array_foreach, vFppp_t) \ - GO(g_ptr_array_sort_with_data, vFppp_t) \ - GO(g_queue_foreach, vFppp_t) \ - GO(g_static_private_set, vFppp_t) \ - GO(g_string_append_printf, vFppV_t) \ - GO(g_string_printf, vFppV_t) \ - GO(g_variant_builder_add, vFppV_t) \ - GO(g_variant_get, vFppV_t) \ - GO(g_string_append_vprintf, vFppA_t) \ - GO(g_string_vprintf, vFppA_t) \ - GO(g_fprintf, iFppV_t) \ - GO(g_sprintf, iFppV_t) \ - GO(g_vasprintf, iFppA_t) \ - GO(g_vfprintf, iFppA_t) \ - GO(g_vsprintf, iFppA_t) \ - GO(g_child_watch_add, uFipp_t) \ - GO(g_timeout_add, uFupp_t) \ - GO(g_timeout_add_seconds, uFupp_t) \ - GO(g_hash_table_foreach_remove, uFppp_t) \ - GO(g_hash_table_foreach_steal, uFppp_t) \ - GO(g_hash_table_find, pFppp_t) \ - GO(g_list_find_custom, pFppp_t) \ - GO(g_list_insert_sorted, pFppp_t) \ - GO(g_list_sort_with_data, pFppp_t) \ - GO(g_node_copy_deep, pFppp_t) \ - GO(g_once_impl, pFppp_t) \ - GO(g_queue_find_custom, pFppp_t) \ - GO(g_slist_find_custom, pFppp_t) \ - GO(g_slist_foreach, pFppp_t) \ - GO(g_slist_insert_sorted, pFppp_t) \ - GO(g_slist_sort_with_data, pFppp_t) \ - GO(g_thread_new, pFppp_t) \ - GO(g_variant_new_va, pFppp_t) \ - GO(g_build_path, pFppV_t) \ - GO(g_log, vFpipV_t) \ - GO(g_logv, vFpipA_t) \ - GO(g_datalist_id_set_data_full, vFpupp_t) \ - GO(g_source_set_callback, vFpppp_t) \ - GO(g_snprintf, iFpLpV_t) \ - GO(g_vsnprintf, iFpLpA_t) \ - GO(g_idle_add_full, uFippp_t) \ - GO(g_io_add_watch, uFpipp_t) \ - GO(g_log_set_handler, uFpipp_t) \ - GO(g_markup_parse_context_new, pFpipp_t) \ - GO(g_error_new, pFpipV_t) \ - GO(g_error_new_valist, pFpipA_t) \ - GO(g_datalist_id_dup_data, pFpupp_t) \ - GO(g_bytes_new_with_free_func, pFpLpp_t) \ - GO(g_thread_create, pFppip_t) \ - GO(g_hash_table_new_full, pFpppp_t) \ - GO(g_list_insert_sorted_with_data, pFpppp_t) \ - GO(g_slist_insert_sorted_with_data, pFpppp_t) \ - GO(g_thread_try_new, pFpppp_t) \ - GO(g_qsort_with_data, vFpiLpp_t) \ - GO(g_set_error, vFppipV_t) \ - GO(g_child_watch_add_full, uFiippp_t) \ - GO(g_timeout_add_full, uFiuppp_t) \ - GO(g_timeout_add_seconds_full, uFiuppp_t) \ - GO(g_option_group_new, pFppppp_t) \ - GO(g_node_traverse, vFpiiipp_t) \ - GO(g_datalist_id_replace_data, iFpupppp_t) \ - GO(g_io_add_watch_full, uFpiippp_t) \ - GO(g_variant_new_from_data, pFppuipp_t) \ - GO(g_thread_create_full, pFppLiiip_t) \ - GO(g_spawn_async, iFpppipppp_t) \ - GO(g_spawn_sync, iFpppipppppp_t) \ - GO(g_spawn_async_with_pipes, iFpppippppppp_t) - -#endif // __wrappedglib2TYPES_H_ diff --git a/src/wrapped/generated/wrappedglib2undefs.h b/src/wrapped/generated/wrappedglib2undefs.h deleted file mode 100644 index f6d5f43..0000000 --- a/src/wrapped/generated/wrappedglib2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedglib2UNDEFS_H_ -#define __wrappedglib2UNDEFS_H_ - - -#endif // __wrappedglib2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgmodule2defs.h b/src/wrapped/generated/wrappedgmodule2defs.h deleted file mode 100644 index 297d418..0000000 --- a/src/wrapped/generated/wrappedgmodule2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgmodule2DEFS_H_ -#define __wrappedgmodule2DEFS_H_ - - -#endif // __wrappedgmodule2DEFS_H_ diff --git a/src/wrapped/generated/wrappedgmodule2types.h b/src/wrapped/generated/wrappedgmodule2types.h deleted file mode 100644 index 96576d2..0000000 --- a/src/wrapped/generated/wrappedgmodule2types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgmodule2TYPES_H_ -#define __wrappedgmodule2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgmodule2TYPES_H_ diff --git a/src/wrapped/generated/wrappedgmodule2undefs.h b/src/wrapped/generated/wrappedgmodule2undefs.h deleted file mode 100644 index 3776199..0000000 --- a/src/wrapped/generated/wrappedgmodule2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgmodule2UNDEFS_H_ -#define __wrappedgmodule2UNDEFS_H_ - - -#endif // __wrappedgmodule2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgmpdefs.h b/src/wrapped/generated/wrappedgmpdefs.h deleted file mode 100644 index 48916e6..0000000 --- a/src/wrapped/generated/wrappedgmpdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgmpDEFS_H_ -#define __wrappedgmpDEFS_H_ - - -#endif // __wrappedgmpDEFS_H_ diff --git a/src/wrapped/generated/wrappedgmptypes.h b/src/wrapped/generated/wrappedgmptypes.h deleted file mode 100644 index c7a54de..0000000 --- a/src/wrapped/generated/wrappedgmptypes.h +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgmpTYPES_H_ -#define __wrappedgmpTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFppp_t)(void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(__gmp_get_memory_functions, vFppp_t) \ - GO(__gmp_set_memory_functions, vFppp_t) - -#endif // __wrappedgmpTYPES_H_ diff --git a/src/wrapped/generated/wrappedgmpundefs.h b/src/wrapped/generated/wrappedgmpundefs.h deleted file mode 100644 index 514a6c0..0000000 --- a/src/wrapped/generated/wrappedgmpundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgmpUNDEFS_H_ -#define __wrappedgmpUNDEFS_H_ - - -#endif // __wrappedgmpUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgnutlsdefs.h b/src/wrapped/generated/wrappedgnutlsdefs.h deleted file mode 100644 index c717849..0000000 --- a/src/wrapped/generated/wrappedgnutlsdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgnutlsDEFS_H_ -#define __wrappedgnutlsDEFS_H_ - - -#endif // __wrappedgnutlsDEFS_H_ diff --git a/src/wrapped/generated/wrappedgnutlstypes.h b/src/wrapped/generated/wrappedgnutlstypes.h deleted file mode 100644 index 3727283..0000000 --- a/src/wrapped/generated/wrappedgnutlstypes.h +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgnutlsTYPES_H_ -#define __wrappedgnutlsTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gnutls_global_set_log_function, vFp_t) \ - GO(gnutls_transport_set_pull_function, vFpp_t) \ - GO(gnutls_transport_set_pull_timeout_function, vFpp_t) \ - GO(gnutls_transport_set_push_function, vFpp_t) - -#endif // __wrappedgnutlsTYPES_H_ diff --git a/src/wrapped/generated/wrappedgnutlsundefs.h b/src/wrapped/generated/wrappedgnutlsundefs.h deleted file mode 100644 index 8ab689c..0000000 --- a/src/wrapped/generated/wrappedgnutlsundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgnutlsUNDEFS_H_ -#define __wrappedgnutlsUNDEFS_H_ - - -#endif // __wrappedgnutlsUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgobject2defs.h b/src/wrapped/generated/wrappedgobject2defs.h deleted file mode 100644 index 0f36947..0000000 --- a/src/wrapped/generated/wrappedgobject2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgobject2DEFS_H_ -#define __wrappedgobject2DEFS_H_ - - -#endif // __wrappedgobject2DEFS_H_ diff --git a/src/wrapped/generated/wrappedgobject2types.h b/src/wrapped/generated/wrappedgobject2types.h deleted file mode 100644 index d7a8f66..0000000 --- a/src/wrapped/generated/wrappedgobject2types.h +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgobject2TYPES_H_ -#define __wrappedgobject2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFL_t)(uintptr_t); -typedef void* (*pFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef int32_t (*iFpp_t)(void*, void*); -typedef void* (*pFpp_t)(void*, void*); -typedef void (*vFiip_t)(int32_t, int32_t, void*); -typedef void (*vFLLp_t)(uintptr_t, uintptr_t, void*); -typedef void (*vFpup_t)(void*, uint32_t, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef void (*vFppV_t)(void*, void*, ...); -typedef void (*vFppA_t)(void*, void*, va_list); -typedef uintptr_t (*LFppp_t)(void*, void*, void*); -typedef void* (*pFLpV_t)(uintptr_t, void*, ...); -typedef void* (*pFLpA_t)(uintptr_t, void*, va_list); -typedef void* (*pFppp_t)(void*, void*, void*); -typedef void* (*pFppV_t)(void*, void*, ...); -typedef void (*vFpuuV_t)(void*, uint32_t, uint32_t, ...); -typedef void (*vFpupp_t)(void*, uint32_t, void*, void*); -typedef void (*vFpupA_t)(void*, uint32_t, void*, va_list); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef uintptr_t (*LFLppi_t)(uintptr_t, void*, void*, int32_t); -typedef uintptr_t (*LFupppp_t)(uint32_t, void*, void*, void*, void*); -typedef uintptr_t (*LFLpppi_t)(uintptr_t, void*, void*, void*, int32_t); -typedef uintptr_t (*LFppppi_t)(void*, void*, void*, void*, int32_t); -typedef uintptr_t (*LFpppppu_t)(void*, void*, void*, void*, void*, uint32_t); -typedef uint32_t (*uFpiupppp_t)(void*, int32_t, uint32_t, void*, void*, void*, void*); -typedef uintptr_t (*LFLpupupu_t)(uintptr_t, void*, uint32_t, void*, uint32_t, void*, uint32_t); -typedef uintptr_t (*LFpiupppp_t)(void*, int32_t, uint32_t, void*, void*, void*, void*); -typedef uint32_t (*uFpLiupppLuV_t)(void*, uintptr_t, int32_t, uint32_t, void*, void*, void*, uintptr_t, uint32_t, ...); -typedef uint32_t (*uFpLippppLup_t)(void*, uintptr_t, int32_t, void*, void*, void*, void*, uintptr_t, uint32_t, void*); -typedef uint32_t (*uFpLippppLuA_t)(void*, uintptr_t, int32_t, void*, void*, void*, void*, uintptr_t, uint32_t, va_list); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(g_type_value_table_peek, pFL_t) \ - GO(g_type_class_peek_parent, pFp_t) \ - GO(g_closure_set_marshal, vFpp_t) \ - GO(g_param_type_register_static, iFpp_t) \ - GO(g_value_array_sort, pFpp_t) \ - GO(g_value_register_transform_func, vFiip_t) \ - GO(g_type_add_interface_static, vFLLp_t) \ - GO(g_object_class_install_properties, vFpup_t) \ - GO(g_closure_add_finalize_notifier, vFppp_t) \ - GO(g_closure_remove_finalize_notifier, vFppp_t) \ - GO(g_object_weak_ref, vFppp_t) \ - GO(g_signal_override_class_handler, vFppp_t) \ - GO(g_object_get, vFppV_t) \ - GO(g_object_set, vFppV_t) \ - GO(g_object_get_valist, vFppA_t) \ - GO(g_object_set_valist, vFppA_t) \ - GO(g_boxed_type_register_static, LFppp_t) \ - GO(g_object_new, pFLpV_t) \ - GO(g_object_new_valist, pFLpA_t) \ - GO(g_cclosure_new, pFppp_t) \ - GO(g_cclosure_new_swap, pFppp_t) \ - GO(g_value_array_sort_with_data, pFppp_t) \ - GO(g_object_connect, pFppV_t) \ - GO(g_signal_emit, vFpuuV_t) \ - GO(g_param_spec_set_qdata_full, vFpupp_t) \ - GO(g_signal_emit_valist, vFpupA_t) \ - GO(g_object_set_data_full, vFpppp_t) \ - GO(g_object_set_qdata_full, vFpppp_t) \ - GO(g_type_register_static, LFLppi_t) \ - GO(g_signal_add_emission_hook, LFupppp_t) \ - GO(g_type_register_fundamental, LFLpppi_t) \ - GO(g_signal_connect_object, LFppppi_t) \ - GO(g_signal_connect_data, LFpppppu_t) \ - GO(g_signal_handlers_block_matched, uFpiupppp_t) \ - GO(g_signal_handlers_disconnect_matched, uFpiupppp_t) \ - GO(g_signal_handlers_unblock_matched, uFpiupppp_t) \ - GO(g_type_register_static_simple, LFLpupupu_t) \ - GO(g_signal_handler_find, LFpiupppp_t) \ - GO(g_signal_new, uFpLiupppLuV_t) \ - GO(g_signal_newv, uFpLippppLup_t) \ - GO(g_signal_new_valist, uFpLippppLuA_t) - -#endif // __wrappedgobject2TYPES_H_ diff --git a/src/wrapped/generated/wrappedgobject2undefs.h b/src/wrapped/generated/wrappedgobject2undefs.h deleted file mode 100644 index 5b5b37b..0000000 --- a/src/wrapped/generated/wrappedgobject2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgobject2UNDEFS_H_ -#define __wrappedgobject2UNDEFS_H_ - - -#endif // __wrappedgobject2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgompdefs.h b/src/wrapped/generated/wrappedgompdefs.h deleted file mode 100644 index 5618a4d..0000000 --- a/src/wrapped/generated/wrappedgompdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgompDEFS_H_ -#define __wrappedgompDEFS_H_ - - -#endif // __wrappedgompDEFS_H_ diff --git a/src/wrapped/generated/wrappedgomptypes.h b/src/wrapped/generated/wrappedgomptypes.h deleted file mode 100644 index 4b0d4c0..0000000 --- a/src/wrapped/generated/wrappedgomptypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgompTYPES_H_ -#define __wrappedgompTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFppuu_t)(void*, void*, uint32_t, uint32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(GOMP_parallel, vFppuu_t) - -#endif // __wrappedgompTYPES_H_ diff --git a/src/wrapped/generated/wrappedgompundefs.h b/src/wrapped/generated/wrappedgompundefs.h deleted file mode 100644 index ae3271f..0000000 --- a/src/wrapped/generated/wrappedgompundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgompUNDEFS_H_ -#define __wrappedgompUNDEFS_H_ - - -#endif // __wrappedgompUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgssapidefs.h b/src/wrapped/generated/wrappedgssapidefs.h deleted file mode 100644 index 85b82b8..0000000 --- a/src/wrapped/generated/wrappedgssapidefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgssapiDEFS_H_ -#define __wrappedgssapiDEFS_H_ - - -#endif // __wrappedgssapiDEFS_H_ diff --git a/src/wrapped/generated/wrappedgssapikrb5defs.h b/src/wrapped/generated/wrappedgssapikrb5defs.h deleted file mode 100644 index 423cee1..0000000 --- a/src/wrapped/generated/wrappedgssapikrb5defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgssapikrb5DEFS_H_ -#define __wrappedgssapikrb5DEFS_H_ - - -#endif // __wrappedgssapikrb5DEFS_H_ diff --git a/src/wrapped/generated/wrappedgssapikrb5types.h b/src/wrapped/generated/wrappedgssapikrb5types.h deleted file mode 100644 index 2f2c3cd..0000000 --- a/src/wrapped/generated/wrappedgssapikrb5types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgssapikrb5TYPES_H_ -#define __wrappedgssapikrb5TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgssapikrb5TYPES_H_ diff --git a/src/wrapped/generated/wrappedgssapikrb5undefs.h b/src/wrapped/generated/wrappedgssapikrb5undefs.h deleted file mode 100644 index a2be1c3..0000000 --- a/src/wrapped/generated/wrappedgssapikrb5undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgssapikrb5UNDEFS_H_ -#define __wrappedgssapikrb5UNDEFS_H_ - - -#endif // __wrappedgssapikrb5UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgssapitypes.h b/src/wrapped/generated/wrappedgssapitypes.h deleted file mode 100644 index 3d4ee9f..0000000 --- a/src/wrapped/generated/wrappedgssapitypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgssapiTYPES_H_ -#define __wrappedgssapiTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgssapiTYPES_H_ diff --git a/src/wrapped/generated/wrappedgssapiundefs.h b/src/wrapped/generated/wrappedgssapiundefs.h deleted file mode 100644 index c5512ff..0000000 --- a/src/wrapped/generated/wrappedgssapiundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgssapiUNDEFS_H_ -#define __wrappedgssapiUNDEFS_H_ - - -#endif // __wrappedgssapiUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstallocatorsdefs.h b/src/wrapped/generated/wrappedgstallocatorsdefs.h deleted file mode 100644 index c45e3cf..0000000 --- a/src/wrapped/generated/wrappedgstallocatorsdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstallocatorsDEFS_H_ -#define __wrappedgstallocatorsDEFS_H_ - - -#endif // __wrappedgstallocatorsDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstallocatorstypes.h b/src/wrapped/generated/wrappedgstallocatorstypes.h deleted file mode 100644 index a98a8a1..0000000 --- a/src/wrapped/generated/wrappedgstallocatorstypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstallocatorsTYPES_H_ -#define __wrappedgstallocatorsTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstallocatorsTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstallocatorsundefs.h b/src/wrapped/generated/wrappedgstallocatorsundefs.h deleted file mode 100644 index c672c70..0000000 --- a/src/wrapped/generated/wrappedgstallocatorsundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstallocatorsUNDEFS_H_ -#define __wrappedgstallocatorsUNDEFS_H_ - - -#endif // __wrappedgstallocatorsUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstappdefs.h b/src/wrapped/generated/wrappedgstappdefs.h deleted file mode 100644 index 35f3ab3..0000000 --- a/src/wrapped/generated/wrappedgstappdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstappDEFS_H_ -#define __wrappedgstappDEFS_H_ - - -#endif // __wrappedgstappDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstapptypes.h b/src/wrapped/generated/wrappedgstapptypes.h deleted file mode 100644 index 4ffbaf8..0000000 --- a/src/wrapped/generated/wrappedgstapptypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstappTYPES_H_ -#define __wrappedgstappTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstappTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstappundefs.h b/src/wrapped/generated/wrappedgstappundefs.h deleted file mode 100644 index ce6a01f..0000000 --- a/src/wrapped/generated/wrappedgstappundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstappUNDEFS_H_ -#define __wrappedgstappUNDEFS_H_ - - -#endif // __wrappedgstappUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstaudiodefs.h b/src/wrapped/generated/wrappedgstaudiodefs.h deleted file mode 100644 index 1cb16ea..0000000 --- a/src/wrapped/generated/wrappedgstaudiodefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstaudioDEFS_H_ -#define __wrappedgstaudioDEFS_H_ - - -#endif // __wrappedgstaudioDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstaudiotypes.h b/src/wrapped/generated/wrappedgstaudiotypes.h deleted file mode 100644 index 82d46cc..0000000 --- a/src/wrapped/generated/wrappedgstaudiotypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstaudioTYPES_H_ -#define __wrappedgstaudioTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstaudioTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstaudioundefs.h b/src/wrapped/generated/wrappedgstaudioundefs.h deleted file mode 100644 index fb81b07..0000000 --- a/src/wrapped/generated/wrappedgstaudioundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstaudioUNDEFS_H_ -#define __wrappedgstaudioUNDEFS_H_ - - -#endif // __wrappedgstaudioUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstbasedefs.h b/src/wrapped/generated/wrappedgstbasedefs.h deleted file mode 100644 index d9a16ee..0000000 --- a/src/wrapped/generated/wrappedgstbasedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstbaseDEFS_H_ -#define __wrappedgstbaseDEFS_H_ - - -#endif // __wrappedgstbaseDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstbasetypes.h b/src/wrapped/generated/wrappedgstbasetypes.h deleted file mode 100644 index 4c30623..0000000 --- a/src/wrapped/generated/wrappedgstbasetypes.h +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstbaseTYPES_H_ -#define __wrappedgstbaseTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFppp_t)(void*, void*, void*); -typedef void* (*pFppupi_t)(void*, void*, uint32_t, void*, int32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gst_collect_pads_set_buffer_function, vFppp_t) \ - GO(gst_collect_pads_set_clip_function, vFppp_t) \ - GO(gst_collect_pads_set_event_function, vFppp_t) \ - GO(gst_collect_pads_set_function, vFppp_t) \ - GO(gst_collect_pads_set_query_function, vFppp_t) \ - GO(gst_collect_pads_add_pad, pFppupi_t) - -#endif // __wrappedgstbaseTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstbaseundefs.h b/src/wrapped/generated/wrappedgstbaseundefs.h deleted file mode 100644 index 0547e9f..0000000 --- a/src/wrapped/generated/wrappedgstbaseundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstbaseUNDEFS_H_ -#define __wrappedgstbaseUNDEFS_H_ - - -#endif // __wrappedgstbaseUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstcheckdefs.h b/src/wrapped/generated/wrappedgstcheckdefs.h deleted file mode 100644 index 150a1b5..0000000 --- a/src/wrapped/generated/wrappedgstcheckdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstcheckDEFS_H_ -#define __wrappedgstcheckDEFS_H_ - - -#endif // __wrappedgstcheckDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstchecktypes.h b/src/wrapped/generated/wrappedgstchecktypes.h deleted file mode 100644 index 5769e17..0000000 --- a/src/wrapped/generated/wrappedgstchecktypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstcheckTYPES_H_ -#define __wrappedgstcheckTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstcheckTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstcheckundefs.h b/src/wrapped/generated/wrappedgstcheckundefs.h deleted file mode 100644 index 29f89b9..0000000 --- a/src/wrapped/generated/wrappedgstcheckundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstcheckUNDEFS_H_ -#define __wrappedgstcheckUNDEFS_H_ - - -#endif // __wrappedgstcheckUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstcontrollerdefs.h b/src/wrapped/generated/wrappedgstcontrollerdefs.h deleted file mode 100644 index 639be35..0000000 --- a/src/wrapped/generated/wrappedgstcontrollerdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstcontrollerDEFS_H_ -#define __wrappedgstcontrollerDEFS_H_ - - -#endif // __wrappedgstcontrollerDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstcontrollertypes.h b/src/wrapped/generated/wrappedgstcontrollertypes.h deleted file mode 100644 index b52da4a..0000000 --- a/src/wrapped/generated/wrappedgstcontrollertypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstcontrollerTYPES_H_ -#define __wrappedgstcontrollerTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstcontrollerTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstcontrollerundefs.h b/src/wrapped/generated/wrappedgstcontrollerundefs.h deleted file mode 100644 index 342d086..0000000 --- a/src/wrapped/generated/wrappedgstcontrollerundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstcontrollerUNDEFS_H_ -#define __wrappedgstcontrollerUNDEFS_H_ - - -#endif // __wrappedgstcontrollerUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstfftdefs.h b/src/wrapped/generated/wrappedgstfftdefs.h deleted file mode 100644 index 8e45f8e..0000000 --- a/src/wrapped/generated/wrappedgstfftdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstfftDEFS_H_ -#define __wrappedgstfftDEFS_H_ - - -#endif // __wrappedgstfftDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstffttypes.h b/src/wrapped/generated/wrappedgstffttypes.h deleted file mode 100644 index 1628dae..0000000 --- a/src/wrapped/generated/wrappedgstffttypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstfftTYPES_H_ -#define __wrappedgstfftTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstfftTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstfftundefs.h b/src/wrapped/generated/wrappedgstfftundefs.h deleted file mode 100644 index 26a688a..0000000 --- a/src/wrapped/generated/wrappedgstfftundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstfftUNDEFS_H_ -#define __wrappedgstfftUNDEFS_H_ - - -#endif // __wrappedgstfftUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstgldefs.h b/src/wrapped/generated/wrappedgstgldefs.h deleted file mode 100644 index 255450f..0000000 --- a/src/wrapped/generated/wrappedgstgldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstglDEFS_H_ -#define __wrappedgstglDEFS_H_ - - -#endif // __wrappedgstglDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstgltypes.h b/src/wrapped/generated/wrappedgstgltypes.h deleted file mode 100644 index e801305..0000000 --- a/src/wrapped/generated/wrappedgstgltypes.h +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstglTYPES_H_ -#define __wrappedgstglTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFup_t)(uint32_t, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef void (*vFppV_t)(void*, void*, ...); -typedef void* (*pFuup_t)(uint32_t, uint32_t, void*); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFppppp_t)(void*, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gst_gl_context_default_get_proc_address, pFup_t) \ - GO(gst_gl_context_thread_add, vFppp_t) \ - GO(gst_gl_window_send_message, vFppp_t) \ - GO(gst_gl_insert_debug_marker, vFppV_t) \ - GO(gst_gl_context_get_proc_address_with_platform, pFuup_t) \ - GO(gst_gl_window_set_close_callback, vFpppp_t) \ - GO(gst_gl_window_set_draw_callback, vFpppp_t) \ - GO(gst_gl_window_set_resize_callback, vFpppp_t) \ - GO(gst_gl_framebuffer_draw_to_texture, iFpppp_t) \ - GO(gst_gl_filter_render_to_target, iFppppp_t) - -#endif // __wrappedgstglTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstglundefs.h b/src/wrapped/generated/wrappedgstglundefs.h deleted file mode 100644 index 05db81c..0000000 --- a/src/wrapped/generated/wrappedgstglundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstglUNDEFS_H_ -#define __wrappedgstglUNDEFS_H_ - - -#endif // __wrappedgstglUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstnetdefs.h b/src/wrapped/generated/wrappedgstnetdefs.h deleted file mode 100644 index 50e7548..0000000 --- a/src/wrapped/generated/wrappedgstnetdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstnetDEFS_H_ -#define __wrappedgstnetDEFS_H_ - - -#endif // __wrappedgstnetDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstnettypes.h b/src/wrapped/generated/wrappedgstnettypes.h deleted file mode 100644 index a4f1dbb..0000000 --- a/src/wrapped/generated/wrappedgstnettypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstnetTYPES_H_ -#define __wrappedgstnetTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstnetTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstnetundefs.h b/src/wrapped/generated/wrappedgstnetundefs.h deleted file mode 100644 index 3af737a..0000000 --- a/src/wrapped/generated/wrappedgstnetundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstnetUNDEFS_H_ -#define __wrappedgstnetUNDEFS_H_ - - -#endif // __wrappedgstnetUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstpbutilsdefs.h b/src/wrapped/generated/wrappedgstpbutilsdefs.h deleted file mode 100644 index 6451ec6..0000000 --- a/src/wrapped/generated/wrappedgstpbutilsdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstpbutilsDEFS_H_ -#define __wrappedgstpbutilsDEFS_H_ - - -#endif // __wrappedgstpbutilsDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstpbutilstypes.h b/src/wrapped/generated/wrappedgstpbutilstypes.h deleted file mode 100644 index ec08b7d..0000000 --- a/src/wrapped/generated/wrappedgstpbutilstypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstpbutilsTYPES_H_ -#define __wrappedgstpbutilsTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstpbutilsTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstpbutilsundefs.h b/src/wrapped/generated/wrappedgstpbutilsundefs.h deleted file mode 100644 index c4e5fb3..0000000 --- a/src/wrapped/generated/wrappedgstpbutilsundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstpbutilsUNDEFS_H_ -#define __wrappedgstpbutilsUNDEFS_H_ - - -#endif // __wrappedgstpbutilsUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstreamerdefs.h b/src/wrapped/generated/wrappedgstreamerdefs.h deleted file mode 100644 index 6b6714e..0000000 --- a/src/wrapped/generated/wrappedgstreamerdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstreamerDEFS_H_ -#define __wrappedgstreamerDEFS_H_ - - -#endif // __wrappedgstreamerDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstreamertypes.h b/src/wrapped/generated/wrappedgstreamertypes.h deleted file mode 100644 index 939f702..0000000 --- a/src/wrapped/generated/wrappedgstreamertypes.h +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstreamerTYPES_H_ -#define __wrappedgstreamerTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFA_t)(va_list); -typedef void (*vFpp_t)(void*, void*); -typedef void* (*pFpp_t)(void*, void*); -typedef void* (*pFpV_t)(void*, ...); -typedef void* (*pFpA_t)(void*, va_list); -typedef void (*vFppp_t)(void*, void*, void*); -typedef void (*vFppV_t)(void*, void*, ...); -typedef void (*vFppA_t)(void*, void*, va_list); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef int32_t (*iFppV_t)(void*, void*, ...); -typedef int32_t (*iFppA_t)(void*, void*, va_list); -typedef uint32_t (*uFppp_t)(void*, void*, void*); -typedef void* (*pFppp_t)(void*, void*, void*); -typedef void* (*pFppV_t)(void*, void*, ...); -typedef void* (*pFppA_t)(void*, void*, va_list); -typedef void (*vFpipV_t)(void*, int32_t, void*, ...); -typedef void (*vFpipA_t)(void*, int32_t, void*, va_list); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); -typedef void* (*pFppip_t)(void*, void*, int32_t, void*); -typedef void* (*pFpppV_t)(void*, void*, void*, ...); -typedef void* (*pFpppA_t)(void*, void*, void*, va_list); -typedef uint32_t (*uFpippp_t)(void*, int32_t, void*, void*, void*); -typedef uintptr_t (*LFpippp_t)(void*, int32_t, void*, void*, void*); -typedef void* (*pFiplllpp_t)(int32_t, void*, intptr_t, intptr_t, intptr_t, void*, void*); -typedef void* (*pFipLLLpp_t)(int32_t, void*, uintptr_t, uintptr_t, uintptr_t, void*, void*); -typedef void* (*pFpuLpipp_t)(void*, uint32_t, uintptr_t, void*, int32_t, void*, void*); -typedef void (*vFpippippV_t)(void*, int32_t, void*, void*, int32_t, void*, void*, ...); -typedef void (*vFpippippA_t)(void*, int32_t, void*, void*, int32_t, void*, void*, va_list); -typedef int32_t (*iFppuppppp_t)(void*, void*, uint32_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFiipppppppp_t)(int32_t, int32_t, void*, void*, void*, void*, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gst_tag_list_new_valist, pFA_t) \ - GO(gst_init, vFpp_t) \ - GO(gst_plugin_load_file, pFpp_t) \ - GO(_gst_element_error_printf, pFpV_t) \ - GO(gst_caps_features_new, pFpV_t) \ - GO(gst_make_element_message_details, pFpV_t) \ - GO(gst_tag_list_new, pFpV_t) \ - GO(gst_caps_features_new_valist, pFpA_t) \ - GO(gst_pad_sticky_events_foreach, vFppp_t) \ - GO(gst_structure_filter_and_map_in_place, vFppp_t) \ - GO(gst_tag_list_foreach, vFppp_t) \ - GO(gst_bin_add_many, vFppV_t) \ - GO(gst_caps_set_simple, vFppV_t) \ - GO(gst_structure_remove_fields, vFppV_t) \ - GO(gst_structure_set, vFppV_t) \ - GO(gst_caps_set_simple_valist, vFppA_t) \ - GO(gst_structure_remove_fields_valist, vFppA_t) \ - GO(gst_structure_set_valist, vFppA_t) \ - GO(gst_buffer_foreach_meta, iFppp_t) \ - GO(gst_caps_foreach, iFppp_t) \ - GO(gst_element_foreach_sink_pad, iFppp_t) \ - GO(gst_init_check, iFppp_t) \ - GO(gst_structure_foreach, iFppp_t) \ - GO(gst_element_link_many, iFppV_t) \ - GO(gst_structure_get, iFppV_t) \ - GO(gst_info_vasprintf, iFppA_t) \ - GO(gst_structure_get_valist, iFppA_t) \ - GO(gst_bus_add_watch, uFppp_t) \ - GO(gst_task_new, pFppp_t) \ - GO(gst_caps_new_simple, pFppV_t) \ - GO(gst_structure_new, pFppV_t) \ - GO(gst_structure_new_valist, pFppA_t) \ - GO(gst_tag_list_add, vFpipV_t) \ - GO(gst_tag_list_add_values, vFpipV_t) \ - GO(gst_tag_list_add_valist, vFpipA_t) \ - GO(gst_tag_list_add_valist_values, vFpipA_t) \ - GO(gst_bus_set_sync_handler, vFpppp_t) \ - GO(gst_mini_object_set_qdata, vFpppp_t) \ - GO(gst_pad_set_activate_function_full, vFpppp_t) \ - GO(gst_pad_set_activatemode_function_full, vFpppp_t) \ - GO(gst_pad_set_chain_function_full, vFpppp_t) \ - GO(gst_pad_set_event_function_full, vFpppp_t) \ - GO(gst_pad_set_getrange_function_full, vFpppp_t) \ - GO(gst_pad_set_iterate_internal_links_function_full, vFpppp_t) \ - GO(gst_pad_set_link_function_full, vFpppp_t) \ - GO(gst_pad_set_query_function_full, vFpppp_t) \ - GO(gst_iterator_fold, iFpppp_t) \ - GO(gst_pad_start_task, iFpppp_t) \ - GO(gst_registry_feature_filter, pFppip_t) \ - GO(gst_pad_create_stream_id_printf, pFpppV_t) \ - GO(gst_pad_create_stream_id_printf_valist, pFpppA_t) \ - GO(gst_bus_add_watch_full, uFpippp_t) \ - GO(gst_pad_add_probe, LFpippp_t) \ - GO(gst_buffer_new_wrapped_full, pFiplllpp_t) \ - GO(gst_memory_new_wrapped, pFipLLLpp_t) \ - GO(gst_util_array_binary_search, pFpuLpipp_t) \ - GO(gst_debug_log, vFpippippV_t) \ - GO(gst_debug_log_valist, vFpippippA_t) \ - GO(gst_type_find_register, iFppuppppp_t) \ - GO(gst_plugin_register_static, iFiipppppppp_t) - -#endif // __wrappedgstreamerTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstreamerundefs.h b/src/wrapped/generated/wrappedgstreamerundefs.h deleted file mode 100644 index 207c97a..0000000 --- a/src/wrapped/generated/wrappedgstreamerundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstreamerUNDEFS_H_ -#define __wrappedgstreamerUNDEFS_H_ - - -#endif // __wrappedgstreamerUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstriffdefs.h b/src/wrapped/generated/wrappedgstriffdefs.h deleted file mode 100644 index 81e814b..0000000 --- a/src/wrapped/generated/wrappedgstriffdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstriffDEFS_H_ -#define __wrappedgstriffDEFS_H_ - - -#endif // __wrappedgstriffDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstrifftypes.h b/src/wrapped/generated/wrappedgstrifftypes.h deleted file mode 100644 index 8799c1e..0000000 --- a/src/wrapped/generated/wrappedgstrifftypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstriffTYPES_H_ -#define __wrappedgstriffTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstriffTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstriffundefs.h b/src/wrapped/generated/wrappedgstriffundefs.h deleted file mode 100644 index ddb6cb9..0000000 --- a/src/wrapped/generated/wrappedgstriffundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstriffUNDEFS_H_ -#define __wrappedgstriffUNDEFS_H_ - - -#endif // __wrappedgstriffUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstrtpdefs.h b/src/wrapped/generated/wrappedgstrtpdefs.h deleted file mode 100644 index 871d7f6..0000000 --- a/src/wrapped/generated/wrappedgstrtpdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstrtpDEFS_H_ -#define __wrappedgstrtpDEFS_H_ - - -#endif // __wrappedgstrtpDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstrtptypes.h b/src/wrapped/generated/wrappedgstrtptypes.h deleted file mode 100644 index 54af171..0000000 --- a/src/wrapped/generated/wrappedgstrtptypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstrtpTYPES_H_ -#define __wrappedgstrtpTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstrtpTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstrtpundefs.h b/src/wrapped/generated/wrappedgstrtpundefs.h deleted file mode 100644 index 09ae5a3..0000000 --- a/src/wrapped/generated/wrappedgstrtpundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstrtpUNDEFS_H_ -#define __wrappedgstrtpUNDEFS_H_ - - -#endif // __wrappedgstrtpUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstrtspdefs.h b/src/wrapped/generated/wrappedgstrtspdefs.h deleted file mode 100644 index cf9cd01..0000000 --- a/src/wrapped/generated/wrappedgstrtspdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstrtspDEFS_H_ -#define __wrappedgstrtspDEFS_H_ - - -#endif // __wrappedgstrtspDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstrtsptypes.h b/src/wrapped/generated/wrappedgstrtsptypes.h deleted file mode 100644 index c5ec4e6..0000000 --- a/src/wrapped/generated/wrappedgstrtsptypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstrtspTYPES_H_ -#define __wrappedgstrtspTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstrtspTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstrtspundefs.h b/src/wrapped/generated/wrappedgstrtspundefs.h deleted file mode 100644 index b40cba5..0000000 --- a/src/wrapped/generated/wrappedgstrtspundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstrtspUNDEFS_H_ -#define __wrappedgstrtspUNDEFS_H_ - - -#endif // __wrappedgstrtspUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstsdpdefs.h b/src/wrapped/generated/wrappedgstsdpdefs.h deleted file mode 100644 index 1d7b9f4..0000000 --- a/src/wrapped/generated/wrappedgstsdpdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstsdpDEFS_H_ -#define __wrappedgstsdpDEFS_H_ - - -#endif // __wrappedgstsdpDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstsdptypes.h b/src/wrapped/generated/wrappedgstsdptypes.h deleted file mode 100644 index 8d25683..0000000 --- a/src/wrapped/generated/wrappedgstsdptypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstsdpTYPES_H_ -#define __wrappedgstsdpTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstsdpTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstsdpundefs.h b/src/wrapped/generated/wrappedgstsdpundefs.h deleted file mode 100644 index 01e5b54..0000000 --- a/src/wrapped/generated/wrappedgstsdpundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstsdpUNDEFS_H_ -#define __wrappedgstsdpUNDEFS_H_ - - -#endif // __wrappedgstsdpUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgsttagdefs.h b/src/wrapped/generated/wrappedgsttagdefs.h deleted file mode 100644 index f9e4019..0000000 --- a/src/wrapped/generated/wrappedgsttagdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgsttagDEFS_H_ -#define __wrappedgsttagDEFS_H_ - - -#endif // __wrappedgsttagDEFS_H_ diff --git a/src/wrapped/generated/wrappedgsttagtypes.h b/src/wrapped/generated/wrappedgsttagtypes.h deleted file mode 100644 index 32da785..0000000 --- a/src/wrapped/generated/wrappedgsttagtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgsttagTYPES_H_ -#define __wrappedgsttagTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgsttagTYPES_H_ diff --git a/src/wrapped/generated/wrappedgsttagundefs.h b/src/wrapped/generated/wrappedgsttagundefs.h deleted file mode 100644 index 7b71d72..0000000 --- a/src/wrapped/generated/wrappedgsttagundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgsttagUNDEFS_H_ -#define __wrappedgsttagUNDEFS_H_ - - -#endif // __wrappedgsttagUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstvideodefs.h b/src/wrapped/generated/wrappedgstvideodefs.h deleted file mode 100644 index 58d61cb..0000000 --- a/src/wrapped/generated/wrappedgstvideodefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstvideoDEFS_H_ -#define __wrappedgstvideoDEFS_H_ - - -#endif // __wrappedgstvideoDEFS_H_ diff --git a/src/wrapped/generated/wrappedgstvideotypes.h b/src/wrapped/generated/wrappedgstvideotypes.h deleted file mode 100644 index 33bc624..0000000 --- a/src/wrapped/generated/wrappedgstvideotypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstvideoTYPES_H_ -#define __wrappedgstvideoTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedgstvideoTYPES_H_ diff --git a/src/wrapped/generated/wrappedgstvideoundefs.h b/src/wrapped/generated/wrappedgstvideoundefs.h deleted file mode 100644 index cfe9373..0000000 --- a/src/wrapped/generated/wrappedgstvideoundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgstvideoUNDEFS_H_ -#define __wrappedgstvideoUNDEFS_H_ - - -#endif // __wrappedgstvideoUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgthread2defs.h b/src/wrapped/generated/wrappedgthread2defs.h deleted file mode 100644 index 745d004..0000000 --- a/src/wrapped/generated/wrappedgthread2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgthread2DEFS_H_ -#define __wrappedgthread2DEFS_H_ - - -#endif // __wrappedgthread2DEFS_H_ diff --git a/src/wrapped/generated/wrappedgthread2types.h b/src/wrapped/generated/wrappedgthread2types.h deleted file mode 100644 index 104fab8..0000000 --- a/src/wrapped/generated/wrappedgthread2types.h +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgthread2TYPES_H_ -#define __wrappedgthread2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(g_thread_init, vFp_t) \ - GO(g_thread_init_with_errorcheck_mutexes, vFp_t) - -#endif // __wrappedgthread2TYPES_H_ diff --git a/src/wrapped/generated/wrappedgthread2undefs.h b/src/wrapped/generated/wrappedgthread2undefs.h deleted file mode 100644 index 486f880..0000000 --- a/src/wrapped/generated/wrappedgthread2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgthread2UNDEFS_H_ -#define __wrappedgthread2UNDEFS_H_ - - -#endif // __wrappedgthread2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgtk3defs.h b/src/wrapped/generated/wrappedgtk3defs.h deleted file mode 100644 index de33868..0000000 --- a/src/wrapped/generated/wrappedgtk3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgtk3DEFS_H_ -#define __wrappedgtk3DEFS_H_ - - -#endif // __wrappedgtk3DEFS_H_ diff --git a/src/wrapped/generated/wrappedgtk3types.h b/src/wrapped/generated/wrappedgtk3types.h deleted file mode 100644 index 93850e0..0000000 --- a/src/wrapped/generated/wrappedgtk3types.h +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgtk3TYPES_H_ -#define __wrappedgtk3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFi_t)(int32_t); -typedef void (*vFpp_t)(void*, void*); -typedef void (*vFpA_t)(void*, va_list); -typedef int32_t (*iFLp_t)(uintptr_t, void*); -typedef int32_t (*iFpp_t)(void*, void*); -typedef void* (*pFuV_t)(uint32_t, ...); -typedef void (*vFpiA_t)(void*, int32_t, va_list); -typedef void (*vFppp_t)(void*, void*, void*); -typedef void (*vFppV_t)(void*, void*, ...); -typedef void (*vFppA_t)(void*, void*, va_list); -typedef uint32_t (*uFupp_t)(uint32_t, void*, void*); -typedef void (*vFppiV_t)(void*, void*, int32_t, ...); -typedef void (*vFpppi_t)(void*, void*, void*, int32_t); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); -typedef void (*vFpippp_t)(void*, int32_t, void*, void*, void*); -typedef void (*vFpuppp_t)(void*, uint32_t, void*, void*, void*); -typedef void (*vFppppp_t)(void*, void*, void*, void*, void*); -typedef int32_t (*iFppuppp_t)(void*, void*, uint32_t, void*, void*, void*); -typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*); -typedef void (*vFpppppuu_t)(void*, void*, void*, void*, void*, uint32_t, uint32_t); -typedef void* (*pFppppppi_t)(void*, void*, void*, void*, void*, void*, int32_t); -typedef void* (*pFppppppp_t)(void*, void*, void*, void*, void*, void*, void*); -typedef uintptr_t (*LFppppppii_t)(void*, void*, void*, void*, void*, void*, int32_t, int32_t); -typedef void* (*pFpppppppi_t)(void*, void*, void*, void*, void*, void*, void*, int32_t); -typedef void* (*pFpippppppp_t)(void*, int32_t, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFpipppppppi_t)(void*, int32_t, void*, void*, void*, void*, void*, void*, void*, int32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gtk_type_class, pFi_t) \ - GO(gtk_builder_connect_signals, vFpp_t) \ - GO(gtk_init, vFpp_t) \ - GO(gtk_style_context_get_style_valist, vFpA_t) \ - GO(gtk_type_unique, iFLp_t) \ - GO(gtk_init_check, iFpp_t) \ - GO(gtk_tree_store_new, pFuV_t) \ - GO(gtk_style_context_get_valist, vFpiA_t) \ - GO(gtk_builder_connect_signals_full, vFppp_t) \ - GO(gtk_clipboard_request_text, vFppp_t) \ - GO(gtk_container_forall, vFppp_t) \ - GO(gtk_container_foreach, vFppp_t) \ - GO(gtk_menu_attach_to_widget, vFppp_t) \ - GO(gtk_dialog_add_buttons, vFppV_t) \ - GO(gtk_message_dialog_format_secondary_markup, vFppV_t) \ - GO(gtk_message_dialog_format_secondary_text, vFppV_t) \ - GO(gtk_style_context_get, vFppV_t) \ - GO(gtk_tree_store_set, vFppV_t) \ - GO(gtk_widget_style_get, vFppV_t) \ - GO(gtk_tree_store_set_valist, vFppA_t) \ - GO(gtk_timeout_add, uFupp_t) \ - GO(gtk_list_store_insert_with_values, vFppiV_t) \ - GO(gtk_enumerate_printers, vFpppi_t) \ - GO(gtk_object_set_data_full, vFpppp_t) \ - GO(gtk_print_job_send, vFpppp_t) \ - GO(gtk_stock_set_translate_func, vFpppp_t) \ - GO(gtk_tree_sortable_set_default_sort_func, vFpppp_t) \ - GO(gtk_tree_view_set_search_equal_func, vFpppp_t) \ - GO(gtk_text_iter_backward_find_char, iFpppp_t) \ - GO(gtk_text_iter_forward_find_char, iFpppp_t) \ - GO(gtk_tree_sortable_set_sort_func, vFpippp_t) \ - GO(gtk_file_filter_add_custom, vFpuppp_t) \ - GO(gtk_tree_view_column_set_cell_data_func, vFppppp_t) \ - GO(gtk_clipboard_set_with_data, iFppuppp_t) \ - GO(gtk_clipboard_set_with_owner, iFppuppp_t) \ - GO(gtk_init_with_args, iFpppppp_t) \ - GO(gtk_menu_popup, vFpppppuu_t) \ - GO(gtk_toolbar_insert_stock, pFppppppi_t) \ - GO(gtk_toolbar_append_item, pFppppppp_t) \ - GO(gtk_toolbar_prepend_item, pFppppppp_t) \ - GO(gtk_signal_connect_full, LFppppppii_t) \ - GO(gtk_toolbar_insert_item, pFpppppppi_t) \ - GO(gtk_toolbar_append_element, pFpippppppp_t) \ - GO(gtk_toolbar_prepend_element, pFpippppppp_t) \ - GO(gtk_toolbar_insert_element, pFpipppppppi_t) - -#endif // __wrappedgtk3TYPES_H_ diff --git a/src/wrapped/generated/wrappedgtk3undefs.h b/src/wrapped/generated/wrappedgtk3undefs.h deleted file mode 100644 index 763ac0e..0000000 --- a/src/wrapped/generated/wrappedgtk3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgtk3UNDEFS_H_ -#define __wrappedgtk3UNDEFS_H_ - - -#endif // __wrappedgtk3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedgtkx112defs.h b/src/wrapped/generated/wrappedgtkx112defs.h deleted file mode 100644 index b23e2b3..0000000 --- a/src/wrapped/generated/wrappedgtkx112defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgtkx112DEFS_H_ -#define __wrappedgtkx112DEFS_H_ - - -#endif // __wrappedgtkx112DEFS_H_ diff --git a/src/wrapped/generated/wrappedgtkx112types.h b/src/wrapped/generated/wrappedgtkx112types.h deleted file mode 100644 index 3456628..0000000 --- a/src/wrapped/generated/wrappedgtkx112types.h +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgtkx112TYPES_H_ -#define __wrappedgtkx112TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef float (*fFp_t)(void*); -typedef void* (*pFi_t)(int32_t); -typedef void (*vFpp_t)(void*, void*); -typedef int32_t (*iFpp_t)(void*, void*); -typedef void* (*pFiV_t)(int32_t, ...); -typedef void* (*pFpi_t)(void*, int32_t); -typedef void (*vFppp_t)(void*, void*, void*); -typedef void (*vFppV_t)(void*, void*, ...); -typedef void (*vFppA_t)(void*, void*, va_list); -typedef uint32_t (*uFupp_t)(uint32_t, void*, void*); -typedef void* (*pFppp_t)(void*, void*, void*); -typedef void (*vFppiV_t)(void*, void*, int32_t, ...); -typedef void (*vFppup_t)(void*, void*, uint32_t, void*); -typedef void (*vFpppi_t)(void*, void*, void*, int32_t); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); -typedef uintptr_t (*LFpppp_t)(void*, void*, void*, void*); -typedef void (*vFpippp_t)(void*, int32_t, void*, void*, void*); -typedef void (*vFpuppp_t)(void*, uint32_t, void*, void*, void*); -typedef void (*vFppupp_t)(void*, void*, uint32_t, void*, void*); -typedef void (*vFppppp_t)(void*, void*, void*, void*, void*); -typedef void (*vFpuipuV_t)(void*, uint32_t, int32_t, void*, uint32_t, ...); -typedef int32_t (*iFppuppp_t)(void*, void*, uint32_t, void*, void*, void*); -typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFiipppp_t)(int32_t, int32_t, void*, void*, void*, void*); -typedef void (*vFpppppuu_t)(void*, void*, void*, void*, void*, uint32_t, uint32_t); -typedef void* (*pFppppppi_t)(void*, void*, void*, void*, void*, void*, int32_t); -typedef void* (*pFppppppp_t)(void*, void*, void*, void*, void*, void*, void*); -typedef uintptr_t (*LFppppppii_t)(void*, void*, void*, void*, void*, void*, int32_t, int32_t); -typedef void* (*pFpppppppi_t)(void*, void*, void*, void*, void*, void*, void*, int32_t); -typedef void* (*pFpippppppp_t)(void*, int32_t, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFpipppppppi_t)(void*, int32_t, void*, void*, void*, void*, void*, void*, void*, int32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gtk_spin_button_get_value_as_float, fFp_t) \ - GO(gtk_type_class, pFi_t) \ - GO(gtk_builder_connect_signals, vFpp_t) \ - GO(gtk_init, vFpp_t) \ - GO(gtk_init_check, iFpp_t) \ - GO(gtk_type_unique, iFpp_t) \ - GO(gtk_list_store_new, pFiV_t) \ - GO(gtk_tree_store_new, pFiV_t) \ - GO(gtk_type_check_object_cast, pFpi_t) \ - GO(gtk_builder_connect_signals_full, vFppp_t) \ - GO(gtk_clipboard_request_text, vFppp_t) \ - GO(gtk_container_forall, vFppp_t) \ - GO(gtk_container_foreach, vFppp_t) \ - GO(gtk_menu_attach_to_widget, vFppp_t) \ - GO(gtk_tree_model_foreach, vFppp_t) \ - GO(gtk_tree_selection_selected_foreach, vFppp_t) \ - GO(gtk_dialog_add_buttons, vFppV_t) \ - GO(gtk_list_store_set, vFppV_t) \ - GO(gtk_message_dialog_format_secondary_markup, vFppV_t) \ - GO(gtk_message_dialog_format_secondary_text, vFppV_t) \ - GO(gtk_tree_model_get, vFppV_t) \ - GO(gtk_widget_style_get, vFppV_t) \ - GO(gtk_list_store_set_valist, vFppA_t) \ - GO(gtk_tree_model_get_valist, vFppA_t) \ - GO(gtk_widget_style_get_valist, vFppA_t) \ - GO(gtk_timeout_add, uFupp_t) \ - GO(gtk_link_button_set_uri_hook, pFppp_t) \ - GO(gtk_list_store_insert_with_values, vFppiV_t) \ - GO(gtk_action_group_add_actions, vFppup_t) \ - GO(gtk_enumerate_printers, vFpppi_t) \ - GO(gtk_clipboard_request_contents, vFpppp_t) \ - GO(gtk_object_set_data_full, vFpppp_t) \ - GO(gtk_print_job_send, vFpppp_t) \ - GO(gtk_stock_set_translate_func, vFpppp_t) \ - GO(gtk_tree_sortable_set_default_sort_func, vFpppp_t) \ - GO(gtk_tree_view_set_search_equal_func, vFpppp_t) \ - GO(gtk_text_iter_backward_find_char, iFpppp_t) \ - GO(gtk_text_iter_forward_find_char, iFpppp_t) \ - GO(gtk_signal_connect, LFpppp_t) \ - GO(gtk_tree_sortable_set_sort_func, vFpippp_t) \ - GO(gtk_file_filter_add_custom, vFpuppp_t) \ - GO(gtk_action_group_add_actions_full, vFppupp_t) \ - GO(gtk_cell_layout_set_cell_data_func, vFppppp_t) \ - GO(gtk_tree_view_column_set_cell_data_func, vFppppp_t) \ - GO(gtk_binding_entry_add_signal, vFpuipuV_t) \ - GO(gtk_clipboard_set_with_data, iFppuppp_t) \ - GO(gtk_clipboard_set_with_owner, iFppuppp_t) \ - GO(gtk_init_with_args, iFpppppp_t) \ - GO(gtk_input_add_full, uFiipppp_t) \ - GO(gtk_menu_popup, vFpppppuu_t) \ - GO(gtk_toolbar_insert_stock, pFppppppi_t) \ - GO(gtk_toolbar_append_item, pFppppppp_t) \ - GO(gtk_toolbar_prepend_item, pFppppppp_t) \ - GO(gtk_signal_connect_full, LFppppppii_t) \ - GO(gtk_toolbar_insert_item, pFpppppppi_t) \ - GO(gtk_toolbar_append_element, pFpippppppp_t) \ - GO(gtk_toolbar_prepend_element, pFpippppppp_t) \ - GO(gtk_toolbar_insert_element, pFpipppppppi_t) - -#endif // __wrappedgtkx112TYPES_H_ diff --git a/src/wrapped/generated/wrappedgtkx112undefs.h b/src/wrapped/generated/wrappedgtkx112undefs.h deleted file mode 100644 index 4f05b24..0000000 --- a/src/wrapped/generated/wrappedgtkx112undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedgtkx112UNDEFS_H_ -#define __wrappedgtkx112UNDEFS_H_ - - -#endif // __wrappedgtkx112UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedicui18n64defs.h b/src/wrapped/generated/wrappedicui18n64defs.h deleted file mode 100644 index 18689c5..0000000 --- a/src/wrapped/generated/wrappedicui18n64defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n64DEFS_H_ -#define __wrappedicui18n64DEFS_H_ - - -#endif // __wrappedicui18n64DEFS_H_ diff --git a/src/wrapped/generated/wrappedicui18n64types.h b/src/wrapped/generated/wrappedicui18n64types.h deleted file mode 100644 index 849a176..0000000 --- a/src/wrapped/generated/wrappedicui18n64types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n64TYPES_H_ -#define __wrappedicui18n64TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedicui18n64TYPES_H_ diff --git a/src/wrapped/generated/wrappedicui18n64undefs.h b/src/wrapped/generated/wrappedicui18n64undefs.h deleted file mode 100644 index 2613c2d..0000000 --- a/src/wrapped/generated/wrappedicui18n64undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n64UNDEFS_H_ -#define __wrappedicui18n64UNDEFS_H_ - - -#endif // __wrappedicui18n64UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedicui18n66defs.h b/src/wrapped/generated/wrappedicui18n66defs.h deleted file mode 100644 index 62c4ec8..0000000 --- a/src/wrapped/generated/wrappedicui18n66defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n66DEFS_H_ -#define __wrappedicui18n66DEFS_H_ - - -#endif // __wrappedicui18n66DEFS_H_ diff --git a/src/wrapped/generated/wrappedicui18n66types.h b/src/wrapped/generated/wrappedicui18n66types.h deleted file mode 100644 index c3aaa0c..0000000 --- a/src/wrapped/generated/wrappedicui18n66types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n66TYPES_H_ -#define __wrappedicui18n66TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedicui18n66TYPES_H_ diff --git a/src/wrapped/generated/wrappedicui18n66undefs.h b/src/wrapped/generated/wrappedicui18n66undefs.h deleted file mode 100644 index 8c75e93..0000000 --- a/src/wrapped/generated/wrappedicui18n66undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n66UNDEFS_H_ -#define __wrappedicui18n66UNDEFS_H_ - - -#endif // __wrappedicui18n66UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedicui18n67defs.h b/src/wrapped/generated/wrappedicui18n67defs.h deleted file mode 100644 index 91fd2a6..0000000 --- a/src/wrapped/generated/wrappedicui18n67defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n67DEFS_H_ -#define __wrappedicui18n67DEFS_H_ - - -#endif // __wrappedicui18n67DEFS_H_ diff --git a/src/wrapped/generated/wrappedicui18n67types.h b/src/wrapped/generated/wrappedicui18n67types.h deleted file mode 100644 index f387e62..0000000 --- a/src/wrapped/generated/wrappedicui18n67types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n67TYPES_H_ -#define __wrappedicui18n67TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedicui18n67TYPES_H_ diff --git a/src/wrapped/generated/wrappedicui18n67undefs.h b/src/wrapped/generated/wrappedicui18n67undefs.h deleted file mode 100644 index 04164f9..0000000 --- a/src/wrapped/generated/wrappedicui18n67undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n67UNDEFS_H_ -#define __wrappedicui18n67UNDEFS_H_ - - -#endif // __wrappedicui18n67UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedicui18n72defs.h b/src/wrapped/generated/wrappedicui18n72defs.h deleted file mode 100644 index f065b4c..0000000 --- a/src/wrapped/generated/wrappedicui18n72defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n72DEFS_H_ -#define __wrappedicui18n72DEFS_H_ - - -#endif // __wrappedicui18n72DEFS_H_ diff --git a/src/wrapped/generated/wrappedicui18n72types.h b/src/wrapped/generated/wrappedicui18n72types.h deleted file mode 100644 index ba6a2e7..0000000 --- a/src/wrapped/generated/wrappedicui18n72types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n72TYPES_H_ -#define __wrappedicui18n72TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedicui18n72TYPES_H_ diff --git a/src/wrapped/generated/wrappedicui18n72undefs.h b/src/wrapped/generated/wrappedicui18n72undefs.h deleted file mode 100644 index fa3d7f9..0000000 --- a/src/wrapped/generated/wrappedicui18n72undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n72UNDEFS_H_ -#define __wrappedicui18n72UNDEFS_H_ - - -#endif // __wrappedicui18n72UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedicui18n73defs.h b/src/wrapped/generated/wrappedicui18n73defs.h deleted file mode 100644 index 7dd420e..0000000 --- a/src/wrapped/generated/wrappedicui18n73defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n73DEFS_H_ -#define __wrappedicui18n73DEFS_H_ - - -#endif // __wrappedicui18n73DEFS_H_ diff --git a/src/wrapped/generated/wrappedicui18n73types.h b/src/wrapped/generated/wrappedicui18n73types.h deleted file mode 100644 index a532595..0000000 --- a/src/wrapped/generated/wrappedicui18n73types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n73TYPES_H_ -#define __wrappedicui18n73TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedicui18n73TYPES_H_ diff --git a/src/wrapped/generated/wrappedicui18n73undefs.h b/src/wrapped/generated/wrappedicui18n73undefs.h deleted file mode 100644 index af936d3..0000000 --- a/src/wrapped/generated/wrappedicui18n73undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n73UNDEFS_H_ -#define __wrappedicui18n73UNDEFS_H_ - - -#endif // __wrappedicui18n73UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedicui18n74defs.h b/src/wrapped/generated/wrappedicui18n74defs.h deleted file mode 100644 index 9d35caa..0000000 --- a/src/wrapped/generated/wrappedicui18n74defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n74DEFS_H_ -#define __wrappedicui18n74DEFS_H_ - - -#endif // __wrappedicui18n74DEFS_H_ diff --git a/src/wrapped/generated/wrappedicui18n74types.h b/src/wrapped/generated/wrappedicui18n74types.h deleted file mode 100644 index c7ab0d4..0000000 --- a/src/wrapped/generated/wrappedicui18n74types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n74TYPES_H_ -#define __wrappedicui18n74TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedicui18n74TYPES_H_ diff --git a/src/wrapped/generated/wrappedicui18n74undefs.h b/src/wrapped/generated/wrappedicui18n74undefs.h deleted file mode 100644 index 6165885..0000000 --- a/src/wrapped/generated/wrappedicui18n74undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicui18n74UNDEFS_H_ -#define __wrappedicui18n74UNDEFS_H_ - - -#endif // __wrappedicui18n74UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedicuuc64defs.h b/src/wrapped/generated/wrappedicuuc64defs.h deleted file mode 100644 index b0e5e18..0000000 --- a/src/wrapped/generated/wrappedicuuc64defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc64DEFS_H_ -#define __wrappedicuuc64DEFS_H_ - - -#endif // __wrappedicuuc64DEFS_H_ diff --git a/src/wrapped/generated/wrappedicuuc64types.h b/src/wrapped/generated/wrappedicuuc64types.h deleted file mode 100644 index afad3be..0000000 --- a/src/wrapped/generated/wrappedicuuc64types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc64TYPES_H_ -#define __wrappedicuuc64TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedicuuc64TYPES_H_ diff --git a/src/wrapped/generated/wrappedicuuc64undefs.h b/src/wrapped/generated/wrappedicuuc64undefs.h deleted file mode 100644 index 8405e07..0000000 --- a/src/wrapped/generated/wrappedicuuc64undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc64UNDEFS_H_ -#define __wrappedicuuc64UNDEFS_H_ - - -#endif // __wrappedicuuc64UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedicuuc66defs.h b/src/wrapped/generated/wrappedicuuc66defs.h deleted file mode 100644 index 5236e32..0000000 --- a/src/wrapped/generated/wrappedicuuc66defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc66DEFS_H_ -#define __wrappedicuuc66DEFS_H_ - - -#endif // __wrappedicuuc66DEFS_H_ diff --git a/src/wrapped/generated/wrappedicuuc66types.h b/src/wrapped/generated/wrappedicuuc66types.h deleted file mode 100644 index 050fe41..0000000 --- a/src/wrapped/generated/wrappedicuuc66types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc66TYPES_H_ -#define __wrappedicuuc66TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedicuuc66TYPES_H_ diff --git a/src/wrapped/generated/wrappedicuuc66undefs.h b/src/wrapped/generated/wrappedicuuc66undefs.h deleted file mode 100644 index 97cf2db..0000000 --- a/src/wrapped/generated/wrappedicuuc66undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc66UNDEFS_H_ -#define __wrappedicuuc66UNDEFS_H_ - - -#endif // __wrappedicuuc66UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedicuuc67defs.h b/src/wrapped/generated/wrappedicuuc67defs.h deleted file mode 100644 index 96e34f1..0000000 --- a/src/wrapped/generated/wrappedicuuc67defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc67DEFS_H_ -#define __wrappedicuuc67DEFS_H_ - - -#endif // __wrappedicuuc67DEFS_H_ diff --git a/src/wrapped/generated/wrappedicuuc67types.h b/src/wrapped/generated/wrappedicuuc67types.h deleted file mode 100644 index 508d920..0000000 --- a/src/wrapped/generated/wrappedicuuc67types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc67TYPES_H_ -#define __wrappedicuuc67TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedicuuc67TYPES_H_ diff --git a/src/wrapped/generated/wrappedicuuc67undefs.h b/src/wrapped/generated/wrappedicuuc67undefs.h deleted file mode 100644 index e6043cd..0000000 --- a/src/wrapped/generated/wrappedicuuc67undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc67UNDEFS_H_ -#define __wrappedicuuc67UNDEFS_H_ - - -#endif // __wrappedicuuc67UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedicuuc72defs.h b/src/wrapped/generated/wrappedicuuc72defs.h deleted file mode 100644 index 8a512ca..0000000 --- a/src/wrapped/generated/wrappedicuuc72defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc72DEFS_H_ -#define __wrappedicuuc72DEFS_H_ - - -#endif // __wrappedicuuc72DEFS_H_ diff --git a/src/wrapped/generated/wrappedicuuc72types.h b/src/wrapped/generated/wrappedicuuc72types.h deleted file mode 100644 index ff28ecf..0000000 --- a/src/wrapped/generated/wrappedicuuc72types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc72TYPES_H_ -#define __wrappedicuuc72TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedicuuc72TYPES_H_ diff --git a/src/wrapped/generated/wrappedicuuc72undefs.h b/src/wrapped/generated/wrappedicuuc72undefs.h deleted file mode 100644 index 82b2e32..0000000 --- a/src/wrapped/generated/wrappedicuuc72undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc72UNDEFS_H_ -#define __wrappedicuuc72UNDEFS_H_ - - -#endif // __wrappedicuuc72UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedicuuc73defs.h b/src/wrapped/generated/wrappedicuuc73defs.h deleted file mode 100644 index 93b84b0..0000000 --- a/src/wrapped/generated/wrappedicuuc73defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc73DEFS_H_ -#define __wrappedicuuc73DEFS_H_ - - -#endif // __wrappedicuuc73DEFS_H_ diff --git a/src/wrapped/generated/wrappedicuuc73types.h b/src/wrapped/generated/wrappedicuuc73types.h deleted file mode 100644 index e6859dd..0000000 --- a/src/wrapped/generated/wrappedicuuc73types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc73TYPES_H_ -#define __wrappedicuuc73TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedicuuc73TYPES_H_ diff --git a/src/wrapped/generated/wrappedicuuc73undefs.h b/src/wrapped/generated/wrappedicuuc73undefs.h deleted file mode 100644 index 8fa4518..0000000 --- a/src/wrapped/generated/wrappedicuuc73undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc73UNDEFS_H_ -#define __wrappedicuuc73UNDEFS_H_ - - -#endif // __wrappedicuuc73UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedicuuc74defs.h b/src/wrapped/generated/wrappedicuuc74defs.h deleted file mode 100644 index b8dc616..0000000 --- a/src/wrapped/generated/wrappedicuuc74defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc74DEFS_H_ -#define __wrappedicuuc74DEFS_H_ - - -#endif // __wrappedicuuc74DEFS_H_ diff --git a/src/wrapped/generated/wrappedicuuc74types.h b/src/wrapped/generated/wrappedicuuc74types.h deleted file mode 100644 index 4998e10..0000000 --- a/src/wrapped/generated/wrappedicuuc74types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc74TYPES_H_ -#define __wrappedicuuc74TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedicuuc74TYPES_H_ diff --git a/src/wrapped/generated/wrappedicuuc74undefs.h b/src/wrapped/generated/wrappedicuuc74undefs.h deleted file mode 100644 index 43d685d..0000000 --- a/src/wrapped/generated/wrappedicuuc74undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedicuuc74UNDEFS_H_ -#define __wrappedicuuc74UNDEFS_H_ - - -#endif // __wrappedicuuc74UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedidn2defs.h b/src/wrapped/generated/wrappedidn2defs.h deleted file mode 100644 index 4177a4a..0000000 --- a/src/wrapped/generated/wrappedidn2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedidn2DEFS_H_ -#define __wrappedidn2DEFS_H_ - - -#endif // __wrappedidn2DEFS_H_ diff --git a/src/wrapped/generated/wrappedidn2types.h b/src/wrapped/generated/wrappedidn2types.h deleted file mode 100644 index e67e4de..0000000 --- a/src/wrapped/generated/wrappedidn2types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedidn2TYPES_H_ -#define __wrappedidn2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedidn2TYPES_H_ diff --git a/src/wrapped/generated/wrappedidn2undefs.h b/src/wrapped/generated/wrappedidn2undefs.h deleted file mode 100644 index 77a2eb8..0000000 --- a/src/wrapped/generated/wrappedidn2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedidn2UNDEFS_H_ -#define __wrappedidn2UNDEFS_H_ - - -#endif // __wrappedidn2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedkrb5defs.h b/src/wrapped/generated/wrappedkrb5defs.h deleted file mode 100644 index 1480b7a..0000000 --- a/src/wrapped/generated/wrappedkrb5defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedkrb5DEFS_H_ -#define __wrappedkrb5DEFS_H_ - - -#endif // __wrappedkrb5DEFS_H_ diff --git a/src/wrapped/generated/wrappedkrb5types.h b/src/wrapped/generated/wrappedkrb5types.h deleted file mode 100644 index 5e8fb37..0000000 --- a/src/wrapped/generated/wrappedkrb5types.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedkrb5TYPES_H_ -#define __wrappedkrb5TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFppppppipp_t)(void*, void*, void*, void*, void*, void*, int32_t, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(krb5_get_init_creds_password, iFppppppipp_t) - -#endif // __wrappedkrb5TYPES_H_ diff --git a/src/wrapped/generated/wrappedkrb5undefs.h b/src/wrapped/generated/wrappedkrb5undefs.h deleted file mode 100644 index 555d016..0000000 --- a/src/wrapped/generated/wrappedkrb5undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedkrb5UNDEFS_H_ -#define __wrappedkrb5UNDEFS_H_ - - -#endif // __wrappedkrb5UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlberdefs.h b/src/wrapped/generated/wrappedlberdefs.h deleted file mode 100644 index c82f057..0000000 --- a/src/wrapped/generated/wrappedlberdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlberDEFS_H_ -#define __wrappedlberDEFS_H_ - - -#endif // __wrappedlberDEFS_H_ diff --git a/src/wrapped/generated/wrappedlbertypes.h b/src/wrapped/generated/wrappedlbertypes.h deleted file mode 100644 index 4e0ffd6..0000000 --- a/src/wrapped/generated/wrappedlbertypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlberTYPES_H_ -#define __wrappedlberTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFppip_t)(void*, void*, int32_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(ber_sockbuf_add_io, iFppip_t) - -#endif // __wrappedlberTYPES_H_ diff --git a/src/wrapped/generated/wrappedlberundefs.h b/src/wrapped/generated/wrappedlberundefs.h deleted file mode 100644 index 02a61ea..0000000 --- a/src/wrapped/generated/wrappedlberundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlberUNDEFS_H_ -#define __wrappedlberUNDEFS_H_ - - -#endif // __wrappedlberUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlcms2defs.h b/src/wrapped/generated/wrappedlcms2defs.h deleted file mode 100644 index 01abe07..0000000 --- a/src/wrapped/generated/wrappedlcms2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlcms2DEFS_H_ -#define __wrappedlcms2DEFS_H_ - - -#endif // __wrappedlcms2DEFS_H_ diff --git a/src/wrapped/generated/wrappedlcms2types.h b/src/wrapped/generated/wrappedlcms2types.h deleted file mode 100644 index 9fdd10b..0000000 --- a/src/wrapped/generated/wrappedlcms2types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlcms2TYPES_H_ -#define __wrappedlcms2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlcms2TYPES_H_ diff --git a/src/wrapped/generated/wrappedlcms2undefs.h b/src/wrapped/generated/wrappedlcms2undefs.h deleted file mode 100644 index 890088f..0000000 --- a/src/wrapped/generated/wrappedlcms2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlcms2UNDEFS_H_ -#define __wrappedlcms2UNDEFS_H_ - - -#endif // __wrappedlcms2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedldaprdefs.h b/src/wrapped/generated/wrappedldaprdefs.h deleted file mode 100644 index 0b42b5c..0000000 --- a/src/wrapped/generated/wrappedldaprdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedldaprDEFS_H_ -#define __wrappedldaprDEFS_H_ - - -#endif // __wrappedldaprDEFS_H_ diff --git a/src/wrapped/generated/wrappedldaprtypes.h b/src/wrapped/generated/wrappedldaprtypes.h deleted file mode 100644 index 8cb0a7c..0000000 --- a/src/wrapped/generated/wrappedldaprtypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedldaprTYPES_H_ -#define __wrappedldaprTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFpppppupp_t)(void*, void*, void*, void*, void*, uint32_t, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(ldap_sasl_interactive_bind_s, iFpppppupp_t) - -#endif // __wrappedldaprTYPES_H_ diff --git a/src/wrapped/generated/wrappedldaprundefs.h b/src/wrapped/generated/wrappedldaprundefs.h deleted file mode 100644 index 1c09ce3..0000000 --- a/src/wrapped/generated/wrappedldaprundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedldaprUNDEFS_H_ -#define __wrappedldaprUNDEFS_H_ - - -#endif // __wrappedldaprUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedldlinuxdefs.h b/src/wrapped/generated/wrappedldlinuxdefs.h deleted file mode 100644 index d7bf282..0000000 --- a/src/wrapped/generated/wrappedldlinuxdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedldlinuxDEFS_H_ -#define __wrappedldlinuxDEFS_H_ - - -#endif // __wrappedldlinuxDEFS_H_ diff --git a/src/wrapped/generated/wrappedldlinuxtypes.h b/src/wrapped/generated/wrappedldlinuxtypes.h deleted file mode 100644 index cd8e909..0000000 --- a/src/wrapped/generated/wrappedldlinuxtypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedldlinuxTYPES_H_ -#define __wrappedldlinuxTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(__tls_get_addr, pFp_t) - -#endif // __wrappedldlinuxTYPES_H_ diff --git a/src/wrapped/generated/wrappedldlinuxundefs.h b/src/wrapped/generated/wrappedldlinuxundefs.h deleted file mode 100644 index 2d70d2a..0000000 --- a/src/wrapped/generated/wrappedldlinuxundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedldlinuxUNDEFS_H_ -#define __wrappedldlinuxUNDEFS_H_ - - -#endif // __wrappedldlinuxUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibasounddefs.h b/src/wrapped/generated/wrappedlibasounddefs.h deleted file mode 100644 index 0c3d0af..0000000 --- a/src/wrapped/generated/wrappedlibasounddefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibasoundDEFS_H_ -#define __wrappedlibasoundDEFS_H_ - - -#endif // __wrappedlibasoundDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibasoundtypes.h b/src/wrapped/generated/wrappedlibasoundtypes.h deleted file mode 100644 index cbea784..0000000 --- a/src/wrapped/generated/wrappedlibasoundtypes.h +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibasoundTYPES_H_ -#define __wrappedlibasoundTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef void* (*pFppp_t)(void*, void*, void*); -typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); -typedef void* (*pFpipL_t)(void*, int32_t, void*, uintptr_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(snd_dlclose, iFp_t) \ - GO(snd_lib_error_set_handler, iFp_t) \ - GO(snd_mixer_elem_set_callback, vFpp_t) \ - GO(snd_dlsym, pFppp_t) \ - GO(snd_async_add_handler, iFpipp_t) \ - GO(snd_async_add_pcm_handler, iFpppp_t) \ - GO(snd_dlopen, pFpipL_t) - -#endif // __wrappedlibasoundTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibasoundundefs.h b/src/wrapped/generated/wrappedlibasoundundefs.h deleted file mode 100644 index b43a3e1..0000000 --- a/src/wrapped/generated/wrappedlibasoundundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibasoundUNDEFS_H_ -#define __wrappedlibasoundUNDEFS_H_ - - -#endif // __wrappedlibasoundUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibbsddefs.h b/src/wrapped/generated/wrappedlibbsddefs.h deleted file mode 100644 index 6104bfc..0000000 --- a/src/wrapped/generated/wrappedlibbsddefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibbsdDEFS_H_ -#define __wrappedlibbsdDEFS_H_ - - -#endif // __wrappedlibbsdDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibbsdtypes.h b/src/wrapped/generated/wrappedlibbsdtypes.h deleted file mode 100644 index b007845..0000000 --- a/src/wrapped/generated/wrappedlibbsdtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibbsdTYPES_H_ -#define __wrappedlibbsdTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibbsdTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibbsdundefs.h b/src/wrapped/generated/wrappedlibbsdundefs.h deleted file mode 100644 index 6f22a93..0000000 --- a/src/wrapped/generated/wrappedlibbsdundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibbsdUNDEFS_H_ -#define __wrappedlibbsdUNDEFS_H_ - - -#endif // __wrappedlibbsdUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibcdefs.h b/src/wrapped/generated/wrappedlibcdefs.h deleted file mode 100644 index 9b1434a..0000000 --- a/src/wrapped/generated/wrappedlibcdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibcDEFS_H_ -#define __wrappedlibcDEFS_H_ - - -#endif // __wrappedlibcDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibcmusldefs.h b/src/wrapped/generated/wrappedlibcmusldefs.h deleted file mode 100644 index 4469968..0000000 --- a/src/wrapped/generated/wrappedlibcmusldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibcmuslDEFS_H_ -#define __wrappedlibcmuslDEFS_H_ - - -#endif // __wrappedlibcmuslDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibcmusltypes.h b/src/wrapped/generated/wrappedlibcmusltypes.h deleted file mode 100644 index dc4ac24..0000000 --- a/src/wrapped/generated/wrappedlibcmusltypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibcmuslTYPES_H_ -#define __wrappedlibcmuslTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibcmuslTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibcmuslundefs.h b/src/wrapped/generated/wrappedlibcmuslundefs.h deleted file mode 100644 index 71ff2c0..0000000 --- a/src/wrapped/generated/wrappedlibcmuslundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibcmuslUNDEFS_H_ -#define __wrappedlibcmuslUNDEFS_H_ - - -#endif // __wrappedlibcmuslUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibcryptdefs.h b/src/wrapped/generated/wrappedlibcryptdefs.h deleted file mode 100644 index fc002b3..0000000 --- a/src/wrapped/generated/wrappedlibcryptdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibcryptDEFS_H_ -#define __wrappedlibcryptDEFS_H_ - - -#endif // __wrappedlibcryptDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibcrypttypes.h b/src/wrapped/generated/wrappedlibcrypttypes.h deleted file mode 100644 index 4104714..0000000 --- a/src/wrapped/generated/wrappedlibcrypttypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibcryptTYPES_H_ -#define __wrappedlibcryptTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibcryptTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibcryptundefs.h b/src/wrapped/generated/wrappedlibcryptundefs.h deleted file mode 100644 index 4f5de63..0000000 --- a/src/wrapped/generated/wrappedlibcryptundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibcryptUNDEFS_H_ -#define __wrappedlibcryptUNDEFS_H_ - - -#endif // __wrappedlibcryptUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibctypes.h b/src/wrapped/generated/wrappedlibctypes.h deleted file mode 100644 index a9b5dbb..0000000 --- a/src/wrapped/generated/wrappedlibctypes.h +++ /dev/null @@ -1,302 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibcTYPES_H_ -#define __wrappedlibcTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFv_t)(void); -typedef void (*vFi_t)(int32_t); -typedef void (*vFp_t)(void*); -typedef int32_t (*iFv_t)(void); -typedef int32_t (*iFi_t)(int32_t); -typedef int32_t (*iFp_t)(void*); -typedef int64_t (*IFi_t)(int32_t); -typedef intptr_t (*lFv_t)(void); -typedef intptr_t (*lFi_t)(int32_t); -typedef uintptr_t (*LFL_t)(uintptr_t); -typedef void* (*pFp_t)(void*); -typedef void (*vFpi_t)(void*, int32_t); -typedef void (*vFpu_t)(void*, uint32_t); -typedef void (*vFpp_t)(void*, void*); -typedef void (*vFpV_t)(void*, ...); -typedef int32_t (*iFip_t)(int32_t, void*); -typedef int32_t (*iFup_t)(uint32_t, void*); -typedef int32_t (*iFpi_t)(void*, int32_t); -typedef int32_t (*iFpL_t)(void*, uintptr_t); -typedef int32_t (*iFpp_t)(void*, void*); -typedef int32_t (*iFpV_t)(void*, ...); -typedef int32_t (*iFpA_t)(void*, va_list); -typedef int32_t (*iFSp_t)(void*, void*); -typedef void* (*pFip_t)(int32_t, void*); -typedef void* (*pFpi_t)(void*, int32_t); -typedef void* (*pFpp_t)(void*, void*); -typedef void (*vFipV_t)(int32_t, void*, ...); -typedef void (*vFipA_t)(int32_t, void*, va_list); -typedef void (*vFpii_t)(void*, int32_t, int32_t); -typedef void (*vFpup_t)(void*, uint32_t, void*); -typedef int32_t (*iFiip_t)(int32_t, int32_t, void*); -typedef int32_t (*iFiiN_t)(int32_t, int32_t, ...); -typedef int32_t (*iFipp_t)(int32_t, void*, void*); -typedef int32_t (*iFipV_t)(int32_t, void*, ...); -typedef int32_t (*iFipA_t)(int32_t, void*, va_list); -typedef int32_t (*iFpLi_t)(void*, uintptr_t, int32_t); -typedef int32_t (*iFppi_t)(void*, void*, int32_t); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef int32_t (*iFppV_t)(void*, void*, ...); -typedef int32_t (*iFppA_t)(void*, void*, va_list); -typedef int32_t (*iFpOu_t)(void*, int32_t, uint32_t); -typedef intptr_t (*lFipV_t)(int32_t, void*, ...); -typedef intptr_t (*lFppL_t)(void*, void*, uintptr_t); -typedef uintptr_t (*LFppL_t)(void*, void*, uintptr_t); -typedef void* (*pFpip_t)(void*, int32_t, void*); -typedef void* (*pFppp_t)(void*, void*, void*); -typedef void* (*pFppV_t)(void*, void*, ...); -typedef void (*vFiipV_t)(int32_t, int32_t, void*, ...); -typedef void (*vFiipA_t)(int32_t, int32_t, void*, va_list); -typedef void (*vFpLLp_t)(void*, uintptr_t, uintptr_t, void*); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFiiip_t)(int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFiiiN_t)(int32_t, int32_t, int32_t, ...); -typedef int32_t (*iFiipV_t)(int32_t, int32_t, void*, ...); -typedef int32_t (*iFiipA_t)(int32_t, int32_t, void*, va_list); -typedef int32_t (*iFipii_t)(int32_t, void*, int32_t, int32_t); -typedef int32_t (*iFipup_t)(int32_t, void*, uint32_t, void*); -typedef int32_t (*iFippi_t)(int32_t, void*, void*, int32_t); -typedef int32_t (*iFippL_t)(int32_t, void*, void*, uintptr_t); -typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*); -typedef int32_t (*iFpipV_t)(void*, int32_t, void*, ...); -typedef int32_t (*iFpipA_t)(void*, int32_t, void*, va_list); -typedef int32_t (*iFpLpV_t)(void*, uintptr_t, void*, ...); -typedef int32_t (*iFpLpA_t)(void*, uintptr_t, void*, va_list); -typedef int32_t (*iFppii_t)(void*, void*, int32_t, int32_t); -typedef int32_t (*iFppiV_t)(void*, void*, int32_t, ...); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); -typedef intptr_t (*lFuipp_t)(uint32_t, int32_t, void*, void*); -typedef void (*vFpLLpp_t)(void*, uintptr_t, uintptr_t, void*, void*); -typedef int32_t (*iFiipup_t)(int32_t, int32_t, void*, uint32_t, void*); -typedef int32_t (*iFiippi_t)(int32_t, int32_t, void*, void*, int32_t); -typedef int32_t (*iFiLLLL_t)(int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef int32_t (*iFipiip_t)(int32_t, void*, int32_t, int32_t, void*); -typedef int32_t (*iFipppp_t)(int32_t, void*, void*, void*, void*); -typedef int32_t (*iFpilpV_t)(void*, int32_t, intptr_t, void*, ...); -typedef int32_t (*iFpuppp_t)(void*, uint32_t, void*, void*, void*); -typedef int32_t (*iFpLLpp_t)(void*, uintptr_t, uintptr_t, void*, void*); -typedef void* (*pFpLLiN_t)(void*, uintptr_t, uintptr_t, int32_t, ...); -typedef void* (*pFppLLp_t)(void*, void*, uintptr_t, uintptr_t, void*); -typedef void* (*pFpppLp_t)(void*, void*, void*, uintptr_t, void*); -typedef int32_t (*iFpLiLpp_t)(void*, uintptr_t, int32_t, uintptr_t, void*, void*); -typedef int32_t (*iFpLiLpV_t)(void*, uintptr_t, int32_t, uintptr_t, void*, ...); -typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*); -typedef void* (*pFpLiiil_t)(void*, uintptr_t, int32_t, int32_t, int32_t, intptr_t); -typedef int32_t (*iFpippppp_t)(void*, int32_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(_Jv_RegisterClasses, vFv_t) \ - GO(__cxa_pure_virtual, vFv_t) \ - GO(__stack_chk_fail, vFv_t) \ - GO(exit, vFi_t) \ - GO(_ITM_deregisterTMCloneTable, vFp_t) \ - GO(__cxa_finalize, vFp_t) \ - GO(fork, iFv_t) \ - GO(vfork, iFv_t) \ - GO(iopl, iFi_t) \ - GO(_setjmp, iFp_t) \ - GO(atexit, iFp_t) \ - GO(getcontext, iFp_t) \ - GO(register_printf_type, iFp_t) \ - GO(setcontext, iFp_t) \ - GO(setjmp, iFp_t) \ - GO(stime, iFp_t) \ - GO(uname, iFp_t) \ - GO(sysconf, IFi_t) \ - GO(syscall, lFv_t) \ - GO(__sysconf, lFi_t) \ - GO(getauxval, LFL_t) \ - GO(__deregister_frame_info, pFp_t) \ - GO(mallinfo, pFp_t) \ - GO(__longjmp_chk, vFpi_t) \ - GO(_longjmp, vFpi_t) \ - GO(_obstack_newchunk, vFpi_t) \ - GO(longjmp, vFpi_t) \ - GO(siglongjmp, vFpi_t) \ - GO(_ITM_registerTMCloneTable, vFpu_t) \ - GO(__register_frame_info, vFpp_t) \ - GO(_obstack_free, vFpp_t) \ - GO(obstack_free, vFpp_t) \ - GO(tdestroy, vFpp_t) \ - GO(twalk, vFpp_t) \ - GO(warn, vFpV_t) \ - GO(warnx, vFpV_t) \ - GO(fstat, iFip_t) \ - GO(fstat64, iFip_t) \ - GO(setrlimit, iFup_t) \ - GO(__sigsetjmp, iFpi_t) \ - GO(backtrace, iFpi_t) \ - GO(sigsetjmp, iFpi_t) \ - GO(munmap, iFpL_t) \ - GO(__vprintf_chk, iFpp_t) \ - GO(dl_iterate_phdr, iFpp_t) \ - GO(execv, iFpp_t) \ - GO(execvp, iFpp_t) \ - GO(lstat, iFpp_t) \ - GO(lstat64, iFpp_t) \ - GO(sigaltstack, iFpp_t) \ - GO(stat, iFpp_t) \ - GO(stat64, iFpp_t) \ - GO(swapcontext, iFpp_t) \ - GO(__isoc99_scanf, iFpV_t) \ - GO(execl, iFpV_t) \ - GO(execle, iFpV_t) \ - GO(execlp, iFpV_t) \ - GO(printf, iFpV_t) \ - GO(wprintf, iFpV_t) \ - GO(__isoc99_vscanf, iFpA_t) \ - GO(vprintf, iFpA_t) \ - GO(vscanf, iFpA_t) \ - GO(vwprintf, iFpA_t) \ - GO(_IO_file_stat, iFSp_t) \ - GO(__sysv_signal, pFip_t) \ - GO(bsd_signal, pFip_t) \ - GO(signal, pFip_t) \ - GO(sigset, pFip_t) \ - GO(sysv_signal, pFip_t) \ - GO(backtrace_symbols, pFpi_t) \ - GO(__realpath_chk, pFpp_t) \ - GO(fopen, pFpp_t) \ - GO(fopen64, pFpp_t) \ - GO(realpath, pFpp_t) \ - GO(err, vFipV_t) \ - GO(errx, vFipV_t) \ - GO(syslog, vFipV_t) \ - GO(vsyslog, vFipA_t) \ - GO(backtrace_symbols_fd, vFpii_t) \ - GO(_ITM_addUserCommitAction, vFpup_t) \ - GO(__fxstat, iFiip_t) \ - GO(__fxstat64, iFiip_t) \ - GO(__fcntl, iFiiN_t) \ - GO(fcntl, iFiiN_t) \ - GO(fcntl64, iFiiN_t) \ - GO(__lxstat, iFipp_t) \ - GO(__lxstat64, iFipp_t) \ - GO(__sigaction, iFipp_t) \ - GO(__xstat, iFipp_t) \ - GO(__xstat64, iFipp_t) \ - GO(getopt, iFipp_t) \ - GO(register_printf_specifier, iFipp_t) \ - GO(sigaction, iFipp_t) \ - GO(__printf_chk, iFipV_t) \ - GO(dprintf, iFipV_t) \ - GO(vdprintf, iFipA_t) \ - GO(mprotect, iFpLi_t) \ - GO(ftw, iFppi_t) \ - GO(ftw64, iFppi_t) \ - GO(__cxa_atexit, iFppp_t) \ - GO(__cxa_thread_atexit_impl, iFppp_t) \ - GO(__vfprintf_chk, iFppp_t) \ - GO(__vsscanf, iFppp_t) \ - GO(execve, iFppp_t) \ - GO(__asprintf, iFppV_t) \ - GO(__isoc23_fscanf, iFppV_t) \ - GO(__isoc23_sscanf, iFppV_t) \ - GO(__isoc99_fscanf, iFppV_t) \ - GO(__isoc99_sscanf, iFppV_t) \ - GO(__isoc99_swscanf, iFppV_t) \ - GO(asprintf, iFppV_t) \ - GO(fprintf, iFppV_t) \ - GO(fscanf, iFppV_t) \ - GO(fwprintf, iFppV_t) \ - GO(sprintf, iFppV_t) \ - GO(sscanf, iFppV_t) \ - GO(swscanf, iFppV_t) \ - GO(__isoc99_vfscanf, iFppA_t) \ - GO(__isoc99_vsscanf, iFppA_t) \ - GO(__isoc99_vswscanf, iFppA_t) \ - GO(obstack_vprintf, iFppA_t) \ - GO(vasprintf, iFppA_t) \ - GO(vfprintf, iFppA_t) \ - GO(vfscanf, iFppA_t) \ - GO(vfwprintf, iFppA_t) \ - GO(vsprintf, iFppA_t) \ - GO(vsscanf, iFppA_t) \ - GO(vswscanf, iFppA_t) \ - GO(__open, iFpOu_t) \ - GO(open, iFpOu_t) \ - GO(open64, iFpOu_t) \ - GO(__wprintf_chk, lFipV_t) \ - GO(readlink, lFppL_t) \ - GO(strlcat, LFppL_t) \ - GO(strlcpy, LFppL_t) \ - GO(fts64_open, pFpip_t) \ - GO(fts_open, pFpip_t) \ - GO(tdelete, pFppp_t) \ - GO(tfind, pFppp_t) \ - GO(tsearch, pFppp_t) \ - GO(fopencookie, pFppV_t) \ - GO(__syslog_chk, vFiipV_t) \ - GO(__vsyslog_chk, vFiipA_t) \ - GO(qsort, vFpLLp_t) \ - GO(__libc_init, vFpppp_t) \ - GO(epoll_ctl, iFiiip_t) \ - GO(semctl, iFiiiN_t) \ - GO(__dprintf_chk, iFiipV_t) \ - GO(__vdprintf_chk, iFiipA_t) \ - GO(epoll_wait, iFipii_t) \ - GO(__xmknod, iFipup_t) \ - GO(fstatat, iFippi_t) \ - GO(fstatat64, iFippi_t) \ - GO(readlinkat, iFippL_t) \ - GO(__vasprintf_chk, iFpipp_t) \ - GO(glob, iFpipp_t) \ - GO(glob64, iFpipp_t) \ - GO(__asprintf_chk, iFpipV_t) \ - GO(__fprintf_chk, iFpipV_t) \ - GO(__fwprintf_chk, iFpipV_t) \ - GO(__vfwprintf_chk, iFpipA_t) \ - GO(__snprintf, iFpLpV_t) \ - GO(snprintf, iFpLpV_t) \ - GO(swprintf, iFpLpV_t) \ - GO(__vsnprintf, iFpLpA_t) \ - GO(vsnprintf, iFpLpA_t) \ - GO(vswprintf, iFpLpA_t) \ - GO(nftw64, iFppii_t) \ - GO(makecontext, iFppiV_t) \ - GO(__register_atfork, iFpppp_t) \ - GO(__vsprintf_chk, iFpppp_t) \ - GO(scandir, iFpppp_t) \ - GO(scandir64, iFpppp_t) \ - GO(ptrace, lFuipp_t) \ - GO(qsort_r, vFpLLpp_t) \ - GO(__xmknodat, iFiipup_t) \ - GO(__fxstatat, iFiippi_t) \ - GO(__fxstatat64, iFiippi_t) \ - GO(prctl, iFiLLLL_t) \ - GO(epoll_pwait, iFipiip_t) \ - GO(getopt_long, iFipppp_t) \ - GO(getopt_long_only, iFipppp_t) \ - GO(scandirat, iFipppp_t) \ - GO(__sprintf_chk, iFpilpV_t) \ - GO(__vswprintf_chk, iFpuppp_t) \ - GO(_obstack_begin, iFpLLpp_t) \ - GO(mremap, pFpLLiN_t) \ - GO(bsearch, pFppLLp_t) \ - GO(lfind, pFpppLp_t) \ - GO(lsearch, pFpppLp_t) \ - GO(__vsnprintf_chk, iFpLiLpp_t) \ - GO(__snprintf_chk, iFpLiLpV_t) \ - GO(__swprintf_chk, iFpLiLpV_t) \ - GO(posix_spawn, iFpppppp_t) \ - GO(posix_spawnp, iFpppppp_t) \ - GO(mmap, pFpLiiil_t) \ - GO(mmap64, pFpLiiil_t) \ - GO(__libc_start_main, iFpippppp_t) \ - GO(clone, iFppipppp_t) - -#endif // __wrappedlibcTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibcundefs.h b/src/wrapped/generated/wrappedlibcundefs.h deleted file mode 100644 index 9fef326..0000000 --- a/src/wrapped/generated/wrappedlibcundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibcUNDEFS_H_ -#define __wrappedlibcUNDEFS_H_ - - -#endif // __wrappedlibcUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibcupsdefs.h b/src/wrapped/generated/wrappedlibcupsdefs.h deleted file mode 100644 index 3401915..0000000 --- a/src/wrapped/generated/wrappedlibcupsdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibcupsDEFS_H_ -#define __wrappedlibcupsDEFS_H_ - - -#endif // __wrappedlibcupsDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibcupstypes.h b/src/wrapped/generated/wrappedlibcupstypes.h deleted file mode 100644 index f17b8fc..0000000 --- a/src/wrapped/generated/wrappedlibcupstypes.h +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibcupsTYPES_H_ -#define __wrappedlibcupsTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpp_t)(void*, void*); -typedef int32_t (*iFuipuupp_t)(uint32_t, int32_t, void*, uint32_t, uint32_t, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(cupsSetPasswordCB2, vFpp_t) \ - GO(cupsEnumDests, iFuipuupp_t) - -#endif // __wrappedlibcupsTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibcupsundefs.h b/src/wrapped/generated/wrappedlibcupsundefs.h deleted file mode 100644 index be8baf8..0000000 --- a/src/wrapped/generated/wrappedlibcupsundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibcupsUNDEFS_H_ -#define __wrappedlibcupsUNDEFS_H_ - - -#endif // __wrappedlibcupsUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibdldefs.h b/src/wrapped/generated/wrappedlibdldefs.h deleted file mode 100644 index 75844c4..0000000 --- a/src/wrapped/generated/wrappedlibdldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibdlDEFS_H_ -#define __wrappedlibdlDEFS_H_ - - -#endif // __wrappedlibdlDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibdltypes.h b/src/wrapped/generated/wrappedlibdltypes.h deleted file mode 100644 index a2535e0..0000000 --- a/src/wrapped/generated/wrappedlibdltypes.h +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibdlTYPES_H_ -#define __wrappedlibdlTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFp_t)(void*); -typedef void* (*pFv_t)(void); -typedef int32_t (*iFpp_t)(void*, void*); -typedef void* (*pFpi_t)(void*, int32_t); -typedef void* (*pFpp_t)(void*, void*); -typedef int32_t (*iFpip_t)(void*, int32_t, void*); -typedef void* (*pFppi_t)(void*, void*, int32_t); -typedef void* (*pFppp_t)(void*, void*, void*); -typedef int32_t (*iFpppi_t)(void*, void*, void*, int32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(dlclose, iFp_t) \ - GO(dlerror, pFv_t) \ - GO(_dl_find_object, iFpp_t) \ - GO(dladdr, iFpp_t) \ - GO(dlopen, pFpi_t) \ - GO(dlsym, pFpp_t) \ - GO(dlinfo, iFpip_t) \ - GO(dlmopen, pFppi_t) \ - GO(dlvsym, pFppp_t) \ - GO(dladdr1, iFpppi_t) - -#endif // __wrappedlibdlTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibdlundefs.h b/src/wrapped/generated/wrappedlibdlundefs.h deleted file mode 100644 index f09b463..0000000 --- a/src/wrapped/generated/wrappedlibdlundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibdlUNDEFS_H_ -#define __wrappedlibdlUNDEFS_H_ - - -#endif // __wrappedlibdlUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibdrmdefs.h b/src/wrapped/generated/wrappedlibdrmdefs.h deleted file mode 100644 index a94ebd0..0000000 --- a/src/wrapped/generated/wrappedlibdrmdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibdrmDEFS_H_ -#define __wrappedlibdrmDEFS_H_ - - -#endif // __wrappedlibdrmDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibdrmtypes.h b/src/wrapped/generated/wrappedlibdrmtypes.h deleted file mode 100644 index 8c583cb..0000000 --- a/src/wrapped/generated/wrappedlibdrmtypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibdrmTYPES_H_ -#define __wrappedlibdrmTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpV_t)(void*, ...); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(drmMsg, vFpV_t) - -#endif // __wrappedlibdrmTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibdrmundefs.h b/src/wrapped/generated/wrappedlibdrmundefs.h deleted file mode 100644 index b52bd36..0000000 --- a/src/wrapped/generated/wrappedlibdrmundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibdrmUNDEFS_H_ -#define __wrappedlibdrmUNDEFS_H_ - - -#endif // __wrappedlibdrmUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibegldefs.h b/src/wrapped/generated/wrappedlibegldefs.h deleted file mode 100644 index f52e5d2..0000000 --- a/src/wrapped/generated/wrappedlibegldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibeglDEFS_H_ -#define __wrappedlibeglDEFS_H_ - - -#endif // __wrappedlibeglDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibegltypes.h b/src/wrapped/generated/wrappedlibegltypes.h deleted file mode 100644 index 9488b9b..0000000 --- a/src/wrapped/generated/wrappedlibegltypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibeglTYPES_H_ -#define __wrappedlibeglTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(eglGetProcAddress, pFp_t) - -#endif // __wrappedlibeglTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibeglundefs.h b/src/wrapped/generated/wrappedlibeglundefs.h deleted file mode 100644 index 7364e25..0000000 --- a/src/wrapped/generated/wrappedlibeglundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibeglUNDEFS_H_ -#define __wrappedlibeglUNDEFS_H_ - - -#endif // __wrappedlibeglUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibformdefs.h b/src/wrapped/generated/wrappedlibformdefs.h deleted file mode 100644 index 30a2e52..0000000 --- a/src/wrapped/generated/wrappedlibformdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibformDEFS_H_ -#define __wrappedlibformDEFS_H_ - - -#endif // __wrappedlibformDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibformtypes.h b/src/wrapped/generated/wrappedlibformtypes.h deleted file mode 100644 index 2718dd4..0000000 --- a/src/wrapped/generated/wrappedlibformtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibformTYPES_H_ -#define __wrappedlibformTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibformTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibformundefs.h b/src/wrapped/generated/wrappedlibformundefs.h deleted file mode 100644 index 3c54fd7..0000000 --- a/src/wrapped/generated/wrappedlibformundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibformUNDEFS_H_ -#define __wrappedlibformUNDEFS_H_ - - -#endif // __wrappedlibformUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibformw6defs.h b/src/wrapped/generated/wrappedlibformw6defs.h deleted file mode 100644 index 1458ae4..0000000 --- a/src/wrapped/generated/wrappedlibformw6defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibformw6DEFS_H_ -#define __wrappedlibformw6DEFS_H_ - - -#endif // __wrappedlibformw6DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibformw6types.h b/src/wrapped/generated/wrappedlibformw6types.h deleted file mode 100644 index 682d248..0000000 --- a/src/wrapped/generated/wrappedlibformw6types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibformw6TYPES_H_ -#define __wrappedlibformw6TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibformw6TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibformw6undefs.h b/src/wrapped/generated/wrappedlibformw6undefs.h deleted file mode 100644 index 4866960..0000000 --- a/src/wrapped/generated/wrappedlibformw6undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibformw6UNDEFS_H_ -#define __wrappedlibformw6UNDEFS_H_ - - -#endif // __wrappedlibformw6UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibformwdefs.h b/src/wrapped/generated/wrappedlibformwdefs.h deleted file mode 100644 index 55a007b..0000000 --- a/src/wrapped/generated/wrappedlibformwdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibformwDEFS_H_ -#define __wrappedlibformwDEFS_H_ - - -#endif // __wrappedlibformwDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibformwtypes.h b/src/wrapped/generated/wrappedlibformwtypes.h deleted file mode 100644 index 19d8d75..0000000 --- a/src/wrapped/generated/wrappedlibformwtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibformwTYPES_H_ -#define __wrappedlibformwTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibformwTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibformwundefs.h b/src/wrapped/generated/wrappedlibformwundefs.h deleted file mode 100644 index 35926a4..0000000 --- a/src/wrapped/generated/wrappedlibformwundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibformwUNDEFS_H_ -#define __wrappedlibformwUNDEFS_H_ - - -#endif // __wrappedlibformwUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibfusedefs.h b/src/wrapped/generated/wrappedlibfusedefs.h deleted file mode 100644 index d42e7a2..0000000 --- a/src/wrapped/generated/wrappedlibfusedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibfuseDEFS_H_ -#define __wrappedlibfuseDEFS_H_ - - -#endif // __wrappedlibfuseDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibfusetypes.h b/src/wrapped/generated/wrappedlibfusetypes.h deleted file mode 100644 index 342a308..0000000 --- a/src/wrapped/generated/wrappedlibfusetypes.h +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibfuseTYPES_H_ -#define __wrappedlibfuseTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFpp_t)(void*, void*); -typedef int32_t (*iFppd_t)(void*, void*, double); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); -typedef void* (*pFppLp_t)(void*, void*, uintptr_t, void*); -typedef int32_t (*iFippLp_t)(int32_t, void*, void*, uintptr_t, void*); -typedef uintptr_t (*LFppLppU_t)(void*, void*, uintptr_t, void*, void*, uint64_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(fuse_reply_entry, iFpp_t) \ - GO(fuse_reply_attr, iFppd_t) \ - GO(fuse_reply_create, iFppp_t) \ - GO(fuse_opt_parse, iFpppp_t) \ - GO(fuse_lowlevel_new, pFppLp_t) \ - GO(fuse_main_real, iFippLp_t) \ - GO(fuse_add_direntry, LFppLppU_t) - -#endif // __wrappedlibfuseTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibfuseundefs.h b/src/wrapped/generated/wrappedlibfuseundefs.h deleted file mode 100644 index 4f19489..0000000 --- a/src/wrapped/generated/wrappedlibfuseundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibfuseUNDEFS_H_ -#define __wrappedlibfuseUNDEFS_H_ - - -#endif // __wrappedlibfuseUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibgldefs.h b/src/wrapped/generated/wrappedlibgldefs.h deleted file mode 100644 index 4caba6d..0000000 --- a/src/wrapped/generated/wrappedlibgldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibglDEFS_H_ -#define __wrappedlibglDEFS_H_ - - -#endif // __wrappedlibglDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibgltypes.h b/src/wrapped/generated/wrappedlibgltypes.h deleted file mode 100644 index e9d4845..0000000 --- a/src/wrapped/generated/wrappedlibgltypes.h +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibglTYPES_H_ -#define __wrappedlibglTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFi_t)(int32_t); -typedef void* (*pFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef int32_t (*iFpp_t)(void*, void*); -typedef void (*vFipp_t)(int32_t, void*, void*); -typedef void (*vFppi_t)(void*, void*, int32_t); -typedef void (*vFppp_t)(void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(glXSwapIntervalMESA, iFi_t) \ - GO(glGetVkProcAddrNV, pFp_t) \ - GO(glXGetProcAddress, pFp_t) \ - GO(glXGetProcAddressARB, pFp_t) \ - GO(glDebugMessageCallback, vFpp_t) \ - GO(glDebugMessageCallbackAMD, vFpp_t) \ - GO(glDebugMessageCallbackARB, vFpp_t) \ - GO(glDebugMessageCallbackKHR, vFpp_t) \ - GO(eglDebugMessageControlKHR, iFpp_t) \ - GO(glProgramCallbackMESA, vFipp_t) \ - GO(glXSwapIntervalEXT, vFppi_t) \ - GO(eglSetBlobCacheFuncsANDROID, vFppp_t) - -#endif // __wrappedlibglTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibgludefs.h b/src/wrapped/generated/wrappedlibgludefs.h deleted file mode 100644 index f365ac3..0000000 --- a/src/wrapped/generated/wrappedlibgludefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibgluDEFS_H_ -#define __wrappedlibgluDEFS_H_ - - -#endif // __wrappedlibgluDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibglundefs.h b/src/wrapped/generated/wrappedlibglundefs.h deleted file mode 100644 index bca7160..0000000 --- a/src/wrapped/generated/wrappedlibglundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibglUNDEFS_H_ -#define __wrappedlibglUNDEFS_H_ - - -#endif // __wrappedlibglUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibglutypes.h b/src/wrapped/generated/wrappedlibglutypes.h deleted file mode 100644 index ec000dd..0000000 --- a/src/wrapped/generated/wrappedlibglutypes.h +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibgluTYPES_H_ -#define __wrappedlibgluTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpip_t)(void*, int32_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(gluNurbsCallback, vFpip_t) \ - GO(gluQuadricCallback, vFpip_t) \ - GO(gluTessCallback, vFpip_t) - -#endif // __wrappedlibgluTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibgluundefs.h b/src/wrapped/generated/wrappedlibgluundefs.h deleted file mode 100644 index acf3804..0000000 --- a/src/wrapped/generated/wrappedlibgluundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibgluUNDEFS_H_ -#define __wrappedlibgluUNDEFS_H_ - - -#endif // __wrappedlibgluUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibglxdefs.h b/src/wrapped/generated/wrappedlibglxdefs.h deleted file mode 100644 index 1e947e9..0000000 --- a/src/wrapped/generated/wrappedlibglxdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibglxDEFS_H_ -#define __wrappedlibglxDEFS_H_ - - -#endif // __wrappedlibglxDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibglxtypes.h b/src/wrapped/generated/wrappedlibglxtypes.h deleted file mode 100644 index bfa19ba..0000000 --- a/src/wrapped/generated/wrappedlibglxtypes.h +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibglxTYPES_H_ -#define __wrappedlibglxTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(glXGetProcAddress, pFp_t) \ - GO(glXGetProcAddressARB, pFp_t) - -#endif // __wrappedlibglxTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibglxundefs.h b/src/wrapped/generated/wrappedlibglxundefs.h deleted file mode 100644 index 3c140b5..0000000 --- a/src/wrapped/generated/wrappedlibglxundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibglxUNDEFS_H_ -#define __wrappedlibglxUNDEFS_H_ - - -#endif // __wrappedlibglxUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibharfbuzzdefs.h b/src/wrapped/generated/wrappedlibharfbuzzdefs.h deleted file mode 100644 index c463b59..0000000 --- a/src/wrapped/generated/wrappedlibharfbuzzdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibharfbuzzDEFS_H_ -#define __wrappedlibharfbuzzDEFS_H_ - - -#endif // __wrappedlibharfbuzzDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibharfbuzztypes.h b/src/wrapped/generated/wrappedlibharfbuzztypes.h deleted file mode 100644 index b6ccb20..0000000 --- a/src/wrapped/generated/wrappedlibharfbuzztypes.h +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibharfbuzzTYPES_H_ -#define __wrappedlibharfbuzzTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef void* (*pFp_t)(void*); -typedef void* (*pFpp_t)(void*, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef void* (*pFppp_t)(void*, void*, void*); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFppppi_t)(void*, void*, void*, void*, int32_t); -typedef void* (*pFpuupp_t)(void*, uint32_t, uint32_t, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(hb_draw_funcs_destroy, vFp_t) \ - GO(hb_font_funcs_destroy, vFp_t) \ - GO(hb_unicode_funcs_reference, pFp_t) \ - GO(hb_ft_face_create, pFpp_t) \ - GO(hb_font_set_funcs_data, vFppp_t) \ - GO(hb_face_create_for_tables, pFppp_t) \ - GO(hb_buffer_set_message_func, vFpppp_t) \ - GO(hb_draw_funcs_set_close_path_func, vFpppp_t) \ - GO(hb_draw_funcs_set_cubic_to_func, vFpppp_t) \ - GO(hb_draw_funcs_set_line_to_func, vFpppp_t) \ - GO(hb_draw_funcs_set_move_to_func, vFpppp_t) \ - GO(hb_draw_funcs_set_quadratic_to_func, vFpppp_t) \ - GO(hb_font_funcs_set_font_h_extents_func, vFpppp_t) \ - GO(hb_font_funcs_set_font_v_extents_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_contour_point_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_extents_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_from_name_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_h_advance_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_h_advances_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_h_kerning_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_h_origin_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_name_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_shape_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_v_advance_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_v_advances_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_v_kerning_func, vFpppp_t) \ - GO(hb_font_funcs_set_glyph_v_origin_func, vFpppp_t) \ - GO(hb_font_funcs_set_nominal_glyph_func, vFpppp_t) \ - GO(hb_font_funcs_set_nominal_glyphs_func, vFpppp_t) \ - GO(hb_font_funcs_set_variation_glyph_func, vFpppp_t) \ - GO(hb_font_set_funcs, vFpppp_t) \ - GO(hb_unicode_funcs_set_combining_class_func, vFpppp_t) \ - GO(hb_unicode_funcs_set_compose_func, vFpppp_t) \ - GO(hb_unicode_funcs_set_decompose_compatibility_func, vFpppp_t) \ - GO(hb_unicode_funcs_set_decompose_func, vFpppp_t) \ - GO(hb_unicode_funcs_set_eastasian_width_func, vFpppp_t) \ - GO(hb_unicode_funcs_set_general_category_func, vFpppp_t) \ - GO(hb_unicode_funcs_set_mirroring_func, vFpppp_t) \ - GO(hb_unicode_funcs_set_script_func, vFpppp_t) \ - GO(hb_blob_set_user_data, iFppppi_t) \ - GO(hb_buffer_set_user_data, iFppppi_t) \ - GO(hb_face_set_user_data, iFppppi_t) \ - GO(hb_font_funcs_set_user_data, iFppppi_t) \ - GO(hb_font_set_user_data, iFppppi_t) \ - GO(hb_unicode_funcs_set_user_data, iFppppi_t) \ - GO(hb_blob_create, pFpuupp_t) \ - GO(hb_blob_create_or_fail, pFpuupp_t) - -#endif // __wrappedlibharfbuzzTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibharfbuzzundefs.h b/src/wrapped/generated/wrappedlibharfbuzzundefs.h deleted file mode 100644 index 05caf5a..0000000 --- a/src/wrapped/generated/wrappedlibharfbuzzundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibharfbuzzUNDEFS_H_ -#define __wrappedlibharfbuzzUNDEFS_H_ - - -#endif // __wrappedlibharfbuzzUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibhogweed6defs.h b/src/wrapped/generated/wrappedlibhogweed6defs.h deleted file mode 100644 index 6693e71..0000000 --- a/src/wrapped/generated/wrappedlibhogweed6defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibhogweed6DEFS_H_ -#define __wrappedlibhogweed6DEFS_H_ - - -#endif // __wrappedlibhogweed6DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibhogweed6types.h b/src/wrapped/generated/wrappedlibhogweed6types.h deleted file mode 100644 index c00cc2b..0000000 --- a/src/wrapped/generated/wrappedlibhogweed6types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibhogweed6TYPES_H_ -#define __wrappedlibhogweed6TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibhogweed6TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibhogweed6undefs.h b/src/wrapped/generated/wrappedlibhogweed6undefs.h deleted file mode 100644 index d83b11c..0000000 --- a/src/wrapped/generated/wrappedlibhogweed6undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibhogweed6UNDEFS_H_ -#define __wrappedlibhogweed6UNDEFS_H_ - - -#endif // __wrappedlibhogweed6UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibibusdefs.h b/src/wrapped/generated/wrappedlibibusdefs.h deleted file mode 100644 index 353351f..0000000 --- a/src/wrapped/generated/wrappedlibibusdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibibusDEFS_H_ -#define __wrappedlibibusDEFS_H_ - - -#endif // __wrappedlibibusDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibibustypes.h b/src/wrapped/generated/wrappedlibibustypes.h deleted file mode 100644 index 23612c7..0000000 --- a/src/wrapped/generated/wrappedlibibustypes.h +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibibusTYPES_H_ -#define __wrappedlibibusTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpippp_t)(void*, int32_t, void*, void*, void*); -typedef void (*vFppippp_t)(void*, void*, int32_t, void*, void*, void*); -typedef void (*vFpppippp_t)(void*, void*, void*, int32_t, void*, void*, void*); -typedef void (*vFpuuuippp_t)(void*, uint32_t, uint32_t, uint32_t, int32_t, void*, void*, void*); -typedef void (*vFppppippp_t)(void*, void*, void*, void*, int32_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(ibus_bus_current_input_context_async, vFpippp_t) \ - GO(ibus_bus_get_global_engine_async, vFpippp_t) \ - GO(ibus_bus_list_active_engines_async, vFpippp_t) \ - GO(ibus_bus_list_engines_async, vFpippp_t) \ - GO(ibus_input_context_get_engine_async, vFpippp_t) \ - GO(ibus_bus_create_input_context_async, vFppippp_t) \ - GO(ibus_bus_set_global_engine_async, vFppippp_t) \ - GO(ibus_config_get_values_async, vFppippp_t) \ - GO(ibus_config_get_value_async, vFpppippp_t) \ - GO(ibus_input_context_process_key_event_async, vFpuuuippp_t) \ - GO(ibus_config_set_value_async, vFppppippp_t) - -#endif // __wrappedlibibusTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibibusundefs.h b/src/wrapped/generated/wrappedlibibusundefs.h deleted file mode 100644 index 3bc6269..0000000 --- a/src/wrapped/generated/wrappedlibibusundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibibusUNDEFS_H_ -#define __wrappedlibibusUNDEFS_H_ - - -#endif // __wrappedlibibusUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibicedefs.h b/src/wrapped/generated/wrappedlibicedefs.h deleted file mode 100644 index 6ee5a38..0000000 --- a/src/wrapped/generated/wrappedlibicedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibiceDEFS_H_ -#define __wrappedlibiceDEFS_H_ - - -#endif // __wrappedlibiceDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibicetypes.h b/src/wrapped/generated/wrappedlibicetypes.h deleted file mode 100644 index 111f9be..0000000 --- a/src/wrapped/generated/wrappedlibicetypes.h +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibiceTYPES_H_ -#define __wrappedlibiceTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); -typedef int32_t (*iFpp_t)(void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(IceSetErrorHandler, pFp_t) \ - GO(IceSetIOErrorHandler, pFp_t) \ - GO(IceAddConnectionWatch, iFpp_t) \ - GO(IceRemoveConnectionWatch, iFpp_t) - -#endif // __wrappedlibiceTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibiceundefs.h b/src/wrapped/generated/wrappedlibiceundefs.h deleted file mode 100644 index 052cabf..0000000 --- a/src/wrapped/generated/wrappedlibiceundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibiceUNDEFS_H_ -#define __wrappedlibiceUNDEFS_H_ - - -#endif // __wrappedlibiceUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibmdefs.h b/src/wrapped/generated/wrappedlibmdefs.h deleted file mode 100644 index 6afe322..0000000 --- a/src/wrapped/generated/wrappedlibmdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibmDEFS_H_ -#define __wrappedlibmDEFS_H_ - - -#endif // __wrappedlibmDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibmtypes.h b/src/wrapped/generated/wrappedlibmtypes.h deleted file mode 100644 index b31e0cb..0000000 --- a/src/wrapped/generated/wrappedlibmtypes.h +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibmTYPES_H_ -#define __wrappedlibmTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFv_t)(void); -typedef int32_t (*iFi_t)(int32_t); -typedef int32_t (*iFf_t)(float); -typedef int32_t (*iFd_t)(double); -typedef int64_t (*IFf_t)(float); -typedef int64_t (*IFd_t)(double); -typedef int64_t (*IFD_t)(long double); -typedef int64_t (*IFK_t)(double); -typedef float (*fFf_t)(float); -typedef double (*dFd_t)(double); -typedef long double (*DFD_t)(long double); -typedef double (*KFK_t)(double); -typedef float (*fFff_t)(float, float); -typedef double (*dFdd_t)(double, double); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(fegetround, iFv_t) \ - GO(fesetround, iFi_t) \ - GO(lrintf, iFf_t) \ - GO(lrint, iFd_t) \ - GO(llrintf, IFf_t) \ - GO(llrint, IFd_t) \ - GO(llrintl, IFD_t) \ - GO(llrintl, IFK_t) \ - GO(__acosf_finite, fFf_t) \ - GO(__acoshf_finite, fFf_t) \ - GO(__asinf_finite, fFf_t) \ - GO(__coshf_finite, fFf_t) \ - GO(__exp2f_finite, fFf_t) \ - GO(__expf_finite, fFf_t) \ - GO(__log10f_finite, fFf_t) \ - GO(__log2f_finite, fFf_t) \ - GO(__logf_finite, fFf_t) \ - GO(__sinhf_finite, fFf_t) \ - GO(__sqrtf_finite, fFf_t) \ - GO(nearbyintf, fFf_t) \ - GO(pow10f, fFf_t) \ - GO(rintf, fFf_t) \ - GO(__acos_finite, dFd_t) \ - GO(__acosh_finite, dFd_t) \ - GO(__asin_finite, dFd_t) \ - GO(__cosh_finite, dFd_t) \ - GO(__exp2_finite, dFd_t) \ - GO(__exp_finite, dFd_t) \ - GO(__log10_finite, dFd_t) \ - GO(__log2_finite, dFd_t) \ - GO(__log_finite, dFd_t) \ - GO(__sinh_finite, dFd_t) \ - GO(__sqrt_finite, dFd_t) \ - GO(nearbyint, dFd_t) \ - GO(pow10, dFd_t) \ - GO(rint, dFd_t) \ - GO(pow10l, DFD_t) \ - GO(pow10l, KFK_t) \ - GO(__atan2f_finite, fFff_t) \ - GO(__fmodf_finite, fFff_t) \ - GO(__hypotf_finite, fFff_t) \ - GO(__powf_finite, fFff_t) \ - GO(__atan2_finite, dFdd_t) \ - GO(__fmod_finite, dFdd_t) \ - GO(__hypot_finite, dFdd_t) \ - GO(__pow_finite, dFdd_t) - -#endif // __wrappedlibmTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibmundefs.h b/src/wrapped/generated/wrappedlibmundefs.h deleted file mode 100644 index 66b487b..0000000 --- a/src/wrapped/generated/wrappedlibmundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibmUNDEFS_H_ -#define __wrappedlibmUNDEFS_H_ - - -#endif // __wrappedlibmUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibncurses6defs.h b/src/wrapped/generated/wrappedlibncurses6defs.h deleted file mode 100644 index 0d07108..0000000 --- a/src/wrapped/generated/wrappedlibncurses6defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibncurses6DEFS_H_ -#define __wrappedlibncurses6DEFS_H_ - - -#endif // __wrappedlibncurses6DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibncurses6types.h b/src/wrapped/generated/wrappedlibncurses6types.h deleted file mode 100644 index 9594091..0000000 --- a/src/wrapped/generated/wrappedlibncurses6types.h +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibncurses6TYPES_H_ -#define __wrappedlibncurses6TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFv_t)(void); -typedef int32_t (*iFpV_t)(void*, ...); -typedef int32_t (*iFppV_t)(void*, void*, ...); -typedef int32_t (*iFppA_t)(void*, void*, va_list); -typedef int32_t (*iFiipV_t)(int32_t, int32_t, void*, ...); -typedef int32_t (*iFpiipV_t)(void*, int32_t, int32_t, void*, ...); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(initscr, pFv_t) \ - GO(printw, iFpV_t) \ - GO(wprintw, iFppV_t) \ - GO(vwprintw, iFppA_t) \ - GO(mvprintw, iFiipV_t) \ - GO(mvwprintw, iFpiipV_t) - -#endif // __wrappedlibncurses6TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibncurses6undefs.h b/src/wrapped/generated/wrappedlibncurses6undefs.h deleted file mode 100644 index 17cb535..0000000 --- a/src/wrapped/generated/wrappedlibncurses6undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibncurses6UNDEFS_H_ -#define __wrappedlibncurses6UNDEFS_H_ - - -#endif // __wrappedlibncurses6UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibncursesdefs.h b/src/wrapped/generated/wrappedlibncursesdefs.h deleted file mode 100644 index 3f1e508..0000000 --- a/src/wrapped/generated/wrappedlibncursesdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibncursesDEFS_H_ -#define __wrappedlibncursesDEFS_H_ - - -#endif // __wrappedlibncursesDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibncursestypes.h b/src/wrapped/generated/wrappedlibncursestypes.h deleted file mode 100644 index 08e551d..0000000 --- a/src/wrapped/generated/wrappedlibncursestypes.h +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibncursesTYPES_H_ -#define __wrappedlibncursesTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFv_t)(void); -typedef int32_t (*iFpV_t)(void*, ...); -typedef int32_t (*iFppA_t)(void*, void*, va_list); -typedef int32_t (*iFiipV_t)(int32_t, int32_t, void*, ...); -typedef int32_t (*iFpiipV_t)(void*, int32_t, int32_t, void*, ...); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(initscr, pFv_t) \ - GO(printw, iFpV_t) \ - GO(vwprintw, iFppA_t) \ - GO(mvprintw, iFiipV_t) \ - GO(mvwprintw, iFpiipV_t) - -#endif // __wrappedlibncursesTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibncursesundefs.h b/src/wrapped/generated/wrappedlibncursesundefs.h deleted file mode 100644 index ee39f26..0000000 --- a/src/wrapped/generated/wrappedlibncursesundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibncursesUNDEFS_H_ -#define __wrappedlibncursesUNDEFS_H_ - - -#endif // __wrappedlibncursesUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibncursesw6defs.h b/src/wrapped/generated/wrappedlibncursesw6defs.h deleted file mode 100644 index 70f1a06..0000000 --- a/src/wrapped/generated/wrappedlibncursesw6defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibncursesw6DEFS_H_ -#define __wrappedlibncursesw6DEFS_H_ - - -#endif // __wrappedlibncursesw6DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibncursesw6types.h b/src/wrapped/generated/wrappedlibncursesw6types.h deleted file mode 100644 index 275961e..0000000 --- a/src/wrapped/generated/wrappedlibncursesw6types.h +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibncursesw6TYPES_H_ -#define __wrappedlibncursesw6TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFv_t)(void); -typedef int32_t (*iFpV_t)(void*, ...); -typedef int32_t (*iFppA_t)(void*, void*, va_list); -typedef int32_t (*iFiipV_t)(int32_t, int32_t, void*, ...); -typedef int32_t (*iFpiipV_t)(void*, int32_t, int32_t, void*, ...); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(initscr, pFv_t) \ - GO(printw, iFpV_t) \ - GO(vwprintw, iFppA_t) \ - GO(mvprintw, iFiipV_t) \ - GO(mvwprintw, iFpiipV_t) - -#endif // __wrappedlibncursesw6TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibncursesw6undefs.h b/src/wrapped/generated/wrappedlibncursesw6undefs.h deleted file mode 100644 index 2207fbb..0000000 --- a/src/wrapped/generated/wrappedlibncursesw6undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibncursesw6UNDEFS_H_ -#define __wrappedlibncursesw6UNDEFS_H_ - - -#endif // __wrappedlibncursesw6UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibncurseswdefs.h b/src/wrapped/generated/wrappedlibncurseswdefs.h deleted file mode 100644 index 59c3a16..0000000 --- a/src/wrapped/generated/wrappedlibncurseswdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibncurseswDEFS_H_ -#define __wrappedlibncurseswDEFS_H_ - - -#endif // __wrappedlibncurseswDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibncurseswtypes.h b/src/wrapped/generated/wrappedlibncurseswtypes.h deleted file mode 100644 index 77ea437..0000000 --- a/src/wrapped/generated/wrappedlibncurseswtypes.h +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibncurseswTYPES_H_ -#define __wrappedlibncurseswTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFv_t)(void); -typedef int32_t (*iFpV_t)(void*, ...); -typedef int32_t (*iFppV_t)(void*, void*, ...); -typedef int32_t (*iFppA_t)(void*, void*, va_list); -typedef int32_t (*iFiipV_t)(int32_t, int32_t, void*, ...); -typedef int32_t (*iFpiipV_t)(void*, int32_t, int32_t, void*, ...); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(initscr, pFv_t) \ - GO(printw, iFpV_t) \ - GO(wprintw, iFppV_t) \ - GO(vwprintw, iFppA_t) \ - GO(mvprintw, iFiipV_t) \ - GO(mvwprintw, iFpiipV_t) - -#endif // __wrappedlibncurseswTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibncurseswundefs.h b/src/wrapped/generated/wrappedlibncurseswundefs.h deleted file mode 100644 index 5dc4f35..0000000 --- a/src/wrapped/generated/wrappedlibncurseswundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibncurseswUNDEFS_H_ -#define __wrappedlibncurseswUNDEFS_H_ - - -#endif // __wrappedlibncurseswUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibnettle8defs.h b/src/wrapped/generated/wrappedlibnettle8defs.h deleted file mode 100644 index 4b2b000..0000000 --- a/src/wrapped/generated/wrappedlibnettle8defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibnettle8DEFS_H_ -#define __wrappedlibnettle8DEFS_H_ - - -#endif // __wrappedlibnettle8DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibnettle8types.h b/src/wrapped/generated/wrappedlibnettle8types.h deleted file mode 100644 index 469e932..0000000 --- a/src/wrapped/generated/wrappedlibnettle8types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibnettle8TYPES_H_ -#define __wrappedlibnettle8TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibnettle8TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibnettle8undefs.h b/src/wrapped/generated/wrappedlibnettle8undefs.h deleted file mode 100644 index 6f345ec..0000000 --- a/src/wrapped/generated/wrappedlibnettle8undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibnettle8UNDEFS_H_ -#define __wrappedlibnettle8UNDEFS_H_ - - -#endif // __wrappedlibnettle8UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibnumadefs.h b/src/wrapped/generated/wrappedlibnumadefs.h deleted file mode 100644 index dbbf945..0000000 --- a/src/wrapped/generated/wrappedlibnumadefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibnumaDEFS_H_ -#define __wrappedlibnumaDEFS_H_ - - -#endif // __wrappedlibnumaDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibnumatypes.h b/src/wrapped/generated/wrappedlibnumatypes.h deleted file mode 100644 index 722c2aa..0000000 --- a/src/wrapped/generated/wrappedlibnumatypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibnumaTYPES_H_ -#define __wrappedlibnumaTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibnumaTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibnumaundefs.h b/src/wrapped/generated/wrappedlibnumaundefs.h deleted file mode 100644 index 37f7893..0000000 --- a/src/wrapped/generated/wrappedlibnumaundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibnumaUNDEFS_H_ -#define __wrappedlibnumaUNDEFS_H_ - - -#endif // __wrappedlibnumaUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedliboggdefs.h b/src/wrapped/generated/wrappedliboggdefs.h deleted file mode 100644 index f890dfb..0000000 --- a/src/wrapped/generated/wrappedliboggdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedliboggDEFS_H_ -#define __wrappedliboggDEFS_H_ - - -#endif // __wrappedliboggDEFS_H_ diff --git a/src/wrapped/generated/wrappedliboggtypes.h b/src/wrapped/generated/wrappedliboggtypes.h deleted file mode 100644 index 6ed0612..0000000 --- a/src/wrapped/generated/wrappedliboggtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedliboggTYPES_H_ -#define __wrappedliboggTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedliboggTYPES_H_ diff --git a/src/wrapped/generated/wrappedliboggundefs.h b/src/wrapped/generated/wrappedliboggundefs.h deleted file mode 100644 index d62105c..0000000 --- a/src/wrapped/generated/wrappedliboggundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedliboggUNDEFS_H_ -#define __wrappedliboggUNDEFS_H_ - - -#endif // __wrappedliboggUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibpaneldefs.h b/src/wrapped/generated/wrappedlibpaneldefs.h deleted file mode 100644 index 05a0b2f..0000000 --- a/src/wrapped/generated/wrappedlibpaneldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibpanelDEFS_H_ -#define __wrappedlibpanelDEFS_H_ - - -#endif // __wrappedlibpanelDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibpaneltypes.h b/src/wrapped/generated/wrappedlibpaneltypes.h deleted file mode 100644 index 6f55da2..0000000 --- a/src/wrapped/generated/wrappedlibpaneltypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibpanelTYPES_H_ -#define __wrappedlibpanelTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibpanelTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibpanelundefs.h b/src/wrapped/generated/wrappedlibpanelundefs.h deleted file mode 100644 index 7725e7b..0000000 --- a/src/wrapped/generated/wrappedlibpanelundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibpanelUNDEFS_H_ -#define __wrappedlibpanelUNDEFS_H_ - - -#endif // __wrappedlibpanelUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibpcidefs.h b/src/wrapped/generated/wrappedlibpcidefs.h deleted file mode 100644 index cb277a0..0000000 --- a/src/wrapped/generated/wrappedlibpcidefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibpciDEFS_H_ -#define __wrappedlibpciDEFS_H_ - - -#endif // __wrappedlibpciDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibpcitypes.h b/src/wrapped/generated/wrappedlibpcitypes.h deleted file mode 100644 index 5c78181..0000000 --- a/src/wrapped/generated/wrappedlibpcitypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibpciTYPES_H_ -#define __wrappedlibpciTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibpciTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibpciundefs.h b/src/wrapped/generated/wrappedlibpciundefs.h deleted file mode 100644 index 88b3e89..0000000 --- a/src/wrapped/generated/wrappedlibpciundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibpciUNDEFS_H_ -#define __wrappedlibpciUNDEFS_H_ - - -#endif // __wrappedlibpciUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibpcredefs.h b/src/wrapped/generated/wrappedlibpcredefs.h deleted file mode 100644 index aebe1a8..0000000 --- a/src/wrapped/generated/wrappedlibpcredefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibpcreDEFS_H_ -#define __wrappedlibpcreDEFS_H_ - - -#endif // __wrappedlibpcreDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibpcretypes.h b/src/wrapped/generated/wrappedlibpcretypes.h deleted file mode 100644 index 379b86f..0000000 --- a/src/wrapped/generated/wrappedlibpcretypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibpcreTYPES_H_ -#define __wrappedlibpcreTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibpcreTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibpcreundefs.h b/src/wrapped/generated/wrappedlibpcreundefs.h deleted file mode 100644 index d25656d..0000000 --- a/src/wrapped/generated/wrappedlibpcreundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibpcreUNDEFS_H_ -#define __wrappedlibpcreUNDEFS_H_ - - -#endif // __wrappedlibpcreUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibpthreaddefs.h b/src/wrapped/generated/wrappedlibpthreaddefs.h deleted file mode 100644 index c45f107..0000000 --- a/src/wrapped/generated/wrappedlibpthreaddefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibpthreadDEFS_H_ -#define __wrappedlibpthreadDEFS_H_ - - -#endif // __wrappedlibpthreadDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibpthreadtypes.h b/src/wrapped/generated/wrappedlibpthreadtypes.h deleted file mode 100644 index c9e5b10..0000000 --- a/src/wrapped/generated/wrappedlibpthreadtypes.h +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibpthreadTYPES_H_ -#define __wrappedlibpthreadTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef int32_t (*iFL_t)(uintptr_t); -typedef int32_t (*iFp_t)(void*); -typedef void (*vFpi_t)(void*, int32_t); -typedef int32_t (*iFLp_t)(uintptr_t, void*); -typedef int32_t (*iFpi_t)(void*, int32_t); -typedef int32_t (*iFpL_t)(void*, uintptr_t); -typedef int32_t (*iFpp_t)(void*, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef int32_t (*iFpLp_t)(void*, uintptr_t, void*); -typedef int32_t (*iFppu_t)(void*, void*, uint32_t); -typedef int32_t (*iFppL_t)(void*, void*, uintptr_t); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef int32_t (*iFppip_t)(void*, void*, int32_t, void*); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(__pthread_register_cancel, vFp_t) \ - GO(__pthread_unregister_cancel, vFp_t) \ - GO(__pthread_unwind_next, vFp_t) \ - GO(pthread_key_delete, iFL_t) \ - GO(__pthread_mutexattr_destroy, iFp_t) \ - GO(__pthread_mutexattr_init, iFp_t) \ - GO(pthread_attr_destroy, iFp_t) \ - GO(pthread_attr_init, iFp_t) \ - GO(pthread_barrierattr_destroy, iFp_t) \ - GO(pthread_barrierattr_init, iFp_t) \ - GO(pthread_cond_broadcast, iFp_t) \ - GO(pthread_cond_destroy, iFp_t) \ - GO(pthread_cond_signal, iFp_t) \ - GO(pthread_condattr_destroy, iFp_t) \ - GO(pthread_condattr_init, iFp_t) \ - GO(pthread_getattr_default_np, iFp_t) \ - GO(pthread_mutexattr_destroy, iFp_t) \ - GO(pthread_mutexattr_init, iFp_t) \ - GO(pthread_setattr_default_np, iFp_t) \ - GO(_pthread_cleanup_pop, vFpi_t) \ - GO(_pthread_cleanup_pop_restore, vFpi_t) \ - GO(pthread_getattr_np, iFLp_t) \ - GO(__pthread_mutexattr_settype, iFpi_t) \ - GO(pthread_attr_setdetachstate, iFpi_t) \ - GO(pthread_attr_setinheritsched, iFpi_t) \ - GO(pthread_attr_setschedpolicy, iFpi_t) \ - GO(pthread_attr_setscope, iFpi_t) \ - GO(pthread_barrierattr_setpshared, iFpi_t) \ - GO(pthread_condattr_setclock, iFpi_t) \ - GO(pthread_condattr_setpshared, iFpi_t) \ - GO(pthread_kill, iFpi_t) \ - GO(pthread_kill@GLIBC_2.2.5, iFpi_t) \ - GO(pthread_mutexattr_setkind_np, iFpi_t) \ - GO(pthread_mutexattr_setprotocol, iFpi_t) \ - GO(pthread_mutexattr_setpshared, iFpi_t) \ - GO(pthread_mutexattr_setrobust, iFpi_t) \ - GO(pthread_mutexattr_settype, iFpi_t) \ - GO(pthread_attr_setguardsize, iFpL_t) \ - GO(pthread_attr_setstacksize, iFpL_t) \ - GO(__pthread_key_create, iFpp_t) \ - GO(__pthread_mutex_init, iFpp_t) \ - GO(__pthread_once, iFpp_t) \ - GO(pthread_attr_getdetachstate, iFpp_t) \ - GO(pthread_attr_getguardsize, iFpp_t) \ - GO(pthread_attr_getinheritsched, iFpp_t) \ - GO(pthread_attr_getschedparam, iFpp_t) \ - GO(pthread_attr_getschedpolicy, iFpp_t) \ - GO(pthread_attr_getscope, iFpp_t) \ - GO(pthread_attr_getstackaddr, iFpp_t) \ - GO(pthread_attr_getstacksize, iFpp_t) \ - GO(pthread_attr_setschedparam, iFpp_t) \ - GO(pthread_attr_setstackaddr, iFpp_t) \ - GO(pthread_barrierattr_getpshared, iFpp_t) \ - GO(pthread_cond_init, iFpp_t) \ - GO(pthread_cond_wait, iFpp_t) \ - GO(pthread_condattr_getclock, iFpp_t) \ - GO(pthread_condattr_getpshared, iFpp_t) \ - GO(pthread_key_create, iFpp_t) \ - GO(pthread_mutex_init, iFpp_t) \ - GO(pthread_mutexattr_getkind_np, iFpp_t) \ - GO(pthread_mutexattr_getprotocol, iFpp_t) \ - GO(pthread_mutexattr_getrobust, iFpp_t) \ - GO(pthread_mutexattr_gettype, iFpp_t) \ - GO(pthread_once, iFpp_t) \ - GO(_pthread_cleanup_push, vFppp_t) \ - GO(_pthread_cleanup_push_defer, vFppp_t) \ - GO(pthread_attr_setaffinity_np, iFpLp_t) \ - GO(pthread_getaffinity_np, iFpLp_t) \ - GO(pthread_setaffinity_np, iFpLp_t) \ - GO(pthread_barrier_init, iFppu_t) \ - GO(pthread_attr_setstack, iFppL_t) \ - GO(__pthread_atfork, iFppp_t) \ - GO(pthread_atfork, iFppp_t) \ - GO(pthread_attr_getstack, iFppp_t) \ - GO(pthread_cond_timedwait, iFppp_t) \ - GO(pthread_cond_clockwait, iFppip_t) \ - GO(pthread_create, iFpppp_t) - -#endif // __wrappedlibpthreadTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibpthreadundefs.h b/src/wrapped/generated/wrappedlibpthreadundefs.h deleted file mode 100644 index a54b5c8..0000000 --- a/src/wrapped/generated/wrappedlibpthreadundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibpthreadUNDEFS_H_ -#define __wrappedlibpthreadUNDEFS_H_ - - -#endif // __wrappedlibpthreadUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibresolvdefs.h b/src/wrapped/generated/wrappedlibresolvdefs.h deleted file mode 100644 index 5ccf7db..0000000 --- a/src/wrapped/generated/wrappedlibresolvdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibresolvDEFS_H_ -#define __wrappedlibresolvDEFS_H_ - - -#endif // __wrappedlibresolvDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibresolvtypes.h b/src/wrapped/generated/wrappedlibresolvtypes.h deleted file mode 100644 index 74f7c25..0000000 --- a/src/wrapped/generated/wrappedlibresolvtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibresolvTYPES_H_ -#define __wrappedlibresolvTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibresolvTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibresolvundefs.h b/src/wrapped/generated/wrappedlibresolvundefs.h deleted file mode 100644 index 964f358..0000000 --- a/src/wrapped/generated/wrappedlibresolvundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibresolvUNDEFS_H_ -#define __wrappedlibresolvUNDEFS_H_ - - -#endif // __wrappedlibresolvUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibrtdefs.h b/src/wrapped/generated/wrappedlibrtdefs.h deleted file mode 100644 index 959c4e2..0000000 --- a/src/wrapped/generated/wrappedlibrtdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibrtDEFS_H_ -#define __wrappedlibrtDEFS_H_ - - -#endif // __wrappedlibrtDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibrttypes.h b/src/wrapped/generated/wrappedlibrttypes.h deleted file mode 100644 index bf1b3fd..0000000 --- a/src/wrapped/generated/wrappedlibrttypes.h +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibrtTYPES_H_ -#define __wrappedlibrtTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFp_t)(void*); -typedef int32_t (*iFip_t)(int32_t, void*); -typedef int32_t (*iFupp_t)(uint32_t, void*, void*); -typedef int32_t (*iFipip_t)(int32_t, void*, int32_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(aio_read, iFp_t) \ - GO(aio_read64, iFp_t) \ - GO(aio_write, iFp_t) \ - GO(aio_write64, iFp_t) \ - GO(aio_cancel, iFip_t) \ - GO(timer_create, iFupp_t) \ - GO(lio_listio, iFipip_t) - -#endif // __wrappedlibrtTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibrtundefs.h b/src/wrapped/generated/wrappedlibrtundefs.h deleted file mode 100644 index 86a1a4e..0000000 --- a/src/wrapped/generated/wrappedlibrtundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibrtUNDEFS_H_ -#define __wrappedlibrtUNDEFS_H_ - - -#endif // __wrappedlibrtUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibsmdefs.h b/src/wrapped/generated/wrappedlibsmdefs.h deleted file mode 100644 index 6260b39..0000000 --- a/src/wrapped/generated/wrappedlibsmdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibsmDEFS_H_ -#define __wrappedlibsmDEFS_H_ - - -#endif // __wrappedlibsmDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibsmtypes.h b/src/wrapped/generated/wrappedlibsmtypes.h deleted file mode 100644 index 0eef242..0000000 --- a/src/wrapped/generated/wrappedlibsmtypes.h +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibsmTYPES_H_ -#define __wrappedlibsmTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*); -typedef void* (*pFppiiLpppip_t)(void*, void*, int32_t, int32_t, uintptr_t, void*, void*, void*, int32_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(SmcSetErrorHandler, pFp_t) \ - GO(SmcRequestSaveYourselfPhase2, iFppp_t) \ - GO(SmcInteractRequest, iFpipp_t) \ - GO(SmcOpenConnection, pFppiiLpppip_t) - -#endif // __wrappedlibsmTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibsmundefs.h b/src/wrapped/generated/wrappedlibsmundefs.h deleted file mode 100644 index 174f1ec..0000000 --- a/src/wrapped/generated/wrappedlibsmundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibsmUNDEFS_H_ -#define __wrappedlibsmUNDEFS_H_ - - -#endif // __wrappedlibsmUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibsndfiledefs.h b/src/wrapped/generated/wrappedlibsndfiledefs.h deleted file mode 100644 index 32e25ee..0000000 --- a/src/wrapped/generated/wrappedlibsndfiledefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibsndfileDEFS_H_ -#define __wrappedlibsndfileDEFS_H_ - - -#endif // __wrappedlibsndfileDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibsndfiletypes.h b/src/wrapped/generated/wrappedlibsndfiletypes.h deleted file mode 100644 index 5d45b78..0000000 --- a/src/wrapped/generated/wrappedlibsndfiletypes.h +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibsndfileTYPES_H_ -#define __wrappedlibsndfileTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFp_t)(void*); -typedef void* (*pFpipp_t)(void*, int32_t, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(sf_close, iFp_t) \ - GO(sf_open_virtual, pFpipp_t) - -#endif // __wrappedlibsndfileTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibsndfileundefs.h b/src/wrapped/generated/wrappedlibsndfileundefs.h deleted file mode 100644 index 887c9b2..0000000 --- a/src/wrapped/generated/wrappedlibsndfileundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibsndfileUNDEFS_H_ -#define __wrappedlibsndfileUNDEFS_H_ - - -#endif // __wrappedlibsndfileUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibsqlite3defs.h b/src/wrapped/generated/wrappedlibsqlite3defs.h deleted file mode 100644 index 95e690c..0000000 --- a/src/wrapped/generated/wrappedlibsqlite3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibsqlite3DEFS_H_ -#define __wrappedlibsqlite3DEFS_H_ - - -#endif // __wrappedlibsqlite3DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibsqlite3types.h b/src/wrapped/generated/wrappedlibsqlite3types.h deleted file mode 100644 index 03aa528..0000000 --- a/src/wrapped/generated/wrappedlibsqlite3types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibsqlite3TYPES_H_ -#define __wrappedlibsqlite3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibsqlite3TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibsqlite3undefs.h b/src/wrapped/generated/wrappedlibsqlite3undefs.h deleted file mode 100644 index 39570fe..0000000 --- a/src/wrapped/generated/wrappedlibsqlite3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibsqlite3UNDEFS_H_ -#define __wrappedlibsqlite3UNDEFS_H_ - - -#endif // __wrappedlibsqlite3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibssh2defs.h b/src/wrapped/generated/wrappedlibssh2defs.h deleted file mode 100644 index 96ef86f..0000000 --- a/src/wrapped/generated/wrappedlibssh2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibssh2DEFS_H_ -#define __wrappedlibssh2DEFS_H_ - - -#endif // __wrappedlibssh2DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibssh2types.h b/src/wrapped/generated/wrappedlibssh2types.h deleted file mode 100644 index 3363c6c..0000000 --- a/src/wrapped/generated/wrappedlibssh2types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibssh2TYPES_H_ -#define __wrappedlibssh2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibssh2TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibssh2undefs.h b/src/wrapped/generated/wrappedlibssh2undefs.h deleted file mode 100644 index 8c11095..0000000 --- a/src/wrapped/generated/wrappedlibssh2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibssh2UNDEFS_H_ -#define __wrappedlibssh2UNDEFS_H_ - - -#endif // __wrappedlibssh2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibssl3defs.h b/src/wrapped/generated/wrappedlibssl3defs.h deleted file mode 100644 index 0f2f747..0000000 --- a/src/wrapped/generated/wrappedlibssl3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibssl3DEFS_H_ -#define __wrappedlibssl3DEFS_H_ - - -#endif // __wrappedlibssl3DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibssl3types.h b/src/wrapped/generated/wrappedlibssl3types.h deleted file mode 100644 index ec73505..0000000 --- a/src/wrapped/generated/wrappedlibssl3types.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibssl3TYPES_H_ -#define __wrappedlibssl3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef void (*vFpip_t)(void*, int32_t, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef intptr_t (*lFpip_t)(void*, int32_t, void*); -typedef int32_t (*iFlpppp_t)(intptr_t, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(SSL_CTX_get_default_passwd_cb, pFp_t) \ - GO(SSL_CTX_get_verify_callback, pFp_t) \ - GO(SSL_get_verify_callback, pFp_t) \ - GO(SSL_CTX_set_client_cert_cb, vFpp_t) \ - GO(SSL_CTX_set_default_passwd_cb, vFpp_t) \ - GO(SSL_CTX_set_keylog_callback, vFpp_t) \ - GO(SSL_CTX_set_msg_callback, vFpp_t) \ - GO(SSL_set_msg_callback, vFpp_t) \ - GO(SSL_set_psk_client_callback, vFpp_t) \ - GO(SSL_CTX_set_verify, vFpip_t) \ - GO(SSL_set_verify, vFpip_t) \ - GO(SSL_CTX_set_alpn_select_cb, vFppp_t) \ - GO(SSL_CTX_set_cert_verify_callback, vFppp_t) \ - GO(SSL_CTX_set_next_proto_select_cb, vFppp_t) \ - GO(SSL_CTX_callback_ctrl, lFpip_t) \ - GO(SSL_callback_ctrl, lFpip_t) \ - GO(SSL_get_ex_new_index, iFlpppp_t) - -#endif // __wrappedlibssl3TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibssl3undefs.h b/src/wrapped/generated/wrappedlibssl3undefs.h deleted file mode 100644 index 5c86c5e..0000000 --- a/src/wrapped/generated/wrappedlibssl3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibssl3UNDEFS_H_ -#define __wrappedlibssl3UNDEFS_H_ - - -#endif // __wrappedlibssl3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibssldefs.h b/src/wrapped/generated/wrappedlibssldefs.h deleted file mode 100644 index 55eceb3..0000000 --- a/src/wrapped/generated/wrappedlibssldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibsslDEFS_H_ -#define __wrappedlibsslDEFS_H_ - - -#endif // __wrappedlibsslDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibssltypes.h b/src/wrapped/generated/wrappedlibssltypes.h deleted file mode 100644 index d6d337f..0000000 --- a/src/wrapped/generated/wrappedlibssltypes.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibsslTYPES_H_ -#define __wrappedlibsslTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef void (*vFpip_t)(void*, int32_t, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef intptr_t (*lFpip_t)(void*, int32_t, void*); -typedef int32_t (*iFlpppp_t)(intptr_t, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(SSL_get_verify_callback, pFp_t) \ - GO(SSL_CTX_sess_set_new_cb, vFpp_t) \ - GO(SSL_CTX_set_client_cert_cb, vFpp_t) \ - GO(SSL_CTX_set_cookie_generate_cb, vFpp_t) \ - GO(SSL_CTX_set_cookie_verify_cb, vFpp_t) \ - GO(SSL_CTX_set_default_passwd_cb, vFpp_t) \ - GO(SSL_set_psk_client_callback, vFpp_t) \ - GO(SSL_set_psk_server_callback, vFpp_t) \ - GO(SSL_set_psk_use_session_callback, vFpp_t) \ - GO(SSL_CTX_set_verify, vFpip_t) \ - GO(SSL_set_verify, vFpip_t) \ - GO(SSL_CTX_set_alpn_select_cb, vFppp_t) \ - GO(SSL_CTX_set_cert_verify_callback, vFppp_t) \ - GO(SSL_CTX_set_next_proto_select_cb, vFppp_t) \ - GO(SSL_CTX_callback_ctrl, lFpip_t) \ - GO(SSL_callback_ctrl, lFpip_t) \ - GO(SSL_get_ex_new_index, iFlpppp_t) - -#endif // __wrappedlibsslTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibsslundefs.h b/src/wrapped/generated/wrappedlibsslundefs.h deleted file mode 100644 index 1227826..0000000 --- a/src/wrapped/generated/wrappedlibsslundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibsslUNDEFS_H_ -#define __wrappedlibsslUNDEFS_H_ - - -#endif // __wrappedlibsslUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibtasn1defs.h b/src/wrapped/generated/wrappedlibtasn1defs.h deleted file mode 100644 index 6a4d7bd..0000000 --- a/src/wrapped/generated/wrappedlibtasn1defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibtasn1DEFS_H_ -#define __wrappedlibtasn1DEFS_H_ - - -#endif // __wrappedlibtasn1DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibtasn1types.h b/src/wrapped/generated/wrappedlibtasn1types.h deleted file mode 100644 index 02a76bb..0000000 --- a/src/wrapped/generated/wrappedlibtasn1types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibtasn1TYPES_H_ -#define __wrappedlibtasn1TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibtasn1TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibtasn1undefs.h b/src/wrapped/generated/wrappedlibtasn1undefs.h deleted file mode 100644 index 0e9c168..0000000 --- a/src/wrapped/generated/wrappedlibtasn1undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibtasn1UNDEFS_H_ -#define __wrappedlibtasn1UNDEFS_H_ - - -#endif // __wrappedlibtasn1UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibtinfo6defs.h b/src/wrapped/generated/wrappedlibtinfo6defs.h deleted file mode 100644 index 72facfa..0000000 --- a/src/wrapped/generated/wrappedlibtinfo6defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibtinfo6DEFS_H_ -#define __wrappedlibtinfo6DEFS_H_ - - -#endif // __wrappedlibtinfo6DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibtinfo6types.h b/src/wrapped/generated/wrappedlibtinfo6types.h deleted file mode 100644 index e195221..0000000 --- a/src/wrapped/generated/wrappedlibtinfo6types.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibtinfo6TYPES_H_ -#define __wrappedlibtinfo6TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFpip_t)(void*, int32_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(tputs, iFpip_t) - -#endif // __wrappedlibtinfo6TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibtinfo6undefs.h b/src/wrapped/generated/wrappedlibtinfo6undefs.h deleted file mode 100644 index cf063de..0000000 --- a/src/wrapped/generated/wrappedlibtinfo6undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibtinfo6UNDEFS_H_ -#define __wrappedlibtinfo6UNDEFS_H_ - - -#endif // __wrappedlibtinfo6UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibtinfodefs.h b/src/wrapped/generated/wrappedlibtinfodefs.h deleted file mode 100644 index a04196f..0000000 --- a/src/wrapped/generated/wrappedlibtinfodefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibtinfoDEFS_H_ -#define __wrappedlibtinfoDEFS_H_ - - -#endif // __wrappedlibtinfoDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibtinfotypes.h b/src/wrapped/generated/wrappedlibtinfotypes.h deleted file mode 100644 index e276244..0000000 --- a/src/wrapped/generated/wrappedlibtinfotypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibtinfoTYPES_H_ -#define __wrappedlibtinfoTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFpip_t)(void*, int32_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(tputs, iFpip_t) - -#endif // __wrappedlibtinfoTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibtinfoundefs.h b/src/wrapped/generated/wrappedlibtinfoundefs.h deleted file mode 100644 index 0321595..0000000 --- a/src/wrapped/generated/wrappedlibtinfoundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibtinfoUNDEFS_H_ -#define __wrappedlibtinfoUNDEFS_H_ - - -#endif // __wrappedlibtinfoUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibunistring2defs.h b/src/wrapped/generated/wrappedlibunistring2defs.h deleted file mode 100644 index 5204414..0000000 --- a/src/wrapped/generated/wrappedlibunistring2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibunistring2DEFS_H_ -#define __wrappedlibunistring2DEFS_H_ - - -#endif // __wrappedlibunistring2DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibunistring2types.h b/src/wrapped/generated/wrappedlibunistring2types.h deleted file mode 100644 index 25a30d9..0000000 --- a/src/wrapped/generated/wrappedlibunistring2types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibunistring2TYPES_H_ -#define __wrappedlibunistring2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibunistring2TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibunistring2undefs.h b/src/wrapped/generated/wrappedlibunistring2undefs.h deleted file mode 100644 index 88de83f..0000000 --- a/src/wrapped/generated/wrappedlibunistring2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibunistring2UNDEFS_H_ -#define __wrappedlibunistring2UNDEFS_H_ - - -#endif // __wrappedlibunistring2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibusb1defs.h b/src/wrapped/generated/wrappedlibusb1defs.h deleted file mode 100644 index 9da71f8..0000000 --- a/src/wrapped/generated/wrappedlibusb1defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibusb1DEFS_H_ -#define __wrappedlibusb1DEFS_H_ - - -#endif // __wrappedlibusb1DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibusb1types.h b/src/wrapped/generated/wrappedlibusb1types.h deleted file mode 100644 index 9155c25..0000000 --- a/src/wrapped/generated/wrappedlibusb1types.h +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibusb1TYPES_H_ -#define __wrappedlibusb1TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFp_t)(void*); -typedef void* (*pFi_t)(int32_t); -typedef int32_t (*iFpiiiiippp_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(libusb_cancel_transfer, iFp_t) \ - GO(libusb_submit_transfer, iFp_t) \ - GO(libusb_alloc_transfer, pFi_t) \ - GO(libusb_hotplug_register_callback, iFpiiiiippp_t) - -#endif // __wrappedlibusb1TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibusb1undefs.h b/src/wrapped/generated/wrappedlibusb1undefs.h deleted file mode 100644 index 99ee492..0000000 --- a/src/wrapped/generated/wrappedlibusb1undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibusb1UNDEFS_H_ -#define __wrappedlibusb1UNDEFS_H_ - - -#endif // __wrappedlibusb1UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibuuiddefs.h b/src/wrapped/generated/wrappedlibuuiddefs.h deleted file mode 100644 index c20d4b6..0000000 --- a/src/wrapped/generated/wrappedlibuuiddefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibuuidDEFS_H_ -#define __wrappedlibuuidDEFS_H_ - - -#endif // __wrappedlibuuidDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibuuidtypes.h b/src/wrapped/generated/wrappedlibuuidtypes.h deleted file mode 100644 index a39b43d..0000000 --- a/src/wrapped/generated/wrappedlibuuidtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibuuidTYPES_H_ -#define __wrappedlibuuidTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibuuidTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibuuidundefs.h b/src/wrapped/generated/wrappedlibuuidundefs.h deleted file mode 100644 index e705970..0000000 --- a/src/wrapped/generated/wrappedlibuuidundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibuuidUNDEFS_H_ -#define __wrappedlibuuidUNDEFS_H_ - - -#endif // __wrappedlibuuidUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibvadefs.h b/src/wrapped/generated/wrappedlibvadefs.h deleted file mode 100644 index 40decd8..0000000 --- a/src/wrapped/generated/wrappedlibvadefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvaDEFS_H_ -#define __wrappedlibvaDEFS_H_ - - -#endif // __wrappedlibvaDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibvadrmdefs.h b/src/wrapped/generated/wrappedlibvadrmdefs.h deleted file mode 100644 index 359d706..0000000 --- a/src/wrapped/generated/wrappedlibvadrmdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvadrmDEFS_H_ -#define __wrappedlibvadrmDEFS_H_ - - -#endif // __wrappedlibvadrmDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibvadrmtypes.h b/src/wrapped/generated/wrappedlibvadrmtypes.h deleted file mode 100644 index b1d9979..0000000 --- a/src/wrapped/generated/wrappedlibvadrmtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvadrmTYPES_H_ -#define __wrappedlibvadrmTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibvadrmTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibvadrmundefs.h b/src/wrapped/generated/wrappedlibvadrmundefs.h deleted file mode 100644 index a729302..0000000 --- a/src/wrapped/generated/wrappedlibvadrmundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvadrmUNDEFS_H_ -#define __wrappedlibvadrmUNDEFS_H_ - - -#endif // __wrappedlibvadrmUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibvatypes.h b/src/wrapped/generated/wrappedlibvatypes.h deleted file mode 100644 index 3eac036..0000000 --- a/src/wrapped/generated/wrappedlibvatypes.h +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvaTYPES_H_ -#define __wrappedlibvaTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFppp_t)(void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(vaSetErrorCallback, pFppp_t) \ - GO(vaSetInfoCallback, pFppp_t) - -#endif // __wrappedlibvaTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibvaundefs.h b/src/wrapped/generated/wrappedlibvaundefs.h deleted file mode 100644 index ed6dde1..0000000 --- a/src/wrapped/generated/wrappedlibvaundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvaUNDEFS_H_ -#define __wrappedlibvaUNDEFS_H_ - - -#endif // __wrappedlibvaUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibvawaylanddefs.h b/src/wrapped/generated/wrappedlibvawaylanddefs.h deleted file mode 100644 index 02a7e4b..0000000 --- a/src/wrapped/generated/wrappedlibvawaylanddefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvawaylandDEFS_H_ -#define __wrappedlibvawaylandDEFS_H_ - - -#endif // __wrappedlibvawaylandDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibvawaylandtypes.h b/src/wrapped/generated/wrappedlibvawaylandtypes.h deleted file mode 100644 index 96e1861..0000000 --- a/src/wrapped/generated/wrappedlibvawaylandtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvawaylandTYPES_H_ -#define __wrappedlibvawaylandTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibvawaylandTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibvawaylandundefs.h b/src/wrapped/generated/wrappedlibvawaylandundefs.h deleted file mode 100644 index 62a23ae..0000000 --- a/src/wrapped/generated/wrappedlibvawaylandundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvawaylandUNDEFS_H_ -#define __wrappedlibvawaylandUNDEFS_H_ - - -#endif // __wrappedlibvawaylandUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibvax11defs.h b/src/wrapped/generated/wrappedlibvax11defs.h deleted file mode 100644 index afa9f01..0000000 --- a/src/wrapped/generated/wrappedlibvax11defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvax11DEFS_H_ -#define __wrappedlibvax11DEFS_H_ - - -#endif // __wrappedlibvax11DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibvax11types.h b/src/wrapped/generated/wrappedlibvax11types.h deleted file mode 100644 index 118aad9..0000000 --- a/src/wrapped/generated/wrappedlibvax11types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvax11TYPES_H_ -#define __wrappedlibvax11TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibvax11TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibvax11undefs.h b/src/wrapped/generated/wrappedlibvax11undefs.h deleted file mode 100644 index 265614f..0000000 --- a/src/wrapped/generated/wrappedlibvax11undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvax11UNDEFS_H_ -#define __wrappedlibvax11UNDEFS_H_ - - -#endif // __wrappedlibvax11UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibvdpaudefs.h b/src/wrapped/generated/wrappedlibvdpaudefs.h deleted file mode 100644 index 5a07377..0000000 --- a/src/wrapped/generated/wrappedlibvdpaudefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvdpauDEFS_H_ -#define __wrappedlibvdpauDEFS_H_ - - -#endif // __wrappedlibvdpauDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibvdpautypes.h b/src/wrapped/generated/wrappedlibvdpautypes.h deleted file mode 100644 index 8c04102..0000000 --- a/src/wrapped/generated/wrappedlibvdpautypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvdpauTYPES_H_ -#define __wrappedlibvdpauTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(vdp_device_create_x11, iFpipp_t) - -#endif // __wrappedlibvdpauTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibvdpauundefs.h b/src/wrapped/generated/wrappedlibvdpauundefs.h deleted file mode 100644 index 3f7baa6..0000000 --- a/src/wrapped/generated/wrappedlibvdpauundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvdpauUNDEFS_H_ -#define __wrappedlibvdpauUNDEFS_H_ - - -#endif // __wrappedlibvdpauUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibvorbisdefs.h b/src/wrapped/generated/wrappedlibvorbisdefs.h deleted file mode 100644 index 73d6d3f..0000000 --- a/src/wrapped/generated/wrappedlibvorbisdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvorbisDEFS_H_ -#define __wrappedlibvorbisDEFS_H_ - - -#endif // __wrappedlibvorbisDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibvorbistypes.h b/src/wrapped/generated/wrappedlibvorbistypes.h deleted file mode 100644 index b90ae75..0000000 --- a/src/wrapped/generated/wrappedlibvorbistypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvorbisTYPES_H_ -#define __wrappedlibvorbisTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibvorbisTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibvorbisundefs.h b/src/wrapped/generated/wrappedlibvorbisundefs.h deleted file mode 100644 index 75f1028..0000000 --- a/src/wrapped/generated/wrappedlibvorbisundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibvorbisUNDEFS_H_ -#define __wrappedlibvorbisUNDEFS_H_ - - -#endif // __wrappedlibvorbisUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibx11defs.h b/src/wrapped/generated/wrappedlibx11defs.h deleted file mode 100644 index 9c6afd1..0000000 --- a/src/wrapped/generated/wrappedlibx11defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibx11DEFS_H_ -#define __wrappedlibx11DEFS_H_ - - -#endif // __wrappedlibx11DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibx11types.h b/src/wrapped/generated/wrappedlibx11types.h deleted file mode 100644 index f712ce5..0000000 --- a/src/wrapped/generated/wrappedlibx11types.h +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibx11TYPES_H_ -#define __wrappedlibx11TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFp_t)(void*); -typedef void* (*pFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef void* (*pFiV_t)(int32_t, ...); -typedef void* (*pFpi_t)(void*, int32_t); -typedef void* (*pFpp_t)(void*, void*); -typedef void* (*pFpV_t)(void*, ...); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef void* (*pFpip_t)(void*, int32_t, void*); -typedef void* (*pFpuL_t)(void*, uint32_t, uintptr_t); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFppppp_t)(void*, void*, void*, void*, void*); -typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*); -typedef void* (*pFppiiuuLi_t)(void*, void*, int32_t, int32_t, uint32_t, uint32_t, uintptr_t, int32_t); -typedef int32_t (*iFppppiiiiuu_t)(void*, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); -typedef void* (*pFppuiipuuii_t)(void*, void*, uint32_t, int32_t, int32_t, void*, uint32_t, uint32_t, int32_t, int32_t); -typedef void* (*pFppiiuuuipii_t)(void*, void*, int32_t, int32_t, uint32_t, uint32_t, uint32_t, int32_t, void*, int32_t, int32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(XDestroyImage, iFp_t) \ - GO(XInitImage, iFp_t) \ - GO(XOpenDisplay, pFp_t) \ - GO(XSetErrorHandler, pFp_t) \ - GO(XSetIOErrorHandler, pFp_t) \ - GO(_XDeqAsyncHandler, vFpp_t) \ - GO(XVaCreateNestedList, pFiV_t) \ - GO(XSynchronize, pFpi_t) \ - GO(XSetAfterFunction, pFpp_t) \ - GO(XCreateIC, pFpV_t) \ - GO(XSetICValues, pFpV_t) \ - GO(XSetIMValues, pFpV_t) \ - GO(XAddConnectionWatch, iFppp_t) \ - GO(XRemoveConnectionWatch, iFppp_t) \ - GO(XESetCloseDisplay, pFpip_t) \ - GO(XESetError, pFpip_t) \ - GO(XESetEventToWire, pFpip_t) \ - GO(XESetWireToEvent, pFpip_t) \ - GO(_XGetRequest, pFpuL_t) \ - GO(XCheckIfEvent, iFpppp_t) \ - GO(XIfEvent, iFpppp_t) \ - GO(XPeekIfEvent, iFpppp_t) \ - GO(XQueryExtension, iFppppp_t) \ - GO(XRegisterIMInstantiateCallback, iFpppppp_t) \ - GO(XUnregisterIMInstantiateCallback, iFpppppp_t) \ - GO(XGetImage, pFppiiuuLi_t) \ - GO(XPutImage, iFppppiiiiuu_t) \ - GO(XCreateImage, pFppuiipuuii_t) \ - GO(XGetSubImage, pFppiiuuuipii_t) - -#endif // __wrappedlibx11TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibx11undefs.h b/src/wrapped/generated/wrappedlibx11undefs.h deleted file mode 100644 index 4fe5929..0000000 --- a/src/wrapped/generated/wrappedlibx11undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibx11UNDEFS_H_ -#define __wrappedlibx11UNDEFS_H_ - - -#endif // __wrappedlibx11UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibx11xcbdefs.h b/src/wrapped/generated/wrappedlibx11xcbdefs.h deleted file mode 100644 index ffa5c2d..0000000 --- a/src/wrapped/generated/wrappedlibx11xcbdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibx11xcbDEFS_H_ -#define __wrappedlibx11xcbDEFS_H_ - - -#endif // __wrappedlibx11xcbDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibx11xcbtypes.h b/src/wrapped/generated/wrappedlibx11xcbtypes.h deleted file mode 100644 index 0e534c6..0000000 --- a/src/wrapped/generated/wrappedlibx11xcbtypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibx11xcbTYPES_H_ -#define __wrappedlibx11xcbTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(XGetXCBConnection, pFp_t) - -#endif // __wrappedlibx11xcbTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibx11xcbundefs.h b/src/wrapped/generated/wrappedlibx11xcbundefs.h deleted file mode 100644 index ed02c59..0000000 --- a/src/wrapped/generated/wrappedlibx11xcbundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibx11xcbUNDEFS_H_ -#define __wrappedlibx11xcbUNDEFS_H_ - - -#endif // __wrappedlibx11xcbUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxaudefs.h b/src/wrapped/generated/wrappedlibxaudefs.h deleted file mode 100644 index 293e448..0000000 --- a/src/wrapped/generated/wrappedlibxaudefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxauDEFS_H_ -#define __wrappedlibxauDEFS_H_ - - -#endif // __wrappedlibxauDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxautypes.h b/src/wrapped/generated/wrappedlibxautypes.h deleted file mode 100644 index a19e2da..0000000 --- a/src/wrapped/generated/wrappedlibxautypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxauTYPES_H_ -#define __wrappedlibxauTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxauTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxauundefs.h b/src/wrapped/generated/wrappedlibxauundefs.h deleted file mode 100644 index 27c78c6..0000000 --- a/src/wrapped/generated/wrappedlibxauundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxauUNDEFS_H_ -#define __wrappedlibxauUNDEFS_H_ - - -#endif // __wrappedlibxauUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbcursordefs.h b/src/wrapped/generated/wrappedlibxcbcursordefs.h deleted file mode 100644 index 7db154a..0000000 --- a/src/wrapped/generated/wrappedlibxcbcursordefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbcursorDEFS_H_ -#define __wrappedlibxcbcursorDEFS_H_ - - -#endif // __wrappedlibxcbcursorDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbcursortypes.h b/src/wrapped/generated/wrappedlibxcbcursortypes.h deleted file mode 100644 index e2dfedd..0000000 --- a/src/wrapped/generated/wrappedlibxcbcursortypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbcursorTYPES_H_ -#define __wrappedlibxcbcursorTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbcursorTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbcursorundefs.h b/src/wrapped/generated/wrappedlibxcbcursorundefs.h deleted file mode 100644 index d85e57f..0000000 --- a/src/wrapped/generated/wrappedlibxcbcursorundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbcursorUNDEFS_H_ -#define __wrappedlibxcbcursorUNDEFS_H_ - - -#endif // __wrappedlibxcbcursorUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbdefs.h b/src/wrapped/generated/wrappedlibxcbdefs.h deleted file mode 100644 index 62930d6..0000000 --- a/src/wrapped/generated/wrappedlibxcbdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbDEFS_H_ -#define __wrappedlibxcbDEFS_H_ - - -#endif // __wrappedlibxcbDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbdri2defs.h b/src/wrapped/generated/wrappedlibxcbdri2defs.h deleted file mode 100644 index a0914c4..0000000 --- a/src/wrapped/generated/wrappedlibxcbdri2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbdri2DEFS_H_ -#define __wrappedlibxcbdri2DEFS_H_ - - -#endif // __wrappedlibxcbdri2DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbdri2types.h b/src/wrapped/generated/wrappedlibxcbdri2types.h deleted file mode 100644 index e483d45..0000000 --- a/src/wrapped/generated/wrappedlibxcbdri2types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbdri2TYPES_H_ -#define __wrappedlibxcbdri2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbdri2TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbdri2undefs.h b/src/wrapped/generated/wrappedlibxcbdri2undefs.h deleted file mode 100644 index 39e96e0..0000000 --- a/src/wrapped/generated/wrappedlibxcbdri2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbdri2UNDEFS_H_ -#define __wrappedlibxcbdri2UNDEFS_H_ - - -#endif // __wrappedlibxcbdri2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbdri3defs.h b/src/wrapped/generated/wrappedlibxcbdri3defs.h deleted file mode 100644 index 2a1d6aa..0000000 --- a/src/wrapped/generated/wrappedlibxcbdri3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbdri3DEFS_H_ -#define __wrappedlibxcbdri3DEFS_H_ - - -#endif // __wrappedlibxcbdri3DEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbdri3types.h b/src/wrapped/generated/wrappedlibxcbdri3types.h deleted file mode 100644 index c392880..0000000 --- a/src/wrapped/generated/wrappedlibxcbdri3types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbdri3TYPES_H_ -#define __wrappedlibxcbdri3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbdri3TYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbdri3undefs.h b/src/wrapped/generated/wrappedlibxcbdri3undefs.h deleted file mode 100644 index f28e6db..0000000 --- a/src/wrapped/generated/wrappedlibxcbdri3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbdri3UNDEFS_H_ -#define __wrappedlibxcbdri3UNDEFS_H_ - - -#endif // __wrappedlibxcbdri3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbglxdefs.h b/src/wrapped/generated/wrappedlibxcbglxdefs.h deleted file mode 100644 index 892bafe..0000000 --- a/src/wrapped/generated/wrappedlibxcbglxdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbglxDEFS_H_ -#define __wrappedlibxcbglxDEFS_H_ - - -#endif // __wrappedlibxcbglxDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbglxtypes.h b/src/wrapped/generated/wrappedlibxcbglxtypes.h deleted file mode 100644 index fba2309..0000000 --- a/src/wrapped/generated/wrappedlibxcbglxtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbglxTYPES_H_ -#define __wrappedlibxcbglxTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbglxTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbglxundefs.h b/src/wrapped/generated/wrappedlibxcbglxundefs.h deleted file mode 100644 index 03aa022..0000000 --- a/src/wrapped/generated/wrappedlibxcbglxundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbglxUNDEFS_H_ -#define __wrappedlibxcbglxUNDEFS_H_ - - -#endif // __wrappedlibxcbglxUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbicccmdefs.h b/src/wrapped/generated/wrappedlibxcbicccmdefs.h deleted file mode 100644 index 553bf71..0000000 --- a/src/wrapped/generated/wrappedlibxcbicccmdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbicccmDEFS_H_ -#define __wrappedlibxcbicccmDEFS_H_ - - -#endif // __wrappedlibxcbicccmDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbicccmtypes.h b/src/wrapped/generated/wrappedlibxcbicccmtypes.h deleted file mode 100644 index baeff95..0000000 --- a/src/wrapped/generated/wrappedlibxcbicccmtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbicccmTYPES_H_ -#define __wrappedlibxcbicccmTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbicccmTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbicccmundefs.h b/src/wrapped/generated/wrappedlibxcbicccmundefs.h deleted file mode 100644 index 85117de..0000000 --- a/src/wrapped/generated/wrappedlibxcbicccmundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbicccmUNDEFS_H_ -#define __wrappedlibxcbicccmUNDEFS_H_ - - -#endif // __wrappedlibxcbicccmUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbimagedefs.h b/src/wrapped/generated/wrappedlibxcbimagedefs.h deleted file mode 100644 index 851c2f0..0000000 --- a/src/wrapped/generated/wrappedlibxcbimagedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbimageDEFS_H_ -#define __wrappedlibxcbimageDEFS_H_ - - -#endif // __wrappedlibxcbimageDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbimagetypes.h b/src/wrapped/generated/wrappedlibxcbimagetypes.h deleted file mode 100644 index cde1840..0000000 --- a/src/wrapped/generated/wrappedlibxcbimagetypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbimageTYPES_H_ -#define __wrappedlibxcbimageTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbimageTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbimageundefs.h b/src/wrapped/generated/wrappedlibxcbimageundefs.h deleted file mode 100644 index bbcba65..0000000 --- a/src/wrapped/generated/wrappedlibxcbimageundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbimageUNDEFS_H_ -#define __wrappedlibxcbimageUNDEFS_H_ - - -#endif // __wrappedlibxcbimageUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbkeysymsdefs.h b/src/wrapped/generated/wrappedlibxcbkeysymsdefs.h deleted file mode 100644 index dacaad5..0000000 --- a/src/wrapped/generated/wrappedlibxcbkeysymsdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbkeysymsDEFS_H_ -#define __wrappedlibxcbkeysymsDEFS_H_ - - -#endif // __wrappedlibxcbkeysymsDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbkeysymstypes.h b/src/wrapped/generated/wrappedlibxcbkeysymstypes.h deleted file mode 100644 index e2772cc..0000000 --- a/src/wrapped/generated/wrappedlibxcbkeysymstypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbkeysymsTYPES_H_ -#define __wrappedlibxcbkeysymsTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbkeysymsTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbkeysymsundefs.h b/src/wrapped/generated/wrappedlibxcbkeysymsundefs.h deleted file mode 100644 index 28e2aba..0000000 --- a/src/wrapped/generated/wrappedlibxcbkeysymsundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbkeysymsUNDEFS_H_ -#define __wrappedlibxcbkeysymsUNDEFS_H_ - - -#endif // __wrappedlibxcbkeysymsUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbpresentdefs.h b/src/wrapped/generated/wrappedlibxcbpresentdefs.h deleted file mode 100644 index bc8a3af..0000000 --- a/src/wrapped/generated/wrappedlibxcbpresentdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbpresentDEFS_H_ -#define __wrappedlibxcbpresentDEFS_H_ - - -#endif // __wrappedlibxcbpresentDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbpresenttypes.h b/src/wrapped/generated/wrappedlibxcbpresenttypes.h deleted file mode 100644 index 2325075..0000000 --- a/src/wrapped/generated/wrappedlibxcbpresenttypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbpresentTYPES_H_ -#define __wrappedlibxcbpresentTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbpresentTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbpresentundefs.h b/src/wrapped/generated/wrappedlibxcbpresentundefs.h deleted file mode 100644 index 0443c7a..0000000 --- a/src/wrapped/generated/wrappedlibxcbpresentundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbpresentUNDEFS_H_ -#define __wrappedlibxcbpresentUNDEFS_H_ - - -#endif // __wrappedlibxcbpresentUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbrandrdefs.h b/src/wrapped/generated/wrappedlibxcbrandrdefs.h deleted file mode 100644 index 9b44fc0..0000000 --- a/src/wrapped/generated/wrappedlibxcbrandrdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbrandrDEFS_H_ -#define __wrappedlibxcbrandrDEFS_H_ - - -#endif // __wrappedlibxcbrandrDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbrandrtypes.h b/src/wrapped/generated/wrappedlibxcbrandrtypes.h deleted file mode 100644 index dad5eee..0000000 --- a/src/wrapped/generated/wrappedlibxcbrandrtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbrandrTYPES_H_ -#define __wrappedlibxcbrandrTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbrandrTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbrandrundefs.h b/src/wrapped/generated/wrappedlibxcbrandrundefs.h deleted file mode 100644 index 5c32936..0000000 --- a/src/wrapped/generated/wrappedlibxcbrandrundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbrandrUNDEFS_H_ -#define __wrappedlibxcbrandrUNDEFS_H_ - - -#endif // __wrappedlibxcbrandrUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbrenderdefs.h b/src/wrapped/generated/wrappedlibxcbrenderdefs.h deleted file mode 100644 index da0f873..0000000 --- a/src/wrapped/generated/wrappedlibxcbrenderdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbrenderDEFS_H_ -#define __wrappedlibxcbrenderDEFS_H_ - - -#endif // __wrappedlibxcbrenderDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbrendertypes.h b/src/wrapped/generated/wrappedlibxcbrendertypes.h deleted file mode 100644 index 750fd61..0000000 --- a/src/wrapped/generated/wrappedlibxcbrendertypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbrenderTYPES_H_ -#define __wrappedlibxcbrenderTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbrenderTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbrenderundefs.h b/src/wrapped/generated/wrappedlibxcbrenderundefs.h deleted file mode 100644 index 2a14ad1..0000000 --- a/src/wrapped/generated/wrappedlibxcbrenderundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbrenderUNDEFS_H_ -#define __wrappedlibxcbrenderUNDEFS_H_ - - -#endif // __wrappedlibxcbrenderUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbrenderutildefs.h b/src/wrapped/generated/wrappedlibxcbrenderutildefs.h deleted file mode 100644 index 5270f1f..0000000 --- a/src/wrapped/generated/wrappedlibxcbrenderutildefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbrenderutilDEFS_H_ -#define __wrappedlibxcbrenderutilDEFS_H_ - - -#endif // __wrappedlibxcbrenderutilDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbrenderutiltypes.h b/src/wrapped/generated/wrappedlibxcbrenderutiltypes.h deleted file mode 100644 index 2ce0dd8..0000000 --- a/src/wrapped/generated/wrappedlibxcbrenderutiltypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbrenderutilTYPES_H_ -#define __wrappedlibxcbrenderutilTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbrenderutilTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbrenderutilundefs.h b/src/wrapped/generated/wrappedlibxcbrenderutilundefs.h deleted file mode 100644 index 3b55616..0000000 --- a/src/wrapped/generated/wrappedlibxcbrenderutilundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbrenderutilUNDEFS_H_ -#define __wrappedlibxcbrenderutilUNDEFS_H_ - - -#endif // __wrappedlibxcbrenderutilUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbshapedefs.h b/src/wrapped/generated/wrappedlibxcbshapedefs.h deleted file mode 100644 index 23f5ccb..0000000 --- a/src/wrapped/generated/wrappedlibxcbshapedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbshapeDEFS_H_ -#define __wrappedlibxcbshapeDEFS_H_ - - -#endif // __wrappedlibxcbshapeDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbshapetypes.h b/src/wrapped/generated/wrappedlibxcbshapetypes.h deleted file mode 100644 index c794e0b..0000000 --- a/src/wrapped/generated/wrappedlibxcbshapetypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbshapeTYPES_H_ -#define __wrappedlibxcbshapeTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbshapeTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbshapeundefs.h b/src/wrapped/generated/wrappedlibxcbshapeundefs.h deleted file mode 100644 index 1ec642f..0000000 --- a/src/wrapped/generated/wrappedlibxcbshapeundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbshapeUNDEFS_H_ -#define __wrappedlibxcbshapeUNDEFS_H_ - - -#endif // __wrappedlibxcbshapeUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbshmdefs.h b/src/wrapped/generated/wrappedlibxcbshmdefs.h deleted file mode 100644 index 584c471..0000000 --- a/src/wrapped/generated/wrappedlibxcbshmdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbshmDEFS_H_ -#define __wrappedlibxcbshmDEFS_H_ - - -#endif // __wrappedlibxcbshmDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbshmtypes.h b/src/wrapped/generated/wrappedlibxcbshmtypes.h deleted file mode 100644 index 82a85b4..0000000 --- a/src/wrapped/generated/wrappedlibxcbshmtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbshmTYPES_H_ -#define __wrappedlibxcbshmTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbshmTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbshmundefs.h b/src/wrapped/generated/wrappedlibxcbshmundefs.h deleted file mode 100644 index eccdb49..0000000 --- a/src/wrapped/generated/wrappedlibxcbshmundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbshmUNDEFS_H_ -#define __wrappedlibxcbshmUNDEFS_H_ - - -#endif // __wrappedlibxcbshmUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbsyncdefs.h b/src/wrapped/generated/wrappedlibxcbsyncdefs.h deleted file mode 100644 index 91787f3..0000000 --- a/src/wrapped/generated/wrappedlibxcbsyncdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbsyncDEFS_H_ -#define __wrappedlibxcbsyncDEFS_H_ - - -#endif // __wrappedlibxcbsyncDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbsynctypes.h b/src/wrapped/generated/wrappedlibxcbsynctypes.h deleted file mode 100644 index ef4d544..0000000 --- a/src/wrapped/generated/wrappedlibxcbsynctypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbsyncTYPES_H_ -#define __wrappedlibxcbsyncTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbsyncTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbsyncundefs.h b/src/wrapped/generated/wrappedlibxcbsyncundefs.h deleted file mode 100644 index 14b58ac..0000000 --- a/src/wrapped/generated/wrappedlibxcbsyncundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbsyncUNDEFS_H_ -#define __wrappedlibxcbsyncUNDEFS_H_ - - -#endif // __wrappedlibxcbsyncUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbtypes.h b/src/wrapped/generated/wrappedlibxcbtypes.h deleted file mode 100644 index 61e03f2..0000000 --- a/src/wrapped/generated/wrappedlibxcbtypes.h +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbTYPES_H_ -#define __wrappedlibxcbTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef void* (*pFpp_t)(void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(xcb_disconnect, vFp_t) \ - GO(xcb_connect, pFpp_t) - -#endif // __wrappedlibxcbTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbundefs.h b/src/wrapped/generated/wrappedlibxcbundefs.h deleted file mode 100644 index 679ee16..0000000 --- a/src/wrapped/generated/wrappedlibxcbundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbUNDEFS_H_ -#define __wrappedlibxcbUNDEFS_H_ - - -#endif // __wrappedlibxcbUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbutildefs.h b/src/wrapped/generated/wrappedlibxcbutildefs.h deleted file mode 100644 index 5eaeeaa..0000000 --- a/src/wrapped/generated/wrappedlibxcbutildefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbutilDEFS_H_ -#define __wrappedlibxcbutilDEFS_H_ - - -#endif // __wrappedlibxcbutilDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbutiltypes.h b/src/wrapped/generated/wrappedlibxcbutiltypes.h deleted file mode 100644 index 5d9e643..0000000 --- a/src/wrapped/generated/wrappedlibxcbutiltypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbutilTYPES_H_ -#define __wrappedlibxcbutilTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbutilTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbutilundefs.h b/src/wrapped/generated/wrappedlibxcbutilundefs.h deleted file mode 100644 index d1776c6..0000000 --- a/src/wrapped/generated/wrappedlibxcbutilundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbutilUNDEFS_H_ -#define __wrappedlibxcbutilUNDEFS_H_ - - -#endif // __wrappedlibxcbutilUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxfixesdefs.h b/src/wrapped/generated/wrappedlibxcbxfixesdefs.h deleted file mode 100644 index 580a33e..0000000 --- a/src/wrapped/generated/wrappedlibxcbxfixesdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxfixesDEFS_H_ -#define __wrappedlibxcbxfixesDEFS_H_ - - -#endif // __wrappedlibxcbxfixesDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxfixestypes.h b/src/wrapped/generated/wrappedlibxcbxfixestypes.h deleted file mode 100644 index 4bcc978..0000000 --- a/src/wrapped/generated/wrappedlibxcbxfixestypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxfixesTYPES_H_ -#define __wrappedlibxcbxfixesTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbxfixesTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxfixesundefs.h b/src/wrapped/generated/wrappedlibxcbxfixesundefs.h deleted file mode 100644 index 9976a68..0000000 --- a/src/wrapped/generated/wrappedlibxcbxfixesundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxfixesUNDEFS_H_ -#define __wrappedlibxcbxfixesUNDEFS_H_ - - -#endif // __wrappedlibxcbxfixesUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxineramadefs.h b/src/wrapped/generated/wrappedlibxcbxineramadefs.h deleted file mode 100644 index ad27310..0000000 --- a/src/wrapped/generated/wrappedlibxcbxineramadefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxineramaDEFS_H_ -#define __wrappedlibxcbxineramaDEFS_H_ - - -#endif // __wrappedlibxcbxineramaDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxineramatypes.h b/src/wrapped/generated/wrappedlibxcbxineramatypes.h deleted file mode 100644 index 98d9667..0000000 --- a/src/wrapped/generated/wrappedlibxcbxineramatypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxineramaTYPES_H_ -#define __wrappedlibxcbxineramaTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbxineramaTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxineramaundefs.h b/src/wrapped/generated/wrappedlibxcbxineramaundefs.h deleted file mode 100644 index 70103e1..0000000 --- a/src/wrapped/generated/wrappedlibxcbxineramaundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxineramaUNDEFS_H_ -#define __wrappedlibxcbxineramaUNDEFS_H_ - - -#endif // __wrappedlibxcbxineramaUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxinputdefs.h b/src/wrapped/generated/wrappedlibxcbxinputdefs.h deleted file mode 100644 index 0811efb..0000000 --- a/src/wrapped/generated/wrappedlibxcbxinputdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxinputDEFS_H_ -#define __wrappedlibxcbxinputDEFS_H_ - - -#endif // __wrappedlibxcbxinputDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxinputtypes.h b/src/wrapped/generated/wrappedlibxcbxinputtypes.h deleted file mode 100644 index 366fe68..0000000 --- a/src/wrapped/generated/wrappedlibxcbxinputtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxinputTYPES_H_ -#define __wrappedlibxcbxinputTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbxinputTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxinputundefs.h b/src/wrapped/generated/wrappedlibxcbxinputundefs.h deleted file mode 100644 index 8e638af..0000000 --- a/src/wrapped/generated/wrappedlibxcbxinputundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxinputUNDEFS_H_ -#define __wrappedlibxcbxinputUNDEFS_H_ - - -#endif // __wrappedlibxcbxinputUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxkbdefs.h b/src/wrapped/generated/wrappedlibxcbxkbdefs.h deleted file mode 100644 index 21f98e2..0000000 --- a/src/wrapped/generated/wrappedlibxcbxkbdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxkbDEFS_H_ -#define __wrappedlibxcbxkbDEFS_H_ - - -#endif // __wrappedlibxcbxkbDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxkbtypes.h b/src/wrapped/generated/wrappedlibxcbxkbtypes.h deleted file mode 100644 index cb2f33b..0000000 --- a/src/wrapped/generated/wrappedlibxcbxkbtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxkbTYPES_H_ -#define __wrappedlibxcbxkbTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbxkbTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxkbundefs.h b/src/wrapped/generated/wrappedlibxcbxkbundefs.h deleted file mode 100644 index 7fa787a..0000000 --- a/src/wrapped/generated/wrappedlibxcbxkbundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxkbUNDEFS_H_ -#define __wrappedlibxcbxkbUNDEFS_H_ - - -#endif // __wrappedlibxcbxkbUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxtestdefs.h b/src/wrapped/generated/wrappedlibxcbxtestdefs.h deleted file mode 100644 index a68e8d8..0000000 --- a/src/wrapped/generated/wrappedlibxcbxtestdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxtestDEFS_H_ -#define __wrappedlibxcbxtestDEFS_H_ - - -#endif // __wrappedlibxcbxtestDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxtesttypes.h b/src/wrapped/generated/wrappedlibxcbxtesttypes.h deleted file mode 100644 index 3583dd7..0000000 --- a/src/wrapped/generated/wrappedlibxcbxtesttypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxtestTYPES_H_ -#define __wrappedlibxcbxtestTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcbxtestTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcbxtestundefs.h b/src/wrapped/generated/wrappedlibxcbxtestundefs.h deleted file mode 100644 index 552c01a..0000000 --- a/src/wrapped/generated/wrappedlibxcbxtestundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcbxtestUNDEFS_H_ -#define __wrappedlibxcbxtestUNDEFS_H_ - - -#endif // __wrappedlibxcbxtestUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcompositedefs.h b/src/wrapped/generated/wrappedlibxcompositedefs.h deleted file mode 100644 index 4228a44..0000000 --- a/src/wrapped/generated/wrappedlibxcompositedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcompositeDEFS_H_ -#define __wrappedlibxcompositeDEFS_H_ - - -#endif // __wrappedlibxcompositeDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcompositetypes.h b/src/wrapped/generated/wrappedlibxcompositetypes.h deleted file mode 100644 index 0cda0e1..0000000 --- a/src/wrapped/generated/wrappedlibxcompositetypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcompositeTYPES_H_ -#define __wrappedlibxcompositeTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcompositeTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcompositeundefs.h b/src/wrapped/generated/wrappedlibxcompositeundefs.h deleted file mode 100644 index 98be8e6..0000000 --- a/src/wrapped/generated/wrappedlibxcompositeundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcompositeUNDEFS_H_ -#define __wrappedlibxcompositeUNDEFS_H_ - - -#endif // __wrappedlibxcompositeUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcursordefs.h b/src/wrapped/generated/wrappedlibxcursordefs.h deleted file mode 100644 index 1394578..0000000 --- a/src/wrapped/generated/wrappedlibxcursordefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcursorDEFS_H_ -#define __wrappedlibxcursorDEFS_H_ - - -#endif // __wrappedlibxcursorDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxcursortypes.h b/src/wrapped/generated/wrappedlibxcursortypes.h deleted file mode 100644 index cb21afd..0000000 --- a/src/wrapped/generated/wrappedlibxcursortypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcursorTYPES_H_ -#define __wrappedlibxcursorTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxcursorTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxcursorundefs.h b/src/wrapped/generated/wrappedlibxcursorundefs.h deleted file mode 100644 index e64c250..0000000 --- a/src/wrapped/generated/wrappedlibxcursorundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxcursorUNDEFS_H_ -#define __wrappedlibxcursorUNDEFS_H_ - - -#endif // __wrappedlibxcursorUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxdamagedefs.h b/src/wrapped/generated/wrappedlibxdamagedefs.h deleted file mode 100644 index f9ffdd4..0000000 --- a/src/wrapped/generated/wrappedlibxdamagedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxdamageDEFS_H_ -#define __wrappedlibxdamageDEFS_H_ - - -#endif // __wrappedlibxdamageDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxdamagetypes.h b/src/wrapped/generated/wrappedlibxdamagetypes.h deleted file mode 100644 index 4aa79cf..0000000 --- a/src/wrapped/generated/wrappedlibxdamagetypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxdamageTYPES_H_ -#define __wrappedlibxdamageTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxdamageTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxdamageundefs.h b/src/wrapped/generated/wrappedlibxdamageundefs.h deleted file mode 100644 index 3a0c70e..0000000 --- a/src/wrapped/generated/wrappedlibxdamageundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxdamageUNDEFS_H_ -#define __wrappedlibxdamageUNDEFS_H_ - - -#endif // __wrappedlibxdamageUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxdmcpdefs.h b/src/wrapped/generated/wrappedlibxdmcpdefs.h deleted file mode 100644 index df3bff9..0000000 --- a/src/wrapped/generated/wrappedlibxdmcpdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxdmcpDEFS_H_ -#define __wrappedlibxdmcpDEFS_H_ - - -#endif // __wrappedlibxdmcpDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxdmcptypes.h b/src/wrapped/generated/wrappedlibxdmcptypes.h deleted file mode 100644 index fec3d45..0000000 --- a/src/wrapped/generated/wrappedlibxdmcptypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxdmcpTYPES_H_ -#define __wrappedlibxdmcpTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxdmcpTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxdmcpundefs.h b/src/wrapped/generated/wrappedlibxdmcpundefs.h deleted file mode 100644 index 9158ebe..0000000 --- a/src/wrapped/generated/wrappedlibxdmcpundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxdmcpUNDEFS_H_ -#define __wrappedlibxdmcpUNDEFS_H_ - - -#endif // __wrappedlibxdmcpUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxextdefs.h b/src/wrapped/generated/wrappedlibxextdefs.h deleted file mode 100644 index f10ce9b..0000000 --- a/src/wrapped/generated/wrappedlibxextdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxextDEFS_H_ -#define __wrappedlibxextDEFS_H_ - - -#endif // __wrappedlibxextDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxexttypes.h b/src/wrapped/generated/wrappedlibxexttypes.h deleted file mode 100644 index 75f71c1..0000000 --- a/src/wrapped/generated/wrappedlibxexttypes.h +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxextTYPES_H_ -#define __wrappedlibxextTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); -typedef int32_t (*iFpppiiu_t)(void*, void*, void*, int32_t, int32_t, uint32_t); -typedef void* (*pFppppip_t)(void*, void*, void*, void*, int32_t, void*); -typedef void* (*pFppuippuu_t)(void*, void*, uint32_t, int32_t, void*, void*, uint32_t, uint32_t); -typedef int32_t (*iFppppiiiiuui_t)(void*, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(XSetExtensionErrorHandler, pFp_t) \ - GO(XShmGetImage, iFpppiiu_t) \ - GO(XextAddDisplay, pFppppip_t) \ - GO(XShmCreateImage, pFppuippuu_t) \ - GO(XShmPutImage, iFppppiiiiuui_t) - -#endif // __wrappedlibxextTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxextundefs.h b/src/wrapped/generated/wrappedlibxextundefs.h deleted file mode 100644 index f80c8e0..0000000 --- a/src/wrapped/generated/wrappedlibxextundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxextUNDEFS_H_ -#define __wrappedlibxextUNDEFS_H_ - - -#endif // __wrappedlibxextUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxfixesdefs.h b/src/wrapped/generated/wrappedlibxfixesdefs.h deleted file mode 100644 index 71736ae..0000000 --- a/src/wrapped/generated/wrappedlibxfixesdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxfixesDEFS_H_ -#define __wrappedlibxfixesDEFS_H_ - - -#endif // __wrappedlibxfixesDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxfixestypes.h b/src/wrapped/generated/wrappedlibxfixestypes.h deleted file mode 100644 index 38ebb61..0000000 --- a/src/wrapped/generated/wrappedlibxfixestypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxfixesTYPES_H_ -#define __wrappedlibxfixesTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxfixesTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxfixesundefs.h b/src/wrapped/generated/wrappedlibxfixesundefs.h deleted file mode 100644 index a6c3372..0000000 --- a/src/wrapped/generated/wrappedlibxfixesundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxfixesUNDEFS_H_ -#define __wrappedlibxfixesUNDEFS_H_ - - -#endif // __wrappedlibxfixesUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxftdefs.h b/src/wrapped/generated/wrappedlibxftdefs.h deleted file mode 100644 index bce3a59..0000000 --- a/src/wrapped/generated/wrappedlibxftdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxftDEFS_H_ -#define __wrappedlibxftDEFS_H_ - - -#endif // __wrappedlibxftDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxfttypes.h b/src/wrapped/generated/wrappedlibxfttypes.h deleted file mode 100644 index f2a1391..0000000 --- a/src/wrapped/generated/wrappedlibxfttypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxftTYPES_H_ -#define __wrappedlibxftTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxftTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxftundefs.h b/src/wrapped/generated/wrappedlibxftundefs.h deleted file mode 100644 index 04b418c..0000000 --- a/src/wrapped/generated/wrappedlibxftundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxftUNDEFS_H_ -#define __wrappedlibxftUNDEFS_H_ - - -#endif // __wrappedlibxftUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxidefs.h b/src/wrapped/generated/wrappedlibxidefs.h deleted file mode 100644 index 685eb51..0000000 --- a/src/wrapped/generated/wrappedlibxidefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxiDEFS_H_ -#define __wrappedlibxiDEFS_H_ - - -#endif // __wrappedlibxiDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxitypes.h b/src/wrapped/generated/wrappedlibxitypes.h deleted file mode 100644 index fc4bcdd..0000000 --- a/src/wrapped/generated/wrappedlibxitypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxiTYPES_H_ -#define __wrappedlibxiTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxiTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxiundefs.h b/src/wrapped/generated/wrappedlibxiundefs.h deleted file mode 100644 index 0278ade..0000000 --- a/src/wrapped/generated/wrappedlibxiundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxiUNDEFS_H_ -#define __wrappedlibxiUNDEFS_H_ - - -#endif // __wrappedlibxiUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxmudefs.h b/src/wrapped/generated/wrappedlibxmudefs.h deleted file mode 100644 index 22d0c80..0000000 --- a/src/wrapped/generated/wrappedlibxmudefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxmuDEFS_H_ -#define __wrappedlibxmuDEFS_H_ - - -#endif // __wrappedlibxmuDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxmutypes.h b/src/wrapped/generated/wrappedlibxmutypes.h deleted file mode 100644 index 4661c30..0000000 --- a/src/wrapped/generated/wrappedlibxmutypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxmuTYPES_H_ -#define __wrappedlibxmuTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxmuTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxmuundefs.h b/src/wrapped/generated/wrappedlibxmuundefs.h deleted file mode 100644 index 9539c36..0000000 --- a/src/wrapped/generated/wrappedlibxmuundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxmuUNDEFS_H_ -#define __wrappedlibxmuUNDEFS_H_ - - -#endif // __wrappedlibxmuUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxpmdefs.h b/src/wrapped/generated/wrappedlibxpmdefs.h deleted file mode 100644 index df70f67..0000000 --- a/src/wrapped/generated/wrappedlibxpmdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxpmDEFS_H_ -#define __wrappedlibxpmDEFS_H_ - - -#endif // __wrappedlibxpmDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxpmtypes.h b/src/wrapped/generated/wrappedlibxpmtypes.h deleted file mode 100644 index d2e9f2c..0000000 --- a/src/wrapped/generated/wrappedlibxpmtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxpmTYPES_H_ -#define __wrappedlibxpmTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxpmTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxpmundefs.h b/src/wrapped/generated/wrappedlibxpmundefs.h deleted file mode 100644 index 895939f..0000000 --- a/src/wrapped/generated/wrappedlibxpmundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxpmUNDEFS_H_ -#define __wrappedlibxpmUNDEFS_H_ - - -#endif // __wrappedlibxpmUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxpresentdefs.h b/src/wrapped/generated/wrappedlibxpresentdefs.h deleted file mode 100644 index de65473..0000000 --- a/src/wrapped/generated/wrappedlibxpresentdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxpresentDEFS_H_ -#define __wrappedlibxpresentDEFS_H_ - - -#endif // __wrappedlibxpresentDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxpresenttypes.h b/src/wrapped/generated/wrappedlibxpresenttypes.h deleted file mode 100644 index b5cc524..0000000 --- a/src/wrapped/generated/wrappedlibxpresenttypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxpresentTYPES_H_ -#define __wrappedlibxpresentTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxpresentTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxpresentundefs.h b/src/wrapped/generated/wrappedlibxpresentundefs.h deleted file mode 100644 index c22f099..0000000 --- a/src/wrapped/generated/wrappedlibxpresentundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxpresentUNDEFS_H_ -#define __wrappedlibxpresentUNDEFS_H_ - - -#endif // __wrappedlibxpresentUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxrandrdefs.h b/src/wrapped/generated/wrappedlibxrandrdefs.h deleted file mode 100644 index 1f94ada..0000000 --- a/src/wrapped/generated/wrappedlibxrandrdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxrandrDEFS_H_ -#define __wrappedlibxrandrDEFS_H_ - - -#endif // __wrappedlibxrandrDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxrandrtypes.h b/src/wrapped/generated/wrappedlibxrandrtypes.h deleted file mode 100644 index d50c72f..0000000 --- a/src/wrapped/generated/wrappedlibxrandrtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxrandrTYPES_H_ -#define __wrappedlibxrandrTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxrandrTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxrandrundefs.h b/src/wrapped/generated/wrappedlibxrandrundefs.h deleted file mode 100644 index f353738..0000000 --- a/src/wrapped/generated/wrappedlibxrandrundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxrandrUNDEFS_H_ -#define __wrappedlibxrandrUNDEFS_H_ - - -#endif // __wrappedlibxrandrUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxrenderdefs.h b/src/wrapped/generated/wrappedlibxrenderdefs.h deleted file mode 100644 index d4360e4..0000000 --- a/src/wrapped/generated/wrappedlibxrenderdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxrenderDEFS_H_ -#define __wrappedlibxrenderDEFS_H_ - - -#endif // __wrappedlibxrenderDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxrendertypes.h b/src/wrapped/generated/wrappedlibxrendertypes.h deleted file mode 100644 index 3cc9906..0000000 --- a/src/wrapped/generated/wrappedlibxrendertypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxrenderTYPES_H_ -#define __wrappedlibxrenderTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxrenderTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxrenderundefs.h b/src/wrapped/generated/wrappedlibxrenderundefs.h deleted file mode 100644 index 23a53a4..0000000 --- a/src/wrapped/generated/wrappedlibxrenderundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxrenderUNDEFS_H_ -#define __wrappedlibxrenderUNDEFS_H_ - - -#endif // __wrappedlibxrenderUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxssdefs.h b/src/wrapped/generated/wrappedlibxssdefs.h deleted file mode 100644 index b9eb4ed..0000000 --- a/src/wrapped/generated/wrappedlibxssdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxssDEFS_H_ -#define __wrappedlibxssDEFS_H_ - - -#endif // __wrappedlibxssDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxsstypes.h b/src/wrapped/generated/wrappedlibxsstypes.h deleted file mode 100644 index a7e0e25..0000000 --- a/src/wrapped/generated/wrappedlibxsstypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxssTYPES_H_ -#define __wrappedlibxssTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxssTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxssundefs.h b/src/wrapped/generated/wrappedlibxssundefs.h deleted file mode 100644 index 0fd1e94..0000000 --- a/src/wrapped/generated/wrappedlibxssundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxssUNDEFS_H_ -#define __wrappedlibxssUNDEFS_H_ - - -#endif // __wrappedlibxssUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxtdefs.h b/src/wrapped/generated/wrappedlibxtdefs.h deleted file mode 100644 index 60eff6d..0000000 --- a/src/wrapped/generated/wrappedlibxtdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxtDEFS_H_ -#define __wrappedlibxtDEFS_H_ - - -#endif // __wrappedlibxtDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxtstdefs.h b/src/wrapped/generated/wrappedlibxtstdefs.h deleted file mode 100644 index fa195cb..0000000 --- a/src/wrapped/generated/wrappedlibxtstdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxtstDEFS_H_ -#define __wrappedlibxtstDEFS_H_ - - -#endif // __wrappedlibxtstDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxtsttypes.h b/src/wrapped/generated/wrappedlibxtsttypes.h deleted file mode 100644 index f7cac5a..0000000 --- a/src/wrapped/generated/wrappedlibxtsttypes.h +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxtstTYPES_H_ -#define __wrappedlibxtstTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(XRecordEnableContext, iFpppp_t) \ - GO(XRecordEnableContextAsync, iFpppp_t) - -#endif // __wrappedlibxtstTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxtstundefs.h b/src/wrapped/generated/wrappedlibxtstundefs.h deleted file mode 100644 index 2e5eec4..0000000 --- a/src/wrapped/generated/wrappedlibxtstundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxtstUNDEFS_H_ -#define __wrappedlibxtstUNDEFS_H_ - - -#endif // __wrappedlibxtstUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxttypes.h b/src/wrapped/generated/wrappedlibxttypes.h deleted file mode 100644 index bfa2543..0000000 --- a/src/wrapped/generated/wrappedlibxttypes.h +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxtTYPES_H_ -#define __wrappedlibxtTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpp_t)(void*, void*); -typedef intptr_t (*lFppp_t)(void*, void*, void*); -typedef void (*vFpuipp_t)(void*, uint32_t, int32_t, void*, void*); -typedef intptr_t (*lFpippp_t)(void*, int32_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(XtAppSetErrorHandler, vFpp_t) \ - GO(XtAppSetErrorMsgHandler, vFpp_t) \ - GO(XtAppSetWarningHandler, vFpp_t) \ - GO(XtAppSetWarningMsgHandler, vFpp_t) \ - GO(XtAppAddWorkProc, lFppp_t) \ - GO(XtAddEventHandler, vFpuipp_t) \ - GO(XtAddRawEventHandler, vFpuipp_t) \ - GO(XtAppAddInput, lFpippp_t) - -#endif // __wrappedlibxtTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxtundefs.h b/src/wrapped/generated/wrappedlibxtundefs.h deleted file mode 100644 index 04d8349..0000000 --- a/src/wrapped/generated/wrappedlibxtundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxtUNDEFS_H_ -#define __wrappedlibxtUNDEFS_H_ - - -#endif // __wrappedlibxtUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxxf86vmdefs.h b/src/wrapped/generated/wrappedlibxxf86vmdefs.h deleted file mode 100644 index 04dc513..0000000 --- a/src/wrapped/generated/wrappedlibxxf86vmdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxxf86vmDEFS_H_ -#define __wrappedlibxxf86vmDEFS_H_ - - -#endif // __wrappedlibxxf86vmDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibxxf86vmtypes.h b/src/wrapped/generated/wrappedlibxxf86vmtypes.h deleted file mode 100644 index fb1b4ee..0000000 --- a/src/wrapped/generated/wrappedlibxxf86vmtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxxf86vmTYPES_H_ -#define __wrappedlibxxf86vmTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedlibxxf86vmTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibxxf86vmundefs.h b/src/wrapped/generated/wrappedlibxxf86vmundefs.h deleted file mode 100644 index 836a2db..0000000 --- a/src/wrapped/generated/wrappedlibxxf86vmundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibxxf86vmUNDEFS_H_ -#define __wrappedlibxxf86vmUNDEFS_H_ - - -#endif // __wrappedlibxxf86vmUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibzdefs.h b/src/wrapped/generated/wrappedlibzdefs.h deleted file mode 100644 index 8d486b8..0000000 --- a/src/wrapped/generated/wrappedlibzdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibzDEFS_H_ -#define __wrappedlibzDEFS_H_ - - -#endif // __wrappedlibzDEFS_H_ diff --git a/src/wrapped/generated/wrappedlibztypes.h b/src/wrapped/generated/wrappedlibztypes.h deleted file mode 100644 index 49e8dc9..0000000 --- a/src/wrapped/generated/wrappedlibztypes.h +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibzTYPES_H_ -#define __wrappedlibzTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFp_t)(void*); -typedef int32_t (*iFpi_t)(void*, int32_t); -typedef int32_t (*iFppi_t)(void*, void*, int32_t); -typedef int32_t (*iFpipi_t)(void*, int32_t, void*, int32_t); -typedef int32_t (*iFpippi_t)(void*, int32_t, void*, void*, int32_t); -typedef int32_t (*iFpiiiiipi_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t, void*, int32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(deflateEnd, iFp_t) \ - GO(inflateEnd, iFp_t) \ - GO(inflate, iFpi_t) \ - GO(inflateInit_, iFppi_t) \ - GO(deflateInit_, iFpipi_t) \ - GO(inflateInit2_, iFpipi_t) \ - GO(inflateBackInit_, iFpippi_t) \ - GO(deflateInit2_, iFpiiiiipi_t) - -#endif // __wrappedlibzTYPES_H_ diff --git a/src/wrapped/generated/wrappedlibzundefs.h b/src/wrapped/generated/wrappedlibzundefs.h deleted file mode 100644 index 7270878..0000000 --- a/src/wrapped/generated/wrappedlibzundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlibzUNDEFS_H_ -#define __wrappedlibzUNDEFS_H_ - - -#endif // __wrappedlibzUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedlzmadefs.h b/src/wrapped/generated/wrappedlzmadefs.h deleted file mode 100644 index 7d2830d..0000000 --- a/src/wrapped/generated/wrappedlzmadefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlzmaDEFS_H_ -#define __wrappedlzmaDEFS_H_ - - -#endif // __wrappedlzmaDEFS_H_ diff --git a/src/wrapped/generated/wrappedlzmatypes.h b/src/wrapped/generated/wrappedlzmatypes.h deleted file mode 100644 index da923ef..0000000 --- a/src/wrapped/generated/wrappedlzmatypes.h +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlzmaTYPES_H_ -#define __wrappedlzmaTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef int32_t (*iFpi_t)(void*, int32_t); -typedef int32_t (*iFpU_t)(void*, uint64_t); -typedef int32_t (*iFpp_t)(void*, void*); -typedef int32_t (*iFpui_t)(void*, uint32_t, int32_t); -typedef int32_t (*iFpUi_t)(void*, uint64_t, int32_t); -typedef int32_t (*iFppi_t)(void*, void*, int32_t); -typedef int32_t (*iFpppL_t)(void*, void*, void*, uintptr_t); -typedef int32_t (*iFpppppL_t)(void*, void*, void*, void*, void*, uintptr_t); -typedef int32_t (*iFpupppLppL_t)(void*, uint32_t, void*, void*, void*, uintptr_t, void*, void*, uintptr_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(lzma_end, vFp_t) \ - GO(lzma_index_end, vFpp_t) \ - GO(lzma_code, iFpi_t) \ - GO(lzma_alone_decoder, iFpU_t) \ - GO(lzma_alone_encoder, iFpp_t) \ - GO(lzma_raw_decoder, iFpp_t) \ - GO(lzma_raw_encoder, iFpp_t) \ - GO(lzma_stream_encoder_mt, iFpp_t) \ - GO(lzma_easy_encoder, iFpui_t) \ - GO(lzma_stream_decoder, iFpUi_t) \ - GO(lzma_stream_encoder, iFppi_t) \ - GO(lzma_properties_decode, iFpppL_t) \ - GO(lzma_index_buffer_decode, iFpppppL_t) \ - GO(lzma_stream_buffer_decode, iFpupppLppL_t) - -#endif // __wrappedlzmaTYPES_H_ diff --git a/src/wrapped/generated/wrappedlzmaundefs.h b/src/wrapped/generated/wrappedlzmaundefs.h deleted file mode 100644 index c50459a..0000000 --- a/src/wrapped/generated/wrappedlzmaundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedlzmaUNDEFS_H_ -#define __wrappedlzmaUNDEFS_H_ - - -#endif // __wrappedlzmaUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedmpg123defs.h b/src/wrapped/generated/wrappedmpg123defs.h deleted file mode 100644 index 0a797a1..0000000 --- a/src/wrapped/generated/wrappedmpg123defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedmpg123DEFS_H_ -#define __wrappedmpg123DEFS_H_ - - -#endif // __wrappedmpg123DEFS_H_ diff --git a/src/wrapped/generated/wrappedmpg123types.h b/src/wrapped/generated/wrappedmpg123types.h deleted file mode 100644 index 6f65c02..0000000 --- a/src/wrapped/generated/wrappedmpg123types.h +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedmpg123TYPES_H_ -#define __wrappedmpg123TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(mpg123_replace_reader_handle, iFpppp_t) \ - GO(mpg123_replace_reader_handle_64, iFpppp_t) - -#endif // __wrappedmpg123TYPES_H_ diff --git a/src/wrapped/generated/wrappedmpg123undefs.h b/src/wrapped/generated/wrappedmpg123undefs.h deleted file mode 100644 index f243812..0000000 --- a/src/wrapped/generated/wrappedmpg123undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedmpg123UNDEFS_H_ -#define __wrappedmpg123UNDEFS_H_ - - -#endif // __wrappedmpg123UNDEFS_H_ diff --git a/src/wrapped/generated/wrappednotifydefs.h b/src/wrapped/generated/wrappednotifydefs.h deleted file mode 100644 index 57f9994..0000000 --- a/src/wrapped/generated/wrappednotifydefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednotifyDEFS_H_ -#define __wrappednotifyDEFS_H_ - - -#endif // __wrappednotifyDEFS_H_ diff --git a/src/wrapped/generated/wrappednotifytypes.h b/src/wrapped/generated/wrappednotifytypes.h deleted file mode 100644 index 4c470cb..0000000 --- a/src/wrapped/generated/wrappednotifytypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednotifyTYPES_H_ -#define __wrappednotifyTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappednotifyTYPES_H_ diff --git a/src/wrapped/generated/wrappednotifyundefs.h b/src/wrapped/generated/wrappednotifyundefs.h deleted file mode 100644 index b9e8eff..0000000 --- a/src/wrapped/generated/wrappednotifyundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednotifyUNDEFS_H_ -#define __wrappednotifyUNDEFS_H_ - - -#endif // __wrappednotifyUNDEFS_H_ diff --git a/src/wrapped/generated/wrappednsldefs.h b/src/wrapped/generated/wrappednsldefs.h deleted file mode 100644 index ba88d8a..0000000 --- a/src/wrapped/generated/wrappednsldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednslDEFS_H_ -#define __wrappednslDEFS_H_ - - -#endif // __wrappednslDEFS_H_ diff --git a/src/wrapped/generated/wrappednsltypes.h b/src/wrapped/generated/wrappednsltypes.h deleted file mode 100644 index 12a6ff9..0000000 --- a/src/wrapped/generated/wrappednsltypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednslTYPES_H_ -#define __wrappednslTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappednslTYPES_H_ diff --git a/src/wrapped/generated/wrappednslundefs.h b/src/wrapped/generated/wrappednslundefs.h deleted file mode 100644 index a0380d7..0000000 --- a/src/wrapped/generated/wrappednslundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednslUNDEFS_H_ -#define __wrappednslUNDEFS_H_ - - -#endif // __wrappednslUNDEFS_H_ diff --git a/src/wrapped/generated/wrappednspr4defs.h b/src/wrapped/generated/wrappednspr4defs.h deleted file mode 100644 index fe8445a..0000000 --- a/src/wrapped/generated/wrappednspr4defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednspr4DEFS_H_ -#define __wrappednspr4DEFS_H_ - - -#endif // __wrappednspr4DEFS_H_ diff --git a/src/wrapped/generated/wrappednspr4types.h b/src/wrapped/generated/wrappednspr4types.h deleted file mode 100644 index d61c83f..0000000 --- a/src/wrapped/generated/wrappednspr4types.h +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednspr4TYPES_H_ -#define __wrappednspr4TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFpp_t)(void*, void*); -typedef int32_t (*iFppp_t)(void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(PR_CallOnce, iFpp_t) \ - GO(PR_CallOnceWithArg, iFppp_t) - -#endif // __wrappednspr4TYPES_H_ diff --git a/src/wrapped/generated/wrappednspr4undefs.h b/src/wrapped/generated/wrappednspr4undefs.h deleted file mode 100644 index 39cb34c..0000000 --- a/src/wrapped/generated/wrappednspr4undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednspr4UNDEFS_H_ -#define __wrappednspr4UNDEFS_H_ - - -#endif // __wrappednspr4UNDEFS_H_ diff --git a/src/wrapped/generated/wrappednss3defs.h b/src/wrapped/generated/wrappednss3defs.h deleted file mode 100644 index 7df348c..0000000 --- a/src/wrapped/generated/wrappednss3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednss3DEFS_H_ -#define __wrappednss3DEFS_H_ - - -#endif // __wrappednss3DEFS_H_ diff --git a/src/wrapped/generated/wrappednss3types.h b/src/wrapped/generated/wrappednss3types.h deleted file mode 100644 index cdc8a87..0000000 --- a/src/wrapped/generated/wrappednss3types.h +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednss3TYPES_H_ -#define __wrappednss3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef int32_t (*iFpp_t)(void*, void*); -typedef int32_t (*iFpIppp_t)(void*, int64_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(PK11_SetPasswordFunc, vFp_t) \ - GO(PORT_SetUCS2_ASCIIConversionFunction, vFp_t) \ - GO(CERT_RegisterAlternateOCSPAIAInfoCallBack, iFpp_t) \ - GO(NSS_RegisterShutdown, iFpp_t) \ - GO(CERT_PKIXVerifyCert, iFpIppp_t) - -#endif // __wrappednss3TYPES_H_ diff --git a/src/wrapped/generated/wrappednss3undefs.h b/src/wrapped/generated/wrappednss3undefs.h deleted file mode 100644 index 19e156e..0000000 --- a/src/wrapped/generated/wrappednss3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednss3UNDEFS_H_ -#define __wrappednss3UNDEFS_H_ - - -#endif // __wrappednss3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappednssutil3defs.h b/src/wrapped/generated/wrappednssutil3defs.h deleted file mode 100644 index bcaf6bc..0000000 --- a/src/wrapped/generated/wrappednssutil3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednssutil3DEFS_H_ -#define __wrappednssutil3DEFS_H_ - - -#endif // __wrappednssutil3DEFS_H_ diff --git a/src/wrapped/generated/wrappednssutil3types.h b/src/wrapped/generated/wrappednssutil3types.h deleted file mode 100644 index 4e0b0e4..0000000 --- a/src/wrapped/generated/wrappednssutil3types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednssutil3TYPES_H_ -#define __wrappednssutil3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappednssutil3TYPES_H_ diff --git a/src/wrapped/generated/wrappednssutil3undefs.h b/src/wrapped/generated/wrappednssutil3undefs.h deleted file mode 100644 index c5d687e..0000000 --- a/src/wrapped/generated/wrappednssutil3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappednssutil3UNDEFS_H_ -#define __wrappednssutil3UNDEFS_H_ - - -#endif // __wrappednssutil3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedopenaldefs.h b/src/wrapped/generated/wrappedopenaldefs.h deleted file mode 100644 index f49934b..0000000 --- a/src/wrapped/generated/wrappedopenaldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedopenalDEFS_H_ -#define __wrappedopenalDEFS_H_ - - -#endif // __wrappedopenalDEFS_H_ diff --git a/src/wrapped/generated/wrappedopenaltypes.h b/src/wrapped/generated/wrappedopenaltypes.h deleted file mode 100644 index 1bd88ca..0000000 --- a/src/wrapped/generated/wrappedopenaltypes.h +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedopenalTYPES_H_ -#define __wrappedopenalTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFv_t)(void); -typedef void* (*pFp_t)(void*); -typedef void* (*pFpp_t)(void*, void*); -typedef void (*vFiiipp_t)(int32_t, int32_t, int32_t, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(alRequestFoldbackStop, vFv_t) \ - GO(alGetProcAddress, pFp_t) \ - GO(alcGetProcAddress, pFpp_t) \ - GO(alRequestFoldbackStart, vFiiipp_t) - -#endif // __wrappedopenalTYPES_H_ diff --git a/src/wrapped/generated/wrappedopenalundefs.h b/src/wrapped/generated/wrappedopenalundefs.h deleted file mode 100644 index 020eec6..0000000 --- a/src/wrapped/generated/wrappedopenalundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedopenalUNDEFS_H_ -#define __wrappedopenalUNDEFS_H_ - - -#endif // __wrappedopenalUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedopencldefs.h b/src/wrapped/generated/wrappedopencldefs.h deleted file mode 100644 index 2536f0f..0000000 --- a/src/wrapped/generated/wrappedopencldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedopenclDEFS_H_ -#define __wrappedopenclDEFS_H_ - - -#endif // __wrappedopenclDEFS_H_ diff --git a/src/wrapped/generated/wrappedopencltypes.h b/src/wrapped/generated/wrappedopencltypes.h deleted file mode 100644 index f631b04..0000000 --- a/src/wrapped/generated/wrappedopencltypes.h +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedopenclTYPES_H_ -#define __wrappedopenclTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFpuppp_t)(void*, uint32_t, void*, void*, void*); -typedef int32_t (*iFpupppp_t)(void*, uint32_t, void*, void*, void*, void*); -typedef void* (*pFpupppp_t)(void*, uint32_t, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(clCreateContextFromType, pFpuppp_t) \ - GO(clBuildProgram, iFpupppp_t) \ - GO(clCreateContext, pFpupppp_t) - -#endif // __wrappedopenclTYPES_H_ diff --git a/src/wrapped/generated/wrappedopenclundefs.h b/src/wrapped/generated/wrappedopenclundefs.h deleted file mode 100644 index 282406b..0000000 --- a/src/wrapped/generated/wrappedopenclundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedopenclUNDEFS_H_ -#define __wrappedopenclUNDEFS_H_ - - -#endif // __wrappedopenclUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedp11kitdefs.h b/src/wrapped/generated/wrappedp11kitdefs.h deleted file mode 100644 index ec4bd05..0000000 --- a/src/wrapped/generated/wrappedp11kitdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedp11kitDEFS_H_ -#define __wrappedp11kitDEFS_H_ - - -#endif // __wrappedp11kitDEFS_H_ diff --git a/src/wrapped/generated/wrappedp11kittypes.h b/src/wrapped/generated/wrappedp11kittypes.h deleted file mode 100644 index cd22864..0000000 --- a/src/wrapped/generated/wrappedp11kittypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedp11kitTYPES_H_ -#define __wrappedp11kitTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedp11kitTYPES_H_ diff --git a/src/wrapped/generated/wrappedp11kitundefs.h b/src/wrapped/generated/wrappedp11kitundefs.h deleted file mode 100644 index 38b4ca5..0000000 --- a/src/wrapped/generated/wrappedp11kitundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedp11kitUNDEFS_H_ -#define __wrappedp11kitUNDEFS_H_ - - -#endif // __wrappedp11kitUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedpamdefs.h b/src/wrapped/generated/wrappedpamdefs.h deleted file mode 100644 index 31a659b..0000000 --- a/src/wrapped/generated/wrappedpamdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpamDEFS_H_ -#define __wrappedpamDEFS_H_ - - -#endif // __wrappedpamDEFS_H_ diff --git a/src/wrapped/generated/wrappedpamtypes.h b/src/wrapped/generated/wrappedpamtypes.h deleted file mode 100644 index 98b7782..0000000 --- a/src/wrapped/generated/wrappedpamtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpamTYPES_H_ -#define __wrappedpamTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedpamTYPES_H_ diff --git a/src/wrapped/generated/wrappedpamundefs.h b/src/wrapped/generated/wrappedpamundefs.h deleted file mode 100644 index 092a7b6..0000000 --- a/src/wrapped/generated/wrappedpamundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpamUNDEFS_H_ -#define __wrappedpamUNDEFS_H_ - - -#endif // __wrappedpamUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedpangocairodefs.h b/src/wrapped/generated/wrappedpangocairodefs.h deleted file mode 100644 index b552e7f..0000000 --- a/src/wrapped/generated/wrappedpangocairodefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpangocairoDEFS_H_ -#define __wrappedpangocairoDEFS_H_ - - -#endif // __wrappedpangocairoDEFS_H_ diff --git a/src/wrapped/generated/wrappedpangocairotypes.h b/src/wrapped/generated/wrappedpangocairotypes.h deleted file mode 100644 index c2462c1..0000000 --- a/src/wrapped/generated/wrappedpangocairotypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpangocairoTYPES_H_ -#define __wrappedpangocairoTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedpangocairoTYPES_H_ diff --git a/src/wrapped/generated/wrappedpangocairoundefs.h b/src/wrapped/generated/wrappedpangocairoundefs.h deleted file mode 100644 index 40d338a..0000000 --- a/src/wrapped/generated/wrappedpangocairoundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpangocairoUNDEFS_H_ -#define __wrappedpangocairoUNDEFS_H_ - - -#endif // __wrappedpangocairoUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedpangodefs.h b/src/wrapped/generated/wrappedpangodefs.h deleted file mode 100644 index a7e8d0c..0000000 --- a/src/wrapped/generated/wrappedpangodefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpangoDEFS_H_ -#define __wrappedpangoDEFS_H_ - - -#endif // __wrappedpangoDEFS_H_ diff --git a/src/wrapped/generated/wrappedpangoft2defs.h b/src/wrapped/generated/wrappedpangoft2defs.h deleted file mode 100644 index c987b41..0000000 --- a/src/wrapped/generated/wrappedpangoft2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpangoft2DEFS_H_ -#define __wrappedpangoft2DEFS_H_ - - -#endif // __wrappedpangoft2DEFS_H_ diff --git a/src/wrapped/generated/wrappedpangoft2types.h b/src/wrapped/generated/wrappedpangoft2types.h deleted file mode 100644 index 616fc38..0000000 --- a/src/wrapped/generated/wrappedpangoft2types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpangoft2TYPES_H_ -#define __wrappedpangoft2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedpangoft2TYPES_H_ diff --git a/src/wrapped/generated/wrappedpangoft2undefs.h b/src/wrapped/generated/wrappedpangoft2undefs.h deleted file mode 100644 index 941a16a..0000000 --- a/src/wrapped/generated/wrappedpangoft2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpangoft2UNDEFS_H_ -#define __wrappedpangoft2UNDEFS_H_ - - -#endif // __wrappedpangoft2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedpangotypes.h b/src/wrapped/generated/wrappedpangotypes.h deleted file mode 100644 index d874436..0000000 --- a/src/wrapped/generated/wrappedpangotypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpangoTYPES_H_ -#define __wrappedpangoTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpp_t)(void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(pango_attribute_init, vFpp_t) - -#endif // __wrappedpangoTYPES_H_ diff --git a/src/wrapped/generated/wrappedpangoundefs.h b/src/wrapped/generated/wrappedpangoundefs.h deleted file mode 100644 index ffe1118..0000000 --- a/src/wrapped/generated/wrappedpangoundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpangoUNDEFS_H_ -#define __wrappedpangoUNDEFS_H_ - - -#endif // __wrappedpangoUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedplc4defs.h b/src/wrapped/generated/wrappedplc4defs.h deleted file mode 100644 index ba22678..0000000 --- a/src/wrapped/generated/wrappedplc4defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedplc4DEFS_H_ -#define __wrappedplc4DEFS_H_ - - -#endif // __wrappedplc4DEFS_H_ diff --git a/src/wrapped/generated/wrappedplc4types.h b/src/wrapped/generated/wrappedplc4types.h deleted file mode 100644 index 5ca8ff9..0000000 --- a/src/wrapped/generated/wrappedplc4types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedplc4TYPES_H_ -#define __wrappedplc4TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedplc4TYPES_H_ diff --git a/src/wrapped/generated/wrappedplc4undefs.h b/src/wrapped/generated/wrappedplc4undefs.h deleted file mode 100644 index 3da2719..0000000 --- a/src/wrapped/generated/wrappedplc4undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedplc4UNDEFS_H_ -#define __wrappedplc4UNDEFS_H_ - - -#endif // __wrappedplc4UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedplds4defs.h b/src/wrapped/generated/wrappedplds4defs.h deleted file mode 100644 index c062074..0000000 --- a/src/wrapped/generated/wrappedplds4defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedplds4DEFS_H_ -#define __wrappedplds4DEFS_H_ - - -#endif // __wrappedplds4DEFS_H_ diff --git a/src/wrapped/generated/wrappedplds4types.h b/src/wrapped/generated/wrappedplds4types.h deleted file mode 100644 index aaf83eb..0000000 --- a/src/wrapped/generated/wrappedplds4types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedplds4TYPES_H_ -#define __wrappedplds4TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedplds4TYPES_H_ diff --git a/src/wrapped/generated/wrappedplds4undefs.h b/src/wrapped/generated/wrappedplds4undefs.h deleted file mode 100644 index 9d0868f..0000000 --- a/src/wrapped/generated/wrappedplds4undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedplds4UNDEFS_H_ -#define __wrappedplds4UNDEFS_H_ - - -#endif // __wrappedplds4UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedpng16defs.h b/src/wrapped/generated/wrappedpng16defs.h deleted file mode 100644 index 11d1e26..0000000 --- a/src/wrapped/generated/wrappedpng16defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpng16DEFS_H_ -#define __wrappedpng16DEFS_H_ - - -#endif // __wrappedpng16DEFS_H_ diff --git a/src/wrapped/generated/wrappedpng16types.h b/src/wrapped/generated/wrappedpng16types.h deleted file mode 100644 index 367c19e..0000000 --- a/src/wrapped/generated/wrappedpng16types.h +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpng16TYPES_H_ -#define __wrappedpng16TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpp_t)(void*, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef void* (*pFpppp_t)(void*, void*, void*, void*); -typedef void (*vFppppp_t)(void*, void*, void*, void*, void*); -typedef void* (*pFppppppp_t)(void*, void*, void*, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(png_set_read_user_transform_fn, vFpp_t) \ - GO(png_set_read_fn, vFppp_t) \ - GO(png_set_error_fn, vFpppp_t) \ - GO(png_set_write_fn, vFpppp_t) \ - GO(png_create_read_struct, pFpppp_t) \ - GO(png_set_progressive_read_fn, vFppppp_t) \ - GO(png_create_read_struct_2, pFppppppp_t) \ - GO(png_create_write_struct_2, pFppppppp_t) - -#endif // __wrappedpng16TYPES_H_ diff --git a/src/wrapped/generated/wrappedpng16undefs.h b/src/wrapped/generated/wrappedpng16undefs.h deleted file mode 100644 index bbe2124..0000000 --- a/src/wrapped/generated/wrappedpng16undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpng16UNDEFS_H_ -#define __wrappedpng16UNDEFS_H_ - - -#endif // __wrappedpng16UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedpsl5defs.h b/src/wrapped/generated/wrappedpsl5defs.h deleted file mode 100644 index 274c347..0000000 --- a/src/wrapped/generated/wrappedpsl5defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpsl5DEFS_H_ -#define __wrappedpsl5DEFS_H_ - - -#endif // __wrappedpsl5DEFS_H_ diff --git a/src/wrapped/generated/wrappedpsl5types.h b/src/wrapped/generated/wrappedpsl5types.h deleted file mode 100644 index 44310fa..0000000 --- a/src/wrapped/generated/wrappedpsl5types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpsl5TYPES_H_ -#define __wrappedpsl5TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedpsl5TYPES_H_ diff --git a/src/wrapped/generated/wrappedpsl5undefs.h b/src/wrapped/generated/wrappedpsl5undefs.h deleted file mode 100644 index 0db6f2e..0000000 --- a/src/wrapped/generated/wrappedpsl5undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpsl5UNDEFS_H_ -#define __wrappedpsl5UNDEFS_H_ - - -#endif // __wrappedpsl5UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedpulsedefs.h b/src/wrapped/generated/wrappedpulsedefs.h deleted file mode 100644 index 1562e31..0000000 --- a/src/wrapped/generated/wrappedpulsedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpulseDEFS_H_ -#define __wrappedpulseDEFS_H_ - - -#endif // __wrappedpulseDEFS_H_ diff --git a/src/wrapped/generated/wrappedpulsemainloopglibdefs.h b/src/wrapped/generated/wrappedpulsemainloopglibdefs.h deleted file mode 100644 index 41195f9..0000000 --- a/src/wrapped/generated/wrappedpulsemainloopglibdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpulsemainloopglibDEFS_H_ -#define __wrappedpulsemainloopglibDEFS_H_ - - -#endif // __wrappedpulsemainloopglibDEFS_H_ diff --git a/src/wrapped/generated/wrappedpulsemainloopglibtypes.h b/src/wrapped/generated/wrappedpulsemainloopglibtypes.h deleted file mode 100644 index f5d96cf..0000000 --- a/src/wrapped/generated/wrappedpulsemainloopglibtypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpulsemainloopglibTYPES_H_ -#define __wrappedpulsemainloopglibTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(pa_glib_mainloop_get_api, pFp_t) - -#endif // __wrappedpulsemainloopglibTYPES_H_ diff --git a/src/wrapped/generated/wrappedpulsemainloopglibundefs.h b/src/wrapped/generated/wrappedpulsemainloopglibundefs.h deleted file mode 100644 index d70aa31..0000000 --- a/src/wrapped/generated/wrappedpulsemainloopglibundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpulsemainloopglibUNDEFS_H_ -#define __wrappedpulsemainloopglibUNDEFS_H_ - - -#endif // __wrappedpulsemainloopglibUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedpulsesimpledefs.h b/src/wrapped/generated/wrappedpulsesimpledefs.h deleted file mode 100644 index 30e5fbe..0000000 --- a/src/wrapped/generated/wrappedpulsesimpledefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpulsesimpleDEFS_H_ -#define __wrappedpulsesimpleDEFS_H_ - - -#endif // __wrappedpulsesimpleDEFS_H_ diff --git a/src/wrapped/generated/wrappedpulsesimpletypes.h b/src/wrapped/generated/wrappedpulsesimpletypes.h deleted file mode 100644 index 2a46385..0000000 --- a/src/wrapped/generated/wrappedpulsesimpletypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpulsesimpleTYPES_H_ -#define __wrappedpulsesimpleTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedpulsesimpleTYPES_H_ diff --git a/src/wrapped/generated/wrappedpulsesimpleundefs.h b/src/wrapped/generated/wrappedpulsesimpleundefs.h deleted file mode 100644 index 0361423..0000000 --- a/src/wrapped/generated/wrappedpulsesimpleundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpulsesimpleUNDEFS_H_ -#define __wrappedpulsesimpleUNDEFS_H_ - - -#endif // __wrappedpulsesimpleUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedpulsetypes.h b/src/wrapped/generated/wrappedpulsetypes.h deleted file mode 100644 index e3ed948..0000000 --- a/src/wrapped/generated/wrappedpulsetypes.h +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpulseTYPES_H_ -#define __wrappedpulseTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef int32_t (*iFp_t)(void*); -typedef void* (*pFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef void* (*pFpp_t)(void*, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef void* (*pFipp_t)(int32_t, void*, void*); -typedef void* (*pFppp_t)(void*, void*, void*); -typedef int32_t (*iFppip_t)(void*, void*, int32_t, void*); -typedef int32_t (*iFpppV_t)(void*, void*, void*, ...); -typedef void* (*pFpipp_t)(void*, int32_t, void*, void*); -typedef void* (*pFpupp_t)(void*, uint32_t, void*, void*); -typedef void* (*pFpUpp_t)(void*, uint64_t, void*, void*); -typedef void* (*pFpppp_t)(void*, void*, void*, void*); -typedef void* (*pFpiupp_t)(void*, int32_t, uint32_t, void*, void*); -typedef void* (*pFpippp_t)(void*, int32_t, void*, void*, void*); -typedef void* (*pFpuipp_t)(void*, uint32_t, int32_t, void*, void*); -typedef void* (*pFpuupp_t)(void*, uint32_t, uint32_t, void*, void*); -typedef void* (*pFpuppp_t)(void*, uint32_t, void*, void*, void*); -typedef void* (*pFppppp_t)(void*, void*, void*, void*, void*); -typedef int32_t (*iFppLpIi_t)(void*, void*, uintptr_t, void*, int64_t, int32_t); -typedef void* (*pFpiuCppp_t)(void*, int32_t, uint32_t, uint8_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(pa_mainloop_free, vFp_t) \ - GO(pa_threaded_mainloop_free, vFp_t) \ - GO(pa_signal_init, iFp_t) \ - GO(pa_mainloop_get_api, pFp_t) \ - GO(pa_threaded_mainloop_get_api, pFp_t) \ - GO(pa_signal_set_destroy, vFpp_t) \ - GO(pa_context_new, pFpp_t) \ - GO(pa_context_set_event_callback, vFppp_t) \ - GO(pa_context_set_state_callback, vFppp_t) \ - GO(pa_context_set_subscribe_callback, vFppp_t) \ - GO(pa_mainloop_api_once, vFppp_t) \ - GO(pa_mainloop_set_poll_func, vFppp_t) \ - GO(pa_stream_set_buffer_attr_callback, vFppp_t) \ - GO(pa_stream_set_event_callback, vFppp_t) \ - GO(pa_stream_set_latency_update_callback, vFppp_t) \ - GO(pa_stream_set_moved_callback, vFppp_t) \ - GO(pa_stream_set_overflow_callback, vFppp_t) \ - GO(pa_stream_set_read_callback, vFppp_t) \ - GO(pa_stream_set_started_callback, vFppp_t) \ - GO(pa_stream_set_state_callback, vFppp_t) \ - GO(pa_stream_set_suspended_callback, vFppp_t) \ - GO(pa_stream_set_underflow_callback, vFppp_t) \ - GO(pa_stream_set_write_callback, vFppp_t) \ - GO(pa_signal_new, pFipp_t) \ - GO(pa_context_drain, pFppp_t) \ - GO(pa_context_exit_daemon, pFppp_t) \ - GO(pa_context_get_card_info_list, pFppp_t) \ - GO(pa_context_get_client_info_list, pFppp_t) \ - GO(pa_context_get_module_info_list, pFppp_t) \ - GO(pa_context_get_server_info, pFppp_t) \ - GO(pa_context_get_sink_info_list, pFppp_t) \ - GO(pa_context_get_sink_input_info_list, pFppp_t) \ - GO(pa_context_get_source_info_list, pFppp_t) \ - GO(pa_context_get_source_output_info_list, pFppp_t) \ - GO(pa_context_new_with_proplist, pFppp_t) \ - GO(pa_ext_device_restore_read_formats_all, pFppp_t) \ - GO(pa_ext_device_restore_set_subscribe_cb, pFppp_t) \ - GO(pa_stream_drain, pFppp_t) \ - GO(pa_stream_flush, pFppp_t) \ - GO(pa_stream_prebuf, pFppp_t) \ - GO(pa_stream_trigger, pFppp_t) \ - GO(pa_stream_update_timing_info, pFppp_t) \ - GO(pa_context_connect, iFppip_t) \ - GO(pa_proplist_setf, iFpppV_t) \ - GO(pa_ext_device_restore_subscribe, pFpipp_t) \ - GO(pa_stream_cork, pFpipp_t) \ - GO(pa_context_get_card_info_by_index, pFpupp_t) \ - GO(pa_context_get_client_info, pFpupp_t) \ - GO(pa_context_get_sink_info_by_index, pFpupp_t) \ - GO(pa_context_get_sink_input_info, pFpupp_t) \ - GO(pa_context_get_source_info_by_index, pFpupp_t) \ - GO(pa_context_get_source_output_info, pFpupp_t) \ - GO(pa_context_subscribe, pFpupp_t) \ - GO(pa_context_unload_module, pFpupp_t) \ - GO(pa_stream_update_sample_rate, pFpupp_t) \ - GO(pa_context_rttime_new, pFpUpp_t) \ - GO(pa_context_get_sink_info_by_name, pFpppp_t) \ - GO(pa_context_get_source_info_by_name, pFpppp_t) \ - GO(pa_context_proplist_remove, pFpppp_t) \ - GO(pa_context_set_default_sink, pFpppp_t) \ - GO(pa_context_set_default_source, pFpppp_t) \ - GO(pa_context_set_name, pFpppp_t) \ - GO(pa_stream_proplist_remove, pFpppp_t) \ - GO(pa_stream_set_buffer_attr, pFpppp_t) \ - GO(pa_stream_set_name, pFpppp_t) \ - GO(pa_ext_device_restore_read_formats, pFpiupp_t) \ - GO(pa_context_proplist_update, pFpippp_t) \ - GO(pa_stream_proplist_update, pFpippp_t) \ - GO(pa_context_set_sink_input_mute, pFpuipp_t) \ - GO(pa_context_set_sink_mute_by_index, pFpuipp_t) \ - GO(pa_context_set_source_mute_by_index, pFpuipp_t) \ - GO(pa_context_move_sink_input_by_index, pFpuupp_t) \ - GO(pa_context_move_source_output_by_index, pFpuupp_t) \ - GO(pa_context_set_card_profile_by_index, pFpuppp_t) \ - GO(pa_context_set_sink_input_volume, pFpuppp_t) \ - GO(pa_context_set_sink_port_by_index, pFpuppp_t) \ - GO(pa_context_set_sink_volume_by_index, pFpuppp_t) \ - GO(pa_context_set_source_port_by_index, pFpuppp_t) \ - GO(pa_context_set_source_volume_by_index, pFpuppp_t) \ - GO(pa_context_load_module, pFppppp_t) \ - GO(pa_context_set_sink_port_by_name, pFppppp_t) \ - GO(pa_context_set_source_volume_by_name, pFppppp_t) \ - GO(pa_stream_write, iFppLpIi_t) \ - GO(pa_ext_device_restore_save_formats, pFpiuCppp_t) - -#endif // __wrappedpulseTYPES_H_ diff --git a/src/wrapped/generated/wrappedpulseundefs.h b/src/wrapped/generated/wrappedpulseundefs.h deleted file mode 100644 index 4472c93..0000000 --- a/src/wrapped/generated/wrappedpulseundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedpulseUNDEFS_H_ -#define __wrappedpulseUNDEFS_H_ - - -#endif // __wrappedpulseUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl1defs.h b/src/wrapped/generated/wrappedsdl1defs.h deleted file mode 100644 index a3219d5..0000000 --- a/src/wrapped/generated/wrappedsdl1defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1DEFS_H_ -#define __wrappedsdl1DEFS_H_ - - -#endif // __wrappedsdl1DEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl1imagedefs.h b/src/wrapped/generated/wrappedsdl1imagedefs.h deleted file mode 100644 index e7c9814..0000000 --- a/src/wrapped/generated/wrappedsdl1imagedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1imageDEFS_H_ -#define __wrappedsdl1imageDEFS_H_ - - -#endif // __wrappedsdl1imageDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl1imagetypes.h b/src/wrapped/generated/wrappedsdl1imagetypes.h deleted file mode 100644 index 27a2fb0..0000000 --- a/src/wrapped/generated/wrappedsdl1imagetypes.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1imageTYPES_H_ -#define __wrappedsdl1imageTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); -typedef void* (*pFpi_t)(void*, int32_t); -typedef void* (*pFpip_t)(void*, int32_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(IMG_LoadBMP_RW, pFp_t) \ - GO(IMG_LoadCUR_RW, pFp_t) \ - GO(IMG_LoadGIF_RW, pFp_t) \ - GO(IMG_LoadICO_RW, pFp_t) \ - GO(IMG_LoadJPG_RW, pFp_t) \ - GO(IMG_LoadLBM_RW, pFp_t) \ - GO(IMG_LoadPCX_RW, pFp_t) \ - GO(IMG_LoadPNG_RW, pFp_t) \ - GO(IMG_LoadPNM_RW, pFp_t) \ - GO(IMG_LoadTGA_RW, pFp_t) \ - GO(IMG_LoadTIF_RW, pFp_t) \ - GO(IMG_LoadWEBP_RW, pFp_t) \ - GO(IMG_LoadXCF_RW, pFp_t) \ - GO(IMG_LoadXPM_RW, pFp_t) \ - GO(IMG_LoadXV_RW, pFp_t) \ - GO(IMG_Load_RW, pFpi_t) \ - GO(IMG_LoadTyped_RW, pFpip_t) - -#endif // __wrappedsdl1imageTYPES_H_ diff --git a/src/wrapped/generated/wrappedsdl1imageundefs.h b/src/wrapped/generated/wrappedsdl1imageundefs.h deleted file mode 100644 index 8588d27..0000000 --- a/src/wrapped/generated/wrappedsdl1imageundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1imageUNDEFS_H_ -#define __wrappedsdl1imageUNDEFS_H_ - - -#endif // __wrappedsdl1imageUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl1mixerdefs.h b/src/wrapped/generated/wrappedsdl1mixerdefs.h deleted file mode 100644 index c1ee043..0000000 --- a/src/wrapped/generated/wrappedsdl1mixerdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1mixerDEFS_H_ -#define __wrappedsdl1mixerDEFS_H_ - - -#endif // __wrappedsdl1mixerDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl1mixertypes.h b/src/wrapped/generated/wrappedsdl1mixertypes.h deleted file mode 100644 index 3998e3d..0000000 --- a/src/wrapped/generated/wrappedsdl1mixertypes.h +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1mixerTYPES_H_ -#define __wrappedsdl1mixerTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef void* (*pFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef int32_t (*iFip_t)(int32_t, void*); -typedef void* (*pFpi_t)(void*, int32_t); -typedef void* (*pFpii_t)(void*, int32_t, int32_t); -typedef int32_t (*iFippp_t)(int32_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(Mix_ChannelFinished, vFp_t) \ - GO(Mix_HookMusicFinished, vFp_t) \ - GO(Mix_LoadMUS_RW, pFp_t) \ - GO(Mix_HookMusic, vFpp_t) \ - GO(Mix_SetPostMix, vFpp_t) \ - GO(Mix_UnregisterEffect, iFip_t) \ - GO(Mix_LoadWAV_RW, pFpi_t) \ - GO(Mix_LoadMUSType_RW, pFpii_t) \ - GO(Mix_RegisterEffect, iFippp_t) - -#endif // __wrappedsdl1mixerTYPES_H_ diff --git a/src/wrapped/generated/wrappedsdl1mixerundefs.h b/src/wrapped/generated/wrappedsdl1mixerundefs.h deleted file mode 100644 index f943ef6..0000000 --- a/src/wrapped/generated/wrappedsdl1mixerundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1mixerUNDEFS_H_ -#define __wrappedsdl1mixerUNDEFS_H_ - - -#endif // __wrappedsdl1mixerUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl1netdefs.h b/src/wrapped/generated/wrappedsdl1netdefs.h deleted file mode 100644 index 8bef12a..0000000 --- a/src/wrapped/generated/wrappedsdl1netdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1netDEFS_H_ -#define __wrappedsdl1netDEFS_H_ - - -#endif // __wrappedsdl1netDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl1nettypes.h b/src/wrapped/generated/wrappedsdl1nettypes.h deleted file mode 100644 index df143a1..0000000 --- a/src/wrapped/generated/wrappedsdl1nettypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1netTYPES_H_ -#define __wrappedsdl1netTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedsdl1netTYPES_H_ diff --git a/src/wrapped/generated/wrappedsdl1netundefs.h b/src/wrapped/generated/wrappedsdl1netundefs.h deleted file mode 100644 index e2492dd..0000000 --- a/src/wrapped/generated/wrappedsdl1netundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1netUNDEFS_H_ -#define __wrappedsdl1netUNDEFS_H_ - - -#endif // __wrappedsdl1netUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl1sounddefs.h b/src/wrapped/generated/wrappedsdl1sounddefs.h deleted file mode 100644 index eb8bfa2..0000000 --- a/src/wrapped/generated/wrappedsdl1sounddefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1soundDEFS_H_ -#define __wrappedsdl1soundDEFS_H_ - - -#endif // __wrappedsdl1soundDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl1soundtypes.h b/src/wrapped/generated/wrappedsdl1soundtypes.h deleted file mode 100644 index a093993..0000000 --- a/src/wrapped/generated/wrappedsdl1soundtypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1soundTYPES_H_ -#define __wrappedsdl1soundTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFpppu_t)(void*, void*, void*, uint32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(Sound_NewSample, pFpppu_t) - -#endif // __wrappedsdl1soundTYPES_H_ diff --git a/src/wrapped/generated/wrappedsdl1soundundefs.h b/src/wrapped/generated/wrappedsdl1soundundefs.h deleted file mode 100644 index 86a4a19..0000000 --- a/src/wrapped/generated/wrappedsdl1soundundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1soundUNDEFS_H_ -#define __wrappedsdl1soundUNDEFS_H_ - - -#endif // __wrappedsdl1soundUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl1ttfdefs.h b/src/wrapped/generated/wrappedsdl1ttfdefs.h deleted file mode 100644 index 431c627..0000000 --- a/src/wrapped/generated/wrappedsdl1ttfdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1ttfDEFS_H_ -#define __wrappedsdl1ttfDEFS_H_ - - -#endif // __wrappedsdl1ttfDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl1ttftypes.h b/src/wrapped/generated/wrappedsdl1ttftypes.h deleted file mode 100644 index 7ce6d58..0000000 --- a/src/wrapped/generated/wrappedsdl1ttftypes.h +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1ttfTYPES_H_ -#define __wrappedsdl1ttfTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFpii_t)(void*, int32_t, int32_t); -typedef void* (*pFpiii_t)(void*, int32_t, int32_t, int32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(TTF_OpenFontRW, pFpii_t) \ - GO(TTF_OpenFontIndexRW, pFpiii_t) - -#endif // __wrappedsdl1ttfTYPES_H_ diff --git a/src/wrapped/generated/wrappedsdl1ttfundefs.h b/src/wrapped/generated/wrappedsdl1ttfundefs.h deleted file mode 100644 index 3643349..0000000 --- a/src/wrapped/generated/wrappedsdl1ttfundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1ttfUNDEFS_H_ -#define __wrappedsdl1ttfUNDEFS_H_ - - -#endif // __wrappedsdl1ttfUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl1types.h b/src/wrapped/generated/wrappedsdl1types.h deleted file mode 100644 index 4956762..0000000 --- a/src/wrapped/generated/wrappedsdl1types.h +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1TYPES_H_ -#define __wrappedsdl1TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef int32_t (*iFv_t)(void); -typedef int32_t (*iFp_t)(void*); -typedef uint32_t (*uFp_t)(void*); -typedef uint64_t (*UFp_t)(void*); -typedef void* (*pFv_t)(void); -typedef void* (*pFp_t)(void*); -typedef int32_t (*iFup_t)(uint32_t, void*); -typedef int32_t (*iFpp_t)(void*, void*); -typedef uint32_t (*uFpW_t)(void*, uint16_t); -typedef uint32_t (*uFpu_t)(void*, uint32_t); -typedef uint32_t (*uFpU_t)(void*, uint64_t); -typedef void* (*pFpi_t)(void*, int32_t); -typedef void* (*pFpp_t)(void*, void*); -typedef int32_t (*iFppi_t)(void*, void*, int32_t); -typedef void* (*pFupp_t)(uint32_t, void*, void*); -typedef void* (*pFpippp_t)(void*, int32_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(SDL_KillThread, vFp_t) \ - GO(SDL_SetEventFilter, vFp_t) \ - GO(SDL_UnloadObject, vFp_t) \ - GO(SDL_Has3DNow, iFv_t) \ - GO(SDL_Has3DNowExt, iFv_t) \ - GO(SDL_HasAltiVec, iFv_t) \ - GO(SDL_HasMMX, iFv_t) \ - GO(SDL_HasMMXExt, iFv_t) \ - GO(SDL_HasRDTSC, iFv_t) \ - GO(SDL_HasSSE, iFv_t) \ - GO(SDL_HasSSE2, iFv_t) \ - GO(SDL_GetWMInfo, iFp_t) \ - GO(SDL_RemoveTimer, iFp_t) \ - GO(SDL_ReadBE16, uFp_t) \ - GO(SDL_ReadBE32, uFp_t) \ - GO(SDL_ReadLE16, uFp_t) \ - GO(SDL_ReadLE32, uFp_t) \ - GO(SDL_ReadBE64, UFp_t) \ - GO(SDL_ReadLE64, UFp_t) \ - GO(SDL_GetEventFilter, pFv_t) \ - GO(SDL_GL_GetProcAddress, pFp_t) \ - GO(SDL_LoadObject, pFp_t) \ - GO(SDL_SetTimer, iFup_t) \ - GO(SDL_OpenAudio, iFpp_t) \ - GO(SDL_WriteBE16, uFpW_t) \ - GO(SDL_WriteLE16, uFpW_t) \ - GO(SDL_WriteBE32, uFpu_t) \ - GO(SDL_WriteLE32, uFpu_t) \ - GO(SDL_WriteBE64, uFpU_t) \ - GO(SDL_WriteLE64, uFpU_t) \ - GO(SDL_LoadBMP_RW, pFpi_t) \ - GO(SDL_RWFromConstMem, pFpi_t) \ - GO(SDL_RWFromFP, pFpi_t) \ - GO(SDL_RWFromMem, pFpi_t) \ - GO(SDL_CreateThread, pFpp_t) \ - GO(SDL_LoadFunction, pFpp_t) \ - GO(SDL_RWFromFile, pFpp_t) \ - GO(SDL_SaveBMP_RW, iFppi_t) \ - GO(SDL_AddTimer, pFupp_t) \ - GO(SDL_LoadWAV_RW, pFpippp_t) - -#endif // __wrappedsdl1TYPES_H_ diff --git a/src/wrapped/generated/wrappedsdl1undefs.h b/src/wrapped/generated/wrappedsdl1undefs.h deleted file mode 100644 index 6a49a25..0000000 --- a/src/wrapped/generated/wrappedsdl1undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl1UNDEFS_H_ -#define __wrappedsdl1UNDEFS_H_ - - -#endif // __wrappedsdl1UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl2defs.h b/src/wrapped/generated/wrappedsdl2defs.h deleted file mode 100644 index b9a45cf..0000000 --- a/src/wrapped/generated/wrappedsdl2defs.h +++ /dev/null @@ -1,9 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2DEFS_H_ -#define __wrappedsdl2DEFS_H_ - -#define vFGpppp vFUUpppp - -#endif // __wrappedsdl2DEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl2imagedefs.h b/src/wrapped/generated/wrappedsdl2imagedefs.h deleted file mode 100644 index fd8334f..0000000 --- a/src/wrapped/generated/wrappedsdl2imagedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2imageDEFS_H_ -#define __wrappedsdl2imageDEFS_H_ - - -#endif // __wrappedsdl2imageDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl2imagetypes.h b/src/wrapped/generated/wrappedsdl2imagetypes.h deleted file mode 100644 index a7c3b66..0000000 --- a/src/wrapped/generated/wrappedsdl2imagetypes.h +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2imageTYPES_H_ -#define __wrappedsdl2imageTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); -typedef void* (*pFpi_t)(void*, int32_t); -typedef int32_t (*iFppi_t)(void*, void*, int32_t); -typedef void* (*pFpip_t)(void*, int32_t, void*); -typedef void* (*pFppi_t)(void*, void*, int32_t); -typedef void* (*pFppip_t)(void*, void*, int32_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(IMG_LoadBMP_RW, pFp_t) \ - GO(IMG_LoadCUR_RW, pFp_t) \ - GO(IMG_LoadGIF_RW, pFp_t) \ - GO(IMG_LoadICO_RW, pFp_t) \ - GO(IMG_LoadJPG_RW, pFp_t) \ - GO(IMG_LoadLBM_RW, pFp_t) \ - GO(IMG_LoadPCX_RW, pFp_t) \ - GO(IMG_LoadPNG_RW, pFp_t) \ - GO(IMG_LoadPNM_RW, pFp_t) \ - GO(IMG_LoadTGA_RW, pFp_t) \ - GO(IMG_LoadTIF_RW, pFp_t) \ - GO(IMG_LoadWEBP_RW, pFp_t) \ - GO(IMG_LoadXCF_RW, pFp_t) \ - GO(IMG_LoadXPM_RW, pFp_t) \ - GO(IMG_LoadXV_RW, pFp_t) \ - GO(IMG_Load_RW, pFpi_t) \ - GO(IMG_SavePNG_RW, iFppi_t) \ - GO(IMG_LoadTyped_RW, pFpip_t) \ - GO(IMG_LoadTexture_RW, pFppi_t) \ - GO(IMG_LoadTextureTyped_RW, pFppip_t) - -#endif // __wrappedsdl2imageTYPES_H_ diff --git a/src/wrapped/generated/wrappedsdl2imageundefs.h b/src/wrapped/generated/wrappedsdl2imageundefs.h deleted file mode 100644 index b4b175e..0000000 --- a/src/wrapped/generated/wrappedsdl2imageundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2imageUNDEFS_H_ -#define __wrappedsdl2imageUNDEFS_H_ - - -#endif // __wrappedsdl2imageUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl2mixerdefs.h b/src/wrapped/generated/wrappedsdl2mixerdefs.h deleted file mode 100644 index 1f3a729..0000000 --- a/src/wrapped/generated/wrappedsdl2mixerdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2mixerDEFS_H_ -#define __wrappedsdl2mixerDEFS_H_ - - -#endif // __wrappedsdl2mixerDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl2mixertypes.h b/src/wrapped/generated/wrappedsdl2mixertypes.h deleted file mode 100644 index d48871c..0000000 --- a/src/wrapped/generated/wrappedsdl2mixertypes.h +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2mixerTYPES_H_ -#define __wrappedsdl2mixerTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef int32_t (*iFiw_t)(int32_t, int16_t); -typedef int32_t (*iFip_t)(int32_t, void*); -typedef void* (*pFpi_t)(void*, int32_t); -typedef void* (*pFpii_t)(void*, int32_t, int32_t); -typedef int32_t (*iFippp_t)(int32_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(Mix_ChannelFinished, vFp_t) \ - GO(Mix_HookMusicFinished, vFp_t) \ - GO(Mix_HookMusic, vFpp_t) \ - GO(Mix_SetPostMix, vFpp_t) \ - GO(MinorityMix_SetPosition, iFiw_t) \ - GO(Mix_UnregisterEffect, iFip_t) \ - GO(Mix_LoadMUS_RW, pFpi_t) \ - GO(Mix_LoadWAV_RW, pFpi_t) \ - GO(Mix_LoadMUSType_RW, pFpii_t) \ - GO(Mix_RegisterEffect, iFippp_t) - -#endif // __wrappedsdl2mixerTYPES_H_ diff --git a/src/wrapped/generated/wrappedsdl2mixerundefs.h b/src/wrapped/generated/wrappedsdl2mixerundefs.h deleted file mode 100644 index 15074b6..0000000 --- a/src/wrapped/generated/wrappedsdl2mixerundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2mixerUNDEFS_H_ -#define __wrappedsdl2mixerUNDEFS_H_ - - -#endif // __wrappedsdl2mixerUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl2netdefs.h b/src/wrapped/generated/wrappedsdl2netdefs.h deleted file mode 100644 index 8b2cc63..0000000 --- a/src/wrapped/generated/wrappedsdl2netdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2netDEFS_H_ -#define __wrappedsdl2netDEFS_H_ - - -#endif // __wrappedsdl2netDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl2nettypes.h b/src/wrapped/generated/wrappedsdl2nettypes.h deleted file mode 100644 index 58ebd63..0000000 --- a/src/wrapped/generated/wrappedsdl2nettypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2netTYPES_H_ -#define __wrappedsdl2netTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedsdl2netTYPES_H_ diff --git a/src/wrapped/generated/wrappedsdl2netundefs.h b/src/wrapped/generated/wrappedsdl2netundefs.h deleted file mode 100644 index 81e16b3..0000000 --- a/src/wrapped/generated/wrappedsdl2netundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2netUNDEFS_H_ -#define __wrappedsdl2netUNDEFS_H_ - - -#endif // __wrappedsdl2netUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl2ttfdefs.h b/src/wrapped/generated/wrappedsdl2ttfdefs.h deleted file mode 100644 index bb8ffb6..0000000 --- a/src/wrapped/generated/wrappedsdl2ttfdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2ttfDEFS_H_ -#define __wrappedsdl2ttfDEFS_H_ - - -#endif // __wrappedsdl2ttfDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl2ttftypes.h b/src/wrapped/generated/wrappedsdl2ttftypes.h deleted file mode 100644 index 6d4e02b..0000000 --- a/src/wrapped/generated/wrappedsdl2ttftypes.h +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2ttfTYPES_H_ -#define __wrappedsdl2ttfTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFpii_t)(void*, int32_t, int32_t); -typedef void* (*pFpiii_t)(void*, int32_t, int32_t, int32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(TTF_OpenFontRW, pFpii_t) \ - GO(TTF_OpenFontIndexRW, pFpiii_t) - -#endif // __wrappedsdl2ttfTYPES_H_ diff --git a/src/wrapped/generated/wrappedsdl2ttfundefs.h b/src/wrapped/generated/wrappedsdl2ttfundefs.h deleted file mode 100644 index 0ff8e53..0000000 --- a/src/wrapped/generated/wrappedsdl2ttfundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2ttfUNDEFS_H_ -#define __wrappedsdl2ttfUNDEFS_H_ - - -#endif // __wrappedsdl2ttfUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsdl2types.h b/src/wrapped/generated/wrappedsdl2types.h deleted file mode 100644 index 8386e99..0000000 --- a/src/wrapped/generated/wrappedsdl2types.h +++ /dev/null @@ -1,136 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2TYPES_H_ -#define __wrappedsdl2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef int32_t (*iFv_t)(void); -typedef int32_t (*iFp_t)(void*); -typedef int64_t (*IFp_t)(void*); -typedef uint32_t (*uFp_t)(void*); -typedef uint64_t (*UFp_t)(void*); -typedef uintptr_t (*LFp_t)(void*); -typedef void* (*pFv_t)(void); -typedef void* (*pFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef void (*vFpV_t)(void*, ...); -typedef int32_t (*iFip_t)(int32_t, void*); -typedef int32_t (*iFWW_t)(uint16_t, uint16_t); -typedef int32_t (*iFUU_t)(uint64_t, uint64_t); -typedef int32_t (*iFpi_t)(void*, int32_t); -typedef int32_t (*iFpp_t)(void*, void*); -typedef uint32_t (*uFpW_t)(void*, uint16_t); -typedef uint32_t (*uFpu_t)(void*, uint32_t); -typedef uint32_t (*uFpU_t)(void*, uint64_t); -typedef void* (*pFpi_t)(void*, int32_t); -typedef void* (*pFpp_t)(void*, void*); -typedef void (*vFipV_t)(int32_t, void*, ...); -typedef int32_t (*iFupu_t)(uint32_t, void*, uint32_t); -typedef int32_t (*iFupp_t)(uint32_t, void*, void*); -typedef int32_t (*iFppi_t)(void*, void*, int32_t); -typedef int32_t (*iFppV_t)(void*, void*, ...); -typedef int64_t (*IFpIi_t)(void*, int64_t, int32_t); -typedef void* (*pFupp_t)(uint32_t, void*, void*); -typedef void* (*pFppi_t)(void*, void*, int32_t); -typedef void* (*pFppp_t)(void*, void*, void*); -typedef void (*vFpuup_t)(void*, uint32_t, uint32_t, void*); -typedef int32_t (*iFpLpp_t)(void*, uintptr_t, void*, void*); -typedef int32_t (*iFpLpV_t)(void*, uintptr_t, void*, ...); -typedef uint32_t (*uFppuu_t)(void*, void*, uint32_t, uint32_t); -typedef void (*vFGpppp_t)(SDL_JoystickGUID, void*, void*, void*, void*); -typedef int32_t (*iFpippi_t)(void*, int32_t, void*, void*, int32_t); -typedef void* (*pFpippp_t)(void*, int32_t, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(SDL_UnloadObject, vFp_t) \ - GO(SDL_Has3DNow, iFv_t) \ - GO(SDL_HasAVX, iFv_t) \ - GO(SDL_HasAVX2, iFv_t) \ - GO(SDL_HasAVX512F, iFv_t) \ - GO(SDL_HasAltiVec, iFv_t) \ - GO(SDL_HasMMX, iFv_t) \ - GO(SDL_HasNEON, iFv_t) \ - GO(SDL_HasRDTSC, iFv_t) \ - GO(SDL_HasSSE, iFv_t) \ - GO(SDL_HasSSE2, iFv_t) \ - GO(SDL_HasSSE3, iFv_t) \ - GO(SDL_HasSSE41, iFv_t) \ - GO(SDL_HasSSE42, iFv_t) \ - GO(SDL_RWclose, iFp_t) \ - GO(SDL_RemoveTimer, iFp_t) \ - GO(SDL_SaveAllDollarTemplates, iFp_t) \ - GO(SDL_RWtell, IFp_t) \ - GO(SDL_ReadBE16, uFp_t) \ - GO(SDL_ReadBE32, uFp_t) \ - GO(SDL_ReadLE16, uFp_t) \ - GO(SDL_ReadLE32, uFp_t) \ - GO(SDL_ReadU8, uFp_t) \ - GO(SDL_ReadBE64, UFp_t) \ - GO(SDL_ReadLE64, UFp_t) \ - GO(SDL_GetThreadID, LFp_t) \ - GO(SDL_GetBasePath, pFv_t) \ - GO(SDL_Vulkan_GetVkGetInstanceProcAddr, pFv_t) \ - GO(SDL_GL_GetProcAddress, pFp_t) \ - GO(SDL_LoadObject, pFp_t) \ - GO(SDL_AddEventWatch, vFpp_t) \ - GO(SDL_DelEventWatch, vFpp_t) \ - GO(SDL_LogGetOutputFunction, vFpp_t) \ - GO(SDL_LogSetOutputFunction, vFpp_t) \ - GO(SDL_SetEventFilter, vFpp_t) \ - GO(SDL_Log, vFpV_t) \ - GO(SDL_SaveDollarTemplate, iFip_t) \ - GO(SDL_IsJoystickNintendoSwitchPro, iFWW_t) \ - GO(SDL_IsJoystickPS4, iFWW_t) \ - GO(SDL_IsJoystickSteamController, iFWW_t) \ - GO(SDL_IsJoystickXbox360, iFWW_t) \ - GO(SDL_IsJoystickXboxOne, iFWW_t) \ - GO(SDL_IsJoystickHIDAPI, iFUU_t) \ - GO(SDL_IsJoystickXInput, iFUU_t) \ - GO(SDL_GameControllerAddMappingsFromRW, iFpi_t) \ - GO(SDL_GetEventFilter, iFpp_t) \ - GO(SDL_OpenAudio, iFpp_t) \ - GO(SDL_WriteBE16, uFpW_t) \ - GO(SDL_WriteLE16, uFpW_t) \ - GO(SDL_WriteBE32, uFpu_t) \ - GO(SDL_WriteLE32, uFpu_t) \ - GO(SDL_WriteU8, uFpu_t) \ - GO(SDL_WriteBE64, uFpU_t) \ - GO(SDL_WriteLE64, uFpU_t) \ - GO(SDL_LoadBMP_RW, pFpi_t) \ - GO(SDL_RWFromConstMem, pFpi_t) \ - GO(SDL_RWFromFP, pFpi_t) \ - GO(SDL_RWFromMem, pFpi_t) \ - GO(SDL_LoadFunction, pFpp_t) \ - GO(SDL_RWFromFile, pFpp_t) \ - GO(SDL_LogCritical, vFipV_t) \ - GO(SDL_LogDebug, vFipV_t) \ - GO(SDL_LogError, vFipV_t) \ - GO(SDL_LogInfo, vFipV_t) \ - GO(SDL_LogVerbose, vFipV_t) \ - GO(SDL_LogWarn, vFipV_t) \ - GO(SDL_DYNAPI_entry, iFupu_t) \ - GO(SDL_TLSSet, iFupp_t) \ - GO(SDL_SaveBMP_RW, iFppi_t) \ - GO(SDL_sscanf, iFppV_t) \ - GO(SDL_RWseek, IFpIi_t) \ - GO(SDL_AddTimer, pFupp_t) \ - GO(SDL_LoadFile_RW, pFppi_t) \ - GO(SDL_CreateThread, pFppp_t) \ - GO(SDL_qsort, vFpuup_t) \ - GO(SDL_vsnprintf, iFpLpp_t) \ - GO(SDL_snprintf, iFpLpV_t) \ - GO(SDL_RWread, uFppuu_t) \ - GO(SDL_RWwrite, uFppuu_t) \ - GO(SDL_GetJoystickGUIDInfo, vFGpppp_t) \ - GO(SDL_OpenAudioDevice, iFpippi_t) \ - GO(SDL_LoadWAV_RW, pFpippp_t) - -#endif // __wrappedsdl2TYPES_H_ diff --git a/src/wrapped/generated/wrappedsdl2undefs.h b/src/wrapped/generated/wrappedsdl2undefs.h deleted file mode 100644 index e27f5ae..0000000 --- a/src/wrapped/generated/wrappedsdl2undefs.h +++ /dev/null @@ -1,9 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsdl2UNDEFS_H_ -#define __wrappedsdl2UNDEFS_H_ - -#undef vFGpppp - -#endif // __wrappedsdl2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsecret1defs.h b/src/wrapped/generated/wrappedsecret1defs.h deleted file mode 100644 index d71edbc..0000000 --- a/src/wrapped/generated/wrappedsecret1defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsecret1DEFS_H_ -#define __wrappedsecret1DEFS_H_ - - -#endif // __wrappedsecret1DEFS_H_ diff --git a/src/wrapped/generated/wrappedsecret1types.h b/src/wrapped/generated/wrappedsecret1types.h deleted file mode 100644 index f9a3222..0000000 --- a/src/wrapped/generated/wrappedsecret1types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsecret1TYPES_H_ -#define __wrappedsecret1TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedsecret1TYPES_H_ diff --git a/src/wrapped/generated/wrappedsecret1undefs.h b/src/wrapped/generated/wrappedsecret1undefs.h deleted file mode 100644 index 1ca2fef..0000000 --- a/src/wrapped/generated/wrappedsecret1undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsecret1UNDEFS_H_ -#define __wrappedsecret1UNDEFS_H_ - - -#endif // __wrappedsecret1UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedselinuxdefs.h b/src/wrapped/generated/wrappedselinuxdefs.h deleted file mode 100644 index bc11a10..0000000 --- a/src/wrapped/generated/wrappedselinuxdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedselinuxDEFS_H_ -#define __wrappedselinuxDEFS_H_ - - -#endif // __wrappedselinuxDEFS_H_ diff --git a/src/wrapped/generated/wrappedselinuxtypes.h b/src/wrapped/generated/wrappedselinuxtypes.h deleted file mode 100644 index b79ee17..0000000 --- a/src/wrapped/generated/wrappedselinuxtypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedselinuxTYPES_H_ -#define __wrappedselinuxTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedselinuxTYPES_H_ diff --git a/src/wrapped/generated/wrappedselinuxundefs.h b/src/wrapped/generated/wrappedselinuxundefs.h deleted file mode 100644 index 8562c7d..0000000 --- a/src/wrapped/generated/wrappedselinuxundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedselinuxUNDEFS_H_ -#define __wrappedselinuxUNDEFS_H_ - - -#endif // __wrappedselinuxUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsmime3defs.h b/src/wrapped/generated/wrappedsmime3defs.h deleted file mode 100644 index 7f730ae..0000000 --- a/src/wrapped/generated/wrappedsmime3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsmime3DEFS_H_ -#define __wrappedsmime3DEFS_H_ - - -#endif // __wrappedsmime3DEFS_H_ diff --git a/src/wrapped/generated/wrappedsmime3types.h b/src/wrapped/generated/wrappedsmime3types.h deleted file mode 100644 index 6d382ec..0000000 --- a/src/wrapped/generated/wrappedsmime3types.h +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsmime3TYPES_H_ -#define __wrappedsmime3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFpp_t)(void*, void*); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*); -typedef void* (*pFpppp_t)(void*, void*, void*, void*); -typedef void* (*pFpppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(SEC_PKCS12DecoderValidateBags, iFpp_t) \ - GO(SEC_PKCS12Encode, iFppp_t) \ - GO(CERT_DecodeCertPackage, iFpipp_t) \ - GO(SEC_PKCS12CreateExportContext, pFpppp_t) \ - GO(SEC_PKCS12DecoderStart, pFpppppppp_t) \ - GO(NSS_CMSEncoder_Start, pFppppppppppp_t) - -#endif // __wrappedsmime3TYPES_H_ diff --git a/src/wrapped/generated/wrappedsmime3undefs.h b/src/wrapped/generated/wrappedsmime3undefs.h deleted file mode 100644 index 9e4d66a..0000000 --- a/src/wrapped/generated/wrappedsmime3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsmime3UNDEFS_H_ -#define __wrappedsmime3UNDEFS_H_ - - -#endif // __wrappedsmime3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsmpeg2defs.h b/src/wrapped/generated/wrappedsmpeg2defs.h deleted file mode 100644 index 87313f8..0000000 --- a/src/wrapped/generated/wrappedsmpeg2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsmpeg2DEFS_H_ -#define __wrappedsmpeg2DEFS_H_ - - -#endif // __wrappedsmpeg2DEFS_H_ diff --git a/src/wrapped/generated/wrappedsmpeg2types.h b/src/wrapped/generated/wrappedsmpeg2types.h deleted file mode 100644 index e9cb40d..0000000 --- a/src/wrapped/generated/wrappedsmpeg2types.h +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsmpeg2TYPES_H_ -#define __wrappedsmpeg2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef void* (*pFppii_t)(void*, void*, int32_t, int32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(SMPEG_setdisplay, vFpppp_t) \ - GO(SMPEG_new_rwops, pFppii_t) - -#endif // __wrappedsmpeg2TYPES_H_ diff --git a/src/wrapped/generated/wrappedsmpeg2undefs.h b/src/wrapped/generated/wrappedsmpeg2undefs.h deleted file mode 100644 index 962f137..0000000 --- a/src/wrapped/generated/wrappedsmpeg2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsmpeg2UNDEFS_H_ -#define __wrappedsmpeg2UNDEFS_H_ - - -#endif // __wrappedsmpeg2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsmpegdefs.h b/src/wrapped/generated/wrappedsmpegdefs.h deleted file mode 100644 index 2c6beeb..0000000 --- a/src/wrapped/generated/wrappedsmpegdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsmpegDEFS_H_ -#define __wrappedsmpegDEFS_H_ - - -#endif // __wrappedsmpegDEFS_H_ diff --git a/src/wrapped/generated/wrappedsmpegtypes.h b/src/wrapped/generated/wrappedsmpegtypes.h deleted file mode 100644 index 15d7494..0000000 --- a/src/wrapped/generated/wrappedsmpegtypes.h +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsmpegTYPES_H_ -#define __wrappedsmpegTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFppi_t)(void*, void*, int32_t); -typedef void (*vFpppp_t)(void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(SMPEG_new_rwops, pFppi_t) \ - GO(SMPEG_setdisplay, vFpppp_t) - -#endif // __wrappedsmpegTYPES_H_ diff --git a/src/wrapped/generated/wrappedsmpegundefs.h b/src/wrapped/generated/wrappedsmpegundefs.h deleted file mode 100644 index d7682a7..0000000 --- a/src/wrapped/generated/wrappedsmpegundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsmpegUNDEFS_H_ -#define __wrappedsmpegUNDEFS_H_ - - -#endif // __wrappedsmpegUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedsoftokn3defs.h b/src/wrapped/generated/wrappedsoftokn3defs.h deleted file mode 100644 index 8c8fa0e..0000000 --- a/src/wrapped/generated/wrappedsoftokn3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsoftokn3DEFS_H_ -#define __wrappedsoftokn3DEFS_H_ - - -#endif // __wrappedsoftokn3DEFS_H_ diff --git a/src/wrapped/generated/wrappedsoftokn3types.h b/src/wrapped/generated/wrappedsoftokn3types.h deleted file mode 100644 index 1cc54de..0000000 --- a/src/wrapped/generated/wrappedsoftokn3types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsoftokn3TYPES_H_ -#define __wrappedsoftokn3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedsoftokn3TYPES_H_ diff --git a/src/wrapped/generated/wrappedsoftokn3undefs.h b/src/wrapped/generated/wrappedsoftokn3undefs.h deleted file mode 100644 index 2566450..0000000 --- a/src/wrapped/generated/wrappedsoftokn3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedsoftokn3UNDEFS_H_ -#define __wrappedsoftokn3UNDEFS_H_ - - -#endif // __wrappedsoftokn3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedssl3defs.h b/src/wrapped/generated/wrappedssl3defs.h deleted file mode 100644 index ae087e0..0000000 --- a/src/wrapped/generated/wrappedssl3defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedssl3DEFS_H_ -#define __wrappedssl3DEFS_H_ - - -#endif // __wrappedssl3DEFS_H_ diff --git a/src/wrapped/generated/wrappedssl3types.h b/src/wrapped/generated/wrappedssl3types.h deleted file mode 100644 index 1927a23..0000000 --- a/src/wrapped/generated/wrappedssl3types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedssl3TYPES_H_ -#define __wrappedssl3TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedssl3TYPES_H_ diff --git a/src/wrapped/generated/wrappedssl3undefs.h b/src/wrapped/generated/wrappedssl3undefs.h deleted file mode 100644 index 16eb9fa..0000000 --- a/src/wrapped/generated/wrappedssl3undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedssl3UNDEFS_H_ -#define __wrappedssl3UNDEFS_H_ - - -#endif // __wrappedssl3UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedtbbbinddefs.h b/src/wrapped/generated/wrappedtbbbinddefs.h deleted file mode 100644 index aba756f..0000000 --- a/src/wrapped/generated/wrappedtbbbinddefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedtbbbindDEFS_H_ -#define __wrappedtbbbindDEFS_H_ - - -#endif // __wrappedtbbbindDEFS_H_ diff --git a/src/wrapped/generated/wrappedtbbbindtypes.h b/src/wrapped/generated/wrappedtbbbindtypes.h deleted file mode 100644 index c898ebc..0000000 --- a/src/wrapped/generated/wrappedtbbbindtypes.h +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedtbbbindTYPES_H_ -#define __wrappedtbbbindTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFv_t)(void); -typedef void (*vFp_t)(void*); -typedef void (*vFpi_t)(void*, int32_t); -typedef int32_t (*iFiii_t)(int32_t, int32_t, int32_t); -typedef void* (*pFiiii_t)(int32_t, int32_t, int32_t, int32_t); -typedef void (*vFLpppp_t)(uintptr_t, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(__TBB_internal_destroy_system_topology, vFv_t) \ - GO(__TBB_internal_deallocate_binding_handler, vFp_t) \ - GO(__TBB_internal_apply_affinity, vFpi_t) \ - GO(__TBB_internal_restore_affinity, vFpi_t) \ - GO(__TBB_internal_get_default_concurrency, iFiii_t) \ - GO(__TBB_internal_allocate_binding_handler, pFiiii_t) \ - GO(__TBB_internal_initialize_system_topology, vFLpppp_t) - -#endif // __wrappedtbbbindTYPES_H_ diff --git a/src/wrapped/generated/wrappedtbbbindundefs.h b/src/wrapped/generated/wrappedtbbbindundefs.h deleted file mode 100644 index 408e8fb..0000000 --- a/src/wrapped/generated/wrappedtbbbindundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedtbbbindUNDEFS_H_ -#define __wrappedtbbbindUNDEFS_H_ - - -#endif // __wrappedtbbbindUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedtbbmallocdefs.h b/src/wrapped/generated/wrappedtbbmallocdefs.h deleted file mode 100644 index b0fe962..0000000 --- a/src/wrapped/generated/wrappedtbbmallocdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedtbbmallocDEFS_H_ -#define __wrappedtbbmallocDEFS_H_ - - -#endif // __wrappedtbbmallocDEFS_H_ diff --git a/src/wrapped/generated/wrappedtbbmallocproxydefs.h b/src/wrapped/generated/wrappedtbbmallocproxydefs.h deleted file mode 100644 index fab8b48..0000000 --- a/src/wrapped/generated/wrappedtbbmallocproxydefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedtbbmallocproxyDEFS_H_ -#define __wrappedtbbmallocproxyDEFS_H_ - - -#endif // __wrappedtbbmallocproxyDEFS_H_ diff --git a/src/wrapped/generated/wrappedtbbmallocproxytypes.h b/src/wrapped/generated/wrappedtbbmallocproxytypes.h deleted file mode 100644 index 661340a..0000000 --- a/src/wrapped/generated/wrappedtbbmallocproxytypes.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedtbbmallocproxyTYPES_H_ -#define __wrappedtbbmallocproxyTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef void* (*pFL_t)(uintptr_t); -typedef void (*vFpp_t)(void*, void*); -typedef void* (*pFLp_t)(uintptr_t, void*); -typedef int32_t (*iFipp_t)(int32_t, void*, void*); -typedef int32_t (*iFppi_t)(void*, void*, int32_t); -typedef int32_t (*iFppp_t)(void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(_ZdaPv, vFp_t) \ - GO(_ZdlPv, vFp_t) \ - GO(__RML_close_factory, vFp_t) \ - GO(_Znam, pFL_t) \ - GO(_Znwm, pFL_t) \ - GO(_ZdaPvRKSt9nothrow_t, vFpp_t) \ - GO(_ZdlPvRKSt9nothrow_t, vFpp_t) \ - GO(__TBB_call_with_my_server_info, vFpp_t) \ - GO(_ZnamRKSt9nothrow_t, pFLp_t) \ - GO(_ZnwmRKSt9nothrow_t, pFLp_t) \ - GO(__TBB_internal_find_original_malloc, iFipp_t) \ - GO(__RML_open_factory, iFppi_t) \ - GO(__TBB_make_rml_server, iFppp_t) - -#endif // __wrappedtbbmallocproxyTYPES_H_ diff --git a/src/wrapped/generated/wrappedtbbmallocproxyundefs.h b/src/wrapped/generated/wrappedtbbmallocproxyundefs.h deleted file mode 100644 index ed68ff0..0000000 --- a/src/wrapped/generated/wrappedtbbmallocproxyundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedtbbmallocproxyUNDEFS_H_ -#define __wrappedtbbmallocproxyUNDEFS_H_ - - -#endif // __wrappedtbbmallocproxyUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedtbbmalloctypes.h b/src/wrapped/generated/wrappedtbbmalloctypes.h deleted file mode 100644 index caec388..0000000 --- a/src/wrapped/generated/wrappedtbbmalloctypes.h +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedtbbmallocTYPES_H_ -#define __wrappedtbbmallocTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef uintptr_t (*LFp_t)(void*); -typedef uintptr_t (*LFpp_t)(void*, void*); -typedef void* (*pFLL_t)(uintptr_t, uintptr_t); -typedef void* (*pFpp_t)(void*, void*); -typedef void* (*pFpLL_t)(void*, uintptr_t, uintptr_t); -typedef void* (*pFpLp_t)(void*, uintptr_t, void*); -typedef void* (*pFpLLp_t)(void*, uintptr_t, uintptr_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(scalable_aligned_free, vFp_t) \ - GO(scalable_msize, LFp_t) \ - GO(safer_scalable_msize, LFpp_t) \ - GO(scalable_aligned_malloc, pFLL_t) \ - GO(scalable_calloc, pFLL_t) \ - GO(safer_scalable_free, pFpp_t) \ - GO(scalable_aligned_realloc, pFpLL_t) \ - GO(safer_scalable_realloc, pFpLp_t) \ - GO(safer_scalable_aligned_realloc, pFpLLp_t) - -#endif // __wrappedtbbmallocTYPES_H_ diff --git a/src/wrapped/generated/wrappedtbbmallocundefs.h b/src/wrapped/generated/wrappedtbbmallocundefs.h deleted file mode 100644 index 0e22b27..0000000 --- a/src/wrapped/generated/wrappedtbbmallocundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedtbbmallocUNDEFS_H_ -#define __wrappedtbbmallocUNDEFS_H_ - - -#endif // __wrappedtbbmallocUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedtcmallocminimaldefs.h b/src/wrapped/generated/wrappedtcmallocminimaldefs.h deleted file mode 100644 index c22b54d..0000000 --- a/src/wrapped/generated/wrappedtcmallocminimaldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedtcmallocminimalDEFS_H_ -#define __wrappedtcmallocminimalDEFS_H_ - - -#endif // __wrappedtcmallocminimalDEFS_H_ diff --git a/src/wrapped/generated/wrappedtcmallocminimaltypes.h b/src/wrapped/generated/wrappedtcmallocminimaltypes.h deleted file mode 100644 index 52e03b2..0000000 --- a/src/wrapped/generated/wrappedtcmallocminimaltypes.h +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedtcmallocminimalTYPES_H_ -#define __wrappedtcmallocminimalTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void* (*pFp_t)(void*); -typedef int32_t (*iFpL_t)(void*, uintptr_t); -typedef void* (*pFpLiiil_t)(void*, uintptr_t, int32_t, int32_t, int32_t, intptr_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(mallinfo, pFp_t) \ - GO(munmap, iFpL_t) \ - GO(mmap, pFpLiiil_t) \ - GO(mmap64, pFpLiiil_t) - -#endif // __wrappedtcmallocminimalTYPES_H_ diff --git a/src/wrapped/generated/wrappedtcmallocminimalundefs.h b/src/wrapped/generated/wrappedtcmallocminimalundefs.h deleted file mode 100644 index 2dc85a7..0000000 --- a/src/wrapped/generated/wrappedtcmallocminimalundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedtcmallocminimalUNDEFS_H_ -#define __wrappedtcmallocminimalUNDEFS_H_ - - -#endif // __wrappedtcmallocminimalUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedudev0defs.h b/src/wrapped/generated/wrappedudev0defs.h deleted file mode 100644 index 23e9251..0000000 --- a/src/wrapped/generated/wrappedudev0defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedudev0DEFS_H_ -#define __wrappedudev0DEFS_H_ - - -#endif // __wrappedudev0DEFS_H_ diff --git a/src/wrapped/generated/wrappedudev0types.h b/src/wrapped/generated/wrappedudev0types.h deleted file mode 100644 index 9226453..0000000 --- a/src/wrapped/generated/wrappedudev0types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedudev0TYPES_H_ -#define __wrappedudev0TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedudev0TYPES_H_ diff --git a/src/wrapped/generated/wrappedudev0undefs.h b/src/wrapped/generated/wrappedudev0undefs.h deleted file mode 100644 index ca9b005..0000000 --- a/src/wrapped/generated/wrappedudev0undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedudev0UNDEFS_H_ -#define __wrappedudev0UNDEFS_H_ - - -#endif // __wrappedudev0UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedudev1defs.h b/src/wrapped/generated/wrappedudev1defs.h deleted file mode 100644 index 040be66..0000000 --- a/src/wrapped/generated/wrappedudev1defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedudev1DEFS_H_ -#define __wrappedudev1DEFS_H_ - - -#endif // __wrappedudev1DEFS_H_ diff --git a/src/wrapped/generated/wrappedudev1types.h b/src/wrapped/generated/wrappedudev1types.h deleted file mode 100644 index 7d1681b..0000000 --- a/src/wrapped/generated/wrappedudev1types.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedudev1TYPES_H_ -#define __wrappedudev1TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpp_t)(void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(udev_set_log_fn, vFpp_t) - -#endif // __wrappedudev1TYPES_H_ diff --git a/src/wrapped/generated/wrappedudev1undefs.h b/src/wrapped/generated/wrappedudev1undefs.h deleted file mode 100644 index 814025c..0000000 --- a/src/wrapped/generated/wrappedudev1undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedudev1UNDEFS_H_ -#define __wrappedudev1UNDEFS_H_ - - -#endif // __wrappedudev1UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedunwinddefs.h b/src/wrapped/generated/wrappedunwinddefs.h deleted file mode 100644 index 6b5b16e..0000000 --- a/src/wrapped/generated/wrappedunwinddefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedunwindDEFS_H_ -#define __wrappedunwindDEFS_H_ - - -#endif // __wrappedunwindDEFS_H_ diff --git a/src/wrapped/generated/wrappedunwindtypes.h b/src/wrapped/generated/wrappedunwindtypes.h deleted file mode 100644 index 78977ea..0000000 --- a/src/wrapped/generated/wrappedunwindtypes.h +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedunwindTYPES_H_ -#define __wrappedunwindTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFp_t)(void*); -typedef int32_t (*iFpp_t)(void*, void*); -typedef int32_t (*iFpip_t)(void*, int32_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(_ULx86_64_step, iFp_t) \ - GO(_ULx86_64_get_proc_info, iFpp_t) \ - GO(_ULx86_64_init_local, iFpp_t) \ - GO(_ULx86_64_get_reg, iFpip_t) - -#endif // __wrappedunwindTYPES_H_ diff --git a/src/wrapped/generated/wrappedunwindundefs.h b/src/wrapped/generated/wrappedunwindundefs.h deleted file mode 100644 index 13d2afb..0000000 --- a/src/wrapped/generated/wrappedunwindundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedunwindUNDEFS_H_ -#define __wrappedunwindUNDEFS_H_ - - -#endif // __wrappedunwindUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedutildefs.h b/src/wrapped/generated/wrappedutildefs.h deleted file mode 100644 index 14920bc..0000000 --- a/src/wrapped/generated/wrappedutildefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedutilDEFS_H_ -#define __wrappedutilDEFS_H_ - - -#endif // __wrappedutilDEFS_H_ diff --git a/src/wrapped/generated/wrappedutiltypes.h b/src/wrapped/generated/wrappedutiltypes.h deleted file mode 100644 index 8b46276..0000000 --- a/src/wrapped/generated/wrappedutiltypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedutilTYPES_H_ -#define __wrappedutilTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(forkpty, iFpppp_t) - -#endif // __wrappedutilTYPES_H_ diff --git a/src/wrapped/generated/wrappedutilundefs.h b/src/wrapped/generated/wrappedutilundefs.h deleted file mode 100644 index 69632e8..0000000 --- a/src/wrapped/generated/wrappedutilundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedutilUNDEFS_H_ -#define __wrappedutilUNDEFS_H_ - - -#endif // __wrappedutilUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedvorbisfiledefs.h b/src/wrapped/generated/wrappedvorbisfiledefs.h deleted file mode 100644 index 50057e6..0000000 --- a/src/wrapped/generated/wrappedvorbisfiledefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedvorbisfileDEFS_H_ -#define __wrappedvorbisfileDEFS_H_ - - -#endif // __wrappedvorbisfileDEFS_H_ diff --git a/src/wrapped/generated/wrappedvorbisfiletypes.h b/src/wrapped/generated/wrappedvorbisfiletypes.h deleted file mode 100644 index 1533cba..0000000 --- a/src/wrapped/generated/wrappedvorbisfiletypes.h +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedvorbisfileTYPES_H_ -#define __wrappedvorbisfileTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFppplPPPP_t)(void*, void*, void*, intptr_t, void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(ov_open_callbacks, iFppplPPPP_t) \ - GO(ov_test_callbacks, iFppplPPPP_t) - -#endif // __wrappedvorbisfileTYPES_H_ diff --git a/src/wrapped/generated/wrappedvorbisfileundefs.h b/src/wrapped/generated/wrappedvorbisfileundefs.h deleted file mode 100644 index 329c731..0000000 --- a/src/wrapped/generated/wrappedvorbisfileundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedvorbisfileUNDEFS_H_ -#define __wrappedvorbisfileUNDEFS_H_ - - -#endif // __wrappedvorbisfileUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedvulkandefs.h b/src/wrapped/generated/wrappedvulkandefs.h deleted file mode 100644 index f976c2d..0000000 --- a/src/wrapped/generated/wrappedvulkandefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedvulkanDEFS_H_ -#define __wrappedvulkanDEFS_H_ - - -#endif // __wrappedvulkanDEFS_H_ diff --git a/src/wrapped/generated/wrappedvulkantypes.h b/src/wrapped/generated/wrappedvulkantypes.h deleted file mode 100644 index fd78439..0000000 --- a/src/wrapped/generated/wrappedvulkantypes.h +++ /dev/null @@ -1,146 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedvulkanTYPES_H_ -#define __wrappedvulkanTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFpp_t)(void*, void*); -typedef void* (*pFpp_t)(void*, void*); -typedef void (*vFpUp_t)(void*, uint64_t, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef int32_t (*iFpUp_t)(void*, uint64_t, void*); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef int32_t (*iFpUup_t)(void*, uint64_t, uint32_t, void*); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); -typedef void (*vFpupup_t)(void*, uint32_t, void*, uint32_t, void*); -typedef int32_t (*iFpuppp_t)(void*, uint32_t, void*, void*, void*); -typedef int32_t (*iFpUppp_t)(void*, uint64_t, void*, void*, void*); -typedef int32_t (*iFpUuppp_t)(void*, uint64_t, uint32_t, void*, void*, void*); -typedef int32_t (*iFpUUuppp_t)(void*, uint64_t, uint64_t, uint32_t, void*, void*, void*); -typedef void (*vFpiiiuipp_t)(void*, int32_t, int32_t, int32_t, uint32_t, int32_t, void*, void*); -typedef void (*vFpuuuupupup_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, void*, uint32_t, void*, uint32_t, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(vkDestroyDevice, vFpp_t) \ - GO(vkDestroyInstance, vFpp_t) \ - GO(vkGetPhysicalDeviceMemoryProperties, vFpp_t) \ - GO(vkGetPhysicalDeviceProperties, vFpp_t) \ - GO(vkGetDeviceProcAddr, pFpp_t) \ - GO(vkGetInstanceProcAddr, pFpp_t) \ - GO(vkDestroyAccelerationStructureKHR, vFpUp_t) \ - GO(vkDestroyAccelerationStructureNV, vFpUp_t) \ - GO(vkDestroyBuffer, vFpUp_t) \ - GO(vkDestroyBufferView, vFpUp_t) \ - GO(vkDestroyCommandPool, vFpUp_t) \ - GO(vkDestroyCuFunctionNVX, vFpUp_t) \ - GO(vkDestroyCuModuleNVX, vFpUp_t) \ - GO(vkDestroyCudaFunctionNV, vFpUp_t) \ - GO(vkDestroyCudaModuleNV, vFpUp_t) \ - GO(vkDestroyDeferredOperationKHR, vFpUp_t) \ - GO(vkDestroyDescriptorPool, vFpUp_t) \ - GO(vkDestroyDescriptorSetLayout, vFpUp_t) \ - GO(vkDestroyDescriptorUpdateTemplate, vFpUp_t) \ - GO(vkDestroyDescriptorUpdateTemplateKHR, vFpUp_t) \ - GO(vkDestroyEvent, vFpUp_t) \ - GO(vkDestroyFence, vFpUp_t) \ - GO(vkDestroyFramebuffer, vFpUp_t) \ - GO(vkDestroyImage, vFpUp_t) \ - GO(vkDestroyImageView, vFpUp_t) \ - GO(vkDestroyIndirectCommandsLayoutNV, vFpUp_t) \ - GO(vkDestroyMicromapEXT, vFpUp_t) \ - GO(vkDestroyOpticalFlowSessionNV, vFpUp_t) \ - GO(vkDestroyPipeline, vFpUp_t) \ - GO(vkDestroyPipelineCache, vFpUp_t) \ - GO(vkDestroyPipelineLayout, vFpUp_t) \ - GO(vkDestroyPrivateDataSlot, vFpUp_t) \ - GO(vkDestroyPrivateDataSlotEXT, vFpUp_t) \ - GO(vkDestroyQueryPool, vFpUp_t) \ - GO(vkDestroyRenderPass, vFpUp_t) \ - GO(vkDestroySampler, vFpUp_t) \ - GO(vkDestroySamplerYcbcrConversion, vFpUp_t) \ - GO(vkDestroySamplerYcbcrConversionKHR, vFpUp_t) \ - GO(vkDestroySemaphore, vFpUp_t) \ - GO(vkDestroyShaderEXT, vFpUp_t) \ - GO(vkDestroyShaderModule, vFpUp_t) \ - GO(vkDestroySurfaceKHR, vFpUp_t) \ - GO(vkDestroySwapchainKHR, vFpUp_t) \ - GO(vkDestroyValidationCacheEXT, vFpUp_t) \ - GO(vkDestroyVideoSessionKHR, vFpUp_t) \ - GO(vkDestroyVideoSessionParametersKHR, vFpUp_t) \ - GO(vkDestroyDebugReportCallbackEXT, vFppp_t) \ - GO(vkDestroyDebugUtilsMessengerEXT, vFppp_t) \ - GO(vkFreeMemory, iFpUp_t) \ - GO(vkCreateDeferredOperationKHR, iFppp_t) \ - GO(vkCreateInstance, iFppp_t) \ - GO(vkGetPhysicalDeviceDisplayPropertiesKHR, iFppp_t) \ - GO(vkGetDisplayPlaneCapabilitiesKHR, iFpUup_t) \ - GO(vkAllocateMemory, iFpppp_t) \ - GO(vkCreateAccelerationStructureKHR, iFpppp_t) \ - GO(vkCreateAccelerationStructureNV, iFpppp_t) \ - GO(vkCreateAndroidSurfaceKHR, iFpppp_t) \ - GO(vkCreateBuffer, iFpppp_t) \ - GO(vkCreateBufferView, iFpppp_t) \ - GO(vkCreateCommandPool, iFpppp_t) \ - GO(vkCreateCuFunctionNVX, iFpppp_t) \ - GO(vkCreateCuModuleNVX, iFpppp_t) \ - GO(vkCreateCudaFunctionNV, iFpppp_t) \ - GO(vkCreateCudaModuleNV, iFpppp_t) \ - GO(vkCreateDebugReportCallbackEXT, iFpppp_t) \ - GO(vkCreateDebugUtilsMessengerEXT, iFpppp_t) \ - GO(vkCreateDescriptorPool, iFpppp_t) \ - GO(vkCreateDescriptorSetLayout, iFpppp_t) \ - GO(vkCreateDescriptorUpdateTemplate, iFpppp_t) \ - GO(vkCreateDescriptorUpdateTemplateKHR, iFpppp_t) \ - GO(vkCreateDevice, iFpppp_t) \ - GO(vkCreateDisplayPlaneSurfaceKHR, iFpppp_t) \ - GO(vkCreateEvent, iFpppp_t) \ - GO(vkCreateFence, iFpppp_t) \ - GO(vkCreateFramebuffer, iFpppp_t) \ - GO(vkCreateHeadlessSurfaceEXT, iFpppp_t) \ - GO(vkCreateImage, iFpppp_t) \ - GO(vkCreateImageView, iFpppp_t) \ - GO(vkCreateIndirectCommandsLayoutNV, iFpppp_t) \ - GO(vkCreateMicromapEXT, iFpppp_t) \ - GO(vkCreateOpticalFlowSessionNV, iFpppp_t) \ - GO(vkCreatePipelineCache, iFpppp_t) \ - GO(vkCreatePipelineLayout, iFpppp_t) \ - GO(vkCreatePrivateDataSlot, iFpppp_t) \ - GO(vkCreatePrivateDataSlotEXT, iFpppp_t) \ - GO(vkCreateQueryPool, iFpppp_t) \ - GO(vkCreateRenderPass, iFpppp_t) \ - GO(vkCreateRenderPass2, iFpppp_t) \ - GO(vkCreateRenderPass2KHR, iFpppp_t) \ - GO(vkCreateSampler, iFpppp_t) \ - GO(vkCreateSamplerYcbcrConversion, iFpppp_t) \ - GO(vkCreateSamplerYcbcrConversionKHR, iFpppp_t) \ - GO(vkCreateSemaphore, iFpppp_t) \ - GO(vkCreateShaderModule, iFpppp_t) \ - GO(vkCreateSwapchainKHR, iFpppp_t) \ - GO(vkCreateValidationCacheEXT, iFpppp_t) \ - GO(vkCreateVideoSessionKHR, iFpppp_t) \ - GO(vkCreateVideoSessionParametersKHR, iFpppp_t) \ - GO(vkCreateWaylandSurfaceKHR, iFpppp_t) \ - GO(vkCreateXcbSurfaceKHR, iFpppp_t) \ - GO(vkCreateXlibSurfaceKHR, iFpppp_t) \ - GO(vkRegisterDeviceEventEXT, iFpppp_t) \ - GO(vkUpdateDescriptorSets, vFpupup_t) \ - GO(vkCreateShadersEXT, iFpuppp_t) \ - GO(vkCreateSharedSwapchainsKHR, iFpuppp_t) \ - GO(vkCreateDisplayModeKHR, iFpUppp_t) \ - GO(vkRegisterDisplayEventEXT, iFpUppp_t) \ - GO(vkCreateComputePipelines, iFpUuppp_t) \ - GO(vkCreateExecutionGraphPipelinesAMDX, iFpUuppp_t) \ - GO(vkCreateGraphicsPipelines, iFpUuppp_t) \ - GO(vkCreateRayTracingPipelinesNV, iFpUuppp_t) \ - GO(vkCreateRayTracingPipelinesKHR, iFpUUuppp_t) \ - GO(vkGetPhysicalDeviceSparseImageFormatProperties, vFpiiiuipp_t) \ - GO(vkCmdPipelineBarrier, vFpuuuupupup_t) - -#endif // __wrappedvulkanTYPES_H_ diff --git a/src/wrapped/generated/wrappedvulkanundefs.h b/src/wrapped/generated/wrappedvulkanundefs.h deleted file mode 100644 index a43e9a6..0000000 --- a/src/wrapped/generated/wrappedvulkanundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedvulkanUNDEFS_H_ -#define __wrappedvulkanUNDEFS_H_ - - -#endif // __wrappedvulkanUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedwaylandclientdefs.h b/src/wrapped/generated/wrappedwaylandclientdefs.h deleted file mode 100644 index b1aa284..0000000 --- a/src/wrapped/generated/wrappedwaylandclientdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedwaylandclientDEFS_H_ -#define __wrappedwaylandclientDEFS_H_ - - -#endif // __wrappedwaylandclientDEFS_H_ diff --git a/src/wrapped/generated/wrappedwaylandclienttypes.h b/src/wrapped/generated/wrappedwaylandclienttypes.h deleted file mode 100644 index fe0f4d8..0000000 --- a/src/wrapped/generated/wrappedwaylandclienttypes.h +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedwaylandclientTYPES_H_ -#define __wrappedwaylandclientTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef int32_t (*iFppp_t)(void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(wl_proxy_add_listener, iFppp_t) - -#endif // __wrappedwaylandclientTYPES_H_ diff --git a/src/wrapped/generated/wrappedwaylandclientundefs.h b/src/wrapped/generated/wrappedwaylandclientundefs.h deleted file mode 100644 index 3848289..0000000 --- a/src/wrapped/generated/wrappedwaylandclientundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedwaylandclientUNDEFS_H_ -#define __wrappedwaylandclientUNDEFS_H_ - - -#endif // __wrappedwaylandclientUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedwaylandcursordefs.h b/src/wrapped/generated/wrappedwaylandcursordefs.h deleted file mode 100644 index 0a3c0ae..0000000 --- a/src/wrapped/generated/wrappedwaylandcursordefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedwaylandcursorDEFS_H_ -#define __wrappedwaylandcursorDEFS_H_ - - -#endif // __wrappedwaylandcursorDEFS_H_ diff --git a/src/wrapped/generated/wrappedwaylandcursortypes.h b/src/wrapped/generated/wrappedwaylandcursortypes.h deleted file mode 100644 index b04183a..0000000 --- a/src/wrapped/generated/wrappedwaylandcursortypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedwaylandcursorTYPES_H_ -#define __wrappedwaylandcursorTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedwaylandcursorTYPES_H_ diff --git a/src/wrapped/generated/wrappedwaylandcursorundefs.h b/src/wrapped/generated/wrappedwaylandcursorundefs.h deleted file mode 100644 index 88cfda9..0000000 --- a/src/wrapped/generated/wrappedwaylandcursorundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedwaylandcursorUNDEFS_H_ -#define __wrappedwaylandcursorUNDEFS_H_ - - -#endif // __wrappedwaylandcursorUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedwaylandegldefs.h b/src/wrapped/generated/wrappedwaylandegldefs.h deleted file mode 100644 index 7887ffc..0000000 --- a/src/wrapped/generated/wrappedwaylandegldefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedwaylandeglDEFS_H_ -#define __wrappedwaylandeglDEFS_H_ - - -#endif // __wrappedwaylandeglDEFS_H_ diff --git a/src/wrapped/generated/wrappedwaylandegltypes.h b/src/wrapped/generated/wrappedwaylandegltypes.h deleted file mode 100644 index 91c5de4..0000000 --- a/src/wrapped/generated/wrappedwaylandegltypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedwaylandeglTYPES_H_ -#define __wrappedwaylandeglTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedwaylandeglTYPES_H_ diff --git a/src/wrapped/generated/wrappedwaylandeglundefs.h b/src/wrapped/generated/wrappedwaylandeglundefs.h deleted file mode 100644 index 84f92a3..0000000 --- a/src/wrapped/generated/wrappedwaylandeglundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedwaylandeglUNDEFS_H_ -#define __wrappedwaylandeglUNDEFS_H_ - - -#endif // __wrappedwaylandeglUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedxineramadefs.h b/src/wrapped/generated/wrappedxineramadefs.h deleted file mode 100644 index 5d869c9..0000000 --- a/src/wrapped/generated/wrappedxineramadefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxineramaDEFS_H_ -#define __wrappedxineramaDEFS_H_ - - -#endif // __wrappedxineramaDEFS_H_ diff --git a/src/wrapped/generated/wrappedxineramatypes.h b/src/wrapped/generated/wrappedxineramatypes.h deleted file mode 100644 index 111c7e7..0000000 --- a/src/wrapped/generated/wrappedxineramatypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxineramaTYPES_H_ -#define __wrappedxineramaTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedxineramaTYPES_H_ diff --git a/src/wrapped/generated/wrappedxineramaundefs.h b/src/wrapped/generated/wrappedxineramaundefs.h deleted file mode 100644 index 8c55ca0..0000000 --- a/src/wrapped/generated/wrappedxineramaundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxineramaUNDEFS_H_ -#define __wrappedxineramaUNDEFS_H_ - - -#endif // __wrappedxineramaUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedxkbcommondefs.h b/src/wrapped/generated/wrappedxkbcommondefs.h deleted file mode 100644 index 692dd5c..0000000 --- a/src/wrapped/generated/wrappedxkbcommondefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxkbcommonDEFS_H_ -#define __wrappedxkbcommonDEFS_H_ - - -#endif // __wrappedxkbcommonDEFS_H_ diff --git a/src/wrapped/generated/wrappedxkbcommontypes.h b/src/wrapped/generated/wrappedxkbcommontypes.h deleted file mode 100644 index 8ed4d90..0000000 --- a/src/wrapped/generated/wrappedxkbcommontypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxkbcommonTYPES_H_ -#define __wrappedxkbcommonTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedxkbcommonTYPES_H_ diff --git a/src/wrapped/generated/wrappedxkbcommonundefs.h b/src/wrapped/generated/wrappedxkbcommonundefs.h deleted file mode 100644 index 50f3558..0000000 --- a/src/wrapped/generated/wrappedxkbcommonundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxkbcommonUNDEFS_H_ -#define __wrappedxkbcommonUNDEFS_H_ - - -#endif // __wrappedxkbcommonUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedxkbcommonx11defs.h b/src/wrapped/generated/wrappedxkbcommonx11defs.h deleted file mode 100644 index d182bec..0000000 --- a/src/wrapped/generated/wrappedxkbcommonx11defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxkbcommonx11DEFS_H_ -#define __wrappedxkbcommonx11DEFS_H_ - - -#endif // __wrappedxkbcommonx11DEFS_H_ diff --git a/src/wrapped/generated/wrappedxkbcommonx11types.h b/src/wrapped/generated/wrappedxkbcommonx11types.h deleted file mode 100644 index 790d388..0000000 --- a/src/wrapped/generated/wrappedxkbcommonx11types.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxkbcommonx11TYPES_H_ -#define __wrappedxkbcommonx11TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedxkbcommonx11TYPES_H_ diff --git a/src/wrapped/generated/wrappedxkbcommonx11undefs.h b/src/wrapped/generated/wrappedxkbcommonx11undefs.h deleted file mode 100644 index 3d21600..0000000 --- a/src/wrapped/generated/wrappedxkbcommonx11undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxkbcommonx11UNDEFS_H_ -#define __wrappedxkbcommonx11UNDEFS_H_ - - -#endif // __wrappedxkbcommonx11UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedxkbregistrydefs.h b/src/wrapped/generated/wrappedxkbregistrydefs.h deleted file mode 100644 index 2a05478..0000000 --- a/src/wrapped/generated/wrappedxkbregistrydefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxkbregistryDEFS_H_ -#define __wrappedxkbregistryDEFS_H_ - - -#endif // __wrappedxkbregistryDEFS_H_ diff --git a/src/wrapped/generated/wrappedxkbregistrytypes.h b/src/wrapped/generated/wrappedxkbregistrytypes.h deleted file mode 100644 index 51cfef3..0000000 --- a/src/wrapped/generated/wrappedxkbregistrytypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxkbregistryTYPES_H_ -#define __wrappedxkbregistryTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedxkbregistryTYPES_H_ diff --git a/src/wrapped/generated/wrappedxkbregistryundefs.h b/src/wrapped/generated/wrappedxkbregistryundefs.h deleted file mode 100644 index f106d4a..0000000 --- a/src/wrapped/generated/wrappedxkbregistryundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxkbregistryUNDEFS_H_ -#define __wrappedxkbregistryUNDEFS_H_ - - -#endif // __wrappedxkbregistryUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedxml2defs.h b/src/wrapped/generated/wrappedxml2defs.h deleted file mode 100644 index 9e06efc..0000000 --- a/src/wrapped/generated/wrappedxml2defs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxml2DEFS_H_ -#define __wrappedxml2DEFS_H_ - - -#endif // __wrappedxml2DEFS_H_ diff --git a/src/wrapped/generated/wrappedxml2types.h b/src/wrapped/generated/wrappedxml2types.h deleted file mode 100644 index bed5ff5..0000000 --- a/src/wrapped/generated/wrappedxml2types.h +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxml2TYPES_H_ -#define __wrappedxml2TYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFp_t)(void*); -typedef int32_t (*iFp_t)(void*); -typedef void* (*pFv_t)(void); -typedef void (*vFpp_t)(void*, void*); -typedef void* (*pFpp_t)(void*, void*); -typedef void (*vFppp_t)(void*, void*, void*); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef void* (*pFppp_t)(void*, void*, void*); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFpppV_t)(void*, void*, void*, ...); -typedef int32_t (*iFpppA_t)(void*, void*, void*, va_list); -typedef void* (*pFpppi_t)(void*, void*, void*, int32_t); -typedef void* (*pFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFppppp_t)(void*, void*, void*, void*, void*); -typedef void* (*pFppppi_t)(void*, void*, void*, void*, int32_t); -typedef void (*vFpppppp_t)(void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*); -typedef void* (*pFpppppi_t)(void*, void*, void*, void*, void*, int32_t); -typedef void* (*pFppppppi_t)(void*, void*, void*, void*, void*, void*, int32_t); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(xmlSetExternalEntityLoader, vFp_t) \ - GO(xmlParseDocument, iFp_t) \ - GO(__xmlGenericError, pFv_t) \ - GO(__xmlStructuredError, pFv_t) \ - GO(xmlGetExternalEntityLoader, pFv_t) \ - GO(xmlHashFree, vFpp_t) \ - GO(xmlSetGenericErrorFunc, vFpp_t) \ - GO(xmlSetStructuredErrorFunc, vFpp_t) \ - GO(xmlHashCopy, pFpp_t) \ - GO(xmlHashScan, vFppp_t) \ - GO(xmlHashScanFull, vFppp_t) \ - GO(xmlSchemaSetParserStructuredErrors, vFppp_t) \ - GO(xmlSchemaSetValidStructuredErrors, vFppp_t) \ - GO(xmlTextReaderSetErrorHandler, vFppp_t) \ - GO(xmlHashRemoveEntry, iFppp_t) \ - GO(xmlXPathRegisterFunc, iFppp_t) \ - GO(xmlNewCharEncodingHandler, pFppp_t) \ - GO(xmlSchemaSetParserErrors, vFpppp_t) \ - GO(xmlSchemaSetValidErrors, vFpppp_t) \ - GO(xmlHashRemoveEntry2, iFpppp_t) \ - GO(xmlHashUpdateEntry, iFpppp_t) \ - GO(xmlRegisterInputCallbacks, iFpppp_t) \ - GO(xmlRegisterOutputCallbacks, iFpppp_t) \ - GO(xmlTextWriterWriteFormatAttribute, iFpppV_t) \ - GO(xmlTextWriterWriteVFormatAttribute, iFpppA_t) \ - GO(xmlParserInputBufferCreateIO, pFpppi_t) \ - GO(xmlOutputBufferCreateIO, pFpppp_t) \ - GO(xmlHashRemoveEntry3, iFppppp_t) \ - GO(xmlHashUpdateEntry2, iFppppp_t) \ - GO(xmlSaveToIO, pFppppi_t) \ - GO(xmlHashScan3, vFpppppp_t) \ - GO(xmlHashScanFull3, vFpppppp_t) \ - GO(xmlHashUpdateEntry3, iFpppppp_t) \ - GO(xmlCreateIOParserCtxt, pFpppppi_t) \ - GO(xmlReaderForIO, pFpppppi_t) \ - GO(xmlCtxtReadIO, pFppppppi_t) - -#endif // __wrappedxml2TYPES_H_ diff --git a/src/wrapped/generated/wrappedxml2undefs.h b/src/wrapped/generated/wrappedxml2undefs.h deleted file mode 100644 index cb9cbb7..0000000 --- a/src/wrapped/generated/wrappedxml2undefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxml2UNDEFS_H_ -#define __wrappedxml2UNDEFS_H_ - - -#endif // __wrappedxml2UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedxshmfencedefs.h b/src/wrapped/generated/wrappedxshmfencedefs.h deleted file mode 100644 index 38ffbde..0000000 --- a/src/wrapped/generated/wrappedxshmfencedefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxshmfenceDEFS_H_ -#define __wrappedxshmfenceDEFS_H_ - - -#endif // __wrappedxshmfenceDEFS_H_ diff --git a/src/wrapped/generated/wrappedxshmfencetypes.h b/src/wrapped/generated/wrappedxshmfencetypes.h deleted file mode 100644 index 01c92a2..0000000 --- a/src/wrapped/generated/wrappedxshmfencetypes.h +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxshmfenceTYPES_H_ -#define __wrappedxshmfenceTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - - -#define SUPER() ADDED_FUNCTIONS() - -#endif // __wrappedxshmfenceTYPES_H_ diff --git a/src/wrapped/generated/wrappedxshmfenceundefs.h b/src/wrapped/generated/wrappedxshmfenceundefs.h deleted file mode 100644 index 57603fd..0000000 --- a/src/wrapped/generated/wrappedxshmfenceundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxshmfenceUNDEFS_H_ -#define __wrappedxshmfenceUNDEFS_H_ - - -#endif // __wrappedxshmfenceUNDEFS_H_ diff --git a/src/wrapped/generated/wrappedxsltdefs.h b/src/wrapped/generated/wrappedxsltdefs.h deleted file mode 100644 index bc87e36..0000000 --- a/src/wrapped/generated/wrappedxsltdefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxsltDEFS_H_ -#define __wrappedxsltDEFS_H_ - - -#endif // __wrappedxsltDEFS_H_ diff --git a/src/wrapped/generated/wrappedxslttypes.h b/src/wrapped/generated/wrappedxslttypes.h deleted file mode 100644 index c96a364..0000000 --- a/src/wrapped/generated/wrappedxslttypes.h +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxsltTYPES_H_ -#define __wrappedxsltTYPES_H_ - -#ifndef LIBNAME -#error You should only #include this file inside a wrapped*.c file -#endif -#ifndef ADDED_FUNCTIONS -#define ADDED_FUNCTIONS() -#endif - -typedef void (*vFv_t)(void); -typedef void (*vFp_t)(void*); -typedef void (*vFpp_t)(void*, void*); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); - -#define SUPER() ADDED_FUNCTIONS() \ - GO(xsltInit, vFv_t) \ - GO(xsltSetLoaderFunc, vFp_t) \ - GO(xsltSetCtxtSortFunc, vFpp_t) \ - GO(xsltRegisterExtModuleFunction, iFppp_t) \ - GO(xsltSetSecurityPrefs, iFppp_t) \ - GO(xsltRegisterExtFunction, iFpppp_t) - -#endif // __wrappedxsltTYPES_H_ diff --git a/src/wrapped/generated/wrappedxsltundefs.h b/src/wrapped/generated/wrappedxsltundefs.h deleted file mode 100644 index 057facc..0000000 --- a/src/wrapped/generated/wrappedxsltundefs.h +++ /dev/null @@ -1,8 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __wrappedxsltUNDEFS_H_ -#define __wrappedxsltUNDEFS_H_ - - -#endif // __wrappedxsltUNDEFS_H_ diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c deleted file mode 100644 index 51e63c1..0000000 --- a/src/wrapped/generated/wrapper.c +++ /dev/null @@ -1,8479 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#include -#include -#include - -#include "wrapper.h" -#include "emu/x64emu_private.h" -#include "emu/x87emu_private.h" -#include "regs.h" -#include "x64emu.h" -#define COMPLEX_IMPL -#include "complext.h" - -extern void* my__IO_2_1_stdin_ ; -extern void* my__IO_2_1_stdout_; -extern void* my__IO_2_1_stderr_; - -static void* io_convert(void* v) -{ - if(!v) - return v; - if(v == my__IO_2_1_stdin_) - return stdin; - if(v == my__IO_2_1_stdout_) - return stdout; - if(v == my__IO_2_1_stderr_) - return stderr; - return v; -} - -#define ST0val ST0.d - -int of_convert(int); -void* align_xcb_connection(void* src); -void unalign_xcb_connection(void* src, void* dst); - -typedef void (*vFE_t)(x64emu_t*); -typedef void (*vFv_t)(void); -typedef void (*vFc_t)(int8_t); -typedef void (*vFw_t)(int16_t); -typedef void (*vFi_t)(int32_t); -typedef void (*vFC_t)(uint8_t); -typedef void (*vFW_t)(uint16_t); -typedef void (*vFu_t)(uint32_t); -typedef void (*vFU_t)(uint64_t); -typedef void (*vFf_t)(float); -typedef void (*vFd_t)(double); -typedef void (*vFl_t)(intptr_t); -typedef void (*vFL_t)(uintptr_t); -typedef void (*vFp_t)(void*); -typedef void (*vFS_t)(void*); -typedef void (*vFb_t)(void*); -typedef int8_t (*cFv_t)(void); -typedef int8_t (*cFi_t)(int32_t); -typedef int8_t (*cFu_t)(uint32_t); -typedef int8_t (*cFf_t)(float); -typedef int8_t (*cFp_t)(void*); -typedef int16_t (*wFp_t)(void*); -typedef int32_t (*iFE_t)(x64emu_t*); -typedef int32_t (*iFv_t)(void); -typedef int32_t (*iFw_t)(int16_t); -typedef int32_t (*iFi_t)(int32_t); -typedef int32_t (*iFI_t)(int64_t); -typedef int32_t (*iFC_t)(uint8_t); -typedef int32_t (*iFW_t)(uint16_t); -typedef int32_t (*iFu_t)(uint32_t); -typedef int32_t (*iFU_t)(uint64_t); -typedef int32_t (*iFf_t)(float); -typedef int32_t (*iFd_t)(double); -typedef int32_t (*iFD_t)(long double); -typedef int32_t (*iFl_t)(intptr_t); -typedef int32_t (*iFL_t)(uintptr_t); -typedef int32_t (*iFp_t)(void*); -typedef int32_t (*iFO_t)(int32_t); -typedef int32_t (*iFS_t)(void*); -typedef int32_t (*iFP_t)(void*); -typedef int32_t (*iFb_t)(void*); -typedef int64_t (*IFv_t)(void); -typedef int64_t (*IFi_t)(int32_t); -typedef int64_t (*IFI_t)(int64_t); -typedef int64_t (*IFf_t)(float); -typedef int64_t (*IFd_t)(double); -typedef int64_t (*IFp_t)(void*); -typedef uint8_t (*CFv_t)(void); -typedef uint8_t (*CFi_t)(int32_t); -typedef uint8_t (*CFC_t)(uint8_t); -typedef uint8_t (*CFW_t)(uint16_t); -typedef uint8_t (*CFu_t)(uint32_t); -typedef uint8_t (*CFl_t)(intptr_t); -typedef uint8_t (*CFL_t)(uintptr_t); -typedef uint8_t (*CFp_t)(void*); -typedef uint16_t (*WFi_t)(int32_t); -typedef uint16_t (*WFW_t)(uint16_t); -typedef uint16_t (*WFu_t)(uint32_t); -typedef uint16_t (*WFp_t)(void*); -typedef uint32_t (*uFv_t)(void); -typedef uint32_t (*uFi_t)(int32_t); -typedef uint32_t (*uFu_t)(uint32_t); -typedef uint32_t (*uFd_t)(double); -typedef uint32_t (*uFl_t)(intptr_t); -typedef uint32_t (*uFL_t)(uintptr_t); -typedef uint32_t (*uFp_t)(void*); -typedef uint32_t (*uFb_t)(void*); -typedef uint64_t (*UFv_t)(void); -typedef uint64_t (*UFu_t)(uint32_t); -typedef uint64_t (*UFp_t)(void*); -typedef float (*fFi_t)(int32_t); -typedef float (*fFf_t)(float); -typedef float (*fFp_t)(void*); -typedef double (*dFv_t)(void); -typedef double (*dFi_t)(int32_t); -typedef double (*dFu_t)(uint32_t); -typedef double (*dFd_t)(double); -typedef double (*dFL_t)(uintptr_t); -typedef double (*dFp_t)(void*); -typedef intptr_t (*lFE_t)(x64emu_t*); -typedef intptr_t (*lFv_t)(void); -typedef intptr_t (*lFi_t)(int32_t); -typedef intptr_t (*lFu_t)(uint32_t); -typedef intptr_t (*lFl_t)(intptr_t); -typedef intptr_t (*lFp_t)(void*); -typedef uintptr_t (*LFv_t)(void); -typedef uintptr_t (*LFi_t)(int32_t); -typedef uintptr_t (*LFu_t)(uint32_t); -typedef uintptr_t (*LFd_t)(double); -typedef uintptr_t (*LFL_t)(uintptr_t); -typedef uintptr_t (*LFp_t)(void*); -typedef void* (*pFE_t)(x64emu_t*); -typedef void* (*pFv_t)(void); -typedef void* (*pFw_t)(int16_t); -typedef void* (*pFi_t)(int32_t); -typedef void* (*pFC_t)(uint8_t); -typedef void* (*pFW_t)(uint16_t); -typedef void* (*pFu_t)(uint32_t); -typedef void* (*pFU_t)(uint64_t); -typedef void* (*pFd_t)(double); -typedef void* (*pFl_t)(intptr_t); -typedef void* (*pFL_t)(uintptr_t); -typedef void* (*pFp_t)(void*); -typedef void* (*pFV_t)(void*); -typedef void* (*pFA_t)(void*); -typedef void* (*pFb_t)(void*); -typedef unsigned __int128 (*HFi_t)(int32_t); -typedef unsigned __int128 (*HFp_t)(void*); -typedef complexf_t (*xFx_t)(complexf_t); -typedef complex_t (*XFX_t)(complex_t); -typedef void (*vWp_t)(void*); -typedef int32_t (*iWp_t)(void*); -typedef uint32_t (*uWp_t)(void*); -typedef float (*fWp_t)(void*); -typedef void (*vFEi_t)(x64emu_t*, int32_t); -typedef void (*vFEp_t)(x64emu_t*, void*); -typedef void (*vFcc_t)(int8_t, int8_t); -typedef void (*vFww_t)(int16_t, int16_t); -typedef void (*vFii_t)(int32_t, int32_t); -typedef void (*vFiW_t)(int32_t, uint16_t); -typedef void (*vFiu_t)(int32_t, uint32_t); -typedef void (*vFiU_t)(int32_t, uint64_t); -typedef void (*vFif_t)(int32_t, float); -typedef void (*vFid_t)(int32_t, double); -typedef void (*vFil_t)(int32_t, intptr_t); -typedef void (*vFiL_t)(int32_t, uintptr_t); -typedef void (*vFip_t)(int32_t, void*); -typedef void (*vFWW_t)(uint16_t, uint16_t); -typedef void (*vFWp_t)(uint16_t, void*); -typedef void (*vFuc_t)(uint32_t, int8_t); -typedef void (*vFuw_t)(uint32_t, int16_t); -typedef void (*vFui_t)(uint32_t, int32_t); -typedef void (*vFuC_t)(uint32_t, uint8_t); -typedef void (*vFuW_t)(uint32_t, uint16_t); -typedef void (*vFuu_t)(uint32_t, uint32_t); -typedef void (*vFuU_t)(uint32_t, uint64_t); -typedef void (*vFuf_t)(uint32_t, float); -typedef void (*vFud_t)(uint32_t, double); -typedef void (*vFul_t)(uint32_t, intptr_t); -typedef void (*vFuL_t)(uint32_t, uintptr_t); -typedef void (*vFup_t)(uint32_t, void*); -typedef void (*vFUi_t)(uint64_t, int32_t); -typedef void (*vFfi_t)(float, int32_t); -typedef void (*vFfC_t)(float, uint8_t); -typedef void (*vFff_t)(float, float); -typedef void (*vFfp_t)(float, void*); -typedef void (*vFdd_t)(double, double); -typedef void (*vFlu_t)(intptr_t, uint32_t); -typedef void (*vFlp_t)(intptr_t, void*); -typedef void (*vFLu_t)(uintptr_t, uint32_t); -typedef void (*vFLL_t)(uintptr_t, uintptr_t); -typedef void (*vFLp_t)(uintptr_t, void*); -typedef void (*vFpc_t)(void*, int8_t); -typedef void (*vFpi_t)(void*, int32_t); -typedef void (*vFpI_t)(void*, int64_t); -typedef void (*vFpC_t)(void*, uint8_t); -typedef void (*vFpW_t)(void*, uint16_t); -typedef void (*vFpu_t)(void*, uint32_t); -typedef void (*vFpU_t)(void*, uint64_t); -typedef void (*vFpf_t)(void*, float); -typedef void (*vFpd_t)(void*, double); -typedef void (*vFpl_t)(void*, intptr_t); -typedef void (*vFpL_t)(void*, uintptr_t); -typedef void (*vFpp_t)(void*, void*); -typedef void (*vFpV_t)(void*, void*); -typedef void (*vFpS_t)(void*, void*); -typedef void (*vFSi_t)(void*, int32_t); -typedef void (*vFbi_t)(void*, int32_t); -typedef void (*vFbu_t)(void*, uint32_t); -typedef void (*vFbU_t)(void*, uint64_t); -typedef void (*vFbp_t)(void*, void*); -typedef int8_t (*cFpi_t)(void*, int32_t); -typedef int8_t (*cFpp_t)(void*, void*); -typedef int16_t (*wFpi_t)(void*, int32_t); -typedef int32_t (*iFEi_t)(x64emu_t*, int32_t); -typedef int32_t (*iFEf_t)(x64emu_t*, float); -typedef int32_t (*iFEd_t)(x64emu_t*, double); -typedef int32_t (*iFEL_t)(x64emu_t*, uintptr_t); -typedef int32_t (*iFEp_t)(x64emu_t*, void*); -typedef int32_t (*iFwp_t)(int16_t, void*); -typedef int32_t (*iFii_t)(int32_t, int32_t); -typedef int32_t (*iFiI_t)(int32_t, int64_t); -typedef int32_t (*iFiC_t)(int32_t, uint8_t); -typedef int32_t (*iFiu_t)(int32_t, uint32_t); -typedef int32_t (*iFil_t)(int32_t, intptr_t); -typedef int32_t (*iFiL_t)(int32_t, uintptr_t); -typedef int32_t (*iFip_t)(int32_t, void*); -typedef int32_t (*iFiS_t)(int32_t, void*); -typedef int32_t (*iFui_t)(uint32_t, int32_t); -typedef int32_t (*iFuu_t)(uint32_t, uint32_t); -typedef int32_t (*iFuL_t)(uint32_t, uintptr_t); -typedef int32_t (*iFup_t)(uint32_t, void*); -typedef int32_t (*iFUp_t)(uint64_t, void*); -typedef int32_t (*iFli_t)(intptr_t, int32_t); -typedef int32_t (*iFlp_t)(intptr_t, void*); -typedef int32_t (*iFLi_t)(uintptr_t, int32_t); -typedef int32_t (*iFLu_t)(uintptr_t, uint32_t); -typedef int32_t (*iFLL_t)(uintptr_t, uintptr_t); -typedef int32_t (*iFLp_t)(uintptr_t, void*); -typedef int32_t (*iFpw_t)(void*, int16_t); -typedef int32_t (*iFpi_t)(void*, int32_t); -typedef int32_t (*iFpI_t)(void*, int64_t); -typedef int32_t (*iFpC_t)(void*, uint8_t); -typedef int32_t (*iFpW_t)(void*, uint16_t); -typedef int32_t (*iFpu_t)(void*, uint32_t); -typedef int32_t (*iFpU_t)(void*, uint64_t); -typedef int32_t (*iFpf_t)(void*, float); -typedef int32_t (*iFpd_t)(void*, double); -typedef int32_t (*iFpl_t)(void*, intptr_t); -typedef int32_t (*iFpL_t)(void*, uintptr_t); -typedef int32_t (*iFpp_t)(void*, void*); -typedef int32_t (*iFpO_t)(void*, int32_t); -typedef int32_t (*iFSi_t)(void*, int32_t); -typedef int64_t (*IFEi_t)(x64emu_t*, int32_t); -typedef int64_t (*IFEf_t)(x64emu_t*, float); -typedef int64_t (*IFEd_t)(x64emu_t*, double); -typedef int64_t (*IFEp_t)(x64emu_t*, void*); -typedef int64_t (*IFip_t)(int32_t, void*); -typedef int64_t (*IFII_t)(int64_t, int64_t); -typedef int64_t (*IFpi_t)(void*, int32_t); -typedef int64_t (*IFpu_t)(void*, uint32_t); -typedef int64_t (*IFpd_t)(void*, double); -typedef int64_t (*IFpp_t)(void*, void*); -typedef uint8_t (*CFip_t)(int32_t, void*); -typedef uint8_t (*CFCi_t)(uint8_t, int32_t); -typedef uint8_t (*CFui_t)(uint32_t, int32_t); -typedef uint8_t (*CFuW_t)(uint32_t, uint16_t); -typedef uint8_t (*CFuu_t)(uint32_t, uint32_t); -typedef uint8_t (*CFuL_t)(uint32_t, uintptr_t); -typedef uint8_t (*CFpi_t)(void*, int32_t); -typedef uint8_t (*CFpu_t)(void*, uint32_t); -typedef uint8_t (*CFpL_t)(void*, uintptr_t); -typedef uint8_t (*CFpp_t)(void*, void*); -typedef uint16_t (*WFpi_t)(void*, int32_t); -typedef uint16_t (*WFpp_t)(void*, void*); -typedef uint32_t (*uFEp_t)(x64emu_t*, void*); -typedef uint32_t (*uFii_t)(int32_t, int32_t); -typedef uint32_t (*uFiu_t)(int32_t, uint32_t); -typedef uint32_t (*uFip_t)(int32_t, void*); -typedef uint32_t (*uFui_t)(uint32_t, int32_t); -typedef uint32_t (*uFuu_t)(uint32_t, uint32_t); -typedef uint32_t (*uFup_t)(uint32_t, void*); -typedef uint32_t (*uFuM_t)(uint32_t, ...); -typedef uint32_t (*uFpw_t)(void*, int16_t); -typedef uint32_t (*uFpi_t)(void*, int32_t); -typedef uint32_t (*uFpC_t)(void*, uint8_t); -typedef uint32_t (*uFpu_t)(void*, uint32_t); -typedef uint32_t (*uFpU_t)(void*, uint64_t); -typedef uint32_t (*uFpf_t)(void*, float); -typedef uint32_t (*uFpl_t)(void*, intptr_t); -typedef uint32_t (*uFpL_t)(void*, uintptr_t); -typedef uint32_t (*uFpp_t)(void*, void*); -typedef uint32_t (*uFbu_t)(void*, uint32_t); -typedef uint64_t (*UFEp_t)(x64emu_t*, void*); -typedef uint64_t (*UFuu_t)(uint32_t, uint32_t); -typedef uint64_t (*UFUp_t)(uint64_t, void*); -typedef uint64_t (*UFpi_t)(void*, int32_t); -typedef uint64_t (*UFpU_t)(void*, uint64_t); -typedef uint64_t (*UFpp_t)(void*, void*); -typedef float (*fFEf_t)(x64emu_t*, float); -typedef float (*fFEp_t)(x64emu_t*, void*); -typedef float (*fFif_t)(int32_t, float); -typedef float (*fFfi_t)(float, int32_t); -typedef float (*fFff_t)(float, float); -typedef float (*fFfD_t)(float, long double); -typedef float (*fFfp_t)(float, void*); -typedef float (*fFpu_t)(void*, uint32_t); -typedef float (*fFpp_t)(void*, void*); -typedef float (*fFbu_t)(void*, uint32_t); -typedef double (*dFEd_t)(x64emu_t*, double); -typedef double (*dFid_t)(int32_t, double); -typedef double (*dFdi_t)(double, int32_t); -typedef double (*dFdd_t)(double, double); -typedef double (*dFdD_t)(double, long double); -typedef double (*dFdp_t)(double, void*); -typedef double (*dFll_t)(intptr_t, intptr_t); -typedef double (*dFpi_t)(void*, int32_t); -typedef double (*dFpu_t)(void*, uint32_t); -typedef double (*dFpd_t)(void*, double); -typedef double (*dFpp_t)(void*, void*); -typedef long double (*DFDi_t)(long double, int32_t); -typedef long double (*DFDD_t)(long double, long double); -typedef long double (*DFDp_t)(long double, void*); -typedef long double (*DFpp_t)(void*, void*); -typedef intptr_t (*lFEi_t)(x64emu_t*, int32_t); -typedef intptr_t (*lFii_t)(int32_t, int32_t); -typedef intptr_t (*lFip_t)(int32_t, void*); -typedef intptr_t (*lFui_t)(uint32_t, int32_t); -typedef intptr_t (*lFll_t)(intptr_t, intptr_t); -typedef intptr_t (*lFpi_t)(void*, int32_t); -typedef intptr_t (*lFpd_t)(void*, double); -typedef intptr_t (*lFpl_t)(void*, intptr_t); -typedef intptr_t (*lFpp_t)(void*, void*); -typedef uintptr_t (*LFEL_t)(x64emu_t*, uintptr_t); -typedef uintptr_t (*LFEp_t)(x64emu_t*, void*); -typedef uintptr_t (*LFii_t)(int32_t, int32_t); -typedef uintptr_t (*LFuu_t)(uint32_t, uint32_t); -typedef uintptr_t (*LFUp_t)(uint64_t, void*); -typedef uintptr_t (*LFLi_t)(uintptr_t, int32_t); -typedef uintptr_t (*LFLL_t)(uintptr_t, uintptr_t); -typedef uintptr_t (*LFLp_t)(uintptr_t, void*); -typedef uintptr_t (*LFpi_t)(void*, int32_t); -typedef uintptr_t (*LFpu_t)(void*, uint32_t); -typedef uintptr_t (*LFpL_t)(void*, uintptr_t); -typedef uintptr_t (*LFpp_t)(void*, void*); -typedef void* (*pFEi_t)(x64emu_t*, int32_t); -typedef void* (*pFEL_t)(x64emu_t*, uintptr_t); -typedef void* (*pFEp_t)(x64emu_t*, void*); -typedef void* (*pFii_t)(int32_t, int32_t); -typedef void* (*pFiI_t)(int32_t, int64_t); -typedef void* (*pFiu_t)(int32_t, uint32_t); -typedef void* (*pFip_t)(int32_t, void*); -typedef void* (*pFiV_t)(int32_t, void*); -typedef void* (*pFui_t)(uint32_t, int32_t); -typedef void* (*pFuu_t)(uint32_t, uint32_t); -typedef void* (*pFup_t)(uint32_t, void*); -typedef void* (*pFUU_t)(uint64_t, uint64_t); -typedef void* (*pFdi_t)(double, int32_t); -typedef void* (*pFdd_t)(double, double); -typedef void* (*pFli_t)(intptr_t, int32_t); -typedef void* (*pFll_t)(intptr_t, intptr_t); -typedef void* (*pFlp_t)(intptr_t, void*); -typedef void* (*pFLi_t)(uintptr_t, int32_t); -typedef void* (*pFLC_t)(uintptr_t, uint8_t); -typedef void* (*pFLu_t)(uintptr_t, uint32_t); -typedef void* (*pFLL_t)(uintptr_t, uintptr_t); -typedef void* (*pFLp_t)(uintptr_t, void*); -typedef void* (*pFpi_t)(void*, int32_t); -typedef void* (*pFpC_t)(void*, uint8_t); -typedef void* (*pFpW_t)(void*, uint16_t); -typedef void* (*pFpu_t)(void*, uint32_t); -typedef void* (*pFpU_t)(void*, uint64_t); -typedef void* (*pFpd_t)(void*, double); -typedef void* (*pFpl_t)(void*, intptr_t); -typedef void* (*pFpL_t)(void*, uintptr_t); -typedef void* (*pFpp_t)(void*, void*); -typedef void* (*pFSi_t)(void*, int32_t); -typedef void* (*pFbC_t)(void*, uint8_t); -typedef void* (*pFbu_t)(void*, uint32_t); -typedef void* (*pFbp_t)(void*, void*); -typedef unsigned __int128 (*HFII_t)(int64_t, int64_t); -typedef unsigned __int128 (*HFll_t)(intptr_t, intptr_t); -typedef unsigned __int128 (*HFpi_t)(void*, int32_t); -typedef unsigned __int128 (*HFpp_t)(void*, void*); -typedef complexf_t (*xFxx_t)(complexf_t, complexf_t); -typedef complex_t (*XFXX_t)(complex_t, complex_t); -typedef int32_t (*iWpi_t)(void*, int32_t); -typedef int32_t (*iWpu_t)(void*, uint32_t); -typedef int32_t (*iWpf_t)(void*, float); -typedef int32_t (*iWpp_t)(void*, void*); -typedef uint32_t (*uWpu_t)(void*, uint32_t); -typedef void* (*pWEp_t)(x64emu_t*, void*); -typedef void* (*pWpu_t)(void*, uint32_t); -typedef void (*vFEpi_t)(x64emu_t*, void*, int32_t); -typedef void (*vFEpu_t)(x64emu_t*, void*, uint32_t); -typedef void (*vFEpp_t)(x64emu_t*, void*, void*); -typedef void (*vFEpV_t)(x64emu_t*, void*, void*); -typedef void (*vFEpA_t)(x64emu_t*, void*, void*); -typedef void (*vFccc_t)(int8_t, int8_t, int8_t); -typedef void (*vFwww_t)(int16_t, int16_t, int16_t); -typedef void (*vFiii_t)(int32_t, int32_t, int32_t); -typedef void (*vFiif_t)(int32_t, int32_t, float); -typedef void (*vFiip_t)(int32_t, int32_t, void*); -typedef void (*vFiui_t)(int32_t, uint32_t, int32_t); -typedef void (*vFiuu_t)(int32_t, uint32_t, uint32_t); -typedef void (*vFiuU_t)(int32_t, uint32_t, uint64_t); -typedef void (*vFiup_t)(int32_t, uint32_t, void*); -typedef void (*vFiff_t)(int32_t, float, float); -typedef void (*vFidd_t)(int32_t, double, double); -typedef void (*vFilu_t)(int32_t, intptr_t, uint32_t); -typedef void (*vFill_t)(int32_t, intptr_t, intptr_t); -typedef void (*vFilp_t)(int32_t, intptr_t, void*); -typedef void (*vFiLL_t)(int32_t, uintptr_t, uintptr_t); -typedef void (*vFipi_t)(int32_t, void*, int32_t); -typedef void (*vFipu_t)(int32_t, void*, uint32_t); -typedef void (*vFipL_t)(int32_t, void*, uintptr_t); -typedef void (*vFipp_t)(int32_t, void*, void*); -typedef void (*vFCCC_t)(uint8_t, uint8_t, uint8_t); -typedef void (*vFWWW_t)(uint16_t, uint16_t, uint16_t); -typedef void (*vFucc_t)(uint32_t, int8_t, int8_t); -typedef void (*vFuww_t)(uint32_t, int16_t, int16_t); -typedef void (*vFuii_t)(uint32_t, int32_t, int32_t); -typedef void (*vFuiu_t)(uint32_t, int32_t, uint32_t); -typedef void (*vFuiU_t)(uint32_t, int32_t, uint64_t); -typedef void (*vFuif_t)(uint32_t, int32_t, float); -typedef void (*vFuid_t)(uint32_t, int32_t, double); -typedef void (*vFuil_t)(uint32_t, int32_t, intptr_t); -typedef void (*vFuiL_t)(uint32_t, int32_t, uintptr_t); -typedef void (*vFuip_t)(uint32_t, int32_t, void*); -typedef void (*vFuWW_t)(uint32_t, uint16_t, uint16_t); -typedef void (*vFuui_t)(uint32_t, uint32_t, int32_t); -typedef void (*vFuuC_t)(uint32_t, uint32_t, uint8_t); -typedef void (*vFuuu_t)(uint32_t, uint32_t, uint32_t); -typedef void (*vFuuU_t)(uint32_t, uint32_t, uint64_t); -typedef void (*vFuuf_t)(uint32_t, uint32_t, float); -typedef void (*vFuud_t)(uint32_t, uint32_t, double); -typedef void (*vFuuL_t)(uint32_t, uint32_t, uintptr_t); -typedef void (*vFuup_t)(uint32_t, uint32_t, void*); -typedef void (*vFuff_t)(uint32_t, float, float); -typedef void (*vFufp_t)(uint32_t, float, void*); -typedef void (*vFudd_t)(uint32_t, double, double); -typedef void (*vFull_t)(uint32_t, intptr_t, intptr_t); -typedef void (*vFulp_t)(uint32_t, intptr_t, void*); -typedef void (*vFuLL_t)(uint32_t, uintptr_t, uintptr_t); -typedef void (*vFuLp_t)(uint32_t, uintptr_t, void*); -typedef void (*vFupu_t)(uint32_t, void*, uint32_t); -typedef void (*vFupp_t)(uint32_t, void*, void*); -typedef void (*vFfff_t)(float, float, float); -typedef void (*vFfpp_t)(float, void*, void*); -typedef void (*vFddd_t)(double, double, double); -typedef void (*vFdpp_t)(double, void*, void*); -typedef void (*vFlii_t)(intptr_t, int32_t, int32_t); -typedef void (*vFlip_t)(intptr_t, int32_t, void*); -typedef void (*vFllp_t)(intptr_t, intptr_t, void*); -typedef void (*vFlpp_t)(intptr_t, void*, void*); -typedef void (*vFLup_t)(uintptr_t, uint32_t, void*); -typedef void (*vFLpL_t)(uintptr_t, void*, uintptr_t); -typedef void (*vFLpp_t)(uintptr_t, void*, void*); -typedef void (*vFpic_t)(void*, int32_t, int8_t); -typedef void (*vFpii_t)(void*, int32_t, int32_t); -typedef void (*vFpiI_t)(void*, int32_t, int64_t); -typedef void (*vFpiC_t)(void*, int32_t, uint8_t); -typedef void (*vFpiu_t)(void*, int32_t, uint32_t); -typedef void (*vFpiU_t)(void*, int32_t, uint64_t); -typedef void (*vFpif_t)(void*, int32_t, float); -typedef void (*vFpid_t)(void*, int32_t, double); -typedef void (*vFpiL_t)(void*, int32_t, uintptr_t); -typedef void (*vFpip_t)(void*, int32_t, void*); -typedef void (*vFpui_t)(void*, uint32_t, int32_t); -typedef void (*vFpuI_t)(void*, uint32_t, int64_t); -typedef void (*vFpuW_t)(void*, uint32_t, uint16_t); -typedef void (*vFpuu_t)(void*, uint32_t, uint32_t); -typedef void (*vFpuU_t)(void*, uint32_t, uint64_t); -typedef void (*vFpuf_t)(void*, uint32_t, float); -typedef void (*vFpud_t)(void*, uint32_t, double); -typedef void (*vFpuL_t)(void*, uint32_t, uintptr_t); -typedef void (*vFpup_t)(void*, uint32_t, void*); -typedef void (*vFpUi_t)(void*, uint64_t, int32_t); -typedef void (*vFpUu_t)(void*, uint64_t, uint32_t); -typedef void (*vFpUU_t)(void*, uint64_t, uint64_t); -typedef void (*vFpUf_t)(void*, uint64_t, float); -typedef void (*vFpUp_t)(void*, uint64_t, void*); -typedef void (*vFpff_t)(void*, float, float); -typedef void (*vFpdu_t)(void*, double, uint32_t); -typedef void (*vFpdd_t)(void*, double, double); -typedef void (*vFpdp_t)(void*, double, void*); -typedef void (*vFpll_t)(void*, intptr_t, intptr_t); -typedef void (*vFplp_t)(void*, intptr_t, void*); -typedef void (*vFpLi_t)(void*, uintptr_t, int32_t); -typedef void (*vFpLu_t)(void*, uintptr_t, uint32_t); -typedef void (*vFpLL_t)(void*, uintptr_t, uintptr_t); -typedef void (*vFpLp_t)(void*, uintptr_t, void*); -typedef void (*vFppi_t)(void*, void*, int32_t); -typedef void (*vFppu_t)(void*, void*, uint32_t); -typedef void (*vFppU_t)(void*, void*, uint64_t); -typedef void (*vFppf_t)(void*, void*, float); -typedef void (*vFppd_t)(void*, void*, double); -typedef void (*vFppl_t)(void*, void*, intptr_t); -typedef void (*vFppL_t)(void*, void*, uintptr_t); -typedef void (*vFppp_t)(void*, void*, void*); -typedef void (*vFppV_t)(void*, void*, void*); -typedef int8_t (*cFpdp_t)(void*, double, void*); -typedef int16_t (*wFppp_t)(void*, void*, void*); -typedef int32_t (*iFEiw_t)(x64emu_t*, int32_t, int16_t); -typedef int32_t (*iFEip_t)(x64emu_t*, int32_t, void*); -typedef int32_t (*iFEWW_t)(x64emu_t*, uint16_t, uint16_t); -typedef int32_t (*iFEup_t)(x64emu_t*, uint32_t, void*); -typedef int32_t (*iFEUU_t)(x64emu_t*, uint64_t, uint64_t); -typedef int32_t (*iFELp_t)(x64emu_t*, uintptr_t, void*); -typedef int32_t (*iFEpi_t)(x64emu_t*, void*, int32_t); -typedef int32_t (*iFEpU_t)(x64emu_t*, void*, uint64_t); -typedef int32_t (*iFEpL_t)(x64emu_t*, void*, uintptr_t); -typedef int32_t (*iFEpp_t)(x64emu_t*, void*, void*); -typedef int32_t (*iFEpV_t)(x64emu_t*, void*, void*); -typedef int32_t (*iFEpA_t)(x64emu_t*, void*, void*); -typedef int32_t (*iFESp_t)(x64emu_t*, void*, void*); -typedef int32_t (*iFwww_t)(int16_t, int16_t, int16_t); -typedef int32_t (*iFwpp_t)(int16_t, void*, void*); -typedef int32_t (*iFiwC_t)(int32_t, int16_t, uint8_t); -typedef int32_t (*iFiii_t)(int32_t, int32_t, int32_t); -typedef int32_t (*iFiiI_t)(int32_t, int32_t, int64_t); -typedef int32_t (*iFiiu_t)(int32_t, int32_t, uint32_t); -typedef int32_t (*iFiil_t)(int32_t, int32_t, intptr_t); -typedef int32_t (*iFiip_t)(int32_t, int32_t, void*); -typedef int32_t (*iFiiO_t)(int32_t, int32_t, int32_t); -typedef int32_t (*iFiCC_t)(int32_t, uint8_t, uint8_t); -typedef int32_t (*iFiui_t)(int32_t, uint32_t, int32_t); -typedef int32_t (*iFiuu_t)(int32_t, uint32_t, uint32_t); -typedef int32_t (*iFiup_t)(int32_t, uint32_t, void*); -typedef int32_t (*iFill_t)(int32_t, intptr_t, intptr_t); -typedef int32_t (*iFilp_t)(int32_t, intptr_t, void*); -typedef int32_t (*iFiLi_t)(int32_t, uintptr_t, int32_t); -typedef int32_t (*iFiLp_t)(int32_t, uintptr_t, void*); -typedef int32_t (*iFiLN_t)(int32_t, uintptr_t, ...); -typedef int32_t (*iFipi_t)(int32_t, void*, int32_t); -typedef int32_t (*iFipu_t)(int32_t, void*, uint32_t); -typedef int32_t (*iFipL_t)(int32_t, void*, uintptr_t); -typedef int32_t (*iFipp_t)(int32_t, void*, void*); -typedef int32_t (*iFipO_t)(int32_t, void*, int32_t); -typedef int32_t (*iFCuW_t)(uint8_t, uint32_t, uint16_t); -typedef int32_t (*iFuwp_t)(uint32_t, int16_t, void*); -typedef int32_t (*iFuip_t)(uint32_t, int32_t, void*); -typedef int32_t (*iFuWp_t)(uint32_t, uint16_t, void*); -typedef int32_t (*iFuui_t)(uint32_t, uint32_t, int32_t); -typedef int32_t (*iFuuu_t)(uint32_t, uint32_t, uint32_t); -typedef int32_t (*iFuup_t)(uint32_t, uint32_t, void*); -typedef int32_t (*iFuLL_t)(uint32_t, uintptr_t, uintptr_t); -typedef int32_t (*iFuLp_t)(uint32_t, uintptr_t, void*); -typedef int32_t (*iFupi_t)(uint32_t, void*, int32_t); -typedef int32_t (*iFupu_t)(uint32_t, void*, uint32_t); -typedef int32_t (*iFupL_t)(uint32_t, void*, uintptr_t); -typedef int32_t (*iFupp_t)(uint32_t, void*, void*); -typedef int32_t (*iFfff_t)(float, float, float); -typedef int32_t (*iFLip_t)(uintptr_t, int32_t, void*); -typedef int32_t (*iFLpp_t)(uintptr_t, void*, void*); -typedef int32_t (*iFpwp_t)(void*, int16_t, void*); -typedef int32_t (*iFpii_t)(void*, int32_t, int32_t); -typedef int32_t (*iFpiI_t)(void*, int32_t, int64_t); -typedef int32_t (*iFpiC_t)(void*, int32_t, uint8_t); -typedef int32_t (*iFpiW_t)(void*, int32_t, uint16_t); -typedef int32_t (*iFpiu_t)(void*, int32_t, uint32_t); -typedef int32_t (*iFpiU_t)(void*, int32_t, uint64_t); -typedef int32_t (*iFpid_t)(void*, int32_t, double); -typedef int32_t (*iFpil_t)(void*, int32_t, intptr_t); -typedef int32_t (*iFpiL_t)(void*, int32_t, uintptr_t); -typedef int32_t (*iFpip_t)(void*, int32_t, void*); -typedef int32_t (*iFpIi_t)(void*, int64_t, int32_t); -typedef int32_t (*iFpII_t)(void*, int64_t, int64_t); -typedef int32_t (*iFpCp_t)(void*, uint8_t, void*); -typedef int32_t (*iFpWp_t)(void*, uint16_t, void*); -typedef int32_t (*iFpui_t)(void*, uint32_t, int32_t); -typedef int32_t (*iFpuC_t)(void*, uint32_t, uint8_t); -typedef int32_t (*iFpuu_t)(void*, uint32_t, uint32_t); -typedef int32_t (*iFpuU_t)(void*, uint32_t, uint64_t); -typedef int32_t (*iFpul_t)(void*, uint32_t, intptr_t); -typedef int32_t (*iFpuL_t)(void*, uint32_t, uintptr_t); -typedef int32_t (*iFpup_t)(void*, uint32_t, void*); -typedef int32_t (*iFpUu_t)(void*, uint64_t, uint32_t); -typedef int32_t (*iFpUU_t)(void*, uint64_t, uint64_t); -typedef int32_t (*iFpUp_t)(void*, uint64_t, void*); -typedef int32_t (*iFpfu_t)(void*, float, uint32_t); -typedef int32_t (*iFpff_t)(void*, float, float); -typedef int32_t (*iFpdd_t)(void*, double, double); -typedef int32_t (*iFpli_t)(void*, intptr_t, int32_t); -typedef int32_t (*iFpll_t)(void*, intptr_t, intptr_t); -typedef int32_t (*iFplp_t)(void*, intptr_t, void*); -typedef int32_t (*iFpLi_t)(void*, uintptr_t, int32_t); -typedef int32_t (*iFpLu_t)(void*, uintptr_t, uint32_t); -typedef int32_t (*iFpLl_t)(void*, uintptr_t, intptr_t); -typedef int32_t (*iFpLL_t)(void*, uintptr_t, uintptr_t); -typedef int32_t (*iFpLp_t)(void*, uintptr_t, void*); -typedef int32_t (*iFppi_t)(void*, void*, int32_t); -typedef int32_t (*iFppI_t)(void*, void*, int64_t); -typedef int32_t (*iFppC_t)(void*, void*, uint8_t); -typedef int32_t (*iFppW_t)(void*, void*, uint16_t); -typedef int32_t (*iFppu_t)(void*, void*, uint32_t); -typedef int32_t (*iFppU_t)(void*, void*, uint64_t); -typedef int32_t (*iFppd_t)(void*, void*, double); -typedef int32_t (*iFppl_t)(void*, void*, intptr_t); -typedef int32_t (*iFppL_t)(void*, void*, uintptr_t); -typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef int32_t (*iFpOu_t)(void*, int32_t, uint32_t); -typedef int32_t (*iFpOM_t)(void*, int32_t, ...); -typedef int32_t (*iFSpL_t)(void*, void*, uintptr_t); -typedef int32_t (*iFbpp_t)(void*, void*, void*); -typedef int64_t (*IFiIi_t)(int32_t, int64_t, int32_t); -typedef int64_t (*IFpIi_t)(void*, int64_t, int32_t); -typedef int64_t (*IFppi_t)(void*, void*, int32_t); -typedef int64_t (*IFppI_t)(void*, void*, int64_t); -typedef int64_t (*IFSIi_t)(void*, int64_t, int32_t); -typedef uint8_t (*CFipp_t)(int32_t, void*, void*); -typedef uint8_t (*CFuff_t)(uint32_t, float, float); -typedef uint8_t (*CFuLu_t)(uint32_t, uintptr_t, uint32_t); -typedef uint8_t (*CFppp_t)(void*, void*, void*); -typedef uint16_t (*WFppp_t)(void*, void*, void*); -typedef uint32_t (*uFEpW_t)(x64emu_t*, void*, uint16_t); -typedef uint32_t (*uFEpu_t)(x64emu_t*, void*, uint32_t); -typedef uint32_t (*uFEpU_t)(x64emu_t*, void*, uint64_t); -typedef uint32_t (*uFEpp_t)(x64emu_t*, void*, void*); -typedef uint32_t (*uFiuu_t)(int32_t, uint32_t, uint32_t); -typedef uint32_t (*uFilp_t)(int32_t, intptr_t, void*); -typedef uint32_t (*uFipu_t)(int32_t, void*, uint32_t); -typedef uint32_t (*uFipL_t)(int32_t, void*, uintptr_t); -typedef uint32_t (*uFuii_t)(uint32_t, int32_t, int32_t); -typedef uint32_t (*uFuip_t)(uint32_t, int32_t, void*); -typedef uint32_t (*uFuuu_t)(uint32_t, uint32_t, uint32_t); -typedef uint32_t (*uFuup_t)(uint32_t, uint32_t, void*); -typedef uint32_t (*uFufp_t)(uint32_t, float, void*); -typedef uint32_t (*uFupu_t)(uint32_t, void*, uint32_t); -typedef uint32_t (*uFupp_t)(uint32_t, void*, void*); -typedef uint32_t (*uFpii_t)(void*, int32_t, int32_t); -typedef uint32_t (*uFpiu_t)(void*, int32_t, uint32_t); -typedef uint32_t (*uFpip_t)(void*, int32_t, void*); -typedef uint32_t (*uFpCi_t)(void*, uint8_t, int32_t); -typedef uint32_t (*uFpWi_t)(void*, uint16_t, int32_t); -typedef uint32_t (*uFpWu_t)(void*, uint16_t, uint32_t); -typedef uint32_t (*uFpWf_t)(void*, uint16_t, float); -typedef uint32_t (*uFpWp_t)(void*, uint16_t, void*); -typedef uint32_t (*uFpui_t)(void*, uint32_t, int32_t); -typedef uint32_t (*uFpuu_t)(void*, uint32_t, uint32_t); -typedef uint32_t (*uFpuL_t)(void*, uint32_t, uintptr_t); -typedef uint32_t (*uFpup_t)(void*, uint32_t, void*); -typedef uint32_t (*uFpfu_t)(void*, float, uint32_t); -typedef uint32_t (*uFpli_t)(void*, intptr_t, int32_t); -typedef uint32_t (*uFpLu_t)(void*, uintptr_t, uint32_t); -typedef uint32_t (*uFpLL_t)(void*, uintptr_t, uintptr_t); -typedef uint32_t (*uFpLp_t)(void*, uintptr_t, void*); -typedef uint32_t (*uFppi_t)(void*, void*, int32_t); -typedef uint32_t (*uFppu_t)(void*, void*, uint32_t); -typedef uint32_t (*uFppL_t)(void*, void*, uintptr_t); -typedef uint32_t (*uFppp_t)(void*, void*, void*); -typedef uint32_t (*uFbWW_t)(void*, uint16_t, uint16_t); -typedef uint32_t (*uFbWu_t)(void*, uint16_t, uint32_t); -typedef uint32_t (*uFbuC_t)(void*, uint32_t, uint8_t); -typedef uint32_t (*uFbuW_t)(void*, uint32_t, uint16_t); -typedef uint32_t (*uFbuu_t)(void*, uint32_t, uint32_t); -typedef uint32_t (*uFbuU_t)(void*, uint32_t, uint64_t); -typedef uint32_t (*uFbup_t)(void*, uint32_t, void*); -typedef uint64_t (*UFUii_t)(uint64_t, int32_t, int32_t); -typedef uint64_t (*UFUUU_t)(uint64_t, uint64_t, uint64_t); -typedef uint64_t (*UFpiU_t)(void*, int32_t, uint64_t); -typedef uint64_t (*UFppi_t)(void*, void*, int32_t); -typedef float (*fFuii_t)(uint32_t, int32_t, int32_t); -typedef float (*fFfff_t)(float, float, float); -typedef float (*fFffp_t)(float, float, void*); -typedef float (*fFppi_t)(void*, void*, int32_t); -typedef float (*fFppL_t)(void*, void*, uintptr_t); -typedef float (*fFppp_t)(void*, void*, void*); -typedef double (*dFuud_t)(uint32_t, uint32_t, double); -typedef double (*dFddd_t)(double, double, double); -typedef double (*dFddp_t)(double, double, void*); -typedef double (*dFpii_t)(void*, int32_t, int32_t); -typedef double (*dFpdd_t)(void*, double, double); -typedef double (*dFppi_t)(void*, void*, int32_t); -typedef double (*dFppu_t)(void*, void*, uint32_t); -typedef double (*dFppd_t)(void*, void*, double); -typedef double (*dFppp_t)(void*, void*, void*); -typedef long double (*DFppi_t)(void*, void*, int32_t); -typedef long double (*DFppp_t)(void*, void*, void*); -typedef intptr_t (*lFili_t)(int32_t, intptr_t, int32_t); -typedef intptr_t (*lFilL_t)(int32_t, intptr_t, uintptr_t); -typedef intptr_t (*lFipi_t)(int32_t, void*, int32_t); -typedef intptr_t (*lFipL_t)(int32_t, void*, uintptr_t); -typedef intptr_t (*lFlll_t)(intptr_t, intptr_t, intptr_t); -typedef intptr_t (*lFpli_t)(void*, intptr_t, int32_t); -typedef intptr_t (*lFpLu_t)(void*, uintptr_t, uint32_t); -typedef intptr_t (*lFpLp_t)(void*, uintptr_t, void*); -typedef intptr_t (*lFppi_t)(void*, void*, int32_t); -typedef intptr_t (*lFppu_t)(void*, void*, uint32_t); -typedef intptr_t (*lFppL_t)(void*, void*, uintptr_t); -typedef intptr_t (*lFppp_t)(void*, void*, void*); -typedef intptr_t (*lFSpl_t)(void*, void*, intptr_t); -typedef uintptr_t (*LFEpA_t)(x64emu_t*, void*, void*); -typedef uintptr_t (*LFipL_t)(int32_t, void*, uintptr_t); -typedef uintptr_t (*LFuui_t)(uint32_t, uint32_t, int32_t); -typedef uintptr_t (*LFLii_t)(uintptr_t, int32_t, int32_t); -typedef uintptr_t (*LFLLl_t)(uintptr_t, uintptr_t, intptr_t); -typedef uintptr_t (*LFLLL_t)(uintptr_t, uintptr_t, uintptr_t); -typedef uintptr_t (*LFLpu_t)(uintptr_t, void*, uint32_t); -typedef uintptr_t (*LFLpL_t)(uintptr_t, void*, uintptr_t); -typedef uintptr_t (*LFpii_t)(void*, int32_t, int32_t); -typedef uintptr_t (*LFpCi_t)(void*, uint8_t, int32_t); -typedef uintptr_t (*LFpuL_t)(void*, uint32_t, uintptr_t); -typedef uintptr_t (*LFpup_t)(void*, uint32_t, void*); -typedef uintptr_t (*LFpLi_t)(void*, uintptr_t, int32_t); -typedef uintptr_t (*LFpLL_t)(void*, uintptr_t, uintptr_t); -typedef uintptr_t (*LFpLp_t)(void*, uintptr_t, void*); -typedef uintptr_t (*LFppi_t)(void*, void*, int32_t); -typedef uintptr_t (*LFppu_t)(void*, void*, uint32_t); -typedef uintptr_t (*LFppL_t)(void*, void*, uintptr_t); -typedef uintptr_t (*LFppp_t)(void*, void*, void*); -typedef uintptr_t (*LFSpL_t)(void*, void*, uintptr_t); -typedef void* (*pFEip_t)(x64emu_t*, int32_t, void*); -typedef void* (*pFEiV_t)(x64emu_t*, int32_t, void*); -typedef void* (*pFEup_t)(x64emu_t*, uint32_t, void*); -typedef void* (*pFEuV_t)(x64emu_t*, uint32_t, void*); -typedef void* (*pFEpi_t)(x64emu_t*, void*, int32_t); -typedef void* (*pFEpu_t)(x64emu_t*, void*, uint32_t); -typedef void* (*pFEpp_t)(x64emu_t*, void*, void*); -typedef void* (*pFEpV_t)(x64emu_t*, void*, void*); -typedef void* (*pFEpA_t)(x64emu_t*, void*, void*); -typedef void* (*pFiii_t)(int32_t, int32_t, int32_t); -typedef void* (*pFiiu_t)(int32_t, int32_t, uint32_t); -typedef void* (*pFiip_t)(int32_t, int32_t, void*); -typedef void* (*pFiIi_t)(int32_t, int64_t, int32_t); -typedef void* (*pFiLL_t)(int32_t, uintptr_t, uintptr_t); -typedef void* (*pFipi_t)(int32_t, void*, int32_t); -typedef void* (*pFipL_t)(int32_t, void*, uintptr_t); -typedef void* (*pFipp_t)(int32_t, void*, void*); -typedef void* (*pFCuW_t)(uint8_t, uint32_t, uint16_t); -typedef void* (*pFWWW_t)(uint16_t, uint16_t, uint16_t); -typedef void* (*pFuip_t)(uint32_t, int32_t, void*); -typedef void* (*pFuui_t)(uint32_t, uint32_t, int32_t); -typedef void* (*pFuuu_t)(uint32_t, uint32_t, uint32_t); -typedef void* (*pFulu_t)(uint32_t, intptr_t, uint32_t); -typedef void* (*pFulp_t)(uint32_t, intptr_t, void*); -typedef void* (*pFupi_t)(uint32_t, void*, int32_t); -typedef void* (*pFupu_t)(uint32_t, void*, uint32_t); -typedef void* (*pFupl_t)(uint32_t, void*, intptr_t); -typedef void* (*pFupL_t)(uint32_t, void*, uintptr_t); -typedef void* (*pFupp_t)(uint32_t, void*, void*); -typedef void* (*pFdip_t)(double, int32_t, void*); -typedef void* (*pFdUU_t)(double, uint64_t, uint64_t); -typedef void* (*pFddi_t)(double, double, int32_t); -typedef void* (*pFddd_t)(double, double, double); -typedef void* (*pFDip_t)(long double, int32_t, void*); -typedef void* (*pFlpi_t)(intptr_t, void*, int32_t); -typedef void* (*pFLup_t)(uintptr_t, uint32_t, void*); -typedef void* (*pFLLp_t)(uintptr_t, uintptr_t, void*); -typedef void* (*pFLpi_t)(uintptr_t, void*, int32_t); -typedef void* (*pFLpp_t)(uintptr_t, void*, void*); -typedef void* (*pFpii_t)(void*, int32_t, int32_t); -typedef void* (*pFpiu_t)(void*, int32_t, uint32_t); -typedef void* (*pFpid_t)(void*, int32_t, double); -typedef void* (*pFpil_t)(void*, int32_t, intptr_t); -typedef void* (*pFpiL_t)(void*, int32_t, uintptr_t); -typedef void* (*pFpip_t)(void*, int32_t, void*); -typedef void* (*pFpCi_t)(void*, uint8_t, int32_t); -typedef void* (*pFpCu_t)(void*, uint8_t, uint32_t); -typedef void* (*pFpWi_t)(void*, uint16_t, int32_t); -typedef void* (*pFpWW_t)(void*, uint16_t, uint16_t); -typedef void* (*pFpWp_t)(void*, uint16_t, void*); -typedef void* (*pFpui_t)(void*, uint32_t, int32_t); -typedef void* (*pFpuu_t)(void*, uint32_t, uint32_t); -typedef void* (*pFpuL_t)(void*, uint32_t, uintptr_t); -typedef void* (*pFpup_t)(void*, uint32_t, void*); -typedef void* (*pFpUi_t)(void*, uint64_t, int32_t); -typedef void* (*pFpUu_t)(void*, uint64_t, uint32_t); -typedef void* (*pFpdu_t)(void*, double, uint32_t); -typedef void* (*pFpdd_t)(void*, double, double); -typedef void* (*pFplC_t)(void*, intptr_t, uint8_t); -typedef void* (*pFplu_t)(void*, intptr_t, uint32_t); -typedef void* (*pFpll_t)(void*, intptr_t, intptr_t); -typedef void* (*pFplp_t)(void*, intptr_t, void*); -typedef void* (*pFpLi_t)(void*, uintptr_t, int32_t); -typedef void* (*pFpLu_t)(void*, uintptr_t, uint32_t); -typedef void* (*pFpLL_t)(void*, uintptr_t, uintptr_t); -typedef void* (*pFpLp_t)(void*, uintptr_t, void*); -typedef void* (*pFppi_t)(void*, void*, int32_t); -typedef void* (*pFppI_t)(void*, void*, int64_t); -typedef void* (*pFppC_t)(void*, void*, uint8_t); -typedef void* (*pFppu_t)(void*, void*, uint32_t); -typedef void* (*pFppU_t)(void*, void*, uint64_t); -typedef void* (*pFppf_t)(void*, void*, float); -typedef void* (*pFppl_t)(void*, void*, intptr_t); -typedef void* (*pFppL_t)(void*, void*, uintptr_t); -typedef void* (*pFppp_t)(void*, void*, void*); -typedef void* (*pFppA_t)(void*, void*, void*); -typedef void* (*pFpOM_t)(void*, int32_t, ...); -typedef void* (*pFpbi_t)(void*, void*, int32_t); -typedef void* (*pFSpl_t)(void*, void*, intptr_t); -typedef void* (*pFbCC_t)(void*, uint8_t, uint8_t); -typedef void* (*pFbuu_t)(void*, uint32_t, uint32_t); -typedef void* (*pFbup_t)(void*, uint32_t, void*); -typedef void* (*pFbUp_t)(void*, uint64_t, void*); -typedef void* (*pFbpi_t)(void*, void*, int32_t); -typedef void* (*pFbpu_t)(void*, void*, uint32_t); -typedef void* (*pFbpp_t)(void*, void*, void*); -typedef void (*vWpup_t)(void*, uint32_t, void*); -typedef int32_t (*iWEip_t)(x64emu_t*, int32_t, void*); -typedef int32_t (*iWEpp_t)(x64emu_t*, void*, void*); -typedef int32_t (*iWpiu_t)(void*, int32_t, uint32_t); -typedef int32_t (*iWpip_t)(void*, int32_t, void*); -typedef int32_t (*iWpui_t)(void*, uint32_t, int32_t); -typedef int32_t (*iWpuu_t)(void*, uint32_t, uint32_t); -typedef int32_t (*iWpup_t)(void*, uint32_t, void*); -typedef int32_t (*iWppu_t)(void*, void*, uint32_t); -typedef int32_t (*iWppp_t)(void*, void*, void*); -typedef uint32_t (*uWpui_t)(void*, uint32_t, int32_t); -typedef uint32_t (*uWpup_t)(void*, uint32_t, void*); -typedef void (*vFEiip_t)(x64emu_t*, int32_t, int32_t, void*); -typedef void (*vFEipp_t)(x64emu_t*, int32_t, void*, void*); -typedef void (*vFEipV_t)(x64emu_t*, int32_t, void*, void*); -typedef void (*vFEipA_t)(x64emu_t*, int32_t, void*, void*); -typedef void (*vFELLp_t)(x64emu_t*, uintptr_t, uintptr_t, void*); -typedef void (*vFEpii_t)(x64emu_t*, void*, int32_t, int32_t); -typedef void (*vFEpip_t)(x64emu_t*, void*, int32_t, void*); -typedef void (*vFEpiA_t)(x64emu_t*, void*, int32_t, void*); -typedef void (*vFEpup_t)(x64emu_t*, void*, uint32_t, void*); -typedef void (*vFEpUp_t)(x64emu_t*, void*, uint64_t, void*); -typedef void (*vFEppp_t)(x64emu_t*, void*, void*, void*); -typedef void (*vFEppV_t)(x64emu_t*, void*, void*, void*); -typedef void (*vFEppA_t)(x64emu_t*, void*, void*, void*); -typedef void (*vFcccc_t)(int8_t, int8_t, int8_t, int8_t); -typedef void (*vFwwww_t)(int16_t, int16_t, int16_t, int16_t); -typedef void (*vFiiii_t)(int32_t, int32_t, int32_t, int32_t); -typedef void (*vFiiip_t)(int32_t, int32_t, int32_t, void*); -typedef void (*vFiiCp_t)(int32_t, int32_t, uint8_t, void*); -typedef void (*vFiill_t)(int32_t, int32_t, intptr_t, intptr_t); -typedef void (*vFiipV_t)(int32_t, int32_t, void*, void*); -typedef void (*vFiuip_t)(int32_t, uint32_t, int32_t, void*); -typedef void (*vFiuuu_t)(int32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFiulp_t)(int32_t, uint32_t, intptr_t, void*); -typedef void (*vFiupV_t)(int32_t, uint32_t, void*, void*); -typedef void (*vFifff_t)(int32_t, float, float, float); -typedef void (*vFiddd_t)(int32_t, double, double, double); -typedef void (*vFilip_t)(int32_t, intptr_t, int32_t, void*); -typedef void (*vFilll_t)(int32_t, intptr_t, intptr_t, intptr_t); -typedef void (*vFilpu_t)(int32_t, intptr_t, void*, uint32_t); -typedef void (*vFilpp_t)(int32_t, intptr_t, void*, void*); -typedef void (*vFiLLL_t)(int32_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (*vFipii_t)(int32_t, void*, int32_t, int32_t); -typedef void (*vFipup_t)(int32_t, void*, uint32_t, void*); -typedef void (*vFipll_t)(int32_t, void*, intptr_t, intptr_t); -typedef void (*vFippL_t)(int32_t, void*, void*, uintptr_t); -typedef void (*vFippp_t)(int32_t, void*, void*, void*); -typedef void (*vFCCCC_t)(uint8_t, uint8_t, uint8_t, uint8_t); -typedef void (*vFWWWW_t)(uint16_t, uint16_t, uint16_t, uint16_t); -typedef void (*vFuccc_t)(uint32_t, int8_t, int8_t, int8_t); -typedef void (*vFuwww_t)(uint32_t, int16_t, int16_t, int16_t); -typedef void (*vFuiii_t)(uint32_t, int32_t, int32_t, int32_t); -typedef void (*vFuiiu_t)(uint32_t, int32_t, int32_t, uint32_t); -typedef void (*vFuiip_t)(uint32_t, int32_t, int32_t, void*); -typedef void (*vFuiui_t)(uint32_t, int32_t, uint32_t, int32_t); -typedef void (*vFuiuC_t)(uint32_t, int32_t, uint32_t, uint8_t); -typedef void (*vFuiuu_t)(uint32_t, int32_t, uint32_t, uint32_t); -typedef void (*vFuiup_t)(uint32_t, int32_t, uint32_t, void*); -typedef void (*vFuifi_t)(uint32_t, int32_t, float, int32_t); -typedef void (*vFuiff_t)(uint32_t, int32_t, float, float); -typedef void (*vFuidd_t)(uint32_t, int32_t, double, double); -typedef void (*vFuill_t)(uint32_t, int32_t, intptr_t, intptr_t); -typedef void (*vFuilp_t)(uint32_t, int32_t, intptr_t, void*); -typedef void (*vFuiLL_t)(uint32_t, int32_t, uintptr_t, uintptr_t); -typedef void (*vFuipi_t)(uint32_t, int32_t, void*, int32_t); -typedef void (*vFuipu_t)(uint32_t, int32_t, void*, uint32_t); -typedef void (*vFuipp_t)(uint32_t, int32_t, void*, void*); -typedef void (*vFuWWW_t)(uint32_t, uint16_t, uint16_t, uint16_t); -typedef void (*vFuuii_t)(uint32_t, uint32_t, int32_t, int32_t); -typedef void (*vFuuiu_t)(uint32_t, uint32_t, int32_t, uint32_t); -typedef void (*vFuuil_t)(uint32_t, uint32_t, int32_t, intptr_t); -typedef void (*vFuuip_t)(uint32_t, uint32_t, int32_t, void*); -typedef void (*vFuuCu_t)(uint32_t, uint32_t, uint8_t, uint32_t); -typedef void (*vFuuCp_t)(uint32_t, uint32_t, uint8_t, void*); -typedef void (*vFuuui_t)(uint32_t, uint32_t, uint32_t, int32_t); -typedef void (*vFuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFuuuf_t)(uint32_t, uint32_t, uint32_t, float); -typedef void (*vFuuud_t)(uint32_t, uint32_t, uint32_t, double); -typedef void (*vFuuul_t)(uint32_t, uint32_t, uint32_t, intptr_t); -typedef void (*vFuuup_t)(uint32_t, uint32_t, uint32_t, void*); -typedef void (*vFuuff_t)(uint32_t, uint32_t, float, float); -typedef void (*vFuuli_t)(uint32_t, uint32_t, intptr_t, int32_t); -typedef void (*vFuulp_t)(uint32_t, uint32_t, intptr_t, void*); -typedef void (*vFuuLl_t)(uint32_t, uint32_t, uintptr_t, intptr_t); -typedef void (*vFuupi_t)(uint32_t, uint32_t, void*, int32_t); -typedef void (*vFuupp_t)(uint32_t, uint32_t, void*, void*); -typedef void (*vFufff_t)(uint32_t, float, float, float); -typedef void (*vFuddd_t)(uint32_t, double, double, double); -typedef void (*vFuluL_t)(uint32_t, intptr_t, uint32_t, uintptr_t); -typedef void (*vFullC_t)(uint32_t, intptr_t, intptr_t, uint8_t); -typedef void (*vFulll_t)(uint32_t, intptr_t, intptr_t, intptr_t); -typedef void (*vFullp_t)(uint32_t, intptr_t, intptr_t, void*); -typedef void (*vFulpi_t)(uint32_t, intptr_t, void*, int32_t); -typedef void (*vFulpu_t)(uint32_t, intptr_t, void*, uint32_t); -typedef void (*vFulpp_t)(uint32_t, intptr_t, void*, void*); -typedef void (*vFuLui_t)(uint32_t, uintptr_t, uint32_t, int32_t); -typedef void (*vFuLup_t)(uint32_t, uintptr_t, uint32_t, void*); -typedef void (*vFuLLL_t)(uint32_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (*vFupii_t)(uint32_t, void*, int32_t, int32_t); -typedef void (*vFuppi_t)(uint32_t, void*, void*, int32_t); -typedef void (*vFuppu_t)(uint32_t, void*, void*, uint32_t); -typedef void (*vFUUpi_t)(uint64_t, uint64_t, void*, int32_t); -typedef void (*vFffff_t)(float, float, float, float); -typedef void (*vFdddd_t)(double, double, double, double); -typedef void (*vFllii_t)(intptr_t, intptr_t, int32_t, int32_t); -typedef void (*vFLuui_t)(uintptr_t, uint32_t, uint32_t, int32_t); -typedef void (*vFLppi_t)(uintptr_t, void*, void*, int32_t); -typedef void (*vFpiii_t)(void*, int32_t, int32_t, int32_t); -typedef void (*vFpiiu_t)(void*, int32_t, int32_t, uint32_t); -typedef void (*vFpiid_t)(void*, int32_t, int32_t, double); -typedef void (*vFpiip_t)(void*, int32_t, int32_t, void*); -typedef void (*vFpiui_t)(void*, int32_t, uint32_t, int32_t); -typedef void (*vFpiuu_t)(void*, int32_t, uint32_t, uint32_t); -typedef void (*vFpiuL_t)(void*, int32_t, uint32_t, uintptr_t); -typedef void (*vFpiup_t)(void*, int32_t, uint32_t, void*); -typedef void (*vFpiUu_t)(void*, int32_t, uint64_t, uint32_t); -typedef void (*vFpiUU_t)(void*, int32_t, uint64_t, uint64_t); -typedef void (*vFpifi_t)(void*, int32_t, float, int32_t); -typedef void (*vFpipi_t)(void*, int32_t, void*, int32_t); -typedef void (*vFpipu_t)(void*, int32_t, void*, uint32_t); -typedef void (*vFpipp_t)(void*, int32_t, void*, void*); -typedef void (*vFpIdi_t)(void*, int64_t, double, int32_t); -typedef void (*vFpCuW_t)(void*, uint8_t, uint32_t, uint16_t); -typedef void (*vFpuii_t)(void*, uint32_t, int32_t, int32_t); -typedef void (*vFpuip_t)(void*, uint32_t, int32_t, void*); -typedef void (*vFpuuu_t)(void*, uint32_t, uint32_t, uint32_t); -typedef void (*vFpuup_t)(void*, uint32_t, uint32_t, void*); -typedef void (*vFpufi_t)(void*, uint32_t, float, int32_t); -typedef void (*vFpudd_t)(void*, uint32_t, double, double); -typedef void (*vFpupu_t)(void*, uint32_t, void*, uint32_t); -typedef void (*vFpupp_t)(void*, uint32_t, void*, void*); -typedef void (*vFpUuu_t)(void*, uint64_t, uint32_t, uint32_t); -typedef void (*vFpUup_t)(void*, uint64_t, uint32_t, void*); -typedef void (*vFpUUi_t)(void*, uint64_t, uint64_t, int32_t); -typedef void (*vFpUUu_t)(void*, uint64_t, uint64_t, uint32_t); -typedef void (*vFpUUp_t)(void*, uint64_t, uint64_t, void*); -typedef void (*vFpUpp_t)(void*, uint64_t, void*, void*); -typedef void (*vFpfff_t)(void*, float, float, float); -typedef void (*vFpdii_t)(void*, double, int32_t, int32_t); -typedef void (*vFpdup_t)(void*, double, uint32_t, void*); -typedef void (*vFpddu_t)(void*, double, double, uint32_t); -typedef void (*vFpddd_t)(void*, double, double, double); -typedef void (*vFplll_t)(void*, intptr_t, intptr_t, intptr_t); -typedef void (*vFplpp_t)(void*, intptr_t, void*, void*); -typedef void (*vFpLii_t)(void*, uintptr_t, int32_t, int32_t); -typedef void (*vFpLuu_t)(void*, uintptr_t, uint32_t, uint32_t); -typedef void (*vFpLLL_t)(void*, uintptr_t, uintptr_t, uintptr_t); -typedef void (*vFpLpL_t)(void*, uintptr_t, void*, uintptr_t); -typedef void (*vFpLpp_t)(void*, uintptr_t, void*, void*); -typedef void (*vFppii_t)(void*, void*, int32_t, int32_t); -typedef void (*vFppiu_t)(void*, void*, int32_t, uint32_t); -typedef void (*vFppid_t)(void*, void*, int32_t, double); -typedef void (*vFppil_t)(void*, void*, int32_t, intptr_t); -typedef void (*vFppiL_t)(void*, void*, int32_t, uintptr_t); -typedef void (*vFppip_t)(void*, void*, int32_t, void*); -typedef void (*vFppui_t)(void*, void*, uint32_t, int32_t); -typedef void (*vFppuu_t)(void*, void*, uint32_t, uint32_t); -typedef void (*vFppup_t)(void*, void*, uint32_t, void*); -typedef void (*vFppfi_t)(void*, void*, float, int32_t); -typedef void (*vFppff_t)(void*, void*, float, float); -typedef void (*vFppdu_t)(void*, void*, double, uint32_t); -typedef void (*vFppdd_t)(void*, void*, double, double); -typedef void (*vFppdp_t)(void*, void*, double, void*); -typedef void (*vFpplp_t)(void*, void*, intptr_t, void*); -typedef void (*vFppLL_t)(void*, void*, uintptr_t, uintptr_t); -typedef void (*vFppLp_t)(void*, void*, uintptr_t, void*); -typedef void (*vFpppi_t)(void*, void*, void*, int32_t); -typedef void (*vFpppu_t)(void*, void*, void*, uint32_t); -typedef void (*vFpppd_t)(void*, void*, void*, double); -typedef void (*vFpppl_t)(void*, void*, void*, intptr_t); -typedef void (*vFpppL_t)(void*, void*, void*, uintptr_t); -typedef void (*vFpppp_t)(void*, void*, void*, void*); -typedef int8_t (*cFpipp_t)(void*, int32_t, void*, void*); -typedef int32_t (*iFEiip_t)(x64emu_t*, int32_t, int32_t, void*); -typedef int32_t (*iFEiiN_t)(x64emu_t*, int32_t, int32_t, ...); -typedef int32_t (*iFEipp_t)(x64emu_t*, int32_t, void*, void*); -typedef int32_t (*iFEipV_t)(x64emu_t*, int32_t, void*, void*); -typedef int32_t (*iFEipA_t)(x64emu_t*, int32_t, void*, void*); -typedef int32_t (*iFEupu_t)(x64emu_t*, uint32_t, void*, uint32_t); -typedef int32_t (*iFEupp_t)(x64emu_t*, uint32_t, void*, void*); -typedef int32_t (*iFEpii_t)(x64emu_t*, void*, int32_t, int32_t); -typedef int32_t (*iFEpip_t)(x64emu_t*, void*, int32_t, void*); -typedef int32_t (*iFEpiV_t)(x64emu_t*, void*, int32_t, void*); -typedef int32_t (*iFEpiA_t)(x64emu_t*, void*, int32_t, void*); -typedef int32_t (*iFEpui_t)(x64emu_t*, void*, uint32_t, int32_t); -typedef int32_t (*iFEpup_t)(x64emu_t*, void*, uint32_t, void*); -typedef int32_t (*iFEpUi_t)(x64emu_t*, void*, uint64_t, int32_t); -typedef int32_t (*iFEpUp_t)(x64emu_t*, void*, uint64_t, void*); -typedef int32_t (*iFEpLi_t)(x64emu_t*, void*, uintptr_t, int32_t); -typedef int32_t (*iFEpLp_t)(x64emu_t*, void*, uintptr_t, void*); -typedef int32_t (*iFEppi_t)(x64emu_t*, void*, void*, int32_t); -typedef int32_t (*iFEppd_t)(x64emu_t*, void*, void*, double); -typedef int32_t (*iFEppL_t)(x64emu_t*, void*, void*, uintptr_t); -typedef int32_t (*iFEppp_t)(x64emu_t*, void*, void*, void*); -typedef int32_t (*iFEppV_t)(x64emu_t*, void*, void*, void*); -typedef int32_t (*iFEppA_t)(x64emu_t*, void*, void*, void*); -typedef int32_t (*iFEpOu_t)(x64emu_t*, void*, int32_t, uint32_t); -typedef int32_t (*iFwwww_t)(int16_t, int16_t, int16_t, int16_t); -typedef int32_t (*iFwppp_t)(int16_t, void*, void*, void*); -typedef int32_t (*iFiiii_t)(int32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iFiiiu_t)(int32_t, int32_t, int32_t, uint32_t); -typedef int32_t (*iFiiip_t)(int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFiiiN_t)(int32_t, int32_t, int32_t, ...); -typedef int32_t (*iFiiui_t)(int32_t, int32_t, uint32_t, int32_t); -typedef int32_t (*iFiill_t)(int32_t, int32_t, intptr_t, intptr_t); -typedef int32_t (*iFiipi_t)(int32_t, int32_t, void*, int32_t); -typedef int32_t (*iFiipp_t)(int32_t, int32_t, void*, void*); -typedef int32_t (*iFiWii_t)(int32_t, uint16_t, int32_t, int32_t); -typedef int32_t (*iFiuwp_t)(int32_t, uint32_t, int16_t, void*); -typedef int32_t (*iFiuup_t)(int32_t, uint32_t, uint32_t, void*); -typedef int32_t (*iFiupp_t)(int32_t, uint32_t, void*, void*); -typedef int32_t (*iFilli_t)(int32_t, intptr_t, intptr_t, int32_t); -typedef int32_t (*iFillu_t)(int32_t, intptr_t, intptr_t, uint32_t); -typedef int32_t (*iFiLpL_t)(int32_t, uintptr_t, void*, uintptr_t); -typedef int32_t (*iFipii_t)(int32_t, void*, int32_t, int32_t); -typedef int32_t (*iFipip_t)(int32_t, void*, int32_t, void*); -typedef int32_t (*iFipWp_t)(int32_t, void*, uint16_t, void*); -typedef int32_t (*iFipui_t)(int32_t, void*, uint32_t, int32_t); -typedef int32_t (*iFipuL_t)(int32_t, void*, uint32_t, uintptr_t); -typedef int32_t (*iFipLi_t)(int32_t, void*, uintptr_t, int32_t); -typedef int32_t (*iFipLu_t)(int32_t, void*, uintptr_t, uint32_t); -typedef int32_t (*iFipLp_t)(int32_t, void*, uintptr_t, void*); -typedef int32_t (*iFippi_t)(int32_t, void*, void*, int32_t); -typedef int32_t (*iFippu_t)(int32_t, void*, void*, uint32_t); -typedef int32_t (*iFippL_t)(int32_t, void*, void*, uintptr_t); -typedef int32_t (*iFippp_t)(int32_t, void*, void*, void*); -typedef int32_t (*iFipON_t)(int32_t, void*, int32_t, ...); -typedef int32_t (*iFuiup_t)(uint32_t, int32_t, uint32_t, void*); -typedef int32_t (*iFuipp_t)(uint32_t, int32_t, void*, void*); -typedef int32_t (*iFuWWp_t)(uint32_t, uint16_t, uint16_t, void*); -typedef int32_t (*iFuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t); -typedef int32_t (*iFuupi_t)(uint32_t, uint32_t, void*, int32_t); -typedef int32_t (*iFuupp_t)(uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFupLp_t)(uint32_t, void*, uintptr_t, void*); -typedef int32_t (*iFuppi_t)(uint32_t, void*, void*, int32_t); -typedef int32_t (*iFuppu_t)(uint32_t, void*, void*, uint32_t); -typedef int32_t (*iFuppp_t)(uint32_t, void*, void*, void*); -typedef int32_t (*iFLppp_t)(uintptr_t, void*, void*, void*); -typedef int32_t (*iFpwww_t)(void*, int16_t, int16_t, int16_t); -typedef int32_t (*iFpwpp_t)(void*, int16_t, void*, void*); -typedef int32_t (*iFpiii_t)(void*, int32_t, int32_t, int32_t); -typedef int32_t (*iFpiiu_t)(void*, int32_t, int32_t, uint32_t); -typedef int32_t (*iFpiid_t)(void*, int32_t, int32_t, double); -typedef int32_t (*iFpiiL_t)(void*, int32_t, int32_t, uintptr_t); -typedef int32_t (*iFpiip_t)(void*, int32_t, int32_t, void*); -typedef int32_t (*iFpiuu_t)(void*, int32_t, uint32_t, uint32_t); -typedef int32_t (*iFpiuL_t)(void*, int32_t, uint32_t, uintptr_t); -typedef int32_t (*iFpiup_t)(void*, int32_t, uint32_t, void*); -typedef int32_t (*iFpiUp_t)(void*, int32_t, uint64_t, void*); -typedef int32_t (*iFpild_t)(void*, int32_t, intptr_t, double); -typedef int32_t (*iFpipi_t)(void*, int32_t, void*, int32_t); -typedef int32_t (*iFpipu_t)(void*, int32_t, void*, uint32_t); -typedef int32_t (*iFpipL_t)(void*, int32_t, void*, uintptr_t); -typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*); -typedef int32_t (*iFpipV_t)(void*, int32_t, void*, void*); -typedef int32_t (*iFpIip_t)(void*, int64_t, int32_t, void*); -typedef int32_t (*iFpCCC_t)(void*, uint8_t, uint8_t, uint8_t); -typedef int32_t (*iFpCpi_t)(void*, uint8_t, void*, int32_t); -typedef int32_t (*iFpCpp_t)(void*, uint8_t, void*, void*); -typedef int32_t (*iFpWWu_t)(void*, uint16_t, uint16_t, uint32_t); -typedef int32_t (*iFpWpp_t)(void*, uint16_t, void*, void*); -typedef int32_t (*iFpuwp_t)(void*, uint32_t, int16_t, void*); -typedef int32_t (*iFpuii_t)(void*, uint32_t, int32_t, int32_t); -typedef int32_t (*iFpuiL_t)(void*, uint32_t, int32_t, uintptr_t); -typedef int32_t (*iFpuip_t)(void*, uint32_t, int32_t, void*); -typedef int32_t (*iFpuui_t)(void*, uint32_t, uint32_t, int32_t); -typedef int32_t (*iFpuuu_t)(void*, uint32_t, uint32_t, uint32_t); -typedef int32_t (*iFpuul_t)(void*, uint32_t, uint32_t, intptr_t); -typedef int32_t (*iFpuuL_t)(void*, uint32_t, uint32_t, uintptr_t); -typedef int32_t (*iFpuup_t)(void*, uint32_t, uint32_t, void*); -typedef int32_t (*iFpuUp_t)(void*, uint32_t, uint64_t, void*); -typedef int32_t (*iFpuLL_t)(void*, uint32_t, uintptr_t, uintptr_t); -typedef int32_t (*iFpuLp_t)(void*, uint32_t, uintptr_t, void*); -typedef int32_t (*iFpupi_t)(void*, uint32_t, void*, int32_t); -typedef int32_t (*iFpupC_t)(void*, uint32_t, void*, uint8_t); -typedef int32_t (*iFpupu_t)(void*, uint32_t, void*, uint32_t); -typedef int32_t (*iFpupU_t)(void*, uint32_t, void*, uint64_t); -typedef int32_t (*iFpupL_t)(void*, uint32_t, void*, uintptr_t); -typedef int32_t (*iFpupp_t)(void*, uint32_t, void*, void*); -typedef int32_t (*iFpupV_t)(void*, uint32_t, void*, void*); -typedef int32_t (*iFpUip_t)(void*, uint64_t, int32_t, void*); -typedef int32_t (*iFpUup_t)(void*, uint64_t, uint32_t, void*); -typedef int32_t (*iFpUUU_t)(void*, uint64_t, uint64_t, uint64_t); -typedef int32_t (*iFpULp_t)(void*, uint64_t, uintptr_t, void*); -typedef int32_t (*iFpUpp_t)(void*, uint64_t, void*, void*); -typedef int32_t (*iFpdip_t)(void*, double, int32_t, void*); -typedef int32_t (*iFplii_t)(void*, intptr_t, int32_t, int32_t); -typedef int32_t (*iFplip_t)(void*, intptr_t, int32_t, void*); -typedef int32_t (*iFplpi_t)(void*, intptr_t, void*, int32_t); -typedef int32_t (*iFplpp_t)(void*, intptr_t, void*, void*); -typedef int32_t (*iFpLii_t)(void*, uintptr_t, int32_t, int32_t); -typedef int32_t (*iFpLiL_t)(void*, uintptr_t, int32_t, uintptr_t); -typedef int32_t (*iFpLip_t)(void*, uintptr_t, int32_t, void*); -typedef int32_t (*iFpLuu_t)(void*, uintptr_t, uint32_t, uint32_t); -typedef int32_t (*iFpLup_t)(void*, uintptr_t, uint32_t, void*); -typedef int32_t (*iFpLlp_t)(void*, uintptr_t, intptr_t, void*); -typedef int32_t (*iFpLLu_t)(void*, uintptr_t, uintptr_t, uint32_t); -typedef int32_t (*iFpLLL_t)(void*, uintptr_t, uintptr_t, uintptr_t); -typedef int32_t (*iFpLLp_t)(void*, uintptr_t, uintptr_t, void*); -typedef int32_t (*iFpLpi_t)(void*, uintptr_t, void*, int32_t); -typedef int32_t (*iFpLpf_t)(void*, uintptr_t, void*, float); -typedef int32_t (*iFpLpd_t)(void*, uintptr_t, void*, double); -typedef int32_t (*iFpLpD_t)(void*, uintptr_t, void*, long double); -typedef int32_t (*iFpLpL_t)(void*, uintptr_t, void*, uintptr_t); -typedef int32_t (*iFpLpp_t)(void*, uintptr_t, void*, void*); -typedef int32_t (*iFppii_t)(void*, void*, int32_t, int32_t); -typedef int32_t (*iFppiu_t)(void*, void*, int32_t, uint32_t); -typedef int32_t (*iFppiU_t)(void*, void*, int32_t, uint64_t); -typedef int32_t (*iFppiL_t)(void*, void*, int32_t, uintptr_t); -typedef int32_t (*iFppip_t)(void*, void*, int32_t, void*); -typedef int32_t (*iFppIL_t)(void*, void*, int64_t, uintptr_t); -typedef int32_t (*iFppCC_t)(void*, void*, uint8_t, uint8_t); -typedef int32_t (*iFppuw_t)(void*, void*, uint32_t, int16_t); -typedef int32_t (*iFppui_t)(void*, void*, uint32_t, int32_t); -typedef int32_t (*iFppuu_t)(void*, void*, uint32_t, uint32_t); -typedef int32_t (*iFppuL_t)(void*, void*, uint32_t, uintptr_t); -typedef int32_t (*iFppup_t)(void*, void*, uint32_t, void*); -typedef int32_t (*iFppdd_t)(void*, void*, double, double); -typedef int32_t (*iFppdp_t)(void*, void*, double, void*); -typedef int32_t (*iFppli_t)(void*, void*, intptr_t, int32_t); -typedef int32_t (*iFppll_t)(void*, void*, intptr_t, intptr_t); -typedef int32_t (*iFpplL_t)(void*, void*, intptr_t, uintptr_t); -typedef int32_t (*iFpplp_t)(void*, void*, intptr_t, void*); -typedef int32_t (*iFppLi_t)(void*, void*, uintptr_t, int32_t); -typedef int32_t (*iFppLL_t)(void*, void*, uintptr_t, uintptr_t); -typedef int32_t (*iFppLp_t)(void*, void*, uintptr_t, void*); -typedef int32_t (*iFpppi_t)(void*, void*, void*, int32_t); -typedef int32_t (*iFpppC_t)(void*, void*, void*, uint8_t); -typedef int32_t (*iFpppu_t)(void*, void*, void*, uint32_t); -typedef int32_t (*iFpppL_t)(void*, void*, void*, uintptr_t); -typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); -typedef int32_t (*iFbupp_t)(void*, uint32_t, void*, void*); -typedef int64_t (*IFEpIi_t)(x64emu_t*, void*, int64_t, int32_t); -typedef int64_t (*IFipUI_t)(int32_t, void*, uint64_t, int64_t); -typedef int64_t (*IFipUp_t)(int32_t, void*, uint64_t, void*); -typedef int64_t (*IFpIip_t)(void*, int64_t, int32_t, void*); -typedef int64_t (*IFppii_t)(void*, void*, int32_t, int32_t); -typedef int64_t (*IFppip_t)(void*, void*, int32_t, void*); -typedef int64_t (*IFSIii_t)(void*, int64_t, int32_t, int32_t); -typedef uint8_t (*CFuuff_t)(uint32_t, uint32_t, float, float); -typedef uint8_t (*CFpiii_t)(void*, int32_t, int32_t, int32_t); -typedef uint8_t (*CFpLLi_t)(void*, uintptr_t, uintptr_t, int32_t); -typedef uint8_t (*CFppip_t)(void*, void*, int32_t, void*); -typedef uint8_t (*CFbupp_t)(void*, uint32_t, void*, void*); -typedef uint32_t (*uFEipp_t)(x64emu_t*, int32_t, void*, void*); -typedef uint32_t (*uFEupp_t)(x64emu_t*, uint32_t, void*, void*); -typedef uint32_t (*uFEpup_t)(x64emu_t*, void*, uint32_t, void*); -typedef uint32_t (*uFEppp_t)(x64emu_t*, void*, void*, void*); -typedef uint32_t (*uFiiii_t)(int32_t, int32_t, int32_t, int32_t); -typedef uint32_t (*uFiiuu_t)(int32_t, int32_t, uint32_t, uint32_t); -typedef uint32_t (*uFifff_t)(int32_t, float, float, float); -typedef uint32_t (*uFuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t); -typedef uint32_t (*uFpiip_t)(void*, int32_t, int32_t, void*); -typedef uint32_t (*uFpipu_t)(void*, int32_t, void*, uint32_t); -typedef uint32_t (*uFpipL_t)(void*, int32_t, void*, uintptr_t); -typedef uint32_t (*uFpipp_t)(void*, int32_t, void*, void*); -typedef uint32_t (*uFpCCC_t)(void*, uint8_t, uint8_t, uint8_t); -typedef uint32_t (*uFpuip_t)(void*, uint32_t, int32_t, void*); -typedef uint32_t (*uFpuup_t)(void*, uint32_t, uint32_t, void*); -typedef uint32_t (*uFpupi_t)(void*, uint32_t, void*, int32_t); -typedef uint32_t (*uFpupu_t)(void*, uint32_t, void*, uint32_t); -typedef uint32_t (*uFpupp_t)(void*, uint32_t, void*, void*); -typedef uint32_t (*uFpubp_t)(void*, uint32_t, void*, void*); -typedef uint32_t (*uFppiu_t)(void*, void*, int32_t, uint32_t); -typedef uint32_t (*uFppip_t)(void*, void*, int32_t, void*); -typedef uint32_t (*uFppuu_t)(void*, void*, uint32_t, uint32_t); -typedef uint32_t (*uFpplp_t)(void*, void*, intptr_t, void*); -typedef uint32_t (*uFppLp_t)(void*, void*, uintptr_t, void*); -typedef uint32_t (*uFpppi_t)(void*, void*, void*, int32_t); -typedef uint32_t (*uFpppu_t)(void*, void*, void*, uint32_t); -typedef uint32_t (*uFpppL_t)(void*, void*, void*, uintptr_t); -typedef uint32_t (*uFpppp_t)(void*, void*, void*, void*); -typedef uint32_t (*uFbipp_t)(void*, int32_t, void*, void*); -typedef uint32_t (*uFbCWp_t)(void*, uint8_t, uint16_t, void*); -typedef uint32_t (*uFbuWp_t)(void*, uint32_t, uint16_t, void*); -typedef uint32_t (*uFbuuC_t)(void*, uint32_t, uint32_t, uint8_t); -typedef uint32_t (*uFbuuu_t)(void*, uint32_t, uint32_t, uint32_t); -typedef uint32_t (*uFbuup_t)(void*, uint32_t, uint32_t, void*); -typedef uint64_t (*UFpUui_t)(void*, uint64_t, uint32_t, int32_t); -typedef uint64_t (*UFppii_t)(void*, void*, int32_t, int32_t); -typedef uint64_t (*UFppip_t)(void*, void*, int32_t, void*); -typedef uint64_t (*UFbipp_t)(void*, int32_t, void*, void*); -typedef double (*dFpppp_t)(void*, void*, void*, void*); -typedef intptr_t (*lFEipV_t)(x64emu_t*, int32_t, void*, void*); -typedef intptr_t (*lFEpip_t)(x64emu_t*, void*, int32_t, void*); -typedef intptr_t (*lFEppL_t)(x64emu_t*, void*, void*, uintptr_t); -typedef intptr_t (*lFEppp_t)(x64emu_t*, void*, void*, void*); -typedef intptr_t (*lFiiLu_t)(int32_t, int32_t, uintptr_t, uint32_t); -typedef intptr_t (*lFiipL_t)(int32_t, int32_t, void*, uintptr_t); -typedef intptr_t (*lFipil_t)(int32_t, void*, int32_t, intptr_t); -typedef intptr_t (*lFipLi_t)(int32_t, void*, uintptr_t, int32_t); -typedef intptr_t (*lFipLI_t)(int32_t, void*, uintptr_t, int64_t); -typedef intptr_t (*lFipLu_t)(int32_t, void*, uintptr_t, uint32_t); -typedef intptr_t (*lFipLl_t)(int32_t, void*, uintptr_t, intptr_t); -typedef intptr_t (*lFipLL_t)(int32_t, void*, uintptr_t, uintptr_t); -typedef intptr_t (*lFipLp_t)(int32_t, void*, uintptr_t, void*); -typedef intptr_t (*lFippL_t)(int32_t, void*, void*, uintptr_t); -typedef intptr_t (*lFpili_t)(void*, int32_t, intptr_t, int32_t); -typedef intptr_t (*lFpilp_t)(void*, int32_t, intptr_t, void*); -typedef intptr_t (*lFpuip_t)(void*, uint32_t, int32_t, void*); -typedef intptr_t (*lFplip_t)(void*, intptr_t, int32_t, void*); -typedef intptr_t (*lFplpp_t)(void*, intptr_t, void*, void*); -typedef intptr_t (*lFpLpp_t)(void*, uintptr_t, void*, void*); -typedef intptr_t (*lFppii_t)(void*, void*, int32_t, int32_t); -typedef intptr_t (*lFppip_t)(void*, void*, int32_t, void*); -typedef intptr_t (*lFpppL_t)(void*, void*, void*, uintptr_t); -typedef intptr_t (*lFpppp_t)(void*, void*, void*, void*); -typedef uintptr_t (*LFEppL_t)(x64emu_t*, void*, void*, uintptr_t); -typedef uintptr_t (*LFEppp_t)(x64emu_t*, void*, void*, void*); -typedef uintptr_t (*LFipLL_t)(int32_t, void*, uintptr_t, uintptr_t); -typedef uintptr_t (*LFippL_t)(int32_t, void*, void*, uintptr_t); -typedef uintptr_t (*LFippp_t)(int32_t, void*, void*, void*); -typedef uintptr_t (*LFuipL_t)(uint32_t, int32_t, void*, uintptr_t); -typedef uintptr_t (*LFpCii_t)(void*, uint8_t, int32_t, int32_t); -typedef uintptr_t (*LFpupL_t)(void*, uint32_t, void*, uintptr_t); -typedef uintptr_t (*LFpLCL_t)(void*, uintptr_t, uint8_t, uintptr_t); -typedef uintptr_t (*LFpLLp_t)(void*, uintptr_t, uintptr_t, void*); -typedef uintptr_t (*LFpLpL_t)(void*, uintptr_t, void*, uintptr_t); -typedef uintptr_t (*LFpLpp_t)(void*, uintptr_t, void*, void*); -typedef uintptr_t (*LFppii_t)(void*, void*, int32_t, int32_t); -typedef uintptr_t (*LFppip_t)(void*, void*, int32_t, void*); -typedef uintptr_t (*LFppLu_t)(void*, void*, uintptr_t, uint32_t); -typedef uintptr_t (*LFppLL_t)(void*, void*, uintptr_t, uintptr_t); -typedef uintptr_t (*LFppLp_t)(void*, void*, uintptr_t, void*); -typedef uintptr_t (*LFpppi_t)(void*, void*, void*, int32_t); -typedef uintptr_t (*LFpppL_t)(void*, void*, void*, uintptr_t); -typedef uintptr_t (*LFpppp_t)(void*, void*, void*, void*); -typedef void* (*pFEipp_t)(x64emu_t*, int32_t, void*, void*); -typedef void* (*pFEuup_t)(x64emu_t*, uint32_t, uint32_t, void*); -typedef void* (*pFEupp_t)(x64emu_t*, uint32_t, void*, void*); -typedef void* (*pFELpV_t)(x64emu_t*, uintptr_t, void*, void*); -typedef void* (*pFELpA_t)(x64emu_t*, uintptr_t, void*, void*); -typedef void* (*pFEpii_t)(x64emu_t*, void*, int32_t, int32_t); -typedef void* (*pFEpip_t)(x64emu_t*, void*, int32_t, void*); -typedef void* (*pFEpuL_t)(x64emu_t*, void*, uint32_t, uintptr_t); -typedef void* (*pFEppi_t)(x64emu_t*, void*, void*, int32_t); -typedef void* (*pFEppp_t)(x64emu_t*, void*, void*, void*); -typedef void* (*pFEppV_t)(x64emu_t*, void*, void*, void*); -typedef void* (*pFiiii_t)(int32_t, int32_t, int32_t, int32_t); -typedef void* (*pFiiiu_t)(int32_t, int32_t, int32_t, uint32_t); -typedef void* (*pFiiuu_t)(int32_t, int32_t, uint32_t, uint32_t); -typedef void* (*pFiiup_t)(int32_t, int32_t, uint32_t, void*); -typedef void* (*pFiiLp_t)(int32_t, int32_t, uintptr_t, void*); -typedef void* (*pFiipi_t)(int32_t, int32_t, void*, int32_t); -typedef void* (*pFiIIi_t)(int32_t, int64_t, int64_t, int32_t); -typedef void* (*pFillu_t)(int32_t, intptr_t, intptr_t, uint32_t); -typedef void* (*pFipii_t)(int32_t, void*, int32_t, int32_t); -typedef void* (*pFipip_t)(int32_t, void*, int32_t, void*); -typedef void* (*pFippi_t)(int32_t, void*, void*, int32_t); -typedef void* (*pFippu_t)(int32_t, void*, void*, uint32_t); -typedef void* (*pFippL_t)(int32_t, void*, void*, uintptr_t); -typedef void* (*pFippp_t)(int32_t, void*, void*, void*); -typedef void* (*pFuuii_t)(uint32_t, uint32_t, int32_t, int32_t); -typedef void* (*pFuuip_t)(uint32_t, uint32_t, int32_t, void*); -typedef void* (*pFuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t); -typedef void* (*pFullu_t)(uint32_t, intptr_t, intptr_t, uint32_t); -typedef void* (*pFupii_t)(uint32_t, void*, int32_t, int32_t); -typedef void* (*pFuppp_t)(uint32_t, void*, void*, void*); -typedef void* (*pFffff_t)(float, float, float, float); -typedef void* (*pFdipp_t)(double, int32_t, void*, void*); -typedef void* (*pFdddd_t)(double, double, double, double); -typedef void* (*pFDipp_t)(long double, int32_t, void*, void*); -typedef void* (*pFlfff_t)(intptr_t, float, float, float); -typedef void* (*pFLiip_t)(uintptr_t, int32_t, int32_t, void*); -typedef void* (*pFLLup_t)(uintptr_t, uintptr_t, uint32_t, void*); -typedef void* (*pFLLpp_t)(uintptr_t, uintptr_t, void*, void*); -typedef void* (*pFLppp_t)(uintptr_t, void*, void*, void*); -typedef void* (*pFpiii_t)(void*, int32_t, int32_t, int32_t); -typedef void* (*pFpiiu_t)(void*, int32_t, int32_t, uint32_t); -typedef void* (*pFpiip_t)(void*, int32_t, int32_t, void*); -typedef void* (*pFpiuu_t)(void*, int32_t, uint32_t, uint32_t); -typedef void* (*pFpiLi_t)(void*, int32_t, uintptr_t, int32_t); -typedef void* (*pFpiLL_t)(void*, int32_t, uintptr_t, uintptr_t); -typedef void* (*pFpipi_t)(void*, int32_t, void*, int32_t); -typedef void* (*pFpipd_t)(void*, int32_t, void*, double); -typedef void* (*pFpipL_t)(void*, int32_t, void*, uintptr_t); -typedef void* (*pFpipp_t)(void*, int32_t, void*, void*); -typedef void* (*pFpCip_t)(void*, uint8_t, int32_t, void*); -typedef void* (*pFpWWW_t)(void*, uint16_t, uint16_t, uint16_t); -typedef void* (*pFpuii_t)(void*, uint32_t, int32_t, int32_t); -typedef void* (*pFpuip_t)(void*, uint32_t, int32_t, void*); -typedef void* (*pFpuuu_t)(void*, uint32_t, uint32_t, uint32_t); -typedef void* (*pFpuup_t)(void*, uint32_t, uint32_t, void*); -typedef void* (*pFpudd_t)(void*, uint32_t, double, double); -typedef void* (*pFpuLL_t)(void*, uint32_t, uintptr_t, uintptr_t); -typedef void* (*pFpupi_t)(void*, uint32_t, void*, int32_t); -typedef void* (*pFpupu_t)(void*, uint32_t, void*, uint32_t); -typedef void* (*pFpupp_t)(void*, uint32_t, void*, void*); -typedef void* (*pFpdIU_t)(void*, double, int64_t, uint64_t); -typedef void* (*pFpddi_t)(void*, double, double, int32_t); -typedef void* (*pFplil_t)(void*, intptr_t, int32_t, intptr_t); -typedef void* (*pFplip_t)(void*, intptr_t, int32_t, void*); -typedef void* (*pFplpl_t)(void*, intptr_t, void*, intptr_t); -typedef void* (*pFplpp_t)(void*, intptr_t, void*, void*); -typedef void* (*pFpLii_t)(void*, uintptr_t, int32_t, int32_t); -typedef void* (*pFpLip_t)(void*, uintptr_t, int32_t, void*); -typedef void* (*pFpLup_t)(void*, uintptr_t, uint32_t, void*); -typedef void* (*pFpLLp_t)(void*, uintptr_t, uintptr_t, void*); -typedef void* (*pFpLpi_t)(void*, uintptr_t, void*, int32_t); -typedef void* (*pFpLpl_t)(void*, uintptr_t, void*, intptr_t); -typedef void* (*pFpLpL_t)(void*, uintptr_t, void*, uintptr_t); -typedef void* (*pFpLpp_t)(void*, uintptr_t, void*, void*); -typedef void* (*pFppii_t)(void*, void*, int32_t, int32_t); -typedef void* (*pFppiu_t)(void*, void*, int32_t, uint32_t); -typedef void* (*pFppiL_t)(void*, void*, int32_t, uintptr_t); -typedef void* (*pFppip_t)(void*, void*, int32_t, void*); -typedef void* (*pFppCp_t)(void*, void*, uint8_t, void*); -typedef void* (*pFppWp_t)(void*, void*, uint16_t, void*); -typedef void* (*pFppuu_t)(void*, void*, uint32_t, uint32_t); -typedef void* (*pFppuL_t)(void*, void*, uint32_t, uintptr_t); -typedef void* (*pFppup_t)(void*, void*, uint32_t, void*); -typedef void* (*pFppUU_t)(void*, void*, uint64_t, uint64_t); -typedef void* (*pFppdd_t)(void*, void*, double, double); -typedef void* (*pFppll_t)(void*, void*, intptr_t, intptr_t); -typedef void* (*pFpplp_t)(void*, void*, intptr_t, void*); -typedef void* (*pFppLi_t)(void*, void*, uintptr_t, int32_t); -typedef void* (*pFppLL_t)(void*, void*, uintptr_t, uintptr_t); -typedef void* (*pFppLp_t)(void*, void*, uintptr_t, void*); -typedef void* (*pFpppi_t)(void*, void*, void*, int32_t); -typedef void* (*pFpppu_t)(void*, void*, void*, uint32_t); -typedef void* (*pFpppL_t)(void*, void*, void*, uintptr_t); -typedef void* (*pFpppp_t)(void*, void*, void*, void*); -typedef void* (*pFpbii_t)(void*, void*, int32_t, int32_t); -typedef void* (*pFSppi_t)(void*, void*, void*, int32_t); -typedef void* (*pFbCuW_t)(void*, uint8_t, uint32_t, uint16_t); -typedef void* (*pFbCuu_t)(void*, uint8_t, uint32_t, uint32_t); -typedef void* (*pFbuWp_t)(void*, uint32_t, uint16_t, void*); -typedef void* (*pFbuuC_t)(void*, uint32_t, uint32_t, uint8_t); -typedef void* (*pFbuuu_t)(void*, uint32_t, uint32_t, uint32_t); -typedef void* (*pFbuup_t)(void*, uint32_t, uint32_t, void*); -typedef void* (*pFbpWp_t)(void*, void*, uint16_t, void*); -typedef void* (*pFbpup_t)(void*, void*, uint32_t, void*); -typedef void* (*pFbppu_t)(void*, void*, void*, uint32_t); -typedef void* (*pFbppU_t)(void*, void*, void*, uint64_t); -typedef void (*vWpiiu_t)(void*, int32_t, int32_t, uint32_t); -typedef void (*vWpuup_t)(void*, uint32_t, uint32_t, void*); -typedef int32_t (*iWEpip_t)(x64emu_t*, void*, int32_t, void*); -typedef int32_t (*iWEpup_t)(x64emu_t*, void*, uint32_t, void*); -typedef int32_t (*iWEppu_t)(x64emu_t*, void*, void*, uint32_t); -typedef int32_t (*iWEppp_t)(x64emu_t*, void*, void*, void*); -typedef int32_t (*iWpiii_t)(void*, int32_t, int32_t, int32_t); -typedef int32_t (*iWpiuu_t)(void*, int32_t, uint32_t, uint32_t); -typedef int32_t (*iWpuiu_t)(void*, uint32_t, int32_t, uint32_t); -typedef int32_t (*iWpuip_t)(void*, uint32_t, int32_t, void*); -typedef int32_t (*iWpuup_t)(void*, uint32_t, uint32_t, void*); -typedef int32_t (*iWpupu_t)(void*, uint32_t, void*, uint32_t); -typedef int32_t (*iWpupp_t)(void*, uint32_t, void*, void*); -typedef int32_t (*iWppuu_t)(void*, void*, uint32_t, uint32_t); -typedef int32_t (*iWpppu_t)(void*, void*, void*, uint32_t); -typedef int32_t (*iWpppp_t)(void*, void*, void*, void*); -typedef void (*vFEiipV_t)(x64emu_t*, int32_t, int32_t, void*, void*); -typedef void (*vFEiipA_t)(x64emu_t*, int32_t, int32_t, void*, void*); -typedef void (*vFEippp_t)(x64emu_t*, int32_t, void*, void*, void*); -typedef void (*vFEpipV_t)(x64emu_t*, void*, int32_t, void*, void*); -typedef void (*vFEpipA_t)(x64emu_t*, void*, int32_t, void*, void*); -typedef void (*vFEpuup_t)(x64emu_t*, void*, uint32_t, uint32_t, void*); -typedef void (*vFEpuuV_t)(x64emu_t*, void*, uint32_t, uint32_t, void*); -typedef void (*vFEpupp_t)(x64emu_t*, void*, uint32_t, void*, void*); -typedef void (*vFEpupA_t)(x64emu_t*, void*, uint32_t, void*, void*); -typedef void (*vFEpLLp_t)(x64emu_t*, void*, uintptr_t, uintptr_t, void*); -typedef void (*vFEppip_t)(x64emu_t*, void*, void*, int32_t, void*); -typedef void (*vFEppiV_t)(x64emu_t*, void*, void*, int32_t, void*); -typedef void (*vFEppuu_t)(x64emu_t*, void*, void*, uint32_t, uint32_t); -typedef void (*vFEppup_t)(x64emu_t*, void*, void*, uint32_t, void*); -typedef void (*vFEpppi_t)(x64emu_t*, void*, void*, void*, int32_t); -typedef void (*vFEpppp_t)(x64emu_t*, void*, void*, void*, void*); -typedef void (*vFiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFiiiiu_t)(int32_t, int32_t, int32_t, int32_t, uint32_t); -typedef void (*vFiiipi_t)(int32_t, int32_t, int32_t, void*, int32_t); -typedef void (*vFiiuii_t)(int32_t, int32_t, uint32_t, int32_t, int32_t); -typedef void (*vFiiuup_t)(int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFiillu_t)(int32_t, int32_t, intptr_t, intptr_t, uint32_t); -typedef void (*vFiilll_t)(int32_t, int32_t, intptr_t, intptr_t, intptr_t); -typedef void (*vFiipii_t)(int32_t, int32_t, void*, int32_t, int32_t); -typedef void (*vFiipll_t)(int32_t, int32_t, void*, intptr_t, intptr_t); -typedef void (*vFiuiip_t)(int32_t, uint32_t, int32_t, int32_t, void*); -typedef void (*vFiuipi_t)(int32_t, uint32_t, int32_t, void*, int32_t); -typedef void (*vFiuuuu_t)(int32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFiulpp_t)(int32_t, uint32_t, intptr_t, void*, void*); -typedef void (*vFiffff_t)(int32_t, float, float, float, float); -typedef void (*vFidddd_t)(int32_t, double, double, double, double); -typedef void (*vFilill_t)(int32_t, intptr_t, int32_t, intptr_t, intptr_t); -typedef void (*vFilipi_t)(int32_t, intptr_t, int32_t, void*, int32_t); -typedef void (*vFilipl_t)(int32_t, intptr_t, int32_t, void*, intptr_t); -typedef void (*vFillll_t)(int32_t, intptr_t, intptr_t, intptr_t, intptr_t); -typedef void (*vFiLLLL_t)(int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (*vFipipu_t)(int32_t, void*, int32_t, void*, uint32_t); -typedef void (*vFipipp_t)(int32_t, void*, int32_t, void*, void*); -typedef void (*vFipupi_t)(int32_t, void*, uint32_t, void*, int32_t); -typedef void (*vFucccc_t)(uint32_t, int8_t, int8_t, int8_t, int8_t); -typedef void (*vFuwwww_t)(uint32_t, int16_t, int16_t, int16_t, int16_t); -typedef void (*vFuiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuiiiu_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t); -typedef void (*vFuiiip_t)(uint32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFuiiCp_t)(uint32_t, int32_t, int32_t, uint8_t, void*); -typedef void (*vFuiiup_t)(uint32_t, int32_t, int32_t, uint32_t, void*); -typedef void (*vFuiill_t)(uint32_t, int32_t, int32_t, intptr_t, intptr_t); -typedef void (*vFuiuii_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t); -typedef void (*vFuiuip_t)(uint32_t, int32_t, uint32_t, int32_t, void*); -typedef void (*vFuiuCi_t)(uint32_t, int32_t, uint32_t, uint8_t, int32_t); -typedef void (*vFuiuCu_t)(uint32_t, int32_t, uint32_t, uint8_t, uint32_t); -typedef void (*vFuiuuu_t)(uint32_t, int32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFuiuup_t)(uint32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuiupi_t)(uint32_t, int32_t, uint32_t, void*, int32_t); -typedef void (*vFuifff_t)(uint32_t, int32_t, float, float, float); -typedef void (*vFuiddd_t)(uint32_t, int32_t, double, double, double); -typedef void (*vFuilll_t)(uint32_t, int32_t, intptr_t, intptr_t, intptr_t); -typedef void (*vFuiLLL_t)(uint32_t, int32_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (*vFuipii_t)(uint32_t, int32_t, void*, int32_t, int32_t); -typedef void (*vFuipip_t)(uint32_t, int32_t, void*, int32_t, void*); -typedef void (*vFuipup_t)(uint32_t, int32_t, void*, uint32_t, void*); -typedef void (*vFuippp_t)(uint32_t, int32_t, void*, void*, void*); -typedef void (*vFuCCCC_t)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t); -typedef void (*vFuCuip_t)(uint32_t, uint8_t, uint32_t, int32_t, void*); -typedef void (*vFuCuup_t)(uint32_t, uint8_t, uint32_t, uint32_t, void*); -typedef void (*vFuWWWW_t)(uint32_t, uint16_t, uint16_t, uint16_t, uint16_t); -typedef void (*vFuuiii_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t); -typedef void (*vFuuiiu_t)(uint32_t, uint32_t, int32_t, int32_t, uint32_t); -typedef void (*vFuuiip_t)(uint32_t, uint32_t, int32_t, int32_t, void*); -typedef void (*vFuuiui_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t); -typedef void (*vFuuiuu_t)(uint32_t, uint32_t, int32_t, uint32_t, uint32_t); -typedef void (*vFuuiup_t)(uint32_t, uint32_t, int32_t, uint32_t, void*); -typedef void (*vFuuifi_t)(uint32_t, uint32_t, int32_t, float, int32_t); -typedef void (*vFuuipC_t)(uint32_t, uint32_t, int32_t, void*, uint8_t); -typedef void (*vFuuipu_t)(uint32_t, uint32_t, int32_t, void*, uint32_t); -typedef void (*vFuuipp_t)(uint32_t, uint32_t, int32_t, void*, void*); -typedef void (*vFuuuii_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t); -typedef void (*vFuuuiu_t)(uint32_t, uint32_t, uint32_t, int32_t, uint32_t); -typedef void (*vFuuuil_t)(uint32_t, uint32_t, uint32_t, int32_t, intptr_t); -typedef void (*vFuuuip_t)(uint32_t, uint32_t, uint32_t, int32_t, void*); -typedef void (*vFuuuui_t)(uint32_t, uint32_t, uint32_t, uint32_t, int32_t); -typedef void (*vFuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFuuuup_t)(uint32_t, uint32_t, uint32_t, uint32_t, void*); -typedef void (*vFuuuli_t)(uint32_t, uint32_t, uint32_t, intptr_t, int32_t); -typedef void (*vFuuull_t)(uint32_t, uint32_t, uint32_t, intptr_t, intptr_t); -typedef void (*vFuulll_t)(uint32_t, uint32_t, intptr_t, intptr_t, intptr_t); -typedef void (*vFuullp_t)(uint32_t, uint32_t, intptr_t, intptr_t, void*); -typedef void (*vFuupii_t)(uint32_t, uint32_t, void*, int32_t, int32_t); -typedef void (*vFuuppu_t)(uint32_t, uint32_t, void*, void*, uint32_t); -typedef void (*vFuffff_t)(uint32_t, float, float, float, float); -typedef void (*vFudddd_t)(uint32_t, double, double, double, double); -typedef void (*vFulill_t)(uint32_t, intptr_t, int32_t, intptr_t, intptr_t); -typedef void (*vFullll_t)(uint32_t, intptr_t, intptr_t, intptr_t, intptr_t); -typedef void (*vFullpu_t)(uint32_t, intptr_t, intptr_t, void*, uint32_t); -typedef void (*vFuLLLL_t)(uint32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (*vFupiii_t)(uint32_t, void*, int32_t, int32_t, int32_t); -typedef void (*vFupupi_t)(uint32_t, void*, uint32_t, void*, int32_t); -typedef void (*vFupupp_t)(uint32_t, void*, uint32_t, void*, void*); -typedef void (*vFuplii_t)(uint32_t, void*, intptr_t, int32_t, int32_t); -typedef void (*vFuppip_t)(uint32_t, void*, void*, int32_t, void*); -typedef void (*vFupppu_t)(uint32_t, void*, void*, void*, uint32_t); -typedef void (*vFupppp_t)(uint32_t, void*, void*, void*, void*); -typedef void (*vFfffff_t)(float, float, float, float, float); -typedef void (*vFddddp_t)(double, double, double, double, void*); -typedef void (*vFluipp_t)(intptr_t, uint32_t, int32_t, void*, void*); -typedef void (*vFLpppi_t)(uintptr_t, void*, void*, void*, int32_t); -typedef void (*vFLpppp_t)(uintptr_t, void*, void*, void*, void*); -typedef void (*vFpiiii_t)(void*, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFpiiiI_t)(void*, int32_t, int32_t, int32_t, int64_t); -typedef void (*vFpiiiu_t)(void*, int32_t, int32_t, int32_t, uint32_t); -typedef void (*vFpiiip_t)(void*, int32_t, int32_t, int32_t, void*); -typedef void (*vFpiiII_t)(void*, int32_t, int32_t, int64_t, int64_t); -typedef void (*vFpiiuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t); -typedef void (*vFpiiup_t)(void*, int32_t, int32_t, uint32_t, void*); -typedef void (*vFpiiff_t)(void*, int32_t, int32_t, float, float); -typedef void (*vFpiipp_t)(void*, int32_t, int32_t, void*, void*); -typedef void (*vFpiIiI_t)(void*, int32_t, int64_t, int32_t, int64_t); -typedef void (*vFpiIII_t)(void*, int32_t, int64_t, int64_t, int64_t); -typedef void (*vFpiuuu_t)(void*, int32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFpiUUu_t)(void*, int32_t, uint64_t, uint64_t, uint32_t); -typedef void (*vFpiUUp_t)(void*, int32_t, uint64_t, uint64_t, void*); -typedef void (*vFpilpp_t)(void*, int32_t, intptr_t, void*, void*); -typedef void (*vFpipii_t)(void*, int32_t, void*, int32_t, int32_t); -typedef void (*vFpippi_t)(void*, int32_t, void*, void*, int32_t); -typedef void (*vFpippp_t)(void*, int32_t, void*, void*, void*); -typedef void (*vFpuiip_t)(void*, uint32_t, int32_t, int32_t, void*); -typedef void (*vFpuipp_t)(void*, uint32_t, int32_t, void*, void*); -typedef void (*vFpuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFpuuup_t)(void*, uint32_t, uint32_t, uint32_t, void*); -typedef void (*vFpuupp_t)(void*, uint32_t, uint32_t, void*, void*); -typedef void (*vFpuddd_t)(void*, uint32_t, double, double, double); -typedef void (*vFpupiu_t)(void*, uint32_t, void*, int32_t, uint32_t); -typedef void (*vFpupup_t)(void*, uint32_t, void*, uint32_t, void*); -typedef void (*vFpUuuu_t)(void*, uint64_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFpUUuu_t)(void*, uint64_t, uint64_t, uint32_t, uint32_t); -typedef void (*vFpUUup_t)(void*, uint64_t, uint64_t, uint32_t, void*); -typedef void (*vFpUUUi_t)(void*, uint64_t, uint64_t, uint64_t, int32_t); -typedef void (*vFpUUUu_t)(void*, uint64_t, uint64_t, uint64_t, uint32_t); -typedef void (*vFpUUUp_t)(void*, uint64_t, uint64_t, uint64_t, void*); -typedef void (*vFpfffi_t)(void*, float, float, float, int32_t); -typedef void (*vFpffff_t)(void*, float, float, float, float); -typedef void (*vFpdiII_t)(void*, double, int32_t, int64_t, int64_t); -typedef void (*vFpddii_t)(void*, double, double, int32_t, int32_t); -typedef void (*vFpdddd_t)(void*, double, double, double, double); -typedef void (*vFpddpp_t)(void*, double, double, void*, void*); -typedef void (*vFpluul_t)(void*, intptr_t, uint32_t, uint32_t, intptr_t); -typedef void (*vFplppp_t)(void*, intptr_t, void*, void*, void*); -typedef void (*vFpLLLL_t)(void*, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (*vFpLLpp_t)(void*, uintptr_t, uintptr_t, void*, void*); -typedef void (*vFpLpiL_t)(void*, uintptr_t, void*, int32_t, uintptr_t); -typedef void (*vFppiii_t)(void*, void*, int32_t, int32_t, int32_t); -typedef void (*vFppiiu_t)(void*, void*, int32_t, int32_t, uint32_t); -typedef void (*vFppiip_t)(void*, void*, int32_t, int32_t, void*); -typedef void (*vFppiui_t)(void*, void*, int32_t, uint32_t, int32_t); -typedef void (*vFppiup_t)(void*, void*, int32_t, uint32_t, void*); -typedef void (*vFppiff_t)(void*, void*, int32_t, float, float); -typedef void (*vFppidd_t)(void*, void*, int32_t, double, double); -typedef void (*vFppipi_t)(void*, void*, int32_t, void*, int32_t); -typedef void (*vFppipp_t)(void*, void*, int32_t, void*, void*); -typedef void (*vFppWui_t)(void*, void*, uint16_t, uint32_t, int32_t); -typedef void (*vFppuii_t)(void*, void*, uint32_t, int32_t, int32_t); -typedef void (*vFppuui_t)(void*, void*, uint32_t, uint32_t, int32_t); -typedef void (*vFppuuu_t)(void*, void*, uint32_t, uint32_t, uint32_t); -typedef void (*vFppuup_t)(void*, void*, uint32_t, uint32_t, void*); -typedef void (*vFppudd_t)(void*, void*, uint32_t, double, double); -typedef void (*vFppupi_t)(void*, void*, uint32_t, void*, int32_t); -typedef void (*vFppupu_t)(void*, void*, uint32_t, void*, uint32_t); -typedef void (*vFppupp_t)(void*, void*, uint32_t, void*, void*); -typedef void (*vFppfff_t)(void*, void*, float, float, float); -typedef void (*vFppddp_t)(void*, void*, double, double, void*); -typedef void (*vFppLLL_t)(void*, void*, uintptr_t, uintptr_t, uintptr_t); -typedef void (*vFppLpL_t)(void*, void*, uintptr_t, void*, uintptr_t); -typedef void (*vFpppii_t)(void*, void*, void*, int32_t, int32_t); -typedef void (*vFpppip_t)(void*, void*, void*, int32_t, void*); -typedef void (*vFpppui_t)(void*, void*, void*, uint32_t, int32_t); -typedef void (*vFpppuu_t)(void*, void*, void*, uint32_t, uint32_t); -typedef void (*vFpppup_t)(void*, void*, void*, uint32_t, void*); -typedef void (*vFpppff_t)(void*, void*, void*, float, float); -typedef void (*vFpppdd_t)(void*, void*, void*, double, double); -typedef void (*vFpppLp_t)(void*, void*, void*, uintptr_t, void*); -typedef void (*vFppppi_t)(void*, void*, void*, void*, int32_t); -typedef void (*vFppppu_t)(void*, void*, void*, void*, uint32_t); -typedef void (*vFppppL_t)(void*, void*, void*, void*, uintptr_t); -typedef void (*vFppppp_t)(void*, void*, void*, void*, void*); -typedef int32_t (*iFEiipp_t)(x64emu_t*, int32_t, int32_t, void*, void*); -typedef int32_t (*iFEiipV_t)(x64emu_t*, int32_t, int32_t, void*, void*); -typedef int32_t (*iFEiipA_t)(x64emu_t*, int32_t, int32_t, void*, void*); -typedef int32_t (*iFEipip_t)(x64emu_t*, int32_t, void*, int32_t, void*); -typedef int32_t (*iFEippi_t)(x64emu_t*, int32_t, void*, void*, int32_t); -typedef int32_t (*iFEippL_t)(x64emu_t*, int32_t, void*, void*, uintptr_t); -typedef int32_t (*iFEippp_t)(x64emu_t*, int32_t, void*, void*, void*); -typedef int32_t (*iFEpiii_t)(x64emu_t*, void*, int32_t, int32_t, int32_t); -typedef int32_t (*iFEpipi_t)(x64emu_t*, void*, int32_t, void*, int32_t); -typedef int32_t (*iFEpipp_t)(x64emu_t*, void*, int32_t, void*, void*); -typedef int32_t (*iFEpipV_t)(x64emu_t*, void*, int32_t, void*, void*); -typedef int32_t (*iFEpipA_t)(x64emu_t*, void*, int32_t, void*, void*); -typedef int32_t (*iFEpUup_t)(x64emu_t*, void*, uint64_t, uint32_t, void*); -typedef int32_t (*iFEpLpp_t)(x64emu_t*, void*, uintptr_t, void*, void*); -typedef int32_t (*iFEpLpV_t)(x64emu_t*, void*, uintptr_t, void*, void*); -typedef int32_t (*iFEpLpA_t)(x64emu_t*, void*, uintptr_t, void*, void*); -typedef int32_t (*iFEppii_t)(x64emu_t*, void*, void*, int32_t, int32_t); -typedef int32_t (*iFEppip_t)(x64emu_t*, void*, void*, int32_t, void*); -typedef int32_t (*iFEppiV_t)(x64emu_t*, void*, void*, int32_t, void*); -typedef int32_t (*iFEppiA_t)(x64emu_t*, void*, void*, int32_t, void*); -typedef int32_t (*iFEpplp_t)(x64emu_t*, void*, void*, intptr_t, void*); -typedef int32_t (*iFEpppi_t)(x64emu_t*, void*, void*, void*, int32_t); -typedef int32_t (*iFEpppL_t)(x64emu_t*, void*, void*, void*, uintptr_t); -typedef int32_t (*iFEpppp_t)(x64emu_t*, void*, void*, void*, void*); -typedef int32_t (*iFEpppV_t)(x64emu_t*, void*, void*, void*, void*); -typedef int32_t (*iFEpppA_t)(x64emu_t*, void*, void*, void*, void*); -typedef int32_t (*iFiiipu_t)(int32_t, int32_t, int32_t, void*, uint32_t); -typedef int32_t (*iFiiipp_t)(int32_t, int32_t, int32_t, void*, void*); -typedef int32_t (*iFiiupp_t)(int32_t, int32_t, uint32_t, void*, void*); -typedef int32_t (*iFiuuuu_t)(int32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef int32_t (*iFiuuup_t)(int32_t, uint32_t, uint32_t, uint32_t, void*); -typedef int32_t (*iFiuLip_t)(int32_t, uint32_t, uintptr_t, int32_t, void*); -typedef int32_t (*iFillLL_t)(int32_t, intptr_t, intptr_t, uintptr_t, uintptr_t); -typedef int32_t (*iFipiii_t)(int32_t, void*, int32_t, int32_t, int32_t); -typedef int32_t (*iFipiup_t)(int32_t, void*, int32_t, uint32_t, void*); -typedef int32_t (*iFipipi_t)(int32_t, void*, int32_t, void*, int32_t); -typedef int32_t (*iFipipu_t)(int32_t, void*, int32_t, void*, uint32_t); -typedef int32_t (*iFipuip_t)(int32_t, void*, uint32_t, int32_t, void*); -typedef int32_t (*iFipuui_t)(int32_t, void*, uint32_t, uint32_t, int32_t); -typedef int32_t (*iFipLup_t)(int32_t, void*, uintptr_t, uint32_t, void*); -typedef int32_t (*iFippuu_t)(int32_t, void*, void*, uint32_t, uint32_t); -typedef int32_t (*iFippLi_t)(int32_t, void*, void*, uintptr_t, int32_t); -typedef int32_t (*iFippLp_t)(int32_t, void*, void*, uintptr_t, void*); -typedef int32_t (*iFipppi_t)(int32_t, void*, void*, void*, int32_t); -typedef int32_t (*iFipppp_t)(int32_t, void*, void*, void*, void*); -typedef int32_t (*iFuuupp_t)(uint32_t, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFuppLp_t)(uint32_t, void*, void*, uintptr_t, void*); -typedef int32_t (*iFLppip_t)(uintptr_t, void*, void*, int32_t, void*); -typedef int32_t (*iFLpppp_t)(uintptr_t, void*, void*, void*, void*); -typedef int32_t (*iFpwwww_t)(void*, int16_t, int16_t, int16_t, int16_t); -typedef int32_t (*iFpwppp_t)(void*, int16_t, void*, void*, void*); -typedef int32_t (*iFpiiii_t)(void*, int32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iFpiiiu_t)(void*, int32_t, int32_t, int32_t, uint32_t); -typedef int32_t (*iFpiiiL_t)(void*, int32_t, int32_t, int32_t, uintptr_t); -typedef int32_t (*iFpiiip_t)(void*, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFpiiui_t)(void*, int32_t, int32_t, uint32_t, int32_t); -typedef int32_t (*iFpiiuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t); -typedef int32_t (*iFpiipi_t)(void*, int32_t, int32_t, void*, int32_t); -typedef int32_t (*iFpiipp_t)(void*, int32_t, int32_t, void*, void*); -typedef int32_t (*iFpiIip_t)(void*, int32_t, int64_t, int32_t, void*); -typedef int32_t (*iFpiuwp_t)(void*, int32_t, uint32_t, int16_t, void*); -typedef int32_t (*iFpiuuu_t)(void*, int32_t, uint32_t, uint32_t, uint32_t); -typedef int32_t (*iFpiUUU_t)(void*, int32_t, uint64_t, uint64_t, uint64_t); -typedef int32_t (*iFpipii_t)(void*, int32_t, void*, int32_t, int32_t); -typedef int32_t (*iFpipiu_t)(void*, int32_t, void*, int32_t, uint32_t); -typedef int32_t (*iFpipiL_t)(void*, int32_t, void*, int32_t, uintptr_t); -typedef int32_t (*iFpipip_t)(void*, int32_t, void*, int32_t, void*); -typedef int32_t (*iFpippi_t)(void*, int32_t, void*, void*, int32_t); -typedef int32_t (*iFpippW_t)(void*, int32_t, void*, void*, uint16_t); -typedef int32_t (*iFpippp_t)(void*, int32_t, void*, void*, void*); -typedef int32_t (*iFpCCCC_t)(void*, uint8_t, uint8_t, uint8_t, uint8_t); -typedef int32_t (*iFpCupp_t)(void*, uint8_t, uint32_t, void*, void*); -typedef int32_t (*iFpCpip_t)(void*, uint8_t, void*, int32_t, void*); -typedef int32_t (*iFpuill_t)(void*, uint32_t, int32_t, intptr_t, intptr_t); -typedef int32_t (*iFpuipi_t)(void*, uint32_t, int32_t, void*, int32_t); -typedef int32_t (*iFpuipp_t)(void*, uint32_t, int32_t, void*, void*); -typedef int32_t (*iFpuuip_t)(void*, uint32_t, uint32_t, int32_t, void*); -typedef int32_t (*iFpuuui_t)(void*, uint32_t, uint32_t, uint32_t, int32_t); -typedef int32_t (*iFpuuup_t)(void*, uint32_t, uint32_t, uint32_t, void*); -typedef int32_t (*iFpuuLL_t)(void*, uint32_t, uint32_t, uintptr_t, uintptr_t); -typedef int32_t (*iFpuupp_t)(void*, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFpulup_t)(void*, uint32_t, intptr_t, uint32_t, void*); -typedef int32_t (*iFpulpp_t)(void*, uint32_t, intptr_t, void*, void*); -typedef int32_t (*iFpuLpL_t)(void*, uint32_t, uintptr_t, void*, uintptr_t); -typedef int32_t (*iFpuLpp_t)(void*, uint32_t, uintptr_t, void*, void*); -typedef int32_t (*iFpupui_t)(void*, uint32_t, void*, uint32_t, int32_t); -typedef int32_t (*iFpupuu_t)(void*, uint32_t, void*, uint32_t, uint32_t); -typedef int32_t (*iFpupuU_t)(void*, uint32_t, void*, uint32_t, uint64_t); -typedef int32_t (*iFpupup_t)(void*, uint32_t, void*, uint32_t, void*); -typedef int32_t (*iFpuppL_t)(void*, uint32_t, void*, void*, uintptr_t); -typedef int32_t (*iFpuppp_t)(void*, uint32_t, void*, void*, void*); -typedef int32_t (*iFpUiUi_t)(void*, uint64_t, int32_t, uint64_t, int32_t); -typedef int32_t (*iFpUupp_t)(void*, uint64_t, uint32_t, void*, void*); -typedef int32_t (*iFplupp_t)(void*, intptr_t, uint32_t, void*, void*); -typedef int32_t (*iFplluu_t)(void*, intptr_t, intptr_t, uint32_t, uint32_t); -typedef int32_t (*iFpLiup_t)(void*, uintptr_t, int32_t, uint32_t, void*); -typedef int32_t (*iFpLilp_t)(void*, uintptr_t, int32_t, intptr_t, void*); -typedef int32_t (*iFpLiLi_t)(void*, uintptr_t, int32_t, uintptr_t, int32_t); -typedef int32_t (*iFpLlpp_t)(void*, uintptr_t, intptr_t, void*, void*); -typedef int32_t (*iFpLLii_t)(void*, uintptr_t, uintptr_t, int32_t, int32_t); -typedef int32_t (*iFpLLup_t)(void*, uintptr_t, uintptr_t, uint32_t, void*); -typedef int32_t (*iFpLLpp_t)(void*, uintptr_t, uintptr_t, void*, void*); -typedef int32_t (*iFpLpii_t)(void*, uintptr_t, void*, int32_t, int32_t); -typedef int32_t (*iFpLpiL_t)(void*, uintptr_t, void*, int32_t, uintptr_t); -typedef int32_t (*iFpLpuL_t)(void*, uintptr_t, void*, uint32_t, uintptr_t); -typedef int32_t (*iFpLpup_t)(void*, uintptr_t, void*, uint32_t, void*); -typedef int32_t (*iFpLpLi_t)(void*, uintptr_t, void*, uintptr_t, int32_t); -typedef int32_t (*iFpLppi_t)(void*, uintptr_t, void*, void*, int32_t); -typedef int32_t (*iFpLppL_t)(void*, uintptr_t, void*, void*, uintptr_t); -typedef int32_t (*iFpLppp_t)(void*, uintptr_t, void*, void*, void*); -typedef int32_t (*iFppiiu_t)(void*, void*, int32_t, int32_t, uint32_t); -typedef int32_t (*iFppiiL_t)(void*, void*, int32_t, int32_t, uintptr_t); -typedef int32_t (*iFppiip_t)(void*, void*, int32_t, int32_t, void*); -typedef int32_t (*iFppiuu_t)(void*, void*, int32_t, uint32_t, uint32_t); -typedef int32_t (*iFppiup_t)(void*, void*, int32_t, uint32_t, void*); -typedef int32_t (*iFppiLi_t)(void*, void*, int32_t, uintptr_t, int32_t); -typedef int32_t (*iFppiLL_t)(void*, void*, int32_t, uintptr_t, uintptr_t); -typedef int32_t (*iFppipi_t)(void*, void*, int32_t, void*, int32_t); -typedef int32_t (*iFppipu_t)(void*, void*, int32_t, void*, uint32_t); -typedef int32_t (*iFppipp_t)(void*, void*, int32_t, void*, void*); -typedef int32_t (*iFppuwp_t)(void*, void*, uint32_t, int16_t, void*); -typedef int32_t (*iFppuip_t)(void*, void*, uint32_t, int32_t, void*); -typedef int32_t (*iFppuuu_t)(void*, void*, uint32_t, uint32_t, uint32_t); -typedef int32_t (*iFppuup_t)(void*, void*, uint32_t, uint32_t, void*); -typedef int32_t (*iFppupi_t)(void*, void*, uint32_t, void*, int32_t); -typedef int32_t (*iFppupu_t)(void*, void*, uint32_t, void*, uint32_t); -typedef int32_t (*iFppupp_t)(void*, void*, uint32_t, void*, void*); -typedef int32_t (*iFppUup_t)(void*, void*, uint64_t, uint32_t, void*); -typedef int32_t (*iFpplii_t)(void*, void*, intptr_t, int32_t, int32_t); -typedef int32_t (*iFppllp_t)(void*, void*, intptr_t, intptr_t, void*); -typedef int32_t (*iFpplpp_t)(void*, void*, intptr_t, void*, void*); -typedef int32_t (*iFppLup_t)(void*, void*, uintptr_t, uint32_t, void*); -typedef int32_t (*iFppLpi_t)(void*, void*, uintptr_t, void*, int32_t); -typedef int32_t (*iFppLpL_t)(void*, void*, uintptr_t, void*, uintptr_t); -typedef int32_t (*iFppLpp_t)(void*, void*, uintptr_t, void*, void*); -typedef int32_t (*iFpppii_t)(void*, void*, void*, int32_t, int32_t); -typedef int32_t (*iFpppip_t)(void*, void*, void*, int32_t, void*); -typedef int32_t (*iFpppui_t)(void*, void*, void*, uint32_t, int32_t); -typedef int32_t (*iFpppup_t)(void*, void*, void*, uint32_t, void*); -typedef int32_t (*iFpppUi_t)(void*, void*, void*, uint64_t, int32_t); -typedef int32_t (*iFpppLi_t)(void*, void*, void*, uintptr_t, int32_t); -typedef int32_t (*iFpppLL_t)(void*, void*, void*, uintptr_t, uintptr_t); -typedef int32_t (*iFpppLp_t)(void*, void*, void*, uintptr_t, void*); -typedef int32_t (*iFppppi_t)(void*, void*, void*, void*, int32_t); -typedef int32_t (*iFppppu_t)(void*, void*, void*, void*, uint32_t); -typedef int32_t (*iFppppl_t)(void*, void*, void*, void*, intptr_t); -typedef int32_t (*iFppppL_t)(void*, void*, void*, void*, uintptr_t); -typedef int32_t (*iFppppp_t)(void*, void*, void*, void*, void*); -typedef int64_t (*IFppIII_t)(void*, void*, int64_t, int64_t, int64_t); -typedef uint32_t (*uFEippp_t)(x64emu_t*, int32_t, void*, void*, void*); -typedef uint32_t (*uFEpipp_t)(x64emu_t*, void*, int32_t, void*, void*); -typedef uint32_t (*uFEppuu_t)(x64emu_t*, void*, void*, uint32_t, uint32_t); -typedef uint32_t (*uFEpppp_t)(x64emu_t*, void*, void*, void*, void*); -typedef uint32_t (*uFEpppV_t)(x64emu_t*, void*, void*, void*, void*); -typedef uint32_t (*uFiuuuu_t)(int32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef uint32_t (*uFiuppi_t)(int32_t, uint32_t, void*, void*, int32_t); -typedef uint32_t (*uFipipp_t)(int32_t, void*, int32_t, void*, void*); -typedef uint32_t (*uFipLpp_t)(int32_t, void*, uintptr_t, void*, void*); -typedef uint32_t (*uFuiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef uint32_t (*uFLpppL_t)(uintptr_t, void*, void*, void*, uintptr_t); -typedef uint32_t (*uFpCCCC_t)(void*, uint8_t, uint8_t, uint8_t, uint8_t); -typedef uint32_t (*uFpWuip_t)(void*, uint16_t, uint32_t, int32_t, void*); -typedef uint32_t (*uFpuuui_t)(void*, uint32_t, uint32_t, uint32_t, int32_t); -typedef uint32_t (*uFpuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t); -typedef uint32_t (*uFpuupp_t)(void*, uint32_t, uint32_t, void*, void*); -typedef uint32_t (*uFpupuu_t)(void*, uint32_t, void*, uint32_t, uint32_t); -typedef uint32_t (*uFpuppp_t)(void*, uint32_t, void*, void*, void*); -typedef uint32_t (*uFppipp_t)(void*, void*, int32_t, void*, void*); -typedef uint32_t (*uFppuup_t)(void*, void*, uint32_t, uint32_t, void*); -typedef uint32_t (*uFppupp_t)(void*, void*, uint32_t, void*, void*); -typedef uint32_t (*uFpplip_t)(void*, void*, intptr_t, int32_t, void*); -typedef uint32_t (*uFppLpp_t)(void*, void*, uintptr_t, void*, void*); -typedef uint32_t (*uFppppL_t)(void*, void*, void*, void*, uintptr_t); -typedef uint32_t (*uFppppp_t)(void*, void*, void*, void*, void*); -typedef uint32_t (*uFbCuuu_t)(void*, uint8_t, uint32_t, uint32_t, uint32_t); -typedef uint32_t (*uFbCuup_t)(void*, uint8_t, uint32_t, uint32_t, void*); -typedef uint32_t (*uFbuuWW_t)(void*, uint32_t, uint32_t, uint16_t, uint16_t); -typedef uint32_t (*uFbuuup_t)(void*, uint32_t, uint32_t, uint32_t, void*); -typedef uint64_t (*UFuiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef intptr_t (*lFEuipp_t)(x64emu_t*, uint32_t, int32_t, void*, void*); -typedef intptr_t (*lFipili_t)(int32_t, void*, int32_t, intptr_t, int32_t); -typedef intptr_t (*lFipLli_t)(int32_t, void*, uintptr_t, intptr_t, int32_t); -typedef intptr_t (*lFipLlL_t)(int32_t, void*, uintptr_t, intptr_t, uintptr_t); -typedef intptr_t (*lFipLLi_t)(int32_t, void*, uintptr_t, uintptr_t, int32_t); -typedef intptr_t (*lFipLpp_t)(int32_t, void*, uintptr_t, void*, void*); -typedef intptr_t (*lFpuipC_t)(void*, uint32_t, int32_t, void*, uint8_t); -typedef intptr_t (*lFpuuLL_t)(void*, uint32_t, uint32_t, uintptr_t, uintptr_t); -typedef intptr_t (*lFppupp_t)(void*, void*, uint32_t, void*, void*); -typedef intptr_t (*lFppllp_t)(void*, void*, intptr_t, intptr_t, void*); -typedef intptr_t (*lFppLpL_t)(void*, void*, uintptr_t, void*, uintptr_t); -typedef intptr_t (*lFppLpp_t)(void*, void*, uintptr_t, void*, void*); -typedef uintptr_t (*LFELppi_t)(x64emu_t*, uintptr_t, void*, void*, int32_t); -typedef uintptr_t (*LFEpppp_t)(x64emu_t*, void*, void*, void*, void*); -typedef uintptr_t (*LFuiCiu_t)(uint32_t, int32_t, uint8_t, int32_t, uint32_t); -typedef uintptr_t (*LFLpppL_t)(uintptr_t, void*, void*, void*, uintptr_t); -typedef uintptr_t (*LFpuipp_t)(void*, uint32_t, int32_t, void*, void*); -typedef uintptr_t (*LFpuppi_t)(void*, uint32_t, void*, void*, int32_t); -typedef uintptr_t (*LFpLuuu_t)(void*, uintptr_t, uint32_t, uint32_t, uint32_t); -typedef uintptr_t (*LFpLLLp_t)(void*, uintptr_t, uintptr_t, uintptr_t, void*); -typedef uintptr_t (*LFpLpuu_t)(void*, uintptr_t, void*, uint32_t, uint32_t); -typedef uintptr_t (*LFpLppL_t)(void*, uintptr_t, void*, void*, uintptr_t); -typedef uintptr_t (*LFpLppp_t)(void*, uintptr_t, void*, void*, void*); -typedef uintptr_t (*LFppLLp_t)(void*, void*, uintptr_t, uintptr_t, void*); -typedef uintptr_t (*LFppLpL_t)(void*, void*, uintptr_t, void*, uintptr_t); -typedef uintptr_t (*LFpppii_t)(void*, void*, void*, int32_t, int32_t); -typedef uintptr_t (*LFppppp_t)(void*, void*, void*, void*, void*); -typedef void* (*pFEpiii_t)(x64emu_t*, void*, int32_t, int32_t, int32_t); -typedef void* (*pFEpipL_t)(x64emu_t*, void*, int32_t, void*, uintptr_t); -typedef void* (*pFEpipp_t)(x64emu_t*, void*, int32_t, void*, void*); -typedef void* (*pFEpipV_t)(x64emu_t*, void*, int32_t, void*, void*); -typedef void* (*pFEpipA_t)(x64emu_t*, void*, int32_t, void*, void*); -typedef void* (*pFEpupp_t)(x64emu_t*, void*, uint32_t, void*, void*); -typedef void* (*pFEpUpp_t)(x64emu_t*, void*, uint64_t, void*, void*); -typedef void* (*pFEpLpp_t)(x64emu_t*, void*, uintptr_t, void*, void*); -typedef void* (*pFEppii_t)(x64emu_t*, void*, void*, int32_t, int32_t); -typedef void* (*pFEppip_t)(x64emu_t*, void*, void*, int32_t, void*); -typedef void* (*pFEppLp_t)(x64emu_t*, void*, void*, uintptr_t, void*); -typedef void* (*pFEpppi_t)(x64emu_t*, void*, void*, void*, int32_t); -typedef void* (*pFEpppu_t)(x64emu_t*, void*, void*, void*, uint32_t); -typedef void* (*pFEpppp_t)(x64emu_t*, void*, void*, void*, void*); -typedef void* (*pFEpppV_t)(x64emu_t*, void*, void*, void*, void*); -typedef void* (*pFEpppA_t)(x64emu_t*, void*, void*, void*, void*); -typedef void* (*pFiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void* (*pFiiipL_t)(int32_t, int32_t, int32_t, void*, uintptr_t); -typedef void* (*pFipipL_t)(int32_t, void*, int32_t, void*, uintptr_t); -typedef void* (*pFipipp_t)(int32_t, void*, int32_t, void*, void*); -typedef void* (*pFuiiiu_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t); -typedef void* (*pFuiupp_t)(uint32_t, int32_t, uint32_t, void*, void*); -typedef void* (*pFuuiip_t)(uint32_t, uint32_t, int32_t, int32_t, void*); -typedef void* (*pFuuupu_t)(uint32_t, uint32_t, uint32_t, void*, uint32_t); -typedef void* (*pFuupuu_t)(uint32_t, uint32_t, void*, uint32_t, uint32_t); -typedef void* (*pFudddp_t)(uint32_t, double, double, double, void*); -typedef void* (*pFupLpl_t)(uint32_t, void*, uintptr_t, void*, intptr_t); -typedef void* (*pFupLpL_t)(uint32_t, void*, uintptr_t, void*, uintptr_t); -typedef void* (*pFddddi_t)(double, double, double, double, int32_t); -typedef void* (*pFLuppp_t)(uintptr_t, uint32_t, void*, void*, void*); -typedef void* (*pFLpppi_t)(uintptr_t, void*, void*, void*, int32_t); -typedef void* (*pFpiiii_t)(void*, int32_t, int32_t, int32_t, int32_t); -typedef void* (*pFpiiip_t)(void*, int32_t, int32_t, int32_t, void*); -typedef void* (*pFpiiuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t); -typedef void* (*pFpiipi_t)(void*, int32_t, int32_t, void*, int32_t); -typedef void* (*pFpiipL_t)(void*, int32_t, int32_t, void*, uintptr_t); -typedef void* (*pFpiipp_t)(void*, int32_t, int32_t, void*, void*); -typedef void* (*pFpiCCC_t)(void*, int32_t, uint8_t, uint8_t, uint8_t); -typedef void* (*pFpiuuu_t)(void*, int32_t, uint32_t, uint32_t, uint32_t); -typedef void* (*pFpiuup_t)(void*, int32_t, uint32_t, uint32_t, void*); -typedef void* (*pFpiupp_t)(void*, int32_t, uint32_t, void*, void*); -typedef void* (*pFpiLip_t)(void*, int32_t, uintptr_t, int32_t, void*); -typedef void* (*pFpipip_t)(void*, int32_t, void*, int32_t, void*); -typedef void* (*pFpipup_t)(void*, int32_t, void*, uint32_t, void*); -typedef void* (*pFpippi_t)(void*, int32_t, void*, void*, int32_t); -typedef void* (*pFpippp_t)(void*, int32_t, void*, void*, void*); -typedef void* (*pFpuiii_t)(void*, uint32_t, int32_t, int32_t, int32_t); -typedef void* (*pFpuiip_t)(void*, uint32_t, int32_t, int32_t, void*); -typedef void* (*pFpuuip_t)(void*, uint32_t, uint32_t, int32_t, void*); -typedef void* (*pFpuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void* (*pFpuuup_t)(void*, uint32_t, uint32_t, uint32_t, void*); -typedef void* (*pFpuupp_t)(void*, uint32_t, uint32_t, void*, void*); -typedef void* (*pFpuLpp_t)(void*, uint32_t, uintptr_t, void*, void*); -typedef void* (*pFpuppu_t)(void*, uint32_t, void*, void*, uint32_t); -typedef void* (*pFpuppp_t)(void*, uint32_t, void*, void*, void*); -typedef void* (*pFpUdii_t)(void*, uint64_t, double, int32_t, int32_t); -typedef void* (*pFpfffi_t)(void*, float, float, float, int32_t); -typedef void* (*pFpdddd_t)(void*, double, double, double, double); -typedef void* (*pFplppp_t)(void*, intptr_t, void*, void*, void*); -typedef void* (*pFpLiii_t)(void*, uintptr_t, int32_t, int32_t, int32_t); -typedef void* (*pFpLLip_t)(void*, uintptr_t, uintptr_t, int32_t, void*); -typedef void* (*pFpLLLp_t)(void*, uintptr_t, uintptr_t, uintptr_t, void*); -typedef void* (*pFpLpii_t)(void*, uintptr_t, void*, int32_t, int32_t); -typedef void* (*pFpLpip_t)(void*, uintptr_t, void*, int32_t, void*); -typedef void* (*pFpLpup_t)(void*, uintptr_t, void*, uint32_t, void*); -typedef void* (*pFppiii_t)(void*, void*, int32_t, int32_t, int32_t); -typedef void* (*pFppiiu_t)(void*, void*, int32_t, int32_t, uint32_t); -typedef void* (*pFppiip_t)(void*, void*, int32_t, int32_t, void*); -typedef void* (*pFppiup_t)(void*, void*, int32_t, uint32_t, void*); -typedef void* (*pFppipi_t)(void*, void*, int32_t, void*, int32_t); -typedef void* (*pFppipp_t)(void*, void*, int32_t, void*, void*); -typedef void* (*pFppWpp_t)(void*, void*, uint16_t, void*, void*); -typedef void* (*pFppuip_t)(void*, void*, uint32_t, int32_t, void*); -typedef void* (*pFppuuu_t)(void*, void*, uint32_t, uint32_t, uint32_t); -typedef void* (*pFppuup_t)(void*, void*, uint32_t, uint32_t, void*); -typedef void* (*pFppupp_t)(void*, void*, uint32_t, void*, void*); -typedef void* (*pFppddu_t)(void*, void*, double, double, uint32_t); -typedef void* (*pFppLii_t)(void*, void*, uintptr_t, int32_t, int32_t); -typedef void* (*pFppLLi_t)(void*, void*, uintptr_t, uintptr_t, int32_t); -typedef void* (*pFppLpp_t)(void*, void*, uintptr_t, void*, void*); -typedef void* (*pFpppii_t)(void*, void*, void*, int32_t, int32_t); -typedef void* (*pFpppip_t)(void*, void*, void*, int32_t, void*); -typedef void* (*pFpppui_t)(void*, void*, void*, uint32_t, int32_t); -typedef void* (*pFpppup_t)(void*, void*, void*, uint32_t, void*); -typedef void* (*pFpppli_t)(void*, void*, void*, intptr_t, int32_t); -typedef void* (*pFpppLi_t)(void*, void*, void*, uintptr_t, int32_t); -typedef void* (*pFppppi_t)(void*, void*, void*, void*, int32_t); -typedef void* (*pFppppu_t)(void*, void*, void*, void*, uint32_t); -typedef void* (*pFppppL_t)(void*, void*, void*, void*, uintptr_t); -typedef void* (*pFppppp_t)(void*, void*, void*, void*, void*); -typedef void* (*pFbuWWW_t)(void*, uint32_t, uint16_t, uint16_t, uint16_t); -typedef void* (*pFbuuWW_t)(void*, uint32_t, uint32_t, uint16_t, uint16_t); -typedef void* (*pFbuuup_t)(void*, uint32_t, uint32_t, uint32_t, void*); -typedef void* (*pFbupii_t)(void*, uint32_t, void*, int32_t, int32_t); -typedef void* (*pFbpuii_t)(void*, void*, uint32_t, int32_t, int32_t); -typedef void* (*pFbpppp_t)(void*, void*, void*, void*, void*); -typedef int32_t (*iWEpiup_t)(x64emu_t*, void*, int32_t, uint32_t, void*); -typedef int32_t (*iWEpipp_t)(x64emu_t*, void*, int32_t, void*, void*); -typedef int32_t (*iWpiiii_t)(void*, int32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iWpiupu_t)(void*, int32_t, uint32_t, void*, uint32_t); -typedef int32_t (*iWpuiii_t)(void*, uint32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iWpuiup_t)(void*, uint32_t, int32_t, uint32_t, void*); -typedef int32_t (*iWpuupu_t)(void*, uint32_t, uint32_t, void*, uint32_t); -typedef int32_t (*iWpuupp_t)(void*, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iWpupuu_t)(void*, uint32_t, void*, uint32_t, uint32_t); -typedef int32_t (*iWpupup_t)(void*, uint32_t, void*, uint32_t, void*); -typedef int32_t (*iWpuppu_t)(void*, uint32_t, void*, void*, uint32_t); -typedef int32_t (*iWpuppp_t)(void*, uint32_t, void*, void*, void*); -typedef int32_t (*iWpppuu_t)(void*, void*, void*, uint32_t, uint32_t); -typedef int32_t (*iWpppup_t)(void*, void*, void*, uint32_t, void*); -typedef int32_t (*iWppppp_t)(void*, void*, void*, void*, void*); -typedef void (*vFEiiipp_t)(x64emu_t*, int32_t, int32_t, int32_t, void*, void*); -typedef void (*vFEpiwpp_t)(x64emu_t*, void*, int32_t, int16_t, void*, void*); -typedef void (*vFEpiLpp_t)(x64emu_t*, void*, int32_t, uintptr_t, void*, void*); -typedef void (*vFEpippp_t)(x64emu_t*, void*, int32_t, void*, void*, void*); -typedef void (*vFEpuipp_t)(x64emu_t*, void*, uint32_t, int32_t, void*, void*); -typedef void (*vFEpuipV_t)(x64emu_t*, void*, uint32_t, int32_t, void*, void*); -typedef void (*vFEpupup_t)(x64emu_t*, void*, uint32_t, void*, uint32_t, void*); -typedef void (*vFEpuppp_t)(x64emu_t*, void*, uint32_t, void*, void*, void*); -typedef void (*vFEpLLpp_t)(x64emu_t*, void*, uintptr_t, uintptr_t, void*, void*); -typedef void (*vFEppipV_t)(x64emu_t*, void*, void*, int32_t, void*, void*); -typedef void (*vFEppipA_t)(x64emu_t*, void*, void*, int32_t, void*, void*); -typedef void (*vFEppupp_t)(x64emu_t*, void*, void*, uint32_t, void*, void*); -typedef void (*vFEppppp_t)(x64emu_t*, void*, void*, void*, void*, void*); -typedef void (*vFiiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFiiiuil_t)(int32_t, int32_t, int32_t, uint32_t, int32_t, intptr_t); -typedef void (*vFiiilpi_t)(int32_t, int32_t, int32_t, intptr_t, void*, int32_t); -typedef void (*vFiiuilp_t)(int32_t, int32_t, uint32_t, int32_t, intptr_t, void*); -typedef void (*vFiffiff_t)(int32_t, float, float, int32_t, float, float); -typedef void (*vFiddidd_t)(int32_t, double, double, int32_t, double, double); -typedef void (*vFilipli_t)(int32_t, intptr_t, int32_t, void*, intptr_t, int32_t); -typedef void (*vFiliplu_t)(int32_t, intptr_t, int32_t, void*, intptr_t, uint32_t); -typedef void (*vFillill_t)(int32_t, intptr_t, intptr_t, int32_t, intptr_t, intptr_t); -typedef void (*vFipiplp_t)(int32_t, void*, int32_t, void*, intptr_t, void*); -typedef void (*vFCCCCff_t)(uint8_t, uint8_t, uint8_t, uint8_t, float, float); -typedef void (*vFuiiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuiiiip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFuiiuii_t)(uint32_t, int32_t, int32_t, uint32_t, int32_t, int32_t); -typedef void (*vFuiiuup_t)(uint32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuiuiii_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t); -typedef void (*vFuiuiiC_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, uint8_t); -typedef void (*vFuiuiil_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, intptr_t); -typedef void (*vFuiuiip_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, void*); -typedef void (*vFuiuiuu_t)(uint32_t, int32_t, uint32_t, int32_t, uint32_t, uint32_t); -typedef void (*vFuiuiuL_t)(uint32_t, int32_t, uint32_t, int32_t, uint32_t, uintptr_t); -typedef void (*vFuiuCip_t)(uint32_t, int32_t, uint32_t, uint8_t, int32_t, void*); -typedef void (*vFuiuuip_t)(uint32_t, int32_t, uint32_t, uint32_t, int32_t, void*); -typedef void (*vFuiuuuu_t)(uint32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFuiupii_t)(uint32_t, int32_t, uint32_t, void*, int32_t, int32_t); -typedef void (*vFuiupiu_t)(uint32_t, int32_t, uint32_t, void*, int32_t, uint32_t); -typedef void (*vFuiffff_t)(uint32_t, int32_t, float, float, float, float); -typedef void (*vFuidddd_t)(uint32_t, int32_t, double, double, double, double); -typedef void (*vFuillll_t)(uint32_t, int32_t, intptr_t, intptr_t, intptr_t, intptr_t); -typedef void (*vFuiLLLL_t)(uint32_t, int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (*vFuipiup_t)(uint32_t, int32_t, void*, int32_t, uint32_t, void*); -typedef void (*vFuCuuip_t)(uint32_t, uint8_t, uint32_t, uint32_t, int32_t, void*); -typedef void (*vFuuiiii_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuuiiiu_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, uint32_t); -typedef void (*vFuuiuii_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t); -typedef void (*vFuuiuil_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, intptr_t); -typedef void (*vFuuiuip_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, void*); -typedef void (*vFuuiuCu_t)(uint32_t, uint32_t, int32_t, uint32_t, uint8_t, uint32_t); -typedef void (*vFuuiuup_t)(uint32_t, uint32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuuippp_t)(uint32_t, uint32_t, int32_t, void*, void*, void*); -typedef void (*vFuuuiii_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t); -typedef void (*vFuuuiup_t)(uint32_t, uint32_t, uint32_t, int32_t, uint32_t, void*); -typedef void (*vFuuuipi_t)(uint32_t, uint32_t, uint32_t, int32_t, void*, int32_t); -typedef void (*vFuuuipC_t)(uint32_t, uint32_t, uint32_t, int32_t, void*, uint8_t); -typedef void (*vFuuuipp_t)(uint32_t, uint32_t, uint32_t, int32_t, void*, void*); -typedef void (*vFuuuuii_t)(uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t); -typedef void (*vFuuuuip_t)(uint32_t, uint32_t, uint32_t, uint32_t, int32_t, void*); -typedef void (*vFuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFuuuull_t)(uint32_t, uint32_t, uint32_t, uint32_t, intptr_t, intptr_t); -typedef void (*vFuuuppi_t)(uint32_t, uint32_t, uint32_t, void*, void*, int32_t); -typedef void (*vFuuuppp_t)(uint32_t, uint32_t, uint32_t, void*, void*, void*); -typedef void (*vFuuffff_t)(uint32_t, uint32_t, float, float, float, float); -typedef void (*vFuudddd_t)(uint32_t, uint32_t, double, double, double, double); -typedef void (*vFuupiii_t)(uint32_t, uint32_t, void*, int32_t, int32_t, int32_t); -typedef void (*vFuupupp_t)(uint32_t, uint32_t, void*, uint32_t, void*, void*); -typedef void (*vFuuplii_t)(uint32_t, uint32_t, void*, intptr_t, int32_t, int32_t); -typedef void (*vFuffiip_t)(uint32_t, float, float, int32_t, int32_t, void*); -typedef void (*vFufffff_t)(uint32_t, float, float, float, float, float); -typedef void (*vFuddiip_t)(uint32_t, double, double, int32_t, int32_t, void*); -typedef void (*vFullill_t)(uint32_t, intptr_t, intptr_t, int32_t, intptr_t, intptr_t); -typedef void (*vFulluLC_t)(uint32_t, intptr_t, intptr_t, uint32_t, uintptr_t, uint8_t); -typedef void (*vFupiiii_t)(uint32_t, void*, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFupupip_t)(uint32_t, void*, uint32_t, void*, int32_t, void*); -typedef void (*vFuppppu_t)(uint32_t, void*, void*, void*, void*, uint32_t); -typedef void (*vFuppppp_t)(uint32_t, void*, void*, void*, void*, void*); -typedef void (*vFUUpppp_t)(uint64_t, uint64_t, void*, void*, void*, void*); -typedef void (*vFffffff_t)(float, float, float, float, float, float); -typedef void (*vFdddddd_t)(double, double, double, double, double, double); -typedef void (*vFdddppp_t)(double, double, double, void*, void*, void*); -typedef void (*vFpiiiii_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFpiiipp_t)(void*, int32_t, int32_t, int32_t, void*, void*); -typedef void (*vFpiiuuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFpiippi_t)(void*, int32_t, int32_t, void*, void*, int32_t); -typedef void (*vFpiippp_t)(void*, int32_t, int32_t, void*, void*, void*); -typedef void (*vFpiUuup_t)(void*, int32_t, uint64_t, uint32_t, uint32_t, void*); -typedef void (*vFpipipp_t)(void*, int32_t, void*, int32_t, void*, void*); -typedef void (*vFpipipV_t)(void*, int32_t, void*, int32_t, void*, void*); -typedef void (*vFpipppi_t)(void*, int32_t, void*, void*, void*, int32_t); -typedef void (*vFpipppp_t)(void*, int32_t, void*, void*, void*, void*); -typedef void (*vFpuiiii_t)(void*, uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFpuiiiu_t)(void*, uint32_t, int32_t, int32_t, int32_t, uint32_t); -typedef void (*vFpuiipp_t)(void*, uint32_t, int32_t, int32_t, void*, void*); -typedef void (*vFpuuuiu_t)(void*, uint32_t, uint32_t, uint32_t, int32_t, uint32_t); -typedef void (*vFpuuuup_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, void*); -typedef void (*vFpuuupp_t)(void*, uint32_t, uint32_t, uint32_t, void*, void*); -typedef void (*vFpuupuu_t)(void*, uint32_t, uint32_t, void*, uint32_t, uint32_t); -typedef void (*vFpuuppp_t)(void*, uint32_t, uint32_t, void*, void*, void*); -typedef void (*vFpudddd_t)(void*, uint32_t, double, double, double, double); -typedef void (*vFpupiUu_t)(void*, uint32_t, void*, int32_t, uint64_t, uint32_t); -typedef void (*vFpupuuu_t)(void*, uint32_t, void*, uint32_t, uint32_t, uint32_t); -typedef void (*vFpupupu_t)(void*, uint32_t, void*, uint32_t, void*, uint32_t); -typedef void (*vFpuppuu_t)(void*, uint32_t, void*, void*, uint32_t, uint32_t); -typedef void (*vFpupppp_t)(void*, uint32_t, void*, void*, void*, void*); -typedef void (*vFpUiUup_t)(void*, uint64_t, int32_t, uint64_t, uint32_t, void*); -typedef void (*vFpUipup_t)(void*, uint64_t, int32_t, void*, uint32_t, void*); -typedef void (*vFpUuuup_t)(void*, uint64_t, uint32_t, uint32_t, uint32_t, void*); -typedef void (*vFpUUiup_t)(void*, uint64_t, uint64_t, int32_t, uint32_t, void*); -typedef void (*vFpdddii_t)(void*, double, double, double, int32_t, int32_t); -typedef void (*vFpddddd_t)(void*, double, double, double, double, double); -typedef void (*vFpddddp_t)(void*, double, double, double, double, void*); -typedef void (*vFppiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppiiip_t)(void*, void*, int32_t, int32_t, int32_t, void*); -typedef void (*vFppiiuu_t)(void*, void*, int32_t, int32_t, uint32_t, uint32_t); -typedef void (*vFppiipi_t)(void*, void*, int32_t, int32_t, void*, int32_t); -typedef void (*vFppiipp_t)(void*, void*, int32_t, int32_t, void*, void*); -typedef void (*vFppilpp_t)(void*, void*, int32_t, intptr_t, void*, void*); -typedef void (*vFppipLp_t)(void*, void*, int32_t, void*, uintptr_t, void*); -typedef void (*vFppippi_t)(void*, void*, int32_t, void*, void*, int32_t); -typedef void (*vFppippp_t)(void*, void*, int32_t, void*, void*, void*); -typedef void (*vFppuiii_t)(void*, void*, uint32_t, int32_t, int32_t, int32_t); -typedef void (*vFppuiiu_t)(void*, void*, uint32_t, int32_t, int32_t, uint32_t); -typedef void (*vFppuiip_t)(void*, void*, uint32_t, int32_t, int32_t, void*); -typedef void (*vFppuuuu_t)(void*, void*, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFppuUUU_t)(void*, void*, uint32_t, uint64_t, uint64_t, uint64_t); -typedef void (*vFppupii_t)(void*, void*, uint32_t, void*, int32_t, int32_t); -typedef void (*vFppuppp_t)(void*, void*, uint32_t, void*, void*, void*); -typedef void (*vFppffff_t)(void*, void*, float, float, float, float); -typedef void (*vFppdidd_t)(void*, void*, double, int32_t, double, double); -typedef void (*vFppdddd_t)(void*, void*, double, double, double, double); -typedef void (*vFpplppi_t)(void*, void*, intptr_t, void*, void*, int32_t); -typedef void (*vFpplppp_t)(void*, void*, intptr_t, void*, void*, void*); -typedef void (*vFppLppi_t)(void*, void*, uintptr_t, void*, void*, int32_t); -typedef void (*vFppLppp_t)(void*, void*, uintptr_t, void*, void*, void*); -typedef void (*vFpppiii_t)(void*, void*, void*, int32_t, int32_t, int32_t); -typedef void (*vFpppiip_t)(void*, void*, void*, int32_t, int32_t, void*); -typedef void (*vFpppiui_t)(void*, void*, void*, int32_t, uint32_t, int32_t); -typedef void (*vFpppiff_t)(void*, void*, void*, int32_t, float, float); -typedef void (*vFpppipu_t)(void*, void*, void*, int32_t, void*, uint32_t); -typedef void (*vFpppuii_t)(void*, void*, void*, uint32_t, int32_t, int32_t); -typedef void (*vFpppuuu_t)(void*, void*, void*, uint32_t, uint32_t, uint32_t); -typedef void (*vFppppii_t)(void*, void*, void*, void*, int32_t, int32_t); -typedef void (*vFpppppi_t)(void*, void*, void*, void*, void*, int32_t); -typedef void (*vFpppppu_t)(void*, void*, void*, void*, void*, uint32_t); -typedef void (*vFpppppU_t)(void*, void*, void*, void*, void*, uint64_t); -typedef void (*vFpppppL_t)(void*, void*, void*, void*, void*, uintptr_t); -typedef void (*vFpppppp_t)(void*, void*, void*, void*, void*, void*); -typedef int8_t (*cFppLppi_t)(void*, void*, uintptr_t, void*, void*, int32_t); -typedef int32_t (*iFEiippi_t)(x64emu_t*, int32_t, int32_t, void*, void*, int32_t); -typedef int32_t (*iFEiippp_t)(x64emu_t*, int32_t, int32_t, void*, void*, void*); -typedef int32_t (*iFEiLLLL_t)(x64emu_t*, int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef int32_t (*iFEippLp_t)(x64emu_t*, int32_t, void*, void*, uintptr_t, void*); -typedef int32_t (*iFElpppp_t)(x64emu_t*, intptr_t, void*, void*, void*, void*); -typedef int32_t (*iFEpiipp_t)(x64emu_t*, void*, int32_t, int32_t, void*, void*); -typedef int32_t (*iFEpiipV_t)(x64emu_t*, void*, int32_t, int32_t, void*, void*); -typedef int32_t (*iFEpilpV_t)(x64emu_t*, void*, int32_t, intptr_t, void*, void*); -typedef int32_t (*iFEpippi_t)(x64emu_t*, void*, int32_t, void*, void*, int32_t); -typedef int32_t (*iFEpIppp_t)(x64emu_t*, void*, int64_t, void*, void*, void*); -typedef int32_t (*iFEpuppp_t)(x64emu_t*, void*, uint32_t, void*, void*, void*); -typedef int32_t (*iFEpUppp_t)(x64emu_t*, void*, uint64_t, void*, void*, void*); -typedef int32_t (*iFEppppi_t)(x64emu_t*, void*, void*, void*, void*, int32_t); -typedef int32_t (*iFEppppp_t)(x64emu_t*, void*, void*, void*, void*, void*); -typedef int32_t (*iFiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFiiiipp_t)(int32_t, int32_t, int32_t, int32_t, void*, void*); -typedef int32_t (*iFiiiuwp_t)(int32_t, int32_t, int32_t, uint32_t, int16_t, void*); -typedef int32_t (*iFiWiipi_t)(int32_t, uint16_t, int32_t, int32_t, void*, int32_t); -typedef int32_t (*iFiuUuUu_t)(int32_t, uint32_t, uint64_t, uint32_t, uint64_t, uint32_t); -typedef int32_t (*iFilpppp_t)(int32_t, intptr_t, void*, void*, void*, void*); -typedef int32_t (*iFiLpppi_t)(int32_t, uintptr_t, void*, void*, void*, int32_t); -typedef int32_t (*iFipiipi_t)(int32_t, void*, int32_t, int32_t, void*, int32_t); -typedef int32_t (*iFipipip_t)(int32_t, void*, int32_t, void*, int32_t, void*); -typedef int32_t (*iFipippp_t)(int32_t, void*, int32_t, void*, void*, void*); -typedef int32_t (*iFipuIup_t)(int32_t, void*, uint32_t, int64_t, uint32_t, void*); -typedef int32_t (*iFipupup_t)(int32_t, void*, uint32_t, void*, uint32_t, void*); -typedef int32_t (*iFipuppp_t)(int32_t, void*, uint32_t, void*, void*, void*); -typedef int32_t (*iFipppLp_t)(int32_t, void*, void*, void*, uintptr_t, void*); -typedef int32_t (*iFippppp_t)(int32_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFdipppL_t)(double, int32_t, void*, void*, void*, uintptr_t); -typedef int32_t (*iFDipppL_t)(long double, int32_t, void*, void*, void*, uintptr_t); -typedef int32_t (*iFlpippp_t)(intptr_t, void*, int32_t, void*, void*, void*); -typedef int32_t (*iFLpppii_t)(uintptr_t, void*, void*, void*, int32_t, int32_t); -typedef int32_t (*iFpiiiii_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iFpiiiiu_t)(void*, int32_t, int32_t, int32_t, int32_t, uint32_t); -typedef int32_t (*iFpiiiip_t)(void*, int32_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFpiiipp_t)(void*, int32_t, int32_t, int32_t, void*, void*); -typedef int32_t (*iFpiiuii_t)(void*, int32_t, int32_t, uint32_t, int32_t, int32_t); -typedef int32_t (*iFpiiuui_t)(void*, int32_t, int32_t, uint32_t, uint32_t, int32_t); -typedef int32_t (*iFpiiupp_t)(void*, int32_t, int32_t, uint32_t, void*, void*); -typedef int32_t (*iFpiipip_t)(void*, int32_t, int32_t, void*, int32_t, void*); -typedef int32_t (*iFpiippp_t)(void*, int32_t, int32_t, void*, void*, void*); -typedef int32_t (*iFpiCCpu_t)(void*, int32_t, uint8_t, uint8_t, void*, uint32_t); -typedef int32_t (*iFpiuuup_t)(void*, int32_t, uint32_t, uint32_t, uint32_t, void*); -typedef int32_t (*iFpiuupp_t)(void*, int32_t, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFpipiii_t)(void*, int32_t, void*, int32_t, int32_t, int32_t); -typedef int32_t (*iFpipipi_t)(void*, int32_t, void*, int32_t, void*, int32_t); -typedef int32_t (*iFpipipp_t)(void*, int32_t, void*, int32_t, void*, void*); -typedef int32_t (*iFpipupp_t)(void*, int32_t, void*, uint32_t, void*, void*); -typedef int32_t (*iFpipLpp_t)(void*, int32_t, void*, uintptr_t, void*, void*); -typedef int32_t (*iFpippip_t)(void*, int32_t, void*, void*, int32_t, void*); -typedef int32_t (*iFpippup_t)(void*, int32_t, void*, void*, uint32_t, void*); -typedef int32_t (*iFpipppp_t)(void*, int32_t, void*, void*, void*, void*); -typedef int32_t (*iFpCiipp_t)(void*, uint8_t, int32_t, int32_t, void*, void*); -typedef int32_t (*iFpCpipu_t)(void*, uint8_t, void*, int32_t, void*, uint32_t); -typedef int32_t (*iFpWipip_t)(void*, uint16_t, int32_t, void*, int32_t, void*); -typedef int32_t (*iFpWpppp_t)(void*, uint16_t, void*, void*, void*, void*); -typedef int32_t (*iFpuiCpp_t)(void*, uint32_t, int32_t, uint8_t, void*, void*); -typedef int32_t (*iFpuippp_t)(void*, uint32_t, int32_t, void*, void*, void*); -typedef int32_t (*iFpuuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef int32_t (*iFpuuuup_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, void*); -typedef int32_t (*iFpuuupu_t)(void*, uint32_t, uint32_t, uint32_t, void*, uint32_t); -typedef int32_t (*iFpuuupp_t)(void*, uint32_t, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFpuuLpp_t)(void*, uint32_t, uint32_t, uintptr_t, void*, void*); -typedef int32_t (*iFpuupuu_t)(void*, uint32_t, uint32_t, void*, uint32_t, uint32_t); -typedef int32_t (*iFpuuppp_t)(void*, uint32_t, uint32_t, void*, void*, void*); -typedef int32_t (*iFpuLLpp_t)(void*, uint32_t, uintptr_t, uintptr_t, void*, void*); -typedef int32_t (*iFpupuui_t)(void*, uint32_t, void*, uint32_t, uint32_t, int32_t); -typedef int32_t (*iFpupLpL_t)(void*, uint32_t, void*, uintptr_t, void*, uintptr_t); -typedef int32_t (*iFpupLpp_t)(void*, uint32_t, void*, uintptr_t, void*, void*); -typedef int32_t (*iFpUiipp_t)(void*, uint64_t, int32_t, int32_t, void*, void*); -typedef int32_t (*iFpUuuLp_t)(void*, uint64_t, uint32_t, uint32_t, uintptr_t, void*); -typedef int32_t (*iFpUUUup_t)(void*, uint64_t, uint64_t, uint64_t, uint32_t, void*); -typedef int32_t (*iFpUUUUp_t)(void*, uint64_t, uint64_t, uint64_t, uint64_t, void*); -typedef int32_t (*iFpdpipp_t)(void*, double, void*, int32_t, void*, void*); -typedef int32_t (*iFpLiiiL_t)(void*, uintptr_t, int32_t, int32_t, int32_t, uintptr_t); -typedef int32_t (*iFpLiiip_t)(void*, uintptr_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFpLiiuu_t)(void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t); -typedef int32_t (*iFpLipLu_t)(void*, uintptr_t, int32_t, void*, uintptr_t, uint32_t); -typedef int32_t (*iFpLuipp_t)(void*, uintptr_t, uint32_t, int32_t, void*, void*); -typedef int32_t (*iFpLuupp_t)(void*, uintptr_t, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFpLupip_t)(void*, uintptr_t, uint32_t, void*, int32_t, void*); -typedef int32_t (*iFpLLLLL_t)(void*, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef int32_t (*iFpLLppp_t)(void*, uintptr_t, uintptr_t, void*, void*, void*); -typedef int32_t (*iFpLpipi_t)(void*, uintptr_t, void*, int32_t, void*, int32_t); -typedef int32_t (*iFpLppii_t)(void*, uintptr_t, void*, void*, int32_t, int32_t); -typedef int32_t (*iFpLpppL_t)(void*, uintptr_t, void*, void*, void*, uintptr_t); -typedef int32_t (*iFpLpppp_t)(void*, uintptr_t, void*, void*, void*, void*); -typedef int32_t (*iFppiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iFppiiip_t)(void*, void*, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFppiipi_t)(void*, void*, int32_t, int32_t, void*, int32_t); -typedef int32_t (*iFppiipp_t)(void*, void*, int32_t, int32_t, void*, void*); -typedef int32_t (*iFppiupp_t)(void*, void*, int32_t, uint32_t, void*, void*); -typedef int32_t (*iFppilpp_t)(void*, void*, int32_t, intptr_t, void*, void*); -typedef int32_t (*iFppipii_t)(void*, void*, int32_t, void*, int32_t, int32_t); -typedef int32_t (*iFppipiL_t)(void*, void*, int32_t, void*, int32_t, uintptr_t); -typedef int32_t (*iFppipip_t)(void*, void*, int32_t, void*, int32_t, void*); -typedef int32_t (*iFppippi_t)(void*, void*, int32_t, void*, void*, int32_t); -typedef int32_t (*iFppippu_t)(void*, void*, int32_t, void*, void*, uint32_t); -typedef int32_t (*iFppippp_t)(void*, void*, int32_t, void*, void*, void*); -typedef int32_t (*iFppIppp_t)(void*, void*, int64_t, void*, void*, void*); -typedef int32_t (*iFppuiii_t)(void*, void*, uint32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iFppuIII_t)(void*, void*, uint32_t, int64_t, int64_t, int64_t); -typedef int32_t (*iFppuupp_t)(void*, void*, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFppuLpp_t)(void*, void*, uint32_t, uintptr_t, void*, void*); -typedef int32_t (*iFppupip_t)(void*, void*, uint32_t, void*, int32_t, void*); -typedef int32_t (*iFppuppp_t)(void*, void*, uint32_t, void*, void*, void*); -typedef int32_t (*iFppdidd_t)(void*, void*, double, int32_t, double, double); -typedef int32_t (*iFpplupp_t)(void*, void*, intptr_t, uint32_t, void*, void*); -typedef int32_t (*iFpplppi_t)(void*, void*, intptr_t, void*, void*, int32_t); -typedef int32_t (*iFppLupp_t)(void*, void*, uintptr_t, uint32_t, void*, void*); -typedef int32_t (*iFppLLiL_t)(void*, void*, uintptr_t, uintptr_t, int32_t, uintptr_t); -typedef int32_t (*iFppLLup_t)(void*, void*, uintptr_t, uintptr_t, uint32_t, void*); -typedef int32_t (*iFppLLpp_t)(void*, void*, uintptr_t, uintptr_t, void*, void*); -typedef int32_t (*iFppLpLp_t)(void*, void*, uintptr_t, void*, uintptr_t, void*); -typedef int32_t (*iFppLppp_t)(void*, void*, uintptr_t, void*, void*, void*); -typedef int32_t (*iFpppiuu_t)(void*, void*, void*, int32_t, uint32_t, uint32_t); -typedef int32_t (*iFpppipi_t)(void*, void*, void*, int32_t, void*, int32_t); -typedef int32_t (*iFpppipu_t)(void*, void*, void*, int32_t, void*, uint32_t); -typedef int32_t (*iFpppipp_t)(void*, void*, void*, int32_t, void*, void*); -typedef int32_t (*iFpppuii_t)(void*, void*, void*, uint32_t, int32_t, int32_t); -typedef int32_t (*iFpppuup_t)(void*, void*, void*, uint32_t, uint32_t, void*); -typedef int32_t (*iFpppupu_t)(void*, void*, void*, uint32_t, void*, uint32_t); -typedef int32_t (*iFpppupp_t)(void*, void*, void*, uint32_t, void*, void*); -typedef int32_t (*iFpppLpp_t)(void*, void*, void*, uintptr_t, void*, void*); -typedef int32_t (*iFppppii_t)(void*, void*, void*, void*, int32_t, int32_t); -typedef int32_t (*iFppppiu_t)(void*, void*, void*, void*, int32_t, uint32_t); -typedef int32_t (*iFppppip_t)(void*, void*, void*, void*, int32_t, void*); -typedef int32_t (*iFppppup_t)(void*, void*, void*, void*, uint32_t, void*); -typedef int32_t (*iFppppLp_t)(void*, void*, void*, void*, uintptr_t, void*); -typedef int32_t (*iFpppppi_t)(void*, void*, void*, void*, void*, int32_t); -typedef int32_t (*iFpppppL_t)(void*, void*, void*, void*, void*, uintptr_t); -typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFEiippp_t)(x64emu_t*, int32_t, int32_t, void*, void*, void*); -typedef uint32_t (*uFEiuppp_t)(x64emu_t*, int32_t, uint32_t, void*, void*, void*); -typedef uint32_t (*uFEpippp_t)(x64emu_t*, void*, int32_t, void*, void*, void*); -typedef uint32_t (*uFEpCppp_t)(x64emu_t*, void*, uint8_t, void*, void*, void*); -typedef uint32_t (*uFEpuppp_t)(x64emu_t*, void*, uint32_t, void*, void*, void*); -typedef uint32_t (*uFuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef uint32_t (*uFupuufp_t)(uint32_t, void*, uint32_t, uint32_t, float, void*); -typedef uint32_t (*uFuppppp_t)(uint32_t, void*, void*, void*, void*, void*); -typedef uint32_t (*uFpiuppu_t)(void*, int32_t, uint32_t, void*, void*, uint32_t); -typedef uint32_t (*uFpWuipp_t)(void*, uint16_t, uint32_t, int32_t, void*, void*); -typedef uint32_t (*uFpWuuCp_t)(void*, uint16_t, uint32_t, uint32_t, uint8_t, void*); -typedef uint32_t (*uFpuippp_t)(void*, uint32_t, int32_t, void*, void*, void*); -typedef uint32_t (*uFpuuuup_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, void*); -typedef uint32_t (*uFpuuupp_t)(void*, uint32_t, uint32_t, uint32_t, void*, void*); -typedef uint32_t (*uFpuuppp_t)(void*, uint32_t, uint32_t, void*, void*, void*); -typedef uint32_t (*uFpupupu_t)(void*, uint32_t, void*, uint32_t, void*, uint32_t); -typedef uint32_t (*uFpupppp_t)(void*, uint32_t, void*, void*, void*, void*); -typedef uint32_t (*uFppippp_t)(void*, void*, int32_t, void*, void*, void*); -typedef uint32_t (*uFppuuup_t)(void*, void*, uint32_t, uint32_t, uint32_t, void*); -typedef uint32_t (*uFppuupu_t)(void*, void*, uint32_t, uint32_t, void*, uint32_t); -typedef uint32_t (*uFppLppL_t)(void*, void*, uintptr_t, void*, void*, uintptr_t); -typedef uint32_t (*uFpppppi_t)(void*, void*, void*, void*, void*, int32_t); -typedef uint32_t (*uFpppppp_t)(void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFbippup_t)(void*, int32_t, void*, void*, uint32_t, void*); -typedef uint32_t (*uFbCuuWW_t)(void*, uint8_t, uint32_t, uint32_t, uint16_t, uint16_t); -typedef uint32_t (*uFbuuiup_t)(void*, uint32_t, uint32_t, int32_t, uint32_t, void*); -typedef uint64_t (*UFbippup_t)(void*, int32_t, void*, void*, uint32_t, void*); -typedef intptr_t (*lFEpippp_t)(x64emu_t*, void*, int32_t, void*, void*, void*); -typedef intptr_t (*lFipipLu_t)(int32_t, void*, int32_t, void*, uintptr_t, uint32_t); -typedef intptr_t (*lFipLipu_t)(int32_t, void*, uintptr_t, int32_t, void*, uint32_t); -typedef intptr_t (*lFipLipp_t)(int32_t, void*, uintptr_t, int32_t, void*, void*); -typedef intptr_t (*lFipLpLL_t)(int32_t, void*, uintptr_t, void*, uintptr_t, uintptr_t); -typedef intptr_t (*lFpipill_t)(void*, int32_t, void*, int32_t, intptr_t, intptr_t); -typedef intptr_t (*lFpuuLLp_t)(void*, uint32_t, uint32_t, uintptr_t, uintptr_t, void*); -typedef intptr_t (*lFpplllp_t)(void*, void*, intptr_t, intptr_t, intptr_t, void*); -typedef intptr_t (*lFppLipp_t)(void*, void*, uintptr_t, int32_t, void*, void*); -typedef intptr_t (*lFpppLpp_t)(void*, void*, void*, uintptr_t, void*, void*); -typedef uintptr_t (*LFEupppp_t)(x64emu_t*, uint32_t, void*, void*, void*, void*); -typedef uintptr_t (*LFELpppi_t)(x64emu_t*, uintptr_t, void*, void*, void*, int32_t); -typedef uintptr_t (*LFEpippp_t)(x64emu_t*, void*, int32_t, void*, void*, void*); -typedef uintptr_t (*LFEppppi_t)(x64emu_t*, void*, void*, void*, void*, int32_t); -typedef uintptr_t (*LFpipipi_t)(void*, int32_t, void*, int32_t, void*, int32_t); -typedef uintptr_t (*LFpLippp_t)(void*, uintptr_t, int32_t, void*, void*, void*); -typedef uintptr_t (*LFpLLLLL_t)(void*, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef uintptr_t (*LFppLLpL_t)(void*, void*, uintptr_t, uintptr_t, void*, uintptr_t); -typedef uintptr_t (*LFppLpLL_t)(void*, void*, uintptr_t, void*, uintptr_t, uintptr_t); -typedef uintptr_t (*LFSpLiip_t)(void*, void*, uintptr_t, int32_t, int32_t, void*); -typedef void* (*pFEpiupp_t)(x64emu_t*, void*, int32_t, uint32_t, void*, void*); -typedef void* (*pFEpippp_t)(x64emu_t*, void*, int32_t, void*, void*, void*); -typedef void* (*pFEpuipp_t)(x64emu_t*, void*, uint32_t, int32_t, void*, void*); -typedef void* (*pFEpuupp_t)(x64emu_t*, void*, uint32_t, uint32_t, void*, void*); -typedef void* (*pFEpuppp_t)(x64emu_t*, void*, uint32_t, void*, void*, void*); -typedef void* (*pFEpLLiN_t)(x64emu_t*, void*, uintptr_t, uintptr_t, int32_t, ...); -typedef void* (*pFEppupi_t)(x64emu_t*, void*, void*, uint32_t, void*, int32_t); -typedef void* (*pFEppLLp_t)(x64emu_t*, void*, void*, uintptr_t, uintptr_t, void*); -typedef void* (*pFEpppLp_t)(x64emu_t*, void*, void*, void*, uintptr_t, void*); -typedef void* (*pFEppppi_t)(x64emu_t*, void*, void*, void*, void*, int32_t); -typedef void* (*pFEppppp_t)(x64emu_t*, void*, void*, void*, void*, void*); -typedef void* (*pFEppppV_t)(x64emu_t*, void*, void*, void*, void*, void*); -typedef void* (*pFEppApp_t)(x64emu_t*, void*, void*, void*, void*, void*); -typedef void* (*pFiiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void* (*pFiiiiid_t)(int32_t, int32_t, int32_t, int32_t, int32_t, double); -typedef void* (*pFipippp_t)(int32_t, void*, int32_t, void*, void*, void*); -typedef void* (*pFWCiWCi_t)(uint16_t, uint8_t, int32_t, uint16_t, uint8_t, int32_t); -typedef void* (*pFuCCCCp_t)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t, void*); -typedef void* (*pFuuipip_t)(uint32_t, uint32_t, int32_t, void*, int32_t, void*); -typedef void* (*pFuuuiip_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, void*); -typedef void* (*pFuuuuii_t)(uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t); -typedef void* (*pFuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void* (*pFuuuuup_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, void*); -typedef void* (*pFuuppuu_t)(uint32_t, uint32_t, void*, void*, uint32_t, uint32_t); -typedef void* (*pFuppppp_t)(uint32_t, void*, void*, void*, void*, void*); -typedef void* (*pFdddddd_t)(double, double, double, double, double, double); -typedef void* (*pFpiiiiu_t)(void*, int32_t, int32_t, int32_t, int32_t, uint32_t); -typedef void* (*pFpiiipp_t)(void*, int32_t, int32_t, int32_t, void*, void*); -typedef void* (*pFpiiCCC_t)(void*, int32_t, int32_t, uint8_t, uint8_t, uint8_t); -typedef void* (*pFpiiuup_t)(void*, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void* (*pFpiUUUU_t)(void*, int32_t, uint64_t, uint64_t, uint64_t, uint64_t); -typedef void* (*pFpipipp_t)(void*, int32_t, void*, int32_t, void*, void*); -typedef void* (*pFpippip_t)(void*, int32_t, void*, void*, int32_t, void*); -typedef void* (*pFpipppp_t)(void*, int32_t, void*, void*, void*, void*); -typedef void* (*pFpuiiip_t)(void*, uint32_t, int32_t, int32_t, int32_t, void*); -typedef void* (*pFpuuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void* (*pFpuuupu_t)(void*, uint32_t, uint32_t, uint32_t, void*, uint32_t); -typedef void* (*pFpupuui_t)(void*, uint32_t, void*, uint32_t, uint32_t, int32_t); -typedef void* (*pFpuppip_t)(void*, uint32_t, void*, void*, int32_t, void*); -typedef void* (*pFpupppp_t)(void*, uint32_t, void*, void*, void*, void*); -typedef void* (*pFplpppp_t)(void*, intptr_t, void*, void*, void*, void*); -typedef void* (*pFpLuLpp_t)(void*, uintptr_t, uint32_t, uintptr_t, void*, void*); -typedef void* (*pFpLpLLi_t)(void*, uintptr_t, void*, uintptr_t, uintptr_t, int32_t); -typedef void* (*pFpLppii_t)(void*, uintptr_t, void*, void*, int32_t, int32_t); -typedef void* (*pFpLppip_t)(void*, uintptr_t, void*, void*, int32_t, void*); -typedef void* (*pFpLppup_t)(void*, uintptr_t, void*, void*, uint32_t, void*); -typedef void* (*pFppiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t); -typedef void* (*pFppiipp_t)(void*, void*, int32_t, int32_t, void*, void*); -typedef void* (*pFppiCCC_t)(void*, void*, int32_t, uint8_t, uint8_t, uint8_t); -typedef void* (*pFppiupp_t)(void*, void*, int32_t, uint32_t, void*, void*); -typedef void* (*pFppilpp_t)(void*, void*, int32_t, intptr_t, void*, void*); -typedef void* (*pFppipip_t)(void*, void*, int32_t, void*, int32_t, void*); -typedef void* (*pFppippi_t)(void*, void*, int32_t, void*, void*, int32_t); -typedef void* (*pFppippp_t)(void*, void*, int32_t, void*, void*, void*); -typedef void* (*pFppuupp_t)(void*, void*, uint32_t, uint32_t, void*, void*); -typedef void* (*pFppuppp_t)(void*, void*, uint32_t, void*, void*, void*); -typedef void* (*pFpplplp_t)(void*, void*, intptr_t, void*, intptr_t, void*); -typedef void* (*pFpplppp_t)(void*, void*, intptr_t, void*, void*, void*); -typedef void* (*pFpppupp_t)(void*, void*, void*, uint32_t, void*, void*); -typedef void* (*pFpppLii_t)(void*, void*, void*, uintptr_t, int32_t, int32_t); -typedef void* (*pFpppLui_t)(void*, void*, void*, uintptr_t, uint32_t, int32_t); -typedef void* (*pFppppii_t)(void*, void*, void*, void*, int32_t, int32_t); -typedef void* (*pFpppppi_t)(void*, void*, void*, void*, void*, int32_t); -typedef void* (*pFpppppu_t)(void*, void*, void*, void*, void*, uint32_t); -typedef void* (*pFpppppp_t)(void*, void*, void*, void*, void*, void*); -typedef void* (*pFSpiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t); -typedef void* (*pFbCuuCC_t)(void*, uint8_t, uint32_t, uint32_t, uint8_t, uint8_t); -typedef void* (*pFbCuuup_t)(void*, uint8_t, uint32_t, uint32_t, uint32_t, void*); -typedef void* (*pFbuuwwu_t)(void*, uint32_t, uint32_t, int16_t, int16_t, uint32_t); -typedef void* (*pFbuuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void* (*pFbuuUUU_t)(void*, uint32_t, uint32_t, uint64_t, uint64_t, uint64_t); -typedef void* (*pFbpupii_t)(void*, void*, uint32_t, void*, int32_t, int32_t); -typedef int32_t (*iWEpuuip_t)(x64emu_t*, void*, uint32_t, uint32_t, int32_t, void*); -typedef int32_t (*iWEppppp_t)(x64emu_t*, void*, void*, void*, void*, void*); -typedef int32_t (*iWpiiiip_t)(void*, int32_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iWpiiuii_t)(void*, int32_t, int32_t, uint32_t, int32_t, int32_t); -typedef int32_t (*iWpiuppu_t)(void*, int32_t, uint32_t, void*, void*, uint32_t); -typedef int32_t (*iWpuiiii_t)(void*, uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iWpppppi_t)(void*, void*, void*, void*, void*, int32_t); -typedef int32_t (*iWpppppu_t)(void*, void*, void*, void*, void*, uint32_t); -typedef void (*vFEpiiipp_t)(x64emu_t*, void*, int32_t, int32_t, int32_t, void*, void*); -typedef void (*vFEpipppp_t)(x64emu_t*, void*, int32_t, void*, void*, void*, void*); -typedef void (*vFEpuipuV_t)(x64emu_t*, void*, uint32_t, int32_t, void*, uint32_t, void*); -typedef void (*vFEppippp_t)(x64emu_t*, void*, void*, int32_t, void*, void*, void*); -typedef void (*vFEpppppp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*); -typedef void (*vFiiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFiiiiuup_t)(int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFiiuilil_t)(int32_t, int32_t, uint32_t, int32_t, intptr_t, int32_t, intptr_t); -typedef void (*vFiiffffp_t)(int32_t, int32_t, float, float, float, float, void*); -typedef void (*vFiuulipi_t)(int32_t, uint32_t, uint32_t, intptr_t, int32_t, void*, int32_t); -typedef void (*vFiupuuup_t)(int32_t, uint32_t, void*, uint32_t, uint32_t, uint32_t, void*); -typedef void (*vFilipliu_t)(int32_t, intptr_t, int32_t, void*, intptr_t, int32_t, uint32_t); -typedef void (*vFilulipi_t)(int32_t, intptr_t, uint32_t, intptr_t, int32_t, void*, int32_t); -typedef void (*vFCCCCfff_t)(uint8_t, uint8_t, uint8_t, uint8_t, float, float, float); -typedef void (*vFuiiiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuiiiiiC_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint8_t); -typedef void (*vFuiiiuip_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, void*); -typedef void (*vFuiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuiuiiii_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuiuiiiC_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, uint8_t); -typedef void (*vFuiuiiip_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFuiuiiuL_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, uint32_t, uintptr_t); -typedef void (*vFuiuCiuu_t)(uint32_t, int32_t, uint32_t, uint8_t, int32_t, uint32_t, uint32_t); -typedef void (*vFuiupiiu_t)(uint32_t, int32_t, uint32_t, void*, int32_t, int32_t, uint32_t); -typedef void (*vFuiupuip_t)(uint32_t, int32_t, uint32_t, void*, uint32_t, int32_t, void*); -typedef void (*vFuipiiii_t)(uint32_t, int32_t, void*, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuipffff_t)(uint32_t, int32_t, void*, float, float, float, float); -typedef void (*vFuipdddd_t)(uint32_t, int32_t, void*, double, double, double, double); -typedef void (*vFuuiiiii_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuuiiiiC_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint8_t); -typedef void (*vFuuiiiiu_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t); -typedef void (*vFuuiiiip_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFuuiiuup_t)(uint32_t, uint32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuuiCiui_t)(uint32_t, uint32_t, int32_t, uint8_t, int32_t, uint32_t, int32_t); -typedef void (*vFuuiCiuu_t)(uint32_t, uint32_t, int32_t, uint8_t, int32_t, uint32_t, uint32_t); -typedef void (*vFuuiuiii_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t); -typedef void (*vFuuiuiiC_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, uint8_t); -typedef void (*vFuuipppp_t)(uint32_t, uint32_t, int32_t, void*, void*, void*, void*); -typedef void (*vFuuuiiii_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuuuiiCp_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, uint8_t, void*); -typedef void (*vFuuuiuii_t)(uint32_t, uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t); -typedef void (*vFuuuiuil_t)(uint32_t, uint32_t, uint32_t, int32_t, uint32_t, int32_t, intptr_t); -typedef void (*vFuuuiupi_t)(uint32_t, uint32_t, uint32_t, int32_t, uint32_t, void*, int32_t); -typedef void (*vFuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFuuuulll_t)(uint32_t, uint32_t, uint32_t, uint32_t, intptr_t, intptr_t, intptr_t); -typedef void (*vFuuuffff_t)(uint32_t, uint32_t, uint32_t, float, float, float, float); -typedef void (*vFuuudddd_t)(uint32_t, uint32_t, uint32_t, double, double, double, double); -typedef void (*vFuuffiip_t)(uint32_t, uint32_t, float, float, int32_t, int32_t, void*); -typedef void (*vFuuddiip_t)(uint32_t, uint32_t, double, double, int32_t, int32_t, void*); -typedef void (*vFuulluup_t)(uint32_t, uint32_t, intptr_t, intptr_t, uint32_t, uint32_t, void*); -typedef void (*vFuupiiii_t)(uint32_t, uint32_t, void*, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuuppppu_t)(uint32_t, uint32_t, void*, void*, void*, void*, uint32_t); -typedef void (*vFuuppppp_t)(uint32_t, uint32_t, void*, void*, void*, void*, void*); -typedef void (*vFuffffff_t)(uint32_t, float, float, float, float, float, float); -typedef void (*vFudddddd_t)(uint32_t, double, double, double, double, double, double); -typedef void (*vFlipuiip_t)(intptr_t, int32_t, void*, uint32_t, int32_t, int32_t, void*); -typedef void (*vFlliiiip_t)(intptr_t, intptr_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFpiiiipp_t)(void*, int32_t, int32_t, int32_t, int32_t, void*, void*); -typedef void (*vFpiiliip_t)(void*, int32_t, int32_t, intptr_t, int32_t, int32_t, void*); -typedef void (*vFpiiLiip_t)(void*, int32_t, int32_t, uintptr_t, int32_t, int32_t, void*); -typedef void (*vFpiipCpp_t)(void*, int32_t, int32_t, void*, uint8_t, void*, void*); -typedef void (*vFpiipppp_t)(void*, int32_t, int32_t, void*, void*, void*, void*); -typedef void (*vFpipipii_t)(void*, int32_t, void*, int32_t, void*, int32_t, int32_t); -typedef void (*vFpippppu_t)(void*, int32_t, void*, void*, void*, void*, uint32_t); -typedef void (*vFpuuuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFpuuUUuu_t)(void*, uint32_t, uint32_t, uint64_t, uint64_t, uint32_t, uint32_t); -typedef void (*vFpuupupu_t)(void*, uint32_t, uint32_t, void*, uint32_t, void*, uint32_t); -typedef void (*vFpuupppp_t)(void*, uint32_t, uint32_t, void*, void*, void*, void*); -typedef void (*vFpupuuup_t)(void*, uint32_t, void*, uint32_t, uint32_t, uint32_t, void*); -typedef void (*vFpupppui_t)(void*, uint32_t, void*, void*, void*, uint32_t, int32_t); -typedef void (*vFpUiUiup_t)(void*, uint64_t, int32_t, uint64_t, int32_t, uint32_t, void*); -typedef void (*vFpUuuUip_t)(void*, uint64_t, uint32_t, uint32_t, uint64_t, int32_t, void*); -typedef void (*vFpUUUUuu_t)(void*, uint64_t, uint64_t, uint64_t, uint64_t, uint32_t, uint32_t); -typedef void (*vFpddiidd_t)(void*, double, double, int32_t, int32_t, double, double); -typedef void (*vFpdddddd_t)(void*, double, double, double, double, double, double); -typedef void (*vFpLiLiLp_t)(void*, uintptr_t, int32_t, uintptr_t, int32_t, uintptr_t, void*); -typedef void (*vFpLpiipi_t)(void*, uintptr_t, void*, int32_t, int32_t, void*, int32_t); -typedef void (*vFppiiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppiiiip_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFppiiipi_t)(void*, void*, int32_t, int32_t, int32_t, void*, int32_t); -typedef void (*vFppiipii_t)(void*, void*, int32_t, int32_t, void*, int32_t, int32_t); -typedef void (*vFppiipuu_t)(void*, void*, int32_t, int32_t, void*, uint32_t, uint32_t); -typedef void (*vFppiippp_t)(void*, void*, int32_t, int32_t, void*, void*, void*); -typedef void (*vFppilppi_t)(void*, void*, int32_t, intptr_t, void*, void*, int32_t); -typedef void (*vFppiLiLp_t)(void*, void*, int32_t, uintptr_t, int32_t, uintptr_t, void*); -typedef void (*vFppipiip_t)(void*, void*, int32_t, void*, int32_t, int32_t, void*); -typedef void (*vFppipipp_t)(void*, void*, int32_t, void*, int32_t, void*, void*); -typedef void (*vFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*); -typedef void (*vFppCuupp_t)(void*, void*, uint8_t, uint32_t, uint32_t, void*, void*); -typedef void (*vFppuiiip_t)(void*, void*, uint32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFppuupii_t)(void*, void*, uint32_t, uint32_t, void*, int32_t, int32_t); -typedef void (*vFppUuupp_t)(void*, void*, uint64_t, uint32_t, uint32_t, void*, void*); -typedef void (*vFppddddu_t)(void*, void*, double, double, double, double, uint32_t); -typedef void (*vFppddpiu_t)(void*, void*, double, double, void*, int32_t, uint32_t); -typedef void (*vFpplpppi_t)(void*, void*, intptr_t, void*, void*, void*, int32_t); -typedef void (*vFppLpppi_t)(void*, void*, uintptr_t, void*, void*, void*, int32_t); -typedef void (*vFppLpppp_t)(void*, void*, uintptr_t, void*, void*, void*, void*); -typedef void (*vFpppiiii_t)(void*, void*, void*, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFpppiipi_t)(void*, void*, void*, int32_t, int32_t, void*, int32_t); -typedef void (*vFpppiipp_t)(void*, void*, void*, int32_t, int32_t, void*, void*); -typedef void (*vFpppiupi_t)(void*, void*, void*, int32_t, uint32_t, void*, int32_t); -typedef void (*vFpppippi_t)(void*, void*, void*, int32_t, void*, void*, int32_t); -typedef void (*vFpppuuuu_t)(void*, void*, void*, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFpppffff_t)(void*, void*, void*, float, float, float, float); -typedef void (*vFppppiip_t)(void*, void*, void*, void*, int32_t, int32_t, void*); -typedef void (*vFppppiui_t)(void*, void*, void*, void*, int32_t, uint32_t, int32_t); -typedef void (*vFppppipi_t)(void*, void*, void*, void*, int32_t, void*, int32_t); -typedef void (*vFpppppip_t)(void*, void*, void*, void*, void*, int32_t, void*); -typedef void (*vFppppppu_t)(void*, void*, void*, void*, void*, void*, uint32_t); -typedef void (*vFppppppp_t)(void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFEpupppp_t)(x64emu_t*, void*, uint32_t, void*, void*, void*, void*); -typedef int32_t (*iFEpUuppp_t)(x64emu_t*, void*, uint64_t, uint32_t, void*, void*, void*); -typedef int32_t (*iFEpLiLpp_t)(x64emu_t*, void*, uintptr_t, int32_t, uintptr_t, void*, void*); -typedef int32_t (*iFEpLiLpV_t)(x64emu_t*, void*, uintptr_t, int32_t, uintptr_t, void*, void*); -typedef int32_t (*iFEppuppp_t)(x64emu_t*, void*, void*, uint32_t, void*, void*, void*); -typedef int32_t (*iFEppLpIi_t)(x64emu_t*, void*, void*, uintptr_t, void*, int64_t, int32_t); -typedef int32_t (*iFEpppiiu_t)(x64emu_t*, void*, void*, void*, int32_t, int32_t, uint32_t); -typedef int32_t (*iFEpppppL_t)(x64emu_t*, void*, void*, void*, void*, void*, uintptr_t); -typedef int32_t (*iFEpppppp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFiiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFipupupi_t)(int32_t, void*, uint32_t, void*, uint32_t, void*, int32_t); -typedef int32_t (*iFippuIup_t)(int32_t, void*, void*, uint32_t, int64_t, uint32_t, void*); -typedef int32_t (*iFipppppp_t)(int32_t, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpiiiiii_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iFpiiiuwp_t)(void*, int32_t, int32_t, int32_t, uint32_t, int16_t, void*); -typedef int32_t (*iFpiiiuup_t)(void*, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef int32_t (*iFpiiuuiu_t)(void*, int32_t, int32_t, uint32_t, uint32_t, int32_t, uint32_t); -typedef int32_t (*iFpiipppp_t)(void*, int32_t, int32_t, void*, void*, void*, void*); -typedef int32_t (*iFpiuiipp_t)(void*, int32_t, uint32_t, int32_t, int32_t, void*, void*); -typedef int32_t (*iFpiuLiii_t)(void*, int32_t, uint32_t, uintptr_t, int32_t, int32_t, int32_t); -typedef int32_t (*iFpiupppp_t)(void*, int32_t, uint32_t, void*, void*, void*, void*); -typedef int32_t (*iFpiLuupp_t)(void*, int32_t, uintptr_t, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFpiLuppp_t)(void*, int32_t, uintptr_t, uint32_t, void*, void*, void*); -typedef int32_t (*iFpipiiip_t)(void*, int32_t, void*, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFpipipip_t)(void*, int32_t, void*, int32_t, void*, int32_t, void*); -typedef int32_t (*iFpipippp_t)(void*, int32_t, void*, int32_t, void*, void*, void*); -typedef int32_t (*iFpippLpp_t)(void*, int32_t, void*, void*, uintptr_t, void*, void*); -typedef int32_t (*iFpippppW_t)(void*, int32_t, void*, void*, void*, void*, uint16_t); -typedef int32_t (*iFpippppp_t)(void*, int32_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFpIIpppp_t)(void*, int64_t, int64_t, void*, void*, void*, void*); -typedef int32_t (*iFpWCiWCi_t)(void*, uint16_t, uint8_t, int32_t, uint16_t, uint8_t, int32_t); -typedef int32_t (*iFpWppppW_t)(void*, uint16_t, void*, void*, void*, void*, uint16_t); -typedef int32_t (*iFpWppppp_t)(void*, uint16_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFpuiCuCp_t)(void*, uint32_t, int32_t, uint8_t, uint32_t, uint8_t, void*); -typedef int32_t (*iFpuiuupp_t)(void*, uint32_t, int32_t, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFpupiLpL_t)(void*, uint32_t, void*, int32_t, uintptr_t, void*, uintptr_t); -typedef int32_t (*iFpupuuui_t)(void*, uint32_t, void*, uint32_t, uint32_t, uint32_t, int32_t); -typedef int32_t (*iFpupuupp_t)(void*, uint32_t, void*, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFpupupui_t)(void*, uint32_t, void*, uint32_t, void*, uint32_t, int32_t); -typedef int32_t (*iFpuppppp_t)(void*, uint32_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFpllpppp_t)(void*, intptr_t, intptr_t, void*, void*, void*, void*); -typedef int32_t (*iFpLiiiiL_t)(void*, uintptr_t, int32_t, int32_t, int32_t, int32_t, uintptr_t); -typedef int32_t (*iFpLiiuui_t)(void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, int32_t); -typedef int32_t (*iFpLipipi_t)(void*, uintptr_t, int32_t, void*, int32_t, void*, int32_t); -typedef int32_t (*iFpLipupu_t)(void*, uintptr_t, int32_t, void*, uint32_t, void*, uint32_t); -typedef int32_t (*iFpLpiiii_t)(void*, uintptr_t, void*, int32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iFpLpiiuu_t)(void*, uintptr_t, void*, int32_t, int32_t, uint32_t, uint32_t); -typedef int32_t (*iFpLpiipi_t)(void*, uintptr_t, void*, int32_t, int32_t, void*, int32_t); -typedef int32_t (*iFpLppiii_t)(void*, uintptr_t, void*, void*, int32_t, int32_t, int32_t); -typedef int32_t (*iFppiiiip_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFppiiuup_t)(void*, void*, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef int32_t (*iFppiiLll_t)(void*, void*, int32_t, int32_t, uintptr_t, intptr_t, intptr_t); -typedef int32_t (*iFppiipii_t)(void*, void*, int32_t, int32_t, void*, int32_t, int32_t); -typedef int32_t (*iFppiipiL_t)(void*, void*, int32_t, int32_t, void*, int32_t, uintptr_t); -typedef int32_t (*iFppipiii_t)(void*, void*, int32_t, void*, int32_t, int32_t, int32_t); -typedef int32_t (*iFppipiip_t)(void*, void*, int32_t, void*, int32_t, int32_t, void*); -typedef int32_t (*iFppipipp_t)(void*, void*, int32_t, void*, int32_t, void*, void*); -typedef int32_t (*iFppippip_t)(void*, void*, int32_t, void*, void*, int32_t, void*); -typedef int32_t (*iFppipppi_t)(void*, void*, int32_t, void*, void*, void*, int32_t); -typedef int32_t (*iFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*); -typedef int32_t (*iFppuipiL_t)(void*, void*, uint32_t, int32_t, void*, int32_t, uintptr_t); -typedef int32_t (*iFppuippp_t)(void*, void*, uint32_t, int32_t, void*, void*, void*); -typedef int32_t (*iFppuuppp_t)(void*, void*, uint32_t, uint32_t, void*, void*, void*); -typedef int32_t (*iFppupupp_t)(void*, void*, uint32_t, void*, uint32_t, void*, void*); -typedef int32_t (*iFppliupp_t)(void*, void*, intptr_t, int32_t, uint32_t, void*, void*); -typedef int32_t (*iFppLiipp_t)(void*, void*, uintptr_t, int32_t, int32_t, void*, void*); -typedef int32_t (*iFppLippp_t)(void*, void*, uintptr_t, int32_t, void*, void*, void*); -typedef int32_t (*iFppLuuii_t)(void*, void*, uintptr_t, uint32_t, uint32_t, int32_t, int32_t); -typedef int32_t (*iFpppiiuu_t)(void*, void*, void*, int32_t, int32_t, uint32_t, uint32_t); -typedef int32_t (*iFpppiiup_t)(void*, void*, void*, int32_t, int32_t, uint32_t, void*); -typedef int32_t (*iFpppiuwu_t)(void*, void*, void*, int32_t, uint32_t, int16_t, uint32_t); -typedef int32_t (*iFpppippi_t)(void*, void*, void*, int32_t, void*, void*, int32_t); -typedef int32_t (*iFpppippp_t)(void*, void*, void*, int32_t, void*, void*, void*); -typedef int32_t (*iFpppuiii_t)(void*, void*, void*, uint32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iFpppLppp_t)(void*, void*, void*, uintptr_t, void*, void*, void*); -typedef int32_t (*iFppppilp_t)(void*, void*, void*, void*, int32_t, intptr_t, void*); -typedef int32_t (*iFppppipp_t)(void*, void*, void*, void*, int32_t, void*, void*); -typedef int32_t (*iFppppIip_t)(void*, void*, void*, void*, int64_t, int32_t, void*); -typedef int32_t (*iFppppdpu_t)(void*, void*, void*, void*, double, void*, uint32_t); -typedef int32_t (*iFpppppip_t)(void*, void*, void*, void*, void*, int32_t, void*); -typedef int32_t (*iFpppppLp_t)(void*, void*, void*, void*, void*, uintptr_t, void*); -typedef int32_t (*iFppppppu_t)(void*, void*, void*, void*, void*, void*, uint32_t); -typedef int32_t (*iFppppppp_t)(void*, void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFEiipppp_t)(x64emu_t*, int32_t, int32_t, void*, void*, void*, void*); -typedef uint32_t (*uFEpiippp_t)(x64emu_t*, void*, int32_t, int32_t, void*, void*, void*); -typedef uint32_t (*uFEpuuppp_t)(x64emu_t*, void*, uint32_t, uint32_t, void*, void*, void*); -typedef uint32_t (*uFEpppppp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFiiiuuuu_t)(int32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef uint32_t (*uFuippppp_t)(uint32_t, int32_t, void*, void*, void*, void*, void*); -typedef uint32_t (*uFpippppp_t)(void*, int32_t, void*, void*, void*, void*, void*); -typedef uint32_t (*uFpuuuupp_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, void*, void*); -typedef uint32_t (*uFpuuuppp_t)(void*, uint32_t, uint32_t, uint32_t, void*, void*, void*); -typedef uint32_t (*uFpuupppp_t)(void*, uint32_t, uint32_t, void*, void*, void*, void*); -typedef uint32_t (*uFppiuppi_t)(void*, void*, int32_t, uint32_t, void*, void*, int32_t); -typedef uint32_t (*uFppiuppp_t)(void*, void*, int32_t, uint32_t, void*, void*, void*); -typedef uint32_t (*uFppuuuup_t)(void*, void*, uint32_t, uint32_t, uint32_t, uint32_t, void*); -typedef uint32_t (*uFppppppp_t)(void*, void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFbCuuuuu_t)(void*, uint8_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef uint32_t (*uFbuuuwwu_t)(void*, uint32_t, uint32_t, uint32_t, int16_t, int16_t, uint32_t); -typedef uint32_t (*uFbuupwwC_t)(void*, uint32_t, uint32_t, void*, int16_t, int16_t, uint8_t); -typedef uintptr_t (*LFEppLppU_t)(x64emu_t*, void*, void*, uintptr_t, void*, void*, uint64_t); -typedef uintptr_t (*LFEpppppu_t)(x64emu_t*, void*, void*, void*, void*, void*, uint32_t); -typedef uintptr_t (*LFpLLuupp_t)(void*, uintptr_t, uintptr_t, uint32_t, uint32_t, void*, void*); -typedef uintptr_t (*LFpLLppuu_t)(void*, uintptr_t, uintptr_t, void*, void*, uint32_t, uint32_t); -typedef void* (*pFEpupppp_t)(x64emu_t*, void*, uint32_t, void*, void*, void*, void*); -typedef void* (*pFEpLiiil_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, int32_t, intptr_t); -typedef void* (*pFEppuipp_t)(x64emu_t*, void*, void*, uint32_t, int32_t, void*, void*); -typedef void* (*pFEppppip_t)(x64emu_t*, void*, void*, void*, void*, int32_t, void*); -typedef void* (*pFEpppppi_t)(x64emu_t*, void*, void*, void*, void*, void*, int32_t); -typedef void* (*pFifffppp_t)(int32_t, float, float, float, void*, void*, void*); -typedef void* (*pFWpppppp_t)(uint16_t, void*, void*, void*, void*, void*, void*); -typedef void* (*pFuuuiiip_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, void*); -typedef void* (*pFuupupup_t)(uint32_t, uint32_t, void*, uint32_t, void*, uint32_t, void*); -typedef void* (*pFfiiiiid_t)(float, int32_t, int32_t, int32_t, int32_t, int32_t, double); -typedef void* (*pFdiiiIiI_t)(double, int32_t, int32_t, int32_t, int64_t, int32_t, int64_t); -typedef void* (*pFpiiiiid_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t, double); -typedef void* (*pFpiiippp_t)(void*, int32_t, int32_t, int32_t, void*, void*, void*); -typedef void* (*pFpiiUdii_t)(void*, int32_t, int32_t, uint64_t, double, int32_t, int32_t); -typedef void* (*pFpiipppp_t)(void*, int32_t, int32_t, void*, void*, void*, void*); -typedef void* (*pFpipippp_t)(void*, int32_t, void*, int32_t, void*, void*, void*); -typedef void* (*pFpWppWpp_t)(void*, uint16_t, void*, void*, uint16_t, void*, void*); -typedef void* (*pFpuLpipp_t)(void*, uint32_t, uintptr_t, void*, int32_t, void*, void*); -typedef void* (*pFpupiipp_t)(void*, uint32_t, void*, int32_t, int32_t, void*, void*); -typedef void* (*pFpuppipp_t)(void*, uint32_t, void*, void*, int32_t, void*, void*); -typedef void* (*pFpuppppp_t)(void*, uint32_t, void*, void*, void*, void*, void*); -typedef void* (*pFplppppp_t)(void*, intptr_t, void*, void*, void*, void*, void*); -typedef void* (*pFpLLppup_t)(void*, uintptr_t, uintptr_t, void*, void*, uint32_t, void*); -typedef void* (*pFpLpipip_t)(void*, uintptr_t, void*, int32_t, void*, int32_t, void*); -typedef void* (*pFpLpLLiL_t)(void*, uintptr_t, void*, uintptr_t, uintptr_t, int32_t, uintptr_t); -typedef void* (*pFpLppiip_t)(void*, uintptr_t, void*, void*, int32_t, int32_t, void*); -typedef void* (*pFpLppLLi_t)(void*, uintptr_t, void*, void*, uintptr_t, uintptr_t, int32_t); -typedef void* (*pFppiiipp_t)(void*, void*, int32_t, int32_t, int32_t, void*, void*); -typedef void* (*pFppiiCCC_t)(void*, void*, int32_t, int32_t, uint8_t, uint8_t, uint8_t); -typedef void* (*pFppiippp_t)(void*, void*, int32_t, int32_t, void*, void*, void*); -typedef void* (*pFppipipp_t)(void*, void*, int32_t, void*, int32_t, void*, void*); -typedef void* (*pFppipLpp_t)(void*, void*, int32_t, void*, uintptr_t, void*, void*); -typedef void* (*pFppuippp_t)(void*, void*, uint32_t, int32_t, void*, void*, void*); -typedef void* (*pFppuuupp_t)(void*, void*, uint32_t, uint32_t, uint32_t, void*, void*); -typedef void* (*pFppuuppp_t)(void*, void*, uint32_t, uint32_t, void*, void*, void*); -typedef void* (*pFppuLLip_t)(void*, void*, uint32_t, uintptr_t, uintptr_t, int32_t, void*); -typedef void* (*pFppupuuu_t)(void*, void*, uint32_t, void*, uint32_t, uint32_t, uint32_t); -typedef void* (*pFppliuip_t)(void*, void*, intptr_t, int32_t, uint32_t, int32_t, void*); -typedef void* (*pFpplipup_t)(void*, void*, intptr_t, int32_t, void*, uint32_t, void*); -typedef void* (*pFppLipip_t)(void*, void*, uintptr_t, int32_t, void*, int32_t, void*); -typedef void* (*pFppLLiLi_t)(void*, void*, uintptr_t, uintptr_t, int32_t, uintptr_t, int32_t); -typedef void* (*pFpppccci_t)(void*, void*, void*, int8_t, int8_t, int8_t, int32_t); -typedef void* (*pFpppiiii_t)(void*, void*, void*, int32_t, int32_t, int32_t, int32_t); -typedef void* (*pFpppCCCi_t)(void*, void*, void*, uint8_t, uint8_t, uint8_t, int32_t); -typedef void* (*pFpppuipp_t)(void*, void*, void*, uint32_t, int32_t, void*, void*); -typedef void* (*pFpppuuui_t)(void*, void*, void*, uint32_t, uint32_t, uint32_t, int32_t); -typedef void* (*pFpppuupp_t)(void*, void*, void*, uint32_t, uint32_t, void*, void*); -typedef void* (*pFpppupii_t)(void*, void*, void*, uint32_t, void*, int32_t, int32_t); -typedef void* (*pFpppupup_t)(void*, void*, void*, uint32_t, void*, uint32_t, void*); -typedef void* (*pFpppuppp_t)(void*, void*, void*, uint32_t, void*, void*, void*); -typedef void* (*pFpppfffi_t)(void*, void*, void*, float, float, float, int32_t); -typedef void* (*pFpppdddi_t)(void*, void*, void*, double, double, double, int32_t); -typedef void* (*pFpppllli_t)(void*, void*, void*, intptr_t, intptr_t, intptr_t, int32_t); -typedef void* (*pFpppLLLi_t)(void*, void*, void*, uintptr_t, uintptr_t, uintptr_t, int32_t); -typedef void* (*pFppppiii_t)(void*, void*, void*, void*, int32_t, int32_t, int32_t); -typedef void* (*pFppppuuu_t)(void*, void*, void*, void*, uint32_t, uint32_t, uint32_t); -typedef void* (*pFpppppuu_t)(void*, void*, void*, void*, void*, uint32_t, uint32_t); -typedef void* (*pFppppppu_t)(void*, void*, void*, void*, void*, void*, uint32_t); -typedef void* (*pFppppppp_t)(void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFbCuwwWW_t)(void*, uint8_t, uint32_t, int16_t, int16_t, uint16_t, uint16_t); -typedef void* (*pFbCuWCCC_t)(void*, uint8_t, uint32_t, uint16_t, uint8_t, uint8_t, uint8_t); -typedef void* (*pFbCuuwwp_t)(void*, uint8_t, uint32_t, uint32_t, int16_t, int16_t, void*); -typedef void* (*pFbCpWWup_t)(void*, uint8_t, void*, uint16_t, uint16_t, uint32_t, void*); -typedef int32_t (*iWpiiuuuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef int32_t (*iWpuiiiip_t)(void*, uint32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iWpuiiuii_t)(void*, uint32_t, int32_t, int32_t, uint32_t, int32_t, int32_t); -typedef int32_t (*iWpuipupp_t)(void*, uint32_t, int32_t, void*, uint32_t, void*, void*); -typedef int32_t (*iWpuuuppu_t)(void*, uint32_t, uint32_t, uint32_t, void*, void*, uint32_t); -typedef int32_t (*iWpupuufu_t)(void*, uint32_t, void*, uint32_t, uint32_t, float, uint32_t); -typedef int32_t (*iWpppuppp_t)(void*, void*, void*, uint32_t, void*, void*, void*); -typedef void (*vFEiippppV_t)(x64emu_t*, int32_t, int32_t, void*, void*, void*, void*, void*); -typedef void (*vFEiupippp_t)(x64emu_t*, int32_t, uint32_t, void*, int32_t, void*, void*, void*); -typedef void (*vFEipAippp_t)(x64emu_t*, int32_t, void*, void*, int32_t, void*, void*, void*); -typedef void (*vFEppipppp_t)(x64emu_t*, void*, void*, int32_t, void*, void*, void*, void*); -typedef void (*vFEppLippp_t)(x64emu_t*, void*, void*, uintptr_t, int32_t, void*, void*, void*); -typedef void (*vFEpppippp_t)(x64emu_t*, void*, void*, void*, int32_t, void*, void*, void*); -typedef void (*vFEpppuipV_t)(x64emu_t*, void*, void*, void*, uint32_t, int32_t, void*, void*); -typedef void (*vFEpppppuu_t)(x64emu_t*, void*, void*, void*, void*, void*, uint32_t, uint32_t); -typedef void (*vFiiiiuuip_t)(int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, void*); -typedef void (*vFiilliilp_t)(int32_t, int32_t, intptr_t, intptr_t, int32_t, int32_t, intptr_t, void*); -typedef void (*vFiilluulp_t)(int32_t, int32_t, intptr_t, intptr_t, uint32_t, uint32_t, intptr_t, void*); -typedef void (*vFiupuiuup_t)(int32_t, uint32_t, void*, uint32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFiupuuuup_t)(int32_t, uint32_t, void*, uint32_t, uint32_t, uint32_t, uint32_t, void*); -typedef void (*vFuiiiiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuiiiiiiC_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint8_t); -typedef void (*vFuiiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuiiipiup_t)(uint32_t, int32_t, int32_t, int32_t, void*, int32_t, uint32_t, void*); -typedef void (*vFuiuiiiii_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuiuiiiip_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFuiuiiiuL_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, uint32_t, uintptr_t); -typedef void (*vFuiuiiCuL_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, uint8_t, uint32_t, uintptr_t); -typedef void (*vFuiuiuuuu_t)(uint32_t, int32_t, uint32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFuCCCCfff_t)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t, float, float, float); -typedef void (*vFuuiiiiiC_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint8_t); -typedef void (*vFuuiiiuip_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, void*); -typedef void (*vFuuiiiuup_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuuiiuupp_t)(uint32_t, uint32_t, int32_t, int32_t, uint32_t, uint32_t, void*, void*); -typedef void (*vFuuiuiiii_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuuiuiiiC_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, uint8_t); -typedef void (*vFuuiuiiip_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFuuuiiiiu_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t); -typedef void (*vFuuuiuCil_t)(uint32_t, uint32_t, uint32_t, int32_t, uint32_t, uint8_t, int32_t, intptr_t); -typedef void (*vFuuuipipp_t)(uint32_t, uint32_t, uint32_t, int32_t, void*, int32_t, void*, void*); -typedef void (*vFuuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFuuufffff_t)(uint32_t, uint32_t, uint32_t, float, float, float, float, float); -typedef void (*vFffffffff_t)(float, float, float, float, float, float, float, float); -typedef void (*vFpiiiiiii_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFpiiiiiip_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFpiiiipii_t)(void*, int32_t, int32_t, int32_t, int32_t, void*, int32_t, int32_t); -typedef void (*vFpiUuupup_t)(void*, int32_t, uint64_t, uint32_t, uint32_t, void*, uint32_t, void*); -typedef void (*vFpippiiuu_t)(void*, int32_t, void*, void*, int32_t, int32_t, uint32_t, uint32_t); -typedef void (*vFpippiipi_t)(void*, int32_t, void*, void*, int32_t, int32_t, void*, int32_t); -typedef void (*vFpuiULipp_t)(void*, uint32_t, int32_t, uint64_t, uintptr_t, int32_t, void*, void*); -typedef void (*vFpudddddd_t)(void*, uint32_t, double, double, double, double, double, double); -typedef void (*vFpuppippp_t)(void*, uint32_t, void*, void*, int32_t, void*, void*, void*); -typedef void (*vFpuppLLLL_t)(void*, uint32_t, void*, void*, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (*vFpUiUiupi_t)(void*, uint64_t, int32_t, uint64_t, int32_t, uint32_t, void*, int32_t); -typedef void (*vFpUuuUUUu_t)(void*, uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint64_t, uint32_t); -typedef void (*vFpLppiipi_t)(void*, uintptr_t, void*, void*, int32_t, int32_t, void*, int32_t); -typedef void (*vFppiiiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppiiipii_t)(void*, void*, int32_t, int32_t, int32_t, void*, int32_t, int32_t); -typedef void (*vFppipipiu_t)(void*, void*, int32_t, void*, int32_t, void*, int32_t, uint32_t); -typedef void (*vFppipppui_t)(void*, void*, int32_t, void*, void*, void*, uint32_t, int32_t); -typedef void (*vFppippppi_t)(void*, void*, int32_t, void*, void*, void*, void*, int32_t); -typedef void (*vFppippppp_t)(void*, void*, int32_t, void*, void*, void*, void*, void*); -typedef void (*vFppuuiiii_t)(void*, void*, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppuppiii_t)(void*, void*, uint32_t, void*, void*, int32_t, int32_t, int32_t); -typedef void (*vFppuppiiu_t)(void*, void*, uint32_t, void*, void*, int32_t, int32_t, uint32_t); -typedef void (*vFpplppppi_t)(void*, void*, intptr_t, void*, void*, void*, void*, int32_t); -typedef void (*vFpplppppp_t)(void*, void*, intptr_t, void*, void*, void*, void*, void*); -typedef void (*vFppLpLpLp_t)(void*, void*, uintptr_t, void*, uintptr_t, void*, uintptr_t, void*); -typedef void (*vFpppipppu_t)(void*, void*, void*, int32_t, void*, void*, void*, uint32_t); -typedef void (*vFpppuiiii_t)(void*, void*, void*, uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppppiipi_t)(void*, void*, void*, void*, int32_t, int32_t, void*, int32_t); -typedef void (*vFpppppuuu_t)(void*, void*, void*, void*, void*, uint32_t, uint32_t, uint32_t); -typedef void (*vFpppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFEuipuupp_t)(x64emu_t*, uint32_t, int32_t, void*, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFEpippppp_t)(x64emu_t*, void*, int32_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFEpuuLppp_t)(x64emu_t*, void*, uint32_t, uint32_t, uintptr_t, void*, void*, void*); -typedef int32_t (*iFEpUUuppp_t)(x64emu_t*, void*, uint64_t, uint64_t, uint32_t, void*, void*, void*); -typedef int32_t (*iFEppipppp_t)(x64emu_t*, void*, void*, int32_t, void*, void*, void*, void*); -typedef int32_t (*iFEppppipp_t)(x64emu_t*, void*, void*, void*, void*, int32_t, void*, void*); -typedef int32_t (*iFiiiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFiiupiupi_t)(int32_t, int32_t, uint32_t, void*, int32_t, uint32_t, void*, int32_t); -typedef int32_t (*iFiuuCCuup_t)(int32_t, uint32_t, uint32_t, uint8_t, uint8_t, uint32_t, uint32_t, void*); -typedef int32_t (*iFiuuuupip_t)(int32_t, uint32_t, uint32_t, uint32_t, uint32_t, void*, int32_t, void*); -typedef int32_t (*iFipippppp_t)(int32_t, void*, int32_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFuuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef int32_t (*iFdiippppL_t)(double, int32_t, int32_t, void*, void*, void*, void*, uintptr_t); -typedef int32_t (*iFpiiiuuup_t)(void*, int32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, void*); -typedef int32_t (*iFpipiipip_t)(void*, int32_t, void*, int32_t, int32_t, void*, int32_t, void*); -typedef int32_t (*iFpippuuii_t)(void*, int32_t, void*, void*, uint32_t, uint32_t, int32_t, int32_t); -typedef int32_t (*iFpippuupp_t)(void*, int32_t, void*, void*, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFpCCWWpWu_t)(void*, uint8_t, uint8_t, uint16_t, uint16_t, void*, uint16_t, uint32_t); -typedef int32_t (*iFpWCuWCuu_t)(void*, uint16_t, uint8_t, uint32_t, uint16_t, uint8_t, uint32_t, uint32_t); -typedef int32_t (*iFpuiipppp_t)(void*, uint32_t, int32_t, int32_t, void*, void*, void*, void*); -typedef int32_t (*iFpuippLpp_t)(void*, uint32_t, int32_t, void*, void*, uintptr_t, void*, void*); -typedef int32_t (*iFpuuiiiii_t)(void*, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iFpuuipppp_t)(void*, uint32_t, uint32_t, int32_t, void*, void*, void*, void*); -typedef int32_t (*iFpuuupupu_t)(void*, uint32_t, uint32_t, uint32_t, void*, uint32_t, void*, uint32_t); -typedef int32_t (*iFpuupuupp_t)(void*, uint32_t, uint32_t, void*, uint32_t, uint32_t, void*, void*); -typedef int32_t (*iFpuuppiip_t)(void*, uint32_t, uint32_t, void*, void*, int32_t, int32_t, void*); -typedef int32_t (*iFpuuppppp_t)(void*, uint32_t, uint32_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFpupppppp_t)(void*, uint32_t, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpUuuLpUu_t)(void*, uint64_t, uint32_t, uint32_t, uintptr_t, void*, uint64_t, uint32_t); -typedef int32_t (*iFpduuulul_t)(void*, double, uint32_t, uint32_t, uint32_t, intptr_t, uint32_t, intptr_t); -typedef int32_t (*iFpLLiippp_t)(void*, uintptr_t, uintptr_t, int32_t, int32_t, void*, void*, void*); -typedef int32_t (*iFpLLLiipi_t)(void*, uintptr_t, uintptr_t, uintptr_t, int32_t, int32_t, void*, int32_t); -typedef int32_t (*iFpLLppppp_t)(void*, uintptr_t, uintptr_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFpLpipppp_t)(void*, uintptr_t, void*, int32_t, void*, void*, void*, void*); -typedef int32_t (*iFpLppLpip_t)(void*, uintptr_t, void*, void*, uintptr_t, void*, int32_t, void*); -typedef int32_t (*iFpLpppupu_t)(void*, uintptr_t, void*, void*, void*, uint32_t, void*, uint32_t); -typedef int32_t (*iFpLpppppp_t)(void*, uintptr_t, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFppiiipip_t)(void*, void*, int32_t, int32_t, int32_t, void*, int32_t, void*); -typedef int32_t (*iFppillppp_t)(void*, void*, int32_t, intptr_t, intptr_t, void*, void*, void*); -typedef int32_t (*iFppippppp_t)(void*, void*, int32_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFppIIIppp_t)(void*, void*, int64_t, int64_t, int64_t, void*, void*, void*); -typedef int32_t (*iFppuiiuuu_t)(void*, void*, uint32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t); -typedef int32_t (*iFppuuuuuu_t)(void*, void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef int32_t (*iFppuppppp_t)(void*, void*, uint32_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFpppiiipi_t)(void*, void*, void*, int32_t, int32_t, int32_t, void*, int32_t); -typedef int32_t (*iFpppiiipp_t)(void*, void*, void*, int32_t, int32_t, int32_t, void*, void*); -typedef int32_t (*iFpppipipi_t)(void*, void*, void*, int32_t, void*, int32_t, void*, int32_t); -typedef int32_t (*iFppppiiup_t)(void*, void*, void*, void*, int32_t, int32_t, uint32_t, void*); -typedef int32_t (*iFppppippp_t)(void*, void*, void*, void*, int32_t, void*, void*, void*); -typedef int32_t (*iFpppppupp_t)(void*, void*, void*, void*, void*, uint32_t, void*, void*); -typedef int32_t (*iFppppppii_t)(void*, void*, void*, void*, void*, void*, int32_t, int32_t); -typedef int32_t (*iFpppppppi_t)(void*, void*, void*, void*, void*, void*, void*, int32_t); -typedef int32_t (*iFpppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFbWWipppp_t)(void*, uint16_t, uint16_t, int32_t, void*, void*, void*, void*); -typedef int32_t (*iFbupppWWu_t)(void*, uint32_t, void*, void*, void*, uint16_t, uint16_t, uint32_t); -typedef uint8_t (*CFuiifpppp_t)(uint32_t, int32_t, int32_t, float, void*, void*, void*, void*); -typedef uint32_t (*uFEipipppp_t)(x64emu_t*, int32_t, void*, int32_t, void*, void*, void*, void*); -typedef uint32_t (*uFEpiupppp_t)(x64emu_t*, void*, int32_t, uint32_t, void*, void*, void*, void*); -typedef uint32_t (*uFEppipppp_t)(x64emu_t*, void*, void*, int32_t, void*, void*, void*, void*); -typedef uint32_t (*uFEpppuppp_t)(x64emu_t*, void*, void*, void*, uint32_t, void*, void*, void*); -typedef uint32_t (*uFEppppppp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFuipppppp_t)(uint32_t, int32_t, void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFuupuuiuf_t)(uint32_t, uint32_t, void*, uint32_t, uint32_t, int32_t, uint32_t, float); -typedef uint32_t (*uFulpppppp_t)(uint32_t, intptr_t, void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFpuupupuu_t)(void*, uint32_t, uint32_t, void*, uint32_t, void*, uint32_t, uint32_t); -typedef uint32_t (*uFpupuuuCp_t)(void*, uint32_t, void*, uint32_t, uint32_t, uint32_t, uint8_t, void*); -typedef uint32_t (*uFppuuuupp_t)(void*, void*, uint32_t, uint32_t, uint32_t, uint32_t, void*, void*); -typedef uint32_t (*uFppuuuppu_t)(void*, void*, uint32_t, uint32_t, uint32_t, void*, void*, uint32_t); -typedef uint32_t (*uFppuppppp_t)(void*, void*, uint32_t, void*, void*, void*, void*, void*); -typedef uint32_t (*uFpppppupp_t)(void*, void*, void*, void*, void*, uint32_t, void*, void*); -typedef uint32_t (*uFbCuuuCup_t)(void*, uint8_t, uint32_t, uint32_t, uint32_t, uint8_t, uint32_t, void*); -typedef uint32_t (*uFbWWWWWWp_t)(void*, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, void*); -typedef uintptr_t (*LFELpupupu_t)(x64emu_t*, uintptr_t, void*, uint32_t, void*, uint32_t, void*, uint32_t); -typedef uintptr_t (*LFEpiupppp_t)(x64emu_t*, void*, int32_t, uint32_t, void*, void*, void*, void*); -typedef uintptr_t (*LFpLpuuLLu_t)(void*, uintptr_t, void*, uint32_t, uint32_t, uintptr_t, uintptr_t, uint32_t); -typedef void* (*pFEiplllpp_t)(x64emu_t*, int32_t, void*, intptr_t, intptr_t, intptr_t, void*, void*); -typedef void* (*pFEipLLLpp_t)(x64emu_t*, int32_t, void*, uintptr_t, uintptr_t, uintptr_t, void*, void*); -typedef void* (*pFEpiuCppp_t)(x64emu_t*, void*, int32_t, uint32_t, uint8_t, void*, void*, void*); -typedef void* (*pFEppLiiip_t)(x64emu_t*, void*, void*, uintptr_t, int32_t, int32_t, int32_t, void*); -typedef void* (*pFEpppuipV_t)(x64emu_t*, void*, void*, void*, uint32_t, int32_t, void*, void*); -typedef void* (*pFEpppppiV_t)(x64emu_t*, void*, void*, void*, void*, void*, int32_t, void*); -typedef void* (*pFEppppppi_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, int32_t); -typedef void* (*pFEppppppp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFiippipip_t)(int32_t, int32_t, void*, void*, int32_t, void*, int32_t, void*); -typedef void* (*pFiupppppp_t)(int32_t, uint32_t, void*, void*, void*, void*, void*, void*); -typedef void* (*pFuiiiuuuu_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void* (*pFuCCCCpWw_t)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t, void*, uint16_t, int16_t); -typedef void* (*pFuupupipp_t)(uint32_t, uint32_t, void*, uint32_t, void*, int32_t, void*, void*); -typedef void* (*pFpiiiiiuu_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); -typedef void* (*pFpiiuuupp_t)(void*, int32_t, int32_t, uint32_t, uint32_t, uint32_t, void*, void*); -typedef void* (*pFpiUdiiUi_t)(void*, int32_t, uint64_t, double, int32_t, int32_t, uint64_t, int32_t); -typedef void* (*pFpipiiiip_t)(void*, int32_t, void*, int32_t, int32_t, int32_t, int32_t, void*); -typedef void* (*pFpuuuuupp_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, void*, void*); -typedef void* (*pFpuuuupup_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, void*, uint32_t, void*); -typedef void* (*pFpupLLLpp_t)(void*, uint32_t, void*, uintptr_t, uintptr_t, uintptr_t, void*, void*); -typedef void* (*pFpupppppp_t)(void*, uint32_t, void*, void*, void*, void*, void*, void*); -typedef void* (*pFplpppppp_t)(void*, intptr_t, void*, void*, void*, void*, void*, void*); -typedef void* (*pFpLuLpLip_t)(void*, uintptr_t, uint32_t, uintptr_t, void*, uintptr_t, int32_t, void*); -typedef void* (*pFpLpipLup_t)(void*, uintptr_t, void*, int32_t, void*, uintptr_t, uint32_t, void*); -typedef void* (*pFpLpLLiLi_t)(void*, uintptr_t, void*, uintptr_t, uintptr_t, int32_t, uintptr_t, int32_t); -typedef void* (*pFpLppuLLp_t)(void*, uintptr_t, void*, void*, uint32_t, uintptr_t, uintptr_t, void*); -typedef void* (*pFpLppLLiL_t)(void*, uintptr_t, void*, void*, uintptr_t, uintptr_t, int32_t, uintptr_t); -typedef void* (*pFppiiiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void* (*pFpppipipi_t)(void*, void*, void*, int32_t, void*, int32_t, void*, int32_t); -typedef void* (*pFppplippp_t)(void*, void*, void*, intptr_t, int32_t, void*, void*, void*); -typedef void* (*pFppppuppp_t)(void*, void*, void*, void*, uint32_t, void*, void*, void*); -typedef void* (*pFpppppupp_t)(void*, void*, void*, void*, void*, uint32_t, void*, void*); -typedef void* (*pFbCCuuwwC_t)(void*, uint8_t, uint8_t, uint32_t, uint32_t, int16_t, int16_t, uint8_t); -typedef void* (*pFbCuwwWWu_t)(void*, uint8_t, uint32_t, int16_t, int16_t, uint16_t, uint16_t, uint32_t); -typedef void* (*pFbWWiCpup_t)(void*, uint16_t, uint16_t, int32_t, uint8_t, void*, uint32_t, void*); -typedef void* (*pFbuuWWCuu_t)(void*, uint32_t, uint32_t, uint16_t, uint16_t, uint8_t, uint32_t, uint32_t); -typedef void* (*pFbuuupwwp_t)(void*, uint32_t, uint32_t, uint32_t, void*, int16_t, int16_t, void*); -typedef void* (*pFbdwwWWui_t)(void*, double, int16_t, int16_t, uint16_t, uint16_t, uint32_t, int32_t); -typedef int32_t (*iWEpuuiipp_t)(x64emu_t*, void*, uint32_t, uint32_t, int32_t, int32_t, void*, void*); -typedef int32_t (*iWEpuuuipp_t)(x64emu_t*, void*, uint32_t, uint32_t, uint32_t, int32_t, void*, void*); -typedef int32_t (*iWpuipuppp_t)(void*, uint32_t, int32_t, void*, uint32_t, void*, void*, void*); -typedef void (*vFEpiiiuipp_t)(x64emu_t*, void*, int32_t, int32_t, int32_t, uint32_t, int32_t, void*, void*); -typedef void (*vFEpippippV_t)(x64emu_t*, void*, int32_t, void*, void*, int32_t, void*, void*, void*); -typedef void (*vFEpippippA_t)(x64emu_t*, void*, int32_t, void*, void*, int32_t, void*, void*, void*); -typedef void (*vFEpuuuippp_t)(x64emu_t*, void*, uint32_t, uint32_t, uint32_t, int32_t, void*, void*, void*); -typedef void (*vFEppiipppp_t)(x64emu_t*, void*, void*, int32_t, int32_t, void*, void*, void*, void*); -typedef void (*vFEpppiippp_t)(x64emu_t*, void*, void*, void*, int32_t, int32_t, void*, void*, void*); -typedef void (*vFEppppippp_t)(x64emu_t*, void*, void*, void*, void*, int32_t, void*, void*, void*); -typedef void (*vFiiiiiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFiiiiiiill_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t); -typedef void (*vFiiiiillli_t)(int32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t, int32_t); -typedef void (*vFiiilllilp_t)(int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t, int32_t, intptr_t, void*); -typedef void (*vFiupuiuuup_t)(int32_t, uint32_t, void*, uint32_t, int32_t, uint32_t, uint32_t, uint32_t, void*); -typedef void (*vFiupuuuuup_t)(int32_t, uint32_t, void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, void*); -typedef void (*vFuiiiiiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuiiiiiiiC_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint8_t); -typedef void (*vFuiiiiiuip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, void*); -typedef void (*vFuiiiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuiuiiiiip_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFuiuiiiCuL_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, uint8_t, uint32_t, uintptr_t); -typedef void (*vFuiupuffup_t)(uint32_t, int32_t, uint32_t, void*, uint32_t, float, float, uint32_t, void*); -typedef void (*vFuuiiiiiii_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuuiiiiiiC_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint8_t); -typedef void (*vFuuiiiiuup_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuuiuiiiii_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuuiuiiiip_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFuuuiiiiCp_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint8_t, void*); -typedef void (*vFuuuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFuupuuiuuf_t)(uint32_t, uint32_t, void*, uint32_t, uint32_t, int32_t, uint32_t, uint32_t, float); -typedef void (*vFuffffffff_t)(uint32_t, float, float, float, float, float, float, float, float); -typedef void (*vFffCCCCfff_t)(float, float, uint8_t, uint8_t, uint8_t, uint8_t, float, float, float); -typedef void (*vFddddddddd_t)(double, double, double, double, double, double, double, double, double); -typedef void (*vFpiuippppi_t)(void*, int32_t, uint32_t, int32_t, void*, void*, void*, void*, int32_t); -typedef void (*vFpipiuiipp_t)(void*, int32_t, void*, int32_t, uint32_t, int32_t, int32_t, void*, void*); -typedef void (*vFpipppiipi_t)(void*, int32_t, void*, void*, void*, int32_t, int32_t, void*, int32_t); -typedef void (*vFpuuuuuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFpLpppippp_t)(void*, uintptr_t, void*, void*, void*, int32_t, void*, void*, void*); -typedef void (*vFppiiiiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppiiiiipi_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, void*, int32_t); -typedef void (*vFppiiiiupi_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, void*, int32_t); -typedef void (*vFppiiipiii_t)(void*, void*, int32_t, int32_t, int32_t, void*, int32_t, int32_t, int32_t); -typedef void (*vFppiupiiii_t)(void*, void*, int32_t, uint32_t, void*, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppippDpDC_t)(void*, void*, int32_t, void*, void*, long double, void*, long double, uint8_t); -typedef void (*vFppipppiii_t)(void*, void*, int32_t, void*, void*, void*, int32_t, int32_t, int32_t); -typedef void (*vFppipppiip_t)(void*, void*, int32_t, void*, void*, void*, int32_t, int32_t, void*); -typedef void (*vFppuippiip_t)(void*, void*, uint32_t, int32_t, void*, void*, int32_t, int32_t, void*); -typedef void (*vFppuuiiiii_t)(void*, void*, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppuuiiiiu_t)(void*, void*, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t); -typedef void (*vFppuppiiii_t)(void*, void*, uint32_t, void*, void*, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppupppiii_t)(void*, void*, uint32_t, void*, void*, void*, int32_t, int32_t, int32_t); -typedef void (*vFppupppiiu_t)(void*, void*, uint32_t, void*, void*, void*, int32_t, int32_t, uint32_t); -typedef void (*vFppupppiip_t)(void*, void*, uint32_t, void*, void*, void*, int32_t, int32_t, void*); -typedef void (*vFppUUuUUUU_t)(void*, void*, uint64_t, uint64_t, uint32_t, uint64_t, uint64_t, uint64_t, uint64_t); -typedef void (*vFppddddudd_t)(void*, void*, double, double, double, double, uint32_t, double, double); -typedef void (*vFpplpppppi_t)(void*, void*, intptr_t, void*, void*, void*, void*, void*, int32_t); -typedef void (*vFpppiiiiii_t)(void*, void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFpppffffff_t)(void*, void*, void*, float, float, float, float, float, float); -typedef void (*vFppppipiip_t)(void*, void*, void*, void*, int32_t, void*, int32_t, int32_t, void*); -typedef void (*vFpppppippp_t)(void*, void*, void*, void*, void*, int32_t, void*, void*, void*); -typedef int32_t (*iFEpiiiiipi_t)(x64emu_t*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, void*, int32_t); -typedef int32_t (*iFEppuppppp_t)(x64emu_t*, void*, void*, uint32_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFEpppipppp_t)(x64emu_t*, void*, void*, void*, int32_t, void*, void*, void*, void*); -typedef int32_t (*iFEppplPPPP_t)(x64emu_t*, void*, void*, void*, intptr_t, void*, void*, void*, void*); -typedef int32_t (*iFEpppppupp_t)(x64emu_t*, void*, void*, void*, void*, void*, uint32_t, void*, void*); -typedef int32_t (*iFEppPPPPPP_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFiiiiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFiiiipiiip_t)(int32_t, int32_t, int32_t, int32_t, void*, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFipiipippi_t)(int32_t, void*, int32_t, int32_t, void*, int32_t, void*, void*, int32_t); -typedef int32_t (*iFdddpppppp_t)(double, double, double, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpipippppi_t)(void*, int32_t, void*, int32_t, void*, void*, void*, void*, int32_t); -typedef int32_t (*iFpipLpiiip_t)(void*, int32_t, void*, uintptr_t, void*, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFpuuuuuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef int32_t (*iFpuuuuduup_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, double, uint32_t, uint32_t, void*); -typedef int32_t (*iFpuuuLiiip_t)(void*, uint32_t, uint32_t, uint32_t, uintptr_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFpuuuLpppp_t)(void*, uint32_t, uint32_t, uint32_t, uintptr_t, void*, void*, void*, void*); -typedef int32_t (*iFpduuuLuLp_t)(void*, double, uint32_t, uint32_t, uint32_t, uintptr_t, uint32_t, uintptr_t, void*); -typedef int32_t (*iFpLiuiiLLL_t)(void*, uintptr_t, int32_t, uint32_t, int32_t, int32_t, uintptr_t, uintptr_t, uintptr_t); -typedef int32_t (*iFpLLiiuuii_t)(void*, uintptr_t, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t); -typedef int32_t (*iFpLpiiuuii_t)(void*, uintptr_t, void*, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t); -typedef int32_t (*iFpLpppupup_t)(void*, uintptr_t, void*, void*, void*, uint32_t, void*, uint32_t, void*); -typedef int32_t (*iFpLppppppp_t)(void*, uintptr_t, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFppiiiiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iFppippippp_t)(void*, void*, int32_t, void*, void*, int32_t, void*, void*, void*); -typedef int32_t (*iFppuLLpupp_t)(void*, void*, uint32_t, uintptr_t, uintptr_t, void*, uint32_t, void*, void*); -typedef int32_t (*iFppuppuuuu_t)(void*, void*, uint32_t, void*, void*, uint32_t, uint32_t, uint32_t, uint32_t); -typedef int32_t (*iFppupppupp_t)(void*, void*, uint32_t, void*, void*, void*, uint32_t, void*, void*); -typedef int32_t (*iFppLpiuppp_t)(void*, void*, uintptr_t, void*, int32_t, uint32_t, void*, void*, void*); -typedef int32_t (*iFpppiiipip_t)(void*, void*, void*, int32_t, int32_t, int32_t, void*, int32_t, void*); -typedef int32_t (*iFpppiiuuii_t)(void*, void*, void*, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t); -typedef int32_t (*iFpppiipiiu_t)(void*, void*, void*, int32_t, int32_t, void*, int32_t, int32_t, uint32_t); -typedef int32_t (*iFpppippipi_t)(void*, void*, void*, int32_t, void*, void*, int32_t, void*, int32_t); -typedef int32_t (*iFpppLLLupp_t)(void*, void*, void*, uintptr_t, uintptr_t, uintptr_t, uint32_t, void*, void*); -typedef int32_t (*iFpppLppupp_t)(void*, void*, void*, uintptr_t, void*, void*, uint32_t, void*, void*); -typedef int32_t (*iFppppiiupp_t)(void*, void*, void*, void*, int32_t, int32_t, uint32_t, void*, void*); -typedef int32_t (*iFpppppLupp_t)(void*, void*, void*, void*, void*, uintptr_t, uint32_t, void*, void*); -typedef int32_t (*iFppppppupp_t)(void*, void*, void*, void*, void*, void*, uint32_t, void*, void*); -typedef int32_t (*iFppppppppu_t)(void*, void*, void*, void*, void*, void*, void*, void*, uint32_t); -typedef int32_t (*iFppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFEipippppp_t)(x64emu_t*, int32_t, void*, int32_t, void*, void*, void*, void*, void*); -typedef uint32_t (*uFEpppufppp_t)(x64emu_t*, void*, void*, void*, uint32_t, float, void*, void*, void*); -typedef uint32_t (*uFuulpiuiuf_t)(uint32_t, uint32_t, intptr_t, void*, int32_t, uint32_t, int32_t, uint32_t, float); -typedef uint32_t (*uFpuupuppuu_t)(void*, uint32_t, uint32_t, void*, uint32_t, void*, void*, uint32_t, uint32_t); -typedef uint32_t (*uFppLpLuppp_t)(void*, void*, uintptr_t, void*, uintptr_t, uint32_t, void*, void*, void*); -typedef uint32_t (*uFppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef intptr_t (*lFpppipiipp_t)(void*, void*, void*, int32_t, void*, int32_t, int32_t, void*, void*); -typedef intptr_t (*lFpppippppp_t)(void*, void*, void*, int32_t, void*, void*, void*, void*, void*); -typedef uintptr_t (*LFEppppppii_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, int32_t, int32_t); -typedef uintptr_t (*LFpLiiuuuLL_t)(void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uintptr_t, uintptr_t); -typedef void* (*pFEppiiuuLi_t)(x64emu_t*, void*, void*, int32_t, int32_t, uint32_t, uint32_t, uintptr_t, int32_t); -typedef void* (*pFEppuippuu_t)(x64emu_t*, void*, void*, uint32_t, int32_t, void*, void*, uint32_t, uint32_t); -typedef void* (*pFEpppppiiV_t)(x64emu_t*, void*, void*, void*, void*, void*, int32_t, int32_t, void*); -typedef void* (*pFEpppppppi_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, void*, int32_t); -typedef void* (*pFEpppppppp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFuupuuuuuu_t)(uint32_t, uint32_t, void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void* (*pFpiiiiuuuu_t)(void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void* (*pFpLpLLipui_t)(void*, uintptr_t, void*, uintptr_t, uintptr_t, int32_t, void*, uint32_t, int32_t); -typedef void* (*pFpLppLLiLi_t)(void*, uintptr_t, void*, void*, uintptr_t, uintptr_t, int32_t, uintptr_t, int32_t); -typedef void* (*pFppiiiiiip_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef void* (*pFppipppppp_t)(void*, void*, int32_t, void*, void*, void*, void*, void*, void*); -typedef void* (*pFpppiiiiii_t)(void*, void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void* (*pFpppuipppp_t)(void*, void*, void*, uint32_t, int32_t, void*, void*, void*, void*); -typedef void* (*pFpppppiipp_t)(void*, void*, void*, void*, void*, int32_t, int32_t, void*, void*); -typedef void* (*pFbiiCpWWup_t)(void*, int32_t, int32_t, uint8_t, void*, uint16_t, uint16_t, uint32_t, void*); -typedef void* (*pFbCuWCCuuu_t)(void*, uint8_t, uint32_t, uint16_t, uint8_t, uint8_t, uint32_t, uint32_t, uint32_t); -typedef void* (*pFbuuwwWWww_t)(void*, uint32_t, uint32_t, int16_t, int16_t, uint16_t, uint16_t, int16_t, int16_t); -typedef void* (*pFbupuuuuup_t)(void*, uint32_t, void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, void*); -typedef void* (*pFbppppuuCC_t)(void*, void*, void*, void*, void*, uint32_t, uint32_t, uint8_t, uint8_t); -typedef int32_t (*iWEpuuiippu_t)(x64emu_t*, void*, uint32_t, uint32_t, int32_t, int32_t, void*, void*, uint32_t); -typedef int32_t (*iWEpuuuiipp_t)(x64emu_t*, void*, uint32_t, uint32_t, uint32_t, int32_t, int32_t, void*, void*); -typedef int32_t (*iWpiuuupipu_t)(void*, int32_t, uint32_t, uint32_t, uint32_t, void*, int32_t, void*, uint32_t); -typedef int32_t (*iWpuiuuipip_t)(void*, uint32_t, int32_t, uint32_t, uint32_t, int32_t, void*, int32_t, void*); -typedef int32_t (*iWppppupiii_t)(void*, void*, void*, void*, uint32_t, void*, int32_t, int32_t, int32_t); -typedef void (*vFEiippppppp_t)(x64emu_t*, int32_t, int32_t, void*, void*, void*, void*, void*, void*, void*); -typedef void (*vFEpippppppp_t)(x64emu_t*, void*, int32_t, void*, void*, void*, void*, void*, void*, void*); -typedef void (*vFEpppiipppp_t)(x64emu_t*, void*, void*, void*, int32_t, int32_t, void*, void*, void*, void*); -typedef void (*vFiiiiiiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFiiiiiiiiiu_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t); -typedef void (*vFiiiiiiiiui_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t); -typedef void (*vFiiiiiiiiuu_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); -typedef void (*vFiiillliiip_t)(int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFuiiiiiiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuiiiiiiiip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFuiiiiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuiuiiiiuup_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuuiiiiiiii_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFuuiiiiiuip_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, void*); -typedef void (*vFuuiiiiiuup_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuuiuiiiiip_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFuuuuuuuCCC_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint8_t, uint8_t, uint8_t); -typedef void (*vFuuuuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFuupuiupuuf_t)(uint32_t, uint32_t, void*, uint32_t, int32_t, uint32_t, void*, uint32_t, uint32_t, float); -typedef void (*vFuffiiffiip_t)(uint32_t, float, float, int32_t, int32_t, float, float, int32_t, int32_t, void*); -typedef void (*vFuddiiddiip_t)(uint32_t, double, double, int32_t, int32_t, double, double, int32_t, int32_t, void*); -typedef void (*vFffffffffff_t)(float, float, float, float, float, float, float, float, float, float); -typedef void (*vFpiuippppip_t)(void*, int32_t, uint32_t, int32_t, void*, void*, void*, void*, int32_t, void*); -typedef void (*vFpuupuuuuuu_t)(void*, uint32_t, uint32_t, void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFppiiiiiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppiiiiipip_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, void*, int32_t, void*); -typedef void (*vFppiiiiupip_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, void*, int32_t, void*); -typedef void (*vFppiippppii_t)(void*, void*, int32_t, int32_t, void*, void*, void*, void*, int32_t, int32_t); -typedef void (*vFppuipppiip_t)(void*, void*, uint32_t, int32_t, void*, void*, void*, int32_t, int32_t, void*); -typedef void (*vFppuuuiiiii_t)(void*, void*, uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppuuuuuuuu_t)(void*, void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFppuuppiiii_t)(void*, void*, uint32_t, uint32_t, void*, void*, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppuuppppii_t)(void*, void*, uint32_t, uint32_t, void*, void*, void*, void*, int32_t, int32_t); -typedef void (*vFppuppuiiii_t)(void*, void*, uint32_t, void*, void*, uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppupppiiii_t)(void*, void*, uint32_t, void*, void*, void*, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppdddddddd_t)(void*, void*, double, double, double, double, double, double, double, double); -typedef void (*vFppppppppii_t)(void*, void*, void*, void*, void*, void*, void*, void*, int32_t, int32_t); -typedef void (*vFpppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFEpiiiiippp_t)(x64emu_t*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, void*, void*, void*); -typedef int32_t (*iFEpupppLppL_t)(x64emu_t*, void*, uint32_t, void*, void*, void*, uintptr_t, void*, void*, uintptr_t); -typedef int32_t (*iFEppppppipp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, int32_t, void*, void*); -typedef int32_t (*iFiiiiiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFpiipiiipip_t)(void*, int32_t, int32_t, void*, int32_t, int32_t, int32_t, void*, int32_t, void*); -typedef int32_t (*iFpippddiidd_t)(void*, int32_t, void*, void*, double, double, int32_t, int32_t, double, double); -typedef int32_t (*iFpCuWCCCCup_t)(void*, uint8_t, uint32_t, uint16_t, uint8_t, uint8_t, uint8_t, uint8_t, uint32_t, void*); -typedef int32_t (*iFpuuLiuiiLL_t)(void*, uint32_t, uint32_t, uintptr_t, int32_t, uint32_t, int32_t, int32_t, uintptr_t, uintptr_t); -typedef int32_t (*iFpLLpiiuuii_t)(void*, uintptr_t, uintptr_t, void*, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t); -typedef int32_t (*iFpLpLUUUUpL_t)(void*, uintptr_t, void*, uintptr_t, uint64_t, uint64_t, uint64_t, uint64_t, void*, uintptr_t); -typedef int32_t (*iFppuuiiiiii_t)(void*, void*, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef int32_t (*iFppuuiiuupi_t)(void*, void*, uint32_t, uint32_t, int32_t, int32_t, uint32_t, uint32_t, void*, int32_t); -typedef int32_t (*iFpppiiipipi_t)(void*, void*, void*, int32_t, int32_t, int32_t, void*, int32_t, void*, int32_t); -typedef int32_t (*iFpppLLipppp_t)(void*, void*, void*, uintptr_t, uintptr_t, int32_t, void*, void*, void*, void*); -typedef int32_t (*iFpppppiiuup_t)(void*, void*, void*, void*, void*, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef int32_t (*iFpppppppipi_t)(void*, void*, void*, void*, void*, void*, void*, int32_t, void*, int32_t); -typedef int32_t (*iFpppppppppu_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, uint32_t); -typedef uint32_t (*uFpddpippppp_t)(void*, double, double, void*, int32_t, void*, void*, void*, void*, void*); -typedef uint32_t (*uFpppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef intptr_t (*lFpLppdddddd_t)(void*, uintptr_t, void*, void*, double, double, double, double, double, double); -typedef void* (*pFEiippppppp_t)(x64emu_t*, int32_t, int32_t, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFEpiiiiiipp_t)(x64emu_t*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*, void*); -typedef void* (*pFEpippppppp_t)(x64emu_t*, void*, int32_t, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFpupLLLLLpp_t)(void*, uint32_t, void*, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, void*, void*); -typedef void* (*pFplllllllll_t)(void*, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t); -typedef void* (*pFppippLLLip_t)(void*, void*, int32_t, void*, void*, uintptr_t, uintptr_t, uintptr_t, int32_t, void*); -typedef void* (*pFppuiipuuii_t)(void*, void*, uint32_t, int32_t, int32_t, void*, uint32_t, uint32_t, int32_t, int32_t); -typedef void* (*pFppuuLLuppp_t)(void*, void*, uint32_t, uint32_t, uintptr_t, uintptr_t, uint32_t, void*, void*, void*); -typedef void* (*pFpppiiiiiii_t)(void*, void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void* (*pFpppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFbCuWCCuuCW_t)(void*, uint8_t, uint32_t, uint16_t, uint8_t, uint8_t, uint32_t, uint32_t, uint8_t, uint16_t); -typedef void* (*pFbuwwWWuCuu_t)(void*, uint32_t, int16_t, int16_t, uint16_t, uint16_t, uint32_t, uint8_t, uint32_t, uint32_t); -typedef void* (*pFbuuuwwwwWW_t)(void*, uint32_t, uint32_t, uint32_t, int16_t, int16_t, int16_t, int16_t, uint16_t, uint16_t); -typedef void* (*pFbuuuWWWCCi_t)(void*, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, uint16_t, uint8_t, uint8_t, int32_t); -typedef int32_t (*iWEpuipupppp_t)(x64emu_t*, void*, uint32_t, int32_t, void*, uint32_t, void*, void*, void*, void*); -typedef int32_t (*iWEpuuiiuipp_t)(x64emu_t*, void*, uint32_t, uint32_t, int32_t, int32_t, uint32_t, int32_t, void*, void*); -typedef int32_t (*iWEpuuuuiipp_t)(x64emu_t*, void*, uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t, void*, void*); -typedef void (*vFEpuuuupupup_t)(x64emu_t*, void*, uint32_t, uint32_t, uint32_t, uint32_t, void*, uint32_t, void*, uint32_t, void*); -typedef void (*vFiiiiillliip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t, int32_t, int32_t, void*); -typedef void (*vFiiiiilllilp_t)(int32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t, int32_t, intptr_t, void*); -typedef void (*vFuiiiiiiiiip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef void (*vFuiiiiiiiuip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, void*); -typedef void (*vFuiiiiiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuiiiillliip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t, int32_t, int32_t, void*); -typedef void (*vFuiuiiiiiuup_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuuiiiiiiuup_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuuupupppppp_t)(uint32_t, uint32_t, uint32_t, void*, uint32_t, void*, void*, void*, void*, void*, void*); -typedef void (*vFuuffiiffiip_t)(uint32_t, uint32_t, float, float, int32_t, int32_t, float, float, int32_t, int32_t, void*); -typedef void (*vFuufffffffff_t)(uint32_t, uint32_t, float, float, float, float, float, float, float, float, float); -typedef void (*vFuuddiiddiip_t)(uint32_t, uint32_t, double, double, int32_t, int32_t, double, double, int32_t, int32_t, void*); -typedef void (*vFuffffffffff_t)(uint32_t, float, float, float, float, float, float, float, float, float, float); -typedef void (*vFuLuuuuuuuuu_t)(uint32_t, uintptr_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFLufffffffff_t)(uintptr_t, uint32_t, float, float, float, float, float, float, float, float, float); -typedef void (*vFpipipiipiii_t)(void*, int32_t, void*, int32_t, void*, int32_t, int32_t, void*, int32_t, int32_t, int32_t); -typedef void (*vFpipppiiiipi_t)(void*, int32_t, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, void*, int32_t); -typedef void (*vFpupuuupupup_t)(void*, uint32_t, void*, uint32_t, uint32_t, uint32_t, void*, uint32_t, void*, uint32_t, void*); -typedef void (*vFppiiiiiiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppiiiiipiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, void*, int32_t, int32_t, int32_t); -typedef void (*vFppiiiiupiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, void*, int32_t, int32_t, int32_t); -typedef void (*vFppiiiiddddi_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, double, double, double, double, int32_t); -typedef void (*vFppiipppiiii_t)(void*, void*, int32_t, int32_t, void*, void*, void*, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppuuiiiiuii_t)(void*, void*, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, int32_t); -typedef void (*vFppuuppiiiiu_t)(void*, void*, uint32_t, uint32_t, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t); -typedef void (*vFppuupppiiii_t)(void*, void*, uint32_t, uint32_t, void*, void*, void*, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppupipiuuuu_t)(void*, void*, uint32_t, void*, int32_t, void*, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFppupppuiiii_t)(void*, void*, uint32_t, void*, void*, void*, uint32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFEiipppppppp_t)(x64emu_t*, int32_t, int32_t, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFEpppipppppp_t)(x64emu_t*, void*, void*, void*, int32_t, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFEppppiiiiuu_t)(x64emu_t*, void*, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); -typedef int32_t (*iFEpppppppppp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFiiiiiiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFpiippiiipip_t)(void*, int32_t, int32_t, void*, void*, int32_t, int32_t, int32_t, void*, int32_t, void*); -typedef int32_t (*iFpippupppppp_t)(void*, int32_t, void*, void*, uint32_t, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpuppppppppp_t)(void*, uint32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpLipiiiippp_t)(void*, uintptr_t, int32_t, void*, int32_t, int32_t, int32_t, int32_t, void*, void*, void*); -typedef int32_t (*iFpLLpiiuuiiL_t)(void*, uintptr_t, uintptr_t, void*, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, uintptr_t); -typedef int32_t (*iFppippipppip_t)(void*, void*, int32_t, void*, void*, int32_t, void*, void*, void*, int32_t, void*); -typedef int32_t (*iFppuppLLpupp_t)(void*, void*, uint32_t, void*, void*, uintptr_t, uintptr_t, void*, uint32_t, void*, void*); -typedef int32_t (*iFpppiiuuiiuu_t)(void*, void*, void*, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, uint32_t, uint32_t); -typedef int32_t (*iFpppppiiuupp_t)(void*, void*, void*, void*, void*, int32_t, int32_t, uint32_t, uint32_t, void*, void*); -typedef uint32_t (*uFEpLiupppLuV_t)(x64emu_t*, void*, uintptr_t, int32_t, uint32_t, void*, void*, void*, uintptr_t, uint32_t, void*); -typedef uint32_t (*uFEpLippppLup_t)(x64emu_t*, void*, uintptr_t, int32_t, void*, void*, void*, void*, uintptr_t, uint32_t, void*); -typedef uint32_t (*uFEpLippppLuA_t)(x64emu_t*, void*, uintptr_t, int32_t, void*, void*, void*, void*, uintptr_t, uint32_t, void*); -typedef uint32_t (*uFEppppppippp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, int32_t, void*, void*, void*); -typedef uint32_t (*uFppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFEpipppppppi_t)(x64emu_t*, void*, int32_t, void*, void*, void*, void*, void*, void*, void*, int32_t); -typedef void* (*pFEppiiLpppip_t)(x64emu_t*, void*, void*, int32_t, int32_t, uintptr_t, void*, void*, void*, int32_t, void*); -typedef void* (*pFEppuiipuuii_t)(x64emu_t*, void*, void*, uint32_t, int32_t, int32_t, void*, uint32_t, uint32_t, int32_t, int32_t); -typedef void* (*pFpppppppuipp_t)(void*, void*, void*, void*, void*, void*, void*, uint32_t, int32_t, void*, void*); -typedef void* (*pFppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iWEpuipuppppp_t)(x64emu_t*, void*, uint32_t, int32_t, void*, uint32_t, void*, void*, void*, void*, void*); -typedef int32_t (*iWEpuuiiuippu_t)(x64emu_t*, void*, uint32_t, uint32_t, int32_t, int32_t, uint32_t, int32_t, void*, void*, uint32_t); -typedef int32_t (*iWEpuuuuuiipp_t)(x64emu_t*, void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t, void*, void*); -typedef void (*vFuiiiiiiiiuLC_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uintptr_t, uint8_t); -typedef void (*vFuiiiiiiiuuip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, void*); -typedef void (*vFuuiiiiiiiiui_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t); -typedef void (*vFuuiiiiiiiiuu_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); -typedef void (*vFuuiiiiiiiuip_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, void*); -typedef void (*vFuuiiiiiiiuup_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuuuuuuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFffffffffffff_t)(float, float, float, float, float, float, float, float, float, float, float, float); -typedef void (*vFpipppiiiipii_t)(void*, int32_t, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, void*, int32_t, int32_t); -typedef void (*vFpippppiiiipi_t)(void*, int32_t, void*, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, void*, int32_t); -typedef void (*vFpupppppppppp_t)(void*, uint32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void (*vFppiiiiddddii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, double, double, double, double, int32_t, int32_t); -typedef void (*vFppiiuuuiupup_t)(void*, void*, int32_t, int32_t, uint32_t, uint32_t, uint32_t, int32_t, uint32_t, void*, uint32_t, void*); -typedef void (*vFppiipppiiiii_t)(void*, void*, int32_t, int32_t, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppuuppuiiiii_t)(void*, void*, uint32_t, uint32_t, void*, void*, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppuupppiiiiu_t)(void*, void*, uint32_t, uint32_t, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t); -typedef void (*vFpppiiiiiiiii_t)(void*, void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFpppiiiiiiuii_t)(void*, void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, int32_t); -typedef void (*vFpppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFEpppippppppp_t)(x64emu_t*, void*, void*, void*, int32_t, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFEppppiiiiuui_t)(x64emu_t*, void*, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t); -typedef int32_t (*iFpipllipppppp_t)(void*, int32_t, void*, intptr_t, intptr_t, int32_t, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpipppppppppp_t)(void*, int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpCCCWCWCCCWp_t)(void*, uint8_t, uint8_t, uint8_t, uint16_t, uint8_t, uint16_t, uint8_t, uint8_t, uint8_t, uint16_t, void*); -typedef int32_t (*iFpLLlliLppppp_t)(void*, uintptr_t, uintptr_t, intptr_t, intptr_t, int32_t, uintptr_t, void*, void*, void*, void*, void*); -typedef int32_t (*iFpppllipppppp_t)(void*, void*, void*, intptr_t, intptr_t, int32_t, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFEppiiuuuipii_t)(x64emu_t*, void*, void*, int32_t, int32_t, uint32_t, uint32_t, uint32_t, int32_t, void*, int32_t, int32_t); -typedef void* (*pFEppppppppppp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFWWiCCCCiipup_t)(uint16_t, uint16_t, int32_t, uint8_t, uint8_t, uint8_t, uint8_t, int32_t, int32_t, void*, uint32_t, void*); -typedef void* (*pFppiiuuuiupLp_t)(void*, void*, int32_t, int32_t, uint32_t, uint32_t, uint32_t, int32_t, uint32_t, void*, uintptr_t, void*); -typedef void* (*pFppippLLLiLpp_t)(void*, void*, int32_t, void*, void*, uintptr_t, uintptr_t, uintptr_t, int32_t, uintptr_t, void*, void*); -typedef void* (*pFppuuppppuppp_t)(void*, void*, uint32_t, uint32_t, void*, void*, void*, void*, uint32_t, void*, void*, void*); -typedef void* (*pFpppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFbCuuWWwwCCup_t)(void*, uint8_t, uint32_t, uint32_t, uint16_t, uint16_t, int16_t, int16_t, uint8_t, uint8_t, uint32_t, void*); -typedef void* (*pFbuuuWWWWWWWW_t)(void*, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t); -typedef void (*vFEpppppppiippp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, void*, int32_t, int32_t, void*, void*, void*); -typedef void (*vFuiiiiiiiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); -typedef void (*vFuuuuuuuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFuffffffffffff_t)(uint32_t, float, float, float, float, float, float, float, float, float, float, float, float); -typedef void (*vFuLuuuuuuuuuuu_t)(uint32_t, uintptr_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFpipppiiiiiiuu_t)(void*, int32_t, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); -typedef void (*vFpippppppppppp_t)(void*, int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void (*vFpuppppppppppp_t)(void*, uint32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void (*vFppiiiiiiiiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppiiiiiiuiuii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t); -typedef void (*vFppuuppiiiiuii_t)(void*, void*, uint32_t, uint32_t, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, int32_t); -typedef void (*vFppuupppuiiiii_t)(void*, void*, uint32_t, uint32_t, void*, void*, void*, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFddddpppddpppp_t)(double, double, double, double, void*, void*, void*, double, double, void*, void*, void*, void*); -typedef int32_t (*iFpippuuuiipppp_t)(void*, int32_t, void*, void*, uint32_t, uint32_t, uint32_t, int32_t, int32_t, void*, void*, void*, void*); -typedef int32_t (*iFpupiiiipppppp_t)(void*, uint32_t, void*, int32_t, int32_t, int32_t, int32_t, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFppppppLLLLupp_t)(void*, void*, void*, void*, void*, void*, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uint32_t, void*, void*); -typedef uint32_t (*uFippuuuulllipp_t)(int32_t, void*, void*, uint32_t, uint32_t, uint32_t, uint32_t, intptr_t, intptr_t, intptr_t, int32_t, void*, void*); -typedef uint32_t (*uFpppppuupppppp_t)(void*, void*, void*, void*, void*, uint32_t, uint32_t, void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFbCuuwwWWWWuup_t)(void*, uint8_t, uint32_t, uint32_t, int16_t, int16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint32_t, void*); -typedef void* (*pFpuupppwwwwWWC_t)(void*, uint32_t, uint32_t, void*, void*, void*, int16_t, int16_t, int16_t, int16_t, uint16_t, uint16_t, uint8_t); -typedef void* (*pFppLppppiiLpip_t)(void*, void*, uintptr_t, void*, void*, void*, void*, int32_t, int32_t, uintptr_t, void*, int32_t, void*); -typedef void* (*pFpppppppuipppp_t)(void*, void*, void*, void*, void*, void*, void*, uint32_t, int32_t, void*, void*, void*, void*); -typedef void* (*pFppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void (*vFippppppppppppp_t)(int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void (*vFuffiiffiiffiip_t)(uint32_t, float, float, int32_t, int32_t, float, float, int32_t, int32_t, float, float, int32_t, int32_t, void*); -typedef void (*vFuddiiddiiddiip_t)(uint32_t, double, double, int32_t, int32_t, double, double, int32_t, int32_t, double, double, int32_t, int32_t, void*); -typedef void (*vFppiipppiiiiiii_t)(void*, void*, int32_t, int32_t, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppuupppiiiiuii_t)(void*, void*, uint32_t, uint32_t, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, int32_t); -typedef int32_t (*iFpipppppppppppp_t)(void*, int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFppupppLLLLpupp_t)(void*, void*, uint32_t, void*, void*, void*, uintptr_t, uintptr_t, uintptr_t, uintptr_t, void*, uint32_t, void*, void*); -typedef int32_t (*iFpppwwWWwwWWpuu_t)(void*, void*, void*, int16_t, int16_t, uint16_t, uint16_t, int16_t, int16_t, uint16_t, uint16_t, void*, uint32_t, uint32_t); -typedef void* (*pFbpCpppwwwwwwWW_t)(void*, void*, uint8_t, void*, void*, void*, int16_t, int16_t, int16_t, int16_t, int16_t, int16_t, uint16_t, uint16_t); -typedef void (*vFuiiiiiuiiiiilll_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t); -typedef void (*vFuuiiiiuuiiiiiii_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFfffffffffffffff_t)(float, float, float, float, float, float, float, float, float, float, float, float, float, float, float); -typedef void (*vFpUUUUUUUUUUUuuu_t)(void*, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint32_t, uint32_t, uint32_t); -typedef void (*vFpppippppppppppp_t)(void*, void*, void*, int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void (*vFppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFpuiippppppppppp_t)(void*, uint32_t, int32_t, int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFppipppppppppppp_t)(void*, void*, int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void (*vFpppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFppipipipipipipip_t)(void*, void*, int32_t, void*, int32_t, void*, int32_t, void*, int32_t, void*, int32_t, void*, int32_t, void*, int32_t, void*); -typedef void* (*pFpppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFbuuWWWWWWwwCCCuu_t)(void*, uint32_t, uint32_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, int16_t, int16_t, uint8_t, uint8_t, uint8_t, uint32_t, uint32_t); -typedef void (*vFuuuiiiiiuiiiiilll_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t); -typedef void (*vFuuuuiiiiuuiiiiiii_t)(uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFppiiiiddddiiiiiuu_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, double, double, double, double, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); -typedef void (*vFpppuppiipppuUUUpi_t)(void*, void*, void*, uint32_t, void*, void*, int32_t, int32_t, void*, void*, void*, uint32_t, uint64_t, uint64_t, uint64_t, void*, int32_t); -typedef void* (*pFppippipipipipipip_t)(void*, void*, int32_t, void*, void*, int32_t, void*, int32_t, void*, int32_t, void*, int32_t, void*, int32_t, void*, int32_t, void*); -typedef void* (*pFbuuuuuwwuuuuUUUup_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, int16_t, int16_t, uint32_t, uint32_t, uint32_t, uint32_t, uint64_t, uint64_t, uint64_t, uint32_t, void*); -typedef void (*vFppuiiiiipuiiiiiiii_t)(void*, void*, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef void (*vFpppipppppppppppppp_t)(void*, void*, void*, int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpppppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef uintptr_t (*LFpppppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFippppppppppppppppp_t)(int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFpupppppppppppppppp_t)(void*, uint32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void (*vFpiiiiiiiiiiiiiiiiii_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); -typedef uint32_t (*uFbWWWCCCCCCCCWCCCCCC_t)(void*, uint16_t, uint16_t, uint16_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint16_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t); -typedef void* (*pFiiiippppppppppppppp_t)(int32_t, int32_t, int32_t, int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFpippppppppppppppppp_t)(void*, int32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFpupupppppppppppppppp_t)(void*, uint32_t, void*, uint32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpppppppppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef uint32_t (*uFippuuuuiiiiuuiiiiiiiipp_t)(int32_t, void*, void*, uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*, void*); -typedef void (*vFpppppppppppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef void* (*pFpupuupppppppppppppppppppp_t)(void*, uint32_t, void*, uint32_t, uint32_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); -typedef int32_t (*iFpppppppppppppppppppppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); - -#if defined(HAVE_LD80BITS) -typedef long double (*DFD_t)(long double); -typedef long double (*DFY_t)(complexl_t); -typedef intptr_t (*lFD_t)(long double); -typedef complexl_t (*YFY_t)(complexl_t); -typedef int64_t (*IFED_t)(x64emu_t*, long double); -typedef long double (*DFiD_t)(int32_t, long double); -typedef intptr_t (*lFDD_t)(long double, long double); -typedef complexl_t (*YFYY_t)(complexl_t, complexl_t); -typedef void (*vFDpp_t)(long double, void*, void*); -typedef long double (*DFDDD_t)(long double, long double, long double); -#endif - -#if !defined(HAVE_LD80BITS) -typedef double (*KFK_t)(double); -typedef double (*KFy_t)(complex_t); -typedef intptr_t (*lFK_t)(double); -typedef complex_t (*yFy_t)(complex_t); -typedef int64_t (*IFEK_t)(x64emu_t*, double); -typedef double (*KFiK_t)(int32_t, double); -typedef double (*KFKK_t)(double, double); -typedef double (*KFKp_t)(double, void*); -typedef intptr_t (*lFKK_t)(double, double); -typedef complex_t (*yFyy_t)(complex_t, complex_t); -typedef void (*vFKpp_t)(double, void*, void*); -typedef double (*KFKKK_t)(double, double, double); -#endif - -#if defined(NOALIGN) -typedef int32_t (*iFipiip_t)(int32_t, void*, int32_t, int32_t, void*); -#endif - -#if !defined(NOALIGN) -typedef int32_t (*iFEppu_t)(x64emu_t*, void*, void*, uint32_t); -typedef int32_t (*iFEiiip_t)(x64emu_t*, int32_t, int32_t, int32_t, void*); -typedef int32_t (*iFEipii_t)(x64emu_t*, int32_t, void*, int32_t, int32_t); -typedef int32_t (*iFEipiip_t)(x64emu_t*, int32_t, void*, int32_t, int32_t, void*); -#endif - -#if !defined(STATICBUILD) -typedef int32_t (*iFlip_t)(intptr_t, int32_t, void*); -typedef int32_t (*iFLLi_t)(uintptr_t, uintptr_t, int32_t); -typedef int32_t (*iFLLiW_t)(uintptr_t, uintptr_t, int32_t, uint16_t); -typedef int32_t (*iFEipup_t)(x64emu_t*, int32_t, void*, uint32_t, void*); -typedef int32_t (*iFEiipup_t)(x64emu_t*, int32_t, int32_t, void*, uint32_t, void*); -typedef int32_t (*iFpipppL_t)(void*, int32_t, void*, void*, void*, uintptr_t); -#endif - -void vFE(x64emu_t *emu, uintptr_t fcn) { vFE_t fn = (vFE_t)fcn; fn(emu); } -void vFv(x64emu_t *emu, uintptr_t fcn) { vFv_t fn = (vFv_t)fcn; fn(); (void)emu; } -void vFc(x64emu_t *emu, uintptr_t fcn) { vFc_t fn = (vFc_t)fcn; fn((int8_t)R_RDI); } -void vFw(x64emu_t *emu, uintptr_t fcn) { vFw_t fn = (vFw_t)fcn; fn((int16_t)R_RDI); } -void vFi(x64emu_t *emu, uintptr_t fcn) { vFi_t fn = (vFi_t)fcn; fn((int32_t)R_RDI); } -void vFC(x64emu_t *emu, uintptr_t fcn) { vFC_t fn = (vFC_t)fcn; fn((uint8_t)R_RDI); } -void vFW(x64emu_t *emu, uintptr_t fcn) { vFW_t fn = (vFW_t)fcn; fn((uint16_t)R_RDI); } -void vFu(x64emu_t *emu, uintptr_t fcn) { vFu_t fn = (vFu_t)fcn; fn((uint32_t)R_RDI); } -void vFU(x64emu_t *emu, uintptr_t fcn) { vFU_t fn = (vFU_t)fcn; fn((uint64_t)R_RDI); } -void vFf(x64emu_t *emu, uintptr_t fcn) { vFf_t fn = (vFf_t)fcn; fn(emu->xmm[0].f[0]); } -void vFd(x64emu_t *emu, uintptr_t fcn) { vFd_t fn = (vFd_t)fcn; fn(emu->xmm[0].d[0]); } -void vFl(x64emu_t *emu, uintptr_t fcn) { vFl_t fn = (vFl_t)fcn; fn((intptr_t)R_RDI); } -void vFL(x64emu_t *emu, uintptr_t fcn) { vFL_t fn = (vFL_t)fcn; fn((uintptr_t)R_RDI); } -void vFp(x64emu_t *emu, uintptr_t fcn) { vFp_t fn = (vFp_t)fcn; fn((void*)R_RDI); } -void vFS(x64emu_t *emu, uintptr_t fcn) { vFS_t fn = (vFS_t)fcn; fn(io_convert((void*)R_RDI)); } -void vFb(x64emu_t *emu, uintptr_t fcn) { vFb_t fn = (vFb_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); fn(aligned_xcb); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void cFv(x64emu_t *emu, uintptr_t fcn) { cFv_t fn = (cFv_t)fcn; R_RAX=fn(); } -void cFi(x64emu_t *emu, uintptr_t fcn) { cFi_t fn = (cFi_t)fcn; R_RAX=fn((int32_t)R_RDI); } -void cFu(x64emu_t *emu, uintptr_t fcn) { cFu_t fn = (cFu_t)fcn; R_RAX=fn((uint32_t)R_RDI); } -void cFf(x64emu_t *emu, uintptr_t fcn) { cFf_t fn = (cFf_t)fcn; R_RAX=fn(emu->xmm[0].f[0]); } -void cFp(x64emu_t *emu, uintptr_t fcn) { cFp_t fn = (cFp_t)fcn; R_RAX=fn((void*)R_RDI); } -void wFp(x64emu_t *emu, uintptr_t fcn) { wFp_t fn = (wFp_t)fcn; R_RAX=fn((void*)R_RDI); } -void iFE(x64emu_t *emu, uintptr_t fcn) { iFE_t fn = (iFE_t)fcn; R_RAX=(int32_t)fn(emu); } -void iFv(x64emu_t *emu, uintptr_t fcn) { iFv_t fn = (iFv_t)fcn; R_RAX=(int32_t)fn(); } -void iFw(x64emu_t *emu, uintptr_t fcn) { iFw_t fn = (iFw_t)fcn; R_RAX=(int32_t)fn((int16_t)R_RDI); } -void iFi(x64emu_t *emu, uintptr_t fcn) { iFi_t fn = (iFi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI); } -void iFI(x64emu_t *emu, uintptr_t fcn) { iFI_t fn = (iFI_t)fcn; R_RAX=(int32_t)fn((int64_t)R_RDI); } -void iFC(x64emu_t *emu, uintptr_t fcn) { iFC_t fn = (iFC_t)fcn; R_RAX=(int32_t)fn((uint8_t)R_RDI); } -void iFW(x64emu_t *emu, uintptr_t fcn) { iFW_t fn = (iFW_t)fcn; R_RAX=(int32_t)fn((uint16_t)R_RDI); } -void iFu(x64emu_t *emu, uintptr_t fcn) { iFu_t fn = (iFu_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI); } -void iFU(x64emu_t *emu, uintptr_t fcn) { iFU_t fn = (iFU_t)fcn; R_RAX=(int32_t)fn((uint64_t)R_RDI); } -void iFf(x64emu_t *emu, uintptr_t fcn) { iFf_t fn = (iFf_t)fcn; R_RAX=(int32_t)fn(emu->xmm[0].f[0]); } -void iFd(x64emu_t *emu, uintptr_t fcn) { iFd_t fn = (iFd_t)fcn; R_RAX=(int32_t)fn(emu->xmm[0].d[0]); } -void iFD(x64emu_t *emu, uintptr_t fcn) { iFD_t fn = (iFD_t)fcn; R_RAX=(int32_t)fn(LD2localLD((void*)(R_RSP + 8))); } -void iFl(x64emu_t *emu, uintptr_t fcn) { iFl_t fn = (iFl_t)fcn; R_RAX=(int32_t)fn((intptr_t)R_RDI); } -void iFL(x64emu_t *emu, uintptr_t fcn) { iFL_t fn = (iFL_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI); } -void iFp(x64emu_t *emu, uintptr_t fcn) { iFp_t fn = (iFp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI); } -void iFO(x64emu_t *emu, uintptr_t fcn) { iFO_t fn = (iFO_t)fcn; R_RAX=(int32_t)fn(of_convert((int32_t)R_RDI)); } -void iFS(x64emu_t *emu, uintptr_t fcn) { iFS_t fn = (iFS_t)fcn; R_RAX=(int32_t)fn(io_convert((void*)R_RDI)); } -void iFP(x64emu_t *emu, uintptr_t fcn) { iFP_t fn = (iFP_t)fcn; R_RAX=(int32_t)fn(*(void**)(R_RSP + 8)); } -void iFb(x64emu_t *emu, uintptr_t fcn) { iFb_t fn = (iFb_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(int32_t)fn(aligned_xcb); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void IFv(x64emu_t *emu, uintptr_t fcn) { IFv_t fn = (IFv_t)fcn; R_RAX=(int64_t)fn(); } -void IFi(x64emu_t *emu, uintptr_t fcn) { IFi_t fn = (IFi_t)fcn; R_RAX=(int64_t)fn((int32_t)R_RDI); } -void IFI(x64emu_t *emu, uintptr_t fcn) { IFI_t fn = (IFI_t)fcn; R_RAX=(int64_t)fn((int64_t)R_RDI); } -void IFf(x64emu_t *emu, uintptr_t fcn) { IFf_t fn = (IFf_t)fcn; R_RAX=(int64_t)fn(emu->xmm[0].f[0]); } -void IFd(x64emu_t *emu, uintptr_t fcn) { IFd_t fn = (IFd_t)fcn; R_RAX=(int64_t)fn(emu->xmm[0].d[0]); } -void IFp(x64emu_t *emu, uintptr_t fcn) { IFp_t fn = (IFp_t)fcn; R_RAX=(int64_t)fn((void*)R_RDI); } -void CFv(x64emu_t *emu, uintptr_t fcn) { CFv_t fn = (CFv_t)fcn; R_RAX=(unsigned char)fn(); } -void CFi(x64emu_t *emu, uintptr_t fcn) { CFi_t fn = (CFi_t)fcn; R_RAX=(unsigned char)fn((int32_t)R_RDI); } -void CFC(x64emu_t *emu, uintptr_t fcn) { CFC_t fn = (CFC_t)fcn; R_RAX=(unsigned char)fn((uint8_t)R_RDI); } -void CFW(x64emu_t *emu, uintptr_t fcn) { CFW_t fn = (CFW_t)fcn; R_RAX=(unsigned char)fn((uint16_t)R_RDI); } -void CFu(x64emu_t *emu, uintptr_t fcn) { CFu_t fn = (CFu_t)fcn; R_RAX=(unsigned char)fn((uint32_t)R_RDI); } -void CFl(x64emu_t *emu, uintptr_t fcn) { CFl_t fn = (CFl_t)fcn; R_RAX=(unsigned char)fn((intptr_t)R_RDI); } -void CFL(x64emu_t *emu, uintptr_t fcn) { CFL_t fn = (CFL_t)fcn; R_RAX=(unsigned char)fn((uintptr_t)R_RDI); } -void CFp(x64emu_t *emu, uintptr_t fcn) { CFp_t fn = (CFp_t)fcn; R_RAX=(unsigned char)fn((void*)R_RDI); } -void WFi(x64emu_t *emu, uintptr_t fcn) { WFi_t fn = (WFi_t)fcn; R_RAX=(unsigned short)fn((int32_t)R_RDI); } -void WFW(x64emu_t *emu, uintptr_t fcn) { WFW_t fn = (WFW_t)fcn; R_RAX=(unsigned short)fn((uint16_t)R_RDI); } -void WFu(x64emu_t *emu, uintptr_t fcn) { WFu_t fn = (WFu_t)fcn; R_RAX=(unsigned short)fn((uint32_t)R_RDI); } -void WFp(x64emu_t *emu, uintptr_t fcn) { WFp_t fn = (WFp_t)fcn; R_RAX=(unsigned short)fn((void*)R_RDI); } -void uFv(x64emu_t *emu, uintptr_t fcn) { uFv_t fn = (uFv_t)fcn; R_RAX=(uint32_t)fn(); } -void uFi(x64emu_t *emu, uintptr_t fcn) { uFi_t fn = (uFi_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI); } -void uFu(x64emu_t *emu, uintptr_t fcn) { uFu_t fn = (uFu_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI); } -void uFd(x64emu_t *emu, uintptr_t fcn) { uFd_t fn = (uFd_t)fcn; R_RAX=(uint32_t)fn(emu->xmm[0].d[0]); } -void uFl(x64emu_t *emu, uintptr_t fcn) { uFl_t fn = (uFl_t)fcn; R_RAX=(uint32_t)fn((intptr_t)R_RDI); } -void uFL(x64emu_t *emu, uintptr_t fcn) { uFL_t fn = (uFL_t)fcn; R_RAX=(uint32_t)fn((uintptr_t)R_RDI); } -void uFp(x64emu_t *emu, uintptr_t fcn) { uFp_t fn = (uFp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI); } -void uFb(x64emu_t *emu, uintptr_t fcn) { uFb_t fn = (uFb_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void UFv(x64emu_t *emu, uintptr_t fcn) { UFv_t fn = (UFv_t)fcn; R_RAX=fn(); } -void UFu(x64emu_t *emu, uintptr_t fcn) { UFu_t fn = (UFu_t)fcn; R_RAX=fn((uint32_t)R_RDI); } -void UFp(x64emu_t *emu, uintptr_t fcn) { UFp_t fn = (UFp_t)fcn; R_RAX=fn((void*)R_RDI); } -void fFi(x64emu_t *emu, uintptr_t fcn) { fFi_t fn = (fFi_t)fcn; emu->xmm[0].f[0]=fn((int32_t)R_RDI); } -void fFf(x64emu_t *emu, uintptr_t fcn) { fFf_t fn = (fFf_t)fcn; emu->xmm[0].f[0]=fn(emu->xmm[0].f[0]); } -void fFp(x64emu_t *emu, uintptr_t fcn) { fFp_t fn = (fFp_t)fcn; emu->xmm[0].f[0]=fn((void*)R_RDI); } -void dFv(x64emu_t *emu, uintptr_t fcn) { dFv_t fn = (dFv_t)fcn; emu->xmm[0].d[0]=fn(); } -void dFi(x64emu_t *emu, uintptr_t fcn) { dFi_t fn = (dFi_t)fcn; emu->xmm[0].d[0]=fn((int32_t)R_RDI); } -void dFu(x64emu_t *emu, uintptr_t fcn) { dFu_t fn = (dFu_t)fcn; emu->xmm[0].d[0]=fn((uint32_t)R_RDI); } -void dFd(x64emu_t *emu, uintptr_t fcn) { dFd_t fn = (dFd_t)fcn; emu->xmm[0].d[0]=fn(emu->xmm[0].d[0]); } -void dFL(x64emu_t *emu, uintptr_t fcn) { dFL_t fn = (dFL_t)fcn; emu->xmm[0].d[0]=fn((uintptr_t)R_RDI); } -void dFp(x64emu_t *emu, uintptr_t fcn) { dFp_t fn = (dFp_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI); } -void lFE(x64emu_t *emu, uintptr_t fcn) { lFE_t fn = (lFE_t)fcn; R_RAX=(intptr_t)fn(emu); } -void lFv(x64emu_t *emu, uintptr_t fcn) { lFv_t fn = (lFv_t)fcn; R_RAX=(intptr_t)fn(); } -void lFi(x64emu_t *emu, uintptr_t fcn) { lFi_t fn = (lFi_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI); } -void lFu(x64emu_t *emu, uintptr_t fcn) { lFu_t fn = (lFu_t)fcn; R_RAX=(intptr_t)fn((uint32_t)R_RDI); } -void lFl(x64emu_t *emu, uintptr_t fcn) { lFl_t fn = (lFl_t)fcn; R_RAX=(intptr_t)fn((intptr_t)R_RDI); } -void lFp(x64emu_t *emu, uintptr_t fcn) { lFp_t fn = (lFp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI); } -void LFv(x64emu_t *emu, uintptr_t fcn) { LFv_t fn = (LFv_t)fcn; R_RAX=(uintptr_t)fn(); } -void LFi(x64emu_t *emu, uintptr_t fcn) { LFi_t fn = (LFi_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI); } -void LFu(x64emu_t *emu, uintptr_t fcn) { LFu_t fn = (LFu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI); } -void LFd(x64emu_t *emu, uintptr_t fcn) { LFd_t fn = (LFd_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0]); } -void LFL(x64emu_t *emu, uintptr_t fcn) { LFL_t fn = (LFL_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI); } -void LFp(x64emu_t *emu, uintptr_t fcn) { LFp_t fn = (LFp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI); } -void pFE(x64emu_t *emu, uintptr_t fcn) { pFE_t fn = (pFE_t)fcn; R_RAX=(uintptr_t)fn(emu); } -void pFv(x64emu_t *emu, uintptr_t fcn) { pFv_t fn = (pFv_t)fcn; R_RAX=(uintptr_t)fn(); } -void pFw(x64emu_t *emu, uintptr_t fcn) { pFw_t fn = (pFw_t)fcn; R_RAX=(uintptr_t)fn((int16_t)R_RDI); } -void pFi(x64emu_t *emu, uintptr_t fcn) { pFi_t fn = (pFi_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI); } -void pFC(x64emu_t *emu, uintptr_t fcn) { pFC_t fn = (pFC_t)fcn; R_RAX=(uintptr_t)fn((uint8_t)R_RDI); } -void pFW(x64emu_t *emu, uintptr_t fcn) { pFW_t fn = (pFW_t)fcn; R_RAX=(uintptr_t)fn((uint16_t)R_RDI); } -void pFu(x64emu_t *emu, uintptr_t fcn) { pFu_t fn = (pFu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI); } -void pFU(x64emu_t *emu, uintptr_t fcn) { pFU_t fn = (pFU_t)fcn; R_RAX=(uintptr_t)fn((uint64_t)R_RDI); } -void pFd(x64emu_t *emu, uintptr_t fcn) { pFd_t fn = (pFd_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0]); } -void pFl(x64emu_t *emu, uintptr_t fcn) { pFl_t fn = (pFl_t)fcn; R_RAX=(uintptr_t)fn((intptr_t)R_RDI); } -void pFL(x64emu_t *emu, uintptr_t fcn) { pFL_t fn = (pFL_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI); } -void pFp(x64emu_t *emu, uintptr_t fcn) { pFp_t fn = (pFp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI); } -void pFV(x64emu_t *emu, uintptr_t fcn) { pFV_t fn = (pFV_t)fcn; R_RAX=(uintptr_t)fn((void*)(R_RSP + 8)); } -void pFA(x64emu_t *emu, uintptr_t fcn) { pFA_t fn = (pFA_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI); } -void pFb(x64emu_t *emu, uintptr_t fcn) { pFb_t fn = (pFb_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void HFi(x64emu_t *emu, uintptr_t fcn) { HFi_t fn = (HFi_t)fcn; unsigned __int128 u128 = fn((int32_t)R_RDI); R_RAX=(u128&0xFFFFFFFFFFFFFFFFL); R_RDX=(u128>>64)&0xFFFFFFFFFFFFFFFFL; } -void HFp(x64emu_t *emu, uintptr_t fcn) { HFp_t fn = (HFp_t)fcn; unsigned __int128 u128 = fn((void*)R_RDI); R_RAX=(u128&0xFFFFFFFFFFFFFFFFL); R_RDX=(u128>>64)&0xFFFFFFFFFFFFFFFFL; } -void xFx(x64emu_t *emu, uintptr_t fcn) { xFx_t fn = (xFx_t)fcn; from_complexf(emu, fn(to_complexf(emu, 0))); } -void XFX(x64emu_t *emu, uintptr_t fcn) { XFX_t fn = (XFX_t)fcn; from_complex(emu, fn(to_complex(emu, 0))); } -void vWp(x64emu_t *emu, uintptr_t fcn) { vWp_t fn = (vWp_t)fcn; fn((void*)R_RCX); } -void iWp(x64emu_t *emu, uintptr_t fcn) { iWp_t fn = (iWp_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX); } -void uWp(x64emu_t *emu, uintptr_t fcn) { uWp_t fn = (uWp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RCX); } -void fWp(x64emu_t *emu, uintptr_t fcn) { fWp_t fn = (fWp_t)fcn; emu->xmm[0].f[0]=fn((void*)R_RCX); } -void vFEi(x64emu_t *emu, uintptr_t fcn) { vFEi_t fn = (vFEi_t)fcn; fn(emu, (int32_t)R_RDI); } -void vFEp(x64emu_t *emu, uintptr_t fcn) { vFEp_t fn = (vFEp_t)fcn; fn(emu, (void*)R_RDI); } -void vFcc(x64emu_t *emu, uintptr_t fcn) { vFcc_t fn = (vFcc_t)fcn; fn((int8_t)R_RDI, (int8_t)R_RSI); } -void vFww(x64emu_t *emu, uintptr_t fcn) { vFww_t fn = (vFww_t)fcn; fn((int16_t)R_RDI, (int16_t)R_RSI); } -void vFii(x64emu_t *emu, uintptr_t fcn) { vFii_t fn = (vFii_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI); } -void vFiW(x64emu_t *emu, uintptr_t fcn) { vFiW_t fn = (vFiW_t)fcn; fn((int32_t)R_RDI, (uint16_t)R_RSI); } -void vFiu(x64emu_t *emu, uintptr_t fcn) { vFiu_t fn = (vFiu_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI); } -void vFiU(x64emu_t *emu, uintptr_t fcn) { vFiU_t fn = (vFiU_t)fcn; fn((int32_t)R_RDI, (uint64_t)R_RSI); } -void vFif(x64emu_t *emu, uintptr_t fcn) { vFif_t fn = (vFif_t)fcn; fn((int32_t)R_RDI, emu->xmm[0].f[0]); } -void vFid(x64emu_t *emu, uintptr_t fcn) { vFid_t fn = (vFid_t)fcn; fn((int32_t)R_RDI, emu->xmm[0].d[0]); } -void vFil(x64emu_t *emu, uintptr_t fcn) { vFil_t fn = (vFil_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI); } -void vFiL(x64emu_t *emu, uintptr_t fcn) { vFiL_t fn = (vFiL_t)fcn; fn((int32_t)R_RDI, (uintptr_t)R_RSI); } -void vFip(x64emu_t *emu, uintptr_t fcn) { vFip_t fn = (vFip_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI); } -void vFWW(x64emu_t *emu, uintptr_t fcn) { vFWW_t fn = (vFWW_t)fcn; fn((uint16_t)R_RDI, (uint16_t)R_RSI); } -void vFWp(x64emu_t *emu, uintptr_t fcn) { vFWp_t fn = (vFWp_t)fcn; fn((uint16_t)R_RDI, (void*)R_RSI); } -void vFuc(x64emu_t *emu, uintptr_t fcn) { vFuc_t fn = (vFuc_t)fcn; fn((uint32_t)R_RDI, (int8_t)R_RSI); } -void vFuw(x64emu_t *emu, uintptr_t fcn) { vFuw_t fn = (vFuw_t)fcn; fn((uint32_t)R_RDI, (int16_t)R_RSI); } -void vFui(x64emu_t *emu, uintptr_t fcn) { vFui_t fn = (vFui_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI); } -void vFuC(x64emu_t *emu, uintptr_t fcn) { vFuC_t fn = (vFuC_t)fcn; fn((uint32_t)R_RDI, (uint8_t)R_RSI); } -void vFuW(x64emu_t *emu, uintptr_t fcn) { vFuW_t fn = (vFuW_t)fcn; fn((uint32_t)R_RDI, (uint16_t)R_RSI); } -void vFuu(x64emu_t *emu, uintptr_t fcn) { vFuu_t fn = (vFuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI); } -void vFuU(x64emu_t *emu, uintptr_t fcn) { vFuU_t fn = (vFuU_t)fcn; fn((uint32_t)R_RDI, (uint64_t)R_RSI); } -void vFuf(x64emu_t *emu, uintptr_t fcn) { vFuf_t fn = (vFuf_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0]); } -void vFud(x64emu_t *emu, uintptr_t fcn) { vFud_t fn = (vFud_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].d[0]); } -void vFul(x64emu_t *emu, uintptr_t fcn) { vFul_t fn = (vFul_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI); } -void vFuL(x64emu_t *emu, uintptr_t fcn) { vFuL_t fn = (vFuL_t)fcn; fn((uint32_t)R_RDI, (uintptr_t)R_RSI); } -void vFup(x64emu_t *emu, uintptr_t fcn) { vFup_t fn = (vFup_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI); } -void vFUi(x64emu_t *emu, uintptr_t fcn) { vFUi_t fn = (vFUi_t)fcn; fn((uint64_t)R_RDI, (int32_t)R_RSI); } -void vFfi(x64emu_t *emu, uintptr_t fcn) { vFfi_t fn = (vFfi_t)fcn; fn(emu->xmm[0].f[0], (int32_t)R_RDI); } -void vFfC(x64emu_t *emu, uintptr_t fcn) { vFfC_t fn = (vFfC_t)fcn; fn(emu->xmm[0].f[0], (uint8_t)R_RDI); } -void vFff(x64emu_t *emu, uintptr_t fcn) { vFff_t fn = (vFff_t)fcn; fn(emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void vFfp(x64emu_t *emu, uintptr_t fcn) { vFfp_t fn = (vFfp_t)fcn; fn(emu->xmm[0].f[0], (void*)R_RDI); } -void vFdd(x64emu_t *emu, uintptr_t fcn) { vFdd_t fn = (vFdd_t)fcn; fn(emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void vFlu(x64emu_t *emu, uintptr_t fcn) { vFlu_t fn = (vFlu_t)fcn; fn((intptr_t)R_RDI, (uint32_t)R_RSI); } -void vFlp(x64emu_t *emu, uintptr_t fcn) { vFlp_t fn = (vFlp_t)fcn; fn((intptr_t)R_RDI, (void*)R_RSI); } -void vFLu(x64emu_t *emu, uintptr_t fcn) { vFLu_t fn = (vFLu_t)fcn; fn((uintptr_t)R_RDI, (uint32_t)R_RSI); } -void vFLL(x64emu_t *emu, uintptr_t fcn) { vFLL_t fn = (vFLL_t)fcn; fn((uintptr_t)R_RDI, (uintptr_t)R_RSI); } -void vFLp(x64emu_t *emu, uintptr_t fcn) { vFLp_t fn = (vFLp_t)fcn; fn((uintptr_t)R_RDI, (void*)R_RSI); } -void vFpc(x64emu_t *emu, uintptr_t fcn) { vFpc_t fn = (vFpc_t)fcn; fn((void*)R_RDI, (int8_t)R_RSI); } -void vFpi(x64emu_t *emu, uintptr_t fcn) { vFpi_t fn = (vFpi_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI); } -void vFpI(x64emu_t *emu, uintptr_t fcn) { vFpI_t fn = (vFpI_t)fcn; fn((void*)R_RDI, (int64_t)R_RSI); } -void vFpC(x64emu_t *emu, uintptr_t fcn) { vFpC_t fn = (vFpC_t)fcn; fn((void*)R_RDI, (uint8_t)R_RSI); } -void vFpW(x64emu_t *emu, uintptr_t fcn) { vFpW_t fn = (vFpW_t)fcn; fn((void*)R_RDI, (uint16_t)R_RSI); } -void vFpu(x64emu_t *emu, uintptr_t fcn) { vFpu_t fn = (vFpu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI); } -void vFpU(x64emu_t *emu, uintptr_t fcn) { vFpU_t fn = (vFpU_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI); } -void vFpf(x64emu_t *emu, uintptr_t fcn) { vFpf_t fn = (vFpf_t)fcn; fn((void*)R_RDI, emu->xmm[0].f[0]); } -void vFpd(x64emu_t *emu, uintptr_t fcn) { vFpd_t fn = (vFpd_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0]); } -void vFpl(x64emu_t *emu, uintptr_t fcn) { vFpl_t fn = (vFpl_t)fcn; fn((void*)R_RDI, (intptr_t)R_RSI); } -void vFpL(x64emu_t *emu, uintptr_t fcn) { vFpL_t fn = (vFpL_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI); } -void vFpp(x64emu_t *emu, uintptr_t fcn) { vFpp_t fn = (vFpp_t)fcn; fn((void*)R_RDI, (void*)R_RSI); } -void vFpV(x64emu_t *emu, uintptr_t fcn) { vFpV_t fn = (vFpV_t)fcn; fn((void*)R_RDI, (void*)(R_RSP + 8)); } -void vFpS(x64emu_t *emu, uintptr_t fcn) { vFpS_t fn = (vFpS_t)fcn; fn((void*)R_RDI, io_convert((void*)R_RSI)); } -void vFSi(x64emu_t *emu, uintptr_t fcn) { vFSi_t fn = (vFSi_t)fcn; fn(io_convert((void*)R_RDI), (int32_t)R_RSI); } -void vFbi(x64emu_t *emu, uintptr_t fcn) { vFbi_t fn = (vFbi_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); fn(aligned_xcb, (int32_t)R_RSI); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void vFbu(x64emu_t *emu, uintptr_t fcn) { vFbu_t fn = (vFbu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); fn(aligned_xcb, (uint32_t)R_RSI); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void vFbU(x64emu_t *emu, uintptr_t fcn) { vFbU_t fn = (vFbU_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); fn(aligned_xcb, (uint64_t)R_RSI); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void vFbp(x64emu_t *emu, uintptr_t fcn) { vFbp_t fn = (vFbp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); fn(aligned_xcb, (void*)R_RSI); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void cFpi(x64emu_t *emu, uintptr_t fcn) { cFpi_t fn = (cFpi_t)fcn; R_RAX=fn((void*)R_RDI, (int32_t)R_RSI); } -void cFpp(x64emu_t *emu, uintptr_t fcn) { cFpp_t fn = (cFpp_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI); } -void wFpi(x64emu_t *emu, uintptr_t fcn) { wFpi_t fn = (wFpi_t)fcn; R_RAX=fn((void*)R_RDI, (int32_t)R_RSI); } -void iFEi(x64emu_t *emu, uintptr_t fcn) { iFEi_t fn = (iFEi_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI); } -void iFEf(x64emu_t *emu, uintptr_t fcn) { iFEf_t fn = (iFEf_t)fcn; R_RAX=(int32_t)fn(emu, emu->xmm[0].f[0]); } -void iFEd(x64emu_t *emu, uintptr_t fcn) { iFEd_t fn = (iFEd_t)fcn; R_RAX=(int32_t)fn(emu, emu->xmm[0].d[0]); } -void iFEL(x64emu_t *emu, uintptr_t fcn) { iFEL_t fn = (iFEL_t)fcn; R_RAX=(int32_t)fn(emu, (uintptr_t)R_RDI); } -void iFEp(x64emu_t *emu, uintptr_t fcn) { iFEp_t fn = (iFEp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI); } -void iFwp(x64emu_t *emu, uintptr_t fcn) { iFwp_t fn = (iFwp_t)fcn; R_RAX=(int32_t)fn((int16_t)R_RDI, (void*)R_RSI); } -void iFii(x64emu_t *emu, uintptr_t fcn) { iFii_t fn = (iFii_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI); } -void iFiI(x64emu_t *emu, uintptr_t fcn) { iFiI_t fn = (iFiI_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int64_t)R_RSI); } -void iFiC(x64emu_t *emu, uintptr_t fcn) { iFiC_t fn = (iFiC_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint8_t)R_RSI); } -void iFiu(x64emu_t *emu, uintptr_t fcn) { iFiu_t fn = (iFiu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI); } -void iFil(x64emu_t *emu, uintptr_t fcn) { iFil_t fn = (iFil_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (intptr_t)R_RSI); } -void iFiL(x64emu_t *emu, uintptr_t fcn) { iFiL_t fn = (iFiL_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uintptr_t)R_RSI); } -void iFip(x64emu_t *emu, uintptr_t fcn) { iFip_t fn = (iFip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI); } -void iFiS(x64emu_t *emu, uintptr_t fcn) { iFiS_t fn = (iFiS_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, io_convert((void*)R_RSI)); } -void iFui(x64emu_t *emu, uintptr_t fcn) { iFui_t fn = (iFui_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (int32_t)R_RSI); } -void iFuu(x64emu_t *emu, uintptr_t fcn) { iFuu_t fn = (iFuu_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI); } -void iFuL(x64emu_t *emu, uintptr_t fcn) { iFuL_t fn = (iFuL_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uintptr_t)R_RSI); } -void iFup(x64emu_t *emu, uintptr_t fcn) { iFup_t fn = (iFup_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (void*)R_RSI); } -void iFUp(x64emu_t *emu, uintptr_t fcn) { iFUp_t fn = (iFUp_t)fcn; R_RAX=(int32_t)fn((uint64_t)R_RDI, (void*)R_RSI); } -void iFli(x64emu_t *emu, uintptr_t fcn) { iFli_t fn = (iFli_t)fcn; R_RAX=(int32_t)fn((intptr_t)R_RDI, (int32_t)R_RSI); } -void iFlp(x64emu_t *emu, uintptr_t fcn) { iFlp_t fn = (iFlp_t)fcn; R_RAX=(int32_t)fn((intptr_t)R_RDI, (void*)R_RSI); } -void iFLi(x64emu_t *emu, uintptr_t fcn) { iFLi_t fn = (iFLi_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (int32_t)R_RSI); } -void iFLu(x64emu_t *emu, uintptr_t fcn) { iFLu_t fn = (iFLu_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (uint32_t)R_RSI); } -void iFLL(x64emu_t *emu, uintptr_t fcn) { iFLL_t fn = (iFLL_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI); } -void iFLp(x64emu_t *emu, uintptr_t fcn) { iFLp_t fn = (iFLp_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (void*)R_RSI); } -void iFpw(x64emu_t *emu, uintptr_t fcn) { iFpw_t fn = (iFpw_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int16_t)R_RSI); } -void iFpi(x64emu_t *emu, uintptr_t fcn) { iFpi_t fn = (iFpi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI); } -void iFpI(x64emu_t *emu, uintptr_t fcn) { iFpI_t fn = (iFpI_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int64_t)R_RSI); } -void iFpC(x64emu_t *emu, uintptr_t fcn) { iFpC_t fn = (iFpC_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI); } -void iFpW(x64emu_t *emu, uintptr_t fcn) { iFpW_t fn = (iFpW_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint16_t)R_RSI); } -void iFpu(x64emu_t *emu, uintptr_t fcn) { iFpu_t fn = (iFpu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI); } -void iFpU(x64emu_t *emu, uintptr_t fcn) { iFpU_t fn = (iFpU_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI); } -void iFpf(x64emu_t *emu, uintptr_t fcn) { iFpf_t fn = (iFpf_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, emu->xmm[0].f[0]); } -void iFpd(x64emu_t *emu, uintptr_t fcn) { iFpd_t fn = (iFpd_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, emu->xmm[0].d[0]); } -void iFpl(x64emu_t *emu, uintptr_t fcn) { iFpl_t fn = (iFpl_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (intptr_t)R_RSI); } -void iFpL(x64emu_t *emu, uintptr_t fcn) { iFpL_t fn = (iFpL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI); } -void iFpp(x64emu_t *emu, uintptr_t fcn) { iFpp_t fn = (iFpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI); } -void iFpO(x64emu_t *emu, uintptr_t fcn) { iFpO_t fn = (iFpO_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, of_convert((int32_t)R_RSI)); } -void iFSi(x64emu_t *emu, uintptr_t fcn) { iFSi_t fn = (iFSi_t)fcn; R_RAX=(int32_t)fn(io_convert((void*)R_RDI), (int32_t)R_RSI); } -void IFEi(x64emu_t *emu, uintptr_t fcn) { IFEi_t fn = (IFEi_t)fcn; R_RAX=(int64_t)fn(emu, (int32_t)R_RDI); } -void IFEf(x64emu_t *emu, uintptr_t fcn) { IFEf_t fn = (IFEf_t)fcn; R_RAX=(int64_t)fn(emu, emu->xmm[0].f[0]); } -void IFEd(x64emu_t *emu, uintptr_t fcn) { IFEd_t fn = (IFEd_t)fcn; R_RAX=(int64_t)fn(emu, emu->xmm[0].d[0]); } -void IFEp(x64emu_t *emu, uintptr_t fcn) { IFEp_t fn = (IFEp_t)fcn; R_RAX=(int64_t)fn(emu, (void*)R_RDI); } -void IFip(x64emu_t *emu, uintptr_t fcn) { IFip_t fn = (IFip_t)fcn; R_RAX=(int64_t)fn((int32_t)R_RDI, (void*)R_RSI); } -void IFII(x64emu_t *emu, uintptr_t fcn) { IFII_t fn = (IFII_t)fcn; R_RAX=(int64_t)fn((int64_t)R_RDI, (int64_t)R_RSI); } -void IFpi(x64emu_t *emu, uintptr_t fcn) { IFpi_t fn = (IFpi_t)fcn; R_RAX=(int64_t)fn((void*)R_RDI, (int32_t)R_RSI); } -void IFpu(x64emu_t *emu, uintptr_t fcn) { IFpu_t fn = (IFpu_t)fcn; R_RAX=(int64_t)fn((void*)R_RDI, (uint32_t)R_RSI); } -void IFpd(x64emu_t *emu, uintptr_t fcn) { IFpd_t fn = (IFpd_t)fcn; R_RAX=(int64_t)fn((void*)R_RDI, emu->xmm[0].d[0]); } -void IFpp(x64emu_t *emu, uintptr_t fcn) { IFpp_t fn = (IFpp_t)fcn; R_RAX=(int64_t)fn((void*)R_RDI, (void*)R_RSI); } -void CFip(x64emu_t *emu, uintptr_t fcn) { CFip_t fn = (CFip_t)fcn; R_RAX=(unsigned char)fn((int32_t)R_RDI, (void*)R_RSI); } -void CFCi(x64emu_t *emu, uintptr_t fcn) { CFCi_t fn = (CFCi_t)fcn; R_RAX=(unsigned char)fn((uint8_t)R_RDI, (int32_t)R_RSI); } -void CFui(x64emu_t *emu, uintptr_t fcn) { CFui_t fn = (CFui_t)fcn; R_RAX=(unsigned char)fn((uint32_t)R_RDI, (int32_t)R_RSI); } -void CFuW(x64emu_t *emu, uintptr_t fcn) { CFuW_t fn = (CFuW_t)fcn; R_RAX=(unsigned char)fn((uint32_t)R_RDI, (uint16_t)R_RSI); } -void CFuu(x64emu_t *emu, uintptr_t fcn) { CFuu_t fn = (CFuu_t)fcn; R_RAX=(unsigned char)fn((uint32_t)R_RDI, (uint32_t)R_RSI); } -void CFuL(x64emu_t *emu, uintptr_t fcn) { CFuL_t fn = (CFuL_t)fcn; R_RAX=(unsigned char)fn((uint32_t)R_RDI, (uintptr_t)R_RSI); } -void CFpi(x64emu_t *emu, uintptr_t fcn) { CFpi_t fn = (CFpi_t)fcn; R_RAX=(unsigned char)fn((void*)R_RDI, (int32_t)R_RSI); } -void CFpu(x64emu_t *emu, uintptr_t fcn) { CFpu_t fn = (CFpu_t)fcn; R_RAX=(unsigned char)fn((void*)R_RDI, (uint32_t)R_RSI); } -void CFpL(x64emu_t *emu, uintptr_t fcn) { CFpL_t fn = (CFpL_t)fcn; R_RAX=(unsigned char)fn((void*)R_RDI, (uintptr_t)R_RSI); } -void CFpp(x64emu_t *emu, uintptr_t fcn) { CFpp_t fn = (CFpp_t)fcn; R_RAX=(unsigned char)fn((void*)R_RDI, (void*)R_RSI); } -void WFpi(x64emu_t *emu, uintptr_t fcn) { WFpi_t fn = (WFpi_t)fcn; R_RAX=(unsigned short)fn((void*)R_RDI, (int32_t)R_RSI); } -void WFpp(x64emu_t *emu, uintptr_t fcn) { WFpp_t fn = (WFpp_t)fcn; R_RAX=(unsigned short)fn((void*)R_RDI, (void*)R_RSI); } -void uFEp(x64emu_t *emu, uintptr_t fcn) { uFEp_t fn = (uFEp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI); } -void uFii(x64emu_t *emu, uintptr_t fcn) { uFii_t fn = (uFii_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (int32_t)R_RSI); } -void uFiu(x64emu_t *emu, uintptr_t fcn) { uFiu_t fn = (uFiu_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI); } -void uFip(x64emu_t *emu, uintptr_t fcn) { uFip_t fn = (uFip_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (void*)R_RSI); } -void uFui(x64emu_t *emu, uintptr_t fcn) { uFui_t fn = (uFui_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (int32_t)R_RSI); } -void uFuu(x64emu_t *emu, uintptr_t fcn) { uFuu_t fn = (uFuu_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI); } -void uFup(x64emu_t *emu, uintptr_t fcn) { uFup_t fn = (uFup_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (void*)R_RSI); } -void uFuM(x64emu_t *emu, uintptr_t fcn) { uFuM_t fn = (uFuM_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void uFpw(x64emu_t *emu, uintptr_t fcn) { uFpw_t fn = (uFpw_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int16_t)R_RSI); } -void uFpi(x64emu_t *emu, uintptr_t fcn) { uFpi_t fn = (uFpi_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI); } -void uFpC(x64emu_t *emu, uintptr_t fcn) { uFpC_t fn = (uFpC_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint8_t)R_RSI); } -void uFpu(x64emu_t *emu, uintptr_t fcn) { uFpu_t fn = (uFpu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI); } -void uFpU(x64emu_t *emu, uintptr_t fcn) { uFpU_t fn = (uFpU_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint64_t)R_RSI); } -void uFpf(x64emu_t *emu, uintptr_t fcn) { uFpf_t fn = (uFpf_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, emu->xmm[0].f[0]); } -void uFpl(x64emu_t *emu, uintptr_t fcn) { uFpl_t fn = (uFpl_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (intptr_t)R_RSI); } -void uFpL(x64emu_t *emu, uintptr_t fcn) { uFpL_t fn = (uFpL_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uintptr_t)R_RSI); } -void uFpp(x64emu_t *emu, uintptr_t fcn) { uFpp_t fn = (uFpp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI); } -void uFbu(x64emu_t *emu, uintptr_t fcn) { uFbu_t fn = (uFbu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void UFEp(x64emu_t *emu, uintptr_t fcn) { UFEp_t fn = (UFEp_t)fcn; R_RAX=fn(emu, (void*)R_RDI); } -void UFuu(x64emu_t *emu, uintptr_t fcn) { UFuu_t fn = (UFuu_t)fcn; R_RAX=fn((uint32_t)R_RDI, (uint32_t)R_RSI); } -void UFUp(x64emu_t *emu, uintptr_t fcn) { UFUp_t fn = (UFUp_t)fcn; R_RAX=fn((uint64_t)R_RDI, (void*)R_RSI); } -void UFpi(x64emu_t *emu, uintptr_t fcn) { UFpi_t fn = (UFpi_t)fcn; R_RAX=fn((void*)R_RDI, (int32_t)R_RSI); } -void UFpU(x64emu_t *emu, uintptr_t fcn) { UFpU_t fn = (UFpU_t)fcn; R_RAX=fn((void*)R_RDI, (uint64_t)R_RSI); } -void UFpp(x64emu_t *emu, uintptr_t fcn) { UFpp_t fn = (UFpp_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI); } -void fFEf(x64emu_t *emu, uintptr_t fcn) { fFEf_t fn = (fFEf_t)fcn; emu->xmm[0].f[0]=fn(emu, emu->xmm[0].f[0]); } -void fFEp(x64emu_t *emu, uintptr_t fcn) { fFEp_t fn = (fFEp_t)fcn; emu->xmm[0].f[0]=fn(emu, (void*)R_RDI); } -void fFif(x64emu_t *emu, uintptr_t fcn) { fFif_t fn = (fFif_t)fcn; emu->xmm[0].f[0]=fn((int32_t)R_RDI, emu->xmm[0].f[0]); } -void fFfi(x64emu_t *emu, uintptr_t fcn) { fFfi_t fn = (fFfi_t)fcn; emu->xmm[0].f[0]=fn(emu->xmm[0].f[0], (int32_t)R_RDI); } -void fFff(x64emu_t *emu, uintptr_t fcn) { fFff_t fn = (fFff_t)fcn; emu->xmm[0].f[0]=fn(emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void fFfD(x64emu_t *emu, uintptr_t fcn) { fFfD_t fn = (fFfD_t)fcn; emu->xmm[0].f[0]=fn(emu->xmm[0].f[0], LD2localLD((void*)(R_RSP + 8))); } -void fFfp(x64emu_t *emu, uintptr_t fcn) { fFfp_t fn = (fFfp_t)fcn; emu->xmm[0].f[0]=fn(emu->xmm[0].f[0], (void*)R_RDI); } -void fFpu(x64emu_t *emu, uintptr_t fcn) { fFpu_t fn = (fFpu_t)fcn; emu->xmm[0].f[0]=fn((void*)R_RDI, (uint32_t)R_RSI); } -void fFpp(x64emu_t *emu, uintptr_t fcn) { fFpp_t fn = (fFpp_t)fcn; emu->xmm[0].f[0]=fn((void*)R_RDI, (void*)R_RSI); } -void fFbu(x64emu_t *emu, uintptr_t fcn) { fFbu_t fn = (fFbu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); emu->xmm[0].f[0]=fn(aligned_xcb, (uint32_t)R_RSI); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void dFEd(x64emu_t *emu, uintptr_t fcn) { dFEd_t fn = (dFEd_t)fcn; emu->xmm[0].d[0]=fn(emu, emu->xmm[0].d[0]); } -void dFid(x64emu_t *emu, uintptr_t fcn) { dFid_t fn = (dFid_t)fcn; emu->xmm[0].d[0]=fn((int32_t)R_RDI, emu->xmm[0].d[0]); } -void dFdi(x64emu_t *emu, uintptr_t fcn) { dFdi_t fn = (dFdi_t)fcn; emu->xmm[0].d[0]=fn(emu->xmm[0].d[0], (int32_t)R_RDI); } -void dFdd(x64emu_t *emu, uintptr_t fcn) { dFdd_t fn = (dFdd_t)fcn; emu->xmm[0].d[0]=fn(emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void dFdD(x64emu_t *emu, uintptr_t fcn) { dFdD_t fn = (dFdD_t)fcn; emu->xmm[0].d[0]=fn(emu->xmm[0].d[0], LD2localLD((void*)(R_RSP + 8))); } -void dFdp(x64emu_t *emu, uintptr_t fcn) { dFdp_t fn = (dFdp_t)fcn; emu->xmm[0].d[0]=fn(emu->xmm[0].d[0], (void*)R_RDI); } -void dFll(x64emu_t *emu, uintptr_t fcn) { dFll_t fn = (dFll_t)fcn; emu->xmm[0].d[0]=fn((intptr_t)R_RDI, (intptr_t)R_RSI); } -void dFpi(x64emu_t *emu, uintptr_t fcn) { dFpi_t fn = (dFpi_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (int32_t)R_RSI); } -void dFpu(x64emu_t *emu, uintptr_t fcn) { dFpu_t fn = (dFpu_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (uint32_t)R_RSI); } -void dFpd(x64emu_t *emu, uintptr_t fcn) { dFpd_t fn = (dFpd_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, emu->xmm[0].d[0]); } -void dFpp(x64emu_t *emu, uintptr_t fcn) { dFpp_t fn = (dFpp_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (void*)R_RSI); } -void DFDi(x64emu_t *emu, uintptr_t fcn) { DFDi_t fn = (DFDi_t)fcn; long double ld=fn(LD2localLD((void*)(R_RSP + 8)), (int32_t)R_RDI); fpu_do_push(emu); ST0val = ld; } -void DFDD(x64emu_t *emu, uintptr_t fcn) { DFDD_t fn = (DFDD_t)fcn; long double ld=fn(LD2localLD((void*)(R_RSP + 8)), LD2localLD((void*)(R_RSP + 24))); fpu_do_push(emu); ST0val = ld; } -void DFDp(x64emu_t *emu, uintptr_t fcn) { DFDp_t fn = (DFDp_t)fcn; long double ld=fn(LD2localLD((void*)(R_RSP + 8)), (void*)R_RDI); fpu_do_push(emu); ST0val = ld; } -void DFpp(x64emu_t *emu, uintptr_t fcn) { DFpp_t fn = (DFpp_t)fcn; long double ld=fn((void*)R_RDI, (void*)R_RSI); fpu_do_push(emu); ST0val = ld; } -void lFEi(x64emu_t *emu, uintptr_t fcn) { lFEi_t fn = (lFEi_t)fcn; R_RAX=(intptr_t)fn(emu, (int32_t)R_RDI); } -void lFii(x64emu_t *emu, uintptr_t fcn) { lFii_t fn = (lFii_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI); } -void lFip(x64emu_t *emu, uintptr_t fcn) { lFip_t fn = (lFip_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI); } -void lFui(x64emu_t *emu, uintptr_t fcn) { lFui_t fn = (lFui_t)fcn; R_RAX=(intptr_t)fn((uint32_t)R_RDI, (int32_t)R_RSI); } -void lFll(x64emu_t *emu, uintptr_t fcn) { lFll_t fn = (lFll_t)fcn; R_RAX=(intptr_t)fn((intptr_t)R_RDI, (intptr_t)R_RSI); } -void lFpi(x64emu_t *emu, uintptr_t fcn) { lFpi_t fn = (lFpi_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (int32_t)R_RSI); } -void lFpd(x64emu_t *emu, uintptr_t fcn) { lFpd_t fn = (lFpd_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, emu->xmm[0].d[0]); } -void lFpl(x64emu_t *emu, uintptr_t fcn) { lFpl_t fn = (lFpl_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (intptr_t)R_RSI); } -void lFpp(x64emu_t *emu, uintptr_t fcn) { lFpp_t fn = (lFpp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI); } -void LFEL(x64emu_t *emu, uintptr_t fcn) { LFEL_t fn = (LFEL_t)fcn; R_RAX=(uintptr_t)fn(emu, (uintptr_t)R_RDI); } -void LFEp(x64emu_t *emu, uintptr_t fcn) { LFEp_t fn = (LFEp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI); } -void LFii(x64emu_t *emu, uintptr_t fcn) { LFii_t fn = (LFii_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI); } -void LFuu(x64emu_t *emu, uintptr_t fcn) { LFuu_t fn = (LFuu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI); } -void LFUp(x64emu_t *emu, uintptr_t fcn) { LFUp_t fn = (LFUp_t)fcn; R_RAX=(uintptr_t)fn((uint64_t)R_RDI, (void*)R_RSI); } -void LFLi(x64emu_t *emu, uintptr_t fcn) { LFLi_t fn = (LFLi_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (int32_t)R_RSI); } -void LFLL(x64emu_t *emu, uintptr_t fcn) { LFLL_t fn = (LFLL_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI); } -void LFLp(x64emu_t *emu, uintptr_t fcn) { LFLp_t fn = (LFLp_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (void*)R_RSI); } -void LFpi(x64emu_t *emu, uintptr_t fcn) { LFpi_t fn = (LFpi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI); } -void LFpu(x64emu_t *emu, uintptr_t fcn) { LFpu_t fn = (LFpu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI); } -void LFpL(x64emu_t *emu, uintptr_t fcn) { LFpL_t fn = (LFpL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI); } -void LFpp(x64emu_t *emu, uintptr_t fcn) { LFpp_t fn = (LFpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI); } -void pFEi(x64emu_t *emu, uintptr_t fcn) { pFEi_t fn = (pFEi_t)fcn; R_RAX=(uintptr_t)fn(emu, (int32_t)R_RDI); } -void pFEL(x64emu_t *emu, uintptr_t fcn) { pFEL_t fn = (pFEL_t)fcn; R_RAX=(uintptr_t)fn(emu, (uintptr_t)R_RDI); } -void pFEp(x64emu_t *emu, uintptr_t fcn) { pFEp_t fn = (pFEp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI); } -void pFii(x64emu_t *emu, uintptr_t fcn) { pFii_t fn = (pFii_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI); } -void pFiI(x64emu_t *emu, uintptr_t fcn) { pFiI_t fn = (pFiI_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int64_t)R_RSI); } -void pFiu(x64emu_t *emu, uintptr_t fcn) { pFiu_t fn = (pFiu_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (uint32_t)R_RSI); } -void pFip(x64emu_t *emu, uintptr_t fcn) { pFip_t fn = (pFip_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI); } -void pFiV(x64emu_t *emu, uintptr_t fcn) { pFiV_t fn = (pFiV_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)(R_RSP + 8)); } -void pFui(x64emu_t *emu, uintptr_t fcn) { pFui_t fn = (pFui_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (int32_t)R_RSI); } -void pFuu(x64emu_t *emu, uintptr_t fcn) { pFuu_t fn = (pFuu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI); } -void pFup(x64emu_t *emu, uintptr_t fcn) { pFup_t fn = (pFup_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (void*)R_RSI); } -void pFUU(x64emu_t *emu, uintptr_t fcn) { pFUU_t fn = (pFUU_t)fcn; R_RAX=(uintptr_t)fn((uint64_t)R_RDI, (uint64_t)R_RSI); } -void pFdi(x64emu_t *emu, uintptr_t fcn) { pFdi_t fn = (pFdi_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0], (int32_t)R_RDI); } -void pFdd(x64emu_t *emu, uintptr_t fcn) { pFdd_t fn = (pFdd_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void pFli(x64emu_t *emu, uintptr_t fcn) { pFli_t fn = (pFli_t)fcn; R_RAX=(uintptr_t)fn((intptr_t)R_RDI, (int32_t)R_RSI); } -void pFll(x64emu_t *emu, uintptr_t fcn) { pFll_t fn = (pFll_t)fcn; R_RAX=(uintptr_t)fn((intptr_t)R_RDI, (intptr_t)R_RSI); } -void pFlp(x64emu_t *emu, uintptr_t fcn) { pFlp_t fn = (pFlp_t)fcn; R_RAX=(uintptr_t)fn((intptr_t)R_RDI, (void*)R_RSI); } -void pFLi(x64emu_t *emu, uintptr_t fcn) { pFLi_t fn = (pFLi_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (int32_t)R_RSI); } -void pFLC(x64emu_t *emu, uintptr_t fcn) { pFLC_t fn = (pFLC_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uint8_t)R_RSI); } -void pFLu(x64emu_t *emu, uintptr_t fcn) { pFLu_t fn = (pFLu_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uint32_t)R_RSI); } -void pFLL(x64emu_t *emu, uintptr_t fcn) { pFLL_t fn = (pFLL_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI); } -void pFLp(x64emu_t *emu, uintptr_t fcn) { pFLp_t fn = (pFLp_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (void*)R_RSI); } -void pFpi(x64emu_t *emu, uintptr_t fcn) { pFpi_t fn = (pFpi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI); } -void pFpC(x64emu_t *emu, uintptr_t fcn) { pFpC_t fn = (pFpC_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint8_t)R_RSI); } -void pFpW(x64emu_t *emu, uintptr_t fcn) { pFpW_t fn = (pFpW_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint16_t)R_RSI); } -void pFpu(x64emu_t *emu, uintptr_t fcn) { pFpu_t fn = (pFpu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI); } -void pFpU(x64emu_t *emu, uintptr_t fcn) { pFpU_t fn = (pFpU_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint64_t)R_RSI); } -void pFpd(x64emu_t *emu, uintptr_t fcn) { pFpd_t fn = (pFpd_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, emu->xmm[0].d[0]); } -void pFpl(x64emu_t *emu, uintptr_t fcn) { pFpl_t fn = (pFpl_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI); } -void pFpL(x64emu_t *emu, uintptr_t fcn) { pFpL_t fn = (pFpL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI); } -void pFpp(x64emu_t *emu, uintptr_t fcn) { pFpp_t fn = (pFpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI); } -void pFSi(x64emu_t *emu, uintptr_t fcn) { pFSi_t fn = (pFSi_t)fcn; R_RAX=(uintptr_t)fn(io_convert((void*)R_RDI), (int32_t)R_RSI); } -void pFbC(x64emu_t *emu, uintptr_t fcn) { pFbC_t fn = (pFbC_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbu(x64emu_t *emu, uintptr_t fcn) { pFbu_t fn = (pFbu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbp(x64emu_t *emu, uintptr_t fcn) { pFbp_t fn = (pFbp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void HFII(x64emu_t *emu, uintptr_t fcn) { HFII_t fn = (HFII_t)fcn; unsigned __int128 u128 = fn((int64_t)R_RDI, (int64_t)R_RSI); R_RAX=(u128&0xFFFFFFFFFFFFFFFFL); R_RDX=(u128>>64)&0xFFFFFFFFFFFFFFFFL; } -void HFll(x64emu_t *emu, uintptr_t fcn) { HFll_t fn = (HFll_t)fcn; unsigned __int128 u128 = fn((intptr_t)R_RDI, (intptr_t)R_RSI); R_RAX=(u128&0xFFFFFFFFFFFFFFFFL); R_RDX=(u128>>64)&0xFFFFFFFFFFFFFFFFL; } -void HFpi(x64emu_t *emu, uintptr_t fcn) { HFpi_t fn = (HFpi_t)fcn; unsigned __int128 u128 = fn((void*)R_RDI, (int32_t)R_RSI); R_RAX=(u128&0xFFFFFFFFFFFFFFFFL); R_RDX=(u128>>64)&0xFFFFFFFFFFFFFFFFL; } -void HFpp(x64emu_t *emu, uintptr_t fcn) { HFpp_t fn = (HFpp_t)fcn; unsigned __int128 u128 = fn((void*)R_RDI, (void*)R_RSI); R_RAX=(u128&0xFFFFFFFFFFFFFFFFL); R_RDX=(u128>>64)&0xFFFFFFFFFFFFFFFFL; } -void xFxx(x64emu_t *emu, uintptr_t fcn) { xFxx_t fn = (xFxx_t)fcn; from_complexf(emu, fn(to_complexf(emu, 0), to_complexf(emu, 1))); } -void XFXX(x64emu_t *emu, uintptr_t fcn) { XFXX_t fn = (XFXX_t)fcn; from_complex(emu, fn(to_complex(emu, 0), to_complex(emu, 2))); } -void iWpi(x64emu_t *emu, uintptr_t fcn) { iWpi_t fn = (iWpi_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (int32_t)R_RDX); } -void iWpu(x64emu_t *emu, uintptr_t fcn) { iWpu_t fn = (iWpu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX); } -void iWpf(x64emu_t *emu, uintptr_t fcn) { iWpf_t fn = (iWpf_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, emu->xmm[1].f[0]); } -void iWpp(x64emu_t *emu, uintptr_t fcn) { iWpp_t fn = (iWpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX); } -void uWpu(x64emu_t *emu, uintptr_t fcn) { uWpu_t fn = (uWpu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RCX, (uint32_t)R_RDX); } -void pWEp(x64emu_t *emu, uintptr_t fcn) { pWEp_t fn = (pWEp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RCX); } -void pWpu(x64emu_t *emu, uintptr_t fcn) { pWpu_t fn = (pWpu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RCX, (uint32_t)R_RDX); } -void vFEpi(x64emu_t *emu, uintptr_t fcn) { vFEpi_t fn = (vFEpi_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI); } -void vFEpu(x64emu_t *emu, uintptr_t fcn) { vFEpu_t fn = (vFEpu_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI); } -void vFEpp(x64emu_t *emu, uintptr_t fcn) { vFEpp_t fn = (vFEpp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI); } -void vFEpV(x64emu_t *emu, uintptr_t fcn) { vFEpV_t fn = (vFEpV_t)fcn; fn(emu, (void*)R_RDI, (void*)(R_RSP + 8)); } -void vFEpA(x64emu_t *emu, uintptr_t fcn) { vFEpA_t fn = (vFEpA_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI); } -void vFccc(x64emu_t *emu, uintptr_t fcn) { vFccc_t fn = (vFccc_t)fcn; fn((int8_t)R_RDI, (int8_t)R_RSI, (int8_t)R_RDX); } -void vFwww(x64emu_t *emu, uintptr_t fcn) { vFwww_t fn = (vFwww_t)fcn; fn((int16_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX); } -void vFiii(x64emu_t *emu, uintptr_t fcn) { vFiii_t fn = (vFiii_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void vFiif(x64emu_t *emu, uintptr_t fcn) { vFiif_t fn = (vFiif_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0]); } -void vFiip(x64emu_t *emu, uintptr_t fcn) { vFiip_t fn = (vFiip_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void vFiui(x64emu_t *emu, uintptr_t fcn) { vFiui_t fn = (vFiui_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); } -void vFiuu(x64emu_t *emu, uintptr_t fcn) { vFiuu_t fn = (vFiuu_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); } -void vFiuU(x64emu_t *emu, uintptr_t fcn) { vFiuU_t fn = (vFiuU_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX); } -void vFiup(x64emu_t *emu, uintptr_t fcn) { vFiup_t fn = (vFiup_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void vFiff(x64emu_t *emu, uintptr_t fcn) { vFiff_t fn = (vFiff_t)fcn; fn((int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void vFidd(x64emu_t *emu, uintptr_t fcn) { vFidd_t fn = (vFidd_t)fcn; fn((int32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void vFilu(x64emu_t *emu, uintptr_t fcn) { vFilu_t fn = (vFilu_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX); } -void vFill(x64emu_t *emu, uintptr_t fcn) { vFill_t fn = (vFill_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); } -void vFilp(x64emu_t *emu, uintptr_t fcn) { vFilp_t fn = (vFilp_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); } -void vFiLL(x64emu_t *emu, uintptr_t fcn) { vFiLL_t fn = (vFiLL_t)fcn; fn((int32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); } -void vFipi(x64emu_t *emu, uintptr_t fcn) { vFipi_t fn = (vFipi_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void vFipu(x64emu_t *emu, uintptr_t fcn) { vFipu_t fn = (vFipu_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void vFipL(x64emu_t *emu, uintptr_t fcn) { vFipL_t fn = (vFipL_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void vFipp(x64emu_t *emu, uintptr_t fcn) { vFipp_t fn = (vFipp_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void vFCCC(x64emu_t *emu, uintptr_t fcn) { vFCCC_t fn = (vFCCC_t)fcn; fn((uint8_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX); } -void vFWWW(x64emu_t *emu, uintptr_t fcn) { vFWWW_t fn = (vFWWW_t)fcn; fn((uint16_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX); } -void vFucc(x64emu_t *emu, uintptr_t fcn) { vFucc_t fn = (vFucc_t)fcn; fn((uint32_t)R_RDI, (int8_t)R_RSI, (int8_t)R_RDX); } -void vFuww(x64emu_t *emu, uintptr_t fcn) { vFuww_t fn = (vFuww_t)fcn; fn((uint32_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX); } -void vFuii(x64emu_t *emu, uintptr_t fcn) { vFuii_t fn = (vFuii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void vFuiu(x64emu_t *emu, uintptr_t fcn) { vFuiu_t fn = (vFuiu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); } -void vFuiU(x64emu_t *emu, uintptr_t fcn) { vFuiU_t fn = (vFuiU_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX); } -void vFuif(x64emu_t *emu, uintptr_t fcn) { vFuif_t fn = (vFuif_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0]); } -void vFuid(x64emu_t *emu, uintptr_t fcn) { vFuid_t fn = (vFuid_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0]); } -void vFuil(x64emu_t *emu, uintptr_t fcn) { vFuil_t fn = (vFuil_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX); } -void vFuiL(x64emu_t *emu, uintptr_t fcn) { vFuiL_t fn = (vFuiL_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX); } -void vFuip(x64emu_t *emu, uintptr_t fcn) { vFuip_t fn = (vFuip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void vFuWW(x64emu_t *emu, uintptr_t fcn) { vFuWW_t fn = (vFuWW_t)fcn; fn((uint32_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX); } -void vFuui(x64emu_t *emu, uintptr_t fcn) { vFuui_t fn = (vFuui_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); } -void vFuuC(x64emu_t *emu, uintptr_t fcn) { vFuuC_t fn = (vFuuC_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint8_t)R_RDX); } -void vFuuu(x64emu_t *emu, uintptr_t fcn) { vFuuu_t fn = (vFuuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); } -void vFuuU(x64emu_t *emu, uintptr_t fcn) { vFuuU_t fn = (vFuuU_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX); } -void vFuuf(x64emu_t *emu, uintptr_t fcn) { vFuuf_t fn = (vFuuf_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0]); } -void vFuud(x64emu_t *emu, uintptr_t fcn) { vFuud_t fn = (vFuud_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0]); } -void vFuuL(x64emu_t *emu, uintptr_t fcn) { vFuuL_t fn = (vFuuL_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); } -void vFuup(x64emu_t *emu, uintptr_t fcn) { vFuup_t fn = (vFuup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void vFuff(x64emu_t *emu, uintptr_t fcn) { vFuff_t fn = (vFuff_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void vFufp(x64emu_t *emu, uintptr_t fcn) { vFufp_t fn = (vFufp_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0], (void*)R_RSI); } -void vFudd(x64emu_t *emu, uintptr_t fcn) { vFudd_t fn = (vFudd_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void vFull(x64emu_t *emu, uintptr_t fcn) { vFull_t fn = (vFull_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); } -void vFulp(x64emu_t *emu, uintptr_t fcn) { vFulp_t fn = (vFulp_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); } -void vFuLL(x64emu_t *emu, uintptr_t fcn) { vFuLL_t fn = (vFuLL_t)fcn; fn((uint32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); } -void vFuLp(x64emu_t *emu, uintptr_t fcn) { vFuLp_t fn = (vFuLp_t)fcn; fn((uint32_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void vFupu(x64emu_t *emu, uintptr_t fcn) { vFupu_t fn = (vFupu_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void vFupp(x64emu_t *emu, uintptr_t fcn) { vFupp_t fn = (vFupp_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void vFfff(x64emu_t *emu, uintptr_t fcn) { vFfff_t fn = (vFfff_t)fcn; fn(emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); } -void vFfpp(x64emu_t *emu, uintptr_t fcn) { vFfpp_t fn = (vFfpp_t)fcn; fn(emu->xmm[0].f[0], (void*)R_RDI, (void*)R_RSI); } -void vFddd(x64emu_t *emu, uintptr_t fcn) { vFddd_t fn = (vFddd_t)fcn; fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); } -void vFdpp(x64emu_t *emu, uintptr_t fcn) { vFdpp_t fn = (vFdpp_t)fcn; fn(emu->xmm[0].d[0], (void*)R_RDI, (void*)R_RSI); } -void vFlii(x64emu_t *emu, uintptr_t fcn) { vFlii_t fn = (vFlii_t)fcn; fn((intptr_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void vFlip(x64emu_t *emu, uintptr_t fcn) { vFlip_t fn = (vFlip_t)fcn; fn((intptr_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void vFllp(x64emu_t *emu, uintptr_t fcn) { vFllp_t fn = (vFllp_t)fcn; fn((intptr_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); } -void vFlpp(x64emu_t *emu, uintptr_t fcn) { vFlpp_t fn = (vFlpp_t)fcn; fn((intptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void vFLup(x64emu_t *emu, uintptr_t fcn) { vFLup_t fn = (vFLup_t)fcn; fn((uintptr_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void vFLpL(x64emu_t *emu, uintptr_t fcn) { vFLpL_t fn = (vFLpL_t)fcn; fn((uintptr_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void vFLpp(x64emu_t *emu, uintptr_t fcn) { vFLpp_t fn = (vFLpp_t)fcn; fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void vFpic(x64emu_t *emu, uintptr_t fcn) { vFpic_t fn = (vFpic_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int8_t)R_RDX); } -void vFpii(x64emu_t *emu, uintptr_t fcn) { vFpii_t fn = (vFpii_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void vFpiI(x64emu_t *emu, uintptr_t fcn) { vFpiI_t fn = (vFpiI_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX); } -void vFpiC(x64emu_t *emu, uintptr_t fcn) { vFpiC_t fn = (vFpiC_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX); } -void vFpiu(x64emu_t *emu, uintptr_t fcn) { vFpiu_t fn = (vFpiu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); } -void vFpiU(x64emu_t *emu, uintptr_t fcn) { vFpiU_t fn = (vFpiU_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX); } -void vFpif(x64emu_t *emu, uintptr_t fcn) { vFpif_t fn = (vFpif_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0]); } -void vFpid(x64emu_t *emu, uintptr_t fcn) { vFpid_t fn = (vFpid_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0]); } -void vFpiL(x64emu_t *emu, uintptr_t fcn) { vFpiL_t fn = (vFpiL_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX); } -void vFpip(x64emu_t *emu, uintptr_t fcn) { vFpip_t fn = (vFpip_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void vFpui(x64emu_t *emu, uintptr_t fcn) { vFpui_t fn = (vFpui_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); } -void vFpuI(x64emu_t *emu, uintptr_t fcn) { vFpuI_t fn = (vFpuI_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (int64_t)R_RDX); } -void vFpuW(x64emu_t *emu, uintptr_t fcn) { vFpuW_t fn = (vFpuW_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint16_t)R_RDX); } -void vFpuu(x64emu_t *emu, uintptr_t fcn) { vFpuu_t fn = (vFpuu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); } -void vFpuU(x64emu_t *emu, uintptr_t fcn) { vFpuU_t fn = (vFpuU_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX); } -void vFpuf(x64emu_t *emu, uintptr_t fcn) { vFpuf_t fn = (vFpuf_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0]); } -void vFpud(x64emu_t *emu, uintptr_t fcn) { vFpud_t fn = (vFpud_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0]); } -void vFpuL(x64emu_t *emu, uintptr_t fcn) { vFpuL_t fn = (vFpuL_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); } -void vFpup(x64emu_t *emu, uintptr_t fcn) { vFpup_t fn = (vFpup_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void vFpUi(x64emu_t *emu, uintptr_t fcn) { vFpUi_t fn = (vFpUi_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX); } -void vFpUu(x64emu_t *emu, uintptr_t fcn) { vFpUu_t fn = (vFpUu_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX); } -void vFpUU(x64emu_t *emu, uintptr_t fcn) { vFpUU_t fn = (vFpUU_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX); } -void vFpUf(x64emu_t *emu, uintptr_t fcn) { vFpUf_t fn = (vFpUf_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, emu->xmm[0].f[0]); } -void vFpUp(x64emu_t *emu, uintptr_t fcn) { vFpUp_t fn = (vFpUp_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX); } -void vFpff(x64emu_t *emu, uintptr_t fcn) { vFpff_t fn = (vFpff_t)fcn; fn((void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void vFpdu(x64emu_t *emu, uintptr_t fcn) { vFpdu_t fn = (vFpdu_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], (uint32_t)R_RSI); } -void vFpdd(x64emu_t *emu, uintptr_t fcn) { vFpdd_t fn = (vFpdd_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void vFpdp(x64emu_t *emu, uintptr_t fcn) { vFpdp_t fn = (vFpdp_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], (void*)R_RSI); } -void vFpll(x64emu_t *emu, uintptr_t fcn) { vFpll_t fn = (vFpll_t)fcn; fn((void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); } -void vFplp(x64emu_t *emu, uintptr_t fcn) { vFplp_t fn = (vFplp_t)fcn; fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); } -void vFpLi(x64emu_t *emu, uintptr_t fcn) { vFpLi_t fn = (vFpLi_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); } -void vFpLu(x64emu_t *emu, uintptr_t fcn) { vFpLu_t fn = (vFpLu_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX); } -void vFpLL(x64emu_t *emu, uintptr_t fcn) { vFpLL_t fn = (vFpLL_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); } -void vFpLp(x64emu_t *emu, uintptr_t fcn) { vFpLp_t fn = (vFpLp_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void vFppi(x64emu_t *emu, uintptr_t fcn) { vFppi_t fn = (vFppi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void vFppu(x64emu_t *emu, uintptr_t fcn) { vFppu_t fn = (vFppu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void vFppU(x64emu_t *emu, uintptr_t fcn) { vFppU_t fn = (vFppU_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX); } -void vFppf(x64emu_t *emu, uintptr_t fcn) { vFppf_t fn = (vFppf_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0]); } -void vFppd(x64emu_t *emu, uintptr_t fcn) { vFppd_t fn = (vFppd_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0]); } -void vFppl(x64emu_t *emu, uintptr_t fcn) { vFppl_t fn = (vFppl_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); } -void vFppL(x64emu_t *emu, uintptr_t fcn) { vFppL_t fn = (vFppL_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void vFppp(x64emu_t *emu, uintptr_t fcn) { vFppp_t fn = (vFppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void vFppV(x64emu_t *emu, uintptr_t fcn) { vFppV_t fn = (vFppV_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); } -void cFpdp(x64emu_t *emu, uintptr_t fcn) { cFpdp_t fn = (cFpdp_t)fcn; R_RAX=fn((void*)R_RDI, emu->xmm[0].d[0], (void*)R_RSI); } -void wFppp(x64emu_t *emu, uintptr_t fcn) { wFppp_t fn = (wFppp_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void iFEiw(x64emu_t *emu, uintptr_t fcn) { iFEiw_t fn = (iFEiw_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int16_t)R_RSI); } -void iFEip(x64emu_t *emu, uintptr_t fcn) { iFEip_t fn = (iFEip_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI); } -void iFEWW(x64emu_t *emu, uintptr_t fcn) { iFEWW_t fn = (iFEWW_t)fcn; R_RAX=(int32_t)fn(emu, (uint16_t)R_RDI, (uint16_t)R_RSI); } -void iFEup(x64emu_t *emu, uintptr_t fcn) { iFEup_t fn = (iFEup_t)fcn; R_RAX=(int32_t)fn(emu, (uint32_t)R_RDI, (void*)R_RSI); } -void iFEUU(x64emu_t *emu, uintptr_t fcn) { iFEUU_t fn = (iFEUU_t)fcn; R_RAX=(int32_t)fn(emu, (uint64_t)R_RDI, (uint64_t)R_RSI); } -void iFELp(x64emu_t *emu, uintptr_t fcn) { iFELp_t fn = (iFELp_t)fcn; R_RAX=(int32_t)fn(emu, (uintptr_t)R_RDI, (void*)R_RSI); } -void iFEpi(x64emu_t *emu, uintptr_t fcn) { iFEpi_t fn = (iFEpi_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI); } -void iFEpU(x64emu_t *emu, uintptr_t fcn) { iFEpU_t fn = (iFEpU_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint64_t)R_RSI); } -void iFEpL(x64emu_t *emu, uintptr_t fcn) { iFEpL_t fn = (iFEpL_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI); } -void iFEpp(x64emu_t *emu, uintptr_t fcn) { iFEpp_t fn = (iFEpp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI); } -void iFEpV(x64emu_t *emu, uintptr_t fcn) { iFEpV_t fn = (iFEpV_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)(R_RSP + 8)); } -void iFEpA(x64emu_t *emu, uintptr_t fcn) { iFEpA_t fn = (iFEpA_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI); } -void iFESp(x64emu_t *emu, uintptr_t fcn) { iFESp_t fn = (iFESp_t)fcn; R_RAX=(int32_t)fn(emu, io_convert((void*)R_RDI), (void*)R_RSI); } -void iFwww(x64emu_t *emu, uintptr_t fcn) { iFwww_t fn = (iFwww_t)fcn; R_RAX=(int32_t)fn((int16_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX); } -void iFwpp(x64emu_t *emu, uintptr_t fcn) { iFwpp_t fn = (iFwpp_t)fcn; R_RAX=(int32_t)fn((int16_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void iFiwC(x64emu_t *emu, uintptr_t fcn) { iFiwC_t fn = (iFiwC_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int16_t)R_RSI, (uint8_t)R_RDX); } -void iFiii(x64emu_t *emu, uintptr_t fcn) { iFiii_t fn = (iFiii_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void iFiiI(x64emu_t *emu, uintptr_t fcn) { iFiiI_t fn = (iFiiI_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX); } -void iFiiu(x64emu_t *emu, uintptr_t fcn) { iFiiu_t fn = (iFiiu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); } -void iFiil(x64emu_t *emu, uintptr_t fcn) { iFiil_t fn = (iFiil_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX); } -void iFiip(x64emu_t *emu, uintptr_t fcn) { iFiip_t fn = (iFiip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void iFiiO(x64emu_t *emu, uintptr_t fcn) { iFiiO_t fn = (iFiiO_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, of_convert((int32_t)R_RDX)); } -void iFiCC(x64emu_t *emu, uintptr_t fcn) { iFiCC_t fn = (iFiCC_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX); } -void iFiui(x64emu_t *emu, uintptr_t fcn) { iFiui_t fn = (iFiui_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); } -void iFiuu(x64emu_t *emu, uintptr_t fcn) { iFiuu_t fn = (iFiuu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); } -void iFiup(x64emu_t *emu, uintptr_t fcn) { iFiup_t fn = (iFiup_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void iFill(x64emu_t *emu, uintptr_t fcn) { iFill_t fn = (iFill_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); } -void iFilp(x64emu_t *emu, uintptr_t fcn) { iFilp_t fn = (iFilp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); } -void iFiLi(x64emu_t *emu, uintptr_t fcn) { iFiLi_t fn = (iFiLi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); } -void iFiLp(x64emu_t *emu, uintptr_t fcn) { iFiLp_t fn = (iFiLp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void iFiLN(x64emu_t *emu, uintptr_t fcn) { iFiLN_t fn = (iFiLN_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void iFipi(x64emu_t *emu, uintptr_t fcn) { iFipi_t fn = (iFipi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void iFipu(x64emu_t *emu, uintptr_t fcn) { iFipu_t fn = (iFipu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void iFipL(x64emu_t *emu, uintptr_t fcn) { iFipL_t fn = (iFipL_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void iFipp(x64emu_t *emu, uintptr_t fcn) { iFipp_t fn = (iFipp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void iFipO(x64emu_t *emu, uintptr_t fcn) { iFipO_t fn = (iFipO_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, of_convert((int32_t)R_RDX)); } -void iFCuW(x64emu_t *emu, uintptr_t fcn) { iFCuW_t fn = (iFCuW_t)fcn; R_RAX=(int32_t)fn((uint8_t)R_RDI, (uint32_t)R_RSI, (uint16_t)R_RDX); } -void iFuwp(x64emu_t *emu, uintptr_t fcn) { iFuwp_t fn = (iFuwp_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (int16_t)R_RSI, (void*)R_RDX); } -void iFuip(x64emu_t *emu, uintptr_t fcn) { iFuip_t fn = (iFuip_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void iFuWp(x64emu_t *emu, uintptr_t fcn) { iFuWp_t fn = (iFuWp_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uint16_t)R_RSI, (void*)R_RDX); } -void iFuui(x64emu_t *emu, uintptr_t fcn) { iFuui_t fn = (iFuui_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); } -void iFuuu(x64emu_t *emu, uintptr_t fcn) { iFuuu_t fn = (iFuuu_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); } -void iFuup(x64emu_t *emu, uintptr_t fcn) { iFuup_t fn = (iFuup_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void iFuLL(x64emu_t *emu, uintptr_t fcn) { iFuLL_t fn = (iFuLL_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); } -void iFuLp(x64emu_t *emu, uintptr_t fcn) { iFuLp_t fn = (iFuLp_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void iFupi(x64emu_t *emu, uintptr_t fcn) { iFupi_t fn = (iFupi_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void iFupu(x64emu_t *emu, uintptr_t fcn) { iFupu_t fn = (iFupu_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void iFupL(x64emu_t *emu, uintptr_t fcn) { iFupL_t fn = (iFupL_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void iFupp(x64emu_t *emu, uintptr_t fcn) { iFupp_t fn = (iFupp_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void iFfff(x64emu_t *emu, uintptr_t fcn) { iFfff_t fn = (iFfff_t)fcn; R_RAX=(int32_t)fn(emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); } -void iFLip(x64emu_t *emu, uintptr_t fcn) { iFLip_t fn = (iFLip_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void iFLpp(x64emu_t *emu, uintptr_t fcn) { iFLpp_t fn = (iFLpp_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void iFpwp(x64emu_t *emu, uintptr_t fcn) { iFpwp_t fn = (iFpwp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int16_t)R_RSI, (void*)R_RDX); } -void iFpii(x64emu_t *emu, uintptr_t fcn) { iFpii_t fn = (iFpii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void iFpiI(x64emu_t *emu, uintptr_t fcn) { iFpiI_t fn = (iFpiI_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX); } -void iFpiC(x64emu_t *emu, uintptr_t fcn) { iFpiC_t fn = (iFpiC_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX); } -void iFpiW(x64emu_t *emu, uintptr_t fcn) { iFpiW_t fn = (iFpiW_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint16_t)R_RDX); } -void iFpiu(x64emu_t *emu, uintptr_t fcn) { iFpiu_t fn = (iFpiu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); } -void iFpiU(x64emu_t *emu, uintptr_t fcn) { iFpiU_t fn = (iFpiU_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX); } -void iFpid(x64emu_t *emu, uintptr_t fcn) { iFpid_t fn = (iFpid_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0]); } -void iFpil(x64emu_t *emu, uintptr_t fcn) { iFpil_t fn = (iFpil_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX); } -void iFpiL(x64emu_t *emu, uintptr_t fcn) { iFpiL_t fn = (iFpiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX); } -void iFpip(x64emu_t *emu, uintptr_t fcn) { iFpip_t fn = (iFpip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void iFpIi(x64emu_t *emu, uintptr_t fcn) { iFpIi_t fn = (iFpIi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); } -void iFpII(x64emu_t *emu, uintptr_t fcn) { iFpII_t fn = (iFpII_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX); } -void iFpCp(x64emu_t *emu, uintptr_t fcn) { iFpCp_t fn = (iFpCp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX); } -void iFpWp(x64emu_t *emu, uintptr_t fcn) { iFpWp_t fn = (iFpWp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX); } -void iFpui(x64emu_t *emu, uintptr_t fcn) { iFpui_t fn = (iFpui_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); } -void iFpuC(x64emu_t *emu, uintptr_t fcn) { iFpuC_t fn = (iFpuC_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint8_t)R_RDX); } -void iFpuu(x64emu_t *emu, uintptr_t fcn) { iFpuu_t fn = (iFpuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); } -void iFpuU(x64emu_t *emu, uintptr_t fcn) { iFpuU_t fn = (iFpuU_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX); } -void iFpul(x64emu_t *emu, uintptr_t fcn) { iFpul_t fn = (iFpul_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX); } -void iFpuL(x64emu_t *emu, uintptr_t fcn) { iFpuL_t fn = (iFpuL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); } -void iFpup(x64emu_t *emu, uintptr_t fcn) { iFpup_t fn = (iFpup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void iFpUu(x64emu_t *emu, uintptr_t fcn) { iFpUu_t fn = (iFpUu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX); } -void iFpUU(x64emu_t *emu, uintptr_t fcn) { iFpUU_t fn = (iFpUU_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX); } -void iFpUp(x64emu_t *emu, uintptr_t fcn) { iFpUp_t fn = (iFpUp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX); } -void iFpfu(x64emu_t *emu, uintptr_t fcn) { iFpfu_t fn = (iFpfu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, emu->xmm[0].f[0], (uint32_t)R_RSI); } -void iFpff(x64emu_t *emu, uintptr_t fcn) { iFpff_t fn = (iFpff_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void iFpdd(x64emu_t *emu, uintptr_t fcn) { iFpdd_t fn = (iFpdd_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void iFpli(x64emu_t *emu, uintptr_t fcn) { iFpli_t fn = (iFpli_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX); } -void iFpll(x64emu_t *emu, uintptr_t fcn) { iFpll_t fn = (iFpll_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); } -void iFplp(x64emu_t *emu, uintptr_t fcn) { iFplp_t fn = (iFplp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); } -void iFpLi(x64emu_t *emu, uintptr_t fcn) { iFpLi_t fn = (iFpLi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); } -void iFpLu(x64emu_t *emu, uintptr_t fcn) { iFpLu_t fn = (iFpLu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX); } -void iFpLl(x64emu_t *emu, uintptr_t fcn) { iFpLl_t fn = (iFpLl_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (intptr_t)R_RDX); } -void iFpLL(x64emu_t *emu, uintptr_t fcn) { iFpLL_t fn = (iFpLL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); } -void iFpLp(x64emu_t *emu, uintptr_t fcn) { iFpLp_t fn = (iFpLp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void iFppi(x64emu_t *emu, uintptr_t fcn) { iFppi_t fn = (iFppi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void iFppI(x64emu_t *emu, uintptr_t fcn) { iFppI_t fn = (iFppI_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX); } -void iFppC(x64emu_t *emu, uintptr_t fcn) { iFppC_t fn = (iFppC_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint8_t)R_RDX); } -void iFppW(x64emu_t *emu, uintptr_t fcn) { iFppW_t fn = (iFppW_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint16_t)R_RDX); } -void iFppu(x64emu_t *emu, uintptr_t fcn) { iFppu_t fn = (iFppu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void iFppU(x64emu_t *emu, uintptr_t fcn) { iFppU_t fn = (iFppU_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX); } -void iFppd(x64emu_t *emu, uintptr_t fcn) { iFppd_t fn = (iFppd_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0]); } -void iFppl(x64emu_t *emu, uintptr_t fcn) { iFppl_t fn = (iFppl_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); } -void iFppL(x64emu_t *emu, uintptr_t fcn) { iFppL_t fn = (iFppL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void iFppp(x64emu_t *emu, uintptr_t fcn) { iFppp_t fn = (iFppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void iFpOu(x64emu_t *emu, uintptr_t fcn) { iFpOu_t fn = (iFpOu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, of_convert((int32_t)R_RSI), (uint32_t)R_RDX); } -void iFpOM(x64emu_t *emu, uintptr_t fcn) { iFpOM_t fn = (iFpOM_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, of_convert((int32_t)R_RSI), (void*)R_RDX, (void*)R_RCX); } -void iFSpL(x64emu_t *emu, uintptr_t fcn) { iFSpL_t fn = (iFSpL_t)fcn; R_RAX=(int32_t)fn(io_convert((void*)R_RDI), (void*)R_RSI, (uintptr_t)R_RDX); } -void iFbpp(x64emu_t *emu, uintptr_t fcn) { iFbpp_t fn = (iFbpp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(int32_t)fn(aligned_xcb, (void*)R_RSI, (void*)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void IFiIi(x64emu_t *emu, uintptr_t fcn) { IFiIi_t fn = (IFiIi_t)fcn; R_RAX=(int64_t)fn((int32_t)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); } -void IFpIi(x64emu_t *emu, uintptr_t fcn) { IFpIi_t fn = (IFpIi_t)fcn; R_RAX=(int64_t)fn((void*)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); } -void IFppi(x64emu_t *emu, uintptr_t fcn) { IFppi_t fn = (IFppi_t)fcn; R_RAX=(int64_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void IFppI(x64emu_t *emu, uintptr_t fcn) { IFppI_t fn = (IFppI_t)fcn; R_RAX=(int64_t)fn((void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX); } -void IFSIi(x64emu_t *emu, uintptr_t fcn) { IFSIi_t fn = (IFSIi_t)fcn; R_RAX=(int64_t)fn(io_convert((void*)R_RDI), (int64_t)R_RSI, (int32_t)R_RDX); } -void CFipp(x64emu_t *emu, uintptr_t fcn) { CFipp_t fn = (CFipp_t)fcn; R_RAX=(unsigned char)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void CFuff(x64emu_t *emu, uintptr_t fcn) { CFuff_t fn = (CFuff_t)fcn; R_RAX=(unsigned char)fn((uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void CFuLu(x64emu_t *emu, uintptr_t fcn) { CFuLu_t fn = (CFuLu_t)fcn; R_RAX=(unsigned char)fn((uint32_t)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX); } -void CFppp(x64emu_t *emu, uintptr_t fcn) { CFppp_t fn = (CFppp_t)fcn; R_RAX=(unsigned char)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void WFppp(x64emu_t *emu, uintptr_t fcn) { WFppp_t fn = (WFppp_t)fcn; R_RAX=(unsigned short)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void uFEpW(x64emu_t *emu, uintptr_t fcn) { uFEpW_t fn = (uFEpW_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (uint16_t)R_RSI); } -void uFEpu(x64emu_t *emu, uintptr_t fcn) { uFEpu_t fn = (uFEpu_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI); } -void uFEpU(x64emu_t *emu, uintptr_t fcn) { uFEpU_t fn = (uFEpU_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (uint64_t)R_RSI); } -void uFEpp(x64emu_t *emu, uintptr_t fcn) { uFEpp_t fn = (uFEpp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (void*)R_RSI); } -void uFiuu(x64emu_t *emu, uintptr_t fcn) { uFiuu_t fn = (uFiuu_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); } -void uFilp(x64emu_t *emu, uintptr_t fcn) { uFilp_t fn = (uFilp_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); } -void uFipu(x64emu_t *emu, uintptr_t fcn) { uFipu_t fn = (uFipu_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void uFipL(x64emu_t *emu, uintptr_t fcn) { uFipL_t fn = (uFipL_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void uFuii(x64emu_t *emu, uintptr_t fcn) { uFuii_t fn = (uFuii_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void uFuip(x64emu_t *emu, uintptr_t fcn) { uFuip_t fn = (uFuip_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void uFuuu(x64emu_t *emu, uintptr_t fcn) { uFuuu_t fn = (uFuuu_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); } -void uFuup(x64emu_t *emu, uintptr_t fcn) { uFuup_t fn = (uFuup_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void uFufp(x64emu_t *emu, uintptr_t fcn) { uFufp_t fn = (uFufp_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, emu->xmm[0].f[0], (void*)R_RSI); } -void uFupu(x64emu_t *emu, uintptr_t fcn) { uFupu_t fn = (uFupu_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void uFupp(x64emu_t *emu, uintptr_t fcn) { uFupp_t fn = (uFupp_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void uFpii(x64emu_t *emu, uintptr_t fcn) { uFpii_t fn = (uFpii_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void uFpiu(x64emu_t *emu, uintptr_t fcn) { uFpiu_t fn = (uFpiu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); } -void uFpip(x64emu_t *emu, uintptr_t fcn) { uFpip_t fn = (uFpip_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void uFpCi(x64emu_t *emu, uintptr_t fcn) { uFpCi_t fn = (uFpCi_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX); } -void uFpWi(x64emu_t *emu, uintptr_t fcn) { uFpWi_t fn = (uFpWi_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX); } -void uFpWu(x64emu_t *emu, uintptr_t fcn) { uFpWu_t fn = (uFpWu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (uint32_t)R_RDX); } -void uFpWf(x64emu_t *emu, uintptr_t fcn) { uFpWf_t fn = (uFpWf_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint16_t)R_RSI, emu->xmm[0].f[0]); } -void uFpWp(x64emu_t *emu, uintptr_t fcn) { uFpWp_t fn = (uFpWp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX); } -void uFpui(x64emu_t *emu, uintptr_t fcn) { uFpui_t fn = (uFpui_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); } -void uFpuu(x64emu_t *emu, uintptr_t fcn) { uFpuu_t fn = (uFpuu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); } -void uFpuL(x64emu_t *emu, uintptr_t fcn) { uFpuL_t fn = (uFpuL_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); } -void uFpup(x64emu_t *emu, uintptr_t fcn) { uFpup_t fn = (uFpup_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void uFpfu(x64emu_t *emu, uintptr_t fcn) { uFpfu_t fn = (uFpfu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, emu->xmm[0].f[0], (uint32_t)R_RSI); } -void uFpli(x64emu_t *emu, uintptr_t fcn) { uFpli_t fn = (uFpli_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX); } -void uFpLu(x64emu_t *emu, uintptr_t fcn) { uFpLu_t fn = (uFpLu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX); } -void uFpLL(x64emu_t *emu, uintptr_t fcn) { uFpLL_t fn = (uFpLL_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); } -void uFpLp(x64emu_t *emu, uintptr_t fcn) { uFpLp_t fn = (uFpLp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void uFppi(x64emu_t *emu, uintptr_t fcn) { uFppi_t fn = (uFppi_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void uFppu(x64emu_t *emu, uintptr_t fcn) { uFppu_t fn = (uFppu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void uFppL(x64emu_t *emu, uintptr_t fcn) { uFppL_t fn = (uFppL_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void uFppp(x64emu_t *emu, uintptr_t fcn) { uFppp_t fn = (uFppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void uFbWW(x64emu_t *emu, uintptr_t fcn) { uFbWW_t fn = (uFbWW_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint16_t)R_RSI, (uint16_t)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbWu(x64emu_t *emu, uintptr_t fcn) { uFbWu_t fn = (uFbWu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint16_t)R_RSI, (uint32_t)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuC(x64emu_t *emu, uintptr_t fcn) { uFbuC_t fn = (uFbuC_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint8_t)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuW(x64emu_t *emu, uintptr_t fcn) { uFbuW_t fn = (uFbuW_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint16_t)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuu(x64emu_t *emu, uintptr_t fcn) { uFbuu_t fn = (uFbuu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuU(x64emu_t *emu, uintptr_t fcn) { uFbuU_t fn = (uFbuU_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint64_t)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbup(x64emu_t *emu, uintptr_t fcn) { uFbup_t fn = (uFbup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (void*)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void UFUii(x64emu_t *emu, uintptr_t fcn) { UFUii_t fn = (UFUii_t)fcn; R_RAX=fn((uint64_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void UFUUU(x64emu_t *emu, uintptr_t fcn) { UFUUU_t fn = (UFUUU_t)fcn; R_RAX=fn((uint64_t)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX); } -void UFpiU(x64emu_t *emu, uintptr_t fcn) { UFpiU_t fn = (UFpiU_t)fcn; R_RAX=fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX); } -void UFppi(x64emu_t *emu, uintptr_t fcn) { UFppi_t fn = (UFppi_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void fFuii(x64emu_t *emu, uintptr_t fcn) { fFuii_t fn = (fFuii_t)fcn; emu->xmm[0].f[0]=fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void fFfff(x64emu_t *emu, uintptr_t fcn) { fFfff_t fn = (fFfff_t)fcn; emu->xmm[0].f[0]=fn(emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); } -void fFffp(x64emu_t *emu, uintptr_t fcn) { fFffp_t fn = (fFffp_t)fcn; emu->xmm[0].f[0]=fn(emu->xmm[0].f[0], emu->xmm[1].f[0], (void*)R_RDI); } -void fFppi(x64emu_t *emu, uintptr_t fcn) { fFppi_t fn = (fFppi_t)fcn; emu->xmm[0].f[0]=fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void fFppL(x64emu_t *emu, uintptr_t fcn) { fFppL_t fn = (fFppL_t)fcn; emu->xmm[0].f[0]=fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void fFppp(x64emu_t *emu, uintptr_t fcn) { fFppp_t fn = (fFppp_t)fcn; emu->xmm[0].f[0]=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void dFuud(x64emu_t *emu, uintptr_t fcn) { dFuud_t fn = (dFuud_t)fcn; emu->xmm[0].d[0]=fn((uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0]); } -void dFddd(x64emu_t *emu, uintptr_t fcn) { dFddd_t fn = (dFddd_t)fcn; emu->xmm[0].d[0]=fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); } -void dFddp(x64emu_t *emu, uintptr_t fcn) { dFddp_t fn = (dFddp_t)fcn; emu->xmm[0].d[0]=fn(emu->xmm[0].d[0], emu->xmm[1].d[0], (void*)R_RDI); } -void dFpii(x64emu_t *emu, uintptr_t fcn) { dFpii_t fn = (dFpii_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void dFpdd(x64emu_t *emu, uintptr_t fcn) { dFpdd_t fn = (dFpdd_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void dFppi(x64emu_t *emu, uintptr_t fcn) { dFppi_t fn = (dFppi_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void dFppu(x64emu_t *emu, uintptr_t fcn) { dFppu_t fn = (dFppu_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void dFppd(x64emu_t *emu, uintptr_t fcn) { dFppd_t fn = (dFppd_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0]); } -void dFppp(x64emu_t *emu, uintptr_t fcn) { dFppp_t fn = (dFppp_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void DFppi(x64emu_t *emu, uintptr_t fcn) { DFppi_t fn = (DFppi_t)fcn; long double ld=fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); fpu_do_push(emu); ST0val = ld; } -void DFppp(x64emu_t *emu, uintptr_t fcn) { DFppp_t fn = (DFppp_t)fcn; long double ld=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); fpu_do_push(emu); ST0val = ld; } -void lFili(x64emu_t *emu, uintptr_t fcn) { lFili_t fn = (lFili_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX); } -void lFilL(x64emu_t *emu, uintptr_t fcn) { lFilL_t fn = (lFilL_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (intptr_t)R_RSI, (uintptr_t)R_RDX); } -void lFipi(x64emu_t *emu, uintptr_t fcn) { lFipi_t fn = (lFipi_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void lFipL(x64emu_t *emu, uintptr_t fcn) { lFipL_t fn = (lFipL_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void lFlll(x64emu_t *emu, uintptr_t fcn) { lFlll_t fn = (lFlll_t)fcn; R_RAX=(intptr_t)fn((intptr_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); } -void lFpli(x64emu_t *emu, uintptr_t fcn) { lFpli_t fn = (lFpli_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX); } -void lFpLu(x64emu_t *emu, uintptr_t fcn) { lFpLu_t fn = (lFpLu_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX); } -void lFpLp(x64emu_t *emu, uintptr_t fcn) { lFpLp_t fn = (lFpLp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void lFppi(x64emu_t *emu, uintptr_t fcn) { lFppi_t fn = (lFppi_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void lFppu(x64emu_t *emu, uintptr_t fcn) { lFppu_t fn = (lFppu_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void lFppL(x64emu_t *emu, uintptr_t fcn) { lFppL_t fn = (lFppL_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void lFppp(x64emu_t *emu, uintptr_t fcn) { lFppp_t fn = (lFppp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void lFSpl(x64emu_t *emu, uintptr_t fcn) { lFSpl_t fn = (lFSpl_t)fcn; R_RAX=(intptr_t)fn(io_convert((void*)R_RDI), (void*)R_RSI, (intptr_t)R_RDX); } -void LFEpA(x64emu_t *emu, uintptr_t fcn) { LFEpA_t fn = (LFEpA_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI); } -void LFipL(x64emu_t *emu, uintptr_t fcn) { LFipL_t fn = (LFipL_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void LFuui(x64emu_t *emu, uintptr_t fcn) { LFuui_t fn = (LFuui_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); } -void LFLii(x64emu_t *emu, uintptr_t fcn) { LFLii_t fn = (LFLii_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void LFLLl(x64emu_t *emu, uintptr_t fcn) { LFLLl_t fn = (LFLLl_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI, (intptr_t)R_RDX); } -void LFLLL(x64emu_t *emu, uintptr_t fcn) { LFLLL_t fn = (LFLLL_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); } -void LFLpu(x64emu_t *emu, uintptr_t fcn) { LFLpu_t fn = (LFLpu_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void LFLpL(x64emu_t *emu, uintptr_t fcn) { LFLpL_t fn = (LFLpL_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void LFpii(x64emu_t *emu, uintptr_t fcn) { LFpii_t fn = (LFpii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void LFpCi(x64emu_t *emu, uintptr_t fcn) { LFpCi_t fn = (LFpCi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX); } -void LFpuL(x64emu_t *emu, uintptr_t fcn) { LFpuL_t fn = (LFpuL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); } -void LFpup(x64emu_t *emu, uintptr_t fcn) { LFpup_t fn = (LFpup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void LFpLi(x64emu_t *emu, uintptr_t fcn) { LFpLi_t fn = (LFpLi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); } -void LFpLL(x64emu_t *emu, uintptr_t fcn) { LFpLL_t fn = (LFpLL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); } -void LFpLp(x64emu_t *emu, uintptr_t fcn) { LFpLp_t fn = (LFpLp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void LFppi(x64emu_t *emu, uintptr_t fcn) { LFppi_t fn = (LFppi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void LFppu(x64emu_t *emu, uintptr_t fcn) { LFppu_t fn = (LFppu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void LFppL(x64emu_t *emu, uintptr_t fcn) { LFppL_t fn = (LFppL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void LFppp(x64emu_t *emu, uintptr_t fcn) { LFppp_t fn = (LFppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void LFSpL(x64emu_t *emu, uintptr_t fcn) { LFSpL_t fn = (LFSpL_t)fcn; R_RAX=(uintptr_t)fn(io_convert((void*)R_RDI), (void*)R_RSI, (uintptr_t)R_RDX); } -void pFEip(x64emu_t *emu, uintptr_t fcn) { pFEip_t fn = (pFEip_t)fcn; R_RAX=(uintptr_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI); } -void pFEiV(x64emu_t *emu, uintptr_t fcn) { pFEiV_t fn = (pFEiV_t)fcn; R_RAX=(uintptr_t)fn(emu, (int32_t)R_RDI, (void*)(R_RSP + 8)); } -void pFEup(x64emu_t *emu, uintptr_t fcn) { pFEup_t fn = (pFEup_t)fcn; R_RAX=(uintptr_t)fn(emu, (uint32_t)R_RDI, (void*)R_RSI); } -void pFEuV(x64emu_t *emu, uintptr_t fcn) { pFEuV_t fn = (pFEuV_t)fcn; R_RAX=(uintptr_t)fn(emu, (uint32_t)R_RDI, (void*)(R_RSP + 8)); } -void pFEpi(x64emu_t *emu, uintptr_t fcn) { pFEpi_t fn = (pFEpi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI); } -void pFEpu(x64emu_t *emu, uintptr_t fcn) { pFEpu_t fn = (pFEpu_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI); } -void pFEpp(x64emu_t *emu, uintptr_t fcn) { pFEpp_t fn = (pFEpp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI); } -void pFEpV(x64emu_t *emu, uintptr_t fcn) { pFEpV_t fn = (pFEpV_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)(R_RSP + 8)); } -void pFEpA(x64emu_t *emu, uintptr_t fcn) { pFEpA_t fn = (pFEpA_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI); } -void pFiii(x64emu_t *emu, uintptr_t fcn) { pFiii_t fn = (pFiii_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void pFiiu(x64emu_t *emu, uintptr_t fcn) { pFiiu_t fn = (pFiiu_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); } -void pFiip(x64emu_t *emu, uintptr_t fcn) { pFiip_t fn = (pFiip_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void pFiIi(x64emu_t *emu, uintptr_t fcn) { pFiIi_t fn = (pFiIi_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); } -void pFiLL(x64emu_t *emu, uintptr_t fcn) { pFiLL_t fn = (pFiLL_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); } -void pFipi(x64emu_t *emu, uintptr_t fcn) { pFipi_t fn = (pFipi_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void pFipL(x64emu_t *emu, uintptr_t fcn) { pFipL_t fn = (pFipL_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void pFipp(x64emu_t *emu, uintptr_t fcn) { pFipp_t fn = (pFipp_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void pFCuW(x64emu_t *emu, uintptr_t fcn) { pFCuW_t fn = (pFCuW_t)fcn; R_RAX=(uintptr_t)fn((uint8_t)R_RDI, (uint32_t)R_RSI, (uint16_t)R_RDX); } -void pFWWW(x64emu_t *emu, uintptr_t fcn) { pFWWW_t fn = (pFWWW_t)fcn; R_RAX=(uintptr_t)fn((uint16_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX); } -void pFuip(x64emu_t *emu, uintptr_t fcn) { pFuip_t fn = (pFuip_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void pFuui(x64emu_t *emu, uintptr_t fcn) { pFuui_t fn = (pFuui_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); } -void pFuuu(x64emu_t *emu, uintptr_t fcn) { pFuuu_t fn = (pFuuu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); } -void pFulu(x64emu_t *emu, uintptr_t fcn) { pFulu_t fn = (pFulu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX); } -void pFulp(x64emu_t *emu, uintptr_t fcn) { pFulp_t fn = (pFulp_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); } -void pFupi(x64emu_t *emu, uintptr_t fcn) { pFupi_t fn = (pFupi_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void pFupu(x64emu_t *emu, uintptr_t fcn) { pFupu_t fn = (pFupu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void pFupl(x64emu_t *emu, uintptr_t fcn) { pFupl_t fn = (pFupl_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); } -void pFupL(x64emu_t *emu, uintptr_t fcn) { pFupL_t fn = (pFupL_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void pFupp(x64emu_t *emu, uintptr_t fcn) { pFupp_t fn = (pFupp_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void pFdip(x64emu_t *emu, uintptr_t fcn) { pFdip_t fn = (pFdip_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0], (int32_t)R_RDI, (void*)R_RSI); } -void pFdUU(x64emu_t *emu, uintptr_t fcn) { pFdUU_t fn = (pFdUU_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0], (uint64_t)R_RDI, (uint64_t)R_RSI); } -void pFddi(x64emu_t *emu, uintptr_t fcn) { pFddi_t fn = (pFddi_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RDI); } -void pFddd(x64emu_t *emu, uintptr_t fcn) { pFddd_t fn = (pFddd_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); } -void pFDip(x64emu_t *emu, uintptr_t fcn) { pFDip_t fn = (pFDip_t)fcn; R_RAX=(uintptr_t)fn(LD2localLD((void*)(R_RSP + 8)), (int32_t)R_RDI, (void*)R_RSI); } -void pFlpi(x64emu_t *emu, uintptr_t fcn) { pFlpi_t fn = (pFlpi_t)fcn; R_RAX=(uintptr_t)fn((intptr_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void pFLup(x64emu_t *emu, uintptr_t fcn) { pFLup_t fn = (pFLup_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void pFLLp(x64emu_t *emu, uintptr_t fcn) { pFLLp_t fn = (pFLLp_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void pFLpi(x64emu_t *emu, uintptr_t fcn) { pFLpi_t fn = (pFLpi_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void pFLpp(x64emu_t *emu, uintptr_t fcn) { pFLpp_t fn = (pFLpp_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void pFpii(x64emu_t *emu, uintptr_t fcn) { pFpii_t fn = (pFpii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void pFpiu(x64emu_t *emu, uintptr_t fcn) { pFpiu_t fn = (pFpiu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); } -void pFpid(x64emu_t *emu, uintptr_t fcn) { pFpid_t fn = (pFpid_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0]); } -void pFpil(x64emu_t *emu, uintptr_t fcn) { pFpil_t fn = (pFpil_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX); } -void pFpiL(x64emu_t *emu, uintptr_t fcn) { pFpiL_t fn = (pFpiL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX); } -void pFpip(x64emu_t *emu, uintptr_t fcn) { pFpip_t fn = (pFpip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void pFpCi(x64emu_t *emu, uintptr_t fcn) { pFpCi_t fn = (pFpCi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX); } -void pFpCu(x64emu_t *emu, uintptr_t fcn) { pFpCu_t fn = (pFpCu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX); } -void pFpWi(x64emu_t *emu, uintptr_t fcn) { pFpWi_t fn = (pFpWi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX); } -void pFpWW(x64emu_t *emu, uintptr_t fcn) { pFpWW_t fn = (pFpWW_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX); } -void pFpWp(x64emu_t *emu, uintptr_t fcn) { pFpWp_t fn = (pFpWp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX); } -void pFpui(x64emu_t *emu, uintptr_t fcn) { pFpui_t fn = (pFpui_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); } -void pFpuu(x64emu_t *emu, uintptr_t fcn) { pFpuu_t fn = (pFpuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX); } -void pFpuL(x64emu_t *emu, uintptr_t fcn) { pFpuL_t fn = (pFpuL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); } -void pFpup(x64emu_t *emu, uintptr_t fcn) { pFpup_t fn = (pFpup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void pFpUi(x64emu_t *emu, uintptr_t fcn) { pFpUi_t fn = (pFpUi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX); } -void pFpUu(x64emu_t *emu, uintptr_t fcn) { pFpUu_t fn = (pFpUu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX); } -void pFpdu(x64emu_t *emu, uintptr_t fcn) { pFpdu_t fn = (pFpdu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, emu->xmm[0].d[0], (uint32_t)R_RSI); } -void pFpdd(x64emu_t *emu, uintptr_t fcn) { pFpdd_t fn = (pFpdd_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void pFplC(x64emu_t *emu, uintptr_t fcn) { pFplC_t fn = (pFplC_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (uint8_t)R_RDX); } -void pFplu(x64emu_t *emu, uintptr_t fcn) { pFplu_t fn = (pFplu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX); } -void pFpll(x64emu_t *emu, uintptr_t fcn) { pFpll_t fn = (pFpll_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX); } -void pFplp(x64emu_t *emu, uintptr_t fcn) { pFplp_t fn = (pFplp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX); } -void pFpLi(x64emu_t *emu, uintptr_t fcn) { pFpLi_t fn = (pFpLi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); } -void pFpLu(x64emu_t *emu, uintptr_t fcn) { pFpLu_t fn = (pFpLu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX); } -void pFpLL(x64emu_t *emu, uintptr_t fcn) { pFpLL_t fn = (pFpLL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX); } -void pFpLp(x64emu_t *emu, uintptr_t fcn) { pFpLp_t fn = (pFpLp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void pFppi(x64emu_t *emu, uintptr_t fcn) { pFppi_t fn = (pFppi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void pFppI(x64emu_t *emu, uintptr_t fcn) { pFppI_t fn = (pFppI_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX); } -void pFppC(x64emu_t *emu, uintptr_t fcn) { pFppC_t fn = (pFppC_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint8_t)R_RDX); } -void pFppu(x64emu_t *emu, uintptr_t fcn) { pFppu_t fn = (pFppu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void pFppU(x64emu_t *emu, uintptr_t fcn) { pFppU_t fn = (pFppU_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX); } -void pFppf(x64emu_t *emu, uintptr_t fcn) { pFppf_t fn = (pFppf_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0]); } -void pFppl(x64emu_t *emu, uintptr_t fcn) { pFppl_t fn = (pFppl_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); } -void pFppL(x64emu_t *emu, uintptr_t fcn) { pFppL_t fn = (pFppL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void pFppp(x64emu_t *emu, uintptr_t fcn) { pFppp_t fn = (pFppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void pFppA(x64emu_t *emu, uintptr_t fcn) { pFppA_t fn = (pFppA_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void pFpOM(x64emu_t *emu, uintptr_t fcn) { pFpOM_t fn = (pFpOM_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, of_convert((int32_t)R_RSI), (void*)R_RDX, (void*)R_RCX); } -void pFpbi(x64emu_t *emu, uintptr_t fcn) { pFpbi_t fn = (pFpbi_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RSI); R_RAX=(uintptr_t)fn((void*)R_RDI, aligned_xcb, (int32_t)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RSI); } -void pFSpl(x64emu_t *emu, uintptr_t fcn) { pFSpl_t fn = (pFSpl_t)fcn; R_RAX=(uintptr_t)fn(io_convert((void*)R_RDI), (void*)R_RSI, (intptr_t)R_RDX); } -void pFbCC(x64emu_t *emu, uintptr_t fcn) { pFbCC_t fn = (pFbCC_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint8_t)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuu(x64emu_t *emu, uintptr_t fcn) { pFbuu_t fn = (pFbuu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbup(x64emu_t *emu, uintptr_t fcn) { pFbup_t fn = (pFbup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (void*)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbUp(x64emu_t *emu, uintptr_t fcn) { pFbUp_t fn = (pFbUp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint64_t)R_RSI, (void*)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbpi(x64emu_t *emu, uintptr_t fcn) { pFbpi_t fn = (pFbpi_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI, (int32_t)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbpu(x64emu_t *emu, uintptr_t fcn) { pFbpu_t fn = (pFbpu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI, (uint32_t)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbpp(x64emu_t *emu, uintptr_t fcn) { pFbpp_t fn = (pFbpp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI, (void*)R_RDX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void vWpup(x64emu_t *emu, uintptr_t fcn) { vWpup_t fn = (vWpup_t)fcn; fn((void*)R_RCX, (uint32_t)R_RDX, (void*)R_R8); } -void iWEip(x64emu_t *emu, uintptr_t fcn) { iWEip_t fn = (iWEip_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RCX, (void*)R_RDX); } -void iWEpp(x64emu_t *emu, uintptr_t fcn) { iWEpp_t fn = (iWEpp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (void*)R_RDX); } -void iWpiu(x64emu_t *emu, uintptr_t fcn) { iWpiu_t fn = (iWpiu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (int32_t)R_RDX, (uint32_t)R_R8); } -void iWpip(x64emu_t *emu, uintptr_t fcn) { iWpip_t fn = (iWpip_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (int32_t)R_RDX, (void*)R_R8); } -void iWpui(x64emu_t *emu, uintptr_t fcn) { iWpui_t fn = (iWpui_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8); } -void iWpuu(x64emu_t *emu, uintptr_t fcn) { iWpuu_t fn = (iWpuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8); } -void iWpup(x64emu_t *emu, uintptr_t fcn) { iWpup_t fn = (iWpup_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (void*)R_R8); } -void iWppu(x64emu_t *emu, uintptr_t fcn) { iWppu_t fn = (iWppu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX, (uint32_t)R_R8); } -void iWppp(x64emu_t *emu, uintptr_t fcn) { iWppp_t fn = (iWppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX, (void*)R_R8); } -void uWpui(x64emu_t *emu, uintptr_t fcn) { uWpui_t fn = (uWpui_t)fcn; R_RAX=(uint32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8); } -void uWpup(x64emu_t *emu, uintptr_t fcn) { uWpup_t fn = (uWpup_t)fcn; R_RAX=(uint32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (void*)R_R8); } -void vFEiip(x64emu_t *emu, uintptr_t fcn) { vFEiip_t fn = (vFEiip_t)fcn; fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void vFEipp(x64emu_t *emu, uintptr_t fcn) { vFEipp_t fn = (vFEipp_t)fcn; fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void vFEipV(x64emu_t *emu, uintptr_t fcn) { vFEipV_t fn = (vFEipV_t)fcn; fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); } -void vFEipA(x64emu_t *emu, uintptr_t fcn) { vFEipA_t fn = (vFEipA_t)fcn; fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void vFELLp(x64emu_t *emu, uintptr_t fcn) { vFELLp_t fn = (vFELLp_t)fcn; fn(emu, (uintptr_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void vFEpii(x64emu_t *emu, uintptr_t fcn) { vFEpii_t fn = (vFEpii_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void vFEpip(x64emu_t *emu, uintptr_t fcn) { vFEpip_t fn = (vFEpip_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void vFEpiA(x64emu_t *emu, uintptr_t fcn) { vFEpiA_t fn = (vFEpiA_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void vFEpup(x64emu_t *emu, uintptr_t fcn) { vFEpup_t fn = (vFEpup_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void vFEpUp(x64emu_t *emu, uintptr_t fcn) { vFEpUp_t fn = (vFEpUp_t)fcn; fn(emu, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX); } -void vFEppp(x64emu_t *emu, uintptr_t fcn) { vFEppp_t fn = (vFEppp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void vFEppV(x64emu_t *emu, uintptr_t fcn) { vFEppV_t fn = (vFEppV_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); } -void vFEppA(x64emu_t *emu, uintptr_t fcn) { vFEppA_t fn = (vFEppA_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void vFcccc(x64emu_t *emu, uintptr_t fcn) { vFcccc_t fn = (vFcccc_t)fcn; fn((int8_t)R_RDI, (int8_t)R_RSI, (int8_t)R_RDX, (int8_t)R_RCX); } -void vFwwww(x64emu_t *emu, uintptr_t fcn) { vFwwww_t fn = (vFwwww_t)fcn; fn((int16_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX); } -void vFiiii(x64emu_t *emu, uintptr_t fcn) { vFiiii_t fn = (vFiiii_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void vFiiip(x64emu_t *emu, uintptr_t fcn) { vFiiip_t fn = (vFiiip_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void vFiiCp(x64emu_t *emu, uintptr_t fcn) { vFiiCp_t fn = (vFiiCp_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX, (void*)R_RCX); } -void vFiill(x64emu_t *emu, uintptr_t fcn) { vFiill_t fn = (vFiill_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); } -void vFiipV(x64emu_t *emu, uintptr_t fcn) { vFiipV_t fn = (vFiipV_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void vFiuip(x64emu_t *emu, uintptr_t fcn) { vFiuip_t fn = (vFiuip_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void vFiuuu(x64emu_t *emu, uintptr_t fcn) { vFiuuu_t fn = (vFiuuu_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void vFiulp(x64emu_t *emu, uintptr_t fcn) { vFiulp_t fn = (vFiulp_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); } -void vFiupV(x64emu_t *emu, uintptr_t fcn) { vFiupV_t fn = (vFiupV_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void vFifff(x64emu_t *emu, uintptr_t fcn) { vFifff_t fn = (vFifff_t)fcn; fn((int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); } -void vFiddd(x64emu_t *emu, uintptr_t fcn) { vFiddd_t fn = (vFiddd_t)fcn; fn((int32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); } -void vFilip(x64emu_t *emu, uintptr_t fcn) { vFilip_t fn = (vFilip_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void vFilll(x64emu_t *emu, uintptr_t fcn) { vFilll_t fn = (vFilll_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); } -void vFilpu(x64emu_t *emu, uintptr_t fcn) { vFilpu_t fn = (vFilpu_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void vFilpp(x64emu_t *emu, uintptr_t fcn) { vFilpp_t fn = (vFilpp_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFiLLL(x64emu_t *emu, uintptr_t fcn) { vFiLLL_t fn = (vFiLLL_t)fcn; fn((int32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void vFipii(x64emu_t *emu, uintptr_t fcn) { vFipii_t fn = (vFipii_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void vFipup(x64emu_t *emu, uintptr_t fcn) { vFipup_t fn = (vFipup_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void vFipll(x64emu_t *emu, uintptr_t fcn) { vFipll_t fn = (vFipll_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); } -void vFippL(x64emu_t *emu, uintptr_t fcn) { vFippL_t fn = (vFippL_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void vFippp(x64emu_t *emu, uintptr_t fcn) { vFippp_t fn = (vFippp_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFCCCC(x64emu_t *emu, uintptr_t fcn) { vFCCCC_t fn = (vFCCCC_t)fcn; fn((uint8_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX); } -void vFWWWW(x64emu_t *emu, uintptr_t fcn) { vFWWWW_t fn = (vFWWWW_t)fcn; fn((uint16_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint16_t)R_RCX); } -void vFuccc(x64emu_t *emu, uintptr_t fcn) { vFuccc_t fn = (vFuccc_t)fcn; fn((uint32_t)R_RDI, (int8_t)R_RSI, (int8_t)R_RDX, (int8_t)R_RCX); } -void vFuwww(x64emu_t *emu, uintptr_t fcn) { vFuwww_t fn = (vFuwww_t)fcn; fn((uint32_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX); } -void vFuiii(x64emu_t *emu, uintptr_t fcn) { vFuiii_t fn = (vFuiii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void vFuiiu(x64emu_t *emu, uintptr_t fcn) { vFuiiu_t fn = (vFuiiu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } -void vFuiip(x64emu_t *emu, uintptr_t fcn) { vFuiip_t fn = (vFuiip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void vFuiui(x64emu_t *emu, uintptr_t fcn) { vFuiui_t fn = (vFuiui_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); } -void vFuiuC(x64emu_t *emu, uintptr_t fcn) { vFuiuC_t fn = (vFuiuC_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX); } -void vFuiuu(x64emu_t *emu, uintptr_t fcn) { vFuiuu_t fn = (vFuiuu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void vFuiup(x64emu_t *emu, uintptr_t fcn) { vFuiup_t fn = (vFuiup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void vFuifi(x64emu_t *emu, uintptr_t fcn) { vFuifi_t fn = (vFuifi_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0], (int32_t)R_RDX); } -void vFuiff(x64emu_t *emu, uintptr_t fcn) { vFuiff_t fn = (vFuiff_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void vFuidd(x64emu_t *emu, uintptr_t fcn) { vFuidd_t fn = (vFuidd_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void vFuill(x64emu_t *emu, uintptr_t fcn) { vFuill_t fn = (vFuill_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); } -void vFuilp(x64emu_t *emu, uintptr_t fcn) { vFuilp_t fn = (vFuilp_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); } -void vFuiLL(x64emu_t *emu, uintptr_t fcn) { vFuiLL_t fn = (vFuiLL_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void vFuipi(x64emu_t *emu, uintptr_t fcn) { vFuipi_t fn = (vFuipi_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void vFuipu(x64emu_t *emu, uintptr_t fcn) { vFuipu_t fn = (vFuipu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void vFuipp(x64emu_t *emu, uintptr_t fcn) { vFuipp_t fn = (vFuipp_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFuWWW(x64emu_t *emu, uintptr_t fcn) { vFuWWW_t fn = (vFuWWW_t)fcn; fn((uint32_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint16_t)R_RCX); } -void vFuuii(x64emu_t *emu, uintptr_t fcn) { vFuuii_t fn = (vFuuii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void vFuuiu(x64emu_t *emu, uintptr_t fcn) { vFuuiu_t fn = (vFuuiu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } -void vFuuil(x64emu_t *emu, uintptr_t fcn) { vFuuil_t fn = (vFuuil_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX); } -void vFuuip(x64emu_t *emu, uintptr_t fcn) { vFuuip_t fn = (vFuuip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void vFuuCu(x64emu_t *emu, uintptr_t fcn) { vFuuCu_t fn = (vFuuCu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint8_t)R_RDX, (uint32_t)R_RCX); } -void vFuuCp(x64emu_t *emu, uintptr_t fcn) { vFuuCp_t fn = (vFuuCp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint8_t)R_RDX, (void*)R_RCX); } -void vFuuui(x64emu_t *emu, uintptr_t fcn) { vFuuui_t fn = (vFuuui_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); } -void vFuuuu(x64emu_t *emu, uintptr_t fcn) { vFuuuu_t fn = (vFuuuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void vFuuuf(x64emu_t *emu, uintptr_t fcn) { vFuuuf_t fn = (vFuuuf_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, emu->xmm[0].f[0]); } -void vFuuud(x64emu_t *emu, uintptr_t fcn) { vFuuud_t fn = (vFuuud_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, emu->xmm[0].d[0]); } -void vFuuul(x64emu_t *emu, uintptr_t fcn) { vFuuul_t fn = (vFuuul_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX); } -void vFuuup(x64emu_t *emu, uintptr_t fcn) { vFuuup_t fn = (vFuuup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void vFuuff(x64emu_t *emu, uintptr_t fcn) { vFuuff_t fn = (vFuuff_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void vFuuli(x64emu_t *emu, uintptr_t fcn) { vFuuli_t fn = (vFuuli_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX); } -void vFuulp(x64emu_t *emu, uintptr_t fcn) { vFuulp_t fn = (vFuulp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); } -void vFuuLl(x64emu_t *emu, uintptr_t fcn) { vFuuLl_t fn = (vFuuLl_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX); } -void vFuupi(x64emu_t *emu, uintptr_t fcn) { vFuupi_t fn = (vFuupi_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void vFuupp(x64emu_t *emu, uintptr_t fcn) { vFuupp_t fn = (vFuupp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFufff(x64emu_t *emu, uintptr_t fcn) { vFufff_t fn = (vFufff_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); } -void vFuddd(x64emu_t *emu, uintptr_t fcn) { vFuddd_t fn = (vFuddd_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); } -void vFuluL(x64emu_t *emu, uintptr_t fcn) { vFuluL_t fn = (vFuluL_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX); } -void vFullC(x64emu_t *emu, uintptr_t fcn) { vFullC_t fn = (vFullC_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uint8_t)R_RCX); } -void vFulll(x64emu_t *emu, uintptr_t fcn) { vFulll_t fn = (vFulll_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); } -void vFullp(x64emu_t *emu, uintptr_t fcn) { vFullp_t fn = (vFullp_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); } -void vFulpi(x64emu_t *emu, uintptr_t fcn) { vFulpi_t fn = (vFulpi_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void vFulpu(x64emu_t *emu, uintptr_t fcn) { vFulpu_t fn = (vFulpu_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void vFulpp(x64emu_t *emu, uintptr_t fcn) { vFulpp_t fn = (vFulpp_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFuLui(x64emu_t *emu, uintptr_t fcn) { vFuLui_t fn = (vFuLui_t)fcn; fn((uint32_t)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); } -void vFuLup(x64emu_t *emu, uintptr_t fcn) { vFuLup_t fn = (vFuLup_t)fcn; fn((uint32_t)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void vFuLLL(x64emu_t *emu, uintptr_t fcn) { vFuLLL_t fn = (vFuLLL_t)fcn; fn((uint32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void vFupii(x64emu_t *emu, uintptr_t fcn) { vFupii_t fn = (vFupii_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void vFuppi(x64emu_t *emu, uintptr_t fcn) { vFuppi_t fn = (vFuppi_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void vFuppu(x64emu_t *emu, uintptr_t fcn) { vFuppu_t fn = (vFuppu_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void vFUUpi(x64emu_t *emu, uintptr_t fcn) { vFUUpi_t fn = (vFUUpi_t)fcn; fn((uint64_t)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void vFffff(x64emu_t *emu, uintptr_t fcn) { vFffff_t fn = (vFffff_t)fcn; fn(emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); } -void vFdddd(x64emu_t *emu, uintptr_t fcn) { vFdddd_t fn = (vFdddd_t)fcn; fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void vFllii(x64emu_t *emu, uintptr_t fcn) { vFllii_t fn = (vFllii_t)fcn; fn((intptr_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void vFLuui(x64emu_t *emu, uintptr_t fcn) { vFLuui_t fn = (vFLuui_t)fcn; fn((uintptr_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); } -void vFLppi(x64emu_t *emu, uintptr_t fcn) { vFLppi_t fn = (vFLppi_t)fcn; fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void vFpiii(x64emu_t *emu, uintptr_t fcn) { vFpiii_t fn = (vFpiii_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void vFpiiu(x64emu_t *emu, uintptr_t fcn) { vFpiiu_t fn = (vFpiiu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } -void vFpiid(x64emu_t *emu, uintptr_t fcn) { vFpiid_t fn = (vFpiid_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[0].d[0]); } -void vFpiip(x64emu_t *emu, uintptr_t fcn) { vFpiip_t fn = (vFpiip_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void vFpiui(x64emu_t *emu, uintptr_t fcn) { vFpiui_t fn = (vFpiui_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); } -void vFpiuu(x64emu_t *emu, uintptr_t fcn) { vFpiuu_t fn = (vFpiuu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void vFpiuL(x64emu_t *emu, uintptr_t fcn) { vFpiuL_t fn = (vFpiuL_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX); } -void vFpiup(x64emu_t *emu, uintptr_t fcn) { vFpiup_t fn = (vFpiup_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void vFpiUu(x64emu_t *emu, uintptr_t fcn) { vFpiUu_t fn = (vFpiUu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX); } -void vFpiUU(x64emu_t *emu, uintptr_t fcn) { vFpiUU_t fn = (vFpiUU_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX); } -void vFpifi(x64emu_t *emu, uintptr_t fcn) { vFpifi_t fn = (vFpifi_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0], (int32_t)R_RDX); } -void vFpipi(x64emu_t *emu, uintptr_t fcn) { vFpipi_t fn = (vFpipi_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void vFpipu(x64emu_t *emu, uintptr_t fcn) { vFpipu_t fn = (vFpipu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void vFpipp(x64emu_t *emu, uintptr_t fcn) { vFpipp_t fn = (vFpipp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFpIdi(x64emu_t *emu, uintptr_t fcn) { vFpIdi_t fn = (vFpIdi_t)fcn; fn((void*)R_RDI, (int64_t)R_RSI, emu->xmm[0].d[0], (int32_t)R_RDX); } -void vFpCuW(x64emu_t *emu, uintptr_t fcn) { vFpCuW_t fn = (vFpCuW_t)fcn; fn((void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX); } -void vFpuii(x64emu_t *emu, uintptr_t fcn) { vFpuii_t fn = (vFpuii_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void vFpuip(x64emu_t *emu, uintptr_t fcn) { vFpuip_t fn = (vFpuip_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void vFpuuu(x64emu_t *emu, uintptr_t fcn) { vFpuuu_t fn = (vFpuuu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void vFpuup(x64emu_t *emu, uintptr_t fcn) { vFpuup_t fn = (vFpuup_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void vFpufi(x64emu_t *emu, uintptr_t fcn) { vFpufi_t fn = (vFpufi_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], (int32_t)R_RDX); } -void vFpudd(x64emu_t *emu, uintptr_t fcn) { vFpudd_t fn = (vFpudd_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void vFpupu(x64emu_t *emu, uintptr_t fcn) { vFpupu_t fn = (vFpupu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void vFpupp(x64emu_t *emu, uintptr_t fcn) { vFpupp_t fn = (vFpupp_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFpUuu(x64emu_t *emu, uintptr_t fcn) { vFpUuu_t fn = (vFpUuu_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void vFpUup(x64emu_t *emu, uintptr_t fcn) { vFpUup_t fn = (vFpUup_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void vFpUUi(x64emu_t *emu, uintptr_t fcn) { vFpUUi_t fn = (vFpUUi_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (int32_t)R_RCX); } -void vFpUUu(x64emu_t *emu, uintptr_t fcn) { vFpUUu_t fn = (vFpUUu_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX); } -void vFpUUp(x64emu_t *emu, uintptr_t fcn) { vFpUUp_t fn = (vFpUUp_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (void*)R_RCX); } -void vFpUpp(x64emu_t *emu, uintptr_t fcn) { vFpUpp_t fn = (vFpUpp_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFpfff(x64emu_t *emu, uintptr_t fcn) { vFpfff_t fn = (vFpfff_t)fcn; fn((void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); } -void vFpdii(x64emu_t *emu, uintptr_t fcn) { vFpdii_t fn = (vFpdii_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], (int32_t)R_RSI, (int32_t)R_RDX); } -void vFpdup(x64emu_t *emu, uintptr_t fcn) { vFpdup_t fn = (vFpdup_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], (uint32_t)R_RSI, (void*)R_RDX); } -void vFpddu(x64emu_t *emu, uintptr_t fcn) { vFpddu_t fn = (vFpddu_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (uint32_t)R_RSI); } -void vFpddd(x64emu_t *emu, uintptr_t fcn) { vFpddd_t fn = (vFpddd_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); } -void vFplll(x64emu_t *emu, uintptr_t fcn) { vFplll_t fn = (vFplll_t)fcn; fn((void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); } -void vFplpp(x64emu_t *emu, uintptr_t fcn) { vFplpp_t fn = (vFplpp_t)fcn; fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFpLii(x64emu_t *emu, uintptr_t fcn) { vFpLii_t fn = (vFpLii_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void vFpLuu(x64emu_t *emu, uintptr_t fcn) { vFpLuu_t fn = (vFpLuu_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void vFpLLL(x64emu_t *emu, uintptr_t fcn) { vFpLLL_t fn = (vFpLLL_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void vFpLpL(x64emu_t *emu, uintptr_t fcn) { vFpLpL_t fn = (vFpLpL_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void vFpLpp(x64emu_t *emu, uintptr_t fcn) { vFpLpp_t fn = (vFpLpp_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFppii(x64emu_t *emu, uintptr_t fcn) { vFppii_t fn = (vFppii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void vFppiu(x64emu_t *emu, uintptr_t fcn) { vFppiu_t fn = (vFppiu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } -void vFppid(x64emu_t *emu, uintptr_t fcn) { vFppid_t fn = (vFppid_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, emu->xmm[0].d[0]); } -void vFppil(x64emu_t *emu, uintptr_t fcn) { vFppil_t fn = (vFppil_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX); } -void vFppiL(x64emu_t *emu, uintptr_t fcn) { vFppiL_t fn = (vFppiL_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); } -void vFppip(x64emu_t *emu, uintptr_t fcn) { vFppip_t fn = (vFppip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void vFppui(x64emu_t *emu, uintptr_t fcn) { vFppui_t fn = (vFppui_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); } -void vFppuu(x64emu_t *emu, uintptr_t fcn) { vFppuu_t fn = (vFppuu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void vFppup(x64emu_t *emu, uintptr_t fcn) { vFppup_t fn = (vFppup_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void vFppfi(x64emu_t *emu, uintptr_t fcn) { vFppfi_t fn = (vFppfi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0], (int32_t)R_RDX); } -void vFppff(x64emu_t *emu, uintptr_t fcn) { vFppff_t fn = (vFppff_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void vFppdu(x64emu_t *emu, uintptr_t fcn) { vFppdu_t fn = (vFppdu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], (uint32_t)R_RDX); } -void vFppdd(x64emu_t *emu, uintptr_t fcn) { vFppdd_t fn = (vFppdd_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void vFppdp(x64emu_t *emu, uintptr_t fcn) { vFppdp_t fn = (vFppdp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], (void*)R_RDX); } -void vFpplp(x64emu_t *emu, uintptr_t fcn) { vFpplp_t fn = (vFpplp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); } -void vFppLL(x64emu_t *emu, uintptr_t fcn) { vFppLL_t fn = (vFppLL_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void vFppLp(x64emu_t *emu, uintptr_t fcn) { vFppLp_t fn = (vFppLp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void vFpppi(x64emu_t *emu, uintptr_t fcn) { vFpppi_t fn = (vFpppi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void vFpppu(x64emu_t *emu, uintptr_t fcn) { vFpppu_t fn = (vFpppu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void vFpppd(x64emu_t *emu, uintptr_t fcn) { vFpppd_t fn = (vFpppd_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].d[0]); } -void vFpppl(x64emu_t *emu, uintptr_t fcn) { vFpppl_t fn = (vFpppl_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); } -void vFpppL(x64emu_t *emu, uintptr_t fcn) { vFpppL_t fn = (vFpppL_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void vFpppp(x64emu_t *emu, uintptr_t fcn) { vFpppp_t fn = (vFpppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void cFpipp(x64emu_t *emu, uintptr_t fcn) { cFpipp_t fn = (cFpipp_t)fcn; R_RAX=fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFEiip(x64emu_t *emu, uintptr_t fcn) { iFEiip_t fn = (iFEiip_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void iFEiiN(x64emu_t *emu, uintptr_t fcn) { iFEiiN_t fn = (iFEiiN_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void iFEipp(x64emu_t *emu, uintptr_t fcn) { iFEipp_t fn = (iFEipp_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void iFEipV(x64emu_t *emu, uintptr_t fcn) { iFEipV_t fn = (iFEipV_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); } -void iFEipA(x64emu_t *emu, uintptr_t fcn) { iFEipA_t fn = (iFEipA_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void iFEupu(x64emu_t *emu, uintptr_t fcn) { iFEupu_t fn = (iFEupu_t)fcn; R_RAX=(int32_t)fn(emu, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void iFEupp(x64emu_t *emu, uintptr_t fcn) { iFEupp_t fn = (iFEupp_t)fcn; R_RAX=(int32_t)fn(emu, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void iFEpii(x64emu_t *emu, uintptr_t fcn) { iFEpii_t fn = (iFEpii_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void iFEpip(x64emu_t *emu, uintptr_t fcn) { iFEpip_t fn = (iFEpip_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void iFEpiV(x64emu_t *emu, uintptr_t fcn) { iFEpiV_t fn = (iFEpiV_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)(R_RSP + 8)); } -void iFEpiA(x64emu_t *emu, uintptr_t fcn) { iFEpiA_t fn = (iFEpiA_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void iFEpui(x64emu_t *emu, uintptr_t fcn) { iFEpui_t fn = (iFEpui_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX); } -void iFEpup(x64emu_t *emu, uintptr_t fcn) { iFEpup_t fn = (iFEpup_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void iFEpUi(x64emu_t *emu, uintptr_t fcn) { iFEpUi_t fn = (iFEpUi_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX); } -void iFEpUp(x64emu_t *emu, uintptr_t fcn) { iFEpUp_t fn = (iFEpUp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX); } -void iFEpLi(x64emu_t *emu, uintptr_t fcn) { iFEpLi_t fn = (iFEpLi_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); } -void iFEpLp(x64emu_t *emu, uintptr_t fcn) { iFEpLp_t fn = (iFEpLp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } -void iFEppi(x64emu_t *emu, uintptr_t fcn) { iFEppi_t fn = (iFEppi_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void iFEppd(x64emu_t *emu, uintptr_t fcn) { iFEppd_t fn = (iFEppd_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0]); } -void iFEppL(x64emu_t *emu, uintptr_t fcn) { iFEppL_t fn = (iFEppL_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void iFEppp(x64emu_t *emu, uintptr_t fcn) { iFEppp_t fn = (iFEppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void iFEppV(x64emu_t *emu, uintptr_t fcn) { iFEppV_t fn = (iFEppV_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); } -void iFEppA(x64emu_t *emu, uintptr_t fcn) { iFEppA_t fn = (iFEppA_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void iFEpOu(x64emu_t *emu, uintptr_t fcn) { iFEpOu_t fn = (iFEpOu_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, of_convert((int32_t)R_RSI), (uint32_t)R_RDX); } -void iFwwww(x64emu_t *emu, uintptr_t fcn) { iFwwww_t fn = (iFwwww_t)fcn; R_RAX=(int32_t)fn((int16_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX); } -void iFwppp(x64emu_t *emu, uintptr_t fcn) { iFwppp_t fn = (iFwppp_t)fcn; R_RAX=(int32_t)fn((int16_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFiiii(x64emu_t *emu, uintptr_t fcn) { iFiiii_t fn = (iFiiii_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void iFiiiu(x64emu_t *emu, uintptr_t fcn) { iFiiiu_t fn = (iFiiiu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } -void iFiiip(x64emu_t *emu, uintptr_t fcn) { iFiiip_t fn = (iFiiip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFiiiN(x64emu_t *emu, uintptr_t fcn) { iFiiiN_t fn = (iFiiiN_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFiiui(x64emu_t *emu, uintptr_t fcn) { iFiiui_t fn = (iFiiui_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); } -void iFiill(x64emu_t *emu, uintptr_t fcn) { iFiill_t fn = (iFiill_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); } -void iFiipi(x64emu_t *emu, uintptr_t fcn) { iFiipi_t fn = (iFiipi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFiipp(x64emu_t *emu, uintptr_t fcn) { iFiipp_t fn = (iFiipp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFiWii(x64emu_t *emu, uintptr_t fcn) { iFiWii_t fn = (iFiWii_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void iFiuwp(x64emu_t *emu, uintptr_t fcn) { iFiuwp_t fn = (iFiuwp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (int16_t)R_RDX, (void*)R_RCX); } -void iFiuup(x64emu_t *emu, uintptr_t fcn) { iFiuup_t fn = (iFiuup_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void iFiupp(x64emu_t *emu, uintptr_t fcn) { iFiupp_t fn = (iFiupp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFilli(x64emu_t *emu, uintptr_t fcn) { iFilli_t fn = (iFilli_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX); } -void iFillu(x64emu_t *emu, uintptr_t fcn) { iFillu_t fn = (iFillu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX); } -void iFiLpL(x64emu_t *emu, uintptr_t fcn) { iFiLpL_t fn = (iFiLpL_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void iFipii(x64emu_t *emu, uintptr_t fcn) { iFipii_t fn = (iFipii_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void iFipip(x64emu_t *emu, uintptr_t fcn) { iFipip_t fn = (iFipip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFipWp(x64emu_t *emu, uintptr_t fcn) { iFipWp_t fn = (iFipWp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint16_t)R_RDX, (void*)R_RCX); } -void iFipui(x64emu_t *emu, uintptr_t fcn) { iFipui_t fn = (iFipui_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); } -void iFipuL(x64emu_t *emu, uintptr_t fcn) { iFipuL_t fn = (iFipuL_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX); } -void iFipLi(x64emu_t *emu, uintptr_t fcn) { iFipLi_t fn = (iFipLi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); } -void iFipLu(x64emu_t *emu, uintptr_t fcn) { iFipLu_t fn = (iFipLu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); } -void iFipLp(x64emu_t *emu, uintptr_t fcn) { iFipLp_t fn = (iFipLp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void iFippi(x64emu_t *emu, uintptr_t fcn) { iFippi_t fn = (iFippi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFippu(x64emu_t *emu, uintptr_t fcn) { iFippu_t fn = (iFippu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void iFippL(x64emu_t *emu, uintptr_t fcn) { iFippL_t fn = (iFippL_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void iFippp(x64emu_t *emu, uintptr_t fcn) { iFippp_t fn = (iFippp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFipON(x64emu_t *emu, uintptr_t fcn) { iFipON_t fn = (iFipON_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, of_convert((int32_t)R_RDX), (void*)R_RCX); } -void iFuiup(x64emu_t *emu, uintptr_t fcn) { iFuiup_t fn = (iFuiup_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void iFuipp(x64emu_t *emu, uintptr_t fcn) { iFuipp_t fn = (iFuipp_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFuWWp(x64emu_t *emu, uintptr_t fcn) { iFuWWp_t fn = (iFuWWp_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (void*)R_RCX); } -void iFuuuu(x64emu_t *emu, uintptr_t fcn) { iFuuuu_t fn = (iFuuuu_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void iFuupi(x64emu_t *emu, uintptr_t fcn) { iFuupi_t fn = (iFuupi_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFuupp(x64emu_t *emu, uintptr_t fcn) { iFuupp_t fn = (iFuupp_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFupLp(x64emu_t *emu, uintptr_t fcn) { iFupLp_t fn = (iFupLp_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void iFuppi(x64emu_t *emu, uintptr_t fcn) { iFuppi_t fn = (iFuppi_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFuppu(x64emu_t *emu, uintptr_t fcn) { iFuppu_t fn = (iFuppu_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void iFuppp(x64emu_t *emu, uintptr_t fcn) { iFuppp_t fn = (iFuppp_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFLppp(x64emu_t *emu, uintptr_t fcn) { iFLppp_t fn = (iFLppp_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFpwww(x64emu_t *emu, uintptr_t fcn) { iFpwww_t fn = (iFpwww_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX); } -void iFpwpp(x64emu_t *emu, uintptr_t fcn) { iFpwpp_t fn = (iFpwpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int16_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFpiii(x64emu_t *emu, uintptr_t fcn) { iFpiii_t fn = (iFpiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void iFpiiu(x64emu_t *emu, uintptr_t fcn) { iFpiiu_t fn = (iFpiiu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } -void iFpiid(x64emu_t *emu, uintptr_t fcn) { iFpiid_t fn = (iFpiid_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[0].d[0]); } -void iFpiiL(x64emu_t *emu, uintptr_t fcn) { iFpiiL_t fn = (iFpiiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); } -void iFpiip(x64emu_t *emu, uintptr_t fcn) { iFpiip_t fn = (iFpiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFpiuu(x64emu_t *emu, uintptr_t fcn) { iFpiuu_t fn = (iFpiuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void iFpiuL(x64emu_t *emu, uintptr_t fcn) { iFpiuL_t fn = (iFpiuL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX); } -void iFpiup(x64emu_t *emu, uintptr_t fcn) { iFpiup_t fn = (iFpiup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void iFpiUp(x64emu_t *emu, uintptr_t fcn) { iFpiUp_t fn = (iFpiUp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (void*)R_RCX); } -void iFpild(x64emu_t *emu, uintptr_t fcn) { iFpild_t fn = (iFpild_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, emu->xmm[0].d[0]); } -void iFpipi(x64emu_t *emu, uintptr_t fcn) { iFpipi_t fn = (iFpipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFpipu(x64emu_t *emu, uintptr_t fcn) { iFpipu_t fn = (iFpipu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void iFpipL(x64emu_t *emu, uintptr_t fcn) { iFpipL_t fn = (iFpipL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void iFpipp(x64emu_t *emu, uintptr_t fcn) { iFpipp_t fn = (iFpipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFpipV(x64emu_t *emu, uintptr_t fcn) { iFpipV_t fn = (iFpipV_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void iFpIip(x64emu_t *emu, uintptr_t fcn) { iFpIip_t fn = (iFpIip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFpCCC(x64emu_t *emu, uintptr_t fcn) { iFpCCC_t fn = (iFpCCC_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX); } -void iFpCpi(x64emu_t *emu, uintptr_t fcn) { iFpCpi_t fn = (iFpCpi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFpCpp(x64emu_t *emu, uintptr_t fcn) { iFpCpp_t fn = (iFpCpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFpWWu(x64emu_t *emu, uintptr_t fcn) { iFpWWu_t fn = (iFpWWu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint32_t)R_RCX); } -void iFpWpp(x64emu_t *emu, uintptr_t fcn) { iFpWpp_t fn = (iFpWpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFpuwp(x64emu_t *emu, uintptr_t fcn) { iFpuwp_t fn = (iFpuwp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int16_t)R_RDX, (void*)R_RCX); } -void iFpuii(x64emu_t *emu, uintptr_t fcn) { iFpuii_t fn = (iFpuii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void iFpuiL(x64emu_t *emu, uintptr_t fcn) { iFpuiL_t fn = (iFpuiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); } -void iFpuip(x64emu_t *emu, uintptr_t fcn) { iFpuip_t fn = (iFpuip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFpuui(x64emu_t *emu, uintptr_t fcn) { iFpuui_t fn = (iFpuui_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); } -void iFpuuu(x64emu_t *emu, uintptr_t fcn) { iFpuuu_t fn = (iFpuuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void iFpuul(x64emu_t *emu, uintptr_t fcn) { iFpuul_t fn = (iFpuul_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX); } -void iFpuuL(x64emu_t *emu, uintptr_t fcn) { iFpuuL_t fn = (iFpuuL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX); } -void iFpuup(x64emu_t *emu, uintptr_t fcn) { iFpuup_t fn = (iFpuup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void iFpuUp(x64emu_t *emu, uintptr_t fcn) { iFpuUp_t fn = (iFpuUp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX, (void*)R_RCX); } -void iFpuLL(x64emu_t *emu, uintptr_t fcn) { iFpuLL_t fn = (iFpuLL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void iFpuLp(x64emu_t *emu, uintptr_t fcn) { iFpuLp_t fn = (iFpuLp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void iFpupi(x64emu_t *emu, uintptr_t fcn) { iFpupi_t fn = (iFpupi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFpupC(x64emu_t *emu, uintptr_t fcn) { iFpupC_t fn = (iFpupC_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint8_t)R_RCX); } -void iFpupu(x64emu_t *emu, uintptr_t fcn) { iFpupu_t fn = (iFpupu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void iFpupU(x64emu_t *emu, uintptr_t fcn) { iFpupU_t fn = (iFpupU_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint64_t)R_RCX); } -void iFpupL(x64emu_t *emu, uintptr_t fcn) { iFpupL_t fn = (iFpupL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void iFpupp(x64emu_t *emu, uintptr_t fcn) { iFpupp_t fn = (iFpupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFpupV(x64emu_t *emu, uintptr_t fcn) { iFpupV_t fn = (iFpupV_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void iFpUip(x64emu_t *emu, uintptr_t fcn) { iFpUip_t fn = (iFpUip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFpUup(x64emu_t *emu, uintptr_t fcn) { iFpUup_t fn = (iFpUup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void iFpUUU(x64emu_t *emu, uintptr_t fcn) { iFpUUU_t fn = (iFpUUU_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX); } -void iFpULp(x64emu_t *emu, uintptr_t fcn) { iFpULp_t fn = (iFpULp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void iFpUpp(x64emu_t *emu, uintptr_t fcn) { iFpUpp_t fn = (iFpUpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFpdip(x64emu_t *emu, uintptr_t fcn) { iFpdip_t fn = (iFpdip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, emu->xmm[0].d[0], (int32_t)R_RSI, (void*)R_RDX); } -void iFplii(x64emu_t *emu, uintptr_t fcn) { iFplii_t fn = (iFplii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void iFplip(x64emu_t *emu, uintptr_t fcn) { iFplip_t fn = (iFplip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFplpi(x64emu_t *emu, uintptr_t fcn) { iFplpi_t fn = (iFplpi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFplpp(x64emu_t *emu, uintptr_t fcn) { iFplpp_t fn = (iFplpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFpLii(x64emu_t *emu, uintptr_t fcn) { iFpLii_t fn = (iFpLii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void iFpLiL(x64emu_t *emu, uintptr_t fcn) { iFpLiL_t fn = (iFpLiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); } -void iFpLip(x64emu_t *emu, uintptr_t fcn) { iFpLip_t fn = (iFpLip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFpLuu(x64emu_t *emu, uintptr_t fcn) { iFpLuu_t fn = (iFpLuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void iFpLup(x64emu_t *emu, uintptr_t fcn) { iFpLup_t fn = (iFpLup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void iFpLlp(x64emu_t *emu, uintptr_t fcn) { iFpLlp_t fn = (iFpLlp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); } -void iFpLLu(x64emu_t *emu, uintptr_t fcn) { iFpLLu_t fn = (iFpLLu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); } -void iFpLLL(x64emu_t *emu, uintptr_t fcn) { iFpLLL_t fn = (iFpLLL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void iFpLLp(x64emu_t *emu, uintptr_t fcn) { iFpLLp_t fn = (iFpLLp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void iFpLpi(x64emu_t *emu, uintptr_t fcn) { iFpLpi_t fn = (iFpLpi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFpLpf(x64emu_t *emu, uintptr_t fcn) { iFpLpf_t fn = (iFpLpf_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, emu->xmm[0].f[0]); } -void iFpLpd(x64emu_t *emu, uintptr_t fcn) { iFpLpd_t fn = (iFpLpd_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, emu->xmm[0].d[0]); } -void iFpLpD(x64emu_t *emu, uintptr_t fcn) { iFpLpD_t fn = (iFpLpD_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, LD2localLD((void*)(R_RSP + 8))); } -void iFpLpL(x64emu_t *emu, uintptr_t fcn) { iFpLpL_t fn = (iFpLpL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void iFpLpp(x64emu_t *emu, uintptr_t fcn) { iFpLpp_t fn = (iFpLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFppii(x64emu_t *emu, uintptr_t fcn) { iFppii_t fn = (iFppii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void iFppiu(x64emu_t *emu, uintptr_t fcn) { iFppiu_t fn = (iFppiu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } -void iFppiU(x64emu_t *emu, uintptr_t fcn) { iFppiU_t fn = (iFppiU_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX); } -void iFppiL(x64emu_t *emu, uintptr_t fcn) { iFppiL_t fn = (iFppiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); } -void iFppip(x64emu_t *emu, uintptr_t fcn) { iFppip_t fn = (iFppip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFppIL(x64emu_t *emu, uintptr_t fcn) { iFppIL_t fn = (iFppIL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX, (uintptr_t)R_RCX); } -void iFppCC(x64emu_t *emu, uintptr_t fcn) { iFppCC_t fn = (iFppCC_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX); } -void iFppuw(x64emu_t *emu, uintptr_t fcn) { iFppuw_t fn = (iFppuw_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int16_t)R_RCX); } -void iFppui(x64emu_t *emu, uintptr_t fcn) { iFppui_t fn = (iFppui_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); } -void iFppuu(x64emu_t *emu, uintptr_t fcn) { iFppuu_t fn = (iFppuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void iFppuL(x64emu_t *emu, uintptr_t fcn) { iFppuL_t fn = (iFppuL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX); } -void iFppup(x64emu_t *emu, uintptr_t fcn) { iFppup_t fn = (iFppup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void iFppdd(x64emu_t *emu, uintptr_t fcn) { iFppdd_t fn = (iFppdd_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void iFppdp(x64emu_t *emu, uintptr_t fcn) { iFppdp_t fn = (iFppdp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], (void*)R_RDX); } -void iFppli(x64emu_t *emu, uintptr_t fcn) { iFppli_t fn = (iFppli_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX); } -void iFppll(x64emu_t *emu, uintptr_t fcn) { iFppll_t fn = (iFppll_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); } -void iFpplL(x64emu_t *emu, uintptr_t fcn) { iFpplL_t fn = (iFpplL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (uintptr_t)R_RCX); } -void iFpplp(x64emu_t *emu, uintptr_t fcn) { iFpplp_t fn = (iFpplp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); } -void iFppLi(x64emu_t *emu, uintptr_t fcn) { iFppLi_t fn = (iFppLi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); } -void iFppLL(x64emu_t *emu, uintptr_t fcn) { iFppLL_t fn = (iFppLL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void iFppLp(x64emu_t *emu, uintptr_t fcn) { iFppLp_t fn = (iFppLp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void iFpppi(x64emu_t *emu, uintptr_t fcn) { iFpppi_t fn = (iFpppi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFpppC(x64emu_t *emu, uintptr_t fcn) { iFpppC_t fn = (iFpppC_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint8_t)R_RCX); } -void iFpppu(x64emu_t *emu, uintptr_t fcn) { iFpppu_t fn = (iFpppu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void iFpppL(x64emu_t *emu, uintptr_t fcn) { iFpppL_t fn = (iFpppL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void iFpppp(x64emu_t *emu, uintptr_t fcn) { iFpppp_t fn = (iFpppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFbupp(x64emu_t *emu, uintptr_t fcn) { iFbupp_t fn = (iFbupp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(int32_t)fn(aligned_xcb, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void IFEpIi(x64emu_t *emu, uintptr_t fcn) { IFEpIi_t fn = (IFEpIi_t)fcn; R_RAX=(int64_t)fn(emu, (void*)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); } -void IFipUI(x64emu_t *emu, uintptr_t fcn) { IFipUI_t fn = (IFipUI_t)fcn; R_RAX=(int64_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (int64_t)R_RCX); } -void IFipUp(x64emu_t *emu, uintptr_t fcn) { IFipUp_t fn = (IFipUp_t)fcn; R_RAX=(int64_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (void*)R_RCX); } -void IFpIip(x64emu_t *emu, uintptr_t fcn) { IFpIip_t fn = (IFpIip_t)fcn; R_RAX=(int64_t)fn((void*)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void IFppii(x64emu_t *emu, uintptr_t fcn) { IFppii_t fn = (IFppii_t)fcn; R_RAX=(int64_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void IFppip(x64emu_t *emu, uintptr_t fcn) { IFppip_t fn = (IFppip_t)fcn; R_RAX=(int64_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void IFSIii(x64emu_t *emu, uintptr_t fcn) { IFSIii_t fn = (IFSIii_t)fcn; R_RAX=(int64_t)fn(io_convert((void*)R_RDI), (int64_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void CFuuff(x64emu_t *emu, uintptr_t fcn) { CFuuff_t fn = (CFuuff_t)fcn; R_RAX=(unsigned char)fn((uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void CFpiii(x64emu_t *emu, uintptr_t fcn) { CFpiii_t fn = (CFpiii_t)fcn; R_RAX=(unsigned char)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void CFpLLi(x64emu_t *emu, uintptr_t fcn) { CFpLLi_t fn = (CFpLLi_t)fcn; R_RAX=(unsigned char)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); } -void CFppip(x64emu_t *emu, uintptr_t fcn) { CFppip_t fn = (CFppip_t)fcn; R_RAX=(unsigned char)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void CFbupp(x64emu_t *emu, uintptr_t fcn) { CFbupp_t fn = (CFbupp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(unsigned char)fn(aligned_xcb, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFEipp(x64emu_t *emu, uintptr_t fcn) { uFEipp_t fn = (uFEipp_t)fcn; R_RAX=(uint32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void uFEupp(x64emu_t *emu, uintptr_t fcn) { uFEupp_t fn = (uFEupp_t)fcn; R_RAX=(uint32_t)fn(emu, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void uFEpup(x64emu_t *emu, uintptr_t fcn) { uFEpup_t fn = (uFEpup_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void uFEppp(x64emu_t *emu, uintptr_t fcn) { uFEppp_t fn = (uFEppp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void uFiiii(x64emu_t *emu, uintptr_t fcn) { uFiiii_t fn = (uFiiii_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void uFiiuu(x64emu_t *emu, uintptr_t fcn) { uFiiuu_t fn = (uFiiuu_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void uFifff(x64emu_t *emu, uintptr_t fcn) { uFifff_t fn = (uFifff_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); } -void uFuuuu(x64emu_t *emu, uintptr_t fcn) { uFuuuu_t fn = (uFuuuu_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void uFpiip(x64emu_t *emu, uintptr_t fcn) { uFpiip_t fn = (uFpiip_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void uFpipu(x64emu_t *emu, uintptr_t fcn) { uFpipu_t fn = (uFpipu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void uFpipL(x64emu_t *emu, uintptr_t fcn) { uFpipL_t fn = (uFpipL_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void uFpipp(x64emu_t *emu, uintptr_t fcn) { uFpipp_t fn = (uFpipp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void uFpCCC(x64emu_t *emu, uintptr_t fcn) { uFpCCC_t fn = (uFpCCC_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX); } -void uFpuip(x64emu_t *emu, uintptr_t fcn) { uFpuip_t fn = (uFpuip_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void uFpuup(x64emu_t *emu, uintptr_t fcn) { uFpuup_t fn = (uFpuup_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void uFpupi(x64emu_t *emu, uintptr_t fcn) { uFpupi_t fn = (uFpupi_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void uFpupu(x64emu_t *emu, uintptr_t fcn) { uFpupu_t fn = (uFpupu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void uFpupp(x64emu_t *emu, uintptr_t fcn) { uFpupp_t fn = (uFpupp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void uFpubp(x64emu_t *emu, uintptr_t fcn) { uFpubp_t fn = (uFpubp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDX); R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, aligned_xcb, (void*)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDX); } -void uFppiu(x64emu_t *emu, uintptr_t fcn) { uFppiu_t fn = (uFppiu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } -void uFppip(x64emu_t *emu, uintptr_t fcn) { uFppip_t fn = (uFppip_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void uFppuu(x64emu_t *emu, uintptr_t fcn) { uFppuu_t fn = (uFppuu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void uFpplp(x64emu_t *emu, uintptr_t fcn) { uFpplp_t fn = (uFpplp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); } -void uFppLp(x64emu_t *emu, uintptr_t fcn) { uFppLp_t fn = (uFppLp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void uFpppi(x64emu_t *emu, uintptr_t fcn) { uFpppi_t fn = (uFpppi_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void uFpppu(x64emu_t *emu, uintptr_t fcn) { uFpppu_t fn = (uFpppu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void uFpppL(x64emu_t *emu, uintptr_t fcn) { uFpppL_t fn = (uFpppL_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void uFpppp(x64emu_t *emu, uintptr_t fcn) { uFpppp_t fn = (uFpppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void uFbipp(x64emu_t *emu, uintptr_t fcn) { uFbipp_t fn = (uFbipp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbCWp(x64emu_t *emu, uintptr_t fcn) { uFbCWp_t fn = (uFbCWp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint16_t)R_RDX, (void*)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuWp(x64emu_t *emu, uintptr_t fcn) { uFbuWp_t fn = (uFbuWp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint16_t)R_RDX, (void*)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuuC(x64emu_t *emu, uintptr_t fcn) { uFbuuC_t fn = (uFbuuC_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuuu(x64emu_t *emu, uintptr_t fcn) { uFbuuu_t fn = (uFbuuu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuup(x64emu_t *emu, uintptr_t fcn) { uFbuup_t fn = (uFbuup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void UFpUui(x64emu_t *emu, uintptr_t fcn) { UFpUui_t fn = (UFpUui_t)fcn; R_RAX=fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); } -void UFppii(x64emu_t *emu, uintptr_t fcn) { UFppii_t fn = (UFppii_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void UFppip(x64emu_t *emu, uintptr_t fcn) { UFppip_t fn = (UFppip_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void UFbipp(x64emu_t *emu, uintptr_t fcn) { UFbipp_t fn = (UFbipp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=fn(aligned_xcb, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void dFpppp(x64emu_t *emu, uintptr_t fcn) { dFpppp_t fn = (dFpppp_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void lFEipV(x64emu_t *emu, uintptr_t fcn) { lFEipV_t fn = (lFEipV_t)fcn; R_RAX=(intptr_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); } -void lFEpip(x64emu_t *emu, uintptr_t fcn) { lFEpip_t fn = (lFEpip_t)fcn; R_RAX=(intptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void lFEppL(x64emu_t *emu, uintptr_t fcn) { lFEppL_t fn = (lFEppL_t)fcn; R_RAX=(intptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void lFEppp(x64emu_t *emu, uintptr_t fcn) { lFEppp_t fn = (lFEppp_t)fcn; R_RAX=(intptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void lFiiLu(x64emu_t *emu, uintptr_t fcn) { lFiiLu_t fn = (lFiiLu_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); } -void lFiipL(x64emu_t *emu, uintptr_t fcn) { lFiipL_t fn = (lFiipL_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void lFipil(x64emu_t *emu, uintptr_t fcn) { lFipil_t fn = (lFipil_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX); } -void lFipLi(x64emu_t *emu, uintptr_t fcn) { lFipLi_t fn = (lFipLi_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); } -void lFipLI(x64emu_t *emu, uintptr_t fcn) { lFipLI_t fn = (lFipLI_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int64_t)R_RCX); } -void lFipLu(x64emu_t *emu, uintptr_t fcn) { lFipLu_t fn = (lFipLu_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); } -void lFipLl(x64emu_t *emu, uintptr_t fcn) { lFipLl_t fn = (lFipLl_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX); } -void lFipLL(x64emu_t *emu, uintptr_t fcn) { lFipLL_t fn = (lFipLL_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void lFipLp(x64emu_t *emu, uintptr_t fcn) { lFipLp_t fn = (lFipLp_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void lFippL(x64emu_t *emu, uintptr_t fcn) { lFippL_t fn = (lFippL_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void lFpili(x64emu_t *emu, uintptr_t fcn) { lFpili_t fn = (lFpili_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX); } -void lFpilp(x64emu_t *emu, uintptr_t fcn) { lFpilp_t fn = (lFpilp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); } -void lFpuip(x64emu_t *emu, uintptr_t fcn) { lFpuip_t fn = (lFpuip_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void lFplip(x64emu_t *emu, uintptr_t fcn) { lFplip_t fn = (lFplip_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void lFplpp(x64emu_t *emu, uintptr_t fcn) { lFplpp_t fn = (lFplpp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void lFpLpp(x64emu_t *emu, uintptr_t fcn) { lFpLpp_t fn = (lFpLpp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void lFppii(x64emu_t *emu, uintptr_t fcn) { lFppii_t fn = (lFppii_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void lFppip(x64emu_t *emu, uintptr_t fcn) { lFppip_t fn = (lFppip_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void lFpppL(x64emu_t *emu, uintptr_t fcn) { lFpppL_t fn = (lFpppL_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void lFpppp(x64emu_t *emu, uintptr_t fcn) { lFpppp_t fn = (lFpppp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void LFEppL(x64emu_t *emu, uintptr_t fcn) { LFEppL_t fn = (LFEppL_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } -void LFEppp(x64emu_t *emu, uintptr_t fcn) { LFEppp_t fn = (LFEppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void LFipLL(x64emu_t *emu, uintptr_t fcn) { LFipLL_t fn = (LFipLL_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void LFippL(x64emu_t *emu, uintptr_t fcn) { LFippL_t fn = (LFippL_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void LFippp(x64emu_t *emu, uintptr_t fcn) { LFippp_t fn = (LFippp_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void LFuipL(x64emu_t *emu, uintptr_t fcn) { LFuipL_t fn = (LFuipL_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void LFpCii(x64emu_t *emu, uintptr_t fcn) { LFpCii_t fn = (LFpCii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void LFpupL(x64emu_t *emu, uintptr_t fcn) { LFpupL_t fn = (LFpupL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void LFpLCL(x64emu_t *emu, uintptr_t fcn) { LFpLCL_t fn = (LFpLCL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint8_t)R_RDX, (uintptr_t)R_RCX); } -void LFpLLp(x64emu_t *emu, uintptr_t fcn) { LFpLLp_t fn = (LFpLLp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void LFpLpL(x64emu_t *emu, uintptr_t fcn) { LFpLpL_t fn = (LFpLpL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void LFpLpp(x64emu_t *emu, uintptr_t fcn) { LFpLpp_t fn = (LFpLpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void LFppii(x64emu_t *emu, uintptr_t fcn) { LFppii_t fn = (LFppii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void LFppip(x64emu_t *emu, uintptr_t fcn) { LFppip_t fn = (LFppip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void LFppLu(x64emu_t *emu, uintptr_t fcn) { LFppLu_t fn = (LFppLu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX); } -void LFppLL(x64emu_t *emu, uintptr_t fcn) { LFppLL_t fn = (LFppLL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void LFppLp(x64emu_t *emu, uintptr_t fcn) { LFppLp_t fn = (LFppLp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void LFpppi(x64emu_t *emu, uintptr_t fcn) { LFpppi_t fn = (LFpppi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void LFpppL(x64emu_t *emu, uintptr_t fcn) { LFpppL_t fn = (LFpppL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void LFpppp(x64emu_t *emu, uintptr_t fcn) { LFpppp_t fn = (LFpppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFEipp(x64emu_t *emu, uintptr_t fcn) { pFEipp_t fn = (pFEipp_t)fcn; R_RAX=(uintptr_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void pFEuup(x64emu_t *emu, uintptr_t fcn) { pFEuup_t fn = (pFEuup_t)fcn; R_RAX=(uintptr_t)fn(emu, (uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); } -void pFEupp(x64emu_t *emu, uintptr_t fcn) { pFEupp_t fn = (pFEupp_t)fcn; R_RAX=(uintptr_t)fn(emu, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void pFELpV(x64emu_t *emu, uintptr_t fcn) { pFELpV_t fn = (pFELpV_t)fcn; R_RAX=(uintptr_t)fn(emu, (uintptr_t)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); } -void pFELpA(x64emu_t *emu, uintptr_t fcn) { pFELpA_t fn = (pFELpA_t)fcn; R_RAX=(uintptr_t)fn(emu, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void pFEpii(x64emu_t *emu, uintptr_t fcn) { pFEpii_t fn = (pFEpii_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } -void pFEpip(x64emu_t *emu, uintptr_t fcn) { pFEpip_t fn = (pFEpip_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void pFEpuL(x64emu_t *emu, uintptr_t fcn) { pFEpuL_t fn = (pFEpuL_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); } -void pFEppi(x64emu_t *emu, uintptr_t fcn) { pFEppi_t fn = (pFEppi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } -void pFEppp(x64emu_t *emu, uintptr_t fcn) { pFEppp_t fn = (pFEppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void pFEppV(x64emu_t *emu, uintptr_t fcn) { pFEppV_t fn = (pFEppV_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); } -void pFiiii(x64emu_t *emu, uintptr_t fcn) { pFiiii_t fn = (pFiiii_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void pFiiiu(x64emu_t *emu, uintptr_t fcn) { pFiiiu_t fn = (pFiiiu_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } -void pFiiuu(x64emu_t *emu, uintptr_t fcn) { pFiiuu_t fn = (pFiiuu_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void pFiiup(x64emu_t *emu, uintptr_t fcn) { pFiiup_t fn = (pFiiup_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void pFiiLp(x64emu_t *emu, uintptr_t fcn) { pFiiLp_t fn = (pFiiLp_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void pFiipi(x64emu_t *emu, uintptr_t fcn) { pFiipi_t fn = (pFiipi_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void pFiIIi(x64emu_t *emu, uintptr_t fcn) { pFiIIi_t fn = (pFiIIi_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX, (int32_t)R_RCX); } -void pFillu(x64emu_t *emu, uintptr_t fcn) { pFillu_t fn = (pFillu_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX); } -void pFipii(x64emu_t *emu, uintptr_t fcn) { pFipii_t fn = (pFipii_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void pFipip(x64emu_t *emu, uintptr_t fcn) { pFipip_t fn = (pFipip_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void pFippi(x64emu_t *emu, uintptr_t fcn) { pFippi_t fn = (pFippi_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void pFippu(x64emu_t *emu, uintptr_t fcn) { pFippu_t fn = (pFippu_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void pFippL(x64emu_t *emu, uintptr_t fcn) { pFippL_t fn = (pFippL_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void pFippp(x64emu_t *emu, uintptr_t fcn) { pFippp_t fn = (pFippp_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFuuii(x64emu_t *emu, uintptr_t fcn) { pFuuii_t fn = (pFuuii_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void pFuuip(x64emu_t *emu, uintptr_t fcn) { pFuuip_t fn = (pFuuip_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void pFuuuu(x64emu_t *emu, uintptr_t fcn) { pFuuuu_t fn = (pFuuuu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void pFullu(x64emu_t *emu, uintptr_t fcn) { pFullu_t fn = (pFullu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX); } -void pFupii(x64emu_t *emu, uintptr_t fcn) { pFupii_t fn = (pFupii_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void pFuppp(x64emu_t *emu, uintptr_t fcn) { pFuppp_t fn = (pFuppp_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFffff(x64emu_t *emu, uintptr_t fcn) { pFffff_t fn = (pFffff_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); } -void pFdipp(x64emu_t *emu, uintptr_t fcn) { pFdipp_t fn = (pFdipp_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0], (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void pFdddd(x64emu_t *emu, uintptr_t fcn) { pFdddd_t fn = (pFdddd_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void pFDipp(x64emu_t *emu, uintptr_t fcn) { pFDipp_t fn = (pFDipp_t)fcn; R_RAX=(uintptr_t)fn(LD2localLD((void*)(R_RSP + 8)), (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void pFlfff(x64emu_t *emu, uintptr_t fcn) { pFlfff_t fn = (pFlfff_t)fcn; R_RAX=(uintptr_t)fn((intptr_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); } -void pFLiip(x64emu_t *emu, uintptr_t fcn) { pFLiip_t fn = (pFLiip_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void pFLLup(x64emu_t *emu, uintptr_t fcn) { pFLLup_t fn = (pFLLup_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void pFLLpp(x64emu_t *emu, uintptr_t fcn) { pFLLpp_t fn = (pFLLpp_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFLppp(x64emu_t *emu, uintptr_t fcn) { pFLppp_t fn = (pFLppp_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFpiii(x64emu_t *emu, uintptr_t fcn) { pFpiii_t fn = (pFpiii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void pFpiiu(x64emu_t *emu, uintptr_t fcn) { pFpiiu_t fn = (pFpiiu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } -void pFpiip(x64emu_t *emu, uintptr_t fcn) { pFpiip_t fn = (pFpiip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void pFpiuu(x64emu_t *emu, uintptr_t fcn) { pFpiuu_t fn = (pFpiuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void pFpiLi(x64emu_t *emu, uintptr_t fcn) { pFpiLi_t fn = (pFpiLi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); } -void pFpiLL(x64emu_t *emu, uintptr_t fcn) { pFpiLL_t fn = (pFpiLL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void pFpipi(x64emu_t *emu, uintptr_t fcn) { pFpipi_t fn = (pFpipi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void pFpipd(x64emu_t *emu, uintptr_t fcn) { pFpipd_t fn = (pFpipd_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, emu->xmm[0].d[0]); } -void pFpipL(x64emu_t *emu, uintptr_t fcn) { pFpipL_t fn = (pFpipL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void pFpipp(x64emu_t *emu, uintptr_t fcn) { pFpipp_t fn = (pFpipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFpCip(x64emu_t *emu, uintptr_t fcn) { pFpCip_t fn = (pFpCip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void pFpWWW(x64emu_t *emu, uintptr_t fcn) { pFpWWW_t fn = (pFpWWW_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint16_t)R_RCX); } -void pFpuii(x64emu_t *emu, uintptr_t fcn) { pFpuii_t fn = (pFpuii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void pFpuip(x64emu_t *emu, uintptr_t fcn) { pFpuip_t fn = (pFpuip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void pFpuuu(x64emu_t *emu, uintptr_t fcn) { pFpuuu_t fn = (pFpuuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void pFpuup(x64emu_t *emu, uintptr_t fcn) { pFpuup_t fn = (pFpuup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void pFpudd(x64emu_t *emu, uintptr_t fcn) { pFpudd_t fn = (pFpudd_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void pFpuLL(x64emu_t *emu, uintptr_t fcn) { pFpuLL_t fn = (pFpuLL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void pFpupi(x64emu_t *emu, uintptr_t fcn) { pFpupi_t fn = (pFpupi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void pFpupu(x64emu_t *emu, uintptr_t fcn) { pFpupu_t fn = (pFpupu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void pFpupp(x64emu_t *emu, uintptr_t fcn) { pFpupp_t fn = (pFpupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFpdIU(x64emu_t *emu, uintptr_t fcn) { pFpdIU_t fn = (pFpdIU_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, emu->xmm[0].d[0], (int64_t)R_RSI, (uint64_t)R_RDX); } -void pFpddi(x64emu_t *emu, uintptr_t fcn) { pFpddi_t fn = (pFpddi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI); } -void pFplil(x64emu_t *emu, uintptr_t fcn) { pFplil_t fn = (pFplil_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX); } -void pFplip(x64emu_t *emu, uintptr_t fcn) { pFplip_t fn = (pFplip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void pFplpl(x64emu_t *emu, uintptr_t fcn) { pFplpl_t fn = (pFplpl_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); } -void pFplpp(x64emu_t *emu, uintptr_t fcn) { pFplpp_t fn = (pFplpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFpLii(x64emu_t *emu, uintptr_t fcn) { pFpLii_t fn = (pFpLii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void pFpLip(x64emu_t *emu, uintptr_t fcn) { pFpLip_t fn = (pFpLip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void pFpLup(x64emu_t *emu, uintptr_t fcn) { pFpLup_t fn = (pFpLup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void pFpLLp(x64emu_t *emu, uintptr_t fcn) { pFpLLp_t fn = (pFpLLp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void pFpLpi(x64emu_t *emu, uintptr_t fcn) { pFpLpi_t fn = (pFpLpi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void pFpLpl(x64emu_t *emu, uintptr_t fcn) { pFpLpl_t fn = (pFpLpl_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX); } -void pFpLpL(x64emu_t *emu, uintptr_t fcn) { pFpLpL_t fn = (pFpLpL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void pFpLpp(x64emu_t *emu, uintptr_t fcn) { pFpLpp_t fn = (pFpLpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFppii(x64emu_t *emu, uintptr_t fcn) { pFppii_t fn = (pFppii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void pFppiu(x64emu_t *emu, uintptr_t fcn) { pFppiu_t fn = (pFppiu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } -void pFppiL(x64emu_t *emu, uintptr_t fcn) { pFppiL_t fn = (pFppiL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); } -void pFppip(x64emu_t *emu, uintptr_t fcn) { pFppip_t fn = (pFppip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void pFppCp(x64emu_t *emu, uintptr_t fcn) { pFppCp_t fn = (pFppCp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint8_t)R_RDX, (void*)R_RCX); } -void pFppWp(x64emu_t *emu, uintptr_t fcn) { pFppWp_t fn = (pFppWp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint16_t)R_RDX, (void*)R_RCX); } -void pFppuu(x64emu_t *emu, uintptr_t fcn) { pFppuu_t fn = (pFppuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void pFppuL(x64emu_t *emu, uintptr_t fcn) { pFppuL_t fn = (pFppuL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX); } -void pFppup(x64emu_t *emu, uintptr_t fcn) { pFppup_t fn = (pFppup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void pFppUU(x64emu_t *emu, uintptr_t fcn) { pFppUU_t fn = (pFppUU_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX); } -void pFppdd(x64emu_t *emu, uintptr_t fcn) { pFppdd_t fn = (pFppdd_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void pFppll(x64emu_t *emu, uintptr_t fcn) { pFppll_t fn = (pFppll_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX); } -void pFpplp(x64emu_t *emu, uintptr_t fcn) { pFpplp_t fn = (pFpplp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); } -void pFppLi(x64emu_t *emu, uintptr_t fcn) { pFppLi_t fn = (pFppLi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); } -void pFppLL(x64emu_t *emu, uintptr_t fcn) { pFppLL_t fn = (pFppLL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX); } -void pFppLp(x64emu_t *emu, uintptr_t fcn) { pFppLp_t fn = (pFppLp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void pFpppi(x64emu_t *emu, uintptr_t fcn) { pFpppi_t fn = (pFpppi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void pFpppu(x64emu_t *emu, uintptr_t fcn) { pFpppu_t fn = (pFpppu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void pFpppL(x64emu_t *emu, uintptr_t fcn) { pFpppL_t fn = (pFpppL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void pFpppp(x64emu_t *emu, uintptr_t fcn) { pFpppp_t fn = (pFpppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFpbii(x64emu_t *emu, uintptr_t fcn) { pFpbii_t fn = (pFpbii_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RSI); R_RAX=(uintptr_t)fn((void*)R_RDI, aligned_xcb, (int32_t)R_RDX, (int32_t)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RSI); } -void pFSppi(x64emu_t *emu, uintptr_t fcn) { pFSppi_t fn = (pFSppi_t)fcn; R_RAX=(uintptr_t)fn(io_convert((void*)R_RDI), (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void pFbCuW(x64emu_t *emu, uintptr_t fcn) { pFbCuW_t fn = (pFbCuW_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbCuu(x64emu_t *emu, uintptr_t fcn) { pFbCuu_t fn = (pFbCuu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuWp(x64emu_t *emu, uintptr_t fcn) { pFbuWp_t fn = (pFbuWp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint16_t)R_RDX, (void*)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuC(x64emu_t *emu, uintptr_t fcn) { pFbuuC_t fn = (pFbuuC_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuu(x64emu_t *emu, uintptr_t fcn) { pFbuuu_t fn = (pFbuuu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuup(x64emu_t *emu, uintptr_t fcn) { pFbuup_t fn = (pFbuup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbpWp(x64emu_t *emu, uintptr_t fcn) { pFbpWp_t fn = (pFbpWp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI, (uint16_t)R_RDX, (void*)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbpup(x64emu_t *emu, uintptr_t fcn) { pFbpup_t fn = (pFbpup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbppu(x64emu_t *emu, uintptr_t fcn) { pFbppu_t fn = (pFbppu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbppU(x64emu_t *emu, uintptr_t fcn) { pFbppU_t fn = (pFbppU_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI, (void*)R_RDX, (uint64_t)R_RCX); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void vWpiiu(x64emu_t *emu, uintptr_t fcn) { vWpiiu_t fn = (vWpiiu_t)fcn; fn((void*)R_RCX, (int32_t)R_RDX, (int32_t)R_R8, (uint32_t)R_R9); } -void vWpuup(x64emu_t *emu, uintptr_t fcn) { vWpuup_t fn = (vWpuup_t)fcn; fn((void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (void*)R_R9); } -void iWEpip(x64emu_t *emu, uintptr_t fcn) { iWEpip_t fn = (iWEpip_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (int32_t)R_RDX, (void*)R_R8); } -void iWEpup(x64emu_t *emu, uintptr_t fcn) { iWEpup_t fn = (iWEpup_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (uint32_t)R_RDX, (void*)R_R8); } -void iWEppu(x64emu_t *emu, uintptr_t fcn) { iWEppu_t fn = (iWEppu_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (void*)R_RDX, (uint32_t)R_R8); } -void iWEppp(x64emu_t *emu, uintptr_t fcn) { iWEppp_t fn = (iWEppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (void*)R_RDX, (void*)R_R8); } -void iWpiii(x64emu_t *emu, uintptr_t fcn) { iWpiii_t fn = (iWpiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (int32_t)R_RDX, (int32_t)R_R8, (int32_t)R_R9); } -void iWpiuu(x64emu_t *emu, uintptr_t fcn) { iWpiuu_t fn = (iWpiuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (int32_t)R_RDX, (uint32_t)R_R8, (uint32_t)R_R9); } -void iWpuiu(x64emu_t *emu, uintptr_t fcn) { iWpuiu_t fn = (iWpuiu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8, (uint32_t)R_R9); } -void iWpuip(x64emu_t *emu, uintptr_t fcn) { iWpuip_t fn = (iWpuip_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8, (void*)R_R9); } -void iWpuup(x64emu_t *emu, uintptr_t fcn) { iWpuup_t fn = (iWpuup_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (void*)R_R9); } -void iWpupu(x64emu_t *emu, uintptr_t fcn) { iWpupu_t fn = (iWpupu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (void*)R_R8, (uint32_t)R_R9); } -void iWpupp(x64emu_t *emu, uintptr_t fcn) { iWpupp_t fn = (iWpupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (void*)R_R8, (void*)R_R9); } -void iWppuu(x64emu_t *emu, uintptr_t fcn) { iWppuu_t fn = (iWppuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX, (uint32_t)R_R8, (uint32_t)R_R9); } -void iWpppu(x64emu_t *emu, uintptr_t fcn) { iWpppu_t fn = (iWpppu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX, (void*)R_R8, (uint32_t)R_R9); } -void iWpppp(x64emu_t *emu, uintptr_t fcn) { iWpppp_t fn = (iWpppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX, (void*)R_R8, (void*)R_R9); } -void vFEiipV(x64emu_t *emu, uintptr_t fcn) { vFEiipV_t fn = (vFEiipV_t)fcn; fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void vFEiipA(x64emu_t *emu, uintptr_t fcn) { vFEiipA_t fn = (vFEiipA_t)fcn; fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFEippp(x64emu_t *emu, uintptr_t fcn) { vFEippp_t fn = (vFEippp_t)fcn; fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFEpipV(x64emu_t *emu, uintptr_t fcn) { vFEpipV_t fn = (vFEpipV_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void vFEpipA(x64emu_t *emu, uintptr_t fcn) { vFEpipA_t fn = (vFEpipA_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFEpuup(x64emu_t *emu, uintptr_t fcn) { vFEpuup_t fn = (vFEpuup_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void vFEpuuV(x64emu_t *emu, uintptr_t fcn) { vFEpuuV_t fn = (vFEpuuV_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)(R_RSP + 8)); } -void vFEpupp(x64emu_t *emu, uintptr_t fcn) { vFEpupp_t fn = (vFEpupp_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFEpupA(x64emu_t *emu, uintptr_t fcn) { vFEpupA_t fn = (vFEpupA_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFEpLLp(x64emu_t *emu, uintptr_t fcn) { vFEpLLp_t fn = (vFEpLLp_t)fcn; fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void vFEppip(x64emu_t *emu, uintptr_t fcn) { vFEppip_t fn = (vFEppip_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void vFEppiV(x64emu_t *emu, uintptr_t fcn) { vFEppiV_t fn = (vFEppiV_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)(R_RSP + 8)); } -void vFEppuu(x64emu_t *emu, uintptr_t fcn) { vFEppuu_t fn = (vFEppuu_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void vFEppup(x64emu_t *emu, uintptr_t fcn) { vFEppup_t fn = (vFEppup_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void vFEpppi(x64emu_t *emu, uintptr_t fcn) { vFEpppi_t fn = (vFEpppi_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void vFEpppp(x64emu_t *emu, uintptr_t fcn) { vFEpppp_t fn = (vFEpppp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void vFiiiii(x64emu_t *emu, uintptr_t fcn) { vFiiiii_t fn = (vFiiiii_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFiiiiu(x64emu_t *emu, uintptr_t fcn) { vFiiiiu_t fn = (vFiiiiu_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void vFiiipi(x64emu_t *emu, uintptr_t fcn) { vFiiipi_t fn = (vFiiipi_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void vFiiuii(x64emu_t *emu, uintptr_t fcn) { vFiiuii_t fn = (vFiiuii_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFiiuup(x64emu_t *emu, uintptr_t fcn) { vFiiuup_t fn = (vFiiuup_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFiillu(x64emu_t *emu, uintptr_t fcn) { vFiillu_t fn = (vFiillu_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (uint32_t)R_R8); } -void vFiilll(x64emu_t *emu, uintptr_t fcn) { vFiilll_t fn = (vFiilll_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); } -void vFiipii(x64emu_t *emu, uintptr_t fcn) { vFiipii_t fn = (vFiipii_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFiipll(x64emu_t *emu, uintptr_t fcn) { vFiipll_t fn = (vFiipll_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); } -void vFiuiip(x64emu_t *emu, uintptr_t fcn) { vFiuiip_t fn = (vFiuiip_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFiuipi(x64emu_t *emu, uintptr_t fcn) { vFiuipi_t fn = (vFiuipi_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void vFiuuuu(x64emu_t *emu, uintptr_t fcn) { vFiuuuu_t fn = (vFiuuuu_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void vFiulpp(x64emu_t *emu, uintptr_t fcn) { vFiulpp_t fn = (vFiulpp_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFiffff(x64emu_t *emu, uintptr_t fcn) { vFiffff_t fn = (vFiffff_t)fcn; fn((int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); } -void vFidddd(x64emu_t *emu, uintptr_t fcn) { vFidddd_t fn = (vFidddd_t)fcn; fn((int32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void vFilill(x64emu_t *emu, uintptr_t fcn) { vFilill_t fn = (vFilill_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); } -void vFilipi(x64emu_t *emu, uintptr_t fcn) { vFilipi_t fn = (vFilipi_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void vFilipl(x64emu_t *emu, uintptr_t fcn) { vFilipl_t fn = (vFilipl_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); } -void vFillll(x64emu_t *emu, uintptr_t fcn) { vFillll_t fn = (vFillll_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); } -void vFiLLLL(x64emu_t *emu, uintptr_t fcn) { vFiLLLL_t fn = (vFiLLLL_t)fcn; fn((int32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); } -void vFipipu(x64emu_t *emu, uintptr_t fcn) { vFipipu_t fn = (vFipipu_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void vFipipp(x64emu_t *emu, uintptr_t fcn) { vFipipp_t fn = (vFipipp_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFipupi(x64emu_t *emu, uintptr_t fcn) { vFipupi_t fn = (vFipupi_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void vFucccc(x64emu_t *emu, uintptr_t fcn) { vFucccc_t fn = (vFucccc_t)fcn; fn((uint32_t)R_RDI, (int8_t)R_RSI, (int8_t)R_RDX, (int8_t)R_RCX, (int8_t)R_R8); } -void vFuwwww(x64emu_t *emu, uintptr_t fcn) { vFuwwww_t fn = (vFuwwww_t)fcn; fn((uint32_t)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX, (int16_t)R_R8); } -void vFuiiii(x64emu_t *emu, uintptr_t fcn) { vFuiiii_t fn = (vFuiiii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFuiiiu(x64emu_t *emu, uintptr_t fcn) { vFuiiiu_t fn = (vFuiiiu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void vFuiiip(x64emu_t *emu, uintptr_t fcn) { vFuiiip_t fn = (vFuiiip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFuiiCp(x64emu_t *emu, uintptr_t fcn) { vFuiiCp_t fn = (vFuiiCp_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (void*)R_R8); } -void vFuiiup(x64emu_t *emu, uintptr_t fcn) { vFuiiup_t fn = (vFuiiup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFuiill(x64emu_t *emu, uintptr_t fcn) { vFuiill_t fn = (vFuiill_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); } -void vFuiuii(x64emu_t *emu, uintptr_t fcn) { vFuiuii_t fn = (vFuiuii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFuiuip(x64emu_t *emu, uintptr_t fcn) { vFuiuip_t fn = (vFuiuip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFuiuCi(x64emu_t *emu, uintptr_t fcn) { vFuiuCi_t fn = (vFuiuCi_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (int32_t)R_R8); } -void vFuiuCu(x64emu_t *emu, uintptr_t fcn) { vFuiuCu_t fn = (vFuiuCu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (uint32_t)R_R8); } -void vFuiuuu(x64emu_t *emu, uintptr_t fcn) { vFuiuuu_t fn = (vFuiuuu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void vFuiuup(x64emu_t *emu, uintptr_t fcn) { vFuiuup_t fn = (vFuiuup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFuiupi(x64emu_t *emu, uintptr_t fcn) { vFuiupi_t fn = (vFuiupi_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void vFuifff(x64emu_t *emu, uintptr_t fcn) { vFuifff_t fn = (vFuifff_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); } -void vFuiddd(x64emu_t *emu, uintptr_t fcn) { vFuiddd_t fn = (vFuiddd_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); } -void vFuilll(x64emu_t *emu, uintptr_t fcn) { vFuilll_t fn = (vFuilll_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); } -void vFuiLLL(x64emu_t *emu, uintptr_t fcn) { vFuiLLL_t fn = (vFuiLLL_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); } -void vFuipii(x64emu_t *emu, uintptr_t fcn) { vFuipii_t fn = (vFuipii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFuipip(x64emu_t *emu, uintptr_t fcn) { vFuipip_t fn = (vFuipip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFuipup(x64emu_t *emu, uintptr_t fcn) { vFuipup_t fn = (vFuipup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFuippp(x64emu_t *emu, uintptr_t fcn) { vFuippp_t fn = (vFuippp_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFuCCCC(x64emu_t *emu, uintptr_t fcn) { vFuCCCC_t fn = (vFuCCCC_t)fcn; fn((uint32_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8); } -void vFuCuip(x64emu_t *emu, uintptr_t fcn) { vFuCuip_t fn = (vFuCuip_t)fcn; fn((uint32_t)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFuCuup(x64emu_t *emu, uintptr_t fcn) { vFuCuup_t fn = (vFuCuup_t)fcn; fn((uint32_t)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFuWWWW(x64emu_t *emu, uintptr_t fcn) { vFuWWWW_t fn = (vFuWWWW_t)fcn; fn((uint32_t)R_RDI, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8); } -void vFuuiii(x64emu_t *emu, uintptr_t fcn) { vFuuiii_t fn = (vFuuiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFuuiiu(x64emu_t *emu, uintptr_t fcn) { vFuuiiu_t fn = (vFuuiiu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void vFuuiip(x64emu_t *emu, uintptr_t fcn) { vFuuiip_t fn = (vFuuiip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFuuiui(x64emu_t *emu, uintptr_t fcn) { vFuuiui_t fn = (vFuuiui_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void vFuuiuu(x64emu_t *emu, uintptr_t fcn) { vFuuiuu_t fn = (vFuuiuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void vFuuiup(x64emu_t *emu, uintptr_t fcn) { vFuuiup_t fn = (vFuuiup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFuuifi(x64emu_t *emu, uintptr_t fcn) { vFuuifi_t fn = (vFuuifi_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, emu->xmm[0].f[0], (int32_t)R_RCX); } -void vFuuipC(x64emu_t *emu, uintptr_t fcn) { vFuuipC_t fn = (vFuuipC_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint8_t)R_R8); } -void vFuuipu(x64emu_t *emu, uintptr_t fcn) { vFuuipu_t fn = (vFuuipu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void vFuuipp(x64emu_t *emu, uintptr_t fcn) { vFuuipp_t fn = (vFuuipp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFuuuii(x64emu_t *emu, uintptr_t fcn) { vFuuuii_t fn = (vFuuuii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFuuuiu(x64emu_t *emu, uintptr_t fcn) { vFuuuiu_t fn = (vFuuuiu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void vFuuuil(x64emu_t *emu, uintptr_t fcn) { vFuuuil_t fn = (vFuuuil_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (intptr_t)R_R8); } -void vFuuuip(x64emu_t *emu, uintptr_t fcn) { vFuuuip_t fn = (vFuuuip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFuuuui(x64emu_t *emu, uintptr_t fcn) { vFuuuui_t fn = (vFuuuui_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void vFuuuuu(x64emu_t *emu, uintptr_t fcn) { vFuuuuu_t fn = (vFuuuuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void vFuuuup(x64emu_t *emu, uintptr_t fcn) { vFuuuup_t fn = (vFuuuup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFuuuli(x64emu_t *emu, uintptr_t fcn) { vFuuuli_t fn = (vFuuuli_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8); } -void vFuuull(x64emu_t *emu, uintptr_t fcn) { vFuuull_t fn = (vFuuull_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); } -void vFuulll(x64emu_t *emu, uintptr_t fcn) { vFuulll_t fn = (vFuulll_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); } -void vFuullp(x64emu_t *emu, uintptr_t fcn) { vFuullp_t fn = (vFuullp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8); } -void vFuupii(x64emu_t *emu, uintptr_t fcn) { vFuupii_t fn = (vFuupii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFuuppu(x64emu_t *emu, uintptr_t fcn) { vFuuppu_t fn = (vFuuppu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void vFuffff(x64emu_t *emu, uintptr_t fcn) { vFuffff_t fn = (vFuffff_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); } -void vFudddd(x64emu_t *emu, uintptr_t fcn) { vFudddd_t fn = (vFudddd_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void vFulill(x64emu_t *emu, uintptr_t fcn) { vFulill_t fn = (vFulill_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); } -void vFullll(x64emu_t *emu, uintptr_t fcn) { vFullll_t fn = (vFullll_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); } -void vFullpu(x64emu_t *emu, uintptr_t fcn) { vFullpu_t fn = (vFullpu_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void vFuLLLL(x64emu_t *emu, uintptr_t fcn) { vFuLLLL_t fn = (vFuLLLL_t)fcn; fn((uint32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); } -void vFupiii(x64emu_t *emu, uintptr_t fcn) { vFupiii_t fn = (vFupiii_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFupupi(x64emu_t *emu, uintptr_t fcn) { vFupupi_t fn = (vFupupi_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void vFupupp(x64emu_t *emu, uintptr_t fcn) { vFupupp_t fn = (vFupupp_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFuplii(x64emu_t *emu, uintptr_t fcn) { vFuplii_t fn = (vFuplii_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFuppip(x64emu_t *emu, uintptr_t fcn) { vFuppip_t fn = (vFuppip_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFupppu(x64emu_t *emu, uintptr_t fcn) { vFupppu_t fn = (vFupppu_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void vFupppp(x64emu_t *emu, uintptr_t fcn) { vFupppp_t fn = (vFupppp_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFfffff(x64emu_t *emu, uintptr_t fcn) { vFfffff_t fn = (vFfffff_t)fcn; fn(emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0]); } -void vFddddp(x64emu_t *emu, uintptr_t fcn) { vFddddp_t fn = (vFddddp_t)fcn; fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], (void*)R_RDI); } -void vFluipp(x64emu_t *emu, uintptr_t fcn) { vFluipp_t fn = (vFluipp_t)fcn; fn((intptr_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFLpppi(x64emu_t *emu, uintptr_t fcn) { vFLpppi_t fn = (vFLpppi_t)fcn; fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void vFLpppp(x64emu_t *emu, uintptr_t fcn) { vFLpppp_t fn = (vFLpppp_t)fcn; fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFpiiii(x64emu_t *emu, uintptr_t fcn) { vFpiiii_t fn = (vFpiiii_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFpiiiI(x64emu_t *emu, uintptr_t fcn) { vFpiiiI_t fn = (vFpiiiI_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int64_t)R_R8); } -void vFpiiiu(x64emu_t *emu, uintptr_t fcn) { vFpiiiu_t fn = (vFpiiiu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void vFpiiip(x64emu_t *emu, uintptr_t fcn) { vFpiiip_t fn = (vFpiiip_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFpiiII(x64emu_t *emu, uintptr_t fcn) { vFpiiII_t fn = (vFpiiII_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8); } -void vFpiiuu(x64emu_t *emu, uintptr_t fcn) { vFpiiuu_t fn = (vFpiiuu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void vFpiiup(x64emu_t *emu, uintptr_t fcn) { vFpiiup_t fn = (vFpiiup_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFpiiff(x64emu_t *emu, uintptr_t fcn) { vFpiiff_t fn = (vFpiiff_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void vFpiipp(x64emu_t *emu, uintptr_t fcn) { vFpiipp_t fn = (vFpiipp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFpiIiI(x64emu_t *emu, uintptr_t fcn) { vFpiIiI_t fn = (vFpiIiI_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX, (int32_t)R_RCX, (int64_t)R_R8); } -void vFpiIII(x64emu_t *emu, uintptr_t fcn) { vFpiIII_t fn = (vFpiIII_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8); } -void vFpiuuu(x64emu_t *emu, uintptr_t fcn) { vFpiuuu_t fn = (vFpiuuu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void vFpiUUu(x64emu_t *emu, uintptr_t fcn) { vFpiUUu_t fn = (vFpiUUu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint32_t)R_R8); } -void vFpiUUp(x64emu_t *emu, uintptr_t fcn) { vFpiUUp_t fn = (vFpiUUp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (void*)R_R8); } -void vFpilpp(x64emu_t *emu, uintptr_t fcn) { vFpilpp_t fn = (vFpilpp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFpipii(x64emu_t *emu, uintptr_t fcn) { vFpipii_t fn = (vFpipii_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFpippi(x64emu_t *emu, uintptr_t fcn) { vFpippi_t fn = (vFpippi_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void vFpippp(x64emu_t *emu, uintptr_t fcn) { vFpippp_t fn = (vFpippp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFpuiip(x64emu_t *emu, uintptr_t fcn) { vFpuiip_t fn = (vFpuiip_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFpuipp(x64emu_t *emu, uintptr_t fcn) { vFpuipp_t fn = (vFpuipp_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFpuuuu(x64emu_t *emu, uintptr_t fcn) { vFpuuuu_t fn = (vFpuuuu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void vFpuuup(x64emu_t *emu, uintptr_t fcn) { vFpuuup_t fn = (vFpuuup_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFpuupp(x64emu_t *emu, uintptr_t fcn) { vFpuupp_t fn = (vFpuupp_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFpuddd(x64emu_t *emu, uintptr_t fcn) { vFpuddd_t fn = (vFpuddd_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); } -void vFpupiu(x64emu_t *emu, uintptr_t fcn) { vFpupiu_t fn = (vFpupiu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void vFpupup(x64emu_t *emu, uintptr_t fcn) { vFpupup_t fn = (vFpupup_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFpUuuu(x64emu_t *emu, uintptr_t fcn) { vFpUuuu_t fn = (vFpUuuu_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void vFpUUuu(x64emu_t *emu, uintptr_t fcn) { vFpUUuu_t fn = (vFpUUuu_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void vFpUUup(x64emu_t *emu, uintptr_t fcn) { vFpUUup_t fn = (vFpUUup_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFpUUUi(x64emu_t *emu, uintptr_t fcn) { vFpUUUi_t fn = (vFpUUUi_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (int32_t)R_R8); } -void vFpUUUu(x64emu_t *emu, uintptr_t fcn) { vFpUUUu_t fn = (vFpUUUu_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint32_t)R_R8); } -void vFpUUUp(x64emu_t *emu, uintptr_t fcn) { vFpUUUp_t fn = (vFpUUUp_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (void*)R_R8); } -void vFpfffi(x64emu_t *emu, uintptr_t fcn) { vFpfffi_t fn = (vFpfffi_t)fcn; fn((void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], (int32_t)R_RSI); } -void vFpffff(x64emu_t *emu, uintptr_t fcn) { vFpffff_t fn = (vFpffff_t)fcn; fn((void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); } -void vFpdiII(x64emu_t *emu, uintptr_t fcn) { vFpdiII_t fn = (vFpdiII_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], (int32_t)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX); } -void vFpddii(x64emu_t *emu, uintptr_t fcn) { vFpddii_t fn = (vFpddii_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI, (int32_t)R_RDX); } -void vFpdddd(x64emu_t *emu, uintptr_t fcn) { vFpdddd_t fn = (vFpdddd_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void vFpddpp(x64emu_t *emu, uintptr_t fcn) { vFpddpp_t fn = (vFpddpp_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (void*)R_RSI, (void*)R_RDX); } -void vFpluul(x64emu_t *emu, uintptr_t fcn) { vFpluul_t fn = (vFpluul_t)fcn; fn((void*)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8); } -void vFplppp(x64emu_t *emu, uintptr_t fcn) { vFplppp_t fn = (vFplppp_t)fcn; fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFpLLLL(x64emu_t *emu, uintptr_t fcn) { vFpLLLL_t fn = (vFpLLLL_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); } -void vFpLLpp(x64emu_t *emu, uintptr_t fcn) { vFpLLpp_t fn = (vFpLLpp_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFpLpiL(x64emu_t *emu, uintptr_t fcn) { vFpLpiL_t fn = (vFpLpiL_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); } -void vFppiii(x64emu_t *emu, uintptr_t fcn) { vFppiii_t fn = (vFppiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFppiiu(x64emu_t *emu, uintptr_t fcn) { vFppiiu_t fn = (vFppiiu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void vFppiip(x64emu_t *emu, uintptr_t fcn) { vFppiip_t fn = (vFppiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFppiui(x64emu_t *emu, uintptr_t fcn) { vFppiui_t fn = (vFppiui_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void vFppiup(x64emu_t *emu, uintptr_t fcn) { vFppiup_t fn = (vFppiup_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFppiff(x64emu_t *emu, uintptr_t fcn) { vFppiff_t fn = (vFppiff_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void vFppidd(x64emu_t *emu, uintptr_t fcn) { vFppidd_t fn = (vFppidd_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void vFppipi(x64emu_t *emu, uintptr_t fcn) { vFppipi_t fn = (vFppipi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void vFppipp(x64emu_t *emu, uintptr_t fcn) { vFppipp_t fn = (vFppipp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFppWui(x64emu_t *emu, uintptr_t fcn) { vFppWui_t fn = (vFppWui_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint16_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void vFppuii(x64emu_t *emu, uintptr_t fcn) { vFppuii_t fn = (vFppuii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFppuui(x64emu_t *emu, uintptr_t fcn) { vFppuui_t fn = (vFppuui_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void vFppuuu(x64emu_t *emu, uintptr_t fcn) { vFppuuu_t fn = (vFppuuu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void vFppuup(x64emu_t *emu, uintptr_t fcn) { vFppuup_t fn = (vFppuup_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFppudd(x64emu_t *emu, uintptr_t fcn) { vFppudd_t fn = (vFppudd_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void vFppupi(x64emu_t *emu, uintptr_t fcn) { vFppupi_t fn = (vFppupi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void vFppupu(x64emu_t *emu, uintptr_t fcn) { vFppupu_t fn = (vFppupu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void vFppupp(x64emu_t *emu, uintptr_t fcn) { vFppupp_t fn = (vFppupp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFppfff(x64emu_t *emu, uintptr_t fcn) { vFppfff_t fn = (vFppfff_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); } -void vFppddp(x64emu_t *emu, uintptr_t fcn) { vFppddp_t fn = (vFppddp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], (void*)R_RDX); } -void vFppLLL(x64emu_t *emu, uintptr_t fcn) { vFppLLL_t fn = (vFppLLL_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); } -void vFppLpL(x64emu_t *emu, uintptr_t fcn) { vFppLpL_t fn = (vFppLpL_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void vFpppii(x64emu_t *emu, uintptr_t fcn) { vFpppii_t fn = (vFpppii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void vFpppip(x64emu_t *emu, uintptr_t fcn) { vFpppip_t fn = (vFpppip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFpppui(x64emu_t *emu, uintptr_t fcn) { vFpppui_t fn = (vFpppui_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void vFpppuu(x64emu_t *emu, uintptr_t fcn) { vFpppuu_t fn = (vFpppuu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void vFpppup(x64emu_t *emu, uintptr_t fcn) { vFpppup_t fn = (vFpppup_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFpppff(x64emu_t *emu, uintptr_t fcn) { vFpppff_t fn = (vFpppff_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void vFpppdd(x64emu_t *emu, uintptr_t fcn) { vFpppdd_t fn = (vFpppdd_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0]); } -void vFpppLp(x64emu_t *emu, uintptr_t fcn) { vFpppLp_t fn = (vFpppLp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); } -void vFppppi(x64emu_t *emu, uintptr_t fcn) { vFppppi_t fn = (vFppppi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void vFppppu(x64emu_t *emu, uintptr_t fcn) { vFppppu_t fn = (vFppppu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void vFppppL(x64emu_t *emu, uintptr_t fcn) { vFppppL_t fn = (vFppppL_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void vFppppp(x64emu_t *emu, uintptr_t fcn) { vFppppp_t fn = (vFppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFEiipp(x64emu_t *emu, uintptr_t fcn) { iFEiipp_t fn = (iFEiipp_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFEiipV(x64emu_t *emu, uintptr_t fcn) { iFEiipV_t fn = (iFEiipV_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void iFEiipA(x64emu_t *emu, uintptr_t fcn) { iFEiipA_t fn = (iFEiipA_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFEipip(x64emu_t *emu, uintptr_t fcn) { iFEipip_t fn = (iFEipip_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFEippi(x64emu_t *emu, uintptr_t fcn) { iFEippi_t fn = (iFEippi_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFEippL(x64emu_t *emu, uintptr_t fcn) { iFEippL_t fn = (iFEippL_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void iFEippp(x64emu_t *emu, uintptr_t fcn) { iFEippp_t fn = (iFEippp_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFEpiii(x64emu_t *emu, uintptr_t fcn) { iFEpiii_t fn = (iFEpiii_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void iFEpipi(x64emu_t *emu, uintptr_t fcn) { iFEpipi_t fn = (iFEpipi_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFEpipp(x64emu_t *emu, uintptr_t fcn) { iFEpipp_t fn = (iFEpipp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFEpipV(x64emu_t *emu, uintptr_t fcn) { iFEpipV_t fn = (iFEpipV_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void iFEpipA(x64emu_t *emu, uintptr_t fcn) { iFEpipA_t fn = (iFEpipA_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFEpUup(x64emu_t *emu, uintptr_t fcn) { iFEpUup_t fn = (iFEpUup_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void iFEpLpp(x64emu_t *emu, uintptr_t fcn) { iFEpLpp_t fn = (iFEpLpp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFEpLpV(x64emu_t *emu, uintptr_t fcn) { iFEpLpV_t fn = (iFEpLpV_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void iFEpLpA(x64emu_t *emu, uintptr_t fcn) { iFEpLpA_t fn = (iFEpLpA_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFEppii(x64emu_t *emu, uintptr_t fcn) { iFEppii_t fn = (iFEppii_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void iFEppip(x64emu_t *emu, uintptr_t fcn) { iFEppip_t fn = (iFEppip_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFEppiV(x64emu_t *emu, uintptr_t fcn) { iFEppiV_t fn = (iFEppiV_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)(R_RSP + 8)); } -void iFEppiA(x64emu_t *emu, uintptr_t fcn) { iFEppiA_t fn = (iFEppiA_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFEpplp(x64emu_t *emu, uintptr_t fcn) { iFEpplp_t fn = (iFEpplp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX); } -void iFEpppi(x64emu_t *emu, uintptr_t fcn) { iFEpppi_t fn = (iFEpppi_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void iFEpppL(x64emu_t *emu, uintptr_t fcn) { iFEpppL_t fn = (iFEpppL_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void iFEpppp(x64emu_t *emu, uintptr_t fcn) { iFEpppp_t fn = (iFEpppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFEpppV(x64emu_t *emu, uintptr_t fcn) { iFEpppV_t fn = (iFEpppV_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void iFEpppA(x64emu_t *emu, uintptr_t fcn) { iFEpppA_t fn = (iFEpppA_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void iFiiipu(x64emu_t *emu, uintptr_t fcn) { iFiiipu_t fn = (iFiiipu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void iFiiipp(x64emu_t *emu, uintptr_t fcn) { iFiiipp_t fn = (iFiiipp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFiiupp(x64emu_t *emu, uintptr_t fcn) { iFiiupp_t fn = (iFiiupp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFiuuuu(x64emu_t *emu, uintptr_t fcn) { iFiuuuu_t fn = (iFiuuuu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void iFiuuup(x64emu_t *emu, uintptr_t fcn) { iFiuuup_t fn = (iFiuuup_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFiuLip(x64emu_t *emu, uintptr_t fcn) { iFiuLip_t fn = (iFiuLip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void iFillLL(x64emu_t *emu, uintptr_t fcn) { iFillLL_t fn = (iFillLL_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); } -void iFipiii(x64emu_t *emu, uintptr_t fcn) { iFipiii_t fn = (iFipiii_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void iFipiup(x64emu_t *emu, uintptr_t fcn) { iFipiup_t fn = (iFipiup_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFipipi(x64emu_t *emu, uintptr_t fcn) { iFipipi_t fn = (iFipipi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFipipu(x64emu_t *emu, uintptr_t fcn) { iFipipu_t fn = (iFipipu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void iFipuip(x64emu_t *emu, uintptr_t fcn) { iFipuip_t fn = (iFipuip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void iFipuui(x64emu_t *emu, uintptr_t fcn) { iFipuui_t fn = (iFipuui_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void iFipLup(x64emu_t *emu, uintptr_t fcn) { iFipLup_t fn = (iFipLup_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFippuu(x64emu_t *emu, uintptr_t fcn) { iFippuu_t fn = (iFippuu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void iFippLi(x64emu_t *emu, uintptr_t fcn) { iFippLi_t fn = (iFippLi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); } -void iFippLp(x64emu_t *emu, uintptr_t fcn) { iFippLp_t fn = (iFippLp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); } -void iFipppi(x64emu_t *emu, uintptr_t fcn) { iFipppi_t fn = (iFipppi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFipppp(x64emu_t *emu, uintptr_t fcn) { iFipppp_t fn = (iFipppp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFuuupp(x64emu_t *emu, uintptr_t fcn) { iFuuupp_t fn = (iFuuupp_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFuppLp(x64emu_t *emu, uintptr_t fcn) { iFuppLp_t fn = (iFuppLp_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); } -void iFLppip(x64emu_t *emu, uintptr_t fcn) { iFLppip_t fn = (iFLppip_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void iFLpppp(x64emu_t *emu, uintptr_t fcn) { iFLpppp_t fn = (iFLpppp_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpwwww(x64emu_t *emu, uintptr_t fcn) { iFpwwww_t fn = (iFpwwww_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int16_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX, (int16_t)R_R8); } -void iFpwppp(x64emu_t *emu, uintptr_t fcn) { iFpwppp_t fn = (iFpwppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int16_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpiiii(x64emu_t *emu, uintptr_t fcn) { iFpiiii_t fn = (iFpiiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void iFpiiiu(x64emu_t *emu, uintptr_t fcn) { iFpiiiu_t fn = (iFpiiiu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void iFpiiiL(x64emu_t *emu, uintptr_t fcn) { iFpiiiL_t fn = (iFpiiiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); } -void iFpiiip(x64emu_t *emu, uintptr_t fcn) { iFpiiip_t fn = (iFpiiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void iFpiiui(x64emu_t *emu, uintptr_t fcn) { iFpiiui_t fn = (iFpiiui_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void iFpiiuu(x64emu_t *emu, uintptr_t fcn) { iFpiiuu_t fn = (iFpiiuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void iFpiipi(x64emu_t *emu, uintptr_t fcn) { iFpiipi_t fn = (iFpiipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFpiipp(x64emu_t *emu, uintptr_t fcn) { iFpiipp_t fn = (iFpiipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpiIip(x64emu_t *emu, uintptr_t fcn) { iFpiIip_t fn = (iFpiIip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int64_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void iFpiuwp(x64emu_t *emu, uintptr_t fcn) { iFpiuwp_t fn = (iFpiuwp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int16_t)R_RCX, (void*)R_R8); } -void iFpiuuu(x64emu_t *emu, uintptr_t fcn) { iFpiuuu_t fn = (iFpiuuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void iFpiUUU(x64emu_t *emu, uintptr_t fcn) { iFpiUUU_t fn = (iFpiUUU_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8); } -void iFpipii(x64emu_t *emu, uintptr_t fcn) { iFpipii_t fn = (iFpipii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void iFpipiu(x64emu_t *emu, uintptr_t fcn) { iFpipiu_t fn = (iFpipiu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void iFpipiL(x64emu_t *emu, uintptr_t fcn) { iFpipiL_t fn = (iFpipiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); } -void iFpipip(x64emu_t *emu, uintptr_t fcn) { iFpipip_t fn = (iFpipip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void iFpippi(x64emu_t *emu, uintptr_t fcn) { iFpippi_t fn = (iFpippi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFpippW(x64emu_t *emu, uintptr_t fcn) { iFpippW_t fn = (iFpippW_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint16_t)R_R8); } -void iFpippp(x64emu_t *emu, uintptr_t fcn) { iFpippp_t fn = (iFpippp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpCCCC(x64emu_t *emu, uintptr_t fcn) { iFpCCCC_t fn = (iFpCCCC_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8); } -void iFpCupp(x64emu_t *emu, uintptr_t fcn) { iFpCupp_t fn = (iFpCupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpCpip(x64emu_t *emu, uintptr_t fcn) { iFpCpip_t fn = (iFpCpip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void iFpuill(x64emu_t *emu, uintptr_t fcn) { iFpuill_t fn = (iFpuill_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8); } -void iFpuipi(x64emu_t *emu, uintptr_t fcn) { iFpuipi_t fn = (iFpuipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFpuipp(x64emu_t *emu, uintptr_t fcn) { iFpuipp_t fn = (iFpuipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpuuip(x64emu_t *emu, uintptr_t fcn) { iFpuuip_t fn = (iFpuuip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void iFpuuui(x64emu_t *emu, uintptr_t fcn) { iFpuuui_t fn = (iFpuuui_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void iFpuuup(x64emu_t *emu, uintptr_t fcn) { iFpuuup_t fn = (iFpuuup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFpuuLL(x64emu_t *emu, uintptr_t fcn) { iFpuuLL_t fn = (iFpuuLL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); } -void iFpuupp(x64emu_t *emu, uintptr_t fcn) { iFpuupp_t fn = (iFpuupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpulup(x64emu_t *emu, uintptr_t fcn) { iFpulup_t fn = (iFpulup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFpulpp(x64emu_t *emu, uintptr_t fcn) { iFpulpp_t fn = (iFpulpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpuLpL(x64emu_t *emu, uintptr_t fcn) { iFpuLpL_t fn = (iFpuLpL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void iFpuLpp(x64emu_t *emu, uintptr_t fcn) { iFpuLpp_t fn = (iFpuLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpupui(x64emu_t *emu, uintptr_t fcn) { iFpupui_t fn = (iFpupui_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void iFpupuu(x64emu_t *emu, uintptr_t fcn) { iFpupuu_t fn = (iFpupuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void iFpupuU(x64emu_t *emu, uintptr_t fcn) { iFpupuU_t fn = (iFpupuU_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint64_t)R_R8); } -void iFpupup(x64emu_t *emu, uintptr_t fcn) { iFpupup_t fn = (iFpupup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFpuppL(x64emu_t *emu, uintptr_t fcn) { iFpuppL_t fn = (iFpuppL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void iFpuppp(x64emu_t *emu, uintptr_t fcn) { iFpuppp_t fn = (iFpuppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpUiUi(x64emu_t *emu, uintptr_t fcn) { iFpUiUi_t fn = (iFpUiUi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX, (int32_t)R_R8); } -void iFpUupp(x64emu_t *emu, uintptr_t fcn) { iFpUupp_t fn = (iFpUupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFplupp(x64emu_t *emu, uintptr_t fcn) { iFplupp_t fn = (iFplupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFplluu(x64emu_t *emu, uintptr_t fcn) { iFplluu_t fn = (iFplluu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void iFpLiup(x64emu_t *emu, uintptr_t fcn) { iFpLiup_t fn = (iFpLiup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFpLilp(x64emu_t *emu, uintptr_t fcn) { iFpLilp_t fn = (iFpLilp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8); } -void iFpLiLi(x64emu_t *emu, uintptr_t fcn) { iFpLiLi_t fn = (iFpLiLi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); } -void iFpLlpp(x64emu_t *emu, uintptr_t fcn) { iFpLlpp_t fn = (iFpLlpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpLLii(x64emu_t *emu, uintptr_t fcn) { iFpLLii_t fn = (iFpLLii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void iFpLLup(x64emu_t *emu, uintptr_t fcn) { iFpLLup_t fn = (iFpLLup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFpLLpp(x64emu_t *emu, uintptr_t fcn) { iFpLLpp_t fn = (iFpLLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpLpii(x64emu_t *emu, uintptr_t fcn) { iFpLpii_t fn = (iFpLpii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void iFpLpiL(x64emu_t *emu, uintptr_t fcn) { iFpLpiL_t fn = (iFpLpiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); } -void iFpLpuL(x64emu_t *emu, uintptr_t fcn) { iFpLpuL_t fn = (iFpLpuL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8); } -void iFpLpup(x64emu_t *emu, uintptr_t fcn) { iFpLpup_t fn = (iFpLpup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFpLpLi(x64emu_t *emu, uintptr_t fcn) { iFpLpLi_t fn = (iFpLpLi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); } -void iFpLppi(x64emu_t *emu, uintptr_t fcn) { iFpLppi_t fn = (iFpLppi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFpLppL(x64emu_t *emu, uintptr_t fcn) { iFpLppL_t fn = (iFpLppL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void iFpLppp(x64emu_t *emu, uintptr_t fcn) { iFpLppp_t fn = (iFpLppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFppiiu(x64emu_t *emu, uintptr_t fcn) { iFppiiu_t fn = (iFppiiu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void iFppiiL(x64emu_t *emu, uintptr_t fcn) { iFppiiL_t fn = (iFppiiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); } -void iFppiip(x64emu_t *emu, uintptr_t fcn) { iFppiip_t fn = (iFppiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void iFppiuu(x64emu_t *emu, uintptr_t fcn) { iFppiuu_t fn = (iFppiuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void iFppiup(x64emu_t *emu, uintptr_t fcn) { iFppiup_t fn = (iFppiup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFppiLi(x64emu_t *emu, uintptr_t fcn) { iFppiLi_t fn = (iFppiLi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); } -void iFppiLL(x64emu_t *emu, uintptr_t fcn) { iFppiLL_t fn = (iFppiLL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); } -void iFppipi(x64emu_t *emu, uintptr_t fcn) { iFppipi_t fn = (iFppipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFppipu(x64emu_t *emu, uintptr_t fcn) { iFppipu_t fn = (iFppipu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void iFppipp(x64emu_t *emu, uintptr_t fcn) { iFppipp_t fn = (iFppipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFppuwp(x64emu_t *emu, uintptr_t fcn) { iFppuwp_t fn = (iFppuwp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int16_t)R_RCX, (void*)R_R8); } -void iFppuip(x64emu_t *emu, uintptr_t fcn) { iFppuip_t fn = (iFppuip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void iFppuuu(x64emu_t *emu, uintptr_t fcn) { iFppuuu_t fn = (iFppuuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void iFppuup(x64emu_t *emu, uintptr_t fcn) { iFppuup_t fn = (iFppuup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFppupi(x64emu_t *emu, uintptr_t fcn) { iFppupi_t fn = (iFppupi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFppupu(x64emu_t *emu, uintptr_t fcn) { iFppupu_t fn = (iFppupu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void iFppupp(x64emu_t *emu, uintptr_t fcn) { iFppupp_t fn = (iFppupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFppUup(x64emu_t *emu, uintptr_t fcn) { iFppUup_t fn = (iFppUup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFpplii(x64emu_t *emu, uintptr_t fcn) { iFpplii_t fn = (iFpplii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void iFppllp(x64emu_t *emu, uintptr_t fcn) { iFppllp_t fn = (iFppllp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8); } -void iFpplpp(x64emu_t *emu, uintptr_t fcn) { iFpplpp_t fn = (iFpplpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFppLup(x64emu_t *emu, uintptr_t fcn) { iFppLup_t fn = (iFppLup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFppLpi(x64emu_t *emu, uintptr_t fcn) { iFppLpi_t fn = (iFppLpi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFppLpL(x64emu_t *emu, uintptr_t fcn) { iFppLpL_t fn = (iFppLpL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void iFppLpp(x64emu_t *emu, uintptr_t fcn) { iFppLpp_t fn = (iFppLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpppii(x64emu_t *emu, uintptr_t fcn) { iFpppii_t fn = (iFpppii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void iFpppip(x64emu_t *emu, uintptr_t fcn) { iFpppip_t fn = (iFpppip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void iFpppui(x64emu_t *emu, uintptr_t fcn) { iFpppui_t fn = (iFpppui_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void iFpppup(x64emu_t *emu, uintptr_t fcn) { iFpppup_t fn = (iFpppup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFpppUi(x64emu_t *emu, uintptr_t fcn) { iFpppUi_t fn = (iFpppUi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint64_t)R_RCX, (int32_t)R_R8); } -void iFpppLi(x64emu_t *emu, uintptr_t fcn) { iFpppLi_t fn = (iFpppLi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); } -void iFpppLL(x64emu_t *emu, uintptr_t fcn) { iFpppLL_t fn = (iFpppLL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); } -void iFpppLp(x64emu_t *emu, uintptr_t fcn) { iFpppLp_t fn = (iFpppLp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); } -void iFppppi(x64emu_t *emu, uintptr_t fcn) { iFppppi_t fn = (iFppppi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFppppu(x64emu_t *emu, uintptr_t fcn) { iFppppu_t fn = (iFppppu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void iFppppl(x64emu_t *emu, uintptr_t fcn) { iFppppl_t fn = (iFppppl_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (intptr_t)R_R8); } -void iFppppL(x64emu_t *emu, uintptr_t fcn) { iFppppL_t fn = (iFppppL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void iFppppp(x64emu_t *emu, uintptr_t fcn) { iFppppp_t fn = (iFppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void IFppIII(x64emu_t *emu, uintptr_t fcn) { IFppIII_t fn = (IFppIII_t)fcn; R_RAX=(int64_t)fn((void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8); } -void uFEippp(x64emu_t *emu, uintptr_t fcn) { uFEippp_t fn = (uFEippp_t)fcn; R_RAX=(uint32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void uFEpipp(x64emu_t *emu, uintptr_t fcn) { uFEpipp_t fn = (uFEpipp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void uFEppuu(x64emu_t *emu, uintptr_t fcn) { uFEppuu_t fn = (uFEppuu_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } -void uFEpppp(x64emu_t *emu, uintptr_t fcn) { uFEpppp_t fn = (uFEpppp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void uFEpppV(x64emu_t *emu, uintptr_t fcn) { uFEpppV_t fn = (uFEpppV_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void uFiuuuu(x64emu_t *emu, uintptr_t fcn) { uFiuuuu_t fn = (uFiuuuu_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void uFiuppi(x64emu_t *emu, uintptr_t fcn) { uFiuppi_t fn = (uFiuppi_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void uFipipp(x64emu_t *emu, uintptr_t fcn) { uFipipp_t fn = (uFipipp_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFipLpp(x64emu_t *emu, uintptr_t fcn) { uFipLpp_t fn = (uFipLpp_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFuiiii(x64emu_t *emu, uintptr_t fcn) { uFuiiii_t fn = (uFuiiii_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void uFLpppL(x64emu_t *emu, uintptr_t fcn) { uFLpppL_t fn = (uFLpppL_t)fcn; R_RAX=(uint32_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void uFpCCCC(x64emu_t *emu, uintptr_t fcn) { uFpCCCC_t fn = (uFpCCCC_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8); } -void uFpWuip(x64emu_t *emu, uintptr_t fcn) { uFpWuip_t fn = (uFpWuip_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void uFpuuui(x64emu_t *emu, uintptr_t fcn) { uFpuuui_t fn = (uFpuuui_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void uFpuuuu(x64emu_t *emu, uintptr_t fcn) { uFpuuuu_t fn = (uFpuuuu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void uFpuupp(x64emu_t *emu, uintptr_t fcn) { uFpuupp_t fn = (uFpuupp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFpupuu(x64emu_t *emu, uintptr_t fcn) { uFpupuu_t fn = (uFpupuu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void uFpuppp(x64emu_t *emu, uintptr_t fcn) { uFpuppp_t fn = (uFpuppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFppipp(x64emu_t *emu, uintptr_t fcn) { uFppipp_t fn = (uFppipp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFppuup(x64emu_t *emu, uintptr_t fcn) { uFppuup_t fn = (uFppuup_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void uFppupp(x64emu_t *emu, uintptr_t fcn) { uFppupp_t fn = (uFppupp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFpplip(x64emu_t *emu, uintptr_t fcn) { uFpplip_t fn = (uFpplip_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void uFppLpp(x64emu_t *emu, uintptr_t fcn) { uFppLpp_t fn = (uFppLpp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFppppL(x64emu_t *emu, uintptr_t fcn) { uFppppL_t fn = (uFppppL_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void uFppppp(x64emu_t *emu, uintptr_t fcn) { uFppppp_t fn = (uFppppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFbCuuu(x64emu_t *emu, uintptr_t fcn) { uFbCuuu_t fn = (uFbCuuu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbCuup(x64emu_t *emu, uintptr_t fcn) { uFbCuup_t fn = (uFbCuup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuuWW(x64emu_t *emu, uintptr_t fcn) { uFbuuWW_t fn = (uFbuuWW_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuuup(x64emu_t *emu, uintptr_t fcn) { uFbuuup_t fn = (uFbuuup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void UFuiiii(x64emu_t *emu, uintptr_t fcn) { UFuiiii_t fn = (UFuiiii_t)fcn; R_RAX=fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void lFEuipp(x64emu_t *emu, uintptr_t fcn) { lFEuipp_t fn = (lFEuipp_t)fcn; R_RAX=(intptr_t)fn(emu, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void lFipili(x64emu_t *emu, uintptr_t fcn) { lFipili_t fn = (lFipili_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8); } -void lFipLli(x64emu_t *emu, uintptr_t fcn) { lFipLli_t fn = (lFipLli_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8); } -void lFipLlL(x64emu_t *emu, uintptr_t fcn) { lFipLlL_t fn = (lFipLlL_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX, (uintptr_t)R_R8); } -void lFipLLi(x64emu_t *emu, uintptr_t fcn) { lFipLLi_t fn = (lFipLLi_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); } -void lFipLpp(x64emu_t *emu, uintptr_t fcn) { lFipLpp_t fn = (lFipLpp_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void lFpuipC(x64emu_t *emu, uintptr_t fcn) { lFpuipC_t fn = (lFpuipC_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint8_t)R_R8); } -void lFpuuLL(x64emu_t *emu, uintptr_t fcn) { lFpuuLL_t fn = (lFpuuLL_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); } -void lFppupp(x64emu_t *emu, uintptr_t fcn) { lFppupp_t fn = (lFppupp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void lFppllp(x64emu_t *emu, uintptr_t fcn) { lFppllp_t fn = (lFppllp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8); } -void lFppLpL(x64emu_t *emu, uintptr_t fcn) { lFppLpL_t fn = (lFppLpL_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void lFppLpp(x64emu_t *emu, uintptr_t fcn) { lFppLpp_t fn = (lFppLpp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void LFELppi(x64emu_t *emu, uintptr_t fcn) { LFELppi_t fn = (LFELppi_t)fcn; R_RAX=(uintptr_t)fn(emu, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void LFEpppp(x64emu_t *emu, uintptr_t fcn) { LFEpppp_t fn = (LFEpppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void LFuiCiu(x64emu_t *emu, uintptr_t fcn) { LFuiCiu_t fn = (LFuiCiu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void LFLpppL(x64emu_t *emu, uintptr_t fcn) { LFLpppL_t fn = (LFLpppL_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void LFpuipp(x64emu_t *emu, uintptr_t fcn) { LFpuipp_t fn = (LFpuipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void LFpuppi(x64emu_t *emu, uintptr_t fcn) { LFpuppi_t fn = (LFpuppi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void LFpLuuu(x64emu_t *emu, uintptr_t fcn) { LFpLuuu_t fn = (LFpLuuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void LFpLLLp(x64emu_t *emu, uintptr_t fcn) { LFpLLLp_t fn = (LFpLLLp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); } -void LFpLpuu(x64emu_t *emu, uintptr_t fcn) { LFpLpuu_t fn = (LFpLpuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void LFpLppL(x64emu_t *emu, uintptr_t fcn) { LFpLppL_t fn = (LFpLppL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void LFpLppp(x64emu_t *emu, uintptr_t fcn) { LFpLppp_t fn = (LFpLppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void LFppLLp(x64emu_t *emu, uintptr_t fcn) { LFppLLp_t fn = (LFppLLp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); } -void LFppLpL(x64emu_t *emu, uintptr_t fcn) { LFppLpL_t fn = (LFppLpL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void LFpppii(x64emu_t *emu, uintptr_t fcn) { LFpppii_t fn = (LFpppii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void LFppppp(x64emu_t *emu, uintptr_t fcn) { LFppppp_t fn = (LFppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFEpiii(x64emu_t *emu, uintptr_t fcn) { pFEpiii_t fn = (pFEpiii_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void pFEpipL(x64emu_t *emu, uintptr_t fcn) { pFEpipL_t fn = (pFEpipL_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } -void pFEpipp(x64emu_t *emu, uintptr_t fcn) { pFEpipp_t fn = (pFEpipp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFEpipV(x64emu_t *emu, uintptr_t fcn) { pFEpipV_t fn = (pFEpipV_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void pFEpipA(x64emu_t *emu, uintptr_t fcn) { pFEpipA_t fn = (pFEpipA_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFEpupp(x64emu_t *emu, uintptr_t fcn) { pFEpupp_t fn = (pFEpupp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFEpUpp(x64emu_t *emu, uintptr_t fcn) { pFEpUpp_t fn = (pFEpUpp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFEpLpp(x64emu_t *emu, uintptr_t fcn) { pFEpLpp_t fn = (pFEpLpp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFEppii(x64emu_t *emu, uintptr_t fcn) { pFEppii_t fn = (pFEppii_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void pFEppip(x64emu_t *emu, uintptr_t fcn) { pFEppip_t fn = (pFEppip_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void pFEppLp(x64emu_t *emu, uintptr_t fcn) { pFEppLp_t fn = (pFEppLp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); } -void pFEpppi(x64emu_t *emu, uintptr_t fcn) { pFEpppi_t fn = (pFEpppi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } -void pFEpppu(x64emu_t *emu, uintptr_t fcn) { pFEpppu_t fn = (pFEpppu_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } -void pFEpppp(x64emu_t *emu, uintptr_t fcn) { pFEpppp_t fn = (pFEpppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFEpppV(x64emu_t *emu, uintptr_t fcn) { pFEpppV_t fn = (pFEpppV_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } -void pFEpppA(x64emu_t *emu, uintptr_t fcn) { pFEpppA_t fn = (pFEpppA_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFiiiii(x64emu_t *emu, uintptr_t fcn) { pFiiiii_t fn = (pFiiiii_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void pFiiipL(x64emu_t *emu, uintptr_t fcn) { pFiiipL_t fn = (pFiiipL_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void pFipipL(x64emu_t *emu, uintptr_t fcn) { pFipipL_t fn = (pFipipL_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void pFipipp(x64emu_t *emu, uintptr_t fcn) { pFipipp_t fn = (pFipipp_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFuiiiu(x64emu_t *emu, uintptr_t fcn) { pFuiiiu_t fn = (pFuiiiu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void pFuiupp(x64emu_t *emu, uintptr_t fcn) { pFuiupp_t fn = (pFuiupp_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFuuiip(x64emu_t *emu, uintptr_t fcn) { pFuuiip_t fn = (pFuuiip_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void pFuuupu(x64emu_t *emu, uintptr_t fcn) { pFuuupu_t fn = (pFuuupu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void pFuupuu(x64emu_t *emu, uintptr_t fcn) { pFuupuu_t fn = (pFuupuu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void pFudddp(x64emu_t *emu, uintptr_t fcn) { pFudddp_t fn = (pFudddp_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], (void*)R_RSI); } -void pFupLpl(x64emu_t *emu, uintptr_t fcn) { pFupLpl_t fn = (pFupLpl_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); } -void pFupLpL(x64emu_t *emu, uintptr_t fcn) { pFupLpL_t fn = (pFupLpL_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void pFddddi(x64emu_t *emu, uintptr_t fcn) { pFddddi_t fn = (pFddddi_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], (int32_t)R_RDI); } -void pFLuppp(x64emu_t *emu, uintptr_t fcn) { pFLuppp_t fn = (pFLuppp_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFLpppi(x64emu_t *emu, uintptr_t fcn) { pFLpppi_t fn = (pFLpppi_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void pFpiiii(x64emu_t *emu, uintptr_t fcn) { pFpiiii_t fn = (pFpiiii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void pFpiiip(x64emu_t *emu, uintptr_t fcn) { pFpiiip_t fn = (pFpiiip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void pFpiiuu(x64emu_t *emu, uintptr_t fcn) { pFpiiuu_t fn = (pFpiiuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void pFpiipi(x64emu_t *emu, uintptr_t fcn) { pFpiipi_t fn = (pFpiipi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void pFpiipL(x64emu_t *emu, uintptr_t fcn) { pFpiipL_t fn = (pFpiipL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void pFpiipp(x64emu_t *emu, uintptr_t fcn) { pFpiipp_t fn = (pFpiipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFpiCCC(x64emu_t *emu, uintptr_t fcn) { pFpiCCC_t fn = (pFpiCCC_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8); } -void pFpiuuu(x64emu_t *emu, uintptr_t fcn) { pFpiuuu_t fn = (pFpiuuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void pFpiuup(x64emu_t *emu, uintptr_t fcn) { pFpiuup_t fn = (pFpiuup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void pFpiupp(x64emu_t *emu, uintptr_t fcn) { pFpiupp_t fn = (pFpiupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFpiLip(x64emu_t *emu, uintptr_t fcn) { pFpiLip_t fn = (pFpiLip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void pFpipip(x64emu_t *emu, uintptr_t fcn) { pFpipip_t fn = (pFpipip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void pFpipup(x64emu_t *emu, uintptr_t fcn) { pFpipup_t fn = (pFpipup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void pFpippi(x64emu_t *emu, uintptr_t fcn) { pFpippi_t fn = (pFpippi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void pFpippp(x64emu_t *emu, uintptr_t fcn) { pFpippp_t fn = (pFpippp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFpuiii(x64emu_t *emu, uintptr_t fcn) { pFpuiii_t fn = (pFpuiii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void pFpuiip(x64emu_t *emu, uintptr_t fcn) { pFpuiip_t fn = (pFpuiip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void pFpuuip(x64emu_t *emu, uintptr_t fcn) { pFpuuip_t fn = (pFpuuip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void pFpuuuu(x64emu_t *emu, uintptr_t fcn) { pFpuuuu_t fn = (pFpuuuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void pFpuuup(x64emu_t *emu, uintptr_t fcn) { pFpuuup_t fn = (pFpuuup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void pFpuupp(x64emu_t *emu, uintptr_t fcn) { pFpuupp_t fn = (pFpuupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFpuLpp(x64emu_t *emu, uintptr_t fcn) { pFpuLpp_t fn = (pFpuLpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFpuppu(x64emu_t *emu, uintptr_t fcn) { pFpuppu_t fn = (pFpuppu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void pFpuppp(x64emu_t *emu, uintptr_t fcn) { pFpuppp_t fn = (pFpuppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFpUdii(x64emu_t *emu, uintptr_t fcn) { pFpUdii_t fn = (pFpUdii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint64_t)R_RSI, emu->xmm[0].d[0], (int32_t)R_RDX, (int32_t)R_RCX); } -void pFpfffi(x64emu_t *emu, uintptr_t fcn) { pFpfffi_t fn = (pFpfffi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], (int32_t)R_RSI); } -void pFpdddd(x64emu_t *emu, uintptr_t fcn) { pFpdddd_t fn = (pFpdddd_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void pFplppp(x64emu_t *emu, uintptr_t fcn) { pFplppp_t fn = (pFplppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFpLiii(x64emu_t *emu, uintptr_t fcn) { pFpLiii_t fn = (pFpLiii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void pFpLLip(x64emu_t *emu, uintptr_t fcn) { pFpLLip_t fn = (pFpLLip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void pFpLLLp(x64emu_t *emu, uintptr_t fcn) { pFpLLLp_t fn = (pFpLLLp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); } -void pFpLpii(x64emu_t *emu, uintptr_t fcn) { pFpLpii_t fn = (pFpLpii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void pFpLpip(x64emu_t *emu, uintptr_t fcn) { pFpLpip_t fn = (pFpLpip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void pFpLpup(x64emu_t *emu, uintptr_t fcn) { pFpLpup_t fn = (pFpLpup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void pFppiii(x64emu_t *emu, uintptr_t fcn) { pFppiii_t fn = (pFppiii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void pFppiiu(x64emu_t *emu, uintptr_t fcn) { pFppiiu_t fn = (pFppiiu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void pFppiip(x64emu_t *emu, uintptr_t fcn) { pFppiip_t fn = (pFppiip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void pFppiup(x64emu_t *emu, uintptr_t fcn) { pFppiup_t fn = (pFppiup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void pFppipi(x64emu_t *emu, uintptr_t fcn) { pFppipi_t fn = (pFppipi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void pFppipp(x64emu_t *emu, uintptr_t fcn) { pFppipp_t fn = (pFppipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFppWpp(x64emu_t *emu, uintptr_t fcn) { pFppWpp_t fn = (pFppWpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint16_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFppuip(x64emu_t *emu, uintptr_t fcn) { pFppuip_t fn = (pFppuip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void pFppuuu(x64emu_t *emu, uintptr_t fcn) { pFppuuu_t fn = (pFppuuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); } -void pFppuup(x64emu_t *emu, uintptr_t fcn) { pFppuup_t fn = (pFppuup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void pFppupp(x64emu_t *emu, uintptr_t fcn) { pFppupp_t fn = (pFppupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFppddu(x64emu_t *emu, uintptr_t fcn) { pFppddu_t fn = (pFppddu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], (uint32_t)R_RDX); } -void pFppLii(x64emu_t *emu, uintptr_t fcn) { pFppLii_t fn = (pFppLii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void pFppLLi(x64emu_t *emu, uintptr_t fcn) { pFppLLi_t fn = (pFppLLi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); } -void pFppLpp(x64emu_t *emu, uintptr_t fcn) { pFppLpp_t fn = (pFppLpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFpppii(x64emu_t *emu, uintptr_t fcn) { pFpppii_t fn = (pFpppii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } -void pFpppip(x64emu_t *emu, uintptr_t fcn) { pFpppip_t fn = (pFpppip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void pFpppui(x64emu_t *emu, uintptr_t fcn) { pFpppui_t fn = (pFpppui_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8); } -void pFpppup(x64emu_t *emu, uintptr_t fcn) { pFpppup_t fn = (pFpppup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void pFpppli(x64emu_t *emu, uintptr_t fcn) { pFpppli_t fn = (pFpppli_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8); } -void pFpppLi(x64emu_t *emu, uintptr_t fcn) { pFpppLi_t fn = (pFpppLi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8); } -void pFppppi(x64emu_t *emu, uintptr_t fcn) { pFppppi_t fn = (pFppppi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void pFppppu(x64emu_t *emu, uintptr_t fcn) { pFppppu_t fn = (pFppppu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } -void pFppppL(x64emu_t *emu, uintptr_t fcn) { pFppppL_t fn = (pFppppL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void pFppppp(x64emu_t *emu, uintptr_t fcn) { pFppppp_t fn = (pFppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFbuWWW(x64emu_t *emu, uintptr_t fcn) { pFbuWWW_t fn = (pFbuWWW_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint16_t)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuWW(x64emu_t *emu, uintptr_t fcn) { pFbuuWW_t fn = (pFbuuWW_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuup(x64emu_t *emu, uintptr_t fcn) { pFbuuup_t fn = (pFbuuup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbupii(x64emu_t *emu, uintptr_t fcn) { pFbupii_t fn = (pFbupii_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbpuii(x64emu_t *emu, uintptr_t fcn) { pFbpuii_t fn = (pFbpuii_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbpppp(x64emu_t *emu, uintptr_t fcn) { pFbpppp_t fn = (pFbpppp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void iWEpiup(x64emu_t *emu, uintptr_t fcn) { iWEpiup_t fn = (iWEpiup_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (int32_t)R_RDX, (uint32_t)R_R8, (void*)R_R9); } -void iWEpipp(x64emu_t *emu, uintptr_t fcn) { iWEpipp_t fn = (iWEpipp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (int32_t)R_RDX, (void*)R_R8, (void*)R_R9); } -void iWpiiii(x64emu_t *emu, uintptr_t fcn) { iWpiiii_t fn = (iWpiiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (int32_t)R_RDX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 40)); } -void iWpiupu(x64emu_t *emu, uintptr_t fcn) { iWpiupu_t fn = (iWpiupu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (int32_t)R_RDX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 40)); } -void iWpuiii(x64emu_t *emu, uintptr_t fcn) { iWpuiii_t fn = (iWpuiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 40)); } -void iWpuiup(x64emu_t *emu, uintptr_t fcn) { iWpuiup_t fn = (iWpuiup_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 40)); } -void iWpuupu(x64emu_t *emu, uintptr_t fcn) { iWpuupu_t fn = (iWpuupu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 40)); } -void iWpuupp(x64emu_t *emu, uintptr_t fcn) { iWpuupp_t fn = (iWpuupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 40)); } -void iWpupuu(x64emu_t *emu, uintptr_t fcn) { iWpupuu_t fn = (iWpupuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 40)); } -void iWpupup(x64emu_t *emu, uintptr_t fcn) { iWpupup_t fn = (iWpupup_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 40)); } -void iWpuppu(x64emu_t *emu, uintptr_t fcn) { iWpuppu_t fn = (iWpuppu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 40)); } -void iWpuppp(x64emu_t *emu, uintptr_t fcn) { iWpuppp_t fn = (iWpuppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 40)); } -void iWpppuu(x64emu_t *emu, uintptr_t fcn) { iWpppuu_t fn = (iWpppuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 40)); } -void iWpppup(x64emu_t *emu, uintptr_t fcn) { iWpppup_t fn = (iWpppup_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 40)); } -void iWppppp(x64emu_t *emu, uintptr_t fcn) { iWppppp_t fn = (iWppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 40)); } -void vFEiiipp(x64emu_t *emu, uintptr_t fcn) { vFEiiipp_t fn = (vFEiiipp_t)fcn; fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFEpiwpp(x64emu_t *emu, uintptr_t fcn) { vFEpiwpp_t fn = (vFEpiwpp_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int16_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFEpiLpp(x64emu_t *emu, uintptr_t fcn) { vFEpiLpp_t fn = (vFEpiLpp_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFEpippp(x64emu_t *emu, uintptr_t fcn) { vFEpippp_t fn = (vFEpippp_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFEpuipp(x64emu_t *emu, uintptr_t fcn) { vFEpuipp_t fn = (vFEpuipp_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFEpuipV(x64emu_t *emu, uintptr_t fcn) { vFEpuipV_t fn = (vFEpuipV_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)(R_RSP + 8)); } -void vFEpupup(x64emu_t *emu, uintptr_t fcn) { vFEpupup_t fn = (vFEpupup_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void vFEpuppp(x64emu_t *emu, uintptr_t fcn) { vFEpuppp_t fn = (vFEpuppp_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFEpLLpp(x64emu_t *emu, uintptr_t fcn) { vFEpLLpp_t fn = (vFEpLLpp_t)fcn; fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFEppipV(x64emu_t *emu, uintptr_t fcn) { vFEppipV_t fn = (vFEppipV_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)(R_RSP + 8)); } -void vFEppipA(x64emu_t *emu, uintptr_t fcn) { vFEppipA_t fn = (vFEppipA_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFEppupp(x64emu_t *emu, uintptr_t fcn) { vFEppupp_t fn = (vFEppupp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFEppppp(x64emu_t *emu, uintptr_t fcn) { vFEppppp_t fn = (vFEppppp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void vFiiiiii(x64emu_t *emu, uintptr_t fcn) { vFiiiiii_t fn = (vFiiiiii_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFiiiuil(x64emu_t *emu, uintptr_t fcn) { vFiiiuil_t fn = (vFiiiuil_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9); } -void vFiiilpi(x64emu_t *emu, uintptr_t fcn) { vFiiilpi_t fn = (vFiiilpi_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void vFiiuilp(x64emu_t *emu, uintptr_t fcn) { vFiiuilp_t fn = (vFiiuilp_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (intptr_t)R_R8, (void*)R_R9); } -void vFiffiff(x64emu_t *emu, uintptr_t fcn) { vFiffiff_t fn = (vFiffiff_t)fcn; fn((int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], (int32_t)R_RSI, emu->xmm[2].f[0], emu->xmm[3].f[0]); } -void vFiddidd(x64emu_t *emu, uintptr_t fcn) { vFiddidd_t fn = (vFiddidd_t)fcn; fn((int32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI, emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void vFilipli(x64emu_t *emu, uintptr_t fcn) { vFilipli_t fn = (vFilipli_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (int32_t)R_R9); } -void vFiliplu(x64emu_t *emu, uintptr_t fcn) { vFiliplu_t fn = (vFiliplu_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (uint32_t)R_R9); } -void vFillill(x64emu_t *emu, uintptr_t fcn) { vFillill_t fn = (vFillill_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9); } -void vFipiplp(x64emu_t *emu, uintptr_t fcn) { vFipiplp_t fn = (vFipiplp_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9); } -void vFCCCCff(x64emu_t *emu, uintptr_t fcn) { vFCCCCff_t fn = (vFCCCCff_t)fcn; fn((uint8_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void vFuiiiii(x64emu_t *emu, uintptr_t fcn) { vFuiiiii_t fn = (vFuiiiii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFuiiiip(x64emu_t *emu, uintptr_t fcn) { vFuiiiip_t fn = (vFuiiiip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFuiiuii(x64emu_t *emu, uintptr_t fcn) { vFuiiuii_t fn = (vFuiiuii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFuiiuup(x64emu_t *emu, uintptr_t fcn) { vFuiiuup_t fn = (vFuiiuup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void vFuiuiii(x64emu_t *emu, uintptr_t fcn) { vFuiuiii_t fn = (vFuiuiii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFuiuiiC(x64emu_t *emu, uintptr_t fcn) { vFuiuiiC_t fn = (vFuiuiiC_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint8_t)R_R9); } -void vFuiuiil(x64emu_t *emu, uintptr_t fcn) { vFuiuiil_t fn = (vFuiuiil_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9); } -void vFuiuiip(x64emu_t *emu, uintptr_t fcn) { vFuiuiip_t fn = (vFuiuiip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFuiuiuu(x64emu_t *emu, uintptr_t fcn) { vFuiuiuu_t fn = (vFuiuiuu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void vFuiuiuL(x64emu_t *emu, uintptr_t fcn) { vFuiuiuL_t fn = (vFuiuiuL_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uintptr_t)R_R9); } -void vFuiuCip(x64emu_t *emu, uintptr_t fcn) { vFuiuCip_t fn = (vFuiuCip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFuiuuip(x64emu_t *emu, uintptr_t fcn) { vFuiuuip_t fn = (vFuiuuip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFuiuuuu(x64emu_t *emu, uintptr_t fcn) { vFuiuuuu_t fn = (vFuiuuuu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void vFuiupii(x64emu_t *emu, uintptr_t fcn) { vFuiupii_t fn = (vFuiupii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFuiupiu(x64emu_t *emu, uintptr_t fcn) { vFuiupiu_t fn = (vFuiupiu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); } -void vFuiffff(x64emu_t *emu, uintptr_t fcn) { vFuiffff_t fn = (vFuiffff_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); } -void vFuidddd(x64emu_t *emu, uintptr_t fcn) { vFuidddd_t fn = (vFuidddd_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void vFuillll(x64emu_t *emu, uintptr_t fcn) { vFuillll_t fn = (vFuillll_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9); } -void vFuiLLLL(x64emu_t *emu, uintptr_t fcn) { vFuiLLLL_t fn = (vFuiLLLL_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9); } -void vFuipiup(x64emu_t *emu, uintptr_t fcn) { vFuipiup_t fn = (vFuipiup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void vFuCuuip(x64emu_t *emu, uintptr_t fcn) { vFuCuuip_t fn = (vFuCuuip_t)fcn; fn((uint32_t)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFuuiiii(x64emu_t *emu, uintptr_t fcn) { vFuuiiii_t fn = (vFuuiiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFuuiiiu(x64emu_t *emu, uintptr_t fcn) { vFuuiiiu_t fn = (vFuuiiiu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); } -void vFuuiuii(x64emu_t *emu, uintptr_t fcn) { vFuuiuii_t fn = (vFuuiuii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFuuiuil(x64emu_t *emu, uintptr_t fcn) { vFuuiuil_t fn = (vFuuiuil_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9); } -void vFuuiuip(x64emu_t *emu, uintptr_t fcn) { vFuuiuip_t fn = (vFuuiuip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFuuiuCu(x64emu_t *emu, uintptr_t fcn) { vFuuiuCu_t fn = (vFuuiuCu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint8_t)R_R8, (uint32_t)R_R9); } -void vFuuiuup(x64emu_t *emu, uintptr_t fcn) { vFuuiuup_t fn = (vFuuiuup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void vFuuippp(x64emu_t *emu, uintptr_t fcn) { vFuuippp_t fn = (vFuuippp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFuuuiii(x64emu_t *emu, uintptr_t fcn) { vFuuuiii_t fn = (vFuuuiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFuuuiup(x64emu_t *emu, uintptr_t fcn) { vFuuuiup_t fn = (vFuuuiup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void vFuuuipi(x64emu_t *emu, uintptr_t fcn) { vFuuuipi_t fn = (vFuuuipi_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void vFuuuipC(x64emu_t *emu, uintptr_t fcn) { vFuuuipC_t fn = (vFuuuipC_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint8_t)R_R9); } -void vFuuuipp(x64emu_t *emu, uintptr_t fcn) { vFuuuipp_t fn = (vFuuuipp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFuuuuii(x64emu_t *emu, uintptr_t fcn) { vFuuuuii_t fn = (vFuuuuii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFuuuuip(x64emu_t *emu, uintptr_t fcn) { vFuuuuip_t fn = (vFuuuuip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFuuuuuu_t fn = (vFuuuuuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void vFuuuull(x64emu_t *emu, uintptr_t fcn) { vFuuuull_t fn = (vFuuuull_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9); } -void vFuuuppi(x64emu_t *emu, uintptr_t fcn) { vFuuuppi_t fn = (vFuuuppi_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void vFuuuppp(x64emu_t *emu, uintptr_t fcn) { vFuuuppp_t fn = (vFuuuppp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFuuffff(x64emu_t *emu, uintptr_t fcn) { vFuuffff_t fn = (vFuuffff_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); } -void vFuudddd(x64emu_t *emu, uintptr_t fcn) { vFuudddd_t fn = (vFuudddd_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void vFuupiii(x64emu_t *emu, uintptr_t fcn) { vFuupiii_t fn = (vFuupiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFuupupp(x64emu_t *emu, uintptr_t fcn) { vFuupupp_t fn = (vFuupupp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFuuplii(x64emu_t *emu, uintptr_t fcn) { vFuuplii_t fn = (vFuuplii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFuffiip(x64emu_t *emu, uintptr_t fcn) { vFuffiip_t fn = (vFuffiip_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void vFufffff(x64emu_t *emu, uintptr_t fcn) { vFufffff_t fn = (vFufffff_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0]); } -void vFuddiip(x64emu_t *emu, uintptr_t fcn) { vFuddiip_t fn = (vFuddiip_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void vFullill(x64emu_t *emu, uintptr_t fcn) { vFullill_t fn = (vFullill_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9); } -void vFulluLC(x64emu_t *emu, uintptr_t fcn) { vFulluLC_t fn = (vFulluLC_t)fcn; fn((uint32_t)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (uint8_t)R_R9); } -void vFupiiii(x64emu_t *emu, uintptr_t fcn) { vFupiiii_t fn = (vFupiiii_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFupupip(x64emu_t *emu, uintptr_t fcn) { vFupupip_t fn = (vFupupip_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFuppppu(x64emu_t *emu, uintptr_t fcn) { vFuppppu_t fn = (vFuppppu_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void vFuppppp(x64emu_t *emu, uintptr_t fcn) { vFuppppp_t fn = (vFuppppp_t)fcn; fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFUUpppp(x64emu_t *emu, uintptr_t fcn) { vFUUpppp_t fn = (vFUUpppp_t)fcn; fn((uint64_t)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFffffff(x64emu_t *emu, uintptr_t fcn) { vFffffff_t fn = (vFffffff_t)fcn; fn(emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0]); } -void vFdddddd(x64emu_t *emu, uintptr_t fcn) { vFdddddd_t fn = (vFdddddd_t)fcn; fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); } -void vFdddppp(x64emu_t *emu, uintptr_t fcn) { vFdddppp_t fn = (vFdddppp_t)fcn; fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void vFpiiiii(x64emu_t *emu, uintptr_t fcn) { vFpiiiii_t fn = (vFpiiiii_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFpiiipp(x64emu_t *emu, uintptr_t fcn) { vFpiiipp_t fn = (vFpiiipp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFpiiuuu(x64emu_t *emu, uintptr_t fcn) { vFpiiuuu_t fn = (vFpiiuuu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void vFpiippi(x64emu_t *emu, uintptr_t fcn) { vFpiippi_t fn = (vFpiippi_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void vFpiippp(x64emu_t *emu, uintptr_t fcn) { vFpiippp_t fn = (vFpiippp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFpiUuup(x64emu_t *emu, uintptr_t fcn) { vFpiUuup_t fn = (vFpiUuup_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void vFpipipp(x64emu_t *emu, uintptr_t fcn) { vFpipipp_t fn = (vFpipipp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFpipipV(x64emu_t *emu, uintptr_t fcn) { vFpipipV_t fn = (vFpipipV_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)(R_RSP + 8)); } -void vFpipppi(x64emu_t *emu, uintptr_t fcn) { vFpipppi_t fn = (vFpipppi_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void vFpipppp(x64emu_t *emu, uintptr_t fcn) { vFpipppp_t fn = (vFpipppp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFpuiiii(x64emu_t *emu, uintptr_t fcn) { vFpuiiii_t fn = (vFpuiiii_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFpuiiiu(x64emu_t *emu, uintptr_t fcn) { vFpuiiiu_t fn = (vFpuiiiu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); } -void vFpuiipp(x64emu_t *emu, uintptr_t fcn) { vFpuiipp_t fn = (vFpuiipp_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFpuuuiu(x64emu_t *emu, uintptr_t fcn) { vFpuuuiu_t fn = (vFpuuuiu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); } -void vFpuuuup(x64emu_t *emu, uintptr_t fcn) { vFpuuuup_t fn = (vFpuuuup_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void vFpuuupp(x64emu_t *emu, uintptr_t fcn) { vFpuuupp_t fn = (vFpuuupp_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFpuupuu(x64emu_t *emu, uintptr_t fcn) { vFpuupuu_t fn = (vFpuupuu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void vFpuuppp(x64emu_t *emu, uintptr_t fcn) { vFpuuppp_t fn = (vFpuuppp_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFpudddd(x64emu_t *emu, uintptr_t fcn) { vFpudddd_t fn = (vFpudddd_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void vFpupiUu(x64emu_t *emu, uintptr_t fcn) { vFpupiUu_t fn = (vFpupiUu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint64_t)R_R8, (uint32_t)R_R9); } -void vFpupuuu(x64emu_t *emu, uintptr_t fcn) { vFpupuuu_t fn = (vFpupuuu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void vFpupupu(x64emu_t *emu, uintptr_t fcn) { vFpupupu_t fn = (vFpupupu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void vFpuppuu(x64emu_t *emu, uintptr_t fcn) { vFpuppuu_t fn = (vFpuppuu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void vFpupppp(x64emu_t *emu, uintptr_t fcn) { vFpupppp_t fn = (vFpupppp_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFpUiUup(x64emu_t *emu, uintptr_t fcn) { vFpUiUup_t fn = (vFpUiUup_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void vFpUipup(x64emu_t *emu, uintptr_t fcn) { vFpUipup_t fn = (vFpUipup_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void vFpUuuup(x64emu_t *emu, uintptr_t fcn) { vFpUuuup_t fn = (vFpUuuup_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void vFpUUiup(x64emu_t *emu, uintptr_t fcn) { vFpUUiup_t fn = (vFpUUiup_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void vFpdddii(x64emu_t *emu, uintptr_t fcn) { vFpdddii_t fn = (vFpdddii_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], (int32_t)R_RSI, (int32_t)R_RDX); } -void vFpddddd(x64emu_t *emu, uintptr_t fcn) { vFpddddd_t fn = (vFpddddd_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0]); } -void vFpddddp(x64emu_t *emu, uintptr_t fcn) { vFpddddp_t fn = (vFpddddp_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], (void*)R_RSI); } -void vFppiiii(x64emu_t *emu, uintptr_t fcn) { vFppiiii_t fn = (vFppiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFppiiip(x64emu_t *emu, uintptr_t fcn) { vFppiiip_t fn = (vFppiiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFppiiuu(x64emu_t *emu, uintptr_t fcn) { vFppiiuu_t fn = (vFppiiuu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void vFppiipi(x64emu_t *emu, uintptr_t fcn) { vFppiipi_t fn = (vFppiipi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void vFppiipp(x64emu_t *emu, uintptr_t fcn) { vFppiipp_t fn = (vFppiipp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFppilpp(x64emu_t *emu, uintptr_t fcn) { vFppilpp_t fn = (vFppilpp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFppipLp(x64emu_t *emu, uintptr_t fcn) { vFppipLp_t fn = (vFppipLp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); } -void vFppippi(x64emu_t *emu, uintptr_t fcn) { vFppippi_t fn = (vFppippi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void vFppippp(x64emu_t *emu, uintptr_t fcn) { vFppippp_t fn = (vFppippp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFppuiii(x64emu_t *emu, uintptr_t fcn) { vFppuiii_t fn = (vFppuiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFppuiiu(x64emu_t *emu, uintptr_t fcn) { vFppuiiu_t fn = (vFppuiiu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); } -void vFppuiip(x64emu_t *emu, uintptr_t fcn) { vFppuiip_t fn = (vFppuiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFppuuuu(x64emu_t *emu, uintptr_t fcn) { vFppuuuu_t fn = (vFppuuuu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void vFppuUUU(x64emu_t *emu, uintptr_t fcn) { vFppuUUU_t fn = (vFppuUUU_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (uint64_t)R_R9); } -void vFppupii(x64emu_t *emu, uintptr_t fcn) { vFppupii_t fn = (vFppupii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFppuppp(x64emu_t *emu, uintptr_t fcn) { vFppuppp_t fn = (vFppuppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFppffff(x64emu_t *emu, uintptr_t fcn) { vFppffff_t fn = (vFppffff_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); } -void vFppdidd(x64emu_t *emu, uintptr_t fcn) { vFppdidd_t fn = (vFppdidd_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], (int32_t)R_RDX, emu->xmm[1].d[0], emu->xmm[2].d[0]); } -void vFppdddd(x64emu_t *emu, uintptr_t fcn) { vFppdddd_t fn = (vFppdddd_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void vFpplppi(x64emu_t *emu, uintptr_t fcn) { vFpplppi_t fn = (vFpplppi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void vFpplppp(x64emu_t *emu, uintptr_t fcn) { vFpplppp_t fn = (vFpplppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFppLppi(x64emu_t *emu, uintptr_t fcn) { vFppLppi_t fn = (vFppLppi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void vFppLppp(x64emu_t *emu, uintptr_t fcn) { vFppLppp_t fn = (vFppLppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFpppiii(x64emu_t *emu, uintptr_t fcn) { vFpppiii_t fn = (vFpppiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFpppiip(x64emu_t *emu, uintptr_t fcn) { vFpppiip_t fn = (vFpppiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFpppiui(x64emu_t *emu, uintptr_t fcn) { vFpppiui_t fn = (vFpppiui_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); } -void vFpppiff(x64emu_t *emu, uintptr_t fcn) { vFpppiff_t fn = (vFpppiff_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, emu->xmm[0].f[0], emu->xmm[1].f[0]); } -void vFpppipu(x64emu_t *emu, uintptr_t fcn) { vFpppipu_t fn = (vFpppipu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void vFpppuii(x64emu_t *emu, uintptr_t fcn) { vFpppuii_t fn = (vFpppuii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFpppuuu(x64emu_t *emu, uintptr_t fcn) { vFpppuuu_t fn = (vFpppuuu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void vFppppii(x64emu_t *emu, uintptr_t fcn) { vFppppii_t fn = (vFppppii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void vFpppppi(x64emu_t *emu, uintptr_t fcn) { vFpppppi_t fn = (vFpppppi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void vFpppppu(x64emu_t *emu, uintptr_t fcn) { vFpppppu_t fn = (vFpppppu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void vFpppppU(x64emu_t *emu, uintptr_t fcn) { vFpppppU_t fn = (vFpppppU_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint64_t)R_R9); } -void vFpppppL(x64emu_t *emu, uintptr_t fcn) { vFpppppL_t fn = (vFpppppL_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); } -void vFpppppp(x64emu_t *emu, uintptr_t fcn) { vFpppppp_t fn = (vFpppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void cFppLppi(x64emu_t *emu, uintptr_t fcn) { cFppLppi_t fn = (cFppLppi_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void iFEiippi(x64emu_t *emu, uintptr_t fcn) { iFEiippi_t fn = (iFEiippi_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFEiippp(x64emu_t *emu, uintptr_t fcn) { iFEiippp_t fn = (iFEiippp_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFEiLLLL(x64emu_t *emu, uintptr_t fcn) { iFEiLLLL_t fn = (iFEiLLLL_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); } -void iFEippLp(x64emu_t *emu, uintptr_t fcn) { iFEippLp_t fn = (iFEippLp_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); } -void iFElpppp(x64emu_t *emu, uintptr_t fcn) { iFElpppp_t fn = (iFElpppp_t)fcn; R_RAX=(int32_t)fn(emu, (intptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFEpiipp(x64emu_t *emu, uintptr_t fcn) { iFEpiipp_t fn = (iFEpiipp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFEpiipV(x64emu_t *emu, uintptr_t fcn) { iFEpiipV_t fn = (iFEpiipV_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)(R_RSP + 8)); } -void iFEpilpV(x64emu_t *emu, uintptr_t fcn) { iFEpilpV_t fn = (iFEpilpV_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)(R_RSP + 8)); } -void iFEpippi(x64emu_t *emu, uintptr_t fcn) { iFEpippi_t fn = (iFEpippi_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFEpIppp(x64emu_t *emu, uintptr_t fcn) { iFEpIppp_t fn = (iFEpIppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int64_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFEpuppp(x64emu_t *emu, uintptr_t fcn) { iFEpuppp_t fn = (iFEpuppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFEpUppp(x64emu_t *emu, uintptr_t fcn) { iFEpUppp_t fn = (iFEpUppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint64_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFEppppi(x64emu_t *emu, uintptr_t fcn) { iFEppppi_t fn = (iFEppppi_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void iFEppppp(x64emu_t *emu, uintptr_t fcn) { iFEppppp_t fn = (iFEppppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFiiiiip(x64emu_t *emu, uintptr_t fcn) { iFiiiiip_t fn = (iFiiiiip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void iFiiiipp(x64emu_t *emu, uintptr_t fcn) { iFiiiipp_t fn = (iFiiiipp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFiiiuwp(x64emu_t *emu, uintptr_t fcn) { iFiiiuwp_t fn = (iFiiiuwp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int16_t)R_R8, (void*)R_R9); } -void iFiWiipi(x64emu_t *emu, uintptr_t fcn) { iFiWiipi_t fn = (iFiWiipi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void iFiuUuUu(x64emu_t *emu, uintptr_t fcn) { iFiuUuUu_t fn = (iFiuUuUu_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (uint64_t)R_R8, (uint32_t)R_R9); } -void iFilpppp(x64emu_t *emu, uintptr_t fcn) { iFilpppp_t fn = (iFilpppp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFiLpppi(x64emu_t *emu, uintptr_t fcn) { iFiLpppi_t fn = (iFiLpppi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void iFipiipi(x64emu_t *emu, uintptr_t fcn) { iFipiipi_t fn = (iFipiipi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void iFipipip(x64emu_t *emu, uintptr_t fcn) { iFipipip_t fn = (iFipipip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void iFipippp(x64emu_t *emu, uintptr_t fcn) { iFipippp_t fn = (iFipippp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFipuIup(x64emu_t *emu, uintptr_t fcn) { iFipuIup_t fn = (iFipuIup_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int64_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void iFipupup(x64emu_t *emu, uintptr_t fcn) { iFipupup_t fn = (iFipupup_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void iFipuppp(x64emu_t *emu, uintptr_t fcn) { iFipuppp_t fn = (iFipuppp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFipppLp(x64emu_t *emu, uintptr_t fcn) { iFipppLp_t fn = (iFipppLp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); } -void iFippppp(x64emu_t *emu, uintptr_t fcn) { iFippppp_t fn = (iFippppp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFdipppL(x64emu_t *emu, uintptr_t fcn) { iFdipppL_t fn = (iFdipppL_t)fcn; R_RAX=(int32_t)fn(emu->xmm[0].d[0], (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void iFDipppL(x64emu_t *emu, uintptr_t fcn) { iFDipppL_t fn = (iFDipppL_t)fcn; R_RAX=(int32_t)fn(LD2localLD((void*)(R_RSP + 8)), (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8); } -void iFlpippp(x64emu_t *emu, uintptr_t fcn) { iFlpippp_t fn = (iFlpippp_t)fcn; R_RAX=(int32_t)fn((intptr_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFLpppii(x64emu_t *emu, uintptr_t fcn) { iFLpppii_t fn = (iFLpppii_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void iFpiiiii(x64emu_t *emu, uintptr_t fcn) { iFpiiiii_t fn = (iFpiiiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void iFpiiiiu(x64emu_t *emu, uintptr_t fcn) { iFpiiiiu_t fn = (iFpiiiiu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); } -void iFpiiiip(x64emu_t *emu, uintptr_t fcn) { iFpiiiip_t fn = (iFpiiiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void iFpiiipp(x64emu_t *emu, uintptr_t fcn) { iFpiiipp_t fn = (iFpiiipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpiiuii(x64emu_t *emu, uintptr_t fcn) { iFpiiuii_t fn = (iFpiiuii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void iFpiiuui(x64emu_t *emu, uintptr_t fcn) { iFpiiuui_t fn = (iFpiiuui_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); } -void iFpiiupp(x64emu_t *emu, uintptr_t fcn) { iFpiiupp_t fn = (iFpiiupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpiipip(x64emu_t *emu, uintptr_t fcn) { iFpiipip_t fn = (iFpiipip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void iFpiippp(x64emu_t *emu, uintptr_t fcn) { iFpiippp_t fn = (iFpiippp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpiCCpu(x64emu_t *emu, uintptr_t fcn) { iFpiCCpu_t fn = (iFpiCCpu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void iFpiuuup(x64emu_t *emu, uintptr_t fcn) { iFpiuuup_t fn = (iFpiuuup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void iFpiuupp(x64emu_t *emu, uintptr_t fcn) { iFpiuupp_t fn = (iFpiuupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpipiii(x64emu_t *emu, uintptr_t fcn) { iFpipiii_t fn = (iFpipiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void iFpipipi(x64emu_t *emu, uintptr_t fcn) { iFpipipi_t fn = (iFpipipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void iFpipipp(x64emu_t *emu, uintptr_t fcn) { iFpipipp_t fn = (iFpipipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpipupp(x64emu_t *emu, uintptr_t fcn) { iFpipupp_t fn = (iFpipupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpipLpp(x64emu_t *emu, uintptr_t fcn) { iFpipLpp_t fn = (iFpipLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpippip(x64emu_t *emu, uintptr_t fcn) { iFpippip_t fn = (iFpippip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void iFpippup(x64emu_t *emu, uintptr_t fcn) { iFpippup_t fn = (iFpippup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void iFpipppp(x64emu_t *emu, uintptr_t fcn) { iFpipppp_t fn = (iFpipppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpCiipp(x64emu_t *emu, uintptr_t fcn) { iFpCiipp_t fn = (iFpCiipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpCpipu(x64emu_t *emu, uintptr_t fcn) { iFpCpipu_t fn = (iFpCpipu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void iFpWipip(x64emu_t *emu, uintptr_t fcn) { iFpWipip_t fn = (iFpWipip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void iFpWpppp(x64emu_t *emu, uintptr_t fcn) { iFpWpppp_t fn = (iFpWpppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpuiCpp(x64emu_t *emu, uintptr_t fcn) { iFpuiCpp_t fn = (iFpuiCpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpuippp(x64emu_t *emu, uintptr_t fcn) { iFpuippp_t fn = (iFpuippp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpuuuuu(x64emu_t *emu, uintptr_t fcn) { iFpuuuuu_t fn = (iFpuuuuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void iFpuuuup(x64emu_t *emu, uintptr_t fcn) { iFpuuuup_t fn = (iFpuuuup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void iFpuuupu(x64emu_t *emu, uintptr_t fcn) { iFpuuupu_t fn = (iFpuuupu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void iFpuuupp(x64emu_t *emu, uintptr_t fcn) { iFpuuupp_t fn = (iFpuuupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpuuLpp(x64emu_t *emu, uintptr_t fcn) { iFpuuLpp_t fn = (iFpuuLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpuupuu(x64emu_t *emu, uintptr_t fcn) { iFpuupuu_t fn = (iFpuupuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void iFpuuppp(x64emu_t *emu, uintptr_t fcn) { iFpuuppp_t fn = (iFpuuppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpuLLpp(x64emu_t *emu, uintptr_t fcn) { iFpuLLpp_t fn = (iFpuLLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpupuui(x64emu_t *emu, uintptr_t fcn) { iFpupuui_t fn = (iFpupuui_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); } -void iFpupLpL(x64emu_t *emu, uintptr_t fcn) { iFpupLpL_t fn = (iFpupLpL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9); } -void iFpupLpp(x64emu_t *emu, uintptr_t fcn) { iFpupLpp_t fn = (iFpupLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpUiipp(x64emu_t *emu, uintptr_t fcn) { iFpUiipp_t fn = (iFpUiipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpUuuLp(x64emu_t *emu, uintptr_t fcn) { iFpUuuLp_t fn = (iFpUuuLp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9); } -void iFpUUUup(x64emu_t *emu, uintptr_t fcn) { iFpUUUup_t fn = (iFpUUUup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void iFpUUUUp(x64emu_t *emu, uintptr_t fcn) { iFpUUUUp_t fn = (iFpUUUUp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (void*)R_R9); } -void iFpdpipp(x64emu_t *emu, uintptr_t fcn) { iFpdpipp_t fn = (iFpdpipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, emu->xmm[0].d[0], (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void iFpLiiiL(x64emu_t *emu, uintptr_t fcn) { iFpLiiiL_t fn = (iFpLiiiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9); } -void iFpLiiip(x64emu_t *emu, uintptr_t fcn) { iFpLiiip_t fn = (iFpLiiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void iFpLiiuu(x64emu_t *emu, uintptr_t fcn) { iFpLiiuu_t fn = (iFpLiiuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void iFpLipLu(x64emu_t *emu, uintptr_t fcn) { iFpLipLu_t fn = (iFpLipLu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9); } -void iFpLuipp(x64emu_t *emu, uintptr_t fcn) { iFpLuipp_t fn = (iFpLuipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpLuupp(x64emu_t *emu, uintptr_t fcn) { iFpLuupp_t fn = (iFpLuupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpLupip(x64emu_t *emu, uintptr_t fcn) { iFpLupip_t fn = (iFpLupip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void iFpLLLLL(x64emu_t *emu, uintptr_t fcn) { iFpLLLLL_t fn = (iFpLLLLL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9); } -void iFpLLppp(x64emu_t *emu, uintptr_t fcn) { iFpLLppp_t fn = (iFpLLppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpLpipi(x64emu_t *emu, uintptr_t fcn) { iFpLpipi_t fn = (iFpLpipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void iFpLppii(x64emu_t *emu, uintptr_t fcn) { iFpLppii_t fn = (iFpLppii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void iFpLpppL(x64emu_t *emu, uintptr_t fcn) { iFpLpppL_t fn = (iFpLpppL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); } -void iFpLpppp(x64emu_t *emu, uintptr_t fcn) { iFpLpppp_t fn = (iFpLpppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFppiiii(x64emu_t *emu, uintptr_t fcn) { iFppiiii_t fn = (iFppiiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void iFppiiip(x64emu_t *emu, uintptr_t fcn) { iFppiiip_t fn = (iFppiiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void iFppiipi(x64emu_t *emu, uintptr_t fcn) { iFppiipi_t fn = (iFppiipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void iFppiipp(x64emu_t *emu, uintptr_t fcn) { iFppiipp_t fn = (iFppiipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFppiupp(x64emu_t *emu, uintptr_t fcn) { iFppiupp_t fn = (iFppiupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFppilpp(x64emu_t *emu, uintptr_t fcn) { iFppilpp_t fn = (iFppilpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFppipii(x64emu_t *emu, uintptr_t fcn) { iFppipii_t fn = (iFppipii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void iFppipiL(x64emu_t *emu, uintptr_t fcn) { iFppipiL_t fn = (iFppipiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9); } -void iFppipip(x64emu_t *emu, uintptr_t fcn) { iFppipip_t fn = (iFppipip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void iFppippi(x64emu_t *emu, uintptr_t fcn) { iFppippi_t fn = (iFppippi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void iFppippu(x64emu_t *emu, uintptr_t fcn) { iFppippu_t fn = (iFppippu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void iFppippp(x64emu_t *emu, uintptr_t fcn) { iFppippp_t fn = (iFppippp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFppIppp(x64emu_t *emu, uintptr_t fcn) { iFppIppp_t fn = (iFppIppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFppuiii(x64emu_t *emu, uintptr_t fcn) { iFppuiii_t fn = (iFppuiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void iFppuIII(x64emu_t *emu, uintptr_t fcn) { iFppuIII_t fn = (iFppuIII_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8, (int64_t)R_R9); } -void iFppuupp(x64emu_t *emu, uintptr_t fcn) { iFppuupp_t fn = (iFppuupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFppuLpp(x64emu_t *emu, uintptr_t fcn) { iFppuLpp_t fn = (iFppuLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFppupip(x64emu_t *emu, uintptr_t fcn) { iFppupip_t fn = (iFppupip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void iFppuppp(x64emu_t *emu, uintptr_t fcn) { iFppuppp_t fn = (iFppuppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFppdidd(x64emu_t *emu, uintptr_t fcn) { iFppdidd_t fn = (iFppdidd_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], (int32_t)R_RDX, emu->xmm[1].d[0], emu->xmm[2].d[0]); } -void iFpplupp(x64emu_t *emu, uintptr_t fcn) { iFpplupp_t fn = (iFpplupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpplppi(x64emu_t *emu, uintptr_t fcn) { iFpplppi_t fn = (iFpplppi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void iFppLupp(x64emu_t *emu, uintptr_t fcn) { iFppLupp_t fn = (iFppLupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFppLLiL(x64emu_t *emu, uintptr_t fcn) { iFppLLiL_t fn = (iFppLLiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9); } -void iFppLLup(x64emu_t *emu, uintptr_t fcn) { iFppLLup_t fn = (iFppLLup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void iFppLLpp(x64emu_t *emu, uintptr_t fcn) { iFppLLpp_t fn = (iFppLLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFppLpLp(x64emu_t *emu, uintptr_t fcn) { iFppLpLp_t fn = (iFppLpLp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); } -void iFppLppp(x64emu_t *emu, uintptr_t fcn) { iFppLppp_t fn = (iFppLppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpppiuu(x64emu_t *emu, uintptr_t fcn) { iFpppiuu_t fn = (iFpppiuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void iFpppipi(x64emu_t *emu, uintptr_t fcn) { iFpppipi_t fn = (iFpppipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void iFpppipu(x64emu_t *emu, uintptr_t fcn) { iFpppipu_t fn = (iFpppipu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void iFpppipp(x64emu_t *emu, uintptr_t fcn) { iFpppipp_t fn = (iFpppipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpppuii(x64emu_t *emu, uintptr_t fcn) { iFpppuii_t fn = (iFpppuii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void iFpppuup(x64emu_t *emu, uintptr_t fcn) { iFpppuup_t fn = (iFpppuup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void iFpppupu(x64emu_t *emu, uintptr_t fcn) { iFpppupu_t fn = (iFpppupu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void iFpppupp(x64emu_t *emu, uintptr_t fcn) { iFpppupp_t fn = (iFpppupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpppLpp(x64emu_t *emu, uintptr_t fcn) { iFpppLpp_t fn = (iFpppLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFppppii(x64emu_t *emu, uintptr_t fcn) { iFppppii_t fn = (iFppppii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void iFppppiu(x64emu_t *emu, uintptr_t fcn) { iFppppiu_t fn = (iFppppiu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); } -void iFppppip(x64emu_t *emu, uintptr_t fcn) { iFppppip_t fn = (iFppppip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void iFppppup(x64emu_t *emu, uintptr_t fcn) { iFppppup_t fn = (iFppppup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void iFppppLp(x64emu_t *emu, uintptr_t fcn) { iFppppLp_t fn = (iFppppLp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9); } -void iFpppppi(x64emu_t *emu, uintptr_t fcn) { iFpppppi_t fn = (iFpppppi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void iFpppppL(x64emu_t *emu, uintptr_t fcn) { iFpppppL_t fn = (iFpppppL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); } -void iFpppppp(x64emu_t *emu, uintptr_t fcn) { iFpppppp_t fn = (iFpppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFEiippp(x64emu_t *emu, uintptr_t fcn) { uFEiippp_t fn = (uFEiippp_t)fcn; R_RAX=(uint32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFEiuppp(x64emu_t *emu, uintptr_t fcn) { uFEiuppp_t fn = (uFEiuppp_t)fcn; R_RAX=(uint32_t)fn(emu, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFEpippp(x64emu_t *emu, uintptr_t fcn) { uFEpippp_t fn = (uFEpippp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFEpCppp(x64emu_t *emu, uintptr_t fcn) { uFEpCppp_t fn = (uFEpCppp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (uint8_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFEpuppp(x64emu_t *emu, uintptr_t fcn) { uFEpuppp_t fn = (uFEpuppp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void uFuuuuuu(x64emu_t *emu, uintptr_t fcn) { uFuuuuuu_t fn = (uFuuuuuu_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void uFupuufp(x64emu_t *emu, uintptr_t fcn) { uFupuufp_t fn = (uFupuufp_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, emu->xmm[0].f[0], (void*)R_R8); } -void uFuppppp(x64emu_t *emu, uintptr_t fcn) { uFuppppp_t fn = (uFuppppp_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFpiuppu(x64emu_t *emu, uintptr_t fcn) { uFpiuppu_t fn = (uFpiuppu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void uFpWuipp(x64emu_t *emu, uintptr_t fcn) { uFpWuipp_t fn = (uFpWuipp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFpWuuCp(x64emu_t *emu, uintptr_t fcn) { uFpWuuCp_t fn = (uFpWuuCp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint8_t)R_R8, (void*)R_R9); } -void uFpuippp(x64emu_t *emu, uintptr_t fcn) { uFpuippp_t fn = (uFpuippp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFpuuuup(x64emu_t *emu, uintptr_t fcn) { uFpuuuup_t fn = (uFpuuuup_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void uFpuuupp(x64emu_t *emu, uintptr_t fcn) { uFpuuupp_t fn = (uFpuuupp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFpuuppp(x64emu_t *emu, uintptr_t fcn) { uFpuuppp_t fn = (uFpuuppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFpupupu(x64emu_t *emu, uintptr_t fcn) { uFpupupu_t fn = (uFpupupu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void uFpupppp(x64emu_t *emu, uintptr_t fcn) { uFpupppp_t fn = (uFpupppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFppippp(x64emu_t *emu, uintptr_t fcn) { uFppippp_t fn = (uFppippp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFppuuup(x64emu_t *emu, uintptr_t fcn) { uFppuuup_t fn = (uFppuuup_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void uFppuupu(x64emu_t *emu, uintptr_t fcn) { uFppuupu_t fn = (uFppuupu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void uFppLppL(x64emu_t *emu, uintptr_t fcn) { uFppLppL_t fn = (uFppLppL_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); } -void uFpppppi(x64emu_t *emu, uintptr_t fcn) { uFpppppi_t fn = (uFpppppi_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void uFpppppp(x64emu_t *emu, uintptr_t fcn) { uFpppppp_t fn = (uFpppppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFbippup(x64emu_t *emu, uintptr_t fcn) { uFbippup_t fn = (uFbippup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbCuuWW(x64emu_t *emu, uintptr_t fcn) { uFbCuuWW_t fn = (uFbCuuWW_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint16_t)R_R8, (uint16_t)R_R9); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuuiup(x64emu_t *emu, uintptr_t fcn) { uFbuuiup_t fn = (uFbuuiup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void UFbippup(x64emu_t *emu, uintptr_t fcn) { UFbippup_t fn = (UFbippup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=fn(aligned_xcb, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void lFEpippp(x64emu_t *emu, uintptr_t fcn) { lFEpippp_t fn = (lFEpippp_t)fcn; R_RAX=(intptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void lFipipLu(x64emu_t *emu, uintptr_t fcn) { lFipipLu_t fn = (lFipipLu_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9); } -void lFipLipu(x64emu_t *emu, uintptr_t fcn) { lFipLipu_t fn = (lFipLipu_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void lFipLipp(x64emu_t *emu, uintptr_t fcn) { lFipLipp_t fn = (lFipLipp_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void lFipLpLL(x64emu_t *emu, uintptr_t fcn) { lFipLpLL_t fn = (lFipLpLL_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9); } -void lFpipill(x64emu_t *emu, uintptr_t fcn) { lFpipill_t fn = (lFpipill_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9); } -void lFpuuLLp(x64emu_t *emu, uintptr_t fcn) { lFpuuLLp_t fn = (lFpuuLLp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9); } -void lFpplllp(x64emu_t *emu, uintptr_t fcn) { lFpplllp_t fn = (lFpplllp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (void*)R_R9); } -void lFppLipp(x64emu_t *emu, uintptr_t fcn) { lFppLipp_t fn = (lFppLipp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void lFpppLpp(x64emu_t *emu, uintptr_t fcn) { lFpppLpp_t fn = (lFpppLpp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void LFEupppp(x64emu_t *emu, uintptr_t fcn) { LFEupppp_t fn = (LFEupppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void LFELpppi(x64emu_t *emu, uintptr_t fcn) { LFELpppi_t fn = (LFELpppi_t)fcn; R_RAX=(uintptr_t)fn(emu, (uintptr_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void LFEpippp(x64emu_t *emu, uintptr_t fcn) { LFEpippp_t fn = (LFEpippp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void LFEppppi(x64emu_t *emu, uintptr_t fcn) { LFEppppi_t fn = (LFEppppi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void LFpipipi(x64emu_t *emu, uintptr_t fcn) { LFpipipi_t fn = (LFpipipi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void LFpLippp(x64emu_t *emu, uintptr_t fcn) { LFpLippp_t fn = (LFpLippp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void LFpLLLLL(x64emu_t *emu, uintptr_t fcn) { LFpLLLLL_t fn = (LFpLLLLL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9); } -void LFppLLpL(x64emu_t *emu, uintptr_t fcn) { LFppLLpL_t fn = (LFppLLpL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9); } -void LFppLpLL(x64emu_t *emu, uintptr_t fcn) { LFppLpLL_t fn = (LFppLpLL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9); } -void LFSpLiip(x64emu_t *emu, uintptr_t fcn) { LFSpLiip_t fn = (LFSpLiip_t)fcn; R_RAX=(uintptr_t)fn(io_convert((void*)R_RDI), (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void pFEpiupp(x64emu_t *emu, uintptr_t fcn) { pFEpiupp_t fn = (pFEpiupp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFEpippp(x64emu_t *emu, uintptr_t fcn) { pFEpippp_t fn = (pFEpippp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFEpuipp(x64emu_t *emu, uintptr_t fcn) { pFEpuipp_t fn = (pFEpuipp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFEpuupp(x64emu_t *emu, uintptr_t fcn) { pFEpuupp_t fn = (pFEpuupp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFEpuppp(x64emu_t *emu, uintptr_t fcn) { pFEpuppp_t fn = (pFEpuppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFEpLLiN(x64emu_t *emu, uintptr_t fcn) { pFEpLLiN_t fn = (pFEpLLiN_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void pFEppupi(x64emu_t *emu, uintptr_t fcn) { pFEppupi_t fn = (pFEppupi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void pFEppLLp(x64emu_t *emu, uintptr_t fcn) { pFEppLLp_t fn = (pFEppLLp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); } -void pFEpppLp(x64emu_t *emu, uintptr_t fcn) { pFEpppLp_t fn = (pFEpppLp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8); } -void pFEppppi(x64emu_t *emu, uintptr_t fcn) { pFEppppi_t fn = (pFEppppi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } -void pFEppppp(x64emu_t *emu, uintptr_t fcn) { pFEppppp_t fn = (pFEppppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFEppppV(x64emu_t *emu, uintptr_t fcn) { pFEppppV_t fn = (pFEppppV_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)(R_RSP + 8)); } -void pFEppApp(x64emu_t *emu, uintptr_t fcn) { pFEppApp_t fn = (pFEppApp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } -void pFiiiiii(x64emu_t *emu, uintptr_t fcn) { pFiiiiii_t fn = (pFiiiiii_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void pFiiiiid(x64emu_t *emu, uintptr_t fcn) { pFiiiiid_t fn = (pFiiiiid_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, emu->xmm[0].d[0]); } -void pFipippp(x64emu_t *emu, uintptr_t fcn) { pFipippp_t fn = (pFipippp_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFWCiWCi(x64emu_t *emu, uintptr_t fcn) { pFWCiWCi_t fn = (pFWCiWCi_t)fcn; R_RAX=(uintptr_t)fn((uint16_t)R_RDI, (uint8_t)R_RSI, (int32_t)R_RDX, (uint16_t)R_RCX, (uint8_t)R_R8, (int32_t)R_R9); } -void pFuCCCCp(x64emu_t *emu, uintptr_t fcn) { pFuCCCCp_t fn = (pFuCCCCp_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (void*)R_R9); } -void pFuuipip(x64emu_t *emu, uintptr_t fcn) { pFuuipip_t fn = (pFuuipip_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void pFuuuiip(x64emu_t *emu, uintptr_t fcn) { pFuuuiip_t fn = (pFuuuiip_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void pFuuuuii(x64emu_t *emu, uintptr_t fcn) { pFuuuuii_t fn = (pFuuuuii_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void pFuuuuuu(x64emu_t *emu, uintptr_t fcn) { pFuuuuuu_t fn = (pFuuuuuu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void pFuuuuup(x64emu_t *emu, uintptr_t fcn) { pFuuuuup_t fn = (pFuuuuup_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void pFuuppuu(x64emu_t *emu, uintptr_t fcn) { pFuuppuu_t fn = (pFuuppuu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void pFuppppp(x64emu_t *emu, uintptr_t fcn) { pFuppppp_t fn = (pFuppppp_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFdddddd(x64emu_t *emu, uintptr_t fcn) { pFdddddd_t fn = (pFdddddd_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); } -void pFpiiiiu(x64emu_t *emu, uintptr_t fcn) { pFpiiiiu_t fn = (pFpiiiiu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); } -void pFpiiipp(x64emu_t *emu, uintptr_t fcn) { pFpiiipp_t fn = (pFpiiipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFpiiCCC(x64emu_t *emu, uintptr_t fcn) { pFpiiCCC_t fn = (pFpiiCCC_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9); } -void pFpiiuup(x64emu_t *emu, uintptr_t fcn) { pFpiiuup_t fn = (pFpiiuup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void pFpiUUUU(x64emu_t *emu, uintptr_t fcn) { pFpiUUUU_t fn = (pFpiUUUU_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (uint64_t)R_R9); } -void pFpipipp(x64emu_t *emu, uintptr_t fcn) { pFpipipp_t fn = (pFpipipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFpippip(x64emu_t *emu, uintptr_t fcn) { pFpippip_t fn = (pFpippip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void pFpipppp(x64emu_t *emu, uintptr_t fcn) { pFpipppp_t fn = (pFpipppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFpuiiip(x64emu_t *emu, uintptr_t fcn) { pFpuiiip_t fn = (pFpuiiip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void pFpuuuuu(x64emu_t *emu, uintptr_t fcn) { pFpuuuuu_t fn = (pFpuuuuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } -void pFpuuupu(x64emu_t *emu, uintptr_t fcn) { pFpuuupu_t fn = (pFpuuupu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void pFpupuui(x64emu_t *emu, uintptr_t fcn) { pFpupuui_t fn = (pFpupuui_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); } -void pFpuppip(x64emu_t *emu, uintptr_t fcn) { pFpuppip_t fn = (pFpuppip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void pFpupppp(x64emu_t *emu, uintptr_t fcn) { pFpupppp_t fn = (pFpupppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFplpppp(x64emu_t *emu, uintptr_t fcn) { pFplpppp_t fn = (pFplpppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFpLuLpp(x64emu_t *emu, uintptr_t fcn) { pFpLuLpp_t fn = (pFpLuLpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFpLpLLi(x64emu_t *emu, uintptr_t fcn) { pFpLpLLi_t fn = (pFpLpLLi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9); } -void pFpLppii(x64emu_t *emu, uintptr_t fcn) { pFpLppii_t fn = (pFpLppii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void pFpLppip(x64emu_t *emu, uintptr_t fcn) { pFpLppip_t fn = (pFpLppip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void pFpLppup(x64emu_t *emu, uintptr_t fcn) { pFpLppup_t fn = (pFpLppup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); } -void pFppiiii(x64emu_t *emu, uintptr_t fcn) { pFppiiii_t fn = (pFppiiii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void pFppiipp(x64emu_t *emu, uintptr_t fcn) { pFppiipp_t fn = (pFppiipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFppiCCC(x64emu_t *emu, uintptr_t fcn) { pFppiCCC_t fn = (pFppiCCC_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9); } -void pFppiupp(x64emu_t *emu, uintptr_t fcn) { pFppiupp_t fn = (pFppiupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFppilpp(x64emu_t *emu, uintptr_t fcn) { pFppilpp_t fn = (pFppilpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFppipip(x64emu_t *emu, uintptr_t fcn) { pFppipip_t fn = (pFppipip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void pFppippi(x64emu_t *emu, uintptr_t fcn) { pFppippi_t fn = (pFppippi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void pFppippp(x64emu_t *emu, uintptr_t fcn) { pFppippp_t fn = (pFppippp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFppuupp(x64emu_t *emu, uintptr_t fcn) { pFppuupp_t fn = (pFppuupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFppuppp(x64emu_t *emu, uintptr_t fcn) { pFppuppp_t fn = (pFppuppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFpplplp(x64emu_t *emu, uintptr_t fcn) { pFpplplp_t fn = (pFpplplp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (void*)R_R9); } -void pFpplppp(x64emu_t *emu, uintptr_t fcn) { pFpplppp_t fn = (pFpplppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFpppupp(x64emu_t *emu, uintptr_t fcn) { pFpppupp_t fn = (pFpppupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFpppLii(x64emu_t *emu, uintptr_t fcn) { pFpppLii_t fn = (pFpppLii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void pFpppLui(x64emu_t *emu, uintptr_t fcn) { pFpppLui_t fn = (pFpppLui_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); } -void pFppppii(x64emu_t *emu, uintptr_t fcn) { pFppppii_t fn = (pFppppii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void pFpppppi(x64emu_t *emu, uintptr_t fcn) { pFpppppi_t fn = (pFpppppi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void pFpppppu(x64emu_t *emu, uintptr_t fcn) { pFpppppu_t fn = (pFpppppu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void pFpppppp(x64emu_t *emu, uintptr_t fcn) { pFpppppp_t fn = (pFpppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFSpiiii(x64emu_t *emu, uintptr_t fcn) { pFSpiiii_t fn = (pFSpiiii_t)fcn; R_RAX=(uintptr_t)fn(io_convert((void*)R_RDI), (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); } -void pFbCuuCC(x64emu_t *emu, uintptr_t fcn) { pFbCuuCC_t fn = (pFbCuuCC_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbCuuup(x64emu_t *emu, uintptr_t fcn) { pFbCuuup_t fn = (pFbCuuup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuwwu(x64emu_t *emu, uintptr_t fcn) { pFbuuwwu_t fn = (pFbuuwwu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (int16_t)R_RCX, (int16_t)R_R8, (uint32_t)R_R9); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuuuu(x64emu_t *emu, uintptr_t fcn) { pFbuuuuu_t fn = (pFbuuuuu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuUUU(x64emu_t *emu, uintptr_t fcn) { pFbuuUUU_t fn = (pFbuuUUU_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (uint64_t)R_R9); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbpupii(x64emu_t *emu, uintptr_t fcn) { pFbpupii_t fn = (pFbpupii_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void iWEpuuip(x64emu_t *emu, uintptr_t fcn) { iWEpuuip_t fn = (iWEpuuip_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 40)); } -void iWEppppp(x64emu_t *emu, uintptr_t fcn) { iWEppppp_t fn = (iWEppppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (void*)R_RDX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 40)); } -void iWpiiiip(x64emu_t *emu, uintptr_t fcn) { iWpiiiip_t fn = (iWpiiiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (int32_t)R_RDX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void iWpiiuii(x64emu_t *emu, uintptr_t fcn) { iWpiiuii_t fn = (iWpiiuii_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (int32_t)R_RDX, (int32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); } -void iWpiuppu(x64emu_t *emu, uintptr_t fcn) { iWpiuppu_t fn = (iWpiuppu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (int32_t)R_RDX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 40), *(uint32_t*)(R_RSP + 48)); } -void iWpuiiii(x64emu_t *emu, uintptr_t fcn) { iWpuiiii_t fn = (iWpuiiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); } -void iWpppppi(x64emu_t *emu, uintptr_t fcn) { iWpppppi_t fn = (iWpppppi_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); } -void iWpppppu(x64emu_t *emu, uintptr_t fcn) { iWpppppu_t fn = (iWpppppu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 40), *(uint32_t*)(R_RSP + 48)); } -void vFEpiiipp(x64emu_t *emu, uintptr_t fcn) { vFEpiiipp_t fn = (vFEpiiipp_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFEpipppp(x64emu_t *emu, uintptr_t fcn) { vFEpipppp_t fn = (vFEpipppp_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFEpuipuV(x64emu_t *emu, uintptr_t fcn) { vFEpuipuV_t fn = (vFEpuipuV_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)(R_RSP + 8)); } -void vFEppippp(x64emu_t *emu, uintptr_t fcn) { vFEppippp_t fn = (vFEppippp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFEpppppp(x64emu_t *emu, uintptr_t fcn) { vFEpppppp_t fn = (vFEpppppp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void vFiiiiiip(x64emu_t *emu, uintptr_t fcn) { vFiiiiiip_t fn = (vFiiiiiip_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFiiiiuup(x64emu_t *emu, uintptr_t fcn) { vFiiiiuup_t fn = (vFiiiiuup_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFiiuilil(x64emu_t *emu, uintptr_t fcn) { vFiiuilil_t fn = (vFiiuilil_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(intptr_t*)(R_RSP + 8)); } -void vFiiffffp(x64emu_t *emu, uintptr_t fcn) { vFiiffffp_t fn = (vFiiffffp_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], (void*)R_RDX); } -void vFiuulipi(x64emu_t *emu, uintptr_t fcn) { vFiuulipi_t fn = (vFiuulipi_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFiupuuup(x64emu_t *emu, uintptr_t fcn) { vFiupuuup_t fn = (vFiupuuup_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFilipliu(x64emu_t *emu, uintptr_t fcn) { vFilipliu_t fn = (vFilipliu_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFilulipi(x64emu_t *emu, uintptr_t fcn) { vFilulipi_t fn = (vFilulipi_t)fcn; fn((int32_t)R_RDI, (intptr_t)R_RSI, (uint32_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFCCCCfff(x64emu_t *emu, uintptr_t fcn) { vFCCCCfff_t fn = (vFCCCCfff_t)fcn; fn((uint8_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); } -void vFuiiiiii(x64emu_t *emu, uintptr_t fcn) { vFuiiiiii_t fn = (vFuiiiiii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFuiiiiiC(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiC_t fn = (vFuiiiiiC_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint8_t*)(R_RSP + 8)); } -void vFuiiiuip(x64emu_t *emu, uintptr_t fcn) { vFuiiiuip_t fn = (vFuiiiuip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFuiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuiiiuup_t fn = (vFuiiiuup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFuiuiiii(x64emu_t *emu, uintptr_t fcn) { vFuiuiiii_t fn = (vFuiuiiii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFuiuiiiC(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiC_t fn = (vFuiuiiiC_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint8_t*)(R_RSP + 8)); } -void vFuiuiiip(x64emu_t *emu, uintptr_t fcn) { vFuiuiiip_t fn = (vFuiuiiip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFuiuiiuL(x64emu_t *emu, uintptr_t fcn) { vFuiuiiuL_t fn = (vFuiuiiuL_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uintptr_t*)(R_RSP + 8)); } -void vFuiuCiuu(x64emu_t *emu, uintptr_t fcn) { vFuiuCiuu_t fn = (vFuiuCiuu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFuiupiiu(x64emu_t *emu, uintptr_t fcn) { vFuiupiiu_t fn = (vFuiupiiu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFuiupuip(x64emu_t *emu, uintptr_t fcn) { vFuiupuip_t fn = (vFuiupuip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFuipiiii(x64emu_t *emu, uintptr_t fcn) { vFuipiiii_t fn = (vFuipiiii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFuipffff(x64emu_t *emu, uintptr_t fcn) { vFuipffff_t fn = (vFuipffff_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); } -void vFuipdddd(x64emu_t *emu, uintptr_t fcn) { vFuipdddd_t fn = (vFuipdddd_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void vFuuiiiii(x64emu_t *emu, uintptr_t fcn) { vFuuiiiii_t fn = (vFuuiiiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFuuiiiiC(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiC_t fn = (vFuuiiiiC_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint8_t*)(R_RSP + 8)); } -void vFuuiiiiu(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiu_t fn = (vFuuiiiiu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFuuiiiip(x64emu_t *emu, uintptr_t fcn) { vFuuiiiip_t fn = (vFuuiiiip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFuuiiuup(x64emu_t *emu, uintptr_t fcn) { vFuuiiuup_t fn = (vFuuiiuup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFuuiCiui(x64emu_t *emu, uintptr_t fcn) { vFuuiCiui_t fn = (vFuuiCiui_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFuuiCiuu(x64emu_t *emu, uintptr_t fcn) { vFuuiCiuu_t fn = (vFuuiCiuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFuuiuiii(x64emu_t *emu, uintptr_t fcn) { vFuuiuiii_t fn = (vFuuiuiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFuuiuiiC(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiC_t fn = (vFuuiuiiC_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint8_t*)(R_RSP + 8)); } -void vFuuipppp(x64emu_t *emu, uintptr_t fcn) { vFuuipppp_t fn = (vFuuipppp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFuuuiiii(x64emu_t *emu, uintptr_t fcn) { vFuuuiiii_t fn = (vFuuuiiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFuuuiiCp(x64emu_t *emu, uintptr_t fcn) { vFuuuiiCp_t fn = (vFuuuiiCp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint8_t)R_R9, *(void**)(R_RSP + 8)); } -void vFuuuiuii(x64emu_t *emu, uintptr_t fcn) { vFuuuiuii_t fn = (vFuuuiuii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFuuuiuil(x64emu_t *emu, uintptr_t fcn) { vFuuuiuil_t fn = (vFuuuiuil_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(intptr_t*)(R_RSP + 8)); } -void vFuuuiupi(x64emu_t *emu, uintptr_t fcn) { vFuuuiupi_t fn = (vFuuuiupi_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFuuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuu_t fn = (vFuuuuuuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFuuuulll(x64emu_t *emu, uintptr_t fcn) { vFuuuulll_t fn = (vFuuuulll_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8)); } -void vFuuuffff(x64emu_t *emu, uintptr_t fcn) { vFuuuffff_t fn = (vFuuuffff_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); } -void vFuuudddd(x64emu_t *emu, uintptr_t fcn) { vFuuudddd_t fn = (vFuuudddd_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void vFuuffiip(x64emu_t *emu, uintptr_t fcn) { vFuuffiip_t fn = (vFuuffiip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFuuddiip(x64emu_t *emu, uintptr_t fcn) { vFuuddiip_t fn = (vFuuddiip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -void vFuulluup(x64emu_t *emu, uintptr_t fcn) { vFuulluup_t fn = (vFuulluup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFuupiiii(x64emu_t *emu, uintptr_t fcn) { vFuupiiii_t fn = (vFuupiiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFuuppppu(x64emu_t *emu, uintptr_t fcn) { vFuuppppu_t fn = (vFuuppppu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFuuppppp(x64emu_t *emu, uintptr_t fcn) { vFuuppppp_t fn = (vFuuppppp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFuffffff(x64emu_t *emu, uintptr_t fcn) { vFuffffff_t fn = (vFuffffff_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0]); } -void vFudddddd(x64emu_t *emu, uintptr_t fcn) { vFudddddd_t fn = (vFudddddd_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); } -void vFlipuiip(x64emu_t *emu, uintptr_t fcn) { vFlipuiip_t fn = (vFlipuiip_t)fcn; fn((intptr_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFlliiiip(x64emu_t *emu, uintptr_t fcn) { vFlliiiip_t fn = (vFlliiiip_t)fcn; fn((intptr_t)R_RDI, (intptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFpiiiipp(x64emu_t *emu, uintptr_t fcn) { vFpiiiipp_t fn = (vFpiiiipp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFpiiliip(x64emu_t *emu, uintptr_t fcn) { vFpiiliip_t fn = (vFpiiliip_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFpiiLiip(x64emu_t *emu, uintptr_t fcn) { vFpiiLiip_t fn = (vFpiiLiip_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFpiipCpp(x64emu_t *emu, uintptr_t fcn) { vFpiipCpp_t fn = (vFpiipCpp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint8_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFpiipppp(x64emu_t *emu, uintptr_t fcn) { vFpiipppp_t fn = (vFpiipppp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFpipipii(x64emu_t *emu, uintptr_t fcn) { vFpipipii_t fn = (vFpipipii_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFpippppu(x64emu_t *emu, uintptr_t fcn) { vFpippppu_t fn = (vFpippppu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFpuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFpuuuuuu_t fn = (vFpuuuuuu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFpuuUUuu(x64emu_t *emu, uintptr_t fcn) { vFpuuUUuu_t fn = (vFpuuUUuu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFpuupupu(x64emu_t *emu, uintptr_t fcn) { vFpuupupu_t fn = (vFpuupupu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFpuupppp(x64emu_t *emu, uintptr_t fcn) { vFpuupppp_t fn = (vFpuupppp_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFpupuuup(x64emu_t *emu, uintptr_t fcn) { vFpupuuup_t fn = (vFpupuuup_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFpupppui(x64emu_t *emu, uintptr_t fcn) { vFpupppui_t fn = (vFpupppui_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFpUiUiup(x64emu_t *emu, uintptr_t fcn) { vFpUiUiup_t fn = (vFpUiUiup_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFpUuuUip(x64emu_t *emu, uintptr_t fcn) { vFpUuuUip_t fn = (vFpUuuUip_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint64_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFpUUUUuu(x64emu_t *emu, uintptr_t fcn) { vFpUUUUuu_t fn = (vFpUUUUuu_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFpddiidd(x64emu_t *emu, uintptr_t fcn) { vFpddiidd_t fn = (vFpddiidd_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void vFpdddddd(x64emu_t *emu, uintptr_t fcn) { vFpdddddd_t fn = (vFpdddddd_t)fcn; fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); } -void vFpLiLiLp(x64emu_t *emu, uintptr_t fcn) { vFpLiLiLp_t fn = (vFpLiLiLp_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8)); } -void vFpLpiipi(x64emu_t *emu, uintptr_t fcn) { vFpLpiipi_t fn = (vFpLpiipi_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFppiiiii(x64emu_t *emu, uintptr_t fcn) { vFppiiiii_t fn = (vFppiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFppiiiip(x64emu_t *emu, uintptr_t fcn) { vFppiiiip_t fn = (vFppiiiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFppiiipi(x64emu_t *emu, uintptr_t fcn) { vFppiiipi_t fn = (vFppiiipi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFppiipii(x64emu_t *emu, uintptr_t fcn) { vFppiipii_t fn = (vFppiipii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFppiipuu(x64emu_t *emu, uintptr_t fcn) { vFppiipuu_t fn = (vFppiipuu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFppiippp(x64emu_t *emu, uintptr_t fcn) { vFppiippp_t fn = (vFppiippp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFppilppi(x64emu_t *emu, uintptr_t fcn) { vFppilppi_t fn = (vFppilppi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFppiLiLp(x64emu_t *emu, uintptr_t fcn) { vFppiLiLp_t fn = (vFppiLiLp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8)); } -void vFppipiip(x64emu_t *emu, uintptr_t fcn) { vFppipiip_t fn = (vFppipiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFppipipp(x64emu_t *emu, uintptr_t fcn) { vFppipipp_t fn = (vFppipipp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFppipppp(x64emu_t *emu, uintptr_t fcn) { vFppipppp_t fn = (vFppipppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFppCuupp(x64emu_t *emu, uintptr_t fcn) { vFppCuupp_t fn = (vFppCuupp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint8_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFppuiiip(x64emu_t *emu, uintptr_t fcn) { vFppuiiip_t fn = (vFppuiiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFppuupii(x64emu_t *emu, uintptr_t fcn) { vFppuupii_t fn = (vFppuupii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFppUuupp(x64emu_t *emu, uintptr_t fcn) { vFppUuupp_t fn = (vFppUuupp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFppddddu(x64emu_t *emu, uintptr_t fcn) { vFppddddu_t fn = (vFppddddu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], (uint32_t)R_RDX); } -void vFppddpiu(x64emu_t *emu, uintptr_t fcn) { vFppddpiu_t fn = (vFppddpiu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8); } -void vFpplpppi(x64emu_t *emu, uintptr_t fcn) { vFpplpppi_t fn = (vFpplpppi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFppLpppi(x64emu_t *emu, uintptr_t fcn) { vFppLpppi_t fn = (vFppLpppi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFppLpppp(x64emu_t *emu, uintptr_t fcn) { vFppLpppp_t fn = (vFppLpppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFpppiiii(x64emu_t *emu, uintptr_t fcn) { vFpppiiii_t fn = (vFpppiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFpppiipi(x64emu_t *emu, uintptr_t fcn) { vFpppiipi_t fn = (vFpppiipi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFpppiipp(x64emu_t *emu, uintptr_t fcn) { vFpppiipp_t fn = (vFpppiipp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFpppiupi(x64emu_t *emu, uintptr_t fcn) { vFpppiupi_t fn = (vFpppiupi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFpppippi(x64emu_t *emu, uintptr_t fcn) { vFpppippi_t fn = (vFpppippi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFpppuuuu(x64emu_t *emu, uintptr_t fcn) { vFpppuuuu_t fn = (vFpppuuuu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFpppffff(x64emu_t *emu, uintptr_t fcn) { vFpppffff_t fn = (vFpppffff_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0]); } -void vFppppiip(x64emu_t *emu, uintptr_t fcn) { vFppppiip_t fn = (vFppppiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFppppiui(x64emu_t *emu, uintptr_t fcn) { vFppppiui_t fn = (vFppppiui_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFppppipi(x64emu_t *emu, uintptr_t fcn) { vFppppipi_t fn = (vFppppipi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void vFpppppip(x64emu_t *emu, uintptr_t fcn) { vFpppppip_t fn = (vFpppppip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFppppppu(x64emu_t *emu, uintptr_t fcn) { vFppppppu_t fn = (vFppppppu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFppppppp(x64emu_t *emu, uintptr_t fcn) { vFppppppp_t fn = (vFppppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFEpupppp(x64emu_t *emu, uintptr_t fcn) { iFEpupppp_t fn = (iFEpupppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFEpUuppp(x64emu_t *emu, uintptr_t fcn) { iFEpUuppp_t fn = (iFEpUuppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFEpLiLpp(x64emu_t *emu, uintptr_t fcn) { iFEpLiLpp_t fn = (iFEpLiLpp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFEpLiLpV(x64emu_t *emu, uintptr_t fcn) { iFEpLiLpV_t fn = (iFEpLiLpV_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)(R_RSP + 8)); } -void iFEppuppp(x64emu_t *emu, uintptr_t fcn) { iFEppuppp_t fn = (iFEppuppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFEppLpIi(x64emu_t *emu, uintptr_t fcn) { iFEppLpIi_t fn = (iFEppLpIi_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int64_t)R_R8, (int32_t)R_R9); } -void iFEpppiiu(x64emu_t *emu, uintptr_t fcn) { iFEpppiiu_t fn = (iFEpppiiu_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9); } -void iFEpppppL(x64emu_t *emu, uintptr_t fcn) { iFEpppppL_t fn = (iFEpppppL_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); } -void iFEpppppp(x64emu_t *emu, uintptr_t fcn) { iFEpppppp_t fn = (iFEpppppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFiiiiiip(x64emu_t *emu, uintptr_t fcn) { iFiiiiiip_t fn = (iFiiiiiip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void iFipupupi(x64emu_t *emu, uintptr_t fcn) { iFipupupi_t fn = (iFipupupi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFippuIup(x64emu_t *emu, uintptr_t fcn) { iFippuIup_t fn = (iFippuIup_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int64_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void iFipppppp(x64emu_t *emu, uintptr_t fcn) { iFipppppp_t fn = (iFipppppp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpiiiiii(x64emu_t *emu, uintptr_t fcn) { iFpiiiiii_t fn = (iFpiiiiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFpiiiuwp(x64emu_t *emu, uintptr_t fcn) { iFpiiiuwp_t fn = (iFpiiiuwp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int16_t)R_R9, *(void**)(R_RSP + 8)); } -void iFpiiiuup(x64emu_t *emu, uintptr_t fcn) { iFpiiiuup_t fn = (iFpiiiuup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void iFpiiuuiu(x64emu_t *emu, uintptr_t fcn) { iFpiiuuiu_t fn = (iFpiiuuiu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void iFpiipppp(x64emu_t *emu, uintptr_t fcn) { iFpiipppp_t fn = (iFpiipppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpiuiipp(x64emu_t *emu, uintptr_t fcn) { iFpiuiipp_t fn = (iFpiuiipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpiuLiii(x64emu_t *emu, uintptr_t fcn) { iFpiuLiii_t fn = (iFpiuLiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFpiupppp(x64emu_t *emu, uintptr_t fcn) { iFpiupppp_t fn = (iFpiupppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpiLuupp(x64emu_t *emu, uintptr_t fcn) { iFpiLuupp_t fn = (iFpiLuupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpiLuppp(x64emu_t *emu, uintptr_t fcn) { iFpiLuppp_t fn = (iFpiLuppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpipiiip(x64emu_t *emu, uintptr_t fcn) { iFpipiiip_t fn = (iFpipiiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void iFpipipip(x64emu_t *emu, uintptr_t fcn) { iFpipipip_t fn = (iFpipipip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void iFpipippp(x64emu_t *emu, uintptr_t fcn) { iFpipippp_t fn = (iFpipippp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpippLpp(x64emu_t *emu, uintptr_t fcn) { iFpippLpp_t fn = (iFpippLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpippppW(x64emu_t *emu, uintptr_t fcn) { iFpippppW_t fn = (iFpippppW_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint16_t*)(R_RSP + 8)); } -void iFpippppp(x64emu_t *emu, uintptr_t fcn) { iFpippppp_t fn = (iFpippppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpIIpppp(x64emu_t *emu, uintptr_t fcn) { iFpIIpppp_t fn = (iFpIIpppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpWCiWCi(x64emu_t *emu, uintptr_t fcn) { iFpWCiWCi_t fn = (iFpWCiWCi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (uint8_t)R_RDX, (int32_t)R_RCX, (uint16_t)R_R8, (uint8_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFpWppppW(x64emu_t *emu, uintptr_t fcn) { iFpWppppW_t fn = (iFpWppppW_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint16_t*)(R_RSP + 8)); } -void iFpWppppp(x64emu_t *emu, uintptr_t fcn) { iFpWppppp_t fn = (iFpWppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpuiCuCp(x64emu_t *emu, uintptr_t fcn) { iFpuiCuCp_t fn = (iFpuiCuCp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (uint32_t)R_R8, (uint8_t)R_R9, *(void**)(R_RSP + 8)); } -void iFpuiuupp(x64emu_t *emu, uintptr_t fcn) { iFpuiuupp_t fn = (iFpuiuupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpupiLpL(x64emu_t *emu, uintptr_t fcn) { iFpupiLpL_t fn = (iFpupiLpL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8)); } -void iFpupuuui(x64emu_t *emu, uintptr_t fcn) { iFpupuuui_t fn = (iFpupuuui_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFpupuupp(x64emu_t *emu, uintptr_t fcn) { iFpupuupp_t fn = (iFpupuupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpupupui(x64emu_t *emu, uintptr_t fcn) { iFpupupui_t fn = (iFpupupui_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFpuppppp(x64emu_t *emu, uintptr_t fcn) { iFpuppppp_t fn = (iFpuppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpllpppp(x64emu_t *emu, uintptr_t fcn) { iFpllpppp_t fn = (iFpllpppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpLiiiiL(x64emu_t *emu, uintptr_t fcn) { iFpLiiiiL_t fn = (iFpLiiiiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8)); } -void iFpLiiuui(x64emu_t *emu, uintptr_t fcn) { iFpLiiuui_t fn = (iFpLiiuui_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFpLipipi(x64emu_t *emu, uintptr_t fcn) { iFpLipipi_t fn = (iFpLipipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFpLipupu(x64emu_t *emu, uintptr_t fcn) { iFpLipupu_t fn = (iFpLipupu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); } -void iFpLpiiii(x64emu_t *emu, uintptr_t fcn) { iFpLpiiii_t fn = (iFpLpiiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFpLpiiuu(x64emu_t *emu, uintptr_t fcn) { iFpLpiiuu_t fn = (iFpLpiiuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void iFpLpiipi(x64emu_t *emu, uintptr_t fcn) { iFpLpiipi_t fn = (iFpLpiipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFpLppiii(x64emu_t *emu, uintptr_t fcn) { iFpLppiii_t fn = (iFpLppiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFppiiiip(x64emu_t *emu, uintptr_t fcn) { iFppiiiip_t fn = (iFppiiiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void iFppiiuup(x64emu_t *emu, uintptr_t fcn) { iFppiiuup_t fn = (iFppiiuup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void iFppiiLll(x64emu_t *emu, uintptr_t fcn) { iFppiiLll_t fn = (iFppiiLll_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8)); } -void iFppiipii(x64emu_t *emu, uintptr_t fcn) { iFppiipii_t fn = (iFppiipii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFppiipiL(x64emu_t *emu, uintptr_t fcn) { iFppiipiL_t fn = (iFppiipiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8)); } -void iFppipiii(x64emu_t *emu, uintptr_t fcn) { iFppipiii_t fn = (iFppipiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFppipiip(x64emu_t *emu, uintptr_t fcn) { iFppipiip_t fn = (iFppipiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void iFppipipp(x64emu_t *emu, uintptr_t fcn) { iFppipipp_t fn = (iFppipipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFppippip(x64emu_t *emu, uintptr_t fcn) { iFppippip_t fn = (iFppippip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void iFppipppi(x64emu_t *emu, uintptr_t fcn) { iFppipppi_t fn = (iFppipppi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFppipppp(x64emu_t *emu, uintptr_t fcn) { iFppipppp_t fn = (iFppipppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFppuipiL(x64emu_t *emu, uintptr_t fcn) { iFppuipiL_t fn = (iFppuipiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8)); } -void iFppuippp(x64emu_t *emu, uintptr_t fcn) { iFppuippp_t fn = (iFppuippp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFppuuppp(x64emu_t *emu, uintptr_t fcn) { iFppuuppp_t fn = (iFppuuppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFppupupp(x64emu_t *emu, uintptr_t fcn) { iFppupupp_t fn = (iFppupupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFppliupp(x64emu_t *emu, uintptr_t fcn) { iFppliupp_t fn = (iFppliupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFppLiipp(x64emu_t *emu, uintptr_t fcn) { iFppLiipp_t fn = (iFppLiipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFppLippp(x64emu_t *emu, uintptr_t fcn) { iFppLippp_t fn = (iFppLippp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFppLuuii(x64emu_t *emu, uintptr_t fcn) { iFppLuuii_t fn = (iFppLuuii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFpppiiuu(x64emu_t *emu, uintptr_t fcn) { iFpppiiuu_t fn = (iFpppiiuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void iFpppiiup(x64emu_t *emu, uintptr_t fcn) { iFpppiiup_t fn = (iFpppiiup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void iFpppiuwu(x64emu_t *emu, uintptr_t fcn) { iFpppiuwu_t fn = (iFpppiuwu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int16_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void iFpppippi(x64emu_t *emu, uintptr_t fcn) { iFpppippi_t fn = (iFpppippi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFpppippp(x64emu_t *emu, uintptr_t fcn) { iFpppippp_t fn = (iFpppippp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpppuiii(x64emu_t *emu, uintptr_t fcn) { iFpppuiii_t fn = (iFpppuiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void iFpppLppp(x64emu_t *emu, uintptr_t fcn) { iFpppLppp_t fn = (iFpppLppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFppppilp(x64emu_t *emu, uintptr_t fcn) { iFppppilp_t fn = (iFppppilp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (intptr_t)R_R9, *(void**)(R_RSP + 8)); } -void iFppppipp(x64emu_t *emu, uintptr_t fcn) { iFppppipp_t fn = (iFppppipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFppppIip(x64emu_t *emu, uintptr_t fcn) { iFppppIip_t fn = (iFppppIip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int64_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void iFppppdpu(x64emu_t *emu, uintptr_t fcn) { iFppppdpu_t fn = (iFppppdpu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, emu->xmm[0].d[0], (void*)R_R8, (uint32_t)R_R9); } -void iFpppppip(x64emu_t *emu, uintptr_t fcn) { iFpppppip_t fn = (iFpppppip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void iFpppppLp(x64emu_t *emu, uintptr_t fcn) { iFpppppLp_t fn = (iFpppppLp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8)); } -void iFppppppu(x64emu_t *emu, uintptr_t fcn) { iFppppppu_t fn = (iFppppppu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); } -void iFppppppp(x64emu_t *emu, uintptr_t fcn) { iFppppppp_t fn = (iFppppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFEiipppp(x64emu_t *emu, uintptr_t fcn) { uFEiipppp_t fn = (uFEiipppp_t)fcn; R_RAX=(uint32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFEpiippp(x64emu_t *emu, uintptr_t fcn) { uFEpiippp_t fn = (uFEpiippp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFEpuuppp(x64emu_t *emu, uintptr_t fcn) { uFEpuuppp_t fn = (uFEpuuppp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFEpppppp(x64emu_t *emu, uintptr_t fcn) { uFEpppppp_t fn = (uFEpppppp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void uFiiiuuuu(x64emu_t *emu, uintptr_t fcn) { uFiiiuuuu_t fn = (uFiiiuuuu_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void uFuippppp(x64emu_t *emu, uintptr_t fcn) { uFuippppp_t fn = (uFuippppp_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFpippppp(x64emu_t *emu, uintptr_t fcn) { uFpippppp_t fn = (uFpippppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFpuuuupp(x64emu_t *emu, uintptr_t fcn) { uFpuuuupp_t fn = (uFpuuuupp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFpuuuppp(x64emu_t *emu, uintptr_t fcn) { uFpuuuppp_t fn = (uFpuuuppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFpuupppp(x64emu_t *emu, uintptr_t fcn) { uFpuupppp_t fn = (uFpuupppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFppiuppi(x64emu_t *emu, uintptr_t fcn) { uFppiuppi_t fn = (uFppiuppi_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void uFppiuppp(x64emu_t *emu, uintptr_t fcn) { uFppiuppp_t fn = (uFppiuppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFppuuuup(x64emu_t *emu, uintptr_t fcn) { uFppuuuup_t fn = (uFppuuuup_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void uFppppppp(x64emu_t *emu, uintptr_t fcn) { uFppppppp_t fn = (uFppppppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFbCuuuuu(x64emu_t *emu, uintptr_t fcn) { uFbCuuuuu_t fn = (uFbCuuuuu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuuuwwu(x64emu_t *emu, uintptr_t fcn) { uFbuuuwwu_t fn = (uFbuuuwwu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int16_t)R_R8, (int16_t)R_R9, *(uint32_t*)(R_RSP + 8)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbuupwwC(x64emu_t *emu, uintptr_t fcn) { uFbuupwwC_t fn = (uFbuupwwC_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int16_t)R_R8, (int16_t)R_R9, *(uint8_t*)(R_RSP + 8)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void LFEppLppU(x64emu_t *emu, uintptr_t fcn) { LFEppLppU_t fn = (LFEppLppU_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint64_t)R_R9); } -void LFEpppppu(x64emu_t *emu, uintptr_t fcn) { LFEpppppu_t fn = (LFEpppppu_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9); } -void LFpLLuupp(x64emu_t *emu, uintptr_t fcn) { LFpLLuupp_t fn = (LFpLLuupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void LFpLLppuu(x64emu_t *emu, uintptr_t fcn) { LFpLLppuu_t fn = (LFpLLppuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void pFEpupppp(x64emu_t *emu, uintptr_t fcn) { pFEpupppp_t fn = (pFEpupppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFEpLiiil(x64emu_t *emu, uintptr_t fcn) { pFEpLiiil_t fn = (pFEpLiiil_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9); } -void pFEppuipp(x64emu_t *emu, uintptr_t fcn) { pFEppuipp_t fn = (pFEppuipp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9); } -void pFEppppip(x64emu_t *emu, uintptr_t fcn) { pFEppppip_t fn = (pFEppppip_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void pFEpppppi(x64emu_t *emu, uintptr_t fcn) { pFEpppppi_t fn = (pFEpppppi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9); } -void pFifffppp(x64emu_t *emu, uintptr_t fcn) { pFifffppp_t fn = (pFifffppp_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } -void pFWpppppp(x64emu_t *emu, uintptr_t fcn) { pFWpppppp_t fn = (pFWpppppp_t)fcn; R_RAX=(uintptr_t)fn((uint16_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFuuuiiip(x64emu_t *emu, uintptr_t fcn) { pFuuuiiip_t fn = (pFuuuiiip_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void pFuupupup(x64emu_t *emu, uintptr_t fcn) { pFuupupup_t fn = (pFuupupup_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void pFfiiiiid(x64emu_t *emu, uintptr_t fcn) { pFfiiiiid_t fn = (pFfiiiiid_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].f[0], (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, emu->xmm[1].d[0]); } -void pFdiiiIiI(x64emu_t *emu, uintptr_t fcn) { pFdiiiIiI_t fn = (pFdiiiIiI_t)fcn; R_RAX=(uintptr_t)fn(emu->xmm[0].d[0], (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int64_t)R_RCX, (int32_t)R_R8, (int64_t)R_R9); } -void pFpiiiiid(x64emu_t *emu, uintptr_t fcn) { pFpiiiiid_t fn = (pFpiiiiid_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, emu->xmm[0].d[0]); } -void pFpiiippp(x64emu_t *emu, uintptr_t fcn) { pFpiiippp_t fn = (pFpiiippp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFpiiUdii(x64emu_t *emu, uintptr_t fcn) { pFpiiUdii_t fn = (pFpiiUdii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX, emu->xmm[0].d[0], (int32_t)R_R8, (int32_t)R_R9); } -void pFpiipppp(x64emu_t *emu, uintptr_t fcn) { pFpiipppp_t fn = (pFpiipppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFpipippp(x64emu_t *emu, uintptr_t fcn) { pFpipippp_t fn = (pFpipippp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFpWppWpp(x64emu_t *emu, uintptr_t fcn) { pFpWppWpp_t fn = (pFpWppWpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint16_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFpuLpipp(x64emu_t *emu, uintptr_t fcn) { pFpuLpipp_t fn = (pFpuLpipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFpupiipp(x64emu_t *emu, uintptr_t fcn) { pFpupiipp_t fn = (pFpupiipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFpuppipp(x64emu_t *emu, uintptr_t fcn) { pFpuppipp_t fn = (pFpuppipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFpuppppp(x64emu_t *emu, uintptr_t fcn) { pFpuppppp_t fn = (pFpuppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFplppppp(x64emu_t *emu, uintptr_t fcn) { pFplppppp_t fn = (pFplppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFpLLppup(x64emu_t *emu, uintptr_t fcn) { pFpLLppup_t fn = (pFpLLppup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void pFpLpipip(x64emu_t *emu, uintptr_t fcn) { pFpLpipip_t fn = (pFpLpipip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void pFpLpLLiL(x64emu_t *emu, uintptr_t fcn) { pFpLpLLiL_t fn = (pFpLpLLiL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8)); } -void pFpLppiip(x64emu_t *emu, uintptr_t fcn) { pFpLppiip_t fn = (pFpLppiip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void pFpLppLLi(x64emu_t *emu, uintptr_t fcn) { pFpLppLLi_t fn = (pFpLppLLi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void pFppiiipp(x64emu_t *emu, uintptr_t fcn) { pFppiiipp_t fn = (pFppiiipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFppiiCCC(x64emu_t *emu, uintptr_t fcn) { pFppiiCCC_t fn = (pFppiiCCC_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(uint8_t*)(R_RSP + 8)); } -void pFppiippp(x64emu_t *emu, uintptr_t fcn) { pFppiippp_t fn = (pFppiippp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFppipipp(x64emu_t *emu, uintptr_t fcn) { pFppipipp_t fn = (pFppipipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFppipLpp(x64emu_t *emu, uintptr_t fcn) { pFppipLpp_t fn = (pFppipLpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFppuippp(x64emu_t *emu, uintptr_t fcn) { pFppuippp_t fn = (pFppuippp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFppuuupp(x64emu_t *emu, uintptr_t fcn) { pFppuuupp_t fn = (pFppuuupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFppuuppp(x64emu_t *emu, uintptr_t fcn) { pFppuuppp_t fn = (pFppuuppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFppuLLip(x64emu_t *emu, uintptr_t fcn) { pFppuLLip_t fn = (pFppuLLip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void pFppupuuu(x64emu_t *emu, uintptr_t fcn) { pFppupuuu_t fn = (pFppupuuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void pFppliuip(x64emu_t *emu, uintptr_t fcn) { pFppliuip_t fn = (pFppliuip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void pFpplipup(x64emu_t *emu, uintptr_t fcn) { pFpplipup_t fn = (pFpplipup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void pFppLipip(x64emu_t *emu, uintptr_t fcn) { pFppLipip_t fn = (pFppLipip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void pFppLLiLi(x64emu_t *emu, uintptr_t fcn) { pFppLLiLi_t fn = (pFppLLiLi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void pFpppccci(x64emu_t *emu, uintptr_t fcn) { pFpppccci_t fn = (pFpppccci_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int8_t)R_RCX, (int8_t)R_R8, (int8_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void pFpppiiii(x64emu_t *emu, uintptr_t fcn) { pFpppiiii_t fn = (pFpppiiii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void pFpppCCCi(x64emu_t *emu, uintptr_t fcn) { pFpppCCCi_t fn = (pFpppCCCi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void pFpppuipp(x64emu_t *emu, uintptr_t fcn) { pFpppuipp_t fn = (pFpppuipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFpppuuui(x64emu_t *emu, uintptr_t fcn) { pFpppuuui_t fn = (pFpppuuui_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void pFpppuupp(x64emu_t *emu, uintptr_t fcn) { pFpppuupp_t fn = (pFpppuupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFpppupii(x64emu_t *emu, uintptr_t fcn) { pFpppupii_t fn = (pFpppupii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void pFpppupup(x64emu_t *emu, uintptr_t fcn) { pFpppupup_t fn = (pFpppupup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void pFpppuppp(x64emu_t *emu, uintptr_t fcn) { pFpppuppp_t fn = (pFpppuppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFpppfffi(x64emu_t *emu, uintptr_t fcn) { pFpppfffi_t fn = (pFpppfffi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], (int32_t)R_RCX); } -void pFpppdddi(x64emu_t *emu, uintptr_t fcn) { pFpppdddi_t fn = (pFpppdddi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], (int32_t)R_RCX); } -void pFpppllli(x64emu_t *emu, uintptr_t fcn) { pFpppllli_t fn = (pFpppllli_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void pFpppLLLi(x64emu_t *emu, uintptr_t fcn) { pFpppLLLi_t fn = (pFpppLLLi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void pFppppiii(x64emu_t *emu, uintptr_t fcn) { pFppppiii_t fn = (pFppppiii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void pFppppuuu(x64emu_t *emu, uintptr_t fcn) { pFppppuuu_t fn = (pFppppuuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void pFpppppuu(x64emu_t *emu, uintptr_t fcn) { pFpppppuu_t fn = (pFpppppuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void pFppppppu(x64emu_t *emu, uintptr_t fcn) { pFppppppu_t fn = (pFppppppu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); } -void pFppppppp(x64emu_t *emu, uintptr_t fcn) { pFppppppp_t fn = (pFppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFbCuwwWW(x64emu_t *emu, uintptr_t fcn) { pFbCuwwWW_t fn = (pFbCuwwWW_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (int16_t)R_RCX, (int16_t)R_R8, (uint16_t)R_R9, *(uint16_t*)(R_RSP + 8)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbCuWCCC(x64emu_t *emu, uintptr_t fcn) { pFbCuWCCC_t fn = (pFbCuWCCC_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(uint8_t*)(R_RSP + 8)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbCuuwwp(x64emu_t *emu, uintptr_t fcn) { pFbCuuwwp_t fn = (pFbCuuwwp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int16_t)R_R8, (int16_t)R_R9, *(void**)(R_RSP + 8)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbCpWWup(x64emu_t *emu, uintptr_t fcn) { pFbCpWWup_t fn = (pFbCpWWup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (void*)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void iWpiiuuuu(x64emu_t *emu, uintptr_t fcn) { iWpiiuuuu_t fn = (iWpiiuuuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (int32_t)R_RDX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56)); } -void iWpuiiiip(x64emu_t *emu, uintptr_t fcn) { iWpuiiiip_t fn = (iWpuiiiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void iWpuiiuii(x64emu_t *emu, uintptr_t fcn) { iWpuiiuii_t fn = (iWpuiiuii_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56)); } -void iWpuipupp(x64emu_t *emu, uintptr_t fcn) { iWpuipupp_t fn = (iWpuipupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void iWpuuuppu(x64emu_t *emu, uintptr_t fcn) { iWpuuuppu_t fn = (iWpuuuppu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(uint32_t*)(R_RSP + 56)); } -void iWpupuufu(x64emu_t *emu, uintptr_t fcn) { iWpupuufu_t fn = (iWpupuufu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 40), *(float*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56)); } -void iWpppuppp(x64emu_t *emu, uintptr_t fcn) { iWpppuppp_t fn = (iWpppuppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void vFEiippppV(x64emu_t *emu, uintptr_t fcn) { vFEiippppV_t fn = (vFEiippppV_t)fcn; fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, (void*)(R_RSP + 8)); } -void vFEiupippp(x64emu_t *emu, uintptr_t fcn) { vFEiupippp_t fn = (vFEiupippp_t)fcn; fn(emu, (int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFEipAippp(x64emu_t *emu, uintptr_t fcn) { vFEipAippp_t fn = (vFEipAippp_t)fcn; fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFEppipppp(x64emu_t *emu, uintptr_t fcn) { vFEppipppp_t fn = (vFEppipppp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFEppLippp(x64emu_t *emu, uintptr_t fcn) { vFEppLippp_t fn = (vFEppLippp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFEpppippp(x64emu_t *emu, uintptr_t fcn) { vFEpppippp_t fn = (vFEpppippp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void vFEpppuipV(x64emu_t *emu, uintptr_t fcn) { vFEpppuipV_t fn = (vFEpppuipV_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, (void*)(R_RSP + 8)); } -void vFEpppppuu(x64emu_t *emu, uintptr_t fcn) { vFEpppppuu_t fn = (vFEpppppuu_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8)); } -void vFiiiiuuip(x64emu_t *emu, uintptr_t fcn) { vFiiiiuuip_t fn = (vFiiiiuuip_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFiilliilp(x64emu_t *emu, uintptr_t fcn) { vFiilliilp_t fn = (vFiilliilp_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFiilluulp(x64emu_t *emu, uintptr_t fcn) { vFiilluulp_t fn = (vFiilluulp_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(intptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFiupuiuup(x64emu_t *emu, uintptr_t fcn) { vFiupuiuup_t fn = (vFiupuiuup_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFiupuuuup(x64emu_t *emu, uintptr_t fcn) { vFiupuuuup_t fn = (vFiupuuuup_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFuiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiii_t fn = (vFuiiiiiii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFuiiiiiiC(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiC_t fn = (vFuiiiiiiC_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16)); } -void vFuiiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuiiiiuup_t fn = (vFuiiiiuup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFuiiipiup(x64emu_t *emu, uintptr_t fcn) { vFuiiipiup_t fn = (vFuiiipiup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFuiuiiiii(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiii_t fn = (vFuiuiiiii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFuiuiiiip(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiip_t fn = (vFuiuiiiip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFuiuiiiuL(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiuL_t fn = (vFuiuiiiuL_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); } -void vFuiuiiCuL(x64emu_t *emu, uintptr_t fcn) { vFuiuiiCuL_t fn = (vFuiuiiCuL_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint8_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); } -void vFuiuiuuuu(x64emu_t *emu, uintptr_t fcn) { vFuiuiuuuu_t fn = (vFuiuiuuuu_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void vFuCCCCfff(x64emu_t *emu, uintptr_t fcn) { vFuCCCCfff_t fn = (vFuCCCCfff_t)fcn; fn((uint32_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); } -void vFuuiiiiiC(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiC_t fn = (vFuuiiiiiC_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16)); } -void vFuuiiiuip(x64emu_t *emu, uintptr_t fcn) { vFuuiiiuip_t fn = (vFuuiiiuip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFuuiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuuiiiuup_t fn = (vFuuiiiuup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFuuiiuupp(x64emu_t *emu, uintptr_t fcn) { vFuuiiuupp_t fn = (vFuuiiuupp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFuuiuiiii(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiii_t fn = (vFuuiuiiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFuuiuiiiC(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiiC_t fn = (vFuuiuiiiC_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16)); } -void vFuuiuiiip(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiip_t fn = (vFuuiuiiip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFuuuiiiiu(x64emu_t *emu, uintptr_t fcn) { vFuuuiiiiu_t fn = (vFuuuiiiiu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void vFuuuiuCil(x64emu_t *emu, uintptr_t fcn) { vFuuuiuCil_t fn = (vFuuuiuCil_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint8_t)R_R9, *(int32_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16)); } -void vFuuuipipp(x64emu_t *emu, uintptr_t fcn) { vFuuuipipp_t fn = (vFuuuipipp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFuuuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuuu_t fn = (vFuuuuuuuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void vFuuufffff(x64emu_t *emu, uintptr_t fcn) { vFuuufffff_t fn = (vFuuufffff_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0]); } -void vFffffffff(x64emu_t *emu, uintptr_t fcn) { vFffffffff_t fn = (vFffffffff_t)fcn; fn(emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0]); } -void vFpiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFpiiiiiii_t fn = (vFpiiiiiii_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFpiiiiiip(x64emu_t *emu, uintptr_t fcn) { vFpiiiiiip_t fn = (vFpiiiiiip_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFpiiiipii(x64emu_t *emu, uintptr_t fcn) { vFpiiiipii_t fn = (vFpiiiipii_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFpiUuupup(x64emu_t *emu, uintptr_t fcn) { vFpiUuupup_t fn = (vFpiUuupup_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFpippiiuu(x64emu_t *emu, uintptr_t fcn) { vFpippiiuu_t fn = (vFpippiiuu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void vFpippiipi(x64emu_t *emu, uintptr_t fcn) { vFpippiipi_t fn = (vFpippiipi_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFpuiULipp(x64emu_t *emu, uintptr_t fcn) { vFpuiULipp_t fn = (vFpuiULipp_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFpudddddd(x64emu_t *emu, uintptr_t fcn) { vFpudddddd_t fn = (vFpudddddd_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); } -void vFpuppippp(x64emu_t *emu, uintptr_t fcn) { vFpuppippp_t fn = (vFpuppippp_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFpuppLLLL(x64emu_t *emu, uintptr_t fcn) { vFpuppLLLL_t fn = (vFpuppLLLL_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); } -void vFpUiUiupi(x64emu_t *emu, uintptr_t fcn) { vFpUiUiupi_t fn = (vFpUiUiupi_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (int32_t)R_RDX, (uint64_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFpUuuUUUu(x64emu_t *emu, uintptr_t fcn) { vFpUuuUUUu_t fn = (vFpUuuUUUu_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint64_t)R_R8, (uint64_t)R_R9, *(uint64_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void vFpLppiipi(x64emu_t *emu, uintptr_t fcn) { vFpLppiipi_t fn = (vFpLppiipi_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFppiiiiii(x64emu_t *emu, uintptr_t fcn) { vFppiiiiii_t fn = (vFppiiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFppiiipii(x64emu_t *emu, uintptr_t fcn) { vFppiiipii_t fn = (vFppiiipii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFppipipiu(x64emu_t *emu, uintptr_t fcn) { vFppipipiu_t fn = (vFppipipiu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void vFppipppui(x64emu_t *emu, uintptr_t fcn) { vFppipppui_t fn = (vFppipppui_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFppippppi(x64emu_t *emu, uintptr_t fcn) { vFppippppi_t fn = (vFppippppi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFppippppp(x64emu_t *emu, uintptr_t fcn) { vFppippppp_t fn = (vFppippppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFppuuiiii(x64emu_t *emu, uintptr_t fcn) { vFppuuiiii_t fn = (vFppuuiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFppuppiii(x64emu_t *emu, uintptr_t fcn) { vFppuppiii_t fn = (vFppuppiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFppuppiiu(x64emu_t *emu, uintptr_t fcn) { vFppuppiiu_t fn = (vFppuppiiu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void vFpplppppi(x64emu_t *emu, uintptr_t fcn) { vFpplppppi_t fn = (vFpplppppi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFpplppppp(x64emu_t *emu, uintptr_t fcn) { vFpplppppp_t fn = (vFpplppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFppLpLpLp(x64emu_t *emu, uintptr_t fcn) { vFppLpLpLp_t fn = (vFppLpLpLp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFpppipppu(x64emu_t *emu, uintptr_t fcn) { vFpppipppu_t fn = (vFpppipppu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void vFpppuiiii(x64emu_t *emu, uintptr_t fcn) { vFpppuiiii_t fn = (vFpppuiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFppppiipi(x64emu_t *emu, uintptr_t fcn) { vFppppiipi_t fn = (vFppppiipi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFpppppuuu(x64emu_t *emu, uintptr_t fcn) { vFpppppuuu_t fn = (vFpppppuuu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void vFpppppppp(x64emu_t *emu, uintptr_t fcn) { vFpppppppp_t fn = (vFpppppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFEuipuupp(x64emu_t *emu, uintptr_t fcn) { iFEuipuupp_t fn = (iFEuipuupp_t)fcn; R_RAX=(int32_t)fn(emu, (uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFEpippppp(x64emu_t *emu, uintptr_t fcn) { iFEpippppp_t fn = (iFEpippppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFEpuuLppp(x64emu_t *emu, uintptr_t fcn) { iFEpuuLppp_t fn = (iFEpuuLppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFEpUUuppp(x64emu_t *emu, uintptr_t fcn) { iFEpUUuppp_t fn = (iFEpUUuppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFEppipppp(x64emu_t *emu, uintptr_t fcn) { iFEppipppp_t fn = (iFEppipppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFEppppipp(x64emu_t *emu, uintptr_t fcn) { iFEppppipp_t fn = (iFEppppipp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFiiiiiiip(x64emu_t *emu, uintptr_t fcn) { iFiiiiiiip_t fn = (iFiiiiiiip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFiiupiupi(x64emu_t *emu, uintptr_t fcn) { iFiiupiupi_t fn = (iFiiupiupi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void iFiuuCCuup(x64emu_t *emu, uintptr_t fcn) { iFiuuCCuup_t fn = (iFiuuCCuup_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFiuuuupip(x64emu_t *emu, uintptr_t fcn) { iFiuuuupip_t fn = (iFiuuuupip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFipippppp(x64emu_t *emu, uintptr_t fcn) { iFipippppp_t fn = (iFipippppp_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFuuuuuuuu(x64emu_t *emu, uintptr_t fcn) { iFuuuuuuuu_t fn = (iFuuuuuuuu_t)fcn; R_RAX=(int32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void iFdiippppL(x64emu_t *emu, uintptr_t fcn) { iFdiippppL_t fn = (iFdiippppL_t)fcn; R_RAX=(int32_t)fn(emu->xmm[0].d[0], (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8)); } -void iFpiiiuuup(x64emu_t *emu, uintptr_t fcn) { iFpiiiuuup_t fn = (iFpiiiuuup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpipiipip(x64emu_t *emu, uintptr_t fcn) { iFpipiipip_t fn = (iFpipiipip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpippuuii(x64emu_t *emu, uintptr_t fcn) { iFpippuuii_t fn = (iFpippuuii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void iFpippuupp(x64emu_t *emu, uintptr_t fcn) { iFpippuupp_t fn = (iFpippuupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpCCWWpWu(x64emu_t *emu, uintptr_t fcn) { iFpCCWWpWu_t fn = (iFpCCWWpWu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8, (void*)R_R9, *(uint16_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void iFpWCuWCuu(x64emu_t *emu, uintptr_t fcn) { iFpWCuWCuu_t fn = (iFpWCuWCuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (uint8_t)R_RDX, (uint32_t)R_RCX, (uint16_t)R_R8, (uint8_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void iFpuiipppp(x64emu_t *emu, uintptr_t fcn) { iFpuiipppp_t fn = (iFpuiipppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpuippLpp(x64emu_t *emu, uintptr_t fcn) { iFpuippLpp_t fn = (iFpuippLpp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpuuiiiii(x64emu_t *emu, uintptr_t fcn) { iFpuuiiiii_t fn = (iFpuuiiiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void iFpuuipppp(x64emu_t *emu, uintptr_t fcn) { iFpuuipppp_t fn = (iFpuuipppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpuuupupu(x64emu_t *emu, uintptr_t fcn) { iFpuuupupu_t fn = (iFpuuupupu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void iFpuupuupp(x64emu_t *emu, uintptr_t fcn) { iFpuupuupp_t fn = (iFpuupuupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpuuppiip(x64emu_t *emu, uintptr_t fcn) { iFpuuppiip_t fn = (iFpuuppiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpuuppppp(x64emu_t *emu, uintptr_t fcn) { iFpuuppppp_t fn = (iFpuuppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpupppppp(x64emu_t *emu, uintptr_t fcn) { iFpupppppp_t fn = (iFpupppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpUuuLpUu(x64emu_t *emu, uintptr_t fcn) { iFpUuuLpUu_t fn = (iFpUuuLpUu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint64_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uint64_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void iFpduuulul(x64emu_t *emu, uintptr_t fcn) { iFpduuulul_t fn = (iFpduuulul_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, emu->xmm[0].d[0], (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (intptr_t)R_R8, (uint32_t)R_R9, *(intptr_t*)(R_RSP + 8)); } -void iFpLLiippp(x64emu_t *emu, uintptr_t fcn) { iFpLLiippp_t fn = (iFpLLiippp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpLLLiipi(x64emu_t *emu, uintptr_t fcn) { iFpLLLiipi_t fn = (iFpLLLiipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void iFpLLppppp(x64emu_t *emu, uintptr_t fcn) { iFpLLppppp_t fn = (iFpLLppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpLpipppp(x64emu_t *emu, uintptr_t fcn) { iFpLpipppp_t fn = (iFpLpipppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpLppLpip(x64emu_t *emu, uintptr_t fcn) { iFpLppLpip_t fn = (iFpLppLpip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpLpppupu(x64emu_t *emu, uintptr_t fcn) { iFpLpppupu_t fn = (iFpLpppupu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void iFpLpppppp(x64emu_t *emu, uintptr_t fcn) { iFpLpppppp_t fn = (iFpLpppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFppiiipip(x64emu_t *emu, uintptr_t fcn) { iFppiiipip_t fn = (iFppiiipip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFppillppp(x64emu_t *emu, uintptr_t fcn) { iFppillppp_t fn = (iFppillppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFppippppp(x64emu_t *emu, uintptr_t fcn) { iFppippppp_t fn = (iFppippppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFppIIIppp(x64emu_t *emu, uintptr_t fcn) { iFppIIIppp_t fn = (iFppIIIppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX, (int64_t)R_RCX, (int64_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFppuiiuuu(x64emu_t *emu, uintptr_t fcn) { iFppuiiuuu_t fn = (iFppuiiuuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void iFppuuuuuu(x64emu_t *emu, uintptr_t fcn) { iFppuuuuuu_t fn = (iFppuuuuuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void iFppuppppp(x64emu_t *emu, uintptr_t fcn) { iFppuppppp_t fn = (iFppuppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpppiiipi(x64emu_t *emu, uintptr_t fcn) { iFpppiiipi_t fn = (iFpppiiipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void iFpppiiipp(x64emu_t *emu, uintptr_t fcn) { iFpppiiipp_t fn = (iFpppiiipp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpppipipi(x64emu_t *emu, uintptr_t fcn) { iFpppipipi_t fn = (iFpppipipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void iFppppiiup(x64emu_t *emu, uintptr_t fcn) { iFppppiiup_t fn = (iFppppiiup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFppppippp(x64emu_t *emu, uintptr_t fcn) { iFppppippp_t fn = (iFppppippp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpppppupp(x64emu_t *emu, uintptr_t fcn) { iFpppppupp_t fn = (iFpppppupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFppppppii(x64emu_t *emu, uintptr_t fcn) { iFppppppii_t fn = (iFppppppii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void iFpppppppi(x64emu_t *emu, uintptr_t fcn) { iFpppppppi_t fn = (iFpppppppi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void iFpppppppp(x64emu_t *emu, uintptr_t fcn) { iFpppppppp_t fn = (iFpppppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFbWWipppp(x64emu_t *emu, uintptr_t fcn) { iFbWWipppp_t fn = (iFbWWipppp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(int32_t)fn(aligned_xcb, (uint16_t)R_RSI, (uint16_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void iFbupppWWu(x64emu_t *emu, uintptr_t fcn) { iFbupppWWu_t fn = (iFbupppWWu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(int32_t)fn(aligned_xcb, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint16_t)R_R9, *(uint16_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void CFuiifpppp(x64emu_t *emu, uintptr_t fcn) { CFuiifpppp_t fn = (CFuiifpppp_t)fcn; R_RAX=(unsigned char)fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[0].f[0], (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFEipipppp(x64emu_t *emu, uintptr_t fcn) { uFEipipppp_t fn = (uFEipipppp_t)fcn; R_RAX=(uint32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFEpiupppp(x64emu_t *emu, uintptr_t fcn) { uFEpiupppp_t fn = (uFEpiupppp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFEppipppp(x64emu_t *emu, uintptr_t fcn) { uFEppipppp_t fn = (uFEppipppp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFEpppuppp(x64emu_t *emu, uintptr_t fcn) { uFEpppuppp_t fn = (uFEpppuppp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFEppppppp(x64emu_t *emu, uintptr_t fcn) { uFEppppppp_t fn = (uFEppppppp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFuipppppp(x64emu_t *emu, uintptr_t fcn) { uFuipppppp_t fn = (uFuipppppp_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void uFuupuuiuf(x64emu_t *emu, uintptr_t fcn) { uFuupuuiuf_t fn = (uFuupuuiuf_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), emu->xmm[0].f[0]); } -void uFulpppppp(x64emu_t *emu, uintptr_t fcn) { uFulpppppp_t fn = (uFulpppppp_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void uFpuupupuu(x64emu_t *emu, uintptr_t fcn) { uFpuupupuu_t fn = (uFpuupupuu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void uFpupuuuCp(x64emu_t *emu, uintptr_t fcn) { uFpupuuuCp_t fn = (uFpupuuuCp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint8_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void uFppuuuupp(x64emu_t *emu, uintptr_t fcn) { uFppuuuupp_t fn = (uFppuuuupp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void uFppuuuppu(x64emu_t *emu, uintptr_t fcn) { uFppuuuppu_t fn = (uFppuuuppu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void uFppuppppp(x64emu_t *emu, uintptr_t fcn) { uFppuppppp_t fn = (uFppuppppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void uFpppppupp(x64emu_t *emu, uintptr_t fcn) { uFpppppupp_t fn = (uFpppppupp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void uFbCuuuCup(x64emu_t *emu, uintptr_t fcn) { uFbCuuuCup_t fn = (uFbCuuuCup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint8_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void uFbWWWWWWp(x64emu_t *emu, uintptr_t fcn) { uFbWWWWWWp_t fn = (uFbWWWWWWp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8, (uint16_t)R_R9, *(uint16_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void LFELpupupu(x64emu_t *emu, uintptr_t fcn) { LFELpupupu_t fn = (LFELpupupu_t)fcn; R_RAX=(uintptr_t)fn(emu, (uintptr_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8)); } -void LFEpiupppp(x64emu_t *emu, uintptr_t fcn) { LFEpiupppp_t fn = (LFEpiupppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void LFpLpuuLLu(x64emu_t *emu, uintptr_t fcn) { LFpLpuuLLu_t fn = (LFpLpuuLLu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void pFEiplllpp(x64emu_t *emu, uintptr_t fcn) { pFEiplllpp_t fn = (pFEiplllpp_t)fcn; R_RAX=(uintptr_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFEipLLLpp(x64emu_t *emu, uintptr_t fcn) { pFEipLLLpp_t fn = (pFEipLLLpp_t)fcn; R_RAX=(uintptr_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFEpiuCppp(x64emu_t *emu, uintptr_t fcn) { pFEpiuCppp_t fn = (pFEpiuCppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (uint8_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFEppLiiip(x64emu_t *emu, uintptr_t fcn) { pFEppLiiip_t fn = (pFEppLiiip_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void pFEpppuipV(x64emu_t *emu, uintptr_t fcn) { pFEpppuipV_t fn = (pFEpppuipV_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, (void*)(R_RSP + 8)); } -void pFEpppppiV(x64emu_t *emu, uintptr_t fcn) { pFEpppppiV_t fn = (pFEpppppiV_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, (void*)(R_RSP + 8)); } -void pFEppppppi(x64emu_t *emu, uintptr_t fcn) { pFEppppppi_t fn = (pFEppppppi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8)); } -void pFEppppppp(x64emu_t *emu, uintptr_t fcn) { pFEppppppp_t fn = (pFEppppppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void pFiippipip(x64emu_t *emu, uintptr_t fcn) { pFiippipip_t fn = (pFiippipip_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFiupppppp(x64emu_t *emu, uintptr_t fcn) { pFiupppppp_t fn = (pFiupppppp_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFuiiiuuuu(x64emu_t *emu, uintptr_t fcn) { pFuiiiuuuu_t fn = (pFuiiiuuuu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void pFuCCCCpWw(x64emu_t *emu, uintptr_t fcn) { pFuCCCCpWw_t fn = (pFuCCCCpWw_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (void*)R_R9, *(uint16_t*)(R_RSP + 8), *(int16_t*)(R_RSP + 16)); } -void pFuupupipp(x64emu_t *emu, uintptr_t fcn) { pFuupupipp_t fn = (pFuupupipp_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFpiiiiiuu(x64emu_t *emu, uintptr_t fcn) { pFpiiiiiuu_t fn = (pFpiiiiiuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void pFpiiuuupp(x64emu_t *emu, uintptr_t fcn) { pFpiiuuupp_t fn = (pFpiiuuupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFpiUdiiUi(x64emu_t *emu, uintptr_t fcn) { pFpiUdiiUi_t fn = (pFpiUdiiUi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uint64_t)R_RDX, emu->xmm[0].d[0], (int32_t)R_RCX, (int32_t)R_R8, (uint64_t)R_R9, *(int32_t*)(R_RSP + 8)); } -void pFpipiiiip(x64emu_t *emu, uintptr_t fcn) { pFpipiiiip_t fn = (pFpipiiiip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFpuuuuupp(x64emu_t *emu, uintptr_t fcn) { pFpuuuuupp_t fn = (pFpuuuuupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFpuuuupup(x64emu_t *emu, uintptr_t fcn) { pFpuuuupup_t fn = (pFpuuuupup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFpupLLLpp(x64emu_t *emu, uintptr_t fcn) { pFpupLLLpp_t fn = (pFpupLLLpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFpupppppp(x64emu_t *emu, uintptr_t fcn) { pFpupppppp_t fn = (pFpupppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFplpppppp(x64emu_t *emu, uintptr_t fcn) { pFplpppppp_t fn = (pFplpppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFpLuLpLip(x64emu_t *emu, uintptr_t fcn) { pFpLuLpLip_t fn = (pFpLuLpLip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFpLpipLup(x64emu_t *emu, uintptr_t fcn) { pFpLpipLup_t fn = (pFpLpipLup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFpLpLLiLi(x64emu_t *emu, uintptr_t fcn) { pFpLpLLiLi_t fn = (pFpLpLLiLi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void pFpLppuLLp(x64emu_t *emu, uintptr_t fcn) { pFpLppuLLp_t fn = (pFpLppuLLp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFpLppLLiL(x64emu_t *emu, uintptr_t fcn) { pFpLppLLiL_t fn = (pFpLppLLiL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16)); } -void pFppiiiiii(x64emu_t *emu, uintptr_t fcn) { pFppiiiiii_t fn = (pFppiiiiii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void pFpppipipi(x64emu_t *emu, uintptr_t fcn) { pFpppipipi_t fn = (pFpppipipi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void pFppplippp(x64emu_t *emu, uintptr_t fcn) { pFppplippp_t fn = (pFppplippp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFppppuppp(x64emu_t *emu, uintptr_t fcn) { pFppppuppp_t fn = (pFppppuppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFpppppupp(x64emu_t *emu, uintptr_t fcn) { pFpppppupp_t fn = (pFpppppupp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFbCCuuwwC(x64emu_t *emu, uintptr_t fcn) { pFbCCuuwwC_t fn = (pFbCCuuwwC_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int16_t)R_R9, *(int16_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbCuwwWWu(x64emu_t *emu, uintptr_t fcn) { pFbCuwwWWu_t fn = (pFbCuwwWWu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (int16_t)R_RCX, (int16_t)R_R8, (uint16_t)R_R9, *(uint16_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbWWiCpup(x64emu_t *emu, uintptr_t fcn) { pFbWWiCpup_t fn = (pFbWWiCpup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint16_t)R_RSI, (uint16_t)R_RDX, (int32_t)R_RCX, (uint8_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuWWCuu(x64emu_t *emu, uintptr_t fcn) { pFbuuWWCuu_t fn = (pFbuuWWCuu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8, (uint8_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuupwwp(x64emu_t *emu, uintptr_t fcn) { pFbuuupwwp_t fn = (pFbuuupwwp_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (int16_t)R_R9, *(int16_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbdwwWWui(x64emu_t *emu, uintptr_t fcn) { pFbdwwWWui_t fn = (pFbdwwWWui_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, emu->xmm[0].d[0], (int16_t)R_RSI, (int16_t)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void iWEpuuiipp(x64emu_t *emu, uintptr_t fcn) { iWEpuuiipp_t fn = (iWEpuuiipp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void iWEpuuuipp(x64emu_t *emu, uintptr_t fcn) { iWEpuuuipp_t fn = (iWEpuuuipp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void iWpuipuppp(x64emu_t *emu, uintptr_t fcn) { iWpuipuppp_t fn = (iWpuipuppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64)); } -void vFEpiiiuipp(x64emu_t *emu, uintptr_t fcn) { vFEpiiiuipp_t fn = (vFEpiiiuipp_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFEpippippV(x64emu_t *emu, uintptr_t fcn) { vFEpippippV_t fn = (vFEpippippV_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), (void*)(R_RSP + 16)); } -void vFEpippippA(x64emu_t *emu, uintptr_t fcn) { vFEpippippA_t fn = (vFEpippippA_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFEpuuuippp(x64emu_t *emu, uintptr_t fcn) { vFEpuuuippp_t fn = (vFEpuuuippp_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFEppiipppp(x64emu_t *emu, uintptr_t fcn) { vFEppiipppp_t fn = (vFEppiipppp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFEpppiippp(x64emu_t *emu, uintptr_t fcn) { vFEpppiippp_t fn = (vFEpppiippp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFEppppippp(x64emu_t *emu, uintptr_t fcn) { vFEppppippp_t fn = (vFEppppippp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFiiiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiiii_t fn = (vFiiiiiiiii_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFiiiiiiill(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiill_t fn = (vFiiiiiiill_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(intptr_t*)(R_RSP + 24)); } -void vFiiiiillli(x64emu_t *emu, uintptr_t fcn) { vFiiiiillli_t fn = (vFiiiiillli_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFiiilllilp(x64emu_t *emu, uintptr_t fcn) { vFiiilllilp_t fn = (vFiiilllilp_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFiupuiuuup(x64emu_t *emu, uintptr_t fcn) { vFiupuiuuup_t fn = (vFiupuiuuup_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFiupuuuuup(x64emu_t *emu, uintptr_t fcn) { vFiupuuuuup_t fn = (vFiupuuuuup_t)fcn; fn((int32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFuiiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiii_t fn = (vFuiiiiiiii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFuiiiiiiiC(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiC_t fn = (vFuiiiiiiiC_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24)); } -void vFuiiiiiuip(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiuip_t fn = (vFuiiiiiuip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFuiiiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiuup_t fn = (vFuiiiiiuup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFuiuiiiiip(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiiip_t fn = (vFuiuiiiiip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFuiuiiiCuL(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiCuL_t fn = (vFuiuiiiCuL_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint8_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); } -void vFuiupuffup(x64emu_t *emu, uintptr_t fcn) { vFuiupuffup_t fn = (vFuiupuffup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, emu->xmm[0].f[0], emu->xmm[1].f[0], (uint32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFuuiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiii_t fn = (vFuuiiiiiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFuuiiiiiiC(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiC_t fn = (vFuuiiiiiiC_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24)); } -void vFuuiiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiuup_t fn = (vFuuiiiiuup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFuuiuiiiii(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiiii_t fn = (vFuuiuiiiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFuuiuiiiip(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiiip_t fn = (vFuuiuiiiip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFuuuiiiiCp(x64emu_t *emu, uintptr_t fcn) { vFuuuiiiiCp_t fn = (vFuuuiiiiCp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFuuuuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuuuu_t fn = (vFuuuuuuuuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); } -void vFuupuuiuuf(x64emu_t *emu, uintptr_t fcn) { vFuupuuiuuf_t fn = (vFuupuuiuuf_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), emu->xmm[0].f[0]); } -void vFuffffffff(x64emu_t *emu, uintptr_t fcn) { vFuffffffff_t fn = (vFuffffffff_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0]); } -void vFffCCCCfff(x64emu_t *emu, uintptr_t fcn) { vFffCCCCfff_t fn = (vFffCCCCfff_t)fcn; fn(emu->xmm[0].f[0], emu->xmm[1].f[0], (uint8_t)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0]); } -void vFddddddddd(x64emu_t *emu, uintptr_t fcn) { vFddddddddd_t fn = (vFddddddddd_t)fcn; fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0], emu->xmm[6].d[0], emu->xmm[7].d[0], *(double*)(R_RSP + 8)); } -void vFpiuippppi(x64emu_t *emu, uintptr_t fcn) { vFpiuippppi_t fn = (vFpiuippppi_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFpipiuiipp(x64emu_t *emu, uintptr_t fcn) { vFpipiuiipp_t fn = (vFpipiuiipp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFpipppiipi(x64emu_t *emu, uintptr_t fcn) { vFpipppiipi_t fn = (vFpipppiipi_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFpuuuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFpuuuuuuuu_t fn = (vFpuuuuuuuu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); } -void vFpLpppippp(x64emu_t *emu, uintptr_t fcn) { vFpLpppippp_t fn = (vFpLpppippp_t)fcn; fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFppiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFppiiiiiii_t fn = (vFppiiiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFppiiiiipi(x64emu_t *emu, uintptr_t fcn) { vFppiiiiipi_t fn = (vFppiiiiipi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFppiiiiupi(x64emu_t *emu, uintptr_t fcn) { vFppiiiiupi_t fn = (vFppiiiiupi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFppiiipiii(x64emu_t *emu, uintptr_t fcn) { vFppiiipiii_t fn = (vFppiiipiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFppiupiiii(x64emu_t *emu, uintptr_t fcn) { vFppiupiiii_t fn = (vFppiupiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFppippDpDC(x64emu_t *emu, uintptr_t fcn) { vFppippDpDC_t fn = (vFppippDpDC_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, LD2localLD((void*)(R_RSP + 8)), (void*)R_R9, LD2localLD((void*)(R_RSP + 24)), *(uint8_t*)(R_RSP + 40)); } -void vFppipppiii(x64emu_t *emu, uintptr_t fcn) { vFppipppiii_t fn = (vFppipppiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFppipppiip(x64emu_t *emu, uintptr_t fcn) { vFppipppiip_t fn = (vFppipppiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFppuippiip(x64emu_t *emu, uintptr_t fcn) { vFppuippiip_t fn = (vFppuippiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFppuuiiiii(x64emu_t *emu, uintptr_t fcn) { vFppuuiiiii_t fn = (vFppuuiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFppuuiiiiu(x64emu_t *emu, uintptr_t fcn) { vFppuuiiiiu_t fn = (vFppuuiiiiu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); } -void vFppuppiiii(x64emu_t *emu, uintptr_t fcn) { vFppuppiiii_t fn = (vFppuppiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFppupppiii(x64emu_t *emu, uintptr_t fcn) { vFppupppiii_t fn = (vFppupppiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFppupppiiu(x64emu_t *emu, uintptr_t fcn) { vFppupppiiu_t fn = (vFppupppiiu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); } -void vFppupppiip(x64emu_t *emu, uintptr_t fcn) { vFppupppiip_t fn = (vFppupppiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFppUUuUUUU(x64emu_t *emu, uintptr_t fcn) { vFppUUuUUUU_t fn = (vFppUUuUUUU_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint32_t)R_R8, (uint64_t)R_R9, *(uint64_t*)(R_RSP + 8), *(uint64_t*)(R_RSP + 16), *(uint64_t*)(R_RSP + 24)); } -void vFppddddudd(x64emu_t *emu, uintptr_t fcn) { vFppddddudd_t fn = (vFppddddudd_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], (uint32_t)R_RDX, emu->xmm[4].d[0], emu->xmm[5].d[0]); } -void vFpplpppppi(x64emu_t *emu, uintptr_t fcn) { vFpplpppppi_t fn = (vFpplpppppi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFpppiiiiii(x64emu_t *emu, uintptr_t fcn) { vFpppiiiiii_t fn = (vFpppiiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void vFpppffffff(x64emu_t *emu, uintptr_t fcn) { vFpppffffff_t fn = (vFpppffffff_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0]); } -void vFppppipiip(x64emu_t *emu, uintptr_t fcn) { vFppppipiip_t fn = (vFppppipiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFpppppippp(x64emu_t *emu, uintptr_t fcn) { vFpppppippp_t fn = (vFpppppippp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFEpiiiiipi(x64emu_t *emu, uintptr_t fcn) { iFEpiiiiipi_t fn = (iFEpiiiiipi_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void iFEppuppppp(x64emu_t *emu, uintptr_t fcn) { iFEppuppppp_t fn = (iFEppuppppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFEpppipppp(x64emu_t *emu, uintptr_t fcn) { iFEpppipppp_t fn = (iFEpppipppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFEppplPPPP(x64emu_t *emu, uintptr_t fcn) { iFEppplPPPP_t fn = (iFEppplPPPP_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void iFEpppppupp(x64emu_t *emu, uintptr_t fcn) { iFEpppppupp_t fn = (iFEpppppupp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFEppPPPPPP(x64emu_t *emu, uintptr_t fcn) { iFEppPPPPPP_t fn = (iFEppPPPPPP_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void iFiiiiiiiip(x64emu_t *emu, uintptr_t fcn) { iFiiiiiiiip_t fn = (iFiiiiiiiip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFiiiipiiip(x64emu_t *emu, uintptr_t fcn) { iFiiiipiiip_t fn = (iFiiiipiiip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFipiipippi(x64emu_t *emu, uintptr_t fcn) { iFipiipippi_t fn = (iFipiipippi_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void iFdddpppppp(x64emu_t *emu, uintptr_t fcn) { iFdddpppppp_t fn = (iFdddpppppp_t)fcn; R_RAX=(int32_t)fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFpipippppi(x64emu_t *emu, uintptr_t fcn) { iFpipippppi_t fn = (iFpipippppi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void iFpipLpiiip(x64emu_t *emu, uintptr_t fcn) { iFpipLpiiip_t fn = (iFpipLpiiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFpuuuuuuuu(x64emu_t *emu, uintptr_t fcn) { iFpuuuuuuuu_t fn = (iFpuuuuuuuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); } -void iFpuuuuduup(x64emu_t *emu, uintptr_t fcn) { iFpuuuuduup_t fn = (iFpuuuuduup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, emu->xmm[0].d[0], (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpuuuLiiip(x64emu_t *emu, uintptr_t fcn) { iFpuuuLiiip_t fn = (iFpuuuLiiip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFpuuuLpppp(x64emu_t *emu, uintptr_t fcn) { iFpuuuLpppp_t fn = (iFpuuuLpppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFpduuuLuLp(x64emu_t *emu, uintptr_t fcn) { iFpduuuLuLp_t fn = (iFpduuuLuLp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, emu->xmm[0].d[0], (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void iFpLiuiiLLL(x64emu_t *emu, uintptr_t fcn) { iFpLiuiiLLL_t fn = (iFpLiuiiLLL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); } -void iFpLLiiuuii(x64emu_t *emu, uintptr_t fcn) { iFpLLiiuuii_t fn = (iFpLLiiuuii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void iFpLpiiuuii(x64emu_t *emu, uintptr_t fcn) { iFpLpiiuuii_t fn = (iFpLpiiuuii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void iFpLpppupup(x64emu_t *emu, uintptr_t fcn) { iFpLpppupup_t fn = (iFpLpppupup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFpLppppppp(x64emu_t *emu, uintptr_t fcn) { iFpLppppppp_t fn = (iFpLppppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFppiiiiiii(x64emu_t *emu, uintptr_t fcn) { iFppiiiiiii_t fn = (iFppiiiiiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void iFppippippp(x64emu_t *emu, uintptr_t fcn) { iFppippippp_t fn = (iFppippippp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFppuLLpupp(x64emu_t *emu, uintptr_t fcn) { iFppuLLpupp_t fn = (iFppuLLpupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFppuppuuuu(x64emu_t *emu, uintptr_t fcn) { iFppuppuuuu_t fn = (iFppuppuuuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); } -void iFppupppupp(x64emu_t *emu, uintptr_t fcn) { iFppupppupp_t fn = (iFppupppupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFppLpiuppp(x64emu_t *emu, uintptr_t fcn) { iFppLpiuppp_t fn = (iFppLpiuppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFpppiiipip(x64emu_t *emu, uintptr_t fcn) { iFpppiiipip_t fn = (iFpppiiipip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFpppiiuuii(x64emu_t *emu, uintptr_t fcn) { iFpppiiuuii_t fn = (iFpppiiuuii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void iFpppiipiiu(x64emu_t *emu, uintptr_t fcn) { iFpppiipiiu_t fn = (iFpppiipiiu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); } -void iFpppippipi(x64emu_t *emu, uintptr_t fcn) { iFpppippipi_t fn = (iFpppippipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void iFpppLLLupp(x64emu_t *emu, uintptr_t fcn) { iFpppLLLupp_t fn = (iFpppLLLupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFpppLppupp(x64emu_t *emu, uintptr_t fcn) { iFpppLppupp_t fn = (iFpppLppupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFppppiiupp(x64emu_t *emu, uintptr_t fcn) { iFppppiiupp_t fn = (iFppppiiupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFpppppLupp(x64emu_t *emu, uintptr_t fcn) { iFpppppLupp_t fn = (iFpppppLupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFppppppupp(x64emu_t *emu, uintptr_t fcn) { iFppppppupp_t fn = (iFppppppupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFppppppppu(x64emu_t *emu, uintptr_t fcn) { iFppppppppu_t fn = (iFppppppppu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); } -void iFppppppppp(x64emu_t *emu, uintptr_t fcn) { iFppppppppp_t fn = (iFppppppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void uFEipippppp(x64emu_t *emu, uintptr_t fcn) { uFEipippppp_t fn = (uFEipippppp_t)fcn; R_RAX=(uint32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void uFEpppufppp(x64emu_t *emu, uintptr_t fcn) { uFEpppufppp_t fn = (uFEpppufppp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, emu->xmm[0].f[0], (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void uFuulpiuiuf(x64emu_t *emu, uintptr_t fcn) { uFuulpiuiuf_t fn = (uFuulpiuiuf_t)fcn; R_RAX=(uint32_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), emu->xmm[0].f[0]); } -void uFpuupuppuu(x64emu_t *emu, uintptr_t fcn) { uFpuupuppuu_t fn = (uFpuupuppuu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); } -void uFppLpLuppp(x64emu_t *emu, uintptr_t fcn) { uFppLpLuppp_t fn = (uFppLpLuppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void uFppppppppp(x64emu_t *emu, uintptr_t fcn) { uFppppppppp_t fn = (uFppppppppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void lFpppipiipp(x64emu_t *emu, uintptr_t fcn) { lFpppipiipp_t fn = (lFpppipiipp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void lFpppippppp(x64emu_t *emu, uintptr_t fcn) { lFpppippppp_t fn = (lFpppippppp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void LFEppppppii(x64emu_t *emu, uintptr_t fcn) { LFEppppppii_t fn = (LFEppppppii_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void LFpLiiuuuLL(x64emu_t *emu, uintptr_t fcn) { LFpLiiuuuLL_t fn = (LFpLiiuuuLL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); } -void pFEppiiuuLi(x64emu_t *emu, uintptr_t fcn) { pFEppiiuuLi_t fn = (pFEppiiuuLi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void pFEppuippuu(x64emu_t *emu, uintptr_t fcn) { pFEppuippuu_t fn = (pFEppuippuu_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16)); } -void pFEpppppiiV(x64emu_t *emu, uintptr_t fcn) { pFEpppppiiV_t fn = (pFEpppppiiV_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), (void*)(R_RSP + 16)); } -void pFEpppppppi(x64emu_t *emu, uintptr_t fcn) { pFEpppppppi_t fn = (pFEpppppppi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void pFEpppppppp(x64emu_t *emu, uintptr_t fcn) { pFEpppppppp_t fn = (pFEpppppppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void pFuupuuuuuu(x64emu_t *emu, uintptr_t fcn) { pFuupuuuuuu_t fn = (pFuupuuuuuu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); } -void pFpiiiiuuuu(x64emu_t *emu, uintptr_t fcn) { pFpiiiiuuuu_t fn = (pFpiiiiuuuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); } -void pFpLpLLipui(x64emu_t *emu, uintptr_t fcn) { pFpLpLLipui_t fn = (pFpLpLLipui_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void pFpLppLLiLi(x64emu_t *emu, uintptr_t fcn) { pFpLppLLiLi_t fn = (pFpLppLLiLi_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void pFppiiiiiip(x64emu_t *emu, uintptr_t fcn) { pFppiiiiiip_t fn = (pFppiiiiiip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void pFppipppppp(x64emu_t *emu, uintptr_t fcn) { pFppipppppp_t fn = (pFppipppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void pFpppiiiiii(x64emu_t *emu, uintptr_t fcn) { pFpppiiiiii_t fn = (pFpppiiiiii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24)); } -void pFpppuipppp(x64emu_t *emu, uintptr_t fcn) { pFpppuipppp_t fn = (pFpppuipppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void pFpppppiipp(x64emu_t *emu, uintptr_t fcn) { pFpppppiipp_t fn = (pFpppppiipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void pFbiiCpWWup(x64emu_t *emu, uintptr_t fcn) { pFbiiCpWWup_t fn = (pFbiiCpWWup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (int32_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (void*)R_R8, (uint16_t)R_R9, *(uint16_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbCuWCCuuu(x64emu_t *emu, uintptr_t fcn) { pFbCuWCCuuu_t fn = (pFbCuWCCuuu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuwwWWww(x64emu_t *emu, uintptr_t fcn) { pFbuuwwWWww_t fn = (pFbuuwwWWww_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (int16_t)R_RCX, (int16_t)R_R8, (uint16_t)R_R9, *(uint16_t*)(R_RSP + 8), *(int16_t*)(R_RSP + 16), *(int16_t*)(R_RSP + 24)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbupuuuuup(x64emu_t *emu, uintptr_t fcn) { pFbupuuuuup_t fn = (pFbupuuuuup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbppppuuCC(x64emu_t *emu, uintptr_t fcn) { pFbppppuuCC_t fn = (pFbppppuuCC_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void iWEpuuiippu(x64emu_t *emu, uintptr_t fcn) { iWEpuuiippu_t fn = (iWEpuuiippu_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(uint32_t*)(R_RSP + 64)); } -void iWEpuuuiipp(x64emu_t *emu, uintptr_t fcn) { iWEpuuuiipp_t fn = (iWEpuuuiipp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64)); } -void iWpiuuupipu(x64emu_t *emu, uintptr_t fcn) { iWpiuuupipu_t fn = (iWpiuuupipu_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (int32_t)R_RDX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(void**)(R_RSP + 64), *(uint32_t*)(R_RSP + 72)); } -void iWpuiuuipip(x64emu_t *emu, uintptr_t fcn) { iWpuiuuipip_t fn = (iWpuiuuipip_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(void**)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(void**)(R_RSP + 72)); } -void iWppppupiii(x64emu_t *emu, uintptr_t fcn) { iWppppupiii_t fn = (iWppppupiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RCX, (void*)R_RDX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(int32_t*)(R_RSP + 72)); } -void vFEiippppppp(x64emu_t *emu, uintptr_t fcn) { vFEiippppppp_t fn = (vFEiippppppp_t)fcn; fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFEpippppppp(x64emu_t *emu, uintptr_t fcn) { vFEpippppppp_t fn = (vFEpippppppp_t)fcn; fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFEpppiipppp(x64emu_t *emu, uintptr_t fcn) { vFEpppiipppp_t fn = (vFEpppiipppp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void vFiiiiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiiiii_t fn = (vFiiiiiiiiii_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void vFiiiiiiiiiu(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiiiiu_t fn = (vFiiiiiiiiiu_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); } -void vFiiiiiiiiui(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiiiui_t fn = (vFiiiiiiiiui_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void vFiiiiiiiiuu(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiiiuu_t fn = (vFiiiiiiiiuu_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); } -void vFiiillliiip(x64emu_t *emu, uintptr_t fcn) { vFiiillliiip_t fn = (vFiiillliiip_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void vFuiiiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiii_t fn = (vFuiiiiiiiii_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void vFuiiiiiiiip(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiip_t fn = (vFuiiiiiiiip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void vFuiiiiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiuup_t fn = (vFuiiiiiiuup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void vFuiuiiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiiuup_t fn = (vFuiuiiiiuup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void vFuuiiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiii_t fn = (vFuuiiiiiiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void vFuuiiiiiuip(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiuip_t fn = (vFuuiiiiiuip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void vFuuiiiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiuup_t fn = (vFuuiiiiiuup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void vFuuiuiiiiip(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiiiip_t fn = (vFuuiuiiiiip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void vFuuuuuuuCCC(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuuCCC_t fn = (vFuuuuuuuCCC_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24), *(uint8_t*)(R_RSP + 32)); } -void vFuuuuuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuuuuu_t fn = (vFuuuuuuuuuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); } -void vFuupuiupuuf(x64emu_t *emu, uintptr_t fcn) { vFuupuiupuuf_t fn = (vFuupuiupuuf_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), emu->xmm[0].f[0]); } -void vFuffiiffiip(x64emu_t *emu, uintptr_t fcn) { vFuffiiffiip_t fn = (vFuffiiffiip_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[2].f[0], emu->xmm[3].f[0], (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFuddiiddiip(x64emu_t *emu, uintptr_t fcn) { vFuddiiddiip_t fn = (vFuddiiddiip_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[2].d[0], emu->xmm[3].d[0], (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } -void vFffffffffff(x64emu_t *emu, uintptr_t fcn) { vFffffffffff_t fn = (vFffffffffff_t)fcn; fn(emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8), *(float*)(R_RSP + 16)); } -void vFpiuippppip(x64emu_t *emu, uintptr_t fcn) { vFpiuippppip_t fn = (vFpiuippppip_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void vFpuupuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFpuupuuuuuu_t fn = (vFpuupuuuuuu_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); } -void vFppiiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFppiiiiiiii_t fn = (vFppiiiiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void vFppiiiiipip(x64emu_t *emu, uintptr_t fcn) { vFppiiiiipip_t fn = (vFppiiiiipip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void vFppiiiiupip(x64emu_t *emu, uintptr_t fcn) { vFppiiiiupip_t fn = (vFppiiiiupip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void vFppiippppii(x64emu_t *emu, uintptr_t fcn) { vFppiippppii_t fn = (vFppiippppii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void vFppuipppiip(x64emu_t *emu, uintptr_t fcn) { vFppuipppiip_t fn = (vFppuipppiip_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void vFppuuuiiiii(x64emu_t *emu, uintptr_t fcn) { vFppuuuiiiii_t fn = (vFppuuuiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void vFppuuuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFppuuuuuuuu_t fn = (vFppuuuuuuuu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); } -void vFppuuppiiii(x64emu_t *emu, uintptr_t fcn) { vFppuuppiiii_t fn = (vFppuuppiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void vFppuuppppii(x64emu_t *emu, uintptr_t fcn) { vFppuuppppii_t fn = (vFppuuppppii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void vFppuppuiiii(x64emu_t *emu, uintptr_t fcn) { vFppuppuiiii_t fn = (vFppuppuiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void vFppupppiiii(x64emu_t *emu, uintptr_t fcn) { vFppupppiiii_t fn = (vFppupppiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void vFppdddddddd(x64emu_t *emu, uintptr_t fcn) { vFppdddddddd_t fn = (vFppdddddddd_t)fcn; fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0], emu->xmm[6].d[0], emu->xmm[7].d[0]); } -void vFppppppppii(x64emu_t *emu, uintptr_t fcn) { vFppppppppii_t fn = (vFppppppppii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void vFpppppppppp(x64emu_t *emu, uintptr_t fcn) { vFpppppppppp_t fn = (vFpppppppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void iFEpiiiiippp(x64emu_t *emu, uintptr_t fcn) { iFEpiiiiippp_t fn = (iFEpiiiiippp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFEpupppLppL(x64emu_t *emu, uintptr_t fcn) { iFEpupppLppL_t fn = (iFEpupppLppL_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24)); } -void iFEppppppipp(x64emu_t *emu, uintptr_t fcn) { iFEppppppipp_t fn = (iFEppppppipp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void iFiiiiiiiiip(x64emu_t *emu, uintptr_t fcn) { iFiiiiiiiiip_t fn = (iFiiiiiiiiip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void iFpiipiiipip(x64emu_t *emu, uintptr_t fcn) { iFpiipiiipip_t fn = (iFpiipiiipip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void iFpippddiidd(x64emu_t *emu, uintptr_t fcn) { iFpippddiidd_t fn = (iFpippddiidd_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_R8, (int32_t)R_R9, emu->xmm[2].d[0], emu->xmm[3].d[0]); } -void iFpCuWCCCCup(x64emu_t *emu, uintptr_t fcn) { iFpCuWCCCCup_t fn = (iFpCuWCCCCup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(uint8_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void iFpuuLiuiiLL(x64emu_t *emu, uintptr_t fcn) { iFpuuLiuiiLL_t fn = (iFpuuLiuiiLL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32)); } -void iFpLLpiiuuii(x64emu_t *emu, uintptr_t fcn) { iFpLLpiiuuii_t fn = (iFpLLpiiuuii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void iFpLpLUUUUpL(x64emu_t *emu, uintptr_t fcn) { iFpLpLUUUUpL_t fn = (iFpLpLUUUUpL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uint64_t)R_R8, (uint64_t)R_R9, *(uint64_t*)(R_RSP + 8), *(uint64_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32)); } -void iFppuuiiiiii(x64emu_t *emu, uintptr_t fcn) { iFppuuiiiiii_t fn = (iFppuuiiiiii_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void iFppuuiiuupi(x64emu_t *emu, uintptr_t fcn) { iFppuuiiuupi_t fn = (iFppuuiiuupi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void iFpppiiipipi(x64emu_t *emu, uintptr_t fcn) { iFpppiiipipi_t fn = (iFpppiiipipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void iFpppLLipppp(x64emu_t *emu, uintptr_t fcn) { iFpppLLipppp_t fn = (iFpppLLipppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void iFpppppiiuup(x64emu_t *emu, uintptr_t fcn) { iFpppppiiuup_t fn = (iFpppppiiuup_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void iFpppppppipi(x64emu_t *emu, uintptr_t fcn) { iFpppppppipi_t fn = (iFpppppppipi_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void iFpppppppppu(x64emu_t *emu, uintptr_t fcn) { iFpppppppppu_t fn = (iFpppppppppu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); } -void uFpddpippppp(x64emu_t *emu, uintptr_t fcn) { uFpddpippppp_t fn = (uFpddpippppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void uFpppppppppp(x64emu_t *emu, uintptr_t fcn) { uFpppppppppp_t fn = (uFpppppppppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void lFpLppdddddd(x64emu_t *emu, uintptr_t fcn) { lFpLppdddddd_t fn = (lFpLppdddddd_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], emu->xmm[4].d[0], emu->xmm[5].d[0]); } -void pFEiippppppp(x64emu_t *emu, uintptr_t fcn) { pFEiippppppp_t fn = (pFEiippppppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void pFEpiiiiiipp(x64emu_t *emu, uintptr_t fcn) { pFEpiiiiiipp_t fn = (pFEpiiiiiipp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void pFEpippppppp(x64emu_t *emu, uintptr_t fcn) { pFEpippppppp_t fn = (pFEpippppppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24)); } -void pFpupLLLLLpp(x64emu_t *emu, uintptr_t fcn) { pFpupLLLLLpp_t fn = (pFpupLLLLLpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void pFplllllllll(x64emu_t *emu, uintptr_t fcn) { pFplllllllll_t fn = (pFplllllllll_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (intptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(intptr_t*)(R_RSP + 24), *(intptr_t*)(R_RSP + 32)); } -void pFppippLLLip(x64emu_t *emu, uintptr_t fcn) { pFppippLLLip_t fn = (pFppippLLLip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void pFppuiipuuii(x64emu_t *emu, uintptr_t fcn) { pFppuiipuuii_t fn = (pFppuiipuuii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void pFppuuLLuppp(x64emu_t *emu, uintptr_t fcn) { pFppuuLLuppp_t fn = (pFppuuLLuppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uintptr_t)R_R8, (uintptr_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void pFpppiiiiiii(x64emu_t *emu, uintptr_t fcn) { pFpppiiiiiii_t fn = (pFpppiiiiiii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void pFpppppppppp(x64emu_t *emu, uintptr_t fcn) { pFpppppppppp_t fn = (pFpppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void pFbCuWCCuuCW(x64emu_t *emu, uintptr_t fcn) { pFbCuWCCuuCW_t fn = (pFbCuWCCuuCW_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24), *(uint16_t*)(R_RSP + 32)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuwwWWuCuu(x64emu_t *emu, uintptr_t fcn) { pFbuwwWWuCuu_t fn = (pFbuwwWWuCuu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (int16_t)R_RDX, (int16_t)R_RCX, (uint16_t)R_R8, (uint16_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuuwwwwWW(x64emu_t *emu, uintptr_t fcn) { pFbuuuwwwwWW_t fn = (pFbuuuwwwwWW_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int16_t)R_R8, (int16_t)R_R9, *(int16_t*)(R_RSP + 8), *(int16_t*)(R_RSP + 16), *(uint16_t*)(R_RSP + 24), *(uint16_t*)(R_RSP + 32)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuuWWWCCi(x64emu_t *emu, uintptr_t fcn) { pFbuuuWWWCCi_t fn = (pFbuuuWWWCCi_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint16_t)R_R8, (uint16_t)R_R9, *(uint16_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void iWEpuipupppp(x64emu_t *emu, uintptr_t fcn) { iWEpuipupppp_t fn = (iWEpuipupppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); } -void iWEpuuiiuipp(x64emu_t *emu, uintptr_t fcn) { iWEpuuiiuipp_t fn = (iWEpuuiiuipp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); } -void iWEpuuuuiipp(x64emu_t *emu, uintptr_t fcn) { iWEpuuuuiipp_t fn = (iWEpuuuuiipp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); } -void vFEpuuuupupup(x64emu_t *emu, uintptr_t fcn) { vFEpuuuupupup_t fn = (vFEpuuuupupup_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void vFiiiiillliip(x64emu_t *emu, uintptr_t fcn) { vFiiiiillliip_t fn = (vFiiiiillliip_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void vFiiiiilllilp(x64emu_t *emu, uintptr_t fcn) { vFiiiiilllilp_t fn = (vFiiiiilllilp_t)fcn; fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void vFuiiiiiiiiip(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiiip_t fn = (vFuiiiiiiiiip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void vFuiiiiiiiuip(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiuip_t fn = (vFuiiiiiiiuip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void vFuiiiiiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiuup_t fn = (vFuiiiiiiiuup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void vFuiiiillliip(x64emu_t *emu, uintptr_t fcn) { vFuiiiillliip_t fn = (vFuiiiillliip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (intptr_t)R_R9, *(intptr_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void vFuiuiiiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiiiuup_t fn = (vFuiuiiiiiuup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void vFuuiiiiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiuup_t fn = (vFuuiiiiiiuup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void vFuuupupppppp(x64emu_t *emu, uintptr_t fcn) { vFuuupupppppp_t fn = (vFuuupupppppp_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void vFuuffiiffiip(x64emu_t *emu, uintptr_t fcn) { vFuuffiiffiip_t fn = (vFuuffiiffiip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], (int32_t)R_RDX, (int32_t)R_RCX, emu->xmm[2].f[0], emu->xmm[3].f[0], (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFuufffffffff(x64emu_t *emu, uintptr_t fcn) { vFuufffffffff_t fn = (vFuufffffffff_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8)); } -void vFuuddiiddiip(x64emu_t *emu, uintptr_t fcn) { vFuuddiiddiip_t fn = (vFuuddiiddiip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RDX, (int32_t)R_RCX, emu->xmm[2].d[0], emu->xmm[3].d[0], (int32_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8)); } -void vFuffffffffff(x64emu_t *emu, uintptr_t fcn) { vFuffffffffff_t fn = (vFuffffffffff_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8), *(float*)(R_RSP + 16)); } -void vFuLuuuuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFuLuuuuuuuuu_t fn = (vFuLuuuuuuuuu_t)fcn; fn((uint32_t)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40)); } -void vFLufffffffff(x64emu_t *emu, uintptr_t fcn) { vFLufffffffff_t fn = (vFLufffffffff_t)fcn; fn((uintptr_t)R_RDI, (uint32_t)R_RSI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8)); } -void vFpipipiipiii(x64emu_t *emu, uintptr_t fcn) { vFpipipiipiii_t fn = (vFpipipiipiii_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); } -void vFpipppiiiipi(x64emu_t *emu, uintptr_t fcn) { vFpipppiiiipi_t fn = (vFpipppiiiipi_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); } -void vFpupuuupupup(x64emu_t *emu, uintptr_t fcn) { vFpupuuupupup_t fn = (vFpupuuupupup_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void vFppiiiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFppiiiiiiiii_t fn = (vFppiiiiiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); } -void vFppiiiiipiii(x64emu_t *emu, uintptr_t fcn) { vFppiiiiipiii_t fn = (vFppiiiiipiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); } -void vFppiiiiupiii(x64emu_t *emu, uintptr_t fcn) { vFppiiiiupiii_t fn = (vFppiiiiupiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); } -void vFppiiiiddddi(x64emu_t *emu, uintptr_t fcn) { vFppiiiiddddi_t fn = (vFppiiiiddddi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], *(int32_t*)(R_RSP + 8)); } -void vFppiipppiiii(x64emu_t *emu, uintptr_t fcn) { vFppiipppiiii_t fn = (vFppiipppiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); } -void vFppuuiiiiuii(x64emu_t *emu, uintptr_t fcn) { vFppuuiiiiuii_t fn = (vFppuuiiiiuii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); } -void vFppuuppiiiiu(x64emu_t *emu, uintptr_t fcn) { vFppuuppiiiiu_t fn = (vFppuuppiiiiu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40)); } -void vFppuupppiiii(x64emu_t *emu, uintptr_t fcn) { vFppuupppiiii_t fn = (vFppuupppiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); } -void vFppupipiuuuu(x64emu_t *emu, uintptr_t fcn) { vFppupipiuuuu_t fn = (vFppupipiuuuu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40)); } -void vFppupppuiiii(x64emu_t *emu, uintptr_t fcn) { vFppupppuiiii_t fn = (vFppupppuiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); } -void vFppppppppppp(x64emu_t *emu, uintptr_t fcn) { vFppppppppppp_t fn = (vFppppppppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void iFEiipppppppp(x64emu_t *emu, uintptr_t fcn) { iFEiipppppppp_t fn = (iFEiipppppppp_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void iFEpppipppppp(x64emu_t *emu, uintptr_t fcn) { iFEpppipppppp_t fn = (iFEpppipppppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void iFEppppiiiiuu(x64emu_t *emu, uintptr_t fcn) { iFEppppiiiiuu_t fn = (iFEppppiiiiuu_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32)); } -void iFEpppppppppp(x64emu_t *emu, uintptr_t fcn) { iFEpppppppppp_t fn = (iFEpppppppppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void iFiiiiiiiiiip(x64emu_t *emu, uintptr_t fcn) { iFiiiiiiiiiip_t fn = (iFiiiiiiiiiip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void iFpiippiiipip(x64emu_t *emu, uintptr_t fcn) { iFpiippiiipip_t fn = (iFpiippiiipip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void iFpippupppppp(x64emu_t *emu, uintptr_t fcn) { iFpippupppppp_t fn = (iFpippupppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void iFpuppppppppp(x64emu_t *emu, uintptr_t fcn) { iFpuppppppppp_t fn = (iFpuppppppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void iFpLipiiiippp(x64emu_t *emu, uintptr_t fcn) { iFpLipiiiippp_t fn = (iFpLipiiiippp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void iFpLLpiiuuiiL(x64emu_t *emu, uintptr_t fcn) { iFpLLpiiuuiiL_t fn = (iFpLLpiiuuiiL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40)); } -void iFppippipppip(x64emu_t *emu, uintptr_t fcn) { iFppippipppip_t fn = (iFppippipppip_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void iFppuppLLpupp(x64emu_t *emu, uintptr_t fcn) { iFppuppLLpupp_t fn = (iFppuppLLpupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void iFpppiiuuiiuu(x64emu_t *emu, uintptr_t fcn) { iFpppiiuuiiuu_t fn = (iFpppiiuuiiuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40)); } -void iFpppppiiuupp(x64emu_t *emu, uintptr_t fcn) { iFpppppiiuupp_t fn = (iFpppppiiuupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void uFEpLiupppLuV(x64emu_t *emu, uintptr_t fcn) { uFEpLiupppLuV_t fn = (uFEpLiupppLuV_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), (void*)(R_RSP + 32)); } -void uFEpLippppLup(x64emu_t *emu, uintptr_t fcn) { uFEpLippppLup_t fn = (uFEpLippppLup_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void uFEpLippppLuA(x64emu_t *emu, uintptr_t fcn) { uFEpLippppLuA_t fn = (uFEpLippppLuA_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void uFEppppppippp(x64emu_t *emu, uintptr_t fcn) { uFEppppppippp_t fn = (uFEppppppippp_t)fcn; R_RAX=(uint32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void uFppppppppppp(x64emu_t *emu, uintptr_t fcn) { uFppppppppppp_t fn = (uFppppppppppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void pFEpipppppppi(x64emu_t *emu, uintptr_t fcn) { pFEpipppppppi_t fn = (pFEpipppppppi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void pFEppiiLpppip(x64emu_t *emu, uintptr_t fcn) { pFEppiiLpppip_t fn = (pFEppiiLpppip_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } -void pFEppuiipuuii(x64emu_t *emu, uintptr_t fcn) { pFEppuiipuuii_t fn = (pFEppuiipuuii_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } -void pFpppppppuipp(x64emu_t *emu, uintptr_t fcn) { pFpppppppuipp_t fn = (pFpppppppuipp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void pFppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFppppppppppp_t fn = (pFppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void iWEpuipuppppp(x64emu_t *emu, uintptr_t fcn) { iWEpuipuppppp_t fn = (iWEpuipuppppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (uint32_t)R_RDX, (int32_t)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80)); } -void iWEpuuiiuippu(x64emu_t *emu, uintptr_t fcn) { iWEpuuiiuippu_t fn = (iWEpuuiiuippu_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(uint32_t*)(R_RSP + 80)); } -void iWEpuuuuuiipp(x64emu_t *emu, uintptr_t fcn) { iWEpuuuuuiipp_t fn = (iWEpuuuuuiipp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RCX, (uint32_t)R_RDX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80)); } -void vFuiiiiiiiiuLC(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiiuLC_t fn = (vFuiiiiiiiiuLC_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40), *(uint8_t*)(R_RSP + 48)); } -void vFuiiiiiiiuuip(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiuuip_t fn = (vFuiiiiiiiuuip_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void vFuuiiiiiiiiui(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiiiui_t fn = (vFuuiiiiiiiiui_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); } -void vFuuiiiiiiiiuu(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiiiuu_t fn = (vFuuiiiiiiiiuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48)); } -void vFuuiiiiiiiuip(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiiuip_t fn = (vFuuiiiiiiiuip_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void vFuuiiiiiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiiuup_t fn = (vFuuiiiiiiiuup_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void vFuuuuuuuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuuuuuuu_t fn = (vFuuuuuuuuuuuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48)); } -void vFffffffffffff(x64emu_t *emu, uintptr_t fcn) { vFffffffffffff_t fn = (vFffffffffffff_t)fcn; fn(emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8), *(float*)(R_RSP + 16), *(float*)(R_RSP + 24), *(float*)(R_RSP + 32)); } -void vFpipppiiiipii(x64emu_t *emu, uintptr_t fcn) { vFpipppiiiipii_t fn = (vFpipppiiiipii_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); } -void vFpippppiiiipi(x64emu_t *emu, uintptr_t fcn) { vFpippppiiiipi_t fn = (vFpippppiiiipi_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); } -void vFpupppppppppp(x64emu_t *emu, uintptr_t fcn) { vFpupppppppppp_t fn = (vFpupppppppppp_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void vFppiiiiddddii(x64emu_t *emu, uintptr_t fcn) { vFppiiiiddddii_t fn = (vFppiiiiddddii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16)); } -void vFppiiuuuiupup(x64emu_t *emu, uintptr_t fcn) { vFppiiuuuiupup_t fn = (vFppiiuuuiupup_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void vFppiipppiiiii(x64emu_t *emu, uintptr_t fcn) { vFppiipppiiiii_t fn = (vFppiipppiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); } -void vFppuuppuiiiii(x64emu_t *emu, uintptr_t fcn) { vFppuuppuiiiii_t fn = (vFppuuppuiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); } -void vFppuupppiiiiu(x64emu_t *emu, uintptr_t fcn) { vFppuupppiiiiu_t fn = (vFppuupppiiiiu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48)); } -void vFpppiiiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFpppiiiiiiiii_t fn = (vFpppiiiiiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); } -void vFpppiiiiiiuii(x64emu_t *emu, uintptr_t fcn) { vFpppiiiiiiuii_t fn = (vFpppiiiiiiuii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48)); } -void vFpppppppppppp(x64emu_t *emu, uintptr_t fcn) { vFpppppppppppp_t fn = (vFpppppppppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void iFEpppippppppp(x64emu_t *emu, uintptr_t fcn) { iFEpppippppppp_t fn = (iFEpppippppppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void iFEppppiiiiuui(x64emu_t *emu, uintptr_t fcn) { iFEppppiiiiuui_t fn = (iFEppppiiiiuui_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); } -void iFpipllipppppp(x64emu_t *emu, uintptr_t fcn) { iFpipllipppppp_t fn = (iFpipllipppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void iFpipppppppppp(x64emu_t *emu, uintptr_t fcn) { iFpipppppppppp_t fn = (iFpipppppppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void iFpCCCWCWCCCWp(x64emu_t *emu, uintptr_t fcn) { iFpCCCWCWCCCWp_t fn = (iFpCCCWCWCCCWp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (uint8_t)R_RDX, (uint8_t)R_RCX, (uint16_t)R_R8, (uint8_t)R_R9, *(uint16_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24), *(uint8_t*)(R_RSP + 32), *(uint16_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void iFpLLlliLppppp(x64emu_t *emu, uintptr_t fcn) { iFpLLlliLppppp_t fn = (iFpLLlliLppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void iFpppllipppppp(x64emu_t *emu, uintptr_t fcn) { iFpppllipppppp_t fn = (iFpppllipppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (intptr_t)R_RCX, (intptr_t)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void iFpppppppppppp(x64emu_t *emu, uintptr_t fcn) { iFpppppppppppp_t fn = (iFpppppppppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void pFEppiiuuuipii(x64emu_t *emu, uintptr_t fcn) { pFEppiiuuuipii_t fn = (pFEppiiuuuipii_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40)); } -void pFEppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFEppppppppppp_t fn = (pFEppppppppppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40)); } -void pFWWiCCCCiipup(x64emu_t *emu, uintptr_t fcn) { pFWWiCCCCiipup_t fn = (pFWWiCCCCiipup_t)fcn; R_RAX=(uintptr_t)fn((uint16_t)R_RDI, (uint16_t)R_RSI, (int32_t)R_RDX, (uint8_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(uint8_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void pFppiiuuuiupLp(x64emu_t *emu, uintptr_t fcn) { pFppiiuuuiupLp_t fn = (pFppiiuuuiupLp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(uintptr_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void pFppippLLLiLpp(x64emu_t *emu, uintptr_t fcn) { pFppippLLLiLpp_t fn = (pFppippLLLiLpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void pFppuuppppuppp(x64emu_t *emu, uintptr_t fcn) { pFppuuppppuppp_t fn = (pFppuuppppuppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void pFpppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFpppppppppppp_t fn = (pFpppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void pFbCuuWWwwCCup(x64emu_t *emu, uintptr_t fcn) { pFbCuuWWwwCCup_t fn = (pFbCuuWWwwCCup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint16_t)R_R8, (uint16_t)R_R9, *(int16_t*)(R_RSP + 8), *(int16_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24), *(uint8_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFbuuuWWWWWWWW(x64emu_t *emu, uintptr_t fcn) { pFbuuuWWWWWWWW_t fn = (pFbuuuWWWWWWWW_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint16_t)R_R8, (uint16_t)R_R9, *(uint16_t*)(R_RSP + 8), *(uint16_t*)(R_RSP + 16), *(uint16_t*)(R_RSP + 24), *(uint16_t*)(R_RSP + 32), *(uint16_t*)(R_RSP + 40), *(uint16_t*)(R_RSP + 48)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void vFEpppppppiippp(x64emu_t *emu, uintptr_t fcn) { vFEpppppppiippp_t fn = (vFEpppppppiippp_t)fcn; fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48)); } -void vFuiiiiiiiiiuup(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiiiuup_t fn = (vFuiiiiiiiiiuup_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void vFuuuuuuuuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuuuuuuuu_t fn = (vFuuuuuuuuuuuuu_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56)); } -void vFuffffffffffff(x64emu_t *emu, uintptr_t fcn) { vFuffffffffffff_t fn = (vFuffffffffffff_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8), *(float*)(R_RSP + 16), *(float*)(R_RSP + 24), *(float*)(R_RSP + 32)); } -void vFuLuuuuuuuuuuu(x64emu_t *emu, uintptr_t fcn) { vFuLuuuuuuuuuuu_t fn = (vFuLuuuuuuuuuuu_t)fcn; fn((uint32_t)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56)); } -void vFpipppiiiiiiuu(x64emu_t *emu, uintptr_t fcn) { vFpipppiiiiiiuu_t fn = (vFpipppiiiiiiuu_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56)); } -void vFpippppppppppp(x64emu_t *emu, uintptr_t fcn) { vFpippppppppppp_t fn = (vFpippppppppppp_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void vFpuppppppppppp(x64emu_t *emu, uintptr_t fcn) { vFpuppppppppppp_t fn = (vFpuppppppppppp_t)fcn; fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void vFppiiiiiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFppiiiiiiiiiii_t fn = (vFppiiiiiiiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56)); } -void vFppiiiiiiuiuii(x64emu_t *emu, uintptr_t fcn) { vFppiiiiiiuiuii_t fn = (vFppiiiiiiuiuii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56)); } -void vFppuuppiiiiuii(x64emu_t *emu, uintptr_t fcn) { vFppuuppiiiiuii_t fn = (vFppuuppiiiiuii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56)); } -void vFppuupppuiiiii(x64emu_t *emu, uintptr_t fcn) { vFppuupppuiiiii_t fn = (vFppuupppuiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56)); } -void vFppppppppppppp(x64emu_t *emu, uintptr_t fcn) { vFppppppppppppp_t fn = (vFppppppppppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void iFddddpppddpppp(x64emu_t *emu, uintptr_t fcn) { iFddddpppddpppp_t fn = (iFddddpppddpppp_t)fcn; R_RAX=(int32_t)fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, emu->xmm[4].d[0], emu->xmm[5].d[0], (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } -void iFpippuuuiipppp(x64emu_t *emu, uintptr_t fcn) { iFpippuuuiipppp_t fn = (iFpippuuuiipppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void iFpupiiiipppppp(x64emu_t *emu, uintptr_t fcn) { iFpupiiiipppppp_t fn = (iFpupiiiipppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void iFppppppLLLLupp(x64emu_t *emu, uintptr_t fcn) { iFppppppLLLLupp_t fn = (iFppppppLLLLupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void uFippuuuulllipp(x64emu_t *emu, uintptr_t fcn) { uFippuuuulllipp_t fn = (uFippuuuulllipp_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(intptr_t*)(R_RSP + 16), *(intptr_t*)(R_RSP + 24), *(intptr_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void uFpppppuupppppp(x64emu_t *emu, uintptr_t fcn) { uFpppppuupppppp_t fn = (uFpppppuupppppp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void uFbCuuwwWWWWuup(x64emu_t *emu, uintptr_t fcn) { uFbCuuwwWWWWuup_t fn = (uFbCuuwwWWWWuup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int16_t)R_R8, (int16_t)R_R9, *(uint16_t*)(R_RSP + 8), *(uint16_t*)(R_RSP + 16), *(uint16_t*)(R_RSP + 24), *(uint16_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(void**)(R_RSP + 56)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFpuupppwwwwWWC(x64emu_t *emu, uintptr_t fcn) { pFpuupppwwwwWWC_t fn = (pFpuupppwwwwWWC_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int16_t*)(R_RSP + 8), *(int16_t*)(R_RSP + 16), *(int16_t*)(R_RSP + 24), *(int16_t*)(R_RSP + 32), *(uint16_t*)(R_RSP + 40), *(uint16_t*)(R_RSP + 48), *(uint8_t*)(R_RSP + 56)); } -void pFppLppppiiLpip(x64emu_t *emu, uintptr_t fcn) { pFppLppppiiLpip_t fn = (pFppLppppiiLpip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void pFpppppppuipppp(x64emu_t *emu, uintptr_t fcn) { pFpppppppuipppp_t fn = (pFpppppppuipppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void pFppppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFppppppppppppp_t fn = (pFppppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56)); } -void vFippppppppppppp(x64emu_t *emu, uintptr_t fcn) { vFippppppppppppp_t fn = (vFippppppppppppp_t)fcn; fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64)); } -void vFuffiiffiiffiip(x64emu_t *emu, uintptr_t fcn) { vFuffiiffiiffiip_t fn = (vFuffiiffiiffiip_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].f[0], emu->xmm[1].f[0], (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[2].f[0], emu->xmm[3].f[0], (int32_t)R_RCX, (int32_t)R_R8, emu->xmm[4].f[0], emu->xmm[5].f[0], (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFuddiiddiiddiip(x64emu_t *emu, uintptr_t fcn) { vFuddiiddiiddiip_t fn = (vFuddiiddiiddiip_t)fcn; fn((uint32_t)R_RDI, emu->xmm[0].d[0], emu->xmm[1].d[0], (int32_t)R_RSI, (int32_t)R_RDX, emu->xmm[2].d[0], emu->xmm[3].d[0], (int32_t)R_RCX, (int32_t)R_R8, emu->xmm[4].d[0], emu->xmm[5].d[0], (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16)); } -void vFppiipppiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFppiipppiiiiiii_t fn = (vFppiipppiiiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64)); } -void vFppuupppiiiiuii(x64emu_t *emu, uintptr_t fcn) { vFppuupppiiiiuii_t fn = (vFppuupppiiiiuii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64)); } -void iFpipppppppppppp(x64emu_t *emu, uintptr_t fcn) { iFpipppppppppppp_t fn = (iFpipppppppppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64)); } -void iFppupppLLLLpupp(x64emu_t *emu, uintptr_t fcn) { iFppupppLLLLpupp_t fn = (iFppupppLLLLpupp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(uintptr_t*)(R_RSP + 8), *(uintptr_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64)); } -void iFpppwwWWwwWWpuu(x64emu_t *emu, uintptr_t fcn) { iFpppwwWWwwWWpuu_t fn = (iFpppwwWWwwWWpuu_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int16_t)R_RCX, (int16_t)R_R8, (uint16_t)R_R9, *(uint16_t*)(R_RSP + 8), *(int16_t*)(R_RSP + 16), *(int16_t*)(R_RSP + 24), *(uint16_t*)(R_RSP + 32), *(uint16_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(uint32_t*)(R_RSP + 56), *(uint32_t*)(R_RSP + 64)); } -void pFbpCpppwwwwwwWW(x64emu_t *emu, uintptr_t fcn) { pFbpCpppwwwwwwWW_t fn = (pFbpCpppwwwwwwWW_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (void*)R_RSI, (uint8_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(int16_t*)(R_RSP + 8), *(int16_t*)(R_RSP + 16), *(int16_t*)(R_RSP + 24), *(int16_t*)(R_RSP + 32), *(int16_t*)(R_RSP + 40), *(int16_t*)(R_RSP + 48), *(uint16_t*)(R_RSP + 56), *(uint16_t*)(R_RSP + 64)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void vFuiiiiiuiiiiilll(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiuiiiiilll_t fn = (vFuiiiiiuiiiiilll_t)fcn; fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(intptr_t*)(R_RSP + 56), *(intptr_t*)(R_RSP + 64), *(intptr_t*)(R_RSP + 72)); } -void vFuuiiiiuuiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiuuiiiiiii_t fn = (vFuuiiiiuuiiiiiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(int32_t*)(R_RSP + 72)); } -void vFfffffffffffffff(x64emu_t *emu, uintptr_t fcn) { vFfffffffffffffff_t fn = (vFfffffffffffffff_t)fcn; fn(emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0], emu->xmm[3].f[0], emu->xmm[4].f[0], emu->xmm[5].f[0], emu->xmm[6].f[0], emu->xmm[7].f[0], *(float*)(R_RSP + 8), *(float*)(R_RSP + 16), *(float*)(R_RSP + 24), *(float*)(R_RSP + 32), *(float*)(R_RSP + 40), *(float*)(R_RSP + 48), *(float*)(R_RSP + 56)); } -void vFpUUUUUUUUUUUuuu(x64emu_t *emu, uintptr_t fcn) { vFpUUUUUUUUUUUuuu_t fn = (vFpUUUUUUUUUUUuuu_t)fcn; fn((void*)R_RDI, (uint64_t)R_RSI, (uint64_t)R_RDX, (uint64_t)R_RCX, (uint64_t)R_R8, (uint64_t)R_R9, *(uint64_t*)(R_RSP + 8), *(uint64_t*)(R_RSP + 16), *(uint64_t*)(R_RSP + 24), *(uint64_t*)(R_RSP + 32), *(uint64_t*)(R_RSP + 40), *(uint64_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56), *(uint32_t*)(R_RSP + 64), *(uint32_t*)(R_RSP + 72)); } -void vFpppippppppppppp(x64emu_t *emu, uintptr_t fcn) { vFpppippppppppppp_t fn = (vFpppippppppppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); } -void vFppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { vFppppppppppppppp_t fn = (vFppppppppppppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); } -void pFpuiippppppppppp(x64emu_t *emu, uintptr_t fcn) { pFpuiippppppppppp_t fn = (pFpuiippppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); } -void pFppipppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFppipppppppppppp_t fn = (pFppipppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); } -void pFppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFppppppppppppppp_t fn = (pFppppppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72)); } -void vFpppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { vFpppppppppppppppp_t fn = (vFpppppppppppppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80)); } -void iFpppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { iFpppppppppppppppp_t fn = (iFpppppppppppppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80)); } -void pFppipipipipipipip(x64emu_t *emu, uintptr_t fcn) { pFppipipipipipipip_t fn = (pFppipipipipipipip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(void**)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(void**)(R_RSP + 64), *(int32_t*)(R_RSP + 72), *(void**)(R_RSP + 80)); } -void pFpppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFpppppppppppppppp_t fn = (pFpppppppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80)); } -void pFbuuWWWWWWwwCCCuu(x64emu_t *emu, uintptr_t fcn) { pFbuuWWWWWWwwCCCuu_t fn = (pFbuuWWWWWWwwCCCuu_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX, (uint16_t)R_R8, (uint16_t)R_R9, *(uint16_t*)(R_RSP + 8), *(uint16_t*)(R_RSP + 16), *(uint16_t*)(R_RSP + 24), *(int16_t*)(R_RSP + 32), *(int16_t*)(R_RSP + 40), *(uint8_t*)(R_RSP + 48), *(uint8_t*)(R_RSP + 56), *(uint8_t*)(R_RSP + 64), *(uint32_t*)(R_RSP + 72), *(uint32_t*)(R_RSP + 80)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void vFuuuiiiiiuiiiiilll(x64emu_t *emu, uintptr_t fcn) { vFuuuiiiiiuiiiiilll_t fn = (vFuuuiiiiiuiiiiilll_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(intptr_t*)(R_RSP + 72), *(intptr_t*)(R_RSP + 80), *(intptr_t*)(R_RSP + 88)); } -void vFuuuuiiiiuuiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFuuuuiiiiuuiiiiiii_t fn = (vFuuuuiiiiuuiiiiiii_t)fcn; fn((uint32_t)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(int32_t*)(R_RSP + 72), *(int32_t*)(R_RSP + 80), *(int32_t*)(R_RSP + 88)); } -void vFppiiiiddddiiiiiuu(x64emu_t *emu, uintptr_t fcn) { vFppiiiiddddiiiiiuu_t fn = (vFppiiiiddddiiiiiuu_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0], emu->xmm[3].d[0], *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56)); } -void vFpppuppiipppuUUUpi(x64emu_t *emu, uintptr_t fcn) { vFpppuppiipppuUUUpi_t fn = (vFpppuppiipppuUUUpi_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint64_t*)(R_RSP + 56), *(uint64_t*)(R_RSP + 64), *(uint64_t*)(R_RSP + 72), *(void**)(R_RSP + 80), *(int32_t*)(R_RSP + 88)); } -void pFppippipipipipipip(x64emu_t *emu, uintptr_t fcn) { pFppippipipipipipip_t fn = (pFppippipipipipipip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8, (int32_t)R_R9, *(void**)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(void**)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(void**)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(void**)(R_RSP + 72), *(int32_t*)(R_RSP + 80), *(void**)(R_RSP + 88)); } -void pFbuuuuuwwuuuuUUUup(x64emu_t *emu, uintptr_t fcn) { pFbuuuuuwwuuuuUUUup_t fn = (pFbuuuuuwwuuuuUUUup_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uintptr_t)fn(aligned_xcb, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(int16_t*)(R_RSP + 8), *(int16_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(uint32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint64_t*)(R_RSP + 56), *(uint64_t*)(R_RSP + 64), *(uint64_t*)(R_RSP + 72), *(uint32_t*)(R_RSP + 80), *(void**)(R_RSP + 88)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void vFppuiiiiipuiiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFppuiiiiipuiiiiiiii_t fn = (vFppuiiiiipuiiiiiiii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(void**)(R_RSP + 24), *(uint32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(int32_t*)(R_RSP + 72), *(int32_t*)(R_RSP + 80), *(int32_t*)(R_RSP + 88), *(int32_t*)(R_RSP + 96)); } -void vFpppipppppppppppppp(x64emu_t *emu, uintptr_t fcn) { vFpppipppppppppppppp_t fn = (vFpppipppppppppppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96)); } -void iFpppppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { iFpppppppppppppppppp_t fn = (iFpppppppppppppppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96)); } -void LFpppppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { LFpppppppppppppppppp_t fn = (LFpppppppppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96)); } -void pFippppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFippppppppppppppppp_t fn = (pFippppppppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96)); } -void pFpupppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFpupppppppppppppppp_t fn = (pFpupppppppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96)); } -void vFpiiiiiiiiiiiiiiiiii(x64emu_t *emu, uintptr_t fcn) { vFpiiiiiiiiiiiiiiiiii_t fn = (vFpiiiiiiiiiiiiiiiiii_t)fcn; fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(int32_t*)(R_RSP + 48), *(int32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(int32_t*)(R_RSP + 72), *(int32_t*)(R_RSP + 80), *(int32_t*)(R_RSP + 88), *(int32_t*)(R_RSP + 96), *(int32_t*)(R_RSP + 104)); } -void uFbWWWCCCCCCCCWCCCCCC(x64emu_t *emu, uintptr_t fcn) { uFbWWWCCCCCCCCWCCCCCC_t fn = (uFbWWWCCCCCCCCWCCCCCC_t)fcn; void *aligned_xcb = align_xcb_connection((void*)R_RDI); R_RAX=(uint32_t)fn(aligned_xcb, (uint16_t)R_RSI, (uint16_t)R_RDX, (uint16_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(uint8_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(uint8_t*)(R_RSP + 24), *(uint8_t*)(R_RSP + 32), *(uint8_t*)(R_RSP + 40), *(uint8_t*)(R_RSP + 48), *(uint16_t*)(R_RSP + 56), *(uint8_t*)(R_RSP + 64), *(uint8_t*)(R_RSP + 72), *(uint8_t*)(R_RSP + 80), *(uint8_t*)(R_RSP + 88), *(uint8_t*)(R_RSP + 96), *(uint8_t*)(R_RSP + 104)); unalign_xcb_connection(aligned_xcb, (void*)R_RDI); } -void pFiiiippppppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFiiiippppppppppppppp_t fn = (pFiiiippppppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104)); } -void pFpippppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFpippppppppppppppppp_t fn = (pFpippppppppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104)); } -void pFpupupppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFpupupppppppppppppppp_t fn = (pFpupupppppppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112)); } -void iFpppppppppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { iFpppppppppppppppppppppp_t fn = (iFpppppppppppppppppppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128)); } -void uFippuuuuiiiiuuiiiiiiiipp(x64emu_t *emu, uintptr_t fcn) { uFippuuuuiiiiuuiiiiiiiipp_t fn = (uFippuuuuiiiiuuiiiiiiiipp_t)fcn; R_RAX=(uint32_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32), *(int32_t*)(R_RSP + 40), *(uint32_t*)(R_RSP + 48), *(uint32_t*)(R_RSP + 56), *(int32_t*)(R_RSP + 64), *(int32_t*)(R_RSP + 72), *(int32_t*)(R_RSP + 80), *(int32_t*)(R_RSP + 88), *(int32_t*)(R_RSP + 96), *(int32_t*)(R_RSP + 104), *(int32_t*)(R_RSP + 112), *(int32_t*)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136)); } -void vFpppppppppppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { vFpppppppppppppppppppppppp_t fn = (vFpppppppppppppppppppppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144)); } -void pFpupuupppppppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { pFpupuupppppppppppppppppppp_t fn = (pFpupuupppppppppppppppppppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152)); } -void iFpppppppppppppppppppppppppppppppppp(x64emu_t *emu, uintptr_t fcn) { iFpppppppppppppppppppppppppppppppppp_t fn = (iFpppppppppppppppppppppppppppppppppp_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(void**)(R_RSP + 32), *(void**)(R_RSP + 40), *(void**)(R_RSP + 48), *(void**)(R_RSP + 56), *(void**)(R_RSP + 64), *(void**)(R_RSP + 72), *(void**)(R_RSP + 80), *(void**)(R_RSP + 88), *(void**)(R_RSP + 96), *(void**)(R_RSP + 104), *(void**)(R_RSP + 112), *(void**)(R_RSP + 120), *(void**)(R_RSP + 128), *(void**)(R_RSP + 136), *(void**)(R_RSP + 144), *(void**)(R_RSP + 152), *(void**)(R_RSP + 160), *(void**)(R_RSP + 168), *(void**)(R_RSP + 176), *(void**)(R_RSP + 184), *(void**)(R_RSP + 192), *(void**)(R_RSP + 200), *(void**)(R_RSP + 208), *(void**)(R_RSP + 216), *(void**)(R_RSP + 224)); } - -#if defined(HAVE_LD80BITS) -void DFD(x64emu_t *emu, uintptr_t fcn) { DFD_t fn = (DFD_t)fcn; long double ld=fn(LD2localLD((void*)(R_RSP + 8))); fpu_do_push(emu); ST0val = ld; } -void DFY(x64emu_t *emu, uintptr_t fcn) { DFY_t fn = (DFY_t)fcn; long double ld=fn(to_complexl(emu, R_RSP + 8)); fpu_do_push(emu); ST0val = ld; } -void lFD(x64emu_t *emu, uintptr_t fcn) { lFD_t fn = (lFD_t)fcn; R_RAX=(intptr_t)fn(LD2localLD((void*)(R_RSP + 8))); } -void YFY(x64emu_t *emu, uintptr_t fcn) { YFY_t fn = (YFY_t)fcn; from_complexl(emu, fn(to_complexl(emu, R_RSP + 8))); } -void IFED(x64emu_t *emu, uintptr_t fcn) { IFED_t fn = (IFED_t)fcn; R_RAX=(int64_t)fn(emu, LD2localLD((void*)(R_RSP + 8))); } -void DFiD(x64emu_t *emu, uintptr_t fcn) { DFiD_t fn = (DFiD_t)fcn; long double ld=fn((int32_t)R_RDI, LD2localLD((void*)(R_RSP + 8))); fpu_do_push(emu); ST0val = ld; } -void lFDD(x64emu_t *emu, uintptr_t fcn) { lFDD_t fn = (lFDD_t)fcn; R_RAX=(intptr_t)fn(LD2localLD((void*)(R_RSP + 8)), LD2localLD((void*)(R_RSP + 24))); } -void YFYY(x64emu_t *emu, uintptr_t fcn) { YFYY_t fn = (YFYY_t)fcn; from_complexl(emu, fn(to_complexl(emu, R_RSP + 8), to_complexl(emu, R_RSP + 40))); } -void vFDpp(x64emu_t *emu, uintptr_t fcn) { vFDpp_t fn = (vFDpp_t)fcn; fn(LD2localLD((void*)(R_RSP + 8)), (void*)R_RDI, (void*)R_RSI); } -void DFDDD(x64emu_t *emu, uintptr_t fcn) { DFDDD_t fn = (DFDDD_t)fcn; long double ld=fn(LD2localLD((void*)(R_RSP + 8)), LD2localLD((void*)(R_RSP + 24)), LD2localLD((void*)(R_RSP + 40))); fpu_do_push(emu); ST0val = ld; } -#endif - -#if !defined(HAVE_LD80BITS) -void KFK(x64emu_t *emu, uintptr_t fcn) { KFK_t fn = (KFK_t)fcn; double db=fn(FromLD((void*)(R_RSP + 8))); fpu_do_push(emu); ST0val = db; } -void KFy(x64emu_t *emu, uintptr_t fcn) { KFy_t fn = (KFy_t)fcn; double db=fn(to_complexk(emu, R_RSP + 8)); fpu_do_push(emu); ST0val = db; } -void lFK(x64emu_t *emu, uintptr_t fcn) { lFK_t fn = (lFK_t)fcn; R_RAX=(intptr_t)fn(FromLD((void*)(R_RSP + 8))); } -void yFy(x64emu_t *emu, uintptr_t fcn) { yFy_t fn = (yFy_t)fcn; from_complexk(emu, fn(to_complexk(emu, R_RSP + 8))); } -void IFEK(x64emu_t *emu, uintptr_t fcn) { IFEK_t fn = (IFEK_t)fcn; R_RAX=(int64_t)fn(emu, FromLD((void*)(R_RSP + 8))); } -void KFiK(x64emu_t *emu, uintptr_t fcn) { KFiK_t fn = (KFiK_t)fcn; double db=fn((int32_t)R_RDI, FromLD((void*)(R_RSP + 8))); fpu_do_push(emu); ST0val = db; } -void KFKK(x64emu_t *emu, uintptr_t fcn) { KFKK_t fn = (KFKK_t)fcn; double db=fn(FromLD((void*)(R_RSP + 8)), FromLD((void*)(R_RSP + 24))); fpu_do_push(emu); ST0val = db; } -void KFKp(x64emu_t *emu, uintptr_t fcn) { KFKp_t fn = (KFKp_t)fcn; double db=fn(FromLD((void*)(R_RSP + 8)), (void*)R_RDI); fpu_do_push(emu); ST0val = db; } -void lFKK(x64emu_t *emu, uintptr_t fcn) { lFKK_t fn = (lFKK_t)fcn; R_RAX=(intptr_t)fn(FromLD((void*)(R_RSP + 8)), FromLD((void*)(R_RSP + 24))); } -void yFyy(x64emu_t *emu, uintptr_t fcn) { yFyy_t fn = (yFyy_t)fcn; from_complexk(emu, fn(to_complexk(emu, R_RSP + 8), to_complexk(emu, R_RSP + 40))); } -void vFKpp(x64emu_t *emu, uintptr_t fcn) { vFKpp_t fn = (vFKpp_t)fcn; fn(FromLD((void*)(R_RSP + 8)), (void*)R_RDI, (void*)R_RSI); } -void KFKKK(x64emu_t *emu, uintptr_t fcn) { KFKKK_t fn = (KFKKK_t)fcn; double db=fn(FromLD((void*)(R_RSP + 8)), FromLD((void*)(R_RSP + 24)), FromLD((void*)(R_RSP + 40))); fpu_do_push(emu); ST0val = db; } -#endif - -#if defined(NOALIGN) -void iFipiip(x64emu_t *emu, uintptr_t fcn) { iFipiip_t fn = (iFipiip_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -#endif - -#if !defined(NOALIGN) -void iFEppu(x64emu_t *emu, uintptr_t fcn) { iFEppu_t fn = (iFEppu_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } -void iFEiiip(x64emu_t *emu, uintptr_t fcn) { iFEiiip_t fn = (iFEiiip_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } -void iFEipii(x64emu_t *emu, uintptr_t fcn) { iFEipii_t fn = (iFEipii_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } -void iFEipiip(x64emu_t *emu, uintptr_t fcn) { iFEipiip_t fn = (iFEipiip_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } -#endif - -#if !defined(STATICBUILD) -void iFlip(x64emu_t *emu, uintptr_t fcn) { iFlip_t fn = (iFlip_t)fcn; R_RAX=(int32_t)fn((intptr_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } -void iFLLi(x64emu_t *emu, uintptr_t fcn) { iFLLi_t fn = (iFLLi_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); } -void iFLLiW(x64emu_t *emu, uintptr_t fcn) { iFLLiW_t fn = (iFLLiW_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uint16_t)R_RCX); } -void iFEipup(x64emu_t *emu, uintptr_t fcn) { iFEipup_t fn = (iFEipup_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } -void iFEiipup(x64emu_t *emu, uintptr_t fcn) { iFEiipup_t fn = (iFEiipup_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); } -void iFpipppL(x64emu_t *emu, uintptr_t fcn) { iFpipppL_t fn = (iFpipppL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); } -#endif - -void vFEv(x64emu_t *emu, uintptr_t fcn) { vFE_t fn = (vFE_t)fcn; fn(emu); } -void iFEv(x64emu_t *emu, uintptr_t fcn) { iFE_t fn = (iFE_t)fcn; R_RAX=(int32_t)fn(emu); } -void lFEv(x64emu_t *emu, uintptr_t fcn) { lFE_t fn = (lFE_t)fcn; R_RAX=(intptr_t)fn(emu); } -void pFEv(x64emu_t *emu, uintptr_t fcn) { pFE_t fn = (pFE_t)fcn; R_RAX=(uintptr_t)fn(emu); } -void iFEvpp(x64emu_t *emu, uintptr_t fcn) { iFEpp_t fn = (iFEpp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RSI, (void*)R_RDX); } -void pFEppv(x64emu_t *emu, uintptr_t fcn) { pFEpp_t fn = (pFEpp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI); } -void iFEpvpp(x64emu_t *emu, uintptr_t fcn) { iFEppp_t fn = (iFEppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RDX, (void*)R_RCX); } -void iFEpvvppp(x64emu_t *emu, uintptr_t fcn) { iFEpppp_t fn = (iFEpppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } -void iFEpuvvppp(x64emu_t *emu, uintptr_t fcn) { iFEpuppp_t fn = (iFEpuppp_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); } - -#if defined(ARM64) -int isSimpleWrapper(wrapper_t fun) { - if (fun == &vFv) return 1; - if (fun == &vFc) return 1; - if (fun == &vFw) return 1; - if (fun == &vFi) return 1; - if (fun == &vFC) return 1; - if (fun == &vFW) return 1; - if (fun == &vFu) return 1; - if (fun == &vFU) return 1; - if (fun == &vFf) return 2; - if (fun == &vFd) return 2; - if (fun == &vFl) return 1; - if (fun == &vFL) return 1; - if (fun == &vFp) return 1; - if (fun == &cFv) return 1; - if (fun == &cFi) return 1; - if (fun == &cFu) return 1; - if (fun == &cFf) return 2; - if (fun == &cFp) return 1; - if (fun == &wFp) return 1; - if (fun == &iFv) return 1; - if (fun == &iFw) return 1; - if (fun == &iFi) return 1; - if (fun == &iFI) return 1; - if (fun == &iFC) return 1; - if (fun == &iFW) return 1; - if (fun == &iFu) return 1; - if (fun == &iFU) return 1; - if (fun == &iFf) return 2; - if (fun == &iFd) return 2; - if (fun == &iFl) return 1; - if (fun == &iFL) return 1; - if (fun == &iFp) return 1; - if (fun == &IFv) return 1; - if (fun == &IFi) return 1; - if (fun == &IFI) return 1; - if (fun == &IFf) return 2; - if (fun == &IFd) return 2; - if (fun == &IFp) return 1; - if (fun == &CFv) return 1; - if (fun == &CFi) return 1; - if (fun == &CFC) return 1; - if (fun == &CFW) return 1; - if (fun == &CFu) return 1; - if (fun == &CFl) return 1; - if (fun == &CFL) return 1; - if (fun == &CFp) return 1; - if (fun == &WFi) return 1; - if (fun == &WFW) return 1; - if (fun == &WFu) return 1; - if (fun == &WFp) return 1; - if (fun == &uFv) return 1; - if (fun == &uFi) return 1; - if (fun == &uFu) return 1; - if (fun == &uFd) return 2; - if (fun == &uFl) return 1; - if (fun == &uFL) return 1; - if (fun == &uFp) return 1; - if (fun == &UFv) return 1; - if (fun == &UFu) return 1; - if (fun == &UFp) return 1; - if (fun == &fFi) return -1; - if (fun == &fFf) return -2; - if (fun == &fFp) return -1; - if (fun == &dFv) return -1; - if (fun == &dFi) return -1; - if (fun == &dFu) return -1; - if (fun == &dFd) return -2; - if (fun == &dFL) return -1; - if (fun == &dFp) return -1; - if (fun == &lFv) return 1; - if (fun == &lFi) return 1; - if (fun == &lFu) return 1; - if (fun == &lFl) return 1; - if (fun == &lFp) return 1; - if (fun == &LFv) return 1; - if (fun == &LFi) return 1; - if (fun == &LFu) return 1; - if (fun == &LFd) return 2; - if (fun == &LFL) return 1; - if (fun == &LFp) return 1; - if (fun == &pFv) return 1; - if (fun == &pFw) return 1; - if (fun == &pFi) return 1; - if (fun == &pFC) return 1; - if (fun == &pFW) return 1; - if (fun == &pFu) return 1; - if (fun == &pFU) return 1; - if (fun == &pFd) return 2; - if (fun == &pFl) return 1; - if (fun == &pFL) return 1; - if (fun == &pFp) return 1; - if (fun == &vFcc) return 1; - if (fun == &vFww) return 1; - if (fun == &vFii) return 1; - if (fun == &vFiW) return 1; - if (fun == &vFiu) return 1; - if (fun == &vFiU) return 1; - if (fun == &vFif) return 2; - if (fun == &vFid) return 2; - if (fun == &vFil) return 1; - if (fun == &vFiL) return 1; - if (fun == &vFip) return 1; - if (fun == &vFWW) return 1; - if (fun == &vFWp) return 1; - if (fun == &vFuc) return 1; - if (fun == &vFuw) return 1; - if (fun == &vFui) return 1; - if (fun == &vFuC) return 1; - if (fun == &vFuW) return 1; - if (fun == &vFuu) return 1; - if (fun == &vFuU) return 1; - if (fun == &vFuf) return 2; - if (fun == &vFud) return 2; - if (fun == &vFul) return 1; - if (fun == &vFuL) return 1; - if (fun == &vFup) return 1; - if (fun == &vFUi) return 1; - if (fun == &vFfi) return 2; - if (fun == &vFfC) return 2; - if (fun == &vFff) return 3; - if (fun == &vFfp) return 2; - if (fun == &vFdd) return 3; - if (fun == &vFlu) return 1; - if (fun == &vFlp) return 1; - if (fun == &vFLu) return 1; - if (fun == &vFLL) return 1; - if (fun == &vFLp) return 1; - if (fun == &vFpc) return 1; - if (fun == &vFpi) return 1; - if (fun == &vFpI) return 1; - if (fun == &vFpC) return 1; - if (fun == &vFpW) return 1; - if (fun == &vFpu) return 1; - if (fun == &vFpU) return 1; - if (fun == &vFpf) return 2; - if (fun == &vFpd) return 2; - if (fun == &vFpl) return 1; - if (fun == &vFpL) return 1; - if (fun == &vFpp) return 1; - if (fun == &cFpi) return 1; - if (fun == &cFpp) return 1; - if (fun == &wFpi) return 1; - if (fun == &iFwp) return 1; - if (fun == &iFii) return 1; - if (fun == &iFiI) return 1; - if (fun == &iFiC) return 1; - if (fun == &iFiu) return 1; - if (fun == &iFil) return 1; - if (fun == &iFiL) return 1; - if (fun == &iFip) return 1; - if (fun == &iFui) return 1; - if (fun == &iFuu) return 1; - if (fun == &iFuL) return 1; - if (fun == &iFup) return 1; - if (fun == &iFUp) return 1; - if (fun == &iFli) return 1; - if (fun == &iFlp) return 1; - if (fun == &iFLi) return 1; - if (fun == &iFLu) return 1; - if (fun == &iFLL) return 1; - if (fun == &iFLp) return 1; - if (fun == &iFpw) return 1; - if (fun == &iFpi) return 1; - if (fun == &iFpI) return 1; - if (fun == &iFpC) return 1; - if (fun == &iFpW) return 1; - if (fun == &iFpu) return 1; - if (fun == &iFpU) return 1; - if (fun == &iFpf) return 2; - if (fun == &iFpd) return 2; - if (fun == &iFpl) return 1; - if (fun == &iFpL) return 1; - if (fun == &iFpp) return 1; - if (fun == &IFip) return 1; - if (fun == &IFII) return 1; - if (fun == &IFpi) return 1; - if (fun == &IFpu) return 1; - if (fun == &IFpd) return 2; - if (fun == &IFpp) return 1; - if (fun == &CFip) return 1; - if (fun == &CFCi) return 1; - if (fun == &CFui) return 1; - if (fun == &CFuW) return 1; - if (fun == &CFuu) return 1; - if (fun == &CFuL) return 1; - if (fun == &CFpi) return 1; - if (fun == &CFpu) return 1; - if (fun == &CFpL) return 1; - if (fun == &CFpp) return 1; - if (fun == &WFpi) return 1; - if (fun == &WFpp) return 1; - if (fun == &uFii) return 1; - if (fun == &uFiu) return 1; - if (fun == &uFip) return 1; - if (fun == &uFui) return 1; - if (fun == &uFuu) return 1; - if (fun == &uFup) return 1; - if (fun == &uFpw) return 1; - if (fun == &uFpi) return 1; - if (fun == &uFpC) return 1; - if (fun == &uFpu) return 1; - if (fun == &uFpU) return 1; - if (fun == &uFpf) return 2; - if (fun == &uFpl) return 1; - if (fun == &uFpL) return 1; - if (fun == &uFpp) return 1; - if (fun == &UFuu) return 1; - if (fun == &UFUp) return 1; - if (fun == &UFpi) return 1; - if (fun == &UFpU) return 1; - if (fun == &UFpp) return 1; - if (fun == &fFif) return -2; - if (fun == &fFfi) return -2; - if (fun == &fFff) return -3; - if (fun == &fFfp) return -2; - if (fun == &fFpu) return -1; - if (fun == &fFpp) return -1; - if (fun == &dFid) return -2; - if (fun == &dFdi) return -2; - if (fun == &dFdd) return -3; - if (fun == &dFdp) return -2; - if (fun == &dFll) return -1; - if (fun == &dFpi) return -1; - if (fun == &dFpu) return -1; - if (fun == &dFpd) return -2; - if (fun == &dFpp) return -1; - if (fun == &lFii) return 1; - if (fun == &lFip) return 1; - if (fun == &lFui) return 1; - if (fun == &lFll) return 1; - if (fun == &lFpi) return 1; - if (fun == &lFpd) return 2; - if (fun == &lFpl) return 1; - if (fun == &lFpp) return 1; - if (fun == &LFii) return 1; - if (fun == &LFuu) return 1; - if (fun == &LFUp) return 1; - if (fun == &LFLi) return 1; - if (fun == &LFLL) return 1; - if (fun == &LFLp) return 1; - if (fun == &LFpi) return 1; - if (fun == &LFpu) return 1; - if (fun == &LFpL) return 1; - if (fun == &LFpp) return 1; - if (fun == &pFii) return 1; - if (fun == &pFiI) return 1; - if (fun == &pFiu) return 1; - if (fun == &pFip) return 1; - if (fun == &pFui) return 1; - if (fun == &pFuu) return 1; - if (fun == &pFup) return 1; - if (fun == &pFUU) return 1; - if (fun == &pFdi) return 2; - if (fun == &pFdd) return 3; - if (fun == &pFli) return 1; - if (fun == &pFll) return 1; - if (fun == &pFlp) return 1; - if (fun == &pFLi) return 1; - if (fun == &pFLC) return 1; - if (fun == &pFLu) return 1; - if (fun == &pFLL) return 1; - if (fun == &pFLp) return 1; - if (fun == &pFpi) return 1; - if (fun == &pFpC) return 1; - if (fun == &pFpW) return 1; - if (fun == &pFpu) return 1; - if (fun == &pFpU) return 1; - if (fun == &pFpd) return 2; - if (fun == &pFpl) return 1; - if (fun == &pFpL) return 1; - if (fun == &pFpp) return 1; - if (fun == &vFccc) return 1; - if (fun == &vFwww) return 1; - if (fun == &vFiii) return 1; - if (fun == &vFiif) return 2; - if (fun == &vFiip) return 1; - if (fun == &vFiui) return 1; - if (fun == &vFiuu) return 1; - if (fun == &vFiuU) return 1; - if (fun == &vFiup) return 1; - if (fun == &vFiff) return 3; - if (fun == &vFidd) return 3; - if (fun == &vFilu) return 1; - if (fun == &vFill) return 1; - if (fun == &vFilp) return 1; - if (fun == &vFiLL) return 1; - if (fun == &vFipi) return 1; - if (fun == &vFipu) return 1; - if (fun == &vFipL) return 1; - if (fun == &vFipp) return 1; - if (fun == &vFCCC) return 1; - if (fun == &vFWWW) return 1; - if (fun == &vFucc) return 1; - if (fun == &vFuww) return 1; - if (fun == &vFuii) return 1; - if (fun == &vFuiu) return 1; - if (fun == &vFuiU) return 1; - if (fun == &vFuif) return 2; - if (fun == &vFuid) return 2; - if (fun == &vFuil) return 1; - if (fun == &vFuiL) return 1; - if (fun == &vFuip) return 1; - if (fun == &vFuWW) return 1; - if (fun == &vFuui) return 1; - if (fun == &vFuuC) return 1; - if (fun == &vFuuu) return 1; - if (fun == &vFuuU) return 1; - if (fun == &vFuuf) return 2; - if (fun == &vFuud) return 2; - if (fun == &vFuuL) return 1; - if (fun == &vFuup) return 1; - if (fun == &vFuff) return 3; - if (fun == &vFufp) return 2; - if (fun == &vFudd) return 3; - if (fun == &vFull) return 1; - if (fun == &vFulp) return 1; - if (fun == &vFuLL) return 1; - if (fun == &vFuLp) return 1; - if (fun == &vFupu) return 1; - if (fun == &vFupp) return 1; - if (fun == &vFfff) return 4; - if (fun == &vFfpp) return 2; - if (fun == &vFddd) return 4; - if (fun == &vFdpp) return 2; - if (fun == &vFlii) return 1; - if (fun == &vFlip) return 1; - if (fun == &vFllp) return 1; - if (fun == &vFlpp) return 1; - if (fun == &vFLup) return 1; - if (fun == &vFLpL) return 1; - if (fun == &vFLpp) return 1; - if (fun == &vFpic) return 1; - if (fun == &vFpii) return 1; - if (fun == &vFpiI) return 1; - if (fun == &vFpiC) return 1; - if (fun == &vFpiu) return 1; - if (fun == &vFpiU) return 1; - if (fun == &vFpif) return 2; - if (fun == &vFpid) return 2; - if (fun == &vFpiL) return 1; - if (fun == &vFpip) return 1; - if (fun == &vFpui) return 1; - if (fun == &vFpuI) return 1; - if (fun == &vFpuW) return 1; - if (fun == &vFpuu) return 1; - if (fun == &vFpuU) return 1; - if (fun == &vFpuf) return 2; - if (fun == &vFpud) return 2; - if (fun == &vFpuL) return 1; - if (fun == &vFpup) return 1; - if (fun == &vFpUi) return 1; - if (fun == &vFpUu) return 1; - if (fun == &vFpUU) return 1; - if (fun == &vFpUf) return 2; - if (fun == &vFpUp) return 1; - if (fun == &vFpff) return 3; - if (fun == &vFpdu) return 2; - if (fun == &vFpdd) return 3; - if (fun == &vFpdp) return 2; - if (fun == &vFpll) return 1; - if (fun == &vFplp) return 1; - if (fun == &vFpLi) return 1; - if (fun == &vFpLu) return 1; - if (fun == &vFpLL) return 1; - if (fun == &vFpLp) return 1; - if (fun == &vFppi) return 1; - if (fun == &vFppu) return 1; - if (fun == &vFppU) return 1; - if (fun == &vFppf) return 2; - if (fun == &vFppd) return 2; - if (fun == &vFppl) return 1; - if (fun == &vFppL) return 1; - if (fun == &vFppp) return 1; - if (fun == &cFpdp) return 2; - if (fun == &wFppp) return 1; - if (fun == &iFwww) return 1; - if (fun == &iFwpp) return 1; - if (fun == &iFiwC) return 1; - if (fun == &iFiii) return 1; - if (fun == &iFiiI) return 1; - if (fun == &iFiiu) return 1; - if (fun == &iFiil) return 1; - if (fun == &iFiip) return 1; - if (fun == &iFiCC) return 1; - if (fun == &iFiui) return 1; - if (fun == &iFiuu) return 1; - if (fun == &iFiup) return 1; - if (fun == &iFill) return 1; - if (fun == &iFilp) return 1; - if (fun == &iFiLi) return 1; - if (fun == &iFiLp) return 1; - if (fun == &iFipi) return 1; - if (fun == &iFipu) return 1; - if (fun == &iFipL) return 1; - if (fun == &iFipp) return 1; - if (fun == &iFCuW) return 1; - if (fun == &iFuwp) return 1; - if (fun == &iFuip) return 1; - if (fun == &iFuWp) return 1; - if (fun == &iFuui) return 1; - if (fun == &iFuuu) return 1; - if (fun == &iFuup) return 1; - if (fun == &iFuLL) return 1; - if (fun == &iFuLp) return 1; - if (fun == &iFupi) return 1; - if (fun == &iFupu) return 1; - if (fun == &iFupL) return 1; - if (fun == &iFupp) return 1; - if (fun == &iFfff) return 4; - if (fun == &iFLip) return 1; - if (fun == &iFLpp) return 1; - if (fun == &iFpwp) return 1; - if (fun == &iFpii) return 1; - if (fun == &iFpiI) return 1; - if (fun == &iFpiC) return 1; - if (fun == &iFpiW) return 1; - if (fun == &iFpiu) return 1; - if (fun == &iFpiU) return 1; - if (fun == &iFpid) return 2; - if (fun == &iFpil) return 1; - if (fun == &iFpiL) return 1; - if (fun == &iFpip) return 1; - if (fun == &iFpIi) return 1; - if (fun == &iFpII) return 1; - if (fun == &iFpCp) return 1; - if (fun == &iFpWp) return 1; - if (fun == &iFpui) return 1; - if (fun == &iFpuC) return 1; - if (fun == &iFpuu) return 1; - if (fun == &iFpuU) return 1; - if (fun == &iFpul) return 1; - if (fun == &iFpuL) return 1; - if (fun == &iFpup) return 1; - if (fun == &iFpUu) return 1; - if (fun == &iFpUU) return 1; - if (fun == &iFpUp) return 1; - if (fun == &iFpfu) return 2; - if (fun == &iFpff) return 3; - if (fun == &iFpdd) return 3; - if (fun == &iFpli) return 1; - if (fun == &iFpll) return 1; - if (fun == &iFplp) return 1; - if (fun == &iFpLi) return 1; - if (fun == &iFpLu) return 1; - if (fun == &iFpLl) return 1; - if (fun == &iFpLL) return 1; - if (fun == &iFpLp) return 1; - if (fun == &iFppi) return 1; - if (fun == &iFppI) return 1; - if (fun == &iFppC) return 1; - if (fun == &iFppW) return 1; - if (fun == &iFppu) return 1; - if (fun == &iFppU) return 1; - if (fun == &iFppd) return 2; - if (fun == &iFppl) return 1; - if (fun == &iFppL) return 1; - if (fun == &iFppp) return 1; - if (fun == &IFiIi) return 1; - if (fun == &IFpIi) return 1; - if (fun == &IFppi) return 1; - if (fun == &IFppI) return 1; - if (fun == &CFipp) return 1; - if (fun == &CFuff) return 3; - if (fun == &CFuLu) return 1; - if (fun == &CFppp) return 1; - if (fun == &WFppp) return 1; - if (fun == &uFiuu) return 1; - if (fun == &uFilp) return 1; - if (fun == &uFipu) return 1; - if (fun == &uFipL) return 1; - if (fun == &uFuii) return 1; - if (fun == &uFuip) return 1; - if (fun == &uFuuu) return 1; - if (fun == &uFuup) return 1; - if (fun == &uFufp) return 2; - if (fun == &uFupu) return 1; - if (fun == &uFupp) return 1; - if (fun == &uFpii) return 1; - if (fun == &uFpiu) return 1; - if (fun == &uFpip) return 1; - if (fun == &uFpCi) return 1; - if (fun == &uFpWi) return 1; - if (fun == &uFpWu) return 1; - if (fun == &uFpWf) return 2; - if (fun == &uFpWp) return 1; - if (fun == &uFpui) return 1; - if (fun == &uFpuu) return 1; - if (fun == &uFpuL) return 1; - if (fun == &uFpup) return 1; - if (fun == &uFpfu) return 2; - if (fun == &uFpli) return 1; - if (fun == &uFpLu) return 1; - if (fun == &uFpLL) return 1; - if (fun == &uFpLp) return 1; - if (fun == &uFppi) return 1; - if (fun == &uFppu) return 1; - if (fun == &uFppL) return 1; - if (fun == &uFppp) return 1; - if (fun == &UFUii) return 1; - if (fun == &UFUUU) return 1; - if (fun == &UFpiU) return 1; - if (fun == &UFppi) return 1; - if (fun == &fFuii) return -1; - if (fun == &fFfff) return -4; - if (fun == &fFffp) return -3; - if (fun == &fFppi) return -1; - if (fun == &fFppL) return -1; - if (fun == &fFppp) return -1; - if (fun == &dFuud) return -2; - if (fun == &dFddd) return -4; - if (fun == &dFddp) return -3; - if (fun == &dFpii) return -1; - if (fun == &dFpdd) return -3; - if (fun == &dFppi) return -1; - if (fun == &dFppu) return -1; - if (fun == &dFppd) return -2; - if (fun == &dFppp) return -1; - if (fun == &lFili) return 1; - if (fun == &lFilL) return 1; - if (fun == &lFipi) return 1; - if (fun == &lFipL) return 1; - if (fun == &lFlll) return 1; - if (fun == &lFpli) return 1; - if (fun == &lFpLu) return 1; - if (fun == &lFpLp) return 1; - if (fun == &lFppi) return 1; - if (fun == &lFppu) return 1; - if (fun == &lFppL) return 1; - if (fun == &lFppp) return 1; - if (fun == &LFipL) return 1; - if (fun == &LFuui) return 1; - if (fun == &LFLii) return 1; - if (fun == &LFLLl) return 1; - if (fun == &LFLLL) return 1; - if (fun == &LFLpu) return 1; - if (fun == &LFLpL) return 1; - if (fun == &LFpii) return 1; - if (fun == &LFpCi) return 1; - if (fun == &LFpuL) return 1; - if (fun == &LFpup) return 1; - if (fun == &LFpLi) return 1; - if (fun == &LFpLL) return 1; - if (fun == &LFpLp) return 1; - if (fun == &LFppi) return 1; - if (fun == &LFppu) return 1; - if (fun == &LFppL) return 1; - if (fun == &LFppp) return 1; - if (fun == &pFiii) return 1; - if (fun == &pFiiu) return 1; - if (fun == &pFiip) return 1; - if (fun == &pFiIi) return 1; - if (fun == &pFiLL) return 1; - if (fun == &pFipi) return 1; - if (fun == &pFipL) return 1; - if (fun == &pFipp) return 1; - if (fun == &pFCuW) return 1; - if (fun == &pFWWW) return 1; - if (fun == &pFuip) return 1; - if (fun == &pFuui) return 1; - if (fun == &pFuuu) return 1; - if (fun == &pFulu) return 1; - if (fun == &pFulp) return 1; - if (fun == &pFupi) return 1; - if (fun == &pFupu) return 1; - if (fun == &pFupl) return 1; - if (fun == &pFupL) return 1; - if (fun == &pFupp) return 1; - if (fun == &pFdip) return 2; - if (fun == &pFdUU) return 2; - if (fun == &pFddi) return 3; - if (fun == &pFddd) return 4; - if (fun == &pFlpi) return 1; - if (fun == &pFLup) return 1; - if (fun == &pFLLp) return 1; - if (fun == &pFLpi) return 1; - if (fun == &pFLpp) return 1; - if (fun == &pFpii) return 1; - if (fun == &pFpiu) return 1; - if (fun == &pFpid) return 2; - if (fun == &pFpil) return 1; - if (fun == &pFpiL) return 1; - if (fun == &pFpip) return 1; - if (fun == &pFpCi) return 1; - if (fun == &pFpCu) return 1; - if (fun == &pFpWi) return 1; - if (fun == &pFpWW) return 1; - if (fun == &pFpWp) return 1; - if (fun == &pFpui) return 1; - if (fun == &pFpuu) return 1; - if (fun == &pFpuL) return 1; - if (fun == &pFpup) return 1; - if (fun == &pFpUi) return 1; - if (fun == &pFpUu) return 1; - if (fun == &pFpdu) return 2; - if (fun == &pFpdd) return 3; - if (fun == &pFplC) return 1; - if (fun == &pFplu) return 1; - if (fun == &pFpll) return 1; - if (fun == &pFplp) return 1; - if (fun == &pFpLi) return 1; - if (fun == &pFpLu) return 1; - if (fun == &pFpLL) return 1; - if (fun == &pFpLp) return 1; - if (fun == &pFppi) return 1; - if (fun == &pFppI) return 1; - if (fun == &pFppC) return 1; - if (fun == &pFppu) return 1; - if (fun == &pFppU) return 1; - if (fun == &pFppf) return 2; - if (fun == &pFppl) return 1; - if (fun == &pFppL) return 1; - if (fun == &pFppp) return 1; - if (fun == &vFcccc) return 1; - if (fun == &vFwwww) return 1; - if (fun == &vFiiii) return 1; - if (fun == &vFiiip) return 1; - if (fun == &vFiiCp) return 1; - if (fun == &vFiill) return 1; - if (fun == &vFiuip) return 1; - if (fun == &vFiuuu) return 1; - if (fun == &vFiulp) return 1; - if (fun == &vFifff) return 4; - if (fun == &vFiddd) return 4; - if (fun == &vFilip) return 1; - if (fun == &vFilll) return 1; - if (fun == &vFilpu) return 1; - if (fun == &vFilpp) return 1; - if (fun == &vFiLLL) return 1; - if (fun == &vFipii) return 1; - if (fun == &vFipup) return 1; - if (fun == &vFipll) return 1; - if (fun == &vFippL) return 1; - if (fun == &vFippp) return 1; - if (fun == &vFCCCC) return 1; - if (fun == &vFWWWW) return 1; - if (fun == &vFuccc) return 1; - if (fun == &vFuwww) return 1; - if (fun == &vFuiii) return 1; - if (fun == &vFuiiu) return 1; - if (fun == &vFuiip) return 1; - if (fun == &vFuiui) return 1; - if (fun == &vFuiuC) return 1; - if (fun == &vFuiuu) return 1; - if (fun == &vFuiup) return 1; - if (fun == &vFuifi) return 2; - if (fun == &vFuiff) return 3; - if (fun == &vFuidd) return 3; - if (fun == &vFuill) return 1; - if (fun == &vFuilp) return 1; - if (fun == &vFuiLL) return 1; - if (fun == &vFuipi) return 1; - if (fun == &vFuipu) return 1; - if (fun == &vFuipp) return 1; - if (fun == &vFuWWW) return 1; - if (fun == &vFuuii) return 1; - if (fun == &vFuuiu) return 1; - if (fun == &vFuuil) return 1; - if (fun == &vFuuip) return 1; - if (fun == &vFuuCu) return 1; - if (fun == &vFuuCp) return 1; - if (fun == &vFuuui) return 1; - if (fun == &vFuuuu) return 1; - if (fun == &vFuuuf) return 2; - if (fun == &vFuuud) return 2; - if (fun == &vFuuul) return 1; - if (fun == &vFuuup) return 1; - if (fun == &vFuuff) return 3; - if (fun == &vFuuli) return 1; - if (fun == &vFuulp) return 1; - if (fun == &vFuuLl) return 1; - if (fun == &vFuupi) return 1; - if (fun == &vFuupp) return 1; - if (fun == &vFufff) return 4; - if (fun == &vFuddd) return 4; - if (fun == &vFuluL) return 1; - if (fun == &vFullC) return 1; - if (fun == &vFulll) return 1; - if (fun == &vFullp) return 1; - if (fun == &vFulpi) return 1; - if (fun == &vFulpu) return 1; - if (fun == &vFulpp) return 1; - if (fun == &vFuLui) return 1; - if (fun == &vFuLup) return 1; - if (fun == &vFuLLL) return 1; - if (fun == &vFupii) return 1; - if (fun == &vFuppi) return 1; - if (fun == &vFuppu) return 1; - if (fun == &vFUUpi) return 1; - if (fun == &vFffff) return 5; - if (fun == &vFdddd) return 5; - if (fun == &vFllii) return 1; - if (fun == &vFLuui) return 1; - if (fun == &vFLppi) return 1; - if (fun == &vFpiii) return 1; - if (fun == &vFpiiu) return 1; - if (fun == &vFpiid) return 2; - if (fun == &vFpiip) return 1; - if (fun == &vFpiui) return 1; - if (fun == &vFpiuu) return 1; - if (fun == &vFpiuL) return 1; - if (fun == &vFpiup) return 1; - if (fun == &vFpiUu) return 1; - if (fun == &vFpiUU) return 1; - if (fun == &vFpifi) return 2; - if (fun == &vFpipi) return 1; - if (fun == &vFpipu) return 1; - if (fun == &vFpipp) return 1; - if (fun == &vFpIdi) return 2; - if (fun == &vFpCuW) return 1; - if (fun == &vFpuii) return 1; - if (fun == &vFpuip) return 1; - if (fun == &vFpuuu) return 1; - if (fun == &vFpuup) return 1; - if (fun == &vFpufi) return 2; - if (fun == &vFpudd) return 3; - if (fun == &vFpupu) return 1; - if (fun == &vFpupp) return 1; - if (fun == &vFpUuu) return 1; - if (fun == &vFpUup) return 1; - if (fun == &vFpUUi) return 1; - if (fun == &vFpUUu) return 1; - if (fun == &vFpUUp) return 1; - if (fun == &vFpUpp) return 1; - if (fun == &vFpfff) return 4; - if (fun == &vFpdii) return 2; - if (fun == &vFpdup) return 2; - if (fun == &vFpddu) return 3; - if (fun == &vFpddd) return 4; - if (fun == &vFplll) return 1; - if (fun == &vFplpp) return 1; - if (fun == &vFpLii) return 1; - if (fun == &vFpLuu) return 1; - if (fun == &vFpLLL) return 1; - if (fun == &vFpLpL) return 1; - if (fun == &vFpLpp) return 1; - if (fun == &vFppii) return 1; - if (fun == &vFppiu) return 1; - if (fun == &vFppid) return 2; - if (fun == &vFppil) return 1; - if (fun == &vFppiL) return 1; - if (fun == &vFppip) return 1; - if (fun == &vFppui) return 1; - if (fun == &vFppuu) return 1; - if (fun == &vFppup) return 1; - if (fun == &vFppfi) return 2; - if (fun == &vFppff) return 3; - if (fun == &vFppdu) return 2; - if (fun == &vFppdd) return 3; - if (fun == &vFppdp) return 2; - if (fun == &vFpplp) return 1; - if (fun == &vFppLL) return 1; - if (fun == &vFppLp) return 1; - if (fun == &vFpppi) return 1; - if (fun == &vFpppu) return 1; - if (fun == &vFpppd) return 2; - if (fun == &vFpppl) return 1; - if (fun == &vFpppL) return 1; - if (fun == &vFpppp) return 1; - if (fun == &cFpipp) return 1; - if (fun == &iFwwww) return 1; - if (fun == &iFwppp) return 1; - if (fun == &iFiiii) return 1; - if (fun == &iFiiiu) return 1; - if (fun == &iFiiip) return 1; - if (fun == &iFiiui) return 1; - if (fun == &iFiill) return 1; - if (fun == &iFiipi) return 1; - if (fun == &iFiipp) return 1; - if (fun == &iFiWii) return 1; - if (fun == &iFiuwp) return 1; - if (fun == &iFiuup) return 1; - if (fun == &iFiupp) return 1; - if (fun == &iFilli) return 1; - if (fun == &iFillu) return 1; - if (fun == &iFiLpL) return 1; - if (fun == &iFipii) return 1; - if (fun == &iFipip) return 1; - if (fun == &iFipWp) return 1; - if (fun == &iFipui) return 1; - if (fun == &iFipuL) return 1; - if (fun == &iFipLi) return 1; - if (fun == &iFipLu) return 1; - if (fun == &iFipLp) return 1; - if (fun == &iFippi) return 1; - if (fun == &iFippu) return 1; - if (fun == &iFippL) return 1; - if (fun == &iFippp) return 1; - if (fun == &iFuiup) return 1; - if (fun == &iFuipp) return 1; - if (fun == &iFuWWp) return 1; - if (fun == &iFuuuu) return 1; - if (fun == &iFuupi) return 1; - if (fun == &iFuupp) return 1; - if (fun == &iFupLp) return 1; - if (fun == &iFuppi) return 1; - if (fun == &iFuppu) return 1; - if (fun == &iFuppp) return 1; - if (fun == &iFLppp) return 1; - if (fun == &iFpwww) return 1; - if (fun == &iFpwpp) return 1; - if (fun == &iFpiii) return 1; - if (fun == &iFpiiu) return 1; - if (fun == &iFpiid) return 2; - if (fun == &iFpiiL) return 1; - if (fun == &iFpiip) return 1; - if (fun == &iFpiuu) return 1; - if (fun == &iFpiuL) return 1; - if (fun == &iFpiup) return 1; - if (fun == &iFpiUp) return 1; - if (fun == &iFpild) return 2; - if (fun == &iFpipi) return 1; - if (fun == &iFpipu) return 1; - if (fun == &iFpipL) return 1; - if (fun == &iFpipp) return 1; - if (fun == &iFpIip) return 1; - if (fun == &iFpCCC) return 1; - if (fun == &iFpCpi) return 1; - if (fun == &iFpCpp) return 1; - if (fun == &iFpWWu) return 1; - if (fun == &iFpWpp) return 1; - if (fun == &iFpuwp) return 1; - if (fun == &iFpuii) return 1; - if (fun == &iFpuiL) return 1; - if (fun == &iFpuip) return 1; - if (fun == &iFpuui) return 1; - if (fun == &iFpuuu) return 1; - if (fun == &iFpuul) return 1; - if (fun == &iFpuuL) return 1; - if (fun == &iFpuup) return 1; - if (fun == &iFpuUp) return 1; - if (fun == &iFpuLL) return 1; - if (fun == &iFpuLp) return 1; - if (fun == &iFpupi) return 1; - if (fun == &iFpupC) return 1; - if (fun == &iFpupu) return 1; - if (fun == &iFpupU) return 1; - if (fun == &iFpupL) return 1; - if (fun == &iFpupp) return 1; - if (fun == &iFpUip) return 1; - if (fun == &iFpUup) return 1; - if (fun == &iFpUUU) return 1; - if (fun == &iFpULp) return 1; - if (fun == &iFpUpp) return 1; - if (fun == &iFpdip) return 2; - if (fun == &iFplii) return 1; - if (fun == &iFplip) return 1; - if (fun == &iFplpi) return 1; - if (fun == &iFplpp) return 1; - if (fun == &iFpLii) return 1; - if (fun == &iFpLiL) return 1; - if (fun == &iFpLip) return 1; - if (fun == &iFpLuu) return 1; - if (fun == &iFpLup) return 1; - if (fun == &iFpLlp) return 1; - if (fun == &iFpLLu) return 1; - if (fun == &iFpLLL) return 1; - if (fun == &iFpLLp) return 1; - if (fun == &iFpLpi) return 1; - if (fun == &iFpLpf) return 2; - if (fun == &iFpLpd) return 2; - if (fun == &iFpLpL) return 1; - if (fun == &iFpLpp) return 1; - if (fun == &iFppii) return 1; - if (fun == &iFppiu) return 1; - if (fun == &iFppiU) return 1; - if (fun == &iFppiL) return 1; - if (fun == &iFppip) return 1; - if (fun == &iFppIL) return 1; - if (fun == &iFppCC) return 1; - if (fun == &iFppuw) return 1; - if (fun == &iFppui) return 1; - if (fun == &iFppuu) return 1; - if (fun == &iFppuL) return 1; - if (fun == &iFppup) return 1; - if (fun == &iFppdd) return 3; - if (fun == &iFppdp) return 2; - if (fun == &iFppli) return 1; - if (fun == &iFppll) return 1; - if (fun == &iFpplL) return 1; - if (fun == &iFpplp) return 1; - if (fun == &iFppLi) return 1; - if (fun == &iFppLL) return 1; - if (fun == &iFppLp) return 1; - if (fun == &iFpppi) return 1; - if (fun == &iFpppC) return 1; - if (fun == &iFpppu) return 1; - if (fun == &iFpppL) return 1; - if (fun == &iFpppp) return 1; - if (fun == &IFipUI) return 1; - if (fun == &IFipUp) return 1; - if (fun == &IFpIip) return 1; - if (fun == &IFppii) return 1; - if (fun == &IFppip) return 1; - if (fun == &CFuuff) return 3; - if (fun == &CFpiii) return 1; - if (fun == &CFpLLi) return 1; - if (fun == &CFppip) return 1; - if (fun == &uFiiii) return 1; - if (fun == &uFiiuu) return 1; - if (fun == &uFifff) return 4; - if (fun == &uFuuuu) return 1; - if (fun == &uFpiip) return 1; - if (fun == &uFpipu) return 1; - if (fun == &uFpipL) return 1; - if (fun == &uFpipp) return 1; - if (fun == &uFpCCC) return 1; - if (fun == &uFpuip) return 1; - if (fun == &uFpuup) return 1; - if (fun == &uFpupi) return 1; - if (fun == &uFpupu) return 1; - if (fun == &uFpupp) return 1; - if (fun == &uFppiu) return 1; - if (fun == &uFppip) return 1; - if (fun == &uFppuu) return 1; - if (fun == &uFpplp) return 1; - if (fun == &uFppLp) return 1; - if (fun == &uFpppi) return 1; - if (fun == &uFpppu) return 1; - if (fun == &uFpppL) return 1; - if (fun == &uFpppp) return 1; - if (fun == &UFpUui) return 1; - if (fun == &UFppii) return 1; - if (fun == &UFppip) return 1; - if (fun == &dFpppp) return -1; - if (fun == &lFiiLu) return 1; - if (fun == &lFiipL) return 1; - if (fun == &lFipil) return 1; - if (fun == &lFipLi) return 1; - if (fun == &lFipLI) return 1; - if (fun == &lFipLu) return 1; - if (fun == &lFipLl) return 1; - if (fun == &lFipLL) return 1; - if (fun == &lFipLp) return 1; - if (fun == &lFippL) return 1; - if (fun == &lFpili) return 1; - if (fun == &lFpilp) return 1; - if (fun == &lFpuip) return 1; - if (fun == &lFplip) return 1; - if (fun == &lFplpp) return 1; - if (fun == &lFpLpp) return 1; - if (fun == &lFppii) return 1; - if (fun == &lFppip) return 1; - if (fun == &lFpppL) return 1; - if (fun == &lFpppp) return 1; - if (fun == &LFipLL) return 1; - if (fun == &LFippL) return 1; - if (fun == &LFippp) return 1; - if (fun == &LFuipL) return 1; - if (fun == &LFpCii) return 1; - if (fun == &LFpupL) return 1; - if (fun == &LFpLCL) return 1; - if (fun == &LFpLLp) return 1; - if (fun == &LFpLpL) return 1; - if (fun == &LFpLpp) return 1; - if (fun == &LFppii) return 1; - if (fun == &LFppip) return 1; - if (fun == &LFppLu) return 1; - if (fun == &LFppLL) return 1; - if (fun == &LFppLp) return 1; - if (fun == &LFpppi) return 1; - if (fun == &LFpppL) return 1; - if (fun == &LFpppp) return 1; - if (fun == &pFiiii) return 1; - if (fun == &pFiiiu) return 1; - if (fun == &pFiiuu) return 1; - if (fun == &pFiiup) return 1; - if (fun == &pFiiLp) return 1; - if (fun == &pFiipi) return 1; - if (fun == &pFiIIi) return 1; - if (fun == &pFillu) return 1; - if (fun == &pFipii) return 1; - if (fun == &pFipip) return 1; - if (fun == &pFippi) return 1; - if (fun == &pFippu) return 1; - if (fun == &pFippL) return 1; - if (fun == &pFippp) return 1; - if (fun == &pFuuii) return 1; - if (fun == &pFuuip) return 1; - if (fun == &pFuuuu) return 1; - if (fun == &pFullu) return 1; - if (fun == &pFupii) return 1; - if (fun == &pFuppp) return 1; - if (fun == &pFffff) return 5; - if (fun == &pFdipp) return 2; - if (fun == &pFdddd) return 5; - if (fun == &pFlfff) return 4; - if (fun == &pFLiip) return 1; - if (fun == &pFLLup) return 1; - if (fun == &pFLLpp) return 1; - if (fun == &pFLppp) return 1; - if (fun == &pFpiii) return 1; - if (fun == &pFpiiu) return 1; - if (fun == &pFpiip) return 1; - if (fun == &pFpiuu) return 1; - if (fun == &pFpiLi) return 1; - if (fun == &pFpiLL) return 1; - if (fun == &pFpipi) return 1; - if (fun == &pFpipd) return 2; - if (fun == &pFpipL) return 1; - if (fun == &pFpipp) return 1; - if (fun == &pFpCip) return 1; - if (fun == &pFpWWW) return 1; - if (fun == &pFpuii) return 1; - if (fun == &pFpuip) return 1; - if (fun == &pFpuuu) return 1; - if (fun == &pFpuup) return 1; - if (fun == &pFpudd) return 3; - if (fun == &pFpuLL) return 1; - if (fun == &pFpupi) return 1; - if (fun == &pFpupu) return 1; - if (fun == &pFpupp) return 1; - if (fun == &pFpdIU) return 2; - if (fun == &pFpddi) return 3; - if (fun == &pFplil) return 1; - if (fun == &pFplip) return 1; - if (fun == &pFplpl) return 1; - if (fun == &pFplpp) return 1; - if (fun == &pFpLii) return 1; - if (fun == &pFpLip) return 1; - if (fun == &pFpLup) return 1; - if (fun == &pFpLLp) return 1; - if (fun == &pFpLpi) return 1; - if (fun == &pFpLpl) return 1; - if (fun == &pFpLpL) return 1; - if (fun == &pFpLpp) return 1; - if (fun == &pFppii) return 1; - if (fun == &pFppiu) return 1; - if (fun == &pFppiL) return 1; - if (fun == &pFppip) return 1; - if (fun == &pFppCp) return 1; - if (fun == &pFppWp) return 1; - if (fun == &pFppuu) return 1; - if (fun == &pFppuL) return 1; - if (fun == &pFppup) return 1; - if (fun == &pFppUU) return 1; - if (fun == &pFppdd) return 3; - if (fun == &pFppll) return 1; - if (fun == &pFpplp) return 1; - if (fun == &pFppLi) return 1; - if (fun == &pFppLL) return 1; - if (fun == &pFppLp) return 1; - if (fun == &pFpppi) return 1; - if (fun == &pFpppu) return 1; - if (fun == &pFpppL) return 1; - if (fun == &pFpppp) return 1; - if (fun == &vFiiiii) return 1; - if (fun == &vFiiiiu) return 1; - if (fun == &vFiiipi) return 1; - if (fun == &vFiiuii) return 1; - if (fun == &vFiiuup) return 1; - if (fun == &vFiillu) return 1; - if (fun == &vFiilll) return 1; - if (fun == &vFiipii) return 1; - if (fun == &vFiipll) return 1; - if (fun == &vFiuiip) return 1; - if (fun == &vFiuipi) return 1; - if (fun == &vFiuuuu) return 1; - if (fun == &vFiulpp) return 1; - if (fun == &vFiffff) return 5; - if (fun == &vFidddd) return 5; - if (fun == &vFilill) return 1; - if (fun == &vFilipi) return 1; - if (fun == &vFilipl) return 1; - if (fun == &vFillll) return 1; - if (fun == &vFiLLLL) return 1; - if (fun == &vFipipu) return 1; - if (fun == &vFipipp) return 1; - if (fun == &vFipupi) return 1; - if (fun == &vFucccc) return 1; - if (fun == &vFuwwww) return 1; - if (fun == &vFuiiii) return 1; - if (fun == &vFuiiiu) return 1; - if (fun == &vFuiiip) return 1; - if (fun == &vFuiiCp) return 1; - if (fun == &vFuiiup) return 1; - if (fun == &vFuiill) return 1; - if (fun == &vFuiuii) return 1; - if (fun == &vFuiuip) return 1; - if (fun == &vFuiuCi) return 1; - if (fun == &vFuiuCu) return 1; - if (fun == &vFuiuuu) return 1; - if (fun == &vFuiuup) return 1; - if (fun == &vFuiupi) return 1; - if (fun == &vFuifff) return 4; - if (fun == &vFuiddd) return 4; - if (fun == &vFuilll) return 1; - if (fun == &vFuiLLL) return 1; - if (fun == &vFuipii) return 1; - if (fun == &vFuipip) return 1; - if (fun == &vFuipup) return 1; - if (fun == &vFuippp) return 1; - if (fun == &vFuCCCC) return 1; - if (fun == &vFuCuip) return 1; - if (fun == &vFuCuup) return 1; - if (fun == &vFuWWWW) return 1; - if (fun == &vFuuiii) return 1; - if (fun == &vFuuiiu) return 1; - if (fun == &vFuuiip) return 1; - if (fun == &vFuuiui) return 1; - if (fun == &vFuuiuu) return 1; - if (fun == &vFuuiup) return 1; - if (fun == &vFuuifi) return 2; - if (fun == &vFuuipC) return 1; - if (fun == &vFuuipu) return 1; - if (fun == &vFuuipp) return 1; - if (fun == &vFuuuii) return 1; - if (fun == &vFuuuiu) return 1; - if (fun == &vFuuuil) return 1; - if (fun == &vFuuuip) return 1; - if (fun == &vFuuuui) return 1; - if (fun == &vFuuuuu) return 1; - if (fun == &vFuuuup) return 1; - if (fun == &vFuuuli) return 1; - if (fun == &vFuuull) return 1; - if (fun == &vFuulll) return 1; - if (fun == &vFuullp) return 1; - if (fun == &vFuupii) return 1; - if (fun == &vFuuppu) return 1; - if (fun == &vFuffff) return 5; - if (fun == &vFudddd) return 5; - if (fun == &vFulill) return 1; - if (fun == &vFullll) return 1; - if (fun == &vFullpu) return 1; - if (fun == &vFuLLLL) return 1; - if (fun == &vFupiii) return 1; - if (fun == &vFupupi) return 1; - if (fun == &vFupupp) return 1; - if (fun == &vFuplii) return 1; - if (fun == &vFuppip) return 1; - if (fun == &vFupppu) return 1; - if (fun == &vFupppp) return 1; - if (fun == &vFfffff) return 6; - if (fun == &vFddddp) return 5; - if (fun == &vFluipp) return 1; - if (fun == &vFLpppi) return 1; - if (fun == &vFLpppp) return 1; - if (fun == &vFpiiii) return 1; - if (fun == &vFpiiiI) return 1; - if (fun == &vFpiiiu) return 1; - if (fun == &vFpiiip) return 1; - if (fun == &vFpiiII) return 1; - if (fun == &vFpiiuu) return 1; - if (fun == &vFpiiup) return 1; - if (fun == &vFpiiff) return 3; - if (fun == &vFpiipp) return 1; - if (fun == &vFpiIiI) return 1; - if (fun == &vFpiIII) return 1; - if (fun == &vFpiuuu) return 1; - if (fun == &vFpiUUu) return 1; - if (fun == &vFpiUUp) return 1; - if (fun == &vFpilpp) return 1; - if (fun == &vFpipii) return 1; - if (fun == &vFpippi) return 1; - if (fun == &vFpippp) return 1; - if (fun == &vFpuiip) return 1; - if (fun == &vFpuipp) return 1; - if (fun == &vFpuuuu) return 1; - if (fun == &vFpuuup) return 1; - if (fun == &vFpuupp) return 1; - if (fun == &vFpuddd) return 4; - if (fun == &vFpupiu) return 1; - if (fun == &vFpupup) return 1; - if (fun == &vFpUuuu) return 1; - if (fun == &vFpUUuu) return 1; - if (fun == &vFpUUup) return 1; - if (fun == &vFpUUUi) return 1; - if (fun == &vFpUUUu) return 1; - if (fun == &vFpUUUp) return 1; - if (fun == &vFpfffi) return 4; - if (fun == &vFpffff) return 5; - if (fun == &vFpdiII) return 2; - if (fun == &vFpddii) return 3; - if (fun == &vFpdddd) return 5; - if (fun == &vFpddpp) return 3; - if (fun == &vFpluul) return 1; - if (fun == &vFplppp) return 1; - if (fun == &vFpLLLL) return 1; - if (fun == &vFpLLpp) return 1; - if (fun == &vFpLpiL) return 1; - if (fun == &vFppiii) return 1; - if (fun == &vFppiiu) return 1; - if (fun == &vFppiip) return 1; - if (fun == &vFppiui) return 1; - if (fun == &vFppiup) return 1; - if (fun == &vFppiff) return 3; - if (fun == &vFppidd) return 3; - if (fun == &vFppipi) return 1; - if (fun == &vFppipp) return 1; - if (fun == &vFppWui) return 1; - if (fun == &vFppuii) return 1; - if (fun == &vFppuui) return 1; - if (fun == &vFppuuu) return 1; - if (fun == &vFppuup) return 1; - if (fun == &vFppudd) return 3; - if (fun == &vFppupi) return 1; - if (fun == &vFppupu) return 1; - if (fun == &vFppupp) return 1; - if (fun == &vFppfff) return 4; - if (fun == &vFppddp) return 3; - if (fun == &vFppLLL) return 1; - if (fun == &vFppLpL) return 1; - if (fun == &vFpppii) return 1; - if (fun == &vFpppip) return 1; - if (fun == &vFpppui) return 1; - if (fun == &vFpppuu) return 1; - if (fun == &vFpppup) return 1; - if (fun == &vFpppff) return 3; - if (fun == &vFpppdd) return 3; - if (fun == &vFpppLp) return 1; - if (fun == &vFppppi) return 1; - if (fun == &vFppppu) return 1; - if (fun == &vFppppL) return 1; - if (fun == &vFppppp) return 1; - if (fun == &iFiiipu) return 1; - if (fun == &iFiiipp) return 1; - if (fun == &iFiiupp) return 1; - if (fun == &iFiuuuu) return 1; - if (fun == &iFiuuup) return 1; - if (fun == &iFiuLip) return 1; - if (fun == &iFillLL) return 1; - if (fun == &iFipiii) return 1; - if (fun == &iFipiup) return 1; - if (fun == &iFipipi) return 1; - if (fun == &iFipipu) return 1; - if (fun == &iFipuip) return 1; - if (fun == &iFipuui) return 1; - if (fun == &iFipLup) return 1; - if (fun == &iFippuu) return 1; - if (fun == &iFippLi) return 1; - if (fun == &iFippLp) return 1; - if (fun == &iFipppi) return 1; - if (fun == &iFipppp) return 1; - if (fun == &iFuuupp) return 1; - if (fun == &iFuppLp) return 1; - if (fun == &iFLppip) return 1; - if (fun == &iFLpppp) return 1; - if (fun == &iFpwwww) return 1; - if (fun == &iFpwppp) return 1; - if (fun == &iFpiiii) return 1; - if (fun == &iFpiiiu) return 1; - if (fun == &iFpiiiL) return 1; - if (fun == &iFpiiip) return 1; - if (fun == &iFpiiui) return 1; - if (fun == &iFpiiuu) return 1; - if (fun == &iFpiipi) return 1; - if (fun == &iFpiipp) return 1; - if (fun == &iFpiIip) return 1; - if (fun == &iFpiuwp) return 1; - if (fun == &iFpiuuu) return 1; - if (fun == &iFpiUUU) return 1; - if (fun == &iFpipii) return 1; - if (fun == &iFpipiu) return 1; - if (fun == &iFpipiL) return 1; - if (fun == &iFpipip) return 1; - if (fun == &iFpippi) return 1; - if (fun == &iFpippW) return 1; - if (fun == &iFpippp) return 1; - if (fun == &iFpCCCC) return 1; - if (fun == &iFpCupp) return 1; - if (fun == &iFpCpip) return 1; - if (fun == &iFpuill) return 1; - if (fun == &iFpuipi) return 1; - if (fun == &iFpuipp) return 1; - if (fun == &iFpuuip) return 1; - if (fun == &iFpuuui) return 1; - if (fun == &iFpuuup) return 1; - if (fun == &iFpuuLL) return 1; - if (fun == &iFpuupp) return 1; - if (fun == &iFpulup) return 1; - if (fun == &iFpulpp) return 1; - if (fun == &iFpuLpL) return 1; - if (fun == &iFpuLpp) return 1; - if (fun == &iFpupui) return 1; - if (fun == &iFpupuu) return 1; - if (fun == &iFpupuU) return 1; - if (fun == &iFpupup) return 1; - if (fun == &iFpuppL) return 1; - if (fun == &iFpuppp) return 1; - if (fun == &iFpUiUi) return 1; - if (fun == &iFpUupp) return 1; - if (fun == &iFplupp) return 1; - if (fun == &iFplluu) return 1; - if (fun == &iFpLiup) return 1; - if (fun == &iFpLilp) return 1; - if (fun == &iFpLiLi) return 1; - if (fun == &iFpLlpp) return 1; - if (fun == &iFpLLii) return 1; - if (fun == &iFpLLup) return 1; - if (fun == &iFpLLpp) return 1; - if (fun == &iFpLpii) return 1; - if (fun == &iFpLpiL) return 1; - if (fun == &iFpLpuL) return 1; - if (fun == &iFpLpup) return 1; - if (fun == &iFpLpLi) return 1; - if (fun == &iFpLppi) return 1; - if (fun == &iFpLppL) return 1; - if (fun == &iFpLppp) return 1; - if (fun == &iFppiiu) return 1; - if (fun == &iFppiiL) return 1; - if (fun == &iFppiip) return 1; - if (fun == &iFppiuu) return 1; - if (fun == &iFppiup) return 1; - if (fun == &iFppiLi) return 1; - if (fun == &iFppiLL) return 1; - if (fun == &iFppipi) return 1; - if (fun == &iFppipu) return 1; - if (fun == &iFppipp) return 1; - if (fun == &iFppuwp) return 1; - if (fun == &iFppuip) return 1; - if (fun == &iFppuuu) return 1; - if (fun == &iFppuup) return 1; - if (fun == &iFppupi) return 1; - if (fun == &iFppupu) return 1; - if (fun == &iFppupp) return 1; - if (fun == &iFppUup) return 1; - if (fun == &iFpplii) return 1; - if (fun == &iFppllp) return 1; - if (fun == &iFpplpp) return 1; - if (fun == &iFppLup) return 1; - if (fun == &iFppLpi) return 1; - if (fun == &iFppLpL) return 1; - if (fun == &iFppLpp) return 1; - if (fun == &iFpppii) return 1; - if (fun == &iFpppip) return 1; - if (fun == &iFpppui) return 1; - if (fun == &iFpppup) return 1; - if (fun == &iFpppUi) return 1; - if (fun == &iFpppLi) return 1; - if (fun == &iFpppLL) return 1; - if (fun == &iFpppLp) return 1; - if (fun == &iFppppi) return 1; - if (fun == &iFppppu) return 1; - if (fun == &iFppppl) return 1; - if (fun == &iFppppL) return 1; - if (fun == &iFppppp) return 1; - if (fun == &IFppIII) return 1; - if (fun == &uFiuuuu) return 1; - if (fun == &uFiuppi) return 1; - if (fun == &uFipipp) return 1; - if (fun == &uFipLpp) return 1; - if (fun == &uFuiiii) return 1; - if (fun == &uFLpppL) return 1; - if (fun == &uFpCCCC) return 1; - if (fun == &uFpWuip) return 1; - if (fun == &uFpuuui) return 1; - if (fun == &uFpuuuu) return 1; - if (fun == &uFpuupp) return 1; - if (fun == &uFpupuu) return 1; - if (fun == &uFpuppp) return 1; - if (fun == &uFppipp) return 1; - if (fun == &uFppuup) return 1; - if (fun == &uFppupp) return 1; - if (fun == &uFpplip) return 1; - if (fun == &uFppLpp) return 1; - if (fun == &uFppppL) return 1; - if (fun == &uFppppp) return 1; - if (fun == &UFuiiii) return 1; - if (fun == &lFipili) return 1; - if (fun == &lFipLli) return 1; - if (fun == &lFipLlL) return 1; - if (fun == &lFipLLi) return 1; - if (fun == &lFipLpp) return 1; - if (fun == &lFpuipC) return 1; - if (fun == &lFpuuLL) return 1; - if (fun == &lFppupp) return 1; - if (fun == &lFppllp) return 1; - if (fun == &lFppLpL) return 1; - if (fun == &lFppLpp) return 1; - if (fun == &LFuiCiu) return 1; - if (fun == &LFLpppL) return 1; - if (fun == &LFpuipp) return 1; - if (fun == &LFpuppi) return 1; - if (fun == &LFpLuuu) return 1; - if (fun == &LFpLLLp) return 1; - if (fun == &LFpLpuu) return 1; - if (fun == &LFpLppL) return 1; - if (fun == &LFpLppp) return 1; - if (fun == &LFppLLp) return 1; - if (fun == &LFppLpL) return 1; - if (fun == &LFpppii) return 1; - if (fun == &LFppppp) return 1; - if (fun == &pFiiiii) return 1; - if (fun == &pFiiipL) return 1; - if (fun == &pFipipL) return 1; - if (fun == &pFipipp) return 1; - if (fun == &pFuiiiu) return 1; - if (fun == &pFuiupp) return 1; - if (fun == &pFuuiip) return 1; - if (fun == &pFuuupu) return 1; - if (fun == &pFuupuu) return 1; - if (fun == &pFudddp) return 4; - if (fun == &pFupLpl) return 1; - if (fun == &pFupLpL) return 1; - if (fun == &pFddddi) return 5; - if (fun == &pFLuppp) return 1; - if (fun == &pFLpppi) return 1; - if (fun == &pFpiiii) return 1; - if (fun == &pFpiiip) return 1; - if (fun == &pFpiiuu) return 1; - if (fun == &pFpiipi) return 1; - if (fun == &pFpiipL) return 1; - if (fun == &pFpiipp) return 1; - if (fun == &pFpiCCC) return 1; - if (fun == &pFpiuuu) return 1; - if (fun == &pFpiuup) return 1; - if (fun == &pFpiupp) return 1; - if (fun == &pFpiLip) return 1; - if (fun == &pFpipip) return 1; - if (fun == &pFpipup) return 1; - if (fun == &pFpippi) return 1; - if (fun == &pFpippp) return 1; - if (fun == &pFpuiii) return 1; - if (fun == &pFpuiip) return 1; - if (fun == &pFpuuip) return 1; - if (fun == &pFpuuuu) return 1; - if (fun == &pFpuuup) return 1; - if (fun == &pFpuupp) return 1; - if (fun == &pFpuLpp) return 1; - if (fun == &pFpuppu) return 1; - if (fun == &pFpuppp) return 1; - if (fun == &pFpUdii) return 2; - if (fun == &pFpfffi) return 4; - if (fun == &pFpdddd) return 5; - if (fun == &pFplppp) return 1; - if (fun == &pFpLiii) return 1; - if (fun == &pFpLLip) return 1; - if (fun == &pFpLLLp) return 1; - if (fun == &pFpLpii) return 1; - if (fun == &pFpLpip) return 1; - if (fun == &pFpLpup) return 1; - if (fun == &pFppiii) return 1; - if (fun == &pFppiiu) return 1; - if (fun == &pFppiip) return 1; - if (fun == &pFppiup) return 1; - if (fun == &pFppipi) return 1; - if (fun == &pFppipp) return 1; - if (fun == &pFppWpp) return 1; - if (fun == &pFppuip) return 1; - if (fun == &pFppuuu) return 1; - if (fun == &pFppuup) return 1; - if (fun == &pFppupp) return 1; - if (fun == &pFppddu) return 3; - if (fun == &pFppLii) return 1; - if (fun == &pFppLLi) return 1; - if (fun == &pFppLpp) return 1; - if (fun == &pFpppii) return 1; - if (fun == &pFpppip) return 1; - if (fun == &pFpppui) return 1; - if (fun == &pFpppup) return 1; - if (fun == &pFpppli) return 1; - if (fun == &pFpppLi) return 1; - if (fun == &pFppppi) return 1; - if (fun == &pFppppu) return 1; - if (fun == &pFppppL) return 1; - if (fun == &pFppppp) return 1; - if (fun == &vFiiiiii) return 1; - if (fun == &vFiiiuil) return 1; - if (fun == &vFiiilpi) return 1; - if (fun == &vFiiuilp) return 1; - if (fun == &vFiffiff) return 5; - if (fun == &vFiddidd) return 5; - if (fun == &vFilipli) return 1; - if (fun == &vFiliplu) return 1; - if (fun == &vFillill) return 1; - if (fun == &vFipiplp) return 1; - if (fun == &vFCCCCff) return 3; - if (fun == &vFuiiiii) return 1; - if (fun == &vFuiiiip) return 1; - if (fun == &vFuiiuii) return 1; - if (fun == &vFuiiuup) return 1; - if (fun == &vFuiuiii) return 1; - if (fun == &vFuiuiiC) return 1; - if (fun == &vFuiuiil) return 1; - if (fun == &vFuiuiip) return 1; - if (fun == &vFuiuiuu) return 1; - if (fun == &vFuiuiuL) return 1; - if (fun == &vFuiuCip) return 1; - if (fun == &vFuiuuip) return 1; - if (fun == &vFuiuuuu) return 1; - if (fun == &vFuiupii) return 1; - if (fun == &vFuiupiu) return 1; - if (fun == &vFuiffff) return 5; - if (fun == &vFuidddd) return 5; - if (fun == &vFuillll) return 1; - if (fun == &vFuiLLLL) return 1; - if (fun == &vFuipiup) return 1; - if (fun == &vFuCuuip) return 1; - if (fun == &vFuuiiii) return 1; - if (fun == &vFuuiiiu) return 1; - if (fun == &vFuuiuii) return 1; - if (fun == &vFuuiuil) return 1; - if (fun == &vFuuiuip) return 1; - if (fun == &vFuuiuCu) return 1; - if (fun == &vFuuiuup) return 1; - if (fun == &vFuuippp) return 1; - if (fun == &vFuuuiii) return 1; - if (fun == &vFuuuiup) return 1; - if (fun == &vFuuuipi) return 1; - if (fun == &vFuuuipC) return 1; - if (fun == &vFuuuipp) return 1; - if (fun == &vFuuuuii) return 1; - if (fun == &vFuuuuip) return 1; - if (fun == &vFuuuuuu) return 1; - if (fun == &vFuuuull) return 1; - if (fun == &vFuuuppi) return 1; - if (fun == &vFuuuppp) return 1; - if (fun == &vFuuffff) return 5; - if (fun == &vFuudddd) return 5; - if (fun == &vFuupiii) return 1; - if (fun == &vFuupupp) return 1; - if (fun == &vFuuplii) return 1; - if (fun == &vFuffiip) return 3; - if (fun == &vFufffff) return 6; - if (fun == &vFuddiip) return 3; - if (fun == &vFullill) return 1; - if (fun == &vFulluLC) return 1; - if (fun == &vFupiiii) return 1; - if (fun == &vFupupip) return 1; - if (fun == &vFuppppu) return 1; - if (fun == &vFuppppp) return 1; - if (fun == &vFUUpppp) return 1; - if (fun == &vFffffff) return 7; - if (fun == &vFdddddd) return 7; - if (fun == &vFdddppp) return 4; - if (fun == &vFpiiiii) return 1; - if (fun == &vFpiiipp) return 1; - if (fun == &vFpiiuuu) return 1; - if (fun == &vFpiippi) return 1; - if (fun == &vFpiippp) return 1; - if (fun == &vFpiUuup) return 1; - if (fun == &vFpipipp) return 1; - if (fun == &vFpipppi) return 1; - if (fun == &vFpipppp) return 1; - if (fun == &vFpuiiii) return 1; - if (fun == &vFpuiiiu) return 1; - if (fun == &vFpuiipp) return 1; - if (fun == &vFpuuuiu) return 1; - if (fun == &vFpuuuup) return 1; - if (fun == &vFpuuupp) return 1; - if (fun == &vFpuupuu) return 1; - if (fun == &vFpuuppp) return 1; - if (fun == &vFpudddd) return 5; - if (fun == &vFpupiUu) return 1; - if (fun == &vFpupuuu) return 1; - if (fun == &vFpupupu) return 1; - if (fun == &vFpuppuu) return 1; - if (fun == &vFpupppp) return 1; - if (fun == &vFpUiUup) return 1; - if (fun == &vFpUipup) return 1; - if (fun == &vFpUuuup) return 1; - if (fun == &vFpUUiup) return 1; - if (fun == &vFpdddii) return 4; - if (fun == &vFpddddd) return 6; - if (fun == &vFpddddp) return 5; - if (fun == &vFppiiii) return 1; - if (fun == &vFppiiip) return 1; - if (fun == &vFppiiuu) return 1; - if (fun == &vFppiipi) return 1; - if (fun == &vFppiipp) return 1; - if (fun == &vFppilpp) return 1; - if (fun == &vFppipLp) return 1; - if (fun == &vFppippi) return 1; - if (fun == &vFppippp) return 1; - if (fun == &vFppuiii) return 1; - if (fun == &vFppuiiu) return 1; - if (fun == &vFppuiip) return 1; - if (fun == &vFppuuuu) return 1; - if (fun == &vFppuUUU) return 1; - if (fun == &vFppupii) return 1; - if (fun == &vFppuppp) return 1; - if (fun == &vFppffff) return 5; - if (fun == &vFppdidd) return 4; - if (fun == &vFppdddd) return 5; - if (fun == &vFpplppi) return 1; - if (fun == &vFpplppp) return 1; - if (fun == &vFppLppi) return 1; - if (fun == &vFppLppp) return 1; - if (fun == &vFpppiii) return 1; - if (fun == &vFpppiip) return 1; - if (fun == &vFpppiui) return 1; - if (fun == &vFpppiff) return 3; - if (fun == &vFpppipu) return 1; - if (fun == &vFpppuii) return 1; - if (fun == &vFpppuuu) return 1; - if (fun == &vFppppii) return 1; - if (fun == &vFpppppi) return 1; - if (fun == &vFpppppu) return 1; - if (fun == &vFpppppU) return 1; - if (fun == &vFpppppL) return 1; - if (fun == &vFpppppp) return 1; - if (fun == &cFppLppi) return 1; - if (fun == &iFiiiiip) return 1; - if (fun == &iFiiiipp) return 1; - if (fun == &iFiiiuwp) return 1; - if (fun == &iFiWiipi) return 1; - if (fun == &iFiuUuUu) return 1; - if (fun == &iFilpppp) return 1; - if (fun == &iFiLpppi) return 1; - if (fun == &iFipiipi) return 1; - if (fun == &iFipipip) return 1; - if (fun == &iFipippp) return 1; - if (fun == &iFipuIup) return 1; - if (fun == &iFipupup) return 1; - if (fun == &iFipuppp) return 1; - if (fun == &iFipppLp) return 1; - if (fun == &iFippppp) return 1; - if (fun == &iFdipppL) return 2; - if (fun == &iFlpippp) return 1; - if (fun == &iFLpppii) return 1; - if (fun == &iFpiiiii) return 1; - if (fun == &iFpiiiiu) return 1; - if (fun == &iFpiiiip) return 1; - if (fun == &iFpiiipp) return 1; - if (fun == &iFpiiuii) return 1; - if (fun == &iFpiiuui) return 1; - if (fun == &iFpiiupp) return 1; - if (fun == &iFpiipip) return 1; - if (fun == &iFpiippp) return 1; - if (fun == &iFpiCCpu) return 1; - if (fun == &iFpiuuup) return 1; - if (fun == &iFpiuupp) return 1; - if (fun == &iFpipiii) return 1; - if (fun == &iFpipipi) return 1; - if (fun == &iFpipipp) return 1; - if (fun == &iFpipupp) return 1; - if (fun == &iFpipLpp) return 1; - if (fun == &iFpippip) return 1; - if (fun == &iFpippup) return 1; - if (fun == &iFpipppp) return 1; - if (fun == &iFpCiipp) return 1; - if (fun == &iFpCpipu) return 1; - if (fun == &iFpWipip) return 1; - if (fun == &iFpWpppp) return 1; - if (fun == &iFpuiCpp) return 1; - if (fun == &iFpuippp) return 1; - if (fun == &iFpuuuuu) return 1; - if (fun == &iFpuuuup) return 1; - if (fun == &iFpuuupu) return 1; - if (fun == &iFpuuupp) return 1; - if (fun == &iFpuuLpp) return 1; - if (fun == &iFpuupuu) return 1; - if (fun == &iFpuuppp) return 1; - if (fun == &iFpuLLpp) return 1; - if (fun == &iFpupuui) return 1; - if (fun == &iFpupLpL) return 1; - if (fun == &iFpupLpp) return 1; - if (fun == &iFpUiipp) return 1; - if (fun == &iFpUuuLp) return 1; - if (fun == &iFpUUUup) return 1; - if (fun == &iFpUUUUp) return 1; - if (fun == &iFpdpipp) return 2; - if (fun == &iFpLiiiL) return 1; - if (fun == &iFpLiiip) return 1; - if (fun == &iFpLiiuu) return 1; - if (fun == &iFpLipLu) return 1; - if (fun == &iFpLuipp) return 1; - if (fun == &iFpLuupp) return 1; - if (fun == &iFpLupip) return 1; - if (fun == &iFpLLLLL) return 1; - if (fun == &iFpLLppp) return 1; - if (fun == &iFpLpipi) return 1; - if (fun == &iFpLppii) return 1; - if (fun == &iFpLpppL) return 1; - if (fun == &iFpLpppp) return 1; - if (fun == &iFppiiii) return 1; - if (fun == &iFppiiip) return 1; - if (fun == &iFppiipi) return 1; - if (fun == &iFppiipp) return 1; - if (fun == &iFppiupp) return 1; - if (fun == &iFppilpp) return 1; - if (fun == &iFppipii) return 1; - if (fun == &iFppipiL) return 1; - if (fun == &iFppipip) return 1; - if (fun == &iFppippi) return 1; - if (fun == &iFppippu) return 1; - if (fun == &iFppippp) return 1; - if (fun == &iFppIppp) return 1; - if (fun == &iFppuiii) return 1; - if (fun == &iFppuIII) return 1; - if (fun == &iFppuupp) return 1; - if (fun == &iFppuLpp) return 1; - if (fun == &iFppupip) return 1; - if (fun == &iFppuppp) return 1; - if (fun == &iFppdidd) return 4; - if (fun == &iFpplupp) return 1; - if (fun == &iFpplppi) return 1; - if (fun == &iFppLupp) return 1; - if (fun == &iFppLLiL) return 1; - if (fun == &iFppLLup) return 1; - if (fun == &iFppLLpp) return 1; - if (fun == &iFppLpLp) return 1; - if (fun == &iFppLppp) return 1; - if (fun == &iFpppiuu) return 1; - if (fun == &iFpppipi) return 1; - if (fun == &iFpppipu) return 1; - if (fun == &iFpppipp) return 1; - if (fun == &iFpppuii) return 1; - if (fun == &iFpppuup) return 1; - if (fun == &iFpppupu) return 1; - if (fun == &iFpppupp) return 1; - if (fun == &iFpppLpp) return 1; - if (fun == &iFppppii) return 1; - if (fun == &iFppppiu) return 1; - if (fun == &iFppppip) return 1; - if (fun == &iFppppup) return 1; - if (fun == &iFppppLp) return 1; - if (fun == &iFpppppi) return 1; - if (fun == &iFpppppL) return 1; - if (fun == &iFpppppp) return 1; - if (fun == &uFuuuuuu) return 1; - if (fun == &uFupuufp) return 2; - if (fun == &uFuppppp) return 1; - if (fun == &uFpiuppu) return 1; - if (fun == &uFpWuipp) return 1; - if (fun == &uFpWuuCp) return 1; - if (fun == &uFpuippp) return 1; - if (fun == &uFpuuuup) return 1; - if (fun == &uFpuuupp) return 1; - if (fun == &uFpuuppp) return 1; - if (fun == &uFpupupu) return 1; - if (fun == &uFpupppp) return 1; - if (fun == &uFppippp) return 1; - if (fun == &uFppuuup) return 1; - if (fun == &uFppuupu) return 1; - if (fun == &uFppLppL) return 1; - if (fun == &uFpppppi) return 1; - if (fun == &uFpppppp) return 1; - if (fun == &lFipipLu) return 1; - if (fun == &lFipLipu) return 1; - if (fun == &lFipLipp) return 1; - if (fun == &lFipLpLL) return 1; - if (fun == &lFpipill) return 1; - if (fun == &lFpuuLLp) return 1; - if (fun == &lFpplllp) return 1; - if (fun == &lFppLipp) return 1; - if (fun == &lFpppLpp) return 1; - if (fun == &LFpipipi) return 1; - if (fun == &LFpLippp) return 1; - if (fun == &LFpLLLLL) return 1; - if (fun == &LFppLLpL) return 1; - if (fun == &LFppLpLL) return 1; - if (fun == &pFiiiiii) return 1; - if (fun == &pFiiiiid) return 2; - if (fun == &pFipippp) return 1; - if (fun == &pFWCiWCi) return 1; - if (fun == &pFuCCCCp) return 1; - if (fun == &pFuuipip) return 1; - if (fun == &pFuuuiip) return 1; - if (fun == &pFuuuuii) return 1; - if (fun == &pFuuuuuu) return 1; - if (fun == &pFuuuuup) return 1; - if (fun == &pFuuppuu) return 1; - if (fun == &pFuppppp) return 1; - if (fun == &pFdddddd) return 7; - if (fun == &pFpiiiiu) return 1; - if (fun == &pFpiiipp) return 1; - if (fun == &pFpiiCCC) return 1; - if (fun == &pFpiiuup) return 1; - if (fun == &pFpiUUUU) return 1; - if (fun == &pFpipipp) return 1; - if (fun == &pFpippip) return 1; - if (fun == &pFpipppp) return 1; - if (fun == &pFpuiiip) return 1; - if (fun == &pFpuuuuu) return 1; - if (fun == &pFpuuupu) return 1; - if (fun == &pFpupuui) return 1; - if (fun == &pFpuppip) return 1; - if (fun == &pFpupppp) return 1; - if (fun == &pFplpppp) return 1; - if (fun == &pFpLuLpp) return 1; - if (fun == &pFpLpLLi) return 1; - if (fun == &pFpLppii) return 1; - if (fun == &pFpLppip) return 1; - if (fun == &pFpLppup) return 1; - if (fun == &pFppiiii) return 1; - if (fun == &pFppiipp) return 1; - if (fun == &pFppiCCC) return 1; - if (fun == &pFppiupp) return 1; - if (fun == &pFppilpp) return 1; - if (fun == &pFppipip) return 1; - if (fun == &pFppippi) return 1; - if (fun == &pFppippp) return 1; - if (fun == &pFppuupp) return 1; - if (fun == &pFppuppp) return 1; - if (fun == &pFpplplp) return 1; - if (fun == &pFpplppp) return 1; - if (fun == &pFpppupp) return 1; - if (fun == &pFpppLii) return 1; - if (fun == &pFpppLui) return 1; - if (fun == &pFppppii) return 1; - if (fun == &pFpppppi) return 1; - if (fun == &pFpppppu) return 1; - if (fun == &pFpppppp) return 1; - if (fun == &vFiiffffp) return 5; - if (fun == &vFCCCCfff) return 4; - if (fun == &vFuipffff) return 5; - if (fun == &vFuipdddd) return 5; - if (fun == &vFuuuffff) return 5; - if (fun == &vFuuudddd) return 5; - if (fun == &vFuuffiip) return 3; - if (fun == &vFuuddiip) return 3; - if (fun == &vFuffffff) return 7; - if (fun == &vFudddddd) return 7; - if (fun == &vFpddiidd) return 5; - if (fun == &vFpdddddd) return 7; - if (fun == &vFppddddu) return 5; - if (fun == &vFppddpiu) return 3; - if (fun == &vFpppffff) return 5; - if (fun == &iFppppdpu) return 2; - if (fun == &pFifffppp) return 4; - if (fun == &pFfiiiiid) return 3; - if (fun == &pFdiiiIiI) return 2; - if (fun == &pFpiiiiid) return 2; - if (fun == &pFpiiUdii) return 2; - if (fun == &pFpppfffi) return 4; - if (fun == &pFpppdddi) return 4; - if (fun == &vFuCCCCfff) return 4; - if (fun == &vFuuufffff) return 6; - if (fun == &vFffffffff) return 9; - if (fun == &vFpudddddd) return 7; - if (fun == &vFuffffffff) return 9; - if (fun == &vFffCCCCfff) return 6; - if (fun == &vFppddddudd) return 7; - if (fun == &vFpppffffff) return 7; - if (fun == &iFdddpppppp) return 4; - if (fun == &vFuffiiffiip) return 5; - if (fun == &vFuddiiddiip) return 5; - if (fun == &vFppdddddddd) return 9; - if (fun == &iFpippddiidd) return 5; - if (fun == &lFpLppdddddd) return 7; -#if defined(NOALIGN) - if (fun == &iFipiip) return 1; -#endif -#if !defined(STATICBUILD) - if (fun == &iFlip) return 1; - if (fun == &iFLLi) return 1; - if (fun == &iFLLiW) return 1; - if (fun == &iFpipppL) return 1; -#endif - return 0; -} -#elif defined(RV64) -int isSimpleWrapper(wrapper_t fun) { - if (fun == &vFv) return 1; - if (fun == &vFC) return 1; - if (fun == &vFW) return 1; - if (fun == &vFu) return 1; - if (fun == &vFU) return 1; - if (fun == &vFf) return 3; - if (fun == &vFd) return 3; - if (fun == &vFl) return 1; - if (fun == &vFL) return 1; - if (fun == &vFp) return 1; - if (fun == &IFv) return 1; - if (fun == &IFI) return 1; - if (fun == &IFf) return 3; - if (fun == &IFd) return 3; - if (fun == &IFp) return 1; - if (fun == &CFv) return 1; - if (fun == &CFC) return 1; - if (fun == &CFW) return 1; - if (fun == &CFu) return 1; - if (fun == &CFl) return 1; - if (fun == &CFL) return 1; - if (fun == &CFp) return 1; - if (fun == &WFW) return 1; - if (fun == &WFu) return 1; - if (fun == &WFp) return 1; - if (fun == &uFv) return 1; - if (fun == &uFu) return 1; - if (fun == &uFd) return 3; - if (fun == &uFl) return 1; - if (fun == &uFL) return 1; - if (fun == &uFp) return 1; - if (fun == &UFv) return 1; - if (fun == &UFu) return 1; - if (fun == &UFp) return 1; - if (fun == &fFf) return -3; - if (fun == &fFp) return -1; - if (fun == &dFv) return -1; - if (fun == &dFu) return -1; - if (fun == &dFd) return -3; - if (fun == &dFL) return -1; - if (fun == &dFp) return -1; - if (fun == &lFv) return 1; - if (fun == &lFu) return 1; - if (fun == &lFl) return 1; - if (fun == &lFp) return 1; - if (fun == &LFv) return 1; - if (fun == &LFu) return 1; - if (fun == &LFd) return 3; - if (fun == &LFL) return 1; - if (fun == &LFp) return 1; - if (fun == &pFv) return 1; - if (fun == &pFC) return 1; - if (fun == &pFW) return 1; - if (fun == &pFu) return 1; - if (fun == &pFU) return 1; - if (fun == &pFd) return 3; - if (fun == &pFl) return 1; - if (fun == &pFL) return 1; - if (fun == &pFp) return 1; - if (fun == &vFWW) return 1; - if (fun == &vFWp) return 1; - if (fun == &vFuC) return 1; - if (fun == &vFuW) return 1; - if (fun == &vFuu) return 1; - if (fun == &vFuU) return 1; - if (fun == &vFuf) return 3; - if (fun == &vFud) return 3; - if (fun == &vFul) return 1; - if (fun == &vFuL) return 1; - if (fun == &vFup) return 1; - if (fun == &vFfC) return 3; - if (fun == &vFff) return 5; - if (fun == &vFfp) return 3; - if (fun == &vFdd) return 5; - if (fun == &vFlu) return 1; - if (fun == &vFlp) return 1; - if (fun == &vFLu) return 1; - if (fun == &vFLL) return 1; - if (fun == &vFLp) return 1; - if (fun == &vFpI) return 1; - if (fun == &vFpC) return 1; - if (fun == &vFpW) return 1; - if (fun == &vFpu) return 1; - if (fun == &vFpU) return 1; - if (fun == &vFpf) return 3; - if (fun == &vFpd) return 3; - if (fun == &vFpl) return 1; - if (fun == &vFpL) return 1; - if (fun == &vFpp) return 1; - if (fun == &IFII) return 1; - if (fun == &IFpu) return 1; - if (fun == &IFpd) return 3; - if (fun == &IFpp) return 1; - if (fun == &CFuW) return 1; - if (fun == &CFuu) return 1; - if (fun == &CFuL) return 1; - if (fun == &CFpu) return 1; - if (fun == &CFpL) return 1; - if (fun == &CFpp) return 1; - if (fun == &WFpp) return 1; - if (fun == &uFuu) return 1; - if (fun == &uFup) return 1; - if (fun == &uFpC) return 1; - if (fun == &uFpu) return 1; - if (fun == &uFpU) return 1; - if (fun == &uFpf) return 3; - if (fun == &uFpl) return 1; - if (fun == &uFpL) return 1; - if (fun == &uFpp) return 1; - if (fun == &UFuu) return 1; - if (fun == &UFUp) return 1; - if (fun == &UFpU) return 1; - if (fun == &UFpp) return 1; - if (fun == &fFff) return -5; - if (fun == &fFfp) return -3; - if (fun == &fFpu) return -1; - if (fun == &fFpp) return -1; - if (fun == &dFdd) return -5; - if (fun == &dFdp) return -3; - if (fun == &dFll) return -1; - if (fun == &dFpu) return -1; - if (fun == &dFpd) return -3; - if (fun == &dFpp) return -1; - if (fun == &lFll) return 1; - if (fun == &lFpd) return 3; - if (fun == &lFpl) return 1; - if (fun == &lFpp) return 1; - if (fun == &LFuu) return 1; - if (fun == &LFUp) return 1; - if (fun == &LFLL) return 1; - if (fun == &LFLp) return 1; - if (fun == &LFpu) return 1; - if (fun == &LFpL) return 1; - if (fun == &LFpp) return 1; - if (fun == &pFuu) return 1; - if (fun == &pFup) return 1; - if (fun == &pFUU) return 1; - if (fun == &pFdd) return 5; - if (fun == &pFll) return 1; - if (fun == &pFlp) return 1; - if (fun == &pFLC) return 1; - if (fun == &pFLu) return 1; - if (fun == &pFLL) return 1; - if (fun == &pFLp) return 1; - if (fun == &pFpC) return 1; - if (fun == &pFpW) return 1; - if (fun == &pFpu) return 1; - if (fun == &pFpU) return 1; - if (fun == &pFpd) return 3; - if (fun == &pFpl) return 1; - if (fun == &pFpL) return 1; - if (fun == &pFpp) return 1; - if (fun == &vFCCC) return 1; - if (fun == &vFWWW) return 1; - if (fun == &vFuWW) return 1; - if (fun == &vFuuC) return 1; - if (fun == &vFuuu) return 1; - if (fun == &vFuuU) return 1; - if (fun == &vFuuf) return 3; - if (fun == &vFuud) return 3; - if (fun == &vFuuL) return 1; - if (fun == &vFuup) return 1; - if (fun == &vFuff) return 5; - if (fun == &vFufp) return 3; - if (fun == &vFudd) return 5; - if (fun == &vFull) return 1; - if (fun == &vFulp) return 1; - if (fun == &vFuLL) return 1; - if (fun == &vFuLp) return 1; - if (fun == &vFupu) return 1; - if (fun == &vFupp) return 1; - if (fun == &vFfff) return 7; - if (fun == &vFfpp) return 3; - if (fun == &vFddd) return 7; - if (fun == &vFdpp) return 3; - if (fun == &vFllp) return 1; - if (fun == &vFlpp) return 1; - if (fun == &vFLup) return 1; - if (fun == &vFLpL) return 1; - if (fun == &vFLpp) return 1; - if (fun == &vFpuI) return 1; - if (fun == &vFpuW) return 1; - if (fun == &vFpuu) return 1; - if (fun == &vFpuU) return 1; - if (fun == &vFpuf) return 3; - if (fun == &vFpud) return 3; - if (fun == &vFpuL) return 1; - if (fun == &vFpup) return 1; - if (fun == &vFpUu) return 1; - if (fun == &vFpUU) return 1; - if (fun == &vFpUf) return 3; - if (fun == &vFpUp) return 1; - if (fun == &vFpff) return 5; - if (fun == &vFpdu) return 3; - if (fun == &vFpdd) return 5; - if (fun == &vFpdp) return 3; - if (fun == &vFpll) return 1; - if (fun == &vFplp) return 1; - if (fun == &vFpLu) return 1; - if (fun == &vFpLL) return 1; - if (fun == &vFpLp) return 1; - if (fun == &vFppu) return 1; - if (fun == &vFppU) return 1; - if (fun == &vFppf) return 3; - if (fun == &vFppd) return 3; - if (fun == &vFppl) return 1; - if (fun == &vFppL) return 1; - if (fun == &vFppp) return 1; - if (fun == &IFppI) return 1; - if (fun == &CFuff) return 5; - if (fun == &CFuLu) return 1; - if (fun == &CFppp) return 1; - if (fun == &WFppp) return 1; - if (fun == &uFuuu) return 1; - if (fun == &uFuup) return 1; - if (fun == &uFufp) return 3; - if (fun == &uFupu) return 1; - if (fun == &uFupp) return 1; - if (fun == &uFpWu) return 1; - if (fun == &uFpWf) return 3; - if (fun == &uFpWp) return 1; - if (fun == &uFpuu) return 1; - if (fun == &uFpuL) return 1; - if (fun == &uFpup) return 1; - if (fun == &uFpfu) return 3; - if (fun == &uFpLu) return 1; - if (fun == &uFpLL) return 1; - if (fun == &uFpLp) return 1; - if (fun == &uFppu) return 1; - if (fun == &uFppL) return 1; - if (fun == &uFppp) return 1; - if (fun == &UFUUU) return 1; - if (fun == &fFfff) return -7; - if (fun == &fFffp) return -5; - if (fun == &fFppL) return -1; - if (fun == &fFppp) return -1; - if (fun == &dFuud) return -3; - if (fun == &dFddd) return -7; - if (fun == &dFddp) return -5; - if (fun == &dFpdd) return -5; - if (fun == &dFppu) return -1; - if (fun == &dFppd) return -3; - if (fun == &dFppp) return -1; - if (fun == &lFlll) return 1; - if (fun == &lFpLu) return 1; - if (fun == &lFpLp) return 1; - if (fun == &lFppu) return 1; - if (fun == &lFppL) return 1; - if (fun == &lFppp) return 1; - if (fun == &LFLLl) return 1; - if (fun == &LFLLL) return 1; - if (fun == &LFLpu) return 1; - if (fun == &LFLpL) return 1; - if (fun == &LFpuL) return 1; - if (fun == &LFpup) return 1; - if (fun == &LFpLL) return 1; - if (fun == &LFpLp) return 1; - if (fun == &LFppu) return 1; - if (fun == &LFppL) return 1; - if (fun == &LFppp) return 1; - if (fun == &pFCuW) return 1; - if (fun == &pFWWW) return 1; - if (fun == &pFuuu) return 1; - if (fun == &pFulu) return 1; - if (fun == &pFulp) return 1; - if (fun == &pFupu) return 1; - if (fun == &pFupl) return 1; - if (fun == &pFupL) return 1; - if (fun == &pFupp) return 1; - if (fun == &pFdUU) return 3; - if (fun == &pFddd) return 7; - if (fun == &pFLup) return 1; - if (fun == &pFLLp) return 1; - if (fun == &pFLpp) return 1; - if (fun == &pFpCu) return 1; - if (fun == &pFpWW) return 1; - if (fun == &pFpWp) return 1; - if (fun == &pFpuu) return 1; - if (fun == &pFpuL) return 1; - if (fun == &pFpup) return 1; - if (fun == &pFpUu) return 1; - if (fun == &pFpdu) return 3; - if (fun == &pFpdd) return 5; - if (fun == &pFplC) return 1; - if (fun == &pFplu) return 1; - if (fun == &pFpll) return 1; - if (fun == &pFplp) return 1; - if (fun == &pFpLu) return 1; - if (fun == &pFpLL) return 1; - if (fun == &pFpLp) return 1; - if (fun == &pFppI) return 1; - if (fun == &pFppC) return 1; - if (fun == &pFppu) return 1; - if (fun == &pFppU) return 1; - if (fun == &pFppf) return 3; - if (fun == &pFppl) return 1; - if (fun == &pFppL) return 1; - if (fun == &pFppp) return 1; - if (fun == &vFuuuf) return 3; - if (fun == &vFuuud) return 3; - if (fun == &vFuuff) return 5; - if (fun == &vFufff) return 7; - if (fun == &vFuddd) return 7; - if (fun == &vFffff) return 9; - if (fun == &vFdddd) return 9; - if (fun == &vFpudd) return 5; - if (fun == &vFpfff) return 7; - if (fun == &vFpdup) return 3; - if (fun == &vFpddu) return 5; - if (fun == &vFpddd) return 7; - if (fun == &vFppff) return 5; - if (fun == &vFppdu) return 3; - if (fun == &vFppdd) return 5; - if (fun == &vFppdp) return 3; - if (fun == &vFpppd) return 3; - if (fun == &CFuuff) return 5; - if (fun == &pFffff) return 9; - if (fun == &pFdddd) return 9; - if (fun == &pFlfff) return 7; - if (fun == &pFpudd) return 5; - if (fun == &pFpdIU) return 3; - if (fun == &pFppdd) return 5; - if (fun == &vFuffff) return 9; - if (fun == &vFudddd) return 9; - if (fun == &vFddddp) return 9; - if (fun == &vFpuddd) return 7; - if (fun == &vFpffff) return 9; - if (fun == &vFpdddd) return 9; - if (fun == &vFpddpp) return 5; - if (fun == &vFppudd) return 5; - if (fun == &vFppfff) return 7; - if (fun == &vFppddp) return 5; - if (fun == &vFpppff) return 5; - if (fun == &vFpppdd) return 5; - if (fun == &pFudddp) return 7; - if (fun == &pFpdddd) return 9; - if (fun == &pFppddu) return 5; - if (fun == &vFuuffff) return 9; - if (fun == &vFuudddd) return 9; - if (fun == &vFdddppp) return 7; - if (fun == &vFpudddd) return 9; - if (fun == &vFpddddp) return 9; - if (fun == &vFppffff) return 9; - if (fun == &vFppdddd) return 9; - if (fun == &vFuuuffff) return 9; - if (fun == &vFuuudddd) return 9; - if (fun == &vFppddddu) return 9; - if (fun == &vFpppffff) return 9; - return 0; -} - -#else -int isSimpleWrapper(wrapper_t fun) { - return 0; -} -#endif - -int isRetX87Wrapper(wrapper_t fun) { - if (fun == &DFDi) return 1; - if (fun == &DFDD) return 1; - if (fun == &DFDp) return 1; - if (fun == &DFpp) return 1; - if (fun == &DFppi) return 1; - if (fun == &DFppp) return 1; -#if defined(HAVE_LD80BITS) - if (fun == &DFD) return 1; - if (fun == &DFY) return 1; - if (fun == &DFiD) return 1; - if (fun == &DFDDD) return 1; -#endif -#if !defined(HAVE_LD80BITS) - if (fun == &KFK) return 1; - if (fun == &KFy) return 1; - if (fun == &KFiK) return 1; - if (fun == &KFKK) return 1; - if (fun == &KFKp) return 1; - if (fun == &KFKKK) return 1; -#endif - return 0; -} diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h deleted file mode 100644 index 3c6ad60..0000000 --- a/src/wrapped/generated/wrapper.h +++ /dev/null @@ -1,3154 +0,0 @@ -/******************************************************************* - * File automatically generated by rebuild_wrappers.py (v2.4.0.21) * - *******************************************************************/ -#ifndef __WRAPPER_H_ -#define __WRAPPER_H_ -#include -#include -#include "complext.h" - -typedef struct x64emu_s x64emu_t; - -// the generic wrapper pointer functions -typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc); - - -// list of defined wrapper -// E = current x86emu struct -// v = void -// C = unsigned byte c = char -// W = unsigned short w = short -// u = uint32, i = int32 -// U = uint64, I = int64 -// L = unsigned long, l = signed long (long is an int with the size of a pointer) -// H = Huge 128bits value/struct -// p = pointer, P = void* on the stack -// f = float, d = double, D = long double, K = fake long double -// V = vaargs -// O = libc O_ flags bitfield -// o = stdout -// S = _IO_2_1_stdXXX_ pointer (or FILE*) -// N = ... automatically sending 1 arg -// M = ... automatically sending 2 args -// A = va_list -// 0 = constant 0, 1 = constant 1 -// x = float complex -// X = double complex -// b = xcb_connection_t* - -void vFE(x64emu_t *emu, uintptr_t fnc); -void vFv(x64emu_t *emu, uintptr_t fnc); -void vFc(x64emu_t *emu, uintptr_t fnc); -void vFw(x64emu_t *emu, uintptr_t fnc); -void vFi(x64emu_t *emu, uintptr_t fnc); -void vFC(x64emu_t *emu, uintptr_t fnc); -void vFW(x64emu_t *emu, uintptr_t fnc); -void vFu(x64emu_t *emu, uintptr_t fnc); -void vFU(x64emu_t *emu, uintptr_t fnc); -void vFf(x64emu_t *emu, uintptr_t fnc); -void vFd(x64emu_t *emu, uintptr_t fnc); -void vFl(x64emu_t *emu, uintptr_t fnc); -void vFL(x64emu_t *emu, uintptr_t fnc); -void vFp(x64emu_t *emu, uintptr_t fnc); -void vFS(x64emu_t *emu, uintptr_t fnc); -void vFb(x64emu_t *emu, uintptr_t fnc); -void cFv(x64emu_t *emu, uintptr_t fnc); -void cFi(x64emu_t *emu, uintptr_t fnc); -void cFu(x64emu_t *emu, uintptr_t fnc); -void cFf(x64emu_t *emu, uintptr_t fnc); -void cFp(x64emu_t *emu, uintptr_t fnc); -void wFp(x64emu_t *emu, uintptr_t fnc); -void iFE(x64emu_t *emu, uintptr_t fnc); -void iFv(x64emu_t *emu, uintptr_t fnc); -void iFw(x64emu_t *emu, uintptr_t fnc); -void iFi(x64emu_t *emu, uintptr_t fnc); -void iFI(x64emu_t *emu, uintptr_t fnc); -void iFC(x64emu_t *emu, uintptr_t fnc); -void iFW(x64emu_t *emu, uintptr_t fnc); -void iFu(x64emu_t *emu, uintptr_t fnc); -void iFU(x64emu_t *emu, uintptr_t fnc); -void iFf(x64emu_t *emu, uintptr_t fnc); -void iFd(x64emu_t *emu, uintptr_t fnc); -void iFD(x64emu_t *emu, uintptr_t fnc); -void iFl(x64emu_t *emu, uintptr_t fnc); -void iFL(x64emu_t *emu, uintptr_t fnc); -void iFp(x64emu_t *emu, uintptr_t fnc); -void iFO(x64emu_t *emu, uintptr_t fnc); -void iFS(x64emu_t *emu, uintptr_t fnc); -void iFP(x64emu_t *emu, uintptr_t fnc); -void iFb(x64emu_t *emu, uintptr_t fnc); -void IFv(x64emu_t *emu, uintptr_t fnc); -void IFi(x64emu_t *emu, uintptr_t fnc); -void IFI(x64emu_t *emu, uintptr_t fnc); -void IFf(x64emu_t *emu, uintptr_t fnc); -void IFd(x64emu_t *emu, uintptr_t fnc); -void IFp(x64emu_t *emu, uintptr_t fnc); -void CFv(x64emu_t *emu, uintptr_t fnc); -void CFi(x64emu_t *emu, uintptr_t fnc); -void CFC(x64emu_t *emu, uintptr_t fnc); -void CFW(x64emu_t *emu, uintptr_t fnc); -void CFu(x64emu_t *emu, uintptr_t fnc); -void CFl(x64emu_t *emu, uintptr_t fnc); -void CFL(x64emu_t *emu, uintptr_t fnc); -void CFp(x64emu_t *emu, uintptr_t fnc); -void WFi(x64emu_t *emu, uintptr_t fnc); -void WFW(x64emu_t *emu, uintptr_t fnc); -void WFu(x64emu_t *emu, uintptr_t fnc); -void WFp(x64emu_t *emu, uintptr_t fnc); -void uFv(x64emu_t *emu, uintptr_t fnc); -void uFi(x64emu_t *emu, uintptr_t fnc); -void uFu(x64emu_t *emu, uintptr_t fnc); -void uFd(x64emu_t *emu, uintptr_t fnc); -void uFl(x64emu_t *emu, uintptr_t fnc); -void uFL(x64emu_t *emu, uintptr_t fnc); -void uFp(x64emu_t *emu, uintptr_t fnc); -void uFb(x64emu_t *emu, uintptr_t fnc); -void UFv(x64emu_t *emu, uintptr_t fnc); -void UFu(x64emu_t *emu, uintptr_t fnc); -void UFp(x64emu_t *emu, uintptr_t fnc); -void fFi(x64emu_t *emu, uintptr_t fnc); -void fFf(x64emu_t *emu, uintptr_t fnc); -void fFp(x64emu_t *emu, uintptr_t fnc); -void dFv(x64emu_t *emu, uintptr_t fnc); -void dFi(x64emu_t *emu, uintptr_t fnc); -void dFu(x64emu_t *emu, uintptr_t fnc); -void dFd(x64emu_t *emu, uintptr_t fnc); -void dFL(x64emu_t *emu, uintptr_t fnc); -void dFp(x64emu_t *emu, uintptr_t fnc); -void lFE(x64emu_t *emu, uintptr_t fnc); -void lFv(x64emu_t *emu, uintptr_t fnc); -void lFi(x64emu_t *emu, uintptr_t fnc); -void lFu(x64emu_t *emu, uintptr_t fnc); -void lFl(x64emu_t *emu, uintptr_t fnc); -void lFp(x64emu_t *emu, uintptr_t fnc); -void LFv(x64emu_t *emu, uintptr_t fnc); -void LFi(x64emu_t *emu, uintptr_t fnc); -void LFu(x64emu_t *emu, uintptr_t fnc); -void LFd(x64emu_t *emu, uintptr_t fnc); -void LFL(x64emu_t *emu, uintptr_t fnc); -void LFp(x64emu_t *emu, uintptr_t fnc); -void pFE(x64emu_t *emu, uintptr_t fnc); -void pFv(x64emu_t *emu, uintptr_t fnc); -void pFw(x64emu_t *emu, uintptr_t fnc); -void pFi(x64emu_t *emu, uintptr_t fnc); -void pFC(x64emu_t *emu, uintptr_t fnc); -void pFW(x64emu_t *emu, uintptr_t fnc); -void pFu(x64emu_t *emu, uintptr_t fnc); -void pFU(x64emu_t *emu, uintptr_t fnc); -void pFd(x64emu_t *emu, uintptr_t fnc); -void pFl(x64emu_t *emu, uintptr_t fnc); -void pFL(x64emu_t *emu, uintptr_t fnc); -void pFp(x64emu_t *emu, uintptr_t fnc); -void pFV(x64emu_t *emu, uintptr_t fnc); -void pFA(x64emu_t *emu, uintptr_t fnc); -void pFb(x64emu_t *emu, uintptr_t fnc); -void HFi(x64emu_t *emu, uintptr_t fnc); -void HFp(x64emu_t *emu, uintptr_t fnc); -void xFx(x64emu_t *emu, uintptr_t fnc); -void XFX(x64emu_t *emu, uintptr_t fnc); -void vWp(x64emu_t *emu, uintptr_t fnc); -void iWp(x64emu_t *emu, uintptr_t fnc); -void uWp(x64emu_t *emu, uintptr_t fnc); -void fWp(x64emu_t *emu, uintptr_t fnc); -void vFEi(x64emu_t *emu, uintptr_t fnc); -void vFEp(x64emu_t *emu, uintptr_t fnc); -void vFcc(x64emu_t *emu, uintptr_t fnc); -void vFww(x64emu_t *emu, uintptr_t fnc); -void vFii(x64emu_t *emu, uintptr_t fnc); -void vFiW(x64emu_t *emu, uintptr_t fnc); -void vFiu(x64emu_t *emu, uintptr_t fnc); -void vFiU(x64emu_t *emu, uintptr_t fnc); -void vFif(x64emu_t *emu, uintptr_t fnc); -void vFid(x64emu_t *emu, uintptr_t fnc); -void vFil(x64emu_t *emu, uintptr_t fnc); -void vFiL(x64emu_t *emu, uintptr_t fnc); -void vFip(x64emu_t *emu, uintptr_t fnc); -void vFWW(x64emu_t *emu, uintptr_t fnc); -void vFWp(x64emu_t *emu, uintptr_t fnc); -void vFuc(x64emu_t *emu, uintptr_t fnc); -void vFuw(x64emu_t *emu, uintptr_t fnc); -void vFui(x64emu_t *emu, uintptr_t fnc); -void vFuC(x64emu_t *emu, uintptr_t fnc); -void vFuW(x64emu_t *emu, uintptr_t fnc); -void vFuu(x64emu_t *emu, uintptr_t fnc); -void vFuU(x64emu_t *emu, uintptr_t fnc); -void vFuf(x64emu_t *emu, uintptr_t fnc); -void vFud(x64emu_t *emu, uintptr_t fnc); -void vFul(x64emu_t *emu, uintptr_t fnc); -void vFuL(x64emu_t *emu, uintptr_t fnc); -void vFup(x64emu_t *emu, uintptr_t fnc); -void vFUi(x64emu_t *emu, uintptr_t fnc); -void vFfi(x64emu_t *emu, uintptr_t fnc); -void vFfC(x64emu_t *emu, uintptr_t fnc); -void vFff(x64emu_t *emu, uintptr_t fnc); -void vFfp(x64emu_t *emu, uintptr_t fnc); -void vFdd(x64emu_t *emu, uintptr_t fnc); -void vFlu(x64emu_t *emu, uintptr_t fnc); -void vFlp(x64emu_t *emu, uintptr_t fnc); -void vFLu(x64emu_t *emu, uintptr_t fnc); -void vFLL(x64emu_t *emu, uintptr_t fnc); -void vFLp(x64emu_t *emu, uintptr_t fnc); -void vFpc(x64emu_t *emu, uintptr_t fnc); -void vFpi(x64emu_t *emu, uintptr_t fnc); -void vFpI(x64emu_t *emu, uintptr_t fnc); -void vFpC(x64emu_t *emu, uintptr_t fnc); -void vFpW(x64emu_t *emu, uintptr_t fnc); -void vFpu(x64emu_t *emu, uintptr_t fnc); -void vFpU(x64emu_t *emu, uintptr_t fnc); -void vFpf(x64emu_t *emu, uintptr_t fnc); -void vFpd(x64emu_t *emu, uintptr_t fnc); -void vFpl(x64emu_t *emu, uintptr_t fnc); -void vFpL(x64emu_t *emu, uintptr_t fnc); -void vFpp(x64emu_t *emu, uintptr_t fnc); -void vFpV(x64emu_t *emu, uintptr_t fnc); -void vFpS(x64emu_t *emu, uintptr_t fnc); -void vFSi(x64emu_t *emu, uintptr_t fnc); -void vFbi(x64emu_t *emu, uintptr_t fnc); -void vFbu(x64emu_t *emu, uintptr_t fnc); -void vFbU(x64emu_t *emu, uintptr_t fnc); -void vFbp(x64emu_t *emu, uintptr_t fnc); -void cFpi(x64emu_t *emu, uintptr_t fnc); -void cFpp(x64emu_t *emu, uintptr_t fnc); -void wFpi(x64emu_t *emu, uintptr_t fnc); -void iFEi(x64emu_t *emu, uintptr_t fnc); -void iFEf(x64emu_t *emu, uintptr_t fnc); -void iFEd(x64emu_t *emu, uintptr_t fnc); -void iFEL(x64emu_t *emu, uintptr_t fnc); -void iFEp(x64emu_t *emu, uintptr_t fnc); -void iFwp(x64emu_t *emu, uintptr_t fnc); -void iFii(x64emu_t *emu, uintptr_t fnc); -void iFiI(x64emu_t *emu, uintptr_t fnc); -void iFiC(x64emu_t *emu, uintptr_t fnc); -void iFiu(x64emu_t *emu, uintptr_t fnc); -void iFil(x64emu_t *emu, uintptr_t fnc); -void iFiL(x64emu_t *emu, uintptr_t fnc); -void iFip(x64emu_t *emu, uintptr_t fnc); -void iFiS(x64emu_t *emu, uintptr_t fnc); -void iFui(x64emu_t *emu, uintptr_t fnc); -void iFuu(x64emu_t *emu, uintptr_t fnc); -void iFuL(x64emu_t *emu, uintptr_t fnc); -void iFup(x64emu_t *emu, uintptr_t fnc); -void iFUp(x64emu_t *emu, uintptr_t fnc); -void iFli(x64emu_t *emu, uintptr_t fnc); -void iFlp(x64emu_t *emu, uintptr_t fnc); -void iFLi(x64emu_t *emu, uintptr_t fnc); -void iFLu(x64emu_t *emu, uintptr_t fnc); -void iFLL(x64emu_t *emu, uintptr_t fnc); -void iFLp(x64emu_t *emu, uintptr_t fnc); -void iFpw(x64emu_t *emu, uintptr_t fnc); -void iFpi(x64emu_t *emu, uintptr_t fnc); -void iFpI(x64emu_t *emu, uintptr_t fnc); -void iFpC(x64emu_t *emu, uintptr_t fnc); -void iFpW(x64emu_t *emu, uintptr_t fnc); -void iFpu(x64emu_t *emu, uintptr_t fnc); -void iFpU(x64emu_t *emu, uintptr_t fnc); -void iFpf(x64emu_t *emu, uintptr_t fnc); -void iFpd(x64emu_t *emu, uintptr_t fnc); -void iFpl(x64emu_t *emu, uintptr_t fnc); -void iFpL(x64emu_t *emu, uintptr_t fnc); -void iFpp(x64emu_t *emu, uintptr_t fnc); -void iFpO(x64emu_t *emu, uintptr_t fnc); -void iFSi(x64emu_t *emu, uintptr_t fnc); -void IFEi(x64emu_t *emu, uintptr_t fnc); -void IFEf(x64emu_t *emu, uintptr_t fnc); -void IFEd(x64emu_t *emu, uintptr_t fnc); -void IFEp(x64emu_t *emu, uintptr_t fnc); -void IFip(x64emu_t *emu, uintptr_t fnc); -void IFII(x64emu_t *emu, uintptr_t fnc); -void IFpi(x64emu_t *emu, uintptr_t fnc); -void IFpu(x64emu_t *emu, uintptr_t fnc); -void IFpd(x64emu_t *emu, uintptr_t fnc); -void IFpp(x64emu_t *emu, uintptr_t fnc); -void CFip(x64emu_t *emu, uintptr_t fnc); -void CFCi(x64emu_t *emu, uintptr_t fnc); -void CFui(x64emu_t *emu, uintptr_t fnc); -void CFuW(x64emu_t *emu, uintptr_t fnc); -void CFuu(x64emu_t *emu, uintptr_t fnc); -void CFuL(x64emu_t *emu, uintptr_t fnc); -void CFpi(x64emu_t *emu, uintptr_t fnc); -void CFpu(x64emu_t *emu, uintptr_t fnc); -void CFpL(x64emu_t *emu, uintptr_t fnc); -void CFpp(x64emu_t *emu, uintptr_t fnc); -void WFpi(x64emu_t *emu, uintptr_t fnc); -void WFpp(x64emu_t *emu, uintptr_t fnc); -void uFEp(x64emu_t *emu, uintptr_t fnc); -void uFii(x64emu_t *emu, uintptr_t fnc); -void uFiu(x64emu_t *emu, uintptr_t fnc); -void uFip(x64emu_t *emu, uintptr_t fnc); -void uFui(x64emu_t *emu, uintptr_t fnc); -void uFuu(x64emu_t *emu, uintptr_t fnc); -void uFup(x64emu_t *emu, uintptr_t fnc); -void uFuM(x64emu_t *emu, uintptr_t fnc); -void uFpw(x64emu_t *emu, uintptr_t fnc); -void uFpi(x64emu_t *emu, uintptr_t fnc); -void uFpC(x64emu_t *emu, uintptr_t fnc); -void uFpu(x64emu_t *emu, uintptr_t fnc); -void uFpU(x64emu_t *emu, uintptr_t fnc); -void uFpf(x64emu_t *emu, uintptr_t fnc); -void uFpl(x64emu_t *emu, uintptr_t fnc); -void uFpL(x64emu_t *emu, uintptr_t fnc); -void uFpp(x64emu_t *emu, uintptr_t fnc); -void uFbu(x64emu_t *emu, uintptr_t fnc); -void UFEp(x64emu_t *emu, uintptr_t fnc); -void UFuu(x64emu_t *emu, uintptr_t fnc); -void UFUp(x64emu_t *emu, uintptr_t fnc); -void UFpi(x64emu_t *emu, uintptr_t fnc); -void UFpU(x64emu_t *emu, uintptr_t fnc); -void UFpp(x64emu_t *emu, uintptr_t fnc); -void fFEf(x64emu_t *emu, uintptr_t fnc); -void fFEp(x64emu_t *emu, uintptr_t fnc); -void fFif(x64emu_t *emu, uintptr_t fnc); -void fFfi(x64emu_t *emu, uintptr_t fnc); -void fFff(x64emu_t *emu, uintptr_t fnc); -void fFfD(x64emu_t *emu, uintptr_t fnc); -void fFfp(x64emu_t *emu, uintptr_t fnc); -void fFpu(x64emu_t *emu, uintptr_t fnc); -void fFpp(x64emu_t *emu, uintptr_t fnc); -void fFbu(x64emu_t *emu, uintptr_t fnc); -void dFEd(x64emu_t *emu, uintptr_t fnc); -void dFid(x64emu_t *emu, uintptr_t fnc); -void dFdi(x64emu_t *emu, uintptr_t fnc); -void dFdd(x64emu_t *emu, uintptr_t fnc); -void dFdD(x64emu_t *emu, uintptr_t fnc); -void dFdp(x64emu_t *emu, uintptr_t fnc); -void dFll(x64emu_t *emu, uintptr_t fnc); -void dFpi(x64emu_t *emu, uintptr_t fnc); -void dFpu(x64emu_t *emu, uintptr_t fnc); -void dFpd(x64emu_t *emu, uintptr_t fnc); -void dFpp(x64emu_t *emu, uintptr_t fnc); -void DFDi(x64emu_t *emu, uintptr_t fnc); -void DFDD(x64emu_t *emu, uintptr_t fnc); -void DFDp(x64emu_t *emu, uintptr_t fnc); -void DFpp(x64emu_t *emu, uintptr_t fnc); -void lFEi(x64emu_t *emu, uintptr_t fnc); -void lFii(x64emu_t *emu, uintptr_t fnc); -void lFip(x64emu_t *emu, uintptr_t fnc); -void lFui(x64emu_t *emu, uintptr_t fnc); -void lFll(x64emu_t *emu, uintptr_t fnc); -void lFpi(x64emu_t *emu, uintptr_t fnc); -void lFpd(x64emu_t *emu, uintptr_t fnc); -void lFpl(x64emu_t *emu, uintptr_t fnc); -void lFpp(x64emu_t *emu, uintptr_t fnc); -void LFEL(x64emu_t *emu, uintptr_t fnc); -void LFEp(x64emu_t *emu, uintptr_t fnc); -void LFii(x64emu_t *emu, uintptr_t fnc); -void LFuu(x64emu_t *emu, uintptr_t fnc); -void LFUp(x64emu_t *emu, uintptr_t fnc); -void LFLi(x64emu_t *emu, uintptr_t fnc); -void LFLL(x64emu_t *emu, uintptr_t fnc); -void LFLp(x64emu_t *emu, uintptr_t fnc); -void LFpi(x64emu_t *emu, uintptr_t fnc); -void LFpu(x64emu_t *emu, uintptr_t fnc); -void LFpL(x64emu_t *emu, uintptr_t fnc); -void LFpp(x64emu_t *emu, uintptr_t fnc); -void pFEi(x64emu_t *emu, uintptr_t fnc); -void pFEL(x64emu_t *emu, uintptr_t fnc); -void pFEp(x64emu_t *emu, uintptr_t fnc); -void pFii(x64emu_t *emu, uintptr_t fnc); -void pFiI(x64emu_t *emu, uintptr_t fnc); -void pFiu(x64emu_t *emu, uintptr_t fnc); -void pFip(x64emu_t *emu, uintptr_t fnc); -void pFiV(x64emu_t *emu, uintptr_t fnc); -void pFui(x64emu_t *emu, uintptr_t fnc); -void pFuu(x64emu_t *emu, uintptr_t fnc); -void pFup(x64emu_t *emu, uintptr_t fnc); -void pFUU(x64emu_t *emu, uintptr_t fnc); -void pFdi(x64emu_t *emu, uintptr_t fnc); -void pFdd(x64emu_t *emu, uintptr_t fnc); -void pFli(x64emu_t *emu, uintptr_t fnc); -void pFll(x64emu_t *emu, uintptr_t fnc); -void pFlp(x64emu_t *emu, uintptr_t fnc); -void pFLi(x64emu_t *emu, uintptr_t fnc); -void pFLC(x64emu_t *emu, uintptr_t fnc); -void pFLu(x64emu_t *emu, uintptr_t fnc); -void pFLL(x64emu_t *emu, uintptr_t fnc); -void pFLp(x64emu_t *emu, uintptr_t fnc); -void pFpi(x64emu_t *emu, uintptr_t fnc); -void pFpC(x64emu_t *emu, uintptr_t fnc); -void pFpW(x64emu_t *emu, uintptr_t fnc); -void pFpu(x64emu_t *emu, uintptr_t fnc); -void pFpU(x64emu_t *emu, uintptr_t fnc); -void pFpd(x64emu_t *emu, uintptr_t fnc); -void pFpl(x64emu_t *emu, uintptr_t fnc); -void pFpL(x64emu_t *emu, uintptr_t fnc); -void pFpp(x64emu_t *emu, uintptr_t fnc); -void pFSi(x64emu_t *emu, uintptr_t fnc); -void pFbC(x64emu_t *emu, uintptr_t fnc); -void pFbu(x64emu_t *emu, uintptr_t fnc); -void pFbp(x64emu_t *emu, uintptr_t fnc); -void HFII(x64emu_t *emu, uintptr_t fnc); -void HFll(x64emu_t *emu, uintptr_t fnc); -void HFpi(x64emu_t *emu, uintptr_t fnc); -void HFpp(x64emu_t *emu, uintptr_t fnc); -void xFxx(x64emu_t *emu, uintptr_t fnc); -void XFXX(x64emu_t *emu, uintptr_t fnc); -void iWpi(x64emu_t *emu, uintptr_t fnc); -void iWpu(x64emu_t *emu, uintptr_t fnc); -void iWpf(x64emu_t *emu, uintptr_t fnc); -void iWpp(x64emu_t *emu, uintptr_t fnc); -void uWpu(x64emu_t *emu, uintptr_t fnc); -void pWEp(x64emu_t *emu, uintptr_t fnc); -void pWpu(x64emu_t *emu, uintptr_t fnc); -void vFEpi(x64emu_t *emu, uintptr_t fnc); -void vFEpu(x64emu_t *emu, uintptr_t fnc); -void vFEpp(x64emu_t *emu, uintptr_t fnc); -void vFEpV(x64emu_t *emu, uintptr_t fnc); -void vFEpA(x64emu_t *emu, uintptr_t fnc); -void vFccc(x64emu_t *emu, uintptr_t fnc); -void vFwww(x64emu_t *emu, uintptr_t fnc); -void vFiii(x64emu_t *emu, uintptr_t fnc); -void vFiif(x64emu_t *emu, uintptr_t fnc); -void vFiip(x64emu_t *emu, uintptr_t fnc); -void vFiui(x64emu_t *emu, uintptr_t fnc); -void vFiuu(x64emu_t *emu, uintptr_t fnc); -void vFiuU(x64emu_t *emu, uintptr_t fnc); -void vFiup(x64emu_t *emu, uintptr_t fnc); -void vFiff(x64emu_t *emu, uintptr_t fnc); -void vFidd(x64emu_t *emu, uintptr_t fnc); -void vFilu(x64emu_t *emu, uintptr_t fnc); -void vFill(x64emu_t *emu, uintptr_t fnc); -void vFilp(x64emu_t *emu, uintptr_t fnc); -void vFiLL(x64emu_t *emu, uintptr_t fnc); -void vFipi(x64emu_t *emu, uintptr_t fnc); -void vFipu(x64emu_t *emu, uintptr_t fnc); -void vFipL(x64emu_t *emu, uintptr_t fnc); -void vFipp(x64emu_t *emu, uintptr_t fnc); -void vFCCC(x64emu_t *emu, uintptr_t fnc); -void vFWWW(x64emu_t *emu, uintptr_t fnc); -void vFucc(x64emu_t *emu, uintptr_t fnc); -void vFuww(x64emu_t *emu, uintptr_t fnc); -void vFuii(x64emu_t *emu, uintptr_t fnc); -void vFuiu(x64emu_t *emu, uintptr_t fnc); -void vFuiU(x64emu_t *emu, uintptr_t fnc); -void vFuif(x64emu_t *emu, uintptr_t fnc); -void vFuid(x64emu_t *emu, uintptr_t fnc); -void vFuil(x64emu_t *emu, uintptr_t fnc); -void vFuiL(x64emu_t *emu, uintptr_t fnc); -void vFuip(x64emu_t *emu, uintptr_t fnc); -void vFuWW(x64emu_t *emu, uintptr_t fnc); -void vFuui(x64emu_t *emu, uintptr_t fnc); -void vFuuC(x64emu_t *emu, uintptr_t fnc); -void vFuuu(x64emu_t *emu, uintptr_t fnc); -void vFuuU(x64emu_t *emu, uintptr_t fnc); -void vFuuf(x64emu_t *emu, uintptr_t fnc); -void vFuud(x64emu_t *emu, uintptr_t fnc); -void vFuuL(x64emu_t *emu, uintptr_t fnc); -void vFuup(x64emu_t *emu, uintptr_t fnc); -void vFuff(x64emu_t *emu, uintptr_t fnc); -void vFufp(x64emu_t *emu, uintptr_t fnc); -void vFudd(x64emu_t *emu, uintptr_t fnc); -void vFull(x64emu_t *emu, uintptr_t fnc); -void vFulp(x64emu_t *emu, uintptr_t fnc); -void vFuLL(x64emu_t *emu, uintptr_t fnc); -void vFuLp(x64emu_t *emu, uintptr_t fnc); -void vFupu(x64emu_t *emu, uintptr_t fnc); -void vFupp(x64emu_t *emu, uintptr_t fnc); -void vFfff(x64emu_t *emu, uintptr_t fnc); -void vFfpp(x64emu_t *emu, uintptr_t fnc); -void vFddd(x64emu_t *emu, uintptr_t fnc); -void vFdpp(x64emu_t *emu, uintptr_t fnc); -void vFlii(x64emu_t *emu, uintptr_t fnc); -void vFlip(x64emu_t *emu, uintptr_t fnc); -void vFllp(x64emu_t *emu, uintptr_t fnc); -void vFlpp(x64emu_t *emu, uintptr_t fnc); -void vFLup(x64emu_t *emu, uintptr_t fnc); -void vFLpL(x64emu_t *emu, uintptr_t fnc); -void vFLpp(x64emu_t *emu, uintptr_t fnc); -void vFpic(x64emu_t *emu, uintptr_t fnc); -void vFpii(x64emu_t *emu, uintptr_t fnc); -void vFpiI(x64emu_t *emu, uintptr_t fnc); -void vFpiC(x64emu_t *emu, uintptr_t fnc); -void vFpiu(x64emu_t *emu, uintptr_t fnc); -void vFpiU(x64emu_t *emu, uintptr_t fnc); -void vFpif(x64emu_t *emu, uintptr_t fnc); -void vFpid(x64emu_t *emu, uintptr_t fnc); -void vFpiL(x64emu_t *emu, uintptr_t fnc); -void vFpip(x64emu_t *emu, uintptr_t fnc); -void vFpui(x64emu_t *emu, uintptr_t fnc); -void vFpuI(x64emu_t *emu, uintptr_t fnc); -void vFpuW(x64emu_t *emu, uintptr_t fnc); -void vFpuu(x64emu_t *emu, uintptr_t fnc); -void vFpuU(x64emu_t *emu, uintptr_t fnc); -void vFpuf(x64emu_t *emu, uintptr_t fnc); -void vFpud(x64emu_t *emu, uintptr_t fnc); -void vFpuL(x64emu_t *emu, uintptr_t fnc); -void vFpup(x64emu_t *emu, uintptr_t fnc); -void vFpUi(x64emu_t *emu, uintptr_t fnc); -void vFpUu(x64emu_t *emu, uintptr_t fnc); -void vFpUU(x64emu_t *emu, uintptr_t fnc); -void vFpUf(x64emu_t *emu, uintptr_t fnc); -void vFpUp(x64emu_t *emu, uintptr_t fnc); -void vFpff(x64emu_t *emu, uintptr_t fnc); -void vFpdu(x64emu_t *emu, uintptr_t fnc); -void vFpdd(x64emu_t *emu, uintptr_t fnc); -void vFpdp(x64emu_t *emu, uintptr_t fnc); -void vFpll(x64emu_t *emu, uintptr_t fnc); -void vFplp(x64emu_t *emu, uintptr_t fnc); -void vFpLi(x64emu_t *emu, uintptr_t fnc); -void vFpLu(x64emu_t *emu, uintptr_t fnc); -void vFpLL(x64emu_t *emu, uintptr_t fnc); -void vFpLp(x64emu_t *emu, uintptr_t fnc); -void vFppi(x64emu_t *emu, uintptr_t fnc); -void vFppu(x64emu_t *emu, uintptr_t fnc); -void vFppU(x64emu_t *emu, uintptr_t fnc); -void vFppf(x64emu_t *emu, uintptr_t fnc); -void vFppd(x64emu_t *emu, uintptr_t fnc); -void vFppl(x64emu_t *emu, uintptr_t fnc); -void vFppL(x64emu_t *emu, uintptr_t fnc); -void vFppp(x64emu_t *emu, uintptr_t fnc); -void vFppV(x64emu_t *emu, uintptr_t fnc); -void cFpdp(x64emu_t *emu, uintptr_t fnc); -void wFppp(x64emu_t *emu, uintptr_t fnc); -void iFEiw(x64emu_t *emu, uintptr_t fnc); -void iFEip(x64emu_t *emu, uintptr_t fnc); -void iFEWW(x64emu_t *emu, uintptr_t fnc); -void iFEup(x64emu_t *emu, uintptr_t fnc); -void iFEUU(x64emu_t *emu, uintptr_t fnc); -void iFELp(x64emu_t *emu, uintptr_t fnc); -void iFEpi(x64emu_t *emu, uintptr_t fnc); -void iFEpU(x64emu_t *emu, uintptr_t fnc); -void iFEpL(x64emu_t *emu, uintptr_t fnc); -void iFEpp(x64emu_t *emu, uintptr_t fnc); -void iFEpV(x64emu_t *emu, uintptr_t fnc); -void iFEpA(x64emu_t *emu, uintptr_t fnc); -void iFESp(x64emu_t *emu, uintptr_t fnc); -void iFwww(x64emu_t *emu, uintptr_t fnc); -void iFwpp(x64emu_t *emu, uintptr_t fnc); -void iFiwC(x64emu_t *emu, uintptr_t fnc); -void iFiii(x64emu_t *emu, uintptr_t fnc); -void iFiiI(x64emu_t *emu, uintptr_t fnc); -void iFiiu(x64emu_t *emu, uintptr_t fnc); -void iFiil(x64emu_t *emu, uintptr_t fnc); -void iFiip(x64emu_t *emu, uintptr_t fnc); -void iFiiO(x64emu_t *emu, uintptr_t fnc); -void iFiCC(x64emu_t *emu, uintptr_t fnc); -void iFiui(x64emu_t *emu, uintptr_t fnc); -void iFiuu(x64emu_t *emu, uintptr_t fnc); -void iFiup(x64emu_t *emu, uintptr_t fnc); -void iFill(x64emu_t *emu, uintptr_t fnc); -void iFilp(x64emu_t *emu, uintptr_t fnc); -void iFiLi(x64emu_t *emu, uintptr_t fnc); -void iFiLp(x64emu_t *emu, uintptr_t fnc); -void iFiLN(x64emu_t *emu, uintptr_t fnc); -void iFipi(x64emu_t *emu, uintptr_t fnc); -void iFipu(x64emu_t *emu, uintptr_t fnc); -void iFipL(x64emu_t *emu, uintptr_t fnc); -void iFipp(x64emu_t *emu, uintptr_t fnc); -void iFipO(x64emu_t *emu, uintptr_t fnc); -void iFCuW(x64emu_t *emu, uintptr_t fnc); -void iFuwp(x64emu_t *emu, uintptr_t fnc); -void iFuip(x64emu_t *emu, uintptr_t fnc); -void iFuWp(x64emu_t *emu, uintptr_t fnc); -void iFuui(x64emu_t *emu, uintptr_t fnc); -void iFuuu(x64emu_t *emu, uintptr_t fnc); -void iFuup(x64emu_t *emu, uintptr_t fnc); -void iFuLL(x64emu_t *emu, uintptr_t fnc); -void iFuLp(x64emu_t *emu, uintptr_t fnc); -void iFupi(x64emu_t *emu, uintptr_t fnc); -void iFupu(x64emu_t *emu, uintptr_t fnc); -void iFupL(x64emu_t *emu, uintptr_t fnc); -void iFupp(x64emu_t *emu, uintptr_t fnc); -void iFfff(x64emu_t *emu, uintptr_t fnc); -void iFLip(x64emu_t *emu, uintptr_t fnc); -void iFLpp(x64emu_t *emu, uintptr_t fnc); -void iFpwp(x64emu_t *emu, uintptr_t fnc); -void iFpii(x64emu_t *emu, uintptr_t fnc); -void iFpiI(x64emu_t *emu, uintptr_t fnc); -void iFpiC(x64emu_t *emu, uintptr_t fnc); -void iFpiW(x64emu_t *emu, uintptr_t fnc); -void iFpiu(x64emu_t *emu, uintptr_t fnc); -void iFpiU(x64emu_t *emu, uintptr_t fnc); -void iFpid(x64emu_t *emu, uintptr_t fnc); -void iFpil(x64emu_t *emu, uintptr_t fnc); -void iFpiL(x64emu_t *emu, uintptr_t fnc); -void iFpip(x64emu_t *emu, uintptr_t fnc); -void iFpIi(x64emu_t *emu, uintptr_t fnc); -void iFpII(x64emu_t *emu, uintptr_t fnc); -void iFpCp(x64emu_t *emu, uintptr_t fnc); -void iFpWp(x64emu_t *emu, uintptr_t fnc); -void iFpui(x64emu_t *emu, uintptr_t fnc); -void iFpuC(x64emu_t *emu, uintptr_t fnc); -void iFpuu(x64emu_t *emu, uintptr_t fnc); -void iFpuU(x64emu_t *emu, uintptr_t fnc); -void iFpul(x64emu_t *emu, uintptr_t fnc); -void iFpuL(x64emu_t *emu, uintptr_t fnc); -void iFpup(x64emu_t *emu, uintptr_t fnc); -void iFpUu(x64emu_t *emu, uintptr_t fnc); -void iFpUU(x64emu_t *emu, uintptr_t fnc); -void iFpUp(x64emu_t *emu, uintptr_t fnc); -void iFpfu(x64emu_t *emu, uintptr_t fnc); -void iFpff(x64emu_t *emu, uintptr_t fnc); -void iFpdd(x64emu_t *emu, uintptr_t fnc); -void iFpli(x64emu_t *emu, uintptr_t fnc); -void iFpll(x64emu_t *emu, uintptr_t fnc); -void iFplp(x64emu_t *emu, uintptr_t fnc); -void iFpLi(x64emu_t *emu, uintptr_t fnc); -void iFpLu(x64emu_t *emu, uintptr_t fnc); -void iFpLl(x64emu_t *emu, uintptr_t fnc); -void iFpLL(x64emu_t *emu, uintptr_t fnc); -void iFpLp(x64emu_t *emu, uintptr_t fnc); -void iFppi(x64emu_t *emu, uintptr_t fnc); -void iFppI(x64emu_t *emu, uintptr_t fnc); -void iFppC(x64emu_t *emu, uintptr_t fnc); -void iFppW(x64emu_t *emu, uintptr_t fnc); -void iFppu(x64emu_t *emu, uintptr_t fnc); -void iFppU(x64emu_t *emu, uintptr_t fnc); -void iFppd(x64emu_t *emu, uintptr_t fnc); -void iFppl(x64emu_t *emu, uintptr_t fnc); -void iFppL(x64emu_t *emu, uintptr_t fnc); -void iFppp(x64emu_t *emu, uintptr_t fnc); -void iFpOu(x64emu_t *emu, uintptr_t fnc); -void iFpOM(x64emu_t *emu, uintptr_t fnc); -void iFSpL(x64emu_t *emu, uintptr_t fnc); -void iFbpp(x64emu_t *emu, uintptr_t fnc); -void IFiIi(x64emu_t *emu, uintptr_t fnc); -void IFpIi(x64emu_t *emu, uintptr_t fnc); -void IFppi(x64emu_t *emu, uintptr_t fnc); -void IFppI(x64emu_t *emu, uintptr_t fnc); -void IFSIi(x64emu_t *emu, uintptr_t fnc); -void CFipp(x64emu_t *emu, uintptr_t fnc); -void CFuff(x64emu_t *emu, uintptr_t fnc); -void CFuLu(x64emu_t *emu, uintptr_t fnc); -void CFppp(x64emu_t *emu, uintptr_t fnc); -void WFppp(x64emu_t *emu, uintptr_t fnc); -void uFEpW(x64emu_t *emu, uintptr_t fnc); -void uFEpu(x64emu_t *emu, uintptr_t fnc); -void uFEpU(x64emu_t *emu, uintptr_t fnc); -void uFEpp(x64emu_t *emu, uintptr_t fnc); -void uFiuu(x64emu_t *emu, uintptr_t fnc); -void uFilp(x64emu_t *emu, uintptr_t fnc); -void uFipu(x64emu_t *emu, uintptr_t fnc); -void uFipL(x64emu_t *emu, uintptr_t fnc); -void uFuii(x64emu_t *emu, uintptr_t fnc); -void uFuip(x64emu_t *emu, uintptr_t fnc); -void uFuuu(x64emu_t *emu, uintptr_t fnc); -void uFuup(x64emu_t *emu, uintptr_t fnc); -void uFufp(x64emu_t *emu, uintptr_t fnc); -void uFupu(x64emu_t *emu, uintptr_t fnc); -void uFupp(x64emu_t *emu, uintptr_t fnc); -void uFpii(x64emu_t *emu, uintptr_t fnc); -void uFpiu(x64emu_t *emu, uintptr_t fnc); -void uFpip(x64emu_t *emu, uintptr_t fnc); -void uFpCi(x64emu_t *emu, uintptr_t fnc); -void uFpWi(x64emu_t *emu, uintptr_t fnc); -void uFpWu(x64emu_t *emu, uintptr_t fnc); -void uFpWf(x64emu_t *emu, uintptr_t fnc); -void uFpWp(x64emu_t *emu, uintptr_t fnc); -void uFpui(x64emu_t *emu, uintptr_t fnc); -void uFpuu(x64emu_t *emu, uintptr_t fnc); -void uFpuL(x64emu_t *emu, uintptr_t fnc); -void uFpup(x64emu_t *emu, uintptr_t fnc); -void uFpfu(x64emu_t *emu, uintptr_t fnc); -void uFpli(x64emu_t *emu, uintptr_t fnc); -void uFpLu(x64emu_t *emu, uintptr_t fnc); -void uFpLL(x64emu_t *emu, uintptr_t fnc); -void uFpLp(x64emu_t *emu, uintptr_t fnc); -void uFppi(x64emu_t *emu, uintptr_t fnc); -void uFppu(x64emu_t *emu, uintptr_t fnc); -void uFppL(x64emu_t *emu, uintptr_t fnc); -void uFppp(x64emu_t *emu, uintptr_t fnc); -void uFbWW(x64emu_t *emu, uintptr_t fnc); -void uFbWu(x64emu_t *emu, uintptr_t fnc); -void uFbuC(x64emu_t *emu, uintptr_t fnc); -void uFbuW(x64emu_t *emu, uintptr_t fnc); -void uFbuu(x64emu_t *emu, uintptr_t fnc); -void uFbuU(x64emu_t *emu, uintptr_t fnc); -void uFbup(x64emu_t *emu, uintptr_t fnc); -void UFUii(x64emu_t *emu, uintptr_t fnc); -void UFUUU(x64emu_t *emu, uintptr_t fnc); -void UFpiU(x64emu_t *emu, uintptr_t fnc); -void UFppi(x64emu_t *emu, uintptr_t fnc); -void fFuii(x64emu_t *emu, uintptr_t fnc); -void fFfff(x64emu_t *emu, uintptr_t fnc); -void fFffp(x64emu_t *emu, uintptr_t fnc); -void fFppi(x64emu_t *emu, uintptr_t fnc); -void fFppL(x64emu_t *emu, uintptr_t fnc); -void fFppp(x64emu_t *emu, uintptr_t fnc); -void dFuud(x64emu_t *emu, uintptr_t fnc); -void dFddd(x64emu_t *emu, uintptr_t fnc); -void dFddp(x64emu_t *emu, uintptr_t fnc); -void dFpii(x64emu_t *emu, uintptr_t fnc); -void dFpdd(x64emu_t *emu, uintptr_t fnc); -void dFppi(x64emu_t *emu, uintptr_t fnc); -void dFppu(x64emu_t *emu, uintptr_t fnc); -void dFppd(x64emu_t *emu, uintptr_t fnc); -void dFppp(x64emu_t *emu, uintptr_t fnc); -void DFppi(x64emu_t *emu, uintptr_t fnc); -void DFppp(x64emu_t *emu, uintptr_t fnc); -void lFili(x64emu_t *emu, uintptr_t fnc); -void lFilL(x64emu_t *emu, uintptr_t fnc); -void lFipi(x64emu_t *emu, uintptr_t fnc); -void lFipL(x64emu_t *emu, uintptr_t fnc); -void lFlll(x64emu_t *emu, uintptr_t fnc); -void lFpli(x64emu_t *emu, uintptr_t fnc); -void lFpLu(x64emu_t *emu, uintptr_t fnc); -void lFpLp(x64emu_t *emu, uintptr_t fnc); -void lFppi(x64emu_t *emu, uintptr_t fnc); -void lFppu(x64emu_t *emu, uintptr_t fnc); -void lFppL(x64emu_t *emu, uintptr_t fnc); -void lFppp(x64emu_t *emu, uintptr_t fnc); -void lFSpl(x64emu_t *emu, uintptr_t fnc); -void LFEpA(x64emu_t *emu, uintptr_t fnc); -void LFipL(x64emu_t *emu, uintptr_t fnc); -void LFuui(x64emu_t *emu, uintptr_t fnc); -void LFLii(x64emu_t *emu, uintptr_t fnc); -void LFLLl(x64emu_t *emu, uintptr_t fnc); -void LFLLL(x64emu_t *emu, uintptr_t fnc); -void LFLpu(x64emu_t *emu, uintptr_t fnc); -void LFLpL(x64emu_t *emu, uintptr_t fnc); -void LFpii(x64emu_t *emu, uintptr_t fnc); -void LFpCi(x64emu_t *emu, uintptr_t fnc); -void LFpuL(x64emu_t *emu, uintptr_t fnc); -void LFpup(x64emu_t *emu, uintptr_t fnc); -void LFpLi(x64emu_t *emu, uintptr_t fnc); -void LFpLL(x64emu_t *emu, uintptr_t fnc); -void LFpLp(x64emu_t *emu, uintptr_t fnc); -void LFppi(x64emu_t *emu, uintptr_t fnc); -void LFppu(x64emu_t *emu, uintptr_t fnc); -void LFppL(x64emu_t *emu, uintptr_t fnc); -void LFppp(x64emu_t *emu, uintptr_t fnc); -void LFSpL(x64emu_t *emu, uintptr_t fnc); -void pFEip(x64emu_t *emu, uintptr_t fnc); -void pFEiV(x64emu_t *emu, uintptr_t fnc); -void pFEup(x64emu_t *emu, uintptr_t fnc); -void pFEuV(x64emu_t *emu, uintptr_t fnc); -void pFEpi(x64emu_t *emu, uintptr_t fnc); -void pFEpu(x64emu_t *emu, uintptr_t fnc); -void pFEpp(x64emu_t *emu, uintptr_t fnc); -void pFEpV(x64emu_t *emu, uintptr_t fnc); -void pFEpA(x64emu_t *emu, uintptr_t fnc); -void pFiii(x64emu_t *emu, uintptr_t fnc); -void pFiiu(x64emu_t *emu, uintptr_t fnc); -void pFiip(x64emu_t *emu, uintptr_t fnc); -void pFiIi(x64emu_t *emu, uintptr_t fnc); -void pFiLL(x64emu_t *emu, uintptr_t fnc); -void pFipi(x64emu_t *emu, uintptr_t fnc); -void pFipL(x64emu_t *emu, uintptr_t fnc); -void pFipp(x64emu_t *emu, uintptr_t fnc); -void pFCuW(x64emu_t *emu, uintptr_t fnc); -void pFWWW(x64emu_t *emu, uintptr_t fnc); -void pFuip(x64emu_t *emu, uintptr_t fnc); -void pFuui(x64emu_t *emu, uintptr_t fnc); -void pFuuu(x64emu_t *emu, uintptr_t fnc); -void pFulu(x64emu_t *emu, uintptr_t fnc); -void pFulp(x64emu_t *emu, uintptr_t fnc); -void pFupi(x64emu_t *emu, uintptr_t fnc); -void pFupu(x64emu_t *emu, uintptr_t fnc); -void pFupl(x64emu_t *emu, uintptr_t fnc); -void pFupL(x64emu_t *emu, uintptr_t fnc); -void pFupp(x64emu_t *emu, uintptr_t fnc); -void pFdip(x64emu_t *emu, uintptr_t fnc); -void pFdUU(x64emu_t *emu, uintptr_t fnc); -void pFddi(x64emu_t *emu, uintptr_t fnc); -void pFddd(x64emu_t *emu, uintptr_t fnc); -void pFDip(x64emu_t *emu, uintptr_t fnc); -void pFlpi(x64emu_t *emu, uintptr_t fnc); -void pFLup(x64emu_t *emu, uintptr_t fnc); -void pFLLp(x64emu_t *emu, uintptr_t fnc); -void pFLpi(x64emu_t *emu, uintptr_t fnc); -void pFLpp(x64emu_t *emu, uintptr_t fnc); -void pFpii(x64emu_t *emu, uintptr_t fnc); -void pFpiu(x64emu_t *emu, uintptr_t fnc); -void pFpid(x64emu_t *emu, uintptr_t fnc); -void pFpil(x64emu_t *emu, uintptr_t fnc); -void pFpiL(x64emu_t *emu, uintptr_t fnc); -void pFpip(x64emu_t *emu, uintptr_t fnc); -void pFpCi(x64emu_t *emu, uintptr_t fnc); -void pFpCu(x64emu_t *emu, uintptr_t fnc); -void pFpWi(x64emu_t *emu, uintptr_t fnc); -void pFpWW(x64emu_t *emu, uintptr_t fnc); -void pFpWp(x64emu_t *emu, uintptr_t fnc); -void pFpui(x64emu_t *emu, uintptr_t fnc); -void pFpuu(x64emu_t *emu, uintptr_t fnc); -void pFpuL(x64emu_t *emu, uintptr_t fnc); -void pFpup(x64emu_t *emu, uintptr_t fnc); -void pFpUi(x64emu_t *emu, uintptr_t fnc); -void pFpUu(x64emu_t *emu, uintptr_t fnc); -void pFpdu(x64emu_t *emu, uintptr_t fnc); -void pFpdd(x64emu_t *emu, uintptr_t fnc); -void pFplC(x64emu_t *emu, uintptr_t fnc); -void pFplu(x64emu_t *emu, uintptr_t fnc); -void pFpll(x64emu_t *emu, uintptr_t fnc); -void pFplp(x64emu_t *emu, uintptr_t fnc); -void pFpLi(x64emu_t *emu, uintptr_t fnc); -void pFpLu(x64emu_t *emu, uintptr_t fnc); -void pFpLL(x64emu_t *emu, uintptr_t fnc); -void pFpLp(x64emu_t *emu, uintptr_t fnc); -void pFppi(x64emu_t *emu, uintptr_t fnc); -void pFppI(x64emu_t *emu, uintptr_t fnc); -void pFppC(x64emu_t *emu, uintptr_t fnc); -void pFppu(x64emu_t *emu, uintptr_t fnc); -void pFppU(x64emu_t *emu, uintptr_t fnc); -void pFppf(x64emu_t *emu, uintptr_t fnc); -void pFppl(x64emu_t *emu, uintptr_t fnc); -void pFppL(x64emu_t *emu, uintptr_t fnc); -void pFppp(x64emu_t *emu, uintptr_t fnc); -void pFppA(x64emu_t *emu, uintptr_t fnc); -void pFpOM(x64emu_t *emu, uintptr_t fnc); -void pFpbi(x64emu_t *emu, uintptr_t fnc); -void pFSpl(x64emu_t *emu, uintptr_t fnc); -void pFbCC(x64emu_t *emu, uintptr_t fnc); -void pFbuu(x64emu_t *emu, uintptr_t fnc); -void pFbup(x64emu_t *emu, uintptr_t fnc); -void pFbUp(x64emu_t *emu, uintptr_t fnc); -void pFbpi(x64emu_t *emu, uintptr_t fnc); -void pFbpu(x64emu_t *emu, uintptr_t fnc); -void pFbpp(x64emu_t *emu, uintptr_t fnc); -void vWpup(x64emu_t *emu, uintptr_t fnc); -void iWEip(x64emu_t *emu, uintptr_t fnc); -void iWEpp(x64emu_t *emu, uintptr_t fnc); -void iWpiu(x64emu_t *emu, uintptr_t fnc); -void iWpip(x64emu_t *emu, uintptr_t fnc); -void iWpui(x64emu_t *emu, uintptr_t fnc); -void iWpuu(x64emu_t *emu, uintptr_t fnc); -void iWpup(x64emu_t *emu, uintptr_t fnc); -void iWppu(x64emu_t *emu, uintptr_t fnc); -void iWppp(x64emu_t *emu, uintptr_t fnc); -void uWpui(x64emu_t *emu, uintptr_t fnc); -void uWpup(x64emu_t *emu, uintptr_t fnc); -void vFEiip(x64emu_t *emu, uintptr_t fnc); -void vFEipp(x64emu_t *emu, uintptr_t fnc); -void vFEipV(x64emu_t *emu, uintptr_t fnc); -void vFEipA(x64emu_t *emu, uintptr_t fnc); -void vFELLp(x64emu_t *emu, uintptr_t fnc); -void vFEpii(x64emu_t *emu, uintptr_t fnc); -void vFEpip(x64emu_t *emu, uintptr_t fnc); -void vFEpiA(x64emu_t *emu, uintptr_t fnc); -void vFEpup(x64emu_t *emu, uintptr_t fnc); -void vFEpUp(x64emu_t *emu, uintptr_t fnc); -void vFEppp(x64emu_t *emu, uintptr_t fnc); -void vFEppV(x64emu_t *emu, uintptr_t fnc); -void vFEppA(x64emu_t *emu, uintptr_t fnc); -void vFcccc(x64emu_t *emu, uintptr_t fnc); -void vFwwww(x64emu_t *emu, uintptr_t fnc); -void vFiiii(x64emu_t *emu, uintptr_t fnc); -void vFiiip(x64emu_t *emu, uintptr_t fnc); -void vFiiCp(x64emu_t *emu, uintptr_t fnc); -void vFiill(x64emu_t *emu, uintptr_t fnc); -void vFiipV(x64emu_t *emu, uintptr_t fnc); -void vFiuip(x64emu_t *emu, uintptr_t fnc); -void vFiuuu(x64emu_t *emu, uintptr_t fnc); -void vFiulp(x64emu_t *emu, uintptr_t fnc); -void vFiupV(x64emu_t *emu, uintptr_t fnc); -void vFifff(x64emu_t *emu, uintptr_t fnc); -void vFiddd(x64emu_t *emu, uintptr_t fnc); -void vFilip(x64emu_t *emu, uintptr_t fnc); -void vFilll(x64emu_t *emu, uintptr_t fnc); -void vFilpu(x64emu_t *emu, uintptr_t fnc); -void vFilpp(x64emu_t *emu, uintptr_t fnc); -void vFiLLL(x64emu_t *emu, uintptr_t fnc); -void vFipii(x64emu_t *emu, uintptr_t fnc); -void vFipup(x64emu_t *emu, uintptr_t fnc); -void vFipll(x64emu_t *emu, uintptr_t fnc); -void vFippL(x64emu_t *emu, uintptr_t fnc); -void vFippp(x64emu_t *emu, uintptr_t fnc); -void vFCCCC(x64emu_t *emu, uintptr_t fnc); -void vFWWWW(x64emu_t *emu, uintptr_t fnc); -void vFuccc(x64emu_t *emu, uintptr_t fnc); -void vFuwww(x64emu_t *emu, uintptr_t fnc); -void vFuiii(x64emu_t *emu, uintptr_t fnc); -void vFuiiu(x64emu_t *emu, uintptr_t fnc); -void vFuiip(x64emu_t *emu, uintptr_t fnc); -void vFuiui(x64emu_t *emu, uintptr_t fnc); -void vFuiuC(x64emu_t *emu, uintptr_t fnc); -void vFuiuu(x64emu_t *emu, uintptr_t fnc); -void vFuiup(x64emu_t *emu, uintptr_t fnc); -void vFuifi(x64emu_t *emu, uintptr_t fnc); -void vFuiff(x64emu_t *emu, uintptr_t fnc); -void vFuidd(x64emu_t *emu, uintptr_t fnc); -void vFuill(x64emu_t *emu, uintptr_t fnc); -void vFuilp(x64emu_t *emu, uintptr_t fnc); -void vFuiLL(x64emu_t *emu, uintptr_t fnc); -void vFuipi(x64emu_t *emu, uintptr_t fnc); -void vFuipu(x64emu_t *emu, uintptr_t fnc); -void vFuipp(x64emu_t *emu, uintptr_t fnc); -void vFuWWW(x64emu_t *emu, uintptr_t fnc); -void vFuuii(x64emu_t *emu, uintptr_t fnc); -void vFuuiu(x64emu_t *emu, uintptr_t fnc); -void vFuuil(x64emu_t *emu, uintptr_t fnc); -void vFuuip(x64emu_t *emu, uintptr_t fnc); -void vFuuCu(x64emu_t *emu, uintptr_t fnc); -void vFuuCp(x64emu_t *emu, uintptr_t fnc); -void vFuuui(x64emu_t *emu, uintptr_t fnc); -void vFuuuu(x64emu_t *emu, uintptr_t fnc); -void vFuuuf(x64emu_t *emu, uintptr_t fnc); -void vFuuud(x64emu_t *emu, uintptr_t fnc); -void vFuuul(x64emu_t *emu, uintptr_t fnc); -void vFuuup(x64emu_t *emu, uintptr_t fnc); -void vFuuff(x64emu_t *emu, uintptr_t fnc); -void vFuuli(x64emu_t *emu, uintptr_t fnc); -void vFuulp(x64emu_t *emu, uintptr_t fnc); -void vFuuLl(x64emu_t *emu, uintptr_t fnc); -void vFuupi(x64emu_t *emu, uintptr_t fnc); -void vFuupp(x64emu_t *emu, uintptr_t fnc); -void vFufff(x64emu_t *emu, uintptr_t fnc); -void vFuddd(x64emu_t *emu, uintptr_t fnc); -void vFuluL(x64emu_t *emu, uintptr_t fnc); -void vFullC(x64emu_t *emu, uintptr_t fnc); -void vFulll(x64emu_t *emu, uintptr_t fnc); -void vFullp(x64emu_t *emu, uintptr_t fnc); -void vFulpi(x64emu_t *emu, uintptr_t fnc); -void vFulpu(x64emu_t *emu, uintptr_t fnc); -void vFulpp(x64emu_t *emu, uintptr_t fnc); -void vFuLui(x64emu_t *emu, uintptr_t fnc); -void vFuLup(x64emu_t *emu, uintptr_t fnc); -void vFuLLL(x64emu_t *emu, uintptr_t fnc); -void vFupii(x64emu_t *emu, uintptr_t fnc); -void vFuppi(x64emu_t *emu, uintptr_t fnc); -void vFuppu(x64emu_t *emu, uintptr_t fnc); -void vFUUpi(x64emu_t *emu, uintptr_t fnc); -void vFffff(x64emu_t *emu, uintptr_t fnc); -void vFdddd(x64emu_t *emu, uintptr_t fnc); -void vFllii(x64emu_t *emu, uintptr_t fnc); -void vFLuui(x64emu_t *emu, uintptr_t fnc); -void vFLppi(x64emu_t *emu, uintptr_t fnc); -void vFpiii(x64emu_t *emu, uintptr_t fnc); -void vFpiiu(x64emu_t *emu, uintptr_t fnc); -void vFpiid(x64emu_t *emu, uintptr_t fnc); -void vFpiip(x64emu_t *emu, uintptr_t fnc); -void vFpiui(x64emu_t *emu, uintptr_t fnc); -void vFpiuu(x64emu_t *emu, uintptr_t fnc); -void vFpiuL(x64emu_t *emu, uintptr_t fnc); -void vFpiup(x64emu_t *emu, uintptr_t fnc); -void vFpiUu(x64emu_t *emu, uintptr_t fnc); -void vFpiUU(x64emu_t *emu, uintptr_t fnc); -void vFpifi(x64emu_t *emu, uintptr_t fnc); -void vFpipi(x64emu_t *emu, uintptr_t fnc); -void vFpipu(x64emu_t *emu, uintptr_t fnc); -void vFpipp(x64emu_t *emu, uintptr_t fnc); -void vFpIdi(x64emu_t *emu, uintptr_t fnc); -void vFpCuW(x64emu_t *emu, uintptr_t fnc); -void vFpuii(x64emu_t *emu, uintptr_t fnc); -void vFpuip(x64emu_t *emu, uintptr_t fnc); -void vFpuuu(x64emu_t *emu, uintptr_t fnc); -void vFpuup(x64emu_t *emu, uintptr_t fnc); -void vFpufi(x64emu_t *emu, uintptr_t fnc); -void vFpudd(x64emu_t *emu, uintptr_t fnc); -void vFpupu(x64emu_t *emu, uintptr_t fnc); -void vFpupp(x64emu_t *emu, uintptr_t fnc); -void vFpUuu(x64emu_t *emu, uintptr_t fnc); -void vFpUup(x64emu_t *emu, uintptr_t fnc); -void vFpUUi(x64emu_t *emu, uintptr_t fnc); -void vFpUUu(x64emu_t *emu, uintptr_t fnc); -void vFpUUp(x64emu_t *emu, uintptr_t fnc); -void vFpUpp(x64emu_t *emu, uintptr_t fnc); -void vFpfff(x64emu_t *emu, uintptr_t fnc); -void vFpdii(x64emu_t *emu, uintptr_t fnc); -void vFpdup(x64emu_t *emu, uintptr_t fnc); -void vFpddu(x64emu_t *emu, uintptr_t fnc); -void vFpddd(x64emu_t *emu, uintptr_t fnc); -void vFplll(x64emu_t *emu, uintptr_t fnc); -void vFplpp(x64emu_t *emu, uintptr_t fnc); -void vFpLii(x64emu_t *emu, uintptr_t fnc); -void vFpLuu(x64emu_t *emu, uintptr_t fnc); -void vFpLLL(x64emu_t *emu, uintptr_t fnc); -void vFpLpL(x64emu_t *emu, uintptr_t fnc); -void vFpLpp(x64emu_t *emu, uintptr_t fnc); -void vFppii(x64emu_t *emu, uintptr_t fnc); -void vFppiu(x64emu_t *emu, uintptr_t fnc); -void vFppid(x64emu_t *emu, uintptr_t fnc); -void vFppil(x64emu_t *emu, uintptr_t fnc); -void vFppiL(x64emu_t *emu, uintptr_t fnc); -void vFppip(x64emu_t *emu, uintptr_t fnc); -void vFppui(x64emu_t *emu, uintptr_t fnc); -void vFppuu(x64emu_t *emu, uintptr_t fnc); -void vFppup(x64emu_t *emu, uintptr_t fnc); -void vFppfi(x64emu_t *emu, uintptr_t fnc); -void vFppff(x64emu_t *emu, uintptr_t fnc); -void vFppdu(x64emu_t *emu, uintptr_t fnc); -void vFppdd(x64emu_t *emu, uintptr_t fnc); -void vFppdp(x64emu_t *emu, uintptr_t fnc); -void vFpplp(x64emu_t *emu, uintptr_t fnc); -void vFppLL(x64emu_t *emu, uintptr_t fnc); -void vFppLp(x64emu_t *emu, uintptr_t fnc); -void vFpppi(x64emu_t *emu, uintptr_t fnc); -void vFpppu(x64emu_t *emu, uintptr_t fnc); -void vFpppd(x64emu_t *emu, uintptr_t fnc); -void vFpppl(x64emu_t *emu, uintptr_t fnc); -void vFpppL(x64emu_t *emu, uintptr_t fnc); -void vFpppp(x64emu_t *emu, uintptr_t fnc); -void cFpipp(x64emu_t *emu, uintptr_t fnc); -void iFEiip(x64emu_t *emu, uintptr_t fnc); -void iFEiiN(x64emu_t *emu, uintptr_t fnc); -void iFEipp(x64emu_t *emu, uintptr_t fnc); -void iFEipV(x64emu_t *emu, uintptr_t fnc); -void iFEipA(x64emu_t *emu, uintptr_t fnc); -void iFEupu(x64emu_t *emu, uintptr_t fnc); -void iFEupp(x64emu_t *emu, uintptr_t fnc); -void iFEpii(x64emu_t *emu, uintptr_t fnc); -void iFEpip(x64emu_t *emu, uintptr_t fnc); -void iFEpiV(x64emu_t *emu, uintptr_t fnc); -void iFEpiA(x64emu_t *emu, uintptr_t fnc); -void iFEpui(x64emu_t *emu, uintptr_t fnc); -void iFEpup(x64emu_t *emu, uintptr_t fnc); -void iFEpUi(x64emu_t *emu, uintptr_t fnc); -void iFEpUp(x64emu_t *emu, uintptr_t fnc); -void iFEpLi(x64emu_t *emu, uintptr_t fnc); -void iFEpLp(x64emu_t *emu, uintptr_t fnc); -void iFEppi(x64emu_t *emu, uintptr_t fnc); -void iFEppd(x64emu_t *emu, uintptr_t fnc); -void iFEppL(x64emu_t *emu, uintptr_t fnc); -void iFEppp(x64emu_t *emu, uintptr_t fnc); -void iFEppV(x64emu_t *emu, uintptr_t fnc); -void iFEppA(x64emu_t *emu, uintptr_t fnc); -void iFEpOu(x64emu_t *emu, uintptr_t fnc); -void iFwwww(x64emu_t *emu, uintptr_t fnc); -void iFwppp(x64emu_t *emu, uintptr_t fnc); -void iFiiii(x64emu_t *emu, uintptr_t fnc); -void iFiiiu(x64emu_t *emu, uintptr_t fnc); -void iFiiip(x64emu_t *emu, uintptr_t fnc); -void iFiiiN(x64emu_t *emu, uintptr_t fnc); -void iFiiui(x64emu_t *emu, uintptr_t fnc); -void iFiill(x64emu_t *emu, uintptr_t fnc); -void iFiipi(x64emu_t *emu, uintptr_t fnc); -void iFiipp(x64emu_t *emu, uintptr_t fnc); -void iFiWii(x64emu_t *emu, uintptr_t fnc); -void iFiuwp(x64emu_t *emu, uintptr_t fnc); -void iFiuup(x64emu_t *emu, uintptr_t fnc); -void iFiupp(x64emu_t *emu, uintptr_t fnc); -void iFilli(x64emu_t *emu, uintptr_t fnc); -void iFillu(x64emu_t *emu, uintptr_t fnc); -void iFiLpL(x64emu_t *emu, uintptr_t fnc); -void iFipii(x64emu_t *emu, uintptr_t fnc); -void iFipip(x64emu_t *emu, uintptr_t fnc); -void iFipWp(x64emu_t *emu, uintptr_t fnc); -void iFipui(x64emu_t *emu, uintptr_t fnc); -void iFipuL(x64emu_t *emu, uintptr_t fnc); -void iFipLi(x64emu_t *emu, uintptr_t fnc); -void iFipLu(x64emu_t *emu, uintptr_t fnc); -void iFipLp(x64emu_t *emu, uintptr_t fnc); -void iFippi(x64emu_t *emu, uintptr_t fnc); -void iFippu(x64emu_t *emu, uintptr_t fnc); -void iFippL(x64emu_t *emu, uintptr_t fnc); -void iFippp(x64emu_t *emu, uintptr_t fnc); -void iFipON(x64emu_t *emu, uintptr_t fnc); -void iFuiup(x64emu_t *emu, uintptr_t fnc); -void iFuipp(x64emu_t *emu, uintptr_t fnc); -void iFuWWp(x64emu_t *emu, uintptr_t fnc); -void iFuuuu(x64emu_t *emu, uintptr_t fnc); -void iFuupi(x64emu_t *emu, uintptr_t fnc); -void iFuupp(x64emu_t *emu, uintptr_t fnc); -void iFupLp(x64emu_t *emu, uintptr_t fnc); -void iFuppi(x64emu_t *emu, uintptr_t fnc); -void iFuppu(x64emu_t *emu, uintptr_t fnc); -void iFuppp(x64emu_t *emu, uintptr_t fnc); -void iFLppp(x64emu_t *emu, uintptr_t fnc); -void iFpwww(x64emu_t *emu, uintptr_t fnc); -void iFpwpp(x64emu_t *emu, uintptr_t fnc); -void iFpiii(x64emu_t *emu, uintptr_t fnc); -void iFpiiu(x64emu_t *emu, uintptr_t fnc); -void iFpiid(x64emu_t *emu, uintptr_t fnc); -void iFpiiL(x64emu_t *emu, uintptr_t fnc); -void iFpiip(x64emu_t *emu, uintptr_t fnc); -void iFpiuu(x64emu_t *emu, uintptr_t fnc); -void iFpiuL(x64emu_t *emu, uintptr_t fnc); -void iFpiup(x64emu_t *emu, uintptr_t fnc); -void iFpiUp(x64emu_t *emu, uintptr_t fnc); -void iFpild(x64emu_t *emu, uintptr_t fnc); -void iFpipi(x64emu_t *emu, uintptr_t fnc); -void iFpipu(x64emu_t *emu, uintptr_t fnc); -void iFpipL(x64emu_t *emu, uintptr_t fnc); -void iFpipp(x64emu_t *emu, uintptr_t fnc); -void iFpipV(x64emu_t *emu, uintptr_t fnc); -void iFpIip(x64emu_t *emu, uintptr_t fnc); -void iFpCCC(x64emu_t *emu, uintptr_t fnc); -void iFpCpi(x64emu_t *emu, uintptr_t fnc); -void iFpCpp(x64emu_t *emu, uintptr_t fnc); -void iFpWWu(x64emu_t *emu, uintptr_t fnc); -void iFpWpp(x64emu_t *emu, uintptr_t fnc); -void iFpuwp(x64emu_t *emu, uintptr_t fnc); -void iFpuii(x64emu_t *emu, uintptr_t fnc); -void iFpuiL(x64emu_t *emu, uintptr_t fnc); -void iFpuip(x64emu_t *emu, uintptr_t fnc); -void iFpuui(x64emu_t *emu, uintptr_t fnc); -void iFpuuu(x64emu_t *emu, uintptr_t fnc); -void iFpuul(x64emu_t *emu, uintptr_t fnc); -void iFpuuL(x64emu_t *emu, uintptr_t fnc); -void iFpuup(x64emu_t *emu, uintptr_t fnc); -void iFpuUp(x64emu_t *emu, uintptr_t fnc); -void iFpuLL(x64emu_t *emu, uintptr_t fnc); -void iFpuLp(x64emu_t *emu, uintptr_t fnc); -void iFpupi(x64emu_t *emu, uintptr_t fnc); -void iFpupC(x64emu_t *emu, uintptr_t fnc); -void iFpupu(x64emu_t *emu, uintptr_t fnc); -void iFpupU(x64emu_t *emu, uintptr_t fnc); -void iFpupL(x64emu_t *emu, uintptr_t fnc); -void iFpupp(x64emu_t *emu, uintptr_t fnc); -void iFpupV(x64emu_t *emu, uintptr_t fnc); -void iFpUip(x64emu_t *emu, uintptr_t fnc); -void iFpUup(x64emu_t *emu, uintptr_t fnc); -void iFpUUU(x64emu_t *emu, uintptr_t fnc); -void iFpULp(x64emu_t *emu, uintptr_t fnc); -void iFpUpp(x64emu_t *emu, uintptr_t fnc); -void iFpdip(x64emu_t *emu, uintptr_t fnc); -void iFplii(x64emu_t *emu, uintptr_t fnc); -void iFplip(x64emu_t *emu, uintptr_t fnc); -void iFplpi(x64emu_t *emu, uintptr_t fnc); -void iFplpp(x64emu_t *emu, uintptr_t fnc); -void iFpLii(x64emu_t *emu, uintptr_t fnc); -void iFpLiL(x64emu_t *emu, uintptr_t fnc); -void iFpLip(x64emu_t *emu, uintptr_t fnc); -void iFpLuu(x64emu_t *emu, uintptr_t fnc); -void iFpLup(x64emu_t *emu, uintptr_t fnc); -void iFpLlp(x64emu_t *emu, uintptr_t fnc); -void iFpLLu(x64emu_t *emu, uintptr_t fnc); -void iFpLLL(x64emu_t *emu, uintptr_t fnc); -void iFpLLp(x64emu_t *emu, uintptr_t fnc); -void iFpLpi(x64emu_t *emu, uintptr_t fnc); -void iFpLpf(x64emu_t *emu, uintptr_t fnc); -void iFpLpd(x64emu_t *emu, uintptr_t fnc); -void iFpLpD(x64emu_t *emu, uintptr_t fnc); -void iFpLpL(x64emu_t *emu, uintptr_t fnc); -void iFpLpp(x64emu_t *emu, uintptr_t fnc); -void iFppii(x64emu_t *emu, uintptr_t fnc); -void iFppiu(x64emu_t *emu, uintptr_t fnc); -void iFppiU(x64emu_t *emu, uintptr_t fnc); -void iFppiL(x64emu_t *emu, uintptr_t fnc); -void iFppip(x64emu_t *emu, uintptr_t fnc); -void iFppIL(x64emu_t *emu, uintptr_t fnc); -void iFppCC(x64emu_t *emu, uintptr_t fnc); -void iFppuw(x64emu_t *emu, uintptr_t fnc); -void iFppui(x64emu_t *emu, uintptr_t fnc); -void iFppuu(x64emu_t *emu, uintptr_t fnc); -void iFppuL(x64emu_t *emu, uintptr_t fnc); -void iFppup(x64emu_t *emu, uintptr_t fnc); -void iFppdd(x64emu_t *emu, uintptr_t fnc); -void iFppdp(x64emu_t *emu, uintptr_t fnc); -void iFppli(x64emu_t *emu, uintptr_t fnc); -void iFppll(x64emu_t *emu, uintptr_t fnc); -void iFpplL(x64emu_t *emu, uintptr_t fnc); -void iFpplp(x64emu_t *emu, uintptr_t fnc); -void iFppLi(x64emu_t *emu, uintptr_t fnc); -void iFppLL(x64emu_t *emu, uintptr_t fnc); -void iFppLp(x64emu_t *emu, uintptr_t fnc); -void iFpppi(x64emu_t *emu, uintptr_t fnc); -void iFpppC(x64emu_t *emu, uintptr_t fnc); -void iFpppu(x64emu_t *emu, uintptr_t fnc); -void iFpppL(x64emu_t *emu, uintptr_t fnc); -void iFpppp(x64emu_t *emu, uintptr_t fnc); -void iFbupp(x64emu_t *emu, uintptr_t fnc); -void IFEpIi(x64emu_t *emu, uintptr_t fnc); -void IFipUI(x64emu_t *emu, uintptr_t fnc); -void IFipUp(x64emu_t *emu, uintptr_t fnc); -void IFpIip(x64emu_t *emu, uintptr_t fnc); -void IFppii(x64emu_t *emu, uintptr_t fnc); -void IFppip(x64emu_t *emu, uintptr_t fnc); -void IFSIii(x64emu_t *emu, uintptr_t fnc); -void CFuuff(x64emu_t *emu, uintptr_t fnc); -void CFpiii(x64emu_t *emu, uintptr_t fnc); -void CFpLLi(x64emu_t *emu, uintptr_t fnc); -void CFppip(x64emu_t *emu, uintptr_t fnc); -void CFbupp(x64emu_t *emu, uintptr_t fnc); -void uFEipp(x64emu_t *emu, uintptr_t fnc); -void uFEupp(x64emu_t *emu, uintptr_t fnc); -void uFEpup(x64emu_t *emu, uintptr_t fnc); -void uFEppp(x64emu_t *emu, uintptr_t fnc); -void uFiiii(x64emu_t *emu, uintptr_t fnc); -void uFiiuu(x64emu_t *emu, uintptr_t fnc); -void uFifff(x64emu_t *emu, uintptr_t fnc); -void uFuuuu(x64emu_t *emu, uintptr_t fnc); -void uFpiip(x64emu_t *emu, uintptr_t fnc); -void uFpipu(x64emu_t *emu, uintptr_t fnc); -void uFpipL(x64emu_t *emu, uintptr_t fnc); -void uFpipp(x64emu_t *emu, uintptr_t fnc); -void uFpCCC(x64emu_t *emu, uintptr_t fnc); -void uFpuip(x64emu_t *emu, uintptr_t fnc); -void uFpuup(x64emu_t *emu, uintptr_t fnc); -void uFpupi(x64emu_t *emu, uintptr_t fnc); -void uFpupu(x64emu_t *emu, uintptr_t fnc); -void uFpupp(x64emu_t *emu, uintptr_t fnc); -void uFpubp(x64emu_t *emu, uintptr_t fnc); -void uFppiu(x64emu_t *emu, uintptr_t fnc); -void uFppip(x64emu_t *emu, uintptr_t fnc); -void uFppuu(x64emu_t *emu, uintptr_t fnc); -void uFpplp(x64emu_t *emu, uintptr_t fnc); -void uFppLp(x64emu_t *emu, uintptr_t fnc); -void uFpppi(x64emu_t *emu, uintptr_t fnc); -void uFpppu(x64emu_t *emu, uintptr_t fnc); -void uFpppL(x64emu_t *emu, uintptr_t fnc); -void uFpppp(x64emu_t *emu, uintptr_t fnc); -void uFbipp(x64emu_t *emu, uintptr_t fnc); -void uFbCWp(x64emu_t *emu, uintptr_t fnc); -void uFbuWp(x64emu_t *emu, uintptr_t fnc); -void uFbuuC(x64emu_t *emu, uintptr_t fnc); -void uFbuuu(x64emu_t *emu, uintptr_t fnc); -void uFbuup(x64emu_t *emu, uintptr_t fnc); -void UFpUui(x64emu_t *emu, uintptr_t fnc); -void UFppii(x64emu_t *emu, uintptr_t fnc); -void UFppip(x64emu_t *emu, uintptr_t fnc); -void UFbipp(x64emu_t *emu, uintptr_t fnc); -void dFpppp(x64emu_t *emu, uintptr_t fnc); -void lFEipV(x64emu_t *emu, uintptr_t fnc); -void lFEpip(x64emu_t *emu, uintptr_t fnc); -void lFEppL(x64emu_t *emu, uintptr_t fnc); -void lFEppp(x64emu_t *emu, uintptr_t fnc); -void lFiiLu(x64emu_t *emu, uintptr_t fnc); -void lFiipL(x64emu_t *emu, uintptr_t fnc); -void lFipil(x64emu_t *emu, uintptr_t fnc); -void lFipLi(x64emu_t *emu, uintptr_t fnc); -void lFipLI(x64emu_t *emu, uintptr_t fnc); -void lFipLu(x64emu_t *emu, uintptr_t fnc); -void lFipLl(x64emu_t *emu, uintptr_t fnc); -void lFipLL(x64emu_t *emu, uintptr_t fnc); -void lFipLp(x64emu_t *emu, uintptr_t fnc); -void lFippL(x64emu_t *emu, uintptr_t fnc); -void lFpili(x64emu_t *emu, uintptr_t fnc); -void lFpilp(x64emu_t *emu, uintptr_t fnc); -void lFpuip(x64emu_t *emu, uintptr_t fnc); -void lFplip(x64emu_t *emu, uintptr_t fnc); -void lFplpp(x64emu_t *emu, uintptr_t fnc); -void lFpLpp(x64emu_t *emu, uintptr_t fnc); -void lFppii(x64emu_t *emu, uintptr_t fnc); -void lFppip(x64emu_t *emu, uintptr_t fnc); -void lFpppL(x64emu_t *emu, uintptr_t fnc); -void lFpppp(x64emu_t *emu, uintptr_t fnc); -void LFEppL(x64emu_t *emu, uintptr_t fnc); -void LFEppp(x64emu_t *emu, uintptr_t fnc); -void LFipLL(x64emu_t *emu, uintptr_t fnc); -void LFippL(x64emu_t *emu, uintptr_t fnc); -void LFippp(x64emu_t *emu, uintptr_t fnc); -void LFuipL(x64emu_t *emu, uintptr_t fnc); -void LFpCii(x64emu_t *emu, uintptr_t fnc); -void LFpupL(x64emu_t *emu, uintptr_t fnc); -void LFpLCL(x64emu_t *emu, uintptr_t fnc); -void LFpLLp(x64emu_t *emu, uintptr_t fnc); -void LFpLpL(x64emu_t *emu, uintptr_t fnc); -void LFpLpp(x64emu_t *emu, uintptr_t fnc); -void LFppii(x64emu_t *emu, uintptr_t fnc); -void LFppip(x64emu_t *emu, uintptr_t fnc); -void LFppLu(x64emu_t *emu, uintptr_t fnc); -void LFppLL(x64emu_t *emu, uintptr_t fnc); -void LFppLp(x64emu_t *emu, uintptr_t fnc); -void LFpppi(x64emu_t *emu, uintptr_t fnc); -void LFpppL(x64emu_t *emu, uintptr_t fnc); -void LFpppp(x64emu_t *emu, uintptr_t fnc); -void pFEipp(x64emu_t *emu, uintptr_t fnc); -void pFEuup(x64emu_t *emu, uintptr_t fnc); -void pFEupp(x64emu_t *emu, uintptr_t fnc); -void pFELpV(x64emu_t *emu, uintptr_t fnc); -void pFELpA(x64emu_t *emu, uintptr_t fnc); -void pFEpii(x64emu_t *emu, uintptr_t fnc); -void pFEpip(x64emu_t *emu, uintptr_t fnc); -void pFEpuL(x64emu_t *emu, uintptr_t fnc); -void pFEppi(x64emu_t *emu, uintptr_t fnc); -void pFEppp(x64emu_t *emu, uintptr_t fnc); -void pFEppV(x64emu_t *emu, uintptr_t fnc); -void pFiiii(x64emu_t *emu, uintptr_t fnc); -void pFiiiu(x64emu_t *emu, uintptr_t fnc); -void pFiiuu(x64emu_t *emu, uintptr_t fnc); -void pFiiup(x64emu_t *emu, uintptr_t fnc); -void pFiiLp(x64emu_t *emu, uintptr_t fnc); -void pFiipi(x64emu_t *emu, uintptr_t fnc); -void pFiIIi(x64emu_t *emu, uintptr_t fnc); -void pFillu(x64emu_t *emu, uintptr_t fnc); -void pFipii(x64emu_t *emu, uintptr_t fnc); -void pFipip(x64emu_t *emu, uintptr_t fnc); -void pFippi(x64emu_t *emu, uintptr_t fnc); -void pFippu(x64emu_t *emu, uintptr_t fnc); -void pFippL(x64emu_t *emu, uintptr_t fnc); -void pFippp(x64emu_t *emu, uintptr_t fnc); -void pFuuii(x64emu_t *emu, uintptr_t fnc); -void pFuuip(x64emu_t *emu, uintptr_t fnc); -void pFuuuu(x64emu_t *emu, uintptr_t fnc); -void pFullu(x64emu_t *emu, uintptr_t fnc); -void pFupii(x64emu_t *emu, uintptr_t fnc); -void pFuppp(x64emu_t *emu, uintptr_t fnc); -void pFffff(x64emu_t *emu, uintptr_t fnc); -void pFdipp(x64emu_t *emu, uintptr_t fnc); -void pFdddd(x64emu_t *emu, uintptr_t fnc); -void pFDipp(x64emu_t *emu, uintptr_t fnc); -void pFlfff(x64emu_t *emu, uintptr_t fnc); -void pFLiip(x64emu_t *emu, uintptr_t fnc); -void pFLLup(x64emu_t *emu, uintptr_t fnc); -void pFLLpp(x64emu_t *emu, uintptr_t fnc); -void pFLppp(x64emu_t *emu, uintptr_t fnc); -void pFpiii(x64emu_t *emu, uintptr_t fnc); -void pFpiiu(x64emu_t *emu, uintptr_t fnc); -void pFpiip(x64emu_t *emu, uintptr_t fnc); -void pFpiuu(x64emu_t *emu, uintptr_t fnc); -void pFpiLi(x64emu_t *emu, uintptr_t fnc); -void pFpiLL(x64emu_t *emu, uintptr_t fnc); -void pFpipi(x64emu_t *emu, uintptr_t fnc); -void pFpipd(x64emu_t *emu, uintptr_t fnc); -void pFpipL(x64emu_t *emu, uintptr_t fnc); -void pFpipp(x64emu_t *emu, uintptr_t fnc); -void pFpCip(x64emu_t *emu, uintptr_t fnc); -void pFpWWW(x64emu_t *emu, uintptr_t fnc); -void pFpuii(x64emu_t *emu, uintptr_t fnc); -void pFpuip(x64emu_t *emu, uintptr_t fnc); -void pFpuuu(x64emu_t *emu, uintptr_t fnc); -void pFpuup(x64emu_t *emu, uintptr_t fnc); -void pFpudd(x64emu_t *emu, uintptr_t fnc); -void pFpuLL(x64emu_t *emu, uintptr_t fnc); -void pFpupi(x64emu_t *emu, uintptr_t fnc); -void pFpupu(x64emu_t *emu, uintptr_t fnc); -void pFpupp(x64emu_t *emu, uintptr_t fnc); -void pFpdIU(x64emu_t *emu, uintptr_t fnc); -void pFpddi(x64emu_t *emu, uintptr_t fnc); -void pFplil(x64emu_t *emu, uintptr_t fnc); -void pFplip(x64emu_t *emu, uintptr_t fnc); -void pFplpl(x64emu_t *emu, uintptr_t fnc); -void pFplpp(x64emu_t *emu, uintptr_t fnc); -void pFpLii(x64emu_t *emu, uintptr_t fnc); -void pFpLip(x64emu_t *emu, uintptr_t fnc); -void pFpLup(x64emu_t *emu, uintptr_t fnc); -void pFpLLp(x64emu_t *emu, uintptr_t fnc); -void pFpLpi(x64emu_t *emu, uintptr_t fnc); -void pFpLpl(x64emu_t *emu, uintptr_t fnc); -void pFpLpL(x64emu_t *emu, uintptr_t fnc); -void pFpLpp(x64emu_t *emu, uintptr_t fnc); -void pFppii(x64emu_t *emu, uintptr_t fnc); -void pFppiu(x64emu_t *emu, uintptr_t fnc); -void pFppiL(x64emu_t *emu, uintptr_t fnc); -void pFppip(x64emu_t *emu, uintptr_t fnc); -void pFppCp(x64emu_t *emu, uintptr_t fnc); -void pFppWp(x64emu_t *emu, uintptr_t fnc); -void pFppuu(x64emu_t *emu, uintptr_t fnc); -void pFppuL(x64emu_t *emu, uintptr_t fnc); -void pFppup(x64emu_t *emu, uintptr_t fnc); -void pFppUU(x64emu_t *emu, uintptr_t fnc); -void pFppdd(x64emu_t *emu, uintptr_t fnc); -void pFppll(x64emu_t *emu, uintptr_t fnc); -void pFpplp(x64emu_t *emu, uintptr_t fnc); -void pFppLi(x64emu_t *emu, uintptr_t fnc); -void pFppLL(x64emu_t *emu, uintptr_t fnc); -void pFppLp(x64emu_t *emu, uintptr_t fnc); -void pFpppi(x64emu_t *emu, uintptr_t fnc); -void pFpppu(x64emu_t *emu, uintptr_t fnc); -void pFpppL(x64emu_t *emu, uintptr_t fnc); -void pFpppp(x64emu_t *emu, uintptr_t fnc); -void pFpbii(x64emu_t *emu, uintptr_t fnc); -void pFSppi(x64emu_t *emu, uintptr_t fnc); -void pFbCuW(x64emu_t *emu, uintptr_t fnc); -void pFbCuu(x64emu_t *emu, uintptr_t fnc); -void pFbuWp(x64emu_t *emu, uintptr_t fnc); -void pFbuuC(x64emu_t *emu, uintptr_t fnc); -void pFbuuu(x64emu_t *emu, uintptr_t fnc); -void pFbuup(x64emu_t *emu, uintptr_t fnc); -void pFbpWp(x64emu_t *emu, uintptr_t fnc); -void pFbpup(x64emu_t *emu, uintptr_t fnc); -void pFbppu(x64emu_t *emu, uintptr_t fnc); -void pFbppU(x64emu_t *emu, uintptr_t fnc); -void vWpiiu(x64emu_t *emu, uintptr_t fnc); -void vWpuup(x64emu_t *emu, uintptr_t fnc); -void iWEpip(x64emu_t *emu, uintptr_t fnc); -void iWEpup(x64emu_t *emu, uintptr_t fnc); -void iWEppu(x64emu_t *emu, uintptr_t fnc); -void iWEppp(x64emu_t *emu, uintptr_t fnc); -void iWpiii(x64emu_t *emu, uintptr_t fnc); -void iWpiuu(x64emu_t *emu, uintptr_t fnc); -void iWpuiu(x64emu_t *emu, uintptr_t fnc); -void iWpuip(x64emu_t *emu, uintptr_t fnc); -void iWpuup(x64emu_t *emu, uintptr_t fnc); -void iWpupu(x64emu_t *emu, uintptr_t fnc); -void iWpupp(x64emu_t *emu, uintptr_t fnc); -void iWppuu(x64emu_t *emu, uintptr_t fnc); -void iWpppu(x64emu_t *emu, uintptr_t fnc); -void iWpppp(x64emu_t *emu, uintptr_t fnc); -void vFEiipV(x64emu_t *emu, uintptr_t fnc); -void vFEiipA(x64emu_t *emu, uintptr_t fnc); -void vFEippp(x64emu_t *emu, uintptr_t fnc); -void vFEpipV(x64emu_t *emu, uintptr_t fnc); -void vFEpipA(x64emu_t *emu, uintptr_t fnc); -void vFEpuup(x64emu_t *emu, uintptr_t fnc); -void vFEpuuV(x64emu_t *emu, uintptr_t fnc); -void vFEpupp(x64emu_t *emu, uintptr_t fnc); -void vFEpupA(x64emu_t *emu, uintptr_t fnc); -void vFEpLLp(x64emu_t *emu, uintptr_t fnc); -void vFEppip(x64emu_t *emu, uintptr_t fnc); -void vFEppiV(x64emu_t *emu, uintptr_t fnc); -void vFEppuu(x64emu_t *emu, uintptr_t fnc); -void vFEppup(x64emu_t *emu, uintptr_t fnc); -void vFEpppi(x64emu_t *emu, uintptr_t fnc); -void vFEpppp(x64emu_t *emu, uintptr_t fnc); -void vFiiiii(x64emu_t *emu, uintptr_t fnc); -void vFiiiiu(x64emu_t *emu, uintptr_t fnc); -void vFiiipi(x64emu_t *emu, uintptr_t fnc); -void vFiiuii(x64emu_t *emu, uintptr_t fnc); -void vFiiuup(x64emu_t *emu, uintptr_t fnc); -void vFiillu(x64emu_t *emu, uintptr_t fnc); -void vFiilll(x64emu_t *emu, uintptr_t fnc); -void vFiipii(x64emu_t *emu, uintptr_t fnc); -void vFiipll(x64emu_t *emu, uintptr_t fnc); -void vFiuiip(x64emu_t *emu, uintptr_t fnc); -void vFiuipi(x64emu_t *emu, uintptr_t fnc); -void vFiuuuu(x64emu_t *emu, uintptr_t fnc); -void vFiulpp(x64emu_t *emu, uintptr_t fnc); -void vFiffff(x64emu_t *emu, uintptr_t fnc); -void vFidddd(x64emu_t *emu, uintptr_t fnc); -void vFilill(x64emu_t *emu, uintptr_t fnc); -void vFilipi(x64emu_t *emu, uintptr_t fnc); -void vFilipl(x64emu_t *emu, uintptr_t fnc); -void vFillll(x64emu_t *emu, uintptr_t fnc); -void vFiLLLL(x64emu_t *emu, uintptr_t fnc); -void vFipipu(x64emu_t *emu, uintptr_t fnc); -void vFipipp(x64emu_t *emu, uintptr_t fnc); -void vFipupi(x64emu_t *emu, uintptr_t fnc); -void vFucccc(x64emu_t *emu, uintptr_t fnc); -void vFuwwww(x64emu_t *emu, uintptr_t fnc); -void vFuiiii(x64emu_t *emu, uintptr_t fnc); -void vFuiiiu(x64emu_t *emu, uintptr_t fnc); -void vFuiiip(x64emu_t *emu, uintptr_t fnc); -void vFuiiCp(x64emu_t *emu, uintptr_t fnc); -void vFuiiup(x64emu_t *emu, uintptr_t fnc); -void vFuiill(x64emu_t *emu, uintptr_t fnc); -void vFuiuii(x64emu_t *emu, uintptr_t fnc); -void vFuiuip(x64emu_t *emu, uintptr_t fnc); -void vFuiuCi(x64emu_t *emu, uintptr_t fnc); -void vFuiuCu(x64emu_t *emu, uintptr_t fnc); -void vFuiuuu(x64emu_t *emu, uintptr_t fnc); -void vFuiuup(x64emu_t *emu, uintptr_t fnc); -void vFuiupi(x64emu_t *emu, uintptr_t fnc); -void vFuifff(x64emu_t *emu, uintptr_t fnc); -void vFuiddd(x64emu_t *emu, uintptr_t fnc); -void vFuilll(x64emu_t *emu, uintptr_t fnc); -void vFuiLLL(x64emu_t *emu, uintptr_t fnc); -void vFuipii(x64emu_t *emu, uintptr_t fnc); -void vFuipip(x64emu_t *emu, uintptr_t fnc); -void vFuipup(x64emu_t *emu, uintptr_t fnc); -void vFuippp(x64emu_t *emu, uintptr_t fnc); -void vFuCCCC(x64emu_t *emu, uintptr_t fnc); -void vFuCuip(x64emu_t *emu, uintptr_t fnc); -void vFuCuup(x64emu_t *emu, uintptr_t fnc); -void vFuWWWW(x64emu_t *emu, uintptr_t fnc); -void vFuuiii(x64emu_t *emu, uintptr_t fnc); -void vFuuiiu(x64emu_t *emu, uintptr_t fnc); -void vFuuiip(x64emu_t *emu, uintptr_t fnc); -void vFuuiui(x64emu_t *emu, uintptr_t fnc); -void vFuuiuu(x64emu_t *emu, uintptr_t fnc); -void vFuuiup(x64emu_t *emu, uintptr_t fnc); -void vFuuifi(x64emu_t *emu, uintptr_t fnc); -void vFuuipC(x64emu_t *emu, uintptr_t fnc); -void vFuuipu(x64emu_t *emu, uintptr_t fnc); -void vFuuipp(x64emu_t *emu, uintptr_t fnc); -void vFuuuii(x64emu_t *emu, uintptr_t fnc); -void vFuuuiu(x64emu_t *emu, uintptr_t fnc); -void vFuuuil(x64emu_t *emu, uintptr_t fnc); -void vFuuuip(x64emu_t *emu, uintptr_t fnc); -void vFuuuui(x64emu_t *emu, uintptr_t fnc); -void vFuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFuuuup(x64emu_t *emu, uintptr_t fnc); -void vFuuuli(x64emu_t *emu, uintptr_t fnc); -void vFuuull(x64emu_t *emu, uintptr_t fnc); -void vFuulll(x64emu_t *emu, uintptr_t fnc); -void vFuullp(x64emu_t *emu, uintptr_t fnc); -void vFuupii(x64emu_t *emu, uintptr_t fnc); -void vFuuppu(x64emu_t *emu, uintptr_t fnc); -void vFuffff(x64emu_t *emu, uintptr_t fnc); -void vFudddd(x64emu_t *emu, uintptr_t fnc); -void vFulill(x64emu_t *emu, uintptr_t fnc); -void vFullll(x64emu_t *emu, uintptr_t fnc); -void vFullpu(x64emu_t *emu, uintptr_t fnc); -void vFuLLLL(x64emu_t *emu, uintptr_t fnc); -void vFupiii(x64emu_t *emu, uintptr_t fnc); -void vFupupi(x64emu_t *emu, uintptr_t fnc); -void vFupupp(x64emu_t *emu, uintptr_t fnc); -void vFuplii(x64emu_t *emu, uintptr_t fnc); -void vFuppip(x64emu_t *emu, uintptr_t fnc); -void vFupppu(x64emu_t *emu, uintptr_t fnc); -void vFupppp(x64emu_t *emu, uintptr_t fnc); -void vFfffff(x64emu_t *emu, uintptr_t fnc); -void vFddddp(x64emu_t *emu, uintptr_t fnc); -void vFluipp(x64emu_t *emu, uintptr_t fnc); -void vFLpppi(x64emu_t *emu, uintptr_t fnc); -void vFLpppp(x64emu_t *emu, uintptr_t fnc); -void vFpiiii(x64emu_t *emu, uintptr_t fnc); -void vFpiiiI(x64emu_t *emu, uintptr_t fnc); -void vFpiiiu(x64emu_t *emu, uintptr_t fnc); -void vFpiiip(x64emu_t *emu, uintptr_t fnc); -void vFpiiII(x64emu_t *emu, uintptr_t fnc); -void vFpiiuu(x64emu_t *emu, uintptr_t fnc); -void vFpiiup(x64emu_t *emu, uintptr_t fnc); -void vFpiiff(x64emu_t *emu, uintptr_t fnc); -void vFpiipp(x64emu_t *emu, uintptr_t fnc); -void vFpiIiI(x64emu_t *emu, uintptr_t fnc); -void vFpiIII(x64emu_t *emu, uintptr_t fnc); -void vFpiuuu(x64emu_t *emu, uintptr_t fnc); -void vFpiUUu(x64emu_t *emu, uintptr_t fnc); -void vFpiUUp(x64emu_t *emu, uintptr_t fnc); -void vFpilpp(x64emu_t *emu, uintptr_t fnc); -void vFpipii(x64emu_t *emu, uintptr_t fnc); -void vFpippi(x64emu_t *emu, uintptr_t fnc); -void vFpippp(x64emu_t *emu, uintptr_t fnc); -void vFpuiip(x64emu_t *emu, uintptr_t fnc); -void vFpuipp(x64emu_t *emu, uintptr_t fnc); -void vFpuuuu(x64emu_t *emu, uintptr_t fnc); -void vFpuuup(x64emu_t *emu, uintptr_t fnc); -void vFpuupp(x64emu_t *emu, uintptr_t fnc); -void vFpuddd(x64emu_t *emu, uintptr_t fnc); -void vFpupiu(x64emu_t *emu, uintptr_t fnc); -void vFpupup(x64emu_t *emu, uintptr_t fnc); -void vFpUuuu(x64emu_t *emu, uintptr_t fnc); -void vFpUUuu(x64emu_t *emu, uintptr_t fnc); -void vFpUUup(x64emu_t *emu, uintptr_t fnc); -void vFpUUUi(x64emu_t *emu, uintptr_t fnc); -void vFpUUUu(x64emu_t *emu, uintptr_t fnc); -void vFpUUUp(x64emu_t *emu, uintptr_t fnc); -void vFpfffi(x64emu_t *emu, uintptr_t fnc); -void vFpffff(x64emu_t *emu, uintptr_t fnc); -void vFpdiII(x64emu_t *emu, uintptr_t fnc); -void vFpddii(x64emu_t *emu, uintptr_t fnc); -void vFpdddd(x64emu_t *emu, uintptr_t fnc); -void vFpddpp(x64emu_t *emu, uintptr_t fnc); -void vFpluul(x64emu_t *emu, uintptr_t fnc); -void vFplppp(x64emu_t *emu, uintptr_t fnc); -void vFpLLLL(x64emu_t *emu, uintptr_t fnc); -void vFpLLpp(x64emu_t *emu, uintptr_t fnc); -void vFpLpiL(x64emu_t *emu, uintptr_t fnc); -void vFppiii(x64emu_t *emu, uintptr_t fnc); -void vFppiiu(x64emu_t *emu, uintptr_t fnc); -void vFppiip(x64emu_t *emu, uintptr_t fnc); -void vFppiui(x64emu_t *emu, uintptr_t fnc); -void vFppiup(x64emu_t *emu, uintptr_t fnc); -void vFppiff(x64emu_t *emu, uintptr_t fnc); -void vFppidd(x64emu_t *emu, uintptr_t fnc); -void vFppipi(x64emu_t *emu, uintptr_t fnc); -void vFppipp(x64emu_t *emu, uintptr_t fnc); -void vFppWui(x64emu_t *emu, uintptr_t fnc); -void vFppuii(x64emu_t *emu, uintptr_t fnc); -void vFppuui(x64emu_t *emu, uintptr_t fnc); -void vFppuuu(x64emu_t *emu, uintptr_t fnc); -void vFppuup(x64emu_t *emu, uintptr_t fnc); -void vFppudd(x64emu_t *emu, uintptr_t fnc); -void vFppupi(x64emu_t *emu, uintptr_t fnc); -void vFppupu(x64emu_t *emu, uintptr_t fnc); -void vFppupp(x64emu_t *emu, uintptr_t fnc); -void vFppfff(x64emu_t *emu, uintptr_t fnc); -void vFppddp(x64emu_t *emu, uintptr_t fnc); -void vFppLLL(x64emu_t *emu, uintptr_t fnc); -void vFppLpL(x64emu_t *emu, uintptr_t fnc); -void vFpppii(x64emu_t *emu, uintptr_t fnc); -void vFpppip(x64emu_t *emu, uintptr_t fnc); -void vFpppui(x64emu_t *emu, uintptr_t fnc); -void vFpppuu(x64emu_t *emu, uintptr_t fnc); -void vFpppup(x64emu_t *emu, uintptr_t fnc); -void vFpppff(x64emu_t *emu, uintptr_t fnc); -void vFpppdd(x64emu_t *emu, uintptr_t fnc); -void vFpppLp(x64emu_t *emu, uintptr_t fnc); -void vFppppi(x64emu_t *emu, uintptr_t fnc); -void vFppppu(x64emu_t *emu, uintptr_t fnc); -void vFppppL(x64emu_t *emu, uintptr_t fnc); -void vFppppp(x64emu_t *emu, uintptr_t fnc); -void iFEiipp(x64emu_t *emu, uintptr_t fnc); -void iFEiipV(x64emu_t *emu, uintptr_t fnc); -void iFEiipA(x64emu_t *emu, uintptr_t fnc); -void iFEipip(x64emu_t *emu, uintptr_t fnc); -void iFEippi(x64emu_t *emu, uintptr_t fnc); -void iFEippL(x64emu_t *emu, uintptr_t fnc); -void iFEippp(x64emu_t *emu, uintptr_t fnc); -void iFEpiii(x64emu_t *emu, uintptr_t fnc); -void iFEpipi(x64emu_t *emu, uintptr_t fnc); -void iFEpipp(x64emu_t *emu, uintptr_t fnc); -void iFEpipV(x64emu_t *emu, uintptr_t fnc); -void iFEpipA(x64emu_t *emu, uintptr_t fnc); -void iFEpUup(x64emu_t *emu, uintptr_t fnc); -void iFEpLpp(x64emu_t *emu, uintptr_t fnc); -void iFEpLpV(x64emu_t *emu, uintptr_t fnc); -void iFEpLpA(x64emu_t *emu, uintptr_t fnc); -void iFEppii(x64emu_t *emu, uintptr_t fnc); -void iFEppip(x64emu_t *emu, uintptr_t fnc); -void iFEppiV(x64emu_t *emu, uintptr_t fnc); -void iFEppiA(x64emu_t *emu, uintptr_t fnc); -void iFEpplp(x64emu_t *emu, uintptr_t fnc); -void iFEpppi(x64emu_t *emu, uintptr_t fnc); -void iFEpppL(x64emu_t *emu, uintptr_t fnc); -void iFEpppp(x64emu_t *emu, uintptr_t fnc); -void iFEpppV(x64emu_t *emu, uintptr_t fnc); -void iFEpppA(x64emu_t *emu, uintptr_t fnc); -void iFiiipu(x64emu_t *emu, uintptr_t fnc); -void iFiiipp(x64emu_t *emu, uintptr_t fnc); -void iFiiupp(x64emu_t *emu, uintptr_t fnc); -void iFiuuuu(x64emu_t *emu, uintptr_t fnc); -void iFiuuup(x64emu_t *emu, uintptr_t fnc); -void iFiuLip(x64emu_t *emu, uintptr_t fnc); -void iFillLL(x64emu_t *emu, uintptr_t fnc); -void iFipiii(x64emu_t *emu, uintptr_t fnc); -void iFipiup(x64emu_t *emu, uintptr_t fnc); -void iFipipi(x64emu_t *emu, uintptr_t fnc); -void iFipipu(x64emu_t *emu, uintptr_t fnc); -void iFipuip(x64emu_t *emu, uintptr_t fnc); -void iFipuui(x64emu_t *emu, uintptr_t fnc); -void iFipLup(x64emu_t *emu, uintptr_t fnc); -void iFippuu(x64emu_t *emu, uintptr_t fnc); -void iFippLi(x64emu_t *emu, uintptr_t fnc); -void iFippLp(x64emu_t *emu, uintptr_t fnc); -void iFipppi(x64emu_t *emu, uintptr_t fnc); -void iFipppp(x64emu_t *emu, uintptr_t fnc); -void iFuuupp(x64emu_t *emu, uintptr_t fnc); -void iFuppLp(x64emu_t *emu, uintptr_t fnc); -void iFLppip(x64emu_t *emu, uintptr_t fnc); -void iFLpppp(x64emu_t *emu, uintptr_t fnc); -void iFpwwww(x64emu_t *emu, uintptr_t fnc); -void iFpwppp(x64emu_t *emu, uintptr_t fnc); -void iFpiiii(x64emu_t *emu, uintptr_t fnc); -void iFpiiiu(x64emu_t *emu, uintptr_t fnc); -void iFpiiiL(x64emu_t *emu, uintptr_t fnc); -void iFpiiip(x64emu_t *emu, uintptr_t fnc); -void iFpiiui(x64emu_t *emu, uintptr_t fnc); -void iFpiiuu(x64emu_t *emu, uintptr_t fnc); -void iFpiipi(x64emu_t *emu, uintptr_t fnc); -void iFpiipp(x64emu_t *emu, uintptr_t fnc); -void iFpiIip(x64emu_t *emu, uintptr_t fnc); -void iFpiuwp(x64emu_t *emu, uintptr_t fnc); -void iFpiuuu(x64emu_t *emu, uintptr_t fnc); -void iFpiUUU(x64emu_t *emu, uintptr_t fnc); -void iFpipii(x64emu_t *emu, uintptr_t fnc); -void iFpipiu(x64emu_t *emu, uintptr_t fnc); -void iFpipiL(x64emu_t *emu, uintptr_t fnc); -void iFpipip(x64emu_t *emu, uintptr_t fnc); -void iFpippi(x64emu_t *emu, uintptr_t fnc); -void iFpippW(x64emu_t *emu, uintptr_t fnc); -void iFpippp(x64emu_t *emu, uintptr_t fnc); -void iFpCCCC(x64emu_t *emu, uintptr_t fnc); -void iFpCupp(x64emu_t *emu, uintptr_t fnc); -void iFpCpip(x64emu_t *emu, uintptr_t fnc); -void iFpuill(x64emu_t *emu, uintptr_t fnc); -void iFpuipi(x64emu_t *emu, uintptr_t fnc); -void iFpuipp(x64emu_t *emu, uintptr_t fnc); -void iFpuuip(x64emu_t *emu, uintptr_t fnc); -void iFpuuui(x64emu_t *emu, uintptr_t fnc); -void iFpuuup(x64emu_t *emu, uintptr_t fnc); -void iFpuuLL(x64emu_t *emu, uintptr_t fnc); -void iFpuupp(x64emu_t *emu, uintptr_t fnc); -void iFpulup(x64emu_t *emu, uintptr_t fnc); -void iFpulpp(x64emu_t *emu, uintptr_t fnc); -void iFpuLpL(x64emu_t *emu, uintptr_t fnc); -void iFpuLpp(x64emu_t *emu, uintptr_t fnc); -void iFpupui(x64emu_t *emu, uintptr_t fnc); -void iFpupuu(x64emu_t *emu, uintptr_t fnc); -void iFpupuU(x64emu_t *emu, uintptr_t fnc); -void iFpupup(x64emu_t *emu, uintptr_t fnc); -void iFpuppL(x64emu_t *emu, uintptr_t fnc); -void iFpuppp(x64emu_t *emu, uintptr_t fnc); -void iFpUiUi(x64emu_t *emu, uintptr_t fnc); -void iFpUupp(x64emu_t *emu, uintptr_t fnc); -void iFplupp(x64emu_t *emu, uintptr_t fnc); -void iFplluu(x64emu_t *emu, uintptr_t fnc); -void iFpLiup(x64emu_t *emu, uintptr_t fnc); -void iFpLilp(x64emu_t *emu, uintptr_t fnc); -void iFpLiLi(x64emu_t *emu, uintptr_t fnc); -void iFpLlpp(x64emu_t *emu, uintptr_t fnc); -void iFpLLii(x64emu_t *emu, uintptr_t fnc); -void iFpLLup(x64emu_t *emu, uintptr_t fnc); -void iFpLLpp(x64emu_t *emu, uintptr_t fnc); -void iFpLpii(x64emu_t *emu, uintptr_t fnc); -void iFpLpiL(x64emu_t *emu, uintptr_t fnc); -void iFpLpuL(x64emu_t *emu, uintptr_t fnc); -void iFpLpup(x64emu_t *emu, uintptr_t fnc); -void iFpLpLi(x64emu_t *emu, uintptr_t fnc); -void iFpLppi(x64emu_t *emu, uintptr_t fnc); -void iFpLppL(x64emu_t *emu, uintptr_t fnc); -void iFpLppp(x64emu_t *emu, uintptr_t fnc); -void iFppiiu(x64emu_t *emu, uintptr_t fnc); -void iFppiiL(x64emu_t *emu, uintptr_t fnc); -void iFppiip(x64emu_t *emu, uintptr_t fnc); -void iFppiuu(x64emu_t *emu, uintptr_t fnc); -void iFppiup(x64emu_t *emu, uintptr_t fnc); -void iFppiLi(x64emu_t *emu, uintptr_t fnc); -void iFppiLL(x64emu_t *emu, uintptr_t fnc); -void iFppipi(x64emu_t *emu, uintptr_t fnc); -void iFppipu(x64emu_t *emu, uintptr_t fnc); -void iFppipp(x64emu_t *emu, uintptr_t fnc); -void iFppuwp(x64emu_t *emu, uintptr_t fnc); -void iFppuip(x64emu_t *emu, uintptr_t fnc); -void iFppuuu(x64emu_t *emu, uintptr_t fnc); -void iFppuup(x64emu_t *emu, uintptr_t fnc); -void iFppupi(x64emu_t *emu, uintptr_t fnc); -void iFppupu(x64emu_t *emu, uintptr_t fnc); -void iFppupp(x64emu_t *emu, uintptr_t fnc); -void iFppUup(x64emu_t *emu, uintptr_t fnc); -void iFpplii(x64emu_t *emu, uintptr_t fnc); -void iFppllp(x64emu_t *emu, uintptr_t fnc); -void iFpplpp(x64emu_t *emu, uintptr_t fnc); -void iFppLup(x64emu_t *emu, uintptr_t fnc); -void iFppLpi(x64emu_t *emu, uintptr_t fnc); -void iFppLpL(x64emu_t *emu, uintptr_t fnc); -void iFppLpp(x64emu_t *emu, uintptr_t fnc); -void iFpppii(x64emu_t *emu, uintptr_t fnc); -void iFpppip(x64emu_t *emu, uintptr_t fnc); -void iFpppui(x64emu_t *emu, uintptr_t fnc); -void iFpppup(x64emu_t *emu, uintptr_t fnc); -void iFpppUi(x64emu_t *emu, uintptr_t fnc); -void iFpppLi(x64emu_t *emu, uintptr_t fnc); -void iFpppLL(x64emu_t *emu, uintptr_t fnc); -void iFpppLp(x64emu_t *emu, uintptr_t fnc); -void iFppppi(x64emu_t *emu, uintptr_t fnc); -void iFppppu(x64emu_t *emu, uintptr_t fnc); -void iFppppl(x64emu_t *emu, uintptr_t fnc); -void iFppppL(x64emu_t *emu, uintptr_t fnc); -void iFppppp(x64emu_t *emu, uintptr_t fnc); -void IFppIII(x64emu_t *emu, uintptr_t fnc); -void uFEippp(x64emu_t *emu, uintptr_t fnc); -void uFEpipp(x64emu_t *emu, uintptr_t fnc); -void uFEppuu(x64emu_t *emu, uintptr_t fnc); -void uFEpppp(x64emu_t *emu, uintptr_t fnc); -void uFEpppV(x64emu_t *emu, uintptr_t fnc); -void uFiuuuu(x64emu_t *emu, uintptr_t fnc); -void uFiuppi(x64emu_t *emu, uintptr_t fnc); -void uFipipp(x64emu_t *emu, uintptr_t fnc); -void uFipLpp(x64emu_t *emu, uintptr_t fnc); -void uFuiiii(x64emu_t *emu, uintptr_t fnc); -void uFLpppL(x64emu_t *emu, uintptr_t fnc); -void uFpCCCC(x64emu_t *emu, uintptr_t fnc); -void uFpWuip(x64emu_t *emu, uintptr_t fnc); -void uFpuuui(x64emu_t *emu, uintptr_t fnc); -void uFpuuuu(x64emu_t *emu, uintptr_t fnc); -void uFpuupp(x64emu_t *emu, uintptr_t fnc); -void uFpupuu(x64emu_t *emu, uintptr_t fnc); -void uFpuppp(x64emu_t *emu, uintptr_t fnc); -void uFppipp(x64emu_t *emu, uintptr_t fnc); -void uFppuup(x64emu_t *emu, uintptr_t fnc); -void uFppupp(x64emu_t *emu, uintptr_t fnc); -void uFpplip(x64emu_t *emu, uintptr_t fnc); -void uFppLpp(x64emu_t *emu, uintptr_t fnc); -void uFppppL(x64emu_t *emu, uintptr_t fnc); -void uFppppp(x64emu_t *emu, uintptr_t fnc); -void uFbCuuu(x64emu_t *emu, uintptr_t fnc); -void uFbCuup(x64emu_t *emu, uintptr_t fnc); -void uFbuuWW(x64emu_t *emu, uintptr_t fnc); -void uFbuuup(x64emu_t *emu, uintptr_t fnc); -void UFuiiii(x64emu_t *emu, uintptr_t fnc); -void lFEuipp(x64emu_t *emu, uintptr_t fnc); -void lFipili(x64emu_t *emu, uintptr_t fnc); -void lFipLli(x64emu_t *emu, uintptr_t fnc); -void lFipLlL(x64emu_t *emu, uintptr_t fnc); -void lFipLLi(x64emu_t *emu, uintptr_t fnc); -void lFipLpp(x64emu_t *emu, uintptr_t fnc); -void lFpuipC(x64emu_t *emu, uintptr_t fnc); -void lFpuuLL(x64emu_t *emu, uintptr_t fnc); -void lFppupp(x64emu_t *emu, uintptr_t fnc); -void lFppllp(x64emu_t *emu, uintptr_t fnc); -void lFppLpL(x64emu_t *emu, uintptr_t fnc); -void lFppLpp(x64emu_t *emu, uintptr_t fnc); -void LFELppi(x64emu_t *emu, uintptr_t fnc); -void LFEpppp(x64emu_t *emu, uintptr_t fnc); -void LFuiCiu(x64emu_t *emu, uintptr_t fnc); -void LFLpppL(x64emu_t *emu, uintptr_t fnc); -void LFpuipp(x64emu_t *emu, uintptr_t fnc); -void LFpuppi(x64emu_t *emu, uintptr_t fnc); -void LFpLuuu(x64emu_t *emu, uintptr_t fnc); -void LFpLLLp(x64emu_t *emu, uintptr_t fnc); -void LFpLpuu(x64emu_t *emu, uintptr_t fnc); -void LFpLppL(x64emu_t *emu, uintptr_t fnc); -void LFpLppp(x64emu_t *emu, uintptr_t fnc); -void LFppLLp(x64emu_t *emu, uintptr_t fnc); -void LFppLpL(x64emu_t *emu, uintptr_t fnc); -void LFpppii(x64emu_t *emu, uintptr_t fnc); -void LFppppp(x64emu_t *emu, uintptr_t fnc); -void pFEpiii(x64emu_t *emu, uintptr_t fnc); -void pFEpipL(x64emu_t *emu, uintptr_t fnc); -void pFEpipp(x64emu_t *emu, uintptr_t fnc); -void pFEpipV(x64emu_t *emu, uintptr_t fnc); -void pFEpipA(x64emu_t *emu, uintptr_t fnc); -void pFEpupp(x64emu_t *emu, uintptr_t fnc); -void pFEpUpp(x64emu_t *emu, uintptr_t fnc); -void pFEpLpp(x64emu_t *emu, uintptr_t fnc); -void pFEppii(x64emu_t *emu, uintptr_t fnc); -void pFEppip(x64emu_t *emu, uintptr_t fnc); -void pFEppLp(x64emu_t *emu, uintptr_t fnc); -void pFEpppi(x64emu_t *emu, uintptr_t fnc); -void pFEpppu(x64emu_t *emu, uintptr_t fnc); -void pFEpppp(x64emu_t *emu, uintptr_t fnc); -void pFEpppV(x64emu_t *emu, uintptr_t fnc); -void pFEpppA(x64emu_t *emu, uintptr_t fnc); -void pFiiiii(x64emu_t *emu, uintptr_t fnc); -void pFiiipL(x64emu_t *emu, uintptr_t fnc); -void pFipipL(x64emu_t *emu, uintptr_t fnc); -void pFipipp(x64emu_t *emu, uintptr_t fnc); -void pFuiiiu(x64emu_t *emu, uintptr_t fnc); -void pFuiupp(x64emu_t *emu, uintptr_t fnc); -void pFuuiip(x64emu_t *emu, uintptr_t fnc); -void pFuuupu(x64emu_t *emu, uintptr_t fnc); -void pFuupuu(x64emu_t *emu, uintptr_t fnc); -void pFudddp(x64emu_t *emu, uintptr_t fnc); -void pFupLpl(x64emu_t *emu, uintptr_t fnc); -void pFupLpL(x64emu_t *emu, uintptr_t fnc); -void pFddddi(x64emu_t *emu, uintptr_t fnc); -void pFLuppp(x64emu_t *emu, uintptr_t fnc); -void pFLpppi(x64emu_t *emu, uintptr_t fnc); -void pFpiiii(x64emu_t *emu, uintptr_t fnc); -void pFpiiip(x64emu_t *emu, uintptr_t fnc); -void pFpiiuu(x64emu_t *emu, uintptr_t fnc); -void pFpiipi(x64emu_t *emu, uintptr_t fnc); -void pFpiipL(x64emu_t *emu, uintptr_t fnc); -void pFpiipp(x64emu_t *emu, uintptr_t fnc); -void pFpiCCC(x64emu_t *emu, uintptr_t fnc); -void pFpiuuu(x64emu_t *emu, uintptr_t fnc); -void pFpiuup(x64emu_t *emu, uintptr_t fnc); -void pFpiupp(x64emu_t *emu, uintptr_t fnc); -void pFpiLip(x64emu_t *emu, uintptr_t fnc); -void pFpipip(x64emu_t *emu, uintptr_t fnc); -void pFpipup(x64emu_t *emu, uintptr_t fnc); -void pFpippi(x64emu_t *emu, uintptr_t fnc); -void pFpippp(x64emu_t *emu, uintptr_t fnc); -void pFpuiii(x64emu_t *emu, uintptr_t fnc); -void pFpuiip(x64emu_t *emu, uintptr_t fnc); -void pFpuuip(x64emu_t *emu, uintptr_t fnc); -void pFpuuuu(x64emu_t *emu, uintptr_t fnc); -void pFpuuup(x64emu_t *emu, uintptr_t fnc); -void pFpuupp(x64emu_t *emu, uintptr_t fnc); -void pFpuLpp(x64emu_t *emu, uintptr_t fnc); -void pFpuppu(x64emu_t *emu, uintptr_t fnc); -void pFpuppp(x64emu_t *emu, uintptr_t fnc); -void pFpUdii(x64emu_t *emu, uintptr_t fnc); -void pFpfffi(x64emu_t *emu, uintptr_t fnc); -void pFpdddd(x64emu_t *emu, uintptr_t fnc); -void pFplppp(x64emu_t *emu, uintptr_t fnc); -void pFpLiii(x64emu_t *emu, uintptr_t fnc); -void pFpLLip(x64emu_t *emu, uintptr_t fnc); -void pFpLLLp(x64emu_t *emu, uintptr_t fnc); -void pFpLpii(x64emu_t *emu, uintptr_t fnc); -void pFpLpip(x64emu_t *emu, uintptr_t fnc); -void pFpLpup(x64emu_t *emu, uintptr_t fnc); -void pFppiii(x64emu_t *emu, uintptr_t fnc); -void pFppiiu(x64emu_t *emu, uintptr_t fnc); -void pFppiip(x64emu_t *emu, uintptr_t fnc); -void pFppiup(x64emu_t *emu, uintptr_t fnc); -void pFppipi(x64emu_t *emu, uintptr_t fnc); -void pFppipp(x64emu_t *emu, uintptr_t fnc); -void pFppWpp(x64emu_t *emu, uintptr_t fnc); -void pFppuip(x64emu_t *emu, uintptr_t fnc); -void pFppuuu(x64emu_t *emu, uintptr_t fnc); -void pFppuup(x64emu_t *emu, uintptr_t fnc); -void pFppupp(x64emu_t *emu, uintptr_t fnc); -void pFppddu(x64emu_t *emu, uintptr_t fnc); -void pFppLii(x64emu_t *emu, uintptr_t fnc); -void pFppLLi(x64emu_t *emu, uintptr_t fnc); -void pFppLpp(x64emu_t *emu, uintptr_t fnc); -void pFpppii(x64emu_t *emu, uintptr_t fnc); -void pFpppip(x64emu_t *emu, uintptr_t fnc); -void pFpppui(x64emu_t *emu, uintptr_t fnc); -void pFpppup(x64emu_t *emu, uintptr_t fnc); -void pFpppli(x64emu_t *emu, uintptr_t fnc); -void pFpppLi(x64emu_t *emu, uintptr_t fnc); -void pFppppi(x64emu_t *emu, uintptr_t fnc); -void pFppppu(x64emu_t *emu, uintptr_t fnc); -void pFppppL(x64emu_t *emu, uintptr_t fnc); -void pFppppp(x64emu_t *emu, uintptr_t fnc); -void pFbuWWW(x64emu_t *emu, uintptr_t fnc); -void pFbuuWW(x64emu_t *emu, uintptr_t fnc); -void pFbuuup(x64emu_t *emu, uintptr_t fnc); -void pFbupii(x64emu_t *emu, uintptr_t fnc); -void pFbpuii(x64emu_t *emu, uintptr_t fnc); -void pFbpppp(x64emu_t *emu, uintptr_t fnc); -void iWEpiup(x64emu_t *emu, uintptr_t fnc); -void iWEpipp(x64emu_t *emu, uintptr_t fnc); -void iWpiiii(x64emu_t *emu, uintptr_t fnc); -void iWpiupu(x64emu_t *emu, uintptr_t fnc); -void iWpuiii(x64emu_t *emu, uintptr_t fnc); -void iWpuiup(x64emu_t *emu, uintptr_t fnc); -void iWpuupu(x64emu_t *emu, uintptr_t fnc); -void iWpuupp(x64emu_t *emu, uintptr_t fnc); -void iWpupuu(x64emu_t *emu, uintptr_t fnc); -void iWpupup(x64emu_t *emu, uintptr_t fnc); -void iWpuppu(x64emu_t *emu, uintptr_t fnc); -void iWpuppp(x64emu_t *emu, uintptr_t fnc); -void iWpppuu(x64emu_t *emu, uintptr_t fnc); -void iWpppup(x64emu_t *emu, uintptr_t fnc); -void iWppppp(x64emu_t *emu, uintptr_t fnc); -void vFEiiipp(x64emu_t *emu, uintptr_t fnc); -void vFEpiwpp(x64emu_t *emu, uintptr_t fnc); -void vFEpiLpp(x64emu_t *emu, uintptr_t fnc); -void vFEpippp(x64emu_t *emu, uintptr_t fnc); -void vFEpuipp(x64emu_t *emu, uintptr_t fnc); -void vFEpuipV(x64emu_t *emu, uintptr_t fnc); -void vFEpupup(x64emu_t *emu, uintptr_t fnc); -void vFEpuppp(x64emu_t *emu, uintptr_t fnc); -void vFEpLLpp(x64emu_t *emu, uintptr_t fnc); -void vFEppipV(x64emu_t *emu, uintptr_t fnc); -void vFEppipA(x64emu_t *emu, uintptr_t fnc); -void vFEppupp(x64emu_t *emu, uintptr_t fnc); -void vFEppppp(x64emu_t *emu, uintptr_t fnc); -void vFiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFiiiuil(x64emu_t *emu, uintptr_t fnc); -void vFiiilpi(x64emu_t *emu, uintptr_t fnc); -void vFiiuilp(x64emu_t *emu, uintptr_t fnc); -void vFiffiff(x64emu_t *emu, uintptr_t fnc); -void vFiddidd(x64emu_t *emu, uintptr_t fnc); -void vFilipli(x64emu_t *emu, uintptr_t fnc); -void vFiliplu(x64emu_t *emu, uintptr_t fnc); -void vFillill(x64emu_t *emu, uintptr_t fnc); -void vFipiplp(x64emu_t *emu, uintptr_t fnc); -void vFCCCCff(x64emu_t *emu, uintptr_t fnc); -void vFuiiiii(x64emu_t *emu, uintptr_t fnc); -void vFuiiiip(x64emu_t *emu, uintptr_t fnc); -void vFuiiuii(x64emu_t *emu, uintptr_t fnc); -void vFuiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuiuiii(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiC(x64emu_t *emu, uintptr_t fnc); -void vFuiuiil(x64emu_t *emu, uintptr_t fnc); -void vFuiuiip(x64emu_t *emu, uintptr_t fnc); -void vFuiuiuu(x64emu_t *emu, uintptr_t fnc); -void vFuiuiuL(x64emu_t *emu, uintptr_t fnc); -void vFuiuCip(x64emu_t *emu, uintptr_t fnc); -void vFuiuuip(x64emu_t *emu, uintptr_t fnc); -void vFuiuuuu(x64emu_t *emu, uintptr_t fnc); -void vFuiupii(x64emu_t *emu, uintptr_t fnc); -void vFuiupiu(x64emu_t *emu, uintptr_t fnc); -void vFuiffff(x64emu_t *emu, uintptr_t fnc); -void vFuidddd(x64emu_t *emu, uintptr_t fnc); -void vFuillll(x64emu_t *emu, uintptr_t fnc); -void vFuiLLLL(x64emu_t *emu, uintptr_t fnc); -void vFuipiup(x64emu_t *emu, uintptr_t fnc); -void vFuCuuip(x64emu_t *emu, uintptr_t fnc); -void vFuuiiii(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiu(x64emu_t *emu, uintptr_t fnc); -void vFuuiuii(x64emu_t *emu, uintptr_t fnc); -void vFuuiuil(x64emu_t *emu, uintptr_t fnc); -void vFuuiuip(x64emu_t *emu, uintptr_t fnc); -void vFuuiuCu(x64emu_t *emu, uintptr_t fnc); -void vFuuiuup(x64emu_t *emu, uintptr_t fnc); -void vFuuippp(x64emu_t *emu, uintptr_t fnc); -void vFuuuiii(x64emu_t *emu, uintptr_t fnc); -void vFuuuiup(x64emu_t *emu, uintptr_t fnc); -void vFuuuipi(x64emu_t *emu, uintptr_t fnc); -void vFuuuipC(x64emu_t *emu, uintptr_t fnc); -void vFuuuipp(x64emu_t *emu, uintptr_t fnc); -void vFuuuuii(x64emu_t *emu, uintptr_t fnc); -void vFuuuuip(x64emu_t *emu, uintptr_t fnc); -void vFuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFuuuull(x64emu_t *emu, uintptr_t fnc); -void vFuuuppi(x64emu_t *emu, uintptr_t fnc); -void vFuuuppp(x64emu_t *emu, uintptr_t fnc); -void vFuuffff(x64emu_t *emu, uintptr_t fnc); -void vFuudddd(x64emu_t *emu, uintptr_t fnc); -void vFuupiii(x64emu_t *emu, uintptr_t fnc); -void vFuupupp(x64emu_t *emu, uintptr_t fnc); -void vFuuplii(x64emu_t *emu, uintptr_t fnc); -void vFuffiip(x64emu_t *emu, uintptr_t fnc); -void vFufffff(x64emu_t *emu, uintptr_t fnc); -void vFuddiip(x64emu_t *emu, uintptr_t fnc); -void vFullill(x64emu_t *emu, uintptr_t fnc); -void vFulluLC(x64emu_t *emu, uintptr_t fnc); -void vFupiiii(x64emu_t *emu, uintptr_t fnc); -void vFupupip(x64emu_t *emu, uintptr_t fnc); -void vFuppppu(x64emu_t *emu, uintptr_t fnc); -void vFuppppp(x64emu_t *emu, uintptr_t fnc); -void vFUUpppp(x64emu_t *emu, uintptr_t fnc); -void vFffffff(x64emu_t *emu, uintptr_t fnc); -void vFdddddd(x64emu_t *emu, uintptr_t fnc); -void vFdddppp(x64emu_t *emu, uintptr_t fnc); -void vFpiiiii(x64emu_t *emu, uintptr_t fnc); -void vFpiiipp(x64emu_t *emu, uintptr_t fnc); -void vFpiiuuu(x64emu_t *emu, uintptr_t fnc); -void vFpiippi(x64emu_t *emu, uintptr_t fnc); -void vFpiippp(x64emu_t *emu, uintptr_t fnc); -void vFpiUuup(x64emu_t *emu, uintptr_t fnc); -void vFpipipp(x64emu_t *emu, uintptr_t fnc); -void vFpipipV(x64emu_t *emu, uintptr_t fnc); -void vFpipppi(x64emu_t *emu, uintptr_t fnc); -void vFpipppp(x64emu_t *emu, uintptr_t fnc); -void vFpuiiii(x64emu_t *emu, uintptr_t fnc); -void vFpuiiiu(x64emu_t *emu, uintptr_t fnc); -void vFpuiipp(x64emu_t *emu, uintptr_t fnc); -void vFpuuuiu(x64emu_t *emu, uintptr_t fnc); -void vFpuuuup(x64emu_t *emu, uintptr_t fnc); -void vFpuuupp(x64emu_t *emu, uintptr_t fnc); -void vFpuupuu(x64emu_t *emu, uintptr_t fnc); -void vFpuuppp(x64emu_t *emu, uintptr_t fnc); -void vFpudddd(x64emu_t *emu, uintptr_t fnc); -void vFpupiUu(x64emu_t *emu, uintptr_t fnc); -void vFpupuuu(x64emu_t *emu, uintptr_t fnc); -void vFpupupu(x64emu_t *emu, uintptr_t fnc); -void vFpuppuu(x64emu_t *emu, uintptr_t fnc); -void vFpupppp(x64emu_t *emu, uintptr_t fnc); -void vFpUiUup(x64emu_t *emu, uintptr_t fnc); -void vFpUipup(x64emu_t *emu, uintptr_t fnc); -void vFpUuuup(x64emu_t *emu, uintptr_t fnc); -void vFpUUiup(x64emu_t *emu, uintptr_t fnc); -void vFpdddii(x64emu_t *emu, uintptr_t fnc); -void vFpddddd(x64emu_t *emu, uintptr_t fnc); -void vFpddddp(x64emu_t *emu, uintptr_t fnc); -void vFppiiii(x64emu_t *emu, uintptr_t fnc); -void vFppiiip(x64emu_t *emu, uintptr_t fnc); -void vFppiiuu(x64emu_t *emu, uintptr_t fnc); -void vFppiipi(x64emu_t *emu, uintptr_t fnc); -void vFppiipp(x64emu_t *emu, uintptr_t fnc); -void vFppilpp(x64emu_t *emu, uintptr_t fnc); -void vFppipLp(x64emu_t *emu, uintptr_t fnc); -void vFppippi(x64emu_t *emu, uintptr_t fnc); -void vFppippp(x64emu_t *emu, uintptr_t fnc); -void vFppuiii(x64emu_t *emu, uintptr_t fnc); -void vFppuiiu(x64emu_t *emu, uintptr_t fnc); -void vFppuiip(x64emu_t *emu, uintptr_t fnc); -void vFppuuuu(x64emu_t *emu, uintptr_t fnc); -void vFppuUUU(x64emu_t *emu, uintptr_t fnc); -void vFppupii(x64emu_t *emu, uintptr_t fnc); -void vFppuppp(x64emu_t *emu, uintptr_t fnc); -void vFppffff(x64emu_t *emu, uintptr_t fnc); -void vFppdidd(x64emu_t *emu, uintptr_t fnc); -void vFppdddd(x64emu_t *emu, uintptr_t fnc); -void vFpplppi(x64emu_t *emu, uintptr_t fnc); -void vFpplppp(x64emu_t *emu, uintptr_t fnc); -void vFppLppi(x64emu_t *emu, uintptr_t fnc); -void vFppLppp(x64emu_t *emu, uintptr_t fnc); -void vFpppiii(x64emu_t *emu, uintptr_t fnc); -void vFpppiip(x64emu_t *emu, uintptr_t fnc); -void vFpppiui(x64emu_t *emu, uintptr_t fnc); -void vFpppiff(x64emu_t *emu, uintptr_t fnc); -void vFpppipu(x64emu_t *emu, uintptr_t fnc); -void vFpppuii(x64emu_t *emu, uintptr_t fnc); -void vFpppuuu(x64emu_t *emu, uintptr_t fnc); -void vFppppii(x64emu_t *emu, uintptr_t fnc); -void vFpppppi(x64emu_t *emu, uintptr_t fnc); -void vFpppppu(x64emu_t *emu, uintptr_t fnc); -void vFpppppU(x64emu_t *emu, uintptr_t fnc); -void vFpppppL(x64emu_t *emu, uintptr_t fnc); -void vFpppppp(x64emu_t *emu, uintptr_t fnc); -void cFppLppi(x64emu_t *emu, uintptr_t fnc); -void iFEiippi(x64emu_t *emu, uintptr_t fnc); -void iFEiippp(x64emu_t *emu, uintptr_t fnc); -void iFEiLLLL(x64emu_t *emu, uintptr_t fnc); -void iFEippLp(x64emu_t *emu, uintptr_t fnc); -void iFElpppp(x64emu_t *emu, uintptr_t fnc); -void iFEpiipp(x64emu_t *emu, uintptr_t fnc); -void iFEpiipV(x64emu_t *emu, uintptr_t fnc); -void iFEpilpV(x64emu_t *emu, uintptr_t fnc); -void iFEpippi(x64emu_t *emu, uintptr_t fnc); -void iFEpIppp(x64emu_t *emu, uintptr_t fnc); -void iFEpuppp(x64emu_t *emu, uintptr_t fnc); -void iFEpUppp(x64emu_t *emu, uintptr_t fnc); -void iFEppppi(x64emu_t *emu, uintptr_t fnc); -void iFEppppp(x64emu_t *emu, uintptr_t fnc); -void iFiiiiip(x64emu_t *emu, uintptr_t fnc); -void iFiiiipp(x64emu_t *emu, uintptr_t fnc); -void iFiiiuwp(x64emu_t *emu, uintptr_t fnc); -void iFiWiipi(x64emu_t *emu, uintptr_t fnc); -void iFiuUuUu(x64emu_t *emu, uintptr_t fnc); -void iFilpppp(x64emu_t *emu, uintptr_t fnc); -void iFiLpppi(x64emu_t *emu, uintptr_t fnc); -void iFipiipi(x64emu_t *emu, uintptr_t fnc); -void iFipipip(x64emu_t *emu, uintptr_t fnc); -void iFipippp(x64emu_t *emu, uintptr_t fnc); -void iFipuIup(x64emu_t *emu, uintptr_t fnc); -void iFipupup(x64emu_t *emu, uintptr_t fnc); -void iFipuppp(x64emu_t *emu, uintptr_t fnc); -void iFipppLp(x64emu_t *emu, uintptr_t fnc); -void iFippppp(x64emu_t *emu, uintptr_t fnc); -void iFdipppL(x64emu_t *emu, uintptr_t fnc); -void iFDipppL(x64emu_t *emu, uintptr_t fnc); -void iFlpippp(x64emu_t *emu, uintptr_t fnc); -void iFLpppii(x64emu_t *emu, uintptr_t fnc); -void iFpiiiii(x64emu_t *emu, uintptr_t fnc); -void iFpiiiiu(x64emu_t *emu, uintptr_t fnc); -void iFpiiiip(x64emu_t *emu, uintptr_t fnc); -void iFpiiipp(x64emu_t *emu, uintptr_t fnc); -void iFpiiuii(x64emu_t *emu, uintptr_t fnc); -void iFpiiuui(x64emu_t *emu, uintptr_t fnc); -void iFpiiupp(x64emu_t *emu, uintptr_t fnc); -void iFpiipip(x64emu_t *emu, uintptr_t fnc); -void iFpiippp(x64emu_t *emu, uintptr_t fnc); -void iFpiCCpu(x64emu_t *emu, uintptr_t fnc); -void iFpiuuup(x64emu_t *emu, uintptr_t fnc); -void iFpiuupp(x64emu_t *emu, uintptr_t fnc); -void iFpipiii(x64emu_t *emu, uintptr_t fnc); -void iFpipipi(x64emu_t *emu, uintptr_t fnc); -void iFpipipp(x64emu_t *emu, uintptr_t fnc); -void iFpipupp(x64emu_t *emu, uintptr_t fnc); -void iFpipLpp(x64emu_t *emu, uintptr_t fnc); -void iFpippip(x64emu_t *emu, uintptr_t fnc); -void iFpippup(x64emu_t *emu, uintptr_t fnc); -void iFpipppp(x64emu_t *emu, uintptr_t fnc); -void iFpCiipp(x64emu_t *emu, uintptr_t fnc); -void iFpCpipu(x64emu_t *emu, uintptr_t fnc); -void iFpWipip(x64emu_t *emu, uintptr_t fnc); -void iFpWpppp(x64emu_t *emu, uintptr_t fnc); -void iFpuiCpp(x64emu_t *emu, uintptr_t fnc); -void iFpuippp(x64emu_t *emu, uintptr_t fnc); -void iFpuuuuu(x64emu_t *emu, uintptr_t fnc); -void iFpuuuup(x64emu_t *emu, uintptr_t fnc); -void iFpuuupu(x64emu_t *emu, uintptr_t fnc); -void iFpuuupp(x64emu_t *emu, uintptr_t fnc); -void iFpuuLpp(x64emu_t *emu, uintptr_t fnc); -void iFpuupuu(x64emu_t *emu, uintptr_t fnc); -void iFpuuppp(x64emu_t *emu, uintptr_t fnc); -void iFpuLLpp(x64emu_t *emu, uintptr_t fnc); -void iFpupuui(x64emu_t *emu, uintptr_t fnc); -void iFpupLpL(x64emu_t *emu, uintptr_t fnc); -void iFpupLpp(x64emu_t *emu, uintptr_t fnc); -void iFpUiipp(x64emu_t *emu, uintptr_t fnc); -void iFpUuuLp(x64emu_t *emu, uintptr_t fnc); -void iFpUUUup(x64emu_t *emu, uintptr_t fnc); -void iFpUUUUp(x64emu_t *emu, uintptr_t fnc); -void iFpdpipp(x64emu_t *emu, uintptr_t fnc); -void iFpLiiiL(x64emu_t *emu, uintptr_t fnc); -void iFpLiiip(x64emu_t *emu, uintptr_t fnc); -void iFpLiiuu(x64emu_t *emu, uintptr_t fnc); -void iFpLipLu(x64emu_t *emu, uintptr_t fnc); -void iFpLuipp(x64emu_t *emu, uintptr_t fnc); -void iFpLuupp(x64emu_t *emu, uintptr_t fnc); -void iFpLupip(x64emu_t *emu, uintptr_t fnc); -void iFpLLLLL(x64emu_t *emu, uintptr_t fnc); -void iFpLLppp(x64emu_t *emu, uintptr_t fnc); -void iFpLpipi(x64emu_t *emu, uintptr_t fnc); -void iFpLppii(x64emu_t *emu, uintptr_t fnc); -void iFpLpppL(x64emu_t *emu, uintptr_t fnc); -void iFpLpppp(x64emu_t *emu, uintptr_t fnc); -void iFppiiii(x64emu_t *emu, uintptr_t fnc); -void iFppiiip(x64emu_t *emu, uintptr_t fnc); -void iFppiipi(x64emu_t *emu, uintptr_t fnc); -void iFppiipp(x64emu_t *emu, uintptr_t fnc); -void iFppiupp(x64emu_t *emu, uintptr_t fnc); -void iFppilpp(x64emu_t *emu, uintptr_t fnc); -void iFppipii(x64emu_t *emu, uintptr_t fnc); -void iFppipiL(x64emu_t *emu, uintptr_t fnc); -void iFppipip(x64emu_t *emu, uintptr_t fnc); -void iFppippi(x64emu_t *emu, uintptr_t fnc); -void iFppippu(x64emu_t *emu, uintptr_t fnc); -void iFppippp(x64emu_t *emu, uintptr_t fnc); -void iFppIppp(x64emu_t *emu, uintptr_t fnc); -void iFppuiii(x64emu_t *emu, uintptr_t fnc); -void iFppuIII(x64emu_t *emu, uintptr_t fnc); -void iFppuupp(x64emu_t *emu, uintptr_t fnc); -void iFppuLpp(x64emu_t *emu, uintptr_t fnc); -void iFppupip(x64emu_t *emu, uintptr_t fnc); -void iFppuppp(x64emu_t *emu, uintptr_t fnc); -void iFppdidd(x64emu_t *emu, uintptr_t fnc); -void iFpplupp(x64emu_t *emu, uintptr_t fnc); -void iFpplppi(x64emu_t *emu, uintptr_t fnc); -void iFppLupp(x64emu_t *emu, uintptr_t fnc); -void iFppLLiL(x64emu_t *emu, uintptr_t fnc); -void iFppLLup(x64emu_t *emu, uintptr_t fnc); -void iFppLLpp(x64emu_t *emu, uintptr_t fnc); -void iFppLpLp(x64emu_t *emu, uintptr_t fnc); -void iFppLppp(x64emu_t *emu, uintptr_t fnc); -void iFpppiuu(x64emu_t *emu, uintptr_t fnc); -void iFpppipi(x64emu_t *emu, uintptr_t fnc); -void iFpppipu(x64emu_t *emu, uintptr_t fnc); -void iFpppipp(x64emu_t *emu, uintptr_t fnc); -void iFpppuii(x64emu_t *emu, uintptr_t fnc); -void iFpppuup(x64emu_t *emu, uintptr_t fnc); -void iFpppupu(x64emu_t *emu, uintptr_t fnc); -void iFpppupp(x64emu_t *emu, uintptr_t fnc); -void iFpppLpp(x64emu_t *emu, uintptr_t fnc); -void iFppppii(x64emu_t *emu, uintptr_t fnc); -void iFppppiu(x64emu_t *emu, uintptr_t fnc); -void iFppppip(x64emu_t *emu, uintptr_t fnc); -void iFppppup(x64emu_t *emu, uintptr_t fnc); -void iFppppLp(x64emu_t *emu, uintptr_t fnc); -void iFpppppi(x64emu_t *emu, uintptr_t fnc); -void iFpppppL(x64emu_t *emu, uintptr_t fnc); -void iFpppppp(x64emu_t *emu, uintptr_t fnc); -void uFEiippp(x64emu_t *emu, uintptr_t fnc); -void uFEiuppp(x64emu_t *emu, uintptr_t fnc); -void uFEpippp(x64emu_t *emu, uintptr_t fnc); -void uFEpCppp(x64emu_t *emu, uintptr_t fnc); -void uFEpuppp(x64emu_t *emu, uintptr_t fnc); -void uFuuuuuu(x64emu_t *emu, uintptr_t fnc); -void uFupuufp(x64emu_t *emu, uintptr_t fnc); -void uFuppppp(x64emu_t *emu, uintptr_t fnc); -void uFpiuppu(x64emu_t *emu, uintptr_t fnc); -void uFpWuipp(x64emu_t *emu, uintptr_t fnc); -void uFpWuuCp(x64emu_t *emu, uintptr_t fnc); -void uFpuippp(x64emu_t *emu, uintptr_t fnc); -void uFpuuuup(x64emu_t *emu, uintptr_t fnc); -void uFpuuupp(x64emu_t *emu, uintptr_t fnc); -void uFpuuppp(x64emu_t *emu, uintptr_t fnc); -void uFpupupu(x64emu_t *emu, uintptr_t fnc); -void uFpupppp(x64emu_t *emu, uintptr_t fnc); -void uFppippp(x64emu_t *emu, uintptr_t fnc); -void uFppuuup(x64emu_t *emu, uintptr_t fnc); -void uFppuupu(x64emu_t *emu, uintptr_t fnc); -void uFppLppL(x64emu_t *emu, uintptr_t fnc); -void uFpppppi(x64emu_t *emu, uintptr_t fnc); -void uFpppppp(x64emu_t *emu, uintptr_t fnc); -void uFbippup(x64emu_t *emu, uintptr_t fnc); -void uFbCuuWW(x64emu_t *emu, uintptr_t fnc); -void uFbuuiup(x64emu_t *emu, uintptr_t fnc); -void UFbippup(x64emu_t *emu, uintptr_t fnc); -void lFEpippp(x64emu_t *emu, uintptr_t fnc); -void lFipipLu(x64emu_t *emu, uintptr_t fnc); -void lFipLipu(x64emu_t *emu, uintptr_t fnc); -void lFipLipp(x64emu_t *emu, uintptr_t fnc); -void lFipLpLL(x64emu_t *emu, uintptr_t fnc); -void lFpipill(x64emu_t *emu, uintptr_t fnc); -void lFpuuLLp(x64emu_t *emu, uintptr_t fnc); -void lFpplllp(x64emu_t *emu, uintptr_t fnc); -void lFppLipp(x64emu_t *emu, uintptr_t fnc); -void lFpppLpp(x64emu_t *emu, uintptr_t fnc); -void LFEupppp(x64emu_t *emu, uintptr_t fnc); -void LFELpppi(x64emu_t *emu, uintptr_t fnc); -void LFEpippp(x64emu_t *emu, uintptr_t fnc); -void LFEppppi(x64emu_t *emu, uintptr_t fnc); -void LFpipipi(x64emu_t *emu, uintptr_t fnc); -void LFpLippp(x64emu_t *emu, uintptr_t fnc); -void LFpLLLLL(x64emu_t *emu, uintptr_t fnc); -void LFppLLpL(x64emu_t *emu, uintptr_t fnc); -void LFppLpLL(x64emu_t *emu, uintptr_t fnc); -void LFSpLiip(x64emu_t *emu, uintptr_t fnc); -void pFEpiupp(x64emu_t *emu, uintptr_t fnc); -void pFEpippp(x64emu_t *emu, uintptr_t fnc); -void pFEpuipp(x64emu_t *emu, uintptr_t fnc); -void pFEpuupp(x64emu_t *emu, uintptr_t fnc); -void pFEpuppp(x64emu_t *emu, uintptr_t fnc); -void pFEpLLiN(x64emu_t *emu, uintptr_t fnc); -void pFEppupi(x64emu_t *emu, uintptr_t fnc); -void pFEppLLp(x64emu_t *emu, uintptr_t fnc); -void pFEpppLp(x64emu_t *emu, uintptr_t fnc); -void pFEppppi(x64emu_t *emu, uintptr_t fnc); -void pFEppppp(x64emu_t *emu, uintptr_t fnc); -void pFEppppV(x64emu_t *emu, uintptr_t fnc); -void pFEppApp(x64emu_t *emu, uintptr_t fnc); -void pFiiiiii(x64emu_t *emu, uintptr_t fnc); -void pFiiiiid(x64emu_t *emu, uintptr_t fnc); -void pFipippp(x64emu_t *emu, uintptr_t fnc); -void pFWCiWCi(x64emu_t *emu, uintptr_t fnc); -void pFuCCCCp(x64emu_t *emu, uintptr_t fnc); -void pFuuipip(x64emu_t *emu, uintptr_t fnc); -void pFuuuiip(x64emu_t *emu, uintptr_t fnc); -void pFuuuuii(x64emu_t *emu, uintptr_t fnc); -void pFuuuuuu(x64emu_t *emu, uintptr_t fnc); -void pFuuuuup(x64emu_t *emu, uintptr_t fnc); -void pFuuppuu(x64emu_t *emu, uintptr_t fnc); -void pFuppppp(x64emu_t *emu, uintptr_t fnc); -void pFdddddd(x64emu_t *emu, uintptr_t fnc); -void pFpiiiiu(x64emu_t *emu, uintptr_t fnc); -void pFpiiipp(x64emu_t *emu, uintptr_t fnc); -void pFpiiCCC(x64emu_t *emu, uintptr_t fnc); -void pFpiiuup(x64emu_t *emu, uintptr_t fnc); -void pFpiUUUU(x64emu_t *emu, uintptr_t fnc); -void pFpipipp(x64emu_t *emu, uintptr_t fnc); -void pFpippip(x64emu_t *emu, uintptr_t fnc); -void pFpipppp(x64emu_t *emu, uintptr_t fnc); -void pFpuiiip(x64emu_t *emu, uintptr_t fnc); -void pFpuuuuu(x64emu_t *emu, uintptr_t fnc); -void pFpuuupu(x64emu_t *emu, uintptr_t fnc); -void pFpupuui(x64emu_t *emu, uintptr_t fnc); -void pFpuppip(x64emu_t *emu, uintptr_t fnc); -void pFpupppp(x64emu_t *emu, uintptr_t fnc); -void pFplpppp(x64emu_t *emu, uintptr_t fnc); -void pFpLuLpp(x64emu_t *emu, uintptr_t fnc); -void pFpLpLLi(x64emu_t *emu, uintptr_t fnc); -void pFpLppii(x64emu_t *emu, uintptr_t fnc); -void pFpLppip(x64emu_t *emu, uintptr_t fnc); -void pFpLppup(x64emu_t *emu, uintptr_t fnc); -void pFppiiii(x64emu_t *emu, uintptr_t fnc); -void pFppiipp(x64emu_t *emu, uintptr_t fnc); -void pFppiCCC(x64emu_t *emu, uintptr_t fnc); -void pFppiupp(x64emu_t *emu, uintptr_t fnc); -void pFppilpp(x64emu_t *emu, uintptr_t fnc); -void pFppipip(x64emu_t *emu, uintptr_t fnc); -void pFppippi(x64emu_t *emu, uintptr_t fnc); -void pFppippp(x64emu_t *emu, uintptr_t fnc); -void pFppuupp(x64emu_t *emu, uintptr_t fnc); -void pFppuppp(x64emu_t *emu, uintptr_t fnc); -void pFpplplp(x64emu_t *emu, uintptr_t fnc); -void pFpplppp(x64emu_t *emu, uintptr_t fnc); -void pFpppupp(x64emu_t *emu, uintptr_t fnc); -void pFpppLii(x64emu_t *emu, uintptr_t fnc); -void pFpppLui(x64emu_t *emu, uintptr_t fnc); -void pFppppii(x64emu_t *emu, uintptr_t fnc); -void pFpppppi(x64emu_t *emu, uintptr_t fnc); -void pFpppppu(x64emu_t *emu, uintptr_t fnc); -void pFpppppp(x64emu_t *emu, uintptr_t fnc); -void pFSpiiii(x64emu_t *emu, uintptr_t fnc); -void pFbCuuCC(x64emu_t *emu, uintptr_t fnc); -void pFbCuuup(x64emu_t *emu, uintptr_t fnc); -void pFbuuwwu(x64emu_t *emu, uintptr_t fnc); -void pFbuuuuu(x64emu_t *emu, uintptr_t fnc); -void pFbuuUUU(x64emu_t *emu, uintptr_t fnc); -void pFbpupii(x64emu_t *emu, uintptr_t fnc); -void iWEpuuip(x64emu_t *emu, uintptr_t fnc); -void iWEppppp(x64emu_t *emu, uintptr_t fnc); -void iWpiiiip(x64emu_t *emu, uintptr_t fnc); -void iWpiiuii(x64emu_t *emu, uintptr_t fnc); -void iWpiuppu(x64emu_t *emu, uintptr_t fnc); -void iWpuiiii(x64emu_t *emu, uintptr_t fnc); -void iWpppppi(x64emu_t *emu, uintptr_t fnc); -void iWpppppu(x64emu_t *emu, uintptr_t fnc); -void vFEpiiipp(x64emu_t *emu, uintptr_t fnc); -void vFEpipppp(x64emu_t *emu, uintptr_t fnc); -void vFEpuipuV(x64emu_t *emu, uintptr_t fnc); -void vFEppippp(x64emu_t *emu, uintptr_t fnc); -void vFEpppppp(x64emu_t *emu, uintptr_t fnc); -void vFiiiiiip(x64emu_t *emu, uintptr_t fnc); -void vFiiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFiiuilil(x64emu_t *emu, uintptr_t fnc); -void vFiiffffp(x64emu_t *emu, uintptr_t fnc); -void vFiuulipi(x64emu_t *emu, uintptr_t fnc); -void vFiupuuup(x64emu_t *emu, uintptr_t fnc); -void vFilipliu(x64emu_t *emu, uintptr_t fnc); -void vFilulipi(x64emu_t *emu, uintptr_t fnc); -void vFCCCCfff(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiC(x64emu_t *emu, uintptr_t fnc); -void vFuiiiuip(x64emu_t *emu, uintptr_t fnc); -void vFuiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiii(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiiC(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiip(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiuL(x64emu_t *emu, uintptr_t fnc); -void vFuiuCiuu(x64emu_t *emu, uintptr_t fnc); -void vFuiupiiu(x64emu_t *emu, uintptr_t fnc); -void vFuiupuip(x64emu_t *emu, uintptr_t fnc); -void vFuipiiii(x64emu_t *emu, uintptr_t fnc); -void vFuipffff(x64emu_t *emu, uintptr_t fnc); -void vFuipdddd(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiii(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiC(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiu(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiip(x64emu_t *emu, uintptr_t fnc); -void vFuuiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuuiCiui(x64emu_t *emu, uintptr_t fnc); -void vFuuiCiuu(x64emu_t *emu, uintptr_t fnc); -void vFuuiuiii(x64emu_t *emu, uintptr_t fnc); -void vFuuiuiiC(x64emu_t *emu, uintptr_t fnc); -void vFuuipppp(x64emu_t *emu, uintptr_t fnc); -void vFuuuiiii(x64emu_t *emu, uintptr_t fnc); -void vFuuuiiCp(x64emu_t *emu, uintptr_t fnc); -void vFuuuiuii(x64emu_t *emu, uintptr_t fnc); -void vFuuuiuil(x64emu_t *emu, uintptr_t fnc); -void vFuuuiupi(x64emu_t *emu, uintptr_t fnc); -void vFuuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFuuuulll(x64emu_t *emu, uintptr_t fnc); -void vFuuuffff(x64emu_t *emu, uintptr_t fnc); -void vFuuudddd(x64emu_t *emu, uintptr_t fnc); -void vFuuffiip(x64emu_t *emu, uintptr_t fnc); -void vFuuddiip(x64emu_t *emu, uintptr_t fnc); -void vFuulluup(x64emu_t *emu, uintptr_t fnc); -void vFuupiiii(x64emu_t *emu, uintptr_t fnc); -void vFuuppppu(x64emu_t *emu, uintptr_t fnc); -void vFuuppppp(x64emu_t *emu, uintptr_t fnc); -void vFuffffff(x64emu_t *emu, uintptr_t fnc); -void vFudddddd(x64emu_t *emu, uintptr_t fnc); -void vFlipuiip(x64emu_t *emu, uintptr_t fnc); -void vFlliiiip(x64emu_t *emu, uintptr_t fnc); -void vFpiiiipp(x64emu_t *emu, uintptr_t fnc); -void vFpiiliip(x64emu_t *emu, uintptr_t fnc); -void vFpiiLiip(x64emu_t *emu, uintptr_t fnc); -void vFpiipCpp(x64emu_t *emu, uintptr_t fnc); -void vFpiipppp(x64emu_t *emu, uintptr_t fnc); -void vFpipipii(x64emu_t *emu, uintptr_t fnc); -void vFpippppu(x64emu_t *emu, uintptr_t fnc); -void vFpuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFpuuUUuu(x64emu_t *emu, uintptr_t fnc); -void vFpuupupu(x64emu_t *emu, uintptr_t fnc); -void vFpuupppp(x64emu_t *emu, uintptr_t fnc); -void vFpupuuup(x64emu_t *emu, uintptr_t fnc); -void vFpupppui(x64emu_t *emu, uintptr_t fnc); -void vFpUiUiup(x64emu_t *emu, uintptr_t fnc); -void vFpUuuUip(x64emu_t *emu, uintptr_t fnc); -void vFpUUUUuu(x64emu_t *emu, uintptr_t fnc); -void vFpddiidd(x64emu_t *emu, uintptr_t fnc); -void vFpdddddd(x64emu_t *emu, uintptr_t fnc); -void vFpLiLiLp(x64emu_t *emu, uintptr_t fnc); -void vFpLpiipi(x64emu_t *emu, uintptr_t fnc); -void vFppiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppiiiip(x64emu_t *emu, uintptr_t fnc); -void vFppiiipi(x64emu_t *emu, uintptr_t fnc); -void vFppiipii(x64emu_t *emu, uintptr_t fnc); -void vFppiipuu(x64emu_t *emu, uintptr_t fnc); -void vFppiippp(x64emu_t *emu, uintptr_t fnc); -void vFppilppi(x64emu_t *emu, uintptr_t fnc); -void vFppiLiLp(x64emu_t *emu, uintptr_t fnc); -void vFppipiip(x64emu_t *emu, uintptr_t fnc); -void vFppipipp(x64emu_t *emu, uintptr_t fnc); -void vFppipppp(x64emu_t *emu, uintptr_t fnc); -void vFppCuupp(x64emu_t *emu, uintptr_t fnc); -void vFppuiiip(x64emu_t *emu, uintptr_t fnc); -void vFppuupii(x64emu_t *emu, uintptr_t fnc); -void vFppUuupp(x64emu_t *emu, uintptr_t fnc); -void vFppddddu(x64emu_t *emu, uintptr_t fnc); -void vFppddpiu(x64emu_t *emu, uintptr_t fnc); -void vFpplpppi(x64emu_t *emu, uintptr_t fnc); -void vFppLpppi(x64emu_t *emu, uintptr_t fnc); -void vFppLpppp(x64emu_t *emu, uintptr_t fnc); -void vFpppiiii(x64emu_t *emu, uintptr_t fnc); -void vFpppiipi(x64emu_t *emu, uintptr_t fnc); -void vFpppiipp(x64emu_t *emu, uintptr_t fnc); -void vFpppiupi(x64emu_t *emu, uintptr_t fnc); -void vFpppippi(x64emu_t *emu, uintptr_t fnc); -void vFpppuuuu(x64emu_t *emu, uintptr_t fnc); -void vFpppffff(x64emu_t *emu, uintptr_t fnc); -void vFppppiip(x64emu_t *emu, uintptr_t fnc); -void vFppppiui(x64emu_t *emu, uintptr_t fnc); -void vFppppipi(x64emu_t *emu, uintptr_t fnc); -void vFpppppip(x64emu_t *emu, uintptr_t fnc); -void vFppppppu(x64emu_t *emu, uintptr_t fnc); -void vFppppppp(x64emu_t *emu, uintptr_t fnc); -void iFEpupppp(x64emu_t *emu, uintptr_t fnc); -void iFEpUuppp(x64emu_t *emu, uintptr_t fnc); -void iFEpLiLpp(x64emu_t *emu, uintptr_t fnc); -void iFEpLiLpV(x64emu_t *emu, uintptr_t fnc); -void iFEppuppp(x64emu_t *emu, uintptr_t fnc); -void iFEppLpIi(x64emu_t *emu, uintptr_t fnc); -void iFEpppiiu(x64emu_t *emu, uintptr_t fnc); -void iFEpppppL(x64emu_t *emu, uintptr_t fnc); -void iFEpppppp(x64emu_t *emu, uintptr_t fnc); -void iFiiiiiip(x64emu_t *emu, uintptr_t fnc); -void iFipupupi(x64emu_t *emu, uintptr_t fnc); -void iFippuIup(x64emu_t *emu, uintptr_t fnc); -void iFipppppp(x64emu_t *emu, uintptr_t fnc); -void iFpiiiiii(x64emu_t *emu, uintptr_t fnc); -void iFpiiiuwp(x64emu_t *emu, uintptr_t fnc); -void iFpiiiuup(x64emu_t *emu, uintptr_t fnc); -void iFpiiuuiu(x64emu_t *emu, uintptr_t fnc); -void iFpiipppp(x64emu_t *emu, uintptr_t fnc); -void iFpiuiipp(x64emu_t *emu, uintptr_t fnc); -void iFpiuLiii(x64emu_t *emu, uintptr_t fnc); -void iFpiupppp(x64emu_t *emu, uintptr_t fnc); -void iFpiLuupp(x64emu_t *emu, uintptr_t fnc); -void iFpiLuppp(x64emu_t *emu, uintptr_t fnc); -void iFpipiiip(x64emu_t *emu, uintptr_t fnc); -void iFpipipip(x64emu_t *emu, uintptr_t fnc); -void iFpipippp(x64emu_t *emu, uintptr_t fnc); -void iFpippLpp(x64emu_t *emu, uintptr_t fnc); -void iFpippppW(x64emu_t *emu, uintptr_t fnc); -void iFpippppp(x64emu_t *emu, uintptr_t fnc); -void iFpIIpppp(x64emu_t *emu, uintptr_t fnc); -void iFpWCiWCi(x64emu_t *emu, uintptr_t fnc); -void iFpWppppW(x64emu_t *emu, uintptr_t fnc); -void iFpWppppp(x64emu_t *emu, uintptr_t fnc); -void iFpuiCuCp(x64emu_t *emu, uintptr_t fnc); -void iFpuiuupp(x64emu_t *emu, uintptr_t fnc); -void iFpupiLpL(x64emu_t *emu, uintptr_t fnc); -void iFpupuuui(x64emu_t *emu, uintptr_t fnc); -void iFpupuupp(x64emu_t *emu, uintptr_t fnc); -void iFpupupui(x64emu_t *emu, uintptr_t fnc); -void iFpuppppp(x64emu_t *emu, uintptr_t fnc); -void iFpllpppp(x64emu_t *emu, uintptr_t fnc); -void iFpLiiiiL(x64emu_t *emu, uintptr_t fnc); -void iFpLiiuui(x64emu_t *emu, uintptr_t fnc); -void iFpLipipi(x64emu_t *emu, uintptr_t fnc); -void iFpLipupu(x64emu_t *emu, uintptr_t fnc); -void iFpLpiiii(x64emu_t *emu, uintptr_t fnc); -void iFpLpiiuu(x64emu_t *emu, uintptr_t fnc); -void iFpLpiipi(x64emu_t *emu, uintptr_t fnc); -void iFpLppiii(x64emu_t *emu, uintptr_t fnc); -void iFppiiiip(x64emu_t *emu, uintptr_t fnc); -void iFppiiuup(x64emu_t *emu, uintptr_t fnc); -void iFppiiLll(x64emu_t *emu, uintptr_t fnc); -void iFppiipii(x64emu_t *emu, uintptr_t fnc); -void iFppiipiL(x64emu_t *emu, uintptr_t fnc); -void iFppipiii(x64emu_t *emu, uintptr_t fnc); -void iFppipiip(x64emu_t *emu, uintptr_t fnc); -void iFppipipp(x64emu_t *emu, uintptr_t fnc); -void iFppippip(x64emu_t *emu, uintptr_t fnc); -void iFppipppi(x64emu_t *emu, uintptr_t fnc); -void iFppipppp(x64emu_t *emu, uintptr_t fnc); -void iFppuipiL(x64emu_t *emu, uintptr_t fnc); -void iFppuippp(x64emu_t *emu, uintptr_t fnc); -void iFppuuppp(x64emu_t *emu, uintptr_t fnc); -void iFppupupp(x64emu_t *emu, uintptr_t fnc); -void iFppliupp(x64emu_t *emu, uintptr_t fnc); -void iFppLiipp(x64emu_t *emu, uintptr_t fnc); -void iFppLippp(x64emu_t *emu, uintptr_t fnc); -void iFppLuuii(x64emu_t *emu, uintptr_t fnc); -void iFpppiiuu(x64emu_t *emu, uintptr_t fnc); -void iFpppiiup(x64emu_t *emu, uintptr_t fnc); -void iFpppiuwu(x64emu_t *emu, uintptr_t fnc); -void iFpppippi(x64emu_t *emu, uintptr_t fnc); -void iFpppippp(x64emu_t *emu, uintptr_t fnc); -void iFpppuiii(x64emu_t *emu, uintptr_t fnc); -void iFpppLppp(x64emu_t *emu, uintptr_t fnc); -void iFppppilp(x64emu_t *emu, uintptr_t fnc); -void iFppppipp(x64emu_t *emu, uintptr_t fnc); -void iFppppIip(x64emu_t *emu, uintptr_t fnc); -void iFppppdpu(x64emu_t *emu, uintptr_t fnc); -void iFpppppip(x64emu_t *emu, uintptr_t fnc); -void iFpppppLp(x64emu_t *emu, uintptr_t fnc); -void iFppppppu(x64emu_t *emu, uintptr_t fnc); -void iFppppppp(x64emu_t *emu, uintptr_t fnc); -void uFEiipppp(x64emu_t *emu, uintptr_t fnc); -void uFEpiippp(x64emu_t *emu, uintptr_t fnc); -void uFEpuuppp(x64emu_t *emu, uintptr_t fnc); -void uFEpppppp(x64emu_t *emu, uintptr_t fnc); -void uFiiiuuuu(x64emu_t *emu, uintptr_t fnc); -void uFuippppp(x64emu_t *emu, uintptr_t fnc); -void uFpippppp(x64emu_t *emu, uintptr_t fnc); -void uFpuuuupp(x64emu_t *emu, uintptr_t fnc); -void uFpuuuppp(x64emu_t *emu, uintptr_t fnc); -void uFpuupppp(x64emu_t *emu, uintptr_t fnc); -void uFppiuppi(x64emu_t *emu, uintptr_t fnc); -void uFppiuppp(x64emu_t *emu, uintptr_t fnc); -void uFppuuuup(x64emu_t *emu, uintptr_t fnc); -void uFppppppp(x64emu_t *emu, uintptr_t fnc); -void uFbCuuuuu(x64emu_t *emu, uintptr_t fnc); -void uFbuuuwwu(x64emu_t *emu, uintptr_t fnc); -void uFbuupwwC(x64emu_t *emu, uintptr_t fnc); -void LFEppLppU(x64emu_t *emu, uintptr_t fnc); -void LFEpppppu(x64emu_t *emu, uintptr_t fnc); -void LFpLLuupp(x64emu_t *emu, uintptr_t fnc); -void LFpLLppuu(x64emu_t *emu, uintptr_t fnc); -void pFEpupppp(x64emu_t *emu, uintptr_t fnc); -void pFEpLiiil(x64emu_t *emu, uintptr_t fnc); -void pFEppuipp(x64emu_t *emu, uintptr_t fnc); -void pFEppppip(x64emu_t *emu, uintptr_t fnc); -void pFEpppppi(x64emu_t *emu, uintptr_t fnc); -void pFifffppp(x64emu_t *emu, uintptr_t fnc); -void pFWpppppp(x64emu_t *emu, uintptr_t fnc); -void pFuuuiiip(x64emu_t *emu, uintptr_t fnc); -void pFuupupup(x64emu_t *emu, uintptr_t fnc); -void pFfiiiiid(x64emu_t *emu, uintptr_t fnc); -void pFdiiiIiI(x64emu_t *emu, uintptr_t fnc); -void pFpiiiiid(x64emu_t *emu, uintptr_t fnc); -void pFpiiippp(x64emu_t *emu, uintptr_t fnc); -void pFpiiUdii(x64emu_t *emu, uintptr_t fnc); -void pFpiipppp(x64emu_t *emu, uintptr_t fnc); -void pFpipippp(x64emu_t *emu, uintptr_t fnc); -void pFpWppWpp(x64emu_t *emu, uintptr_t fnc); -void pFpuLpipp(x64emu_t *emu, uintptr_t fnc); -void pFpupiipp(x64emu_t *emu, uintptr_t fnc); -void pFpuppipp(x64emu_t *emu, uintptr_t fnc); -void pFpuppppp(x64emu_t *emu, uintptr_t fnc); -void pFplppppp(x64emu_t *emu, uintptr_t fnc); -void pFpLLppup(x64emu_t *emu, uintptr_t fnc); -void pFpLpipip(x64emu_t *emu, uintptr_t fnc); -void pFpLpLLiL(x64emu_t *emu, uintptr_t fnc); -void pFpLppiip(x64emu_t *emu, uintptr_t fnc); -void pFpLppLLi(x64emu_t *emu, uintptr_t fnc); -void pFppiiipp(x64emu_t *emu, uintptr_t fnc); -void pFppiiCCC(x64emu_t *emu, uintptr_t fnc); -void pFppiippp(x64emu_t *emu, uintptr_t fnc); -void pFppipipp(x64emu_t *emu, uintptr_t fnc); -void pFppipLpp(x64emu_t *emu, uintptr_t fnc); -void pFppuippp(x64emu_t *emu, uintptr_t fnc); -void pFppuuupp(x64emu_t *emu, uintptr_t fnc); -void pFppuuppp(x64emu_t *emu, uintptr_t fnc); -void pFppuLLip(x64emu_t *emu, uintptr_t fnc); -void pFppupuuu(x64emu_t *emu, uintptr_t fnc); -void pFppliuip(x64emu_t *emu, uintptr_t fnc); -void pFpplipup(x64emu_t *emu, uintptr_t fnc); -void pFppLipip(x64emu_t *emu, uintptr_t fnc); -void pFppLLiLi(x64emu_t *emu, uintptr_t fnc); -void pFpppccci(x64emu_t *emu, uintptr_t fnc); -void pFpppiiii(x64emu_t *emu, uintptr_t fnc); -void pFpppCCCi(x64emu_t *emu, uintptr_t fnc); -void pFpppuipp(x64emu_t *emu, uintptr_t fnc); -void pFpppuuui(x64emu_t *emu, uintptr_t fnc); -void pFpppuupp(x64emu_t *emu, uintptr_t fnc); -void pFpppupii(x64emu_t *emu, uintptr_t fnc); -void pFpppupup(x64emu_t *emu, uintptr_t fnc); -void pFpppuppp(x64emu_t *emu, uintptr_t fnc); -void pFpppfffi(x64emu_t *emu, uintptr_t fnc); -void pFpppdddi(x64emu_t *emu, uintptr_t fnc); -void pFpppllli(x64emu_t *emu, uintptr_t fnc); -void pFpppLLLi(x64emu_t *emu, uintptr_t fnc); -void pFppppiii(x64emu_t *emu, uintptr_t fnc); -void pFppppuuu(x64emu_t *emu, uintptr_t fnc); -void pFpppppuu(x64emu_t *emu, uintptr_t fnc); -void pFppppppu(x64emu_t *emu, uintptr_t fnc); -void pFppppppp(x64emu_t *emu, uintptr_t fnc); -void pFbCuwwWW(x64emu_t *emu, uintptr_t fnc); -void pFbCuWCCC(x64emu_t *emu, uintptr_t fnc); -void pFbCuuwwp(x64emu_t *emu, uintptr_t fnc); -void pFbCpWWup(x64emu_t *emu, uintptr_t fnc); -void iWpiiuuuu(x64emu_t *emu, uintptr_t fnc); -void iWpuiiiip(x64emu_t *emu, uintptr_t fnc); -void iWpuiiuii(x64emu_t *emu, uintptr_t fnc); -void iWpuipupp(x64emu_t *emu, uintptr_t fnc); -void iWpuuuppu(x64emu_t *emu, uintptr_t fnc); -void iWpupuufu(x64emu_t *emu, uintptr_t fnc); -void iWpppuppp(x64emu_t *emu, uintptr_t fnc); -void vFEiippppV(x64emu_t *emu, uintptr_t fnc); -void vFEiupippp(x64emu_t *emu, uintptr_t fnc); -void vFEipAippp(x64emu_t *emu, uintptr_t fnc); -void vFEppipppp(x64emu_t *emu, uintptr_t fnc); -void vFEppLippp(x64emu_t *emu, uintptr_t fnc); -void vFEpppippp(x64emu_t *emu, uintptr_t fnc); -void vFEpppuipV(x64emu_t *emu, uintptr_t fnc); -void vFEpppppuu(x64emu_t *emu, uintptr_t fnc); -void vFiiiiuuip(x64emu_t *emu, uintptr_t fnc); -void vFiilliilp(x64emu_t *emu, uintptr_t fnc); -void vFiilluulp(x64emu_t *emu, uintptr_t fnc); -void vFiupuiuup(x64emu_t *emu, uintptr_t fnc); -void vFiupuuuup(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiiC(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuiiipiup(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiiii(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiiip(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiiuL(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiCuL(x64emu_t *emu, uintptr_t fnc); -void vFuiuiuuuu(x64emu_t *emu, uintptr_t fnc); -void vFuCCCCfff(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiiC(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiuip(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuuiiuupp(x64emu_t *emu, uintptr_t fnc); -void vFuuiuiiii(x64emu_t *emu, uintptr_t fnc); -void vFuuiuiiiC(x64emu_t *emu, uintptr_t fnc); -void vFuuiuiiip(x64emu_t *emu, uintptr_t fnc); -void vFuuuiiiiu(x64emu_t *emu, uintptr_t fnc); -void vFuuuiuCil(x64emu_t *emu, uintptr_t fnc); -void vFuuuipipp(x64emu_t *emu, uintptr_t fnc); -void vFuuuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFuuufffff(x64emu_t *emu, uintptr_t fnc); -void vFffffffff(x64emu_t *emu, uintptr_t fnc); -void vFpiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFpiiiiiip(x64emu_t *emu, uintptr_t fnc); -void vFpiiiipii(x64emu_t *emu, uintptr_t fnc); -void vFpiUuupup(x64emu_t *emu, uintptr_t fnc); -void vFpippiiuu(x64emu_t *emu, uintptr_t fnc); -void vFpippiipi(x64emu_t *emu, uintptr_t fnc); -void vFpuiULipp(x64emu_t *emu, uintptr_t fnc); -void vFpudddddd(x64emu_t *emu, uintptr_t fnc); -void vFpuppippp(x64emu_t *emu, uintptr_t fnc); -void vFpuppLLLL(x64emu_t *emu, uintptr_t fnc); -void vFpUiUiupi(x64emu_t *emu, uintptr_t fnc); -void vFpUuuUUUu(x64emu_t *emu, uintptr_t fnc); -void vFpLppiipi(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppiiipii(x64emu_t *emu, uintptr_t fnc); -void vFppipipiu(x64emu_t *emu, uintptr_t fnc); -void vFppipppui(x64emu_t *emu, uintptr_t fnc); -void vFppippppi(x64emu_t *emu, uintptr_t fnc); -void vFppippppp(x64emu_t *emu, uintptr_t fnc); -void vFppuuiiii(x64emu_t *emu, uintptr_t fnc); -void vFppuppiii(x64emu_t *emu, uintptr_t fnc); -void vFppuppiiu(x64emu_t *emu, uintptr_t fnc); -void vFpplppppi(x64emu_t *emu, uintptr_t fnc); -void vFpplppppp(x64emu_t *emu, uintptr_t fnc); -void vFppLpLpLp(x64emu_t *emu, uintptr_t fnc); -void vFpppipppu(x64emu_t *emu, uintptr_t fnc); -void vFpppuiiii(x64emu_t *emu, uintptr_t fnc); -void vFppppiipi(x64emu_t *emu, uintptr_t fnc); -void vFpppppuuu(x64emu_t *emu, uintptr_t fnc); -void vFpppppppp(x64emu_t *emu, uintptr_t fnc); -void iFEuipuupp(x64emu_t *emu, uintptr_t fnc); -void iFEpippppp(x64emu_t *emu, uintptr_t fnc); -void iFEpuuLppp(x64emu_t *emu, uintptr_t fnc); -void iFEpUUuppp(x64emu_t *emu, uintptr_t fnc); -void iFEppipppp(x64emu_t *emu, uintptr_t fnc); -void iFEppppipp(x64emu_t *emu, uintptr_t fnc); -void iFiiiiiiip(x64emu_t *emu, uintptr_t fnc); -void iFiiupiupi(x64emu_t *emu, uintptr_t fnc); -void iFiuuCCuup(x64emu_t *emu, uintptr_t fnc); -void iFiuuuupip(x64emu_t *emu, uintptr_t fnc); -void iFipippppp(x64emu_t *emu, uintptr_t fnc); -void iFuuuuuuuu(x64emu_t *emu, uintptr_t fnc); -void iFdiippppL(x64emu_t *emu, uintptr_t fnc); -void iFpiiiuuup(x64emu_t *emu, uintptr_t fnc); -void iFpipiipip(x64emu_t *emu, uintptr_t fnc); -void iFpippuuii(x64emu_t *emu, uintptr_t fnc); -void iFpippuupp(x64emu_t *emu, uintptr_t fnc); -void iFpCCWWpWu(x64emu_t *emu, uintptr_t fnc); -void iFpWCuWCuu(x64emu_t *emu, uintptr_t fnc); -void iFpuiipppp(x64emu_t *emu, uintptr_t fnc); -void iFpuippLpp(x64emu_t *emu, uintptr_t fnc); -void iFpuuiiiii(x64emu_t *emu, uintptr_t fnc); -void iFpuuipppp(x64emu_t *emu, uintptr_t fnc); -void iFpuuupupu(x64emu_t *emu, uintptr_t fnc); -void iFpuupuupp(x64emu_t *emu, uintptr_t fnc); -void iFpuuppiip(x64emu_t *emu, uintptr_t fnc); -void iFpuuppppp(x64emu_t *emu, uintptr_t fnc); -void iFpupppppp(x64emu_t *emu, uintptr_t fnc); -void iFpUuuLpUu(x64emu_t *emu, uintptr_t fnc); -void iFpduuulul(x64emu_t *emu, uintptr_t fnc); -void iFpLLiippp(x64emu_t *emu, uintptr_t fnc); -void iFpLLLiipi(x64emu_t *emu, uintptr_t fnc); -void iFpLLppppp(x64emu_t *emu, uintptr_t fnc); -void iFpLpipppp(x64emu_t *emu, uintptr_t fnc); -void iFpLppLpip(x64emu_t *emu, uintptr_t fnc); -void iFpLpppupu(x64emu_t *emu, uintptr_t fnc); -void iFpLpppppp(x64emu_t *emu, uintptr_t fnc); -void iFppiiipip(x64emu_t *emu, uintptr_t fnc); -void iFppillppp(x64emu_t *emu, uintptr_t fnc); -void iFppippppp(x64emu_t *emu, uintptr_t fnc); -void iFppIIIppp(x64emu_t *emu, uintptr_t fnc); -void iFppuiiuuu(x64emu_t *emu, uintptr_t fnc); -void iFppuuuuuu(x64emu_t *emu, uintptr_t fnc); -void iFppuppppp(x64emu_t *emu, uintptr_t fnc); -void iFpppiiipi(x64emu_t *emu, uintptr_t fnc); -void iFpppiiipp(x64emu_t *emu, uintptr_t fnc); -void iFpppipipi(x64emu_t *emu, uintptr_t fnc); -void iFppppiiup(x64emu_t *emu, uintptr_t fnc); -void iFppppippp(x64emu_t *emu, uintptr_t fnc); -void iFpppppupp(x64emu_t *emu, uintptr_t fnc); -void iFppppppii(x64emu_t *emu, uintptr_t fnc); -void iFpppppppi(x64emu_t *emu, uintptr_t fnc); -void iFpppppppp(x64emu_t *emu, uintptr_t fnc); -void iFbWWipppp(x64emu_t *emu, uintptr_t fnc); -void iFbupppWWu(x64emu_t *emu, uintptr_t fnc); -void CFuiifpppp(x64emu_t *emu, uintptr_t fnc); -void uFEipipppp(x64emu_t *emu, uintptr_t fnc); -void uFEpiupppp(x64emu_t *emu, uintptr_t fnc); -void uFEppipppp(x64emu_t *emu, uintptr_t fnc); -void uFEpppuppp(x64emu_t *emu, uintptr_t fnc); -void uFEppppppp(x64emu_t *emu, uintptr_t fnc); -void uFuipppppp(x64emu_t *emu, uintptr_t fnc); -void uFuupuuiuf(x64emu_t *emu, uintptr_t fnc); -void uFulpppppp(x64emu_t *emu, uintptr_t fnc); -void uFpuupupuu(x64emu_t *emu, uintptr_t fnc); -void uFpupuuuCp(x64emu_t *emu, uintptr_t fnc); -void uFppuuuupp(x64emu_t *emu, uintptr_t fnc); -void uFppuuuppu(x64emu_t *emu, uintptr_t fnc); -void uFppuppppp(x64emu_t *emu, uintptr_t fnc); -void uFpppppupp(x64emu_t *emu, uintptr_t fnc); -void uFbCuuuCup(x64emu_t *emu, uintptr_t fnc); -void uFbWWWWWWp(x64emu_t *emu, uintptr_t fnc); -void LFELpupupu(x64emu_t *emu, uintptr_t fnc); -void LFEpiupppp(x64emu_t *emu, uintptr_t fnc); -void LFpLpuuLLu(x64emu_t *emu, uintptr_t fnc); -void pFEiplllpp(x64emu_t *emu, uintptr_t fnc); -void pFEipLLLpp(x64emu_t *emu, uintptr_t fnc); -void pFEpiuCppp(x64emu_t *emu, uintptr_t fnc); -void pFEppLiiip(x64emu_t *emu, uintptr_t fnc); -void pFEpppuipV(x64emu_t *emu, uintptr_t fnc); -void pFEpppppiV(x64emu_t *emu, uintptr_t fnc); -void pFEppppppi(x64emu_t *emu, uintptr_t fnc); -void pFEppppppp(x64emu_t *emu, uintptr_t fnc); -void pFiippipip(x64emu_t *emu, uintptr_t fnc); -void pFiupppppp(x64emu_t *emu, uintptr_t fnc); -void pFuiiiuuuu(x64emu_t *emu, uintptr_t fnc); -void pFuCCCCpWw(x64emu_t *emu, uintptr_t fnc); -void pFuupupipp(x64emu_t *emu, uintptr_t fnc); -void pFpiiiiiuu(x64emu_t *emu, uintptr_t fnc); -void pFpiiuuupp(x64emu_t *emu, uintptr_t fnc); -void pFpiUdiiUi(x64emu_t *emu, uintptr_t fnc); -void pFpipiiiip(x64emu_t *emu, uintptr_t fnc); -void pFpuuuuupp(x64emu_t *emu, uintptr_t fnc); -void pFpuuuupup(x64emu_t *emu, uintptr_t fnc); -void pFpupLLLpp(x64emu_t *emu, uintptr_t fnc); -void pFpupppppp(x64emu_t *emu, uintptr_t fnc); -void pFplpppppp(x64emu_t *emu, uintptr_t fnc); -void pFpLuLpLip(x64emu_t *emu, uintptr_t fnc); -void pFpLpipLup(x64emu_t *emu, uintptr_t fnc); -void pFpLpLLiLi(x64emu_t *emu, uintptr_t fnc); -void pFpLppuLLp(x64emu_t *emu, uintptr_t fnc); -void pFpLppLLiL(x64emu_t *emu, uintptr_t fnc); -void pFppiiiiii(x64emu_t *emu, uintptr_t fnc); -void pFpppipipi(x64emu_t *emu, uintptr_t fnc); -void pFppplippp(x64emu_t *emu, uintptr_t fnc); -void pFppppuppp(x64emu_t *emu, uintptr_t fnc); -void pFpppppupp(x64emu_t *emu, uintptr_t fnc); -void pFbCCuuwwC(x64emu_t *emu, uintptr_t fnc); -void pFbCuwwWWu(x64emu_t *emu, uintptr_t fnc); -void pFbWWiCpup(x64emu_t *emu, uintptr_t fnc); -void pFbuuWWCuu(x64emu_t *emu, uintptr_t fnc); -void pFbuuupwwp(x64emu_t *emu, uintptr_t fnc); -void pFbdwwWWui(x64emu_t *emu, uintptr_t fnc); -void iWEpuuiipp(x64emu_t *emu, uintptr_t fnc); -void iWEpuuuipp(x64emu_t *emu, uintptr_t fnc); -void iWpuipuppp(x64emu_t *emu, uintptr_t fnc); -void vFEpiiiuipp(x64emu_t *emu, uintptr_t fnc); -void vFEpippippV(x64emu_t *emu, uintptr_t fnc); -void vFEpippippA(x64emu_t *emu, uintptr_t fnc); -void vFEpuuuippp(x64emu_t *emu, uintptr_t fnc); -void vFEppiipppp(x64emu_t *emu, uintptr_t fnc); -void vFEpppiippp(x64emu_t *emu, uintptr_t fnc); -void vFEppppippp(x64emu_t *emu, uintptr_t fnc); -void vFiiiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFiiiiiiill(x64emu_t *emu, uintptr_t fnc); -void vFiiiiillli(x64emu_t *emu, uintptr_t fnc); -void vFiiilllilp(x64emu_t *emu, uintptr_t fnc); -void vFiupuiuuup(x64emu_t *emu, uintptr_t fnc); -void vFiupuuuuup(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiiiC(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiuip(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiiiip(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiiCuL(x64emu_t *emu, uintptr_t fnc); -void vFuiupuffup(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiiiC(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuuiuiiiii(x64emu_t *emu, uintptr_t fnc); -void vFuuiuiiiip(x64emu_t *emu, uintptr_t fnc); -void vFuuuiiiiCp(x64emu_t *emu, uintptr_t fnc); -void vFuuuuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFuupuuiuuf(x64emu_t *emu, uintptr_t fnc); -void vFuffffffff(x64emu_t *emu, uintptr_t fnc); -void vFffCCCCfff(x64emu_t *emu, uintptr_t fnc); -void vFddddddddd(x64emu_t *emu, uintptr_t fnc); -void vFpiuippppi(x64emu_t *emu, uintptr_t fnc); -void vFpipiuiipp(x64emu_t *emu, uintptr_t fnc); -void vFpipppiipi(x64emu_t *emu, uintptr_t fnc); -void vFpuuuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFpLpppippp(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiipi(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiupi(x64emu_t *emu, uintptr_t fnc); -void vFppiiipiii(x64emu_t *emu, uintptr_t fnc); -void vFppiupiiii(x64emu_t *emu, uintptr_t fnc); -void vFppippDpDC(x64emu_t *emu, uintptr_t fnc); -void vFppipppiii(x64emu_t *emu, uintptr_t fnc); -void vFppipppiip(x64emu_t *emu, uintptr_t fnc); -void vFppuippiip(x64emu_t *emu, uintptr_t fnc); -void vFppuuiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppuuiiiiu(x64emu_t *emu, uintptr_t fnc); -void vFppuppiiii(x64emu_t *emu, uintptr_t fnc); -void vFppupppiii(x64emu_t *emu, uintptr_t fnc); -void vFppupppiiu(x64emu_t *emu, uintptr_t fnc); -void vFppupppiip(x64emu_t *emu, uintptr_t fnc); -void vFppUUuUUUU(x64emu_t *emu, uintptr_t fnc); -void vFppddddudd(x64emu_t *emu, uintptr_t fnc); -void vFpplpppppi(x64emu_t *emu, uintptr_t fnc); -void vFpppiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFpppffffff(x64emu_t *emu, uintptr_t fnc); -void vFppppipiip(x64emu_t *emu, uintptr_t fnc); -void vFpppppippp(x64emu_t *emu, uintptr_t fnc); -void iFEpiiiiipi(x64emu_t *emu, uintptr_t fnc); -void iFEppuppppp(x64emu_t *emu, uintptr_t fnc); -void iFEpppipppp(x64emu_t *emu, uintptr_t fnc); -void iFEppplPPPP(x64emu_t *emu, uintptr_t fnc); -void iFEpppppupp(x64emu_t *emu, uintptr_t fnc); -void iFEppPPPPPP(x64emu_t *emu, uintptr_t fnc); -void iFiiiiiiiip(x64emu_t *emu, uintptr_t fnc); -void iFiiiipiiip(x64emu_t *emu, uintptr_t fnc); -void iFipiipippi(x64emu_t *emu, uintptr_t fnc); -void iFdddpppppp(x64emu_t *emu, uintptr_t fnc); -void iFpipippppi(x64emu_t *emu, uintptr_t fnc); -void iFpipLpiiip(x64emu_t *emu, uintptr_t fnc); -void iFpuuuuuuuu(x64emu_t *emu, uintptr_t fnc); -void iFpuuuuduup(x64emu_t *emu, uintptr_t fnc); -void iFpuuuLiiip(x64emu_t *emu, uintptr_t fnc); -void iFpuuuLpppp(x64emu_t *emu, uintptr_t fnc); -void iFpduuuLuLp(x64emu_t *emu, uintptr_t fnc); -void iFpLiuiiLLL(x64emu_t *emu, uintptr_t fnc); -void iFpLLiiuuii(x64emu_t *emu, uintptr_t fnc); -void iFpLpiiuuii(x64emu_t *emu, uintptr_t fnc); -void iFpLpppupup(x64emu_t *emu, uintptr_t fnc); -void iFpLppppppp(x64emu_t *emu, uintptr_t fnc); -void iFppiiiiiii(x64emu_t *emu, uintptr_t fnc); -void iFppippippp(x64emu_t *emu, uintptr_t fnc); -void iFppuLLpupp(x64emu_t *emu, uintptr_t fnc); -void iFppuppuuuu(x64emu_t *emu, uintptr_t fnc); -void iFppupppupp(x64emu_t *emu, uintptr_t fnc); -void iFppLpiuppp(x64emu_t *emu, uintptr_t fnc); -void iFpppiiipip(x64emu_t *emu, uintptr_t fnc); -void iFpppiiuuii(x64emu_t *emu, uintptr_t fnc); -void iFpppiipiiu(x64emu_t *emu, uintptr_t fnc); -void iFpppippipi(x64emu_t *emu, uintptr_t fnc); -void iFpppLLLupp(x64emu_t *emu, uintptr_t fnc); -void iFpppLppupp(x64emu_t *emu, uintptr_t fnc); -void iFppppiiupp(x64emu_t *emu, uintptr_t fnc); -void iFpppppLupp(x64emu_t *emu, uintptr_t fnc); -void iFppppppupp(x64emu_t *emu, uintptr_t fnc); -void iFppppppppu(x64emu_t *emu, uintptr_t fnc); -void iFppppppppp(x64emu_t *emu, uintptr_t fnc); -void uFEipippppp(x64emu_t *emu, uintptr_t fnc); -void uFEpppufppp(x64emu_t *emu, uintptr_t fnc); -void uFuulpiuiuf(x64emu_t *emu, uintptr_t fnc); -void uFpuupuppuu(x64emu_t *emu, uintptr_t fnc); -void uFppLpLuppp(x64emu_t *emu, uintptr_t fnc); -void uFppppppppp(x64emu_t *emu, uintptr_t fnc); -void lFpppipiipp(x64emu_t *emu, uintptr_t fnc); -void lFpppippppp(x64emu_t *emu, uintptr_t fnc); -void LFEppppppii(x64emu_t *emu, uintptr_t fnc); -void LFpLiiuuuLL(x64emu_t *emu, uintptr_t fnc); -void pFEppiiuuLi(x64emu_t *emu, uintptr_t fnc); -void pFEppuippuu(x64emu_t *emu, uintptr_t fnc); -void pFEpppppiiV(x64emu_t *emu, uintptr_t fnc); -void pFEpppppppi(x64emu_t *emu, uintptr_t fnc); -void pFEpppppppp(x64emu_t *emu, uintptr_t fnc); -void pFuupuuuuuu(x64emu_t *emu, uintptr_t fnc); -void pFpiiiiuuuu(x64emu_t *emu, uintptr_t fnc); -void pFpLpLLipui(x64emu_t *emu, uintptr_t fnc); -void pFpLppLLiLi(x64emu_t *emu, uintptr_t fnc); -void pFppiiiiiip(x64emu_t *emu, uintptr_t fnc); -void pFppipppppp(x64emu_t *emu, uintptr_t fnc); -void pFpppiiiiii(x64emu_t *emu, uintptr_t fnc); -void pFpppuipppp(x64emu_t *emu, uintptr_t fnc); -void pFpppppiipp(x64emu_t *emu, uintptr_t fnc); -void pFbiiCpWWup(x64emu_t *emu, uintptr_t fnc); -void pFbCuWCCuuu(x64emu_t *emu, uintptr_t fnc); -void pFbuuwwWWww(x64emu_t *emu, uintptr_t fnc); -void pFbupuuuuup(x64emu_t *emu, uintptr_t fnc); -void pFbppppuuCC(x64emu_t *emu, uintptr_t fnc); -void iWEpuuiippu(x64emu_t *emu, uintptr_t fnc); -void iWEpuuuiipp(x64emu_t *emu, uintptr_t fnc); -void iWpiuuupipu(x64emu_t *emu, uintptr_t fnc); -void iWpuiuuipip(x64emu_t *emu, uintptr_t fnc); -void iWppppupiii(x64emu_t *emu, uintptr_t fnc); -void vFEiippppppp(x64emu_t *emu, uintptr_t fnc); -void vFEpippppppp(x64emu_t *emu, uintptr_t fnc); -void vFEpppiipppp(x64emu_t *emu, uintptr_t fnc); -void vFiiiiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFiiiiiiiiiu(x64emu_t *emu, uintptr_t fnc); -void vFiiiiiiiiui(x64emu_t *emu, uintptr_t fnc); -void vFiiiiiiiiuu(x64emu_t *emu, uintptr_t fnc); -void vFiiillliiip(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiiiip(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiiuip(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuuiuiiiiip(x64emu_t *emu, uintptr_t fnc); -void vFuuuuuuuCCC(x64emu_t *emu, uintptr_t fnc); -void vFuuuuuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFuupuiupuuf(x64emu_t *emu, uintptr_t fnc); -void vFuffiiffiip(x64emu_t *emu, uintptr_t fnc); -void vFuddiiddiip(x64emu_t *emu, uintptr_t fnc); -void vFffffffffff(x64emu_t *emu, uintptr_t fnc); -void vFpiuippppip(x64emu_t *emu, uintptr_t fnc); -void vFpuupuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiipip(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiupip(x64emu_t *emu, uintptr_t fnc); -void vFppiippppii(x64emu_t *emu, uintptr_t fnc); -void vFppuipppiip(x64emu_t *emu, uintptr_t fnc); -void vFppuuuiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppuuuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFppuuppiiii(x64emu_t *emu, uintptr_t fnc); -void vFppuuppppii(x64emu_t *emu, uintptr_t fnc); -void vFppuppuiiii(x64emu_t *emu, uintptr_t fnc); -void vFppupppiiii(x64emu_t *emu, uintptr_t fnc); -void vFppdddddddd(x64emu_t *emu, uintptr_t fnc); -void vFppppppppii(x64emu_t *emu, uintptr_t fnc); -void vFpppppppppp(x64emu_t *emu, uintptr_t fnc); -void iFEpiiiiippp(x64emu_t *emu, uintptr_t fnc); -void iFEpupppLppL(x64emu_t *emu, uintptr_t fnc); -void iFEppppppipp(x64emu_t *emu, uintptr_t fnc); -void iFiiiiiiiiip(x64emu_t *emu, uintptr_t fnc); -void iFpiipiiipip(x64emu_t *emu, uintptr_t fnc); -void iFpippddiidd(x64emu_t *emu, uintptr_t fnc); -void iFpCuWCCCCup(x64emu_t *emu, uintptr_t fnc); -void iFpuuLiuiiLL(x64emu_t *emu, uintptr_t fnc); -void iFpLLpiiuuii(x64emu_t *emu, uintptr_t fnc); -void iFpLpLUUUUpL(x64emu_t *emu, uintptr_t fnc); -void iFppuuiiiiii(x64emu_t *emu, uintptr_t fnc); -void iFppuuiiuupi(x64emu_t *emu, uintptr_t fnc); -void iFpppiiipipi(x64emu_t *emu, uintptr_t fnc); -void iFpppLLipppp(x64emu_t *emu, uintptr_t fnc); -void iFpppppiiuup(x64emu_t *emu, uintptr_t fnc); -void iFpppppppipi(x64emu_t *emu, uintptr_t fnc); -void iFpppppppppu(x64emu_t *emu, uintptr_t fnc); -void uFpddpippppp(x64emu_t *emu, uintptr_t fnc); -void uFpppppppppp(x64emu_t *emu, uintptr_t fnc); -void lFpLppdddddd(x64emu_t *emu, uintptr_t fnc); -void pFEiippppppp(x64emu_t *emu, uintptr_t fnc); -void pFEpiiiiiipp(x64emu_t *emu, uintptr_t fnc); -void pFEpippppppp(x64emu_t *emu, uintptr_t fnc); -void pFpupLLLLLpp(x64emu_t *emu, uintptr_t fnc); -void pFplllllllll(x64emu_t *emu, uintptr_t fnc); -void pFppippLLLip(x64emu_t *emu, uintptr_t fnc); -void pFppuiipuuii(x64emu_t *emu, uintptr_t fnc); -void pFppuuLLuppp(x64emu_t *emu, uintptr_t fnc); -void pFpppiiiiiii(x64emu_t *emu, uintptr_t fnc); -void pFpppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFbCuWCCuuCW(x64emu_t *emu, uintptr_t fnc); -void pFbuwwWWuCuu(x64emu_t *emu, uintptr_t fnc); -void pFbuuuwwwwWW(x64emu_t *emu, uintptr_t fnc); -void pFbuuuWWWCCi(x64emu_t *emu, uintptr_t fnc); -void iWEpuipupppp(x64emu_t *emu, uintptr_t fnc); -void iWEpuuiiuipp(x64emu_t *emu, uintptr_t fnc); -void iWEpuuuuiipp(x64emu_t *emu, uintptr_t fnc); -void vFEpuuuupupup(x64emu_t *emu, uintptr_t fnc); -void vFiiiiillliip(x64emu_t *emu, uintptr_t fnc); -void vFiiiiilllilp(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiiiiip(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiiiuip(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuiiiillliip(x64emu_t *emu, uintptr_t fnc); -void vFuiuiiiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuuupupppppp(x64emu_t *emu, uintptr_t fnc); -void vFuuffiiffiip(x64emu_t *emu, uintptr_t fnc); -void vFuufffffffff(x64emu_t *emu, uintptr_t fnc); -void vFuuddiiddiip(x64emu_t *emu, uintptr_t fnc); -void vFuffffffffff(x64emu_t *emu, uintptr_t fnc); -void vFuLuuuuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFLufffffffff(x64emu_t *emu, uintptr_t fnc); -void vFpipipiipiii(x64emu_t *emu, uintptr_t fnc); -void vFpipppiiiipi(x64emu_t *emu, uintptr_t fnc); -void vFpupuuupupup(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiipiii(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiupiii(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiddddi(x64emu_t *emu, uintptr_t fnc); -void vFppiipppiiii(x64emu_t *emu, uintptr_t fnc); -void vFppuuiiiiuii(x64emu_t *emu, uintptr_t fnc); -void vFppuuppiiiiu(x64emu_t *emu, uintptr_t fnc); -void vFppuupppiiii(x64emu_t *emu, uintptr_t fnc); -void vFppupipiuuuu(x64emu_t *emu, uintptr_t fnc); -void vFppupppuiiii(x64emu_t *emu, uintptr_t fnc); -void vFppppppppppp(x64emu_t *emu, uintptr_t fnc); -void iFEiipppppppp(x64emu_t *emu, uintptr_t fnc); -void iFEpppipppppp(x64emu_t *emu, uintptr_t fnc); -void iFEppppiiiiuu(x64emu_t *emu, uintptr_t fnc); -void iFEpppppppppp(x64emu_t *emu, uintptr_t fnc); -void iFiiiiiiiiiip(x64emu_t *emu, uintptr_t fnc); -void iFpiippiiipip(x64emu_t *emu, uintptr_t fnc); -void iFpippupppppp(x64emu_t *emu, uintptr_t fnc); -void iFpuppppppppp(x64emu_t *emu, uintptr_t fnc); -void iFpLipiiiippp(x64emu_t *emu, uintptr_t fnc); -void iFpLLpiiuuiiL(x64emu_t *emu, uintptr_t fnc); -void iFppippipppip(x64emu_t *emu, uintptr_t fnc); -void iFppuppLLpupp(x64emu_t *emu, uintptr_t fnc); -void iFpppiiuuiiuu(x64emu_t *emu, uintptr_t fnc); -void iFpppppiiuupp(x64emu_t *emu, uintptr_t fnc); -void uFEpLiupppLuV(x64emu_t *emu, uintptr_t fnc); -void uFEpLippppLup(x64emu_t *emu, uintptr_t fnc); -void uFEpLippppLuA(x64emu_t *emu, uintptr_t fnc); -void uFEppppppippp(x64emu_t *emu, uintptr_t fnc); -void uFppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFEpipppppppi(x64emu_t *emu, uintptr_t fnc); -void pFEppiiLpppip(x64emu_t *emu, uintptr_t fnc); -void pFEppuiipuuii(x64emu_t *emu, uintptr_t fnc); -void pFpppppppuipp(x64emu_t *emu, uintptr_t fnc); -void pFppppppppppp(x64emu_t *emu, uintptr_t fnc); -void iWEpuipuppppp(x64emu_t *emu, uintptr_t fnc); -void iWEpuuiiuippu(x64emu_t *emu, uintptr_t fnc); -void iWEpuuuuuiipp(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiiiiuLC(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiiiuuip(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiiiiiui(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiiiiiuu(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiiiiuip(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuuuuuuuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFffffffffffff(x64emu_t *emu, uintptr_t fnc); -void vFpipppiiiipii(x64emu_t *emu, uintptr_t fnc); -void vFpippppiiiipi(x64emu_t *emu, uintptr_t fnc); -void vFpupppppppppp(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiddddii(x64emu_t *emu, uintptr_t fnc); -void vFppiiuuuiupup(x64emu_t *emu, uintptr_t fnc); -void vFppiipppiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppuuppuiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppuupppiiiiu(x64emu_t *emu, uintptr_t fnc); -void vFpppiiiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFpppiiiiiiuii(x64emu_t *emu, uintptr_t fnc); -void vFpppppppppppp(x64emu_t *emu, uintptr_t fnc); -void iFEpppippppppp(x64emu_t *emu, uintptr_t fnc); -void iFEppppiiiiuui(x64emu_t *emu, uintptr_t fnc); -void iFpipllipppppp(x64emu_t *emu, uintptr_t fnc); -void iFpipppppppppp(x64emu_t *emu, uintptr_t fnc); -void iFpCCCWCWCCCWp(x64emu_t *emu, uintptr_t fnc); -void iFpLLlliLppppp(x64emu_t *emu, uintptr_t fnc); -void iFpppllipppppp(x64emu_t *emu, uintptr_t fnc); -void iFpppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFEppiiuuuipii(x64emu_t *emu, uintptr_t fnc); -void pFEppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFWWiCCCCiipup(x64emu_t *emu, uintptr_t fnc); -void pFppiiuuuiupLp(x64emu_t *emu, uintptr_t fnc); -void pFppippLLLiLpp(x64emu_t *emu, uintptr_t fnc); -void pFppuuppppuppp(x64emu_t *emu, uintptr_t fnc); -void pFpppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFbCuuWWwwCCup(x64emu_t *emu, uintptr_t fnc); -void pFbuuuWWWWWWWW(x64emu_t *emu, uintptr_t fnc); -void vFEpppppppiippp(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiiiiiuup(x64emu_t *emu, uintptr_t fnc); -void vFuuuuuuuuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFuffffffffffff(x64emu_t *emu, uintptr_t fnc); -void vFuLuuuuuuuuuuu(x64emu_t *emu, uintptr_t fnc); -void vFpipppiiiiiiuu(x64emu_t *emu, uintptr_t fnc); -void vFpippppppppppp(x64emu_t *emu, uintptr_t fnc); -void vFpuppppppppppp(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiiiuiuii(x64emu_t *emu, uintptr_t fnc); -void vFppuuppiiiiuii(x64emu_t *emu, uintptr_t fnc); -void vFppuupppuiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void iFddddpppddpppp(x64emu_t *emu, uintptr_t fnc); -void iFpippuuuiipppp(x64emu_t *emu, uintptr_t fnc); -void iFpupiiiipppppp(x64emu_t *emu, uintptr_t fnc); -void iFppppppLLLLupp(x64emu_t *emu, uintptr_t fnc); -void uFippuuuulllipp(x64emu_t *emu, uintptr_t fnc); -void uFpppppuupppppp(x64emu_t *emu, uintptr_t fnc); -void uFbCuuwwWWWWuup(x64emu_t *emu, uintptr_t fnc); -void pFpuupppwwwwWWC(x64emu_t *emu, uintptr_t fnc); -void pFppLppppiiLpip(x64emu_t *emu, uintptr_t fnc); -void pFpppppppuipppp(x64emu_t *emu, uintptr_t fnc); -void pFppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void vFippppppppppppp(x64emu_t *emu, uintptr_t fnc); -void vFuffiiffiiffiip(x64emu_t *emu, uintptr_t fnc); -void vFuddiiddiiddiip(x64emu_t *emu, uintptr_t fnc); -void vFppiipppiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppuupppiiiiuii(x64emu_t *emu, uintptr_t fnc); -void iFpipppppppppppp(x64emu_t *emu, uintptr_t fnc); -void iFppupppLLLLpupp(x64emu_t *emu, uintptr_t fnc); -void iFpppwwWWwwWWpuu(x64emu_t *emu, uintptr_t fnc); -void pFbpCpppwwwwwwWW(x64emu_t *emu, uintptr_t fnc); -void vFuiiiiiuiiiiilll(x64emu_t *emu, uintptr_t fnc); -void vFuuiiiiuuiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFfffffffffffffff(x64emu_t *emu, uintptr_t fnc); -void vFpUUUUUUUUUUUuuu(x64emu_t *emu, uintptr_t fnc); -void vFpppippppppppppp(x64emu_t *emu, uintptr_t fnc); -void vFppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFpuiippppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFppipppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void vFpppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void iFpppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFppipipipipipipip(x64emu_t *emu, uintptr_t fnc); -void pFpppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFbuuWWWWWWwwCCCuu(x64emu_t *emu, uintptr_t fnc); -void vFuuuiiiiiuiiiiilll(x64emu_t *emu, uintptr_t fnc); -void vFuuuuiiiiuuiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFppiiiiddddiiiiiuu(x64emu_t *emu, uintptr_t fnc); -void vFpppuppiipppuUUUpi(x64emu_t *emu, uintptr_t fnc); -void pFppippipipipipipip(x64emu_t *emu, uintptr_t fnc); -void pFbuuuuuwwuuuuUUUup(x64emu_t *emu, uintptr_t fnc); -void vFppuiiiiipuiiiiiiii(x64emu_t *emu, uintptr_t fnc); -void vFpppipppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void iFpppppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void LFpppppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFippppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFpupppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void vFpiiiiiiiiiiiiiiiiii(x64emu_t *emu, uintptr_t fnc); -void uFbWWWCCCCCCCCWCCCCCC(x64emu_t *emu, uintptr_t fnc); -void pFiiiippppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFpippppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFpupupppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void iFpppppppppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void uFippuuuuiiiiuuiiiiiiiipp(x64emu_t *emu, uintptr_t fnc); -void vFpppppppppppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void pFpupuupppppppppppppppppppp(x64emu_t *emu, uintptr_t fnc); -void iFpppppppppppppppppppppppppppppppppp(x64emu_t *emu, uintptr_t fnc); - -#if defined(HAVE_LD80BITS) -void DFD(x64emu_t *emu, uintptr_t fnc); -void DFY(x64emu_t *emu, uintptr_t fnc); -void lFD(x64emu_t *emu, uintptr_t fnc); -void YFY(x64emu_t *emu, uintptr_t fnc); -void IFED(x64emu_t *emu, uintptr_t fnc); -void DFiD(x64emu_t *emu, uintptr_t fnc); -void lFDD(x64emu_t *emu, uintptr_t fnc); -void YFYY(x64emu_t *emu, uintptr_t fnc); -void vFDpp(x64emu_t *emu, uintptr_t fnc); -void DFDDD(x64emu_t *emu, uintptr_t fnc); -#endif - -#if !defined(HAVE_LD80BITS) -void KFK(x64emu_t *emu, uintptr_t fnc); -void KFy(x64emu_t *emu, uintptr_t fnc); -void lFK(x64emu_t *emu, uintptr_t fnc); -void yFy(x64emu_t *emu, uintptr_t fnc); -void IFEK(x64emu_t *emu, uintptr_t fnc); -void KFiK(x64emu_t *emu, uintptr_t fnc); -void KFKK(x64emu_t *emu, uintptr_t fnc); -void KFKp(x64emu_t *emu, uintptr_t fnc); -void lFKK(x64emu_t *emu, uintptr_t fnc); -void yFyy(x64emu_t *emu, uintptr_t fnc); -void vFKpp(x64emu_t *emu, uintptr_t fnc); -void KFKKK(x64emu_t *emu, uintptr_t fnc); -#endif - -#if defined(NOALIGN) -void iFipiip(x64emu_t *emu, uintptr_t fnc); -#endif - -#if !defined(NOALIGN) -void iFEppu(x64emu_t *emu, uintptr_t fnc); -void iFEiiip(x64emu_t *emu, uintptr_t fnc); -void iFEipii(x64emu_t *emu, uintptr_t fnc); -void iFEipiip(x64emu_t *emu, uintptr_t fnc); -#endif - -#if !defined(STATICBUILD) -void iFlip(x64emu_t *emu, uintptr_t fnc); -void iFLLi(x64emu_t *emu, uintptr_t fnc); -void iFLLiW(x64emu_t *emu, uintptr_t fnc); -void iFEipup(x64emu_t *emu, uintptr_t fnc); -void iFEiipup(x64emu_t *emu, uintptr_t fnc); -void iFpipppL(x64emu_t *emu, uintptr_t fnc); -#endif - -void vFEv(x64emu_t *emu, uintptr_t fnc); -void iFEv(x64emu_t *emu, uintptr_t fnc); -void lFEv(x64emu_t *emu, uintptr_t fnc); -void pFEv(x64emu_t *emu, uintptr_t fnc); -void iFEvpp(x64emu_t *emu, uintptr_t fnc); -void pFEppv(x64emu_t *emu, uintptr_t fnc); -void iFEpvpp(x64emu_t *emu, uintptr_t fnc); -void iFEpvvppp(x64emu_t *emu, uintptr_t fnc); -void iFEpuvvppp(x64emu_t *emu, uintptr_t fnc); - -int isSimpleWrapper(wrapper_t fun); - -#endif // __WRAPPER_H_ diff --git a/src/wrapped/wrappedandroidshmem_private.h b/src/wrapped/wrappedandroidshmem_private.h index 84f29a8..bad5242 100755 --- a/src/wrapped/wrappedandroidshmem_private.h +++ b/src/wrapped/wrappedandroidshmem_private.h @@ -2,6 +2,10 @@ #error Meh.... #endif +GO(libandroid_shmdt, iFp) +GO(libandroid_shmctl, iFiip) +GO(libandroid_shmat, pFipi) +GO(libandroid_shmget, iFiLi) GO(shmctl, iFiip) GO(shmget, iFiLi) GO(shmat, pFipi) diff --git a/src/wrapped/wrappedandroidsupport_private.h b/src/wrapped/wrappedandroidsupport_private.h index a0ed8e1..4c8e334 100644 --- a/src/wrapped/wrappedandroidsupport_private.h +++ b/src/wrapped/wrappedandroidsupport_private.h @@ -1,4 +1,4 @@ -#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA) && defined(GOS)) +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) #error Meh... #endif diff --git a/src/wrapped/wrappedatk.c b/src/wrapped/wrappedatk.c index c45d89e..319a011 100644 --- a/src/wrapped/wrappedatk.c +++ b/src/wrapped/wrappedatk.c @@ -150,9 +150,8 @@ EXPORT uint32_t my_atk_add_global_event_listener(x64emu_t* emu, void* f, void* p return my->atk_add_global_event_listener(find_GSignalEmissionHook_Fct(f), p); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define CUSTOM_INIT \ SetAtkObjectID(my->atk_object_get_type()); \ diff --git a/src/wrapped/wrappedatk_private.h b/src/wrapped/wrappedatk_private.h index ec08108..a186542 100644 --- a/src/wrapped/wrappedatk_private.h +++ b/src/wrapped/wrappedatk_private.h @@ -1,9 +1,9 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(atk_action_do_action, iFpi) -GO(atk_action_get_description, iFpip) +GO(atk_action_get_description, pFpi) GO(atk_action_get_keybinding, pFpi) GO(atk_action_get_localized_name, pFpi) GO(atk_action_get_n_actions, iFp) @@ -14,8 +14,8 @@ GOM(atk_add_focus_tracker, uFEp) GOM(atk_add_global_event_listener, uFEpp) GOM(atk_add_key_event_listener, uFEpp) GO(atk_attribute_set_free, vFp) -//GOM(atk_component_add_focus_handler, uFpp) -GO(atk_component_contains, iFpiii) +//GOM(atk_component_add_focus_handler, uFEpp) +GO(atk_component_contains, iFpiiu) GO(atk_component_get_alpha, dFp) GO(atk_component_get_extents, vFpppppu) GO(atk_component_get_layer, uFp) @@ -34,12 +34,12 @@ GO(atk_coord_type_get_type, LFv) GO(atk_document_get_attributes, pFp) GO(atk_document_get_attribute_value, pFpp) GO(atk_document_get_document, pFp) -//GO(atk_document_get_document_type, +GO(atk_document_get_document_type, pFp) GO(atk_document_get_locale, pFp) GO(atk_document_get_type, LFv) GO(atk_document_set_attribute_value, iFppp) -//GO(atk_editable_text_copy_text, -//GO(atk_editable_text_cut_text, +GO(atk_editable_text_copy_text, vFpii) +GO(atk_editable_text_cut_text, vFpii) GO(atk_editable_text_delete_text, vFpii) GO(atk_editable_text_get_type, LFv) GO(atk_editable_text_insert_text, vFppip) @@ -48,21 +48,21 @@ GO(atk_editable_text_set_run_attributes, iFppii) GO(atk_editable_text_set_text_contents, vFpp) GOM(atk_focus_tracker_init, vFEp) GO(atk_focus_tracker_notify, vFp) -//GO(atk_get_binary_age, +GO(atk_get_binary_age, uFv) GO(atk_get_default_registry, pFv) GO(atk_get_focus_object, pFv) GO(atk_get_interface_age, uFv) -//GO(atk_get_major_version, -//GO(atk_get_micro_version, -//GO(atk_get_minor_version, +GO(atk_get_major_version, uFv) +GO(atk_get_micro_version, uFv) +GO(atk_get_minor_version, uFv) GO(atk_get_root, pFv) GO(atk_get_toolkit_name, pFv) GO(atk_get_toolkit_version, pFv) GO(atk_get_version, pFv) -//GO(atk_gobject_accessible_for_object, +GO(atk_gobject_accessible_for_object, pFp) GO(atk_gobject_accessible_get_object, pFp) -//GO(atk_gobject_accessible_get_type, -//GO(atk_hyperlink_get_end_index, +GO(atk_gobject_accessible_get_type, LFv) +GO(atk_hyperlink_get_end_index, iFp) GO(atk_hyperlink_get_n_anchors, iFp) GO(atk_hyperlink_get_object, pFpi) GO(atk_hyperlink_get_start_index, iFp) @@ -70,15 +70,15 @@ GO(atk_hyperlink_get_type, LFv) GO(atk_hyperlink_get_uri, pFpi) GO(atk_hyperlink_impl_get_hyperlink, pFp) GO(atk_hyperlink_impl_get_type, LFv) -//GO(atk_hyperlink_is_inline, +GO(atk_hyperlink_is_inline, iFp) GO(atk_hyperlink_is_selected_link, iFp) -//GO(atk_hyperlink_is_valid, -//GO(atk_hyperlink_state_flags_get_type, +GO(atk_hyperlink_is_valid, iFp) +GO(atk_hyperlink_state_flags_get_type, LFv) GO(atk_hypertext_get_link, pFpi) GO(atk_hypertext_get_link_index, iFpi) GO(atk_hypertext_get_n_links, iFp) GO(atk_hypertext_get_type, LFv) -//GO(atk_image_get_image_description, +GO(atk_image_get_image_description, pFp) GO(atk_image_get_image_locale, pFp) GO(atk_image_get_image_position, vFpppu) GO(atk_image_get_image_size, vFppp) @@ -97,16 +97,16 @@ GO(atk_misc_get_type, LFv) GO(atk_misc_threads_enter, vFp) GO(atk_misc_threads_leave, vFp) DATA(atk_misc_instance, sizeof(void*)) -//GO(atk_no_op_object_factory_get_type, +GO(atk_no_op_object_factory_get_type, LFv) GO(atk_no_op_object_factory_new, pFv) GO(atk_no_op_object_get_type, LFv) GO(atk_no_op_object_new, pFp) -GO(atk_object_add_relationship, iFpip) +GO(atk_object_add_relationship, iFpup) //GOM(atk_object_connect_property_change_handler, uFEpp) GO(atk_object_factory_create_accessible, pFpp) GO(atk_object_factory_get_accessible_type, LFp) GO(atk_object_factory_get_type, LFv) -//GO(atk_object_factory_invalidate, +GO(atk_object_factory_invalidate, vFp) GO(atk_object_get_attributes, pFp) GO(atk_object_get_description, pFp) GO(atk_object_get_index_in_parent, iFp) @@ -130,17 +130,17 @@ GO(atk_object_set_name, vFpp) GO(atk_object_set_parent, vFpp) GO(atk_object_set_role, vFpu) GO(atk_plug_get_id, pFp) -//GO(atk_plug_get_type, -//GO(atk_plug_new, -//GO(atk_rectangle_get_type, +GO(atk_plug_get_type, LFv) +GO(atk_plug_new, pFv) +GO(atk_rectangle_get_type, LFv) GO(atk_registry_get_factory, pFpL) GO(atk_registry_get_factory_type, LFpL) -//GO(atk_registry_get_type, +GO(atk_registry_get_type, LFv) GO(atk_registry_set_factory_type, vFpLL) GO(atk_relation_add_target, vFpp) GO(atk_relation_get_relation_type, uFp) GO(atk_relation_get_target, pFp) -//GO(atk_relation_get_type, +GO(atk_relation_get_type, LFv) GO(atk_relation_new, pFpiu) GO(atk_relation_remove_target, iFpp) GO(atk_relation_set_add, vFpp) @@ -150,19 +150,19 @@ GO(atk_relation_set_contains_target, iFpup) GO(atk_relation_set_get_n_relations, iFp) GO(atk_relation_set_get_relation, pFpi) GO(atk_relation_set_get_relation_by_type, pFpu) -//GO(atk_relation_set_get_type, +GO(atk_relation_set_get_type, LFv) GO(atk_relation_set_new, pFv) -//GO(atk_relation_set_remove, +GO(atk_relation_set_remove, vFpp) GO(atk_relation_type_for_name, uFp) GO(atk_relation_type_get_name, pFu) GO(atk_relation_type_get_type, LFv) -//GO(atk_relation_type_register, +GO(atk_relation_type_register, uFp) GO(atk_remove_focus_tracker, vFu) GO(atk_remove_global_event_listener, vFu) GO(atk_remove_key_event_listener, vFu) -GO(atk_role_for_name, iFp) +GO(atk_role_for_name, uFp) GO(atk_role_get_localized_name, pFu) -GO(atk_role_get_name, pFp) +GO(atk_role_get_name, pFu) GO(atk_role_get_type, LFv) GO(atk_role_register, uFp) GO(atk_selection_add_selection, iFpi) @@ -174,68 +174,72 @@ GO(atk_selection_ref_selection, pFpi) GO(atk_selection_remove_selection, iFpi) GO(atk_selection_select_all_selection, iFp) GO(atk_socket_embed, vFpp) -GO(atk_socket_get_type, iFv) +GO(atk_socket_get_type, LFv) GO(atk_socket_is_occupied, iFp) GO(atk_socket_new, pFv) -GO(atk_state_set_add_state, iFpi) +GO(atk_state_set_add_state, iFpu) GO(atk_state_set_add_states, vFppi) -//GO(atk_state_set_and_sets, -//GO(atk_state_set_clear_states, -GO(atk_state_set_contains_state, iFpi) +GO(atk_state_set_and_sets, pFpp) +GO(atk_state_set_clear_states, vFp) +GO(atk_state_set_contains_state, iFpu) GO(atk_state_set_contains_states, iFppi) -//GO(atk_state_set_get_type, +GO(atk_state_set_get_type, LFv) GO(atk_state_set_is_empty, iFp) GO(atk_state_set_new, pFv) -//GO(atk_state_set_or_sets, +GO(atk_state_set_or_sets, pFpp) GO(atk_state_set_remove_state, iFpu) GO(atk_state_set_xor_sets, pFpp) GO(atk_state_type_for_name, uFp) GO(atk_state_type_get_name, pFu) GO(atk_state_type_get_type, LFv) -//GO(atk_state_type_register, +GO(atk_state_type_register, uFp) GO(atk_streamable_content_get_mime_type, pFpi) GO(atk_streamable_content_get_n_mime_types, iFp) -//GO(atk_streamable_content_get_stream, -//GO(atk_streamable_content_get_type, +//GOM(atk_streamable_content_get_stream, pFEpp) +GO(atk_streamable_content_get_type, LFv) GO(atk_streamable_content_get_uri, pFpp) -//GO(atk_table_add_column_selection, -//GO(atk_table_add_row_selection, +GO(atk_table_add_column_selection, iFpi) +GO(atk_table_add_row_selection, iFpi) +GO(atk_table_cell_get_type, LFv) +GO(atk_table_cell_get_row_column_span, iFppppp) +GO(atk_table_cell_get_column_header_cells, pFp) +GO(atk_table_cell_get_row_header_cells, pFp) GO(atk_table_get_caption, pFp) -//GO(atk_table_get_column_at_index, +GO(atk_table_get_column_at_index, iFpi) GO(atk_table_get_column_description, pFpi) GO(atk_table_get_column_extent_at, iFpii) -//GO(atk_table_get_column_header, -//GO(atk_table_get_index_at, +GO(atk_table_get_column_header, pFpi) +GO(atk_table_get_index_at, iFpii) GO(atk_table_get_n_columns, iFp) GO(atk_table_get_n_rows, iFp) GO(atk_table_get_row_at_index, iFpi) GO(atk_table_get_row_description, pFpi) GO(atk_table_get_row_extent_at, iFpii) GO(atk_table_get_row_header, pFpi) -//GO(atk_table_get_selected_columns, +GO(atk_table_get_selected_columns, iFpp) GO(atk_table_get_selected_rows, iFpp) GO(atk_table_get_summary, pFp) GO(atk_table_get_type, LFv) -//GO(atk_table_is_column_selected, -//GO(atk_table_is_row_selected, +GO(atk_table_is_column_selected, iFpi) +GO(atk_table_is_row_selected, iFpi) GO(atk_table_is_selected, iFpii) GO(atk_table_ref_at, pFpii) GO(atk_table_remove_column_selection, iFpi) -//GO(atk_table_remove_row_selection, -//GO(atk_table_set_caption, -//GO(atk_table_set_column_description, -//GO(atk_table_set_column_header, +GO(atk_table_remove_row_selection, iFpi) +GO(atk_table_set_caption, vFpp) +GO(atk_table_set_column_description, vFpip) +GO(atk_table_set_column_header, vFpip) GO(atk_table_set_row_description, vFpip) GO(atk_table_set_row_header, vFpip) GO(atk_table_set_summary, vFpp) GO(atk_text_add_selection, iFpii) GO(atk_text_attribute_for_name, uFp) GO(atk_text_attribute_get_name, pFu) -//GO(atk_text_attribute_get_type, +GO(atk_text_attribute_get_type, LFv) GO(atk_text_attribute_get_value, pFui) -//GO(atk_text_attribute_register, -//GO(atk_text_boundary_get_type, -//GO(atk_text_clip_type_get_type, +GO(atk_text_attribute_register, uFp) +GO(atk_text_boundary_get_type, LFv) +GO(atk_text_clip_type_get_type, LFv) GO(atk_text_free_ranges, vFp) GO(atk_text_get_bounded_ranges, pFppuuu) GO(atk_text_get_caret_offset, iFp) @@ -249,12 +253,12 @@ GO(atk_text_get_range_extents, vFpiiup) GO(atk_text_get_run_attributes, pFpipp) GO(atk_text_get_selection, pFpipp) GO(atk_text_get_text, pFpii) -//GO(atk_text_get_text_after_offset, -//GO(atk_text_get_text_at_offset, +GO(atk_text_get_text_after_offset, pFpiupp) +GO(atk_text_get_text_at_offset, pFpiupp) GO(atk_text_get_text_before_offset, pFpiupp) GO(atk_text_get_type, LFv) GO(atk_text_range_get_type, LFv) -//GO(atk_text_remove_selection, +GO(atk_text_remove_selection, iFpi) GO(atk_text_scroll_substring_to_point, iFpiiuii) GO(atk_text_set_caret_offset, iFpi) GO(atk_text_set_selection, iFpiii) diff --git a/src/wrapped/wrappedatkbridge.c b/src/wrapped/wrappedatkbridge.c index a4f0aec..e2d6b68 100644 --- a/src/wrapped/wrappedatkbridge.c +++ b/src/wrapped/wrappedatkbridge.c @@ -20,9 +20,8 @@ EXPORT int my_atk_bridge_adaptor_init(void* argc, void** argv) return 0; } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define NEEDED_LIBS "libatk-1.0.so.0", "libSM.so.6", "libICE.so.6", "libXau.so.6", "libxcb.so.1" diff --git a/src/wrapped/wrappedatomic_private.h b/src/wrapped/wrappedatomic_private.h index 9566807..e1a21aa 100644 --- a/src/wrapped/wrappedatomic_private.h +++ b/src/wrapped/wrappedatomic_private.h @@ -62,7 +62,7 @@ GO(__atomic_exchange, vFLpppi) GO(__atomic_is_lock_free, iFLp) GO(__atomic_load, vFLppi) //GO(__atomic_load_1, -//GO(__atomic_load_16, +GO(__atomic_load_16, HFpi) //GO(__atomic_load_2, //GO(__atomic_load_4, //GO(__atomic_load_8, @@ -79,7 +79,7 @@ GO(__atomic_load, vFLppi) //GO(atomic_signal_fence, GO(__atomic_store, vFLppi) //GO(__atomic_store_1, -//GO(__atomic_store_16, +GO(__atomic_store_16, vFpHi) //GO(__atomic_store_2, //GO(__atomic_store_4, //GO(__atomic_store_8, diff --git a/src/wrapped/wrappedatspi.c b/src/wrapped/wrappedatspi.c index 2557a60..5d376b1 100644 --- a/src/wrapped/wrappedatspi.c +++ b/src/wrapped/wrappedatspi.c @@ -87,8 +87,7 @@ EXPORT void* my_atspi_event_listener_new(x64emu_t* emu, void* f, void* data, voi return my->atspi_event_listener_new(find_AtspiEventListenerCB_Fct(f), data, find_GDestroyNotify_Fct(d)); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedavahiclient.c b/src/wrapped/wrappedavahiclient.c new file mode 100644 index 0000000..631a5a4 --- /dev/null +++ b/src/wrapped/wrappedavahiclient.c @@ -0,0 +1,281 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* avahiclientName = "libavahi-client.so.3"; +#define LIBNAME avahiclient + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedavahiclienttypes.h" + +#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) + +// AvahiAddressResolverCallback +#define GO(A) \ +static uintptr_t my_AvahiAddressResolverCallback_fct_##A = 0; \ +static void my_AvahiAddressResolverCallback_##A(void* a, int b, int c, int d, void* e, void* f, int g, void* h) \ +{ \ + RunFunctionFmt(my_AvahiAddressResolverCallback_fct_##A, "piiippip", a, b, c, d, e, f, g, h); \ +} +SUPER() +#undef GO +static void* findAvahiAddressResolverCallbackFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_AvahiAddressResolverCallback_fct_##A == (uintptr_t)fct) return my_AvahiAddressResolverCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_AvahiAddressResolverCallback_fct_##A == 0) {my_AvahiAddressResolverCallback_fct_##A = (uintptr_t)fct; return my_AvahiAddressResolverCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-client AvahiAddressResolverCallback callback\n"); + return NULL; +} +// AvahiDomainBrowserCallback +#define GO(A) \ +static uintptr_t my_AvahiDomainBrowserCallback_fct_##A = 0; \ +static void my_AvahiDomainBrowserCallback_##A(void* a, int b, int c, int d, void* e, int f, void* g) \ +{ \ + RunFunctionFmt(my_AvahiDomainBrowserCallback_fct_##A, "piiipip", a, b, c, d, e, f, g); \ +} +SUPER() +#undef GO +static void* findAvahiDomainBrowserCallbackFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_AvahiDomainBrowserCallback_fct_##A == (uintptr_t)fct) return my_AvahiDomainBrowserCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_AvahiDomainBrowserCallback_fct_##A == 0) {my_AvahiDomainBrowserCallback_fct_##A = (uintptr_t)fct; return my_AvahiDomainBrowserCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-client AvahiDomainBrowserCallback callback\n"); + return NULL; +} +// AvahiHostNameResolverCallback +#define GO(A) \ +static uintptr_t my_AvahiHostNameResolverCallback_fct_##A = 0; \ +static void my_AvahiHostNameResolverCallback_##A(void* a, int b, int c, int d, void* e, void* f, int g, void* h) \ +{ \ + RunFunctionFmt(my_AvahiHostNameResolverCallback_fct_##A, "piiippip", a, b, c, d, e, f, g, h); \ +} +SUPER() +#undef GO +static void* findAvahiHostNameResolverCallbackFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_AvahiHostNameResolverCallback_fct_##A == (uintptr_t)fct) return my_AvahiHostNameResolverCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_AvahiHostNameResolverCallback_fct_##A == 0) {my_AvahiHostNameResolverCallback_fct_##A = (uintptr_t)fct; return my_AvahiHostNameResolverCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-client AvahiHostNameResolverCallback callback\n"); + return NULL; +} +// AvahiRecordBrowserCallback +#define GO(A) \ +static uintptr_t my_AvahiRecordBrowserCallback_fct_##A = 0; \ +static void my_AvahiRecordBrowserCallback_##A(void* a, int b, int c, int d, void* e, uint16_t f, uint16_t g, void* h, size_t i, int j, void* k) \ +{ \ + RunFunctionFmt(my_AvahiRecordBrowserCallback_fct_##A, "piiipWWpLip", a, b, c, d, e, f, g, h, i, j, k); \ +} +SUPER() +#undef GO +static void* findAvahiRecordBrowserCallbackFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_AvahiRecordBrowserCallback_fct_##A == (uintptr_t)fct) return my_AvahiRecordBrowserCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_AvahiRecordBrowserCallback_fct_##A == 0) {my_AvahiRecordBrowserCallback_fct_##A = (uintptr_t)fct; return my_AvahiRecordBrowserCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-client AvahiRecordBrowserCallback callback\n"); + return NULL; +} +// AvahiServiceBrowserCallback +#define GO(A) \ +static uintptr_t my_AvahiServiceBrowserCallback_fct_##A = 0; \ +static void my_AvahiServiceBrowserCallback_##A(void* a, int b, int c, int d, void* e, void* f, void* g, int h, void* i) \ +{ \ + RunFunctionFmt(my_AvahiServiceBrowserCallback_fct_##A, "piiipppip", a, b, c, d, e, f, g, h, i); \ +} +SUPER() +#undef GO +static void* findAvahiServiceBrowserCallbackFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_AvahiServiceBrowserCallback_fct_##A == (uintptr_t)fct) return my_AvahiServiceBrowserCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_AvahiServiceBrowserCallback_fct_##A == 0) {my_AvahiServiceBrowserCallback_fct_##A = (uintptr_t)fct; return my_AvahiServiceBrowserCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-client AvahiServiceBrowserCallback callback\n"); + return NULL; +} +// AvahiServiceTypeBrowserCallback +#define GO(A) \ +static uintptr_t my_AvahiServiceTypeBrowserCallback_fct_##A = 0; \ +static void my_AvahiServiceTypeBrowserCallback_##A(void* a, int b, int c, int d, void* e, void* f, int g, void* h) \ +{ \ + RunFunctionFmt(my_AvahiServiceTypeBrowserCallback_fct_##A, "piiippip", a, b, c, d, e, f, g, h); \ +} +SUPER() +#undef GO +static void* findAvahiServiceTypeBrowserCallbackFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_AvahiServiceTypeBrowserCallback_fct_##A == (uintptr_t)fct) return my_AvahiServiceTypeBrowserCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_AvahiServiceTypeBrowserCallback_fct_##A == 0) {my_AvahiServiceTypeBrowserCallback_fct_##A = (uintptr_t)fct; return my_AvahiServiceTypeBrowserCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-client AvahiServiceTypeBrowserCallback callback\n"); + return NULL; +} +// AvahiServiceResolverCallback +#define GO(A) \ +static uintptr_t my_AvahiServiceResolverCallback_fct_##A = 0; \ +static void my_AvahiServiceResolverCallback_##A(void* a, int b, int c, int d, void* e, void* f, void* g, void* h, void* i, uint16_t j, void* k, int l, void* m) \ +{ \ + RunFunctionFmt(my_AvahiServiceResolverCallback_fct_##A, "piiipppppWpip", a, b, c, d, e, f, g, h, i, j, k, l, m); \ +} +SUPER() +#undef GO +static void* findAvahiServiceResolverCallbackFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_AvahiServiceResolverCallback_fct_##A == (uintptr_t)fct) return my_AvahiServiceResolverCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_AvahiServiceResolverCallback_fct_##A == 0) {my_AvahiServiceResolverCallback_fct_##A = (uintptr_t)fct; return my_AvahiServiceResolverCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-client AvahiServiceResolverCallback callback\n"); + return NULL; +} +// AvahiClientCallback +#define GO(A) \ +static uintptr_t my_AvahiClientCallback_fct_##A = 0; \ +static void my_AvahiClientCallback_##A(void* a, int b, void* c) \ +{ \ + RunFunctionFmt(my_AvahiClientCallback_fct_##A, "pip", a, b, c); \ +} +SUPER() +#undef GO +static void* findAvahiClientCallbackFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_AvahiClientCallback_fct_##A == (uintptr_t)fct) return my_AvahiClientCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_AvahiClientCallback_fct_##A == 0) {my_AvahiClientCallback_fct_##A = (uintptr_t)fct; return my_AvahiClientCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-client AvahiClientCallback callback\n"); + return NULL; +} +// AvahiEntryGroupCallback +#define GO(A) \ +static uintptr_t my_AvahiEntryGroupCallback_fct_##A = 0; \ +static void my_AvahiEntryGroupCallback_##A(void* a, int b, void* c) \ +{ \ + RunFunctionFmt(my_AvahiEntryGroupCallback_fct_##A, "pip", a, b, c); \ +} +SUPER() +#undef GO +static void* findAvahiEntryGroupCallbackFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_AvahiEntryGroupCallback_fct_##A == (uintptr_t)fct) return my_AvahiEntryGroupCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_AvahiEntryGroupCallback_fct_##A == 0) {my_AvahiEntryGroupCallback_fct_##A = (uintptr_t)fct; return my_AvahiEntryGroupCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-client AvahiEntryGroupCallback callback\n"); + return NULL; +} + +#undef SUPER + +EXPORT void* my_avahi_address_resolver_new(x64emu_t* emu, void* client, int interface, int protocol, void* a, int flags, void* cb, void* data) +{ + return my->avahi_address_resolver_new(client, interface, protocol, a, flags, findAvahiAddressResolverCallbackFct(cb), data); +} + +EXPORT void* my_avahi_domain_browser_new(x64emu_t* emu, void* client, int interface, int protocol, void* domain, int btype, int flags, void* cb, void* data) +{ + return my->avahi_domain_browser_new(client, interface, protocol, domain, btype, flags, findAvahiDomainBrowserCallbackFct(cb), data); +} + +EXPORT void* my_avahi_host_name_resolver_new(x64emu_t* emu, void* client, int interface, int protocol, void* name, int aprotocol, int flags, void* cb, void* data) +{ + return my->avahi_host_name_resolver_new(client, interface, protocol, name, aprotocol, flags, findAvahiHostNameResolverCallbackFct(cb), data); +} + +EXPORT void* my_avahi_record_browser_new(x64emu_t* emu, void* client, int interface, int protocol, void* name, uint16_t class_, uint16_t type, int flags, void* cb, void* data) +{ + return my->avahi_record_browser_new(client, interface, protocol, name, class_, type, flags, findAvahiRecordBrowserCallbackFct(cb), data); +} + +EXPORT void* my_avahi_service_browser_new(x64emu_t* emu, void* client, int interface, int protocol, void* type, void* domain, int flags, void* cb, void* data) +{ + return my->avahi_service_browser_new(client, interface, protocol, type, domain, flags, findAvahiServiceBrowserCallbackFct(cb), data); +} + +EXPORT void* my_avahi_service_type_browser_new(x64emu_t* emu, void* client, int interface, int protocol, void* domain, int flags, void* cb, void* data) +{ + return my->avahi_service_type_browser_new(client, interface, protocol, domain, flags, findAvahiServiceTypeBrowserCallbackFct(cb), data); +} + +EXPORT void* my_avahi_service_resolver_new(x64emu_t* emu, void* client, int interface, int protocol, void* name, void* type, void* domain, int aprotocol, int flags, void* cb, void* data) +{ + return my->avahi_service_resolver_new(client, interface, protocol, name, type, domain, aprotocol, flags, findAvahiServiceResolverCallbackFct(cb), data); +} + +EXPORT void* my_avahi_client_new(x64emu_t* emu, void* poll_api, int flags, void* cb, void* data, void* err) +{ + return my->avahi_client_new(poll_api, flags, findAvahiClientCallbackFct(cb), data, err); +} + +EXPORT void* my_avahi_entry_group_new(x64emu_t* emu, void* p, void* cb, void* data) +{ + return my->avahi_entry_group_new(p, findAvahiEntryGroupCallbackFct(cb), data); +} + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedavahiclient_private.h b/src/wrapped/wrappedavahiclient_private.h new file mode 100644 index 0000000..ebde583 --- /dev/null +++ b/src/wrapped/wrappedavahiclient_private.h @@ -0,0 +1,66 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(avahi_address_resolver_event, iFpip) +GO(avahi_address_resolver_free, iFp) +GO(avahi_address_resolver_get_client, pFp) +GOM(avahi_address_resolver_new, pFEpiipupp) +GO(avahi_client_errno, iFp) +GO(avahi_client_free, vFp) +GO(avahi_client_get_domain_name, pFp) +GO(avahi_client_get_host_name, pFp) +GO(avahi_client_get_host_name_fqdn, pFp) +GO(avahi_client_get_local_service_cookie, uFp) +GO(avahi_client_get_state, uFp) +GO(avahi_client_get_version_string, pFp) +GO(avahi_client_is_connected, iFp) +GOM(avahi_client_new, pFEpuppp) +GO(avahi_client_set_dbus_error, iFpp) +GO(avahi_client_set_errno, iFpi) +GO(avahi_client_set_host_name, iFpp) +GO(avahi_client_simple_method_call, iFpppp) +GO(avahi_dbus_connection_glue, iFpp) +GO(avahi_domain_browser_event, iFpip) +GO(avahi_domain_browser_free, iFp) +GO(avahi_domain_browser_get_client, pFp) +GOM(avahi_domain_browser_new, pFEpiipuupp) +GO(avahi_entry_group_add_address, iFpiiupp) +GO(avahi_entry_group_add_record, iFpiiupWWupL) +GO(avahi_entry_group_add_service, iFpiiuppppWppppppp) //should be iFEpiiuppppWV +GO(avahi_entry_group_add_service_strlst, iFpiiuppppWp) +GO(avahi_entry_group_add_service_subtype, iFpiiupppp) +GO(avahi_entry_group_commit, iFp) +GO(avahi_entry_group_free, iFp) +GO(avahi_entry_group_get_client, pFp) +GO(avahi_entry_group_get_state, iFp) +GO(avahi_entry_group_is_empty, iFp) +GOM(avahi_entry_group_new, pFEppp) +GO(avahi_entry_group_reset, iFp) +GO(avahi_entry_group_set_state, vFpi) +GO(avahi_entry_group_update_service_txt, iFpiiuppppppppp) //should be iFEpiiupppV +GO(avahi_entry_group_update_service_txt_strlst, iFpiiupppp) +GO(avahi_error_dbus_to_number, iFp) +GO(avahi_error_number_to_dbus, pFi) +GO(avahi_host_name_resolver_event, iFpip) +GO(avahi_host_name_resolver_free, iFp) +GO(avahi_host_name_resolver_get_client, pFp) +GOM(avahi_host_name_resolver_new, pFEpiipiupp) +GO(avahi_nss_support, iFv) +GO(avahi_record_browser_event, iFpip) +GO(avahi_record_browser_free, iFp) +GO(avahi_record_browser_get_client, pFp) +GOM(avahi_record_browser_new, pFEpiipWWupp) +GO(avahi_service_browser_event, iFpip) +GO(avahi_service_browser_free, iFp) +GO(avahi_service_browser_get_client, pFp) +GOM(avahi_service_browser_new, pFEpiippupp) +GO(avahi_service_resolver_event, pFpip) +GO(avahi_service_resolver_free, iFp) +GO(avahi_service_resolver_get_client, pFp) +GOM(avahi_service_resolver_new, pFEpiipppiupp) +GO(avahi_service_type_browser_event, iFpip) +GO(avahi_service_type_browser_free, iFp) +GO(avahi_service_type_browser_get_client, pFp) +GOM(avahi_service_type_browser_new, pFEpiipupp) +GO(avahi_xdg_config_open, pFp) diff --git a/src/wrapped/wrappedavahicommon.c b/src/wrapped/wrappedavahicommon.c new file mode 100644 index 0000000..9d28433 --- /dev/null +++ b/src/wrapped/wrappedavahicommon.c @@ -0,0 +1,249 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* avahicommonName = "libavahi-common.so.3"; +#define LIBNAME avahicommon + +typedef void* (*pFpi_t)(void*, int); + +#define ADDED_FUNCTIONS() \ + GO(avahi_string_list_new_from_array, pFpi_t) + +#include "generated/wrappedavahicommontypes.h" + +#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) + +typedef struct my_AvahiAllocator_s { + void* (*malloc)(size_t size); + void (*free)(void *p); + void* (*realloc)(void *p, size_t size); + void* (*calloc)(size_t nmemb, size_t size); +} my_AvahiAllocator_t; + +// malloc +#define GO(A) \ +static uintptr_t my_malloc_fct_##A = 0; \ +static void* my_malloc_##A(size_t a) \ +{ \ + return (void*)RunFunctionFmt(my_malloc_fct_##A, "L", a); \ +} +SUPER() +#undef GO +static void* findmallocFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_malloc_fct_##A == (uintptr_t)fct) return my_malloc_##A; + SUPER() + #undef GO + #define GO(A) if(my_malloc_fct_##A == 0) {my_malloc_fct_##A = (uintptr_t)fct; return my_malloc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-common malloc callback\n"); + return NULL; +} +// free +#define GO(A) \ +static uintptr_t my_free_fct_##A = 0; \ +static void my_free_##A(void* a) \ +{ \ + RunFunctionFmt(my_free_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findfreeFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_free_fct_##A == (uintptr_t)fct) return my_free_##A; + SUPER() + #undef GO + #define GO(A) if(my_free_fct_##A == 0) {my_free_fct_##A = (uintptr_t)fct; return my_free_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-common free callback\n"); + return NULL; +} +// realloc +#define GO(A) \ +static uintptr_t my_realloc_fct_##A = 0; \ +static void* my_realloc_##A(void* a, size_t b) \ +{ \ + return (void*)RunFunctionFmt(my_realloc_fct_##A, "pL", a, b); \ +} +SUPER() +#undef GO +static void* findreallocFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_realloc_fct_##A == (uintptr_t)fct) return my_realloc_##A; + SUPER() + #undef GO + #define GO(A) if(my_realloc_fct_##A == 0) {my_realloc_fct_##A = (uintptr_t)fct; return my_realloc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-common realloc callback\n"); + return NULL; +} +// calloc +#define GO(A) \ +static uintptr_t my_calloc_fct_##A = 0; \ +static void* my_calloc_##A(size_t a, size_t b) \ +{ \ + return (void*)RunFunctionFmt(my_calloc_fct_##A, "LL", a, b); \ +} +SUPER() +#undef GO +static void* findcallocFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_calloc_fct_##A == (uintptr_t)fct) return my_calloc_##A; + SUPER() + #undef GO + #define GO(A) if(my_calloc_fct_##A == 0) {my_calloc_fct_##A = (uintptr_t)fct; return my_calloc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-common calloc callback\n"); + return NULL; +} +// AvahiPollFunc +#define GO(A) \ +static uintptr_t my_AvahiPollFunc_fct_##A = 0; \ +static int my_AvahiPollFunc_##A(void* a, uint32_t b, int c, void* d) \ +{ \ + return (int)RunFunctionFmt(my_AvahiPollFunc_fct_##A, "puip", a, b, c, d); \ +} +SUPER() +#undef GO +static void* findAvahiPollFuncFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_AvahiPollFunc_fct_##A == (uintptr_t)fct) return my_AvahiPollFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_AvahiPollFunc_fct_##A == 0) {my_AvahiPollFunc_fct_##A = (uintptr_t)fct; return my_AvahiPollFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavahi-common AvahiPollFunc callback\n"); + return NULL; +} + +#undef SUPER + +EXPORT void my_avahi_set_allocator(x64emu_t* emu, my_AvahiAllocator_t* p) +{ + my_AvahiAllocator_t _p = {0}; + if(p) { + _p.malloc = findmallocFct(p->malloc); + _p.free = findfreeFct(p->free); + _p.realloc = findreallocFct(p->realloc); + _p.calloc = findcallocFct(p->calloc); + } + my->avahi_set_allocator(p?&_p:NULL); +} + +EXPORT void my_avahi_simple_poll_set_func(x64emu_t* emu, void* s, void* f, void* d) +{ + my->avahi_simple_poll_set_func(s, findAvahiPollFuncFct(f), d); +} + +EXPORT void* my_avahi_strdup_printf(x64emu_t* emu, void* fmt, uint64_t* b) +{ + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 1); + PREPARE_VALIST; + return my->avahi_strdup_vprintf(fmt, VARARGS); +} +EXPORT void* my_avahi_strdup_vprintf(x64emu_t* emu, void* fmt, x64_va_list_t b) +{ + (void)emu; + #ifdef CONVERT_VALIST + CONVERT_VALIST(b); + #else + myStackAlignValist(emu, (const char*)fmt, emu->scratch, b); + PREPARE_VALIST; + #endif + return my->avahi_strdup_vprintf(fmt, VARARGS); +} + +EXPORT void* my_avahi_string_list_add_many(x64emu_t* emu, void* list, uint64_t* b) +{ + CREATE_SYSV_VALIST(b); + return my->avahi_string_list_add_many_va(list, VARARGS); +} +EXPORT void* my_avahi_string_list_add_many_va(x64emu_t* emu, void* list, x64_va_list_t b) +{ + #ifdef CONVERT_VALIST + (void)emu; + CONVERT_VALIST(b); + #else + CREATE_VALIST_FROM_VALIST(b, emu->scratch); + #endif + return my->avahi_string_list_add_many_va(list, VARARGS); +} + +EXPORT void* my_avahi_string_list_add_printf(x64emu_t* emu, void* list, void* fmt, uint64_t* b) +{ + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2); + PREPARE_VALIST; + return my->avahi_string_list_add_vprintf(list, fmt, VARARGS); +} +EXPORT void* my_avahi_string_list_add_vprintf(x64emu_t* emu, void* list, void* fmt, x64_va_list_t b) +{ + (void)emu; + #ifdef CONVERT_VALIST + CONVERT_VALIST(b); + #else + myStackAlignValist(emu, (const char*)fmt, emu->scratch, b); + PREPARE_VALIST; + #endif + return my->avahi_string_list_add_vprintf(list, fmt, VARARGS); +} + +EXPORT void* my_avahi_string_list_new(x64emu_t* emu, void* p, uintptr_t* b) +{ + int cnt = 0; + while(getVArgs(emu, 1, b, cnt)) ++cnt; + void* arr[cnt+1]; + arr[0] = p; + for(int i=0; iavahi_string_list_new_from_array(arr, cnt+1); +} + +EXPORT void* my_avahi_string_list_new_va(x64emu_t* emu, x64_va_list_t b) +{ + #ifdef CONVERT_VALIST + (void)emu; + CONVERT_VALIST(b); + #else + CREATE_VALIST_FROM_VALIST(b, emu->scratch); + #endif + return my->avahi_string_list_new_va(VARARGS); +} + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedavahicommon_private.h b/src/wrapped/wrappedavahicommon_private.h new file mode 100644 index 0000000..9379727 --- /dev/null +++ b/src/wrapped/wrappedavahicommon_private.h @@ -0,0 +1,93 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(avahi_address_cmp, iFpp) +GO(avahi_address_parse, pFpip) +GO(avahi_address_snprint, pFpLp) +GO(avahi_af_to_proto, iFi) +GO(avahi_age, IFp) +GO(avahi_alternative_host_name, pFp) +GO(avahi_alternative_service_name, pFp) +GO(avahi_domain_equal, iFpp) +GO(avahi_domain_hash, uFp) +GO(avahi_elapse_time, pFpuu) +GO(avahi_escape_label, pFpLpp) +GO(avahi_free, vFp) +GO(avahi_get_type_from_subtype, pFp) +GO(avahi_init_i18n, vFv) +GO(avahi_is_valid_domain_name, iFp) +GO(avahi_is_valid_fqdn, iFp) +GO(avahi_is_valid_host_name, iFp) +GO(avahi_is_valid_service_name, iFp) +GO(avahi_is_valid_service_subtype, iFp) +GO(avahi_is_valid_service_type_generic, iFp) +GO(avahi_is_valid_service_type_strict, iFp) +GO(avahi_malloc, pFL) +GO(avahi_malloc0, pFL) +GO(avahi_memdup, pFpL) +GO(avahi_normalize_name, pFppL) +GO(avahi_normalize_name_strdup, pFp) +GO(avahi_proto_to_af, iFi) +GO(avahi_proto_to_string, pFi) +GO(avahi_realloc, pFpL) +GO(avahi_reverse_lookup_name, pFppL) +GO(avahi_rlist_prepend, pFpp) +GO(avahi_rlist_remove, pFpp) +GO(avahi_rlist_remove_by_link, pFpp) +GO(avahi_service_name_join, iFpLppp) +GO(avahi_service_name_split, iFppLpLpL) +GOM(avahi_set_allocator, vFEp) +GO(avahi_simple_poll_dispatch, iFp) +GO(avahi_simple_poll_free, vFp) +GO(avahi_simple_poll_get, pFp) +GO(avahi_simple_poll_iterate, iFpi) +GO(avahi_simple_poll_loop, iFp) +GO(avahi_simple_poll_new, pFv) +GO(avahi_simple_poll_prepare, iFpi) +GO(avahi_simple_poll_quit, vFp) +GO(avahi_simple_poll_run, iFp) +GOM(avahi_simple_poll_set_func, vFEppp) +GO(avahi_simple_poll_wakeup, vFp) +GO(avahi_strdup, pFp) +GOM(avahi_strdup_printf, pFEpV) +GOM(avahi_strdup_vprintf, pFEpA) +GO(avahi_strerror, pFi) +GO(avahi_string_list_add, pFpp) +GO(avahi_string_list_add_anonymous, pFpL) +GO(avahi_string_list_add_arbitrary, pFppL) +GOM(avahi_string_list_add_many, pFEpV) +GOM(avahi_string_list_add_many_va, pFEpA) +GO(avahi_string_list_add_pair, pFppp) +GO(avahi_string_list_add_pair_arbitrary, pFpppL) +GOM(avahi_string_list_add_printf, pFEppV) +GOM(avahi_string_list_add_vprintf, pFEppA) +GO(avahi_string_list_copy, pFp) +GO(avahi_string_list_equal, iFpp) +GO(avahi_string_list_find, pFpp) +GO(avahi_string_list_free, vFp) +GO(avahi_string_list_get_next, pFp) +GO(avahi_string_list_get_pair, iFpppp) +GO(avahi_string_list_get_service_cookie, uFp) +GO(avahi_string_list_get_size, LFp) +GO(avahi_string_list_get_text, pFp) +GO(avahi_string_list_length, uFp) +GOM(avahi_string_list_new, pFEpV) +GO(avahi_string_list_new_from_array, pFpi) +GOM(avahi_string_list_new_va, pFEA) +GO(avahi_string_list_parse, iFpLp) +GO(avahi_string_list_reverse, pFp) +GO(avahi_string_list_serialize, LFppL) +GO(avahi_string_list_to_string, pFp) +GO(avahi_strndup, pFpL) +GO(avahi_threaded_poll_free, vFp) +GO(avahi_threaded_poll_get, pFp) +GO(avahi_threaded_poll_lock, vFp) +GO(avahi_threaded_poll_new, pFv) +GO(avahi_threaded_poll_quit, vFp) +GO(avahi_threaded_poll_start, iFp) +GO(avahi_threaded_poll_stop, iFp) +GO(avahi_threaded_poll_unlock, vFp) +GO(avahi_timeval_add, pFpI) +GO(avahi_timeval_compare, iFpp) +GO(avahi_timeval_diff, IFpp) diff --git a/src/wrapped/wrappedbrotlidec.c b/src/wrapped/wrappedbrotlidec.c new file mode 100644 index 0000000..f74b701 --- /dev/null +++ b/src/wrapped/wrappedbrotlidec.c @@ -0,0 +1,135 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include + +#include "wrappedlibs.h" + +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "debug.h" +#include "myalign.h" +#include "callback.h" +#include "emu/x64emu_private.h" + +const char* brotlidecName = "libbrotlidec.so.1"; +#define LIBNAME brotlidec + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedbrotlidectypes.h" + +#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// brotli_alloc_func ... +#define GO(A) \ +static uintptr_t my_brotli_alloc_func_fct_##A = 0; \ +static void* my_brotli_alloc_func_##A(void* a, size_t b) \ +{ \ + return (void*)RunFunctionFmt(my_brotli_alloc_func_fct_##A, "pL", a, b); \ +} +SUPER() +#undef GO +static void* find_brotli_alloc_func_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_brotli_alloc_func_fct_##A == (uintptr_t)fct) return my_brotli_alloc_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_brotli_alloc_func_fct_##A == 0) {my_brotli_alloc_func_fct_##A = (uintptr_t)fct; return my_brotli_alloc_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for brotidec brotli_alloc_func callback\n"); + return NULL; +} +// brotli_free_func ... +#define GO(A) \ +static uintptr_t my_brotli_free_func_fct_##A = 0; \ +static void my_brotli_free_func_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_brotli_free_func_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* find_brotli_free_func_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_brotli_free_func_fct_##A == (uintptr_t)fct) return my_brotli_free_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_brotli_free_func_fct_##A == 0) {my_brotli_free_func_fct_##A = (uintptr_t)fct; return my_brotli_free_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for brotidec brotli_free_func callback\n"); + return NULL; +} +// brotli_decoder_metadata_start_func ... +#define GO(A) \ +static uintptr_t my_brotli_decoder_metadata_start_func_fct_##A = 0; \ +static void my_brotli_decoder_metadata_start_func_##A(void* a, size_t b) \ +{ \ + RunFunctionFmt(my_brotli_decoder_metadata_start_func_fct_##A, "pL", a, b); \ +} +SUPER() +#undef GO +static void* find_brotli_decoder_metadata_start_func_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_brotli_decoder_metadata_start_func_fct_##A == (uintptr_t)fct) return my_brotli_decoder_metadata_start_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_brotli_decoder_metadata_start_func_fct_##A == 0) {my_brotli_decoder_metadata_start_func_fct_##A = (uintptr_t)fct; return my_brotli_decoder_metadata_start_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for brotidec brotli_decoder_metadata_start_func callback\n"); + return NULL; +} +// brotli_decoder_metadata_chunk_func ... +#define GO(A) \ +static uintptr_t my_brotli_decoder_metadata_chunk_func_fct_##A = 0; \ +static void my_brotli_decoder_metadata_chunk_func_##A(void* a, void* b, size_t c) \ +{ \ + RunFunctionFmt(my_brotli_decoder_metadata_chunk_func_fct_##A, "ppL", a, b, c); \ +} +SUPER() +#undef GO +static void* find_brotli_decoder_metadata_chunk_func_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_brotli_decoder_metadata_chunk_func_fct_##A == (uintptr_t)fct) return my_brotli_decoder_metadata_chunk_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_brotli_decoder_metadata_chunk_func_fct_##A == 0) {my_brotli_decoder_metadata_chunk_func_fct_##A = (uintptr_t)fct; return my_brotli_decoder_metadata_chunk_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for brotidec brotli_decoder_metadata_chunk_func callback\n"); + return NULL; +} +#undef SUPER + +EXPORT void* my_BrotliDecoderCreateInstance(x64emu_t* emu, void* m, void* f, void* d) +{ + return my->BrotliDecoderCreateInstance(find_brotli_alloc_func_Fct(m), find_brotli_free_func_Fct(f), d); +} + +EXPORT void my_BrotliDecoderSetMetadataCallbacks(x64emu_t* emu, void* state, void* start, void* chunk, void* d) +{ + my->BrotliDecoderSetMetadataCallbacks(state, find_brotli_decoder_metadata_start_func_Fct(start), find_brotli_decoder_metadata_chunk_func_Fct(chunk), d); +} + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedbrotlidec_private.h b/src/wrapped/wrappedbrotlidec_private.h new file mode 100644 index 0000000..952985d --- /dev/null +++ b/src/wrapped/wrappedbrotlidec_private.h @@ -0,0 +1,18 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(BrotliDecoderAttachDictionary, iFpuLp) +GOM(BrotliDecoderCreateInstance, pFEppp) +GO(BrotliDecoderDecompress, uFLppp) +GO(BrotliDecoderDecompressStream, uFpppppp) +GO(BrotliDecoderDestroyInstance, vFp) +GO(BrotliDecoderErrorString, pFi) +GO(BrotliDecoderGetErrorCode, iFp) +GO(BrotliDecoderHasMoreOutput, iFp) +GO(BrotliDecoderIsFinished, iFp) +GO(BrotliDecoderIsUsed, iFp) +GOM(BrotliDecoderSetMetadataCallbacks, vFEpppp) +GO(BrotliDecoderSetParameter, iFpuu) +GO(BrotliDecoderTakeOutput, pFpp) +GO(BrotliDecoderVersion, uFv) diff --git a/src/wrapped/wrappedcairo.c b/src/wrapped/wrappedcairo.c index 77c4fc2..13c6dde 100644 --- a/src/wrapped/wrappedcairo.c +++ b/src/wrapped/wrappedcairo.c @@ -64,6 +64,30 @@ static void* reverse_destroy_Fct(void* fct) #undef GO return (void*)AddBridge(my_lib->w.bridge, pFpii, fct, 0, NULL); } +// cairo_write ... +#define GO(A) \ +static uintptr_t my_cairo_write_fct_##A = 0; \ +static uint32_t my_cairo_write_##A(void* a, void* b, uint32_t c) \ +{ \ + return (uint32_t)RunFunctionFmt(my_cairo_write_fct_##A, "ppu", a, b, c); \ +} +SUPER() +#undef GO +static void* find_cairo_write_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_cairo_write_fct_##A == (uintptr_t)fct) return my_cairo_write_##A; + SUPER() + #undef GO + #define GO(A) if(my_cairo_write_fct_##A == 0) {my_cairo_write_fct_##A = (uintptr_t)fct; return my_cairo_write_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for cairo cairo_write callback\n"); + return NULL; +} + +#undef SUPER EXPORT void* my_cairo_xcb_device_get_connection(x64emu_t* emu, void* a) { @@ -80,4 +104,19 @@ EXPORT int my_cairo_set_user_data(x64emu_t* emu, void* cr, void* key, void* data return my->cairo_set_user_data(cr, key, data, find_destroy_Fct(d)); } +EXPORT int my_cairo_surface_set_mime_data(x64emu_t* emu, void* surf, void* mime_type, void* data, size_t len, void* destroy, void* closure) +{ + return my->cairo_surface_set_mime_data(surf, mime_type, data, len, find_destroy_Fct(destroy), closure); +} + +EXPORT void* my_cairo_pdf_surface_create_for_stream(x64emu_t* emu, void* f, void* c, double w, double h) +{ + return my->cairo_pdf_surface_create_for_stream(find_cairo_write_Fct(f), c, w, h); +} + +EXPORT uint32_t my_cairo_surface_write_to_png_stream(x64emu_t* emu, void* surf, void* f, void* c) +{ + return my->cairo_surface_write_to_png_stream(surf, find_cairo_write_Fct(f), c); +} + #include "wrappedlib_init.h" \ No newline at end of file diff --git a/src/wrapped/wrappedcairo_private.h b/src/wrapped/wrappedcairo_private.h index d069a24..9912156 100644 --- a/src/wrapped/wrappedcairo_private.h +++ b/src/wrapped/wrappedcairo_private.h @@ -175,7 +175,7 @@ GO(cairo_pattern_set_matrix, vFpp) GO(cairo_pattern_status, uFp) GO(cairo_pdf_get_versions, vFpp) GO(cairo_pdf_surface_create, pFpdd) -//GO(cairo_pdf_surface_create_for_stream, +GOM(cairo_pdf_surface_create_for_stream, pFEppdd) GO(cairo_pdf_surface_restrict_to_version, vFpu) GO(cairo_pdf_surface_set_size, vFpdd) GO(cairo_pdf_version_to_string, pFu) @@ -331,14 +331,14 @@ GO(cairo_surface_reference, pFp) GO(cairo_surface_set_device_offset, vFpdd) GO(cairo_surface_set_device_scale, vFpdd) GO(cairo_surface_set_fallback_resolution, vFpdd) -//GOM(cairo_surface_set_mime_data, iFEpppLpp) +GOM(cairo_surface_set_mime_data, iFEpppLpp) GOM(cairo_surface_set_user_data, iFEpppp) GO(cairo_surface_show_page, vFp) GO(cairo_surface_status, uFp) GO(cairo_surface_supports_mime_type, iFpp) GO(cairo_surface_unmap_image, vFpp) GO(cairo_surface_write_to_png, uFpp) -//GO(cairo_surface_write_to_png_stream, +GOM(cairo_surface_write_to_png_stream, uFEppp) GO(cairo_svg_get_versions, vFpp) GO(cairo_svg_surface_create, pFpdd) //GO(cairo_svg_surface_create_for_stream, @@ -388,8 +388,8 @@ GO(cairo_xlib_surface_get_display, pFp) GO(cairo_xlib_surface_get_drawable, LFp) GO(cairo_xlib_surface_get_height, iFp) GO(cairo_xlib_surface_get_screen, pFp) -//GO(cairo_xlib_surface_get_visual, -//GO(cairo_xlib_surface_get_width, +GO(cairo_xlib_surface_get_visual, pFp) +GO(cairo_xlib_surface_get_width, iFp) GO(cairo_xlib_surface_get_xrender_format, pFp) GO(cairo_xlib_surface_set_drawable, vFpLii) GO(cairo_xlib_surface_set_size, vFpii) diff --git a/src/wrapped/wrappedcap_private.h b/src/wrapped/wrappedcap_private.h index a09c939..c27c531 100644 --- a/src/wrapped/wrappedcap_private.h +++ b/src/wrapped/wrappedcap_private.h @@ -1,62 +1,62 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif -//GO(cap_clear, -//GO(cap_clear_flag, -//GO(cap_compare, -//GO(cap_copy_ext, -//GO(cap_copy_int, -//GO(cap_drop_bound, -//GO(cap_dup, +GO(cap_clear, iFp) +GO(cap_clear_flag, iFpu) +GO(cap_compare, iFpp) +GO(cap_copy_ext, lFppl) +GO(cap_copy_int, pFp) +GO(cap_drop_bound, iFi) +GO(cap_dup, pFp) GO(cap_free, iFp) -//GO(cap_from_name, -//GO(cap_from_text, -//GO(cap_get_ambient, -//GO(cap_get_bound, -//GO(cap_get_fd, -//GO(cap_get_file, -//GO(cap_get_flag, -//GO(cap_get_mode, -//GO(cap_get_nsowner, -//GO(capgetp, -//GO(cap_get_pid, -GO(cap_get_proc, pFi) -//GO(cap_get_secbits, -//GO(cap_iab_fill, -//GO(cap_iab_from_text, -//GO(cap_iab_get_proc, -//GO(cap_iab_get_vector, -//GO(cap_iab_init, -//GO(cap_iab_set_proc, -//GO(cap_iab_set_vector, -//GO(cap_iab_to_text, -//GO(cap_init, -//GO(cap_launch, -//GO(cap_launcher_callback, -//GO(cap_launcher_set_chroot, -//GO(cap_launcher_setgroups, -//GO(cap_launcher_set_iab, -//GO(cap_launcher_set_mode, -//GO(cap_launcher_setuid, -//GO(cap_max_bits, -//GO(cap_mode_name, -//GO(cap_new_launcher, -//GO(cap_reset_ambient, -//GO(cap_set_ambient, -//GO(cap_set_fd, -//GO(cap_set_file, -GO(cap_set_flag, iFpiipi) -//GO(cap_setgroups, -//GO(cap_set_mode, -//GO(cap_set_nsowner, -//GO(capsetp, +GO(cap_from_name, iFpp) +GO(cap_from_text, pFp) +GO(cap_get_ambient, iFi) +GO(cap_get_bound, iFi) +GO(cap_get_fd, pFi) +GO(cap_get_file, pFp) +GO(cap_get_flag, iFpiup) +GO(cap_get_mode, uFv) +GO(cap_get_nsowner, uFp) +GO(capgetp, iFip) +GO(cap_get_pid, pFi) +GO(cap_get_proc, pFv) +GO(cap_get_secbits, uFv) +GO(cap_iab_fill, iFpupu) +GO(cap_iab_from_text, pFp) +GO(cap_iab_get_proc, pFv) +GO(cap_iab_get_vector, uFpui) +GO(cap_iab_init, pFv) +GO(cap_iab_set_proc, iFp) +GO(cap_iab_set_vector, iFpuiu) +GO(cap_iab_to_text, pFp) +GO(cap_init, pFv) +GO(cap_launch, iFpp) +//GOM(cap_launcher_callback, iFEpp) +GO(cap_launcher_set_chroot, iFpp) +GO(cap_launcher_setgroups, iFpuip) +GO(cap_launcher_set_iab, pFpp) +GO(cap_launcher_set_mode, iFpu) +GO(cap_launcher_setuid, iFpu) +GO(cap_max_bits, iFv) +GO(cap_mode_name, pFu) +GO(cap_new_launcher, pFppp) +GO(cap_reset_ambient, iFv) +GO(cap_set_ambient, iFiu) +GO(cap_set_fd, iFip) +GO(cap_set_file, iFpp) +GO(cap_set_flag, iFpuipu) +GO(cap_setgroups, iFuLp) +GO(cap_set_mode, iFu) +GO(cap_set_nsowner, iFpu) +GO(capsetp, iFip) GO(cap_set_proc, iFp) -//GO(cap_set_secbits, -//GO(cap_set_syscall, -//GO(cap_setuid, -//GO(cap_size, -//GO(cap_to_name, -//GO(cap_to_text, +GO(cap_set_secbits, iFu) +//GOM(cap_set_syscall, vFEpp) +GO(cap_setuid, iFu) +GO(cap_size, lFp) +GO(cap_to_name, pFi) +GO(cap_to_text, pFpp) //GO(_libcap_strdup, //GOW(psx_load_syscalls, diff --git a/src/wrapped/wrappedcrashhandler.c b/src/wrapped/wrappedcrashhandler.c index fe0840b..603d18d 100644 --- a/src/wrapped/wrappedcrashhandler.c +++ b/src/wrapped/wrappedcrashhandler.c @@ -21,7 +21,7 @@ const char* crashhandlerName = "crashhandler.so"; #define LIBNAME crashhandler #define PRE_INIT \ - if(!box64_dummy_crashhandler) \ + if(!BOX64ENV(dummy_crashhandler)) \ return -1; \ if(1) \ lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL);\ diff --git a/src/wrapped/wrappedcrypto3.c b/src/wrapped/wrappedcrypto3.c index 87e5e08..990e42a 100644 --- a/src/wrapped/wrappedcrypto3.c +++ b/src/wrapped/wrappedcrypto3.c @@ -22,10 +22,25 @@ const char* crypto3Name = "libcrypto.so.3"; #define LIBNAME crypto3 -typedef int(*iFppA_t) (void*, void*, va_list); +typedef void*(*pFv_t) (); +typedef int (*iFppA_t) (void*, void*, va_list); +typedef int (*iFpip_t) (void*, int, void*); +typedef void*(*pFppp_t) (void*, void*, void*); #define ADDED_FUNCTIONS() \ GO(BIO_vprintf, iFppA_t); \ + GO(i2t_ASN1_OBJECT, iFpip_t); \ + GO(i2v_ASN1_BIT_STRING, pFppp_t); \ + GO(i2v_GENERAL_NAME, pFppp_t); \ + GO(i2v_GENERAL_NAMES, pFppp_t); \ + GO(ASN1_BIT_STRING_it, pFv_t); \ + GO(EXTENDED_KEY_USAGE_it, pFv_t); \ + GO(ASN1_OCTET_STRING_it, pFv_t); \ + GO(GENERAL_NAMES_it, pFv_t); \ + GO(CERTIFICATEPOLICIES_it, pFv_t); \ + GO(POLICYINFO_it, pFv_t); \ + GO(CRL_DIST_POINTS_it, pFv_t); \ + GO(ISSUING_DIST_POINT_it, pFv_t); \ #include "generated/wrappedcrypto3types.h" @@ -111,6 +126,30 @@ static void* find_free_fnc_Fct(void* fct) return NULL; } +// copy_fnc +#define GO(A) \ +static uintptr_t my3_copy_fnc_fct_##A = 0; \ +static void my3_copy_fnc_##A(void* p) \ +{ \ + RunFunctionFmt(my3_copy_fnc_fct_##A, "p", p); \ +} +SUPER() +#undef GO +static void* find_copy_fnc_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my3_copy_fnc_fct_##A == (uintptr_t)fct) return my3_copy_fnc_##A; + SUPER() + #undef GO + #define GO(A) if(my3_copy_fnc_fct_##A == 0) {my3_copy_fnc_fct_##A = (uintptr_t)fct; return my3_copy_fnc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcrypto copy_fnc callback\n"); + return NULL; +} + // id_func #define GO(A) \ static uintptr_t my3_id_func_fct_##A = 0; \ @@ -183,6 +222,54 @@ static void* find_passphrase_Fct(void* fct) return NULL; } +// BIO_meth_set_gets +#define GO(A) \ +static uintptr_t my3_BIO_meth_set_gets_fct_##A = 0; \ +static int my3_BIO_meth_set_gets_##A(void* a, void* b, int c) \ +{ \ + return (int)RunFunctionFmt(my3_BIO_meth_set_gets_fct_##A, "ppi", a, b, c); \ +} +SUPER() +#undef GO +static void* find_BIO_meth_set_gets_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my3_BIO_meth_set_gets_fct_##A == (uintptr_t)fct) return my3_BIO_meth_set_gets_##A; + SUPER() + #undef GO + #define GO(A) if(my3_BIO_meth_set_gets_fct_##A == 0) {my3_BIO_meth_set_gets_fct_##A = (uintptr_t)fct; return my3_BIO_meth_set_gets_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcrypto3 BIO_meth_set_gets callback\n"); + return NULL; +} + +// rsakeygen +#define GO(A) \ +static uintptr_t my3_rsakeygen_fct_##A = 0; \ +static void my3_rsakeygen_##A(int a, int b, void* c) \ +{ \ + RunFunctionFmt(my3_rsakeygen_fct_##A, "iip", a, b, c); \ +} +SUPER() +#undef GO +static void* find_rsakeygen_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my3_rsakeygen_fct_##A == (uintptr_t)fct) return my3_rsakeygen_##A; + SUPER() + #undef GO + #define GO(A) if(my3_rsakeygen_fct_##A == 0) {my3_rsakeygen_fct_##A = (uintptr_t)fct; return my3_rsakeygen_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcrypto rsakeygen callback\n"); + return NULL; +} + // xnew #define GO(A) \ static uintptr_t my3_xnew_fct_##A = 0; \ @@ -303,6 +390,92 @@ static void* find_verify_cb_Fct(void* fct) return NULL; } +// err_print_errors_cb +#define GO(A) \ +static uintptr_t my3_err_print_errors_cb_fct_##A = 0; \ +static int my3_err_print_errors_cb_##A(const char* str, size_t len, void* u) \ +{ \ + return (int)RunFunctionFmt(my3_err_print_errors_cb_fct_##A, "pLp", str, len, u); \ +} +SUPER() +#undef GO +static void* find_err_print_errors_cb_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my3_err_print_errors_cb_fct_##A == (uintptr_t)fct) return my3_err_print_errors_cb_##A; + SUPER() + #undef GO + #define GO(A) if(my3_err_print_errors_cb_fct_##A == 0) {my3_err_print_errors_cb_fct_##A = (uintptr_t)fct; return my3_err_print_errors_cb_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcrypto err_print_errors_cb callback\n"); + return NULL; +} + +// ui_opener +#define GO(A) \ +static uintptr_t my3_ui_opener_fct_##A = 0; \ +static int my3_ui_opener_##A(void *ui) \ +{ \ + return (int)RunFunctionFmt(my3_ui_opener_fct_##A, "p", ui); \ +} +SUPER() +#undef GO +static void* find_ui_opener_Fct(void *fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my3_ui_opener_fct_##A == (uintptr_t)fct) return my3_ui_opener_##A; + SUPER() + #undef GO + #define GO(A) if(my3_ui_opener_fct_##A ==0) {my3_ui_opener_fct_##A = (uintptr_t)fct; return my3_ui_opener_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcrypto ui_opener callback\n"); + return NULL; +} + + +// ui_writer +#define GO(A) \ +static uintptr_t my3_ui_writer_fct_##A = 0; \ +static int my3_ui_writer_##A(void *ui) \ +{ \ + return (int)RunFunctionFmt(my3_ui_writer_fct_##A, "p", ui); \ +} +SUPER() +#undef GO +static void* find_ui_writer_Fct(void *fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my3_ui_writer_fct_##A == (uintptr_t)fct) return my3_ui_writer_##A; + SUPER() + #undef GO + #define GO(A) if(my3_ui_writer_fct_##A ==0) {my3_ui_writer_fct_##A = (uintptr_t)fct; return my3_ui_writer_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcrypto ui_writer callback\n"); + return NULL; +} + +EXPORT int my3_UI_method_set_opener(x64emu_t* emu, void* method, void* opener) { + return my->UI_method_set_opener(method, find_ui_opener_Fct(opener)); +} +EXPORT int my3_UI_method_set_closer(x64emu_t* emu, void* method, void* closer) { + return my->UI_method_set_closer(method, find_ui_opener_Fct(closer)); +} +EXPORT int my3_UI_method_set_reader(x64emu_t* emu, void* method, void* reader) { + return my->UI_method_set_reader(method, find_ui_writer_Fct(reader)); +} +EXPORT int my3_UI_method_set_writer(x64emu_t* emu, void* method, void* writer) { + return my->UI_method_set_writer(method, find_ui_writer_Fct(writer)); +} + // do_all_provided_cb #define GO(A) \ static uintptr_t my3_do_all_provided_cb_fct_##A = 0; \ @@ -327,7 +500,6 @@ static void* find_do_all_provided_cb_Fct(void* fct) return NULL; } -#undef SUPER EXPORT int32_t my3_ENGINE_ctrl(x64emu_t* emu, void* e, int32_t cmd, int32_t i, void* p, void* f) { @@ -377,6 +549,12 @@ EXPORT void my3_PEM_read_bio_RSA_PUBKEY(x64emu_t* emu, void* bp, void* x, void* my->PEM_read_bio_RSA_PUBKEY(bp, x, find_passphrase_Fct(cb), u); } +EXPORT void my3_PEM_read_bio_RSAPublicKey(x64emu_t* emu, void* bp, void* x, void* cb, void* u) +{ + (void)emu; + my->PEM_read_bio_RSAPublicKey(bp, x, find_passphrase_Fct(cb), u); +} + EXPORT void my3_PEM_read_bio_ECPrivateKey(x64emu_t* emu, void* bp, void* x, void* cb, void* u) { (void)emu; @@ -455,6 +633,18 @@ EXPORT void* my3_PEM_read_bio_X509_CERT_PAIR(x64emu_t* emu, void* bp, void* x, v return my->PEM_read_bio_X509_CERT_PAIR(bp, x, find_pem_password_cb_Fct(cb), u); } +EXPORT void my3_ERR_print_errors_cb(x64emu_t* emu, void* cb, void* u) +{ + (void)emu; + my->ERR_print_errors_cb(find_err_print_errors_cb_Fct(cb), u); +} + +EXPORT void* my3_PEM_X509_INFO_read_bio(x64emu_t* emu, void* bp, void* sk, void* cb, void* u) +{ + (void)emu; + return my->PEM_X509_INFO_read_bio(bp, sk, find_pem_password_cb_Fct(cb), u); +} + EXPORT void my3_X509_STORE_CTX_set_verify_cb(x64emu_t* emu, void* ctx, void* cb) { (void)emu; @@ -467,6 +657,11 @@ EXPORT void my3_OPENSSL_sk_pop_free(x64emu_t* emu, void* s, void* cb) my->OPENSSL_sk_pop_free(s, find_free_fnc_Fct(cb)); } +EXPORT void* my3_OPENSSL_sk_deep_copy(x64emu_t* emu, void* s, void* c, void* f) +{ + return my->OPENSSL_sk_deep_copy(s, find_copy_fnc_Fct(c), find_free_fnc_Fct(f)); +} + EXPORT void* my3_OPENSSL_sk_new(x64emu_t* emu, void* f) { return my->OPENSSL_sk_new(find_cmp_fnc_Fct(f)); @@ -496,16 +691,184 @@ EXPORT int my3_BIO_printf(x64emu_t* emu, void* bio, void* fmt, uintptr_t* b) return my->BIO_vprintf(bio, fmt, VARARGS); } +EXPORT int my3_BIO_meth_set_gets(x64emu_t* emu, void* biom, void* cb) +{ + (void)emu; + return my->BIO_meth_set_gets(biom, find_BIO_meth_set_gets_Fct(cb)); +} + +EXPORT void my3_OSSL_PARAM_construct_end(x64emu_t* emu, void* ret) +{ + (void)emu; + my->OSSL_PARAM_construct_end(ret); +} + +EXPORT void my3_OSSL_PARAM_construct_int(x64emu_t* emu, void* ret, void* key, void* buf) +{ + (void)emu; + my->OSSL_PARAM_construct_int(ret, key, buf); +} + +EXPORT void my3_OSSL_PARAM_construct_uint(x64emu_t* emu, void* ret, void* key, void* buf) +{ + (void)emu; + my->OSSL_PARAM_construct_uint(ret, key, buf); +} + +EXPORT void my3_OSSL_PARAM_construct_octet_string(x64emu_t* emu, void* ret, void* key, void* buf, size_t bsize) +{ + (void)emu; + my->OSSL_PARAM_construct_octet_string(ret, key, buf, bsize); +} + +EXPORT void my3_OSSL_PARAM_construct_utf8_string(x64emu_t* emu, void* ret, void* key, void* buf, size_t bsize) +{ + (void)emu; + my->OSSL_PARAM_construct_utf8_string(ret, key, buf, bsize); +} + +#define GO(A) \ +static uintptr_t my3_OSSL_STORE_post_process_info_fct_##A = 0; \ +static void* my3_OSSL_STORE_post_process_info_##A(void* info, void* data) \ +{ \ + return (void*)RunFunctionFmt(my3_OSSL_STORE_post_process_info_fct_##A, "pp", info, data); \ +} +SUPER() +#undef GO +static void* find_OSSL_STORE_post_process_info(void* fct) +{ + if (!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my3_OSSL_STORE_post_process_info_fct_##A == (uintptr_t)fct) return my3_OSSL_STORE_post_process_info_##A; + SUPER() + #undef GO + #define GO(A) if(my3_OSSL_STORE_post_process_info_fct_##A == 0) {my3_OSSL_STORE_post_process_info_fct_##A = (uintptr_t)fct; return my3_OSSL_STORE_post_process_info_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcrypto OSSL_STORE_post_process_info callback\n"); + return NULL; +} + +EXPORT void* my3_OSSL_STORE_open(x64emu_t* emu, void* uri, void *ui_method, void *ui_data, void* post_process, void* post_process_data) +{ + (void)emu; + return my->OSSL_STORE_open(uri, ui_method, ui_data, find_OSSL_STORE_post_process_info(post_process), post_process_data); +} + +EXPORT void* my3_OSSL_STORE_open_ex(x64emu_t* emu, void* uri, void* libctx, void* propq, void* ui_method, void* ui_data, void* params, void* post_process, void* post_process_data) +{ + (void)emu; + return my->OSSL_STORE_open_ex(uri, libctx, propq, ui_method, ui_data, params, find_OSSL_STORE_post_process_info(post_process), post_process_data); +} + EXPORT void* my3_PEM_read_DHparams(x64emu_t* emu, void* fp, void* x, void* cb, void* u) { return my->PEM_read_DHparams(fp, x, find_pem_password_cb_Fct(cb), u); } +EXPORT void* my3_PEM_read_PrivateKey(x64emu_t* emu, void* fp, void* x, void* cb, void* u) +{ + (void)emu; + return my->PEM_read_PrivateKey(fp, x, find_pem_password_cb_Fct(cb), u); +} + +EXPORT void* my3_PEM_read_PUBKEY(x64emu_t* emu, void* fp, void* x, void* cb, void* u) +{ + (void)emu; + return my->PEM_read_PUBKEY(fp, x, find_pem_password_cb_Fct(cb), u); +} + EXPORT void my3_EVP_MD_do_all_provided(x64emu_t* emu, void* ctx, void* cb, void* arg) { my->EVP_MD_do_all_provided(ctx, find_do_all_provided_cb_Fct(cb), arg); } +EXPORT void my3_X509_STORE_set_verify_cb(x64emu_t* emu, void* ctx, void* cb) +{ + my->X509_STORE_set_verify_cb(ctx, find_verify_cb_Fct(cb)); +} + +EXPORT void* my3_PEM_read_bio_PrivateKey(x64emu_t* emu, void* bp, void* x, void* cb, void* u) +{ + return my->PEM_read_bio_PrivateKey(bp,x, find_pem_password_cb_Fct(cb), u); +} + +EXPORT int my3_PEM_write_bio_PrivateKey(x64emu_t* emu, void* bp, void* x, void* enc, void* kstr, int klen, void* cb, void* u) +{ + return my->PEM_write_bio_PrivateKey(bp, x, enc, kstr, klen, find_pem_password_cb_Fct(cb), u); +} + +EXPORT int my3_PEM_write_bio_PrivateKey_traditional(x64emu_t* emu, void* bp, void* x, void* enc, void* kstr, int klen, void* cb, void* u) +{ + return my->PEM_write_bio_PrivateKey_traditional(bp, x, enc, kstr, klen, find_pem_password_cb_Fct(cb), u); +} + +EXPORT void* my3_PEM_read_bio_PUBKEY(x64emu_t* emu, void* bp, void* x, void* cb, void* u) +{ + return my->PEM_read_bio_PUBKEY(bp, x, find_pem_password_cb_Fct(cb), u); +} + +EXPORT void* my3_PEM_read_bio_DHparams(x64emu_t* emu, void* bp, void* x, void* cb, void* u) +{ + return my->PEM_read_bio_DHparams(bp, x, find_pem_password_cb_Fct(cb), u); +} + +EXPORT void* my3_RSA_generate_key(x64emu_t* emu, int bits, unsigned long e, void* cb, void* cb_arg) +{ + return my->RSA_generate_key(bits, e, find_rsakeygen_Fct(cb), cb_arg); +} + +typedef struct my_v3_ext_method_s { + int ext_nid; + int ext_flags; + void* it; + void* ext_new; + void* ext_free; + void* d2i; + void* i2d; + void* i2s; + void* s2i; + void* i2v; + void* v2i; + void* i2r; + void* r2i; +} my_v3_ext_method_t; + +EXPORT void* my3_X509V3_EXT_get(x64emu_t* emu, void* x) +{ + my_v3_ext_method_t* ret = my->X509V3_EXT_get(x); + if(ret) { + #define GO(A, W) if(ret->A) AddAutomaticBridge(my_lib->w.bridge, W, ret->A, 0, "v3_ext_method_" #A) + GO(ext_new, pFv); + GO(ext_free, vFp); + GO(d2i, pFppl); + GO(i2d, iFpp); + GO(i2s, pFpp); + GO(s2i, pFppp); + GO(i2v, pFppp); + GO(v2i, pFppp); + GO(i2r, iFpppi); + GO(r2i, pFppp); + #undef GO + } + return ret; +} + #define ALTMY my3_ +#define CUSTOM_INIT \ + AddAutomaticBridge(lib->w.bridge, iFpip, my->i2t_ASN1_OBJECT, 0, "i2t_ASN1_OBJECT"); \ + AddAutomaticBridge(lib->w.bridge, pFppp, my->i2v_ASN1_BIT_STRING, 0, "i2v_ASN1_BIT_STRING"); \ + AddAutomaticBridge(lib->w.bridge, pFppp, my->i2v_GENERAL_NAME, 0, "i2v_GENERAL_NAME"); \ + AddAutomaticBridge(lib->w.bridge, pFppp, my->i2v_GENERAL_NAMES, 0, "i2v_GENERAL_NAMES"); \ + AddAutomaticBridge(lib->w.bridge, pFv, my->ASN1_BIT_STRING_it, 0, "ASN1_BIT_STRING_it"); \ + AddAutomaticBridge(lib->w.bridge, pFv, my->EXTENDED_KEY_USAGE_it, 0, "EXTENDED_KEY_USAGE_it"); \ + AddAutomaticBridge(lib->w.bridge, pFv, my->ASN1_OCTET_STRING_it, 0, "ASN1_OCTET_STRING_it"); \ + AddAutomaticBridge(lib->w.bridge, pFv, my->GENERAL_NAMES_it, 0, "GENERAL_NAMES_it"); \ + AddAutomaticBridge(lib->w.bridge, pFv, my->CERTIFICATEPOLICIES_it, 0, "CERTIFICATEPOLICIES_it");\ + AddAutomaticBridge(lib->w.bridge, pFv, my->POLICYINFO_it, 0, "POLICYINFO_it"); \ + AddAutomaticBridge(lib->w.bridge, pFv, my->CRL_DIST_POINTS_it, 0, "CRL_DIST_POINTS_it"); \ + AddAutomaticBridge(lib->w.bridge, pFv, my->ISSUING_DIST_POINT_it, 0, "ISSUING_DIST_POINT_it"); \ + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedcrypto3_private.h b/src/wrapped/wrappedcrypto3_private.h index 9b4d5cf..8d632b0 100644 --- a/src/wrapped/wrappedcrypto3_private.h +++ b/src/wrapped/wrappedcrypto3_private.h @@ -1,5 +1,5 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(a2d_ASN1_OBJECT, iFpipi) @@ -42,10 +42,11 @@ GO(AES_wrap_key, iFppppi) //GO(_armv8_sha1_probe, //GO(_armv8_sha256_probe, //GO(asn1_add_error, -//GO(ASN1_add_oid_module, +GO(ASN1_add_oid_module, vFv) GO(ASN1_BIT_STRING_check, iFppi) GO(ASN1_BIT_STRING_free, vFp) GO(ASN1_BIT_STRING_get_bit, iFpi) +GO(ASN1_BIT_STRING_it, pFv) GO(ASN1_BIT_STRING_name_print, iFpppi) GO(ASN1_BIT_STRING_new, pFv) GO(ASN1_BIT_STRING_num_asc, iFpp) @@ -59,11 +60,11 @@ GO(ASN1_check_infinite_end, iFpl) GO(ASN1_const_check_infinite_end, iFpl) //GO(asn1_const_Finish, GOM(ASN1_d2i_bio, pFEpppp) -//GO(ASN1_d2i_fp, +//GOM(ASN1_d2i_fp, pFEppSp) //GO(ASN1_digest, //GO(asn1_do_adb, //GO(asn1_do_lock, -//GO(ASN1_dup, +//GOM(ASN1_dup, pFEppp) //GO(asn1_enc_free, //GO(asn1_enc_init, //GO(asn1_enc_restore, @@ -93,7 +94,7 @@ GO(ASN1_generate_v3, pFpp) GO(ASN1_get_object, iFppppl) //GO(asn1_GetSequence, GOM(ASN1_i2d_bio, iFEppp) -//GO(ASN1_i2d_fp, +//GOM(ASN1_i2d_fp, iFEpSp) GO(ASN1_IA5STRING_free, vFp) GO(ASN1_IA5STRING_new, pFv) GO(ASN1_INTEGER_cmp, iFpp) @@ -105,7 +106,7 @@ GO(ASN1_INTEGER_set, iFpl) GO(ASN1_INTEGER_to_BN, pFpp) GO(ASN1_item_d2i, pFpplp) GO(ASN1_item_d2i_bio, pFppp) -GO(ASN1_item_d2i_fp, pFppp) +GO(ASN1_item_d2i_fp, pFpSp) //GO(ASN1_item_digest, GO(ASN1_item_dup, pFpp) //GO(ASN1_item_ex_d2i, @@ -113,9 +114,9 @@ GO(ASN1_item_dup, pFpp) //GO(ASN1_item_ex_i2d, //GO(ASN1_item_ex_new, GO(ASN1_item_free, vFpp) -//GO(ASN1_item_i2d, +GO(ASN1_item_i2d, iFppp) GO(ASN1_item_i2d_bio, iFppp) -GO(ASN1_item_i2d_fp, iFppp) +GO(ASN1_item_i2d_fp, iFpSp) GO(ASN1_item_ndef_i2d, iFppp) GO(ASN1_item_new, pFp) GO(ASN1_item_pack, pFppp) @@ -135,27 +136,28 @@ GO(ASN1_object_size, iFiii) GO(ASN1_OCTET_STRING_cmp, iFpp) GO(ASN1_OCTET_STRING_dup, pFp) GO(ASN1_OCTET_STRING_free, vFp) +GO(ASN1_OCTET_STRING_it, pFv) GO(ASN1_OCTET_STRING_new, pFv) GO(ASN1_OCTET_STRING_set, iFppi) //GO(ASN1_pack_string, GO(ASN1_parse, iFppli) GO(ASN1_parse_dump, iFpplii) GO(ASN1_PCTX_free, vFp) -//GO(ASN1_PCTX_get_cert_flags, -//GO(ASN1_PCTX_get_flags, -//GO(ASN1_PCTX_get_nm_flags, -//GO(ASN1_PCTX_get_oid_flags, +GO(ASN1_PCTX_get_cert_flags, LFp) +GO(ASN1_PCTX_get_flags, LFp) +GO(ASN1_PCTX_get_nm_flags, LFp) +GO(ASN1_PCTX_get_oid_flags, LFp) GO(ASN1_PCTX_get_str_flags, LFp) GO(ASN1_PCTX_new, pFv) -//GO(ASN1_PCTX_set_cert_flags, -//GO(ASN1_PCTX_set_flags, -//GO(ASN1_PCTX_set_nm_flags, -//GO(ASN1_PCTX_set_oid_flags, +GO(ASN1_PCTX_set_cert_flags, vFpL) +GO(ASN1_PCTX_set_flags, vFpL) +GO(ASN1_PCTX_set_nm_flags, vFpL) +GO(ASN1_PCTX_set_oid_flags, vFpL) GO(ASN1_PCTX_set_str_flags, vFpL) //GO(ASN1_primitive_free, //GO(ASN1_primitive_new, -//GO(ASN1_PRINTABLE_free, -//GO(ASN1_PRINTABLE_new, +GO(ASN1_PRINTABLE_free, vFp) +GO(ASN1_PRINTABLE_new, pFv) GO(ASN1_PRINTABLESTRING_free, vFp) GO(ASN1_PRINTABLESTRING_new, pFv) GO(ASN1_PRINTABLE_type, iFpi) @@ -165,7 +167,7 @@ GO(ASN1_put_object, vFpiiii) //GO(ASN1_seq_unpack, //GO(asn1_set_choice_selector, //GO(ASN1_sign, -//GO(ASN1_STRING_clear_free, +GO(ASN1_STRING_clear_free, vFp) GO(ASN1_STRING_cmp, iFpp) GO(ASN1_STRING_copy, iFpp) GO(ASN1_STRING_data, pFp) @@ -175,17 +177,17 @@ GO(ASN1_STRING_get0_data, pFp) GO(ASN1_STRING_get_default_mask, LFv) GO(ASN1_STRING_length, iFp) GO(ASN1_STRING_length_set, vFpi) -//GO(ASN1_STRING_new, +GO(ASN1_STRING_new, pFv) GO(ASN1_STRING_print, iFpp) GO(ASN1_STRING_print_ex, iFppL) -GO(ASN1_STRING_print_ex_fp, iFppL) +GO(ASN1_STRING_print_ex_fp, iFSpL) GO(ASN1_STRING_set, iFppi) GO(ASN1_STRING_set0, vFppi) GO(ASN1_STRING_set_by_NID, pFppiii) GO(ASN1_STRING_set_default_mask, vFL) GO(ASN1_STRING_set_default_mask_asc, iFp) GO(ASN1_STRING_TABLE_add, iFillLL) -//GO(ASN1_STRING_TABLE_cleanup, +GO(ASN1_STRING_TABLE_cleanup, vFv) GO(ASN1_STRING_TABLE_get, pFi) GO(ASN1_STRING_to_UTF8, iFpp) GO(ASN1_STRING_type, iFp) @@ -206,7 +208,7 @@ GO(ASN1_TIME_free, vFp) GO(ASN1_TIME_new, pFv) GO(ASN1_TIME_print, iFpp) GO(ASN1_TIME_set, pFpl) -//GO(ASN1_TIME_set_string, +GO(ASN1_TIME_set_string, iFpp) GO(ASN1_TIME_to_generalizedtime, pFpp) GO(ASN1_TYPE_cmp, iFpp) GO(ASN1_TYPE_free, vFp) @@ -218,6 +220,7 @@ GO(ASN1_TYPE_set, vFpip) GO(ASN1_TYPE_set1, iFpip) GO(ASN1_TYPE_set_int_octetstring, iFplpi) GO(ASN1_TYPE_set_octetstring, iFppi) +GO(ASN1_TIME_to_tm, iFpp) GO(ASN1_UNIVERSALSTRING_free, vFp) GO(ASN1_UNIVERSALSTRING_new, pFv) GO(ASN1_UNIVERSALSTRING_to_string, iFp) @@ -256,48 +259,48 @@ GO(BF_ofb64_encrypt, vFpplppp) GO(BF_options, pFv) GO(BF_set_key, vFpip) GO(BIO_accept, iFip) -//GO(BIO_asn1_get_prefix, -GO(BIO_asn1_get_suffix, iFppp) -//GO(BIO_asn1_set_prefix, -//GO(BIO_asn1_set_suffix, -//GO(BIO_callback_ctrl, +//GOM(BIO_asn1_get_prefix, iFEppp) +GO(BIO_asn1_get_suffix, iFppp) // might need GOM, the 2 last p are functions pointers +//GOM(BIO_asn1_set_prefix, iFEppp) +//GOM(BIO_asn1_set_suffix, iFEppp) +//GOM(BIO_callback_ctrl, lFEpip) GO(BIO_clear_flags, vFpi) //GO(BIO_CONNECT_free, //GO(BIO_CONNECT_new, GO(BIO_copy_next_retry, vFp) GO(BIO_ctrl, lFpilp) GO(BIO_ctrl_get_read_request, LFp) -//GO(BIO_ctrl_get_write_guarantee, +GO(BIO_ctrl_get_write_guarantee, LFp) GO(BIO_ctrl_pending, LFp) -//GO(BIO_ctrl_reset_read_request, +GO(BIO_ctrl_reset_read_request, iFp) GO(BIO_ctrl_wpending, LFp) GO(BIO_debug_callback, lFpipill) -//GO(BIO_dgram_non_fatal_error, +GO(BIO_dgram_non_fatal_error, iFi) GO(BIO_dump, iFppi) -//GO(BIO_dump_cb, -GO(BIO_dump_fp, iFppi) +//GOM(BIO_dump_cb, iFEpppi) +GO(BIO_dump_fp, iFSpi) GO(BIO_dump_indent, iFppii) -//GO(BIO_dump_indent_cb, -GO(BIO_dump_indent_fp, iFppii) +//GOM(BIO_dump_indent_cb, iFEpppii) +GO(BIO_dump_indent_fp, iFSpii) GO(BIO_dup_chain, pFp) GO(BIO_eof, iFp) GO(BIO_f_asn1, pFv) -//GO(BIO_f_base64, -//GO(BIO_f_buffer, -//GO(BIO_f_cipher, -//GO(BIO_fd_non_fatal_error, -//GO(BIO_fd_should_retry, +GO(BIO_f_base64, pFv) +GO(BIO_f_buffer, pFv) +GO(BIO_f_cipher, pFv) +GO(BIO_fd_non_fatal_error, iFi) +GO(BIO_fd_should_retry, iFi) GO(BIO_flush, iFp) GO(BIO_find_type, pFpi) -//GO(BIO_f_md, -//GO(BIO_f_nbio_test, -//GO(BIO_f_null, +GO(BIO_f_md, pFv) +GO(BIO_f_nbio_test, pFv) +GO(BIO_f_null, pFv) GO(BIO_free, iFp) GO(BIO_free_all, vFp) -//GO(BIO_f_reliable, +GO(BIO_f_reliable, pFv) //GO(BIO_f_zlib, GO(BIO_get_accept_socket, iFpi) -GO(BIO_get_callback, pFp) +GO(BIO_get_callback, pFp) // might need GOM to unwrap callback? GO(BIO_get_callback_arg, pFp) GO(BIO_get_close, iFp) GO(BIO_get_ex_data, pFpi) @@ -309,83 +312,84 @@ GO(BIO_get_retry_BIO, pFpp) GO(BIO_get_retry_reason, iFp) GO(BIO_gets, iFppi) GO(BIO_hex_string, iFpiipi) -//GO(BIO_indent, +GO(BIO_indent, iFpii) GO(BIO_int_ctrl, lFpili) GO(BIO_method_name, pFp) GO(BIO_method_type, iFp) +GOM(BIO_meth_set_gets, iFEpp) GO(BIO_new, pFp) GO(BIO_new_accept, pFp) GO(BIO_new_bio_pair, iFpLpL) //GO(BIO_new_CMS, -//GO(BIO_new_connect, -//GO(BIO_new_dgram, +GO(BIO_new_connect, pFp) +GO(BIO_new_dgram, pFii) GO(BIO_new_fd, pFii) GO(BIO_new_file, pFpp) -GO(BIO_new_fp, pFpi) +GO(BIO_new_fp, pFSi) GO(BIO_new_mem_buf, pFpi) GO(BIO_new_NDEF, pFppp) //GO(BIO_new_PKCS7, -//GO(BIO_new_socket, -//GO(BIO_next, -//GO(BIO_nread, -//GO(BIO_nread0, -//GO(BIO_number_read, -GO(BIO_number_written, LFp) +GO(BIO_new_socket, pFii) +GO(BIO_next, pFp) +GO(BIO_nread, iFppi) +GO(BIO_nread0, iFpp) +GO(BIO_number_read, UFp) +GO(BIO_number_written, UFp) GO(BIO_nwrite, iFppi) GO(BIO_nwrite0, iFpp) GO(BIO_pending, iFp) -//GO(BIO_pop, +GO(BIO_pop, pFp) GOM(BIO_printf, iFEppV) GO(BIO_ptr_ctrl, pFpil) GO(BIO_push, pFpp) GO(BIO_puts, iFpp) GO(BIO_read, iFppi) GO(BIO_reset, iFp) -//GO(BIO_s_accept, -//GO(BIO_s_bio, -//GO(BIO_s_connect, +GO(BIO_s_accept, pFv) +GO(BIO_s_bio, pFv) +GO(BIO_s_connect, pFv) GO(BIO_s_datagram, pFv) GO(BIO_seek, iFpi) GO(BIO_set, iFpp) -//GO(BIO_set_callback, +//GOM(BIO_set_callback, vFEpp) GO(BIO_set_callback_arg, vFpp) GO(BIO_set_close, iFpl) -//GO(BIO_set_cipher, +GO(BIO_set_cipher, iFppppi) GO(BIO_set_ex_data, iFpip) GO(BIO_set_flags, vFpi) GO(BIO_set_tcp_ndelay, iFii) -//GO(BIO_s_fd, +GO(BIO_s_fd, pFv) GO(BIO_s_file, pFv) -//GO(BIO_s_log, +GO(BIO_s_log, pFv) GO(BIO_s_mem, pFv) -//GO(BIO_snprintf, -//GO(BIO_s_null, +//GOM(BIO_snprintf, iFEpLpV) +GO(BIO_s_null, pFv) //GO(BIO_sock_cleanup, -//GO(BIO_sock_error, +GO(BIO_sock_error, iFi) GO(BIO_socket_ioctl, iFilp) -//GO(BIO_socket_nbio, +GO(BIO_socket_nbio, iFii) GO(BIO_sock_init, iFv) -//GO(BIO_sock_non_fatal_error, -//GO(BIO_sock_should_retry, -//GO(BIO_s_socket, +GO(BIO_sock_non_fatal_error, iFi) +GO(BIO_sock_should_retry, iFi) +GO(BIO_s_socket, pFv) GO(BIO_tell, iFp) GO(BIO_test_flags, iFpi) GO(BIO_up_ref, iFp) GO(BIO_vfree, vFp) -//GO(BIO_vprintf, -//GO(BIO_vsnprintf, +//GOM(BIO_vprintf, iFEppA) +//GOM(BIO_vsnprintf, iFEpLpA) GO(BIO_wpending, iFp) GO(BIO_write, iFppi) GO(BN_add, iFppp) //GO(bn_add_part_words, -GO(BN_add_word, iFpu) +GO(BN_add_word, iFpL) //GO(bn_add_words, GO(BN_asc2bn, iFpp) GO(BN_bin2bn, pFpip) -//GO(BN_BLINDING_convert, +GO(BN_BLINDING_convert, iFppp) GO(BN_BLINDING_convert_ex, iFpppp) -//GO(BN_BLINDING_create_param, -//GO(BN_BLINDING_free, +//GOM(BN_BLINDING_create_param, pFEpppppp) +GO(BN_BLINDING_free, vFp) GO(BN_BLINDING_get_flags, LFp) //GO(BN_BLINDING_get_thread_id, GO(BN_BLINDING_invert, iFppp) @@ -413,7 +417,7 @@ GO(BN_CTX_free, vFp) GO(BN_CTX_get, pFp) GO(BN_CTX_init, vFp) GO(BN_CTX_new, pFv) -//GO(BN_CTX_start, +GO(BN_CTX_start, vFp) GO(BN_dec2bn, iFpp) GO(BN_div, iFppppp) GO(BN_div_recp, iFppppp) @@ -427,60 +431,62 @@ GO(BN_free, vFp) GO(BN_from_montgomery, iFpppp) GO(BN_gcd, iFpppp) GO(BN_GENCB_call, iFpii) -//GO(BN_generate_prime, pFpiippBp) //callback previous last argument... +//GOM(BN_generate_prime, pFEpiipppp) GO(BN_generate_prime_ex, iFpiippp) -//GO(BN_get0_nist_prime_192, -//GO(BN_get0_nist_prime_224, -//GO(BN_get0_nist_prime_256, -//GO(BN_get0_nist_prime_384, +GO(BN_get0_nist_prime_192, pFv) +GO(BN_get0_nist_prime_224, pFv) +GO(BN_get0_nist_prime_256, pFv) +GO(BN_get0_nist_prime_384, pFv) GO(BN_get0_nist_prime_521, pFv) GO(BN_get_params, iFi) GO(BN_get_word, LFp) -//GO(BN_GF2m_add, +GO(BN_get_flags, iFpi) +GO(BN_GF2m_add, iFppp) GO(BN_GF2m_arr2poly, iFpp) GO(BN_GF2m_mod, iFppp) GO(BN_GF2m_mod_arr, iFppp) -//GO(BN_GF2m_mod_div, -//GO(BN_GF2m_mod_div_arr, +GO(BN_GF2m_mod_div, iFppppp) +GO(BN_GF2m_mod_div_arr, iFppppp) GO(BN_GF2m_mod_exp, iFppppp) GO(BN_GF2m_mod_exp_arr, iFppppp) -//GO(BN_GF2m_mod_inv, -//GO(BN_GF2m_mod_inv_arr, -//GO(BN_GF2m_mod_mul, -//GO(BN_GF2m_mod_mul_arr, -//GO(BN_GF2m_mod_solve_quad, +GO(BN_GF2m_mod_inv, iFpppp) +GO(BN_GF2m_mod_inv_arr, iFpppp) +GO(BN_GF2m_mod_mul, iFppppp) +GO(BN_GF2m_mod_mul_arr, iFppppp) +GO(BN_GF2m_mod_solve_quad, iFpppp) GO(BN_GF2m_mod_solve_quad_arr, iFpppp) -//GO(BN_GF2m_mod_sqr, -//GO(BN_GF2m_mod_sqr_arr, -//GO(BN_GF2m_mod_sqrt, -//GO(BN_GF2m_mod_sqrt_arr, +GO(BN_GF2m_mod_sqr, iFpppp) +GO(BN_GF2m_mod_sqr_arr, iFpppp) +GO(BN_GF2m_mod_sqrt, iFpppp) +GO(BN_GF2m_mod_sqrt_arr, iFpppp) //GO(bn_GF2m_mul_2x2, GO(BN_GF2m_poly2arr, iFppi) GO(BN_hex2bn, iFpp) //GO(BN_init, GO(BN_is_bit_set, iFpi) -//GO(BN_is_prime, iFpiBpp) // third argument is a callback +//GOM(BN_is_prime, iFEpippp) // third argument is a callback GO(BN_is_prime_ex, iFpipp) -//GO(BN_is_prime_fasttest, +//GOM(BN_is_prime_fasttest, iFEpipppi) GO(BN_is_prime_fasttest_ex, iFpipip) -GO(BN_is_zero, iFp) +GO(BN_is_word, iFpL) +GO(BN_is_zero, iFp) GO(BN_kronecker, iFppp) GO(BN_lshift, iFppi) GO(BN_lshift1, iFpp) GO(BN_mask_bits, iFpi) GO(BN_mod_add, iFppppp) -//GO(BN_mod_add_quick, +GO(BN_mod_add_quick, iFpppp) GO(BN_mod_exp, iFppppp) GO(BN_mod_exp2_mont, iFpppppppp) -//GO(BN_mod_exp_mont, +GO(BN_mod_exp_mont, iFpppppp) GO(BN_mod_exp_mont_consttime, iFpppppp) GO(BN_mod_exp_mont_word, iFpLpppp) -//GO(BN_mod_exp_recp, -//GO(BN_mod_exp_simple, +GO(BN_mod_exp_recp, iFppppp) +GO(BN_mod_exp_simple, iFppppp) GO(BN_mod_inverse, pFpppp) GO(BN_mod_lshift, iFppipp) -//GO(BN_mod_lshift1, -//GO(BN_mod_lshift1_quick, +GO(BN_mod_lshift1, iFpppp) +GO(BN_mod_lshift1_quick, iFppp) GO(BN_mod_lshift_quick, iFppip) GO(BN_mod_mul, iFppppp) GO(BN_mod_mul_montgomery, iFppppp) @@ -508,13 +514,13 @@ GO(BN_mul, iFpppp) //GO(bn_mul_normal, //GO(bn_mul_part_recursive, //GO(bn_mul_recursive, -GO(BN_mul_word, iFpu) +GO(BN_mul_word, iFpL) //GO(bn_mul_words, GO(BN_new, pFv) -//GO(BN_nist_mod_192, -//GO(BN_nist_mod_224, -//GO(BN_nist_mod_256, -//GO(BN_nist_mod_384, +GO(BN_nist_mod_192, iFpppp) +GO(BN_nist_mod_224, iFpppp) +GO(BN_nist_mod_256, iFpppp) +GO(BN_nist_mod_384, iFpppp) GO(BN_nist_mod_521, iFpppp) GO(BN_nnmod, iFpppp) GO(BN_num_bits, iFp) @@ -522,11 +528,11 @@ GO(BN_num_bits_word, iFL) GO(BN_one, iFp) GO(BN_options, pFv) GO(BN_print, iFpp) -GO(BN_print_fp, iFpp) +GO(BN_print_fp, iFSp) GO(BN_pseudo_rand, iFpiii) GO(BN_pseudo_rand_range, iFpp) GO(BN_rand, iFpiii) -//GO(BN_rand_range, +GO(BN_rand_range, iFpp) GO(BN_reciprocal, iFppip) GO(BN_RECP_CTX_free, vFp) //GO(BN_RECP_CTX_init, @@ -538,6 +544,7 @@ GO(BN_set_bit, iFpi) GO(BN_set_negative, vFpi) GO(BN_set_params, vFiiii) GO(BN_set_word, iFpL) +GO(BN_set_flags, vFpi) GO(BN_sqr, iFppp) //GO(bn_sqr_comba4, //GO(bn_sqr_comba8, @@ -546,14 +553,14 @@ GO(BN_sqr, iFppp) //GO(bn_sqr_words, GO(BN_sub, iFppp) //GO(bn_sub_part_words, -GO(BN_sub_word, iFpu) +GO(BN_sub_word, iFpL) //GO(bn_sub_words, GO(BN_swap, vFpp) GO(BN_to_ASN1_ENUMERATED, pFpp) GO(BN_to_ASN1_INTEGER, pFpp) -//GO(BN_uadd, +GO(BN_uadd, iFppp) GO(BN_ucmp, iFpp) -//GO(BN_usub, +GO(BN_usub, iFppp) GO(BN_value_one, pFv) GO(BN_X931_derive_prime_ex, iFppppppppp) GO(BN_X931_generate_prime_ex, iFppppppppp) @@ -600,6 +607,7 @@ GO(BN_zero, vFp) //GO(CAST_ofb64_encrypt, //GO(CAST_set_key, //GO(CERTIFICATEPOLICIES_free, +GO(CERTIFICATEPOLICIES_it, pFv) //GO(CERTIFICATEPOLICIES_new, //GO(check_defer, //GO(CMAC_CTX_cleanup, @@ -797,6 +805,7 @@ GO(CONF_modules_unload, vFi) //GO(CONF_set_nconf, GO(COMP_get_type, iFp) GO(CRL_DIST_POINTS_free, vFp) +GO(CRL_DIST_POINTS_it, pFv) GO(CRL_DIST_POINTS_new, pFv) //GO(CRYPTO_128_unwrap, //GO(CRYPTO_128_wrap, @@ -814,6 +823,7 @@ GO(CRYPTO_add_lock, iFpiipi) //GO(CRYPTO_cfb128_1_encrypt, //GO(CRYPTO_cfb128_8_encrypt, //GO(CRYPTO_cfb128_encrypt, +GO(CRYPTO_clear_free, vFvLpi) GO(CRYPTO_cleanup_all_ex_data, vFv) //GO(CRYPTO_ctr128_encrypt, //GO(CRYPTO_ctr128_encrypt_ctr32, @@ -850,7 +860,7 @@ GO(CRYPTO_free_ex_data, vFipp) //GO(CRYPTO_get_dynlock_value, GO(CRYPTO_get_ex_data, pFpi) //GO(CRYPTO_get_ex_data_implementation, -GO(CRYPTO_get_ex_new_index, iFilpppp) +GO(CRYPTO_get_ex_new_index, iFilpppp) // might need GOM, last 3 pointers are functions //GO(CRYPTO_get_id_callback, //GO(CRYPTO_get_locked_mem_ex_functions, //GO(CRYPTO_get_locked_mem_functions, @@ -859,12 +869,12 @@ GO(CRYPTO_get_ex_new_index, iFilpppp) //GO(CRYPTO_get_mem_debug_functions, //GO(CRYPTO_get_mem_debug_options, //GO(CRYPTO_get_mem_ex_functions, -GO(CRYPTO_get_mem_functions, vFppp) +GO(CRYPTO_get_mem_functions, vFppp) // might need GOM, 3 function pointers retreived //GO(CRYPTO_get_new_dynlockid, //GO(CRYPTO_get_new_lockid, //GO(CRYPTO_is_mem_check_on, //GO(CRYPTO_lock, -GO(CRYPTO_malloc, pFupi) +GO(CRYPTO_malloc, pFLpi) //GO(CRYPTO_malloc_locked, GO(CRYPTO_memcmp, iFppL) //GO(CRYPTO_mem_ctrl, @@ -897,7 +907,7 @@ GOM(CRYPTO_set_locking_callback, vFEp) //GO(CRYPTO_set_mem_debug_functions, //GO(CRYPTO_set_mem_debug_options, //GO(CRYPTO_set_mem_ex_functions, -//GO(CRYPTO_set_mem_functions, +//GOM(CRYPTO_set_mem_functions, iFEppp) GO(CRYPTO_strdup, pFppi) //GO(CRYPTO_thread_id, //GO(CRYPTO_THREADID_cmp, @@ -918,13 +928,13 @@ GO(d2i_ASN1_ENUMERATED, pFppl) GO(d2i_ASN1_GENERALIZEDTIME, pFppl) GO(d2i_ASN1_GENERALSTRING, pFppl) GO(d2i_ASN1_IA5STRING, pFppl) -//GO(d2i_ASN1_INTEGER, +GO(d2i_ASN1_INTEGER, pFppl) GO(d2i_ASN1_NULL, pFppl) GO(d2i_ASN1_OBJECT, pFppl) GO(d2i_ASN1_OCTET_STRING, pFppl) -//GO(d2i_ASN1_PRINTABLE, +GO(d2i_ASN1_PRINTABLE, pFppl) GO(d2i_ASN1_PRINTABLESTRING, pFppl) -//GO(d2i_ASN1_SEQUENCE_ANY, +GO(d2i_ASN1_SEQUENCE_ANY, pFppl) //GO(d2i_ASN1_SET, GO(d2i_ASN1_SET_ANY, pFppl) GO(d2i_ASN1_T61STRING, pFppl) @@ -947,7 +957,7 @@ GO(d2i_BASIC_CONSTRAINTS, pFppl) //GO(d2i_CRL_DIST_POINTS, GO(d2i_DHparams, pFppl) //GO(d2i_DHxparams, -//GO(d2i_DIRECTORYSTRING, +GO(d2i_DIRECTORYSTRING, pFppl) GO(d2i_DISPLAYTEXT, pFppl) //GO(d2i_DIST_POINT, //GO(d2i_DIST_POINT_NAME, @@ -960,7 +970,7 @@ GO(d2i_DSA_PUBKEY_bio, pFpp) GO(d2i_DSA_PUBKEY_fp, pFpp) //GO(d2i_DSAPublicKey, //GO(d2i_DSA_SIG, -//GO(d2i_ECDSA_SIG, +GO(d2i_ECDSA_SIG, pFppl) //GO(d2i_ECParameters, //GO(d2i_ECPKParameters, //GO(d2i_ECPKPARAMETERS, @@ -1046,7 +1056,7 @@ GO(d2i_PKCS8_PRIV_KEY_INFO_fp, pFpp) //GO(d2i_PKEY_USAGE_PERIOD, //GO(d2i_POLICYINFO, //GO(d2i_POLICYQUALINFO, -GO(d2i_PrivateKey, pFppl) +GO(d2i_PrivateKey, pFippl) GO(d2i_PrivateKey_bio, pFpp) GO(d2i_PrivateKey_fp, pFpp) //GO(d2i_PROXY_CERT_INFO_EXTENSION, @@ -1054,7 +1064,7 @@ GO(d2i_PrivateKey_fp, pFpp) GO(d2i_PUBKEY, pFppl) GO(d2i_PUBKEY_bio, pFpp) GO(d2i_PUBKEY_fp, pFpp) -//GO(d2i_PublicKey, +GO(d2i_PublicKey, pFippl) //GO(d2i_RSA_NET, //GO(d2i_RSA_OAEP_PARAMS, GO(d2i_RSAPrivateKey, pFppl) @@ -1150,7 +1160,8 @@ GO(DES_set_odd_parity, vFp) GO(DES_string_to_2keys, vFppp) GO(DES_string_to_key, vFpp) GO(DES_xcbc_encrypt, vFpplppppi) -//GO(DH_check, +GO(DH_bits, iFp) +GO(DH_check, iFpp) //GO(DH_check_pub_key, //GO(DH_compute_key, //GO(DH_compute_key_padded, @@ -1158,6 +1169,7 @@ GO(DH_free, vFp) //GO(DH_generate_key, //GO(DH_generate_parameters, //GO(DH_generate_parameters_ex, +GO(DH_get0_pqg, vFpppp) //GO(DH_get_1024_160, //GO(DH_get_2048_224, //GO(DH_get_2048_256, @@ -1176,8 +1188,8 @@ GO(DH_new, pFv) //GO(DH_set_method, //GO(DH_size, //GO(DH_up_ref, -//GO(DIRECTORYSTRING_free, -//GO(DIRECTORYSTRING_new, +GO(DIRECTORYSTRING_free, vFp) +GO(DIRECTORYSTRING_new, pFv) GO(DISPLAYTEXT_free, vFp) GO(DISPLAYTEXT_new, pFv) //GO(DIST_POINT_free, @@ -1185,6 +1197,7 @@ GO(DISPLAYTEXT_new, pFv) //GO(DIST_POINT_NAME_new, //GO(DIST_POINT_new, //GO(DIST_POINT_set_dpname, +GO(DSA_bits, iFp) //GO(dsa_builtin_paramgen, //GO(dsa_builtin_paramgen2, //GO(DSA_do_sign, @@ -1214,9 +1227,9 @@ GO(DSA_set0_pqg, iFppp) //GO(DSA_set_default_method, //GO(DSA_set_ex_data, //GO(DSA_set_method, -//GO(DSA_SIG_free, +GO(DSA_SIG_free, vFp) GO(DSA_sign, iFipippp) -//GO(DSA_SIG_new, +GO(DSA_SIG_new, pFv) //GO(DSA_sign_setup, GO(DSA_size, iFp) GO(DSA_up_ref, iFp) @@ -1283,6 +1296,7 @@ GO(ECDSA_do_verify, iFpipp) //GO(ECDSA_set_method, GO(ECDSA_SIG_free, vFp) GO(ECDSA_sign, iFipippp) +GO(DSA_SIG_set0, iFppp) GO(ECDSA_SIG_get0, vFppp) GO(ECDSA_SIG_new, pFv) GO(ECDSA_SIG_set0, iFppp) @@ -1408,6 +1422,7 @@ GO(EC_GROUP_get_seed_len, LFp) GO(EC_GROUP_method_of, pFp) GO(EC_GROUP_new, pFp) GO(EC_GROUP_new_by_curve_name, pFi) +GO(EC_GROUP_new_by_curve_name_ex, pFppi) GO(EC_GROUP_new_curve_GF2m, pFpppp) GO(EC_GROUP_new_curve_GFp, pFpppp) GO(EC_GROUP_new_from_ecparameters, pFp) @@ -1472,16 +1487,16 @@ GO(EC_POINT_get_Jprojective_coordinates_GFp, iFpppppp) //GO(EC_POINT_hex2point, //GO(EC_POINT_invert, //GO(EC_POINT_is_at_infinity, -//GO(EC_POINT_is_on_curve, +GO(EC_POINT_is_on_curve, iFppp) //GO(EC_POINT_make_affine, GO(EC_POINT_method_of, pFp) GO(EC_POINT_mul, iFpppppp) GO(EC_POINT_new, pFp) -//GO(EC_POINT_oct2point, -//GO(EC_POINT_point2buf, +GO(EC_POINT_oct2point, iFpppLp) +//GO(EC_POINT_point2buf, //GO(EC_POINT_point2bn, //GO(EC_POINT_point2hex, -//GO(EC_POINT_point2oct, +GO(EC_POINT_point2oct, LFppipLp) GO(EC_POINT_set_affine_coordinates, iFppppp) GO(EC_POINT_set_affine_coordinates_GF2m, iFppppp) GO(EC_POINT_set_affine_coordinates_GFp, iFppppp) @@ -1662,42 +1677,43 @@ GO(ERR_func_error_string, pFu) GO(ERR_get_error, LFv) GO(ERR_get_error_line, LFpp) GO(ERR_get_error_line_data, LFpppp) +GO(ERR_get_error_all, LFppppp) //GO(ERR_get_err_state_table, //GO(ERR_get_implementation, //GO(ERR_get_next_error_library, //GO(ERR_get_state, //GO(ERR_get_string_table, GO(ERR_lib_error_string, pFu) -//GO(ERR_load_ASN1_strings, -//GO(ERR_load_BIO_strings, -//GO(ERR_load_BN_strings, -//GO(ERR_load_BUF_strings, -//GO(ERR_load_CMS_strings, -//GO(ERR_load_COMP_strings, -//GO(ERR_load_CONF_strings, +GO(ERR_load_ASN1_strings, iFv) +GO(ERR_load_BIO_strings, iFv) +GO(ERR_load_BN_strings, iFv) +GO(ERR_load_BUF_strings, iFv) +GO(ERR_load_CMS_strings, iFv) +GO(ERR_load_COMP_strings, iFv) +GO(ERR_load_CONF_strings, iFv) GO(ERR_load_crypto_strings, vFv) -GO(ERR_load_CRYPTO_strings, vFv) -//GO(ERR_load_DH_strings, -//GO(ERR_load_DSA_strings, +GO(ERR_load_CRYPTO_strings, iFv) +GO(ERR_load_DH_strings, iFv) +GO(ERR_load_DSA_strings, iFv) //GO(ERR_load_DSO_strings, //GO(ERR_load_ECDH_strings, //GO(ERR_load_ECDSA_strings, -//GO(ERR_load_EC_strings, -//GO(ERR_load_ENGINE_strings, -//GO(ERR_load_ERR_strings, -GO(ERR_load_EVP_strings, vFv) -//GO(ERR_load_OBJ_strings, -//GO(ERR_load_OCSP_strings, -//GO(ERR_load_PEM_strings, -//GO(ERR_load_PKCS12_strings, -GO(ERR_load_PKCS7_strings, vFv) -//GO(ERR_load_RAND_strings, -//GO(ERR_load_RSA_strings, +GO(ERR_load_EC_strings, iFv) +GO(ERR_load_ENGINE_strings, iFv) +GO(ERR_load_ERR_strings, iFv) +GO(ERR_load_EVP_strings, iFv) +GO(ERR_load_OBJ_strings, iFv) +GO(ERR_load_OCSP_strings, iFv) +GO(ERR_load_PEM_strings, iFv) +GO(ERR_load_PKCS12_strings, iFv) +GO(ERR_load_PKCS7_strings, iFv) +GO(ERR_load_RAND_strings, iFv) +GO(ERR_load_RSA_strings, iFv) //GO(ERR_load_strings, -//GO(ERR_load_TS_strings, -//GO(ERR_load_UI_strings, -//GO(ERR_load_X509_strings, -//GO(ERR_load_X509V3_strings, +GO(ERR_load_TS_strings, iFv) +GO(ERR_load_UI_strings, iFv) +GO(ERR_load_X509_strings, iFv) +GO(ERR_load_X509V3_strings, iFv) GO(ERR_new, vFv) GO(ERR_peek_error, LFv) GO(ERR_peek_error_line, LFpp) @@ -1705,10 +1721,10 @@ GO(ERR_peek_error_line_data, LFpppp) GO(ERR_peek_last_error, LFv) GO(ERR_peek_last_error_line, LFpp) GO(ERR_peek_last_error_line_data, LFpppp) -//GO(ERR_pop_to_mark, +GO(ERR_pop_to_mark, iFp) //GO(ERR_print_errors, -//GO(ERR_print_errors_cb, -//GO(ERR_print_errors_fp, +GOM(ERR_print_errors_cb, vFEpp) +GO(ERR_print_errors_fp, iFp) GO(ERR_put_error, vFiiipi) GO(ERR_reason_error_string, pFu) //GO(ERR_release_err_state_table, @@ -1719,7 +1735,7 @@ GOM(ERR_set_error, vFEiipV) GOM(ERR_vset_error, vFEiipA) //GO(ERR_set_error_data, //GO(ERR_set_implementation, -//GO(ERR_set_mark, +GO(ERR_set_mark, iFp) //GO(ERR_unload_strings, //GO(ESS_CERT_ID_dup, //GO(ESS_CERT_ID_free, @@ -1730,9 +1746,9 @@ GOM(ERR_vset_error, vFEiipA) //GO(ESS_SIGNING_CERT_dup, //GO(ESS_SIGNING_CERT_free, //GO(ESS_SIGNING_CERT_new, -//GO(EVP_add_alg_module, -//GO(EVP_add_cipher, -//GO(EVP_add_digest, +GO(EVP_add_alg_module, vFv) +GO(EVP_add_cipher, iFp) +GO(EVP_add_digest, iFp) GO(EVP_aes_128_cbc, pFv) GO(EVP_aes_128_cbc_hmac_sha1, pFv) GO(EVP_aes_128_cbc_hmac_sha256, pFv) @@ -1744,6 +1760,7 @@ GO(EVP_aes_128_cfb8, pFv) GO(EVP_aes_128_ctr, pFv) GO(EVP_aes_128_ecb, pFv) GO(EVP_aes_128_gcm, pFv) +GO(EVP_aes_128_ocb, pFv) GO(EVP_aes_128_ofb, pFv) GO(EVP_aes_128_wrap, pFv) GO(EVP_aes_128_xts, pFv) @@ -1756,6 +1773,7 @@ GO(EVP_aes_192_cfb8, pFv) GO(EVP_aes_192_ctr, pFv) GO(EVP_aes_192_ecb, pFv) GO(EVP_aes_192_gcm, pFv) +GO(EVP_aes_192_ocb, pFv) GO(EVP_aes_192_ofb, pFv) GO(EVP_aes_192_wrap, pFv) GO(EVP_aes_256_cbc, pFv) @@ -1769,52 +1787,57 @@ GO(EVP_aes_256_cfb8, pFv) GO(EVP_aes_256_ctr, pFv) GO(EVP_aes_256_ecb, pFv) GO(EVP_aes_256_gcm, pFv) -//GO(EVP_aes_256_ofb, -//GO(EVP_aes_256_wrap, -//GO(EVP_aes_256_xts, -//GO(EVP_bf_cbc, +GO(EVP_aes_256_ocb, pFv) +GO(EVP_aes_256_ofb, pFv) +GO(EVP_aes_256_wrap, pFv) +GO(EVP_aes_256_xts, pFv) +GO(EVP_bf_cbc, pFv) //GO(EVP_bf_cfb, -//GO(EVP_bf_cfb64, -//GO(EVP_bf_ecb, -//GO(EVP_bf_ofb, -//GO(EVP_BytesToKey, -//GO(EVP_camellia_128_cbc, -//GO(EVP_camellia_128_cfb1, -//GO(EVP_camellia_128_cfb128, -//GO(EVP_camellia_128_cfb8, -//GO(EVP_camellia_128_ecb, -//GO(EVP_camellia_128_ofb, -//GO(EVP_camellia_192_cbc, -//GO(EVP_camellia_192_cfb1, -//GO(EVP_camellia_192_cfb128, -//GO(EVP_camellia_192_cfb8, -//GO(EVP_camellia_192_ecb, -//GO(EVP_camellia_192_ofb, -//GO(EVP_camellia_256_cbc, -//GO(EVP_camellia_256_cfb1, -//GO(EVP_camellia_256_cfb128, -//GO(EVP_camellia_256_cfb8, -//GO(EVP_camellia_256_ecb, -//GO(EVP_camellia_256_ofb, -//GO(EVP_cast5_cbc, +GO(EVP_bf_cfb64, pFv) +GO(EVP_bf_ecb, pFv) +GO(EVP_bf_ofb, pFv) +GO(EVP_BytesToKey, iFppppiipp) +GO(EVP_camellia_128_cbc, pFv) +GO(EVP_camellia_128_cfb1, pFv) +GO(EVP_camellia_128_cfb128, pFv) +GO(EVP_camellia_128_cfb8, pFv) +GO(EVP_camellia_128_ecb, pFv) +GO(EVP_camellia_128_ofb, pFv) +GO(EVP_camellia_192_cbc, pFv) +GO(EVP_camellia_192_cfb1, pFv) +GO(EVP_camellia_192_cfb128, pFv) +GO(EVP_camellia_192_cfb8, pFv) +GO(EVP_camellia_192_ecb, pFv) +GO(EVP_camellia_192_ofb, pFv) +GO(EVP_camellia_256_cbc, pFv) +GO(EVP_camellia_256_cfb1, pFv) +GO(EVP_camellia_256_cfb128, pFv) +GO(EVP_camellia_256_cfb8, pFv) +GO(EVP_camellia_256_ecb, pFv) +GO(EVP_camellia_256_ofb, pFv) +GO(EVP_cast5_cbc, pFv) //GO(EVP_cast5_cfb, -//GO(EVP_cast5_cfb64, -//GO(EVP_cast5_ecb, -//GO(EVP_cast5_ofb, +GO(EVP_cast5_cfb64, pFv) +GO(EVP_cast5_ecb, pFv) +GO(EVP_cast5_ofb, pFv) GO(EVP_chacha20, pFv) GO(EVP_chacha20_poly1305, pFv) -//GO(EVP_Cipher, +GO(EVP_Cipher, iFpppu) GO(EVP_CIPHER_asn1_to_param, iFpp) //GO(EVP_CIPHER_block_size, //GO(EVP_CIPHER_CTX_block_size, -//GO(EVP_CIPHER_CTX_cipher, +GO(EVP_CIPHER_CTX_cipher, pFp) GO(EVP_CIPHER_CTX_cleanup, iFp) -//GO(EVP_CIPHER_CTX_clear_flags, -//GO(EVP_CIPHER_CTX_copy, +GO(EVP_CIPHER_CTX_clear_flags, vFpi) +GO(EVP_CIPHER_CTX_copy, iFpp) GO(EVP_CIPHER_CTX_ctrl, iFpiip) //GO(EVP_CIPHER_CTX_flags, GO(EVP_CIPHER_CTX_free, vFp) -//GO(EVP_CIPHER_CTX_get_app_data, +GO(EVP_CIPHER_CTX_get0_cipher, pFp) +GO(EVP_CIPHER_CTX_get_app_data, pFp) +GO(EVP_CIPHER_CTX_get_block_size, iFp) +GO(EVP_CIPHER_CTX_get_iv_length, iFp) +GO(EVP_CIPHER_CTX_get_key_length, iFp) GO(EVP_CIPHER_CTX_get_original_iv, iFppL) GO(EVP_CIPHER_CTX_get_updated_iv, iFppL) GO(EVP_CIPHER_CTX_init, vFp) @@ -1822,33 +1845,38 @@ GO(EVP_CIPHER_CTX_init, vFp) //GO(EVP_CIPHER_CTX_key_length, GO(EVP_CIPHER_CTX_new, pFv) //GO(EVP_CIPHER_CTX_nid, -//GO(EVP_CIPHER_CTX_rand_key, +GO(EVP_CIPHER_CTX_rand_key, iFpp) GO(EVP_CIPHER_CTX_reset, iFp) -//GO(EVP_CIPHER_CTX_set_app_data, -//GO(EVP_CIPHER_CTX_set_flags, +GO(EVP_CIPHER_CTX_set_app_data, vFpp) +GO(EVP_CIPHER_CTX_set_flags, vFpi) GO(EVP_CIPHER_CTX_set_key_length, iFpi) GO(EVP_CIPHER_CTX_set_padding, iFpi) -//GO(EVP_CIPHER_CTX_test_flags, -//GO(EVP_CIPHER_do_all, -//GO(EVP_CIPHER_do_all_sorted, +GO(EVP_CIPHER_CTX_test_flags, iFpi) +//GOM(EVP_CIPHER_do_all, vFEpp) +//GOM(EVP_CIPHER_do_all_sorted, vFEpp) GO(EVP_CipherFinal, iFppp) GO(EVP_CipherFinal_ex, iFppp) //GO(EVP_CIPHER_flags, -//GO(EVP_CIPHER_get_asn1_iv, +GO(EVP_CIPHER_fetch, pFppp) +GO(EVP_CIPHER_free, vFp) +GO(EVP_CIPHER_get_asn1_iv, iFpp) +GO(EVP_CIPHER_get_iv_length, iFp) +GO(EVP_CIPHER_get_key_length, iFp) GO(EVP_CipherInit, iFppppi) GO(EVP_CipherInit_ex, iFpppppi) +GO(EVP_CipherInit_ex2, iFppppip) //GO(EVP_CIPHER_iv_length, //GO(EVP_CIPHER_key_length, //GO(EVP_CIPHER_nid, GO(EVP_CIPHER_param_to_asn1, iFpp) -//GO(EVP_CIPHER_set_asn1_iv, +GO(EVP_CIPHER_set_asn1_iv, iFpp) GO(EVP_CIPHER_type, iFp) GO(EVP_CipherUpdate, iFppppi) GO(EVP_cleanup, vFv) GO(EVP_DecodeBlock, iFppi) -//GO(EVP_DecodeFinal, -//GO(EVP_DecodeInit, -//GO(EVP_DecodeUpdate, +GO(EVP_DecodeFinal, iFppp) +GO(EVP_DecodeInit, vFp) +GO(EVP_DecodeUpdate, iFppppi) GO(EVP_DecryptFinal, iFppp) GO(EVP_DecryptFinal_ex, iFppp) GO(EVP_DecryptInit, iFpppp) @@ -1876,9 +1904,9 @@ GO(EVP_des_ede_cfb, pFv) GO(EVP_des_ede_cfb64, pFv) GO(EVP_des_ede_ecb, pFv) GO(EVP_des_ede_ofb, pFv) -//GO(EVP_des_ofb, -//GO(EVP_desx_cbc, -//GO(EVP_Digest, +GO(EVP_des_ofb, pFv) +GO(EVP_desx_cbc, pFv) +GO(EVP_Digest, iFpLpppp) GO(EVP_DigestFinal, iFppp) GO(EVP_DigestFinalXOF, iFppL) GO(EVP_DigestFinal_ex, iFppp) @@ -1887,18 +1915,20 @@ GO(EVP_DigestInit_ex, iFppp) GO(EVP_DigestSign, iFppppL) GO(EVP_DigestSignFinal, iFppp) GO(EVP_DigestSignInit, iFppppp) +GO(EVP_DigestSignUpdate, iFppL) GO(EVP_DigestUpdate, iFppL) GO(EVP_DigestVerify, iFppLpL) -//GO(EVP_DigestVerifyFinal, +GO(EVP_DigestVerifyUpdate, iFppL) +GO(EVP_DigestVerifyFinal, iFppL) GO(EVP_DigestVerifyInit, iFppppp) //GO(EVP_dss, //GO(EVP_dss1, //GO(EVP_ecdsa, -//GO(EVP_enc_null, +GO(EVP_enc_null, pFv) GO(EVP_EncodeBlock, iFppi) -//GO(EVP_EncodeFinal, -//GO(EVP_EncodeInit, -//GO(EVP_EncodeUpdate, +GO(EVP_EncodeFinal, vFppp) +GO(EVP_EncodeInit, vFp) +GO(EVP_EncodeUpdate, iFppppi) GO(EVP_EncryptFinal, iFppp) GO(EVP_EncryptFinal_ex, iFppp) GO(EVP_EncryptInit, iFpppp) @@ -1906,12 +1936,16 @@ GO(EVP_EncryptInit_ex, iFppppp) GO(EVP_EncryptUpdate, iFppppi) GO(EVP_get_cipherbyname, pFp) GO(EVP_get_digestbyname, pFp) -//GO(EVP_get_pw_prompt, +GO(EVP_get_pw_prompt, pFv) //GO(EVP_idea_cbc, -//GO(EVP_idea_cfb, -//GO(EVP_idea_cfb64, +GO(EVP_idea_cfb64, pFv) //GO(EVP_idea_ecb, //GO(EVP_idea_ofb, +GO(EVP_KDF_CTX_free, vFp) +GO(EVP_KDF_CTX_new, pFp) +GO(EVP_KDF_derive, iFppLp) +GO(EVP_KDF_fetch, pFppp) +GO(EVP_KDF_free, vFp) GO(EVP_MAC_CTX_free, vFp) GO(EVP_MAC_CTX_new, pFp) GO(EVP_MAC_fetch, pFppp) @@ -1928,7 +1962,7 @@ GO(EVP_MD_CTX_clear_flags, vFpi) GO(EVP_MD_CTX_copy, iFpp) GO(EVP_MD_CTX_copy_ex, iFpp) GO(EVP_MD_CTX_create, pFv) -GO(EVP_MD_CTX_ctrl, vFpiip) +GO(EVP_MD_CTX_ctrl, iFpiip) GO(EVP_MD_CTX_destroy, vFp) GO(EVP_MD_CTX_free, vFp) GO(EVP_MD_CTX_get0_md, pFp) @@ -1937,28 +1971,30 @@ GO(EVP_MD_CTX_md, pFp) GO(EVP_MD_CTX_new, pFv) GO(EVP_MD_CTX_reset, iFp) GO(EVP_MD_CTX_set_flags, vFpi) -//GO(EVP_MD_CTX_test_flags, -//GO(EVP_MD_do_all, +GO(EVP_MD_CTX_test_flags, iFpi) +//GOM(EVP_MD_do_all, vFEpp) GOM(EVP_MD_do_all_provided, vFEppp) -//GO(EVP_MD_do_all_sorted, +//GOM(EVP_MD_do_all_sorted, vFEpp) GO(EVP_MD_fetch, pFppp) //GO(EVP_MD_flags, GO(EVP_MD_free, vFp) +GO(EVP_MD_get0_name, pFp) GO(EVP_MD_get_block_size, iFp) GO(EVP_MD_get_flags, LFp) GO(EVP_MD_get_size, iFp) +GO(EVP_MD_CTX_get_size_ex, iFp) GO(EVP_MD_get_type, iFp) GO(EVP_md_null, pFv) GO(EVP_MD_pkey_type, iFp) GO(EVP_MD_type, iFp) GO(EVP_MD_up_ref, iFp) -//GO(EVP_OpenFinal, -//GO(EVP_OpenInit, -//GO(EVP_PBE_alg_add, -//GO(EVP_PBE_alg_add_type, -//GO(EVP_PBE_CipherInit, -//GO(EVP_PBE_cleanup, -//GO(EVP_PBE_find, +GO(EVP_OpenFinal, iFppp) +GO(EVP_OpenInit, iFpppipp) +//GOM(EVP_PBE_alg_add, iFEippp) +//GOM(EVP_PBE_alg_add_type, iFEiiiip) +GO(EVP_PBE_CipherInit, iFppippi) +GO(EVP_PBE_cleanup, vFv) +//GOM(EVP_PBE_find, iFEiippp) GO(EVP_PBE_scrypt, iFpLpLUUUUpL) GO(EVP_PKCS82PKEY, pFp) GO(EVP_PKCS82PKEY_ex, pFppp) @@ -1968,27 +2004,28 @@ GO(EVP_PKEY2PKCS8, pFp) //GO(EVP_PKEY_add1_attr_by_NID, //GO(EVP_PKEY_add1_attr_by_OBJ, //GO(EVP_PKEY_add1_attr_by_txt, -//GO(EVP_PKEY_asn1_add0, -//GO(EVP_PKEY_asn1_add_alias, -//GO(EVP_PKEY_asn1_copy, -//GO(EVP_PKEY_asn1_find, -//GO(EVP_PKEY_asn1_find_str, -//GO(EVP_PKEY_asn1_free, -//GO(EVP_PKEY_asn1_get0, -//GO(EVP_PKEY_asn1_get0_info, -//GO(EVP_PKEY_asn1_get_count, -//GO(EVP_PKEY_asn1_new, -//GO(EVP_PKEY_asn1_set_ctrl, -//GO(EVP_PKEY_asn1_set_free, -//GO(EVP_PKEY_asn1_set_item, -//GO(EVP_PKEY_asn1_set_param, -//GO(EVP_PKEY_asn1_set_private, -//GO(EVP_PKEY_asn1_set_public, +GO(EVP_PKEY_asn1_add0, iFp) +GO(EVP_PKEY_asn1_add_alias, iFii) +GO(EVP_PKEY_asn1_copy, vFpp) +GO(EVP_PKEY_asn1_find, pFpi) +GO(EVP_PKEY_asn1_find_str, pFppi) +GO(EVP_PKEY_asn1_free, vFp) +GO(EVP_PKEY_asn1_get0, pFi) +GO(EVP_PKEY_asn1_get0_info, iFpppppp) +GO(EVP_PKEY_asn1_get_count, iFv) +GO(EVP_PKEY_asn1_new, pFiipp) +//GOM(EVP_PKEY_asn1_set_ctrl, vFEpp) +//GOM(EVP_PKEY_asn1_set_free, vFEpp) +//GOM(EVP_PKEY_asn1_set_item, vFEppp) +//GOM(EVP_PKEY_asn1_set_param, vFEppppppp) +//GOM(EVP_PKEY_asn1_set_private, vFEpppp) +//GOM(EVP_PKEY_asn1_set_public, vFEppppppp) GO(EVP_PKEY_assign, iFpip) //GO(EVP_PKEY_base_id, //GO(EVP_PKEY_bits, GO(EVP_PKEY_cmp, iFpp) GO(EVP_PKEY_cmp_parameters, iFpp) +GO(EVP_PKEY_eq, iFpp) GO(EVP_PKEY_copy_parameters, iFpp) GO(EVP_PKEY_CTX_ctrl, iFpiiiip) GO(EVP_PKEY_CTX_ctrl_str, iFppp) @@ -1997,16 +2034,19 @@ GO(EVP_PKEY_CTX_free, vFp) GO(EVP_PKEY_CTX_get0_peerkey, pFp) GO(EVP_PKEY_CTX_get0_pkey, pFp) GO(EVP_PKEY_CTX_get_app_data, pFp) -//GO(EVP_PKEY_CTX_get_cb, -//GO(EVP_PKEY_CTX_get_data, +//GOM(EVP_PKEY_CTX_get_cb, pFEp) +GO(EVP_PKEY_CTX_get_data, pFp) GO(EVP_PKEY_CTX_get_keygen_info, iFpi) -//GO(EVP_PKEY_CTX_get_operation, +GO(EVP_PKEY_CTX_get_operation, iFp) GO(EVP_PKEY_CTX_new, pFpp) GO(EVP_PKEY_CTX_new_id, pFip) -//GO(EVP_PKEY_CTX_set0_keygen_info, +GO(EVP_PKEY_CTX_new_from_name, pFppp) +GO(EVP_PKEY_CTX_new_from_pkey, pFppp) +GO(EVP_PKEY_CTX_set0_keygen_info, vFppi) GO(EVP_PKEY_CTX_set_app_data, vFpp) -//GO(EVP_PKEY_CTX_set_cb, -//GO(EVP_PKEY_CTX_set_data, +//GOM(EVP_PKEY_CTX_set_cb, vFEpp) +GO(EVP_PKEY_CTX_set_data, vFpp) +GO(EVP_PKEY_CTX_set_params, iFpp) GO(EVP_PKEY_CTX_set_rsa_keygen_bits, iFpi) GO(EVP_PKEY_CTX_set_rsa_oaep_md, iFpp) GO(EVP_PKEY_CTX_set_rsa_padding, iFpi) @@ -2015,19 +2055,23 @@ GO(EVP_PKEY_CTX_set_signature_md, iFpp) GO(EVP_PKEY_check, iFp) GO(EVP_PKEY_decrypt, iFppppL) GO(EVP_PKEY_decrypt_init, iFp) -//GO(EVP_PKEY_decrypt_old, +GO(EVP_PKEY_decrypt_old, iFppip) //GO(EVP_PKEY_delete_attr, GO(EVP_PKEY_derive, iFppp) GO(EVP_PKEY_derive_init, iFp) -GO(EVP_PKEY_derive_set_peer, iFppi) +GO(EVP_PKEY_derive_set_peer, iFpp) GO(EVP_PKEY_encrypt, iFppppL) GO(EVP_PKEY_encrypt_init, iFp) -//GO(EVP_PKEY_encrypt_old, +GO(EVP_PKEY_encrypt_old, iFppip) GO(EVP_PKEY_free, vFp) -//GO(EVP_PKEY_get0, -//GO(EVP_PKEY_get0_asn1, +GO(EVP_PKEY_fromdata_init, iFp) +GO(EVP_PKEY_fromdata, iFppip) +GO(EVP_PKEY_todata, iFpip) +GO(EVP_PKEY_get0, pFp) +GO(EVP_PKEY_get0_asn1, pFp) GO(EVP_PKEY_get0_RSA, pFp) -//GO(EVP_PKEY_get1_DH, +GO(EVP_PKEY_get0_type_name, pFp) +GO(EVP_PKEY_get1_DH, pFp) GO(EVP_PKEY_get1_DSA, pFp) GO(EVP_PKEY_get1_EC_KEY, pFp) GO(EVP_PKEY_get1_RSA, pFp) @@ -2036,61 +2080,72 @@ GO(EVP_PKEY_get1_RSA, pFp) //GO(EVP_PKEY_get_attr_by_OBJ, //GO(EVP_PKEY_get_attr_count, GO(EVP_PKEY_get_base_id, iFp) -//GO(EVP_PKEY_get_default_digest_nid, +GO(EVP_PKEY_get_id, iFp) +GO(EVP_PKEY_get_security_bits, iFp) +GO(EVP_PKEY_get_bits, iFp) +GO(EVP_PKEY_get_default_digest_nid, iFpp) +GO(EVP_PKEY_get_group_name, iFppLp) +GO(EVP_PKEY_CTX_set0_rsa_oaep_label, iFppi) +GO(EVP_PKEY_CTX_set_ec_paramgen_curve_nid, iFpi) +GO(EVP_PKEY_get_bn_param, iFppp) +GO(EVP_PKEY_get_utf8_string_param, iFppppL) GO(EVP_PKEY_get_raw_private_key, iFppp) GO(EVP_PKEY_get_raw_public_key, iFppp) -GO(EVP_PKEY_new_raw_private_key, pFppppL) +GO(EVP_PKEY_new_raw_private_key, pFippL) GO(EVP_PKEY_new_raw_public_key, pFippL) GO(EVP_PKEY_get_size, iFp) //GO(EVP_PKEY_id, GO(EVP_PKEY_keygen, iFpp) +GO(EVP_PKEY_generate, iFpp) GO(EVP_PKEY_keygen_init, iFp) -//GO(EVP_PKEY_meth_add0, -//GO(EVP_PKEY_meth_copy, -//GO(EVP_PKEY_meth_find, -//GO(EVP_PKEY_meth_free, -//GO(EVP_PKEY_meth_get0_info, -//GO(EVP_PKEY_meth_new, -//GO(EVP_PKEY_meth_set_cleanup, -//GO(EVP_PKEY_meth_set_copy, -//GO(EVP_PKEY_meth_set_ctrl, -//GO(EVP_PKEY_meth_set_decrypt, -//GO(EVP_PKEY_meth_set_derive, -//GO(EVP_PKEY_meth_set_encrypt, -//GO(EVP_PKEY_meth_set_init, -//GO(EVP_PKEY_meth_set_keygen, -//GO(EVP_PKEY_meth_set_paramgen, -//GO(EVP_PKEY_meth_set_sign, -//GO(EVP_PKEY_meth_set_signctx, -//GO(EVP_PKEY_meth_set_verify, -//GO(EVP_PKEY_meth_set_verifyctx, -//GO(EVP_PKEY_meth_set_verify_recover, +GO(EVP_PKEY_meth_add0, iFp) +GO(EVP_PKEY_meth_copy, vFpp) +GO(EVP_PKEY_meth_find, pFi) +GO(EVP_PKEY_meth_free, vFp) +GO(EVP_PKEY_meth_get0_info, vFppp) +GO(EVP_PKEY_meth_new, pFii) +//GOM(EVP_PKEY_meth_set_cleanup, vFEpp) +//GOM(EVP_PKEY_meth_set_copy, vFEpp) +//GOM(EVP_PKEY_meth_set_ctrl, vFEppp) +//GOM(EVP_PKEY_meth_set_decrypt, vFEppp) +//GOM(EVP_PKEY_meth_set_derive, vFEppp) +//GOM(EVP_PKEY_meth_set_encrypt, vFEppp) +//GOM(EVP_PKEY_meth_set_init, vFEpp) +//GOM(EVP_PKEY_meth_set_keygen, vFEppp) +//GOM(EVP_PKEY_meth_set_paramgen, vFEppp) +//GOM(EVP_PKEY_meth_set_sign, vFEppp) +//GOM(EVP_PKEY_meth_set_signctx, vFEppp) +//GOM(EVP_PKEY_meth_set_verify, vFEppp) +//GOM(EVP_PKEY_meth_set_verifyctx, vFEppp) +//GOM(EVP_PKEY_meth_set_verify_recover, vFEppp) GO(EVP_PKEY_missing_parameters, iFp) GO(EVP_PKEY_new, pFv) GO(EVP_PKEY_new_mac_key, pFippi) +GO(EVP_PKEY_Q_keygen, pFpppL) +GO(EVP_PKEY_param_check, iFp) GO(EVP_PKEY_paramgen, iFpp) GO(EVP_PKEY_paramgen_init, iFp) -//GO(EVP_PKEY_print_params, -//GO(EVP_PKEY_print_private, -//GO(EVP_PKEY_print_public, +GO(EVP_PKEY_print_params, iFppip) +GO(EVP_PKEY_print_private, iFppip) +GO(EVP_PKEY_print_public, iFppip) GO(EVP_PKEY_public_check, iFp) -//GO(EVP_PKEY_save_parameters, -//GO(EVP_PKEY_set1_DH, +GO(EVP_PKEY_save_parameters, iFpi) +GO(EVP_PKEY_set1_DH, iFpp) GO(EVP_PKEY_set1_DSA, iFpp) GO(EVP_PKEY_set1_EC_KEY, iFpp) GO(EVP_PKEY_set1_RSA, iFpp) //GO(evp_pkey_set_cb_translate, -//GO(EVP_PKEY_set_type, -//GO(EVP_PKEY_set_type_str, -GO(EVP_PKEY_sign, iFppppp) +GO(EVP_PKEY_set_type, iFpi) +GO(EVP_PKEY_set_type_str, iFppi) +GO(EVP_PKEY_sign, iFppppL) GO(EVP_PKEY_sign_init, iFp) //GO(EVP_PKEY_size, GO(EVP_PKEY_type, iFi) GO(EVP_PKEY_up_ref, iFp) GO(EVP_PKEY_verify, iFppLpL) GO(EVP_PKEY_verify_init, iFp) -//GO(EVP_PKEY_verify_recover, -//GO(EVP_PKEY_verify_recover_init, +GO(EVP_PKEY_verify_recover, iFppppL) +GO(EVP_PKEY_verify_recover_init, iFp) GO(EVP_rc2_40_cbc, pFv) GO(EVP_rc2_64_cbc, pFv) GO(EVP_rc2_cbc, pFv) @@ -2098,32 +2153,34 @@ GO(EVP_rc2_cfb, pFv) GO(EVP_rc2_cfb64, pFv) GO(EVP_rc2_ecb, pFv) GO(EVP_rc2_ofb, pFv) -//GO(EVP_rc4, -//GO(EVP_rc4_40, -//GO(EVP_rc4_hmac_md5, -//GO(EVP_read_pw_string, -//GO(EVP_read_pw_string_min, -GO(EVP_ripemd160, pFp) -//GO(EVP_SealFinal, -//GO(EVP_SealInit, -//GO(EVP_seed_cbc, -//GO(EVP_seed_cfb128, -//GO(EVP_seed_ecb, -//GO(EVP_seed_ofb, -//GO(EVP_set_pw_prompt, +GO(EVP_rc4, pFv) +GO(EVP_rc4_40, pFv) +GO(EVP_rc4_hmac_md5, pFv) +GO(EVP_read_pw_string, iFpipi) +GO(EVP_read_pw_string_min, iFpiipi) +GO(EVP_ripemd160, pFv) +GO(EVP_SealFinal, iFppp) +GO(EVP_SealInit, iFppppppi) +GO(EVP_seed_cbc, pFv) +GO(EVP_seed_cfb128, pFv) +GO(EVP_seed_ecb, pFv) +GO(EVP_seed_ofb, pFv) +GO(EVP_set_pw_prompt, vFp) GO(EVP_sha, pFV) GO(EVP_sha1, pFv) GO(EVP_sha224, pFv) GO(EVP_sha256, pFv) GO(EVP_sha384, pFv) GO(EVP_sha512, pFv) -//GO(EVP_SignFinal, +GO(EVP_sha512_256, pFv) +GO(EVP_SignFinal, iFpppp) GO(EVP_VerifyFinal, iFppup) -GO(EVP_VerifyInit, iFpp) // 1.1.0+ -GO(EVP_VerifyInit_ex, iFppp) // 1.1.0+ -GO(EVP_VerifyUpdate, iFppu) // 1.1.0+ -//GO(EVP_whirlpool, +GO(EVP_VerifyInit, iFpp) +GO(EVP_VerifyInit_ex, iFppp) +GO(EVP_VerifyUpdate, iFppu) +GO(EVP_whirlpool, pFv) GO(EXTENDED_KEY_USAGE_free, vFp) +GO(EXTENDED_KEY_USAGE_it, pFv) //GO(EXTENDED_KEY_USAGE_new, //GO(fcrypt_body, //GO(_fini, @@ -2147,6 +2204,7 @@ GO(GENERAL_NAME_print, iFpp) //GO(GENERAL_NAME_set0_othername, //GO(GENERAL_NAME_set0_value, GO(GENERAL_NAMES_free, vFp) +GO(GENERAL_NAMES_it, pFv) GO(GENERAL_NAMES_new, pFv) GO(GENERAL_SUBTREE_free, vFp) GO(GENERAL_SUBTREE_new, pFv) @@ -2195,9 +2253,9 @@ GO(i2d_ASN1_INTEGER, iFpp) GO(i2d_ASN1_NULL, iFpp) GO(i2d_ASN1_OBJECT, iFpp) GO(i2d_ASN1_OCTET_STRING, iFpp) -//GO(i2d_ASN1_PRINTABLE, +GO(i2d_ASN1_PRINTABLE, iFpp) GO(i2d_ASN1_PRINTABLESTRING, iFpp) -//GO(i2d_ASN1_SEQUENCE_ANY, +GO(i2d_ASN1_SEQUENCE_ANY, iFpp) //GO(i2d_ASN1_SET, GO(i2d_ASN1_SET_ANY, iFpp) GO(i2d_ASN1_T61STRING, iFpp) @@ -2218,7 +2276,7 @@ GO(i2d_CMS_bio, iFpp) //GO(i2d_CRL_DIST_POINTS, GO(i2d_DHparams, iFpp) //GO(i2d_DHxparams, -//GO(i2d_DIRECTORYSTRING, +GO(i2d_DIRECTORYSTRING, iFpp) GO(i2d_DISPLAYTEXT, iFpp) //GO(i2d_DIST_POINT, //GO(i2d_DIST_POINT_NAME, @@ -2230,8 +2288,8 @@ GO(i2d_DSA_PUBKEY, iFpp) GO(i2d_DSA_PUBKEY_bio, iFpp) GO(i2d_DSA_PUBKEY_fp, iFpp) //GO(i2d_DSAPublicKey, -//GO(i2d_DSA_SIG, -//GO(i2d_ECDSA_SIG, +GO(i2d_DSA_SIG, iFpp) +GO(i2d_ECDSA_SIG, iFpp) //GO(i2d_ECParameters, //GO(i2d_ECPKParameters, //GO(i2d_ECPKPARAMETERS, @@ -2331,7 +2389,7 @@ GO(i2d_PROXY_POLICY, iFpp) GO(i2d_PUBKEY, iFpp) GO(i2d_PUBKEY_bio, iFpp) GO(i2d_PUBKEY_fp, iFpp) -//GO(i2d_PublicKey, +GO(i2d_PublicKey, iFpp) //GO(i2d_re_X509_tbs, GO(i2d_RSA_NET, iFpp) GO(i2d_RSA_OAEP_PARAMS, iFpp) @@ -2395,9 +2453,9 @@ GO(i2d_X509_VAL, iFpp) //GO(i2s_ASN1_INTEGER, //GO(i2s_ASN1_OCTET_STRING, GO(i2t_ASN1_OBJECT, iFpip) -//GO(i2v_ASN1_BIT_STRING, -//GO(i2v_GENERAL_NAME, -//GO(i2v_GENERAL_NAMES, +GO(i2v_ASN1_BIT_STRING, pFppp) +GO(i2v_GENERAL_NAME, pFppp) +GO(i2v_GENERAL_NAMES, pFppp) //GO(idea_cbc_encrypt, //GO(idea_cfb64_encrypt, //GO(idea_ecb_encrypt, @@ -2409,6 +2467,7 @@ GO(i2t_ASN1_OBJECT, iFpip) //GO(_init, //GO(int_rsa_verify, //GO(ISSUING_DIST_POINT_free, +GO(ISSUING_DIST_POINT_it, pFv) //GO(ISSUING_DIST_POINT_new, //GO(KRB5_APREQBODY_free, //GO(KRB5_APREQBODY_new, @@ -2504,33 +2563,33 @@ GO(NETSCAPE_X509_new, pFv) //GO(NOTICEREF_free, //GO(NOTICEREF_new, //GO(o2i_ECPublicKey, -//GO(OBJ_add_object, -//GO(OBJ_add_sigid, -//GO(OBJ_bsearch_, -//GO(OBJ_bsearch_ex_, +GO(OBJ_add_object, iFp) +GO(OBJ_add_sigid, iFiii) +//GOM(OBJ_bsearch_, pFEppiip) +//GOM(OBJ_bsearch_ex_, pFEppiipi) GO(OBJ_cleanup, vFv) GO(OBJ_cmp, iFpp) GO(OBJ_create, iFppp) -//GO(OBJ_create_objects, +GO(OBJ_create_objects, iFp) GO(OBJ_dup, pFp) -//GO(OBJ_find_sigid_algs, -//GO(OBJ_find_sigid_by_algs, +GO(OBJ_find_sigid_algs, iFipp) +GO(OBJ_find_sigid_by_algs, iFpii) GO(OBJ_ln2nid, iFp) -//GO(OBJ_NAME_add, -//GO(OBJ_NAME_cleanup, -//GO(OBJ_NAME_do_all, -//GO(OBJ_NAME_do_all_sorted, -//GO(OBJ_NAME_get, -//GO(OBJ_NAME_init, -//GO(OBJ_NAME_new_index, -//GO(OBJ_NAME_remove, -//GO(OBJ_new_nid, +GO(OBJ_NAME_add, iFpip) +GO(OBJ_NAME_cleanup, vFi) +//GOM(OBJ_NAME_do_all, vFEipp) +//GOM(OBJ_NAME_do_all_sorted, vFEipp) +GO(OBJ_NAME_get, pFpi) +GO(OBJ_NAME_init, iFv) +//GOM(OBJ_NAME_new_index, iFEppp) +GO(OBJ_NAME_remove, iFpi) +GO(OBJ_new_nid, iFi) GO(OBJ_nid2ln, pFi) GO(OBJ_nid2obj, pFi) GO(OBJ_nid2sn, pFi) GO(OBJ_obj2nid, iFp) GO(OBJ_obj2txt, iFpipi) -//GO(OBJ_sigid_free, +GO(OBJ_sigid_free, vFv) GO(OBJ_sn2nid, iFp) GO(OBJ_txt2nid, iFp) GO(OBJ_txt2obj, pFpi) @@ -2538,7 +2597,7 @@ GO(OBJ_txt2obj, pFpi) //GO(OCSP_archive_cutoff_new, //GO(OCSP_basic_add1_cert, //GO(OCSP_basic_add1_nonce, -//GO(OCSP_basic_add1_status, +GO(OCSP_basic_add1_status, pFppiippp) //GO(OCSP_BASICRESP_add1_ext_i2d, //GO(OCSP_BASICRESP_add_ext, //GO(OCSP_BASICRESP_delete_ext, @@ -2549,8 +2608,8 @@ GO(OCSP_BASICRESP_free, vFp) //GO(OCSP_BASICRESP_get_ext_by_NID, //GO(OCSP_BASICRESP_get_ext_by_OBJ, //GO(OCSP_BASICRESP_get_ext_count, -//GO(OCSP_BASICRESP_new, -//GO(OCSP_basic_sign, +GO(OCSP_BASICRESP_new, pFv) +GO(OCSP_basic_sign, iFpppppL) GO(OCSP_basic_verify, iFpppL) //GO(OCSP_CERTID_dup, GO(OCSP_CERTID_free, vFp) @@ -2558,17 +2617,17 @@ GO(OCSP_CERTID_free, vFp) //GO(OCSP_CERTID_new, //GO(OCSP_CERTSTATUS_free, //GO(OCSP_CERTSTATUS_new, -//GO(OCSP_cert_status_str, +GO(OCSP_cert_status_str, pFl) GO(OCSP_cert_to_id, pFppp) GO(OCSP_check_nonce, iFpp) -//GO(OCSP_check_validity, +GO(OCSP_check_validity, iFppll) //GO(OCSP_copy_nonce, //GO(OCSP_CRLID_free, //GO(OCSP_crlID_new, //GO(OCSP_CRLID_new, -//GO(OCSP_crl_reason_str, -//GO(OCSP_id_cmp, -//GO(OCSP_id_get0_info, +GO(OCSP_crl_reason_str, pFl) +GO(OCSP_id_cmp, iFpp) +GO(OCSP_id_get0_info, iFppppp) //GO(OCSP_id_issuer_cmp, //GO(OCSP_ONEREQ_add1_ext_i2d, //GO(OCSP_ONEREQ_add_ext, @@ -2617,21 +2676,22 @@ GO(OCSP_REQUEST_new, pFv) //GO(OCSP_request_verify, //GO(OCSP_RESPBYTES_free, //GO(OCSP_RESPBYTES_new, -//GO(OCSP_resp_count, +GO(OCSP_resp_count, iFp) +GO(OCSP_resp_get0_certs, pFp) //GO(OCSP_RESPDATA_free, //GO(OCSP_RESPDATA_new, //GO(OCSP_resp_find, GO(OCSP_resp_find_status, iFppppppp) -//GO(OCSP_resp_get0, +GO(OCSP_resp_get0, pFpi) //GO(OCSP_RESPID_free, //GO(OCSP_RESPID_new, -//GO(OCSP_response_create, +GO(OCSP_response_create, pFip) GO(OCSP_RESPONSE_free, vFp) GO(OCSP_response_get1_basic, pFp) GO(OCSP_RESPONSE_new, pFv) //GO(OCSP_RESPONSE_print, -//GO(OCSP_response_status, -//GO(OCSP_response_status_str, +GO(OCSP_response_status, iFp) +GO(OCSP_response_status_str, pFl) //GO(OCSP_REVOKEDINFO_free, //GO(OCSP_REVOKEDINFO_new, //GO(OCSP_sendreq_bio, @@ -2642,11 +2702,12 @@ GO(OCSP_RESPONSE_new, pFv) //GO(OCSP_set_max_response_length, //GO(OCSP_SIGNATURE_free, //GO(OCSP_SIGNATURE_new, -//GO(OCSP_single_get0_status, +GO(OCSP_single_get0_status, iFppppp) //GO(OCSP_SINGLERESP_add1_ext_i2d, //GO(OCSP_SINGLERESP_add_ext, //GO(OCSP_SINGLERESP_delete_ext, //GO(OCSP_SINGLERESP_free, +GO(OCSP_SINGLERESP_get0_id, pFp) //GO(OCSP_SINGLERESP_get1_ext_d2i, //GO(OCSP_SINGLERESP_get_ext, //GO(OCSP_SINGLERESP_get_ext_by_critical, @@ -2671,25 +2732,26 @@ GO(OPENSSL_gmtime, pFpp) GO(OPENSSL_gmtime_adj, iFpil) GO(OPENSSL_gmtime_diff, iFpppp) //GO(OPENSSL_ia32cap_loc, -//GO(OPENSSL_init, -GO(OPENSSL_init_crypto, iFLp) +GO(OPENSSL_init, vFv) +GO(OPENSSL_init_crypto, iFUp) //GO(OPENSSL_instrument_bus, //GO(OPENSSL_instrument_bus2, -//GO(OPENSSL_isservice, -//GO(OPENSSL_issetugid, +GO(OPENSSL_isservice, iFv) +GO(OPENSSL_issetugid, iFv) //GO(OPENSSL_load_builtin_modules, //GO(OPENSSL_memcmp, GO(OPENSSL_no_config, vFv) -//GO(OPENSSL_rdtsc, +// GO(OPENSSL_rdtsc, +GOM(OPENSSL_sk_deep_copy, pFEppp) GO(OPENSSL_sk_find, iFpp) -GO(OPENSSL_sk_free, vFp) //1.1+ +GO(OPENSSL_sk_free, vFp) GOM(OPENSSL_sk_new, pFEp) -GO(OPENSSL_sk_new_null, pFv) //1.1+ -GO(OPENSSL_sk_num, iFp) //1.1+ -GO(OPENSSL_sk_pop, pFp) //1.1+ -GOM(OPENSSL_sk_pop_free, pFEpp) //1.1+ -GO(OPENSSL_sk_push, iFpp) //1.1+ -GO(OPENSSL_sk_value, pFpi) //1.1+ +GO(OPENSSL_sk_new_null, pFv) +GO(OPENSSL_sk_num, iFp) +GO(OPENSSL_sk_pop, pFp) +GOM(OPENSSL_sk_pop_free, vFEpp) +GO(OPENSSL_sk_push, iFpp) +GO(OPENSSL_sk_value, pFpi) //GO(OPENSSL_showfatal, //GO(OPENSSL_stderr, GO(OPENSSL_strcasecmp, iFpp) @@ -2736,7 +2798,41 @@ GO(OpenSSL_version_num, LFv) //GO(_ossl_old_des_string_to_2keys, //GO(_ossl_old_des_string_to_key, //GO(_ossl_old_des_xcbc_encrypt, +GO(OSSL_EC_curve_nid2name, pFi) +GO(OSSL_LIB_CTX_free, vFp) +GO(OSSL_LIB_CTX_new, pFv) +GO(OSSL_LIB_CTX_load_config, iFpp) +GO(OSSL_PARAM_BLD_free, vFp) +GO(OSSL_PARAM_BLD_new, pFv) +GO(OSSL_PARAM_BLD_push_BN, iFppp) +GO(OSSL_PARAM_BLD_push_octet_string, iFpppL) +GO(OSSL_PARAM_BLD_push_utf8_string, iFpppL) +GO(OSSL_PARAM_BLD_to_param, pFp) +GOM(OSSL_PARAM_construct_end, vFEp) +GOM(OSSL_PARAM_construct_int, vFEppp) +GOM(OSSL_PARAM_construct_octet_string, vFEpppL) +GOM(OSSL_PARAM_construct_uint, vFEppp) +GOM(OSSL_PARAM_construct_utf8_string, vFEpppL) +GO(OSSL_PARAM_free, vFp) +GO(OSSL_PARAM_get_BN, iFpp) +GO(OSSL_PARAM_get_octet_string_ptr, iFppp) +GO(OSSL_PARAM_locate, pFpp) +GO(OSSL_PARAM_locate_const, pFpp) +GO(OSSL_PARAM_merge, pFpp) +GO(OSSL_PROVIDER_available, iFpp) +GO(OSSL_PROVIDER_load, pFpp) +GO(OSSL_PROVIDER_unload, iFp) GO(OSSL_PROVIDER_try_load, pFppi) +GOM(OSSL_STORE_open, pFEppppp) +GOM(OSSL_STORE_open_ex, pFEpppppppp) +GO(OSSL_STORE_load, pFp) +GO(OSSL_STORE_close, iFp) +GO(OSSL_STORE_expect, iFpi) +GO(OSSL_STORE_INFO_get1_CERT, pFp) +GO(OSSL_STORE_INFO_get1_PKEY, pFp) +GO(OSSL_STORE_INFO_get1_PUBKEY, pFp) +GO(OSSL_STORE_INFO_get_type, iFp) +GO(OSSL_STORE_INFO_free, vFp) //GO(OTHERNAME_cmp, //GO(OTHERNAME_free, //GO(OTHERNAME_new, @@ -2760,7 +2856,7 @@ GO(OSSL_PROVIDER_try_load, pFppi) //GO(PEM_read, //GO(PEM_read_bio, //GO(PEM_read_bio_CMS, -//GO(PEM_read_bio_DHparams, +GOM(PEM_read_bio_DHparams, pFEpppp) //GO(PEM_read_bio_DSAparams, GOM(PEM_read_bio_DSAPrivateKey, pFEpppp) GOM(PEM_read_bio_DSA_PUBKEY, pFEpppp) @@ -2768,15 +2864,15 @@ GOM(PEM_read_bio_DSA_PUBKEY, pFEpppp) GOM(PEM_read_bio_ECPrivateKey, pFEpppp) GOM(PEM_read_bio_EC_PUBKEY, pFEpppp) //GO(PEM_read_bio_NETSCAPE_CERT_SEQUENCE, -//GO(PEM_read_bio_Parameters, +GO(PEM_read_bio_Parameters, pFpp) GOM(PEM_read_bio_PKCS7, pFEpppp) //GO(PEM_read_bio_PKCS8, //GO(PEM_read_bio_PKCS8_PRIV_KEY_INFO, -//GO(PEM_read_bio_PrivateKey, -//GO(PEM_read_bio_PUBKEY, +GOM(PEM_read_bio_PrivateKey, pFEpppp) +GOM(PEM_read_bio_PUBKEY, pFEpppp) GOM(PEM_read_bio_RSAPrivateKey, pFEpppp) GOM(PEM_read_bio_RSA_PUBKEY, pFEpppp) -//GO(PEM_read_bio_RSAPublicKey, +GOM(PEM_read_bio_RSAPublicKey, pFEpppp) GOM(PEM_read_bio_X509, pFEpppp) GOM(PEM_read_bio_X509_AUX, pFEpppp) GOM(PEM_read_bio_X509_CERT_PAIR, pFEpppp) @@ -2794,8 +2890,8 @@ GOM(PEM_read_DHparams, pFEpppp) //GO(PEM_read_PKCS7, //GO(PEM_read_PKCS8, //GO(PEM_read_PKCS8_PRIV_KEY_INFO, -//GO(PEM_read_PrivateKey, -//GO(PEM_read_PUBKEY, +GOM(PEM_read_PrivateKey, pFEpppp) +GOM(PEM_read_PUBKEY, pFEpppp) //GO(PEM_read_RSAPrivateKey, //GO(PEM_read_RSA_PUBKEY, //GO(PEM_read_RSAPublicKey, @@ -2831,8 +2927,9 @@ GO(PEM_write_bio_EC_PUBKEY, iFpp) //GO(PEM_write_bio_PKCS8PrivateKey, //GO(PEM_write_bio_PKCS8PrivateKey_nid, //GO(PEM_write_bio_PKCS8_PRIV_KEY_INFO, -//GO(PEM_write_bio_PrivateKey, -//GO(PEM_write_bio_PUBKEY, +GOM(PEM_write_bio_PrivateKey, iFEppppipp) +GOM(PEM_write_bio_PrivateKey_traditional, iFEppppipp) +GO(PEM_write_bio_PUBKEY, iFpp) GOM(PEM_write_bio_RSAPrivateKey, iFEppppipp) GO(PEM_write_bio_RSA_PUBKEY, iFpp) //GO(PEM_write_bio_RSAPublicKey, @@ -2869,7 +2966,7 @@ GO(PEM_write_bio_X509_REQ, iFpp) //GO(PEM_write_X509_REQ, //GO(PEM_write_X509_REQ_NEW, //GO(PEM_X509_INFO_read, -//GO(PEM_X509_INFO_read_bio, +GOM(PEM_X509_INFO_read_bio, pFEpppp) //GO(PEM_X509_INFO_write_bio, //GO(pitem_free, //GO(pitem_new, @@ -2923,14 +3020,14 @@ GO(PKCS12_PBE_keyivgen, iFppipppi) //GO(PKCS1_MGF1, //GO(PKCS5_pbe2_set, //GO(PKCS5_pbe2_set_iv, -//GO(PKCS5_PBE_add, -//GO(PKCS5_PBE_keyivgen, +GO(PKCS5_PBE_add, vFv) +GO(PKCS5_PBE_keyivgen, iFppipppi) //GO(PKCS5_pbe_set, //GO(PKCS5_pbe_set0_algor, GO(PKCS5_PBKDF2_HMAC, iFpipiipip) GO(PKCS5_PBKDF2_HMAC_SHA1, iFpipiiip) //GO(PKCS5_pbkdf2_set, -//GO(PKCS5_v2_PBE_keyivgen, +GO(PKCS5_v2_PBE_keyivgen, iFppipppi) //GO(PKCS5_v2_PBKDF2_keyivgen, //GO(PKCS7_add0_attrib_signing_time, //GO(PKCS7_add1_attrib_digest, @@ -2963,7 +3060,7 @@ GO(PKCS5_PBKDF2_HMAC_SHA1, iFpipiiip) //GO(PKCS7_ENCRYPT_new, //GO(PKCS7_ENVELOPE_free, //GO(PKCS7_ENVELOPE_new, -//GO(PKCS7_final, +GO(PKCS7_final, iFpppi) GO(PKCS7_free, vFp) //GO(PKCS7_get0_signers, //GO(PKCS7_get_attribute, @@ -3022,6 +3119,7 @@ GO(PKCS8_PRIV_KEY_INFO_new, pFv) //GO(policy_data_free, //GO(policy_data_new, //GO(POLICYINFO_free, +GO(POLICYINFO_it, pFv) //GO(POLICYINFO_new, //GO(POLICY_MAPPING_free, //GO(POLICY_MAPPING_new, @@ -3081,12 +3179,13 @@ GO(RAND_write_file, iFp) //GO(RIPEMD160_Init, //GO(RIPEMD160_Transform, //GO(RIPEMD160_Update, +GO(RSA_bits, iFp) //GO(RSA_blinding_off, //GO(RSA_blinding_on, GO(RSA_check_key, iFp) -//GO(RSA_flags, +GO(RSA_flags, iFp) GO(RSA_free, vFp) -//GO(RSA_generate_key, +GOM(RSA_generate_key, pFEiLpp) GO(RSA_generate_key_ex, iFpipp) GO(RSA_get0_crt_params, vFpppp) GO(RSA_get0_factors, vFppp) @@ -3379,9 +3478,9 @@ GO(UI_add_input_string, iFppipii) GO(UI_add_user_data, pFpp) //GO(UI_add_verify_string, GO(UI_construct_prompt, pFppp) -//GO(UI_create_method, +GO(UI_create_method, pFp) //GO(UI_ctrl, -//GO(UI_destroy_method, +GO(UI_destroy_method, vFp) GO(UI_dup_error_string, iFpp) GO(UI_dup_info_string, iFpp) GO(UI_dup_input_boolean, iFpppppip) @@ -3397,23 +3496,23 @@ GO(UI_get0_user_data, pFp) GO(UI_get_default_method, pFv) //GO(UI_get_ex_data, //GO(UI_get_ex_new_index, -//GO(UI_get_input_flags, +GO(UI_get_input_flags, iFp) GO(UI_get_method, pFp) //GO(UI_get_result_maxsize, //GO(UI_get_result_minsize, -//GO(UI_get_string_type, -//GO(UI_method_get_closer, +GO(UI_get_string_type, iFp) +GO(UI_method_get_closer, pFp) //GO(UI_method_get_flusher, -//GO(UI_method_get_opener, +GO(UI_method_get_opener, pFp) //GO(UI_method_get_prompt_constructor, -//GO(UI_method_get_reader, -//GO(UI_method_get_writer, -//GO(UI_method_set_closer, +GO(UI_method_get_reader, pFp) +GO(UI_method_get_writer, pFp) +GOM(UI_method_set_closer, iFEpp) //GO(UI_method_set_flusher, -//GO(UI_method_set_opener, +GOM(UI_method_set_opener, iFEpp) //GO(UI_method_set_prompt_constructor, -//GO(UI_method_set_reader, -//GO(UI_method_set_writer, +GOM(UI_method_set_reader, iFEpp) +GOM(UI_method_set_writer, iFEpp) GO(UI_new, pFv) GO(UI_new_method, pFp) GO(UI_OpenSSL, pFv) @@ -3421,7 +3520,7 @@ GO(UI_process, iFp) GO(UI_set_default_method, vFp) //GO(UI_set_ex_data, GO(UI_set_method, pFpp) -//GO(UI_set_result, +GO(UI_set_result, iFppp) //GO(UI_UTIL_read_pw, //GO(UI_UTIL_read_pw_string, //GO(USERNOTICE_free, @@ -3445,7 +3544,7 @@ GO(X509_add1_ext_i2d, iFpipiL) //GO(X509_ALGOR_cmp, //GO(X509_ALGOR_dup, //GO(X509_ALGOR_free, -//GO(X509_ALGOR_get0, +GO(X509_ALGOR_get0, vFpppp) //GO(X509_ALGOR_new, //GO(X509_ALGOR_set0, //GO(X509_ALGOR_set_md, @@ -3555,8 +3654,10 @@ GO(X509_EXTENSION_set_object, iFpp) //GO(X509_find_by_subject, GO(X509_free, vFp) GO(X509_get0_pubkey_bitstr, pFp) -//GO(X509_get0_signature, +GO(X509_get0_signature, vFppp) +GO(X509_get0_extensions, pFp) GO(X509_get0_tbs_sigalg, pFp) +GO(X509_get0_subject_key_id, pFp) //GO(X509_get1_email, //GO(X509_get1_ocsp, //GO(X509_get_default_cert_area, @@ -3581,11 +3682,13 @@ GO(X509_get0_notBefore, pFp) GO(X509_get0_pubkey, pFp) GO(X509_get0_serialNumber, pFp) GO(X509_get_serialNumber, pFp) -//GO(X509_get_signature_nid, +GO(X509_get_signature_nid, iFp) GO(X509_get_subject_name, pFp) GO(X509_get_version, lFp) GO(X509_get_X509_PUBKEY, pFp) -//GO(X509_gmtime_adj, +GO(X509_getm_notAfter, pFp) +GO(X509_getm_notBefore, pFp) +GO(X509_gmtime_adj, pFpl) //GO(X509_http_nbio, GO(X509_INFO_free, vFp) GO(X509_INFO_new, pFv) @@ -3603,21 +3706,21 @@ GO(X509_load_crl_file, iFppi) //GO(X509_LOOKUP_by_fingerprint, //GO(X509_LOOKUP_by_issuer_serial, //GO(X509_LOOKUP_by_subject, -//GO(X509_LOOKUP_ctrl, +GO(X509_LOOKUP_ctrl, iFpiplp) GO(X509_LOOKUP_file, pFv) //GO(X509_LOOKUP_free, GO(X509_LOOKUP_hash_dir, pFv) -//GO(X509_LOOKUP_init, -//GO(X509_LOOKUP_new, -//GO(X509_LOOKUP_shutdown, -//GO(X509_NAME_add_entry, -//GO(X509_NAME_add_entry_by_NID, +// GO(X509_LOOKUP_init, +// GO(X509_LOOKUP_new, +// GO(X509_LOOKUP_shutdown, +// GO(X509_NAME_add_entry, +GO(X509_NAME_add_entry_by_NID, iFpiipiii) //GO(X509_NAME_add_entry_by_OBJ, GO(X509_NAME_add_entry_by_txt, iFppipiii) //GO(X509_NAME_cmp, //GO(X509_NAME_delete_entry, //GO(X509_NAME_digest, -//GO(X509_NAME_dup, +GO(X509_NAME_dup, pFp) GO(X509_NAME_entry_count, iFp) GO(X509_NAME_ENTRY_create_by_NID, pFpiipi) GO(X509_NAME_ENTRY_create_by_OBJ, pFppipi) @@ -3646,9 +3749,14 @@ GO(X509_NAME_print_ex, iFppiu) GO(X509_NAME_print_ex_fp, iFppiu) //GO(X509_NAME_set, GO(X509_new, pFv) +GO(X509_OBJECT_free, vFp) +GO(X509_OBJECT_new, pFv) //GO(X509_OBJECT_free_contents, GO(X509_OBJECT_get_type, iFp) GO(X509_OBJECT_get0_X509, pFp) +GO(X509_OBJECT_set1_X509, iFpp) +GO(X509_OBJECT_get0_X509_CRL, pFp) +GO(X509_OBJECT_set1_X509_CRL, iFpp) //GO(X509_OBJECT_idx_by_subject, //GO(X509_OBJECT_retrieve_by_subject, //GO(X509_OBJECT_retrieve_match, @@ -3673,11 +3781,11 @@ GO(X509_print_ex, iFppLL) GO(X509_print_ex_fp, iFppLL) GO(X509_print_fp, iFpp) //GO(X509_pubkey_digest, -//GO(X509_PUBKEY_free, +GO(X509_PUBKEY_free, vFp) GO(X509_PUBKEY_get, pFp) GO(X509_PUBKEY_get0_param, iFppppp) //GO(X509_PUBKEY_new, -//GO(X509_PUBKEY_set, +GO(X509_PUBKEY_set, iFpp) //GO(X509_PUBKEY_set0_param, //GO(X509_PURPOSE_add, //GO(X509_PURPOSE_cleanup, @@ -3702,20 +3810,21 @@ GO(X509_PUBKEY_get0_param, iFppppp) //GO(X509_REQ_digest, //GO(X509_REQ_dup, //GO(X509_REQ_extension_nid, -//GO(X509_REQ_free, +GO(X509_REQ_free, vFp) //GO(X509_REQ_get1_email, //GO(X509_REQ_get_attr, //GO(X509_REQ_get_attr_by_NID, //GO(X509_REQ_get_attr_by_OBJ, //GO(X509_REQ_get_attr_count, //GO(X509_REQ_get_extension_nids, -//GO(X509_REQ_get_extensions, +//GO(X509_REQ_get_extensions, GO(X509_REQ_get_pubkey, pFp) +GO(X509_REQ_get_subject_name, pFp) GO(X509_REQ_get_X509_PUBKEY, pFp) GO(X509_REQ_get0_pubkey, pFp) //GO(X509_REQ_INFO_free, //GO(X509_REQ_INFO_new, -//GO(X509_REQ_new, +GO(X509_REQ_new, pFv) //GO(X509_REQ_print, //GO(X509_REQ_print_ex, //GO(X509_REQ_print_fp, @@ -3723,7 +3832,7 @@ GO(X509_REQ_get0_pubkey, pFp) GO(X509_REQ_set_pubkey, iFpp) GO(X509_REQ_set_subject_name, iFpp) //GO(X509_REQ_set_version, -//GO(X509_REQ_sign, +GO(X509_REQ_sign, iFppp) //GO(X509_REQ_sign_ctx, //GO(X509_REQ_to_X509, //GO(X509_REQ_verify, @@ -3760,6 +3869,7 @@ GO(X509_sign_ctx, iFpp) GO(X509_STORE_add_cert, iFpp) GO(X509_STORE_add_crl, iFpp) GO(X509_STORE_add_lookup, pFpp) +GO(X509_STORE_up_ref, iFp) GO(X509_STORE_CTX_cleanup, vFp) GO(X509_STORE_CTX_free, vFp) //GO(X509_STORE_CTX_get0_current_crl, @@ -3777,7 +3887,7 @@ GO(X509_STORE_CTX_get_chain, pFp) GO(X509_STORE_CTX_get_current_cert, pFp) GO(X509_STORE_CTX_get_error, iFp) GO(X509_STORE_CTX_get_error_depth, iFp) -//GO(X509_STORE_CTX_get_ex_data, +GO(X509_STORE_CTX_get_ex_data, pFpi) //GO(X509_STORE_CTX_get_ex_new_index, //GO(X509_STORE_CTX_get_explicit_policy, GO(X509_STORE_CTX_init, iFpppp) @@ -3802,22 +3912,27 @@ GOM(X509_STORE_CTX_set_verify_cb, vFEpp) GO(X509_STORE_free, vFp) GO(X509_STORE_get0_param, pFp) GO(X509_STORE_get0_objects, pFp) +GO(X509_STORE_get1_objects, pFp) //GO(X509_STORE_get1_certs, //GO(X509_STORE_get1_crls, //GO(X509_STORE_get_by_subject, +GO(X509_STORE_get_ex_data, pFpi) GO(X509_STORE_load_file, iFpp) GO(X509_STORE_load_path, iFpp) GO(X509_STORE_load_store, iFpp) //GO(X509_STORE_load_locations, iFppp) +GO(X509_STORE_lock, iFp) +GO(X509_STORE_unlock, iFp) GO(X509_STORE_new, pFv) //GO(X509_STORE_set1_param, //GO(X509_STORE_set_default_paths, +GO(X509_STORE_set_ex_data, iFpip) GO(X509_STORE_set_depth, iFpi) GO(X509_STORE_set_flags, iFpL) //GO(X509_STORE_set_lookup_crls_cb, GO(X509_STORE_set_purpose, iFpi) GO(X509_STORE_set_trust, iFpi) -//GO(X509_STORE_set_verify_cb, +GOM(X509_STORE_set_verify_cb, vFEpp) //GO(X509_subject_name_cmp, GO(X509_subject_name_hash, LFp) GO(X509_subject_name_hash_old, LFp) @@ -3839,13 +3954,13 @@ GO(X509_subject_name_hash_old, LFp) GO(X509_up_ref, iFp) GO(X509V3_add1_i2d, iFpipiL) //GO(X509v3_add_ext, -//GO(X509V3_add_standard_extensions, +GO(X509V3_add_standard_extensions, iFv) //GO(X509V3_add_value, //GO(X509V3_add_value_bool, //GO(X509V3_add_value_bool_nf, //GO(X509V3_add_value_int, //GO(X509V3_add_value_uchar, -//GO(X509V3_conf_free, +GO(X509V3_conf_free, vFp) //GO(X509v3_delete_ext, //GO(X509V3_EXT_add, //GO(X509V3_EXT_add_alias, @@ -3861,7 +3976,7 @@ GO(X509V3_add1_i2d, iFpipiL) GO(X509V3_EXT_d2i, pFp) //GO(X509V3_extensions_print, //GO(X509V3_EXT_free, -GO(X509V3_EXT_get, pFp) +GOM(X509V3_EXT_get, pFEp) //GO(X509V3_EXT_get_nid, GO(X509V3_EXT_i2d, pFiip) //GO(X509V3_EXT_nconf, @@ -3904,6 +4019,7 @@ GO(X509_VERIFY_PARAM_clear_flags, iFpL) //GO(X509_VERIFY_PARAM_get_count, //GO(X509_VERIFY_PARAM_get_depth, GO(X509_VERIFY_PARAM_get_flags, LFp) +GO(X509_VERIFY_PARAM_get_hostflags, uFp) //GO(X509_VERIFY_PARAM_inherit, //GO(X509_VERIFY_PARAM_lookup, //GO(X509_VERIFY_PARAM_new, @@ -3925,3 +4041,6 @@ GO(X509_VERIFY_PARAM_set_time, vFpl) //GO(X9_62_CHARACTERISTIC_TWO_new, //GO(X9_62_PENTANOMIAL_free, //GO(X9_62_PENTANOMIAL_new, +GO(EVP_PKEY_new_raw_private_key_ex, pFppppL) +GO(OSSL_PARAM_BLD_push_uint32, iFppu) +GO(RAND_bytes_ex, iFppLu) diff --git a/src/wrapped/wrappedcuda.c b/src/wrapped/wrappedcuda.c new file mode 100644 index 0000000..991ebda --- /dev/null +++ b/src/wrapped/wrappedcuda.c @@ -0,0 +1,309 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "wrapper.h" +#include "bridge.h" +#include "librarian.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "debug.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "elfloader.h" + +const char* cudaName = "libcuda.so.1"; +#define LIBNAME cuda + +#include "generated/wrappedcudatypes.h" + +#define ADDED_SUPER 1 +#include "wrappercallback.h" + +void fillCUDAProcWrapper(box64context_t* context); +static void* resolveSymbol(x64emu_t* emu, void* symbol, const char* rname, const char* name, int version); + +static void cuda_wrapper_resolver(x64emu_t* emu, const char* name, void** pfn, int cudaVersion) +{ + if(!emu->context->cudawrappers) // could be moved in "my" structure... + fillCUDAProcWrapper(emu->context); + + const char* fname = name; // default is name given + if(*pfn) { + // try to find the right wrapper, first get the real name of the function if possible + Dl_info infos = {0}; + if(!dladdr(*pfn, &infos)) { + //is there a name we can use? + if(infos.dli_sname && infos.dli_saddr==*pfn) { + //we have a name! + fname = infos.dli_sname; // use it + } + } + khint_t k = kh_get(symbolmap, emu->context->mycuda, fname); + int is_my = (k==kh_end(emu->context->mycuda))?0:1; + void* symbol = *pfn; + if(!symbol) { + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", NULL); + return; // easy + } + if(is_my) { + // try again, by using custom "my_" now... + char tmp[200]; + strcpy(tmp, "my_"); + strcat(tmp, fname); + symbol = dlsym(emu->context->box64lib, tmp); + // need to update symbol link maybe + #define GO(A, W) if(!strcmp(fname, #A)) my->A = *pfn; + SUPER() + #undef GO + } + *pfn = resolveSymbol(emu, symbol, fname, name, cudaVersion); + } +} +#undef SUPER + +#define SUPER() \ + GO(0) \ + GO(1) \ + GO(2) \ + GO(3) + +typedef struct my_CUDA_HOST_NODE_PARAMS_v1_s { + void* f; + void* data; +} my_CUDA_HOST_NODE_PARAMS_v1_t; + +// CUstreamCallback +#define GO(A) \ +static uintptr_t my_CUstreamCallback_fct_##A = 0; \ +static void my_CUstreamCallback_##A(void* a, uint32_t b, void* c) \ +{ \ + RunFunctionFmt(my_CUstreamCallback_fct_##A, "pup", a, b, c); \ +} +SUPER() +#undef GO +static void* find_CUstreamCallback_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_CUstreamCallback_fct_##A == (uintptr_t)fct) return my_CUstreamCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_CUstreamCallback_fct_##A == 0) {my_CUstreamCallback_fct_##A = (uintptr_t)fct; return my_CUstreamCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for cuda CUstreamCallback callback\n"); + return NULL; +} +// CUasyncNotificationInfo +#define GO(A) \ +static uintptr_t my_CUasyncNotificationInfo_fct_##A = 0; \ +static void my_CUasyncNotificationInfo_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my_CUasyncNotificationInfo_fct_##A, "ppp", a, b, c); \ +} +SUPER() +#undef GO +static void* find_CUasyncNotificationInfo_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_CUasyncNotificationInfo_fct_##A == (uintptr_t)fct) return my_CUasyncNotificationInfo_##A; + SUPER() + #undef GO + #define GO(A) if(my_CUasyncNotificationInfo_fct_##A == 0) {my_CUasyncNotificationInfo_fct_##A = (uintptr_t)fct; return my_CUasyncNotificationInfo_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for cuda CUasyncNotificationInfo callback\n"); + return NULL; +} +// CuHostFn +#define GO(A) \ +static uintptr_t my_CuHostFn_fct_##A = 0; \ +static void my_CuHostFn_##A(void* a) \ +{ \ + RunFunctionFmt(my_CuHostFn_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* find_CuHostFn_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_CuHostFn_fct_##A == (uintptr_t)fct) return my_CuHostFn_##A; + SUPER() + #undef GO + #define GO(A) if(my_CuHostFn_fct_##A == 0) {my_CuHostFn_fct_##A = (uintptr_t)fct; return my_CuHostFn_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for cuda CuHostFn callback\n"); + return NULL; +} +static void* reverse_CuHostFn_Fct(void* fct) +{ + if(!fct) return fct; + if(CheckBridged(my_lib->w.bridge, fct)) + return (void*)CheckBridged(my_lib->w.bridge, fct); + #define GO(A) if(my_CuHostFn_##A == fct) return (void*)my_CuHostFn_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(my_lib->w.bridge, vFp, fct, 0, NULL); +} + +#undef SUPER + +EXPORT uint32_t my_cuStreamAddCallback(x64emu_t* emu, void* h, void* f, void* data, uint32_t flags) +{ + return my->cuStreamAddCallback(h, find_CUstreamCallback_Fct(f), data, flags); +} + +EXPORT uint32_t my_cuStreamAddCallback_ptsz(x64emu_t* emu, void* h, void* f, void* data, uint32_t flags) +{ + return my->cuStreamAddCallback_ptsz(h, find_CUstreamCallback_Fct(f), data, flags); +} + +EXPORT uint32_t my_cuGraphAddHostNode(x64emu_t* emu, void* node, void* graph, void* dep, size_t dep_sz, my_CUDA_HOST_NODE_PARAMS_v1_t* param) +{ + my_CUDA_HOST_NODE_PARAMS_v1_t param_ = {0}; + if(param) { + param_.f = find_CuHostFn_Fct(param->f); + param_.data = param->data; + } + return my->cuGraphAddHostNode(node, graph, dep, dep_sz, param?(¶m_):NULL); +} + +EXPORT uint32_t my_cuLaunchHostFunc(x64emu_t* emu, void* h, void* f, void* data) +{ + return my->cuLaunchHostFunc(h, find_CuHostFn_Fct(f), data); +} + +EXPORT uint32_t my_cuLaunchHostFunc_ptsz(x64emu_t* emu, void* h, void* f, void* data) +{ + return my->cuLaunchHostFunc_ptsz(h, find_CuHostFn_Fct(f), data); +} + +EXPORT uint32_t my_cuGraphHostNodeGetParams(x64emu_t* emu, void* node, my_CUDA_HOST_NODE_PARAMS_v1_t* p) +{ + uint32_t ret = my->cuGraphHostNodeGetParams(node, p); + if(p) p->f = reverse_CuHostFn_Fct(p->f); + return ret; +} + +EXPORT uint32_t my_cuGraphHostNodeSetParams(x64emu_t* emu, void* node, my_CUDA_HOST_NODE_PARAMS_v1_t* p) +{ + my_CUDA_HOST_NODE_PARAMS_v1_t param_ = {0}; + if(p) { + param_.f = find_CuHostFn_Fct(p->f); + param_.data = p->data; + } + return my->cuGraphHostNodeSetParams(node, p?(¶m_):NULL); +} + +EXPORT uint32_t my_cuGraphExecHostNodeSetParams(x64emu_t* emu, void* g, void* node, my_CUDA_HOST_NODE_PARAMS_v1_t* p) +{ + my_CUDA_HOST_NODE_PARAMS_v1_t param_ = {0}; + if(p) { + param_.f = find_CuHostFn_Fct(p->f); + param_.data = p->data; + } + return my->cuGraphExecHostNodeSetParams(g, node, p?(¶m_):NULL); +} + +EXPORT uint32_t my_cuUserObjectCreate(x64emu_t* emu, void* obj, void* ptr, void* d, uint32_t ref, uint32_t flags) +{ + return my->cuUserObjectCreate(obj, ptr, find_CuHostFn_Fct(d), ref, flags); +} + +static void* resolveSymbol(x64emu_t* emu, void* symbol, const char* rname, const char* name, int version) +{ + // get wrapper + symbol1_t *s = NULL; + khint_t k = kh_get(symbolmap, emu->context->cudawrappers, rname); + if(k==kh_end(emu->context->cudawrappers)) { + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", NULL); + printf_dlsym(LOG_INFO, "Warning, no wrapper for %s(%s version %d)\n", rname, name, version); + return NULL; + } + s = &kh_value(emu->context->cudawrappers, k); + + if(!s->resolved) { + khint_t k = kh_get(symbolmap, emu->context->cudawrappers, rname); + const char* constname = kh_key(emu->context->cudawrappers, k); + s->addr = AddCheckBridge(emu->context->system, s->w, symbol, 0, constname); + s->resolved = 1; + } + void* ret = (void*)s->addr; + printf_dlsym_prefix(0, LOG_DEBUG, "%p (%p)\n", ret, symbol); + return ret; +} + +EXPORT uint32_t my_cuGetProcAddress(x64emu_t* emu, char* name, void** pfn, int cudaVersion, uint64_t flags, void* status) +{ + printf_dlsym(LOG_DEBUG, "Calling cuGetProcAddress(%s, %p, %i, %llx, %p) ", name, pfn, cudaVersion, flags, status); + uint32_t ret = my->cuGetProcAddress(name, pfn, cudaVersion, flags, status); + cuda_wrapper_resolver(emu, name, pfn, cudaVersion); + return ret; +} +EXPORT uint32_t my_cuGetProcAddress_v2(x64emu_t* emu, char* name, void** pfn, int cudaVersion, uint64_t flags, void* status) +{ + printf_dlsym(LOG_DEBUG, "Calling cuGetProcAddress_v2(%s, %p, %i, %llx, %p) ", name, pfn, cudaVersion, flags, status); + uint32_t ret = my->cuGetProcAddress_v2(name, pfn, cudaVersion, flags, status); + cuda_wrapper_resolver(emu, name, pfn, cudaVersion); + return ret; +} + +EXPORT uint32_t my_cuDeviceRegisterAsyncNotification(x64emu_t* emu, void* device, void* f, void* data, void* handle) +{ + return my->cuDeviceRegisterAsyncNotification(device, find_CUasyncNotificationInfo_Fct(f), data, handle); +} + +#include "wrappedlib_init.h" + +void fillCUDAProcWrapper(box64context_t* context) +{ + int cnt, ret; + khint_t k; + kh_symbolmap_t * symbolmap = kh_init(symbolmap); + // populates maps... + cnt = sizeof(cudasymbolmap)/sizeof(map_onesymbol_t); + for (int i=0; icudawrappers = symbolmap; + // fill my_* map + symbolmap = kh_init(symbolmap); + cnt = sizeof(MAPNAME(mysymbolmap))/sizeof(map_onesymbol_t); + for (int i=0; imycuda = symbolmap; +} +void freeCUDAProcWrapper(box64context_t* context) +{ + if(!context) + return; + if(context->cudawrappers) + kh_destroy(symbolmap, context->cudawrappers); + if(context->mycuda) + kh_destroy(symbolmap, context->mycuda); + context->cudawrappers = NULL; + context->mycuda = NULL; +} + +// see https://github.com/SveSop/nvidia-libs for nvidia libs installation in wine \ No newline at end of file diff --git a/src/wrapped/wrappedcuda_private.h b/src/wrapped/wrappedcuda_private.h new file mode 100644 index 0000000..ce224ac --- /dev/null +++ b/src/wrapped/wrappedcuda_private.h @@ -0,0 +1,675 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(cuArray3DCreate, uFpp) +GO(cuArray3DCreate_v2, uFpp) +GO(cuArray3DGetDescriptor, uFpp) +GO(cuArray3DGetDescriptor_v2, uFpp) +GO(cuArrayCreate, uFpp) +GO(cuArrayCreate_v2, uFpp) +GO(cuArrayDestroy, uFp) +GO(cuArrayGetDescriptor, uFpp) +GO(cuArrayGetDescriptor_v2, uFpp) +GO(cuArrayGetMemoryRequirements, uFppi) +GO(cuArrayGetPlane, uFppu) +GO(cuArrayGetSparseProperties, uFpp) +GO(cuCoredumpGetAttribute, uFupp) +GO(cuCoredumpGetAttributeGlobal, uFupp) +GO(cuCoredumpSetAttribute, uFupp) +GO(cuCoredumpSetAttributeGlobal, uFupp) +GO(cuCtxAttach, uFpu) +GO(cuCtxCreate, uFpui) +GO(cuCtxCreate_v2, uFpui) +GO(cuCtxCreate_v3, uFppiui) +GO(cuCtxCreate_v4, uFppup) +GO(cuCtxDestroy, uFp) +GO(cuCtxDestroy_v2, uFp) +GO(cuCtxDetach, uFp) +GO(cuCtxDisablePeerAccess, uFp) +GO(cuCtxEnablePeerAccess, uFpu) +GO(cuCtxFromGreenCtx, uFpp) +GO(cuCtxGetApiVersion, uFpp) +GO(cuCtxGetCacheConfig, uFp) +GO(cuCtxGetCurrent, uFp) +GO(cuCtxGetDevice, uFp) +GO(cuCtxGetDevResource, uFppu) +GO(cuCtxGetExecAffinity, uFpu) +GO(cuCtxGetFlags, uFp) +GO(cuCtxGetId, uFpp) +GO(cuCtxGetLimit, uFpu) +GO(cuCtxGetSharedMemConfig, uFp) +GO(cuCtxGetStreamPriorityRange, uFpp) +GO(cuCtxPopCurrent, uFp) +GO(cuCtxPopCurrent_v2, uFp) +GO(cuCtxPushCurrent, uFp) +GO(cuCtxPushCurrent_v2, uFp) +GO(cuCtxRecordEvent, uFpp) +GO(cuCtxResetPersistingL2Cache, uFv) +GO(cuCtxSetCacheConfig, uFu) +GO(cuCtxSetCurrent, uFp) +GO(cuCtxSetFlags, uFu) +GO(cuCtxSetLimit, uFuL) +GO(cuCtxSetSharedMemConfig, uFu) +GO(cuCtxSynchronize, uFv) +GO(cuCtxWaitEvent, uFpp) +//GO(cudbgApiAttach, +//DATA(cudbgApiClientPid, +//DATA(cudbgApiClientRevision, +//GO(cudbgApiDetach, +//GO(cudbgApiInit, +//DATA(cudbgAttachHandlerAvailable, +//DATA(cudbgDebuggerCapabilities, +//DATA(cudbgDebuggerInitialized, +//DATA(cudbgDetachSuspendedDevicesMask, +//DATA(cudbgEnableIntegratedMemcheck, +//DATA(cudbgEnableLaunchBlocking, +//DATA(cudbgEnablePreemptionDebugging, +//GO(cudbgGetAPI, +//GO(cudbgGetAPIVersion, +//DATA(cudbgInjectionPath, +//DATA(cudbgIpcFlag, +//GO(cudbgMain, +//GO(cudbgReportDriverApiError, +//DATA(cudbgReportDriverApiErrorFlags, +//GO(cudbgReportDriverInternalError, +//DATA(cudbgReportedDriverApiErrorCode, +//DATA(cudbgReportedDriverApiErrorFuncNameAddr, +//DATA(cudbgReportedDriverApiErrorFuncNameSize, +//DATA(cudbgReportedDriverInternalErrorCode, +//DATA(cudbgResumeForAttachDetach, +//DATA(cudbgRpcEnabled, +//DATA(cudbgSessionId, +//DATA(cudbgUseExternalDebugger, +GO(cuDestroyExternalMemory, uFp) +GO(cuDestroyExternalSemaphore, uFp) +GO(cuDeviceCanAccessPeer, uFpii) +GO(cuDeviceComputeCapability, uFppi) +GO(cuDeviceGet, uFpi) +GO(cuDeviceGetAttribute, uFpui) +GO(cuDeviceGetByPCIBusId, uFpp) +GO(cuDeviceGetCount, uFp) +GO(cuDeviceGetDefaultMemPool, uFpi) +GO(cuDeviceGetDevResource, uFppu) +GO(cuDeviceGetExecAffinitySupport, uFpui) +GO(cuDeviceGetGraphMemAttribute, uFiup) +GO(cuDeviceGetLuid, uFppi) +GO(cuDeviceGetMemPool, uFpi) +GO(cuDeviceGetName, uFpii) +GO(cuDeviceGetNvSciSyncAttributes, uFpii) +GO(cuDeviceGetP2PAttribute, uFpuii) +GO(cuDeviceGetPCIBusId, uFpii) +GO(cuDeviceGetProperties, uFpi) +GO(cuDeviceGetTexture1DLinearMaxWidth, uFpuui) +GO(cuDeviceGetUuid, uFpi) +GO(cuDeviceGetUuid_v2, uFpi) +GO(cuDeviceGraphMemTrim, uFi) +GO(cuDevicePrimaryCtxGetState, uFipp) +GO(cuDevicePrimaryCtxRelease, uFi) +GO(cuDevicePrimaryCtxRelease_v2, uFi) +GO(cuDevicePrimaryCtxReset, uFi) +GO(cuDevicePrimaryCtxReset_v2, uFi) +GO(cuDevicePrimaryCtxRetain, uFpi) +GO(cuDevicePrimaryCtxSetFlags, uFiu) +GO(cuDevicePrimaryCtxSetFlags_v2, uFiu) +GOM(cuDeviceRegisterAsyncNotification, uFEpppp) +GO(cuDeviceSetGraphMemAttribute, uFiup) +GO(cuDeviceSetMemPool, uFip) +GO(cuDeviceTotalMem, uFpi) +GO(cuDeviceTotalMem_v2, uFpi) +GO(cuDevResourceGenerateDesc, uFppu) +GO(cuDevSmResourceSplitByCount, uFppppuu) +GO(cuDeviceUnregisterAsyncNotification, uFpp) +GO(cuDriverGetVersion, uFp) +//GO(cuEGLApiInit, +GO(cuEGLStreamConsumerAcquireFrame, uFpppu) +GO(cuEGLStreamConsumerConnect, uFpp) +GO(cuEGLStreamConsumerConnectWithFlags, uFppu) +GO(cuEGLStreamConsumerDisconnect, uFp) +GO(cuEGLStreamConsumerReleaseFrame, uFppp) +GO(cuEGLStreamProducerConnect, uFppii) +GO(cuEGLStreamProducerDisconnect, uFp) +//GO(cuEGLStreamProducerPresentFrame, +GO(cuEGLStreamProducerReturnFrame, uFppp) +GO(cuEventCreate, uFpu) +GO(cuEventCreateFromEGLSync, uFppu) +GO(cuEventDestroy, uFp) +GO(cuEventDestroy_v2, uFp) +GO(cuEventElapsedTime, uFppp) +GO(cuEventElapsedTime_v2, uFppp) +GO(cuEventQuery, uFp) +GO(cuEventRecord, uFpp) +GO(cuEventRecord_ptsz, uFpp) +GO(cuEventRecordWithFlags, uFppu) +GO(cuEventRecordWithFlags_ptsz, uFppu) +GO(cuEventSynchronize, uFp) +GO(cuExternalMemoryGetMappedBuffer, uFppp) +GO(cuExternalMemoryGetMappedMipmappedArray, uFppp) +GO(cuFlushGPUDirectRDMAWrites, uFuu) +GO(cuFuncGetAttribute, uFpup) +GO(cuFuncGetModule, uFpp) +GO(cuFuncGetName, uFpp) +GO(cuFuncGetParamInfo, uFpLpp) +GO(cuFuncLoad, uFp) +GO(cuFuncIsLoaded, uFpp) +GO(cuFuncSetAttribute, uFpui) +GO(cuFuncSetBlockShape, uFpiii) +GO(cuFuncSetCacheConfig, uFpu) +GO(cuFuncSetSharedMemConfig, uFpu) +GO(cuFuncSetSharedSize, uFpu) +GO(cuGetErrorName, uFup) +GO(cuGetErrorString, uFup) +GO(cuGetExportTable, uFpp) +GOM(cuGetProcAddress, uFppiUp) +GOM(cuGetProcAddress_v2, uFppiUp) +GO(cuGLCtxCreate, uFpui) +GO(cuGLCtxCreate_v2, uFpui) +GO(cuGLGetDevices, uFppuu) +GO(cuGLGetDevices_v2, uFppuu) +GO(cuGLInit, uFv) +GO(cuGLMapBufferObject, uFppu) +GO(cuGLMapBufferObjectAsync, uFppup) +GO(cuGLMapBufferObjectAsync_v2, uFppup) +GO(cuGLMapBufferObjectAsync_v2_ptsz, uFppup) +GO(cuGLMapBufferObject_v2, uFppu) +GO(cuGLMapBufferObject_v2_ptds, uFppu) +GO(cuGLRegisterBufferObject, uFu) +GO(cuGLSetBufferObjectMapFlags, uFuu) +GO(cuGLUnmapBufferObject, uFu) +GO(cuGLUnmapBufferObjectAsync, uFup) +GO(cuGLUnregisterBufferObject, uFu) +GO(cuGraphAddBatchMemOpNode, uFpppLp) +GO(cuGraphAddChildGraphNode, uFpppLp) +GO(cuGraphAddDependencies, uFpppL) +GO(cuGraphAddDependencies_v2, uFppppL) +GO(cuGraphAddEmptyNode, uFpppL) +GO(cuGraphAddEventRecordNode, uFpppLp) +GO(cuGraphAddEventWaitNode, uFpppLp) +GO(cuGraphAddExternalSemaphoresSignalNode, uFpppLp) +GO(cuGraphAddExternalSemaphoresWaitNode, uFpppLp) +GOM(cuGraphAddHostNode, uFEpppLp) +GO(cuGraphAddKernelNode, uFpppLp) +GO(cuGraphAddKernelNode_v2, uFpppLp) +GO(cuGraphAddMemAllocNode, uFpppLp) +GO(cuGraphAddMemcpyNode, uFpppLpp) +GO(cuGraphAddMemFreeNode, uFpppLU) +GO(cuGraphAddMemsetNode, uFpppLpp) +GO(cuGraphAddNode, uFpppLp) // should be GOM for last param? +GO(cuGraphAddNode_v2, uFppppLp) // should be GOM for last param? +GO(cuGraphBatchMemOpNodeGetParams, uFpp) +GO(cuGraphBatchMemOpNodeSetParams, uFpp) +GO(cuGraphChildGraphNodeGetGraph, uFpp) +GO(cuGraphClone, uFpp) +GO(cuGraphConditionalHandleCreate, uFpppuu) +GO(cuGraphCreate, uFpu) +GO(cuGraphDebugDotPrint, uFppu) +GO(cuGraphDestroy, uFp) +GO(cuGraphDestroyNode, uFp) +GO(cuGraphEventRecordNodeGetEvent, uFpp) +GO(cuGraphEventRecordNodeSetEvent, uFpp) +GO(cuGraphEventWaitNodeGetEvent, uFpp) +GO(cuGraphEventWaitNodeSetEvent, uFpp) +GO(cuGraphExecBatchMemOpNodeSetParams, uFppp) +GO(cuGraphExecChildGraphNodeSetParams, uFppp) +GO(cuGraphExecDestroy, uFp) +GO(cuGraphExecEventRecordNodeSetEvent, uFppp) +GO(cuGraphExecEventWaitNodeSetEvent, uFppp) +GO(cuGraphExecExternalSemaphoresSignalNodeSetParams, uFppp) +GO(cuGraphExecExternalSemaphoresWaitNodeSetParams, uFppp) +GO(cuGraphExecGetFlags, uFpp) +GOM(cuGraphExecHostNodeSetParams, uFEppp) +GO(cuGraphExecKernelNodeSetParams, uFppp) +GO(cuGraphExecKernelNodeSetParams_v2, uFppp) +GO(cuGraphExecMemcpyNodeSetParams, uFpppp) +GO(cuGraphExecMemsetNodeSetParams, uFpppp) +GO(cuGraphExecNodeSetParams, uFppp) //should be GOM? +GO(cuGraphExecUpdate, uFppp) +GO(cuGraphExecUpdate_v2, uFppp) +GO(cuGraphExternalSemaphoresSignalNodeGetParams, uFpp) +GO(cuGraphExternalSemaphoresSignalNodeSetParams, uFpp) +GO(cuGraphExternalSemaphoresWaitNodeGetParams, uFpp) +GO(cuGraphExternalSemaphoresWaitNodeSetParams, uFpp) +GO(cuGraphGetEdges, uFpppp) +GO(cuGraphGetEdges_v2, uFppppp) +GO(cuGraphGetNodes, uFppp) +GO(cuGraphGetRootNodes, uFppp) +GOM(cuGraphHostNodeGetParams, uFEpp) +GOM(cuGraphHostNodeSetParams, uFEpp) +GO(cuGraphicsEGLRegisterImage, uFppu) +GO(cuGraphicsGLRegisterBuffer, uFpuu) +GO(cuGraphicsGLRegisterImage, uFpuuu) +GO(cuGraphicsMapResources, uFupp) +GO(cuGraphicsMapResources_ptsz, uFupp) +GO(cuGraphicsResourceGetMappedEglFrame, uFppuu) +GO(cuGraphicsResourceGetMappedMipmappedArray, uFpp) +GO(cuGraphicsResourceGetMappedPointer, uFppp) +GO(cuGraphicsResourceGetMappedPointer_v2, uFppp) +GO(cuGraphicsResourceSetMapFlags, uFpu) +GO(cuGraphicsResourceSetMapFlags_v2, uFpu) +GO(cuGraphicsSubResourceGetMappedArray, uFppuu) +GO(cuGraphicsUnmapResources, uFupp) +GO(cuGraphicsUnmapResources_ptsz, uFupp) +GO(cuGraphicsUnregisterResource, uFp) +GO(cuGraphicsVDPAURegisterOutputSurface, uFpuu) +GO(cuGraphicsVDPAURegisterVideoSurface, uFpuu) +GO(cuGraphInstantiate, uFppppL) +GO(cuGraphInstantiate_v2, uFppppL) +GO(cuGraphInstantiateWithFlags, uFppU) +GO(cuGraphInstantiateWithParams, uFppp) +GO(cuGraphInstantiateWithParams_ptsz, uFppp) +GO(cuGraphKernelNodeCopyAttributes, uFpp) +GO(cuGraphKernelNodeGetAttribute, uFpup) +GO(cuGraphKernelNodeGetParams, uFpp) +GO(cuGraphKernelNodeGetParams_v2, uFpp) +GO(cuGraphKernelNodeSetAttribute, uFpup) +GO(cuGraphKernelNodeSetParams, uFpp) +GO(cuGraphKernelNodeSetParams_v2, uFpp) +GO(cuGraphLaunch, uFpp) +GO(cuGraphLaunch_ptsz, uFpp) +GO(cuGraphMemAllocNodeGetParams, uFpp) +GO(cuGraphMemcpyNodeGetParams, uFpp) +GO(cuGraphMemcpyNodeSetParams, uFpp) +GO(cuGraphMemFreeNodeGetParams, uFpp) +GO(cuGraphMemsetNodeGetParams, uFpp) +GO(cuGraphMemsetNodeSetParams, uFpp) +GO(cuGraphNodeFindInClone, uFppp) +GO(cuGraphNodeGetDependencies, uFppp) +GO(cuGraphNodeGetDependencies_v2, uFpppp) +GO(cuGraphNodeGetDependentNodes, uFppp) +GO(cuGraphNodeGetDependentNodes_v2, uFpppp) +GO(cuGraphNodeGetEnabled, uFppp) +GO(cuGraphNodeGetType, uFpp) +GO(cuGraphNodeSetEnabled, uFppu) +GO(cuGraphNodeSetParams, uFpp) // should be GOM? +GO(cuGraphReleaseUserObject, uFppu) +GO(cuGraphRemoveDependencies, uFpppL) +GO(cuGraphRemoveDependencies_v2, uFppppL) +GO(cuGraphRetainUserObject, uFppuu) +GO(cuGraphUpload, uFpp) +GO(cuGraphUpload_ptsz, uFpp) +GO(cuGreenCtxCreate, uFpppu) +GO(cuGreenCtxDestroy, uFp) +GO(cuGreenCtxGetDevResource, uFppu) +GO(cuGreenCtxRecordEvent, uFpp) +GO(cuGreenCtxStreamCreate, uFppui) +GO(cuGreenCtxWaitEvent, uFpp) +GO(cuImportExternalMemory, uFpp) +GO(cuImportExternalSemaphore, uFpp) +GO(cuInit, uFu) +GO(cuIpcCloseMemHandle, uFU) +GO(cuIpcGetEventHandle, uFpp) +GO(cuIpcGetMemHandle, uFpU) +GO(cuIpcOpenEventHandle, uFpU) +GO(cuIpcOpenMemHandle, uFpUu) +GO(cuIpcOpenMemHandle_v2, uFpuU) +GO(cuKernelGetAttribute, uFpupi) +GO(cuKernelGetFunction, uFpp) +GO(cuKernelGetLibrary, uFpp) +GO(cuKernelGetName, uFpp) +GO(cuKernelGetParamInfo, uFpLpp) +GO(cuKernelSetAttribute, uFuipi) +GO(cuKernelSetCacheConfig, uFpui) +GO(cuLaunch, uFp) +GO(cuLaunchCooperativeKernel, uFpuuuuuuupp) +GO(cuLaunchCooperativeKernelMultiDevice, uFpuu) +GO(cuLaunchCooperativeKernel_ptsz, uFpuuuuuuupp) +GO(cuLaunchGrid, uFpii) +GO(cuLaunchGridAsync, uFpiip) +GOM(cuLaunchHostFunc, uFEppp) +GOM(cuLaunchHostFunc_ptsz, uFEppp) +GO(cuLaunchKernel, uFpuuuuuuuppp) +GO(cuLaunchKernelEx, uFpppp) +GO(cuLaunchKernelEx_ptsz, uFpppp) +GO(cuLaunchKernel_ptsz, uFpuuuuuuuppp) +GO(cuLibraryEnumerateKernels, uFpup) +GO(cuLibraryGetGlobal, uFpppp) +GO(cuLibraryGetKernel, uFppp) +GO(cuLibraryGetKernelCount, uFpp) +GO(cuLibraryGetManaged, uFpppp) +GO(cuLibraryGetModule, uFpp) +GO(cuLibraryGetUnifiedFunction, uFppp) +GO(cuLibraryLoadData, uFppppuppu) +GO(cuLibraryLoadFromFile, uFppppuppu) +GO(cuLibraryUnload, uFp) +GO(cuLinkAddData, uFpupLpupp) +GO(cuLinkAddData_v2, uFpupLpupp) +GO(cuLinkAddFile, uFpupupp) +GO(cuLinkAddFile_v2, uFpupupp) +GO(cuLinkComplete, uFppp) +GO(cuLinkCreate, uFuppp) +GO(cuLinkCreate_v2, uFuppp) +GO(cuLinkDestroy, uFp) +GO(cuMemAddressFree, uFUL) +GO(cuMemAddressReserve, uFpLLUU) +GO(cuMemAdvise, uFULui) +GO(cuMemAdvise_v2, uFULui) +GO(cuMemAlloc, uFpLp) +GO(cuMemAllocAsync, uFpLp) +GO(cuMemAllocAsync_ptsz, uFpLp) +GO(cuMemAllocFromPoolAsync, uFpLpp) +GO(cuMemAllocFromPoolAsync_ptsz, uFpLpp) +GO(cuMemAllocHost, uFpL) +GO(cuMemAllocHost_v2, uFpL) +GO(cuMemAllocManaged, uFpLu) +GO(cuMemAllocPitch, uFppLLu) +GO(cuMemAllocPitch_v2, uFppLLu) +GO(cuMemAlloc_v2, uFpL) +GO(cuMemcpy, uFUUL) +GO(cuMemcpy2D, uFp) +GO(cuMemcpy2DAsync, uFpp) +GO(cuMemcpy2DAsync_v2, uFpp) +GO(cuMemcpy2DAsync_v2_ptsz, uFpp) +GO(cuMemcpy2DUnaligned, uFp) +GO(cuMemcpy2DUnaligned_v2, uFp) +GO(cuMemcpy2DUnaligned_v2_ptds, uFp) +GO(cuMemcpy2D_v2, uFp) +GO(cuMemcpy2D_v2_ptds, uFp) +GO(cuMemcpy3D, uFp) +GO(cuMemcpy3DAsync, uFpp) +GO(cuMemcpy3DAsync_v2, uFpp) +GO(cuMemcpy3DAsync_v2_ptsz, uFpp) +GO(cuMemcpy3DBatchAsync, uFLpUp) +GO(cuMemcpy3DBatchAsync_ptsz, uFLpUp) +GO(cuMemcpy3DPeer, uFp) +GO(cuMemcpy3DPeerAsync, uFpp) +GO(cuMemcpy3DPeerAsync_ptsz, uFpp) +GO(cuMemcpy3DPeer_ptds, uFp) +GO(cuMemcpy3D_v2, uFp) +GO(cuMemcpy3D_v2_ptds, uFp) +GO(cuMemcpyAsync, uFUULp) +GO(cuMemcpyAsync_ptsz, uFUULp) +GO(cuMemcpyAtoA, uFpLpLL) +GO(cuMemcpyAtoA_v2, uFpLpLL) +GO(cuMemcpyAtoA_v2_ptds, uFpLpLL) +GO(cuMemcpyAtoD, uFUpLL) +GO(cuMemcpyAtoD_v2, uFUpLL) +GO(cuMemcpyAtoD_v2_ptds, uFUpLL) +GO(cuMemcpyAtoH, uFppLL) +GO(cuMemcpyAtoHAsync, uFppLLp) +GO(cuMemcpyAtoHAsync_v2, uFppLLp) +GO(cuMemcpyAtoHAsync_v2_ptsz, uFppLLp) +GO(cuMemcpyAtoH_v2, uFppLL) +GO(cuMemcpyAtoH_v2_ptds, uFppLL) +GO(cuMemcpyBatchAsync, uFpppLppLp) +GO(cuMemcpyBatchAsync_ptsz, uFpppLppLp) +GO(cuMemcpyDtoA, uFpLUL) +GO(cuMemcpyDtoA_v2, uFpLUL) +GO(cuMemcpyDtoA_v2_ptds, uFpLUL) +GO(cuMemcpyDtoD, uFUUL) +GO(cuMemcpyDtoDAsync, uFUULp) +GO(cuMemcpyDtoDAsync_v2, uFUULp) +GO(cuMemcpyDtoDAsync_v2_ptsz, uFUULp) +GO(cuMemcpyDtoD_v2, uFUUL) +GO(cuMemcpyDtoD_v2_ptds, uFUUL) +GO(cuMemcpyDtoH, uFpUL) +GO(cuMemcpyDtoHAsync, uFpULp) +GO(cuMemcpyDtoHAsync_v2, uFpULp) +GO(cuMemcpyDtoHAsync_v2_ptsz, uFpULp) +GO(cuMemcpyDtoH_v2, uFpUL) +GO(cuMemcpyDtoH_v2_ptds, uFpUL) +GO(cuMemcpyHtoA, uFpLpL) +GO(cuMemcpyHtoAAsync, uFpLpLp) +GO(cuMemcpyHtoAAsync_v2, uFpLpLp) +GO(cuMemcpyHtoAAsync_v2_ptsz, uFpLpLp) +GO(cuMemcpyHtoA_v2, uFpLpL) +GO(cuMemcpyHtoA_v2_ptds, uFpLpL) +GO(cuMemcpyHtoD, uFUpL) +GO(cuMemcpyHtoDAsync, uFUpLp) +GO(cuMemcpyHtoDAsync_v2, uFUpLp) +GO(cuMemcpyHtoDAsync_v2_ptsz, uFUpLp) +GO(cuMemcpyHtoD_v2, uFUpL) +GO(cuMemcpyHtoD_v2_ptds, uFUpL) +GO(cuMemcpyPeer, uFUpUpL) +GO(cuMemcpyPeerAsync, uFUpUpLp) +GO(cuMemcpyPeerAsync_ptsz, uFUpUpLp) +GO(cuMemcpyPeer_ptds, uFUpUpL) +GO(cuMemcpy_ptds, uFUUL) +GO(cuMemCreate, uFpLpU) +GO(cuMemExportToShareableHandle, uFpUuU) +GO(cuMemFree, uFU) +GO(cuMemFreeAsync, uFUp) +GO(cuMemFreeAsync_ptsz, uFUp) +GO(cuMemFreeHost, uFp) +GO(cuMemFree_v2, uFU) +GO(cuMemGetAccess, uFppU) +GO(cuMemGetAddressRange, uFppU) +GO(cuMemGetAddressRange_v2, uFppU) +GO(cuMemGetAllocationGranularity, uFppu) +GO(cuMemGetAllocationPropertiesFromHandle, uFpU) +//GO(cuMemGetAttribute, +//GO(cuMemGetAttribute_v2, +GO(cuMemGetHandleForAddressRange, uFpULuU) +GO(cuMemGetInfo, uFpp) +GO(cuMemGetInfo_v2, uFpp) +GO(cuMemHostAlloc, uFpLu) +GO(cuMemHostGetDevicePointer, uFppu) +GO(cuMemHostGetDevicePointer_v2, uFppu) +GO(cuMemHostGetFlags, uFpp) +GO(cuMemHostRegister, uFpLu) +GO(cuMemHostRegister_v2, uFpLu) +GO(cuMemHostUnregister, uFp) +GO(cuMemImportFromShareableHandle, uFppu) +GO(cuMemMap, uFULLUU) +GO(cuMemMapArrayAsync, uFpup) +GO(cuMemMapArrayAsync_ptsz, uFpup) +GO(cuMemPoolCreate, uFpp) +GO(cuMemPoolDestroy, uFp) +GO(cuMemPoolExportPointer, uFpU) +GO(cuMemPoolExportToShareableHandle, uFppuU) +GO(cuMemPoolGetAccess, uFppp) +GO(cuMemPoolGetAttribute, uFpup) +GO(cuMemPoolImportFromShareableHandle, uFppuU) +GO(cuMemPoolImportPointer, uFppp) +GO(cuMemPoolSetAccess, uFppL) +GO(cuMemPoolSetAttribute, uFpup) +GO(cuMemPoolTrimTo, uFpL) +GO(cuMemPrefetchAsync, uFULip) +GO(cuMemPrefetchAsync_ptsz, uFULip) +GO(cuMemPrefetchAsync_v2, uFULip) +GO(cuMemPrefetchAsync_v2_ptsz, uFULip) +GO(cuMemRangeGetAttribute, uFpLuUL) +GO(cuMemRangeGetAttributes, uFpppLUL) +GO(cuMemRelease, uFU) +GO(cuMemRetainAllocationHandle, uFpp) +GO(cuMemSetAccess, uFULpL) +GO(cuMemsetD16, uFUWL) +GO(cuMemsetD16Async, uFUWLp) +GO(cuMemsetD16Async_ptsz, uFUWLp) +GO(cuMemsetD16_v2, uFUWL) +GO(cuMemsetD16_v2_ptds, uFUWL) +GO(cuMemsetD2D16, uFULWLL) +GO(cuMemsetD2D16Async, uFULWLLp) +GO(cuMemsetD2D16Async_ptsz, uFULWLLp) +GO(cuMemsetD2D16_v2, uFULWLL) +GO(cuMemsetD2D16_v2_ptds, uFULWLL) +GO(cuMemsetD2D32, uFULuLL) +GO(cuMemsetD2D32Async, uFULuLLp) +GO(cuMemsetD2D32Async_ptsz, uFULuLLp) +GO(cuMemsetD2D32_v2, uFULuLL) +GO(cuMemsetD2D32_v2_ptds, uFULuLL) +GO(cuMemsetD2D8, uFULCLL) +GO(cuMemsetD2D8Async, uFULCLLp) +GO(cuMemsetD2D8Async_ptsz, uFULCLLp) +GO(cuMemsetD2D8_v2, uFULCLL) +GO(cuMemsetD2D8_v2_ptds, uFULCLL) +GO(cuMemsetD32, uFUuL) +GO(cuMemsetD32Async, uFUuLp) +GO(cuMemsetD32Async_ptsz, uFUuLp) +GO(cuMemsetD32_v2, uFUuL) +GO(cuMemsetD32_v2_ptds, uFUuL) +GO(cuMemsetD8, uFUCL) +GO(cuMemsetD8Async, uFUCLp) +GO(cuMemsetD8Async_ptsz, uFUCLp) +GO(cuMemsetD8_v2, uFUCL) +GO(cuMemsetD8_v2_ptds, uFUCL) +GO(cuMemUnmap, uFUL) +GO(cuMipmappedArrayCreate, uFppu) +GO(cuMipmappedArrayDestroy, uFp) +GO(cuMipmappedArrayGetLevel, uFppu) +GO(cuMipmappedArrayGetMemoryRequirements, uFppi) +GO(cuMipmappedArrayGetSparseProperties, uFpp) +GO(cuModuleEnumerateFunctions, uFpup) +GO(cuModuleGetFunction, uFppp) +GO(cuModuleGetFunctionCount, uFpp) +GO(cuModuleGetGlobal, uFpppp) +GO(cuModuleGetGlobal_v2, uFpppp) +GO(cuModuleGetLoadingMode, uFp) +GO(cuModuleGetSurfRef, uFppp) +GO(cuModuleGetTexRef, uFppp) +GO(cuModuleLoad, uFpp) +GO(cuModuleLoadData, uFpp) +GO(cuModuleLoadDataEx, uFppupp) +GO(cuModuleLoadFatBinary, uFpp) +GO(cuModuleUnload, uFp) +GO(cuMulticastAddDevice, uFUi) +GO(cuMulticastBindAddr, uFULULU) +GO(cuMulticastBindMem, uFULULLU) +GO(cuMulticastCreate, uFpp) +GO(cuMulticastGetGranularity, uFppu) +GO(cuMulticastUnbind, uFUiLL) +GO(cuOccupancyAvailableDynamicSMemPerBlock, uFppii) +GO(cuOccupancyMaxActiveBlocksPerMultiprocessor, uFppiL) +GO(cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, uFppiLu) +GO(cuOccupancyMaxActiveClusters, uFppp) +GO(cuOccupancyMaxPotentialBlockSize, uFppppLi) +GO(cuOccupancyMaxPotentialBlockSizeWithFlags, uFppppLiu) +GO(cuOccupancyMaxPotentialClusterSize, uFppp) +GO(cuParamSetf, uFpif) +GO(cuParamSeti, uFpiu) +GO(cuParamSetSize, uFpu) +GO(cuParamSetTexRef, uFpip) +GO(cuParamSetv, uFpipu) +GO(cuPointerGetAttribute, uFpuU) +GO(cuPointerGetAttributes, uFuppU) +GO(cuPointerSetAttribute, uFpuU) +GO(cuProfilerInitialize, uFppu) +GO(cuProfilerStart, uFv) +GO(cuProfilerStop, uFv) +GO(cuSignalExternalSemaphoresAsync, uFppup) +GO(cuSignalExternalSemaphoresAsync_ptsz, uFppup) +GOM(cuStreamAddCallback, uFEpppu) +GOM(cuStreamAddCallback_ptsz, uFEpppu) +GO(cuStreamAttachMemAsync, uFpULu) +GO(cuStreamAttachMemAsync_ptsz, uFpULu) +GO(cuStreamBatchMemOp, uFpupu) +GO(cuStreamBatchMemOp_ptsz, uFpupu) +GO(cuStreamBatchMemOp_v2, uFpupu) +GO(cuStreamBatchMemOp_v2_ptsz, uFpupu) +GO(cuStreamBeginCapture, uFpu) +GO(cuStreamBeginCapture_ptsz, uFpu) +GO(cuStreamBeginCapture_v2, uFpu) +GO(cuStreamBeginCapture_v2_ptsz, uFpu) +GO(cuStreamBeginCaptureToGraph, uFppppLu) +GO(cuStreamBeginCaptureToGraph_ptsz, uFppppLu) +GO(cuStreamCopyAttributes, uFpp) +GO(cuStreamCopyAttributes_ptsz, uFpp) +GO(cuStreamCreate, uFpu) +GO(cuStreamCreateWithPriority, uFpui) +GO(cuStreamDestroy, uFp) +GO(cuStreamDestroy_v2, uFp) +GO(cuStreamEndCapture, uFpp) +GO(cuStreamEndCapture_ptsz, uFpp) +GO(cuStreamGetAttribute, uFpup) +GO(cuStreamGetAttribute_ptsz, uFpup) +GO(cuStreamGetCaptureInfo, uFpppppp) +GO(cuStreamGetCaptureInfo_ptsz, uFpppppp) +GO(cuStreamGetCaptureInfo_v2, uFpppppp) +GO(cuStreamGetCaptureInfo_v2_ptsz, uFpppppp) +GO(cuStreamGetCaptureInfo_v3, uFppppppp) +GO(cuStreamGetCaptureInfo_v3_ptsz, uFppppppp) +GO(cuStreamGetCtx, uFpp) +GO(cuStreamGetCtx_ptsz, uFpp) +GO(cuStreamGetCtx_v2, uFppp) +GO(cuStreamGetCtx_v2_ptsz, uFppp) +GO(cuStreamGetDevice, uFpp) +GO(cuStreamGetDevice_ptsz, uFpp) +GO(cuStreamGetFlags, uFpp) +GO(cuStreamGetFlags_ptsz, uFpp) +GO(cuStreamGetGreenCtx, uFpp) +GO(cuStreamGetId, uFpp) +GO(cuStreamGetId_ptsz, uFpp) +GO(cuStreamGetPriority, uFpp) +GO(cuStreamGetPriority_ptsz, uFpp) +GO(cuStreamIsCapturing, uFpp) +GO(cuStreamIsCapturing_ptsz, uFpp) +GO(cuStreamQuery, uFp) +GO(cuStreamQuery_ptsz, uFp) +GO(cuStreamSetAttribute, uFpup) +GO(cuStreamSetAttribute_ptsz, uFpup) +GO(cuStreamSynchronize, uFp) +GO(cuStreamSynchronize_ptsz, uFp) +GO(cuStreamUpdateCaptureDependencies, uFppLu) +GO(cuStreamUpdateCaptureDependencies_ptsz, uFppLu) +GO(cuStreamUpdateCaptureDependencies_v2, uFpppLu) +GO(cuStreamUpdateCaptureDependencies_v2_ptsz, uFpppLu) +GO(cuStreamWaitEvent, uFppu) +GO(cuStreamWaitEvent_ptsz, uFppu) +GO(cuStreamWaitValue32, uFpUuu) +GO(cuStreamWaitValue32_ptsz, uFpUuu) +GO(cuStreamWaitValue32_v2, uFpUuu) +GO(cuStreamWaitValue32_v2_ptsz, uFpUuu) +GO(cuStreamWaitValue64, uFpUUu) +GO(cuStreamWaitValue64_ptsz, uFpUUu) +GO(cuStreamWaitValue64_v2, uFpUUu) +GO(cuStreamWaitValue64_v2_ptsz, uFpUUu) +GO(cuStreamWriteValue32, uFpUuu) +GO(cuStreamWriteValue32_ptsz, uFpUuu) +GO(cuStreamWriteValue32_v2, uFpUuu) +GO(cuStreamWriteValue32_v2_ptsz, uFpUuu) +GO(cuStreamWriteValue64, uFpUUu) +GO(cuStreamWriteValue64_ptsz, uFpUUu) +GO(cuStreamWriteValue64_v2, uFpUUu) +GO(cuStreamWriteValue64_v2_ptsz, uFpUUu) +GO(cuSurfObjectCreate, uFpp) +GO(cuSurfObjectDestroy, uFU) +GO(cuSurfObjectGetResourceDesc, uFpU) +GO(cuSurfRefGetArray, uFpp) +GO(cuSurfRefSetArray, uFppu) +GO(cuTensorMapEncodeIm2col, uFpuupppppuupuuuu) +GO(cuTensorMapEncodeTiled, uFpuupppppuuuu) +GO(cuTensorMapReplaceAddress, uFpp) +GO(cuTexObjectCreate, uFpppp) +GO(cuTexObjectDestroy, uFU) +GO(cuTexObjectGetResourceDesc, uFpU) +GO(cuTexObjectGetResourceViewDesc, uFpU) +GO(cuTexObjectGetTextureDesc, uFpU) +GO(cuTexRefCreate, uFp) +GO(cuTexRefDestroy, uFp) +GO(cuTexRefGetAddress, uFpp) +GO(cuTexRefGetAddressMode, uFppi) +GO(cuTexRefGetAddress_v2, uFpp) +GO(cuTexRefGetArray, uFpp) +GO(cuTexRefGetBorderColor, uFpp) +GO(cuTexRefGetFilterMode, uFpp) +GO(cuTexRefGetFlags, uFpp) +GO(cuTexRefGetFormat, uFppp) +GO(cuTexRefGetMaxAnisotropy, uFpp) +GO(cuTexRefGetMipmapFilterMode, uFpp) +GO(cuTexRefGetMipmapLevelBias, uFpp) +GO(cuTexRefGetMipmapLevelClamp, uFppp) +GO(cuTexRefGetMipmappedArray, uFpp) +GO(cuTexRefSetAddress, uFppUL) +GO(cuTexRefSetAddress2D, uFppUL) +GO(cuTexRefSetAddress2D_v2, uFppUL) +GO(cuTexRefSetAddress2D_v3, uFppUL) +GO(cuTexRefSetAddressMode, uFpiu) +GO(cuTexRefSetAddress_v2, uFppUL) +GO(cuTexRefSetArray, uFppu) +GO(cuTexRefSetBorderColor, uFpp) +GO(cuTexRefSetFilterMode, uFpu) +GO(cuTexRefSetFlags, uFpu) +GO(cuTexRefSetFormat, uFpui) +GO(cuTexRefSetMaxAnisotropy, uFpu) +GO(cuTexRefSetMipmapFilterMode, uFpu) +GO(cuTexRefSetMipmapLevelBias, uFpf) +GO(cuTexRefSetMipmapLevelClamp, uFpff) +GO(cuTexRefSetMipmappedArray, uFppu) +GO(cuThreadExchangeStreamCaptureMode, uFp) +GOM(cuUserObjectCreate, uFEpppuu) +GO(cuUserObjectRelease, uFpu) +GO(cuUserObjectRetain, uFpu) +//GO(cuVDPAUCtxCreate, +//GOM(cuVDPAUCtxCreate_v2, uFEpuiup) +//GOM(cuVDPAUGetDevice, uFEpup) +GO(cuWaitExternalSemaphoresAsync, uFppup) +GO(cuWaitExternalSemaphoresAsync_ptsz, uFppup) diff --git a/src/wrapped/wrappedcurl.c b/src/wrapped/wrappedcurl.c index 06a49a0..75fe4bd 100644 --- a/src/wrapped/wrappedcurl.c +++ b/src/wrapped/wrappedcurl.c @@ -17,13 +17,10 @@ #include "callback.h" #include "elfloader.h" -#ifdef ANDROID - const char* curlName = "libcurl.so"; -#else - const char* curlName = "libcurl.so.4"; -#endif +const char* curlName = "libcurl.so.4"; +#define ALTNAME "libcurl.so" -#define ALTNAME "libcurl-gnutls.so.4" +#define ALTNAME2 "libcurl-gnutls.so.4" #define LIBNAME curl #include "generated/wrappedcurltypes.h" @@ -718,6 +715,146 @@ static void* find_ssl_ctx_callback_Fct(void* fct) return NULL; } +// malloc_callback +#define GO(A) \ + static uintptr_t my_malloc_callback_fct_##A = 0; \ + static void* my_malloc_callback_##A(size_t a) \ + { \ + return (void*)RunFunctionFmt(my_malloc_callback_fct_##A, "L", a); \ + } +SUPER() +#undef GO +static void* find_malloc_callback_Fct(void* fct) +{ + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_malloc_callback_fct_##A == (uintptr_t)fct) return my_malloc_callback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_malloc_callback_fct_##A == 0) { \ + my_malloc_callback_fct_##A = (uintptr_t)fct; \ + return my_malloc_callback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl malloc_callback callback\n"); + return NULL; +} + +// free_callback +#define GO(A) \ + static uintptr_t my_free_callback_fct_##A = 0; \ + static void my_free_callback_##A(void* a) \ + { \ + RunFunctionFmt(my_free_callback_fct_##A, "p", a); \ + } +SUPER() +#undef GO +static void* find_free_callback_Fct(void* fct) +{ + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_free_callback_fct_##A == (uintptr_t)fct) return my_free_callback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_free_callback_fct_##A == 0) { \ + my_free_callback_fct_##A = (uintptr_t)fct; \ + return my_free_callback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl free_callback callback\n"); + return NULL; +} + +// realloc_callback +#define GO(A) \ + static uintptr_t my_realloc_callback_fct_##A = 0; \ + static void* my_realloc_callback_##A(void* a, size_t b) \ + { \ + return (void*)RunFunctionFmt(my_realloc_callback_fct_##A, "pL", a, b); \ + } +SUPER() +#undef GO +static void* find_realloc_callback_Fct(void* fct) +{ + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_realloc_callback_fct_##A == (uintptr_t)fct) return my_realloc_callback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_realloc_callback_fct_##A == 0) { \ + my_realloc_callback_fct_##A = (uintptr_t)fct; \ + return my_realloc_callback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl realloc_callback callback\n"); + return NULL; +} + +// strdup_callback +#define GO(A) \ + static uintptr_t my_strdup_callback_fct_##A = 0; \ + static void* my_strdup_callback_##A(void* a) \ + { \ + return (void*)RunFunctionFmt(my_strdup_callback_fct_##A, "p", a); \ + } +SUPER() +#undef GO +static void* find_strdup_callback_Fct(void* fct) +{ + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_strdup_callback_fct_##A == (uintptr_t)fct) return my_strdup_callback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_strdup_callback_fct_##A == 0) { \ + my_strdup_callback_fct_##A = (uintptr_t)fct; \ + return my_strdup_callback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl strdup_callback callback\n"); + return NULL; +} + + +// calloc_callback +#define GO(A) \ + static uintptr_t my_calloc_callback_fct_##A = 0; \ + static void* my_calloc_callback_##A(size_t a, size_t b) \ + { \ + return (void*)RunFunctionFmt(my_calloc_callback_fct_##A, "LL", a, b); \ + } +SUPER() +#undef GO +static void* find_calloc_callback_Fct(void* fct) +{ + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_calloc_callback_fct_##A == (uintptr_t)fct) return my_calloc_callback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_calloc_callback_fct_##A == 0) { \ + my_calloc_callback_fct_##A = (uintptr_t)fct; \ + return my_calloc_callback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl calloc_callback callback\n"); + return NULL; +} #undef SUPER EXPORT uint32_t my_curl_easy_setopt(x64emu_t* emu, void* handle, uint32_t option, void* param) @@ -796,4 +933,14 @@ EXPORT uint32_t my_curl_share_setopt(x64emu_t* emu, void* handle, CURLSHoption o } } +EXPORT int my_curl_global_init_mem(x64emu_t* emu, long flags, void* m, void* f, void* r, void* s, void* c) +{ + return my->curl_global_init_mem(flags, + find_malloc_callback_Fct(m), + find_free_callback_Fct(f), + find_realloc_callback_Fct(r), + find_strdup_callback_Fct(s), + find_calloc_callback_Fct(c)); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedcurl_private.h b/src/wrapped/wrappedcurl_private.h index e672b1b..ce198ab 100644 --- a/src/wrapped/wrappedcurl_private.h +++ b/src/wrapped/wrappedcurl_private.h @@ -24,20 +24,20 @@ GO(curl_free, vFp) //GO(curl_getenv, GO(curl_global_cleanup, vFv) GO(curl_global_init, uFu) -//GO(curl_global_init_mem, +GOM(curl_global_init_mem, iFElppppp) GO(curl_global_sslset, uFupp) -//GO(curl_maprintf, -//GO(curl_mfprintf, -//GO(curl_mime_addpart, -//GO(curl_mime_data, -//GO(curl_mime_data_cb, -//GO(curl_mime_encoder, -//GO(curl_mime_filedata, -//GO(curl_mime_filename, -//GO(curl_mime_free, -//GO(curl_mime_headers, -//GO(curl_mime_init, -//GO(curl_mime_name, +// GO(curl_maprintf, +// GO(curl_mfprintf, +GO(curl_mime_addpart, pFp) +GO(curl_mime_data, iFppL) +// GO(curl_mime_data_cb, +// GO(curl_mime_encoder, +GO(curl_mime_filedata, iFpp) +// GO(curl_mime_filename, +// GO(curl_mime_free, +// GO(curl_mime_headers, +GO(curl_mime_init, pFp) +GO(curl_mime_name, iFpp) //GO(curl_mime_subparts, //GO(curl_mime_type, //GO(curl_mprintf, diff --git a/src/wrapped/wrappeddbus.c b/src/wrapped/wrappeddbus.c index fe2dd6c..2be86e5 100644 --- a/src/wrapped/wrappeddbus.c +++ b/src/wrapped/wrappeddbus.c @@ -31,7 +31,11 @@ const char* dbusName = "libdbus-1.so.3"; GO(0) \ GO(1) \ GO(2) \ -GO(3) +GO(3) \ +GO(4) \ +GO(5) \ +GO(6) \ +GO(7) \ // DBusFreeFunction #define GO(A) \ @@ -372,6 +376,28 @@ static void* findDBusNewConnectionFunctionFct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for dbus DBusNewConnectionFunction callback\n"); return NULL; } +// DBusAllowUnixUserFunction +#define GO(A) \ +static uintptr_t my_DBusAllowUnixUserFunction_fct_##A = 0; \ +static int my_DBusAllowUnixUserFunction_##A(void* a, unsigned long b, void* c) \ +{ \ + return RunFunctionFmt(my_DBusAllowUnixUserFunction_fct_##A, "pLp", a, b, c); \ +} +SUPER() +#undef GO +static void* find_DBusAllowUnixUserFunction_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusAllowUnixUserFunction_fct_##A == (uintptr_t)fct) return my_DBusAllowUnixUserFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusAllowUnixUserFunction_fct_##A == 0) {my_DBusAllowUnixUserFunction_fct_##A = (uintptr_t)fct; return my_DBusAllowUnixUserFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusAllowUnixUserFunction callback\n"); + return NULL; +} #undef SUPER @@ -576,6 +602,22 @@ EXPORT int my_dbus_connection_register_fallback(x64emu_t* emu, void* connection, return my->dbus_connection_register_fallback(connection, path, vtable?&vt:NULL, data); } +EXPORT int my_dbus_connection_register_object_path(x64emu_t* emu, void* connection, void* path, my_DBusObjectPathVTable_t* vtable, void* data) +{ + (void)emu; + my_DBusObjectPathVTable_t vt = {0}; + if(vtable) { + vt.unregister_function = findDBusObjectPathUnregisterFunctionFct(vtable->unregister_function); + vt.message_function = findDBusObjectPathMessageFunctionFct(vtable->message_function); + vt.pad1 = finddbus_internal_padFct(vtable->pad1); + vt.pad2 = finddbus_internal_padFct(vtable->pad2); + vt.pad3 = finddbus_internal_padFct(vtable->pad3); + vt.pad4 = finddbus_internal_padFct(vtable->pad4); + } + + return my->dbus_connection_register_object_path(connection, path, vtable?&vt:NULL, data); +} + EXPORT int my_dbus_connection_set_data(x64emu_t* emu, void* connection, int slot, void* data, void* free_func) { (void)emu; @@ -624,4 +666,9 @@ EXPORT int my_dbus_server_set_data(x64emu_t* emu, void* server, int slot, void* return my->dbus_server_set_data(server, slot, data, find_DBusFreeFunction_Fct(d)); } +EXPORT void my_dbus_connection_set_unix_user_function(x64emu_t* emu, void* conn, void* f, void* data, void* fr) +{ + my->dbus_connection_set_unix_user_function(conn, find_DBusAllowUnixUserFunction_Fct(f), data, find_DBusFreeFunction_Fct(fr)); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappeddbus_private.h b/src/wrapped/wrappeddbus_private.h index 81fe303..3670d2e 100644 --- a/src/wrapped/wrappeddbus_private.h +++ b/src/wrapped/wrappeddbus_private.h @@ -55,7 +55,7 @@ GO(dbus_connection_read_write, iFpi) GO(dbus_connection_read_write_dispatch, iFpi) GO(dbus_connection_ref, pFp) GOM(dbus_connection_register_fallback, iFEpppp) -//GO(dbus_connection_register_object_path, +GOM(dbus_connection_register_object_path, iFEpppp) GOM(dbus_connection_remove_filter, vFEppp) GO(dbus_connection_return_message, vFpp) GO(dbus_connection_send, iFppp) @@ -71,7 +71,7 @@ GO(dbus_connection_set_max_message_size, vFpl) GO(dbus_connection_set_max_received_size, vFpl) GO(dbus_connection_set_route_peer_messages, vFpi) GOM(dbus_connection_set_timeout_functions, iFEpppppp) -//GO(dbus_connection_set_unix_user_function, +GOM(dbus_connection_set_unix_user_function, vFEpppp) GOM(dbus_connection_set_wakeup_main_function, vFEpppp) GOM(dbus_connection_set_watch_functions, iFEpppppp) //GO(dbus_connection_set_windows_user_function, @@ -99,7 +99,7 @@ GO(dbus_message_copy, pFp) GO(dbus_message_demarshal, pFpip) GO(dbus_message_demarshal_bytes_needed, iFpi) GO(dbus_message_free_data_slot, vFp) -GOM(dbus_message_get_args, iFEppip) +GOM(dbus_message_get_args, iFEppiV) GO(dbus_message_get_allow_interactive_authorization, iFp) GOM(dbus_message_get_args_valist, iFEppiA) GO(dbus_message_get_auto_start, iFp) @@ -184,7 +184,7 @@ GO(dbus_server_allocate_data_slot, iFp) GO(dbus_server_disconnect, vFp) GO(dbus_server_free_data_slot, vFp) GO(dbus_server_get_address, pFp) -//GO(dbus_server_get_data, +GO(dbus_server_get_data, pFpi) //GO(dbus_server_get_id, GO(dbus_server_get_is_connected, iFp) GO(dbus_server_listen, pFpp) @@ -214,6 +214,7 @@ GO(dbus_timeout_get_enabled, iFp) GO(dbus_timeout_get_interval, iFp) GO(dbus_timeout_handle, iFp) GOM(dbus_timeout_set_data, vFEppp) +GO(dbus_try_get_local_machine_id, pFp) GO(dbus_type_is_basic, iFi) GO(dbus_type_is_container, iFi) GO(dbus_type_is_fixed, iFi) diff --git a/src/wrapped/wrappeddbusglib1.c b/src/wrapped/wrappeddbusglib1.c index 5218882..1793965 100644 --- a/src/wrapped/wrappeddbusglib1.c +++ b/src/wrapped/wrappeddbusglib1.c @@ -221,8 +221,7 @@ EXPORT void my_dbus_g_proxy_disconnect_signal(x64emu_t* emu, void* proxy, void* my->dbus_g_proxy_disconnect_signal(proxy, name, findGCallbackFct(handler), data); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappeddbusmenuglib.c b/src/wrapped/wrappeddbusmenuglib.c index db73511..d223eda 100644 --- a/src/wrapped/wrappeddbusmenuglib.c +++ b/src/wrapped/wrappeddbusmenuglib.c @@ -18,11 +18,8 @@ #include "emu/x64emu_private.h" #include "callback.h" -#ifdef ANDROID - const char* dbusmenuglibName = "libdbusmenu-glib.so"; -#else - const char* dbusmenuglibName = "libdbusmenu-glib.so.4"; -#endif +const char* dbusmenuglibName = "libdbusmenu-glib.so.4"; +#define ALTNAME "libdbusmenu-glib.so" #define LIBNAME dbusmenuglib @@ -102,8 +99,7 @@ EXPORT void my_dbusmenu_menuitem_send_about_to_show(x64emu_t* emu, void* mi, voi my->dbusmenu_menuitem_send_about_to_show(mi, findDbusmenuMenuitemFct(f), data); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappeddecor0.c b/src/wrapped/wrappeddecor0.c index 409aa09..5b14ce5 100644 --- a/src/wrapped/wrappeddecor0.c +++ b/src/wrapped/wrappeddecor0.c @@ -25,6 +25,78 @@ const char* decor0Name = "libdecor-0.so.0"; #include "generated/wrappeddecor0types.h" -//#include "wrappercallback.h" +#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) \ + +// libdecor_frame_interface ... +typedef struct my_libdecor_frame_interface_s { + uintptr_t configure; //vFppp + uintptr_t close; //vFpp + uintptr_t commit; //vFpp + uintptr_t dismiss_popup; //vFppp + uintptr_t reserved0; + uintptr_t reserved1; + uintptr_t reserved2; + uintptr_t reserved3; + uintptr_t reserved4; + uintptr_t reserved5; + uintptr_t reserved6; + uintptr_t reserved7; + uintptr_t reserved8; + uintptr_t reserved9; +} my_libdecor_frame_interface_t; +#define GO(A) \ +static my_libdecor_frame_interface_t* ref_libdecor_frame_interface_##A = NULL; \ +static void my_libdecor_frame_interface_configure_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_libdecor_frame_interface_##A->configure, "ppp", a, b, c); \ +} \ +static void my_libdecor_frame_interface_close_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(ref_libdecor_frame_interface_##A->close, "pp", a, b); \ +} \ +static void my_libdecor_frame_interface_commit_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(ref_libdecor_frame_interface_##A->commit, "pp", a, b); \ +} \ +static void my_libdecor_frame_interface_dismiss_popup_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_libdecor_frame_interface_##A->dismiss_popup, "ppp", a, b, c); \ +} \ +static my_libdecor_frame_interface_t my_libdecor_frame_interface_fct_##A = { \ + (uintptr_t)my_libdecor_frame_interface_configure_##A, \ + (uintptr_t)my_libdecor_frame_interface_close_##A, \ + (uintptr_t)my_libdecor_frame_interface_commit_##A, \ + (uintptr_t)my_libdecor_frame_interface_dismiss_popup_##A, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \ +}; +SUPER() +#undef GO +static void* find_libdecor_frame_interface_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(ref_libdecor_frame_interface_##A == fct) return &my_libdecor_frame_interface_fct_##A; + SUPER() + #undef GO + #define GO(A) if(ref_libdecor_frame_interface_##A == 0) {ref_libdecor_frame_interface_##A = fct; return &my_libdecor_frame_interface_fct_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libdecor_frame_interface callback\n"); + return NULL; +} + +#undef SUPER + +EXPORT void* my_libdecor_decorate(x64emu_t* emu, void* context, void* wl_surface, void* iface, void* data) +{ + iface = find_libdecor_frame_interface_Fct(iface); + return my->libdecor_decorate(context, wl_surface, iface, data); +} #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappeddecor0_private.h b/src/wrapped/wrappeddecor0_private.h index 517d1f4..c41a140 100644 --- a/src/wrapped/wrappeddecor0_private.h +++ b/src/wrapped/wrappeddecor0_private.h @@ -1,60 +1,60 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif -//GO(libdecor_configuration_get_content_size, -//GO(libdecor_configuration_get_window_state, -//GO(libdecor_decorate, -//GO(libdecor_dispatch, -//GO(libdecor_frame_close, -//GO(libdecor_frame_commit, -//GO(libdecor_frame_dismiss_popup, -//GO(libdecor_frame_get_capabilities, -//GO(libdecor_frame_get_content_height, -//GO(libdecor_frame_get_content_width, -//GO(libdecor_frame_get_max_content_size, -//GO(libdecor_frame_get_min_content_size, -//GO(libdecor_frame_get_title, -//GO(libdecor_frame_get_window_state, -//GO(libdecor_frame_get_wl_surface, -//GO(libdecor_frame_get_xdg_surface, -//GO(libdecor_frame_get_xdg_toplevel, -//GO(libdecor_frame_has_capability, -//GO(libdecor_frame_is_floating, -//GO(libdecor_frame_is_visible, -//GO(libdecor_frame_map, -//GO(libdecor_frame_move, -//GO(libdecor_frame_popup_grab, -//GO(libdecor_frame_popup_ungrab, -//GO(libdecor_frame_ref, -//GO(libdecor_frame_resize, -//GO(libdecor_frame_set_app_id, -//GO(libdecor_frame_set_capabilities, -//GO(libdecor_frame_set_fullscreen, -//GO(libdecor_frame_set_max_content_size, -//GO(libdecor_frame_set_maximized, -//GO(libdecor_frame_set_min_content_size, -//GO(libdecor_frame_set_minimized, -//GO(libdecor_frame_set_parent, -//GO(libdecor_frame_set_title, -//GO(libdecor_frame_set_visibility, -//GO(libdecor_frame_show_window_menu, -//GO(libdecor_frame_toplevel_commit, -//GO(libdecor_frame_translate_coordinate, -//GO(libdecor_frame_unref, -//GO(libdecor_frame_unset_capabilities, -//GO(libdecor_frame_unset_fullscreen, -//GO(libdecor_frame_unset_maximized, -//GO(libdecor_get_fd, -//GO(libdecor_get_wl_display, -//GO(libdecor_new, -//GO(libdecor_notify_plugin_error, -//GO(libdecor_notify_plugin_ready, -//GO(libdecor_plugin_init, -//GO(libdecor_plugin_release, -//GO(libdecor_state_free, -//GO(libdecor_state_get_content_height, -//GO(libdecor_state_get_content_width, -//GO(libdecor_state_get_window_state, -//GO(libdecor_state_new, -//GO(libdecor_unref, +GO(libdecor_configuration_get_content_size, iFpppp) +GO(libdecor_configuration_get_window_state, iFpp) +GOM(libdecor_decorate, pFEpppp) +GO(libdecor_dispatch, iFpi) +GO(libdecor_frame_close, vFp) +GO(libdecor_frame_commit, vFppp) +//GO(libdecor_frame_dismiss_popup, +//GO(libdecor_frame_get_capabilities, +//GO(libdecor_frame_get_content_height, +//GO(libdecor_frame_get_content_width, +GO(libdecor_frame_get_max_content_size, vFppp) +GO(libdecor_frame_get_min_content_size, vFppp) +GO(libdecor_frame_get_title, pFp) +//GO(libdecor_frame_get_window_state, +//GO(libdecor_frame_get_wl_surface, +GO(libdecor_frame_get_xdg_surface, pFp) +GO(libdecor_frame_get_xdg_toplevel, pFp) +GO(libdecor_frame_has_capability, iFpu) +GO(libdecor_frame_is_floating, iFp) +GO(libdecor_frame_is_visible, iFp) +GO(libdecor_frame_map, vFp) +GO(libdecor_frame_move, vFppu) +GO(libdecor_frame_popup_grab, vFpp) +GO(libdecor_frame_popup_ungrab, vFpp) +GO(libdecor_frame_ref, vFp) +GO(libdecor_frame_resize, vFppuu) +GO(libdecor_frame_set_app_id, vFpp) +GO(libdecor_frame_set_capabilities, vFpu) +GO(libdecor_frame_set_fullscreen, vFpp) +GO(libdecor_frame_set_max_content_size, vFpii) +GO(libdecor_frame_set_maximized, vFp) +GO(libdecor_frame_set_min_content_size, vFpii) +GO(libdecor_frame_set_minimized, vFp) +GO(libdecor_frame_set_parent, vFpp) +GO(libdecor_frame_set_title, vFpp) +GO(libdecor_frame_set_visibility, vFpi) +GO(libdecor_frame_show_window_menu, vFppuii) +//GO(libdecor_frame_toplevel_commit, +GO(libdecor_frame_translate_coordinate, vFpiipp) +GO(libdecor_frame_unref, vFp) +GO(libdecor_frame_unset_capabilities, vFpu) +GO(libdecor_frame_unset_fullscreen, vFp) +GO(libdecor_frame_unset_maximized, vFp) +GO(libdecor_get_fd, iFp) +//GO(libdecor_get_wl_display, +GO(libdecor_new, pFpp) +//GO(libdecor_notify_plugin_error, +//GO(libdecor_notify_plugin_ready, +//GO(libdecor_plugin_init, +//GO(libdecor_plugin_release, +GO(libdecor_state_free, vFp) +//GO(libdecor_state_get_content_height, +//GO(libdecor_state_get_content_width, +//GO(libdecor_state_get_window_state, +GO(libdecor_state_new, pFii) +GO(libdecor_unref, vFp) diff --git a/src/wrapped/wrappedexpat.c b/src/wrapped/wrappedexpat.c index be880b8..9cb3f1b 100644 --- a/src/wrapped/wrappedexpat.c +++ b/src/wrapped/wrappedexpat.c @@ -20,6 +20,7 @@ const char* expatName = "libexpat.so.1"; #define LIBNAME expat +#define ALTNAME "libexpat.so" #include "generated/wrappedexpattypes.h" @@ -687,4 +688,14 @@ EXPORT void my_XML_SetSkippedEntityHandler(x64emu_t* emu, void* p, void* f) my->XML_SetSkippedEntityHandler(p, find_SkippedEntity_Fct(f)); } +EXPORT void my_XML_SetCdataSectionHandler(x64emu_t* emu, void* p, void* s, void* e) +{ + my->XML_SetCdataSectionHandler(p, find_StartCdataSection_Fct(s), find_EndCdataSection_Fct(e)); +} + +EXPORT void my_XML_SetDoctypeDeclHandler(x64emu_t* emu, void* p, void* s, void* e) +{ + my->XML_SetDoctypeDeclHandler(p, find_StartDoctypeDecl_Fct(s), find_EndDoctypeDecl_Fct(e)); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedexpat_private.h b/src/wrapped/wrappedexpat_private.h index 5ce94ae..1cd2a36 100644 --- a/src/wrapped/wrappedexpat_private.h +++ b/src/wrapped/wrappedexpat_private.h @@ -1,61 +1,64 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif //GO(_INTERNAL_trim_to_complete_utf8_characters, -//GO(XML_DefaultCurrent, -GO(XML_ErrorString, pFi) +GO(XML_DefaultCurrent, vFp) +GO(XML_ErrorString, pFu) GO(XML_ExpatVersion, pFv) GO(XML_ExpatVersionInfo, pFp) // return a struct of 3 int. Use shadow pointer on ARM64 and x86_64 GO(XML_ExternalEntityParserCreate, pFppp) GO(XML_FreeContentModel, vFpp) GO(XML_GetBase, pFp) GO(XML_GetBuffer, pFpi) -//GO(XML_GetCurrentByteCount, +GO(XML_GetCurrentByteCount, iFp) GO(XML_GetCurrentByteIndex, lFp) GO(XML_GetCurrentColumnNumber, LFp) -GO(XML_GetCurrentLineNumber, iFp) -GO(XML_GetErrorCode, iFp) +GO(XML_GetCurrentLineNumber, LFp) +GO(XML_GetErrorCode, uFp) GO(XML_GetFeatureList, pFv) -//GO(XML_GetIdAttributeIndex, +GO(XML_GetIdAttributeIndex, iFp) GO(XML_GetInputContext, pFppp) -//GO(XML_GetParsingStatus, +GO(XML_GetParsingStatus, vFpp) GO(XML_GetSpecifiedAttributeCount, iFp) -//GO(XML_MemFree, -//GO(XML_MemMalloc, -//GO(XML_MemRealloc, -GO(XML_Parse, iFppii) -GO(XML_ParseBuffer, iFpii) +GO(XML_MemFree, vFpp) +GO(XML_MemMalloc, pFpL) +GO(XML_MemRealloc, pFppL) +GO(XML_Parse, uFppii) +GO(XML_ParseBuffer, uFpii) GO(XML_ParserCreate, pFp) GO(XML_ParserCreate_MM, pFpppp) // return a structure -//GO(XML_ParserCreateNS, +GO(XML_ParserCreateNS, pFpc) GO(XML_ParserFree, vFp) -GO(XML_ParserReset, iFpp) -//GO(XML_ResumeParser, +GO(XML_ParserReset, CFpp) +GO(XML_ResumeParser, uFp) +GO(XML_SetAllocTrackerActivationThreshold, iFpL) +GO(XML_SetAllocTrackerMaximumAmplification, iFpf) GOM(XML_SetAttlistDeclHandler, vFEpp) -GO(XML_SetBase, iFpp) -//GO(XML_SetCdataSectionHandler, +GO(XML_SetBase, uFpp) +GOM(XML_SetCdataSectionHandler, vFEppp) GOM(XML_SetCharacterDataHandler, vFEpp) GOM(XML_SetCommentHandler, vFEpp) GOM(XML_SetDefaultHandler, vFEpp) GOM(XML_SetDefaultHandlerExpand, vFEpp) -//GO(XML_SetDoctypeDeclHandler, +GOM(XML_SetDoctypeDeclHandler, vFEppp) GOM(XML_SetElementDeclHandler, vFEpp) GOM(XML_SetElementHandler, vFEppp) -GO(XML_SetEncoding, iFpp) +GO(XML_SetEncoding, uFpp) GOM(XML_SetEndCdataSectionHandler, vFEpp) GOM(XML_SetEndDoctypeDeclHandler, vFEpp) GOM(XML_SetEndElementHandler, vFEpp) GOM(XML_SetEndNamespaceDeclHandler, vFEpp) GOM(XML_SetEntityDeclHandler, vFEpp) GOM(XML_SetExternalEntityRefHandler, vFEpp) -//GO(XML_SetExternalEntityRefHandlerArg, +GO(XML_SetExternalEntityRefHandlerArg, vFpp) GO(XML_SetHashSalt, iFpL) GOM(XML_SetNamespaceDeclHandler, vFEppp) GOM(XML_SetNotationDeclHandler, vFEpp) GOM(XML_SetNotStandaloneHandler, vFEpp) -GO(XML_SetParamEntityParsing, iFpi) +GO(XML_SetParamEntityParsing, iFpu) GOM(XML_SetProcessingInstructionHandler, vFEpp) +GO(XML_SetReparseDeferralEnabled, iFpi) GO(XML_SetReturnNSTriplet, vFpi) GOM(XML_SetSkippedEntityHandler, vFEpp) GOM(XML_SetStartCdataSectionHandler, vFEpp) @@ -66,6 +69,6 @@ GOM(XML_SetUnknownEncodingHandler, vFEppp) GOM(XML_SetUnparsedEntityDeclHandler, vFEpp) GO(XML_SetUserData, vFpp) GOM(XML_SetXmlDeclHandler, vFEpp) -GO(XML_StopParser, iFpi) -GO(XML_UseForeignDTD, iFpi) -//GO(XML_UseParserAsHandlerArg, +GO(XML_StopParser, uFpC) +GO(XML_UseForeignDTD, uFpC) +GO(XML_UseParserAsHandlerArg, vFp) diff --git a/src/wrapped/wrappedflac.c b/src/wrapped/wrappedflac.c index 06f7617..28005fc 100644 --- a/src/wrapped/wrappedflac.c +++ b/src/wrapped/wrappedflac.c @@ -18,11 +18,9 @@ #include "myalign.h" #include "bridge.h" -#ifdef ANDROID - const char* flacName = "libFLAC.so"; -#else - const char* flacName = "libFLAC.so.8"; -#endif +const char* flacName = "libFLAC.so.8"; +#define ALTNAME "libFLAC.so" +#define ALTNAME2 "libFLAC.so.12" #define LIBNAME flac diff --git a/src/wrapped/wrappedfontconfig.c b/src/wrapped/wrappedfontconfig.c index 41ef350..25d05e5 100644 --- a/src/wrapped/wrappedfontconfig.c +++ b/src/wrapped/wrappedfontconfig.c @@ -18,11 +18,8 @@ #include "emu/x64emu_private.h" #include "myalign.h" -#ifdef ANDROID - const char* fontconfigName = "libfontconfig.so"; -#else - const char* fontconfigName = "libfontconfig.so.1"; -#endif +const char* fontconfigName = "libfontconfig.so.1"; +#define ALTNAME "libfontconfig.so" #define LIBNAME fontconfig diff --git a/src/wrapped/wrappedfontconfig_private.h b/src/wrapped/wrappedfontconfig_private.h index 5403f0d..9ade643 100644 --- a/src/wrapped/wrappedfontconfig_private.h +++ b/src/wrapped/wrappedfontconfig_private.h @@ -1,16 +1,16 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(FcAtomicCreate, pFp) GO(FcAtomicDeleteNew, vFp) GO(FcAtomicDestroy, vFp) GO(FcAtomicLock, iFp) -//GO(FcAtomicNewFile, +GO(FcAtomicNewFile, pFp) GO(FcAtomicOrigFile, pFp) GO(FcAtomicReplaceOrig, iFp) -//GO(FcAtomicUnlock, -//GO(FcBlanksAdd, +GO(FcAtomicUnlock, vFp) +GO(FcBlanksAdd, iFpu) GO(FcBlanksCreate, pFv) GO(FcBlanksDestroy, vFp) GO(FcBlanksIsMember, iFpu) @@ -24,12 +24,13 @@ GO(FcCharSetCopy, pFp) GO(FcCharSetCount, uFp) GO(FcCharSetCoverage, uFpup) GO(FcCharSetCreate, pFv) +GO(FcCharSetDelChar, iFpu) GO(FcCharSetDestroy, vFp) -//GO(FcCharSetEqual, -GO(FcCharSetFirstPage, iFppp) // second p is a fixed sized array +GO(FcCharSetEqual, iFpp) +GO(FcCharSetFirstPage, uFppp) // second p is a fixed sized array GO(FcCharSetHasChar, iFpu) -//GO(FcCharSetIntersect, -//GO(FcCharSetIntersectCount, +GO(FcCharSetIntersect, pFpp) +GO(FcCharSetIntersectCount, uFpp) GO(FcCharSetIsSubset, iFpp) GO(FcCharSetMerge, iFppp) GO(FcCharSetNew, pFv) @@ -44,12 +45,12 @@ GO(FcConfigBuildFonts, iFp) GO(FcConfigCreate, pFv) GO(FcConfigDestroy, vFp) GO(FcConfigEnableHome, iFi) -//GO(FcConfigFilename, +GO(FcConfigFilename, pFp) GO(FcConfigGetBlanks, pFp) GO(FcConfigGetCache, pFp) GO(FcConfigGetCacheDirs, pFp) -//GO(FcConfigGetConfigDirs, -//GO(FcConfigGetConfigFiles, +GO(FcConfigGetConfigDirs, pFp) +GO(FcConfigGetConfigFiles, pFp) GO(FcConfigGetCurrent, pFv) GO(FcConfigGetFontDirs, pFp) GO(FcConfigGetFonts, pFpu) @@ -57,25 +58,25 @@ GO(FcConfigGetRescanInterval, iFp) //GO(FcConfigGetRescanInverval, GO(FcConfigGetSysRoot, pFp) GO(FcConfigHome, pFv) -//GO(FcConfigParseAndLoad, +GO(FcConfigParseAndLoad, iFppi) GO(FcConfigReference, pFp) -//GO(FcConfigSetCurrent, +GO(FcConfigSetCurrent, iFp) GO(FcConfigSetRescanInterval, iFpi) //GO(FcConfigSetRescanInverval, GO(FcConfigSubstitute, iFppu) GO(FcConfigSubstituteWithPat, iFpppu) -//GO(FcConfigUptoDate, +GO(FcConfigUptoDate, iFp) GO(FcDefaultSubstitute, vFp) GO(FcDirCacheLoad, pFppp) GO(FcDirCacheLoadFile, pFpp) GO(FcDirCacheRead, pFpip) -//GO(FcDirCacheUnlink, +GO(FcDirCacheUnlink, iFpp) GO(FcDirCacheUnload, vFp) -//GO(FcDirCacheValid, +GO(FcDirCacheValid, iFp) GO(FcDirSave, iFppp) GO(FcDirScan, iFpppppi) GO(FcFileIsDir, iFp) -//GO(FcFileScan, +GO(FcFileScan, iFpppppi) GO(FcFini, vFv) GO(FcFontList, pFppp) GO(FcFontMatch, pFppp) @@ -90,21 +91,21 @@ GO(FcFontSetSort, pFppipipp) GO(FcFontSetSortDestroy, vFp) GO(FcFontSort, pFppipp) GO(FcFreeTypeCharIndex, uFpu) -//GO(FcFreeTypeCharSet, +GO(FcFreeTypeCharSet, pFpp) //GO(FcFreeTypeCharSetAndSpacing, GO(FcFreeTypeQuery, pFpupp) GO(FcFreeTypeQueryFace, pFppip) -//GO(FcGetLangs, +GO(FcGetLangs, pFv) GO(FcGetVersion, iFv) GO(FcInit, iFv) GO(FcInitBringUptoDate, iFv) -//GO(FcInitLoadConfig, +GO(FcInitLoadConfig, pFv) GO(FcInitLoadConfigAndFonts, pFv) GO(FcInitReinitialize, iFv) GO(FcLangGetCharSet, pFp) GO(FcLangSetAdd, iFpp) GO(FcLangSetCompare, uFpp) -//GO(FcLangSetContains, +GO(FcLangSetContains, iFpp) GO(FcLangSetCopy, pFp) GO(FcLangSetCreate, pFv) GO(FcLangSetDestroy, vFp) @@ -115,15 +116,15 @@ GO(FcLangSetHasLang, uFpp) GO(FcMatrixCopy, pFp) GO(FcMatrixEqual, iFpp) GO(FcMatrixMultiply, vFppp) -//GO(FcMatrixRotate, -//GO(FcMatrixScale, +GO(FcMatrixRotate, vFpdd) +GO(FcMatrixScale, vFpdd) GO(FcMatrixShear, vFpdd) GO(FcNameConstant, iFpp) GO(FcNameGetConstant, pFp) GO(FcNameGetObjectType, pFp) GO(FcNameParse, pFp) -//GO(FcNameRegisterConstants, -//GO(FcNameRegisterObjectTypes, +GO(FcNameRegisterConstants, iFpi) +GO(FcNameRegisterObjectTypes, iFpi) GO(FcNameUnparse, pFp) GO(FcNameUnregisterConstants, iFpi) GO(FcNameUnregisterObjectTypes, iFpi) @@ -132,16 +133,16 @@ GOM(FcObjectSetBuild, pFEpV) GO(FcObjectSetCreate, pFv) GO(FcObjectSetDestroy, vFp) GOM(FcObjectSetVaBuild, pFEpA) -GO(FcPatternAdd, iFppiLi) // FcValue is a typedef with int+union, with biggest part is a double => so 1 int and 1"L" +GO(FcPatternAdd, iFppiLi) // Warning: failed to confirm GO(FcPatternAddBool, iFppi) GO(FcPatternAddCharSet, iFppp) GO(FcPatternAddDouble, iFppd) -GO(FcPatternAddFTFace, iFppp) +GO(FcPatternAddFTFace, iFppp) // Warning: failed to confirm GO(FcPatternAddInteger, iFppi) GO(FcPatternAddLangSet, iFppp) GO(FcPatternAddMatrix, iFppp) GO(FcPatternAddString, iFppp) -GO(FcPatternAddWeak, iFppiLi) +GO(FcPatternAddWeak, iFppiLi) // Warning: failed to confirm GOM(FcPatternBuild, pFEpV) GO(FcPatternCreate, pFv) GO(FcPatternDel, iFpp) @@ -155,7 +156,7 @@ GO(FcPatternGet, uFppip) GO(FcPatternGetBool, uFppip) GO(FcPatternGetCharSet, uFppip) GO(FcPatternGetDouble, uFppip) -GO(FcPatternGetFTFace, iFppip) +GO(FcPatternGetFTFace, iFppip) // Warning: failed to confirm GO(FcPatternGetInteger, uFppip) GO(FcPatternGetLangSet, uFppip) GO(FcPatternGetMatrix, uFppip) @@ -175,7 +176,7 @@ GO(FcStrDowncase, pFp) GO(FcStrFree, vFp) GO(FcStrListCreate, pFp) GO(FcStrListDone, vFp) -GO(FcStrListFirst, vFp) //2.11.0+ +GO(FcStrListFirst, vFp) GO(FcStrListNext, pFp) GO(FcStrPlus, pFpp) GO(FcStrSetAdd, iFpp) diff --git a/src/wrapped/wrappedfreetype.c b/src/wrapped/wrappedfreetype.c index 7e02db0..cfb5e76 100644 --- a/src/wrapped/wrappedfreetype.c +++ b/src/wrapped/wrappedfreetype.c @@ -18,13 +18,9 @@ #include "emu/x64emu_private.h" #include "myalign.h" -const char* freetypeName = -#ifdef ANDROID - "libfreetype.so" -#else - "libfreetype.so.6" -#endif - ; +const char* freetypeName = "libfreetype.so.6"; +#define ALTNAME "libfreetype.so" + #define LIBNAME freetype typedef void (*vFp_t)(void*); diff --git a/src/wrapped/wrappedfreetype_private.h b/src/wrapped/wrappedfreetype_private.h index 7ec258d..903f0f8 100644 --- a/src/wrapped/wrappedfreetype_private.h +++ b/src/wrapped/wrappedfreetype_private.h @@ -1,5 +1,5 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(FT_Activate_Size, iFp) @@ -15,7 +15,7 @@ GO(FT_Bitmap_Done, iFpp) GO(FT_Bitmap_Embolden, iFppll) GO(FT_Bitmap_Init, vFp) GO(FT_Bitmap_New, vFp) -//GO(FT_CeilFix, +GO(FT_CeilFix, lFl) //GO(FT_ClassicKern_Free, //GO(FT_ClassicKern_Validate, GO(FT_Cos, lFl) @@ -28,7 +28,7 @@ GO(FT_Done_MM_Var, iFpp) GO(FT_Done_Size, iFp) //GO(FT_Face_CheckTrueTypePatents, //GO(FT_Face_GetCharsOfVariant, -GO(FT_Face_GetCharVariantIndex, uFpuu) +GO(FT_Face_GetCharVariantIndex, uFpLL) //GO(FT_Face_GetCharVariantIsDefault, //GO(FT_Face_GetVariantSelectors, //GO(FT_Face_GetVariantsOfChar, @@ -37,17 +37,17 @@ GO(FT_Face_Properties, iFpup) GO(FT_FloorFix, lFl) GO(FT_Get_Advance, iFpiup) GO(FT_Get_Advances, iFpuuip) -//GO(FT_Get_BDF_Charset_ID, -//GO(FT_Get_BDF_Property, +//GO(FT_Get_BDF_Charset_ID, +GO(FT_Get_BDF_Property, iFppp) GO(FT_Get_Char_Index, uFpL) GO(FT_Get_Charmap_Index, iFp) GO(FT_Get_Color_Glyph_Layer, iFpupp) GO(FT_Get_Color_Glyph_Paint, iFpuip) GO(FT_Get_Color_Glyph_ClipBox, iFpup) GO(FT_Get_Colorline_Stops, iFppp) -//GO(FT_Get_CID_From_Glyph_Index, -//GO(FT_Get_CID_Is_Internally_CID_Keyed, -//GO(FT_Get_CID_Registry_Ordering_Supplement, +GO(FT_Get_CID_From_Glyph_Index, iFpup) +GO(FT_Get_CID_Is_Internally_CID_Keyed, iFpp) +GO(FT_Get_CID_Registry_Ordering_Supplement, iFpppp) //GO(FT_Get_CMap_Format, //GO(FT_Get_CMap_Language_ID, GO(FT_Get_First_Char, LFpp) @@ -81,8 +81,9 @@ GO(FT_Get_SubGlyph_Info, iFpuppppp) GO(FT_Get_Track_Kerning, iFplip) GO(FT_Get_Transform, vFppp) GO(FT_Get_TrueType_Engine_Type, uFp) +GO(FT_Get_Var_Axis_Flags, iFpup) GO(FT_Get_Var_Blend_Coordinates, iFpup) -//GO(FT_Get_Var_Design_Coordinates, +GO(FT_Get_Var_Design_Coordinates, iFpup) GO(FT_Get_WinFNT_Header, iFpp) // does FT_WinFNT_HeaderRec_ needs alignment? GO(FT_Get_X11_Font_Format, pFp) GO(FT_Glyph_Copy, iFpp) @@ -141,6 +142,7 @@ GO(FT_Outline_Reverse, vFp) GO(FT_Outline_Transform, vFpp) GO(FT_Outline_Translate, vFpll) GO(FT_Palette_Select, iFpWp) +GO(FT_Palette_Data_Get, iFpp) GO(FT_Property_Get, iFpppp) GO(FT_Property_Set, iFpppp) GO(FT_Reference_Face, iFp) @@ -148,13 +150,14 @@ GO(FT_Reference_Face, iFp) GO(FT_Remove_Module, iFpp) GO(FT_Render_Glyph, iFpu) GO(FT_Request_Size, iFpp) -//GO(FT_RoundFix, -GO(FT_Select_Charmap, iFpi) +GO(FT_RoundFix, lFl) +GO(FT_Select_Charmap, iFpu) GO(FT_Select_Size, iFpi) GO(FT_Set_Charmap, iFpp) GO(FT_Set_Char_Size, iFplluu) //GO(FT_Set_Debug_Hook, GO(FT_Set_Default_Properties, vFp) +GO(FT_Set_Named_Instance, iFpu) //GO(FT_Set_MM_Blend_Coordinates, GO(FT_Set_MM_Design_Coordinates, iFpup) GO(FT_Set_Pixel_Sizes, iFpuu) diff --git a/src/wrapped/wrappedgconf2.c b/src/wrapped/wrappedgconf2.c index eefd223..9195610 100644 --- a/src/wrapped/wrappedgconf2.c +++ b/src/wrapped/wrappedgconf2.c @@ -84,8 +84,7 @@ EXPORT uint32_t my_gconf_client_notify_add(x64emu_t* emu, void* client, void* se return my->gconf_client_notify_add(client, section, findGConfClientNotifyFuncFct(f), data, findGFreeFctFct(d), error); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgcrypt_private.h b/src/wrapped/wrappedgcrypt_private.h index 4aa3dcb..db1b5f1 100644 --- a/src/wrapped/wrappedgcrypt_private.h +++ b/src/wrapped/wrappedgcrypt_private.h @@ -24,7 +24,7 @@ GO(gcry_check_version, pFp) //GO(gcry_cipher_setctr, //GO(gcry_cipher_setiv, //GO(gcry_cipher_setkey, -GO(gcry_control, uFuM) +GO(gcry_control, uFuNN) //GO(gcry_create_nonce, //GO(gcry_ctx_release, //GO(gcry_ecc_get_algo_keylen, @@ -158,7 +158,7 @@ GO(gcry_mpi_snew, pFu) //GO(gcry_pk_algo_info, //GO(gcry_pk_algo_name, //GO(gcry_pk_ctl, -//GO(gcry_pk_decrypt, +GO(gcry_pk_decrypt, uFppp) GO(gcry_pk_encrypt, uFppp) //GO(gcry_pk_genkey, //GO(gcry_pk_get_curve, diff --git a/src/wrapped/wrappedgdk3.c b/src/wrapped/wrappedgdk3.c index 29d7626..835c574 100644 --- a/src/wrapped/wrappedgdk3.c +++ b/src/wrapped/wrappedgdk3.c @@ -18,11 +18,9 @@ #include "emu/x64emu_private.h" #include "gtkclass.h" -#ifdef ANDROID - const char* gdk3Name = "libgdk-3.so"; -#else - const char* gdk3Name = "libgdk-3.so.0"; -#endif +const char* gdk3Name = "libgdk-3.so.0"; +#define ALTNAME "libgdk-3.so" + #define LIBNAME gdk3 //#define ADDED_FUNCTIONS() @@ -125,48 +123,66 @@ static void* findGCallbackFct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for gdk3 generic GCallback\n"); return NULL; } - -#undef SUPER - - -static void my3_event_handler(void* event, my_signal_t* sig) -{ - RunFunctionFmt(sig->c_handler, "pp", event, sig->data) ; +// EventHandler +#define GO(A) \ +static uintptr_t my_EventHandler_fct_##A = 0; \ +static void* my_EventHandler_##A(void* a, void* b, void* c, void* d, void* e) \ +{ \ + return (void*)RunFunctionFmt(my_EventHandler_fct_##A, "ppppp", a, b, c, d, e); \ } - -EXPORT void my3_gdk_event_handler_set(x64emu_t* emu, void* func, void* data, void* notify) +SUPER() +#undef GO +static void* findEventHandlerFct(void* fct) { - if(!func) - return my->gdk_event_handler_set(func, data, notify); - - my_signal_t* sig = new_mysignal(func, data, notify); - my->gdk_event_handler_set(my3_event_handler, sig, my_signal_delete); + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_EventHandler_fct_##A == (uintptr_t)fct) return my_EventHandler_##A; + SUPER() + #undef GO + #define GO(A) if(my_EventHandler_fct_##A == 0) {my_EventHandler_fct_##A = (uintptr_t)fct; return my_EventHandler_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gdk3 generic EventHandler\n"); + return NULL; } - -static void my3_input_function(my_signal_t* sig, int source, int condition) +// GdkSeatGrabPrepareFunc +#define GO(A) \ + static uintptr_t my_GdkSeatGrabPrepareFunc_fct_##A = 0; \ + static void* my_GdkSeatGrabPrepareFunc_##A(void* a, void* b, void* c) \ + { \ + return (void*)RunFunctionFmt(my_GdkSeatGrabPrepareFunc_fct_##A, "ppp", a, b, c); \ + } +SUPER() +#undef GO +static void* findGdkSeatGrabPrepareFuncFct(void* fct) { - RunFunctionFmt(sig->c_handler, "pii", sig->data, source, condition) ; + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_GdkSeatGrabPrepareFunc_fct_##A == (uintptr_t)fct) return my_GdkSeatGrabPrepareFunc_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_GdkSeatGrabPrepareFunc_fct_##A == 0) { \ + my_GdkSeatGrabPrepareFunc_fct_##A = (uintptr_t)fct; \ + return my_GdkSeatGrabPrepareFunc_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for gdk3 GdkSeatGrabPrepareFunc\n"); + return NULL; } -EXPORT int my3_gdk_input_add(x64emu_t* emu, int source, int condition, void* f, void* data) -{ - if(!f) - return my->gdk_input_add_full(source, condition, f, data, NULL); +#undef SUPER - my_signal_t* sig = new_mysignal(f, data, NULL); - return my->gdk_input_add_full(source, condition, my3_input_function, sig, my_signal_delete); -} -EXPORT int my3_gdk_input_add_full(x64emu_t* emu, int source, int condition, void* f, void* data, void* notify) +EXPORT void my3_gdk_event_handler_set(x64emu_t* emu, void* func, void* data, void* notify) { - if(!f) - return my->gdk_input_add_full(source, condition, f, data, notify); - - my_signal_t* sig = new_mysignal(f, data, notify); - return my->gdk_input_add_full(source, condition, my3_input_function, sig, my_signal_delete); + return my->gdk_event_handler_set(findEventHandlerFct(func), data, findGDestroyNotifyFct(notify)); } + EXPORT void my3_gdk_init(x64emu_t* emu, void* argc, void* argv) { my->gdk_init(argc, argv); @@ -210,16 +226,16 @@ EXPORT void my3_gdk_threads_set_lock_functions(x64emu_t* emu, void* enter_fn, vo my->gdk_threads_set_lock_functions(findGCallbackFct(enter_fn), findGCallbackFct(leave_fn)); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +EXPORT uint32_t my3_gdk_seat_grab(x64emu_t* emu, void* seat, void* window, uint32_t cap, int oes, void* cursor, void* ev, void* func, void* data) +{ + return my->gdk_seat_grab(seat, window, cap, oes, cursor, ev, findGdkSeatGrabPrepareFuncFct(func), data); +} + +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define ALTMY my3_ -#ifdef ANDROID -#define NEEDED_LIBS "libgobject-2.0.so", "libgio-2.0.so", "libgdk_pixbuf-2.0.so" -#else #define NEEDED_LIBS "libgobject-2.0.so.0", "libgio-2.0.so.0", "libgdk_pixbuf-2.0.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgdk3_private.h b/src/wrapped/wrappedgdk3_private.h index 8dcee79..e6b1a93 100644 --- a/src/wrapped/wrappedgdk3_private.h +++ b/src/wrapped/wrappedgdk3_private.h @@ -1,10 +1,10 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//GOM(gdk_add_client_message_filter, vFpBp) GO(gdk_add_option_entries_libgtk_only, vFp) -//GO(gdk_app_launch_context_get_type, +GO(gdk_anchor_hints_get_type, LFv) +GO(gdk_app_launch_context_get_type, LFv) GO(gdk_app_launch_context_new, pFv) GO(gdk_app_launch_context_set_desktop, vFpi) GO(gdk_app_launch_context_set_display, vFpp) @@ -15,10 +15,18 @@ GO(gdk_app_launch_context_set_timestamp, vFpu) GO(gdk_atom_intern, pFpi) GO(gdk_atom_intern_static_string, pFp) GO(gdk_atom_name, pFp) -GO(gdk_axis_use_get_type, iFv) +GO(gdk_axis_flags_get_type, LFv) +GO(gdk_axis_use_get_type, LFv) GO(gdk_beep, vFv) -GO(gdk_bitmap_create_from_data, pFppii) -GO(gdk_byte_order_get_type, iFv) +GO(gdk_broadway_cursor_get_type, LFv) +GO(gdk_broadway_display_get_type, LFv) +GO(gdk_broadway_display_hide_keyboard, vFp) +GO(gdk_broadway_display_show_keyboard, vFp) +GO(gdk_broadway_get_last_seen_time, uFp) +GO(gdk_broadway_monitor_get_type, LFv) +GO(gdk_broadway_visual_get_type, LFv) +GO(gdk_broadway_window_get_type, LFv) +GO(gdk_byte_order_get_type, LFv) GO(gdk_cairo_create, pFp) GO(gdk_cairo_draw_from_gl, vFppiiiiiii) GO(gdk_cairo_get_clip_rectangle, iFpp) @@ -26,86 +34,89 @@ GO(gdk_cairo_get_drawing_context, pFp) GO(gdk_cairo_rectangle, vFpp) GO(gdk_cairo_region, vFpp) GO(gdk_cairo_region_create_from_surface, pFp) -GO(gdk_cairo_reset_clip, vFpp) GO(gdk_cairo_set_source_color, vFpp) GO(gdk_cairo_set_source_pixbuf, vFppdd) -GO(gdk_cairo_set_source_pixmap, vFppdd) GO(gdk_cairo_set_source_rgba, vFpp) GO(gdk_cairo_set_source_window, vFppdd) GO(gdk_cairo_surface_create_from_pixbuf, pFpip) -//GO(gdk_cap_style_get_type, -//GO(gdk_char_height, -//GO(gdk_char_measure, -//GO(gdk_char_width, -//GO(gdk_char_width_wc, -GO(gdk_color_alloc, iFpp) -GO(gdk_color_black, iFpp) -GO(gdk_color_change, iFpp) GO(gdk_color_copy, pFp) GO(gdk_color_equal, iFpp) GO(gdk_color_free, vFp) -GO(gdk_color_get_type, iFv) +GO(gdk_color_get_type, LFv) GO(gdk_color_hash, uFp) -GO(gdk_colormap_alloc_color, iFppii) -GO(gdk_colormap_alloc_colors, iFppiiip) -GO(gdk_colormap_change, vFpi) -GO(gdk_colormap_free_colors, vFppi) -GO(gdk_colormap_get_screen, pFp) -GO(gdk_colormap_get_system, pFv) -GO(gdk_colormap_get_system_size, iFv) -GO(gdk_colormap_get_type, iFv) -GO(gdk_colormap_get_visual, pFp) -GO(gdk_colormap_new, pFpi) -GO(gdk_colormap_query_color, vFpLp) -GO(gdk_colormap_ref, pFp) -GO(gdk_colormap_unref, vFp) GO(gdk_color_parse, iFpp) -GO(gdk_colors_alloc, iFpipipi) -GO(gdk_colors_free, vFppiL) -GO(gdk_colors_store, vFppi) GO(gdk_color_to_string, pFp) -GO(gdk_color_white, iFpp) -GO(gdk_crossing_mode_get_type, iFv) +GO(gdk_crossing_mode_get_type, LFv) GO(gdk_cursor_get_cursor_type, iFp) GO(gdk_cursor_get_display, pFp) GO(gdk_cursor_get_image, pFp) -GO(gdk_cursor_get_type, iFv) +GO(gdk_cursor_get_surface, pFppp) +GO(gdk_cursor_get_type, LFv) GO(gdk_cursor_new, pFi) GO(gdk_cursor_new_for_display, pFpi) GO(gdk_cursor_new_from_name, pFpp) GO(gdk_cursor_new_from_pixbuf, pFppii) -GO(gdk_cursor_new_from_pixmap, pFppppii) +GO(gdk_cursor_new_from_surface, pFppdd) GO(gdk_cursor_ref, pFp) -GO(gdk_cursor_type_get_type, iFv) +GO(gdk_cursor_type_get_type, LFv) GO(gdk_cursor_unref, vFp) GO(gdk_device_free_history, vFpi) +GO(gdk_device_get_associated_device, pFp) +GO(gdk_device_get_axes, uFp) GO(gdk_device_get_axis, iFppup) GO(gdk_device_get_axis_use, uFpu) -GO(gdk_device_get_core_pointer, pFv) +GO(gdk_device_get_axis_value, iFpppp) +GO(gdk_device_get_device_type, uFp) +GO(gdk_device_get_display, pFp) GO(gdk_device_get_has_cursor, iFp) GO(gdk_device_get_history, iFppuupp) GO(gdk_device_get_key, iFpupp) +GO(gdk_device_get_last_event_window, pFp) GO(gdk_device_get_mode, uFp) GO(gdk_device_get_name, pFp) GO(gdk_device_get_n_axes, iFp) GO(gdk_device_get_n_keys, iFp) GO(gdk_device_get_position, vFpppp) +GO(gdk_device_get_position_double, vFpppp) +GO(gdk_device_get_product_id, pFp) +GO(gdk_device_get_seat, pFp) GO(gdk_device_get_source, uFp) GO(gdk_device_get_state, vFpppp) -GO(gdk_device_get_type, iFv) -GO(gdk_device_set_axis_use, vFpuu) +GO(gdk_device_get_type, LFv) +GO(gdk_device_get_vendor_id, pFp) +GO(gdk_device_get_window_at_position, pFppp) +GO(gdk_device_get_window_at_position_double, pFppp) +GO(gdk_device_grab, uFppuiupu) +GO(gdk_device_grab_info_libgtk_only, iFpppp) +GO(gdk_device_list_axes, pFp) +GO(gdk_device_list_slave_devices, pFp) GO(gdk_device_manager_get_client_pointer, pFp) -GO(gdk_device_manager_get_type, lFv) +GO(gdk_device_manager_get_display, pFp) +GO(gdk_device_manager_get_type, LFv) +GO(gdk_device_manager_list_devices, pFpu) +GO(gdk_device_pad_feature_get_type, LFv) +GO(gdk_device_pad_get_feature_group, iFpui) +GO(gdk_device_pad_get_group_n_modes, iFpi) +GO(gdk_device_pad_get_n_features, iFpu) +GO(gdk_device_pad_get_n_groups, iFp) +GO(gdk_device_pad_get_type, LFv) +GO(gdk_device_set_axis_use, vFpuu) GO(gdk_device_set_key, vFpuuu) GO(gdk_device_set_mode, iFpu) -GO(gdk_device_set_source, vFpi) -GO(gdk_devices_list, pFv) +GO(gdk_device_tool_get_hardware_id, LFp) +GO(gdk_device_tool_get_serial, LFp) +GO(gdk_device_tool_get_tool_type, uFp) +GO(gdk_device_tool_get_type, LFv) +GO(gdk_device_tool_type_get_type, LFv) +GO(gdk_device_type_get_type, LFv) GO(gdk_device_ungrab, vFpu) -//GOM(gdk_display_add_client_message_filter, vFEpppp) +GO(gdk_device_warp, vFppii) +GO(gdk_disable_multidevice, vFv) GO(gdk_display_beep, vFp) GO(gdk_display_close, vFp) +GO(gdk_display_device_is_grabbed, iFpp) GO(gdk_display_flush, vFp) -GO(gdk_display_get_core_pointer, pFp) +GO(gdk_display_get_app_launch_context, pFp) GO(gdk_display_get_default, pFv) GO(gdk_display_get_default_cursor_size, uFp) GO(gdk_display_get_default_group, pFp) @@ -114,23 +125,27 @@ GO(gdk_display_get_default_seat, pFp) GO(gdk_display_get_device_manager, pFp) GO(gdk_display_get_event, pFp) GO(gdk_display_get_maximal_cursor_size, vFppp) -GO(gdk_display_get_name, pFp) GO(gdk_display_get_monitor, pFpi) -GO(gdk_display_get_monitors, pFp) +GO(gdk_display_get_monitor_at_point, pFpii) +GO(gdk_display_get_monitor_at_window, pFpp) +GO(gdk_display_get_name, pFp) GO(gdk_display_get_n_monitors, iFp) GO(gdk_display_get_n_screens, iFp) GO(gdk_display_get_pointer, vFppppp) GO(gdk_display_get_primary_monitor, pFp) GO(gdk_display_get_screen, pFpi) -GO(gdk_display_get_type, iFv) +GO(gdk_display_get_type, LFv) GO(gdk_display_get_window_at_pointer, pFppp) +GO(gdk_display_has_pending, iFp) GO(gdk_display_is_closed, iFp) GO(gdk_display_keyboard_ungrab, vFpu) GO(gdk_display_list_devices, pFp) +GO(gdk_display_list_seats, pFp) GO(gdk_display_manager_get, pFv) GO(gdk_display_manager_get_default_display, pFp) -GO(gdk_display_manager_get_type, iFv) +GO(gdk_display_manager_get_type, LFv) GO(gdk_display_manager_list_displays, pFp) +GO(gdk_display_manager_open_display, pFpp) GO(gdk_display_manager_set_default_display, vFpp) GO(gdk_display_map_keycode, iFpuppp) GO(gdk_display_notify_startup_complete, vFpp) @@ -143,7 +158,6 @@ GO(gdk_display_put_event, vFpp) GO(gdk_display_request_selection_notification, iFpp) GO(gdk_display_set_double_click_distance, vFpu) GO(gdk_display_set_double_click_time, vFpu) -//GOM(gdk_display_set_pointer_hooks, pFEpp) // GdkDisplayPointerHooks needs wrapping GO(gdk_display_store_clipboard, vFppupi) GO(gdk_display_supports_clipboard_persistence, iFp) GO(gdk_display_supports_composite, iFp) @@ -155,206 +169,146 @@ GO(gdk_display_supports_shapes, iFp) GO(gdk_display_sync, vFp) GO(gdk_display_warp_pointer, vFppii) GO(gdk_drag_abort, vFpu) -GO(gdk_drag_action_get_type, iFv) +GO(gdk_drag_action_get_type, LFv) GO(gdk_drag_begin, pFpp) -GO(gdk_drag_context_get_actions, iFp) +GO(gdk_drag_begin_for_device, pFppp) +GO(gdk_drag_begin_from_point, pFpppii) +GO(gdk_drag_cancel_reason_get_type, LFv) +GO(gdk_drag_context_get_actions, uFp) GO(gdk_drag_context_get_dest_window, pFp) +GO(gdk_drag_context_get_device, pFp) +GO(gdk_drag_context_get_drag_window, pFp) GO(gdk_drag_context_get_protocol, uFp) GO(gdk_drag_context_get_selected_action, uFp) GO(gdk_drag_context_get_source_window, pFp) -GO(gdk_drag_context_get_suggested_action, iFp) -GO(gdk_drag_context_get_type, iFv) +GO(gdk_drag_context_get_suggested_action, uFp) +GO(gdk_drag_context_get_type, LFv) GO(gdk_drag_context_list_targets, pFp) -GO(gdk_drag_context_new, pFv) -GO(gdk_drag_context_ref, vFp) -GO(gdk_drag_context_unref, vFp) +GO(gdk_drag_context_manage_dnd, iFppu) +GO(gdk_drag_context_set_device, vFpp) +GO(gdk_drag_context_set_hotspot, vFpii) GO(gdk_drag_drop, vFpu) +GO(gdk_drag_drop_done, vFpi) GO(gdk_drag_drop_succeeded, iFp) -GO(gdk_drag_find_window, vFppiipp) GO(gdk_drag_find_window_for_screen, vFpppiipp) -GO(gdk_drag_get_protocol, pFpp) -GO(gdk_drag_get_protocol_for_display, pFppp) GO(gdk_drag_get_selection, pFp) GO(gdk_drag_motion, iFppuiiuuu) -GO(gdk_drag_protocol_get_type, iFv) +GO(gdk_drag_protocol_get_type, LFv) GO(gdk_drag_status, vFpuu) -GO(gdk_drawable_copy_to_image, pFppiiiiii) -GO(gdk_drawable_get_clip_region, pFp) -GO(gdk_drawable_get_colormap, pFp) -GO(gdk_drawable_get_data, pFpp) -GO(gdk_drawable_get_depth, iFp) -GO(gdk_drawable_get_display, pFp) -GO(gdk_drawable_get_image, pFpiiii) -GO(gdk_drawable_get_screen, pFp) -GO(gdk_drawable_get_size, vFppp) -GO(gdk_drawable_get_type, iFv) -GO(gdk_drawable_get_visible_region, pFp) -GO(gdk_drawable_get_visual, pFp) -GO(gdk_drawable_ref, pFp) -GO(gdk_drawable_set_colormap, vFpp) -//GOM(gdk_drawable_set_data, vFEpppB) -GO(gdk_drawable_unref, vFp) -GO(gdk_draw_arc, vFppiiiiiii) -GO(gdk_draw_drawable, vFpppiiiiii) -GO(gdk_draw_glyphs, vFpppiip) -GO(gdk_draw_glyphs_transformed, vFppppiip) -GO(gdk_draw_gray_image, vFppiiiiipi) -GO(gdk_draw_image, vFpppiiiiii) -GO(gdk_draw_indexed_image, vFppiiiiipip) -GO(gdk_draw_layout, vFppiip) -GO(gdk_draw_layout_line, vFppiip) -GO(gdk_draw_layout_line_with_colors, vFppiippp) -GO(gdk_draw_layout_with_colors, vFppiippp) -GO(gdk_draw_line, vFppiiii) -GO(gdk_draw_lines, vFpppi) -GO(gdk_draw_pixbuf, vFpppiiiiiiiii) -GO(gdk_draw_point, vFppii) -GO(gdk_draw_points, vFpppi) -GO(gdk_draw_polygon, vFppipi) -GO(gdk_draw_rectangle, vFppiiiii) -GO(gdk_draw_rgb_32_image, vFppiiiiipi) -GO(gdk_draw_rgb_32_image_dithalign, vFppiiiiipiii) -GO(gdk_draw_rgb_image, vFppiiiiipi) -GO(gdk_draw_rgb_image_dithalign, vFppiiiiipiii) -GO(gdk_draw_segments, vFpppi) -GO(gdk_draw_string, vFpppiip) -GO(gdk_draw_text, vFpppiipi) -GO(gdk_draw_text_wc, vFpppiipi) -GO(gdk_draw_trapezoids, vFpppi) +GO(gdk_drawing_context_get_cairo_context, pFp) +GO(gdk_drawing_context_get_clip, pFp) +GO(gdk_drawing_context_get_type, LFv) +GO(gdk_drawing_context_get_window, pFp) +GO(gdk_drawing_context_is_valid, iFp) GO(gdk_drop_finish, vFpiu) GO(gdk_drop_reply, vFpiu) GO(gdk_error_trap_pop, iFv) +GO(gdk_error_trap_pop_ignored, vFv) GO(gdk_error_trap_push, vFv) GO(gdk_event_copy, pFp) GO(gdk_event_free, vFp) GO(gdk_event_get, pFv) GO(gdk_event_get_axis, iFpup) +GO(gdk_event_get_button, iFpp) +GO(gdk_event_get_click_count, iFpp) GO(gdk_event_get_coords, iFppp) -GO(gdk_event_get_graphics_expose, pFp) -GO(gdk_event_get_modifier_state, iFp) +GO(gdk_event_get_device, pFp) +GO(gdk_event_get_device_tool, pFp) +GO(gdk_event_get_event_sequence, pFp) +GO(gdk_event_get_event_type, iFp) +GO(gdk_event_get_keycode, iFpp) +GO(gdk_event_get_keyval, iFpp) +GO(gdk_event_get_modifier_state, uFp) +GO(gdk_event_get_pointer_emulated, iFp) GO(gdk_event_get_root_coords, iFppp) +GO(gdk_event_get_scancode, iFp) GO(gdk_event_get_screen, pFp) -GO(gdk_event_get_state, iFpp) +GO(gdk_event_get_scroll_deltas, iFppp) +GO(gdk_event_get_scroll_direction, iFpp) +GO(gdk_event_get_seat, pFp) GO(gdk_event_get_source_device, pFp) +GO(gdk_event_get_state, iFpp) GO(gdk_event_get_surface, pFp) GO(gdk_event_get_time, uFp) -GO(gdk_event_get_type, iFv) +GO(gdk_event_get_type, LFv) +GO(gdk_event_get_window, pFp) GOM(gdk_event_handler_set, vFEppp) -GO(gdk_event_mask_get_type, lFv) +//GO(gdk_event_is_allocated, +GO(gdk_event_is_scroll_stop_event, iFp) +GO(gdk_event_mask_get_type, LFv) GO(gdk_event_new, pFi) GO(gdk_event_peek, pFv) GO(gdk_event_put, vFp) GO(gdk_event_request_motions, vFp) -GO(gdk_event_send_client_message, iFpp) -GO(gdk_event_send_client_message_for_display, iFppp) -GO(gdk_event_send_clientmessage_toall, vFp) +GO(gdk_event_sequence_get_type, LFv) +GO(gdk_event_set_device, vFpp) +GO(gdk_event_set_device_tool, vFpp) GO(gdk_event_set_screen, vFpp) +GO(gdk_event_set_source_device, vFpp) +GO(gdk_events_get_angle, iFppp) +GO(gdk_events_get_center, iFpppp) +GO(gdk_events_get_distance, iFppp) GO(gdk_events_pending, iFv) -GO(gdk_event_type_get_type, lFv) -GO(gdk_exit, vFi) -//GO(gdk_extension_mode_get_type, -//GO(gdk_fill_get_type, -//GO(gdk_fill_rule_get_type, -//GO(gdk_filter_return_get_type, +GO(gdk_event_triggers_context_menu, iFp) +GO(gdk_event_type_get_type, LFv) +GO(gdk_filter_return_get_type, LFv) GO(gdk_flush, vFv) -//GO(gdk_font_equal, -//GO(gdk_font_from_description, -//GO(gdk_font_from_description_for_display, -//GO(gdk_font_get_display, -GO(gdk_font_get_type, iFv) -//GO(gdk_font_id, -//GO(gdk_font_load, -//GO(gdk_font_load_for_display, -//GO(gdk_font_ref, -//GO(gdk_fontset_load, -//GO(gdk_fontset_load_for_display, -//GO(gdk_font_type_get_type, -//GO(gdk_font_unref, -GO(gdk_frame_clock_phase_get_type, lFv) -GO(gdk_frame_clock_get_type, lFv) -GO(gdk_frame_timings_get_type, lFv) -GO(gdk_free_compound_text, vFp) -GO(gdk_free_text_list, vFp) -GO(gdk_function_get_type, iFv) -GO(gdk_gc_copy, vFpp) -GO(gdk_gc_get_colormap, pFp) -GO(gdk_gc_get_screen, pFp) -GO(gdk_gc_get_type, iFv) -GO(gdk_gc_get_values, vFpp) -GO(gdk_gc_new, pFp) -GO(gdk_gc_new_with_values, pFppu) -GO(gdk_gc_offset, vFpii) -GO(gdk_gc_ref, pFp) -GO(gdk_gc_set_background, vFpp) -GO(gdk_gc_set_clip_mask, vFpp) -GO(gdk_gc_set_clip_origin, vFpii) -GO(gdk_gc_set_clip_rectangle, vFpp) -GO(gdk_gc_set_clip_region, vFpp) -GO(gdk_gc_set_colormap, vFpp) -GO(gdk_gc_set_dashes, vFpipi) -GO(gdk_gc_set_exposures, vFpi) -GO(gdk_gc_set_fill, vFpi) -GO(gdk_gc_set_font, vFpp) -GO(gdk_gc_set_foreground, vFpp) -GO(gdk_gc_set_function,vFpi) -GO(gdk_gc_set_line_attributes, vFpiiii) -GO(gdk_gc_set_rgb_bg_color, vFpp) -GO(gdk_gc_set_rgb_fg_color, vFpp) -GO(gdk_gc_set_stipple, vFpp) -GO(gdk_gc_set_subwindow, vFpi) -GO(gdk_gc_set_tile, vFpp) -GO(gdk_gc_set_ts_origin, vFpii) -GO(gdk_gc_set_values, vFppu) -GO(gdk_gc_unref, vFp) -GO(gdk_gc_values_mask_get_type, iFv) +GO(gdk_frame_clock_begin_updating, vFp) +GO(gdk_frame_clock_end_updating, vFp) +GO(gdk_frame_clock_get_current_timings, pFp) +GO(gdk_frame_clock_get_frame_counter, lFp) +GO(gdk_frame_clock_get_frame_time, lFp) +GO(gdk_frame_clock_get_history_start, lFp) +GO(gdk_frame_clock_get_refresh_info, vFplpp) +GO(gdk_frame_clock_get_timings, pFpl) +GO(gdk_frame_clock_get_type, LFv) +GO(gdk_frame_clock_phase_get_type, LFv) +GO(gdk_frame_clock_request_phase, vFpu) +GO(gdk_frame_timings_get_complete, iFp) +GO(gdk_frame_timings_get_frame_counter, lFp) +GO(gdk_frame_timings_get_frame_time, lFp) +GO(gdk_frame_timings_get_predicted_presentation_time, lFp) +GO(gdk_frame_timings_get_presentation_time, lFp) +GO(gdk_frame_timings_get_refresh_interval, lFp) +GO(gdk_frame_timings_get_type, LFv) +GO(gdk_frame_timings_ref, pFp) +GO(gdk_frame_timings_unref, vFp) +GO(gdk_fullscreen_mode_get_type, LFv) GO(gdk_get_default_root_window, pFv) GO(gdk_get_display, pFv) GO(gdk_get_display_arg_name, pFv) GO(gdk_get_program_class, pFv) GO(gdk_get_show_events, iFv) -GO(gdk_get_use_xshm, iFv) -GO(gdk_gl_context_get_type, LFv) GO(gdk_gl_context_clear_current, vFv) GO(gdk_gl_context_get_current, pFv) +GO(gdk_gl_context_get_debug_enabled, iFp) +GO(gdk_gl_context_get_display, pFp) +GO(gdk_gl_context_get_forward_compatible, iFp) +GO(gdk_gl_context_get_required_version, vFppp) +GO(gdk_gl_context_get_shared_context, pFp) +GO(gdk_gl_context_get_type, LFv) +GO(gdk_gl_context_get_use_es, iFp) +GO(gdk_gl_context_get_version, vFppp) +GO(gdk_gl_context_get_window, pFp) +GO(gdk_gl_context_is_legacy, iFp) GO(gdk_gl_context_make_current, vFp) GO(gdk_gl_context_realize, iFpp) -GO(gdk_grab_status_get_type, iFv) -GO(gdk_gravity_get_type, iFv) -GO(gdk_image_get, pFpiiii) -GO(gdk_image_get_bits_per_pixel, WFp) -GO(gdk_image_get_byte_order, iFp) -GO(gdk_image_get_bytes_per_line, WFp) -GO(gdk_image_get_bytes_per_pixel, WFp) -GO(gdk_image_get_colormap, pFp) -GO(gdk_image_get_depth, WFp) -GO(gdk_image_get_height, iFp) -GO(gdk_image_get_image_type, iFp) -GO(gdk_image_get_pixel, uFpii) -GO(gdk_image_get_pixels, pFp) -GO(gdk_image_get_type, iFv) -GO(gdk_image_get_visual, pFp) -GO(gdk_image_get_width, iFp) -GO(gdk_image_new, pFipii) -GO(gdk_image_new_bitmap, pFppii) -GO(gdk_image_put_pixel, vFpiiu) -GO(gdk_image_ref, pFp) -GO(gdk_image_set_colormap, vFpp) -GO(gdk_image_type_get_type, iFv) -GO(gdk_image_unref, vFp) +GO(gdk_gl_context_set_debug_enabled, vFpi) +GO(gdk_gl_context_set_forward_compatible, vFpi) +GO(gdk_gl_context_set_required_version, vFpii) +GO(gdk_gl_context_set_use_es, vFpi) +GO(gdk_gl_error_get_type, LFv) +GO(gdk_gl_error_quark, uFv) +GO(gdk_grab_ownership_get_type, LFv) +GO(gdk_grab_status_get_type, LFv) +GO(gdk_gravity_get_type, LFv) GOM(gdk_init, vFEpp) GOM(gdk_init_check, iFEpp) -GOM(gdk_input_add, iFEiipp) -GOM(gdk_input_add_full, iFEiippp) -GO(gdk_input_condition_get_type, iFv) -GO(gdk_input_mode_get_type, iFv) -GO(gdk_input_remove, vFi) -GO(gdk_input_set_extension_events, vFpii) -GO(gdk_input_source_get_type, iFv) -GO(gdk_join_style_get_type, iFv) +GO(gdk_input_mode_get_type, LFv) +GO(gdk_input_source_get_type, LFv) GO(gdk_key_event_get_keycode, uFp) GO(gdk_key_event_get_keyval, uFp) GO(gdk_keyboard_grab, uFpiu) -//GO(gdk_keyboard_grab_info_libgtk_only, GO(gdk_keyboard_ungrab, vFu) GO(gdk_keymap_add_virtual_modifiers, vFpp) GO(gdk_keymap_get_caps_lock_state, iFp) @@ -363,7 +317,11 @@ GO(gdk_keymap_get_direction, uFp) GO(gdk_keymap_get_entries_for_keycode, iFpuppp) GO(gdk_keymap_get_entries_for_keyval, iFpupp) GO(gdk_keymap_get_for_display, pFp) -GO(gdk_keymap_get_type, iFv) +GO(gdk_keymap_get_modifier_mask, uFpu) +GO(gdk_keymap_get_modifier_state, uFp) +GO(gdk_keymap_get_num_lock_state, iFp) +GO(gdk_keymap_get_scroll_lock_state, iFp) +GO(gdk_keymap_get_type, LFv) GO(gdk_keymap_have_bidi_layouts, iFp) GO(gdk_keymap_lookup_key, uFpp) GO(gdk_keymap_map_virtual_modifiers, iFpp) @@ -376,11 +334,10 @@ GO(gdk_keyval_name, pFu) GO(gdk_keyval_to_lower, uFu) GO(gdk_keyval_to_unicode, uFu) GO(gdk_keyval_to_upper, uFu) -GO(gdk_line_style_get_type, iFv) GO(gdk_list_visuals, pFv) -//GO(gdk_mbstowcs, -GO(gdk_monitor_get_connector, pFp) -GO(gdk_monitor_get_description, pFp) +GO(gdk_memory_texture_new, pFiiupL) +GO(gdk_modifier_intent_get_type, LFv) +GO(gdk_modifier_type_get_type, LFv) GO(gdk_monitor_get_display, pFp) GO(gdk_monitor_get_geometry, vFpp) GO(gdk_monitor_get_height_mm, iFp) @@ -389,120 +346,54 @@ GO(gdk_monitor_get_model, pFp) GO(gdk_monitor_get_refresh_rate, iFp) GO(gdk_monitor_get_scale_factor, iFp) GO(gdk_monitor_get_subpixel_layout, uFp) +GO(gdk_monitor_get_type, LFv) GO(gdk_monitor_get_width_mm, iFp) -GO(gdk_monitor_is_valid, iFp) -GO(gdk_memory_texture_new, pFiiipL) -GO(gdk_modifier_type_get_type, iFv) -GO(gdk_net_wm_supports, iFp) +GO(gdk_monitor_get_workarea, vFpp) +GO(gdk_monitor_is_primary, iFp) GO(gdk_notify_startup_complete, vFv) GO(gdk_notify_startup_complete_with_id, vFp) -GO(gdk_notify_type_get_type, iFv) +GO(gdk_notify_type_get_type, LFv) GO(gdk_offscreen_window_get_embedder, pFp) -GO(gdk_offscreen_window_get_pixmap, pFp) -GO(gdk_offscreen_window_get_type, iFv) +GO(gdk_offscreen_window_get_surface, pFp) GO(gdk_offscreen_window_set_embedder, vFpp) -GO(gdk_overlap_type_get_type, iFv) -GO(gdk_owner_change_get_type, iFv) +GO(gdk_owner_change_get_type, LFv) GO(gdk_paintable_get_intrinsic_height, iFp) GO(gdk_paintable_get_intrinsic_width, iFp) -GO(gdk_paintable_get_type, pFv) +GO(gdk_paintable_get_type, LFv) GO(gdk_paintable_snapshot, vFppdd) -GO(gdk_pango_attr_emboss_color_new, pFp) -GO(gdk_pango_attr_embossed_new, pFi) -GO(gdk_pango_attr_stipple_new, pFp) GO(gdk_pango_context_get, pFv) +GO(gdk_pango_context_get_for_display, pFp) GO(gdk_pango_context_get_for_screen, pFp) -GO(gdk_pango_context_set_colormap, vFpp) GO(gdk_pango_layout_get_clip_region, pFpiipi) GO(gdk_pango_layout_line_get_clip_region, pFpiipi) -GO(gdk_pango_renderer_get_default, pFp) -GO(gdk_pango_renderer_get_type, iFv) -GO(gdk_pango_renderer_new, pFp) -GO(gdk_pango_renderer_set_drawable, vFpp) -GO(gdk_pango_renderer_set_gc, vFpp) -GO(gdk_pango_renderer_set_override_color, vFpip) -GO(gdk_pango_renderer_set_stipple, vFpip) GO(gdk_parse_args, vFpp) -GO(gdk_pixbuf_get_from_drawable, pFpppiiiiii) -GO(gdk_pixbuf_get_from_image, pFpppiiiiii) +GO(gdk_pixbuf_get_from_surface, pFpiiii) GO(gdk_pixbuf_get_from_window, pFpiiii) -GO(gdk_pixbuf_render_pixmap_and_mask, vFpppi) -GO(gdk_pixbuf_render_pixmap_and_mask_for_colormap, vFppppi) -GO(gdk_pixbuf_render_threshold_alpha, vFppiiiiiii) -GO(gdk_pixbuf_render_to_drawable, vFpppiiiiiiiii) -GO(gdk_pixbuf_render_to_drawable_alpha, vFppiiiiiiiiiii) -GO(gdk_pixmap_colormap_create_from_xpm, pFppppp) -GO(gdk_pixmap_colormap_create_from_xpm_d, pFppppp) -GO(gdk_pixmap_create_from_data, pFppiiipp) -GO(gdk_pixmap_create_from_xpm, pFpppp) -GO(gdk_pixmap_create_from_xpm_d, pFpppp) -GO(gdk_pixmap_foreign_new, pFp) -GO(gdk_pixmap_foreign_new_for_display, pFpp) -GO(gdk_pixmap_foreign_new_for_screen, pFppiii) -GO(gdk_pixmap_get_size, vFppp) -GO(gdk_pixmap_get_type, iFv) -GO(gdk_pixmap_impl_x11_get_type, iFv) -GO(gdk_pixmap_lookup, pFp) -GO(gdk_pixmap_lookup_for_display, pFpp) -GO(gdk_pixmap_new, pFpiii) GO(gdk_pointer_grab, uFpiuppu) -//GO(gdk_pointer_grab_info_libgtk_only, GO(gdk_pointer_is_grabbed, iFv) GO(gdk_pointer_ungrab, vFu) -//GO(gdk_pre_parse_libgtk_only, +GO(gdk_pre_parse_libgtk_only, vFv) +//GO(gdk__private__, GO(gdk_property_change, vFpppiupi) GO(gdk_property_delete, vFpp) GO(gdk_property_get, iFpppLLipppp) -GO(gdk_property_state_get_type, iFv) -GO(gdk_prop_mode_get_type, iFv) +GO(gdk_property_state_get_type, LFv) +GO(gdk_prop_mode_get_type, LFv) GO(gdk_query_depths, vFpp) GO(gdk_query_visual_types, vFpp) -GO(gdk_rectangle_get_type, iFv) +GO(gdk_rectangle_equal, iFpp) +GO(gdk_rectangle_get_type, LFv) GO(gdk_rectangle_intersect, iFppp) GO(gdk_rectangle_union, vFppp) -GO(gdk_region_copy, pFp) -GO(gdk_region_destroy, vFpp) -GO(gdk_region_empty, iFp) -GO(gdk_region_equal, iFpp) -GO(gdk_region_get_clipbox, vFpp) -GO(gdk_region_get_rectangles, vFppp) -GO(gdk_region_intersect, vFpp) -GO(gdk_region_new, pFv) -GO(gdk_region_offset, vFpii) -GO(gdk_region_point_in, iFpii) -GO(gdk_region_polygon, pFpii) -GO(gdk_region_rectangle, pFp) -GO(gdk_region_rect_equal, iFpp) -GO(gdk_region_rect_in, iFpp) -GO(gdk_region_shrink, vFpii) -//GOM(gdk_region_spans_intersect_foreach, vFppiiBp) -GO(gdk_region_subtract, vFpp) -GO(gdk_region_union, vFpp) -GO(gdk_region_union_with_rect, vFpp) -GO(gdk_region_xor, vFpp) +GO(gdk_rgba_copy, pFp) +GO(gdk_rgba_equal, iFpp) GO(gdk_rgba_free, vFp) GO(gdk_rgba_get_type, LFv) +GO(gdk_rgba_hash, uFp) GO(gdk_rgba_parse, iFpp) GO(gdk_rgba_to_string, pFp) -GO(gdk_rgb_cmap_free, vFp) -GO(gdk_rgb_cmap_new, pFpi) -GO(gdk_rgb_colormap_ditherable, iFp) -GO(gdk_rgb_ditherable, iFv) -GO(gdk_rgb_dither_get_type, iFv) -GO(gdk_rgb_find_color, vFpp) -GO(gdk_rgb_gc_set_background, vFpu) -GO(gdk_rgb_gc_set_foreground, vFpu) -GO(gdk_rgb_get_colormap, pFv) -GO(gdk_rgb_get_visual, pFv) -GO(gdk_rgb_init, vFv) -GO(gdk_rgb_set_install, vFi) -GO(gdk_rgb_set_min_colors, vFi) -GO(gdk_rgb_set_verbose, vFi) -GO(gdk_rgb_xpixel_from_rgb, LFu) -GO(gdk_screen_broadcast_client_message, vFpp) GO(gdk_screen_get_active_window, pFp) GO(gdk_screen_get_default, pFv) -GO(gdk_screen_get_default_colormap, pFp) GO(gdk_screen_get_display, pFp) GO(gdk_screen_get_font_options, pFp) GO(gdk_screen_get_height, iFp) @@ -512,22 +403,19 @@ GO(gdk_screen_get_monitor_at_window, iFpp) GO(gdk_screen_get_monitor_geometry, vFpip) GO(gdk_screen_get_monitor_height_mm, iFpi) GO(gdk_screen_get_monitor_plug_name, pFpi) +GO(gdk_screen_get_monitor_scale_factor, iFpi) GO(gdk_screen_get_monitor_width_mm, iFpi) GO(gdk_screen_get_monitor_workarea, vFpip) GO(gdk_screen_get_n_monitors, iFp) GO(gdk_screen_get_number, iFp) GO(gdk_screen_get_primary_monitor, iFp) GO(gdk_screen_get_resolution, dFp) -GO(gdk_screen_get_rgba_colormap, pFp) GO(gdk_screen_get_rgba_visual, pFp) -GO(gdk_screen_get_rgb_colormap, pFp) -GO(gdk_screen_get_rgb_visual, pFp) GO(gdk_screen_get_root_window, pFp) GO(gdk_screen_get_setting, iFppp) -GO(gdk_screen_get_system_colormap, pFp) GO(gdk_screen_get_system_visual, pFp) GO(gdk_screen_get_toplevel_windows, pFp) -GO(gdk_screen_get_type, iFv) +GO(gdk_screen_get_type, LFv) GO(gdk_screen_get_width, iFp) GO(gdk_screen_get_width_mm, iFp) GO(gdk_screen_get_window_stack, pFp) @@ -536,13 +424,20 @@ GO(gdk_screen_height_mm, iFv) GO(gdk_screen_is_composited, iFp) GO(gdk_screen_list_visuals, pFp) GO(gdk_screen_make_display_name, pFp) -GO(gdk_screen_set_default_colormap, vFpp) GO(gdk_screen_set_font_options, vFpp) GO(gdk_screen_set_resolution, vFpd) GO(gdk_screen_width, iFv) GO(gdk_screen_width_mm, iFv) -GO(gdk_scroll_direction_get_type, iFv) +GO(gdk_scroll_direction_get_type, LFv) +GO(gdk_seat_capabilities_get_type, LFv) +GO(gdk_seat_get_capabilities, uFp) +GO(gdk_seat_get_display, pFp) GO(gdk_seat_get_keyboard, pFp) +GO(gdk_seat_get_pointer, pFp) +GO(gdk_seat_get_slaves, pFpu) +GO(gdk_seat_get_type, LFv) +GOM(gdk_seat_grab, uFEppuipppp) +GO(gdk_seat_ungrab, vFp) GO(gdk_selection_convert, vFpppu) GO(gdk_selection_owner_get, pFp) GO(gdk_selection_owner_get_for_display, pFpp) @@ -553,42 +448,20 @@ GO(gdk_selection_send_notify, vFppppu) GO(gdk_selection_send_notify_for_display, vFpppppu) GO(gdk_set_allowed_backends, vFp) GO(gdk_set_double_click_time, vFu) -GO(gdk_set_locale, pFv) -//GOM(gdk_set_pointer_hooks, BFEB) GO(gdk_set_program_class, vFp) GO(gdk_set_show_events, vFi) -GO(gdk_set_sm_client_id, vFp) -GO(gdk_setting_action_get_type, iFv) +GO(gdk_setting_action_get_type, LFv) GO(gdk_setting_get, iFpp) -GO(gdk_set_use_xshm, vFi) -GO(gdk_spawn_command_line_on_screen, iFppp) -//GOM(gdk_spawn_on_screen, iFEppppipppp) -//GOM(gdk_spawn_on_screen_with_pipes, iFEppppippppppp) -GO(gdk_status_get_type, iFv) -//GO(gdk_string_extents, -//GO(gdk_string_height, -//GO(gdk_string_measure, -GO(gdk_string_to_compound_text, iFppppp) -GO(gdk_string_to_compound_text_for_display, iFpppppp) -//GO(gdk_string_width, -//GO(gdk_subwindow_mode_get_type, +GO(gdk_status_get_type, LFv) +GO(gdk_subpixel_layout_get_type, LFv) //GO(gdk_synthesize_window_state, -//GO(gdk_test_render_sync, +GO(gdk_test_render_sync, vFp) GO(gdk_test_simulate_button, iFpiiuui) -//GO(gdk_test_simulate_key, -//GO(gdk_text_extents, -//GO(gdk_text_extents_wc, -//GO(gdk_text_height, -//GO(gdk_text_measure, -GO(gdk_text_property_to_text_list, iFpipip) -GO(gdk_text_property_to_text_list_for_display, iFppipip) -GO(gdk_text_property_to_utf8_list, iFpipip) -GO(gdk_text_property_to_utf8_list_for_display, iFppipip) -//GO(gdk_text_width, -//GO(gdk_text_width_wc, +GO(gdk_test_simulate_key, iFpiiuui) GO(gdk_texture_download, vFppL) -GO(gdk_texture_get_width, uFp) -GO(gdk_texture_get_height, uFp) +GO(gdk_texture_get_height, iFp) +GO(gdk_texture_get_width, iFp) +GO(gdk_text_property_to_utf8_list_for_display, iFppipip) GOM(gdk_threads_add_idle, uFEpp) GOM(gdk_threads_add_idle_full, uFEippp) //GOM(gdk_threads_add_timeout, uFEupp) @@ -599,12 +472,11 @@ GO(gdk_threads_enter, vFv) GO(gdk_threads_init, vFv) GO(gdk_threads_leave, vFv) GOM(gdk_threads_set_lock_functions, vFEpp) -GO(gdk_toplevel_get_type, pFv) +GO(gdk_toplevel_get_type, LFv) +GO(gdk_touchpad_gesture_phase_get_type, LFv) GO(gdk_unicode_to_keyval, uFu) -GO(gdk_utf8_to_compound_text, iFppppp) -GO(gdk_utf8_to_compound_text_for_display, iFpppppp) GO(gdk_utf8_to_string_target, pFp) -GO(gdk_visibility_state_get_type, iFv) +GO(gdk_visibility_state_get_type, LFv) GO(gdk_visual_get_best, pFv) GO(gdk_visual_get_best_depth, iFv) GO(gdk_visual_get_best_type, uFv) @@ -622,23 +494,50 @@ GO(gdk_visual_get_screen, pFp) GO(gdk_visual_get_system, pFv) GO(gdk_visual_get_type, LFv) GO(gdk_visual_get_visual_type, uFp) -GO(gdk_visual_type_get_type, iFv) +GO(gdk_visual_type_get_type, LFv) +GO(gdk_wayland_device_get_node_path, pFp) +GO(gdk_wayland_device_get_type, LFv) +GO(gdk_wayland_device_get_wl_keyboard, pFp) +GO(gdk_wayland_device_get_wl_pointer, pFp) +GO(gdk_wayland_device_get_wl_seat, pFp) +GO(gdk_wayland_device_pad_set_feedback, vFpuup) +GO(gdk_wayland_display_get_type, LFv) +GO(gdk_wayland_display_get_wl_compositor, pFp) +GO(gdk_wayland_display_get_wl_display, pFp) +GO(gdk_wayland_display_prefers_ssd, iFp) +GO(gdk_wayland_display_query_registry, iFpp) +GO(gdk_wayland_display_set_cursor_theme, vFppi) +GO(gdk_wayland_display_set_startup_notification_id, vFpp) +GO(gdk_wayland_gl_context_get_type, LFv) +GO(gdk_wayland_monitor_get_type, LFv) +GO(gdk_wayland_monitor_get_wl_output, pFp) +GO(gdk_wayland_seat_get_wl_seat, pFp) +//GO(gdk_wayland_selection_add_targets_libgtk_only, +//GO(gdk_wayland_selection_clear_targets_libgtk_only, GO(gdk_wayland_toplevel_set_transient_for_exported, iFpp) +GO(gdk_wayland_window_add_frame_callback_surface, vFpp) +GO(gdk_wayland_window_announce_csd, vFp) +GO(gdk_wayland_window_announce_ssd, vFp) +//GOM(gdk_wayland_window_export_handle, iFpppp) GO(gdk_wayland_window_get_type, LFv) +GO(gdk_wayland_window_get_wl_surface, pFp) +GO(gdk_wayland_window_remove_frame_callback_surface, vFpp) +GO(gdk_wayland_window_set_application_id, vFpp) +GO(gdk_wayland_window_set_dbus_properties_libgtk_only, vFppppppp) GO(gdk_wayland_window_set_transient_for_exported, iFpp) -//GO(gdk_wcstombs, +GO(gdk_wayland_window_set_use_custom_surface, vFp) +GO(gdk_wayland_window_unexport_handle, vFp) GOM(gdk_window_add_filter, vFEppp) GO(gdk_window_at_pointer, pFpp) -//GO(gdk_window_attributes_type_get_type, +GO(gdk_window_attributes_type_get_type, LFv) GO(gdk_window_beep, vFp) +GO(gdk_window_begin_draw_frame, pFpp) GO(gdk_window_begin_move_drag, vFpiiiu) +GO(gdk_window_begin_move_drag_for_device, vFppiiiu) GO(gdk_window_begin_paint_rect, vFpp) GO(gdk_window_begin_paint_region, vFpp) GO(gdk_window_begin_resize_drag, vFpuiiiu) -GO(gdk_window_class_get_type, iFv) -GO(gdk_window_clear, vFp) -GO(gdk_window_clear_area, vFpiiii) -GO(gdk_window_clear_area_e, vFpiiii) +GO(gdk_window_begin_resize_drag_for_device, vFpupiiiu) GO(gdk_window_configure_finished, vFp) GO(gdk_window_constrain_size, vFpuiipp) GO(gdk_window_coords_from_parent, vFpddpp) @@ -649,62 +548,71 @@ GO(gdk_window_create_similar_surface, pFpuii) GO(gdk_window_deiconify, vFp) GO(gdk_window_destroy, vFp) //GO(gdk_window_destroy_notify, -//GO(gdk_window_edge_get_type, +GO(gdk_window_edge_get_type, LFv) GO(gdk_window_enable_synchronized_configure, vFp) +GO(gdk_window_end_draw_frame, vFpp) GO(gdk_window_end_paint, vFp) GO(gdk_window_ensure_native, iFp) GO(gdk_window_flush, vFp) GO(gdk_window_focus, vFpu) -GO(gdk_window_foreign_new, pFp) -GO(gdk_window_foreign_new_for_display, pFpp) -//GO(gdk_window_freeze_toplevel_updates_libgtk_only, +GO(gdk_window_freeze_toplevel_updates_libgtk_only, vFp) GO(gdk_window_freeze_updates, vFp) GO(gdk_window_fullscreen, vFp) +GO(gdk_window_fullscreen_on_monitor, vFpi) GO(gdk_window_geometry_changed, vFp) GO(gdk_window_get_accept_focus, iFp) GO(gdk_window_get_background_pattern, pFp) GO(gdk_window_get_children, pFp) +GO(gdk_window_get_children_with_user_data, pFpp) +GO(gdk_window_get_clip_region, pFp) GO(gdk_window_get_composited, iFp) GO(gdk_window_get_cursor, pFp) GO(gdk_window_get_decorations, iFpp) -GO(gdk_window_get_deskrelative_origin, iFppp) +GO(gdk_window_get_device_cursor, pFpp) +GO(gdk_window_get_device_events, uFpp) +GO(gdk_window_get_device_position, pFppppp) +GO(gdk_window_get_device_position_double, pFppppp) GO(gdk_window_get_display, pFp) +GO(gdk_window_get_drag_protocol, uFpp) GO(gdk_window_get_effective_parent, pFp) GO(gdk_window_get_effective_toplevel, pFp) +GO(gdk_window_get_event_compression, iFp) GO(gdk_window_get_events, uFp) GO(gdk_window_get_focus_on_map, iFp) +GO(gdk_window_get_frame_clock, pFp) GO(gdk_window_get_frame_extents, vFpp) +GO(gdk_window_get_fullscreen_mode, uFp) GO(gdk_window_get_geometry, vFppppp) GO(gdk_window_get_group, pFp) GO(gdk_window_get_height, iFp) -GO(gdk_window_get_internal_paint_info, vFpppp) GO(gdk_window_get_modal_hint, iFp) GO(gdk_window_get_origin, iFppp) GO(gdk_window_get_parent, pFp) +GO(gdk_window_get_pass_through, iFp) GO(gdk_window_get_pointer, pFpppp) GO(gdk_window_get_position, vFppp) GO(gdk_window_get_root_coords, vFpiipp) GO(gdk_window_get_root_origin, vFppp) +GO(gdk_window_get_scale_factor, iFp) GO(gdk_window_get_screen, pFp) +GO(gdk_window_get_source_events, uFpu) GO(gdk_window_get_state, uFp) +GO(gdk_window_get_support_multidevice, iFp) GO(gdk_window_get_toplevel, pFp) -GO(gdk_window_get_toplevels, pFp) -GO(gdk_window_get_type, lFv) +GO(gdk_window_get_type, LFv) GO(gdk_window_get_type_hint, uFp) GO(gdk_window_get_update_area, pFp) GO(gdk_window_get_user_data, vFpp) +GO(gdk_window_get_visible_region, pFp) GO(gdk_window_get_visual, pFp) GO(gdk_window_get_width, iFp) GO(gdk_window_get_window_type, uFp) GO(gdk_window_has_native, iFp) GO(gdk_window_hide, vFp) -GO(gdk_window_hints_get_type, iFv) +GO(gdk_window_hints_get_type, LFv) GO(gdk_window_iconify, vFp) -GO(gdk_window_impl_get_type, iFv) -GO(gdk_window_impl_x11_get_type, iFv) -GO(gdk_window_input_shape_combine_mask, vFppii) GO(gdk_window_input_shape_combine_region, vFppii) -//GOM(gdk_window_invalidate_maybe_recurse, vFEppBp) +//GOM(gdk_window_invalidate_maybe_recurse, vFEpppp) GO(gdk_window_invalidate_rect, vFppi) GO(gdk_window_invalidate_region, vFppi) GO(gdk_window_is_destroyed, iFp) @@ -712,143 +620,165 @@ GO(gdk_window_is_input_only, iFp) GO(gdk_window_is_shaped, iFp) GO(gdk_window_is_viewable, iFp) GO(gdk_window_is_visible, iFp) -GO(gdk_window_lookup, pFp) -GO(gdk_window_lookup_for_display, pFpp) GO(gdk_window_lower, vFp) +GO(gdk_window_mark_paint_from_clip, vFpp) GO(gdk_window_maximize, vFp) GO(gdk_window_merge_child_input_shapes, vFp) GO(gdk_window_merge_child_shapes, vFp) GO(gdk_window_move, vFpii) GO(gdk_window_move_region, vFppii) GO(gdk_window_move_resize, vFpiiii) +GO(gdk_window_move_to_rect, vFppuuuii) GO(gdk_window_new, pFppi) -GO(gdk_window_object_get_type, iFv) GO(gdk_window_peek_children, pFp) GO(gdk_window_process_all_updates, vFv) GO(gdk_window_process_updates, vFpi) GO(gdk_window_raise, vFp) -GO(gdk_window_redirect_to_drawable, vFppiiiiii) GO(gdk_window_register_dnd, vFp) GOM(gdk_window_remove_filter, vFEppp) -GO(gdk_window_remove_redirection, vFp) GO(gdk_window_reparent, vFppii) GO(gdk_window_resize, vFpii) GO(gdk_window_restack, vFppi) GO(gdk_window_scroll, vFpii) GO(gdk_window_set_accept_focus, vFpi) GO(gdk_window_set_background, vFpp) +GO(gdk_window_set_background_pattern, vFpp) GO(gdk_window_set_background_rgba, vFpp) -GO(gdk_window_set_back_pixmap, vFppi) GO(gdk_window_set_child_input_shapes, vFp) GO(gdk_window_set_child_shapes, vFp) GO(gdk_window_set_composited, vFpi) GO(gdk_window_set_cursor, vFpp) GO(gdk_window_set_debug_updates, vFi) GO(gdk_window_set_decorations, vFpu) +GO(gdk_window_set_device_cursor, vFppp) +GO(gdk_window_set_device_events, vFppu) +GO(gdk_window_set_event_compression, vFpi) GO(gdk_window_set_events, vFpu) GO(gdk_window_set_focus_on_map, vFpi) +GO(gdk_window_set_fullscreen_mode, vFpu) GO(gdk_window_set_functions, vFpu) GO(gdk_window_set_geometry_hints, vFppu) GO(gdk_window_set_group, vFpp) -GO(gdk_window_set_hints, vFpiiiiiii) -GO(gdk_window_set_icon, vFpppp) GO(gdk_window_set_icon_list, vFpp) GO(gdk_window_set_icon_name, vFpp) +//GOM(gdk_window_set_invalidate_handler, vFpp) GO(gdk_window_set_keep_above, vFpi) GO(gdk_window_set_keep_below, vFpi) -GO(gdk_window_set_modal_hint, iFp) +GO(gdk_window_set_modal_hint, vFpi) GO(gdk_window_set_opacity, vFpd) +GO(gdk_window_set_opaque_region, vFpp) GO(gdk_window_set_override_redirect, vFpi) +GO(gdk_window_set_pass_through, vFpi) GO(gdk_window_set_role, vFpp) +GO(gdk_window_set_shadow_width, vFpiiii) GO(gdk_window_set_skip_pager_hint, vFpi) GO(gdk_window_set_skip_taskbar_hint, vFpi) +GO(gdk_window_set_source_events, vFpuu) GO(gdk_window_set_startup_id, vFpp) GO(gdk_window_set_static_gravities, iFpi) +GO(gdk_window_set_support_multidevice, vFpi) GO(gdk_window_set_title, vFpp) GO(gdk_window_set_transient_for, vFpp) GO(gdk_window_set_type_hint, vFpu) GO(gdk_window_set_urgency_hint, vFpi) GO(gdk_window_set_user_data, vFpp) -GO(gdk_window_shape_combine_mask, vFppii) GO(gdk_window_shape_combine_region, vFppii) GO(gdk_window_show, vFp) GO(gdk_window_show_unraised, vFp) -GO(gdk_window_state_get_type, iFv) +GO(gdk_window_show_window_menu, iFpp) +GO(gdk_window_state_get_type, LFv) GO(gdk_window_stick, vFp) -//GO(gdk_window_thaw_toplevel_updates_libgtk_only, +GO(gdk_window_thaw_toplevel_updates_libgtk_only, vFp) GO(gdk_window_thaw_updates, vFp) -GO(gdk_window_type_get_type, iFv) -GO(gdk_window_type_hint_get_type, iFv) +GO(gdk_window_type_get_type, LFv) +GO(gdk_window_type_hint_get_type, LFv) GO(gdk_window_unfullscreen, vFp) GO(gdk_window_unmaximize, vFp) GO(gdk_window_unstick, vFp) +GO(gdk_window_window_class_get_type, LFv) GO(gdk_window_withdraw, vFp) -GO(gdk_wm_decoration_get_type, iFv) -GO(gdk_wm_function_get_type, iFv) -GO(gdk_x11_atom_to_xatom, pFp) -GO(gdk_x11_atom_to_xatom_for_display, pFpp) -GO(gdk_x11_colormap_foreign_new, pFpp) -GO(gdk_x11_colormap_get_xcolormap, pFp) -GO(gdk_x11_colormap_get_xdisplay, pFp) -GO(gdk_x11_cursor_get_xcursor, pFp) +GO(gdk_wm_decoration_get_type, LFv) +GO(gdk_wm_function_get_type, LFv) +GO(gdk_x11_app_launch_context_get_type, LFv) +GO(gdk_x11_atom_to_xatom, LFp) +GO(gdk_x11_atom_to_xatom_for_display, LFpp) +GO(gdk_x11_cursor_get_type, LFv) +GO(gdk_x11_cursor_get_xcursor, LFp) GO(gdk_x11_cursor_get_xdisplay, pFp) +GO(gdk_x11_device_core_get_type, LFv) +GO(gdk_x11_device_get_id, iFp) +GO(gdk_x11_device_manager_core_get_type, LFv) +GO(gdk_x11_device_manager_lookup, pFpi) +GO(gdk_x11_device_manager_xi2_get_type, LFv) +GO(gdk_x11_device_xi2_get_type, LFv) GO(gdk_x11_display_broadcast_startup_message, vFppppppppppppp) //vaarg after 2 p +GO(gdk_x11_display_error_trap_pop, iFp) +GO(gdk_x11_display_error_trap_pop_ignored, vFp) +GO(gdk_x11_display_error_trap_push, vFp) +GO(gdk_x11_display_get_glx_version, iFppp) GO(gdk_x11_display_get_startup_notification_id, pFp) -GO(gdk_x11_display_get_type, iFv) +GO(gdk_x11_display_get_type, LFv) GO(gdk_x11_display_get_user_time, uFp) GO(gdk_x11_display_get_xdisplay, pFp) -GO(gdk_x11_window_get_type, LFv) -GO(gdk_x11_window_get_xid, LFp) GO(gdk_x11_display_grab, vFp) +GO(gdk_x11_display_manager_get_type, LFv) GO(gdk_x11_display_set_cursor_theme, vFppi) -//GO(gdk_x11_display_string_to_compound_text, -//GO(gdk_x11_display_text_property_to_text_list, +GO(gdk_x11_display_set_startup_notification_id, vFpp) +GO(gdk_x11_display_set_window_scale, vFpi) +GO(gdk_x11_display_string_to_compound_text, iFpppppp) +GO(gdk_x11_display_text_property_to_text_list, iFppipip) GO(gdk_x11_display_ungrab, vFp) -//GO(gdk_x11_display_utf8_to_compound_text, -GO(gdk_x11_drawable_get_xdisplay, pFp) -GO(gdk_x11_drawable_get_xid, pFp) -GO(gdk_x11_font_get_name, pFp) -GO(gdk_x11_font_get_xdisplay, pFp) -GO(gdk_x11_font_get_xfont, pFp) -//GO(gdk_x11_free_compound_text, -//GO(gdk_x11_free_text_list, -GO(gdk_x11_gc_get_xdisplay, pFp) -GO(gdk_x11_gc_get_xgc, pFp) -GO(gdk_x11_get_default_root_xwindow, pFv) +GO(gdk_x11_display_utf8_to_compound_text, iFpppppp) +GO(gdk_x11_drag_context_get_type, LFv) +GO(gdk_x11_free_compound_text, vFp) +GO(gdk_x11_free_text_list, vFp) +GO(gdk_x11_get_default_root_xwindow, LFv) GO(gdk_x11_get_default_screen, iFv) GO(gdk_x11_get_default_xdisplay, pFv) +GO(gdk_x11_get_parent_relative_pattern, pFv) GO(gdk_x11_get_server_time, uFp) -GO(gdk_x11_get_xatom_by_name, pFp) -GO(gdk_x11_get_xatom_by_name_for_display, pFpp) -GO(gdk_x11_get_xatom_name, pFp) -GO(gdk_x11_get_xatom_name_for_display, pFpp) +GO(gdk_x11_get_xatom_by_name, LFp) +GO(gdk_x11_get_xatom_by_name_for_display, LFpp) +GO(gdk_x11_get_xatom_name, pFL) +GO(gdk_x11_get_xatom_name_for_display, pFpL) +GO(gdk_x11_gl_context_get_type, LFv) GO(gdk_x11_grab_server, vFv) -GO(gdk_x11_image_get_xdisplay, pFp) -GO(gdk_x11_image_get_ximage, pFp) +GO(gdk_x11_keymap_get_group_for_state, iFpu) +GO(gdk_x11_keymap_get_type, LFv) +GO(gdk_x11_keymap_key_is_modifier, iFpu) GO(gdk_x11_lookup_xdisplay, pFp) -GO(gdk_x11_pixmap_get_drawable_impl, pFp) +GO(gdk_x11_monitor_get_output, LFp) +GO(gdk_x11_monitor_get_type, LFv) GO(gdk_x11_register_standard_event_type, vFpii) -GO(gdk_x11_screen_get_monitor_output, pFpi) +GO(gdk_x11_screen_get_current_desktop, uFp) +GO(gdk_x11_screen_get_monitor_output, LFpi) +GO(gdk_x11_screen_get_number_of_desktops, uFp) GO(gdk_x11_screen_get_screen_number, iFp) +GO(gdk_x11_screen_get_type, LFv) GO(gdk_x11_screen_get_window_manager_name, pFp) GO(gdk_x11_screen_get_xscreen, pFp) -GO(gdk_x11_screen_lookup_visual, pFpp) +GO(gdk_x11_screen_lookup_visual, pFpL) GO(gdk_x11_screen_supports_net_wm_hint, iFpp) GO(gdk_x11_set_sm_client_id, vFp) GO(gdk_x11_surface_get_xid, LFp) GO(gdk_x11_ungrab_server, vFv) +GO(gdk_x11_visual_get_type, LFv) GO(gdk_x11_visual_get_xvisual, pFp) -GO(gdk_x11_window_foreign_new_for_display, pFpp) -GO(gdk_x11_window_get_drawable_impl, pFp) -GO(gdk_x11_window_lookup_for_display, pFpp) +GO(gdk_x11_window_foreign_new_for_display, pFpL) +GO(gdk_x11_window_get_desktop, uFp) +GO(gdk_x11_window_get_type, LFv) +GO(gdk_x11_window_get_xid, LFp) +GO(gdk_x11_window_lookup_for_display, pFpL) GO(gdk_x11_window_move_to_current_desktop, vFp) +GO(gdk_x11_window_move_to_desktop, vFpu) +GO(gdk_x11_window_set_frame_extents, vFpiiii) +GO(gdk_x11_window_set_frame_sync_enabled, vFpi) +GO(gdk_x11_window_set_hide_titlebar_when_maximized, vFpi) +GO(gdk_x11_window_set_theme_variant, vFpp) GO(gdk_x11_window_set_user_time, vFpu) -GO(gdk_x11_xatom_to_atom, pFp) -GO(gdk_x11_xatom_to_atom_for_display, pFpp) -GO(gdkx_colormap_get, pFu) -GO(gdk_xid_table_lookup, pFp) -GO(gdk_xid_table_lookup_for_display, pFpp) -GO(gdkx_visual_get, pFp) +GO(gdk_x11_window_set_utf8_property, vFppp) +GO(gdk_x11_xatom_to_atom, pFL) +GO(gdk_x11_xatom_to_atom_for_display, pFpL) DATA(gdk_display, 4) // no hack here... DATA(gdk_threads_lock, 4) diff --git a/src/wrapped/wrappedgdkpixbuf2.c b/src/wrapped/wrappedgdkpixbuf2.c index 99fa169..1fd742a 100644 --- a/src/wrapped/wrappedgdkpixbuf2.c +++ b/src/wrapped/wrappedgdkpixbuf2.c @@ -16,14 +16,18 @@ #include "librarian.h" #include "box64context.h" #include "emu/x64emu_private.h" +#include "myalign.h" + +const char* gdkpixbuf2Name = "libgdk_pixbuf-2.0.so.0"; +#define ALTNAME "libgdk_pixbuf-2.0.so" -#ifdef ANDROID - const char* gdkpixbuf2Name = "libgdk_pixbuf-2.0.so"; -#else - const char* gdkpixbuf2Name = "libgdk_pixbuf-2.0.so.0"; -#endif #define LIBNAME gdkpixbuf2 +typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*); + +#define ADDED_FUNCTIONS() \ + GO(gdk_pixbuf_savev, iFpppppp_t) + #include "generated/wrappedgdkpixbuf2types.h" #include "wrappercallback.h" @@ -64,8 +68,22 @@ EXPORT void* my_gdk_pixbuf_new_from_data(x64emu_t* emu, void* data, int32_t colo return my->gdk_pixbuf_new_from_data(data, colorspace, has_alpha, bpp, w, h, stride, finddestroy_pixbufFct(destroy_func), destroy_data); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +EXPORT int my_gdk_pixbuf_save(x64emu_t* emu, void* pixbuf, void* filename, void* type, void* error, uintptr_t* b) +{ + int n = 0; + while ((((void*)getVArgs(emu, 4, b, n * 2))) != NULL) + n += 1; + char* keys[n]; + char* vals[n]; + for (int i = 0; i < n; ++i) { + keys[i] = (char*)getVArgs(emu, 4, b, i * 2 + 0); + vals[i] = (char*)getVArgs(emu, 4, b, i * 2 + 1); + } + + return my->gdk_pixbuf_savev(pixbuf, filename, type, keys, vals, error); +} + +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgdkpixbuf2_private.h b/src/wrapped/wrappedgdkpixbuf2_private.h index adc0f9f..87a7ce4 100644 --- a/src/wrapped/wrappedgdkpixbuf2_private.h +++ b/src/wrapped/wrappedgdkpixbuf2_private.h @@ -25,6 +25,7 @@ GO(gdk_pixbuf_animation_new_from_file, pFpp) GO(gdk_pixbuf_animation_ref, pFp) GO(gdk_pixbuf_animation_unref, vFp) GO(gdk_pixbuf_apply_embedded_orientation, pFp) +GO(gdk_pixbuf_calculate_rowstride, iFuiiii) GO(gdk_pixbuf_composite, vFppiiiiddddii) GO(gdk_pixbuf_composite_color, vFppiiiiddddiiiiiuu) GO(gdk_pixbuf_composite_color_simple, pFpiiiiiuu) @@ -74,6 +75,7 @@ GO(gdk_pixbuf_loader_set_size, vFpii) GO(gdk_pixbuf_loader_write, iFppLp) GO(gdk_pixbuf_loader_write_bytes, iFppp) GO(gdk_pixbuf_new, pFiiiii) +GO(gdk_pixbuf_new_from_bytes, pFpuiiiii) GOM(gdk_pixbuf_new_from_data, pFEpiiiiiipp) GO(gdk_pixbuf_new_from_file, pFpp) GO(gdk_pixbuf_new_from_file_at_scale, pFpiiip) @@ -94,7 +96,7 @@ GO(gdk_pixbuf_ref, pFp) GO(gdk_pixbuf_rotate_simple, pFpi) //GO(gdk_pixbuf_rotation_get_type, GO(gdk_pixbuf_saturate_and_pixelate, vFppfi) -//GO(gdk_pixbuf_save, iFpppppppppppppp) //vaarg, wrap with gdk_pixbuf_save? +GOM(gdk_pixbuf_save, iFEppppV) //GO(gdk_pixbuf_save_to_buffer, iFpppppppppppppp) //vaarg, wrap with gdk_pixbuf_save_to_bufferv ? GO(gdk_pixbuf_save_to_bufferv, iFppppppp) //GOM(gdk_pixbuf_save_to_callback, iFEpppppV) //wrap with gdk_pixbuf_save_to_callbackv diff --git a/src/wrapped/wrappedgdkx112.c b/src/wrapped/wrappedgdkx112.c index a9b6cd5..337a96e 100644 --- a/src/wrapped/wrappedgdkx112.c +++ b/src/wrapped/wrappedgdkx112.c @@ -18,11 +18,9 @@ #include "emu/x64emu_private.h" #include "gtkclass.h" -#ifdef ANDROID - const char* gdkx112Name = "libgdk-x11-2.0.so"; -#else - const char* gdkx112Name = "libgdk-x11-2.0.so.0"; -#endif +const char* gdkx112Name = "libgdk-x11-2.0.so.0"; +#define ALTNAME "libgdk-x11-2.0.so" + #define LIBNAME gdkx112 static char* libname = NULL; @@ -105,45 +103,67 @@ static void* findGDestroyNotifyFct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for gdk2 GDestroyNotify callback\n"); return NULL; } - -#undef SUPER - -static void my_event_handler(void* event, my_signal_t* sig) +// EventHandler +#define GO(A) \ +static uintptr_t my_EventHandler_fct_##A = 0; \ +static void my_EventHandler_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_EventHandler_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* findEventHandlerFct(void* fct) { - RunFunctionFmt(sig->c_handler, "pp", event, sig->data); + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_EventHandler_fct_##A == (uintptr_t)fct) return my_EventHandler_##A; + SUPER() + #undef GO + #define GO(A) if(my_EventHandler_fct_##A == 0) {my_EventHandler_fct_##A = (uintptr_t)fct; return my_EventHandler_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gdk2 EventHandler callback\n"); + return NULL; } - -EXPORT void my_gdk_event_handler_set(x64emu_t* emu, void* func, void* data, void* notify) +// InputEvent +#define GO(A) \ +static uintptr_t my_InputEvent_fct_##A = 0; \ +static void my_InputEvent_##A(void* a, int b, int c) \ +{ \ + RunFunctionFmt(my_InputEvent_fct_##A, "pii", a, b, c); \ +} +SUPER() +#undef GO +static void* findInputEventFct(void* fct) { - if(!func) - return my->gdk_event_handler_set(func, data, notify); - - my_signal_t* sig = new_mysignal(func, data, notify); - my->gdk_event_handler_set(my_event_handler, sig, my_signal_delete); + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_InputEvent_fct_##A == (uintptr_t)fct) return my_InputEvent_##A; + SUPER() + #undef GO + #define GO(A) if(my_InputEvent_fct_##A == 0) {my_InputEvent_fct_##A = (uintptr_t)fct; return my_InputEvent_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gdk2 InputEvent callback\n"); + return NULL; } +#undef SUPER -static void my_input_function(my_signal_t* sig, int source, int condition) +EXPORT void my_gdk_event_handler_set(x64emu_t* emu, void* func, void* data, void* notify) { - RunFunctionFmt(sig->c_handler, "pii", sig->data, source, condition); + return my->gdk_event_handler_set(findEventHandlerFct(func), data, findGDestroyNotifyFct(notify)); } + EXPORT int my_gdk_input_add(x64emu_t* emu, int source, int condition, void* f, void* data) { - if(!f) - return my->gdk_input_add_full(source, condition, f, data, NULL); - - my_signal_t* sig = new_mysignal(f, data, NULL); - return my->gdk_input_add_full(source, condition, my_input_function, sig, my_signal_delete); + return my->gdk_input_add(source, condition, findInputEventFct(f), data); } EXPORT int my_gdk_input_add_full(x64emu_t* emu, int source, int condition, void* f, void* data, void* notify) { - if(!f) - return my->gdk_input_add_full(source, condition, f, data, notify); - - my_signal_t* sig = new_mysignal(f, data, notify); - return my->gdk_input_add_full(source, condition, my_input_function, sig, my_signal_delete); + return my->gdk_input_add_full(source, condition, findInputEventFct(f), data, findGDestroyNotifyFct(notify)); } EXPORT void my_gdk_init(x64emu_t* emu, void* argc, void* argv) @@ -174,17 +194,12 @@ EXPORT uint32_t my_gdk_threads_add_timeout_full(x64emu_t* emu, int priotity, uin return my->gdk_threads_add_timeout_full(priotity, interval, findGSourceFunc(f), data, findGDestroyNotifyFct(d)); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define CUSTOM_INIT \ libname = lib->name; -#ifdef ANDROID -#define NEEDED_LIBS "libgobject-2.0.so", "libgio-2.0.so", "libgdk_pixbuf-2.0.so" -#else #define NEEDED_LIBS "libgobject-2.0.so.0", "libgio-2.0.so.0", "libgdk_pixbuf-2.0.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgio2.c b/src/wrapped/wrappedgio2.c index 638bc14..0c46764 100644 --- a/src/wrapped/wrappedgio2.c +++ b/src/wrapped/wrappedgio2.c @@ -20,18 +20,18 @@ #include "myalign.h" #include "gtkclass.h" -#ifdef ANDROID - const char* gio2Name = "libgio-2.0.so"; -#else - const char* gio2Name = "libgio-2.0.so.0"; -#endif +const char* gio2Name = "libgio-2.0.so.0"; +#define ALTNAME "libgio-2.0.so" + #define LIBNAME gio2 typedef size_t(*LFv_t)(void); #define ADDED_FUNCTIONS() \ - GO(g_application_get_type, LFv_t) \ - GO(g_dbus_proxy_get_type, LFv_t) \ + GO(g_application_get_type, LFv_t) \ + GO(g_dbus_proxy_get_type, LFv_t) \ + GO(g_dbus_object_manager_client_get_type, LFv_t) \ + GO(g_dbus_interface_skeleton_get_type, LFv_t) \ #include "wrappedgio2types.h" @@ -89,6 +89,34 @@ static void* findGDestroyNotifyFct(void* fct) return NULL; } +// GTaskThreadFunc +#define GO(A) \ + static uintptr_t my_GTaskThreadFunc_fct_##A = 0; \ + static void my_GTaskThreadFunc_##A(void* task, void* source_object, void* task_data, void* cancellable) \ + { \ + RunFunctionFmt(my_GTaskThreadFunc_fct_##A, "pppp", task, source_object, task_data, cancellable); \ + } +SUPER() +#undef GO +static void* findGTaskThreadFuncFct(void* fct) +{ + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_GTaskThreadFunc_fct_##A == (uintptr_t)fct) return my_GTaskThreadFunc_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_GTaskThreadFunc_fct_##A == 0) { \ + my_GTaskThreadFunc_fct_##A = (uintptr_t)fct; \ + return my_GTaskThreadFunc_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for gio2 GTaskThreadFunc callback\n"); + return NULL; +} + // GDBusProxyTypeFunc #define GO(A) \ static uintptr_t my_GDBusProxyTypeFunc_fct_##A = 0; \ @@ -358,11 +386,11 @@ static my_GDBusInterfaceVTable_t* findFreeGDBusInterfaceVTable(my_GDBusInterface #undef GO #define GO(A) if(ref_GDBusInterfaceVTable_##A == 0) { \ ref_GDBusInterfaceVTable_##A = fcts; \ - my_GDBusInterfaceVTable_##A.method_call = (fcts->method_call)?((GetNativeFnc((uintptr_t)fcts->method_call))?GetNativeFnc((uintptr_t)fcts->method_call):my_funcs_method_call_##A):NULL; \ + my_GDBusInterfaceVTable_##A.method_call = (fcts->method_call)?((GetNativeFnc((uintptr_t)fcts->method_call))?GetNativeFnc((uintptr_t)fcts->method_call):(void*)my_funcs_method_call_##A):NULL; \ fct_funcs_method_call_##A = (uintptr_t)fcts->method_call; \ - my_GDBusInterfaceVTable_##A.get_property = (fcts->get_property)?((GetNativeFnc((uintptr_t)fcts->get_property))?GetNativeFnc((uintptr_t)fcts->get_property):my_funcs_get_property_##A):NULL; \ + my_GDBusInterfaceVTable_##A.get_property = (fcts->get_property)?((GetNativeFnc((uintptr_t)fcts->get_property))?GetNativeFnc((uintptr_t)fcts->get_property):(void*)my_funcs_get_property_##A):NULL; \ fct_funcs_get_property_##A = (uintptr_t)fcts->get_property; \ - my_GDBusInterfaceVTable_##A.set_property = (fcts->set_property)?((GetNativeFnc((uintptr_t)fcts->set_property))?GetNativeFnc((uintptr_t)fcts->set_property):my_funcs_set_property_##A):NULL; \ + my_GDBusInterfaceVTable_##A.set_property = (fcts->set_property)?((GetNativeFnc((uintptr_t)fcts->set_property))?GetNativeFnc((uintptr_t)fcts->set_property):(void*)my_funcs_set_property_##A):NULL; \ fct_funcs_set_property_##A = (uintptr_t)fcts->set_property; \ return &my_GDBusInterfaceVTable_##A; \ } @@ -383,27 +411,42 @@ EXPORT void my_g_task_return_pointer(x64emu_t* emu, void* task, void* result, vo my->g_task_return_pointer(task, result, findGDestroyNotifyFct(destroy)); } -EXPORT void my_g_dbus_proxy_new(x64emu_t* emu, void* connection, int flags, void* info, void* name, void* path, void* interface, void* cancellable, void* cb, void* data) +EXPORT void my_g_task_set_task_data(x64emu_t* emu, void* task, void* data, void* destroy) +{ + my->g_task_set_task_data(task, data, findGDestroyNotifyFct(destroy)); +} + +EXPORT void my_g_task_run_in_thread(x64emu_t* emu, void* task, void* func) +{ + my->g_task_run_in_thread(task, findGTaskThreadFuncFct(func)); +} + +EXPORT void my_g_task_run_in_thread_sync(x64emu_t* emu, void* task, void* func) +{ + my->g_task_run_in_thread_sync(task, findGTaskThreadFuncFct(func)); +} + +EXPORT void my_g_dbus_proxy_new(x64emu_t* emu, void* connection, uint32_t flags, void* info, void* name, void* path, void* interface, void* cancellable, void* cb, void* data) { my->g_dbus_proxy_new(connection, flags, info, name, path, interface, cancellable, findGAsyncReadyCallbackFct(cb), data); } -EXPORT void my_g_dbus_proxy_new_for_bus(x64emu_t* emu, int bus_type, int flags, void* info, void* name, void* path, void* interface, void* cancellable, void* cb, void* data) +EXPORT void my_g_dbus_proxy_new_for_bus(x64emu_t* emu, int bus_type, uint32_t flags, void* info, void* name, void* path, void* interface, void* cancellable, void* cb, void* data) { my->g_dbus_proxy_new_for_bus(bus_type, flags, info, name, path, interface, cancellable, findGAsyncReadyCallbackFct(cb), data); } -EXPORT void my_g_dbus_proxy_call(x64emu_t* emu, void* proxy, void* name, void* param, int flags, int timeout, void* cancellable, void* cb, void* data) +EXPORT void my_g_dbus_proxy_call(x64emu_t* emu, void* proxy, void* name, void* param, uint32_t flags, int timeout, void* cancellable, void* cb, void* data) { my->g_dbus_proxy_call(proxy, name, param, flags, timeout, cancellable, findGAsyncReadyCallbackFct(cb), data); } -EXPORT void my_g_dbus_proxy_call_with_unix_fd_list(x64emu_t* emu, void* proxy, void* name, void* param, int flags, int timeout, void* fd_list, void* cancellable, void* cb, void* data) +EXPORT void my_g_dbus_proxy_call_with_unix_fd_list(x64emu_t* emu, void* proxy, void* name, void* param, uint32_t flags, int timeout, void* fd_list, void* cancellable, void* cb, void* data) { my->g_dbus_proxy_call_with_unix_fd_list(proxy, name, param, flags, timeout, fd_list, cancellable, findGAsyncReadyCallbackFct(cb), data); } -EXPORT void* my_g_dbus_object_manager_client_new_for_bus_sync(x64emu_t* emu, size_t bus, int flags, void* name, void* path, void* cb, void* data, void* destroy, void* cancellable, void* error) +EXPORT void* my_g_dbus_object_manager_client_new_for_bus_sync(x64emu_t* emu, size_t bus, uint32_t flags, void* name, void* path, void* cb, void* data, void* destroy, void* cancellable, void* error) { return my->g_dbus_object_manager_client_new_for_bus_sync(bus, flags, name, path, findGDBusProxyTypeFuncFct(cb), data, findGDestroyNotifyFct(destroy), cancellable, error); } @@ -498,12 +541,12 @@ EXPORT void my_g_bus_get(x64emu_t* emu, size_t type, void* cancellable, void* cb my->g_bus_get(type, cancellable, findGAsyncReadyCallbackFct(cb), data); } -EXPORT void my_g_dbus_connection_new(x64emu_t* emu, void* stream, void* guid, int flags, void* observer, void* cancellable, void* cb, void* data) +EXPORT void my_g_dbus_connection_new(x64emu_t* emu, void* stream, void* guid, uint32_t flags, void* observer, void* cancellable, void* cb, void* data) { my->g_dbus_connection_new(stream, guid, flags, observer, cancellable, findGAsyncReadyCallbackFct(cb), data); } -EXPORT void my_g_dbus_connection_new_for_address(x64emu_t* emu, void* address, int flags, void* observer, void* cancellable, void* cb, void* data) +EXPORT void my_g_dbus_connection_new_for_address(x64emu_t* emu, void* address, uint32_t flags, void* observer, void* cancellable, void* cb, void* data) { my->g_dbus_connection_new_for_address(address, flags, observer, cancellable, findGAsyncReadyCallbackFct(cb), data); } @@ -518,17 +561,17 @@ EXPORT void my_g_dbus_connection_flush(x64emu_t* emu, void* connection, void* ca my->g_dbus_connection_flush(connection, cancellable, findGAsyncReadyCallbackFct(cb), data); } -EXPORT void my_g_dbus_connection_call(x64emu_t* emu, void* connection, void* bus, void* object, void* interface, void* method, void* param, void* reply, int flags, int timeout, void* cancellable, void* cb, void* data) +EXPORT void my_g_dbus_connection_call(x64emu_t* emu, void* connection, void* bus, void* object, void* interface, void* method, void* param, void* reply, uint32_t flags, int timeout, void* cancellable, void* cb, void* data) { my->g_dbus_connection_call(connection, bus, object, interface, method, param, reply, flags, timeout, cancellable, findGAsyncReadyCallbackFct(cb), data); } -EXPORT uint32_t my_g_dbus_connection_signal_subscribe(x64emu_t* emu, void* connection, void* sender, void* interface, void* member, void* object, void* arg0, int flags, void* cb, void* data, void* notify) +EXPORT uint32_t my_g_dbus_connection_signal_subscribe(x64emu_t* emu, void* connection, void* sender, void* interface, void* member, void* object, void* arg0, uint32_t flags, void* cb, void* data, void* notify) { return my->g_dbus_connection_signal_subscribe(connection, sender, interface, member, object, arg0, flags, findGDBusSignalCallbackFct(cb), data, findGDestroyNotifyFct(notify)); } -EXPORT void my_g_dbus_connection_send_message_with_reply(x64emu_t* emu, void* connection, void* message, int flags, int timeout, void* serial, void* cancellable, void* cb, void* data) +EXPORT void my_g_dbus_connection_send_message_with_reply(x64emu_t* emu, void* connection, void* message, uint32_t flags, int timeout, void* serial, void* cancellable, void* cb, void* data) { my->g_dbus_connection_send_message_with_reply(connection, message, flags, timeout, serial, cancellable, findGAsyncReadyCallbackFct(cb), data); } @@ -543,27 +586,27 @@ EXPORT uint32_t my_g_dbus_connection_register_object(x64emu_t* emu, void* connec return my->g_dbus_connection_register_object(connection, object, info, findFreeGDBusInterfaceVTable(vtable), data, findGDestroyNotifyFct(notify), error); } -EXPORT uint32_t my_g_bus_watch_name(x64emu_t* emu, size_t type, void* name, int flags, void* appeared, void* vanished, void* data, void* notify) +EXPORT uint32_t my_g_bus_watch_name(x64emu_t* emu, int type, void* name, uint32_t flags, void* appeared, void* vanished, void* data, void* notify) { return my->g_bus_watch_name(type, name, flags, findGBusNameAppearedCallbackFct(appeared), findGBusNameVanishedCallbackFct(vanished), data, findGDestroyNotifyFct(notify)); } -EXPORT uint32_t my_g_bus_watch_name_on_connection(x64emu_t* emu, void* connection, void* name, int flags, void* appeared, void* vanished, void* data, void* notify) +EXPORT uint32_t my_g_bus_watch_name_on_connection(x64emu_t* emu, void* connection, void* name, uint32_t flags, void* appeared, void* vanished, void* data, void* notify) { return my->g_bus_watch_name_on_connection(connection, name, flags, findGBusNameAppearedCallbackFct(appeared), findGBusNameVanishedCallbackFct(vanished), data, findGDestroyNotifyFct(notify)); } -EXPORT uint32_t my_g_bus_own_name(x64emu_t* emu, size_t type, void* name, int flags, void* bus_acquired, void* name_acquired, void* name_lost, void* data, void* notify) +EXPORT uint32_t my_g_bus_own_name(x64emu_t* emu, size_t type, void* name, uint32_t flags, void* bus_acquired, void* name_acquired, void* name_lost, void* data, void* notify) { return my->g_bus_own_name(type, name, flags, findGBusAcquiredCallbackFct(bus_acquired), findGBusNameAcquiredCallbackFct(name_acquired), findGBusNameLostCallbackFct(name_lost), data, findGDestroyNotifyFct(notify)); } -EXPORT uint32_t my_g_bus_own_name_on_connection(x64emu_t* emu, void* connection, void* name, int flags, void* name_acquired, void* name_lost, void* data, void* notify) +EXPORT uint32_t my_g_bus_own_name_on_connection(x64emu_t* emu, void* connection, void* name, uint32_t flags, void* name_acquired, void* name_lost, void* data, void* notify) { return my->g_bus_own_name_on_connection(connection, name, flags, findGBusNameAcquiredCallbackFct(name_acquired), findGBusNameLostCallbackFct(name_lost), data, findGDestroyNotifyFct(notify)); } -EXPORT void my_g_simple_async_result_set_error_va(x64emu_t* emu, void* simple, void* domain, int code, void* fmt, x64_va_list_t V) +EXPORT void my_g_simple_async_result_set_error_va(x64emu_t* emu, void* simple, uint32_t domain, int code, void* fmt, x64_va_list_t V) { #ifdef CONVERT_VALIST CONVERT_VALIST(V); @@ -573,14 +616,14 @@ EXPORT void my_g_simple_async_result_set_error_va(x64emu_t* emu, void* simple, v my->g_simple_async_result_set_error_va(simple, domain, code, fmt, VARARGS); } -EXPORT void my_g_simple_async_result_set_error(x64emu_t* emu, void* simple, void* domain, int code, void* fmt, uintptr_t* b) +EXPORT void my_g_simple_async_result_set_error(x64emu_t* emu, void* simple, uint32_t domain, int code, void* fmt, uintptr_t* b) { myStackAlign(emu, fmt, b, emu->scratch, R_EAX, 4); PREPARE_VALIST; my->g_simple_async_result_set_error_va(simple, domain, code, fmt, VARARGS); } -EXPORT void* my_g_initable_new(x64emu_t* emu, void* type, void* cancel, void* err, void* first, uintptr_t* b) +EXPORT void* my_g_initable_new(x64emu_t* emu, size_t type, void* cancel, void* err, void* first, uintptr_t* b) { #if 0 // look for number of pairs @@ -601,7 +644,7 @@ EXPORT void* my_g_initable_new(x64emu_t* emu, void* type, void* cancel, void* er return my->g_initable_new_valist(type, first, VARARGS, cancel, err); } -EXPORT void* my_g_initable_new_valist(x64emu_t* emu, void* type, void* first, x64_va_list_t V, void* cancel, void* err) +EXPORT void* my_g_initable_new_valist(x64emu_t* emu, size_t type, void* first, x64_va_list_t V, void* cancel, void* err) { #ifdef CONVERT_VALIST CONVERT_VALIST(V); @@ -625,18 +668,31 @@ EXPORT void my_g_input_stream_read_async(x64emu_t* emu, void* stream, void* buff my->g_input_stream_read_async(stream, buffer, count, io_prio, cancel, findGAsyncReadyCallbackFct(f), data); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +EXPORT void my_g_dbus_method_invocation_return_error_valist(x64emu_t* emu, void* invocation, uint32_t domain, int code, void* fmt, x64_va_list_t V) +{ + #ifdef CONVERT_VALIST + CONVERT_VALIST(V); + #else + CREATE_VALIST_FROM_VALIST(V, emu->scratch); + #endif + my->g_dbus_method_invocation_return_error_valist(invocation, domain, code, fmt, VARARGS); +} + +EXPORT void my_g_dbus_method_invocation_return_error(x64emu_t* emu, void* invocation, uint32_t domain, int code, void* fmt, uintptr_t* b) +{ + CREATE_VALIST_FROM_VAARG(b, emu->scratch, 4); + my->g_dbus_method_invocation_return_error(invocation, domain, code, fmt, VARARGS); +} + +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define CUSTOM_INIT \ - SetGApplicationID(my->g_application_get_type()); \ - SetGDBusProxyID(my->g_dbus_proxy_get_type()); + SetGApplicationID(my->g_application_get_type()); \ + SetGDBusProxyID(my->g_dbus_proxy_get_type()); \ + SetGDBusObjectManagerClientID(my->g_dbus_object_manager_client_get_type()); \ + SetGDBusInterfaceSkeletonID(my->g_dbus_interface_skeleton_get_type()); -#ifdef ANDROID -#define NEEDED_LIBS "libgmodule-2.0.so" -#else #define NEEDED_LIBS "libgmodule-2.0.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgio2_private.h b/src/wrapped/wrappedgio2_private.h index 22f9283..fb25008 100644 --- a/src/wrapped/wrappedgio2_private.h +++ b/src/wrapped/wrappedgio2_private.h @@ -1,17 +1,17 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif //GO(_fini, GO(g_action_activate, vFpp) -//GO(g_action_change_state, +GO(g_action_change_state, vFpp) GO(g_action_get_enabled, iFp) GO(g_action_get_name, pFp) -//GO(g_action_get_parameter_type, +GO(g_action_get_parameter_type, pFp) GO(g_action_get_state, pFp) -//GO(g_action_get_state_hint, +GO(g_action_get_state_hint, pFp) GO(g_action_get_state_type, pFp) -//GO(g_action_get_type, +GO(g_action_get_type, LFv) GO(g_action_group_action_added, vFpp) GO(g_action_group_action_enabled_changed, vFppi) GO(g_action_group_action_removed, vFpp) @@ -29,10 +29,10 @@ GO(g_action_group_list_actions, pFp) GO(g_action_group_query_action, iFppppppp) GO(g_action_map_add_action, vFpp) GO(g_action_map_add_action_entries, vFppip) -//GO(g_action_map_get_type, +GO(g_action_map_get_type, LFv) GO(g_action_map_lookup_action, pFpp) GO(g_action_map_remove_action, vFpp) -//GO(g_action_name_is_valid, +GO(g_action_name_is_valid, iFp) GO(g_action_parse_detailed_name, iFpppp) GO(g_action_print_detailed_name, pFpp) GO(g_app_info_add_supports_type, iFppp) @@ -71,16 +71,16 @@ GO(g_app_info_set_as_last_used_for_type, iFppp) GO(g_app_info_should_show, iFp) GO(g_app_info_supports_files, iFp) GO(g_app_info_supports_uris, iFp) -//GO(g_app_launch_context_get_display, +GO(g_app_launch_context_get_display, pFppp) GO(g_app_launch_context_get_environment, pFp) GO(g_app_launch_context_get_startup_notify_id, pFppp) GO(g_app_launch_context_get_type, LFv) GO(g_app_launch_context_launch_failed, vFpp) GO(g_app_launch_context_new, pFv) GO(g_app_launch_context_setenv, vFppp) -//GO(g_app_launch_context_unsetenv, +GO(g_app_launch_context_unsetenv, vFpp) GO(g_application_activate, vFp) -GO(g_application_add_main_option, vFppCuupp) +GO(g_application_add_main_option, vFppcuupp) GO(g_application_add_main_option_entries, vFpp) GO(g_application_add_option_group, vFpp) GO(g_application_command_line_create_file_for_arg, pFpp) @@ -93,24 +93,24 @@ GO(g_application_command_line_get_is_remote, iFp) GO(g_application_command_line_get_options_dict, pFp) GO(g_application_command_line_get_platform_data, pFp) GO(g_application_command_line_get_stdin, pFp) -//GO(g_application_command_line_get_type, -//GO(g_application_command_line_print, -//GO(g_application_command_line_printerr, +GO(g_application_command_line_get_type, LFv) +//GOM(g_application_command_line_print, vFppV) +//GOM(g_application_command_line_printerr, vFppV) GO(g_application_command_line_set_exit_status, vFpi) -//GO(g_application_flags_get_type, -//GO(g_application_get_application_id, +GO(g_application_flags_get_type, LFv) +GO(g_application_get_application_id, pFp) GO(g_application_get_dbus_connection, pFp) -//GO(g_application_get_dbus_object_path, +GO(g_application_get_dbus_object_path, pFp) GO(g_application_get_default, pFv) GO(g_application_get_flags, uFp) GO(g_application_get_inactivity_timeout, uFp) -//GO(g_application_get_is_registered, -//GO(g_application_get_is_remote, +GO(g_application_get_is_registered, iFp) +GO(g_application_get_is_remote, iFp) GO(g_application_get_resource_base_path, pFp) GO(g_application_get_type, LFv) -//GO(g_application_hold, -//GO(g_application_id_is_valid, -//GO(g_application_mark_busy, +GO(g_application_hold, vFp) +GO(g_application_id_is_valid, iFp) +GO(g_application_mark_busy, vFp) GO(g_application_new, pFpu) GO(g_application_open, vFppip) GO(g_application_quit, vFp) @@ -119,32 +119,32 @@ GO(g_application_release, vFp) GO(g_application_run, iFpip) GO(g_application_send_notification, vFppp) GO(g_application_set_action_group, vFpp) -//GO(g_application_set_application_id, -//GO(g_application_set_default, +GO(g_application_set_application_id, vFpp) +GO(g_application_set_default, vFp) GO(g_application_set_flags, vFpu) GO(g_application_set_inactivity_timeout, vFpu) -//GO(g_application_set_resource_base_path, -//GO(g_application_unmark_busy, +GO(g_application_set_resource_base_path, vFpp) +GO(g_application_unmark_busy, vFp) GO(g_application_withdraw_notification, vFpp) -//GO(g_ask_password_flags_get_type, +GO(g_ask_password_flags_get_type, LFv) GO(g_async_initable_get_type, LFv) GOM(g_async_initable_init_async, vFEpippp) GO(g_async_initable_init_finish, iFppp) -GOM(g_async_initable_new_async, vFEiippppV) +GOM(g_async_initable_new_async, vFELippppV) GO(g_async_initable_new_finish, pFppp) -GOM(g_async_initable_new_valist_async, vFEipAippp) -GOM(g_async_initable_newv_async, vFEiupippp) +GOM(g_async_initable_new_valist_async, vFELpAippp) +GOM(g_async_initable_newv_async, vFELupippp) GO(g_async_result_get_source_object, pFp) GO(g_async_result_get_type, LFv) GO(g_async_result_get_user_data, pFp) GO(g_async_result_is_tagged, iFpp) -//GO(g_async_result_legacy_propagate_error, +GO(g_async_result_legacy_propagate_error, iFpp) GO(g_buffered_input_stream_fill, lFplpp) -//GO(g_buffered_input_stream_fill_async, +//GOM(g_buffered_input_stream_fill_async, vFplippp) GO(g_buffered_input_stream_fill_finish, lFppp) GO(g_buffered_input_stream_get_available, LFp) -//GO(g_buffered_input_stream_get_buffer_size, -//GO(g_buffered_input_stream_get_type, +GO(g_buffered_input_stream_get_buffer_size, LFp) +GO(g_buffered_input_stream_get_type, LFv) GO(g_buffered_input_stream_new, pFp) GO(g_buffered_input_stream_new_sized, pFpL) GO(g_buffered_input_stream_peek, LFppLL) @@ -153,7 +153,7 @@ GO(g_buffered_input_stream_read_byte, iFppp) GO(g_buffered_input_stream_set_buffer_size, vFpL) GO(g_buffered_output_stream_get_auto_grow, iFp) GO(g_buffered_output_stream_get_buffer_size, LFp) -//GO(g_buffered_output_stream_get_type, +GO(g_buffered_output_stream_get_type, LFv) GO(g_buffered_output_stream_new, pFp) GO(g_buffered_output_stream_new_sized, pFpL) GO(g_buffered_output_stream_set_auto_grow, vFpi) @@ -163,19 +163,19 @@ GO(g_bus_get_finish, pFpp) GO(g_bus_get_sync, pFipp) GO(g_bus_name_owner_flags_get_type, LFv) GO(g_bus_name_watcher_flags_get_type, LFv) -GOM(g_bus_own_name, uFEipippppp) -GOM(g_bus_own_name_on_connection, uFEppipppp) -GO(g_bus_own_name_on_connection_with_closures, uFppipp) -GO(g_bus_own_name_with_closures, uFppippp) +GOM(g_bus_own_name, uFEipuppppp) +GOM(g_bus_own_name_on_connection, uFEppupppp) +GO(g_bus_own_name_on_connection_with_closures, uFppupp) +GO(g_bus_own_name_with_closures, uFipuppp) GO(g_bus_type_get_type, LFv) GO(g_bus_unown_name, vFu) GO(g_bus_unwatch_name, vFu) -GOM(g_bus_watch_name, uFEipipppp) -GOM(g_bus_watch_name_on_connection, uFEppipppp) -GO(g_bus_watch_name_on_connection_with_closures, uFppipp) // mmm closure, wrapped or unwrapped? -GO(g_bus_watch_name_with_closures, uFipipp) +GOM(g_bus_watch_name, uFEipupppp) +GOM(g_bus_watch_name_on_connection, uFEppupppp) +GO(g_bus_watch_name_on_connection_with_closures, uFppupp) // mmm closure, wrapped or unwrapped? +GO(g_bus_watch_name_with_closures, uFipupp) GO(g_bytes_icon_get_bytes, pFp) -//GO(g_bytes_icon_get_type, +GO(g_bytes_icon_get_type, LFv) GO(g_bytes_icon_new, pFp) GO(g_cancellable_cancel, vFp) GOM(g_cancellable_connect, LFEpppp) @@ -211,18 +211,18 @@ GO(g_content_type_is_a, iFpp) GO(g_content_type_is_unknown, iFp) GO(g_content_types_get_registered, pFv) GO(g_converter_convert, uFppLpLuppp) -//GO(g_converter_flags_get_type, -//GO(g_converter_get_type, +GO(g_converter_flags_get_type, LFv) +GO(g_converter_get_type, LFv) GO(g_converter_input_stream_get_converter, pFp) -//GO(g_converter_input_stream_get_type, +GO(g_converter_input_stream_get_type, LFv) GO(g_converter_input_stream_new, pFpp) GO(g_converter_output_stream_get_converter, pFp) -//GO(g_converter_output_stream_get_type, +GO(g_converter_output_stream_get_type, LFv) GO(g_converter_output_stream_new, pFpp) -//GO(g_converter_reset, -//GO(g_converter_result_get_type, +GO(g_converter_reset, vFp) +GO(g_converter_result_get_type, LFv) GO(g_credentials_get_native, pFpu) -//GO(g_credentials_get_type, +GO(g_credentials_get_type, LFv) GO(g_credentials_get_unix_pid, iFpp) GO(g_credentials_get_unix_user, uFpp) GO(g_credentials_is_same_user, iFppp) @@ -230,33 +230,33 @@ GO(g_credentials_new, pFv) GO(g_credentials_set_native, vFpup) GO(g_credentials_set_unix_user, iFpup) GO(g_credentials_to_string, pFp) -//GO(g_credentials_type_get_type, +GO(g_credentials_type_get_type, LFv) GO(g_data_input_stream_get_byte_order, uFp) GO(g_data_input_stream_get_newline_type, uFp) -//GO(g_data_input_stream_get_type, +GO(g_data_input_stream_get_type, LFv) GO(g_data_input_stream_new, pFp) GO(g_data_input_stream_read_byte, CFppp) GO(g_data_input_stream_read_int16, wFppp) GO(g_data_input_stream_read_int32, iFppp) GO(g_data_input_stream_read_int64, lFppp) -//GO(g_data_input_stream_read_line, -//GO(g_data_input_stream_read_line_async, -//GO(g_data_input_stream_read_line_finish, -//GO(g_data_input_stream_read_line_finish_utf8, +GO(g_data_input_stream_read_line, pFpppp) +//GOM(g_data_input_stream_read_line_async, vFpippp) +GO(g_data_input_stream_read_line_finish, pFpppp) +GO(g_data_input_stream_read_line_finish_utf8, pFpppp) GO(g_data_input_stream_read_line_utf8, pFpppp) GO(g_data_input_stream_read_uint16, WFppp) GO(g_data_input_stream_read_uint32, uFppp) GO(g_data_input_stream_read_uint64, LFppp) GO(g_data_input_stream_read_until, pFppppp) -//GO(g_data_input_stream_read_until_async, -//GO(g_data_input_stream_read_until_finish, +//GOM(g_data_input_stream_read_until_async, vFppippp) +GO(g_data_input_stream_read_until_finish, pFpppp) GO(g_data_input_stream_read_upto, pFpplppp) -//GO(g_data_input_stream_read_upto_async, +//GOM(g_data_input_stream_read_upto_async, vFpplippp) GO(g_data_input_stream_read_upto_finish, pFpppp) GO(g_data_input_stream_set_byte_order, vFpu) GO(g_data_input_stream_set_newline_type, vFpu) GO(g_data_output_stream_get_byte_order, uFp) -//GO(g_data_output_stream_get_type, +GO(g_data_output_stream_get_type, LFv) GO(g_data_output_stream_new, pFp) GO(g_data_output_stream_put_byte, iFpCpp) GO(g_data_output_stream_put_int16, iFpwpp) @@ -267,13 +267,13 @@ GO(g_data_output_stream_put_uint16, iFpWpp) GO(g_data_output_stream_put_uint32, iFpupp) GO(g_data_output_stream_put_uint64, iFpLpp) GO(g_data_output_stream_set_byte_order, vFpu) -//GO(g_data_stream_byte_order_get_type, -//GO(g_data_stream_newline_type_get_type, +GO(g_data_stream_byte_order_get_type, LFv) +GO(g_data_stream_newline_type_get_type, LFv) GO(g_dbus_action_group_get, pFppp) -//GO(g_dbus_action_group_get_type, -//GO(g_dbus_address_escape_value, +GO(g_dbus_action_group_get_type, LFv) +GO(g_dbus_address_escape_value, pFp) GO(g_dbus_address_get_for_bus_sync, pFipp) -//GO(g_dbus_address_get_stream, +//GOM(g_dbus_address_get_stream, vFpppp) GO(g_dbus_address_get_stream_finish, pFppp) GO(g_dbus_address_get_stream_sync, pFpppp) GO(g_dbus_annotation_info_get_type, LFv) @@ -285,15 +285,15 @@ GO(g_dbus_arg_info_ref, pFp) GO(g_dbus_arg_info_unref, vFp) GO(g_dbus_auth_observer_allow_mechanism, iFpp) GO(g_dbus_auth_observer_authorize_authenticated_peer, iFppp) -//GO(g_dbus_auth_observer_get_type, +GO(g_dbus_auth_observer_get_type, LFv) GO(g_dbus_auth_observer_new, pFv) GO(g_dbus_call_flags_get_type, LFv) GO(g_dbus_capability_flags_get_type, LFv) GOM(g_dbus_connection_add_filter, uFEpppp) -GOM(g_dbus_connection_call, vFEpppppppiippp) +GOM(g_dbus_connection_call, vFEpppppppuippp) GO(g_dbus_connection_call_finish, pFppp) GO(g_dbus_connection_call_sync, pFpppppppuipp) -//GO(g_dbus_connection_call_with_unix_fd_list, +//GOM(g_dbus_connection_call_with_unix_fd_list, vFpppppppuipppp) GO(g_dbus_connection_call_with_unix_fd_list_finish, pFpppp) GO(g_dbus_connection_call_with_unix_fd_list_sync, pFpppppppuipppp) GOM(g_dbus_connection_close, vFEpppp) @@ -315,37 +315,37 @@ GO(g_dbus_connection_get_stream, pFp) GO(g_dbus_connection_get_type, LFv) GO(g_dbus_connection_get_unique_name, pFp) GO(g_dbus_connection_is_closed, iFp) -GOM(g_dbus_connection_new, vFEppipppp) +GOM(g_dbus_connection_new, vFEppupppp) GO(g_dbus_connection_new_finish, pFpp) -GOM(g_dbus_connection_new_for_address, vFEpipppp) +GOM(g_dbus_connection_new_for_address, vFEpupppp) GO(g_dbus_connection_new_for_address_finish, pFpp) GO(g_dbus_connection_new_for_address_sync, pFpuppp) GO(g_dbus_connection_new_sync, pFppuppp) GOM(g_dbus_connection_register_object, uFEppppppp) -//GOM(g_dbus_connection_register_subtree, uFEppppppp) // vtable need wrapping +//GOM(g_dbus_connection_register_subtree, uFEpppuppp) // vtable need wrapping GO(g_dbus_connection_remove_filter, vFpu) GO(g_dbus_connection_send_message, iFppupp) -GOM(g_dbus_connection_send_message_with_reply, vFEppiipppp) //TODO: same volatile argument... +GOM(g_dbus_connection_send_message_with_reply, vFEppuipppp) //TODO: same volatile argument... GO(g_dbus_connection_send_message_with_reply_finish, pFppp) GO(g_dbus_connection_send_message_with_reply_sync, pFppuippp) GO(g_dbus_connection_set_exit_on_close, vFpi) -GOM(g_dbus_connection_signal_subscribe, uFEppppppippp) +GOM(g_dbus_connection_signal_subscribe, uFEppppppuppp) GO(g_dbus_connection_signal_unsubscribe, vFpu) GO(g_dbus_connection_start_message_processing, vFp) -//GO(g_dbus_connection_unexport_action_group, +GO(g_dbus_connection_unexport_action_group, vFpu) GO(g_dbus_connection_unexport_menu_model, vFpu) GO(g_dbus_connection_unregister_object, iFpu) GO(g_dbus_connection_unregister_subtree, iFpu) GO(g_dbus_error_encode_gerror, pFp) -//GO(g_dbus_error_get_remote_error, -//GO(g_dbus_error_get_type, +GO(g_dbus_error_get_remote_error, pFp) +GO(g_dbus_error_get_type, LFv) GO(g_dbus_error_is_remote_error, iFp) GO(g_dbus_error_new_for_dbus_error, pFpp) GO(g_dbus_error_quark, uFv) -//GO(g_dbus_error_register_error, +GO(g_dbus_error_register_error, iFuip) GO(g_dbus_error_register_error_domain, vFpppu) -//GO(g_dbus_error_set_dbus_error, -//GO(g_dbus_error_set_dbus_error_valist, +//GOM(g_dbus_error_set_dbus_error, vFppppV) +//GOM(g_dbus_error_set_dbus_error_valist, vFppppA) GO(g_dbus_error_strip_remote_error, iFp) GO(g_dbus_error_unregister_error, iFuip) GO(g_dbus_generate_guid, pFv) @@ -353,8 +353,8 @@ GO(g_dbus_gvalue_to_gvariant, pFpp) GO(g_dbus_gvariant_to_gvalue, vFpp) GO(g_dbus_interface_dup_object, pFp) GO(g_dbus_interface_get_info, pFp) -//GO(g_dbus_interface_get_object, -//GO(g_dbus_interface_get_type, +GO(g_dbus_interface_get_object, pFp) +GO(g_dbus_interface_get_type, LFv) GO(g_dbus_interface_info_cache_build, vFp) GO(g_dbus_interface_info_cache_release, vFp) GO(g_dbus_interface_info_generate_xml, vFpup) @@ -366,19 +366,19 @@ GO(g_dbus_interface_info_ref, pFp) GO(g_dbus_interface_info_unref, vFp) GO(g_dbus_interface_set_object, vFpp) GO(g_dbus_interface_skeleton_export, iFpppp) -//GO(g_dbus_interface_skeleton_flags_get_type, -//GO(g_dbus_interface_skeleton_flush, +GO(g_dbus_interface_skeleton_flags_get_type, LFv) +GO(g_dbus_interface_skeleton_flush, vFp) GO(g_dbus_interface_skeleton_get_connection, pFp) GO(g_dbus_interface_skeleton_get_connections, pFp) GO(g_dbus_interface_skeleton_get_flags, uFp) GO(g_dbus_interface_skeleton_get_info, pFp) GO(g_dbus_interface_skeleton_get_object_path, pFp) GO(g_dbus_interface_skeleton_get_properties, pFp) -//GO(g_dbus_interface_skeleton_get_type, -//GO(g_dbus_interface_skeleton_get_vtable, +GO(g_dbus_interface_skeleton_get_type, LFv) +//GOM(g_dbus_interface_skeleton_get_vtable, pFp) GO(g_dbus_interface_skeleton_has_connection, iFpp) GO(g_dbus_interface_skeleton_set_flags, vFpu) -//GO(g_dbus_interface_skeleton_unexport, +GO(g_dbus_interface_skeleton_unexport, vFp) GO(g_dbus_interface_skeleton_unexport_from_connection, vFpp) GO(g_dbus_is_address, iFp) GO(g_dbus_is_guid, iFp) @@ -418,9 +418,9 @@ GO(g_dbus_message_lock, vFp) GO(g_dbus_message_new, pFv) GO(g_dbus_message_new_from_blob, pFpLup) GO(g_dbus_message_new_method_call, pFpppp) -//GO2(g_dbus_message_new_method_error, pFpppV, g_dbus_message_new_method_error_valist) +//GOM(g_dbus_message_new_method_error, pFpppV) GO(g_dbus_message_new_method_error_literal, pFppp) -//GO(g_dbus_message_new_method_error_valist, pFpppp) +//GOM(g_dbus_message_new_method_error_valist, pFpppA) GO(g_dbus_message_new_method_reply, pFp) GO(g_dbus_message_new_signal, pFppp) GO(g_dbus_message_print, pFpu) @@ -458,9 +458,9 @@ GO(g_dbus_method_invocation_get_sender, pFp) GO(g_dbus_method_invocation_get_type, LFv) GO(g_dbus_method_invocation_get_user_data, pFp) GO(g_dbus_method_invocation_return_dbus_error, vFppp) -//GO2(g_dbus_method_invocation_return_error, vFpuipV, g_dbus_method_invocation_return_error_valist) +GOM(g_dbus_method_invocation_return_error, vFpuipV) GO(g_dbus_method_invocation_return_error_literal, vFpuip) -//GO(g_dbus_method_invocation_return_error_valist, vFpuipp) +GOM(g_dbus_method_invocation_return_error_valist, vFpuipA) GO(g_dbus_method_invocation_return_gerror, vFpp) GO(g_dbus_method_invocation_return_value, vFpp) GO(g_dbus_method_invocation_return_value_with_unix_fd_list, vFppp) @@ -481,43 +481,43 @@ GO(g_dbus_object_manager_client_get_flags, uFp) GO(g_dbus_object_manager_client_get_name, pFp) GO(g_dbus_object_manager_client_get_name_owner, pFp) GO(g_dbus_object_manager_client_get_type, LFv) -//GOM(g_dbus_object_manager_client_new, +//GOM(g_dbus_object_manager_client_new, vFpupppppppp) GO(g_dbus_object_manager_client_new_finish, pFpp) -//GOM(g_dbus_object_manager_client_new_for_bus, +//GOM(g_dbus_object_manager_client_new_for_bus, vFiupppppppp) GO(g_dbus_object_manager_client_new_for_bus_finish, pFpp) -GOM(g_dbus_object_manager_client_new_for_bus_sync, pFEiippppppp) -//GOM(g_dbus_object_manager_client_new_sync, +GOM(g_dbus_object_manager_client_new_for_bus_sync, pFEiuppppppp) +//GOM(g_dbus_object_manager_client_new_sync, pFpuppppppp) //GOM(g_dbus_object_manager_get_interface, pFEppp) //struct GDBusObjectManagerIface is full of callbacks GO(g_dbus_object_manager_get_object, pFpp) GO(g_dbus_object_manager_get_object_path, pFp) GO(g_dbus_object_manager_get_objects, pFp) -//GO(g_dbus_object_manager_get_type, -//GO(g_dbus_object_manager_server_export, +GO(g_dbus_object_manager_get_type, LFv) +GO(g_dbus_object_manager_server_export, vFpp) GO(g_dbus_object_manager_server_export_uniquely, vFpp) GO(g_dbus_object_manager_server_get_connection, pFp) -//GO(g_dbus_object_manager_server_get_type, +GO(g_dbus_object_manager_server_get_type, LFv) GO(g_dbus_object_manager_server_is_exported, iFpp) GO(g_dbus_object_manager_server_new, pFp) GO(g_dbus_object_manager_server_set_connection, vFpp) GO(g_dbus_object_manager_server_unexport, iFpp) GO(g_dbus_object_proxy_get_connection, pFp) -//GO(g_dbus_object_proxy_get_type, +GO(g_dbus_object_proxy_get_type, LFv) GO(g_dbus_object_proxy_new, pFpp) -//GO(g_dbus_object_skeleton_add_interface, -//GO(g_dbus_object_skeleton_flush, -//GO(g_dbus_object_skeleton_get_type, +GO(g_dbus_object_skeleton_add_interface, vFpp) +GO(g_dbus_object_skeleton_flush, vFp) +GO(g_dbus_object_skeleton_get_type, LFv) GO(g_dbus_object_skeleton_new, pFp) GO(g_dbus_object_skeleton_remove_interface, vFpp) -//GO(g_dbus_object_skeleton_remove_interface_by_name, +GO(g_dbus_object_skeleton_remove_interface_by_name, vFpp) GO(g_dbus_object_skeleton_set_object_path, vFpp) -//GO(g_dbus_property_info_flags_get_type, +GO(g_dbus_property_info_flags_get_type, LFv) GO(g_dbus_property_info_get_type, LFv) GO(g_dbus_property_info_ref, pFp) GO(g_dbus_property_info_unref, vFp) -GOM(g_dbus_proxy_call, vFEpppiippp) +GOM(g_dbus_proxy_call, vFEpppuippp) GO(g_dbus_proxy_call_finish, pFppp) GO(g_dbus_proxy_call_sync, pFpppuipp) -GOM(g_dbus_proxy_call_with_unix_fd_list, vFEpppiipppp) +GOM(g_dbus_proxy_call_with_unix_fd_list, vFEpppuipppp) GO(g_dbus_proxy_call_with_unix_fd_list_finish, pFpppp) GO(g_dbus_proxy_call_with_unix_fd_list_sync, pFpppuipppp) GO(g_dbus_proxy_flags_get_type, LFv) @@ -532,159 +532,159 @@ GO(g_dbus_proxy_get_name, pFp) GO(g_dbus_proxy_get_name_owner, pFp) GO(g_dbus_proxy_get_object_path, pFp) GO(g_dbus_proxy_get_type, LFv) -GOM(g_dbus_proxy_new, vFEpippppppp) +GOM(g_dbus_proxy_new, vFEpuppppppp) GO(g_dbus_proxy_new_finish, pFpp) -GOM(g_dbus_proxy_new_for_bus, vFEiippppppp) +GOM(g_dbus_proxy_new_for_bus, vFEiuppppppp) GO(g_dbus_proxy_new_for_bus_finish, pFpp) GO(g_dbus_proxy_new_for_bus_sync, pFiupppppp) GO(g_dbus_proxy_new_sync, pFpupppppp) GO(g_dbus_proxy_set_cached_property, vFppp) GO(g_dbus_proxy_set_default_timeout, vFpi) GO(g_dbus_proxy_set_interface_info, vFpp) -//GO(g_dbus_send_message_flags_get_type, -//GO(g_dbus_server_flags_get_type, -//GO(g_dbus_server_get_client_address, +GO(g_dbus_send_message_flags_get_type, LFv) +GO(g_dbus_server_flags_get_type, LFv) +GO(g_dbus_server_get_client_address, pFp) GO(g_dbus_server_get_flags, uFp) GO(g_dbus_server_get_guid, pFp) -//GO(g_dbus_server_get_type, +GO(g_dbus_server_get_type, LFv) GO(g_dbus_server_is_active, iFp) GO(g_dbus_server_new_sync, pFpupppp) -//GO(g_dbus_server_start, -//GO(g_dbus_server_stop, -//GO(g_dbus_signal_flags_get_type, +GO(g_dbus_server_start, vFp) +GO(g_dbus_server_stop, vFp) +GO(g_dbus_signal_flags_get_type, LFv) GO(g_dbus_signal_info_get_type, LFv) GO(g_dbus_signal_info_ref, pFp) GO(g_dbus_signal_info_unref, vFp) GO(g_dbus_subtree_flags_get_type, LFv) -//GO(g_desktop_app_info_get_action_name, -//GO(g_desktop_app_info_get_boolean, +GO(g_desktop_app_info_get_action_name, pFpp) +GO(g_desktop_app_info_get_boolean, iFpp) GO(g_desktop_app_info_get_categories, pFp) GO(g_desktop_app_info_get_filename, pFp) GO(g_desktop_app_info_get_generic_name, pFp) -//GO(g_desktop_app_info_get_implementations, +GO(g_desktop_app_info_get_implementations, pFp) GO(g_desktop_app_info_get_is_hidden, iFp) GO(g_desktop_app_info_get_keywords, pFp) GO(g_desktop_app_info_get_nodisplay, iFp) GO(g_desktop_app_info_get_show_in, iFpp) -//GO(g_desktop_app_info_get_startup_wm_class, +GO(g_desktop_app_info_get_startup_wm_class, pFp) GO(g_desktop_app_info_get_string, pFpp) GO(g_desktop_app_info_get_type, LFv) -//GO(g_desktop_app_info_has_key, -//GO(g_desktop_app_info_launch_action, -//GO(g_desktop_app_info_launch_uris_as_manager, -//GO(g_desktop_app_info_list_actions, -//GO(g_desktop_app_info_lookup_get_default_for_uri_scheme, +GO(g_desktop_app_info_has_key, iFpp) +GO(g_desktop_app_info_launch_action, vFppp) +//GOM(g_desktop_app_info_launch_uris_as_manager, iFpppuppppp) +GO(g_desktop_app_info_list_actions, pFp) +GO(g_desktop_app_info_lookup_get_default_for_uri_scheme, pFpp) GO(g_desktop_app_info_lookup_get_type, LFv) GO(g_desktop_app_info_new, pFp) GO(g_desktop_app_info_new_from_filename, pFp) GO(g_desktop_app_info_new_from_keyfile, pFp) -//GO(g_desktop_app_info_search, +GO(g_desktop_app_info_search, pFp) GO(g_desktop_app_info_set_desktop_env, vFp) -//GO(g_drive_can_eject, -//GO(g_drive_can_poll_for_media, -//GO(g_drive_can_start, -//GO(g_drive_can_start_degraded, +GO(g_drive_can_eject, iFp) +GO(g_drive_can_poll_for_media, iFp) +GO(g_drive_can_start, iFp) +GO(g_drive_can_start_degraded, iFp) GO(g_drive_can_stop, iFp) -//GO(g_drive_eject, -//GO(g_drive_eject_finish, -//GO(g_drive_eject_with_operation, +//GOM(g_drive_eject, vFpuppp) +GO(g_drive_eject_finish, iFppp) +//GOM(g_drive_eject_with_operation, vFpupppp) GO(g_drive_eject_with_operation_finish, iFppp) GO(g_drive_enumerate_identifiers, pFp) -//GO(g_drive_get_icon, +GO(g_drive_get_icon, pFp) GO(g_drive_get_identifier, pFpp) GO(g_drive_get_name, pFp) GO(g_drive_get_sort_key, pFp) GO(g_drive_get_start_stop_type, uFp) GO(g_drive_get_symbolic_icon, pFp) -//GO(g_drive_get_type, +GO(g_drive_get_type, LFv) GO(g_drive_get_volumes, pFp) -//GO(g_drive_has_media, -//GO(g_drive_has_volumes, -//GO(g_drive_is_media_check_automatic, -//GO(g_drive_is_media_removable, -//GO(g_drive_poll_for_media, -//GO(g_drive_poll_for_media_finish, -//GO(g_drive_start, -//GO(g_drive_start_finish, -//GO(g_drive_start_flags_get_type, -//GO(g_drive_start_stop_type_get_type, -//GO(g_drive_stop, -//GO(g_drive_stop_finish, +GO(g_drive_has_media, iFp) +GO(g_drive_has_volumes, iFp) +GO(g_drive_is_media_check_automatic, iFp) +GO(g_drive_is_media_removable, iFp) +//GOM(g_drive_poll_for_media, vFpppp) +GO(g_drive_poll_for_media_finish, iFppp) +//GOM(g_drive_start, vFpupppp) +GO(g_drive_start_finish, iFppp) +GO(g_drive_start_flags_get_type, LFv) +GO(g_drive_start_stop_type_get_type, LFv) +//GOM(g_drive_stop, vFpupppp) +GO(g_drive_stop_finish, iFppp) GO(g_emblemed_icon_add_emblem, vFpp) -//GO(g_emblemed_icon_clear_emblems, +GO(g_emblemed_icon_clear_emblems, vFp) GO(g_emblemed_icon_get_emblems, pFp) GO(g_emblemed_icon_get_icon, pFp) -//GO(g_emblemed_icon_get_type, +GO(g_emblemed_icon_get_type, LFv) GO(g_emblemed_icon_new, pFpp) GO(g_emblem_get_icon, pFp) GO(g_emblem_get_origin, uFp) -//GO(g_emblem_get_type, +GO(g_emblem_get_type, LFv) GO(g_emblem_new, pFp) GO(g_emblem_new_with_origin, pFpu) -//GO(g_emblem_origin_get_type, -GO(g_file_append_to, pFpipp) -//GOM(g_file_append_to_async, vFEpiipBp) +GO(g_emblem_origin_get_type, LFv) +GO(g_file_append_to, pFpupp) +//GOM(g_file_append_to_async, vFEpuippp) GO(g_file_append_to_finish, pFppp) -//GO(g_file_attribute_info_flags_get_type, +GO(g_file_attribute_info_flags_get_type, LFv) GO(g_file_attribute_info_list_add, vFppuu) GO(g_file_attribute_info_list_dup, pFp) -//GO(g_file_attribute_info_list_get_type, +GO(g_file_attribute_info_list_get_type, LFv) GO(g_file_attribute_info_list_lookup, pFpp) GO(g_file_attribute_info_list_new, pFv) -//GO(g_file_attribute_info_list_ref, -//GO(g_file_attribute_info_list_unref, +GO(g_file_attribute_info_list_ref, pFp) +GO(g_file_attribute_info_list_unref, vFp) GO(g_file_attribute_matcher_enumerate_namespace, iFpp) GO(g_file_attribute_matcher_enumerate_next, pFp) -//GO(g_file_attribute_matcher_get_type, -//GO(g_file_attribute_matcher_matches, -//GO(g_file_attribute_matcher_matches_only, +GO(g_file_attribute_matcher_get_type, LFv) +GO(g_file_attribute_matcher_matches, iFpp) +GO(g_file_attribute_matcher_matches_only, iFpp) GO(g_file_attribute_matcher_new, pFp) GO(g_file_attribute_matcher_ref, pFp) GO(g_file_attribute_matcher_subtract, pFpp) GO(g_file_attribute_matcher_to_string, pFp) GO(g_file_attribute_matcher_unref, vFp) -//GO(g_file_attribute_status_get_type, -//GO(g_file_attribute_type_get_type, -//GOM(g_file_copy, iFEppipBpp) -//GOM(g_file_copy_async, vFEppiipBpBp) +GO(g_file_attribute_status_get_type, LFv) +GO(g_file_attribute_type_get_type, LFv) +//GOM(g_file_copy, iFEppupppp) +//GOM(g_file_copy_async, vFEppuippppp) GO(g_file_copy_attributes, iFppupp) GO(g_file_copy_finish, iFppp) GO(g_file_copy_flags_get_type, LFv) GO(g_file_create, pFpupp) -//GOM(g_file_create_async, vFEpiipBp) +//GOM(g_file_create_async, vFEpuippp) GO(g_file_create_finish, pFppp) GO(g_file_create_flags_get_type, LFv) GO(g_file_create_readwrite, pFpupp) -//GOM(g_file_create_readwrite_async, vFEpiipBp) +//GOM(g_file_create_readwrite_async, vFEpuippp) GO(g_file_create_readwrite_finish, pFppp) GO(g_file_delete, iFppp) -//GOM(g_file_delete_async, vFEpipBp) -GO(g_file_delete_finish, pFppp) -//GO(g_file_descriptor_based_get_fd, -//GO(g_file_descriptor_based_get_type, +//GOM(g_file_delete_async, vFEpippp) +GO(g_file_delete_finish, iFppp) +GO(g_file_descriptor_based_get_fd, iFp) +GO(g_file_descriptor_based_get_type, LFv) GO(g_file_dup, pFp) -//GOM(g_file_eject_mountable, vFEpipBp) +//GOM(g_file_eject_mountable, vFEpuppp) GO(g_file_eject_mountable_finish, iFppp) -//GOM(g_file_eject_mountable_with_operation, vFpippBp) +//GOM(g_file_eject_mountable_with_operation, vFpupppp) GO(g_file_eject_mountable_with_operation_finish, iFppp) GO(g_file_enumerate_children, pFppupp) -//GOM(g_file_enumerate_children_async, vFppiipBp) +//GOM(g_file_enumerate_children_async, vFppuippp) GO(g_file_enumerate_children_finish, pFppp) GO(g_file_enumerator_close, iFppp) -//GO(g_file_enumerator_close_async, +//GOM(g_file_enumerator_close_async, vFpippp) GO(g_file_enumerator_close_finish, iFppp) GO(g_file_enumerator_get_child, pFpp) GO(g_file_enumerator_get_container, pFp) -//GO(g_file_enumerator_get_type, +GO(g_file_enumerator_get_type, LFv) GO(g_file_enumerator_has_pending, iFp) -//GO(g_file_enumerator_is_closed, +GO(g_file_enumerator_is_closed, iFp) GO(g_file_enumerator_next_file, pFppp) -//GO(g_file_enumerator_next_files_async, +//GOM(g_file_enumerator_next_files_async, vFpiippp) GO(g_file_enumerator_next_files_finish, pFppp) GO(g_file_enumerator_set_pending, vFpi) GO(g_file_equal, iFpp) GO(g_file_find_enclosing_mount, pFppp) -//GOM(g_file_find_enclosing_mount_async, vFEpipBp) +//GOM(g_file_find_enclosing_mount_async, vFEpippp) GO(g_file_find_enclosing_mount_finish, pFppp) GO(g_file_get_basename, pFp) GO(g_file_get_child, pFpp) @@ -703,7 +703,7 @@ GO(g_file_has_uri_scheme, iFpp) GO(g_file_icon_get_file, pFp) GO(g_file_icon_get_type, LFv) GO(g_file_icon_new, pFp) -//GO(g_file_info_clear_status, +GO(g_file_info_clear_status, vFp) GO(g_file_info_copy_into, vFpp) GO(g_file_info_dup, pFp) GO(g_file_info_get_attribute_as_string, pFpp) @@ -714,33 +714,33 @@ GO(g_file_info_get_attribute_int32, iFpp) GO(g_file_info_get_attribute_int64, lFpp) GO(g_file_info_get_attribute_object, pFpp) GO(g_file_info_get_attribute_status, uFpp) -//GO(g_file_info_get_attribute_string, +GO(g_file_info_get_attribute_string, pFpp) GO(g_file_info_get_attribute_stringv, pFpp) GO(g_file_info_get_attribute_type, uFpp) GO(g_file_info_get_attribute_uint32, uFpp) GO(g_file_info_get_attribute_uint64, LFpp) -//GO(g_file_info_get_content_type, -//GO(g_file_info_get_deletion_date, -//GO(g_file_info_get_display_name, -//GO(g_file_info_get_edit_name, +GO(g_file_info_get_content_type, pFp) +GO(g_file_info_get_deletion_date, pFp) +GO(g_file_info_get_display_name, pFp) +GO(g_file_info_get_edit_name, pFp) GO(g_file_info_get_etag, pFp) GO(g_file_info_get_file_type, uFp) -//GO(g_file_info_get_icon, -//GO(g_file_info_get_is_backup, -//GO(g_file_info_get_is_hidden, +GO(g_file_info_get_icon, pFp) +GO(g_file_info_get_is_backup, iFp) +GO(g_file_info_get_is_hidden, iFp) GO(g_file_info_get_is_symlink, iFp) -//GO(g_file_info_get_modification_time, -//GO(g_file_info_get_name, +GO(g_file_info_get_modification_time, vFpp) +GO(g_file_info_get_name, pFp) GO(g_file_info_get_size, lFp) GO(g_file_info_get_sort_order, iFp) GO(g_file_info_get_symbolic_icon, pFp) -//GO(g_file_info_get_symlink_target, -//GO(g_file_info_get_type, -//GO(g_file_info_has_attribute, -//GO(g_file_info_has_namespace, -//GO(g_file_info_list_attributes, +GO(g_file_info_get_symlink_target, pFp) +GO(g_file_info_get_type, LFv) +GO(g_file_info_has_attribute, iFpp) +GO(g_file_info_has_namespace, iFpp) +GO(g_file_info_list_attributes, pFpp) GO(g_file_info_new, pFv) -//GO(g_file_info_remove_attribute, +GO(g_file_info_remove_attribute, vFpp) GO(g_file_info_set_attribute, vFppup) GO(g_file_info_set_attribute_boolean, vFppi) GO(g_file_info_set_attribute_byte_string, vFppp) @@ -749,69 +749,69 @@ GO(g_file_info_set_attribute_int64, vFppl) GO(g_file_info_set_attribute_mask, vFpp) GO(g_file_info_set_attribute_object, vFppp) GO(g_file_info_set_attribute_status, iFppu) -//GO(g_file_info_set_attribute_string, +GO(g_file_info_set_attribute_string, vFppp) GO(g_file_info_set_attribute_stringv, vFppp) GO(g_file_info_set_attribute_uint32, vFppu) GO(g_file_info_set_attribute_uint64, vFppL) -//GO(g_file_info_set_content_type, -//GO(g_file_info_set_display_name, -//GO(g_file_info_set_edit_name, +GO(g_file_info_set_content_type, vFpp) +GO(g_file_info_set_display_name, vFpp) +GO(g_file_info_set_edit_name, vFpp) GO(g_file_info_set_file_type, vFpu) -//GO(g_file_info_set_icon, -//GO(g_file_info_set_is_hidden, +GO(g_file_info_set_icon, vFpp) +GO(g_file_info_set_is_hidden, vFpi) GO(g_file_info_set_is_symlink, vFpi) GO(g_file_info_set_modification_time, vFpp) -//GO(g_file_info_set_name, +GO(g_file_info_set_name, vFpp) GO(g_file_info_set_size, vFpl) GO(g_file_info_set_sort_order, vFpi) GO(g_file_info_set_symbolic_icon, vFpp) GO(g_file_info_set_symlink_target, vFpp) -//GO(g_file_info_unset_attribute_mask, -//GO(g_file_input_stream_get_type, +GO(g_file_info_unset_attribute_mask, vFp) +GO(g_file_input_stream_get_type, LFv) GO(g_file_input_stream_query_info, pFpppp) -//GO(g_file_input_stream_query_info_async, +//GOM(g_file_input_stream_query_info_async, vFppippp) GO(g_file_input_stream_query_info_finish, pFppp) GO(g_file_io_stream_get_etag, pFp) -//GO(g_file_io_stream_get_type, +GO(g_file_io_stream_get_type, LFv) GO(g_file_io_stream_query_info, pFpppp) -//GO(g_file_io_stream_query_info_async, +//GOM(g_file_io_stream_query_info_async, vFppippp) GO(g_file_io_stream_query_info_finish, pFppp) -GO(g_file_is_native, iFpp) +GO(g_file_is_native, iFp) GO(g_file_load_bytes, pFpppp) //sice 2.56+ -//GOM(g_file_load_bytes_async, vFEppBp) //since 2.56+ +//GOM(g_file_load_bytes_async, vFEpppp) //since 2.56+ GO(g_file_load_bytes_finish, pFpppp) //since 2.56+ GO(g_file_load_contents, iFpppppp) -//GOM(g_file_load_contents_async, vFEppBp) +//GOM(g_file_load_contents_async, vFEpppp) GO(g_file_load_contents_finish, iFpppppp) -//GOM(g_file_load_partial_contents_async, vFppBBp) +//GOM(g_file_load_partial_contents_async, vFppppp) GO(g_file_load_partial_contents_finish, iFpppppp) GO(g_file_make_directory, iFppp) -//GOM(g_file_make_directory_async, vFEpipBp) +//GOM(g_file_make_directory_async, vFEpippp) GO(g_file_make_directory_finish, iFppp) GO(g_file_make_directory_with_parents, iFppp) GO(g_file_make_symbolic_link, iFpppp) -//GOM(g_file_measure_disk_usage, iFEpipBppppp) -//GOM(g_file_measure_disk_usage_async, vFEpiipBpBp) +//GOM(g_file_measure_disk_usage, iFEpuppppppp) +//GOM(g_file_measure_disk_usage_async, vFEpuippppp) GO(g_file_measure_disk_usage_finish, iFpppppp) -//GO(g_file_measure_flags_get_type, +GO(g_file_measure_flags_get_type, LFv) GO(g_file_monitor, pFpupp) -//GO(g_file_monitor_cancel, -GO(g_file_monitor_directory, pFpipp) +GO(g_file_monitor_cancel, iFp) +GO(g_file_monitor_directory, pFpupp) GO(g_file_monitor_emit_event, vFpppu) -//GO(g_file_monitor_event_get_type, -GO(g_file_monitor_file, pFpipp) -//GO(g_file_monitor_flags_get_type, -//GO(g_file_monitor_get_type, +GO(g_file_monitor_event_get_type, LFv) +GO(g_file_monitor_file, pFpupp) +GO(g_file_monitor_flags_get_type, LFv) +GO(g_file_monitor_get_type, LFv) GO(g_file_monitor_is_cancelled, iFp) GO(g_file_monitor_set_rate_limit, vFpi) -//GOM(g_file_mount_enclosing_volume, vFEpippBp) +//GOM(g_file_mount_enclosing_volume, vFEpupppp) GO(g_file_mount_enclosing_volume_finish, iFppp) -//GOM(g_file_mount_mountable, vFEpippBp) +//GOM(g_file_mount_mountable, vFEpupppp) GO(g_file_mount_mountable_finish, pFppp) -//GOM(g_file_move, iFEppipBpp) +//GOM(g_file_move, iFEppupppp) GO(g_filename_completer_get_completions, pFpp) GO(g_filename_completer_get_completion_suffix, pFpp) -//GO(g_filename_completer_get_type, +GO(g_filename_completer_get_type, LFv) GO(g_filename_completer_new, pFv) GO(g_filename_completer_set_dirs_only, vFpi) GO(g_file_new_build_filename, pFppppppppppp) // vaarg, since v2.56+ @@ -821,106 +821,106 @@ GO(g_file_new_for_path, pFp) GO(g_file_new_for_uri, pFp) GO(g_file_new_tmp, pFppp) GO(g_file_open_readwrite, pFppp) -//GOM(g_file_open_readwrite_async, vFEpipBp) +//GOM(g_file_open_readwrite_async, vFEpippp) GO(g_file_open_readwrite_finish, pFppp) GO(g_file_output_stream_get_etag, pFp) -//GO(g_file_output_stream_get_type, +GO(g_file_output_stream_get_type, LFv) GO(g_file_output_stream_query_info, pFpppp) -//GO(g_file_output_stream_query_info_async, +//GOM(g_file_output_stream_query_info_async, vFppippp) GO(g_file_output_stream_query_info_finish, pFppp) GO(g_file_parse_name, pFp) -GO(g_file_peek_path , pFp) // sice 2.56+ -//GOM(g_file_poll_mountable, vFEppBp) +GO(g_file_peek_path, pFp) +//GOM(g_file_poll_mountable, vFEpppp) GO(g_file_poll_mountable_finish, iFppp) GO(g_file_query_default_handler, pFppp) -//GOMg_file_query_default_handler_async, vFEpipBp) //since 2.60+ +//GOM(g_file_query_default_handler_async, vFEpipBp) //since 2.60+ GO(g_file_query_default_handler_finish, pFppp) //since 2.60+ GO(g_file_query_exists, iFpp) GO(g_file_query_filesystem_info, pFpppp) -//GOM(g_file_query_filesystem_info_async, vFEppipBp) +//GOM(g_file_query_filesystem_info_async, vFEppippp) GO(g_file_query_filesystem_info_finish, pFppp) GO(g_file_query_file_type, uFpup) GO(g_file_query_info, pFppupp) -//GOM(g_file_query_info_async, vFEppiipBp) +//GOM(g_file_query_info_async, vFEppuippp) GO(g_file_query_info_finish, pFppp) -//GO(g_file_query_info_flags_get_type, +GO(g_file_query_info_flags_get_type, LFv) GO(g_file_query_settable_attributes, pFppp) GO(g_file_query_writable_namespaces, pFppp) GO(g_file_read, pFppp) -//GOM(g_file_read_async, vFEpipBp) +//GOM(g_file_read_async, vFEpippp) GO(g_file_read_finish, pFppp) GO(g_file_replace, pFppiupp) -//GOM(g_file_replace_async, vFEppiiipBp) +//GOM(g_file_replace_async, vFEppiuippp) GO(g_file_replace_contents, iFppLpiuppp) -//GOM(g_file_replace_contents_async, vFEppLpuupBp) -//GOM(g_file_replace_contents_bytes_async, vFEpppiipBp) +//GOM(g_file_replace_contents_async, vFEppLpiuppp) +//GOM(g_file_replace_contents_bytes_async, vFEpppiuppp) GO(g_file_replace_contents_finish, iFpppp) GO(g_file_replace_finish, pFppp) GO(g_file_replace_readwrite, pFppiupp) -//GOM(g_file_replace_readwrite_async, vFEppiiipBp) +//GOM(g_file_replace_readwrite_async, vFEppiuippp) GO(g_file_replace_readwrite_finish, pFppp) GO(g_file_resolve_relative_path, pFpp) GO(g_file_set_attribute, iFppupupp) GO(g_file_set_attribute_byte_string, iFpppupp) GO(g_file_set_attribute_int32, iFppiupp) GO(g_file_set_attribute_int64, iFpplupp) -//GOM(g_file_set_attributes_async, vFEppiipBp) +//GOM(g_file_set_attributes_async, vFEppuippp) GO(g_file_set_attributes_finish, iFpppp) GO(g_file_set_attributes_from_info, iFppupp) -GO(g_file_set_attribute_string, iFpppipp) +GO(g_file_set_attribute_string, iFpppupp) GO(g_file_set_attribute_uint32, iFppuupp) GO(g_file_set_attribute_uint64, iFppLupp) GO(g_file_set_display_name, pFpppp) -//GOM(g_file_set_display_name_async, vFEppipBp) +//GOM(g_file_set_display_name_async, vFEppippp) GO(g_file_set_display_name_finish, pFppp) -//GOM(g_file_start_mountable, vFEpippBp) +//GOM(g_file_start_mountable, vFEpupppp) GO(g_file_start_mountable_finish, iFppp) -//GOM(g_file_stop_mountable, vFpippBp) +//GOM(g_file_stop_mountable, vFpupppp) GO(g_file_stop_mountable_finish, iFppp) GO(g_file_supports_thread_contexts, iFp) -//GO(g_filesystem_preview_type_get_type, +GO(g_filesystem_preview_type_get_type, LFv) GO(g_file_trash, iFppp) -//GOM(g_file_trash_async, vFEpipBp) -GO(g_file_trash_finish, pFppp) +//GOM(g_file_trash_async, vFEpippp) +GO(g_file_trash_finish, iFppp) GO(g_file_type_get_type, LFv) -//GOM(g_file_unmount_mountable, vFEpipBp) +//GOM(g_file_unmount_mountable, vFEpuppp) GO(g_file_unmount_mountable_finish, iFppp) -//GOM(g_file_unmount_mountable_with_operation, vFEpippBp) +//GOM(g_file_unmount_mountable_with_operation, vFEpupppp) GO(g_file_unmount_mountable_with_operation_finish, iFppp) GO(g_filter_input_stream_get_base_stream, pFp) GO(g_filter_input_stream_get_close_base_stream, iFp) -//GO(g_filter_input_stream_get_type, +GO(g_filter_input_stream_get_type, LFv) GO(g_filter_input_stream_set_close_base_stream, vFpi) GO(g_filter_output_stream_get_base_stream, pFp) GO(g_filter_output_stream_get_close_base_stream, iFp) -//GO(g_filter_output_stream_get_type, +GO(g_filter_output_stream_get_type, LFv) GO(g_filter_output_stream_set_close_base_stream, vFpi) GO(g_icon_deserialize, pFp) GO(g_icon_equal, iFpp) -//GO(g_icon_get_type, +GO(g_icon_get_type, LFv) GO(g_icon_hash, uFp) GO(g_icon_new_for_string, pFpp) GO(g_icon_serialize, pFp) GO(g_icon_to_string, pFp) GO(g_inet_address_equal, iFpp) GO(g_inet_address_get_family, uFp) -//GO(g_inet_address_get_is_any, -//GO(g_inet_address_get_is_link_local, -//GO(g_inet_address_get_is_loopback, -//GO(g_inet_address_get_is_mc_global, -//GO(g_inet_address_get_is_mc_link_local, -//GO(g_inet_address_get_is_mc_node_local, -//GO(g_inet_address_get_is_mc_org_local, +GO(g_inet_address_get_is_any, iFp) +GO(g_inet_address_get_is_link_local, iFp) +GO(g_inet_address_get_is_loopback, iFp) +GO(g_inet_address_get_is_mc_global, iFp) +GO(g_inet_address_get_is_mc_link_local, iFp) +GO(g_inet_address_get_is_mc_node_local, iFp) +GO(g_inet_address_get_is_mc_org_local, iFp) GO(g_inet_address_get_is_mc_site_local, iFp) -//GO(g_inet_address_get_is_multicast, -//GO(g_inet_address_get_is_site_local, +GO(g_inet_address_get_is_multicast, iFp) +GO(g_inet_address_get_is_site_local, iFp) GO(g_inet_address_get_native_size, LFp) -//GO(g_inet_address_get_type, +GO(g_inet_address_get_type, LFv) GO(g_inet_address_mask_equal, iFpp) GO(g_inet_address_mask_get_address, pFp) GO(g_inet_address_mask_get_family, uFp) GO(g_inet_address_mask_get_length, uFp) -//GO(g_inet_address_mask_get_type, +GO(g_inet_address_mask_get_type, LFv) GO(g_inet_address_mask_matches, iFpp) GO(g_inet_address_mask_new, pFpup) GO(g_inet_address_mask_new_from_string, pFpp) @@ -928,40 +928,40 @@ GO(g_inet_address_mask_to_string, pFp) GO(g_inet_address_new_any, pFu) GO(g_inet_address_new_from_bytes, pFpu) GO(g_inet_address_new_from_string, pFp) -//GO(g_inet_address_new_loopback, +GO(g_inet_address_new_loopback, pFu) GO(g_inet_address_to_bytes, pFp) GO(g_inet_address_to_string, pFp) GO(g_inet_socket_address_get_address, pFp) -//GO(g_inet_socket_address_get_flowinfo, +GO(g_inet_socket_address_get_flowinfo, uFp) GO(g_inet_socket_address_get_port, WFp) GO(g_inet_socket_address_get_scope_id, uFp) -//GO(g_inet_socket_address_get_type, +GO(g_inet_socket_address_get_type, LFv) GO(g_inet_socket_address_new, pFpW) GO(g_inet_socket_address_new_from_string, pFpu) GO(g_initable_get_type, LFv) GO(g_initable_init, iFppp) -GOM(g_initable_new, pFEppppV) +GOM(g_initable_new, pFELpppV) GO(g_initable_newv, pFLuppp) -GOM(g_initable_new_valist, pFEppApp) -//GO(g_input_stream_clear_pending, +GOM(g_initable_new_valist, pFELpApp) +GO(g_input_stream_clear_pending, vFp) GO(g_input_stream_close, iFppp) -//GO(g_input_stream_close_async, +//GOM(g_input_stream_close_async, vFpippp) GO(g_input_stream_close_finish, iFppp) GO(g_input_stream_get_type, LFv) GO(g_input_stream_has_pending, iFp) -//GO(g_input_stream_is_closed, +GO(g_input_stream_is_closed, iFp) GO(g_input_stream_read, lFppLpp) GO(g_input_stream_read_all, iFppLppp) GOM(g_input_stream_read_async, vFEppLippp) GO(g_input_stream_read_bytes, pFpLpp) -//GO(g_input_stream_read_bytes_async, +//GOM(g_input_stream_read_bytes_async, vFpLippp) GO(g_input_stream_read_bytes_finish, pFppp) GO(g_input_stream_read_finish, lFppp) GO(g_input_stream_set_pending, iFpp) GO(g_input_stream_skip, lFpLpp) -//GO(g_input_stream_skip_async, +//GOM(g_input_stream_skip_async, vFpLippp) GO(g_input_stream_skip_finish, lFppp) -//GO(g_io_error_enum_get_type, +GO(g_io_error_enum_get_type, LFv) GO(g_io_error_from_errno, uFi) GO(g_io_error_quark, uFv) GO(g_io_extension_get_name, pFp) @@ -972,57 +972,57 @@ GO(g_io_extension_point_get_extensions, pFp) GO(g_io_extension_point_get_required_type, LFp) GO(g_io_extension_point_implement, pFpLpi) GO(g_io_extension_point_lookup, pFp) -//GO(g_io_extension_point_register, +GO(g_io_extension_point_register, pFp) GO(g_io_extension_point_set_required_type, vFpL) GO(g_io_extension_ref_class, pFp) -//GO(g_io_module_get_type, +GO(g_io_module_get_type, LFv) GO(g_io_module_new, pFp) GO(g_io_module_scope_block, vFpp) -//GO(g_io_module_scope_flags_get_type, +GO(g_io_module_scope_flags_get_type, LFv) GO(g_io_module_scope_free, vFp) GO(g_io_module_scope_new, pFu) GO(g_io_modules_load_all_in_directory, pFp) GO(g_io_modules_load_all_in_directory_with_scope, pFpp) GO(g_io_modules_scan_all_in_directory, vFp) GO(g_io_modules_scan_all_in_directory_with_scope, vFpp) -//GO(g_io_scheduler_cancel_all_jobs, -//GO(g_io_scheduler_job_send_to_mainloop, -//GO(g_io_scheduler_job_send_to_mainloop_async, -//GO(g_io_scheduler_push_job, -//GO(g_io_stream_clear_pending, +GO(g_io_scheduler_cancel_all_jobs, vFv) +//GOM(g_io_scheduler_job_send_to_mainloop, iFpppp) +//GOM(g_io_scheduler_job_send_to_mainloop_async, vFpppp) +//GOM(g_io_scheduler_push_job, vFpppip) +GO(g_io_stream_clear_pending, vFp) GO(g_io_stream_close, iFppp) -//GO(g_io_stream_close_async, +//GOM(g_io_stream_close_async, vFpippp) GO(g_io_stream_close_finish, iFppp) GO(g_io_stream_get_input_stream, pFp) GO(g_io_stream_get_output_stream, pFp) -//GO(g_io_stream_get_type, +GO(g_io_stream_get_type, LFv) GO(g_io_stream_has_pending, iFp) -//GO(g_io_stream_is_closed, +GO(g_io_stream_is_closed, iFp) GO(g_io_stream_set_pending, iFpp) -//GO(g_io_stream_splice_async, +//GOM(g_io_stream_splice_async, vFppuippp) GO(g_io_stream_splice_finish, iFpp) -//GO(g_io_stream_splice_flags_get_type, +GO(g_io_stream_splice_flags_get_type, LFv) //GO(g_keyfile_settings_backend_new, GO(g_list_model_get_item, pFpu) GO(g_list_model_get_n_items, uFp) GO(g_list_model_get_object, pFpu) -//GO(g_loadable_icon_get_type, +GO(g_loadable_icon_get_type, LFv) GO(g_loadable_icon_load, pFpippp) -//GO(g_loadable_icon_load_async, +//GOM(g_loadable_icon_load_async, vFpippp) GO(g_loadable_icon_load_finish, pFpppp) //GO(g_local_directory_monitor_get_type, //GO(g_local_file_monitor_get_type, GO(g_memory_input_stream_add_bytes, vFpp) -//GO(g_memory_input_stream_add_data, -//GO(g_memory_input_stream_get_type, +//GOM(g_memory_input_stream_add_data, vFpplp) +GO(g_memory_input_stream_get_type, LFv) GO(g_memory_input_stream_new, pFv) GO(g_memory_input_stream_new_from_bytes, pFp) -//GO(g_memory_input_stream_new_from_data, -//GO(g_memory_output_stream_get_data, +//GOM(g_memory_input_stream_new_from_data, pFplp) +GO(g_memory_output_stream_get_data, pFp) GO(g_memory_output_stream_get_data_size, LFp) -//GO(g_memory_output_stream_get_size, -//GO(g_memory_output_stream_get_type, -//GO(g_memory_output_stream_new, +GO(g_memory_output_stream_get_size, LFp) +GO(g_memory_output_stream_get_type, LFv) +//GOM(g_memory_output_stream_new, pFpLpp) GO(g_memory_output_stream_new_resizable, pFv) GO(g_memory_output_stream_steal_as_bytes, pFp) GO(g_memory_output_stream_steal_data, pFp) @@ -1033,107 +1033,107 @@ GO(g_menu_append_section, vFppp) GO(g_menu_append_submenu, vFppp) GO(g_menu_attribute_iter_get_name, pFp) GO(g_menu_attribute_iter_get_next, iFppp) -//GO(g_menu_attribute_iter_get_type, +GO(g_menu_attribute_iter_get_type, LFv) GO(g_menu_attribute_iter_get_value, pFp) GO(g_menu_attribute_iter_next, iFp) -//GO(g_menu_freeze, -//GO(g_menu_get_type, +GO(g_menu_freeze, vFp) +GO(g_menu_get_type, LFv) GO(g_menu_insert, vFpipp) GO(g_menu_insert_item, vFpip) -//GO(g_menu_insert_section, +GO(g_menu_insert_section, vFpipp) GO(g_menu_insert_submenu, vFpipp) -//GO(g_menu_item_get_attribute, +//GOM(g_menu_item_get_attribute, iFpppV) GO(g_menu_item_get_attribute_value, pFppp) GO(g_menu_item_get_link, pFpp) -//GO(g_menu_item_get_type, +GO(g_menu_item_get_type, LFv) GO(g_menu_item_new, pFpp) GO(g_menu_item_new_from_model, pFpi) GO(g_menu_item_new_section, pFpp) -//GO(g_menu_item_new_submenu, -//GO(g_menu_item_set_action_and_target, +GO(g_menu_item_new_submenu, pFpp) +//GOM(g_menu_item_set_action_and_target, vFpppV) GO(g_menu_item_set_action_and_target_value, vFppp) -//GO(g_menu_item_set_attribute, -//GO(g_menu_item_set_attribute_value, +//GOM(g_menu_item_set_attribute, vFpppV) +GO(g_menu_item_set_attribute_value, vFppp) GO(g_menu_item_set_detailed_action, vFpp) GO(g_menu_item_set_icon, vFpp) -//GO(g_menu_item_set_label, +GO(g_menu_item_set_label, vFpp) GO(g_menu_item_set_link, vFppp) GO(g_menu_item_set_section, vFpp) -//GO(g_menu_item_set_submenu, +GO(g_menu_item_set_submenu, vFpp) GO(g_menu_link_iter_get_name, pFp) GO(g_menu_link_iter_get_next, iFppp) -//GO(g_menu_link_iter_get_type, +GO(g_menu_link_iter_get_type, LFv) GO(g_menu_link_iter_get_value, pFp) GO(g_menu_link_iter_next, iFp) -//GO(g_menu_model_get_item_attribute, +//GOM(g_menu_model_get_item_attribute, iFpippV) GO(g_menu_model_get_item_attribute_value, pFpipp) GO(g_menu_model_get_item_link, pFpip) GO(g_menu_model_get_n_items, iFp) -//GO(g_menu_model_get_type, +GO(g_menu_model_get_type, LFv) GO(g_menu_model_is_mutable, iFp) GO(g_menu_model_items_changed, vFpiii) GO(g_menu_model_iterate_item_attributes, pFpi) GO(g_menu_model_iterate_item_links, pFpi) GO(g_menu_new, pFv) -//GO(g_menu_prepend, -//GO(g_menu_prepend_item, -//GO(g_menu_prepend_section, -//GO(g_menu_prepend_submenu, +GO(g_menu_prepend, vFppp) +GO(g_menu_prepend_item, vFpp) +GO(g_menu_prepend_section, vFppp) +GO(g_menu_prepend_submenu, vFppp) GO(g_menu_remove, vFpi) -//GO(g_menu_remove_all, -//GO(g_mount_can_eject, -//GO(g_mount_can_unmount, -//GO(g_mount_eject, -//GO(g_mount_eject_finish, -//GO(g_mount_eject_with_operation, +GO(g_menu_remove_all, vFp) +GO(g_mount_can_eject, iFp) +GO(g_mount_can_unmount, iFp) +//GOM(g_mount_eject, vFpuppp) +GO(g_mount_eject_finish, iFppp) +//GOM(g_mount_eject_with_operation, vFpupppp) GO(g_mount_eject_with_operation_finish, iFppp) GO(g_mount_get_default_location, pFp) GO(g_mount_get_drive, pFp) -//GO(g_mount_get_icon, -//GO(g_mount_get_name, -//GO(g_mount_get_root, +GO(g_mount_get_icon, pFp) +GO(g_mount_get_name, pFp) +GO(g_mount_get_root, pFp) GO(g_mount_get_sort_key, pFp) GO(g_mount_get_symbolic_icon, pFp) -//GO(g_mount_get_type, +GO(g_mount_get_type, LFv) GO(g_mount_get_uuid, pFp) -//GO(g_mount_get_volume, -//GO(g_mount_guess_content_type, +GO(g_mount_get_volume, pFp) +//GOM(g_mount_guess_content_type, vFpippp) GO(g_mount_guess_content_type_finish, pFppp) GO(g_mount_guess_content_type_sync, pFpipp) GO(g_mount_is_shadowed, iFp) -//GO(g_mount_mount_flags_get_type, -//GO(g_mount_operation_get_anonymous, +GO(g_mount_mount_flags_get_type, LFv) +GO(g_mount_operation_get_anonymous, iFp) GO(g_mount_operation_get_choice, iFp) GO(g_mount_operation_get_domain, pFp) -//GO(g_mount_operation_get_password, +GO(g_mount_operation_get_password, pFp) GO(g_mount_operation_get_password_save, uFp) -//GO(g_mount_operation_get_type, -//GO(g_mount_operation_get_username, +GO(g_mount_operation_get_type, LFv) +GO(g_mount_operation_get_username, pFp) GO(g_mount_operation_new, pFv) GO(g_mount_operation_reply, vFpu) -//GO(g_mount_operation_result_get_type, -//GO(g_mount_operation_set_anonymous, +GO(g_mount_operation_result_get_type, LFv) +GO(g_mount_operation_set_anonymous, vFpi) GO(g_mount_operation_set_choice, vFpi) GO(g_mount_operation_set_domain, vFpp) -//GO(g_mount_operation_set_password, +GO(g_mount_operation_set_password, vFpp) GO(g_mount_operation_set_password_save, vFpu) -//GO(g_mount_operation_set_username, -//GO(g_mount_remount, -//GO(g_mount_remount_finish, -//GO(g_mount_shadow, -//GO(g_mount_unmount, -//GO(g_mount_unmount_finish, -//GO(g_mount_unmount_flags_get_type, -//GO(g_mount_unmount_with_operation, -//GO(g_mount_unmount_with_operation_finish, -//GO(g_mount_unshadow, -//GO(g_native_volume_monitor_get_type, -//GO(g_network_address_get_hostname, +GO(g_mount_operation_set_username, vFpp) +//GOM(g_mount_remount, vFpupppp) +GO(g_mount_remount_finish, iFppp) +GO(g_mount_shadow, vFp) +//GOM(g_mount_unmount, vFpuppp) +GO(g_mount_unmount_finish, iFppp) +GO(g_mount_unmount_flags_get_type, LFv) +//GOM(g_mount_unmount_with_operation, vFpupppp) +GO(g_mount_unmount_with_operation_finish, iFppp) +GO(g_mount_unshadow, vFp) +GO(g_native_volume_monitor_get_type, LFv) +GO(g_network_address_get_hostname, pFp) GO(g_network_address_get_port, WFp) GO(g_network_address_get_scheme, pFp) -//GO(g_network_address_get_type, +GO(g_network_address_get_type, LFv) GO(g_network_address_new, pFpW) -//GO(g_network_address_parse, +GO(g_network_address_parse, pFpWp) GO(g_network_address_parse_uri, pFpWp) //GO(g_networking_init, //GO(g_network_monitor_base_add_network, @@ -1141,141 +1141,143 @@ GO(g_network_address_parse_uri, pFpWp) //GO(g_network_monitor_base_remove_network, //GO(g_network_monitor_base_set_networks, GO(g_network_monitor_can_reach, iFpppp) -//GO(g_network_monitor_can_reach_async, +//GOM(g_network_monitor_can_reach_async, vFppppp) GO(g_network_monitor_can_reach_finish, iFppp) +GO(g_network_monitor_get_connectivity, iFp) GO(g_network_monitor_get_default, pFv) -//GO(g_network_monitor_get_network_available, -//GO(g_network_monitor_get_type, -//GO(g_network_service_get_domain, -//GO(g_network_service_get_protocol, +GO(g_network_monitor_get_network_available, iFp) +GO(g_network_monitor_get_network_metered, iFp) +GO(g_network_monitor_get_type, LFv) +GO(g_network_service_get_domain, pFp) +GO(g_network_service_get_protocol, pFp) GO(g_network_service_get_scheme, pFp) -//GO(g_network_service_get_service, -//GO(g_network_service_get_type, +GO(g_network_service_get_service, pFp) +GO(g_network_service_get_type, LFv) GO(g_network_service_new, pFppp) GO(g_network_service_set_scheme, vFpp) GO(g_notification_add_button, vFppp) -//GO(g_notification_add_button_with_target, +//GOM(g_notification_add_button_with_target, vFppppV) GO(g_notification_add_button_with_target_value, vFpppp) -//GO(g_notification_get_type, +GO(g_notification_get_type, LFv) GO(g_notification_new, pFp) -//GO(g_notification_priority_get_type, -//GO(g_notification_set_body, +GO(g_notification_priority_get_type, LFv) +GO(g_notification_set_body, vFpp) GO(g_notification_set_default_action, vFpp) -//GO(g_notification_set_default_action_and_target, +//GOM(g_notification_set_default_action_and_target, vFpppV) GO(g_notification_set_default_action_and_target_value, vFppp) GO(g_notification_set_icon, vFpp) GO(g_notification_set_priority, vFpu) -//GO(g_notification_set_title, +GO(g_notification_set_title, vFpp) GO(g_notification_set_urgent, vFpi) //GO(g_null_settings_backend_new, -//GO(g_output_stream_clear_pending, +GO(g_output_stream_clear_pending, vFp) GO(g_output_stream_close, iFppp) -//GO(g_output_stream_close_async, +//GOM(g_output_stream_close_async, vFpippp) GO(g_output_stream_close_finish, iFppp) -//GO(g_output_stream_flush, -//GO(g_output_stream_flush_async, -//GO(g_output_stream_flush_finish, -//GO(g_output_stream_get_type, +GO(g_output_stream_flush, iFppp) +//GOM(g_output_stream_flush_async, vFpippp) +GO(g_output_stream_flush_finish, iFppp) +GO(g_output_stream_get_type, LFv) GO(g_output_stream_has_pending, iFp) -//GO(g_output_stream_is_closed, -//GO(g_output_stream_is_closing, -//GO(g_output_stream_printf, +GO(g_output_stream_is_closed, iFp) +GO(g_output_stream_is_closing, iFp) +//GOM(g_output_stream_printf, iFpppppV) GO(g_output_stream_set_pending, iFpp) GO(g_output_stream_splice, lFppupp) -//GO(g_output_stream_splice_async, +//GOM(g_output_stream_splice_async, vFppuippp) GO(g_output_stream_splice_finish, lFppp) -//GO(g_output_stream_splice_flags_get_type, -//GO(g_output_stream_vprintf, +GO(g_output_stream_splice_flags_get_type, LFv) +//GOM(g_output_stream_vprintf, iFpppppA) GO(g_output_stream_write, lFppLpp) GO(g_output_stream_write_all, iFppLppp) -//GO(g_output_stream_write_async, +//GOM(g_output_stream_write_async, vFppLippp) GO(g_output_stream_write_bytes, lFpppp) -//GO(g_output_stream_write_bytes_async, -//GO(g_output_stream_write_bytes_finish, -//GO(g_output_stream_write_finish, -//GO(g_password_save_get_type, -//GO(g_permission_acquire, -//GO(g_permission_acquire_async, -//GO(g_permission_acquire_finish, -//GO(g_permission_get_allowed, -//GO(g_permission_get_can_acquire, +//GOM(g_output_stream_write_bytes_async, vFppippp) +GO(g_output_stream_write_bytes_finish, lFppp) +GO(g_output_stream_write_finish, lFppp) +GO(g_password_save_get_type, LFv) +GO(g_permission_acquire, iFppp) +//GOM(g_permission_acquire_async, vFpppp) +GO(g_permission_acquire_finish, iFppp) +GO(g_permission_get_allowed, iFp) +GO(g_permission_get_can_acquire, iFp) GO(g_permission_get_can_release, iFp) -//GO(g_permission_get_type, +GO(g_permission_get_type, LFv) GO(g_permission_impl_update, vFpiii) GO(g_permission_release, iFppp) -//GO(g_permission_release_async, +//GOM(g_permission_release_async, vFpppp) GO(g_permission_release_finish, iFppp) -//GO(g_pollable_input_stream_can_poll, -//GO(g_pollable_input_stream_create_source, -//GO(g_pollable_input_stream_get_type, +GO(g_pollable_input_stream_can_poll, iFp) +//GOM(g_pollable_input_stream_create_source, pFpp) +GO(g_pollable_input_stream_get_type, LFv) GO(g_pollable_input_stream_is_readable, iFp) GO(g_pollable_input_stream_read_nonblocking, lFppLpp) -//GO(g_pollable_output_stream_can_poll, -//GO(g_pollable_output_stream_create_source, -//GO(g_pollable_output_stream_get_type, +GO(g_pollable_output_stream_can_poll, iFp) +//GOM(g_pollable_output_stream_create_source, pFpp) +GO(g_pollable_output_stream_get_type, LFv) GO(g_pollable_output_stream_is_writable, iFp) GO(g_pollable_output_stream_write_nonblocking, lFppLpp) -//GO(g_pollable_source_new, -//GO(g_pollable_source_new_full, +//GOM(g_pollable_source_new, pFp) +//GOM(g_pollable_source_new_full, pFppp) GO(g_pollable_stream_read, lFppLipp) GO(g_pollable_stream_write, lFppLipp) GO(g_pollable_stream_write_all, iFppLippp) -//GO(g_property_action_get_type, +GO(g_property_action_get_type, LFv) GO(g_property_action_new, pFppp) -//GO(g_proxy_address_enumerator_get_type, -//GO(g_proxy_address_get_destination_hostname, +GO(g_proxy_address_enumerator_get_type, LFv) +GO(g_proxy_address_get_destination_hostname, pFp) GO(g_proxy_address_get_destination_port, WFp) -//GO(g_proxy_address_get_destination_protocol, -//GO(g_proxy_address_get_password, -//GO(g_proxy_address_get_protocol, +GO(g_proxy_address_get_destination_protocol, pFp) +GO(g_proxy_address_get_password, pFp) +GO(g_proxy_address_get_protocol, pFp) GO(g_proxy_address_get_type, LFv) GO(g_proxy_address_get_uri, pFp) -//GO(g_proxy_address_get_username, +GO(g_proxy_address_get_username, pFp) GO(g_proxy_address_new, pFpWppWpp) GO(g_proxy_connect, pFppppp) -//GO(g_proxy_connect_async, +//GOM(g_proxy_connect_async, vFpppppp) GO(g_proxy_connect_finish, pFppp) GO(g_proxy_get_default_for_protocol, pFp) -//GO(g_proxy_get_type, +GO(g_proxy_get_type, LFv) GO(g_proxy_resolver_get_default, pFv) GO(g_proxy_resolver_get_type, LFv) GO(g_proxy_resolver_is_supported, iFp) GO(g_proxy_resolver_lookup, pFpppp) -//GO(g_proxy_resolver_lookup_async, +//GOM(g_proxy_resolver_lookup_async, vFppppp) GO(g_proxy_resolver_lookup_finish, pFppp) GO(g_proxy_supports_hostname, iFp) -//GO(g_remote_action_group_activate_action_full, +GO(g_remote_action_group_activate_action_full, vFpppp) GO(g_remote_action_group_change_action_state_full, vFpppp) -//GO(g_remote_action_group_get_type, -//GO(g_resolver_error_get_type, -//GO(g_resolver_error_quark, -//GO(g_resolver_free_addresses, +GO(g_remote_action_group_get_type, LFv) +GO(g_resolver_error_get_type, LFv) +GO(g_resolver_error_quark, uFv) +GO(g_resolver_free_addresses, vFp) GO(g_resolver_free_targets, vFp) GO(g_resolver_get_default, pFv) GO(g_resolver_get_type, LFv) GO(g_resolver_lookup_by_address, pFpppp) -//GO(g_resolver_lookup_by_address_async, +//GOM(g_resolver_lookup_by_address_async, vFppppp) GO(g_resolver_lookup_by_address_finish, pFppp) GO(g_resolver_lookup_by_name, pFpppp) -//GO(g_resolver_lookup_by_name_async, -//GO(g_resolver_lookup_by_name_finish, +//GOM(g_resolver_lookup_by_name_async, vFppppp) +GO(g_resolver_lookup_by_name_finish, pFppp) GO(g_resolver_lookup_records, pFppupp) -//GO(g_resolver_lookup_records_async, +//GOM(g_resolver_lookup_records_async, vFppuppp) GO(g_resolver_lookup_records_finish, pFppp) GO(g_resolver_lookup_service, pFpppppp) -//GO(g_resolver_lookup_service_async, -//GO(g_resolver_lookup_service_finish, -//GO(g_resolver_record_type_get_type, -//GO(g_resolver_set_default, +//GOM(g_resolver_lookup_service_async, vFppppppp) +GO(g_resolver_lookup_service_finish, pFppp) +GO(g_resolver_record_type_get_type, LFv) +GO(g_resolver_set_default, vFp) GO(g_resource_enumerate_children, pFppup) -//GO(g_resource_error_get_type, -//GO(g_resource_error_quark, -//GO(g_resource_flags_get_type, +GO(g_resource_error_get_type, LFv) +GO(g_resource_error_quark, uFv) +GO(g_resource_flags_get_type, LFv) GO(g_resource_get_info, iFppuppp) -//GO(g_resource_get_type, +GO(g_resource_get_type, LFv) GO(g_resource_load, pFpp) GO(g_resource_lookup_data, pFppup) -//GO(g_resource_lookup_flags_get_type, +GO(g_resource_lookup_flags_get_type, LFv) GO(g_resource_new_from_data, pFpp) GO(g_resource_open_stream, pFppup) GO(g_resource_ref, pFp) @@ -1283,12 +1285,12 @@ GO(g_resources_enumerate_children, pFpup) GO(g_resources_get_info, iFpuppp) GO(g_resources_lookup_data, pFpup) GO(g_resources_open_stream, pFpup) -//GO(g_resources_register, -//GO(g_resources_unregister, -//GO(g_resource_unref, -//GO(g_seekable_can_seek, +GO(g_resources_register, vFp) +GO(g_resources_unregister, vFp) +GO(g_resource_unref, vFp) +GO(g_seekable_can_seek, iFp) GO(g_seekable_can_truncate, iFp) -//GO(g_seekable_get_type, +GO(g_seekable_get_type, LFv) GO(g_seekable_seek, iFplupp) GO(g_seekable_tell, lFp) GO(g_seekable_truncate, iFplpp) @@ -1303,12 +1305,12 @@ GO(g_settings_apply, vFp) //GO(g_settings_backend_path_writable_changed, //GO(g_settings_backend_writable_changed, GO(g_settings_bind, vFppppu) -//GO(g_settings_bind_flags_get_type, -//GO(g_settings_bind_with_mapping, +GO(g_settings_bind_flags_get_type, LFv) +//GOM(g_settings_bind_with_mapping, vFppppupppp) GO(g_settings_bind_writable, vFppppi) GO(g_settings_create_action, pFpp) GO(g_settings_delay, vFp) -//GO(g_settings_get, +//GOM(g_settings_get, vFpppV) GO(g_settings_get_boolean, iFpp) GO(g_settings_get_child, pFpp) GO(g_settings_get_default_value, pFpp) @@ -1317,41 +1319,41 @@ GO(g_settings_get_enum, iFpp) GO(g_settings_get_flags, uFpp) GO(g_settings_get_has_unapplied, iFp) GO(g_settings_get_int, iFpp) -//GO(g_settings_get_mapped, -//GO(g_settings_get_range, +//GOM(g_settings_get_mapped, pFpppp) +GO(g_settings_get_range, pFpp) GO(g_settings_get_string, pFpp) GO(g_settings_get_strv, pFpp) -GO(g_settings_get_type, pFv) +GO(g_settings_get_type, LFv) GO(g_settings_get_uint, uFpp) GO(g_settings_get_user_value, pFpp) GO(g_settings_get_value, pFpp) GO(g_settings_is_writable, iFpp) -//GO(g_settings_list_children, +GO(g_settings_list_children, pFp) GO(g_settings_list_keys, pFp) GO(g_settings_list_relocatable_schemas, pFv) -//GO(g_settings_list_schemas, +GO(g_settings_list_schemas, pFv) GO(g_settings_new, pFp) GO(g_settings_new_full, pFppp) GO(g_settings_new_with_backend, pFpp) GO(g_settings_new_with_backend_and_path, pFppp) GO(g_settings_new_with_path, pFpp) -//GO(g_settings_range_check, +GO(g_settings_range_check, iFppp) GO(g_settings_reset, vFpp) -//GO(g_settings_revert, -//GO(g_settings_schema_get_id, +GO(g_settings_revert, vFp) +GO(g_settings_schema_get_id, pFp) GO(g_settings_schema_get_key, pFpp) GO(g_settings_schema_get_path, pFp) -//GO(g_settings_schema_get_type, +GO(g_settings_schema_get_type, LFv) GO(g_settings_schema_has_key, iFpp) -//GO(g_settings_schema_key_get_default_value, +GO(g_settings_schema_key_get_default_value, pFp) GO(g_settings_schema_key_get_description, pFp) GO(g_settings_schema_key_get_range, pFp) -//GO(g_settings_schema_key_get_summary, -//GO(g_settings_schema_key_get_type, +GO(g_settings_schema_key_get_summary, pFp) +GO(g_settings_schema_key_get_type, LFv) GO(g_settings_schema_key_get_value_type, pFp) GO(g_settings_schema_key_range_check, iFpp) GO(g_settings_schema_key_ref, pFp) -//GO(g_settings_schema_key_unref, +GO(g_settings_schema_key_unref, vFp) GO(g_settings_schema_ref, pFp) GO(g_settings_schema_source_get_default, pFv) GO(g_settings_schema_source_get_type, LFv) @@ -1361,7 +1363,7 @@ GO(g_settings_schema_source_new_from_directory, pFppip) GO(g_settings_schema_source_ref, pFp) GO(g_settings_schema_source_unref, vFp) GO(g_settings_schema_unref, vFp) -//GO(g_settings_set, +//GOM(g_settings_set, iFpppV) GO(g_settings_set_boolean, iFppi) GO(g_settings_set_double, iFppd) GO(g_settings_set_enum, iFppi) @@ -1369,13 +1371,13 @@ GO(g_settings_set_flags, iFppu) GO(g_settings_set_int, iFppi) GO(g_settings_set_string, iFppp) GO(g_settings_set_strv, iFppp) -//GO(g_settings_set_uint, +GO(g_settings_set_uint, iFppu) GO(g_settings_set_value, iFppp) GO(g_settings_sync, vFv) GO(g_settings_unbind, vFpp) GO(g_simple_action_get_type, LFv) -//GO(g_simple_action_group_add_entries, -//GO(g_simple_action_group_get_type, +//GOM(g_simple_action_group_add_entries, vFppip) +GO(g_simple_action_group_get_type, LFv) GO(g_simple_action_group_insert, vFpp) GO(g_simple_action_group_lookup, pFpp) GO(g_simple_action_group_new, pFv) @@ -1383,7 +1385,7 @@ GO(g_simple_action_group_remove, vFpp) GO(g_simple_action_new, pFpp) GO(g_simple_action_new_stateful, pFppp) GO(g_simple_action_set_enabled, vFpi) -//GO(g_simple_action_set_state, +GO(g_simple_action_set_state, vFpp) GOM(g_simple_async_report_error_in_idle, vFEpppuipV) GOM(g_simple_async_report_gerror_in_idle, vFEpppp) GOM(g_simple_async_report_take_gerror_in_idle, vFEpppp) @@ -1402,8 +1404,8 @@ GOM(g_simple_async_result_new_take_error, pFEpppp) GO(g_simple_async_result_propagate_error, iFpp) GOM(g_simple_async_result_run_in_thread, vFEppip) GO(g_simple_async_result_set_check_cancellable, vFpp) -GOM(g_simple_async_result_set_error, vFEppipV) -GOM(g_simple_async_result_set_error_va, vFEppipA) +GOM(g_simple_async_result_set_error, vFEpuipV) +GOM(g_simple_async_result_set_error_va, vFEpuipA) GO(g_simple_async_result_set_from_error, vFpp) GO(g_simple_async_result_set_handle_cancellation, vFpi) GO(g_simple_async_result_set_op_res_gboolean, vFpi) @@ -1418,32 +1420,32 @@ GO(g_simple_proxy_resolver_set_default_proxy, vFpp) GO(g_simple_proxy_resolver_set_ignore_hosts, vFpp) GO(g_simple_proxy_resolver_set_uri_proxy, vFppp) GO(g_socket_accept, pFppp) -//GO(g_socket_address_enumerator_get_type, +GO(g_socket_address_enumerator_get_type, LFv) GO(g_socket_address_enumerator_next, pFppp) -//GO(g_socket_address_enumerator_next_async, +//GOM(g_socket_address_enumerator_next_async, vFpppp) GO(g_socket_address_enumerator_next_finish, pFppp) GO(g_socket_address_get_family, uFp) GO(g_socket_address_get_native_size, lFp) GO(g_socket_address_get_type, LFv) -//GO(g_socket_address_new_from_native, +GO(g_socket_address_new_from_native, pFpL) GO(g_socket_address_to_native, iFppLp) GO(g_socket_bind, iFppip) -//GO(g_socket_check_connect_result, +GO(g_socket_check_connect_result, iFpp) GO(g_socket_client_add_application_proxy, vFpp) GO(g_socket_client_connect, pFpppp) -//GO(g_socket_client_connect_async, -//GO(g_socket_client_connect_finish, -//GO(g_socket_client_connect_to_host, -//GO(g_socket_client_connect_to_host_async, -//GO(g_socket_client_connect_to_host_finish, +//GOM(g_socket_client_connect_async, vFppppp) +GO(g_socket_client_connect_finish, pFppp) +GO(g_socket_client_connect_to_host, pFppWpp) +//GOM(g_socket_client_connect_to_host_async, vFppWppp) +GO(g_socket_client_connect_to_host_finish, pFppp) GO(g_socket_client_connect_to_service, pFppppp) -//GO(g_socket_client_connect_to_service_async, -//GO(g_socket_client_connect_to_service_finish, +//GOM(g_socket_client_connect_to_service_async, vFpppppp) +GO(g_socket_client_connect_to_service_finish, pFppp) GO(g_socket_client_connect_to_uri, pFppWpp) -//GO(g_socket_client_connect_to_uri_async, +//GOM(g_socket_client_connect_to_uri_async, vFppWppp) GO(g_socket_client_connect_to_uri_finish, pFppp) -//GO(g_socket_client_event_get_type, -//GO(g_socket_client_get_enable_proxy, +GO(g_socket_client_event_get_type, LFv) +GO(g_socket_client_get_enable_proxy, iFp) GO(g_socket_client_get_family, uFp) GO(g_socket_client_get_local_address, pFp) GO(g_socket_client_get_protocol, iFp) @@ -1454,7 +1456,7 @@ GO(g_socket_client_get_tls, iFp) GO(g_socket_client_get_tls_validation_flags, uFp) GO(g_socket_client_get_type, LFv) GO(g_socket_client_new, pFv) -//GO(g_socket_client_set_enable_proxy, +GO(g_socket_client_set_enable_proxy, vFpi) GO(g_socket_client_set_family, vFpu) GO(g_socket_client_set_local_address, vFpp) GO(g_socket_client_set_protocol, vFpi) @@ -1468,69 +1470,69 @@ GO(g_socket_condition_check, uFpu) GO(g_socket_condition_timed_wait, iFpulpp) GO(g_socket_condition_wait, iFpupp) GO(g_socket_connect, iFpppp) -//GO(g_socket_connectable_enumerate, -//GO(g_socket_connectable_get_type, +GO(g_socket_connectable_enumerate, pFp) +GO(g_socket_connectable_get_type, LFv) GO(g_socket_connectable_proxy_enumerate, pFp) GO(g_socket_connection_connect, iFpppp) -//GO(g_socket_connection_connect_async, +//GOM(g_socket_connection_connect_async, vFppppp) GO(g_socket_connection_connect_finish, iFppp) GO(g_socket_connection_factory_create_connection, pFp) GO(g_socket_connection_factory_lookup_type, LFuui) GO(g_socket_connection_factory_register_type, vFLuui) -//GO(g_socket_connection_get_local_address, +GO(g_socket_connection_get_local_address, pFpp) GO(g_socket_connection_get_remote_address, pFpp) GO(g_socket_connection_get_socket, pFp) -//GO(g_socket_connection_get_type, +GO(g_socket_connection_get_type, LFv) GO(g_socket_connection_is_connected, iFp) GO(g_socket_control_message_deserialize, pFiiLp) -//GO(g_socket_control_message_get_level, +GO(g_socket_control_message_get_level, iFp) GO(g_socket_control_message_get_msg_type, iFp) GO(g_socket_control_message_get_size, LFp) -//GO(g_socket_control_message_get_type, +GO(g_socket_control_message_get_type, LFv) GO(g_socket_control_message_serialize, vFpp) -//GO(g_socket_create_source, +//GOM(g_socket_create_source, pFpup) GO(g_socket_family_get_type, LFv) GO(g_socket_get_available_bytes, lFp) -//GO(g_socket_get_blocking, -//GO(g_socket_get_broadcast, +GO(g_socket_get_blocking, iFp) +GO(g_socket_get_broadcast, iFp) GO(g_socket_get_credentials, pFpp) GO(g_socket_get_family, uFp) GO(g_socket_get_fd, iFp) -//GO(g_socket_get_keepalive, +GO(g_socket_get_keepalive, iFp) GO(g_socket_get_listen_backlog, iFp) -//GO(g_socket_get_local_address, -//GO(g_socket_get_multicast_loopback, +GO(g_socket_get_local_address, pFpp) +GO(g_socket_get_multicast_loopback, iFp) GO(g_socket_get_multicast_ttl, uFp) GO(g_socket_get_option, iFpiipp) GO(g_socket_get_protocol, iFp) GO(g_socket_get_remote_address, pFpp) GO(g_socket_get_socket_type, uFp) -//GO(g_socket_get_timeout, -//GO(g_socket_get_ttl, +GO(g_socket_get_timeout, uFp) +GO(g_socket_get_ttl, uFp) GO(g_socket_get_type, LFv) -//GO(g_socket_is_closed, -//GO(g_socket_is_connected, -//GO(g_socket_join_multicast_group, +GO(g_socket_is_closed, iFp) +GO(g_socket_is_connected, iFp) +GO(g_socket_join_multicast_group, iFppipp) GO(g_socket_leave_multicast_group, iFppipp) -//GO(g_socket_listen, +GO(g_socket_listen, iFpp) GO(g_socket_listener_accept, pFpppp) -//GO(g_socket_listener_accept_async, +//GOM(g_socket_listener_accept_async, vFpppp) GO(g_socket_listener_accept_finish, pFpppp) GO(g_socket_listener_accept_socket, pFpppp) -//GO(g_socket_listener_accept_socket_async, +//GOM(g_socket_listener_accept_socket_async, vFpppp) GO(g_socket_listener_accept_socket_finish, pFpppp) GO(g_socket_listener_add_address, iFppuippp) GO(g_socket_listener_add_any_inet_port, WFppp) GO(g_socket_listener_add_inet_port, iFpWpp) GO(g_socket_listener_add_socket, iFpppp) -//GO(g_socket_listener_close, -//GO(g_socket_listener_get_type, +GO(g_socket_listener_close, vFp) +GO(g_socket_listener_get_type, LFv) GO(g_socket_listener_new, pFv) GO(g_socket_listener_set_backlog, vFpi) -//GO(g_socket_msg_flags_get_type, +GO(g_socket_msg_flags_get_type, LFv) GO(g_socket_new, pFuuip) GO(g_socket_new_from_fd, pFip) -//GO(g_socket_protocol_get_type, +GO(g_socket_protocol_get_type, LFv) GO(g_socket_receive, lFppLpp) GO(g_socket_receive_from, lFpppLpp) GO(g_socket_receive_message, lFpppippppp) @@ -1542,26 +1544,26 @@ GO(g_socket_send_with_blocking, lFppLipp) GO(g_socket_service_get_type, LFv) GO(g_socket_service_is_active, iFp) GO(g_socket_service_new, pFv) -//GO(g_socket_service_start, -//GO(g_socket_service_stop, -//GO(g_socket_set_blocking, -//GO(g_socket_set_broadcast, -//GO(g_socket_set_keepalive, +GO(g_socket_service_start, vFp) +GO(g_socket_service_stop, vFp) +GO(g_socket_set_blocking, vFpi) +GO(g_socket_set_broadcast, vFpi) +GO(g_socket_set_keepalive, vFpi) GO(g_socket_set_listen_backlog, vFpi) GO(g_socket_set_multicast_loopback, vFpi) GO(g_socket_set_multicast_ttl, vFpu) GO(g_socket_set_option, iFpiiip) -//GO(g_socket_set_timeout, -//GO(g_socket_set_ttl, +GO(g_socket_set_timeout, vFpu) +GO(g_socket_set_ttl, vFpu) GO(g_socket_shutdown, iFpiip) GO(g_socket_speaks_ipv4, iFp) -//GO(g_socket_type_get_type, +GO(g_socket_type_get_type, LFv) GO(g_srv_target_copy, pFp) GO(g_srv_target_free, vFp) GO(g_srv_target_get_hostname, pFp) -//GO(g_srv_target_get_port, -//GO(g_srv_target_get_priority, -//GO(g_srv_target_get_type, +GO(g_srv_target_get_port, WFp) +GO(g_srv_target_get_priority, WFp) +GO(g_srv_target_get_type, LFv) GO(g_srv_target_get_weight, WFp) GO(g_srv_target_list_sort, pFp) GO(g_srv_target_new, pFpWWW) @@ -1569,98 +1571,100 @@ GO(g_static_resource_fini, vFp) GO(g_static_resource_get_resource, pFp) GO(g_static_resource_init, vFp) GO(g_subprocess_communicate, iFpppppp) -//GO(g_subprocess_communicate_async, +//GOM(g_subprocess_communicate_async, vFppppp) GO(g_subprocess_communicate_finish, iFppppp) GO(g_subprocess_communicate_utf8, iFpppppp) -//GO(g_subprocess_communicate_utf8_async, +//GOM(g_subprocess_communicate_utf8_async, vFppppp) GO(g_subprocess_communicate_utf8_finish, iFppppp) -//GO(g_subprocess_flags_get_type, -//GO(g_subprocess_force_exit, -//GO(g_subprocess_get_exit_status, +GO(g_subprocess_flags_get_type, LFv) +GO(g_subprocess_force_exit, vFp) +GO(g_subprocess_get_exit_status, iFp) GO(g_subprocess_get_identifier, pFp) -//GO(g_subprocess_get_if_exited, +GO(g_subprocess_get_if_exited, iFp) GO(g_subprocess_get_if_signaled, iFp) -//GO(g_subprocess_get_status, +GO(g_subprocess_get_status, iFp) GO(g_subprocess_get_stderr_pipe, pFp) GO(g_subprocess_get_stdin_pipe, pFp) -//GO(g_subprocess_get_stdout_pipe, -//GO(g_subprocess_get_successful, +GO(g_subprocess_get_stdout_pipe, pFp) +GO(g_subprocess_get_successful, iFp) GO(g_subprocess_get_term_sig, iFp) -//GO(g_subprocess_get_type, +GO(g_subprocess_get_type, LFv) GO(g_subprocess_launcher_getenv, pFpp) -//GO(g_subprocess_launcher_get_type, +GO(g_subprocess_launcher_get_type, LFv) GO(g_subprocess_launcher_new, pFu) -//GO(g_subprocess_launcher_set_child_setup, -//GO(g_subprocess_launcher_set_cwd, +//GOM(g_subprocess_launcher_set_child_setup, vFpppp) +GO(g_subprocess_launcher_set_cwd, vFpp) GO(g_subprocess_launcher_setenv, vFpppi) GO(g_subprocess_launcher_set_environ, vFpp) GO(g_subprocess_launcher_set_flags, vFpu) GO(g_subprocess_launcher_set_stderr_file_path, vFpp) -//GO(g_subprocess_launcher_set_stdin_file_path, -//GO(g_subprocess_launcher_set_stdout_file_path, -//GO(g_subprocess_launcher_spawn, +GO(g_subprocess_launcher_set_stdin_file_path, vFpp) +GO(g_subprocess_launcher_set_stdout_file_path, vFpp) +//GOM(g_subprocess_launcher_spawn, pFpppV) GO(g_subprocess_launcher_spawnv, pFppp) GO(g_subprocess_launcher_take_fd, vFpii) GO(g_subprocess_launcher_take_stderr_fd, vFpi) -//GO(g_subprocess_launcher_take_stdin_fd, -//GO(g_subprocess_launcher_take_stdout_fd, -//GO(g_subprocess_launcher_unsetenv, -//GO(g_subprocess_new, +GO(g_subprocess_launcher_take_stdin_fd, vFpi) +GO(g_subprocess_launcher_take_stdout_fd, vFpi) +GO(g_subprocess_launcher_unsetenv, vFpp) +//GOM(g_subprocess_new, pFuppV) GO(g_subprocess_newv, pFpup) GO(g_subprocess_send_signal, vFpi) -//GO(g_subprocess_wait, -//GO(g_subprocess_wait_async, +GO(g_subprocess_wait, iFppp) +//GOM(g_subprocess_wait_async, vFpppp) GO(g_subprocess_wait_check, iFppp) -//GO(g_subprocess_wait_check_async, +//GOM(g_subprocess_wait_check_async, vFpppp) GO(g_subprocess_wait_check_finish, iFppp) -//GO(g_subprocess_wait_finish, -//GO(g_task_attach_source, +GO(g_subprocess_wait_finish, iFppp) +//GOM(g_task_attach_source, vFppp) GO(g_task_get_cancellable, pFp) -//GO(g_task_get_check_cancellable, +GO(g_task_get_check_cancellable, iFp) GO(g_task_get_context, pFp) +GO(g_task_get_name, pFp) GO(g_task_get_priority, iFp) -//GO(g_task_get_return_on_cancel, -//GO(g_task_get_source_object, +GO(g_task_get_return_on_cancel, iFp) +GO(g_task_get_source_object, pFp) GO(g_task_get_source_tag, pFp) -//GO(g_task_get_task_data, +GO(g_task_get_task_data, pFp) GO(g_task_get_type, LFv) -//GO(g_task_had_error, +GO(g_task_had_error, iFp) GO(g_task_is_valid, iFpp) GOM(g_task_new, pFEpppp) GO(g_task_propagate_boolean, iFpp) GO(g_task_propagate_int, lFpp) GO(g_task_propagate_pointer, pFpp) -//GO(g_task_report_error, -//GO(g_task_report_new_error, +//GOM(g_task_report_error, vFppppp) +//GOM(g_task_report_new_error, vFppppuipV) GO(g_task_return_boolean, vFpi) GO(g_task_return_error, vFpp) -//GO(g_task_return_error_if_cancelled, +GO(g_task_return_error_if_cancelled, iFp) GO(g_task_return_int, vFpl) GOM(g_task_return_new_error, vFEpuipV) GOM(g_task_return_pointer, vFEppp) -//GO(g_task_run_in_thread, -//GO(g_task_run_in_thread_sync, -//GO(g_task_set_check_cancellable, +GOM(g_task_run_in_thread, vFEpp) +GOM(g_task_run_in_thread_sync, vFEpp) +GO(g_task_set_check_cancellable, vFpi) +GO(g_task_set_name, vFpp) GO(g_task_set_priority, vFpi) GO(g_task_set_return_on_cancel, iFpi) GO(g_task_set_source_tag, vFpp) -//GO(g_task_set_task_data, +GOM(g_task_set_task_data, vFEppp) GO(g_tcp_connection_get_graceful_disconnect, iFp) -//GO(g_tcp_connection_get_type, +GO(g_tcp_connection_get_type, LFv) GO(g_tcp_connection_set_graceful_disconnect, vFpi) GO(g_tcp_wrapper_connection_get_base_io_stream, pFp) -//GO(g_tcp_wrapper_connection_get_type, +GO(g_tcp_wrapper_connection_get_type, LFv) GO(g_tcp_wrapper_connection_new, pFpp) GO(g_test_dbus_add_service_dir, vFpp) -//GO(g_test_dbus_down, -//GO(g_test_dbus_flags_get_type, +GO(g_test_dbus_down, vFp) +GO(g_test_dbus_flags_get_type, LFv) GO(g_test_dbus_get_bus_address, pFp) GO(g_test_dbus_get_flags, uFp) -//GO(g_test_dbus_get_type, +GO(g_test_dbus_get_type, LFv) GO(g_test_dbus_new, pFu) -//GO(g_test_dbus_stop, +GO(g_test_dbus_stop, vFp) GO(g_test_dbus_unset, vFv) -//GO(g_test_dbus_up, +GO(g_test_dbus_up, vFp) GO(g_themed_icon_append_name, vFpp) GO(g_themed_icon_get_names, pFp) GO(g_themed_icon_get_type, LFv) @@ -1669,30 +1673,30 @@ GO(g_themed_icon_new_from_names, pFpi) GO(g_themed_icon_new_with_default_fallbacks, pFp) GO(g_themed_icon_prepend_name, vFpp) //GO(g_threaded_resolver_get_type, -//GO(g_threaded_socket_service_get_type, +GO(g_threaded_socket_service_get_type, LFv) GO(g_threaded_socket_service_new, pFi) -//GO(g_tls_authentication_mode_get_type, -//GO(g_tls_backend_get_certificate_type, -//GO(g_tls_backend_get_client_connection_type, +GO(g_tls_authentication_mode_get_type, LFv) +GO(g_tls_backend_get_certificate_type, LFp) +GO(g_tls_backend_get_client_connection_type, LFp) GO(g_tls_backend_get_default, pFv) GO(g_tls_backend_get_default_database, pFp) -//GO(g_tls_backend_get_file_database_type, -//GO(g_tls_backend_get_server_connection_type, -//GO(g_tls_backend_get_type, -//GO(g_tls_backend_supports_tls, -//GO(g_tls_certificate_flags_get_type, +GO(g_tls_backend_get_file_database_type, LFp) +GO(g_tls_backend_get_server_connection_type, LFp) +GO(g_tls_backend_get_type, LFv) +GO(g_tls_backend_supports_tls, iFp) +GO(g_tls_certificate_flags_get_type, LFv) GO(g_tls_certificate_get_issuer, pFp) GO(g_tls_certificate_get_type, LFv) GO(g_tls_certificate_is_same, iFpp) GO(g_tls_certificate_list_new_from_file, pFpp) GO(g_tls_certificate_new_from_file, pFpp) -//GO(g_tls_certificate_new_from_files, +GO(g_tls_certificate_new_from_files, pFppp) GO(g_tls_certificate_new_from_pem, pFplp) -//GO(g_tls_certificate_request_flags_get_type, +GO(g_tls_certificate_request_flags_get_type, LFv) GO(g_tls_certificate_verify, uFppp) GO(g_tls_client_connection_get_accepted_cas, pFp) GO(g_tls_client_connection_get_server_identity, pFp) -//GO(g_tls_client_connection_get_type, +GO(g_tls_client_connection_get_type, LFv) GO(g_tls_client_connection_get_use_ssl3, iFp) GO(g_tls_client_connection_get_validation_flags, uFp) GO(g_tls_client_connection_new, pFppp) @@ -1700,7 +1704,7 @@ GO(g_tls_client_connection_set_server_identity, vFpp) GO(g_tls_client_connection_set_use_ssl3, vFpi) GO(g_tls_client_connection_set_validation_flags, vFpu) GO(g_tls_connection_emit_accept_certificate, iFppu) -//GO(g_tls_connection_get_certificate, +GO(g_tls_connection_get_certificate, pFp) GO(g_tls_connection_get_database, pFp) GO(g_tls_connection_get_interaction, pFp) GO(g_tls_connection_get_peer_certificate, pFp) @@ -1708,76 +1712,76 @@ GO(g_tls_connection_get_peer_certificate_errors, uFp) GO(g_tls_connection_get_rehandshake_mode, uFp) GO(g_tls_connection_get_require_close_notify, iFp) GO(g_tls_connection_get_type, LFv) -//GO(g_tls_connection_get_use_system_certdb, +GO(g_tls_connection_get_use_system_certdb, iFp) GO(g_tls_connection_handshake, iFppp) -//GO(g_tls_connection_handshake_async, +//GOM(g_tls_connection_handshake_async, vFpippp) GO(g_tls_connection_handshake_finish, iFppp) GO(g_tls_connection_set_certificate, vFpp) GO(g_tls_connection_set_database, vFpp) GO(g_tls_connection_set_interaction, vFpp) GO(g_tls_connection_set_rehandshake_mode, vFpu) GO(g_tls_connection_set_require_close_notify, vFpi) -//GO(g_tls_connection_set_use_system_certdb, +GO(g_tls_connection_set_use_system_certdb, vFpi) GO(g_tls_database_create_certificate_handle, pFpp) GO(g_tls_database_get_type, LFv) GO(g_tls_database_lookup_certificate_for_handle, pFpppupp) -//GO(g_tls_database_lookup_certificate_for_handle_async, -//GO(g_tls_database_lookup_certificate_for_handle_finish, +//GOM(g_tls_database_lookup_certificate_for_handle_async, vFpppuppp) +GO(g_tls_database_lookup_certificate_for_handle_finish, pFppp) GO(g_tls_database_lookup_certificate_issuer, pFpppupp) -//GO(g_tls_database_lookup_certificate_issuer_async, +//GOM(g_tls_database_lookup_certificate_issuer_async, vFpppuppp) GO(g_tls_database_lookup_certificate_issuer_finish, pFppp) GO(g_tls_database_lookup_certificates_issued_by, pFpppupp) -//GO(g_tls_database_lookup_certificates_issued_by_async, +//GOM(g_tls_database_lookup_certificates_issued_by_async, vFpppuppp) GO(g_tls_database_lookup_certificates_issued_by_finish, pFppp) -//GO(g_tls_database_lookup_flags_get_type, +GO(g_tls_database_lookup_flags_get_type, LFv) GO(g_tls_database_verify_chain, uFpppppupp) -//GO(g_tls_database_verify_chain_async, +//GOM(g_tls_database_verify_chain_async, vFpppppuppp) GO(g_tls_database_verify_chain_finish, uFppp) -//GO(g_tls_database_verify_flags_get_type, -//GO(g_tls_error_get_type, -//GO(g_tls_error_quark, -//GO(g_tls_file_database_get_type, +GO(g_tls_database_verify_flags_get_type, LFv) +GO(g_tls_error_get_type, LFv) +GO(g_tls_error_quark, uFv) +GO(g_tls_file_database_get_type, LFv) GO(g_tls_file_database_new, pFpp) GO(g_tls_interaction_ask_password, uFpppp) -//GO(g_tls_interaction_ask_password_async, -//GO(g_tls_interaction_ask_password_finish, +//GOM(g_tls_interaction_ask_password_async, vFppppp) +GO(g_tls_interaction_ask_password_finish, uFppp) GO(g_tls_interaction_get_type, LFv) -//GO(g_tls_interaction_invoke_ask_password, -//GO(g_tls_interaction_invoke_request_certificate, +GO(g_tls_interaction_invoke_ask_password, uFpppp) +GO(g_tls_interaction_invoke_request_certificate, uFppupp) GO(g_tls_interaction_request_certificate, uFppupp) -//GO(g_tls_interaction_request_certificate_async, +//GOM(g_tls_interaction_request_certificate_async, vFppuppp) GO(g_tls_interaction_request_certificate_finish, uFppp) -//GO(g_tls_interaction_result_get_type, -//GO(g_tls_password_flags_get_type, -//GO(g_tls_password_get_description, +GO(g_tls_interaction_result_get_type, LFv) +GO(g_tls_password_flags_get_type, LFv) +GO(g_tls_password_get_description, pFp) GO(g_tls_password_get_flags, uFp) -//GO(g_tls_password_get_type, +GO(g_tls_password_get_type, LFv) GO(g_tls_password_get_value, pFpp) GO(g_tls_password_get_warning, pFp) GO(g_tls_password_new, pFup) -//GO(g_tls_password_set_description, +GO(g_tls_password_set_description, vFpp) GO(g_tls_password_set_flags, vFpu) GO(g_tls_password_set_value, vFppl) -//GO(g_tls_password_set_value_full, +//GOM(g_tls_password_set_value_full, vFpplp) GO(g_tls_password_set_warning, vFpp) -//GO(g_tls_rehandshake_mode_get_type, -//GO(g_tls_server_connection_get_type, +GO(g_tls_rehandshake_mode_get_type, LFv) +GO(g_tls_server_connection_get_type, LFv) GO(g_tls_server_connection_new, pFppp) -//GO(g_unix_connection_get_type, +GO(g_unix_connection_get_type, LFv) GO(g_unix_connection_receive_credentials, pFppp) -//GO(g_unix_connection_receive_credentials_async, +//GOM(g_unix_connection_receive_credentials_async, vFpppp) GO(g_unix_connection_receive_credentials_finish, pFppp) GO(g_unix_connection_receive_fd, iFppp) GO(g_unix_connection_send_credentials, iFppp) -//GO(g_unix_connection_send_credentials_async, +//GOM(g_unix_connection_send_credentials_async, vFpppp) GO(g_unix_connection_send_credentials_finish, iFppp) GO(g_unix_connection_send_fd, iFpipp) GO(g_unix_credentials_message_get_credentials, pFp) -//GO(g_unix_credentials_message_get_type, -//GO(g_unix_credentials_message_is_supported, +GO(g_unix_credentials_message_get_type, LFv) +GO(g_unix_credentials_message_is_supported, iFv) GO(g_unix_credentials_message_new, pFv) GO(g_unix_credentials_message_new_with_credentials, pFp) -//GO(g_unix_fd_list_append, +GO(g_unix_fd_list_append, iFpip) GO(g_unix_fd_list_get, iFpip) GO(g_unix_fd_list_get_length, iFp) GO(g_unix_fd_list_get_type, LFv) @@ -1785,105 +1789,105 @@ GO(g_unix_fd_list_new, pFv) GO(g_unix_fd_list_new_from_array, pFpi) GO(g_unix_fd_list_peek_fds, pFpp) GO(g_unix_fd_list_steal_fds, pFpp) -//GO(g_unix_fd_message_append_fd, -//GO(g_unix_fd_message_get_fd_list, -//GO(g_unix_fd_message_get_type, -//GO(g_unix_fd_message_new, -//GO(g_unix_fd_message_new_with_fd_list, -//GO(g_unix_fd_message_steal_fds, -//GO(g_unix_input_stream_get_close_fd, -//GO(g_unix_input_stream_get_fd, -//GO(g_unix_input_stream_get_type, -//GO(g_unix_input_stream_new, -//GO(g_unix_input_stream_set_close_fd, -//GO(g_unix_is_mount_path_system_internal, -//GO(g_unix_mount_at, -//GO(g_unix_mount_compare, -//GO(g_unix_mount_free, -//GO(g_unix_mount_get_device_path, -//GO(g_unix_mount_get_fs_type, -//GO(g_unix_mount_get_mount_path, -//GO(g_unix_mount_guess_can_eject, -//GO(g_unix_mount_guess_icon, -//GO(g_unix_mount_guess_name, -//GO(g_unix_mount_guess_should_display, -//GO(g_unix_mount_guess_symbolic_icon, -//GO(g_unix_mount_is_readonly, -//GO(g_unix_mount_is_system_internal, -//GO(g_unix_mount_monitor_get_type, -//GO(g_unix_mount_monitor_new, -//GO(g_unix_mount_monitor_set_rate_limit, -//GO(g_unix_mount_point_compare, -//GO(g_unix_mount_point_free, -//GO(g_unix_mount_point_get_device_path, -//GO(g_unix_mount_point_get_fs_type, -//GO(g_unix_mount_point_get_mount_path, -//GO(g_unix_mount_point_get_options, -//GO(g_unix_mount_point_guess_can_eject, -//GO(g_unix_mount_point_guess_icon, -//GO(g_unix_mount_point_guess_name, -//GO(g_unix_mount_point_guess_symbolic_icon, -//GO(g_unix_mount_point_is_loopback, -//GO(g_unix_mount_point_is_readonly, -//GO(g_unix_mount_point_is_user_mountable, -//GO(g_unix_mount_points_changed_since, -//GO(g_unix_mount_points_get, -//GO(g_unix_mounts_changed_since, -//GO(g_unix_mounts_get, -//GO(g_unix_output_stream_get_close_fd, -//GO(g_unix_output_stream_get_fd, -//GO(g_unix_output_stream_get_type, -//GO(g_unix_output_stream_new, -//GO(g_unix_output_stream_set_close_fd, +GO(g_unix_fd_message_append_fd, iFpip) +GO(g_unix_fd_message_get_fd_list, pFp) +GO(g_unix_fd_message_get_type, LFv) +GO(g_unix_fd_message_new, pFv) +GO(g_unix_fd_message_new_with_fd_list, pFp) +GO(g_unix_fd_message_steal_fds, pFpp) +GO(g_unix_input_stream_get_close_fd, iFp) +GO(g_unix_input_stream_get_fd, iFp) +GO(g_unix_input_stream_get_type, LFv) +GO(g_unix_input_stream_new, pFii) +GO(g_unix_input_stream_set_close_fd, vFpi) +GO(g_unix_is_mount_path_system_internal, iFp) +GO(g_unix_mount_at, pFpp) +GO(g_unix_mount_compare, iFpp) +GO(g_unix_mount_free, vFp) +GO(g_unix_mount_get_device_path, pFp) +GO(g_unix_mount_get_fs_type, pFp) +GO(g_unix_mount_get_mount_path, pFp) +GO(g_unix_mount_guess_can_eject, iFp) +GO(g_unix_mount_guess_icon, pFp) +GO(g_unix_mount_guess_name, pFp) +GO(g_unix_mount_guess_should_display, iFp) +GO(g_unix_mount_guess_symbolic_icon, pFp) +GO(g_unix_mount_is_readonly, iFp) +GO(g_unix_mount_is_system_internal, iFp) +GO(g_unix_mount_monitor_get_type, LFv) +GO(g_unix_mount_monitor_new, pFv) +GO(g_unix_mount_monitor_set_rate_limit, vFpi) +GO(g_unix_mount_point_compare, iFpp) +GO(g_unix_mount_point_free, vFp) +GO(g_unix_mount_point_get_device_path, pFp) +GO(g_unix_mount_point_get_fs_type, pFp) +GO(g_unix_mount_point_get_mount_path, pFp) +GO(g_unix_mount_point_get_options, pFp) +GO(g_unix_mount_point_guess_can_eject, iFp) +GO(g_unix_mount_point_guess_icon, pFp) +GO(g_unix_mount_point_guess_name, pFp) +GO(g_unix_mount_point_guess_symbolic_icon, pFp) +GO(g_unix_mount_point_is_loopback, iFp) +GO(g_unix_mount_point_is_readonly, iFp) +GO(g_unix_mount_point_is_user_mountable, iFp) +GO(g_unix_mount_points_changed_since, iFL) +GO(g_unix_mount_points_get, pFp) +GO(g_unix_mounts_changed_since, iFL) +GO(g_unix_mounts_get, pFp) +GO(g_unix_output_stream_get_close_fd, iFp) +GO(g_unix_output_stream_get_fd, iFp) +GO(g_unix_output_stream_get_type, LFv) +GO(g_unix_output_stream_new, pFii) +GO(g_unix_output_stream_set_close_fd, vFpi) GO(g_unix_socket_address_abstract_names_supported, iFv) GO(g_unix_socket_address_get_address_type, uFp) GO(g_unix_socket_address_get_is_abstract, iFp) GO(g_unix_socket_address_get_path, pFp) GO(g_unix_socket_address_get_path_len, LFp) -//GO(g_unix_socket_address_get_type, +GO(g_unix_socket_address_get_type, LFv) GO(g_unix_socket_address_new, pFp) GO(g_unix_socket_address_new_abstract, pFpi) GO(g_unix_socket_address_new_with_type, pFpiu) -//GO(g_unix_socket_address_type_get_type, -//GO(g_vfs_get_default, -//GO(g_vfs_get_file_for_path, -//GO(g_vfs_get_file_for_uri, +GO(g_unix_socket_address_type_get_type, LFv) +GO(g_vfs_get_default, pFv) +GO(g_vfs_get_file_for_path, pFpp) +GO(g_vfs_get_file_for_uri, pFpp) GO(g_vfs_get_local, pFv) GO(g_vfs_get_supported_uri_schemes, pFp) -//GO(g_vfs_get_type, +GO(g_vfs_get_type, LFv) GO(g_vfs_is_active, iFp) GO(g_vfs_parse_name, pFpp) -//GO(g_volume_can_eject, -//GO(g_volume_can_mount, -//GO(g_volume_eject, -//GO(g_volume_eject_finish, -//GO(g_volume_eject_with_operation, +GO(g_volume_can_eject, iFp) +GO(g_volume_can_mount, iFp) +//GOM(g_volume_eject, vFpuppp) +GO(g_volume_eject_finish, iFppp) +//GOM(g_volume_eject_with_operation, vFpupppp) GO(g_volume_eject_with_operation_finish, iFppp) GO(g_volume_enumerate_identifiers, pFp) GO(g_volume_get_activation_root, pFp) GO(g_volume_get_drive, pFp) -//GO(g_volume_get_icon, +GO(g_volume_get_icon, pFp) GO(g_volume_get_identifier, pFpp) GO(g_volume_get_mount, pFp) -//GO(g_volume_get_name, +GO(g_volume_get_name, pFp) GO(g_volume_get_sort_key, pFp) GO(g_volume_get_symbolic_icon, pFp) -//GO(g_volume_get_type, +GO(g_volume_get_type, LFv) GO(g_volume_get_uuid, pFp) GO(g_volume_monitor_adopt_orphan_mount, pFp) GO(g_volume_monitor_get, pFv) -//GO(g_volume_monitor_get_connected_drives, +GO(g_volume_monitor_get_connected_drives, pFp) GO(g_volume_monitor_get_mount_for_uuid, pFpp) GO(g_volume_monitor_get_mounts, pFp) -//GO(g_volume_monitor_get_type, +GO(g_volume_monitor_get_type, LFv) GO(g_volume_monitor_get_volume_for_uuid, pFpp) -//GO(g_volume_monitor_get_volumes, -//GO(g_volume_mount, -//GO(g_volume_mount_finish, +GO(g_volume_monitor_get_volumes, pFp) +//GOM(g_volume_mount, vFpupppp) +GO(g_volume_mount_finish, iFppp) GO(g_volume_should_automount, iFp) -//GO(g_zlib_compressor_format_get_type, +GO(g_zlib_compressor_format_get_type, LFv) GO(g_zlib_compressor_get_file_info, pFp) -//GO(g_zlib_compressor_get_type, +GO(g_zlib_compressor_get_type, LFv) GO(g_zlib_compressor_new, pFui) GO(g_zlib_compressor_set_file_info, vFpp) GO(g_zlib_decompressor_get_file_info, pFp) diff --git a/src/wrapped/wrappedglesv2.c b/src/wrapped/wrappedglesv2.c index 63b2235..60953a5 100644 --- a/src/wrapped/wrappedglesv2.c +++ b/src/wrapped/wrappedglesv2.c @@ -12,11 +12,8 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* glesv2Name = "libGLESv2.so"; -#else - const char* glesv2Name = "libGLESv2.so.2"; -#endif +const char* glesv2Name = "libGLESv2.so.2"; +#define ALTNAME "libGLESv2.so" #define LIBNAME glesv2 diff --git a/src/wrapped/wrappedglib2.c b/src/wrapped/wrappedglib2.c index 0372e84..ffc86a4 100644 --- a/src/wrapped/wrappedglib2.c +++ b/src/wrapped/wrappedglib2.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "wrappedlibs.h" @@ -20,54 +21,33 @@ #include "gtkclass.h" #include "threads.h" -#ifdef ANDROID - const char* glib2Name = "libglib-2.0.so"; -#else - const char* glib2Name = "libglib-2.0.so.0"; -#endif +const char* glib2Name = "libglib-2.0.so.0"; +#define ALTNAME "libglib-2.0.so" + #define LIBNAME glib2 typedef void (*vFppip_t)(void*, void*, int, void*); +#ifdef HAVE_LD80LIBS +#define ADDED_FUNCTIONS_2() +#else +typedef void (*vFppippDpDC_t)(void*, void*, int32_t, void*, void*, double, void*, double, uint8_t); +#define ADDED_FUNCTIONS_2() \ + GO(g_assertion_message_cmpnum, vFppippDpDC_t) +#endif + #define ADDED_FUNCTIONS() \ GO(g_build_filenamev, pFp_t) \ GO(g_variant_get_va, vFpppp_t) \ GO(g_build_pathv, pFpp_t) \ GO(g_set_error_literal, vFppip_t) \ GO(g_variant_builder_add_value, vFpp_t) \ + ADDED_FUNCTIONS_2() #include "wrappedglib2types.h" #include "wrappercallback.h" -EXPORT void* my_g_markup_vprintf_escaped(x64emu_t *emu, void* fmt, void* b) { - // need to align on arm - myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 1); - PREPARE_VALIST; - return my->g_markup_vprintf_escaped(fmt, VARARGS); -} - -EXPORT void* my_g_build_filename(x64emu_t* emu, void* first, uintptr_t* b) -{ - int n = 0; - while (getVArgs(emu, 1, b, n++)); - void* array[n+1]; // +1 for 1st (NULL terminal already included) - array[0] = first; - for(int i=0; ig_build_filenamev(array); - return ret; -} - -static int my_timeout_cb(my_signal_t* sig) -{ - return (int)RunFunctionFmt(sig->c_handler, "p", sig->data); -} -EXPORT uint32_t my_g_timeout_add(x64emu_t* emu, uint32_t interval, void* func, void* data) -{ - my_signal_t *sig = new_mysignal(func, data, NULL); - return my->g_timeout_add_full(0, interval, my_timeout_cb, sig, my_signal_delete); -} typedef int (*GSourceFunc) (void* user_data); typedef struct my_GSourceFuncs_s { @@ -90,14 +70,19 @@ GO(6) \ GO(7) \ GO(8) \ GO(9) \ +GO(10) \ +GO(11) \ +GO(12) \ +GO(13) \ +GO(14) \ // GCopyFct -#define GO(A) \ -static uintptr_t my_copy_fct_##A = 0; \ -static void* my_copy_##A(void* data) \ -{ \ - return (void*)RunFunctionFmt(my_copy_fct_##A, "p", data); \ -} +#define GO(A) \ + static uintptr_t my_copy_fct_##A = 0; \ + static void* my_copy_##A(void* src, void* data) \ + { \ + return (void*)RunFunctionFmt(my_copy_fct_##A, "pp", src, data); \ + } SUPER() #undef GO static void* findCopyFct(void* fct) @@ -166,28 +151,27 @@ SUPER() #undef GO // then the static functions callback that may be used with the structure, but dispatch also have a callback... #define GO(A) \ -static uintptr_t fct_funcs_prepare_##A = 0; \ -static int my_funcs_prepare_##A(void* source, int *timeout_) { \ - return (int)RunFunctionFmt(fct_funcs_prepare_##A, "pp", source, timeout_); \ -} \ -static uintptr_t fct_funcs_check_##A = 0; \ -static int my_funcs_check_##A(void* source) { \ - return (int)RunFunctionFmt(fct_funcs_check_##A, "p", source); \ -} \ -static uintptr_t fct_funcs_dispatch_cb_##A = 0; \ -static int my_funcs_dispatch_cb_##A(void* a, void* b, void* c, void* d) { \ - return (int)RunFunctionFmt(fct_funcs_dispatch_cb_##A, "pppp", a, b, c, d); \ -} \ -static uintptr_t fct_funcs_dispatch_##A = 0; \ -static int my_funcs_dispatch_##A(void* source, void* cb, void* data) { \ - uintptr_t old = fct_funcs_dispatch_cb_##A; \ - fct_funcs_dispatch_cb_##A = (uintptr_t)cb; \ - return (int)RunFunctionFmt(fct_funcs_dispatch_##A, "ppp", source, cb?my_funcs_dispatch_cb_##A:NULL, data); \ - fct_funcs_dispatch_cb_##A = old; \ -} \ -static uintptr_t fct_funcs_finalize_##A = 0; \ -static int my_funcs_finalize_##A(void* source) { \ - return (int)RunFunctionFmt(fct_funcs_finalize_##A, "p", source); \ +static int my_funcs_prepare_##A(void* source, int *timeout_) { \ + return (int)RunFunctionFmt((uintptr_t)ref_gsourcefuncs_##A->prepare, "pp", source, timeout_); \ +} \ +static uintptr_t fct_funcs_check_##A = 0; \ +static int my_funcs_check_##A(void* source) { \ + return (int)RunFunctionFmt((uintptr_t)ref_gsourcefuncs_##A->check, "p", source); \ +} \ +static uintptr_t fct_funcs_dispatch_cb_##A = 0; \ +static int my_funcs_dispatch_cb_##A(void* a, void* b, void* c, void* d) { \ + return (int)RunFunctionFmt(fct_funcs_dispatch_cb_##A, "pppp", a, b, c, d); \ +} \ +static uintptr_t fct_funcs_dispatch_##A = 0; \ +static int my_funcs_dispatch_##A(void* source, void* cb, void* data) { \ + uintptr_t old = fct_funcs_dispatch_cb_##A; \ + fct_funcs_dispatch_cb_##A = (uintptr_t)cb; \ + return (int)RunFunctionFmt((uintptr_t)ref_gsourcefuncs_##A->dispatch, "ppp", source, cb?my_funcs_dispatch_cb_##A:NULL, data); \ + fct_funcs_dispatch_cb_##A = old; \ +} \ +static uintptr_t fct_funcs_finalize_##A = 0; \ +static int my_funcs_finalize_##A(void* source) { \ + return (int)RunFunctionFmt((uintptr_t)ref_gsourcefuncs_##A->finalize, "p", source); \ } SUPER() #undef GO @@ -198,16 +182,14 @@ static my_GSourceFuncs_t* findFreeGSourceFuncs(my_GSourceFuncs_t* fcts) #define GO(A) if(ref_gsourcefuncs_##A == fcts) return &my_gsourcefuncs_##A; SUPER() #undef GO - #define GO(A) if(ref_gsourcefuncs_##A == 0) { \ - ref_gsourcefuncs_##A = fcts; \ - my_gsourcefuncs_##A.prepare = (fcts->prepare)?((GetNativeFnc((uintptr_t)fcts->prepare))?GetNativeFnc((uintptr_t)fcts->prepare):my_funcs_prepare_##A):NULL; \ - fct_funcs_prepare_##A = (uintptr_t)fcts->prepare; \ - my_gsourcefuncs_##A.check = (fcts->check)?((GetNativeFnc((uintptr_t)fcts->check))?GetNativeFnc((uintptr_t)fcts->check):my_funcs_check_##A):NULL; \ - fct_funcs_check_##A = (uintptr_t)fcts->check; \ - my_gsourcefuncs_##A.dispatch = (fcts->dispatch)?((GetNativeFnc((uintptr_t)fcts->dispatch))?GetNativeFnc((uintptr_t)fcts->dispatch):my_funcs_dispatch_##A):NULL; \ - fct_funcs_dispatch_##A = (uintptr_t)fcts->dispatch; \ - my_gsourcefuncs_##A.finalize = (fcts->finalize)?((GetNativeFnc((uintptr_t)fcts->finalize))?GetNativeFnc((uintptr_t)fcts->finalize):my_funcs_finalize_##A):NULL; \ - fct_funcs_finalize_##A = (uintptr_t)fcts->finalize; \ + #define GO(A) if(ref_gsourcefuncs_##A == 0) { \ + ref_gsourcefuncs_##A = fcts; \ + my_gsourcefuncs_##A.closure = fcts->closure; \ + my_gsourcefuncs_##A.marshal = fcts->marshal; \ + my_gsourcefuncs_##A.prepare = (fcts->prepare)?GetNativeOrAlt(fcts->prepare, my_funcs_prepare_##A):NULL; \ + my_gsourcefuncs_##A.check = (fcts->check)?GetNativeOrAlt(fcts->check, my_funcs_check_##A):NULL; \ + my_gsourcefuncs_##A.dispatch = (fcts->dispatch)?GetNativeOrAlt(fcts->dispatch, my_funcs_dispatch_##A):NULL; \ + my_gsourcefuncs_##A.finalize = (fcts->finalize)?GetNativeOrAlt(fcts->finalize, my_funcs_finalize_##A):NULL; \ return &my_gsourcefuncs_##A; \ } SUPER() @@ -734,9 +716,161 @@ static void* findGThreadFuncFct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for glib2 GThreadFunc callback\n"); return NULL; } +// TimeOut +#define GO(A) \ +static uintptr_t my_TimeOut_fct_##A = 0; \ +static void my_TimeOut_##A(void* a) \ +{ \ + RunFunctionFmt(my_TimeOut_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findTimeOutFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_TimeOut_fct_##A == (uintptr_t)fct) return my_TimeOut_##A; + SUPER() + #undef GO + #define GO(A) if(my_TimeOut_fct_##A == 0) {my_TimeOut_fct_##A = (uintptr_t)fct; return my_TimeOut_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for glib2 TimeOut callback\n"); + return NULL; +} +// GTraverseFunc ... +#define GO(A) \ +static uintptr_t my_GTraverseFunc_fct_##A = 0; \ +static int my_GTraverseFunc_##A(void* a, void* b, void* c) \ +{ \ + return (int)RunFunctionFmt(my_GTraverseFunc_fct_##A, "ppp", a, b, c); \ +} +SUPER() +#undef GO +static void* findGTraverseFuncFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_GTraverseFunc_fct_##A == (uintptr_t)fct) return my_GTraverseFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_GTraverseFunc_fct_##A == 0) {my_GTraverseFunc_fct_##A = (uintptr_t)fct; return my_GTraverseFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for glib2 GTraverseFunc callback\n"); + return NULL; +} + +// GLogWriterFunc ... +#define GO(A) \ + static uintptr_t my_GLogWriterFunc_fct_##A = 0; \ + static int my_GLogWriterFunc_##A(void* a, void* b) \ + { \ + return RunFunctionFmt(my_GLogWriterFunc_fct_##A, "pp", a, b); \ + } +SUPER() +#undef GO +static void* findLogWriterFct(void* fct) +{ + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_GLogWriterFunc_fct_##A == (uintptr_t)fct) return my_GLogWriterFunc_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_GLogWriterFunc_fct_##A == 0) { \ + my_GLogWriterFunc_fct_##A = (uintptr_t)fct; \ + return my_GLogWriterFunc_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for glib2 GLogWriterFunc callback\n"); + return NULL; +} + +// GDataForeachFunc ... +#define GO(A) \ + static uintptr_t my_GDataForeachFunc_fct_##A = 0; \ + static void* my_GDataForeachFunc_##A(uint32_t a, void* b, void* c) \ + { \ + return (void*)RunFunctionFmt(my_GDataForeachFunc_fct_##A, "upp", a, b, c); \ + } +SUPER() +#undef GO +static void* findGDataForeachFuncFct(void* fct) +{ + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_GDataForeachFunc_fct_##A == (uintptr_t)fct) return my_GDataForeachFunc_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_GDataForeachFunc_fct_##A == 0) { \ + my_GDataForeachFunc_fct_##A = (uintptr_t)fct; \ + return my_GDataForeachFunc_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for glib2 GDataForeachFunc callback\n"); + return NULL; +} + +// GUnixFDSourceFunc ... +#define GO(A) \ + static uintptr_t my_GUnixFDSourceFunc_fct_##A = 0; \ + static int my_GUnixFDSourceFunc_##A(int a, uint32_t b, void* c) \ + { \ + return RunFunctionFmt(my_GUnixFDSourceFunc_fct_##A, "iup", a, b, c); \ + } +SUPER() +#undef GO +static void* findGUnixFDSourceFuncFct(void* fct) +{ + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_GUnixFDSourceFunc_fct_##A == (uintptr_t)fct) return my_GUnixFDSourceFunc_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_GUnixFDSourceFunc_fct_##A == 0) { \ + my_GUnixFDSourceFunc_fct_##A = (uintptr_t)fct; \ + return my_GUnixFDSourceFunc_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for glib2 GUnixFDSourceFunc callback\n"); + return NULL; +} #undef SUPER +EXPORT void* my_g_markup_vprintf_escaped(x64emu_t *emu, void* fmt, void* b) { + // need to align on arm + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 1); + PREPARE_VALIST; + return my->g_markup_vprintf_escaped(fmt, VARARGS); +} + +EXPORT void* my_g_build_filename(x64emu_t* emu, void* first, uintptr_t* b) +{ + int n = 0; + while (getVArgs(emu, 1, b, n++)); + void* array[n+1]; // +1 for 1st (NULL terminal already included) + array[0] = first; + for(int i=0; ig_build_filenamev(array); + return ret; +} + +EXPORT uint32_t my_g_timeout_add(x64emu_t* emu, uint32_t interval, void* func, void* data) +{ + return my->g_timeout_add(interval, findTimeOutFct(func), data); +} + EXPORT void my_g_list_free_full(x64emu_t* emu, void* list, void* free_func) { my->g_list_free_full(list, findFreeFct(free_func)); @@ -756,6 +890,11 @@ EXPORT void my_g_datalist_id_set_data_full(x64emu_t* emu, void* datalist, uintpt my->g_datalist_id_set_data_full(datalist, key, data, fc); } +EXPORT void my_g_datalist_foreach(x64emu_t* emu, void* datalist, void* func, void* data) +{ + my->g_datalist_foreach(datalist, findGDataForeachFuncFct(func), data); +} + EXPORT void* my_g_datalist_id_dup_data(x64emu_t* emu, void* datalist, uintptr_t key, void* dupcb, void* data) { void* cc = findDuplicateFct(dupcb); @@ -897,12 +1036,7 @@ EXPORT void my_g_main_context_set_poll_func(x64emu_t* emu, void* context, void* EXPORT uint32_t my_g_idle_add_full(x64emu_t* emu, int priority, void* f, void* data, void* notify) { - if(!f) - return my->g_idle_add_full(priority, f, data, notify); - - my_signal_t *sig = new_mysignal(f, data, notify); - printf_log(LOG_DEBUG, "glib2 Idle CB with priority %d created for %p, sig=%p\n", priority, f, sig); - return my->g_idle_add_full(priority, my_timeout_cb, sig, my_signal_delete); + return my->g_idle_add_full(priority, findTimeOutFct(f), data, findGDestroyNotifyFct(notify)); } EXPORT void* my_g_hash_table_new(x64emu_t* emu, void* hash, void* equal) @@ -936,17 +1070,17 @@ EXPORT void* my_g_hash_table_find(x64emu_t* emu, void* table, void* f, void* dat return my->g_hash_table_find(table, findGHRFuncFct(f), data); } -EXPORT int my_g_spawn_async_with_pipes(x64emu_t* emu, void* dir, void* argv, void* envp, int flags, void* f, void* data, void* child, void* input, void* output, void* err, void* error) +EXPORT int my_g_spawn_async_with_pipes(x64emu_t* emu, void* dir, void* argv, void* envp, uint32_t flags, void* f, void* data, void* child, void* input, void* output, void* err, void* error) { return my->g_spawn_async_with_pipes(dir, argv, envp, flags, findSpawnChildSetupFct(f), data, child, input, output, err, error); } -EXPORT int my_g_spawn_async(x64emu_t* emu, void* dir, void* argv, void* envp, int flags, void* f, void* data, void* child, void* error) +EXPORT int my_g_spawn_async(x64emu_t* emu, void* dir, void* argv, void* envp, uint32_t flags, void* f, void* data, void* child, void* error) { return my->g_spawn_async(dir, argv, envp, flags, findSpawnChildSetupFct(f), data, child, error); } -EXPORT int my_g_spawn_sync(x64emu_t* emu, void* dir, void* argv, void* envp, int flags, void* f, void* data, void* input, void* output, void* status, void* error) +EXPORT int my_g_spawn_sync(x64emu_t* emu, void* dir, void* argv, void* envp, uint32_t flags, void* f, void* data, void* input, void* output, void* status, void* error) { return my->g_spawn_sync(dir, argv, envp, flags, findSpawnChildSetupFct(f), data, input, output, status, error); } @@ -1006,13 +1140,18 @@ EXPORT void my_g_ptr_array_foreach(x64emu_t* emu, void* array, void* func, void* my->g_ptr_array_foreach(array, findGFuncFct(func), data); } +EXPORT int my_g_ptr_array_find_with_equal_func(x64emu_t* emu, void* haystack, void* needle, void* equal_func, void* index_) +{ + return my->g_ptr_array_find_with_equal_func(haystack, needle, findEqualFct(equal_func), index_); +} + EXPORT void* my_g_thread_create(x64emu_t* emu, void* func, void* data, int joinable, void* error) { void* et = NULL; return my->g_thread_create(my_prepare_thread(emu, func, data, 0, &et), et, joinable, error); } -EXPORT void* my_g_thread_create_full(x64emu_t* emu, void* func, void* data, unsigned long stack, int joinable, int bound, int priority, void* error) +EXPORT void* my_g_thread_create_full(x64emu_t* emu, void* func, void* data, unsigned long stack, int joinable, int bound, uint32_t priority, void* error) { void* et = NULL; return my->g_thread_create_full(my_prepare_thread(emu, func, data, stack, &et), et, stack, joinable, bound, priority, error); @@ -1043,6 +1182,11 @@ EXPORT void my_g_source_set_callback(x64emu_t* emu, void* source, void* func, vo my->g_source_set_callback(source, findGSourceFuncFct(func), data, findFreeFct(notify)); } +EXPORT void my_g_main_context_invoke(x64emu_t* emu, void* context, void* func, void* data) +{ + my->g_main_context_invoke(context, findGSourceFuncFct(func), data); +} + EXPORT void* my_g_slist_insert_sorted(x64emu_t* emu, void* list, void* d, void* comp) { @@ -1070,18 +1214,28 @@ EXPORT uint32_t my_g_idle_add(x64emu_t* emu, void* func, void* data) EXPORT void* my_g_variant_new_va(x64emu_t* emu, char* fmt, void* endptr, x64_va_list_t* b) { - #ifdef CONVERT_VALIST +#ifdef CONVERT_VALIST CONVERT_VALIST(*b); - #else +#else +#if defined(__loongarch64) || defined(__riscv) + va_list sysv_varargs; + myStackAlignGVariantNewVa(emu, fmt, emu->scratch, b); + sysv_varargs = (va_list)emu->scratch; +#else CREATE_VALIST_FROM_VALIST(*b, emu->scratch); - #endif - va_list* aligned = &VARARGS; - return my->g_variant_new_va(fmt, endptr, &aligned); +#endif +#endif + return my->g_variant_new_va(fmt, endptr, &sysv_varargs); } EXPORT void* my_g_variant_new(x64emu_t* emu, char* fmt, uint64_t* V) { +#if defined(__loongarch64) || defined(__riscv) + myStackAlignGVariantNew(emu, fmt, V, emu->scratch, 1); + PREPARE_VALIST; +#else CREATE_VALIST_FROM_VAARG(V, emu->scratch, 1); +#endif return my->g_variant_new_va(fmt, NULL, &VARARGS); } @@ -1108,12 +1262,12 @@ EXPORT void* my_g_log_set_default_handler(x64emu_t *emu, void* f, void* data) return reverseGLogFuncFct(my->g_log_set_default_handler(findGLogFuncFct(f), data)); } -EXPORT uint32_t my_g_io_add_watch_full(x64emu_t* emu, void* channel, int priority, int cond, void* f, void* data, void* notify) +EXPORT uint32_t my_g_io_add_watch_full(x64emu_t* emu, void* channel, int priority, uint32_t cond, void* f, void* data, void* notify) { return my->g_io_add_watch_full(channel, priority, cond, findGIOFuncFct(f), data, findDestroyFct(notify)); } -EXPORT uint32_t my_g_io_add_watch(x64emu_t* emu, void* channel, int cond, void* f, void* data) +EXPORT uint32_t my_g_io_add_watch(x64emu_t* emu, void* channel, uint32_t cond, void* f, void* data) { return my->g_io_add_watch(channel, cond, findGIOFuncFct(f), data); } @@ -1195,7 +1349,12 @@ EXPORT uint32_t my_g_log_set_handler(x64emu_t *emu, void* domain, int level, voi return my->g_log_set_handler(domain, level, findGLogFuncFct(f), data); } -EXPORT void my_g_set_error(x64emu_t *emu, void* err, void* domain, int code, void* fmt, uintptr_t* stack) +EXPORT void my_g_log_set_writer_func(x64emu_t* emu, void* f, void* data, void* notify) +{ + my->g_log_set_writer_func(findLogWriterFct(f), data, findDestroyFct(notify)); +} + +EXPORT void my_g_set_error(x64emu_t *emu, void* err, void* domain, uint32_t code, void* fmt, uintptr_t* stack) { char buf[1000]; myStackAlign(emu, fmt, stack, emu->scratch, R_EAX, 4); @@ -1204,13 +1363,13 @@ EXPORT void my_g_set_error(x64emu_t *emu, void* err, void* domain, int code, voi my->g_set_error_literal(err, domain, code, buf); } -EXPORT void* my_g_error_new(x64emu_t* emu, void* domain, int code, void* fmt, uintptr_t* b) +EXPORT void* my_g_error_new(x64emu_t* emu, uint32_t domain, int code, void* fmt, uintptr_t* b) { myStackAlign(emu, fmt, b, emu->scratch, R_EAX, 3); PREPARE_VALIST; return my->g_error_new_valist(domain, code, fmt, VARARGS); } -EXPORT void* my_g_error_new_valist(x64emu_t* emu, void* domain, int code, void* fmt, x64_va_list_t V) +EXPORT void* my_g_error_new_valist(x64emu_t* emu, uint32_t domain, int code, void* fmt, x64_va_list_t V) { #ifdef CONVERT_VALIST CONVERT_VALIST(V); @@ -1220,6 +1379,13 @@ EXPORT void* my_g_error_new_valist(x64emu_t* emu, void* domain, int code, void* return my->g_error_new_valist(domain, code, fmt, VARARGS); } +EXPORT void my_g_propagate_prefixed_error(x64emu_t* emu, void* dest, void* src, void* fmt, uintptr_t* b) +{ + myStackAlign(emu, fmt, b, emu->scratch, R_EAX, 3); + PREPARE_VALIST; + my->g_propagate_prefixed_error(dest, src, fmt, VARARGS); +} + EXPORT int my_g_fprintf(x64emu_t* emu, void* f, void* fmt, uintptr_t* b) { myStackAlign(emu, fmt, b, emu->scratch, R_EAX, 3); @@ -1243,6 +1409,13 @@ EXPORT void my_g_log(x64emu_t* emu, void* domain, int level, void* fmt, uintptr_ my->g_logv(domain, level, fmt, VARARGS); } +EXPORT void my_g_log_structured_standard(x64emu_t* emu, void* log_domain, uint32_t log_level, void* file, void* line, void* func, void* fmt, uintptr_t* b) +{ + myStackAlign(emu, fmt, b, emu->scratch, R_EAX, 6); + PREPARE_VALIST; + my->g_log_structured_standard(log_domain, log_level, file, line, func, fmt, VARARGS); +} + EXPORT int my_g_printf(x64emu_t* emu, void* fmt, uintptr_t* b) { myStackAlign(emu, fmt, b, emu->scratch, R_EAX, 1); @@ -1384,7 +1557,7 @@ EXPORT void* my_g_strconcat(x64emu_t* emu, void* first, uintptr_t* data) return p; } -EXPORT void* my_g_markup_parse_context_new(x64emu_t* emu, void* parser, int flags, void* data, void* destroy) +EXPORT void* my_g_markup_parse_context_new(x64emu_t* emu, void* parser, uint32_t flags, void* data, void* destroy) { return my->g_markup_parse_context_new(parser, flags, data, findDestroyFct(destroy)); } @@ -1409,6 +1582,11 @@ EXPORT void* my_g_node_copy_deep(x64emu_t* emu, void* node, void* f, void* data) return my->g_node_copy_deep(node, findCopyFct(f), data); } +EXPORT void* my_g_slist_copy_deep(x64emu_t* emu, void* list, void* f, void* data) +{ + return my->g_slist_copy_deep(list, findCopyFct(f), data); +} + EXPORT void* my_g_thread_try_new(x64emu_t* emu, void* name, void* f, void* data, void* err) { return my->g_thread_try_new(name, findGThreadFuncFct(f), data, err); @@ -1449,8 +1627,84 @@ EXPORT void* my_g_bytes_new_with_free_func(x64emu_t* emu, void* data, unsigned l return my->g_bytes_new_with_free_func(data, n, findGDestroyNotifyFct(notify), user); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#ifndef HAVE_LD80BITS +EXPORT void my_g_assertion_message_cmpnum(void* domain, void* file, int32_t line, void* func, void* expr, double arg1, void* comp, double arg2, uint8_t numtype) +{ + my->g_assertion_message_cmpnum(domain, file, line, func, expr, arg1, comp, arg2, numtype); +} +#endif + +EXPORT void* my_g_sequence_new(x64emu_t* emu, void* d) +{ + return my->g_sequence_new(findGDestroyNotifyFct(d)); +} + +EXPORT void* my_g_sequence_lookup(x64emu_t* emu, void* seq, void* data, void* f, void* cmp_data) +{ + return my->g_sequence_lookup(seq, data, findGCompareDataFuncFct(f), cmp_data); +} + +EXPORT void* my_g_sequence_insert_sorted(x64emu_t* emu, void* seq, void* data, void* f, void* cmp_data) +{ + return my->g_sequence_insert_sorted(seq, data, findGCompareDataFuncFct(f), cmp_data); +} + +EXPORT void* my_g_tree_new(x64emu_t* emu, void* f) +{ + return my->g_tree_new(findGCompareFuncFct(f)); +} + +EXPORT void* my_g_tree_new_full(x64emu_t* emu, void* f, void* data, void* d1, void* d2) +{ + return my->g_tree_new_full(findGCompareFuncFct(f), data, findGDestroyNotifyFct(d1), findGDestroyNotifyFct(d2)); +} + +EXPORT void my_g_tree_foreach(x64emu_t* emu, void* tree, void* f, void* data) +{ + my->g_tree_foreach(tree, findGTraverseFuncFct(f), data); +} + +EXPORT void my_g_queue_insert_sorted(x64emu_t* emu, void* queue, void* data, void* f, void* user_data) +{ + my->g_queue_insert_sorted(queue, data, findGCompareDataFuncFct(f), user_data); +} + +EXPORT void* my_g_async_queue_new_full(x64emu_t* emu, void* item_free_func) +{ + return my->g_async_queue_new_full(findGDestroyNotifyFct(item_free_func)); +} + +EXPORT void* my_g_thread_pool_new(x64emu_t* emu, void* func, void* user_data, int32_t max_threads, int32_t exclusive, void* error) +{ + return my->g_thread_pool_new(findGFuncFct(func), user_data, max_threads, exclusive, error); +} + +EXPORT void my_g_async_queue_push_sorted(x64emu_t* emu, void* queue, void* data, void* func, void* user_data) +{ + my->g_async_queue_push_sorted(queue, data, findGCompareDataFuncFct(func), user_data); +} + +EXPORT void my_g_thread_pool_set_sort_function(x64emu_t* emu, void* pool, void* func, void* user_data) +{ + my->g_thread_pool_set_sort_function(pool, findGCompareDataFuncFct(func), user_data); +} + +EXPORT void my_g_queue_free_full(x64emu_t* emu, void* queue, void* d) +{ + my->g_queue_free_full(queue, findGDestroyNotifyFct(d)); +} + +EXPORT uint32_t my_g_unix_fd_add(x64emu_t* emu, int fd, uint32_t cond, void* f, void* data) +{ + return my->g_unix_fd_add(fd, cond, findGUnixFDSourceFuncFct(f), data); +} + +EXPORT uint32_t my_g_unix_fd_add_full(x64emu_t* emu, int priority, int fd, uint32_t cond, void* f, void* data, void* notify) +{ + return my->g_unix_fd_add_full(priority, fd, cond, findGUnixFDSourceFuncFct(f), data, findGDestroyNotifyFct(notify)); +} + +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedglib2_private.h b/src/wrapped/wrappedglib2_private.h index 4f06530..a4bba07 100644 --- a/src/wrapped/wrappedglib2_private.h +++ b/src/wrapped/wrappedglib2_private.h @@ -1,5 +1,5 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif //GO(__aeabi_d2lz, @@ -24,21 +24,21 @@ GO(g_array_sized_new, pFiiuu) GOM(g_array_sort, vFEpp) GOM(g_array_sort_with_data, vFEppp) GO(g_array_unref, vFp) -GO(g_ascii_digit_value, iFC) +GO(g_ascii_digit_value, iFc) GO(g_ascii_dtostr, pFpid) GO(g_ascii_formatd, pFpipd) GO(g_ascii_strcasecmp, iFpp) -GO(g_ascii_strdown, pFpi) +GO(g_ascii_strdown, pFpl) GO(g_ascii_strncasecmp, iFppL) GO(g_ascii_strtod, dFpp) GO(g_ascii_strtoll, lFppu) GO(g_ascii_strtoull, LFppu) GO(g_ascii_strup, pFpl) -GO(g_ascii_tolower, CFC) -GO(g_ascii_toupper, CFC) -GO(g_ascii_xdigit_value, iFC) +GO(g_ascii_tolower, cFc) +GO(g_ascii_toupper, cFc) +GO(g_ascii_xdigit_value, iFc) GO(g_assertion_message, vFppipp) -GO(g_assertion_message_cmpnum, vFppippDpDC) +GOD(g_assertion_message_cmpnum, vFppippDpDc, my_g_assertion_message_cmpnum) GO(g_assertion_message_cmpstr, vFppippppp) GO(g_assertion_message_error, vFppipppui) GO(g_assertion_message_expr, vFppipp) @@ -47,20 +47,20 @@ GO(g_async_queue_length, iFp) GO(g_async_queue_length_unlocked, iFp) GO(g_async_queue_lock, vFp) GO(g_async_queue_new, pFv) -//GO(g_async_queue_new_full, +GOM(g_async_queue_new_full, pFEp) GO(g_async_queue_pop, pFp) -//GO(g_async_queue_pop_unlocked, +GO(g_async_queue_pop_unlocked, pFp) GO(g_async_queue_push, vFpp) -//GO(g_async_queue_push_sorted, -//GO(g_async_queue_push_sorted_unlocked, +GOM(g_async_queue_push_sorted, vFEpppp) +//GOM(g_async_queue_push_sorted_unlocked, vFpppp) GO(g_async_queue_push_unlocked, vFpp) GO(g_async_queue_ref, pFp) -//GO(g_async_queue_ref_unlocked, -//GO(g_async_queue_sort, -//GO(g_async_queue_sort_unlocked, -//GO(g_async_queue_timed_pop, +GO(g_async_queue_ref_unlocked, vFp) +//GOM(g_async_queue_sort, vFppp) +//GOM(g_async_queue_sort_unlocked, vFppp) +GO(g_async_queue_timed_pop, pFpp) GO(g_async_queue_timed_pop_unlocked, pFpp) -GO(g_async_queue_timeout_pop, pFpU) +GO(g_async_queue_timeout_pop, pFpL) GO(g_async_queue_timeout_pop_unlocked, pFpL) GO(g_async_queue_try_pop, pFp) GO(g_async_queue_try_pop_unlocked, pFp) @@ -68,21 +68,21 @@ GO(g_async_queue_unlock, vFp) GO(g_async_queue_unref, vFp) GO(g_async_queue_unref_and_unlock, vFp) GO2(g_atexit, vFEp, my_atexit) -//GO(g_atomic_int_add, -//GO(g_atomic_int_and, +GO(g_atomic_int_add, iFpi) +GO(g_atomic_int_and, uFpu) GO(g_atomic_int_compare_and_exchange, iFpii) GO(g_atomic_int_dec_and_test, iFp) GO(g_atomic_int_exchange_and_add, iFpi) GO(g_atomic_int_get, iFp) GO(g_atomic_int_inc, vFp) -//GO(g_atomic_int_or, -//GO(g_atomic_int_set, +GO(g_atomic_int_or, uFpu) +GO(g_atomic_int_set, vFpi) GO(g_atomic_int_xor, uFpu) GO(g_atomic_pointer_add, lFpl) -//GO(g_atomic_pointer_and, +GO(g_atomic_pointer_and, LFpL) GO(g_atomic_pointer_compare_and_exchange, iFppp) GO(g_atomic_pointer_get, pFp) -//GO(g_atomic_pointer_or, +GO(g_atomic_pointer_or, LFpL) GO(g_atomic_pointer_set, vFpp) GO(g_atomic_pointer_xor, LFpL) GO(g_base64_decode, pFpp) @@ -92,53 +92,53 @@ GO(g_base64_encode, pFpL) GO(g_base64_encode_close, LFippp) GO(g_base64_encode_step, LFpLippp) GO(g_basename, pFp) -//GO(g_bit_lock, -GO(g_bit_nth_lsf, iFii) +GO(g_bit_lock, vFpi) +GO(g_bit_nth_lsf, iFLi) GO(g_bit_nth_msf, iFLi) GO(g_bit_storage, uFL) GO(g_bit_trylock, iFpi) GO(g_bit_unlock, vFpi) -//GO(g_blow_chunks, -//GO(g_bookmark_file_add_application, +GO(g_blow_chunks, vFv) +GO(g_bookmark_file_add_application, vFpppp) GO(g_bookmark_file_add_group, vFppp) -//GO(g_bookmark_file_error_quark, -//GO(g_bookmark_file_free, -//GO(g_bookmark_file_get_added, +GO(g_bookmark_file_error_quark, uFv) +GO(g_bookmark_file_free, vFp) +GO(g_bookmark_file_get_added, lFppp) GO(g_bookmark_file_get_app_info, iFppppppp) GO(g_bookmark_file_get_applications, pFpppp) -//GO(g_bookmark_file_get_description, -//GO(g_bookmark_file_get_groups, +GO(g_bookmark_file_get_description, pFppp) +GO(g_bookmark_file_get_groups, pFpppp) GO(g_bookmark_file_get_icon, iFppppp) -//GO(g_bookmark_file_get_is_private, +GO(g_bookmark_file_get_is_private, iFppp) GO(g_bookmark_file_get_mime_type, pFppp) -//GO(g_bookmark_file_get_modified, +GO(g_bookmark_file_get_modified, lFppp) GO(g_bookmark_file_get_size, iFp) -//GO(g_bookmark_file_get_title, +GO(g_bookmark_file_get_title, pFppp) GO(g_bookmark_file_get_uris, pFpp) GO(g_bookmark_file_get_visited, lFppp) -//GO(g_bookmark_file_has_application, -//GO(g_bookmark_file_has_group, +GO(g_bookmark_file_has_application, iFpppp) +GO(g_bookmark_file_has_group, iFpppp) GO(g_bookmark_file_has_item, iFpp) GO(g_bookmark_file_load_from_data, iFppLp) GO(g_bookmark_file_load_from_data_dirs, iFpppp) -//GO(g_bookmark_file_load_from_file, +GO(g_bookmark_file_load_from_file, iFppp) GO(g_bookmark_file_move_item, iFpppp) GO(g_bookmark_file_new, pFv) -//GO(g_bookmark_file_remove_application, -//GO(g_bookmark_file_remove_group, +GO(g_bookmark_file_remove_application, iFpppp) +GO(g_bookmark_file_remove_group, iFpppp) GO(g_bookmark_file_remove_item, iFppp) -//GO(g_bookmark_file_set_added, +GO(g_bookmark_file_set_added, vFppl) GO(g_bookmark_file_set_app_info, iFppppilp) -//GO(g_bookmark_file_set_description, +GO(g_bookmark_file_set_description, vFppp) GO(g_bookmark_file_set_groups, vFpppL) GO(g_bookmark_file_set_icon, vFpppp) GO(g_bookmark_file_set_is_private, vFppi) -//GO(g_bookmark_file_set_mime_type, -//GO(g_bookmark_file_set_modified, -//GO(g_bookmark_file_set_title, +GO(g_bookmark_file_set_mime_type, vFppp) +GO(g_bookmark_file_set_modified, vFppl) +GO(g_bookmark_file_set_title, vFppp) GO(g_bookmark_file_set_visited, vFppl) GO(g_bookmark_file_to_data, pFppp) -//GO(g_bookmark_file_to_file, +GO(g_bookmark_file_to_file, iFppp) GOM(g_build_filename, pFEpV) GO(g_build_filenamev, pFp) GOM(g_build_path, pFEppV) // wrap using g_build_pathv @@ -155,8 +155,8 @@ GO(g_byte_array_remove_index_fast, pFpu) GO(g_byte_array_remove_range, pFpuu) GO(g_byte_array_set_size, pFpu) GO(g_byte_array_sized_new, pFu) -//GOM(g_byte_array_sort, vFpB) -//GOM(g_byte_array_sort_with_data, vFpBp) +//GOM(g_byte_array_sort, vFpp) +//GOM(g_byte_array_sort_with_data, vFppp) GO(g_byte_array_unref, vFp) GO(g_bytes_compare, iFpp) GO(g_bytes_equal, iFpp) @@ -174,17 +174,17 @@ GO(g_bytes_unref_to_array, pFp) GO(g_bytes_unref_to_data, pFpp) GO(g_cache_destroy, vFp) GO(g_cache_insert, pFpp) -//GO(g_cache_key_foreach, -//GO(g_cache_new, +//GOM(g_cache_key_foreach, vFppp) +//GOM(g_cache_new, pFppppppp) GO(g_cache_remove, vFpp) -//GO(g_cache_value_foreach, +//GOM(g_cache_value_foreach, vFppp) GO(g_chdir, iFp) GO(g_checksum_copy, pFp) GO(g_checksum_free, vFp) GO(g_checksum_get_digest, vFppp) GO(g_checksum_get_string, pFp) GO(g_checksum_new, pFu) -//GO(g_checksum_reset, +GO(g_checksum_reset, vFp) GO(g_checksum_type_get_length, lFu) GO(g_checksum_update, vFppl) GOM(g_child_watch_add, uFEipp) @@ -194,7 +194,7 @@ GO(g_chmod, iFpi) GO(g_clear_error, vFp) //GOM(g_clear_pointer, vFEpp) GO(g_close, iFip) -GO(g_completion_add_items, vFpp) +GO(g_completion_add_items, vFpp) // need wrapping?: GCompletion structure contains 2 callback GO(g_completion_clear_items, vFp) GO(g_completion_complete, pFppp) GO(g_completion_complete_utf8, pFppp) @@ -217,12 +217,12 @@ GO(g_cond_timed_wait, iFppp) GO(g_cond_wait, vFpp) GO(g_cond_wait_until, iFppl) GO(g_convert, pFplppppp) -//GO(g_convert_error_quark, +GO(g_convert_error_quark, uFv) GO(g_convert_with_fallback, pFplpppppp) GO(g_convert_with_iconv, pFplpppp) GO(g_creat, iFpi) GO(g_datalist_clear, vFp) -//GOM(g_datalist_foreach, vFEppp) +GOM(g_datalist_foreach, vFEppp) GO(g_datalist_get_data, pFpp) GO(g_datalist_get_flags, uFp) GOM(g_datalist_id_dup_data, pFEpupp) @@ -234,10 +234,10 @@ GO(g_datalist_init, vFp) GO(g_datalist_set_flags, vFpu) GO(g_datalist_unset_flags, vFpu) GO(g_dataset_destroy, vFp) -//GO(g_dataset_foreach, -//GO(g_dataset_id_get_data, +//GOM(g_dataset_foreach, vFppp) +GO(g_dataset_id_get_data, pFpu) GO(g_dataset_id_remove_no_notify, pFpu) -//GO(g_dataset_id_set_data_full, +//GOM(g_dataset_id_set_data_full, vFpupp) GO(g_date_add_days, vFpu) GO(g_date_add_months, vFpu) GO(g_date_add_years, vFpu) @@ -252,7 +252,7 @@ GO(g_date_get_days_in_month, CFuW) GO(g_date_get_iso8601_week_of_year, uFp) GO(g_date_get_julian, uFp) GO(g_date_get_monday_week_of_year, uFp) -GO(g_date_get_monday_weeks_in_year, CFp) +GO(g_date_get_monday_weeks_in_year, CFW) GO(g_date_get_month, uFp) GO(g_date_get_sunday_week_of_year, uFp) GO(g_date_get_sunday_weeks_in_year, CFW) @@ -279,47 +279,48 @@ GO(g_date_subtract_days, vFpu) GO(g_date_subtract_months, vFpu) GO(g_date_subtract_years, vFpu) GO(g_date_time_add, pFpl) -//GO(g_date_time_add_days, +GO(g_date_time_add_days, pFpi) GO(g_date_time_add_full, pFpiiiiid) -//GO(g_date_time_add_hours, +GO(g_date_time_add_hours, pFpi) GO(g_date_time_add_minutes, pFpi) -//GO(g_date_time_add_months, +GO(g_date_time_add_months, pFpi) GO(g_date_time_add_seconds, pFpd) -//GO(g_date_time_add_weeks, -//GO(g_date_time_add_years, -//GO(g_date_time_compare, +GO(g_date_time_add_weeks, pFpi) +GO(g_date_time_add_years, pFpi) +GO(g_date_time_compare, iFpp) GO(g_date_time_difference, lFpp) -//GO(g_date_time_equal, +GO(g_date_time_equal, iFpp) GO(g_date_time_format, pFpp) -//GO(g_date_time_get_day_of_month, -//GO(g_date_time_get_day_of_week, -//GO(g_date_time_get_day_of_year, -//GO(g_date_time_get_hour, +GO(g_date_time_format_iso8601, pFp) +GO(g_date_time_get_day_of_month, iFp) +GO(g_date_time_get_day_of_week, iFp) +GO(g_date_time_get_day_of_year, iFp) +GO(g_date_time_get_hour, iFp) GO(g_date_time_get_microsecond, iFp) -//GO(g_date_time_get_minute, -//GO(g_date_time_get_month, -//GO(g_date_time_get_second, +GO(g_date_time_get_minute, iFp) +GO(g_date_time_get_month, iFp) +GO(g_date_time_get_second, iFp) GO(g_date_time_get_seconds, dFp) GO(g_date_time_get_timezone_abbreviation, pFp) GO(g_date_time_get_utc_offset, lFp) -//GO(g_date_time_get_week_numbering_year, -//GO(g_date_time_get_week_of_year, -//GO(g_date_time_get_year, +GO(g_date_time_get_week_numbering_year, iFp) +GO(g_date_time_get_week_of_year, iFp) +GO(g_date_time_get_year, iFp) GO(g_date_time_get_ymd, vFpppp) -//GO(g_date_time_hash, +GO(g_date_time_hash, uFp) GO(g_date_time_is_daylight_savings, iFp) GO(g_date_time_new, pFpiiiiid) -//GO(g_date_time_new_from_timeval_local, +GO(g_date_time_new_from_timeval_local, pFp) GO(g_date_time_new_from_timeval_utc, pFp) -//GO(g_date_time_new_from_unix_local, +GO(g_date_time_new_from_unix_local, pFl) GO(g_date_time_new_from_unix_utc, pFl) -//GO(g_date_time_new_local, +GO(g_date_time_new_local, pFiiiiid) GO(g_date_time_new_now, pFp) GO(g_date_time_new_now_local, pFv) GO(g_date_time_new_now_utc, pFv) GO(g_date_time_new_utc, pFiiiiid) GO(g_date_time_ref, pFp) -//GO(g_date_time_to_local, +GO(g_date_time_to_local, pFp) GO(g_date_time_to_timeval, iFpp) GO(g_date_time_to_timezone, pFpp) GO(g_date_time_to_unix, lFp) @@ -353,23 +354,23 @@ GO(g_environ_unsetenv, pFpp) GO(g_error_copy, pFp) GO(g_error_free, vFp) GO(g_error_matches, iFpui) -GOM(g_error_new, pFEpipV) +GOM(g_error_new, pFEuipV) GO(g_error_new_literal, pFuip) -GOM(g_error_new_valist, pFEpipA) +GOM(g_error_new_valist, pFEuipA) GO(g_file_error_from_errno, uFi) -GO(g_file_error_quark, pFv) +GO(g_file_error_quark, uFv) GO(g_file_get_contents, iFpppp) GO(g_filename_display_basename, pFp) GO(g_filename_display_name, pFp) GO(g_filename_from_uri, pFppp) GO(g_filename_from_utf8, pFplppp) GO(g_filename_to_uri, pFppp) -GO(g_filename_to_utf8, pFpippp) +GO(g_filename_to_utf8, pFplppp) GO(g_file_open_tmp, iFppp) GO(g_file_read_link, pFpp) GO(g_file_set_contents, iFpplp) GO(g_file_test, iFpu) -GO(g_find_program_in_path, pFp) // need wrap? +GO(g_find_program_in_path, pFp) GO(g_fopen, pFpp) GO(g_format_size, pFL) GO(g_format_size_for_display, pFl) @@ -382,15 +383,16 @@ GO(g_get_charset, iFp) GO(g_get_codeset, pFv) GO(g_get_current_dir, pFv) GO(g_get_current_time, vFp) -GO(g_getenv, pFp) // should wrap? +GO(g_getenv, pFp) GO(g_get_environ, pFv) GO(g_get_filename_charsets, iFp) GO(g_get_home_dir, pFv) GO(g_get_host_name, pFv) GO(g_get_language_names, pFv) +GO(g_get_language_names_with_category, pFp) GO(g_get_locale_variants, pFp) -GO(g_get_monotonic_time, IFv) -//GO(g_get_num_processors, +GO(g_get_monotonic_time, lFv) +GO(g_get_num_processors, uFv) GO(g_get_prgname, pFv) GO(g_get_real_name, pFv) GO(g_get_real_time, lFv) @@ -437,88 +439,88 @@ GO(g_hmac_get_digest, vFppp) GO(g_hmac_get_string, pFp) GO(g_hmac_new, pFupL) GO(g_hmac_ref, pFp) -//GO(g_hmac_unref, +GO(g_hmac_unref, vFp) GO(g_hmac_update, vFppl) -//GO(g_hook_alloc, -//GO(g_hook_compare_ids, -//GO(g_hook_destroy, -//GO(g_hook_destroy_link, -//GO(g_hook_find, -//GO(g_hook_find_data, -//GO(g_hook_find_func, -//GO(g_hook_find_func_data, -//GO(g_hook_first_valid, -//GO(g_hook_free, -//GO(g_hook_get, -//GO(g_hook_insert_before, -//GO(g_hook_insert_sorted, -//GO(g_hook_list_clear, -//GO(g_hook_list_init, -//GO(g_hook_list_invoke, -//GO(g_hook_list_invoke_check, -//GO(g_hook_list_marshal, -//GO(g_hook_list_marshal_check, -//GO(g_hook_next_valid, -//GO(g_hook_prepend, -//GO(g_hook_ref, -//GO(g_hook_unref, -//GO(g_hostname_is_ascii_encoded, -//GO(g_hostname_is_ip_address, -//GO(g_hostname_is_non_ascii, -//GO(g_hostname_to_ascii, -//GO(g_hostname_to_unicode, +//GOM(g_hook_alloc, pFp) +//GOM(g_hook_compare_ids, iFpp) +//GOM(g_hook_destroy, iFpL) +//GOM(g_hook_destroy_link, vFpp) +//GOM(g_hook_find, pFpipp) +//GOM(g_hook_find_data, pFpip) +//GOM(g_hook_find_func, pFpip) +//GOM(g_hook_find_func_data, pFpipp) +//GOM(g_hook_first_valid, pFpi) +//GOM(g_hook_free, vFpp) +//GOM(g_hook_get, pFpL) +//GOM(g_hook_insert_before, vFppp) +//GOM(g_hook_insert_sorted, vFppp) +//GOM(g_hook_list_clear, vFp) +//GOM(g_hook_list_init, vFpu) +//GOM(g_hook_list_invoke, vFpi) +//GOM(g_hook_list_invoke_check, vFpi) +//GOM(g_hook_list_marshal, vFpipp) +//GOM(g_hook_list_marshal_check, vFpipp) +//GOM(g_hook_next_valid, pFppi) +//GOM(g_hook_prepend, vFpp) +//GOM(g_hook_ref, pFpp) +//GOM(g_hook_unref, vFpp) +GO(g_hostname_is_ascii_encoded, iFp) +GO(g_hostname_is_ip_address, iFp) +GO(g_hostname_is_non_ascii, iFp) +GO(g_hostname_to_ascii, pFp) +GO(g_hostname_to_unicode, pFp) GO(g_iconv, LFppppp) GO(g_iconv_close, iFp) GO(g_iconv_open, pFpp) GOM(g_idle_add, uFEpp) GOM(g_idle_add_full, uFEippp) GO(g_idle_remove_by_data, iFp) -GO(g_idle_source_new, pFv) +GO(g_idle_source_new, pFv) // should wrap? GO(g_int64_equal, iFpp) GO(g_int64_hash, uFp) GO(g_int_equal, iFpp) GO(g_intern_static_string, pFp) GO(g_intern_string, pFp) GO(g_int_hash, uFp) -GOM(g_io_add_watch, uFEpipp) -GOM(g_io_add_watch_full, uFEpiippp) +GOM(g_io_add_watch, uFEpupp) +GOM(g_io_add_watch_full, uFEpiuppp) GO(g_io_channel_close, vFp) GO(g_io_channel_error_from_errno, uFi) -GO(g_io_channel_error_quark, pFv) -GO(g_io_channel_flush, iFpp) -GO(g_io_channel_get_buffer_condition, iFp) +GO(g_io_channel_error_quark, uFv) +GO(g_io_channel_flush, uFpp) //should wrap? +GO(g_io_channel_get_buffer_condition, uFp) GO(g_io_channel_get_buffered, iFp) -GO(g_io_channel_get_buffer_size, iFp) +GO(g_io_channel_get_buffer_size, LFp) GO(g_io_channel_get_close_on_unref, iFp) GO(g_io_channel_get_encoding, pFp) -GO(g_io_channel_get_flags, iFp) +GO(g_io_channel_get_flags, uFp) GO(g_io_channel_get_line_term, pFpp) GO(g_io_channel_init, vFp) GO(g_io_channel_new_file, pFppp) -GO(g_io_channel_read, iFppLp) -GO(g_io_channel_read_chars, iFpplpp) -GO(g_io_channel_read_line, iFppppp) -GO(g_io_channel_read_line_string, iFpppp) -GO(g_io_channel_read_to_end, iFpppp) -GO(g_io_channel_read_unichar, iFppp) +GO(g_io_channel_read, uFppLp) +GO(g_io_channel_read_chars, uFppLpp) +GO(g_io_channel_read_line, uFppppp) +GO(g_io_channel_read_line_string, uFpppp) +GO(g_io_channel_read_to_end, uFpppp) +GO(g_io_channel_read_unichar, uFppp) GO(g_io_channel_ref, pFp) -GO(g_io_channel_seek, iFpIi) -GO(g_io_channel_seek_position, iFpIip) +GO(g_io_channel_seek, uFplu) +GO(g_io_channel_seek_position, uFplup) GO(g_io_channel_set_buffered, vFpi) GO(g_io_channel_set_buffer_size, vFpL) GO(g_io_channel_set_close_on_unref, vFpi) -GO(g_io_channel_set_encoding, iFppp) -GO(g_io_channel_set_flags, iFpip) +GO(g_io_channel_set_encoding, uFppp) +GO(g_io_channel_set_flags, uFpup) GO(g_io_channel_set_line_term, vFppi) -GO(g_io_channel_shutdown, iFpip) +GO(g_io_channel_shutdown, uFpip) GO(g_io_channel_unix_get_fd, iFp) GO(g_io_channel_unix_new, pFi) GO(g_io_channel_unref, vFp) -GO(g_io_channel_write, iFppLp) -GO(g_io_channel_write_chars, iFpplpp) -GO(g_io_channel_write_unichar, iFpup) -GO(g_io_create_watch, pFpp) -GO(g_key_file_error_quark, pFv) +GO(g_io_channel_write, uFppLp) +GO(g_io_channel_write_chars, uFpplpp) +GO(g_io_channel_write_unichar, uFpup) +GO(g_io_create_watch, pFpu) +GO(g_key_file_error_quark, uFv) GO(g_key_file_free, vFp) GO(g_key_file_get_boolean, iFpppp) GO(g_key_file_get_boolean_list, pFppppp) @@ -557,7 +559,7 @@ GO(g_key_file_set_double_list, vFppppL) GO(g_key_file_set_int64, vFpppl) GO(g_key_file_set_integer, vFpppi) GO(g_key_file_set_integer_list, vFppppL) -GO(g_key_file_set_list_separator, vFpC) +GO(g_key_file_set_list_separator, vFpc) GO(g_key_file_set_locale_string, vFppppp) GO(g_key_file_set_locale_string_list, vFpppppL) GO(g_key_file_set_string, vFpppp) @@ -574,7 +576,7 @@ GO(g_list_alloc, pFv) GO(g_list_append, pFpp) GO(g_list_concat, pFpp) GO(g_list_copy, pFp) -//GOM(g_list_copy_deep, pFEpBp) +//GOM(g_list_copy_deep, pFEppp) GO(g_list_delete_link, pFpp) GO(g_listenv, pFv) GO(g_list_find, pFpp) @@ -594,10 +596,10 @@ GO(g_list_length, uFp) GO(g_list_nth, pFpu) GO(g_list_nth_data, pFpu) GO(g_list_nth_prev, pFpu) -//GO(g_list_pop_allocator, +GO(g_list_pop_allocator, vFv) GO(g_list_position, iFpp) GO(g_list_prepend, pFpp) -//GO(g_list_push_allocator, +GO(g_list_push_allocator, vFp) GO(g_list_remove, pFpp) GO(g_list_remove_all, pFpp) GO(g_list_remove_link, pFpp) @@ -613,9 +615,12 @@ GO(g_log_set_always_fatal, iFi) GOM(g_log_set_default_handler, pFEpp) GO(g_log_set_fatal_mask, iFpi) GOM(g_log_set_handler, uFEpipp) +GOM(g_log_set_writer_func, vFEppp) +GO(g_log_writer_default, iFipLp) GO(g_log_writer_is_journald, iFi) GOM(g_logv, vFEpipA) GO(g_log_structured_array, vFipL) +GOM(g_log_structured_standard, vFEpuppppV) GO(g_lstat, iFpp) GO(g_main_context_acquire, iFp) GO(g_main_context_add_poll, vFppi) @@ -623,12 +628,12 @@ GO(g_main_context_check, iFpipi) GO(g_main_context_default, pFv) GO(g_main_context_dispatch, vFp) //GOM(g_main_context_find_source_by_funcs_user_data, pFEppp) // 2nd is a GSourceFuncs structures with callbacks.. -GO(g_main_context_find_source_by_id, pFpu) -GO(g_main_context_find_source_by_user_data, pFpp) +GO(g_main_context_find_source_by_id, pFpu) // sould wrap? +GO(g_main_context_find_source_by_user_data, pFpp) // sould wrap? GOM(g_main_context_get_poll_func, pFEp) GO(g_main_context_get_thread_default, pFv) -//GOM(g_main_context_invoke, vFppp) // 2nd is GSourceFuncs -//GOM(g_main_context_invoke_full, vFpippB) // 3rd is GSourceFuncs +GOM(g_main_context_invoke, vFppp) // 2nd is GSourceFuncs +//GOM(g_main_context_invoke_full, vFpippp) // 3rd is GSourceFuncs GO(g_main_context_is_owner, iFp) GO(g_main_context_iteration, iFpi) GO(g_main_context_new, pFv) @@ -666,8 +671,8 @@ GO(g_mapped_file_new, pFpip) GO(g_mapped_file_new_from_fd, pFiip) GO(g_mapped_file_ref, pFp) GO(g_mapped_file_unref, vFp) -//GO(g_markup_collect_attributes, -//GO(g_markup_error_quark, +//GOM(g_markup_collect_attributes, iFppppupV) +GO(g_markup_error_quark, uFv) GO(g_markup_escape_text, pFpl) GO(g_markup_parse_context_end_parse, iFpp) GO(g_markup_parse_context_free, vFp) @@ -675,12 +680,12 @@ GO(g_markup_parse_context_get_element, pFp) GO(g_markup_parse_context_get_element_stack, pFp) GO(g_markup_parse_context_get_position, vFppp) GO(g_markup_parse_context_get_user_data, pFp) -GOM(g_markup_parse_context_new, pFEpipp) +GOM(g_markup_parse_context_new, pFEpupp) GO(g_markup_parse_context_parse, iFpplp) -//GO(g_markup_parse_context_pop, -//GO(g_markup_parse_context_push, +GO(g_markup_parse_context_pop, pFp) +GO(g_markup_parse_context_push, vFppp) GO(g_markup_parse_context_ref, pFp) -//GO(g_markup_parse_context_unref, +GO(g_markup_parse_context_unref, vFp) GOM(g_markup_printf_escaped, pFEpV) GOM(g_markup_vprintf_escaped, pFEpA) GO(g_match_info_expand_references, pFppp) @@ -698,19 +703,20 @@ GO(g_match_info_matches, iFp) GO(g_match_info_next, iFpp) GO(g_match_info_ref, pFp) GO(g_match_info_unref, vFp) -//GO(g_mem_chunk_alloc, +GO(g_mem_chunk_alloc, pFp) GO(g_mem_chunk_alloc0, pFp) -//GO(g_mem_chunk_clean, -//GO(g_mem_chunk_destroy, +GO(g_mem_chunk_clean, vFp) +GO(g_mem_chunk_destroy, vFp) GO(g_mem_chunk_free, vFpp) -//GO(g_mem_chunk_info, +GO(g_mem_chunk_info, vFv) GO(g_mem_chunk_new, pFpiLi) GO(g_mem_chunk_print, vFp) -//GO(g_mem_chunk_reset, +GO(g_mem_chunk_reset, vFp) GO(g_memdup, pFpu) +GO(g_memdup2, pFpL) GO(g_mem_is_system_malloc, iFv) GO(g_mem_profile, vFv) -//GOM(g_mem_set_vtable, vFEp) // VMemTable needs wrapping +//GOM(g_mem_set_vtable, vFEp) GO(g_mkdir, iFpi) GO(g_mkdir_with_parents, iFpi) GO(g_mkdtemp, pFp) @@ -726,32 +732,32 @@ GO(g_mutex_trylock, iFp) GO(g_mutex_unlock, vFp) GO(g_node_child_index, iFpp) GO(g_node_child_position, iFpp) -//GO(g_node_children_foreach, -//GO(g_node_copy, +//GOM(g_node_children_foreach, vFpupp) +GO(g_node_copy, pFp) GOM(g_node_copy_deep, pFEppp) -//GO(g_node_depth, +GO(g_node_depth, uFp) GO(g_node_destroy, vFp) GO(g_node_find, pFpuup) GO(g_node_find_child, pFpup) -//GO(g_node_first_sibling, +GO(g_node_first_sibling, pFp) GO(g_node_get_root, pFp) GO(g_node_insert, pFpip) GO(g_node_insert_after, pFppp) GO(g_node_insert_before, pFppp) GO(g_node_is_ancestor, iFpp) -//GO(g_node_last_child, +GO(g_node_last_child, pFp) GO(g_node_last_sibling, pFp) -//GO(g_node_max_height, +GO(g_node_max_height, uFp) GO(g_node_n_children, uFp) GO(g_node_new, pFp) GO(g_node_n_nodes, uFpu) GO(g_node_nth_child, pFpu) -//GO(g_node_pop_allocator, +GO(g_node_pop_allocator, vFv) GO(g_node_prepend, pFpp) GO(g_node_push_allocator, vFp) -//GO(g_node_reverse_children, -GOM(g_node_traverse, vFEpiiipp) -//GO(g_node_unlink, +GO(g_node_reverse_children, vFp) +GOM(g_node_traverse, vFEpuuipp) +GO(g_node_unlink, vFp) GO(g_nullify_pointer, vFp) GOM(g_once_impl, pFEppp) GO(g_once_init_enter, iFp) @@ -761,7 +767,7 @@ GO(g_once_init_leave, vFpL) GO(g_once_init_leave_pointer, vFpp) GO(g_on_error_query, vFp) GO(g_on_error_stack_trace, vFp) -GO(g_open, iFpii) +GO(g_open, iFpOi) GO(g_option_context_add_group, vFpp) GOM(g_option_context_add_main_entries, vFEppp) GO(g_option_context_free, vFp) @@ -781,16 +787,16 @@ GO(g_option_context_set_ignore_unknown_options, vFpi) GO(g_option_context_set_main_group, vFpp) GO(g_option_context_set_strict_posix, vFpi) // 2.44+ GO(g_option_context_set_summary, vFpp) -//GOM(g_option_context_set_translate_func, vFEpBpB) +//GOM(g_option_context_set_translate_func, vFEpppp) GO(g_option_context_set_translation_domain, vFpp) -GO(g_option_error_quark, pFv) +GO(g_option_error_quark, uFv) GO(g_option_group_add_entries, vFpp) GO(g_option_group_free, vFp) GOM(g_option_group_new, pFEppppp) GO(g_option_group_ref, pFp) // 2.44+ -//GOM(g_option_group_set_error_hook, vFEpB) +//GOM(g_option_group_set_error_hook, vFEpp) GOM(g_option_group_set_parse_hooks, vFEppp) -//GOM(g_option_group_set_translate_func, vFEpBpB) +//GOM(g_option_group_set_translate_func, vFEpppp) GO(g_option_group_set_translation_domain, vFpp) GO(g_option_group_unref, vFp) // 2.44+ GO(g_parse_debug_string, uFppu) @@ -804,11 +810,11 @@ GO(g_pattern_match_string, iFpp) GO(g_pattern_spec_equal, iFpp) GO(g_pattern_spec_free, vFp) GO(g_pattern_spec_new, pFp) -//GO(g_pointer_bit_lock, +GO(g_pointer_bit_lock, vFpi) GO(g_pointer_bit_trylock, iFpi) GO(g_pointer_bit_unlock, vFpi) GO(g_poll, iFpui) -//GO(g_prefix_error, vFpppppppppp) //vaarg, should align? +//GOM(g_prefix_error, vFppV) GOM(g_print, vFEpV) GOM(g_printerr, vFEpV) GOM(g_printf, iFEpV) @@ -818,16 +824,18 @@ GOM(g_private_new, pFEp) GO(g_private_replace, vFpp) GO(g_private_set, vFpp) GO(g_propagate_error, vFpp) -//GO(g_propagate_prefixed_error, vFpppppppppppp) //vaarg, should align? +GOM(g_propagate_prefixed_error, vFpppV) GO(g_ptr_array_add, vFpp) +GO(g_ptr_array_extend_and_steal, vFpp) GOM(g_ptr_array_foreach, vFEppp) +GOM(g_ptr_array_find_with_equal_func, iFEpppp) GO(g_ptr_array_free, pFpi) GO(g_ptr_array_insert, vFpip) GO(g_ptr_array_new, pFv) GOM(g_ptr_array_new_full, pFEup) GOM(g_ptr_array_new_with_free_func, pFEp) GO(g_ptr_array_ref, pFp) -GO(g_ptr_array_remove, vFpp) +GO(g_ptr_array_remove, iFpp) GO(g_ptr_array_remove_fast, iFpp) GO(g_ptr_array_remove_index, pFpu) GO(g_ptr_array_remove_index_fast, pFpu) @@ -844,14 +852,14 @@ GO(g_quark_from_string, uFp) GO(g_quark_to_string, pFu) GO(g_quark_try_string, uFp) GO(g_queue_clear, vFp) -//GOM(g_queue_clear_full, vFEpB) // 2.60+ +//GOM(g_queue_clear_full, vFEpp) // 2.60+ GO(g_queue_copy, pFp) GO(g_queue_delete_link, vFpp) GO(g_queue_find, pFpp) GOM(g_queue_find_custom, pFEppp) GOM(g_queue_foreach, vFEppp) GO(g_queue_free, vFp) -//GOM(g_queue_free_full, vFEpB) +GOM(g_queue_free_full, vFEpp) GO(g_queue_get_length, uFp) GO(g_queue_index, iFpp) GO(g_queue_init, vFp) @@ -859,7 +867,7 @@ GO(g_queue_insert_after, vFppp) GO(g_queue_insert_after_link, vFppp) // 2.62+ GO(g_queue_insert_before, vFppp) GO(g_queue_insert_before_link, vFppp) // 2.62+ -//GOM(g_queue_insert_sorted, vFEppBp) +GOM(g_queue_insert_sorted, vFEpppp) GO(g_queue_is_empty, iFp) GO(g_queue_link_index, iFpp) GO(g_queue_new, pFv) @@ -883,8 +891,8 @@ GO(g_queue_push_tail, vFpp) GO(g_queue_push_tail_link, vFpp) GO(g_queue_remove, iFpp) GO(g_queue_remove_all, uFpp) -GO(g_queue_reverse, pFp) -//GOM(g_queue_sort, vFEpBp) +GO(g_queue_reverse, vFp) +//GOM(g_queue_sort, vFEppp) GO(g_queue_unlink, vFpp) GO(g_rand_copy, pFp) GO(g_rand_double, dFp) @@ -910,7 +918,7 @@ GO(g_rec_mutex_lock, vFp) GO(g_rec_mutex_trylock, iFp) GO(g_rec_mutex_unlock, vFp) GO(g_regex_check_replacement, iFppp) -//GO(g_regex_error_quark, +GO(g_regex_error_quark, uFv) GO(g_regex_escape_nul, pFpi) GO(g_regex_escape_string, pFpi) GO(g_regex_get_capture_count, iFp) @@ -921,108 +929,108 @@ GO(g_regex_get_max_backref, iFp) GO(g_regex_get_max_lookbehind, iFp) GO(g_regex_get_pattern, pFp) GO(g_regex_get_string_number, iFpp) -GO(g_regex_match, iFppip) +GO(g_regex_match, iFppup) GO(g_regex_match_all, iFppup) GO(g_regex_match_all_full, iFppliupp) -GO(g_regex_match_full, iFppLiipp) +GO(g_regex_match_full, iFppliupp) GO(g_regex_match_simple, iFppuu) GO(g_regex_new, pFpuup) GO(g_regex_ref, pFp) -GO(g_regex_replace, pFppLipip) -//GOM(g_regex_replace_eval, pFEppLiiBpp) +GO(g_regex_replace, pFpplipup) +//GOM(g_regex_replace_eval, pFEppliuppp) GO(g_regex_replace_literal, pFpplipup) GO(g_regex_split, pFppu) GO(g_regex_split_full, pFppliuip) GO(g_regex_split_simple, pFppuu) GO(g_regex_unref, vFp) GO(g_relation_count, iFppi) -//GO(g_relation_delete, -//GO(g_relation_destroy, -//GO(g_relation_exists, -//GO(g_relation_index, -//GO(g_relation_insert, +GO(g_relation_delete, iFppi) +GO(g_relation_destroy, vFp) +//GOM(g_relation_exists, iFpV) +//GOM(g_relation_index, vFpipp) +//GOM(g_relation_insert, vFpV) GO(g_relation_new, pFi) GO(g_relation_print, vFp) GO(g_relation_select, pFppi) -//GO(g_reload_user_special_dirs_cache, +GO(g_reload_user_special_dirs_cache, vFv) GO(g_remove, iFp) GO(g_rename, iFpp) GO(g_return_if_fail_warning, vFppp) GO(g_rmdir, iFp) -//GO(g_rw_lock_clear, -//GO(g_rw_lock_init, -//GO(g_rw_lock_reader_lock, +GO(g_rw_lock_clear, vFp) +GO(g_rw_lock_init, vFp) +GO(g_rw_lock_reader_lock, vFp) GO(g_rw_lock_reader_trylock, iFp) GO(g_rw_lock_reader_unlock, vFp) -//GO(g_rw_lock_writer_lock, -//GO(g_rw_lock_writer_trylock, -//GO(g_rw_lock_writer_unlock, -//GO(g_scanner_cur_line, -//GO(g_scanner_cur_position, -//GO(g_scanner_cur_token, -//GO(g_scanner_cur_value, -//GO(g_scanner_destroy, -//GO(g_scanner_eof, -//GO(g_scanner_error, -//GO(g_scanner_get_next_token, -//GO(g_scanner_input_file, -//GO(g_scanner_input_text, -//GO(g_scanner_lookup_symbol, -//GO(g_scanner_new, -//GO(g_scanner_peek_next_token, -//GO(g_scanner_scope_add_symbol, -//GO(g_scanner_scope_foreach_symbol, -//GO(g_scanner_scope_lookup_symbol, -//GO(g_scanner_scope_remove_symbol, -//GO(g_scanner_set_scope, -//GO(g_scanner_sync_file_offset, -//GO(g_scanner_unexp_token, -//GO(g_scanner_warn, -//GO(g_sequence_append, -//GO(g_sequence_foreach, -//GO(g_sequence_foreach_range, -//GO(g_sequence_free, +GO(g_rw_lock_writer_lock, vFp) +GO(g_rw_lock_writer_trylock, iFp) +GO(g_rw_lock_writer_unlock, vFp) +//GOM(g_scanner_cur_line, uFp) +//GOM(g_scanner_cur_position, uFp) +//GOM(g_scanner_cur_token, uFp) +//GOM(g_scanner_cur_value, UFp) +//GOM(g_scanner_destroy, vFp) +//GOM(g_scanner_eof, iFp) +//GOM(g_scanner_error, vFppV) +//GOM(g_scanner_get_next_token, uFp) +//GOM(g_scanner_input_file, vFpi) +//GOM(g_scanner_input_text, vFppu) +//GOM(g_scanner_lookup_symbol, pFpp) +//GOM(g_scanner_new, pFp) +//GOM(g_scanner_peek_next_token, uFp) +//GOM(g_scanner_scope_add_symbol, vFpupp) +//GOM(g_scanner_scope_foreach_symbol, vFpupp) +//GOM(g_scanner_scope_lookup_symbol, pFpup) +//GOM(g_scanner_scope_remove_symbol, vFpup) +//GOM(g_scanner_set_scope, uFpu) +//GOM(g_scanner_sync_file_offset, vFp) +//GOM(g_scanner_unexp_token, vFpuppppi) +//GOM(g_scanner_warn, vFppV) +GO(g_sequence_append, pFpp) +//GOM(g_sequence_foreach, vFppp) +//GOM(g_sequence_foreach_range, vFpppp) +GO(g_sequence_free, vFp) GO(g_sequence_get, pFp) -//GO(g_sequence_get_begin_iter, +GO(g_sequence_get_begin_iter, pFp) GO(g_sequence_get_end_iter, pFp) GO(g_sequence_get_iter_at_pos, pFpi) GO(g_sequence_get_length, iFp) GO(g_sequence_insert_before, pFpp) -//GO(g_sequence_insert_sorted, -//GO(g_sequence_insert_sorted_iter, +GOM(g_sequence_insert_sorted, pFEpppp) +//GOM(g_sequence_insert_sorted_iter, pFpppp) GO(g_sequence_iter_compare, iFpp) GO(g_sequence_iter_get_position, iFp) GO(g_sequence_iter_get_sequence, pFp) -//GO(g_sequence_iter_is_begin, +GO(g_sequence_iter_is_begin, iFp) GO(g_sequence_iter_is_end, iFp) GO(g_sequence_iter_move, pFpi) -//GO(g_sequence_iter_next, +GO(g_sequence_iter_next, pFp) GO(g_sequence_iter_prev, pFp) -//GO(g_sequence_lookup, -//GO(g_sequence_lookup_iter, -//GO(g_sequence_move, +GOM(g_sequence_lookup, pFEpppp) +//GOM(g_sequence_lookup_iter, pFpppp) +GO(g_sequence_move, vFpp) GO(g_sequence_move_range, vFppp) -//GO(g_sequence_new, +GOM(g_sequence_new, pFEp) GO(g_sequence_prepend, pFpp) GO(g_sequence_range_get_midpoint, pFpp) GO(g_sequence_remove, vFp) GO(g_sequence_remove_range, vFpp) -//GO(g_sequence_search, -//GO(g_sequence_search_iter, +//GOM(g_sequence_search, pFpppp) +//GOM(g_sequence_search_iter, pFpppp) GO(g_sequence_set, vFpp) -//GO(g_sequence_sort, -//GO(g_sequence_sort_changed, -//GO(g_sequence_sort_changed_iter, -//GO(g_sequence_sort_iter, -//GO(g_sequence_swap, +//GOM(g_sequence_sort, vFppp) +//GOM(g_sequence_sort_changed, vFppp) +//GOM(g_sequence_sort_changed_iter, vFppp) +//GOM(g_sequence_sort_iter, vFppp) +GO(g_sequence_swap, vFpp) GO(g_set_application_name, vFp) GO(g_setenv, iFppi) -GOM(g_set_error, vFEppipV) +GOM(g_set_error, vFEpuipV) GO(g_set_error_literal, vFpuip) GO(g_set_prgname, vFp) GOM(g_set_printerr_handler, pFEp) GOM(g_set_print_handler, pFEp) -//GO(g_shell_error_quark, +GO(g_shell_error_quark, uFv) GO(g_shell_parse_argv, iFpppp) GO(g_shell_quote, pFp) GO(g_shell_unquote, pFpp) @@ -1038,11 +1046,11 @@ GO(g_slist_alloc, pFv) GO(g_slist_append, pFpp) GO(g_slist_concat, pFpp) GO(g_slist_copy, pFp) -//GOM(g_slist_copy_deep, pFEppp) +GOM(g_slist_copy_deep, pFEppp) GO(g_slist_delete_link, pFpp) GO(g_slist_find, pFpp) GOM(g_slist_find_custom, pFEppp) -GOM(g_slist_foreach, pFEppp) +GOM(g_slist_foreach, vFEppp) GO(g_slist_free, vFp) GO(g_slist_free_1, vFp) GOM(g_slist_free_full, vFEpp) @@ -1055,10 +1063,10 @@ GO(g_slist_last, pFp) GO(g_slist_length, uFp) GO(g_slist_nth, pFpu) GO(g_slist_nth_data, pFpu) -//GO(g_slist_pop_allocator, +GO(g_slist_pop_allocator, vFv) GO(g_slist_position, iFpp) GO(g_slist_prepend, pFpp) -//GO(g_slist_push_allocator, +GO(g_slist_push_allocator, vFp) GO(g_slist_remove, pFpp) GO(g_slist_remove_all, pFpp) GO(g_slist_remove_link, pFpp) @@ -1066,9 +1074,9 @@ GO(g_slist_reverse, pFp) GOM(g_slist_sort, pFEpp) GOM(g_slist_sort_with_data, pFEppp) GOM(g_snprintf, iFEpLpV) -GO(g_source_add_child_source, vFpp) +GO(g_source_add_child_source, vFpp) //should wrap? GO(g_source_add_poll, vFpp) -GO(g_source_add_unix_fd, pFpii) +GO(g_source_add_unix_fd, pFpiu) GO(g_source_attach, uFpp) GO(g_source_destroy, vFp) GO(g_source_get_can_recurse, iFp) @@ -1077,12 +1085,12 @@ GO(g_source_get_current_time, vFpp) GO(g_source_get_id, uFp) GO(g_source_get_name, pFp) GO(g_source_get_priority, iFp) -GO(g_source_get_ready_time, IFp) -GO(g_source_get_time, IFp) +GO(g_source_get_ready_time, lFp) +GO(g_source_get_time, lFp) GO(g_source_is_destroyed, iFp) -GO(g_source_modify_unix_fd, vFppi) +GO(g_source_modify_unix_fd, vFppu) GOM(g_source_new, pFEpu) -GO(g_source_query_unix_fd, iFpp) +GO(g_source_query_unix_fd, uFpp) GO(g_source_ref, pFp) GO(g_source_remove, iFu) GOM(g_source_remove_by_funcs_user_data, iFEpp) @@ -1091,24 +1099,24 @@ GO(g_source_remove_child_source, vFpp) GO(g_source_remove_poll, vFpp) GO(g_source_remove_unix_fd, vFpp) GOM(g_source_set_callback, vFEpppp) -//GOM(g_source_set_callback_indirect, vFEppB) +//GOM(g_source_set_callback_indirect, vFEppp) GO(g_source_set_can_recurse, vFpi) GOM(g_source_set_funcs, vFEpp) GO(g_source_set_name, vFpp) GO(g_source_set_name_by_id, vFup) GO(g_source_set_priority, vFpi) -GO(g_source_set_ready_time, vFpI) +GO(g_source_set_ready_time, vFpl) GO(g_source_unref, vFp) GO(g_spaced_primes_closest, uFu) -GOM(g_spawn_async, iFEpppipppp) -GOM(g_spawn_async_with_pipes, iFEpppippppppp) +GOM(g_spawn_async, iFEpppupppp) +GOM(g_spawn_async_with_pipes, iFEpppuppppppp) GO(g_spawn_check_exit_status, iFip) GO(g_spawn_close_pid, vFi) GO(g_spawn_command_line_async, iFpp) GO(g_spawn_command_line_sync, iFppppp) -GO(g_spawn_error_quark, pFv) -GO(g_spawn_exit_error_quark, pFv) -GOM(g_spawn_sync, iFEpppipppppp) +GO(g_spawn_error_quark, uFv) +GO(g_spawn_exit_error_quark, uFv) +GOM(g_spawn_sync, iFEpppupppppp) GOM(g_sprintf, iFEppV) GO(g_stat, iFpp) GO(g_static_mutex_free, vFp) @@ -1134,14 +1142,14 @@ GO(g_static_rw_lock_writer_lock, vFp) GO(g_static_rw_lock_writer_trylock, iFp) GO(g_static_rw_lock_writer_unlock, vFp) GO(g_stpcpy, pFpp) -GO(g_strcanon, pFppC) +GO(g_strcanon, pFppc) GO(g_strcasecmp, iFpp) GO(g_strchomp, pFp) GO(g_strchug, pFp) GO(g_strcmp0, iFpp) GO(g_strcompress, pFp) GOM(g_strconcat, pFEpV) //vaarg, no va_list equivalent... -GO(g_strdelimit, pFppC) +GO(g_strdelimit, pFppc) GO(g_strdown, pFp) GO(g_strdup, pFp) GOM(g_strdup_printf, pFEpV) @@ -1155,7 +1163,7 @@ GO(g_str_hash, uFp) GO(g_str_has_prefix, iFpp) GO(g_str_has_suffix, iFpp) GO(g_string_append, pFpp) -GO(g_string_append_c, pFpC) +GO(g_string_append_c, pFpc) GO(g_string_append_len, pFppl) GOM(g_string_append_printf, vFEppV) GO(g_string_append_unichar, pFpu) @@ -1174,10 +1182,11 @@ GO(g_string_down, pFp) GO(g_string_equal, iFpp) GO(g_string_erase, pFpll) GO(g_string_free, pFpi) +GO(g_string_free_and_steal, pFp) GO(g_string_free_to_bytes, pFp) GO(g_string_hash, uFp) GO(g_string_insert, pFplp) -GO(g_string_insert_c, pFplC) +GO(g_string_insert_c, pFplc) GO(g_string_insert_len, pFplpl) GO(g_string_insert_unichar, pFplu) GO(g_string_new, pFp) @@ -1185,10 +1194,11 @@ GO(g_string_new_len, pFpl) GO(g_string_overwrite, pFpLp) GO(g_string_overwrite_len, pFpLpl) GO(g_string_prepend, pFpp) -GO(g_string_prepend_c, pFpC) +GO(g_string_prepend_c, pFpc) GO(g_string_prepend_len, pFppl) GO(g_string_prepend_unichar, pFpu) GOM(g_string_printf, vFEppV) +GO(g_string_replace, uFpppu) GO(g_string_set_size, pFpL) GO(g_string_sized_new, pFL) GO(g_string_truncate, pFpL) @@ -1199,99 +1209,99 @@ GO(g_str_is_ascii, iFp) GOM(g_strjoin, pFEpV) GOM(g_strjoinv, pFEpp) GO(g_strlcat, LFppL) -GO(g_strlcpy, uFppu) +GO(g_strlcpy, LFppL) GO(g_str_match_string, iFppi) GO(g_strncasecmp, iFppu) GO(g_strndup, pFpL) -GO(g_strnfill, pFLC) +GO(g_strnfill, pFLc) GO(g_strreverse, pFp) GO(g_strrstr, pFpp) GO(g_strrstr_len, pFplp) GO(g_strsignal, pFi) GO(g_strsplit, pFppi) GO(g_strsplit_set, pFppi) -GO(g_strstr_len, pFpip) +GO(g_strstr_len, pFplp) GO(g_str_to_ascii, pFpp) GO(g_strtod, dFpp) GO(g_str_tokenize_and_fold, pFppp) GO(g_strup, pFp) GO(g_strv_contains, iFpp) GO(g_strv_length, uFp) -//GO(g_test_add_data_func, -//GO(g_test_add_data_func_full, -//GO(g_test_add_func, -//GO(g_test_add_vtable, +//GOM(g_test_add_data_func, vFppp) +//GOM(g_test_add_data_func_full, vFpppp) +//GOM(g_test_add_func, vFpp) +//GOM(g_test_add_vtable, vFpLpppp) GO(g_test_assert_expected_messages_internal, vFppip) -//GO(g_test_bug, -//GO(g_test_bug_base, -//GO(g_test_build_filename, -//GO(g_test_create_case, +GO(g_test_bug, vFp) +GO(g_test_bug_base, vFp) +//GOM(g_test_build_filename, pFupV) +//GOM(g_test_create_case, pFpLpppp) GO(g_test_create_suite, pFp) GO(g_test_expect_message, vFpip) -//GO(g_test_fail, -//GO(g_test_failed, +GO(g_test_fail, vFv) +GO(g_test_failed, iFv) GO(g_test_get_dir, pFu) -//GO(g_test_get_filename, +//GOM(g_test_get_filename, pFupV) GO(g_test_get_root, pFv) -//GO(g_test_incomplete, -//GO(g_test_init, +GO(g_test_incomplete, vFp) +//GOM(g_test_init, vFppV) GO(g_test_log_buffer_free, vFp) GO(g_test_log_buffer_new, pFv) GO(g_test_log_buffer_pop, pFp) GO(g_test_log_buffer_push, vFpup) GO(g_test_log_msg_free, vFp) -//GO(g_test_log_set_fatal_handler, +//GOM(g_test_log_set_fatal_handler, vFpp) GO(g_test_log_type_name, pFu) -//GO(g_test_maximized_result, -//GO(g_test_message, -//GO(g_test_minimized_result, -//GO(g_test_queue_destroy, -//GO(g_test_queue_free, +//GOM(g_test_maximized_result, vFdpV) +//GOM(g_test_message, vFpV) +//GOM(g_test_minimized_result, vFdpV) +//GOM(g_test_queue_destroy, vFpp) +GO(g_test_queue_free, vFp) GO(g_test_rand_double, dFv) GO(g_test_rand_double_range, dFdd) GO(g_test_rand_int, iFv) GO(g_test_rand_int_range, iFii) -//GO(g_test_run, +GO(g_test_run, iFv) GO(g_test_run_suite, iFp) -//GO(g_test_set_nonfatal_assertions, +GO(g_test_set_nonfatal_assertions, vFv) GO(g_test_skip, vFp) -//GO(g_test_subprocess, +GO(g_test_subprocess, iFv) GO(g_test_suite_add, vFpp) GO(g_test_suite_add_suite, vFpp) -//GO(g_test_timer_elapsed, -//GO(g_test_timer_last, -//GO(g_test_timer_start, +GO(g_test_timer_elapsed, dFv) +GO(g_test_timer_last, dFv) +GO(g_test_timer_start, vFv) GO(g_test_trap_assertions, vFppipLp) GO(g_test_trap_fork, iFLu) -//GO(g_test_trap_has_passed, -//GO(g_test_trap_reached_timeout, +GO(g_test_trap_has_passed, iFv) +GO(g_test_trap_reached_timeout, iFv) GO(g_test_trap_subprocess, vFpLu) GOM(g_thread_create, pFEppip) -GOM(g_thread_create_full, pFEppLiiip) -GO(g_thread_error_quark, pFv) +GOM(g_thread_create_full, pFEppLiiup) +GO(g_thread_error_quark, uFv) GO(g_thread_exit, vFp) GOM(g_thread_foreach, vFEpp) GO(g_thread_get_initialized, iFv) //GO(g_thread_init_glib, GO(g_thread_join, pFp) GOM(g_thread_new, pFEppp) -//GO(g_thread_pool_free, +GO(g_thread_pool_free, vFpii) GO(g_thread_pool_get_max_idle_time, uFv) -//GO(g_thread_pool_get_max_threads, +GO(g_thread_pool_get_max_threads, iFp) GO(g_thread_pool_get_max_unused_threads, iFv) -//GO(g_thread_pool_get_num_threads, -//GO(g_thread_pool_get_num_unused_threads, -//GO(g_thread_pool_new, -//GO(g_thread_pool_push, +GO(g_thread_pool_get_num_threads, uFp) +GO(g_thread_pool_get_num_unused_threads, uFv) +GOM(g_thread_pool_new, pFEppiip) +GO(g_thread_pool_push, iFppp) GO(g_thread_pool_set_max_idle_time, vFu) -//GO(g_thread_pool_set_max_threads, +GO(g_thread_pool_set_max_threads, iFpip) GO(g_thread_pool_set_max_unused_threads, vFi) -//GO(g_thread_pool_set_sort_function, -//GO(g_thread_pool_stop_unused_threads, -//GO(g_thread_pool_unprocessed, +GOM(g_thread_pool_set_sort_function, vFEppp) +GO(g_thread_pool_stop_unused_threads, vFv) +GO(g_thread_pool_unprocessed, uFp) GO(g_thread_ref, pFp) GO(g_thread_self, pFv) -GO(g_thread_set_priority, vFpi) +GO(g_thread_set_priority, vFpu) GOM(g_thread_try_new, pFEpppp) GO(g_thread_unref, vFp) GO(g_thread_yield, vFv) @@ -1301,13 +1311,13 @@ GOM(g_timeout_add_seconds, uFEupp) GOM(g_timeout_add_seconds_full, uFEiuppp) GO(g_timeout_source_new, pFu) GO(g_timeout_source_new_seconds, pFu) -//GO(g_timer_continue, -//GO(g_timer_destroy, +GO(g_timer_continue, vFp) +GO(g_timer_destroy, vFp) GO(g_timer_elapsed, dFpp) GO(g_timer_new, pFv) -//GO(g_timer_reset, -//GO(g_timer_start, -//GO(g_timer_stop, +GO(g_timer_reset, vFp) +GO(g_timer_start, vFp) +GO(g_timer_stop, vFp) GO(g_time_val_add, vFpl) GO(g_time_val_from_iso8601, iFpp) GO(g_time_val_to_iso8601, pFp) @@ -1316,32 +1326,32 @@ GO(g_time_zone_find_interval, iFpul) GO(g_time_zone_get_abbreviation, pFpi) GO(g_time_zone_get_offset, iFpi) GO(g_time_zone_is_dst, iFpi) -//GO(g_time_zone_new, +GO(g_time_zone_new, pFp) GO(g_time_zone_new_local, pFv) -//GO(g_time_zone_new_utc, +GO(g_time_zone_new_utc, pFv) GO(g_time_zone_ref, pFp) -//GO(g_time_zone_unref, +GO(g_time_zone_unref, vFp) GO(g_trash_stack_height, uFp) GO(g_trash_stack_peek, pFp) GO(g_trash_stack_pop, pFp) GO(g_trash_stack_push, vFpp) -//GO(g_tree_destroy, -//GO(g_tree_foreach, -//GO(g_tree_height, -//GO(g_tree_insert, +GO(g_tree_destroy, vFp) +GOM(g_tree_foreach, vFEppp) +GO(g_tree_height, iFp) +GO(g_tree_insert, vFppp) GO(g_tree_lookup, pFpp) GO(g_tree_lookup_extended, iFpppp) -//GO(g_tree_new, -//GO(g_tree_new_full, -//GO(g_tree_new_with_data, +GOM(g_tree_new, pFEp) +GOM(g_tree_new_full, pFEpppp) +//GOM(g_tree_new_with_data, pFpp) GO(g_tree_nnodes, iFp) GO(g_tree_ref, pFp) -//GO(g_tree_remove, +GO(g_tree_remove, iFpp) GO(g_tree_replace, vFppp) -//GO(g_tree_search, +//GOM(g_tree_search, pFppp) GO(g_tree_steal, iFpp) -//GO(g_tree_traverse, -//GO(g_tree_unref, +//GOM(g_tree_traverse, vFppup) +GO(g_tree_unref, vFp) GO(g_try_malloc, pFL) GO(g_try_malloc0, pFL) GO(g_try_malloc0_n, pFLL) @@ -1388,55 +1398,61 @@ GO(g_unicode_canonical_decomposition, pFup) GO(g_unicode_canonical_ordering, vFpL) GO(g_unicode_script_from_iso15924, iFu) GO(g_unicode_script_to_iso15924, uFi) -//GO(g_unix_error_quark, -//GO(g_unix_fd_add, -//GO(g_unix_fd_add_full, -GO(g_unix_fd_source_new, pFii) -//GO(g_unix_open_pipe, -//GO(g_unix_set_fd_nonblocking, -//GO(g_unix_signal_add, -//GO(g_unix_signal_add_full, -//GO(g_unix_signal_source_new, +GO(g_unix_error_quark, uFv) +GOM(g_unix_fd_add, uFEiupp) +GOM(g_unix_fd_add_full, uFEiiuppp) +GO(g_unix_fd_source_new, pFiu) +GO(g_unix_open_pipe, iFpip) +GO(g_unix_set_fd_nonblocking, iFiip) +//GOM(g_unix_signal_add, uFipp) +//GOM(g_unix_signal_add_full, uFiippp) +//GOM(g_unix_signal_source_new, pFi) GO(g_unlink, iFp) GO(g_unsetenv, vFp) GO(g_uri_escape_string, pFppi) +GO(g_uri_get_host, pFp) +GO(g_uri_get_port, iFp) +GO(g_uri_get_scheme, pFp) GO(g_uri_list_extract_uris, pFp) -GO(g_uri_parse, pFpip) +GO(g_uri_parse, pFpup) GO(g_uri_parse_scheme, pFp) -GO(g_uri_to_string_partial, pFpi) +GO(g_uri_to_string_partial, pFpu) GO(g_uri_unescape_segment, pFppp) GO(g_uri_unescape_string, pFpp) GO(g_uri_unref, vFp) GO(g_usleep, vFL) GO(g_utf16_to_ucs4, pFplppp) GO(g_utf16_to_utf8, pFplppp) -GO(g_utf8_casefold, pFpi) +GO(g_utf8_casefold, pFpl) GO(g_utf8_collate, iFpp) -GO(g_utf8_collate_key, pFpi) -GO(g_utf8_collate_key_for_filename, pFpi) +GO(g_utf8_collate_key, pFpl) +GO(g_utf8_collate_key_for_filename, pFpl) GO(g_utf8_find_next_char, pFpp) GO(g_utf8_find_prev_char, pFpp) GO(g_utf8_get_char, uFp) GO(g_utf8_get_char_validated, uFpl) +GO(g_utf8_make_valid, pFpi) GO(g_utf8_normalize, pFplu) GO(g_utf8_offset_to_pointer, pFpl) GO(g_utf8_pointer_to_offset, lFpp) GO(g_utf8_prev_char, pFp) -GO(g_utf8_strchr, pFpiu) -GO(g_utf8_strdown, pFpi) +GO(g_utf8_strchr, pFplu) +GO(g_utf8_strdown, pFpl) GO(g_utf8_strlen, lFpl) GO(g_utf8_strncpy, pFppL) GO(g_utf8_strrchr, pFplu) -GO(g_utf8_strreverse, pFpi) -GO(g_utf8_strup, pFpi) +GO(g_utf8_strreverse, pFpl) +GO(g_utf8_strup, pFpl) GO(g_utf8_substring, pFpll) GO(g_utf8_to_ucs4, pFplppp) GO(g_utf8_to_ucs4_fast, pFplp) GO(g_utf8_to_utf16, pFplppp) GO(g_utf8_validate, iFplp) -GO(g_utime, iFpp) +GO(g_utime, iFpp) // Warning: failed to confirm +GO(g_uuid_string_is_valid, iFp) +GO(g_uuid_string_random, pFv) GOM(g_variant_builder_add, vFEppV) -//GO(g_variant_builder_add_parsed, vFppppppppppp) //vaarg +//GOM(g_variant_builder_add_parsed, vFppV) GO(g_variant_builder_add_value, vFpp) GO(g_variant_builder_clear, vFp) GO(g_variant_builder_close, vFp) @@ -1454,9 +1470,9 @@ GO(g_variant_dict_clear, vFp) GO(g_variant_dict_contains, iFpp) GO(g_variant_dict_end, pFp) GO(g_variant_dict_init, vFpp) -//GO(g_variant_dict_insert, vFpppppppppppppp) //vaarg +//GOM(g_variant_dict_insert, vFpppV) GO(g_variant_dict_insert_value, vFppp) -//GO(g_variant_dict_lookup, iFppppppppppppp) //vaarg +//GOM(g_variant_dict_lookup, iFpppV) GO(g_variant_dict_lookup_value, pFppp) GO(g_variant_dict_new, pFp) GO(g_variant_dict_ref, pFp) @@ -1475,7 +1491,7 @@ GO(g_variant_get_boolean, iFp) GO(g_variant_get_byte, CFp) GO(g_variant_get_bytestring, pFp) GO(g_variant_get_bytestring_array, pFpp) -GO(g_variant_get_child, vFpuppppppppppp) //vaarg here, only pointers so should be ok +GO(g_variant_get_child, vFpLppppppppppp) //vaarg here, only pointers so should be ok GO(g_variant_get_child_value, pFpL) GO(g_variant_get_data, pFp) GO(g_variant_get_data_as_bytes, pFp) @@ -1515,7 +1531,7 @@ GO(g_variant_iter_next, iFpppppppppppp) // vaarg here, only pointers so should b GO(g_variant_iter_next_value, pFp) GO(g_variant_lookup, iFpppppppppppp) // vaarg GO(g_variant_lookup_value, pFppp) -GO(g_variant_n_children, uFp) +GO(g_variant_n_children, LFp) GOM(g_variant_new, pFEpV) GO(g_variant_new_array, pFppL) GO(g_variant_new_boolean, pFi) @@ -1526,20 +1542,20 @@ GO(g_variant_new_dict_entry, pFpp) GO(g_variant_new_double, pFd) GO(g_variant_new_fixed_array, pFppLL) GO(g_variant_new_from_bytes, pFppi) -GOM(g_variant_new_from_data, pFEppuipp) +GOM(g_variant_new_from_data, pFEppLipp) GO(g_variant_new_handle, pFi) GO(g_variant_new_int16, pFw) GO(g_variant_new_int32, pFi) GO(g_variant_new_int64, pFl) GO(g_variant_new_maybe, pFpp) GO(g_variant_new_object_path, pFp) -GO(g_variant_new_objv, pFpi) -//GO2(g_variant_new_parsed, pFEpV, my_g_variant_new_parsed_va) +GO(g_variant_new_objv, pFpl) +//GOM(g_variant_new_parsed, pFpV) GOM(g_variant_new_parsed_va, pFEpp) -//GO(g_variant_new_printf, // needs alignment..... +//GOM(g_variant_new_printf, pFpV) GO(g_variant_new_signature, pFp) GO(g_variant_new_string, pFp) -GO(g_variant_new_strv, pFpi) +GO(g_variant_new_strv, pFpl) GO(g_variant_new_take_string, pFp) GO(g_variant_new_tuple, pFpL) GO(g_variant_new_uint16, pFW) @@ -1549,8 +1565,8 @@ GOM(g_variant_new_va, pFEppp) GO(g_variant_new_variant, pFp) GO(g_variant_parse, pFppppp) GO(g_variant_parse_error_print_context, pFpp) -//GO(g_variant_parse_error_quark, -//GO(g_variant_parser_get_error_quark, +GO(g_variant_parse_error_quark, uFv) +GO(g_variant_parser_get_error_quark, uFv) GO(g_variant_print, pFpi) GO(g_variant_print_string, pFppi) GO(g_variant_ref, pFp) @@ -1569,9 +1585,9 @@ GO(g_variant_take_ref, pFp) GO(g_variant_type_checked_, pFp) GO(g_variant_type_copy, pFp) GO(g_variant_type_dup_string, pFp) -//GO(g_variant_type_element, +GO(g_variant_type_element, pFp) GO(g_variant_type_equal, iFpp) -//GO(g_variant_type_first, +GO(g_variant_type_first, pFp) GO(g_variant_type_free, vFp) GO(g_variant_type_get_string_length, LFp) GO(g_variant_type_hash, uFp) diff --git a/src/wrapped/wrappedgmodule2.c b/src/wrapped/wrappedgmodule2.c index d4233e1..f08ca25 100644 --- a/src/wrapped/wrappedgmodule2.c +++ b/src/wrapped/wrappedgmodule2.c @@ -12,21 +12,14 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* gmodule2Name = "libgmodule-2.0.so"; -#else - const char* gmodule2Name = "libgmodule-2.0.so.0"; -#endif +const char* gmodule2Name = "libgmodule-2.0.so.0"; +#define ALTNAME "libgmodule-2.0.so" + #define LIBNAME gmodule2 -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; -#ifdef ANDROID -#define NEEDED_LIBS "libglib-2.0.so" -#else #define NEEDED_LIBS "libglib-2.0.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgmodule2_private.h b/src/wrapped/wrappedgmodule2_private.h index 9aed451..bc60812 100644 --- a/src/wrapped/wrappedgmodule2_private.h +++ b/src/wrapped/wrappedgmodule2_private.h @@ -3,12 +3,12 @@ #endif //GO(_fini, -GO(g_module_build_path, pFpp) -GO(g_module_close, iFp) -GO(g_module_error, pFv) -GO(g_module_make_resident, vFp) -GO(g_module_name, pFp) -GO(g_module_open, pFpu) -GO(g_module_supported, iFv) -GO(g_module_symbol, iFppp) +//GO(g_module_build_path, pFpp) +//GO(g_module_close, iFp) +//GO(g_module_error, pFv) +//GO(g_module_make_resident, vFp) +//GO(g_module_name, pFp) +//GO(g_module_open, pFpu) +//GO(g_module_supported, iFv) +//GO(g_module_symbol, iFppp) //GO(_init, diff --git a/src/wrapped/wrappedgmp.c b/src/wrapped/wrappedgmp.c index b9a2bbe..03097bb 100644 --- a/src/wrapped/wrappedgmp.c +++ b/src/wrapped/wrappedgmp.c @@ -19,6 +19,7 @@ #include "callback.h" const char* gmpName = "libgmp.so.10"; +#define ALTNAME "libgmp.so" #define LIBNAME gmp #include "generated/wrappedgmptypes.h" diff --git a/src/wrapped/wrappedgmp_private.h b/src/wrapped/wrappedgmp_private.h index a9cf6c0..3815010 100644 --- a/src/wrapped/wrappedgmp_private.h +++ b/src/wrapped/wrappedgmp_private.h @@ -1,11 +1,11 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif // mp_bitcnt_t unsigned long int //DATA(__gmp_allocate_func, -//GO(__gmp_asprintf, +//GOM(__gmp_asprintf, iFEppV) //GO(__gmp_asprintf_final, //DATA(__gmp_asprintf_funs, //GO(__gmp_asprintf_memory, @@ -21,100 +21,100 @@ //GO(__gmp_doprnt_integer, //GO(__gmp_doprnt_mpf2, //GO(__gmp_doscan, -//DATAB(__gmp_errno, +//DATAB(__gmp_errno, 4) //GO(__gmp_exception, //GO(__gmp_extract_double, -//GO(__gmpf_abs, -//GO(__gmpf_add, -//GO(__gmpf_add_ui, -//GO(__gmpf_ceil, -//GO(__gmpf_clear, -//GO(__gmpf_clears, -//GO(__gmpf_cmp, -//GO(__gmpf_cmp_d, -//GO(__gmpf_cmp_si, -//GO(__gmpf_cmp_ui, -//GO(__gmpf_cmp_z, -//GO(__gmpf_div, -//GO(__gmpf_div_2exp, -//GO(__gmpf_div_ui, -//GO(__gmpf_dump, -//GO(__gmpf_eq, -//GO(__gmpf_fits_sint_p, -//GO(__gmpf_fits_slong_p, -//GO(__gmpf_fits_sshort_p, -//GO(__gmpf_fits_uint_p, -//GO(__gmpf_fits_ulong_p, -//GO(__gmpf_fits_ushort_p, -//GO(__gmpf_floor, -//GO(__gmpf_get_d, -//GO(__gmpf_get_d_2exp, -//GO(__gmpf_get_default_prec, -//GO(__gmpf_get_prec, -//GO(__gmpf_get_si, -//GO(__gmpf_get_str, -//GO(__gmpf_get_ui, -//GO(__gmpf_init, -//GO(__gmpf_init2, -//GO(__gmpf_inits, -//GO(__gmpf_init_set, -//GO(__gmpf_init_set_d, -//GO(__gmpf_init_set_si, -//GO(__gmpf_init_set_str, -//GO(__gmpf_init_set_ui, +GO(__gmpf_abs, vFpp) +GO(__gmpf_add, vFppp) +GO(__gmpf_add_ui, vFppL) +GO(__gmpf_ceil, vFpp) +GO(__gmpf_clear, vFp) +//GOM(__gmpf_clears, vFEpV) +GO(__gmpf_cmp, iFpp) +GO(__gmpf_cmp_d, iFpd) +GO(__gmpf_cmp_si, iFpl) +GO(__gmpf_cmp_ui, iFpL) +GO(__gmpf_cmp_z, iFpp) +GO(__gmpf_div, vFppp) +GO(__gmpf_div_2exp, vFppL) +GO(__gmpf_div_ui, vFppL) +GO(__gmpf_dump, vFp) +GO(__gmpf_eq, iFppL) +GO(__gmpf_fits_sint_p, iFp) +GO(__gmpf_fits_slong_p, iFp) +GO(__gmpf_fits_sshort_p, iFp) +GO(__gmpf_fits_uint_p, iFp) +GO(__gmpf_fits_ulong_p, iFp) +GO(__gmpf_fits_ushort_p, iFp) +GO(__gmpf_floor, vFpp) +GO(__gmpf_get_d, dFp) +GO(__gmpf_get_d_2exp, dFpp) +GO(__gmpf_get_default_prec, LFv) +GO(__gmpf_get_prec, LFp) +GO(__gmpf_get_si, lFp) +GO(__gmpf_get_str, pFppiLp) +GO(__gmpf_get_ui, LFp) +GO(__gmpf_init, vFp) +GO(__gmpf_init2, vFpL) +//GOM(__gmpf_inits, vFEpV) +GO(__gmpf_init_set, vFpp) +GO(__gmpf_init_set_d, vFpd) +GO(__gmpf_init_set_si, vFpl) +GO(__gmpf_init_set_str, iFppi) +GO(__gmpf_init_set_ui, vFpL) //GO(__gmpf_inp_str, -//GO(__gmpf_integer_p, -//GO(__gmpf_mul, -//GO(__gmpf_mul_2exp, -//GO(__gmpf_mul_ui, -//GO(__gmpf_neg, +GO(__gmpf_integer_p, iFp) +GO(__gmpf_mul, vFppp) +GO(__gmpf_mul_2exp, vFppL) +GO(__gmpf_mul_ui, vFppL) +GO(__gmpf_neg, vFpp) //GO(__gmpf_out_str, -//GO(__gmpf_pow_ui, +GO(__gmpf_pow_ui, vFppL) //GO(__gmp_fprintf, //DATA(__gmp_fprintf_funs, -//GO(__gmpf_random2, +GO(__gmpf_random2, vFpll) //DATA(__gmp_free_func, -//GO(__gmpf_reldiff, +GO(__gmpf_reldiff, vFppp) //GO(__gmp_fscanf, //DATA(__gmp_fscanf_funs, -//GO(__gmpf_set, -//GO(__gmpf_set_d, -//GO(__gmpf_set_default_prec, -//GO(__gmpf_set_prec, -//GO(__gmpf_set_prec_raw, -//GO(__gmpf_set_q, -//GO(__gmpf_set_si, -//GO(__gmpf_set_str, -//GO(__gmpf_set_ui, -//GO(__gmpf_set_z, -//GO(__gmpf_size, -//GO(__gmpf_sqrt, -//GO(__gmpf_sqrt_ui, -//GO(__gmpf_sub, -//GO(__gmpf_sub_ui, -//GO(__gmpf_swap, -//GO(__gmpf_trunc, -//GO(__gmpf_ui_div, -//GO(__gmpf_ui_sub, -//GO(__gmpf_urandomb, +GO(__gmpf_set, vFpp) +GO(__gmpf_set_d, vFpd) +GO(__gmpf_set_default_prec, vFL) +GO(__gmpf_set_prec, vFpL) +GO(__gmpf_set_prec_raw, vFpL) +GO(__gmpf_set_q, vFpp) +GO(__gmpf_set_si, vFpl) +GO(__gmpf_set_str, iFppi) +GO(__gmpf_set_ui, vFpL) +GO(__gmpf_set_z, vFpp) +GO(__gmpf_size, LFp) +GO(__gmpf_sqrt, vFpp) +GO(__gmpf_sqrt_ui, vFpL) +GO(__gmpf_sub, vFppp) +GO(__gmpf_sub_ui, vFppL) +GO(__gmpf_swap, vFpp) +GO(__gmpf_trunc, vFpp) +GO(__gmpf_ui_div, vFpLp) +GO(__gmpf_ui_sub, vFpLp) +GO(__gmpf_urandomb, vFppL) GOM(__gmp_get_memory_functions, vFEppp) //GO(__gmp_init_primesieve, //GO(__gmp_invalid_operation, //DATAB(__gmp_junk, //GO(__gmp_mt_recalc_buffer, -//GO(__gmpn_add, -//GO(__gmpn_add_1, +GO(__gmpn_add, LFpplpl) +GO(__gmpn_add_1, LFpplL) //GO(__gmpn_add_err1_n, //GO(__gmpn_add_err2_n, //GO(__gmpn_add_err3_n, //GO(__gmpn_addlsh1_n, //GO(__gmpn_addlsh2_n, -GO(__gmpn_addmul_1, LFppLL) -GO(__gmpn_add_n, LFpppL) +GO(__gmpn_addmul_1, LFpplL) +GO(__gmpn_add_n, LFpppl) //GO(__gmpn_add_nc, //GO(__gmpn_add_n_sub_n, -//GO(__gmpn_and_n, -//GO(__gmpn_andn_n, +GO(__gmpn_and_n, vFpppl) +GO(__gmpn_andn_n, vFpppl) //GO(__gmpn_bc_mulmod_bnm1, //GO(__gmpn_bc_set_str, //GO(__gmpn_bdiv_dbm1c, @@ -130,14 +130,14 @@ GO(__gmpn_add_n, LFpppL) //GO(__gmpn_broot_invm1, //GO(__gmpn_bsqrt, //GO(__gmpn_bsqrtinv, -//GO(__gmpn_cmp, -GO(__gmpn_cnd_add_n, LFLpppL) -GO(__gmpn_cnd_sub_n, LFLpppL) -GO(__gmpn_cnd_swap, vFippL) -//GO(__gmpn_com, +GO(__gmpn_cmp, iFppl) +GO(__gmpn_cnd_add_n, LFLpppl) +GO(__gmpn_cnd_sub_n, LFLpppl) +GO(__gmpn_cnd_swap, vFLppl) +GO(__gmpn_com, vFppl) //GO(__gmpn_compute_powtab, -GO(__gmpn_copyd, vFppL) -GO(__gmpn_copyi, vFppL) +GO(__gmpn_copyd, vFppl) +GO(__gmpn_copyi, vFppl) //GO(__gmpn_dcpi1_bdiv_q, //GO(__gmpn_dcpi1_bdiv_qr, //GO(__gmpn_dcpi1_bdiv_qr_n, @@ -148,38 +148,38 @@ GO(__gmpn_copyi, vFppL) //GO(__gmpn_dcpi1_div_qr_n, //GO(__gmpn_dc_set_str, //GO(__gmpn_divexact, -//GO(__gmpn_divexact_1, +GO(__gmpn_divexact_1, vFpplL) //GO(__gmpn_divexact_by3, -//GO(__gmpn_divexact_by3c, +GO(__gmpn_divexact_by3c, LFpplL) //GO(__gmpn_divisible_p, //GO(__gmpn_divmod_1, //GO(__gmpn_div_q, -//GO(__gmpn_div_qr_1, +GO(__gmpn_div_qr_1, LFppplL) //GO(__gmpn_div_qr_1n_pi1, -//GO(__gmpn_div_qr_2, +GO(__gmpn_div_qr_2, LFppplp) //GO(__gmpn_div_qr_2n_pi1, //GO(__gmpn_div_qr_2u_pi1, -//GO(__gmpn_divrem, -//GO(__gmpn_divrem_1, -//GO(__gmpn_divrem_2, +GO(__gmpn_divrem, LFplplpl) +GO(__gmpn_divrem_1, LFplplL) +GO(__gmpn_divrem_2, LFplplp) //GO(__gmpn_dump, //GO(__gmp_nextprime, //GO(__gmpn_fft_best_k, //GO(__gmpn_fft_next_size, //GO(__gmpn_fib2m, //GO(__gmpn_fib2_ui, -//GO(__gmpn_gcd, -//GO(__gmpn_gcd_1, -//GO(__gmpn_gcd_11, +GO(__gmpn_gcd, lFpplpl) +GO(__gmpn_gcd_1, LFplL) +GO(__gmpn_gcd_11, LFLL) //GO(__gmpn_gcd_22, -//GO(__gmpn_gcdext, -//GO(__gmpn_gcdext_1, +GO(__gmpn_gcdext, lFpppplpl) +GO(__gmpn_gcdext_1, LFppLL) //GO(__gmpn_gcdext_hook, //GO(__gmpn_gcdext_lehmer_n, //GO(__gmpn_gcd_subdiv_step, //GO(__gmpn_get_d, -//GO(__gmpn_get_str, -//GO(__gmpn_hamdist, +GO(__gmpn_get_str, LFpipl) +GO(__gmpn_hamdist, LFppl) //GO(__gmpn_hgcd, //GO(__gmpn_hgcd2, //GO(__gmpn_hgcd2_jacobi, @@ -199,17 +199,17 @@ GO(__gmpn_copyi, vFppL) //GO(__gmpn_invert, //GO(__gmpn_invertappr, //GO(__gmpn_invert_limb, -//GO(__gmpn_ior_n, -//GO(__gmpn_iorn_n, +GO(__gmpn_ior_n, vFpppl) +GO(__gmpn_iorn_n, vFpppl) //GO(__gmpn_jacobi_2, //GO(__gmpn_jacobi_base, //GO(__gmpn_jacobi_n, -//GO(__gmpn_lshift, +GO(__gmpn_lshift, LFpplu) //GO(__gmpn_lshiftc, //GO(__gmpn_matrix22_mul, //GO(__gmpn_matrix22_mul1_inverse_vector, //GO(__gmpn_matrix22_mul_itch, -//GO(__gmpn_mod_1, +GO(__gmpn_mod_1, LFplL) //GO(__gmpn_mod_1_1p, //GO(__gmpn_mod_1_1p_cps, //GO(__gmpn_mod_1s_2p, @@ -230,8 +230,8 @@ GO(__gmpn_copyi, vFppL) //GO(__gmpn_mu_div_q_itch, //GO(__gmpn_mu_div_qr, //GO(__gmpn_mu_div_qr_itch, -//GO(__gmpn_mul, -GO(__gmpn_mul_1, LFppLL) +GO(__gmpn_mul, LFpplpl) +GO(__gmpn_mul_1, LFpplL) //GO(__gmpn_mul_1c, //GO(__gmpn_mul_basecase, //GO(__gmpn_mul_fft, @@ -242,25 +242,25 @@ GO(__gmpn_mul_1, LFppLL) //GO(__gmpn_mulmid_n, //GO(__gmpn_mulmod_bnm1, //GO(__gmpn_mulmod_bnm1_next_size, -GO(__gmpn_mul_n, vFpppL) -//GO(__gmpn_nand_n, -//GO(__gmpn_neg, +GO(__gmpn_mul_n, vFpppl) +GO(__gmpn_nand_n, vFpppl) +GO(__gmpn_neg, LFppl) //GO(__gmpn_ni_invertappr, -//GO(__gmpn_nior_n, +GO(__gmpn_nior_n, vFpppl) //GO(__gmpn_nussbaumer_mul, -//GO(__gmpn_perfect_power_p, -GO(__gmpn_perfect_square_p, iFpL) +GO(__gmpn_perfect_power_p, iFpl) +GO(__gmpn_perfect_square_p, iFpl) //GO(__gmpn_pi1_bdiv_q_1, -//GO(__gmpn_popcount, -//GO(__gmpn_pow_1, +GO(__gmpn_popcount, LFpl) +GO(__gmpn_pow_1, lFpplLp) //GO(__gmpn_powlo, //GO(__gmpn_powm, //GO(__gmpn_preinv_divrem_1, -//GO(__gmpn_preinv_mod_1, +GO(__gmpn_preinv_mod_1, LFplLL) //GO(__gmpn_preinv_mu_div_qr, //GO(__gmpn_preinv_mu_div_qr_itch, -//GO(__gmpn_random, -//GO(__gmpn_random2, +GO(__gmpn_random, vFpl) +GO(__gmpn_random2, vFpl) //GO(__gmpn_redc_1, //GO(__gmpn_redc_2, //GO(__gmpn_redc_n, @@ -270,56 +270,56 @@ GO(__gmpn_perfect_square_p, iFpL) //GO(__gmpn_rsblsh2_n, //GO(__gmpn_rsh1add_n, //GO(__gmpn_rsh1sub_n, -GO(__gmpn_rshift, LFppLu) +GO(__gmpn_rshift, LFpplu) //GO(__gmpn_sbpi1_bdiv_q, //GO(__gmpn_sbpi1_bdiv_qr, //GO(__gmpn_sbpi1_bdiv_r, //GO(__gmpn_sbpi1_divappr_q, //GO(__gmpn_sbpi1_div_q, //GO(__gmpn_sbpi1_div_qr, -//GO(__gmpn_scan0, -//GO(__gmpn_scan1, -GO(__gmpn_sec_add_1, LFppLL) -GO(__gmpn_sec_add_1_itch, LFL) -//GO(__gmpn_sec_div_qr, -//GO(__gmpn_sec_div_qr_itch, -GO(__gmpn_sec_div_r, LFppLpLL) -GO(__gmpn_sec_div_r_itch, LFL) -GO(__gmpn_sec_invert, iFpppLL) -GO(__gmpn_sec_invert_itch, LFL) -GO(__gmpn_sec_mul, vFpppLp) -GO(__gmpn_sec_mul_itch, LFL) +GO(__gmpn_scan0, LFpL) +GO(__gmpn_scan1, LFpL) +GO(__gmpn_sec_add_1, LFpplLp) +GO(__gmpn_sec_add_1_itch, lFl) +GO(__gmpn_sec_div_qr, LFpplplp) +GO(__gmpn_sec_div_qr_itch, lFll) +GO(__gmpn_sec_div_r, vFplplp) +GO(__gmpn_sec_div_r_itch, lFll) +GO(__gmpn_sec_invert, iFppplLp) +GO(__gmpn_sec_invert_itch, lFl) +GO(__gmpn_sec_mul, vFpplplp) +GO(__gmpn_sec_mul_itch, lFll) //GO(__gmpn_sec_pi1_div_qr, //GO(__gmpn_sec_pi1_div_r, -GO(__gmpn_sec_powm, vFppLpLpLp) -GO(__gmpn_sec_powm_itch, LFLL) -//GO(__gmpn_sec_sqr, -//GO(__gmpn_sec_sqr_itch, -GO(__gmpn_sec_sub_1, LFppLL) -//GO(__gmpn_sec_sub_1_itch, -GO(__gmpn_sec_tabselect, vFppLLL) -//GO(__gmpn_set_str, -//GO(__gmpn_sizeinbase, -GO(__gmpn_sqr, vFppL) +GO(__gmpn_sec_powm, vFpplpLplp) +GO(__gmpn_sec_powm_itch, lFlLl) +GO(__gmpn_sec_sqr, vFpplp) +GO(__gmpn_sec_sqr_itch, lFl) +GO(__gmpn_sec_sub_1, LFpplLp) +GO(__gmpn_sec_sub_1_itch, lFl) +GO(__gmpn_sec_tabselect, vFpplll) +GO(__gmpn_set_str, lFppLi) +GO(__gmpn_sizeinbase, LFpli) +GO(__gmpn_sqr, vFppl) //GO(__gmpn_sqr_basecase, //GO(__gmpn_sqr_diag_addlsh1, //GO(__gmpn_sqrlo, //GO(__gmpn_sqrlo_basecase, //GO(__gmpn_sqrmod_bnm1, //GO(__gmpn_sqrmod_bnm1_next_size, -//GO(__gmpn_sqrtrem, +GO(__gmpn_sqrtrem, lFpppl) //GO(__gmpn_strongfibo, -//GO(__gmpn_sub, -//GO(__gmpn_sub_1, +GO(__gmpn_sub, LFpplpl) +GO(__gmpn_sub_1, LFpplL) //GO(__gmpn_sub_err1_n, //GO(__gmpn_sub_err2_n, //GO(__gmpn_sub_err3_n, //GO(__gmpn_sublsh1_n, //GO(__gmpn_sublsh2_n, -GO(__gmpn_submul_1, LFppLL) -GO(__gmpn_sub_n, LFpppL) +GO(__gmpn_submul_1, LFpplL) +GO(__gmpn_sub_n, LFpppl) //GO(__gmpn_sub_nc, -//GO(__gmpn_tdiv_qr, +GO(__gmpn_tdiv_qr, vFpplplpl) //GO(__gmpn_toom22_mul, //GO(__gmpn_toom2_sqr, //GO(__gmpn_toom32_mul, @@ -353,81 +353,81 @@ GO(__gmpn_sub_n, LFpppL) //GO(__gmpn_toom_interpolate_7pts, //GO(__gmpn_toom_interpolate_8pts, //GO(__gmpn_trialdiv, -//GO(__gmpn_xnor_n, -//GO(__gmpn_xor_n, -GO(__gmpn_zero, vFpL) -//GO(__gmpn_zero_p, +GO(__gmpn_xnor_n, vFpppl) +GO(__gmpn_xor_n, vFpppl) +GO(__gmpn_zero, vFpl) +GO(__gmpn_zero_p, iFpl) //GO(__gmp_obstack_printf, //DATA(__gmp_obstack_printf_funs, //GO(__gmp_obstack_vprintf, //GO(__gmp_primesieve, -//GO(__gmp_printf, -//GO(__gmpq_abs, -//GO(__gmpq_add, -//GO(__gmpq_canonicalize, -//GO(__gmpq_clear, -//GO(__gmpq_clears, -//GO(__gmpq_cmp, -//GO(__gmpq_cmp_si, -//GO(__gmpq_cmp_ui, -//GO(__gmpq_cmp_z, -//GO(__gmpq_div, -//GO(__gmpq_div_2exp, -//GO(__gmpq_equal, -//GO(__gmpq_get_d, -//GO(__gmpq_get_den, -//GO(__gmpq_get_num, -//GO(__gmpq_get_str, -//GO(__gmpq_init, -//GO(__gmpq_inits, +//GOM(__gmp_printf, iFEpV) +GO(__gmpq_abs, vFpp) +GO(__gmpq_add, vFppp) +GO(__gmpq_canonicalize, vFp) +GO(__gmpq_clear, vFp) +//GOM(__gmpq_clears, vFEpV) +GO(__gmpq_cmp, iFpp) +GO(__gmpq_cmp_si, iFplL) +GO(__gmpq_cmp_ui, iFpLL) +GO(__gmpq_cmp_z, iFpp) +GO(__gmpq_div, vFppp) +GO(__gmpq_div_2exp, vFppL) +GO(__gmpq_equal, iFpp) +GO(__gmpq_get_d, dFp) +GO(__gmpq_get_den, vFpp) +GO(__gmpq_get_num, vFpp) +GO(__gmpq_get_str, pFpip) +GO(__gmpq_init, vFp) +//GOM(__gmpq_inits, vFEpV) //GO(__gmpq_inp_str, -//GO(__gmpq_inv, -//GO(__gmpq_mul, -//GO(__gmpq_mul_2exp, -//GO(__gmpq_neg, +GO(__gmpq_inv, vFpp) +GO(__gmpq_mul, vFppp) +GO(__gmpq_mul_2exp, vFppL) +GO(__gmpq_neg, vFpp) //GO(__gmpq_out_str, -//GO(__gmpq_set, -//GO(__gmpq_set_d, -//GO(__gmpq_set_den, -//GO(__gmpq_set_f, -//GO(__gmpq_set_num, -//GO(__gmpq_set_si, -//GO(__gmpq_set_str, -//GO(__gmpq_set_ui, -//GO(__gmpq_set_z, -//GO(__gmpq_sub, -//GO(__gmpq_swap, -//GO(__gmp_randclear, +GO(__gmpq_set, vFpp) +GO(__gmpq_set_d, vFpd) +GO(__gmpq_set_den, vFpp) +GO(__gmpq_set_f, vFpp) +GO(__gmpq_set_num, vFpp) +GO(__gmpq_set_si, vFplL) +GO(__gmpq_set_str, iFppi) +GO(__gmpq_set_ui, vFpLL) +GO(__gmpq_set_z, vFpp) +GO(__gmpq_sub, vFppp) +GO(__gmpq_swap, vFpp) +GO(__gmp_randclear, vFp) //GO(__gmp_randclear_mt, //GO(__gmp_randget_mt, -//GO(__gmp_randinit, -//GO(__gmp_randinit_default, -//GO(__gmp_randinit_lc_2exp, -//GO(__gmp_randinit_lc_2exp_size, -//GO(__gmp_randinit_mt, +//GOM(__gmp_randinit, vFEpuV) +GO(__gmp_randinit_default, vFp) +GO(__gmp_randinit_lc_2exp, vFppLL) +GO(__gmp_randinit_lc_2exp_size, iFpL) +GO(__gmp_randinit_mt, vFp) //GO(__gmp_randinit_mt_noseed, -//GO(__gmp_randinit_set, +GO(__gmp_randinit_set, vFpp) //GO(__gmp_randiset_mt, //DATAB(__gmp_rands, -//GO(__gmp_randseed, -//GO(__gmp_randseed_ui, +GO(__gmp_randseed, vFpp) +GO(__gmp_randseed_ui, vFpL) //DATAB(__gmp_rands_initialized, //DATA(__gmp_reallocate_func, -//GO(__gmp_scanf, +//GOM(__gmp_scanf, iFEpV) GOM(__gmp_set_memory_functions, vFEppp) -//GO(__gmp_snprintf, +//GOM(__gmp_snprintf, iFEpLpV) //DATA(__gmp_snprintf_funs, -//GO(__gmp_sprintf, +//GOM(__gmp_sprintf, iFEppV) //DATA(__gmp_sprintf_funs, //GO(__gmp_sqrt_of_negative, -//GO(__gmp_sscanf, +//GOM(__gmp_sscanf, iFEppV) //DATA(__gmp_sscanf_funs, //GO(__gmp_tmp_reentrant_alloc, //GO(__gmp_tmp_reentrant_free, -//GO(__gmp_urandomb_ui, -//GO(__gmp_urandomm_ui, +GO(__gmp_urandomb_ui, LFpL) +GO(__gmp_urandomm_ui, LFpL) //GO(__gmp_vasprintf, -//DATA(__gmp_version, +//DATA(__gmp_version, 8) //GO(__gmp_vfprintf, //GO(__gmp_vfscanf, //GO(__gmp_vprintf, @@ -435,170 +435,170 @@ GOM(__gmp_set_memory_functions, vFEppp) //GO(__gmp_vsnprintf, //GO(__gmp_vsprintf, //GO(__gmp_vsscanf, -//GO(__gmpz_2fac_ui, -//GO(__gmpz_abs, +GO(__gmpz_2fac_ui, vFpL) +GO(__gmpz_abs, vFpp) GO(__gmpz_add, vFppp) -//GO(__gmpz_addmul, -//GO(__gmpz_addmul_ui, +GO(__gmpz_addmul, vFppp) +GO(__gmpz_addmul_ui, vFppL) GO(__gmpz_add_ui, vFppL) GO(__gmpz_and, vFppp) //GO(__gmpz_aorsmul_1, -//GO(__gmpz_array_init, -//GO(__gmpz_bin_ui, -//GO(__gmpz_bin_uiui, +GO(__gmpz_array_init, vFpll) +GO(__gmpz_bin_ui, vFppL) +GO(__gmpz_bin_uiui, vFpLL) GO(__gmpz_cdiv_q, vFppp) -//GO(__gmpz_cdiv_q_2exp, -//GO(__gmpz_cdiv_qr, -//GO(__gmpz_cdiv_qr_ui, -//GO(__gmpz_cdiv_q_ui, -//GO(__gmpz_cdiv_r, -//GO(__gmpz_cdiv_r_2exp, -//GO(__gmpz_cdiv_r_ui, -//GO(__gmpz_cdiv_ui, +GO(__gmpz_cdiv_q_2exp, vFppL) +GO(__gmpz_cdiv_qr, vFpppp) +GO(__gmpz_cdiv_qr_ui, LFpppL) +GO(__gmpz_cdiv_q_ui, LFppL) +GO(__gmpz_cdiv_r, vFppp) +GO(__gmpz_cdiv_r_2exp, vFppL) +GO(__gmpz_cdiv_r_ui, LFppL) +GO(__gmpz_cdiv_ui, LFpL) GO(__gmpz_clear, vFp) -//GO(__gmpz_clears, -//GO(__gmpz_clrbit, +//GOM(__gmpz_clears, vFEpV) +GO(__gmpz_clrbit, vFpL) GO(__gmpz_cmp, iFpp) -//GO(__gmpz_cmpabs, -//GO(__gmpz_cmpabs_d, -//GO(__gmpz_cmpabs_ui, -//GO(__gmpz_cmp_d, -//GO(__gmpz_cmp_si, -GO(__gmpz_cmp_ui, iFpu) +GO(__gmpz_cmpabs, iFpp) +GO(__gmpz_cmpabs_d, iFpd) +GO(__gmpz_cmpabs_ui, iFpL) +GO(__gmpz_cmp_d, iFpd) +GO(__gmpz_cmp_si, iFpl) +GO(__gmpz_cmp_ui, iFpL) GO(__gmpz_com, vFpp) -//GO(__gmpz_combit, -//GO(__gmpz_congruent_2exp_p, +GO(__gmpz_combit, vFpL) +GO(__gmpz_congruent_2exp_p, iFppL) GO(__gmpz_congruent_p, iFppp) -//GO(__gmpz_congruent_ui_p, -//GO(__gmpz_divexact, +GO(__gmpz_congruent_ui_p, iFpLL) +GO(__gmpz_divexact, vFppp) //GO(__gmpz_divexact_gcd, -//GO(__gmpz_divexact_ui, -//GO(__gmpz_divisible_2exp_p, -//GO(__gmpz_divisible_p, -//GO(__gmpz_divisible_ui_p, -//GO(__gmpz_dump, -GO(__gmpz_export, vFppiLiLp) -//GO(__gmpz_fac_ui, +GO(__gmpz_divexact_ui, vFppL) +GO(__gmpz_divisible_2exp_p, iFpL) +GO(__gmpz_divisible_p, iFpp) +GO(__gmpz_divisible_ui_p, iFpL) +GO(__gmpz_dump, vFp) +GO(__gmpz_export, pFppiLiLp) +GO(__gmpz_fac_ui, vFpL) GO(__gmpz_fdiv_q, vFppp) GO(__gmpz_fdiv_q_2exp, vFppL) -//GO(__gmpz_fdiv_qr, -//GO(__gmpz_fdiv_qr_ui, -//GO(__gmpz_fdiv_q_ui, +GO(__gmpz_fdiv_qr, vFpppp) +GO(__gmpz_fdiv_qr_ui, LFpppL) +GO(__gmpz_fdiv_q_ui, LFppL) GO(__gmpz_fdiv_r, vFppp) GO(__gmpz_fdiv_r_2exp, vFppL) -//GO(__gmpz_fdiv_r_ui, -//GO(__gmpz_fdiv_ui, -//GO(__gmpz_fib2_ui, -//GO(__gmpz_fib_ui, -//GO(__gmpz_fits_sint_p, -//GO(__gmpz_fits_slong_p, -//GO(__gmpz_fits_sshort_p, -//GO(__gmpz_fits_uint_p, -//GO(__gmpz_fits_ulong_p, -//GO(__gmpz_fits_ushort_p, +GO(__gmpz_fdiv_r_ui, LFppL) +GO(__gmpz_fdiv_ui, LFpL) +GO(__gmpz_fib2_ui, vFppL) +GO(__gmpz_fib_ui, vFpL) +GO(__gmpz_fits_sint_p, iFp) +GO(__gmpz_fits_slong_p, iFp) +GO(__gmpz_fits_sshort_p, iFp) +GO(__gmpz_fits_uint_p, iFp) +GO(__gmpz_fits_ulong_p, iFp) +GO(__gmpz_fits_ushort_p, iFp) GO(__gmpz_gcd, vFppp) -//GO(__gmpz_gcdext, -//GO(__gmpz_gcd_ui, -//GO(__gmpz_get_d, -//GO(__gmpz_get_d_2exp, -//GO(__gmpz_getlimbn, -//GO(__gmpz_get_si, -//GO(__gmpz_get_str, -//GO(__gmpz_get_ui, -//GO(__gmpz_hamdist, +GO(__gmpz_gcdext, vFppppp) +GO(__gmpz_gcd_ui, LFppL) +GO(__gmpz_get_d, dFp) +GO(__gmpz_get_d_2exp, dFpp) +GO(__gmpz_getlimbn, LFpl) +GO(__gmpz_get_si, lFp) +GO(__gmpz_get_str, pFpip) +GO(__gmpz_get_ui, LFp) +GO(__gmpz_hamdist, LFpp) GO(__gmpz_import, vFpLiLiLp) GO(__gmpz_init, vFp) -//GO(__gmpz_init2, -//GO(__gmpz_inits, +GO(__gmpz_init2, vFpL) +//GOM(__gmpz_inits, vFEpV) GO(__gmpz_init_set, vFpp) -//GO(__gmpz_init_set_d, -//GO(__gmpz_init_set_si, +GO(__gmpz_init_set_d, vFpd) +GO(__gmpz_init_set_si, vFpl) GO(__gmpz_init_set_str, iFppi) GO(__gmpz_init_set_ui, vFpL) //GO(__gmpz_inp_raw, //GO(__gmpz_inp_str, //GO(__gmpz_inp_str_nowhite, GO(__gmpz_invert, iFppp) -//GO(__gmpz_ior, -//GO(__gmpz_jacobi, -//GO(__gmpz_kronecker_si, -//GO(__gmpz_kronecker_ui, +GO(__gmpz_ior, vFppp) +GO(__gmpz_jacobi, iFpp) +GO(__gmpz_kronecker_si, iFpl) +GO(__gmpz_kronecker_ui, iFpL) GO(__gmpz_lcm, vFppp) -//GO(__gmpz_lcm_ui, +GO(__gmpz_lcm_ui, vFppL) //GO(__gmpz_legendre, -GO(__gmpz_limbs_finish, vFpL) -GO(__gmpz_limbs_modify, pFpL) +GO(__gmpz_limbs_finish, vFpl) +GO(__gmpz_limbs_modify, pFpl) GO(__gmpz_limbs_read, pFp) -GO(__gmpz_limbs_write, pFpL) +GO(__gmpz_limbs_write, pFpl) //GO(__gmpz_lucas_mod, -//GO(__gmpz_lucnum2_ui, -//GO(__gmpz_lucnum_ui, -//GO(__gmpz_mfac_uiui, -//GO(__gmpz_millerrabin, +GO(__gmpz_lucnum2_ui, vFppL) +GO(__gmpz_lucnum_ui, vFpL) +GO(__gmpz_mfac_uiui, vFpLL) +GO(__gmpz_millerrabin, iFpi) GO(__gmpz_mod, vFppp) GO(__gmpz_mul, vFppp) GO(__gmpz_mul_2exp, vFppL) -//GO(__gmpz_mul_si, +GO(__gmpz_mul_si, vFppl) GO(__gmpz_mul_ui, vFppL) -//GO(__gmpz_neg, -//GO(__gmpz_nextprime, +GO(__gmpz_neg, vFpp) +GO(__gmpz_nextprime, vFpp) //GO(__gmpz_n_pow_ui, //GO(__gmpz_oddfac_1, //GO(__gmpz_out_raw, -//GO(__gmpz_out_str, -//GO(__gmpz_perfect_power_p, -//GO(__gmpz_perfect_square_p, -//GO(__gmpz_popcount, +GO(__gmpz_out_str, LFpip) +GO(__gmpz_perfect_power_p, iFp) +GO(__gmpz_perfect_square_p, iFp) +GO(__gmpz_popcount, LFp) GO(__gmpz_powm, vFpppp) GO(__gmpz_powm_sec, vFpppp) GO(__gmpz_powm_ui, vFppLp) -//GO(__gmpz_pow_ui, -//GO(__gmpz_primorial_ui, +GO(__gmpz_pow_ui, vFppL) +GO(__gmpz_primorial_ui, vFpL) GO(__gmpz_probab_prime_p, iFpi) //GO(__gmpz_prodlimbs, -//GO(__gmpz_random, -//GO(__gmpz_random2, -//GO(__gmpz_realloc, -//GO(__gmpz_realloc2, -//GO(__gmpz_remove, -GO(__gmpz_roinit_n, pFppL) -//GO(__gmpz_root, -//GO(__gmpz_rootrem, -//GO(__gmpz_rrandomb, -//GO(__gmpz_scan0, +GO(__gmpz_random, vFpl) +GO(__gmpz_random2, vFpl) +GO(__gmpz_realloc, pFpl) +GO(__gmpz_realloc2, vFpL) +GO(__gmpz_remove, LFppp) +GO(__gmpz_roinit_n, pFppl) +GO(__gmpz_root, iFppL) +GO(__gmpz_rootrem, vFpppL) +GO(__gmpz_rrandomb, vFppL) +GO(__gmpz_scan0, LFpL) GO(__gmpz_scan1, LFpL) GO(__gmpz_set, vFpp) GO(__gmpz_setbit, vFpL) -//GO(__gmpz_set_d, -//GO(__gmpz_set_f, -//GO(__gmpz_set_q, -//GO(__gmpz_set_si, -//GO(__gmpz_set_str, +GO(__gmpz_set_d, vFpd) +GO(__gmpz_set_f, vFpp) +GO(__gmpz_set_q, vFpp) +GO(__gmpz_set_si, vFpl) +GO(__gmpz_set_str, iFppi) GO(__gmpz_set_ui, vFpL) -//GO(__gmpz_si_kronecker, -//GO(__gmpz_size, +GO(__gmpz_si_kronecker, iFlp) +GO(__gmpz_size, LFp) GO(__gmpz_sizeinbase, LFpi) GO(__gmpz_sqrt, vFpp) -//GO(__gmpz_sqrtrem, +GO(__gmpz_sqrtrem, vFppp) //GO(__gmpz_stronglucas, GO(__gmpz_sub, vFppp) GO(__gmpz_submul, vFppp) GO(__gmpz_submul_ui, vFppL) -GO(__gmpz_sub_ui, vFppu) -//GO(__gmpz_swap, -//GO(__gmpz_tdiv_q, +GO(__gmpz_sub_ui, vFppL) +GO(__gmpz_swap, vFpp) +GO(__gmpz_tdiv_q, vFppp) GO(__gmpz_tdiv_q_2exp, vFppL) GO(__gmpz_tdiv_qr, vFpppp) -//GO(__gmpz_tdiv_qr_ui, -//GO(__gmpz_tdiv_q_ui, -//GO(__gmpz_tdiv_r, +GO(__gmpz_tdiv_qr_ui, LFpppL) +GO(__gmpz_tdiv_q_ui, LFppL) +GO(__gmpz_tdiv_r, vFppp) GO(__gmpz_tdiv_r_2exp, vFppL) -//GO(__gmpz_tdiv_r_ui, -//GO(__gmpz_tdiv_ui, +GO(__gmpz_tdiv_r_ui, LFppL) +GO(__gmpz_tdiv_ui, LFpL) GO(__gmpz_tstbit, iFpL) -//GO(__gmpz_ui_kronecker, -//GO(__gmpz_ui_pow_ui, -//GO(__gmpz_ui_sub, -//GO(__gmpz_urandomb, -//GO(__gmpz_urandomm, -//GO(__gmpz_xor, +GO(__gmpz_ui_kronecker, iFLp) +GO(__gmpz_ui_pow_ui, vFpLL) +GO(__gmpz_ui_sub, vFpLp) +GO(__gmpz_urandomb, vFppL) +GO(__gmpz_urandomm, vFppp) +GO(__gmpz_xor, vFppp) diff --git a/src/wrapped/wrappedgnutls.c b/src/wrapped/wrappedgnutls.c index 6af45d6..00d9296 100644 --- a/src/wrapped/wrappedgnutls.c +++ b/src/wrapped/wrappedgnutls.c @@ -18,13 +18,9 @@ #include "emu/x64emu_private.h" #include "callback.h" -const char* gnutlsName = -#if ANDROID - "libgnutls.so" -#else - "libgnutls.so.30" -#endif - ; +const char* gnutlsName = "libgnutls.so.30"; +#define ALTNAME "libgnutls.so" + #define LIBNAME gnutls #include "generated/wrappedgnutlstypes.h" diff --git a/src/wrapped/wrappedgnutls_private.h b/src/wrapped/wrappedgnutls_private.h index 1d8e009..1686735 100644 --- a/src/wrapped/wrappedgnutls_private.h +++ b/src/wrapped/wrappedgnutls_private.h @@ -1,5 +1,5 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif //gnutls_session_t is p @@ -10,101 +10,101 @@ //GO(_dsa_generate_dss_pq, //GO(_dsa_validate_dss_g, //GO(_dsa_validate_dss_pq, -//GO(gnutls_aead_cipher_decrypt, -//GO(gnutls_aead_cipher_deinit, -//GO(gnutls_aead_cipher_encrypt, -//GO(gnutls_aead_cipher_init, -GO(gnutls_alert_get, pFp) -GO(gnutls_alert_get_name, pFp) -//GO(gnutls_alert_get_strname, -GO(gnutls_alert_send, iFppp) -//GO(gnutls_alert_send_appropriate, +GO(gnutls_aead_cipher_decrypt, iFppLpLLpLpp) +GO(gnutls_aead_cipher_deinit, vFp) +GO(gnutls_aead_cipher_encrypt, iFppLpLLpLpp) +GO(gnutls_aead_cipher_init, iFpup) +GO(gnutls_alert_get, uFp) +GO(gnutls_alert_get_name, pFu) +GO(gnutls_alert_get_strname, pFu) +GO(gnutls_alert_send, iFpuu) +GO(gnutls_alert_send_appropriate, iFpi) GO(gnutls_alpn_get_selected_protocol, iFpp) GO(gnutls_alpn_set_protocols, iFppuu) -//GO(gnutls_anon_allocate_client_credentials, -//GO(gnutls_anon_allocate_server_credentials, -//GO(gnutls_anon_free_client_credentials, -//GO(gnutls_anon_free_server_credentials, -//GO(gnutls_anon_set_params_function, -//GO(gnutls_anon_set_server_dh_params, -//GO(gnutls_anon_set_server_known_dh_params, -//GO(gnutls_anon_set_server_params_function, -//GO(gnutls_auth_client_get_type, -//GO(gnutls_auth_get_type, -//GO(gnutls_auth_server_get_type, +GO(gnutls_anon_allocate_client_credentials, iFp) +GO(gnutls_anon_allocate_server_credentials, iFp) +GO(gnutls_anon_free_client_credentials, vFp) +GO(gnutls_anon_free_server_credentials, vFp) +//GOM(gnutls_anon_set_params_function, vFEpp) +GO(gnutls_anon_set_server_dh_params, vFpp) +GO(gnutls_anon_set_server_known_dh_params, iFpu) +//GOM(gnutls_anon_set_server_params_function, vFEpp) +GO(gnutls_auth_client_get_type, uFp) +GO(gnutls_auth_get_type, uFp) +GO(gnutls_auth_server_get_type, uFp) //GO(_gnutls_bin2hex, -//GO(gnutls_buffer_append_data, +GO(gnutls_buffer_append_data, iFppL) //GO(_gnutls_buffer_append_str, //GO(_gnutls_buffer_init, //GO(_gnutls_buffer_to_datum, -GO(gnutls_bye, iFpi) -//GO(gnutls_certificate_activation_time_peers, +GO(gnutls_bye, iFpu) +GO(gnutls_certificate_activation_time_peers, lFp) GO(gnutls_certificate_allocate_credentials, iFp) -//GO(gnutls_certificate_client_get_request_status, -//GO(gnutls_certificate_expiration_time_peers, -//GO(gnutls_certificate_free_ca_names, -//GO(gnutls_certificate_free_cas, +GO(gnutls_certificate_client_get_request_status, uFp) +GO(gnutls_certificate_expiration_time_peers, lFp) +GO(gnutls_certificate_free_ca_names, vFp) +GO(gnutls_certificate_free_cas, vFp) GO(gnutls_certificate_free_credentials, vFp) -//GO(gnutls_certificate_free_crls, -//GO(gnutls_certificate_free_keys, -//GO(gnutls_certificate_get_crt_raw, -//GO(gnutls_certificate_get_issuer, -//GO(gnutls_certificate_get_openpgp_crt, -//GO(gnutls_certificate_get_openpgp_key, -//GO(gnutls_certificate_get_ours, +GO(gnutls_certificate_free_crls, vFp) +GO(gnutls_certificate_free_keys, vFp) +GO(gnutls_certificate_get_crt_raw, iFpuup) +GO(gnutls_certificate_get_issuer, iFpppu) +GO(gnutls_certificate_get_openpgp_crt, iFpupp) +GO(gnutls_certificate_get_openpgp_key, iFpup) +GO(gnutls_certificate_get_ours, pFp) GO(gnutls_certificate_get_peers, pFpp) -//GO(gnutls_certificate_get_peers_subkey_id, -//GO(gnutls_certificate_get_trust_list, -//GO(gnutls_certificate_get_verify_flags, -//GO(gnutls_certificate_get_x509_crt, -//GO(gnutls_certificate_get_x509_key, -//GO(gnutls_certificate_send_x509_rdn_sequence, -//GO(gnutls_certificate_server_set_request, -//GO(gnutls_certificate_set_dh_params, -//GO(gnutls_certificate_set_flags, -//GO(gnutls_certificate_set_key, -//GO(gnutls_certificate_set_known_dh_params, -//GO(gnutls_certificate_set_ocsp_status_request_file, -//GO(gnutls_certificate_set_ocsp_status_request_function, -//GO(gnutls_certificate_set_ocsp_status_request_function2, -//GO(gnutls_certificate_set_openpgp_key, -//GO(gnutls_certificate_set_openpgp_key_file, -//GO(gnutls_certificate_set_openpgp_key_file2, -//GO(gnutls_certificate_set_openpgp_key_mem, -//GO(gnutls_certificate_set_openpgp_key_mem2, -//GO(gnutls_certificate_set_openpgp_keyring_file, -//GO(gnutls_certificate_set_openpgp_keyring_mem, -//GO(gnutls_certificate_set_params_function, -//GO(gnutls_certificate_set_pin_function, -//GO(gnutls_certificate_set_retrieve_function, -//GO(gnutls_certificate_set_retrieve_function2, -//GO(gnutls_certificate_set_trust_list, +GO(gnutls_certificate_get_peers_subkey_id, iFpp) +GO(gnutls_certificate_get_trust_list, vFpp) +GO(gnutls_certificate_get_verify_flags, uFp) +GO(gnutls_certificate_get_x509_crt, iFpupp) +GO(gnutls_certificate_get_x509_key, iFpup) +GO(gnutls_certificate_send_x509_rdn_sequence, vFpi) +GO(gnutls_certificate_server_set_request, vFpu) +GO(gnutls_certificate_set_dh_params, vFpp) +GO(gnutls_certificate_set_flags, vFpu) +GO(gnutls_certificate_set_key, iFppipip) +GO(gnutls_certificate_set_known_dh_params, iFpu) +GO(gnutls_certificate_set_ocsp_status_request_file, iFppu) +//GOM(gnutls_certificate_set_ocsp_status_request_function, vFEppp) +//GOM(gnutls_certificate_set_ocsp_status_request_function2, iFEpupp) +GO(gnutls_certificate_set_openpgp_key, iFppp) +GO(gnutls_certificate_set_openpgp_key_file, iFpppu) +GO(gnutls_certificate_set_openpgp_key_file2, iFppppu) +GO(gnutls_certificate_set_openpgp_key_mem, iFpppu) +GO(gnutls_certificate_set_openpgp_key_mem2, iFppppu) +GO(gnutls_certificate_set_openpgp_keyring_file, iFppu) +GO(gnutls_certificate_set_openpgp_keyring_mem, iFppLu) +//GOM(gnutls_certificate_set_params_function, vFEpp) +//GOM(gnutls_certificate_set_pin_function, vFEppp) +//GOM(gnutls_certificate_set_retrieve_function, vFEpp) +//GOM(gnutls_certificate_set_retrieve_function2, vFEpp) +GO(gnutls_certificate_set_trust_list, vFppu) GO(gnutls_certificate_set_verify_flags, vFpu) -//GO(gnutls_certificate_set_verify_function, -//GO(gnutls_certificate_set_verify_limits, -//GO(gnutls_certificate_set_x509_crl, -GO(gnutls_certificate_set_x509_crl_file, iFppi) -//GO(gnutls_certificate_set_x509_crl_mem, +//GOM(gnutls_certificate_set_verify_function, vFEpp) +GO(gnutls_certificate_set_verify_limits, vFpuu) +GO(gnutls_certificate_set_x509_crl, iFppi) +GO(gnutls_certificate_set_x509_crl_file, iFppu) +GO(gnutls_certificate_set_x509_crl_mem, iFppu) GO(gnutls_certificate_set_x509_key, iFppip) -GO(gnutls_certificate_set_x509_key_file, iFpppi) -GO(gnutls_certificate_set_x509_key_file2, iFpppipu) -//GO(gnutls_certificate_set_x509_key_mem, -//GO(gnutls_certificate_set_x509_key_mem2, -//GO(gnutls_certificate_set_x509_simple_pkcs12_file, -//GO(gnutls_certificate_set_x509_simple_pkcs12_mem, +GO(gnutls_certificate_set_x509_key_file, iFpppu) +GO(gnutls_certificate_set_x509_key_file2, iFpppupu) +GO(gnutls_certificate_set_x509_key_mem, iFpppu) +GO(gnutls_certificate_set_x509_key_mem2, iFpppupu) +GO(gnutls_certificate_set_x509_simple_pkcs12_file, iFppup) +GO(gnutls_certificate_set_x509_simple_pkcs12_mem, iFppup) GO(gnutls_certificate_set_x509_system_trust, iFp) -//GO(gnutls_certificate_set_x509_trust, -GO(gnutls_certificate_set_x509_trust_dir, iFppi) -GO(gnutls_certificate_set_x509_trust_file, iFppi) -//GO(gnutls_certificate_set_x509_trust_mem, -//GO(gnutls_certificate_type_get, -//GO(gnutls_certificate_type_get_id, -//GO(gnutls_certificate_type_get_name, -//GO(gnutls_certificate_type_list, -//GO(gnutls_certificate_verification_status_print, -//GO(gnutls_certificate_verify_peers, +GO(gnutls_certificate_set_x509_trust, iFppi) +GO(gnutls_certificate_set_x509_trust_dir, iFppu) +GO(gnutls_certificate_set_x509_trust_file, iFppu) +GO(gnutls_certificate_set_x509_trust_mem, iFppu) +GO(gnutls_certificate_type_get, uFp) +GO(gnutls_certificate_type_get_id, uFp) +GO(gnutls_certificate_type_get_name, pFu) +GO(gnutls_certificate_type_list, pFv) +GO(gnutls_certificate_verification_status_print, iFuupu) +GO(gnutls_certificate_verify_peers, iFppup) GO(gnutls_certificate_verify_peers2, iFpp) -//GO(gnutls_certificate_verify_peers3, +GO(gnutls_certificate_verify_peers3, iFppp) GO(gnutls_check_version, pFp) //GO(_gnutls_cidr_to_string, GO(gnutls_cipher_add_auth, iFppL) @@ -113,668 +113,669 @@ GO(gnutls_cipher_decrypt2, iFppLpL) GO(gnutls_cipher_deinit, vFp) GO(gnutls_cipher_encrypt, iFppL) GO(gnutls_cipher_encrypt2, iFppLpL) -GO(gnutls_cipher_get, pFp) -GO(gnutls_cipher_get_block_size, uFp) -//GO(gnutls_cipher_get_id, -//GO(gnutls_cipher_get_iv_size, -GO(gnutls_cipher_get_key_size, LFp) -//GO(gnutls_cipher_get_name, -//GO(gnutls_cipher_get_tag_size, -GO(gnutls_cipher_init, iFpppp) -//GO(gnutls_cipher_list, -//GO(gnutls_cipher_set_iv, -GO(gnutls_cipher_suite_get_name, pFiii) -//GO(gnutls_cipher_suite_info, +GO(gnutls_cipher_get, uFp) +GO(gnutls_cipher_get_block_size, uFu) +GO(gnutls_cipher_get_id, uFp) +GO(gnutls_cipher_get_iv_size, uFu) +GO(gnutls_cipher_get_key_size, LFu) +GO(gnutls_cipher_get_name, pFu) +GO(gnutls_cipher_get_tag_size, uFu) +GO(gnutls_cipher_init, iFpupp) +GO(gnutls_cipher_list, pFv) +GO(gnutls_cipher_set_iv, vFppL) +GO(gnutls_cipher_suite_get_name, pFuuu) +GO(gnutls_cipher_suite_info, pFLppppp) GO(gnutls_cipher_tag, iFppL) -//GO(gnutls_compression_get, -//GO(gnutls_compression_get_id, -//GO(gnutls_compression_get_name, -//GO(gnutls_compression_list, -//GO(gnutls_credentials_clear, -//GO(gnutls_credentials_get, -GO(gnutls_credentials_set, iFppp) -//GO(gnutls_crypto_register_aead_cipher, -//GO(gnutls_crypto_register_cipher, -//GO(gnutls_crypto_register_digest, -//GO(gnutls_crypto_register_mac, +GO(gnutls_compression_get, uFp) +GO(gnutls_compression_get_id, uFp) +GO(gnutls_compression_get_name, pFu) +GO(gnutls_compression_list, pFv) +GO(gnutls_credentials_clear, vFp) +GO(gnutls_credentials_get, iFpup) +GO(gnutls_credentials_set, iFpup) +//GOM(gnutls_crypto_register_aead_cipher, iFEuippppp) +//GOM(gnutls_crypto_register_cipher, iFEuipppppp) +//GOM(gnutls_crypto_register_digest, iFEuippppp) +//GOM(gnutls_crypto_register_mac, iFEuippppppp) //GO(gnutls_db_check_entry, -//GO(gnutls_db_check_entry_time, -//GO(gnutls_db_get_default_cache_expiration, -//GO(gnutls_db_get_ptr, -//GO(gnutls_db_remove_session, -//GO(gnutls_db_set_cache_expiration, -//GO(gnutls_db_set_ptr, -//GO(gnutls_db_set_remove_function, -//GO(gnutls_db_set_retrieve_function, -//GO(gnutls_db_set_store_function, -GO(gnutls_decode_rs_value, iFppp) // not always present -//GO(gnutls_decode_ber_digest_info, +GO(gnutls_db_check_entry_time, lFp) +GO(gnutls_db_get_default_cache_expiration, uFv) +GO(gnutls_db_get_ptr, pFp) +GO(gnutls_db_remove_session, vFp) +GO(gnutls_db_set_cache_expiration, vFpi) +GO(gnutls_db_set_ptr, vFpp) +//GOM(gnutls_db_set_remove_function, vFEpp) +//GOM(gnutls_db_set_retrieve_function, vFEpp) +//GOM(gnutls_db_set_store_function, vFEpp) +GO(gnutls_decode_rs_value, iFppp) +GO(gnutls_decode_ber_digest_info, iFpppp) //GO(_gnutls_decode_ber_rs_raw, GO(gnutls_deinit, vFp) -//GO(gnutls_dh_get_group, -//GO(gnutls_dh_get_peers_public_bits, -//GO(gnutls_dh_get_prime_bits, -//GO(gnutls_dh_get_pubkey, -//GO(gnutls_dh_get_secret_bits, -//GO(gnutls_dh_params_cpy, +GO(gnutls_dh_get_group, iFppp) +GO(gnutls_dh_get_peers_public_bits, iFp) +GO(gnutls_dh_get_prime_bits, iFp) +GO(gnutls_dh_get_pubkey, iFpp) +GO(gnutls_dh_get_secret_bits, iFp) +GO(gnutls_dh_params_cpy, iFpp) GO(gnutls_dh_params_deinit, vFp) -//GO(gnutls_dh_params_export2_pkcs3, -//GO(gnutls_dh_params_export_pkcs3, +GO(gnutls_dh_params_export2_pkcs3, iFpup) +GO(gnutls_dh_params_export_pkcs3, iFpupp) GO(gnutls_dh_params_export_raw, iFpppp) GO(gnutls_dh_params_generate2, iFpu) -//GO(gnutls_dh_params_import_dsa, -//GO(gnutls_dh_params_import_pkcs3, +GO(gnutls_dh_params_import_dsa, iFpp) +GO(gnutls_dh_params_import_pkcs3, iFppu) GO(gnutls_dh_params_import_raw, iFppp) GO(gnutls_dh_params_import_raw2, iFpppu) GO(gnutls_dh_params_init, iFp) -//GO(gnutls_dh_set_prime_bits, +GO(gnutls_dh_set_prime_bits, vFpu) //GO(_gnutls_digest_exists, -//GO(gnutls_digest_get_id, -//GO(gnutls_digest_get_name, -//GO(gnutls_digest_get_oid, -//GO(gnutls_digest_list, -//GO(gnutls_dtls_cookie_send, -//GO(gnutls_dtls_cookie_verify, -//GO(gnutls_dtls_get_data_mtu, -//GO(gnutls_dtls_get_mtu, -//GO(gnutls_dtls_get_timeout, -//GO(gnutls_dtls_prestate_set, -//GO(gnutls_dtls_set_data_mtu, +GO(gnutls_digest_get_id, uFp) +GO(gnutls_digest_get_name, pFu) +GO(gnutls_digest_get_oid, pFu) +GO(gnutls_digest_list, pFv) +//GOM(gnutls_dtls_cookie_send, iFEppLppp) +GO(gnutls_dtls_cookie_verify, iFppLpLp) +GO(gnutls_dtls_get_data_mtu, uFp) +GO(gnutls_dtls_get_mtu, uFp) +GO(gnutls_dtls_get_timeout, uFp) +GO(gnutls_dtls_prestate_set, vFpp) +GO(gnutls_dtls_set_data_mtu, iFpu) GO(gnutls_dtls_set_mtu, vFpu) GO(gnutls_dtls_set_timeouts, vFpuu) -//GO(gnutls_ecc_curve_get, -//GO(gnutls_ecc_curve_get_id, -//GO(gnutls_ecc_curve_get_name, -//GO(gnutls_ecc_curve_get_oid, -//GO(gnutls_ecc_curve_get_pk, -//GO(gnutls_ecc_curve_get_size, -//GO(gnutls_ecc_curve_list, +GO(gnutls_ecc_curve_get, uFp) +GO(gnutls_ecc_curve_get_id, uFp) +GO(gnutls_ecc_curve_get_name, pFu) +GO(gnutls_ecc_curve_get_oid, pFu) +GO(gnutls_ecc_curve_get_pk, uFu) +GO(gnutls_ecc_curve_get_size, iFu) +GO(gnutls_ecc_curve_list, pFv) GO(_gnutls_ecdh_compute_key, iFipppppp) GO(gnutls_ecdh_compute_key, iFipppppp) -//GO(gnutls_encode_ber_digest_info, +GO(gnutls_encode_ber_digest_info, iFupp) //GO(_gnutls_encode_ber_rs_raw, GO(gnutls_error_is_fatal, iFi) -//GO(gnutls_error_to_alert, -//GO(gnutls_est_record_overhead_size, +GO(gnutls_error_to_alert, iFip) +GO(gnutls_est_record_overhead_size, LFuuuuu) GO(gnutls_privkey_export_dh_raw, iFppppu) -//GO(gnutls_ext_get_data, -//GO(gnutls_ext_get_name, -//GO(gnutls_ext_register, -//GO(gnutls_ext_set_data, -//GO(gnutls_fingerprint, -//GO(gnutls_fips140_mode_enabled, -GO(gnutls_free, vFp) +GO(gnutls_ext_get_data, iFpup) +GO(gnutls_ext_get_name, pFu) +//GOM(gnutls_ext_register, iFEpiuppppp) +GO(gnutls_ext_set_data, vFpup) +GO(gnutls_fingerprint, iFuppp) +GO(gnutls_fips140_mode_enabled, uFv) +GO(gnutls_fips140_set_mode, vFuu) +GO(gnutls_free, vFp)//DATAM(gnutls_free, 8) GO(gnutls_global_deinit, vFv) GO(gnutls_global_init, iFv) -//GO(gnutls_global_set_audit_log_function, +//GOM(gnutls_global_set_audit_log_function, vFEp) GOM(gnutls_global_set_log_function, vFEp) GO(gnutls_global_set_log_level, vFi) -//GO(gnutls_global_set_mem_functions, -//GO(gnutls_global_set_mutex, -//GO(gnutls_global_set_time_function, +//GOM(gnutls_global_set_mem_functions, vFEppppp) +//GOM(gnutls_global_set_mutex, vFEpppp) +//GOM(gnutls_global_set_time_function, vFEp) GO(gnutls_handshake, iFp) -//GO(gnutls_handshake_description_get_name, -//GO(gnutls_handshake_get_last_in, -//GO(gnutls_handshake_get_last_out, -//GO(gnutls_handshake_set_hook_function, -//GO(gnutls_handshake_set_max_packet_length, -//GO(gnutls_handshake_set_post_client_hello_function, -//GO(gnutls_handshake_set_private_extensions, -//GO(gnutls_handshake_set_random, -//GO(gnutls_handshake_set_timeout, -//GO(gnutls_hash, -//GO(gnutls_hash_deinit, -//GO(gnutls_hash_fast, -//GO(gnutls_hash_get_len, -//GO(gnutls_hash_init, -//GO(gnutls_hash_output, -//GO(gnutls_heartbeat_allowed, -//GO(gnutls_heartbeat_enable, -//GO(gnutls_heartbeat_get_timeout, -//GO(gnutls_heartbeat_ping, -//GO(gnutls_heartbeat_pong, -//GO(gnutls_heartbeat_set_timeouts, +GO(gnutls_handshake_description_get_name, pFu) +GO(gnutls_handshake_get_last_in, uFp) +GO(gnutls_handshake_get_last_out, uFp) +//GOM(gnutls_handshake_set_hook_function, vFEpuip) +GO(gnutls_handshake_set_max_packet_length, vFpL) +//GOM(gnutls_handshake_set_post_client_hello_function, vFEpp) +GO(gnutls_handshake_set_private_extensions, vFpi) +GO(gnutls_handshake_set_random, iFpp) +GO(gnutls_handshake_set_timeout, vFpu) +GO(gnutls_hash, iFppL) +GO(gnutls_hash_deinit, vFpp) +GO(gnutls_hash_fast, iFupLp) +GO(gnutls_hash_get_len, uFu) +GO(gnutls_hash_init, iFpu) +GO(gnutls_hash_output, vFpp) +GO(gnutls_heartbeat_allowed, uFpu) +GO(gnutls_heartbeat_enable, vFpu) +GO(gnutls_heartbeat_get_timeout, uFp) +GO(gnutls_heartbeat_ping, iFpLuu) +GO(gnutls_heartbeat_pong, iFpu) +GO(gnutls_heartbeat_set_timeouts, vFpuu) //GO(_gnutls_hello_set_default_version, -//GO(gnutls_hex2bin, -//GO(gnutls_hex_decode, -//GO(gnutls_hex_decode2, -//GO(gnutls_hex_encode, -//GO(gnutls_hex_encode2, -//GO(gnutls_hmac, -//GO(gnutls_hmac_deinit, -//GO(gnutls_hmac_fast, -//GO(gnutls_hmac_get_len, -//GO(gnutls_hmac_init, -//GO(gnutls_hmac_output, -//GO(gnutls_hmac_set_nonce, -//GO(gnutls_idna_map, -//GO(gnutls_idna_reverse_map, +GO(gnutls_hex2bin, iFpLpp) +GO(gnutls_hex_decode, iFppp) +GO(gnutls_hex_decode2, iFpp) +GO(gnutls_hex_encode, iFppp) +GO(gnutls_hex_encode2, iFpp) +GO(gnutls_hmac, iFppL) +GO(gnutls_hmac_deinit, vFpp) +GO(gnutls_hmac_fast, iFupLpLp) +GO(gnutls_hmac_get_len, uFu) +GO(gnutls_hmac_init, iFpupL) +GO(gnutls_hmac_output, vFpp) +GO(gnutls_hmac_set_nonce, vFppL) +GO(gnutls_idna_map, iFpupu) +GO(gnutls_idna_reverse_map, iFpupu) GO(gnutls_init, iFpu) //GO(_gnutls_ip_to_string, -//GO(gnutls_key_generate, -GO(gnutls_kx_get, pFp) -//GO(gnutls_kx_get_id, -//GO(gnutls_kx_get_name, -//GO(gnutls_kx_list, +GO(gnutls_key_generate, iFpu) +GO(gnutls_kx_get, uFp) +GO(gnutls_kx_get_id, uFp) +GO(gnutls_kx_get_name, pFu) +GO(gnutls_kx_list, pFv) //GO(_gnutls_lib_simulate_error, -//GO(gnutls_load_file, +GO(gnutls_load_file, iFpp) //GO(_gnutls_log, -GO(gnutls_mac_get, pFp) -//GO(gnutls_mac_get_id, -GO(gnutls_mac_get_key_size, LFp) -//GO(gnutls_mac_get_name, -//GO(gnutls_mac_get_nonce_size, -//GO(gnutls_mac_list, +GO(gnutls_mac_get, uFp) +GO(gnutls_mac_get_id, uFp) +GO(gnutls_mac_get_key_size, LFu) +GO(gnutls_mac_get_name, pFu) +GO(gnutls_mac_get_nonce_size, LFu) +GO(gnutls_mac_list, pFv) //GO(_gnutls_mac_to_entry, -//GO(gnutls_memcmp, -//GO(gnutls_memset, +GO(gnutls_memcmp, iFppL) +GO(gnutls_memset, vFpiL) //GO(_gnutls_mpi_log, -//GO(gnutls_ocsp_req_add_cert, -//GO(gnutls_ocsp_req_add_cert_id, -//GO(gnutls_ocsp_req_deinit, -//GO(gnutls_ocsp_req_export, -//GO(gnutls_ocsp_req_get_cert_id, -//GO(gnutls_ocsp_req_get_extension, -//GO(gnutls_ocsp_req_get_nonce, -//GO(gnutls_ocsp_req_get_version, -//GO(gnutls_ocsp_req_import, -//GO(gnutls_ocsp_req_init, -//GO(gnutls_ocsp_req_print, -//GO(gnutls_ocsp_req_randomize_nonce, -//GO(gnutls_ocsp_req_set_extension, -//GO(gnutls_ocsp_req_set_nonce, -//GO(gnutls_ocsp_resp_check_crt, +GO(gnutls_ocsp_req_add_cert, iFpupp) +GO(gnutls_ocsp_req_add_cert_id, iFpuppp) +GO(gnutls_ocsp_req_deinit, vFp) +GO(gnutls_ocsp_req_export, iFpp) +GO(gnutls_ocsp_req_get_cert_id, iFpupppp) +GO(gnutls_ocsp_req_get_extension, iFpuppp) +GO(gnutls_ocsp_req_get_nonce, iFppp) +GO(gnutls_ocsp_req_get_version, iFp) +GO(gnutls_ocsp_req_import, iFpp) +GO(gnutls_ocsp_req_init, iFp) +GO(gnutls_ocsp_req_print, iFpup) +GO(gnutls_ocsp_req_randomize_nonce, iFp) +GO(gnutls_ocsp_req_set_extension, iFppup) +GO(gnutls_ocsp_req_set_nonce, iFpup) +GO(gnutls_ocsp_resp_check_crt, iFpup) GO(gnutls_ocsp_resp_deinit, vFp) -//GO(gnutls_ocsp_resp_export, -//GO(gnutls_ocsp_resp_get_certs, -//GO(gnutls_ocsp_resp_get_extension, -//GO(gnutls_ocsp_resp_get_nonce, -//GO(gnutls_ocsp_resp_get_produced, -//GO(gnutls_ocsp_resp_get_responder, -//GO(gnutls_ocsp_resp_get_responder2, -//GO(gnutls_ocsp_resp_get_responder_raw_id, -//GO(gnutls_ocsp_resp_get_response, -//GO(gnutls_ocsp_resp_get_signature, -//GO(gnutls_ocsp_resp_get_signature_algorithm, +GO(gnutls_ocsp_resp_export, iFpp) +GO(gnutls_ocsp_resp_get_certs, iFppp) +GO(gnutls_ocsp_resp_get_extension, iFpuppp) +GO(gnutls_ocsp_resp_get_nonce, iFppp) +GO(gnutls_ocsp_resp_get_produced, lFp) +GO(gnutls_ocsp_resp_get_responder, iFpp) +GO(gnutls_ocsp_resp_get_responder2, iFppu) +GO(gnutls_ocsp_resp_get_responder_raw_id, iFpup) +GO(gnutls_ocsp_resp_get_response, iFppp) +GO(gnutls_ocsp_resp_get_signature, iFpp) +GO(gnutls_ocsp_resp_get_signature_algorithm, iFp) GO(gnutls_ocsp_resp_get_single, iFpuppppppppp) -//GO(gnutls_ocsp_resp_get_status, -//GO(gnutls_ocsp_resp_get_version, +GO(gnutls_ocsp_resp_get_status, iFp) +GO(gnutls_ocsp_resp_get_version, iFp) GO(gnutls_ocsp_resp_import, iFpp) GO(gnutls_ocsp_resp_init, iFp) -//GO(gnutls_ocsp_resp_print, -//GO(gnutls_ocsp_resp_verify, -//GO(gnutls_ocsp_resp_verify_direct, +GO(gnutls_ocsp_resp_print, iFpup) +GO(gnutls_ocsp_resp_verify, iFpppu) +GO(gnutls_ocsp_resp_verify_direct, iFpppu) GO(gnutls_ocsp_status_request_enable_client, iFppLp) GO(gnutls_ocsp_status_request_get, iFpp) GO(gnutls_ocsp_status_request_is_checked, uFpu) -//GO(gnutls_oid_to_digest, -//GO(gnutls_oid_to_ecc_curve, -//GO(gnutls_oid_to_mac, -//GO(gnutls_oid_to_pk, -//GO(gnutls_oid_to_sign, -//GO(gnutls_openpgp_crt_check_email, -//GO(gnutls_openpgp_crt_check_hostname, -//GO(gnutls_openpgp_crt_check_hostname2, -//GO(gnutls_openpgp_crt_deinit, -//GO(gnutls_openpgp_crt_export, -//GO(gnutls_openpgp_crt_export2, -//GO(gnutls_openpgp_crt_get_auth_subkey, -//GO(gnutls_openpgp_crt_get_creation_time, -//GO(gnutls_openpgp_crt_get_expiration_time, -//GO(gnutls_openpgp_crt_get_fingerprint, -//GO(gnutls_openpgp_crt_get_key_id, -//GO(gnutls_openpgp_crt_get_key_usage, -//GO(gnutls_openpgp_crt_get_name, -//GO(gnutls_openpgp_crt_get_pk_algorithm, -//GO(gnutls_openpgp_crt_get_pk_dsa_raw, -//GO(gnutls_openpgp_crt_get_pk_rsa_raw, -//GO(gnutls_openpgp_crt_get_preferred_key_id, -//GO(gnutls_openpgp_crt_get_revoked_status, -//GO(gnutls_openpgp_crt_get_subkey_count, -//GO(gnutls_openpgp_crt_get_subkey_creation_time, -//GO(gnutls_openpgp_crt_get_subkey_expiration_time, -//GO(gnutls_openpgp_crt_get_subkey_fingerprint, -//GO(gnutls_openpgp_crt_get_subkey_id, -//GO(gnutls_openpgp_crt_get_subkey_idx, -//GO(gnutls_openpgp_crt_get_subkey_pk_algorithm, -//GO(gnutls_openpgp_crt_get_subkey_pk_dsa_raw, -//GO(gnutls_openpgp_crt_get_subkey_pk_rsa_raw, -//GO(gnutls_openpgp_crt_get_subkey_revoked_status, -//GO(gnutls_openpgp_crt_get_subkey_usage, -//GO(gnutls_openpgp_crt_get_version, -//GO(gnutls_openpgp_crt_import, -//GO(gnutls_openpgp_crt_init, -//GO(gnutls_openpgp_crt_print, -//GO(gnutls_openpgp_crt_set_preferred_key_id, -//GO(gnutls_openpgp_crt_verify_ring, -//GO(gnutls_openpgp_crt_verify_self, -//GO(gnutls_openpgp_keyring_check_id, -//GO(gnutls_openpgp_keyring_deinit, -//GO(gnutls_openpgp_keyring_get_crt, -//GO(gnutls_openpgp_keyring_get_crt_count, -//GO(gnutls_openpgp_keyring_import, -//GO(gnutls_openpgp_keyring_init, -//GO(gnutls_openpgp_privkey_deinit, -//GO(gnutls_openpgp_privkey_export, -//GO(gnutls_openpgp_privkey_export2, -//GO(gnutls_openpgp_privkey_export_dsa_raw, -//GO(gnutls_openpgp_privkey_export_rsa_raw, -//GO(gnutls_openpgp_privkey_export_subkey_dsa_raw, -//GO(gnutls_openpgp_privkey_export_subkey_rsa_raw, -//GO(gnutls_openpgp_privkey_get_fingerprint, -//GO(gnutls_openpgp_privkey_get_key_id, -//GO(gnutls_openpgp_privkey_get_pk_algorithm, -//GO(gnutls_openpgp_privkey_get_preferred_key_id, -//GO(gnutls_openpgp_privkey_get_revoked_status, -//GO(gnutls_openpgp_privkey_get_subkey_count, -//GO(gnutls_openpgp_privkey_get_subkey_creation_time, -//GO(gnutls_openpgp_privkey_get_subkey_expiration_time, -//GO(gnutls_openpgp_privkey_get_subkey_fingerprint, -//GO(gnutls_openpgp_privkey_get_subkey_id, -//GO(gnutls_openpgp_privkey_get_subkey_idx, -//GO(gnutls_openpgp_privkey_get_subkey_pk_algorithm, -//GO(gnutls_openpgp_privkey_get_subkey_revoked_status, -//GO(gnutls_openpgp_privkey_import, -//GO(gnutls_openpgp_privkey_init, -//GO(gnutls_openpgp_privkey_sec_param, -//GO(gnutls_openpgp_privkey_set_preferred_key_id, -//GO(gnutls_openpgp_privkey_sign_hash, -//GO(gnutls_openpgp_send_cert, -//GO(gnutls_openpgp_set_recv_key_function, -//GO(gnutls_packet_deinit, -//GO(gnutls_packet_get, -//GO(gnutls_pcert_deinit, -//GO(gnutls_pcert_export_openpgp, -//GO(gnutls_pcert_export_x509, -//GO(gnutls_pcert_import_openpgp, -//GO(gnutls_pcert_import_openpgp_raw, -//GO(gnutls_pcert_import_x509, -//GO(gnutls_pcert_import_x509_list, -//GO(gnutls_pcert_import_x509_raw, -//GO(gnutls_pcert_list_import_x509_raw, -//GO(gnutls_pem_base64_decode, -//GO(gnutls_pem_base64_decode2, -//GO(gnutls_pem_base64_encode, -//GO(gnutls_pem_base64_encode2, +GO(gnutls_oid_to_digest, uFp) +GO(gnutls_oid_to_ecc_curve, uFp) +GO(gnutls_oid_to_mac, uFp) +GO(gnutls_oid_to_pk, uFp) +GO(gnutls_oid_to_sign, uFp) +GO(gnutls_openpgp_crt_check_email, iFppu) +GO(gnutls_openpgp_crt_check_hostname, iFpp) +GO(gnutls_openpgp_crt_check_hostname2, iFppu) +GO(gnutls_openpgp_crt_deinit, vFp) +GO(gnutls_openpgp_crt_export, iFpupp) +GO(gnutls_openpgp_crt_export2, iFpup) +GO(gnutls_openpgp_crt_get_auth_subkey, iFppu) +GO(gnutls_openpgp_crt_get_creation_time, lFp) +GO(gnutls_openpgp_crt_get_expiration_time, lFp) +GO(gnutls_openpgp_crt_get_fingerprint, iFppp) +GO(gnutls_openpgp_crt_get_key_id, iFpp) +GO(gnutls_openpgp_crt_get_key_usage, iFpp) +GO(gnutls_openpgp_crt_get_name, iFpipp) +GO(gnutls_openpgp_crt_get_pk_algorithm, uFpp) +GO(gnutls_openpgp_crt_get_pk_dsa_raw, iFppppp) +GO(gnutls_openpgp_crt_get_pk_rsa_raw, iFppp) +GO(gnutls_openpgp_crt_get_preferred_key_id, iFpp) +GO(gnutls_openpgp_crt_get_revoked_status, iFp) +GO(gnutls_openpgp_crt_get_subkey_count, iFp) +GO(gnutls_openpgp_crt_get_subkey_creation_time, lFpu) +GO(gnutls_openpgp_crt_get_subkey_expiration_time, lFpu) +GO(gnutls_openpgp_crt_get_subkey_fingerprint, iFpupp) +GO(gnutls_openpgp_crt_get_subkey_id, iFpup) +GO(gnutls_openpgp_crt_get_subkey_idx, iFpp) +GO(gnutls_openpgp_crt_get_subkey_pk_algorithm, uFpup) +GO(gnutls_openpgp_crt_get_subkey_pk_dsa_raw, iFpupppp) +GO(gnutls_openpgp_crt_get_subkey_pk_rsa_raw, iFpupp) +GO(gnutls_openpgp_crt_get_subkey_revoked_status, iFpu) +GO(gnutls_openpgp_crt_get_subkey_usage, iFpup) +GO(gnutls_openpgp_crt_get_version, iFp) +GO(gnutls_openpgp_crt_import, iFppu) +GO(gnutls_openpgp_crt_init, iFp) +GO(gnutls_openpgp_crt_print, iFpup) +GO(gnutls_openpgp_crt_set_preferred_key_id, iFpp) +GO(gnutls_openpgp_crt_verify_ring, iFppup) +GO(gnutls_openpgp_crt_verify_self, iFpup) +GO(gnutls_openpgp_keyring_check_id, iFppu) +GO(gnutls_openpgp_keyring_deinit, vFp) +GO(gnutls_openpgp_keyring_get_crt, iFpup) +GO(gnutls_openpgp_keyring_get_crt_count, iFp) +GO(gnutls_openpgp_keyring_import, iFppu) +GO(gnutls_openpgp_keyring_init, iFp) +GO(gnutls_openpgp_privkey_deinit, vFp) +GO(gnutls_openpgp_privkey_export, iFpupupp) +GO(gnutls_openpgp_privkey_export2, iFpupup) +GO(gnutls_openpgp_privkey_export_dsa_raw, iFpppppp) +GO(gnutls_openpgp_privkey_export_rsa_raw, iFppppppp) +GO(gnutls_openpgp_privkey_export_subkey_dsa_raw, iFpuppppp) +GO(gnutls_openpgp_privkey_export_subkey_rsa_raw, iFpupppppp) +GO(gnutls_openpgp_privkey_get_fingerprint, iFppp) +GO(gnutls_openpgp_privkey_get_key_id, iFpp) +GO(gnutls_openpgp_privkey_get_pk_algorithm, uFpp) +GO(gnutls_openpgp_privkey_get_preferred_key_id, iFpp) +GO(gnutls_openpgp_privkey_get_revoked_status, iFp) +GO(gnutls_openpgp_privkey_get_subkey_count, iFp) +GO(gnutls_openpgp_privkey_get_subkey_creation_time, lFpu) +GO(gnutls_openpgp_privkey_get_subkey_expiration_time, lFpu) +GO(gnutls_openpgp_privkey_get_subkey_fingerprint, iFpupp) +GO(gnutls_openpgp_privkey_get_subkey_id, iFpup) +GO(gnutls_openpgp_privkey_get_subkey_idx, iFpp) +GO(gnutls_openpgp_privkey_get_subkey_pk_algorithm, uFpup) +GO(gnutls_openpgp_privkey_get_subkey_revoked_status, iFpu) +GO(gnutls_openpgp_privkey_import, iFppupu) +GO(gnutls_openpgp_privkey_init, iFp) +GO(gnutls_openpgp_privkey_sec_param, uFp) +GO(gnutls_openpgp_privkey_set_preferred_key_id, iFpp) +GO(gnutls_openpgp_privkey_sign_hash, iFppp) +GO(gnutls_openpgp_send_cert, vFpu) +//GOM(gnutls_openpgp_set_recv_key_function, vFEpp) +GO(gnutls_packet_deinit, vFp) +GO(gnutls_packet_get, vFppp) +GO(gnutls_pcert_deinit, vFp) +GO(gnutls_pcert_export_openpgp, iFpp) +GO(gnutls_pcert_export_x509, iFpp) +GO(gnutls_pcert_import_openpgp, iFppu) +GO(gnutls_pcert_import_openpgp_raw, iFppupu) +GO(gnutls_pcert_import_x509, iFppu) +GO(gnutls_pcert_import_x509_list, iFpppu) +GO(gnutls_pcert_import_x509_raw, iFppuu) +GO(gnutls_pcert_list_import_x509_raw, iFpppuu) +GO(gnutls_pem_base64_decode, iFpppp) +GO(gnutls_pem_base64_decode2, iFppp) +GO(gnutls_pem_base64_encode, iFpppp) +GO(gnutls_pem_base64_encode2, iFppp) GO(gnutls_perror, vFi) -GO(gnutls_pk_algorithm_get_name, pFi) -//GO(gnutls_pk_bits_to_sec_param, -//GO(gnutls_pkcs11_add_provider, -//GO(gnutls_pkcs11_copy_attached_extension, -//GO(gnutls_pkcs11_copy_pubkey, -//GO(gnutls_pkcs11_copy_secret_key, -//GO(gnutls_pkcs11_copy_x509_crt2, -//GO(gnutls_pkcs11_copy_x509_privkey2, -//GO(gnutls_pkcs11_crt_is_known, -//GO(gnutls_pkcs11_deinit, -//GO(gnutls_pkcs11_delete_url, -//GO(gnutls_pkcs11_get_pin_function, -//GO(gnutls_pkcs11_get_raw_issuer, -//GO(gnutls_pkcs11_get_raw_issuer_by_dn, -//GO(gnutls_pkcs11_get_raw_issuer_by_subject_key_id, -//GO(gnutls_pkcs11_init, -//GO(gnutls_pkcs11_obj_deinit, -//GO(gnutls_pkcs11_obj_export, -//GO(gnutls_pkcs11_obj_export2, -//GO(gnutls_pkcs11_obj_export3, -//GO(gnutls_pkcs11_obj_export_url, -//GO(gnutls_pkcs11_obj_flags_get_str, -//GO(gnutls_pkcs11_obj_get_exts, -//GO(gnutls_pkcs11_obj_get_flags, -//GO(gnutls_pkcs11_obj_get_info, -//GO(gnutls_pkcs11_obj_get_type, -//GO(gnutls_pkcs11_obj_import_url, -//GO(gnutls_pkcs11_obj_init, -//GO(gnutls_pkcs11_obj_list_import_url3, -//GO(gnutls_pkcs11_obj_list_import_url4, -//GO(gnutls_pkcs11_obj_set_info, -//GO(gnutls_pkcs11_obj_set_pin_function, -//GO(gnutls_pkcs11_privkey_cpy, -//GO(gnutls_pkcs11_privkey_deinit, -//GO(gnutls_pkcs11_privkey_export_pubkey, -//GO(gnutls_pkcs11_privkey_export_url, -//GO(gnutls_pkcs11_privkey_generate3, -//GO(gnutls_pkcs11_privkey_get_info, -//GO(gnutls_pkcs11_privkey_get_pk_algorithm, -//GO(gnutls_pkcs11_privkey_import_url, -//GO(gnutls_pkcs11_privkey_init, -//GO(gnutls_pkcs11_privkey_set_pin_function, -//GO(gnutls_pkcs11_privkey_status, -//GO(gnutls_pkcs11_reinit, -//GO(gnutls_pkcs11_set_pin_function, -//GO(gnutls_pkcs11_set_token_function, -//GO(gnutls_pkcs11_token_get_flags, -//GO(gnutls_pkcs11_token_get_info, -//GO(gnutls_pkcs11_token_get_mechanism, -//GO(gnutls_pkcs11_token_get_random, -//GO(gnutls_pkcs11_token_get_url, -//GO(gnutls_pkcs11_token_init, -//GO(gnutls_pkcs11_token_set_pin, -//GO(gnutls_pkcs11_type_get_name, -//GO(gnutls_pkcs12_bag_decrypt, -//GO(gnutls_pkcs12_bag_deinit, -//GO(gnutls_pkcs12_bag_enc_info, -//GO(gnutls_pkcs12_bag_encrypt, -//GO(gnutls_pkcs12_bag_get_count, -//GO(gnutls_pkcs12_bag_get_data, -//GO(gnutls_pkcs12_bag_get_friendly_name, -//GO(gnutls_pkcs12_bag_get_key_id, -//GO(gnutls_pkcs12_bag_get_type, -//GO(gnutls_pkcs12_bag_init, -//GO(gnutls_pkcs12_bag_set_crl, -//GO(gnutls_pkcs12_bag_set_crt, -//GO(gnutls_pkcs12_bag_set_data, -//GO(gnutls_pkcs12_bag_set_friendly_name, -//GO(gnutls_pkcs12_bag_set_key_id, -//GO(gnutls_pkcs12_bag_set_privkey, +GO(gnutls_pk_algorithm_get_name, pFu) +GO(gnutls_pk_bits_to_sec_param, uFuu) +GO(gnutls_pkcs11_add_provider, iFpp) +GO(gnutls_pkcs11_copy_attached_extension, iFppppu) +GO(gnutls_pkcs11_copy_pubkey, iFppppuu) +GO(gnutls_pkcs11_copy_secret_key, iFpppuu) +GO(gnutls_pkcs11_copy_x509_crt2, iFppppu) +GO(gnutls_pkcs11_copy_x509_privkey2, iFppppuu) +GO(gnutls_pkcs11_crt_is_known, uFppu) +GO(gnutls_pkcs11_deinit, vFv) +GO(gnutls_pkcs11_delete_url, iFpu) +//GOM(gnutls_pkcs11_get_pin_function, pFEp) +GO(gnutls_pkcs11_get_raw_issuer, iFpppuu) +GO(gnutls_pkcs11_get_raw_issuer_by_dn, iFpppuu) +GO(gnutls_pkcs11_get_raw_issuer_by_subject_key_id, iFppppuu) +GO(gnutls_pkcs11_init, iFup) +GO(gnutls_pkcs11_obj_deinit, vFp) +GO(gnutls_pkcs11_obj_export, iFppp) +GO(gnutls_pkcs11_obj_export2, iFpp) +GO(gnutls_pkcs11_obj_export3, iFpup) +GO(gnutls_pkcs11_obj_export_url, iFpup) +GO(gnutls_pkcs11_obj_flags_get_str, pFu) +GO(gnutls_pkcs11_obj_get_exts, iFpppu) +GO(gnutls_pkcs11_obj_get_flags, iFpp) +GO(gnutls_pkcs11_obj_get_info, iFpupp) +GO(gnutls_pkcs11_obj_get_type, uFp) +GO(gnutls_pkcs11_obj_import_url, iFppu) +GO(gnutls_pkcs11_obj_init, iFp) +GO(gnutls_pkcs11_obj_list_import_url3, iFpppu) +GO(gnutls_pkcs11_obj_list_import_url4, iFpppu) +GO(gnutls_pkcs11_obj_set_info, iFpupLu) +//GOM(gnutls_pkcs11_obj_set_pin_function, vFEppp) +GO(gnutls_pkcs11_privkey_cpy, iFpp) +GO(gnutls_pkcs11_privkey_deinit, vFp) +GO(gnutls_pkcs11_privkey_export_pubkey, iFpupu) +GO(gnutls_pkcs11_privkey_export_url, iFpup) +GO(gnutls_pkcs11_privkey_generate3, iFpuuppupuu) +GO(gnutls_pkcs11_privkey_get_info, iFpupp) +GO(gnutls_pkcs11_privkey_get_pk_algorithm, iFpp) +GO(gnutls_pkcs11_privkey_import_url, iFppu) +GO(gnutls_pkcs11_privkey_init, iFp) +//GOM(gnutls_pkcs11_privkey_set_pin_function, vFEppp) +GO(gnutls_pkcs11_privkey_status, uFp) +GO(gnutls_pkcs11_reinit, iFv) +//GOM(gnutls_pkcs11_set_pin_function, vFEpp) +//GOM(gnutls_pkcs11_set_token_function, vFEpp) +GO(gnutls_pkcs11_token_get_flags, iFpp) +GO(gnutls_pkcs11_token_get_info, iFpupp) +GO(gnutls_pkcs11_token_get_mechanism, iFpup) +GO(gnutls_pkcs11_token_get_random, iFppL) +GO(gnutls_pkcs11_token_get_url, iFuup) +GO(gnutls_pkcs11_token_init, iFppp) +GO(gnutls_pkcs11_token_set_pin, iFpppu) +GO(gnutls_pkcs11_type_get_name, pFu) +GO(gnutls_pkcs12_bag_decrypt, iFpp) +GO(gnutls_pkcs12_bag_deinit, vFp) +GO(gnutls_pkcs12_bag_enc_info, iFppppppp) +GO(gnutls_pkcs12_bag_encrypt, iFppu) +GO(gnutls_pkcs12_bag_get_count, iFp) +GO(gnutls_pkcs12_bag_get_data, iFpup) +GO(gnutls_pkcs12_bag_get_friendly_name, iFpup) +GO(gnutls_pkcs12_bag_get_key_id, iFpup) +GO(gnutls_pkcs12_bag_get_type, iFpu) +GO(gnutls_pkcs12_bag_init, iFp) +GO(gnutls_pkcs12_bag_set_crl, iFpp) +GO(gnutls_pkcs12_bag_set_crt, iFpp) +GO(gnutls_pkcs12_bag_set_data, iFpup) +GO(gnutls_pkcs12_bag_set_friendly_name, iFpup) +GO(gnutls_pkcs12_bag_set_key_id, iFpup) +GO(gnutls_pkcs12_bag_set_privkey, iFpppu) GO(gnutls_pkcs12_deinit, vFp) -//GO(gnutls_pkcs12_export, -//GO(gnutls_pkcs12_export2, -//GO(gnutls_pkcs12_generate_mac, -//GO(gnutls_pkcs12_generate_mac2, -//GO(gnutls_pkcs12_get_bag, -GO(gnutls_pkcs12_import, iFpppu) +GO(gnutls_pkcs12_export, iFpupp) +GO(gnutls_pkcs12_export2, iFpup) +GO(gnutls_pkcs12_generate_mac, iFpp) +GO(gnutls_pkcs12_generate_mac2, iFpup) +GO(gnutls_pkcs12_get_bag, iFpip) +GO(gnutls_pkcs12_import, iFppuu) GO(gnutls_pkcs12_init, iFp) -//GO(gnutls_pkcs12_mac_info, -//GO(gnutls_pkcs12_set_bag, +GO(gnutls_pkcs12_mac_info, iFpppppp) +GO(gnutls_pkcs12_set_bag, iFpp) GO(gnutls_pkcs12_simple_parse, iFppppppppu) //GO(_gnutls_pkcs12_string_to_key, -//GO(gnutls_pkcs12_verify_mac, -//GO(gnutls_pkcs7_add_attr, -//GO(gnutls_pkcs7_attrs_deinit, -//GO(gnutls_pkcs7_deinit, -//GO(gnutls_pkcs7_delete_crl, -//GO(gnutls_pkcs7_delete_crt, -//GO(gnutls_pkcs7_export, -//GO(gnutls_pkcs7_export2, -//GO(gnutls_pkcs7_get_attr, -//GO(gnutls_pkcs7_get_crl_count, -//GO(gnutls_pkcs7_get_crl_raw, -//GO(gnutls_pkcs7_get_crl_raw2, -//GO(gnutls_pkcs7_get_crt_count, -//GO(gnutls_pkcs7_get_crt_raw, -//GO(gnutls_pkcs7_get_crt_raw2, -//GO(gnutls_pkcs7_get_embedded_data, -//GO(gnutls_pkcs7_get_embedded_data_oid, -//GO(gnutls_pkcs7_get_signature_count, -//GO(gnutls_pkcs7_get_signature_info, -//GO(gnutls_pkcs7_import, -//GO(gnutls_pkcs7_init, -//GO(gnutls_pkcs7_print, -//GO(gnutls_pkcs7_set_crl, -//GO(gnutls_pkcs7_set_crl_raw, -//GO(gnutls_pkcs7_set_crt, -//GO(gnutls_pkcs7_set_crt_raw, -//GO(gnutls_pkcs7_sign, -//GO(gnutls_pkcs7_signature_info_deinit, -//GO(gnutls_pkcs7_verify, -//GO(gnutls_pkcs7_verify_direct, -//GO(gnutls_pkcs8_info, -//GO(gnutls_pkcs_schema_get_name, -//GO(gnutls_pkcs_schema_get_oid, -//GO(gnutls_pk_get_id, -//GO(gnutls_pk_get_name, -//GO(gnutls_pk_get_oid, -//GO(gnutls_pk_list, -GO(gnutls_pk_to_sign, pFpp) -//GO(gnutls_prf, -//GO(gnutls_prf_raw, -//GO(gnutls_prf_rfc5705, -//GO(gnutls_priority_certificate_type_list, -//GO(gnutls_priority_cipher_list, -//GO(gnutls_priority_compression_list, -//GO(gnutls_priority_deinit, -//GO(gnutls_priority_ecc_curve_list, -//GO(gnutls_priority_get_cipher_suite_index, -//GO(gnutls_priority_init, -//GO(gnutls_priority_kx_list, -//GO(gnutls_priority_mac_list, -//GO(gnutls_priority_protocol_list, -//GO(gnutls_priority_set, +GO(gnutls_pkcs12_verify_mac, iFpp) +GO(gnutls_pkcs7_add_attr, iFpppu) +GO(gnutls_pkcs7_attrs_deinit, vFp) +GO(gnutls_pkcs7_deinit, vFp) +GO(gnutls_pkcs7_delete_crl, iFpi) +GO(gnutls_pkcs7_delete_crt, iFpi) +GO(gnutls_pkcs7_export, iFpupp) +GO(gnutls_pkcs7_export2, iFpup) +GO(gnutls_pkcs7_get_attr, iFpuppu) +GO(gnutls_pkcs7_get_crl_count, iFp) +GO(gnutls_pkcs7_get_crl_raw, iFpupp) +GO(gnutls_pkcs7_get_crl_raw2, iFpup) +GO(gnutls_pkcs7_get_crt_count, iFp) +GO(gnutls_pkcs7_get_crt_raw, iFpupp) +GO(gnutls_pkcs7_get_crt_raw2, iFpup) +GO(gnutls_pkcs7_get_embedded_data, iFpup) +GO(gnutls_pkcs7_get_embedded_data_oid, pFp) +GO(gnutls_pkcs7_get_signature_count, iFp) +GO(gnutls_pkcs7_get_signature_info, iFpup) +GO(gnutls_pkcs7_import, iFppu) +GO(gnutls_pkcs7_init, iFp) +GO(gnutls_pkcs7_print, iFpup) +GO(gnutls_pkcs7_set_crl, iFpp) +GO(gnutls_pkcs7_set_crl_raw, iFpp) +GO(gnutls_pkcs7_set_crt, iFpp) +GO(gnutls_pkcs7_set_crt_raw, iFpp) +GO(gnutls_pkcs7_sign, iFppppppuu) +GO(gnutls_pkcs7_signature_info_deinit, vFp) +GO(gnutls_pkcs7_verify, iFpppuupu) +GO(gnutls_pkcs7_verify_direct, iFppupu) +GO(gnutls_pkcs8_info, iFpupppppp) +GO(gnutls_pkcs_schema_get_name, pFu) +GO(gnutls_pkcs_schema_get_oid, pFu) +GO(gnutls_pk_get_id, uFp) +GO(gnutls_pk_get_name, pFu) +GO(gnutls_pk_get_oid, pFu) +GO(gnutls_pk_list, pFv) +GO(gnutls_pk_to_sign, uFuu) +GO(gnutls_prf, iFpLpiLpLp) +GO(gnutls_prf_raw, iFpLpLpLp) +GO(gnutls_prf_rfc5705, iFpLpLpLp) +GO(gnutls_priority_certificate_type_list, iFpp) +GO(gnutls_priority_cipher_list, iFpp) +GO(gnutls_priority_compression_list, iFpp) +GO(gnutls_priority_deinit, vFp) +GO(gnutls_priority_ecc_curve_list, iFpp) +GO(gnutls_priority_get_cipher_suite_index, iFpup) +GO(gnutls_priority_init, iFppp) +GO(gnutls_priority_kx_list, iFpp) +GO(gnutls_priority_mac_list, iFpp) +GO(gnutls_priority_protocol_list, iFpp) +GO(gnutls_priority_set, iFpp) GO(gnutls_priority_set_direct, iFppp) -//GO(gnutls_priority_sign_list, -//GO(gnutls_priority_string_list, -GO(gnutls_privkey_decrypt_data, iFpipp) +GO(gnutls_priority_sign_list, iFpp) +GO(gnutls_priority_string_list, pFuu) +GO(gnutls_privkey_decrypt_data, iFpupp) GO(gnutls_privkey_deinit, vFp) GO(gnutls_privkey_derive_secret, iFppppu) GO(gnutls_privkey_export_dsa_raw, iFpppppp) GO(gnutls_privkey_export_ecc_raw, iFppppp) -//GO(gnutls_privkey_export_openpgp, -//GO(gnutls_privkey_export_pkcs11, +GO(gnutls_privkey_export_openpgp, iFpp) +GO(gnutls_privkey_export_pkcs11, iFpp) GO(gnutls_privkey_export_rsa_raw, iFppppppppp) GO(gnutls_privkey_export_x509, iFpp) -GO(gnutls_privkey_generate, iFppuu) +GO(gnutls_privkey_generate, iFpuuu) GO(gnutls_privkey_generate2, iFpuuupu) -//GO(gnutls_privkey_get_pk_algorithm, -//GO(gnutls_privkey_get_seed, -//GO(gnutls_privkey_get_type, -GO(gnutls_privkey_import_dh_raw, iFpupp) +GO(gnutls_privkey_get_pk_algorithm, iFpp) +GO(gnutls_privkey_get_seed, iFpppp) +GO(gnutls_privkey_get_type, uFp) +GO(gnutls_privkey_import_dh_raw, iFpppp) GO(gnutls_privkey_import_dsa_raw, iFpppppp) -GO(gnutls_privkey_import_ecc_raw, iFppppp) -//GO(gnutls_privkey_import_ext, -//GO(gnutls_privkey_import_ext2, -//GO(gnutls_privkey_import_ext3, -//GO(gnutls_privkey_import_openpgp, -//GO(gnutls_privkey_import_openpgp_raw, -//GO(gnutls_privkey_import_pkcs11, +GO(gnutls_privkey_import_ecc_raw, iFpuppp) +//GOM(gnutls_privkey_import_ext, iFEpupppu) +//GOM(gnutls_privkey_import_ext2, iFEpuppppu) +//GOM(gnutls_privkey_import_ext3, iFEppppppu) +GO(gnutls_privkey_import_openpgp, iFppu) +GO(gnutls_privkey_import_openpgp_raw, iFppupp) +GO(gnutls_privkey_import_pkcs11, iFppu) GO(gnutls_privkey_import_rsa_raw, iFppppppppp) -//GO(gnutls_privkey_import_tpm_raw, -//GO(gnutls_privkey_import_tpm_url, -//GO(gnutls_privkey_import_url, -//GO(gnutls_privkey_import_x509, -//GO(gnutls_privkey_import_x509_raw, +GO(gnutls_privkey_import_tpm_raw, iFppuppu) +GO(gnutls_privkey_import_tpm_url, iFppppu) +GO(gnutls_privkey_import_url, iFppu) +GO(gnutls_privkey_import_x509, iFppu) +GO(gnutls_privkey_import_x509_raw, iFppupu) GO(gnutls_privkey_init, iFp) -//GO(gnutls_privkey_set_flags, -//GO(gnutls_privkey_set_pin_function, +GO(gnutls_privkey_set_flags, vFpu) +//GOM(gnutls_privkey_set_pin_function, vFEppp) GO(gnutls_privkey_set_spki, iFppu) -//GO(gnutls_privkey_sign_data, -GO(gnutls_privkey_sign_hash, iFppupp) -//GO(gnutls_privkey_status, -//GO(gnutls_privkey_verify_params, -//GO(gnutls_privkey_verify_seed, -//GO(gnutls_protocol_get_id, -GO(gnutls_protocol_get_name, pFi) -GO(gnutls_protocol_get_version, iFp) -//GO(gnutls_protocol_list, -//GO(gnutls_psk_allocate_client_credentials, -//GO(gnutls_psk_allocate_server_credentials, -//GO(gnutls_psk_client_get_hint, -//GO(gnutls_psk_free_client_credentials, -//GO(gnutls_psk_free_server_credentials, -//GO(gnutls_psk_server_get_username, -//GO(gnutls_psk_set_client_credentials, -//GO(gnutls_psk_set_client_credentials_function, -//GO(gnutls_psk_set_params_function, -//GO(gnutls_psk_set_server_credentials_file, -//GO(gnutls_psk_set_server_credentials_function, -//GO(gnutls_psk_set_server_credentials_hint, -//GO(gnutls_psk_set_server_dh_params, -//GO(gnutls_psk_set_server_known_dh_params, -//GO(gnutls_psk_set_server_params_function, +GO(gnutls_privkey_sign_data, iFpuupp) +GO(gnutls_privkey_sign_hash, iFpuupp) +GO(gnutls_privkey_status, iFp) +GO(gnutls_privkey_verify_params, iFp) +GO(gnutls_privkey_verify_seed, iFpupL) +GO(gnutls_protocol_get_id, uFp) +GO(gnutls_protocol_get_name, pFu) +GO(gnutls_protocol_get_version, uFp) +GO(gnutls_protocol_list, pFv) +GO(gnutls_psk_allocate_client_credentials, iFp) +GO(gnutls_psk_allocate_server_credentials, iFp) +GO(gnutls_psk_client_get_hint, pFp) +GO(gnutls_psk_free_client_credentials, vFp) +GO(gnutls_psk_free_server_credentials, vFp) +GO(gnutls_psk_server_get_username, pFp) +GO(gnutls_psk_set_client_credentials, iFpppu) +//GOM(gnutls_psk_set_client_credentials_function, vFEpp) +//GOM(gnutls_psk_set_params_function, vFEpp) +GO(gnutls_psk_set_server_credentials_file, iFpp) +//GOM(gnutls_psk_set_server_credentials_function, vFEpp) +GO(gnutls_psk_set_server_credentials_hint, iFpp) +GO(gnutls_psk_set_server_dh_params, vFpp) +GO(gnutls_psk_set_server_known_dh_params, iFpu) +//GOM(gnutls_psk_set_server_params_function, vFEpp) GO(gnutls_pubkey_deinit, vFp) GO(gnutls_pubkey_encrypt_data, iFpupp) -GO(gnutls_pubkey_export, iFpipp) -//GO(gnutls_pubkey_export2, +GO(gnutls_pubkey_export, iFpupp) +GO(gnutls_pubkey_export2, iFpup) GO(gnutls_pubkey_export_dsa_raw, iFppppp) -GO(gnutls_pubkey_export_dh_raw, iFpupu) +GO(gnutls_pubkey_export_dh_raw, iFpppu) GO(gnutls_pubkey_export_ecc_raw, iFpppp) -//GO(gnutls_pubkey_export_ecc_x962, +GO(gnutls_pubkey_export_ecc_x962, iFppp) GO(gnutls_pubkey_export_rsa_raw, iFppp) -//GO(gnutls_pubkey_get_key_id, -//GO(gnutls_pubkey_get_key_usage, -//GO(gnutls_pubkey_get_openpgp_key_id, -//GO(gnutls_pubkey_get_pk_algorithm, -//GO(gnutls_pubkey_get_preferred_hash_algorithm, -//GO(gnutls_pubkey_import, -GO(gnutls_pubkey_import_dh_raw, iFpup) +GO(gnutls_pubkey_get_key_id, iFpupp) +GO(gnutls_pubkey_get_key_usage, iFpp) +GO(gnutls_pubkey_get_openpgp_key_id, iFpuppp) +GO(gnutls_pubkey_get_pk_algorithm, iFpp) +GO(gnutls_pubkey_get_preferred_hash_algorithm, iFppp) +GO(gnutls_pubkey_import, iFppu) +GO(gnutls_pubkey_import_dh_raw, iFppp) GO(gnutls_pubkey_import_dsa_raw, iFppppp) -GO(gnutls_pubkey_import_ecc_raw, iFpppp) -//GO(gnutls_pubkey_import_ecc_x962, -//GO(gnutls_pubkey_import_openpgp, -//GO(gnutls_pubkey_import_openpgp_raw, -//GO(gnutls_pubkey_import_pkcs11, +GO(gnutls_pubkey_import_ecc_raw, iFpupp) +GO(gnutls_pubkey_import_ecc_x962, iFppp) +GO(gnutls_pubkey_import_openpgp, iFppu) +GO(gnutls_pubkey_import_openpgp_raw, iFppupu) +GO(gnutls_pubkey_import_pkcs11, iFppu) GO(gnutls_pubkey_import_privkey, iFppuu) GO(gnutls_pubkey_import_rsa_raw, iFppp) -//GO(gnutls_pubkey_import_tpm_raw, -//GO(gnutls_pubkey_import_tpm_url, -//GO(gnutls_pubkey_import_url, +GO(gnutls_pubkey_import_tpm_raw, iFppupu) +GO(gnutls_pubkey_import_tpm_url, iFpppu) +GO(gnutls_pubkey_import_url, iFppu) GO(gnutls_pubkey_import_x509, iFppu) -//GO(gnutls_pubkey_import_x509_crq, -//GO(gnutls_pubkey_import_x509_raw, +GO(gnutls_pubkey_import_x509_crq, iFppu) +GO(gnutls_pubkey_import_x509_raw, iFppuu) GO(gnutls_pubkey_init, iFp) -//GO(gnutls_pubkey_print, -//GO(gnutls_pubkey_set_key_usage, -//GO(gnutls_pubkey_set_pin_function, +GO(gnutls_pubkey_print, iFpup) +GO(gnutls_pubkey_set_key_usage, iFpu) +//GOM(gnutls_pubkey_set_pin_function, vFEppp) GO(gnutls_pubkey_set_spki, iFppu) -//GO(gnutls_pubkey_verify_data2, -GO(gnutls_pubkey_verify_hash2, iFppupp) -//GO(gnutls_pubkey_verify_params, -//GO(gnutls_random_art, -//GO(gnutls_range_split, -//GO(gnutls_record_can_use_length_hiding, -//GO(gnutls_record_check_corked, +GO(gnutls_pubkey_verify_data2, iFpuupp) +GO(gnutls_pubkey_verify_hash2, iFpuupp) +GO(gnutls_pubkey_verify_params, iFp) +GO(gnutls_random_art, iFupupLp) +GO(gnutls_range_split, iFpppp) +GO(gnutls_record_can_use_length_hiding, uFp) +GO(gnutls_record_check_corked, LFp) GO(gnutls_record_check_pending, LFp) -//GO(gnutls_record_cork, -//GO(gnutls_record_disable_padding, -//GO(gnutls_record_discard_queued, +GO(gnutls_record_cork, vFp) +GO(gnutls_record_disable_padding, vFp) +GO(gnutls_record_discard_queued, LFp) GO(gnutls_record_get_direction, iFp) -//GO(gnutls_record_get_discarded, +GO(gnutls_record_get_discarded, uFp) GO(gnutls_record_get_max_size, LFp) -//GO(gnutls_record_get_state, -//GO(gnutls_record_overhead_size, +GO(gnutls_record_get_state, iFpupppp) +GO(gnutls_record_overhead_size, LFp) GO(gnutls_record_recv, lFppL) -//GO(gnutls_record_recv_packet, -//GO(gnutls_record_recv_seq, +GO(gnutls_record_recv_packet, lFpp) +GO(gnutls_record_recv_seq, lFppLp) GO(gnutls_record_send, lFppL) -//GO(gnutls_record_send_range, +GO(gnutls_record_send_range, lFppLp) //GO(_gnutls_record_set_default_version, -//GO(gnutls_record_set_max_size, -//GO(gnutls_record_set_state, -//GO(gnutls_record_set_timeout, -//GO(gnutls_record_uncork, +GO(gnutls_record_set_max_size, lFpL) +GO(gnutls_record_set_state, iFpup) +GO(gnutls_record_set_timeout, vFpu) +GO(gnutls_record_uncork, iFpu) //GO(gnutls_register_custom_url, -//GO(gnutls_rehandshake, +GO(gnutls_rehandshake, iFp) //GO(_gnutls_resolve_priorities, -GO(gnutls_rnd, iFipL) -//GO(gnutls_rnd_refresh, +GO(gnutls_rnd, iFupL) +GO(gnutls_rnd_refresh, vFv) //GO(_gnutls_rsa_pms_set_version, -//GO(gnutls_safe_renegotiation_status, -//GO(gnutls_sec_param_get_name, -//GO(gnutls_sec_param_to_pk_bits, -//GO(gnutls_sec_param_to_symmetric_bits, -//GO(gnutls_server_name_get, -GO(gnutls_server_name_set, iFpppL) +GO(gnutls_safe_renegotiation_status, uFp) +GO(gnutls_sec_param_get_name, pFu) +GO(gnutls_sec_param_to_pk_bits, uFuu) +GO(gnutls_sec_param_to_symmetric_bits, uFu) +GO(gnutls_server_name_get, iFppppu) +GO(gnutls_server_name_set, iFpupL) //GO(_gnutls_server_name_set_raw, -GO(gnutls_session_channel_binding, iFpip) -//GO(gnutls_session_enable_compatibility_mode, -//GO(gnutls_session_etm_status, -//GO(gnutls_session_ext_master_secret_status, -//GO(gnutls_session_ext_register, -//GO(gnutls_session_force_valid, +GO(gnutls_session_channel_binding, iFpup) +GO(gnutls_session_enable_compatibility_mode, vFp) +GO(gnutls_session_etm_status, uFp) +GO(gnutls_session_ext_master_secret_status, uFp) +//GOM(gnutls_session_ext_register, iFEppiupppppu) +GO(gnutls_session_force_valid, vFp) GO(gnutls_session_get_data, iFppp) -//GO(gnutls_session_get_data2, -//GO(gnutls_session_get_desc, -//GO(gnutls_session_get_flags, -//GO(gnutls_session_get_id, -//GO(gnutls_session_get_id2, -//GO(gnutls_session_get_master_secret, -//GO(gnutls_session_get_ptr, -//GO(gnutls_session_get_random, -//GO(gnutls_session_get_verify_cert_status, -//GO(gnutls_session_is_resumed, -//GO(gnutls_session_resumption_requested, +GO(gnutls_session_get_data2, iFpp) +GO(gnutls_session_get_desc, pFp) +GO(gnutls_session_get_flags, uFp) +GO(gnutls_session_get_id, iFppp) +GO(gnutls_session_get_id2, iFpp) +GO(gnutls_session_get_master_secret, vFpp) +GO(gnutls_session_get_ptr, pFp) +GO(gnutls_session_get_random, vFppp) +GO(gnutls_session_get_verify_cert_status, uFp) +GO(gnutls_session_is_resumed, iFp) +GO(gnutls_session_resumption_requested, iFp) GO(gnutls_session_set_data, iFppL) -//GO(gnutls_session_set_id, -//GO(gnutls_session_set_premaster, -//GO(gnutls_session_set_ptr, -//GO(gnutls_session_set_verify_cert, -//GO(gnutls_session_set_verify_cert2, -//GO(gnutls_session_set_verify_function, -//GO(gnutls_session_supplemental_register, -//GO(gnutls_session_ticket_enable_client, -//GO(gnutls_session_ticket_enable_server, -//GO(gnutls_session_ticket_key_generate, +GO(gnutls_session_set_id, iFpp) +GO(gnutls_session_set_premaster, iFpuuuuuupp) +GO(gnutls_session_set_ptr, vFpp) +GO(gnutls_session_set_verify_cert, vFppu) +GO(gnutls_session_set_verify_cert2, vFppuu) +//GOM(gnutls_session_set_verify_function, vFEpp) +//GOM(gnutls_session_supplemental_register, iFEppuppu) +GO(gnutls_session_ticket_enable_client, iFp) +GO(gnutls_session_ticket_enable_server, iFpp) +GO(gnutls_session_ticket_key_generate, iFp) GO(gnutls_set_default_priority, iFp) -//GO(gnutls_sign_algorithm_get, -//GO(gnutls_sign_algorithm_get_client, -//GO(gnutls_sign_algorithm_get_requested, -//GO(gnutls_sign_get_hash_algorithm, -//GO(gnutls_sign_get_id, -//GO(gnutls_sign_get_name, -//GO(gnutls_sign_get_oid, -//GO(gnutls_sign_get_pk_algorithm, -//GO(gnutls_sign_is_secure, -//GO(gnutls_sign_list, -//GO(gnutls_srp_allocate_client_credentials, -//GO(gnutls_srp_allocate_server_credentials, -//GO(gnutls_srp_base64_decode, -//GO(gnutls_srp_base64_decode2, -//GO(gnutls_srp_base64_encode, -//GO(gnutls_srp_base64_encode2, -//GO(gnutls_srp_free_client_credentials, -//GO(gnutls_srp_free_server_credentials, -//GO(gnutls_srp_server_get_username, -//GO(gnutls_srp_set_client_credentials, -//GO(gnutls_srp_set_client_credentials_function, -//GO(gnutls_srp_set_prime_bits, -//GO(gnutls_srp_set_server_credentials_file, -//GO(gnutls_srp_set_server_credentials_function, -//GO(gnutls_srp_set_server_fake_salt_seed, -//GO(gnutls_srp_verifier, -//GO(gnutls_srtp_get_keys, -//GO(gnutls_srtp_get_mki, -//GO(gnutls_srtp_get_profile_id, -//GO(gnutls_srtp_get_profile_name, -//GO(gnutls_srtp_get_selected_profile, -//GO(gnutls_srtp_set_mki, -//GO(gnutls_srtp_set_profile, -//GO(gnutls_srtp_set_profile_direct, -//GO(gnutls_store_commitment, -//GO(gnutls_store_pubkey, +GO(gnutls_sign_algorithm_get, iFp) +GO(gnutls_sign_algorithm_get_client, iFp) +GO(gnutls_sign_algorithm_get_requested, iFpLp) +GO(gnutls_sign_get_hash_algorithm, uFu) +GO(gnutls_sign_get_id, uFp) +GO(gnutls_sign_get_name, pFu) +GO(gnutls_sign_get_oid, pFu) +GO(gnutls_sign_get_pk_algorithm, uFu) +GO(gnutls_sign_is_secure, uFu) +GO(gnutls_sign_list, pFv) +GO(gnutls_srp_allocate_client_credentials, iFp) +GO(gnutls_srp_allocate_server_credentials, iFp) +GO(gnutls_srp_base64_decode, iFppp) +GO(gnutls_srp_base64_decode2, iFpp) +GO(gnutls_srp_base64_encode, iFppp) +GO(gnutls_srp_base64_encode2, iFpp) +GO(gnutls_srp_free_client_credentials, vFp) +GO(gnutls_srp_free_server_credentials, vFp) +GO(gnutls_srp_server_get_username, pFp) +GO(gnutls_srp_set_client_credentials, iFppp) +//GOM(gnutls_srp_set_client_credentials_function, vFEpp) +GO(gnutls_srp_set_prime_bits, vFpu) +GO(gnutls_srp_set_server_credentials_file, iFppp) +//GOM(gnutls_srp_set_server_credentials_function, vFEpp) +GO(gnutls_srp_set_server_fake_salt_seed, vFppu) +GO(gnutls_srp_verifier, iFpppppp) +GO(gnutls_srtp_get_keys, iFppupppp) +GO(gnutls_srtp_get_mki, iFpp) +GO(gnutls_srtp_get_profile_id, iFpp) +GO(gnutls_srtp_get_profile_name, pFu) +GO(gnutls_srtp_get_selected_profile, iFpp) +GO(gnutls_srtp_set_mki, iFpp) +GO(gnutls_srtp_set_profile, iFpu) +GO(gnutls_srtp_set_profile_direct, iFppp) +GO(gnutls_store_commitment, iFppppuplu) +GO(gnutls_store_pubkey, iFppppuplu) GO(gnutls_strerror, pFi) -//GO(gnutls_strerror_name, +GO(gnutls_strerror_name, pFi) //GO(gnutls_subject_alt_names_deinit, //GO(gnutls_subject_alt_names_get, //GO(gnutls_subject_alt_names_init, //GO(gnutls_subject_alt_names_set, -//GO(gnutls_supplemental_get_name, -//GO(gnutls_supplemental_recv, -//GO(gnutls_supplemental_register, -//GO(gnutls_supplemental_send, +GO(gnutls_supplemental_get_name, pFu) +GO(gnutls_supplemental_recv, vFpu) +//GOM(gnutls_supplemental_register, iFEpupp) +GO(gnutls_supplemental_send, vFpu) //GO(gnutls_system_key_add_x509, //GO(gnutls_system_key_delete, //GO(gnutls_system_key_iter_deinit, //GO(gnutls_system_key_iter_get_info, -//GO(gnutls_system_recv_timeout, -//GO(gnutls_tdb_deinit, -//GO(gnutls_tdb_init, -//GO(gnutls_tdb_set_store_commitment_func, -//GO(gnutls_tdb_set_store_func, -//GO(gnutls_tdb_set_verify_func, -//GO(gnutls_tpm_get_registered, -//GO(gnutls_tpm_key_list_deinit, -//GO(gnutls_tpm_key_list_get_url, -//GO(gnutls_tpm_privkey_delete, -//GO(gnutls_tpm_privkey_generate, -//GO(gnutls_transport_get_int, -//GO(gnutls_transport_get_int2, +GO(gnutls_system_recv_timeout, iFpu) +GO(gnutls_tdb_deinit, vFp) +GO(gnutls_tdb_init, iFp) +//GOM(gnutls_tdb_set_store_commitment_func, vFEpp) +//GOM(gnutls_tdb_set_store_func, vFEpp) +//GOM(gnutls_tdb_set_verify_func, vFEpp) +GO(gnutls_tpm_get_registered, iFp) +GO(gnutls_tpm_key_list_deinit, vFp) +GO(gnutls_tpm_key_list_get_url, iFpupu) +GO(gnutls_tpm_privkey_delete, iFpp) +GO(gnutls_tpm_privkey_generate, iFuuppuuppu) +GO(gnutls_transport_get_int, iFp) +GO(gnutls_transport_get_int2, vFppp) GO(gnutls_transport_get_ptr, pFp) -//GO(gnutls_transport_get_ptr2, +GO(gnutls_transport_get_ptr2, vFppp) GO(gnutls_transport_set_errno, vFpi) -//GO(gnutls_transport_set_errno_function, +//GOM(gnutls_transport_set_errno_function, vFEpp) //GO(gnutls_transport_set_fastopen, -//GO(gnutls_transport_set_int2, +GO(gnutls_transport_set_int2, vFpii) GO(gnutls_transport_set_ptr, vFpp) -//GO(gnutls_transport_set_ptr2, +GO(gnutls_transport_set_ptr2, vFppp) GOM(gnutls_transport_set_pull_function, vFEpp) GOM(gnutls_transport_set_pull_timeout_function, vFEpp) GOM(gnutls_transport_set_push_function, vFEpp) -//GO(gnutls_transport_set_vec_push_function, +//GOM(gnutls_transport_set_vec_push_function, vFEpp) //GO(_gnutls_ucs2_to_utf8, -//GO(gnutls_url_is_supported, -//GO(gnutls_utf8_password_normalize, +GO(gnutls_url_is_supported, uFp) +GO(gnutls_utf8_password_normalize, iFpupu) //GO(_gnutls_utf8_to_ucs2, -//GO(gnutls_verify_stored_pubkey, +GO(gnutls_verify_stored_pubkey, iFppppupu) //GO(gnutls_x509_aia_deinit, //GO(gnutls_x509_aia_get, //GO(gnutls_x509_aia_init, @@ -785,240 +786,240 @@ GOM(gnutls_transport_set_push_function, vFEpp) //GO(gnutls_x509_aki_init, //GO(gnutls_x509_aki_set_cert_issuer, //GO(gnutls_x509_aki_set_id, -//GO(gnutls_x509_cidr_to_rfc5280, -//GO(gnutls_x509_crl_check_issuer, -//GO(gnutls_x509_crl_deinit, +GO(gnutls_x509_cidr_to_rfc5280, iFpp) +GO(gnutls_x509_crl_check_issuer, uFpp) +GO(gnutls_x509_crl_deinit, vFp) //GO(gnutls_x509_crl_dist_points_deinit, //GO(gnutls_x509_crl_dist_points_get, //GO(gnutls_x509_crl_dist_points_init, //GO(gnutls_x509_crl_dist_points_set, -//GO(gnutls_x509_crl_export, -//GO(gnutls_x509_crl_export2, -//GO(gnutls_x509_crl_get_authority_key_gn_serial, -//GO(gnutls_x509_crl_get_authority_key_id, -//GO(gnutls_x509_crl_get_crt_count, -//GO(gnutls_x509_crl_get_crt_serial, -//GO(gnutls_x509_crl_get_dn_oid, -//GO(gnutls_x509_crl_get_extension_data, -//GO(gnutls_x509_crl_get_extension_data2, -//GO(gnutls_x509_crl_get_extension_info, -//GO(gnutls_x509_crl_get_extension_oid, -//GO(gnutls_x509_crl_get_issuer_dn, -//GO(gnutls_x509_crl_get_issuer_dn2, -//GO(gnutls_x509_crl_get_issuer_dn3, -//GO(gnutls_x509_crl_get_issuer_dn_by_oid, -//GO(gnutls_x509_crl_get_next_update, -//GO(gnutls_x509_crl_get_number, -//GO(gnutls_x509_crl_get_raw_issuer_dn, -//GO(gnutls_x509_crl_get_signature, -//GO(gnutls_x509_crl_get_signature_algorithm, -//GO(gnutls_x509_crl_get_signature_oid, -//GO(gnutls_x509_crl_get_this_update, -//GO(gnutls_x509_crl_get_version, -//GO(gnutls_x509_crl_import, -//GO(gnutls_x509_crl_init, -//GO(gnutls_x509_crl_iter_crt_serial, -//GO(gnutls_x509_crl_iter_deinit, -//GO(gnutls_x509_crl_list_import, -//GO(gnutls_x509_crl_list_import2, -//GO(gnutls_x509_crl_print, -//GO(gnutls_x509_crl_privkey_sign, -//GO(gnutls_x509_crl_set_authority_key_id, -//GO(gnutls_x509_crl_set_crt, -//GO(gnutls_x509_crl_set_crt_serial, -//GO(gnutls_x509_crl_set_next_update, -//GO(gnutls_x509_crl_set_number, -//GO(gnutls_x509_crl_set_this_update, -//GO(gnutls_x509_crl_set_version, -//GO(gnutls_x509_crl_sign, -//GO(gnutls_x509_crl_sign2, -//GO(gnutls_x509_crl_verify, -//GO(gnutls_x509_crq_deinit, -//GO(gnutls_x509_crq_export, -//GO(gnutls_x509_crq_export2, -//GO(gnutls_x509_crq_get_attribute_by_oid, -//GO(gnutls_x509_crq_get_attribute_data, -//GO(gnutls_x509_crq_get_attribute_info, -//GO(gnutls_x509_crq_get_basic_constraints, -//GO(gnutls_x509_crq_get_challenge_password, -//GO(gnutls_x509_crq_get_dn, -//GO(gnutls_x509_crq_get_dn2, -//GO(gnutls_x509_crq_get_dn3, -//GO(gnutls_x509_crq_get_dn_by_oid, -//GO(gnutls_x509_crq_get_dn_oid, -//GO(gnutls_x509_crq_get_extension_by_oid, -//GO(gnutls_x509_crq_get_extension_by_oid2, -//GO(gnutls_x509_crq_get_extension_data, -//GO(gnutls_x509_crq_get_extension_data2, -//GO(gnutls_x509_crq_get_extension_info, -//GO(gnutls_x509_crq_get_key_id, -//GO(gnutls_x509_crq_get_key_purpose_oid, -//GO(gnutls_x509_crq_get_key_rsa_raw, -//GO(gnutls_x509_crq_get_key_usage, -//GO(gnutls_x509_crq_get_pk_algorithm, -//GO(gnutls_x509_crq_get_pk_oid, -//GO(gnutls_x509_crq_get_private_key_usage_period, -//GO(gnutls_x509_crq_get_signature_algorithm, -//GO(gnutls_x509_crq_get_signature_oid, -//GO(gnutls_x509_crq_get_subject_alt_name, -//GO(gnutls_x509_crq_get_subject_alt_othername_oid, -//GO(gnutls_x509_crq_get_tlsfeatures, -//GO(gnutls_x509_crq_get_version, -//GO(gnutls_x509_crq_import, -//GO(gnutls_x509_crq_init, -//GO(gnutls_x509_crq_print, -//GO(gnutls_x509_crq_privkey_sign, -//GO(gnutls_x509_crq_set_attribute_by_oid, -//GO(gnutls_x509_crq_set_basic_constraints, -//GO(gnutls_x509_crq_set_challenge_password, -//GO(gnutls_x509_crq_set_dn, -//GO(gnutls_x509_crq_set_dn_by_oid, -//GO(gnutls_x509_crq_set_extension_by_oid, -//GO(gnutls_x509_crq_set_key, -//GO(gnutls_x509_crq_set_key_purpose_oid, -//GO(gnutls_x509_crq_set_key_rsa_raw, -//GO(gnutls_x509_crq_set_key_usage, -//GO(gnutls_x509_crq_set_private_key_usage_period, -//GO(gnutls_x509_crq_set_pubkey, -//GO(gnutls_x509_crq_set_subject_alt_name, -//GO(gnutls_x509_crq_set_subject_alt_othername, -//GO(gnutls_x509_crq_set_tlsfeatures, -//GO(gnutls_x509_crq_set_version, -//GO(gnutls_x509_crq_sign, -//GO(gnutls_x509_crq_sign2, -//GO(gnutls_x509_crq_verify, -//GO(gnutls_x509_crt_check_email, +GO(gnutls_x509_crl_export, iFpupp) +GO(gnutls_x509_crl_export2, iFpup) +GO(gnutls_x509_crl_get_authority_key_gn_serial, iFpupppppp) +GO(gnutls_x509_crl_get_authority_key_id, iFpppp) +GO(gnutls_x509_crl_get_crt_count, iFp) +GO(gnutls_x509_crl_get_crt_serial, iFpuppp) +GO(gnutls_x509_crl_get_dn_oid, iFpupp) +GO(gnutls_x509_crl_get_extension_data, iFpupp) +GO(gnutls_x509_crl_get_extension_data2, iFpup) +GO(gnutls_x509_crl_get_extension_info, iFpuppp) +GO(gnutls_x509_crl_get_extension_oid, iFpupp) +GO(gnutls_x509_crl_get_issuer_dn, iFppp) +GO(gnutls_x509_crl_get_issuer_dn2, iFpp) +GO(gnutls_x509_crl_get_issuer_dn3, iFppu) +GO(gnutls_x509_crl_get_issuer_dn_by_oid, iFppuupp) +GO(gnutls_x509_crl_get_next_update, lFp) +GO(gnutls_x509_crl_get_number, iFpppp) +GO(gnutls_x509_crl_get_raw_issuer_dn, iFpp) +GO(gnutls_x509_crl_get_signature, iFppp) +GO(gnutls_x509_crl_get_signature_algorithm, iFp) +GO(gnutls_x509_crl_get_signature_oid, iFppp) +GO(gnutls_x509_crl_get_this_update, lFp) +GO(gnutls_x509_crl_get_version, iFp) +GO(gnutls_x509_crl_import, iFppu) +GO(gnutls_x509_crl_init, iFp) +GO(gnutls_x509_crl_iter_crt_serial, iFppppp) +GO(gnutls_x509_crl_iter_deinit, vFp) +GO(gnutls_x509_crl_list_import, iFpppuu) +GO(gnutls_x509_crl_list_import2, iFpppuu) +GO(gnutls_x509_crl_print, iFpup) +GO(gnutls_x509_crl_privkey_sign, iFpppuu) +GO(gnutls_x509_crl_set_authority_key_id, iFppL) +GO(gnutls_x509_crl_set_crt, iFppl) +GO(gnutls_x509_crl_set_crt_serial, iFppLl) +GO(gnutls_x509_crl_set_next_update, iFpl) +GO(gnutls_x509_crl_set_number, iFppL) +GO(gnutls_x509_crl_set_this_update, iFpl) +GO(gnutls_x509_crl_set_version, iFpu) +GO(gnutls_x509_crl_sign, iFppp) +GO(gnutls_x509_crl_sign2, iFpppuu) +GO(gnutls_x509_crl_verify, iFppuup) +GO(gnutls_x509_crq_deinit, vFp) +GO(gnutls_x509_crq_export, iFpupp) +GO(gnutls_x509_crq_export2, iFpup) +GO(gnutls_x509_crq_get_attribute_by_oid, iFppupp) +GO(gnutls_x509_crq_get_attribute_data, iFpupp) +GO(gnutls_x509_crq_get_attribute_info, iFpupp) +GO(gnutls_x509_crq_get_basic_constraints, iFpppp) +GO(gnutls_x509_crq_get_challenge_password, iFppp) +GO(gnutls_x509_crq_get_dn, iFppp) +GO(gnutls_x509_crq_get_dn2, iFpp) +GO(gnutls_x509_crq_get_dn3, iFppu) +GO(gnutls_x509_crq_get_dn_by_oid, iFppuupp) +GO(gnutls_x509_crq_get_dn_oid, iFpupp) +GO(gnutls_x509_crq_get_extension_by_oid, iFppuppp) +GO(gnutls_x509_crq_get_extension_by_oid2, iFppupp) +GO(gnutls_x509_crq_get_extension_data, iFpupp) +GO(gnutls_x509_crq_get_extension_data2, iFpup) +GO(gnutls_x509_crq_get_extension_info, iFpuppp) +GO(gnutls_x509_crq_get_key_id, iFpupp) +GO(gnutls_x509_crq_get_key_purpose_oid, iFpuppp) +GO(gnutls_x509_crq_get_key_rsa_raw, iFppp) +GO(gnutls_x509_crq_get_key_usage, iFppp) +GO(gnutls_x509_crq_get_pk_algorithm, iFpp) +GO(gnutls_x509_crq_get_pk_oid, iFppp) +GO(gnutls_x509_crq_get_private_key_usage_period, iFpppp) +GO(gnutls_x509_crq_get_signature_algorithm, iFp) +GO(gnutls_x509_crq_get_signature_oid, iFppp) +GO(gnutls_x509_crq_get_subject_alt_name, iFpupppp) +GO(gnutls_x509_crq_get_subject_alt_othername_oid, iFpupp) +GO(gnutls_x509_crq_get_tlsfeatures, iFppup) +GO(gnutls_x509_crq_get_version, iFp) +GO(gnutls_x509_crq_import, iFppu) +GO(gnutls_x509_crq_init, iFp) +GO(gnutls_x509_crq_print, iFpup) +GO(gnutls_x509_crq_privkey_sign, iFppuu) +GO(gnutls_x509_crq_set_attribute_by_oid, iFpppL) +GO(gnutls_x509_crq_set_basic_constraints, iFpui) +GO(gnutls_x509_crq_set_challenge_password, iFpp) +GO(gnutls_x509_crq_set_dn, iFppp) +GO(gnutls_x509_crq_set_dn_by_oid, iFppupu) +GO(gnutls_x509_crq_set_extension_by_oid, iFpppLu) +GO(gnutls_x509_crq_set_key, iFpp) +GO(gnutls_x509_crq_set_key_purpose_oid, iFppu) +GO(gnutls_x509_crq_set_key_rsa_raw, iFppp) +GO(gnutls_x509_crq_set_key_usage, iFpu) +GO(gnutls_x509_crq_set_private_key_usage_period, iFpll) +GO(gnutls_x509_crq_set_pubkey, iFpp) +GO(gnutls_x509_crq_set_subject_alt_name, iFpupuu) +GO(gnutls_x509_crq_set_subject_alt_othername, iFpppuu) +GO(gnutls_x509_crq_set_tlsfeatures, iFpp) +GO(gnutls_x509_crq_set_version, iFpu) +GO(gnutls_x509_crq_sign, iFpp) +GO(gnutls_x509_crq_sign2, iFppuu) +GO(gnutls_x509_crq_verify, iFpu) +GO(gnutls_x509_crt_check_email, uFppu) GO(gnutls_x509_crt_check_hostname, uFpp) -//GO(gnutls_x509_crt_check_hostname2, +GO(gnutls_x509_crt_check_hostname2, uFppu) GO(gnutls_x509_crt_check_issuer, uFpp) -//GO(gnutls_x509_crt_check_key_purpose, -//GO(gnutls_x509_crt_check_revocation, -//GO(gnutls_x509_crt_cpy_crl_dist_points, +GO(gnutls_x509_crt_check_key_purpose, uFppu) +GO(gnutls_x509_crt_check_revocation, iFppu) +GO(gnutls_x509_crt_cpy_crl_dist_points, iFpp) GO(gnutls_x509_crt_deinit, vFp) -//GO(gnutls_x509_crt_equals, -//GO(gnutls_x509_crt_equals2, -GO(gnutls_x509_crt_export, iFpppp) -//GO(gnutls_x509_crt_export2, +GO(gnutls_x509_crt_equals, uFpp) +GO(gnutls_x509_crt_equals2, uFpp) +GO(gnutls_x509_crt_export, iFpupp) +GO(gnutls_x509_crt_export2, iFpup) GO(gnutls_x509_crt_get_activation_time, lFp) -//GO(gnutls_x509_crt_get_authority_info_access, -//GO(gnutls_x509_crt_get_authority_key_gn_serial, -//GO(gnutls_x509_crt_get_authority_key_id, -//GO(gnutls_x509_crt_get_basic_constraints, -//GO(gnutls_x509_crt_get_ca_status, -//GO(gnutls_x509_crt_get_crl_dist_points, -//GO(gnutls_x509_crt_get_dn, +GO(gnutls_x509_crt_get_authority_info_access, iFpuipp) +GO(gnutls_x509_crt_get_authority_key_gn_serial, iFpupppppp) +GO(gnutls_x509_crt_get_authority_key_id, iFpppp) +GO(gnutls_x509_crt_get_basic_constraints, iFpppp) +GO(gnutls_x509_crt_get_ca_status, iFpp) +GO(gnutls_x509_crt_get_crl_dist_points, iFpupppp) +GO(gnutls_x509_crt_get_dn, iFppp) GO(gnutls_x509_crt_get_dn2, iFpp) -//GO(gnutls_x509_crt_get_dn3, +GO(gnutls_x509_crt_get_dn3, iFppu) GO(gnutls_x509_crt_get_dn_by_oid, iFppuupp) -//GO(gnutls_x509_crt_get_dn_oid, +GO(gnutls_x509_crt_get_dn_oid, iFpupp) GO(gnutls_x509_crt_get_expiration_time, lFp) -//GO(gnutls_x509_crt_get_extension_by_oid, -//GO(gnutls_x509_crt_get_extension_by_oid2, -//GO(gnutls_x509_crt_get_extension_data, -//GO(gnutls_x509_crt_get_extension_data2, -//GO(gnutls_x509_crt_get_extension_info, -//GO(gnutls_x509_crt_get_extension_oid, -//GO(gnutls_x509_crt_get_fingerprint, -//GO(gnutls_x509_crt_get_issuer, -//GO(gnutls_x509_crt_get_issuer_alt_name, -//GO(gnutls_x509_crt_get_issuer_alt_name2, -//GO(gnutls_x509_crt_get_issuer_alt_othername_oid, -//GO(gnutls_x509_crt_get_issuer_dn, +GO(gnutls_x509_crt_get_extension_by_oid, iFppuppp) +GO(gnutls_x509_crt_get_extension_by_oid2, iFppupp) +GO(gnutls_x509_crt_get_extension_data, iFpupp) +GO(gnutls_x509_crt_get_extension_data2, iFpup) +GO(gnutls_x509_crt_get_extension_info, iFpuppp) +GO(gnutls_x509_crt_get_extension_oid, iFpupp) +GO(gnutls_x509_crt_get_fingerprint, iFpupp) +GO(gnutls_x509_crt_get_issuer, iFpp) +GO(gnutls_x509_crt_get_issuer_alt_name, iFpuppp) +GO(gnutls_x509_crt_get_issuer_alt_name2, iFpupppp) +GO(gnutls_x509_crt_get_issuer_alt_othername_oid, iFpupp) +GO(gnutls_x509_crt_get_issuer_dn, iFppp) GO(gnutls_x509_crt_get_issuer_dn2, iFpp) -//GO(gnutls_x509_crt_get_issuer_dn3, -//GO(gnutls_x509_crt_get_issuer_dn_by_oid, -//GO(gnutls_x509_crt_get_issuer_dn_oid, -//GO(gnutls_x509_crt_get_issuer_unique_id, -//GO(gnutls_x509_crt_get_key_id, -//GO(gnutls_x509_crt_get_key_purpose_oid, -//GO(gnutls_x509_crt_get_key_usage, -//GO(gnutls_x509_crt_get_name_constraints, +GO(gnutls_x509_crt_get_issuer_dn3, iFppu) +GO(gnutls_x509_crt_get_issuer_dn_by_oid, iFppuupp) +GO(gnutls_x509_crt_get_issuer_dn_oid, iFpupp) +GO(gnutls_x509_crt_get_issuer_unique_id, iFppp) +GO(gnutls_x509_crt_get_key_id, iFpupp) +GO(gnutls_x509_crt_get_key_purpose_oid, iFpuppp) +GO(gnutls_x509_crt_get_key_usage, iFppp) +GO(gnutls_x509_crt_get_name_constraints, iFppup) GO(gnutls_x509_crt_get_pk_algorithm, iFpp) -//GO(gnutls_x509_crt_get_pk_dsa_raw, -//GO(gnutls_x509_crt_get_pk_ecc_raw, -//GO(gnutls_x509_crt_get_pk_oid, -//GO(gnutls_x509_crt_get_pk_rsa_raw, -//GO(gnutls_x509_crt_get_policy, -//GO(gnutls_x509_crt_get_preferred_hash_algorithm, -//GO(gnutls_x509_crt_get_private_key_usage_period, -//GO(gnutls_x509_crt_get_proxy, -//GO(gnutls_x509_crt_get_raw_dn, -//GO(gnutls_x509_crt_get_raw_issuer_dn, -//GO(gnutls_x509_crt_get_serial, -//GO(gnutls_x509_crt_get_signature, -//GO(gnutls_x509_crt_get_signature_algorithm, -//GO(gnutls_x509_crt_get_signature_oid, -//GO(gnutls_x509_crt_get_subject, -//GO(gnutls_x509_crt_get_subject_alt_name, -//GO(gnutls_x509_crt_get_subject_alt_name2, -//GO(gnutls_x509_crt_get_subject_alt_othername_oid, -//GO(gnutls_x509_crt_get_subject_key_id, -//GO(gnutls_x509_crt_get_subject_unique_id, -//GO(gnutls_x509_crt_get_tlsfeatures, +GO(gnutls_x509_crt_get_pk_dsa_raw, iFppppp) +GO(gnutls_x509_crt_get_pk_ecc_raw, iFpppp) +GO(gnutls_x509_crt_get_pk_oid, iFppp) +GO(gnutls_x509_crt_get_pk_rsa_raw, iFppp) +GO(gnutls_x509_crt_get_policy, iFpupp) +GO(gnutls_x509_crt_get_preferred_hash_algorithm, iFppp) +GO(gnutls_x509_crt_get_private_key_usage_period, iFpppp) +GO(gnutls_x509_crt_get_proxy, iFpppppp) +GO(gnutls_x509_crt_get_raw_dn, iFpp) +GO(gnutls_x509_crt_get_raw_issuer_dn, iFpp) +GO(gnutls_x509_crt_get_serial, iFppp) +GO(gnutls_x509_crt_get_signature, iFppp) +GO(gnutls_x509_crt_get_signature_algorithm, iFp) +GO(gnutls_x509_crt_get_signature_oid, iFppp) +GO(gnutls_x509_crt_get_subject, iFpp) +GO(gnutls_x509_crt_get_subject_alt_name, iFpuppp) +GO(gnutls_x509_crt_get_subject_alt_name2, iFpupppp) +GO(gnutls_x509_crt_get_subject_alt_othername_oid, iFpupp) +GO(gnutls_x509_crt_get_subject_key_id, iFpppp) +GO(gnutls_x509_crt_get_subject_unique_id, iFppp) +GO(gnutls_x509_crt_get_tlsfeatures, iFppup) GO(gnutls_x509_crt_get_version, iFp) -GO(gnutls_x509_crt_import, iFppp) -//GO(gnutls_x509_crt_import_pkcs11, -//GO(gnutls_x509_crt_import_url, +GO(gnutls_x509_crt_import, iFppu) +GO(gnutls_x509_crt_import_pkcs11, iFpp) +GO(gnutls_x509_crt_import_url, iFppu) GO(gnutls_x509_crt_init, iFp) -//GO(gnutls_x509_crt_list_import, -//GO(gnutls_x509_crt_list_import2, -//GO(gnutls_x509_crt_list_import_pkcs11, -//GO(gnutls_x509_crt_list_verify, -//GO(gnutls_x509_crt_print, -//GO(gnutls_x509_crt_privkey_sign, -//GO(gnutls_x509_crt_set_activation_time, -//GO(gnutls_x509_crt_set_authority_info_access, -//GO(gnutls_x509_crt_set_authority_key_id, -//GO(gnutls_x509_crt_set_basic_constraints, -//GO(gnutls_x509_crt_set_ca_status, -//GO(gnutls_x509_crt_set_crl_dist_points, -//GO(gnutls_x509_crt_set_crl_dist_points2, -//GO(gnutls_x509_crt_set_crq, -//GO(gnutls_x509_crt_set_crq_extension_by_oid, -//GO(gnutls_x509_crt_set_crq_extensions, -//GO(gnutls_x509_crt_set_dn, -//GO(gnutls_x509_crt_set_dn_by_oid, -//GO(gnutls_x509_crt_set_expiration_time, -//GO(gnutls_x509_crt_set_extension_by_oid, -//GO(gnutls_x509_crt_set_issuer_alt_name, -//GO(gnutls_x509_crt_set_issuer_alt_othername, -//GO(gnutls_x509_crt_set_issuer_dn, -//GO(gnutls_x509_crt_set_issuer_dn_by_oid, -//GO(gnutls_x509_crt_set_issuer_unique_id, -//GO(gnutls_x509_crt_set_key, -//GO(gnutls_x509_crt_set_key_purpose_oid, -//GO(gnutls_x509_crt_set_key_usage, -//GO(gnutls_x509_crt_set_name_constraints, -//GO(gnutls_x509_crt_set_pin_function, -//GO(gnutls_x509_crt_set_policy, -//GO(gnutls_x509_crt_set_private_key_usage_period, -//GO(gnutls_x509_crt_set_proxy, -//GO(gnutls_x509_crt_set_proxy_dn, -//GO(gnutls_x509_crt_set_pubkey, -//GO(gnutls_x509_crt_set_serial, -//GO(gnutls_x509_crt_set_subject_alternative_name, -//GO(gnutls_x509_crt_set_subject_alt_name, -//GO(gnutls_x509_crt_set_subject_alt_othername, -//GO(gnutls_x509_crt_set_subject_key_id, -//GO(gnutls_x509_crt_set_subject_unique_id, -//GO(gnutls_x509_crt_set_tlsfeatures, -//GO(gnutls_x509_crt_set_version, -//GO(gnutls_x509_crt_sign, -//GO(gnutls_x509_crt_sign2, -//GO(gnutls_x509_crt_verify, -//GO(gnutls_x509_crt_verify_data2, -//GO(gnutls_x509_dn_deinit, -//GO(gnutls_x509_dn_export, -//GO(gnutls_x509_dn_export2, -//GO(gnutls_x509_dn_get_rdn_ava, -//GO(gnutls_x509_dn_get_str, -//GO(gnutls_x509_dn_get_str2, -//GO(gnutls_x509_dn_import, -//GO(gnutls_x509_dn_init, -//GO(gnutls_x509_dn_oid_known, -//GO(gnutls_x509_dn_oid_name, -//GO(gnutls_x509_dn_set_str, -//GO(gnutls_x509_ext_deinit, +GO(gnutls_x509_crt_list_import, iFpppuu) +GO(gnutls_x509_crt_list_import2, iFpppuu) +GO(gnutls_x509_crt_list_import_pkcs11, iFpupu) +GO(gnutls_x509_crt_list_verify, iFpupupuup) +GO(gnutls_x509_crt_print, iFpup) +GO(gnutls_x509_crt_privkey_sign, iFpppuu) +GO(gnutls_x509_crt_set_activation_time, iFpl) +GO(gnutls_x509_crt_set_authority_info_access, iFpip) +GO(gnutls_x509_crt_set_authority_key_id, iFppL) +GO(gnutls_x509_crt_set_basic_constraints, iFpui) +GO(gnutls_x509_crt_set_ca_status, iFpu) +GO(gnutls_x509_crt_set_crl_dist_points, iFpupu) +GO(gnutls_x509_crt_set_crl_dist_points2, iFpupuu) +GO(gnutls_x509_crt_set_crq, iFpp) +GO(gnutls_x509_crt_set_crq_extension_by_oid, iFpppu) +GO(gnutls_x509_crt_set_crq_extensions, iFpp) +GO(gnutls_x509_crt_set_dn, iFppp) +GO(gnutls_x509_crt_set_dn_by_oid, iFppupu) +GO(gnutls_x509_crt_set_expiration_time, iFpl) +GO(gnutls_x509_crt_set_extension_by_oid, iFpppLu) +GO(gnutls_x509_crt_set_issuer_alt_name, iFpupuu) +GO(gnutls_x509_crt_set_issuer_alt_othername, iFpppuu) +GO(gnutls_x509_crt_set_issuer_dn, iFppp) +GO(gnutls_x509_crt_set_issuer_dn_by_oid, iFppupu) +GO(gnutls_x509_crt_set_issuer_unique_id, iFppL) +GO(gnutls_x509_crt_set_key, iFpp) +GO(gnutls_x509_crt_set_key_purpose_oid, iFppu) +GO(gnutls_x509_crt_set_key_usage, iFpu) +GO(gnutls_x509_crt_set_name_constraints, iFppu) +//GOM(gnutls_x509_crt_set_pin_function, vFEppp) +GO(gnutls_x509_crt_set_policy, iFppu) +GO(gnutls_x509_crt_set_private_key_usage_period, iFpll) +GO(gnutls_x509_crt_set_proxy, iFpippL) +GO(gnutls_x509_crt_set_proxy_dn, iFppupu) +GO(gnutls_x509_crt_set_pubkey, iFpp) +GO(gnutls_x509_crt_set_serial, iFppL) +GO(gnutls_x509_crt_set_subject_alternative_name, iFpup) +GO(gnutls_x509_crt_set_subject_alt_name, iFpupuu) +GO(gnutls_x509_crt_set_subject_alt_othername, iFpppuu) +GO(gnutls_x509_crt_set_subject_key_id, iFppL) +GO(gnutls_x509_crt_set_subject_unique_id, iFppL) +GO(gnutls_x509_crt_set_tlsfeatures, iFpp) +GO(gnutls_x509_crt_set_version, iFpu) +GO(gnutls_x509_crt_sign, iFppp) +GO(gnutls_x509_crt_sign2, iFpppuu) +GO(gnutls_x509_crt_verify, iFppuup) +GO(gnutls_x509_crt_verify_data2, iFpuupp) +GO(gnutls_x509_dn_deinit, vFp) +GO(gnutls_x509_dn_export, iFpupp) +GO(gnutls_x509_dn_export2, iFpup) +GO(gnutls_x509_dn_get_rdn_ava, iFpiip) +GO(gnutls_x509_dn_get_str, iFpp) +GO(gnutls_x509_dn_get_str2, iFppu) +GO(gnutls_x509_dn_import, iFpp) +GO(gnutls_x509_dn_init, iFp) +GO(gnutls_x509_dn_oid_known, iFp) +GO(gnutls_x509_dn_oid_name, pFpu) +GO(gnutls_x509_dn_set_str, iFppp) +GO(gnutls_x509_ext_deinit, vFp) //GO(gnutls_x509_ext_export_aia, //GO(gnutls_x509_ext_export_authority_key_id, //GO(gnutls_x509_ext_export_basic_constraints, @@ -1045,90 +1046,90 @@ GO(gnutls_x509_crt_init, iFp) //GO(gnutls_x509_ext_import_subject_alt_names, //GO(gnutls_x509_ext_import_subject_key_id, //GO(gnutls_x509_ext_import_tlsfeatures, -//GO(gnutls_x509_ext_print, +GO(gnutls_x509_ext_print, iFpuup) //GO(gnutls_x509_key_purpose_deinit, //GO(gnutls_x509_key_purpose_get, //GO(gnutls_x509_key_purpose_init, //GO(gnutls_x509_key_purpose_set, -//GO(gnutls_x509_name_constraints_add_excluded, -//GO(gnutls_x509_name_constraints_add_permitted, -//GO(gnutls_x509_name_constraints_check, -//GO(gnutls_x509_name_constraints_check_crt, -//GO(gnutls_x509_name_constraints_deinit, -//GO(gnutls_x509_name_constraints_get_excluded, -//GO(gnutls_x509_name_constraints_get_permitted, -//GO(gnutls_x509_name_constraints_init, +GO(gnutls_x509_name_constraints_add_excluded, iFpup) +GO(gnutls_x509_name_constraints_add_permitted, iFpup) +GO(gnutls_x509_name_constraints_check, uFpup) +GO(gnutls_x509_name_constraints_check_crt, uFpup) +GO(gnutls_x509_name_constraints_deinit, vFp) +GO(gnutls_x509_name_constraints_get_excluded, iFpupp) +GO(gnutls_x509_name_constraints_get_permitted, iFpupp) +GO(gnutls_x509_name_constraints_init, iFp) //GO(_gnutls_x509_name_constraints_merge, //GO(gnutls_x509_othername_to_virtual, //GO(gnutls_x509_policies_deinit, //GO(gnutls_x509_policies_get, //GO(gnutls_x509_policies_init, //GO(gnutls_x509_policies_set, -//GO(gnutls_x509_policy_release, -//GO(gnutls_x509_privkey_cpy, +GO(gnutls_x509_policy_release, vFp) +GO(gnutls_x509_privkey_cpy, iFpp) GO(gnutls_x509_privkey_deinit, vFp) -//GO(gnutls_x509_privkey_export, -//GO(gnutls_x509_privkey_export2, -//GO(gnutls_x509_privkey_export2_pkcs8, -//GO(gnutls_x509_privkey_export_dsa_raw, -//GO(gnutls_x509_privkey_export_ecc_raw, -//GO(gnutls_x509_privkey_export_pkcs8, -//GO(gnutls_x509_privkey_export_rsa_raw, +GO(gnutls_x509_privkey_export, iFpupp) +GO(gnutls_x509_privkey_export2, iFpup) +GO(gnutls_x509_privkey_export2_pkcs8, iFpupup) +GO(gnutls_x509_privkey_export_dsa_raw, iFpppppp) +GO(gnutls_x509_privkey_export_ecc_raw, iFppppp) +GO(gnutls_x509_privkey_export_pkcs8, iFpupupp) +GO(gnutls_x509_privkey_export_rsa_raw, iFppppppp) GO(gnutls_x509_privkey_export_rsa_raw2, iFppppppppp) -//GO(gnutls_x509_privkey_fix, -//GO(gnutls_x509_privkey_generate, -//GO(gnutls_x509_privkey_generate2, -//GO(gnutls_x509_privkey_get_key_id, -//GO(gnutls_x509_privkey_get_pk_algorithm, +GO(gnutls_x509_privkey_fix, iFp) +GO(gnutls_x509_privkey_generate, iFpuuu) +GO(gnutls_x509_privkey_generate2, iFpuuupu) +GO(gnutls_x509_privkey_get_key_id, iFpupp) +GO(gnutls_x509_privkey_get_pk_algorithm, iFp) GO(gnutls_x509_privkey_get_pk_algorithm2, iFpp) -//GO(gnutls_x509_privkey_get_seed, -//GO(gnutls_x509_privkey_import, -//GO(gnutls_x509_privkey_import2, -//GO(gnutls_x509_privkey_import_dsa_raw, -//GO(gnutls_x509_privkey_import_ecc_raw, -//GO(gnutls_x509_privkey_import_openssl, -//GO(gnutls_x509_privkey_import_pkcs8, -//GO(gnutls_x509_privkey_import_rsa_raw, -//GO(gnutls_x509_privkey_import_rsa_raw2, -//GO(gnutls_x509_privkey_init, -//GO(gnutls_x509_privkey_sec_param, -//GO(gnutls_x509_privkey_set_flags, -//GO(gnutls_x509_privkey_set_pin_function, -//GO(gnutls_x509_privkey_sign_data, -//GO(gnutls_x509_privkey_sign_hash, -//GO(gnutls_x509_privkey_verify_params, -//GO(gnutls_x509_privkey_verify_seed, -//GO(gnutls_x509_rdn_get, -//GO(gnutls_x509_rdn_get2, -//GO(gnutls_x509_rdn_get_by_oid, -//GO(gnutls_x509_rdn_get_oid, +GO(gnutls_x509_privkey_get_seed, iFpppp) +GO(gnutls_x509_privkey_import, iFppu) +GO(gnutls_x509_privkey_import2, iFppupu) +GO(gnutls_x509_privkey_import_dsa_raw, iFpppppp) +GO(gnutls_x509_privkey_import_ecc_raw, iFpuppp) +GO(gnutls_x509_privkey_import_openssl, iFppp) +GO(gnutls_x509_privkey_import_pkcs8, iFppupu) +GO(gnutls_x509_privkey_import_rsa_raw, iFppppppp) +GO(gnutls_x509_privkey_import_rsa_raw2, iFppppppppp) +GO(gnutls_x509_privkey_init, iFp) +GO(gnutls_x509_privkey_sec_param, uFp) +GO(gnutls_x509_privkey_set_flags, vFpu) +//GOM(gnutls_x509_privkey_set_pin_function, vFEppp) +GO(gnutls_x509_privkey_sign_data, iFpuuppp) +GO(gnutls_x509_privkey_sign_hash, iFppp) +GO(gnutls_x509_privkey_verify_params, iFp) +GO(gnutls_x509_privkey_verify_seed, iFpupL) +GO(gnutls_x509_rdn_get, iFppp) +GO(gnutls_x509_rdn_get2, iFppu) +GO(gnutls_x509_rdn_get_by_oid, iFppuupp) +GO(gnutls_x509_rdn_get_oid, iFpupp) GO(gnutls_x509_spki_deinit, vFp) -GO(gnutls_x509_spki_init, vFp) +GO(gnutls_x509_spki_init, iFp) GO(gnutls_x509_spki_set_rsa_oaep_params, iFpup) -GO(gnutls_x509_spki_set_rsa_pss_params, vFppu) +GO(gnutls_x509_spki_set_rsa_pss_params, vFpuu) //GO(gnutls_x509_tlsfeatures_add, -//GO(gnutls_x509_tlsfeatures_check_crt, -//GO(gnutls_x509_tlsfeatures_deinit, -//GO(gnutls_x509_tlsfeatures_get, -//GO(gnutls_x509_tlsfeatures_init, -//GO(gnutls_x509_trust_list_add_cas, -//GO(gnutls_x509_trust_list_add_crls, -//GO(gnutls_x509_trust_list_add_named_crt, -//GO(gnutls_x509_trust_list_add_system_trust, -//GO(gnutls_x509_trust_list_add_trust_dir, -//GO(gnutls_x509_trust_list_add_trust_file, -//GO(gnutls_x509_trust_list_add_trust_mem, -//GO(gnutls_x509_trust_list_deinit, -//GO(gnutls_x509_trust_list_get_issuer, -//GO(gnutls_x509_trust_list_get_issuer_by_dn, -//GO(gnutls_x509_trust_list_get_issuer_by_subject_key_id, -//GO(gnutls_x509_trust_list_init, -//GO(gnutls_x509_trust_list_iter_deinit, -//GO(gnutls_x509_trust_list_iter_get_ca, -//GO(gnutls_x509_trust_list_remove_cas, -//GO(gnutls_x509_trust_list_remove_trust_file, -//GO(gnutls_x509_trust_list_remove_trust_mem, -//GO(gnutls_x509_trust_list_verify_crt, -//GO(gnutls_x509_trust_list_verify_crt2, -//GO(gnutls_x509_trust_list_verify_named_crt, +GO(gnutls_x509_tlsfeatures_check_crt, uFpp) +GO(gnutls_x509_tlsfeatures_deinit, vFp) +GO(gnutls_x509_tlsfeatures_get, iFpup) +GO(gnutls_x509_tlsfeatures_init, iFp) +GO(gnutls_x509_trust_list_add_cas, iFppuu) +GO(gnutls_x509_trust_list_add_crls, iFppuuu) +GO(gnutls_x509_trust_list_add_named_crt, iFpppLu) +GO(gnutls_x509_trust_list_add_system_trust, iFpuu) +GO(gnutls_x509_trust_list_add_trust_dir, iFpppuuu) +GO(gnutls_x509_trust_list_add_trust_file, iFpppuuu) +GO(gnutls_x509_trust_list_add_trust_mem, iFpppuuu) +GO(gnutls_x509_trust_list_deinit, vFpu) +GO(gnutls_x509_trust_list_get_issuer, iFpppu) +GO(gnutls_x509_trust_list_get_issuer_by_dn, iFpppu) +GO(gnutls_x509_trust_list_get_issuer_by_subject_key_id, iFppppu) +GO(gnutls_x509_trust_list_init, iFpu) +GO(gnutls_x509_trust_list_iter_deinit, vFp) +GO(gnutls_x509_trust_list_iter_get_ca, iFppp) +GO(gnutls_x509_trust_list_remove_cas, iFppu) +GO(gnutls_x509_trust_list_remove_trust_file, iFppu) +GO(gnutls_x509_trust_list_remove_trust_mem, iFppu) +//GOM(gnutls_x509_trust_list_verify_crt, iFEppuupp) +//GOM(gnutls_x509_trust_list_verify_crt2, iFEppupuupp) +//GOM(gnutls_x509_trust_list_verify_named_crt, iFEpppLupp) //GO(_rsa_generate_fips186_4_keypair, diff --git a/src/wrapped/wrappedgobject2.c b/src/wrapped/wrappedgobject2.c index a29588f..038c82d 100644 --- a/src/wrapped/wrappedgobject2.c +++ b/src/wrapped/wrappedgobject2.c @@ -19,11 +19,9 @@ #include "gtkclass.h" #include "myalign.h" -#ifdef ANDROID - const char* gobject2Name = "libgobject-2.0.so"; -#else - const char* gobject2Name = "libgobject-2.0.so.0"; -#endif +const char* gobject2Name = "libgobject-2.0.so.0"; +#define ALTNAME "libgobject-2.0.so" + #define LIBNAME gobject2 typedef size_t(*LFv_t)(void); @@ -48,94 +46,6 @@ static void addGObject2Alternate(library_t* lib); #include "wrappercallback.h" -static int signal_cb(void* a, void* b, void* c, void* d, void* e) -{ - // signal can have many signature... so first job is to find the data! - // hopefully, no callback have more than 4 arguments... - my_signal_t* sig = NULL; - int i = 0; - if(my_signal_is_valid(a)) { - sig = (my_signal_t*)a; - i = 1; - } - if(!sig && my_signal_is_valid(b)) { - sig = (my_signal_t*)b; - i = 2; - } - if(!sig && my_signal_is_valid(c)) { - sig = (my_signal_t*)c; - i = 3; - } - if(!sig && my_signal_is_valid(d)) { - sig = (my_signal_t*)d; - i = 4; - } - if(!sig && my_signal_is_valid(e)) { - sig = (my_signal_t*)e; - i = 5; - printf_log(LOG_DEBUG, "Warning, GObject2 signal callback with 5 args found, sig=%p!\n", sig); - } - printf_log(LOG_DEBUG, "gobject2 Signal called, sig=%p, handler=%p, NArgs=%d\n", sig, sig?(void*)sig->c_handler:NULL, i); - switch(i) { - case 1: return (int)RunFunctionFmt(sig->c_handler, "p", sig->data); - case 2: return (int)RunFunctionFmt(sig->c_handler, "pp", a, sig->data); - case 3: return (int)RunFunctionFmt(sig->c_handler, "ppp", a, b, sig->data); - case 4: return (int)RunFunctionFmt(sig->c_handler, "pppp", a, b, c, sig->data); - case 5: return (int)RunFunctionFmt(sig->c_handler, "ppppp", a, b, c, d, sig->data); - } - printf_log(LOG_NONE, "Warning, GObject2 signal callback but no data found!\n"); - return 0; -} -static int signal_cb_swapped(my_signal_t* sig, void* b, void* c, void* d) -{ - // data is in front here... - printf_log(LOG_DEBUG, "gobject2 swaped4 Signal called, sig=%p\n", sig); - return (int)RunFunctionFmt(sig->c_handler, "pppp", sig->data, b, c, d); -} -static int signal_cb_5(void* a, void* b, void* c, void* d, my_signal_t* sig) -{ - printf_log(LOG_DEBUG, "gobject2 5 Signal called, sig=%p\n", sig); - return (int)RunFunctionFmt(sig->c_handler, "ppppp", a, b, c, d, sig->data); -} -static int signal_cb_swapped_5(my_signal_t* sig, void* b, void* c, void* d, void* e) -{ - // data is in front here... - printf_log(LOG_DEBUG, "gobject2 swaped5 Signal called, sig=%p\n", sig); - return (int)RunFunctionFmt(sig->c_handler, "ppppp", sig->data, b, c, d, e); -} -static int signal_cb_6(void* a, void* b, void* c, void* d, void* e, my_signal_t* sig) -{ - printf_log(LOG_DEBUG, "gobject2 6 Signal called, sig=%p\n", sig); - return (int)RunFunctionFmt(sig->c_handler, "pppppp", a, b, c, d, e, sig->data); -} -static int signal_cb_swapped_6(my_signal_t* sig, void* b, void* c, void* d, void* e, void* f) -{ - // data is in front here... - printf_log(LOG_DEBUG, "gobject2 swaped6 Signal called, sig=%p\n", sig); - return (int)RunFunctionFmt(sig->c_handler, "pppppp", sig->data, b, c, d, e, f); -} -static int signal_cb_8(void* a, void* b, void* c, void* d, void* e, void* f, void* g, my_signal_t* sig) -{ - printf_log(LOG_DEBUG, "gobject2 8 Signal called, sig=%p\n", sig); - return (int)RunFunctionFmt(sig->c_handler, "pppppppp", a, b, c, d, e, f, g, sig->data); -} -static int signal_cb_swapped_8(my_signal_t* sig, void* b, void* c, void* d, void* e, void* f, void* g, void* h) -{ - // data is in front here... - printf_log(LOG_DEBUG, "gobject2 swaped8 Signal called, sig=%p\n", sig); - return (int)RunFunctionFmt(sig->c_handler, "pppppppp", sig->data, b, c, d, e, f, g, h); -} - -static void signal_delete(my_signal_t* sig, void* b) -{ - uintptr_t d = sig->destroy; - if(d) { - RunFunctionFmt(d, "pp", sig->data, b); - } - printf_log(LOG_DEBUG, "gobject2 Signal deleted, sig=%p, destroy=%p\n", sig, (void*)d); - free(sig); -} - static void addGObject2Alternate(library_t* lib) { #define GO(A, W) AddAutomaticBridge(lib->w.bridge, W, dlsym(lib->w.lib, #A), 0, #A) @@ -184,100 +94,9 @@ static void addGObject2Alternate(library_t* lib) GO(g_cclosure_marshal_BOOLEAN__FLAGSv, vFpppppip); GO(g_cclosure_marshal_BOOLEAN__BOXED_BOXEDv, vFpppppip); #undef GO - #define GO(A, W) AddAutomaticBridge(lib->w.bridge, W, A, 0, #A) - GO(signal_cb, iFpppp); - GO(signal_cb_swapped, iFpppp); - GO(signal_cb_5, iFppppp); - GO(signal_cb_swapped_5, iFppppp); - GO(signal_cb_6, iFpppppp); - GO(signal_cb_swapped_6, iFpppppp); - GO(signal_cb_8, iFpppppppp); - GO(signal_cb_swapped_8, iFpppppppp); - GO(signal_delete, vFpp); - #undef GO -} - -EXPORT uintptr_t my_g_signal_connect_data(x64emu_t* emu, void* instance, void* detailed, void* c_handler, void* data, void* closure, uint32_t flags) -{ - //TODO: get the type of instance to be more precise below - - my_signal_t *sig = new_mysignal(c_handler, data, closure); - uintptr_t ret = 0; - #define GO(A, B) if(strcmp((const char*)detailed, A)==0) ret = my->g_signal_connect_data(instance, detailed, (flags&2)?((void*)signal_cb_swapped_##B):((void*)signal_cb_##B), sig, signal_delete, flags); - GO("query-tooltip", 6) // GtkWidget - else GO("query_tooltip", 6) - else GO("selection-get", 5) //GtkWidget - else GO("selection_get", 5) - else GO("drag-data-get", 5) //GtkWidget - else GO("drag-data-received", 8) //GtkWidget - else GO("drag_data_received", 8) - else GO("drag-drop", 6) //GtkWidget - else GO("drag_drop", 6) - else GO("drag-motion", 6) //GtkWidget - else GO("drag_motion", 6) - else GO("expand-collapse-cursor-row", 5) //GtkTreeView - else GO("expand_collapse_cursor_row", 5) - else GO("insert-text", 5) // GtkEditable - else GO("insert_text", 5) - else GO("move-cursor", 5) // GtkEntry - else GO("move_cursor", 5) - else - ret = my->g_signal_connect_data(instance, detailed, (flags&2)?((void*)signal_cb_swapped):((void*)signal_cb), sig, signal_delete, flags); - #undef GO - printf_log(LOG_DEBUG, "Connecting gobject2 %p signal \"%s\" with sig=%p to %p, flags=%d\n", instance, (char*)detailed, sig, c_handler, flags); - return ret; -} - - -EXPORT void* my_g_object_connect(x64emu_t* emu, void* object, void* signal_spec, void** b) -{ - //gobject2_my_t *my = (gobject2_my_t*)my_lib->w.p2; - - char* spec = (char*)signal_spec; - while(spec) { - // loop on each triplet... - if(strstr(spec, "signal::")==spec) { - my_g_signal_connect_data(emu, object, spec+strlen("signal::"), b[0], b[1], NULL, 0); - b+=2; - spec = (char*)*(b++); - } else if(strstr(spec, "swapped_signal::")==spec || strstr(spec, "swapped-signal::")==spec) { - my_g_signal_connect_data(emu, object, spec+strlen("swapped_signal::"), b[0], b[1], NULL, 2); - b+=2; - spec = (char*)*(b++); - } else if(strstr(spec, "signal_after::")==spec || strstr(spec, "signal-after::")==spec) { - my_g_signal_connect_data(emu, object, spec+strlen("signal_after::"), b[0], b[1], NULL, 1); - b+=2; - spec = (char*)*(b++); - } else if(strstr(spec, "swapped_signal_after::")==spec || strstr(spec, "swapped-signal-after::")==spec) { - my_g_signal_connect_data(emu, object, spec+strlen("swapped_signal_after::"), b[0], b[1], NULL, 1|2); - b+=2; - spec = (char*)*(b++); - } else { - printf_log(LOG_NONE, "Warning, don't know how to handle signal spec \"%s\" in g_object_connect\n", spec); - spec = NULL; - } - } - return object; } - -#define SUPER() \ -GO(0) \ -GO(1) \ -GO(2) \ -GO(3) \ -GO(4) \ -GO(5) \ -GO(6) \ -GO(7) \ -GO(8) \ -GO(9) \ -GO(10) \ -GO(11) \ -GO(12) \ -GO(13) \ -GO(14) \ -GO(15) \ +#include "super80.h" #define GO(A) \ static uintptr_t my_copy_fct_##A = 0; \ @@ -458,6 +277,29 @@ static void* findWeakNotifyFct(void* fct) return NULL; } +// GToggleNotify +#define GO(A) \ +static uintptr_t my_togglenotifyfunc_fct_##A = 0; \ +static int my_togglenotifyfunc_##A(void* a, void* b, int c) \ +{ \ + return RunFunctionFmt(my_togglenotifyfunc_fct_##A, "ppi", a, b, c); \ +} +SUPER() +#undef GO +static void* findToggleNotifyFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_togglenotifyfunc_fct_##A == (uintptr_t)fct) return my_togglenotifyfunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_togglenotifyfunc_fct_##A == 0) {my_togglenotifyfunc_fct_##A = (uintptr_t)fct; return my_togglenotifyfunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gobject GToggleNotify callback\n"); + return NULL; +} + // GParamSpecTypeInfo.... // First the structure GParamSpecTypeInfo statics, with paired x64 source pointer typedef struct my_GParamSpecTypeInfo_s { @@ -511,15 +353,15 @@ static my_GParamSpecTypeInfo_t* findFreeGParamSpecTypeInfo(my_GParamSpecTypeInfo #undef GO #define GO(A) if(ref_GParamSpecTypeInfo_##A == 0) { \ ref_GParamSpecTypeInfo_##A = fcts; \ - my_GParamSpecTypeInfo_##A.instance_init = (fcts->instance_init)?((GetNativeFnc((uintptr_t)fcts->instance_init))?GetNativeFnc((uintptr_t)fcts->instance_init):my_funcs_instance_init_##A):NULL; \ + my_GParamSpecTypeInfo_##A.instance_init = (fcts->instance_init)?((GetNativeFnc((uintptr_t)fcts->instance_init))?(void (*)(void *))GetNativeFnc((uintptr_t)fcts->instance_init):my_funcs_instance_init_##A):NULL; \ fct_funcs_instance_init_##A = (uintptr_t)fcts->instance_init; \ - my_GParamSpecTypeInfo_##A.finalize = (fcts->finalize)?((GetNativeFnc((uintptr_t)fcts->finalize))?GetNativeFnc((uintptr_t)fcts->finalize):my_funcs_finalize_##A):NULL; \ + my_GParamSpecTypeInfo_##A.finalize = (fcts->finalize)?((GetNativeFnc((uintptr_t)fcts->finalize))?(void (*)(void *))GetNativeFnc((uintptr_t)fcts->finalize):my_funcs_finalize_##A):NULL; \ fct_funcs_finalize_##A = (uintptr_t)fcts->finalize; \ - my_GParamSpecTypeInfo_##A.value_set_default = (fcts->value_set_default)?((GetNativeFnc((uintptr_t)fcts->value_set_default))?GetNativeFnc((uintptr_t)fcts->value_set_default):my_funcs_value_set_default_##A):NULL; \ + my_GParamSpecTypeInfo_##A.value_set_default = (fcts->value_set_default)?((GetNativeFnc((uintptr_t)fcts->value_set_default))?(void (*)(void *, void *))GetNativeFnc((uintptr_t)fcts->value_set_default):my_funcs_value_set_default_##A):NULL; \ fct_funcs_value_set_default_##A = (uintptr_t)fcts->value_set_default; \ - my_GParamSpecTypeInfo_##A.value_validate = (fcts->value_validate)?((GetNativeFnc((uintptr_t)fcts->value_validate))?GetNativeFnc((uintptr_t)fcts->value_validate):my_funcs_value_validate_##A):NULL; \ + my_GParamSpecTypeInfo_##A.value_validate = (fcts->value_validate)?((GetNativeFnc((uintptr_t)fcts->value_validate))?(int (*)(void *, void *))GetNativeFnc((uintptr_t)fcts->value_validate):my_funcs_value_validate_##A):NULL; \ fct_funcs_value_validate_##A = (uintptr_t)fcts->value_validate; \ - my_GParamSpecTypeInfo_##A.values_cmp = (fcts->values_cmp)?((GetNativeFnc((uintptr_t)fcts->values_cmp))?GetNativeFnc((uintptr_t)fcts->values_cmp):my_funcs_values_cmp_##A):NULL; \ + my_GParamSpecTypeInfo_##A.values_cmp = (fcts->values_cmp)?((GetNativeFnc((uintptr_t)fcts->values_cmp))?(int (*)(void *, void *, void *))GetNativeFnc((uintptr_t)fcts->values_cmp):my_funcs_values_cmp_##A):NULL; \ fct_funcs_values_cmp_##A = (uintptr_t)fcts->values_cmp; \ return &my_GParamSpecTypeInfo_##A; \ } @@ -597,6 +439,50 @@ static void* findcompareFct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for gobject compare callback\n"); return NULL; } + +// GTypeModuleClass +#define GO(A) \ +static uintptr_t my_load_fct_##A = 0; \ +static int my_load_##A(my_GTypeModule_t* module) \ +{ \ + return (int)RunFunctionFmt(my_load_fct_##A, "p", module); \ +} +SUPER() +#undef GO +static void* findLoadFct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(my_load_fct_##A == (uintptr_t)fct) return my_load_##A; + SUPER() + #undef GO + #define GO(A) if(my_load_fct_##A == 0) {my_load_fct_##A = (uintptr_t)fct; return my_load_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gobject GTypeModuleClass load callback\n"); + return NULL; +} + +#define GO(A) \ +static uintptr_t my_unload_fct_##A = 0; \ +static int my_unload_##A(my_GTypeModule_t* module) \ +{ \ + return (int)RunFunctionFmt(my_unload_fct_##A, "p", module); \ +} +SUPER() +#undef GO +static void* findUnloadFct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(my_unload_fct_##A == (uintptr_t)fct) return my_unload_##A; + SUPER() + #undef GO + #define GO(A) if(my_unload_fct_##A == 0) {my_unload_fct_##A = (uintptr_t)fct; return my_unload_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gobject GTypeModuleClass unload callback\n"); + return NULL; +} + #undef SUPER #include "super100.h" @@ -623,9 +509,89 @@ static void* findGCallbackFct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for gobject generic GCallback\n"); return NULL; } - +// EmissionHook +#define GO(A) \ +static uintptr_t my_EmissionHook_fct_##A = 0; \ +static void my_EmissionHook_##A(void* a, uint32_t b, void* c, void* d) \ +{ \ + RunFunctionFmt(my_EmissionHook_fct_##A, "pupp", a, b, c, d); \ +} +SUPER() +#undef GO +static void* findEmissionHookFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_EmissionHook_fct_##A == (uintptr_t)fct) return my_EmissionHook_##A; + SUPER() + #undef GO + #define GO(A) if(my_EmissionHook_fct_##A == 0) {my_EmissionHook_fct_##A = (uintptr_t)fct; return my_EmissionHook_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gobject2 generic EmissionHook callback\n"); + return NULL; +} +// Event +#define GO(A) \ +static uintptr_t my_Event_fct_##A = 0; \ +static void my_Event_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g, void* h, void* i, void* j) \ +{ \ + RunFunctionFmt(my_Event_fct_##A, "pppppppppp", a, b, c, d, e, f, g, h, i, j); \ +} +SUPER() +#undef GO +static void* findEventFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_Event_fct_##A == (uintptr_t)fct) return my_Event_##A; + SUPER() + #undef GO + #define GO(A) if(my_Event_fct_##A == 0) {my_Event_fct_##A = (uintptr_t)fct; return my_Event_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gobject2 generic Event callback\n"); + return NULL; +} #undef SUPER +EXPORT uintptr_t my_g_signal_connect_data(x64emu_t* emu, void* instance, void* detailed, void* c_handler, void* data, void* closure, uint32_t flags) +{ + return my->g_signal_connect_data(instance, detailed, findEventFct(c_handler), data, findGClosureNotify_Fct(closure), flags); +} + + +EXPORT void* my_g_object_connect(x64emu_t* emu, void* object, void* signal_spec, void** b) +{ + //gobject2_my_t *my = (gobject2_my_t*)my_lib->w.p2; + + char* spec = (char*)signal_spec; + while(spec) { + // loop on each triplet... + if(strstr(spec, "signal::")==spec) { + my_g_signal_connect_data(emu, object, spec+strlen("signal::"), b[0], b[1], NULL, 0); + b+=2; + spec = (char*)*(b++); + } else if(strstr(spec, "swapped_signal::")==spec || strstr(spec, "swapped-signal::")==spec) { + my_g_signal_connect_data(emu, object, spec+strlen("swapped_signal::"), b[0], b[1], NULL, 2); + b+=2; + spec = (char*)*(b++); + } else if(strstr(spec, "signal_after::")==spec || strstr(spec, "signal-after::")==spec) { + my_g_signal_connect_data(emu, object, spec+strlen("signal_after::"), b[0], b[1], NULL, 1); + b+=2; + spec = (char*)*(b++); + } else if(strstr(spec, "swapped_signal_after::")==spec || strstr(spec, "swapped-signal-after::")==spec) { + my_g_signal_connect_data(emu, object, spec+strlen("swapped_signal_after::"), b[0], b[1], NULL, 1|2); + b+=2; + spec = (char*)*(b++); + } else { + printf_log(LOG_NONE, "Warning, don't know how to handle signal spec \"%s\" in g_object_connect\n", spec); + spec = NULL; + } + } + return object; +} + EXPORT uintptr_t my_g_signal_connect_object(x64emu_t* emu, void* instance, void* detailed, void* c_handler, void* object, uint32_t flags) { //TODO: get the type of instance to be more precise below @@ -640,7 +606,7 @@ EXPORT int my_g_boxed_type_register_static(x64emu_t* emu, void* name, void* boxe return my->g_boxed_type_register_static(name, bc, bf); } -EXPORT uint32_t my_g_signal_new(x64emu_t* emu, void* name, size_t itype, int flags, uint32_t offset, void* acc, void* accu_data, void* marsh, size_t rtype, uint32_t n, void** b) +EXPORT uint32_t my_g_signal_new(x64emu_t* emu, void* name, size_t itype, uint32_t flags, uint32_t offset, void* acc, void* accu_data, void* marsh, size_t rtype, uint32_t n, void** b) { printf_log(LOG_DEBUG, "g_signal_new for \"%s\", with offset=%d and %d args\n", (const char*)name, offset, n); @@ -655,20 +621,22 @@ EXPORT uint32_t my_g_signal_new(x64emu_t* emu, void* name, size_t itype, int fla case 4: return my->g_signal_new(name, itype, flags, offset, cb_acc, accu_data, cb_marsh, rtype, n, b[0], b[1], b[2], b[3]); case 5: return my->g_signal_new(name, itype, flags, offset, cb_acc, accu_data, cb_marsh, rtype, n, b[0], b[1], b[2], b[3], b[4]); case 6: return my->g_signal_new(name, itype, flags, offset, cb_acc, accu_data, cb_marsh, rtype, n, b[0], b[1], b[2], b[3], b[4], b[5]); + case 7: return my->g_signal_new(name, itype, flags, offset, cb_acc, accu_data, cb_marsh, rtype, n, b[0], b[1], b[2], b[3], b[4], b[5], b[6]); + case 8: return my->g_signal_new(name, itype, flags, offset, cb_acc, accu_data, cb_marsh, rtype, n, b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]); case 15:return my->g_signal_new(name, itype, flags, offset, cb_acc, accu_data, cb_marsh, rtype, n, b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14]); } printf_log(LOG_NONE, "Warning, gobject g_signal_new called with too many parameters (%d)\n", n); return my->g_signal_new(name, itype, flags, offset, cb_acc, accu_data, cb_marsh, rtype, n, b[0], b[1], b[2]); } -EXPORT uint32_t my_g_signal_newv(x64emu_t* emu, void* name, size_t itype, int flags, void* closure, void* acc, void* accu_data, void* marsh, size_t rtype, uint32_t n, void* types) +EXPORT uint32_t my_g_signal_newv(x64emu_t* emu, void* name, size_t itype, uint32_t flags, void* closure, void* acc, void* accu_data, void* marsh, size_t rtype, uint32_t n, void* types) { printf_log(LOG_DEBUG, "g_signal_newv for \"%s\", with %d args\n", (const char*)name, n); return my->g_signal_newv(name, itype, flags, closure, findAccumulatorFct(acc), accu_data, findMarshalFct(marsh), rtype, n, types); } -EXPORT uint32_t my_g_signal_new_valist(x64emu_t* emu, void* name, size_t itype, int flags, void* closure, void* acc, void* accu_data, void* marsh, size_t rtype, uint32_t n, x64_va_list_t b) +EXPORT uint32_t my_g_signal_new_valist(x64emu_t* emu, void* name, size_t itype, uint32_t flags, void* closure, void* acc, void* accu_data, void* marsh, size_t rtype, uint32_t n, x64_va_list_t b) { printf_log(LOG_DEBUG, "g_signal_new_valist for \"%s\", with %d args\n", (const char*)name, n); #ifdef CONVERT_VALIST @@ -679,7 +647,7 @@ EXPORT uint32_t my_g_signal_new_valist(x64emu_t* emu, void* name, size_t itype, return my->g_signal_new_valist(name, itype, flags, closure, findAccumulatorFct(acc), accu_data, findMarshalFct(marsh), rtype, n, VARARGS); } -EXPORT uint32_t my_g_signal_handlers_block_matched(x64emu_t* emu, void* instance, int mask, uint32_t signal, void* detail, void* closure, void* fnc, void* data) +EXPORT uint32_t my_g_signal_handlers_block_matched(x64emu_t* emu, void* instance, uint32_t mask, uint32_t signal, uint32_t detail, void* closure, void* fnc, void* data) { // NOTE that I have no idea of the fnc signature!... if (fnc) printf_log(LOG_DEBUG, "Warning, gobject g_signal_handlers_block_matched called with non null function \n"); @@ -687,7 +655,7 @@ EXPORT uint32_t my_g_signal_handlers_block_matched(x64emu_t* emu, void* instance return my->g_signal_handlers_block_matched(instance, mask, signal, detail, closure, fnc, data); } -EXPORT uint32_t my_g_signal_handlers_unblock_matched(x64emu_t* emu, void* instance, int mask, uint32_t signal, void* detail, void* closure, void* fnc, void* data) +EXPORT uint32_t my_g_signal_handlers_unblock_matched(x64emu_t* emu, void* instance, uint32_t mask, uint32_t signal, uint32_t detail, void* closure, void* fnc, void* data) { // NOTE that I have no idea of the fnc signature!... if (fnc) printf_log(LOG_DEBUG, "Warning, gobject g_signal_handlers_unblock_matched called with non null function \n"); @@ -695,7 +663,7 @@ EXPORT uint32_t my_g_signal_handlers_unblock_matched(x64emu_t* emu, void* instan return my->g_signal_handlers_unblock_matched(instance, mask, signal, detail, closure, fnc, data); } -EXPORT uint32_t my_g_signal_handlers_disconnect_matched(x64emu_t* emu, void* instance, int mask, uint32_t signal, void* detail, void* closure, void* fnc, void* data) +EXPORT uint32_t my_g_signal_handlers_disconnect_matched(x64emu_t* emu, void* instance, uint32_t mask, uint32_t signal, uint32_t detail, void* closure, void* fnc, void* data) { // NOTE that I have no idea of the fnc signature!... if (fnc) printf_log(LOG_DEBUG, "Warning, gobject g_signal_handlers_disconnect_matched called with non null function \n"); @@ -703,7 +671,7 @@ EXPORT uint32_t my_g_signal_handlers_disconnect_matched(x64emu_t* emu, void* ins return my->g_signal_handlers_disconnect_matched(instance, mask, signal, detail, closure, fnc, data); } -EXPORT unsigned long my_g_signal_handler_find(x64emu_t* emu, void* instance, int mask, uint32_t signal, void* detail, void* closure, void* fnc, void* data) +EXPORT unsigned long my_g_signal_handler_find(x64emu_t* emu, void* instance, uint32_t mask, uint32_t signal, uint32_t detail, void* closure, void* fnc, void* data) { // NOTE that I have no idea of the fnc signature!... if (fnc) printf_log(LOG_DEBUG, "Warning, gobject g_signal_handler_find called with non null function \n"); @@ -751,20 +719,9 @@ EXPORT void my_g_value_register_transform_func(x64emu_t* emu, size_t src, size_t my->g_value_register_transform_func(src, dst, findValueTransformFct(f)); } -static int my_signal_emission_hook(void* ihint, uint32_t n, void* values, my_signal_t* sig) -{ - printf_log(LOG_DEBUG, "gobject2 Signal Emission Hook called, sig=%p\n", sig); - return (int)RunFunctionFmt(sig->c_handler, "pupp", ihint, n, values, sig->data); -} -EXPORT unsigned long my_g_signal_add_emission_hook(x64emu_t* emu, uint32_t signal, void* detail, void* f, void* data, void* notify) +EXPORT unsigned long my_g_signal_add_emission_hook(x64emu_t* emu, uint32_t signal, uint32_t detail, void* f, void* data, void* notify) { - // there can be many signals connected, so something "light" is needed here - - if(!f) - return my->g_signal_add_emission_hook(signal, detail, f, data, notify); - my_signal_t* sig = new_mysignal(f, data, notify); - printf_log(LOG_DEBUG, "gobject2 Signal Emission Hook for signal %d created for %p, sig=%p\n", signal, f, sig); - return my->g_signal_add_emission_hook(signal, detail, my_signal_emission_hook, sig, my_signal_delete); + return my->g_signal_add_emission_hook(signal, detail, findEmissionHookFct(f), data, findDestroyFct(notify)); } EXPORT size_t my_g_type_register_static_simple(x64emu_t* emu, size_t parent, void* name, uint32_t class_size, void* class_init, uint32_t instance_size, void* instance_init, uint32_t flags) @@ -801,7 +758,7 @@ EXPORT void my_g_param_spec_set_qdata_full(x64emu_t* emu, void* pspec, uint32_t my->g_param_spec_set_qdata_full(pspec, quark, data, findFreeFct(notify)); } -EXPORT int my_g_param_type_register_static(x64emu_t* emu, void* name, void* pspec_info) +EXPORT size_t my_g_param_type_register_static(x64emu_t* emu, void* name, void* pspec_info) { return my->g_param_type_register_static(name, findFreeGParamSpecTypeInfo(pspec_info)); @@ -833,7 +790,13 @@ EXPORT void* my_g_type_class_peek_parent(x64emu_t* emu, void* object) return wrapCopyGTKClass(klass, type); } -EXPORT void my_g_signal_emit_valist(x64emu_t* emu, void* inst, uint32_t id, void* quark, x64_va_list_t b) +EXPORT void* my_g_type_check_class_cast(x64emu_t* emu, void* object, size_t kast) +{ + void* klass = my->g_type_check_class_cast(object, kast); + return wrapCopyGTKClass(klass, kast); +} + +EXPORT void my_g_signal_emit_valist(x64emu_t* emu, void* inst, uint32_t id, uint32_t quark, x64_va_list_t b) { #ifdef CONVERT_VALIST CONVERT_VALIST(b); @@ -843,7 +806,7 @@ EXPORT void my_g_signal_emit_valist(x64emu_t* emu, void* inst, uint32_t id, void my->g_signal_emit_valist(inst, id, quark, VARARGS); } -EXPORT void my_g_signal_emit(x64emu_t* emu, void* inst, uint32_t id, void* quark, uintptr_t* b) +EXPORT void my_g_signal_emit(x64emu_t* emu, void* inst, uint32_t id, uint32_t quark, uintptr_t* b) { CREATE_VALIST_FROM_VAARG(b, emu->scratch, 3); my->g_signal_emit_valist(inst, id, quark, VARARGS); @@ -882,14 +845,21 @@ EXPORT void my_g_object_set(x64emu_t* emu, void* a1, void* a2, uintptr_t* b) my->g_object_set_valist(a1, a2, VARARGS); } -EXPORT void my_g_object_set_qdata_full(x64emu_t* emu, void* o, void* q, void* data, void* d) +EXPORT void my_g_object_set_qdata_full(x64emu_t* emu, void* o, uint32_t q, void* data, void* d) { my->g_object_set_qdata_full(o, q, data, findDestroyFct(d)); } +EXPORT int my_g_object_replace_qdata(x64emu_t* emu, void* o, uint32_t q, void* ov, void* nv, void* d, void* od) +{ + return my->g_object_replace_qdata(o, q, ov, nv, findDestroyFct(d), findDestroyFct(od)); +} + EXPORT void my_g_object_class_install_properties(x64emu_t* emu, void* klass, uint32_t n, void* specs) { - my->g_object_class_install_properties(unwrapCopyGTKClass(klass, my->g_object_get_type()), n, specs); + unwrapGTKClass(klass, my->g_object_get_type()); + my->g_object_class_install_properties(klass, n, specs); + wrapGTKClass(klass, my->g_object_get_type()); } EXPORT void my_g_object_weak_ref(x64emu_t* emu, void* object, void* notify, void* data) @@ -897,7 +867,22 @@ EXPORT void my_g_object_weak_ref(x64emu_t* emu, void* object, void* notify, void my->g_object_weak_ref(object, findWeakNotifyFct(notify), data); } -EXPORT void my_g_signal_override_class_handler(x64emu_t* emu, char* name, void* gtype, void* callback) +EXPORT void my_g_object_weak_unref(x64emu_t* emu, void* object, void* notify, void* data) +{ + my->g_object_weak_unref(object, findWeakNotifyFct(notify), data); +} + +EXPORT void my_g_object_add_toggle_ref(x64emu_t* emu, void* object, void* notify, void* data) +{ + my->g_object_add_toggle_ref(object, findToggleNotifyFct(notify), data); +} + +EXPORT void my_g_object_remove_toggle_ref(x64emu_t* emu, void* object, void* notify, void* data) +{ + my->g_object_remove_toggle_ref(object, findToggleNotifyFct(notify), data); +} + +EXPORT void my_g_signal_override_class_handler(x64emu_t* emu, char* name, size_t gtype, void* callback) { my->g_signal_override_class_handler(name, gtype, findGCallbackFct(callback)); } @@ -932,9 +917,35 @@ EXPORT void* my_g_type_value_table_peek(x64emu_t* emu, size_t type) return findFreeGTypeValueTable(my->g_type_value_table_peek(type)); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +EXPORT int my_g_type_module_use(x64emu_t* emu, my_GTypeModule_t* module) +{ + my_GTypeModuleClass_t* module_class = (my_GTypeModuleClass_t*)(((my_GTypeInstance_t*)module)->g_class); + if (module_class) { + module_class->load = findLoadFct(module_class->load); + module_class->unload = findUnloadFct(module_class->unload); + } + return my->g_type_module_use(module); +} + +EXPORT void my_g_type_module_add_interface(x64emu_t* emu, my_GTypeModule_t* module, size_t instance_type, size_t interface_type, my_GInterfaceInfo_t* interface_info) +{ + if (interface_info) { + interface_info->interface_init = findGInterfaceInitFuncFct(interface_info->interface_init, interface_type); + interface_info->interface_finalize = findGInterfaceFinalizeFuncFct(interface_info->interface_finalize); + } + return my->g_type_module_add_interface(module, instance_type, interface_type, interface_info); +} + +EXPORT size_t my_g_type_module_register_type(x64emu_t* emu, my_GTypeModule_t* module, size_t parent_type, char* type_name, my_GTypeInfo_t* type_info, uint32_t flags) +{ + if (type_info) { + type_info->class_init = find_class_init_Fct(type_info->class_init, parent_type); + } + return my->g_type_module_register_type(module, parent_type, type_name, type_info, flags); +} + +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define CUSTOM_INIT \ SetGObjectID(my->g_object_get_type()); \ @@ -943,10 +954,6 @@ EXPORT void* my_g_type_value_table_peek(x64emu_t* emu, size_t type) SetGClassPeek(my->g_type_class_peek); \ SetGTypeParent(my->g_type_parent); -#ifdef ANDROID -#define NEEDED_LIBS "libglib-2.0.so" -#else #define NEEDED_LIBS "libglib-2.0.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgobject2_private.h b/src/wrapped/wrappedgobject2_private.h index fcf4c5c..bd18784 100644 --- a/src/wrapped/wrappedgobject2_private.h +++ b/src/wrapped/wrappedgobject2_private.h @@ -1,5 +1,5 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif //GType is gulong !!!!! @@ -9,9 +9,9 @@ GO(g_array_get_type, LFv) GO(g_binding_flags_get_type, LFv) GO(g_binding_get_flags, uFp) -//GO(g_binding_get_source, -//GO(g_binding_get_source_property, -//GO(g_binding_get_target, +GO(g_binding_get_source, pFp) +GO(g_binding_get_source_property, pFp) +GO(g_binding_get_target, pFp) GO(g_binding_get_target_property, pFp) GO(g_binding_get_type, LFv) GO(g_binding_unbind, vFp) @@ -67,35 +67,35 @@ DATA(g_cclosure_marshal_VOID__VARIANTv, sizeof(void*)) DATA(g_cclosure_marshal_VOID__VOID, sizeof(void*)) DATA(g_cclosure_marshal_VOID__VOIDv, sizeof(void*)) GOM(g_cclosure_new, pFEppp) -//GO(g_cclosure_new_object, -//GO(g_cclosure_new_object_swap, +//GOM(g_cclosure_new_object, pFpp) +//GOM(g_cclosure_new_object_swap, pFpp) GOM(g_cclosure_new_swap, pFEppp) -//GO(g_checksum_get_type, +GO(g_checksum_get_type, LFv) GO(g_clear_object, vFp) GOM(g_closure_add_finalize_notifier, vFEppp) -//GO(g_closure_add_invalidate_notifier, -//GO(g_closure_add_marshal_guards, -//GO(g_closure_get_type, -//GO(g_closure_invalidate, -//GO(g_closure_invoke, -//GO(g_closure_new_object, +//GOM(g_closure_add_invalidate_notifier, vFppp) +//GOM(g_closure_add_marshal_guards, vFppppp) +GO(g_closure_get_type, LFv) +//GOM(g_closure_invalidate, vFp) +GO(g_closure_invoke, vFppupp) +//GOM(g_closure_new_object, pFup) GO(g_closure_new_simple, pFup) -//GO(g_closure_ref, +GO(g_closure_ref, pFp) GOM(g_closure_remove_finalize_notifier, vFEppp) -//GO(g_closure_remove_invalidate_notifier, +//GOM(g_closure_remove_invalidate_notifier, vFppp) GOM(g_closure_set_marshal, vFEpp) -//GO(g_closure_set_meta_marshal, -//GO(g_closure_sink, -GO(g_closure_unref, pFp) +//GOM(g_closure_set_meta_marshal, vFppp) +GO(g_closure_sink, vFp) +GO(g_closure_unref, vFp) GO(g_date_get_type, LFv) GO(g_date_time_get_type, LFv) -GO(g_enum_complete_type_info, vFLpp) +GO(g_enum_complete_type_info, vFLpp) // should the GTypeInfo (1st "p") needs wrapping? GO(g_enum_get_value, pFpi) GO(g_enum_get_value_by_name, pFpp) GO(g_enum_get_value_by_nick, pFpp) GO(g_enum_register_static, LFpp) GO(g_error_get_type, LFv) -GO(g_flags_complete_type_info, vFipp) +GO(g_flags_complete_type_info, vFLpp) // should the GTypeInfo (1st "p") needs wrapping? GO(g_flags_get_first_value, pFpu) GO(g_flags_get_value_by_name, pFpp) GO(g_flags_get_value_by_nick, pFpp) @@ -112,27 +112,27 @@ GO(g_main_loop_get_type, LFv) GO(g_mapped_file_get_type, LFv) GO(g_markup_parse_context_get_type, LFv) GO(g_match_info_get_type, LFv) -//GOM(g_object_add_toggle_ref, vFEpBp) +GOM(g_object_add_toggle_ref, vFEppp) GO(g_object_add_weak_pointer, vFpp) GO(g_object_bind_property, pFppppu) -//GO(g_object_bind_property_full, -//GO(g_object_bind_property_with_closures, -GO(g_object_class_find_property, pFpp) +//GOM(g_object_bind_property_full, pFppppupppp) +//GOM(g_object_bind_property_with_closures, pFppppupp) +GO(g_object_class_find_property, pFpp) // need wrapping? GOM(g_object_class_install_properties, vFEpup) -GO(g_object_class_install_property, vFpup) -GO(g_object_class_list_properties, pFpp) -GO(g_object_class_override_property, vFpup) +GO(g_object_class_install_property, vFpup) // need wrapping? +GO(g_object_class_list_properties, pFpp) // need wrapping? +GO(g_object_class_override_property, vFpup) // need wrapping? GO(g_object_compat_control, LFLp) GOM(g_object_connect, pFEppV) -GO(g_object_disconnect, vFpppppppppppppppp) // caarg -//GOM(g_object_dup_data, pFEppBp) -//GOM(g_object_dup_qdata, pFEppBp) +GO(g_object_disconnect, vFpppppppppppppppp) // vaarg +//GOM(g_object_dup_data, pFEpppp) +//GOM(g_object_dup_qdata, pFEpupp) GO(g_object_force_floating, vFp) GO(g_object_freeze_notify, vFp) GOM(g_object_get, vFEppV) GO(g_object_get_data, pFpp) GO(g_object_get_property, vFppp) -GO(g_object_get_qdata, pFpp) +GO(g_object_get_qdata, pFpu) GO(g_object_get_type, LFv) GOM(g_object_get_valist, vFEppA) GO(g_object_interface_find_property, pFpp) @@ -146,25 +146,25 @@ GO(g_object_notify, vFpp) GO(g_object_notify_by_pspec, vFpp) GO(g_object_ref, pFp) GO(g_object_ref_sink, pFp) -//GOM(g_object_remove_toggle_ref, vFEpBp) +GOM(g_object_remove_toggle_ref, vFEppp) GO(g_object_remove_weak_pointer, vFpp) -//GOM(g_object_replace_data, iFEppppBB) -//GOM(g_object_replace_qdata, iFEppppBB) +//GOM(g_object_replace_data, iFEpppppp) +GOM(g_object_replace_qdata, iFEpupppp) GO(g_object_run_dispose, vFp) GOM(g_object_set, vFEppV) GO(g_object_set_data, vFppp) GOM(g_object_set_data_full, vFEpppp) GO(g_object_set_property, vFppp) GO(g_object_set_qdata, vFpup) -GOM(g_object_set_qdata_full, vFEpppp) +GOM(g_object_set_qdata_full, vFEpupp) GOM(g_object_set_valist, vFEppA) GO(g_object_steal_data, pFpp) GO(g_object_steal_qdata, pFpu) GO(g_object_thaw_notify, vFp) GO(g_object_unref, vFp) -GO(g_object_watch_closure, vFpp) +GO(g_object_watch_closure, vFpp) // needs wrapping? GOM(g_object_weak_ref, vFEppp) -GO(g_object_weak_unref, vFpp) +GOM(g_object_weak_unref, vFEppp) GO(g_param_spec_boolean, pFpppii) GO(g_param_spec_boxed, pFpppLi) GO(g_param_spec_char, pFpppccci) @@ -185,7 +185,7 @@ GO(g_param_spec_internal, pFLpppi) GO(g_param_spec_long, pFpppllli) GO(g_param_spec_object, pFpppLi) GO(g_param_spec_override, pFpp) -GO(g_param_spec_param, pFpppii) +GO(g_param_spec_param, pFpppLi) GO(g_param_spec_pointer, pFpppi) GO(g_param_spec_pool_insert, vFppL) GO(g_param_spec_pool_list, pFpLp) @@ -209,77 +209,77 @@ GO(g_param_spec_unichar, pFpppui) GO(g_param_spec_unref, vFp) GO(g_param_spec_value_array, pFppppi) GO(g_param_spec_variant, pFpppppi) -GOM(g_param_type_register_static, iFEpp) +GOM(g_param_type_register_static, LFEpp) GO(g_param_value_convert, iFpppi) GO(g_param_value_defaults, iFpp) GO(g_param_values_cmp, iFppp) GO(g_param_value_set_default, vFpp) GO(g_param_value_validate, iFpp) GO(g_pointer_type_register_static, LFp) -//GO(g_pollfd_get_type, -//GO(g_ptr_array_get_type, -//GO(g_regex_get_type, +GO(g_pollfd_get_type, LFv) +GO(g_ptr_array_get_type, LFv) +GO(g_regex_get_type, LFv) GO(g_signal_accumulator_first_wins, iFpppp) GO(g_signal_accumulator_true_handled, iFpppp) -GOM(g_signal_add_emission_hook, LFEupppp) +GOM(g_signal_add_emission_hook, LFEuuppp) GO(g_signal_chain_from_overridden, vFpp) -//GO(g_signal_chain_from_overridden_handler, vFpppppppppp) //vaarg -GO(g_signal_connect_closure, LFpppi) -GO(g_signal_connect_closure_by_id, LFpuppi) +//GOM(g_signal_chain_from_overridden_handler, vFpV) +GO(g_signal_connect_closure, LFpppi) // needs wrapping? +GO(g_signal_connect_closure_by_id, LFpuupi) // needs wrapping? GOM(g_signal_connect_data, LFEpppppu) -GOM(g_signal_connect_object, LFEppppi) +GOM(g_signal_connect_object, LFEppppu) GOM(g_signal_emit, vFEpuuV) GO(g_signal_emit_by_name, vFppppppppppp) //vaarg GO(g_signal_emitv, vFpuup) -GOM(g_signal_emit_valist, vFEpupA) // va_list here +GOM(g_signal_emit_valist, vFEpuuA) GO(g_signal_get_invocation_hint, pFp) GO(g_signal_handler_block, vFpL) GO(g_signal_handler_disconnect, vFpL) -GOM(g_signal_handler_find, LFEpiupppp) +GOM(g_signal_handler_find, LFEpuuuppp) GO(g_signal_handler_is_connected, iFpL) -GOM(g_signal_handlers_block_matched, uFEpiupppp) -//GO(g_signal_handlers_destroy, -GOM(g_signal_handlers_disconnect_matched, uFEpiupppp) -GOM(g_signal_handlers_unblock_matched, uFEpiupppp) +GOM(g_signal_handlers_block_matched, uFEpuuuppp) +GO(g_signal_handlers_destroy, vFp) +GOM(g_signal_handlers_disconnect_matched, uFEpuuuppp) +GOM(g_signal_handlers_unblock_matched, uFEpuuuppp) GO(g_signal_handler_unblock, vFpL) GO(g_signal_has_handler_pending, iFpuui) GO(g_signal_list_ids, pFLp) GO(g_signal_lookup, uFpL) GO(g_signal_name, pFu) -GOM(g_signal_new, uFEpLiupppLuV) -//GOM(g_signal_new_class_handler, uFEpLupppppnV) -GOM(g_signal_newv, uFEpLippppLup) -GOM(g_signal_new_valist, uFEpLippppLuA) +GOM(g_signal_new, uFEpLuupppLuV) +//GOM(g_signal_new_class_handler, uFEpLuppppLuV) +GOM(g_signal_newv, uFEpLuppppLup) +GOM(g_signal_new_valist, uFEpLuppppLuA) GO(g_signal_override_class_closure, vFuLp) -GOM(g_signal_override_class_handler, vFEppp) +GOM(g_signal_override_class_handler, vFEpLp) GO(g_signal_parse_name, iFpLppi) GO(g_signal_query, vFup) GO(g_signal_remove_emission_hook, vFuL) -//GOM(g_signal_set_va_marshaller, vFEuiB) +//GOM(g_signal_set_va_marshaller, vFEuLp) GO(g_signal_stop_emission, vFpuu) GO(g_signal_stop_emission_by_name, vFpp) GO(g_signal_type_cclosure_new, pFLu) //should wrap? GO(g_source_get_type, LFv) GO(g_source_set_closure, vFpp) -//GO(g_source_set_dummy_callback, +//GOM(g_source_set_dummy_callback, vFp) GO(g_strdup_value_contents, pFp) GO(g_strv_get_type, LFv) GO(g_thread_get_type, LFv) GO(g_time_zone_get_type, LFv) -//GOM(g_type_add_class_cache_func, vFEpB) +//GOM(g_type_add_class_cache_func, vFEpp) GO(g_type_add_class_private, vFLL) GO(g_type_add_instance_private, iFLL) -//GOM(g_type_add_interface_check, vFEpB) -//GOM(g_type_add_interface_dynamic, vFEiip) +//GOM(g_type_add_interface_check, vFEpp) +//GOM(g_type_add_interface_dynamic, vFELLp) GOM(g_type_add_interface_static, vFELLp) -GO(g_type_check_class_cast, pFpL) +GOM(g_type_check_class_cast, pFEpL) GO(g_type_check_class_is_a, iFpL) GO(g_type_check_instance, iFp) GO(g_type_check_instance_cast, pFpL) -GO(g_type_check_instance_is_a, LFpL) +GO(g_type_check_instance_is_a, iFpL) GO(g_type_check_instance_is_fundamentally_a, iFpL) GO(g_type_check_is_value_type, iFL) -GO(g_type_check_value, LFp) +GO(g_type_check_value, iFp) GO(g_type_check_value_holds, iFpL) GO(g_type_children, pFLp) GO(g_type_class_add_private, vFpL) @@ -289,7 +289,7 @@ GO(g_type_class_get_private, pFpL) GO(g_type_class_peek, pFL) GOM(g_type_class_peek_parent, pFEp) GO(g_type_class_peek_static, pFL) -GO(g_type_class_ref, pFp) +GO(g_type_class_ref, pFL) GO(g_type_class_unref, vFp) GO(g_type_class_unref_uncached, vFp) GO(g_type_create_instance, pFL) @@ -302,45 +302,45 @@ GO(g_type_free_instance, vFp) GO(g_type_from_name, LFp) GO(g_type_fundamental, LFL) GO(g_type_fundamental_next, LFv) -//GOM(g_type_get_plugin, pFEi) // GTypePugin is a stuct with callback +//GOM(g_type_get_plugin, pFEL) // GTypePugin is a stuct with callback GO(g_type_get_qdata, pFLu) GO(g_type_get_type_registration_serial, uFv) GO(g_type_init, vFv) GO(g_type_init_with_debug_flags, vFu) GO(g_type_instance_get_private, pFpL) GO(g_type_interface_add_prerequisite, vFLL) -//GOM(g_type_interface_get_plugin, pFEii) // return GTypePlugin* +//GOM(g_type_interface_get_plugin, pFELL) // return GTypePlugin* GO(g_type_interface_peek, pFpL) GO(g_type_interface_peek_parent, pFp) GO(g_type_interface_prerequisites, pFLp) GO(g_type_interfaces, pFLp) GO(g_type_is_a, iFLL) -//GO(g_type_module_add_interface, -//GO(g_type_module_get_type, +GOM(g_type_module_add_interface, vFEpLLp) +GO(g_type_module_get_type, LFv) GO(g_type_module_register_enum, LFppp) GO(g_type_module_register_flags, LFppp) -//GO(g_type_module_register_type, +GOM(g_type_module_register_type, LFEpLppu) GO(g_type_module_set_name, vFpp) GO(g_type_module_unuse, vFp) -GO(g_type_module_use, iFp) +GOM(g_type_module_use, iFEp) GO(g_type_name, pFL) GO(g_type_name_from_class, pFp) GO(g_type_name_from_instance, pFp) GO(g_type_next_base, LFLL) GO(g_type_parent, LFL) -//GO(g_type_plugin_complete_interface_info, -//GO(g_type_plugin_complete_type_info, -//GO(g_type_plugin_get_type, +//GOM(g_type_plugin_complete_interface_info, vFpLLp) +//GOM(g_type_plugin_complete_type_info, vFpLpp) +GO(g_type_plugin_get_type, LFv) GO(g_type_plugin_unuse, vFp) -//GO(g_type_plugin_use, +GO(g_type_plugin_use, vFp) GO(g_type_qname, uFL) GO(g_type_query, vFLp) //GOM(type_register_dynamic, iFEpippi) -GOM(g_type_register_fundamental, LFELpppi) -GOM(g_type_register_static, LFELppi) +GOM(g_type_register_fundamental, LFELpppu) +GOM(g_type_register_static, LFELppu) GOM(g_type_register_static_simple, LFELpupupu) -//GOM(g_type_remove_class_cache_func, vFEpB) -//GOM(g_type_remove_interface_check, vFEpB) +//GOM(g_type_remove_class_cache_func, vFEpp) +//GOM(g_type_remove_interface_check, vFEpp) GO(g_type_set_qdata, vFLup) GO(g_type_test_flags, iFLu) GOM(g_type_value_table_peek, pFEL) //need to bridge GTypeValueTable @@ -364,7 +364,7 @@ GO(g_value_dup_variant, pFp) GO(g_value_fits_pointer, iFp) GO(g_value_get_boolean, iFp) GO(g_value_get_boxed, pFp) -GO(g_value_get_char, CFp) +GO(g_value_get_char, cFp) GO(g_value_get_double, dFp) GO(g_value_get_enum, iFp) GO(g_value_get_flags, uFp) @@ -387,12 +387,12 @@ GO(g_value_get_variant, pFp) GO(g_value_init, pFpL) GO(g_value_init_from_instance, vFpp) GO(g_value_peek_pointer, pFp) -GOM(g_value_register_transform_func, vFEiip) +GOM(g_value_register_transform_func, vFELLp) GO(g_value_reset, pFp) GO(g_value_set_boolean, vFpi) GO(g_value_set_boxed, vFpp) GO(g_value_set_boxed_take_ownership, vFpp) -GO(g_value_set_char, vFpC) +GO(g_value_set_char, vFpc) GO(g_value_set_double, vFpd) GO(g_value_set_enum, vFpi) GO(g_value_set_flags, vFpu) @@ -423,13 +423,13 @@ GO(g_value_take_param, vFpp) GO(g_value_take_string, vFpp) GO(g_value_take_variant, vFpp) GO(g_value_transform, iFpp) -GO(g_value_type_compatible, iFii) +GO(g_value_type_compatible, iFLL) GO(g_value_type_transformable, iFLL) GO(g_value_unset, vFp) -//GO(g_variant_builder_get_type, -//GO(g_variant_dict_get_type, -//GO(g_variant_get_gtype, -//GO(g_variant_type_get_gtype, +GO(g_variant_builder_get_type, LFv) +GO(g_variant_dict_get_type, LFv) +GO(g_variant_get_gtype, LFv) +GO(g_variant_type_get_gtype, LFv) GO(g_weak_ref_clear, vFp) GO(g_weak_ref_get, pFp) GO(g_weak_ref_init, vFpp) @@ -437,10 +437,15 @@ GO(g_weak_ref_set, vFpp) //GO(_init, // to have some wrapper created for gtkclass.c -GO(dummy_set_property, vFpupp) +GO(dummy_set_property, vFpupp) GO(dummy_drag_data_get, vFpppuu) GO(dummy_drag_motion, iFppiiu) GO(dummy_drag_data_received, vFppiipuu) GO(dummy_childprop, vFppupp) GO(dummy_marshal, vFppuppp) GO(dummy_marshalv, vFpppppip) +GO(dummy_iFppppi, iFppppi) +GO(dummy_pFppii, pFppii) +GO(dummy_vFppppppp, vFppppppp) +GO(dummy_vFppppppi, vFppppppi) +GO(dummy_pFppppppi, pFppppppi) diff --git a/src/wrapped/wrappedgomp.c b/src/wrapped/wrappedgomp.c index 679b1a9..e711db7 100644 --- a/src/wrapped/wrappedgomp.c +++ b/src/wrapped/wrappedgomp.c @@ -56,6 +56,29 @@ static void* find_parallel_Fct(void* fct) return NULL; } + +// task_cpy +#define GO(A) \ +static uintptr_t my_task_cpy_fct_##A = 0; \ +static void my_task_cpy_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_task_cpy_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* find_task_cpy_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(my_task_cpy_fct_##A == (uintptr_t)fct) return my_task_cpy_##A; + SUPER() + #undef GO + #define GO(A) if(my_task_cpy_fct_##A == 0) {my_task_cpy_fct_##A = (uintptr_t)fct; return my_task_cpy_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libgomp Boxed task_cpy callback\n"); + return NULL; +} + #undef SUPER EXPORT void my_GOMP_parallel(x64emu_t* emu, void* f, void* data, unsigned num_threads, uint32_t flags) @@ -63,4 +86,10 @@ EXPORT void my_GOMP_parallel(x64emu_t* emu, void* f, void* data, unsigned num_th my->GOMP_parallel(find_parallel_Fct(f), data, num_threads, flags); } +EXPORT void my_GOMP_task(x64emu_t* emu, void* fn, void *data, void* cpyfn, long arg_size, + long arg_align, int if_clause, unsigned flags, void **depend, int priority) +{ + my->GOMP_task(find_parallel_Fct(fn), data, find_task_cpy_Fct(cpyfn),arg_size, arg_align, if_clause, flags, depend, priority); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgomp_private.h b/src/wrapped/wrappedgomp_private.h index c7ccd76..7de432d 100644 --- a/src/wrapped/wrappedgomp_private.h +++ b/src/wrapped/wrappedgomp_private.h @@ -133,16 +133,16 @@ //GO(acc_wait_h_, //GO(GOMP_alloc, -//GO(GOMP_atomic_end, -//GO(GOMP_atomic_start, -//GO(GOMP_barrier, -//GO(GOMP_barrier_cancel, -//GO(GOMP_cancel, +GO(GOMP_atomic_end, vFv) +GO(GOMP_atomic_start, vFv) +GO(GOMP_barrier, vFv) +GO(GOMP_barrier_cancel, iFv) +GO(GOMP_cancel, iFii) //GO(GOMP_cancellation_point, -//GO(GOMP_critical_end, -//GO(GOMP_critical_name_end, -//GO(GOMP_critical_name_start, -//GO(GOMP_critical_start, +GO(GOMP_critical_end, vFv) +GO(GOMP_critical_name_end, vFp) +GO(GOMP_critical_name_start, vFp) +GO(GOMP_critical_start, vFv) //GO(GOMP_doacross_post, //GO(GOMP_doacross_ull_post, //GO(GOMP_doacross_ull_wait, @@ -154,11 +154,11 @@ //GO(GOMP_loop_doacross_runtime_start, //GO(GOMP_loop_doacross_start, //GO(GOMP_loop_doacross_static_start, -//GO(GOMP_loop_dynamic_next, -//GO(GOMP_loop_dynamic_start, -//GO(GOMP_loop_end, +GO(GOMP_loop_dynamic_next, iFpp) +GO(GOMP_loop_dynamic_start, iFllllpp) +GO(GOMP_loop_end, vFv) //GO(GOMP_loop_end_cancel, -//GO(GOMP_loop_end_nowait, +GO(GOMP_loop_end_nowait, vFv) //GO(GOMP_loop_guided_next, //GO(GOMP_loop_guided_start, //GO(GOMP_loop_maybe_nonmonotonic_runtime_next, @@ -169,13 +169,13 @@ //GO(GOMP_loop_nonmonotonic_guided_start, //GO(GOMP_loop_nonmonotonic_runtime_next, //GO(GOMP_loop_nonmonotonic_runtime_start, -//GO(GOMP_loop_ordered_dynamic_next, -//GO(GOMP_loop_ordered_dynamic_start, +GO(GOMP_loop_ordered_dynamic_next, iFpp) +GO(GOMP_loop_ordered_dynamic_start, iFllllpp) //GO(GOMP_loop_ordered_guided_next, //GO(GOMP_loop_ordered_guided_start, //GO(GOMP_loop_ordered_runtime_next, //GO(GOMP_loop_ordered_runtime_start, -//GO(GOMP_loop_ordered_start, +//GO(GOMP_loop_ordered_start, //GO(GOMP_loop_ordered_static_next, //GO(GOMP_loop_ordered_static_start, //GO(GOMP_loop_runtime_next, @@ -218,8 +218,8 @@ //GO(GOMP_offload_register_ver, //GO(GOMP_offload_unregister, //GO(GOMP_offload_unregister_ver, -//GO(GOMP_ordered_end, -//GO(GOMP_ordered_start, +GO(GOMP_ordered_end, vFv) +GO(GOMP_ordered_start, vFv) GOM(GOMP_parallel, vFEppuu) //GO(GOMP_parallel_end, //GO(GOMP_parallel_loop_dynamic, @@ -255,12 +255,12 @@ GOM(GOMP_parallel, vFEppuu) //GO(GOMP_sections2_start, //GO(GOMP_sections_end, //GO(GOMP_sections_end_cancel, -//GO(GOMP_sections_end_nowait, -//GO(GOMP_sections_next, -//GO(GOMP_sections_start, +GO(GOMP_sections_end_nowait, vFv) +GO(GOMP_sections_next, uFv) +GO(GOMP_sections_start, uFu) //GO(GOMP_single_copy_end, //GO(GOMP_single_copy_start, -//GO(GOMP_single_start, +GO(GOMP_single_start, iFv) //GO(GOMP_target, //GO(GOMP_target_data, //GO(GOMP_target_data_ext, @@ -269,7 +269,7 @@ GOM(GOMP_parallel, vFEppuu) //GO(GOMP_target_ext, //GO(GOMP_target_update, //GO(GOMP_target_update_ext, -//GO(GOMP_task, +GOM(GOMP_task, vFEppplliupi) //GO(GOMP_taskgroup_end, //GO(GOMP_taskgroup_reduction_register, //GO(GOMP_taskgroup_reduction_unregister, @@ -347,7 +347,7 @@ GO(omp_get_max_threads, iFv) //GO(omp_get_num_devices_, //GO(omp_get_num_places, //GO(omp_get_num_places_, -//GO(omp_get_num_procs, +GO(omp_get_num_procs, iFv) //GO(omp_get_num_procs_, //GO(omp_get_num_teams, //GO(omp_get_num_teams_, @@ -403,7 +403,7 @@ GO(omp_get_thread_num, iFv) //GO(omp_init_nest_lock@OMP_1.0 //GO(omp_init_nest_lock_, //GO(omp_init_nest_lock_@OMP_1.0 -//GO(omp_in_parallel, +GO(omp_in_parallel, iFv) //GO(omp_in_parallel_, //GO(omp_is_initial_device, //GO(omp_is_initial_device_, @@ -439,7 +439,7 @@ GO(omp_get_thread_num, iFv) //GO(omp_set_num_teams, //GO(omp_set_num_teams_, //GO(omp_set_num_teams_8_, -//GO(omp_set_num_threads, +GO(omp_set_num_threads, vFi) //GO(omp_set_num_threads_, //GO(omp_set_num_threads_8_, //GO(omp_set_schedule, diff --git a/src/wrapped/wrappedgssapikrb5_private.h b/src/wrapped/wrappedgssapikrb5_private.h index 1329530..d6173d6 100644 --- a/src/wrapped/wrappedgssapikrb5_private.h +++ b/src/wrapped/wrappedgssapikrb5_private.h @@ -133,7 +133,7 @@ GO(gss_release_buffer_set, uFpp) GO(gss_release_cred, uFpp) GO(gss_release_iov_buffer, uFppi) GO(gss_release_name, uFpp) -//GO(gss_release_oid, +GO(gss_release_oid, uFpp) GO(gss_release_oid_set, uFpp) //GO(gss_seal, //GO(gss_set_cred_option, @@ -162,4 +162,4 @@ GO(gss_wrap_iov, uFppiuppi) //GO(gss_wrap_size_limit, //DATAB(krb5_gss_dbg_client_expcreds, //GO(krb5_gss_register_acceptor_identity, -//GO(krb5_gss_use_kdc_context, \ No newline at end of file +//GO(krb5_gss_use_kdc_context, diff --git a/src/wrapped/wrappedgstallocators.c b/src/wrapped/wrappedgstallocators.c index ebdcb0f..0369c98 100644 --- a/src/wrapped/wrappedgstallocators.c +++ b/src/wrapped/wrappedgstallocators.c @@ -12,16 +12,12 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* gstallocatorsName = "libgstallocators-1.0.so"; -#else - const char* gstallocatorsName = "libgstallocators-1.0.so.0"; -#endif +const char* gstallocatorsName = "libgstallocators-1.0.so.0"; +#define ALTNAME "libgstallocators-1.0.so" #define LIBNAME gstallocators -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstallocators_private.h b/src/wrapped/wrappedgstallocators_private.h index 18c71e1..f906e7f 100644 --- a/src/wrapped/wrappedgstallocators_private.h +++ b/src/wrapped/wrappedgstallocators_private.h @@ -1,18 +1,18 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(gst_dmabuf_allocator_alloc, pFpiL) -//GO(gst_dmabuf_allocator_alloc_with_flags, +GO(gst_dmabuf_allocator_alloc_with_flags, pFpiLu) GO(gst_dmabuf_allocator_get_type, LFv) GO(gst_dmabuf_allocator_new, pFv) -//GO(gst_dmabuf_memory_get_fd, -//GO(gst_fd_allocator_alloc, +GO(gst_dmabuf_memory_get_fd, iFp) +GO(gst_fd_allocator_alloc, pFpiLu) GO(gst_fd_allocator_get_type, LFv) -//GO(gst_fd_allocator_new, -//GO(gst_fd_memory_get_fd, -//GO(gst_is_dmabuf_memory, -//GO(gst_is_fd_memory, -//GO(gst_is_phys_memory, +GO(gst_fd_allocator_new, pFv) +GO(gst_fd_memory_get_fd, iFp) +GO(gst_is_dmabuf_memory, iFp) +GO(gst_is_fd_memory, iFp) +GO(gst_is_phys_memory, iFp) GO(gst_phys_memory_allocator_get_type, LFv) -//GO(gst_phys_memory_get_phys_addr, \ No newline at end of file +GO(gst_phys_memory_get_phys_addr, LFp) diff --git a/src/wrapped/wrappedgstapp.c b/src/wrapped/wrappedgstapp.c index bc712f7..bc38751 100644 --- a/src/wrapped/wrappedgstapp.c +++ b/src/wrapped/wrappedgstapp.c @@ -12,16 +12,12 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* gstappName = "libgstapp-1.0.so"; -#else - const char* gstappName = "libgstapp-1.0.so.0"; -#endif +const char* gstappName = "libgstapp-1.0.so.0"; +#define ALTNAME "libgstapp-1.0.so" #define LIBNAME gstapp -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstapp_private.h b/src/wrapped/wrappedgstapp_private.h index 2b3bd09..f097df3 100644 --- a/src/wrapped/wrappedgstapp_private.h +++ b/src/wrapped/wrappedgstapp_private.h @@ -1,45 +1,45 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//GO(gst_app_sink_get_buffer_list_support, -//GO(gst_app_sink_get_caps, -//GO(gst_app_sink_get_drop, -//GO(gst_app_sink_get_emit_signals, -//GO(gst_app_sink_get_max_buffers, +GO(gst_app_sink_get_buffer_list_support, iFp) +GO(gst_app_sink_get_caps, pFp) +GO(gst_app_sink_get_drop, iFp) +GO(gst_app_sink_get_emit_signals, iFp) +GO(gst_app_sink_get_max_buffers, uFp) GO(gst_app_sink_get_type, LFv) -//GO(gst_app_sink_get_wait_on_eos, -//GO(gst_app_sink_is_eos, -//GO(gst_app_sink_pull_preroll, -//GO(gst_app_sink_pull_sample, -//GO(gst_app_sink_set_buffer_list_support, -//GO(gst_app_sink_set_callbacks, -//GO(gst_app_sink_set_caps, -//GO(gst_app_sink_set_drop, -//GO(gst_app_sink_set_emit_signals, -//GO(gst_app_sink_set_max_buffers, -//GO(gst_app_sink_set_wait_on_eos, -//GO(gst_app_sink_try_pull_preroll, -//GO(gst_app_sink_try_pull_sample, -//GO(gst_app_src_end_of_stream, -//GO(gst_app_src_get_caps, -//GO(gst_app_src_get_current_level_bytes, -//GO(gst_app_src_get_duration, -//GO(gst_app_src_get_emit_signals, -//GO(gst_app_src_get_latency, -//GO(gst_app_src_get_max_bytes, -//GO(gst_app_src_get_size, -//GO(gst_app_src_get_stream_type, -//GO(gst_app_src_get_type, -//GO(gst_app_src_push_buffer, -//GO(gst_app_src_push_buffer_list, -//GO(gst_app_src_push_sample, -//GO(gst_app_src_set_callbacks, -//GO(gst_app_src_set_caps, -//GO(gst_app_src_set_duration, -//GO(gst_app_src_set_emit_signals, -//GO(gst_app_src_set_latency, -//GO(gst_app_src_set_max_bytes, -//GO(gst_app_src_set_size, -//GO(gst_app_src_set_stream_type, -//GO(gst_app_stream_type_get_type, +GO(gst_app_sink_get_wait_on_eos, iFp) +GO(gst_app_sink_is_eos, iFp) +GO(gst_app_sink_pull_preroll, pFp) +GO(gst_app_sink_pull_sample, pFp) +GO(gst_app_sink_set_buffer_list_support, vFpi) +//GOM(gst_app_sink_set_callbacks, vFEpppp) +GO(gst_app_sink_set_caps, vFpp) +GO(gst_app_sink_set_drop, vFpi) +GO(gst_app_sink_set_emit_signals, vFpi) +GO(gst_app_sink_set_max_buffers, vFpu) +GO(gst_app_sink_set_wait_on_eos, vFpi) +GO(gst_app_sink_try_pull_preroll, pFpL) +GO(gst_app_sink_try_pull_sample, pFpL) +GO(gst_app_src_end_of_stream, iFp) +GO(gst_app_src_get_caps, pFp) +GO(gst_app_src_get_current_level_bytes, LFp) +GO(gst_app_src_get_duration, LFp) +GO(gst_app_src_get_emit_signals, iFp) +GO(gst_app_src_get_latency, vFppp) +GO(gst_app_src_get_max_bytes, LFp) +GO(gst_app_src_get_size, lFp) +GO(gst_app_src_get_stream_type, uFp) +GO(gst_app_src_get_type, LFv) +GO(gst_app_src_push_buffer, iFpp) +GO(gst_app_src_push_buffer_list, iFpp) +GO(gst_app_src_push_sample, iFpp) +//GOM(gst_app_src_set_callbacks, vFEpppp) +GO(gst_app_src_set_caps, vFpp) +GO(gst_app_src_set_duration, vFpL) +GO(gst_app_src_set_emit_signals, vFpi) +GO(gst_app_src_set_latency, vFpLL) +GO(gst_app_src_set_max_bytes, vFpL) +GO(gst_app_src_set_size, vFpl) +GO(gst_app_src_set_stream_type, vFpu) +GO(gst_app_stream_type_get_type, LFv) diff --git a/src/wrapped/wrappedgstaudio.c b/src/wrapped/wrappedgstaudio.c index 943d2fa..2b3e34d 100644 --- a/src/wrapped/wrappedgstaudio.c +++ b/src/wrapped/wrappedgstaudio.c @@ -20,11 +20,8 @@ #include "gtkclass.h" #include "fileutils.h" -#ifdef ANDROID - const char* gstaudioName = "libgstaudio-1.0.so"; -#else - const char* gstaudioName = "libgstaudio-1.0.so.0"; -#endif +const char* gstaudioName = "libgstaudio-1.0.so.0"; +#define ALTNAME "libgstaudio-1.0.so" #define LIBNAME gstaudio @@ -38,18 +35,13 @@ typedef size_t (*LFv_t)(); #include "wrappercallback.h" -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define CUSTOM_INIT \ SetGstAudioDecoderID(my->gst_audio_decoder_get_type()); \ SetGstAudioFilterID(my->gst_audio_filter_get_type()); -#ifdef ANDROID -#define NEEDED_LIBS "libgstreamer-1.0.so" -#else #define NEEDED_LIBS "libgstreamer-1.0.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstaudio_private.h b/src/wrapped/wrappedgstaudio_private.h index 9d41361..e94c08c 100644 --- a/src/wrapped/wrappedgstaudio_private.h +++ b/src/wrapped/wrappedgstaudio_private.h @@ -1,246 +1,246 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//GO(gst_audio_aggregator_convert_pad_get_type, -//GO(gst_audio_aggregator_get_type, -//GO(gst_audio_aggregator_pad_get_type, -//GO(gst_audio_aggregator_set_sink_caps, -//GO(gst_audio_base_sink_create_ringbuffer, -//GO(gst_audio_base_sink_discont_reason_get_type, -//GO(gst_audio_base_sink_get_alignment_threshold, -//GO(gst_audio_base_sink_get_discont_wait, -//GO(gst_audio_base_sink_get_drift_tolerance, -//GO(gst_audio_base_sink_get_provide_clock, -//GO(gst_audio_base_sink_get_slave_method, -//GO(gst_audio_base_sink_get_type, -//GO(gst_audio_base_sink_report_device_failure, -//GO(gst_audio_base_sink_set_alignment_threshold, -//GO(gst_audio_base_sink_set_custom_slaving_callback, -//GO(gst_audio_base_sink_set_discont_wait, -//GO(gst_audio_base_sink_set_drift_tolerance, -//GO(gst_audio_base_sink_set_provide_clock, -//GO(gst_audio_base_sink_set_slave_method, -//GO(gst_audio_base_sink_slave_method_get_type, -//GO(gst_audio_base_src_create_ringbuffer, -//GO(gst_audio_base_src_get_provide_clock, -//GO(gst_audio_base_src_get_slave_method, -//GO(gst_audio_base_src_get_type, -//GO(gst_audio_base_src_set_provide_clock, -//GO(gst_audio_base_src_set_slave_method, -//GO(gst_audio_base_src_slave_method_get_type, +GO(gst_audio_aggregator_convert_pad_get_type, LFv) +GO(gst_audio_aggregator_get_type, LFv) +GO(gst_audio_aggregator_pad_get_type, LFv) +GO(gst_audio_aggregator_set_sink_caps, vFppp) +//GOM(gst_audio_base_sink_create_ringbuffer, pFEp) +GO(gst_audio_base_sink_discont_reason_get_type, LFv) +//GOM(gst_audio_base_sink_get_alignment_threshold, LFEp) +//GOM(gst_audio_base_sink_get_discont_wait, LFEp) +//GOM(gst_audio_base_sink_get_drift_tolerance, lFEp) +//GOM(gst_audio_base_sink_get_provide_clock, iFEp) +//GOM(gst_audio_base_sink_get_slave_method, uFEp) +GO(gst_audio_base_sink_get_type, LFv) +//GOM(gst_audio_base_sink_report_device_failure, vFEp) +//GOM(gst_audio_base_sink_set_alignment_threshold, vFEpL) +//GOM(gst_audio_base_sink_set_custom_slaving_callback, vFEpppp) +//GOM(gst_audio_base_sink_set_discont_wait, vFEpL) +//GOM(gst_audio_base_sink_set_drift_tolerance, vFEpl) +//GOM(gst_audio_base_sink_set_provide_clock, vFEpi) +//GOM(gst_audio_base_sink_set_slave_method, vFEpu) +GO(gst_audio_base_sink_slave_method_get_type, LFv) +//GOM(gst_audio_base_src_create_ringbuffer, pFEp) +//GOM(gst_audio_base_src_get_provide_clock, iFEp) +//GOM(gst_audio_base_src_get_slave_method, uFEp) +GO(gst_audio_base_src_get_type, LFv) +//GOM(gst_audio_base_src_set_provide_clock, vFEpi) +//GOM(gst_audio_base_src_set_slave_method, vFEpu) +GO(gst_audio_base_src_slave_method_get_type, LFv) GO(gst_audio_buffer_clip, pFppii) -//GO(gst_audio_buffer_map, +GO(gst_audio_buffer_map, iFpppu) GO(gst_audio_buffer_reorder_channels, iFpuipp) GO(gst_audio_buffer_truncate, pFpiLL) -//GO(gst_audio_buffer_unmap, -//GO(gst_audio_cd_src_add_track, -//GO(gst_audio_cd_src_get_type, -//GO(gst_audio_cd_src_mode_get_type, +GO(gst_audio_buffer_unmap, vFp) +GO(gst_audio_cd_src_add_track, iFpp) +GO(gst_audio_cd_src_get_type, LFv) +GO(gst_audio_cd_src_mode_get_type, LFv) GO(gst_audio_channel_get_fallback_mask, LFi) -//GO(gst_audio_channel_mixer_flags_get_type, +GO(gst_audio_channel_mixer_flags_get_type, LFv) GO(gst_audio_channel_mixer_free, vFp) GO(gst_audio_channel_mixer_is_passthrough, iFp) GO(gst_audio_channel_mixer_new, pFuuipip) GO(gst_audio_channel_mixer_new_with_matrix, pFuuiip) GO(gst_audio_channel_mixer_samples, vFpppi) -//GO(gst_audio_channel_position_get_type, +GO(gst_audio_channel_position_get_type, LFv) GO(gst_audio_channel_positions_from_mask, iFiLp) GO(gst_audio_channel_positions_to_mask, iFpiip) GO(gst_audio_channel_positions_to_string, pFpi) GO(gst_audio_channel_positions_to_valid_order, iFpi) GO(gst_audio_check_valid_channel_positions, iFpii) GO(gst_audio_clipping_meta_api_get_type, LFv) -//GO(gst_audio_clipping_meta_get_info, -//GO(gst_audio_clock_adjust, -//GO(gst_audio_clock_get_time, -//GO(gst_audio_clock_get_type, -//GO(gst_audio_clock_invalidate, -//GO(gst_audio_clock_new, -//GO(gst_audio_clock_reset, +GO(gst_audio_clipping_meta_get_info, pFv) +//GOM(gst_audio_clock_adjust, LFEpL) +//GOM(gst_audio_clock_get_time, LFEp) +GO(gst_audio_clock_get_type, LFv) +//GOM(gst_audio_clock_invalidate, vFEp) +//GOM(gst_audio_clock_new, pFEpppp) +//GOM(gst_audio_clock_reset, vFEpL) GO(gst_audio_converter_convert, iFpupLpp) -//GO(gst_audio_converter_flags_get_type, -//GO(gst_audio_converter_free, +GO(gst_audio_converter_flags_get_type, LFv) +GO(gst_audio_converter_free, vFp) GO(gst_audio_converter_get_config, pFppp) GO(gst_audio_converter_get_in_frames, LFpL) GO(gst_audio_converter_get_max_latency, LFp) -//GO(gst_audio_converter_get_out_frames, -//GO(gst_audio_converter_get_type, +GO(gst_audio_converter_get_out_frames, LFpL) +GO(gst_audio_converter_get_type, LFv) GO(gst_audio_converter_is_passthrough, iFp) -//GO(gst_audio_converter_new, +GO(gst_audio_converter_new, pFuppp) GO(gst_audio_converter_reset, vFp) GO(gst_audio_converter_samples, iFpupLpL) -//GO(gst_audio_converter_supports_inplace, +GO(gst_audio_converter_supports_inplace, iFp) GO(gst_audio_converter_update_config, iFpiip) GO(gst_audio_decoder_allocate_output_buffer, pFpL) -GO(_gst_audio_decoder_error, iFpipippppi) +GO(_gst_audio_decoder_error, iFpiuippppi) GO(gst_audio_decoder_finish_frame, iFppi) GO(gst_audio_decoder_finish_subframe, iFpp) -//GO(gst_audio_decoder_get_allocator, -//GO(gst_audio_decoder_get_audio_info, -//GO(gst_audio_decoder_get_delay, -//GO(gst_audio_decoder_get_drainable, -//GO(gst_audio_decoder_get_estimate_rate, -//GO(gst_audio_decoder_get_latency, -//GO(gst_audio_decoder_get_max_errors, -//GO(gst_audio_decoder_get_min_latency, -//GO(gst_audio_decoder_get_needs_format, -//GO(gst_audio_decoder_get_parse_state, -//GO(gst_audio_decoder_get_plc, -//GO(gst_audio_decoder_get_plc_aware, -//GO(gst_audio_decoder_get_tolerance, +GO(gst_audio_decoder_get_allocator, vFppp) +GO(gst_audio_decoder_get_audio_info, pFp) +GO(gst_audio_decoder_get_delay, iFp) +GO(gst_audio_decoder_get_drainable, iFp) +GO(gst_audio_decoder_get_estimate_rate, iFp) +GO(gst_audio_decoder_get_latency, vFppp) +GO(gst_audio_decoder_get_max_errors, iFp) +GO(gst_audio_decoder_get_min_latency, LFp) +GO(gst_audio_decoder_get_needs_format, iFp) +GO(gst_audio_decoder_get_parse_state, vFppp) +GO(gst_audio_decoder_get_plc, iFp) +GO(gst_audio_decoder_get_plc_aware, iFp) +GO(gst_audio_decoder_get_tolerance, LFp) GO(gst_audio_decoder_get_type, LFv) -//GO(gst_audio_decoder_merge_tags, -//GO(gst_audio_decoder_negotiate, -//GO(gst_audio_decoder_proxy_getcaps, -//GO(gst_audio_decoder_set_allocation_caps, +GO(gst_audio_decoder_merge_tags, vFppu) +GO(gst_audio_decoder_negotiate, iFp) +GO(gst_audio_decoder_proxy_getcaps, pFppp) +GO(gst_audio_decoder_set_allocation_caps, vFpp) GO(gst_audio_decoder_set_drainable, vFpi) -//GO(gst_audio_decoder_set_estimate_rate, -//GO(gst_audio_decoder_set_latency, -//GO(gst_audio_decoder_set_max_errors, -//GO(gst_audio_decoder_set_min_latency, +GO(gst_audio_decoder_set_estimate_rate, vFpi) +GO(gst_audio_decoder_set_latency, vFpLL) +GO(gst_audio_decoder_set_max_errors, vFpi) +GO(gst_audio_decoder_set_min_latency, vFpL) GO(gst_audio_decoder_set_needs_format, vFpi) -//GO(gst_audio_decoder_set_output_caps, +GO(gst_audio_decoder_set_output_caps, iFpp) GO(gst_audio_decoder_set_output_format, iFpp) -//GO(gst_audio_decoder_set_plc, -//GO(gst_audio_decoder_set_plc_aware, -//GO(gst_audio_decoder_set_tolerance, +GO(gst_audio_decoder_set_plc, vFpi) +GO(gst_audio_decoder_set_plc_aware, vFpi) +GO(gst_audio_decoder_set_tolerance, vFpL) GO(gst_audio_decoder_set_use_default_pad_acceptcaps, vFpi) -//GO(gst_audio_dither_method_get_type, -//GO(gst_audio_downmix_meta_api_get_type, -//GO(gst_audio_downmix_meta_get_info, -//GO(gst_audio_encoder_allocate_output_buffer, +GO(gst_audio_dither_method_get_type, LFv) +GO(gst_audio_downmix_meta_api_get_type, LFv) +GO(gst_audio_downmix_meta_get_info, pFv) +GO(gst_audio_encoder_allocate_output_buffer, pFpL) GO(gst_audio_encoder_finish_frame, iFppi) -//GO(gst_audio_encoder_get_allocator, +GO(gst_audio_encoder_get_allocator, vFppp) GO(gst_audio_encoder_get_audio_info, pFp) -//GO(gst_audio_encoder_get_drainable, -//GO(gst_audio_encoder_get_frame_max, -//GO(gst_audio_encoder_get_frame_samples_max, -//GO(gst_audio_encoder_get_frame_samples_min, -//GO(gst_audio_encoder_get_hard_min, -//GO(gst_audio_encoder_get_hard_resync, -//GO(gst_audio_encoder_get_latency, -//GO(gst_audio_encoder_get_lookahead, -//GO(gst_audio_encoder_get_mark_granule, -//GO(gst_audio_encoder_get_perfect_timestamp, -//GO(gst_audio_encoder_get_tolerance, +GO(gst_audio_encoder_get_drainable, iFp) +GO(gst_audio_encoder_get_frame_max, iFp) +GO(gst_audio_encoder_get_frame_samples_max, iFp) +GO(gst_audio_encoder_get_frame_samples_min, iFp) +GO(gst_audio_encoder_get_hard_min, iFp) +GO(gst_audio_encoder_get_hard_resync, iFp) +GO(gst_audio_encoder_get_latency, vFppp) +GO(gst_audio_encoder_get_lookahead, iFp) +GO(gst_audio_encoder_get_mark_granule, iFp) +GO(gst_audio_encoder_get_perfect_timestamp, iFp) +GO(gst_audio_encoder_get_tolerance, LFp) GO(gst_audio_encoder_get_type, LFv) -GO(gst_audio_encoder_merge_tags, vFppi) -//GO(gst_audio_encoder_negotiate, -//GO(gst_audio_encoder_proxy_getcaps, -//GO(gst_audio_encoder_set_allocation_caps, +GO(gst_audio_encoder_merge_tags, vFppu) +GO(gst_audio_encoder_negotiate, iFp) +GO(gst_audio_encoder_proxy_getcaps, pFppp) +GO(gst_audio_encoder_set_allocation_caps, vFpp) GO(gst_audio_encoder_set_drainable, vFpi) GO(gst_audio_encoder_set_frame_max, vFpi) GO(gst_audio_encoder_set_frame_samples_max, vFpi) GO(gst_audio_encoder_set_frame_samples_min, vFpi) -//GO(gst_audio_encoder_set_hard_min, -//GO(gst_audio_encoder_set_hard_resync, -//GO(gst_audio_encoder_set_headers, -//GO(gst_audio_encoder_set_latency, -//GO(gst_audio_encoder_set_lookahead, -//GO(gst_audio_encoder_set_mark_granule, +GO(gst_audio_encoder_set_hard_min, vFpi) +GO(gst_audio_encoder_set_hard_resync, vFpi) +GO(gst_audio_encoder_set_headers, vFpp) +GO(gst_audio_encoder_set_latency, vFpLL) +GO(gst_audio_encoder_set_lookahead, vFpi) +GO(gst_audio_encoder_set_mark_granule, vFpi) GO(gst_audio_encoder_set_output_format, iFpp) -//GO(gst_audio_encoder_set_perfect_timestamp, -//GO(gst_audio_encoder_set_tolerance, -//GO(gst_audio_filter_class_add_pad_templates, +GO(gst_audio_encoder_set_perfect_timestamp, vFpi) +GO(gst_audio_encoder_set_tolerance, vFpL) +GO(gst_audio_filter_class_add_pad_templates, vFpp) GO(gst_audio_filter_get_type, LFv) GO(gst_audio_flags_get_type, LFv) GO(gst_audio_format_build_integer, uFiiii) GO(gst_audio_format_fill_silence, vFppL) GO(gst_audio_format_flags_get_type, LFv) GO(gst_audio_format_from_string, uFp) -//GO(gst_audio_format_get_info, +GO(gst_audio_format_get_info, pFu) GO(gst_audio_format_get_type, LFv) GO(gst_audio_format_info_fill_silence, vFppL) GO(gst_audio_format_info_get_type, LFv) GO(gst_audio_formats_raw, pFp) GO(gst_audio_format_to_string, pFu) GO(gst_audio_get_channel_reorder_map, iFippp) -//GO(gst_audio_iec61937_frame_size, -//GO(gst_audio_iec61937_payload, -GO(gst_audio_info_convert, iFpiIip) +GO(gst_audio_iec61937_frame_size, uFp) +GO(gst_audio_iec61937_payload, iFpupupi) +GO(gst_audio_info_convert, iFpulup) GO(gst_audio_info_copy, pFp) GO(gst_audio_info_free, vFp) GO(gst_audio_info_from_caps, iFpp) -GO(gst_audio_info_get_type, pFv) +GO(gst_audio_info_get_type, LFv) GO(gst_audio_info_init, vFp) GO(gst_audio_info_is_equal, iFpp) GO(gst_audio_info_new, pFv) -GO(gst_audio_info_set_format, vFpiiip) +GO(gst_audio_info_set_format, vFpuiip) GO(gst_audio_info_to_caps, pFp) -GO(gst_audio_layout_get_type, pFv) -//GO(gst_audio_make_raw_caps, -//GO(gst_audio_meta_api_get_type, -//GO(gst_audio_meta_get_info, -//GO(gst_audio_noise_shaping_method_get_type, -//GO(gst_audio_pack_flags_get_type, -//GO(gst_audio_quantize_flags_get_type, -//GO(gst_audio_quantize_free, +GO(gst_audio_layout_get_type, LFv) +GO(gst_audio_make_raw_caps, pFpuu) +GO(gst_audio_meta_api_get_type, LFv) +GO(gst_audio_meta_get_info, pFv) +GO(gst_audio_noise_shaping_method_get_type, LFv) +GO(gst_audio_pack_flags_get_type, LFv) +GO(gst_audio_quantize_flags_get_type, LFv) +GO(gst_audio_quantize_free, vFp) GO(gst_audio_quantize_new, pFuuuuuu) GO(gst_audio_quantize_reset, vFp) GO(gst_audio_quantize_samples, vFpppu) GO(gst_audio_reorder_channels, iFpLuipp) -//GO(gst_audio_resampler_filter_interpolation_get_type, -//GO(gst_audio_resampler_filter_mode_get_type, -//GO(gst_audio_resampler_flags_get_type, -//GO(gst_audio_resampler_free, +GO(gst_audio_resampler_filter_interpolation_get_type, LFv) +GO(gst_audio_resampler_filter_mode_get_type, LFv) +GO(gst_audio_resampler_flags_get_type, LFv) +GO(gst_audio_resampler_free, vFp) GO(gst_audio_resampler_get_in_frames, LFpL) GO(gst_audio_resampler_get_max_latency, LFp) -//GO(gst_audio_resampler_get_out_frames, -//GO(gst_audio_resampler_method_get_type, +GO(gst_audio_resampler_get_out_frames, LFpL) +GO(gst_audio_resampler_method_get_type, LFv) GO(gst_audio_resampler_new, pFuuuiiip) GO(gst_audio_resampler_options_set_quality, vFuuiip) GO(gst_audio_resampler_resample, vFppLpL) GO(gst_audio_resampler_reset, vFp) GO(gst_audio_resampler_update, iFpiip) -//GO(gst_audio_ring_buffer_acquire, -//GO(gst_audio_ring_buffer_activate, -//GO(gst_audio_ring_buffer_advance, -//GO(gst_audio_ring_buffer_clear, -//GO(gst_audio_ring_buffer_clear_all, -//GO(gst_audio_ring_buffer_close_device, -//GO(gst_audio_ring_buffer_commit, -//GO(gst_audio_ring_buffer_convert, -//GO(gst_audio_ring_buffer_debug_spec_buff, -//GO(gst_audio_ring_buffer_debug_spec_caps, -//GO(gst_audio_ring_buffer_delay, -//GO(gst_audio_ring_buffer_device_is_open, -//GO(gst_audio_ring_buffer_format_type_get_type, -//GO(gst_audio_ring_buffer_get_type, -//GO(gst_audio_ring_buffer_is_acquired, -//GO(gst_audio_ring_buffer_is_active, -//GO(gst_audio_ring_buffer_is_flushing, -//GO(gst_audio_ring_buffer_may_start, -//GO(gst_audio_ring_buffer_open_device, -//GO(gst_audio_ring_buffer_parse_caps, -//GO(gst_audio_ring_buffer_pause, -//GO(gst_audio_ring_buffer_prepare_read, -//GO(gst_audio_ring_buffer_read, -//GO(gst_audio_ring_buffer_release, -//GO(gst_audio_ring_buffer_samples_done, -//GO(gst_audio_ring_buffer_set_callback, -//GO(gst_audio_ring_buffer_set_callback_full, -//GO(gst_audio_ring_buffer_set_channel_positions, -//GO(gst_audio_ring_buffer_set_flushing, -//GO(gst_audio_ring_buffer_set_sample, -//GO(gst_audio_ring_buffer_set_timestamp, -//GO(gst_audio_ring_buffer_start, -//GO(gst_audio_ring_buffer_state_get_type, -//GO(gst_audio_ring_buffer_stop, -//GO(gst_audio_sink_get_type, -//GO(gst_audio_src_get_type, +//GOM(gst_audio_ring_buffer_acquire, iFEpp) +//GOM(gst_audio_ring_buffer_activate, iFEpi) +//GOM(gst_audio_ring_buffer_advance, vFEpu) +//GOM(gst_audio_ring_buffer_clear, vFEpi) +//GOM(gst_audio_ring_buffer_clear_all, vFEp) +//GOM(gst_audio_ring_buffer_close_device, iFEp) +//GOM(gst_audio_ring_buffer_commit, uFEpppiip) +//GOM(gst_audio_ring_buffer_convert, iFEpulup) +GO(gst_audio_ring_buffer_debug_spec_buff, vFp) +GO(gst_audio_ring_buffer_debug_spec_caps, vFp) +//GOM(gst_audio_ring_buffer_delay, uFEp) +//GOM(gst_audio_ring_buffer_device_is_open, iFEp) +GO(gst_audio_ring_buffer_format_type_get_type, LFv) +GO(gst_audio_ring_buffer_get_type, LFv) +//GOM(gst_audio_ring_buffer_is_acquired, iFEp) +//GOM(gst_audio_ring_buffer_is_active, iFEp) +//GOM(gst_audio_ring_buffer_is_flushing, iFEp) +//GOM(gst_audio_ring_buffer_may_start, vFEpi) +//GOM(gst_audio_ring_buffer_open_device, iFEp) +GO(gst_audio_ring_buffer_parse_caps, iFpp) +//GOM(gst_audio_ring_buffer_pause, iFEp) +//GOM(gst_audio_ring_buffer_prepare_read, iFEpppp) +//GOM(gst_audio_ring_buffer_read, uFEpLpup) +//GOM(gst_audio_ring_buffer_release, iFEp) +//GOM(gst_audio_ring_buffer_samples_done, LFEp) +//GOM(gst_audio_ring_buffer_set_callback, vFEppp) +//GOM(gst_audio_ring_buffer_set_callback_full, vFEpppp) +//GOM(gst_audio_ring_buffer_set_channel_positions, vFEpp) +//GOM(gst_audio_ring_buffer_set_flushing, vFEpi) +//GOM(gst_audio_ring_buffer_set_sample, vFEpL) +//GOM(gst_audio_ring_buffer_set_timestamp, vFEpiL) +//GOM(gst_audio_ring_buffer_start, iFEp) +GO(gst_audio_ring_buffer_state_get_type, LFv) +//GOM(gst_audio_ring_buffer_stop, iFEp) +GO(gst_audio_sink_get_type, LFv) +GO(gst_audio_src_get_type, LFv) GO(gst_audio_stream_align_copy, pFp) -//GO(gst_audio_stream_align_free, -//GO(gst_audio_stream_align_get_alignment_threshold, -//GO(gst_audio_stream_align_get_discont_wait, +GO(gst_audio_stream_align_free, vFp) +GO(gst_audio_stream_align_get_alignment_threshold, LFp) +GO(gst_audio_stream_align_get_discont_wait, LFp) GO(gst_audio_stream_align_get_rate, iFp) GO(gst_audio_stream_align_get_samples_since_discont, LFp) GO(gst_audio_stream_align_get_timestamp_at_discont, LFp) -//GO(gst_audio_stream_align_get_type, +GO(gst_audio_stream_align_get_type, LFv) GO(gst_audio_stream_align_mark_discont, vFp) GO(gst_audio_stream_align_new, pFiLL) GO(gst_audio_stream_align_process, iFpiLuppp) -//GO(gst_audio_stream_align_set_alignment_threshold, +GO(gst_audio_stream_align_set_alignment_threshold, vFpL) GO(gst_audio_stream_align_set_discont_wait, vFpL) GO(gst_audio_stream_align_set_rate, vFpi) GO(gst_buffer_add_audio_clipping_meta, pFpuLL) diff --git a/src/wrapped/wrappedgstbase.c b/src/wrapped/wrappedgstbase.c index b3d85b3..4d00d2f 100644 --- a/src/wrapped/wrappedgstbase.c +++ b/src/wrapped/wrappedgstbase.c @@ -20,11 +20,8 @@ #include "gtkclass.h" #include "fileutils.h" -#ifdef ANDROID - const char* gstbaseName = "libgstbase-1.0.so"; -#else - const char* gstbaseName = "libgstbase-1.0.so.0"; -#endif +const char* gstbaseName = "libgstbase-1.0.so.0"; +#define ALTNAME "libgstbase-1.0.so" #define LIBNAME gstbase @@ -192,6 +189,102 @@ static void* findGstCollectPadsBufferFunctionFct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for gstbase GstCollectPadsBufferFunction callback\n"); return NULL; } +// GstTypeFindHelperGetRangeFunction ... +#define GO(A) \ +static uintptr_t my_GstTypeFindHelperGetRangeFunction_fct_##A = 0; \ +static int my_GstTypeFindHelperGetRangeFunction_##A(void* a, void* b, uint64_t c, uint32_t d, void* e) \ +{ \ + return RunFunctionFmt(my_GstTypeFindHelperGetRangeFunction_fct_##A, "ppUup", a, b, c, d, e); \ +} +SUPER() +#undef GO +static void* findGstTypeFindHelperGetRangeFunctionFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_GstTypeFindHelperGetRangeFunction_fct_##A == (uintptr_t)fct) return my_GstTypeFindHelperGetRangeFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstTypeFindHelperGetRangeFunction_fct_##A == 0) {my_GstTypeFindHelperGetRangeFunction_fct_##A = (uintptr_t)fct; return my_GstTypeFindHelperGetRangeFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstbase GstTypeFindHelperGetRangeFunction callback\n"); + return NULL; +} +// GstDataQueueCheckFullFunction ... +#define GO(A) \ +static uintptr_t my_GstDataQueueCheckFullFunction_fct_##A = 0; \ +static int my_GstDataQueueCheckFullFunction_##A(void* a, uint32_t b, uint32_t c, uint64_t d, void* e) \ +{ \ + return RunFunctionFmt(my_GstDataQueueCheckFullFunction_fct_##A, "puuUp", a, b, c, d, e); \ +} +SUPER() +#undef GO +static void* findGstDataQueueCheckFullFunctionFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_GstDataQueueCheckFullFunction_fct_##A == (uintptr_t)fct) return my_GstDataQueueCheckFullFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstDataQueueCheckFullFunction_fct_##A == 0) {my_GstDataQueueCheckFullFunction_fct_##A = (uintptr_t)fct; return my_GstDataQueueCheckFullFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstbase GstDataQueueCheckFullFunction callback\n"); + return NULL; +} +// GstDataQueueFullCallback ... +#define GO(A) \ +static uintptr_t my_GstDataQueueFullCallback_fct_##A = 0; \ +static void my_GstDataQueueFullCallback_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_GstDataQueueFullCallback_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* findGstDataQueueFullCallbackFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_GstDataQueueFullCallback_fct_##A == (uintptr_t)fct) return my_GstDataQueueFullCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstDataQueueFullCallback_fct_##A == 0) {my_GstDataQueueFullCallback_fct_##A = (uintptr_t)fct; return my_GstDataQueueFullCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstbase GstDataQueueFullCallback callback\n"); + return NULL; +} +// GstDataQueueEmptyCallback ... +#define GO(A) \ +static uintptr_t my_GstDataQueueEmptyCallback_fct_##A = 0; \ +static void my_GstDataQueueEmptyCallback_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_GstDataQueueEmptyCallback_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* findGstDataQueueEmptyCallbackFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_GstDataQueueEmptyCallback_fct_##A == (uintptr_t)fct) return my_GstDataQueueEmptyCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstDataQueueEmptyCallback_fct_##A == 0) {my_GstDataQueueEmptyCallback_fct_##A = (uintptr_t)fct; return my_GstDataQueueEmptyCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstbase GstDataQueueEmptyCallback callback\n"); + return NULL; +} #undef SUPER @@ -225,9 +318,18 @@ EXPORT void my_gst_collect_pads_set_buffer_function(x64emu_t* emu, void* pads, v my->gst_collect_pads_set_buffer_function(pads, findGstCollectPadsBufferFunctionFct(f), data); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +EXPORT int my_gst_type_find_helper_get_range_full(x64emu_t* emu, void* obj, void* parent, void* f, uint64_t sz, void* ext, void* caps, void* prob) +{ + return my->gst_type_find_helper_get_range_full(obj, parent, findGstTypeFindHelperGetRangeFunctionFct(f), sz, ext, caps, prob); +} + +EXPORT void* my_gst_data_queue_new(x64emu_t* emu, void* checkfull, void* full, void* empty, void* data) +{ + return my->gst_data_queue_new(findGstDataQueueCheckFullFunctionFct(checkfull), findGstDataQueueFullCallbackFct(full), findGstDataQueueEmptyCallbackFct(empty), data); +} + +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define CUSTOM_INIT \ SetGstBaseTransformID(my->gst_base_transform_get_type());\ @@ -237,10 +339,6 @@ EXPORT void my_gst_collect_pads_set_buffer_function(x64emu_t* emu, void* pads, v SetGstBaseSrcID(my->gst_base_src_get_type());\ SetGstAggregatorPadID(my->gst_aggregator_pad_get_type()); -#ifdef ANDROID -#define NEEDED_LIBS "libgstreamer-1.0.so" -#else #define NEEDED_LIBS "libgstreamer-1.0.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstbase_private.h b/src/wrapped/wrappedgstbase_private.h index 68b5242..5c21252 100644 --- a/src/wrapped/wrappedgstbase_private.h +++ b/src/wrapped/wrappedgstbase_private.h @@ -1,5 +1,5 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(gst_adapter_available, LFp) @@ -10,7 +10,7 @@ GO(gst_adapter_copy_bytes, pFpLL) GO(gst_adapter_distance_from_discont, LFp) GO(gst_adapter_dts_at_discont, LFp) GO(gst_adapter_flush, vFpL) -//GO(gst_adapter_get_buffer, +GO(gst_adapter_get_buffer, pFpL) GO(gst_adapter_get_buffer_fast, pFpL) GO(gst_adapter_get_buffer_list, pFpL) GO(gst_adapter_get_list, pFpL) @@ -19,245 +19,245 @@ GO(gst_adapter_map, pFpL) GO(gst_adapter_masked_scan_uint32, lFpuuLL) GO(gst_adapter_masked_scan_uint32_peek, lFpuuLLp) GO(gst_adapter_new, pFv) -//GO(gst_adapter_offset_at_discont, +GO(gst_adapter_offset_at_discont, LFp) GO(gst_adapter_prev_dts, LFpp) GO(gst_adapter_prev_dts_at_offset, LFpLp) GO(gst_adapter_prev_offset, LFpp) -//GO(gst_adapter_prev_pts, -//GO(gst_adapter_prev_pts_at_offset, -//GO(gst_adapter_pts_at_discont, +GO(gst_adapter_prev_pts, LFpp) +GO(gst_adapter_prev_pts_at_offset, LFpLp) +GO(gst_adapter_pts_at_discont, LFp) GO(gst_adapter_push, vFpp) GO(gst_adapter_take, pFpL) GO(gst_adapter_take_buffer, pFpL) -//GO(gst_adapter_take_buffer_fast, -//GO(gst_adapter_take_buffer_list, -//GO(gst_adapter_take_list, +GO(gst_adapter_take_buffer_fast, pFpL) +GO(gst_adapter_take_buffer_list, pFpL) +GO(gst_adapter_take_list, pFpL) GO(gst_adapter_unmap, vFp) GO(gst_aggregator_finish_buffer, iFpp) -//GO(gst_aggregator_finish_buffer_list, -//GO(gst_aggregator_get_allocator, -//GO(gst_aggregator_get_buffer_pool, -//GO(gst_aggregator_get_latency, +GO(gst_aggregator_finish_buffer_list, iFpp) +GO(gst_aggregator_get_allocator, vFppp) +GO(gst_aggregator_get_buffer_pool, pFp) +GO(gst_aggregator_get_latency, LFp) GO(gst_aggregator_get_type, LFv) -//GO(gst_aggregator_negotiate, -//GO(gst_aggregator_pad_drop_buffer, +GO(gst_aggregator_negotiate, iFp) +GO(gst_aggregator_pad_drop_buffer, iFp) GO(gst_aggregator_pad_get_type, LFv) -//GO(gst_aggregator_pad_has_buffer, -//GO(gst_aggregator_pad_is_eos, -//GO(gst_aggregator_pad_peek_buffer, -//GO(gst_aggregator_pad_pop_buffer, -//GO(gst_aggregator_peek_next_sample, -//GO(gst_aggregator_selected_samples, -//GO(gst_aggregator_set_latency, -//GO(gst_aggregator_set_src_caps, -//GO(gst_aggregator_simple_get_next_time, -//GO(gst_aggregator_start_time_selection_get_type, -//GO(gst_aggregator_update_segment, -//GO(gst_base_parse_add_index_entry, -//GO(gst_base_parse_convert_default, -//GO(gst_base_parse_drain, -//GO(gst_base_parse_finish_frame, -//GO(gst_base_parse_frame_copy, -//GO(gst_base_parse_frame_free, -//GO(gst_base_parse_frame_get_type, -//GO(gst_base_parse_frame_init, -//GO(gst_base_parse_frame_new, -//GO(gst_base_parse_get_type, -//GO(gst_base_parse_merge_tags, -//GO(gst_base_parse_push_frame, -//GO(gst_base_parse_set_average_bitrate, -//GO(gst_base_parse_set_duration, -//GO(gst_base_parse_set_frame_rate, -//GO(gst_base_parse_set_has_timing_info, -//GO(gst_base_parse_set_infer_ts, -//GO(gst_base_parse_set_latency, -//GO(gst_base_parse_set_min_frame_size, -//GO(gst_base_parse_set_passthrough, -//GO(gst_base_parse_set_pts_interpolation, -//GO(gst_base_parse_set_syncable, -//GO(gst_base_parse_set_ts_at_offset, -//GO(gst_base_sink_do_preroll, -//GO(gst_base_sink_get_blocksize, -//GO(gst_base_sink_get_drop_out_of_segment, -//GO(gst_base_sink_get_last_sample, -//GO(gst_base_sink_get_latency, -//GO(gst_base_sink_get_max_bitrate, -//GO(gst_base_sink_get_max_lateness, -//GO(gst_base_sink_get_processing_deadline, -//GO(gst_base_sink_get_render_delay, -//GO(gst_base_sink_get_stats, -//GO(gst_base_sink_get_sync, -//GO(gst_base_sink_get_throttle_time, -//GO(gst_base_sink_get_ts_offset, +GO(gst_aggregator_pad_has_buffer, iFp) +GO(gst_aggregator_pad_is_eos, iFp) +GO(gst_aggregator_pad_peek_buffer, pFp) +GO(gst_aggregator_pad_pop_buffer, pFp) +GO(gst_aggregator_peek_next_sample, pFpp) +GO(gst_aggregator_selected_samples, vFpLLLp) +GO(gst_aggregator_set_latency, vFpLL) +GO(gst_aggregator_set_src_caps, vFpp) +GO(gst_aggregator_simple_get_next_time, LFp) +GO(gst_aggregator_start_time_selection_get_type, LFv) +GO(gst_aggregator_update_segment, vFpp) +GO(gst_base_parse_add_index_entry, iFpLLii) +GO(gst_base_parse_convert_default, iFpulup) +GO(gst_base_parse_drain, vFp) +GO(gst_base_parse_finish_frame, iFppi) +GO(gst_base_parse_frame_copy, pFp) +GO(gst_base_parse_frame_free, vFp) +GO(gst_base_parse_frame_get_type, LFv) +GO(gst_base_parse_frame_init, vFp) +GO(gst_base_parse_frame_new, pFpui) +GO(gst_base_parse_get_type, LFv) +GO(gst_base_parse_merge_tags, vFppu) +GO(gst_base_parse_push_frame, iFpp) +GO(gst_base_parse_set_average_bitrate, vFpu) +GO(gst_base_parse_set_duration, vFpuli) +GO(gst_base_parse_set_frame_rate, vFpuuuu) +GO(gst_base_parse_set_has_timing_info, vFpi) +GO(gst_base_parse_set_infer_ts, vFpi) +GO(gst_base_parse_set_latency, vFpLL) +GO(gst_base_parse_set_min_frame_size, vFpu) +GO(gst_base_parse_set_passthrough, vFpi) +GO(gst_base_parse_set_pts_interpolation, vFpi) +GO(gst_base_parse_set_syncable, vFpi) +GO(gst_base_parse_set_ts_at_offset, vFpL) +GO(gst_base_sink_do_preroll, iFpp) +GO(gst_base_sink_get_blocksize, uFp) +GO(gst_base_sink_get_drop_out_of_segment, iFp) +GO(gst_base_sink_get_last_sample, pFp) +GO(gst_base_sink_get_latency, LFp) +GO(gst_base_sink_get_max_bitrate, LFp) +GO(gst_base_sink_get_max_lateness, lFp) +GO(gst_base_sink_get_processing_deadline, LFp) +GO(gst_base_sink_get_render_delay, LFp) +GO(gst_base_sink_get_stats, pFp) +GO(gst_base_sink_get_sync, iFp) +GO(gst_base_sink_get_throttle_time, LFp) +GO(gst_base_sink_get_ts_offset, lFp) GO(gst_base_sink_get_type, LFv) -//GO(gst_base_sink_is_async_enabled, -//GO(gst_base_sink_is_last_sample_enabled, -//GO(gst_base_sink_is_qos_enabled, -//GO(gst_base_sink_query_latency, -//GO(gst_base_sink_set_async_enabled, -//GO(gst_base_sink_set_blocksize, -//GO(gst_base_sink_set_drop_out_of_segment, -//GO(gst_base_sink_set_last_sample_enabled, -//GO(gst_base_sink_set_max_bitrate, -//GO(gst_base_sink_set_max_lateness, -//GO(gst_base_sink_set_processing_deadline, -//GO(gst_base_sink_set_qos_enabled, -//GO(gst_base_sink_set_render_delay, -//GO(gst_base_sink_set_sync, -//GO(gst_base_sink_set_throttle_time, -//GO(gst_base_sink_set_ts_offset, -//GO(gst_base_sink_wait, -//GO(gst_base_sink_wait_clock, -//GO(gst_base_sink_wait_preroll, -//GO(gst_base_src_get_allocator, +GO(gst_base_sink_is_async_enabled, iFp) +GO(gst_base_sink_is_last_sample_enabled, iFp) +GO(gst_base_sink_is_qos_enabled, iFp) +GO(gst_base_sink_query_latency, iFppppp) +GO(gst_base_sink_set_async_enabled, vFpi) +GO(gst_base_sink_set_blocksize, vFpu) +GO(gst_base_sink_set_drop_out_of_segment, vFpi) +GO(gst_base_sink_set_last_sample_enabled, vFpi) +GO(gst_base_sink_set_max_bitrate, vFpL) +GO(gst_base_sink_set_max_lateness, vFpl) +GO(gst_base_sink_set_processing_deadline, vFpL) +GO(gst_base_sink_set_qos_enabled, vFpi) +GO(gst_base_sink_set_render_delay, vFpL) +GO(gst_base_sink_set_sync, vFpi) +GO(gst_base_sink_set_throttle_time, vFpL) +GO(gst_base_sink_set_ts_offset, vFpl) +GO(gst_base_sink_wait, iFpLp) +GO(gst_base_sink_wait_clock, uFpLp) +GO(gst_base_sink_wait_preroll, iFp) +GO(gst_base_src_get_allocator, vFppp) GO(gst_base_src_get_blocksize, uFp) -//GO(gst_base_src_get_buffer_pool, -//GO(gst_base_src_get_do_timestamp, +GO(gst_base_src_get_buffer_pool, pFp) +GO(gst_base_src_get_do_timestamp, iFp) GO(gst_base_src_get_type, LFv) -//GO(gst_base_src_is_async, +GO(gst_base_src_is_async, iFp) GO(gst_base_src_is_live, iFp) -//GO(gst_base_src_negotiate, -//GO(gst_base_src_new_seamless_segment, -//GO(gst_base_src_new_segment, -//GO(gst_base_src_query_latency, -//GO(gst_base_src_set_async, +GO(gst_base_src_negotiate, iFp) +GO(gst_base_src_new_seamless_segment, iFplll) +GO(gst_base_src_new_segment, iFpp) +GO(gst_base_src_query_latency, iFpppp) +GO(gst_base_src_set_async, vFpi) GO(gst_base_src_set_automatic_eos, vFpi) GO(gst_base_src_set_blocksize, vFpu) GO(gst_base_src_set_caps, iFpp) -//GO(gst_base_src_set_do_timestamp, -//GO(gst_base_src_set_dynamic_size, -//GO(gst_base_src_set_format, +GO(gst_base_src_set_do_timestamp, vFpi) +GO(gst_base_src_set_dynamic_size, vFpi) +GO(gst_base_src_set_format, vFpu) GO(gst_base_src_set_live, vFpi) -//GO(gst_base_src_start_complete, -//GO(gst_base_src_start_wait, -//GO(gst_base_src_submit_buffer_list, -//GO(gst_base_src_wait_playing, -//GO(gst_base_transform_get_allocator, -//GO(gst_base_transform_get_buffer_pool, +GO(gst_base_src_start_complete, vFpi) +GO(gst_base_src_start_wait, iFp) +GO(gst_base_src_submit_buffer_list, vFpp) +GO(gst_base_src_wait_playing, iFp) +GO(gst_base_transform_get_allocator, vFppp) +GO(gst_base_transform_get_buffer_pool, pFp) GO(gst_base_transform_get_type, LFv) -//GO(gst_base_transform_is_in_place, +GO(gst_base_transform_is_in_place, iFp) GO(gst_base_transform_is_passthrough, iFp) -//GO(gst_base_transform_is_qos_enabled, -//GO(gst_base_transform_reconfigure, -//GO(gst_base_transform_reconfigure_sink, +GO(gst_base_transform_is_qos_enabled, iFp) +GO(gst_base_transform_reconfigure, iFp) +GO(gst_base_transform_reconfigure_sink, vFp) GO(gst_base_transform_reconfigure_src, vFp) GO(gst_base_transform_set_gap_aware, vFpi) GO(gst_base_transform_set_in_place, vFpi) GO(gst_base_transform_set_passthrough, vFpi) GO(gst_base_transform_set_prefer_passthrough, vFpi) -//GO(gst_base_transform_set_qos_enabled, -//GO(gst_base_transform_update_qos, +GO(gst_base_transform_set_qos_enabled, vFpi) +GO(gst_base_transform_update_qos, vFpdlL) GO(gst_base_transform_update_src_caps, iFpp) -//GO(gst_bit_reader_free, -//GO(gst_bit_reader_get_bits_uint16, -//GO(gst_bit_reader_get_bits_uint32, -//GO(gst_bit_reader_get_bits_uint64, -//GO(gst_bit_reader_get_bits_uint8, -//GO(gst_bit_reader_get_pos, -//GO(gst_bit_reader_get_remaining, -//GO(gst_bit_reader_get_size, +GO(gst_bit_reader_free, vFp) +GO(gst_bit_reader_get_bits_uint16, iFppu) +GO(gst_bit_reader_get_bits_uint32, iFppu) +GO(gst_bit_reader_get_bits_uint64, iFppu) +GO(gst_bit_reader_get_bits_uint8, iFppu) +GO(gst_bit_reader_get_pos, uFp) +GO(gst_bit_reader_get_remaining, uFp) +GO(gst_bit_reader_get_size, uFp) GO(gst_bit_reader_init, vFppu) GO(gst_bit_reader_new, pFpu) -//GO(gst_bit_reader_peek_bits_uint16, -//GO(gst_bit_reader_peek_bits_uint32, -//GO(gst_bit_reader_peek_bits_uint64, -//GO(gst_bit_reader_peek_bits_uint8, -//GO(gst_bit_reader_set_pos, -//GO(gst_bit_reader_skip, -//GO(gst_bit_reader_skip_to_byte, -//GO(gst_bit_writer_align_bytes, -//GO(gst_bit_writer_free, -//GO(gst_bit_writer_free_and_get_buffer, -//GO(gst_bit_writer_free_and_get_data, -//GO(gst_bit_writer_get_data, -//GO(gst_bit_writer_get_size, -//GO(gst_bit_writer_init, +GO(gst_bit_reader_peek_bits_uint16, iFppu) +GO(gst_bit_reader_peek_bits_uint32, iFppu) +GO(gst_bit_reader_peek_bits_uint64, iFppu) +GO(gst_bit_reader_peek_bits_uint8, iFppu) +GO(gst_bit_reader_set_pos, iFpu) +GO(gst_bit_reader_skip, iFpu) +GO(gst_bit_reader_skip_to_byte, iFp) +GO(gst_bit_writer_align_bytes, iFpC) +GO(gst_bit_writer_free, vFp) +GO(gst_bit_writer_free_and_get_buffer, pFp) +GO(gst_bit_writer_free_and_get_data, pFp) +GO(gst_bit_writer_get_data, pFp) +GO(gst_bit_writer_get_size, uFp) +GO(gst_bit_writer_init, vFp) GO(gst_bit_writer_init_with_data, vFppui) GO(gst_bit_writer_init_with_size, vFpui) GO(gst_bit_writer_new, pFv) GO(gst_bit_writer_new_with_data, pFpui) GO(gst_bit_writer_new_with_size, pFui) -//GO(gst_bit_writer_put_bits_uint16, -//GO(gst_bit_writer_put_bits_uint32, -//GO(gst_bit_writer_put_bits_uint64, -//GO(gst_bit_writer_put_bits_uint8, -//GO(gst_bit_writer_put_bytes, +GO(gst_bit_writer_put_bits_uint16, iFpWu) +GO(gst_bit_writer_put_bits_uint32, iFpuu) +GO(gst_bit_writer_put_bits_uint64, iFpLu) +GO(gst_bit_writer_put_bits_uint8, iFpCu) +GO(gst_bit_writer_put_bytes, iFppu) GO(gst_bit_writer_reset, vFp) GO(gst_bit_writer_reset_and_get_buffer, pFp) GO(gst_bit_writer_reset_and_get_data, pFp) -//GO(gst_bit_writer_set_pos, -//GO(gst_byte_reader_dup_data, +GO(gst_bit_writer_set_pos, iFpu) +GO(gst_byte_reader_dup_data, iFpup) GO(gst_byte_reader_dup_string_utf16, iFpp) GO(gst_byte_reader_dup_string_utf32, iFpp) GO(gst_byte_reader_dup_string_utf8, iFpp) GO(gst_byte_reader_free, vFp) -//GO(gst_byte_reader_get_data, -//GO(gst_byte_reader_get_float32_be, -//GO(gst_byte_reader_get_float32_le, -//GO(gst_byte_reader_get_float64_be, -//GO(gst_byte_reader_get_float64_le, -//GO(gst_byte_reader_get_int16_be, -//GO(gst_byte_reader_get_int16_le, -//GO(gst_byte_reader_get_int24_be, -//GO(gst_byte_reader_get_int24_le, -//GO(gst_byte_reader_get_int32_be, -//GO(gst_byte_reader_get_int32_le, -//GO(gst_byte_reader_get_int64_be, -//GO(gst_byte_reader_get_int64_le, -//GO(gst_byte_reader_get_int8, -//GO(gst_byte_reader_get_pos, -//GO(gst_byte_reader_get_remaining, -//GO(gst_byte_reader_get_size, +GO(gst_byte_reader_get_data, iFpup) +GO(gst_byte_reader_get_float32_be, iFpp) +GO(gst_byte_reader_get_float32_le, iFpp) +GO(gst_byte_reader_get_float64_be, iFpp) +GO(gst_byte_reader_get_float64_le, iFpp) +GO(gst_byte_reader_get_int16_be, iFpp) +GO(gst_byte_reader_get_int16_le, iFpp) +GO(gst_byte_reader_get_int24_be, iFpp) +GO(gst_byte_reader_get_int24_le, iFpp) +GO(gst_byte_reader_get_int32_be, iFpp) +GO(gst_byte_reader_get_int32_le, iFpp) +GO(gst_byte_reader_get_int64_be, iFpp) +GO(gst_byte_reader_get_int64_le, iFpp) +GO(gst_byte_reader_get_int8, iFpp) +GO(gst_byte_reader_get_pos, uFp) +GO(gst_byte_reader_get_remaining, uFp) +GO(gst_byte_reader_get_size, uFp) GO(gst_byte_reader_get_string_utf8, iFpp) -//GO(gst_byte_reader_get_sub_reader, -//GO(gst_byte_reader_get_uint16_be, -//GO(gst_byte_reader_get_uint16_le, -//GO(gst_byte_reader_get_uint24_be, -//GO(gst_byte_reader_get_uint24_le, -//GO(gst_byte_reader_get_uint32_be, -//GO(gst_byte_reader_get_uint32_le, -//GO(gst_byte_reader_get_uint64_be, -//GO(gst_byte_reader_get_uint64_le, -//GO(gst_byte_reader_get_uint8, -//GO(gst_byte_reader_init, +GO(gst_byte_reader_get_sub_reader, iFppu) +GO(gst_byte_reader_get_uint16_be, iFpp) +GO(gst_byte_reader_get_uint16_le, iFpp) +GO(gst_byte_reader_get_uint24_be, iFpp) +GO(gst_byte_reader_get_uint24_le, iFpp) +GO(gst_byte_reader_get_uint32_be, iFpp) +GO(gst_byte_reader_get_uint32_le, iFpp) +GO(gst_byte_reader_get_uint64_be, iFpp) +GO(gst_byte_reader_get_uint64_le, iFpp) +GO(gst_byte_reader_get_uint8, iFpp) +GO(gst_byte_reader_init, vFppu) GO(gst_byte_reader_masked_scan_uint32, uFpuuuu) GO(gst_byte_reader_masked_scan_uint32_peek, uFpuuuup) GO(gst_byte_reader_new, pFpu) -//GO(gst_byte_reader_peek_data, -//GO(gst_byte_reader_peek_float32_be, -//GO(gst_byte_reader_peek_float32_le, -//GO(gst_byte_reader_peek_float64_be, -//GO(gst_byte_reader_peek_float64_le, -//GO(gst_byte_reader_peek_int16_be, -//GO(gst_byte_reader_peek_int16_le, -//GO(gst_byte_reader_peek_int24_be, -//GO(gst_byte_reader_peek_int24_le, -//GO(gst_byte_reader_peek_int32_be, -//GO(gst_byte_reader_peek_int32_le, -//GO(gst_byte_reader_peek_int64_be, -//GO(gst_byte_reader_peek_int64_le, -//GO(gst_byte_reader_peek_int8, +GO(gst_byte_reader_peek_data, iFpup) +GO(gst_byte_reader_peek_float32_be, iFpp) +GO(gst_byte_reader_peek_float32_le, iFpp) +GO(gst_byte_reader_peek_float64_be, iFpp) +GO(gst_byte_reader_peek_float64_le, iFpp) +GO(gst_byte_reader_peek_int16_be, iFpp) +GO(gst_byte_reader_peek_int16_le, iFpp) +GO(gst_byte_reader_peek_int24_be, iFpp) +GO(gst_byte_reader_peek_int24_le, iFpp) +GO(gst_byte_reader_peek_int32_be, iFpp) +GO(gst_byte_reader_peek_int32_le, iFpp) +GO(gst_byte_reader_peek_int64_be, iFpp) +GO(gst_byte_reader_peek_int64_le, iFpp) +GO(gst_byte_reader_peek_int8, iFpp) GO(gst_byte_reader_peek_string_utf8, iFpp) -//GO(gst_byte_reader_peek_sub_reader, -//GO(gst_byte_reader_peek_uint16_be, -//GO(gst_byte_reader_peek_uint16_le, -//GO(gst_byte_reader_peek_uint24_be, -//GO(gst_byte_reader_peek_uint24_le, -//GO(gst_byte_reader_peek_uint32_be, -//GO(gst_byte_reader_peek_uint32_le, -//GO(gst_byte_reader_peek_uint64_be, -//GO(gst_byte_reader_peek_uint64_le, -//GO(gst_byte_reader_peek_uint8, +GO(gst_byte_reader_peek_sub_reader, iFppu) +GO(gst_byte_reader_peek_uint16_be, iFpp) +GO(gst_byte_reader_peek_uint16_le, iFpp) +GO(gst_byte_reader_peek_uint24_be, iFpp) +GO(gst_byte_reader_peek_uint24_le, iFpp) +GO(gst_byte_reader_peek_uint32_be, iFpp) +GO(gst_byte_reader_peek_uint32_le, iFpp) +GO(gst_byte_reader_peek_uint64_be, iFpp) +GO(gst_byte_reader_peek_uint64_le, iFpp) +GO(gst_byte_reader_peek_uint8, iFpp) GO(gst_byte_reader_set_pos, iFpu) -//GO(gst_byte_reader_skip, -//GO(gst_byte_reader_skip_string_utf16, +GO(gst_byte_reader_skip, iFpu) +GO(gst_byte_reader_skip_string_utf16, iFp) GO(gst_byte_reader_skip_string_utf32, iFp) -//GO(gst_byte_reader_skip_string_utf8, -//GO(gst_byte_writer_ensure_free_space, -//GO(gst_byte_writer_fill, +GO(gst_byte_reader_skip_string_utf8, iFp) +GO(gst_byte_writer_ensure_free_space, iFpu) +GO(gst_byte_writer_fill, iFpCu) GO(gst_byte_writer_free, vFp) GO(gst_byte_writer_free_and_get_buffer, pFp) -//GO(gst_byte_writer_free_and_get_data, +GO(gst_byte_writer_free_and_get_data, pFp) GO(gst_byte_writer_get_remaining, uFp) GO(gst_byte_writer_init, vFp) GO(gst_byte_writer_init_with_data, vFppui) @@ -265,32 +265,32 @@ GO(gst_byte_writer_init_with_size, vFpui) GO(gst_byte_writer_new, pFv) GO(gst_byte_writer_new_with_data, pFpui) GO(gst_byte_writer_new_with_size, pFui) -//GO(gst_byte_writer_put_data, -//GO(gst_byte_writer_put_float32_be, -//GO(gst_byte_writer_put_float32_le, -//GO(gst_byte_writer_put_float64_be, -//GO(gst_byte_writer_put_float64_le, -//GO(gst_byte_writer_put_int16_be, -//GO(gst_byte_writer_put_int16_le, -//GO(gst_byte_writer_put_int24_be, -//GO(gst_byte_writer_put_int24_le, -//GO(gst_byte_writer_put_int32_be, -//GO(gst_byte_writer_put_int32_le, -//GO(gst_byte_writer_put_int64_be, -//GO(gst_byte_writer_put_int64_le, -//GO(gst_byte_writer_put_int8, +GO(gst_byte_writer_put_data, iFppu) +GO(gst_byte_writer_put_float32_be, iFpf) +GO(gst_byte_writer_put_float32_le, iFpf) +GO(gst_byte_writer_put_float64_be, iFpd) +GO(gst_byte_writer_put_float64_le, iFpd) +GO(gst_byte_writer_put_int16_be, iFpw) +GO(gst_byte_writer_put_int16_le, iFpw) +GO(gst_byte_writer_put_int24_be, iFpi) +GO(gst_byte_writer_put_int24_le, iFpi) +GO(gst_byte_writer_put_int32_be, iFpi) +GO(gst_byte_writer_put_int32_le, iFpi) +GO(gst_byte_writer_put_int64_be, iFpl) +GO(gst_byte_writer_put_int64_le, iFpl) +GO(gst_byte_writer_put_int8, iFpc) GO(gst_byte_writer_put_string_utf16, iFpp) GO(gst_byte_writer_put_string_utf32, iFpp) GO(gst_byte_writer_put_string_utf8, iFpp) -//GO(gst_byte_writer_put_uint16_be, -//GO(gst_byte_writer_put_uint16_le, -//GO(gst_byte_writer_put_uint24_be, -//GO(gst_byte_writer_put_uint24_le, -//GO(gst_byte_writer_put_uint32_be, -//GO(gst_byte_writer_put_uint32_le, -//GO(gst_byte_writer_put_uint64_be, -//GO(gst_byte_writer_put_uint64_le, -//GO(gst_byte_writer_put_uint8, +GO(gst_byte_writer_put_uint16_be, iFpW) +GO(gst_byte_writer_put_uint16_le, iFpW) +GO(gst_byte_writer_put_uint24_be, iFpu) +GO(gst_byte_writer_put_uint24_le, iFpu) +GO(gst_byte_writer_put_uint32_be, iFpu) +GO(gst_byte_writer_put_uint32_le, iFpu) +GO(gst_byte_writer_put_uint64_be, iFpL) +GO(gst_byte_writer_put_uint64_le, iFpL) +GO(gst_byte_writer_put_uint8, iFpC) GO(gst_byte_writer_reset, vFp) GO(gst_byte_writer_reset_and_get_buffer, pFp) GO(gst_byte_writer_reset_and_get_data, pFp) @@ -298,39 +298,39 @@ GOM(gst_collect_pads_add_pad, pFEppupi) GO(gst_collect_pads_available, uFp) GO(gst_collect_pads_clip_running_time, iFppppp) GO(gst_collect_pads_event_default, iFpppi) -//GO(gst_collect_pads_flush, -//GO(gst_collect_pads_get_type, +GO(gst_collect_pads_flush, uFppu) +GO(gst_collect_pads_get_type, LFv) GO(gst_collect_pads_new, pFv) GO(gst_collect_pads_peek, pFpp) GO(gst_collect_pads_pop, pFpp) GO(gst_collect_pads_query_default, iFpppi) -//GO(gst_collect_pads_read_buffer, +GO(gst_collect_pads_read_buffer, pFppu) GO(gst_collect_pads_remove_pad, iFpp) GOM(gst_collect_pads_set_buffer_function, vFEppp) GOM(gst_collect_pads_set_clip_function, vFEppp) -//GO(gst_collect_pads_set_compare_function, +//GOM(gst_collect_pads_set_compare_function, vFEppp) GOM(gst_collect_pads_set_event_function, vFEppp) -//GO(gst_collect_pads_set_flush_function, +//GOM(gst_collect_pads_set_flush_function, vFEppp) GO(gst_collect_pads_set_flushing, vFpi) GOM(gst_collect_pads_set_function, vFEppp) GOM(gst_collect_pads_set_query_function, vFEppp) GO(gst_collect_pads_set_waiting, vFppi) -//GO(gst_collect_pads_src_event_default, +GO(gst_collect_pads_src_event_default, iFppp) GO(gst_collect_pads_start, vFp) GO(gst_collect_pads_stop, vFp) GO(gst_collect_pads_take_buffer, pFppu) GO(gst_data_queue_drop_head, iFpL) -//GO(gst_data_queue_flush, +GO(gst_data_queue_flush, vFp) GO(gst_data_queue_get_level, vFpp) -//GO(gst_data_queue_get_type, +GO(gst_data_queue_get_type, LFv) GO(gst_data_queue_is_empty, iFp) -//GO(gst_data_queue_is_full, -//GO(gst_data_queue_limits_changed, -//GO(gst_data_queue_new, +GO(gst_data_queue_is_full, iFp) +GO(gst_data_queue_limits_changed, vFp) +GOM(gst_data_queue_new, pFEpppp) GO(gst_data_queue_peek, iFpp) -//GO(gst_data_queue_pop, -//GO(gst_data_queue_push, -//GO(gst_data_queue_push_force, +GO(gst_data_queue_pop, iFpp) +GO(gst_data_queue_push, iFpp) +GO(gst_data_queue_push_force, iFpp) GO(gst_data_queue_set_flushing, vFpi) GO(gst_flow_combiner_add_pad, vFpp) GO(gst_flow_combiner_clear, vFp) @@ -340,37 +340,37 @@ GO(gst_flow_combiner_new, pFv) GO(gst_flow_combiner_ref, pFp) GO(gst_flow_combiner_remove_pad, vFpp) GO(gst_flow_combiner_reset, vFp) -//GO(gst_flow_combiner_unref, +GO(gst_flow_combiner_unref, vFp) GO(gst_flow_combiner_update_flow, iFpi) GO(gst_flow_combiner_update_pad_flow, iFppi) GO(gst_push_src_get_type, LFv) GO(gst_queue_array_clear, vFp) -//GO(gst_queue_array_drop_element, +GO(gst_queue_array_drop_element, pFpu) GO(gst_queue_array_drop_struct, iFpup) -//GO(gst_queue_array_find, -//GO(gst_queue_array_free, +//GOM(gst_queue_array_find, uFEppp) +GO(gst_queue_array_free, vFp) GO(gst_queue_array_get_length, uFp) GO(gst_queue_array_is_empty, iFp) GO(gst_queue_array_new, pFu) GO(gst_queue_array_new_for_struct, pFLu) -//GO(gst_queue_array_peek_head, -//GO(gst_queue_array_peek_head_struct, -//GO(gst_queue_array_peek_nth, +GO(gst_queue_array_peek_head, pFp) +GO(gst_queue_array_peek_head_struct, pFp) +GO(gst_queue_array_peek_nth, pFpu) GO(gst_queue_array_peek_nth_struct, pFpu) -//GO(gst_queue_array_peek_tail, +GO(gst_queue_array_peek_tail, pFp) GO(gst_queue_array_peek_tail_struct, pFp) -//GO(gst_queue_array_pop_head, -//GO(gst_queue_array_pop_head_struct, -//GO(gst_queue_array_pop_tail, -//GO(gst_queue_array_pop_tail_struct, -//GO(gst_queue_array_push_tail, +GO(gst_queue_array_pop_head, pFp) +GO(gst_queue_array_pop_head_struct, pFp) +GO(gst_queue_array_pop_tail, pFp) +GO(gst_queue_array_pop_tail_struct, pFp) +GO(gst_queue_array_push_tail, vFpp) GO(gst_queue_array_push_tail_struct, vFpp) -//GO(gst_queue_array_set_clear_func, -//GO(gst_type_find_helper, +//GOM(gst_queue_array_set_clear_func, vFEpp) +GO(gst_type_find_helper, pFpL) GO(gst_type_find_helper_for_buffer, pFppp) -//GO(gst_type_find_helper_for_buffer_with_extension, -//GO(gst_type_find_helper_for_data, +GO(gst_type_find_helper_for_buffer_with_extension, pFpppp) +GO(gst_type_find_helper_for_data, pFppLp) GO(gst_type_find_helper_for_data_with_extension, pFppLpp) -//GO(gst_type_find_helper_for_extension, -//GO(gst_type_find_helper_get_range, -//GO(gst_type_find_helper_get_range_full, +GO(gst_type_find_helper_for_extension, pFpp) +//GOM(gst_type_find_helper_get_range, pFEpppLpp) +GOM(gst_type_find_helper_get_range_full, iFEpppLppp) diff --git a/src/wrapped/wrappedgstcheck.c b/src/wrapped/wrappedgstcheck.c index e52bf0b..f21dbeb 100644 --- a/src/wrapped/wrappedgstcheck.c +++ b/src/wrapped/wrappedgstcheck.c @@ -12,16 +12,12 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* gstcheckName = "libgstcheck-1.0.so"; -#else - const char* gstcheckName = "libgstcheck-1.0.so.0"; -#endif +const char* gstcheckName = "libgstcheck-1.0.so.0"; +#define ALTNAME "libgstcheck-1.0.so" #define LIBNAME gstcheck -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstcheck_private.h b/src/wrapped/wrappedgstcheck_private.h index b2f2bfc..e6e7d76 100644 --- a/src/wrapped/wrappedgstcheck_private.h +++ b/src/wrapped/wrappedgstcheck_private.h @@ -1,203 +1,203 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//DATAB(buffers, -//DATAB(check_cond, -//DATAB(check_debug, -//GO(check_fork, -//DATAB(check_major_version, -//DATA(check_micro_version, -//DATA(check_minor_version, -//DATAB(check_mutex, -//GO(check_waitpid_and_exit, -//GO(_ck_assert_failed, +//DATAB(buffers, 8) +//DATAB(check_cond, 16) +//DATAB(check_debug, 8) +GO(check_fork, iFv) +//DATAB(check_major_version, 4) +//DATA(check_micro_version, 4) +//DATA(check_minor_version, 4) +//DATAB(check_mutex, 8) +GO(check_waitpid_and_exit, vFi) +//GOM(_ck_assert_failed, vFEpipV) //GO(_fail_unless, -//GO(gst_buffer_straw_get_buffer, -//GO(gst_buffer_straw_start_pipeline, -//GO(gst_buffer_straw_stop_pipeline, -//GO(gst_check_abi_list, -//GO(gst_check_add_log_filter, -//GO(gst_check_buffer_data, -//GO(gst_check_caps_equal, -//GO(gst_check_chain_func, -//GO(gst_check_clear_log_filter, -//GO(gst_check_drop_buffers, -//GO(gst_check_element_push_buffer, -//GO(gst_check_element_push_buffer_list, -//DATAB(_gst_check_expecting_log, -//GO(gst_check_init, -//DATAB(_gst_check_list_tests, -//GO(gst_check_message_error, -//GO(gst_check_object_destroyed_on_unref, -//GO(gst_check_objects_destroyed_on_unref, -//DATAB(_gst_check_raised_critical, -//DATAB(_gst_check_raised_warning, -//GO(gst_check_remove_log_filter, -//GO(gst_check_run_suite, -//GO(_gst_check_run_test_func, -//GO(gst_check_setup_element, -//GO(gst_check_setup_events, -//GO(gst_check_setup_events_with_stream_id, -//GO(gst_check_setup_sink_pad, -//GO(gst_check_setup_sink_pad_by_name, -//GO(gst_check_setup_sink_pad_by_name_from_template, -//GO(gst_check_setup_sink_pad_from_template, -//GO(gst_check_setup_src_pad, -//GO(gst_check_setup_src_pad_by_name, -//GO(gst_check_setup_src_pad_by_name_from_template, -//GO(gst_check_setup_src_pad_from_template, -//GO(gst_check_teardown_element, -//GO(gst_check_teardown_pad_by_name, -//GO(gst_check_teardown_sink_pad, -//GO(gst_check_teardown_src_pad, -//DATAB(_gst_check_threads_running, -//GO(gst_consistency_checker_add_pad, -//GO(gst_consistency_checker_free, -//GO(gst_consistency_checker_new, -//GO(gst_consistency_checker_reset, -//GO(gst_harness_add_element_full, -//GO(gst_harness_add_element_sink_pad, -//GO(gst_harness_add_element_src_pad, -//GO(gst_harness_add_parse, -//GO(gst_harness_add_probe, -//GO(gst_harness_add_propose_allocation_meta, -//GO(gst_harness_add_sink, -//GO(gst_harness_add_sink_harness, -//GO(gst_harness_add_sink_parse, -//GO(gst_harness_add_src, -//GO(gst_harness_add_src_harness, -//GO(gst_harness_add_src_parse, -//GO(gst_harness_buffers_in_queue, -//GO(gst_harness_buffers_received, -//GO(gst_harness_crank_multiple_clock_waits, -//GO(gst_harness_crank_single_clock_wait, -//GO(gst_harness_create_buffer, -//GO(gst_harness_dump_to_file, -//GO(gst_harness_events_in_queue, -//GO(gst_harness_events_received, -//GO(gst_harness_find_element, -//GO(gst_harness_get, -//GO(gst_harness_get_allocator, -//GO(gst_harness_get_last_pushed_timestamp, -//GO(gst_harness_get_testclock, -//GO(gst_harness_new, -//GO(gst_harness_new_empty, -//GO(gst_harness_new_full, -//GO(gst_harness_new_parse, -//GO(gst_harness_new_with_element, -//GO(gst_harness_new_with_padnames, -//GO(gst_harness_new_with_templates, -//GO(gst_harness_play, -//GO(gst_harness_pull, -//GO(gst_harness_pull_event, -//GO(gst_harness_pull_until_eos, -//GO(gst_harness_pull_upstream_event, -//GO(gst_harness_push, -//GO(gst_harness_push_and_pull, -//GO(gst_harness_push_event, -//GO(gst_harness_push_from_src, -//GO(gst_harness_push_to_sink, -//GO(gst_harness_push_upstream_event, -//GO(gst_harness_query_latency, -//GO(gst_harness_set, -//GO(gst_harness_set_blocking_push_mode, -//GO(gst_harness_set_caps, -//GO(gst_harness_set_caps_str, -//GO(gst_harness_set_drop_buffers, -//GO(gst_harness_set_forwarding, -//GO(gst_harness_set_live, -//GO(gst_harness_set_propose_allocator, -//GO(gst_harness_set_sink_caps, -//GO(gst_harness_set_sink_caps_str, -//GO(gst_harness_set_src_caps, -//GO(gst_harness_set_src_caps_str, -//GO(gst_harness_set_time, -//GO(gst_harness_set_upstream_latency, -//GO(gst_harness_sink_push_many, -//GO(gst_harness_src_crank_and_push_many, -//GO(gst_harness_src_push_event, -//GO(gst_harness_stress_custom_start, -//GO(gst_harness_stress_property_start_full, -//GO(gst_harness_stress_push_buffer_start_full, -//GO(gst_harness_stress_push_buffer_with_cb_start_full, -//GO(gst_harness_stress_push_event_start_full, -//GO(gst_harness_stress_push_event_with_cb_start_full, -//GO(gst_harness_stress_push_upstream_event_start_full, -//GO(gst_harness_stress_push_upstream_event_with_cb_start_full, -//GO(gst_harness_stress_requestpad_start_full, -//GO(gst_harness_stress_statechange_start_full, -//GO(gst_harness_stress_thread_stop, -//GO(gst_harness_take_all_data, -//GO(gst_harness_take_all_data_as_buffer, -//GO(gst_harness_take_all_data_as_bytes, -//GO(gst_harness_teardown, -//GO(gst_harness_try_pull, -//GO(gst_harness_try_pull_event, -//GO(gst_harness_try_pull_upstream_event, -//GO(gst_harness_upstream_events_in_queue, -//GO(gst_harness_upstream_events_received, -//GO(gst_harness_use_systemclock, -//GO(gst_harness_use_testclock, -//GO(gst_harness_wait_for_clock_id_waits, -//GO(gst_test_clock_advance_time, -//GO(gst_test_clock_crank, -//GO(gst_test_clock_get_next_entry_time, +GO(gst_buffer_straw_get_buffer, pFpp) +GO(gst_buffer_straw_start_pipeline, vFpp) +GO(gst_buffer_straw_stop_pipeline, vFpp) +GO(gst_check_abi_list, vFpi) +//GOM(gst_check_add_log_filter, pFEpipppp) +GO(gst_check_buffer_data, vFppL) +GO(gst_check_caps_equal, vFpp) +GO(gst_check_chain_func, iFppp) +GO(gst_check_clear_log_filter, vFv) +GO(gst_check_drop_buffers, vFv) +GO(gst_check_element_push_buffer, vFppppp) +GO(gst_check_element_push_buffer_list, vFpppppi) +//DATAB(_gst_check_expecting_log, 4) +GO(gst_check_init, vFpp) +//DATAB(_gst_check_list_tests, 4) +GO(gst_check_message_error, vFpiui) +GO(gst_check_object_destroyed_on_unref, vFp) +//GOM(gst_check_objects_destroyed_on_unref, vFEppV) +//DATAB(_gst_check_raised_critical, 4) +//DATAB(_gst_check_raised_warning, 4) +GO(gst_check_remove_log_filter, vFp) +GO(gst_check_run_suite, iFppp) +GO(_gst_check_run_test_func, iFp) +GO(gst_check_setup_element, pFp) +GO(gst_check_setup_events, vFpppu) +GO(gst_check_setup_events_with_stream_id, vFpppup) +GO(gst_check_setup_sink_pad, pFpp) +GO(gst_check_setup_sink_pad_by_name, pFppp) +GO(gst_check_setup_sink_pad_by_name_from_template, pFppp) +GO(gst_check_setup_sink_pad_from_template, pFpp) +GO(gst_check_setup_src_pad, pFpp) +GO(gst_check_setup_src_pad_by_name, pFppp) +GO(gst_check_setup_src_pad_by_name_from_template, pFppp) +GO(gst_check_setup_src_pad_from_template, pFpp) +GO(gst_check_teardown_element, vFp) +GO(gst_check_teardown_pad_by_name, vFpp) +GO(gst_check_teardown_sink_pad, vFp) +GO(gst_check_teardown_src_pad, vFp) +//DATAB(_gst_check_threads_running, 4) +GO(gst_consistency_checker_add_pad, iFpp) +GO(gst_consistency_checker_free, vFp) +GO(gst_consistency_checker_new, pFp) +GO(gst_consistency_checker_reset, vFp) +GO(gst_harness_add_element_full, vFpppppp) +GO(gst_harness_add_element_sink_pad, vFpp) +GO(gst_harness_add_element_src_pad, vFpp) +GO(gst_harness_add_parse, vFpp) +//GOM(gst_harness_add_probe, vFEpppuppp) +GO(gst_harness_add_propose_allocation_meta, vFpLp) +GO(gst_harness_add_sink, vFpp) +GO(gst_harness_add_sink_harness, vFpp) +GO(gst_harness_add_sink_parse, vFpp) +GO(gst_harness_add_src, vFppi) +GO(gst_harness_add_src_harness, vFppi) +GO(gst_harness_add_src_parse, vFppi) +GO(gst_harness_buffers_in_queue, uFp) +GO(gst_harness_buffers_received, uFp) +GO(gst_harness_crank_multiple_clock_waits, iFpu) +GO(gst_harness_crank_single_clock_wait, iFp) +GO(gst_harness_create_buffer, pFpL) +GO(gst_harness_dump_to_file, vFpp) +GO(gst_harness_events_in_queue, uFp) +GO(gst_harness_events_received, uFp) +GO(gst_harness_find_element, pFpp) +//GOM(gst_harness_get, vFEpppV) +GO(gst_harness_get_allocator, vFppp) +GO(gst_harness_get_last_pushed_timestamp, LFp) +GO(gst_harness_get_testclock, pFp) +GO(gst_harness_new, pFp) +GO(gst_harness_new_empty, pFv) +GO(gst_harness_new_full, pFppppp) +GO(gst_harness_new_parse, pFp) +GO(gst_harness_new_with_element, pFppp) +GO(gst_harness_new_with_padnames, pFppp) +GO(gst_harness_new_with_templates, pFppp) +GO(gst_harness_play, vFp) +GO(gst_harness_pull, pFp) +GO(gst_harness_pull_event, pFp) +GO(gst_harness_pull_until_eos, iFpp) +GO(gst_harness_pull_upstream_event, pFp) +GO(gst_harness_push, iFpp) +GO(gst_harness_push_and_pull, pFpp) +GO(gst_harness_push_event, iFpp) +GO(gst_harness_push_from_src, iFp) +GO(gst_harness_push_to_sink, iFp) +GO(gst_harness_push_upstream_event, iFpp) +GO(gst_harness_query_latency, LFp) +//GOM(gst_harness_set, vFEpppV) +GO(gst_harness_set_blocking_push_mode, vFp) +GO(gst_harness_set_caps, vFppp) +GO(gst_harness_set_caps_str, vFppp) +GO(gst_harness_set_drop_buffers, vFpi) +GO(gst_harness_set_forwarding, vFpi) +GO(gst_harness_set_live, vFpi) +GO(gst_harness_set_propose_allocator, vFppp) +GO(gst_harness_set_sink_caps, vFpp) +GO(gst_harness_set_sink_caps_str, vFpp) +GO(gst_harness_set_src_caps, vFpp) +GO(gst_harness_set_src_caps_str, vFpp) +GO(gst_harness_set_time, iFpL) +GO(gst_harness_set_upstream_latency, vFpL) +GO(gst_harness_sink_push_many, iFpi) +GO(gst_harness_src_crank_and_push_many, iFpii) +GO(gst_harness_src_push_event, iFp) +//GOM(gst_harness_stress_custom_start, pFEppppL) +GO(gst_harness_stress_property_start_full, pFpppL) +GO(gst_harness_stress_push_buffer_start_full, pFppppL) +//GOM(gst_harness_stress_push_buffer_with_cb_start_full, pFEppppppL) +GO(gst_harness_stress_push_event_start_full, pFppL) +//GOM(gst_harness_stress_push_event_with_cb_start_full, pFEppppL) +GO(gst_harness_stress_push_upstream_event_start_full, pFppL) +//GOM(gst_harness_stress_push_upstream_event_with_cb_start_full, pFEppppL) +GO(gst_harness_stress_requestpad_start_full, pFppppiL) +GO(gst_harness_stress_statechange_start_full, pFpL) +GO(gst_harness_stress_thread_stop, uFp) +GO(gst_harness_take_all_data, pFpp) +GO(gst_harness_take_all_data_as_buffer, pFp) +GO(gst_harness_take_all_data_as_bytes, pFp) +GO(gst_harness_teardown, vFp) +GO(gst_harness_try_pull, pFp) +GO(gst_harness_try_pull_event, pFp) +GO(gst_harness_try_pull_upstream_event, pFp) +GO(gst_harness_upstream_events_in_queue, uFp) +GO(gst_harness_upstream_events_received, uFp) +GO(gst_harness_use_systemclock, vFp) +GO(gst_harness_use_testclock, vFp) +GO(gst_harness_wait_for_clock_id_waits, iFpuu) +GO(gst_test_clock_advance_time, vFpl) +GO(gst_test_clock_crank, iFp) +GO(gst_test_clock_get_next_entry_time, LFp) GO(gst_test_clock_get_type, LFv) -//GO(gst_test_clock_has_id, -//GO(gst_test_clock_id_list_get_latest_time, -//GO(gst_test_clock_new, -//GO(gst_test_clock_new_with_start_time, -//GO(gst_test_clock_peek_id_count, -//GO(gst_test_clock_peek_next_pending_id, -//GO(gst_test_clock_process_id, -//GO(gst_test_clock_process_id_list, -//GO(gst_test_clock_process_next_clock_id, -//GO(gst_test_clock_set_time, -//GO(gst_test_clock_timed_wait_for_multiple_pending_ids, -//GO(gst_test_clock_wait_for_multiple_pending_ids, -//GO(gst_test_clock_wait_for_next_pending_id, -//GO(gst_test_clock_wait_for_pending_id_count, -//GO(_mark_point, -//DATAB(mutex, -//GO(srunner_add_suite, -//GO(srunner_create, -//GO(srunner_failures, -//GO(srunner_fork_status, -//GO(srunner_free, -//GO(srunner_has_log, -//GO(srunner_has_tap, -//GO(srunner_has_xml, -//GO(srunner_log_fname, -//GO(srunner_ntests_failed, -//GO(srunner_ntests_run, -//GO(srunner_print, -//GO(srunner_results, -//GO(srunner_run, -//GO(srunner_run_all, -//GO(srunner_run_tagged, -//GO(srunner_set_fork_status, -//GO(srunner_set_log, -//GO(srunner_set_tap, -//GO(srunner_set_xml, -//GO(srunner_tap_fname, -//GO(srunner_xml_fname, -//DATAB(start_cond, -//GO(suite_add_tcase, -//GO(suite_create, -//GO(suite_tcase, -//DATAB(sync_cond, -//GO(tcase_add_checked_fixture, -//GO(_tcase_add_test, -//GO(tcase_add_unchecked_fixture, -//GO(tcase_create, -//GO(tcase_fn_start, -//GO(tcase_set_tags, -//GO(tcase_set_timeout, -//DATAB(thread_list, -//GO(tr_ctx, -//GO(tr_lfile, -//GO(tr_lno, -//GO(tr_msg, -//GO(tr_rtype, -//GO(tr_tcname, +GO(gst_test_clock_has_id, iFpp) +GO(gst_test_clock_id_list_get_latest_time, LFp) +GO(gst_test_clock_new, pFv) +GO(gst_test_clock_new_with_start_time, pFL) +GO(gst_test_clock_peek_id_count, uFp) +GO(gst_test_clock_peek_next_pending_id, iFpp) +GO(gst_test_clock_process_id, iFpp) +GO(gst_test_clock_process_id_list, uFpp) +GO(gst_test_clock_process_next_clock_id, pFp) +GO(gst_test_clock_set_time, vFpL) +GO(gst_test_clock_timed_wait_for_multiple_pending_ids, iFpuup) +GO(gst_test_clock_wait_for_multiple_pending_ids, vFpup) +GO(gst_test_clock_wait_for_next_pending_id, vFpp) +GO(gst_test_clock_wait_for_pending_id_count, vFpu) +GO(_mark_point, vFpi) +//DATAB(mutex, 8) +GO(srunner_add_suite, vFpp) +GO(srunner_create, pFp) +GO(srunner_failures, pFp) +GO(srunner_fork_status, uFp) +GO(srunner_free, vFp) +GO(srunner_has_log, iFp) +GO(srunner_has_tap, iFp) +GO(srunner_has_xml, iFp) +GO(srunner_log_fname, pFp) +GO(srunner_ntests_failed, iFp) +GO(srunner_ntests_run, iFp) +GO(srunner_print, vFpu) +GO(srunner_results, pFp) +GO(srunner_run, vFpppu) +GO(srunner_run_all, vFpu) +GO(srunner_run_tagged, vFpppppu) +GO(srunner_set_fork_status, vFpu) +GO(srunner_set_log, vFpp) +GO(srunner_set_tap, vFpp) +GO(srunner_set_xml, vFpp) +GO(srunner_tap_fname, pFp) +GO(srunner_xml_fname, pFp) +//DATAB(start_cond, 16) +GO(suite_add_tcase, vFpp) +GO(suite_create, pFp) +GO(suite_tcase, iFpp) +//DATAB(sync_cond, 16) +//GOM(tcase_add_checked_fixture, vFEppp) +//GOM(_tcase_add_test, vFEpppiiii) +//GOM(tcase_add_unchecked_fixture, vFEppp) +GO(tcase_create, pFp) +GO(tcase_fn_start, vFppi) +GO(tcase_set_tags, vFpp) +GO(tcase_set_timeout, vFpd) +//DATAB(thread_list, 8) +GO(tr_ctx, uFp) +GO(tr_lfile, pFp) +GO(tr_lno, iFp) +GO(tr_msg, pFp) +GO(tr_rtype, iFp) +GO(tr_tcname, pFp) diff --git a/src/wrapped/wrappedgstcontroller.c b/src/wrapped/wrappedgstcontroller.c index c2a7cfc..c1ab69a 100644 --- a/src/wrapped/wrappedgstcontroller.c +++ b/src/wrapped/wrappedgstcontroller.c @@ -12,16 +12,12 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* gstcontrollerName = "libgstcontroller-1.0.so"; -#else - const char* gstcontrollerName = "libgstcontroller-1.0.so.0"; -#endif +const char* gstcontrollerName = "libgstcontroller-1.0.so.0"; +#define ALTNAME "libgstcontroller-1.0.so" #define LIBNAME gstcontroller -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstcontroller_private.h b/src/wrapped/wrappedgstcontroller_private.h index 0cbde97..5f4437b 100644 --- a/src/wrapped/wrappedgstcontroller_private.h +++ b/src/wrapped/wrappedgstcontroller_private.h @@ -1,31 +1,31 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(gst_argb_control_binding_get_type, LFv) -//GO(gst_argb_control_binding_new, -//GO(gst_control_point_copy, -//GO(gst_control_point_free, +//GOM(gst_argb_control_binding_new, pFEpppppp) +GO(gst_control_point_copy, pFp) +GO(gst_control_point_free, vFp) GO(gst_control_point_get_type, LFv) GO(gst_direct_control_binding_get_type, LFv) -//GO(gst_direct_control_binding_new, -//GO(gst_direct_control_binding_new_absolute, +//GOM(gst_direct_control_binding_new, pFEppp) +//GOM(gst_direct_control_binding_new_absolute, pFEppp) GO(gst_interpolation_control_source_get_type, LFv) -//GO(gst_interpolation_control_source_new, +//GOM(gst_interpolation_control_source_new, pFEv) GO(gst_interpolation_mode_get_type, LFv) GO(gst_lfo_control_source_get_type, LFv) -//GO(gst_lfo_control_source_new, +//GOM(gst_lfo_control_source_new, pFEv) GO(gst_lfo_waveform_get_type, LFv) GO(gst_proxy_control_binding_get_type, LFv) GO(gst_proxy_control_binding_new, pFpppp) -//GO(gst_timed_value_control_invalidate_cache, -//GO(gst_timed_value_control_source_find_control_point_iter, -//GO(gst_timed_value_control_source_get_all, -//GO(gst_timed_value_control_source_get_count, +//GOM(gst_timed_value_control_invalidate_cache, vFEp) +//GOM(gst_timed_value_control_source_find_control_point_iter, pFEpL) +//GOM(gst_timed_value_control_source_get_all, pFEp) +//GOM(gst_timed_value_control_source_get_count, iFEp) GO(gst_timed_value_control_source_get_type, LFv) -//GO(gst_timed_value_control_source_set, -//GO(gst_timed_value_control_source_set_from_list, -//GO(gst_timed_value_control_source_unset, -//GO(gst_timed_value_control_source_unset_all, +//GOM(gst_timed_value_control_source_set, iFEpLd) +//GOM(gst_timed_value_control_source_set_from_list, iFEpp) +//GOM(gst_timed_value_control_source_unset, iFEpL) +//GOM(gst_timed_value_control_source_unset_all, vFEp) GO(gst_trigger_control_source_get_type, LFv) -//GO(gst_trigger_control_source_new, +//GOM(gst_trigger_control_source_new, pFEv) diff --git a/src/wrapped/wrappedgstfft.c b/src/wrapped/wrappedgstfft.c index ee3a565..76f7141 100644 --- a/src/wrapped/wrappedgstfft.c +++ b/src/wrapped/wrappedgstfft.c @@ -12,16 +12,12 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* gstfftName = "libgstfft-1.0.so"; -#else - const char* gstfftName = "libgstfft-1.0.so.0"; -#endif +const char* gstfftName = "libgstfft-1.0.so.0"; +#define ALTNAME "libgstfft-1.0.so" #define LIBNAME gstfft -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstfft_private.h b/src/wrapped/wrappedgstfft_private.h index 6493423..fbe4b1c 100644 --- a/src/wrapped/wrappedgstfft_private.h +++ b/src/wrapped/wrappedgstfft_private.h @@ -1,25 +1,25 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//GO(gst_fft_f32_fft, -//GO(gst_fft_f32_free, -//GO(gst_fft_f32_inverse_fft, -//GO(gst_fft_f32_new, -//GO(gst_fft_f32_window, -//GO(gst_fft_f64_fft, -//GO(gst_fft_f64_free, -//GO(gst_fft_f64_inverse_fft, -//GO(gst_fft_f64_new, -//GO(gst_fft_f64_window, -//GO(gst_fft_next_fast_length, -//GO(gst_fft_s16_fft, -//GO(gst_fft_s16_free, -//GO(gst_fft_s16_inverse_fft, -//GO(gst_fft_s16_new, -//GO(gst_fft_s16_window, -//GO(gst_fft_s32_fft, -//GO(gst_fft_s32_free, -//GO(gst_fft_s32_inverse_fft, -//GO(gst_fft_s32_new, -//GO(gst_fft_s32_window, +GO(gst_fft_f32_fft, vFppp) +GO(gst_fft_f32_free, vFp) +GO(gst_fft_f32_inverse_fft, vFppp) +GO(gst_fft_f32_new, pFii) +GO(gst_fft_f32_window, vFppu) +GO(gst_fft_f64_fft, vFppp) +GO(gst_fft_f64_free, vFp) +GO(gst_fft_f64_inverse_fft, vFppp) +GO(gst_fft_f64_new, pFii) +GO(gst_fft_f64_window, vFppu) +GO(gst_fft_next_fast_length, iFi) +GO(gst_fft_s16_fft, vFppp) +GO(gst_fft_s16_free, vFp) +GO(gst_fft_s16_inverse_fft, vFppp) +GO(gst_fft_s16_new, pFii) +GO(gst_fft_s16_window, vFppu) +GO(gst_fft_s32_fft, vFppp) +GO(gst_fft_s32_free, vFp) +GO(gst_fft_s32_inverse_fft, vFppp) +GO(gst_fft_s32_new, pFii) +GO(gst_fft_s32_window, vFppu) diff --git a/src/wrapped/wrappedgstgl.c b/src/wrapped/wrappedgstgl.c index 176df13..ff264e9 100644 --- a/src/wrapped/wrappedgstgl.c +++ b/src/wrapped/wrappedgstgl.c @@ -21,11 +21,8 @@ #include "fileutils.h" #include "gltools.h" -#ifdef ANDROID - const char* gstglName = "libgstgl-1.0.so"; -#else - const char* gstglName = "libgstgl-1.0.so.0"; -#endif +const char* gstglName = "libgstgl-1.0.so.0"; +#define ALTNAME "libgstgl-1.0.so" #define LIBNAME gstgl @@ -209,12 +206,12 @@ static void* findGstGLWindowCBFct(void* fct) EXPORT void* my_gst_gl_context_get_proc_address_with_platform(x64emu_t* emu, int type, int gl_api, const char* name) { - return getGLProcAddress(emu, findGetProcAddressPlatformFct(type, gl_api), name); + return getGLProcAddress(emu, NULL, findGetProcAddressPlatformFct(type, gl_api), name); } EXPORT void* my_gst_gl_context_default_get_proc_address(x64emu_t* emu, int gl_api, const char* name) { - return getGLProcAddress(emu, findGetProcAddressAPIFct(gl_api), name); + return getGLProcAddress(emu, NULL, findGetProcAddressAPIFct(gl_api), name); } EXPORT void my_gst_gl_context_thread_add(x64emu_t* emu, void* context, void* f, void* data) @@ -267,9 +264,8 @@ EXPORT void my_gst_gl_window_set_resize_callback(x64emu_t* emu, void* window, vo my->gst_gl_window_set_resize_callback(window, findGstGLWindowCBFct(f), data, findDestroyFct(d)); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define CUSTOM_INIT \ SetGstGLBaseFilterID(my->gst_gl_base_filter_get_type()); \ diff --git a/src/wrapped/wrappedgstgl_private.h b/src/wrapped/wrappedgstgl_private.h index 92e247c..d0b502e 100644 --- a/src/wrapped/wrappedgstgl_private.h +++ b/src/wrapped/wrappedgstgl_private.h @@ -1,168 +1,168 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(gst_buffer_add_gl_sync_meta, pFpp) -//GO(gst_buffer_add_gl_sync_meta_full, -//GO(gst_buffer_pool_config_get_gl_allocation_params, -//GO(gst_buffer_pool_config_set_gl_allocation_params, +GO(gst_buffer_add_gl_sync_meta_full, pFppp) +GO(gst_buffer_pool_config_get_gl_allocation_params, pFp) +GO(gst_buffer_pool_config_set_gl_allocation_params, vFpp) GO(gst_context_get_gl_display, iFpp) GO(gst_context_set_gl_display, vFpp) -//GO(gst_egl_get_error_string, +GO(gst_egl_get_error_string, pFi) GO(gst_egl_image_export_dmabuf, iFpppp) -//GO(gst_egl_image_from_dmabuf, -//GO(gst_egl_image_from_dmabuf_direct, -//GO(gst_egl_image_from_dmabuf_direct_target, +GO(gst_egl_image_from_dmabuf, pFpipiL) +GO(gst_egl_image_from_dmabuf_direct, pFpppp) +GO(gst_egl_image_from_dmabuf_direct_target, pFppppu) GO(gst_egl_image_from_texture, pFppp) -//GO(gst_egl_image_get_image, +GO(gst_egl_image_get_image, pFp) GO(gst_egl_image_get_type, LFv) -//GO(gst_egl_image_new_wrapped, -//GO(gst_gl_allocation_params_copy, -//GO(gst_gl_allocation_params_copy_data, +//GOM(gst_egl_image_new_wrapped, pFEppupp) +GO(gst_gl_allocation_params_copy, pFp) +GO(gst_gl_allocation_params_copy_data, vFpp) GO(gst_gl_allocation_params_free, vFp) -//GO(gst_gl_allocation_params_free_data, +GO(gst_gl_allocation_params_free_data, vFp) GO(gst_gl_allocation_params_get_type, LFv) -//GO(gst_gl_allocation_params_init, +//GOM(gst_gl_allocation_params_init, iFEpLupppLppppp) GO(gst_gl_api_from_string, uFp) GO(gst_gl_api_get_type, LFv) GO(gst_gl_api_to_string, pFu) -//GO(gst_gl_async_debug_free, -//GO(gst_gl_async_debug_freeze, -//GO(gst_gl_async_debug_init, -//GO(gst_gl_async_debug_new, -//GO(gst_gl_async_debug_output_log_msg, -//GO(gst_gl_async_debug_store_log_msg, -//GO(gst_gl_async_debug_store_log_msg_valist, -//GO(gst_gl_async_debug_thaw, -//GO(gst_gl_async_debug_unset, +//GOM(gst_gl_async_debug_free, vFEp) +//GOM(gst_gl_async_debug_freeze, vFEp) +//GOM(gst_gl_async_debug_init, vFEp) +//GOM(gst_gl_async_debug_new, pFEv) +//GOM(gst_gl_async_debug_output_log_msg, vFEp) +//GOM(gst_gl_async_debug_store_log_msg, vFEppuppippV) +//GOM(gst_gl_async_debug_store_log_msg_valist, vFEppuppippA) +//GOM(gst_gl_async_debug_thaw, vFEp) +//GOM(gst_gl_async_debug_unset, vFEp) GO(gst_gl_base_filter_find_gl_context, iFp) GO(gst_gl_base_filter_get_gl_context, pFp) GO(gst_gl_base_filter_get_type, LFv) GO(gst_gl_base_memory_alloc, pFpp) GO(gst_gl_base_memory_allocator_get_type, LFv) -//GO(gst_gl_base_memory_alloc_data, +GO(gst_gl_base_memory_alloc_data, iFp) GO(gst_gl_base_memory_error_get_type, LFv) GO(gst_gl_base_memory_error_quark, uFv) GO(gst_gl_base_memory_get_type, LFv) -//GO(gst_gl_base_memory_init, -//GO(gst_gl_base_memory_init_once, -//GO(gst_gl_base_memory_memcpy, +//GOM(gst_gl_base_memory_init, vFEpppppLpp) +GO(gst_gl_base_memory_init_once, vFv) +GO(gst_gl_base_memory_memcpy, iFppll) GO(gst_gl_base_memory_transfer_get_type, LFv) GO(gst_gl_base_src_get_type, LFv) GO(gst_gl_buffer_allocation_params_get_type, LFv) -//GO(gst_gl_buffer_allocation_params_new, +GO(gst_gl_buffer_allocation_params_new, pFpLpuu) GO(gst_gl_buffer_allocator_get_type, LFv) GO(gst_gl_buffer_get_type, LFv) -//GO(gst_gl_buffer_init_once, -//GO(gst_gl_buffer_pool_get_gl_allocation_params, +GO(gst_gl_buffer_init_once, vFv) +GO(gst_gl_buffer_pool_get_gl_allocation_params, pFp) GO(gst_gl_buffer_pool_get_type, LFv) GO(gst_gl_buffer_pool_new, pFp) GO(gst_gl_check_extension, iFpp) GO(gst_gl_color_convert_decide_allocation, iFpp) -GO(gst_gl_color_convert_fixate_caps, pFpipp) +GO(gst_gl_color_convert_fixate_caps, pFpupp) GO(gst_gl_color_convert_get_type, LFv) GO(gst_gl_color_convert_new, pFp) GO(gst_gl_color_convert_perform, pFpp) GO(gst_gl_color_convert_set_caps, iFppp) -GO(gst_gl_color_convert_transform_caps, pFpipp) -//DATA(GST_GL_CONFIG_ATTRIB_ALPHA_SIZE_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_BLUE_SIZE_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_CAVEAT_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_CONFIG_ID_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_CONFORMANT_API_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_DEPTH_SIZE_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_GREEN_SIZE_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_LEVEL_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_LUMINANCE_SIZE_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_MAX_PBUFFER_HEIGHT_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_MAX_PBUFFER_PIXELS_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_MAX_PBUFFER_WIDTH_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_MAX_SWAP_INTERVAL_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_MIN_SWAP_INTERVAL_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_NATIVE_RENDERABLE_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_NATIVE_VISUAL_ID_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_PLATFORM_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_RED_SIZE_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_RENDERABLE_API_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_SAMPLE_BUFFERS_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_SAMPLES_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_STENCIL_SIZE_NAME, -//DATA(GST_GL_CONFIG_ATTRIB_SURFACE_TYPE_NAME, +GO(gst_gl_color_convert_transform_caps, pFpupp) +DATA(GST_GL_CONFIG_ATTRIB_ALPHA_SIZE_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_BLUE_SIZE_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_CAVEAT_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_CONFIG_ID_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_CONFORMANT_API_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_DEPTH_SIZE_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_GREEN_SIZE_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_LEVEL_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_LUMINANCE_SIZE_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_MAX_PBUFFER_HEIGHT_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_MAX_PBUFFER_PIXELS_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_MAX_PBUFFER_WIDTH_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_MAX_SWAP_INTERVAL_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_MIN_SWAP_INTERVAL_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_NATIVE_RENDERABLE_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_NATIVE_VISUAL_ID_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_PLATFORM_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_RED_SIZE_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_RENDERABLE_API_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_SAMPLE_BUFFERS_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_SAMPLES_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_STENCIL_SIZE_NAME, 8) +DATA(GST_GL_CONFIG_ATTRIB_SURFACE_TYPE_NAME, 8) GO(gst_gl_config_caveat_get_type, LFv) GO(gst_gl_config_caveat_to_string, pFu) GO(gst_gl_config_surface_type_get_type, LFv) GO(gst_gl_config_surface_type_to_string, pFu) -//GO(gst_gl_context_activate, -//GO(gst_gl_context_can_share, -//GO(gst_gl_context_check_feature, -//GO(gst_gl_context_check_framebuffer_status, -GO(gst_gl_context_check_gl_version, iFpiii) -//GO(gst_gl_context_clear_framebuffer, +GO(gst_gl_context_activate, iFpi) +GO(gst_gl_context_can_share, iFpp) +GO(gst_gl_context_check_feature, iFpp) +GO(gst_gl_context_check_framebuffer_status, iFpu) +GO(gst_gl_context_check_gl_version, iFpuii) +GO(gst_gl_context_clear_framebuffer, vFp) GO(gst_gl_context_clear_shader, vFp) -//GO(gst_gl_context_create, +GO(gst_gl_context_create, iFppp) GOM(gst_gl_context_default_get_proc_address, pFEup) -//GO(gst_gl_context_destroy, +GO(gst_gl_context_destroy, vFp) GO(gst_gl_context_error_get_type, LFv) -//GO(gst_gl_context_error_quark, -//GO(gst_gl_context_fill_info, -//GO(gst_gl_context_get_config, +GO(gst_gl_context_error_quark, uFv) +GO(gst_gl_context_fill_info, iFpp) +GO(gst_gl_context_get_config, pFp) GO(gst_gl_context_get_current, pFv) GO(gst_gl_context_get_current_gl_api, uFupp) GO(gst_gl_context_get_current_gl_context, LFu) -//GO(gst_gl_context_get_display, -GO(gst_gl_context_get_gl_api, iFp) -//GO(gst_gl_context_get_gl_context, -GO(gst_gl_context_get_gl_platform, iFp) -//GO(gst_gl_context_get_gl_platform_version, -//GO(gst_gl_context_get_gl_version, -//GO(gst_gl_context_get_proc_address, +GO(gst_gl_context_get_display, pFp) +GO(gst_gl_context_get_gl_api, uFp) +GO(gst_gl_context_get_gl_context, LFp) +GO(gst_gl_context_get_gl_platform, uFp) +GO(gst_gl_context_get_gl_platform_version, vFppp) +GO(gst_gl_context_get_gl_version, vFppp) +GO(gst_gl_context_get_proc_address, pFpp) GOM(gst_gl_context_get_proc_address_with_platform, pFEuup) -//GO(gst_gl_context_get_thread, +GO(gst_gl_context_get_thread, pFp) GO(gst_gl_context_get_type, LFv) GO(gst_gl_context_get_window, pFp) -//GO(gst_gl_context_is_shared, -//GO(gst_gl_context_new, -//GO(gst_gl_context_new_wrapped, -//GO(gst_gl_context_request_config, -//GO(gst_gl_context_set_shared_with, -//GO(gst_gl_context_set_window, -//GO(gst_gl_context_supports_glsl_profile_version, -//GO(gst_gl_context_supports_precision, -//GO(gst_gl_context_supports_precision_highp, -//GO(gst_gl_context_swap_buffers, +GO(gst_gl_context_is_shared, iFp) +GO(gst_gl_context_new, pFp) +GO(gst_gl_context_new_wrapped, pFpLuu) +GO(gst_gl_context_request_config, iFpp) +GO(gst_gl_context_set_shared_with, vFpp) +GO(gst_gl_context_set_window, iFpp) +GO(gst_gl_context_supports_glsl_profile_version, iFpui) +GO(gst_gl_context_supports_precision, iFpui) +GO(gst_gl_context_supports_precision_highp, iFpui) +GO(gst_gl_context_swap_buffers, vFp) GOM(gst_gl_context_thread_add, vFEppp) GO(gst_gl_display_add_context, iFpp) GO(gst_gl_display_create_context, iFpppp) -//GO(gst_gl_display_create_window, +GO(gst_gl_display_create_window, pFp) GO(gst_gl_display_egl_device_get_type, LFv) -//GO(gst_gl_display_egl_device_new, -//GO(gst_gl_display_egl_device_new_with_egl_device, -//GO(gst_gl_display_egl_from_gl_display, -//GO(gst_gl_display_egl_get_from_native, +GO(gst_gl_display_egl_device_new, pFu) +GO(gst_gl_display_egl_device_new_with_egl_device, pFp) +GO(gst_gl_display_egl_from_gl_display, pFp) +GO(gst_gl_display_egl_get_from_native, pFuL) GO(gst_gl_display_egl_get_type, LFv) -//GO(gst_gl_display_egl_new, -//GO(gst_gl_display_egl_new_with_egl_display, -GO(gst_gl_display_filter_gl_api, vFpi) -//GO(gst_gl_display_find_window, -//GO(gst_gl_display_get_gl_api, -//GO(gst_gl_display_get_gl_api_unlocked, +GO(gst_gl_display_egl_new, pFv) +GO(gst_gl_display_egl_new_with_egl_display, pFp) +GO(gst_gl_display_filter_gl_api, vFpu) +//GOM(gst_gl_display_find_window, pFEppp) +GO(gst_gl_display_get_gl_api, uFp) +GO(gst_gl_display_get_gl_api_unlocked, uFp) GO(gst_gl_display_get_gl_context_for_thread, pFpp) -//GO(gst_gl_display_get_handle, -//GO(gst_gl_display_get_handle_type, +GO(gst_gl_display_get_handle, LFp) +GO(gst_gl_display_get_handle_type, uFp) GO(gst_gl_display_get_type, LFv) GO(gst_gl_display_new, pFv) -GO(gst_gl_display_new_with_type, pFi) -//GO(gst_gl_display_remove_context, -//GO(gst_gl_display_remove_window, -//GO(gst_gl_display_retrieve_window, +GO(gst_gl_display_new_with_type, pFu) +GO(gst_gl_display_remove_context, vFpp) +GO(gst_gl_display_remove_window, iFpp) +//GOM(gst_gl_display_retrieve_window, pFEppp) GO(gst_gl_display_type_get_type, LFv) GO(gst_gl_display_wayland_get_type, LFv) -//GO(gst_gl_display_wayland_new, -//GO(gst_gl_display_wayland_new_with_display, +GO(gst_gl_display_wayland_new, pFp) +GO(gst_gl_display_wayland_new_with_display, pFp) GO(gst_gl_display_x11_get_type, LFv) -//GO(gst_gl_display_x11_new, -//GO(gst_gl_display_x11_new_with_display, -//GO(gst_gl_element_propagate_display_context, +//GOM(gst_gl_display_x11_new, pFEp) +//GOM(gst_gl_display_x11_new_with_display, pFEp) +GO(gst_gl_element_propagate_display_context, vFpp) GO(gst_gl_ensure_element_data, iFppp) GO(gst_gl_filter_add_rgba_pad_templates, vFp) GO(gst_gl_filter_draw_fullscreen_quad, vFp) @@ -170,51 +170,51 @@ GO(gst_gl_filter_filter_texture, iFppp) GO(gst_gl_filter_get_type, LFv) GOM(gst_gl_filter_render_to_target, iFEppppp) GO(gst_gl_filter_render_to_target_with_shader, vFpppp) -//GO(gst_gl_format_from_video_info, +GO(gst_gl_format_from_video_info, uFppu) GO(gst_gl_format_get_type, LFv) -//GO(gst_gl_format_is_supported, +GO(gst_gl_format_is_supported, iFpu) GO(gst_gl_format_type_from_sized_gl_format, vFupp) GO(gst_gl_format_type_n_bytes, uFuu) -//GO(gst_gl_framebuffer_attach, -//GO(gst_gl_framebuffer_bind, +GO(gst_gl_framebuffer_attach, vFpup) +GO(gst_gl_framebuffer_bind, vFp) GOM(gst_gl_framebuffer_draw_to_texture, iFEpppp) GO(gst_gl_framebuffer_get_effective_dimensions, vFppp) GO(gst_gl_framebuffer_get_id, uFp) GO(gst_gl_framebuffer_get_type, LFv) -//GO(gst_gl_framebuffer_new, +GO(gst_gl_framebuffer_new, pFp) GO(gst_gl_framebuffer_new_with_default_depth, pFpuu) GO(gst_gl_get_affine_transformation_meta_as_ndc, vFpp) -//GO(gst_gl_get_plane_data_size, -//GO(gst_gl_get_plane_start, +GO(gst_gl_get_plane_data_size, LFppu) +GO(gst_gl_get_plane_start, LFppu) GO(gst_gl_handle_context_query, iFppppp) GO(gst_gl_handle_set_context, iFpppp) GOM(gst_gl_insert_debug_marker, vFppV) -//GO(gst_gl_memory_allocator_get_default, +GO(gst_gl_memory_allocator_get_default, pFp) GO(gst_gl_memory_allocator_get_type, LFv) -//GO(gst_gl_memory_copy_into, -//GO(gst_gl_memory_copy_teximage, +GO(gst_gl_memory_copy_into, iFpuuuii) +GO(gst_gl_memory_copy_teximage, iFpuuuii) GO(gst_gl_memory_egl_allocator_get_type, LFv) -//GO(gst_gl_memory_egl_get_display, -//GO(gst_gl_memory_egl_get_image, +GO(gst_gl_memory_egl_get_display, pFp) +GO(gst_gl_memory_egl_get_image, pFp) GO(gst_gl_memory_egl_get_type, LFv) -//GO(gst_gl_memory_egl_init_once, -//GO(gst_gl_memory_get_texture_format, +GO(gst_gl_memory_egl_init_once, vFv) +GO(gst_gl_memory_get_texture_format, uFp) GO(gst_gl_memory_get_texture_height, iFp) GO(gst_gl_memory_get_texture_id, uFp) -GO(gst_gl_memory_get_texture_target, iFp) +GO(gst_gl_memory_get_texture_target, uFp) GO(gst_gl_memory_get_texture_width, iFp) GO(gst_gl_memory_get_type, LFv) -//GO(gst_gl_memory_init, -//GO(gst_gl_memory_init_once, +//GOM(gst_gl_memory_init, vFEppppuuppuppp) +GO(gst_gl_memory_init_once, vFv) GO(gst_gl_memory_pbo_allocator_get_type, LFv) -//GO(gst_gl_memory_pbo_copy_into_texture, +GO(gst_gl_memory_pbo_copy_into_texture, iFpuuuiiii) GO(gst_gl_memory_pbo_download_transfer, vFp) GO(gst_gl_memory_pbo_get_type, LFv) -//GO(gst_gl_memory_pbo_init_once, -//GO(gst_gl_memory_pbo_upload_transfer, -//GO(gst_gl_memory_read_pixels, -//GO(gst_gl_memory_setup_buffer, -//GO(gst_gl_memory_texsubimage, +GO(gst_gl_memory_pbo_init_once, vFv) +GO(gst_gl_memory_pbo_upload_transfer, vFp) +GO(gst_gl_memory_read_pixels, iFpp) +GO(gst_gl_memory_setup_buffer, iFpppppL) +GO(gst_gl_memory_texsubimage, vFpp) GO(gst_gl_multiply_matrix4, vFppp) GO(gst_gl_overlay_compositor_add_caps, pFp) GO(gst_gl_overlay_compositor_draw_overlays, vFp) @@ -225,25 +225,25 @@ GO(gst_gl_overlay_compositor_upload_overlays, vFpp) GO(gst_gl_platform_from_string, uFp) GO(gst_gl_platform_get_type, LFv) GO(gst_gl_platform_to_string, pFu) -//GO(gst_gl_query_counter, -//GO(gst_gl_query_end, -//GO(gst_gl_query_free, -//GO(gst_gl_query_init, +//GOM(gst_gl_query_counter, vFEp) +//GOM(gst_gl_query_end, vFEp) +//GOM(gst_gl_query_free, vFEp) +//GOM(gst_gl_query_init, vFEppu) GO(gst_gl_query_local_gl_context, iFpup) -//GO(gst_gl_query_new, -//GO(gst_gl_query_result, -//GO(gst_gl_query_start, +//GOM(gst_gl_query_new, pFEpu) +//GOM(gst_gl_query_result, LFEp) +//GOM(gst_gl_query_start, vFEp) GO(gst_gl_query_type_get_type, LFv) -//GO(gst_gl_query_unset, +//GOM(gst_gl_query_unset, vFEp) GO(gst_gl_renderbuffer_allocation_params_get_type, LFv) -//GO(gst_gl_renderbuffer_allocation_params_new, -//GO(gst_gl_renderbuffer_allocation_params_new_wrapped, +GO(gst_gl_renderbuffer_allocation_params_new, pFppuuu) +//GOM(gst_gl_renderbuffer_allocation_params_new_wrapped, pFEppuuuppp) GO(gst_gl_renderbuffer_allocator_get_type, LFv) -//GO(gst_gl_renderbuffer_get_format, -//GO(gst_gl_renderbuffer_get_height, -//GO(gst_gl_renderbuffer_get_id, +GO(gst_gl_renderbuffer_get_format, uFp) +GO(gst_gl_renderbuffer_get_height, iFp) +GO(gst_gl_renderbuffer_get_id, uFp) GO(gst_gl_renderbuffer_get_type, LFv) -//GO(gst_gl_renderbuffer_get_width, +GO(gst_gl_renderbuffer_get_width, iFp) GO(gst_gl_renderbuffer_init_once, vFv) GO(gst_gl_set_affine_transformation_meta_from_ndc, vFpp) GO(gst_gl_shader_attach, iFpp) @@ -262,72 +262,72 @@ GO(gst_gl_shader_new, pFp) GO(gst_gl_shader_new_default, pFpp) GO(gst_gl_shader_new_link_with_stages, pFpppppppppppp) //vaargs GO(gst_gl_shader_new_with_stages, pFpppppppppppp) //vaarg -//GO(gst_gl_shader_release, -//GO(gst_gl_shader_release_unlocked, +GO(gst_gl_shader_release, vFp) +GO(gst_gl_shader_release_unlocked, vFp) GO(gst_gl_shader_set_uniform_1f, vFppf) GO(gst_gl_shader_set_uniform_1fv, vFppup) GO(gst_gl_shader_set_uniform_1i, vFppi) -//GO(gst_gl_shader_set_uniform_1iv, +GO(gst_gl_shader_set_uniform_1iv, vFppup) GO(gst_gl_shader_set_uniform_2f, vFppff) -//GO(gst_gl_shader_set_uniform_2fv, +GO(gst_gl_shader_set_uniform_2fv, vFppup) GO(gst_gl_shader_set_uniform_2i, vFppii) -//GO(gst_gl_shader_set_uniform_2iv, +GO(gst_gl_shader_set_uniform_2iv, vFppup) GO(gst_gl_shader_set_uniform_3f, vFppfff) -//GO(gst_gl_shader_set_uniform_3fv, +GO(gst_gl_shader_set_uniform_3fv, vFppup) GO(gst_gl_shader_set_uniform_3i, vFppiii) -//GO(gst_gl_shader_set_uniform_3iv, +GO(gst_gl_shader_set_uniform_3iv, vFppup) GO(gst_gl_shader_set_uniform_4f, vFppffff) GO(gst_gl_shader_set_uniform_4fv, vFppup) GO(gst_gl_shader_set_uniform_4i, vFppiiii) GO(gst_gl_shader_set_uniform_4iv, vFppup) -//GO(gst_gl_shader_set_uniform_matrix_2fv, -//GO(gst_gl_shader_set_uniform_matrix_2x3fv, -//GO(gst_gl_shader_set_uniform_matrix_2x4fv, -//GO(gst_gl_shader_set_uniform_matrix_3fv, -//GO(gst_gl_shader_set_uniform_matrix_3x2fv, -//GO(gst_gl_shader_set_uniform_matrix_3x4fv, +GO(gst_gl_shader_set_uniform_matrix_2fv, vFppiip) +GO(gst_gl_shader_set_uniform_matrix_2x3fv, vFppiip) +GO(gst_gl_shader_set_uniform_matrix_2x4fv, vFppiip) +GO(gst_gl_shader_set_uniform_matrix_3fv, vFppiip) +GO(gst_gl_shader_set_uniform_matrix_3x2fv, vFppiip) +GO(gst_gl_shader_set_uniform_matrix_3x4fv, vFppiip) GO(gst_gl_shader_set_uniform_matrix_4fv, vFppiip) -//GO(gst_gl_shader_set_uniform_matrix_4x2fv, +GO(gst_gl_shader_set_uniform_matrix_4x2fv, vFppiip) GO(gst_gl_shader_set_uniform_matrix_4x3fv, vFppiip) -//DATA(gst_gl_shader_string_fragment_default, -//DATA(gst_gl_shader_string_fragment_external_oes_default, -GO(gst_gl_shader_string_fragment_external_oes_get_default, pFpii) -GO(gst_gl_shader_string_fragment_get_default, pFpii) -DATA(gst_gl_shader_string_fragment_highp_precision, sizeof(void*)) -DATA(gst_gl_shader_string_fragment_mediump_precision, sizeof(void*)) -GO(gst_gl_shader_string_get_highest_precision, pFpii) -DATA(gst_gl_shader_string_vertex_default, sizeof(void*)) -DATA(gst_gl_shader_string_vertex_mat4_texture_transform, sizeof(void*)) -DATA(gst_gl_shader_string_vertex_mat4_vertex_transform, sizeof(void*)) +DATA(gst_gl_shader_string_fragment_default, 8) +DATA(gst_gl_shader_string_fragment_external_oes_default, 8) +GO(gst_gl_shader_string_fragment_external_oes_get_default, pFpui) +GO(gst_gl_shader_string_fragment_get_default, pFpui) +DATA(gst_gl_shader_string_fragment_highp_precision, 8) +DATA(gst_gl_shader_string_fragment_mediump_precision, 8) +GO(gst_gl_shader_string_get_highest_precision, pFpui) +DATA(gst_gl_shader_string_vertex_default, 8) +DATA(gst_gl_shader_string_vertex_mat4_texture_transform, 8) +DATA(gst_gl_shader_string_vertex_mat4_vertex_transform, 8) GO(gst_gl_shader_use, vFp) -//GO(gst_gl_sized_gl_format_from_gl_format_type, +GO(gst_gl_sized_gl_format_from_gl_format_type, uFpuu) GO(gst_glsl_error_get_type, LFv) -GO(gst_glsl_error_quark, pFv) +GO(gst_glsl_error_quark, uFv) GO(gst_glsl_profile_from_string, iFp) GO(gst_glsl_profile_get_type, LFv) GO(gst_glsl_profile_to_string, pFi) GO(gst_glsl_stage_compile, iFpp) -//GO(gst_glsl_stage_get_handle, -//GO(gst_glsl_stage_get_profile, -//GO(gst_glsl_stage_get_shader_type, +GO(gst_glsl_stage_get_handle, uFp) +GO(gst_glsl_stage_get_profile, iFp) +GO(gst_glsl_stage_get_shader_type, uFp) GO(gst_glsl_stage_get_type, LFv) -//GO(gst_glsl_stage_get_version, -//GO(gst_glsl_stage_new, +GO(gst_glsl_stage_get_version, uFp) +GO(gst_glsl_stage_new, pFpu) GO(gst_glsl_stage_new_default_fragment, pFp) GO(gst_glsl_stage_new_default_vertex, pFp) -GO(gst_glsl_stage_new_with_string, pFpuiip) -GO(gst_glsl_stage_new_with_strings, pFpuiiip) -//GO(gst_glsl_stage_set_strings, +GO(gst_glsl_stage_new_with_string, pFpuuip) +GO(gst_glsl_stage_new_with_strings, pFpuuiip) +GO(gst_glsl_stage_set_strings, iFpuiip) GO(gst_glsl_string_get_version_profile, iFppp) GO(gst_glsl_version_from_string, uFp) GO(gst_glsl_version_get_type, LFv) -//GO(gst_glsl_version_profile_from_string, +GO(gst_glsl_version_profile_from_string, iFppp) GO(gst_glsl_version_profile_to_string, pFui) GO(gst_glsl_version_to_string, pFu) GO(gst_gl_stereo_downmix_get_type, LFv) GO(gst_gl_stereo_downmix_mode_get_type, LFv) GO(gst_gl_sync_meta_api_get_type, LFv) -//GO(gst_gl_sync_meta_get_info, +GO(gst_gl_sync_meta_get_info, pFv) GO(gst_gl_sync_meta_set_sync_point, vFpp) GO(gst_gl_sync_meta_wait, vFpp) GO(gst_gl_sync_meta_wait_cpu, vFpp) @@ -336,7 +336,7 @@ GO(gst_gl_texture_target_from_string, uFp) GO(gst_gl_texture_target_get_type, LFv) GO(gst_gl_texture_target_to_buffer_pool_option, pFu) GO(gst_gl_texture_target_to_gl, uFu) -GO(gst_gl_texture_target_to_string, pFi) +GO(gst_gl_texture_target_to_string, pFu) GO(gst_gl_upload_get_caps, vFppp) GO(gst_gl_upload_get_input_template_caps, pFv) GO(gst_gl_upload_get_type, LFv) @@ -346,20 +346,20 @@ GO(gst_gl_upload_propose_allocation, vFppp) GO(gst_gl_upload_return_get_type, LFv) GO(gst_gl_upload_set_caps, iFppp) GO(gst_gl_upload_set_context, vFpp) -GO(gst_gl_upload_transform_caps, pFppipp) +GO(gst_gl_upload_transform_caps, pFppupp) GO(gst_gl_value_get_texture_target_mask, uFp) GO(gst_gl_value_set_texture_target, iFpu) -//GO(gst_gl_value_set_texture_target_from_mask, +GO(gst_gl_value_set_texture_target_from_mask, iFpu) GO(gst_gl_version_to_glsl_version, uFuii) -//GO(gst_gl_video_allocation_params_copy_data, -//GO(gst_gl_video_allocation_params_free_data, +GO(gst_gl_video_allocation_params_copy_data, vFpp) +GO(gst_gl_video_allocation_params_free_data, vFp) GO(gst_gl_video_allocation_params_get_type, LFv) -//GO(gst_gl_video_allocation_params_init_full, -GO(gst_gl_video_allocation_params_new, pFpppupii) -//GO(gst_gl_video_allocation_params_new_wrapped_data, -//GO(gst_gl_video_allocation_params_new_wrapped_gl_handle, -//GO(gst_gl_video_allocation_params_new_wrapped_texture, -GO(gst_gl_view_convert_fixate_caps, pFpipp) +//GOM(gst_gl_video_allocation_params_init_full, iFEpLupppppupuupppp) +GO(gst_gl_video_allocation_params_new, pFpppupuu) +//GOM(gst_gl_video_allocation_params_new_wrapped_data, pFEpppupuuppp) +//GOM(gst_gl_video_allocation_params_new_wrapped_gl_handle, pFEpppupuuppp) +//GOM(gst_gl_video_allocation_params_new_wrapped_texture, pFEpppupuuupp) +GO(gst_gl_view_convert_fixate_caps, pFpupp) GO(gst_gl_view_convert_get_output, iFpp) GO(gst_gl_view_convert_get_type, LFv) GO(gst_gl_view_convert_new, pFv) @@ -368,28 +368,28 @@ GO(gst_gl_view_convert_reset, vFp) GO(gst_gl_view_convert_set_caps, iFppp) GO(gst_gl_view_convert_set_context, vFpp) GO(gst_gl_view_convert_submit_input_buffer, iFpip) -GO(gst_gl_view_convert_transform_caps, pFpipp) +GO(gst_gl_view_convert_transform_caps, pFpupp) GO(gst_gl_window_controls_viewport, iFp) -GO(gst_gl_window_draw, iFp) +GO(gst_gl_window_draw, vFp) GO(gst_gl_window_error_get_type, LFv) -GO(gst_gl_window_error_quark, pFv) -//GO(gst_gl_window_get_context, -//GO(gst_gl_window_get_display, +GO(gst_gl_window_error_quark, uFv) +GO(gst_gl_window_get_context, pFp) +GO(gst_gl_window_get_display, LFp) GO(gst_gl_window_get_surface_dimensions, vFppp) GO(gst_gl_window_get_type, LFv) -//GO(gst_gl_window_get_window_handle, +GO(gst_gl_window_get_window_handle, LFp) GO(gst_gl_window_handle_events, vFpi) -//GO(gst_gl_window_has_output_surface, -//GO(gst_gl_window_new, +GO(gst_gl_window_has_output_surface, iFp) +GO(gst_gl_window_new, pFp) GO(gst_gl_window_queue_resize, vFp) -//GO(gst_gl_window_quit, -//GO(gst_gl_window_resize, -//GO(gst_gl_window_run, -//GO(gst_gl_window_send_key_event, +GO(gst_gl_window_quit, vFp) +GO(gst_gl_window_resize, vFpuu) +GO(gst_gl_window_run, vFp) +GO(gst_gl_window_send_key_event, vFppp) GOM(gst_gl_window_send_message, vFEppp) -//GO(gst_gl_window_send_message_async, -//GO(gst_gl_window_send_mouse_event, -//GO(gst_gl_window_send_scroll_event, +//GOM(gst_gl_window_send_message_async, vFEpppp) +GO(gst_gl_window_send_mouse_event, vFppidd) +GO(gst_gl_window_send_scroll_event, vFpdddd) GOM(gst_gl_window_set_close_callback, vFEpppp) GOM(gst_gl_window_set_draw_callback, vFEpppp) GO(gst_gl_window_set_preferred_size, vFpii) @@ -397,10 +397,10 @@ GO(gst_gl_window_set_render_rectangle, iFpiiii) GOM(gst_gl_window_set_resize_callback, vFEpppp) GO(gst_gl_window_set_window_handle, vFpL) GO(gst_gl_window_show, vFp) -//GO(gst_is_gl_base_memory, -//GO(gst_is_gl_buffer, -//GO(gst_is_gl_memory, -//GO(gst_is_gl_memory_egl, +GO(gst_is_gl_base_memory, iFp) +GO(gst_is_gl_buffer, iFp) +GO(gst_is_gl_memory, iFp) +GO(gst_is_gl_memory_egl, iFp) GO(gst_is_gl_memory_pbo, iFp) -//GO(gst_is_gl_renderbuffer, +GO(gst_is_gl_renderbuffer, iFp) diff --git a/src/wrapped/wrappedgstnet.c b/src/wrapped/wrappedgstnet.c index 53c09dc..6779b1e 100644 --- a/src/wrapped/wrappedgstnet.c +++ b/src/wrapped/wrappedgstnet.c @@ -12,16 +12,12 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* gstnetName = "libgstnet-1.0.so"; -#else - const char* gstnetName = "libgstnet-1.0.so.0"; -#endif +const char* gstnetName = "libgstnet-1.0.so.0"; +#define ALTNAME "libgstnet-1.0.so" #define LIBNAME gstnet -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstnet_private.h b/src/wrapped/wrappedgstnet_private.h index 03a500c..359215c 100644 --- a/src/wrapped/wrappedgstnet_private.h +++ b/src/wrapped/wrappedgstnet_private.h @@ -1,33 +1,33 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//GO(gst_buffer_add_net_address_meta, -//GO(gst_buffer_add_net_control_message_meta, -//GO(gst_buffer_get_net_address_meta, +GO(gst_buffer_add_net_address_meta, pFpp) +GO(gst_buffer_add_net_control_message_meta, pFpp) +GO(gst_buffer_get_net_address_meta, pFp) GO(gst_net_address_meta_api_get_type, LFv) -//GO(gst_net_address_meta_get_info, +GO(gst_net_address_meta_get_info, pFv) GO(gst_net_client_clock_get_type, LFv) -//GO(gst_net_client_clock_new, +GO(gst_net_client_clock_new, pFppiL) GO(gst_net_control_message_meta_api_get_type, LFv) -//GO(gst_net_control_message_meta_get_info, -//GO(gst_net_time_packet_copy, -//GO(gst_net_time_packet_free, +GO(gst_net_control_message_meta_get_info, pFv) +GO(gst_net_time_packet_copy, pFp) +GO(gst_net_time_packet_free, vFp) GO(gst_net_time_packet_get_type, LFv) -//GO(gst_net_time_packet_new, -//GO(gst_net_time_packet_receive, -//GO(gst_net_time_packet_send, -//GO(gst_net_time_packet_serialize, +GO(gst_net_time_packet_new, pFp) +GO(gst_net_time_packet_receive, pFppp) +GO(gst_net_time_packet_send, iFpppp) +GO(gst_net_time_packet_serialize, pFp) GO(gst_net_time_provider_get_type, LFv) -//GO(gst_net_time_provider_new, -//GO(gst_net_utils_set_socket_tos, +GO(gst_net_time_provider_new, pFppi) +GO(gst_net_utils_set_socket_tos, iFpi) GO(gst_ntp_clock_get_type, LFv) -//GO(gst_ntp_clock_new, +GO(gst_ntp_clock_new, pFppiL) GO(gst_ptp_clock_get_type, LFv) -//GO(gst_ptp_clock_new, -//GO(gst_ptp_deinit, -//GO(gst_ptp_init, -//GO(gst_ptp_is_initialized, -//GO(gst_ptp_is_supported, -//GO(gst_ptp_statistics_callback_add, -//GO(gst_ptp_statistics_callback_remove, +GO(gst_ptp_clock_new, pFpu) +GO(gst_ptp_deinit, vFv) +GO(gst_ptp_init, iFLp) +GO(gst_ptp_is_initialized, iFv) +GO(gst_ptp_is_supported, iFv) +//GOM(gst_ptp_statistics_callback_add, LFEppp) +GO(gst_ptp_statistics_callback_remove, vFL) diff --git a/src/wrapped/wrappedgstpbutils.c b/src/wrapped/wrappedgstpbutils.c index eaa2ee3..1e1f952 100644 --- a/src/wrapped/wrappedgstpbutils.c +++ b/src/wrapped/wrappedgstpbutils.c @@ -12,16 +12,12 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* gstpbutilsName = "libgstpbutils-1.0.so"; -#else - const char* gstpbutilsName = "libgstpbutils-1.0.so.0"; -#endif +const char* gstpbutilsName = "libgstpbutils-1.0.so.0"; +#define ALTNAME "libgstpbutils-1.0.so" #define LIBNAME gstpbutils -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstpbutils_private.h b/src/wrapped/wrappedgstpbutils_private.h index 3957627..32a51e6 100644 --- a/src/wrapped/wrappedgstpbutils_private.h +++ b/src/wrapped/wrappedgstpbutils_private.h @@ -1,195 +1,195 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(gst_audio_visualizer_get_type, LFv) GO(gst_audio_visualizer_shader_get_type, LFv) GO(gst_codec_utils_aac_caps_set_level_and_profile, iFppu) -//GO(gst_codec_utils_aac_get_channels, -//GO(gst_codec_utils_aac_get_index_from_sample_rate, -//GO(gst_codec_utils_aac_get_level, -//GO(gst_codec_utils_aac_get_profile, -//GO(gst_codec_utils_aac_get_sample_rate, -//GO(gst_codec_utils_aac_get_sample_rate_from_index, -//GO(gst_codec_utils_caps_from_mime_codec, -//GO(gst_codec_utils_caps_get_mime_codec, +GO(gst_codec_utils_aac_get_channels, uFpu) +GO(gst_codec_utils_aac_get_index_from_sample_rate, iFu) +GO(gst_codec_utils_aac_get_level, pFpu) +GO(gst_codec_utils_aac_get_profile, pFpu) +GO(gst_codec_utils_aac_get_sample_rate, uFpu) +GO(gst_codec_utils_aac_get_sample_rate_from_index, uFu) +GO(gst_codec_utils_caps_from_mime_codec, pFp) +GO(gst_codec_utils_caps_get_mime_codec, pFp) GO(gst_codec_utils_h264_caps_set_level_and_profile, iFppu) -//GO(gst_codec_utils_h264_get_level, -//GO(gst_codec_utils_h264_get_level_idc, -//GO(gst_codec_utils_h264_get_profile, -//GO(gst_codec_utils_h264_get_profile_flags_level, +GO(gst_codec_utils_h264_get_level, pFpu) +GO(gst_codec_utils_h264_get_level_idc, CFp) +GO(gst_codec_utils_h264_get_profile, pFpu) +GO(gst_codec_utils_h264_get_profile_flags_level, iFpuppp) GO(gst_codec_utils_h265_caps_set_level_tier_and_profile, iFppu) -//GO(gst_codec_utils_h265_get_level, -//GO(gst_codec_utils_h265_get_level_idc, -//GO(gst_codec_utils_h265_get_profile, -//GO(gst_codec_utils_h265_get_tier, +GO(gst_codec_utils_h265_get_level, pFpu) +GO(gst_codec_utils_h265_get_level_idc, CFp) +GO(gst_codec_utils_h265_get_profile, pFpu) +GO(gst_codec_utils_h265_get_tier, pFpu) GO(gst_codec_utils_mpeg4video_caps_set_level_and_profile, iFppu) -//GO(gst_codec_utils_mpeg4video_get_level, -//GO(gst_codec_utils_mpeg4video_get_profile, +GO(gst_codec_utils_mpeg4video_get_level, pFpu) +GO(gst_codec_utils_mpeg4video_get_profile, pFpu) GO(gst_codec_utils_opus_create_caps, pFuCCCCp) GO(gst_codec_utils_opus_create_caps_from_header, pFpp) GO(gst_codec_utils_opus_create_header, pFuCCCCpWw) GO(gst_codec_utils_opus_parse_caps, iFppppppp) -//GO(gst_codec_utils_opus_parse_header, -//GO(gst_discoverer_audio_info_get_bitrate, -//GO(gst_discoverer_audio_info_get_channel_mask, -//GO(gst_discoverer_audio_info_get_channels, -//GO(gst_discoverer_audio_info_get_depth, -//GO(gst_discoverer_audio_info_get_language, -//GO(gst_discoverer_audio_info_get_max_bitrate, -//GO(gst_discoverer_audio_info_get_sample_rate, +GO(gst_codec_utils_opus_parse_header, iFppppppppp) +GO(gst_discoverer_audio_info_get_bitrate, uFp) +GO(gst_discoverer_audio_info_get_channel_mask, LFp) +GO(gst_discoverer_audio_info_get_channels, uFp) +GO(gst_discoverer_audio_info_get_depth, uFp) +GO(gst_discoverer_audio_info_get_language, pFp) +GO(gst_discoverer_audio_info_get_max_bitrate, uFp) +GO(gst_discoverer_audio_info_get_sample_rate, uFp) GO(gst_discoverer_audio_info_get_type, LFv) -//GO(gst_discoverer_container_info_get_streams, -//GO(gst_discoverer_container_info_get_tags, +GO(gst_discoverer_container_info_get_streams, pFp) +GO(gst_discoverer_container_info_get_tags, pFp) GO(gst_discoverer_container_info_get_type, LFv) -//GO(gst_discoverer_discover_uri, -//GO(gst_discoverer_discover_uri_async, +GO(gst_discoverer_discover_uri, pFppp) +GO(gst_discoverer_discover_uri_async, iFpp) GO(gst_discoverer_get_type, LFv) -//GO(gst_discoverer_info_copy, -//GO(gst_discoverer_info_from_variant, -//GO(gst_discoverer_info_get_audio_streams, -//GO(gst_discoverer_info_get_container_streams, -//GO(gst_discoverer_info_get_duration, -//GO(gst_discoverer_info_get_live, -//GO(gst_discoverer_info_get_misc, -//GO(gst_discoverer_info_get_missing_elements_installer_details, -//GO(gst_discoverer_info_get_result, -//GO(gst_discoverer_info_get_seekable, -//GO(gst_discoverer_info_get_stream_info, -//GO(gst_discoverer_info_get_stream_list, -//GO(gst_discoverer_info_get_streams, -//GO(gst_discoverer_info_get_subtitle_streams, -//GO(gst_discoverer_info_get_tags, -//GO(gst_discoverer_info_get_toc, +GO(gst_discoverer_info_copy, pFp) +GO(gst_discoverer_info_from_variant, pFp) +GO(gst_discoverer_info_get_audio_streams, pFp) +GO(gst_discoverer_info_get_container_streams, pFp) +GO(gst_discoverer_info_get_duration, LFp) +GO(gst_discoverer_info_get_live, iFp) +GO(gst_discoverer_info_get_misc, pFp) +GO(gst_discoverer_info_get_missing_elements_installer_details, pFp) +GO(gst_discoverer_info_get_result, uFp) +GO(gst_discoverer_info_get_seekable, iFp) +GO(gst_discoverer_info_get_stream_info, pFp) +GO(gst_discoverer_info_get_stream_list, pFp) +GO(gst_discoverer_info_get_streams, pFpL) +GO(gst_discoverer_info_get_subtitle_streams, pFp) +GO(gst_discoverer_info_get_tags, pFp) +GO(gst_discoverer_info_get_toc, pFp) GO(gst_discoverer_info_get_type, LFv) -//GO(gst_discoverer_info_get_uri, -//GO(gst_discoverer_info_get_video_streams, -//GO(gst_discoverer_info_to_variant, -//GO(gst_discoverer_new, +GO(gst_discoverer_info_get_uri, pFp) +GO(gst_discoverer_info_get_video_streams, pFp) +GO(gst_discoverer_info_to_variant, pFpu) +GO(gst_discoverer_new, pFLp) GO(gst_discoverer_result_get_type, LFv) GO(gst_discoverer_serialize_flags_get_type, LFv) -//GO(gst_discoverer_start, -//GO(gst_discoverer_stop, -//GO(gst_discoverer_stream_info_get_caps, -//GO(gst_discoverer_stream_info_get_misc, -//GO(gst_discoverer_stream_info_get_next, -//GO(gst_discoverer_stream_info_get_previous, -//GO(gst_discoverer_stream_info_get_stream_id, -//GO(gst_discoverer_stream_info_get_stream_number, -//GO(gst_discoverer_stream_info_get_stream_type_nick, -//GO(gst_discoverer_stream_info_get_tags, -//GO(gst_discoverer_stream_info_get_toc, +GO(gst_discoverer_start, vFp) +GO(gst_discoverer_stop, vFp) +GO(gst_discoverer_stream_info_get_caps, pFp) +GO(gst_discoverer_stream_info_get_misc, pFp) +GO(gst_discoverer_stream_info_get_next, pFp) +GO(gst_discoverer_stream_info_get_previous, pFp) +GO(gst_discoverer_stream_info_get_stream_id, pFp) +GO(gst_discoverer_stream_info_get_stream_number, iFp) +GO(gst_discoverer_stream_info_get_stream_type_nick, pFp) +GO(gst_discoverer_stream_info_get_tags, pFp) +GO(gst_discoverer_stream_info_get_toc, pFp) GO(gst_discoverer_stream_info_get_type, LFv) -//GO(gst_discoverer_stream_info_list_free, -//GO(gst_discoverer_subtitle_info_get_language, +GO(gst_discoverer_stream_info_list_free, vFp) +GO(gst_discoverer_subtitle_info_get_language, pFp) GO(gst_discoverer_subtitle_info_get_type, LFv) -//GO(gst_discoverer_video_info_get_bitrate, -//GO(gst_discoverer_video_info_get_depth, -//GO(gst_discoverer_video_info_get_framerate_denom, -//GO(gst_discoverer_video_info_get_framerate_num, -//GO(gst_discoverer_video_info_get_height, -//GO(gst_discoverer_video_info_get_max_bitrate, -//GO(gst_discoverer_video_info_get_par_denom, -//GO(gst_discoverer_video_info_get_par_num, +GO(gst_discoverer_video_info_get_bitrate, uFp) +GO(gst_discoverer_video_info_get_depth, uFp) +GO(gst_discoverer_video_info_get_framerate_denom, uFp) +GO(gst_discoverer_video_info_get_framerate_num, uFp) +GO(gst_discoverer_video_info_get_height, uFp) +GO(gst_discoverer_video_info_get_max_bitrate, uFp) +GO(gst_discoverer_video_info_get_par_denom, uFp) +GO(gst_discoverer_video_info_get_par_num, uFp) GO(gst_discoverer_video_info_get_type, LFv) -//GO(gst_discoverer_video_info_get_width, -//GO(gst_discoverer_video_info_is_image, -//GO(gst_discoverer_video_info_is_interlaced, +GO(gst_discoverer_video_info_get_width, uFp) +GO(gst_discoverer_video_info_is_image, iFp) +GO(gst_discoverer_video_info_is_interlaced, iFp) GO(gst_encoding_audio_profile_get_type, LFv) -//GO(gst_encoding_audio_profile_new, -//GO(gst_encoding_container_profile_add_profile, -//GO(gst_encoding_container_profile_contains_profile, -//GO(gst_encoding_container_profile_get_profiles, +GO(gst_encoding_audio_profile_new, pFpppu) +GO(gst_encoding_container_profile_add_profile, iFpp) +GO(gst_encoding_container_profile_contains_profile, iFpp) +GO(gst_encoding_container_profile_get_profiles, pFp) GO(gst_encoding_container_profile_get_type, LFv) -//GO(gst_encoding_container_profile_new, -//GO(gst_encoding_list_all_targets, -//GO(gst_encoding_list_available_categories, -//GO(gst_encoding_profile_copy, -//GO(gst_encoding_profile_find, -//GO(gst_encoding_profile_from_discoverer, -//GO(gst_encoding_profile_get_allow_dynamic_output, -//GO(gst_encoding_profile_get_description, -//GO(gst_encoding_profile_get_element_properties, -//GO(gst_encoding_profile_get_file_extension, -//GO(gst_encoding_profile_get_format, -//GO(gst_encoding_profile_get_input_caps, -//GO(gst_encoding_profile_get_name, -//GO(gst_encoding_profile_get_presence, -//GO(gst_encoding_profile_get_preset, -//GO(gst_encoding_profile_get_preset_name, -//GO(gst_encoding_profile_get_restriction, -//GO(gst_encoding_profile_get_single_segment, +GO(gst_encoding_container_profile_new, pFpppp) +GO(gst_encoding_list_all_targets, pFp) +GO(gst_encoding_list_available_categories, pFv) +GO(gst_encoding_profile_copy, pFp) +GO(gst_encoding_profile_find, pFppp) +GO(gst_encoding_profile_from_discoverer, pFp) +GO(gst_encoding_profile_get_allow_dynamic_output, iFp) +GO(gst_encoding_profile_get_description, pFp) +GO(gst_encoding_profile_get_element_properties, pFp) +GO(gst_encoding_profile_get_file_extension, pFp) +GO(gst_encoding_profile_get_format, pFp) +GO(gst_encoding_profile_get_input_caps, pFp) +GO(gst_encoding_profile_get_name, pFp) +GO(gst_encoding_profile_get_presence, uFp) +GO(gst_encoding_profile_get_preset, pFp) +GO(gst_encoding_profile_get_preset_name, pFp) +GO(gst_encoding_profile_get_restriction, pFp) +GO(gst_encoding_profile_get_single_segment, iFp) GO(gst_encoding_profile_get_type, LFv) -//GO(gst_encoding_profile_get_type_nick, -//GO(gst_encoding_profile_is_enabled, -//GO(gst_encoding_profile_is_equal, -//GO(gst_encoding_profile_set_allow_dynamic_output, -//GO(gst_encoding_profile_set_description, -//GO(gst_encoding_profile_set_element_properties, -//GO(gst_encoding_profile_set_enabled, -//GO(gst_encoding_profile_set_format, -//GO(gst_encoding_profile_set_name, -//GO(gst_encoding_profile_set_presence, -//GO(gst_encoding_profile_set_preset, -//GO(gst_encoding_profile_set_preset_name, -//GO(gst_encoding_profile_set_restriction, -//GO(gst_encoding_profile_set_single_segment, -//GO(gst_encoding_target_add_profile, -//GO(gst_encoding_target_get_category, -//GO(gst_encoding_target_get_description, -//GO(gst_encoding_target_get_name, -//GO(gst_encoding_target_get_path, -//GO(gst_encoding_target_get_profile, -//GO(gst_encoding_target_get_profiles, +GO(gst_encoding_profile_get_type_nick, pFp) +GO(gst_encoding_profile_is_enabled, iFp) +GO(gst_encoding_profile_is_equal, iFpp) +GO(gst_encoding_profile_set_allow_dynamic_output, vFpi) +GO(gst_encoding_profile_set_description, vFpp) +GO(gst_encoding_profile_set_element_properties, vFpp) +GO(gst_encoding_profile_set_enabled, vFpi) +GO(gst_encoding_profile_set_format, vFpp) +GO(gst_encoding_profile_set_name, vFpp) +GO(gst_encoding_profile_set_presence, vFpu) +GO(gst_encoding_profile_set_preset, vFpp) +GO(gst_encoding_profile_set_preset_name, vFpp) +GO(gst_encoding_profile_set_restriction, vFpp) +GO(gst_encoding_profile_set_single_segment, vFpi) +GO(gst_encoding_target_add_profile, iFpp) +GO(gst_encoding_target_get_category, pFp) +GO(gst_encoding_target_get_description, pFp) +GO(gst_encoding_target_get_name, pFp) +GO(gst_encoding_target_get_path, pFp) +GO(gst_encoding_target_get_profile, pFpp) +GO(gst_encoding_target_get_profiles, pFp) GO(gst_encoding_target_get_type, LFv) -//GO(gst_encoding_target_load, -//GO(gst_encoding_target_load_from_file, -//GO(gst_encoding_target_new, -//GO(gst_encoding_target_save, -//GO(gst_encoding_target_save_to_file, -//GO(gst_encoding_video_profile_get_pass, +GO(gst_encoding_target_load, pFppp) +GO(gst_encoding_target_load_from_file, pFpp) +GO(gst_encoding_target_new, pFpppp) +GO(gst_encoding_target_save, iFpp) +GO(gst_encoding_target_save_to_file, iFppp) +GO(gst_encoding_video_profile_get_pass, uFp) GO(gst_encoding_video_profile_get_type, LFv) -//GO(gst_encoding_video_profile_get_variableframerate, -//GO(gst_encoding_video_profile_new, -//GO(gst_encoding_video_profile_set_pass, -//GO(gst_encoding_video_profile_set_variableframerate, -//GO(gst_install_plugins_async, -//GO(gst_install_plugins_context_copy, -//GO(gst_install_plugins_context_free, +GO(gst_encoding_video_profile_get_variableframerate, iFp) +GO(gst_encoding_video_profile_new, pFpppu) +GO(gst_encoding_video_profile_set_pass, vFpu) +GO(gst_encoding_video_profile_set_variableframerate, vFpi) +//GOM(gst_install_plugins_async, uFEpppp) +GO(gst_install_plugins_context_copy, pFp) +GO(gst_install_plugins_context_free, vFp) GO(gst_install_plugins_context_get_type, LFv) -//GO(gst_install_plugins_context_new, -//GO(gst_install_plugins_context_set_confirm_search, -//GO(gst_install_plugins_context_set_desktop_id, -//GO(gst_install_plugins_context_set_startup_notification_id, -//GO(gst_install_plugins_context_set_xid, -//GO(gst_install_plugins_installation_in_progress, -//GO(gst_install_plugins_return_get_name, +GO(gst_install_plugins_context_new, pFv) +GO(gst_install_plugins_context_set_confirm_search, vFpi) +GO(gst_install_plugins_context_set_desktop_id, vFpp) +GO(gst_install_plugins_context_set_startup_notification_id, vFpp) +GO(gst_install_plugins_context_set_xid, vFpu) +GO(gst_install_plugins_installation_in_progress, iFv) +GO(gst_install_plugins_return_get_name, pFu) GO(gst_install_plugins_return_get_type, LFv) -//GO(gst_install_plugins_supported, -//GO(gst_install_plugins_sync, -//GO(gst_is_missing_plugin_message, -//GO(gst_missing_decoder_installer_detail_new, -//GO(gst_missing_decoder_message_new, -//GO(gst_missing_element_installer_detail_new, -//GO(gst_missing_element_message_new, -//GO(gst_missing_encoder_installer_detail_new, -//GO(gst_missing_encoder_message_new, -//GO(gst_missing_plugin_message_get_description, -//GO(gst_missing_plugin_message_get_installer_detail, -//GO(gst_missing_uri_sink_installer_detail_new, -//GO(gst_missing_uri_sink_message_new, -//GO(gst_missing_uri_source_installer_detail_new, -//GO(gst_missing_uri_source_message_new, +GO(gst_install_plugins_supported, iFv) +GO(gst_install_plugins_sync, uFpp) +GO(gst_is_missing_plugin_message, iFp) +GO(gst_missing_decoder_installer_detail_new, pFp) +GO(gst_missing_decoder_message_new, pFpp) +GO(gst_missing_element_installer_detail_new, pFp) +GO(gst_missing_element_message_new, pFpp) +GO(gst_missing_encoder_installer_detail_new, pFp) +GO(gst_missing_encoder_message_new, pFpp) +GO(gst_missing_plugin_message_get_description, pFp) +GO(gst_missing_plugin_message_get_installer_detail, pFp) +GO(gst_missing_uri_sink_installer_detail_new, pFp) +GO(gst_missing_uri_sink_message_new, pFpp) +GO(gst_missing_uri_source_installer_detail_new, pFp) +GO(gst_missing_uri_source_message_new, pFpp) GO(gst_pb_utils_add_codec_description_to_tag_list, iFppp) GO(gst_pb_utils_caps_description_flags_get_type, LFv) -//GO(gst_pb_utils_get_caps_description_flags, +GO(gst_pb_utils_get_caps_description_flags, uFp) GO(gst_pb_utils_get_codec_description, pFp) -//GO(gst_pb_utils_get_decoder_description, -//GO(gst_pb_utils_get_element_description, -//GO(gst_pb_utils_get_encoder_description, -//GO(gst_pb_utils_get_file_extension_from_caps, -//GO(gst_pb_utils_get_sink_description, -//GO(gst_pb_utils_get_source_description, +GO(gst_pb_utils_get_decoder_description, pFp) +GO(gst_pb_utils_get_element_description, pFp) +GO(gst_pb_utils_get_encoder_description, pFp) +GO(gst_pb_utils_get_file_extension_from_caps, pFp) +GO(gst_pb_utils_get_sink_description, pFp) +GO(gst_pb_utils_get_source_description, pFp) GO(gst_pb_utils_init, vFv) -//GO(gst_plugins_base_version, -//GO(gst_plugins_base_version_string, +GO(gst_plugins_base_version, vFpppp) +GO(gst_plugins_base_version_string, pFv) diff --git a/src/wrapped/wrappedgstreamer.c b/src/wrapped/wrappedgstreamer.c index 16fcc74..e51a93d 100644 --- a/src/wrapped/wrappedgstreamer.c +++ b/src/wrapped/wrappedgstreamer.c @@ -21,11 +21,9 @@ #include "gtkclass.h" #include "fileutils.h" -#ifdef ANDROID - const char* gstreamerName = "libgstreamer-1.0.so"; -#else - const char* gstreamerName = "libgstreamer-1.0.so.0"; -#endif +const char* gstreamerName = "libgstreamer-1.0.so.0"; +#define ALTNAME "libgstreamer-1.0.so" + #define LIBNAME gstreamer typedef void (*vFv_t)(); @@ -35,6 +33,7 @@ typedef size_t (*LFv_t)(); typedef void* (*pFp_t)(void*); typedef void (*vFpp_t)(void*, void*); typedef int (*iFpp_t)(void*, void*); +typedef void (*vFpip_t)(void*, int, void*); void* my_dlopen(x64emu_t* emu, void *filename, int flag); int my_dlclose(x64emu_t* emu, void *handle); @@ -52,12 +51,14 @@ void* my_dlsym(x64emu_t* emu, void *handle, void *symbol); GO(gst_bin_get_type, LFv_t) \ GO(gst_pad_get_type, LFv_t) \ GO(gst_uri_handler_get_type, LFv_t) \ + GO(gst_buffer_pool_get_type, LFv_t) \ GO(gst_structure_new_empty, pFp_t) \ GO(gst_caps_new_empty, pFv_t) \ GO(gst_caps_replace, iFpp_t) \ GO(gst_caps_append_structure, vFpp_t) \ GO(gst_bin_add, iFpp_t) \ GO(gst_element_link, iFpp_t) \ + GO(gst_query_set_formatsv, vFpip_t) \ typedef struct my_gst_plugin_s { void* handle; @@ -363,6 +364,27 @@ static void* findGstIteratorFoldFunctionFct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstIteratorFoldFunction callback\n"); return NULL; } +//GCompareFunc +#define GO(A) \ +static uintptr_t my_GCompareFunc_fct_##A = 0; \ +static int my_GCompareFunc_##A(void* a, void* b) \ +{ \ + return (int)RunFunctionFmt(my_GCompareFunc_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* findGCompareFuncFct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(my_GCompareFunc_fct_##A == (uintptr_t)fct) return my_GCompareFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_GCompareFunc_fct_##A == 0) {my_GCompareFunc_fct_##A = (uintptr_t)fct; return my_GCompareFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstreamer GCompareFunc callback\n"); + return NULL; +} //GCompareDataFunc #define GO(A) \ static uintptr_t my_GCompareDataFunc_fct_##A = 0; \ @@ -656,6 +678,236 @@ static void* findGstBufferForeachMetaFuncFct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstBufferForeachMetaFunc callback\n"); return NULL; } +//GstMiniObjectCopyFunction +#define GO(A) \ +static uintptr_t my_GstMiniObjectCopyFunction_fct_##A = 0; \ +static void* my_GstMiniObjectCopyFunction_##A(void* a) \ +{ \ + return (void*)RunFunctionFmt(my_GstMiniObjectCopyFunction_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findGstMiniObjectCopyFunctionFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_GstMiniObjectCopyFunction_fct_##A == (uintptr_t)fct) return my_GstMiniObjectCopyFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstMiniObjectCopyFunction_fct_##A == 0) {my_GstMiniObjectCopyFunction_fct_##A = (uintptr_t)fct; return my_GstMiniObjectCopyFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstMiniObjectCopyFunction callback\n"); + return NULL; +} +//GstMiniObjectDisposeFunction +#define GO(A) \ +static uintptr_t my_GstMiniObjectDisposeFunction_fct_##A = 0; \ +static int my_GstMiniObjectDisposeFunction_##A(void* a) \ +{ \ + return (int)RunFunctionFmt(my_GstMiniObjectDisposeFunction_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findGstMiniObjectDisposeFunctionFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_GstMiniObjectDisposeFunction_fct_##A == (uintptr_t)fct) return my_GstMiniObjectDisposeFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstMiniObjectDisposeFunction_fct_##A == 0) {my_GstMiniObjectDisposeFunction_fct_##A = (uintptr_t)fct; return my_GstMiniObjectDisposeFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstMiniObjectDisposeFunction callback\n"); + return NULL; +} +//GstMiniObjectFreeFunction +#define GO(A) \ +static uintptr_t my_GstMiniObjectFreeFunction_fct_##A = 0; \ +static void my_GstMiniObjectFreeFunction_##A(void* a) \ +{ \ + RunFunctionFmt(my_GstMiniObjectFreeFunction_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findGstMiniObjectFreeFunctionFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_GstMiniObjectFreeFunction_fct_##A == (uintptr_t)fct) return my_GstMiniObjectFreeFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstMiniObjectFreeFunction_fct_##A == 0) {my_GstMiniObjectFreeFunction_fct_##A = (uintptr_t)fct; return my_GstMiniObjectFreeFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstMiniObjectFreeFunction callback\n"); + return NULL; +} +//GstClockCallback +#define GO(A) \ +static uintptr_t my_GstClockCallback_fct_##A = 0; \ +static int my_GstClockCallback_##A(void* a, uint64_t b, void* c, void* d) \ +{ \ + return (int)RunFunctionFmt(my_GstClockCallback_fct_##A, "pUpp", a, b, c, d); \ +} +SUPER() +#undef GO +static void* findGstClockCallbackFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_GstClockCallback_fct_##A == (uintptr_t)fct) return my_GstClockCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstClockCallback_fct_##A == 0) {my_GstClockCallback_fct_##A = (uintptr_t)fct; return my_GstClockCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstClockCallback callback\n"); + return NULL; +} +//GstPadChainListFunction +#define GO(A) \ +static uintptr_t my_GstPadChainListFunction_fct_##A = 0; \ +static int my_GstPadChainListFunction_##A(void* a, void* b, void* c) \ +{ \ + return (int)RunFunctionFmt(my_GstPadChainListFunction_fct_##A, "ppp", a, b, c); \ +} +SUPER() +#undef GO +static void* findGstPadChainListFunctionFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_GstPadChainListFunction_fct_##A == (uintptr_t)fct) return my_GstPadChainListFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstPadChainListFunction_fct_##A == 0) {my_GstPadChainListFunction_fct_##A = (uintptr_t)fct; return my_GstPadChainListFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstPadChainListFunction callback\n"); + return NULL; +} +//GstCapsMapFunc +#define GO(A) \ +static uintptr_t my_GstCapsMapFunc_fct_##A = 0; \ +static int my_GstCapsMapFunc_##A(void* a, void* b, void* c) \ +{ \ + return (int)RunFunctionFmt(my_GstCapsMapFunc_fct_##A, "ppp", a, b, c); \ +} +SUPER() +#undef GO +static void* findGstCapsMapFuncFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_GstCapsMapFunc_fct_##A == (uintptr_t)fct) return my_GstCapsMapFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstCapsMapFunc_fct_##A == 0) {my_GstCapsMapFunc_fct_##A = (uintptr_t)fct; return my_GstCapsMapFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstCapsMapFunc callback\n"); + return NULL; +} +//GstTagMergeFunc +#define GO(A) \ +static uintptr_t my_GstTagMergeFunc_fct_##A = 0; \ +static void my_GstTagMergeFunc_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_GstTagMergeFunc_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* findGstTagMergeFuncFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_GstTagMergeFunc_fct_##A == (uintptr_t)fct) return my_GstTagMergeFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstTagMergeFunc_fct_##A == 0) {my_GstTagMergeFunc_fct_##A = (uintptr_t)fct; return my_GstTagMergeFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstTagMergeFunc callback\n"); + return NULL; +} +//GstIteratorForeachFunction +#define GO(A) \ +static uintptr_t my_GstIteratorForeachFunction_fct_##A = 0; \ +static void my_GstIteratorForeachFunction_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_GstIteratorForeachFunction_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* findGstIteratorForeachFunctionFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_GstIteratorForeachFunction_fct_##A == (uintptr_t)fct) return my_GstIteratorForeachFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstIteratorForeachFunction_fct_##A == 0) {my_GstIteratorForeachFunction_fct_##A = (uintptr_t)fct; return my_GstIteratorForeachFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstIteratorForeachFunction callback\n"); + return NULL; +} +//GstPadEventFullFunction +#define GO(A) \ +static uintptr_t my_GstPadEventFullFunction_fct_##A = 0; \ +static int my_GstPadEventFullFunction_##A(void* a, void* b, void* c) \ +{ \ + return (int)RunFunctionFmt(my_GstPadEventFullFunction_fct_##A, "ppp", a, b, c); \ +} +SUPER() +#undef GO +static void* findGstPadEventFullFunctionFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_GstPadEventFullFunction_fct_##A == (uintptr_t)fct) return my_GstPadEventFullFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstPadEventFullFunction_fct_##A == 0) {my_GstPadEventFullFunction_fct_##A = (uintptr_t)fct; return my_GstPadEventFullFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstPadEventFullFunction callback\n"); + return NULL; +} +//GstBufferListFunc +#define GO(A) \ +static uintptr_t my_GstBufferListFunc_fct_##A = 0; \ +static int my_GstBufferListFunc_##A(void* a, uint32_t b, void* c) \ +{ \ + return (int)RunFunctionFmt(my_GstBufferListFunc_fct_##A, "pup", a, b, c); \ +} +SUPER() +#undef GO +static void* findGstBufferListFuncFct(void* fct) +{ + if(!fct) return fct; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_GstBufferListFunc_fct_##A == (uintptr_t)fct) return my_GstBufferListFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_GstBufferListFunc_fct_##A == 0) {my_GstBufferListFunc_fct_##A = (uintptr_t)fct; return my_GstBufferListFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gstreamer GstBufferListFunc callback\n"); + return NULL; +} #undef SUPER @@ -689,14 +941,14 @@ EXPORT void my_gst_structure_remove_fields_valist(x64emu_t* emu, void* structure my->gst_structure_remove_fields_valist(structure, field, VARARGS); } -EXPORT void my_gst_debug_log(x64emu_t* emu, void* cat, int level, void* file, void* func, int line, void* obj, void* fmt, void* b) { +EXPORT void my_gst_debug_log(x64emu_t* emu, void* cat, uint32_t level, void* file, void* func, int line, void* obj, void* fmt, void* b) { myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 7); PREPARE_VALIST; my->gst_debug_log_valist(cat, level, file, func, line, obj, fmt, VARARGS); } -EXPORT void my_gst_debug_log_valist(x64emu_t* emu, void* cat, int level, void* file, void* func, int line, void* obj, void* fmt, x64_va_list_t V) { +EXPORT void my_gst_debug_log_valist(x64emu_t* emu, void* cat, uint32_t level, void* file, void* func, int line, void* obj, void* fmt, x64_va_list_t V) { #ifdef CONVERT_VALIST CONVERT_VALIST(V); @@ -766,7 +1018,7 @@ EXPORT void* my_gst_structure_new(x64emu_t* emu, void* name, void* first, uint64 return my->gst_structure_new_valist(name, first, VARARGS); } -EXPORT void my_gst_mini_object_set_qdata(x64emu_t* emu, void* object, void* quark, void* data, void* d) +EXPORT void my_gst_mini_object_set_qdata(x64emu_t* emu, void* object, uint32_t quark, void* data, void* d) { my->gst_mini_object_set_qdata(object, quark, data, findDestroyFct(d)); } @@ -836,7 +1088,7 @@ EXPORT void* my_gst_plugin_load_file(x64emu_t* emu, const char* filename, void** static void register_plugins_from_folder(x64emu_t* emu, const char* folder) { if(!folder) { - printf_log(/*LOG_DEBUG*/LOG_INFO, "BOX64 didn't detect any custom gstreamer-1.0 folder"); + printf_log(/*LOG_DEBUG*/ LOG_INFO, "BOX64 didn't detect any custom gstreamer-1.0 folder\n"); return; } DIR *d; @@ -849,7 +1101,7 @@ static void register_plugins_from_folder(x64emu_t* emu, const char* folder) char* p = strrchr(native_folder, '/'); *p = '\0'; strcat(native_folder, "/gstreamer-1.0/"); - printf_log(/*LOG_DEBUG*/LOG_INFO, "BOX64 Will look for native gstreamer plugin in %s", native_folder); + printf_log(/*LOG_DEBUG*/ LOG_INFO, "BOX64 Will look for native gstreamer plugin in %s\n", native_folder); } d = opendir(folder); if(!d) @@ -867,7 +1119,7 @@ static void register_plugins_from_folder(x64emu_t* emu, const char* folder) *strrchr(name, '.') = '\0'; snprintf(regfunc_name, sizeof(regfunc_name), "gst_plugin_%s_register", name); // check if native version exist - if(native_folder[0]) { + if(native_folder[0] && !FindInCollection(dir->d_name, &my_context->box64_emulated_libs)) { strcpy(filename, native_folder); strcat(filename, dir->d_name); handle = dlopen(filename, 2); @@ -882,7 +1134,7 @@ static void register_plugins_from_folder(x64emu_t* emu, const char* folder) } void* f_init = handle?(is_native?dlsym(handle, regfunc_name):my_dlsym(emu, handle, regfunc_name)):NULL; if(f_init) { - printf_log(LOG_DEBUG, "BOX64: Will registering %sgstplugin %s\n", is_native?"native ":"", filename); + printf_log(LOG_DEBUG, "Will registering %sgstplugin %s\n", is_native?"native ":"", filename); if(is_native) ((vFv_t)(f_init))(); else @@ -894,7 +1146,7 @@ static void register_plugins_from_folder(x64emu_t* emu, const char* folder) my->plugins[my->plugin_cnt].is_native = is_native; my->plugins[my->plugin_cnt++].handle = handle; } else { - printf_log(LOG_DEBUG, "BOX64: Failled to register %sgstplugin %s, name=%s, handle=%p\n", is_native?"native ":"", filename, name, handle); + printf_log(LOG_DEBUG, "Failled to register %sgstplugin %s, name=%s, handle=%p\n", is_native?"native ":"", filename, name, handle); } if(handle && !f_init) { is_native?dlclose(handle):my_dlclose(emu, handle); @@ -960,12 +1212,12 @@ EXPORT void my_gst_structure_set(x64emu_t* emu, void* st, void* fieldname, uintp my->gst_structure_set_valist(st, fieldname, VARARGS); } -EXPORT int my_gst_iterator_fold(x64emu_t* emu, void* it, void* f, void* ret, void* data) +EXPORT uint32_t my_gst_iterator_fold(x64emu_t* emu, void* it, void* f, void* ret, void* data) { return my->gst_iterator_fold(it, findGstIteratorFoldFunctionFct(f), ret, data); } -EXPORT void* my_gst_util_array_binary_search(x64emu_t* emu, void* array, uint32_t num, size_t size, void* f, int mode, void* search, void* data) +EXPORT void* my_gst_util_array_binary_search(x64emu_t* emu, void* array, uint32_t num, size_t size, void* f, uint32_t mode, void* search, void* data) { return my->gst_util_array_binary_search(array, num, size, findGCompareDataFuncFct(f), mode, search, data); } @@ -998,7 +1250,7 @@ EXPORT void my_gst_tag_list_foreach(x64emu_t* emu, void* list, void* f, void* da my->gst_tag_list_foreach(list, findGstTagForeachFuncFct(f), data); } -EXPORT void* my_gst_memory_new_wrapped(x64emu_t* emu, int flags, void* data, size_t maxsz, size_t offset, size_t size, void* user_data, void* d) +EXPORT void* my_gst_memory_new_wrapped(x64emu_t* emu, uint32_t flags, void* data, size_t maxsz, size_t offset, size_t size, void* user_data, void* d) { return my->gst_memory_new_wrapped(flags, data, maxsz, offset, size, user_data, findDestroyFct(d)); } @@ -1019,6 +1271,23 @@ EXPORT void* my_gst_pad_create_stream_id_printf(x64emu_t* emu, void* pad, void* return my->gst_pad_create_stream_id_printf_valist(pad, parent, id, VARARGS); } +EXPORT void* my_gst_caps_features_new_id_valist(x64emu_t* emu, uint32_t id, x64_va_list_t V) +{ + #ifdef CONVERT_VALIST + CONVERT_VALIST(V); + #else + CREATE_VALIST_FROM_VALIST(V, emu->scratch); + #endif + return my->gst_caps_features_new_id_valist(id, VARARGS); +} + +EXPORT void* my_gst_caps_features_new_id(x64emu_t* emu, uint32_t id, uintptr_t* b) +{ + CREATE_VALIST_FROM_VAARG(b, emu->scratch, 1); + return my->gst_caps_features_new_id_valist(id, VARARGS); +} + + EXPORT void my_gst_pad_set_activate_function_full(x64emu_t* emu, void* pad, void* f, void* data, void* d) { my->gst_pad_set_activate_function_full(pad, findGstPadActivateFunctionFct(f), data, findDestroyFct(d)); @@ -1072,7 +1341,7 @@ EXPORT void* my_gst_caps_features_new(x64emu_t* emu, void* feat1, uintptr_t* b) return my->gst_caps_features_new_valist(feat1, VARARGS); } -EXPORT unsigned long my_gst_pad_add_probe(x64emu_t* emu, void* pad, int mask, void* f, void* data, void* d) +EXPORT unsigned long my_gst_pad_add_probe(x64emu_t* emu, void* pad, uint32_t mask, void* f, void* data, void* d) { return my->gst_pad_add_probe(pad, mask, findGstPadProbeCallbackFct(f), data, findDestroyFct(d)); } @@ -1138,9 +1407,77 @@ EXPORT int my_gst_buffer_foreach_meta(x64emu_t* emu, void* buff, void* f, void* return my->gst_buffer_foreach_meta(buff, findGstBufferForeachMetaFuncFct(f), data); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +EXPORT void my_gst_mini_object_init(x64emu_t* emu, void* obj, uint32_t flags, size_t type, void* copy_f, void* disp_f, void* free_f) +{ + my->gst_mini_object_init(obj, flags, type, findGstMiniObjectCopyFunctionFct(copy_f), findGstMiniObjectDisposeFunctionFct(disp_f), findGstMiniObjectFreeFunctionFct(free_f)); +} + +EXPORT int my_gst_iterator_find_custom(x64emu_t* emu, void* it, void* f, void* elem, void* data) +{ + return my->gst_iterator_find_custom(it, findGCompareFuncFct(f), elem, data); +} + +EXPORT int my_gst_clock_id_wait_async(x64emu_t* emu, void* id, void* f, void* data, void* d) +{ + return my->gst_clock_id_wait_async(id, findGstClockCallbackFct(f), data, findDestroyFct(d)); +} + +EXPORT void my_gst_pad_set_chain_list_function_full(x64emu_t* emu, void* pad, void *f, void* data, void* d) +{ + return my->gst_pad_set_chain_list_function_full(pad, findGstPadChainListFunctionFct(f), data, findDestroyFct(d)); +} + +EXPORT int my_gst_caps_map_in_place(x64emu_t* emu, void* caps, void* f, void* data) +{ + return my->gst_caps_map_in_place(caps, findGstCapsMapFuncFct(f), data); +} + +EXPORT void my_gst_tag_register(x64emu_t* emu, void* name, uint32_t flag, size_t type, void* nick, void* blurb, void* f) +{ + my->gst_tag_register(name, flag, type, nick, blurb, findGstTagMergeFuncFct(f)); +} + +EXPORT uint32_t my_gst_iterator_foreach(x64emu_t* emu, void* it, void* f, void* data) +{ + return my->gst_iterator_foreach(it, findGstIteratorForeachFunctionFct(f), data); +} + +EXPORT void my_gst_pad_set_event_full_function_full(x64emu_t* emu, void* pad, void* f, void* data, void* d) +{ + my->gst_pad_set_event_full_function_full(pad, findGstPadEventFullFunctionFct(f), data, findDestroyFct(d)); +} + +EXPORT int my_gst_buffer_list_foreach(x64emu_t* emu, void* list, void* f, void* data) +{ + return my->gst_buffer_list_foreach(list, findGstBufferListFuncFct(f), data); +} + +EXPORT void my_gst_query_set_formats(x64emu_t* emu, void* query, int n, uint64_t* b) +{ + uint32_t a[n]; + for(int i=0; igst_query_set_formatsv(query, n, a); +} + +EXPORT void my_gst_debug_log_id_valist(x64emu_t* emu, void* cat, uint32_t level, void* f, void* func, int l, void* id, void* fmt, x64_va_list_t V) +{ + #ifdef CONVERT_VALIST + CONVERT_VALIST(V); + #else + CREATE_VALIST_FROM_VALIST(V, emu->scratch); + #endif + my->gst_debug_log_id_valist(cat, level, f, func, l, id, fmt, VARARGS); +} + +EXPORT void my_gst_debug_log_id(x64emu_t* emu, void* cat, uint32_t level, void* f, void* func, int l, void* id, void* fmt, void* b) +{ + CREATE_VALIST_FROM_VAARG(b, emu->scratch, 7); + my->gst_debug_log_id_valist(cat, level, f, func, l, id, fmt, VARARGS); +} + +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define CUSTOM_INIT \ SetGstObjectID(my->gst_object_get_type()); \ @@ -1149,12 +1486,9 @@ EXPORT int my_gst_buffer_foreach_meta(x64emu_t* emu, void* buff, void* f, void* SetGstElementID(my->gst_element_get_type()); \ SetGstBinID(my->gst_bin_get_type()); \ SetGstPadID(my->gst_pad_get_type()); \ - SetGstURIHandlerID(my->gst_uri_handler_get_type()); + SetGstURIHandlerID(my->gst_uri_handler_get_type()); \ + SetGstBufferPoolID(my->gst_buffer_pool_get_type()); \ -#ifdef ANDROID -#define NEEDED_LIBS "libgtk-3.so" -#else #define NEEDED_LIBS "libgtk-3.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstreamer_private.h b/src/wrapped/wrappedgstreamer_private.h index 46bcc95..3126e68 100644 --- a/src/wrapped/wrappedgstreamer_private.h +++ b/src/wrapped/wrappedgstreamer_private.h @@ -1,19 +1,19 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(gst_allocation_params_copy, pFp) -//GO(gst_allocation_params_free, -//GO(gst_allocation_params_get_type, +GO(gst_allocation_params_free, vFp) +GO(gst_allocation_params_get_type, LFv) GO(gst_allocation_params_init, vFp) GO(gst_allocator_alloc, pFpLp) GO(gst_allocator_find, pFp) -//GO(gst_allocator_flags_get_type, -//GO(gst_allocator_free, +GO(gst_allocator_flags_get_type, LFv) +GO(gst_allocator_free, vFpp) GO(gst_allocator_get_type, LFv) -//GO(gst_allocator_register, -//GO(gst_allocator_set_default, -//GO(gst_atomic_queue_get_type, +GO(gst_allocator_register, vFpp) +GO(gst_allocator_set_default, vFp) +GO(gst_atomic_queue_get_type, LFv) GO(gst_atomic_queue_length, uFp) GO(gst_atomic_queue_new, pFu) GO(gst_atomic_queue_peek, pFp) @@ -23,7 +23,7 @@ GO(gst_atomic_queue_ref, vFp) GO(gst_atomic_queue_unref, vFp) GO(gst_bin_add, iFpp) GOM(gst_bin_add_many, vFEppV) -GO(gst_bin_find_unlinked_pad, pFpi) +GO(gst_bin_find_unlinked_pad, pFpu) GO(gst_bin_flags_get_type, LFv) GO(gst_bin_get_by_interface, pFpL) GO(gst_bin_get_by_name, pFpp) @@ -31,7 +31,7 @@ GO(gst_bin_get_by_name_recurse_up, pFpp) GO(gst_bin_get_suppressed_flags, uFp) GO(gst_bin_get_type, LFv) GO(gst_bin_iterate_all_by_element_factory_name, pFpp) -GO(gst_bin_iterate_all_by_interface, pFpp) +GO(gst_bin_iterate_all_by_interface, pFpL) GO(gst_bin_iterate_elements, pFp) GO(gst_bin_iterate_recurse, pFp) GO(gst_bin_iterate_sinks, pFp) @@ -40,23 +40,23 @@ GO(gst_bin_iterate_sources, pFp) GO(gst_bin_new, pFp) GO(gst_bin_recalculate_latency, iFp) GO(gst_bin_remove, iFpp) -//GOM(gst_bin_remove_many, iFEppV) +//GOM(gst_bin_remove_many, vFEppV) GO(gst_bin_set_suppressed_flags, vFpu) GO(gst_bin_sync_children_states, iFp) GO(gst_bitmask_get_type, LFv) -DATAB(_gst_bitmask_type, sizeof(void*)) +DATAB(_gst_bitmask_type, 8) GO(gst_buffer_add_meta, pFppp) GO(gst_buffer_add_parent_buffer_meta, pFpp) GO(gst_buffer_add_protection_meta, pFpp) -GO(gst_buffer_add_reference_timestamp_meta, pFppUU) +GO(gst_buffer_add_reference_timestamp_meta, pFppLL) GO(gst_buffer_append, pFpp) GO(gst_buffer_append_memory, vFpp) GO(gst_buffer_append_region, pFppll) GO(gst_buffer_copy, pFp) GO(gst_buffer_copy_deep, pFp) GO(gst_buffer_copy_flags_get_type, LFv) -GO(gst_buffer_copy_into, iFppiLL) -GO(gst_buffer_copy_region, pFpiLL) +GO(gst_buffer_copy_into, iFppuLL) +GO(gst_buffer_copy_region, pFpuLL) GO(gst_buffer_extract, LFpLpL) GO(gst_buffer_extract_dup, vFpLLpp) GO(gst_buffer_fill, LFpLpL) @@ -64,55 +64,55 @@ GO(gst_buffer_find_memory, iFpLLppp) GO(gst_buffer_flags_get_type, LFv) GOM(gst_buffer_foreach_meta, iFEppp) GO(gst_buffer_get_all_memory, pFp) -GO(gst_buffer_get_flags, iFp) +GO(gst_buffer_get_flags, uFp) GO(gst_buffer_get_max_memory, uFv) GO(gst_buffer_get_memory, pFpu) GO(gst_buffer_get_memory_range, pFpui) -GO(gst_buffer_get_meta, pFpp) -GO(gst_buffer_get_n_meta, uFpp) +GO(gst_buffer_get_meta, pFpL) +GO(gst_buffer_get_n_meta, uFpL) GO(gst_buffer_get_reference_timestamp_meta, pFpp) GO(gst_buffer_get_size, LFp) GO(gst_buffer_get_sizes, LFppp) GO(gst_buffer_get_sizes_range, LFpuipp) GO(gst_buffer_get_type, LFv) -GO(gst_buffer_has_flags, iFpi) +GO(gst_buffer_has_flags, iFpu) GO(gst_buffering_mode_get_type, LFv) GO(gst_buffer_insert_memory, vFpip) GO(gst_buffer_is_all_memory_writable, iFp) GO(gst_buffer_is_memory_range_writable, iFpui) GO(gst_buffer_iterate_meta, pFpp) -GO(gst_buffer_iterate_meta_filtered, pFppp) +GO(gst_buffer_iterate_meta_filtered, pFppL) GO(gst_buffer_list_calculate_size, LFp) -//GO(gst_buffer_list_copy, +GO(gst_buffer_list_copy, pFp) GO(gst_buffer_list_copy_deep, pFp) -//GO(gst_buffer_list_foreach, +GOM(gst_buffer_list_foreach, iFEppp) GO(gst_buffer_list_get, pFpu) -//GO(gst_buffer_list_get_type, -//GO(gst_buffer_list_get_writable, +GO(gst_buffer_list_get_type, LFv) +GO(gst_buffer_list_get_writable, pFpu) GO(gst_buffer_list_insert, vFpip) GO(gst_buffer_list_length, uFp) GO(gst_buffer_list_new, pFv) GO(gst_buffer_list_new_sized, pFu) GO(gst_buffer_list_ref, pFp) GO(gst_buffer_list_remove, vFpuu) -//GO(gst_buffer_list_replace, +GO(gst_buffer_list_replace, iFpp) GO(gst_buffer_list_take, iFpp) -//DATAB(_gst_buffer_list_type, -//GO(gst_buffer_list_unref, -GO(gst_buffer_map, iFppi) -GO(gst_buffer_map_range, iFpuipi) +DATAB(_gst_buffer_list_type, 8) +GO(gst_buffer_list_unref, vFp) +GO(gst_buffer_map, iFppu) +GO(gst_buffer_map_range, iFpuipu) GO(gst_buffer_memcmp, iFpLpL) GO(gst_buffer_memset, LFpLCL) GO(gst_buffer_new, pFv) -GO(gst_buffer_new_allocate, pFplp) +GO(gst_buffer_new_allocate, pFpLp) GO(gst_buffer_new_memdup, pFpL) -GO(gst_buffer_new_wrapped, pFpl) +GO(gst_buffer_new_wrapped, pFpL) GO(gst_buffer_new_wrapped_bytes, pFp) -GOM(gst_buffer_new_wrapped_full, pFEiplllpp) +GOM(gst_buffer_new_wrapped_full, pFEupLLLpp) GO(gst_buffer_n_memory, uFp) GO(gst_buffer_peek_memory, pFpu) GO(gst_buffer_pool_acquire_buffer, iFppp) -//GO(gst_buffer_pool_acquire_flags_get_type, +GO(gst_buffer_pool_acquire_flags_get_type, LFv) GO(gst_buffer_pool_config_add_option, vFpp) GO(gst_buffer_pool_config_get_allocator, iFppp) GO(gst_buffer_pool_config_get_option, pFpu) @@ -128,7 +128,7 @@ GO(gst_buffer_pool_get_type, LFv) GO(gst_buffer_pool_has_option, iFpp) GO(gst_buffer_pool_is_active, iFp) GO(gst_buffer_pool_new, pFv) -//GO(gst_buffer_pool_release_buffer, +GO(gst_buffer_pool_release_buffer, vFpp) GO(gst_buffer_pool_set_active, iFpi) GO(gst_buffer_pool_set_config, iFpp) GO(gst_buffer_pool_set_flushing, vFpi) @@ -144,12 +144,12 @@ GO(gst_buffer_replace_memory, vFpup) GO(gst_buffer_replace_memory_range, vFpuip) GO(gst_buffer_resize, vFpll) GO(gst_buffer_resize_range, iFpuill) -GO(gst_buffer_set_flags, iFpi) +GO(gst_buffer_set_flags, iFpu) GO(gst_buffer_set_size, vFpl) -DATAB(_gst_buffer_type, sizeof(void*)) +DATAB(_gst_buffer_type, 8) GO(gst_buffer_unmap, vFpp) GO(gst_buffer_unref, vFp) -GO(gst_buffer_unset_flags, iFpi) +GO(gst_buffer_unset_flags, iFpu) GO(gst_bus_add_signal_watch, vFp) GO(gst_bus_add_signal_watch_full, vFpi) GOM(gst_bus_add_watch, uFEppp) @@ -164,7 +164,7 @@ GO(gst_bus_get_type, LFv) GO(gst_bus_have_pending, iFp) GO(gst_bus_new, pFv) GO(gst_bus_peek, pFp) -GO(gst_bus_poll, pFppU) +GO(gst_bus_poll, pFpiL) GO(gst_bus_pop, pFp) GO(gst_bus_pop_filtered, pFpi) GO(gst_bus_post, iFpp) @@ -173,11 +173,11 @@ GO(gst_bus_remove_watch, iFp) GO(gst_bus_set_flushing, vFpi) GOM(gst_bus_set_sync_handler, vFEpppp) GO(gst_bus_sync_reply_get_type, LFv) -GO(gst_bus_sync_signal_handler, iFppp) -GO(gst_bus_timed_pop, pFpU) -GO(gst_bus_timed_pop_filtered, pFpUi) +GO(gst_bus_sync_signal_handler, uFppp) +GO(gst_bus_timed_pop, pFpL) +GO(gst_bus_timed_pop_filtered, pFpLi) GO(gst_calculate_linear_regression, iFppuppppp) -DATAB(_gst_caps_any, sizeof(void*)) +DATAB(_gst_caps_any, 8) GO(gst_caps_append, vFpp) GO(gst_caps_append_structure, vFpp) GO(gst_caps_append_structure_full, vFppp) @@ -185,8 +185,8 @@ GO(gst_caps_can_intersect, iFpp) GO(gst_caps_copy, pFp) GO(gst_caps_copy_nth, pFpu) GO(gst_caps_features_add, vFpp) -//GO(gst_caps_features_add_id, -//DATAB(_gst_caps_features_any, +GO(gst_caps_features_add_id, vFpu) +//DATAB(_gst_caps_features_any, 8) GO(gst_caps_features_contains, iFpp) GO(gst_caps_features_contains_id, iFpu) GO(gst_caps_features_copy, pFp) @@ -195,22 +195,22 @@ GO(gst_caps_features_from_string, pFp) GO(gst_caps_features_get_nth, pFpu) GO(gst_caps_features_get_nth_id, uFpu) GO(gst_caps_features_get_size, uFp) -//GO(gst_caps_features_get_type, +GO(gst_caps_features_get_type, LFv) GO(gst_caps_features_is_any, iFp) GO(gst_caps_features_is_equal, iFpp) -DATAB(_gst_caps_features_memory_system_memory, sizeof(void*)) +DATAB(_gst_caps_features_memory_system_memory, 8) GOM(gst_caps_features_new, pFEpV) GO(gst_caps_features_new_any, pFv) -//GO(gst_caps_features_new_empty, -//GO(gst_caps_features_new_id, -GO(gst_caps_features_new_id_valist, pFup) +GO(gst_caps_features_new_empty, pFv) +GOM(gst_caps_features_new_id, pFEuV) +GOM(gst_caps_features_new_id_valist, pFEuA) GOM(gst_caps_features_new_valist, pFEpA) GO(gst_caps_features_remove, vFpp) GO(gst_caps_features_remove_id, vFpu) GO(gst_caps_features_set_parent_refcount, iFpp) GO(gst_caps_features_to_string, pFp) -//DATAB(_gst_caps_features_type, -//GO(gst_caps_filter_and_map_in_place, +DATAB(_gst_caps_features_type, 8) +//GOM(gst_caps_filter_and_map_in_place, vFEppp) GO(gst_caps_fixate, pFp) GO(gst_caps_flags_get_type, LFv) GOM(gst_caps_foreach, iFEppp) @@ -220,7 +220,7 @@ GO(gst_caps_get_size, uFp) GO(gst_caps_get_structure, pFpu) GO(gst_caps_get_type, LFv) GO(gst_caps_intersect, pFpp) -GO(gst_caps_intersect_full, pFppi) +GO(gst_caps_intersect_full, pFppu) GO(gst_caps_intersect_mode_get_type, LFv) GO(gst_caps_is_always_compatible, iFpp) GO(gst_caps_is_any, iFp) @@ -232,7 +232,7 @@ GO(gst_caps_is_strictly_equal, iFpp) GO(gst_caps_is_subset, iFpp) GO(gst_caps_is_subset_structure, iFpp) GO(gst_caps_is_subset_structure_full, iFppp) -//GOM(gst_caps_map_in_place, iFEpBp) +GOM(gst_caps_map_in_place, iFEppp) GO(gst_caps_merge, pFpp) GO(gst_caps_merge_structure, pFpp) GO(gst_caps_merge_structure_full, pFppp) @@ -242,10 +242,10 @@ GO(gst_caps_new_empty_simple, pFp) //GOM(gst_caps_new_full, pFEpV) //GOM(gst_caps_new_full_valist, pFEpA) GOM(gst_caps_new_simple, pFEppV) -DATAB(_gst_caps_none, sizeof(void*)) +DATAB(_gst_caps_none, 8) GO(gst_caps_normalize, pFp) GO(gst_caps_ref, pFp) -GO(gst_caps_remove_structure, vFpp) +GO(gst_caps_remove_structure, vFpu) GO(gst_caps_replace, iFpp) GO(gst_caps_set_features, vFpup) GO(gst_caps_set_features_simple, vFpp) @@ -258,7 +258,7 @@ GO(gst_caps_subtract, pFpp) GO(gst_caps_take, iFpp) GO(gst_caps_to_string, pFp) GO(gst_caps_truncate, pFp) -DATAB(_gst_caps_type, sizeof(void*)) +DATAB(_gst_caps_type, 8) GO(gst_caps_unref, vFp) //DATAB(GST_CAT_BUFFER, //DATAB(GST_CAT_BUFFER_LIST, @@ -267,7 +267,7 @@ GO(gst_caps_unref, vFp) //DATAB(GST_CAT_CAPS, //DATAB(GST_CAT_CLOCK, //DATAB(GST_CAT_CONTEXT, -DATAB(GST_CAT_DEFAULT, sizeof(void*)) +DATAB(GST_CAT_DEFAULT, 8) //DATAB(GST_CAT_ELEMENT_PADS, //DATAB(GST_CAT_ERROR_SYSTEM, //DATAB(GST_CAT_EVENT, @@ -294,112 +294,112 @@ DATAB(GST_CAT_DEFAULT, sizeof(void*)) //DATAB(GST_CAT_STATES, GO(gst_child_proxy_child_added, vFppp) GO(gst_child_proxy_child_removed, vFppp) -//GO(gst_child_proxy_get, +//GOM(gst_child_proxy_get, vFEppV) GO(gst_child_proxy_get_child_by_index, pFpu) -//GO(gst_child_proxy_get_child_by_name, +GO(gst_child_proxy_get_child_by_name, pFpp) GO(gst_child_proxy_get_children_count, uFp) GO(gst_child_proxy_get_property, vFppp) GO(gst_child_proxy_get_type, LFv) -//GO(gst_child_proxy_get_valist, +//GOM(gst_child_proxy_get_valist, vFEppA) GO(gst_child_proxy_lookup, iFpppp) -//GO(gst_child_proxy_set, +//GOM(gst_child_proxy_set, vFEppV) GO(gst_child_proxy_set_property, vFppp) -//GO(gst_child_proxy_set_valist, -//GO(gst_clear_buffer, -//GO(gst_clear_buffer_list, +//GOM(gst_child_proxy_set_valist, vFEppA) +GO(gst_clear_buffer, vFp) +GO(gst_clear_buffer_list, vFp) GO(gst_clear_caps, vFp) GO(gst_clear_event, vFp) GO(gst_clear_message, vFp) GO(gst_clear_mini_object, vFp) -//GO(gst_clear_object, +GO(gst_clear_object, vFp) GO(gst_clear_query, vFp) GO(gst_clear_structure, vFp) -//GO(gst_clear_tag_list, -//GO(gst_clear_uri, +GO(gst_clear_tag_list, vFp) +GO(gst_clear_uri, vFp) GO(gst_clock_add_observation, iFpLLp) GO(gst_clock_add_observation_unapplied, iFpLLppppp) -//GO(gst_clock_adjust_unlocked, -//GO(gst_clock_adjust_with_calibration, -//GO(gst_clock_entry_type_get_type, -//GO(gst_clock_flags_get_type, +GO(gst_clock_adjust_unlocked, LFpL) +GO(gst_clock_adjust_with_calibration, LFpLLLLL) +GO(gst_clock_entry_type_get_type, LFv) +GO(gst_clock_flags_get_type, LFv) GO(gst_clock_get_calibration, vFppppp) GO(gst_clock_get_internal_time, LFp) GO(gst_clock_get_master, pFp) -//GO(gst_clock_get_resolution, -GO(gst_clock_get_time, UFp) -//GO(gst_clock_get_timeout, -//GO(gst_clock_get_type, -//GO(gst_clock_id_compare_func, +GO(gst_clock_get_resolution, LFp) +GO(gst_clock_get_time, LFp) +GO(gst_clock_get_timeout, LFp) +GO(gst_clock_get_type, LFv) +GO(gst_clock_id_compare_func, iFpp) GO(gst_clock_id_get_clock, pFp) GO(gst_clock_id_get_time, LFp) GO(gst_clock_id_ref, pFp) -//GO(gst_clock_id_unref, +GO(gst_clock_id_unref, vFp) GO(gst_clock_id_unschedule, vFp) GO(gst_clock_id_uses_clock, iFpp) GO(gst_clock_id_wait, uFpp) -//GO(gst_clock_id_wait_async, +GOM(gst_clock_id_wait_async, uFEpppp) GO(gst_clock_is_synced, iFp) GO(gst_clock_new_periodic_id, pFpLL) GO(gst_clock_new_single_shot_id, pFpL) GO(gst_clock_periodic_id_reinit, iFppLL) -//GO(gst_clock_return_get_type, +GO(gst_clock_return_get_type, LFv) GO(gst_clock_set_calibration, vFpLLLL) GO(gst_clock_set_master, iFpp) -//GO(gst_clock_set_resolution, +GO(gst_clock_set_resolution, LFpL) GO(gst_clock_set_synced, vFpi) GO(gst_clock_set_timeout, vFpL) GO(gst_clock_single_shot_id_reinit, iFppL) -//GO(gst_clock_type_get_type, +GO(gst_clock_type_get_type, LFv) GO(gst_clock_unadjust_unlocked, LFpL) GO(gst_clock_unadjust_with_calibration, LFpLLLLL) GO(gst_clock_wait_for_sync, iFpL) GO(gst_context_copy, pFp) GO(gst_context_get_context_type, pFp) GO(gst_context_get_structure, pFp) -//GO(gst_context_get_type, +GO(gst_context_get_type, LFv) GO(gst_context_has_context_type, iFpp) GO(gst_context_is_persistent, iFp) GO(gst_context_new, pFpi) GO(gst_context_ref, pFp) GO(gst_context_replace, iFpp) -//DATAB(_gst_context_type, -//GO(gst_context_unref, +DATAB(_gst_context_type, 8) +GO(gst_context_unref, vFp) GO(gst_context_writable_structure, pFp) GO(gst_control_binding_get_g_value_array, iFpLLup) -//GO(gst_control_binding_get_type, +GO(gst_control_binding_get_type, LFv) GO(gst_control_binding_get_value, pFpL) GO(gst_control_binding_get_value_array, iFpLLup) GO(gst_control_binding_is_disabled, iFp) GO(gst_control_binding_set_disabled, vFpi) GO(gst_control_binding_sync_values, iFppLL) -//GO(gst_control_source_get_type, -//GO(gst_control_source_get_value, -//GO(gst_control_source_get_value_array, -//GO(gst_core_error_get_type, -GO(gst_core_error_quark, pFv) -//GO(gst_date_time_get_day, -//GO(gst_date_time_get_hour, +GO(gst_control_source_get_type, LFv) +//GOM(gst_control_source_get_value, iFEpLp) +//GOM(gst_control_source_get_value_array, iFEpLLup) +GO(gst_core_error_get_type, LFv) +GO(gst_core_error_quark, uFv) +GO(gst_date_time_get_day, iFp) +GO(gst_date_time_get_hour, iFp) GO(gst_date_time_get_microsecond, iFp) -//GO(gst_date_time_get_minute, -//GO(gst_date_time_get_month, -//GO(gst_date_time_get_second, +GO(gst_date_time_get_minute, iFp) +GO(gst_date_time_get_month, iFp) +GO(gst_date_time_get_second, iFp) GO(gst_date_time_get_time_zone_offset, fFp) -//GO(gst_date_time_get_type, -//GO(gst_date_time_get_year, -//GO(gst_date_time_has_day, -//GO(gst_date_time_has_month, +GO(gst_date_time_get_type, LFv) +GO(gst_date_time_get_year, iFp) +GO(gst_date_time_has_day, iFp) +GO(gst_date_time_has_month, iFp) GO(gst_date_time_has_second, iFp) -//GO(gst_date_time_has_time, -//GO(gst_date_time_has_year, +GO(gst_date_time_has_time, iFp) +GO(gst_date_time_has_year, iFp) GO(gst_date_time_new, pFfiiiiid) GO(gst_date_time_new_from_g_date_time, pFp) GO(gst_date_time_new_from_iso8601_string, pFp) -//GO(gst_date_time_new_from_unix_epoch_local_time, -//GO(gst_date_time_new_from_unix_epoch_local_time_usecs, -//GO(gst_date_time_new_from_unix_epoch_utc, +GO(gst_date_time_new_from_unix_epoch_local_time, pFl) +GO(gst_date_time_new_from_unix_epoch_local_time_usecs, pFl) +GO(gst_date_time_new_from_unix_epoch_utc, pFl) GO(gst_date_time_new_from_unix_epoch_utc_usecs, pFl) GO(gst_date_time_new_local_time, pFiiiiid) -//GO(gst_date_time_new_now_local_time, +GO(gst_date_time_new_now_local_time, pFv) GO(gst_date_time_new_now_utc, pFv) GO(gst_date_time_new_y, pFi) GO(gst_date_time_new_ym, pFii) @@ -407,65 +407,68 @@ GO(gst_date_time_new_ymd, pFiii) GO(gst_date_time_ref, pFp) GO(gst_date_time_to_g_date_time, pFp) GO(gst_date_time_to_iso8601_string, pFp) -DATAB(_gst_date_time_type, sizeof(void*)) +DATAB(_gst_date_time_type, 8) GO(gst_date_time_unref, vFp) -//GO(gst_debug_add_log_function, +//GOM(gst_debug_add_log_function, vFEppp) GO(gst_debug_add_ring_buffer_logger, vFuu) GO(gst_debug_bin_to_dot_data, pFpi) -//GO(gst_debug_bin_to_dot_file, +GO(gst_debug_bin_to_dot_file, vFpip) GO(gst_debug_bin_to_dot_file_with_ts, vFpip) -//GO(gst_debug_category_free, +GO(gst_debug_category_free, vFp) GO(gst_debug_category_get_color, uFp) GO(gst_debug_category_get_description, pFp) -//GO(gst_debug_category_get_name, +GO(gst_debug_category_get_name, pFp) GO(gst_debug_category_get_threshold, uFp) GO(_gst_debug_category_new, pFpup) GO(gst_debug_category_reset_threshold, vFp) GO(gst_debug_category_set_threshold, vFpu) -//GO(gst_debug_color_flags_get_type, -//GO(gst_debug_color_mode_get_type, +GO(gst_debug_color_flags_get_type, LFv) +GO(gst_debug_color_mode_get_type, LFv) GO(gst_debug_construct_term_color, pFu) GO(gst_debug_construct_win_color, iFu) GO(_gst_debug_dump_mem, vFpppipppu) -//DATAB(_gst_debug_enabled, +DATAB(_gst_debug_enabled, 4) GO(gst_debug_get_all_categories, pFv) GO(_gst_debug_get_category, pFp) GO(gst_debug_get_color_mode, uFv) GO(gst_debug_get_default_threshold, uFv) GO(gst_debug_get_stack_trace, pFu) -//GO(gst_debug_graph_details_get_type, -//GO(gst_debug_is_active, -//GO(gst_debug_is_colored, +GO(gst_debug_graph_details_get_type, LFv) +GO(gst_debug_is_active, iFv) +GO(gst_debug_is_colored, iFv) GO(gst_debug_level_get_name, pFu) -//GO(gst_debug_level_get_type, -GOM(gst_debug_log, vFEpippippV) +GO(gst_debug_level_get_type, LFv) +GOM(gst_debug_log, vFEpuppippV) GO(gst_debug_log_default, vFpuppippp) GO(gst_debug_log_get_line, pFpuppipp) -GOM(gst_debug_log_valist, vFEpippippA) -//GO(gst_debug_message_get, -DATAB(_gst_debug_min, sizeof(int)) -//GO(_gst_debug_nameof_funcptr, -//GO(gst_debug_print_stack_trace, -GO(_gst_debug_register_funcptr, vFpp) -//GO(gst_debug_remove_log_function, +GOM(gst_debug_log_id, vFEpuppippV) //%% +GO(gst_debug_log_id_literal, vFpuppipp) +GOM(gst_debug_log_id_valist, vFEpuppippA) +GOM(gst_debug_log_valist, vFEpuppippA) +GO(gst_debug_message_get, pFp) +DATAB(_gst_debug_min, 4) +//GOM(_gst_debug_nameof_funcptr, pFEp) +GO(gst_debug_print_stack_trace, vFv) +GO(_gst_debug_register_funcptr, vFpp) //no need to wrap it seems, it's the name that get registered +//GOM(gst_debug_remove_log_function, uFEp) GO(gst_debug_remove_log_function_by_data, uFp) -//GO(gst_debug_remove_ring_buffer_logger, +GO(gst_debug_remove_ring_buffer_logger, vFv) GO(gst_debug_ring_buffer_logger_get_logs, pFv) -//GO(gst_debug_set_active, -//GO(gst_debug_set_colored, +GO(gst_debug_set_active, vFi) +GO(gst_debug_set_colored, vFi) GO(gst_debug_set_color_mode, vFu) -//GO(gst_debug_set_color_mode_from_string, +GO(gst_debug_set_color_mode_from_string, vFp) GO(gst_debug_set_default_threshold, vFu) GO(gst_debug_set_threshold_for_name, vFpu) GO(gst_debug_set_threshold_from_string, vFpi) GO(gst_debug_unset_threshold_for_name, vFp) GO(gst_deinit, vFv) GO(gst_device_create_element, pFpp) -//GO(gst_device_get_caps, +GO(gst_device_get_caps, pFp) GO(gst_device_get_device_class, pFp) -//GO(gst_device_get_display_name, +GO(gst_device_get_display_name, pFp) GO(gst_device_get_properties, pFp) -//GO(gst_device_get_type, +GO(gst_device_get_type, LFv) GO(gst_device_has_classes, iFpp) GO(gst_device_has_classesv, iFpp) GO(gst_device_monitor_add_filter, uFppp) @@ -473,19 +476,19 @@ GO(gst_device_monitor_get_bus, pFp) GO(gst_device_monitor_get_devices, pFp) GO(gst_device_monitor_get_providers, pFp) GO(gst_device_monitor_get_show_all_devices, iFp) -//GO(gst_device_monitor_get_type, +GO(gst_device_monitor_get_type, LFv) GO(gst_device_monitor_new, pFv) GO(gst_device_monitor_remove_filter, iFpu) GO(gst_device_monitor_set_show_all_devices, vFpi) GO(gst_device_monitor_start, iFp) -//GO(gst_device_monitor_stop, -//GO(gst_device_provider_can_monitor, -//GO(gst_device_provider_class_add_metadata, -//GO(gst_device_provider_class_add_static_metadata, -//GO(gst_device_provider_class_get_metadata, -//GO(gst_device_provider_class_set_metadata, -//GO(gst_device_provider_class_set_static_metadata, -//GO(gst_device_provider_device_add, +GO(gst_device_monitor_stop, vFp) +GO(gst_device_provider_can_monitor, iFp) +//GOM(gst_device_provider_class_add_metadata, vFEppp) +//GOM(gst_device_provider_class_add_static_metadata, vFEppp) +//GOM(gst_device_provider_class_get_metadata, pFEpp) +//GOM(gst_device_provider_class_set_metadata, vFEppppp) +//GOM(gst_device_provider_class_set_static_metadata, vFEppppp) +GO(gst_device_provider_device_add, vFpp) GO(gst_device_provider_device_changed, vFppp) GO(gst_device_provider_device_remove, vFpp) GO(gst_device_provider_factory_find, pFp) @@ -494,7 +497,7 @@ GO(gst_device_provider_factory_get_by_name, pFp) GO(gst_device_provider_factory_get_device_provider_type, LFp) GO(gst_device_provider_factory_get_metadata, pFpp) GO(gst_device_provider_factory_get_metadata_keys, pFp) -//GO(gst_device_provider_factory_get_type, +GO(gst_device_provider_factory_get_type, LFv) GO(gst_device_provider_factory_has_classes, iFpp) GO(gst_device_provider_factory_has_classesv, iFpp) GO(gst_device_provider_factory_list_get_device_providers, pFu) @@ -503,37 +506,37 @@ GO(gst_device_provider_get_devices, pFp) GO(gst_device_provider_get_factory, pFp) GO(gst_device_provider_get_hidden_providers, pFp) GO(gst_device_provider_get_metadata, pFpp) -//GO(gst_device_provider_get_type, -//GO(gst_device_provider_hide_provider, +GO(gst_device_provider_get_type, LFv) +GO(gst_device_provider_hide_provider, vFpp) GO(gst_device_provider_register, iFppuL) -//GO(gst_device_provider_start, -//GO(gst_device_provider_stop, +GO(gst_device_provider_start, iFp) +GO(gst_device_provider_stop, vFp) GO(gst_device_provider_unhide_provider, vFpp) GO(gst_device_reconfigure_element, iFpp) //DATAB(_gst_disable_registry_cache, -//GO(gst_double_range_get_type, -//DATAB(_gst_double_range_type, -//GO(gst_dynamic_type_factory_get_type, +GO(gst_double_range_get_type, LFv) +DATAB(_gst_double_range_type, 8) +GO(gst_dynamic_type_factory_get_type, LFv) GO(gst_dynamic_type_factory_load, LFp) GO(gst_dynamic_type_register, iFpL) GO(gst_element_abort_state, vFp) GO(gst_element_add_pad, iFpp) GO(gst_element_add_property_deep_notify_watch, LFppi) GO(gst_element_add_property_notify_watch, LFppi) -//GOM(gst_element_call_async, vFEpBpB) +//GOM(gst_element_call_async, vFEpppp) GO(gst_element_change_state, uFpu) GO(gst_element_class_add_metadata, vFppp) GO(gst_element_class_add_pad_template, vFpp) GO(gst_element_class_add_static_metadata, vFppp) GO(gst_element_class_add_static_pad_template, vFpp) -GO(gst_element_class_add_static_pad_template_with_gtype, vFppp) +GO(gst_element_class_add_static_pad_template_with_gtype, vFppL) GO(gst_element_class_get_metadata, pFpp) GO(gst_element_class_get_pad_template, pFpp) GO(gst_element_class_get_pad_template_list, pFp) GO(gst_element_class_set_metadata, vFppppp) GO(gst_element_class_set_static_metadata, vFppppp) GO(gst_element_continue_state, uFpu) -//GOM(gst_element_create_all_pads, iFEpBp) +//GOM(gst_element_create_all_pads, vFEp) GOM(_gst_element_error_printf, pFEpV) GO(gst_element_factory_can_sink_all_caps, iFpp) GO(gst_element_factory_can_sink_any_caps, iFpp) @@ -550,15 +553,15 @@ GO(gst_element_factory_get_type, LFv) GO(gst_element_factory_get_uri_protocols, pFp) GO(gst_element_factory_get_uri_type, uFp) GO(gst_element_factory_has_interface, iFpp) -GO(gst_element_factory_list_filter, pFppii) +GO(gst_element_factory_list_filter, pFppui) GO(gst_element_factory_list_get_elements, pFLu) GO(gst_element_factory_list_is_type, iFpL) GO(gst_element_factory_make, pFpp) GO(gst_element_flags_get_type, LFv) -//GOM(gst_element_foreach_pad, iFEpBp) +//GOM(gst_element_foreach_pad, iFEppp) GOM(gst_element_foreach_sink_pad, iFEppp) -//GOM(gst_element_foreach_src_pad, iFEpBp) -GO(gst_element_get_base_time, UFp) +//GOM(gst_element_foreach_src_pad, iFEppp) +GO(gst_element_get_base_time, LFp) GO(gst_element_get_bus, pFp) GO(gst_element_get_clock, pFp) GO(gst_element_get_compatible_pad, pFppp) @@ -567,13 +570,13 @@ GO(gst_element_get_context, pFpp) GO(gst_element_get_contexts, pFp) GO(gst_element_get_context_unlocked, pFpp) GO(gst_element_get_current_clock_time, LFp) -GO(gst_element_get_current_running_time, UFp) +GO(gst_element_get_current_running_time, LFp) GO(gst_element_get_factory, pFp) GO(gst_element_get_metadata, pFpp) GO(gst_element_get_pad_template, pFpp) GO(gst_element_get_pad_template_list, pFp) -//GO(gst_element_get_request_pad, -GO(gst_element_get_start_time, UFp) +GO(gst_element_get_request_pad, pFpp) +GO(gst_element_get_start_time, LFp) GO(gst_element_get_state, uFpppL) GO(gst_element_get_static_pad, pFpp) GO(gst_element_get_type, LFv) @@ -597,16 +600,17 @@ GO(gst_element_provide_clock, pFp) GO(gst_element_query, iFpp) GO(gst_element_query_convert, iFpulup) GO(gst_element_query_duration, iFpup) -GO(gst_element_query_position, iFpip) -GO(gst_element_register, iFppup) +GO(gst_element_query_position, iFpup) +GO(gst_element_register, iFppuL) GO(gst_element_release_request_pad, vFpp) GO(gst_element_remove_pad, iFpp) GO(gst_element_remove_property_notify_watch, vFpL) GO(gst_element_request_pad, pFpppp) +GO(gst_element_request_pad_simple, pFpp) GO(gst_element_seek, iFpduuulul) GO(gst_element_seek_simple, iFpuul) GO(gst_element_send_event, iFpp) -GO(gst_element_set_base_time, vFpU) +GO(gst_element_set_base_time, vFpL) GO(gst_element_set_bus, vFpp) GO(gst_element_set_clock, iFpp) GO(gst_element_set_context, vFpp) @@ -622,32 +626,32 @@ GO(gst_element_unlink_pads, vFpppp) GO(gst_error_get_message, pFui) GO(gst_event_copy, pFp) GO(gst_event_copy_segment, vFpp) -GO(gst_event_get_running_time_offset, IFp) +GO(gst_event_get_running_time_offset, lFp) GO(gst_event_get_seqnum, uFp) GO(gst_event_get_structure, pFp) GO(gst_event_get_type, LFv) GO(gst_event_has_name, iFpp) -GO(gst_event_has_name_id, iFpp) -GO(gst_event_new_buffer_size, pFiIIi) +GO(gst_event_has_name_id, iFpu) +GO(gst_event_new_buffer_size, pFulli) GO(gst_event_new_caps, pFp) -GO(gst_event_new_custom, pFpp) +GO(gst_event_new_custom, pFup) GO(gst_event_new_eos, pFv) GO(gst_event_new_flush_start, pFv) GO(gst_event_new_flush_stop, pFi) -GO(gst_event_new_gap, pFUU) -GO(gst_event_new_instant_rate_change, pFdi) -GO(gst_event_new_instant_rate_sync_time, pFdUU) -GO(gst_event_new_latency, pFU) +GO(gst_event_new_gap, pFLL) +GO(gst_event_new_instant_rate_change, pFdu) +GO(gst_event_new_instant_rate_sync_time, pFdLL) +GO(gst_event_new_latency, pFL) GO(gst_event_new_navigation, pFp) GO(gst_event_new_protection, pFppp) -GO(gst_event_new_qos, pFpdIU) +GO(gst_event_new_qos, pFudlL) GO(gst_event_new_reconfigure, pFv) -GO(gst_event_new_seek, pFdiiiIiI) +GO(gst_event_new_seek, pFduuulul) GO(gst_event_new_segment, pFp) -GO(gst_event_new_segment_done, pFiI) +GO(gst_event_new_segment_done, pFul) GO(gst_event_new_select_streams, pFp) GO(gst_event_new_sink_message, pFpp) -GO(gst_event_new_step, pFpUdii) +GO(gst_event_new_step, pFuLdii) GO(gst_event_new_stream_collection, pFp) GO(gst_event_new_stream_group_done, pFu) GO(gst_event_new_stream_start, pFp) @@ -658,7 +662,7 @@ GO(gst_event_parse_buffer_size, vFppppp) GO(gst_event_parse_caps, vFpp) GO(gst_event_parse_flush_stop, vFpp) GO(gst_event_parse_gap, vFppp) -GO(gst_event_parse_group_id, vFpp) +GO(gst_event_parse_group_id, iFpp) GO(gst_event_parse_instant_rate_change, vFppp) GO(gst_event_parse_instant_rate_sync_time, vFpppp) GO(gst_event_parse_latency, vFpp) @@ -682,14 +686,14 @@ GO(gst_event_parse_toc_select, vFpp) GO(gst_event_ref, pFp) GO(gst_event_replace, iFpp) GO(gst_event_set_group_id, vFpu) -GO(gst_event_set_running_time_offset, vFpI) -GO(gst_event_set_seek_trickmode_interval, vFpU) +GO(gst_event_set_running_time_offset, vFpl) +GO(gst_event_set_seek_trickmode_interval, vFpL) GO(gst_event_set_seqnum, vFpu) GO(gst_event_set_stream, vFpp) -GO(gst_event_set_stream_flags, vFpi) +GO(gst_event_set_stream_flags, vFpu) GO(gst_event_steal, pFp) GO(gst_event_take, iFpp) -DATAB(_gst_event_type, sizeof(void*)) +DATAB(_gst_event_type, 8) GO(gst_event_type_flags_get_type, LFv) GO(gst_event_type_get_flags, uFu) GO(gst_event_type_get_name, pFu) @@ -699,9 +703,9 @@ GO(gst_event_unref, vFp) GO(gst_event_writable_structure, pFp) //DATAB(_gst_executable_path, GO(gst_filename_to_uri, pFpp) -//GO(gst_flagset_get_type, +GO(gst_flagset_get_type, LFv) GO(gst_flagset_register, LFL) -//DATAB(_gst_flagset_type, +DATAB(_gst_flagset_type, 8) GO(gst_flow_get_name, pFi) GO(gst_flow_return_get_type, LFv) GO(gst_flow_to_quark, uFi) @@ -715,84 +719,84 @@ GO(gst_formats_contains, iFpu) GO(gst_format_to_quark, uFu) GO(gst_fraction_get_type, LFv) GO(gst_fraction_range_get_type, LFv) -DATAB(_gst_fraction_range_type, sizeof(void*)) -DATAB(_gst_fraction_type, sizeof(void*)) +DATAB(_gst_fraction_range_type, 8) +DATAB(_gst_fraction_type, 8) GO(gst_get_main_executable_path, pFv) -//GO(gst_ghost_pad_activate_mode_default, -//GO(gst_ghost_pad_construct, -//GO(gst_ghost_pad_get_target, +GO(gst_ghost_pad_activate_mode_default, iFppui) +GO(gst_ghost_pad_construct, iFp) +GO(gst_ghost_pad_get_target, pFp) GO(gst_ghost_pad_get_type, LFv) -//GO(gst_ghost_pad_internal_activate_mode_default, +GO(gst_ghost_pad_internal_activate_mode_default, iFppui) GO(gst_ghost_pad_new, pFpp) -//GO(gst_ghost_pad_new_from_template, -//GO(gst_ghost_pad_new_no_target, -//GO(gst_ghost_pad_new_no_target_from_template, +GO(gst_ghost_pad_new_from_template, pFppp) +GO(gst_ghost_pad_new_no_target, pFpu) +GO(gst_ghost_pad_new_no_target_from_template, pFpp) GO(gst_ghost_pad_set_target, iFpp) -//GO(gst_g_thread_get_type, -//GO(gst_info_strdup_printf, -//GO(gst_info_strdup_vprintf, +GO(gst_g_thread_get_type, LFv) +//GOM(gst_info_strdup_printf, pFEpV) +//GOM(gst_info_strdup_vprintf, pFEpA) GOM(gst_info_vasprintf, iFEppA) GOM(gst_init, vFEpp) GOM(gst_init_check, iFEppp) GO(gst_init_get_option_group, pFv) -//GO(gst_int64_range_get_type, -//DATAB(_gst_int64_range_type, +GO(gst_int64_range_get_type, LFv) +//DATAB(_gst_int64_range_type, 8) GO(gst_int_range_get_type, LFv) -DATAB(_gst_int_range_type, sizeof(void*)) +DATAB(_gst_int_range_type, 8) GO(gst_is_caps_features, iFp) GO(gst_is_initialized, iFv) -//GO(gst_iterator_copy, -//GO(gst_iterator_filter, -//GO(gst_iterator_find_custom, -GOM(gst_iterator_fold, iFEpppp) -//GO(gst_iterator_foreach, +GO(gst_iterator_copy, pFp) +//GOM(gst_iterator_filter, pFEppp) +GOM(gst_iterator_find_custom, iFEpppp) +GOM(gst_iterator_fold, uFEpppp) +GOM(gst_iterator_foreach, uFEppp) GO(gst_iterator_free, vFp) -//GO(gst_iterator_get_type, -//GO(gst_iterator_item_get_type, -//GO(gst_iterator_new, -//GO(gst_iterator_new_list, +GO(gst_iterator_get_type, LFv) +GO(gst_iterator_item_get_type, LFv) +//GOM(gst_iterator_new, pFEuLppppppp) +//GOM(gst_iterator_new_list, pFELppppp) GO(gst_iterator_new_single, pFLp) -GO(gst_iterator_next, iFpp) -//GO(gst_iterator_push, -//GO(gst_iterator_result_get_type, +GO(gst_iterator_next, uFpp) +GO(gst_iterator_push, vFpp) +GO(gst_iterator_result_get_type, LFv) GO(gst_iterator_resync, vFp) -//GO(gst_library_error_get_type, -GO(gst_library_error_quark, pFv) -//GO(gst_lock_flags_get_type, +GO(gst_library_error_get_type, LFv) +GO(gst_library_error_quark, uFv) +GO(gst_lock_flags_get_type, LFv) GOM(gst_make_element_message_details, pFEpV) -//GO(gst_map_flags_get_type, -//DATA(gst_memory_alignment, -//GO(gst_memory_copy, -//GO(gst_memory_flags_get_type, -GO(gst_memory_get_sizes, iFppp) -//GO(gst_memory_get_type, +GO(gst_map_flags_get_type, LFv) +//DATA(gst_memory_alignment, 8) +GO(gst_memory_copy, pFpll) +GO(gst_memory_flags_get_type, LFv) +GO(gst_memory_get_sizes, LFppp) +GO(gst_memory_get_type, LFv) GO(gst_memory_init, vFpuppLLLL) -//GO(gst_memory_is_span, -//GO(gst_memory_is_type, -//GO(gst_memory_make_mapped, +GO(gst_memory_is_span, iFppp) +GO(gst_memory_is_type, iFpp) +GO(gst_memory_make_mapped, pFppu) GO(gst_memory_map, iFppu) -GOM(gst_memory_new_wrapped, pFEipLLLpp) -//GO(gst_memory_ref, -//GO(gst_memory_resize, -//GO(gst_memory_share, -//DATAB(_gst_memory_type, +GOM(gst_memory_new_wrapped, pFEupLLLpp) +GO(gst_memory_ref, pFp) +GO(gst_memory_resize, vFplL) +GO(gst_memory_share, pFpll) +//DATAB(_gst_memory_type, 8) GO(gst_memory_unmap, vFpp) -//GO(gst_memory_unref, +GO(gst_memory_unref, vFp) GO(gst_message_add_redirect_entry, vFpppp) GO(gst_message_copy, pFp) -GO(gst_message_get_num_redirect_entries, lFp) +GO(gst_message_get_num_redirect_entries, LFp) GO(gst_message_get_seqnum, uFp) GO(gst_message_get_stream_status_object, pFp) GO(gst_message_get_structure, pFp) GO(gst_message_get_type, LFv) GO(gst_message_has_name, iFpp) GO(gst_message_new_application, pFpp) -GO(gst_message_new_async_done, pFpU) +GO(gst_message_new_async_done, pFpL) GO(gst_message_new_async_start, pFp) GO(gst_message_new_buffering, pFpi) GO(gst_message_new_clock_lost, pFpp) GO(gst_message_new_clock_provide, pFppi) -GO(gst_message_new_custom, pFppp) +GO(gst_message_new_custom, pFipp) GO(gst_message_new_device_added, pFpp) GO(gst_message_new_device_changed, pFppp) GO(gst_message_new_device_removed, pFpp) @@ -804,27 +808,27 @@ GO(gst_message_new_error_with_details, pFpppp) GO(gst_message_new_have_context, pFpp) GO(gst_message_new_info, pFppp) GO(gst_message_new_info_with_details, pFpppp) -GO(gst_message_new_instant_rate_request, pFpp) +GO(gst_message_new_instant_rate_request, pFpd) GO(gst_message_new_latency, pFp) GO(gst_message_new_need_context, pFpp) GO(gst_message_new_new_clock, pFpp) -GO(gst_message_new_progress, pFpppp) +GO(gst_message_new_progress, pFpupp) GO(gst_message_new_property_notify, pFppp) -GO(gst_message_new_qos, pFpiUUUU) +GO(gst_message_new_qos, pFpiLLLL) GO(gst_message_new_redirect, pFpppp) -GO(gst_message_new_request_state, pFpp) -GO(gst_message_new_reset_time, pFpU) -GO(gst_message_new_segment_done, pFppI) -GO(gst_message_new_segment_start, pFppI) -GO(gst_message_new_state_changed, pFpiii) +GO(gst_message_new_request_state, pFpu) +GO(gst_message_new_reset_time, pFpL) +GO(gst_message_new_segment_done, pFpul) +GO(gst_message_new_segment_start, pFpul) +GO(gst_message_new_state_changed, pFpuuu) GO(gst_message_new_state_dirty, pFp) -GO(gst_message_new_step_done, pFpiUdiiUi) -GO(gst_message_new_step_start, pFpiiUdii) +GO(gst_message_new_step_done, pFpuLdiiLi) +GO(gst_message_new_step_start, pFpiuLdii) GO(gst_message_new_stream_collection, pFpp) GO(gst_message_new_streams_selected, pFpp) GO(gst_message_new_stream_start, pFp) -GO(gst_message_new_stream_status, pFpip) -GO(gst_message_new_structure_change, pFpppi) +GO(gst_message_new_stream_status, pFpup) +GO(gst_message_new_structure_change, pFpupi) GO(gst_message_new_tag, pFpp) GO(gst_message_new_toc, pFppi) GO(gst_message_new_warning, pFppp) @@ -851,7 +855,7 @@ GO(gst_message_parse_property_notify, vFpppp) GO(gst_message_parse_qos, vFpppppp) GO(gst_message_parse_qos_stats, vFpppp) GO(gst_message_parse_qos_values, vFpppp) -GO(gst_message_parse_redirect_entry, vFplppp) +GO(gst_message_parse_redirect_entry, vFpLppp) GO(gst_message_parse_request_state, vFpp) GO(gst_message_parse_reset_time, vFpp) GO(gst_message_parse_segment_done, vFppp) @@ -869,17 +873,17 @@ GO(gst_message_parse_warning, vFppp) GO(gst_message_parse_warning_details, vFpp) GO(gst_message_ref, pFp) GO(gst_message_replace, iFpp) -GO(gst_message_set_buffering_stats, vFpiiiI) +GO(gst_message_set_buffering_stats, vFpuiil) GO(gst_message_set_group_id, vFpu) -GO(gst_message_set_qos_stats, vFpiUU) -GO(gst_message_set_qos_values, vFpIdi) +GO(gst_message_set_qos_stats, vFpuLL) +GO(gst_message_set_qos_values, vFpldi) GO(gst_message_set_seqnum, vFpu) GO(gst_message_set_stream_status_object, vFpp) GO(gst_message_streams_selected_add, vFpp) GO(gst_message_streams_selected_get_size, uFp) GO(gst_message_streams_selected_get_stream, pFpu) GO(gst_message_take, iFpp) -DATAB(_gst_message_type, sizeof(void*)) +DATAB(_gst_message_type, 8) GO(gst_message_type_get_name, pFi) GO(gst_message_type_get_type, LFv) GO(gst_message_type_to_quark, uFi) @@ -888,32 +892,32 @@ GO(gst_message_writable_structure, pFp) GO(gst_meta_api_type_get_tags, pFL) GO(gst_meta_api_type_has_tag, iFLu) GO(gst_meta_api_type_register, LFpp) -//GO(gst_meta_compare_seqnum, -//GO(gst_meta_flags_get_type, -//GO(gst_meta_get_info, -//GO(gst_meta_get_seqnum, -//GO(gst_meta_register, -//DATAB(_gst_meta_tag_memory, -//DATAB(_gst_meta_transform_copy, -//GO(gst_mini_object_add_parent, +GO(gst_meta_compare_seqnum, iFpp) +GO(gst_meta_flags_get_type, LFv) +GO(gst_meta_get_info, pFp) +GO(gst_meta_get_seqnum, LFp) +//GOM(gst_meta_register, pFELpLppp) +//DATAB(_gst_meta_tag_memory, 4) +//DATAB(_gst_meta_transform_copy, 4) +GO(gst_mini_object_add_parent, vFpp) GO(gst_mini_object_copy, pFp) -//GO(gst_mini_object_flags_get_type, -GO(gst_mini_object_get_qdata, pFpp) -//GO(gst_mini_object_init, +GO(gst_mini_object_flags_get_type, LFv) +GO(gst_mini_object_get_qdata, pFpu) +GOM(gst_mini_object_init, vFEpuLppp) GO(gst_mini_object_is_writable, iFp) -//GO(gst_mini_object_lock, +GO(gst_mini_object_lock, iFpu) GO(gst_mini_object_make_writable, pFp) GO(gst_mini_object_ref, pFp) -//GO(gst_mini_object_remove_parent, +GO(gst_mini_object_remove_parent, vFpp) GO(gst_mini_object_replace, iFpp) -GOM(gst_mini_object_set_qdata, vFEpppp) -//GO(gst_mini_object_steal, -//GO(gst_mini_object_steal_qdata, -//GO(gst_mini_object_take, -//GO(gst_mini_object_unlock, +GOM(gst_mini_object_set_qdata, vFEpupp) +GO(gst_mini_object_steal, pFp) +GO(gst_mini_object_steal_qdata, pFpu) +GO(gst_mini_object_take, iFpp) +GO(gst_mini_object_unlock, vFpu) GO(gst_mini_object_unref, vFp) -//GO(gst_mini_object_weak_ref, -//GO(gst_mini_object_weak_unref, +//GOM(gst_mini_object_weak_ref, vFEppp) +//GOM(gst_mini_object_weak_unref, vFEppp) GO(gst_object_add_control_binding, iFpp) GO(gst_object_check_uniqueness, iFpp) GO(gst_object_default_deep_notify, vFpppp) @@ -941,12 +945,12 @@ GO(gst_object_set_control_bindings_disabled, vFpi) GO(gst_object_set_control_rate, vFpL) GO(gst_object_set_name, iFpp) GO(gst_object_set_parent, iFpp) -GO(gst_object_suggest_next_sync, UFp) +GO(gst_object_suggest_next_sync, LFp) GO(gst_object_sync_values, iFpL) GO(gst_object_unparent, vFp) GO(gst_object_unref, vFp) -GO(gst_pad_activate_mode, iFpii) -GOM(gst_pad_add_probe, LFEpippp) +GO(gst_pad_activate_mode, iFpui) +GOM(gst_pad_add_probe, LFEpuppp) GO(gst_pad_can_link, iFpp) GO(gst_pad_chain, iFpp) GO(gst_pad_chain_list, iFpp) @@ -957,23 +961,23 @@ GOM(gst_pad_create_stream_id_printf_valist, pFEpppA) GO(gst_pad_direction_get_type, LFv) GO(gst_pad_event_default, iFppp) GO(gst_pad_flags_get_type, LFv) -//GOM(gst_pad_forward, iFEpBp) +//GOM(gst_pad_forward, iFEppp) GO(gst_pad_get_allowed_caps, pFp) GO(gst_pad_get_current_caps, pFp) -GO(gst_pad_get_direction, iFp) +GO(gst_pad_get_direction, uFp) GO(gst_pad_get_element_private, pFp) GO(gst_pad_get_last_flow_return, iFp) -GO(gst_pad_get_offset, IFp) +GO(gst_pad_get_offset, lFp) GO(gst_pad_get_pad_template, pFp) GO(gst_pad_get_pad_template_caps, pFp) GO(gst_pad_get_parent_element, pFp) GO(gst_pad_get_peer, pFp) -GO(gst_pad_get_range, iFpUup) +GO(gst_pad_get_range, iFpLup) GO(gst_pad_get_single_internal_link, pFp) -GO(gst_pad_get_sticky_event, pFpiu) +GO(gst_pad_get_sticky_event, pFpuu) GO(gst_pad_get_stream, pFp) GO(gst_pad_get_stream_id, pFp) -GO(gst_pad_get_task_state, iFp) +GO(gst_pad_get_task_state, uFp) GO(gst_pad_get_type, LFv) GO(gst_pad_has_current_caps, iFp) GO(gst_pad_is_active, iFp) @@ -984,117 +988,117 @@ GO(gst_pad_iterate_internal_links, pFp) GO(gst_pad_iterate_internal_links_default, pFpp) GO(gst_pad_link, iFpp) GO(gst_pad_link_check_get_type, LFv) -GO(gst_pad_link_full, iFppi) +GO(gst_pad_link_full, iFppu) GO(gst_pad_link_get_name, pFi) GO(gst_pad_link_maybe_ghosting, iFpp) -GO(gst_pad_link_maybe_ghosting_full, iFppi) +GO(gst_pad_link_maybe_ghosting_full, iFppu) GO(gst_pad_link_return_get_type, LFv) GO(gst_pad_mark_reconfigure, vFp) GO(gst_pad_mode_get_name, pFu) GO(gst_pad_mode_get_type, LFv) GO(gst_pad_needs_reconfigure, iFp) -GO(gst_pad_new, pFpi) +GO(gst_pad_new, pFpu) GO(gst_pad_new_from_static_template, pFpp) GO(gst_pad_new_from_template, pFpp) GO(gst_pad_pause_task, iFp) GO(gst_pad_peer_query, iFpp) GO(gst_pad_peer_query_accept_caps, iFpp) GO(gst_pad_peer_query_caps, pFpp) -GO(gst_pad_peer_query_convert, iFpiIip) -GO(gst_pad_peer_query_duration, iFpip) -GO(gst_pad_peer_query_position, iFpip) +GO(gst_pad_peer_query_convert, iFpulup) +GO(gst_pad_peer_query_duration, iFpup) +GO(gst_pad_peer_query_position, iFpup) GO(gst_pad_presence_get_type, LFv) -//GO(gst_pad_probe_info_get_buffer, +GO(gst_pad_probe_info_get_buffer, pFp) GO(gst_pad_probe_info_get_buffer_list, pFp) -//GO(gst_pad_probe_info_get_event, -//GO(gst_pad_probe_info_get_query, -//GO(gst_pad_probe_return_get_type, -//GO(gst_pad_probe_type_get_type, +GO(gst_pad_probe_info_get_event, pFp) +GO(gst_pad_probe_info_get_query, pFp) +GO(gst_pad_probe_return_get_type, LFv) +GO(gst_pad_probe_type_get_type, LFv) GO(gst_pad_proxy_query_accept_caps, iFpp) GO(gst_pad_proxy_query_caps, iFpp) -GO(gst_pad_pull_range, iFpUup) +GO(gst_pad_pull_range, iFpLup) GO(gst_pad_push, iFpp) GO(gst_pad_push_event, iFpp) GO(gst_pad_push_list, iFpp) GO(gst_pad_query, iFpp) GO(gst_pad_query_accept_caps, iFpp) GO(gst_pad_query_caps, pFpp) -GO(gst_pad_query_convert, iFpiIip) +GO(gst_pad_query_convert, iFpulup) GO(gst_pad_query_default, iFppp) -GO(gst_pad_query_duration, iFppp) -GO(gst_pad_query_position, iFppp) +GO(gst_pad_query_duration, iFpup) +GO(gst_pad_query_position, iFpup) GO(gst_pad_remove_probe, vFpL) GO(gst_pad_send_event, iFpp) GOM(gst_pad_set_activate_function_full, vFEpppp) GOM(gst_pad_set_activatemode_function_full, vFEpppp) GO(gst_pad_set_active, iFpi) GOM(gst_pad_set_chain_function_full, vFEpppp) -//GOM(gst_pad_set_chain_list_function_full, vFEpBpB) +GOM(gst_pad_set_chain_list_function_full, vFEpppp) GO(gst_pad_set_element_private, vFpp) -//GOM(gst_pad_set_event_full_function_full, vFpBpB) +GOM(gst_pad_set_event_full_function_full, vFEpppp) GOM(gst_pad_set_event_function_full, vFEpppp) GOM(gst_pad_set_getrange_function_full, vFEpppp) GOM(gst_pad_set_iterate_internal_links_function_full, vFEpppp) GOM(gst_pad_set_link_function_full, vFEpppp) -GO(gst_pad_set_offset, vFpI) +GO(gst_pad_set_offset, vFpl) GOM(gst_pad_set_query_function_full, vFEpppp) -//GOM(gst_pad_set_unlink_function_full, vFEpBpB) +//GOM(gst_pad_set_unlink_function_full, vFEpppp) GOM(gst_pad_start_task, iFEpppp) GOM(gst_pad_sticky_events_foreach, vFEppp) GO(gst_pad_stop_task, iFp) GO(gst_pad_store_sticky_event, iFpp) GO(gst_pad_template_flags_get_type, LFv) GO(gst_pad_template_get_caps, pFp) -//GO(gst_pad_template_get_documentation_caps, -//GO(gst_pad_template_get_type, -GO(gst_pad_template_new, pFpiip) -//GO(gst_pad_template_new_from_static_pad_template_with_gtype, -GO(gst_pad_template_new_with_gtype, pFpiipL) -//GO(gst_pad_template_pad_created, -//GO(gst_pad_template_set_documentation_caps, +GO(gst_pad_template_get_documentation_caps, pFp) +GO(gst_pad_template_get_type, LFv) +GO(gst_pad_template_new, pFpuup) +GO(gst_pad_template_new_from_static_pad_template_with_gtype, pFpL) +GO(gst_pad_template_new_with_gtype, pFpuupL) +GO(gst_pad_template_pad_created, vFpp) +GO(gst_pad_template_set_documentation_caps, vFpp) GO(gst_pad_unlink, iFpp) GO(gst_pad_use_fixed_caps, vFp) GO(gst_param_spec_array, pFppppi) -//GO(gst_param_spec_array_get_type, +GO(gst_param_spec_array_get_type, LFv) GO(gst_param_spec_fraction, pFpppiiiiiii) -//GO(gst_param_spec_fraction_get_type, -//GO(gst_parent_buffer_meta_api_get_type, -//GO(gst_parent_buffer_meta_get_info, +GO(gst_param_spec_fraction_get_type, LFv) +GO(gst_parent_buffer_meta_api_get_type, LFv) +GO(gst_parent_buffer_meta_get_info, pFv) GO(gst_parse_bin_from_description, pFpip) GO(gst_parse_bin_from_description_full, pFpipup) GO(gst_parse_context_copy, pFp) -//GO(gst_parse_context_free, +GO(gst_parse_context_free, vFp) GO(gst_parse_context_get_missing_elements, pFp) GO(gst_parse_context_get_type, LFv) GO(gst_parse_context_new, pFv) -//GO(gst_parse_error_get_type, +GO(gst_parse_error_get_type, LFv) GO(gst_parse_error_quark, uFv) -//GO(gst_parse_flags_get_type, +GO(gst_parse_flags_get_type, LFv) GO(gst_parse_launch, pFpp) GO(gst_parse_launch_full, pFppup) GO(gst_parse_launchv, pFpp) GO(gst_parse_launchv_full, pFppup) -//GO(gst_pipeline_auto_clock, -//GO(gst_pipeline_flags_get_type, +GO(gst_pipeline_auto_clock, vFp) +GO(gst_pipeline_flags_get_type, LFv) GO(gst_pipeline_get_auto_flush_bus, iFp) GO(gst_pipeline_get_bus, pFp) -//GO(gst_pipeline_get_clock, -//GO(gst_pipeline_get_delay, +GO(gst_pipeline_get_clock, pFp) +GO(gst_pipeline_get_delay, LFp) GO(gst_pipeline_get_latency, LFp) GO(gst_pipeline_get_pipeline_clock, pFp) -//GO(gst_pipeline_get_type, +GO(gst_pipeline_get_type, LFv) GO(gst_pipeline_new, pFp) GO(gst_pipeline_set_auto_flush_bus, vFpi) GO(gst_pipeline_set_clock, iFpp) -//GO(gst_pipeline_set_delay, +GO(gst_pipeline_set_delay, vFpL) GO(gst_pipeline_set_latency, vFpL) GO(gst_pipeline_use_clock, vFpp) GO(gst_plugin_add_dependency, vFppppu) GO(gst_plugin_add_dependency_simple, vFppppu) -//GO(gst_plugin_api_flags_get_type, -//GO(gst_plugin_dependency_flags_get_type, -//GO(gst_plugin_error_get_type, -//GO(gst_plugin_error_quark, +GO(gst_plugin_api_flags_get_type, LFv) +GO(gst_plugin_dependency_flags_get_type, LFv) +GO(gst_plugin_error_get_type, LFv) +GO(gst_plugin_error_quark, uFv) GO(gst_plugin_feature_check_version, iFpuuu) GO(gst_plugin_feature_get_plugin, pFp) GO(gst_plugin_feature_get_plugin_name, pFp) @@ -1106,39 +1110,39 @@ GO(gst_plugin_feature_list_free, vFp) GO(gst_plugin_feature_load, pFp) GO(gst_plugin_feature_rank_compare_func, iFpp) GO(gst_plugin_feature_set_rank, vFpu) -//GO(gst_plugin_flags_get_type, +GO(gst_plugin_flags_get_type, LFv) GO(gst_plugin_get_cache_data, pFp) -//GO(gst_plugin_get_description, -//GO(gst_plugin_get_filename, -//GO(gst_plugin_get_license, -//GO(gst_plugin_get_name, -//GO(gst_plugin_get_origin, -//GO(gst_plugin_get_package, +GO(gst_plugin_get_description, pFp) +GO(gst_plugin_get_filename, pFp) +GO(gst_plugin_get_license, pFp) +GO(gst_plugin_get_name, pFp) +GO(gst_plugin_get_origin, pFp) +GO(gst_plugin_get_package, pFp) GO(gst_plugin_get_release_date_string, pFp) -//GO(gst_plugin_get_source, -//GO(gst_plugin_get_type, -//GO(gst_plugin_get_version, +GO(gst_plugin_get_source, pFp) +GO(gst_plugin_get_type, LFv) +GO(gst_plugin_get_version, pFp) GO(gst_plugin_is_loaded, iFp) -//GO(gst_plugin_list_free, +GO(gst_plugin_list_free, vFp) GO(gst_plugin_load, pFp) GO(gst_plugin_load_by_name, pFp) //GO(_gst_plugin_loader_client_run, GOM(gst_plugin_load_file, pFEpp) GOM(gst_plugin_register_static, iFEiipppppppp) -//GO(gst_plugin_register_static_full, +//GOM(gst_plugin_register_static_full, iFEiippppppppp) GO(gst_plugin_set_cache_data, vFpp) -//GO(gst_poll_add_fd, -//GO(gst_poll_fd_can_read, -//GO(gst_poll_fd_can_write, +GO(gst_poll_add_fd, iFpp) +GO(gst_poll_fd_can_read, iFpp) +GO(gst_poll_fd_can_write, iFpp) GO(gst_poll_fd_ctl_pri, iFppi) -//GO(gst_poll_fd_ctl_read, -//GO(gst_poll_fd_ctl_write, -//GO(gst_poll_fd_has_closed, -//GO(gst_poll_fd_has_error, +GO(gst_poll_fd_ctl_read, iFppi) +GO(gst_poll_fd_ctl_write, iFppi) +GO(gst_poll_fd_has_closed, iFpp) +GO(gst_poll_fd_has_error, iFpp) GO(gst_poll_fd_has_pri, iFpp) GO(gst_poll_fd_ignored, vFpp) GO(gst_poll_fd_init, vFp) -//GO(gst_poll_free, +GO(gst_poll_free, vFp) GO(gst_poll_get_read_gpollfd, vFpp) GO(gst_poll_new, pFi) GO(gst_poll_new_timer, pFv) @@ -1148,53 +1152,53 @@ GO(gst_poll_restart, vFp) GO(gst_poll_set_controllable, iFpi) GO(gst_poll_set_flushing, vFpi) GO(gst_poll_wait, iFpL) -//GO(gst_poll_write_control, +GO(gst_poll_write_control, iFp) GO(gst_preset_delete_preset, iFpp) -//GO(gst_preset_get_app_dir, +GO(gst_preset_get_app_dir, pFv) GO(gst_preset_get_meta, iFpppp) -//GO(gst_preset_get_preset_names, +GO(gst_preset_get_preset_names, pFp) GO(gst_preset_get_property_names, pFp) GO(gst_preset_get_type, LFv) GO(gst_preset_is_editable, iFp) -//GO(gst_preset_load_preset, +GO(gst_preset_load_preset, iFpp) GO(gst_preset_rename_preset, iFppp) -//GO(gst_preset_save_preset, +GO(gst_preset_save_preset, iFpp) GO(gst_preset_set_app_dir, iFp) GO(gst_preset_set_meta, iFpppp) -//GO(gst_print, -//GO(gst_printerr, -//GO(gst_printerrln, -//GO(gst_println, -//GO(gst_progress_type_get_type, -//GO(gst_promise_expire, -//GO(gst_promise_get_reply, -//GO(gst_promise_get_type, -//GO(gst_promise_interrupt, -//GO(gst_promise_new, -//GO(gst_promise_new_with_change_func, -//GO(gst_promise_ref, -//GO(gst_promise_reply, -//GO(gst_promise_result_get_type, -//GO(gst_promise_unref, -//GO(gst_promise_wait, +//GOM(gst_print, vFEpV) +//GOM(gst_printerr, vFEpV) +//GOM(gst_printerrln, vFEpV) +//GOM(gst_println, vFEpV) +GO(gst_progress_type_get_type, LFv) +GO(gst_promise_expire, vFp) +GO(gst_promise_get_reply, pFp) +GO(gst_promise_get_type, LFv) +GO(gst_promise_interrupt, vFp) +GO(gst_promise_new, pFv) +//GOM(gst_promise_new_with_change_func, pFEppp) +GO(gst_promise_ref, pFp) +GO(gst_promise_reply, vFpp) +GO(gst_promise_result_get_type, LFv) +GO(gst_promise_unref, vFp) +GO(gst_promise_wait, uFp) GO(gst_protection_filter_systems_by_available_decryptors, pFp) -//GO(gst_protection_meta_api_get_type, -//GO(gst_protection_meta_get_info, +GO(gst_protection_meta_api_get_type, LFv) +GO(gst_protection_meta_get_info, pFv) GO(gst_protection_select_system, pFp) -//GO(gst_proxy_pad_chain_default, -//GO(gst_proxy_pad_chain_list_default, -//GO(gst_proxy_pad_get_internal, -//GO(gst_proxy_pad_getrange_default, -//GO(gst_proxy_pad_get_type, -//GO(gst_proxy_pad_iterate_internal_links_default, -//GO(gst_qos_type_get_type, -GO(gst_query_add_allocation_meta, vFppp) +GO(gst_proxy_pad_chain_default, iFppp) +GO(gst_proxy_pad_chain_list_default, iFppp) +GO(gst_proxy_pad_get_internal, pFp) +GO(gst_proxy_pad_getrange_default, iFppLup) +GO(gst_proxy_pad_get_type, LFv) +GO(gst_proxy_pad_iterate_internal_links_default, pFpp) +GO(gst_qos_type_get_type, LFv) +GO(gst_query_add_allocation_meta, vFpLp) GO(gst_query_add_allocation_param, vFppp) GO(gst_query_add_allocation_pool, vFppuuu) -GO(gst_query_add_buffering_range, iFpII) -GO(gst_query_add_scheduling_mode, vFpi) +GO(gst_query_add_buffering_range, iFpll) +GO(gst_query_add_scheduling_mode, vFpu) GO(gst_query_copy, pFp) -GO(gst_query_find_allocation_meta, iFppp) +GO(gst_query_find_allocation_meta, iFpLp) GO(gst_query_get_n_allocation_metas, uFp) GO(gst_query_get_n_allocation_params, uFp) GO(gst_query_get_n_allocation_pools, uFp) @@ -1202,24 +1206,24 @@ GO(gst_query_get_n_buffering_ranges, uFp) GO(gst_query_get_n_scheduling_modes, uFp) GO(gst_query_get_structure, pFp) GO(gst_query_get_type, LFv) -GO(gst_query_has_scheduling_mode, iFpi) -GO(gst_query_has_scheduling_mode_with_flags, iFpii) +GO(gst_query_has_scheduling_mode, iFpu) +GO(gst_query_has_scheduling_mode_with_flags, iFpuu) GO(gst_query_new_accept_caps, pFp) GO(gst_query_new_allocation, pFpi) GO(gst_query_new_bitrate, pFv) -GO(gst_query_new_buffering, pFi) +GO(gst_query_new_buffering, pFu) GO(gst_query_new_caps, pFp) GO(gst_query_new_context, pFp) -GO(gst_query_new_convert, pFiIi) -GO(gst_query_new_custom, pFip) +GO(gst_query_new_convert, pFulu) +GO(gst_query_new_custom, pFup) GO(gst_query_new_drain, pFv) -GO(gst_query_new_duration, pFi) +GO(gst_query_new_duration, pFu) GO(gst_query_new_formats, pFv) GO(gst_query_new_latency, pFv) -GO(gst_query_new_position, pFi) +GO(gst_query_new_position, pFu) GO(gst_query_new_scheduling, pFv) -GO(gst_query_new_seeking, pFi) -GO(gst_query_new_segment, pFi) +GO(gst_query_new_seeking, pFu) +GO(gst_query_new_segment, pFu) GO(gst_query_new_uri, pFv) GO(gst_query_parse_accept_caps, vFpp) GO(gst_query_parse_accept_caps_result, vFpp) @@ -1236,12 +1240,12 @@ GO(gst_query_parse_convert, vFppppp) GO(gst_query_parse_duration, vFppp) GO(gst_query_parse_latency, vFpppp) GO(gst_query_parse_n_formats, vFpp) -GO(gst_query_parse_nth_allocation_meta, pFpup) +GO(gst_query_parse_nth_allocation_meta, LFpup) GO(gst_query_parse_nth_allocation_param, vFpupp) GO(gst_query_parse_nth_allocation_pool, vFpupppp) GO(gst_query_parse_nth_buffering_range, iFpupp) GO(gst_query_parse_nth_format, vFpup) -GO(gst_query_parse_nth_scheduling_mode, iFpu) +GO(gst_query_parse_nth_scheduling_mode, uFpu) GO(gst_query_parse_position, vFppp) GO(gst_query_parse_scheduling, vFppppp) GO(gst_query_parse_seeking, vFppppp) @@ -1257,26 +1261,26 @@ GO(gst_query_replace, iFpp) GO(gst_query_set_accept_caps_result, vFpi) GO(gst_query_set_bitrate, vFpu) GO(gst_query_set_buffering_percent, vFpii) -GO(gst_query_set_buffering_range, vFpiIII) -GO(gst_query_set_buffering_stats, vFpiiiI) +GO(gst_query_set_buffering_range, vFpulll) +GO(gst_query_set_buffering_stats, vFpuiil) GO(gst_query_set_caps_result, vFpp) GO(gst_query_set_context, vFpp) -GO(gst_query_set_convert, vFpiIiI) -GO(gst_query_set_duration, vFpiI) -//GOM(gst_query_set_formats, vFEpiV) -GO(gst_query_set_formatsv, vFppp) -GO(gst_query_set_latency, vFpiUU) +GO(gst_query_set_convert, vFpulul) +GO(gst_query_set_duration, vFpul) +GOM(gst_query_set_formats, vFEpiV) +GO(gst_query_set_formatsv, vFpip) +GO(gst_query_set_latency, vFpiLL) GO(gst_query_set_nth_allocation_param, vFpupp) GO(gst_query_set_nth_allocation_pool, vFpupuuu) -GO(gst_query_set_position, vFpiI) -GO(gst_query_set_scheduling, vFpiiii) -GO(gst_query_set_seeking, vFpiiII) -GO(gst_query_set_segment, vFpdiII) +GO(gst_query_set_position, vFpul) +GO(gst_query_set_scheduling, vFpuiii) +GO(gst_query_set_seeking, vFpuill) +GO(gst_query_set_segment, vFpdull) GO(gst_query_set_uri, vFpp) GO(gst_query_set_uri_redirection, vFpp) GO(gst_query_set_uri_redirection_permanent, vFpi) GO(gst_query_take, iFpp) -//DATAB(_gst_query_type, +DATAB(_gst_query_type, 8) GO(gst_query_type_flags_get_type, LFv) GO(gst_query_type_get_flags, uFu) GO(gst_query_type_get_name, pFu) @@ -1284,31 +1288,31 @@ GO(gst_query_type_get_type, LFv) GO(gst_query_type_to_quark, uFu) GO(gst_query_unref, vFp) GO(gst_query_writable_structure, pFp) -//GO(gst_rank_get_type, -//GO(gst_reference_timestamp_meta_api_get_type, -//GO(gst_reference_timestamp_meta_get_info, +GO(gst_rank_get_type, LFv) +GO(gst_reference_timestamp_meta_api_get_type, LFv) +GO(gst_reference_timestamp_meta_get_info, pFv) GO(gst_registry_add_feature, iFpp) GO(gst_registry_add_plugin, iFpp) GO(gst_registry_check_feature_version, iFppuuu) GOM(gst_registry_feature_filter, pFEppip) GO(gst_registry_find_feature, pFppL) GO(gst_registry_find_plugin, pFpp) -//GO(gst_registry_fork_is_enabled, +GO(gst_registry_fork_is_enabled, iFv) GO(gst_registry_fork_set_enabled, vFi) GO(gst_registry_get, pFv) GO(gst_registry_get_feature_list, pFpL) GO(gst_registry_get_feature_list_by_plugin, pFpp) GO(gst_registry_get_feature_list_cookie, uFp) GO(gst_registry_get_plugin_list, pFp) -//GO(gst_registry_get_type, +GO(gst_registry_get_type, LFv) GO(gst_registry_lookup, pFpp) GO(gst_registry_lookup_feature, pFpp) -//GO(gst_registry_plugin_filter, +//GOM(gst_registry_plugin_filter, pFEppip) GO(gst_registry_remove_feature, vFpp) GO(gst_registry_remove_plugin, vFpp) GO(gst_registry_scan_path, iFpp) -//GO(gst_resource_error_get_type, -GO(gst_resource_error_quark, pFv) +GO(gst_resource_error_get_type, LFv) +GO(gst_resource_error_quark, uFv) GO(gst_sample_copy, pFp) GO(gst_sample_get_buffer, pFp) GO(gst_sample_get_buffer_list, pFp) @@ -1318,13 +1322,13 @@ GO(gst_sample_get_segment, pFp) GO(gst_sample_get_type, LFv) GO(gst_sample_new, pFpppp) GO(gst_sample_ref, pFp) -//GO(gst_sample_set_buffer, +GO(gst_sample_set_buffer, vFpp) GO(gst_sample_set_buffer_list, vFpp) -//GO(gst_sample_set_caps, +GO(gst_sample_set_caps, vFpp) GO(gst_sample_set_info, iFpp) GO(gst_sample_set_segment, vFpp) -DATAB(_gst_sample_type, sizeof(long)) -//GO(gst_sample_unref, +DATAB(_gst_sample_type, 8) +GO(gst_sample_unref, vFp) GO(gst_scheduling_flags_get_type, LFv) GO(gst_search_mode_get_type, LFv) GO(gst_seek_flags_get_type, LFv) @@ -1342,14 +1346,14 @@ GO(gst_segment_new, pFv) GO(gst_segment_offset_running_time, iFpul) GO(gst_segment_position_from_running_time, LFpuL) GO(gst_segment_position_from_running_time_full, iFpuLp) -GO(gst_segment_position_from_stream_time, UFpiU) -GO(gst_segment_position_from_stream_time_full, iFpiUp) +GO(gst_segment_position_from_stream_time, LFpuL) +GO(gst_segment_position_from_stream_time_full, iFpuLp) GO(gst_segment_set_running_time, iFpuL) -//GO(gst_segment_to_position, -GO(gst_segment_to_running_time, UFpiU) -GO(gst_segment_to_running_time_full, iFpiUp) -GO(gst_segment_to_stream_time, UFpiU) -GO(gst_segment_to_stream_time_full, iFpiUp) +GO(gst_segment_to_position, LFpuL) +GO(gst_segment_to_running_time, LFpuL) +GO(gst_segment_to_running_time_full, iFpuLp) +GO(gst_segment_to_stream_time, LFpuL) +GO(gst_segment_to_stream_time_full, iFpuLp) GO(gst_segtrap_is_enabled, iFv) GO(gst_segtrap_set_enabled, vFi) GO(gst_stack_trace_flags_get_type, LFv) @@ -1366,28 +1370,28 @@ GO(gst_static_pad_template_get_type, LFv) GO(gst_stream_collection_add_stream, iFpp) GO(gst_stream_collection_get_size, uFp) GO(gst_stream_collection_get_stream, pFpu) -//GO(gst_stream_collection_get_type, +GO(gst_stream_collection_get_type, LFv) GO(gst_stream_collection_get_upstream_id, pFp) GO(gst_stream_collection_new, pFp) -//GO(gst_stream_error_get_type, -GO(gst_stream_error_quark, pFv) -//GO(gst_stream_flags_get_type, +GO(gst_stream_error_get_type, LFv) +GO(gst_stream_error_quark, uFv) +GO(gst_stream_flags_get_type, LFv) GO(gst_stream_get_caps, pFp) GO(gst_stream_get_stream_flags, uFp) GO(gst_stream_get_stream_id, pFp) GO(gst_stream_get_stream_type, uFp) GO(gst_stream_get_tags, pFp) -//GO(gst_stream_get_type, +GO(gst_stream_get_type, LFv) GO(gst_stream_new, pFppuu) GO(gst_stream_set_caps, vFpp) GO(gst_stream_set_stream_flags, vFpu) GO(gst_stream_set_stream_type, vFpu) GO(gst_stream_set_tags, vFpp) -//GO(gst_stream_status_type_get_type, +GO(gst_stream_status_type_get_type, LFv) GO(gst_stream_type_get_name, pFu) -//GO(gst_stream_type_get_type, +GO(gst_stream_type_get_type, LFv) GO(gst_structure_can_intersect, iFpp) -//GO(gst_structure_change_type_get_type, +GO(gst_structure_change_type_get_type, LFv) GO(gst_structure_copy, pFp) GOM(gst_structure_filter_and_map_in_place, vFEppp) GO(gst_structure_fixate, vFp) @@ -1425,23 +1429,23 @@ GO(gst_structure_get_value, pFpp) GO(gst_structure_has_field, iFpp) GO(gst_structure_has_field_typed, iFppL) GO(gst_structure_has_name, iFpp) -//GOM(gst_structure_id_get, iFEppV) -//GOM(gst_structure_id_get_valist, iFEppA) +//GOM(gst_structure_id_get, iFEpuV) +//GOM(gst_structure_id_get_valist, iFEpuA) GO(gst_structure_id_get_value, pFpu) GO(gst_structure_id_has_field, iFpu) GO(gst_structure_id_has_field_typed, iFpuL) -//GOM(gst_structure_id_set, iFEppV) -//GOM(gst_structure_id_set_valist, iFEppA) +//GOM(gst_structure_id_set, vFEpuV) +//GOM(gst_structure_id_set_valist, vFEpuA) GO(gst_structure_id_set_value, vFpup) GO(gst_structure_id_take_value, vFpup) GO(gst_structure_intersect, pFpp) GO(gst_structure_is_equal, iFpp) GO(gst_structure_is_subset, iFpp) -//GOM(gst_structure_map_in_place, iFEpBp) +//GOM(gst_structure_map_in_place, iFEppp) GOM(gst_structure_new, pFEppV) GO(gst_structure_new_empty, pFp) GO(gst_structure_new_from_string, pFp) -//GOM(gst_structure_new_id, pFEppV) +//GOM(gst_structure_new_id, pFEuuV) GO(gst_structure_new_id_empty, pFu) GOM(gst_structure_new_valist, pFppA) GO(gst_structure_n_fields, iFp) @@ -1460,22 +1464,22 @@ GO(gst_structure_set_value, vFppp) GO(gst_structure_take, iFpp) GO(gst_structure_take_value, vFppp) GO(gst_structure_to_string, pFp) -DATAB(_gst_structure_type, sizeof(void*)) -//GO(gst_system_clock_get_type, +DATAB(_gst_structure_type, 8) +GO(gst_system_clock_get_type, LFv) GO(gst_system_clock_obtain, pFv) GO(gst_system_clock_set_default, vFp) -//GO(gst_tag_exists, -//GO(gst_tag_flag_get_type, +GO(gst_tag_exists, iFp) +GO(gst_tag_flag_get_type, LFv) GO(gst_tag_get_description, pFp) GO(gst_tag_get_flag, uFp) -//GO(gst_tag_get_nick, +GO(gst_tag_get_nick, pFp) GO(gst_tag_get_type, LFp) -//GO(gst_tag_is_fixed, -GOM(gst_tag_list_add, vFEpipV) -GOM(gst_tag_list_add_valist, vFEpipA) -GOM(gst_tag_list_add_valist_values, vFEpipA) -GO(gst_tag_list_add_value, vFpipp) -GOM(gst_tag_list_add_values, vFEpipV) +GO(gst_tag_is_fixed, iFp) +GOM(gst_tag_list_add, vFEpupV) +GOM(gst_tag_list_add_valist, vFEpupA) +GOM(gst_tag_list_add_valist_values, vFEpupA) +GO(gst_tag_list_add_value, vFpupp) +GOM(gst_tag_list_add_values, vFEpupV) GO(gst_tag_list_copy, pFp) GO(gst_tag_list_copy_value, iFppp) GOM(gst_tag_list_foreach, vFEppp) @@ -1497,7 +1501,7 @@ GO(gst_tag_list_get_pointer, iFppp) GO(gst_tag_list_get_pointer_index, iFppup) GO(gst_tag_list_get_sample, iFppp) GO(gst_tag_list_get_sample_index, iFppup) -GO(gst_tag_list_get_scope, iFp) +GO(gst_tag_list_get_scope, uFp) GO(gst_tag_list_get_string, iFppp) GO(gst_tag_list_get_string_index, iFppup) GO(gst_tag_list_get_tag_size, uFpp) @@ -1507,10 +1511,10 @@ GO(gst_tag_list_get_uint64, iFppp) GO(gst_tag_list_get_uint64_index, iFppup) GO(gst_tag_list_get_uint_index, iFppup) GO(gst_tag_list_get_value_index, pFppu) -GO(gst_tag_list_insert, vFppi) +GO(gst_tag_list_insert, vFppu) GO(gst_tag_list_is_empty, iFp) GO(gst_tag_list_is_equal, iFpp) -GO(gst_tag_list_merge, pFppi) +GO(gst_tag_list_merge, pFppu) GOM(gst_tag_list_new, pFEpV) GO(gst_tag_list_new_empty, pFv) GO(gst_tag_list_new_from_string, pFp) @@ -1521,52 +1525,52 @@ GO(gst_tag_list_peek_string_index, iFppup) GO(gst_tag_list_ref, pFp) GO(gst_tag_list_remove_tag, vFpp) GO(gst_tag_list_replace, iFpp) -GO(gst_tag_list_set_scope, vFpi) +GO(gst_tag_list_set_scope, vFpu) GO(gst_tag_list_take, iFpp) GO(gst_tag_list_to_string, pFp) -DATAB(_gst_tag_list_type, sizeof(void*)) +DATAB(_gst_tag_list_type, 8) GO(gst_tag_list_unref, vFp) GO(gst_tag_merge_mode_get_type, LFv) -//GO(gst_tag_merge_strings_with_comma, -//GO(gst_tag_merge_use_first, -//GO(gst_tag_register, -//GO(gst_tag_register_static, -//GO(gst_tag_scope_get_type, -//GO(gst_tag_setter_add_tags, -//GO(gst_tag_setter_add_tag_valist, -//GO(gst_tag_setter_add_tag_valist_values, +GO(gst_tag_merge_strings_with_comma, vFpp) +GO(gst_tag_merge_use_first, vFpp) +GOM(gst_tag_register, vFEpuLppp) +//GOM(gst_tag_register_static, vFEpuLppp) +GO(gst_tag_scope_get_type, LFv) +//GOM(gst_tag_setter_add_tags, vFEpupV) +//GOM(gst_tag_setter_add_tag_valist, vFEpupA) +//GOM(gst_tag_setter_add_tag_valist_values, vFEpupA) GO(gst_tag_setter_add_tag_value, vFpupp) -//GO(gst_tag_setter_add_tag_values, +//GOM(gst_tag_setter_add_tag_values, vFEpupV) GO(gst_tag_setter_get_tag_list, pFp) GO(gst_tag_setter_get_tag_merge_mode, uFp) GO(gst_tag_setter_get_type, LFv) -GO(gst_tag_setter_merge_tags, vFppi) +GO(gst_tag_setter_merge_tags, vFppu) GO(gst_tag_setter_reset_tags, vFp) GO(gst_tag_setter_set_tag_merge_mode, vFpu) -//GO(gst_task_cleanup_all, -//GO(gst_task_get_pool, -//GO(gst_task_get_state, +GO(gst_task_cleanup_all, vFv) +GO(gst_task_get_pool, pFp) +GO(gst_task_get_state, uFp) GO(gst_task_get_type, LFv) GO(gst_task_join, iFp) GOM(gst_task_new, pFEppp) GO(gst_task_pause, iFp) GO(gst_task_pool_cleanup, vFp) GO(gst_task_pool_get_type, LFv) -//GO(gst_task_pool_join, -//GO(gst_task_pool_new, -GO(gst_task_pool_prepare, vFp) -//GO(gst_task_pool_push, -//GO(gst_task_resume, -//GO(gst_task_set_enter_callback, -//GO(gst_task_set_leave_callback, +GO(gst_task_pool_join, vFpp) +GO(gst_task_pool_new, pFv) +GO(gst_task_pool_prepare, vFpp) +//GOM(gst_task_pool_push, pFEpppp) +GO(gst_task_resume, iFp) +//GOM(gst_task_set_enter_callback, vFEpppp) +//GOM(gst_task_set_leave_callback, vFEpppp) GO(gst_task_set_lock, vFpp) GO(gst_task_set_pool, vFpp) -//GO(gst_task_set_state, +GO(gst_task_set_state, iFpu) GO(gst_task_start, iFp) GO(gst_task_state_get_type, LFv) GO(gst_task_stop, iFp) GO(gst_toc_append_entry, vFpp) -//GO(gst_toc_dump, +GO(gst_toc_dump, vFp) GO(gst_toc_entry_append_sub_entry, vFpp) GO(gst_toc_entry_get_entry_type, iFp) GO(gst_toc_entry_get_loop, iFppp) @@ -1575,87 +1579,87 @@ GO(gst_toc_entry_get_start_stop_times, iFppp) GO(gst_toc_entry_get_sub_entries, pFp) GO(gst_toc_entry_get_tags, pFp) GO(gst_toc_entry_get_toc, pFp) -//GO(gst_toc_entry_get_type, +GO(gst_toc_entry_get_type, LFv) GO(gst_toc_entry_get_uid, pFp) -//GO(gst_toc_entry_is_alternative, +GO(gst_toc_entry_is_alternative, iFp) GO(gst_toc_entry_is_sequence, iFp) -GO(gst_toc_entry_merge_tags, vFppi) +GO(gst_toc_entry_merge_tags, vFppu) GO(gst_toc_entry_new, pFip) GO(gst_toc_entry_set_loop, vFpui) GO(gst_toc_entry_set_start_stop_times, vFpll) GO(gst_toc_entry_set_tags, vFpp) -//DATAB(_gst_toc_entry_type, +//DATAB(_gst_toc_entry_type, 8) GO(gst_toc_entry_type_get_nick, pFi) -//GO(gst_toc_entry_type_get_type, +GO(gst_toc_entry_type_get_type, LFv) GO(gst_toc_find_entry, pFpp) GO(gst_toc_get_entries, pFp) GO(gst_toc_get_scope, uFp) GO(gst_toc_get_tags, pFp) -//GO(gst_toc_get_type, -//GO(gst_toc_loop_type_get_type, -//GO(gst_toc_merge_tags, +GO(gst_toc_get_type, LFv) +GO(gst_toc_loop_type_get_type, LFv) +GO(gst_toc_merge_tags, vFppu) GO(gst_toc_new, pFu) -//GO(gst_toc_scope_get_type, -//GO(gst_toc_set_tags, +GO(gst_toc_scope_get_type, LFv) +GO(gst_toc_set_tags, vFpp) GO(gst_toc_setter_get_toc, pFp) GO(gst_toc_setter_get_type, LFv) GO(gst_toc_setter_reset, vFp) GO(gst_toc_setter_set_toc, vFpp) -DATAB(_gst_toc_type, sizeof(void*)) -//GO(gst_tracer_factory_get_list, +DATAB(_gst_toc_type, 8) +GO(gst_tracer_factory_get_list, pFv) GO(gst_tracer_factory_get_tracer_type, LFp) -//GO(gst_tracer_factory_get_type, -//GO(gst_tracer_get_type, -//GO(gst_tracer_record_get_type, -//GO(gst_tracer_record_log, -//GO(gst_tracer_record_new, +GO(gst_tracer_factory_get_type, LFv) +GO(gst_tracer_get_type, LFv) +GO(gst_tracer_record_get_type, LFv) +//GOM(gst_tracer_record_log, vFEpV) +//GOM(gst_tracer_record_new, pFEppV) GO(gst_tracer_register, iFppL) -//GO(gst_tracer_value_flags_get_type, -//GO(gst_tracer_value_scope_get_type, -//GO(gst_tracing_get_active_tracers, -//GO(gst_tracing_register_hook, -//GO(gst_type_find_factory_call_function, -//GO(gst_type_find_factory_get_caps, +GO(gst_tracer_value_flags_get_type, LFv) +GO(gst_tracer_value_scope_get_type, LFv) +GO(gst_tracing_get_active_tracers, pFv) +//GOM(gst_tracing_register_hook, vFEppp) +GO(gst_type_find_factory_call_function, vFpp) +GO(gst_type_find_factory_get_caps, pFp) GO(gst_type_find_factory_get_extensions, pFp) GO(gst_type_find_factory_get_list, pFv) -//GO(gst_type_find_factory_get_type, +GO(gst_type_find_factory_get_type, LFv) GO(gst_type_find_factory_has_function, iFp) -GO(gst_type_find_get_length, UFp) -//GO(gst_type_find_get_type, -GO(gst_type_find_peek, pFpUu) -//GO(gst_type_find_probability_get_type, +GO(gst_type_find_get_length, LFp) +GO(gst_type_find_get_type, LFv) +GO(gst_type_find_peek, pFplu) +GO(gst_type_find_probability_get_type, LFv) GOM(gst_type_find_register, iFEppuppppp) GO(gst_type_find_suggest, vFpup) -//GO(gst_type_find_suggest_simple, +//GOM(gst_type_find_suggest_simple, vFEpuppV) GO(gst_type_is_plugin_api, iFLp) GO(gst_type_mark_as_plugin_api, vFLu) GO(gst_update_registry, iFv) -//GO(gst_uri_append_path, -//GO(gst_uri_append_path_segment, -//GO(gst_uri_construct, +GO(gst_uri_append_path, iFpp) +GO(gst_uri_append_path_segment, iFpp) +GO(gst_uri_construct, pFpp) GO(gst_uri_copy, pFp) GO(gst_uri_equal, iFpp) -//GO(gst_uri_error_get_type, -GO(gst_uri_error_quark, pFv) -//GO(gst_uri_from_string, +GO(gst_uri_error_get_type, LFv) +GO(gst_uri_error_quark, uFv) +GO(gst_uri_from_string, pFp) GO(gst_uri_from_string_escaped, pFp) GO(gst_uri_from_string_with_base, pFpp) GO(gst_uri_get_fragment, pFp) -//GO(gst_uri_get_host, +GO(gst_uri_get_host, pFp) GO(gst_uri_get_location, pFp) GO(gst_uri_get_media_fragment_table, pFp) -//GO(gst_uri_get_path, -//GO(gst_uri_get_path_segments, -//GO(gst_uri_get_path_string, +GO(gst_uri_get_path, pFp) +GO(gst_uri_get_path_segments, pFp) +GO(gst_uri_get_path_string, pFp) GO(gst_uri_get_port, uFp) -//GO(gst_uri_get_protocol, +GO(gst_uri_get_protocol, pFp) GO(gst_uri_get_query_keys, pFp) GO(gst_uri_get_query_string, pFp) -//GO(gst_uri_get_query_table, +GO(gst_uri_get_query_table, pFp) GO(gst_uri_get_query_value, pFpp) -//GO(gst_uri_get_scheme, -//GO(gst_uri_get_type, -//GO(gst_uri_get_userinfo, +GO(gst_uri_get_scheme, pFp) +GO(gst_uri_get_type, LFv) +GO(gst_uri_get_userinfo, pFp) GO(gst_uri_handler_get_protocols, pFp) GO(gst_uri_handler_get_type, LFv) GO(gst_uri_handler_get_uri, pFp) @@ -1664,35 +1668,35 @@ GO(gst_uri_handler_set_uri, iFppp) GO(gst_uri_has_protocol, iFpp) GO(gst_uri_is_normalized, iFp) GO(gst_uri_is_valid, iFp) -//GO(gst_uri_is_writable, +GO(gst_uri_is_writable, iFp) GO(gst_uri_join, pFpp) GO(gst_uri_join_strings, pFpp) -//GO(gst_uri_make_writable, +GO(gst_uri_make_writable, pFp) GO(gst_uri_new, pFpppuppp) GO(gst_uri_new_with_base, pFppppuppp) GO(gst_uri_normalize, iFp) GO(gst_uri_protocol_is_supported, iFup) -//GO(gst_uri_protocol_is_valid, +GO(gst_uri_protocol_is_valid, iFp) GO(gst_uri_query_has_key, iFpp) GO(gst_uri_ref, pFp) -//GO(gst_uri_remove_query_key, +GO(gst_uri_remove_query_key, iFpp) GO(gst_uri_set_fragment, iFpp) -//GO(gst_uri_set_host, -//GO(gst_uri_set_path, +GO(gst_uri_set_host, iFpp) +GO(gst_uri_set_path, iFpp) GO(gst_uri_set_path_segments, iFpp) -//GO(gst_uri_set_path_string, +GO(gst_uri_set_path_string, iFpp) GO(gst_uri_set_port, iFpu) -//GO(gst_uri_set_query_string, +GO(gst_uri_set_query_string, iFpp) GO(gst_uri_set_query_table, iFpp) GO(gst_uri_set_query_value, iFppp) -//GO(gst_uri_set_scheme, -//GO(gst_uri_set_userinfo, -//GO(gst_uri_to_string, -//GO(gst_uri_type_get_type, -//GO(gst_uri_unref, -GOM(gst_util_array_binary_search, pFpuLpipp) +GO(gst_uri_set_scheme, iFpp) +GO(gst_uri_set_userinfo, iFpp) +GO(gst_uri_to_string, pFp) +GO(gst_uri_type_get_type, LFv) +GO(gst_uri_unref, vFp) +GOM(gst_util_array_binary_search, pFEpuLpupp) GO(gst_util_double_to_fraction, vFdpp) -//GO(gst_util_dump_buffer, +GO(gst_util_dump_buffer, vFp) GO(gst_util_dump_mem, vFpu) GO(gst_util_fraction_add, iFiiiipp) GO(gst_util_fraction_compare, iFiiii) @@ -1710,62 +1714,62 @@ GO(gst_util_seqnum_next, uFv) GO(gst_util_set_object_arg, vFppp) GO(gst_util_set_object_array, iFppp) GO(gst_util_set_value_from_string, vFpp) -GO(gst_util_uint64_scale, UFUUU) +GO(gst_util_uint64_scale, LFLLL) GO(gst_util_uint64_scale_ceil, LFLLL) -GO(gst_util_uint64_scale_int, UFUii) +GO(gst_util_uint64_scale_int, LFLii) GO(gst_util_uint64_scale_int_ceil, LFLii) -GO(gst_util_uint64_scale_int_round, UFUii) -GO(gst_util_uint64_scale_round, UFUUU) +GO(gst_util_uint64_scale_int_round, LFLii) +GO(gst_util_uint64_scale_round, LFLLL) GO(gst_value_array_append_and_take_value, vFpp) GO(gst_value_array_append_value, vFpp) -GO(gst_value_array_get_size, iFp) -//GO(gst_value_array_get_type, +GO(gst_value_array_get_size, uFp) +GO(gst_value_array_get_type, LFv) GO(gst_value_array_get_value, pFpu) GO(gst_value_array_init, pFpu) GO(gst_value_array_prepend_value, vFpp) -DATAB(_gst_value_array_type, sizeof(void*)) -//GO(gst_value_can_compare, -//GO(gst_value_can_intersect, +DATAB(_gst_value_array_type, 8) +GO(gst_value_can_compare, iFpp) +GO(gst_value_can_intersect, iFpp) GO(gst_value_can_subtract, iFpp) -//GO(gst_value_can_union, +GO(gst_value_can_union, iFpp) GO(gst_value_compare, iFpp) GO(gst_value_deserialize, iFpp) GO(gst_value_fixate, iFpp) -//GO(gst_value_fraction_multiply, -//GO(gst_value_fraction_subtract, +GO(gst_value_fraction_multiply, iFppp) +GO(gst_value_fraction_subtract, iFppp) GO(gst_value_get_bitmask, LFp) GO(gst_value_get_caps, pFp) GO(gst_value_get_caps_features, pFp) GO(gst_value_get_double_range_max, dFp) -//GO(gst_value_get_double_range_min, +GO(gst_value_get_double_range_min, dFp) GO(gst_value_get_flagset_flags, uFp) GO(gst_value_get_flagset_mask, uFp) GO(gst_value_get_fraction_denominator, iFp) GO(gst_value_get_fraction_numerator, iFp) GO(gst_value_get_fraction_range_max, pFp) GO(gst_value_get_fraction_range_min, pFp) -//GO(gst_value_get_int64_range_max, -//GO(gst_value_get_int64_range_min, +GO(gst_value_get_int64_range_max, lFp) +GO(gst_value_get_int64_range_min, lFp) GO(gst_value_get_int64_range_step, lFp) GO(gst_value_get_int_range_max, iFp) GO(gst_value_get_int_range_min, iFp) -//GO(gst_value_get_int_range_step, +GO(gst_value_get_int_range_step, iFp) GO(gst_value_get_structure, pFp) GO(gst_value_init_and_copy, vFpp) -//GO(gst_value_intersect, +GO(gst_value_intersect, iFppp) GO(gst_value_is_fixed, iFp) -//GO(gst_value_is_subset, +GO(gst_value_is_subset, iFpp) GO(gst_value_list_append_and_take_value, vFpp) GO(gst_value_list_append_value, vFpp) -//GO(gst_value_list_concat, +GO(gst_value_list_concat, vFppp) GO(gst_value_list_get_size, uFp) GO(gst_value_list_get_type, LFv) GO(gst_value_list_get_value, pFpu) -//GO(gst_value_list_init, +GO(gst_value_list_init, pFpu) GO(gst_value_list_merge, vFppp) -//GO(gst_value_list_prepend_value, -DATAB(_gst_value_list_type, sizeof(void*)) -//GO(gst_value_register, +GO(gst_value_list_prepend_value, vFpp) +DATAB(_gst_value_list_type, 8) +//GOM(gst_value_register, vFEp) GO(gst_value_serialize, pFp) GO(gst_value_set_bitmask, vFpL) GO(gst_value_set_caps, vFpp) @@ -1781,8 +1785,8 @@ GO(gst_value_set_int_range, vFpii) GO(gst_value_set_int_range_step, vFpiii) GO(gst_value_set_structure, vFpp) GO(gst_value_subtract, iFppp) -//GO(gst_value_union, +GO(gst_value_union, iFppp) GO(gst_version, vFpppp) GO(gst_version_string, pFv) -GO(dummy_iFpipLpp, iFpipLpp) // for gtkclass \ No newline at end of file +GO(dummy_iFpipLpp, iFpipLpp) diff --git a/src/wrapped/wrappedgstriff.c b/src/wrapped/wrappedgstriff.c index 35a300f..20f827b 100644 --- a/src/wrapped/wrappedgstriff.c +++ b/src/wrapped/wrappedgstriff.c @@ -13,10 +13,11 @@ #include "x64emu.h" const char* gstriffName = "libgstriff-1.0.so.0"; +#define ALTNAME "libgstriff-1.0.so" + #define LIBNAME gstriff -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstriff_private.h b/src/wrapped/wrappedgstriff_private.h index 1952be9..cd2dffb 100644 --- a/src/wrapped/wrappedgstriff_private.h +++ b/src/wrapped/wrappedgstriff_private.h @@ -1,19 +1,19 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(gst_riff_create_audio_caps, pFWpppppp) GO(gst_riff_create_audio_template_caps, pFv) -//GO(gst_riff_create_iavs_caps, -//GO(gst_riff_create_iavs_template_caps, +GO(gst_riff_create_iavs_caps, pFuppppp) +GO(gst_riff_create_iavs_template_caps, pFv) GO(gst_riff_create_video_caps, pFuppppp) GO(gst_riff_create_video_template_caps, pFv) GO(gst_riff_init, vFv) -//GO(gst_riff_parse_chunk, -//GO(gst_riff_parse_file_header, -//GO(gst_riff_parse_info, -//GO(gst_riff_parse_strf_auds, -//GO(gst_riff_parse_strf_iavs, -//GO(gst_riff_parse_strf_vids, -//GO(gst_riff_parse_strh, -//GO(gst_riff_read_chunk, +GO(gst_riff_parse_chunk, iFppppp) +GO(gst_riff_parse_file_header, iFppp) +GO(gst_riff_parse_info, vFppp) +GO(gst_riff_parse_strf_auds, iFpppp) +GO(gst_riff_parse_strf_iavs, iFpppp) +GO(gst_riff_parse_strf_vids, iFpppp) +GO(gst_riff_parse_strh, iFppp) +GO(gst_riff_read_chunk, iFppppp) diff --git a/src/wrapped/wrappedgstrtp.c b/src/wrapped/wrappedgstrtp.c index ef3fa6a..22086ac 100644 --- a/src/wrapped/wrappedgstrtp.c +++ b/src/wrapped/wrappedgstrtp.c @@ -12,16 +12,12 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* gstrtpName = "libgstrtp-1.0.so"; -#else - const char* gstrtpName = "libgstrtp-1.0.so.0"; -#endif +const char* gstrtpName = "libgstrtp-1.0.so.0"; +#define ALTNAME "libgstrtp-1.0.so" #define LIBNAME gstrtp -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstrtp_private.h b/src/wrapped/wrappedgstrtp_private.h index 91c55cb..1f1bad0 100644 --- a/src/wrapped/wrappedgstrtp_private.h +++ b/src/wrapped/wrappedgstrtp_private.h @@ -1,215 +1,215 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//GO(gst_buffer_add_rtp_source_meta, -//GO(gst_buffer_get_rtp_source_meta, -//GO(gst_rtcp_buffer_add_packet, -//GO(gst_rtcp_buffer_get_first_packet, -//GO(gst_rtcp_buffer_get_packet_count, -//GO(gst_rtcp_buffer_map, -//GO(gst_rtcp_buffer_new, -//GO(gst_rtcp_buffer_new_copy_data, -//GO(gst_rtcp_buffer_new_take_data, -//GO(gst_rtcp_buffer_unmap, -//GO(gst_rtcp_buffer_validate, -//GO(gst_rtcp_buffer_validate_data, -//GO(gst_rtcp_buffer_validate_data_reduced, -//GO(gst_rtcp_buffer_validate_reduced, +GO(gst_buffer_add_rtp_source_meta, pFpppu) +GO(gst_buffer_get_rtp_source_meta, pFp) +GO(gst_rtcp_buffer_add_packet, iFpup) +GO(gst_rtcp_buffer_get_first_packet, iFpp) +GO(gst_rtcp_buffer_get_packet_count, uFp) +GO(gst_rtcp_buffer_map, iFpup) +GO(gst_rtcp_buffer_new, pFu) +GO(gst_rtcp_buffer_new_copy_data, pFpu) +GO(gst_rtcp_buffer_new_take_data, pFpu) +GO(gst_rtcp_buffer_unmap, iFp) +GO(gst_rtcp_buffer_validate, iFp) +GO(gst_rtcp_buffer_validate_data, iFpu) +GO(gst_rtcp_buffer_validate_data_reduced, iFpu) +GO(gst_rtcp_buffer_validate_reduced, iFp) GO(gst_rtcpfb_type_get_type, LFv) -//GO(gst_rtcp_ntp_to_unix, -//GO(gst_rtcp_packet_add_profile_specific_ext, -//GO(gst_rtcp_packet_add_rb, -//GO(gst_rtcp_packet_app_get_data, -//GO(gst_rtcp_packet_app_get_data_length, -//GO(gst_rtcp_packet_app_get_name, -//GO(gst_rtcp_packet_app_get_ssrc, -//GO(gst_rtcp_packet_app_get_subtype, -//GO(gst_rtcp_packet_app_set_data_length, -//GO(gst_rtcp_packet_app_set_name, -//GO(gst_rtcp_packet_app_set_ssrc, -//GO(gst_rtcp_packet_app_set_subtype, -//GO(gst_rtcp_packet_bye_add_ssrc, -//GO(gst_rtcp_packet_bye_add_ssrcs, -//GO(gst_rtcp_packet_bye_get_nth_ssrc, -//GO(gst_rtcp_packet_bye_get_reason, -//GO(gst_rtcp_packet_bye_get_reason_len, -//GO(gst_rtcp_packet_bye_get_ssrc_count, -//GO(gst_rtcp_packet_bye_set_reason, -//GO(gst_rtcp_packet_copy_profile_specific_ext, -//GO(gst_rtcp_packet_fb_get_fci, -//GO(gst_rtcp_packet_fb_get_fci_length, -//GO(gst_rtcp_packet_fb_get_media_ssrc, -//GO(gst_rtcp_packet_fb_get_sender_ssrc, -GO(gst_rtcp_packet_fb_get_type, LFv) -//GO(gst_rtcp_packet_fb_set_fci_length, -//GO(gst_rtcp_packet_fb_set_media_ssrc, -//GO(gst_rtcp_packet_fb_set_sender_ssrc, -//GO(gst_rtcp_packet_fb_set_type, -//GO(gst_rtcp_packet_get_count, -//GO(gst_rtcp_packet_get_length, -//GO(gst_rtcp_packet_get_padding, -//GO(gst_rtcp_packet_get_profile_specific_ext, -//GO(gst_rtcp_packet_get_profile_specific_ext_length, -//GO(gst_rtcp_packet_get_rb, -//GO(gst_rtcp_packet_get_rb_count, -GO(gst_rtcp_packet_get_type, LFv) -//GO(gst_rtcp_packet_move_to_next, -//GO(gst_rtcp_packet_remove, -//GO(gst_rtcp_packet_rr_get_ssrc, -//GO(gst_rtcp_packet_rr_set_ssrc, -//GO(gst_rtcp_packet_sdes_add_entry, -//GO(gst_rtcp_packet_sdes_add_item, -//GO(gst_rtcp_packet_sdes_copy_entry, -//GO(gst_rtcp_packet_sdes_first_entry, -//GO(gst_rtcp_packet_sdes_first_item, -//GO(gst_rtcp_packet_sdes_get_entry, -//GO(gst_rtcp_packet_sdes_get_item_count, -//GO(gst_rtcp_packet_sdes_get_ssrc, -//GO(gst_rtcp_packet_sdes_next_entry, -//GO(gst_rtcp_packet_sdes_next_item, -//GO(gst_rtcp_packet_set_rb, -//GO(gst_rtcp_packet_sr_get_sender_info, -//GO(gst_rtcp_packet_sr_set_sender_info, -//GO(gst_rtcp_packet_xr_first_rb, -//GO(gst_rtcp_packet_xr_get_block_length, -//GO(gst_rtcp_packet_xr_get_block_type, -//GO(gst_rtcp_packet_xr_get_dlrr_block, -//GO(gst_rtcp_packet_xr_get_prt_by_seq, -//GO(gst_rtcp_packet_xr_get_prt_info, -//GO(gst_rtcp_packet_xr_get_rle_info, -//GO(gst_rtcp_packet_xr_get_rle_nth_chunk, -//GO(gst_rtcp_packet_xr_get_rrt, -//GO(gst_rtcp_packet_xr_get_ssrc, -//GO(gst_rtcp_packet_xr_get_summary_info, -//GO(gst_rtcp_packet_xr_get_summary_jitter, -//GO(gst_rtcp_packet_xr_get_summary_pkt, -//GO(gst_rtcp_packet_xr_get_summary_ttl, -//GO(gst_rtcp_packet_xr_get_voip_burst_metrics, -//GO(gst_rtcp_packet_xr_get_voip_configuration_params, -//GO(gst_rtcp_packet_xr_get_voip_delay_metrics, -//GO(gst_rtcp_packet_xr_get_voip_jitter_buffer_params, -//GO(gst_rtcp_packet_xr_get_voip_metrics_ssrc, -//GO(gst_rtcp_packet_xr_get_voip_packet_metrics, -//GO(gst_rtcp_packet_xr_get_voip_quality_metrics, -//GO(gst_rtcp_packet_xr_get_voip_signal_metrics, -//GO(gst_rtcp_packet_xr_next_rb, -//GO(gst_rtcp_sdes_name_to_type, +GO(gst_rtcp_ntp_to_unix, LFL) +GO(gst_rtcp_packet_add_profile_specific_ext, iFppu) +GO(gst_rtcp_packet_add_rb, iFpuCiuuuu) +GO(gst_rtcp_packet_app_get_data, pFp) +GO(gst_rtcp_packet_app_get_data_length, WFp) +GO(gst_rtcp_packet_app_get_name, pFp) +GO(gst_rtcp_packet_app_get_ssrc, uFp) +GO(gst_rtcp_packet_app_get_subtype, CFp) +GO(gst_rtcp_packet_app_set_data_length, iFpW) +GO(gst_rtcp_packet_app_set_name, vFpp) +GO(gst_rtcp_packet_app_set_ssrc, vFpu) +GO(gst_rtcp_packet_app_set_subtype, vFpC) +GO(gst_rtcp_packet_bye_add_ssrc, iFpu) +GO(gst_rtcp_packet_bye_add_ssrcs, iFppu) +GO(gst_rtcp_packet_bye_get_nth_ssrc, uFpu) +GO(gst_rtcp_packet_bye_get_reason, pFp) +GO(gst_rtcp_packet_bye_get_reason_len, CFp) +GO(gst_rtcp_packet_bye_get_ssrc_count, uFp) +GO(gst_rtcp_packet_bye_set_reason, iFpp) +GO(gst_rtcp_packet_copy_profile_specific_ext, iFppp) +GO(gst_rtcp_packet_fb_get_fci, pFp) +GO(gst_rtcp_packet_fb_get_fci_length, WFp) +GO(gst_rtcp_packet_fb_get_media_ssrc, uFp) +GO(gst_rtcp_packet_fb_get_sender_ssrc, uFp) +GO(gst_rtcp_packet_fb_get_type, uFp) +GO(gst_rtcp_packet_fb_set_fci_length, iFpW) +GO(gst_rtcp_packet_fb_set_media_ssrc, vFpu) +GO(gst_rtcp_packet_fb_set_sender_ssrc, vFpu) +GO(gst_rtcp_packet_fb_set_type, vFpu) +GO(gst_rtcp_packet_get_count, CFp) +GO(gst_rtcp_packet_get_length, WFp) +GO(gst_rtcp_packet_get_padding, iFp) +GO(gst_rtcp_packet_get_profile_specific_ext, iFppp) +GO(gst_rtcp_packet_get_profile_specific_ext_length, WFp) +GO(gst_rtcp_packet_get_rb, vFpuppppppp) +GO(gst_rtcp_packet_get_rb_count, uFp) +GO(gst_rtcp_packet_get_type, uFp) +GO(gst_rtcp_packet_move_to_next, iFp) +GO(gst_rtcp_packet_remove, iFp) +GO(gst_rtcp_packet_rr_get_ssrc, uFp) +GO(gst_rtcp_packet_rr_set_ssrc, vFpu) +GO(gst_rtcp_packet_sdes_add_entry, iFpiCp) +GO(gst_rtcp_packet_sdes_add_item, iFpu) +GO(gst_rtcp_packet_sdes_copy_entry, iFpppp) +GO(gst_rtcp_packet_sdes_first_entry, iFp) +GO(gst_rtcp_packet_sdes_first_item, iFp) +GO(gst_rtcp_packet_sdes_get_entry, iFpppp) +GO(gst_rtcp_packet_sdes_get_item_count, uFp) +GO(gst_rtcp_packet_sdes_get_ssrc, uFp) +GO(gst_rtcp_packet_sdes_next_entry, iFp) +GO(gst_rtcp_packet_sdes_next_item, iFp) +GO(gst_rtcp_packet_set_rb, vFpuuCiuuuu) +GO(gst_rtcp_packet_sr_get_sender_info, vFpppppp) +GO(gst_rtcp_packet_sr_set_sender_info, vFpuLuuu) +GO(gst_rtcp_packet_xr_first_rb, iFp) +GO(gst_rtcp_packet_xr_get_block_length, WFp) +GO(gst_rtcp_packet_xr_get_block_type, iFp) +GO(gst_rtcp_packet_xr_get_dlrr_block, iFpuppp) +GO(gst_rtcp_packet_xr_get_prt_by_seq, iFpWp) +GO(gst_rtcp_packet_xr_get_prt_info, iFppppp) +GO(gst_rtcp_packet_xr_get_rle_info, iFpppppp) +GO(gst_rtcp_packet_xr_get_rle_nth_chunk, iFpup) +GO(gst_rtcp_packet_xr_get_rrt, iFpp) +GO(gst_rtcp_packet_xr_get_ssrc, uFp) +GO(gst_rtcp_packet_xr_get_summary_info, iFpppp) +GO(gst_rtcp_packet_xr_get_summary_jitter, iFppppp) +GO(gst_rtcp_packet_xr_get_summary_pkt, iFppp) +GO(gst_rtcp_packet_xr_get_summary_ttl, iFpppppp) +GO(gst_rtcp_packet_xr_get_voip_burst_metrics, iFppppp) +GO(gst_rtcp_packet_xr_get_voip_configuration_params, iFppp) +GO(gst_rtcp_packet_xr_get_voip_delay_metrics, iFppp) +GO(gst_rtcp_packet_xr_get_voip_jitter_buffer_params, iFpppp) +GO(gst_rtcp_packet_xr_get_voip_metrics_ssrc, iFpp) +GO(gst_rtcp_packet_xr_get_voip_packet_metrics, iFppp) +GO(gst_rtcp_packet_xr_get_voip_quality_metrics, iFppppp) +GO(gst_rtcp_packet_xr_get_voip_signal_metrics, iFppppp) +GO(gst_rtcp_packet_xr_next_rb, iFp) +GO(gst_rtcp_sdes_name_to_type, iFp) GO(gst_rtcpsdes_type_get_type, LFv) -//GO(gst_rtcp_sdes_type_to_name, +GO(gst_rtcp_sdes_type_to_name, pFi) GO(gst_rtcp_type_get_type, LFv) -//GO(gst_rtcp_unix_to_ntp, +GO(gst_rtcp_unix_to_ntp, LFL) GO(gst_rtcpxr_type_get_type, LFv) -//GO(gst_rtp_base_audio_payload_flush, -//GO(gst_rtp_base_audio_payload_get_adapter, +GO(gst_rtp_base_audio_payload_flush, iFpuL) +GO(gst_rtp_base_audio_payload_get_adapter, pFp) GO(gst_rtp_base_audio_payload_get_type, LFv) -//GO(gst_rtp_base_audio_payload_push, -//GO(gst_rtp_base_audio_payload_set_frame_based, -//GO(gst_rtp_base_audio_payload_set_frame_options, -//GO(gst_rtp_base_audio_payload_set_sample_based, -//GO(gst_rtp_base_audio_payload_set_samplebits_options, -//GO(gst_rtp_base_audio_payload_set_sample_options, +GO(gst_rtp_base_audio_payload_push, iFppuL) +GO(gst_rtp_base_audio_payload_set_frame_based, vFp) +GO(gst_rtp_base_audio_payload_set_frame_options, vFpii) +GO(gst_rtp_base_audio_payload_set_sample_based, vFp) +GO(gst_rtp_base_audio_payload_set_samplebits_options, vFpi) +GO(gst_rtp_base_audio_payload_set_sample_options, vFpi) GO(gst_rtp_base_depayload_get_type, LFv) -//GO(gst_rtp_base_depayload_is_source_info_enabled, -//GO(gst_rtp_base_depayload_push, -//GO(gst_rtp_base_depayload_push_list, -//GO(gst_rtp_base_depayload_set_source_info_enabled, -//GO(gst_rtp_base_payload_allocate_output_buffer, -//GO(gst_rtp_base_payload_get_source_count, +GO(gst_rtp_base_depayload_is_source_info_enabled, iFp) +GO(gst_rtp_base_depayload_push, iFpp) +GO(gst_rtp_base_depayload_push_list, iFpp) +GO(gst_rtp_base_depayload_set_source_info_enabled, vFpi) +GO(gst_rtp_base_payload_allocate_output_buffer, pFpuCC) +GO(gst_rtp_base_payload_get_source_count, uFpp) GO(gst_rtp_base_payload_get_type, LFv) -//GO(gst_rtp_base_payload_is_filled, -//GO(gst_rtp_base_payload_is_source_info_enabled, -//GO(gst_rtp_base_payload_push, -//GO(gst_rtp_base_payload_push_list, -//GO(gst_rtp_base_payload_set_options, -//GO(gst_rtp_base_payload_set_outcaps, -//GO(gst_rtp_base_payload_set_outcaps_structure, -//GO(gst_rtp_base_payload_set_source_info_enabled, -//GO(gst_rtp_buffer_add_extension_onebyte_header, -//GO(gst_rtp_buffer_add_extension_twobytes_header, -//GO(gst_rtp_buffer_allocate_data, -//GO(gst_rtp_buffer_calc_header_len, -//GO(gst_rtp_buffer_calc_packet_len, -//GO(gst_rtp_buffer_calc_payload_len, -//GO(gst_rtp_buffer_compare_seqnum, -//GO(gst_rtp_buffer_default_clock_rate, -//GO(gst_rtp_buffer_ext_timestamp, +GO(gst_rtp_base_payload_is_filled, iFpuL) +GO(gst_rtp_base_payload_is_source_info_enabled, iFp) +GO(gst_rtp_base_payload_push, iFpp) +GO(gst_rtp_base_payload_push_list, iFpp) +GO(gst_rtp_base_payload_set_options, vFppipu) +//GOM(gst_rtp_base_payload_set_outcaps, iFEppV) +GO(gst_rtp_base_payload_set_outcaps_structure, iFpp) +GO(gst_rtp_base_payload_set_source_info_enabled, vFpi) +GO(gst_rtp_buffer_add_extension_onebyte_header, iFpCpu) +GO(gst_rtp_buffer_add_extension_twobytes_header, iFpCCpu) +GO(gst_rtp_buffer_allocate_data, vFpuCC) +GO(gst_rtp_buffer_calc_header_len, uFC) +GO(gst_rtp_buffer_calc_packet_len, uFuCC) +GO(gst_rtp_buffer_calc_payload_len, uFuCC) +GO(gst_rtp_buffer_compare_seqnum, iFWW) +GO(gst_rtp_buffer_default_clock_rate, uFC) +GO(gst_rtp_buffer_ext_timestamp, LFpu) GO(gst_rtp_buffer_flags_get_type, LFv) -//GO(gst_rtp_buffer_get_csrc, -//GO(gst_rtp_buffer_get_csrc_count, -//GO(gst_rtp_buffer_get_extension, -//GO(gst_rtp_buffer_get_extension_bytes, -//GO(gst_rtp_buffer_get_extension_data, -//GO(gst_rtp_buffer_get_extension_onebyte_header, -//GO(gst_rtp_buffer_get_extension_onebyte_header_from_bytes, -//GO(gst_rtp_buffer_get_extension_twobytes_header, -//GO(gst_rtp_buffer_get_header_len, -//GO(gst_rtp_buffer_get_marker, -//GO(gst_rtp_buffer_get_packet_len, -//GO(gst_rtp_buffer_get_padding, -//GO(gst_rtp_buffer_get_payload, -//GO(gst_rtp_buffer_get_payload_buffer, -//GO(gst_rtp_buffer_get_payload_bytes, -//GO(gst_rtp_buffer_get_payload_len, -//GO(gst_rtp_buffer_get_payload_subbuffer, -//GO(gst_rtp_buffer_get_payload_type, -//GO(gst_rtp_buffer_get_seq, -//GO(gst_rtp_buffer_get_ssrc, -//GO(gst_rtp_buffer_get_timestamp, -//GO(gst_rtp_buffer_get_version, -//GO(gst_rtp_buffer_map, +GO(gst_rtp_buffer_get_csrc, uFpC) +GO(gst_rtp_buffer_get_csrc_count, CFp) +GO(gst_rtp_buffer_get_extension, iFp) +GO(gst_rtp_buffer_get_extension_bytes, pFpp) +GO(gst_rtp_buffer_get_extension_data, iFpppp) +GO(gst_rtp_buffer_get_extension_onebyte_header, iFpCupp) +GO(gst_rtp_buffer_get_extension_onebyte_header_from_bytes, iFpWCupp) +GO(gst_rtp_buffer_get_extension_twobytes_header, iFppCupp) +GO(gst_rtp_buffer_get_header_len, uFp) +GO(gst_rtp_buffer_get_marker, iFp) +GO(gst_rtp_buffer_get_packet_len, uFp) +GO(gst_rtp_buffer_get_padding, iFp) +GO(gst_rtp_buffer_get_payload, pFp) +GO(gst_rtp_buffer_get_payload_buffer, pFp) +GO(gst_rtp_buffer_get_payload_bytes, pFp) +GO(gst_rtp_buffer_get_payload_len, uFp) +GO(gst_rtp_buffer_get_payload_subbuffer, pFpuu) +GO(gst_rtp_buffer_get_payload_type, CFp) +GO(gst_rtp_buffer_get_seq, WFp) +GO(gst_rtp_buffer_get_ssrc, uFp) +GO(gst_rtp_buffer_get_timestamp, uFp) +GO(gst_rtp_buffer_get_version, CFp) +GO(gst_rtp_buffer_map, iFpup) GO(gst_rtp_buffer_map_flags_get_type, LFv) -//GO(gst_rtp_buffer_new_allocate, -//GO(gst_rtp_buffer_new_allocate_len, -//GO(gst_rtp_buffer_new_copy_data, -//GO(gst_rtp_buffer_new_take_data, -//GO(gst_rtp_buffer_pad_to, -//GO(gst_rtp_buffer_remove_extension_data, -//GO(gst_rtp_buffer_set_csrc, -//GO(gst_rtp_buffer_set_extension, -//GO(gst_rtp_buffer_set_extension_data, -//GO(gst_rtp_buffer_set_marker, -//GO(gst_rtp_buffer_set_packet_len, -//GO(gst_rtp_buffer_set_padding, -//GO(gst_rtp_buffer_set_payload_type, -//GO(gst_rtp_buffer_set_seq, -//GO(gst_rtp_buffer_set_ssrc, -//GO(gst_rtp_buffer_set_timestamp, -//GO(gst_rtp_buffer_set_version, -//GO(gst_rtp_buffer_unmap, -//GO(gst_rtp_get_header_extension_list, -//GO(gst_rtp_hdrext_get_ntp_56, -//GO(gst_rtp_hdrext_get_ntp_64, -//GO(gst_rtp_hdrext_set_ntp_56, -//GO(gst_rtp_hdrext_set_ntp_64, -//GO(gst_rtp_header_extension_class_set_uri, -//GO(gst_rtp_header_extension_create_from_uri, +GO(gst_rtp_buffer_new_allocate, pFuCC) +GO(gst_rtp_buffer_new_allocate_len, pFuCC) +GO(gst_rtp_buffer_new_copy_data, pFpL) +GO(gst_rtp_buffer_new_take_data, pFpL) +GO(gst_rtp_buffer_pad_to, vFpu) +GO(gst_rtp_buffer_remove_extension_data, vFp) +GO(gst_rtp_buffer_set_csrc, vFpCu) +GO(gst_rtp_buffer_set_extension, vFpi) +GO(gst_rtp_buffer_set_extension_data, iFpWW) +GO(gst_rtp_buffer_set_marker, vFpi) +GO(gst_rtp_buffer_set_packet_len, vFpu) +GO(gst_rtp_buffer_set_padding, vFpi) +GO(gst_rtp_buffer_set_payload_type, vFpC) +GO(gst_rtp_buffer_set_seq, vFpW) +GO(gst_rtp_buffer_set_ssrc, vFpu) +GO(gst_rtp_buffer_set_timestamp, vFpu) +GO(gst_rtp_buffer_set_version, vFpC) +GO(gst_rtp_buffer_unmap, vFp) +GO(gst_rtp_get_header_extension_list, pFv) +GO(gst_rtp_hdrext_get_ntp_56, iFpup) +GO(gst_rtp_hdrext_get_ntp_64, iFpup) +GO(gst_rtp_hdrext_set_ntp_56, iFpuL) +GO(gst_rtp_hdrext_set_ntp_64, iFpuL) +GO(gst_rtp_header_extension_class_set_uri, vFpp) +GO(gst_rtp_header_extension_create_from_uri, pFp) GO(gst_rtp_header_extension_direction_get_type, LFv) GO(gst_rtp_header_extension_flags_get_type, LFv) -//GO(gst_rtp_header_extension_get_direction, -//GO(gst_rtp_header_extension_get_id, -//GO(gst_rtp_header_extension_get_max_size, -//GO(gst_rtp_header_extension_get_sdp_caps_field_name, -//GO(gst_rtp_header_extension_get_supported_flags, +GO(gst_rtp_header_extension_get_direction, uFp) +GO(gst_rtp_header_extension_get_id, uFp) +GO(gst_rtp_header_extension_get_max_size, LFpp) +GO(gst_rtp_header_extension_get_sdp_caps_field_name, pFp) +GO(gst_rtp_header_extension_get_supported_flags, uFp) GO(gst_rtp_header_extension_get_type, LFv) -//GO(gst_rtp_header_extension_get_uri, -//GO(gst_rtp_header_extension_read, -//GO(gst_rtp_header_extension_set_attributes_from_caps, -//GO(gst_rtp_header_extension_set_caps_from_attributes, -//GO(gst_rtp_header_extension_set_caps_from_attributes_helper, -//GO(gst_rtp_header_extension_set_direction, -//GO(gst_rtp_header_extension_set_id, -//GO(gst_rtp_header_extension_set_non_rtp_sink_caps, -//GO(gst_rtp_header_extension_set_wants_update_non_rtp_src_caps, -//GO(gst_rtp_header_extension_update_non_rtp_src_caps, -//GO(gst_rtp_header_extension_wants_update_non_rtp_src_caps, -//GO(gst_rtp_header_extension_write, +GO(gst_rtp_header_extension_get_uri, pFp) +GO(gst_rtp_header_extension_read, iFpupLp) +GO(gst_rtp_header_extension_set_attributes_from_caps, iFpp) +GO(gst_rtp_header_extension_set_caps_from_attributes, iFpp) +GO(gst_rtp_header_extension_set_caps_from_attributes_helper, iFppp) +GO(gst_rtp_header_extension_set_direction, vFpu) +GO(gst_rtp_header_extension_set_id, vFpu) +GO(gst_rtp_header_extension_set_non_rtp_sink_caps, iFpp) +GO(gst_rtp_header_extension_set_wants_update_non_rtp_src_caps, vFpi) +GO(gst_rtp_header_extension_update_non_rtp_src_caps, iFpp) +GO(gst_rtp_header_extension_wants_update_non_rtp_src_caps, iFp) +GO(gst_rtp_header_extension_write, lFppuppL) GO(gst_rtp_payload_get_type, LFv) -//GO(gst_rtp_payload_info_for_name, -//GO(gst_rtp_payload_info_for_pt, +GO(gst_rtp_payload_info_for_name, pFpp) +GO(gst_rtp_payload_info_for_pt, pFC) GO(gst_rtp_profile_get_type, LFv) GO(gst_rtp_source_meta_api_get_type, LFv) -//GO(gst_rtp_source_meta_append_csrc, -//GO(gst_rtp_source_meta_get_info, -//GO(gst_rtp_source_meta_get_source_count, -//GO(gst_rtp_source_meta_set_ssrc, +GO(gst_rtp_source_meta_append_csrc, iFppu) +GO(gst_rtp_source_meta_get_info, pFv) +GO(gst_rtp_source_meta_get_source_count, uFp) +GO(gst_rtp_source_meta_set_ssrc, iFpp) diff --git a/src/wrapped/wrappedgstrtsp.c b/src/wrapped/wrappedgstrtsp.c index 57d45ac..cb182fb 100644 --- a/src/wrapped/wrappedgstrtsp.c +++ b/src/wrapped/wrappedgstrtsp.c @@ -12,16 +12,12 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* gstrtspName = "libgstrtsp-1.0.so"; -#else - const char* gstrtspName = "libgstrtsp-1.0.so.0"; -#endif +const char* gstrtspName = "libgstrtsp-1.0.so.0"; +#define ALTNAME "libgstrtsp-1.0.so" #define LIBNAME gstrtsp -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstrtsp_private.h b/src/wrapped/wrappedgstrtsp_private.h index f9d9ebf..992f89b 100644 --- a/src/wrapped/wrappedgstrtsp_private.h +++ b/src/wrapped/wrappedgstrtsp_private.h @@ -1,170 +1,170 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(gst_rtsp_auth_credential_get_type, LFv) -//GO(gst_rtsp_auth_credentials_free, +GO(gst_rtsp_auth_credentials_free, vFp) GO(gst_rtsp_auth_method_get_type, LFv) -//GO(gst_rtsp_auth_param_copy, -//GO(gst_rtsp_auth_param_free, +GO(gst_rtsp_auth_param_copy, pFp) +GO(gst_rtsp_auth_param_free, vFp) GO(gst_rtsp_auth_param_get_type, LFv) -//GO(gst_rtsp_connection_accept, -//GO(gst_rtsp_connection_clear_auth_params, -//GO(gst_rtsp_connection_close, -//GO(gst_rtsp_connection_connect, -//GO(gst_rtsp_connection_connect_usec, -//GO(gst_rtsp_connection_connect_with_response, -//GO(gst_rtsp_connection_connect_with_response_usec, -//GO(gst_rtsp_connection_create, -//GO(gst_rtsp_connection_create_from_socket, -//GO(gst_rtsp_connection_do_tunnel, -//GO(gst_rtsp_connection_flush, -//GO(gst_rtsp_connection_free, -//GO(gst_rtsp_connection_get_ignore_x_server_reply, -//GO(gst_rtsp_connection_get_ip, -//GO(gst_rtsp_connection_get_read_socket, -//GO(gst_rtsp_connection_get_remember_session_id, -//GO(gst_rtsp_connection_get_tls, -//GO(gst_rtsp_connection_get_tls_database, -//GO(gst_rtsp_connection_get_tls_interaction, -//GO(gst_rtsp_connection_get_tls_validation_flags, -//GO(gst_rtsp_connection_get_tunnelid, -//GO(gst_rtsp_connection_get_url, -//GO(gst_rtsp_connection_get_write_socket, -//GO(gst_rtsp_connection_is_tunneled, -//GO(gst_rtsp_connection_next_timeout, -//GO(gst_rtsp_connection_next_timeout_usec, -//GO(gst_rtsp_connection_poll, -//GO(gst_rtsp_connection_poll_usec, -//GO(gst_rtsp_connection_read, -//GO(gst_rtsp_connection_read_usec, -//GO(gst_rtsp_connection_receive, -//GO(gst_rtsp_connection_receive_usec, -//GO(gst_rtsp_connection_reset_timeout, -//GO(gst_rtsp_connection_send, -//GO(gst_rtsp_connection_send_messages, -//GO(gst_rtsp_connection_send_messages_usec, -//GO(gst_rtsp_connection_send_usec, -//GO(gst_rtsp_connection_set_accept_certificate_func, -//GO(gst_rtsp_connection_set_auth, -//GO(gst_rtsp_connection_set_auth_param, -//GO(gst_rtsp_connection_set_content_length_limit, -//GO(gst_rtsp_connection_set_http_mode, -//GO(gst_rtsp_connection_set_ignore_x_server_reply, -//GO(gst_rtsp_connection_set_ip, -//GO(gst_rtsp_connection_set_proxy, -//GO(gst_rtsp_connection_set_qos_dscp, -//GO(gst_rtsp_connection_set_remember_session_id, -//GO(gst_rtsp_connection_set_tls_database, -//GO(gst_rtsp_connection_set_tls_interaction, -//GO(gst_rtsp_connection_set_tls_validation_flags, -//GO(gst_rtsp_connection_set_tunneled, -//GO(gst_rtsp_connection_write, -//GO(gst_rtsp_connection_write_usec, +GO(gst_rtsp_connection_accept, iFppp) +GO(gst_rtsp_connection_clear_auth_params, vFp) +GO(gst_rtsp_connection_close, iFp) +GO(gst_rtsp_connection_connect, iFpp) +GO(gst_rtsp_connection_connect_usec, iFpl) +GO(gst_rtsp_connection_connect_with_response, iFppp) +GO(gst_rtsp_connection_connect_with_response_usec, iFplp) +GO(gst_rtsp_connection_create, iFpp) +GO(gst_rtsp_connection_create_from_socket, iFppWpp) +GO(gst_rtsp_connection_do_tunnel, iFpp) +GO(gst_rtsp_connection_flush, iFpi) +GO(gst_rtsp_connection_free, iFp) +GO(gst_rtsp_connection_get_ignore_x_server_reply, iFp) +GO(gst_rtsp_connection_get_ip, pFp) +GO(gst_rtsp_connection_get_read_socket, pFp) +GO(gst_rtsp_connection_get_remember_session_id, iFp) +GO(gst_rtsp_connection_get_tls, pFpp) +GO(gst_rtsp_connection_get_tls_database, pFp) +GO(gst_rtsp_connection_get_tls_interaction, pFp) +GO(gst_rtsp_connection_get_tls_validation_flags, uFp) +GO(gst_rtsp_connection_get_tunnelid, pFp) +GO(gst_rtsp_connection_get_url, pFp) +GO(gst_rtsp_connection_get_write_socket, pFp) +GO(gst_rtsp_connection_is_tunneled, iFp) +GO(gst_rtsp_connection_next_timeout, iFpp) +GO(gst_rtsp_connection_next_timeout_usec, lFp) +GO(gst_rtsp_connection_poll, iFpupp) +GO(gst_rtsp_connection_poll_usec, iFpupl) +GO(gst_rtsp_connection_read, iFppup) +GO(gst_rtsp_connection_read_usec, iFppul) +GO(gst_rtsp_connection_receive, iFppp) +GO(gst_rtsp_connection_receive_usec, iFppl) +GO(gst_rtsp_connection_reset_timeout, iFp) +GO(gst_rtsp_connection_send, iFppp) +GO(gst_rtsp_connection_send_messages, iFppup) +GO(gst_rtsp_connection_send_messages_usec, iFppul) +GO(gst_rtsp_connection_send_usec, iFppl) +//GOM(gst_rtsp_connection_set_accept_certificate_func, vFEpppp) +GO(gst_rtsp_connection_set_auth, iFpupp) +GO(gst_rtsp_connection_set_auth_param, vFppp) +GO(gst_rtsp_connection_set_content_length_limit, vFpu) +GO(gst_rtsp_connection_set_http_mode, vFpi) +GO(gst_rtsp_connection_set_ignore_x_server_reply, vFpi) +GO(gst_rtsp_connection_set_ip, vFpp) +GO(gst_rtsp_connection_set_proxy, iFppu) +GO(gst_rtsp_connection_set_qos_dscp, iFpu) +GO(gst_rtsp_connection_set_remember_session_id, vFpi) +GO(gst_rtsp_connection_set_tls_database, vFpp) +GO(gst_rtsp_connection_set_tls_interaction, vFpp) +GO(gst_rtsp_connection_set_tls_validation_flags, iFpu) +GO(gst_rtsp_connection_set_tunneled, vFpi) +GO(gst_rtsp_connection_write, iFppup) +GO(gst_rtsp_connection_write_usec, iFppul) GO(gst_rtsp_event_get_type, LFv) -//GO(gst_rtsp_extension_after_send, -//GO(gst_rtsp_extension_before_send, -//GO(gst_rtsp_extension_configure_stream, -//GO(gst_rtsp_extension_detect_server, -//GO(gst_rtsp_extension_get_transports, +GO(gst_rtsp_extension_after_send, iFppp) +GO(gst_rtsp_extension_before_send, iFpp) +GO(gst_rtsp_extension_configure_stream, iFpp) +GO(gst_rtsp_extension_detect_server, iFpp) +GO(gst_rtsp_extension_get_transports, iFpup) GO(gst_rtsp_extension_get_type, LFv) -//GO(gst_rtsp_extension_parse_sdp, -//GO(gst_rtsp_extension_receive_request, -//GO(gst_rtsp_extension_send, -//GO(gst_rtsp_extension_setup_media, -//GO(gst_rtsp_extension_stream_select, +GO(gst_rtsp_extension_parse_sdp, iFppp) +GO(gst_rtsp_extension_receive_request, iFpp) +GO(gst_rtsp_extension_send, iFppp) +GO(gst_rtsp_extension_setup_media, iFpp) +GO(gst_rtsp_extension_stream_select, iFpp) GO(gst_rtsp_family_get_type, LFv) -//GO(gst_rtsp_find_header_field, -//GO(gst_rtsp_find_method, -//GO(gst_rtsp_generate_digest_auth_response, -//GO(gst_rtsp_generate_digest_auth_response_from_md5, -//GO(gst_rtsp_header_allow_multiple, -//GO(gst_rtsp_header_as_text, +GO(gst_rtsp_find_header_field, uFp) +GO(gst_rtsp_find_method, uFp) +GO(gst_rtsp_generate_digest_auth_response, pFppppppp) +GO(gst_rtsp_generate_digest_auth_response_from_md5, pFppppp) +GO(gst_rtsp_header_allow_multiple, iFu) +GO(gst_rtsp_header_as_text, pFu) GO(gst_rtsp_header_field_get_type, LFv) GO(gst_rtsp_lower_trans_get_type, LFv) -//GO(gst_rtsp_message_add_header, -//GO(gst_rtsp_message_add_header_by_name, -//GO(gst_rtsp_message_append_headers, -//GO(gst_rtsp_message_copy, -//GO(gst_rtsp_message_dump, -//GO(gst_rtsp_message_free, -//GO(gst_rtsp_message_get_body, -//GO(gst_rtsp_message_get_body_buffer, -//GO(gst_rtsp_message_get_header, -//GO(gst_rtsp_message_get_header_by_name, -GO(gst_rtsp_message_get_type, LFv) -//GO(gst_rtsp_message_has_body_buffer, -//GO(gst_rtsp_message_init, -//GO(gst_rtsp_message_init_data, -//GO(gst_rtsp_message_init_request, -//GO(gst_rtsp_message_init_response, -//GO(gst_rtsp_message_new, -//GO(gst_rtsp_message_new_data, -//GO(gst_rtsp_message_new_request, -//GO(gst_rtsp_message_new_response, -//GO(gst_rtsp_message_parse_auth_credentials, -//GO(gst_rtsp_message_parse_data, -//GO(gst_rtsp_message_parse_request, -//GO(gst_rtsp_message_parse_response, -//GO(gst_rtsp_message_remove_header, -//GO(gst_rtsp_message_remove_header_by_name, -//GO(gst_rtsp_message_set_body, -//GO(gst_rtsp_message_set_body_buffer, -//GO(gst_rtsp_message_steal_body, -//GO(gst_rtsp_message_steal_body_buffer, -//GO(gst_rtsp_message_take_body, -//GO(gst_rtsp_message_take_body_buffer, -//GO(gst_rtsp_message_take_header, -//GO(gst_rtsp_message_take_header_by_name, -//GO(gst_rtsp_message_unset, -//GO(gst_rtsp_method_as_text, +GO(gst_rtsp_message_add_header, iFpup) +GO(gst_rtsp_message_add_header_by_name, iFppp) +GO(gst_rtsp_message_append_headers, iFpp) +GO(gst_rtsp_message_copy, iFpp) +GO(gst_rtsp_message_dump, iFp) +GO(gst_rtsp_message_free, iFp) +GO(gst_rtsp_message_get_body, iFppp) +GO(gst_rtsp_message_get_body_buffer, iFpp) +GO(gst_rtsp_message_get_header, iFpupi) +GO(gst_rtsp_message_get_header_by_name, iFpppi) +GO(gst_rtsp_message_get_type, uFp) +GO(gst_rtsp_message_has_body_buffer, iFp) +GO(gst_rtsp_message_init, iFp) +GO(gst_rtsp_message_init_data, iFpC) +GO(gst_rtsp_message_init_request, iFpup) +GO(gst_rtsp_message_init_response, iFpupp) +GO(gst_rtsp_message_new, iFp) +GO(gst_rtsp_message_new_data, iFpC) +GO(gst_rtsp_message_new_request, iFpup) +GO(gst_rtsp_message_new_response, iFpupp) +GO(gst_rtsp_message_parse_auth_credentials, pFpu) +GO(gst_rtsp_message_parse_data, iFpp) +GO(gst_rtsp_message_parse_request, iFpppp) +GO(gst_rtsp_message_parse_response, iFpppp) +GO(gst_rtsp_message_remove_header, iFpui) +GO(gst_rtsp_message_remove_header_by_name, iFppi) +GO(gst_rtsp_message_set_body, iFppu) +GO(gst_rtsp_message_set_body_buffer, iFpp) +GO(gst_rtsp_message_steal_body, iFppp) +GO(gst_rtsp_message_steal_body_buffer, iFpp) +GO(gst_rtsp_message_take_body, iFppu) +GO(gst_rtsp_message_take_body_buffer, iFpp) +GO(gst_rtsp_message_take_header, iFpup) +GO(gst_rtsp_message_take_header_by_name, iFppp) +GO(gst_rtsp_message_unset, iFp) +GO(gst_rtsp_method_as_text, pFu) GO(gst_rtsp_method_get_type, LFv) GO(gst_rtsp_msg_get_type, LFv) GO(gst_rtsp_msg_type_get_type, LFv) -//GO(gst_rtsp_options_as_text, -//GO(gst_rtsp_options_from_text, +GO(gst_rtsp_options_as_text, pFu) +GO(gst_rtsp_options_from_text, uFp) GO(gst_rtsp_profile_get_type, LFv) -//GO(gst_rtsp_range_convert_units, -//GO(gst_rtsp_range_free, -//GO(gst_rtsp_range_get_times, -//GO(gst_rtsp_range_parse, -//GO(gst_rtsp_range_to_string, +GO(gst_rtsp_range_convert_units, iFpu) +GO(gst_rtsp_range_free, vFp) +GO(gst_rtsp_range_get_times, iFppp) +GO(gst_rtsp_range_parse, iFpp) +GO(gst_rtsp_range_to_string, pFp) GO(gst_rtsp_range_unit_get_type, LFv) GO(gst_rtsp_result_get_type, LFv) GO(gst_rtsp_state_get_type, LFv) -//GO(gst_rtsp_status_as_text, +GO(gst_rtsp_status_as_text, pFu) GO(gst_rtsp_status_code_get_type, LFv) -//GO(gst_rtsp_strresult, +GO(gst_rtsp_strresult, pFi) GO(gst_rtsp_time_type_get_type, LFv) GO(gst_rtsp_trans_mode_get_type, LFv) -//GO(gst_rtsp_transport_as_text, -//GO(gst_rtsp_transport_free, -//GO(gst_rtsp_transport_get_manager, -//GO(gst_rtsp_transport_get_media_type, -//GO(gst_rtsp_transport_get_mime, -//GO(gst_rtsp_transport_init, -//GO(gst_rtsp_transport_new, -//GO(gst_rtsp_transport_parse, -//GO(gst_rtsp_url_copy, -//GO(gst_rtsp_url_decode_path_components, -//GO(gst_rtsp_url_free, -//GO(gst_rtsp_url_get_port, -//GO(gst_rtsp_url_get_request_uri, -//GO(gst_rtsp_url_get_request_uri_with_control, +GO(gst_rtsp_transport_as_text, pFp) +GO(gst_rtsp_transport_free, iFp) +GO(gst_rtsp_transport_get_manager, iFupu) +GO(gst_rtsp_transport_get_media_type, iFpp) +GO(gst_rtsp_transport_get_mime, iFup) +GO(gst_rtsp_transport_init, iFp) +GO(gst_rtsp_transport_new, iFp) +GO(gst_rtsp_transport_parse, iFpp) +GO(gst_rtsp_url_copy, pFp) +GO(gst_rtsp_url_decode_path_components, pFp) +GO(gst_rtsp_url_free, vFp) +GO(gst_rtsp_url_get_port, iFpp) +GO(gst_rtsp_url_get_request_uri, pFp) +GO(gst_rtsp_url_get_request_uri_with_control, pFpp) GO(gst_rtsp_url_get_type, LFv) -//GO(gst_rtsp_url_parse, -//GO(gst_rtsp_url_set_port, -//GO(gst_rtsp_version_as_text, +GO(gst_rtsp_url_parse, iFpp) +GO(gst_rtsp_url_set_port, iFpW) +GO(gst_rtsp_version_as_text, pFu) GO(gst_rtsp_version_get_type, LFv) -//GO(gst_rtsp_watch_attach, -//GO(gst_rtsp_watch_get_send_backlog, -//GO(gst_rtsp_watch_new, -//GO(gst_rtsp_watch_reset, -//GO(gst_rtsp_watch_send_message, -//GO(gst_rtsp_watch_send_messages, -//GO(gst_rtsp_watch_set_flushing, -//GO(gst_rtsp_watch_set_send_backlog, -//GO(gst_rtsp_watch_unref, -//GO(gst_rtsp_watch_wait_backlog, -//GO(gst_rtsp_watch_wait_backlog_usec, -//GO(gst_rtsp_watch_write_data, +GO(gst_rtsp_watch_attach, uFpp) +GO(gst_rtsp_watch_get_send_backlog, vFppp) +//GOM(gst_rtsp_watch_new, pFEpppp) +GO(gst_rtsp_watch_reset, vFp) +GO(gst_rtsp_watch_send_message, iFppp) +GO(gst_rtsp_watch_send_messages, iFppup) +GO(gst_rtsp_watch_set_flushing, vFpi) +GO(gst_rtsp_watch_set_send_backlog, vFpLu) +GO(gst_rtsp_watch_unref, vFp) +GO(gst_rtsp_watch_wait_backlog, iFpp) +GO(gst_rtsp_watch_wait_backlog_usec, iFpl) +GO(gst_rtsp_watch_write_data, iFppup) diff --git a/src/wrapped/wrappedgstsdp.c b/src/wrapped/wrappedgstsdp.c index ddda7d1..b6c817d 100644 --- a/src/wrapped/wrappedgstsdp.c +++ b/src/wrapped/wrappedgstsdp.c @@ -12,16 +12,12 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* gstsdpName = "libgstsdp-1.0.so"; -#else - const char* gstsdpName = "libgstsdp-1.0.so.0"; -#endif +const char* gstsdpName = "libgstsdp-1.0.so.0"; +#define ALTNAME "libgstsdp-1.0.so" #define LIBNAME gstsdp -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstsdp_private.h b/src/wrapped/wrappedgstsdp_private.h index ba88728..496e50f 100644 --- a/src/wrapped/wrappedgstsdp_private.h +++ b/src/wrapped/wrappedgstsdp_private.h @@ -1,178 +1,178 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//GO(gst_mikey_message_add_cs_srtp, -//GO(gst_mikey_message_add_payload, -//GO(gst_mikey_message_add_pke, -//GO(gst_mikey_message_add_rand, -//GO(gst_mikey_message_add_rand_len, -//GO(gst_mikey_message_add_t, -//GO(gst_mikey_message_add_t_now_ntp_utc, -//GO(gst_mikey_message_base64_encode, -//GO(gst_mikey_message_find_payload, -//GO(gst_mikey_message_get_cs_srtp, -//GO(gst_mikey_message_get_n_cs, -//GO(gst_mikey_message_get_n_payloads, -//GO(gst_mikey_message_get_payload, +GO(gst_mikey_message_add_cs_srtp, iFpCuu) +GO(gst_mikey_message_add_payload, iFpp) +GO(gst_mikey_message_add_pke, iFpuWp) +GO(gst_mikey_message_add_rand, iFpCp) +GO(gst_mikey_message_add_rand_len, iFpC) +GO(gst_mikey_message_add_t, iFpup) +GO(gst_mikey_message_add_t_now_ntp_utc, iFp) +GO(gst_mikey_message_base64_encode, pFp) +GO(gst_mikey_message_find_payload, pFpuu) +GO(gst_mikey_message_get_cs_srtp, pFpu) +GO(gst_mikey_message_get_n_cs, uFp) +GO(gst_mikey_message_get_n_payloads, uFp) +GO(gst_mikey_message_get_payload, pFpu) GO(gst_mikey_message_get_type, LFv) -//GO(gst_mikey_message_insert_cs_srtp, -//GO(gst_mikey_message_insert_payload, -//GO(gst_mikey_message_new, -//GO(gst_mikey_message_new_from_bytes, -//GO(gst_mikey_message_new_from_caps, -//GO(gst_mikey_message_new_from_data, -//GO(gst_mikey_message_remove_cs_srtp, -//GO(gst_mikey_message_remove_payload, -//GO(gst_mikey_message_replace_cs_srtp, -//GO(gst_mikey_message_replace_payload, -//GO(gst_mikey_message_set_info, -//GO(gst_mikey_message_to_bytes, -//GO(gst_mikey_message_to_caps, +GO(gst_mikey_message_insert_cs_srtp, iFpip) +GO(gst_mikey_message_insert_payload, iFpup) +GO(gst_mikey_message_new, pFv) +GO(gst_mikey_message_new_from_bytes, pFppp) +GO(gst_mikey_message_new_from_caps, pFp) +GO(gst_mikey_message_new_from_data, pFpLpp) +GO(gst_mikey_message_remove_cs_srtp, iFpi) +GO(gst_mikey_message_remove_payload, iFpu) +GO(gst_mikey_message_replace_cs_srtp, iFpip) +GO(gst_mikey_message_replace_payload, iFpup) +GO(gst_mikey_message_set_info, iFpCiiuuu) +GO(gst_mikey_message_to_bytes, pFppp) +GO(gst_mikey_message_to_caps, iFpp) GO(gst_mikey_payload_get_type, LFv) -//GO(gst_mikey_payload_kemac_add_sub, -//GO(gst_mikey_payload_kemac_get_n_sub, -//GO(gst_mikey_payload_kemac_get_sub, -//GO(gst_mikey_payload_kemac_remove_sub, -//GO(gst_mikey_payload_kemac_set, -//GO(gst_mikey_payload_key_data_set_interval, -//GO(gst_mikey_payload_key_data_set_key, -//GO(gst_mikey_payload_key_data_set_salt, -//GO(gst_mikey_payload_key_data_set_spi, -//GO(gst_mikey_payload_new, -//GO(gst_mikey_payload_pke_set, -//GO(gst_mikey_payload_rand_set, -//GO(gst_mikey_payload_sp_add_param, -//GO(gst_mikey_payload_sp_get_n_params, -//GO(gst_mikey_payload_sp_get_param, -//GO(gst_mikey_payload_sp_remove_param, -//GO(gst_mikey_payload_sp_set, -//GO(gst_mikey_payload_t_set, -//GO(gst_sdp_address_is_multicast, -//GO(gst_sdp_attribute_clear, -//GO(gst_sdp_attribute_set, -//GO(gst_sdp_bandwidth_clear, -//GO(gst_sdp_bandwidth_set, -//GO(gst_sdp_connection_clear, -//GO(gst_sdp_connection_set, -//GO(gst_sdp_make_keymgmt, -//GO(gst_sdp_media_add_attribute, -//GO(gst_sdp_media_add_bandwidth, -//GO(gst_sdp_media_add_connection, -//GO(gst_sdp_media_add_format, -//GO(gst_sdp_media_as_text, -//GO(gst_sdp_media_attributes_len, -//GO(gst_sdp_media_attributes_to_caps, -//GO(gst_sdp_media_bandwidths_len, -//GO(gst_sdp_media_connections_len, -//GO(gst_sdp_media_copy, -//GO(gst_sdp_media_formats_len, -//GO(gst_sdp_media_free, -//GO(gst_sdp_media_get_attribute, -//GO(gst_sdp_media_get_attribute_val, -//GO(gst_sdp_media_get_attribute_val_n, -//GO(gst_sdp_media_get_bandwidth, -//GO(gst_sdp_media_get_caps_from_media, -//GO(gst_sdp_media_get_connection, -//GO(gst_sdp_media_get_format, -//GO(gst_sdp_media_get_information, -//GO(gst_sdp_media_get_key, -//GO(gst_sdp_media_get_media, -//GO(gst_sdp_media_get_num_ports, -//GO(gst_sdp_media_get_port, -//GO(gst_sdp_media_get_proto, -//GO(gst_sdp_media_init, -//GO(gst_sdp_media_insert_attribute, -//GO(gst_sdp_media_insert_bandwidth, -//GO(gst_sdp_media_insert_connection, -//GO(gst_sdp_media_insert_format, -//GO(gst_sdp_media_new, -//GO(gst_sdp_media_parse_keymgmt, -//GO(gst_sdp_media_remove_attribute, -//GO(gst_sdp_media_remove_bandwidth, -//GO(gst_sdp_media_remove_connection, -//GO(gst_sdp_media_remove_format, -//GO(gst_sdp_media_replace_attribute, -//GO(gst_sdp_media_replace_bandwidth, -//GO(gst_sdp_media_replace_connection, -//GO(gst_sdp_media_replace_format, -//GO(gst_sdp_media_set_information, -//GO(gst_sdp_media_set_key, -//GO(gst_sdp_media_set_media, -//GO(gst_sdp_media_set_media_from_caps, -//GO(gst_sdp_media_set_port_info, -//GO(gst_sdp_media_set_proto, -//GO(gst_sdp_media_uninit, -//GO(gst_sdp_message_add_attribute, -//GO(gst_sdp_message_add_bandwidth, -//GO(gst_sdp_message_add_email, -//GO(gst_sdp_message_add_media, -//GO(gst_sdp_message_add_phone, -//GO(gst_sdp_message_add_time, -//GO(gst_sdp_message_add_zone, -//GO(gst_sdp_message_as_text, -//GO(gst_sdp_message_as_uri, -//GO(gst_sdp_message_attributes_len, -//GO(gst_sdp_message_attributes_to_caps, -//GO(gst_sdp_message_bandwidths_len, -//GO(gst_sdp_message_copy, -//GO(gst_sdp_message_dump, -//GO(gst_sdp_message_emails_len, -//GO(gst_sdp_message_free, -//GO(gst_sdp_message_get_attribute, -//GO(gst_sdp_message_get_attribute_val, -//GO(gst_sdp_message_get_attribute_val_n, -//GO(gst_sdp_message_get_bandwidth, -//GO(gst_sdp_message_get_connection, -//GO(gst_sdp_message_get_email, -//GO(gst_sdp_message_get_information, -//GO(gst_sdp_message_get_key, -//GO(gst_sdp_message_get_media, -//GO(gst_sdp_message_get_origin, -//GO(gst_sdp_message_get_phone, -//GO(gst_sdp_message_get_session_name, -//GO(gst_sdp_message_get_time, +GO(gst_mikey_payload_kemac_add_sub, iFpp) +GO(gst_mikey_payload_kemac_get_n_sub, uFp) +GO(gst_mikey_payload_kemac_get_sub, pFpu) +GO(gst_mikey_payload_kemac_remove_sub, iFpu) +GO(gst_mikey_payload_kemac_set, iFpuu) +GO(gst_mikey_payload_key_data_set_interval, iFpCpCp) +GO(gst_mikey_payload_key_data_set_key, iFpuWp) +GO(gst_mikey_payload_key_data_set_salt, iFpWp) +GO(gst_mikey_payload_key_data_set_spi, iFpCp) +GO(gst_mikey_payload_new, pFu) +GO(gst_mikey_payload_pke_set, iFpuWp) +GO(gst_mikey_payload_rand_set, iFpCp) +GO(gst_mikey_payload_sp_add_param, iFpCCp) +GO(gst_mikey_payload_sp_get_n_params, uFp) +GO(gst_mikey_payload_sp_get_param, pFpu) +GO(gst_mikey_payload_sp_remove_param, iFpu) +GO(gst_mikey_payload_sp_set, iFpuu) +GO(gst_mikey_payload_t_set, iFpup) +GO(gst_sdp_address_is_multicast, iFppp) +GO(gst_sdp_attribute_clear, iFp) +GO(gst_sdp_attribute_set, iFppp) +GO(gst_sdp_bandwidth_clear, iFp) +GO(gst_sdp_bandwidth_set, iFppu) +GO(gst_sdp_connection_clear, iFp) +GO(gst_sdp_connection_set, iFppppuu) +GO(gst_sdp_make_keymgmt, pFpp) +GO(gst_sdp_media_add_attribute, iFppp) +GO(gst_sdp_media_add_bandwidth, iFppu) +GO(gst_sdp_media_add_connection, iFppppuu) +GO(gst_sdp_media_add_format, iFpp) +GO(gst_sdp_media_as_text, pFp) +GO(gst_sdp_media_attributes_len, uFp) +GO(gst_sdp_media_attributes_to_caps, iFpp) +GO(gst_sdp_media_bandwidths_len, uFp) +GO(gst_sdp_media_connections_len, uFp) +GO(gst_sdp_media_copy, iFpp) +GO(gst_sdp_media_formats_len, uFp) +GO(gst_sdp_media_free, iFp) +GO(gst_sdp_media_get_attribute, pFpu) +GO(gst_sdp_media_get_attribute_val, pFpp) +GO(gst_sdp_media_get_attribute_val_n, pFppu) +GO(gst_sdp_media_get_bandwidth, pFpu) +GO(gst_sdp_media_get_caps_from_media, pFpi) +GO(gst_sdp_media_get_connection, pFpu) +GO(gst_sdp_media_get_format, pFpu) +GO(gst_sdp_media_get_information, pFp) +GO(gst_sdp_media_get_key, pFp) +GO(gst_sdp_media_get_media, pFp) +GO(gst_sdp_media_get_num_ports, uFp) +GO(gst_sdp_media_get_port, uFp) +GO(gst_sdp_media_get_proto, pFp) +GO(gst_sdp_media_init, iFp) +GO(gst_sdp_media_insert_attribute, iFpip) +GO(gst_sdp_media_insert_bandwidth, iFpip) +GO(gst_sdp_media_insert_connection, iFpip) +GO(gst_sdp_media_insert_format, iFpip) +GO(gst_sdp_media_new, iFp) +GO(gst_sdp_media_parse_keymgmt, iFpp) +GO(gst_sdp_media_remove_attribute, iFpu) +GO(gst_sdp_media_remove_bandwidth, iFpu) +GO(gst_sdp_media_remove_connection, iFpu) +GO(gst_sdp_media_remove_format, iFpu) +GO(gst_sdp_media_replace_attribute, iFpup) +GO(gst_sdp_media_replace_bandwidth, iFpup) +GO(gst_sdp_media_replace_connection, iFpup) +GO(gst_sdp_media_replace_format, iFpup) +GO(gst_sdp_media_set_information, iFpp) +GO(gst_sdp_media_set_key, iFppp) +GO(gst_sdp_media_set_media, iFpp) +GO(gst_sdp_media_set_media_from_caps, iFpp) +GO(gst_sdp_media_set_port_info, iFpuu) +GO(gst_sdp_media_set_proto, iFpp) +GO(gst_sdp_media_uninit, iFp) +GO(gst_sdp_message_add_attribute, iFppp) +GO(gst_sdp_message_add_bandwidth, iFppu) +GO(gst_sdp_message_add_email, iFpp) +GO(gst_sdp_message_add_media, iFpp) +GO(gst_sdp_message_add_phone, iFpp) +GO(gst_sdp_message_add_time, iFpppp) +GO(gst_sdp_message_add_zone, iFppp) +GO(gst_sdp_message_as_text, pFp) +GO(gst_sdp_message_as_uri, pFpp) +GO(gst_sdp_message_attributes_len, uFp) +GO(gst_sdp_message_attributes_to_caps, iFpp) +GO(gst_sdp_message_bandwidths_len, uFp) +GO(gst_sdp_message_copy, iFpp) +GO(gst_sdp_message_dump, iFp) +GO(gst_sdp_message_emails_len, uFp) +GO(gst_sdp_message_free, iFp) +GO(gst_sdp_message_get_attribute, pFpu) +GO(gst_sdp_message_get_attribute_val, pFpp) +GO(gst_sdp_message_get_attribute_val_n, pFppu) +GO(gst_sdp_message_get_bandwidth, pFpu) +GO(gst_sdp_message_get_connection, pFp) +GO(gst_sdp_message_get_email, pFpu) +GO(gst_sdp_message_get_information, pFp) +GO(gst_sdp_message_get_key, pFp) +GO(gst_sdp_message_get_media, pFpu) +GO(gst_sdp_message_get_origin, pFp) +GO(gst_sdp_message_get_phone, pFpu) +GO(gst_sdp_message_get_session_name, pFp) +GO(gst_sdp_message_get_time, pFpu) GO(gst_sdp_message_get_type, LFv) -//GO(gst_sdp_message_get_uri, -//GO(gst_sdp_message_get_version, -//GO(gst_sdp_message_get_zone, -//GO(gst_sdp_message_init, -//GO(gst_sdp_message_insert_attribute, -//GO(gst_sdp_message_insert_bandwidth, -//GO(gst_sdp_message_insert_email, -//GO(gst_sdp_message_insert_phone, -//GO(gst_sdp_message_insert_time, -//GO(gst_sdp_message_insert_zone, -//GO(gst_sdp_message_medias_len, -//GO(gst_sdp_message_new, -//GO(gst_sdp_message_new_from_text, -//GO(gst_sdp_message_parse_buffer, -//GO(gst_sdp_message_parse_keymgmt, -//GO(gst_sdp_message_parse_uri, -//GO(gst_sdp_message_phones_len, -//GO(gst_sdp_message_remove_attribute, -//GO(gst_sdp_message_remove_bandwidth, -//GO(gst_sdp_message_remove_email, -//GO(gst_sdp_message_remove_phone, -//GO(gst_sdp_message_remove_time, -//GO(gst_sdp_message_remove_zone, -//GO(gst_sdp_message_replace_attribute, -//GO(gst_sdp_message_replace_bandwidth, -//GO(gst_sdp_message_replace_email, -//GO(gst_sdp_message_replace_phone, -//GO(gst_sdp_message_replace_time, -//GO(gst_sdp_message_replace_zone, -//GO(gst_sdp_message_set_connection, -//GO(gst_sdp_message_set_information, -//GO(gst_sdp_message_set_key, -//GO(gst_sdp_message_set_origin, -//GO(gst_sdp_message_set_session_name, -//GO(gst_sdp_message_set_uri, -//GO(gst_sdp_message_set_version, -//GO(gst_sdp_message_times_len, -//GO(gst_sdp_message_uninit, -//GO(gst_sdp_message_zones_len, -//GO(gst_sdp_time_clear, -//GO(gst_sdp_time_set, -//GO(gst_sdp_zone_clear, -//GO(gst_sdp_zone_set, +GO(gst_sdp_message_get_uri, pFp) +GO(gst_sdp_message_get_version, pFp) +GO(gst_sdp_message_get_zone, pFpu) +GO(gst_sdp_message_init, iFp) +GO(gst_sdp_message_insert_attribute, iFpip) +GO(gst_sdp_message_insert_bandwidth, iFpip) +GO(gst_sdp_message_insert_email, iFpip) +GO(gst_sdp_message_insert_phone, iFpip) +GO(gst_sdp_message_insert_time, iFpip) +GO(gst_sdp_message_insert_zone, iFpip) +GO(gst_sdp_message_medias_len, uFp) +GO(gst_sdp_message_new, iFp) +GO(gst_sdp_message_new_from_text, iFpp) +GO(gst_sdp_message_parse_buffer, iFpup) +GO(gst_sdp_message_parse_keymgmt, iFpp) +GO(gst_sdp_message_parse_uri, iFpp) +GO(gst_sdp_message_phones_len, uFp) +GO(gst_sdp_message_remove_attribute, iFpu) +GO(gst_sdp_message_remove_bandwidth, iFpu) +GO(gst_sdp_message_remove_email, iFpu) +GO(gst_sdp_message_remove_phone, iFpu) +GO(gst_sdp_message_remove_time, iFpu) +GO(gst_sdp_message_remove_zone, iFpu) +GO(gst_sdp_message_replace_attribute, iFpup) +GO(gst_sdp_message_replace_bandwidth, iFpup) +GO(gst_sdp_message_replace_email, iFpup) +GO(gst_sdp_message_replace_phone, iFpup) +GO(gst_sdp_message_replace_time, iFpup) +GO(gst_sdp_message_replace_zone, iFpup) +GO(gst_sdp_message_set_connection, iFppppuu) +GO(gst_sdp_message_set_information, iFpp) +GO(gst_sdp_message_set_key, iFppp) +GO(gst_sdp_message_set_origin, iFppppppp) +GO(gst_sdp_message_set_session_name, iFpp) +GO(gst_sdp_message_set_uri, iFpp) +GO(gst_sdp_message_set_version, iFpp) +GO(gst_sdp_message_times_len, uFp) +GO(gst_sdp_message_uninit, iFp) +GO(gst_sdp_message_zones_len, uFp) +GO(gst_sdp_time_clear, iFp) +GO(gst_sdp_time_set, iFpppp) +GO(gst_sdp_zone_clear, iFp) +GO(gst_sdp_zone_set, iFppp) diff --git a/src/wrapped/wrappedgsttag.c b/src/wrapped/wrappedgsttag.c index f7aad56..e4fed93 100644 --- a/src/wrapped/wrappedgsttag.c +++ b/src/wrapped/wrappedgsttag.c @@ -12,16 +12,12 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* gsttagName = "libgsttag-1.0.so"; -#else - const char* gsttagName = "libgsttag-1.0.so.0"; -#endif +const char* gsttagName = "libgsttag-1.0.so.0"; +#define ALTNAME "libgsttag-1.0.so" #define LIBNAME gsttag -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgsttag_private.h b/src/wrapped/wrappedgsttag_private.h index 9049c9e..46e38ca 100644 --- a/src/wrapped/wrappedgsttag_private.h +++ b/src/wrapped/wrappedgsttag_private.h @@ -1,56 +1,56 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//GO(gst_tag_check_language_code, -//GO(gst_tag_demux_get_type, -//GO(gst_tag_demux_result_get_type, +GO(gst_tag_check_language_code, iFp) +GO(gst_tag_demux_get_type, LFv) +GO(gst_tag_demux_result_get_type, LFv) GO(gst_tag_freeform_string_to_utf8, pFpip) -//GO(gst_tag_from_id3_tag, -//GO(gst_tag_from_id3_user_tag, -//GO(gst_tag_from_vorbis_tag, -//GO(gst_tag_get_id3v2_tag_size, +GO(gst_tag_from_id3_tag, pFp) +GO(gst_tag_from_id3_user_tag, pFpp) +GO(gst_tag_from_vorbis_tag, pFp) +GO(gst_tag_get_id3v2_tag_size, uFp) GO(gst_tag_get_language_code_iso_639_1, pFp) GO(gst_tag_get_language_code_iso_639_2B, pFp) GO(gst_tag_get_language_code_iso_639_2T, pFp) GO(gst_tag_get_language_codes, pFv) GO(gst_tag_get_language_name, pFp) -//GO(gst_tag_get_license_description, -//GO(gst_tag_get_license_flags, -//GO(gst_tag_get_license_jurisdiction, -//GO(gst_tag_get_license_nick, -//GO(gst_tag_get_licenses, -//GO(gst_tag_get_license_title, -//GO(gst_tag_get_license_version, -//GO(gst_tag_id3_genre_count, -//GO(gst_tag_id3_genre_get, +GO(gst_tag_get_license_description, pFp) +GO(gst_tag_get_license_flags, uFp) +GO(gst_tag_get_license_jurisdiction, pFp) +GO(gst_tag_get_license_nick, pFp) +GO(gst_tag_get_licenses, pFv) +GO(gst_tag_get_license_title, pFp) +GO(gst_tag_get_license_version, pFp) +GO(gst_tag_id3_genre_count, uFv) +GO(gst_tag_id3_genre_get, pFu) GO(gst_tag_image_data_to_image_sample, pFpui) -//GO(gst_tag_image_type_get_type, -//GO(gst_tag_license_flags_get_type, -//GO(gst_tag_list_add_id3_image, -//GO(gst_tag_list_from_exif_buffer, -//GO(gst_tag_list_from_exif_buffer_with_tiff_header, -//GO(gst_tag_list_from_id3v2_tag, +GO(gst_tag_image_type_get_type, LFv) +GO(gst_tag_license_flags_get_type, LFv) +GO(gst_tag_list_add_id3_image, iFppuu) +GO(gst_tag_list_from_exif_buffer, pFpiu) +GO(gst_tag_list_from_exif_buffer_with_tiff_header, pFp) +GO(gst_tag_list_from_id3v2_tag, pFp) GO(gst_tag_list_from_vorbiscomment, pFpLpup) GO(gst_tag_list_from_vorbiscomment_buffer, pFppup) -//GO(gst_tag_list_from_xmp_buffer, -//GO(gst_tag_list_new_from_id3v1, -//GO(gst_tag_list_to_exif_buffer, -//GO(gst_tag_list_to_exif_buffer_with_tiff_header, -//GO(gst_tag_list_to_vorbiscomment_buffer, -//GO(gst_tag_list_to_xmp_buffer, -//GO(gst_tag_mux_get_type, -//GO(gst_tag_parse_extended_comment, -//GO(gst_tag_register_musicbrainz_tags, -//GO(gst_tag_to_id3_tag, -//GO(gst_tag_to_vorbis_comments, -//GO(gst_tag_to_vorbis_tag, -//GO(gst_tag_xmp_list_schemas, -//GO(gst_tag_xmp_writer_add_all_schemas, -//GO(gst_tag_xmp_writer_add_schema, -//GO(gst_tag_xmp_writer_get_type, -//GO(gst_tag_xmp_writer_has_schema, -//GO(gst_tag_xmp_writer_remove_all_schemas, -//GO(gst_tag_xmp_writer_remove_schema, -//GO(gst_tag_xmp_writer_tag_list_to_xmp_buffer, -//GO(gst_vorbis_tag_add, +GO(gst_tag_list_from_xmp_buffer, pFp) +GO(gst_tag_list_new_from_id3v1, pFp) +GO(gst_tag_list_to_exif_buffer, pFpiu) +GO(gst_tag_list_to_exif_buffer_with_tiff_header, pFp) +GO(gst_tag_list_to_vorbiscomment_buffer, pFppup) +GO(gst_tag_list_to_xmp_buffer, pFpip) +GO(gst_tag_mux_get_type, LFv) +GO(gst_tag_parse_extended_comment, iFppppi) +GO(gst_tag_register_musicbrainz_tags, vFv) +GO(gst_tag_to_id3_tag, pFp) +GO(gst_tag_to_vorbis_comments, pFpp) +GO(gst_tag_to_vorbis_tag, pFp) +GO(gst_tag_xmp_list_schemas, pFv) +GO(gst_tag_xmp_writer_add_all_schemas, vFp) +GO(gst_tag_xmp_writer_add_schema, vFpp) +GO(gst_tag_xmp_writer_get_type, LFv) +GO(gst_tag_xmp_writer_has_schema, iFpp) +GO(gst_tag_xmp_writer_remove_all_schemas, vFp) +GO(gst_tag_xmp_writer_remove_schema, vFpp) +GO(gst_tag_xmp_writer_tag_list_to_xmp_buffer, pFppi) +GO(gst_vorbis_tag_add, vFppp) diff --git a/src/wrapped/wrappedgstvideo.c b/src/wrapped/wrappedgstvideo.c index 37538d3..53595f1 100644 --- a/src/wrapped/wrappedgstvideo.c +++ b/src/wrapped/wrappedgstvideo.c @@ -20,11 +20,8 @@ #include "gtkclass.h" #include "fileutils.h" -#ifdef ANDROID - const char* gstvideoName = "libgstvideo-1.0.so"; -#else - const char* gstvideoName = "libgstvideo-1.0.so.0"; -#endif +const char* gstvideoName = "libgstvideo-1.0.so.0"; +#define ALTNAME "libgstvideo-1.0.so" #define LIBNAME gstvideo @@ -37,14 +34,14 @@ typedef size_t (*LFv_t)(); GO(gst_video_aggregator_get_type, LFv_t) \ GO(gst_video_aggregator_pad_get_type, LFv_t) \ GO(gst_video_filter_get_type, LFv_t) \ + GO(gst_video_buffer_pool_get_type, LFv_t) \ #include "generated/wrappedgstbasetypes.h" #include "wrappercallback.h" -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define CUSTOM_INIT \ SetGstVideoDecoderID(my->gst_video_decoder_get_type());\ @@ -52,12 +49,9 @@ typedef size_t (*LFv_t)(); SetGstVideoSinkID(my->gst_video_sink_get_type());\ SetGstVideoAggregatorID(my->gst_video_aggregator_get_type());\ SetGstVideoAggregatorPadID(my->gst_video_aggregator_pad_get_type());\ - SetGstVideoFilterID(my->gst_video_filter_get_type()); + SetGstVideoFilterID(my->gst_video_filter_get_type());\ + SetGstVideoBufferPoolID(my->gst_video_buffer_pool_get_type());\ -#ifdef ANDROID -#define NEEDED_LIBS "libgstreamer-1.0.so" -#else #define NEEDED_LIBS "libgstreamer-1.0.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgstvideo_private.h b/src/wrapped/wrappedgstvideo_private.h index dbc61d9..8872492 100644 --- a/src/wrapped/wrappedgstvideo_private.h +++ b/src/wrapped/wrappedgstvideo_private.h @@ -1,23 +1,23 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//GO(gst_buffer_add_video_afd_meta, +GO(gst_buffer_add_video_afd_meta, pFpCuu) GO(gst_buffer_add_video_affine_transformation_meta, pFp) -//GO(gst_buffer_add_video_bar_meta, -GO(gst_buffer_add_video_caption_meta, pFpipL) +GO(gst_buffer_add_video_bar_meta, pFpCiuu) +GO(gst_buffer_add_video_caption_meta, pFpupL) GO(gst_buffer_add_video_codec_alpha_meta, pFpp) -//GO(gst_buffer_add_video_gl_texture_upload_meta, -GO(gst_buffer_add_video_meta, pFpiiuu) -GO(gst_buffer_add_video_meta_full, pFpiiuuupp) -//GO(gst_buffer_add_video_overlay_composition_meta, -//GO(gst_buffer_add_video_region_of_interest_meta, -//GO(gst_buffer_add_video_region_of_interest_meta_id, +//GOM(gst_buffer_add_video_gl_texture_upload_meta, pFEpuuppppp) +GO(gst_buffer_add_video_meta, pFpuuuu) +GO(gst_buffer_add_video_meta_full, pFpuuuuupp) +GO(gst_buffer_add_video_overlay_composition_meta, pFpp) +GO(gst_buffer_add_video_region_of_interest_meta, pFppuuuu) +GO(gst_buffer_add_video_region_of_interest_meta_id, pFpuuuuu) GO(gst_buffer_add_video_time_code_meta, pFpp) -//GO(gst_buffer_add_video_time_code_meta_full, +GO(gst_buffer_add_video_time_code_meta_full, pFpuupuuuuuu) GO(gst_buffer_get_video_meta, pFp) -//GO(gst_buffer_get_video_meta_id, -//GO(gst_buffer_get_video_region_of_interest_meta_id, +GO(gst_buffer_get_video_meta_id, pFpi) +GO(gst_buffer_get_video_region_of_interest_meta_id, pFpi) GO(gst_buffer_pool_config_get_video_alignment, iFpp) GO(gst_buffer_pool_config_set_video_alignment, vFpp) GO(gst_color_balance_channel_get_type, LFv) @@ -26,44 +26,44 @@ GO(gst_color_balance_get_type, LFv) GO(gst_color_balance_get_value, iFpp) GO(gst_color_balance_list_channels, pFp) GO(gst_color_balance_set_value, vFppi) -//GO(gst_color_balance_type_get_type, +GO(gst_color_balance_type_get_type, LFv) GO(gst_color_balance_value_changed, vFppi) -//GO(gst_is_video_overlay_prepare_window_handle_message, -//GO(gst_navigation_command_get_type, +GO(gst_is_video_overlay_prepare_window_handle_message, iFp) +GO(gst_navigation_command_get_type, LFv) GO(gst_navigation_event_get_coordinates, iFppp) -GO(gst_navigation_event_get_type, LFv) -GO(gst_navigation_event_new_key_press, pFpi) -GO(gst_navigation_event_new_key_release, pFpi) -GO(gst_navigation_event_new_mouse_button_press, pFpddi) -GO(gst_navigation_event_new_mouse_button_release, pFpddi) -GO(gst_navigation_event_new_mouse_move, pFddi) -GO(gst_navigation_event_new_mouse_scroll, pFddddi) -//GO(gst_navigation_event_parse_command, +GO(gst_navigation_event_get_type, uFp) +GO(gst_navigation_event_new_key_press, pFpu) +GO(gst_navigation_event_new_key_release, pFpu) +GO(gst_navigation_event_new_mouse_button_press, pFiddu) +GO(gst_navigation_event_new_mouse_button_release, pFiddu) +GO(gst_navigation_event_new_mouse_move, pFddu) +GO(gst_navigation_event_new_mouse_scroll, pFddddu) +GO(gst_navigation_event_parse_command, iFpp) GO(gst_navigation_event_parse_key_event, iFpp) -//GO(gst_navigation_event_parse_mouse_button_event, -//GO(gst_navigation_event_parse_mouse_move_event, +GO(gst_navigation_event_parse_mouse_button_event, iFpppp) +GO(gst_navigation_event_parse_mouse_move_event, iFppp) GO(gst_navigation_event_parse_mouse_scroll_event, iFppppp) GO(gst_navigation_event_set_coordinates, iFpdd) -//GO(gst_navigation_event_type_get_type, +GO(gst_navigation_event_type_get_type, LFv) GO(gst_navigation_get_type, LFv) -//GO(gst_navigation_message_get_type, -//GO(gst_navigation_message_new_angles_changed, -//GO(gst_navigation_message_new_commands_changed, +GO(gst_navigation_message_get_type, uFp) +GO(gst_navigation_message_new_angles_changed, pFpuu) +GO(gst_navigation_message_new_commands_changed, pFp) GO(gst_navigation_message_new_event, pFpp) -//GO(gst_navigation_message_new_mouse_over, -//GO(gst_navigation_message_parse_angles_changed, -//GO(gst_navigation_message_parse_event, -//GO(gst_navigation_message_parse_mouse_over, -//GO(gst_navigation_message_type_get_type, -//GO(gst_navigation_query_get_type, -//GO(gst_navigation_query_new_angles, -//GO(gst_navigation_query_new_commands, -//GO(gst_navigation_query_parse_angles, -//GO(gst_navigation_query_parse_commands_length, -//GO(gst_navigation_query_parse_commands_nth, -//GO(gst_navigation_query_set_angles, -//GO(gst_navigation_query_set_commands, -//GO(gst_navigation_query_set_commandsv, +GO(gst_navigation_message_new_mouse_over, pFpi) +GO(gst_navigation_message_parse_angles_changed, iFppp) +GO(gst_navigation_message_parse_event, iFpp) +GO(gst_navigation_message_parse_mouse_over, iFpp) +GO(gst_navigation_message_type_get_type, LFv) +GO(gst_navigation_query_get_type, uFp) +GO(gst_navigation_query_new_angles, pFv) +GO(gst_navigation_query_new_commands, pFv) +GO(gst_navigation_query_parse_angles, iFppp) +GO(gst_navigation_query_parse_commands_length, iFpp) +GO(gst_navigation_query_parse_commands_nth, iFpup) +GO(gst_navigation_query_set_angles, vFpuu) +//GOM(gst_navigation_query_set_commands, vFEpiV) +GO(gst_navigation_query_set_commandsv, vFpip) GO(gst_navigation_query_type_get_type, LFv) GO(gst_navigation_send_command, vFpu) GO(gst_navigation_send_event, vFpp) @@ -72,39 +72,39 @@ GO(gst_navigation_send_key_event, vFppp) GO(gst_navigation_send_mouse_event, vFppidd) GO(gst_navigation_send_mouse_scroll_event, vFpdddd) GO(gst_video_afd_meta_api_get_type, LFv) -//GO(gst_video_afd_meta_get_info, +GO(gst_video_afd_meta_get_info, pFv) GO(gst_video_afd_spec_get_type, LFv) GO(gst_video_afd_value_get_type, LFv) GO(gst_video_affine_transformation_meta_api_get_type, LFv) -//GO(gst_video_affine_transformation_meta_apply_matrix, -//GO(gst_video_affine_transformation_meta_get_info, +GO(gst_video_affine_transformation_meta_apply_matrix, vFpp) +GO(gst_video_affine_transformation_meta_get_info, pFv) GO(gst_video_aggregator_convert_pad_get_type, LFv) -//GO(gst_video_aggregator_convert_pad_update_conversion_info, +GO(gst_video_aggregator_convert_pad_update_conversion_info, vFp) GO(gst_video_aggregator_get_type, LFv) GO(gst_video_aggregator_pad_get_current_buffer, pFp) -//GO(gst_video_aggregator_pad_get_prepared_frame, +GO(gst_video_aggregator_pad_get_prepared_frame, pFp) GO(gst_video_aggregator_pad_get_type, LFv) -//GO(gst_video_aggregator_pad_has_current_buffer, -//GO(gst_video_aggregator_pad_set_needs_alpha, +GO(gst_video_aggregator_pad_has_current_buffer, iFp) +GO(gst_video_aggregator_pad_set_needs_alpha, vFpi) GO(gst_video_alignment_reset, vFp) GO(gst_video_alpha_mode_get_type, LFv) GO(gst_video_ancillary_di_d16_get_type, LFv) GO(gst_video_ancillary_did_get_type, LFv) GO(gst_video_bar_meta_api_get_type, LFv) -//GO(gst_video_bar_meta_get_info, -//GO(gst_video_blend, -//GO(gst_video_blend_scale_linear_RGBA, +GO(gst_video_bar_meta_get_info, pFv) +GO(gst_video_blend, iFppiif) +GO(gst_video_blend_scale_linear_RGBA, vFppiipp) GO(gst_video_buffer_flags_get_type, LFv) GO(gst_video_buffer_pool_get_type, LFv) GO(gst_video_buffer_pool_new, pFv) GO(gst_video_calculate_display_ratio, iFppuuuuuu) GO(gst_video_caption_meta_api_get_type, LFv) -//GO(gst_video_caption_meta_get_info, -//GO(gst_video_caption_type_from_caps, +GO(gst_video_caption_meta_get_info, pFv) +GO(gst_video_caption_type_from_caps, uFp) GO(gst_video_caption_type_get_type, LFv) -//GO(gst_video_caption_type_to_caps, +GO(gst_video_caption_type_to_caps, pFu) GO(gst_video_chroma_flags_get_type, LFv) -//GO(gst_video_chroma_from_string, +GO(gst_video_chroma_from_string, uFp) GO(gst_video_chroma_method_get_type, LFv) GO(gst_video_chroma_mode_get_type, LFv) GO(gst_video_chroma_resample, vFppi) @@ -114,9 +114,9 @@ GO(gst_video_chroma_resample_new, pFuuuuii) GO(gst_video_chroma_site_get_type, LFv) GO(gst_video_chroma_to_string, pFu) GO(gst_video_codec_frame_get_type, LFv) -//GO(gst_video_codec_frame_get_user_data, +GO(gst_video_codec_frame_get_user_data, pFp) GO(gst_video_codec_frame_ref, pFp) -//GO(gst_video_codec_frame_set_user_data, +//GOM(gst_video_codec_frame_set_user_data, vFEppp) GO(gst_video_codec_frame_unref, vFp) GO(gst_video_codec_state_get_type, LFv) GO(gst_video_codec_state_ref, pFp) @@ -134,11 +134,11 @@ GO(gst_video_color_primaries_get_info, pFu) GO(gst_video_color_primaries_get_type, LFv) GO(gst_video_color_primaries_to_iso, uFu) GO(gst_video_color_range_get_type, LFv) -//GO(gst_video_color_range_offsets, -//GO(gst_video_color_transfer_decode, -//GO(gst_video_color_transfer_encode, +GO(gst_video_color_range_offsets, vFuppp) +GO(gst_video_color_transfer_decode, dFud) +GO(gst_video_color_transfer_encode, dFud) GO(gst_video_content_light_level_add_to_caps, iFpp) -//GO(gst_video_content_light_level_from_caps, +GO(gst_video_content_light_level_from_caps, iFpp) GO(gst_video_content_light_level_from_string, iFpp) GO(gst_video_content_light_level_init, vFp) GO(gst_video_content_light_level_to_string, pFp) @@ -147,50 +147,50 @@ GO(gst_video_converter_free, vFp) GO(gst_video_converter_get_config, pFp) GO(gst_video_converter_new, pFppp) GO(gst_video_converter_set_config, iFpp) -//GO(gst_video_convert_sample, -//GO(gst_video_convert_sample_async, +GO(gst_video_convert_sample, pFppLp) +//GOM(gst_video_convert_sample_async, vFEppLppp) GO(gst_video_crop_meta_api_get_type, LFv) GO(gst_video_crop_meta_get_info, pFv) GO(gst_video_decoder_add_to_frame, vFpi) -//GO(gst_video_decoder_allocate_output_buffer, +GO(gst_video_decoder_allocate_output_buffer, pFp) GO(gst_video_decoder_allocate_output_frame, iFpp) -//GO(gst_video_decoder_allocate_output_frame_with_params, +GO(gst_video_decoder_allocate_output_frame_with_params, iFppp) GO(gst_video_decoder_drop_frame, iFpp) -GO(_gst_video_decoder_error, iFpipippppi) +GO(_gst_video_decoder_error, iFpiuippppi) GO(gst_video_decoder_finish_frame, iFpp) -//GO(gst_video_decoder_get_allocator, +GO(gst_video_decoder_get_allocator, vFppp) GO(gst_video_decoder_get_buffer_pool, pFp) -//GO(gst_video_decoder_get_estimate_rate, +GO(gst_video_decoder_get_estimate_rate, iFp) GO(gst_video_decoder_get_frame, pFpi) GO(gst_video_decoder_get_frames, pFp) -//GO(gst_video_decoder_get_latency, -GO(gst_video_decoder_get_max_decode_time, IFpp) -//GO(gst_video_decoder_get_max_errors, -//GO(gst_video_decoder_get_needs_format, -//GO(gst_video_decoder_get_oldest_frame, +GO(gst_video_decoder_get_latency, vFppp) +GO(gst_video_decoder_get_max_decode_time, lFpp) +GO(gst_video_decoder_get_max_errors, iFp) +GO(gst_video_decoder_get_needs_format, iFp) +GO(gst_video_decoder_get_oldest_frame, pFp) GO(gst_video_decoder_get_output_state, pFp) -//GO(gst_video_decoder_get_packetized, -//GO(gst_video_decoder_get_pending_frame_size, -//GO(gst_video_decoder_get_qos_proportion, +GO(gst_video_decoder_get_packetized, iFp) +GO(gst_video_decoder_get_pending_frame_size, LFp) +GO(gst_video_decoder_get_qos_proportion, dFp) GO(gst_video_decoder_get_subframe_mode, iFp) GO(gst_video_decoder_get_type, LFv) GO(gst_video_decoder_have_frame, iFp) GO(gst_video_decoder_have_last_subframe, iFpp) -GO(gst_video_decoder_merge_tags, vFppi) +GO(gst_video_decoder_merge_tags, vFppu) GO(gst_video_decoder_negotiate, iFp) GO(gst_video_decoder_proxy_getcaps, pFppp) GO(gst_video_decoder_release_frame, vFpp) -//GO(gst_video_decoder_set_estimate_rate, -GO(gst_video_decoder_set_interlaced_output_state, pFpiiuup) -GO(gst_video_decoder_set_latency, vFpUU) -//GO(gst_video_decoder_set_max_errors, +GO(gst_video_decoder_set_estimate_rate, vFpi) +GO(gst_video_decoder_set_interlaced_output_state, pFpuuuup) +GO(gst_video_decoder_set_latency, vFpLL) +GO(gst_video_decoder_set_max_errors, vFpi) GO(gst_video_decoder_set_needs_format, vFpi) -GO(gst_video_decoder_set_output_state, pFpiuup) +GO(gst_video_decoder_set_output_state, pFpuuup) GO(gst_video_decoder_set_packetized, vFpi) GO(gst_video_decoder_set_subframe_mode, vFpi) GO(gst_video_decoder_set_use_default_pad_acceptcaps, vFpi) GO(gst_video_direction_get_type, LFv) -//GO(gst_video_dither_flags_get_type, +GO(gst_video_dither_flags_get_type, LFv) GO(gst_video_dither_free, vFp) GO(gst_video_dither_line, vFppuuu) GO(gst_video_dither_method_get_type, LFv) @@ -198,33 +198,33 @@ GO(gst_video_dither_new, pFuuupu) GO(gst_video_encoder_allocate_output_buffer, pFpL) GO(gst_video_encoder_allocate_output_frame, iFppL) GO(gst_video_encoder_finish_frame, iFpp) -//GO(gst_video_encoder_finish_subframe, -//GO(gst_video_encoder_get_allocator, -//GO(gst_video_encoder_get_frame, -//GO(gst_video_encoder_get_frames, -//GO(gst_video_encoder_get_latency, -//GO(gst_video_encoder_get_max_encode_time, -//GO(gst_video_encoder_get_min_force_key_unit_interval, +GO(gst_video_encoder_finish_subframe, iFpp) +GO(gst_video_encoder_get_allocator, vFppp) +GO(gst_video_encoder_get_frame, pFpi) +GO(gst_video_encoder_get_frames, pFp) +GO(gst_video_encoder_get_latency, vFppp) +GO(gst_video_encoder_get_max_encode_time, lFpp) +GO(gst_video_encoder_get_min_force_key_unit_interval, LFp) GO(gst_video_encoder_get_oldest_frame, pFp) -//GO(gst_video_encoder_get_output_state, +GO(gst_video_encoder_get_output_state, pFp) GO(gst_video_encoder_get_type, LFv) -//GO(gst_video_encoder_is_qos_enabled, -GO(gst_video_encoder_merge_tags, vFppi) +GO(gst_video_encoder_is_qos_enabled, iFp) +GO(gst_video_encoder_merge_tags, vFppu) GO(gst_video_encoder_negotiate, iFp) GO(gst_video_encoder_proxy_getcaps, pFppp) GO(gst_video_encoder_set_headers, vFpp) -//GO(gst_video_encoder_set_latency, -//GO(gst_video_encoder_set_min_force_key_unit_interval, -GO(gst_video_encoder_set_min_pts, vFpU) +GO(gst_video_encoder_set_latency, vFpLL) +GO(gst_video_encoder_set_min_force_key_unit_interval, vFpL) +GO(gst_video_encoder_set_min_pts, vFpL) GO(gst_video_encoder_set_output_state, pFppp) -//GO(gst_video_encoder_set_qos_enabled, -//GO(gst_video_event_is_force_key_unit, -//GO(gst_video_event_new_downstream_force_key_unit, -//GO(gst_video_event_new_still_frame, -//GO(gst_video_event_new_upstream_force_key_unit, -//GO(gst_video_event_parse_downstream_force_key_unit, +GO(gst_video_encoder_set_qos_enabled, vFpi) +GO(gst_video_event_is_force_key_unit, iFp) +GO(gst_video_event_new_downstream_force_key_unit, pFLLLiu) +GO(gst_video_event_new_still_frame, pFi) +GO(gst_video_event_new_upstream_force_key_unit, pFLiu) +GO(gst_video_event_parse_downstream_force_key_unit, iFpppppp) GO(gst_video_event_parse_still_frame, iFpp) -//GO(gst_video_event_parse_upstream_force_key_unit, +GO(gst_video_event_parse_upstream_force_key_unit, iFpppp) GO(gst_video_field_order_from_string, uFp) GO(gst_video_field_order_get_type, LFv) GO(gst_video_field_order_to_string, pFu) @@ -234,28 +234,28 @@ GO(gst_video_format_flags_get_type, LFv) GO(gst_video_format_from_fourcc, uFu) GO(gst_video_format_from_masks, uFiiiuuuu) GO(gst_video_format_from_string, uFp) -GO(gst_video_format_get_info, pFi) +GO(gst_video_format_get_info, pFu) GO(gst_video_format_get_palette, pFup) -//GO(gst_video_format_get_type, -//GO(gst_video_format_info_component, +GO(gst_video_format_get_type, LFv) +GO(gst_video_format_info_component, vFpup) GO(gst_video_formats_raw, pFp) GO(gst_video_format_to_fourcc, uFu) GO(gst_video_format_to_string, pFu) GO(gst_video_frame_copy, iFpp) GO(gst_video_frame_copy_plane, iFppu) -//GO(gst_video_frame_flags_get_type, +GO(gst_video_frame_flags_get_type, LFv) GO(gst_video_frame_map, iFpppu) -//GO(gst_video_frame_map_flags_get_type, -//GO(gst_video_frame_map_id, +GO(gst_video_frame_map_flags_get_type, LFv) +GO(gst_video_frame_map_id, iFpppiu) GO(gst_video_frame_unmap, vFp) GO(gst_video_gamma_mode_get_type, LFv) GO(gst_video_gl_texture_upload_meta_api_get_type, LFv) -//GO(gst_video_gl_texture_upload_meta_get_info, -//GO(gst_video_gl_texture_upload_meta_upload, +GO(gst_video_gl_texture_upload_meta_get_info, pFv) +//GOM(gst_video_gl_texture_upload_meta_upload, iFEpp) GO(gst_video_guess_framerate, iFLpp) GO(gst_video_info_align, iFpp) GO(gst_video_info_align_full, iFppp) -GO(gst_video_info_convert, iFpiIip) +GO(gst_video_info_convert, iFpulup) GO(gst_video_info_copy, pFp) GO(gst_video_info_free, vFp) GO(gst_video_info_from_caps, iFpp) @@ -263,63 +263,63 @@ GO(gst_video_info_get_type, LFv) GO(gst_video_info_init, vFp) GO(gst_video_info_is_equal, iFpp) GO(gst_video_info_new, pFv) -GO(gst_video_info_set_format, iFpiuu) -GO(gst_video_info_set_interlaced_format, iFpiiuu) +GO(gst_video_info_set_format, iFpuuu) +GO(gst_video_info_set_interlaced_format, iFpuuuu) GO(gst_video_info_to_caps, pFp) GO(gst_video_interlace_mode_from_string, uFp) GO(gst_video_interlace_mode_get_type, LFv) GO(gst_video_interlace_mode_to_string, pFu) GO(gst_video_is_common_aspect_ratio, iFiiii) -//GO(gst_video_make_raw_caps, -//GO(gst_video_make_raw_caps_with_features, +GO(gst_video_make_raw_caps, pFpu) +GO(gst_video_make_raw_caps_with_features, pFpup) GO(gst_video_mastering_display_info_add_to_caps, iFpp) -//GO(gst_video_mastering_display_info_from_caps, +GO(gst_video_mastering_display_info_from_caps, iFpp) GO(gst_video_mastering_display_info_from_string, iFpp) GO(gst_video_mastering_display_info_init, vFp) GO(gst_video_mastering_display_info_is_equal, iFpp) GO(gst_video_mastering_display_info_to_string, pFp) GO(gst_video_matrix_mode_get_type, LFv) GO(gst_video_meta_api_get_type, LFv) -//GO(gst_video_meta_get_info, -//GO(gst_video_meta_get_plane_height, -//GO(gst_video_meta_get_plane_size, -//GO(gst_video_meta_map, -GO(gst_video_meta_set_alignment, iFpi) -GO(gst_video_meta_transform_scale_get_quark, pFv) -//GO(gst_video_meta_unmap, +GO(gst_video_meta_get_info, pFv) +GO(gst_video_meta_get_plane_height, iFpp) +GO(gst_video_meta_get_plane_size, iFpp) +GO(gst_video_meta_map, iFpupppu) +GO(gst_video_meta_set_alignment, iFpHH) // this function have a structure as 2nd parameter. The structure is 4 ints and an array of 4 ints => translating to 2 HH +GO(gst_video_meta_transform_scale_get_quark, uFv) +GO(gst_video_meta_unmap, iFpup) GO(gst_video_multiview_flagset_get_type, LFv) GO(gst_video_multiview_flags_get_type, LFv) GO(gst_video_multiview_frame_packing_get_type, LFv) -//GO(gst_video_multiview_get_doubled_height_modes, +GO(gst_video_multiview_get_doubled_height_modes, pFv) GO(gst_video_multiview_get_doubled_size_modes, pFv) -//GO(gst_video_multiview_get_doubled_width_modes, -//GO(gst_video_multiview_get_mono_modes, -//GO(gst_video_multiview_get_unpacked_modes, +GO(gst_video_multiview_get_doubled_width_modes, pFv) +GO(gst_video_multiview_get_mono_modes, pFv) +GO(gst_video_multiview_get_unpacked_modes, pFv) GO(gst_video_multiview_guess_half_aspect, iFiuuuu) GO(gst_video_multiview_mode_from_caps_string, iFp) GO(gst_video_multiview_mode_get_type, LFv) GO(gst_video_multiview_mode_to_caps_string, pFi) -GO(gst_video_multiview_video_info_change_mode, vFpii) +GO(gst_video_multiview_video_info_change_mode, vFpiu) GO(gst_video_orientation_from_tag, iFpp) -//GO(gst_video_orientation_get_hcenter, -//GO(gst_video_orientation_get_hflip, +GO(gst_video_orientation_get_hcenter, iFpp) +GO(gst_video_orientation_get_hflip, iFpp) GO(gst_video_orientation_get_type, LFv) GO(gst_video_orientation_get_vcenter, iFpp) GO(gst_video_orientation_get_vflip, iFpp) GO(gst_video_orientation_method_get_type, LFv) -//GO(gst_video_orientation_set_hcenter, -//GO(gst_video_orientation_set_hflip, +GO(gst_video_orientation_set_hcenter, iFpi) +GO(gst_video_orientation_set_hflip, iFpi) GO(gst_video_orientation_set_vcenter, iFpi) GO(gst_video_orientation_set_vflip, iFpi) GO(gst_video_overlay_composition_add_rectangle, vFpp) -//GO(gst_video_overlay_composition_blend, -//GO(gst_video_overlay_composition_copy, +GO(gst_video_overlay_composition_blend, iFpp) +GO(gst_video_overlay_composition_copy, pFp) GO(gst_video_overlay_composition_get_rectangle, pFpu) GO(gst_video_overlay_composition_get_seqnum, uFp) GO(gst_video_overlay_composition_get_type, LFv) GO(gst_video_overlay_composition_make_writable, pFp) GO(gst_video_overlay_composition_meta_api_get_type, LFv) -//GO(gst_video_overlay_composition_meta_get_info, +GO(gst_video_overlay_composition_meta_get_info, pFv) GO(gst_video_overlay_composition_new, pFp) GO(gst_video_overlay_composition_n_rectangles, uFp) GO(gst_video_overlay_expose, vFp) @@ -332,16 +332,16 @@ GO(gst_video_overlay_prepare_window_handle, vFp) GO(gst_video_overlay_rectangle_copy, pFp) GO(gst_video_overlay_rectangle_get_flags, uFp) GO(gst_video_overlay_rectangle_get_global_alpha, fFp) -//GO(gst_video_overlay_rectangle_get_pixels_argb, -//GO(gst_video_overlay_rectangle_get_pixels_ayuv, -//GO(gst_video_overlay_rectangle_get_pixels_raw, -//GO(gst_video_overlay_rectangle_get_pixels_unscaled_argb, -//GO(gst_video_overlay_rectangle_get_pixels_unscaled_ayuv, -//GO(gst_video_overlay_rectangle_get_pixels_unscaled_raw, +GO(gst_video_overlay_rectangle_get_pixels_argb, pFpu) +GO(gst_video_overlay_rectangle_get_pixels_ayuv, pFpu) +GO(gst_video_overlay_rectangle_get_pixels_raw, pFpu) +GO(gst_video_overlay_rectangle_get_pixels_unscaled_argb, pFpu) +GO(gst_video_overlay_rectangle_get_pixels_unscaled_ayuv, pFpu) +GO(gst_video_overlay_rectangle_get_pixels_unscaled_raw, pFpu) GO(gst_video_overlay_rectangle_get_render_rectangle, iFppppp) GO(gst_video_overlay_rectangle_get_seqnum, uFp) GO(gst_video_overlay_rectangle_get_type, LFv) -//GO(gst_video_overlay_rectangle_new_raw, +GO(gst_video_overlay_rectangle_new_raw, pFpiiuuu) GO(gst_video_overlay_rectangle_set_global_alpha, vFpf) GO(gst_video_overlay_rectangle_set_render_rectangle, vFpiiuu) GO(gst_video_overlay_set_property, iFpiup) @@ -349,10 +349,10 @@ GO(gst_video_overlay_set_render_rectangle, iFpiiii) GO(gst_video_overlay_set_window_handle, vFpL) GO(gst_video_pack_flags_get_type, LFv) GO(gst_video_primaries_mode_get_type, LFv) -//GO(gst_video_region_of_interest_meta_add_param, +GO(gst_video_region_of_interest_meta_add_param, vFpp) GO(gst_video_region_of_interest_meta_api_get_type, LFv) -//GO(gst_video_region_of_interest_meta_get_info, -//GO(gst_video_region_of_interest_meta_get_param, +GO(gst_video_region_of_interest_meta_get_info, pFv) +GO(gst_video_region_of_interest_meta_get_param, pFpp) GO(gst_video_resampler_clear, vFp) GO(gst_video_resampler_flags_get_type, LFv) GO(gst_video_resampler_init, iFpuuuuduup) @@ -366,7 +366,7 @@ GO(gst_video_scaler_get_max_taps, uFp) GO(gst_video_scaler_horizontal, vFpuppuu) GO(gst_video_scaler_new, pFuuuuup) GO(gst_video_scaler_vertical, vFpuppuu) -GO(gst_video_sink_center_rect, vFpppppi) // this is vFHHpi, with 2 GstVideoRectangle struct that are 4 ints +GO(gst_video_sink_center_rect, vFHHpi) // structure in parameter GO(gst_video_sink_get_type, LFv) GO(gst_video_tile_get_index, uFuiiii) GO(gst_video_tile_mode_get_type, LFv) @@ -386,36 +386,36 @@ GO(gst_video_time_code_init_from_date_time, vFpuupuu) GO(gst_video_time_code_init_from_date_time_full, iFpuupuu) GO(gst_video_time_code_interval_clear, vFp) GO(gst_video_time_code_interval_copy, pFp) -//GO(gst_video_time_code_interval_free, +GO(gst_video_time_code_interval_free, vFp) GO(gst_video_time_code_interval_get_type, LFv) GO(gst_video_time_code_interval_init, vFpuuuu) GO(gst_video_time_code_interval_new, pFuuuu) GO(gst_video_time_code_interval_new_from_string, pFp) GO(gst_video_time_code_is_valid, iFp) GO(gst_video_time_code_meta_api_get_type, LFv) -//GO(gst_video_time_code_meta_get_info, +GO(gst_video_time_code_meta_get_info, pFv) GO(gst_video_time_code_new, pFuupuuuuuu) GO(gst_video_time_code_new_empty, pFv) -//GO(gst_video_time_code_new_from_date_time, +GO(gst_video_time_code_new_from_date_time, pFuupuu) GO(gst_video_time_code_new_from_date_time_full, pFuupuu) GO(gst_video_time_code_new_from_string, pFp) -GO(gst_video_time_code_nsec_since_daily_jam, UFp) +GO(gst_video_time_code_nsec_since_daily_jam, LFp) GO(gst_video_time_code_to_date_time, pFp) GO(gst_video_time_code_to_string, pFp) GO(gst_video_transfer_function_from_iso, uFu) -//GO(gst_video_transfer_function_get_type, +GO(gst_video_transfer_function_get_type, LFv) GO(gst_video_transfer_function_is_equivalent, iFuuuu) GO(gst_video_transfer_function_to_iso, uFu) GO(gst_video_vbi_encoder_add_ancillary, iFpiCCpu) GO(gst_video_vbi_encoder_copy, pFp) GO(gst_video_vbi_encoder_free, vFp) -//GO(gst_video_vbi_encoder_get_type, +GO(gst_video_vbi_encoder_get_type, LFv) GO(gst_video_vbi_encoder_new, pFuu) GO(gst_video_vbi_encoder_write_line, vFpp) GO(gst_video_vbi_parser_add_line, vFpp) GO(gst_video_vbi_parser_copy, pFp) GO(gst_video_vbi_parser_free, vFp) GO(gst_video_vbi_parser_get_ancillary, uFpp) -//GO(gst_video_vbi_parser_get_type, +GO(gst_video_vbi_parser_get_type, LFv) GO(gst_video_vbi_parser_new, pFuu) -//GO(gst_video_vbi_parser_result_get_type, +GO(gst_video_vbi_parser_result_get_type, LFv) diff --git a/src/wrapped/wrappedgthread2.c b/src/wrapped/wrappedgthread2.c index 66b6462..8fab66f 100644 --- a/src/wrapped/wrappedgthread2.c +++ b/src/wrapped/wrappedgthread2.c @@ -96,8 +96,7 @@ void** my_GetGthreadsGotInitialized() return (void**)&g_threads_got_initialized; } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgtk3.c b/src/wrapped/wrappedgtk3.c index d39d994..f9f7393 100644 --- a/src/wrapped/wrappedgtk3.c +++ b/src/wrapped/wrappedgtk3.c @@ -19,11 +19,8 @@ #include "myalign.h" #include "gtkclass.h" -#ifdef ANDROID - const char* gtk3Name = "libgtk-3.so"; -#else - const char* gtk3Name = "libgtk-3.so.0"; -#endif +const char* gtk3Name = "libgtk-3.so.0"; +#define ALTNAME "libgtk-3.so" #define LIBNAME gtk3 @@ -41,68 +38,64 @@ typedef void (*vFppp_t)(void*, void*, void*); typedef void (*vFppA_t)(void*, void*, va_list); typedef void (*vFpipV_t)(void*, int, void*, ...); typedef void (*vFppippi_t)(void*, void*, int, void*, void*, int); - -#define ADDED_FUNCTIONS() \ -GO(g_type_class_ref, pFL_t) \ -GO(g_type_class_unref, vFp_t) \ -GO(gtk_application_window_get_type, LFv_t) \ -GO(gtk_bin_get_type, LFv_t) \ -GO(gtk_widget_get_type, LFv_t) \ -GO(gtk_button_get_type, LFv_t) \ -GO(gtk_menu_button_get_type, LFv_t) \ -GO(gtk_container_get_type, LFv_t) \ -GO(gtk_misc_get_type, LFv_t) \ -GO(gtk_label_get_type, LFv_t) \ -GO(gtk_list_box_get_type, LFv_t) \ -GO(gtk_image_get_type, LFv_t) \ -GO(gtk_list_box_row_get_type, LFv_t) \ -GO(gtk_tree_view_get_type, LFv_t) \ -GO(gtk_window_get_type, LFv_t) \ -GO(gtk_table_get_type, LFv_t) \ -GO(gtk_fixed_get_type, LFv_t) \ -GO(gtk_combo_box_get_type, LFv_t) \ -GO(gtk_toggle_button_get_type, LFv_t) \ -GO(gtk_check_button_get_type, LFv_t) \ -GO(gtk_text_view_get_type, LFv_t) \ -GO(gtk_frame_get_type, LFv_t) \ -GO(gtk_entry_get_type, LFv_t) \ -GO(gtk_spin_button_get_type, LFv_t) \ -GO(gtk_progress_get_type, LFv_t) \ -GO(gtk_progress_bar_get_type, LFv_t) \ -GO(gtk_menu_shell_get_type, LFv_t) \ -GO(gtk_menu_bar_get_type, LFv_t) \ -GO(gtk_action_get_type, LFv_t) \ -GO(gtk_application_get_type, LFv_t) \ -GO(gtk_grid_get_type, LFv_t) \ -GO(gtk_event_controller_get_type, LFv_t) \ -GO(gtk_gesture_get_type, LFv_t) \ -GO(gtk_gesture_single_get_type, LFv_t) \ -GO(gtk_gesture_long_press_get_type, LFv_t) \ -GO(gtk_dialog_add_button, pFppi_t) \ -GO(gtk_spin_button_get_value, dFp_t) \ -GO(gtk_builder_lookup_callback_symbol, pFpp_t) \ -GO(g_module_symbol, iFppp_t) \ -GO(g_log, vFpipV_t) \ -GO(g_module_open, pFpu_t) \ -GO(g_module_close, vFp_t) \ -GO(gtk_tree_store_newv, pFup_t) \ -GO(gtk_widget_style_get_valist, vFppA_t) \ -GO(gtk_widget_style_get_property, vFppp_t) \ -GO(gtk_list_store_insert_with_valuesv, vFppippi_t) +typedef void (*vFppip_t)(void*, void*, int, void*); + +#define ADDED_FUNCTIONS() \ + GO(g_type_class_ref, pFL_t) \ + GO(g_type_class_unref, vFp_t) \ + GO(gtk_application_window_get_type, LFv_t) \ + GO(gtk_bin_get_type, LFv_t) \ + GO(gtk_widget_get_type, LFv_t) \ + GO(gtk_button_get_type, LFv_t) \ + GO(gtk_menu_button_get_type, LFv_t) \ + GO(gtk_container_get_type, LFv_t) \ + GO(gtk_misc_get_type, LFv_t) \ + GO(gtk_label_get_type, LFv_t) \ + GO(gtk_list_box_get_type, LFv_t) \ + GO(gtk_image_get_type, LFv_t) \ + GO(gtk_list_box_row_get_type, LFv_t) \ + GO(gtk_tree_view_get_type, LFv_t) \ + GO(gtk_window_get_type, LFv_t) \ + GO(gtk_table_get_type, LFv_t) \ + GO(gtk_fixed_get_type, LFv_t) \ + GO(gtk_combo_box_get_type, LFv_t) \ + GO(gtk_toggle_button_get_type, LFv_t) \ + GO(gtk_check_button_get_type, LFv_t) \ + GO(gtk_text_view_get_type, LFv_t) \ + GO(gtk_frame_get_type, LFv_t) \ + GO(gtk_entry_get_type, LFv_t) \ + GO(gtk_spin_button_get_type, LFv_t) \ + GO(gtk_progress_get_type, LFv_t) \ + GO(gtk_progress_bar_get_type, LFv_t) \ + GO(gtk_menu_shell_get_type, LFv_t) \ + GO(gtk_menu_bar_get_type, LFv_t) \ + GO(gtk_action_get_type, LFv_t) \ + GO(gtk_application_get_type, LFv_t) \ + GO(gtk_grid_get_type, LFv_t) \ + GO(gtk_event_controller_get_type, LFv_t) \ + GO(gtk_gesture_get_type, LFv_t) \ + GO(gtk_gesture_single_get_type, LFv_t) \ + GO(gtk_gesture_long_press_get_type, LFv_t) \ + GO(gtk_drawing_area_get_type, LFv_t) \ + GO(gtk_dialog_add_button, pFppi_t) \ + GO(gtk_spin_button_get_value, dFp_t) \ + GO(gtk_builder_lookup_callback_symbol, pFpp_t) \ + GO(g_module_symbol, iFppp_t) \ + GO(g_log, vFpipV_t) \ + GO(g_module_open, pFpu_t) \ + GO(g_module_close, vFp_t) \ + GO(gtk_tree_store_newv, pFup_t) \ + GO(gtk_widget_style_get_valist, vFppA_t) \ + GO(gtk_widget_style_get_property, vFppp_t) \ + GO(gtk_list_store_insert_with_valuesv, vFppippi_t) \ + GO(gtk_tree_model_get_value, vFppip_t) \ + GO(gtk_list_store_set_value, vFppip_t) #include "generated/wrappedgtk3types.h" #include "wrappercallback.h" -EXPORT uintptr_t my3_gtk_signal_connect_full(x64emu_t* emu, void* object, void* name, void* c_handler, void* unsupported, void* data, void* closure, uint32_t signal, int after) -{ - my_signal_t *sig = new_mysignal(c_handler, data, closure); - uintptr_t ret = my->gtk_signal_connect_full(object, name, my_signal_cb, NULL, sig, my_signal_delete, signal, after); - printf_log(LOG_DEBUG, "Connecting gtk signal \"%s\" with cb=%p\n", (char*)name, sig); - return ret; -} - #define SUPER() \ GO(0) \ GO(1) \ @@ -384,6 +377,34 @@ static void* findGDestroyNotifyFct(void* fct) return NULL; } +// GTickCallback +#define GO(A) \ + static uintptr_t my_GTickCallback_fct_##A = 0; \ + static void my_GTickCallback_##A(void* widget, void* clock, void* data) \ + { \ + RunFunctionFmt(my_GTickCallback_fct_##A, "ppp", widget, clock, data); \ + } +SUPER() +#undef GO +static void* findGTickCallbackFct(void* fct) +{ + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_GTickCallback_fct_##A == (uintptr_t)fct) return my_GTickCallback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_GTickCallback_fct_##A == 0) { \ + my_GTickCallback_fct_##A = (uintptr_t)fct; \ + return my_GTickCallback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GTickCallback callback\n"); + return NULL; +} + // GtkTreeIterCompareFunc #define GO(A) \ static uintptr_t my_GtkTreeIterCompareFunc_fct_##A = 0; \ @@ -500,6 +521,79 @@ static void* find_GtkFileFilterFunc_Fct(void* fct) return NULL; } +// GtkListBoxUpdateHeaderFunc +#define GO(A) \ +static uintptr_t my_GtkListBoxUpdateHeaderFunc_fct_##A = 0; \ +static void my_GtkListBoxUpdateHeaderFunc_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my_GtkListBoxUpdateHeaderFunc_fct_##A, "ppp", a, b, c); \ +} +SUPER() +#undef GO +static void* findGtkListBoxUpdateHeaderFunc(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_GtkListBoxUpdateHeaderFunc_fct_##A == (uintptr_t)fct) return my_GtkListBoxUpdateHeaderFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_GtkListBoxUpdateHeaderFunc_fct_##A == 0) {my_GtkListBoxUpdateHeaderFunc_fct_##A = (uintptr_t)fct; return my_GtkListBoxUpdateHeaderFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GtkListBoxUpdateHeaderFunc callback\n"); + return NULL; +} +// TranslateEvent +#define GO(A) \ +static uintptr_t my_TranslateEvent_fct_##A = 0; \ +static void my_TranslateEvent_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_TranslateEvent_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* findTranslateEvent(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_TranslateEvent_fct_##A == (uintptr_t)fct) return my_TranslateEvent_##A; + SUPER() + #undef GO + #define GO(A) if(my_TranslateEvent_fct_##A == 0) {my_TranslateEvent_fct_##A = (uintptr_t)fct; return my_TranslateEvent_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gtk-3 TranslateEvent callback\n"); + return NULL; +} + +// GCallback +#define GO(A) \ + static uintptr_t my_GCallback_fct_##A = 0; \ + static void my_GCallback_##A(void* data) \ + { \ + RunFunctionFmt(my_GCallback_fct_##A, ""); \ + } +SUPER() +#undef GO +static void* findGCallbackFct(void* fct) +{ + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_GCallback_fct_##A == (uintptr_t)fct) return my_GCallback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_GCallback_fct_##A == 0) { \ + my_GCallback_fct_##A = (uintptr_t)fct; \ + return my_GCallback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for gtk-3 GCallback callback\n"); + return NULL; +} + #undef SUPER EXPORT void my3_gtk_dialog_add_buttons(x64emu_t* emu, void* dialog, void* first, uintptr_t* b) @@ -536,12 +630,6 @@ EXPORT void my3_gtk_message_dialog_format_secondary_markup(x64emu_t* emu, void* free(buf); } -EXPORT void* my3_gtk_type_class(x64emu_t* emu, size_t type) -{ - void* class = my->gtk_type_class(type); - return wrapCopyGTKClass(class, type); -} - EXPORT void my3_gtk_file_filter_add_custom(x64emu_t* emu, void* filter, uint32_t needed, void* f, void* data, void* d) { (void)emu; @@ -581,11 +669,6 @@ EXPORT void my3_gtk_menu_popup(x64emu_t* emu, void* menu, void* shell, void* ite my->gtk_menu_popup(menu, shell, item, findMenuPositionFct(f), data, button, time_); } -EXPORT uint32_t my3_gtk_timeout_add(x64emu_t* emu, uint32_t interval, void* f, void* data) -{ - return my->gtk_timeout_add(interval, findGtkFunctionFct(f), data); -} - EXPORT int my3_gtk_clipboard_set_with_data(x64emu_t* emu, void* clipboard, void* target, uint32_t n, void* f_get, void* f_clear, void* data) { return my->gtk_clipboard_set_with_data(clipboard, target, n, findClipboadGetFct(f_get), findClipboadClearFct(f_clear), data); @@ -596,15 +679,9 @@ EXPORT int my3_gtk_clipboard_set_with_owner(x64emu_t* emu, void* clipboard, void return my->gtk_clipboard_set_with_owner(clipboard, target, n, findClipboadGetFct(f_get), findClipboadClearFct(f_clear), data); } -static void* my_translate_func(void* path, my_signal_t* sig) -{ - return (void*)RunFunctionFmt(sig->c_handler, "pp", path, sig->data) ; -} - EXPORT void my3_gtk_stock_set_translate_func(x64emu_t* emu, void* domain, void* f, void* data, void* notify) { - my_signal_t *sig = new_mysignal(f, data, notify); - my->gtk_stock_set_translate_func(domain, my_translate_func, sig, my_signal_delete); + my->gtk_stock_set_translate_func(domain, findTranslateEvent(f), data, findGDestroyNotifyFct(notify)); } EXPORT void my3_gtk_container_forall(x64emu_t* emu, void* container, void* f, void* data) @@ -627,41 +704,6 @@ EXPORT int my3_gtk_text_iter_forward_find_char(x64emu_t* emu, void* iter, void* return my->gtk_text_iter_forward_find_char(iter, findGtkTextCharPredicateFct(f), data, limit); } -EXPORT void* my3_gtk_toolbar_append_item(x64emu_t* emu, void* toolbar, void* text, void* tooltip_text, void* tooltip_private, void* icon, void* f, void* data) -{ - return my->gtk_toolbar_append_item(toolbar, text, tooltip_text, tooltip_private, icon, findToolbarFct(f), data); -} - -EXPORT void* my3_gtk_toolbar_prepend_item(x64emu_t* emu, void* toolbar, void* text, void* tooltip_text, void* tooltip_private, void* icon, void* f, void* data) -{ - return my->gtk_toolbar_prepend_item(toolbar, text, tooltip_text, tooltip_private, icon, findToolbarFct(f), data); -} - -EXPORT void* my3_gtk_toolbar_insert_item(x64emu_t* emu, void* toolbar, void* text, void* tooltip_text, void* tooltip_private, void* icon, void* f, void* data, int position) -{ - return my->gtk_toolbar_insert_item(toolbar, text, tooltip_text, tooltip_private, icon, findToolbarFct(f), data, position); -} - -EXPORT void* my3_gtk_toolbar_append_element(x64emu_t* emu, void* toolbar, size_t type, void* widget, void* text, void* tooltip_text, void* tooltip_private, void* icon, void* f, void* data) -{ - return my->gtk_toolbar_append_element(toolbar, type, widget, text, tooltip_text, tooltip_private, icon, findToolbarFct(f), data); -} - -EXPORT void* my3_gtk_toolbar_prepend_element(x64emu_t* emu, void* toolbar, size_t type, void* widget, void* text, void* tooltip_text, void* tooltip_private, void* icon, void* f, void* data) -{ - return my->gtk_toolbar_prepend_element(toolbar, type, widget, text, tooltip_text, tooltip_private, icon, findToolbarFct(f), data); -} - -EXPORT void* my3_gtk_toolbar_insert_element(x64emu_t* emu, void* toolbar, size_t type, void* widget, void* text, void* tooltip_text, void* tooltip_private, void* icon, void* f, void* data, int position) -{ - return my->gtk_toolbar_insert_element(toolbar, type, widget, text, tooltip_text, tooltip_private, icon, findToolbarFct(f), data, position); -} - -EXPORT void* my3_gtk_toolbar_insert_stock(x64emu_t* emu, void* toolbar, void* stock_id, void* tooltip_text, void* tooltip_private, void* f, void* data, int position) -{ - return my->gtk_toolbar_insert_stock(toolbar, stock_id, tooltip_text, tooltip_private, findToolbarFct(f), data, position); -} - EXPORT void my3_gtk_tree_sortable_set_sort_func(x64emu_t* emu, void* sortable, int id, void* f, void* data, void* notify) { my->gtk_tree_sortable_set_sort_func(sortable, id, findGtkTreeIterCompareFuncFct(f), data, findGDestroyNotifyFct(notify)); @@ -672,21 +714,6 @@ EXPORT void my3_gtk_tree_sortable_set_default_sort_func(x64emu_t* emu, void* sor my->gtk_tree_sortable_set_default_sort_func(sortable, findGtkTreeIterCompareFuncFct(f), data, findGDestroyNotifyFct(notify)); } -EXPORT int my3_gtk_type_unique(x64emu_t* emu, size_t parent, my_GtkTypeInfo_t* gtkinfo) -{ - return my->gtk_type_unique(parent, findFreeGtkTypeInfo(gtkinfo, parent)); -} - -EXPORT unsigned long my3_gtk_signal_connect(x64emu_t* emu, void* object, void* name, void* func, void* data) -{ - return my3_gtk_signal_connect_full(emu, object, name, func, NULL, data, NULL, 0, 0); -} - -EXPORT void my3_gtk_object_set_data_full(x64emu_t* emu, void* object, void* key, void* data, void* notify) -{ - my->gtk_object_set_data_full(object, key, data, findGDestroyNotifyFct(notify)); -} - EXPORT float my3_gtk_spin_button_get_value_as_float(x64emu_t* emu, void* spinner) { return my->gtk_spin_button_get_value(spinner); @@ -753,7 +780,7 @@ EXPORT void* my3_gtk_tree_store_new(x64emu_t* emu, uint32_t n, uintptr_t* b) return my->gtk_tree_store_newv(n, c); } -EXPORT void my3_gtk_style_context_get_valist(x64emu_t* emu, void* context, int state, x64_va_list_t V) +EXPORT void my3_gtk_style_context_get_valist(x64emu_t* emu, void* context, uint32_t state, x64_va_list_t V) { #ifdef CONVERT_VALIST CONVERT_VALIST(V); @@ -773,6 +800,13 @@ EXPORT void my3_gtk_style_context_get_style_valist(x64emu_t* emu, void* context, my->gtk_style_context_get_style_valist(context, VARARGS); } +EXPORT void my3_gtk_style_context_get_style(x64emu_t* emu, void* context, uintptr_t* b) +{ + CREATE_VALIST_FROM_VAARG(b, emu->scratch, 1); + my->gtk_style_context_get_style_valist(context, VARARGS); +} + + EXPORT void my3_gtk_enumerate_printers(x64emu_t* emu, void* f, void* data, void* d, int i) { my->gtk_enumerate_printers(findGtkPrinterFuncFct(f), data, findGDestroyNotifyFct(d), i); @@ -801,10 +835,11 @@ EXPORT void my3_gtk_style_context_get(x64emu_t* emu, void* context, uint32_t fla EXPORT void my3_gtk_widget_style_get(x64emu_t* emu, void* widget, void* first, uintptr_t* b) { - #ifdef PREFER_CONVERT_VAARG +// #ifdef PREFER_CONVERT_VAARG +#if 1 CREATE_VALIST_FROM_VAARG(b, emu->scratch, 2); my->gtk_widget_style_get_valist(widget, first, VARARGS); - #else +#else // breaks DeltaPatcher void* prop = first; int i=0; do { @@ -812,7 +847,7 @@ EXPORT void my3_gtk_widget_style_get(x64emu_t* emu, void* widget, void* first, u my->gtk_widget_style_get_property(widget, prop, val); prop = (void*)getVArgs(emu, 2, b, i++); } while (prop); - #endif +#endif } EXPORT void my3_gtk_list_store_insert_with_values(x64emu_t* emu, void* list_store, void* iter, int position, uintptr_t* b) @@ -844,10 +879,77 @@ EXPORT void my3_gtk_tree_store_set(x64emu_t* emu, void* tree, void* iter, uintpt my->gtk_tree_store_set_valist(tree, iter, VARARGS); } +EXPORT void my3_gtk_list_box_set_header_func(x64emu_t* emu, void* box, void* f, void* data, void* d) +{ + my->gtk_list_box_set_header_func(box, findGtkListBoxUpdateHeaderFunc(f), data, findGDestroyNotifyFct(d)); +} -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +EXPORT void my3_gtk_tree_model_get(x64emu_t* emu, void* tree_model, void* iter, uintptr_t* b) +{ +// #ifdef PREFER_CONVERT_VAARG +#if 1 + CREATE_VALIST_FROM_VAARG(b, emu->scratch, 2); + my->gtk_tree_model_get_valist(tree_model, iter, VARARGS); +#else + int i = 0; + int col = (int)getVArgs(emu, 2, b, i++); + while (col != -1) { + void* val = (void*)getVArgs(emu, 2, b, i++); + my->gtk_tree_model_get_value(tree_model, iter, col, val); + col = (int)getVArgs(emu, 2, b, i++); + } +#endif +} + +EXPORT void my3_gtk_tree_model_get_valist(x64emu_t* emu, void* tree_model, void* iter, x64_va_list_t V) +{ +#ifdef CONVERT_VALIST + CONVERT_VALIST(V); +#else + CREATE_VALIST_FROM_VALIST(V, emu->scratch); +#endif + my->gtk_tree_model_get_valist(tree_model, iter, VARARGS); +} + +EXPORT void my3_gtk_list_store_set(x64emu_t* emu, void* list_store, void* iter, uintptr_t* b) +{ +// #ifdef PREFER_CONVERT_VAARG +#if 1 + CREATE_VALIST_FROM_VAARG(b, emu->scratch, 2); + my->gtk_list_store_set_valist(list_store, iter, VARARGS); +#else + int i = 0; + int col = (int)getVArgs(emu, 2, b, i++); + while (col != -1) { + void* val = (void*)getVArgs(emu, 2, b, i++); + my->gtk_list_store_set_value(list_store, iter, col, val); + col = (int)getVArgs(emu, 2, b, i++); + } +#endif +} + +EXPORT void my3_gtk_list_store_set_valist(x64emu_t* emu, void* list_store, void* iter, x64_va_list_t V) +{ +#ifdef CONVERT_VALIST + CONVERT_VALIST(V); +#else + CREATE_VALIST_FROM_VALIST(V, emu->scratch); +#endif + my->gtk_list_store_set_valist(list_store, iter, VARARGS); +} + +EXPORT void my3_gtk_widget_class_bind_template_callback_full(x64emu_t* emu, void* widget_class, void* cb_name, void* cb) +{ + my->gtk_widget_class_bind_template_callback_full(widget_class, cb_name, findGCallbackFct(cb)); +} + +EXPORT uint32_t my3_gtk_widget_add_tick_callback(x64emu_t* emu, void* widget, void* callback, void* data, void* d) +{ + return my->gtk_widget_add_tick_callback(widget, findGTickCallbackFct(callback), data, findGDestroyNotifyFct(d)); +} + +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define ALTMY my3_ @@ -858,6 +960,7 @@ EXPORT void my3_gtk_tree_store_set(x64emu_t* emu, void* tree, void* iter, uintpt SetGtkContainer3ID(my->gtk_container_get_type()); \ SetGtkBin3ID(my->gtk_bin_get_type()); \ SetGtkButton3ID(my->gtk_button_get_type()); \ + SetGtkDrawingArea3ID(my->gtk_drawing_area_get_type()); \ SetGtkMenuButton3ID(my->gtk_menu_button_get_type()); \ SetGtkWindow3ID(my->gtk_window_get_type()); \ SetGtkApplicationWindowID(my->gtk_application_window_get_type());\ @@ -874,10 +977,6 @@ EXPORT void my3_gtk_tree_store_set(x64emu_t* emu, void* tree, void* iter, uintpt SetGtkGestureLongPressID(my->gtk_gesture_long_press_get_type());\ SetGtkActionID(my->gtk_action_get_type()); -#ifdef ANDROID -#define NEEDED_LIBS "libgdk-3.so", "libpangocairo-1.0.so", "libgio-2.0.so" -#else -#define NEEDED_LIBS "libgdk-3.so.0", "libpangocairo-1.0.so.0", "libgio-2.0.so.0" -#endif +#define NEEDED_LIBS "libgdk-3.so.0", "libpangocairo-1.0.so.0", "libgio-2.0.so.0", "libcairo.so.2" #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgtk3_private.h b/src/wrapped/wrappedgtk3_private.h index 93ec5ea..f38f8b6 100644 --- a/src/wrapped/wrappedgtk3_private.h +++ b/src/wrapped/wrappedgtk3_private.h @@ -1,5 +1,5 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(gtk_about_dialog_add_credit_section, vFppp) @@ -12,7 +12,6 @@ GO(gtk_about_dialog_get_license, pFp) GO(gtk_about_dialog_get_license_type, uFp) GO(gtk_about_dialog_get_logo, pFp) GO(gtk_about_dialog_get_logo_icon_name, pFp) -GO(gtk_about_dialog_get_name, pFp) GO(gtk_about_dialog_get_program_name, pFp) GO(gtk_about_dialog_get_translator_credits, pFp) GO(gtk_about_dialog_get_type, LFv) @@ -26,149 +25,161 @@ GO(gtk_about_dialog_set_authors, vFpp) GO(gtk_about_dialog_set_comments, vFpp) GO(gtk_about_dialog_set_copyright, vFpp) GO(gtk_about_dialog_set_documenters, vFpp) -//GO(gtk_about_dialog_set_email_hook, GO(gtk_about_dialog_set_license, vFpp) GO(gtk_about_dialog_set_license_type, vFpu) GO(gtk_about_dialog_set_logo, vFpp) GO(gtk_about_dialog_set_logo_icon_name, vFpp) -GO(gtk_about_dialog_set_name, vFpp) GO(gtk_about_dialog_set_program_name, vFpp) GO(gtk_about_dialog_set_translator_credits, vFpp) -//GO(gtk_about_dialog_set_url_hook, GO(gtk_about_dialog_set_version, vFpp) GO(gtk_about_dialog_set_website, vFpp) GO(gtk_about_dialog_set_website_label, vFpp) GO(gtk_about_dialog_set_wrap_license, vFpi) GO(gtk_accelerator_get_default_mod_mask, uFv) GO(gtk_accelerator_get_label, pFuu) -GO(gtk_accelerator_name, pFui) +GO(gtk_accelerator_get_label_with_keycode, pFpuuu) +GO(gtk_accelerator_name, pFuu) +GO(gtk_accelerator_name_with_keycode, pFpuuu) GO(gtk_accelerator_parse, vFppp) +GO(gtk_accelerator_parse_with_keycode, vFpppp) GO(gtk_accelerator_set_default_mod_mask, vFu) GO(gtk_accelerator_valid, iFuu) GO(gtk_accel_flags_get_type, LFv) GO(gtk_accel_group_activate, iFpupuu) -GO(gtk_accel_group_connect, vFpuiip) // Closure probably needs wrapping when not null -GO(gtk_accel_group_connect_by_path, vFppp) -GO(gtk_accel_group_disconnect, iFpp) +GO(gtk_accel_group_connect, vFpuuup) // Closure probably needs wrapping when not null +GO(gtk_accel_group_connect_by_path, vFppp) // Closure probably needs wrapping when not null +GO(gtk_accel_group_disconnect, iFpp) // Closure probably needs wrapping when not null GO(gtk_accel_group_disconnect_key, iFpuu) //GOM(gtk_accel_group_find, pFEppp) GO(gtk_accel_group_from_accel_closure, pFp) -GO(gtk_accel_group_get_is_locked, iFp) +GO(gtk_accel_group_get_is_locked, iFp) // Closure probably needs wrapping when not null GO(gtk_accel_group_get_modifier_mask, uFp) GO(gtk_accel_group_get_type, LFv) GO(gtk_accel_group_lock, vFp) GO(gtk_accel_group_new, pFv) GO(gtk_accel_group_query, pFpuup) -GO(gtk_accel_groups_activate, iFpui) +GO(gtk_accel_groups_activate, iFpuu) GO(gtk_accel_groups_from_object, pFp) GO(gtk_accel_group_unlock, vFp) +GO(gtk_accel_label_get_accel, vFppp) GO(gtk_accel_label_get_accel_widget, pFp) GO(gtk_accel_label_get_accel_width, uFp) GO(gtk_accel_label_get_type, LFv) -//GO(gtk_accel_label_new, +GO(gtk_accel_label_new, pFp) GO(gtk_accel_label_refetch, iFp) -//GO(gtk_accel_label_set_accel_closure, +GO(gtk_accel_label_set_accel, vFpuu) +//GOM(gtk_accel_label_set_accel_closure, vFpp) GO(gtk_accel_label_set_accel_widget, vFpp) GO(gtk_accel_map_add_entry, vFpuu) -//GO(gtk_accel_map_add_filter, +GO(gtk_accel_map_add_filter, vFp) GO(gtk_accel_map_change_entry, iFpuui) -//GO(gtk_accel_map_foreach, -//GO(gtk_accel_map_foreach_unfiltered, +//GOM(gtk_accel_map_foreach, vFpp) +//GOM(gtk_accel_map_foreach_unfiltered, vFpp) GO(gtk_accel_map_get, pFv) GO(gtk_accel_map_get_type, LFv) -//GO(gtk_accel_map_load, -//GO(gtk_accel_map_load_fd, -//GO(gtk_accel_map_load_scanner, -//GO(gtk_accel_map_lock_path, +GO(gtk_accel_map_load, vFp) +GO(gtk_accel_map_load_fd, vFi) +//GOM(gtk_accel_map_load_scanner, vFp) +GO(gtk_accel_map_lock_path, vFp) GO(gtk_accel_map_lookup_entry, iFpp) -//GO(gtk_accel_map_save, +GO(gtk_accel_map_save, vFp) GO(gtk_accel_map_save_fd, vFi) -//GO(gtk_accel_map_unlock_path, -//GO(gtk_accessible_connect_widget_destroyed, +GO(gtk_accel_map_unlock_path, vFp) +GO(gtk_accessible_connect_widget_destroyed, vFp) GO(gtk_accessible_get_type, LFv) GO(gtk_accessible_get_widget, pFp) GO(gtk_accessible_set_widget, vFpp) +GO(gtk_actionable_get_action_name, pFp) +GO(gtk_actionable_get_action_target_value, pFp) GO(gtk_actionable_get_type, LFv) -//GO(gtk_action_activate, +GO(gtk_actionable_set_action_name, vFpp) +//GOM(gtk_actionable_set_action_target, vFppV) +GO(gtk_actionable_set_action_target_value, vFpp) +GO(gtk_actionable_set_detailed_action_name, vFpp) +GO(gtk_action_activate, vFp) +GO(gtk_action_bar_get_center_widget, pFp) GO(gtk_action_bar_get_type, LFv) -//GO(gtk_action_block_activate, -//GO(gtk_action_block_activate_from, -//GO(gtk_action_connect_accelerator, -//GO(gtk_action_connect_proxy, +GO(gtk_action_bar_new, pFv) +GO(gtk_action_bar_pack_end, vFpp) +GO(gtk_action_bar_pack_start, vFpp) +GO(gtk_action_bar_set_center_widget, vFpp) +GO(gtk_action_block_activate, vFp) +GO(gtk_action_connect_accelerator, vFp) GO(gtk_action_create_icon, pFpu) GO(gtk_action_create_menu, pFp) -//GO(gtk_action_create_menu_item, -//GO(gtk_action_create_tool_item, -//GO(gtk_action_disconnect_accelerator, -//GO(gtk_action_disconnect_proxy, -//GO(gtk_action_get_accel_closure, -//GO(gtk_action_get_accel_path, +GO(gtk_action_create_menu_item, pFp) +GO(gtk_action_create_tool_item, pFp) +GO(gtk_action_disconnect_accelerator, vFp) +//GOM(gtk_action_get_accel_closure, pFp) +GO(gtk_action_get_accel_path, pFp) GO(gtk_action_get_always_show_image, iFp) GO(gtk_action_get_gicon, pFp) GO(gtk_action_get_icon_name, pFp) -//GO(gtk_action_get_is_important, -//GO(gtk_action_get_label, -//GO(gtk_action_get_name, +GO(gtk_action_get_is_important, iFp) +GO(gtk_action_get_label, pFp) +GO(gtk_action_get_name, pFp) GO(gtk_action_get_proxies, pFp) -//GO(gtk_action_get_sensitive, -//GO(gtk_action_get_short_label, -//GO(gtk_action_get_stock_id, -//GO(gtk_action_get_tooltip, +GO(gtk_action_get_sensitive, iFp) +GO(gtk_action_get_short_label, pFp) +GO(gtk_action_get_stock_id, pFp) +GO(gtk_action_get_tooltip, pFp) GO(gtk_action_get_type, LFv) -//GO(gtk_action_get_visible, -//GO(gtk_action_get_visible_horizontal, -//GO(gtk_action_get_visible_vertical, -//GO(gtk_action_group_add_action, -//GO(gtk_action_group_add_actions, -//GO(gtk_action_group_add_actions_full, +GO(gtk_action_get_visible, iFp) +GO(gtk_action_get_visible_horizontal, iFp) +GO(gtk_action_get_visible_vertical, iFp) +GO(gtk_action_group_add_action, vFpp) +//GOM(gtk_action_group_add_actions, vFppup) +//GOM(gtk_action_group_add_actions_full, vFppupp) GO(gtk_action_group_add_action_with_accel, vFppp) -//GO(gtk_action_group_add_radio_actions, -//GO(gtk_action_group_add_radio_actions_full, -//GO(gtk_action_group_add_toggle_actions, -//GO(gtk_action_group_add_toggle_actions_full, +//GOM(gtk_action_group_add_radio_actions, vFppuipp) +//GOM(gtk_action_group_add_radio_actions_full, vFppuippp) +//GOM(gtk_action_group_add_toggle_actions, vFppup) +//GOM(gtk_action_group_add_toggle_actions_full, vFppupp) +GO(gtk_action_group_get_accel_group, pFp) GO(gtk_action_group_get_action, pFpp) GO(gtk_action_group_get_name, pFp) -//GO(gtk_action_group_get_sensitive, +GO(gtk_action_group_get_sensitive, iFp) GO(gtk_action_group_get_type, LFv) GO(gtk_action_group_get_visible, iFp) GO(gtk_action_group_list_actions, pFp) GO(gtk_action_group_new, pFp) -//GO(gtk_action_group_remove_action, -//GO(gtk_action_group_set_sensitive, -//GO(gtk_action_group_set_translate_func, +GO(gtk_action_group_remove_action, vFpp) +GO(gtk_action_group_set_accel_group, vFpp) +GO(gtk_action_group_set_sensitive, vFpi) +//GOM(gtk_action_group_set_translate_func, vFpppp) GO(gtk_action_group_set_translation_domain, vFpp) GO(gtk_action_group_set_visible, vFpi) GO(gtk_action_group_translate_string, pFpp) -//GO(gtk_action_is_sensitive, -//GO(gtk_action_is_visible, -//GO(gtk_action_new, +GO(gtk_action_is_sensitive, iFp) +GO(gtk_action_is_visible, iFp) +GO(gtk_action_new, pFpppp) GO(gtk_action_set_accel_group, vFpp) -//GO(gtk_action_set_accel_path, +GO(gtk_action_set_accel_path, vFpp) GO(gtk_action_set_always_show_image, vFpi) GO(gtk_action_set_gicon, vFpp) GO(gtk_action_set_icon_name, vFpp) -//GO(gtk_action_set_is_important, -//GO(gtk_action_set_label, -//GO(gtk_action_set_sensitive, -//GO(gtk_action_set_short_label, -//GO(gtk_action_set_stock_id, -//GO(gtk_action_set_tooltip, -//GO(gtk_action_set_visible, -//GO(gtk_action_set_visible_horizontal, -//GO(gtk_action_set_visible_vertical, -//GO(gtk_action_unblock_activate, -//GO(gtk_action_unblock_activate_from, +GO(gtk_action_set_is_important, vFpi) +GO(gtk_action_set_label, vFpp) +GO(gtk_action_set_sensitive, vFpi) +GO(gtk_action_set_short_label, vFpp) +GO(gtk_action_set_stock_id, vFpp) +GO(gtk_action_set_tooltip, vFpp) +GO(gtk_action_set_visible, vFpi) +GO(gtk_action_set_visible_horizontal, vFpi) +GO(gtk_action_set_visible_vertical, vFpi) +GO(gtk_action_unblock_activate, vFp) GO(gtk_activatable_do_set_related_action, vFpp) GO(gtk_activatable_get_related_action, pFp) GO(gtk_activatable_get_type, LFv) GO(gtk_activatable_get_use_action_appearance, iFp) -//GO(gtk_activatable_set_related_action, +GO(gtk_activatable_set_related_action, vFpp) GO(gtk_activatable_set_use_action_appearance, vFpi) -//GO(gtk_activatable_sync_action_properties, +GO(gtk_activatable_sync_action_properties, vFpp) GO(gtk_adjustment_changed, vFp) GO(gtk_adjustment_clamp_page, vFpdd) GO(gtk_adjustment_configure, vFpdddddd) GO(gtk_adjustment_get_lower, dFp) +GO(gtk_adjustment_get_minimum_increment, dFp) GO(gtk_adjustment_get_page_increment, dFp) GO(gtk_adjustment_get_page_size, dFp) GO(gtk_adjustment_get_step_increment, dFp) @@ -177,32 +188,85 @@ GO(gtk_adjustment_get_upper, dFp) GO(gtk_adjustment_get_value, dFp) GO(gtk_adjustment_new, pFdddddd) GO(gtk_adjustment_set_lower, vFpd) -GO(gtk_adjustment_set_page_increment, vFp) +GO(gtk_adjustment_set_page_increment, vFpd) GO(gtk_adjustment_set_page_size, vFpd) GO(gtk_adjustment_set_step_increment, vFpd) GO(gtk_adjustment_set_upper, vFpd) GO(gtk_adjustment_set_value, vFpd) GO(gtk_adjustment_value_changed, vFp) +GO(gtk_align_get_type, LFv) GO(gtk_alignment_get_padding, vFppppp) GO(gtk_alignment_get_type, LFv) GO(gtk_alignment_new, pFffff) GO(gtk_alignment_set, vFpffff) GO(gtk_alignment_set_padding, vFpuuuu) -GO(gtk_align_get_type, LFv) GO(gtk_alternative_dialog_button_order, iFp) -GO(gtk_anchor_type_get_type, LFv) +GO(gtk_app_chooser_button_append_custom_item, vFpppp) +GO(gtk_app_chooser_button_append_separator, vFp) +GO(gtk_app_chooser_button_get_heading, pFp) +GO(gtk_app_chooser_button_get_show_default_item, iFp) +GO(gtk_app_chooser_button_get_show_dialog_item, iFp) +GO(gtk_app_chooser_button_get_type, LFv) +GO(gtk_app_chooser_button_new, pFp) +GO(gtk_app_chooser_button_set_active_custom_item, vFpp) +GO(gtk_app_chooser_button_set_heading, vFpp) +GO(gtk_app_chooser_button_set_show_default_item, vFpi) +GO(gtk_app_chooser_button_set_show_dialog_item, vFpi) +GO(gtk_app_chooser_dialog_get_heading, pFp) +GO(gtk_app_chooser_dialog_get_type, LFv) +GO(gtk_app_chooser_dialog_get_widget, pFp) +GO(gtk_app_chooser_dialog_new, pFpup) +GO(gtk_app_chooser_dialog_new_for_content_type, pFpup) +GO(gtk_app_chooser_dialog_set_heading, vFpp) +GO(gtk_app_chooser_get_app_info, pFp) +GO(gtk_app_chooser_get_content_type, pFp) +GO(gtk_app_chooser_get_type, LFv) +GO(gtk_app_chooser_refresh, vFp) +GO(gtk_app_chooser_widget_get_default_text, pFp) +GO(gtk_app_chooser_widget_get_show_all, iFp) +GO(gtk_app_chooser_widget_get_show_default, iFp) +GO(gtk_app_chooser_widget_get_show_fallback, iFp) +GO(gtk_app_chooser_widget_get_show_other, iFp) +GO(gtk_app_chooser_widget_get_show_recommended, iFp) +GO(gtk_app_chooser_widget_get_type, LFv) +GO(gtk_app_chooser_widget_new, pFp) +GO(gtk_app_chooser_widget_set_default_text, vFpp) +GO(gtk_app_chooser_widget_set_show_all, vFpi) +GO(gtk_app_chooser_widget_set_show_default, vFpi) +GO(gtk_app_chooser_widget_set_show_fallback, vFpi) +GO(gtk_app_chooser_widget_set_show_other, vFpi) +GO(gtk_app_chooser_widget_set_show_recommended, vFpi) +GO(gtk_application_add_accelerator, vFpppp) GO(gtk_application_add_window, vFpp) -GO(gtk_application_get_new, pFpi) +GO(gtk_application_get_accels_for_action, pFpp) +GO(gtk_application_get_actions_for_accel, pFpp) +GO(gtk_application_get_active_window, pFp) +GO(gtk_application_get_app_menu, pFp) +GO(gtk_application_get_menubar, pFp) +GO(gtk_application_get_menu_by_id, pFpp) GO(gtk_application_get_type, LFv) +GO(gtk_application_get_window_by_id, pFpu) +GO(gtk_application_get_windows, pFp) +GO(gtk_application_inhibit, uFppup) +GO(gtk_application_inhibit_flags_get_type, LFv) +GO(gtk_application_is_inhibited, iFpu) +GO(gtk_application_list_action_descriptions, pFp) GO(gtk_application_new, pFpu) +GO(gtk_application_prefers_app_menu, iFp) +GO(gtk_application_remove_accelerator, vFppp) +GO(gtk_application_remove_window, vFpp) GO(gtk_application_set_accels_for_action, vFppp) -GO(gtk_application_window_new, pFp) +GO(gtk_application_set_app_menu, vFpp) +GO(gtk_application_set_menubar, vFpp) +GO(gtk_application_uninhibit, vFpu) +GO(gtk_application_window_get_help_overlay, pFp) +GO(gtk_application_window_get_id, uFp) +GO(gtk_application_window_get_show_menubar, iFp) GO(gtk_application_window_get_type, LFv) -GO(gtk_app_chooser_button_get_type, LFv) -GO(gtk_app_chooser_dialog_get_type, LFv) -GO(gtk_app_chooser_get_type, LFv) -GO(gtk_app_chooser_widget_get_type, LFv) -GO(gtk_arg_flags_get_type, LFv) +GO(gtk_application_window_new, pFp) +GO(gtk_application_window_set_help_overlay, vFpp) +GO(gtk_application_window_set_show_menubar, vFpi) +GO(gtk_arrow_accessible_get_type, LFv) GO(gtk_arrow_get_type, LFv) GO(gtk_arrow_new, pFuu) GO(gtk_arrow_placement_get_type, LFv) @@ -211,61 +275,70 @@ GO(gtk_arrow_type_get_type, LFv) GO(gtk_aspect_frame_get_type, LFv) GO(gtk_aspect_frame_new, pFpfffi) GO(gtk_aspect_frame_set, vFpfffi) -//GO(gtk_assistant_add_action_widget, +GO(gtk_assistant_add_action_widget, vFpp) GO(gtk_assistant_append_page, iFpp) -//GO(gtk_assistant_commit, -//GO(gtk_assistant_get_current_page, +GO(gtk_assistant_commit, vFp) +GO(gtk_assistant_get_current_page, iFp) GO(gtk_assistant_get_n_pages, iFp) GO(gtk_assistant_get_nth_page, pFpi) -//GO(gtk_assistant_get_page_complete, -//GO(gtk_assistant_get_page_header_image, +GO(gtk_assistant_get_page_complete, iFpp) +GO(gtk_assistant_get_page_has_padding, iFpp) +GO(gtk_assistant_get_page_header_image, pFpp) GO(gtk_assistant_get_page_side_image, pFpp) GO(gtk_assistant_get_page_title, pFpp) GO(gtk_assistant_get_page_type, uFpp) GO(gtk_assistant_get_type, LFv) GO(gtk_assistant_insert_page, iFppi) -//GO(gtk_assistant_new, +GO(gtk_assistant_new, pFv) +GO(gtk_assistant_next_page, vFp) GO(gtk_assistant_page_type_get_type, LFv) -//GO(gtk_assistant_prepend_page, +GO(gtk_assistant_prepend_page, iFpp) +GO(gtk_assistant_previous_page, vFp) GO(gtk_assistant_remove_action_widget, vFpp) -//GO(gtk_assistant_set_current_page, -//GO(gtk_assistant_set_forward_page_func, -//GO(gtk_assistant_set_page_complete, -//GO(gtk_assistant_set_page_header_image, +GO(gtk_assistant_remove_page, vFpi) +GO(gtk_assistant_set_current_page, vFpi) +//GOM(gtk_assistant_set_forward_page_func, vFpppp) +GO(gtk_assistant_set_page_complete, vFppi) +GO(gtk_assistant_set_page_has_padding, vFppi) +GO(gtk_assistant_set_page_header_image, vFppp) GO(gtk_assistant_set_page_side_image, vFppp) GO(gtk_assistant_set_page_title, vFppp) GO(gtk_assistant_set_page_type, vFppu) -//GO(gtk_assistant_update_buttons_state, +GO(gtk_assistant_update_buttons_state, vFp) GO(gtk_attach_options_get_type, LFv) -//GO(gtk_binding_entry_add_signal, +GO(gtk_baseline_position_get_type, LFv) +//GOM(gtk_binding_entry_add_signal, vFpuupuV) +GO(gtk_binding_entry_add_signal_from_string, uFpp) GO(gtk_binding_entry_add_signall, vFpuupp) -//GO(gtk_binding_entry_clear, GO(gtk_binding_entry_remove, vFpuu) -//GO(gtk_binding_entry_skip, -//GO(gtk_binding_parse_binding, +GO(gtk_binding_entry_skip, vFpuu) GO(gtk_bindings_activate, iFpuu) GO(gtk_bindings_activate_event, iFpp) GO(gtk_binding_set_activate, iFpuup) GO(gtk_binding_set_add_path, vFpupu) GO(gtk_binding_set_by_class, pFp) GO(gtk_binding_set_find, pFp) -//GO(gtk_binding_set_new, +GO(gtk_binding_set_new, pFp) GO(gtk_bin_get_child, pFp) GO(gtk_bin_get_type, LFv) +GO(gtk_boolean_cell_accessible_get_type, LFv) GO(gtk_border_copy, pFp) GO(gtk_border_free, vFp) GO(gtk_border_get_type, LFv) GO(gtk_border_new, pFv) +GO(gtk_border_style_get_type, LFv) +GO(gtk_box_get_baseline_position, uFp) +GO(gtk_box_get_center_widget, pFp) GO(gtk_box_get_homogeneous, iFp) GO(gtk_box_get_spacing, iFp) GO(gtk_box_get_type, LFv) GO(gtk_box_new, pFui) GO(gtk_box_pack_end, vFppiiu) -GO(gtk_box_pack_end_defaults, vFpp) GO(gtk_box_pack_start, vFppiiu) -GO(gtk_box_pack_start_defaults, vFpp) GO(gtk_box_query_child_packing, vFpppppp) GO(gtk_box_reorder_child, vFppi) +GO(gtk_box_set_baseline_position, vFpu) +GO(gtk_box_set_center_widget, vFpp) GO(gtk_box_set_child_packing, vFppiiuu) GO(gtk_box_set_homogeneous, vFpi) GO(gtk_box_set_spacing, vFpi) @@ -273,46 +346,56 @@ GO(gtk_buildable_add_child, vFpppp) GO(gtk_buildable_construct_child, pFppp) GO(gtk_buildable_custom_finished, vFppppp) GO(gtk_buildable_custom_tag_end, vFppppp) -GO(gtk_buildable_custom_tag_start, iFpppppp) +GO(gtk_buildable_custom_tag_start, iFpppppp) // Something to wrap? GO(gtk_buildable_get_internal_child, pFppp) GO(gtk_buildable_get_name, pFp) GO(gtk_buildable_get_type, LFv) GO(gtk_buildable_parser_finished, vFpp) GO(gtk_buildable_set_buildable_property, vFpppp) GO(gtk_buildable_set_name, vFpp) +//GOM(gtk_builder_add_callback_symbol, vFppp) +//GOM(gtk_builder_add_callback_symbols, vFpppV) GO(gtk_builder_add_from_file, uFppp) GO(gtk_builder_add_from_resource, uFppp) GO(gtk_builder_add_from_string, uFppLp) GO(gtk_builder_add_objects_from_file, uFpppp) +GO(gtk_builder_add_objects_from_resource, uFpppp) GO(gtk_builder_add_objects_from_string, uFppLpp) GOM(gtk_builder_connect_signals, vFEpp) GOM(gtk_builder_connect_signals_full, vFEppp) GO(gtk_builder_error_get_type, LFv) -GO(gtk_builder_error_quark, pFv) +GO(gtk_builder_error_quark, uFv) +GO(gtk_builder_expose_object, vFppp) +GO(gtk_builder_extend_with_template, uFppLpLp) +GO(gtk_builder_get_application, pFp) GO(gtk_builder_get_object, pFpp) GO(gtk_builder_get_objects, pFp) GO(gtk_builder_get_translation_domain, pFp) GO(gtk_builder_get_type, LFv) GO(gtk_builder_get_type_from_name, LFpp) +//GOM(gtk_builder_lookup_callback_symbol, pFpp) GO(gtk_builder_new, pFv) +GO(gtk_builder_new_from_file, pFp) +GO(gtk_builder_new_from_resource, pFp) +GO(gtk_builder_new_from_string, pFpl) +GO(gtk_builder_set_application, vFpp) GO(gtk_builder_set_translation_domain, vFpp) GO(gtk_builder_value_from_string, iFppppp) GO(gtk_builder_value_from_string_type, iFpLppp) -GO(gtk_button_action_get_type, LFv) -GO(gtk_button_box_get_child_ipadding, vFppp) +GO(gtk_button_accessible_get_type, LFv) +GO(gtk_button_box_get_child_non_homogeneous, iFpp) GO(gtk_button_box_get_child_secondary, iFpp) -GO(gtk_button_box_get_child_size, vFppp) GO(gtk_button_box_get_layout, uFp) GO(gtk_button_box_get_type, LFv) -GO(gtk_button_box_new, pFi) -GO(gtk_button_box_set_child_ipadding, vFpii) +GO(gtk_button_box_new, pFu) +GO(gtk_button_box_set_child_non_homogeneous, vFppi) GO(gtk_button_box_set_child_secondary, vFppi) -GO(gtk_button_box_set_child_size, vFpii) GO(gtk_button_box_set_layout, vFpu) GO(gtk_button_box_style_get_type, LFv) -//GO(gtk_button_clicked, -//GO(gtk_button_enter, +GO(gtk_button_clicked, vFp) +GO(gtk_button_enter, vFp) GO(gtk_button_get_alignment, vFppp) +GO(gtk_button_get_always_show_image, iFp) GO(gtk_button_get_event_window, pFp) GO(gtk_button_get_focus_on_click, iFp) GO(gtk_button_get_image, pFp) @@ -324,11 +407,13 @@ GO(gtk_button_get_use_stock, iFp) GO(gtk_button_get_use_underline, iFp) GO(gtk_button_leave, vFp) GO(gtk_button_new, pFv) +GO(gtk_button_new_from_icon_name, pFpu) GO(gtk_button_new_from_stock, pFp) GO(gtk_button_new_with_label, pFp) GO(gtk_button_new_with_mnemonic, pFp) GO(gtk_button_pressed, vFp) GO(gtk_button_released, vFp) +GO(gtk_button_role_get_type, LFv) GO(gtk_button_set_alignment, vFpff) GO(gtk_button_set_always_show_image, vFpi) GO(gtk_button_set_focus_on_click, vFpi) @@ -340,32 +425,111 @@ GO(gtk_button_set_use_stock, vFpi) GO(gtk_button_set_use_underline, vFpi) GO(gtk_buttons_type_get_type, LFv) GO(gtk_cairo_should_draw_window, iFpp) -//GO(gtk_calendar_clear_marks, -//GO(gtk_calendar_display_options, +GO(gtk_cairo_transform_to_window, vFppp) +GO(gtk_calendar_clear_marks, vFp) GO(gtk_calendar_display_options_get_type, LFv) -//GO(gtk_calendar_freeze, GO(gtk_calendar_get_date, vFpppp) +GO(gtk_calendar_get_day_is_marked, iFpu) GO(gtk_calendar_get_detail_height_rows, iFp) -//GO(gtk_calendar_get_detail_width_chars, +GO(gtk_calendar_get_detail_width_chars, iFp) GO(gtk_calendar_get_display_options, uFp) GO(gtk_calendar_get_type, LFv) -//GO(gtk_calendar_mark_day, -//GO(gtk_calendar_new, -//GO(gtk_calendar_select_day, +GO(gtk_calendar_mark_day, vFpu) +GO(gtk_calendar_new, pFv) +GO(gtk_calendar_select_day, vFpu) GO(gtk_calendar_select_month, vFpuu) -//GO(gtk_calendar_set_detail_func, +//GOM(gtk_calendar_set_detail_func, vFpppp) GO(gtk_calendar_set_detail_height_rows, vFpi) -//GO(gtk_calendar_set_detail_width_chars, +GO(gtk_calendar_set_detail_width_chars, vFpi) GO(gtk_calendar_set_display_options, vFpu) -//GO(gtk_calendar_thaw, GO(gtk_calendar_unmark_day, vFpu) -//GO(gtk_cell_editable_editing_done, +GO(gtk_cell_accessible_get_type, LFv) +GO(gtk_cell_accessible_parent_activate, vFpp) +GO(gtk_cell_accessible_parent_edit, vFpp) +GO(gtk_cell_accessible_parent_expand_collapse, vFpp) +GO(gtk_cell_accessible_parent_get_cell_area, vFppp) +GO(gtk_cell_accessible_parent_get_cell_extents, vFppppppu) +GO(gtk_cell_accessible_parent_get_cell_position, vFpppp) +GO(gtk_cell_accessible_parent_get_child_index, iFpp) +GO(gtk_cell_accessible_parent_get_column_header_cells, pFpp) +GO(gtk_cell_accessible_parent_get_renderer_state, uFpp) +GO(gtk_cell_accessible_parent_get_row_header_cells, pFpp) +GO(gtk_cell_accessible_parent_get_type, LFv) +GO(gtk_cell_accessible_parent_grab_focus, iFpp) +GO(gtk_cell_accessible_parent_update_relationset, vFppp) +GO(gtk_cell_area_activate, iFppppui) +GO(gtk_cell_area_activate_cell, iFpppppu) +GO(gtk_cell_area_add, vFpp) +GO(gtk_cell_area_add_focus_sibling, vFppp) +//GOM(gtk_cell_area_add_with_properties, vFpppV) +GO(gtk_cell_area_apply_attributes, vFpppii) +GO(gtk_cell_area_attribute_connect, vFpppi) +GO(gtk_cell_area_attribute_disconnect, vFppp) +GO(gtk_cell_area_attribute_get_column, iFppp) +GO(gtk_cell_area_box_get_spacing, iFp) +GO(gtk_cell_area_box_get_type, LFv) +GO(gtk_cell_area_box_new, pFv) +GO(gtk_cell_area_box_pack_end, vFppiii) +GO(gtk_cell_area_box_pack_start, vFppiii) +GO(gtk_cell_area_box_set_spacing, vFpi) +//GOM(gtk_cell_area_cell_get, vFpppV) +GO(gtk_cell_area_cell_get_property, vFpppp) +//GOM(gtk_cell_area_cell_get_valist, vFpppA) +//GOM(gtk_cell_area_cell_set, vFpppV) +GO(gtk_cell_area_cell_set_property, vFpppp) +//GOM(gtk_cell_area_cell_set_valist, vFpppA) +//GOM(gtk_cell_area_class_find_cell_property, pFpp) +//GOM(gtk_cell_area_class_install_cell_property, vFpup) +//GOM(gtk_cell_area_class_list_cell_properties, pFpp) +GO(gtk_cell_area_context_allocate, vFpii) +GO(gtk_cell_area_context_get_allocation, vFppp) +GO(gtk_cell_area_context_get_area, pFp) +GO(gtk_cell_area_context_get_preferred_height, vFppp) +GO(gtk_cell_area_context_get_preferred_height_for_width, vFpipp) +GO(gtk_cell_area_context_get_preferred_width, vFppp) +GO(gtk_cell_area_context_get_preferred_width_for_height, vFpipp) +GO(gtk_cell_area_context_get_type, LFv) +GO(gtk_cell_area_context_push_preferred_height, vFpii) +GO(gtk_cell_area_context_push_preferred_width, vFpii) +GO(gtk_cell_area_context_reset, vFp) +GO(gtk_cell_area_copy_context, pFpp) +GO(gtk_cell_area_create_context, pFp) +GO(gtk_cell_area_event, iFpppppu) +GO(gtk_cell_area_focus, iFpu) +//GOM(gtk_cell_area_foreach, vFppp) +//GOM(gtk_cell_area_foreach_alloc, vFppppppp) +GO(gtk_cell_area_get_cell_allocation, vFpppppp) +GO(gtk_cell_area_get_cell_at_position, pFppppiip) +GO(gtk_cell_area_get_current_path_string, pFp) +GO(gtk_cell_area_get_edited_cell, pFp) +GO(gtk_cell_area_get_edit_widget, pFp) +GO(gtk_cell_area_get_focus_cell, pFp) +GO(gtk_cell_area_get_focus_from_sibling, pFpp) +GO(gtk_cell_area_get_focus_siblings, pFpp) +GO(gtk_cell_area_get_preferred_height, vFppppp) +GO(gtk_cell_area_get_preferred_height_for_width, vFpppipp) +GO(gtk_cell_area_get_preferred_width, vFppppp) +GO(gtk_cell_area_get_preferred_width_for_height, vFpppipp) +GO(gtk_cell_area_get_request_mode, uFp) +GO(gtk_cell_area_get_type, LFv) +GO(gtk_cell_area_has_renderer, iFpp) +GO(gtk_cell_area_inner_cell_area, vFpppp) +GO(gtk_cell_area_is_activatable, iFp) +GO(gtk_cell_area_is_focus_sibling, iFppp) +GO(gtk_cell_area_remove, vFpp) +GO(gtk_cell_area_remove_focus_sibling, vFppp) +GO(gtk_cell_area_render, vFppppppui) +GO(gtk_cell_area_request_renderer, vFppupipp) +GO(gtk_cell_area_set_focus_cell, vFpp) +GO(gtk_cell_area_stop_editing, vFpi) +GO(gtk_cell_editable_editing_done, vFp) GO(gtk_cell_editable_get_type, LFv) -//GO(gtk_cell_editable_remove_widget, +GO(gtk_cell_editable_remove_widget, vFp) GO(gtk_cell_editable_start_editing, vFpp) GO(gtk_cell_layout_add_attribute, vFpppi) GO(gtk_cell_layout_clear, vFp) GO(gtk_cell_layout_clear_attributes, vFpp) +GO(gtk_cell_layout_get_area, pFp) GO(gtk_cell_layout_get_cells, pFp) GO(gtk_cell_layout_get_type, LFv) GO(gtk_cell_layout_pack_end, vFppi) @@ -375,33 +539,44 @@ GO(gtk_cell_layout_set_attributes, vFpppppppppp) // vaarg //GOM(gtk_cell_layout_set_cell_data_func, vFEppppp) GO(gtk_cell_renderer_accel_get_type, LFv) GO(gtk_cell_renderer_accel_mode_get_type, LFv) -//GO(gtk_cell_renderer_accel_new, +GO(gtk_cell_renderer_accel_new, pFv) GO(gtk_cell_renderer_activate, iFppppppu) +//GOM(gtk_cell_renderer_class_set_accessible_type, vFpL) GO(gtk_cell_renderer_combo_get_type, LFv) -//GO(gtk_cell_renderer_combo_new, -//GO(gtk_cell_renderer_editing_canceled, +GO(gtk_cell_renderer_combo_new, pFv) +GO(gtk_cell_renderer_get_aligned_area, vFppupp) GO(gtk_cell_renderer_get_alignment, vFppp) -//GO(gtk_cell_renderer_get_fixed_size, +GO(gtk_cell_renderer_get_fixed_size, vFppp) GO(gtk_cell_renderer_get_padding, vFppp) -//GO(gtk_cell_renderer_get_sensitive, +GO(gtk_cell_renderer_get_preferred_height, vFpppp) +GO(gtk_cell_renderer_get_preferred_height_for_width, vFppipp) +GO(gtk_cell_renderer_get_preferred_size, vFpppp) +GO(gtk_cell_renderer_get_preferred_width, vFpppp) +GO(gtk_cell_renderer_get_preferred_width_for_height, vFppipp) +GO(gtk_cell_renderer_get_request_mode, uFp) +GO(gtk_cell_renderer_get_sensitive, iFp) GO(gtk_cell_renderer_get_size, vFppppppp) +GO(gtk_cell_renderer_get_state, uFppu) GO(gtk_cell_renderer_get_type, LFv) -//GO(gtk_cell_renderer_get_visible, +GO(gtk_cell_renderer_get_visible, iFp) +//GO(gtk_cell_renderer_graph_get_type, +//GO(gtk_cell_renderer_graph_new, +GO(gtk_cell_renderer_is_activatable, iFp) GO(gtk_cell_renderer_mode_get_type, LFv) GO(gtk_cell_renderer_pixbuf_get_type, LFv) GO(gtk_cell_renderer_pixbuf_new, pFv) GO(gtk_cell_renderer_progress_get_type, LFv) -//GO(gtk_cell_renderer_progress_new, +GO(gtk_cell_renderer_progress_new, pFv) GO(gtk_cell_renderer_render, vFpppppu) GO(gtk_cell_renderer_set_alignment, vFpff) -//GO(gtk_cell_renderer_set_fixed_size, +GO(gtk_cell_renderer_set_fixed_size, vFpii) GO(gtk_cell_renderer_set_padding, vFpii) -//GO(gtk_cell_renderer_set_sensitive, -//GO(gtk_cell_renderer_set_visible, +GO(gtk_cell_renderer_set_sensitive, vFpi) +GO(gtk_cell_renderer_set_visible, vFpi) GO(gtk_cell_renderer_spin_get_type, LFv) GO(gtk_cell_renderer_spinner_get_type, LFv) -//GO(gtk_cell_renderer_spinner_new, -//GO(gtk_cell_renderer_spin_new, +GO(gtk_cell_renderer_spinner_new, pFv) +GO(gtk_cell_renderer_spin_new, pFv) GO(gtk_cell_renderer_start_editing, pFppppppu) GO(gtk_cell_renderer_state_get_type, LFv) GO(gtk_cell_renderer_stop_editing, vFpi) @@ -416,23 +591,28 @@ GO(gtk_cell_renderer_toggle_new, pFv) GO(gtk_cell_renderer_toggle_set_activatable, vFpi) GO(gtk_cell_renderer_toggle_set_active, vFpi) GO(gtk_cell_renderer_toggle_set_radio, vFpi) -GO(gtk_cell_type_get_type, LFv) -//GO(gtk_cell_view_get_cell_renderers, GO(gtk_cell_view_get_displayed_row, pFp) +GO(gtk_cell_view_get_draw_sensitive, iFp) +GO(gtk_cell_view_get_fit_model, iFp) GO(gtk_cell_view_get_model, pFp) GO(gtk_cell_view_get_size_of_row, iFppp) GO(gtk_cell_view_get_type, LFv) -//GO(gtk_cell_view_new, -//GO(gtk_cell_view_new_with_markup, +GO(gtk_cell_view_new, pFv) +GO(gtk_cell_view_new_with_context, pFpp) +GO(gtk_cell_view_new_with_markup, pFp) GO(gtk_cell_view_new_with_pixbuf, pFp) -//GO(gtk_cell_view_new_with_text, +GO(gtk_cell_view_new_with_text, pFp) GO(gtk_cell_view_set_background_color, vFpp) +GO(gtk_cell_view_set_background_rgba, vFpp) GO(gtk_cell_view_set_displayed_row, vFpp) +GO(gtk_cell_view_set_draw_sensitive, vFpi) +GO(gtk_cell_view_set_fit_model, vFpi) GO(gtk_cell_view_set_model, vFpp) GO(gtk_check_button_get_type, LFv) GO(gtk_check_button_new, pFv) GO(gtk_check_button_new_with_label, pFp) GO(gtk_check_button_new_with_mnemonic, pFp) +GO(gtk_check_menu_item_accessible_get_type, LFv) GO(gtk_check_menu_item_get_active, iFp) GO(gtk_check_menu_item_get_draw_as_radio, iFp) GO(gtk_check_menu_item_get_inconsistent, iFp) @@ -443,7 +623,6 @@ GO(gtk_check_menu_item_new_with_mnemonic, pFp) GO(gtk_check_menu_item_set_active, vFpi) GO(gtk_check_menu_item_set_draw_as_radio, vFpi) GO(gtk_check_menu_item_set_inconsistent, vFpi) -GO(gtk_check_menu_item_set_show_toggle, vFpi) GO(gtk_check_menu_item_toggled, vFp) GO(gtk_check_version, pFuuu) GO(gtk_clipboard_clear, vFp) @@ -452,6 +631,7 @@ GO(gtk_clipboard_get_default, pFp) GO(gtk_clipboard_get_display, pFp) GO(gtk_clipboard_get_for_display, pFpp) GO(gtk_clipboard_get_owner, pFp) +GO(gtk_clipboard_get_selection, pFp) GO(gtk_clipboard_get_type, LFv) //GOM(gtk_clipboard_request_contents, vFEpppp) //GOM(gtk_clipboard_request_image, vFEppp) @@ -476,83 +656,9 @@ GO(gtk_clipboard_wait_is_rich_text_available, iFpp) GO(gtk_clipboard_wait_is_target_available, iFpp) GO(gtk_clipboard_wait_is_text_available, iFp) GO(gtk_clipboard_wait_is_uris_available, iFp) -GO(gtk_clist_append, iFpp) -GO(gtk_clist_clear, vFp) -GO(gtk_clist_columns_autosize, iFp) -GO(gtk_clist_column_title_active, vFpi) -GO(gtk_clist_column_title_passive, vFpi) -GO(gtk_clist_column_titles_active, vFp) -GO(gtk_clist_column_titles_hide, vFp) -GO(gtk_clist_column_titles_passive, vFp) -GO(gtk_clist_column_titles_show, vFp) -GO(gtk_clist_drag_pos_get_type, LFv) -GO(gtk_clist_find_row_from_data, iFpp) -GO(gtk_clist_freeze, vFp) -GO(gtk_clist_get_cell_style, pFpii) -GO(gtk_clist_get_cell_type, iFpii) -GO(gtk_clist_get_column_title, pFpi) -GO(gtk_clist_get_column_widget, pFpi) -GO(gtk_clist_get_hadjustment, pFp) -GO(gtk_clist_get_pixmap, iFpiipp) -GO(gtk_clist_get_pixtext, iFpiipppp) -GO(gtk_clist_get_row_data, pFpi) -GO(gtk_clist_get_row_style, pFpi) -GO(gtk_clist_get_selectable, iFpi) -GO(gtk_clist_get_selection_info, iFpiipp) -GO(gtk_clist_get_text, iFpiip) -GO(gtk_clist_get_type, LFv) -GO(gtk_clist_get_vadjustment, pFp) -GO(gtk_clist_insert, iFpip) -GO(gtk_clist_moveto, vFpiiff) -GO(gtk_clist_new, pFi) -GO(gtk_clist_new_with_titles, pFip) -GO(gtk_clist_optimal_column_width, iFpi) -GO(gtk_clist_prepend, iFpp) -GO(gtk_clist_remove, vFpi) -GO(gtk_clist_row_is_visible, iFpi) -GO(gtk_clist_row_move, vFpii) -GO(gtk_clist_select_all, vFp) -GO(gtk_clist_select_row, vFpii) -GO(gtk_clist_set_auto_sort, vFpi) -GO(gtk_clist_set_background, vFpip) -GO(gtk_clist_set_button_actions, vFpiC) -GO(gtk_clist_set_cell_style, vFpiip) -GO(gtk_clist_set_column_auto_resize, iFpi) -GO(gtk_clist_set_column_justification, vFpii) -GO(gtk_clist_set_column_max_width, vFpii) -GO(gtk_clist_set_column_min_width, vFpii) -GO(gtk_clist_set_column_resizeable, vFpii) -GO(gtk_clist_set_column_title, vFpip) -GO(gtk_clist_set_column_visibility, vFpii) -GO(gtk_clist_set_column_widget, vFpip) -GO(gtk_clist_set_column_width, vFpii) -//GOM(gtk_clist_set_compare_func, vFEpp) -GO(gtk_clist_set_foreground, vFpip) -GO(gtk_clist_set_hadjustment, vFpp) -GO(gtk_clist_set_pixmap, vFpiipp) -GO(gtk_clist_set_pixtext, vFpiipCpp) -GO(gtk_clist_set_reorderable, vFpi) -GO(gtk_clist_set_row_data, vFpip) -//GOM(gtk_clist_set_row_data_full, vFpipp) -GO(gtk_clist_set_row_height, vFpu) -GO(gtk_clist_set_row_style, vFpip) -GO(gtk_clist_set_selectable, vFpii) -GO(gtk_clist_set_selection_mode, vFpi) -GO(gtk_clist_set_shadow_type, vFpi) -GO(gtk_clist_set_shift, vFpiiii) -GO(gtk_clist_set_sort_column, vFpi) -GO(gtk_clist_set_sort_type, vFpi) -GO(gtk_clist_set_text, vFpiip) -GO(gtk_clist_set_use_drag_icons, vFpi) -GO(gtk_clist_set_vadjustment, vFpp) -GO(gtk_clist_sort, vFp) -GO(gtk_clist_swap_rows, vFpii) -GO(gtk_clist_thaw, vFp) -GO(gtk_clist_undo_selection, vFp) -GO(gtk_clist_unselect_all, vFp) -GO(gtk_clist_unselect_row, vFpii) GO(gtk_color_button_get_alpha, WFp) GO(gtk_color_button_get_color, vFpp) +GO(gtk_color_button_get_rgba, vFpp) GO(gtk_color_button_get_title, pFp) GO(gtk_color_button_get_type, LFv) GO(gtk_color_button_get_use_alpha, iFp) @@ -564,74 +670,87 @@ GO(gtk_color_button_set_color, vFpp) GO(gtk_color_button_set_rgba, vFpp) GO(gtk_color_button_set_title, vFpp) GO(gtk_color_button_set_use_alpha, vFpi) +GO(gtk_color_chooser_add_palette, vFpuiip) GO(gtk_color_chooser_dialog_get_type, LFv) +GO(gtk_color_chooser_dialog_new, pFpp) +GO(gtk_color_chooser_get_rgba, vFpp) GO(gtk_color_chooser_get_type, LFv) +GO(gtk_color_chooser_get_use_alpha, iFp) +GO(gtk_color_chooser_set_rgba, vFpp) +GO(gtk_color_chooser_set_use_alpha, vFpi) +GO(gtk_color_chooser_widget_get_type, LFv) +GO(gtk_color_chooser_widget_new, pFv) +//GO(gtk_color_picker_get_type, +//GO(gtk_color_picker_kwin_new, +//GO(gtk_color_picker_new, +//GO(gtk_color_picker_pick, +//GO(gtk_color_picker_pick_finish, +//GO(gtk_color_picker_portal_new, +//GO(gtk_color_picker_shell_new, GO(gtk_color_selection_dialog_get_color_selection, pFp) GO(gtk_color_selection_dialog_get_type, LFv) GO(gtk_color_selection_dialog_new, pFp) -GO(gtk_color_selection_get_color, vFpp) GO(gtk_color_selection_get_current_alpha, WFp) GO(gtk_color_selection_get_current_color, vFpp) +GO(gtk_color_selection_get_current_rgba, vFpp) GO(gtk_color_selection_get_has_opacity_control, iFp) GO(gtk_color_selection_get_has_palette, iFp) GO(gtk_color_selection_get_previous_alpha, WFp) GO(gtk_color_selection_get_previous_color, vFpp) +GO(gtk_color_selection_get_previous_rgba, vFpp) GO(gtk_color_selection_get_type, LFv) GO(gtk_color_selection_is_adjusting, iFp) GO(gtk_color_selection_new, pFv) GO(gtk_color_selection_palette_from_string, iFppp) GO(gtk_color_selection_palette_to_string, pFpi) -//GOM(gtk_color_selection_set_change_palette_hook, pFEp) //GOM(gtk_color_selection_set_change_palette_with_screen_hook, pFEp) -GO(gtk_color_selection_set_color, vFpp) GO(gtk_color_selection_set_current_alpha, vFpW) GO(gtk_color_selection_set_current_color, vFpp) +GO(gtk_color_selection_set_current_rgba, vFpp) GO(gtk_color_selection_set_has_opacity_control, vFpi) GO(gtk_color_selection_set_has_palette, vFpi) GO(gtk_color_selection_set_previous_alpha, vFpW) GO(gtk_color_selection_set_previous_color, vFpp) -GO(gtk_color_selection_set_update_policy, vFpi) -GO(gtk_combo_box_append_text, vFpp) -GO(gtk_combo_box_entry_get_text_column, iFp) -GO(gtk_combo_box_entry_get_type, LFv) -GO(gtk_combo_box_entry_new, pFv) -GO(gtk_combo_box_entry_new_text, pFv) -GO(gtk_combo_box_entry_new_with_model, pFpi) -GO(gtk_combo_box_entry_set_text_column, vFpi) +GO(gtk_color_selection_set_previous_rgba, vFpp) +GO(gtk_combo_box_accessible_get_type, LFv) GO(gtk_combo_box_get_active, iFp) +GO(gtk_combo_box_get_active_id, pFp) GO(gtk_combo_box_get_active_iter, iFpp) -GO(gtk_combo_box_get_active_text, pFp) GO(gtk_combo_box_get_add_tearoffs, iFp) GO(gtk_combo_box_get_button_sensitivity, uFp) GO(gtk_combo_box_get_column_span_column, iFp) GO(gtk_combo_box_get_entry_text_column, iFp) GO(gtk_combo_box_get_focus_on_click, iFp) GO(gtk_combo_box_get_has_entry, iFp) +GO(gtk_combo_box_get_id_column, iFp) GO(gtk_combo_box_get_model, pFp) GO(gtk_combo_box_get_popup_accessible, pFp) +GO(gtk_combo_box_get_popup_fixed_width, iFp) //GOM(gtk_combo_box_get_row_separator_func, pFEp) GO(gtk_combo_box_get_row_span_column, iFp) GO(gtk_combo_box_get_title, pFp) GO(gtk_combo_box_get_type, LFv) GO(gtk_combo_box_get_wrap_width, iFp) -GO(gtk_combo_box_insert_text, vFpip) GO(gtk_combo_box_new, pFv) -GO(gtk_combo_box_new_text, pFv) +GO(gtk_combo_box_new_with_area, pFp) +GO(gtk_combo_box_new_with_area_and_entry, pFp) GO(gtk_combo_box_new_with_entry, pFv) GO(gtk_combo_box_new_with_model, pFp) GO(gtk_combo_box_new_with_model_and_entry, pFp) GO(gtk_combo_box_popdown, vFp) GO(gtk_combo_box_popup, vFp) -GO(gtk_combo_box_prepend_text, vFpp) -GO(gtk_combo_box_remove_text, vFpi) +GO(gtk_combo_box_popup_for_device, vFpp) GO(gtk_combo_box_set_active, vFpi) +GO(gtk_combo_box_set_active_id, iFpp) GO(gtk_combo_box_set_active_iter, vFpp) GO(gtk_combo_box_set_add_tearoffs, vFpi) GO(gtk_combo_box_set_button_sensitivity, vFpu) GO(gtk_combo_box_set_column_span_column, vFpi) GO(gtk_combo_box_set_entry_text_column, vFpi) GO(gtk_combo_box_set_focus_on_click, vFpi) +GO(gtk_combo_box_set_id_column, vFpi) GO(gtk_combo_box_set_model, vFpp) +GO(gtk_combo_box_set_popup_fixed_width, vFpi) //GOM(gtk_combo_box_set_row_separator_func, vFEpppp) GO(gtk_combo_box_set_row_span_column, vFpi) GO(gtk_combo_box_set_title, vFpp) @@ -640,33 +759,33 @@ GO(gtk_combo_box_text_append, vFppp) GO(gtk_combo_box_text_append_text, vFpp) GO(gtk_combo_box_text_get_active_text, pFp) GO(gtk_combo_box_text_get_type, LFv) +GO(gtk_combo_box_text_insert, vFpipp) GO(gtk_combo_box_text_insert_text, vFpip) GO(gtk_combo_box_text_new, pFv) GO(gtk_combo_box_text_new_with_entry, pFv) +GO(gtk_combo_box_text_prepend, vFppp) GO(gtk_combo_box_text_prepend_text, vFpp) GO(gtk_combo_box_text_remove, vFpi) GO(gtk_combo_box_text_remove_all, vFp) -GO(gtk_combo_disable_activate, vFp) -GO(gtk_combo_get_type, LFv) -GO(gtk_combo_new, pFv) -GO(gtk_combo_set_case_sensitive, vFpi) -GO(gtk_combo_set_item_string, vFppp) -GO(gtk_combo_set_popdown_strings, vFpp) -GO(gtk_combo_set_use_arrows, vFpi) -GO(gtk_combo_set_use_arrows_always, vFpi) -GO(gtk_combo_set_value_in_list, vFpii) GO(gtk_container_accessible_get_type, LFv) GO(gtk_container_add, vFpp) GO(gtk_container_add_with_properties, vFpppppppppppp) //vaarg +GO(gtk_container_cell_accessible_add_child, vFpp) +GO(gtk_container_cell_accessible_get_children, pFp) +GO(gtk_container_cell_accessible_get_type, LFv) +GO(gtk_container_cell_accessible_new, pFv) +GO(gtk_container_cell_accessible_remove_child, vFpp) GO(gtk_container_check_resize, vFp) -//GO2(gtk_container_child_get, vFpppV, gtk_container_child_get_valist) +//GOM(gtk_container_child_get, vFpppV) GO(gtk_container_child_get_property, vFpppp) -//GO(gtk_container_child_get_valist, vFpppp) -//GO2(gtk_container_child_set, vFpppV, gtk_container_child_set_valist) +//GOM(gtk_container_child_get_valist, vFpppA) +GO(gtk_container_child_notify, vFppp) +GO(gtk_container_child_notify_by_pspec, vFppp) +//GOM(gtk_container_child_set, vFpppV) GO(gtk_container_child_set_property, vFpppp) -//GO(gtk_container_child_set_valist, vFpppp) +//GOM(gtk_container_child_set_valist, vFpppA) GO(gtk_container_child_type, LFp) -GO(gtk_container_class_find_child_property, pFpp) +GO(gtk_container_class_find_child_property, pFpp) // Something to wrap? GO(gtk_container_class_install_child_property, vFpup) GO(gtk_container_class_list_child_properties, pFpp) GOM(gtk_container_forall, vFEppp) @@ -678,9 +797,10 @@ GO(gtk_container_get_focus_chain, iFpp) GO(gtk_container_get_focus_child, pFp) GO(gtk_container_get_focus_hadjustment, pFp) GO(gtk_container_get_focus_vadjustment, pFp) +GO(gtk_container_get_path_for_child, pFpp) GO(gtk_container_get_resize_mode, uFp) GO(gtk_container_get_type, LFv) -GO(gtk_container_propagate_expose, vFppp) +GO(gtk_container_propagate_draw, vFppp) GO(gtk_container_remove, vFpp) GO(gtk_container_resize_children, vFp) GO(gtk_container_set_border_width, vFpu) @@ -692,6 +812,8 @@ GO(gtk_container_set_reallocate_redraws, vFpi) GO(gtk_container_set_resize_mode, vFpu) GO(gtk_container_unset_focus_chain, vFp) GO(gtk_corner_type_get_type, LFv) +GO(gtk_css_provider_error_get_type, LFv) +GO(gtk_css_provider_error_quark, uFv) GO(gtk_css_provider_get_default, pFv) GO(gtk_css_provider_get_named, pFpp) GO(gtk_css_provider_get_type, LFv) @@ -708,120 +830,40 @@ GO(gtk_css_section_get_parent, pFp) GO(gtk_css_section_get_section_type, uFp) GO(gtk_css_section_get_start_line, uFp) GO(gtk_css_section_get_start_position, uFp) +GO(gtk_css_section_get_type, LFv) GO(gtk_css_section_ref, pFp) +GO(gtk_css_section_type_get_type, LFv) GO(gtk_css_section_unref, vFp) -//GO(gtk_ctree_collapse, -//GO(gtk_ctree_collapse_recursive, -//GO(gtk_ctree_collapse_to_depth, -//GO(gtk_ctree_expand, -GO(gtk_ctree_expander_style_get_type, LFv) -//GO(gtk_ctree_expand_recursive, -//GO(gtk_ctree_expand_to_depth, -GO(gtk_ctree_expansion_type_get_type, LFv) -//GO(gtk_ctree_export_to_gnode, -//GO(gtk_ctree_find, -//GO(gtk_ctree_find_all_by_row_data, -//GO(gtk_ctree_find_all_by_row_data_custom, -//GO(gtk_ctree_find_by_row_data, -//GO(gtk_ctree_find_by_row_data_custom, -//GO(gtk_ctree_find_node_ptr, -//GO(gtk_ctree_get_node_info, -GO(gtk_ctree_get_type, LFv) -//GO(gtk_ctree_insert_gnode, -//GO(gtk_ctree_insert_node, -//GO(gtk_ctree_is_ancestor, -//GO(gtk_ctree_is_hot_spot, -//GO(gtk_ctree_is_viewable, -//GO(gtk_ctree_last, -GO(gtk_ctree_line_style_get_type, LFv) -//GO(gtk_ctree_move, -//GO(gtk_ctree_new, -//GO(gtk_ctree_new_with_titles, -//GO(gtk_ctree_node_get_cell_style, -//GO(gtk_ctree_node_get_cell_type, -//GO(gtk_ctree_node_get_pixmap, -//GO(gtk_ctree_node_get_pixtext, -//GO(gtk_ctree_node_get_row_data, -//GO(gtk_ctree_node_get_row_style, -//GO(gtk_ctree_node_get_selectable, -//GO(gtk_ctree_node_get_text, -GO(gtk_ctree_node_get_type, LFv) -//GO(gtk_ctree_node_is_visible, -//GO(gtk_ctree_node_moveto, -//GO(gtk_ctree_node_nth, -//GO(gtk_ctree_node_set_background, -//GO(gtk_ctree_node_set_cell_style, -//GO(gtk_ctree_node_set_foreground, -//GO(gtk_ctree_node_set_pixmap, -//GO(gtk_ctree_node_set_pixtext, -//GO(gtk_ctree_node_set_row_data, -//GO(gtk_ctree_node_set_row_data_full, -//GO(gtk_ctree_node_set_row_style, -//GO(gtk_ctree_node_set_selectable, -//GO(gtk_ctree_node_set_shift, -//GO(gtk_ctree_node_set_text, -GO(gtk_ctree_pos_get_type, LFv) -//GO(gtk_ctree_post_recursive, -//GO(gtk_ctree_post_recursive_to_depth, -//GO(gtk_ctree_pre_recursive, -//GO(gtk_ctree_pre_recursive_to_depth, -//GO(gtk_ctree_real_select_recursive, -//GO(gtk_ctree_remove_node, -//GO(gtk_ctree_select, -//GO(gtk_ctree_select_recursive, -//GO(gtk_ctree_set_drag_compare_func, -//GO(gtk_ctree_set_expander_style, -//GO(gtk_ctree_set_indent, -//GO(gtk_ctree_set_line_style, -//GO(gtk_ctree_set_node_info, -//GO(gtk_ctree_set_show_stub, -//GO(gtk_ctree_set_spacing, -//GO(gtk_ctree_sort_node, -//GO(gtk_ctree_sort_recursive, -//GO(gtk_ctree_toggle_expansion, -//GO(gtk_ctree_toggle_expansion_recursive, -//GO(gtk_ctree_unselect, -//GO(gtk_ctree_unselect_recursive, -GO(gtk_curve_get_type, LFv) -GO(gtk_curve_get_vector, vFpip) -GO(gtk_curve_new, pFv) -GO(gtk_curve_reset, vFp) -GO(gtk_curve_set_curve_type, vFpi) -GO(gtk_curve_set_gamma, vFpf) -GO(gtk_curve_set_range, vFpffff) -GO(gtk_curve_set_vector, vFpip) -GO(gtk_curve_type_get_type, LFv) GO(gtk_custom_paper_unix_dialog_get_type, LFv) GO(gtk_debug_flag_get_type, LFv) -GO(gtk_decorated_window_calculate_frame_size, vFp) -GO(gtk_decorated_window_init, vFp) -GO(gtk_decorated_window_move_resize_window, vFpiiii) -GO(gtk_decorated_window_set_title, vFpp) GO(gtk_delete_type_get_type, LFv) GO(gtk_dest_defaults_get_type, LFv) +GO(gtk_device_grab_add, vFppi) +GO(gtk_device_grab_remove, vFpp) GO(gtk_dialog_add_action_widget, vFppi) GO(gtk_dialog_add_button, pFppi) GOM(gtk_dialog_add_buttons, vFEppV) GO(gtk_dialog_flags_get_type, LFv) GO(gtk_dialog_get_action_area, pFp) GO(gtk_dialog_get_content_area, pFp) -GO(gtk_dialog_get_has_separator, iFp) +GO(gtk_dialog_get_header_bar, pFp) GO(gtk_dialog_get_response_for_widget, iFpp) GO(gtk_dialog_get_type, LFv) GO(gtk_dialog_get_widget_for_response, pFpi) GO(gtk_dialog_new, pFv) -GO(gtk_dialog_new_with_buttons, pFppipppppppppppp) //vaarg +GO(gtk_dialog_new_with_buttons, pFppupppppppppppp) //vaarg GO(gtk_dialog_response, vFpi) GO(gtk_dialog_run, iFp) GO(gtk_dialog_set_alternative_button_order, vFpiiiiiiiiiiiiiiiiii) // vaarg, should wrap using gtk_dialog_set_alternative_button_order_from_array GO(gtk_dialog_set_alternative_button_order_from_array, vFpip) GO(gtk_dialog_set_default_response, vFpi) -GO(gtk_dialog_set_has_separator, vFpi) GO(gtk_dialog_set_response_sensitive, vFpii) GO(gtk_direction_type_get_type, LFv) GO(gtk_disable_setlocale, vFv) GO(gtk_distribute_natural_allocation, iFiup) GO(gtk_drag_begin, pFppuip) +GO(gtk_drag_begin_with_coordinates, pFppuipii) +GO(gtk_drag_cancel, vFp) GO(gtk_drag_check_threshold, iFpiiii) GO(gtk_drag_dest_add_image_targets, vFp) GO(gtk_drag_dest_add_text_targets, vFp) @@ -839,50 +881,28 @@ GO(gtk_drag_get_data, vFpppu) GO(gtk_drag_get_source_widget, pFp) GO(gtk_drag_highlight, vFp) GO(gtk_drag_result_get_type, LFv) -GO(gtk_drag_set_default_icon, vFpppii) GO(gtk_drag_set_icon_default, vFp) +GO(gtk_drag_set_icon_gicon, vFppii) GO(gtk_drag_set_icon_name, vFppii) GO(gtk_drag_set_icon_pixbuf, vFppii) -GO(gtk_drag_set_icon_pixmap, vFppppii) GO(gtk_drag_set_icon_stock, vFppii) +GO(gtk_drag_set_icon_surface, vFpp) GO(gtk_drag_set_icon_widget, vFppii) GO(gtk_drag_source_add_image_targets, vFp) GO(gtk_drag_source_add_text_targets, vFp) GO(gtk_drag_source_add_uri_targets, vFp) GO(gtk_drag_source_get_target_list, pFp) GO(gtk_drag_source_set, vFpupiu) -GO(gtk_drag_source_set_icon, vFpppp) +GO(gtk_drag_source_set_icon_gicon, vFpp) GO(gtk_drag_source_set_icon_name, vFpp) GO(gtk_drag_source_set_icon_pixbuf, vFpp) GO(gtk_drag_source_set_icon_stock, vFpp) GO(gtk_drag_source_set_target_list, vFpp) GO(gtk_drag_source_unset, vFp) GO(gtk_drag_unhighlight, vFp) -GO(gtk_draw_arrow, vFppiiiiiiii) -GO(gtk_draw_box, vFppiiiiii) -GO(gtk_draw_box_gap, vFppiiiiiiiii) -GO(gtk_draw_check, vFppiiiiii) -GO(gtk_draw_diamond, vFppiiiiii) -GO(gtk_draw_expander, vFppiiii) -GO(gtk_draw_extension, vFppiiiiiii) -GO(gtk_draw_flat_box, vFppiiiiii) -GO(gtk_draw_focus, vFppiiii) -GO(gtk_draw_handle, vFppiiiiiii) -GO(gtk_draw_hline, vFppiiii) GO(gtk_drawing_area_get_type, LFv) GO(gtk_drawing_area_new, pFv) -GO(gtk_drawing_area_size, vFpii) GO(gtk_draw_insertion_cursor, vFpppiui) -GO(gtk_draw_layout, vFppiiiip) -GO(gtk_draw_option, vFppiiiiii) -GO(gtk_draw_polygon, vFppiipii) -GO(gtk_draw_resize_grip, vFppiiiiii) -GO(gtk_draw_shadow, vFppiiiiii) -GO(gtk_draw_shadow_gap, vFppiiiiiiiii) -GO(gtk_draw_slider, vFppiiiiiii) -GO(gtk_draw_string, vFppiiip) -GO(gtk_draw_tab, vFppiiiiii) -GO(gtk_draw_vline, vFppiiii) GO(gtk_editable_copy_clipboard, vFp) GO(gtk_editable_cut_clipboard, vFp) GO(gtk_editable_delete_selection, vFp) @@ -897,7 +917,7 @@ GO(gtk_editable_paste_clipboard, vFp) GO(gtk_editable_select_region, vFpii) GO(gtk_editable_set_editable, vFpi) GO(gtk_editable_set_position, vFpi) -GO(gtk_entry_append_text, vFpp) +GO(gtk_entry_accessible_get_type, LFv) GO(gtk_entry_buffer_delete_text, uFpui) GO(gtk_entry_buffer_emit_deleted_text, vFpuu) GO(gtk_entry_buffer_emit_inserted_text, vFpupu) @@ -910,102 +930,113 @@ GO(gtk_entry_buffer_insert_text, uFpupi) GO(gtk_entry_buffer_new, pFpi) GO(gtk_entry_buffer_set_max_length, vFpi) GO(gtk_entry_buffer_set_text, vFppi) -//GO(gtk_entry_completion_complete, -//GO(gtk_entry_completion_delete_action, +GO(gtk_entry_completion_complete, vFp) +GO(gtk_entry_completion_compute_prefix, pFpp) +GO(gtk_entry_completion_delete_action, vFpi) GO(gtk_entry_completion_get_completion_prefix, pFp) GO(gtk_entry_completion_get_entry, pFp) -//GO(gtk_entry_completion_get_inline_completion, -//GO(gtk_entry_completion_get_inline_selection, -//GO(gtk_entry_completion_get_minimum_key_length, +GO(gtk_entry_completion_get_inline_completion, iFp) +GO(gtk_entry_completion_get_inline_selection, iFp) +GO(gtk_entry_completion_get_minimum_key_length, iFp) GO(gtk_entry_completion_get_model, pFp) -//GO(gtk_entry_completion_get_popup_completion, -//GO(gtk_entry_completion_get_popup_set_width, +GO(gtk_entry_completion_get_popup_completion, iFp) +GO(gtk_entry_completion_get_popup_set_width, iFp) GO(gtk_entry_completion_get_popup_single_match, iFp) GO(gtk_entry_completion_get_text_column, iFp) GO(gtk_entry_completion_get_type, LFv) GO(gtk_entry_completion_insert_action_markup, vFpip) -//GO(gtk_entry_completion_insert_action_text, -//GO(gtk_entry_completion_insert_prefix, +GO(gtk_entry_completion_insert_action_text, vFpip) +GO(gtk_entry_completion_insert_prefix, vFp) GO(gtk_entry_completion_new, pFv) -//GO(gtk_entry_completion_set_inline_completion, -//GO(gtk_entry_completion_set_inline_selection, -//GO(gtk_entry_completion_set_match_func, -//GO(gtk_entry_completion_set_minimum_key_length, +GO(gtk_entry_completion_new_with_area, pFp) +GO(gtk_entry_completion_set_inline_completion, vFpi) +GO(gtk_entry_completion_set_inline_selection, vFpi) +//GOM(gtk_entry_completion_set_match_func, vFpppp) +GO(gtk_entry_completion_set_minimum_key_length, vFpi) GO(gtk_entry_completion_set_model, vFpp) -//GO(gtk_entry_completion_set_popup_completion, -//GO(gtk_entry_completion_set_popup_set_width, +GO(gtk_entry_completion_set_popup_completion, vFpi) +GO(gtk_entry_completion_set_popup_set_width, vFpi) GO(gtk_entry_completion_set_popup_single_match, vFpi) GO(gtk_entry_completion_set_text_column, vFpi) GO(gtk_entry_get_activates_default, iFp) GO(gtk_entry_get_alignment, fFp) +GO(gtk_entry_get_attributes, pFp) GO(gtk_entry_get_buffer, pFp) GO(gtk_entry_get_completion, pFp) GO(gtk_entry_get_current_icon_drag_source, iFp) GO(gtk_entry_get_cursor_hadjustment, pFp) GO(gtk_entry_get_has_frame, iFp) -//GO(gtk_entry_get_icon_activatable, +GO(gtk_entry_get_icon_activatable, iFpu) +GO(gtk_entry_get_icon_area, vFpup) GO(gtk_entry_get_icon_at_pos, iFpii) GO(gtk_entry_get_icon_gicon, pFpu) GO(gtk_entry_get_icon_name, pFpu) GO(gtk_entry_get_icon_pixbuf, pFpu) GO(gtk_entry_get_icon_sensitive, iFpu) -//GO(gtk_entry_get_icon_stock, +GO(gtk_entry_get_icon_stock, pFpu) GO(gtk_entry_get_icon_storage_type, uFpu) GO(gtk_entry_get_icon_tooltip_markup, pFpu) -//GO(gtk_entry_get_icon_tooltip_text, -//GO(gtk_entry_get_icon_window, +GO(gtk_entry_get_icon_tooltip_text, pFpu) GO(gtk_entry_get_inner_border, pFp) +GO(gtk_entry_get_input_hints, uFp) +GO(gtk_entry_get_input_purpose, uFp) GO(gtk_entry_get_invisible_char, uFp) GO(gtk_entry_get_layout, pFp) GO(gtk_entry_get_layout_offsets, vFppp) -//GO(gtk_entry_get_max_length, +GO(gtk_entry_get_max_length, iFp) +GO(gtk_entry_get_max_width_chars, iFp) GO(gtk_entry_get_overwrite_mode, iFp) -//GO(gtk_entry_get_progress_fraction, +GO(gtk_entry_get_placeholder_text, pFp) +GO(gtk_entry_get_progress_fraction, dFp) GO(gtk_entry_get_progress_pulse_step, dFp) +GO(gtk_entry_get_tabs, pFp) GO(gtk_entry_get_text, pFp) +GO(gtk_entry_get_text_area, vFpp) GO(gtk_entry_get_text_length, WFp) -//GO(gtk_entry_get_text_window, GO(gtk_entry_get_type, LFv) -//GO(gtk_entry_get_visibility, +GO(gtk_entry_get_visibility, iFp) GO(gtk_entry_get_width_chars, iFp) +GO(gtk_entry_grab_focus_without_selecting, vFp) +GO(gtk_entry_icon_accessible_get_type, LFv) GO(gtk_entry_icon_position_get_type, LFv) GO(gtk_entry_im_context_filter_keypress, iFpp) -//GO(gtk_entry_layout_index_to_text_index, +GO(gtk_entry_layout_index_to_text_index, iFpi) GO(gtk_entry_new, pFv) GO(gtk_entry_new_with_buffer, pFp) -GO(gtk_entry_new_with_max_length, pFi) -GO(gtk_entry_prepend_text, vFpp) -//GO(gtk_entry_progress_pulse, -//GO(gtk_entry_reset_im_context, -GO(gtk_entry_select_region, vFpii) +GO(gtk_entry_progress_pulse, vFp) +GO(gtk_entry_reset_im_context, vFp) GO(gtk_entry_set_activates_default, vFpi) GO(gtk_entry_set_alignment, vFpf) +GO(gtk_entry_set_attributes, vFpp) GO(gtk_entry_set_buffer, vFpp) GO(gtk_entry_set_completion, vFpp) GO(gtk_entry_set_cursor_hadjustment, vFpp) -GO(gtk_entry_set_editable, vFpi) GO(gtk_entry_set_has_frame, vFpi) -//GO(gtk_entry_set_icon_activatable, +GO(gtk_entry_set_icon_activatable, vFpui) GO(gtk_entry_set_icon_drag_source, vFpupu) GO(gtk_entry_set_icon_from_gicon, vFpup) -//GO(gtk_entry_set_icon_from_icon_name, +GO(gtk_entry_set_icon_from_icon_name, vFpup) GO(gtk_entry_set_icon_from_pixbuf, vFpup) -//GO(gtk_entry_set_icon_from_stock, +GO(gtk_entry_set_icon_from_stock, vFpup) GO(gtk_entry_set_icon_sensitive, vFpui) GO(gtk_entry_set_icon_tooltip_markup, vFpup) -//GO(gtk_entry_set_icon_tooltip_text, +GO(gtk_entry_set_icon_tooltip_text, vFpup) GO(gtk_entry_set_inner_border, vFpp) +GO(gtk_entry_set_input_hints, vFpu) +GO(gtk_entry_set_input_purpose, vFpu) GO(gtk_entry_set_invisible_char, vFpu) GO(gtk_entry_set_max_length, vFpi) +GO(gtk_entry_set_max_width_chars, vFpi) GO(gtk_entry_set_overwrite_mode, vFpi) -GO(gtk_entry_set_position, vFpi) -//GO(gtk_entry_set_progress_fraction, +GO(gtk_entry_set_placeholder_text, vFpp) +GO(gtk_entry_set_progress_fraction, vFpd) GO(gtk_entry_set_progress_pulse_step, vFpd) +GO(gtk_entry_set_tabs, vFpp) GO(gtk_entry_set_text, vFpp) GO(gtk_entry_set_visibility, vFpi) -GO(gtk_entry_set_width_chars, uFp) +GO(gtk_entry_set_width_chars, vFpi) GO(gtk_entry_text_index_to_layout_index, iFpi) -//GO(gtk_entry_unset_invisible_char, +GO(gtk_entry_unset_invisible_char, vFp) GOM(gtk_enumerate_printers, vFEpppi) GO(gtk_event_box_get_above_child, iFp) GO(gtk_event_box_get_type, LFv) @@ -1013,13 +1044,33 @@ GO(gtk_event_box_get_visible_window, iFp) GO(gtk_event_box_new, pFv) GO(gtk_event_box_set_above_child, vFpi) GO(gtk_event_box_set_visible_window, vFpi) -GO(gtk_event_controller_set_propagation_phase, vFpi) +GO(gtk_event_controller_get_propagation_phase, uFp) +GO(gtk_event_controller_get_type, LFv) +GO(gtk_event_controller_get_widget, pFp) +GO(gtk_event_controller_handle_event, iFpp) +GO(gtk_event_controller_key_forward, iFpp) +GO(gtk_event_controller_key_get_group, uFp) +GO(gtk_event_controller_key_get_im_context, pFp) +GO(gtk_event_controller_key_get_type, LFv) +GO(gtk_event_controller_key_new, pFp) +GO(gtk_event_controller_key_set_im_context, vFpp) +GO(gtk_event_controller_motion_get_type, LFv) +GO(gtk_event_controller_motion_new, pFp) +GO(gtk_event_controller_reset, vFp) +GO(gtk_event_controller_scroll_flags_get_type, LFv) +GO(gtk_event_controller_scroll_get_flags, uFp) +GO(gtk_event_controller_scroll_get_type, LFv) +GO(gtk_event_controller_scroll_new, pFpu) +GO(gtk_event_controller_scroll_set_flags, vFpu) +GO(gtk_event_controller_set_propagation_phase, vFpu) +GO(gtk_event_sequence_state_get_type, LFv) GO(gtk_events_pending, iFv) -GO(gtk_exit, vFi) +GO(gtk_expander_accessible_get_type, LFv) GO(gtk_expander_get_expanded, iFp) GO(gtk_expander_get_label, pFp) GO(gtk_expander_get_label_fill, iFp) GO(gtk_expander_get_label_widget, pFp) +GO(gtk_expander_get_resize_toplevel, iFp) GO(gtk_expander_get_spacing, iFp) GO(gtk_expander_get_type, LFv) GO(gtk_expander_get_use_markup, iFp) @@ -1030,12 +1081,14 @@ GO(gtk_expander_set_expanded, vFpi) GO(gtk_expander_set_label, vFpp) GO(gtk_expander_set_label_fill, vFpi) GO(gtk_expander_set_label_widget, vFpp) +GO(gtk_expander_set_resize_toplevel, vFpi) GO(gtk_expander_set_spacing, vFpi) GO(gtk_expander_set_use_markup, vFpi) GO(gtk_expander_set_use_underline, vFpi) GO(gtk_expander_style_get_type, LFv) GO(gtk_false, iFv) GO(gtk_file_chooser_action_get_type, LFv) +GO(gtk_file_chooser_add_choice, vFppppp) GO(gtk_file_chooser_add_filter, vFpp) GO(gtk_file_chooser_add_shortcut_folder, iFppp) GO(gtk_file_chooser_add_shortcut_folder_uri, iFppp) @@ -1044,22 +1097,22 @@ GO(gtk_file_chooser_button_get_title, pFp) GO(gtk_file_chooser_button_get_type, LFv) GO(gtk_file_chooser_button_get_width_chars, iFp) GO(gtk_file_chooser_button_new, pFpu) -GO(gtk_file_chooser_button_new_with_backend, pFpip) GO(gtk_file_chooser_button_new_with_dialog, pFp) GO(gtk_file_chooser_button_set_focus_on_click, vFpi) GO(gtk_file_chooser_button_set_title, vFpp) GO(gtk_file_chooser_button_set_width_chars, vFpi) GO(gtk_file_chooser_confirmation_get_type, LFv) GO(gtk_file_chooser_dialog_get_type, LFv) -GO(gtk_file_chooser_dialog_new, pFppipipipipipipip) // vaargs (so pFppipV) with additionnal buttons, end with a NULL -GO(gtk_file_chooser_dialog_new_with_backend, pFppippipipipipipip) // same but pFppippV +GO(gtk_file_chooser_dialog_new, pFppupupupupupupup) // vaargs (so pFppupV) with additionnal buttons, end with a NULL GO(gtk_file_chooser_error_get_type, LFv) -GO(gtk_file_chooser_error_quark, pFv) +GO(gtk_file_chooser_error_quark, uFv) GO(gtk_file_chooser_get_action, uFp) +GO(gtk_file_chooser_get_choice, pFpp) GO(gtk_file_chooser_get_create_folders, iFp) GO(gtk_file_chooser_get_current_folder, pFp) GO(gtk_file_chooser_get_current_folder_file, pFp) GO(gtk_file_chooser_get_current_folder_uri, pFp) +GO(gtk_file_chooser_get_current_name, pFp) GO(gtk_file_chooser_get_do_overwrite_confirmation, iFp) GO(gtk_file_chooser_get_extra_widget, pFp) GO(gtk_file_chooser_get_file, pFp) @@ -1083,7 +1136,13 @@ GO(gtk_file_chooser_get_use_preview_label, iFp) GO(gtk_file_chooser_list_filters, pFp) GO(gtk_file_chooser_list_shortcut_folders, pFp) GO(gtk_file_chooser_list_shortcut_folder_uris, pFp) -GO(gtk_file_chooser_native_new, pFppipp) +GO(gtk_file_chooser_native_get_accept_label, pFp) +GO(gtk_file_chooser_native_get_cancel_label, pFp) +GO(gtk_file_chooser_native_get_type, LFv) +GO(gtk_file_chooser_native_new, pFppupp) +GO(gtk_file_chooser_native_set_accept_label, vFpp) +GO(gtk_file_chooser_native_set_cancel_label, vFpp) +GO(gtk_file_chooser_remove_choice, vFpp) GO(gtk_file_chooser_remove_filter, vFpp) GO(gtk_file_chooser_remove_shortcut_folder, iFppp) GO(gtk_file_chooser_remove_shortcut_folder_uri, iFppp) @@ -1092,6 +1151,7 @@ GO(gtk_file_chooser_select_file, iFppp) GO(gtk_file_chooser_select_filename, iFpp) GO(gtk_file_chooser_select_uri, iFpp) GO(gtk_file_chooser_set_action, vFpu) +GO(gtk_file_chooser_set_choice, vFppp) GO(gtk_file_chooser_set_create_folders, vFpi) GO(gtk_file_chooser_set_current_folder, iFpp) GO(gtk_file_chooser_set_current_folder_file, iFppp) @@ -1107,15 +1167,15 @@ GO(gtk_file_chooser_set_preview_widget, vFpp) GO(gtk_file_chooser_set_preview_widget_active, vFpi) GO(gtk_file_chooser_set_select_multiple, vFpi) GO(gtk_file_chooser_set_show_hidden, vFpi) -GO(gtk_file_chooser_set_uri, vFpp) +GO(gtk_file_chooser_set_uri, iFpp) GO(gtk_file_chooser_set_use_preview_label, vFpi) GO(gtk_file_chooser_unselect_all, vFp) GO(gtk_file_chooser_unselect_file, vFpp) GO(gtk_file_chooser_unselect_filename, vFpp) GO(gtk_file_chooser_unselect_uri, vFpp) +//GO(gtk_file_chooser_widget_accessible_get_type, GO(gtk_file_chooser_widget_get_type, LFv) GO(gtk_file_chooser_widget_new, pFu) -GO(gtk_file_chooser_widget_new_with_backend, pFip) GOM(gtk_file_filter_add_custom, vFEpuppp) GO(gtk_file_filter_add_mime_type, vFpp) GO(gtk_file_filter_add_pattern, vFpp) @@ -1126,25 +1186,52 @@ GO(gtk_file_filter_get_name, pFp) GO(gtk_file_filter_get_needed, uFp) GO(gtk_file_filter_get_type, LFv) GO(gtk_file_filter_new, pFv) +GO(gtk_file_filter_new_from_gvariant, pFp) GO(gtk_file_filter_set_name, vFpp) -GO(gtk_file_selection_complete, vFpp) -GO(gtk_file_selection_get_filename, pFp) -GO(gtk_file_selection_get_selections, pFp) -GO(gtk_file_selection_get_select_multiple, iFp) -GO(gtk_file_selection_get_type, LFv) -GO(gtk_file_selection_hide_fileop_buttons, vFp) -GO(gtk_file_selection_new, pFp) -GO(gtk_file_selection_set_filename, vFpp) -GO(gtk_file_selection_set_select_multiple, vFpi) -GO(gtk_file_selection_show_fileop_buttons, vFp) -GO(gtk_fixed_get_has_window, iFp) +GO(gtk_file_filter_to_gvariant, pFp) GO(gtk_fixed_get_type, LFv) GO(gtk_fixed_move, vFppii) GO(gtk_fixed_new, pFv) GO(gtk_fixed_put, vFppii) -GO(gtk_fixed_set_has_window, vFpi) +GO(gtk_flow_box_accessible_get_type, LFv) +//GOM(gtk_flow_box_bind_model, vFppppp) +GO(gtk_flow_box_child_accessible_get_type, LFv) +GO(gtk_flow_box_child_changed, vFp) +GO(gtk_flow_box_child_get_index, iFp) GO(gtk_flow_box_child_get_type, LFv) +GO(gtk_flow_box_child_is_selected, iFp) +GO(gtk_flow_box_child_new, pFv) +GO(gtk_flow_box_get_activate_on_single_click, iFp) +GO(gtk_flow_box_get_child_at_index, pFpi) +GO(gtk_flow_box_get_child_at_pos, pFpii) +GO(gtk_flow_box_get_column_spacing, uFp) +GO(gtk_flow_box_get_homogeneous, iFp) +GO(gtk_flow_box_get_max_children_per_line, uFp) +GO(gtk_flow_box_get_min_children_per_line, uFp) +GO(gtk_flow_box_get_row_spacing, uFp) +GO(gtk_flow_box_get_selected_children, pFp) +GO(gtk_flow_box_get_selection_mode, uFp) GO(gtk_flow_box_get_type, LFv) +GO(gtk_flow_box_insert, vFppi) +GO(gtk_flow_box_invalidate_filter, vFp) +GO(gtk_flow_box_invalidate_sort, vFp) +GO(gtk_flow_box_new, pFv) +GO(gtk_flow_box_select_all, vFp) +GO(gtk_flow_box_select_child, vFpp) +//GOM(gtk_flow_box_selected_foreach, vFppp) +GO(gtk_flow_box_set_activate_on_single_click, vFpi) +GO(gtk_flow_box_set_column_spacing, vFpu) +//GOM(gtk_flow_box_set_filter_func, vFpppp) +GO(gtk_flow_box_set_hadjustment, vFpp) +GO(gtk_flow_box_set_homogeneous, vFpi) +GO(gtk_flow_box_set_max_children_per_line, vFpu) +GO(gtk_flow_box_set_min_children_per_line, vFpu) +GO(gtk_flow_box_set_row_spacing, vFpu) +GO(gtk_flow_box_set_selection_mode, vFpu) +//GOM(gtk_flow_box_set_sort_func, vFpppp) +GO(gtk_flow_box_set_vadjustment, vFpp) +GO(gtk_flow_box_unselect_all, vFp) +GO(gtk_flow_box_unselect_child, vFpp) GO(gtk_font_button_get_font_name, pFp) GO(gtk_font_button_get_show_size, iFp) GO(gtk_font_button_get_show_style, iFp) @@ -1160,10 +1247,32 @@ GO(gtk_font_button_set_show_style, vFpi) GO(gtk_font_button_set_title, vFpp) GO(gtk_font_button_set_use_font, vFpi) GO(gtk_font_button_set_use_size, vFpi) +GO(gtk_font_chooser_dialog_get_type, LFv) +GO(gtk_font_chooser_dialog_new, pFpp) +GO(gtk_font_chooser_get_font, pFp) +GO(gtk_font_chooser_get_font_desc, pFp) +GO(gtk_font_chooser_get_font_face, pFp) +GO(gtk_font_chooser_get_font_family, pFp) +GO(gtk_font_chooser_get_font_features, pFp) +GO(gtk_font_chooser_get_font_map, pFp) +GO(gtk_font_chooser_get_font_size, iFp) +GO(gtk_font_chooser_get_language, pFp) +GO(gtk_font_chooser_get_level, uFp) +GO(gtk_font_chooser_get_preview_text, pFp) +GO(gtk_font_chooser_get_show_preview_entry, iFp) GO(gtk_font_chooser_get_type, LFv) -GO(gtk_font_selection_dialog_get_apply_button, pFp) +GO(gtk_font_chooser_level_get_type, LFv) +//GOM(gtk_font_chooser_set_filter_func, vFpppp) +GO(gtk_font_chooser_set_font, vFpp) +GO(gtk_font_chooser_set_font_desc, vFpp) +GO(gtk_font_chooser_set_font_map, vFpp) +GO(gtk_font_chooser_set_language, vFpp) +GO(gtk_font_chooser_set_level, vFpu) +GO(gtk_font_chooser_set_preview_text, vFpp) +GO(gtk_font_chooser_set_show_preview_entry, vFpi) +GO(gtk_font_chooser_widget_get_type, LFv) +GO(gtk_font_chooser_widget_new, pFv) GO(gtk_font_selection_dialog_get_cancel_button, pFp) -GO(gtk_font_selection_dialog_get_font, pFp) GO(gtk_font_selection_dialog_get_font_name, pFp) GO(gtk_font_selection_dialog_get_font_selection, pFp) GO(gtk_font_selection_dialog_get_ok_button, pFp) @@ -1176,7 +1285,6 @@ GO(gtk_font_selection_get_face, pFp) GO(gtk_font_selection_get_face_list, pFp) GO(gtk_font_selection_get_family, pFp) GO(gtk_font_selection_get_family_list, pFp) -GO(gtk_font_selection_get_font, pFp) GO(gtk_font_selection_get_font_name, pFp) GO(gtk_font_selection_get_preview_entry, pFp) GO(gtk_font_selection_get_preview_text, pFp) @@ -1187,6 +1295,7 @@ GO(gtk_font_selection_get_type, LFv) GO(gtk_font_selection_new, pFv) GO(gtk_font_selection_set_font_name, iFpp) GO(gtk_font_selection_set_preview_text, vFpp) +GO(gtk_frame_accessible_get_type, LFv) GO(gtk_frame_get_label, pFp) GO(gtk_frame_get_label_align, vFppp) GO(gtk_frame_get_label_widget, pFp) @@ -1197,60 +1306,164 @@ GO(gtk_frame_set_label, vFpp) GO(gtk_frame_set_label_align, vFpff) GO(gtk_frame_set_label_widget, vFpp) GO(gtk_frame_set_shadow_type, vFpu) -GO(gtk_gamma_curve_get_type, LFv) -GO(gtk_gamma_curve_new, pFv) -GO(gtk_gc_get, pFippu) -GO(gtk_gc_release, vFp) +GO(gtk_gesture_drag_get_offset, iFppp) +GO(gtk_gesture_drag_get_start_point, iFppp) +GO(gtk_gesture_drag_get_type, LFv) +GO(gtk_gesture_drag_new, pFp) +GO(gtk_gesture_get_bounding_box, iFpp) +GO(gtk_gesture_get_bounding_box_center, iFppp) +GO(gtk_gesture_get_device, pFp) +GO(gtk_gesture_get_group, pFp) +GO(gtk_gesture_get_last_event, pFpp) +GO(gtk_gesture_get_last_updated_sequence, pFp) +GO(gtk_gesture_get_point, iFpppp) +GO(gtk_gesture_get_sequences, pFp) +GO(gtk_gesture_get_sequence_state, uFpp) +GO(gtk_gesture_get_type, LFv) +GO(gtk_gesture_get_window, pFp) +GO(gtk_gesture_group, vFpp) +GO(gtk_gesture_handles_sequence, iFpp) GO(gtk_gesture_is_active, iFp) -GO(gtk_gesture_long_press_new, pFv) -GO(gtk_gesture_pan_new, pFpi) +GO(gtk_gesture_is_grouped_with, iFpp) +GO(gtk_gesture_is_recognized, iFp) +GO(gtk_gesture_long_press_get_type, LFv) +GO(gtk_gesture_long_press_new, pFp) +GO(gtk_gesture_multi_press_get_area, iFpp) +GO(gtk_gesture_multi_press_get_type, LFv) +GO(gtk_gesture_multi_press_new, pFp) +GO(gtk_gesture_multi_press_set_area, vFpp) +GO(gtk_gesture_pan_get_orientation, uFp) +GO(gtk_gesture_pan_get_type, LFv) +GO(gtk_gesture_pan_new, pFpu) +GO(gtk_gesture_pan_set_orientation, vFpu) +GO(gtk_gesture_rotate_get_angle_delta, dFp) +GO(gtk_gesture_rotate_get_type, LFv) +GO(gtk_gesture_rotate_new, pFp) +GO(gtk_gesture_set_sequence_state, iFppu) +GO(gtk_gesture_set_state, iFpu) +GO(gtk_gesture_set_window, vFpp) +GO(gtk_gesture_single_get_button, uFp) +GO(gtk_gesture_single_get_current_button, uFp) +GO(gtk_gesture_single_get_current_sequence, pFp) +GO(gtk_gesture_single_get_exclusive, iFp) +GO(gtk_gesture_single_get_touch_only, iFp) +GO(gtk_gesture_single_get_type, LFv) +GO(gtk_gesture_single_set_button, vFpu) +GO(gtk_gesture_single_set_exclusive, vFpi) +GO(gtk_gesture_single_set_touch_only, vFpi) +GO(gtk_gesture_stylus_get_axes, iFppp) +GO(gtk_gesture_stylus_get_axis, iFpup) +GO(gtk_gesture_stylus_get_device_tool, pFp) +GO(gtk_gesture_stylus_get_type, LFv) +GO(gtk_gesture_stylus_new, pFp) +GO(gtk_gesture_swipe_get_type, LFv) +GO(gtk_gesture_swipe_get_velocity, iFppp) +GO(gtk_gesture_swipe_new, pFp) +GO(gtk_gesture_ungroup, vFp) +GO(gtk_gesture_zoom_get_scale_delta, dFp) +GO(gtk_gesture_zoom_get_type, LFv) +GO(gtk_gesture_zoom_new, pFp) +GO(gtk_get_binary_age, uFv) GO(gtk_get_current_event, pFv) +GO(gtk_get_current_event_device, pFv) GO(gtk_get_current_event_state, iFp) GO(gtk_get_current_event_time, uFv) +GO(gtk_get_debug_flags, uFv) GO(gtk_get_default_language, pFv) GO(gtk_get_event_widget, pFp) -GO(gtk_get_binary_age, uFv) GO(gtk_get_interface_age, uFv) +GO(gtk_get_locale_direction, uFv) GO(gtk_get_major_version, uFv) -GO(gtk_get_minor_version, uFv) GO(gtk_get_micro_version, uFv) +GO(gtk_get_minor_version, uFv) GO(gtk_get_option_group, pFi) +//GO(gtk_glade_catalog_init, +GO(gtk_gl_area_attach_buffers, vFp) +GO(gtk_gl_area_get_auto_render, iFp) +GO(gtk_gl_area_get_context, pFp) +GO(gtk_gl_area_get_error, pFp) +GO(gtk_gl_area_get_has_alpha, iFp) +GO(gtk_gl_area_get_has_depth_buffer, iFp) +GO(gtk_gl_area_get_has_stencil_buffer, iFp) +GO(gtk_gl_area_get_required_version, vFppp) +GO(gtk_gl_area_get_type, LFv) +GO(gtk_gl_area_get_use_es, iFp) +GO(gtk_gl_area_make_current, vFp) +GO(gtk_gl_area_new, pFv) +GO(gtk_gl_area_queue_render, vFp) +GO(gtk_gl_area_set_auto_render, vFpi) +GO(gtk_gl_area_set_error, vFpp) +GO(gtk_gl_area_set_has_alpha, vFpi) +GO(gtk_gl_area_set_has_depth_buffer, vFpi) +GO(gtk_gl_area_set_has_stencil_buffer, vFpi) +GO(gtk_gl_area_set_required_version, vFpii) +GO(gtk_gl_area_set_use_es, vFpi) GO(gtk_grab_add, vFp) GO(gtk_grab_get_current, pFv) GO(gtk_grab_remove, vFp) +GO(gtk_gradient_add_color_stop, vFpdp) +GO(gtk_gradient_get_type, LFv) +GO(gtk_gradient_new_linear, pFdddd) +GO(gtk_gradient_new_radial, pFdddddd) +GO(gtk_gradient_ref, pFp) +GO(gtk_gradient_resolve, iFppp) +GO(gtk_gradient_resolve_for_context, pFpp) +GO(gtk_gradient_to_string, pFp) +GO(gtk_gradient_unref, vFp) GO(gtk_grid_attach, vFppiiii) +GO(gtk_grid_attach_next_to, vFpppuii) +GO(gtk_grid_get_baseline_row, iFp) +GO(gtk_grid_get_child_at, pFpii) +GO(gtk_grid_get_column_homogeneous, iFp) +GO(gtk_grid_get_column_spacing, uFp) +GO(gtk_grid_get_row_baseline_position, uFpi) +GO(gtk_grid_get_row_homogeneous, iFp) +GO(gtk_grid_get_row_spacing, uFp) GO(gtk_grid_get_type, LFv) +GO(gtk_grid_insert_column, vFpi) +GO(gtk_grid_insert_next_to, vFppu) +GO(gtk_grid_insert_row, vFpi) GO(gtk_grid_new, pFv) +GO(gtk_grid_remove_column, vFpi) +GO(gtk_grid_remove_row, vFpi) +GO(gtk_grid_set_baseline_row, vFpi) GO(gtk_grid_set_column_homogeneous, vFpi) GO(gtk_grid_set_column_spacing, vFpu) +GO(gtk_grid_set_row_baseline_position, vFpiu) GO(gtk_grid_set_row_homogeneous, vFpi) GO(gtk_grid_set_row_spacing, vFpu) GO(gtk_handle_box_get_child_detached, iFp) -GO(gtk_handle_box_get_handle_position, iFp) +GO(gtk_handle_box_get_handle_position, uFp) GO(gtk_handle_box_get_shadow_type, uFp) GO(gtk_handle_box_get_snap_edge, uFp) GO(gtk_handle_box_get_type, LFv) GO(gtk_handle_box_new, pFv) -GO(gtk_handle_box_set_handle_position, vFpi) +GO(gtk_handle_box_set_handle_position, vFpu) GO(gtk_handle_box_set_shadow_type, vFpu) GO(gtk_handle_box_set_snap_edge, vFpu) GO(gtk_hbox_get_type, LFv) GO(gtk_hbox_new, pFii) -GO(gtk_hbutton_box_get_layout_default, iFv) -GO(gtk_hbutton_box_get_spacing_default, iFv) GO(gtk_hbutton_box_get_type, LFv) GO(gtk_hbutton_box_new, pFv) -GO(gtk_hbutton_box_set_layout_default, vFi) -GO(gtk_hbutton_box_set_spacing_default, vFi) +//GO(gtk_header_bar_accessible_get_type, +GO(gtk_header_bar_get_custom_title, pFp) +GO(gtk_header_bar_get_decoration_layout, pFp) +GO(gtk_header_bar_get_has_subtitle, iFp) +GO(gtk_header_bar_get_show_close_button, iFp) +GO(gtk_header_bar_get_subtitle, pFp) +GO(gtk_header_bar_get_title, pFp) +GO(gtk_header_bar_get_type, LFv) GO(gtk_header_bar_new, pFv) -GO(gtk_header_bar_get_type, lFv) GO(gtk_header_bar_pack_end, vFpp) +GO(gtk_header_bar_pack_start, vFpp) +GO(gtk_header_bar_set_custom_title, vFpp) +GO(gtk_header_bar_set_decoration_layout, vFpp) +GO(gtk_header_bar_set_has_subtitle, vFpi) GO(gtk_header_bar_set_show_close_button, vFpi) +GO(gtk_header_bar_set_subtitle, vFpp) GO(gtk_header_bar_set_title, vFpp) GO(gtk_hpaned_get_type, LFv) -//GO(gtk_hpaned_new, -GO(gtk_hruler_get_type, LFv) -//GO(gtk_hruler_new, +GO(gtk_hpaned_new, pFv) GO(gtk_hscale_get_type, LFv) GO(gtk_hscale_new, pFp) GO(gtk_hscale_new_with_range, pFddd) @@ -1262,10 +1475,10 @@ GO(gtk_hsv_get_color, vFpppp) GO(gtk_hsv_get_metrics, vFppp) GO(gtk_hsv_get_type, LFv) GO(gtk_hsv_is_adjusting, iFp) -//GO(gtk_hsv_new, +GO(gtk_hsv_new, pFv) GO(gtk_hsv_set_color, vFpddd) GO(gtk_hsv_set_metrics, vFpii) -//GO(gtk_hsv_to_rgb, +GO(gtk_hsv_to_rgb, vFdddppp) GO(gtk_icon_factory_add, vFppp) GO(gtk_icon_factory_add_default, vFp) GO(gtk_icon_factory_get_type, LFv) @@ -1276,15 +1489,25 @@ GO(gtk_icon_factory_remove_default, vFp) GO(gtk_icon_info_copy, pFp) GO(gtk_icon_info_free, vFp) GO(gtk_icon_info_get_attach_points, iFppp) +GO(gtk_icon_info_get_base_scale, iFp) GO(gtk_icon_info_get_base_size, iFp) GO(gtk_icon_info_get_builtin_pixbuf, pFp) GO(gtk_icon_info_get_display_name, pFp) GO(gtk_icon_info_get_embedded_rect, iFpp) GO(gtk_icon_info_get_filename, pFp) GO(gtk_icon_info_get_type, LFv) +GO(gtk_icon_info_is_symbolic, iFp) GO(gtk_icon_info_load_icon, pFpp) +//GOM(gtk_icon_info_load_icon_async, vFpppp) +GO(gtk_icon_info_load_icon_finish, pFppp) GO(gtk_icon_info_load_surface, pFppp) +GO(gtk_icon_info_load_symbolic, pFppppppp) +//GOM(gtk_icon_info_load_symbolic_async, vFpppppppp) +GO(gtk_icon_info_load_symbolic_finish, pFpppp) GO(gtk_icon_info_load_symbolic_for_context, pFpppp) +//GOM(gtk_icon_info_load_symbolic_for_context_async, vFppppp) +GO(gtk_icon_info_load_symbolic_for_context_finish, pFpppp) +GO(gtk_icon_info_load_symbolic_for_style, pFppupp) GO(gtk_icon_info_new_for_pixbuf, pFpp) GO(gtk_icon_info_set_raw_coordinates, vFpi) GO(gtk_icon_lookup_flags_get_type, LFv) @@ -1296,6 +1519,8 @@ GO(gtk_icon_set_new, pFv) GO(gtk_icon_set_new_from_pixbuf, pFp) GO(gtk_icon_set_ref, pFp) GO(gtk_icon_set_render_icon, pFppuuupp) +GO(gtk_icon_set_render_icon_pixbuf, pFppu) +GO(gtk_icon_set_render_icon_surface, pFppuip) GO(gtk_icon_set_unref, vFp) GO(gtk_icon_size_from_name, uFp) GO(gtk_icon_size_get_name, pFu) @@ -1327,10 +1552,12 @@ GO(gtk_icon_source_set_size_wildcarded, vFpi) GO(gtk_icon_source_set_state, vFpu) GO(gtk_icon_source_set_state_wildcarded, vFpi) GO(gtk_icon_theme_add_builtin_icon, vFpip) +GO(gtk_icon_theme_add_resource_path, vFpp) GO(gtk_icon_theme_append_search_path, vFpp) GO(gtk_icon_theme_choose_icon, pFppiu) +GO(gtk_icon_theme_choose_icon_for_scale, pFppiiu) GO(gtk_icon_theme_error_get_type, LFv) -//GO(gtk_icon_theme_error_quark, +GO(gtk_icon_theme_error_quark, uFv) GO(gtk_icon_theme_get_default, pFv) GO(gtk_icon_theme_get_example_icon_name, pFp) GO(gtk_icon_theme_get_for_display, pFp) @@ -1342,20 +1569,26 @@ GO(gtk_icon_theme_has_icon, iFpp) GO(gtk_icon_theme_list_contexts, pFp) GO(gtk_icon_theme_list_icons, pFpp) GO(gtk_icon_theme_load_icon, pFppiup) +GO(gtk_icon_theme_load_icon_for_scale, pFppiiup) +GO(gtk_icon_theme_load_surface, pFppiipup) GO(gtk_icon_theme_lookup_by_gicon, pFppiu) +GO(gtk_icon_theme_lookup_by_gicon_for_scale, pFppiiu) GO(gtk_icon_theme_lookup_icon, pFppiu) GO(gtk_icon_theme_lookup_icon_for_scale, pFppiiu) GO(gtk_icon_theme_new, pFv) -//GO(gtk_icon_theme_prepend_search_path, +GO(gtk_icon_theme_prepend_search_path, vFpp) GO(gtk_icon_theme_rescan_if_needed, iFp) GO(gtk_icon_theme_set_custom_theme, vFpp) GO(gtk_icon_theme_set_screen, vFpp) GO(gtk_icon_theme_set_search_path, vFppi) +GO(gtk_icon_view_accessible_get_type, LFv) GO(gtk_icon_view_convert_widget_to_bin_window_coords, vFpiipp) GO(gtk_icon_view_create_drag_icon, pFpp) GO(gtk_icon_view_drop_position_get_type, LFv) GO(gtk_icon_view_enable_model_drag_dest, vFppiu) GO(gtk_icon_view_enable_model_drag_source, vFpupiu) +GO(gtk_icon_view_get_activate_on_single_click, iFp) +GO(gtk_icon_view_get_cell_rect, iFpppp) GO(gtk_icon_view_get_columns, iFp) GO(gtk_icon_view_get_column_spacing, iFp) GO(gtk_icon_view_get_cursor, iFppp) @@ -1370,7 +1603,6 @@ GO(gtk_icon_view_get_item_width, iFp) GO(gtk_icon_view_get_margin, iFp) GO(gtk_icon_view_get_markup_column, iFp) GO(gtk_icon_view_get_model, pFp) -GO(gtk_icon_view_get_orientation, iFp) GO(gtk_icon_view_get_path_at_pos, pFpii) GO(gtk_icon_view_get_pixbuf_column, iFp) GO(gtk_icon_view_get_reorderable, iFp) @@ -1385,12 +1617,14 @@ GO(gtk_icon_view_get_type, LFv) GO(gtk_icon_view_get_visible_range, iFppp) GO(gtk_icon_view_item_activated, vFpp) GO(gtk_icon_view_new, pFv) +GO(gtk_icon_view_new_with_area, pFp) GO(gtk_icon_view_new_with_model, pFp) GO(gtk_icon_view_path_is_selected, iFpp) GO(gtk_icon_view_scroll_to_path, vFppiff) GO(gtk_icon_view_select_all, vFp) -//GOM(gtk_icon_view_selected_foreach, vFpBp) +//GOM(gtk_icon_view_selected_foreach, vFppp) GO(gtk_icon_view_select_path, vFpp) +GO(gtk_icon_view_set_activate_on_single_click, vFpi) GO(gtk_icon_view_set_columns, vFpi) GO(gtk_icon_view_set_column_spacing, vFpi) GO(gtk_icon_view_set_cursor, vFpppi) @@ -1401,7 +1635,6 @@ GO(gtk_icon_view_set_item_width, vFpi) GO(gtk_icon_view_set_margin, vFpi) GO(gtk_icon_view_set_markup_column, vFpi) GO(gtk_icon_view_set_model, vFpp) -GO(gtk_icon_view_set_orientation, vFpi) GO(gtk_icon_view_set_pixbuf_column, vFpi) GO(gtk_icon_view_set_reorderable, vFpi) GO(gtk_icon_view_set_row_spacing, vFpi) @@ -1415,22 +1648,16 @@ GO(gtk_icon_view_unselect_all, vFp) GO(gtk_icon_view_unselect_path, vFpp) GO(gtk_icon_view_unset_model_drag_dest, vFp) GO(gtk_icon_view_unset_model_drag_source, vFp) -GO(gtk_identifier_get_type, LFv) -//GOM(gtk_idle_add, uFEBp) -//GOM(gtk_idle_add_full, uFEiBppB) -//GOM(gtk_idle_add_priority, uFEiBp) -GO(gtk_idle_remove, vFu) -GO(gtk_idle_remove_by_data, vFp) +//GO(gtk_identifier_get_type, +GO(gtk_image_accessible_get_type, LFv) +GO(gtk_image_cell_accessible_get_type, LFv) GO(gtk_image_clear, vFp) -GO(gtk_image_get, vFppp) GO(gtk_image_get_animation, pFp) GO(gtk_image_get_gicon, vFppp) GO(gtk_image_get_icon_name, vFppp) GO(gtk_image_get_icon_set, vFppp) -GO(gtk_image_get_image, vFppp) GO(gtk_image_get_pixbuf, pFp) GO(gtk_image_get_pixel_size, iFp) -GO(gtk_image_get_pixmap, vFppp) GO(gtk_image_get_stock, vFppp) GO(gtk_image_get_storage_type, uFp) GO(gtk_image_get_type, LFv) @@ -1450,26 +1677,25 @@ GO(gtk_image_new, pFv) GO(gtk_image_new_from_animation, pFp) GO(gtk_image_new_from_file, pFp) GO(gtk_image_new_from_gicon, pFpu) -GO(gtk_image_new_from_icon_name, pFpi) +GO(gtk_image_new_from_icon_name, pFpu) GO(gtk_image_new_from_icon_set, pFpu) -GO(gtk_image_new_from_image, pFpp) GO(gtk_image_new_from_pixbuf, pFp) -GO(gtk_image_new_from_pixmap, pFpp) -GO(gtk_image_new_from_stock, pFpi) -GO(gtk_image_set, vFppp) +GO(gtk_image_new_from_resource, pFp) +GO(gtk_image_new_from_stock, pFpu) +GO(gtk_image_new_from_surface, pFp) GO(gtk_image_set_from_animation, vFpp) -GO(gtk_image_set_from_file, vFppp) +GO(gtk_image_set_from_file, vFpp) GO(gtk_image_set_from_gicon, vFppu) GO(gtk_image_set_from_icon_name, vFppu) GO(gtk_image_set_from_icon_set, vFppu) -GO(gtk_image_set_from_image, vFppp) GO(gtk_image_set_from_pixbuf, vFpp) -GO(gtk_image_set_from_pixmap, vFppp) -GO(gtk_image_set_from_stock, vFppi) +GO(gtk_image_set_from_resource, vFpp) +GO(gtk_image_set_from_stock, vFppu) +GO(gtk_image_set_from_surface, vFpp) GO(gtk_image_set_pixel_size, vFpi) GO(gtk_image_type_get_type, LFv) GO(gtk_im_context_delete_surrounding, iFpii) -GO(gtk_im_context_filter_key, iFpippuuii) +GO(gtk_im_context_filter_key, iFpippuuui) GO(gtk_im_context_filter_keypress, iFpp) GO(gtk_im_context_focus_in, vFp) GO(gtk_im_context_focus_out, vFp) @@ -1482,6 +1708,7 @@ GO(gtk_im_context_set_client_window, vFpp) GO(gtk_im_context_set_cursor_location, vFpp) GO(gtk_im_context_set_surrounding, vFppii) GO(gtk_im_context_set_use_preedit, vFpi) +GO(gtk_im_context_simple_add_compose_file, vFpp) GO(gtk_im_context_simple_add_table, vFppii) GO(gtk_im_context_simple_get_type, LFv) GO(gtk_im_context_simple_new, pFv) @@ -1494,64 +1721,36 @@ GO(gtk_im_preedit_style_get_type, LFv) GO(gtk_im_status_style_get_type, LFv) GO(gtk_info_bar_add_action_widget, vFppi) GO(gtk_info_bar_add_button, pFppi) -//GO(gtk_info_bar_add_buttons, -//GO(gtk_info_bar_get_action_area, +//GOM(gtk_info_bar_add_buttons, vFppV) +GO(gtk_info_bar_get_action_area, pFp) GO(gtk_info_bar_get_content_area, pFp) GO(gtk_info_bar_get_message_type, uFp) +GO(gtk_info_bar_get_revealed, iFp) +GO(gtk_info_bar_get_show_close_button, iFp) GO(gtk_info_bar_get_type, LFv) GO(gtk_info_bar_new, pFv) -//GO(gtk_info_bar_new_with_buttons, +//GOM(gtk_info_bar_new_with_buttons, pFpV) GO(gtk_info_bar_response, vFpi) -//GO(gtk_info_bar_set_default_response, +GO(gtk_info_bar_set_default_response, vFpi) GO(gtk_info_bar_set_message_type, vFpu) GO(gtk_info_bar_set_response_sensitive, vFpii) +GO(gtk_info_bar_set_revealed, vFpi) +GO(gtk_info_bar_set_show_close_button, vFpi) GOM(gtk_init, vFEpp) -//GO(gtk_init_add, GOM(gtk_init_check, iFEpp) GOM(gtk_init_with_args, iFEpppppp) -//GOM(gtk_input_add_full, uFEiBBppB) -GO(gtk_input_dialog_get_type, LFv) -GO(gtk_input_dialog_new, pFv) GO(gtk_input_hints_get_type, LFv) GO(gtk_input_purpose_get_type, LFv) -GO(gtk_input_remove, vFu) GO(gtk_invisible_get_screen, pFp) GO(gtk_invisible_get_type, LFv) -//GO(gtk_invisible_new, +GO(gtk_invisible_new, pFv) GO(gtk_invisible_new_for_screen, pFp) GO(gtk_invisible_set_screen, vFpp) -//GO(gtk_item_deselect, -//GO(gtk_item_factories_path_delete, -//GO(gtk_item_factory_add_foreign, -//GO(gtk_item_factory_construct, -//GO(gtk_item_factory_create_item, -//GO(gtk_item_factory_create_items, -//GO(gtk_item_factory_create_items_ac, -//GO(gtk_item_factory_create_menu_entries, -//GO(gtk_item_factory_delete_entries, -//GO(gtk_item_factory_delete_entry, -//GO(gtk_item_factory_delete_item, -//GO(gtk_item_factory_from_path, -//GO(gtk_item_factory_from_widget, -//GO(gtk_item_factory_get_item, -//GO(gtk_item_factory_get_item_by_action, -GO(gtk_item_factory_get_type, LFv) -//GO(gtk_item_factory_get_widget, -//GO(gtk_item_factory_get_widget_by_action, -//GO(gtk_item_factory_new, -//GO(gtk_item_factory_path_from_widget, -//GO(gtk_item_factory_popup, -//GO(gtk_item_factory_popup_data, -//GO(gtk_item_factory_popup_data_from_widget, -//GO(gtk_item_factory_popup_with_data, -//GO(gtk_item_factory_set_translate_func, -GO(gtk_item_get_type, LFv) -//GO(gtk_item_select, -//GO(gtk_item_toggle, +GO(gtk_junction_sides_get_type, LFv) GO(gtk_justification_get_type, LFv) -//GOM(gtk_key_snooper_install, uFEBp) +//GOM(gtk_key_snooper_install, uFpp) GO(gtk_key_snooper_remove, vFu) -GO(gtk_label_get, vFpp) +GO(gtk_label_accessible_get_type, LFv) GO(gtk_label_get_angle, dFp) GO(gtk_label_get_attributes, pFp) GO(gtk_label_get_current_uri, pFp) @@ -1560,6 +1759,7 @@ GO(gtk_label_get_justify, uFp) GO(gtk_label_get_label, pFp) GO(gtk_label_get_layout, pFp) GO(gtk_label_get_layout_offsets, vFppp) +GO(gtk_label_get_lines, iFp) GO(gtk_label_get_line_wrap, iFp) GO(gtk_label_get_line_wrap_mode, uFp) GO(gtk_label_get_max_width_chars, iFp) @@ -1574,15 +1774,17 @@ GO(gtk_label_get_type, LFv) GO(gtk_label_get_use_markup, iFp) GO(gtk_label_get_use_underline, iFp) GO(gtk_label_get_width_chars, iFp) +GO(gtk_label_get_xalign, fFp) +GO(gtk_label_get_yalign, fFp) GO(gtk_label_new, pFp) GO(gtk_label_new_with_mnemonic, pFp) -GO(gtk_label_parse_uline, uFpp) GO(gtk_label_select_region, vFpii) GO(gtk_label_set_angle, vFpd) GO(gtk_label_set_attributes, vFpp) GO(gtk_label_set_ellipsize, vFpu) GO(gtk_label_set_justify, vFpu) GO(gtk_label_set_label, vFpp) +GO(gtk_label_set_lines, vFpi) GO(gtk_label_set_line_wrap, vFpi) GO(gtk_label_set_line_wrap_mode, vFpu) GO(gtk_label_set_markup, vFpp) @@ -1598,57 +1800,88 @@ GO(gtk_label_set_track_visited_links, vFpi) GO(gtk_label_set_use_markup, vFpi) GO(gtk_label_set_use_underline, vFpi) GO(gtk_label_set_width_chars, vFpi) -//GO(gtk_layout_freeze, +GO(gtk_label_set_xalign, vFpf) +GO(gtk_label_set_yalign, vFpf) GO(gtk_layout_get_bin_window, pFp) -//GO(gtk_layout_get_hadjustment, +GO(gtk_layout_get_hadjustment, pFp) GO(gtk_layout_get_size, vFppp) GO(gtk_layout_get_type, LFv) GO(gtk_layout_get_vadjustment, pFp) GO(gtk_layout_move, vFppii) GO(gtk_layout_new, pFpp) -//GO(gtk_layout_put, -//GO(gtk_layout_set_hadjustment, +GO(gtk_layout_put, vFppii) +GO(gtk_layout_set_hadjustment, vFpp) GO(gtk_layout_set_size, vFpuu) GO(gtk_layout_set_vadjustment, vFpp) -//GO(gtk_layout_thaw, -GO(gtk_level_bar_mode_get_type, LFv) +GO(gtk_level_bar_accessible_get_type, LFv) +GO(gtk_level_bar_add_offset_value, vFppd) +GO(gtk_level_bar_get_inverted, iFp) +GO(gtk_level_bar_get_max_value, dFp) +GO(gtk_level_bar_get_min_value, dFp) +GO(gtk_level_bar_get_mode, uFp) +GO(gtk_level_bar_get_offset_value, iFppp) GO(gtk_level_bar_get_type, LFv) +GO(gtk_level_bar_get_value, dFp) +GO(gtk_level_bar_mode_get_type, LFv) +GO(gtk_level_bar_new, pFv) +GO(gtk_level_bar_new_for_interval, pFdd) +GO(gtk_level_bar_remove_offset_value, vFpp) +GO(gtk_level_bar_set_inverted, vFpi) +GO(gtk_level_bar_set_max_value, vFpd) +GO(gtk_level_bar_set_min_value, vFpd) +GO(gtk_level_bar_set_mode, vFpu) +GO(gtk_level_bar_set_value, vFpd) GO(gtk_license_get_type, LFv) +GO(gtk_link_button_accessible_get_type, LFv) GO(gtk_link_button_get_type, LFv) GO(gtk_link_button_get_uri, pFp) GO(gtk_link_button_get_visited, iFp) GO(gtk_link_button_new, pFp) GO(gtk_link_button_new_with_label, pFpp) GO(gtk_link_button_set_uri, vFpp) -//GO(gtk_link_button_set_uri_hook, GO(gtk_link_button_set_visited, vFpi) -GO(gtk_list_append_items, vFpp) +GO(gtk_list_box_accessible_get_type, LFv) +//GOM(gtk_list_box_bind_model, vFppppp) +GO(gtk_list_box_drag_highlight_row, vFpp) +GO(gtk_list_box_drag_unhighlight_row, vFp) +GO(gtk_list_box_get_activate_on_single_click, iFp) +GO(gtk_list_box_get_adjustment, pFp) +GO(gtk_list_box_get_row_at_index, pFpi) +GO(gtk_list_box_get_row_at_y, pFpi) +GO(gtk_list_box_get_selected_row, pFp) +GO(gtk_list_box_get_selected_rows, pFp) +GO(gtk_list_box_get_selection_mode, uFp) GO(gtk_list_box_get_type, LFv) +GO(gtk_list_box_insert, vFppi) +GO(gtk_list_box_invalidate_filter, vFp) +GO(gtk_list_box_invalidate_headers, vFp) +GO(gtk_list_box_invalidate_sort, vFp) +GO(gtk_list_box_new, pFv) +GO(gtk_list_box_prepend, vFpp) +GO(gtk_list_box_row_accessible_get_type, LFv) +GO(gtk_list_box_row_changed, vFp) +GO(gtk_list_box_row_get_activatable, iFp) +GO(gtk_list_box_row_get_header, pFp) +GO(gtk_list_box_row_get_index, iFp) +GO(gtk_list_box_row_get_selectable, iFp) GO(gtk_list_box_row_get_type, LFv) -GO(gtk_list_box_set_header_func, vFppp) -GO(gtk_list_child_position, iFpp) -GO(gtk_list_clear_items, vFpii) -GO(gtk_list_end_drag_selection, vFp) -GO(gtk_list_end_selection, vFp) -GO(gtk_list_extend_selection, vFpifi) -GO(gtk_list_get_type, LFv) -GO(gtk_list_insert_items, vFppi) -GO(gtk_list_item_deselect, vFp) -GO(gtk_list_item_get_type, LFv) -GO(gtk_list_item_new, pFv) -GO(gtk_list_item_new_with_label, pFp) -GO(gtk_list_item_select, vFp) -GO(gtk_list_new, pFv) -GO(gtk_list_prepend_items, vFpp) -GO(gtk_list_remove_items, vFpp) -GO(gtk_list_remove_items_no_unref, vFpp) -GO(gtk_list_scroll_horizontal, vFpif) -GO(gtk_list_scroll_vertical, vFpif) -GO(gtk_list_select_all, vFp) -GO(gtk_list_select_child, vFpp) -GO(gtk_list_select_item, vFpi) -GO(gtk_list_set_selection_mode, vFpi) -GO(gtk_list_start_selection, vFp) +GO(gtk_list_box_row_is_selected, iFp) +GO(gtk_list_box_row_new, pFv) +GO(gtk_list_box_row_set_activatable, vFpi) +GO(gtk_list_box_row_set_header, vFpp) +GO(gtk_list_box_row_set_selectable, vFpi) +GO(gtk_list_box_select_all, vFp) +//GOM(gtk_list_box_selected_foreach, vFppp) +GO(gtk_list_box_select_row, vFpp) +GO(gtk_list_box_set_activate_on_single_click, vFpi) +GO(gtk_list_box_set_adjustment, vFpp) +//GOM(gtk_list_box_set_filter_func, vFpppp) +GOM(gtk_list_box_set_header_func, vFEpppp) +GO(gtk_list_box_set_placeholder, vFpp) +GO(gtk_list_box_set_selection_mode, vFpu) +//GOM(gtk_list_box_set_sort_func, vFpppp) +GO(gtk_list_box_unselect_all, vFp) +GO(gtk_list_box_unselect_row, vFpp) GO(gtk_list_store_append, vFpp) GO(gtk_list_store_clear, vFp) GO(gtk_list_store_get_type, LFv) @@ -1665,63 +1898,48 @@ GO(gtk_list_store_newv, pFip) GO(gtk_list_store_prepend, vFpp) GO(gtk_list_store_remove, iFpp) GO(gtk_list_store_reorder, vFpp) -//GO2(gtk_list_store_set, vFppV, gtk_list_store_set_valist) +GOM(gtk_list_store_set, vFEppV) GO(gtk_list_store_set_column_types, vFpip) -//GO(gtk_list_store_set_valist, vFppA) +GOM(gtk_list_store_set_valist, vFEppA) GO(gtk_list_store_set_value, vFppip) GO(gtk_list_store_set_valuesv, vFppppi) GO(gtk_list_store_swap, vFppp) -GO(gtk_list_toggle_add_mode, vFp) -GO(gtk_list_toggle_focus_row, vFp) -GO(gtk_list_toggle_row, vFpp) -GO(gtk_list_undo_selection, vFp) -GO(gtk_list_unselect_all, vFp) -GO(gtk_list_unselect_child, vFpp) -GO(gtk_list_unselect_item, vFpi) +GO(gtk_lock_button_accessible_get_type, LFv) +GO(gtk_lock_button_get_permission, pFp) +GO(gtk_lock_button_get_type, LFv) +GO(gtk_lock_button_new, pFp) +GO(gtk_lock_button_set_permission, vFpp) GO(gtk_main, vFv) GO(gtk_main_do_event, vFp) GO(gtk_main_iteration, iFv) GO(gtk_main_iteration_do, iFi) GO(gtk_main_level, uFv) GO(gtk_main_quit, vFv) -//GO(gtk_marshal_BOOLEAN__POINTER, -//GO(gtk_marshal_BOOLEAN__POINTER_INT_INT, -//GO(gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT, -//GO(gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT, -//GO(gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER, -//GO(gtk_marshal_BOOLEAN__VOID, -//GO(gtk_marshal_ENUM__ENUM, -//GO(gtk_marshal_INT__POINTER, -//GO(gtk_marshal_INT__POINTER_CHAR_CHAR, -//GO(gtk_marshal_VOID__ENUM_FLOAT, -//GO(gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN, -//GO(gtk_marshal_VOID__INT_INT, -//GO(gtk_marshal_VOID__INT_INT_POINTER, -//GO(gtk_marshal_VOID__POINTER_INT, -//GO(gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT, -//GO(gtk_marshal_VOID__POINTER_POINTER, -//GO(gtk_marshal_VOID__POINTER_POINTER_POINTER, -//GO(gtk_marshal_VOID__POINTER_POINTER_UINT_UINT, -//GO(gtk_marshal_VOID__POINTER_STRING_STRING, -//GO(gtk_marshal_VOID__POINTER_UINT, -//GO(gtk_marshal_VOID__POINTER_UINT_ENUM, -//GO(gtk_marshal_VOID__POINTER_UINT_UINT, -//GO(gtk_marshal_VOID__STRING_INT_POINTER, -//GO(gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER, -//GO(gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM, -//GO(gtk_marshal_VOID__UINT_STRING, -GO(gtk_match_type_get_type, LFv) +GO(gtk_menu_accessible_get_type, LFv) GO(gtk_menu_attach, vFppuuuu) GOM(gtk_menu_attach_to_widget, vFEppp) GO(gtk_menu_bar_get_child_pack_direction, uFp) -GO(gtk_menu_bar_get_pack_direction, iFp) +GO(gtk_menu_bar_get_pack_direction, uFp) GO(gtk_menu_bar_get_type, LFv) GO(gtk_menu_bar_new, pFv) +GO(gtk_menu_bar_new_from_model, pFp) GO(gtk_menu_bar_set_child_pack_direction, vFpu) -GO(gtk_menu_bar_set_pack_direction, vFpi) +GO(gtk_menu_bar_set_pack_direction, vFpu) +GO(gtk_menu_button_accessible_get_type, LFv) +GO(gtk_menu_button_get_align_widget, pFp) +GO(gtk_menu_button_get_direction, uFp) +GO(gtk_menu_button_get_menu_model, pFp) +GO(gtk_menu_button_get_popover, pFp) +GO(gtk_menu_button_get_popup, pFp) +GO(gtk_menu_button_get_type, LFv) +GO(gtk_menu_button_get_use_popover, iFp) GO(gtk_menu_button_new, pFv) +GO(gtk_menu_button_set_align_widget, vFpp) +GO(gtk_menu_button_set_direction, vFpu) GO(gtk_menu_button_set_menu_model, vFpp) -GO(gtk_menu_button_get_type, LFv) +GO(gtk_menu_button_set_popover, vFpp) +GO(gtk_menu_button_set_popup, vFpp) +GO(gtk_menu_button_set_use_popover, vFpi) GO(gtk_menu_detach, vFp) GO(gtk_menu_direction_type_get_type, LFv) GO(gtk_menu_get_accel_group, pFp) @@ -1734,29 +1952,37 @@ GO(gtk_menu_get_reserve_toggle_size, iFp) GO(gtk_menu_get_tearoff_state, iFp) GO(gtk_menu_get_title, pFp) GO(gtk_menu_get_type, LFv) +GO(gtk_menu_item_accessible_get_type, LFv) GO(gtk_menu_item_activate, vFp) GO(gtk_menu_item_deselect, vFp) GO(gtk_menu_item_get_accel_path, pFp) GO(gtk_menu_item_get_label, pFp) +GO(gtk_menu_item_get_reserve_indicator, iFp) GO(gtk_menu_item_get_right_justified, iFp) GO(gtk_menu_item_get_submenu, pFp) GO(gtk_menu_item_get_type, LFv) -GO(gtk_menu_item_get_use_underline, vFpi) +GO(gtk_menu_item_get_use_underline, iFp) GO(gtk_menu_item_new, pFv) GO(gtk_menu_item_new_with_label, pFp) GO(gtk_menu_item_new_with_mnemonic, pFp) -GO(gtk_menu_item_remove_submenu, pFp) GO(gtk_menu_item_select, vFp) GO(gtk_menu_item_set_accel_path, vFpp) GO(gtk_menu_item_set_label, vFpp) +GO(gtk_menu_item_set_reserve_indicator, vFpi) GO(gtk_menu_item_set_right_justified, vFpi) GO(gtk_menu_item_set_submenu, vFpp) GO(gtk_menu_item_set_use_underline, vFpi) GO(gtk_menu_item_toggle_size_allocate, vFpi) GO(gtk_menu_item_toggle_size_request, vFpp) GO(gtk_menu_new, pFv) +GO(gtk_menu_new_from_model, pFp) +GO(gtk_menu_place_on_monitor, vFpp) GO(gtk_menu_popdown, vFp) GOM(gtk_menu_popup, vFEpppppuu) +GO(gtk_menu_popup_at_pointer, vFpp) +GO(gtk_menu_popup_at_rect, vFpppuup) +GO(gtk_menu_popup_at_widget, vFppuup) +//GOM(gtk_menu_popup_for_device, vFpppppppuu) GO(gtk_menu_reorder_child, vFppi) GO(gtk_menu_reposition, vFp) GO(gtk_menu_set_accel_group, vFpp) @@ -1767,11 +1993,15 @@ GO(gtk_menu_set_reserve_toggle_size, vFpi) GO(gtk_menu_set_screen, vFpp) GO(gtk_menu_set_tearoff_state, vFpi) GO(gtk_menu_set_title, vFpp) +GO(gtk_menu_shell_accessible_get_type, LFv) GO(gtk_menu_shell_activate_item, vFppi) GO(gtk_menu_shell_append, vFpp) -//GO(gtk_menu_shell_cancel, -//GO(gtk_menu_shell_deactivate, -//GO(gtk_menu_shell_deselect, +GO(gtk_menu_shell_bind_model, vFpppi) +GO(gtk_menu_shell_cancel, vFp) +GO(gtk_menu_shell_deactivate, vFp) +GO(gtk_menu_shell_deselect, vFp) +GO(gtk_menu_shell_get_parent_shell, pFp) +GO(gtk_menu_shell_get_selected_item, pFp) GO(gtk_menu_shell_get_take_focus, iFp) GO(gtk_menu_shell_get_type, LFv) GO(gtk_menu_shell_insert, vFppi) @@ -1782,10 +2012,9 @@ GO(gtk_menu_shell_set_take_focus, vFpi) GO(gtk_menu_tool_button_get_menu, pFp) GO(gtk_menu_tool_button_get_type, LFv) GO(gtk_menu_tool_button_new, pFpp) -//GO(gtk_menu_tool_button_new_from_stock, -//GO(gtk_menu_tool_button_set_arrow_tooltip, +GO(gtk_menu_tool_button_new_from_stock, pFp) GO(gtk_menu_tool_button_set_arrow_tooltip_markup, vFpp) -//GO(gtk_menu_tool_button_set_arrow_tooltip_text, +GO(gtk_menu_tool_button_set_arrow_tooltip_text, vFpp) GO(gtk_menu_tool_button_set_menu, vFpp) GOM(gtk_message_dialog_format_secondary_markup, vFEppV) GOM(gtk_message_dialog_format_secondary_text, vFEppV) @@ -1797,12 +2026,13 @@ GO(gtk_message_dialog_new_with_markup, pFpuiippppppppppp) // vaarg GO(gtk_message_dialog_set_image, vFpp) GO(gtk_message_dialog_set_markup, vFpp) GO(gtk_message_type_get_type, LFv) -GO(gtk_metric_type_get_type, LFv) GO(gtk_misc_get_alignment, vFppp) GO(gtk_misc_get_padding, vFppp) GO(gtk_misc_get_type, LFv) GO(gtk_misc_set_alignment, vFpff) GO(gtk_misc_set_padding, vFpii) +GO(gtk_model_button_get_type, LFv) +GO(gtk_model_button_new, pFv) GO(gtk_mount_operation_get_parent, pFp) GO(gtk_mount_operation_get_screen, pFp) GO(gtk_mount_operation_get_type, LFv) @@ -1815,6 +2045,7 @@ GO(gtk_native_dialog_destroy, vFp) GO(gtk_native_dialog_get_modal, iFp) GO(gtk_native_dialog_get_title, pFp) GO(gtk_native_dialog_get_transient_for, pFp) +GO(gtk_native_dialog_get_type, LFv) GO(gtk_native_dialog_get_visible, iFp) GO(gtk_native_dialog_hide, vFp) GO(gtk_native_dialog_run, iFp) @@ -1823,12 +2054,12 @@ GO(gtk_native_dialog_set_title, vFpp) GO(gtk_native_dialog_set_transient_for, vFpp) GO(gtk_native_dialog_show, vFp) GO(gtk_native_get_surface, pFp) +GO(gtk_notebook_accessible_get_type, LFv) GO(gtk_notebook_append_page, iFppp) GO(gtk_notebook_append_page_menu, iFpppp) +GO(gtk_notebook_detach_tab, vFpp) GO(gtk_notebook_get_action_widget, pFpu) GO(gtk_notebook_get_current_page, iFp) -GO(gtk_notebook_get_group, pFp) -GO(gtk_notebook_get_group_id, iFp) GO(gtk_notebook_get_group_name, pFp) GO(gtk_notebook_get_menu_label, pFpp) GO(gtk_notebook_get_menu_label_text, pFpp) @@ -1849,183 +2080,197 @@ GO(gtk_notebook_insert_page, iFpppi) GO(gtk_notebook_insert_page_menu, iFppppi) GO(gtk_notebook_new, pFv) GO(gtk_notebook_next_page, vFp) +GO(gtk_notebook_page_accessible_get_type, LFv) +GO(gtk_notebook_page_accessible_invalidate, vFp) +GO(gtk_notebook_page_accessible_new, pFpp) GO(gtk_notebook_page_num, iFpp) GO(gtk_notebook_popup_disable, vFp) GO(gtk_notebook_popup_enable, vFp) GO(gtk_notebook_prepend_page, iFppp) GO(gtk_notebook_prepend_page_menu, iFpppp) GO(gtk_notebook_prev_page, vFp) -GO(gtk_notebook_query_tab_label_packing, vFppppp) GO(gtk_notebook_remove_page, vFpi) GO(gtk_notebook_reorder_child, vFppi) GO(gtk_notebook_set_action_widget, vFppu) GO(gtk_notebook_set_current_page, vFpi) -GO(gtk_notebook_set_group, vFpp) -GO(gtk_notebook_set_group_id, vFpi) GO(gtk_notebook_set_group_name, vFpp) -GO(gtk_notebook_set_homogeneous_tabs, vFpi) GO(gtk_notebook_set_menu_label, vFppp) GO(gtk_notebook_set_menu_label_text, vFppp) GO(gtk_notebook_set_scrollable, vFpi) GO(gtk_notebook_set_show_border, vFpi) GO(gtk_notebook_set_show_tabs, vFpi) -GO(gtk_notebook_set_tab_border, vFpu) GO(gtk_notebook_set_tab_detachable, vFppi) -GO(gtk_notebook_set_tab_hborder, vFpu) GO(gtk_notebook_set_tab_label, vFppp) -GO(gtk_notebook_set_tab_label_packing, vFppiii) GO(gtk_notebook_set_tab_label_text, vFppp) GO(gtk_notebook_set_tab_pos, vFpu) GO(gtk_notebook_set_tab_reorderable, vFppi) -GO(gtk_notebook_set_tab_vborder, vFpu) -//GOM(gtk_notebook_set_window_creation_hook, pFEppp) GO(gtk_notebook_tab_get_type, LFv) GO(gtk_number_up_layout_get_type, LFv) -GO(gtk_object_add_arg_type, vFpiuu) -GO(gtk_object_destroy, vFp) -GO(gtk_object_flags_get_type, LFv) -GO(gtk_object_get, vFppppppppppp) // vaarg -GO(gtk_object_get_data, pFpp) -GO(gtk_object_get_data_by_id, pFpp) -GO(gtk_object_get_type, LFv) -GO(gtk_object_get_user_data, pFp) -GO(gtk_object_new, pFppppppppppp) //vaarg -GO(gtk_object_ref, pFp) -GO(gtk_object_remove_data, vFpp) -GO(gtk_object_remove_data_by_id, vFpp) -GO(gtk_object_remove_no_notify, vFpp) -GO(gtk_object_remove_no_notify_by_id, vFpp) -GO(gtk_object_set, vFppppppppppp) //vaarg -GO(gtk_object_set_data, vFppp) -GO(gtk_object_set_data_by_id, vFppp) -//GOM(gtk_object_set_data_by_id_full, vFEpppp) -GOM(gtk_object_set_data_full, vFEpppp) -GO(gtk_object_set_user_data, vFpp) -GO(gtk_object_sink, vFp) -GO(gtk_object_unref, vFp) -//GOM(gtk_object_weakref, vFEppp) -//GOM(gtk_object_weakunref, vFEppp) +GO(gtk_numerable_icon_get_background_gicon, pFp) +GO(gtk_numerable_icon_get_background_icon_name, pFp) +GO(gtk_numerable_icon_get_count, iFp) +GO(gtk_numerable_icon_get_label, pFp) +GO(gtk_numerable_icon_get_style_context, pFp) +GO(gtk_numerable_icon_get_type, LFv) +GO(gtk_numerable_icon_new, pFp) +GO(gtk_numerable_icon_new_with_style_context, pFpp) +GO(gtk_numerable_icon_set_background_gicon, vFpp) +GO(gtk_numerable_icon_set_background_icon_name, vFpp) +GO(gtk_numerable_icon_set_count, vFpi) +GO(gtk_numerable_icon_set_label, vFpp) +GO(gtk_numerable_icon_set_style_context, vFpp) GO(gtk_offscreen_window_get_pixbuf, pFp) -GO(gtk_offscreen_window_get_pixmap, pFp) +GO(gtk_offscreen_window_get_surface, pFp) GO(gtk_offscreen_window_get_type, LFv) GO(gtk_offscreen_window_new, pFv) -GO(gtk_old_editable_changed, vFp) -GO(gtk_old_editable_claim_selection, vFpiu) -GO(gtk_old_editable_get_type, LFv) -GO(gtk_option_menu_get_history, iFp) -GO(gtk_option_menu_get_menu, pFp) -GO(gtk_option_menu_get_type, LFv) -GO(gtk_option_menu_new, pFv) -GO(gtk_option_menu_remove_menu, vFp) -GO(gtk_option_menu_set_history, vFpu) -GO(gtk_option_menu_set_menu, vFpp) GO(gtk_orientable_get_orientation, uFp) GO(gtk_orientable_get_type, LFv) GO(gtk_orientable_set_orientation, vFpu) GO(gtk_orientation_get_type, LFv) GO(gtk_overlay_add_overlay, vFpp) +GO(gtk_overlay_get_overlay_pass_through, iFpp) GO(gtk_overlay_get_type, LFv) +GO(gtk_overlay_new, pFv) +GO(gtk_overlay_reorder_overlay, vFppi) +GO(gtk_overlay_set_overlay_pass_through, vFppi) GO(gtk_pack_direction_get_type, LFv) GO(gtk_pack_type_get_type, LFv) +GO(gtk_pad_action_type_get_type, LFv) +GO(gtk_pad_controller_get_type, LFv) +GO(gtk_pad_controller_new, pFppp) +GO(gtk_pad_controller_set_action, vFpuiipp) +GO(gtk_pad_controller_set_action_entries, vFppi) GO(gtk_page_orientation_get_type, LFv) GO(gtk_page_set_get_type, LFv) GO(gtk_page_setup_copy, pFp) -//GO(gtk_page_setup_get_bottom_margin, -GO(gtk_page_setup_get_left_margin, dFpi) +GO(gtk_page_setup_get_bottom_margin, dFpu) +GO(gtk_page_setup_get_left_margin, dFpu) GO(gtk_page_setup_get_orientation, uFp) GO(gtk_page_setup_get_page_height, dFpu) -GO(gtk_page_setup_get_page_width, dFpi) -GO(gtk_page_setup_get_paper_height, dFpi) +GO(gtk_page_setup_get_page_width, dFpu) +GO(gtk_page_setup_get_paper_height, dFpu) GO(gtk_page_setup_get_paper_size, pFp) -GO(gtk_page_setup_get_paper_width, dFpi) -GO(gtk_page_setup_get_right_margin, dFpi) -GO(gtk_page_setup_get_top_margin, dFpi) +GO(gtk_page_setup_get_paper_width, dFpu) +GO(gtk_page_setup_get_right_margin, dFpu) +GO(gtk_page_setup_get_top_margin, dFpu) GO(gtk_page_setup_get_type, LFv) -//GO(gtk_page_setup_load_file, +GO(gtk_page_setup_load_file, iFppp) GO(gtk_page_setup_load_key_file, iFpppp) GO(gtk_page_setup_new, pFv) GO(gtk_page_setup_new_from_file, pFpp) +GO(gtk_page_setup_new_from_gvariant, pFp) GO(gtk_page_setup_new_from_key_file, pFppp) -//GO(gtk_page_setup_set_bottom_margin, -//GO(gtk_page_setup_set_left_margin, +GO(gtk_page_setup_set_bottom_margin, vFpdu) +GO(gtk_page_setup_set_left_margin, vFpdu) GO(gtk_page_setup_set_orientation, vFpu) GO(gtk_page_setup_set_paper_size, vFpp) GO(gtk_page_setup_set_paper_size_and_default_margins, vFpp) GO(gtk_page_setup_set_right_margin, vFpdu) -//GO(gtk_page_setup_set_top_margin, +GO(gtk_page_setup_set_top_margin, vFpdu) GO(gtk_page_setup_to_file, iFppp) +GO(gtk_page_setup_to_gvariant, pFp) GO(gtk_page_setup_to_key_file, vFppp) -//GO(gtk_page_setup_unix_dialog_get_page_setup, -//GO(gtk_page_setup_unix_dialog_get_print_settings, +GO(gtk_page_setup_unix_dialog_get_page_setup, pFp) +GO(gtk_page_setup_unix_dialog_get_print_settings, pFp) GO(gtk_page_setup_unix_dialog_get_type, LFv) -//GO(gtk_page_setup_unix_dialog_new, -//GO(gtk_page_setup_unix_dialog_set_page_setup, -//GO(gtk_page_setup_unix_dialog_set_print_settings, +GO(gtk_page_setup_unix_dialog_new, pFpp) +GO(gtk_page_setup_unix_dialog_set_page_setup, vFpp) +GO(gtk_page_setup_unix_dialog_set_print_settings, vFpp) GO(gtk_paint_arrow, vFppuuppuiiiii) -GO(gtk_paint_box, vFppiipppiiii) +GO(gtk_paint_box, vFppuuppiiii) GO(gtk_paint_box_gap, vFppuuppiiiiuii) -GO(gtk_paint_check, vFppiipppiiii) -GO(gtk_paint_diamond, vFppiipppiiii) +GO(gtk_paint_check, vFppuuppiiii) +GO(gtk_paint_diamond, vFppuuppiiii) GO(gtk_paint_expander, vFppuppiiu) GO(gtk_paint_extension, vFppuuppiiiiu) -GO(gtk_paint_flat_box, vFppiipppiiii) +GO(gtk_paint_flat_box, vFppuuppiiii) GO(gtk_paint_focus, vFppuppiiii) GO(gtk_paint_handle, vFppuuppiiiiu) -GO(gtk_paint_hline, vFppipppiii) +GO(gtk_paint_hline, vFppuppiii) GO(gtk_paint_layout, vFppuippiip) -GO(gtk_paint_option, vFppiipppiiii) -GO(gtk_paint_polygon, vFppiippppii) +GO(gtk_paint_option, vFppuuppiiii) GO(gtk_paint_resize_grip, vFppuppuiiii) -GO(gtk_paint_shadow, vFppiipppiiii) -GO(gtk_paint_shadow_gap, vFppiipppiiiiiii) -GO(gtk_paint_slider, vFppiipppiiiii) +GO(gtk_paint_shadow, vFppuuppiiii) +GO(gtk_paint_shadow_gap, vFppuuppiiiiuii) +GO(gtk_paint_slider, vFppuuppiiiiu) GO(gtk_paint_spinner, vFppuppuiiii) -GO(gtk_paint_string, vFppipppiip) GO(gtk_paint_tab, vFppuuppiiii) GO(gtk_paint_vline, vFppuppiii) +GO(gtk_pan_direction_get_type, LFv) +GO(gtk_paned_accessible_get_type, LFv) GO(gtk_paned_add1, vFpp) GO(gtk_paned_add2, vFpp) -GO(gtk_paned_compute_position, vFpiii) GO(gtk_paned_get_child1, pFp) GO(gtk_paned_get_child2, pFp) GO(gtk_paned_get_handle_window, pFp) GO(gtk_paned_get_position, iFp) GO(gtk_paned_get_type, LFv) -GO(gtk_paned_new, pFi) +GO(gtk_paned_get_wide_handle, iFp) +GO(gtk_paned_new, pFu) GO(gtk_paned_pack1, vFppii) GO(gtk_paned_pack2, vFppii) GO(gtk_paned_set_position, vFpi) +GO(gtk_paned_set_wide_handle, vFpi) GO(gtk_paper_size_copy, pFp) GO(gtk_paper_size_free, vFp) GO(gtk_paper_size_get_default, pFv) -GO(gtk_paper_size_get_default_bottom_margin, dFpi) -GO(gtk_paper_size_get_default_left_margin, dFpi) +GO(gtk_paper_size_get_default_bottom_margin, dFpu) +GO(gtk_paper_size_get_default_left_margin, dFpu) GO(gtk_paper_size_get_default_right_margin, dFpu) -GO(gtk_paper_size_get_default_top_margin, dFpi) +GO(gtk_paper_size_get_default_top_margin, dFpu) GO(gtk_paper_size_get_display_name, pFp) -GO(gtk_paper_size_get_height, dFpi) +GO(gtk_paper_size_get_height, dFpu) GO(gtk_paper_size_get_name, pFp) GO(gtk_paper_size_get_paper_sizes, pFi) GO(gtk_paper_size_get_ppd_name, pFp) GO(gtk_paper_size_get_type, LFv) -GO(gtk_paper_size_get_width, dFpi) +GO(gtk_paper_size_get_width, dFpu) GO(gtk_paper_size_is_custom, iFp) GO(gtk_paper_size_is_equal, iFpp) +GO(gtk_paper_size_is_ipp, iFp) GO(gtk_paper_size_new, pFp) GO(gtk_paper_size_new_custom, pFppddu) +GO(gtk_paper_size_new_from_gvariant, pFp) +GO(gtk_paper_size_new_from_ipp, pFpdd) GO(gtk_paper_size_new_from_key_file, pFppp) GO(gtk_paper_size_new_from_ppd, pFppdd) GO(gtk_paper_size_set_size, vFpddu) +GO(gtk_paper_size_to_gvariant, pFp) GO(gtk_paper_size_to_key_file, vFppp) GO(gtk_parse_args, iFpp) GO(gtk_path_bar_get_type, LFv) GO(gtk_path_priority_type_get_type, LFv) GO(gtk_path_type_get_type, LFv) -GO(gtk_pixmap_get, vFppp) -GO(gtk_pixmap_get_type, LFv) -GO(gtk_pixmap_new, pFpp) -GO(gtk_pixmap_set, vFppp) -GO(gtk_pixmap_set_build_insensitive, vFpi) +GO(gtk_places_open_flags_get_type, LFv) +GO(gtk_places_sidebar_add_shortcut, vFpp) +GO(gtk_places_sidebar_get_local_only, iFp) +GO(gtk_places_sidebar_get_location, pFp) +GO(gtk_places_sidebar_get_nth_bookmark, pFpi) +GO(gtk_places_sidebar_get_open_flags, uFp) +GO(gtk_places_sidebar_get_show_connect_to_server, iFp) +GO(gtk_places_sidebar_get_show_desktop, iFp) +GO(gtk_places_sidebar_get_show_enter_location, iFp) +GO(gtk_places_sidebar_get_show_other_locations, iFp) +GO(gtk_places_sidebar_get_show_recent, iFp) +GO(gtk_places_sidebar_get_show_starred_location, iFp) +GO(gtk_places_sidebar_get_show_trash, iFp) +GO(gtk_places_sidebar_get_type, LFv) +GO(gtk_places_sidebar_list_shortcuts, pFp) +GO(gtk_places_sidebar_new, pFv) +GO(gtk_places_sidebar_remove_shortcut, vFpp) +GO(gtk_places_sidebar_set_drop_targets_visible, vFpip) +GO(gtk_places_sidebar_set_local_only, vFpi) +GO(gtk_places_sidebar_set_location, vFpp) +GO(gtk_places_sidebar_set_open_flags, vFpu) +GO(gtk_places_sidebar_set_show_connect_to_server, vFpi) +GO(gtk_places_sidebar_set_show_desktop, vFpi) +GO(gtk_places_sidebar_set_show_enter_location, vFpi) +GO(gtk_places_sidebar_set_show_other_locations, vFpi) +GO(gtk_places_sidebar_set_show_recent, vFpi) +GO(gtk_places_sidebar_set_show_starred_location, vFpi) +GO(gtk_places_sidebar_set_show_trash, vFpi) +GO(gtk_plug_accessible_get_id, pFp) +GO(gtk_plug_accessible_get_type, LFv) GO(gtk_plug_construct, vFpp) GO(gtk_plug_construct_for_display, vFppp) GO(gtk_plug_get_embedded, iFp) @@ -2035,25 +2280,32 @@ GO(gtk_plug_get_type, LFv) GO(gtk_plug_new, pFp) GO(gtk_plug_new_for_display, pFpp) GO(gtk_policy_type_get_type, LFv) +GO(gtk_popover_accessible_get_type, LFv) +GO(gtk_popover_bind_model, vFppp) +GO(gtk_popover_constraint_get_type, LFv) +GO(gtk_popover_get_constrain_to, uFp) +GO(gtk_popover_get_default_widget, pFp) +GO(gtk_popover_get_modal, iFp) +GO(gtk_popover_get_pointing_to, iFpp) +GO(gtk_popover_get_position, uFp) +GO(gtk_popover_get_relative_to, pFp) +GO(gtk_popover_get_transitions_enabled, iFp) GO(gtk_popover_get_type, LFv) +GO(gtk_popover_menu_get_type, LFv) +GO(gtk_popover_menu_new, pFv) +GO(gtk_popover_menu_open_submenu, vFpp) +GO(gtk_popover_new, pFp) +GO(gtk_popover_new_from_model, pFpp) +GO(gtk_popover_popdown, vFp) +GO(gtk_popover_popup, vFp) +GO(gtk_popover_set_constrain_to, vFpu) +GO(gtk_popover_set_default_widget, vFpp) +GO(gtk_popover_set_modal, vFpi) +GO(gtk_popover_set_pointing_to, vFpp) +GO(gtk_popover_set_position, vFpu) +GO(gtk_popover_set_relative_to, vFpp) +GO(gtk_popover_set_transitions_enabled, vFpi) GO(gtk_position_type_get_type, LFv) -//GO(gtk_preview_draw_row, -//GO(gtk_preview_get_cmap, -//GO(gtk_preview_get_info, -GO(gtk_preview_get_type, LFv) -//GO(gtk_preview_get_visual, -//GO(gtk_preview_new, -//GO(gtk_preview_put, -//GO(gtk_preview_reset, -//GO(gtk_preview_set_color_cube, -//GO(gtk_preview_set_dither, -//GO(gtk_preview_set_expand, -//GO(gtk_preview_set_gamma, -//GO(gtk_preview_set_install_cmap, -//GO(gtk_preview_set_reserved, -//GO(gtk_preview_size, -GO(gtk_preview_type_get_type, LFv) -//GO(gtk_preview_uninit, //GO(gtk_print_backend_add_printer, //GO(gtk_print_backend_destroy, //GO(gtk_print_backend_error_quark, @@ -2070,39 +2322,39 @@ GO(gtk_print_capabilities_get_type, LFv) GO(gtk_print_context_create_pango_context, pFp) GO(gtk_print_context_create_pango_layout, pFp) GO(gtk_print_context_get_cairo_context, pFp) -//GO(gtk_print_context_get_dpi_x, +GO(gtk_print_context_get_dpi_x, dFp) GO(gtk_print_context_get_dpi_y, dFp) GO(gtk_print_context_get_hard_margins, iFppppp) -//GO(gtk_print_context_get_height, +GO(gtk_print_context_get_height, dFp) GO(gtk_print_context_get_page_setup, pFp) GO(gtk_print_context_get_pango_fontmap, pFp) GO(gtk_print_context_get_type, LFv) -//GO(gtk_print_context_get_width, +GO(gtk_print_context_get_width, dFp) GO(gtk_print_context_set_cairo_context, vFppdd) GO(gtk_print_duplex_get_type, LFv) -//GO(gtk_printer_accepts_pdf, -//GO(gtk_printer_accepts_ps, -//GO(gtk_printer_compare, -//GO(gtk_printer_get_backend, -//GO(gtk_printer_get_capabilities, +GO(gtk_printer_accepts_pdf, iFp) +GO(gtk_printer_accepts_ps, iFp) +GO(gtk_printer_compare, iFpp) +GO(gtk_printer_get_backend, pFp) +GO(gtk_printer_get_capabilities, uFp) GO(gtk_printer_get_default_page_size, pFp) -//GO(gtk_printer_get_description, -//GO(gtk_printer_get_hard_margins, -//GO(gtk_printer_get_icon_name, -//GO(gtk_printer_get_job_count, -//GO(gtk_printer_get_location, +GO(gtk_printer_get_description, pFp) +GO(gtk_printer_get_hard_margins, iFppppp) +GO(gtk_printer_get_icon_name, pFp) +GO(gtk_printer_get_job_count, iFp) +GO(gtk_printer_get_location, pFp) GO(gtk_printer_get_name, pFp) -//GO(gtk_printer_get_state_message, +GO(gtk_printer_get_state_message, pFp) GO(gtk_printer_get_type, LFv) -//GO(gtk_printer_has_details, -//GO(gtk_printer_is_accepting_jobs, -//GO(gtk_printer_is_active, +GO(gtk_printer_has_details, iFp) +GO(gtk_printer_is_accepting_jobs, iFp) +GO(gtk_printer_is_active, iFp) GO(gtk_printer_is_default, iFp) //GO(gtk_printer_is_new, -//GO(gtk_printer_is_paused, -//GO(gtk_printer_is_virtual, -//GO(gtk_printer_list_papers, -//GO(gtk_printer_new, +GO(gtk_printer_is_paused, iFp) +GO(gtk_printer_is_virtual, iFp) +GO(gtk_printer_list_papers, pFp) +GO(gtk_printer_new, pFppi) //GO(gtk_printer_option_allocate_choices, //GO(gtk_printer_option_choices_from_array, //GO(gtk_printer_option_clear_has_conflict, @@ -2129,9 +2381,9 @@ GO(gtk_printer_option_widget_get_type, LFv) //GO(gtk_printer_option_widget_has_external_label, //GO(gtk_printer_option_widget_new, //GO(gtk_printer_option_widget_set_source, -//GO(gtk_printer_request_details, +GO(gtk_printer_request_details, vFp) GO(gtk_print_error_get_type, LFv) -//GO(gtk_print_error_quark, +GO(gtk_print_error_quark, uFv) //GO(gtk_printer_set_accepts_pdf, //GO(gtk_printer_set_accepts_ps, //GO(gtk_printer_set_description, @@ -2145,76 +2397,97 @@ GO(gtk_print_error_get_type, LFv) //GO(gtk_printer_set_job_count, //GO(gtk_printer_set_location, //GO(gtk_printer_set_state_message, -//GO(gtk_print_job_get_printer, -//GO(gtk_print_job_get_settings, -//GO(gtk_print_job_get_status, -//GO(gtk_print_job_get_surface, -//GO(gtk_print_job_get_title, -//GO(gtk_print_job_get_track_print_status, +GO(gtk_print_job_get_collate, iFp) +GO(gtk_print_job_get_num_copies, iFp) +GO(gtk_print_job_get_n_up, uFp) +GO(gtk_print_job_get_n_up_layout, uFp) +GO(gtk_print_job_get_page_ranges, pFpp) +GO(gtk_print_job_get_pages, uFp) +GO(gtk_print_job_get_page_set, uFp) +GO(gtk_print_job_get_printer, pFp) +GO(gtk_print_job_get_reverse, iFp) +GO(gtk_print_job_get_rotate, iFp) +GO(gtk_print_job_get_scale, dFp) +GO(gtk_print_job_get_settings, pFp) +GO(gtk_print_job_get_status, uFp) +GO(gtk_print_job_get_surface, pFpp) +GO(gtk_print_job_get_title, pFp) +GO(gtk_print_job_get_track_print_status, iFp) GO(gtk_print_job_get_type, LFv) GO(gtk_print_job_new, pFpppp) GOM(gtk_print_job_send, vFEpppp) +GO(gtk_print_job_set_collate, vFpi) +GO(gtk_print_job_set_num_copies, vFpi) +GO(gtk_print_job_set_n_up, vFpu) +GO(gtk_print_job_set_n_up_layout, vFpu) +GO(gtk_print_job_set_page_ranges, vFppi) +GO(gtk_print_job_set_pages, vFpu) +GO(gtk_print_job_set_page_set, vFpu) +GO(gtk_print_job_set_reverse, vFpi) +GO(gtk_print_job_set_rotate, vFpi) +GO(gtk_print_job_set_scale, vFpd) +GO(gtk_print_job_set_source_fd, iFpip) GO(gtk_print_job_set_source_file, iFppp) //GO(gtk_print_job_set_status, -//GO(gtk_print_job_set_track_print_status, +GO(gtk_print_job_set_track_print_status, vFpi) GO(gtk_print_operation_action_get_type, LFv) -//GO(gtk_print_operation_cancel, -//GO(gtk_print_operation_draw_page_finish, +GO(gtk_print_operation_cancel, vFp) +GO(gtk_print_operation_draw_page_finish, vFp) GO(gtk_print_operation_get_default_page_setup, pFp) GO(gtk_print_operation_get_embed_page_setup, iFp) GO(gtk_print_operation_get_error, vFpp) -//GO(gtk_print_operation_get_has_selection, +GO(gtk_print_operation_get_has_selection, iFp) GO(gtk_print_operation_get_n_pages_to_print, iFp) GO(gtk_print_operation_get_print_settings, pFp) GO(gtk_print_operation_get_status, uFp) GO(gtk_print_operation_get_status_string, pFp) -//GO(gtk_print_operation_get_support_selection, +GO(gtk_print_operation_get_support_selection, iFp) GO(gtk_print_operation_get_type, LFv) -//GO(gtk_print_operation_is_finished, +GO(gtk_print_operation_is_finished, iFp) GO(gtk_print_operation_new, pFv) -//GO(gtk_print_operation_preview_end_preview, +GO(gtk_print_operation_preview_end_preview, vFp) GO(gtk_print_operation_preview_get_type, LFv) GO(gtk_print_operation_preview_is_selected, iFpi) GO(gtk_print_operation_preview_render_page, vFpi) GO(gtk_print_operation_result_get_type, LFv) GO(gtk_print_operation_run, uFpupp) -//GO(gtk_print_operation_set_allow_async, +GO(gtk_print_operation_set_allow_async, vFpi) GO(gtk_print_operation_set_current_page, vFpi) GO(gtk_print_operation_set_custom_tab_label, vFpp) GO(gtk_print_operation_set_default_page_setup, vFpp) -//GO(gtk_print_operation_set_defer_drawing, +GO(gtk_print_operation_set_defer_drawing, vFp) GO(gtk_print_operation_set_embed_page_setup, vFpi) -//GO(gtk_print_operation_set_export_filename, -//GO(gtk_print_operation_set_has_selection, -//GO(gtk_print_operation_set_job_name, -//GO(gtk_print_operation_set_n_pages, +GO(gtk_print_operation_set_export_filename, vFpp) +GO(gtk_print_operation_set_has_selection, vFpi) +GO(gtk_print_operation_set_job_name, vFpp) +GO(gtk_print_operation_set_n_pages, vFpi) GO(gtk_print_operation_set_print_settings, vFpp) -//GO(gtk_print_operation_set_show_progress, -//GO(gtk_print_operation_set_support_selection, -//GO(gtk_print_operation_set_track_print_status, +GO(gtk_print_operation_set_show_progress, vFpi) +GO(gtk_print_operation_set_support_selection, vFpi) +GO(gtk_print_operation_set_track_print_status, vFpi) GO(gtk_print_operation_set_unit, vFpu) -//GO(gtk_print_operation_set_use_full_page, +GO(gtk_print_operation_set_use_full_page, vFpi) GO(gtk_print_pages_get_type, LFv) GO(gtk_print_quality_get_type, LFv) GO(gtk_print_run_page_setup_dialog, pFppp) -//GO(gtk_print_run_page_setup_dialog_async, +//GOM(gtk_print_run_page_setup_dialog_async, vFppppp) GO(gtk_print_settings_copy, pFp) -//GO(gtk_print_settings_foreach, +//GOM(gtk_print_settings_foreach, vFppp) GO(gtk_print_settings_get, pFpp) GO(gtk_print_settings_get_bool, iFpp) -//GO(gtk_print_settings_get_collate, -//GO(gtk_print_settings_get_default_source, -//GO(gtk_print_settings_get_dither, +GO(gtk_print_settings_get_collate, iFp) +GO(gtk_print_settings_get_default_source, pFp) +GO(gtk_print_settings_get_dither, pFp) GO(gtk_print_settings_get_double, dFpp) GO(gtk_print_settings_get_double_with_default, dFppd) GO(gtk_print_settings_get_duplex, uFp) -//GO(gtk_print_settings_get_finishings, +GO(gtk_print_settings_get_finishings, pFp) GO(gtk_print_settings_get_int, iFpp) GO(gtk_print_settings_get_int_with_default, iFppi) GO(gtk_print_settings_get_length, dFppu) -//GO(gtk_print_settings_get_media_type, -//GO(gtk_print_settings_get_n_copies, -//GO(gtk_print_settings_get_number_up, +GO(gtk_print_settings_get_media_type, pFp) +GO(gtk_print_settings_get_n_copies, iFp) +GO(gtk_print_settings_get_number_up, iFp) GO(gtk_print_settings_get_number_up_layout, uFp) GO(gtk_print_settings_get_orientation, uFp) GO(gtk_print_settings_get_output_bin, pFp) @@ -2222,37 +2495,38 @@ GO(gtk_print_settings_get_page_ranges, pFpp) GO(gtk_print_settings_get_page_set, uFp) GO(gtk_print_settings_get_paper_height, dFpu) GO(gtk_print_settings_get_paper_size, pFp) -//GO(gtk_print_settings_get_paper_width, +GO(gtk_print_settings_get_paper_width, dFpu) GO(gtk_print_settings_get_printer, pFp) -//GO(gtk_print_settings_get_printer_lpi, +GO(gtk_print_settings_get_printer_lpi, dFp) GO(gtk_print_settings_get_print_pages, uFp) GO(gtk_print_settings_get_quality, uFp) GO(gtk_print_settings_get_resolution, iFp) -//GO(gtk_print_settings_get_resolution_x, +GO(gtk_print_settings_get_resolution_x, iFp) GO(gtk_print_settings_get_resolution_y, iFp) GO(gtk_print_settings_get_reverse, iFp) GO(gtk_print_settings_get_scale, dFp) GO(gtk_print_settings_get_type, LFv) -//GO(gtk_print_settings_get_use_color, -//GO(gtk_print_settings_has_key, -//GO(gtk_print_settings_load_file, +GO(gtk_print_settings_get_use_color, iFp) +GO(gtk_print_settings_has_key, iFpp) +GO(gtk_print_settings_load_file, iFppp) GO(gtk_print_settings_load_key_file, iFpppp) GO(gtk_print_settings_new, pFv) GO(gtk_print_settings_new_from_file, pFpp) +GO(gtk_print_settings_new_from_gvariant, pFp) GO(gtk_print_settings_new_from_key_file, pFppp) GO(gtk_print_settings_set, vFppp) GO(gtk_print_settings_set_bool, vFppi) GO(gtk_print_settings_set_collate, vFpi) -//GO(gtk_print_settings_set_default_source, -//GO(gtk_print_settings_set_dither, +GO(gtk_print_settings_set_default_source, vFpp) +GO(gtk_print_settings_set_dither, vFpp) GO(gtk_print_settings_set_double, vFppd) GO(gtk_print_settings_set_duplex, vFpu) -//GO(gtk_print_settings_set_finishings, +GO(gtk_print_settings_set_finishings, vFpp) GO(gtk_print_settings_set_int, vFppi) GO(gtk_print_settings_set_length, vFppdu) -//GO(gtk_print_settings_set_media_type, +GO(gtk_print_settings_set_media_type, vFpp) GO(gtk_print_settings_set_n_copies, vFpi) -//GO(gtk_print_settings_set_number_up, +GO(gtk_print_settings_set_number_up, vFpi) GO(gtk_print_settings_set_number_up_layout, vFpu) GO(gtk_print_settings_set_orientation, vFpu) GO(gtk_print_settings_set_output_bin, vFpp) @@ -2260,7 +2534,7 @@ GO(gtk_print_settings_set_page_ranges, vFppi) GO(gtk_print_settings_set_page_set, vFpu) GO(gtk_print_settings_set_paper_height, vFpdu) GO(gtk_print_settings_set_paper_size, vFpp) -//GO(gtk_print_settings_set_paper_width, +GO(gtk_print_settings_set_paper_width, vFpdu) GO(gtk_print_settings_set_printer, vFpp) GO(gtk_print_settings_set_printer_lpi, vFpd) GO(gtk_print_settings_set_print_pages, vFpu) @@ -2269,81 +2543,60 @@ GO(gtk_print_settings_set_resolution, vFpi) GO(gtk_print_settings_set_resolution_xy, vFpii) GO(gtk_print_settings_set_reverse, vFpi) GO(gtk_print_settings_set_scale, vFpd) -//GO(gtk_print_settings_set_use_color, +GO(gtk_print_settings_set_use_color, vFpi) GO(gtk_print_settings_to_file, iFppp) +GO(gtk_print_settings_to_gvariant, pFp) GO(gtk_print_settings_to_key_file, vFppp) -//GO(gtk_print_settings_unset, +GO(gtk_print_settings_unset, vFpp) GO(gtk_print_status_get_type, LFv) -//GO(gtk_print_unix_dialog_add_custom_tab, -//GO(gtk_print_unix_dialog_get_current_page, -//GO(gtk_print_unix_dialog_get_embed_page_setup, -//GO(gtk_print_unix_dialog_get_has_selection, -//GO(gtk_print_unix_dialog_get_manual_capabilities, +GO(gtk_print_unix_dialog_add_custom_tab, vFppp) +GO(gtk_print_unix_dialog_get_current_page, iFp) +GO(gtk_print_unix_dialog_get_embed_page_setup, iFp) +GO(gtk_print_unix_dialog_get_has_selection, iFp) +GO(gtk_print_unix_dialog_get_manual_capabilities, uFp) GO(gtk_print_unix_dialog_get_page_setup, pFp) -//GO(gtk_print_unix_dialog_get_page_setup_set, +GO(gtk_print_unix_dialog_get_page_setup_set, iFp) GO(gtk_print_unix_dialog_get_selected_printer, pFp) GO(gtk_print_unix_dialog_get_settings, pFp) -//GO(gtk_print_unix_dialog_get_support_selection, +GO(gtk_print_unix_dialog_get_support_selection, iFp) GO(gtk_print_unix_dialog_get_type, LFv) GO(gtk_print_unix_dialog_new, pFpp) -//GO(gtk_print_unix_dialog_set_current_page, +GO(gtk_print_unix_dialog_set_current_page, vFpi) GO(gtk_print_unix_dialog_set_embed_page_setup, vFpi) GO(gtk_print_unix_dialog_set_has_selection, vFpi) -GO(gtk_print_unix_dialog_set_manual_capabilities, vFpi) -//GO(gtk_print_unix_dialog_set_page_setup, +GO(gtk_print_unix_dialog_set_manual_capabilities, vFpu) +GO(gtk_print_unix_dialog_set_page_setup, vFpp) GO(gtk_print_unix_dialog_set_settings, vFpp) GO(gtk_print_unix_dialog_set_support_selection, vFpi) -GO(gtk_private_flags_get_type, LFv) +GO(gtk_progress_bar_accessible_get_type, LFv) GO(gtk_progress_bar_get_ellipsize, uFp) GO(gtk_progress_bar_get_fraction, dFp) -GO(gtk_progress_bar_get_orientation, iFp) +GO(gtk_progress_bar_get_inverted, iFp) GO(gtk_progress_bar_get_pulse_step, dFp) +GO(gtk_progress_bar_get_show_text, iFp) GO(gtk_progress_bar_get_text, pFp) GO(gtk_progress_bar_get_type, LFv) GO(gtk_progress_bar_new, pFv) -GO(gtk_progress_bar_new_with_adjustment, pFp) -GO(gtk_progress_bar_orientation_get_type, LFv) GO(gtk_progress_bar_pulse, vFp) -GO(gtk_progress_bar_set_activity_blocks, vFpu) -GO(gtk_progress_bar_set_activity_step, vFpu) -GO(gtk_progress_bar_set_bar_style, vFpi) -GO(gtk_progress_bar_set_discrete_blocks, vFpu) GO(gtk_progress_bar_set_ellipsize, vFpu) GO(gtk_progress_bar_set_fraction, vFpd) -GO(gtk_progress_bar_set_orientation, vFpi) +GO(gtk_progress_bar_set_inverted, vFpi) GO(gtk_progress_bar_set_pulse_step, vFpd) GO(gtk_progress_bar_set_show_text, vFpi) GO(gtk_progress_bar_set_text, vFpp) -GO(gtk_progress_bar_style_get_type, LFv) -GO(gtk_progress_bar_update, vFpd) -//GO(gtk_progress_configure, -//GO(gtk_progress_get_current_percentage, -//GO(gtk_progress_get_current_text, -//GO(gtk_progress_get_percentage_from_value, -//GO(gtk_progress_get_text_from_value, -GO(gtk_progress_get_type, LFv) -//GO(gtk_progress_get_value, -//GO(gtk_progress_set_activity_mode, -//GO(gtk_progress_set_adjustment, -//GO(gtk_progress_set_format_string, -//GO(gtk_progress_set_percentage, -//GO(gtk_progress_set_show_text, -//GO(gtk_progress_set_text_alignment, -//GO(gtk_progress_set_value, GO(gtk_propagate_event, vFpp) -//GOM(gtk_quit_add, iFEuBp) -GO(gtk_quit_add_destroy, vFup) -//GOM(gtk_quit_add_full, uFuBppB) -GO(gtk_quit_remove, vFu) -GO(gtk_quit_remove_by_data, vFp) +GO(gtk_propagation_phase_get_type, LFv) GO(gtk_radio_action_get_current_value, iFp) GO(gtk_radio_action_get_group, pFp) GO(gtk_radio_action_get_type, LFv) +GO(gtk_radio_action_join_group, vFpp) GO(gtk_radio_action_new, pFppppi) GO(gtk_radio_action_set_current_value, vFpi) GO(gtk_radio_action_set_group, vFpp) +GO(gtk_radio_button_accessible_get_type, LFv) GO(gtk_radio_button_get_group, pFp) GO(gtk_radio_button_get_type, LFv) +GO(gtk_radio_button_join_group, vFpp) GO(gtk_radio_button_new, pFp) GO(gtk_radio_button_new_from_widget, pFp) GO(gtk_radio_button_new_with_label, pFpp) @@ -2351,8 +2604,10 @@ GO(gtk_radio_button_new_with_label_from_widget, pFpp) GO(gtk_radio_button_new_with_mnemonic, pFpp) GO(gtk_radio_button_new_with_mnemonic_from_widget, pFpp) GO(gtk_radio_button_set_group, vFpp) +GO(gtk_radio_menu_item_accessible_get_type, LFv) GO(gtk_radio_menu_item_get_group, pFp) GO(gtk_radio_menu_item_get_type, LFv) +GO(gtk_radio_menu_item_join_group, vFpp) GO(gtk_radio_menu_item_new, pFp) GO(gtk_radio_menu_item_new_from_widget, pFp) GO(gtk_radio_menu_item_new_with_label, pFpp) @@ -2367,11 +2622,12 @@ GO(gtk_radio_tool_button_new_from_stock, pFpp) GO(gtk_radio_tool_button_new_from_widget, pFp) GO(gtk_radio_tool_button_new_with_stock_from_widget, pFpp) GO(gtk_radio_tool_button_set_group, vFpp) +GO(gtk_range_accessible_get_type, LFv) GO(gtk_range_get_adjustment, pFp) GO(gtk_range_get_fill_level, dFp) GO(gtk_range_get_flippable, iFp) GO(gtk_range_get_inverted, iFp) -GO(gtk_range_get_lower_stepper_sensitivity, iFp) +GO(gtk_range_get_lower_stepper_sensitivity, uFp) GO(gtk_range_get_min_slider_size, iFp) GO(gtk_range_get_range_rect, vFpp) GO(gtk_range_get_restrict_to_fill_level, iFp) @@ -2380,7 +2636,6 @@ GO(gtk_range_get_show_fill_level, iFp) GO(gtk_range_get_slider_range, vFppp) GO(gtk_range_get_slider_size_fixed, iFp) GO(gtk_range_get_type, LFv) -GO(gtk_range_get_update_policy, iFp) GO(gtk_range_get_upper_stepper_sensitivity, uFp) GO(gtk_range_get_value, dFp) GO(gtk_range_set_adjustment, vFpp) @@ -2388,22 +2643,18 @@ GO(gtk_range_set_fill_level, vFpd) GO(gtk_range_set_flippable, vFpi) GO(gtk_range_set_increments, vFpdd) GO(gtk_range_set_inverted, vFpi) -GO(gtk_range_set_lower_stepper_sensitivity, vFpi) +GO(gtk_range_set_lower_stepper_sensitivity, vFpu) GO(gtk_range_set_min_slider_size, vFpi) GO(gtk_range_set_range, vFpdd) GO(gtk_range_set_restrict_to_fill_level, vFpi) GO(gtk_range_set_round_digits, vFpi) GO(gtk_range_set_show_fill_level, vFpi) GO(gtk_range_set_slider_size_fixed, vFpi) -GO(gtk_range_set_update_policy, vFpi) GO(gtk_range_set_upper_stepper_sensitivity, vFpu) GO(gtk_range_set_value, vFpd) -GO(gtk_rc_add_class_style, vFpp) GO(gtk_rc_add_default_file, vFp) -GO(gtk_rc_add_widget_class_style, vFpp) -GO(gtk_rc_add_widget_name_style, vFpp) GO(gtk_rc_find_module_in_path, pFp) -GO(gtk_rc_find_pixmap_in_path, pFppp) +GO(gtk_rc_find_pixmap_in_path, pFppp) //need wraping? GO(gtk_rc_flags_get_type, LFv) GO(gtk_rc_get_default_files, pFv) GO(gtk_rc_get_im_module_file, pFv) @@ -2413,10 +2664,10 @@ GO(gtk_rc_get_style, pFp) GO(gtk_rc_get_style_by_paths, pFpppL) GO(gtk_rc_get_theme_dir, pFv) GO(gtk_rc_parse, vFp) -GO(gtk_rc_parse_color, uFpp) -GO(gtk_rc_parse_color_full, uFppp) -GO(gtk_rc_parse_priority, iFpp) -GO(gtk_rc_parse_state, uFpp) +//GOM(gtk_rc_parse_color, uFpp) +//GOM(gtk_rc_parse_color_full, uFppp) +//GOM(gtk_rc_parse_priority, uFpp) +//GOM(gtk_rc_parse_state, uFpp) GO(gtk_rc_parse_string, vFp) GO(gtk_rc_property_parse_border, iFppp) GO(gtk_rc_property_parse_color, iFppp) @@ -2431,20 +2682,16 @@ GO(gtk_rc_set_default_files, vFp) GO(gtk_rc_style_copy, pFp) GO(gtk_rc_style_get_type, LFv) GO(gtk_rc_style_new, pFv) -GO(gtk_rc_style_ref, vFp) -GO(gtk_rc_style_unref, vFp) GO(gtk_rc_token_type_get_type, LFv) -GO(gtk_revealer_get_type, LFv) -GO(gtk_revealer_transition_type_get_type, LFv) GO(gtk_recent_action_get_show_numbers, iFp) GO(gtk_recent_action_get_type, LFv) GO(gtk_recent_action_new, pFpppp) GO(gtk_recent_action_new_for_manager, pFppppp) GO(gtk_recent_action_set_show_numbers, vFpi) -//GO(gtk_recent_chooser_add_filter, +GO(gtk_recent_chooser_add_filter, vFpp) GO(gtk_recent_chooser_dialog_get_type, LFv) -//GO(gtk_recent_chooser_dialog_new, -//GO(gtk_recent_chooser_dialog_new_for_manager, +//GOM(gtk_recent_chooser_dialog_new, pFpppV) +//GOM(gtk_recent_chooser_dialog_new_for_manager, pFppppV) GO(gtk_recent_chooser_error_get_type, LFv) GO(gtk_recent_chooser_error_quark, uFv) GO(gtk_recent_chooser_get_current_item, pFp) @@ -2452,104 +2699,103 @@ GO(gtk_recent_chooser_get_current_uri, pFp) GO(gtk_recent_chooser_get_filter, pFp) GO(gtk_recent_chooser_get_items, pFp) GO(gtk_recent_chooser_get_limit, iFp) -//GO(gtk_recent_chooser_get_local_only, -//GO(gtk_recent_chooser_get_select_multiple, +GO(gtk_recent_chooser_get_local_only, iFp) +GO(gtk_recent_chooser_get_select_multiple, iFp) GO(gtk_recent_chooser_get_show_icons, iFp) -//GO(gtk_recent_chooser_get_show_not_found, -//GO(gtk_recent_chooser_get_show_numbers, -//GO(gtk_recent_chooser_get_show_private, -//GO(gtk_recent_chooser_get_show_tips, +GO(gtk_recent_chooser_get_show_not_found, iFp) +GO(gtk_recent_chooser_get_show_private, iFp) +GO(gtk_recent_chooser_get_show_tips, iFp) GO(gtk_recent_chooser_get_sort_type, uFp) GO(gtk_recent_chooser_get_type, LFv) GO(gtk_recent_chooser_get_uris, pFpp) GO(gtk_recent_chooser_list_filters, pFp) GO(gtk_recent_chooser_menu_get_show_numbers, iFp) GO(gtk_recent_chooser_menu_get_type, LFv) -//GO(gtk_recent_chooser_menu_new, -//GO(gtk_recent_chooser_menu_new_for_manager, +GO(gtk_recent_chooser_menu_new, pFv) +GO(gtk_recent_chooser_menu_new_for_manager, pFp) GO(gtk_recent_chooser_menu_set_show_numbers, vFpi) -//GO(gtk_recent_chooser_remove_filter, -//GO(gtk_recent_chooser_select_all, +GO(gtk_recent_chooser_remove_filter, vFpp) +GO(gtk_recent_chooser_select_all, vFp) GO(gtk_recent_chooser_select_uri, iFppp) -//GO(gtk_recent_chooser_set_current_uri, +GO(gtk_recent_chooser_set_current_uri, iFppp) GO(gtk_recent_chooser_set_filter, vFpp) GO(gtk_recent_chooser_set_limit, vFpi) -//GO(gtk_recent_chooser_set_local_only, -//GO(gtk_recent_chooser_set_select_multiple, +GO(gtk_recent_chooser_set_local_only, vFpi) +GO(gtk_recent_chooser_set_select_multiple, vFpi) GO(gtk_recent_chooser_set_show_icons, vFpi) -//GO(gtk_recent_chooser_set_show_not_found, -//GO(gtk_recent_chooser_set_show_numbers, -//GO(gtk_recent_chooser_set_show_private, -//GO(gtk_recent_chooser_set_show_tips, -//GO(gtk_recent_chooser_set_sort_func, +GO(gtk_recent_chooser_set_show_not_found, vFpi) +GO(gtk_recent_chooser_set_show_private, vFpi) +GO(gtk_recent_chooser_set_show_tips, vFpi) +//GOM(gtk_recent_chooser_set_sort_func, vFpppp) GO(gtk_recent_chooser_set_sort_type, vFpu) -//GO(gtk_recent_chooser_unselect_all, +GO(gtk_recent_chooser_unselect_all, vFp) GO(gtk_recent_chooser_unselect_uri, vFpp) GO(gtk_recent_chooser_widget_get_type, LFv) -//GO(gtk_recent_chooser_widget_new, +GO(gtk_recent_chooser_widget_new, pFv) GO(gtk_recent_chooser_widget_new_for_manager, pFp) GO(gtk_recent_filter_add_age, vFpi) -//GO(gtk_recent_filter_add_application, -//GO(gtk_recent_filter_add_custom, +GO(gtk_recent_filter_add_application, vFpp) +//GOM(gtk_recent_filter_add_custom, vFpuppp) GO(gtk_recent_filter_add_group, vFpp) -//GO(gtk_recent_filter_add_mime_type, -//GO(gtk_recent_filter_add_pattern, -//GO(gtk_recent_filter_add_pixbuf_formats, +GO(gtk_recent_filter_add_mime_type, vFpp) +GO(gtk_recent_filter_add_pattern, vFpp) +GO(gtk_recent_filter_add_pixbuf_formats, vFp) GO(gtk_recent_filter_filter, iFpp) GO(gtk_recent_filter_flags_get_type, LFv) GO(gtk_recent_filter_get_name, pFp) GO(gtk_recent_filter_get_needed, uFp) GO(gtk_recent_filter_get_type, LFv) GO(gtk_recent_filter_new, pFv) -//GO(gtk_recent_filter_set_name, +GO(gtk_recent_filter_set_name, vFpp) +GO(gtk_recent_info_create_app_info, pFppp) GO(gtk_recent_info_exists, iFp) -//GO(gtk_recent_info_get_added, +GO(gtk_recent_info_get_added, lFp) GO(gtk_recent_info_get_age, iFp) GO(gtk_recent_info_get_application_info, iFppppp) -//GO(gtk_recent_info_get_applications, -//GO(gtk_recent_info_get_description, -//GO(gtk_recent_info_get_display_name, +GO(gtk_recent_info_get_applications, pFpp) +GO(gtk_recent_info_get_description, pFp) +GO(gtk_recent_info_get_display_name, pFp) +GO(gtk_recent_info_get_gicon, pFp) GO(gtk_recent_info_get_groups, pFpp) GO(gtk_recent_info_get_icon, pFpi) GO(gtk_recent_info_get_mime_type, pFp) -//GO(gtk_recent_info_get_modified, -//GO(gtk_recent_info_get_private_hint, -//GO(gtk_recent_info_get_short_name, +GO(gtk_recent_info_get_modified, lFp) +GO(gtk_recent_info_get_private_hint, iFp) +GO(gtk_recent_info_get_short_name, pFp) GO(gtk_recent_info_get_type, LFv) -//GO(gtk_recent_info_get_uri, +GO(gtk_recent_info_get_uri, pFp) GO(gtk_recent_info_get_uri_display, pFp) GO(gtk_recent_info_get_visited, lFp) -//GO(gtk_recent_info_has_application, +GO(gtk_recent_info_has_application, iFpp) GO(gtk_recent_info_has_group, iFpp) -//GO(gtk_recent_info_is_local, -//GO(gtk_recent_info_last_application, +GO(gtk_recent_info_is_local, iFp) +GO(gtk_recent_info_last_application, pFp) GO(gtk_recent_info_match, iFpp) GO(gtk_recent_info_ref, pFp) GO(gtk_recent_info_unref, vFp) GO(gtk_recent_manager_add_full, iFppp) -//GO(gtk_recent_manager_add_item, +GO(gtk_recent_manager_add_item, iFpp) GO(gtk_recent_manager_error_get_type, LFv) -//GO(gtk_recent_manager_error_quark, +GO(gtk_recent_manager_error_quark, uFv) GO(gtk_recent_manager_get_default, pFv) -//GO(gtk_recent_manager_get_for_screen, GO(gtk_recent_manager_get_items, pFp) -//GO(gtk_recent_manager_get_limit, GO(gtk_recent_manager_get_type, LFv) GO(gtk_recent_manager_has_item, iFpp) GO(gtk_recent_manager_lookup_item, pFppp) GO(gtk_recent_manager_move_item, iFpppp) -//GO(gtk_recent_manager_new, +GO(gtk_recent_manager_new, pFv) GO(gtk_recent_manager_purge_items, iFpp) GO(gtk_recent_manager_remove_item, iFppp) -//GO(gtk_recent_manager_set_limit, -//GO(gtk_recent_manager_set_screen, GO(gtk_recent_sort_type_get_type, LFv) +GO(gtk_region_flags_get_type, LFv) GO(gtk_relief_style_get_type, LFv) GO(gtk_render_activity, vFppdddd) GO(gtk_render_arrow, vFppdddd) GO(gtk_render_background, vFppdddd) GO(gtk_render_background_get_clip, vFpddddp) GO(gtk_render_check, vFppdddd) +GO(gtk_renderer_cell_accessible_get_type, LFv) +GO(gtk_renderer_cell_accessible_new, pFp) GO(gtk_render_expander, vFppdddd) GO(gtk_render_extension, vFppddddu) GO(gtk_render_focus, vFppdddd) @@ -2567,72 +2813,117 @@ GO(gtk_render_slider, vFppddddu) GO(gtk_requisition_copy, pFp) GO(gtk_requisition_free, vFp) GO(gtk_requisition_get_type, LFv) +GO(gtk_requisition_new, pFv) GO(gtk_resize_mode_get_type, LFv) GO(gtk_response_type_get_type, LFv) +GO(gtk_revealer_get_child_revealed, iFp) +GO(gtk_revealer_get_reveal_child, iFp) +GO(gtk_revealer_get_transition_duration, uFp) +GO(gtk_revealer_get_transition_type, uFp) +GO(gtk_revealer_get_type, LFv) +GO(gtk_revealer_new, pFv) +GO(gtk_revealer_set_reveal_child, vFpi) +GO(gtk_revealer_set_transition_duration, vFpu) +GO(gtk_revealer_set_transition_type, vFpu) +GO(gtk_revealer_transition_type_get_type, LFv) GO(gtk_rgb_to_hsv, vFdddppp) -//GO(gtk_ruler_draw_pos, -//GO(gtk_ruler_draw_ticks, -//GO(gtk_ruler_get_metric, -//GO(gtk_ruler_get_range, -GO(gtk_ruler_get_type, LFv) -//GO(gtk_ruler_set_metric, -//GO(gtk_ruler_set_range, +GO(gtk_scale_accessible_get_type, LFv) GO(gtk_scale_add_mark, vFpdup) +GO(gtk_scale_button_accessible_get_type, LFv) GO(gtk_scale_button_get_adjustment, pFp) -//GO(gtk_scale_button_get_minus_button, -//GO(gtk_scale_button_get_orientation, -//GO(gtk_scale_button_get_plus_button, +GO(gtk_scale_button_get_minus_button, pFp) +GO(gtk_scale_button_get_plus_button, pFp) GO(gtk_scale_button_get_popup, pFp) GO(gtk_scale_button_get_type, LFv) GO(gtk_scale_button_get_value, dFp) GO(gtk_scale_button_new, pFudddp) GO(gtk_scale_button_set_adjustment, vFpp) GO(gtk_scale_button_set_icons, vFpp) -//GO(gtk_scale_button_set_orientation, GO(gtk_scale_button_set_value, vFpd) -//GO(gtk_scale_clear_marks, +GO(gtk_scale_clear_marks, vFp) GO(gtk_scale_get_digits, iFp) GO(gtk_scale_get_draw_value, iFp) +GO(gtk_scale_get_has_origin, iFp) GO(gtk_scale_get_layout, pFp) GO(gtk_scale_get_layout_offsets, vFppp) GO(gtk_scale_get_type, LFv) GO(gtk_scale_get_value_pos, uFp) -GO(gtk_scale_new, pFip) +GO(gtk_scale_new, pFup) +GO(gtk_scale_new_with_range, pFuddd) GO(gtk_scale_set_digits, vFpi) GO(gtk_scale_set_draw_value, vFpi) +GO(gtk_scale_set_has_origin, vFpi) GO(gtk_scale_set_value_pos, vFpu) +GO(gtk_scrollable_get_border, iFpp) +GO(gtk_scrollable_get_hadjustment, pFp) +GO(gtk_scrollable_get_hscroll_policy, uFp) GO(gtk_scrollable_get_type, LFv) +GO(gtk_scrollable_get_vadjustment, pFp) +GO(gtk_scrollable_get_vscroll_policy, uFp) +GO(gtk_scrollable_policy_get_type, LFv) +GO(gtk_scrollable_set_hadjustment, vFpp) +GO(gtk_scrollable_set_hscroll_policy, vFpu) +GO(gtk_scrollable_set_vadjustment, vFpp) +GO(gtk_scrollable_set_vscroll_policy, vFpu) GO(gtk_scrollbar_get_type, LFv) -GO(gtk_scrollbar_new, pFip) +GO(gtk_scrollbar_new, pFup) +GO(gtk_scrolled_window_accessible_get_type, LFv) GO(gtk_scrolled_window_add_with_viewport, vFpp) +GO(gtk_scrolled_window_get_capture_button_press, iFp) GO(gtk_scrolled_window_get_hadjustment, pFp) GO(gtk_scrolled_window_get_hscrollbar, pFp) +GO(gtk_scrolled_window_get_kinetic_scrolling, iFp) +GO(gtk_scrolled_window_get_max_content_height, iFp) +GO(gtk_scrolled_window_get_max_content_width, iFp) +GO(gtk_scrolled_window_get_min_content_height, iFp) +GO(gtk_scrolled_window_get_min_content_width, iFp) +GO(gtk_scrolled_window_get_overlay_scrolling, iFp) GO(gtk_scrolled_window_get_placement, uFp) GO(gtk_scrolled_window_get_policy, vFppp) +GO(gtk_scrolled_window_get_propagate_natural_height, iFp) +GO(gtk_scrolled_window_get_propagate_natural_width, iFp) GO(gtk_scrolled_window_get_shadow_type, uFp) GO(gtk_scrolled_window_get_type, LFv) GO(gtk_scrolled_window_get_vadjustment, pFp) GO(gtk_scrolled_window_get_vscrollbar, pFp) GO(gtk_scrolled_window_new, pFpp) +GO(gtk_scrolled_window_set_capture_button_press, vFpi) GO(gtk_scrolled_window_set_hadjustment, vFpp) +GO(gtk_scrolled_window_set_kinetic_scrolling, vFpi) +GO(gtk_scrolled_window_set_max_content_height, vFpi) +GO(gtk_scrolled_window_set_max_content_width, vFpi) +GO(gtk_scrolled_window_set_min_content_height, vFpi) +GO(gtk_scrolled_window_set_min_content_width, vFpi) +GO(gtk_scrolled_window_set_overlay_scrolling, vFpi) GO(gtk_scrolled_window_set_placement, vFpu) GO(gtk_scrolled_window_set_policy, vFpuu) +GO(gtk_scrolled_window_set_propagate_natural_height, vFpi) +GO(gtk_scrolled_window_set_propagate_natural_width, vFpi) GO(gtk_scrolled_window_set_shadow_type, vFpu) GO(gtk_scrolled_window_set_vadjustment, vFpp) GO(gtk_scrolled_window_unset_placement, vFp) GO(gtk_scroll_step_get_type, LFv) GO(gtk_scroll_type_get_type, LFv) +GO(gtk_search_bar_connect_entry, vFpp) +GO(gtk_search_bar_get_search_mode, iFp) +GO(gtk_search_bar_get_show_close_button, iFp) GO(gtk_search_bar_get_type, LFv) +GO(gtk_search_bar_handle_event, iFpp) +GO(gtk_search_bar_new, pFv) +GO(gtk_search_bar_set_search_mode, vFpi) +GO(gtk_search_bar_set_show_close_button, vFpi) GO(gtk_search_entry_get_type, LFv) +GO(gtk_search_entry_handle_event, iFpp) +GO(gtk_search_entry_new, pFv) GO(gtk_selection_add_target, vFpppu) GO(gtk_selection_add_targets, vFpppu) -GO(gtk_selection_clear, iFpp) GO(gtk_selection_clear_targets, vFpp) GO(gtk_selection_convert, iFpppu) GO(gtk_selection_data_copy, pFp) GO(gtk_selection_data_free, vFp) GO(gtk_selection_data_get_data, pFp) GO(gtk_selection_data_get_data_type, pFp) +GO(gtk_selection_data_get_data_with_length, pFpp) GO(gtk_selection_data_get_display, pFp) GO(gtk_selection_data_get_format, iFp) GO(gtk_selection_data_get_length, iFp) @@ -2664,34 +2955,33 @@ GO(gtk_separator_tool_item_get_draw, iFp) GO(gtk_separator_tool_item_get_type, LFv) GO(gtk_separator_tool_item_new, pFv) GO(gtk_separator_tool_item_set_draw, vFpi) -GO(gtk_set_locale, pFv) +GO(gtk_set_debug_flags, vFu) GO(gtk_settings_get_default, pFv) GO(gtk_settings_get_for_screen, pFp) GO(gtk_settings_get_type, LFv) GO(gtk_settings_install_property, vFp) -//GOM(gtk_settings_install_property_parser, vFEpB) +//GOM(gtk_settings_install_property_parser, vFEpp) +GO(gtk_settings_reset_property, vFpp) GO(gtk_settings_set_double_property, vFppdp) GO(gtk_settings_set_long_property, vFpplp) GO(gtk_settings_set_property_value, vFppp) GO(gtk_settings_set_string_property, vFpppp) GO(gtk_shadow_type_get_type, LFv) +GO(gtk_shortcut_label_get_accelerator, pFp) +GO(gtk_shortcut_label_get_disabled_text, pFp) +GO(gtk_shortcut_label_get_type, LFv) +GO(gtk_shortcut_label_new, pFp) +GO(gtk_shortcut_label_set_accelerator, vFpp) +GO(gtk_shortcut_label_set_disabled_text, vFpp) +GO(gtk_shortcuts_group_get_type, LFv) +GO(gtk_shortcuts_section_get_type, LFv) +GO(gtk_shortcuts_shortcut_get_type, LFv) +GO(gtk_shortcuts_window_get_type, LFv) +GO(gtk_shortcut_type_get_type, LFv) GO(gtk_show_about_dialog, vFpppppppppppppppppppppppp) //vaarg GO(gtk_show_uri, iFppup) GO(gtk_show_uri_on_window, iFppup) -GO(gtk_side_type_get_type, LFv) -//GO(gtk_signal_compat_matched, -GOM(gtk_signal_connect_full, LFEppppppii) -//GO(gtk_signal_connect_object_while_alive, -//GO(gtk_signal_connect_while_alive, -//GO(gtk_signal_emit, -//GO(gtk_signal_emit_by_name, -//GO(gtk_signal_emit_stop_by_name, -//GO(gtk_signal_emitv, -//GO(gtk_signal_emitv_by_name, -//GO(gtk_signal_new, -//GO(gtk_signal_newv, -GO(gtk_signal_run_type_get_type, LFv) -//GO(gtk_size_group_add_widget, +GO(gtk_size_group_add_widget, vFpp) GO(gtk_size_group_get_ignore_hidden, iFp) GO(gtk_size_group_get_mode, uFp) GO(gtk_size_group_get_type, LFv) @@ -2701,16 +2991,19 @@ GO(gtk_size_group_new, pFu) GO(gtk_size_group_remove_widget, vFpp) GO(gtk_size_group_set_ignore_hidden, vFpi) GO(gtk_size_group_set_mode, vFpu) -GO(gtk_snapshot_new, pFv) +GO(gtk_size_request_mode_get_type, LFv) GO(gtk_snapshot_free_to_node, pFp) +GO(gtk_snapshot_new, pFv) GO(gtk_snapshot_render_background, vFppdddd) +GO(gtk_socket_accessible_embed, vFpp) +GO(gtk_socket_accessible_get_type, LFv) GO(gtk_socket_add_id, vFpp) GO(gtk_socket_get_id, pFp) GO(gtk_socket_get_plug_window, pFp) GO(gtk_socket_get_type, LFv) GO(gtk_socket_new, pFv) -GO(gtk_socket_steal, vFpp) GO(gtk_sort_type_get_type, LFv) +GO(gtk_spin_button_accessible_get_type, LFv) GO(gtk_spin_button_configure, vFppdu) GO(gtk_spin_button_get_adjustment, pFp) GO(gtk_spin_button_get_digits, uFp) @@ -2737,18 +3030,49 @@ GO(gtk_spin_button_set_wrap, vFpi) GO(gtk_spin_button_spin, vFpud) GO(gtk_spin_button_update, vFp) GO(gtk_spin_button_update_policy_get_type, LFv) +GO(gtk_spinner_accessible_get_type, LFv) GO(gtk_spinner_get_type, LFv) GO(gtk_spinner_new, pFv) GO(gtk_spinner_start, vFp) GO(gtk_spinner_stop, vFp) GO(gtk_spin_type_get_type, LFv) +GO(gtk_stack_accessible_get_type, LFv) +GO(gtk_stack_add_named, vFppp) +GO(gtk_stack_add_titled, vFpppp) +GO(gtk_stack_get_child_by_name, pFpp) +GO(gtk_stack_get_hhomogeneous, iFp) +GO(gtk_stack_get_homogeneous, iFp) +GO(gtk_stack_get_interpolate_size, iFp) +GO(gtk_stack_get_transition_duration, uFp) +GO(gtk_stack_get_transition_running, iFp) +GO(gtk_stack_get_transition_type, uFp) GO(gtk_stack_get_type, LFv) +GO(gtk_stack_get_vhomogeneous, iFp) +GO(gtk_stack_get_visible_child, pFp) +GO(gtk_stack_get_visible_child_name, pFp) +GO(gtk_stack_new, pFv) +GO(gtk_stack_set_hhomogeneous, vFpi) +GO(gtk_stack_set_homogeneous, vFpi) +GO(gtk_stack_set_interpolate_size, vFpi) +GO(gtk_stack_set_transition_duration, vFpu) +GO(gtk_stack_set_transition_type, vFpu) +GO(gtk_stack_set_vhomogeneous, vFpi) +GO(gtk_stack_set_visible_child, vFpp) +GO(gtk_stack_set_visible_child_full, vFppu) +GO(gtk_stack_set_visible_child_name, vFpp) +GO(gtk_stack_sidebar_get_stack, pFp) +GO(gtk_stack_sidebar_get_type, LFv) +GO(gtk_stack_sidebar_new, pFv) +GO(gtk_stack_sidebar_set_stack, vFpp) +GO(gtk_stack_switcher_get_stack, pFp) GO(gtk_stack_switcher_get_type, LFv) +GO(gtk_stack_switcher_new, pFv) +GO(gtk_stack_switcher_set_stack, vFpp) GO(gtk_stack_transition_type_get_type, LFv) GO(gtk_state_flags_get_type, LFv) GO(gtk_state_type_get_type, LFv) +GO(gtk_statusbar_accessible_get_type, LFv) GO(gtk_statusbar_get_context_id, uFpp) -GO(gtk_statusbar_get_has_resize_grip, iFp) GO(gtk_statusbar_get_message_area, pFp) GO(gtk_statusbar_get_type, LFv) GO(gtk_statusbar_new, pFv) @@ -2756,8 +3080,6 @@ GO(gtk_statusbar_pop, vFpu) GO(gtk_statusbar_push, uFpup) GO(gtk_statusbar_remove, vFpuu) GO(gtk_statusbar_remove_all, vFpu) -GO(gtk_statusbar_set_has_resize_grip, vFpi) -GO(gtk_status_icon_get_blinking, iFp) GO(gtk_status_icon_get_geometry, iFpppp) GO(gtk_status_icon_get_gicon, pFp) GO(gtk_status_icon_get_has_tooltip, iFp) @@ -2781,7 +3103,6 @@ GO(gtk_status_icon_new_from_icon_name, pFp) GO(gtk_status_icon_new_from_pixbuf, pFp) GO(gtk_status_icon_new_from_stock, pFp) GO(gtk_status_icon_position_menu, vFppppp) -GO(gtk_status_icon_set_blinking, vFpi) GO(gtk_status_icon_set_from_file, vFpp) GO(gtk_status_icon_set_from_gicon, vFpp) GO(gtk_status_icon_set_from_icon_name, vFpp) @@ -2791,7 +3112,6 @@ GO(gtk_status_icon_set_has_tooltip, vFpi) GO(gtk_status_icon_set_name, vFpp) GO(gtk_status_icon_set_screen, vFpp) GO(gtk_status_icon_set_title, vFpp) -GO(gtk_status_icon_set_tooltip, vFpp) GO(gtk_status_icon_set_tooltip_markup, vFpp) GO(gtk_status_icon_set_tooltip_text, vFpp) GO(gtk_status_icon_set_visible, vFpi) @@ -2810,28 +3130,29 @@ GO(gtk_style_context_add_provider_for_display, vFppu) GO(gtk_style_context_add_provider_for_screen, vFppu) GO(gtk_style_context_add_region, vFppu) GO(gtk_style_context_cancel_animations, vFpp) -GOM(gtk_style_context_get, vFEppV) -GO(gtk_style_context_get_border, vFpip) -GO(gtk_style_context_get_background_color, vFpip) +GOM(gtk_style_context_get, vFEpuV) +GO(gtk_style_context_get_background_color, vFpup) +GO(gtk_style_context_get_border, vFpup) GO(gtk_style_context_get_border_color, vFpup) -GO(gtk_style_context_get_color, vFpip) +GO(gtk_style_context_get_color, vFpup) GO(gtk_style_context_get_direction, uFp) GO(gtk_style_context_get_font, pFpu) +GO(gtk_style_context_get_frame_clock, pFp) GO(gtk_style_context_get_junction_sides, uFp) GO(gtk_style_context_get_margin, vFpup) -GO(gtk_style_context_get_padding, vFpip) +GO(gtk_style_context_get_padding, vFpup) GO(gtk_style_context_get_parent, pFp) GO(gtk_style_context_get_path, pFp) GO(gtk_style_context_get_property, vFppup) -GO(gtk_style_context_get_frame_clock, pFp) GO(gtk_style_context_get_scale, iFp) GO(gtk_style_context_get_screen, pFp) GO(gtk_style_context_get_section, pFpp) GO(gtk_style_context_get_state, uFp) -GO2(gtk_style_context_get_style, vFpV, gtk_style_context_get_style_valist) +GOM(gtk_style_context_get_style, vFEpV) GO(gtk_style_context_get_style_property, vFppp) GOM(gtk_style_context_get_style_valist, vFEpA) -GOM(gtk_style_context_get_valist, vFEpiA) +GO(gtk_style_context_get_type, LFv) +GOM(gtk_style_context_get_valist, vFEpuA) GO(gtk_style_context_has_class, iFpp) GO(gtk_style_context_has_region, iFppp) GO(gtk_style_context_invalidate, vFp) @@ -2842,14 +3163,15 @@ GO(gtk_style_context_lookup_icon_set, pFpp) GO(gtk_style_context_new, pFv) GO(gtk_style_context_notify_state_change, vFpppui) GO(gtk_style_context_pop_animatable_region, vFp) +GO(gtk_style_context_print_flags_get_type, LFv) GO(gtk_style_context_push_animatable_region, vFpp) -GO(gtk_style_context_restore, vFp) GO(gtk_style_context_remove_class, vFpp) GO(gtk_style_context_remove_provider, vFpp) GO(gtk_style_context_remove_provider_for_display, vFpp) GO(gtk_style_context_remove_provider_for_screen, vFpp) GO(gtk_style_context_remove_region, vFpp) GO(gtk_style_context_reset_widgets, vFp) +GO(gtk_style_context_restore, vFp) GO(gtk_style_context_save, vFp) GO(gtk_style_context_scroll_animations, vFppii) GO(gtk_style_context_set_background, vFpp) @@ -2865,23 +3187,53 @@ GO(gtk_style_context_state_is_running, iFpup) GO(gtk_style_context_to_string, pFpu) GO(gtk_style_copy, pFp) GO(gtk_style_detach, vFp) -GO(gtk_style_get, vFpippppppppppp) //vaarg, wrap with gtk_style_get_valist? -GO(gtk_style_get_font, pFp) +//GOM(gtk_style_get, vFpLpV) GO(gtk_style_get_style_property, vFpLpp) GO(gtk_style_get_type, LFv) -//GO(gtk_style_get_valist, vFpipA) +//GOM(gtk_style_get_valist, vFpLpA) +GO(gtk_style_has_context, iFp) GO(gtk_style_lookup_color, iFppp) GO(gtk_style_lookup_icon_set, pFpp) GO(gtk_style_new, pFv) -GO(gtk_style_ref, pFp) +GO(gtk_style_properties_clear, vFp) +//GOM(gtk_style_properties_get, vFpuV) +GO(gtk_style_properties_get_property, iFppup) +GO(gtk_style_properties_get_type, LFv) +//GOM(gtk_style_properties_get_valist, vFpuA) +GO(gtk_style_properties_lookup_color, pFpp) +//GOM(gtk_style_properties_lookup_property, iFppp) +GO(gtk_style_properties_map_color, vFppp) +GO(gtk_style_properties_merge, vFppi) +GO(gtk_style_properties_new, pFv) +//GOM(gtk_style_properties_register_property, vFpp) +//GOM(gtk_style_properties_set, vFpuV) +GO(gtk_style_properties_set_property, vFppup) +//GOM(gtk_style_properties_set_valist, vFpuA) +GO(gtk_style_properties_unset_property, vFppu) +GO(gtk_style_provider_get_icon_factory, pFpp) +GO(gtk_style_provider_get_style, pFpp) +GO(gtk_style_provider_get_style_property, iFppupp) +GO(gtk_style_provider_get_type, LFv) GO(gtk_style_render_icon, pFppuuupp) GO(gtk_style_set_background, vFppu) -GO(gtk_style_set_font, vFpp) -GO(gtk_style_provider_get_type, LFv) -GO(gtk_style_unref, vFp) -GO(gtk_submenu_direction_get_type, LFv) -GO(gtk_submenu_placement_get_type, LFv) +GO(gtk_switch_accessible_get_type, LFv) +GO(gtk_switch_get_active, iFp) +GO(gtk_switch_get_state, iFp) GO(gtk_switch_get_type, LFv) +GO(gtk_switch_new, pFv) +GO(gtk_switch_set_active, vFpi) +GO(gtk_switch_set_state, vFpi) +GO(gtk_symbolic_color_get_type, LFv) +GO(gtk_symbolic_color_new_alpha, pFpd) +GO(gtk_symbolic_color_new_literal, pFp) +GO(gtk_symbolic_color_new_mix, pFppd) +GO(gtk_symbolic_color_new_name, pFp) +GO(gtk_symbolic_color_new_shade, pFpd) +GO(gtk_symbolic_color_new_win32, pFpi) +GO(gtk_symbolic_color_ref, pFp) +GO(gtk_symbolic_color_resolve, iFppp) +GO(gtk_symbolic_color_to_string, pFp) +GO(gtk_symbolic_color_unref, vFp) GO(gtk_table_attach, vFppuuuuuuuu) GO(gtk_table_attach_defaults, vFppuuuu) GO(gtk_table_get_col_spacing, uFpu) @@ -2898,7 +3250,10 @@ GO(gtk_table_set_col_spacings, vFpu) GO(gtk_table_set_homogeneous, vFpi) GO(gtk_table_set_row_spacing, vFpuu) GO(gtk_table_set_row_spacings, vFpu) +GO(gtk_target_entry_copy, pFp) +GO(gtk_target_entry_free, vFp) GO(gtk_target_entry_get_type, LFv) +GO(gtk_target_entry_new, pFpuu) GO(gtk_target_flags_get_type, LFv) GO(gtk_target_list_add, vFppuu) GO(gtk_target_list_add_image_targets, vFpui) @@ -2921,12 +3276,12 @@ GO(gtk_target_table_new_from_list, pFpp) GO(gtk_tearoff_menu_item_get_type, LFv) GO(gtk_tearoff_menu_item_new, pFv) GO(gtk_test_create_simple_window, pFpp) -//GO(gtk_test_create_widget, -//GO(gtk_test_display_button_window, +//GOM(gtk_test_create_widget, pFLpV) +//GOM(gtk_test_display_button_window, pFppV) GO(gtk_test_find_label, pFpp) GO(gtk_test_find_sibling, pFpL) GO(gtk_test_find_widget, pFppL) -//GO(gtk_test_init, +//GOM(gtk_test_init, vFppV) GO(gtk_test_list_all_types, pFp) GO(gtk_test_register_all_types, vFv) GO(gtk_test_slider_get_value, dFp) @@ -2934,20 +3289,20 @@ GO(gtk_test_slider_set_perc, vFpd) GO(gtk_test_spin_button_click, iFpui) GO(gtk_test_text_get, pFp) GO(gtk_test_text_set, vFpp) -//GO(gtk_test_widget_click, +GO(gtk_test_widget_click, iFpuu) GO(gtk_test_widget_send_key, iFpuu) -GO(gtk_text_anchored_child_set_layout, vFpp) +GO(gtk_test_widget_wait_for_draw, vFp) +//GO(gtk_text_anchored_child_set_layout, GO(gtk_text_attributes_copy, pFp) GO(gtk_text_attributes_copy_values, vFpp) GO(gtk_text_attributes_get_type, LFv) GO(gtk_text_attributes_new, pFv) GO(gtk_text_attributes_ref, pFp) GO(gtk_text_attributes_unref, vFp) -GO(gtk_text_backward_delete, iFpu) -GO(gtk_text_buffer_add_mark, vFpp) +GO(gtk_text_buffer_add_mark, vFppp) GO(gtk_text_buffer_add_selection_clipboard, vFpp) GO(gtk_text_buffer_apply_tag, vFpppp) -GO(gtk_text_buffer_apply_tag_by_name, vFpp) +GO(gtk_text_buffer_apply_tag_by_name, vFpppp) GO(gtk_text_buffer_backspace, iFppii) GO(gtk_text_buffer_begin_user_action, vFp) GO(gtk_text_buffer_copy_clipboard, vFpp) @@ -2994,6 +3349,7 @@ GO(gtk_text_buffer_insert_at_cursor, vFppi) GO(gtk_text_buffer_insert_child_anchor, vFppp) GO(gtk_text_buffer_insert_interactive, iFpppii) GO(gtk_text_buffer_insert_interactive_at_cursor, iFppii) +GO(gtk_text_buffer_insert_markup, vFpppi) GO(gtk_text_buffer_insert_pixbuf, vFppp) GO(gtk_text_buffer_insert_range, vFpppp) GO(gtk_text_buffer_insert_range_interactive, iFppppi) @@ -3004,9 +3360,9 @@ GO(gtk_text_buffer_move_mark_by_name, vFppp) GO(gtk_text_buffer_new, pFp) GO(gtk_text_buffer_paste_clipboard, vFpppi) GO(gtk_text_buffer_place_cursor, vFpp) -//GOM(gtk_text_buffer_register_deserialize_format, pFEppBpB) +//GOM(gtk_text_buffer_register_deserialize_format, pFEppppp) GO(gtk_text_buffer_register_deserialize_tagset, pFpp) -//GOM(gtk_text_buffer_register_serialize_format, pFppBpB) +//GOM(gtk_text_buffer_register_serialize_format, pFppppp) GO(gtk_text_buffer_register_serialize_tagset, pFpp) GO(gtk_text_buffer_remove_all_tags, vFppp) GO(gtk_text_buffer_remove_selection_clipboard, vFpp) @@ -3019,7 +3375,8 @@ GO(gtk_text_buffer_set_text, vFppi) GO(gtk_text_buffer_target_info_get_type, LFv) GO(gtk_text_buffer_unregister_deserialize_format, vFpp) GO(gtk_text_buffer_unregister_serialize_format, vFpp) -GO(gtk_text_byte_begins_utf8_char, iFp) +//GO(gtk_text_byte_begins_utf8_char, +GO(gtk_text_cell_accessible_get_type, LFv) GO(gtk_text_child_anchor_get_deleted, iFp) GO(gtk_text_child_anchor_get_type, LFv) GO(gtk_text_child_anchor_get_widgets, pFp) @@ -3028,12 +3385,8 @@ GO(gtk_text_child_anchor_queue_resize, vFpp) GO(gtk_text_child_anchor_register_child, vFppp) GO(gtk_text_child_anchor_unregister_child, vFpp) GO(gtk_text_direction_get_type, LFv) -GO(gtk_text_forward_delete, iFpu) -GO(gtk_text_freeze, vFp) -GO(gtk_text_get_length, uFp) -GO(gtk_text_get_point, uFp) -GO(gtk_text_get_type, LFv) -GO(gtk_text_insert, vFpppppi) +GO(gtk_text_extend_selection_get_type, LFv) +GO(gtk_text_iter_assign, vFpp) GO(gtk_text_iter_backward_char, iFp) GO(gtk_text_iter_backward_chars, iFpi) GO(gtk_text_iter_backward_cursor_position, iFp) @@ -3073,7 +3426,7 @@ GO(gtk_text_iter_forward_lines, iFpi) GO(gtk_text_iter_forward_search, iFppuppp) GO(gtk_text_iter_forward_sentence_end, iFp) GO(gtk_text_iter_forward_sentence_ends, iFpi) -GO(gtk_text_iter_forward_to_end, iFp) +GO(gtk_text_iter_forward_to_end, vFp) GO(gtk_text_iter_forward_to_line_end, iFp) GO(gtk_text_iter_forward_to_tag_toggle, iFpp) GO(gtk_text_iter_forward_visible_cursor_position, iFp) @@ -3123,6 +3476,7 @@ GO(gtk_text_iter_set_visible_line_index, vFpi) GO(gtk_text_iter_set_visible_line_offset, vFpi) GO(gtk_text_iter_starts_line, iFp) GO(gtk_text_iter_starts_sentence, iFp) +GO(gtk_text_iter_starts_tag, iFpp) GO(gtk_text_iter_starts_word, iFp) GO(gtk_text_iter_toggles_tag, iFpp) //GO(gtk_text_layout_changed, @@ -3144,7 +3498,7 @@ GO(gtk_text_iter_toggles_tag, iFpp) //GO(gtk_text_layout_get_lines, //GO(gtk_text_layout_get_line_yrange, //GO(gtk_text_layout_get_size, -GO(gtk_text_layout_get_type, LFv) +//GO(gtk_text_layout_get_type, //GO(gtk_text_layout_invalidate, //GO(gtk_text_layout_invalidate_cursors, //GO(gtk_text_layout_is_valid, @@ -3179,41 +3533,41 @@ GO(gtk_text_mark_get_type, LFv) GO(gtk_text_mark_get_visible, iFp) GO(gtk_text_mark_new, pFpi) GO(gtk_text_mark_set_visible, vFpi) -GO(gtk_text_new, pFpp) GO(gtk_text_search_flags_get_type, LFv) -GO(gtk_text_set_adjustments, vFppp) -GO(gtk_text_set_editable, vFpi) -GO(gtk_text_set_line_wrap, vFpi) -GO(gtk_text_set_point, vFpu) -GO(gtk_text_set_word_wrap, vFpi) +GO(gtk_text_tag_changed, vFpi) GO(gtk_text_tag_event, iFpppp) GO(gtk_text_tag_get_priority, iFp) GO(gtk_text_tag_get_type, LFv) GO(gtk_text_tag_new, pFp) GO(gtk_text_tag_set_priority, vFpi) GO(gtk_text_tag_table_add, iFpp) -//GOM(gtk_text_tag_table_foreach, vFEpBp) +//GOM(gtk_text_tag_table_foreach, vFEppp) GO(gtk_text_tag_table_get_size, iFp) GO(gtk_text_tag_table_get_type, LFv) GO(gtk_text_tag_table_lookup, pFpp) GO(gtk_text_tag_table_new, pFv) GO(gtk_text_tag_table_remove, vFpp) -GO(gtk_text_thaw, vFp) +//GO(gtk_text_unknown_char_utf8_gtk_tests_only, +GO(gtk_text_view_accessible_get_type, LFv) GO(gtk_text_view_add_child_at_anchor, vFppp) GO(gtk_text_view_add_child_in_window, vFppuii) GO(gtk_text_view_backward_display_line, iFpp) GO(gtk_text_view_backward_display_line_start, iFpp) -GO(gtk_text_view_buffer_to_window_coords, vFpiiipp) +GO(gtk_text_view_buffer_to_window_coords, vFpuiipp) GO(gtk_text_view_forward_display_line, iFpp) GO(gtk_text_view_forward_display_line_end, iFpp) GO(gtk_text_view_get_accepts_tab, iFp) GO(gtk_text_view_get_border_window_size, iFpu) +GO(gtk_text_view_get_bottom_margin, iFp) GO(gtk_text_view_get_buffer, pFp) +GO(gtk_text_view_get_cursor_locations, vFpppp) GO(gtk_text_view_get_cursor_visible, iFp) GO(gtk_text_view_get_default_attributes, pFp) GO(gtk_text_view_get_editable, iFp) GO(gtk_text_view_get_hadjustment, pFp) GO(gtk_text_view_get_indent, iFp) +GO(gtk_text_view_get_input_hints, uFp) +GO(gtk_text_view_get_input_purpose, uFp) GO(gtk_text_view_get_iter_at_location, iFppii) GO(gtk_text_view_get_iter_at_position, iFpppii) GO(gtk_text_view_get_iter_location, vFppp) @@ -3221,12 +3575,14 @@ GO(gtk_text_view_get_justification, uFp) GO(gtk_text_view_get_left_margin, iFp) GO(gtk_text_view_get_line_at_y, vFppip) GO(gtk_text_view_get_line_yrange, vFpppp) +GO(gtk_text_view_get_monospace, iFp) GO(gtk_text_view_get_overwrite, iFp) GO(gtk_text_view_get_pixels_above_lines, iFp) GO(gtk_text_view_get_pixels_below_lines, iFp) GO(gtk_text_view_get_pixels_inside_wrap, iFp) GO(gtk_text_view_get_right_margin, iFp) GO(gtk_text_view_get_tabs, pFp) +GO(gtk_text_view_get_top_margin, iFp) GO(gtk_text_view_get_type, LFv) GO(gtk_text_view_get_vadjustment, pFp) GO(gtk_text_view_get_visible_rect, vFpp) @@ -3234,53 +3590,75 @@ GO(gtk_text_view_get_window, pFpu) GO(gtk_text_view_get_window_type, uFpp) GO(gtk_text_view_get_wrap_mode, uFp) GO(gtk_text_view_im_context_filter_keypress, iFpp) +GO(gtk_text_view_layer_get_type, LFv) GO(gtk_text_view_move_child, vFppii) GO(gtk_text_view_move_mark_onscreen, iFpp) GO(gtk_text_view_move_visually, iFppi) GO(gtk_text_view_new, pFv) GO(gtk_text_view_new_with_buffer, pFp) GO(gtk_text_view_place_cursor_onscreen, iFp) +GO(gtk_text_view_reset_cursor_blink, vFp) GO(gtk_text_view_reset_im_context, vFp) GO(gtk_text_view_scroll_mark_onscreen, vFpp) GO(gtk_text_view_scroll_to_iter, iFppdidd) GO(gtk_text_view_scroll_to_mark, vFppdidd) GO(gtk_text_view_set_accepts_tab, vFpi) GO(gtk_text_view_set_border_window_size, vFpui) +GO(gtk_text_view_set_bottom_margin, vFpi) GO(gtk_text_view_set_buffer, vFpp) GO(gtk_text_view_set_cursor_visible, vFpi) GO(gtk_text_view_set_editable, vFpi) GO(gtk_text_view_set_indent, vFpi) +GO(gtk_text_view_set_input_hints, vFpu) +GO(gtk_text_view_set_input_purpose, vFpu) GO(gtk_text_view_set_justification, vFpu) GO(gtk_text_view_set_left_margin, vFpi) +GO(gtk_text_view_set_monospace, vFpi) GO(gtk_text_view_set_overwrite, vFpi) GO(gtk_text_view_set_pixels_above_lines, vFpi) GO(gtk_text_view_set_pixels_below_lines, vFpi) GO(gtk_text_view_set_pixels_inside_wrap, vFpi) GO(gtk_text_view_set_right_margin, vFpi) GO(gtk_text_view_set_tabs, vFpp) +GO(gtk_text_view_set_top_margin, vFpi) GO(gtk_text_view_set_wrap_mode, vFpu) GO(gtk_text_view_starts_display_line, iFpp) GO(gtk_text_view_window_to_buffer_coords, vFpuiipp) GO(gtk_text_window_type_get_type, LFv) -//GO(gtk_theme_engine_create_rc_style, -//GO(gtk_theme_engine_get, -GO(gtk_theme_engine_get_type, LFv) -GOM(gtk_timeout_add, uFEupp) -//GOM(gtk_timeout_add_full, uFuBppB) -GO(gtk_timeout_remove, vFu) -GO(gtk_tips_query_get_type, LFv) -//GO(gtk_tips_query_new, -//GO(gtk_tips_query_set_caller, -//GO(gtk_tips_query_set_labels, -//GO(gtk_tips_query_start_query, -//GO(gtk_tips_query_stop_query, -//GO(gtk_toggle_action_get_active, +//GOM(gtk_theming_engine_get, vFpuV) +GO(gtk_theming_engine_get_background_color, vFpup) +GO(gtk_theming_engine_get_border, vFpup) +GO(gtk_theming_engine_get_border_color, vFpup) +GO(gtk_theming_engine_get_color, vFpup) +GO(gtk_theming_engine_get_direction, uFp) +GO(gtk_theming_engine_get_font, pFpu) +GO(gtk_theming_engine_get_junction_sides, uFp) +GO(gtk_theming_engine_get_margin, vFpup) +GO(gtk_theming_engine_get_padding, vFpup) +GO(gtk_theming_engine_get_path, pFp) +GO(gtk_theming_engine_get_property, vFppup) +GO(gtk_theming_engine_get_screen, pFp) +GO(gtk_theming_engine_get_state, uFp) +//GOM(gtk_theming_engine_get_style, vFpV) +GO(gtk_theming_engine_get_style_property, vFppp) +//GOM(gtk_theming_engine_get_style_valist, vFpA) +GO(gtk_theming_engine_get_type, LFv) +//GOM(gtk_theming_engine_get_valist, vFpuA) +GO(gtk_theming_engine_has_class, iFpp) +GO(gtk_theming_engine_has_region, iFppp) +GO(gtk_theming_engine_load, pFp) +GO(gtk_theming_engine_lookup_color, iFppp) +//GOM(gtk_theming_engine_register_property, vFppp) +GO(gtk_theming_engine_state_is_running, iFpup) +//GO(gtk_theming_module_get_type, +GO(gtk_toggle_action_get_active, iFp) GO(gtk_toggle_action_get_draw_as_radio, iFp) GO(gtk_toggle_action_get_type, LFv) GO(gtk_toggle_action_new, pFpppp) -//GO(gtk_toggle_action_set_active, -//GO(gtk_toggle_action_set_draw_as_radio, +GO(gtk_toggle_action_set_active, vFpi) +GO(gtk_toggle_action_set_draw_as_radio, vFpi) GO(gtk_toggle_action_toggled, vFp) +GO(gtk_toggle_button_accessible_get_type, LFv) GO(gtk_toggle_button_get_active, iFp) GO(gtk_toggle_button_get_inconsistent, iFp) GO(gtk_toggle_button_get_mode, iFp) @@ -3297,40 +3675,21 @@ GO(gtk_toggle_tool_button_get_type, LFv) GO(gtk_toggle_tool_button_new, pFv) GO(gtk_toggle_tool_button_new_from_stock, pFp) GO(gtk_toggle_tool_button_set_active, vFpi) -GOM(gtk_toolbar_append_element, pFEpippppppp) -GOM(gtk_toolbar_append_item, pFEppppppp) -GO(gtk_toolbar_append_space, vFp) -GO(gtk_toolbar_append_widget, vFpppp) -GO(gtk_toolbar_child_type_get_type, LFv) GO(gtk_toolbar_get_drop_index, iFpii) GO(gtk_toolbar_get_icon_size, uFp) GO(gtk_toolbar_get_item_index, iFpp) GO(gtk_toolbar_get_n_items, iFp) GO(gtk_toolbar_get_nth_item, pFpi) -GO(gtk_toolbar_get_orientation, iFp) GO(gtk_toolbar_get_relief_style, uFp) GO(gtk_toolbar_get_show_arrow, iFp) GO(gtk_toolbar_get_style, uFp) -GO(gtk_toolbar_get_tooltips, iFp) GO(gtk_toolbar_get_type, LFv) GO(gtk_toolbar_insert, vFppi) -GOM(gtk_toolbar_insert_element, pFEpipppppppi) -GOM(gtk_toolbar_insert_item, pFEpppppppi) -GO(gtk_toolbar_insert_space, vFpi) -GOM(gtk_toolbar_insert_stock, pFEppppppi) -GO(gtk_toolbar_insert_widget, vFppppi) GO(gtk_toolbar_new, pFv) -GOM(gtk_toolbar_prepend_element, pFEpippppppp) -GOM(gtk_toolbar_prepend_item, pFEppppppp) -GO(gtk_toolbar_prepend_space, vFp) -GO(gtk_toolbar_prepend_widget, vFpppp) -GO(gtk_toolbar_remove_space, vFpi) GO(gtk_toolbar_set_drop_highlight_item, vFppi) GO(gtk_toolbar_set_icon_size, vFpu) -GO(gtk_toolbar_set_orientation, vFpi) GO(gtk_toolbar_set_show_arrow, vFpi) GO(gtk_toolbar_set_style, vFpu) -GO(gtk_toolbar_set_tooltips, vFpi) GO(gtk_toolbar_space_style_get_type, LFv) GO(gtk_toolbar_style_get_type, LFv) GO(gtk_toolbar_unset_icon_size, vFp) @@ -3351,11 +3710,11 @@ GO(gtk_tool_button_set_label_widget, vFpp) GO(gtk_tool_button_set_stock_id, vFpp) GO(gtk_tool_button_set_use_underline, vFpi) GO(gtk_tool_item_get_ellipsize_mode, uFp) -//GO(gtk_tool_item_get_expand, -//GO(gtk_tool_item_get_homogeneous, +GO(gtk_tool_item_get_expand, iFp) +GO(gtk_tool_item_get_homogeneous, iFp) GO(gtk_tool_item_get_icon_size, uFp) -//GO(gtk_tool_item_get_is_important, -//GO(gtk_tool_item_get_orientation, +GO(gtk_tool_item_get_is_important, iFp) +GO(gtk_tool_item_get_orientation, uFp) GO(gtk_tool_item_get_proxy_menu_item, pFpp) GO(gtk_tool_item_get_relief_style, uFp) GO(gtk_tool_item_get_text_alignment, fFp) @@ -3363,9 +3722,9 @@ GO(gtk_tool_item_get_text_orientation, uFp) GO(gtk_tool_item_get_text_size_group, pFp) GO(gtk_tool_item_get_toolbar_style, uFp) GO(gtk_tool_item_get_type, LFv) -//GO(gtk_tool_item_get_use_drag_window, -//GO(gtk_tool_item_get_visible_horizontal, -//GO(gtk_tool_item_get_visible_vertical, +GO(gtk_tool_item_get_use_drag_window, iFp) +GO(gtk_tool_item_get_visible_horizontal, iFp) +GO(gtk_tool_item_get_visible_vertical, iFp) GO(gtk_tool_item_group_get_collapsed, iFp) GO(gtk_tool_item_group_get_drop_item, pFpii) GO(gtk_tool_item_group_get_ellipsize, uFp) @@ -3376,122 +3735,100 @@ GO(gtk_tool_item_group_get_label_widget, pFp) GO(gtk_tool_item_group_get_n_items, uFp) GO(gtk_tool_item_group_get_nth_item, pFpu) GO(gtk_tool_item_group_get_type, LFv) -//GO(gtk_tool_item_group_insert, -//GO(gtk_tool_item_group_new, +GO(gtk_tool_item_group_insert, vFppi) +GO(gtk_tool_item_group_new, pFp) GO(gtk_tool_item_group_set_collapsed, vFpi) GO(gtk_tool_item_group_set_ellipsize, vFpu) GO(gtk_tool_item_group_set_header_relief, vFpu) GO(gtk_tool_item_group_set_item_position, vFppi) GO(gtk_tool_item_group_set_label, vFpp) GO(gtk_tool_item_group_set_label_widget, vFpp) -//GO(gtk_tool_item_new, -//GO(gtk_tool_item_rebuild_menu, +GO(gtk_tool_item_new, pFv) +GO(gtk_tool_item_rebuild_menu, vFp) GO(gtk_tool_item_retrieve_proxy_menu_item, pFp) -//GO(gtk_tool_item_set_expand, -//GO(gtk_tool_item_set_homogeneous, +GO(gtk_tool_item_set_expand, vFpi) +GO(gtk_tool_item_set_homogeneous, vFpi) GO(gtk_tool_item_set_is_important, vFpi) GO(gtk_tool_item_set_proxy_menu_item, vFppp) -//GO(gtk_tool_item_set_tooltip, GO(gtk_tool_item_set_tooltip_markup, vFpp) -//GO(gtk_tool_item_set_tooltip_text, -//GO(gtk_tool_item_set_use_drag_window, -//GO(gtk_tool_item_set_visible_horizontal, -//GO(gtk_tool_item_set_visible_vertical, -//GO(gtk_tool_item_toolbar_reconfigured, +GO(gtk_tool_item_set_tooltip_text, vFpp) +GO(gtk_tool_item_set_use_drag_window, vFpi) +GO(gtk_tool_item_set_visible_horizontal, vFpi) +GO(gtk_tool_item_set_visible_vertical, vFpi) +GO(gtk_tool_item_toolbar_reconfigured, vFp) GO(gtk_tool_palette_add_drag_dest, vFppuuu) GO(gtk_tool_palette_drag_targets_get_type, LFv) GO(gtk_tool_palette_get_drag_item, pFpp) GO(gtk_tool_palette_get_drag_target_group, pFv) -//GO(gtk_tool_palette_get_drag_target_item, +GO(gtk_tool_palette_get_drag_target_item, pFv) GO(gtk_tool_palette_get_drop_group, pFpii) GO(gtk_tool_palette_get_drop_item, pFpii) -//GO(gtk_tool_palette_get_exclusive, +GO(gtk_tool_palette_get_exclusive, iFpp) GO(gtk_tool_palette_get_expand, iFpp) GO(gtk_tool_palette_get_group_position, iFpp) -//GO(gtk_tool_palette_get_hadjustment, +GO(gtk_tool_palette_get_hadjustment, pFp) GO(gtk_tool_palette_get_icon_size, uFp) GO(gtk_tool_palette_get_style, uFp) GO(gtk_tool_palette_get_type, LFv) GO(gtk_tool_palette_get_vadjustment, pFp) -//GO(gtk_tool_palette_new, +GO(gtk_tool_palette_new, pFv) GO(gtk_tool_palette_set_drag_source, vFpu) -//GO(gtk_tool_palette_set_exclusive, +GO(gtk_tool_palette_set_exclusive, vFppi) GO(gtk_tool_palette_set_expand, vFppi) GO(gtk_tool_palette_set_group_position, vFppi) GO(gtk_tool_palette_set_icon_size, vFpu) GO(gtk_tool_palette_set_style, vFpu) -//GO(gtk_tool_palette_unset_icon_size, -//GO(gtk_tool_palette_unset_style, +GO(gtk_tool_palette_unset_icon_size, vFp) +GO(gtk_tool_palette_unset_style, vFp) GO(gtk_tool_shell_get_ellipsize_mode, uFp) GO(gtk_tool_shell_get_icon_size, uFp) -//GO(gtk_tool_shell_get_orientation, +GO(gtk_tool_shell_get_orientation, uFp) GO(gtk_tool_shell_get_relief_style, uFp) GO(gtk_tool_shell_get_style, uFp) GO(gtk_tool_shell_get_text_alignment, fFp) GO(gtk_tool_shell_get_text_orientation, uFp) GO(gtk_tool_shell_get_text_size_group, pFp) GO(gtk_tool_shell_get_type, LFv) -//GO(gtk_tool_shell_rebuild_menu, +GO(gtk_tool_shell_rebuild_menu, vFp) GO(gtk_tooltip_get_type, LFv) -GO(gtk_tooltips_data_get, pFp) -GO(gtk_tooltips_disable, vFp) -GO(gtk_tooltips_enable, vFp) GO(gtk_tooltip_set_custom, vFpp) GO(gtk_tooltip_set_icon, vFpp) GO(gtk_tooltip_set_icon_from_gicon, vFppu) GO(gtk_tooltip_set_icon_from_icon_name, vFppu) -//GO(gtk_tooltip_set_icon_from_stock, -//GO(gtk_tooltip_set_markup, +GO(gtk_tooltip_set_icon_from_stock, vFppu) +GO(gtk_tooltip_set_markup, vFpp) GO(gtk_tooltip_set_text, vFpp) GO(gtk_tooltip_set_tip_area, vFpp) -GO(gtk_tooltips_force_window, vFp) -GO(gtk_tooltips_get_info_from_tip_window, iFppp) -GO(gtk_tooltips_get_type, LFv) -GO(gtk_tooltips_new, pFv) -GO(gtk_tooltips_set_delay, vFpu) -GO(gtk_tooltips_set_tip, vFpppp) GO(gtk_tooltip_trigger_tooltip_query, vFp) -GO(gtk_tray_icon_get_type, LFv) -//GO(gtk_tree_append, -//GO(gtk_tree_child_position, -//GO(gtk_tree_clear_items, -//GO(gtk_tree_drag_dest_drag_data_received, +GO(gtk_toplevel_accessible_get_children, pFp) +GO(gtk_toplevel_accessible_get_type, LFv) +//GO(gtk_tray_icon_get_type, +GO(gtk_tree_drag_dest_drag_data_received, iFppp) GO(gtk_tree_drag_dest_get_type, LFv) GO(gtk_tree_drag_dest_row_drop_possible, iFppp) GO(gtk_tree_drag_source_drag_data_delete, iFpp) GO(gtk_tree_drag_source_drag_data_get, iFppp) GO(gtk_tree_drag_source_get_type, LFv) -//GO(gtk_tree_drag_source_row_draggable, +GO(gtk_tree_drag_source_row_draggable, iFpp) GO(gtk_tree_get_row_drag_data, iFppp) -GO(gtk_tree_get_type, LFv) -//GO(gtk_tree_insert, -//GO(gtk_tree_item_collapse, -//GO(gtk_tree_item_deselect, -//GO(gtk_tree_item_expand, -GO(gtk_tree_item_get_type, LFv) -//GO(gtk_tree_item_new, -//GO(gtk_tree_item_new_with_label, -//GO(gtk_tree_item_remove_subtree, -//GO(gtk_tree_item_select, -//GO(gtk_tree_item_set_subtree, GO(gtk_tree_iter_copy, pFp) GO(gtk_tree_iter_free, vFp) GO(gtk_tree_iter_get_type, LFv) -//GO(gtk_tree_model_filter_clear_cache, +GO(gtk_tree_model_filter_clear_cache, vFp) GO(gtk_tree_model_filter_convert_child_iter_to_iter, iFppp) -//GO(gtk_tree_model_filter_convert_child_path_to_path, +GO(gtk_tree_model_filter_convert_child_path_to_path, pFpp) GO(gtk_tree_model_filter_convert_iter_to_child_iter, vFppp) GO(gtk_tree_model_filter_convert_path_to_child_path, pFpp) GO(gtk_tree_model_filter_get_model, pFp) GO(gtk_tree_model_filter_get_type, LFv) GO(gtk_tree_model_filter_new, pFpp) -//GO(gtk_tree_model_filter_refilter, -//GO(gtk_tree_model_filter_set_modify_func, +GO(gtk_tree_model_filter_refilter, vFp) +//GOM(gtk_tree_model_filter_set_modify_func, vFpipppp) GO(gtk_tree_model_filter_set_visible_column, vFpi) -//GO(gtk_tree_model_filter_set_visible_func, +//GOM(gtk_tree_model_filter_set_visible_func, vFpppp) GO(gtk_tree_model_flags_get_type, LFv) -//GOM(gtk_tree_model_foreach, vFEpBp) -//GO2(gtk_tree_model_get, vFppV, gtk_tree_model_get_valist) +//GOM(gtk_tree_model_foreach, vFEppp) +GOM(gtk_tree_model_get, vFppV) GO(gtk_tree_model_get_column_type, LFpi) GO(gtk_tree_model_get_flags, uFp) GO(gtk_tree_model_get_iter, iFppp) @@ -3501,7 +3838,7 @@ GO(gtk_tree_model_get_n_columns, iFp) GO(gtk_tree_model_get_path, pFpp) GO(gtk_tree_model_get_string_from_iter, pFpp) GO(gtk_tree_model_get_type, LFv) -//GO(gtk_tree_model_get_valist, vFppp) +GOM(gtk_tree_model_get_valist, vFppA) GO(gtk_tree_model_get_value, vFppip) GO(gtk_tree_model_iter_children, iFppp) GO(gtk_tree_model_iter_has_child, iFpp) @@ -3509,24 +3846,25 @@ GO(gtk_tree_model_iter_n_children, iFpp) GO(gtk_tree_model_iter_next, iFpp) GO(gtk_tree_model_iter_nth_child, iFpppi) GO(gtk_tree_model_iter_parent, iFppp) +GO(gtk_tree_model_iter_previous, iFpp) GO(gtk_tree_model_ref_node, vFpp) GO(gtk_tree_model_row_changed, vFppp) GO(gtk_tree_model_row_deleted, vFpp) GO(gtk_tree_model_row_has_child_toggled, vFppp) GO(gtk_tree_model_row_inserted, vFppp) GO(gtk_tree_model_rows_reordered, vFpppp) -//GO(gtk_tree_model_sort_clear_cache, +GO(gtk_tree_model_rows_reordered_with_length, vFppppi) +GO(gtk_tree_model_sort_clear_cache, vFp) GO(gtk_tree_model_sort_convert_child_iter_to_iter, iFppp) -//GO(gtk_tree_model_sort_convert_child_path_to_path, +GO(gtk_tree_model_sort_convert_child_path_to_path, pFpp) GO(gtk_tree_model_sort_convert_iter_to_child_iter, vFppp) GO(gtk_tree_model_sort_convert_path_to_child_path, pFpp) GO(gtk_tree_model_sort_get_model, pFp) GO(gtk_tree_model_sort_get_type, LFv) GO(gtk_tree_model_sort_iter_is_valid, iFpp) GO(gtk_tree_model_sort_new_with_model, pFp) -//GO(gtk_tree_model_sort_reset_default_sort_func, +GO(gtk_tree_model_sort_reset_default_sort_func, vFp) GO(gtk_tree_model_unref_node, vFpp) -//GO(gtk_tree_new, GO(gtk_tree_path_append_index, vFpi) GO(gtk_tree_path_compare, iFpp) GO(gtk_tree_path_copy, pFp) @@ -3541,15 +3879,13 @@ GO(gtk_tree_path_is_descendant, iFpp) GO(gtk_tree_path_new, pFv) GO(gtk_tree_path_new_first, pFv) GO(gtk_tree_path_new_from_indices, pFippppppppppppppppp) // vaarg +GO(gtk_tree_path_new_from_indicesv, pFpL) GO(gtk_tree_path_new_from_string, pFp) GO(gtk_tree_path_next, vFp) GO(gtk_tree_path_prepend_index, vFpi) -GO(gtk_tree_path_prev, vFp) +GO(gtk_tree_path_prev, iFp) GO(gtk_tree_path_to_string, pFp) GO(gtk_tree_path_up, iFp) -//GO(gtk_tree_prepend, -//GO(gtk_tree_remove_item, -//GO(gtk_tree_remove_items, GO(gtk_tree_row_reference_copy, pFp) GO(gtk_tree_row_reference_deleted, vFpp) GO(gtk_tree_row_reference_free, vFp) @@ -3561,33 +3897,28 @@ GO(gtk_tree_row_reference_new, pFpp) GO(gtk_tree_row_reference_new_proxy, pFppp) GO(gtk_tree_row_reference_reordered, vFpppp) GO(gtk_tree_row_reference_valid, iFp) -//GO(gtk_tree_select_child, GO(gtk_tree_selection_count_selected_rows, iFp) GO(gtk_tree_selection_get_mode, uFp) GO(gtk_tree_selection_get_selected, iFppp) GO(gtk_tree_selection_get_selected_rows, pFpp) -//GOM(gtk_tree_selection_get_select_function, BFEp) +//GOM(gtk_tree_selection_get_select_function, pFEp) GO(gtk_tree_selection_get_tree_view, pFp) GO(gtk_tree_selection_get_type, LFv) -//GOM(gtk_tree_selection_get_user_data, pFEp) +GO(gtk_tree_selection_get_user_data, pFp) GO(gtk_tree_selection_iter_is_selected, iFpp) GO(gtk_tree_selection_path_is_selected, iFpp) GO(gtk_tree_selection_select_all, vFp) -//GOM(gtk_tree_selection_selected_foreach, vFEpBp) +//GOM(gtk_tree_selection_selected_foreach, vFEppp) GO(gtk_tree_selection_select_iter, vFpp) GO(gtk_tree_selection_select_path, vFpp) GO(gtk_tree_selection_select_range, vFppp) GO(gtk_tree_selection_set_mode, vFpu) -//GOM(gtk_tree_selection_set_select_function, vFEpBpB) +//GOM(gtk_tree_selection_set_select_function, vFEpppp) GO(gtk_tree_selection_unselect_all, vFp) GO(gtk_tree_selection_unselect_iter, vFpp) GO(gtk_tree_selection_unselect_path, vFpp) GO(gtk_tree_selection_unselect_range, vFppp) -//GO(gtk_tree_select_item, GO(gtk_tree_set_row_drag_data, iFppp) -//GO(gtk_tree_set_selection_mode, -//GO(gtk_tree_set_view_lines, -//GO(gtk_tree_set_view_mode, GO(gtk_tree_sortable_get_sort_column_id, iFppp) GO(gtk_tree_sortable_get_type, LFv) GO(gtk_tree_sortable_has_default_sort_func, iFp) @@ -3600,27 +3931,26 @@ GO(gtk_tree_store_clear, vFp) GO(gtk_tree_store_get_type, LFv) GO(gtk_tree_store_insert, vFpppi) GO(gtk_tree_store_insert_after, vFpppp) -//GO(gtk_tree_store_insert_before, -//GO(gtk_tree_store_insert_with_values, +GO(gtk_tree_store_insert_before, vFpppp) +//GOM(gtk_tree_store_insert_with_values, vFpppiV) GO(gtk_tree_store_insert_with_valuesv, vFpppippi) GO(gtk_tree_store_is_ancestor, iFppp) GO(gtk_tree_store_iter_depth, iFpp) GO(gtk_tree_store_iter_is_valid, iFpp) GO(gtk_tree_store_move_after, vFppp) -//GO(gtk_tree_store_move_before, -GOM(gtk_tree_store_new, pFEuV) +GO(gtk_tree_store_move_before, vFppp) +GOM(gtk_tree_store_new, pFEiV) GO(gtk_tree_store_newv, pFip) GO(gtk_tree_store_prepend, vFppp) -//GO(gtk_tree_store_remove, +GO(gtk_tree_store_remove, iFpp) GO(gtk_tree_store_reorder, vFppp) GOM(gtk_tree_store_set, vFEppV) GO(gtk_tree_store_set_column_types, vFpip) GOM(gtk_tree_store_set_valist, vFEppA) GO(gtk_tree_store_set_value, vFppip) GO(gtk_tree_store_set_valuesv, vFppppi) -//GO(gtk_tree_store_swap, -//GO(gtk_tree_unselect_child, -//GO(gtk_tree_unselect_item, +GO(gtk_tree_store_swap, vFppp) +GO(gtk_tree_view_accessible_get_type, LFv) GO(gtk_tree_view_append_column, iFpp) GO(gtk_tree_view_collapse_all, vFp) GO(gtk_tree_view_collapse_row, iFpp) @@ -3635,7 +3965,6 @@ GO(gtk_tree_view_column_clicked, vFp) GO(gtk_tree_view_column_focus_cell, vFpp) GO(gtk_tree_view_column_get_alignment, fFp) GO(gtk_tree_view_column_get_button, pFp) -GO(gtk_tree_view_column_get_cell_renderers, pFp) GO(gtk_tree_view_column_get_clickable, iFp) GO(gtk_tree_view_column_get_expand, iFp) GO(gtk_tree_view_column_get_fixed_width, iFp) @@ -3654,14 +3983,16 @@ GO(gtk_tree_view_column_get_type, LFv) GO(gtk_tree_view_column_get_visible, iFp) GO(gtk_tree_view_column_get_widget, pFp) GO(gtk_tree_view_column_get_width, iFp) +GO(gtk_tree_view_column_get_x_offset, iFp) GO(gtk_tree_view_column_new, pFv) +GO(gtk_tree_view_column_new_with_area, pFp) GO(gtk_tree_view_column_new_with_attributes, pFppppppppppppp) //vaarg GO(gtk_tree_view_column_pack_end, vFppi) GO(gtk_tree_view_column_pack_start, vFppi) GO(gtk_tree_view_column_queue_resize, vFp) GO(gtk_tree_view_columns_autosize, vFp) GO(gtk_tree_view_column_set_alignment, vFpf) -GO(gtk_tree_view_column_set_attributes, vFpppppppppppp) //vaarg +//GOM(gtk_tree_view_column_set_attributes, vFppV) GOM(gtk_tree_view_column_set_cell_data_func, vFEppppp) GO(gtk_tree_view_column_set_clickable, vFpi) GO(gtk_tree_view_column_set_expand, vFpi) @@ -3692,6 +4023,7 @@ GO(gtk_tree_view_enable_model_drag_source, vFpupiu) GO(gtk_tree_view_expand_all, vFp) GO(gtk_tree_view_expand_row, iFppi) GO(gtk_tree_view_expand_to_path, vFpp) +GO(gtk_tree_view_get_activate_on_single_click, iFp) GO(gtk_tree_view_get_background_area, vFpppp) GO(gtk_tree_view_get_bin_window, pFp) GO(gtk_tree_view_get_cell_area, vFpppp) @@ -3712,15 +4044,16 @@ GO(gtk_tree_view_get_hover_expand, iFp) GO(gtk_tree_view_get_hover_selection, iFp) GO(gtk_tree_view_get_level_indentation, iFp) GO(gtk_tree_view_get_model, pFp) +GO(gtk_tree_view_get_n_columns, uFp) GO(gtk_tree_view_get_path_at_pos, iFpiipppp) GO(gtk_tree_view_get_reorderable, iFp) -//GOM(gtk_tree_view_get_row_separator_func, BFEp) +//GOM(gtk_tree_view_get_row_separator_func, pFEp) GO(gtk_tree_view_get_rubber_banding, iFp) GO(gtk_tree_view_get_rules_hint, iFp) GO(gtk_tree_view_get_search_column, iFp) GO(gtk_tree_view_get_search_entry, pFp) -//GOM(gtk_tree_view_get_search_equal_func, BFEp) -//GOM(gtk_tree_view_get_search_position_func, BFEp) +//GOM(gtk_tree_view_get_search_equal_func, pFEp) +//GOM(gtk_tree_view_get_search_position_func, pFEp) GO(gtk_tree_view_get_selection, pFp) GO(gtk_tree_view_get_show_expanders, iFp) GO(gtk_tree_view_get_tooltip_column, iFp) @@ -3732,10 +4065,10 @@ GO(gtk_tree_view_get_visible_rect, vFpp) GO(gtk_tree_view_grid_lines_get_type, LFv) GO(gtk_tree_view_insert_column, iFppi) GO(gtk_tree_view_insert_column_with_attributes, iFpipppppppppppp) //vaarg -//GOM(gtk_tree_view_insert_column_with_data_func, iFpippBpB) +//GOM(gtk_tree_view_insert_column_with_data_func, iFpippppp) +GO(gtk_tree_view_is_blank_at_pos, iFpiipppp) GO(gtk_tree_view_is_rubber_banding_active, iFp) -//GOM(gtk_tree_view_map_expanded_rows, vFEpBp) -GO(gtk_tree_view_mode_get_type, LFv) +//GOM(gtk_tree_view_map_expanded_rows, vFEppp) GO(gtk_tree_view_move_column_after, vFppp) GO(gtk_tree_view_new, pFv) GO(gtk_tree_view_new_with_model, pFp) @@ -3744,10 +4077,11 @@ GO(gtk_tree_view_row_activated, vFppp) GO(gtk_tree_view_row_expanded, iFpp) GO(gtk_tree_view_scroll_to_cell, vFpppiff) GO(gtk_tree_view_scroll_to_point, vFpii) -//GOM(gtk_tree_view_set_column_drag_function, vFEpBpB) +GO(gtk_tree_view_set_activate_on_single_click, vFpi) +//GOM(gtk_tree_view_set_column_drag_function, vFEpppp) GO(gtk_tree_view_set_cursor, vFpppi) GO(gtk_tree_view_set_cursor_on_cell, vFppppi) -//GOM(gtk_tree_view_set_destroy_count_func, vFEpBpB) +//GOM(gtk_tree_view_set_destroy_count_func, vFEpppp) GO(gtk_tree_view_set_drag_dest_row, vFppu) GO(gtk_tree_view_set_enable_search, vFpi) GO(gtk_tree_view_set_enable_tree_lines, vFpi) @@ -3762,33 +4096,24 @@ GO(gtk_tree_view_set_hover_selection, vFpi) GO(gtk_tree_view_set_level_indentation, vFpi) GO(gtk_tree_view_set_model, vFpp) GO(gtk_tree_view_set_reorderable, vFpi) -//GOM(gtk_tree_view_set_row_separator_func, vFEpBpB) +//GOM(gtk_tree_view_set_row_separator_func, vFEpppp) GO(gtk_tree_view_set_rubber_banding, vFpi) GO(gtk_tree_view_set_rules_hint, vFpi) GO(gtk_tree_view_set_search_column, vFpi) GO(gtk_tree_view_set_search_entry, vFpp) GOM(gtk_tree_view_set_search_equal_func, vFEpppp) -//GOM(gtk_tree_view_set_search_position_func, vFEpBpB) +//GOM(gtk_tree_view_set_search_position_func, vFEpppp) GO(gtk_tree_view_set_show_expanders, vFpi) GO(gtk_tree_view_set_tooltip_cell, vFppppp) GO(gtk_tree_view_set_tooltip_column, vFpi) GO(gtk_tree_view_set_tooltip_row, vFppp) GO(gtk_tree_view_set_vadjustment, vFpp) -GO(gtk_tree_view_tree_to_widget_coords, vFpiipp) GO(gtk_tree_view_unset_rows_drag_dest, vFp) GO(gtk_tree_view_unset_rows_drag_source, vFp) -GO(gtk_tree_view_widget_to_tree_coords, vFpiipp) GO(gtk_true, iFv) -GOM(gtk_type_class, pFEi) -GO(gtk_type_enum_find_value, pFip) -GO(gtk_type_enum_get_values, pFi) -GO(gtk_type_flags_find_value, pFip) -GO(gtk_type_flags_get_values, pFi) -GO(gtk_type_init, vFi) -GO(gtk_type_new, pFi) -GOM(gtk_type_unique, iFELp) GO(gtk_ui_manager_add_ui, vFpupppui) -//GO(gtk_ui_manager_add_ui_from_file, +GO(gtk_ui_manager_add_ui_from_file, uFppp) +GO(gtk_ui_manager_add_ui_from_resource, uFppp) GO(gtk_ui_manager_add_ui_from_string, uFpplp) GO(gtk_ui_manager_ensure_update, vFp) GO(gtk_ui_manager_get_accel_group, pFp) @@ -3807,32 +4132,24 @@ GO(gtk_ui_manager_remove_action_group, vFpp) GO(gtk_ui_manager_remove_ui, vFpu) GO(gtk_ui_manager_set_add_tearoffs, vFpi) GO(gtk_unit_get_type, LFv) -GO(gtk_update_type_get_type, LFv) GO(gtk_vbox_get_type, LFv) GO(gtk_vbox_new, pFii) -//GO(gtk_vbutton_box_get_layout_default, -//GO(gtk_vbutton_box_get_spacing_default, GO(gtk_vbutton_box_get_type, LFv) -//GO(gtk_vbutton_box_new, -//GO(gtk_vbutton_box_set_layout_default, -//GO(gtk_vbutton_box_set_spacing_default, -//GO(gtk_viewport_get_bin_window, -//GO(gtk_viewport_get_hadjustment, +GO(gtk_vbutton_box_new, pFv) +GO(gtk_viewport_get_bin_window, pFp) +GO(gtk_viewport_get_hadjustment, pFp) GO(gtk_viewport_get_shadow_type, uFp) GO(gtk_viewport_get_type, LFv) GO(gtk_viewport_get_vadjustment, pFp) GO(gtk_viewport_get_view_window, pFp) GO(gtk_viewport_new, pFpp) -//GO(gtk_viewport_set_hadjustment, +GO(gtk_viewport_set_hadjustment, vFpp) GO(gtk_viewport_set_shadow_type, vFpu) GO(gtk_viewport_set_vadjustment, vFpp) -GO(gtk_visibility_get_type, LFv) GO(gtk_volume_button_get_type, LFv) GO(gtk_volume_button_new, pFv) GO(gtk_vpaned_get_type, LFv) GO(gtk_vpaned_new, pFv) -GO(gtk_vruler_get_type, LFv) -GO(gtk_vruler_new, pFv) GO(gtk_vscale_get_type, LFv) GO(gtk_vscale_new, pFp) GO(gtk_vscale_new_with_range, pFddd) @@ -3840,23 +4157,30 @@ GO(gtk_vscrollbar_get_type, LFv) GO(gtk_vscrollbar_new, pFp) GO(gtk_vseparator_get_type, LFv) GO(gtk_vseparator_new, pFv) +GO(gtk_widget_accessible_get_type, LFv) GO(gtk_widget_activate, iFp) GO(gtk_widget_add_accelerator, vFpppuuu) +GO(gtk_widget_add_device_events, vFppu) GO(gtk_widget_add_events, vFpi) GO(gtk_widget_add_mnemonic_label, vFpp) +GOM(gtk_widget_add_tick_callback, uFEpppp) GO(gtk_widget_can_activate_accel, iFpu) -GO(gtk_widget_child_focus, iFpi) -GO(gtk_widget_child_notify, vFp) -GO(gtk_widget_class_bind_template_child_full, vFppil) -//GOM(gtk_widget_class_bind_template_callback_full, vFEppB) +GO(gtk_widget_child_focus, iFpu) +GO(gtk_widget_child_notify, vFpp) +GOM(gtk_widget_class_bind_template_callback_full, vFEppp) +GO(gtk_widget_class_bind_template_child_full, vFppil) // need wrapping? GO(gtk_widget_class_find_style_property, pFpp) +//GOM(gtk_widget_class_get_css_name, pFp) GO(gtk_widget_class_install_style_property, vFpp) -//GOM(gtk_widget_class_install_style_property_parser, vFEppB) +//GOM(gtk_widget_class_install_style_property_parser, vFEppp) GO(gtk_widget_class_list_style_properties, pFpp) GO(gtk_widget_class_path, vFpppp) GO(gtk_widget_class_set_accessible_role, vFpu) GO(gtk_widget_class_set_accessible_type, vFpL) -//GOM(gtk_widget_class_set_connect_func, vFEpBpB) +//GOM(gtk_widget_class_set_connect_func, vFEpppp) +//GOM(gtk_widget_class_set_css_name, vFpp) +GO(gtk_widget_class_set_template, vFpp) +GO(gtk_widget_class_set_template_from_resource, vFpp) GO(gtk_widget_compute_expand, iFpu) GO(gtk_widget_create_pango_context, pFp) GO(gtk_widget_create_pango_layout, pFpp) @@ -3867,13 +4191,14 @@ GO(gtk_widget_draw, vFpp) GO(gtk_widget_ensure_style, vFp) GO(gtk_widget_error_bell, vFp) GO(gtk_widget_event, iFpp) -GO(gtk_widget_flags_get_type, LFv) GO(gtk_widget_freeze_child_notify, vFp) GO(gtk_widget_get_accessible, pFp) -GO(gtk_widget_get_action, pFp) -GO(gtk_widget_get_allocation, vFpp) -GO(gtk_widget_get_allocated_width, iFp) +GO(gtk_widget_get_action_group, pFpp) +GO(gtk_widget_get_allocated_baseline, iFp) GO(gtk_widget_get_allocated_height, iFp) +GO(gtk_widget_get_allocated_size, vFppp) +GO(gtk_widget_get_allocated_width, iFp) +GO(gtk_widget_get_allocation, vFpp) GO(gtk_widget_get_ancestor, pFpL) GO(gtk_widget_get_app_paintable, iFp) GO(gtk_widget_get_can_default, iFp) @@ -3882,37 +4207,41 @@ GO(gtk_widget_get_child_requisition, vFpp) GO(gtk_widget_get_child_visible, iFp) GO(gtk_widget_get_clip, vFpp) GO(gtk_widget_get_clipboard, pFpp) -GO(gtk_widget_get_colormap, pFp) GO(gtk_widget_get_composite_name, pFp) -GO(gtk_widget_get_default_colormap, pFv) -GO(gtk_widget_get_default_direction, iFv) +GO(gtk_widget_get_default_direction, uFv) GO(gtk_widget_get_default_style, pFv) -GO(gtk_widget_get_default_visual, pFv) +GO(gtk_widget_get_device_enabled, iFpp) +GO(gtk_widget_get_device_events, uFpp) GO(gtk_widget_get_direction, uFp) GO(gtk_widget_get_display, pFp) GO(gtk_widget_get_double_buffered, iFp) GO(gtk_widget_get_events, iFp) -GO(gtk_widget_get_extension_events, iFp) +GO(gtk_widget_get_focus_on_click, iFp) +GO(gtk_widget_get_font_map, pFp) +GO(gtk_widget_get_font_options, pFp) GO(gtk_widget_get_frame_clock, pFp) -GO(gtk_widget_get_halign, iFp) +GO(gtk_widget_get_halign, uFp) GO(gtk_widget_get_has_tooltip, iFp) GO(gtk_widget_get_has_window, iFp) GO(gtk_widget_get_hexpand, iFp) GO(gtk_widget_get_hexpand_set, iFp) +GO(gtk_widget_get_mapped, iFp) GO(gtk_widget_get_margin_bottom, iFp) GO(gtk_widget_get_margin_end, iFp) GO(gtk_widget_get_margin_left, iFp) GO(gtk_widget_get_margin_right, iFp) GO(gtk_widget_get_margin_start, iFp) GO(gtk_widget_get_margin_top, iFp) -GO(gtk_widget_get_mapped, iFp) +GO(gtk_widget_get_modifier_mask, uFpu) GO(gtk_widget_get_modifier_style, pFp) GO(gtk_widget_get_name, pFp) GO(gtk_widget_get_native, pFp) GO(gtk_widget_get_no_show_all, iFp) +GO(gtk_widget_get_opacity, dFp) GO(gtk_widget_get_pango_context, pFp) GO(gtk_widget_get_parent, pFp) GO(gtk_widget_get_parent_window, pFp) +GO(gtk_widget_get_path, pFp) GO(gtk_widget_get_pointer, vFppp) GO(gtk_widget_get_preferred_height, vFppp) GO(gtk_widget_get_preferred_height_and_baseline_for_width, vFpipppp) @@ -3930,18 +4259,18 @@ GO(gtk_widget_get_screen, pFp) GO(gtk_widget_get_sensitive, iFp) GO(gtk_widget_get_settings, pFp) GO(gtk_widget_get_size_request, vFppp) -GO(gtk_widget_get_snapshot, pFpp) GO(gtk_widget_get_state, uFp) GO(gtk_widget_get_state_flags, uFp) GO(gtk_widget_get_style, pFp) GO(gtk_widget_get_style_context, pFp) +GO(gtk_widget_get_support_multidevice, iFp) GO(gtk_widget_get_template_child, pFpLp) GO(gtk_widget_get_tooltip_markup, pFp) GO(gtk_widget_get_tooltip_text, pFp) GO(gtk_widget_get_tooltip_window, pFp) GO(gtk_widget_get_toplevel, pFp) GO(gtk_widget_get_type, LFv) -GO(gtk_widget_get_valign, iFp) +GO(gtk_widget_get_valign, uFp) GO(gtk_widget_get_valign_with_baseline, uFp) GO(gtk_widget_get_vexpand, iFp) GO(gtk_widget_get_vexpand_set, iFp) @@ -3955,12 +4284,14 @@ GO(gtk_widget_has_focus, iFp) GO(gtk_widget_has_grab, iFp) GO(gtk_widget_has_rc_style, iFp) GO(gtk_widget_has_screen, iFp) +GO(gtk_widget_has_visible_focus, iFp) GO(gtk_widget_help_type_get_type, LFv) GO(gtk_widget_hide, vFp) -GO(gtk_widget_hide_all, vFp) GO(gtk_widget_hide_on_delete, iFp) +GO(gtk_widget_in_destruction, iFp) GO(gtk_widget_init_template, vFp) -GO(gtk_widget_input_shape_combine_mask, vFppii) +GO(gtk_widget_input_shape_combine_region, vFpp) +GO(gtk_widget_insert_action_group, vFppp) GO(gtk_widget_intersect, iFppp) GO(gtk_widget_is_ancestor, iFpp) GO(gtk_widget_is_composited, iFp) @@ -3968,29 +4299,37 @@ GO(gtk_widget_is_drawable, iFp) GO(gtk_widget_is_focus, iFp) GO(gtk_widget_is_sensitive, iFp) GO(gtk_widget_is_toplevel, iFp) +GO(gtk_widget_is_visible, iFp) GO(gtk_widget_keynav_failed, iFpu) GO(gtk_widget_list_accel_closures, pFp) +GO(gtk_widget_list_action_prefixes, pFp) GO(gtk_widget_list_mnemonic_labels, pFp) +GO(gtk_widget_measure, vFpuipppp) GO(gtk_widget_map, vFp) -GO(gtk_widget_measure, vFpiipppp) GO(gtk_widget_mnemonic_activate, iFpi) GO(gtk_widget_modify_base, vFpup) -GO(gtk_widget_modify_bg, vFpip) +GO(gtk_widget_modify_bg, vFpup) GO(gtk_widget_modify_cursor, vFppp) -GO(gtk_widget_modify_fg, vFpip) +GO(gtk_widget_modify_fg, vFpup) GO(gtk_widget_modify_font, vFpp) GO(gtk_widget_modify_style, vFpp) -GO(gtk_widget_modify_text, vFpip) +GO(gtk_widget_modify_text, vFpup) GO(gtk_widget_new, pFppppppppppppp) //vaarg +GO(gtk_widget_override_background_color, vFpup) +GO(gtk_widget_override_color, vFpup) +GO(gtk_widget_override_cursor, vFppp) +GO(gtk_widget_override_font, vFpp) +GO(gtk_widget_override_symbolic_color, vFppp) GO(gtk_widget_path, vFpppp) +GO(gtk_widget_path_append_for_widget, iFpp) GO(gtk_widget_path_append_type, iFpL) GO(gtk_widget_path_append_with_siblings, iFppu) -GO(gtk_widget_path_append_for_widget, iFpp) GO(gtk_widget_path_copy, pFp) GO(gtk_widget_path_free, vFp) GO(gtk_widget_path_get_object_type, LFp) +GO(gtk_widget_path_get_type, LFv) GO(gtk_widget_path_has_parent, iFpL) -GO(gtk_widget_path_is_type, iFpp) +GO(gtk_widget_path_is_type, iFpL) GO(gtk_widget_path_iter_add_class, vFpip) GO(gtk_widget_path_iter_add_region, vFpipu) GO(gtk_widget_path_iter_clear_classes, vFpi) @@ -3998,13 +4337,13 @@ GO(gtk_widget_path_iter_clear_regions, vFpi) GO(gtk_widget_path_iter_get_name, pFpi) GO(gtk_widget_path_iter_get_object_name, pFpi) GO(gtk_widget_path_iter_get_object_type, LFpi) -GO(gtk_widget_path_iter_get_siblings, pFpi) GO(gtk_widget_path_iter_get_sibling_index, uFpi) +GO(gtk_widget_path_iter_get_siblings, pFpi) GO(gtk_widget_path_iter_get_state, uFpi) GO(gtk_widget_path_iter_has_class, iFpip) GO(gtk_widget_path_iter_has_name, iFpip) GO(gtk_widget_path_iter_has_qclass, iFpiu) -GO(gtk_widget_path_iter_has_qname, iFpip) +GO(gtk_widget_path_iter_has_qname, iFpiu) GO(gtk_widget_path_iter_has_qregion, iFpiup) GO(gtk_widget_path_iter_has_region, iFpipp) GO(gtk_widget_path_iter_list_classes, pFpi) @@ -4018,32 +4357,31 @@ GO(gtk_widget_path_iter_set_state, vFpiu) GO(gtk_widget_path_length, iFp) GO(gtk_widget_path_new, pFv) GO(gtk_widget_path_prepend_type, vFpL) -GO(gtk_widget_path_to_string, pFp) GO(gtk_widget_path_ref, pFp) +GO(gtk_widget_path_to_string, pFp) GO(gtk_widget_path_unref, vFp) -GO(gtk_widget_pop_colormap, vFv) GO(gtk_widget_pop_composite_child, vFv) -GO(gtk_widget_push_colormap, vFp) GO(gtk_widget_push_composite_child, vFv) -GO(gtk_widget_queue_clear, vFp) -GO(gtk_widget_queue_clear_area, vFpiiii) +GO(gtk_widget_queue_allocate, vFp) +GO(gtk_widget_queue_compute_expand, vFp) GO(gtk_widget_queue_draw, vFp) GO(gtk_widget_queue_draw_area, vFpiiii) +GO(gtk_widget_queue_draw_region, vFpp) GO(gtk_widget_queue_resize, vFp) GO(gtk_widget_queue_resize_no_redraw, vFp) GO(gtk_widget_realize, vFp) -GO(gtk_widget_ref, pFp) GO(gtk_widget_region_intersect, pFpp) GO(gtk_widget_register_window, vFpp) GO(gtk_widget_remove_accelerator, iFppuu) GO(gtk_widget_remove_mnemonic_label, vFpp) +GO(gtk_widget_remove_tick_callback, vFpu) GO(gtk_widget_render_icon, pFppup) +GO(gtk_widget_render_icon_pixbuf, pFppu) GO(gtk_widget_reparent, vFpp) GO(gtk_widget_reset_rc_styles, vFp) -GO(gtk_widget_reset_shapes, vFp) +GO(gtk_widget_reset_style, vFp) GO(gtk_widget_send_expose, iFpp) GO(gtk_widget_send_focus_change, iFpp) -GO(gtk_widget_set, vFppppppppppppppp) //vaarg GO(gtk_widget_set_accel_path, vFppp) GO(gtk_widget_set_allocation, vFpp) GO(gtk_widget_set_app_paintable, vFpi) @@ -4051,16 +4389,18 @@ GO(gtk_widget_set_can_default, vFpi) GO(gtk_widget_set_can_focus, vFpi) GO(gtk_widget_set_child_visible, vFpi) GO(gtk_widget_set_clip, vFpp) -GO(gtk_widget_set_colormap, vFpp) GO(gtk_widget_set_composite_name, vFpp) GO(gtk_widget_set_css_classes, vFpp) -GO(gtk_widget_set_default_colormap, vFp) GO(gtk_widget_set_default_direction, vFu) +GO(gtk_widget_set_device_enabled, vFppi) +GO(gtk_widget_set_device_events, vFppu) GO(gtk_widget_set_direction, vFpu) GO(gtk_widget_set_double_buffered, vFpi) GO(gtk_widget_set_events, vFpi) -GO(gtk_widget_set_extension_events, vFpi) -GO(gtk_widget_set_halign, vFpi) +GO(gtk_widget_set_focus_on_click, vFpi) +GO(gtk_widget_set_font_map, vFpp) +GO(gtk_widget_set_font_options, vFpp) +GO(gtk_widget_set_halign, vFpu) GO(gtk_widget_set_has_tooltip, vFpi) GO(gtk_widget_set_has_window, vFpi) GO(gtk_widget_set_hexpand, vFpi) @@ -4074,52 +4414,51 @@ GO(gtk_widget_set_margin_start, vFpi) GO(gtk_widget_set_margin_top, vFpi) GO(gtk_widget_set_name, vFpp) GO(gtk_widget_set_no_show_all, vFpi) +GO(gtk_widget_set_opacity, vFpd) GO(gtk_widget_set_parent, vFpp) GO(gtk_widget_set_parent_window, vFpp) -GO(gtk_widget_queue_compute_expand, vFp) GO(gtk_widget_set_realized, vFpi) GO(gtk_widget_set_receives_default, vFpi) GO(gtk_widget_set_redraw_on_allocate, vFpi) -GO(gtk_widget_set_scroll_adjustments, iFppp) GO(gtk_widget_set_sensitive, vFpi) GO(gtk_widget_set_size_request, vFpii) GO(gtk_widget_set_state, vFpu) GO(gtk_widget_set_state_flags, vFpui) GO(gtk_widget_set_style, vFpp) -GO(gtk_widget_class_set_template, vFpp) -GO(gtk_widget_class_set_template_from_resource, vFpp) +GO(gtk_widget_set_support_multidevice, vFpi) GO(gtk_widget_set_tooltip_markup, vFpp) GO(gtk_widget_set_tooltip_text, vFpp) GO(gtk_widget_set_tooltip_window, vFpp) -GO(gtk_widget_set_uposition, vFpii) -GO(gtk_widget_set_usize, vFpii) GO(gtk_widget_set_valign, vFpu) GO(gtk_widget_set_vexpand, vFpi) GO(gtk_widget_set_vexpand_set, vFpi) GO(gtk_widget_set_visible, vFpi) +GO(gtk_widget_set_visual, vFpp) GO(gtk_widget_set_window, vFpp) -GO(gtk_widget_shape_combine_mask, vFppii) +GO(gtk_widget_shape_combine_region, vFpp) GO(gtk_widget_show, vFp) GO(gtk_widget_show_all, vFp) GO(gtk_widget_show_now, vFp) -GO(gtk_widget_size_allocate, vFpppuii) +GO(gtk_widget_size_allocate, vFpp) +GO(gtk_widget_size_allocate_with_baseline, vFppi) GO(gtk_widget_size_request, vFpp) GO(gtk_widget_style_attach, vFp) GOM(gtk_widget_style_get, vFEppV) GO(gtk_widget_style_get_property, vFppp) -//GO(gtk_widget_style_get_valist, vFppp) +//GOM(gtk_widget_style_get_valist, vFppA) GO(gtk_widget_thaw_child_notify, vFp) GO(gtk_widget_translate_coordinates, iFppiipp) GO(gtk_widget_trigger_tooltip_query, vFp) GO(gtk_widget_unmap, vFp) GO(gtk_widget_unparent, vFp) GO(gtk_widget_unrealize, vFp) -GO(gtk_widget_unref, vFp) +GO(gtk_widget_unregister_window, vFpp) +GO(gtk_widget_unset_state_flags, vFpu) +GO(gtk_window_accessible_get_type, LFv) GO(gtk_window_activate_default, iFp) GO(gtk_window_activate_focus, iFp) GO(gtk_window_activate_key, iFpp) GO(gtk_window_add_accel_group, vFpp) -GO(gtk_window_add_embedded_xid, vFpu) GO(gtk_window_add_mnemonic, vFpup) GO(gtk_window_begin_move_drag, vFpiiiu) GO(gtk_window_begin_resize_drag, vFpuiiiu) @@ -4127,8 +4466,10 @@ GO(gtk_window_close, vFp) GO(gtk_window_deiconify, vFp) GO(gtk_window_destroy, vFp) GO(gtk_window_fullscreen, vFp) +GO(gtk_window_fullscreen_on_monitor, vFppi) GO(gtk_window_get_accept_focus, iFp) -GO(gdk_window_get_clip_region, pFp) +GO(gtk_window_get_application, pFp) +GO(gtk_window_get_attached_to, pFp) GO(gtk_window_get_decorated, iFp) GO(gtk_window_get_default_icon_list, pFv) GO(gtk_window_get_default_icon_name, pFv) @@ -4138,11 +4479,11 @@ GO(gtk_window_get_deletable, iFp) GO(gtk_window_get_destroy_with_parent, iFp) GO(gtk_window_get_focus, pFp) GO(gtk_window_get_focus_on_map, iFp) -GO(gtk_window_get_frame_dimensions, vFppppp) +GO(gtk_window_get_focus_visible, iFp) GO(gtk_window_get_gravity, uFp) GO(gtk_window_get_group, pFp) -GO(gtk_window_get_has_frame, iFp) GO(gtk_window_get_has_resize_grip, iFp) +GO(gtk_window_get_hide_titlebar_when_maximized, iFp) GO(gtk_window_get_icon, pFp) GO(gtk_window_get_icon_list, pFp) GO(gtk_window_get_icon_name, pFp) @@ -4152,19 +4493,21 @@ GO(gtk_window_get_modal, iFp) GO(gtk_window_get_opacity, dFp) GO(gtk_window_get_position, vFppp) GO(gtk_window_get_resizable, iFp) +GO(gtk_window_get_resize_grip_area, iFpp) GO(gtk_window_get_role, pFp) -GO(gdk_window_get_scale_factor, iFp) GO(gtk_window_get_screen, pFp) GO(gtk_window_get_size, vFppp) GO(gtk_window_get_skip_pager_hint, iFp) GO(gtk_window_get_skip_taskbar_hint, iFp) GO(gtk_window_get_title, pFp) +GO(gtk_window_get_titlebar, pFp) GO(gtk_window_get_transient_for, pFp) GO(gtk_window_get_type, LFv) GO(gtk_window_get_type_hint, uFp) GO(gtk_window_get_urgency_hint, iFp) GO(gtk_window_get_window_type, uFp) GO(gtk_window_group_add_window, vFpp) +GO(gtk_window_group_get_current_device_grab, pFpp) GO(gtk_window_group_get_current_grab, pFp) GO(gtk_window_group_get_type, LFv) GO(gtk_window_group_list_windows, pFp) @@ -4174,6 +4517,7 @@ GO(gtk_window_has_group, iFp) GO(gtk_window_has_toplevel_focus, iFp) GO(gtk_window_iconify, vFp) GO(gtk_window_is_active, iFp) +GO(gtk_window_is_maximized, iFp) GO(gtk_window_list_toplevels, pFv) GO(gtk_window_maximize, vFp) GO(gtk_window_mnemonic_activate, iFpuu) @@ -4185,14 +4529,18 @@ GO(gtk_window_present, vFp) GO(gtk_window_present_with_time, vFpu) GO(gtk_window_propagate_key_event, iFpp) GO(gtk_window_remove_accel_group, vFpp) -GO(gtk_window_remove_embedded_xid, vFpu) GO(gtk_window_remove_mnemonic, vFpup) GO(gtk_window_reshow_with_initial_size, vFp) GO(gtk_window_resize, vFpii) +GO(gtk_window_resize_grip_is_visible, iFp) +GO(gtk_window_resize_to_geometry, vFpii) GO(gtk_window_set_accept_focus, vFpi) +GO(gtk_window_set_application, vFpp) +GO(gtk_window_set_attached_to, vFpp) GO(gtk_window_set_auto_startup_notification, vFi) GO(gtk_window_set_decorated, vFpi) GO(gtk_window_set_default, vFpp) +GO(gtk_window_set_default_geometry, vFpii) GO(gtk_window_set_default_icon, vFp) GO(gtk_window_set_default_icon_from_file, iFpp) GO(gtk_window_set_default_icon_list, vFp) @@ -4202,22 +4550,24 @@ GO(gtk_window_set_deletable, vFpi) GO(gtk_window_set_destroy_with_parent, vFpi) GO(gtk_window_set_focus, vFpp) GO(gtk_window_set_focus_on_map, vFpi) -GO(gtk_window_set_frame_dimensions, vFpiiii) +GO(gtk_window_set_focus_visible, vFpi) GO(gtk_window_set_geometry_hints, vFpppu) GO(gtk_window_set_gravity, vFpu) -GO(gtk_window_set_has_frame, vFpi) +GO(gtk_window_set_has_resize_grip, vFpi) +GO(gtk_window_set_has_user_ref_count, vFpi) GO(gtk_window_set_hide_on_close, vFpi) +GO(gtk_window_set_hide_titlebar_when_maximized, vFpi) GO(gtk_window_set_icon, vFpp) GO(gtk_window_set_icon_from_file, iFppp) GO(gtk_window_set_icon_list, vFpp) GO(gtk_window_set_icon_name, vFpp) +GO(gtk_window_set_interactive_debugging, vFi) GO(gtk_window_set_keep_above, vFpi) GO(gtk_window_set_keep_below, vFpi) GO(gtk_window_set_mnemonic_modifier, vFpu) GO(gtk_window_set_mnemonics_visible, vFpi) GO(gtk_window_set_modal, vFpi) GO(gtk_window_set_opacity, vFpd) -GO(gtk_window_set_policy, vFpiii) GO(gtk_window_set_position, vFpu) GO(gtk_window_set_resizable, vFpi) GO(gtk_window_set_role, vFpp) @@ -4226,11 +4576,10 @@ GO(gtk_window_set_skip_pager_hint, vFpi) GO(gtk_window_set_skip_taskbar_hint, vFpi) GO(gtk_window_set_startup_id, vFpp) GO(gtk_window_set_title, vFpp) +GO(gtk_window_set_titlebar, vFpp) GO(gtk_window_set_transient_for, vFpp) GO(gtk_window_set_type_hint, vFpu) -GO(gtk_window_set_titlebar, vFpp) GO(gtk_window_set_urgency_hint, vFpi) -GO(gtk_widget_set_visual, vFpp) GO(gtk_window_set_wmclass, vFppp) GO(gtk_window_stick, vFp) GO(gtk_window_type_get_type, LFv) @@ -4238,14 +4587,6 @@ GO(gtk_window_unfullscreen, vFp) GO(gtk_window_unmaximize, vFp) GO(gtk_window_unstick, vFp) GO(gtk_wrap_mode_get_type, LFv) -GO(gtk_gesture_long_press_get_type, LFv) -GO(gtk_gesture_single_get_type, LFv) -GO(gtk_gesture_get_type, LFv) -GO(gtk_gesture_rotate_new, pFp) -GO(gtk_gesture_zoom_new, pFp) -GO(gtk_event_controller_get_type, LFv) -GO(gtk_stack_set_visible_child_name, vFpp) -GO(gtk_stack_get_visible_child_name, pFp) GO(dummy_iFppdd, iFppdd) // for GtkEventController wrapping GO(dummy_iFppUup, iFppUup) diff --git a/src/wrapped/wrappedgtkx112.c b/src/wrapped/wrappedgtkx112.c index 39f1b08..56b3919 100644 --- a/src/wrapped/wrappedgtkx112.c +++ b/src/wrapped/wrappedgtkx112.c @@ -19,11 +19,8 @@ #include "myalign.h" #include "gtkclass.h" -#ifdef ANDROID - const char* gtkx112Name = "libgtk-x11-2.0.so"; -#else - const char* gtkx112Name = "libgtk-x11-2.0.so.0"; -#endif +const char* gtkx112Name = "libgtk-x11-2.0.so.0"; +#define ALTNAME "libgtk-x11-2.0.so" #define LIBNAME gtkx112 @@ -84,6 +81,9 @@ typedef unsigned long (*LFpppppi_t)(void*, void*, void*, void*, void*, int); GO(g_module_supported, LFv_t) \ GO(g_module_symbol, iFppp_t) \ GO(g_log, vFpipV_t) \ + GO(gtk_notebook_get_type, LFv_t) \ + GO(gtk_cell_renderer_get_type, LFv_t) \ + GO(gtk_cell_renderer_text_get_type, LFv_t) \ #include "generated/wrappedgtkx112types.h" @@ -96,19 +96,6 @@ typedef unsigned long (*LFpppppi_t)(void*, void*, void*, void*, void*, int); #include "wrappercallback.h" -static box64context_t* context = NULL; - -EXPORT uintptr_t my_gtk_signal_connect_full(x64emu_t* emu, void* object, void* name, void* c_handler, void* unsupported, void* data, void* closure, uint32_t signal, int after) -{ - if(!context) - context = emu->context; - - my_signal_t *sig = new_mysignal(c_handler, data, closure); - uintptr_t ret = my->gtk_signal_connect_full(object, name, my_signal_cb, NULL, sig, my_signal_delete, signal, after); - printf_log(LOG_DEBUG, "Connecting gtk signal \"%s\" with cb=%p\n", (char*)name, sig); - return ret; -} - // this is quite ineficient, but GCallback is often used, so create a large pool here... #define SUPER() \ GO(0) \ @@ -712,8 +699,80 @@ static void* reverse_GtkLinkButtonUri_Fct(void* fct) return (void*)AddBridge(my_lib->w.bridge, vFppp, fct, 0, NULL); } +// GtkKeySnoopFunc ... +#define GO(A) \ +static uintptr_t my_GtkKeySnoopFunc_fct_##A = 0; \ +static void my_GtkKeySnoopFunc_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my_GtkKeySnoopFunc_fct_##A, "ppp", a, b, c); \ +} +SUPER() +#undef GO +static void* find_GtkKeySnoopFunc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_GtkKeySnoopFunc_fct_##A == (uintptr_t)fct) return my_GtkKeySnoopFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_GtkKeySnoopFunc_fct_##A == 0) {my_GtkKeySnoopFunc_fct_##A = (uintptr_t)fct; return my_GtkKeySnoopFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gtk-2 GtkKeySnoopFunc callback\n"); + return NULL; +} +// Event +#define GO(A) \ +static uintptr_t my_Event_fct_##A = 0; \ +static void my_Event_##A(void* a, void* b, void* c, void* d, void* e, void* f, void* g, void* h, void* i, void* j) \ +{ \ + RunFunctionFmt(my_Event_fct_##A, "pppppppppp", a, b, c, d, e, f, g, h, i, j); \ +} +SUPER() +#undef GO +static void* findEventFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_Event_fct_##A == (uintptr_t)fct) return my_Event_##A; + SUPER() + #undef GO + #define GO(A) if(my_Event_fct_##A == 0) {my_Event_fct_##A = (uintptr_t)fct; return my_Event_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gtk2 generic Event callback\n"); + return NULL; +} +// TranslateEvent +#define GO(A) \ +static uintptr_t my_TranslateEvent_fct_##A = 0; \ +static void my_TranslateEvent_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_TranslateEvent_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* findTranslateEvent(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_TranslateEvent_fct_##A == (uintptr_t)fct) return my_TranslateEvent_##A; + SUPER() + #undef GO + #define GO(A) if(my_TranslateEvent_fct_##A == 0) {my_TranslateEvent_fct_##A = (uintptr_t)fct; return my_TranslateEvent_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for gtk-2 TranslateEvent callback\n"); + return NULL; +} + #undef SUPER +EXPORT uintptr_t my_gtk_signal_connect_full(x64emu_t* emu, void* object, void* name, void* c_handler, void* unsupported, void* data, void* closure, uint32_t signal, int after) +{ + return my->gtk_signal_connect_full(object, name, findEventFct(c_handler), unsupported, data, findGDestroyNotifyFct(closure), signal, after); +} + EXPORT void my_gtk_dialog_add_buttons(x64emu_t* emu, void* dialog, void* first, uintptr_t* b) { void* btn = first; @@ -835,15 +894,9 @@ EXPORT int my_gtk_clipboard_set_with_owner(x64emu_t* emu, void* clipboard, void* return my->gtk_clipboard_set_with_owner(clipboard, target, n, findClipboadGetFct(f_get), findClipboadClearFct(f_clear), data); } -static void* my_translate_func(void* path, my_signal_t* sig) -{ - return (void*)RunFunctionFmt(sig->c_handler, "pp", path, sig->data) ; -} - EXPORT void my_gtk_stock_set_translate_func(x64emu_t* emu, void* domain, void* f, void* data, void* notify) { - my_signal_t *sig = new_mysignal(f, data, notify); - my->gtk_stock_set_translate_func(domain, my_translate_func, sig, my_signal_delete); + my->gtk_stock_set_translate_func(domain, findTranslateEvent(f), data, findGDestroyNotifyFct(notify)); } EXPORT void my_gtk_container_forall(x64emu_t* emu, void* container, void* f, void* data) @@ -1188,11 +1241,49 @@ EXPORT void my_gtk_print_job_send(x64emu_t* emu, void* job, void* f, void* data, my->gtk_print_job_send(job, find_GtkPrintJobCompleteFunc_Fct(f), data, findGDestroyNotifyFct(d)); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +EXPORT uint32_t my_gtk_key_snooper_install(x64emu_t* emu, void* f, void* data) +{ + (void)emu; + return my->gtk_key_snooper_install(find_GtkKeySnoopFunc_Fct(f), data); +} + +static void addGtk2Alternate(library_t* lib) +{ + #define GO(A, W) AddAutomaticBridge(lib->w.bridge, W, dlsym(lib->w.lib, #A), 0, #A) + GO(gtk_marshal_BOOLEAN__POINTER, vFppuppp); + GO(gtk_marshal_BOOLEAN__POINTER_INT_INT, vFppuppp); + GO(gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT, vFppuppp); + GO(gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT, vFppuppp); + GO(gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER, vFppuppp); + GO(gtk_marshal_BOOLEAN__VOID, vFppuppp); + GO(gtk_marshal_ENUM__ENUM, vFppuppp); + GO(gtk_marshal_INT__POINTER, vFppuppp); + GO(gtk_marshal_INT__POINTER_CHAR_CHAR, vFppuppp); + GO(gtk_marshal_VOID__ENUM_FLOAT, vFppuppp); + GO(gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN, vFppuppp); + GO(gtk_marshal_VOID__INT_INT, vFppuppp); + GO(gtk_marshal_VOID__INT_INT_POINTER, vFppuppp); + GO(gtk_marshal_VOID__POINTER_INT, vFppuppp); + GO(gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT, vFppuppp); + GO(gtk_marshal_VOID__POINTER_POINTER, vFppuppp); + GO(gtk_marshal_VOID__POINTER_POINTER_POINTER, vFppuppp); + GO(gtk_marshal_VOID__POINTER_POINTER_UINT_UINT, vFppuppp); + GO(gtk_marshal_VOID__POINTER_STRING_STRING, vFppuppp); + GO(gtk_marshal_VOID__POINTER_UINT, vFppuppp); + GO(gtk_marshal_VOID__POINTER_UINT_ENUM, vFppuppp); + GO(gtk_marshal_VOID__POINTER_UINT_UINT, vFppuppp); + GO(gtk_marshal_VOID__STRING_INT_POINTER, vFppuppp); + GO(gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER, vFppuppp); + GO(gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM, vFppuppp); + GO(gtk_marshal_VOID__UINT_STRING, vFppuppp); + #undef GO +} + +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define CUSTOM_INIT \ + addGtk2Alternate(lib); \ SetGtkObjectID(my->gtk_object_get_type()); \ SetGtkWidget2ID(my->gtk_widget_get_type()); \ SetGtkContainer2ID(my->gtk_container_get_type()); \ @@ -1215,12 +1306,11 @@ EXPORT void my_gtk_print_job_send(x64emu_t* emu, void* job, void* f, void* data, SetGtkFrame2ID(my->gtk_frame_get_type()); \ SetGtkMenuShell2ID(my->gtk_menu_shell_get_type()); \ SetGtkMenuBar2ID(my->gtk_menu_bar_get_type()); \ - SetGtkTextView2ID(my->gtk_text_view_get_type()); + SetGtkTextView2ID(my->gtk_text_view_get_type()); \ + SetGtkNotebook2ID(my->gtk_notebook_get_type()); \ + SetGtkCellRenderer2ID(my->gtk_cell_renderer_get_type()); \ + SetGtkCellRendererText2ID(my->gtk_cell_renderer_text_get_type()); -#ifdef ANDROID -#define NEEDED_LIBS "libgdk-x11-2.0.so", "libpangocairo-1.0.so" -#else #define NEEDED_LIBS "libgdk-x11-2.0.so.0", "libpangocairo-1.0.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedgtkx112_private.h b/src/wrapped/wrappedgtkx112_private.h index ea9c9df..077e1b7 100644 --- a/src/wrapped/wrappedgtkx112_private.h +++ b/src/wrapped/wrappedgtkx112_private.h @@ -1434,7 +1434,7 @@ GO(gtk_input_dialog_new, pFv) GO(gtk_input_remove, vFu) GO(gtk_invisible_get_screen, pFp) GO(gtk_invisible_get_type, LFv) -//GO(gtk_invisible_new, +GO(gtk_invisible_new, pFv) GO(gtk_invisible_new_for_screen, pFp) GO(gtk_invisible_set_screen, vFpp) //GO(gtk_item_deselect, @@ -1466,7 +1466,7 @@ GO(gtk_item_get_type, LFv) //GO(gtk_item_select, GO(gtk_item_toggle, vFp) GO(gtk_justification_get_type, LFv) -//GOM(gtk_key_snooper_install, uFEBp) +GOM(gtk_key_snooper_install, uFEpp) GO(gtk_key_snooper_remove, vFu) GO(gtk_label_get, vFpp) GO(gtk_label_get_angle, dFp) @@ -1595,32 +1595,32 @@ GO(gtk_main_iteration, iFv) GO(gtk_main_iteration_do, iFi) GO(gtk_main_level, uFv) GO(gtk_main_quit, vFv) -//GO(gtk_marshal_BOOLEAN__POINTER, -//GO(gtk_marshal_BOOLEAN__POINTER_INT_INT, -//GO(gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT, -//GO(gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT, -//GO(gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER, -//GO(gtk_marshal_BOOLEAN__VOID, -//GO(gtk_marshal_ENUM__ENUM, -//GO(gtk_marshal_INT__POINTER, -//GO(gtk_marshal_INT__POINTER_CHAR_CHAR, -//GO(gtk_marshal_VOID__ENUM_FLOAT, -//GO(gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN, -//GO(gtk_marshal_VOID__INT_INT, -//GO(gtk_marshal_VOID__INT_INT_POINTER, -//GO(gtk_marshal_VOID__POINTER_INT, -//GO(gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT, -//GO(gtk_marshal_VOID__POINTER_POINTER, -//GO(gtk_marshal_VOID__POINTER_POINTER_POINTER, -//GO(gtk_marshal_VOID__POINTER_POINTER_UINT_UINT, -//GO(gtk_marshal_VOID__POINTER_STRING_STRING, -//GO(gtk_marshal_VOID__POINTER_UINT, -//GO(gtk_marshal_VOID__POINTER_UINT_ENUM, -//GO(gtk_marshal_VOID__POINTER_UINT_UINT, -//GO(gtk_marshal_VOID__STRING_INT_POINTER, -//GO(gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER, -//GO(gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM, -//GO(gtk_marshal_VOID__UINT_STRING, +DATA(gtk_marshal_BOOLEAN__POINTER, sizeof(void*)) +DATA(gtk_marshal_BOOLEAN__POINTER_INT_INT, sizeof(void*)) +DATA(gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT, sizeof(void*)) +DATA(gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT, sizeof(void*)) +DATA(gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER, sizeof(void*)) +DATA(gtk_marshal_BOOLEAN__VOID, sizeof(void*)) +DATA(gtk_marshal_ENUM__ENUM, sizeof(void*)) +DATA(gtk_marshal_INT__POINTER, sizeof(void*)) +DATA(gtk_marshal_INT__POINTER_CHAR_CHAR, sizeof(void*)) +DATA(gtk_marshal_VOID__ENUM_FLOAT, sizeof(void*)) +DATA(gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN, sizeof(void*)) +DATA(gtk_marshal_VOID__INT_INT, sizeof(void*)) +DATA(gtk_marshal_VOID__INT_INT_POINTER, sizeof(void*)) +DATA(gtk_marshal_VOID__POINTER_INT, sizeof(void*)) +DATA(gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT, sizeof(void*)) +DATA(gtk_marshal_VOID__POINTER_POINTER, sizeof(void*)) +DATA(gtk_marshal_VOID__POINTER_POINTER_POINTER, sizeof(void*)) +DATA(gtk_marshal_VOID__POINTER_POINTER_UINT_UINT, sizeof(void*)) +DATA(gtk_marshal_VOID__POINTER_STRING_STRING, sizeof(void*)) +DATA(gtk_marshal_VOID__POINTER_UINT, sizeof(void*)) +DATA(gtk_marshal_VOID__POINTER_UINT_ENUM, sizeof(void*)) +DATA(gtk_marshal_VOID__POINTER_UINT_UINT, sizeof(void*)) +DATA(gtk_marshal_VOID__STRING_INT_POINTER, sizeof(void*)) +DATA(gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER, sizeof(void*)) +DATA(gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM, sizeof(void*)) +DATA(gtk_marshal_VOID__UINT_STRING, sizeof(void*)) GO(gtk_match_type_get_type, LFv) GO(gtk_menu_attach, vFppuuuu) GOM(gtk_menu_attach_to_widget, vFEppp) diff --git a/src/wrapped/wrappedharfbuzzsubset.c b/src/wrapped/wrappedharfbuzzsubset.c new file mode 100644 index 0000000..9627e6c --- /dev/null +++ b/src/wrapped/wrappedharfbuzzsubset.c @@ -0,0 +1,20 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "callback.h" +#include "debug.h" + +const char* harfbuzzsubsetName = "libharfbuzz-subset.so.0"; +#define LIBNAME harfbuzzsubset + +#include "wrappedlib_init.h" + diff --git a/src/wrapped/wrappedharfbuzzsubset_private.h b/src/wrapped/wrappedharfbuzzsubset_private.h new file mode 100644 index 0000000..af6e8df --- /dev/null +++ b/src/wrapped/wrappedharfbuzzsubset_private.h @@ -0,0 +1,35 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(hb_subset_axis_range_from_string, iFpippp) +GO(hb_subset_axis_range_to_string, vFpupu) +GO(hb_subset_input_create_or_fail, pFv) +GO(hb_subset_input_destroy, vFp) +GO(hb_subset_input_get_axis_range, iFpuppp) +GO(hb_subset_input_get_flags, uFp) +GO(hb_subset_input_get_user_data, pFpp) +GO(hb_subset_input_glyph_set, pFp) +GO(hb_subset_input_keep_everything, vFp) +GO(hb_subset_input_old_to_new_glyph_mapping, pFp) +GO(hb_subset_input_pin_all_axes_to_default, iFpp) +GO(hb_subset_input_pin_axis_location, iFppuf) +GO(hb_subset_input_pin_axis_to_default, iFppu) +GO(hb_subset_input_reference, pFp) +GO(hb_subset_input_set, pFpu) +GO(hb_subset_input_set_axis_range, iFppufff) +GO(hb_subset_input_set_flags, vFpu) +//GOM(hb_subset_input_set_user_data, iFEppppi) +GO(hb_subset_input_unicode_set, pFp) +GO(hb_subset_or_fail, pFpp) +GO(hb_subset_plan_create_or_fail, pFpp) +GO(hb_subset_plan_destroy, vFp) +GO(hb_subset_plan_execute_or_fail, pFp) +GO(hb_subset_plan_get_user_data, pFpp) +GO(hb_subset_plan_new_to_old_glyph_mapping, pFp) +GO(hb_subset_plan_old_to_new_glyph_mapping, pFp) +GO(hb_subset_plan_reference, pFp) +//GOM(hb_subset_plan_set_user_data, iFEppppi) +GO(hb_subset_plan_unicode_to_old_glyph_mapping, pFp) +GO(hb_subset_preprocess, pFp) +//GO(hb_subset_serialize_or_fail, diff --git a/src/wrapped/wrappediconv_private.h b/src/wrapped/wrappediconv_private.h index a0ed8e1..21df708 100644 --- a/src/wrapped/wrappediconv_private.h +++ b/src/wrapped/wrappediconv_private.h @@ -1,4 +1,15 @@ -#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA) && defined(GOS)) +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) #error Meh... #endif +GO(libiconv_open, pFpp) +GO(locale_charset, pFv) +GO(libiconv_close, iFp) +GO(libiconvctl, iFpip) +GO(libiconv_set_relocation_prefix, vFpp) +GO(libiconv, LFppppp) +GO(libiconv_open_into, iFppp) +GO(libiconvlist, vFpp) +GO(iconv_canonicalize, pFp) + +DATA(_libiconv_version, 4) \ No newline at end of file diff --git a/src/wrapped/wrappedicui18n75.c b/src/wrapped/wrappedicui18n75.c new file mode 100644 index 0000000..61a345f --- /dev/null +++ b/src/wrapped/wrappedicui18n75.c @@ -0,0 +1,28 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* icui18n75Name = "libicui18n.so.75"; +#define LIBNAME icui18n75 + +#define ALTMY my74_ + +#define NEEDED_LIBS "libicuuc.so.75" + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedicui18n75_private.h b/src/wrapped/wrappedicui18n75_private.h new file mode 100644 index 0000000..7c597e6 --- /dev/null +++ b/src/wrapped/wrappedicui18n75_private.h @@ -0,0 +1,103 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error meh! +#endif + +// UDate is double +// UBool is int8_t + +GO(ucal_add_75, vFpiip) +GO(ucal_clear_75, vFp) +GO(ucal_clearField_75, vFpi) +GO(ucal_clone_75, pFpp) +GO(ucal_close_75, vFp) +GO(ucal_countAvailable_75, iFv) +GO(ucal_equivalentTo_75, cFpp) +GO(ucal_get_75, iFpip) +GO(ucal_getAttribute_75, iFpi) +GO(ucal_getAvailable_75, pFi) +GO(ucal_getCanonicalTimeZoneID_75, iFpipipp) +GO(ucal_getDayOfWeekType_75, iFpip) +GO(ucal_getDefaultTimeZone_75, iFpip) +GO(ucal_getDSTSavings_75, iFpp) +GO(ucal_getFieldDifference_75, iFpdip) +GO(ucal_getGregorianChange_75, dFpp) +GO(ucal_getHostTimeZone_75, iFpip) +GO(ucal_getKeywordValuesForLocale_75, pFppCp) +GO(ucal_getLimit_75, iFpiip) +GO(ucal_getLocaleByType_75, pFpip) +GO(ucal_getMillis_75, dFpp) +GO(ucal_getNow_75, dFv) +GO(ucal_getTimeZoneDisplayName_75, iFpippip) +GO(ucal_getTimeZoneID_75, iFppip) +GO(ucal_getTimeZoneIDForWindowsID_75, iFpippip) +GO(ucal_getTimeZoneOffsetFromLocal_75, vFpiippp) +GO(ucal_getTimeZoneTransitionDate_75, cFpipp) +GO(ucal_getType_75, pFpp) +GO(ucal_getTZDataVersion_75, pFp) +GO(ucal_getWeekendTransition_75, iFpip) +GO(ucal_getWindowsTimeZoneID_75, iFpipip) +GO(ucal_inDaylightTime_75, cFpp) +GO(ucal_isSet_75, cFpi) +GO(ucal_isWeekend_75, cFpdp) +GO(ucal_open_75, pFpipip) +GO(ucal_openCountryTimeZones_75, pFpp) +GO(ucal_openTimeZoneIDEnumeration_75, pFippp) +GO(ucal_openTimeZones_75, pFp) +GO(ucal_roll_75, vFpiip) +GO(ucal_set_75, vFpii) +GO(ucal_setAttribute_75, vFpii) +GO(ucal_setDate_75, vFpiiip) +GO(ucal_setDateTime_75, vFpiiiiiip) +GO(ucal_setDefaultTimeZone_75, vFpp) +GO(ucal_setGregorianChange_75, vFpdp) +GO(ucal_setMillis_75, vFpdp) +GO(ucal_setTimeZone_75, vFppip) + +GO(ucol_clone_75, pFpp) +GO(ucol_close_75, vFp) +GO(ucol_closeElements_75, vFp) +GO(ucol_setMaxVariable_75, vFpip) +GO(ucol_getOffset_75, iFp) +GO(ucol_getRules_75, pFpp) +GO(ucol_getSortKey_75, iFppipi) +GO(ucol_getStrength_75, iFp) +GO(ucol_getVersion_75, vFpp) +GO(ucol_next_75, iFpp) +GO(ucol_previous_75, iFpp) +GO(ucol_open_75, pFpp) +GO(ucol_openElements_75, pFppip) +GO(ucol_openRules_75, pFpiiipp) +GO(ucol_safeClone_75, pFpppp) +GO(ucol_setAttribute_75, vFpiip) +GO(ucol_setVariableTop_75, uFppip) +GO(ucol_strcoll_75, iFppipi) + +GO(udat_close_75, vFp) +GO(udat_countSymbols_75, iFpi) +GO(udat_getSymbols_75, iFpiipip) +GO(udat_format_75, iFpdpipp) +GO(udat_open_75, pFiippipip) +GO(udat_setCalendar_75, vFpp) +GO(udat_toPattern_75, iFpCpip) + +GO(unum_close_75, vFp) +GO(unum_getAttribute_75, iFpi) +GO(unum_getSymbol_75, iFpipip) +GO(unum_open_75, pFipippp) +GO(unum_toPattern_75, iFpCpip) + +GO(udatpg_close_75, vFp) +GO(udatpg_getBestPattern_75, iFppipip) +GO(udatpg_open_75, pFpp) + +GO(ulocdata_getCLDRVersion_75, vFpp) +GO(ulocdata_getMeasurementSystem_75, iFpp) + +GO(usearch_close_75, vFp) +GO(usearch_first_75, iFpp) +GO(usearch_getBreakIterator_75, pFp) +GO(usearch_getMatchedLength_75, iFp) +GO(usearch_last_75, iFpp) +GO(usearch_openFromCollator_75, pFpipippp) +GO(usearch_setPattern_75, vFppip) +GO(usearch_setText_75, vFppip) diff --git a/src/wrapped/wrappedicui18n76.c b/src/wrapped/wrappedicui18n76.c new file mode 100644 index 0000000..8a6b572 --- /dev/null +++ b/src/wrapped/wrappedicui18n76.c @@ -0,0 +1,28 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* icui18n76Name = "libicui18n.so.76"; +#define LIBNAME icui18n76 + +#define ALTMY my76_ + +#define NEEDED_LIBS "libicuuc.so.76" + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedicui18n76_private.h b/src/wrapped/wrappedicui18n76_private.h new file mode 100644 index 0000000..d58ac44 --- /dev/null +++ b/src/wrapped/wrappedicui18n76_private.h @@ -0,0 +1,104 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error meh! +#endif + +// UDate is double +// UBool is int8_t + +GO(ucal_add_76, vFpiip) +GO(ucal_clear_76, vFp) +GO(ucal_clearField_76, vFpi) +GO(ucal_clone_76, pFpp) +GO(ucal_close_76, vFp) +GO(ucal_countAvailable_76, iFv) +GO(ucal_equivalentTo_76, cFpp) +GO(ucal_get_76, iFpip) +GO(ucal_getAttribute_76, iFpi) +GO(ucal_getAvailable_76, pFi) +GO(ucal_getCanonicalTimeZoneID_76, iFpipipp) +GO(ucal_getDayOfWeekType_76, iFpip) +GO(ucal_getDefaultTimeZone_76, iFpip) +GO(ucal_getDSTSavings_76, iFpp) +GO(ucal_getFieldDifference_76, iFpdip) +GO(ucal_getGregorianChange_76, dFpp) +GO(ucal_getHostTimeZone_76, iFpip) +// GO(ucal_getIanaTimeZoneID_76, iFpipip) // enable if needed, not in widespread use yet +GO(ucal_getKeywordValuesForLocale_76, pFppCp) +GO(ucal_getLimit_76, iFpiip) +GO(ucal_getLocaleByType_76, pFpip) +GO(ucal_getMillis_76, dFpp) +GO(ucal_getNow_76, dFv) +GO(ucal_getTimeZoneDisplayName_76, iFpippip) +GO(ucal_getTimeZoneID_76, iFppip) +GO(ucal_getTimeZoneIDForWindowsID_76, iFpippip) +GO(ucal_getTimeZoneOffsetFromLocal_76, vFpiippp) +GO(ucal_getTimeZoneTransitionDate_76, cFpipp) +GO(ucal_getType_76, pFpp) +GO(ucal_getTZDataVersion_76, pFp) +GO(ucal_getWeekendTransition_76, iFpip) +GO(ucal_getWindowsTimeZoneID_76, iFpipip) +GO(ucal_inDaylightTime_76, cFpp) +GO(ucal_isSet_76, cFpi) +GO(ucal_isWeekend_76, cFpdp) +GO(ucal_open_76, pFpipip) +GO(ucal_openCountryTimeZones_76, pFpp) +GO(ucal_openTimeZoneIDEnumeration_76, pFippp) +GO(ucal_openTimeZones_76, pFp) +GO(ucal_roll_76, vFpiip) +GO(ucal_set_76, vFpii) +GO(ucal_setAttribute_76, vFpii) +GO(ucal_setDate_76, vFpiiip) +GO(ucal_setDateTime_76, vFpiiiiiip) +GO(ucal_setDefaultTimeZone_76, vFpp) +GO(ucal_setGregorianChange_76, vFpdp) +GO(ucal_setMillis_76, vFpdp) +GO(ucal_setTimeZone_76, vFppip) + +GO(ucol_clone_76, pFpp) +GO(ucol_close_76, vFp) +GO(ucol_closeElements_76, vFp) +GO(ucol_setMaxVariable_76, vFpip) +GO(ucol_getOffset_76, iFp) +GO(ucol_getRules_76, pFpp) +GO(ucol_getSortKey_76, iFppipi) +GO(ucol_getStrength_76, iFp) +GO(ucol_getVersion_76, vFpp) +GO(ucol_next_76, iFpp) +GO(ucol_previous_76, iFpp) +GO(ucol_open_76, pFpp) +GO(ucol_openElements_76, pFppip) +GO(ucol_openRules_76, pFpiiipp) +GO(ucol_safeClone_76, pFpppp) +GO(ucol_setAttribute_76, vFpiip) +GO(ucol_setVariableTop_76, uFppip) +GO(ucol_strcoll_76, iFppipi) + +GO(udat_close_76, vFp) +GO(udat_countSymbols_76, iFpi) +GO(udat_getSymbols_76, iFpiipip) +GO(udat_format_76, iFpdpipp) +GO(udat_open_76, pFiippipip) +GO(udat_setCalendar_76, vFpp) +GO(udat_toPattern_76, iFpCpip) + +GO(unum_close_76, vFp) +GO(unum_getAttribute_76, iFpi) +GO(unum_getSymbol_76, iFpipip) +GO(unum_open_76, pFipippp) +GO(unum_toPattern_76, iFpCpip) + +GO(udatpg_close_76, vFp) +GO(udatpg_getBestPattern_76, iFppipip) +GO(udatpg_open_76, pFpp) + +GO(ulocdata_getCLDRVersion_76, vFpp) +GO(ulocdata_getMeasurementSystem_76, iFpp) + +GO(usearch_close_76, vFp) +GO(usearch_first_76, iFpp) +GO(usearch_getBreakIterator_76, pFp) +GO(usearch_getMatchedLength_76, iFp) +GO(usearch_last_76, iFpp) +GO(usearch_openFromCollator_76, pFpipippp) +GO(usearch_setPattern_76, vFppip) +GO(usearch_setText_76, vFppip) diff --git a/src/wrapped/wrappedicuuc75.c b/src/wrapped/wrappedicuuc75.c new file mode 100644 index 0000000..f951134 --- /dev/null +++ b/src/wrapped/wrappedicuuc75.c @@ -0,0 +1,26 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* icuuc75Name = "libicuuc.so.75"; +#define LIBNAME icuuc75 + +#define ALTMY my75_ + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedicuuc75_private.h b/src/wrapped/wrappedicuuc75_private.h new file mode 100644 index 0000000..bd84d18 --- /dev/null +++ b/src/wrapped/wrappedicuuc75_private.h @@ -0,0 +1,92 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error meh! +#endif + +GO(ubrk_clone_75, pFpp) +GO(ubrk_close_75, vFp) +GO(ubrk_countAvailable_75, iFv) +GO(ubrk_current_75, iFp) +GO(ubrk_first_75, iFp) +GO(ubrk_following_75, iFpi) +GO(ubrk_getAvailable_75, pFi) +GO(ubrk_getBinaryRules_75, iFppip) +GO(ubrk_getLocaleByType_75, pFpip) +GO(ubrk_getRuleStatus_75, iFp) +GO(ubrk_getRuleStatusVec_75, iFppip) +GO(ubrk_isBoundary_75, cFpi) +GO(ubrk_last_75, iFp) +GO(ubrk_next_75, iFp) +GO(ubrk_open_75, pFppip) +GO(ubrk_openBinaryRules_75, pFpipip) +GO(ubrk_openRules_75, pFpipipp) +GO(ubrk_preceding_75, iFpi) +GO(ubrk_previous_75, iFp) +GO(ubrk_refreshUText_75, vFppp) +GO(ubrk_safeClone_75, pFpppp) +GO(ubrk_setText_75, vFppip) +GO(ubrk_setUText_75, vFppp) +GO(ubrk_swap_75, iFppipp) + +GO(ucnv_getDefaultName_75, pFv) +GO(ucnv_open_75, pFpp) +GO(ucnv_setDefaultName_75, vFp) + +GO(ucurr_forLocale_75, iFppip) +GO(ucurr_getName_75, pFppippp) + +GO(uloc_canonicalize_75, iFppip) +GO(uloc_countAvailable_75, iFv) +GO(uloc_getAvailable_75, pFi) +GO(uloc_getBaseName_75, iFppip) +GO(uloc_getCharacterOrientation_75, iFpp) +GO(uloc_getCountry_75, iFppip) +GO(uloc_getDefault_75, pFv) +GO(uloc_getDisplayCountry_75, iFpppip) +GO(uloc_getDisplayLanguage_75, iFpppip) +GO(uloc_getDisplayName_75, iFpppip) +GO(uloc_getISO3Country_75, pFp) +GO(uloc_getISO3Language_75, pFp) +GO(uloc_getKeywordValue_75, iFpppip) +GO(uloc_getLanguage_75, iFppip) +GO(uloc_getLCID_75, uFp) +GO(uloc_getName_75, iFppip) +GO(uloc_getParent_75, iFppip) +GO(uloc_setKeywordValue_75, iFpppip) + +GO(ures_close_75, vFp) +GO(ures_getByKey_75, pFpppp) +GO(ures_getSize_75, iFp) +GO(ures_getStringByIndex_75, pFpipp) +GO(ures_open_75, pFppp) + +GO(uldn_close_75, vFp) +GO(uldn_keyValueDisplayName_75, iFppppip) +GO(uldn_open_75, pFpip) + +GO(uenum_close_75, vFp) +GO(uenum_count_75, iFpp) +GO(uenum_next_75, pFppp) + +GO(uidna_close_75, vFp) +GO(uidna_nameToASCII_75, iFppipipp) +GO(uidna_nameToUnicode_75, iFppipipp) +GO(uidna_openUTS46_75, pFpp) + +GO(unorm2_getNFCInstance_75, pFp) +GO(unorm2_getNFDInstance_75, pFp) +GO(unorm2_getNFKCInstance_75, pFp) +GO(unorm2_getNFKDInstance_75, pFp) +GO(unorm2_isNormalized_75, CFppip) +GO(unorm2_normalize_75, iFppipip) + +GO(u_charsToUChars_75, vFppi) +GO(u_getVersion_75, vFp) +GO(u_strcmp_75, iFpp) +GO(u_strcpy_75, pFpp) +GO(u_strlen_75, iFp) +GO(u_strncpy_75, pFppi) +GO(u_strToLower_75, iFpipipp) +GO(u_strToUpper_75, iFpipipp) +GO(u_tolower_75, uFu) +GO(u_toupper_75, uFu) +GO(u_uastrncpy_75, pFppi) diff --git a/src/wrapped/wrappedicuuc76.c b/src/wrapped/wrappedicuuc76.c new file mode 100644 index 0000000..2218f86 --- /dev/null +++ b/src/wrapped/wrappedicuuc76.c @@ -0,0 +1,26 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* icuuc76Name = "libicuuc.so.76"; +#define LIBNAME icuuc76 + +#define ALTMY my76_ + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedicuuc76_private.h b/src/wrapped/wrappedicuuc76_private.h new file mode 100644 index 0000000..4c0f28d --- /dev/null +++ b/src/wrapped/wrappedicuuc76_private.h @@ -0,0 +1,92 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error meh! +#endif + +GO(ubrk_clone_76, pFpp) +GO(ubrk_close_76, vFp) +GO(ubrk_countAvailable_76, iFv) +GO(ubrk_current_76, iFp) +GO(ubrk_first_76, iFp) +GO(ubrk_following_76, iFpi) +GO(ubrk_getAvailable_76, pFi) +GO(ubrk_getBinaryRules_76, iFppip) +GO(ubrk_getLocaleByType_76, pFpip) +GO(ubrk_getRuleStatus_76, iFp) +GO(ubrk_getRuleStatusVec_76, iFppip) +GO(ubrk_isBoundary_76, cFpi) +GO(ubrk_last_76, iFp) +GO(ubrk_next_76, iFp) +GO(ubrk_open_76, pFppip) +GO(ubrk_openBinaryRules_76, pFpipip) +GO(ubrk_openRules_76, pFpipipp) +GO(ubrk_preceding_76, iFpi) +GO(ubrk_previous_76, iFp) +GO(ubrk_refreshUText_76, vFppp) +GO(ubrk_safeClone_76, pFpppp) +GO(ubrk_setText_76, vFppip) +GO(ubrk_setUText_76, vFppp) +GO(ubrk_swap_76, iFppipp) + +GO(ucnv_getDefaultName_76, pFv) +GO(ucnv_open_76, pFpp) +GO(ucnv_setDefaultName_76, vFp) + +GO(ucurr_forLocale_76, iFppip) +GO(ucurr_getName_76, pFppippp) + +GO(uloc_canonicalize_76, iFppip) +GO(uloc_countAvailable_76, iFv) +GO(uloc_getAvailable_76, pFi) +GO(uloc_getBaseName_76, iFppip) +GO(uloc_getCharacterOrientation_76, iFpp) +GO(uloc_getCountry_76, iFppip) +GO(uloc_getDefault_76, pFv) +GO(uloc_getDisplayCountry_76, iFpppip) +GO(uloc_getDisplayLanguage_76, iFpppip) +GO(uloc_getDisplayName_76, iFpppip) +GO(uloc_getISO3Country_76, pFp) +GO(uloc_getISO3Language_76, pFp) +GO(uloc_getKeywordValue_76, iFpppip) +GO(uloc_getLanguage_76, iFppip) +GO(uloc_getLCID_76, uFp) +GO(uloc_getName_76, iFppip) +GO(uloc_getParent_76, iFppip) +GO(uloc_setKeywordValue_76, iFpppip) + +GO(ures_close_76, vFp) +GO(ures_getByKey_76, pFpppp) +GO(ures_getSize_76, iFp) +GO(ures_getStringByIndex_76, pFpipp) +GO(ures_open_76, pFppp) + +GO(uldn_close_76, vFp) +GO(uldn_keyValueDisplayName_76, iFppppip) +GO(uldn_open_76, pFpip) + +GO(uenum_close_76, vFp) +GO(uenum_count_76, iFpp) +GO(uenum_next_76, pFppp) + +GO(uidna_close_76, vFp) +GO(uidna_nameToASCII_76, iFppipipp) +GO(uidna_nameToUnicode_76, iFppipipp) +GO(uidna_openUTS46_76, pFpp) + +GO(unorm2_getNFCInstance_76, pFp) +GO(unorm2_getNFDInstance_76, pFp) +GO(unorm2_getNFKCInstance_76, pFp) +GO(unorm2_getNFKDInstance_76, pFp) +GO(unorm2_isNormalized_76, CFppip) +GO(unorm2_normalize_76, iFppipip) + +GO(u_charsToUChars_76, vFppi) +GO(u_getVersion_76, vFp) +GO(u_strcmp_76, iFpp) +GO(u_strcpy_76, pFpp) +GO(u_strlen_76, iFp) +GO(u_strncpy_76, pFppi) +GO(u_strToLower_76, iFpipipp) +GO(u_strToUpper_76, iFpipipp) +GO(u_tolower_76, uFu) +GO(u_toupper_76, uFu) +GO(u_uastrncpy_76, pFppi) diff --git a/src/wrapped/wrappedidn2.c b/src/wrapped/wrappedidn2.c index b23e77f..8757740 100644 --- a/src/wrapped/wrappedidn2.c +++ b/src/wrapped/wrappedidn2.c @@ -12,6 +12,7 @@ #include "x64emu.h" const char* idn2Name = "libidn2.so.0"; +#define ALTNAME "libidn2.so" #define LIBNAME idn2 #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedidn2_private.h b/src/wrapped/wrappedidn2_private.h index cb73b85..dda2bca 100644 --- a/src/wrapped/wrappedidn2_private.h +++ b/src/wrapped/wrappedidn2_private.h @@ -1,5 +1,5 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif GO(idn2_check_version, pFp) @@ -8,18 +8,18 @@ GO(idn2_lookup_u8, iFppi) GO(idn2_lookup_ul, iFppi) //GO(_idn2_punycode_decode, //GO(_idn2_punycode_encode, -//GO(idn2_register_u8, -//GO(idn2_register_ul, +GO(idn2_register_u8, iFpppi) +GO(idn2_register_ul, iFpppi) GO(idn2_strerror, pFi) -//GO(idn2_strerror_name, -//GO(idn2_to_ascii_4i, -//GO(idn2_to_ascii_4i2, -//GO(idn2_to_ascii_4z, +GO(idn2_strerror_name, pFi) +GO(idn2_to_ascii_4i, iFpLpi) +GO(idn2_to_ascii_4i2, iFpLpi) +GO(idn2_to_ascii_4z, iFppi) GO(idn2_to_ascii_8z, iFppi) -//GO(idn2_to_ascii_lz, -//GO(idn2_to_unicode_44i, -//GO(idn2_to_unicode_4z4z, -//GO(idn2_to_unicode_8z4z, +GO(idn2_to_ascii_lz, iFppi) +GO(idn2_to_unicode_44i, iFpLppi) +GO(idn2_to_unicode_4z4z, iFppi) +GO(idn2_to_unicode_8z4z, iFppi) GO(idn2_to_unicode_8z8z, iFppi) -//GO(idn2_to_unicode_8zlz, -//GO(idn2_to_unicode_lzlz, +GO(idn2_to_unicode_8zlz, iFppi) +GO(idn2_to_unicode_lzlz, iFppi) diff --git a/src/wrapped/wrappedkrb5.c b/src/wrapped/wrappedkrb5.c index 19b3c10..562cfe8 100644 --- a/src/wrapped/wrappedkrb5.c +++ b/src/wrapped/wrappedkrb5.c @@ -16,11 +16,8 @@ #include "librarian.h" #include "callback.h" -#ifdef ANDROID - const char* krb5Name = "libkrb5.so"; -#else - const char* krb5Name = "libkrb5.so.3"; -#endif +const char* krb5Name = "libkrb5.so.3"; +#define ALTNAME "libkrb5.so" #define LIBNAME krb5 diff --git a/src/wrapped/wrappedlber.c b/src/wrapped/wrappedlber.c index c52db30..6b33edd 100644 --- a/src/wrapped/wrappedlber.c +++ b/src/wrapped/wrappedlber.c @@ -17,14 +17,9 @@ #include "callback.h" -const char* lberName = -#ifdef ANDROID - "liblber-2.4.so" -#else - "liblber-2.4.so.2" -#endif - ; -#define ALTNAME "liblber-2.5.so.0" +const char* lberName = "liblber-2.4.so.2"; +#define ALTNAME "liblber-2.4.so" +#define ALTNAME2 "liblber-2.5.so.0" #define LIBNAME lber #define ADDED_FUNCTIONS() \ diff --git a/src/wrapped/wrappedldapr.c b/src/wrapped/wrappedldapr.c index fca9619..1debf5e 100644 --- a/src/wrapped/wrappedldapr.c +++ b/src/wrapped/wrappedldapr.c @@ -16,14 +16,9 @@ #include "librarian.h" #include "callback.h" -const char* ldaprName = -#ifdef ANDROID - "libldap_r-2.4.so" -#else - "libldap_r-2.4.so.2" -#endif - ; -#define ALTNAME "libldap-2.5.so.0" +const char* ldaprName = "libldap_r-2.4.so.2"; +#define ALTNAME "libldap_r-2.4.so" +#define ALTNAME2 "libldap-2.5.so.0" #define LIBNAME ldapr #define ADDED_FUNCTIONS() \ @@ -68,10 +63,6 @@ EXPORT int my_ldap_sasl_interactive_bind_s(x64emu_t* emu, void* ld, void* dn, vo return my->ldap_sasl_interactive_bind_s(ld, dn, mechs, sctrls, cctrls, flags, find_LDAP_SASL_INTERACT_PROC_Fct(f), defaults); } -#ifdef ANDROID -#define NEEDED_LIBS "liblber-2.4.so" -#else #define NEEDED_LIBS "liblber-2.4.so.2" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedldlinux.c b/src/wrapped/wrappedldlinux.c index 90ec1b2..64a178c 100644 --- a/src/wrapped/wrappedldlinux.c +++ b/src/wrapped/wrappedldlinux.c @@ -21,17 +21,21 @@ typedef struct my_tls_s { unsigned long int o; } my_tls_t; -EXPORT void* my___tls_get_addr(void* p) +EXPORT void* my___tls_get_addr(x64emu_t* emu, void* p) { my_tls_t *t = (my_tls_t*)p; - tlsdatasize_t* ptr = getTLSData(my_context); + tlsdatasize_t* ptr = emu->tlsdata; + if (!ptr) { + refreshTLSData(emu); + ptr = emu->tlsdata; + } return ptr->data+GetTLSBase(my_context->elfs[t->i])+t->o; } EXPORT void* my___libc_stack_end; void stSetup(box64context_t* context) { - my___libc_stack_end = context->stack; // is this the end, or should I add stasz? + my___libc_stack_end = context->stack + context->stacksz; } #ifdef STATICBUILD diff --git a/src/wrapped/wrappedldlinux_private.h b/src/wrapped/wrappedldlinux_private.h index 4bde24e..6e2b6fe 100644 --- a/src/wrapped/wrappedldlinux_private.h +++ b/src/wrapped/wrappedldlinux_private.h @@ -15,15 +15,16 @@ // _dl_tls_setup DATA(__libc_enable_secure, sizeof(void*)) DATAM(__libc_stack_end, sizeof(void*)) -DATAB(_r_debug, 40) #ifdef STATICBUILD +//DATAB(_r_debug, 40) //DATA(__pointer_chk_guard, sizeof(void*)) //DATA(_rtld_global, sizeof(void*)) //DATA(_rtld_global_ro, sizeof(void*)) #else +DATAB(_r_debug, 40) DATA(__pointer_chk_guard, sizeof(void*)) DATA(_rtld_global, sizeof(void*)) DATA(_rtld_global_ro, sizeof(void*)) #endif DATA(__stack_chk_guard, sizeof(void*)) -GOM(__tls_get_addr, pFp) //%NoE +GOM(__tls_get_addr, pFEp) diff --git a/src/wrapped/wrappedlib_init.h b/src/wrapped/wrappedlib_init.h index 3505efd..c861228 100644 --- a/src/wrapped/wrappedlib_init.h +++ b/src/wrapped/wrappedlib_init.h @@ -20,6 +20,19 @@ #define DOIT(P,Q) _DOIT(P,Q) #include DOIT(LIBNAME,defs) +// regular symbol mapped to itself or another one (depending on HAVE_LD80BITS) +#ifdef HAVE_LD80BITS +#define GOD(N, W, O) GO(N, W) +#else +#define GOD(N, W, O) GO2(N, W, O) +#endif +// regular symbol mapped to itself or another one (depending on HAVE_LD80BITS), but weak +#ifdef HAVE_LD80BITS +#define GOWD(N, W, O) GOW(N, W) +#else +#define GOWD(N, W, O) GOW2(N, W, O) +#endif + // regular symbol mapped to itself #define GO(N, W) // regular symbol mapped to itself, but weak @@ -28,10 +41,10 @@ #define GOM(N, W) // symbol mapped to my_symbol, but weak #define GOWM(N, W) -// regular symbol mapped to itself, that returns a structure -#define GOS(N, W) // symbol mapped to another one #define GO2(N, W, O) +// symbol mapped to another one, but weak +#define GOW2(N, W, O) // data #define DATA(N, S) // data, Weak (type V) @@ -72,30 +85,24 @@ static const map_onesymbol_t MAPNAME(mysymbolmap)[] = { }; #undef GOM #undef GOWM -#undef GOS #define GOM(N, W) #define GOWM(N, W) -#ifdef STATICBUILD -#define GOS(N, W) {#N, W, 0, &my_##N}, -#else -#define GOS(N, W) {#N, W, 0}, -#endif -static const map_onesymbol_t MAPNAME(stsymbolmap)[] = { - #include PRIVATE(LIBNAME) -}; -#undef GOS #undef GO2 -#define GOS(N, W) +#undef GOW2 #ifdef STATICBUILD #define GO2(N, W, O) {#N, W, 0, #O, &O}, +#define GOW2(N, W, O) {#N, W, 1, #O, &O}, #else #define GO2(N, W, O) {#N, W, 0, #O}, +#define GOW2(N, W, O) {#N, W, 1, #O}, #endif static const map_onesymbol2_t MAPNAME(symbol2map)[] = { #include PRIVATE(LIBNAME) }; #undef GO2 +#undef GOW2 #define GO2(N, W, O) +#define GOW2(N, W, O) #undef DATA #undef DATAV #undef DATAB @@ -129,10 +136,12 @@ static const map_onedata_t MAPNAME(mydatamap)[] = { #undef GO #undef GOW +#undef GOD +#undef GOWD #undef GOM #undef GOWM #undef GO2 -#undef GOS +#undef GOW2 #undef DATA #undef DATAV #undef DATAB @@ -232,19 +241,6 @@ int FUNC(_init)(library_t* lib, box64context_t* box64) DOIT(symbolmap) DOIT(mysymbolmap) #undef DOIT - cnt = sizeof(MAPNAME(stsymbolmap))/sizeof(map_onesymbol_t); - for (int i=0; iw.stsymbolmap, MAPNAME(stsymbolmap)[i].name, &ret); - kh_value(lib->w.stsymbolmap, k).w = MAPNAME(stsymbolmap)[i].w; - #ifdef STATICBUILD - kh_value(lib->w.stsymbolmap, k).resolved = 1; - kh_value(lib->w.stsymbolmap, k).addr = (uintptr_t)MAPNAME(stsymbolmap)[i].addr; - #else - kh_value(lib->w.stsymbolmap, k).resolved = 0; - #endif - if(strchr(MAPNAME(stsymbolmap)[i].name, '@')) - AddDictionnary(box64->versym, MAPNAME(stsymbolmap)[i].name); - } cnt = sizeof(MAPNAME(symbol2map))/sizeof(map_onesymbol2_t); for (int i=0; iw.symbol2map, MAPNAME(symbol2map)[i].name, &ret); diff --git a/src/wrapped/wrappedlibasound.c b/src/wrapped/wrappedlibasound.c index f9919cc..481a7d1 100644 --- a/src/wrapped/wrappedlibasound.c +++ b/src/wrapped/wrappedlibasound.c @@ -32,7 +32,7 @@ static void default_error_handler(const char *file, int line, const char *functi } #define ADDED_INIT() \ - my_snd_lib_error = AddCheckBridge(my_context->system, vFpipipV, default_error_handler, 0, "ASoundCustomErrorHandler"); + my_snd_lib_error = AddCheckBridge(my_lib->w.bridge, vFpipipV, default_error_handler, 0, "ASoundCustomErrorHandler"); #define ADDED_FINI() \ my_snd_lib_error = 0; // no removing of bridge @@ -89,6 +89,94 @@ static void* findElemFct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for Asound Elem callback\n"); return NULL; } +// snd_pcm_hook_func_t +#define GO(A) \ +static uintptr_t my_pcm_hook_fct_##A = 0; \ +static int my_pcm_hook_##A(void* a) \ +{ \ + return (int)RunFunctionFmt(my_pcm_hook_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findPCMHookFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_pcm_hook_fct_##A == (uintptr_t)fct) return my_elem_##A; + SUPER() + #undef GO + #define GO(A) if(my_pcm_hook_fct_##A == 0) {my_pcm_hook_fct_##A = (uintptr_t)fct; return my_pcm_hook_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Asound PCMHook callback\n"); + return NULL; +} +// snd_mixer_compare_t +#define GO(A) \ +static uintptr_t my_mixer_compare_fct_##A = 0; \ +static int my_mixer_compare_##A(void* a) \ +{ \ + return (int)RunFunctionFmt(my_mixer_compare_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findMixerCompareFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_mixer_compare_fct_##A == (uintptr_t)fct) return my_elem_##A; + SUPER() + #undef GO + #define GO(A) if(my_mixer_compare_fct_##A == 0) {my_mixer_compare_fct_##A = (uintptr_t)fct; return my_mixer_compare_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Asound Mixer Compare callback\n"); + return NULL; +} +// private_free +#define GO(A) \ +static uintptr_t my_private_free_fct_##A = 0; \ +static int my_private_free_##A(void* a) \ +{ \ + return (int)RunFunctionFmt(my_private_free_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findPrivateFreeFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_private_free_fct_##A == (uintptr_t)fct) return my_elem_##A; + SUPER() + #undef GO + #define GO(A) if(my_private_free_fct_##A == 0) {my_private_free_fct_##A = (uintptr_t)fct; return my_private_free_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Asound PrivateFree callback\n"); + return NULL; +} +// snd_mixer_event_t +#define GO(A) \ +static uintptr_t my_mixer_event_fct_##A = 0; \ +static int my_mixer_event_##A(void* a, uint32_t b, void* c, void* d) \ +{ \ + return (int)RunFunctionFmt(my_mixer_event_fct_##A, "pupp", a, b, c, d); \ +} +SUPER() +#undef GO +static void* findMixerEventFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_mixer_event_fct_##A == (uintptr_t)fct) return my_elem_##A; + SUPER() + #undef GO + #define GO(A) if(my_mixer_event_fct_##A == 0) {my_mixer_event_fct_##A = (uintptr_t)fct; return my_mixer_event_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Asound MixerEvent callback\n"); + return NULL; +} EXPORT int my_snd_async_add_handler(x64emu_t *emu, void *handler, int fd, void* callback, void *private_data) @@ -142,6 +230,50 @@ EXPORT void my_snd_mixer_elem_set_callback(x64emu_t* emu, void* handler, void* f my->snd_mixer_elem_set_callback(handler, findElemFct(f)); } +EXPORT int my_snd_pcm_hook_add(x64emu_t* emu, void* hook, void* pcm, uint32_t type, void* f, void* data) +{ + return my->snd_pcm_hook_add(hook, pcm, type, findPCMHookFct(f), data); +} + +EXPORT int my_snd_mixer_set_compare(x64emu_t* emu, void* mixer, void* f) +{ + return my->snd_mixer_set_compare(mixer, findMixerCompareFct(f)); +} + +EXPORT int my_snd_mixer_elem_new(x64emu_t* emu, void* elem, uint32_t type, int weight, void* data, void* f) +{ + return my->snd_mixer_elem_new(elem, type, weight, data, findPrivateFreeFct(f)); +} + +EXPORT void* my_snd_mixer_class_get_event(x64emu_t* emu, void* class) +{ + void* ret = my->snd_mixer_class_get_event(class); + AddAutomaticBridge(my_lib->w.bridge, iFpupp, ret, 0, "snd_event_t"); + return ret; +} + +EXPORT void* my_snd_mixer_class_get_compare(x64emu_t* emu, void* class) +{ + void* ret = my->snd_mixer_class_get_compare(class); + AddAutomaticBridge(my_lib->w.bridge, iFpp, ret, 0, "snd_mixer_compare_t"); + return ret; +} + +EXPORT int my_snd_mixer_class_set_event(x64emu_t* emu, void* class, void* f) +{ + return my->snd_mixer_class_set_event(class, findMixerEventFct(f)); +} + +EXPORT int my_snd_mixer_class_set_private_free(x64emu_t* emu, void* class, void* f) +{ + return my->snd_mixer_class_set_private_free(class, findPrivateFreeFct(f)); +} + +EXPORT int my_snd_mixer_class_set_compare(x64emu_t* emu, void* class, void* f) +{ + return my->snd_mixer_class_set_compare(class, findMixerCompareFct(f)); +} + void* my_dlopen(x64emu_t* emu, void *filename, int flag); // defined in wrappedlibdl.c char* my_dlerror(x64emu_t* emu); int my_dlclose(x64emu_t* emu, void *handle); diff --git a/src/wrapped/wrappedlibasound_private.h b/src/wrapped/wrappedlibasound_private.h index ab6e05b..5c59aa5 100644 --- a/src/wrapped/wrappedlibasound_private.h +++ b/src/wrapped/wrappedlibasound_private.h @@ -1,10 +1,10 @@ -#if !(defined(GO) && defined(GOM) && defined(GO2)) -#error meh! +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... #endif DATAB(alsa_lisp_nil, 4) DATAB(alsa_lisp_t, 4) -DATAB(snd_config, 4) +DATAB(snd_config, 8) DATAB(_snd_config_hook_load_dlsym_config_hook_001, 4) DATAB(_snd_config_hook_load_for_all_cards_dlsym_config_hook_001, 4) DATAB(__snd_ctl_hw_open_dlsym_control_001, 4) @@ -63,29 +63,29 @@ GOM(snd_dlopen, pFEpipL) GOM(snd_dlsym, pFEppp) GOM(snd_dlclose, iFEp) GOM(snd_async_add_handler, iFEpipp) -//GO(snd_async_del_handler, iFp) -//GO(snd_async_handler_get_fd, iFp) -//GO(snd_async_handler_get_signo, iFp) +GO(snd_async_del_handler, iFp) +GO(snd_async_handler_get_fd, iFp) +GO(snd_async_handler_get_signo, iFp) GO(snd_async_handler_get_callback_private, pFp) GO(snd_shm_area_create, pFip) GO(snd_shm_area_share, pFp) GO(snd_shm_area_destroy, iFp) GO(snd_user_file, iFpp) GO(snd_input_stdio_open, iFppp) -GO(snd_input_stdio_attach, iFppi) -GO(snd_input_buffer_open, iFppu) +GO(snd_input_stdio_attach, iFpSi) +GO(snd_input_buffer_open, iFppl) GO(snd_input_close, iFp) -//GO(snd_input_scanf, iFppV) -GO(snd_input_gets, pFppu) +//GOM(snd_input_scanf, iFEppV) +GO(snd_input_gets, pFppL) GO(snd_input_getc, iFp) GO(snd_input_ungetc, iFpi) GO(snd_output_stdio_open, iFppp) -GO(snd_output_stdio_attach, iFppi) +GO(snd_output_stdio_attach, iFpSi) GO(snd_output_buffer_open, iFp) -GO(snd_output_buffer_string, uFpp) +GO(snd_output_buffer_string, LFpp) GO(snd_output_close, iFp) -//GO(snd_output_printf, iFppV) -//GO(snd_output_vprintf, iFppV) +//GOM(snd_output_printf, iFEppV) +//GOM(snd_output_vprintf, iFEppA) GO(snd_output_puts, iFpp) GO(snd_output_putc, iFpi) GO(snd_output_flush, iFp) @@ -100,7 +100,7 @@ GO(snd_config_update_r, iFppp) GO(snd_config_update_free, iFp) GO(snd_config_update_free_global, iFv) GO(snd_config_search, iFppp) -//GO(snd_config_searchv, iFppV) +//GOM(snd_config_searchv, iFEppV) GO(snd_config_search_definition, iFpppp) GO(snd_config_expand, iFppppp) GO(snd_config_evaluate, iFpppp) @@ -108,21 +108,21 @@ GO(snd_config_add, iFpp) GO(snd_config_delete, iFp) GO(snd_config_delete_compound_members, iFp) GO(snd_config_copy, iFpp) -GO(snd_config_make, iFppi) +GO(snd_config_make, iFppu) GO(snd_config_make_integer, iFpp) GO(snd_config_make_integer64, iFpp) GO(snd_config_make_real, iFpp) GO(snd_config_make_string, iFpp) GO(snd_config_make_pointer, iFpp) GO(snd_config_make_compound, iFppi) -GO(snd_config_imake_integer, iFppi) +GO(snd_config_imake_integer, iFppl) GO(snd_config_imake_integer64, iFppI) GO(snd_config_imake_real, iFppd) GO(snd_config_imake_string, iFppp) GO(snd_config_imake_pointer, iFppp) -GO(snd_config_get_type, iFp) +GO(snd_config_get_type, uFp) GO(snd_config_set_id, iFpp) -GO(snd_config_set_integer, iFpi) +GO(snd_config_set_integer, iFpl) GO(snd_config_set_integer64, iFpI) GO(snd_config_set_real, iFpd) GO(snd_config_set_string, iFpp) @@ -145,14 +145,16 @@ GO(snd_config_get_bool_ascii, iFp) GO(snd_config_get_bool, iFp) GO(snd_config_get_ctl_iface_ascii, iFp) GO(snd_config_get_ctl_iface, iFp) +GO(snd_ctl_ascii_value_parse, iFpppp) GO(snd_device_name_free_hint, iFp) GO(snd_device_name_get_hint, pFpp) GO(snd_device_name_hint, iFipp) GO(snd_names_list, iFpp) GO(snd_names_list_free, vFp) -GO(snd_pcm_format_mask_sizeof, uFv) -GO(snd_pcm_subformat_mask_sizeof, uFv) -GO(snd_pcm_status_sizeof, uFv) +GO(snd_pcm_format_mask_sizeof, LFv) +GO(snd_pcm_free_chmaps, vFp) +GO(snd_pcm_subformat_mask_sizeof, LFv) +GO(snd_pcm_status_sizeof, LFv) GOM(snd_async_add_pcm_handler, iFEpppp) GO(snd_async_handler_get_pcm, pFp) GO(snd_pcm_access_mask_any, vFp) @@ -161,24 +163,24 @@ GO(snd_pcm_access_mask_empty, iFp) GO(snd_pcm_access_mask_free, vFp) GO(snd_pcm_access_mask_malloc, iFp) GO(snd_pcm_access_mask_none, vFp) -GO(snd_pcm_access_mask_reset, vFpi) -GO(snd_pcm_access_mask_set, vFpi) -GO(snd_pcm_access_mask_test, iFpi) -GO(snd_pcm_access_name, pFi) -GO(snd_pcm_area_copy, iFpupuui) -GO(snd_pcm_area_silence, iFpuui) -GO(snd_pcm_areas_copy, iFpupuuui) -GO(snd_pcm_areas_silence, iFpuuui) -GO(snd_pcm_avail, iFp) +GO(snd_pcm_access_mask_reset, vFpu) +GO(snd_pcm_access_mask_set, vFpu) +GO(snd_pcm_access_mask_test, iFpu) +GO(snd_pcm_access_name, pFu) +GO(snd_pcm_area_copy, iFpLpLui) +GO(snd_pcm_area_silence, iFpLui) +GO(snd_pcm_areas_copy, iFpLpLuLi) +GO(snd_pcm_areas_silence, iFpLuLi) +GO(snd_pcm_avail, lFp) GO(snd_pcm_avail_delay, iFppp) -GO(snd_pcm_avail_update, iFp) +GO(snd_pcm_avail_update, lFp) GO(snd_pcm_build_linear_format, iFiiii) -GO(snd_pcm_bytes_to_frames, iFpu) -GO(snd_pcm_bytes_to_samples, iFpu) -GO(snd_pcm_chmap_type_name, pFi) -GO(snd_pcm_chmap_name, pFi) -GO(snd_pcm_chmap_long_name, pFi) -GO(snd_pcm_chmap_print, iFpup) +GO(snd_pcm_bytes_to_frames, lFpl) +GO(snd_pcm_bytes_to_samples, lFpl) +GO(snd_pcm_chmap_type_name, pFu) +GO(snd_pcm_chmap_name, pFu) +GO(snd_pcm_chmap_long_name, pFu) +GO(snd_pcm_chmap_print, iFpLp) GO(snd_pcm_chmap_from_string, uFp) GO(snd_pcm_chmap_parse_string, pFp) GO(snd_pcm_close, iFp) @@ -208,19 +210,19 @@ GO(snd_pcm_format_name, pFi) GO(snd_pcm_format_physical_width, iFi) GO(snd_pcm_format_set_silence, iFipu) GO(snd_pcm_format_signed, iFi) -GO(snd_pcm_format_silence, iFi) -GO(snd_pcm_format_silence_16, iFi) -GO(snd_pcm_format_silence_32, iFi) -GO(snd_pcm_format_silence_64, iFi) -GO(snd_pcm_format_size, uFiu) +GO(snd_pcm_format_silence, CFi) +GO(snd_pcm_format_silence_16, WFi) +GO(snd_pcm_format_silence_32, uFi) +GO(snd_pcm_format_silence_64, UFi) +GO(snd_pcm_format_size, lFiL) GO(snd_pcm_format_unsigned, iFi) GO(snd_pcm_format_value, iFp) GO(snd_pcm_format_width, iFi) -GO(snd_pcm_forward, iFpu) -GO(snd_pcm_frames_to_bytes, uFpi) +GO(snd_pcm_forward, lFpL) +GO(snd_pcm_frames_to_bytes, lFpl) GO(snd_pcm_get_params, iFppp) GO(snd_pcm_get_chmap, pFp) -GO(snd_pcm_hook_add, iFppipp) +GOM(snd_pcm_hook_add, iFEppupp) GO(snd_pcm_hook_get_pcm, pFp) GO(snd_pcm_hook_get_private, pFp) GO(snd_pcm_hook_remove, iFp) @@ -279,11 +281,11 @@ GO(snd_pcm_hw_params_is_double, iFp) GO(snd_pcm_hw_params_is_half_duplex, iFp) GO(snd_pcm_hw_params_is_joint_duplex, iFp) GO(snd_pcm_hw_params_malloc, iFp) -GO(snd_pcm_hw_params_set_access, iFppi) +GO(snd_pcm_hw_params_set_access, iFppu) GO(snd_pcm_hw_params_set_access_first, iFppp) GO(snd_pcm_hw_params_set_access_last, iFppp) GO(snd_pcm_hw_params_set_access_mask, iFppp) -GO(snd_pcm_hw_params_set_buffer_size, iFppu) +GO(snd_pcm_hw_params_set_buffer_size, iFppL) GO(snd_pcm_hw_params_set_buffer_size_first, iFppp) GO(snd_pcm_hw_params_set_buffer_size_last, iFppp) GO(snd_pcm_hw_params_set_buffer_size_max, iFppp) @@ -309,7 +311,7 @@ GO(snd_pcm_hw_params_set_format, iFppi) GO(snd_pcm_hw_params_set_format_first, iFppp) GO(snd_pcm_hw_params_set_format_last, iFppp) GO(snd_pcm_hw_params_set_format_mask, iFppp) -GO(snd_pcm_hw_params_set_period_size, iFppui) +GO(snd_pcm_hw_params_set_period_size, iFppLi) GO(snd_pcm_hw_params_set_period_size_first, iFpppp) GO(snd_pcm_hw_params_set_period_size_integer, iFpp) GO(snd_pcm_hw_params_set_period_size_last, iFpppp) @@ -351,12 +353,12 @@ GO(snd_pcm_hw_params_set_tick_time_max, iFpppp) GO(snd_pcm_hw_params_set_tick_time_min, iFpppp) GO(snd_pcm_hw_params_set_tick_time_minmax, iFpppppp) GO(snd_pcm_hw_params_set_tick_time_near, iFpppp) -GO(snd_pcm_hw_params_test_access, iFppi) -GO(snd_pcm_hw_params_test_buffer_size, iFppu) +GO(snd_pcm_hw_params_test_access, iFppu) +GO(snd_pcm_hw_params_test_buffer_size, iFppL) GO(snd_pcm_hw_params_test_buffer_time, iFppui) GO(snd_pcm_hw_params_test_channels, iFppu) GO(snd_pcm_hw_params_test_format, iFppi) -GO(snd_pcm_hw_params_test_period_size, iFppui) +GO(snd_pcm_hw_params_test_period_size, iFppLi) GO(snd_pcm_hw_params_test_period_time, iFppui) GO(snd_pcm_hw_params_test_periods, iFppui) GO(snd_pcm_hw_params_test_rate, iFppui) @@ -367,86 +369,87 @@ GO(snd_pcm_info, iFpp) GO(snd_pcm_info_copy, vFpp) GO(snd_pcm_info_free, vFp) GO(snd_pcm_info_get_card, iFp) -GO(snd_pcm_info_get_class, iFp) +GO(snd_pcm_info_get_class, uFp) GO(snd_pcm_info_get_device, uFp) GO(snd_pcm_info_get_id, pFp) GO(snd_pcm_info_get_name, pFp) -GO(snd_pcm_info_get_stream, iFp) -GO(snd_pcm_info_get_subclass, iFp) +GO(snd_pcm_info_get_stream, uFp) +GO(snd_pcm_info_get_subclass, uFp) GO(snd_pcm_info_get_subdevice, uFp) GO(snd_pcm_info_get_subdevice_name, pFp) GO(snd_pcm_info_get_subdevices_avail, uFp) GO(snd_pcm_info_get_subdevices_count, uFp) -GO(snd_pcm_info_get_sync, pFp) +GO(snd_pcm_info_get_sync, HFp) GO(snd_pcm_info_malloc, iFp) -GO(snd_pcm_info_sizeof, uFv) -GO(snd_pcm_access_mask_sizeof, uFv) +GO(snd_pcm_info_sizeof, LFv) +GO(snd_pcm_access_mask_sizeof, LFv) GO(snd_pcm_info_set_device, vFpu) -GO(snd_pcm_info_set_stream, vFpi) +GO(snd_pcm_info_set_stream, vFpu) GO(snd_pcm_info_set_subdevice, vFpu) GO(snd_pcm_link, iFpp) GO(snd_pcm_meter_add_scope, iFpp) -GO(snd_pcm_meter_get_boundary, uFp) -GO(snd_pcm_meter_get_bufsize, uFp) +GO(snd_pcm_meter_get_boundary, LFp) +GO(snd_pcm_meter_get_bufsize, LFp) GO(snd_pcm_meter_get_channels, uFp) -GO(snd_pcm_meter_get_now, uFp) +GO(snd_pcm_meter_get_now, LFp) GO(snd_pcm_meter_get_rate, uFp) GO(snd_pcm_meter_search_scope, pFpp) GO(snd_pcm_mmap_begin, iFpppp) -GO(snd_pcm_mmap_commit, iFpuu) -GO(snd_pcm_mmap_readi, iFppu) -GO(snd_pcm_mmap_readn, iFppu) -GO(snd_pcm_mmap_writei, iFppu) -GO(snd_pcm_mmap_writen, iFppu) +GO(snd_pcm_mmap_commit, lFpLL) +GO(snd_pcm_mmap_readi, lFppL) +GO(snd_pcm_mmap_readn, lFppL) +GO(snd_pcm_mmap_writei, lFppL) +GO(snd_pcm_mmap_writen, lFppL) GO(snd_pcm_name, pFp) GO(snd_pcm_nonblock, iFpi) -GO(snd_pcm_open, iFppii) -GO(snd_pcm_open_lconf, iFppiip) +GO(snd_pcm_open, iFppui) +GO(snd_pcm_open_lconf, iFppuip) GO(snd_pcm_pause, iFpi) GO(snd_pcm_poll_descriptors, iFppu) GO(snd_pcm_poll_descriptors_count, iFp) GO(snd_pcm_poll_descriptors_revents, iFppup) GO(snd_pcm_prepare, iFp) -GO(snd_pcm_readi, iFppu) -GO(snd_pcm_readn, iFppu) +GO(snd_pcm_query_chmaps, pFp) +GO(snd_pcm_readi, lFppL) +GO(snd_pcm_readn, lFppL) GO(snd_pcm_recover, iFpii) GO(snd_pcm_reset, iFp) GO(snd_pcm_resume, iFp) -GO(snd_pcm_rewind, iFpu) -GO(snd_pcm_samples_to_bytes, uFpi) +GO(snd_pcm_rewind, lFpL) +GO(snd_pcm_samples_to_bytes, lFpl) //GOM(snd_pcm_scope_get_callback_private, pFEp) GO(snd_pcm_scope_get_name, pFp) GO(snd_pcm_scope_malloc, iFp) GO(snd_pcm_scope_s16_get_channel_buffer, pFpu) GO(snd_pcm_scope_s16_open, iFppp) //GOM(snd_pcm_scope_set_callback_private, vFEpp) -GO(snd_pcm_hw_params_sizeof, uFv) -GO(snd_pcm_sw_params_sizeof, uFv) +GO(snd_pcm_hw_params_sizeof, LFv) +GO(snd_pcm_sw_params_sizeof, LFv) GO(snd_pcm_hw_params_is_monotonic, iFp) GO(snd_pcm_scope_set_name, vFpp) //GOM(snd_pcm_scope_set_ops, vFEpp) GO(snd_pcm_set_chmap, iFpp) -GO(snd_pcm_set_params, iFpiiuuiu) +GO(snd_pcm_set_params, iFpiuuuiu) GO(snd_pcm_start, iFp) -GO(snd_pcm_start_mode_name, pFi) -GO(snd_pcm_state, iFp) -GO(snd_pcm_state_name, pFi) +GO(snd_pcm_start_mode_name, pFu) +GO(snd_pcm_state, uFp) +GO(snd_pcm_state_name, pFu) GO(snd_pcm_status, iFpp) GO(snd_pcm_status_copy, vFpp) GO(snd_pcm_status_dump, iFpp) GO(snd_pcm_status_free, vFp) -GO(snd_pcm_status_get_avail, uFp) -GO(snd_pcm_status_get_avail_max, uFp) -GO(snd_pcm_status_get_delay, iFp) +GO(snd_pcm_status_get_avail, LFp) +GO(snd_pcm_status_get_avail_max, LFp) +GO(snd_pcm_status_get_delay, lFp) GO(snd_pcm_status_get_htstamp, vFpp) -GO(snd_pcm_status_get_overrange, uFp) -GO(snd_pcm_status_get_state, iFp) +GO(snd_pcm_status_get_overrange, LFp) +GO(snd_pcm_status_get_state, uFp) GO(snd_pcm_status_get_trigger_htstamp, vFpp) GO(snd_pcm_status_get_trigger_tstamp, vFpp) GO(snd_pcm_status_get_tstamp, vFpp) GO(snd_pcm_status_malloc, iFp) -GO(snd_pcm_stream, iFp) -GO(snd_pcm_stream_name, pFi) +GO(snd_pcm_stream, uFp) +GO(snd_pcm_stream_name, pFu) GO(snd_pcm_subformat_description, pFi) GO(snd_pcm_subformat_mask_any, vFp) GO(snd_pcm_subformat_mask_copy, vFpp) @@ -468,35 +471,35 @@ GO(snd_pcm_sw_params_get_boundary, iFpp) GO(snd_pcm_sw_params_get_silence_size, iFpp) GO(snd_pcm_sw_params_get_silence_threshold, iFpp) GO(snd_pcm_sw_params_get_sleep_min, iFpp) -GO(snd_pcm_sw_params_get_start_mode, iFp) +GO(snd_pcm_sw_params_get_start_mode, uFp) GO(snd_pcm_sw_params_get_start_threshold, iFpp) GO(snd_pcm_sw_params_get_stop_threshold, iFpp) GO(snd_pcm_sw_params_get_tstamp_mode, iFpp) GO(snd_pcm_sw_params_get_xfer_align, iFpp) -GO(snd_pcm_sw_params_get_xrun_mode, iFp) +GO(snd_pcm_sw_params_get_xrun_mode, uFp) GO(snd_pcm_sw_params_malloc, iFp) -GO(snd_pcm_sw_params_set_avail_min, iFppu) +GO(snd_pcm_sw_params_set_avail_min, iFppL) GO(snd_pcm_sw_params_set_period_event, iFppi) -GO(snd_pcm_sw_params_set_silence_size, iFppu) -GO(snd_pcm_sw_params_set_silence_threshold, iFppu) +GO(snd_pcm_sw_params_set_silence_size, iFppL) +GO(snd_pcm_sw_params_set_silence_threshold, iFppL) GO(snd_pcm_sw_params_set_sleep_min, iFppu) -GO(snd_pcm_sw_params_set_start_mode, iFppi) -GO(snd_pcm_sw_params_set_start_threshold, iFppu) -GO(snd_pcm_sw_params_set_stop_threshold, iFppu) -GO(snd_pcm_sw_params_set_tstamp_mode, iFppi) -GO(snd_pcm_sw_params_set_tstamp_type, iFppi) -GO(snd_pcm_sw_params_set_xfer_align, iFppu) -GO(snd_pcm_sw_params_set_xrun_mode, iFppi) -GO(snd_pcm_tstamp_mode_name, pFi) -GO(snd_pcm_type, iFp) -GO(snd_pcm_type_name, pFi) +GO(snd_pcm_sw_params_set_start_mode, iFppu) +GO(snd_pcm_sw_params_set_start_threshold, iFppL) +GO(snd_pcm_sw_params_set_stop_threshold, iFppL) +GO(snd_pcm_sw_params_set_tstamp_mode, iFppu) +GO(snd_pcm_sw_params_set_tstamp_type, iFppu) +GO(snd_pcm_sw_params_set_xfer_align, iFppL) +GO(snd_pcm_sw_params_set_xrun_mode, iFppu) +GO(snd_pcm_tstamp_mode_name, pFu) +GO(snd_pcm_type, uFp) +GO(snd_pcm_type_name, pFu) GO(snd_pcm_unlink, iFp) GO(snd_pcm_wait, iFpi) -GO(snd_pcm_writei, iFppu) -GO(snd_pcm_writen, iFppu) -GO(snd_pcm_xrun_mode_name, pFi) -GO(snd_spcm_init, iFpuuiiiii) -GO(snd_spcm_init_duplex, iFppuuiiiiii) +GO(snd_pcm_writei, lFppL) +GO(snd_pcm_writen, lFppL) +GO(snd_pcm_xrun_mode_name, pFu) +GO(snd_spcm_init, iFpuuiiuuu) +GO(snd_spcm_init_duplex, iFppuuiiuuuu) GO(snd_spcm_init_get_params, iFpppp) GO(snd_rawmidi_open, iFpppi) GO(snd_rawmidi_open_lconf, iFpppip) @@ -505,13 +508,13 @@ GO(snd_rawmidi_poll_descriptors_count, iFp) GO(snd_rawmidi_poll_descriptors, iFppu) GO(snd_rawmidi_poll_descriptors_revents, iFppup) GO(snd_rawmidi_nonblock, iFpi) -GO(snd_rawmidi_info_sizeof, uFv) +GO(snd_rawmidi_info_sizeof, LFv) GO(snd_rawmidi_info_malloc, iFp) GO(snd_rawmidi_info_free, vFp) GO(snd_rawmidi_info_copy, vFpp) GO(snd_rawmidi_info_get_device, uFp) GO(snd_rawmidi_info_get_subdevice, uFp) -GO(snd_rawmidi_info_get_stream, iFp) +GO(snd_rawmidi_info_get_stream, uFp) GO(snd_rawmidi_info_get_card, iFp) GO(snd_rawmidi_info_get_flags, uFp) GO(snd_rawmidi_info_get_id, pFp) @@ -521,35 +524,35 @@ GO(snd_rawmidi_info_get_subdevices_count, uFp) GO(snd_rawmidi_info_get_subdevices_avail, uFp) GO(snd_rawmidi_info_set_device, vFpu) GO(snd_rawmidi_info_set_subdevice, vFpu) -GO(snd_rawmidi_info_set_stream, vFpi) +GO(snd_rawmidi_info_set_stream, vFpu) GO(snd_rawmidi_info, iFpp) -GO(snd_rawmidi_params_sizeof, uFv) +GO(snd_rawmidi_params_sizeof, LFv) GO(snd_rawmidi_params_malloc, iFp) GO(snd_rawmidi_params_free, vFp) GO(snd_rawmidi_params_copy, vFpp) -GO(snd_rawmidi_params_set_buffer_size, iFppu) -GO(snd_rawmidi_params_get_buffer_size, uFp) -GO(snd_rawmidi_params_set_avail_min, iFppu) -GO(snd_rawmidi_params_get_avail_min, uFp) +GO(snd_rawmidi_params_set_buffer_size, iFppL) +GO(snd_rawmidi_params_get_buffer_size, LFp) +GO(snd_rawmidi_params_set_avail_min, iFppL) +GO(snd_rawmidi_params_get_avail_min, LFp) GO(snd_rawmidi_params_set_no_active_sensing, iFppi) GO(snd_rawmidi_params_get_no_active_sensing, iFp) GO(snd_rawmidi_params, iFpp) GO(snd_rawmidi_params_current, iFpp) -GO(snd_rawmidi_status_sizeof, uFv) +GO(snd_rawmidi_status_sizeof, LFv) GO(snd_rawmidi_status_malloc, iFp) GO(snd_rawmidi_status_free, vFp) GO(snd_rawmidi_status_copy, vFpp) GO(snd_rawmidi_status_get_tstamp, vFpp) -GO(snd_rawmidi_status_get_avail, uFp) -GO(snd_rawmidi_status_get_xruns, uFp) +GO(snd_rawmidi_status_get_avail, LFp) +GO(snd_rawmidi_status_get_xruns, LFp) GO(snd_rawmidi_status, iFpp) GO(snd_rawmidi_drain, iFp) GO(snd_rawmidi_drop, iFp) -GO(snd_rawmidi_write, uFppu) -GO(snd_rawmidi_read, uFppu) +GO(snd_rawmidi_write, lFppL) +GO(snd_rawmidi_read, lFppL) GO(snd_rawmidi_name, pFp) -GO(snd_rawmidi_type, iFp) -GO(snd_rawmidi_stream, iFp) +GO(snd_rawmidi_type, uFp) +GO(snd_rawmidi_stream, uFp) GO(snd_timer_query_open, iFppi) GO(snd_timer_query_open_lconf, iFppip) GO(snd_timer_query_close, iFp) @@ -560,8 +563,8 @@ GO(snd_timer_query_status, iFpp) GO(snd_timer_open, iFppi) GO(snd_timer_open_lconf, iFppip) GO(snd_timer_close, iFp) -//GO(snd_async_add_timer_handler, iFppPp) -//GO(snd_async_handler_get_timer, pFp) +//GOM(snd_async_add_timer_handler, iFEpppp) +GO(snd_async_handler_get_timer, pFp) GO(snd_timer_poll_descriptors_count, iFp) GO(snd_timer_poll_descriptors, iFppu) GO(snd_timer_poll_descriptors_revents, iFppup) @@ -571,8 +574,8 @@ GO(snd_timer_status, iFpp) GO(snd_timer_start, iFp) GO(snd_timer_stop, iFp) GO(snd_timer_continue, iFp) -GO(snd_timer_read, uFppu) -GO(snd_timer_id_sizeof, uFv) +GO(snd_timer_read, lFppL) +GO(snd_timer_id_sizeof, LFv) GO(snd_timer_id_malloc, iFp) GO(snd_timer_id_free, vFp) GO(snd_timer_id_copy, vFpp) @@ -586,7 +589,7 @@ GO(snd_timer_id_set_device, vFpi) GO(snd_timer_id_get_device, iFp) GO(snd_timer_id_set_subdevice, vFpi) GO(snd_timer_id_get_subdevice, iFp) -GO(snd_timer_ginfo_sizeof, uFv) +GO(snd_timer_ginfo_sizeof, LFv) GO(snd_timer_ginfo_malloc, iFp) GO(snd_timer_ginfo_free, vFp) GO(snd_timer_ginfo_copy, vFpp) @@ -596,11 +599,11 @@ GO(snd_timer_ginfo_get_flags, uFp) GO(snd_timer_ginfo_get_card, iFp) GO(snd_timer_ginfo_get_id, pFp) GO(snd_timer_ginfo_get_name, pFp) -GO(snd_timer_ginfo_get_resolution, iFp) -GO(snd_timer_ginfo_get_resolution_min, iFp) -GO(snd_timer_ginfo_get_resolution_max, iFp) +GO(snd_timer_ginfo_get_resolution, LFp) +GO(snd_timer_ginfo_get_resolution_min, LFp) +GO(snd_timer_ginfo_get_resolution_max, LFp) GO(snd_timer_ginfo_get_clients, uFp) -GO(snd_timer_info_sizeof, uFv) +GO(snd_timer_info_sizeof, LFv) GO(snd_timer_info_malloc, iFp) GO(snd_timer_info_free, vFp) GO(snd_timer_info_copy, vFpp) @@ -608,8 +611,8 @@ GO(snd_timer_info_is_slave, iFp) GO(snd_timer_info_get_card, iFp) GO(snd_timer_info_get_id, pFp) GO(snd_timer_info_get_name, pFp) -GO(snd_timer_info_get_resolution, iFp) -GO(snd_timer_params_sizeof, uFv) +GO(snd_timer_info_get_resolution, lFp) +GO(snd_timer_params_sizeof, LFv) GO(snd_timer_params_malloc, iFp) GO(snd_timer_params_free, vFp) GO(snd_timer_params_copy, vFpp) @@ -619,22 +622,22 @@ GO(snd_timer_params_set_exclusive, iFpi) GO(snd_timer_params_get_exclusive, iFp) GO(snd_timer_params_set_early_event, iFpi) GO(snd_timer_params_get_early_event, iFp) -GO(snd_timer_params_set_ticks, vFpi) -GO(snd_timer_params_get_ticks, iFp) -GO(snd_timer_params_set_queue_size, vFpi) -GO(snd_timer_params_get_queue_size, iFp) +GO(snd_timer_params_set_ticks, vFpl) +GO(snd_timer_params_get_ticks, lFp) +GO(snd_timer_params_set_queue_size, vFpl) +GO(snd_timer_params_get_queue_size, lFp) GO(snd_timer_params_set_filter, vFpu) GO(snd_timer_params_get_filter, uFp) -GO(snd_timer_status_sizeof, uFv) +GO(snd_timer_status_sizeof, LFv) GO(snd_timer_status_malloc, iFp) GO(snd_timer_status_free, vFp) GO(snd_timer_status_copy, vFpp) -GO(snd_timer_status_get_timestamp, iFp) -GO(snd_timer_status_get_resolution, iFp) -GO(snd_timer_status_get_lost, iFp) -GO(snd_timer_status_get_overrun, iFp) -GO(snd_timer_status_get_queue, iFp) -GO(snd_timer_info_get_ticks, iFp) +GO(snd_timer_status_get_timestamp, HFp) +GO(snd_timer_status_get_resolution, lFp) +GO(snd_timer_status_get_lost, lFp) +GO(snd_timer_status_get_overrun, lFp) +GO(snd_timer_status_get_queue, lFp) +GO(snd_timer_info_get_ticks, lFp) GO(snd_hwdep_open, iFppi) GO(snd_hwdep_close, iFp) GO(snd_hwdep_poll_descriptors, iFppu) @@ -644,10 +647,10 @@ GO(snd_hwdep_info, iFpp) GO(snd_hwdep_dsp_status, iFpp) GO(snd_hwdep_dsp_load, iFpp) GO(snd_hwdep_ioctl, iFpup) -GO(snd_hwdep_write, uFppu) -GO(snd_hwdep_read, uFppu) -GO(snd_hwdep_info_sizeof, uFv) -GO(snd_hwdep_dsp_status_sizeof, uFv) +GO(snd_hwdep_write, lFppL) +GO(snd_hwdep_read, lFppL) +GO(snd_hwdep_info_sizeof, LFv) +GO(snd_hwdep_dsp_status_sizeof, LFv) GO(snd_hwdep_dsp_status_malloc, iFp) GO(snd_hwdep_dsp_status_free, vFp) GO(snd_hwdep_dsp_status_copy, vFpp) @@ -656,18 +659,18 @@ GO(snd_hwdep_dsp_status_get_id, pFp) GO(snd_hwdep_dsp_status_get_num_dsps, uFp) GO(snd_hwdep_dsp_status_get_dsp_loaded, uFp) GO(snd_hwdep_dsp_status_get_chip_ready, uFp) -GO(snd_hwdep_dsp_image_sizeof, uFv) +GO(snd_hwdep_dsp_image_sizeof, LFv) GO(snd_hwdep_dsp_image_malloc, iFp) GO(snd_hwdep_dsp_image_free, vFp) GO(snd_hwdep_dsp_image_copy, vFpp) GO(snd_hwdep_dsp_image_get_index, uFp) GO(snd_hwdep_dsp_image_get_name, pFp) GO(snd_hwdep_dsp_image_get_image, pFp) -GO(snd_hwdep_dsp_image_get_length, uFp) +GO(snd_hwdep_dsp_image_get_length, LFp) GO(snd_hwdep_dsp_image_set_index, vFpu) GO(snd_hwdep_dsp_image_set_name, vFpp) GO(snd_hwdep_dsp_image_set_image, vFpp) -GO(snd_hwdep_dsp_image_set_length, vFpu) +GO(snd_hwdep_dsp_image_set_length, vFpL) GO(snd_card_load, iFi) GO(snd_card_next, iFp) GO(snd_card_get_index, iFp) @@ -677,8 +680,8 @@ GO(snd_ctl_open, iFppi) GO(snd_ctl_open_lconf, iFppip) GO(snd_ctl_close, iFp) GO(snd_ctl_nonblock, iFpi) -//GO(snd_async_add_ctl_handler, iFppPp) -//GO(snd_async_handler_get_ctl, pFp) +//GOM(snd_async_add_ctl_handler, iFEpppp) +GO(snd_async_handler_get_ctl, pFp) GO(snd_ctl_poll_descriptors_count, iFp) GO(snd_ctl_poll_descriptors, iFppu) GO(snd_ctl_poll_descriptors_revents, iFppup) @@ -706,38 +709,38 @@ GO(snd_ctl_get_power_state, iFpp) GO(snd_ctl_read, iFpp) GO(snd_ctl_wait, iFpi) GO(snd_ctl_name, pFp) -GO(snd_ctl_type, iFp) -GO(snd_ctl_elem_type_name, pFi) -GO(snd_ctl_elem_iface_name, pFi) -GO(snd_ctl_event_type_name, pFi) +GO(snd_ctl_type, uFp) +GO(snd_ctl_elem_type_name, pFu) +GO(snd_ctl_elem_iface_name, pFu) +GO(snd_ctl_event_type_name, pFu) GO(snd_ctl_event_elem_get_mask, uFp) GO(snd_ctl_event_elem_get_numid, uFp) GO(snd_ctl_event_elem_get_id, vFpp) -GO(snd_ctl_event_elem_get_interface, iFp) +GO(snd_ctl_event_elem_get_interface, uFp) GO(snd_ctl_event_elem_get_device, uFp) GO(snd_ctl_event_elem_get_subdevice, uFp) GO(snd_ctl_event_elem_get_name, pFp) GO(snd_ctl_event_elem_get_index, uFp) GO(snd_ctl_elem_list_alloc_space, iFpu) GO(snd_ctl_elem_list_free_space, vFp) -GO(snd_ctl_elem_id_sizeof, uFv) +GO(snd_ctl_elem_id_sizeof, LFv) GO(snd_ctl_elem_id_malloc, iFp) GO(snd_ctl_elem_id_free, vFp) GO(snd_ctl_elem_id_clear, vFp) GO(snd_ctl_elem_id_copy, vFpp) GO(snd_ctl_elem_id_get_numid, uFp) -GO(snd_ctl_elem_id_get_interface, iFp) +GO(snd_ctl_elem_id_get_interface, uFp) GO(snd_ctl_elem_id_get_device, uFp) GO(snd_ctl_elem_id_get_subdevice, uFp) GO(snd_ctl_elem_id_get_name, pFp) GO(snd_ctl_elem_id_get_index, uFp) GO(snd_ctl_elem_id_set_numid, vFpu) -GO(snd_ctl_elem_id_set_interface, vFpi) +GO(snd_ctl_elem_id_set_interface, vFpu) GO(snd_ctl_elem_id_set_device, vFpu) GO(snd_ctl_elem_id_set_subdevice, vFpu) GO(snd_ctl_elem_id_set_name, vFpp) GO(snd_ctl_elem_id_set_index, vFpu) -GO(snd_ctl_card_info_sizeof, uFv) +GO(snd_ctl_card_info_sizeof, LFv) GO(snd_ctl_card_info_malloc, iFp) GO(snd_ctl_card_info_free, vFp) GO(snd_ctl_card_info_clear, vFp) @@ -749,13 +752,13 @@ GO(snd_ctl_card_info_get_name, pFp) GO(snd_ctl_card_info_get_longname, pFp) GO(snd_ctl_card_info_get_mixername, pFp) GO(snd_ctl_card_info_get_components, pFp) -GO(snd_ctl_event_sizeof, uFv) +GO(snd_ctl_event_sizeof, LFv) GO(snd_ctl_event_malloc, iFp) GO(snd_ctl_event_free, vFp) GO(snd_ctl_event_clear, vFp) GO(snd_ctl_event_copy, vFpp) -GO(snd_ctl_event_get_type, iFp) -GO(snd_ctl_elem_list_sizeof, uFv) +GO(snd_ctl_event_get_type, uFp) +GO(snd_ctl_elem_list_sizeof, LFv) GO(snd_ctl_elem_list_malloc, iFp) GO(snd_ctl_elem_list_free, vFp) GO(snd_ctl_elem_list_clear, vFp) @@ -765,17 +768,17 @@ GO(snd_ctl_elem_list_get_used, uFp) GO(snd_ctl_elem_list_get_count, uFp) GO(snd_ctl_elem_list_get_id, vFpup) GO(snd_ctl_elem_list_get_numid, uFpu) -GO(snd_ctl_elem_list_get_interface, iFpu) +GO(snd_ctl_elem_list_get_interface, uFpu) GO(snd_ctl_elem_list_get_device, uFpu) GO(snd_ctl_elem_list_get_subdevice, uFpu) GO(snd_ctl_elem_list_get_name, pFpu) GO(snd_ctl_elem_list_get_index, uFpu) -GO(snd_ctl_elem_info_sizeof, uFv) +GO(snd_ctl_elem_info_sizeof, LFv) GO(snd_ctl_elem_info_malloc, iFp) GO(snd_ctl_elem_info_free, vFp) GO(snd_ctl_elem_info_clear, vFp) GO(snd_ctl_elem_info_copy, vFpp) -GO(snd_ctl_elem_info_get_type, iFp) +GO(snd_ctl_elem_info_get_type, uFp) GO(snd_ctl_elem_info_is_readable, iFp) GO(snd_ctl_elem_info_is_writable, iFp) GO(snd_ctl_elem_info_is_volatile, iFp) @@ -788,9 +791,9 @@ GO(snd_ctl_elem_info_is_owner, iFp) GO(snd_ctl_elem_info_is_user, iFp) GO(snd_ctl_elem_info_get_owner, iFp) GO(snd_ctl_elem_info_get_count, uFp) -GO(snd_ctl_elem_info_get_min, iFp) -GO(snd_ctl_elem_info_get_max, iFp) -GO(snd_ctl_elem_info_get_step, iFp) +GO(snd_ctl_elem_info_get_min, lFp) +GO(snd_ctl_elem_info_get_max, lFp) +GO(snd_ctl_elem_info_get_step, lFp) GO(snd_ctl_elem_info_get_min64, IFp) GO(snd_ctl_elem_info_get_max64, IFp) GO(snd_ctl_elem_info_get_step64, IFp) @@ -801,53 +804,53 @@ GO(snd_ctl_elem_info_get_dimensions, iFp) GO(snd_ctl_elem_info_get_dimension, iFpu) GO(snd_ctl_elem_info_get_id, vFpp) GO(snd_ctl_elem_info_get_numid, uFp) -GO(snd_ctl_elem_info_get_interface, iFp) +GO(snd_ctl_elem_info_get_interface, uFp) GO(snd_ctl_elem_info_get_device, uFp) GO(snd_ctl_elem_info_get_subdevice, uFp) GO(snd_ctl_elem_info_get_name, pFp) GO(snd_ctl_elem_info_get_index, uFp) GO(snd_ctl_elem_info_set_id, vFpp) GO(snd_ctl_elem_info_set_numid, vFpu) -GO(snd_ctl_elem_info_set_interface, vFpi) +GO(snd_ctl_elem_info_set_interface, vFpu) GO(snd_ctl_elem_info_set_device, vFpu) GO(snd_ctl_elem_info_set_subdevice, vFpu) GO(snd_ctl_elem_info_set_name, vFpp) GO(snd_ctl_elem_info_set_index, vFpu) -GO(snd_ctl_elem_add_integer, iFppuiii) +GO(snd_ctl_elem_add_integer, iFppulll) GO(snd_ctl_elem_add_integer64, iFppuIII) GO(snd_ctl_elem_add_boolean, iFppu) GO(snd_ctl_elem_add_iec958, iFpp) GO(snd_ctl_elem_remove, iFpp) -GO(snd_ctl_elem_value_sizeof, uFv) +GO(snd_ctl_elem_value_sizeof, LFv) GO(snd_ctl_elem_value_malloc, iFp) GO(snd_ctl_elem_value_free, vFp) GO(snd_ctl_elem_value_clear, vFp) GO(snd_ctl_elem_value_copy, vFpp) GO(snd_ctl_elem_value_get_id, vFpp) GO(snd_ctl_elem_value_get_numid, uFp) -GO(snd_ctl_elem_value_get_interface, iFp) +GO(snd_ctl_elem_value_get_interface, uFp) GO(snd_ctl_elem_value_get_device, uFp) GO(snd_ctl_elem_value_get_subdevice, uFp) GO(snd_ctl_elem_value_get_name, pFp) GO(snd_ctl_elem_value_get_index, uFp) GO(snd_ctl_elem_value_set_id, vFpp) GO(snd_ctl_elem_value_set_numid, vFpu) -GO(snd_ctl_elem_value_set_interface, vFpi) +GO(snd_ctl_elem_value_set_interface, vFpu) GO(snd_ctl_elem_value_set_device, vFpu) GO(snd_ctl_elem_value_set_subdevice, vFpu) GO(snd_ctl_elem_value_set_name, vFpp) GO(snd_ctl_elem_value_set_index, vFpu) GO(snd_ctl_elem_value_get_boolean, iFpu) -GO(snd_ctl_elem_value_get_integer, iFpu) +GO(snd_ctl_elem_value_get_integer, lFpu) GO(snd_ctl_elem_value_get_integer64, IFpu) GO(snd_ctl_elem_value_get_enumerated, uFpu) GO(snd_ctl_elem_value_get_byte, CFpu) -GO(snd_ctl_elem_value_set_boolean, vFpui) -GO(snd_ctl_elem_value_set_integer, vFpui) +GO(snd_ctl_elem_value_set_boolean, vFpul) +GO(snd_ctl_elem_value_set_integer, vFpul) GO(snd_ctl_elem_value_set_integer64, vFpuI) GO(snd_ctl_elem_value_set_enumerated, vFpuu) -GO(snd_ctl_elem_value_set_byte, vFpuu) -GO(snd_ctl_elem_set_bytes, vFppu) +GO(snd_ctl_elem_value_set_byte, vFpuC) +GO(snd_ctl_elem_set_bytes, vFppL) GO(snd_ctl_elem_value_get_bytes, pFp) GO(snd_ctl_elem_value_get_iec958, vFpp) GO(snd_ctl_elem_value_set_iec958, vFpp) @@ -860,16 +863,16 @@ GO(snd_hctl_poll_descriptors_count, iFp) GO(snd_hctl_poll_descriptors, iFppu) GO(snd_hctl_poll_descriptors_revents, iFppup) GO(snd_hctl_get_count, uFp) -GO(snd_hctl_set_compare, iFpp) +//GOM(snd_hctl_set_compare, iFEpp) GO(snd_hctl_first_elem, pFp) GO(snd_hctl_last_elem, pFp) GO(snd_hctl_find_elem, pFpp) -//GO(snd_hctl_set_callback, vFpP) -//GO(snd_hctl_set_callback_private, vFpp) -//GO(snd_hctl_get_callback_private, pFp) +//GOM(snd_hctl_set_callback, vFEpp) +GO(snd_hctl_set_callback_private, vFpp) +GO(snd_hctl_get_callback_private, pFp) GO(snd_hctl_load, iFp) GO(snd_hctl_free, iFp) -//GO(snd_hctl_handle_events, iFp) +GO(snd_hctl_handle_events, iFp) GO(snd_hctl_name, pFp) GO(snd_hctl_wait, iFpi) GO(snd_hctl_ctl, pFp) @@ -884,14 +887,14 @@ GO(snd_hctl_elem_tlv_command, iFpp) GO(snd_hctl_elem_get_hctl, pFp) GO(snd_hctl_elem_get_id, vFpp) GO(snd_hctl_elem_get_numid, uFp) -GO(snd_hctl_elem_get_interface, iFp) +GO(snd_hctl_elem_get_interface, uFp) GO(snd_hctl_elem_get_device, uFp) GO(snd_hctl_elem_get_subdevice, uFp) GO(snd_hctl_elem_get_name, pFp) GO(snd_hctl_elem_get_index, uFp) -//GO(snd_hctl_elem_set_callback, vFpP) -//GO(snd_hctl_elem_get_callback_private, pFp) -//GO(snd_hctl_elem_set_callback_private, vFpp) +//GOM(snd_hctl_elem_set_callback, vFEpp) +GO(snd_hctl_elem_get_callback_private, pFp) +GO(snd_hctl_elem_set_callback_private, vFpp) GO(snd_sctl_build, iFppppi) GO(snd_sctl_free, iFp) GO(snd_sctl_install, iFp) @@ -912,10 +915,10 @@ GO(snd_mixer_poll_descriptors_revents, iFppup) GO(snd_mixer_load, iFp) GO(snd_mixer_free, vFp) GO(snd_mixer_wait, iFpi) -GO(snd_mixer_set_compare, iFpp) -//GO(snd_mixer_set_callback, vFpP) -//GO(snd_mixer_get_callback_private, pFp) -//GO(snd_mixer_set_callback_private, vFpp) +GOM(snd_mixer_set_compare, iFEpp) +//GOM(snd_mixer_set_callback, vFEpp) +GO(snd_mixer_get_callback_private, pFp) +GO(snd_mixer_set_callback_private, vFpp) GO(snd_mixer_get_count, uFp) GO(snd_mixer_class_unregister, iFp) GO(snd_mixer_elem_next, pFp) @@ -923,11 +926,11 @@ GO(snd_mixer_elem_prev, pFp) GOM(snd_mixer_elem_set_callback, vFEpp) GO(snd_mixer_elem_get_callback_private, pFp) GO(snd_mixer_elem_set_callback_private, vFpp) -GO(snd_mixer_elem_get_type, iFp) -//GO(snd_mixer_class_register, iFpp) +GO(snd_mixer_elem_get_type, uFp) +GO(snd_mixer_class_register, iFpp) GO(snd_mixer_add_elem, iFpp) GO(snd_mixer_remove_elem, iFpp) -GO(snd_mixer_elem_new, iFpiipp) +GOM(snd_mixer_elem_new, iFEpuipp) GO(snd_mixer_elem_add, iFpp) GO(snd_mixer_elem_remove, iFp) GO(snd_mixer_elem_free, vFp) @@ -937,18 +940,18 @@ GO(snd_mixer_elem_attach, iFpp) GO(snd_mixer_elem_detach, iFpp) GO(snd_mixer_elem_empty, iFp) GO(snd_mixer_elem_get_private, pFp) -GO(snd_mixer_class_sizeof, uFv) +GO(snd_mixer_class_sizeof, LFv) GO(snd_mixer_class_malloc, iFp) GO(snd_mixer_class_free, vFp) GO(snd_mixer_class_copy, vFpp) GO(snd_mixer_class_get_mixer, pFp) -GO(snd_mixer_class_get_event, pFp) +GOM(snd_mixer_class_get_event, pFEp) GO(snd_mixer_class_get_private, pFp) -GO(snd_mixer_class_get_compare, pFp) -GO(snd_mixer_class_set_event, iFpp) +GOM(snd_mixer_class_get_compare, pFEp) +GOM(snd_mixer_class_set_event, iFEpp) GO(snd_mixer_class_set_private, iFpp) -GO(snd_mixer_class_set_private_free, iFpp) -GO(snd_mixer_class_set_compare, iFpp) +GOM(snd_mixer_class_set_private_free, iFEpp) +GOM(snd_mixer_class_set_compare, iFEpp) GO(snd_mixer_selem_channel_name, pFi) GO(snd_mixer_selem_register, iFppp) GO(snd_mixer_selem_get_id, vFpp) @@ -980,32 +983,32 @@ GO(snd_mixer_selem_get_playback_dB, iFpip) GO(snd_mixer_selem_get_capture_dB, iFpip) GO(snd_mixer_selem_get_playback_switch, iFpip) GO(snd_mixer_selem_get_capture_switch, iFpip) -GO(snd_mixer_selem_set_playback_volume, iFpii) -GO(snd_mixer_selem_set_capture_volume, iFpii) -GO(snd_mixer_selem_set_playback_dB, iFpiii) -GO(snd_mixer_selem_set_capture_dB, iFpiii) -GO(snd_mixer_selem_set_playback_volume_all, iFpi) -GO(snd_mixer_selem_set_capture_volume_all, iFpi) -GO(snd_mixer_selem_set_playback_dB_all, iFpii) -GO(snd_mixer_selem_set_capture_dB_all, iFpii) +GO(snd_mixer_selem_set_playback_volume, iFpil) +GO(snd_mixer_selem_set_capture_volume, iFpil) +GO(snd_mixer_selem_set_playback_dB, iFpili) +GO(snd_mixer_selem_set_capture_dB, iFpili) +GO(snd_mixer_selem_set_playback_volume_all, iFpl) +GO(snd_mixer_selem_set_capture_volume_all, iFpl) +GO(snd_mixer_selem_set_playback_dB_all, iFpli) +GO(snd_mixer_selem_set_capture_dB_all, iFpli) GO(snd_mixer_selem_set_playback_switch, iFpii) GO(snd_mixer_selem_set_capture_switch, iFpii) GO(snd_mixer_selem_set_playback_switch_all, iFpi) GO(snd_mixer_selem_set_capture_switch_all, iFpi) GO(snd_mixer_selem_get_playback_volume_range, iFppp) GO(snd_mixer_selem_get_playback_dB_range, iFppp) -GO(snd_mixer_selem_set_playback_volume_range, iFpii) +GO(snd_mixer_selem_set_playback_volume_range, iFpll) GO(snd_mixer_selem_get_capture_volume_range, iFppp) GO(snd_mixer_selem_get_capture_dB_range, iFppp) -GO(snd_mixer_selem_set_capture_volume_range, iFpii) +GO(snd_mixer_selem_set_capture_volume_range, iFpll) GO(snd_mixer_selem_is_enumerated, iFp) GO(snd_mixer_selem_is_enum_playback, iFp) GO(snd_mixer_selem_is_enum_capture, iFp) GO(snd_mixer_selem_get_enum_items, iFp) -GO(snd_mixer_selem_get_enum_item_name, iFpuup) +GO(snd_mixer_selem_get_enum_item_name, iFpuLp) GO(snd_mixer_selem_get_enum_item, iFpip) GO(snd_mixer_selem_set_enum_item, iFpiu) -GO(snd_mixer_selem_id_sizeof, uFv) +GO(snd_mixer_selem_id_sizeof, LFv) GO(snd_mixer_selem_id_malloc, iFp) GO(snd_mixer_selem_id_free, vFp) GO(snd_mixer_selem_id_copy, vFpp) @@ -1016,18 +1019,18 @@ GO(snd_mixer_selem_id_set_index, vFpu) GO(snd_seq_open, iFppii) GO(snd_seq_open_lconf, iFppiip) GO(snd_seq_name, pFp) -GO(snd_seq_type, iFp) +GO(snd_seq_type, uFp) GO(snd_seq_close, iFp) GO(snd_seq_poll_descriptors_count, iFpw) GO(snd_seq_poll_descriptors, iFppuw) GO(snd_seq_poll_descriptors_revents, iFppup) GO(snd_seq_nonblock, iFpi) GO(snd_seq_client_id, iFp) -GO(snd_seq_get_output_buffer_size, uFp) -GO(snd_seq_get_input_buffer_size, uFp) -GO(snd_seq_set_output_buffer_size, iFpu) -GO(snd_seq_set_input_buffer_size, iFpu) -GO(snd_seq_system_info_sizeof, uFv) +GO(snd_seq_get_output_buffer_size, LFp) +GO(snd_seq_get_input_buffer_size, LFp) +GO(snd_seq_set_output_buffer_size, iFpL) +GO(snd_seq_set_input_buffer_size, iFpL) +GO(snd_seq_system_info_sizeof, LFv) GO(snd_seq_system_info_malloc, iFp) GO(snd_seq_system_info_free, vFp) GO(snd_seq_system_info_copy, vFpp) @@ -1038,12 +1041,12 @@ GO(snd_seq_system_info_get_channels, iFp) GO(snd_seq_system_info_get_cur_clients, iFp) GO(snd_seq_system_info_get_cur_queues, iFp) GO(snd_seq_system_info, iFpp) -GO(snd_seq_client_info_sizeof, uFv) +GO(snd_seq_client_info_sizeof, LFv) GO(snd_seq_client_info_malloc, iFp) GO(snd_seq_client_info_free, vFp) GO(snd_seq_client_info_copy, vFpp) GO(snd_seq_client_info_get_client, iFp) -GO(snd_seq_client_info_get_type, iFp) +GO(snd_seq_client_info_get_type, uFp) GO(snd_seq_client_info_get_name, pFp) GO(snd_seq_client_info_get_broadcast_filter, iFp) GO(snd_seq_client_info_get_error_bounce, iFp) @@ -1059,22 +1062,22 @@ GO(snd_seq_get_client_info, iFpp) GO(snd_seq_get_any_client_info, iFpip) GO(snd_seq_set_client_info, iFpp) GO(snd_seq_query_next_client, iFpp) -GO(snd_seq_client_pool_sizeof, uFv) +GO(snd_seq_client_pool_sizeof, LFv) GO(snd_seq_client_pool_malloc, iFp) GO(snd_seq_client_pool_free, vFp) GO(snd_seq_client_pool_copy, vFpp) GO(snd_seq_client_pool_get_client, iFp) -GO(snd_seq_client_pool_get_output_pool, uFp) -GO(snd_seq_client_pool_get_input_pool, uFp) -GO(snd_seq_client_pool_get_output_room, uFp) -GO(snd_seq_client_pool_get_output_free, uFp) -GO(snd_seq_client_pool_get_input_free, uFp) -GO(snd_seq_client_pool_set_output_pool, vFpu) -GO(snd_seq_client_pool_set_input_pool, vFpu) -GO(snd_seq_client_pool_set_output_room, vFpu) +GO(snd_seq_client_pool_get_output_pool, LFp) +GO(snd_seq_client_pool_get_input_pool, LFp) +GO(snd_seq_client_pool_get_output_room, LFp) +GO(snd_seq_client_pool_get_output_free, LFp) +GO(snd_seq_client_pool_get_input_free, LFp) +GO(snd_seq_client_pool_set_output_pool, vFpL) +GO(snd_seq_client_pool_set_input_pool, vFpL) +GO(snd_seq_client_pool_set_output_room, vFpL) GO(snd_seq_get_client_pool, iFpp) GO(snd_seq_set_client_pool, iFpp) -GO(snd_seq_port_info_sizeof, uFv) +GO(snd_seq_port_info_sizeof, LFv) GO(snd_seq_port_info_malloc, iFp) GO(snd_seq_port_info_free, vFp) GO(snd_seq_port_info_copy, vFpp) @@ -1112,7 +1115,7 @@ GO(snd_seq_get_port_info, iFpip) GO(snd_seq_get_any_port_info, iFpiip) GO(snd_seq_set_port_info, iFpip) GO(snd_seq_query_next_port, iFpp) -GO(snd_seq_port_subscribe_sizeof, uFv) +GO(snd_seq_port_subscribe_sizeof, LFv) GO(snd_seq_port_subscribe_malloc, iFp) GO(snd_seq_port_subscribe_free, vFp) GO(snd_seq_port_subscribe_copy, vFpp) @@ -1131,14 +1134,14 @@ GO(snd_seq_port_subscribe_set_time_real, vFpi) GO(snd_seq_get_port_subscription, iFpp) GO(snd_seq_subscribe_port, iFpp) GO(snd_seq_unsubscribe_port, iFpp) -GO(snd_seq_query_subscribe_sizeof, uFv) +GO(snd_seq_query_subscribe_sizeof, LFv) GO(snd_seq_query_subscribe_malloc, iFp) GO(snd_seq_query_subscribe_free, vFp) GO(snd_seq_query_subscribe_copy, vFpp) GO(snd_seq_query_subscribe_get_client, iFp) GO(snd_seq_query_subscribe_get_port, iFp) GO(snd_seq_query_subscribe_get_root, pFp) -GO(snd_seq_query_subscribe_get_type, iFp) +GO(snd_seq_query_subscribe_get_type, uFp) GO(snd_seq_query_subscribe_get_index, iFp) GO(snd_seq_query_subscribe_get_num_subs, iFp) GO(snd_seq_query_subscribe_get_addr, pFp) @@ -1149,10 +1152,10 @@ GO(snd_seq_query_subscribe_get_time_real, iFp) GO(snd_seq_query_subscribe_set_client, vFpi) GO(snd_seq_query_subscribe_set_port, vFpi) GO(snd_seq_query_subscribe_set_root, vFpp) -GO(snd_seq_query_subscribe_set_type, vFpi) +GO(snd_seq_query_subscribe_set_type, vFpu) GO(snd_seq_query_subscribe_set_index, vFpi) GO(snd_seq_query_port_subscribers, iFpp) -GO(snd_seq_queue_info_sizeof, uFv) +GO(snd_seq_queue_info_sizeof, LFv) GO(snd_seq_queue_info_malloc, iFp) GO(snd_seq_queue_info_free, vFp) GO(snd_seq_queue_info_copy, vFpp) @@ -1174,7 +1177,7 @@ GO(snd_seq_set_queue_info, iFpip) GO(snd_seq_query_named_queue, iFpp) GO(snd_seq_get_queue_usage, iFpi) GO(snd_seq_set_queue_usage, iFpii) -GO(snd_seq_queue_status_sizeof, uFv) +GO(snd_seq_queue_status_sizeof, LFv) GO(snd_seq_queue_status_malloc, iFp) GO(snd_seq_queue_status_free, vFp) GO(snd_seq_queue_status_copy, vFpp) @@ -1184,7 +1187,7 @@ GO(snd_seq_queue_status_get_tick_time, uFp) GO(snd_seq_queue_status_get_real_time, pFp) GO(snd_seq_queue_status_get_status, uFp) GO(snd_seq_get_queue_status, iFpip) -GO(snd_seq_queue_tempo_sizeof, uFv) +GO(snd_seq_queue_tempo_sizeof, LFv) GO(snd_seq_queue_tempo_malloc, iFp) GO(snd_seq_queue_tempo_free, vFp) GO(snd_seq_queue_tempo_copy, vFpp) @@ -1199,21 +1202,21 @@ GO(snd_seq_queue_tempo_set_skew, vFpu) GO(snd_seq_queue_tempo_set_skew_base, vFpu) GO(snd_seq_get_queue_tempo, iFpip) GO(snd_seq_set_queue_tempo, iFpip) -GO(snd_seq_queue_timer_sizeof, uFv) +GO(snd_seq_queue_timer_sizeof, LFv) GO(snd_seq_queue_timer_malloc, iFp) GO(snd_seq_queue_timer_free, vFp) GO(snd_seq_queue_timer_copy, vFpp) GO(snd_seq_queue_timer_get_queue, iFp) -GO(snd_seq_queue_timer_get_type, iFp) +GO(snd_seq_queue_timer_get_type, uFp) GO(snd_seq_queue_timer_get_id, pFp) GO(snd_seq_queue_timer_get_resolution, uFp) -GO(snd_seq_queue_timer_set_type, vFpi) +GO(snd_seq_queue_timer_set_type, vFpu) GO(snd_seq_queue_timer_set_id, vFpp) GO(snd_seq_queue_timer_set_resolution, vFpu) GO(snd_seq_get_queue_timer, iFpip) GO(snd_seq_set_queue_timer, iFpip) GO(snd_seq_free_event, iFp) -GO(snd_seq_event_length, uFp) +GO(snd_seq_event_length, lFp) GO(snd_seq_event_output, iFpp) GO(snd_seq_event_output_buffer, iFpp) GO(snd_seq_event_output_direct, iFpp) @@ -1226,7 +1229,7 @@ GO(snd_seq_drop_output, iFp) GO(snd_seq_drop_output_buffer, iFp) GO(snd_seq_drop_input, iFp) GO(snd_seq_drop_input_buffer, iFp) -GO(snd_seq_remove_events_sizeof, uFv) +GO(snd_seq_remove_events_sizeof, LFv) GO(snd_seq_remove_events_malloc, iFp) GO(snd_seq_remove_events_free, vFp) GO(snd_seq_remove_events_copy, vFpp) @@ -1248,16 +1251,16 @@ GO(snd_seq_remove_events, iFpp) GO(snd_seq_set_bit, vFip) GO(snd_seq_change_bit, iFip) GO(snd_seq_get_bit, iFip) -GO(snd_midi_event_new, iFup) -GO(snd_midi_event_resize_buffer, iFpu) +GO(snd_midi_event_new, iFLp) +GO(snd_midi_event_resize_buffer, iFpL) GO(snd_midi_event_free, vFp) GO(snd_midi_event_init, vFp) GO(snd_midi_event_reset_encode, vFp) GO(snd_midi_event_reset_decode, vFp) GO(snd_midi_event_no_status, vFpi) -GO(snd_midi_event_encode, iFppip) +GO(snd_midi_event_encode, lFpplp) GO(snd_midi_event_encode_byte, iFpip) -GO(snd_midi_event_decode, iFppip) +GO(snd_midi_event_decode, lFpplp) GO(snd_seq_control_queue, iFpiiip) GO(snd_seq_create_simple_port, iFppuu) GO(snd_seq_delete_simple_port, iFpi) @@ -1267,13 +1270,13 @@ GO(snd_seq_disconnect_from, iFpiii) GO(snd_seq_disconnect_to, iFpiii) GO(snd_seq_set_client_name, iFpp) GO(snd_seq_set_client_event_filter, iFpi) -GO(snd_seq_set_client_pool_output_room, iFpu) -GO(snd_seq_set_client_pool_input, iFpu) +GO(snd_seq_set_client_pool_output_room, iFpL) +GO(snd_seq_set_client_pool_input, iFpL) GO(snd_seq_reset_pool_output, iFp) GO(snd_seq_reset_pool_input, iFp) GO(snd_seq_sync_output_queue, iFp) GO(snd_seq_parse_address, iFppp) -GO(snd_hwdep_info_get_iface, iFp) -DATAM(snd_lib_error, 4) -GO(superdummy_error_handler, vFpipipV) // dummy to have the bridge definition \ No newline at end of file +GO(snd_hwdep_info_get_iface, uFp) +DATAM(snd_lib_error, 8) +GO(superdummy_error_handler, vFpipipV) diff --git a/src/wrapped/wrappedlibavcodec58.c b/src/wrapped/wrappedlibavcodec58.c new file mode 100644 index 0000000..5b82b4f --- /dev/null +++ b/src/wrapped/wrappedlibavcodec58.c @@ -0,0 +1,50 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* libavcodec58Name = "libavcodec.so.58"; + +#define LIBNAME libavcodec58 + +//#define ADDED_FUNCTIONS() \ + +//#include "generated/wrappedlibcupstypes.h" + +//#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// will allow wrapped lib if and only if libavutil.so.56 && libavformat.so.58 are also available! +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; \ + { \ + void* h = dlopen("libavutil.so.56", RTLD_LAZY | RTLD_GLOBAL); \ + if(!h) return -2; \ + else dlclose(h); \ + h = dlopen("libavformat.so.58", RTLD_LAZY | RTLD_GLOBAL); \ + if(!h) return -2; \ + else dlclose(h); \ + } + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibavcodec58_private.h b/src/wrapped/wrappedlibavcodec58_private.h new file mode 100644 index 0000000..cb50cb8 --- /dev/null +++ b/src/wrapped/wrappedlibavcodec58_private.h @@ -0,0 +1,187 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(av_ac3_parse_header, iFpLpp) +GO(av_adts_header_parse, iFppp) +//GOM(av_alloc_vdpaucontext, pFEv) +GO(av_bitstream_filter_filter, iFppppppii) +GO(av_bsf_alloc, iFpp) // AVBSFContext* contains AVClass* which might needs wrapping +GO(av_bsf_flush, vFp) // AVBSFContext* contains AVClass* which might needs wrapping +GO(av_bsf_free, vFp) // AVBSFContext* contains AVClass* which might needs wrapping +GO(av_bsf_get_by_name, pFp) // AVBSFContext* contains AVClass* which might needs wrapping +//GOM(av_bsf_get_class, pFEv) +GO(av_bsf_get_null_filter, iFp) // AVBSFContext* contains AVClass* which might needs wrapping +GO(av_bsf_init, iFp) // AVBSFContext* contains AVClass* which might needs wrapping +//GOM(av_bsf_iterate, pFEp) +GO(av_bsf_list_alloc, pFv) +//GOM(av_bsf_list_append, iFEpp) +GO(av_bsf_list_append2, iFppp) +//GOM(av_bsf_list_finalize, iFEpp) +GO(av_bsf_list_free, vFp) +//GOM(av_bsf_list_parse_str, iFEpp) +GO(av_bsf_receive_packet, iFpp) // AVBSFContext* contains AVClass* which might needs wrapping +GO(av_bsf_send_packet, iFpp) // AVBSFContext* contains AVClass* which might needs wrapping +//GOM(avcodec_align_dimensions, vFEppp) +GO(avcodec_align_dimensions2, vFpppp) +GO(avcodec_alloc_context3, pFp) +GO(avcodec_chroma_pos_to_enum, iFii) +GO(avcodec_close, iFp) +GO(avcodec_configuration, pFv) +//GOM(avcodec_dct_alloc, pFEv) +//GOM(avcodec_dct_get_class, pFEv) +//GOM(avcodec_dct_init, iFEp) +GO(avcodec_decode_subtitle2, iFpppp) // AVCodecContext *, AVSubtitle *, AVPacket * +//GOM(avcodec_default_execute, iFEppppii) +//GOM(avcodec_default_execute2, iFEppppi) +GO(avcodec_default_get_buffer2, iFppi) +//GOM(avcodec_default_get_encode_buffer, iFEppi) +//GOM(avcodec_default_get_format, iFEpp) +GO(avcodec_descriptor_get, pFu) +GO(avcodec_descriptor_get_by_name, pFp) +GO(avcodec_descriptor_next, pFp) +//GOM(avcodec_encode_subtitle, iFEppip) +GO(avcodec_enum_to_chroma_pos, iFppi) +DATA(av_codec_ffversion, 8) // Warning: failed to confirm +GO(avcodec_fill_audio_frame, iFpiipii) +GO(avcodec_find_best_pix_fmt_of_list, iFpiip) +GO(avcodec_find_decoder, pFu) +GO(avcodec_find_decoder_by_name, pFp) +GO(avcodec_find_encoder, pFu) +GO(avcodec_find_encoder_by_name, pFp) +GO(avcodec_flush_buffers, vFp) +GO(avcodec_free_context, vFp) +//GOM(avcodec_get_class, pFEv) +//GOM(avcodec_get_hw_config, pFEpi) +//GOM(avcodec_get_hw_frames_parameters, iFEppip) +GO(avcodec_get_name, pFu) +//GOM(avcodec_get_subtitle_rect_class, pFEv) +//GOM(avcodec_get_supported_config, iFEppuupp) +GO(avcodec_get_type, iFu) +GO(av_codec_is_decoder, iFp) +GO(av_codec_is_encoder, iFp) +GO(avcodec_is_open, iFp) +GO(av_codec_iterate, pFp) +GO(avcodec_license, pFv) +GO(avcodec_open2, iFppp) +GO(avcodec_parameters_alloc, pFv) +GO(avcodec_parameters_copy, iFpp) +GO(avcodec_parameters_free, vFp) +GO(avcodec_parameters_from_context, iFpp) +GO(avcodec_parameters_to_context, iFpp) +GO(avcodec_pix_fmt_to_codec_tag, uFi) +GO(avcodec_profile_name, pFui) +GO(avcodec_receive_frame, iFpp) +GO(avcodec_receive_packet, iFpp) +GO(avcodec_send_frame, iFpp) +GO(avcodec_send_packet, iFpp) +GO(avcodec_string, vFpipi) //3rd param is an AVCodecContext* +GO(avcodec_version, uFv) +GO(av_cpb_properties_alloc, pFp) +//GO(av_d3d11va_alloc_context, +GO(av_dct_calc, vFpp) +GO(av_dct_end, vFp) +GO(av_dct_init, pFiu) +GO(av_dirac_parse_sequence_header, iFppLp) +GO(av_dv_codec_profile, pFiii) +//GO(av_dv_codec_profile2, +GO(av_dv_frame_profile, pFppu) +GO(av_fast_padded_malloc, vFppL) +GO(av_fast_padded_mallocz, vFppL) +GO(av_fft_calc, vFpp) +GO(av_fft_end, vFp) +GO(av_fft_init, pFii) +GO(av_fft_permute, vFpp) +GO(av_get_audio_frame_duration, iFpi) +GO(av_get_audio_frame_duration2, iFpi) +GO(av_get_bits_per_sample, iFu) +GO(av_get_exact_bits_per_sample, iFu) +GO(av_get_pcm_codec, uFii) +//GOM(av_get_profile_name, pFEpi) +GO(av_grow_packet, iFpi) +GO(av_imdct_calc, vFppp) +GO(av_imdct_half, vFppp) +GO(av_init_packet, vFp) +GO(av_jni_get_java_vm, pFp) +GO(av_jni_set_java_vm, iFpp) +GO(av_mdct_calc, vFppp) +GO(av_mdct_end, vFp) +GO(av_mdct_init, pFiid) +GO(av_mediacodec_alloc_context, pFv) +//GOM(av_mediacodec_default_free, vFEp) +//GOM(av_mediacodec_default_init, iFEppp) +GO(av_mediacodec_release_buffer, iFpi) +GO(av_mediacodec_render_buffer_at_time, iFpI) +GO(av_new_packet, iFpi) +GO(av_packet_add_side_data, iFpupL) +GO(av_packet_alloc, pFv) +GO(av_packet_clone, pFp) +GO(av_packet_copy_props, iFpp) +GO(av_packet_free, vFp) +GO(av_packet_free_side_data, vFp) +GO(av_packet_from_data, iFppi) +GO(av_packet_get_side_data, pFpup) +GO(av_packet_make_refcounted, iFp) +GO(av_packet_make_writable, iFp) +GO(av_packet_move_ref, vFpp) +GO(av_packet_new_side_data, pFpuL) +GO(av_packet_pack_dictionary, pFpp) +GO(av_packet_ref, iFpp) +GO(av_packet_rescale_ts, vFpUU) +GO(av_packet_shrink_side_data, iFpuL) +GO(av_packet_side_data_add, pFppupLi) +GO(av_packet_side_data_free, vFpp) +GO(av_packet_side_data_get, pFpiu) +GO(av_packet_side_data_name, pFu) +GO(av_packet_side_data_new, pFppuLi) +GO(av_packet_side_data_remove, vFppu) +GO(av_packet_unpack_dictionary, iFpLp) +GO(av_packet_unref, vFp) +GO(av_parser_close, vFp) +GO(av_parser_init, pFi) +//GOM(av_parser_iterate, pFEp) +GO(av_parser_parse2, iFpppppiIII) +DATA(avpriv_ac3_channel_layout_tab, sizeof(void*)) +//GO(avpriv_ac3_parse_header, +//GO(avpriv_adts_header_parse, +GO(avpriv_codec_get_cap_skip_frame_fill_param, iFp) +//GO(avpriv_dca_convert_bitstream, +//GO(avpriv_dca_parse_core_frame_header, +//GO(avpriv_elbg_do, +//GO(avpriv_elbg_free, +//GO(avpriv_exif_decode_ifd, +GO(avpriv_find_pix_fmt, iFpu) +GO(avpriv_find_start_code, pFppp) +//GO(avpriv_fits_header_init, +//GO(avpriv_fits_header_parse_line, +GO(avpriv_get_raw_pix_fmt_tags, pFv) +GO(avpriv_h264_has_num_reorder_frames, iFp) +DATA(avpriv_mpa_freq_tab, sizeof(void*)) +GO(avpriv_mpeg4audio_get_config2, iFppiip) +GO(avpriv_mpegaudio_decode_header, iFpu) +DATA(avpriv_mpeg4audio_sample_rates, sizeof(void*)) +//GO(avpriv_packet_list_free, +//GO(avpriv_packet_list_get, +//GO(avpriv_packet_list_put, +//GO(avpriv_pix_fmt_find, +DATA(avpriv_pix_fmt_bps_mov, sizeof(void*)) +GO(avpriv_split_xiph_headers, iFpiipp) +//GO(avpriv_tak_parse_streaminfo, +GO(avpriv_toupper4, uFu) +//GO(av_qsv_alloc_context, +GO(av_rdft_calc, vFpp) +GO(av_rdft_end, vFp) +GO(av_rdft_init, pFiu) +GO(av_shrink_packet, vFpi) +GO(avsubtitle_free, vFp) +//GOM(av_vdpau_alloc_context, pFEv) +//GOM(av_vdpau_bind_context, iFEpupu) +//GOM(av_vdpau_get_surface_parameters, iFEpppp) +//GOM(av_vdpau_hwaccel_get_render2, pFEp) +//GOM(av_vdpau_hwaccel_set_render2, vFEpp) +GO(av_vorbis_parse_frame, iFppi) +GO(av_vorbis_parse_frame_flags, iFppip) +GO(av_vorbis_parse_free, vFp) +GO(av_vorbis_parse_init, pFpi) +GO(av_vorbis_parse_reset, vFp) +GO(av_xiphlacing, uFpu) diff --git a/src/wrapped/wrappedlibavformat58.c b/src/wrapped/wrappedlibavformat58.c new file mode 100644 index 0000000..2548b03 --- /dev/null +++ b/src/wrapped/wrappedlibavformat58.c @@ -0,0 +1,125 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* libavformat58Name = "libavformat.so.58"; + +#define LIBNAME libavformat58 + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedlibavformat58types.h" + +#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// read_packet ... +#define GO(A) \ +static uintptr_t my_read_packet_fct_##A = 0; \ +static int my_read_packet_##A(void* a, void* b, int c) \ +{ \ + return (int)RunFunctionFmt(my_read_packet_fct_##A, "ppi", a, b, c); \ +} +SUPER() +#undef GO +static void* find_read_packet_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_read_packet_fct_##A == (uintptr_t)fct) return my_read_packet_##A; + SUPER() + #undef GO + #define GO(A) if(my_read_packet_fct_##A == 0) {my_read_packet_fct_##A = (uintptr_t)fct; return my_read_packet_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavformat58 read_packet callback\n"); + return NULL; +} +// write_packet ... +#define GO(A) \ +static uintptr_t my_write_packet_fct_##A = 0; \ +static int my_write_packet_##A(void* a, void* b, int c) \ +{ \ + return (int)RunFunctionFmt(my_write_packet_fct_##A, "ppi", a, b, c); \ +} +SUPER() +#undef GO +static void* find_write_packet_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_write_packet_fct_##A == (uintptr_t)fct) return my_write_packet_##A; + SUPER() + #undef GO + #define GO(A) if(my_write_packet_fct_##A == 0) {my_write_packet_fct_##A = (uintptr_t)fct; return my_write_packet_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavformat58 write_packet callback\n"); + return NULL; +} +// seek ... +#define GO(A) \ +static uintptr_t my_seek_fct_##A = 0; \ +static int64_t my_seek_##A(void* a, int64_t b, int c) \ +{ \ + return (int64_t)RunFunctionFmt(my_seek_fct_##A, "pIi", a, b, c); \ +} +SUPER() +#undef GO +static void* find_seek_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_seek_fct_##A == (uintptr_t)fct) return my_seek_##A; + SUPER() + #undef GO + #define GO(A) if(my_seek_fct_##A == 0) {my_seek_fct_##A = (uintptr_t)fct; return my_seek_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavformat58 seek callback\n"); + return NULL; +} + +#undef SUPER + + +EXPORT void* my_avio_alloc_context(x64emu_t* emu, void* buffer, int buffer_size, int write_flag, void* opaque, void* read_packet, void* write_packet, void* seek) +{ + return my->avio_alloc_context(buffer, buffer_size, write_flag, opaque, find_read_packet_Fct(read_packet), find_write_packet_Fct(write_packet), find_seek_Fct(seek)); +} + +// will allow wrapped lib if and only if libavutil.so.56 && libavcodec.so.58 are also available! +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; \ + { \ + void* h = dlopen("libavutil.so.56", RTLD_LAZY | RTLD_GLOBAL); \ + if(!h) return -2; \ + else dlclose(h); \ + h = dlopen("libavcodec.so.58", RTLD_LAZY | RTLD_GLOBAL); \ + if(!h) return -2; \ + else dlclose(h); \ + } + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibavformat58_private.h b/src/wrapped/wrappedlibavformat58_private.h new file mode 100644 index 0000000..df411a2 --- /dev/null +++ b/src/wrapped/wrappedlibavformat58_private.h @@ -0,0 +1,162 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//GOM(av_add_index_entry, iFEpIIiii) +//GOM(av_append_packet, iFEppi) +GO(av_codec_get_id, uFpu) +GO(av_codec_get_tag, uFpu) +GO(av_codec_get_tag2, iFpup) +GO(av_demuxer_iterate, pFp) // return AVInputFormat* that might need wrapping +GO(av_disposition_from_string, iFp) +GO(av_disposition_to_string, pFi) +//GOM(av_dump_format, vFEpipi) +GO(av_filename_number_test, iFp) +//GOM(av_find_best_stream, iFEpiiipi) +GO(av_find_default_stream_index, iFp) +GO(av_find_input_format, pFp) // return AVInputFormat* wich might need wrapping +//GOM(av_find_program_from_stream, pFEppi) +//GOM(av_fmt_ctx_get_duration_estimation_method, uFEp) +GO(avformat_alloc_context, pFv) // return AVFormatContext* wich might needs some wrapping? +//GOM(avformat_alloc_output_context2, iFEpppp) +GO(avformat_close_input, vFp) +GO(avformat_configuration, pFv) +DATA(av_format_ffversion, 8) // Warning: failed to confirm +GO(avformat_find_stream_info, iFpp) // AVFormatContext* might need some wrapping +//GOM(avformat_flush, iFEp) +GO(avformat_free_context, vFp) +//GOM(avformat_get_class, pFEv) +GO(avformat_get_mov_audio_tags, pFv) +GO(avformat_get_mov_video_tags, pFv) +GO(avformat_get_riff_audio_tags, pFv) +GO(avformat_get_riff_video_tags, pFv) +//GOM(avformat_index_get_entries_count, iFEp) +//GOM(avformat_index_get_entry, pFEpi) +//GOM(avformat_index_get_entry_from_timestamp, pFEpIi) +//GOM(avformat_init_output, iFEpp) +//GOM(av_format_inject_global_side_data, vFEp) +GO(avformat_license, pFv) +//GOM(avformat_match_stream_specifier, iFEppp) +GO(avformat_network_deinit, iFv) +GO(avformat_network_init, iFv) +GO(avformat_new_stream, pFpp) +GO(avformat_open_input, iFpppp) // many strucure might need wrapping here +//GOM(avformat_query_codec, iFEpui) +//GOM(avformat_queue_attached_pictures, iFEp) +GO(avformat_seek_file, iFpiIIIi) +//GOM(avformat_stream_group_add_stream, iFEpp) +//GOM(avformat_stream_group_create, pFEpup) +GO(avformat_stream_group_name, pFu) +//GOM(avformat_transfer_internal_stream_timing_info, iFEpppi) +GO(avformat_version, uFv) +GO(avformat_write_header, iFpp) +GO(av_get_frame_filename, iFpipi) +GO(av_get_frame_filename2, iFpipii) +//GOM(av_get_output_timestamp, iFEpipp) +//GOM(av_get_packet, iFEppi) +//GOM(av_guess_codec, uFEppppi) +//GOM(av_guess_format, pFEppp) +//GOM(av_guess_frame_rate, UFEppp) +//GOM(av_guess_sample_aspect_ratio, UFEppp) +GO(av_hex_dump, vFSpi) +GO(av_hex_dump_log, vFpipi) +GO(av_index_search_timestamp, iFpIi) +//GOM(av_interleaved_write_frame, iFEpp) +//GOM(av_interleaved_write_uncoded_frame, iFEpip) +//GOM(avio_accept, iFEpp) +GOM(avio_alloc_context, pFEpiipppp) +GO(avio_check, iFpi) +//GOM(avio_close, iFEp) +GO(avio_close_dir, iFp) +//GOM(avio_close_dyn_buf, iFEpp) +//GOM(avio_closep, iFEp) +GO(avio_context_free, vFp) +GO(avio_enum_protocols, pFpi) +//GOM(avio_feof, iFEp) +GO(avio_find_protocol_name, pFp) +GO(avio_flush, vFp) +GO(avio_free_directory_entry, vFp) +//GOM(avio_get_dyn_buf, iFEpp) +//GOM(avio_get_str, iFEpipi) +//GOM(avio_get_str16be, iFEpipi) +//GOM(avio_get_str16le, iFEpipi) +//GOM(avio_handshake, iFEp) +GO(avio_open, iFppi) +//GOM(avio_open2, iFEppipp) +GO(avio_open_dir, iFppp) +//GOM(avio_open_dyn_buf, iFEp) +//GOM(avio_pause, iFEpi) +//GOM(avio_printf, iFEppV) +//GOM(avio_print_string_array, vFEpp) +//GOM(avio_protocol_get_class, pFEp) +//GOM(avio_put_str, iFEpp) +//GOM(avio_put_str16be, iFEpp) +//GOM(avio_put_str16le, iFEpp) +//GOM(avio_r8, iFEp) +//GOM(avio_rb16, uFEp) +//GOM(avio_rb24, uFEp) +//GOM(avio_rb32, uFEp) +//GOM(avio_rb64, UFEp) +//GOM(avio_read, iFEppi) +GO(avio_read_dir, iFpp) +//GOM(avio_read_partial, iFEppi) +//GOM(avio_read_to_bprint, iFEppL) +//GOM(avio_rl16, uFEp) +//GOM(avio_rl24, uFEp) +//GOM(avio_rl32, uFEp) +//GOM(avio_rl64, UFEp) +//GOM(avio_seek, IFEpIi) +//GOM(avio_seek_time, IFEpiIi) +//GOM(avio_size, IFEp) +//GOM(avio_skip, IFEpI) +//GOM(avio_vprintf, iFEppA) +//GOM(avio_w8, vFEpi) +//GOM(avio_wb16, vFEpu) +//GOM(avio_wb24, vFEpu) +//GOM(avio_wb32, vFEpu) +//GOM(avio_wb64, vFEpU) +//GOM(avio_wl16, vFEpu) +//GOM(avio_wl24, vFEpu) +//GOM(avio_wl32, vFEpu) +//GOM(avio_wl64, vFEpU) +//GOM(avio_write, vFEppi) +//GOM(avio_write_marker, vFEpIu) +GO(av_match_ext, iFpp) +GO(av_muxer_iterate, pFp) +//GOM(av_new_program, pFEpi) +//GOM(av_pkt_dump2, vFESpip) +//GOM(av_pkt_dump_log2, vFEpipip) +//GO(avpriv_dv_get_packet, +//GO(avpriv_dv_init_demux, +//GO(avpriv_dv_produce_packet, +//GO(avpriv_mpegts_parse_close, +//GO(avpriv_mpegts_parse_open, +//GO(avpriv_mpegts_parse_packet, +//GO(avpriv_new_chapter, +//GO(avpriv_register_devices, +//GO(avpriv_set_pts_info, +//GO(avpriv_stream_set_need_parsing, +//GO(avpriv_update_cur_dts, +//GOM(av_probe_input_buffer, iFEppppuu) +//GOM(av_probe_input_buffer2, iFEppppuu) +//GOM(av_probe_input_format, pFEpi) +//GOM(av_probe_input_format2, pFEpip) +//GOM(av_probe_input_format3, pFEpip) +//GOM(av_program_add_stream_index, vFEpiu) +GO(av_read_frame, iFpp) // use AVFormatContext wich might needs some wrapping +//GOM(av_read_pause, iFEp) +//GOM(av_read_play, iFEp) +//GOM(av_sdp_create, iFEpipi) +GO(av_seek_frame, iFpiIi) +//GOM(av_stream_add_side_data, iFEpupL) +//GOM(av_stream_get_class, pFEv) +//GOM(av_stream_get_codec_timebase, UFEp) +//GOM(av_stream_get_parser, pFEp) +//GOM(av_stream_get_side_data, pFEpup) +//GOM(av_stream_group_get_class, pFEv) +//GOM(av_stream_new_side_data, pFEpuL) +GO(av_url_split, vFpipipippip) +GO(av_write_frame, iFpp) +GO(av_write_trailer, iFp) +//GOM(av_write_uncoded_frame, iFEpip) +//GOM(av_write_uncoded_frame_query, iFEpi) diff --git a/src/wrapped/wrappedlibavutil56.c b/src/wrapped/wrappedlibavutil56.c new file mode 100644 index 0000000..1efa086 --- /dev/null +++ b/src/wrapped/wrappedlibavutil56.c @@ -0,0 +1,313 @@ +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#define __STDC_WANT_LIB_EXT2__ 1 // for vasprintf +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* libavutil56Name = "libavutil.so.56"; + +#define LIBNAME libavutil56 + +#define ADDED_FUNCTIONS() \ + GO(av_malloc, pFL_t) \ + GO(av_mallocz, pFL_t) \ + GO(av_realloc, pFpL_t) \ + +#include "generated/wrappedlibavutil56types.h" + +#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// log_callback ... +#define GO(A) \ +static uintptr_t my_log_callback_fct_##A = 0; \ +static void my_log_callback_##A(void* a, int b, void* c, va_list d) \ +{ \ + x64_va_list_t null_va = {0}; \ + char* p = NULL; \ + (void)!vasprintf(&p, c, d); \ + RunFunctionFmt(my_log_callback_fct_##A, "pipp", a, b, d, null_va); \ + free(p); \ +} +SUPER() +#undef GO +static void* find_log_callback_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_log_callback_fct_##A == (uintptr_t)fct) return my_log_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_log_callback_fct_##A == 0) {my_log_callback_fct_##A = (uintptr_t)fct; return my_log_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavutil56 log_callback callback\n"); + return NULL; +} +// alloc ... +#define GO(A) \ +static uintptr_t my_alloc_fct_##A = 0; \ +static void* my_alloc_##A(int a) \ +{ \ + return (void*)RunFunctionFmt(my_alloc_fct_##A, "i", a); \ +} +SUPER() +#undef GO +static void* find_alloc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_alloc_fct_##A == (uintptr_t)fct) return my_alloc_##A; + SUPER() + #undef GO + #define GO(A) if(my_alloc_fct_##A == 0) {my_alloc_fct_##A = (uintptr_t)fct; return my_alloc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavutil56 alloc callback\n"); + return NULL; +} +// func1 ... +#define GO(A) \ +static uintptr_t my_func1_fct_##A = 0; \ +static double my_func1_##A(void* a, double b) \ +{ \ + return RunFunctionFmtD(my_func1_fct_##A, "pd", a, b); \ +} +SUPER() +#undef GO +static void* find_func1_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_func1_fct_##A == (uintptr_t)fct) return my_func1_##A; + SUPER() + #undef GO + #define GO(A) if(my_func1_fct_##A == 0) {my_func1_fct_##A = (uintptr_t)fct; return my_func1_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavutil56 func1 callback\n"); + return NULL; +} +// func2 ... +#define GO(A) \ +static uintptr_t my_func2_fct_##A = 0; \ +static double my_func2_##A(void* a, double b, double c) \ +{ \ + return RunFunctionFmtD(my_func2_fct_##A, "pdd", a, b, c); \ +} +SUPER() +#undef GO +static void* find_func2_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_func2_fct_##A == (uintptr_t)fct) return my_func2_##A; + SUPER() + #undef GO + #define GO(A) if(my_func2_fct_##A == 0) {my_func2_fct_##A = (uintptr_t)fct; return my_func2_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavutil56 func2 callback\n"); + return NULL; +} +// worker ... +#define GO(A) \ +static uintptr_t my_worker_fct_##A = 0; \ +static void my_worker_##A(void* a, int b, int c, int d, int e) \ +{ \ + RunFunctionFmt(my_worker_fct_##A, "piiii", a, b, c, d, e); \ +} +SUPER() +#undef GO +static void* find_worker_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_worker_fct_##A == (uintptr_t)fct) return my_worker_##A; + SUPER() + #undef GO + #define GO(A) if(my_worker_fct_##A == 0) {my_worker_fct_##A = (uintptr_t)fct; return my_worker_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavutil56 worker callback\n"); + return NULL; +} +// main ... +#define GO(A) \ +static uintptr_t my_main_fct_##A = 0; \ +static void my_main_##A(void* a) \ +{ \ + RunFunctionFmt(my_main_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* find_main_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_main_fct_##A == (uintptr_t)fct) return my_main_##A; + SUPER() + #undef GO + #define GO(A) if(my_main_fct_##A == 0) {my_main_fct_##A = (uintptr_t)fct; return my_main_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavutil56 main callback\n"); + return NULL; +} +// free ... +#define GO(A) \ +static uintptr_t my_free_fct_##A = 0; \ +static void my_free_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_free_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* find_free_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_free_fct_##A == (uintptr_t)fct) return my_free_##A; + SUPER() + #undef GO + #define GO(A) if(my_free_fct_##A == 0) {my_free_fct_##A = (uintptr_t)fct; return my_free_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libavutil56 free callback\n"); + return NULL; +} + +#undef SUPER + +EXPORT void my_av_log_set_callback(x64emu_t* emu, void* f) +{ + my->av_log_set_callback(find_log_callback_Fct(f)); +} + +EXPORT void* my_av_asprintf(x64emu_t* emu, void * fmt, uint64_t * b) { + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 1); + PREPARE_VALIST; + char* buff = NULL; + vasprintf(&buff, (char*)fmt, VARARGS); + void* ret = my->av_asprintf("%s", buff); + free(buff); + return ret; +} + +EXPORT void my_av_vbprintf(x64emu_t* emu, void* buff, void* fmt, x64_va_list_t b) +{ + (void)emu; + #ifdef CONVERT_VALIST + CONVERT_VALIST(b); + #else + myStackAlignValist(emu, (const char*)fmt, emu->scratch, b); + PREPARE_VALIST; + #endif + my->av_vbprintf(buff, fmt, VARARGS); +} +EXPORT void my_av_bprintf(x64emu_t* emu, void** buff, void * fmt, uint64_t * b) { + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2); + PREPARE_VALIST; + my->av_vbprintf((char**)buff, (char*)fmt, VARARGS); +} + +EXPORT void* my_av_buffer_pool_init(x64emu_t* emu, int size, void* alloc) +{ + return my->av_buffer_pool_init(size, find_alloc_Fct(alloc)); +} + +EXPORT int my_av_expr_parse(x64emu_t* emu, void* expr, void* s, void** const_names, void** func1_names, void** funcs1, void** func2_names, void** funcs2, int offset, void* log) +{ + int n_f1 = 0, n_f2 = 0; + // find n of f1 and f2 first + while(funcs1[n_f1]) ++n_f1; + while(funcs2[n_f2]) ++n_f2; + n_f1++; n_f2++; // include NULL marker + void* funcs1_[n_f1]; + void* funcs2_[n_f2]; + for(int i=0; iav_expr_parse(expr, s, const_names, func1_names, funcs1_, func2_names, funcs2_, offset, log); +} + +EXPORT void my_av_log(x64emu_t* emu, void* avcl, int lvl, void* fmt, uint64_t* b) +{ + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 3); + PREPARE_VALIST; + char* buff = NULL; + vasprintf(&buff, (char*)fmt, VARARGS); + my->av_log(avcl, lvl, "%s", buff); + free(buff); +} + +EXPORT void* my_av_malloc_tracked(x64emu_t* emu, size_t size) +{ + return my->av_malloc_tracked?my->av_malloc_tracked(size):my->av_malloc(size); +} + +EXPORT void* my_av_mallocz_tracked(x64emu_t* emu, size_t size) +{ + return my->av_mallocz_tracked?my->av_mallocz_tracked(size):my->av_mallocz(size); +} + +EXPORT void* my_av_realloc_tracked(x64emu_t* emu, void* p, size_t size) +{ + return my->av_realloc_tracked?my->av_realloc_tracked(p, size):my->av_realloc(p, size); +} + +EXPORT size_t my_av_strlcatf(x64emu_t* emu, void* dst, size_t size, void* fmt, uint64_t* b) +{ + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 3); + PREPARE_VALIST; + char* buff = NULL; + vasprintf(&buff, (char*)fmt, VARARGS); + size_t ret = my->av_strlcatf(dst, size, "%s", buff); + free(buff); + return ret; +} + +EXPORT int my_avpriv_slicethread_create(x64emu_t* emu, void* pctx, void* priv, void* worker, void* main_func, int nb) +{ + return my->avpriv_slicethread_create(pctx, priv, find_worker_Fct(worker), find_main_Fct(main_func), nb); +} + +EXPORT void* my_av_buffer_create(x64emu_t* emu, void* data, int size, void* f, void* opaque, int flags) +{ + return my->av_buffer_create(data, size, find_free_Fct(f), opaque, flags); +} + +// will allow wrapped lib if and only if libavformat.so.58 && libavcodec.so.58 are also available! +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; \ + { \ + void* h = dlopen("libavformat.so.58", RTLD_LAZY | RTLD_GLOBAL); \ + if(!h) return -2; \ + else dlclose(h); \ + h = dlopen("libavcodec.so.58", RTLD_LAZY | RTLD_GLOBAL); \ + if(!h) return -2; \ + else dlclose(h); \ + } + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibavutil56_private.h b/src/wrapped/wrappedlibavutil56_private.h new file mode 100644 index 0000000..f3a66e7 --- /dev/null +++ b/src/wrapped/wrappedlibavutil56_private.h @@ -0,0 +1,561 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +// AVRational is a struct with 2 int, so a U should do it +// AVinterger is an array of 16 uint16_t, so p +//GO(av_add_i, +//GO(av_add_q, +GO(av_add_stable, IFUIUI) +GO(av_adler32_update, uFupL) +GO(av_aes_alloc, pFv) +GO(av_aes_crypt, vFpppipi) +GO(av_aes_ctr_alloc, pFv) +GO(av_aes_ctr_crypt, vFpppi) +GO(av_aes_ctr_free, vFp) +GO(av_aes_ctr_get_iv, pFp) +GO(av_aes_ctr_increment_iv, vFp) +GO(av_aes_ctr_init, iFpp) +GO(av_aes_ctr_set_full_iv, vFpp) +GO(av_aes_ctr_set_iv, vFpp) +GO(av_aes_ctr_set_random_iv, vFp) +GO(av_aes_init, iFppii) +DATA(av_aes_size, 4) +GO(av_append_path_component, pFpp) +GOM(av_asprintf, pFEpV) +GO(av_assert0_fpu, vFv) +GO(av_audio_fifo_alloc, pFiii) +GO(av_audio_fifo_drain, iFpi) +GO(av_audio_fifo_free, vFp) +GO(av_audio_fifo_peek, iFppi) +GO(av_audio_fifo_peek_at, iFppii) +GO(av_audio_fifo_read, iFppi) +GO(av_audio_fifo_realloc, iFpi) +GO(av_audio_fifo_reset, vFp) +GO(av_audio_fifo_size, iFp) +GO(av_audio_fifo_space, iFp) +GO(av_audio_fifo_write, iFppi) +GO(av_base64_decode, iFppi) +GO(av_base64_encode, pFpipi) +GO(av_basename, pFp) +GO(av_blowfish_alloc, pFv) +GO(av_blowfish_crypt, vFpppipi) +GO(av_blowfish_crypt_ecb, vFpppi) +GO(av_blowfish_init, vFppi) +GO(av_bmg_get, vFpp) +GO(av_bprint_append_data, vFppu) +//GO(av_bprint_channel_layout, +GO(av_bprint_chars, vFpcu) +GO(av_bprint_clear, vFp) +GO(av_bprint_escape, vFpppui) +GOM(av_bprintf, vFEppV) +GO(av_bprint_finalize, iFpp) +GO(av_bprint_get_buffer, vFpupp) +GO(av_bprint_init, vFpuu) +GO(av_bprint_init_for_buffer, vFppu) +GO(av_bprint_strftime, vFppp) +GO(av_buffer_alloc, pFL) +GO(av_buffer_allocz, pFL) +GOM(av_buffer_create, pFEpippi) +GO(av_buffer_default_free, vFpp) +GO(av_buffer_get_opaque, pFp) +GO(av_buffer_get_ref_count, iFp) +GO(av_buffer_is_writable, iFp) +GO(av_buffer_make_writable, iFp) +GO(av_buffer_pool_buffer_get_opaque, pFp) +GO(av_buffer_pool_get, pFp) +GOM(av_buffer_pool_init, pFEip) +//GOM(av_buffer_pool_init2, pFELppp) +GO(av_buffer_pool_uninit, vFp) +GO(av_buffer_realloc, iFpL) +GO(av_buffer_ref, pFp) +GO(av_buffer_replace, iFpp) +GO(av_buffer_unref, vFp) +GO(av_calloc, pFLL) +GO(av_camellia_alloc, pFv) +GO(av_camellia_crypt, vFpppipi) +GO(av_camellia_init, iFppi) +DATA(av_camellia_size, 4) +GO(av_cast5_alloc, pFv) +GO(av_cast5_crypt, vFpppii) +GO(av_cast5_crypt2, vFpppipi) +GO(av_cast5_init, iFppi) +DATA(av_cast5_size, 4) +//GO(av_channel_layout_extract_channel, +GO(av_chroma_location_from_name, iFp) +GO(av_chroma_location_name, pFu) +//GO(av_cmp_i, +GO(av_color_primaries_from_name, iFp) +GO(av_color_primaries_name, pFu) +GO(av_color_range_from_name, iFp) +GO(av_color_range_name, pFu) +GO(av_color_space_from_name, iFp) +GO(av_color_space_name, pFu) +GO(av_color_transfer_from_name, iFp) +GO(av_color_transfer_name, pFu) +GO(av_compare_mod, IFUUU) +GO(av_compare_ts, iFIUIU) +GO(av_content_light_metadata_alloc, pFp) +GO(av_content_light_metadata_create_side_data, pFp) +GO(av_cpu_count, iFv) +GO(av_cpu_max_align, LFv) +GO(av_crc, uFpupL) +GO(av_crc_get_table, pFu) +GO(av_crc_init, iFpiiui) +GO(av_d2q, UFdi) +//GO(av_d2str, +GO(av_default_get_category, uFp) +GO(av_default_item_name, pFp) +GO(av_des_alloc, pFv) +GO(av_des_crypt, vFpppipi) +GO(av_des_init, iFppii) +GO(av_des_mac, vFpppi) +GO(av_dict_copy, iFppi) +GO(av_dict_count, iFp) +GO(av_dict_free, vFp) +GO(av_dict_get, pFpppi) +GO(av_dict_get_string, iFppcc) +GO(av_dict_parse_string, iFppppi) +GO(av_dict_set, iFpppi) +GO(av_dict_set_int, iFppIi) +GO(av_dirname, pFp) +GO(av_display_matrix_flip, vFpii) +GO(av_display_rotation_get, dFp) +GO(av_display_rotation_set, vFpd) +//GO(av_div_i, +GO(av_div_q, UFUU) +GO(av_dovi_alloc, pFp) +//GO(av_downmix_info_update_side_data, +//GO(av_dynamic_hdr_plus_alloc, +//GO(av_dynamic_hdr_plus_create_side_data, +GO(av_dynarray2_add, pFppLp) +GO(av_dynarray_add, vFppp) +GO(av_dynarray_add_nofree, iFppp) +GO(av_encryption_info_add_side_data, pFpp) +GO(av_encryption_info_alloc, pFuuu) +GO(av_encryption_info_clone, pFp) +GO(av_encryption_info_free, vFp) +GO(av_encryption_info_get_side_data, pFpL) +GO(av_encryption_init_info_add_side_data, pFpp) +GO(av_encryption_init_info_alloc, pFuuuu) +GO(av_encryption_init_info_free, vFp) +GO(av_encryption_init_info_get_side_data, pFpL) +GO(av_escape, iFpppui) +GO(av_expr_count_func, iFppii) +GO(av_expr_count_vars, iFppi) +GO(av_expr_eval, dFppp) +GO(av_expr_free, vFp) +GOM(av_expr_parse, iFEpppppppip) +//GOM(av_expr_parse_and_eval, iFEpppppppppip) +GO(av_fast_malloc, vFppL) +GO(av_fast_mallocz, vFppL) +GO(av_fast_realloc, pFppL) +//GO(av_fifo_alloc, +//GO(av_fifo_alloc_array, +//GO(av_fifo_drain, +//GO(av_fifo_free, +//GO(av_fifo_freep, +//GO(av_fifo_generic_peek, +//GO(av_fifo_generic_peek_at, +//GO(av_fifo_generic_read, +//GO(av_fifo_generic_write, +//GO(av_fifo_grow, +//GO(av_fifo_realloc2, +//GO(av_fifo_reset, +//GO(av_fifo_size, +//GO(av_fifo_space, +//GO(av_file_map, +//GO(av_file_unmap, +GO(av_film_grain_params_alloc, pFp) +GO(av_film_grain_params_create_side_data, pFp) +GO(av_find_best_pix_fmt_of_2, iFiiiip) +GO(av_find_info_tag, iFpipp) +//GO(av_find_nearest_q_idx, +//GO(av_fopen_utf8, +GO(av_force_cpu_flags, vFi) +GO(av_fourcc_make_string, pFpu) +GO(av_frame_alloc, pFv) +GO(av_frame_apply_cropping, iFpi) +GO(av_frame_clone, pFp) +GO(av_frame_copy, iFpp) +GO(av_frame_copy_props, iFpp) +GO(av_frame_free, vFp) +//GO(av_frame_get_best_effort_timestamp, +GO(av_frame_get_buffer, iFpi) +//GO(av_frame_get_channel_layout, +//GO(av_frame_get_channels, +//GO(av_frame_get_color_range, +//GO(av_frame_get_colorspace, +//GO(av_frame_get_decode_error_flags, +//GO(av_frame_get_metadata, +//GO(av_frame_get_pkt_duration, +//GO(av_frame_get_pkt_pos, +//GO(av_frame_get_pkt_size, +GO(av_frame_get_plane_buffer, pFpi) +//GO(av_frame_get_qp_table, +//GO(av_frame_get_sample_rate, +GO(av_frame_get_side_data, pFpu) +GO(av_frame_is_writable, iFp) +GO(av_frame_make_writable, iFp) +GO(av_frame_move_ref, vFpp) +GO(av_frame_new_side_data, pFpuL) +GO(av_frame_new_side_data_from_buf, pFpup) +GO(av_frame_ref, iFpp) +GO(av_frame_remove_side_data, vFpu) +//GO(av_frame_set_best_effort_timestamp, +//GO(av_frame_set_channel_layout, +//GO(av_frame_set_channels, +//GO(av_frame_set_color_range, +//GO(av_frame_set_colorspace, +//GO(av_frame_set_decode_error_flags, +//GO(av_frame_set_metadata, +//GO(av_frame_set_pkt_duration, +//GO(av_frame_set_pkt_pos, +//GO(av_frame_set_pkt_size, +//GO(av_frame_set_qp_table, +//GO(av_frame_set_sample_rate, +GO(av_frame_side_data_name, pFu) +GO(av_frame_unref, vFp) +GO(av_free, vFp) +GO(av_freep, vFp) +GO(av_gcd, IFII) +//GO(av_gcd_q, +GO(av_get_alt_sample_fmt, iFii) +GO(av_get_bits_per_pixel, iFp) +GO(av_get_bytes_per_sample, iFi) +//GO(av_get_channel_description, +GO(av_get_channel_layout, UFp) +GO(av_get_channel_layout_channel_index, iFUU) +GO(av_get_channel_layout_nb_channels, iFU) +GO(av_get_channel_layout_string, vFpiiU) +GO(av_get_channel_name, pFU) +//GO(av_get_colorspace_name, +GO(av_get_cpu_flags, iFv) +GO(av_get_default_channel_layout, UFi) +GO(av_get_extended_channel_layout, iFppp) +GO(av_get_known_color_name, pFip) +GO(av_get_media_type_string, pFi) +GO(av_get_packed_sample_fmt, iFi) +GO(av_get_padded_bits_per_pixel, iFp) +GO(av_get_picture_type_char, cFu) +GO(av_get_pix_fmt, iFp) +GO(av_get_pix_fmt_loss, iFiii) +GO(av_get_pix_fmt_name, pFi) +GO(av_get_pix_fmt_string, pFpii) +GO(av_get_planar_sample_fmt, iFi) +GO(av_get_random_seed, uFv) +GO(av_get_sample_fmt, iFp) +GO(av_get_sample_fmt_name, pFi) +GO(av_get_sample_fmt_string, pFpii) +//GO(av_get_standard_channel_layout, +GO(av_gettime, IFv) +GO(av_get_time_base_q, UFv) +GO(av_gettime_relative, IFv) +GO(av_gettime_relative_is_monotonic, iFv) +GO(av_get_token, pFpp) +GO(av_hash_alloc, iFpp) +GO(av_hash_final, vFpp) +GO(av_hash_final_b64, vFppi) +GO(av_hash_final_bin, vFppi) +GO(av_hash_final_hex, vFppi) +GO(av_hash_freep, vFp) +GO(av_hash_get_name, pFp) +GO(av_hash_get_size, iFp) +GO(av_hash_init, vFp) +GO(av_hash_names, pFi) +GO(av_hash_update, vFppL) +GO(av_hmac_alloc, pFu) +GO(av_hmac_calc, iFppupupu) +GO(av_hmac_final, iFppu) +GO(av_hmac_free, vFp) +GO(av_hmac_init, vFppu) +GO(av_hmac_update, vFppu) +GO(av_hwdevice_ctx_alloc, pFu) +GO(av_hwdevice_ctx_create, iFpuppi) +GO(av_hwdevice_ctx_create_derived, iFpupi) +GO(av_hwdevice_ctx_create_derived_opts, iFpuppi) +GO(av_hwdevice_ctx_init, iFp) +GO(av_hwdevice_find_type_by_name, uFp) +GO(av_hwdevice_get_hwframe_constraints, pFpp) +GO(av_hwdevice_get_type_name, pFu) +GO(av_hwdevice_hwconfig_alloc, pFp) +GO(av_hwdevice_iterate_types, uFu) +GO(av_hwframe_constraints_free, vFp) +GO(av_hwframe_ctx_alloc, pFp) +GO(av_hwframe_ctx_create_derived, iFpippi) +GO(av_hwframe_ctx_init, iFp) +GO(av_hwframe_get_buffer, iFppi) +GO(av_hwframe_map, iFppi) +GO(av_hwframe_transfer_data, iFppi) +GO(av_hwframe_transfer_get_formats, iFpupi) +//GO(av_i2int, +GO(av_image_alloc, iFppiiii) +GO(av_image_check_sar, iFuuU) +GO(av_image_check_size, iFuuip) +GO(av_image_check_size2, iFuuIiip) +GO(av_image_copy, vFppppiii) +GO(av_image_copy_plane, vFpipiii) +GO(av_image_copy_to_buffer, iFpippiiii) +GO(av_image_copy_uc_from, vFppppiii) +GO(av_image_fill_arrays, iFpppiiii) +GO(av_image_fill_black, iFppiuii) +GO(av_image_fill_linesizes, iFpii) +GO(av_image_fill_max_pixsteps, vFppp) +GO(av_image_fill_plane_sizes, iFpiip) +GO(av_image_fill_pointers, iFpiipp) +GO(av_image_get_buffer_size, iFiiii) +GO(av_image_get_linesize, iFiii) +//GO(av_int2i, +GO(av_int_list_length_for_size, uFupU) +GO(av_lfg_init, vFpu) +GO(av_lfg_init_from_data, iFppu) +GOM(av_log, vFEpipV) +GO(av_log2, iFu) +GO(av_log2_16bit, iFu) +//GO(av_log2_i, +//GOM(av_log_default_callback, vFEpipA) +//GOM(av_log_format_line, vFEpipApip) +//GOM(av_log_format_line2, iFEpipApip) +GO(av_log_get_flags, iFv) +GO(av_log_get_level, iFv) +//GOM(av_log_once, vFEpiippV) +GOM(av_log_set_callback, vFEp) +GO(av_log_set_flags, vFi) +GO(av_log_set_level, vFi) +GO(av_lzo1x_decode, iFpppp) +GO(av_malloc, pFL) +GOM(av_malloc_tracked, pFEl) +GO(av_malloc_array, pFLL) +GO(av_mallocz, pFL) +GOM(av_mallocz_tracked, pFEL) // not wlways defined +GO(av_mallocz_array, pFLL) +GO(av_mastering_display_metadata_alloc, pFv) +GO(av_mastering_display_metadata_create_side_data, pFp) +GO(av_match_list, iFppc) +GO(av_match_name, iFpp) +GO(av_max_alloc, vFL) +GO(av_md5_alloc, pFv) +GO(av_md5_final, vFpp) +GO(av_md5_init, vFp) +DATA(av_md5_size, 4) +GO(av_md5_sum, vFppL) +GO(av_md5_update, vFppL) +GO(av_memcpy_backptr, vFpii) +GO(av_memdup, pFpL) +//GO(av_mod_i, +//GO(av_mul_i, +GO(av_mul_q, UFUU) +GO(av_murmur3_alloc, pFv) +GO(av_murmur3_final, vFpp) +GO(av_murmur3_init, vFp) +GO(av_murmur3_init_seeded, vFpU) +GO(av_murmur3_update, vFppL) +//GO(av_nearer_q, +//GOM(av_opt_child_class_iterate, pFEpp) +//GO(av_opt_child_class_next, +GO(av_opt_child_next, pFpp) +GO(av_opt_copy, iFpp) +GO(av_opt_eval_double, iFpppp) +GO(av_opt_eval_flags, iFpppp) +GO(av_opt_eval_float, iFpppp) +GO(av_opt_eval_int, iFpppp) +GO(av_opt_eval_int64, iFpppp) +GO(av_opt_eval_q, iFpppp) +GO(av_opt_find, pFpppii) +GO(av_opt_find2, pFpppiip) +GO(av_opt_flag_is_set, iFppp) +GO(av_opt_free, vFp) +GO(av_opt_freep_ranges, vFp) +GO(av_opt_get, iFppip) +//GO(av_opt_get_channel_layout, +GO(av_opt_get_dict_val, iFppip) +GO(av_opt_get_double, iFppip) +GO(av_opt_get_image_size, iFppipp) +GO(av_opt_get_int, iFppip) +GO(av_opt_get_key_value, iFpppupp) +GO(av_opt_get_pixel_fmt, iFppip) +GO(av_opt_get_q, iFppip) +GO(av_opt_get_sample_fmt, iFppip) +GO(av_opt_get_video_rate, iFppip) +GO(av_opt_is_set_to_default, iFpp) +GO(av_opt_is_set_to_default_by_name, iFppi) +GO(av_opt_next, pFpp) +GO(av_opt_ptr, pFppp) //1st param is a AVClass* +GO(av_opt_query_ranges, iFpppi) +GO(av_opt_query_ranges_default, iFpppi) +GO(av_opt_serialize, iFpiipcc) +GO(av_opt_set, iFpppi) +GO(av_opt_set_bin, iFpppii) +//GO(av_opt_set_channel_layout, +GO(av_opt_set_defaults, vFp) +GO(av_opt_set_defaults2, vFpii) +GO(av_opt_set_dict, iFpp) +GO(av_opt_set_dict2, iFppi) +GO(av_opt_set_dict_val, iFpppi) +GO(av_opt_set_double, iFppdi) +GO(av_opt_set_from_string, iFppppp) +GO(av_opt_set_image_size, iFppiii) +GO(av_opt_set_int, iFppIi) +GO(av_opt_set_pixel_fmt, iFppii) +//GO(av_opt_set_q, +GO(av_opt_set_sample_fmt, iFppii) +//GO(av_opt_set_video_rate, +GO(av_opt_show2, iFppii) +GO(av_parse_color, iFppip) +GO(av_parse_cpu_caps, iFpp) +//GO(av_parse_cpu_flags, +GO(av_parse_ratio, iFppiip) +GO(av_parse_time, iFppi) +GO(av_parse_video_rate, iFpp) +GO(av_parse_video_size, iFppp) +//GOM(av_pixelutils_get_sad_fn, pFEiiip) +GO(av_pix_fmt_count_planes, iFi) +GO(av_pix_fmt_desc_get, pFi) +GO(av_pix_fmt_desc_get_id, iFp) +GO(av_pix_fmt_desc_next, pFp) +GO(av_pix_fmt_get_chroma_sub_sample, iFipp) +GO(av_pix_fmt_swap_endianness, iFi) +//GO(avpriv_alloc_fixed_dsp, +//DATA(avpriv_cga_font, +GO(avpriv_dict_set_timestamp, iFppI) +//GO(avpriv_float_dsp_alloc, +GO(avpriv_get_gamma_from_trc, dFi) +//GO(avpriv_get_trc_function_from_trc, +//GO(avpriv_init_lls, +GO(avpriv_open, iFpON) //should wrap like open? +GO(avpriv_report_missing_feature, vFppppppppppp) // is a vFppV actually, printf style +GO(avpriv_request_sample, vFppppppppppp) // is a vFppV actually, printf style +//GO(avpriv_scalarproduct_float_c, +GO(avpriv_set_systematic_pal2, iFpu) +GOM(avpriv_slicethread_create, iFEppppi) +GO(avpriv_slicethread_execute, vFpii) +GO(avpriv_slicethread_free, vFp) +//GO(avpriv_solve_lls, +//GO(avpriv_tempfile, +//DATA(avpriv_vga16_font, +//GO(av_q2intfloat, +GO(av_rc4_alloc, pFv) +GO(av_rc4_crypt, vFpppipi) +GO(av_rc4_init, iFppii) +GO(av_read_image_line, vFppppiiiii) +GO(av_read_image_line2, vFppppiiiiii) +GO(av_realloc, pFpL) +GO(av_realloc_array, pFpLL) +GO(av_realloc_f, pFpLL) +GOM(av_realloc_tracked, pFEpL) //not always defined +GO(av_reallocp, iFpL) +GO(av_reallocp_array, iFpLL) +GO(av_reduce, iFppIII) +GO(av_rescale, IFIII) +//GO(av_rescale_delta, +GO(av_rescale_q, IFIUU) // Both U are AVRationnal: struct with 2 ints +GO(av_rescale_q_rnd, IFIUUu) // Both U are AVRationnal: struct with 2 ints +GO(av_rescale_rnd, IFIIIu) +GO(av_ripemd_alloc, pFv) +GO(av_ripemd_final, vFpp) +GO(av_ripemd_init, iFpi) +DATA(av_ripemd_size, 4) +GO(av_ripemd_update, vFppL) +GO(av_sample_fmt_is_planar, iFi) +GO(av_samples_alloc, iFppiiii) +GO(av_samples_alloc_array_and_samples, iFppiiii) +GO(av_samples_copy, iFppiiiii) +GO(av_samples_fill_arrays, iFpppiiii) +GO(av_samples_get_buffer_size, iFpiiii) +GO(av_samples_set_silence, iFpiiii) +//GO(av_set_cpu_flags_mask, +GO(av_set_options_string, iFpppp) +GO(av_sha512_alloc, pFv) +GO(av_sha512_final, vFpp) +GO(av_sha512_init, iFpi) +DATA(av_sha512_size, 4) +GO(av_sha512_update, vFppL) +GO(av_sha_alloc, pFv) +GO(av_sha_final, vFpp) +GO(av_sha_init, iFpi) +DATA(av_sha_size, 4) +GO(av_sha_update, vFppL) +//GO(av_shr_i, +GO(av_small_strptime, pFppp) +GO(av_spherical_alloc, pFp) +GO(av_spherical_from_name, iFp) +GO(av_spherical_projection_name, pFu) +GO(av_spherical_tile_bounds, vFpLLpppp) +//GOM(av_sscanf, iFEppV) +GO(av_stereo3d_alloc, pFv) +GO(av_stereo3d_create_side_data, pFp) +GO(av_stereo3d_from_name, iFp) +GO(av_stereo3d_type_name, pFu) +GO(av_strcasecmp, iFpp) +GO(av_strdup, pFp) +GO(av_strerror, iFipL) +GO(av_strireplace, pFppp) +GO(av_stristart, iFppp) +GO(av_stristr, pFpp) +GO(av_strlcat, LFppL) +GOM(av_strlcatf, LFEpLpV) +GO(av_strlcpy, LFppL) +GO(av_strncasecmp, iFppL) +GO(av_strndup, pFpL) +GO(av_strnstr, pFppL) +GO(av_strstart, iFppp) +GO(av_strtod, dFpp) +GO(av_strtok, pFppp) +//GO(av_sub_i, +//GO(av_sub_q, +GO(av_tea_alloc, pFv) +GO(av_tea_crypt, vFpppipi) +GO(av_tea_init, vFppi) +DATA(av_tea_size, 4) +GO(av_tempfile, iFppip) // Warning: failed to confirm +GO(av_thread_message_flush, vFp) +GO(av_thread_message_queue_alloc, iFpuu) +GO(av_thread_message_queue_free, vFp) +GO(av_thread_message_queue_nb_elems, iFp) +GO(av_thread_message_queue_recv, iFppu) +GO(av_thread_message_queue_send, iFppu) +GO(av_thread_message_queue_set_err_recv, vFpi) +GO(av_thread_message_queue_set_err_send, vFpi) +//GOM(av_thread_message_queue_set_free_func, vFEpp) +GO(av_timecode_adjust_ntsc_framenum2, iFii) +GO(av_timecode_check_frame_rate, iFU) +//GO(av_timecode_get_smpte, +GO(av_timecode_get_smpte_from_framenum, uFpi) +GO(av_timecode_init, iFpUiip) +//GO(av_timecode_init_from_components, +GO(av_timecode_init_from_string, iFpUpp) +GO(av_timecode_make_mpeg_tc_string, pFpu) +GO(av_timecode_make_smpte_tc_string, pFpui) +//GO(av_timecode_make_smpte_tc_string2, +GO(av_timecode_make_string, pFppi) +GO(av_timegm, lFp) +GO(av_tree_destroy, vFp) +//GOM(av_tree_enumerate, vFEpppp) +//GOM(av_tree_find, pFEpppp) +//GOM(av_tree_insert, pFEpppp) +GO(av_tree_node_alloc, pFv) +DATA(av_tree_node_size, 4) +GO(av_twofish_alloc, pFv) +GO(av_twofish_crypt, vFpppipi) +GO(av_twofish_init, iFppi) +DATA(av_twofish_size, 4) +//GOM(av_tx_init, iFEppuiipU) +GO(av_tx_uninit, vFp) +GO(av_usleep, iFu) +GO(av_utf8_decode, iFpppu) +GO(avutil_configuration, pFv) +DATA(av_util_ffversion, 8) // Warning: failed to confirm +GO(avutil_license, pFv) +GO(avutil_version, uFv) +GOM(av_vbprintf, vFEppA) +GO(av_version_info, pFv) +GO(av_video_enc_params_alloc, pFiup) +GO(av_video_enc_params_create_side_data, pFpiu) +//GOM(av_vlog, vFEpipA) +GO(av_write_image_line, vFppppiiii) +GO(av_write_image_line2, vFppppiiiii) +GO(av_xtea_alloc, pFv) +GO(av_xtea_crypt, vFpppipi) +GO(av_xtea_init, vFpp) +GO(av_xtea_le_crypt, vFpppipi) +GO(av_xtea_le_init, vFpp) diff --git a/src/wrapped/wrappedlibblas.c b/src/wrapped/wrappedlibblas.c new file mode 100644 index 0000000..38eee46 --- /dev/null +++ b/src/wrapped/wrappedlibblas.c @@ -0,0 +1,25 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" + +const char* libblasName = "libblas.so.3"; +#define ALTNAME "libblas.so" + +#define LIBNAME libblas + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibblas_private.h b/src/wrapped/wrappedlibblas_private.h new file mode 100644 index 0000000..474da0d --- /dev/null +++ b/src/wrapped/wrappedlibblas_private.h @@ -0,0 +1,208 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(cblas_caxpby, vFlpplppl) +GO(cblas_caxpy, vFlpplpl) +GO(cblas_caxpyc, vFlpplpl) +GO(cblas_ccopy, vFlplpl) +GO(cblas_cdotc, xFlplpl) +GO(cblas_cdotc_sub, vFlplplp) +GO(cblas_cdotu, xFlplpl) +GO(cblas_cdotu_sub, vFlplplp) +GO(cblas_cgbmv, vFuullllpplplppl) +GO(cblas_cgeadd, vFullpplppl) +GO(cblas_cgemm, vFuuulllpplplppl) +GO(cblas_cgemm_batch, vFuppppppppppppplp) +GO(cblas_cgemmt, vFuuuullpplplppl) +//GO(cblas_cgemmtr, +GO(cblas_cgemv, vFuullpplplppl) +GO(cblas_cgerc, vFullpplplpl) +GO(cblas_cgeru, vFullpplplpl) +GO(cblas_chbmv, vFuullpplplppl) +GO(cblas_chemm, vFuuullpplplppl) +GO(cblas_chemv, vFuulpplplppl) +GO(cblas_cher, vFuulfplpl) +GO(cblas_cher2, vFuulpplplpl) +GO(cblas_cher2k, vFuuullpplplfpl) +GO(cblas_cherk, vFuuullfplfpl) +GO(cblas_chpmv, vFuulppplppl) +GO(cblas_chpr, vFuulfplp) +GO(cblas_chpr2, vFuulpplplp) +GO(cblas_cimatcopy, vFuullppll) +GO(cblas_comatcopy, vFuullpplpl) +GO(cblas_crotg, vFpppp) +GO(cblas_cscal, vFlppl) +GO(cblas_csrot, vFlplplff) +GO(cblas_csscal, vFlfpl) +GO(cblas_cswap, vFlplpl) +GO(cblas_csymm, vFuuullpplplppl) +GO(cblas_csyr2k, vFuuullpplplppl) +GO(cblas_csyrk, vFuuullpplppl) +GO(cblas_ctbmv, vFuuuullplpl) +GO(cblas_ctbsv, vFuuuullplpl) +GO(cblas_ctpmv, vFuuuulppl) +GO(cblas_ctpsv, vFuuuulppl) +GO(cblas_ctrmm, vFuuuuullpplpl) +GO(cblas_ctrmv, vFuuuulplpl) +GO(cblas_ctrsm, vFuuuuullpplpl) +GO(cblas_ctrsv, vFuuuulplpl) +GO(cblas_damax, dFlpl) +GO(cblas_damin, dFlpl) +GO(cblas_dasum, dFlpl) +GO(cblas_daxpby, vFldpldpl) +GO(cblas_daxpy, vFldplpl) +GO(cblas_dcopy, vFlplpl) +GO(cblas_ddot, dFlplpl) +GO(cblas_dgbmv, vFuulllldplpldpl) +GO(cblas_dgeadd, vFulldpldpl) +GO(cblas_dgemm, vFuuullldplpldpl) +GO(cblas_dgemm_batch, vFuppppppppppppplp) +GO(cblas_dgemmt, vFuuuulldplpldpl) +//GO(cblas_dgemmtr, +GO(cblas_dgemv, vFuulldplpldpl) +GO(cblas_dger, vFulldplplpl) +GO(cblas_dimatcopy, vFuulldpll) +GO(cblas_dnrm2, dFlpl) +GO(cblas_domatcopy, vFuulldplpl) +GO(cblas_drot, vFlplpldd) +GO(cblas_drotg, vFpppp) +GO(cblas_drotm, vFlplplp) +GO(cblas_drotmg, vFpppdp) +GO(cblas_dsbmv, vFuulldplpldpl) +GO(cblas_dscal, vFldpl) +GO(cblas_dsdot, dFlplpl) +GO(cblas_dspmv, vFuuldppldpl) +GO(cblas_dspr, vFuuldplp) +GO(cblas_dspr2, vFuuldplplp) +GO(cblas_dsum, dFlpl) +GO(cblas_dswap, vFlplpl) +GO(cblas_dsymm, vFuuulldplpldpl) +GO(cblas_dsymv, vFuuldplpldpl) +GO(cblas_dsyr, vFuuldplpl) +GO(cblas_dsyr2, vFuuldplplpl) +GO(cblas_dsyr2k, vFuuulldplpldpl) +GO(cblas_dsyrk, vFuuulldpldpl) +GO(cblas_dtbmv, vFuuuullplpl) +GO(cblas_dtbsv, vFuuuullplpl) +GO(cblas_dtpmv, vFuuuulppl) +GO(cblas_dtpsv, vFuuuulppl) +GO(cblas_dtrmm, vFuuuuulldplpl) +GO(cblas_dtrmv, vFuuuulplpl) +GO(cblas_dtrsm, vFuuuuulldplpl) +GO(cblas_dtrsv, vFuuuulplpl) +GO(cblas_dzamax, dFlpl) +GO(cblas_dzamin, dFlpl) +GO(cblas_dzasum, dFlpl) +GO(cblas_dznrm2, dFlpl) +GO(cblas_dzsum, dFlpl) +GO(cblas_icamax, LFlpl) +GO(cblas_icamin, LFlpl) +GO(cblas_icmax, LFlpl) +GO(cblas_icmin, LFlpl) +GO(cblas_idamax, LFlpl) +GO(cblas_idamin, LFlpl) +GO(cblas_idmax, LFlpl) +GO(cblas_idmin, LFlpl) +GO(cblas_isamax, LFlpl) +GO(cblas_isamin, LFlpl) +GO(cblas_ismax, LFlpl) +GO(cblas_ismin, LFlpl) +GO(cblas_izamax, LFlpl) +GO(cblas_izamin, LFlpl) +GO(cblas_izmax, LFlpl) +GO(cblas_izmin, LFlpl) +GO(cblas_samax, fFlpl) +GO(cblas_samin, fFlpl) +GO(cblas_sasum, fFlpl) +GO(cblas_saxpby, vFlfplfpl) +GO(cblas_saxpy, vFlfplpl) +GO(cblas_scamax, fFlpl) +GO(cblas_scamin, fFlpl) +GO(cblas_scasum, fFlpl) +GO(cblas_scnrm2, fFlpl) +GO(cblas_scopy, vFlplpl) +GO(cblas_scsum, fFlpl) +GO(cblas_sdot, fFlplpl) +GO(cblas_sdsdot, fFlfplpl) +GO(cblas_sgbmv, vFuullllfplplfpl) +GO(cblas_sgeadd, vFullfplfpl) +GO(cblas_sgemm, vFuuulllfplplfpl) +GO(cblas_sgemm_batch, vFuppppppppppppplp) +GO(cblas_sgemmt, vFuuuullfplplfpl) +//GO(cblas_sgemmtr, +GO(cblas_sgemv, vFuullfplplfpl) +GO(cblas_sger, vFullfplplpl) +GO(cblas_simatcopy, vFuullfpll) +GO(cblas_snrm2, fFlpl) +GO(cblas_somatcopy, vFuullfplpl) +GO(cblas_srot, vFlplplff) +GO(cblas_srotg, vFpppp) +GO(cblas_srotm, vFlplplp) +GO(cblas_srotmg, vFpppfp) +GO(cblas_ssbmv, vFuullfplplfpl) +GO(cblas_sscal, vFlfpl) +GO(cblas_sspmv, vFuulfpplfpl) +GO(cblas_sspr, vFuulfplp) +GO(cblas_sspr2, vFuulfplplp) +GO(cblas_ssum, fFlpl) +GO(cblas_sswap, vFlplpl) +GO(cblas_ssymm, vFuuullfplplfpl) +GO(cblas_ssymv, vFuulfplplfpl) +GO(cblas_ssyr, vFuulfplpl) +GO(cblas_ssyr2, vFuulfplplpl) +GO(cblas_ssyr2k, vFuuullfplplfpl) +GO(cblas_ssyrk, vFuuullfplfpl) +GO(cblas_stbmv, vFuuuullplpl) +GO(cblas_stbsv, vFuuuullplpl) +GO(cblas_stpmv, vFuuuulppl) +GO(cblas_stpsv, vFuuuulppl) +GO(cblas_strmm, vFuuuuullfplpl) +GO(cblas_strmv, vFuuuulplpl) +GO(cblas_strsm, vFuuuuullfplpl) +GO(cblas_strsv, vFuuuulplpl) +GO(cblas_zaxpby, vFlpplppl) +GO(cblas_zaxpy, vFlpplpl) +GO(cblas_zaxpyc, vFlpplpl) +GO(cblas_zcopy, vFlplpl) +GO(cblas_zdotc, XFlplpl) +GO(cblas_zdotc_sub, vFlplplp) +GO(cblas_zdotu, XFlplpl) +GO(cblas_zdotu_sub, vFlplplp) +GO(cblas_zdrot, vFlplpldd) +GO(cblas_zdscal, vFldpl) +GO(cblas_zgbmv, vFuullllpplplppl) +GO(cblas_zgeadd, vFullpplppl) +GO(cblas_zgemm, vFuuulllpplplppl) +GO(cblas_zgemm_batch, vFuppppppppppppplp) +GO(cblas_zgemmt, vFuuuullpplplppl) +//GO(cblas_zgemmtr, +GO(cblas_zgemv, vFuullpplplppl) +GO(cblas_zgerc, vFullpplplpl) +GO(cblas_zgeru, vFullpplplpl) +GO(cblas_zhbmv, vFuullpplplppl) +GO(cblas_zhemm, vFuuullpplplppl) +GO(cblas_zhemv, vFuulpplplppl) +GO(cblas_zher, vFuuldplpl) +GO(cblas_zher2, vFuulpplplpl) +GO(cblas_zher2k, vFuuullpplpldpl) +GO(cblas_zherk, vFuuulldpldpl) +GO(cblas_zhpmv, vFuulppplppl) +GO(cblas_zhpr, vFuuldplp) +GO(cblas_zhpr2, vFuulpplplp) +GO(cblas_zimatcopy, vFuullppll) +GO(cblas_zomatcopy, vFuullpplpl) +GO(cblas_zrotg, vFpppp) +GO(cblas_zscal, vFlppl) +GO(cblas_zswap, vFlplpl) +GO(cblas_zsymm, vFuuullpplplppl) +GO(cblas_zsyr2k, vFuuullpplplppl) +GO(cblas_zsyrk, vFuuullpplppl) +GO(cblas_ztbmv, vFuuuullplpl) +GO(cblas_ztbsv, vFuuuullplpl) +GO(cblas_ztpmv, vFuuuulppl) +GO(cblas_ztpsv, vFuuuulppl) +GO(cblas_ztrmm, vFuuuuullpplpl) +GO(cblas_ztrmv, vFuuuulplpl) +GO(cblas_ztrsm, vFuuuuullpplpl) +GO(cblas_ztrsv, vFuuuulplpl) diff --git a/src/wrapped/wrappedlibbsd.c b/src/wrapped/wrappedlibbsd.c index 231e74c..61bc8e2 100644 --- a/src/wrapped/wrappedlibbsd.c +++ b/src/wrapped/wrappedlibbsd.c @@ -17,25 +17,27 @@ #include "x64tls.h" -#ifdef ANDROID -const char* libbsdName = "libbsd.so"; -#else const char* libbsdName = "libbsd.so.0"; -#endif +#define ALTNAME "libbsd.so" #define LIBNAME libbsd #ifdef STATICBUILD -void arc4random_addrandom(unsigned char *dat, int datlen); -void arc4random_stir(void); -const char *getprogname(void); -void setprogname(const char *); +extern uint32_t arc4random(void); +extern void arc4random_addrandom(unsigned char *dat, int datlen); +extern void arc4random_buf(void *buf, size_t nbytes); +extern void arc4random_stir(void); +extern uint32_t arc4random_uniform(uint32_t upper_bound); +extern const char *getprogname(void); +extern void setprogname(const char *); #endif #ifndef STATICBUILD -#define PRE_INIT\ - if(1) \ - lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \ - else +#define PRE_INIT \ + if(1) { \ + lib->w.lib = dlopen(libbsdName, RTLD_LAZY | RTLD_GLOBAL); \ + if(!lib->w.lib) lib->w.lib = dlopen(ALTNAME, RTLD_LAZY | RTLD_GLOBAL); \ + if(!lib->w.lib) lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \ + } else #endif // define all standard library functions diff --git a/src/wrapped/wrappedlibbsd_private.h b/src/wrapped/wrappedlibbsd_private.h index bded8d1..bc37a27 100644 --- a/src/wrapped/wrappedlibbsd_private.h +++ b/src/wrapped/wrappedlibbsd_private.h @@ -8,7 +8,7 @@ GO(arc4random_buf, vFpL) GO(arc4random_stir, vFv) GO(arc4random_uniform, uFu) //GO(bsd_getopt, -//GO(closefrom, +GO(closefrom, iFi) //GO(dehumanize_number, //GO(errc, //GO(expand_number, @@ -108,5 +108,5 @@ GO(setprogname, vFp) //GO(vis, //GO(vwarnc, //GO(warnc, -//GO(wcslcat, -//GO(wcslcpy, +GO(wcslcat, LFppL) +GO(wcslcpy, LFppL) diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index b27e931..bfe7acf 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -1,6 +1,24 @@ #define _LARGEFILE_SOURCE 1 #define _FILE_OFFSET_BITS 64 #define _GNU_SOURCE /* See feature_test_macros(7) */ +#if !defined(TERMUX) && !defined(ANDROID) +# if defined(__has_include) +# if __has_include() +# include +# define HAVE_ARGP 1 +# endif +# else +# include +# define HAVE_ARGP 1 +# endif +#endif +#ifndef HAVE_ARGP +struct argp; +struct argp_state; +#endif +#ifdef STATICBUILD +extern int _nl_msg_cat_cntr __attribute__((weak)); +#endif #include #include #include @@ -41,13 +59,16 @@ #include #include #include +#include #undef LOG_INFO #undef LOG_DEBUG #include "wrappedlibs.h" +#include "os.h" #include "box64stack.h" #include "x64emu.h" +#include "box64cpu.h" #include "debug.h" #include "wrapper.h" #include "bridge.h" @@ -63,7 +84,11 @@ #include "elfloader.h" #include "bridge.h" #include "globalsymbols.h" -#include "rcfile.h" +#include "env.h" +#include "wine_tools.h" +#include "pe_tools.h" +#include "cleanup.h" +#include "random.h" #ifndef LOG_INFO #define LOG_INFO 1 #endif @@ -73,13 +98,8 @@ #define LIBNAME libc -const char* libcName = -#ifdef ANDROID - "libc.so" -#else - "libc.so.6" -#endif - ; +const char* libcName = "libc.so.6"; +#define ALTNAME "libc.so" typedef int (*iFi_t)(int); typedef int (*iFp_t)(void*); @@ -100,20 +120,38 @@ typedef int32_t (*iFippi_t)(int32_t, void*, void*, int32_t); typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*); typedef int32_t (*iFppii_t)(void*, void*, int32_t, int32_t); -typedef int32_t (*iFipuu_t)(int32_t, void*, uint32_t, uint32_t); +typedef int32_t (*iFipiup_t)(int, void*, int, uint32_t, void*); typedef int32_t (*iFipiI_t)(int32_t, void*, int32_t, int64_t); +typedef int32_t (*iFipuu_t)(int32_t, void*, uint32_t, uint32_t); typedef int32_t (*iFipuup_t)(int32_t, void*, uint32_t, uint32_t, void*); typedef int32_t (*iFiiV_t)(int32_t, int32_t, ...); typedef void* (*pFp_t)(void*); typedef void* (*pFpip_t)(void*, int, void*); -#define SUPER() \ - GO(_ITM_addUserCommitAction, iFpup_t) \ - GO(_IO_file_stat, iFpp_t) \ - GO(fts64_open, pFpip_t) \ - GO(register_printf_specifier, iFipp_t) \ - GO(register_printf_type, iFp_t) +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedlibctypes.h" + +EXPORT uintptr_t my_error_print_progname = 0; +static void (*native_error_print_progname)(void) = NULL; + +static void my_wrap_error_print_progname(void) +{ + if (my_error_print_progname) { + RunFunctionFmt(my_error_print_progname, "v"); + return; + } + if (native_error_print_progname) + native_error_print_progname(); +} +#define ADDED_INIT() \ + void (**p)(void); \ + p = (void (**)(void))dlsym(lib->w.lib, "error_print_progname"); \ + if (p) { \ + native_error_print_progname = *p; \ + *p = my_wrap_error_print_progname; \ + } #include "wrappercallback.h" @@ -451,8 +489,87 @@ static void* findprintf_typeFct(void* fct) return NULL; } +// parse_type +#define GO(A) \ + static uintptr_t my_argp_parser_fct_##A = 0; \ + static int my_argp_parser_##A(int a, void* b, void* c) \ + { \ + return RunFunctionFmt(my_argp_parser_fct_##A, "ipp", a, b, c); \ + } +SUPER() +#undef GO +static void* find_argp_parser_Fct(void* fct) +{ + if (!fct) return NULL; + void* p; + if ((p = GetNativeFnc((uintptr_t)fct))) return p; +#define GO(A) \ + if (my_argp_parser_fct_##A == (uintptr_t)fct) return my_argp_parser_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_argp_parser_fct_##A == 0) { \ + my_argp_parser_fct_##A = (uintptr_t)fct; \ + return my_argp_parser_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc argp_parser callback\n"); + return NULL; +} + +// help_filter +#define GO(A) \ + static uintptr_t my_help_filter_fct_##A = 0; \ + static void* my_help_filter_##A(int a, void* b, void* c) \ + { \ + return (void*)(uintptr_t)RunFunctionFmt(my_help_filter_fct_##A, "ipp", a, b, c); \ + } +SUPER() +#undef GO +static void* find_help_filter_Fct(void* fct) +{ + if (!fct) return NULL; + void* p; + if ((p = GetNativeFnc((uintptr_t)fct))) return p; +#define GO(A) \ + if (my_help_filter_fct_##A == (uintptr_t)fct) return my_help_filter_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_help_filter_fct_##A == 0) { \ + my_help_filter_fct_##A = (uintptr_t)fct; \ + return my_help_filter_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc help_filter callback\n"); + return NULL; +} + #undef SUPER +EXPORT int my_argp_parse(x64emu_t* emu, struct argp* argp, int argc, char** argv, int flags, int* index, void* input) +{ +#if defined(HAVE_ARGP) + if (!argp) { + return argp_parse(argp, argc, argv, flags, index, input); + } + struct argp local = *argp; + if (local.parser) { + local.parser = find_argp_parser_Fct((void*)local.parser); + } + if (local.help_filter) { + local.help_filter = find_help_filter_Fct((void*)local.help_filter); + } + return argp_parse(&local, argc, argv, flags, index, input); +#else + (void)emu; (void)argp; (void)argc; (void)argv; (void)flags; (void)index; (void)input; + printf_log(LOG_NONE, "Warning: unsupported argp_parse called, expecting failure\n"); + return -1; +#endif +} + // some my_XXX declare and defines int32_t my___libc_start_main(x64emu_t* emu, int (*main) (int, char * *, char * *), int argc, char * * ubp_av, void (*init) (void), void (*fini) (void), @@ -472,8 +589,8 @@ void EXPORT my___stack_chk_fail(x64emu_t* emu) #else sprintf(buff, "%p: Stack is corrupted, aborting\n", (void*)emu->old_ip); #endif - if(cycle_log) { - print_cycle_log(LOG_INFO); + if(BOX64ENV(rolling_log)) { + print_rolling_log(LOG_INFO); } StopEmu(emu, buff, emu->segs[_CS]==0x23); } @@ -535,17 +652,17 @@ pid_t EXPORT my_fork(x64emu_t* emu) if(type == EMUTYPE_MAIN) thread_set_emu(emu); if(v<0) { - printf_log(LOG_NONE, "BOX64: Warning, fork errored... (%d)\n", v); + printf_log(LOG_NONE, "Warning, fork errored... (%d)\n", v); // error... } else if(v>0) { // execute atforks parent functions - for (int i=0; iatfork_sz; --i) + for (int i=0; iatfork_sz; ++i) if(my_context->atforks[i].parent) RunFunctionWithEmu(emu, 0, my_context->atforks[i].parent, 0); } else /*if(v==0)*/ { // execute atforks child functions - for (int i=0; iatfork_sz; --i) + for (int i=0; iatfork_sz; ++i) if(my_context->atforks[i].child) RunFunctionWithEmu(emu, 0, my_context->atforks[i].child, 0); } @@ -584,7 +701,7 @@ int EXPORT my_uname(struct utsname *buf) #define X86_O_NONBLOCK 0x800 // octal 04000 #define X86_O_SYNC 0x101000 // octal 04010000 #define X86_O_DSYNC 0x1000 // octal 010000 -#define X86_O_RSYNC O_SYNC +#define X86_O_RSYNC X86_O_SYNC #define X86_FASYNC 020000 #define X86_O_DIRECT 040000 #define X86_O_LARGEFILE 0100000 @@ -653,8 +770,15 @@ int of_unconvert(int a) #define GO(A) if((a&(A))==(A)) {a&=~(A); b|=(X86_##A);} SUPER(); #undef GO - // flags 0x20000 unknown?! - if(a && (a&~0x20000)) { + int missing = 0; + #ifdef ARM64 + if(!O_LARGEFILE) { + if((a&(0400000))==(0400000)) {a&=~(0400000); b|=(X86_O_LARGEFILE);} + } + #else + if(!O_LARGEFILE) missing |= X86_O_LARGEFILE; + #endif + if(a && (a&~missing)) { printf_log(LOG_NONE, "Warning, of_unconvert(...) left over 0x%x, converted 0x%x\n", a, b); } return a|b; @@ -662,6 +786,7 @@ int of_unconvert(int a) #undef SUPER EXPORT void* my__ZGTtnaX (size_t a) { (void)a; printf("warning _ZGTtnaX called\n"); return NULL; } +EXPORT void* my__ZGTtnam (size_t a) { (void)a; printf("warning _ZGTtnam called\n"); return NULL; } EXPORT void my__ZGTtdlPv (void* a) { (void)a; printf("warning _ZGTtdlPv called\n"); } EXPORT uint8_t my__ITM_RU1(const uint8_t * a) { (void)a; printf("warning _ITM_RU1 called\n"); return 0; } EXPORT uint32_t my__ITM_RU4(const uint32_t * a) { (void)a; printf("warning _ITM_RU4 called\n"); return 0; } @@ -690,9 +815,16 @@ EXPORT int my___printf_chk(x64emu_t *emu, int chk, void* fmt, void* b) PREPARE_VALIST; return vprintf((const char*)fmt, VARARGS); } +extern int box64_stdout_no_w; EXPORT int my_wprintf(x64emu_t *emu, void* fmt, void* b) { myStackAlignW(emu, (const char*)fmt, b, emu->scratch, R_EAX, 1); PREPARE_VALIST; + if(box64_stdout_no_w) { + wchar_t buff[2048]; + int ret = vswprintf(buff, 2047, fmt, VARARGS); + printf("%S", buff); + return ret; + } return vwprintf((const wchar_t*)fmt, VARARGS); } EXPORT int my___wprintf_chk(x64emu_t *emu, int chk, void* fmt, void* b) @@ -898,6 +1030,14 @@ EXPORT int my_vsprintf(x64emu_t* emu, void* buff, void * fmt, x64_va_list_t b) } EXPORT int my___vsprintf_chk(x64emu_t* emu, void* buff, void * fmt, x64_va_list_t b) __attribute__((alias("my_vsprintf"))); +EXPORT int my_scanf(x64emu_t* emu, void* fmt, uint64_t* b) +{ + myStackAlignScanf(emu, (const char*)fmt, b, emu->scratch, 1); + PREPARE_VALIST; + + return vscanf(fmt, VARARGS); +} + EXPORT int my_vfscanf(x64emu_t* emu, void* stream, void* fmt, x64_va_list_t b) { (void)emu; @@ -924,6 +1064,38 @@ EXPORT int my_vsscanf(x64emu_t* emu, void* stream, void* fmt, x64_va_list_t b) EXPORT int my___vsscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my_vsscanf"))); +EXPORT int my_vfwscanf(x64emu_t* emu, void* F, void* fmt, x64_va_list_t b) +{ + (void)emu; + #ifdef CONVERT_VALIST + CONVERT_VALIST(b); + #else + myStackAlignScanfWValist(emu, (const char*)fmt, emu->scratch, b); + PREPARE_VALIST; + #endif + return vfwscanf(F, fmt, VARARGS); +} + +EXPORT int my_vwscanf(x64emu_t* emu, void* fmt, x64_va_list_t b) +{ + (void)emu; + #ifdef CONVERT_VALIST + CONVERT_VALIST(b); + #else + myStackAlignScanfWValist(emu, (const char*)fmt, emu->scratch, b); + PREPARE_VALIST; + #endif + return vwscanf(fmt, VARARGS); +} + +EXPORT int my_wscanf(x64emu_t* emu, void* fmt, uint64_t* b) +{ + myStackAlignScanfW(emu, (const char*)fmt, b, emu->scratch, 1); + PREPARE_VALIST; + + return vwscanf(fmt, VARARGS); +} + EXPORT int my_vswscanf(x64emu_t* emu, void* stream, void* fmt, x64_va_list_t b) { (void)emu; @@ -988,12 +1160,20 @@ EXPORT int my___isoc99_sscanf(x64emu_t* emu, void* stream, void* fmt, uint64_t* EXPORT int my___isoc99_swscanf(x64emu_t* emu, void* stream, void* fmt, uint64_t* b) { - myStackAlignScanf(emu, (const char*)fmt, b, emu->scratch, 2); + myStackAlignScanfW(emu, (const char*)fmt, b, emu->scratch, 2); PREPARE_VALIST; return vswscanf(stream, fmt, VARARGS); } +EXPORT int my___isoc23_swscanf(x64emu_t* emu, void* stream, void* fmt, uint64_t* b) +{ + myStackAlignScanfW(emu, (const char*)fmt, b, emu->scratch, 2); + PREPARE_VALIST; + + return vswscanf(stream, fmt, VARARGS); +} + EXPORT int my_vsnprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) { (void)emu; #ifdef CONVERT_VALIST @@ -1074,31 +1254,57 @@ EXPORT int my_swscanf(x64emu_t* emu, void* stream, void* fmt, uint64_t* b) return vswscanf(stream, fmt, VARARGS); } -#if 0 -EXPORT void my_verr(x64emu_t* emu, int eval, void* fmt, void* b) { - #ifndef NOALIGN - myStackAlignW((const char*)fmt, (uint32_t*)b, emu->scratch); +EXPORT void my_argp_error(x64emu_t *emu, void* state, void* fmt, void* b) { +#if defined(HAVE_ARGP) + if(!fmt) { + argp_error(state, NULL); + return; + } + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2); PREPARE_VALIST; - void* f = verr; - ((vFipp_t)f)(eval, fmt, VARARGS); - #else - void* f = verr; - ((vFipp_t)f)(eval, fmt, (uint32_t*)b); - #endif + argp_error(state, fmt, VARARGS); +#else + (void)emu; (void)state; (void)fmt; (void)b; +#endif } -EXPORT void my_vwarn(x64emu_t* emu, void* fmt, void* b) { - #ifndef NOALIGN - myStackAlignW((const char*)fmt, (uint32_t*)b, emu->scratch); +EXPORT void my_error(x64emu_t *emu, int status, int errnum, void* fmt, void* b) { + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 3); + PREPARE_VALIST; + char buf[512]; + vsnprintf(buf, 512, (const char*)fmt, VARARGS); + error(status, errnum, "%s", buf); +} +EXPORT void my_error_at_line(x64emu_t *emu, int status, int errnum, void* filename, uint32_t linenum, void* fmt, void* b) { + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 5); + PREPARE_VALIST; + char buf[512]; + vsnprintf(buf, 512, (const char*)fmt, VARARGS); + error_at_line(status, errnum, filename, linenum, "%s", buf); +} + +EXPORT void my_verr(x64emu_t* emu, int eval, void* fmt, x64_va_list_t b) { + if (!fmt) + return err(eval, NULL); + #ifdef CONVERT_VALIST + (void)emu; + CONVERT_VALIST(b); + #else + myStackAlignValist(emu, (const char*)fmt, emu->scratch, b); PREPARE_VALIST; - void* f = vwarn; - ((vFpp_t)f)(fmt, VARARGS); + #endif + return verr(eval, fmt, VARARGS); +} +EXPORT void my_verrx(x64emu_t* emu, int eval, void* fmt, x64_va_list_t b) { + #ifdef CONVERT_VALIST + (void)emu; + CONVERT_VALIST(b); #else - void* f = vwarn; - ((vFpp_t)f)(fmt, (uint32_t*)b); + myStackAlignValist(emu, (const char*)fmt, emu->scratch, b); + PREPARE_VALIST; #endif + return verrx(eval, fmt, VARARGS); } -#endif EXPORT void my_err(x64emu_t *emu, int eval, void* fmt, void* b) { myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2); PREPARE_VALIST; @@ -1109,6 +1315,45 @@ EXPORT void my_errx(x64emu_t *emu, int eval, void* fmt, void* b) { PREPARE_VALIST; verrx(eval, (const char*)fmt, VARARGS); } +EXPORT void my_vwarn(x64emu_t* emu, void* fmt, x64_va_list_t b) { + if (!fmt) + return warn(NULL); + #ifdef CONVERT_VALIST + (void)emu; + CONVERT_VALIST(b); + #else + myStackAlignValist(emu, (const char*)fmt, emu->scratch, b); + PREPARE_VALIST; + #endif + return vwarn(fmt, VARARGS); +} +EXPORT void my_vwarnx(x64emu_t* emu, void* fmt, x64_va_list_t b) { + if (!fmt) + return warnx(NULL); + #ifdef CONVERT_VALIST + (void)emu; + CONVERT_VALIST(b); + #else + myStackAlignValist(emu, (const char*)fmt, emu->scratch, b); + PREPARE_VALIST; + #endif + return vwarnx(fmt, VARARGS); +} + +EXPORT void my_argp_failure(x64emu_t* emu, void* state, int status, int errnum, void* fmt, void* b) { +#if defined(HAVE_ARGP) + if(!fmt) { + argp_failure(state, status, errnum, NULL); + return; + } + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 4); + PREPARE_VALIST; + argp_failure(state, status, errnum, fmt, VARARGS); +#else + (void)emu; (void)state; (void)status; (void)errnum; (void)fmt; (void)b; +#endif +} + EXPORT void my_warn(x64emu_t *emu, void* fmt, void* b) { myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 1); PREPARE_VALIST; @@ -1198,15 +1443,23 @@ EXPORT int my___fxstat(x64emu_t *emu, int vers, int fd, void* buf) UnalignStat64(&st, buf); return r; } +EXPORT int my___fxstat64(x64emu_t *emu, int vers, int fd, void* buf) __attribute__((alias("my___fxstat"))); -EXPORT int my___fxstat64(x64emu_t *emu, int vers, int fd, void* buf) +EXPORT int my_statx(x64emu_t* emu, int dirfd, void* path, int flags, uint32_t mask, void* buf) { - (void)emu; (void)vers; - struct stat64 st; - int r = fstat64(fd, buf?&st:buf); - if(buf && !r) - UnalignStat64(&st, buf); - return r; + if(my->statx) + return my->statx(dirfd, path, flags, mask, buf); + #ifdef __NR_statx + int ret = syscall(__NR_statx, dirfd, path, flags, mask, buf); + if(ret<0) { + errno = -ret; + ret = -1; + } + return ret; + #else + errno = ENOSYS; + return -1; + #endif } EXPORT int my___xmknod(x64emu_t* emu, int v, char* path, uint32_t mode, dev_t* dev) @@ -1232,16 +1485,7 @@ EXPORT int my___xstat(x64emu_t* emu, int v, void* path, void* buf) UnalignStat64(&st, buf); return r; } - -EXPORT int my___xstat64(x64emu_t* emu, int v, void* path, void* buf) -{ - (void)emu; (void)v; - struct stat64 st; - int r = stat64((const char*)path, buf?&st:buf); - if(buf && !r) - UnalignStat64(&st, buf); - return r; -} +EXPORT int my___xstat64(x64emu_t* emu, int v, void* path, void* buf) __attribute__((alias("my___xstat"))); EXPORT int my___lxstat(x64emu_t* emu, int v, void* name, void* buf) { @@ -1252,16 +1496,7 @@ EXPORT int my___lxstat(x64emu_t* emu, int v, void* name, void* buf) UnalignStat64(&st, buf); return r; } - -EXPORT int my___lxstat64(x64emu_t* emu, int v, void* name, void* buf) -{ - (void)emu; (void)v; - struct stat64 st; - int r = lstat64((const char*)name, buf?&st:buf); - if(buf && !r) - UnalignStat64(&st, buf); - return r; -} +EXPORT int my___lxstat64(x64emu_t* emu, int v, void* name, void* buf) __attribute__((alias("my___lxstat"))); EXPORT int my___fxstatat(x64emu_t* emu, int v, int d, void* path, void* buf, int flags) { @@ -1272,16 +1507,7 @@ EXPORT int my___fxstatat(x64emu_t* emu, int v, int d, void* path, void* buf, int UnalignStat64(&st, buf); return r; } - -EXPORT int my___fxstatat64(x64emu_t* emu, int v, int d, void* path, void* buf, int flags) -{ - (void)emu; (void)v; - struct stat64 st; - int r = fstatat64(d, path, &st, flags); - if(!r) - UnalignStat64(&st, buf); - return r; -} +EXPORT int my___fxstatat64(x64emu_t* emu, int v, int d, void* path, void* buf, int flags) __attribute__((alias("my___fxstatat"))); EXPORT int my_stat(x64emu_t *emu, void* filename, void* buf) { @@ -1437,6 +1663,24 @@ EXPORT void* my_tsearch(x64emu_t* emu, void* key, void* root, void* fnc) (void)emu; return tsearch(key, root, findcompareFct(fnc)); } + +EXPORT int my___sysctl(x64emu_t* emu, int* name, int nlen, void* oldval, size_t* oldlenp, void* newval, size_t newlen) +{ + return ENOSYS; +} + +EXPORT int my_sysctl(x64emu_t* emu, int* name, int nlen, void* oldval, size_t* oldlenp, void* newval, size_t newlen) +{ + /* Glibc 2.32 Release note. + The deprecated header and the sysctl function have been + removed. To support old binaries, the sysctl function continues to + exist as a compatibility symbol (on those architectures which had it), + but always fails with ENOSYS. This reflects the removal of the system + call from all architectures, starting with Linux 5.5. + */ + return ENOSYS; +} + EXPORT void my_tdestroy(x64emu_t* emu, void* root, void* fnc) { (void)emu; @@ -1486,7 +1730,7 @@ struct i386_dirent { EXPORT void* my_readdir(x64emu_t* emu, void* dirp) { - if (fix_64bit_inodes) + if (BOX64ENV(fix_64bit_inodes)) { struct dirent64 *dp64 = readdir64((DIR *)dirp); if (!dp64) return NULL; @@ -1514,7 +1758,7 @@ EXPORT void* my_readdir(x64emu_t* emu, void* dirp) EXPORT int32_t my_readdir_r(x64emu_t* emu, void* dirp, void* entry, void** result) { struct dirent64 d64, *dp64; - if (fix_64bit_inodes && (sizeof(d64.d_name) > 1)) + if (BOX64ENV(fix_64bit_inodes) && (sizeof(d64.d_name) > 1)) { static iFppp_t f = NULL; if(!f) { @@ -1587,8 +1831,8 @@ static int isProcSelf(const char *path, const char* w) static int isSysCpuCache(const char *path, const char* w, int* _cpu, int* _index) { - char tmp[128]; - int cpu, index; + char tmp[128] = {0}; + int cpu=0, index=0; if(sscanf(path, "/sys/devices/system/cpu/cpu%d/cache/index%d/%s", &cpu, &index, tmp)!=3) return 0; if(strcmp(tmp, w)) @@ -1598,6 +1842,14 @@ static int isSysCpuCache(const char *path, const char* w, int* _cpu, int* _index return 1; } +static long isProcMem(const char* path) +{ + long pid; + if(sscanf(path, "/proc/%ld/mem", &pid)==1) + return pid; + return 0; +} + EXPORT ssize_t my_readlink(x64emu_t* emu, void* path, void* buf, size_t sz) { if(isProcSelf((const char*)path, "exe")) { @@ -1607,26 +1859,17 @@ EXPORT ssize_t my_readlink(x64emu_t* emu, void* path, void* buf, size_t sz) return readlink((const char*)path, (char*)buf, sz); } -int getNCpu(); // defined in my_cpuid.c -const char* getBoxCpuName(); // defined in my_cpuid.c -const char* getCpuName(); // defined in my_cpu_id.c -double getBogoMips(); // defined in my_cpu_id.c +EXPORT ssize_t my___readlink_chk(x64emu_t* emu, void* path, void* buf, size_t sz, size_t buflen) +{ + return my_readlink(emu, path, buf, sz); +} #ifndef NOALIGN void CreateCPUInfoFile(int fd) { size_t dummy; char buff[600]; - double freq = 600.0; // default to 600 MHz - // try to get actual ARM max speed: - FILE *f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", "r"); - if(f) { - int r; - if(1==fscanf(f, "%d", &r)) - freq = r/1000.; - fclose(f); - } - int n = getNCpu(); + int n = box64_sysinfo.box64_ncpu; // generate fake CPUINFO #define P \ dummy = write(fd, buff, strlen(buff)) @@ -1639,11 +1882,11 @@ void CreateCPUInfoFile(int fd) P; sprintf(buff, "model\t\t: 1\n"); P; - sprintf(buff, "model name\t: %s\n", getBoxCpuName()); + sprintf(buff, "model name\t: %s\n", box64_sysinfo.cpuname); P; sprintf(buff, "stepping\t: 1\nmicrocode\t: 0x10\n"); P; - sprintf(buff, "cpu MHz\t\t: %g\n", freq); + sprintf(buff, "cpu MHz\t\t: %g\n", box64_sysinfo.frequency / 1000000.); P; sprintf(buff, "cache size\t: %d\n", 4096); P; @@ -1651,9 +1894,19 @@ void CreateCPUInfoFile(int fd) P; sprintf(buff, "core id\t\t: %d\ncpu cores\t: %d\n", i, n); P; - sprintf(buff, "bogomips\t: %g\n", getBogoMips()); + sprintf(buff, "bogomips\t: %g\n", box64_sysinfo.bogomips / 1000000.); P; - sprintf(buff, "flags\t\t: fpu cx8 sep ht cmov clflush mmx sse sse2 syscall tsc lahf_lm ssse3 ht tm lm fxsr cpuid pclmulqdq cx16 aes movbe pni sse4_1%s%s lzcnt popcnt%s%s%s%s%s\n", box64_sse42?" sse4_2":"", box64_avx?" avx":"", box64_avx?" bmi1":"", box64_avx2?" avx2":"", box64_avx?" bmi2":"", box64_avx2?" vaes":"", box64_avx2?" fma":""); + sprintf(buff, "flags\t\t: fpu cx8 sep ht cmov clflush mmx sse sse2 syscall tsc lahf_lm ssse3 ht tm lm fxsr cpuid"\ + "%s cx16%s movbe pni "\ + "sse4_1%s%s%s lzcnt popcnt%s%s%s%s%s%s%s%s%s\n", + BOX64ENV(pclmulqdq)?" pclmulqdq":"", + BOX64ENV(aes)?" aes":"", + BOX64ENV(sse42)?" sse4_2":"", BOX64ENV(avx)?" avx":"", BOX64ENV(shaext)?"sha_ni":"", + BOX64ENV(avx)?" bmi1":"", BOX64ENV(avx2)?" avx2":"", BOX64ENV(avx)?" bmi2":"", + (BOX64ENV(avx2)&&BOX64ENV(aes))?" vaes":"", BOX64ENV(avx2)?" fma":"", + BOX64ENV(avx)?" xsave":"", BOX64ENV(avx)?" f16c":"", BOX64ENV(avx2)?" randr":"", + BOX64ENV(avx2)?" adx":"" + ); P; sprintf(buff, "address sizes\t: 48 bits physical, 48 bits virtual\n"); P; @@ -1667,7 +1920,7 @@ void CreateCPUPresentFile(int fd) { size_t dummy; char buff[600]; - int n = getNCpu(); + int n = box64_sysinfo.box64_ncpu; // generate fake CPUINFO sprintf(buff, "0-%d\n", n-1); dummy = write(fd, buff, strlen(buff)); @@ -1807,7 +2060,35 @@ EXPORT int32_t my_open(x64emu_t* emu, void* pathname, int32_t flags, uint32_t mo lseek(tmp, 0, SEEK_SET); return tmp; } + if(box64_wine && isProcMem(pathname) && (mode&O_WRONLY)) { + // deny using proc/XX/mem as it messes up with dynarec memory protection & tracking + return -1; + } #endif + + if (!strcmp((const char*)pathname, "box64-custom-bashrc-file")) { + int tmp = shm_open("box64-custom-bashrc-file", O_RDWR | O_CREAT, S_IRWXU); + if (tmp < 0) return open(pathname, flags, mode); // error fallback + shm_unlink("box64-custom-bashrc-file"); + const char* content = "if [ -f ~/.bashrc ]\nthen\n. ~/.bashrc\nfi\nexport PS1=\"(box64) \"$PS1\nexport BOX64_NOBANNER=1\nexport BOX64_LOG=0\n"; + size_t dummy; + dummy = write(tmp, content, strlen(content)); + (void)dummy; + lseek(tmp, 0, SEEK_SET); + return tmp; + } + + if(!strcmp((const char*)pathname, "/etc/os-release")) { + char* pv = getenv("BOX64_PRESSURE_VESSEL_FILES"); + if(pv) { + char tmp[MAX_PATH] = {0}; + snprintf(tmp, sizeof(tmp)-1, "%s/lib/os-release", pv); + if(FileExist(tmp, IS_FILE)) { + return open(tmp, flags, mode); + } + } + } + int ret = open(pathname, flags, mode); return ret; } @@ -1885,7 +2166,7 @@ EXPORT int32_t my_open64(x64emu_t* emu, void* pathname, int32_t flags, uint32_t lseek(tmp, 0, SEEK_SET); return tmp; } - if(box64_maxcpu && (!strcmp(pathname, "/sys/devices/system/cpu/present") || !strcmp(pathname, "/sys/devices/system/cpu/online")) && (getNCpu()>=box64_maxcpu)) { + if (BOX64ENV(maxcpu) && (!strcmp(pathname, "/sys/devices/system/cpu/present") || !strcmp(pathname, "/sys/devices/system/cpu/online")) && (box64_sysinfo.ncpu >= BOX64ENV(maxcpu))) { // special case for cpu present (to limit to 64 cores) int tmp = shm_open(TMP_CPUPRESENT, O_RDWR | O_CREAT, S_IRWXU); if(tmp<0) return open64(pathname, mode); // error fallback @@ -1956,7 +2237,7 @@ EXPORT FILE* my_fopen64(x64emu_t* emu, const char* path, const char* mode) lseek(tmp, 0, SEEK_SET); return fdopen(tmp, mode); } - if(box64_maxcpu && (!strcmp(path, "/sys/devices/system/cpu/present") || !strcmp(path, "/sys/devices/system/cpu/online")) && (getNCpu()>=box64_maxcpu)) { + if (BOX64ENV(maxcpu) && (!strcmp(path, "/sys/devices/system/cpu/present") || !strcmp(path, "/sys/devices/system/cpu/online")) && (box64_sysinfo.ncpu >= BOX64ENV(maxcpu))) { // special case for cpu present (to limit to 64 cores) int tmp = shm_open(TMP_CPUPRESENT, O_RDWR | O_CREAT, S_IRWXU); if(tmp<0) return fopen64(path, mode); // error fallback @@ -1974,7 +2255,7 @@ EXPORT FILE* my_fopen64(x64emu_t* emu, const char* path, const char* mode) lseek(tmp, 0, SEEK_SET); return fdopen(tmp, mode); } - int cpu, index; + int cpu=0, index=0; if(isSysCpuCache(path, "ways_of_associativity", &cpu, &index) && !FileExist(path, IS_FILE)) { // Create a dummy one int tmp = shm_open(TMP_CPUCACHE_ASSOC, O_RDWR | O_CREAT, S_IRWXU); @@ -2023,23 +2304,6 @@ EXPORT int32_t my_ftw(x64emu_t* emu, void* pathname, void* B, int32_t nopenfd) return f(pathname, findftwFct(B), nopenfd); } -EXPORT int32_t my_nftw(x64emu_t* emu, void* pathname, void* B, int32_t nopenfd, int32_t flags) -{ - static iFppii_t f = NULL; - if(!f) { - library_t* lib = my_lib; - if(!lib) return 0; - f = (iFppii_t)dlsym(lib->w.lib, "nftw"); - } - - return f(pathname, findnftwFct(B), nopenfd, flags); -} - -EXPORT void* my_ldiv(x64emu_t* emu, void* p, int32_t num, int32_t den) -{ - *((ldiv_t*)p) = ldiv(num, den); - return p; -} #endif #ifndef NOALIGN @@ -2068,6 +2332,26 @@ EXPORT int32_t my_epoll_pwait(x64emu_t* emu, int32_t epfd, void* events, int32_t UnalignEpollEvent(events, _events, ret); return ret; } +EXPORT int32_t my_epoll_pwait2(x64emu_t* emu, int epfd, void* events, int maxevents, struct timespec *timeout, sigset_t * sigmask) +{ + struct epoll_event _events[maxevents]; + //AlignEpollEvent(_events, events, maxevents); + int ret = 0; + if(!my->epoll_pwait2) { + // epoll_pwait2 doesn't exist, to tranforming timeout to int, and from nanosecods to milliseconds... + int tout = -1; + if(timeout) { + int64_t tmp = (timeout->tv_nsec + timeout->tv_sec*1000000000LL)/1000000LL; + if(tmp>1<<31) tmp = 1<<31; + tout = tmp; + } + ret = epoll_pwait(epfd, events?_events:NULL, maxevents, tout, sigmask); + } else + ret = my->epoll_pwait2(epfd, events?_events:NULL, maxevents, timeout, sigmask); + if(ret>0) + UnalignEpollEvent(events, _events, ret); + return ret; +} #endif #ifndef ANDROID @@ -2104,6 +2388,7 @@ EXPORT int32_t my_nftw64(x64emu_t* emu, void* pathname, void* B, int32_t nopenfd (void)emu; return nftw64(pathname, findnftw64Fct(B), nopenfd, flags); } +EXPORT int my_nftw(x64emu_t* emu, void* pathname, void* B, int32_t nopenfd, int32_t flags) __attribute__((alias("my_nftw64"))); EXPORT char** my_environ = NULL; EXPORT char** my__environ = NULL; @@ -2128,7 +2413,7 @@ EXPORT int32_t my_execv(x64emu_t* emu, const char* path, char* const argv[]) const char** newargv = (const char**)box_calloc(n+toadd+2, sizeof(char*)); newargv[0] = x86?emu->context->box86path:emu->context->box64path; if(script) newargv[1] = emu->context->bashpath; // script needs to be launched with bash - memcpy(newargv+toadd, argv+skip_first, sizeof(char*)*(n+toadd)); + memcpy(newargv+toadd, argv+skip_first, sizeof(char*)*(n+1-skip_first)); if(self) newargv[1] = emu->context->fullpath; else { @@ -2142,14 +2427,7 @@ EXPORT int32_t my_execv(x64emu_t* emu, const char* path, char* const argv[]) if(my_environ!=my_context->envv) envv = my_environ; if(my__environ!=my_context->envv) envv = my__environ; if(my___environ!=my_context->envv) envv = my___environ; -/*if(!envv && n>2 && strstr(newargv[2], "fxc.exe")) { -setenv("BOX64_LOG", "2", 1); -setenv("BOX64_TRACE_FILE", "/home/seb/trace-%pid.txt", 1); -setenv("BOX64_TRACE","server_init_process_done", 1); -setenv("BOX64_DYNAREC", "0", 1); -setenv("WINEDEBUG", "+server", 1); -//setenv("BOX64_DYNAREC", "0", 1); -}*/ + int ret; if(envv) ret = execve(newargv[0], (char* const*)newargv, envv); @@ -2168,24 +2446,35 @@ EXPORT int32_t my_execve(x64emu_t* emu, const char* path, char* const argv[], ch int x64 = FileIsX64ELF(path); int x86 = my_context->box86path?FileIsX86ELF(path):0; int script = (my_context->bashpath && FileIsShell(path))?1:0; - printf_log(LOG_DEBUG, "execve(\"%s\", %p[\"%s\", \"%s\", \"%s\"...], %p) is x64=%d x86=%d script=%d (my_context->envv=%p, environ=%p\n", path, argv, argv[0], argv[1]?argv[1]:"(nil)", argv[2]?argv[2]:"(nil)", envp, x64, x86, script, my_context->envv, environ); + int python = (my_context->pythonpath && FileIsPython(path))?1:0; + if(box64env.log>=LOG_DEBUG) { + printf_log(LOG_DEBUG, "execve(\"%s\", %p[\"%s\"", path, argv, argv[0]); + for(int i=1; argv[i]; ++i) + printf_log_prefix(0, LOG_DEBUG, ", \"%s\"", argv[i]); + printf_log_prefix(0, LOG_DEBUG, "], %p) is x64=%d x86=%d script=%d python=%d (my_context->envv=%p, environ=%p\n", envp, x64, x86, script, python, my_context->envv, environ); + } // hack to update the environ var if needed if(envp == my_context->envv && environ) { envp = environ; + } else if(box64env.log>=LOG_DEBUG) { + printf_log(LOG_DEBUG, "envv=[\"%s\'", envp[0]); + for(int i=1; envp[i]; ++i) + printf_log_prefix(0, LOG_DEBUG, ", \"%s\"", envp[i]); + printf_log_prefix(0, LOG_DEBUG, "]\n"); } - #if 1 - if (x64 || x86 || self || script) { + if (x64 || x86 || self || script || python) { int skip_first = 0; if(strlen(path)>=strlen("wine64-preloader") && strcmp(path+strlen(path)-strlen("wine64-preloader"), "wine64-preloader")==0) skip_first++; // count argv... int n=skip_first; while(argv[n]) ++n; - int toadd = script?2:1; + int toadd = (script || python)?2:1; const char** newargv = (const char**)alloca((n+1+toadd-skip_first)*sizeof(char*)); memset(newargv, 0, (n+1+toadd)*sizeof(char*)); newargv[0] = x86?emu->context->box86path:emu->context->box64path; if(script) newargv[1] = emu->context->bashpath; // script needs to be launched with bash + if(python) newargv[1] = emu->context->pythonpath; // script needs to be launched with bash memcpy(newargv+toadd, argv+skip_first, sizeof(char*)*(n+1-skip_first)); if(self) newargv[toadd] = emu->context->fullpath; else { @@ -2198,7 +2487,6 @@ EXPORT int32_t my_execve(x64emu_t* emu, const char* path, char* const argv[], ch int ret = execve(newargv[0], (char* const*)newargv, envp); return ret; } - #endif if(!strcmp(path + strlen(path) - strlen("/uname"), "/uname") && argv[1] && (!strcmp(argv[1], "-m") || !strcmp(argv[1], "-p") || !strcmp(argv[1], "-i")) && !argv[2]) { @@ -2276,16 +2564,18 @@ EXPORT int32_t my_execvp(x64emu_t* emu, const char* path, char* const argv[]) int x64 = FileIsX64ELF(fullpath); int x86 = my_context->box86path?FileIsX86ELF(fullpath):0; int script = (my_context->bashpath && FileIsShell(fullpath))?1:0; + int python = (my_context->pythonpath && FileIsPython(fullpath))?1:0; printf_log(LOG_DEBUG, "execvp(\"%s\", %p), IsX86=%d / fullpath=\"%s\"\n", path, argv, x64, fullpath); - if (x64 || x86 || script || self) { + if (x64 || x86 || script || python || self) { // count argv... int i=0; while(argv[i]) ++i; - int toadd = script?2:1; + int toadd = (script || python)?2:1; char** newargv = (char**)alloca((i+toadd+1)*sizeof(char*)); memset(newargv, 0, (i+toadd+1)*sizeof(char*)); newargv[0] = x86?emu->context->box86path:emu->context->box64path; if(script) newargv[1] = emu->context->bashpath; // script needs to be launched with bash + if(python) newargv[1] = emu->context->pythonpath; // script needs to be launched with bash for (int j=0; jcontext->fullpath; @@ -2323,16 +2613,70 @@ EXPORT int32_t my_execvp(x64emu_t* emu, const char* path, char* const argv[]) // fullpath is gone, so the search will only be on PATH, not on BOX64_PATH (is that an issue?) return execvp(path, argv); } - -EXPORT int32_t my_execl(x64emu_t* emu, const char* path) +// execvp should use PATH to search for the program first +EXPORT int32_t my_execvpe(x64emu_t* emu, const char* path, char* const argv[], char* const envp[]) { - int self = isProcSelf(path, "exe"); - int x64 = FileIsX64ELF(path); - int x86 = my_context->box86path?FileIsX86ELF(path):0; - int script = (my_context->bashpath && FileIsShell(path))?1:0; - printf_log(LOG_DEBUG, "execle(\"%s\", ...), IsX86=%d, self=%d\n", path, x64, self); - // count argv... - int i=0; + // need to use BOX64_PATH / PATH here... + char* fullpath = ResolveFileSoft(path, &my_context->box64_path); + // use fullpath... + int self = isProcSelf(fullpath, "exe"); + int x64 = FileIsX64ELF(fullpath); + int x86 = my_context->box86path?FileIsX86ELF(fullpath):0; + int script = (my_context->bashpath && FileIsShell(fullpath))?1:0; + printf_log(LOG_DEBUG, "execvpe(\"%s\", %p, %p), IsX86=%d / fullpath=\"%s\"\n", path, argv, envp, x64, fullpath); + // hack to update the environ var if needed + if(envp == my_context->envv && environ) { + envp = environ; + } + if (x64 || x86 || script || self) { + // count argv... + int i=0; + while(argv[i]) ++i; + int toadd = script?2:1; + char** newargv = (char**)alloca((i+toadd+1)*sizeof(char*)); + memset(newargv, 0, (i+toadd+1)*sizeof(char*)); + newargv[0] = x86?emu->context->box86path:emu->context->box64path; + if(script) newargv[1] = emu->context->bashpath; // script needs to be launched with bash + for (int j=0; jcontext->fullpath; + //else if(script) newargv[2] = fullpath; + else { + // TODO check if envp is not environ and add the value on a copy + if(strcmp(newargv[toadd], path)) + setenv(x86?"BOX86_ARG0":"BOX64_ARG0", newargv[toadd], 1); + newargv[toadd] = fullpath; + } + + printf_log(LOG_DEBUG, " => execvp(\"%s\", %p [\"%s\", \"%s\"...:%d])\n", newargv[0], newargv, newargv[1], i?newargv[2]:"", i); + int ret; + ret = execvpe(newargv[0], newargv, envp); + box_free(fullpath); + return ret; + } + if((!strcmp(path + strlen(path) - strlen("/uname"), "/uname") || !strcmp(path, "uname")) + && argv[1] && (!strcmp(argv[1], "-m") || !strcmp(argv[1], "-p") || !strcmp(argv[1], "-i")) + && !argv[2]) { + // uname -m is redirected to box64 -m + path = my_context->box64path; + char *argv2[3] = { my_context->box64path, argv[1], NULL }; + + return execvpe(path, argv2, envp); + } + + // fullpath is gone, so the search will only be on PATH, not on BOX64_PATH (is that an issue?) + return execvpe(path, argv, envp); +} + +EXPORT int32_t my_execl(x64emu_t* emu, const char* path) +{ + int self = isProcSelf(path, "exe"); + int x64 = FileIsX64ELF(path); + int x86 = my_context->box86path?FileIsX86ELF(path):0; + int script = (my_context->bashpath && FileIsShell(path))?1:0; + printf_log(LOG_DEBUG, "execl(\"%s\", ...), IsX86=%d, self=%d\n", path, x64, self); + // count argv... + int i=0; while(getVargN(emu, i+1)) ++i; int toadd = script?2:((x64||self)?1:0); char** newargv = (char**)box_calloc(i+toadd+1, sizeof(char*)); @@ -2343,7 +2687,7 @@ EXPORT int32_t my_execl(x64emu_t* emu, const char* path) for (int k=0; kcontext->fullpath; - printf_log(LOG_DEBUG, " => execle(\"%s\", %p [\"%s\", \"%s\"...:%d])\n", newargv[0], newargv, newargv[1], i?newargv[2]:"", i); + printf_log(LOG_DEBUG, " => execl(\"%s\", %p [\"%s\", \"%s\"...:%d])\n", newargv[0], newargv, newargv[1], i?newargv[2]:"", i); int ret = 0; if (!(x64 || x86 || script || self)) { ret = execv(path, newargv); @@ -2360,7 +2704,7 @@ EXPORT int32_t my_execle(x64emu_t* emu, const char* path) int x64 = FileIsX64ELF(path); int x86 = my_context->box86path?FileIsX86ELF(path):0; int script = (my_context->bashpath && FileIsShell(path))?1:0; - printf_log(LOG_DEBUG, "execl(\"%s\", ...), IsX86=%d, self=%d\n", path, x64, self); + printf_log(LOG_DEBUG, "execle(\"%s\", ...), IsX86=%d, self=%d\n", path, x64, self); // hack to update the environ var if needed // count argv... int i=0; @@ -2513,6 +2857,18 @@ EXPORT int32_t my___cxa_thread_atexit_impl(x64emu_t* emu, void* dtor, void* obj, return 0; } +EXPORT int32_t my_delete_module(x64emu_t* emu, const char* name, unsigned int flags) +{ + (void)emu; + return syscall(__NR_delete_module, name, flags); +} + +EXPORT int32_t my_init_module(x64emu_t* emu, void* module_image, unsigned long size, const char* param_values) +{ + (void)emu; + return syscall(__NR_init_module, module_image, size, param_values); +} + EXPORT int32_t my___register_atfork(x64emu_t *emu, void* prepare, void* parent, void* child, void* handle) { (void)emu; @@ -2521,10 +2877,11 @@ EXPORT int32_t my___register_atfork(x64emu_t *emu, void* prepare, void* parent, my_context->atfork_cap += 4; my_context->atforks = (atfork_fnc_t*)box_realloc(my_context->atforks, my_context->atfork_cap*sizeof(atfork_fnc_t)); } - my_context->atforks[my_context->atfork_sz].prepare = (uintptr_t)prepare; - my_context->atforks[my_context->atfork_sz].parent = (uintptr_t)parent; - my_context->atforks[my_context->atfork_sz].child = (uintptr_t)child; - my_context->atforks[my_context->atfork_sz].handle = handle; + int i = my_context->atfork_sz++; + my_context->atforks[i].prepare = (uintptr_t)prepare; + my_context->atforks[i].parent = (uintptr_t)parent; + my_context->atforks[i].child = (uintptr_t)child; + my_context->atforks[i].handle = handle; return 0; } @@ -2724,7 +3081,7 @@ void EXPORT my_longjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p, R_R15 = jpbuff->save_r15; R_RSP = jpbuff->save_rsp; // jmp to saved location, plus restore val to rax - R_RAX = __val; + R_RAX = __val?__val:1; R_RIP = jpbuff->save_rip; if(((__jmp_buf_tag_t*)p)->__mask_was_saved) { sigprocmask(SIG_SETMASK, &((__jmp_buf_tag_t*)p)->__saved_mask, NULL); @@ -2790,79 +3147,43 @@ EXPORT void* my_realpath(x64emu_t* emu, void* path, void* resolved_path) EXPORT int my_readlinkat(x64emu_t* emu, int fd, void* path, void* buf, size_t bufsize) { - if(isProcSelf(path, "exe")) { - strncpy(buf, emu->context->fullpath, bufsize); - size_t l = strlen(emu->context->fullpath); + if((fd==AT_FDCWD) && isProcSelf(path, "exe")) { + strncpy(buf, my_context->fullpath, bufsize); + size_t l = strlen(my_context->fullpath); return (l>bufsize)?bufsize:(l+1); } return readlinkat(fd, path, buf, bufsize); } -#ifndef MAP_FIXED_NOREPLACE -#define MAP_FIXED_NOREPLACE 0x200000 -#endif -#ifndef MAP_32BIT -#define MAP_32BIT 0x40 -#endif + +EXPORT ssize_t my___readlinkat_chk(x64emu_t* emu, int dirfd, void* path, void* buf, size_t sz, size_t buflen) +{ + return my_readlinkat(emu, dirfd, path, buf, sz); +} + extern int have48bits; -EXPORT void* my_mmap64(x64emu_t* emu, void *addr, unsigned long length, int prot, int flags, int fd, ssize_t offset) +void* last_mmap_addr[2] = {0}; +size_t last_mmap_len[2] = {0}; +int last_mmap_idx = 0; +#ifdef DYNAREC +void* last_mmap_0_addr = NULL; +size_t last_mmap_0_len = 0; +#endif +EXPORT void* my_mmap64(x64emu_t* emu, void *addr, size_t length, int prot, int flags, int fd, ssize_t offset) { (void)emu; - if(prot&PROT_WRITE) - prot|=PROT_READ; // PROT_READ is implicit with PROT_WRITE on i386 - if(emu && (box64_log>=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) {printf_log(LOG_NONE, "mmap64(%p, 0x%lx, 0x%x, 0x%x, %d, %ld) => ", addr, length, prot, flags, fd, offset);} - int new_flags = flags; - #ifndef NOALIGN - void* old_addr = addr; - new_flags&=~MAP_32BIT; // remove MAP_32BIT - if(flags&MAP_32BIT) { - // MAP_32BIT only exist on x86_64! - addr = find31bitBlockNearHint(addr, length, 0); - } else if (box64_wine || 1) { // other mmap should be restricted to 47bits - if(!addr) - addr = find47bitBlock(length); - } - #endif - void* ret = internal_mmap(addr, length, prot, new_flags, fd, offset); - #ifndef NOALIGN - if((ret!=MAP_FAILED) && (flags&MAP_32BIT) && - (((uintptr_t)ret>0xffffffffLL) || ((box64_wine) && ((uintptr_t)ret&0xffff) && (ret!=addr)))) { - int olderr = errno; - if(emu && (box64_log>=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) printf_log(LOG_NONE, "Warning, mmap on 32bits didn't worked, ask %p, got %p ", addr, ret); - munmap(ret, length); - loadProtectionFromMap(); // reload map, because something went wrong previously - addr = find31bitBlockNearHint(old_addr, length, 0); // is this the best way? - new_flags = (addr && isBlockFree(addr, length) )? (new_flags|MAP_FIXED) : new_flags; - if((new_flags&(MAP_FIXED|MAP_FIXED_NOREPLACE))==(MAP_FIXED|MAP_FIXED_NOREPLACE)) new_flags&=~MAP_FIXED_NOREPLACE; - ret = internal_mmap(addr, length, prot, new_flags, fd, offset); - if(emu && (box64_log>=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) printf_log(LOG_NONE, " tried again with %p, got %p\n", addr, ret); - if(old_addr && ret!=old_addr && ret!=MAP_FAILED) - errno = olderr; - } else if((ret!=MAP_FAILED) && !(flags&MAP_FIXED) && ((box64_wine)) && (addr && (addr!=ret)) && - (((uintptr_t)ret>0x7fffffffffffLL) || ((uintptr_t)ret&~0xffff))) { - int olderr = errno; - if(emu && (box64_log>=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) printf_log(LOG_NONE, "Warning, mmap on 47bits didn't worked, ask %p, got %p ", addr, ret); - munmap(ret, length); - loadProtectionFromMap(); // reload map, because something went wrong previously - addr = find47bitBlockNearHint(old_addr, length, 0); // is this the best way? - new_flags = (addr && isBlockFree(addr, length)) ? (new_flags|MAP_FIXED) : new_flags; - if((new_flags&(MAP_FIXED|MAP_FIXED_NOREPLACE))==(MAP_FIXED|MAP_FIXED_NOREPLACE)) new_flags&=~MAP_FIXED_NOREPLACE; - ret = internal_mmap(addr, length, prot, new_flags, fd, offset); - if(emu && (box64_log>=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) printf_log(LOG_NONE, " tried again with %p, got %p\n", addr, ret); - if(old_addr && ret!=old_addr && ret!=MAP_FAILED) { - errno = olderr; - if(old_addr>(void*)0x7fffffffff && !have48bits) - errno = EEXIST; - } - } - #endif - if((ret!=MAP_FAILED) && (flags&MAP_FIXED_NOREPLACE) && (ret!=addr)) { - internal_munmap(ret, length); - errno = EEXIST; - return MAP_FAILED; + if(BOX64ENV(dynarec_log)>=LOG_DEBUG) {printf_log(LOG_NONE, "mmap64(%p, 0x%zx, 0x%x, 0x%x, %d, %zd) ", addr, length, prot, flags, fd, offset);} + void* ret = box_mmap(addr, length, prot, flags, fd, offset); + int e = errno; + if(emu && box64_is32bits && ret!=MAP_FAILED && ((ret>(void*)0xc0000000) || (ret+length>(void*)0xc0000000))) { + // do not allow allocating memory that high for 32bits process + box_munmap(ret, length); + ret = MAP_FAILED; + e = EEXIST; } - if(emu && (box64_log>=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) {printf_log(LOG_NONE, "%p\n", ret);} + if((ret==MAP_FAILED && (emu || box64_is32bits)) && (BOX64ENV(log)>=LOG_DEBUG || BOX64ENV(dynarec_log)>=LOG_DEBUG)) {printf_log(LOG_NONE, "%s (%d)\n", strerror(errno), errno);} + if(((ret!=MAP_FAILED) && (emu || box64_is32bits)) && (BOX64ENV(log)>=LOG_DEBUG || BOX64ENV(dynarec_log)>=LOG_DEBUG)) {printf_log(LOG_NONE, "%p\n", ret);} #ifdef DYNAREC - if(box64_dynarec && ret!=MAP_FAILED) { + if(BOX64ENV(dynarec) && ret!=MAP_FAILED) { /*if(flags&0x100000 && addr!=ret) { // program used MAP_FIXED_NOREPLACE but the host linux didn't support it @@ -2876,63 +3197,85 @@ EXPORT void* my_mmap64(x64emu_t* emu, void *addr, unsigned long length, int prot } #endif if(ret!=MAP_FAILED) { + if (emu && !(flags & MAP_ANONYMOUS) && (fd > 0)) { + // the last_mmap will allow mmap created by wine, even those that have hole, to be fully tracked as one single mmap + if((ret>=last_mmap_addr[0]) && ret+length<(last_mmap_addr[0]+last_mmap_len[0])) + RecordEnvMappings((uintptr_t)last_mmap_addr[0], last_mmap_len[0], fd); + else if((ret>=last_mmap_addr[1]) && ret+length<(last_mmap_addr[1]+last_mmap_len[1])) + RecordEnvMappings((uintptr_t)last_mmap_addr[1], last_mmap_len[1], fd); + else + RecordEnvMappings((uintptr_t)ret, length, fd); + } if((flags&MAP_SHARED) && (fd>0)) { uint32_t flags = fcntl(fd, F_GETFL); if((flags&O_ACCMODE)==O_RDWR) { - if((box64_log>=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) {printf_log(LOG_NONE, "Note: Marking the region (%p-%p prot=%x) as NEVERCLEAN because fd have O_RDWR attribute\n", ret, ret+length, prot);} + if((BOX64ENV(log)>=LOG_DEBUG || BOX64ENV(dynarec_log)>=LOG_DEBUG)) {printf_log(LOG_NONE, "Note: Marking the region (%p-%p prot=%x) as NEVERCLEAN because fd have O_RDWR attribute\n", ret, ret+length, prot);} prot |= PROT_NEVERCLEAN; } } - static int unityplayer_detected = 0; - if(fd>0 && box64_unityplayer && !unityplayer_detected) { - char filename[4096]; - char buf[128]; - sprintf(buf, "/proc/self/fd/%d", fd); - ssize_t r = readlink(buf, filename, sizeof(filename)-1); - if(r!=1) filename[r]=0; - if(r>0 && strlen(filename)>strlen("UnityPlayer.dll") && !strcasecmp(filename+strlen(filename)-strlen("UnityPlayer.dll"), "UnityPlayer.dll")) { - printf_log(LOG_INFO, "BOX64: Detected UnityPlayer.dll\n"); - #ifdef DYNAREC - if(!box64_dynarec_strongmem) - box64_dynarec_strongmem = 1; - #endif - unityplayer_detected = 1; - } + // hack to capture full size of the mmap done by wine +#if defined(ANDROID) || defined(WINLATOR_GLIBC) + if(emu && (fd==-1) && (flags&(MAP_PRIVATE|MAP_ANON))==(MAP_PRIVATE|MAP_ANON) && !(flags&MAP_NORESERVE)) { +#else + if(emu && (fd==-1) && (flags&(MAP_PRIVATE|MAP_ANON))==(MAP_PRIVATE|MAP_ANON)) { +#endif + last_mmap_addr[last_mmap_idx] = ret; + last_mmap_len[last_mmap_idx] = length; + } else { + last_mmap_addr[last_mmap_idx] = NULL; + last_mmap_len[last_mmap_idx] = 0; } + last_mmap_idx = 1-last_mmap_idx; + #ifdef DYNAREC + if(!prot) { + last_mmap_0_addr = ret; + last_mmap_0_len = length; + } else { + last_mmap_0_addr = NULL; + last_mmap_0_len = 0; + } + #endif if(emu) setProtection_mmap((uintptr_t)ret, length, prot); else - setProtection((uintptr_t)ret, length, prot); + setProtection_box((uintptr_t)ret, length, prot); + if(addr && ret!=addr) + e = EEXIST; } + errno = e; // preserve errno return ret; } -EXPORT void* my_mmap(x64emu_t* emu, void *addr, unsigned long length, int prot, int flags, int fd, ssize_t offset) __attribute__((alias("my_mmap64"))); +EXPORT void* my_mmap(x64emu_t* emu, void *addr, size_t length, int prot, int flags, int fd, ssize_t offset) __attribute__((alias("my_mmap64"))); EXPORT void* my_mremap(x64emu_t* emu, void* old_addr, size_t old_size, size_t new_size, int flags, void* new_addr) { + #ifdef DYNAREC + last_mmap_0_addr = NULL; + last_mmap_0_len = 0; + #endif (void)emu; - if(emu && (box64_log>=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) {printf_log(LOG_NONE, "mremap(%p, %lu, %lu, %d, %p)=>", old_addr, old_size, new_size, flags, new_addr);} + if((emu || box64_is32bits) && (BOX64ENV(log)>=LOG_DEBUG || BOX64ENV(dynarec_log)>=LOG_DEBUG)) {printf_log(LOG_NONE, "mremap(%p, %lu, %lu, %d, %p)=>", old_addr, old_size, new_size, flags, new_addr);} void* ret = mremap(old_addr, old_size, new_size, flags, new_addr); - if(emu && (box64_log>=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) {printf_log(LOG_NONE, "%p\n", ret);} + if((emu || box64_is32bits) && (BOX64ENV(log)>=LOG_DEBUG || BOX64ENV(dynarec_log)>=LOG_DEBUG)) {printf_log(LOG_NONE, "%p\n", ret);} if(ret!=(void*)-1) { uint32_t prot = getProtection((uintptr_t)old_addr)&~PROT_CUSTOM; if(ret==old_addr) { if(old_size && old_size=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) {printf_log(LOG_NONE, "munmap(%p, %lu)\n", addr, length);} - int ret = internal_munmap(addr, length); + if((emu || box64_is32bits) && (BOX64ENV(log)>=LOG_DEBUG || BOX64ENV(dynarec_log)>=LOG_DEBUG)) {printf_log(LOG_NONE, "munmap(%p, 0x%lx)\n", addr, length);} + int ret = box_munmap(addr, length); + int e = errno; #ifdef DYNAREC - if(!ret && box64_dynarec && length) { - cleanDBFromAddressRange((uintptr_t)addr, length, 1); + if(!ret) { + WillRemoveMapping((uintptr_t)addr, length); + } + if(!ret && BOX64ENV(dynarec) && length) { + if(last_mmap_0_len && last_mmap_0_addr==addr && last_mmap_0_len==length) + {} else // ignore this one + cleanDBFromAddressRange((uintptr_t)addr, length, 1); } + last_mmap_0_addr = NULL; + last_mmap_0_len = 0; #endif if(!ret) { + last_mmap_addr[1-last_mmap_idx] = NULL; + last_mmap_len[1-last_mmap_idx] = 0; freeProtection((uintptr_t)addr, length); + RemoveMapping((uintptr_t)addr, length); } + errno = e; // preseve errno return ret; } EXPORT int my_mprotect(x64emu_t* emu, void *addr, unsigned long len, int prot) { + #ifdef DYNAREC + last_mmap_0_addr = NULL; + last_mmap_0_len = 0; + #endif (void)emu; - if(emu && (box64_log>=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) {printf_log(LOG_NONE, "mprotect(%p, %lu, 0x%x)\n", addr, len, prot);} + if(emu && (BOX64ENV(log)>=LOG_DEBUG || BOX64ENV(dynarec_log)>=LOG_DEBUG)) {printf_log(LOG_NONE, "mprotect(%p, 0x%lx, 0x%x)\n", addr, len, prot);} if(prot&PROT_WRITE) prot|=PROT_READ; // PROT_READ is implicit with PROT_WRITE on x86_64 int ret = mprotect(addr, len, prot); #ifdef DYNAREC - if(box64_dynarec && !ret && len) { - if(prot& PROT_EXEC) - addDBFromAddressRange((uintptr_t)addr, len); - else - cleanDBFromAddressRange((uintptr_t)addr, len, 1); + if(BOX64ENV(dynarec) && !ret && len) { + if(prot& PROT_EXEC) { + if(!IsAddrMappingLoadAndClean((uintptr_t)addr)) + addDBFromAddressRange((uintptr_t)addr, len); + } else + cleanDBFromAddressRange((uintptr_t)addr, len, (!prot)?1:0); } #endif if(!ret && len) { @@ -3011,6 +3371,35 @@ EXPORT void* my_mallinfo(x64emu_t* emu, void* p) return p; } +struct my_mallinfo2_s { + size_t arena; + size_t ordblks; + size_t smblks; + size_t hblks; + size_t hblkhd; + size_t usmblks; + size_t fsmblks; + size_t uordblks; + size_t fordblks; + size_t keepcost; +}; + +typedef struct my_mallinfo2_s (*mallinfo2_fnc)(void); +EXPORT void* my_mallinfo2(x64emu_t* emu, void* p) +{ + static mallinfo2_fnc f = NULL; + static int inited = 0; + if(!inited) { + inited = 1; + f = (mallinfo2_fnc)dlsym(my_lib->w.lib, "mallinfo2"); + } + if(f) + *(struct my_mallinfo2_s*)p = f(); + else + memset(p, 0, sizeof(struct my_mallinfo2_s)); + return p; +} + #ifdef STATICBUILD void my_updateGlobalOpt() {} void my_checkGlobalOpt() {} @@ -3127,6 +3516,14 @@ EXPORT int my___libc_alloca_cutoff(x64emu_t* emu, size_t size) return (size<=(65536*4)); } +EXPORT int my_nanosleep(const struct timespec *req, struct timespec *rem) +{ + if(!req) + return 0; // workaround for some strange calls + return nanosleep(req, rem); +} +#endif + // DL functions from wrappedlibdl.c void* my_dlopen(x64emu_t* emu, void *filename, int flag); int my_dlclose(x64emu_t* emu, void *handle); @@ -3144,14 +3541,6 @@ EXPORT void* my___libc_dlsym(x64emu_t* emu, void* handle, void* name) return my_dlsym(emu, handle, name); } -EXPORT int my_nanosleep(const struct timespec *req, struct timespec *rem) -{ - if(!req) - return 0; // workaround for some strange calls - return nanosleep(req, rem); -} -#endif - #ifdef ANDROID void obstackSetup() { } @@ -3289,30 +3678,56 @@ EXPORT int my_semctl(int semid, int semnum, int cmd, union semun b) } EXPORT int64_t userdata_sign = 0x1234598765ABCEF0; -EXPORT uint32_t userdata[1024]; +EXPORT uint32_t userdata[1024]; EXPORT long my_ptrace(x64emu_t* emu, int request, pid_t pid, void* addr, uint32_t* data) { if(request == PTRACE_POKEUSER) { - if(ptrace(PTRACE_PEEKDATA, pid, &userdata_sign, NULL)==userdata_sign && (uintptr_t)addr < sizeof(userdata)) { - ptrace(PTRACE_POKEDATA, pid, addr+(uintptr_t)userdata, data); - return 0; + if(ptrace(PTRACE_PEEKDATA, pid, &userdata_sign, NULL)==userdata_sign && (uintptr_t)addr < sizeof(my_x64_user_t)) { + //printf_log_prefix(2, LOG_INFO, "Using ptrace POKE at %p for 0x%x (userdata 0x%x)\n", addr, pid, data); + long ret = ptrace(PTRACE_POKEDATA, pid, addr+(uintptr_t)userdata, data); + return ret; } + //printf_log_prefix(2, LOG_INFO, "Using ptrace POKE at %p for 0x%x (faked 0x%x)\n", addr, pid, data); // fallback to a generic local faking - if((uintptr_t)addr < sizeof(userdata)) + if((uintptr_t)addr < sizeof(userdata)) { *(uintptr_t*)(addr+(uintptr_t)userdata) = (uintptr_t)data; // lets just ignore this for now! - return 0; + errno = 0; + return 0; + } + errno = EINVAL; + return -1; } if(request == PTRACE_PEEKUSER) { - if(ptrace(PTRACE_PEEKDATA, pid, &userdata_sign, NULL)==userdata_sign && (uintptr_t)addr < sizeof(userdata)) { - return ptrace(PTRACE_PEEKDATA, pid, addr+(uintptr_t)userdata, data); + if(ptrace(PTRACE_PEEKDATA, pid, &userdata_sign, NULL)==userdata_sign && (uintptr_t)addr < sizeof(my_x64_user_t)) { + long ret = ptrace(PTRACE_PEEKDATA, pid, addr+(uintptr_t)userdata, data); + if((uintptr_t)addr==offsetof(my_x64_user_t, u_debugreg[6])) { + // clean up DR6... + ret |= 0b111111110000ULL; + ret &= 0xffffefffULL; + ret |= 0xffff0000ULL; + } + if((uintptr_t)addr==offsetof(my_x64_user_t, u_debugreg[7])) { + // clean up DR7... + ret |= 1ULL<<10; + ret &= (0xffff3fffLL); + } + //printf_log_prefix(2, LOG_INFO, "Using ptrace PEEK at %p for 0x%x (userdata) => 0x%x\n", addr, pid, ret); + return ret; } // fallback to a generic local faking - if((uintptr_t)addr < sizeof(userdata)) + if((uintptr_t)addr < sizeof(userdata)) { + errno = 0; + //printf_log_prefix(2, LOG_INFO, "Using ptrace PEEK at %p for 0x%x (faked) => 0x%x\n", addr, pid, *(uintptr_t*)(addr+(uintptr_t)userdata)); return *(uintptr_t*)(addr+(uintptr_t)userdata); + } + //printf_log_prefix(2, LOG_INFO, "Using ptrace PEEK at %p for 0x%x (error) => -1)\n", addr, pid); + errno = EINVAL; + return -1; } - return ptrace(request, pid, addr, data); + long ret = ptrace(request, pid, addr, data); + return ret; } // Backtrace stuff @@ -3324,6 +3739,10 @@ EXPORT int my_backtrace(x64emu_t* emu, void** buffer, int size) dwarf_unwind_t *unwind = init_dwarf_unwind_registers(emu); int idx = 0; char success = 0; + if(!(getProtection_fast(R_RSP)&PROT_READ)) + return 0; + if(!(getProtection_fast((uintptr_t)buffer)&PROT_READ)) + return 0; uintptr_t addr = *(uintptr_t*)R_RSP; buffer[0] = (void*)addr; while (++idx < size) { @@ -3334,6 +3753,8 @@ EXPORT int my_backtrace(x64emu_t* emu, void** buffer, int size) success = 2; // See elfdwarf_private.c for the register mapping unwind->regs[7] = unwind->regs[6]; // mov rsp, rbp + if(!(getProtection_fast(unwind->regs[7])&PROT_READ)) + return idx-1; unwind->regs[6] = *(uint64_t*)unwind->regs[7]; // pop rbp unwind->regs[7] += 8; ret_addr = *(uint64_t*)unwind->regs[7]; // ret @@ -3371,7 +3792,7 @@ EXPORT int my_backtrace_ip(x64emu_t* emu, void** buffer, int size) if (++idx < size) buffer[idx] = (void*)ret_addr; } else if (!success) { if(getProtection((uintptr_t)addr)&(PROT_READ)) { - if(getProtection((uintptr_t)addr-19) && *(uint8_t*)(addr-19)==0xCC && *(uint8_t*)(addr-19+1)=='S' && *(uint8_t*)(addr-19+2)=='C') { + if (getProtection((uintptr_t)addr - 19) && *(uint8_t*)(addr - 19) == 0xCC && IsBridgeSignature(*(uint8_t*)(addr - 19 + 1), *(uint8_t*)(addr - 19 + 2))) { buffer[idx-1] = (void*)(addr-19); success = 2; if(idx==1) @@ -3505,8 +3926,10 @@ typedef struct clone_arg_s { uintptr_t fnc; void* args; int stack_clone_used; + int flags; void* tls; } clone_arg_t; +void init_mutexes(box64context_t* context); static int clone_fn(void* p) { clone_arg_t* arg = (clone_arg_t*)p; @@ -3514,7 +3937,11 @@ static int clone_fn(void* p) x64emu_t *emu = arg->emu; R_RSP = arg->stack; emu->flags.quitonexit = 1; + thread_forget_emu(); //TODO: not all will flags needs this, probably just CLONE_VM? thread_set_emu(emu); + if(arg->flags&CLONE_NEWUSER) { + init_mutexes(my_context); + } int ret = RunFunctionWithEmu(emu, 0, arg->fnc, 1, arg->args); int exited = (emu->flags.quitonexit==2); thread_set_emu(NULL); @@ -3551,6 +3978,7 @@ EXPORT int my_clone(x64emu_t* emu, void* fn, void* stack, int flags, void* args, arg->fnc = (uintptr_t)fn; arg->tls = tls; arg->emu = newemu; + arg->flags = flags; if((flags|(CLONE_VM|CLONE_VFORK|CLONE_SETTLS))==flags) // that's difficult to setup, so lets ignore all those flags :S flags&=~(CLONE_VM|CLONE_VFORK|CLONE_SETTLS); int64_t ret = clone(clone_fn, (void*)((uintptr_t)mystack+1024*1024), flags, arg, parent, NULL, child); @@ -3592,6 +4020,11 @@ EXPORT int my_register_printf_type(x64emu_t* emu, void* f) return my->register_printf_type(findprintf_typeFct(f)); } +EXPORT __uint128_t my___udivti3(__uint128_t a, __uint128_t b) +{ + return a/b; +} + extern int box64_quit; extern int box64_exit_code; void endBox64(); @@ -3629,38 +4062,248 @@ EXPORT void my_exit(x64emu_t* emu, int code) exit(code); } -EXPORT void my__exit(x64emu_t* emu, int code) __attribute__((alias("my_exit"))); +EXPORT void my__exit(x64emu_t* emu, int code) +{ + if(emu->flags.quitonexit || emu->quit) { + _exit(code); + } + dynarec_log(LOG_INFO, "Fast _exit called\n"); + emu->quit = 1; + box64_exit_code = code; + SerializeAllMapping(); // just to be safe + // then call all the fini + + _exit(code); +} EXPORT int my_prctl(x64emu_t* emu, int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) { if(option==PR_SET_NAME) { - printf_log(LOG_DEBUG, "BOX64: set process name to \"%s\"\n", (char*)arg2); - ApplyParams((char*)arg2); + printf_log(LOG_DEBUG, "set process name to \"%s\"\n", (char*)arg2); + ApplyEnvFileEntry((char*)arg2); size_t l = strlen((char*)arg2); if(l>4 && !strcasecmp((char*)arg2+l-4, ".exe")) { - printf_log(LOG_DEBUG, "BOX64: hacking orig command line to \"%s\"\n", (char*)arg2); + printf_log(LOG_DEBUG, "hacking orig command line to \"%s\"\n", (char*)arg2); strcpy(my_context->orig_argv[0], (char*)arg2); } } if(option==PR_SET_SECCOMP) { - printf_log(LOG_INFO, "BOX64: ignoring prctl(PR_SET_SECCOMP, ...)\n"); + printf_log(LOG_INFO, "ignoring prctl(PR_SET_SECCOMP, ...)\n"); return 0; } return prctl(option, arg2, arg3, arg4, arg5); } +EXPORT int my_pidfd_open(x64emu_t* emu, int pid, unsigned int flags) +{ + (void)emu; +#if defined(SYS_pidfd_open) + return syscall(SYS_pidfd_open, pid, flags); +#elif defined(__NR_pidfd_open) + return syscall(__NR_pidfd_open, pid, flags); +#else + (void)pid; + (void)flags; + errno = ENOSYS; + return -1; +#endif +} + +EXPORT int my_pidfd_send_signal(x64emu_t* emu, int pidfd, int sig, siginfo_t* info, unsigned int flags) +{ + (void)emu; + int hsig = signal_from_x64(sig); + siginfo_t hinfo; + siginfo_t* hptr = NULL; + if(info) { + memcpy(&hinfo, info, sizeof(hinfo)); + hinfo.si_signo = hsig; + hptr = &hinfo; + } +#if defined(SYS_pidfd_send_signal) + return syscall(SYS_pidfd_send_signal, pidfd, hsig, hptr, flags); +#elif defined(__NR_pidfd_send_signal) + return syscall(__NR_pidfd_send_signal, pidfd, hsig, hptr, flags); +#else + errno = ENOSYS; + return -1; +#endif +} + +EXPORT int my_pidfd_getfd(x64emu_t* emu, int pidfd, int targetfd, unsigned int flags) +{ + (void)emu; +#if defined(SYS_pidfd_getfd) + return syscall(SYS_pidfd_getfd, pidfd, targetfd, flags); +#elif defined(__NR_pidfd_getfd) + return syscall(__NR_pidfd_getfd, pidfd, targetfd, flags); +#else + (void)pidfd; + (void)targetfd; + (void)flags; + errno = ENOSYS; + return -1; +#endif +} + + +EXPORT int my_fsopen(x64emu_t* emu, const char* fs_name, unsigned int flags) +{ + (void)emu; +#if defined(SYS_fsopen) + return syscall(SYS_fsopen, fs_name, flags); +#elif defined(__NR_fsopen) + return syscall(__NR_fsopen, fs_name, flags); +#else + (void)fs_name; + (void)flags; + errno = ENOSYS; + return -1; +#endif +} + +EXPORT int my_fsconfig(x64emu_t* emu, int fs_fd, unsigned int cmd, const char* key, const void* value, int aux) +{ + (void)emu; +#if defined(SYS_fsconfig) + return syscall(SYS_fsconfig, fs_fd, cmd, key, value, aux); +#elif defined(__NR_fsconfig) + return syscall(__NR_fsconfig, fs_fd, cmd, key, value, aux); +#else + (void)fs_fd; + (void)cmd; + (void)key; + (void)value; + (void)aux; + errno = ENOSYS; + return -1; +#endif +} + +EXPORT int my_fsmount(x64emu_t* emu, int fs_fd, unsigned int flags, unsigned int attr_flags) +{ + (void)emu; +#if defined(SYS_fsmount) + return syscall(SYS_fsmount, fs_fd, flags, attr_flags); +#elif defined(__NR_fsmount) + return syscall(__NR_fsmount, fs_fd, flags, attr_flags); +#else + (void)fs_fd; + (void)flags; + (void)attr_flags; + errno = ENOSYS; + return -1; +#endif +} + +EXPORT int my_fspick(x64emu_t* emu, int dfd, const char* path, unsigned int flags) +{ + (void)emu; +#if defined(SYS_fspick) + return syscall(SYS_fspick, dfd, path, flags); +#elif defined(__NR_fspick) + return syscall(__NR_fspick, dfd, path, flags); +#else + (void)dfd; + (void)path; + (void)flags; + errno = ENOSYS; + return -1; +#endif +} + +EXPORT int my_move_mount(x64emu_t* emu, int from_dfd, const char* from_path, int to_dfd, const char* to_path, unsigned int flags) +{ + (void)emu; +#if defined(SYS_move_mount) + return syscall(SYS_move_mount, from_dfd, from_path, to_dfd, to_path, flags); +#elif defined(__NR_move_mount) + return syscall(__NR_move_mount, from_dfd, from_path, to_dfd, to_path, flags); +#else + (void)from_dfd; + (void)from_path; + (void)to_dfd; + (void)to_path; + (void)flags; + errno = ENOSYS; + return -1; +#endif +} + +EXPORT int my_mount_setattr(x64emu_t* emu, int dfd, const char* path, unsigned int flags, void* attr, size_t size) +{ + (void)emu; +#if defined(SYS_mount_setattr) + return syscall(SYS_mount_setattr, dfd, path, flags, attr, size); +#elif defined(__NR_mount_setattr) + return syscall(__NR_mount_setattr, dfd, path, flags, attr, size); +#else + (void)dfd; + (void)path; + (void)flags; + (void)attr; + (void)size; + errno = ENOSYS; + return -1; +#endif +} + +size_t __attribute__((weak)) strlcpy(char* dest, const char* src, size_t len) +{ + size_t l = strlen(src); + if(len) { + strncpy(dest, src, len-1); + dest[len]=0; + } + return l; +} +size_t __attribute__((weak)) __strlcpy_chk(char* dest, const char* src, size_t len, size_t chk) +{ + // in case it's not defined... create a weak version with no actual chk + return strlcpy(dest, src, len); +} + +__attribute__((weak)) uint32_t arc4random(void) +{ + return get_random32(); +} + +__attribute__((weak)) const char* strerrorname_np(int errnum) +{ + (void)errnum; + return NULL; +} + +__attribute__((weak)) int open_tree(int dfd, const char* path, unsigned int flags) +{ +#ifdef SYS_open_tree + return syscall(SYS_open_tree, dfd, path, flags); +#else + errno = ENOSYS; + return -1; +#endif +} + +__attribute__((weak)) int dn_skipname(const unsigned char* ptr, const unsigned char* eom) +{ + (void)ptr; + (void)eom; + errno = ENOSYS; + return -1; +} + #ifndef _SC_NPROCESSORS_ONLN #define _SC_NPROCESSORS_ONLN 84 -#endif +#endif #ifndef _SC_NPROCESSORS_CONF #define _SC_NPROCESSORS_CONF 83 -#endif +#endif EXPORT long my_sysconf(x64emu_t* emu, int what) { if(what==_SC_NPROCESSORS_ONLN) { - return getNCpu(); + return box64_sysinfo.box64_ncpu; } if(what==_SC_NPROCESSORS_CONF) { - return getNCpu(); + return box64_sysinfo.box64_ncpu; } return sysconf(what); } @@ -3674,6 +4317,13 @@ EXPORT char* my_program_invocation_short_name = NULL; // ignoring this for now EXPORT char my___libc_single_threaded = 0; +EXPORT char* secure_getenv(const char* name) +{ + // ignoring the "secure" part for now + //TODO: better handling of user and process ID + return getenv(name); +} + #ifdef STATICBUILD #include "libtools/static_libc.h" #endif @@ -3685,7 +4335,17 @@ EXPORT char my___libc_single_threaded = 0; else #endif -#ifdef ANDROID +#if defined(ANDROID) +#ifdef STATICBUILD +#define NEEDED_LIBS_DEF 3,\ + "libpthread.so", \ + "libdl.so" , \ + "libm.so" +#define NEEDED_LIBS_234 3, \ + "libpthread.so", \ + "libdl.so" , \ + "libm.so" +#else #define NEEDED_LIBS_DEF 4,\ "libpthread.so", \ "libdl.so" , \ @@ -3696,6 +4356,22 @@ EXPORT char my___libc_single_threaded = 0; "libdl.so" , \ "libm.so", \ "libbsd.so" +#endif +#else +#ifdef STATICBUILD +#define NEEDED_LIBS_DEF 5,\ + "ld-linux-x86-64.so.2", \ + "libpthread.so.0", \ + "libdl.so.2", \ + "libutil.so.1", \ + "librt.so.1" +#define NEEDED_LIBS_234 6, \ + "ld-linux-x86-64.so.2", \ + "libpthread.so.0", \ + "libdl.so.2", \ + "libutil.so.1", \ + "libresolv.so.2", \ + "librt.so.1" #else #define NEEDED_LIBS_DEF 6,\ "ld-linux-x86-64.so.2", \ @@ -3713,6 +4389,7 @@ EXPORT char my___libc_single_threaded = 0; "librt.so.1", \ "libbsd.so.0" #endif +#endif #undef HAS_MY diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h index 76a7a9a..4817bce 100644 --- a/src/wrapped/wrappedlibc_private.h +++ b/src/wrapped/wrappedlibc_private.h @@ -1,14 +1,7 @@ -#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA) && defined(GOS)) +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) #error Meh... #endif -//socklen_t is u32 -// typedef unsigned long int nfds_t; -// pid_t is S32 -// key_t is S32 -// uid_t is u32 -// gid_t is u32 - GO(a64l, lFp) GO(abort, vFv) //DATAB(__abort_msg, @@ -17,28 +10,28 @@ GO(accept, iFipp) GO(accept4, iFippi) GOW(access, iFpi) GO(acct, iFp) -GOW(addmntent, iFpp) +GOW(addmntent, iFSp) GOW(addseverity, iFip) GOW(adjtime, iFpp) GO(__adjtimex, iFp) GOW(adjtimex, iFp) //GOW(advance, GO(alarm, uFu) -GO(aligned_alloc, pFUU) +GO(aligned_alloc, pFLL) GOW(alphasort, iFpp) GOW(alphasort64, iFpp) //GO(__arch_prctl, //GOW(arch_prctl, -//DATA(argp_err_exit_status, -//GOW(argp_error, vF!pV) -//GOW(argp_failure, vF!iipV) -//GOW(argp_help, vF!pup) -//GOW(argp_parse, iF!ipupp) -//DATAB(argp_program_bug_address, -//DATAB(argp_program_version, -//DATAB(argp_program_version_hook, -//GOW(argp_state_help, vF!pu) -//GOW(argp_usage, vF!) +//DATA(argp_err_exit_status, 4) +GOWM(argp_error, vFppV) +GOWM(argp_failure, vFpiipV) +//GOWM(argp_help, vFpSup) +GOWM(argp_parse, iFEpipupp) +//DATAB(argp_program_bug_address, 8) +//DATAB(argp_program_version, 8) +//DATAM(argp_program_version_hook, 8) +//GOWM(argp_state_help, vFpSu) +//GOWM(argp_usage, vFp) GOW(argz_add, iFppp) GOW(argz_add_sep, iFpppi) GOW(argz_append, iFpppL) @@ -67,13 +60,13 @@ GO(atof, dFp) GO(atoi, iFp) GO(atol, lFp) GO(atoll, IFp) -//GO(authdes_create, !Fpup!) -//GO(authdes_getucred, iF!pppp) -//GO(authdes_pk_create, !Fp!up!) -//GO(_authenticate, uF!!) -//GO(authnone_create, !Fv) -//GO(authunix_create, !Fpuuip) -//GO(authunix_create_default, !Fv) +//GOM(authdes_create, pFpupp) +//GO(authdes_getucred, "iF!pppp") +//GOM(authdes_pk_create, pFppupp) +//GOM(_authenticate, uFpp) +//GOM(authnone_create, pFv) +//GOM(authunix_create, pFpuuip) +//GOM(authunix_create_default, pFv) //GO(__backtrace, GOWM(backtrace, iFEpi) //GO(__backtrace_symbols, @@ -83,9 +76,9 @@ GOWM(backtrace_symbols_fd, vFEpii) GOW(basename, pFp) GO(bcmp, iFppL) GO(bcopy, vFppL) -//GO(bdflush, // Deprecated +//GO(bdflush, GOW(bind, iFipu) -//GO(bindresvport, iFi!) +GO(bindresvport, iFip) GOW(bindtextdomain, pFpp) GOW(bind_textdomain_codeset, pFpp) GOW(brk, iFp) @@ -95,10 +88,10 @@ GOM(bsearch, pFEppLLp) GOW(btowc, uFi) GO(__bzero, vFpL) GO(bzero, vFpL) -//GO(c16rtomb, LFpW!) +GO(c16rtomb, LFpWp) GOW(c32rtomb, LFpup) GOW(calloc, pFLL) -//GO(callrpc, iFpLLL@p@p) +//GOM(callrpc, iFpiiipppp) //GO(__call_tls_dtors, vFv) GOW(canonicalize_file_name, pFp) GO(capget, iFpp) @@ -106,7 +99,11 @@ GO(capset, iFpp) GO(catclose, iFp) GO(catgets, pFpiip) GO(catopen, pFpi) -//GO(cbc_crypt, // Deprecated +#ifdef STATICBUILD +//GO(cbc_crypt, iFppuup) +#else +GO(cbc_crypt, iFppuup) +#endif GO(cfgetispeed, uFp) GO(cfgetospeed, uFp) GO(cfmakeraw, vFp) @@ -115,43 +112,43 @@ GO(cfsetispeed, iFpu) GO(cfsetospeed, iFpu) GO(cfsetspeed, iFpu) GOW(chdir, iFp) -DATA(__check_rhosts_file, sizeof(void*)) +DATA(__check_rhosts_file, 8) //GO(chflags, //GO(__chk_fail, GOW(chmod, iFpu) GOW(chown, iFpuu) GO(chroot, iFp) GOW(clearenv, iFv) -GO(clearerr, vFp) -GO(clearerr_unlocked, vFp) +GO(clearerr, vFS) +GO(clearerr_unlocked, vFS) #ifdef STATICBUILD //GO(clnt_broadcast, -//GO(clnt_create, !FpLLp) +//GO(clnt_create, "!FpLLp") //GO(clnt_pcreateerror, vFp) //GO(clnt_perrno, vFu) -//GO(clnt_perror, vF!p) -//GO(clntraw_create, !FLL) +//GO(clnt_perror, "vF!p") +//GO(clntraw_create, "!FLL") //GO(clnt_spcreateerror, pFp) //GO(clnt_sperrno, pFu) -//GO(clnt_sperror, pF!p) -//GO(clnttcp_create, !F!LLpuu) -//GO(clntudp_bufcreate, !F!LL?puu) -//GO(clntudp_create, !F!LL?p) -//GO(clntunix_create, !F!LLpuu) +//GO(clnt_sperror, "pF!p") +//GO(clnttcp_create, "!F!LLpuu") +//GO(clntudp_bufcreate, "!F!LL?puu") +//GO(clntudp_create, "!F!LL?p") +//GO(clntunix_create, "!F!LLpuu") #else -//GO(clnt_broadcast, -//GO(clnt_create, !FpLLp) +//GOM(clnt_broadcast, uFLLLppppp) +//GOM(clnt_create, pFpuup) GO(clnt_pcreateerror, vFp) GO(clnt_perrno, vFu) -//GO(clnt_perror, vF!p) -//GO(clntraw_create, !FLL) +//GOM(clnt_perror, vFpp) +//GOM(clntraw_create, pFLL) GO(clnt_spcreateerror, pFp) GO(clnt_sperrno, pFu) -//GO(clnt_sperror, pF!p) -//GO(clnttcp_create, !F!LLpuu) -//GO(clntudp_bufcreate, !F!LL?puu) -//GO(clntudp_create, !F!LL?p) -//GO(clntunix_create, !F!LLpuu) +//GOM(clnt_sperror, pFpp) +//GOM(clnttcp_create, pFpLLpuu) +//GO(clntudp_bufcreate, "!F!LL?puu") +//GO(clntudp_create, "!F!LL?p") +//GOM(clntunix_create, pFpLLpuu) #endif GO(clock, lFv) GO(clock_adjtime, iFip) @@ -172,7 +169,7 @@ GOW(close, iFi) GOW(closedir, iFp) GO(closelog, vFv) //GO(__close_nocancel, -GO(close_range, iFuuu) +GO(close_range, iFuui) GO(__cmsg_nxthdr, pFpp) GO(confstr, LFipL) GO(__confstr_chk, LFipLL) @@ -182,32 +179,37 @@ GO(copy_file_range, lFipipLu) //GO(__copy_grp, GOW(copysign, dFdd) GOW(copysignf, fFff) -GOW(copysignl, DFDD) +GOWD(copysignl, DFDD, copysign) GOW(creat, iFpu) GOW(creat64, iFpu) //GO(create_module, GO(ctermid, pFp) GO(ctime, pFp) GO(ctime_r, pFpp) +#ifdef ANDROID +DATA(_ctype_, 8) +#else +//DATA(_ctype_, 8) //is it even used on Linux? +#endif //DATA(__ctype32_b, //DATA(__ctype32_tolower, //DATA(__ctype32_toupper, #ifdef STATICBUILD -//DATA(__ctype_b, sizeof(void*)) +//DATA(__ctype_b, 8) #else -DATA(__ctype_b, sizeof(void*)) +DATA(__ctype_b, 8) #endif GO(__ctype_b_loc, pFv) GO(__ctype_get_mb_cur_max, LFv) //GO(__ctype_init, -DATAM(__ctype_tolower, sizeof(void*)) +DATAM(__ctype_tolower, 8) GO(__ctype_tolower_loc, pFv) -DATAM(__ctype_toupper, sizeof(void*)) +DATAM(__ctype_toupper, 8) GO(__ctype_toupper_loc, pFv) //DATAB(__curbrk, GO(cuserid, pFp) GOM(__cxa_atexit, iFEppp) -//GO(__cxa_at_quick_exit, /* at_quick_exit has signature iF@ -> */ iF@pp) +//GO(__cxa_at_quick_exit, "/* at_quick_exit has signature iF@ -> */ iF@pp") GOM(__cxa_finalize, vFEp) GOM(__cxa_thread_atexit_impl, iFEppp) //GO(__cyg_profile_func_enter, @@ -219,20 +221,29 @@ GO(__dcgettext, pFppi) GOW(dcgettext, pFppi) GOW(dcngettext, pFpppLi) //GO(__default_morecore, -//GO(delete_module, // Deprecated -//GO(des_setparity, // Deprecated +#ifdef STATICBUILD +//GO(delete_module, +//GO(des_setparity, +#else +GOM(delete_module, iFEpu) +GO(des_setparity, vFp) +#endif GO(__dgettext, pFpp) GOW(dgettext, pFpp) GO(difftime, dFll) GO(dirfd, iFp) GO(dirname, pFp) -GO(div, LFii) +GO(div, UFii) //GO(_dl_addr, //GO(_dl_catch_error, //GO(_dl_catch_exception, GOWM(dl_iterate_phdr, iFEpp) //GO(_dl_mcount_wrapper, -//GO(_dl_mcount_wrapper_check, +#ifdef STATICBUILD +//GO(_dl_mcount_wrapper_check, vFp) +#else +GO(_dl_mcount_wrapper_check, vFp) +#endif //DATAB(_dl_open_hook, //DATAB(_dl_open_hook2, //GO(_dl_signal_error, @@ -240,6 +251,7 @@ GOWM(dl_iterate_phdr, iFEpp) //GO(_dl_sym, //GO(_dl_vsym, GOW(dngettext, pFpppL) +GOW(dn_skipname, iFpp) GOM(dprintf, iFEipV) GOM(__dprintf_chk, iFEiipV) GO(drand48, dFv) @@ -252,7 +264,11 @@ GO(__duplocale, pFp) GOW(duplocale, pFp) GO(dysize, iFi) GOW(eaccess, iFpi) +#ifdef STATICBUILD //GO(ecb_crypt, +#else +GO(ecb_crypt, iFppuu) +#endif GO(ecvt, pFdipp) GOW(ecvt_r, iFdipppL) GO(endaliasent, vFv) @@ -260,21 +276,25 @@ GO(endfsent, vFv) GO(endgrent, vFv) GO(endhostent, vFv) GO(__endmntent, iFp) -GOW(endmntent, iFp) +GOW(endmntent, iFS) GO(endnetent, vFv) GO(endnetgrent, vFv) GO(endprotoent, vFv) GO(endpwent, vFv) GO(endrpcent, vFv) GO(endservent, vFv) +#ifdef STATICBUILD //GO(endsgent, +#else +GO(endsgent, vFv) +#endif GO(endspent, vFv) GOW(endttyent, iFv) GO(endusershell, vFv) GOW(endutent, vFv) GO(endutxent, vFv) -DATAM(environ, sizeof(void*)) -DATAM(__environ, sizeof(void*)) +DATAM(environ, 8) +DATAM(__environ, 8) GO(envz_add, iFpppp) GO(envz_entry, pFpLp) GO(envz_get, pFpLp) @@ -286,10 +306,12 @@ GO(epoll_create1, iFO) #ifdef NOALIGN GO(epoll_ctl, iFiiip) GO(epoll_pwait, iFipiip) +GO(epoll_pwait2, iFipipp) GO(epoll_wait, iFipii) #else -GOM(epoll_ctl, iFEiiip) // struct epoll_event is 12byte on x86_64 and 16bytes (8bytes aligned) on arm64 +GOM(epoll_ctl, iFEiiip) GOM(epoll_pwait, iFEipiip) +GOM(epoll_pwait2, iFEipipp) GOM(epoll_wait, iFEipii) #endif GO(erand48, dFp) @@ -297,40 +319,50 @@ GOW(erand48_r, iFppp) GOM(err, vFEipV) //DATAB(errno, GO(__errno_location, pFv) -GOW(error, vFiipV) -//GOW(error_at_line, vFiipupV) -//DATAB(error_message_count, -//DATAB(error_one_per_line, -//DATAB(error_print_progname, +GOWM(error, vFEiipV) +GOWM(error_at_line, vFEiipupV) +//DATAB(error_message_count, 4) +//DATAB(error_one_per_line, 4) +DATAM(error_print_progname, 8) GOM(errx, vFEipV) -//GO(ether_aton, !Fp) -//GO(ether_aton_r, !Fp!) -//GO(ether_hostton, iFp!) -//GO(ether_line, iFp!p) -//GO(ether_ntoa, pF!) -//GO(ether_ntoa_r, pF!p) -//GO(ether_ntohost, iFp!) +#ifdef STATICBUILD +//GO(ether_aton, pFp) +//GO(ether_aton_r, pFpp) +//GO(ether_hostton, iFpp) +//GO(ether_line, iFppp) +//GO(ether_ntoa, pFp) +//GO(ether_ntoa_r, pFpp) +//GO(ether_ntohost, iFpp) +#else +GO(ether_aton, pFp) +GO(ether_aton_r, pFpp) +GO(ether_hostton, iFpp) +GO(ether_line, iFppp) +GO(ether_ntoa, pFp) +GO(ether_ntoa_r, pFpp) +GO(ether_ntohost, iFpp) +#endif GOW(euidaccess, iFpi) GO(eventfd, iFui) GO(eventfd_read, iFip) -GO(eventfd_write, iFiL) +GO(eventfd_write, iFiU) GOM(execl, iFEpV) // First argument is also part of the variadic GOM(execle, iFEpV) // First argument is also part of the variadic GOM(execlp, iFEpV) // First argument is also part of the variadic GOM(execv, iFEpp) GOM(execve, iFEppp) GOM(execvp, iFEpp) -GOW(execvpe, iFppp) -GO(_exit, vFi) // immediate exit +GOWM(execvpe, iFEppp) +GOM(_exit, vFEi) GOM(exit, vFEi) GOW(_Exit, vFi) GO(explicit_bzero, vFpL) GO(__explicit_bzero_chk, vFpLL) GO(faccessat, iFipii) GOW(fallocate, iFiill) -GO(fallocate64, iFiill) +GO(fallocate64, iFiiII) GO(fanotify_init, iFuu) -GO(fanotify_mark, iFiuLip) +GO(fanotify_mark, iFiuUip) //GO(fattach, GO(__fbufsize, LFp) GOW(fchdir, iFi) @@ -339,7 +371,7 @@ GOW(fchmod, iFiu) GO(fchmodat, iFipui) GOW(fchown, iFiuu) GO(fchownat, iFipuui) -GO(fclose, iFp) +GO(fclose, iFS) GOW(fcloseall, iFv) GOWM(__fcntl, iFEiiN) GOWM(fcntl, iFEiiN) @@ -350,41 +382,50 @@ GO(fdatasync, iFi) GO(__fdelt_chk, LFL) //GO(__fdelt_warn, //GO(fdetach, -GO(fdopen, pFip) +GO(fdopen, SFip) GOW(fdopendir, pFi) //GO(__fentry__, -GOW(feof, iFp) -GOW(feof_unlocked, iFp) -GOW(ferror, iFp) -GOW(ferror_unlocked, iFp) +GOW(feof, iFS) +GOW(feof_unlocked, iFS) +GOW(ferror, iFS) +GOW(ferror_unlocked, iFS) GO(fexecve, iFipp) GOW(fflush, iFS) GO(fflush_unlocked, iFS) //GO(__ffs, GO(ffs, iFi) -GO(ffsl, iFI) +GO(ffsl, iFl) GO(ffsll, iFI) -GOW(fgetc, iFp) -GOW(fgetc_unlocked, iFp) -GO(fgetgrent, pFp) -GOW(fgetgrent_r, iFpppLp) -GO(fgetpos, iFpp) -GO(fgetpos64, iFpp) -GO(fgetpwent, pFp) -GOW(fgetpwent_r, iFpppLp) -GOW(fgets, pFpip) +GOW(fgetc, iFS) +GOW(fgetc_unlocked, iFS) +GO(fgetgrent, pFS) +GOW(fgetgrent_r, iFSppLp) +GO(fgetpos, iFSp) +GO(fgetpos64, iFSp) +GO(fgetpwent, pFS) +GOW(fgetpwent_r, iFSppLp) +GOW(fgets, pFpiS) GO(__fgets_chk, pFpLip) +#ifdef STATICBUILD //GO(fgetsgent, //GOW(fgetsgent_r, -GO(fgetspent, pFp) -GOW(fgetspent_r, iFpppLp) -GOW(fgets_unlocked, pFpip) -//GO(__fgets_unlocked_chk, -GOW(fgetwc, uFp) -GOW(fgetwc_unlocked, uFp) -GO(fgetws, pFpip) +#else +GO(fgetsgent, pFS) +GOW(fgetsgent_r, iFSppLp) +#endif +GO(fgetspent, pFS) +GOW(fgetspent_r, iFSppLp) +GOW(fgets_unlocked, pFpiS) +#ifdef STATICBUILD +//GO(__fgets_unlocked_chk, +#else +GO(__fgets_unlocked_chk, pFpLiS) +#endif +GOW(fgetwc, uFS) +GOW(fgetwc_unlocked, uFS) +GO(fgetws, pFpiS) //GO(__fgetws_chk, -GO(fgetws_unlocked, pFpip) +GO(fgetws_unlocked, pFpiS) //GO(__fgetws_unlocked_chk, GO(fgetxattr, lFippL) GOW(fileno, iFS) @@ -393,41 +434,41 @@ GO(__finite, iFd) GOW(finite, iFd) GO(__finitef, iFf) GOW(finitef, iFf) -GO(__finitel, iFD) -GOW(finitel, iFD) +GOD(__finitel, iFD, __finite) +GOWD(finitel, iFD, finite) GO(__flbf, iFp) GO(flistxattr, lFipL) GOW(flock, iFii) -GOW(flockfile, vFp) +GOW(flockfile, vFS) GOW(_flushlbf, vFv) -GO(fmemopen, pFpLp) +GO(fmemopen, SFpLp) GO(fmtmsg, iFlpippp) GO(fnmatch, iFppi) -GOM(fopen, pFEpp) -GOWM(fopen64, pFEpp) +GOM(fopen, SFEpp) +GOWM(fopen64, SFEpp) GOM(fopencookie, pFEppV) //GO(__fork, GOWM(fork, iFEv) //GO(__fortify_fail, GO(fpathconf, lFii) GO(__fpending, LFp) -GOM(fprintf, iFEppV) +GOM(fprintf, iFESpV) GOM(__fprintf_chk, iFEpipV) //DATA(__fpu_control, GO(__fpurge, vFp) -GO(fputc, iFip) -GO(fputc_unlocked, iFip) -GOW(fputs, iFpp) -GOW(fputs_unlocked, iFpp) -GO(fputwc, uFip) -GO(fputwc_unlocked, uFip) -GO(fputws, iFpp) -GO(fputws_unlocked, iFpp) -GO(fread, LFpLLp) +GO(fputc, iFiS) +GO(fputc_unlocked, iFiS) +GOW(fputs, iFpS) +GOW(fputs_unlocked, iFpS) +GO(fputwc, uFiS) +GO(fputwc_unlocked, uFiS) +GO(fputws, iFpS) +GO(fputws_unlocked, iFpS) +GO(fread, LFpLLS) GO(__freadable, iFp) GO(__fread_chk, LFpLLLp) GO(__freading, iFp) -GO(fread_unlocked, LFpLLp) +GO(fread_unlocked, LFpLLS) GO(__fread_unlocked_chk, LFpLLLp) GO(free, vFp) GO(freeaddrinfo, vFp) @@ -435,19 +476,19 @@ GOW(freeifaddrs, vFp) GO(__freelocale, vFp) GOW(freelocale, vFp) GO(fremovexattr, iFip) -GO(freopen, pFppp) -GO(freopen64, pFppp) +GO(freopen, SFppS) +GO(freopen64, SFppS) GOW(frexp, dFdp) GOW(frexpf, fFfp) -GOW(frexpl, DFDp) -GOM(fscanf, iFEppV) -GO(fseek, iFpli) -GO(fseeko, iFpIi) +GOWD(frexpl, DFDp, frexp) +GOM(fscanf, iFESpV) +GO(fseek, iFSli) +GO(fseeko, iFSli) GO(__fseeko64, iFpli) -GO(fseeko64, iFpli) +GO(fseeko64, iFSIi) GO(__fsetlocking, iFpi) -GO(fsetpos, iFpp) -GO(fsetpos64, iFpp) +GO(fsetpos, iFSp) +GO(fsetpos64, iFSp) GO(fsetxattr, iFippLi) GOM(fstat, iFEip) GOM(fstat64, iFEip) @@ -458,15 +499,15 @@ GOW(fstatfs64, iFip) GOW(fstatvfs, iFip) GOW(fstatvfs64, iFip) GO(fsync, iFi) -GO(ftell, lFp) -GO(ftello, IFp) +GO(ftell, lFS) +GO(ftello, lFS) GO(__ftello64, lFp) -GO(ftello64, lFp) +GO(ftello64, IFS) GO(ftime, iFp) GO(ftok, iFpi) -GO(ftruncate, iFiI) -GO(ftruncate64, iFil) -GOW(ftrylockfile, iFp) +GO(ftruncate, iFil) +GO(ftruncate64, iFiI) +GOW(ftrylockfile, iFS) GOW(fts64_children, pFpi) GOW(fts64_close, iFp) GOWM(fts64_open, pFEpip) @@ -479,18 +520,18 @@ GO(fts_read, pFp) GO(fts_set, iFppi) GOM(ftw, iFEppi) GOM(ftw64, iFEppi) -GOW(funlockfile, vFp) +GOW(funlockfile, vFS) GO(futimens, iFip) GOW(futimes, iFip) GO(futimesat, iFipp) -GO(fwide, iFpi) -GOWM(fwprintf, iFEppV) +GO(fwide, iFSi) +GOWM(fwprintf, iFESpV) GOM(__fwprintf_chk, iFEpipV) GO(__fwritable, iFp) -GO(fwrite, LFpLLp) -GO(fwrite_unlocked, LFpLLp) +GO(fwrite, LFpLLS) +GO(fwrite_unlocked, LFpLLS) GO(__fwriting, iFp) -//GO(fwscanf, iFppV) +//GOM(fwscanf, iFSpV) GOM(__fxstat, iFEiip) GOM(__fxstat64, iFEiip) GOM(__fxstatat, iFEiippi) @@ -506,7 +547,7 @@ GO(gai_suspend, iFpip) //GO(__gconv_transliterate, GO(gcvt, pFdip) GO(getaddrinfo, iFpppp) -GO(getaddrinfo_a, iFipip) +//GOM(getaddrinfo_a, iFipip) GO(getaliasbyname, pFp) GO(getaliasbyname_r, iFpppLp) GO(getaliasent, pFv) @@ -514,22 +555,22 @@ GO(getaliasent_r, iFppLp) //GO(__getauxval, GOWM(getauxval, LFEL) GOW(get_avphys_pages, lFv) -GOW(getc, iFp) +GOW(getc, iFS) GO(getchar, iFv) GO(getchar_unlocked, iFv) GOWM(getcontext, iFEp) GOW(getcpu, iFpp) -GOW(getc_unlocked, iFp) +GOW(getc_unlocked, iFS) GO(get_current_dir_name, pFv) GO(getcwd, pFpL) GO(__getcwd_chk, pFpLL) GO(getdate, pFp) -//DATAB(getdate_err, +//DATAB(getdate_err, 4) GOW(getdate_r, iFpp) -GOW(__getdelim, lFppip) -GO(getdelim, lFppip) +GOW(__getdelim, lFppiS) +GO(getdelim, lFppiS) GO(getdents64, lFipL) -GO(getdirentries, IFipUp) +GO(getdirentries, lFipLp) GO(getdirentries64, lFipLp) GO(getdomainname, iFpL) //GO(__getdomainname_chk, @@ -561,28 +602,41 @@ GO(gethostent, pFv) GO(gethostent_r, iFppLpp) GO(gethostid, lFv) GOW(gethostname, iFpL) -//GO(__gethostname_chk, +#ifdef STATICBUILD +//GO(__gethostname_chk, iFpLL) // it's sometimes not defined, like in LA64 plateform, so lets no wrap it for now +#else +GO(__gethostname_chk, iFpLL) +#endif GOW(getifaddrs, iFp) -//GO(getipv4sourcefilter, iFi??pp!) +GO(getipv4sourcefilter, iFiuuppp) GOW(getitimer, iFup) -//GO(get_kernel_syms, // Deprecated -GO(getline, lFppp) +#ifdef STATICBUILD +//GO(get_kernel_syms, +#else +//GO(get_kernel_syms, +#endif +GO(getline, lFppS) GO(getloadavg, iFpi) GO(getlogin, pFv) GOW(getlogin_r, iFpL) //GO(__getlogin_r_chk, -GO(getmntent, pFp) +GO(getmntent, pFS) GO(__getmntent_r, pFpppi) -GOW(getmntent_r, pFpppi) -//GO(getmsg, // Deprecated -//GO(get_myaddress, vF!) +GOW(getmntent_r, pFSppi) +#ifdef STATICBUILD +//GO(getmsg, +//GO(get_myaddress, iFp) +#else +//GO(getmsg, +GO(get_myaddress, iFp) +#endif GO(getnameinfo, iFpupupui) -//GO(getnetbyaddr, !Fui) -//GO(getnetbyaddr_r, iFui!pL!p) -//GO(getnetbyname, !Fp) -//GO(getnetbyname_r, iFp!pL!p) -//GO(getnetent, !Fv) -//GO(getnetent_r, iF!pL!p) +GO(getnetbyaddr, pFui) +GO(getnetbyaddr_r, iFuippLpp) +GO(getnetbyname, pFp) +GO(getnetbyname_r, iFpppLpp) +GO(getnetent, pFv) +GO(getnetent_r, iFppLpp) GO(getnetgrent, iFppp) GOW(getnetgrent_r, iFppppL) #ifdef STATICBUILD @@ -605,7 +659,7 @@ GO(getpgrp, iFv) GOW(get_phys_pages, lFv) GO(__getpid, iFv) GO(getpid, iFv) -//GO(getpmsg, // Deprecated +//GO(getpmsg, GOW(getppid, iFv) GOW(getpriority, iFuu) GO(getprotobyname, pFp) @@ -642,10 +696,10 @@ GO(getrpcent_r, iFppLp) #ifdef STATICBUILD //GO(getrpcport, #else -GO(getrpcport, iFpLLu) +GO(getrpcport, iFpiii) #endif GOW(getrusage, iFip) -//GOW(gets, // Deprecated +//GOW(gets, //GO(__gets_chk, #ifdef STATICBUILD //GO(getsecretkey, @@ -657,15 +711,22 @@ GO(getservbyname_r, iFppppLp) GO(getservbyport, pFip) GO(getservbyport_r, iFipppLp) GO(getservent, pFv) -//GO(getservent_r, iF!pL!) +GO(getservent_r, iFppLp) +#ifdef STATICBUILD //GO(getsgent, //GO(getsgent_r, //GO(getsgnam, //GO(getsgnam_r, +#else +GO(getsgent, pFv) +GO(getsgent_r, iFppLp) +GO(getsgnam, pFp) +GO(getsgnam_r, iFpppLp) +#endif GO(getsid, iFi) GOW(getsockname, iFipp) GOW(getsockopt, iFiiipp) -//GO(getsourcefilter, iFiupupp!) +GO(getsourcefilter, iFiupuppp) GO(getspent, pFv) GO(getspent_r, iFppLp) GO(getspnam, pFp) @@ -690,11 +751,11 @@ GO(getutmpx, vFpp) GO(getutxent, pFv) GO(getutxid, pFp) GO(getutxline, pFp) -GO(getw, iFp) -GOW(getwc, uFp) +GO(getw, iFS) +GOW(getwc, uFS) GO(getwchar, uFv) GO(getwchar_unlocked, uFv) -GOW(getwc_unlocked, uFp) +GOW(getwc_unlocked, uFS) GO(getwd, pFp) //GO(__getwd_chk, GO(getxattr, lFpppL) @@ -706,20 +767,20 @@ GOW(glob_pattern_p, iFpi) GO(gmtime, pFp) GO(__gmtime_r, pFpp) GOW(gmtime_r, pFpp) -GOW(gnu_dev_major, uFL) -GOW(gnu_dev_makedev, LFuu) -GOW(gnu_dev_minor, uFL) +GOW(gnu_dev_major, uFU) +GOW(gnu_dev_makedev, UFuu) +GOW(gnu_dev_minor, uFU) GOW(gnu_get_libc_release, pFv) GOW(gnu_get_libc_version, pFv) GO(grantpt, iFi) GOW(group_member, iFu) GOW(gsignal, iFi) -//GO(gtty, // Deprecated +//GO(gtty, GOW(hasmntopt, pFpp) -GO(hcreate, iFU) -//GOW(hcreate_r, iFL!) +GO(hcreate, iFL) +GOW(hcreate_r, iFLp) GOW(hdestroy, vFv) -//GOW(hdestroy_r, vF!) +GOW(hdestroy_r, vFp) //DATA(h_errlist, //DATAB(__h_errno, GO(__h_errno_location, pFv) @@ -729,8 +790,8 @@ GO(herror, vFp) #else GO(host2netname, iFppp) #endif -//GO(hsearch, pF?u) -//GOW(hsearch_r, iF?up!) +//GO(hsearch, "pF?u") +//GOW(hsearch_r, "iF?up!") GO(hstrerror, pFi) GO(htonl, uFu) GO(htons, WFW) @@ -743,10 +804,10 @@ GOW(if_freenameindex, vFp) GOW(if_indextoname, pFup) GOW(if_nameindex, pFv) GOW(if_nametoindex, uFp) -GOW(imaxabs, lFl) -GOW(imaxdiv, IFII) -DATA(in6addr_any, 16) // type V -DATA(in6addr_loopback, 16) //type V +GOW(imaxabs, IFI) +GOW(imaxdiv, HFII) +DATAV(in6addr_any, 16) +DATAV(in6addr_loopback, 16) GO(index, pFpi) GO(inet6_opt_append, iFpuiCuCp) GO(inet6_opt_find, iFpuiCpp) @@ -761,8 +822,8 @@ GO(inet6_option_next, iFpp) GO(inet6_option_space, iFi) GO(inet6_opt_next, iFpuippp) GO(inet6_opt_set_val, iFpipu) -//GO(inet6_rth_add, iFp!) -//GO(inet6_rth_getaddr, !Fpi) +GO(inet6_rth_add, iFpp) +GO(inet6_rth_getaddr, pFpi) GO(inet6_rth_init, pFpuii) GO(inet6_rth_reverse, iFpp) GO(inet6_rth_segments, iFp) @@ -771,18 +832,18 @@ GO(inet6_rth_space, uFii) GOW(inet_addr, uFp) GOW(inet_aton, iFpp) //GO(__inet_aton_exact, -//GO(inet_lnaof, uF?) -//GOW(inet_makeaddr, ?Fuu) -//GO(inet_netof, uF?) +GO(inet_lnaof, uFu) +GOW(inet_makeaddr, UFuu) +GO(inet_netof, uFu) GO(inet_network, uFp) GO(inet_nsap_addr, uFppi) GO(inet_nsap_ntoa, pFipp) -GO(inet_ntoa, pFu) // Really? +GO(inet_ntoa, pFu) GO(inet_ntop, pFippu) GOW(inet_pton, iFipp) //GO(__inet_pton_length, GO(initgroups, iFpu) -//GO(init_module, // Deprecated +GOM(init_module, iFEpLp) GO(initstate, pFupL) GO(initstate_r, iFupLp) GO(innetgr, iFpppp) @@ -824,7 +885,7 @@ GO(_IO_file_doallocate, iFS) //GO(_IO_file_finish, GO(_IO_file_fopen, pFSppi) GO(_IO_file_init, vFS) -DATA(_IO_file_jumps, sizeof(void*)) +DATA(_IO_file_jumps, 8) GO(_IO_file_open, pFSpiiii) GO(_IO_file_overflow, iFSi) GO(_IO_file_read, lFSpl) @@ -864,7 +925,7 @@ GO(_IO_init_marker, vFpS) //GO(_IO_iter_next, //GO(_IO_least_wmarker, GO(_IO_link_in, vFp) -DATA(_IO_list_all, sizeof(void*)) +DATA(_IO_list_all, 8) //GO(_IO_list_lock, //GO(_IO_list_resetlock, //GO(_IO_list_unlock, @@ -936,52 +997,54 @@ GO(iruserok, iFuipp) GO(iruserok_af, iFpippW) GO(isalnum, iFi) //GO(__isalnum_l, -//GOW(isalnum_l, iFi!) +GOW(isalnum_l, iFip) GO(isalpha, iFi) //GO(__isalpha_l, GOW(isalpha_l, iFip) GO(isascii, iFi) //GOW(__isascii_l, -//GO(isastream, // Deprecated +//GO(isastream, GOW(isatty, iFi) GO(isblank, iFi) //GO(__isblank_l, -//GOW(isblank_l, iFi!) +GOW(isblank_l, iFip) GO(iscntrl, iFi) //GO(__iscntrl_l, -//GOW(iscntrl_l, iFi!) +GOW(iscntrl_l, iFip) //GO(__isctype, GOW(isctype, iFii) GO(isdigit, iFi) //GO(__isdigit_l, -//GOW(isdigit_l, iFi!) +GOW(isdigit_l, iFip) GO(isfdtype, iFii) GO(isgraph, iFi) //GO(__isgraph_l, -//GOW(isgraph_l, iFi!) +GOW(isgraph_l, iFip) GO(__isinf, iFd) GOW(isinf, iFd) GO(__isinff, iFf) GOW(isinff, iFf) -GO(__isinfl, iFD) -GOW(isinfl, iFD) +GOD(__isinfl, iFD, __isinf) +GOWD(isinfl, iFD, isinf) GO(islower, iFi) //GO(__islower_l, -//GOW(islower_l, iFi!) +GOW(islower_l, iFip) GO(__isnan, iFd) GOW(isnan, iFd) GO(__isnanf, iFf) GOW(isnanf, iFf) -GO(__isnanl, iFD) -GOW(isnanl, iFD) -GO2(__isoc23_fscanf, iFEppV, my___isoc99_fscanf) +GOD(__isnanl, iFD, __isnan) +GOWD(isnanl, iFD, isnan) +GO2(__isoc23_fscanf, iFESpV, my___isoc99_fscanf) GO2(__isoc23_sscanf, iFEppV, my___isoc99_sscanf) GO2(__isoc23_strtol, lFppi, strtol) GO2(__isoc23_strtoll, IFppi, strtoll) GO2(__isoc23_strtoul, LFppi, strtoul) GO2(__isoc23_strtoull, UFppi, strtoull) -GO2(__isoc23_wcstol, LFppi, wcstol) +GO2(__isoc23_wcstol, lFppi, wcstol) GOM(__isoc99_fscanf, iFEppV) +GOM(__isoc23_swscanf, iFEppV) +GO2(__isoc23_vfscanf, iFEppA, my___isoc99_vfscanf) //GO(__isoc99_fwscanf, iFppV) GOM(__isoc99_scanf, iFEpV) GOM(__isoc99_sscanf, iFEppV) @@ -995,16 +1058,16 @@ GOM(__isoc99_vswscanf, iFEppA) //GO(__isoc99_wscanf, iFpV) GO(isprint, iFi) //GO(__isprint_l, -//GOW(isprint_l, iFi!) +GOW(isprint_l, iFip) GO(ispunct, iFi) //GO(__ispunct_l, -//GOW(ispunct_l, iFi!) +GOW(ispunct_l, iFip) GO(isspace, iFi) //GO(__isspace_l, -//GOW(isspace_l, iFi!) +GOW(isspace_l, iFip) GO(isupper, iFi) //GO(__isupper_l, -//GOW(isupper_l, iFi!) +GOW(isupper_l, iFip) GOW(iswalnum, iFu) //GO(__iswalnum_l, GOW(iswalnum_l, iFup) @@ -1051,15 +1114,29 @@ GOW(isxdigit_l, iFip) //GO(__ivaliduser, GO(jrand48, lFp) GOW(jrand48_r, iFppp) -//GO(key_decryptsession, iFp!) -//GO(key_decryptsession_pk, iFp!!) +#ifdef STATICBUILD +//GO(key_decryptsession, iFpp) +//GO(key_decryptsession_pk, "iFp!!") +#else +GO(key_decryptsession, iFpp) +//GO(key_decryptsession_pk, "iFp!!") +#endif //DATAB(__key_decryptsession_pk_LOCAL, -//GO(key_encryptsession, iFp!) -//GO(key_encryptsession_pk, iFp!!) +#ifdef STATICBUILD +//GO(key_encryptsession, iFpp) +//GO(key_encryptsession_pk, "iFp!!") +#else +GO(key_encryptsession, iFpp) +//GO(key_encryptsession_pk, "iFp!!") +#endif //DATAB(__key_encryptsession_pk_LOCAL, -//GO(key_gendes, iF!) +#ifdef STATICBUILD +//GO(key_gendes, iFp) +#else +GO(key_gendes, iFp) +#endif //DATAB(__key_gendes_LOCAL, -//GO(key_get_conv, iFp!) +//GO(key_get_conv, "iFp!") #ifdef STATICBUILD //GO(key_secretkey_is_set, //GO(key_setnet, @@ -1081,7 +1158,7 @@ GO(lcong48, vFp) GOW(lcong48_r, iFpp) GOW(ldexp, dFdi) GOW(ldexpf, fFfi) -GOW(ldexpl, DFDi) +GOWD(ldexpl, DFDi, ldexp) GO(ldiv, HFll) GOM(lfind, pFEpppLp) GO(lgetxattr, lFpppL) @@ -1100,9 +1177,9 @@ GO(__libc_current_sigrtmax, iFv) //GO(__libc_current_sigrtmax_private, GO(__libc_current_sigrtmin, iFv) //GO(__libc_current_sigrtmin_private, -//GO(__libc_dlclose, -//GO(__libc_dlopen_mode, -//GO(__libc_dlsym, +GOM(__libc_dlclose, iFEp) +GOM(__libc_dlopen_mode, pFEpi) +GOM(__libc_dlsym, pFEpp) //GO(__libc_dlvsym, //GO(__libc_dynarray_at_failure, //GO(__libc_dynarray_emplace_enlarge, @@ -1149,16 +1226,16 @@ GO(listxattr, lFppL) GO(llabs, IFI) GO(lldiv, HFII) GO(llistxattr, lFppL) -//GO(llseek, // Deprecated +//GO(llseek, //DATAB(loc1, //DATAB(loc2, GO(localeconv, pFv) GO(localtime, pFp) GO2(localtime64, pFp, localtime) GOW(localtime_r, pFpp) -GO2(localtime64_r, pFpp, localtime_r) //Weak -GO(lockf, iFiiI) -GO(lockf64, iFiil) +GOW2(localtime64_r, pFpp, localtime_r) +GO(lockf, iFiil) +GO(lockf64, iFiiI) //DATAB(locs, GOWM(_longjmp, vFEpi) GOWM(longjmp, vFEpi) @@ -1168,8 +1245,8 @@ GO(lrand48_r, iFpp) GO(lremovexattr, iFpp) GOM(lsearch, pFEpppLp) GO(__lseek, IFiIi) -GO(lseek, IFiIi) -GO(lseek64, lFili) +GO(lseek, lFili) +GO(lseek64, IFiIi) GO(lsetxattr, iFpppLi) GOM(lstat, iFEpp) GOM(lstat64, iFEpp) @@ -1178,21 +1255,22 @@ GOM(__lxstat, iFEipp) GOM(__lxstat64, iFEipp) GO(__madvise, iFpLi) GOW(madvise, iFpLi) -GOWM(makecontext, iFEppiV) +GOWM(makecontext, vFEppiV) GOWM(mallinfo, pFEp) +GOWM(mallinfo2, pFEp) GO(malloc, pFL) -//GO(malloc_get_state, // Obsolete -GOW(malloc_info, iFip) -//GO(malloc_set_state, // Obsolete +//GO(malloc_get_state, +GOW(malloc_info, iFiS) +//GO(malloc_set_state, GOW(malloc_stats, vFv) GO(malloc_trim, iFL) GO(malloc_usable_size, LFp) GOW(mallopt, iFii) //DATAB(mallwatch, -GO(mblen, iFpU) +GO(mblen, iFpL) GO(__mbrlen, LFpLp) GO(mbrlen, LFpLp) -//GO(mbrtoc16, LFppL!) +GO(mbrtoc16, LFppLp) GOW(mbrtoc32, LFppLp) GO(__mbrtowc, LFppLp) GO(mbrtowc, LFppLp) @@ -1204,10 +1282,10 @@ GO(__mbsrtowcs_chk, LFppLpL) GO(mbstowcs, LFppL) GO(__mbstowcs_chk, LFppLL) GO(mbtowc, iFppL) -//GO(mcheck, iF@) +//GOM(mcheck, iFp) GO(mcheck_check_all, vFv) -//GO(mcheck_pedantic, iF@) -//GO(_mcleanup, +//GOM(mcheck_pedantic, iFp) +GO(_mcleanup, vFv) GO(_mcount, vFpp) GO2(mcount, vFpp, _mcount) GO(memalign, pFLL) @@ -1216,11 +1294,11 @@ GO(memchr, pFpiL) GO(memcmp, iFppL) GO(__memcmpeq, iFppL) GO(memcpy, pFppL) -GO(__memcpy_chk, pFppuL) +GO(__memcpy_chk, pFppLL) GO(memfd_create, iFpu) GO(memfrob, pFpL) GO(memmem, pFpLpL) -GO(memmove, pFppU) +GO(memmove, pFppL) GO(__memmove_chk, pFppLL) GO(__mempcpy, pFppL) GO(mempcpy, pFppL) @@ -1236,8 +1314,8 @@ GO(mkdirat, iFipu) GO(mkdtemp, pFp) GO(mkfifo, iFpu) GO(mkfifoat, iFipu) -GO(mknod, iFpuL) -GO(mknodat, iFipuL) +GO(mknod, iFpuU) +GO(mknodat, iFipuU) GO(mkostemp, iFpi) GOW(mkostemp64, iFpi) GO(mkostemps, iFpii) @@ -1254,22 +1332,41 @@ GO(mlock2, iFpLu) GO(mlockall, iFi) //GO(__mmap, GOWM(mmap, pFEpLiiil) -GOWM(mmap64, pFEpLiiil) +GOWM(mmap64, pFEpLiiiI) GOW(modf, dFdp) GOW(modff, fFfp) -GOW(modfl, DFDp) -//GOW(modify_ldt, // Deprecated -//GOW(moncontrol, -//GO(__monstartup, -//GOW(monstartup, -//DATA(__morecore, // Compat-only +GOWD(modfl, DFDp, modf) +//GOW(modify_ldt, +//GOW(moncontrol, +GO(__monstartup, vFLL) +#ifdef STATICBUILD +//GOW(monstartup, vFLL) +#else +GOW(monstartup, vFLL) +#endif +//DATA(__morecore, GOW(mount, iFpppLp) +#ifdef STATICBUILD +GOM(mount_setattr, iFipupL) +GOM(move_mount, iFipipu) +GOM(fsopen, iFpu) +GOM(fsconfig, iFiuppi) +GOM(fsmount, iFiuu) +GOM(fspick, iFipu) +#else +GO(mount_setattr, iFipupL) +GO(move_mount, iFipipu) +GO(fsopen, iFpu) +GO(fsconfig, iFiuppi) +GO(fsmount, iFiuu) +GO(fspick, iFipu) +#endif GO(mprobe, iFp) //GO(__mprotect, GOWM(mprotect, iFEpLi) -GO(mrand48, IFv) +GO(mrand48, lFv) GO(mrand48_r, iFpp) -GOM(mremap, pFEpLLiN) //weal +GOWM(mremap, pFEpLLiN) GO(msgctl, iFiip) GO(msgget, iFii) GOW(msgrcv, lFipLli) @@ -1295,16 +1392,16 @@ GO(netname2user, iFppppp) #endif GO(__newlocale, pFipp) GOW(newlocale, pFipp) -//GO(nfsservctl, // Deprecated -//GO(nftw, iFp@ii) +//GO(nfsservctl, +GOM(nftw, iFEppii) GOM(nftw64, iFEppii) GOW(ngettext, pFppL) GO(nice, iFi) //DATAB(_nl_domain_bindings, GO(nl_langinfo, pFi) -GO(__nl_langinfo_l, pFup) +GO(__nl_langinfo_l, pFip) GOW(nl_langinfo_l, pFip) -//DATAB(_nl_msg_cat_cntr, +DATAB(_nl_msg_cat_cntr, 4) GO(nrand48, lFp) GOW(nrand48_r, iFppp) //GO(__nss_configure_lookup, @@ -1330,29 +1427,29 @@ GOW(nrand48_r, iFppp) GOW(ntohl, uFu) GOW(ntohs, WFW) GOW(ntp_adjtime, iFp) -//GO(ntp_gettime, iF!) -//GO(ntp_gettimex, iF!) -//DATAB(_null_auth, +//GO(ntp_gettime, "iF!") +GO(ntp_gettimex, iFp) +//DATAB(_null_auth, 24) //DATAB(_obstack, //GO(_obstack_allocated_p, -//DATA(obstack_alloc_failed_handler, -GOM(_obstack_begin, iFpLLpp) -//GO(_obstack_begin_1, -//DATA(obstack_exit_failure, +//DATAM(obstack_alloc_failed_handler, 8) +GOM(_obstack_begin, iFpiipp) +//GOM(_obstack_begin_1, iFpiippp) +//DATA(obstack_exit_failure, 4) GOM(_obstack_free, vFpp) GOM(obstack_free, vFpp) -//GO(_obstack_memory_used, +//GOM(_obstack_memory_used, iFp) GOM(_obstack_newchunk, vFEpi) -//GOW(obstack_printf, iFppV) +//GOWM(obstack_printf, iFppV) //GO(__obstack_printf_chk, GOWM(obstack_vprintf, iFEppA) //GO(__obstack_vprintf_chk, -//GOW(on_exit, iF@p) -GOWM(__open, iFEpOu) -GOWM(open, iFEpOu) +//GOWM(on_exit, iFpp) +GOWM(__open, iFEpON) +GOWM(open, iFEpON) GO(__open_2, iFpO) //GOW(__open64, -GOWM(open64, iFEpOu) +GOWM(open64, iFEpON) GO(__open64_2, iFpO) //GO(__open64_nocancel, GOW(openat, iFipON) @@ -1360,57 +1457,69 @@ GO(__openat_2, iFipO) GOW(openat64, iFipON) GO(__openat64_2, iFipO) GO(open_by_handle_at, iFipi) +GOW(open_tree, iFipu) //GO(__open_catalog, GOW(opendir, pFp) GO(openlog, vFpii) -GOW(open_memstream, pFpp) +GOW(open_memstream, SFpp) //GO(__open_nocancel, -GO(open_wmemstream, pFpp) -DATA(optarg, sizeof(void*)) -DATA(opterr, sizeof(int)) -DATA(optind, sizeof(int)) -DATA(optopt, sizeof(int)) -GO(__overflow, iFpi) +GO(open_wmemstream, SFpp) +DATA(optarg, 8) +DATA(opterr, 4) +DATA(optind, 4) +DATA(optopt, 4) +GO(__overflow, iFSi) GO(parse_printf_format, LFpLp) -//GO(passwd2des, // Deprecated +#ifdef STATICBUILD +//GO(passwd2des, +#else +GO(passwd2des, vFpp) +#endif GO(pathconf, lFpi) GOW(pause, iFv) //GO(__pause_nocancel, -GO(pclose, iFp) +GO(pclose, iFS) GO(perror, vFp) GOW(personality, iFL) +GOM(pidfd_open, iFEiu) +GOM(pidfd_send_signal, iFEiipu) +GOM(pidfd_getfd, iFEiiu) GO(__pipe, iFp) GOW(pipe, iFp) GO(pipe2, iFpO) -//GO(pivot_root, // Deprecated +//GO(pivot_root, GO(pkey_alloc, iFuu) GO(pkey_free, iFi) GO(pkey_get, iFi) GO(pkey_mprotect, iFpLii) GO(pkey_set, iFiu) -//GO(pmap_getmaps, pF!) -//GO(pmap_getport, WF!LLu) -//GO(pmap_rmtcall, uF!LLL@p@p?p) #ifdef STATICBUILD -//GO(pmap_set, iFLLiW) +//GO(pmap_getmaps, pFp) +//GO(pmap_getport, WFpLLu) +//GO(pmap_rmtcall, "uF!LLL@p@p?p") +//GO(pmap_set, iFLLii) //GO(pmap_unset, iFLL) #else -GO(pmap_set, iFLLiW) +GO(pmap_getmaps, pFp) +GO(pmap_getport, WFpLLu) +//GO(pmap_rmtcall, "uF!LLL@p@p?p") +GO(pmap_set, iFLLii) GO(pmap_unset, iFLL) #endif GO(__poll, iFpLi) GO(poll, iFpLi) GO(__poll_chk, iFpuiL) -GO(popen, pFpp) +GO(popen, SFpp) GO(posix_fadvise, iFilli) -GO(posix_fadvise64, iFilli) +GO(posix_fadvise64, iFiIIi) GO(posix_fallocate, iFill) -GO(posix_fallocate64, iFill) +GO(posix_fallocate64, iFiII) //GO(__posix_getopt, GO(posix_madvise, iFpLi) GO(posix_memalign, iFpLL) GOW(posix_openpt, iFi) GOM(posix_spawn, iFEpppppp) +GO(posix_spawn_file_actions_addclosefrom_np, iFpi) GOW(posix_spawnattr_destroy, iFp) GO(posix_spawnattr_getflags, iFpp) GO(posix_spawnattr_getpgroup, iFpp) @@ -1436,28 +1545,32 @@ GOM(posix_spawnp, iFEpppppp) GO(ppoll, iFpLpp) GO(__ppoll_chk, iFpuppL) GOWM(prctl, iFEiLLLL) -GO(pread, IFipUI) +GO(pread, lFipLl) GOW(__pread64, lFipLI) -GO(pread64, lFipLl) -//GO(__pread64_chk, +GO(pread64, lFipLI) +#ifdef LA64 +GO2(__pread64_chk, lFipLlL, __pread_chk) +#else +GO(__pread64_chk, lFipLlL) +#endif GO(__pread_chk, lFipLlL) GO(preadv, lFipil) GO(preadv2, lFipili) -GO(preadv64, lFipil) -GO(preadv64v2, lFipili) +GO(preadv64, lFipiI) +GO(preadv64v2, lFipiIi) GOM(printf, iFEpV) GOM(__printf_chk, iFEipV) //GO(__printf_fp, -//GO(printf_size, -//GO(printf_size_info, +GO(printf_size, iFSpp) +GO(printf_size_info, iFpLp) GO(prlimit, iFiupp) GOW(prlimit64, iFiupp) GO(process_vm_readv, lFipLpLL) GO(process_vm_writev, lFipLpLL) GO(profil, iFpLLu) //GO(__profile_frequency, -DATA(__progname, sizeof(void*)) -DATA(__progname_full, sizeof(void)) +DATA(__progname, 8) +DATA(__progname_full, 1) GOW(pselect, iFippppp) GO(psiginfo, vFpp) GO(psignal, vFip) @@ -1473,41 +1586,45 @@ GOM(ptrace, lFEuipp) GO(ptsname, pFi) GOW(ptsname_r, iFipL) //GO(__ptsname_r_chk, -GOW(putc, iFip) +GOW(putc, iFiS) GO(putchar, iFi) GO(putchar_unlocked, iFi) -GOW(putc_unlocked, iFip) +GOW(putc_unlocked, iFiS) GO(putenv, iFp) -GO(putgrent, iFpp) -//GO(putmsg, // Deprecated -//GO(putpmsg, // Deprecated -GO(putpwent, iFpp) +GO(putgrent, iFpS) +//GO(putmsg, +//GO(putpmsg, +GO(putpwent, iFpS) GOW(puts, iFp) +#ifdef STATICBUILD //GO(putsgent, -GO(putspent, iFpp) +#else +GO(putsgent, iFpS) +#endif +GO(putspent, iFpS) GOW(pututline, pFp) GO(pututxline, pFp) -GO(putw, iFip) -GO(putwc, uFup) -GO(putwchar, uFu) -GO(putwchar_unlocked, uFu) -GO(putwc_unlocked, uFup) +GO(putw, iFiS) +GO(putwc, uFiS) +GO(putwchar, uFi) +GO(putwchar_unlocked, uFi) +GO(putwc_unlocked, uFiS) GO(pvalloc, pFL) -GO(pwrite, IFipUI) +GO(pwrite, lFipLl) //GOW(__pwrite64, -GO(pwrite64, lFipLl) +GO(pwrite64, lFipLI) GO(pwritev, lFipil) GO(pwritev2, lFipili) -GO(pwritev64, lFipil) -GO(pwritev64v2, lFipili) -GO(qecvt, pFDipp) -GOW(qecvt_r, iFDipppL) -GO(qfcvt, pFDipp) -GO(qfcvt_r, iFDipppL) -GO(qgcvt, pFDip) +GO(pwritev64, lFipiI) +GO(pwritev64v2, lFipiIi) +GOD(qecvt, pFDipp, ecvt) +GOWD(qecvt_r, iFDipppL, ecvt_r) +GOD(qfcvt, pFDipp, fcvt) +GOD(qfcvt_r, iFDipppL, fcvt_r) +GOD(qgcvt, pFDip, gcvt) GOM(qsort, vFEpLLp) GOWM(qsort_r, vFEpLLpp) -//GO(query_module, // Deprecated +//GO(query_module, GO(quick_exit, vFi) GO(quotactl, iFipip) GO(raise, iFi) @@ -1522,16 +1639,16 @@ GO(rcmd_af, iFpWppppW) //DATAB(__rcmd_errstr, GOW(__read, lFipL) GO(read, lFipL) -GO(readahead, lFilL) +GO(readahead, lFiIL) GO(__read_chk, lFipLL) -GOW(readdir, pFp) // struct dirent is 280 bytes on x86_64 and ARM64 +GOW(readdir, pFp) GOW(readdir64, pFp) GOW(readdir64_r, iFppp) GOW(readdir_r, iFppp) GOWM(readlink, lFEppL) -GOM(readlinkat, iFEippL) -//GO(__readlinkat_chk, -//GO(__readlink_chk, +GOM(readlinkat, lFEippL) +GOM(__readlinkat_chk, lFEippLL) +GOM(__readlink_chk, lFEppLL) //GO(__read_nocancel, GOW(readv, lFipi) GO(realloc, pFpL) @@ -1539,7 +1656,7 @@ GO(reallocarray, pFpLL) GOM(realpath, pFEpp) GO2(__realpath_chk, pFEppv, my_realpath) GO(reboot, iFi) -//GOW(re_comp, // Deprecated +//GOW(re_comp, GOW(re_compile_fastmap, iFp) GOW(re_compile_pattern, pFpLp) GOW(__recv, lFipLi) @@ -1549,20 +1666,20 @@ GOW(recvfrom, lFipLipp) //GO(__recvfrom_chk, GO(recvmmsg, iFipuip) GO(recvmsg, lFipi) -//GOW(re_exec, // Deprecated +//GOW(re_exec, GOW(regcomp, iFppi) GOW(regerror, LFippL) GO(regexec, iFppLpi) GOW(regfree, vFp) GOM(__register_atfork, iFEpppp) -//GOW(register_printf_function, +//GOWM(register_printf_function, iFipp) GOW(register_printf_modifier, iFp) GOWM(register_printf_specifier, iFEipp) GOWM(register_printf_type, iFEp) -//GO(registerrpc, // Deprecated? +//GOM(registerrpc, iFiiippp) GO(remap_file_pages, iFpLiLi) -GOW(re_match, lFppllp) -//GOW(re_match_2, iFppipii!i) +GOW(re_match, iFppiip) +GOW(re_match_2, iFppipiipi) //DATA(re_max_failures, GO(remove, iFp) GO(removexattr, iFpp) @@ -1571,9 +1688,9 @@ GO(rename, iFpp) GOW(renameat, iFipip) GOW(renameat2, iFipipu) //DATAB(_res, -GOW(re_search, lFpplllp) -//GOW(re_search_2, iFppipiii!i) -//GOW(re_set_registers, vFp!upp) +GOW(re_search, iFppiiip) +GOW(re_search_2, iFppipiiipi) +GOW(re_set_registers, vFppupp) GOW(re_set_syntax, LFL) //DATAB(_res_hconf, GO(__res_iclose, vFpi) @@ -1586,11 +1703,15 @@ GO(res_nsearch, iFppiipi) //GO(__resolv_context_get_preinit, //GO(__resolv_context_put, //DATA(__resp, +#ifdef STATICBUILD //GO(__res_randomid, +#else +GO(__res_randomid, uFv) +#endif GO(__res_state, pFv) -//DATAB(re_syntax_options, +//DATAB(re_syntax_options, 8) GOW(revoke, iFp) -GO(rewind, vFp) +GO(rewind, vFS) GOW(rewinddir, vFp) GO(rexec, iFpipppp) GO(rexec_af, iFpippppW) @@ -1600,22 +1721,26 @@ GOW(rmdir, iFp) #ifdef STATICBUILD //DATAB(rpc_createerr, //GO(_rpc_dtablesize, iFv) -//GO(__rpc_thread_createerr, !Fv) -//GO(__rpc_thread_svc_fdset, !Fv) +//GO(__rpc_thread_createerr, "!Fv") +//GO(__rpc_thread_svc_fdset, "!Fv") //GO(__rpc_thread_svc_max_pollfd, pFv) //GO(__rpc_thread_svc_pollfd, pFv) #else //DATAB(rpc_createerr, GO(_rpc_dtablesize, iFv) -//GO(__rpc_thread_createerr, !Fv) -//GO(__rpc_thread_svc_fdset, !Fv) +//GO(__rpc_thread_createerr, "!Fv") +//GO(__rpc_thread_svc_fdset, "!Fv") GO(__rpc_thread_svc_max_pollfd, pFv) GO(__rpc_thread_svc_pollfd, pFv) #endif GO(rpmatch, iFp) GO(rresvport, iFp) GO(rresvport_af, iFpW) -//GO(rtime, iF!!!) +#ifdef STATICBUILD +//GO(rtime, +#else +GO(rtime, iFppp) +#endif GO(ruserok, iFpipp) GO(ruserok_af, iFpippW) //GO(ruserpass, @@ -1623,12 +1748,12 @@ GO(__sbrk, pFl) GO(sbrk, pFl) GOW(scalbn, dFdi) GOW(scalbnf, fFfi) -GOW(scalbnl, DFDi) +GOWD(scalbnl, DFDi, scalbn) GOWM(scandir, iFEpppp) GOWM(scandir64, iFEpppp) GOWM(scandirat, iFipppp) -//GO(scandirat64, iFipp@@) -//GO(scanf, iFpV) +//GOM(scandirat64, iFipppp) +GOM(scanf, iFpV) GO(__sched_cpualloc, pFL) GO(__sched_cpucount, iFLp) GO(__sched_cpufree, vFp) @@ -1669,13 +1794,13 @@ GOW(sendmmsg, iFipui) GO(sendmsg, lFipi) GOW(sendto, lFipLipu) GO(setaliasent, vFv) -GO(setbuf, vFpp) -GO(setbuffer, vFppL) +GO(setbuf, vFSp) +GO(setbuffer, vFSpL) GOWM(setcontext, iFEp) GO(setdomainname, iFpL) GO(setegid, iFu) GOW(setenv, iFppi) -//GO(_seterr_reply, vF!!) +//GOM(_seterr_reply, vFpp) GO(seteuid, iFu) GO(setfsent, iFv) GO(setfsgid, iFu) @@ -1686,16 +1811,16 @@ GO(setgroups, iFLp) GO(sethostent, vFi) GO(sethostid, iFl) GO(sethostname, iFpL) -//GO(setipv4sourcefilter, iFi??uu!) +GO(setipv4sourcefilter, iFiuuuup) GOW(setitimer, iFupp) GOM(_setjmp, iFEp) GOM(setjmp, iFEp) -GO(setlinebuf, vFp) +GO(setlinebuf, vFS) GO(setlocale, pFip) GO(setlogin, iFp) GO(setlogmask, iFi) GO(__setmntent, pFpp) -GOW(setmntent, pFpp) +GOW(setmntent, SFpp) GO(setnetent, vFi) GO(setnetgrent, iFp) GO(setns, iFii) @@ -1713,10 +1838,14 @@ GOWM(setrlimit, iFEup) GOW(setrlimit64, iFup) GO(setrpcent, vFi) GO(setservent, vFi) +#ifdef STATICBUILD //GO(setsgent, +#else +GO(setsgent, vFv) +#endif GOW(setsid, iFv) GOW(setsockopt, iFiiipu) -//GO(setsourcefilter, iFiupuuu!) +GO(setsourcefilter, iFiupuuup) GO(setspent, vFv) GOW(setstate, pFp) GOW(setstate_r, iFpp) @@ -1726,10 +1855,15 @@ GOW(setuid, iFu) GO(setusershell, vFv) GOW(setutent, vFv) GO(setutxent, vFv) -GO(setvbuf, iFppiL) +GO(setvbuf, iFSpiL) GO(setxattr, iFpppLi) -//GO(sgetsgent, -//GOW(sgetsgent_r, +#ifdef STATICBUILD +//GO(sgetsgent, pFp) +//GOW(sgetsgent_r, iFpppLp) +#else +GO(sgetsgent, pFp) +GOW(sgetsgent_r, iFpppLp) +#endif GO(sgetspent, pFp) GOW(sgetspent_r, iFpppLp) GO(shmat, pFipi) @@ -1742,7 +1876,7 @@ GOWM(sigaction, iFEipp) GO(__sigaddset, iFpi) GO(sigaddset, iFpi) GOWM(sigaltstack, iFEpp) -//GO(sigandset, +GO(sigandset, iFppp) GOW(sigblock, iFi) //GO(__sigdelset, GO(sigdelset, iFpi) @@ -1760,15 +1894,20 @@ GOWM(signal, pFEip) GO(signalfd, iFipi) GO(__signbit, iFd) GO(__signbitf, iFf) -GO(__signbitl, iFD) +GOD(__signbitl, iFD, __signbit) GO(sigorset, iFppp) +#ifdef STATICBUILD //GO(__sigpause, -//GOW(sigpause, // Deprecated +//GOW(sigpause, +#else +GO(__sigpause, iFii) +//GOW(sigpause, +#endif GO(sigpending, iFp) GOW(sigprocmask, iFipp) -//GOW(sigqueue, iFii?) +//GOW(sigqueue, "iFii?") GO(sigrelse, iFi) -//GOW(sigreturn, iF!) +GOW(sigreturn, iFp) GOM(sigset, pFEip) GOM(__sigsetjmp, iFEpi) GOM(sigsetjmp, iFEpi) @@ -1778,7 +1917,7 @@ GO(__sigsuspend, iFp) GOW(sigsuspend, iFp) GO(__sigtimedwait, iFppp) GOW(sigtimedwait, iFppp) -//GO(sigvec, // Deprecated +//GO(sigvec, GOW(sigwait, iFpp) GOW(sigwaitinfo, iFpp) GOW(sleep, uFu) @@ -1792,14 +1931,18 @@ GOW(socketpair, iFiiip) GO(splice, lFipipLu) GOM(sprintf, iFEppV) GOM(__sprintf_chk, iFEpilpV) +#ifdef STATICBUILD //GOW(sprofil, +#else +GOW(sprofil, iFpipu) +#endif GOW(srand, vFu) GO(srand48, vFl) GO(srand48_r, iFlp) GOW(srandom, vFu) GOW(srandom_r, iFup) GOM(sscanf, iFEppV) -//GOW(ssignal, @Fi@) +//GOWM(ssignal, pFip) //GO(sstk, GOM(__stack_chk_fail, vFEv) GOM(stat, iFEpp) @@ -1809,10 +1952,10 @@ GOW(statfs, iFpp) GOW(statfs64, iFpp) GOW(statvfs, iFpp) GOW(statvfs64, iFpp) -GO(statx, iFipiup) -DATA(stderr, sizeof(void*)) -DATA(stdin, sizeof(void*)) -DATA(stdout, sizeof(void*)) +GOM(statx, iFEipiup) +DATA(stderr, 8) +DATA(stdin, 8) +DATA(stdout, 8) //GOW(step, GOM(stime, iFEp) GO(__stpcpy, pFpp) @@ -1846,25 +1989,32 @@ GO(strcspn, LFpp) GO(__strdup, pFp) GOW(strdup, pFp) GO(strerror, pFi) +GOW(strerrorname_np, pFi) GO(strerror_l, pFip) GO(__strerror_r, pFipL) GO(strerror_r, pFipL) +#ifdef STATICBUILD //GO(strfmon, lFpLpV) //GO(__strfmon_l, +#else +GO(strfmon, lFpLpdddddd) // should be V, but only double are allowed... +//GO(__strfmon_l, +#endif GOW(strfmon_l, lFpLppdddddd) // should be V, but only double are allowed... GO(strfromd, iFpLpd) GO(strfromf, iFpLpf) -GO(strfromf128, iFpLpD) +GOD(strfromf128, iFpLpD, strfromf64) GO(strfromf32, iFpLpf) GO(strfromf32x, iFpLpd) GO(strfromf64, iFpLpd) -GO(strfromf64x, iFpLpD) -GO(strfroml, iFpLpD) +GOD(strfromf64x, iFpLpD, strfromf32x) +GOD(strfroml, iFpLpD, strfromd) GO(strfry, pFp) GO(strftime, LFpLpp) GO(__strftime_l, LFpLppL) GOW(strftime_l, LFpLppp) GO(strlen, LFp) +GO(__strlcpy_chk, LFppLL) GO(strncasecmp, iFppL) //GO(__strncasecmp_l, GO(strncasecmp_l, iFppLp) @@ -1880,7 +2030,7 @@ GO(strpbrk, pFpp) //GO(__strpbrk_c2, //GO(__strpbrk_c3, GO(strptime, pFppp) -//GOW(strptime_l, pFppp!) +GOW(strptime_l, pFpppp) GO(strrchr, pFpi) GOW(strsep, pFpp) //GO(__strsep_1c, @@ -1899,33 +2049,39 @@ GO(__strtod_l, dFppp) GOW(strtod_l, dFppp) //GO(__strtod_nan, GO(strtof, fFpp) -GO(strtof128, DFpp) +GOD(strtof128, DFpp, strtof64) //GO(__strtof128_internal, //GOW(strtof128_l, //GO(__strtof128_nan, GOW(strtof32, fFpp) -//GOW(strtof32_l, fFpp!) +GOW(strtof32_l, fFppp) GOW(strtof32x, dFpp) -//GOW(strtof32x_l, dFpp!) +GOW(strtof32x_l, dFppp) GOW(strtof64, dFpp) -//GOW(strtof64_l, dFpp!) -GOW(strtof64x, DFpp) -//GOW(strtof64x_l, DFpp!) +GOW(strtof64_l, dFppp) +GOWD(strtof64x, DFpp, strtof32x) +GOWD(strtof64x_l, DFppp, strtof32x_l) GO(__strtof_internal, fFppi) GO(__strtof_l, fFppL) GOW(strtof_l, fFppp) //GO(__strtof_nan, -GO(strtoimax, lFppi) -GO2(__isoc23_strtoimax, lFppi, strtoimax) +GO(strtoimax, IFppi) +GO2(__isoc23_strtoimax, IFppi, strtoimax) +GO2(__isoc23_strtoll_l, IFppip, strtoll_l) +GO2(__isoc23_strtoull_l, UFppip, strtoull_l) +GO2(__isoc23_vsscanf, iFEppA, my_vsscanf) +GO2(__isoc23_wcstoll, IFppi, wcstoll) +GO2(__isoc23_wcstoul, LFppi, wcstoul) +GO2(__isoc23_wcstoull, UFppi, wcstoull) GO(strtok, pFpp) GO(__strtok_r, pFppp) GOW(strtok_r, pFppp) //GO(__strtok_r_1c, GO(strtol, lFppi) -GO(strtold, DFpp) -GO(__strtold_internal, DFppi) -GO(__strtold_l, DFppp) -GOW(strtold_l, DFppp) +GOD(strtold, DFpp, strtod) +GOD(__strtold_internal, DFppi, __strtod_internal) +GOD(__strtold_l, DFppp, __strtod_l) +GOWD(strtold_l, DFppp, strtod_l) //GO(__strtold_nan, GO(__strtol_internal, lFppii) GO(__strtol_l, lFppi) @@ -1943,102 +2099,104 @@ GOW(strtoull, UFppi) GO(__strtoull_internal, UFppii) GOW(__strtoull_l, LFppip) GOW(strtoull_l, UFppip) -GO(strtoumax, LFppi) -GO2(__isoc23_strtoumax, LFppi, strtoumax) +GO(strtoumax, UFppi) +GO2(__isoc23_strtoumax, UFppi, strtoumax) GOW(strtouq, UFppi) //GO(__strverscmp, GOW(strverscmp, iFpp) GO(strxfrm, LFppL) GO(__strxfrm_l, LFppLL) GO(strxfrm_l, LFppLp) -//GO(stty, // Deprecated +//GO(stty, #ifdef STATICBUILD //DATAB(svcauthdes_stats, -//GO(svcerr_auth, vF!u) -//GO(svcerr_decode, vF!) -//GO(svcerr_noproc, vF!) -//GO(svcerr_noprog, vF!) -//GO(svcerr_progvers, vF!LL) -//GO(svcerr_systemerr, vF!) -//GO(svcerr_weakauth, vF!) +//GO(svcerr_auth, "vF!u") +//GO(svcerr_decode, "vF!") +//GO(svcerr_noproc, "vF!") +//GO(svcerr_noprog, "vF!") +//GO(svcerr_progvers, "vF!uu") +//GO(svcerr_systemerr, "vF!") +//GO(svcerr_weakauth, "vF!") //GO(svc_exit, vFv) -//GO(svcfd_create, !Fiuu) +//GO(svcfd_create, "!Fiuu") //DATAB(svc_fdset, //GO(svc_getreq, vFi) //GO(svc_getreq_common, vFi) //GO(svc_getreq_poll, vFpi) -//GO(svc_getreqset, vF!) +//GO(svc_getreqset, "vF!") //DATAB(svc_max_pollfd, //DATAB(svc_pollfd, -//GO(svcraw_create, !Fv) -//GO(svc_register, iF!LL@L) +//GO(svcraw_create, "!Fv") +//GO(svc_register, "iF!LL@i") //GO(svc_run, vFv) -//GO(svc_sendreply, iF!@p) -//GO(svctcp_create, !Fiuu) -//GO(svcudp_bufcreate, !Fiuu) -//GO(svcudp_create, !Fi) +//GO(svc_sendreply, "iF!@p") +//GO(svctcp_create, "!Fiuu") +//GO(svcudp_bufcreate, "!Fiuu") +//GO(svcudp_create, "!Fi") //GO(svcudp_enablecache, -//GO(svcunix_create, !Fiuup) +//GO(svcunix_create, "!Fiuup") //GO(svcunixfd_create, //GO(svc_unregister, vFLL) #else //DATAB(svcauthdes_stats, -//GO(svcerr_auth, vF!u) -//GO(svcerr_decode, vF!) -//GO(svcerr_noproc, vF!) -//GO(svcerr_noprog, vF!) -//GO(svcerr_progvers, vF!LL) -//GO(svcerr_systemerr, vF!) -//GO(svcerr_weakauth, vF!) +//GOM(svcerr_auth, vFpu) +//GOM(svcerr_decode, vFp) +//GOM(svcerr_noproc, vFp) +//GOM(svcerr_noprog, vFp) +//GOM(svcerr_progvers, vFpuu) +//GOM(svcerr_systemerr, vFp) +//GOM(svcerr_weakauth, vFp) GO(svc_exit, vFv) -//GO(svcfd_create, !Fiuu) -//DATAB(svc_fdset, +//GOM(svcfd_create, pFiuu) +//DATAB(svc_fdset, 128) GO(svc_getreq, vFi) GO(svc_getreq_common, vFi) GO(svc_getreq_poll, vFpi) -//GO(svc_getreqset, vF!) -//DATAB(svc_max_pollfd, -//DATAB(svc_pollfd, -//GO(svcraw_create, !Fv) -//GO(svc_register, iF!LL@L) +GO(svc_getreqset, vFp) +//DATAB(svc_max_pollfd, 4) +//DATAB(svc_pollfd, 8) +//GOM(svcraw_create, pFv) +//GOM(svc_register, iFpLLpi) GO(svc_run, vFv) -//GO(svc_sendreply, iF!@p) -//GO(svctcp_create, !Fiuu) -//GO(svcudp_bufcreate, !Fiuu) -//GO(svcudp_create, !Fi) -//GO(svcudp_enablecache, -//GO(svcunix_create, !Fiuup) -//GO(svcunixfd_create, +//GOM(svc_sendreply, iFppp) +//GOM(svctcp_create, pFiuu) +//GOM(svcudp_bufcreate, pFiuu) +//GOM(svcudp_create, pFi) +//GOM(svcudp_enablecache, iFpL) +//GOM(svcunix_create, pFiuup) +//GOM(svcunixfd_create, pFiuu) GO(svc_unregister, vFLL) #endif GO(swab, vFppl) GOWM(swapcontext, iFEpp) +#ifdef STATICBUILD //GOW(swapoff, //GOW(swapon, +#else +GOW(swapoff, iFp) +GOW(swapon, iFpi) +#endif GOM(swprintf, iFEpLpV) GOM(__swprintf_chk, iFEpLiLpV) GOM(swscanf, iFEppV) GOW(symlink, iFpp) GO(symlinkat, iFpip) GO(sync, vFv) -GO(sync_file_range, iFillu) +GO(sync_file_range, iFiIIu) GO(syncfs, iFi) GOM(syscall, lFEv) GOM(__sysconf, lFEi) -GOM(sysconf, IFEi) +GOM(sysconf, lFEi) #ifdef STATICBUILD //GO(__sysctl, -//GO(sysctl, -#else -GO(__sysctl, iFpipppL) -GOW(sysctl, iFpipppL) // Deprecated -#endif -#ifdef STATICBUILD -//DATA(_sys_errlist, sizeof(void*)) -//DATA(sys_errlist, sizeof(void*)) +//GOW(sysctl, +//DATA(_sys_errlist, 8) +//DATA(sys_errlist, 8) #else -DATA(_sys_errlist, sizeof(void*)) -DATA(sys_errlist, sizeof(void*)) +GOM(__sysctl, iFEpipppL) +GOWM(sysctl, iFEpipppL) +DATA(_sys_errlist, 8) +DATA(sys_errlist, 8) #endif GOW(sysinfo, iFp) GOM(syslog, vFEipV) @@ -2068,11 +2226,21 @@ GOW(textdomain, pFp) //GO(__tfind, GOWM(tfind, pFEppp) GOW(tgkill, iFiii) +#ifdef STATICBUILD //GO(thrd_current, -GO(thrd_exit, vFp) +#else +GO(thrd_current, LFv) +#endif +GO(thrd_exit, vFi) +#ifdef STATICBUILD //GO(thrd_equal, //GO(thrd_sleep, //GO(thrd_yield, +#else +GO(thrd_equal, iFLL) +GO(thrd_sleep, iFpp) +GO(thrd_yield, vFv) +#endif GO(time, lFp) GO(timegm, lFp) GOW(timelocal, lFp) @@ -2081,21 +2249,21 @@ GO(timerfd_gettime, iFip) GO(timerfd_settime, iFiipp) GOW(times, lFp) GO(timespec_get, iFpi) -DATAB(__timezone, sizeof(void*)) -DATAV(timezone, sizeof(void*)) -GO(tmpfile, pFv) -GOW(tmpfile64, pFv) +DATAB(__timezone, 8) +DATAV(timezone, 8) +GO(tmpfile, SFv) +GOW(tmpfile64, SFv) GO(tmpnam, pFp) GO(tmpnam_r, pFp) GO(toascii, iFi) //GOW(__toascii_l, GO(_tolower, iFi) GO(tolower, iFi) -//GO(__tolower_l, iFi!) +GO(__tolower_l, iFip) GOW(tolower_l, iFip) GO(_toupper, iFi) GO(toupper, iFi) -//GO(__toupper_l, iFi!) +GO(__toupper_l, iFip) GOW(toupper_l, iFip) //GO(__towctrans, GOW(towctrans, uFup) @@ -2108,8 +2276,8 @@ GOW(towupper, uFu) GO(__towupper_l, iFip) GOW(towupper_l, uFup) //GO(tr_break, -GO(truncate, iFpI) -GO(truncate64, iFpl) +GO(truncate, iFpl) +GO(truncate64, iFpI) //GO(__tsearch, GOWM(tsearch, pFEppp) GO(ttyname, pFi) @@ -2118,21 +2286,25 @@ GO(ttyname_r, iFipL) GO(ttyslot, iFv) //GO(__twalk, GOWM(twalk, vFEpp) -//GOW(twalk_r, vFp@p) -DATA(__tzname, sizeof(void*)) -DATA(tzname, sizeof(void*)) //type V +//GOWM(twalk_r, vFppp) +DATA(__tzname, 16) +DATAV(tzname, 16) GOW(tzset, vFv) GO(ualarm, uFuu) -GO(__uflow, iFp) +GO(__uflow, iFS) GOW(ulckpwdf, iFv) -//GOW(ulimit, lFiV) // Deprecated +#ifdef STATICBUILD +//GOW(ulimit, lFiV) +#else +GOW(ulimit, lFiN) +#endif GOW(umask, uFu) GOW(umount, iFp) GOW(umount2, iFpi) GOWM(uname, iFp) GO(__underflow, iFp) -GOW(ungetc, iFip) -GO(ungetwc, uFup) +GOW(ungetc, iFiS) +GO(ungetwc, uFuS) GOW(unlink, iFp) GO(unlinkat, iFipi) GO(unlockpt, iFi) @@ -2140,7 +2312,7 @@ GOW(unsetenv, iFp) GO(unshare, iFi) GOW(updwtmp, vFpp) GO(updwtmpx, vFpp) -//GO(uselib, // Deprecated +//GO(uselib, GO(__uselocale, pFp) GOW(uselocale, pFp) #ifdef STATICBUILD @@ -2149,7 +2321,7 @@ GOW(uselocale, pFp) GO(user2netname, iFpup) #endif GO(usleep, iFu) -//GO(ustat, // Deprecated +//GO(ustat, GO(utime, iFpp) GO(utimensat, iFippi) GOW(utimes, iFpp) @@ -2160,21 +2332,21 @@ GOWM(vasprintf, iFEppA) GOM(__vasprintf_chk, iFEpipp) GOM(vdprintf, iFEipA) GOM(__vdprintf_chk, iFEiipA) -//GO(verr, vFipA) -//GO(verrx, vFipA) +GOM(verr, vFEipA) +GOM(verrx, vFEipA) GOW(versionsort, iFpp) GOW(versionsort64, iFpp) //GO(__vfork, GOWM(vfork, iFEv) -GOM(vfprintf, iFEppA) +GOM(vfprintf, iFESpA) GOM(__vfprintf_chk, iFEpvpp) //GO(__vfscanf, -GOWM(vfscanf, iFEppA) -GOWM(vfwprintf, iFEppA) +GOWM(vfscanf, iFESpA) +GOWM(vfwprintf, iFESpA) GOM(__vfwprintf_chk, iFEpipA) -//GOW(vfwscanf, iFppA) +GOWM(vfwscanf, iFSpA) GO(vhangup, iFv) -//GO(vlimit, // Deprecated +//GO(vlimit, GO(vmsplice, lFipLu) GOM(vprintf, iFEpA) GOM(__vprintf_chk, iFEvpp) @@ -2191,12 +2363,12 @@ GOWM(__vswprintf_chk, iFEpuvvppp) GOM(vswscanf, iFEppA) GOM(vsyslog, vFEipA) GOM(__vsyslog_chk, vFEiipA) -//GO(vtimes, // Deprecated -//GO(vwarn, vFpA) -//GO(vwarnx, vFpA) +//GO(vtimes, +GOM(vwarn, vFpA) +GOM(vwarnx, vFpA) GOM(vwprintf, iFEpA) //GO(__vwprintf_chk, -//GO(vwscanf, iFpA) +GOM(vwscanf, iFpA) GOW(__wait, iFp) GOW(wait, iFp) GOW(wait3, iFpip) @@ -2210,15 +2382,15 @@ GOW(wcpcpy, pFpp) //GO(__wcpcpy_chk, GO(wcpncpy, pFppL) //GO(__wcpncpy_chk, -GO(wcrtomb, LFpup) +GO(wcrtomb, LFpip) GO(__wcrtomb_chk, LFpupL) GOW(wcscasecmp, iFpp) GO(__wcscasecmp_l, iFppp) GOW(wcscasecmp_l, iFppp) GOW(wcscat, pFpp) GO(__wcscat_chk, pFppL) -GO(wcschr, pFpu) -GO(wcschrnul, pFpu) +GO(wcschr, pFpi) +GO(wcschrnul, pFpi) GO(wcscmp, iFpp) GOW(wcscoll, iFpp) GO(__wcscoll_l, iFppp) @@ -2233,7 +2405,7 @@ GO(wcsftime_l, LFpLppp) GO(wcslen, LFp) GO(wcsncasecmp, iFppL) //GO(__wcsncasecmp_l, -//GOW(wcsncasecmp_l, iFppL!) +GOW(wcsncasecmp_l, iFppLp) GO(wcsncat, pFppL) GO(__wcsncat_chk, pFppLL) GO(wcsncmp, iFppL) @@ -2241,9 +2413,13 @@ GOW(wcsncpy, pFppL) GO(__wcsncpy_chk, pFppLL) GO(wcsnlen, LFpL) GO(wcsnrtombs, LFppLLp) -//GO(__wcsnrtombs_chk, +#ifdef STATICBUILD +//GO(__wcsnrtombs_chk, +#else +GO(__wcsnrtombs_chk, LFppLLpL) +#endif GO(wcspbrk, pFpp) -GO(wcsrchr, pFpu) +GO(wcsrchr, pFpi) GO(wcsrtombs, LFppLp) GO(__wcsrtombs_chk, LFppLpL) GO(wcsspn, LFpp) @@ -2253,46 +2429,52 @@ GO(wcstod, dFpp) //GO(__wcstod_l, GOW(wcstod_l, dFppp) GO(wcstof, fFpp) -GO(wcstof128, DFpp) +GOD(wcstof128, DFpp, wcstof64) //GO(__wcstof128_internal, //GOW(wcstof128_l, GOW(wcstof32, fFpp) -//GOW(wcstof32_l, fFpp!) +GOW(wcstof32_l, fFppp) GOW(wcstof32x, dFpp) -//GOW(wcstof32x_l, dFpp!) +GOW(wcstof32x_l, dFppp) GOW(wcstof64, dFpp) -//GOW(wcstof64_l, dFpp!) -GOW(wcstof64x, DFpp) -//GOW(wcstof64x_l, DFpp!) +GOW(wcstof64_l, dFppp) +GOWD(wcstof64x, DFpp, wcstof32x) +GOWD(wcstof64x_l, DFppp, wcstof32x_l) //GO(__wcstof_internal, //GO(__wcstof_l, -//GOW(wcstof_l, fFpp!) -GO(wcstoimax, lFppi) +GOW(wcstof_l, fFppp) +GO(wcstoimax, IFppi) GO(wcstok, pFppp) GO(wcstol, lFppi) -GO(wcstold, DFpp) +GOD(wcstold, DFpp, wcstod) //GO(__wcstold_internal, //GO(__wcstold_l, -//GOW(wcstold_l, DFpp!) +GOWD(wcstold_l, DFppp, wcstod_l) //GO(__wcstol_internal, //GO(__wcstol_l, GOW(wcstol_l, lFppip) +GO2(__isoc23_wcstol_l, lFppip, wcstol_l) GOW(wcstoll, IFppi) //GO(__wcstoll_internal, //GOW(__wcstoll_l, -//GOW(wcstoll_l, IFppi!) +GOW(wcstoll_l, IFppip) GO(wcstombs, LFppL) -//GO(__wcstombs_chk, +#ifdef STATICBUILD +//GO(__wcstombs_chk, LFppLL) // it's sometimes not defined, like in LA64 plateform, so lets no wrap it for now +#else +GO(__wcstombs_chk, LFppLL) +#endif GOW(wcstoq, IFppi) GO(wcstoul, LFppi) //GO(__wcstoul_internal, //GO(__wcstoul_l, GOW(wcstoul_l, LFppip) +GO2(__isoc23_wcstoul_l, LFppip, wcstoul_l) GOW(wcstoull, UFppi) //GO(__wcstoull_internal, //GOW(__wcstoull_l, -//GOW(wcstoull_l, UFppi!) -GO(wcstoumax, LFppi) +GOW(wcstoull_l, UFppip) +GO(wcstoumax, UFppi) GOW(wcstouq, UFppi) GOW(wcswcs, pFpp) GO(wcswidth, iFpL) @@ -2300,7 +2482,7 @@ GO(wcsxfrm, LFppL) GO(__wcsxfrm_l, LFppLL) GO(wcsxfrm_l, LFppLp) GO(wctob, iFu) -GO(wctomb, iFpu) +GO(wctomb, iFpi) GO(__wctomb_chk, iFpuL) GOW(wctrans, pFp) //GO(__wctrans_l, @@ -2308,8 +2490,8 @@ GOW(wctrans_l, pFpp) GOW(wctype, LFp) GOW(wctype_l, LFpp) GO(__wctype_l, LFpp) -GO(wcwidth, iFu) -GO(wmemchr, pFpuL) +GO(wcwidth, iFi) +GO(wmemchr, pFpiL) GO(wmemcmp, iFppL) GOW(wmemcpy, pFppL) GO(__wmemcpy_chk, pFppLL) @@ -2317,7 +2499,7 @@ GO(wmemmove, pFppL) GO(__wmemmove_chk, pFppLL) GOW(wmempcpy, pFppL) //GO(__wmempcpy_chk, -GO(wmemset, pFpuL) +GO(wmemset, pFpiL) GO(__wmemset_chk, pFpuLL) GO(wordexp, iFppi) GO(wordfree, vFp) @@ -2328,83 +2510,150 @@ GOW(__write, lFipL) GO(write, lFipL) //GO(__write_nocancel, GOW(writev, lFipi) -//GO(wscanf, iFpV) +GOM(wscanf, iFEpV) //GO(__wuflow, //GO(__wunderflow, -//GO(xdecrypt, // Deprecated -//GO(xdr_accepted_reply, -//GO(xdr_array, iF!ppuu@) +//GO(xdecrypt, +#ifdef STATICBUILD +//GOM(xdr_accepted_reply, iFpp) +//GOM(xdr_array, iFpppuup) //GO(xdr_authdes_cred, //GO(xdr_authdes_verf, -//GO(xdr_authunix_parms, iF!!) -//GO(xdr_bool, iF!p) -//GO(xdr_bytes, iF!ppu) -//GO(xdr_callhdr, iF!!) -//GO(xdr_callmsg, iF!!) -//GO(xdr_char, iF!p) +//GOM(xdr_authunix_parms, iFpp) +//GOM(xdr_bool, iFpp) +//GOM(xdr_bytes, iFpppu) +//GOM(xdr_callhdr, iFpp) +//GOM(xdr_callmsg, iFpp) +//GOM(xdr_char, iFpp) //GO(xdr_cryptkeyarg, //GO(xdr_cryptkeyarg2, //GO(xdr_cryptkeyres, -//GO(xdr_des_block, iF!!) -//GO(xdr_double, iF!p) -//GO(xdr_enum, iF!p) -//GO(xdr_float, iF!p) -//GO(xdr_free, vF@p) +//GOM(xdr_des_block, iFpp) +//GOM(xdr_double, iFpp) +//GOM(xdr_enum, iFpp) +//GOM(xdr_float, iFpp) +//GOM(xdr_free, vFpp) //GO(xdr_getcredres, -//GO(xdr_hyper, iF!p) -//GO(xdr_int, iF!p) -//GO(xdr_int16_t, iF!p) -//GO(xdr_int32_t, iF!p) -//GO(xdr_int64_t, iF!p) -//GO(xdr_int8_t, iF!p) +//GOM(xdr_hyper, iFpp) +//GOM(xdr_int, iFpp) +//GOM(xdr_int16_t, iFpp) +//GOM(xdr_int32_t, iFpp) +//GOM(xdr_int64_t, iFpp) +//GOM(xdr_int8_t, iFpp) //GO(xdr_keybuf, //GO(xdr_key_netstarg, //GO(xdr_key_netstres, //GO(xdr_keystatus, -//GO(xdr_long, iF!p) -//GO(xdr_longlong_t, iF!p) -//GO(xdrmem_create, vF!puu) +//GOM(xdr_long, iFpp) +//GOM(xdr_longlong_t, iFpp) +//GOM(xdrmem_create, vFppuu) //GO(xdr_netnamestr, -//GO(xdr_netobj, iF!!) -//GO(xdr_opaque, iF!pu) -//GO(xdr_opaque_auth, iF!!) -//GO(xdr_pmap, -//GO(xdr_pmaplist, -//GO(xdr_pointer, iF!pu@) -//GO(xdr_quad_t, iF!p) -//GO(xdrrec_create, vF!uup@@) -//GO(xdrrec_endofrecord, iF!i) -//GO(xdrrec_eof, iF!) -//GO(xdrrec_skiprecord, iF!) -//GO(xdr_reference, iF!pu@) -//GO(xdr_rejected_reply, -//GO(xdr_replymsg, iF!!) +//GOM(xdr_netobj, iFpp) +//GOM(xdr_opaque, iFppu) +//GOM(xdr_opaque_auth, iFpp) +//GOM(xdr_pmap, iFpp) +//GOM(xdr_pmaplist, iFpp) +//GOM(xdr_pointer, iFppup) +//GOM(xdr_quad_t, iFpp) +//GOM(xdrrec_create, vFpuuppp) +//GOM(xdrrec_endofrecord, iFpi) +//GOM(xdrrec_eof, iFp) +//GOM(xdrrec_skiprecord, iFp) +//GOM(xdr_reference, iFppup) +//GOM(xdr_rejected_reply, iFpp) +//GOM(xdr_replymsg, iFpp) //GO(xdr_rmtcall_args, //GO(xdr_rmtcallres, -//GO(xdr_short, iF!p) -//GO(xdr_sizeof, LF@p) -//GO(xdrstdio_create, vF!pu) -//GO(xdr_string, iF!pu) -//GO(xdr_u_char, iF!p) -//GO(xdr_u_hyper, iF!p) -//GO(xdr_u_int, iF!p) -//GO(xdr_uint16_t, iF!p) -//GO(xdr_uint32_t, iF!p) -//GO(xdr_uint64_t, iF!p) -//GO(xdr_uint8_t, iF!p) -//GO(xdr_u_long, iF!p) -//GO(xdr_u_longlong_t, iF!p) -//GO(xdr_union, iF!pp!@) +//GOM(xdr_short, iFpp) +//GOM(xdr_sizeof, LFpp) +//GOM(xdrstdio_create, vFpSu) +//GOM(xdr_string, iFppu) +//GOM(xdr_u_char, iFpp) +//GOM(xdr_u_hyper, iFpp) +//GOM(xdr_u_int, iFpp) +//GOM(xdr_uint16_t, iFpp) +//GOM(xdr_uint32_t, iFpp) +//GOM(xdr_uint64_t, iFpp) +//GOM(xdr_uint8_t, iFpp) +//GOM(xdr_u_long, iFpp) +//GOM(xdr_u_longlong_t, iFpp) +//GOM(xdr_union, iFppppp) //GO(xdr_unixcred, -//GO(xdr_u_quad_t, iF!p) -//GO(xdr_u_short, iF!p) -//GO(xdr_vector, iF!puu@) -#ifdef STATICBUILD +//GOM(xdr_u_quad_t, iFpp) +//GOM(xdr_u_short, iFpp) +//GOM(xdr_vector, iFppuup) //GO(xdr_void, -//GO(xdr_wrapstring, iF!p) +//GO(xdr_wrapstring, "iF!p") #else +//GOM(xdr_accepted_reply, iFpp) +//GOM(xdr_array, iFpppuup) +//GO(xdr_authdes_cred, +//GO(xdr_authdes_verf, +//GOM(xdr_authunix_parms, iFpp) +//GOM(xdr_bool, iFpp) +//GOM(xdr_bytes, iFpppu) +//GOM(xdr_callhdr, iFpp) +//GOM(xdr_callmsg, iFpp) +//GOM(xdr_char, iFpp) +//GOM(xdr_cryptkeyarg, iFpp) +//GOM(xdr_cryptkeyarg2, iFpp) +//GOM(xdr_cryptkeyres, iFpp) +//GOM(xdr_des_block, iFpp) +//GOM(xdr_double, iFpp) +//GOM(xdr_enum, iFpp) +//GOM(xdr_float, iFpp) +GO(xdr_free, vFpp) +//GOM(xdr_getcredres, iFpp) +//GOM(xdr_hyper, iFpp) +//GOM(xdr_int, iFpp) +//GOM(xdr_int16_t, iFpp) +//GOM(xdr_int32_t, iFpp) +//GOM(xdr_int64_t, iFpp) +//GOM(xdr_int8_t, iFpp) +//GOM(xdr_keybuf, iFpp) +//GOM(xdr_key_netstarg, iFpp) +//GOM(xdr_key_netstres, iFpp) +//GOM(xdr_keystatus, iFpp) +//GOM(xdr_long, iFpp) +//GOM(xdr_longlong_t, iFpp) +//GOM(xdrmem_create, vFppuu) +//GOM(xdr_netnamestr, iFpp) +//GOM(xdr_netobj, iFpp) +//GOM(xdr_opaque, iFppu) +//GOM(xdr_opaque_auth, iFpp) +//GOM(xdr_pmap, iFpp) +//GOM(xdr_pmaplist, iFpp) +//GOM(xdr_pointer, iFppup) +//GOM(xdr_quad_t, iFpp) +//GOM(xdrrec_create, vFpuuppp) +//GOM(xdrrec_endofrecord, iFpi) +//GOM(xdrrec_eof, iFp) +//GOM(xdrrec_skiprecord, iFp) +//GOM(xdr_reference, iFppup) +//GOM(xdr_rejected_reply, iFpp) +//GOM(xdr_replymsg, iFpp) +//GO(xdr_rmtcall_args, +//GO(xdr_rmtcallres, +//GOM(xdr_short, iFpp) +//GOM(xdr_sizeof, LFpp) +//GOM(xdrstdio_create, vFpSu) +GO(xdr_string, iFppu) +//GOM(xdr_u_char, iFpp) +//GOM(xdr_u_hyper, iFpp) +//GOM(xdr_u_int, iFpp) +//GOM(xdr_uint16_t, iFpp) +//GOM(xdr_uint32_t, iFpp) +//GOM(xdr_uint64_t, iFpp) +//GOM(xdr_uint8_t, iFpp) +//GOM(xdr_u_long, iFpp) +//GOM(xdr_u_longlong_t, iFpp) +//GOM(xdr_union, iFppppp) +//GOM(xdr_unixcred, iFpp) +//GOM(xdr_u_quad_t, iFpp) +//GOM(xdr_u_short, iFpp) +//GOM(xdr_vector, iFppuup) GO(xdr_void, iFv) -//GO(xdr_wrapstring, iF!p) +//GOM(xdr_wrapstring, iFpp) #endif //GO(xencrypt, #ifdef STATICBUILD @@ -2417,8 +2666,8 @@ GOM(__xmknodat, iFEiipup) GO(__xpg_basename, pFp) GOW(__xpg_sigpause, iFi) GO(__xpg_strerror_r, pFipL) -//GO(xprt_register, vF!) -//GO(xprt_unregister, vF!) +//GOM(xprt_register, vFp) +//GOM(xprt_unregister, vFp) GOM(__xstat, iFEipp) GOM(__xstat64, iFEipp) @@ -2436,8 +2685,8 @@ GOM(strlcat, LFEppL) GOWM(__cxa_pure_virtual, vFEv) // create a function to trap pure virtual call -DATAM(program_invocation_name, sizeof(void*)) -DATAM(program_invocation_short_name, sizeof(void*)) +DATAM(program_invocation_name, 8) +DATAM(program_invocation_short_name, 8) DATAM(__libc_single_threaded, 1) @@ -2448,19 +2697,39 @@ GO(iconvctl, iFlip) #endif GO(dummy__ZnwmSt11align_val_tRKSt9nothrow_t, pFLLp) // for mallochook.c +GOWM(_ZGTtnaX, pFL) //%noE +GOWM(_ZGTtdlPv, vFp) //%noE +GOWM(_ZGTtnam, pFL) //%noE +GOWM(_ITM_RU1, CFp) //%noE +GOWM(_ITM_RU4, uFp) //%noE +GOWM(_ITM_RU8, UFp) //%noE +GOWM(_ITM_memcpyRtWn, vFppL) //%noE +GOWM(_ITM_memcpyRnWt, vFppL) //%noE + +GOM(__udivti3, HFHH) //%noE + #ifdef ANDROID GOM(__libc_init, vFEpppp) GO(__errno, pFv) +GO(android_set_abort_message, vFp) #else // Those symbols don't exist in non-Android builds -//GOM(__libc_init, -//GO(__errno, +//GOM(__libc_init, +//GO(__errno, +//GO(android_set_abort_message, vFp) #endif #ifdef STATICBUILD GO(dummy_pFLp, pFLp) GO(dummy_pFpLLp, pFpLLp) +// not needed in static build +//GO(dummy_pFpLLi, pFpLLi) +//GO(dummy_iFiiULippp, iFiiULippp) #else +GO(dummy_pFpLLi, pFpLLi) //needed for vulkanoverlay +GO(dummy_iFiiULippp, iFiiULippp) //needed for vulkanoverlay // not needed in no-static build //GO(dummy_pFLp, pFLp) //GO(dummy_pFpLLp, pFpLLp) #endif + +GO(arc4random, uFv) diff --git a/src/wrapped/wrappedlibcups.c b/src/wrapped/wrappedlibcups.c index 5e4f631..bd5afa7 100644 --- a/src/wrapped/wrappedlibcups.c +++ b/src/wrapped/wrappedlibcups.c @@ -18,13 +18,8 @@ #include "emu/x64emu_private.h" #include "myalign.h" -const char* libcupsName = -#ifdef ANDROID - "libcups.so" -#else - "libcups.so.2" -#endif - ; +const char* libcupsName = "libcups.so.2"; +#define ALTNAME "libcups.so" #define LIBNAME libcups @@ -85,6 +80,50 @@ static void* find_cups_password_cb2_t_Fct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for libcups cups_password_cb2_t callback\n"); return NULL; } +// cups_raster_iocb_t ... +#define GO(A) \ +static uintptr_t my_cups_raster_iocb_t_fct_##A = 0; \ +static ssize_t my_cups_raster_iocb_t_##A(void* a, void* b, size_t c) \ +{ \ + return (ssize_t)RunFunctionFmt(my_cups_raster_iocb_t_fct_##A, "ppL", a, b, c); \ +} +SUPER() +#undef GO +static void* find_cups_raster_iocb_t_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_cups_raster_iocb_t_fct_##A == (uintptr_t)fct) return my_cups_raster_iocb_t_##A; + SUPER() + #undef GO + #define GO(A) if(my_cups_raster_iocb_t_fct_##A == 0) {my_cups_raster_iocb_t_fct_##A = (uintptr_t)fct; return my_cups_raster_iocb_t_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcups cups_raster_iocb_t callback\n"); + return NULL; +} +// cups_interpret_cb_t ... +#define GO(A) \ +static uintptr_t my_cups_interpret_cb_t_fct_##A = 0; \ +static int my_cups_interpret_cb_t_##A(void* a, int b) \ +{ \ + return (int)RunFunctionFmt(my_cups_interpret_cb_t_fct_##A, "pi", a, b); \ +} +SUPER() +#undef GO +static void* find_cups_interpret_cb_t_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_cups_interpret_cb_t_fct_##A == (uintptr_t)fct) return my_cups_interpret_cb_t_##A; + SUPER() + #undef GO + #define GO(A) if(my_cups_interpret_cb_t_fct_##A == 0) {my_cups_interpret_cb_t_fct_##A = (uintptr_t)fct; return my_cups_interpret_cb_t_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcups cups_interpret_cb_t callback\n"); + return NULL; +} #undef SUPER @@ -98,4 +137,14 @@ EXPORT void my_cupsSetPasswordCB2(x64emu_t* emu, void* f, void* data) my->cupsSetPasswordCB2(find_cups_password_cb2_t_Fct(f), data); } +EXPORT void* my__cupsRasterNew(x64emu_t* emu, void* f, void* ctx, uint32_t mode) +{ + return my->_cupsRasterNew(find_cups_raster_iocb_t_Fct(f), ctx, mode); +} + +EXPORT int my__cupsRasterInterpretPPD(x64emu_t* emu, void* h, void* ppd, int noptions, void* options, void* f) +{ + return my->_cupsRasterInterpretPPD(h, ppd, noptions, options, find_cups_interpret_cb_t_Fct(f)); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibcups_private.h b/src/wrapped/wrappedlibcups_private.h index 13f3b98..b7e3cd0 100644 --- a/src/wrapped/wrappedlibcups_private.h +++ b/src/wrapped/wrappedlibcups_private.h @@ -1,111 +1,111 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//GO(cupsAddDest, -//GO(cupsAddIntegerOption, +GO(cupsAddDest, iFppip) +GO(cupsAddIntegerOption, iFpiip) GO(cupsAddOption, iFppip) -//GO(cupsAdminCreateWindowsPPD, -//GO(cupsAdminExportSamba, -//GO(cupsAdminGetServerSettings, -//GO(cupsAdminSetServerSettings, -//GO(cupsArrayAdd, +GO(cupsAdminCreateWindowsPPD, pFpppi) +GO(cupsAdminExportSamba, iFpppppS) +GO(cupsAdminGetServerSettings, iFppp) +GO(cupsAdminSetServerSettings, iFpip) +GO(cupsArrayAdd, iFpp) //GO(_cupsArrayAddStrings, -//GO(cupsArrayClear, -//GO(cupsArrayCount, -//GO(cupsArrayCurrent, -//GO(cupsArrayDelete, -//GO(cupsArrayDup, -//GO(cupsArrayFind, -//GO(cupsArrayFirst, -//GO(cupsArrayGetIndex, -//GO(cupsArrayGetInsert, -//GO(cupsArrayIndex, -//GO(cupsArrayInsert, -//GO(cupsArrayLast, -//GO(cupsArrayNew, -//GO(cupsArrayNew2, -//GO(cupsArrayNew3, +GO(cupsArrayClear, vFp) +GO(cupsArrayCount, iFp) +GO(cupsArrayCurrent, pFp) +GO(cupsArrayDelete, vFp) +GO(cupsArrayDup, pFp) +GO(cupsArrayFind, pFpp) +GO(cupsArrayFirst, pFp) +GO(cupsArrayGetIndex, iFp) +GO(cupsArrayGetInsert, iFp) +GO(cupsArrayIndex, pFpi) +GO(cupsArrayInsert, iFpp) +GO(cupsArrayLast, pFp) +//GOM(cupsArrayNew, pFEpp) +//GOM(cupsArrayNew2, pFEpppi) +//GOM(cupsArrayNew3, pFEpppipp) //GO(_cupsArrayNewStrings, -//GO(cupsArrayNext, -//GO(cupsArrayPrev, -//GO(cupsArrayRemove, -//GO(cupsArrayRestore, -//GO(cupsArraySave, -//GO(cupsArrayUserData, -//GO(cupsBackChannelRead, -//GO(cupsBackChannelWrite, -//GO(cupsBackendDeviceURI, -//GO(cupsBackendReport, +GO(cupsArrayNext, pFp) +GO(cupsArrayPrev, pFp) +GO(cupsArrayRemove, iFpp) +GO(cupsArrayRestore, pFp) +GO(cupsArraySave, iFp) +GO(cupsArrayUserData, pFp) +GO(cupsBackChannelRead, lFpLd) +GO(cupsBackChannelWrite, lFpLd) +GO(cupsBackendDeviceURI, pFp) +GO(cupsBackendReport, vFpppppp) //GO(_cupsBufferGet, //GO(_cupsBufferRelease, -//GO(cupsCancelDestJob, -//GO(cupsCancelJob, -//GO(cupsCancelJob2, +GO(cupsCancelDestJob, iFppi) +GO(cupsCancelJob, iFpi) +GO(cupsCancelJob2, iFppii) //GO(_cupsCharmapFlush, -//GO(cupsCharsetToUTF8, -//GO(cupsCheckDestSupported, -//GO(cupsCloseDestJob, +GO(cupsCharsetToUTF8, iFppii) +GO(cupsCheckDestSupported, iFppppp) +GO(cupsCloseDestJob, iFpppi) //GO(_cupsCondBroadcast, //GO(_cupsCondInit, //GO(_cupsCondWait, //GO(_cupsConnect, -//GO(cupsConnectDest, +//GOM(cupsConnectDest, pFEpuippLpp) //GO(_cupsConvertOptions, GO(cupsCopyDest, iFpip) -//GO(cupsCopyDestConflicts, -//GO(cupsCopyDestInfo, +GO(cupsCopyDestConflicts, iFpppippppppp) +GO(cupsCopyDestInfo, pFpp) //GO(_cupsCreateDest, -//GO(cupsCreateDestJob, +GO(cupsCreateDestJob, iFpppppip) GO(cupsCreateJob, iFpppip) //DATA(_cups_debug_fd, //DATA(_cups_debug_level, -//GO(cupsDirClose, -//GO(cupsDirOpen, -//GO(cupsDirRead, -//GO(cupsDirRewind, -//GO(cupsDoAuthentication, -//GO(cupsDoFileRequest, -//GO(cupsDoIORequest, -//GO(cupsDoRequest, -//GO(cupsEncodeOptions, -//GO(cupsEncodeOptions2, +GO(cupsDirClose, vFp) +GO(cupsDirOpen, pFp) +GO(cupsDirRead, pFp) +GO(cupsDirRewind, vFp) +GO(cupsDoAuthentication, iFppp) +GO(cupsDoFileRequest, pFpppp) +GO(cupsDoIORequest, pFpppii) +GO(cupsDoRequest, pFppp) +GO(cupsEncodeOptions, vFpip) +GO(cupsEncodeOptions2, vFpipi) //GO(_cupsEncodingName, -//GO(cupsEncryption, +GO(cupsEncryption, uFv) GOM(cupsEnumDests, iFEuipuupp) //GO(_cupsFileCheck, //GO(_cupsFileCheckFilter, -//GO(cupsFileClose, -//GO(cupsFileCompression, -//GO(cupsFileEOF, -//GO(cupsFileFind, -//GO(cupsFileFlush, -//GO(cupsFileGetChar, -//GO(cupsFileGetConf, -//GO(cupsFileGetLine, -//GO(cupsFileGets, -//GO(cupsFileLock, -//GO(cupsFileNumber, -//GO(cupsFileOpen, -//GO(cupsFileOpenFd, +GO(cupsFileClose, iFp) +GO(cupsFileCompression, iFp) +GO(cupsFileEOF, iFp) +GO(cupsFileFind, pFppipi) +GO(cupsFileFlush, iFp) +GO(cupsFileGetChar, iFp) +GO(cupsFileGetConf, pFppLpp) +GO(cupsFileGetLine, LFppL) +GO(cupsFileGets, pFppL) +GO(cupsFileLock, iFpi) +GO(cupsFileNumber, iFp) +GO(cupsFileOpen, pFpp) +GO(cupsFileOpenFd, pFip) //GO(_cupsFilePeekAhead, -//GO(cupsFilePeekChar, -//GO(cupsFilePrintf, -//GO(cupsFilePutChar, -//GO(cupsFilePutConf, -//GO(cupsFilePuts, -//GO(cupsFileRead, -//GO(cupsFileRewind, -//GO(cupsFileSeek, -//GO(cupsFileStderr, -//GO(cupsFileStdin, -//GO(cupsFileStdout, -//GO(cupsFileTell, -//GO(cupsFileUnlock, -//GO(cupsFileWrite, -//GO(cupsFindDestDefault, -//GO(cupsFindDestReady, -//GO(cupsFindDestSupported, +GO(cupsFilePeekChar, iFp) +//GOM(cupsFilePrintf, iFEppV) +GO(cupsFilePutChar, iFpi) +GO(cupsFilePutConf, lFppp) +GO(cupsFilePuts, iFpp) +GO(cupsFileRead, lFppL) +GO(cupsFileRewind, lFp) +GO(cupsFileSeek, lFpl) +GO(cupsFileStderr, pFv) +GO(cupsFileStdin, pFv) +GO(cupsFileStdout, pFv) +GO(cupsFileTell, lFp) +GO(cupsFileUnlock, iFp) +GO(cupsFileWrite, lFppL) +GO(cupsFindDestDefault, pFpppp) +GO(cupsFindDestReady, pFpppp) +GO(cupsFindDestSupported, pFpppp) GO(cupsFinishDestDocument, iFppp) GO(cupsFinishDocument, iFpp) GO(cupsFreeDestInfo, vFp) @@ -114,24 +114,24 @@ GO(cupsFreeJobs, vFip) GO(cupsFreeOptions, vFip) //GO(_cupsGet1284Values, GO(cupsGetClasses, iFp) -//GO(cupsGetConflicts, +GO(cupsGetConflicts, iFpppp) GO(cupsGetDefault, pFv) GO(cupsGetDefault2, pFp) GO(cupsGetDest, pFppip) -//GO(cupsGetDestMediaByIndex, +GO(cupsGetDestMediaByIndex, iFpppiup) GO(cupsGetDestMediaByName, iFppppup) GO(cupsGetDestMediaBySize, iFpppiiup) -//GO(cupsGetDestMediaCount, -//GO(cupsGetDestMediaDefault, +GO(cupsGetDestMediaCount, iFpppu) +GO(cupsGetDestMediaDefault, iFpppup) //GO(_cupsGetDestResource, //GO(_cupsGetDests, GO(cupsGetDests, iFp) GO(cupsGetDests2, iFpp) -//GO(cupsGetDestWithURI, -//GO(cupsGetDevices, -//GO(cupsGetFd, -//GO(cupsGetFile, -//GO(cupsGetIntegerOption, +GO(cupsGetDestWithURI, pFpp) +//GOM(cupsGetDevices, iFEpipppp) +GO(cupsGetFd, iFppi) +GO(cupsGetFile, iFppp) +GO(cupsGetIntegerOption, iFpip) GO(cupsGetJobs, iFppii) GO(cupsGetJobs2, iFpppii) GO(cupsGetNamedDest, pFppp) @@ -143,14 +143,14 @@ GO(cupsGetPPD, pFp) GO(cupsGetPPD2, pFpp) GO(cupsGetPPD3, iFppppL) GO(cupsGetPrinters, iFp) -//GO(cupsGetResponse, +GO(cupsGetResponse, pFpp) GO(cupsGetServerPPD, pFpp) //GO(_cupsGlobalLock, //GO(_cupsGlobals, //GO(_cupsGlobalUnlock, //GO(_cupsGSSServiceName, -//GO(cupsHashData, -//GO(cupsHashString, +GO(cupsHashData, lFppLpL) +GO(cupsHashString, pFpLpL) GO(cupsLangDefault, pFv) GO(cupsLangEncoding, pFp) GO(cupsLangFlush, vFv) @@ -163,10 +163,10 @@ GO(cupsLangGet, pFp) //GO(_cupsLangString, GO(cupsLastError, iFv) GO(cupsLastErrorString, pFv) -//GO(cupsLocalizeDestMedia, +GO(cupsLocalizeDestMedia, pFpppup) GO(cupsLocalizeDestOption, pFpppp) GO(cupsLocalizeDestValue, pFppppp) -//GO(cupsMakeServerCredentials, +GO(cupsMakeServerCredentials, iFppipl) GO(cupsMarkOptions, iFpip) //GO(_cupsMessageFree, //GO(_cupsMessageLoad, @@ -176,49 +176,58 @@ GO(cupsMarkOptions, iFpip) //GO(_cupsMutexLock, //GO(_cupsMutexUnlock, //GO(_cupsNextDelay, -//GO(cupsNotifySubject, +GO(cupsNotifySubject, pFpp) GO(cupsNotifyText, pFpp) GO(cupsParseOptions, iFpip) GO(cupsPrintFile, iFpppip) GO(cupsPrintFile2, iFppppip) GO(cupsPrintFiles, iFpippip) GO(cupsPrintFiles2, iFppippip) -//GO(cupsPutFd, -//GO(cupsPutFile, -//GO(cupsReadResponseData, +GO(cupsPutFd, iFppi) +GO(cupsPutFile, iFppp) +GO(_cupsRasterDelete, vFp) +GO(_cupsRasterErrorString, pFv) +GO(_cupsRasterInitPWGHeader, iFpppiipp) +GOM(_cupsRasterInterpretPPD, iFppipp) +GOM(_cupsRasterNew, pFEppu) +GO(_cupsRasterReadHeader, uFp) +GO(_cupsRasterReadPixels, uFppu) +GO(_cupsRasterWriteHeader, uFp) +GO(_cupsRasterWritePixels, uFppu) +GO(cupsReadResponseData, lFppL) GO(cupsRemoveDest, iFppip) GO(cupsRemoveOption, iFpip) -//GO(cupsResolveConflicts, +GO(cupsResolveConflicts, iFppppp) //GO(_cupsRWInit, //GO(_cupsRWLockRead, //GO(_cupsRWLockWrite, //GO(_cupsRWUnlock, //GO(_cups_safe_vsnprintf, -//GO(cupsSendRequest, +GO(cupsSendRequest, iFpppL) GO(cupsServer, pFv) -//GO(cupsSetClientCertCB, -//GO(cupsSetCredentials, +//GOM(cupsSetClientCertCB, vFEpp) +GO(cupsSetCredentials, iFp) GO(cupsSetDefaultDest, vFppip) //GO(_cupsSetDefaults, -//GO(cupsSetDests, -//GO(cupsSetDests2, -//GO(cupsSetEncryption, +GO(cupsSetDests, vFip) +GO(cupsSetDests2, iFpip) +GO(cupsSetEncryption, vFu) //GO(_cupsSetError, //GO(_cupsSetHTTPError, //GO(_cupsSetLocale, //GO(_cupsSetNegotiateAuthString, -//GO(cupsSetPasswordCB, +//GOM(cupsSetPasswordCB, vFEp) GOM(cupsSetPasswordCB2, vFEpp) -//GO(cupsSetServer, -//GO(cupsSetServerCertCB, -//GO(cupsSetServerCredentials, -//GO(cupsSetUser, -//GO(cupsSetUserAgent, -//GO(cupsSideChannelDoRequest, -//GO(cupsSideChannelRead, -//GO(cupsSideChannelSNMPGet, -//GO(cupsSideChannelSNMPWalk, -//GO(cupsSideChannelWrite, +GO(cupsSetServer, vFp) +//GOM(cupsSetServerCertCB, vFEpp) +GO(cupsSetServerCredentials, iFppi) +GO(cupsSetUser, vFp) +GO(cupsSetUserAgent, vFp) +GO(cupsSideChannelDoRequest, uFuppd) +GO(cupsSideChannelRead, iFppppd) +GO(cupsSideChannelSNMPGet, uFpppd) +//GOM(cupsSideChannelSNMPWalk, uFEpdpp) +GO(cupsSideChannelWrite, iFuupid) //GO(_cupsSNMPClose, //GO(_cupsSNMPCopyOID, //GO(_cupsSNMPDefaultCommunity, @@ -246,138 +255,138 @@ GO(cupsStartDocument, iFppippi) //GO(_cupsStrRetain, //GO(_cupsStrScand, //GO(_cupsStrStatistics, -//GO(cupsTempFd, -//GO(cupsTempFile, -//GO(cupsTempFile2, +GO(cupsTempFd, iFpi) +GO(cupsTempFile, pFpi) +GO(cupsTempFile2, pFpi) //GO(_cupsThreadCancel, //GO(_cupsThreadCreate, //GO(_cupsThreadDetach, //GO(_cupsThreadWait, -//GO(cupsUser, -//GO(cupsUserAgent, +GO(cupsUser, pFv) +GO(cupsUserAgent, pFv) //GO(_cupsUserDefault, -//GO(cupsUTF32ToUTF8, -//GO(cupsUTF8ToCharset, -//GO(cupsUTF8ToUTF32, -GO(cupsWriteRequestData, iFppl) +GO(cupsUTF32ToUTF8, iFppi) +GO(cupsUTF8ToCharset, iFppii) +GO(cupsUTF8ToUTF32, iFppi) +GO(cupsWriteRequestData, iFppL) -//GO(httpAcceptConnection, -//GO(httpAddCredential, -//GO(httpAddrAny, -//GO(httpAddrClose, -//GO(httpAddrConnect, -//GO(httpAddrConnect2, -//GO(httpAddrCopyList, -//GO(httpAddrEqual, -//GO(httpAddrFamily, -//GO(httpAddrFreeList, -//GO(httpAddrGetList, -//GO(httpAddrLength, -//GO(httpAddrListen, -//GO(httpAddrLocalhost, -//GO(httpAddrLookup, -//GO(httpAddrPort, +GO(httpAcceptConnection, pFii) +GO(httpAddCredential, iFppL) +GO(httpAddrAny, iFp) +GO(httpAddrClose, iFpi) +GO(httpAddrConnect, pFpp) +GO(httpAddrConnect2, pFppip) +GO(httpAddrCopyList, pFp) +GO(httpAddrEqual, iFpp) +GO(httpAddrFamily, iFp) +GO(httpAddrFreeList, vFp) +GO(httpAddrGetList, pFpip) +GO(httpAddrLength, iFp) +GO(httpAddrListen, iFpi) +GO(httpAddrLocalhost, iFp) +GO(httpAddrLookup, pFppi) +GO(httpAddrPort, iFp) //GO(_httpAddrSetPort, -//GO(httpAddrString, -//GO(httpAssembleURI, -//GO(httpAssembleURIf, -//GO(httpAssembleUUID, +GO(httpAddrString, pFppi) +GO(httpAssembleURI, iFupipppip) +//GOM(httpAssembleURIf, iFEupipppipV) +GO(httpAssembleUUID, pFpipipL) GO(httpBlocking, vFpi) -//GO(httpCheck, -//GO(httpClearCookie, -//GO(httpClearFields, +GO(httpCheck, iFp) +GO(httpClearCookie, vFp) +GO(httpClearFields, vFp) GO(httpClose, vFp) -//GO(httpCompareCredentials, -//GO(httpConnect, -GO(httpConnect2, pFpipiiiip) -GO(httpConnectEncrypt, pFpii) -//GO(httpCopyCredentials, +GO(httpCompareCredentials, iFpp) +GO(httpConnect, pFpi) +GO(httpConnect2, pFpipiuiip) +GO(httpConnectEncrypt, pFpiu) +GO(httpCopyCredentials, iFpp) //GO(_httpCreateCredentials, -//GO(httpCredentialsAreValidForName, -//GO(httpCredentialsGetExpiration, -//GO(httpCredentialsGetTrust, -//GO(httpCredentialsString, -//GO(httpDecode64, -//GO(httpDecode64_2, +GO(httpCredentialsAreValidForName, iFpp) +GO(httpCredentialsGetExpiration, lFp) +GO(httpCredentialsGetTrust, uFpp) +GO(httpCredentialsString, LFppL) +GO(httpDecode64, pFpp) +GO(httpDecode64_2, pFppp) //GO(_httpDecodeURI, -//GO(httpDelete, +GO(httpDelete, iFpp) //GO(_httpDisconnect, -//GO(httpEncode64, -//GO(httpEncode64_2, +GO(httpEncode64, pFpp) +GO(httpEncode64_2, pFpipi) //GO(_httpEncodeURI, -//GO(httpEncryption, +GO(httpEncryption, iFpu) GO(httpError, iFp) -//GO(httpFieldValue, -//GO(httpFlush, -//GO(httpFlushWrite, +GO(httpFieldValue, iFp) +GO(httpFlush, vFp) +GO(httpFlushWrite, iFp) //GO(_httpFreeCredentials, -//GO(httpFreeCredentials, -//GO(httpGet, -//GO(httpGetActivity, -//GO(httpGetAddress, -//GO(httpGetAuthString, -//GO(httpGetBlocking, -//GO(httpGetContentEncoding, -//GO(httpGetCookie, -//GO(httpGetDateString, -//GO(httpGetDateString2, -//GO(httpGetDateTime, -//GO(httpGetEncryption, -//GO(httpGetExpect, -//GO(httpGetFd, -//GO(httpGetField, -//GO(httpGetHostByName, -//GO(httpGetHostname, -//GO(httpGetKeepAlive, -//GO(httpGetLength, -//GO(httpGetLength2, -//GO(httpGetPending, -//GO(httpGetReady, -//GO(httpGetRemaining, -//GO(httpGets, -//GO(httpGetState, -//GO(httpGetStatus, -//GO(httpGetSubField, -//GO(httpGetSubField2, -//GO(httpGetVersion, -//GO(httpHead, -//GO(httpInitialize, -//GO(httpIsChunked, -//GO(httpIsEncrypted, -//GO(httpLoadCredentials, -//GO(httpMD5, -//GO(httpMD5Final, -//GO(httpMD5String, -//GO(httpOptions, -//GO(httpPeek, -//GO(httpPost, -//GO(httpPrintf, -//GO(httpPut, -//GO(httpRead, -//GO(httpRead2, -//GO(httpReadRequest, -//GO(httpReconnect, -//GO(httpReconnect2, -//GO(httpResolveHostname, +GO(httpFreeCredentials, vFp) +GO(httpGet, iFpp) +GO(httpGetActivity, lFp) +GO(httpGetAddress, pFp) +GO(httpGetAuthString, pFp) +GO(httpGetBlocking, iFp) +GO(httpGetContentEncoding, pFp) +GO(httpGetCookie, pFp) +GO(httpGetDateString, pFl) +GO(httpGetDateString2, pFlpi) +GO(httpGetDateTime, lFp) +GO(httpGetEncryption, uFp) +GO(httpGetExpect, iFp) +GO(httpGetFd, iFp) +GO(httpGetField, pFpi) +GO(httpGetHostByName, pFp) +GO(httpGetHostname, pFppi) +GO(httpGetKeepAlive, uFp) +GO(httpGetLength, iFp) +GO(httpGetLength2, lFp) +GO(httpGetPending, LFp) +GO(httpGetReady, LFp) +GO(httpGetRemaining, LFp) +GO(httpGets, pFpip) +GO(httpGetState, iFp) +GO(httpGetStatus, iFp) +GO(httpGetSubField, pFpipp) +GO(httpGetSubField2, pFpippi) +GO(httpGetVersion, uFp) +GO(httpHead, iFpp) +GO(httpInitialize, vFv) +GO(httpIsChunked, iFp) +GO(httpIsEncrypted, iFp) +GO(httpLoadCredentials, iFppp) +GO(httpMD5, pFpppp) +GO(httpMD5Final, pFpppp) +GO(httpMD5String, pFpp) +GO(httpOptions, iFpp) +GO(httpPeek, lFppL) +GO(httpPost, iFpp) +//GOM(httpPrintf, iFEppV) +GO(httpPut, iFpp) +GO(httpRead, iFppi) +GO(httpRead2, lFppL) +GO(httpReadRequest, iFppL) +GO(httpReconnect, iFp) +GO(httpReconnect2, iFpip) +GO(httpResolveHostname, pFppL) //GO(_httpResolveURI, -//GO(httpSaveCredentials, -//GO(httpSeparate, -//GO(httpSeparate2, -//GO(httpSeparateURI, -//GO(httpSetAuthString, -//GO(httpSetCookie, -//GO(httpSetCredentials, -//GO(httpSetDefaultField, +GO(httpSaveCredentials, iFppp) +GO(httpSeparate, vFpppppp) +GO(httpSeparate2, vFppipipippi) +GO(httpSeparateURI, iFuppipipippi) +GO(httpSetAuthString, vFppp) +GO(httpSetCookie, vFpp) +GO(httpSetCredentials, iFpp) +GO(httpSetDefaultField, vFpip) //GO(_httpSetDigestAuthString, -//GO(httpSetExpect, -//GO(httpSetField, -//GO(httpSetKeepAlive, -//GO(httpSetLength, -//GO(httpSetTimeout, -//GO(httpShutdown, -//GO(httpStateString, +GO(httpSetExpect, vFpi) +GO(httpSetField, vFpip) +GO(httpSetKeepAlive, vFpu) +GO(httpSetLength, vFpL) +//GOM(httpSetTimeout, vFEpdpp) +GO(httpShutdown, vFp) +GO(httpStateString, pFi) //GO(_httpStatus, -//GO(httpStatus, +GO(httpStatus, pFi) //GO(_httpTLSInitialize, //GO(_httpTLSPending, //GO(_httpTLSRead, @@ -386,108 +395,108 @@ GO(httpError, iFp) //GO(_httpTLSStart, //GO(_httpTLSStop, //GO(_httpTLSWrite, -//GO(httpTrace, +GO(httpTrace, iFpp) //GO(_httpUpdate, -//GO(httpUpdate, -//GO(httpURIStatusString, +GO(httpUpdate, iFp) +GO(httpURIStatusString, pFi) //GO(_httpWait, -//GO(httpWait, -//GO(httpWrite, -//GO(httpWrite2, -//GO(httpWriteResponse, +GO(httpWait, iFpi) +GO(httpWrite, iFppi) +GO(httpWrite2, lFppL) +GO(httpWriteResponse, iFpi) -//GO(ippAddBoolean, -//GO(ippAddBooleans, -//GO(ippAddCollection, -//GO(ippAddCollections, -//GO(ippAddDate, -//GO(ippAddInteger, -//GO(ippAddIntegers, -//GO(ippAddOctetString, -//GO(ippAddOutOfBand, -//GO(ippAddRange, -//GO(ippAddRanges, -//GO(ippAddResolution, -//GO(ippAddResolutions, -//GO(ippAddSeparator, -//GO(ippAddString, -//GO(ippAddStringf, -//GO(ippAddStringfv, -//GO(ippAddStrings, -//GO(ippAttributeString, -//GO(ippContainsInteger, -//GO(ippContainsString, -//GO(ippCopyAttribute, -//GO(ippCopyAttributes, -//GO(ippCreateRequestedArray, -//GO(ippDateToTime, -//GO(ippDelete, -//GO(ippDeleteAttribute, -//GO(ippDeleteValues, -//GO(ippEnumString, -//GO(ippEnumValue, -//GO(ippErrorString, -//GO(ippErrorValue, -//GO(ippFindAttribute, -//GO(ippFindNextAttribute, +GO(ippAddBoolean, pFpipc) +GO(ippAddBooleans, pFpipip) +GO(ippAddCollection, pFpipp) +GO(ippAddCollections, pFpipip) +GO(ippAddDate, pFpipp) +GO(ippAddInteger, pFpiipi) +GO(ippAddIntegers, pFpiipip) +GO(ippAddOctetString, pFpippi) +GO(ippAddOutOfBand, pFpiip) +GO(ippAddRange, pFpipii) +GO(ippAddRanges, pFpipipp) +GO(ippAddResolution, pFpipuii) +GO(ippAddResolutions, pFpipiupp) +GO(ippAddSeparator, pFp) +GO(ippAddString, pFpiippp) +//GOM(ippAddStringf, pFEpiipppV) +//GOM(ippAddStringfv, pFEpiipppA) +GO(ippAddStrings, pFpiipipp) +GO(ippAttributeString, LFppL) +GO(ippContainsInteger, iFpi) +GO(ippContainsString, iFpp) +GO(ippCopyAttribute, pFppi) +//GOM(ippCopyAttributes, iFEppipp) +GO(ippCreateRequestedArray, pFp) +GO(ippDateToTime, lFp) +GO(ippDelete, vFp) +GO(ippDeleteAttribute, vFpp) +GO(ippDeleteValues, iFppii) +GO(ippEnumString, pFpi) +GO(ippEnumValue, iFpp) +GO(ippErrorString, pFi) +GO(ippErrorValue, iFp) +GO(ippFindAttribute, pFppi) +GO(ippFindNextAttribute, pFppi) //GO(_ippFindOption, -//GO(ippFirstAttribute, -//GO(ippGetBoolean, -//GO(ippGetCollection, -//GO(ippGetCount, -//GO(ippGetDate, -//GO(ippGetGroupTag, -//GO(ippGetInteger, -//GO(ippGetName, -//GO(ippGetOctetString, -//GO(ippGetOperation, -//GO(ippGetRange, -//GO(ippGetRequestId, -//GO(ippGetResolution, -//GO(ippGetState, -//GO(ippGetStatusCode, -//GO(ippGetString, -//GO(ippGetValueTag, -//GO(ippGetVersion, -//GO(ippLength, -//GO(ippNew, -//GO(ippNewRequest, -//GO(ippNewResponse, -//GO(ippNextAttribute, -//GO(ippOpString, -//GO(ippOpValue, -//GO(ippPort, -//GO(ippRead, -//GO(ippReadFile, -//GO(ippReadIO, -//GO(ippSetBoolean, -//GO(ippSetCollection, -//GO(ippSetDate, -//GO(ippSetGroupTag, -//GO(ippSetInteger, -//GO(ippSetName, -//GO(ippSetOctetString, -//GO(ippSetOperation, -//GO(ippSetPort, -//GO(ippSetRange, -//GO(ippSetRequestId, -//GO(ippSetResolution, -//GO(ippSetState, -//GO(ippSetStatusCode, -//GO(ippSetString, -//GO(ippSetStringf, -//GO(ippSetStringfv, -//GO(ippSetValueTag, -//GO(ippSetVersion, -//GO(ippStateString, -//GO(ippTagString, -//GO(ippTagValue, -//GO(ippTimeToDate, -//GO(ippValidateAttribute, -//GO(ippValidateAttributes, -//GO(ippWrite, -//GO(ippWriteFile, -//GO(ippWriteIO, +GO(ippFirstAttribute, pFp) +GO(ippGetBoolean, iFpi) +GO(ippGetCollection, pFpi) +GO(ippGetCount, iFp) +GO(ippGetDate, pFpi) +GO(ippGetGroupTag, iFp) +GO(ippGetInteger, iFpi) +GO(ippGetName, pFp) +GO(ippGetOctetString, pFpip) +GO(ippGetOperation, iFp) +GO(ippGetRange, iFpip) +GO(ippGetRequestId, iFp) +GO(ippGetResolution, iFpipp) +GO(ippGetState, iFp) +GO(ippGetStatusCode, iFp) +GO(ippGetString, pFpip) +GO(ippGetValueTag, iFp) +GO(ippGetVersion, iFpp) +GO(ippLength, LFp) +GO(ippNew, pFv) +GO(ippNewRequest, pFi) +GO(ippNewResponse, pFp) +GO(ippNextAttribute, pFp) +GO(ippOpString, pFi) +GO(ippOpValue, iFp) +GO(ippPort, iFv) +GO(ippRead, iFpp) +GO(ippReadFile, iFip) +//GOM(ippReadIO, iFEppipp) +GO(ippSetBoolean, iFppii) +GO(ippSetCollection, iFppip) +GO(ippSetDate, iFppip) +GO(ippSetGroupTag, iFppi) +GO(ippSetInteger, iFppii) +GO(ippSetName, iFppp) +GO(ippSetOctetString, iFppipi) +GO(ippSetOperation, iFpi) +GO(ippSetPort, vFi) +GO(ippSetRange, iFppiii) +GO(ippSetRequestId, iFpi) +GO(ippSetResolution, iFppiuii) +GO(ippSetState, iFpi) +GO(ippSetStatusCode, iFpi) +GO(ippSetString, iFppip) +//GOM(ippSetStringf, iFEppipV) +//GOM(ippSetStringfv, iFEppipA) +GO(ippSetValueTag, iFppi) +GO(ippSetVersion, iFpii) +GO(ippStateString, pFi) +GO(ippTagString, pFi) +GO(ippTagValue, iFp) +GO(ippTimeToDate, pFl) +GO(ippValidateAttribute, iFp) +GO(ippValidateAttributes, iFp) +GO(ippWrite, iFpp) +GO(ippWriteFile, iFip) +//GOM(ippWriteIO, iFEppipp) //GO(_ppdCacheCreateWithFile, //GO(_ppdCacheCreateWithPPD, @@ -504,64 +513,64 @@ GO(httpError, iFp) //GO(_ppdCacheGetType, //GO(_ppdCacheWriteFile, GO(ppdClose, vFp) -//GO(ppdCollect, -//GO(ppdCollect2, -//GO(ppdConflicts, +GO(ppdCollect, iFpup) +GO(ppdCollect2, iFpufp) +GO(ppdConflicts, iFp) //GO(_ppdCreateFromIPP, -//GO(ppdEmit, -//GO(ppdEmitAfterOrder, -//GO(ppdEmitFd, -//GO(ppdEmitJCL, -//GO(ppdEmitJCLEnd, -//GO(ppdEmitString, -GO(ppdErrorString, pFi) +GO(ppdEmit, iFpSu) +GO(ppdEmitAfterOrder, iFpSuif) +GO(ppdEmitFd, iFpiu) +GO(ppdEmitJCL, iFpSipp) +GO(ppdEmitJCLEnd, iFpS) +GO(ppdEmitString, pFpuf) +GO(ppdErrorString, pFu) GO(ppdFindAttr, pFppp) GO(ppdFindChoice, pFpp) -//GO(ppdFindCustomOption, -//GO(ppdFindCustomParam, +GO(ppdFindCustomOption, pFpp) +GO(ppdFindCustomParam, pFpp) GO(ppdFindMarkedChoice, pFpp) -//GO(ppdFindNextAttr, +GO(ppdFindNextAttr, pFppp) GO(ppdFindOption, pFpp) -//GO(ppdFirstCustomParam, -//GO(ppdFirstOption, +GO(ppdFirstCustomParam, pFp) +GO(ppdFirstOption, pFp) //GO(_ppdFreeLanguages, //GO(_ppdGetEncoding, //GO(_ppdGetLanguages, //GO(_ppdGlobals, //GO(_ppdHashName, -//GO(ppdInstallableConflict, -//GO(ppdIsMarked, -GO(ppdLastError, iFp) -//GO(ppdLocalize, -//GO(ppdLocalizeAttr, +GO(ppdInstallableConflict, iFppp) +GO(ppdIsMarked, iFppp) +GO(ppdLastError, uFp) +GO(ppdLocalize, iFp) +GO(ppdLocalizeAttr, pFppp) //GO(_ppdLocalizedAttr, -//GO(ppdLocalizeIPPReason, -//GO(ppdLocalizeMarkerName, +GO(ppdLocalizeIPPReason, pFppppL) +GO(ppdLocalizeMarkerName, pFpp) GO(ppdMarkDefaults, vFp) -//GO(ppdMarkOption, -//GO(ppdNextCustomParam, -//GO(ppdNextOption, +GO(ppdMarkOption, iFppp) +GO(ppdNextCustomParam, pFp) +GO(ppdNextOption, pFp) //GO(_ppdNormalizeMakeAndModel, //GO(_ppdOpen, -//GO(ppdOpen, -//GO(ppdOpen2, +GO(ppdOpen, pFS) +GO(ppdOpen2, pFp) GO(ppdOpenFd, pFi) //GO(_ppdOpenFile, GO(ppdOpenFile, pFp) -//GO(ppdPageLength, -//GO(ppdPageSize, -//GO(ppdPageSizeLimits, -//GO(ppdPageWidth, +GO(ppdPageLength, fFpp) +GO(ppdPageSize, pFpp) +GO(ppdPageSizeLimits, iFppp) +GO(ppdPageWidth, fFpp) //GO(_ppdParseOptions, -//GO(ppdSetConformance, +GO(ppdSetConformance, vFu) -//GO(pwgFormatSizeName, -//GO(pwgInitSize, +GO(pwgFormatSizeName, iFpLppiip) +GO(pwgInitSize, iFppp) //GO(_pwgInputSlotForSource, -//GO(pwgMediaForLegacy, -//GO(pwgMediaForPPD, -//GO(pwgMediaForPWG, -//GO(pwgMediaForSize, +GO(pwgMediaForLegacy, pFp) +GO(pwgMediaForPPD, pFp) +GO(pwgMediaForPWG, pFp) +GO(pwgMediaForSize, pFii) //GO(_pwgMediaNearSize, //GO(_pwgMediaTable, //GO(_pwgMediaTypeForType, diff --git a/src/wrapped/wrappedlibcupsimage.c b/src/wrapped/wrappedlibcupsimage.c new file mode 100644 index 0000000..ab85076 --- /dev/null +++ b/src/wrapped/wrappedlibcupsimage.c @@ -0,0 +1,96 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* libcupsimageName = "libcupsimage.so.2"; +#define ALTNAME "libcupsimage.so" + +#define LIBNAME libcupsimage + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedlibcupsimagetypes.h" + +#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// cups_raster_iocb_t ... +#define GO(A) \ +static uintptr_t my_cups_raster_iocb_t_fct_##A = 0; \ +static ssize_t my_cups_raster_iocb_t_##A(void* a, void* b, size_t c) \ +{ \ + return (ssize_t)RunFunctionFmt(my_cups_raster_iocb_t_fct_##A, "ppL", a, b, c); \ +} +SUPER() +#undef GO +static void* find_cups_raster_iocb_t_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_cups_raster_iocb_t_fct_##A == (uintptr_t)fct) return my_cups_raster_iocb_t_##A; + SUPER() + #undef GO + #define GO(A) if(my_cups_raster_iocb_t_fct_##A == 0) {my_cups_raster_iocb_t_fct_##A = (uintptr_t)fct; return my_cups_raster_iocb_t_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcupsimage cups_raster_iocb_t callback\n"); + return NULL; +} +// cups_interpret_cb_t ... +#define GO(A) \ +static uintptr_t my_cups_interpret_cb_t_fct_##A = 0; \ +static int my_cups_interpret_cb_t_##A(void* a, int b) \ +{ \ + return (int)RunFunctionFmt(my_cups_interpret_cb_t_fct_##A, "pi", a, b); \ +} +SUPER() +#undef GO +static void* find_cups_interpret_cb_t_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_cups_interpret_cb_t_fct_##A == (uintptr_t)fct) return my_cups_interpret_cb_t_##A; + SUPER() + #undef GO + #define GO(A) if(my_cups_interpret_cb_t_fct_##A == 0) {my_cups_interpret_cb_t_fct_##A = (uintptr_t)fct; return my_cups_interpret_cb_t_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcupsimage cups_interpret_cb_t callback\n"); + return NULL; +} + +#undef SUPER + +EXPORT void* my_cupsRasterOpenIO(x64emu_t* emu, void* f, void* ctx, uint32_t mode) +{ + return my->cupsRasterOpenIO(find_cups_raster_iocb_t_Fct(f), ctx, mode); +} + +EXPORT int my_cupsRasterInterpretPPD(x64emu_t* emu, void* h, void* ppd, int noptions, void* options, void* f) +{ + return my->cupsRasterInterpretPPD(h, ppd, noptions, options, find_cups_interpret_cb_t_Fct(f)); +} + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibcupsimage_private.h b/src/wrapped/wrappedlibcupsimage_private.h new file mode 100644 index 0000000..17fe791 --- /dev/null +++ b/src/wrapped/wrappedlibcupsimage_private.h @@ -0,0 +1,16 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(cupsRasterClose, vFp) +GO(cupsRasterErrorString, pFv) +GO(cupsRasterInitPWGHeader, iFpppiipp) +GOM(cupsRasterInterpretPPD, iFEppipp) +GO(cupsRasterOpen, pFiu) +GOM(cupsRasterOpenIO, pFEppu) +GO(cupsRasterReadHeader, uFpp) +GO(cupsRasterReadHeader2, uFpp) +GO(cupsRasterReadPixels, uFppu) +GO(cupsRasterWriteHeader, uFpp) +GO(cupsRasterWriteHeader2, uFpp) +GO(cupsRasterWritePixels, uFppu) diff --git a/src/wrapped/wrappedlibdl.c b/src/wrapped/wrappedlibdl.c index 2725285..63a4b46 100644 --- a/src/wrapped/wrappedlibdl.c +++ b/src/wrapped/wrappedlibdl.c @@ -16,6 +16,7 @@ #include "library.h" #include "librarian.h" #include "box64context.h" +#include "x64tls.h" #include "elfloader.h" #include "elfs/elfloader_private.h" @@ -27,11 +28,14 @@ typedef struct dllib_s { int full; } dllib_t; +#define ERROR_LEN 128 typedef struct dlprivate_s { dllib_t *dllibs; size_t lib_sz; size_t lib_cap; - char* last_error; + char error_msg[ERROR_LEN]; + char last_msg[ERROR_LEN]; + int is_error; } dlprivate_t; dlprivate_t *NewDLPrivate() { @@ -39,12 +43,12 @@ dlprivate_t *NewDLPrivate() { return dl; } void FreeDLPrivate(dlprivate_t **lib) { - box_free((*lib)->last_error); box_free(*lib); } // dead_cells consider the "2" value to be some king of issue? #define MIN_NLIB 3 +int GetTID(); void* my_dlopen(x64emu_t* emu, void *filename, int flag) EXPORT; void* my_dlmopen(x64emu_t* emu, void* mlid, void *filename, int flag) EXPORT; @@ -57,14 +61,49 @@ void* my_dlvsym(x64emu_t* emu, void *handle, void *symbol, const char *vername) int my_dlinfo(x64emu_t* emu, void* handle, int request, void* info) EXPORT; #define LIBNAME libdl -#ifdef ANDROID - const char* libdlName = "libdl.so"; -#else - const char* libdlName = "libdl.so.2"; -#endif +const char* libdlName = "libdl.so.2"; +#define ALTNAME "libdl.so" + +#define CLEARERR dl->is_error = 0 +void dl_clear_error() +{ + dlprivate_t *dl = my_context->dlprivate; + CLEARERR; +} + +void dl_set_error(const char* msg) +{ + dlprivate_t *dl = my_context->dlprivate; + snprintf(dl->last_msg, ERROR_LEN, "%s", msg); + dl->is_error = 1; +} -#define CLEARERR if(dl->last_error) {box_free(dl->last_error); dl->last_error = NULL;} +#define SET_ERROR(M, ...) do { snprintf(dl->last_msg, ERROR_LEN, M, __VA_ARGS__); dl->is_error=1; } while(0) +library_t* dl_get_library(void* handle) +{ + dlprivate_t *dl = my_context->dlprivate; + CLEARERR; + size_t nlib = (size_t)handle; + --nlib; + // size_t is unsigned + if(nlib>=dl->lib_sz) { + SET_ERROR("Bad handle %p)\n", handle); + return (void*)-1LL; + } + if(!dl->dllibs[nlib].count || !dl->dllibs[nlib].full) { + SET_ERROR("Bad handle %p (already closed))\n", handle); + return (void*)-1LL; + } + return dl->dllibs[nlib].lib; +} +#ifdef BOX32 +char* dl_last_error() +{ + dlprivate_t *dl = my_context->dlprivate; + return dl->last_msg; +} +#endif void RemoveDlopen(library_t** lib, size_t idx) { if(!my_context) @@ -92,7 +131,7 @@ void* my_dlopen(x64emu_t* emu, void *filename, int flag) size_t dlopened = 0; int is_local = (flag&0x100)?0:1; // if not global, then local, and that means symbols are not put in the global "pot" for other libs int deepbind = (flag&0x0008)?1:0; // RTLD_DEEPBIND means LOCAL before GLOBAL scope during symbol resolution - CLEARERR + CLEARERR; if(filename) { char* rfilename = (char*)alloca(MAX_PATH); strcpy(rfilename, (char*)filename); @@ -106,7 +145,7 @@ void* my_dlopen(x64emu_t* emu, void *filename, int flag) if(sys) return sys; } - printf_dlsym(LOG_DEBUG, "Call to dlopen(\"%s\"/%p, %X)\n", rfilename, filename, flag); + printf_dlsym(LOG_DEBUG, "%04d|Call to dlopen(\"%s\"/%p, %X)\n", GetTID(), rfilename, filename, flag); // Transform any ${...} that maight be present while(strstr(rfilename, "${ORIGIN}")) { char* origin = box_strdup(my_context->fullpath); @@ -134,7 +173,7 @@ void* my_dlopen(x64emu_t* emu, void *filename, int flag) box_free(tmp); box_free(platform); } - // check if alread dlopenned... + // check if already dlopened... for (size_t i=MIN_NLIB; ilib_sz; ++i) { if(dl->dllibs[i].full && IsSameLib(dl->dllibs[i].lib, rfilename)) { if(flag&0x4) { // don't re-open in RTLD_NOLOAD mode @@ -170,6 +209,7 @@ void* my_dlopen(x64emu_t* emu, void *filename, int flag) dl->dllibs[idx].full = 1; IncRefCount(dl->dllibs[idx].lib, emu); SetDlOpenIdx(lib, idx); + refreshTLSData(emu); printf_dlsym(LOG_DEBUG, "dlopen: New handle %p (%s), dlopened=%ld\n", (void*)(idx+1), (char*)filename, dlopened); return (void*)(idx+1); @@ -193,9 +233,7 @@ void* my_dlopen(x64emu_t* emu, void *filename, int flag) tmp->names[0] = rfilename; if(AddNeededLib(NULL, is_local, bindnow, deepbind, tmp, NULL, my_context, emu)) { printf_dlsym(strchr(rfilename,'/')?LOG_DEBUG:LOG_INFO, "Warning: Cannot dlopen(\"%s\"/%p, %X)\n", rfilename, filename, flag); - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Cannot dlopen(\"%s\"/%p, %X)\n", rfilename, filename, flag); + SET_ERROR("Cannot dlopen(\"%s\"/%p, %X)\n", rfilename, filename, flag); RemoveNeededLib(NULL, is_local, tmp, my_context, emu); if(my_context->deferredInitList) box_free(my_context->deferredInitList); @@ -208,13 +246,14 @@ void* my_dlopen(x64emu_t* emu, void *filename, int flag) setupTraceMapLib(tmp->libs[0]->maplib); free_neededlib(tmp); lib = GetLibInternal(rfilename); + refreshTLSData(emu); RunDeferredElfInit(emu); my_context->deferredInit = old_deferredInit; my_context->deferredInitList = old_deferredInitList; my_context->deferredInitSz = old_deferredInitSz; my_context->deferredInitCap = old_deferredInitCap; } else { - // check if already dlopenned... + // check if already dlopened... for (size_t i=MIN_NLIB; ilib_sz; ++i) { if(dl->dllibs[i].is_self) { ++dl->dllibs[i].count; @@ -254,7 +293,12 @@ void* my_dlmopen(x64emu_t* emu, void* lmid, void *filename, int flag) char* my_dlerror(x64emu_t* emu) { dlprivate_t *dl = my_context->dlprivate; - return dl->last_error; + //printf_dlsym(LOG_INFO, "call to dlerror(): \"%s\"\n", dl->last_error?dl->last_error:"(nil)"); //too chatty + if(!dl->is_error) + return NULL; + strncpy(dl->error_msg, dl->last_msg, ERROR_LEN); + dl->is_error = 0; + return dl->error_msg; } KHASH_SET_INIT_INT(libs); @@ -296,8 +340,8 @@ int my_dlsym_lib(library_t* lib, const char* rsymbol, uintptr_t *start, uintptr_ return ret; } -int GetTID(); -void* my_dlsym(x64emu_t* emu, void *handle, void *symbol) + +void* my_dlsym_internal(x64emu_t* emu, void *handle, void *symbol, int version, const char* vername) { (void)emu; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; @@ -305,34 +349,41 @@ void* my_dlsym(x64emu_t* emu, void *handle, void *symbol) dlprivate_t *dl = my_context->dlprivate; uintptr_t start = 0, end = 0; char* rsymbol = (char*)symbol; - CLEARERR - printf_dlsym(LOG_DEBUG, "%04d|Call to dlsym(%p, \"%s\")%s", GetTID(), handle, rsymbol, dlsym_error?"":"\n"); + if(box64_is32bits && handle==(void*)0xffffffff) + handle = (void*)~0LL; + CLEARERR; if(handle==NULL) { // special case, look globably - if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, -1, NULL, 0, NULL)) { - printf_dlsym(LOG_NEVER, "%p\n", (void*)start); + if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, version, vername, 0, NULL)) { + printf_dlsym_prefix(0, LOG_NEVER, "%p\n", (void*)start); pthread_mutex_unlock(&mutex); return (void*)start; } - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Symbol \"%s\" not found in %p)\n", rsymbol, handle); - printf_dlsym(LOG_NEVER, "%p\n", NULL); + SET_ERROR("Symbol \"%s\" not found in %p)\n", rsymbol, handle); + printf_dlsym_prefix(0, LOG_NEVER, "%p\n", NULL); pthread_mutex_unlock(&mutex); return NULL; } if(handle==(void*)~0LL) { - // special case, look globably but no self (RTLD_NEXT) - elfheader_t *elf = FindElfAddress(my_context, *(uintptr_t*)R_RSP); // use return address to guess "self" - if(GetNoSelfSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, elf, 0, -1, NULL, 0, NULL)) { - printf_dlsym(LOG_NEVER, "%p\n", (void*)start); + // special case, look globably after self in the lm chain (RTLD_NEXT) + uintptr_t ret_addr = 0; + #ifdef BOX32 + if(box64_is32bits) + ret_addr = from_ptri(ptr_t, R_ESP); + else + #endif + ret_addr = *(uintptr_t*)R_RSP; + elfheader_t *elf = FindElfAddress(my_context, ret_addr); // use return address to guess "self" + if(GetNextSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, elf, 0, version, vername, 0, NULL)) { + printf_dlsym_prefix(0, LOG_NEVER, "%p\n", (void*)start); pthread_mutex_unlock(&mutex); return (void*)start; } - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Symbol \"%s\" not found in %p)\n", rsymbol, handle); - printf_dlsym(LOG_NEVER, "%p\n", NULL); + if(version==-1) + SET_ERROR("Symbol \"%s\" not found in %p)\n", rsymbol, handle); + else + SET_ERROR("Symbol \"%s@%s\" not found in %p)\n", rsymbol, vername, handle); + printf_dlsym_prefix(0, LOG_NEVER, "%p\n", NULL); pthread_mutex_unlock(&mutex); return NULL; } @@ -340,79 +391,115 @@ void* my_dlsym(x64emu_t* emu, void *handle, void *symbol) --nlib; // size_t is unsigned if(nlib>=dl->lib_sz) { - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Bad handle %p)\n", handle); - printf_dlsym(LOG_NEVER, "%p\n", NULL); + SET_ERROR("Bad handle %p)\n", handle); + printf_dlsym_prefix(0, LOG_NEVER, "%p\n", NULL); pthread_mutex_unlock(&mutex); return NULL; } if(!dl->dllibs[nlib].count || !dl->dllibs[nlib].full) { - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Bad handle %p (already closed))\n", handle); - printf_dlsym(LOG_NEVER, "%p\n", (void*)NULL); + SET_ERROR("Bad handle %p (already closed))\n", handle); + printf_dlsym_prefix(0, LOG_NEVER, "%p\n", (void*)NULL); pthread_mutex_unlock(&mutex); return NULL; } if(dl->dllibs[nlib].lib) { - if(my_dlsym_lib(dl->dllibs[nlib].lib, rsymbol, &start, &end, -1, NULL)==0) { + if(my_dlsym_lib(dl->dllibs[nlib].lib, rsymbol, &start, &end, version, vername)==0) { // not found - printf_dlsym(LOG_NEVER, "%p\nCall to dlsym(%s, \"%s\") Symbol not found\n", NULL, GetNameLib(dl->dllibs[nlib].lib), rsymbol); - printf_log(LOG_DEBUG, " Symbol not found\n"); - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Symbol \"%s\" not found in %p(%s)", rsymbol, handle, GetNameLib(dl->dllibs[nlib].lib)); + if(version==-1) + printf_dlsym_prefix(0, LOG_NEVER, "%p\nCall to dlsym(%s, \"%s\") Symbol not found\n", NULL, GetNameLib(dl->dllibs[nlib].lib), rsymbol); + else + printf_dlsym_prefix(0, LOG_NEVER, "%p\nCall to dlvsym(%s, \"%s\", \"%s\") Symbol not found\n", NULL, GetNameLib(dl->dllibs[nlib].lib), rsymbol, vername?vername:"NULL"); + printf_log_prefix(0, LOG_DEBUG, " Symbol not found\n"); + if(version==-1) + SET_ERROR("Symbol \"%s\" not found in %p(%s)", rsymbol, handle, GetNameLib(dl->dllibs[nlib].lib)); + else + SET_ERROR("Symbol \"%s@%s\" not found in %p(%s)", rsymbol, vername, handle, GetNameLib(dl->dllibs[nlib].lib)); pthread_mutex_unlock(&mutex); return NULL; } } else { - // still usefull? + // for "self" dlopen // => look globably - if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, -1, NULL, 0, NULL)) { - printf_dlsym(LOG_NEVER, "%p\n", (void*)start); + //look in main elf first + int found = 0; + if(ElfGetSymTabStartEnd(my_context->elfs[0], &start, &end, rsymbol)) + found = 1; + if(!found && GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, -1, NULL, 0, NULL)) + found = 1; + if(!found && GetSymTabStartEnd(my_context->maplib, rsymbol, &start, &end)) + found = 1; + if(found) { + printf_dlsym_prefix(0, LOG_NEVER, "%p\n", (void*)start); pthread_mutex_unlock(&mutex); return (void*)start; } - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Symbol \"%s\" not found in %p)\n", rsymbol, handle); - printf_dlsym(LOG_NEVER, "%p\n", NULL); + if(version==-1) + SET_ERROR("Symbol \"%s\" not found in %p)\n", rsymbol, handle); + else + SET_ERROR("Symbol \"%s@%s\" not found in %p)\n", rsymbol, vername, handle); + printf_dlsym_prefix(0, LOG_NEVER, "%p\n", NULL); pthread_mutex_unlock(&mutex); return NULL; } - printf_dlsym(LOG_NEVER, "%p\n", (void*)start); + printf_dlsym_prefix(0, LOG_NEVER, "%p\n", (void*)start); pthread_mutex_unlock(&mutex); return (void*)start; } +void* my_dlsym(x64emu_t* emu, void *handle, void *symbol) +{ + printf_dlsym(LOG_DEBUG, "%04d|Call to dlsym(%p, \"%s\")%s", GetTID(), handle, symbol, BOX64ENV(dlsym_error)?"":"\n"); + void* ret = my_dlsym_internal(emu, handle, symbol, -1, NULL); + #if 0 + char* symb = symbol; + static char* previous = NULL; + static char previous_storage[128]; + if(previous && ret && (!strcmp(previous, symb) || (previous[0]=='_' && !strcmp(&previous[1], symb)) || (symb[0]=='_' && !strcmp(previous, &symb[1])))) + previous = NULL; + else if(previous && ret) { + printf_log(LOG_INFO, "Warning, symbol %s might be missing\n", previous); + previous = NULL; + } else if(!ret) { + if(previous && !(!strcmp(previous, symb) || (previous[0]=='_' && !strcmp(&previous[1], symb)) || (symb[0]=='_' && !strcmp(previous, &symb[1])))) + printf_log(LOG_INFO, "Warning, symbol %s might be missing\n", previous); + previous = previous_storage; + strcpy(previous, symb); + } + #endif + return ret; +} + +void* my_dlvsym(x64emu_t* emu, void *handle, void *symbol, const char *vername) +{ + int version = (vername)?2:-1; + printf_dlsym(LOG_DEBUG, "Call to dlvsym(%p, \"%s\", %s)%s", handle, symbol, vername?vername:"(nil)", BOX64ENV(dlsym_error)?"":"\n"); + return my_dlsym_internal(emu, handle, symbol, version, vername); +} + static int actualy_closing = 0; int my_dlclose(x64emu_t* emu, void *handle) { (void)emu; printf_dlsym(LOG_DEBUG, "Call to dlclose(%p)\n", handle); dlprivate_t *dl = my_context->dlprivate; - CLEARERR + CLEARERR; size_t nlib = (size_t)handle; --nlib; // size_t is unsigned if(nlib>=dl->lib_sz) { - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Bad handle %p)\n", handle); - printf_dlsym(LOG_DEBUG, "dlclose: %s\n", dl->last_error); + SET_ERROR("Bad handle %p)\n", handle); + printf_dlsym(LOG_DEBUG, "dlclose: %s\n", dl->last_msg); return -1; } if(!dl->dllibs[nlib].count || !dl->dllibs[nlib].full) { - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Bad handle %p (already closed))\n", handle); - printf_dlsym(LOG_DEBUG, "dlclose: %s\n", dl->last_error); + SET_ERROR("Bad handle %p (already closed))\n", handle); + printf_dlsym(LOG_DEBUG, "dlclose: %s\n", dl->last_msg); return -1; } --dl->dllibs[nlib].count; elfheader_t* h = GetElf(dl->dllibs[nlib].lib); if((h && !h->gnuunique) || !h || actualy_closing) DecRefCount(&dl->dllibs[nlib].lib, emu); + refreshTLSData(emu); return 0; } #ifdef ANDROID @@ -428,7 +515,7 @@ int my_dladdr1(x64emu_t* emu, void *addr, void *i, void** extra_info, int flags) { //int dladdr(void *addr, Dl_info *info); dlprivate_t *dl = my_context->dlprivate; - CLEARERR + CLEARERR; Dl_info *info = (Dl_info*)i; printf_log(LOG_DEBUG, "Warning: partially unimplement call to dladdr/dladdr1(%p, %p, %p, %d)\n", addr, info, extra_info, flags); @@ -450,105 +537,24 @@ int my_dladdr(x64emu_t* emu, void *addr, void *i) { return my_dladdr1(emu, addr, i, NULL, 0); } -void* my_dlvsym(x64emu_t* emu, void *handle, void *symbol, const char *vername) -{ - dlprivate_t *dl = my_context->dlprivate; - int version = (vername)?2:-1; - uintptr_t start, end; - char* rsymbol = (char*)symbol; - CLEARERR - printf_dlsym(LOG_DEBUG, "Call to dlvsym(%p, \"%s\", %s)%s", handle, rsymbol, vername?vername:"(nil)", dlsym_error?"":"\n"); - if(handle==NULL) { - // special case, look globably - if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, version, vername, 0, NULL)) { - printf_dlsym(LOG_NEVER, "%p\n", (void*)start); - return (void*)start; - } - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Symbol \"%s\" version %s not found in %p)\n", rsymbol, vername?vername:"(nil)", handle); - printf_dlsym(LOG_NEVER, "%p\n", NULL); - return NULL; - } - if(handle==(void*)~0LL) { - // special case, look globably but no self (RTLD_NEXT) - elfheader_t *elf = FindElfAddress(my_context, *(uintptr_t*)R_RSP); // use return address to guess "self" - if(GetNoSelfSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, elf, 0, version, vername, 0, NULL)) { - printf_dlsym(LOG_NEVER, "%p\n", (void*)start); - return (void*)start; - } - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Symbol \"%s\" version %s not found in %p)\n", rsymbol, vername?vername:"(nil)", handle); - printf_dlsym(LOG_NEVER, "%p\n", NULL); - return NULL; - } - size_t nlib = (size_t)handle; - --nlib; - // size_t is unsigned - if(nlib>=dl->lib_sz) { - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Bad handle %p)\n", handle); - printf_dlsym(LOG_NEVER, "%p\n", NULL); - return NULL; - } - if(!dl->dllibs[nlib].count || !dl->dllibs[nlib].full) { - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Bad handle %p (already closed))\n", handle); - printf_dlsym(LOG_NEVER, "%p\n", (void*)NULL); - return NULL; - } - if(dl->dllibs[nlib].lib) { - if(my_dlsym_lib(dl->dllibs[nlib].lib, rsymbol, &start, &end, version, vername)==0) { - // not found - printf_dlsym(LOG_NEVER, "%p\nCall to dlvsym(%s, \"%s\", %s) Symbol not found\n", NULL, GetNameLib(dl->dllibs[nlib].lib), rsymbol, vername?vername:"(nil)"); - printf_log(LOG_DEBUG, " Symbol not found\n"); - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Symbol \"%s\" not found in %p(%s)", rsymbol, handle, GetNameLib(dl->dllibs[nlib].lib)); - return NULL; - } - } else { - // still usefull? - if(GetGlobalSymbolStartEnd(my_context->maplib, rsymbol, &start, &end, NULL, -1, NULL, 0, NULL)) { - printf_dlsym(LOG_NEVER, "%p\n", (void*)start); - return (void*)start; - } - // not found - printf_dlsym(LOG_NEVER, "%p\nCall to dlvsym(%s, \"%s\", %s) Symbol not found\n", NULL, "Self", rsymbol, vername?vername:"(nil)"); - printf_log(LOG_DEBUG, " Symbol not found\n"); - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Symbol \"%s\" version %s not found in %p)\n", rsymbol, vername?vername:"(nil)", handle); - return NULL; - } - printf_dlsym(LOG_NEVER, "%p\n", (void*)start); - return (void*)start; -} int my_dlinfo(x64emu_t* emu, void* handle, int request, void* info) { (void)emu; printf_dlsym(LOG_DEBUG, "Call to dlinfo(%p, %d, %p)\n", handle, request, info); dlprivate_t *dl = my_context->dlprivate; - CLEARERR + CLEARERR; size_t nlib = (size_t)handle; --nlib; // size_t is unsigned if(nlib>=dl->lib_sz) { - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Bad handle %p)\n", handle); - printf_dlsym(LOG_DEBUG, "dlinfo: %s\n", dl->last_error); + SET_ERROR("Bad handle %p)\n", handle); + printf_dlsym(LOG_DEBUG, "dlinfo: %s\n", dl->last_msg); return -1; } if(!dl->dllibs[nlib].count || !dl->dllibs[nlib].full) { - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "Bad handle %p (already closed))\n", handle); - printf_dlsym(LOG_DEBUG, "dlinfo: %s\n", dl->last_error); + SET_ERROR("Bad handle %p (already closed))\n", handle); + printf_dlsym(LOG_DEBUG, "dlinfo: %s\n", dl->last_msg); return -1; } library_t *lib = dl->dllibs[nlib].lib; @@ -561,9 +567,7 @@ int my_dlinfo(x64emu_t* emu, void* handle, int request, void* info) return 0; default: printf_log(LOG_NONE, "Warning, unsupported call to dlinfo(%p, %d, %p)\n", handle, request, info); - if(!dl->last_error) - dl->last_error = box_calloc(1, 129); - snprintf(dl->last_error, 129, "unsupported call to dlinfo request:%d\n", request); + SET_ERROR("unsupported call to dlinfo request:%d\n", request); } return -1; } @@ -595,7 +599,7 @@ EXPORT int my__dl_find_object(x64emu_t* emu, void* addr, my_dl_find_object_t* re return -1; } -void closeAllDLOpenned() +void closeAllDLOpened() { dlprivate_t *dl = my_context->dlprivate; actualy_closing = 1; @@ -613,8 +617,13 @@ void closeAllDLOpenned() //extern void* _dlfcn_hook; #endif +#define PRE_INIT\ + if(1) \ + lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \ + else + #define CUSTOM_FINI \ - closeAllDLOpenned(); + closeAllDLOpened(); // define all standard library functions #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibdl_private.h b/src/wrapped/wrappedlibdl_private.h index c210625..540ddf0 100644 --- a/src/wrapped/wrappedlibdl_private.h +++ b/src/wrapped/wrappedlibdl_private.h @@ -1,13 +1,15 @@ -#if defined(GO) && defined(GOM) && defined(GO2) && defined(DATA) +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif GOM(dladdr, iFEpp) GOM(dladdr1, iFEpppi) GOM(dlclose, iFEp) GOM(dlerror, pFEv) #ifdef STATICBUILD -//DATAB(_dlfcn_hook, sizeof(void*)) +//DATAB(_dlfcn_hook, 8) #else -DATAB(_dlfcn_hook, sizeof(void*)) +DATAB(_dlfcn_hook, 8) #endif GOM(dlinfo, iFEpip) GOM(dlmopen, pFEppi) @@ -15,5 +17,3 @@ GOM(dlopen, pFEpi) GOM(dlsym, pFEpp) GOM(dlvsym, pFEppp) // Weak GOM(_dl_find_object, iFEpp) - -#endif diff --git a/src/wrapped/wrappedlibdrm.c b/src/wrapped/wrappedlibdrm.c index a1d15e0..005c3ee 100644 --- a/src/wrapped/wrappedlibdrm.c +++ b/src/wrapped/wrappedlibdrm.c @@ -19,6 +19,7 @@ #include "myalign.h" const char* libdrmName = "libdrm.so.2"; +#define ALTNAME "libdrm.so" #define LIBNAME libdrm #define ADDED_FUNCTIONS() \ @@ -27,6 +28,81 @@ const char* libdrmName = "libdrm.so.2"; #include "wrappercallback.h" + +#define SUPER() \ + GO(0) \ + GO(1) \ + GO(2) \ + GO(3) \ + GO(4) \ + GO(5) \ + GO(6) \ + GO(7) \ + GO(8) \ + GO(9) \ + GO(10) \ + GO(11) \ + GO(12) \ + GO(13) \ + GO(14) \ + GO(15) + +// vblank_handler +#define GO(A) \ + static uintptr_t my_vblank_handler_fct_##A = 0; \ + static void my_vblank_handler_##A(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, void* user_data) \ + { \ + RunFunctionFmt(my_vblank_handler_fct_##A, "iuuup", fd, sequence, tv_sec, tv_usec, user_data); \ + } +SUPER() +#undef GO +static void* find_vblank_handlerFct(void* fct) +{ + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_vblank_handler_fct_##A == (uintptr_t)fct) return my_vblank_handler_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_vblank_handler_fct_##A == 0) { \ + my_vblank_handler_fct_##A = (uintptr_t)fct; \ + return my_vblank_handler_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for gobject vblank_handler callback\n"); + return NULL; +} + +// page_flip_handler +#define GO(A) \ + static uintptr_t my_page_flip_handler_fct_##A = 0; \ + static void my_page_flip_handler_##A(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, void* user_data) \ + { \ + RunFunctionFmt(my_page_flip_handler_fct_##A, "iuuup", fd, sequence, tv_sec, tv_usec, user_data); \ + } +SUPER() +#undef GO +static void* find_page_flip_handlerFct(void* fct) +{ + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_page_flip_handler_fct_##A == (uintptr_t)fct) return my_page_flip_handler_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_page_flip_handler_fct_##A == 0) { \ + my_page_flip_handler_fct_##A = (uintptr_t)fct; \ + return my_page_flip_handler_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for gobject page_flip_handler callback\n"); + return NULL; +} + EXPORT void my_drmMsg(x64emu_t* emu, void* fmt, void* b) { myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 1); PREPARE_VALIST; @@ -37,4 +113,21 @@ EXPORT void my_drmMsg(x64emu_t* emu, void* fmt, void* b) { free(buf); } +typedef struct drmEventContext_s { + int version; + void (*vblank_handler)(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, void* user_data); + void (*page_flip_handler)(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, void* user_data); +} drmEventContext_t, *drmEventContextPtr_t; + + +EXPORT void my_drmHandleEvent(x64emu_t* emu, int fd, drmEventContextPtr_t evctx) +{ + drmEventContext_t ctx = { 0 }; + ctx.version = evctx->version; + ctx.vblank_handler = find_vblank_handlerFct(evctx->vblank_handler); + ctx.page_flip_handler = find_page_flip_handlerFct(evctx->page_flip_handler); + my->drmHandleEvent(fd, &ctx); +} + + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibdrm_private.h b/src/wrapped/wrappedlibdrm_private.h index 47df162..c310e58 100644 --- a/src/wrapped/wrappedlibdrm_private.h +++ b/src/wrapped/wrappedlibdrm_private.h @@ -1,183 +1,184 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif -//GO(drmAddBufs, -//GO(drmAddContextPrivateMapping, -//GO(drmAddContextTag, -//GO(drmAddMap, -//GO(drmAgpAcquire, -//GO(drmAgpAlloc, -//GO(drmAgpBase, -//GO(drmAgpBind, -//GO(drmAgpDeviceId, -//GO(drmAgpEnable, -//GO(drmAgpFree, -//GO(drmAgpGetMode, -//GO(drmAgpMemoryAvail, -//GO(drmAgpMemoryUsed, -//GO(drmAgpRelease, -//GO(drmAgpSize, -//GO(drmAgpUnbind, -//GO(drmAgpVendorId, -//GO(drmAgpVersionMajor, -//GO(drmAgpVersionMinor, +GO(drmAddBufs, iFiiiui) +GO(drmAddContextPrivateMapping, iFiuu) +GO(drmAddContextTag, iFiup) +GO(drmAddMap, iFiuuuup) +GO(drmAgpAcquire, iFi) +GO(drmAgpAlloc, iFiLLpp) +GO(drmAgpBase, LFi) +GO(drmAgpBind, iFiuL) +GO(drmAgpDeviceId, uFi) +GO(drmAgpEnable, iFiL) +GO(drmAgpFree, iFiu) +GO(drmAgpGetMode, LFi) +GO(drmAgpMemoryAvail, LFi) +GO(drmAgpMemoryUsed, LFi) +GO(drmAgpRelease, iFi) +GO(drmAgpSize, LFi) +GO(drmAgpUnbind, iFiu) +GO(drmAgpVendorId, uFi) +GO(drmAgpVersionMajor, iFi) +GO(drmAgpVersionMinor, iFi) GO(drmAuthMagic, iFiu) -//GO(drmAvailable, -//GO(drmCheckModesettingSupported, -//GO(drmClose, -//GO(drmCloseOnce, -//GO(drmCommandNone, +GO(drmAvailable, iFv) +GO(drmCheckModesettingSupported, iFp) +GO(drmClose, iFi) +GO(drmCloseOnce, vFi) +GO(drmCommandNone, iFiL) GO(drmCommandRead, iFiLpL) GO(drmCommandWrite, iFiLpL) GO(drmCommandWriteRead, iFiLpL) -//GO(drmCreateContext, -//GO(drmCreateDrawable, -//GO(drmCrtcGetSequence, -//GO(drmCrtcQueueSequence, -//GO(drmCtlInstHandler, -//GO(drmCtlUninstHandler, -//GO(drmDelContextTag, -//GO(drmDestroyContext, -//GO(drmDestroyDrawable, -//GO(drmDevicesEqual, -//GO(drmDMA, -//GO(drmDropMaster, -//GO(drmError, -//GO(drmFinish, -//GO(drmFree, -//GO(drmFreeBufs, -//GO(drmFreeBusid, -//GO(drmFreeDevice, +GO(drmCreateContext, iFip) +GO(drmCreateDrawable, iFip) +GO(drmCrtcGetSequence, iFiupp) +GO(drmCrtcQueueSequence, iFiuuUpU) +GO(drmCtlInstHandler, iFii) +GO(drmCtlUninstHandler, iFi) +GO(drmDelContextTag, iFiu) +GO(drmDestroyContext, iFiu) +GO(drmDestroyDrawable, iFiu) +GO(drmDevicesEqual, iFpp) +GO(drmDMA, iFip) +GO(drmDropMaster, iFi) +GO(drmError, iFip) +GO(drmFinish, iFiiu) +GO(drmFree, vFp) +GO(drmFreeBufs, iFiip) +GO(drmFreeBusid, vFp) +GO(drmFreeDevice, vFp) GO(drmFreeDevices, vFpi) -//GO(drmFreeReservedContextList, +GO(drmFreeReservedContextList, vFp) GO(drmFreeVersion, vFp) -//GO(drmGetBufInfo, -//GO(drmGetBusid, -//GO(drmGetCap, -//GO(drmGetClient, -//GO(drmGetContextFlags, -//GO(drmGetContextPrivateMapping, -//GO(drmGetContextTag, -//GO(drmGetDevice, -//GO(drmGetDevice2, +GO(drmGetBufInfo, pFi) +GO(drmGetBusid, pFi) +GO(drmGetCap, iFiUp) +GO(drmGetClient, iFiippppp) +GO(drmGetContextFlags, iFiup) +GO(drmGetContextPrivateMapping, iFiup) +GO(drmGetContextTag, pFiu) +GO(drmGetDevice, iFip) +GO(drmGetDevice2, iFiup) GO(drmGetDeviceNameFromFd, pFi) -//GO(drmGetDeviceNameFromFd2, +GO(drmGetDeviceNameFromFd2, pFi) GO(drmGetDevices, iFpi) GO(drmGetDevices2, iFupi) -//GO(drmGetEntry, -//GO(drmGetHashTable, -//GO(drmGetInterruptFromBusID, -//GO(drmGetLibVersion, -//GO(drmGetLock, +//GOM(drmGetEntry, pFEi) +GO(drmGetHashTable, pFv) +GO(drmGetInterruptFromBusID, iFiiii) +GO(drmGetLibVersion, pFi) +GO(drmGetLock, iFiuu) GO(drmGetMagic, iFip) -//GO(drmGetMap, +GO(drmGetMap, iFiipppppp) GO(drmGetNodeTypeFromFd, iFi) GO(drmGetPrimaryDeviceNameFromFd, pFi) -//GO(drmGetRenderDeviceNameFromFd, -//GO(drmGetReservedContextList, -//GO(drmGetStats, +GO(drmGetRenderDeviceNameFromFd, pFi) +GO(drmGetReservedContextList, pFip) +GO(drmGetStats, iFip) GO(drmGetVersion, pFi) -GO(drmHandleEvent, iFip) //warning, p is *drmHandleEvent that needs wrapping, plenty of function pointer there +GOM(drmHandleEvent, iFEip) GO(drmHashCreate, pFv) GO(drmHashDelete, iFpL) GO(drmHashDestroy, iFp) GO(drmHashFirst, iFppp) -GO(drmHashInsert, iFpLL) +GO(drmHashInsert, iFpLp) GO(drmHashLookup, iFpLp) GO(drmHashNext, iFppp) GO(drmIoctl, iFiLp) -//GO(drmIsMaster, -//GO(drmMalloc, -//GO(drmMap, -//GO(drmMapBufs, -//GO(drmMarkBufs, +GO(drmIsMaster, iFi) +GO(drmMalloc, pFi) +GO(drmMap, iFiuup) +GO(drmMapBufs, pFi) +GO(drmMarkBufs, iFidd) GO(drmModeAddFB, iFiuuCCuup) -//GO(drmModeAddFB2, -//GO(drmModeAddFB2WithModifiers, -//GO(drmModeAtomicAddProperty, -//GO(drmModeAtomicAlloc, -//GO(drmModeAtomicCommit, -//GO(drmModeAtomicDuplicate, -//GO(drmModeAtomicFree, -//GO(drmModeAtomicGetCursor, -//GO(drmModeAtomicMerge, -//GO(drmModeAtomicSetCursor, -//GO(drmModeAttachMode, -//GO(drmModeConnectorSetProperty, -//GO(drmModeCreateLease, -//GO(drmModeCreatePropertyBlob, -//GO(drmModeCrtcGetGamma, -//GO(drmModeCrtcSetGamma, -//GO(drmModeDestroyPropertyBlob, -//GO(drmModeDetachMode, -//GO(drmModeDirtyFB, +GO(drmModeAddFB2, iFiuuuppppu) +GO(drmModeAddFB2WithModifiers, iFiuuupppppu) +GO(drmModeAtomicAddProperty, iFpuuU) +GO(drmModeAtomicAlloc, pFv) +GO(drmModeAtomicCommit, iFipup) +GO(drmModeAtomicDuplicate, pFp) +GO(drmModeAtomicFree, vFp) +GO(drmModeAtomicGetCursor, iFp) +GO(drmModeAtomicMerge, iFpp) +GO(drmModeAtomicSetCursor, vFpi) +GO(drmModeAttachMode, iFiup) +GO(drmModeConnectorSetProperty, iFiuuU) +GO(drmModeCreateLease, iFipiip) +GO(drmModeCreatePropertyBlob, iFipLp) +GO(drmModeCrtcGetGamma, iFiuuppp) +GO(drmModeCrtcSetGamma, iFiuuppp) +GO(drmModeDestroyPropertyBlob, iFiu) +GO(drmModeDetachMode, iFiup) +GO(drmModeDirtyFB, iFiupu) GO(drmModeFreeConnector, vFp) GO(drmModeFreeCrtc, vFp) GO(drmModeFreeEncoder, vFp) -//GO(drmModeFreeFB, -//GO(drmModeFreeModeInfo, -//GO(drmModeFreeObjectProperties, -//GO(drmModeFreePlane, -//GO(drmModeFreePlaneResources, -//GO(drmModeFreeProperty, -//GO(drmModeFreePropertyBlob, +GO(drmModeFreeFB, vFp) +GO(drmModeFreeModeInfo, vFp) +GO(drmModeFreeObjectProperties, vFp) +GO(drmModeFreePlane, vFp) +GO(drmModeFreePlaneResources, vFp) +GO(drmModeFreeProperty, vFp) +GO(drmModeFreePropertyBlob, vFp) GO(drmModeFreeResources, vFp) GO(drmModeGetConnector, pFiu) -//GO(drmModeGetConnectorCurrent, +GO(drmModeGetConnectorCurrent, pFiu) +GO(drmModeGetConnectorTypeName, pFu) GO(drmModeGetCrtc, pFiu) GO(drmModeGetEncoder, pFiu) -//GO(drmModeGetFB, -//GO(drmModeGetLease, -//GO(drmModeGetPlane, -//GO(drmModeGetPlaneResources, -//GO(drmModeGetProperty, -//GO(drmModeGetPropertyBlob, +GO(drmModeGetFB, pFiu) +//GOM(drmModeGetLease, pFEi) +GO(drmModeGetPlane, pFiu) +GO(drmModeGetPlaneResources, pFi) +GO(drmModeGetProperty, pFiu) +GO(drmModeGetPropertyBlob, pFiu) GO(drmModeGetResources, pFi) -//GO(drmModeListLessees, -//GO(drmModeMoveCursor, -//GO(drmModeObjectGetProperties, -//GO(drmModeObjectSetProperty, +//GOM(drmModeListLessees, pFEi) +GO(drmModeMoveCursor, iFiuii) +GO(drmModeObjectGetProperties, pFiuu) +GO(drmModeObjectSetProperty, iFiuuuU) GO(drmModePageFlip, iFiuuup) -//GO(drmModePageFlipTarget, -//GO(drmModeRevokeLease, +GO(drmModePageFlipTarget, iFiuuupu) +GO(drmModeRevokeLease, iFiu) GO(drmModeRmFB, iFiu) GO(drmModeSetCrtc, iFiuuuupip) -//GO(drmModeSetCursor, -//GO(drmModeSetCursor2, -//GO(drmModeSetPlane, +GO(drmModeSetCursor, iFiuuuu) +GO(drmModeSetCursor2, iFiuuuuii) +GO(drmModeSetPlane, iFiuuuuiiuuuuuu) GOM(drmMsg, vFEpV) -//GO(drmOpen, -//GO(drmOpenControl, -//GO(drmOpenOnce, -//GO(drmOpenOnceWithType, -//GO(drmOpenRender, -//GO(drmOpenWithType, +GO(drmOpen, iFpp) +GO(drmOpenControl, iFi) +GO(drmOpenOnce, iFppp) +GO(drmOpenOnceWithType, iFppi) +GO(drmOpenRender, iFi) +GO(drmOpenWithType, iFppi) GO(drmPrimeFDToHandle, iFiip) GO(drmPrimeHandleToFD, iFiuup) -//GO(drmRandom, -//GO(drmRandomCreate, -//GO(drmRandomDestroy, -//GO(drmRandomDouble, -//GO(drmRmMap, -//GO(drmScatterGatherAlloc, -//GO(drmScatterGatherFree, -//GO(drmSetBusid, -//GO(drmSetClientCap, -//GO(drmSetContextFlags, -//GO(drmSetInterfaceVersion, -//GO(drmSetMaster, -//GO(drmSetServerInfo, -//GO(drmSLCreate, -//GO(drmSLDelete, -//GO(drmSLDestroy, -//GO(drmSLDump, -//GO(drmSLFirst, -//GO(drmSLInsert, -//GO(drmSLLookup, -//GO(drmSLLookupNeighbors, -//GO(drmSLNext, -//GO(drmSwitchToContext, +GO(drmRandom, LFp) +GO(drmRandomCreate, pFL) +GO(drmRandomDestroy, iFp) +GO(drmRandomDouble, dFp) +GO(drmRmMap, iFiu) +GO(drmScatterGatherAlloc, iFiLp) +GO(drmScatterGatherFree, iFiu) +GO(drmSetBusid, iFip) +GO(drmSetClientCap, iFiUU) +GO(drmSetContextFlags, iFiuu) +GO(drmSetInterfaceVersion, iFip) +GO(drmSetMaster, iFi) +//GOM(drmSetServerInfo, vFEp) +GO(drmSLCreate, pFv) +GO(drmSLDelete, iFpL) +GO(drmSLDestroy, iFp) +GO(drmSLDump, vFp) +GO(drmSLFirst, iFppp) +GO(drmSLInsert, iFpLp) +GO(drmSLLookup, iFpLp) +GO(drmSLLookupNeighbors, iFpLpppp) +GO(drmSLNext, iFppp) +GO(drmSwitchToContext, iFiu) GO(drmSyncobjCreate, iFiup) GO(drmSyncobjDestroy, iFiu) GO(drmSyncobjExportSyncFile, iFiup) @@ -192,8 +193,8 @@ GO(drmSyncobjTimelineSignal, iFippu) GO(drmSyncobjTimelineWait, iFippuIup) GO(drmSyncobjTransfer, iFiuUuUu) GO(drmSyncobjWait, iFipuIup) -//GO(drmUnlock, -//GO(drmUnmap, -//GO(drmUnmapBufs, -//GO(drmUpdateDrawableInfo, -//GO(drmWaitVBlank, +GO(drmUnlock, iFiu) +GO(drmUnmap, iFpu) +GO(drmUnmapBufs, iFp) +GO(drmUpdateDrawableInfo, iFiuuup) +GO(drmWaitVBlank, iFip) diff --git a/src/wrapped/wrappedlibdrmamdgpu.c b/src/wrapped/wrappedlibdrmamdgpu.c new file mode 100644 index 0000000..4e58f5f --- /dev/null +++ b/src/wrapped/wrappedlibdrmamdgpu.c @@ -0,0 +1,30 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* libdrmamdgpuName = "libdrm_amdgpu.so.1"; +#define LIBNAME libdrmamdgpu + +#define ADDED_FUNCTIONS() \ + +//#include "generated/wrappedlibdrmamdgputypes.h" + +//#include "wrappercallback.h" + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibdrmamdgpu_private.h b/src/wrapped/wrappedlibdrmamdgpu_private.h new file mode 100644 index 0000000..42a5dbe --- /dev/null +++ b/src/wrapped/wrappedlibdrmamdgpu_private.h @@ -0,0 +1,88 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh.... +#endif + +GO(amdgpu_bo_alloc, iFppp) +GO(amdgpu_bo_cpu_map, iFpp) +GO(amdgpu_bo_cpu_unmap, iFp) +GO(amdgpu_bo_export, iFpup) +GO(amdgpu_bo_free, iFppp) +GO(amdgpu_bo_import, iFpuup) +GO(amdgpu_bo_inc_ref, vFp) +GO(amdgpu_bo_list_create, iFpuppp) +GO(amdgpu_bo_list_create_raw, iFpupp) +GO(amdgpu_bo_list_destroy, iFp) +GO(amdgpu_bo_list_destroy_raw, iFpupp) +GO(amdgpu_bo_list_update, iFpupp) +GO(amdgpu_bo_query_info, iFpp) +GO(amdgpu_bo_set_metadata, iFpp) +GO(amdgpu_bo_va_op, iFpLLLLu) +GO(amdgpu_bo_va_op_raw, iFppLLLLu) +GO(amdgpu_bo_wait_for_idle, iFpLp) +GO(amdgpu_create_bo_from_user_mem, iFppLp) +GO(amdgpu_cs_chunk_fence_info_to_data, vFpp) +GO(amdgpu_cs_chunk_fence_to_dep, vFpp) +GO(amdgpu_cs_create_semaphore, iFp) +GO(amdgpu_cs_create_syncobj, iFpp) +GO(amdgpu_cs_create_syncobj2, iFpup) +GO(amdgpu_cs_ctx_create, iFpp) +GO(amdgpu_cs_ctx_create2, iFpup) +GO(amdgpu_cs_ctx_free, iFp) +GO(amdgpu_cs_ctx_override_priority, iFppiu) +GO(amdgpu_cs_ctx_stable_pstate, iFpuup) +GO(amdgpu_cs_destroy_semaphore, iFp) +GO(amdgpu_cs_destroy_syncobj, iFpu) +GO(amdgpu_cs_export_syncobj, iFpup) +GO(amdgpu_cs_fence_to_handle, iFppup) +GO(amdgpu_cs_import_syncobj, iFpip) +GO(amdgpu_cs_query_fence_status, iFpLLp) +GO(amdgpu_cs_query_reset_state, iFppp) +GO(amdgpu_cs_query_reset_state2, iFpp) +GO(amdgpu_cs_signal_semaphore, iFpuuup) +GO(amdgpu_cs_submit, iFpLpu) +GO(amdgpu_cs_submit_raw, iFpppipp) +GO(amdgpu_cs_submit_raw2, iFppuipp) +GO(amdgpu_cs_syncobj_export_sync_file, iFpup) +GO(amdgpu_cs_syncobj_export_sync_file2, iFpuLup) +GO(amdgpu_cs_syncobj_import_sync_file, iFpui) +GO(amdgpu_cs_syncobj_import_sync_file2, iFpuLi) +GO(amdgpu_cs_syncobj_query, iFpppu) +GO(amdgpu_cs_syncobj_query2, iFpppuu) +GO(amdgpu_cs_syncobj_reset, iFppu) +GO(amdgpu_cs_syncobj_signal, iFppu) +GO(amdgpu_cs_syncobj_timeline_signal, iFpppu) +GO(amdgpu_cs_syncobj_timeline_wait, iFpppulup) +GO(amdgpu_cs_syncobj_transfer, iFpuLuLu) +GO(amdgpu_cs_syncobj_wait, iFppulup) +GO(amdgpu_cs_wait_fences, iFpuiLpp) +GO(amdgpu_cs_wait_semaphore, iFpuuup) +GO(amdgpu_device_deinitialize, iFp) +GO(amdgpu_device_get_fd, iFp) +GO(amdgpu_device_initialize, iFippp) +GO(amdgpu_device_initialize2, iFiippp) +GO(amdgpu_find_bo_by_cpu_mapping, iFppLpp) +GO(amdgpu_get_marketing_name, pFp) +GO(amdgpu_query_buffer_size_alignment, iFpp) +GO(amdgpu_query_crtc_from_id, iFpup) +GO(amdgpu_query_firmware_version, iFpuuupp) +GO(amdgpu_query_gds_info, iFpp) +GO(amdgpu_query_gpu_info, iFpp) +GO(amdgpu_query_gpuvm_fault_info, iFpup) +GO(amdgpu_query_heap_info, iFpuup) +GO(amdgpu_query_hw_ip_count, iFpup) +GO(amdgpu_query_hw_ip_info, iFpuup) +GO(amdgpu_query_info, iFpuup) +GO(amdgpu_query_sensor_info, iFpuup) +GO(amdgpu_query_sw_info, iFpup) +GO(amdgpu_query_video_caps_info, iFpuup) +GO(amdgpu_read_mm_registers, iFpuuuup) +GO(amdgpu_va_get_start_addr, LFp) +GO(amdgpu_va_manager_alloc, pFv) +GO(amdgpu_va_manager_deinit, vFp) +GO(amdgpu_va_manager_init, vFpLLLLu) +GO(amdgpu_va_range_alloc, iFpuLLLppL) +GO(amdgpu_va_range_alloc2, iFpuLLLppL) +GO(amdgpu_va_range_free, iFp) +GO(amdgpu_va_range_query, iFpupp) +GO(amdgpu_vm_reserve_vmid, iFpu) +GO(amdgpu_vm_unreserve_vmid, iFpu) diff --git a/src/wrapped/wrappedlibegl.c b/src/wrapped/wrappedlibegl.c index 4fc254e..c94482a 100644 --- a/src/wrapped/wrappedlibegl.c +++ b/src/wrapped/wrappedlibegl.c @@ -28,7 +28,7 @@ EXPORT void* my_eglGetProcAddress(x64emu_t* emu, void* name) { khint_t k; const char* rname = (const char*)name; - return getGLProcAddress(emu, (glprocaddress_t)my->eglGetProcAddress, rname); + return getGLProcAddress(emu, NULL, (glprocaddress_t)my->eglGetProcAddress, rname); } #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibegl_private.h b/src/wrapped/wrappedlibegl_private.h index 1f3eb96..a1c1193 100644 --- a/src/wrapped/wrappedlibegl_private.h +++ b/src/wrapped/wrappedlibegl_private.h @@ -1,49 +1,53 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -GO(eglBindAPI, iFi) -GO(eglBindTexImage, iFppi) -GO(eglChooseConfig, iFpppip) +GO(eglBindAPI, uFu) +GO(eglBindTexImage, uFppi) +GO(eglChooseConfig, uFpppip) GO(eglClientWaitSync, iFppiU) -GO(eglCopyBuffers, iFppp) +GO(eglCopyBuffers, uFppL) GO(eglCreateContext, pFpppp) -GO(eglCreateImage, pFppuup) -GO(eglCreatePbufferFromClientBuffer, pFpippp) +GO(eglCreateImage, pFppupp) +GO(eglCreatePbufferFromClientBuffer, pFpuppp) GO(eglCreatePbufferSurface, pFppp) -GO(eglCreatePixmapSurface, pFpppp) +GO(eglCreatePixmapSurface, pFppLp) GO(eglCreatePlatformPixmapSurface, pFpppp) GO(eglCreatePlatformWindowSurface, pFpppp) GO(eglCreateSync, pFpup) -GO(eglCreateWindowSurface, pFpppp) -GO(eglDestroyContext, iFpp) -GO(eglDestroyImage, iFpp) -GO(eglDestroySurface, iFpp) -GO(eglDestroySync, iFpp) -GO(eglGetConfigAttrib, iFppip) -GO(eglGetConfigs, iFppip) +GO(eglCreateWindowSurface, pFppLp) +GO(eglDestroyContext, uFpp) +GO(eglDestroyImage, uFpp) +GO(eglDestroySurface, uFpp) +GO(eglDestroySync, uFpp) +GO(eglGetConfigAttrib, uFppip) +GO(eglGetConfigs, uFppip) GO(eglGetCurrentContext, pFv) GO(eglGetCurrentDisplay, pFv) GO(eglGetCurrentSurface, pFi) GO(eglGetDisplay, pFp) GO(eglGetError, iFv) -GO(eglGetPlatformDisplay, pFppp) +GO(eglGetPlatformDisplay, pFupp) GOM(eglGetProcAddress, pFEp) -GO(eglGetSyncAttrib, iFppip) -GO(eglInitialize, iFppp) -GO(eglMakeCurrent, iFpppp) -GO(eglQueryAPI, iFv) -GO(eglQueryContext, iFppip) +GO(eglGetSyncAttrib, uFppip) +GO(eglInitialize, uFppp) +GO(eglMakeCurrent, uFpppp) +GO(eglQueryAPI, uFv) +GO(eglQueryContext, uFppip) GO(eglQueryString, pFpi) -GO(eglQuerySurface, iFppip) -GO(eglReleaseTexImage, iFppi) -GO(eglReleaseThread, iFv) -GO(eglSurfaceAttrib, iFppii) -GO(eglSwapBuffers, iFpp) -GO(eglSwapInterval, iFpi) -GO(eglTerminate, iFp) -GO(eglWaitClient, iFv) -GO(eglWaitGL, iFv) -GO(eglWaitNative, iFi) -GO(eglWaitSync, iFppi) +GO(eglQuerySurface, uFppip) +GO(eglReleaseTexImage, uFppi) +GO(eglReleaseThread, uFv) +GO(eglSurfaceAttrib, uFppii) +GO(eglSwapBuffers, uFpp) +GO(eglSwapInterval, uFpi) +GO(eglTerminate, uFp) +GO(eglWaitClient, uFv) +GO(eglWaitGL, uFv) +GO(eglWaitNative, uFi) +GO(eglWaitSync, uFppi) +// EGL_EXT_platform_base +GO(eglGetPlatformDisplayEXT, pFupp) +GO(eglCreatePlatformWindowSurfaceEXT, pFpppp) +GO(eglCreatePlatformPixmapSurfaceEXT, pFpppp) diff --git a/src/wrapped/wrappedlibfuse.c b/src/wrapped/wrappedlibfuse.c index bca9c4c..bd281d6 100644 --- a/src/wrapped/wrappedlibfuse.c +++ b/src/wrapped/wrappedlibfuse.c @@ -2312,8 +2312,8 @@ EXPORT size_t my_fuse_add_direntry(x64emu_t* emu, void* req, char *buf, size_t b EXPORT int my_fuse_main_real(x64emu_t* emu, int argc, void* argv, const fuse_operations_t* op, size_t op_size, void* data) { static fuse_operations_t o_ = {0}; -box64_log=2; -box64_showsegv=1; + SET_BOX64ENV(log, 2); + SET_BOX64ENV(showsegv, 1); size_t cvt = 0; #define GO(A) if(cvtA); cvt+=sizeof(void*); if(o_.A) printf_log(LOG_DEBUG, "fuse: %s is present\n", #A);} // size is aligned in GOS diff --git a/src/wrapped/wrappedlibgl.c b/src/wrapped/wrappedlibgl.c index 5944502..5a52830 100644 --- a/src/wrapped/wrappedlibgl.c +++ b/src/wrapped/wrappedlibgl.c @@ -18,18 +18,29 @@ #include "gltools.h" const char* libglName = "libGL.so.1"; +#define ALTNAME "libGL.so" #define LIBNAME libgl -static library_t* my_lib = NULL; + +#include "generated/wrappedlibgltypes.h" + +#include "wrappercallback.h" // FIXME: old wrapped* type of file, cannot use generated/wrappedlibgltypes.h EXPORT void* my_glXGetProcAddress(x64emu_t* emu, void* name) { - khint_t k; + pFp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXGetProcAddress; + const char* rname = (const char*)name; + return getGLProcAddress(emu, NULL, (void*)fnc, rname); +} +EXPORT void* my_glXGetProcAddressARB(x64emu_t* emu, void* name) +{ + pFp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXGetProcAddressARB; const char* rname = (const char*)name; - return getGLProcAddress(emu, my_lib->w.priv, rname); + return getGLProcAddress(emu, NULL, (void*)fnc, rname); } -EXPORT void* my_glXGetProcAddressARB(x64emu_t* emu, void* name) __attribute__((alias("my_glXGetProcAddress"))); typedef int (*iFi_t)(int); typedef void (*vFpp_t)(void*, void*); @@ -165,291 +176,94 @@ static void* find_get_blob_func_Fct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for libGL get_blob_func callback\n"); return NULL; } +#undef SUPER -// glDebugMessageCallback ... -#define GO(A) \ -static vFpp_t my_glDebugMessageCallback_fct_##A = NULL; \ -static void my_glDebugMessageCallback_##A(x64emu_t* emu, void* prod, void* param) \ -{ \ - if(!my_glDebugMessageCallback_fct_##A) \ - return; \ - my_glDebugMessageCallback_fct_##A(find_debug_callback_Fct(prod), param); \ -} -SUPER() -#undef GO -static void* find_glDebugMessageCallback_Fct(void* fct) +#define PRE_INIT \ + if(BOX64ENV(libgl)) { \ + lib->w.lib = dlopen(BOX64ENV(libgl), RTLD_LAZY | RTLD_GLOBAL); \ + lib->path = strdup(BOX64ENV(libgl)); \ + } + +#include "wrappedlib_init.h" + +// glDebugMessageCallback +EXPORT void my_glDebugMessageCallback(x64emu_t* emu, void* prod, void* param) { - if(!fct) return fct; - #define GO(A) if(my_glDebugMessageCallback_fct_##A == (vFpp_t)fct) return my_glDebugMessageCallback_##A; - SUPER() - #undef GO - #define GO(A) if(my_glDebugMessageCallback_fct_##A == 0) {my_glDebugMessageCallback_fct_##A = (vFpp_t)fct; return my_glDebugMessageCallback_##A; } - SUPER() - #undef GO - printf_log(LOG_NONE, "Warning, no more slot for libGL glDebugMessageCallback callback\n"); - return NULL; + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallback; + fnc(find_debug_callback_Fct(prod), param); } -// glDebugMessageCallbackARB ... -#define GO(A) \ -static vFpp_t my_glDebugMessageCallbackARB_fct_##A = NULL; \ -static void my_glDebugMessageCallbackARB_##A(x64emu_t* emu, void* prod, void* param) \ -{ \ - if(!my_glDebugMessageCallbackARB_fct_##A) \ - return; \ - my_glDebugMessageCallbackARB_fct_##A(find_debug_callback_Fct(prod), param); \ -} -SUPER() -#undef GO -static void* find_glDebugMessageCallbackARB_Fct(void* fct) +// glDebugMessageCallbackARB +EXPORT void my_glDebugMessageCallbackARB(x64emu_t* emu, void* prod, void* param) { - if(!fct) return fct; - #define GO(A) if(my_glDebugMessageCallbackARB_fct_##A == (vFpp_t)fct) return my_glDebugMessageCallbackARB_##A; - SUPER() - #undef GO - #define GO(A) if(my_glDebugMessageCallbackARB_fct_##A == 0) {my_glDebugMessageCallbackARB_fct_##A = (vFpp_t)fct; return my_glDebugMessageCallbackARB_##A; } - SUPER() - #undef GO - printf_log(LOG_NONE, "Warning, no more slot for libGL glDebugMessageCallbackARB callback\n"); - return NULL; -} -// glDebugMessageCallbackAMD ... -#define GO(A) \ -static vFpp_t my_glDebugMessageCallbackAMD_fct_##A = NULL; \ -static void my_glDebugMessageCallbackAMD_##A(x64emu_t* emu, void* prod, void* param) \ -{ \ - if(!my_glDebugMessageCallbackAMD_fct_##A) \ - return; \ - my_glDebugMessageCallbackAMD_fct_##A(find_debug_callback_Fct(prod), param); \ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallbackARB; + fnc(find_debug_callback_Fct(prod), param); } -SUPER() -#undef GO -static void* find_glDebugMessageCallbackAMD_Fct(void* fct) +// glDebugMessageCallbackAMD +EXPORT void my_glDebugMessageCallbackAMD(x64emu_t* emu, void* prod, void* param) { - if(!fct) return fct; - #define GO(A) if(my_glDebugMessageCallbackAMD_fct_##A == (vFpp_t)fct) return my_glDebugMessageCallbackAMD_##A; - SUPER() - #undef GO - #define GO(A) if(my_glDebugMessageCallbackAMD_fct_##A == 0) {my_glDebugMessageCallbackAMD_fct_##A = (vFpp_t)fct; return my_glDebugMessageCallbackAMD_##A; } - SUPER() - #undef GO - printf_log(LOG_NONE, "Warning, no more slot for libGL glDebugMessageCallbackAMD callback\n"); - return NULL; -} -// glDebugMessageCallbackKHR ... -#define GO(A) \ -static vFpp_t my_glDebugMessageCallbackKHR_fct_##A = NULL; \ -static void my_glDebugMessageCallbackKHR_##A(x64emu_t* emu, void* prod, void* param) \ -{ \ - if(!my_glDebugMessageCallbackKHR_fct_##A) \ - return; \ - my_glDebugMessageCallbackKHR_fct_##A(find_debug_callback_Fct(prod), param); \ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallbackAMD; + fnc(find_debug_callback_Fct(prod), param); } -SUPER() -#undef GO -static void* find_glDebugMessageCallbackKHR_Fct(void* fct) +// glDebugMessageCallbackKHR +EXPORT void my_glDebugMessageCallbackKHR(x64emu_t* emu, void* prod, void* param) { - if(!fct) return fct; - #define GO(A) if(my_glDebugMessageCallbackKHR_fct_##A == (vFpp_t)fct) return my_glDebugMessageCallbackKHR_##A; - SUPER() - #undef GO - #define GO(A) if(my_glDebugMessageCallbackKHR_fct_##A == 0) {my_glDebugMessageCallbackKHR_fct_##A = (vFpp_t)fct; return my_glDebugMessageCallbackKHR_##A; } - SUPER() - #undef GO - printf_log(LOG_NONE, "Warning, no more slot for libGL glDebugMessageCallbackKHR callback\n"); - return NULL; + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallbackKHR; + fnc(find_debug_callback_Fct(prod), param); } -// eglDebugMessageControlKHR ... -#define GO(A) \ -static vFpp_t my_eglDebugMessageControlKHR_fct_##A = NULL; \ -static void my_eglDebugMessageControlKHR_##A(x64emu_t* emu, void* prod, void* param) \ -{ \ - if(!my_eglDebugMessageControlKHR_fct_##A) \ - return; \ - my_eglDebugMessageControlKHR_fct_##A(find_egl_debug_callback_Fct(prod), param); \ -} -SUPER() -#undef GO -static void* find_eglDebugMessageControlKHR_Fct(void* fct) +// eglDebugMessageControlKHR +EXPORT int my_eglDebugMessageControlKHR(x64emu_t* emu, void* prod, void* param) { - if(!fct) return fct; - #define GO(A) if(my_eglDebugMessageControlKHR_fct_##A == (vFpp_t)fct) return my_eglDebugMessageControlKHR_##A; - SUPER() - #undef GO - #define GO(A) if(my_eglDebugMessageControlKHR_fct_##A == 0) {my_eglDebugMessageControlKHR_fct_##A = (vFpp_t)fct; return my_eglDebugMessageControlKHR_##A; } - SUPER() - #undef GO - printf_log(LOG_NONE, "Warning, no more slot for libGL eglDebugMessageControlKHR callback\n"); - return NULL; + iFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->eglDebugMessageControlKHR; + return fnc(find_debug_callback_Fct(prod), param); } // eglSetBlobCacheFuncsANDROID ... -#define GO(A) \ -static vFppp_t my_eglSetBlobCacheFuncsANDROID_fct_##A = NULL; \ -static void my_eglSetBlobCacheFuncsANDROID_##A(x64emu_t* emu, void* dpy, void* set, void* get) \ -{ \ - if(!my_eglSetBlobCacheFuncsANDROID_fct_##A) \ - return; \ - my_eglSetBlobCacheFuncsANDROID_fct_##A(dpy, find_set_blob_func_Fct(set), find_get_blob_func_Fct(get)); \ -} -SUPER() -#undef GO -static void* find_eglSetBlobCacheFuncsANDROID_Fct(void* fct) +EXPORT void my_eglSetBlobCacheFuncsANDROID(x64emu_t* emu, void* dpy, void* set, void* get) { - if(!fct) return fct; - #define GO(A) if(my_eglSetBlobCacheFuncsANDROID_fct_##A == (vFppp_t)fct) return my_eglSetBlobCacheFuncsANDROID_##A; - SUPER() - #undef GO - #define GO(A) if(my_eglSetBlobCacheFuncsANDROID_fct_##A == 0) {my_eglSetBlobCacheFuncsANDROID_fct_##A = (vFppp_t)fct; return my_eglSetBlobCacheFuncsANDROID_##A; } - SUPER() - #undef GO - printf_log(LOG_NONE, "Warning, no more slot for libGL eglSetBlobCacheFuncsANDROID callback\n"); - return NULL; + vFppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->eglSetBlobCacheFuncsANDROID; + fnc(dpy, find_set_blob_func_Fct(set), find_get_blob_func_Fct(get)); } // glXSwapIntervalMESA ... -#define GO(A) \ -static iFi_t my_glXSwapIntervalMESA_fct_##A = NULL; \ -static int my_glXSwapIntervalMESA_##A(int interval) \ -{ \ - if(!my_glXSwapIntervalMESA_fct_##A) \ - return 0; \ - return my_glXSwapIntervalMESA_fct_##A(interval); \ -} -SUPER() -#undef GO - -static int my_dummy_glXSwapIntervalMESA(int interval) +EXPORT int my_dummy_glXSwapIntervalMESA(unsigned int interval) { return 5; // GLX_BAD_CONTEXT } - -static void* find_glXSwapIntervalMESA_Fct(void* fct) +EXPORT int my_glXSwapIntervalMESA(x64emu_t* emu, unsigned int interval) { - if(!fct) return my_dummy_glXSwapIntervalMESA; - #define GO(A) if(my_glXSwapIntervalMESA_fct_##A == (iFi_t)fct) return my_glXSwapIntervalMESA_##A; - SUPER() - #undef GO - #define GO(A) if(my_glXSwapIntervalMESA_fct_##A == 0) {my_glXSwapIntervalMESA_fct_##A = (iFi_t)fct; return my_glXSwapIntervalMESA_##A; } - SUPER() - #undef GO - printf_log(LOG_NONE, "Warning, no more slot for libGL glXSwapIntervalMESA callback\n"); - return NULL; + iFu_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXSwapIntervalMESA; + if(!fnc) fnc=my_dummy_glXSwapIntervalMESA; + return fnc(interval); } - // glXSwapIntervalEXT ... -#define GO(A) \ -static vFppi_t my_glXSwapIntervalEXT_fct_##A = NULL; \ -static void my_glXSwapIntervalEXT_##A(void* dpy, void* drawable, int interval) \ -{ \ - if (!my_glXSwapIntervalEXT_fct_##A) \ - return; \ - my_glXSwapIntervalEXT_fct_##A(dpy, drawable, interval); \ -} -SUPER() -#undef GO - -static void my_dummy_glXSwapIntervalEXT(void* dpy, void* drawable, int interval) {} - -static void* find_glXSwapIntervalEXT_Fct(void* fct) +EXPORT void my_dummy_glXSwapIntervalEXT(void* dpy, unsigned long drawable, int interval) {} +EXPORT void my_glXSwapIntervalEXT(x64emu_t* emu, void* dpy, unsigned long drawable, int interval) { - if(!fct) return my_dummy_glXSwapIntervalEXT; - #define GO(A) if(my_glXSwapIntervalEXT_fct_##A == (vFppi_t)fct) return my_glXSwapIntervalEXT_##A; - SUPER() - #undef GO - #define GO(A) if(my_glXSwapIntervalEXT_fct_##A == 0) {my_glXSwapIntervalEXT_fct_##A = (vFppi_t)fct; return my_glXSwapIntervalEXT_##A; } - SUPER() - #undef GO - printf_log(LOG_NONE, "Warning, no more slot for libGL glXSwapIntervalEXT callback\n"); - return NULL; + vFpLi_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXSwapIntervalEXT; + if(!fnc) fnc=my_dummy_glXSwapIntervalEXT; + fnc(dpy, drawable, interval); } - // glProgramCallbackMESA ... -#define GO(A) \ -static vFpp_t my_glProgramCallbackMESA_fct_##A = NULL; \ -static void my_glProgramCallbackMESA_##A(x64emu_t* emu, void* f, void* data)\ -{ \ - if(!my_glProgramCallbackMESA_fct_##A) \ - return; \ - my_glProgramCallbackMESA_fct_##A(find_program_callback_Fct(f), data); \ -} -SUPER() -#undef GO -static void* find_glProgramCallbackMESA_Fct(void* fct) +EXPORT void my_glProgramCallbackMESA(x64emu_t* emu, int t, void* f, void* data) { - if(!fct) return fct; - #define GO(A) if(my_glProgramCallbackMESA_fct_##A == (vFpp_t)fct) return my_glProgramCallbackMESA_##A; - SUPER() - #undef GO - #define GO(A) if(my_glProgramCallbackMESA_fct_##A == 0) {my_glProgramCallbackMESA_fct_##A = (vFpp_t)fct; return my_glProgramCallbackMESA_##A; } - SUPER() - #undef GO - printf_log(LOG_NONE, "Warning, no more slot for libGL glProgramCallbackMESA callback\n"); - return NULL; + vFipp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glProgramCallbackMESA; + fnc(t, find_program_callback_Fct(f), data); } void* my_GetVkProcAddr(x64emu_t* emu, void* name, void*(*getaddr)(void*)); // defined in wrappedvulkan.c // glGetVkProcAddrNV ... -#define GO(A) \ -static pFp_t my_glGetVkProcAddrNV_fct_##A = NULL; \ -static void* my_glGetVkProcAddrNV_##A(x64emu_t* emu, void* name) \ -{ \ - if(!my_glGetVkProcAddrNV_fct_##A) \ - return NULL; \ - return my_GetVkProcAddr(emu, name, my_glGetVkProcAddrNV_fct_##A); \ -} -SUPER() -#undef GO -static void* find_glGetVkProcAddrNV_Fct(void* fct) +EXPORT void* my_glGetVkProcAddrNV(x64emu_t* emu, void* name) { - if(!fct) return fct; - #define GO(A) if(my_glGetVkProcAddrNV_fct_##A == (pFp_t)fct) return my_glGetVkProcAddrNV_##A; - SUPER() - #undef GO - #define GO(A) if(my_glGetVkProcAddrNV_fct_##A == 0) {my_glGetVkProcAddrNV_fct_##A = (pFp_t)fct; return my_glGetVkProcAddrNV_##A; } - SUPER() - #undef GO - printf_log(LOG_NONE, "Warning, no more slot for libGL glGetVkProcAddrNV callback\n"); - return NULL; + pFp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glGetVkProcAddrNV; + return my_GetVkProcAddr(emu, name, fnc); } -#undef SUPER - -#define PRE_INIT if(box64_libGL) {lib->w.lib = dlopen(box64_libGL, RTLD_LAZY | RTLD_GLOBAL); lib->path = strdup(box64_libGL);} else -#define CUSTOM_INIT \ - my_lib = lib; \ - lib->w.priv = dlsym(lib->w.lib, "glXGetProcAddress"); \ - void* symb = dlsym(lib->w.lib, "glDebugMessageCallback"); \ - if(symb) { \ - k = kh_get(symbolmap, lib->w.mysymbolmap, "glDebugMessageCallback"); \ - symbol1_t *s = &kh_value(lib->w.mysymbolmap, k); \ - s->resolved = 1; \ - s->addr = AddBridge(lib->w.bridge, s->w, find_glDebugMessageCallback_Fct(symb), 0, "glDebugMessageCallback"); \ - } \ - symb = dlsym(lib->w.lib, "glXSwapIntervalMESA"); \ - if(symb) { \ - k = kh_get(symbolmap, lib->w.mysymbolmap, "glXSwapIntervalMESA"); \ - symbol1_t *s = &kh_value(lib->w.mysymbolmap, k); \ - s->resolved = 1; \ - s->addr = AddBridge(lib->w.bridge, s->w, find_glXSwapIntervalMESA_Fct(symb), 0, "glXSwapIntervalMESA"); \ - } \ - symb = dlsym(lib->w.lib, "glXSwapIntervalEXT"); \ - if(symb) { \ - k = kh_get(symbolmap, lib->w.mysymbolmap, "glXSwapIntervalEXT"); \ - symbol1_t *s = &kh_value(lib->w.mysymbolmap, k); \ - s->resolved = 1; \ - s->addr = AddBridge(lib->w.bridge, s->w, find_glXSwapIntervalEXT_Fct(symb), 0, "glXSwapIntervalEXT"); \ - } \ - -#include "wrappedlib_init.h" - -#define SUPER() \ - GO(vFpp_t, glDebugMessageCallback) \ - GO(vFpp_t, glDebugMessageCallbackARB) \ - GO(vFpp_t, glDebugMessageCallbackAMD) \ - GO(vFpp_t, glDebugMessageCallbackKHR) \ - GO(vFpp_t, eglDebugMessageControlKHR) \ - GO(iFi_t, glXSwapIntervalMESA) \ - GO(vFppi_t, glXSwapIntervalEXT) \ - GO(vFpp_t, glProgramCallbackMESA) \ - GO(pFp_t, glGetVkProcAddrNV) \ - GO(vFppp_t, eglSetBlobCacheFuncsANDROID) \ - gl_wrappers_t* getGLProcWrapper(box64context_t* context, glprocaddress_t procaddress) { @@ -508,8 +322,9 @@ void freeGLProcWrapper(box64context_t* context) gl_wrappers = NULL; } -void* getGLProcAddress(x64emu_t* emu, glprocaddress_t procaddr, const char* rname) +void* getGLProcAddress(x64emu_t* emu, const char* my, glprocaddress_t procaddr, const char* rname) { + if(!my) my = "my_"; khint_t k; printf_dlsym(LOG_DEBUG, "Calling getGLProcAddress[%p](\"%s\") => ", procaddr, rname); gl_wrappers_t* wrappers = getGLProcWrapper(emu->context, procaddr); @@ -517,33 +332,23 @@ void* getGLProcAddress(x64emu_t* emu, glprocaddress_t procaddr, const char* rnam // get proc adress using actual glXGetProcAddress k = kh_get(symbolmap, wrappers->glmymap, rname); int is_my = (k==kh_end(wrappers->glmymap))?0:1; - void* symbol; + void* symbol = procaddr(rname); + void* fnc = NULL; if(is_my) { - // try again, by using custom "my_" now... - #define GO(A, B) else if(!strcmp(rname, #B)) symbol = find_##B##_Fct(procaddr(rname)); - if(0) {} - SUPER() - else { - if(strcmp(rname, "glXGetProcAddress") && strcmp(rname, "glXGetProcAddressARB")) { - printf_log(LOG_NONE, "Warning, %s defined as GOM, but find_%s_Fct not defined\n", rname, rname); - } - char tmp[200]; - strcpy(tmp, "my_"); - strcat(tmp, rname); - symbol = dlsym(emu->context->box64lib, tmp); - } - #undef GO - #undef SUPER - } else - symbol = procaddr(rname); + char tmp[200]; + strcpy(tmp, my); + strcat(tmp, rname); + fnc = symbol; + symbol = dlsym(emu->context->box64lib, tmp); + } if(!symbol) { - printf_dlsym(LOG_DEBUG, "%p\n", NULL); + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", NULL); return NULL; // easy } // check if alread bridged - uintptr_t ret = CheckBridged(emu->context->system, symbol); + uintptr_t ret = CheckBridged2(emu->context->system, symbol, fnc); if(ret) { - printf_dlsym(LOG_DEBUG, "%p\n", (void*)ret); + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", (void*)ret); return (void*)ret; // already bridged } // get wrapper @@ -563,18 +368,13 @@ void* getGLProcAddress(x64emu_t* emu, glprocaddress_t procaddr, const char* rnam k = kh_get(symbolmap, wrappers->glwrappers, tmp); } if(k==kh_end(wrappers->glwrappers)) { - printf_dlsym(LOG_DEBUG, "%p\n", NULL); - printf_dlsym(LOG_INFO, "Warning, no wrapper for %s\n", rname); + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", NULL); + printf_dlsym_prefix(2, LOG_INFO, "Warning, no wrapper for %s\n", rname); return NULL; } symbol1_t* s = &kh_value(wrappers->glwrappers, k); - if(!s->resolved) { - const char* constname = kh_key(wrappers->glwrappers, k); - AddOffsetSymbol(emu->context->maplib, symbol, rname); - s->addr = AddCheckBridge(emu->context->system, s->w, symbol, 0, constname); - s->resolved = 1; - } - ret = s->addr; - printf_dlsym(LOG_DEBUG, "%p\n", (void*)ret); + const char* constname = kh_key(wrappers->glwrappers, k); + ret = AddCheckBridge2(emu->context->system, s->w, symbol, fnc, 0, constname); + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", (void*)ret); return (void*)ret; } diff --git a/src/wrapped/wrappedlibgl_private.h b/src/wrapped/wrappedlibgl_private.h index 33605de..4134f64 100644 --- a/src/wrapped/wrappedlibgl_private.h +++ b/src/wrapped/wrappedlibgl_private.h @@ -1,6 +1,7 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif + //VERSION_1_0 GO(glAccum, vFuf) GO(glAlphaFunc, vFuf) @@ -9,7 +10,7 @@ GO(glBitmap, vFiiffffp) GO(glBlendFunc, vFuu) GO(glCallList, vFu) GO(glCallLists, vFiup) -GO(glClear, vFi) +GO(glClear, vFu) GO(glClearAccum, vFffff) GO(glClearColor, vFffff) GO(glClearDepth, vFd) @@ -24,7 +25,7 @@ GO(glColor3f, vFfff) GO(glColor3fv, vFp) GO(glColor3i, vFiii) GO(glColor3iv, vFp) -GO(glColor3s, vFiii) +GO(glColor3s, vFwww) GO(glColor3sv, vFp) GO(glColor3ub, vFCCC) GO(glColor3ubv, vFp) @@ -40,7 +41,7 @@ GO(glColor4f, vFffff) GO(glColor4fv, vFp) GO(glColor4i, vFiiii) GO(glColor4iv, vFp) -GO(glColor4s, vFiiii) +GO(glColor4s, vFwwww) GO(glColor4sv, vFp) GO(glColor4ub, vFCCCC) GO(glColor4ubv, vFp) @@ -54,12 +55,12 @@ GO(glCopyPixels, vFiiiiu) GO(glCullFace, vFu) GO(glDeleteLists, vFui) GO(glDepthFunc, vFu) -GO(glDepthMask, vFi) +GO(glDepthMask, vFC) GO(glDepthRange, vFdd) GO(glDisable, vFu) GO(glDrawBuffer, vFu) GO(glDrawPixels, vFiiuup) -GO(glEdgeFlag, vFi) +GO(glEdgeFlag, vFC) GO(glEdgeFlagv, vFp) GO(glEnable, vFu) GO(glEnd, vFv) @@ -122,11 +123,11 @@ GO(glIndexf, vFf) GO(glIndexfv, vFp) GO(glIndexi, vFi) GO(glIndexiv, vFp) -GO(glIndexs, vFi) +GO(glIndexs, vFw) GO(glIndexsv, vFp) GO(glInitNames, vFv) -GO(glIsEnabled, iFu) -GO(glIsList, iFu) +GO(glIsEnabled, CFu) +GO(glIsList, CFu) GO(glLightModelf, vFuf) GO(glLightModelfv, vFup) GO(glLightModeli, vFui) @@ -159,7 +160,7 @@ GO(glMatrixMode, vFu) GO(glMultMatrixd, vFp) GO(glMultMatrixf, vFp) GO(glNewList, vFuu) -GO(glNormal3b, vFiii) +GO(glNormal3b, vFccc) GO(glNormal3bv, vFp) GO(glNormal3d, vFddd) GO(glNormal3dv, vFp) @@ -167,7 +168,7 @@ GO(glNormal3f, vFfff) GO(glNormal3fv, vFp) GO(glNormal3i, vFiii) GO(glNormal3iv, vFp) -GO(glNormal3s, vFiii) +GO(glNormal3s, vFwww) GO(glNormal3sv, vFp) GO(glOrtho, vFdddddd) GO(glPassThrough, vFf) @@ -185,7 +186,7 @@ GO(glPolygonStipple, vFp) GO(glPopAttrib, vFv) GO(glPopMatrix, vFv) GO(glPopName, vFv) -GO(glPushAttrib, vFi) +GO(glPushAttrib, vFu) GO(glPushMatrix, vFv) GO(glPushName, vFu) GO(glRasterPos2d, vFdd) @@ -194,7 +195,7 @@ GO(glRasterPos2f, vFff) GO(glRasterPos2fv, vFp) GO(glRasterPos2i, vFii) GO(glRasterPos2iv, vFp) -GO(glRasterPos2s, vFii) +GO(glRasterPos2s, vFww) GO(glRasterPos2sv, vFp) GO(glRasterPos3d, vFddd) GO(glRasterPos3dv, vFp) @@ -202,7 +203,7 @@ GO(glRasterPos3f, vFfff) GO(glRasterPos3fv, vFp) GO(glRasterPos3i, vFiii) GO(glRasterPos3iv, vFp) -GO(glRasterPos3s, vFiii) +GO(glRasterPos3s, vFwww) GO(glRasterPos3sv, vFp) GO(glRasterPos4d, vFdddd) GO(glRasterPos4dv, vFp) @@ -210,7 +211,7 @@ GO(glRasterPos4f, vFffff) GO(glRasterPos4fv, vFp) GO(glRasterPos4i, vFiiii) GO(glRasterPos4iv, vFp) -GO(glRasterPos4s, vFiiii) +GO(glRasterPos4s, vFwwww) GO(glRasterPos4sv, vFp) GO(glReadBuffer, vFu) GO(glReadPixels, vFiiiiuup) @@ -220,7 +221,7 @@ GO(glRectf, vFffff) GO(glRectfv, vFpp) GO(glRecti, vFiiii) GO(glRectiv, vFpp) -GO(glRects, vFiiii) +GO(glRects, vFwwww) GO(glRectsv, vFpp) GO(glRenderMode, iFu) GO(glRotated, vFdddd) @@ -239,7 +240,7 @@ GO(glTexCoord1f, vFf) GO(glTexCoord1fv, vFp) GO(glTexCoord1i, vFi) GO(glTexCoord1iv, vFp) -GO(glTexCoord1s, vFi) +GO(glTexCoord1s, vFw) GO(glTexCoord1sv, vFp) GO(glTexCoord2d, vFdd) GO(glTexCoord2dv, vFp) @@ -247,7 +248,7 @@ GO(glTexCoord2f, vFff) GO(glTexCoord2fv, vFp) GO(glTexCoord2i, vFii) GO(glTexCoord2iv, vFp) -GO(glTexCoord2s, vFii) +GO(glTexCoord2s, vFww) GO(glTexCoord2sv, vFp) GO(glTexCoord3d, vFddd) GO(glTexCoord3dv, vFp) @@ -255,7 +256,7 @@ GO(glTexCoord3f, vFfff) GO(glTexCoord3fv, vFp) GO(glTexCoord3i, vFiii) GO(glTexCoord3iv, vFp) -GO(glTexCoord3s, vFiii) +GO(glTexCoord3s, vFwww) GO(glTexCoord3sv, vFp) GO(glTexCoord4d, vFdddd) GO(glTexCoord4dv, vFp) @@ -263,7 +264,7 @@ GO(glTexCoord4f, vFffff) GO(glTexCoord4fv, vFp) GO(glTexCoord4i, vFiiii) GO(glTexCoord4iv, vFp) -GO(glTexCoord4s, vFiiii) +GO(glTexCoord4s, vFwwww) GO(glTexCoord4sv, vFp) GO(glTexEnvf, vFuuf) GO(glTexEnvfv, vFuup) @@ -289,7 +290,7 @@ GO(glVertex2f, vFff) GO(glVertex2fv, vFp) GO(glVertex2i, vFii) GO(glVertex2iv, vFp) -GO(glVertex2s, vFii) +GO(glVertex2s, vFww) GO(glVertex2sv, vFp) GO(glVertex3d, vFddd) GO(glVertex3dv, vFp) @@ -297,7 +298,7 @@ GO(glVertex3f, vFfff) GO(glVertex3fv, vFp) GO(glVertex3i, vFiii) GO(glVertex3iv, vFp) -GO(glVertex3s, vFiii) +GO(glVertex3s, vFwww) GO(glVertex3sv, vFp) GO(glVertex4d, vFdddd) GO(glVertex4dv, vFp) @@ -305,7 +306,7 @@ GO(glVertex4f, vFffff) GO(glVertex4fv, vFp) GO(glVertex4i, vFiiii) GO(glVertex4iv, vFp) -GO(glVertex4s, vFiiii) +GO(glVertex4s, vFwwww) GO(glVertex4sv, vFp) GO(glViewport, vFiiii) //VERSION_1_1 @@ -326,15 +327,15 @@ GO(glEnableClientState, vFu) GO(glGenTextures, vFip) GO(glGetPointerv, vFup) GO(glIndexPointer, vFuip) -GO(glIndexub, vFu) +GO(glIndexub, vFC) GO(glIndexubv, vFp) GO(glInterleavedArrays, vFuip) -GO(glIsTexture, iFu) +GO(glIsTexture, CFu) GO(glNormalPointer, vFuip) GO(glPolygonOffset, vFff) GO(glPopClientAttrib, vFv) GO(glPrioritizeTextures, vFipp) -GO(glPushClientAttrib, vFi) +GO(glPushClientAttrib, vFu) GO(glTexCoordPointer, vFiuip) GO(glTexSubImage1D, vFuiiiuup) GO(glTexSubImage2D, vFuiiiiiuup) @@ -364,15 +365,15 @@ GO(glGetColorTableParameteriv, vFuup) GO(glGetConvolutionFilter, vFuuup) GO(glGetConvolutionParameterfv, vFuup) GO(glGetConvolutionParameteriv, vFuup) -GO(glGetHistogram, vFuiuup) +GO(glGetHistogram, vFuCuup) GO(glGetHistogramParameterfv, vFuup) GO(glGetHistogramParameteriv, vFuup) GO(glGetMinmax, vFuCuup) GO(glGetMinmaxParameterfv, vFuup) GO(glGetMinmaxParameteriv, vFuup) GO(glGetSeparableFilter, vFuuuppp) -GO(glHistogram, vFuiui) -GO(glMinmax, vFuui) +GO(glHistogram, vFuiuC) +GO(glMinmax, vFuuC) GO(glResetHistogram, vFu) GO(glResetMinmax, vFu) GO(glSeparableFilter2D, vFuuiiuupp) @@ -398,7 +399,7 @@ GO(glMultiTexCoord1f, vFuf) GO(glMultiTexCoord1fv, vFup) GO(glMultiTexCoord1i, vFui) GO(glMultiTexCoord1iv, vFup) -GO(glMultiTexCoord1s, vFui) +GO(glMultiTexCoord1s, vFuw) GO(glMultiTexCoord1sv, vFup) GO(glMultiTexCoord2d, vFudd) GO(glMultiTexCoord2dv, vFup) @@ -406,7 +407,7 @@ GO(glMultiTexCoord2f, vFuff) GO(glMultiTexCoord2fv, vFup) GO(glMultiTexCoord2i, vFuii) GO(glMultiTexCoord2iv, vFup) -GO(glMultiTexCoord2s, vFuii) +GO(glMultiTexCoord2s, vFuww) GO(glMultiTexCoord2sv, vFup) GO(glMultiTexCoord3d, vFuddd) GO(glMultiTexCoord3dv, vFup) @@ -414,7 +415,7 @@ GO(glMultiTexCoord3f, vFufff) GO(glMultiTexCoord3fv, vFup) GO(glMultiTexCoord3i, vFuiii) GO(glMultiTexCoord3iv, vFup) -GO(glMultiTexCoord3s, vFuiii) +GO(glMultiTexCoord3s, vFuwww) GO(glMultiTexCoord3sv, vFup) GO(glMultiTexCoord4d, vFudddd) GO(glMultiTexCoord4dv, vFup) @@ -422,9 +423,9 @@ GO(glMultiTexCoord4f, vFuffff) GO(glMultiTexCoord4fv, vFup) GO(glMultiTexCoord4i, vFuiiii) GO(glMultiTexCoord4iv, vFup) -GO(glMultiTexCoord4s, vFuiiii) +GO(glMultiTexCoord4s, vFuwwww) GO(glMultiTexCoord4sv, vFup) -GO(glSampleCoverage, vFfi) +GO(glSampleCoverage, vFfC) //VERSION_1_4 GO(glBlendFuncSeparate, vFuuuu) GO(glFogCoordPointer, vFuip) @@ -438,7 +439,7 @@ GO(glPointParameterf, vFuf) GO(glPointParameterfv, vFup) GO(glPointParameteri, vFui) GO(glPointParameteriv, vFup) -GO(glSecondaryColor3b, vFiii) +GO(glSecondaryColor3b, vFccc) GO(glSecondaryColor3bv, vFp) GO(glSecondaryColor3d, vFddd) GO(glSecondaryColor3dv, vFp) @@ -446,13 +447,13 @@ GO(glSecondaryColor3f, vFfff) GO(glSecondaryColor3fv, vFp) GO(glSecondaryColor3i, vFiii) GO(glSecondaryColor3iv, vFp) -GO(glSecondaryColor3s, vFiii) +GO(glSecondaryColor3s, vFwww) GO(glSecondaryColor3sv, vFp) -GO(glSecondaryColor3ub, vFuuu) +GO(glSecondaryColor3ub, vFCCC) GO(glSecondaryColor3ubv, vFp) GO(glSecondaryColor3ui, vFuuu) GO(glSecondaryColor3uiv, vFp) -GO(glSecondaryColor3us, vFuuu) +GO(glSecondaryColor3us, vFWWW) GO(glSecondaryColor3usv, vFp) GO(glSecondaryColorPointer, vFiuip) GO(glWindowPos2d, vFdd) @@ -461,7 +462,7 @@ GO(glWindowPos2f, vFff) GO(glWindowPos2fv, vFp) GO(glWindowPos2i, vFii) GO(glWindowPos2iv, vFp) -GO(glWindowPos2s, vFii) +GO(glWindowPos2s, vFww) GO(glWindowPos2sv, vFp) GO(glWindowPos3d, vFddd) GO(glWindowPos3dv, vFp) @@ -469,7 +470,7 @@ GO(glWindowPos3f, vFfff) GO(glWindowPos3fv, vFp) GO(glWindowPos3i, vFiii) GO(glWindowPos3iv, vFp) -GO(glWindowPos3s, vFiii) +GO(glWindowPos3s, vFwww) GO(glWindowPos3sv, vFp) //VERSION_1_5 GO(glBeginQuery, vFuu) @@ -487,10 +488,10 @@ GO(glGetBufferSubData, vFullp) GO(glGetQueryObjectiv, vFuup) GO(glGetQueryObjectuiv, vFuup) GO(glGetQueryiv, vFuup) -GO(glIsBuffer, iFu) -GO(glIsQuery, iFu) +GO(glIsBuffer, CFu) +GO(glIsQuery, CFu) GO(glMapBuffer, pFuu) -GO(glUnmapBuffer, iFu) +GO(glUnmapBuffer, CFu) //VERSION_2_0 GO(glAttachShader, vFuu) GO(glBindAttribLocation, vFuup) @@ -520,8 +521,8 @@ GO(glGetVertexAttribPointerv, vFuup) GO(glGetVertexAttribdv, vFuup) GO(glGetVertexAttribfv, vFuup) GO(glGetVertexAttribiv, vFuup) -GO(glIsProgram, iFu) -GO(glIsShader, iFu) +GO(glIsProgram, CFu) +GO(glIsShader, CFu) GO(glLinkProgram, vFu) GO(glShaderSource, vFuipp) GO(glStencilFuncSeparate, vFuuiu) @@ -543,33 +544,33 @@ GO(glUniform4f, vFiffff) GO(glUniform4fv, vFiip) GO(glUniform4i, vFiiiii) GO(glUniform4iv, vFiip) -GO(glUniformMatrix2fv, vFiiip) -GO(glUniformMatrix3fv, vFiiip) -GO(glUniformMatrix4fv, vFiiip) +GO(glUniformMatrix2fv, vFiiCp) +GO(glUniformMatrix3fv, vFiiCp) +GO(glUniformMatrix4fv, vFiiCp) GO(glUseProgram, vFu) GO(glValidateProgram, vFu) GO(glVertexAttrib1d, vFud) GO(glVertexAttrib1dv, vFup) GO(glVertexAttrib1f, vFuf) GO(glVertexAttrib1fv, vFup) -GO(glVertexAttrib1s, vFui) +GO(glVertexAttrib1s, vFuw) GO(glVertexAttrib1sv, vFup) GO(glVertexAttrib2d, vFudd) GO(glVertexAttrib2dv, vFup) GO(glVertexAttrib2f, vFuff) GO(glVertexAttrib2fv, vFup) -GO(glVertexAttrib2s, vFuii) +GO(glVertexAttrib2s, vFuww) GO(glVertexAttrib2sv, vFup) GO(glVertexAttrib3d, vFuddd) GO(glVertexAttrib3dv, vFup) GO(glVertexAttrib3f, vFufff) GO(glVertexAttrib3fv, vFup) -GO(glVertexAttrib3s, vFuiii) +GO(glVertexAttrib3s, vFuwww) GO(glVertexAttrib3sv, vFup) GO(glVertexAttrib4Nbv, vFup) GO(glVertexAttrib4Niv, vFup) GO(glVertexAttrib4Nsv, vFup) -GO(glVertexAttrib4Nub, vFuuuuu) +GO(glVertexAttrib4Nub, vFuCCCC) GO(glVertexAttrib4Nubv, vFup) GO(glVertexAttrib4Nuiv, vFup) GO(glVertexAttrib4Nusv, vFup) @@ -579,31 +580,31 @@ GO(glVertexAttrib4dv, vFup) GO(glVertexAttrib4f, vFuffff) GO(glVertexAttrib4fv, vFup) GO(glVertexAttrib4iv, vFup) -GO(glVertexAttrib4s, vFuiiii) +GO(glVertexAttrib4s, vFuwwww) GO(glVertexAttrib4sv, vFup) GO(glVertexAttrib4ubv, vFup) GO(glVertexAttrib4uiv, vFup) GO(glVertexAttrib4usv, vFup) -GO(glVertexAttribPointer, vFuiuiip) +GO(glVertexAttribPointer, vFuiuCip) //VERSION_2_1 -GO(glUniformMatrix2x3fv, vFiiip) -GO(glUniformMatrix2x4fv, vFiiip) -GO(glUniformMatrix3x2fv, vFiiip) -GO(glUniformMatrix3x4fv, vFiiip) -GO(glUniformMatrix4x2fv, vFiiip) -GO(glUniformMatrix4x3fv, vFiiip) +GO(glUniformMatrix2x3fv, vFiiCp) +GO(glUniformMatrix2x4fv, vFiiCp) +GO(glUniformMatrix3x2fv, vFiiCp) +GO(glUniformMatrix3x4fv, vFiiCp) +GO(glUniformMatrix4x2fv, vFiiCp) +GO(glUniformMatrix4x3fv, vFiiCp) //VERSION_3_0 GO(glBeginConditionalRender, vFuu) GO(glBeginTransformFeedback, vFu) GO(glBindBufferBase, vFuuu) -GO(glBindBufferRange, vFuuuii) +GO(glBindBufferRange, vFuuull) GO(glBindFragDataLocation, vFuup) GO(glClampColor, vFuu) GO(glClearBufferfi, vFuifi) GO(glClearBufferfv, vFuip) GO(glClearBufferiv, vFuip) GO(glClearBufferuiv, vFuip) -GO(glColorMaski, vFuiiii) +GO(glColorMaski, vFuCCCC) GO(glDisablei, vFuu) GO(glEnablei, vFuu) GO(glEndConditionalRender, vFv) @@ -618,7 +619,7 @@ GO(glGetTransformFeedbackVarying, vFuuipppp) GO(glGetUniformuiv, vFuip) GO(glGetVertexAttribIiv, vFuup) GO(glGetVertexAttribIuiv, vFuup) -GO(glIsEnabledi, iFuu) +GO(glIsEnabledi, CFuu) GO(glTexParameterIiv, vFuup) GO(glTexParameterIuiv, vFuup) GO(glTransformFeedbackVaryings, vFuipu) @@ -669,68 +670,68 @@ GO(glBlendFuncSeparatei, vFuuuuu) GO(glBlendFunci, vFuuu) GO(glMinSampleShading, vFf) //VERSION_4_3 -GO(glInvalidateNamedFramebuffer, vFiup) +GO(glInvalidateNamedFramebuffer, vFiup) //VERSION_4_4 -GO(glBindBuffersBase, vFiuip) +GO(glBindBuffersBase, vFuuip) GO(glBindBuffersRange, vFuuippp) -GO(glBindImageTextures, vFuip) -GO(glBindSamplers, vFuip) -GO(glBindTextures, vFuip) -GO(glBindVertexBuffers, vFuippp) +GO(glBindImageTextures, vFuip) +GO(glBindSamplers, vFuip) +GO(glBindTextures, vFuip) +GO(glBindVertexBuffers, vFuippp) GO(glBufferStorage, vFulpu) GO(glClearTexImage, vFuiuup) -GO(glClearTexSubImage, vFuiiiiiiiiip) +GO(glClearTexSubImage, vFuiiiiiiiuup) //VERSION_4_5 -GO(glClipControl, vFii) -GO(glCreateTransformFeedbacks, vFlp) -GO(glTransformFeedbackBufferBase, vFuuu) +GO(glClipControl, vFuu) +GO(glCreateTransformFeedbacks, vFip) +GO(glTransformFeedbackBufferBase, vFuuu) GO(glTransformFeedbackBufferRange, vFuuull) -GO(glGetTransformFeedbackiv, vFuip) -GO(glGetTransformFeedbacki_v, vFuiup) +GO(glGetTransformFeedbackiv, vFuup) +GO(glGetTransformFeedbacki_v, vFuuup) GO(glGetTransformFeedbacki64_v, vFuuup) -GO(glCreateBuffers, vFlp) -GO(glNamedBufferStorage, vFulpu) +GO(glCreateBuffers, vFip) +GO(glNamedBufferStorage, vFulpu) GO(glNamedBufferStorageEXT, vFulpu) -GO(glNamedBufferData, vFulpi) -GO(glNamedBufferSubData, vFullp) -GO(glCopyNamedBufferSubData, vFuulll) -GO(glClearNamedBufferData, vFuiiip) +GO(glNamedBufferData, vFulpu) +GO(glNamedBufferSubData, vFullp) +GO(glCopyNamedBufferSubData, vFuulll) +GO(glClearNamedBufferData, vFuuuup) GO(glClearNamedBufferSubData, vFuulluup) -GO(glMapNamedBuffer, pFui) +GO(glMapNamedBuffer, pFuu) GO(glMapNamedBufferRange, pFullu) -GO(glUnmapNamedBuffer, iFu) +GO(glUnmapNamedBuffer, CFu) GO(glFlushMappedNamedBufferRange, vFull) -GO(glGetNamedBufferParameteriv, vFuip) -GO(glGetNamedBufferParameteri64v, vFuip) -GO(glGetNamedBufferPointerv, vFuip) +GO(glGetNamedBufferParameteriv, vFuup) +GO(glGetNamedBufferParameteri64v, vFuup) +GO(glGetNamedBufferPointerv, vFuup) GO(glGetNamedBufferSubData, vFullp) -GO(glCreateFramebuffers, vFlp) -GO(glNamedFramebufferRenderbuffer, vFuiiu) -GO(glNamedFramebufferParameteri, vFuii) -GO(glNamedFramebufferTexture, vFuiui) -GO(glNamedFramebufferTextureLayer, vFuiuii) -GO(glNamedFramebufferDrawBuffer, vFui) -GO(glNamedFramebufferDrawBuffers, vFulp) -GO(glNamedFramebufferReadBuffer, vFui) -GO(glInvalidateNamedFramebufferData, vFulp) +GO(glCreateFramebuffers, vFip) +GO(glNamedFramebufferRenderbuffer, vFuuuu) +GO(glNamedFramebufferParameteri, vFuui) +GO(glNamedFramebufferTexture, vFuuui) +GO(glNamedFramebufferTextureLayer, vFuuuii) +GO(glNamedFramebufferDrawBuffer, vFuu) +GO(glNamedFramebufferDrawBuffers, vFuip) +GO(glNamedFramebufferReadBuffer, vFuu) +GO(glInvalidateNamedFramebufferData, vFuip) GO(glInvalidateNamedFramebufferSubData, vFuipiiii) GO(glClearNamedFramebufferiv, vFuuip) GO(glClearNamedFramebufferuiv, vFuuip) GO(glClearNamedFramebufferfv, vFuuip) GO(glClearNamedFramebufferfi, vFuuifi) -GO(glBlitNamedFramebuffer, vFuuiiiiiiiiui) -GO(glCheckNamedFramebufferStatus, iFui) -GO(glGetNamedFramebufferParameteriv, vFuip) -GO(glGetNamedFramebufferAttachmentParameteriv, vFuiip) -GO(glCreateRenderbuffers, vFlp) -GO(glNamedRenderbufferStorage, vFuill) -GO(glNamedRenderbufferStorageMultisample, vFulill) -GO(glGetNamedRenderbufferParameteriv, vFuip) -GO(glCreateTextures, vFilp) -GO(glTextureBuffer, vFuiu) +GO(glBlitNamedFramebuffer, vFuuiiiiiiiiuu) +GO(glCheckNamedFramebufferStatus, uFuu) +GO(glGetNamedFramebufferParameteriv, vFuup) +GO(glGetNamedFramebufferAttachmentParameteriv, vFuuup) +GO(glCreateRenderbuffers, vFip) +GO(glNamedRenderbufferStorage, vFuuii) +GO(glNamedRenderbufferStorageMultisample, vFuiuii) +GO(glGetNamedRenderbufferParameteriv, vFuup) +GO(glCreateTextures, vFuip) +GO(glTextureBuffer, vFuuu) GO(glTextureBufferRange, vFuuull) GO(glTextureStorage1D, vFuiui) -GO(glTextureStorage2D, vFulill) +GO(glTextureStorage2D, vFuiuii) GO(glTextureStorage3D, vFuiuiii) GO(glTextureStorage2DMultisample, vFuiuiiC) GO(glTextureStorage3DMultisample, vFuiuiiiC) @@ -743,56 +744,56 @@ GO(glCompressedTextureSubImage3D, vFuiiiiiiiuip) GO(glCopyTextureSubImage1D, vFuiiiii) GO(glCopyTextureSubImage2D, vFuiiiiiii) GO(glCopyTextureSubImage3D, vFuiiiiiiii) -GO(glTextureParameterf, vFuif) -GO(glTextureParameterfv, vFuip) -GO(glTextureParameteri, vFuii) -GO(glTextureParameterIiv, vFuip) +GO(glTextureParameterf, vFuuf) +GO(glTextureParameterfv, vFuup) +GO(glTextureParameteri, vFuui) +GO(glTextureParameterIiv, vFuup) GO(glTextureParameterIuiv, vFuup) -GO(glTextureParameteriv, vFuip) +GO(glTextureParameteriv, vFuup) GO(glGenerateTextureMipmap, vFu) GO(glBindTextureUnit, vFuu) GO(glGetTextureImage, vFuiuuip) GO(glGetCompressedTextureImage, vFuiip) GO(glGetTextureLevelParameterfv, vFuiup) GO(glGetTextureLevelParameteriv, vFuiup) -GO(glGetTextureParameterfv, vFuip) -GO(glGetTextureParameterIiv, vFuip) -GO(glGetTextureParameterIuiv, vFuip) -GO(glGetTextureParameteriv, vFuip) -GO(glCreateVertexArrays, vFlp) +GO(glGetTextureParameterfv, vFuup) +GO(glGetTextureParameterIiv, vFuup) +GO(glGetTextureParameterIuiv, vFuup) +GO(glGetTextureParameteriv, vFuup) +GO(glCreateVertexArrays, vFip) GO(glDisableVertexArrayAttrib, vFuu) GO(glEnableVertexArrayAttrib, vFuu) GO(glVertexArrayElementBuffer, vFuu) -GO(glVertexArrayVertexBuffer, vFuuull) +GO(glVertexArrayVertexBuffer, vFuuuli) GO(glVertexArrayVertexBuffers, vFuuippp) GO(glVertexArrayAttribBinding, vFuuu) -GO(glVertexArrayAttribFormat, vFuuiiiu) -GO(glVertexArrayAttribIFormat, vFuuiiu) -GO(glVertexArrayAttribLFormat, vFuuiiu) +GO(glVertexArrayAttribFormat, vFuuiuCu) +GO(glVertexArrayAttribIFormat, vFuuiuu) +GO(glVertexArrayAttribLFormat, vFuuiuu) GO(glVertexArrayBindingDivisor, vFuuu) -GO(glGetVertexArrayiv, vFuip) -GO(glGetVertexArrayIndexediv, vFuuip) -GO(glGetVertexArrayIndexed64iv, vFuuip) -GO(glCreateSamplers, vFlp) +GO(glGetVertexArrayiv, vFuup) +GO(glGetVertexArrayIndexediv, vFuuup) +GO(glGetVertexArrayIndexed64iv, vFuuup) +GO(glCreateSamplers, vFip) GO(glCreateProgramPipelines, vFip) GO(glTextureBarrier, vFv) GO(glTextureParameteriiv, vFuip) GO(glTextureParameteriuiv, vFuip) -GO(glCreateQueries, vFilp) -GO(glGetQueryBufferObjecti64v, vFuuil) -GO(glGetQueryBufferObjectiv, vFuuil) -GO(glGetQueryBufferObjectui64v, vFuuil) +GO(glCreateQueries, vFuip) +GO(glGetQueryBufferObjecti64v, vFuuul) +GO(glGetQueryBufferObjectiv, vFuuul) +GO(glGetQueryBufferObjectui64v, vFuuul) GO(glGetQueryBufferObjectuiv, vFuuul) GO(glMemoryBarrierByRegion, vFu) GO(glGetTextureSubImage, vFuiiiiiiiuuip) GO(glGetCompressedTextureSubImage, vFuiiiiiiiip) -GO(glGetGraphicsResetStatus, iFv) -GO(glGetnUniformfv, vFuilp) -GO(glGetnUniformiv, vFuilp) -GO(glGetnUniformuiv, vFuilp) -GO(glReadnPixels, vFiilluulp) +GO(glGetGraphicsResetStatus, uFv) +GO(glGetnUniformfv, vFuiip) +GO(glGetnUniformiv, vFuiip) +GO(glGetnUniformuiv, vFuiip) +GO(glReadnPixels, vFiiiiuuip) //VERSION_4_6 -GO(glSpecializeShader, vFippp) +GO(glSpecializeShader, vFupupp) GO(glTexturePageCommitmentEXT, vFuiiiiiiiC) GO(glVertexArrayVertexAttribDivisorEXT, vFuuu) @@ -816,7 +817,7 @@ GO(glMultiDrawElementsIndirectAMD, vFuupii) //AMD_name_gen_delete GO(glDeleteNamesAMD, vFuup) GO(glGenNamesAMD, vFuup) -GO(glIsNameAMD, iFuu) +GO(glIsNameAMD, CFuu) //AMD_performance_monitor GO(glBeginPerfMonitorAMD, vFu) GO(glDeletePerfMonitorsAMD, vFip) @@ -850,10 +851,10 @@ GO(glDeleteFencesAPPLE, vFip) GO(glFinishFenceAPPLE, vFu) GO(glFinishObjectAPPLE, vFui) GO(glGenFencesAPPLE, vFip) -GO(glIsFenceAPPLE, iFu) +GO(glIsFenceAPPLE, CFu) GO(glSetFenceAPPLE, vFu) -GO(glTestFenceAPPLE, iFu) -GO(glTestObjectAPPLE, iFuu) +GO(glTestFenceAPPLE, CFu) +GO(glTestObjectAPPLE, CFuu) //APPLE_flush_buffer_range GO(glBufferParameteriAPPLE, vFuui) GO(glFlushMappedBufferRangeAPPLE, vFull) @@ -868,7 +869,7 @@ GO(glTextureRangeAPPLE, vFuip) GO(glBindVertexArrayAPPLE, vFu) GO(glDeleteVertexArraysAPPLE, vFip) GO(glGenVertexArraysAPPLE, vFip) -GO(glIsVertexArrayAPPLE, iFu) +GO(glIsVertexArrayAPPLE, CFu) //APPLE_vertex_array_range GO(glFlushVertexArrayRangeAPPLE, vFip) GO(glVertexArrayParameteriAPPLE, vFui) @@ -876,7 +877,7 @@ GO(glVertexArrayRangeAPPLE, vFip) //APPLE_vertex_program_evaluators GO(glDisableVertexAttribAPPLE, vFuu) GO(glEnableVertexAttribAPPLE, vFuu) -GO(glIsVertexAttribEnabledAPPLE, iFuu) +GO(glIsVertexAttribEnabledAPPLE, CFuu) GO(glMapVertexAttrib1dAPPLE, vFuuddiip) GO(glMapVertexAttrib1fAPPLE, vFuuffiip) GO(glMapVertexAttrib2dAPPLE, vFuuddiiddiip) @@ -905,7 +906,7 @@ GO(glClearNamedBufferSubDataEXT, vFuulluup) GO(glClampColorARB, vFuu) //ARB_compute_shader GO(glDispatchCompute, vFuuu) -GO(glDispatchComputeIndirect, vFi) +GO(glDispatchComputeIndirect, vFl) //ARB_copy_buffer GO(glCopyBufferSubData, vFuulll) //ARB_copy_image @@ -941,7 +942,7 @@ GO(glNamedFramebufferParameteriEXT, vFuui) //ARB_framebuffer_object GO(glBindFramebuffer, vFuu) GO(glBindRenderbuffer, vFuu) -GO(glBlitFramebuffer, vFiiiiiiiiiu) +GO(glBlitFramebuffer, vFiiiiiiiiuu) GO(glCheckFramebufferStatus, uFu) GO(glDeleteFramebuffers, vFip) GO(glDeleteRenderbuffers, vFip) @@ -955,8 +956,8 @@ GO(glGenRenderbuffers, vFip) GO(glGenerateMipmap, vFu) GO(glGetFramebufferAttachmentParameteriv, vFuuup) GO(glGetRenderbufferParameteriv, vFuup) -GO(glIsFramebuffer, iFu) -GO(glIsRenderbuffer, iFu) +GO(glIsFramebuffer, CFu) +GO(glIsRenderbuffer, CFu) GO(glRenderbufferStorage, vFuuii) GO(glRenderbufferStorageMultisample, vFuiuii) //ARB_geometry_shader4 @@ -978,14 +979,14 @@ GO(glUniform3d, vFiddd) GO(glUniform3dv, vFiip) GO(glUniform4d, vFidddd) GO(glUniform4dv, vFiip) -GO(glUniformMatrix2dv, vFiiip) -GO(glUniformMatrix2x3dv, vFiiip) -GO(glUniformMatrix2x4dv, vFiiip) -GO(glUniformMatrix3dv, vFiiip) -GO(glUniformMatrix3x2dv, vFiiip) -GO(glUniformMatrix3x4dv, vFiiip) -GO(glUniformMatrix4dv, vFiiip) -GO(glUniformMatrix4x2dv, vFiiip) +GO(glUniformMatrix2dv, vFiiCp) +GO(glUniformMatrix2x3dv, vFiiCp) +GO(glUniformMatrix2x4dv, vFiiCp) +GO(glUniformMatrix3dv, vFiiCp) +GO(glUniformMatrix3x2dv, vFiiCp) +GO(glUniformMatrix3x4dv, vFiiCp) +GO(glUniformMatrix4dv, vFiiCp) +GO(glUniformMatrix4x2dv, vFiiCp) GO(glUniformMatrix4x3dv, vFiiCp) //ARB_instanced_arrays GO(glVertexAttribDivisorARB, vFuu) @@ -995,7 +996,7 @@ GO(glGetInternalformativ, vFuuuip) GO(glGetInternalformati64v, vFuuuip) //ARB_invalidate_subdata GO(glInvalidateBufferData, vFu) -GO(glInvalidateBufferSubData, vFuii) +GO(glInvalidateBufferSubData, vFull) GO(glInvalidateFramebuffer, vFuip) GO(glInvalidateSubFramebuffer, vFuipiiii) GO(glInvalidateTexImage, vFui) @@ -1023,7 +1024,7 @@ GO(glMultiTexCoord1fARB, vFuf) GO(glMultiTexCoord1fvARB, vFup) GO(glMultiTexCoord1iARB, vFui) GO(glMultiTexCoord1ivARB, vFup) -GO(glMultiTexCoord1sARB, vFui) +GO(glMultiTexCoord1sARB, vFuw) GO(glMultiTexCoord1svARB, vFup) GO(glMultiTexCoord2dARB, vFudd) GO(glMultiTexCoord2dvARB, vFup) @@ -1031,7 +1032,7 @@ GO(glMultiTexCoord2fARB, vFuff) GO(glMultiTexCoord2fvARB, vFup) GO(glMultiTexCoord2iARB, vFuii) GO(glMultiTexCoord2ivARB, vFup) -GO(glMultiTexCoord2sARB, vFuii) +GO(glMultiTexCoord2sARB, vFuww) GO(glMultiTexCoord2svARB, vFup) GO(glMultiTexCoord3dARB, vFuddd) GO(glMultiTexCoord3dvARB, vFup) @@ -1039,7 +1040,7 @@ GO(glMultiTexCoord3fARB, vFufff) GO(glMultiTexCoord3fvARB, vFup) GO(glMultiTexCoord3iARB, vFuiii) GO(glMultiTexCoord3ivARB, vFup) -GO(glMultiTexCoord3sARB, vFuiii) +GO(glMultiTexCoord3sARB, vFuwww) GO(glMultiTexCoord3svARB, vFup) GO(glMultiTexCoord4dARB, vFudddd) GO(glMultiTexCoord4dvARB, vFup) @@ -1047,7 +1048,7 @@ GO(glMultiTexCoord4fARB, vFuffff) GO(glMultiTexCoord4fvARB, vFup) GO(glMultiTexCoord4iARB, vFuiiii) GO(glMultiTexCoord4ivARB, vFup) -GO(glMultiTexCoord4sARB, vFuiiii) +GO(glMultiTexCoord4sARB, vFuwwww) GO(glMultiTexCoord4svARB, vFup) //ARB_occlusion_query GO(glBeginQueryARB, vFuu) @@ -1057,7 +1058,7 @@ GO(glGenQueriesARB, vFip) GO(glGetQueryObjectivARB, vFuup) GO(glGetQueryObjectuivARB, vFuup) GO(glGetQueryivARB, vFuup) -GO(glIsQueryARB, iFu) +GO(glIsQueryARB, CFu) //ARB_point_parameters GO(glPointParameterfARB, vFuf) GO(glPointParameterfvARB, vFup) @@ -1075,7 +1076,7 @@ GO(glGetGraphicsResetStatusARB, uFv) GO(glGetnColorTableARB, vFuuuip) GO(glGetnCompressedTexImageARB, vFuiip) GO(glGetnConvolutionFilterARB, vFuuuip) -GO(glGetnHistogramARB, vFuiuuip) +GO(glGetnHistogramARB, vFuCuuip) GO(glGetnMapdvARB, vFuuip) GO(glGetnMapfvARB, vFuuip) GO(glGetnMapivARB, vFuuip) @@ -1101,7 +1102,7 @@ GO(glGetSamplerParameterIiv, vFuup) GO(glGetSamplerParameterIuiv, vFuup) GO(glGetSamplerParameterfv, vFuup) GO(glGetSamplerParameteriv, vFuup) -GO(glIsSampler, iFu) +GO(glIsSampler, CFu) GO(glSamplerParameterIiv, vFuup) GO(glSamplerParameterIuiv, vFuup) GO(glSamplerParameterf, vFuuf) @@ -1116,7 +1117,7 @@ GO(glDeleteProgramPipelines, vFip) GO(glGenProgramPipelines, vFip) GO(glGetProgramPipelineInfoLog, vFuipp) GO(glGetProgramPipelineiv, vFuup) -GO(glIsProgramPipeline, iFu) +GO(glIsProgramPipeline, CFu) GO(glProgramUniform1d, vFuid) GO(glProgramUniform1dv, vFuiip) GO(glProgramUniform1f, vFuif) @@ -1149,31 +1150,31 @@ GO(glProgramUniform4i, vFuiiiii) GO(glProgramUniform4iv, vFuiip) GO(glProgramUniform4ui, vFuiuuuu) GO(glProgramUniform4uiv, vFuiip) -GO(glProgramUniformMatrix2dv, vFuiiip) -GO(glProgramUniformMatrix2fv, vFuiiip) -GO(glProgramUniformMatrix2x3dv, vFuiiip) -GO(glProgramUniformMatrix2x3fv, vFuiiip) -GO(glProgramUniformMatrix2x4dv, vFuiiip) -GO(glProgramUniformMatrix2x4fv, vFuiiip) -GO(glProgramUniformMatrix3dv, vFuiiip) -GO(glProgramUniformMatrix3fv, vFuiiip) -GO(glProgramUniformMatrix3x2dv, vFuiiip) -GO(glProgramUniformMatrix3x2fv, vFuiiip) -GO(glProgramUniformMatrix3x4dv, vFuiiip) -GO(glProgramUniformMatrix3x4fv, vFuiiip) -GO(glProgramUniformMatrix4dv, vFuiiip) -GO(glProgramUniformMatrix4fv, vFuiiip) -GO(glProgramUniformMatrix4x2dv, vFuiiip) -GO(glProgramUniformMatrix4x2fv, vFuiiip) -GO(glProgramUniformMatrix4x3dv, vFuiiip) -GO(glProgramUniformMatrix4x3fv, vFuiiip) +GO(glProgramUniformMatrix2dv, vFuiiCp) +GO(glProgramUniformMatrix2fv, vFuiiCp) +GO(glProgramUniformMatrix2x3dv, vFuiiCp) +GO(glProgramUniformMatrix2x3fv, vFuiiCp) +GO(glProgramUniformMatrix2x4dv, vFuiiCp) +GO(glProgramUniformMatrix2x4fv, vFuiiCp) +GO(glProgramUniformMatrix3dv, vFuiiCp) +GO(glProgramUniformMatrix3fv, vFuiiCp) +GO(glProgramUniformMatrix3x2dv, vFuiiCp) +GO(glProgramUniformMatrix3x2fv, vFuiiCp) +GO(glProgramUniformMatrix3x4dv, vFuiiCp) +GO(glProgramUniformMatrix3x4fv, vFuiiCp) +GO(glProgramUniformMatrix4dv, vFuiiCp) +GO(glProgramUniformMatrix4fv, vFuiiCp) +GO(glProgramUniformMatrix4x2dv, vFuiiCp) +GO(glProgramUniformMatrix4x2fv, vFuiiCp) +GO(glProgramUniformMatrix4x3dv, vFuiiCp) +GO(glProgramUniformMatrix4x3fv, vFuiiCp) GO(glUseProgramStages, vFuuu) GO(glValidateProgramPipeline, vFu) //ARB_shader_atomic_counters GO(glGetActiveAtomicCounterBufferiv, vFuuup) //ARB_shader_image_load_store GO(glBindImageTexture, vFuuiCiuu) -GO(glMemoryBarrier, vFi) +GO(glMemoryBarrier, vFu) //ARB_shader_objects GO(glAttachObjectARB, vFuu) GO(glCompileShaderARB, vFu) @@ -1209,8 +1210,8 @@ GO(glUniform4fARB, vFiffff) GO(glUniform4fvARB, vFiip) GO(glUniform4iARB, vFiiiii) GO(glUniform4ivARB, vFiip) -GO(glUniformMatrix2fvARB, vFiiip) -GO(glUniformMatrix3fvARB, vFiiip) +GO(glUniformMatrix2fvARB, vFiiCp) +GO(glUniformMatrix3fvARB, vFiiCp) GO(glUniformMatrix4fvARB, vFiiCp) GO(glUseProgramObjectARB, vFu) GO(glValidateProgramARB, vFu) @@ -1233,13 +1234,13 @@ GO(glGetNamedStringivARB, vFipup) GO(glIsNamedStringARB, CFip) GO(glNamedStringARB, vFuipip) //ARB_sync -GO(glClientWaitSync, uFpuL) +GO(glClientWaitSync, uFpuU) GO(glDeleteSync, vFp) GO(glFenceSync, pFuu) GO(glGetInteger64v, vFup) GO(glGetSynciv, vFpuipp) GO(glIsSync, CFp) -GO(glWaitSync, vFpuL) +GO(glWaitSync, vFpuU) //ARB_tessellation_shader GO(glPatchParameterfv, vFup) GO(glPatchParameteri, vFui) @@ -1258,9 +1259,9 @@ GO(glCompressedTexSubImage3DARB, vFuiiiiiiiuip) GO(glGetCompressedTexImageARB, vFuip) //ARB_texture_multisample GO(glGetMultisamplefv, vFuup) -GO(glSampleMaski, vFui) -GO(glTexImage2DMultisample, vFuiiiii) -GO(glTexImage3DMultisample, vFuiiiiii) +GO(glSampleMaski, vFuu) +GO(glTexImage2DMultisample, vFuiuiiC) +GO(glTexImage3DMultisample, vFuiuiiiC) //ARB_texture_storage GO(glTexStorage1D, vFuiui) GO(glTexStorage2D, vFuiuii) @@ -1284,7 +1285,7 @@ GO(glBindTransformFeedback, vFuu) GO(glDeleteTransformFeedbacks, vFip) GO(glDrawTransformFeedback, vFuu) GO(glGenTransformFeedbacks, vFip) -GO(glIsTransformFeedback, iFu) +GO(glIsTransformFeedback, CFu) GO(glPauseTransformFeedback, vFv) GO(glResumeTransformFeedback, vFv) //ARB_transform_feedback3 @@ -1312,7 +1313,7 @@ GO(glUniformBlockBinding, vFuuu) GO(glBindVertexArray, vFu) GO(glDeleteVertexArrays, vFip) GO(glGenVertexArrays, vFip) -GO(glIsVertexArray, iFu) +GO(glIsVertexArray, CFu) //ARB_vertex_attrib_64bit GO(glGetVertexAttribLdv, vFuup) GO(glVertexAttribL1d, vFud) @@ -1357,9 +1358,9 @@ GO(glGenBuffersARB, vFip) GO(glGetBufferParameterivARB, vFuup) GO(glGetBufferPointervARB, vFuup) GO(glGetBufferSubDataARB, vFullp) -GO(glIsBufferARB, iFu) +GO(glIsBufferARB, CFu) GO(glMapBufferARB, pFuu) -GO(glUnmapBufferARB, iFu) +GO(glUnmapBufferARB, CFu) //ARB_vertex_program GO(glBindProgramARB, vFuu) GO(glDeleteProgramsARB, vFip) @@ -1376,7 +1377,7 @@ GO(glGetVertexAttribPointervARB, vFuup) GO(glGetVertexAttribdvARB, vFuup) GO(glGetVertexAttribfvARB, vFuup) GO(glGetVertexAttribivARB, vFuup) -GO(glIsProgramARB, iFu) +GO(glIsProgramARB, CFu) GO(glProgramEnvParameter4dARB, vFuudddd) GO(glProgramEnvParameter4dvARB, vFuup) GO(glProgramEnvParameter4fARB, vFuuffff) @@ -1390,24 +1391,24 @@ GO(glVertexAttrib1dARB, vFud) GO(glVertexAttrib1dvARB, vFup) GO(glVertexAttrib1fARB, vFuf) GO(glVertexAttrib1fvARB, vFup) -GO(glVertexAttrib1sARB, vFui) +GO(glVertexAttrib1sARB, vFuw) GO(glVertexAttrib1svARB, vFup) GO(glVertexAttrib2dARB, vFudd) GO(glVertexAttrib2dvARB, vFup) GO(glVertexAttrib2fARB, vFuff) GO(glVertexAttrib2fvARB, vFup) -GO(glVertexAttrib2sARB, vFuii) +GO(glVertexAttrib2sARB, vFuww) GO(glVertexAttrib2svARB, vFup) GO(glVertexAttrib3dARB, vFuddd) GO(glVertexAttrib3dvARB, vFup) GO(glVertexAttrib3fARB, vFufff) GO(glVertexAttrib3fvARB, vFup) -GO(glVertexAttrib3sARB, vFuiii) +GO(glVertexAttrib3sARB, vFuwww) GO(glVertexAttrib3svARB, vFup) GO(glVertexAttrib4NbvARB, vFup) GO(glVertexAttrib4NivARB, vFup) GO(glVertexAttrib4NsvARB, vFup) -GO(glVertexAttrib4NubARB, vFuuuuu) +GO(glVertexAttrib4NubARB, vFuCCCC) GO(glVertexAttrib4NubvARB, vFup) GO(glVertexAttrib4NuivARB, vFup) GO(glVertexAttrib4NusvARB, vFup) @@ -1417,7 +1418,7 @@ GO(glVertexAttrib4dvARB, vFup) GO(glVertexAttrib4fARB, vFuffff) GO(glVertexAttrib4fvARB, vFup) GO(glVertexAttrib4ivARB, vFup) -GO(glVertexAttrib4sARB, vFuiiii) +GO(glVertexAttrib4sARB, vFuwwww) GO(glVertexAttrib4svARB, vFup) GO(glVertexAttrib4ubvARB, vFup) GO(glVertexAttrib4uivARB, vFup) @@ -1452,12 +1453,12 @@ GO(glTexCoordP3ui, vFuu) GO(glTexCoordP3uiv, vFup) GO(glTexCoordP4ui, vFuu) GO(glTexCoordP4uiv, vFup) -GO(glVertexAttribP1ui, vFuuiu) -GO(glVertexAttribP1uiv, vFuuip) -GO(glVertexAttribP2ui, vFuuiu) -GO(glVertexAttribP2uiv, vFuuip) -GO(glVertexAttribP3ui, vFuuiu) -GO(glVertexAttribP3uiv, vFuuip) +GO(glVertexAttribP1ui, vFuuCu) +GO(glVertexAttribP1uiv, vFuuCp) +GO(glVertexAttribP2ui, vFuuCu) +GO(glVertexAttribP2uiv, vFuuCp) +GO(glVertexAttribP3ui, vFuuCu) +GO(glVertexAttribP3uiv, vFuuCp) GO(glVertexAttribP4ui, vFuuCu) GO(glVertexAttribP4uiv, vFuuCp) GO(glVertexP2ui, vFuu) @@ -1484,7 +1485,7 @@ GO(glWindowPos2fARB, vFff) GO(glWindowPos2fvARB, vFp) GO(glWindowPos2iARB, vFii) GO(glWindowPos2ivARB, vFp) -GO(glWindowPos2sARB, vFii) +GO(glWindowPos2sARB, vFww) GO(glWindowPos2svARB, vFp) GO(glWindowPos3dARB, vFddd) GO(glWindowPos3dvARB, vFp) @@ -1492,7 +1493,7 @@ GO(glWindowPos3fARB, vFfff) GO(glWindowPos3fvARB, vFp) GO(glWindowPos3iARB, vFiii) GO(glWindowPos3ivARB, vFp) -GO(glWindowPos3sARB, vFiii) +GO(glWindowPos3sARB, vFwww) GO(glWindowPos3svARB, vFp) //ATI_draw_buffers GO(glDrawBuffersATI, vFip) @@ -1538,7 +1539,7 @@ GO(glGetObjectBufferfvATI, vFuup) GO(glGetObjectBufferivATI, vFuup) GO(glGetVariantArrayObjectfvATI, vFuup) GO(glGetVariantArrayObjectivATI, vFuup) -GO(glIsObjectBufferATI, iFu) +GO(glIsObjectBufferATI, CFu) GO(glNewObjectBufferATI, uFipu) GO(glUpdateObjectBufferATI, vFuuipu) GO(glVariantArrayObjectATI, vFuuiuu) @@ -1582,7 +1583,7 @@ GO(glVertexStream3fATI, vFufff) GO(glVertexStream3fvATI, vFup) GO(glVertexStream3iATI, vFuiii) GO(glVertexStream3ivATI, vFup) -GO(glVertexStream3sATI, vFuiii) +GO(glVertexStream3sATI, vFuwww) GO(glVertexStream3svATI, vFup) GO(glVertexStream4dATI, vFudddd) GO(glVertexStream4dvATI, vFup) @@ -1625,7 +1626,7 @@ GO(glGetConvolutionParameterivEXT, vFuup) GO(glGetSeparableFilterEXT, vFuuuppp) GO(glSeparableFilter2DEXT, vFuuiiuupp) //EXT_coordinate_frame -GO(glBinormal3bEXT, vFiii) +GO(glBinormal3bEXT, vFccc) GO(glBinormal3bvEXT, vFp) GO(glBinormal3dEXT, vFddd) GO(glBinormal3dvEXT, vFp) @@ -1633,10 +1634,10 @@ GO(glBinormal3fEXT, vFfff) GO(glBinormal3fvEXT, vFp) GO(glBinormal3iEXT, vFiii) GO(glBinormal3ivEXT, vFp) -GO(glBinormal3sEXT, vFiii) +GO(glBinormal3sEXT, vFwww) GO(glBinormal3svEXT, vFp) GO(glBinormalPointerEXT, vFuip) -GO(glTangent3bEXT, vFiii) +GO(glTangent3bEXT, vFccc) GO(glTangent3bvEXT, vFp) GO(glTangent3dEXT, vFddd) GO(glTangent3dvEXT, vFp) @@ -1644,7 +1645,7 @@ GO(glTangent3fEXT, vFfff) GO(glTangent3fvEXT, vFp) GO(glTangent3iEXT, vFiii) GO(glTangent3ivEXT, vFp) -GO(glTangent3sEXT, vFiii) +GO(glTangent3sEXT, vFwww) GO(glTangent3svEXT, vFp) GO(glTangentPointerEXT, vFuip) //EXT_copy_texture @@ -1661,7 +1662,7 @@ GO(glDepthBoundsEXT, vFdd) //EXT_direct_state_access GO(glBindMultiTextureEXT, vFuuu) GO(glCheckNamedFramebufferStatusEXT, uFuu) -GO(glClientAttribDefaultEXT, vFi) +GO(glClientAttribDefaultEXT, vFu) GO(glCompressedMultiTexImage1DEXT, vFuuiuiiip) GO(glCompressedMultiTexImage2DEXT, vFuuiuiiiip) GO(glCompressedMultiTexImage3DEXT, vFuuiuiiiiip) @@ -1844,25 +1845,25 @@ GO(glProgramUniform4iEXT, vFuiiiii) GO(glProgramUniform4ivEXT, vFuiip) GO(glProgramUniform4uiEXT, vFuiuuuu) GO(glProgramUniform4uivEXT, vFuiip) -GO(glProgramUniformMatrix2dvEXT, vFuiiip) -GO(glProgramUniformMatrix2fvEXT, vFuiiip) -GO(glProgramUniformMatrix2x3dvEXT, vFuiiip) -GO(glProgramUniformMatrix2x3fvEXT, vFuiiip) -GO(glProgramUniformMatrix2x4dvEXT, vFuiiip) -GO(glProgramUniformMatrix2x4fvEXT, vFuiiip) -GO(glProgramUniformMatrix3dvEXT, vFuiiip) -GO(glProgramUniformMatrix3fvEXT, vFuiiip) -GO(glProgramUniformMatrix3x2dvEXT, vFuiiip) -GO(glProgramUniformMatrix3x2fvEXT, vFuiiip) -GO(glProgramUniformMatrix3x4dvEXT, vFuiiip) -GO(glProgramUniformMatrix3x4fvEXT, vFuiiip) -GO(glProgramUniformMatrix4dvEXT, vFuiiip) -GO(glProgramUniformMatrix4fvEXT, vFuiiip) -GO(glProgramUniformMatrix4x2dvEXT, vFuiiip) -GO(glProgramUniformMatrix4x2fvEXT, vFuiiip) +GO(glProgramUniformMatrix2dvEXT, vFuiiCp) +GO(glProgramUniformMatrix2fvEXT, vFuiiCp) +GO(glProgramUniformMatrix2x3dvEXT, vFuiiCp) +GO(glProgramUniformMatrix2x3fvEXT, vFuiiCp) +GO(glProgramUniformMatrix2x4dvEXT, vFuiiCp) +GO(glProgramUniformMatrix2x4fvEXT, vFuiiCp) +GO(glProgramUniformMatrix3dvEXT, vFuiiCp) +GO(glProgramUniformMatrix3fvEXT, vFuiiCp) +GO(glProgramUniformMatrix3x2dvEXT, vFuiiCp) +GO(glProgramUniformMatrix3x2fvEXT, vFuiiCp) +GO(glProgramUniformMatrix3x4dvEXT, vFuiiCp) +GO(glProgramUniformMatrix3x4fvEXT, vFuiiCp) +GO(glProgramUniformMatrix4dvEXT, vFuiiCp) +GO(glProgramUniformMatrix4fvEXT, vFuiiCp) +GO(glProgramUniformMatrix4x2dvEXT, vFuiiCp) +GO(glProgramUniformMatrix4x2fvEXT, vFuiiCp) GO(glProgramUniformMatrix4x3dvEXT, vFuiiCp) GO(glProgramUniformMatrix4x3fvEXT, vFuiiCp) -GO(glPushClientAttribDefaultEXT, vFi) +GO(glPushClientAttribDefaultEXT, vFu) GO(glTextureBufferEXT, vFuuuu) GO(glTextureImage1DEXT, vFuuiiiiuup) GO(glTextureImage2DEXT, vFuuiiiiiuup) @@ -1877,18 +1878,18 @@ GO(glTextureRenderbufferEXT, vFuuu) GO(glTextureSubImage1DEXT, vFuuiiiuup) GO(glTextureSubImage2DEXT, vFuuiiiiiuup) GO(glTextureSubImage3DEXT, vFuuiiiiiiiuup) -GO(glUnmapNamedBufferEXT, iFu) -GO(glVertexArrayColorOffsetEXT, vFuuiuii) +GO(glUnmapNamedBufferEXT, CFu) +GO(glVertexArrayColorOffsetEXT, vFuuiuil) GO(glVertexArrayEdgeFlagOffsetEXT, vFuuil) GO(glVertexArrayFogCoordOffsetEXT, vFuuuil) -GO(glVertexArrayIndexOffsetEXT, vFuuuii) +GO(glVertexArrayIndexOffsetEXT, vFuuuil) GO(glVertexArrayMultiTexCoordOffsetEXT, vFuuuiuil) -GO(glVertexArrayNormalOffsetEXT, vFuuuii) +GO(glVertexArrayNormalOffsetEXT, vFuuuil) GO(glVertexArraySecondaryColorOffsetEXT, vFuuiuil) -GO(glVertexArrayTexCoordOffsetEXT, vFuuiuii) -GO(glVertexArrayVertexAttribIOffsetEXT, vFuuuiuii) +GO(glVertexArrayTexCoordOffsetEXT, vFuuiuil) +GO(glVertexArrayVertexAttribIOffsetEXT, vFuuuiuil) GO(glVertexArrayVertexAttribOffsetEXT, vFuuuiuCil) -GO(glVertexArrayVertexOffsetEXT, vFuuiuii) +GO(glVertexArrayVertexOffsetEXT, vFuuiuil) //EXT_draw_buffers2 GO(glColorMaskIndexedEXT, vFuCCCC) GO(glDisableIndexedEXT, vFuu) @@ -1924,8 +1925,8 @@ GO(glGenRenderbuffersEXT, vFip) GO(glGenerateMipmapEXT, vFu) GO(glGetFramebufferAttachmentParameterivEXT, vFuuup) GO(glGetRenderbufferParameterivEXT, vFuup) -GO(glIsFramebufferEXT, iFu) -GO(glIsRenderbufferEXT, iFu) +GO(glIsFramebufferEXT, CFu) +GO(glIsRenderbufferEXT, CFu) GO(glRenderbufferStorageEXT, vFuuii) //EXT_geometry_shader4 GO(glProgramParameteriEXT, vFuui) @@ -1945,7 +1946,7 @@ GO(glUniform3uivEXT, vFiip) GO(glUniform4uiEXT, vFiuuuu) GO(glUniform4uivEXT, vFiip) //EXT_histogram -GO(glGetHistogramEXT, vFuiuup) +GO(glGetHistogramEXT, vFuCuup) GO(glGetHistogramParameterfvEXT, vFuup) GO(glGetHistogramParameterivEXT, vFuup) GO(glGetMinmaxEXT, vFuCuup) @@ -1967,7 +1968,7 @@ GO(glTextureMaterialEXT, vFuu) GO(glMultiDrawArraysEXT, vFuppi) GO(glMultiDrawElementsEXT, vFupupi) //EXT_multisample -GO(glSampleMaskEXT, vFfi) +GO(glSampleMaskEXT, vFfC) GO(glSamplePatternEXT, vFu) //EXT_paletted_texture GO(glColorTableEXT, vFuuiuup) @@ -1997,7 +1998,7 @@ GO(glSecondaryColor3fEXT, vFfff) GO(glSecondaryColor3fvEXT, vFp) GO(glSecondaryColor3iEXT, vFiii) GO(glSecondaryColor3ivEXT, vFp) -GO(glSecondaryColor3sEXT, vFiii) +GO(glSecondaryColor3sEXT, vFwww) GO(glSecondaryColor3svEXT, vFp) GO(glSecondaryColor3ubEXT, vFCCC) GO(glSecondaryColor3ubvEXT, vFp) @@ -2012,7 +2013,7 @@ GO(glCreateShaderProgramEXT, uFup) GO(glUseShaderProgramEXT, vFuu) //EXT_shader_image_load_store GO(glBindImageTextureEXT, vFuuiCiui) -GO(glMemoryBarrierEXT, vFi) +GO(glMemoryBarrierEXT, vFu) //EXT_stencil_clear_tag GO(glStencilClearTagEXT, vFiu) //EXT_stencil_two_side @@ -2033,19 +2034,19 @@ GO(glGetTexParameterIuivEXT, vFuup) GO(glTexParameterIivEXT, vFuup) GO(glTexParameterIuivEXT, vFuup) //EXT_texture_object -GO(glAreTexturesResidentEXT, iFipp) +GO(glAreTexturesResidentEXT, CFipp) GO(glBindTextureEXT, vFuu) GO(glDeleteTexturesEXT, vFip) GO(glGenTexturesEXT, vFip) -GO(glIsTextureEXT, iFu) +GO(glIsTextureEXT, CFu) GO(glPrioritizeTexturesEXT, vFipp) //EXT_texture_perturb_normal GO(glTextureNormalEXT, vFu) //EXT_transform_feedback GO(glBeginTransformFeedbackEXT, vFu) GO(glBindBufferBaseEXT, vFuuu) -GO(glBindBufferOffsetEXT, vFuuui) -GO(glBindBufferRangeEXT, vFuuuii) +GO(glBindBufferOffsetEXT, vFuuul) +GO(glBindBufferRangeEXT, vFuuull) GO(glEndTransformFeedbackEXT, vFv) GO(glGetTransformFeedbackVaryingEXT, vFuuipppp) GO(glTransformFeedbackVaryingsEXT, vFuipu) @@ -2158,7 +2159,7 @@ GO(glTexCoordPointervINTEL, vFiup) GO(glVertexPointervINTEL, vFiup) //KHR_debug GOM(glDebugMessageCallback, vFEpp) // not ideal, because the my_ version will always exist, even if glDebugMessageCallback doesn't -GO(glDebugMessageControl, vFuuuipi) +GO(glDebugMessageControl, vFuuuipC) GO(glDebugMessageInsert, vFuuuuip) GO(glGetDebugMessageLog, uFuipppppp) GO(glGetObjectLabel, vFuuipp) @@ -2198,18 +2199,18 @@ GO(glWindowPos4svMESA, vFp) GO(glBeginConditionalRenderNVX, vFu) GO(glEndConditionalRenderNVX, vFv) //NV_bindless_texture -GO(glGetImageHandleNV, LFuiCiu) -GO(glGetTextureHandleNV, LFu) -GO(glGetTextureSamplerHandleNV, LFuu) -GO(glIsImageHandleResidentNV, CFL) -GO(glIsTextureHandleResidentNV, iFu) -GO(glMakeImageHandleNonResidentNV, vFu) -GO(glMakeImageHandleResidentNV, vFLu) -GO(glMakeTextureHandleNonResidentNV, vFu) -GO(glMakeTextureHandleResidentNV, vFu) -GO(glProgramUniformHandleui64NV, vFuiL) +GO(glGetImageHandleNV, UFuiCiu) +GO(glGetTextureHandleNV, UFu) +GO(glGetTextureSamplerHandleNV, UFuu) +GO(glIsImageHandleResidentNV, CFU) +GO(glIsTextureHandleResidentNV, CFU) +GO(glMakeImageHandleNonResidentNV, vFU) +GO(glMakeImageHandleResidentNV, vFUu) +GO(glMakeTextureHandleNonResidentNV, vFU) +GO(glMakeTextureHandleResidentNV, vFU) +GO(glProgramUniformHandleui64NV, vFuiU) GO(glProgramUniformHandleui64vNV, vFuiip) -GO(glUniformHandleui64NV, vFiL) +GO(glUniformHandleui64NV, vFiU) GO(glUniformHandleui64vNV, vFiip) //NV_conditional_render GO(glBeginConditionalRenderNV, vFuu) @@ -2234,16 +2235,16 @@ GO(glMapParameterfvNV, vFuup) GO(glMapParameterivNV, vFuup) //NV_explicit_multisample GO(glGetMultisamplefvNV, vFuup) -GO(glSampleMaskIndexedNV, vFui) +GO(glSampleMaskIndexedNV, vFuu) GO(glTexRenderbufferNV, vFuu) //NV_fence GO(glDeleteFencesNV, vFip) GO(glFinishFenceNV, vFu) GO(glGenFencesNV, vFip) GO(glGetFenceivNV, vFuup) -GO(glIsFenceNV, iFu) +GO(glIsFenceNV, CFu) GO(glSetFenceNV, vFuu) -GO(glTestFenceNV, iFu) +GO(glTestFenceNV, CFu) //NV_fragment_program GO(glGetProgramNamedParameterdvNV, vFuipp) GO(glGetProgramNamedParameterfvNV, vFuipp) @@ -2280,44 +2281,44 @@ GO(glGetProgramSubroutineParameteruivNV, vFuup) GO(glProgramSubroutineParametersuivNV, vFuip) //NV_gpu_shader5 GO(glGetUniformi64vNV, vFuip) -GO(glProgramUniform1i64NV, vFuil) +GO(glProgramUniform1i64NV, vFuiI) GO(glProgramUniform1i64vNV, vFuiip) -GO(glProgramUniform1ui64NV, vFuiu) +GO(glProgramUniform1ui64NV, vFuiU) GO(glProgramUniform1ui64vNV, vFuiip) -GO(glProgramUniform2i64NV, vFuill) +GO(glProgramUniform2i64NV, vFuiII) GO(glProgramUniform2i64vNV, vFuiip) -GO(glProgramUniform2ui64NV, vFuiLL) +GO(glProgramUniform2ui64NV, vFuiUU) GO(glProgramUniform2ui64vNV, vFuiip) -GO(glProgramUniform3i64NV, vFuilll) +GO(glProgramUniform3i64NV, vFuiIII) GO(glProgramUniform3i64vNV, vFuiip) -GO(glProgramUniform3ui64NV, vFuiLLL) +GO(glProgramUniform3ui64NV, vFuiUUU) GO(glProgramUniform3ui64vNV, vFuiip) -GO(glProgramUniform4i64NV, vFuillll) +GO(glProgramUniform4i64NV, vFuiIIII) GO(glProgramUniform4i64vNV, vFuiip) -GO(glProgramUniform4ui64NV, vFuiLLLL) +GO(glProgramUniform4ui64NV, vFuiUUUU) GO(glProgramUniform4ui64vNV, vFuiip) -GO(glUniform1i64NV, vFil) +GO(glUniform1i64NV, vFiI) GO(glUniform1i64vNV, vFiip) -GO(glUniform1ui64NV, vFiu) +GO(glUniform1ui64NV, vFiU) GO(glUniform1ui64vNV, vFiip) -GO(glUniform2i64NV, vFill) +GO(glUniform2i64NV, vFiII) GO(glUniform2i64vNV, vFiip) -GO(glUniform2ui64NV, vFiLL) +GO(glUniform2ui64NV, vFiUU) GO(glUniform2ui64vNV, vFiip) -GO(glUniform3i64NV, vFilll) +GO(glUniform3i64NV, vFiIII) GO(glUniform3i64vNV, vFiip) -GO(glUniform3ui64NV, vFiLLL) +GO(glUniform3ui64NV, vFiUUU) GO(glUniform3ui64vNV, vFiip) -GO(glUniform4i64NV, vFillll) +GO(glUniform4i64NV, vFiIIII) GO(glUniform4i64vNV, vFiip) -GO(glUniform4ui64NV, vFiLLLL) +GO(glUniform4ui64NV, vFiUUUU) GO(glUniform4ui64vNV, vFiip) //NV_half_float -GO(glColor3hNV, vFiii) +GO(glColor3hNV, vFWWW) GO(glColor3hvNV, vFp) -GO(glColor4hNV, vFiiii) +GO(glColor4hNV, vFWWWW) GO(glColor4hvNV, vFp) -GO(glFogCoordhNV, vFi) +GO(glFogCoordhNV, vFW) GO(glFogCoordhvNV, vFp) GO(glMultiTexCoord1hNV, vFuW) GO(glMultiTexCoord1hvNV, vFup) @@ -2327,23 +2328,23 @@ GO(glMultiTexCoord3hNV, vFuWWW) GO(glMultiTexCoord3hvNV, vFup) GO(glMultiTexCoord4hNV, vFuWWWW) GO(glMultiTexCoord4hvNV, vFup) -GO(glNormal3hNV, vFiii) +GO(glNormal3hNV, vFWWW) GO(glNormal3hvNV, vFp) GO(glSecondaryColor3hNV, vFWWW) GO(glSecondaryColor3hvNV, vFp) -GO(glTexCoord1hNV, vFi) +GO(glTexCoord1hNV, vFW) GO(glTexCoord1hvNV, vFp) GO(glTexCoord2hNV, vFWW) GO(glTexCoord2hvNV, vFp) -GO(glTexCoord3hNV, vFiii) +GO(glTexCoord3hNV, vFWWW) GO(glTexCoord3hvNV, vFp) GO(glTexCoord4hNV, vFWWWW) GO(glTexCoord4hvNV, vFp) -GO(glVertex2hNV, vFii) +GO(glVertex2hNV, vFWW) GO(glVertex2hvNV, vFp) -GO(glVertex3hNV, vFiii) +GO(glVertex3hNV, vFWWW) GO(glVertex3hvNV, vFp) -GO(glVertex4hNV, vFiiii) +GO(glVertex4hNV, vFWWWW) GO(glVertex4hvNV, vFp) GO(glVertexAttrib1hNV, vFuW) GO(glVertexAttrib1hvNV, vFup) @@ -2366,7 +2367,7 @@ GO(glEndOcclusionQueryNV, vFv) GO(glGenOcclusionQueriesNV, vFip) GO(glGetOcclusionQueryivNV, vFuup) GO(glGetOcclusionQueryuivNV, vFuup) -GO(glIsOcclusionQueryNV, iFu) +GO(glIsOcclusionQueryNV, CFu) //NV_parameter_buffer_object GO(glProgramBufferParametersIivNV, vFuuuip) GO(glProgramBufferParametersIuivNV, vFuuuip) @@ -2382,8 +2383,8 @@ GO(glGetVideoi64vNV, vFuup) GO(glGetVideoivNV, vFuup) GO(glGetVideoui64vNV, vFuup) GO(glGetVideouivNV, vFuup) -GO(glPresentFrameDualFillNV, vFuLuuuuuuuuuuu) -GO(glPresentFrameKeyedNV, vFuLuuuuuuuuu) +GO(glPresentFrameDualFillNV, vFuUuuuuuuuuuuu) +GO(glPresentFrameKeyedNV, vFuUuuuuuuuuu) //NV_primitive_restart GO(glPrimitiveRestartIndexNV, vFu) GO(glPrimitiveRestartNV, vFv) @@ -2410,14 +2411,14 @@ GO(glGetIntegerui64vNV, vFup) GO(glGetNamedBufferParameterui64vNV, vFuup) GO(glGetUniformui64vNV, vFuip) GO(glIsBufferResidentNV, CFu) -GO(glIsNamedBufferResidentNV, iFu) +GO(glIsNamedBufferResidentNV, CFu) GO(glMakeBufferNonResidentNV, vFu) GO(glMakeBufferResidentNV, vFuu) GO(glMakeNamedBufferNonResidentNV, vFu) GO(glMakeNamedBufferResidentNV, vFuu) -GO(glProgramUniformui64NV, vFuiL) +GO(glProgramUniformui64NV, vFuiU) GO(glProgramUniformui64vNV, vFuiip) -GO(glUniformui64NV, vFiL) +GO(glUniformui64NV, vFiU) GO(glUniformui64vNV, vFiip) //NV_texture_barrier GO(glTextureBarrierNV, vFv) @@ -2446,7 +2447,7 @@ GO(glBindTransformFeedbackNV, vFuu) GO(glDeleteTransformFeedbacksNV, vFip) GO(glDrawTransformFeedbackNV, vFuu) GO(glGenTransformFeedbacksNV, vFip) -GO(glIsTransformFeedbackNV, iFu) +GO(glIsTransformFeedbackNV, CFu) GO(glPauseTransformFeedbackNV, vFv) GO(glResumeTransformFeedbackNV, vFv) //NV_vdpau_interop @@ -2456,7 +2457,7 @@ GO(glVDPAUInitNV, vFpp) GO(glVDPAUIsSurfaceNV, CFl) GO(glVDPAUMapSurfacesNV, vFip) GO(glVDPAURegisterOutputSurfaceNV, lFpuip) -GO(glVDPAURegisterVideoSurfaceNV, uFpuip) +GO(glVDPAURegisterVideoSurfaceNV, lFpuip) GO(glVDPAUSurfaceAccessNV, vFlu) GO(glVDPAUUnmapSurfacesNV, vFip) GO(glVDPAUUnregisterSurfaceNV, vFl) @@ -2466,25 +2467,25 @@ GO(glVertexArrayRangeNV, vFip) //NV_vertex_attrib_integer_64bit GO(glGetVertexAttribLi64vNV, vFuup) GO(glGetVertexAttribLui64vNV, vFuup) -GO(glVertexAttribL1i64NV, vFul) +GO(glVertexAttribL1i64NV, vFuI) GO(glVertexAttribL1i64vNV, vFup) -GO(glVertexAttribL1ui64NV, vFuL) +GO(glVertexAttribL1ui64NV, vFuU) GO(glVertexAttribL1ui64vNV, vFup) -GO(glVertexAttribL2i64NV, vFull) +GO(glVertexAttribL2i64NV, vFuII) GO(glVertexAttribL2i64vNV, vFup) -GO(glVertexAttribL2ui64NV, vFuLL) +GO(glVertexAttribL2ui64NV, vFuUU) GO(glVertexAttribL2ui64vNV, vFup) -GO(glVertexAttribL3i64NV, vFulll) +GO(glVertexAttribL3i64NV, vFuIII) GO(glVertexAttribL3i64vNV, vFup) -GO(glVertexAttribL3ui64NV, vFuLLL) +GO(glVertexAttribL3ui64NV, vFuUUU) GO(glVertexAttribL3ui64vNV, vFup) -GO(glVertexAttribL4i64NV, vFullll) +GO(glVertexAttribL4i64NV, vFuIIII) GO(glVertexAttribL4i64vNV, vFup) -GO(glVertexAttribL4ui64NV, vFuLLLL) +GO(glVertexAttribL4ui64NV, vFuUUUU) GO(glVertexAttribL4ui64vNV, vFup) GO(glVertexAttribLFormatNV, vFuiui) //NV_vertex_buffer_unified_memory -GO(glBufferAddressRangeNV, vFuuLl) +GO(glBufferAddressRangeNV, vFuuUl) GO(glColorFormatNV, vFiui) GO(glEdgeFlagFormatNV, vFi) GO(glFogCoordFormatNV, vFui) @@ -2511,7 +2512,7 @@ GO(glGetVertexAttribPointervNV, vFuup) GO(glGetVertexAttribdvNV, vFuup) GO(glGetVertexAttribfvNV, vFuup) GO(glGetVertexAttribivNV, vFuup) -GO(glIsProgramNV, iFu) +GO(glIsProgramNV, CFu) GO(glLoadProgramNV, vFuuip) GO(glProgramParameter4dNV, vFuudddd) GO(glProgramParameter4dvNV, vFuup) @@ -2603,21 +2604,21 @@ GO(glMultiTexCoord1bOES, vFuc) GO(glMultiTexCoord1bvOES, vFup) GO(glMultiTexCoord2bOES, vFucc) GO(glMultiTexCoord2bvOES, vFup) -GO(glMultiTexCoord3bOES, vFuiii) +GO(glMultiTexCoord3bOES, vFuccc) GO(glMultiTexCoord3bvOES, vFup) GO(glMultiTexCoord4bOES, vFucccc) GO(glMultiTexCoord4bvOES, vFup) -GO(glTexCoord1bOES, vFi) +GO(glTexCoord1bOES, vFc) GO(glTexCoord1bvOES, vFp) -GO(glTexCoord2bOES, vFii) +GO(glTexCoord2bOES, vFcc) GO(glTexCoord2bvOES, vFp) -GO(glTexCoord3bOES, vFiii) +GO(glTexCoord3bOES, vFccc) GO(glTexCoord3bvOES, vFp) -GO(glTexCoord4bOES, vFiiii) +GO(glTexCoord4bOES, vFcccc) GO(glTexCoord4bvOES, vFp) GO(glVertex2bOES, vFcc) GO(glVertex2bvOES, vFp) -GO(glVertex3bOES, vFii) +GO(glVertex3bOES, vFccc) GO(glVertex3bvOES, vFp) GO(glVertex4bOES, vFcccc) GO(glVertex4bvOES, vFp) @@ -2816,7 +2817,7 @@ GO(glListParameterivSGIX, vFuup) //SGIX_pixel_texture GO(glPixelTexGenSGIX, vFu) //SGIX_polynomial_ffd -GO(glDeformSGIX, vFi) +GO(glDeformSGIX, vFu) GO(glDeformationMap3dSGIX, vFuddiiddiiddiip) GO(glDeformationMap3fSGIX, vFuffiiffiiffiip) GO(glLoadIdentityDeformationMapSGIX, vFu) @@ -2845,9 +2846,9 @@ GO(glGlobalAlphaFactordSUN, vFd) GO(glGlobalAlphaFactorfSUN, vFf) GO(glGlobalAlphaFactoriSUN, vFi) GO(glGlobalAlphaFactorsSUN, vFw) -GO(glGlobalAlphaFactorubSUN, vFu) +GO(glGlobalAlphaFactorubSUN, vFC) GO(glGlobalAlphaFactoruiSUN, vFu) -GO(glGlobalAlphaFactorusSUN, vFu) +GO(glGlobalAlphaFactorusSUN, vFW) //SUN_mesh_array GO(glDrawMeshArraysSUN, vFuiii) //SUN_triangle_list @@ -2907,8 +2908,8 @@ GO(glPolygonOffsetClamp, vFfff) GO(glPolygonOffsetClampEXT, vFfff) //GL_EXT_multisampled_render_to_texture -GO(glRenderbufferStorageMultisampleEXT, vFilill) -GO(glFramebufferTexture2DMultisampleEXT, vFiiiuil) +GO(glRenderbufferStorageMultisampleEXT, vFuiuii) +GO(glFramebufferTexture2DMultisampleEXT, vFuuuuii) //GL_KTX_buffer_region GO(glBufferRegionEnabled, uFv) @@ -2920,115 +2921,115 @@ GO(glDrawBufferRegion, vFuiiiiii) //GL_ARB_sparse_buffer GO(glBufferPageCommitmentARB, vFullC) GO(glNamedBufferPageCommitmentARB, vFullC) -GO(glNamedBufferPageCommitmentEXT, vFuppi) +GO(glNamedBufferPageCommitmentEXT, vFullC) //GL_ARB_sparse_texture GO(TexPageCommitmentARB, vFiiiiiiiii) //glx GO(glXBindHyperpipeSGIX, iFpi) -GO(glXBindTexImageEXT, vFppip) +GO(glXBindTexImageEXT, vFpLip) GO(glXBindSwapBarrierNV, iFpuu) -GO(glXBindSwapBarrierSGIX,vFii) -GO(glXBindVideoCaptureDeviceNV, iFpup) +GO(glXBindSwapBarrierSGIX, vFpLi) +GO(glXBindVideoCaptureDeviceNV, iFpuL) GO(glXBindVideoDeviceNV, iFpuup) -GO(glXBindVideoImageNV, iFpppi) +GO(glXBindVideoImageNV, iFpuLi) GO(glXChangeDrawableAttributes, vFp) GO(glXChangeDrawableAttributesSGIX, vFp) GO(glXClientInfo, vFv) -GO(glXCopyContext, vFppp) +GO(glXCopyContext, vFpppL) GO(glXChooseFBConfig, pFpipp) GO(glXChooseFBConfigSGIX, pFpipp) -GO(glXCreateContext,pFpppi) +GO(glXCreateContext, pFpppi) GO(glXCreateContextAttribsARB, pFpppip) GO(glXCreateContextWithConfigSGIX, pFppipi) -GO(glXCreateGLXPbufferSGIX, pFppuup) -GO(glXCreateGLXPixmap, pFppp) -GO(glXCreateGLXPixmapWithConfigSGIX, pFppp) +GO(glXCreateGLXPbufferSGIX, LFppuup) +GO(glXCreateGLXPixmap, LFppL) +GO(glXCreateGLXPixmapWithConfigSGIX, LFppL) GO(glXCreateGLXVideoSourceSGIX, pFpippip) GO(glXCreateNewContext, pFppipi) -GO(glXCreatePbuffer, pFppp) -GO(glXCreatePixmap, pFppp) -GO(glXCreateWindow, pFpppp) +GO(glXCreatePbuffer, LFppp) +GO(glXCreatePixmap, LFppLp) +GO(glXCreateWindow, LFppLp) GO(glXChooseVisual, pFpip) -GO(glXCopyImageSubDataNV, vFppuiiiiipuiiiiiiii) -GO(glXCopySubBufferMESA, vFppiiii) -GO(glXDestroyContext,vFpp) -GO(glXDestroyGLXPbufferSGIX,vFpp) -GO(glXDestroyGLXPixmap,vFpp) -GO(glXDestroyGLXVideoSourceSGIX,vFpp) -GO(glXDestroyHyperpipeConfigSGIX,iFpi) -GO(glXDestroyPbuffer,vFpp) -GO(glXDestroyPixmap,vFpp) -GO(glXDestroyWindow,vFpp) +GO(glXCopyImageSubDataNV, vFppuuiiiipuuiiiiiii) +GO(glXCopySubBufferMESA, vFpLiiii) +GO(glXDestroyContext, vFpp) +GO(glXDestroyGLXPbufferSGIX, vFpL) +GO(glXDestroyGLXPixmap, vFpL) +GO(glXDestroyGLXVideoSourceSGIX, vFpp) +GO(glXDestroyHyperpipeConfigSGIX, iFpi) +GO(glXDestroyPbuffer, vFpL) +GO(glXDestroyPixmap, vFpL) +GO(glXDestroyWindow, vFpL) GO(glXEnumerateVideoCaptureDevicesNV, pFpip) GO(glXEnumerateVideoDevicesNV, pFpip) GO(glXFreeContextEXT, vFpp) GO(glXGetClientString, pFpi) GO(glXGetConfig, iFppip) -GO(glXGetContextIDEXT, uFp) +GO(glXGetContextIDEXT, LFp) GO(glXGetCurrentContext, pFv) GO(glXGetCurrentDisplay, pFv) -GO(glXGetCurrentDrawable, pFv) -GO(glXGetCurrentReadDrawable, pFv) -GO(glXGetDrawableAttributes,vFi) -GO(glXGetDrawableAttributesSGIX,vFi) -GO(glXGetFBConfigs,pFpip) +GO(glXGetCurrentDrawable, LFv) +GO(glXGetCurrentReadDrawable, LFv) +GO(glXGetDrawableAttributes, vFi) +GO(glXGetDrawableAttributesSGIX, vFi) +GO(glXGetFBConfigs, pFpip) GO(glXGetFBConfigAttrib, iFppip) GO(glXGetFBConfigAttribSGIX, iFppip) GO(glXGetFBConfigFromVisualSGIX, pFpp) -GO(glXGetFBConfigsSGIX,pFpip) -GO(glXGetSelectedEvent, vFppp) -GO(glXGetSelectedEventSGIX, vFppp) +GO(glXGetFBConfigsSGIX, pFpip) +GO(glXGetSelectedEvent, vFpLp) +GO(glXGetSelectedEventSGIX, vFpLp) GO(glXGetVideoDeviceNV, iFpiip) -GO(glXGetVideoInfoNV, iFpippp) +GO(glXGetVideoInfoNV, iFpiupp) GO(glXGetVideoSyncSGI, iFp) -GO(glXGetVisualConfigs,pFpp) +GO(glXGetVisualConfigs, pFpp) GO(glXGetVisualFromFBConfig, pFpp) GO(glXGetVisualFromFBConfigSGIX, pFpp) -GO(glXHyperpipeAttribSGIX,iFpiiip) -//GO(glXHyperpipeConfigSGIX,iFpii?p) -GO(glXImportContextEXT, pFpu) -GO(glXIsDirect,iFpp) -GO(glXJoinSwapGroupNV, iFppu) -GO(glXJoinSwapGroupSGIX,vFpp) -GO(glXLockVideoCaptureDeviceNV, vFpp) -GO(glXMakeContextCurrent,iFpppp) -GO(glXMakeCurrent,iFppp) -GO(glXQueryContext,iFppip) -GO(glXQueryContextInfoEXT,iFppip) -GO(glXQueryDrawable, iFppip) +GO(glXHyperpipeAttribSGIX, iFpiiip) +GO(glXHyperpipeConfigSGIX, iFpiipp) +GO(glXImportContextEXT, pFpL) +GO(glXIsDirect, iFpp) +GO(glXJoinSwapGroupNV, iFpLu) +GO(glXJoinSwapGroupSGIX, vFpLL) +GO(glXLockVideoCaptureDeviceNV, vFpL) +GO(glXMakeContextCurrent, iFpLLp) +GO(glXMakeCurrent, iFpLp) +GO(glXQueryContext, iFppip) +GO(glXQueryContextInfoEXT, iFppip) +GO(glXQueryDrawable, vFpLip) GO(glXQueryExtension, iFppp) -GO(glXQueryExtensionsString,pFpi) +GO(glXQueryExtensionsString, pFpi) GO(glXQueryFrameCountNV, iFpip) -GO(glXQueryGLXPbufferSGIX, vFppip) -GO(glXQueryHyperpipeAttribSGIX,iFpiiip) -GO(glXQueryHyperpipeBestAttribSGIX,iFpiiipp) -GO(glXQueryHyperpipeConfigSGIX,pFpip) -GO(glXQueryHyperpipeNetworkSGIX,pFpp) -GO(glXQueryMaxSwapBarriersSGIX,pFpp) //? +GO(glXQueryGLXPbufferSGIX, vFpLip) +GO(glXQueryHyperpipeAttribSGIX, iFpiiip) +GO(glXQueryHyperpipeBestAttribSGIX, iFpiiipp) +GO(glXQueryHyperpipeConfigSGIX, pFpip) +GO(glXQueryHyperpipeNetworkSGIX, pFpp) +GO(glXQueryMaxSwapBarriersSGIX, iFpip) GO(glXQueryMaxSwapGroupsNV, iFpipp) -GO(glXQueryServerString,pFpii) -GO(glXQuerySwapGroupNV, iFpipp) -GO(glXQueryVersion,iFppp) -GO(glXQueryVideoCaptureDeviceNV, iFppip) -GO(glXReleaseTexImageEXT, vFppi) -GO(glXReleaseVideoCaptureDeviceNV, vFpp) -GO(glXReleaseVideoDeviceNV, iFpip) -GO(glXReleaseVideoImageNV, iFpp) -//GO(glXRender,vFv) -//GO(glXRenderLarge,vFv) +GO(glXQueryServerString, pFpii) +GO(glXQuerySwapGroupNV, iFpLpp) +GO(glXQueryVersion, iFppp) +GO(glXQueryVideoCaptureDeviceNV, iFpLip) +GO(glXReleaseTexImageEXT, vFpLi) +GO(glXReleaseVideoCaptureDeviceNV, vFpL) +GO(glXReleaseVideoDeviceNV, iFpiu) +GO(glXReleaseVideoImageNV, iFpL) +//GO(glXRender, vFv) +//GO(glXRenderLarge, vFv) GO(glXResetFrameCountNV, iFpi) -GO(glXSelectEvent, vFppu) -GO(glXSelectEventSGIX, vFppu) -GO(glXSendPbufferToVideoNV, iFppipi) -GO(glXSwapBuffers,vFpp) -GO(glXUseXFont,vFpiii) -//GO(glXVendorPrivate,vFv) -//GO(glXVendorPrivateWithReply,vFv) -GO(glXWaitGL,vFv) +GO(glXSelectEvent, vFpLL) +GO(glXSelectEventSGIX, vFpLL) +GO(glXSendPbufferToVideoNV, iFpLipC) +GO(glXSwapBuffers, vFpL) +GO(glXUseXFont, vFLiii) +//GO(glXVendorPrivate, vFv) +//GO(glXVendorPrivateWithReply, vFv) +GO(glXWaitGL, vFv) GO(glXWaitVideoSyncSGI, iFiip) -GO(glXWaitX,vFv) +GO(glXWaitX, vFv) GOM(glXGetProcAddress, pFEp) GOM(glXGetProcAddressARB, pFEp) @@ -3040,37 +3041,48 @@ GO(glXQueryRendererStringMESA, pFpiii) GO(glXQueryCurrentRendererStringMESA, pFi) //GLX_OML_sync_control -GO(glXGetSyncValuesOML, iFppppp) -GO(glXGetMscRateOML, iFpppp) -GO(glXSwapBuffersMscOML, IFppIII) -GO(glXWaitForMscOML, iFppIIIppp) -GO(glXWaitForSbcOML, iFppIppp) +GO(glXGetSyncValuesOML, iFpLppp) +GO(glXGetMscRateOML, iFpLpp) +GO(glXSwapBuffersMscOML, IFpLIII) +GO(glXWaitForMscOML, iFpLIIIppp) +GO(glXWaitForSbcOML, iFpLIppp) //GLX_EXT_swap_control -GOM(glXSwapIntervalEXT,vFppi) +GOM(glXSwapIntervalEXT, vFEpLi) //GLX_EXT_swap_control_tear //nothing //GLX_MESA_swap_control -GOM(glXSwapIntervalMESA,iFi) +GOM(glXSwapIntervalMESA, iFEu) GO(glXGetSwapIntervalMESA, iFv) //GLX_SGI_swap_control -GO(glXSwapIntervalSGI,iFi) +GO(glXSwapIntervalSGI, iFi) //GLX_NV_vertex_array_range -GO(glXAllocateMemoryNV, pFlfff) +GO(glXAllocateMemoryNV, pFifff) GO(glXFreeMemoryNV, vFp) //GLX_ARB_???? GO(glSpecializeShaderARB, vFupupp) +//GLX_AMD_gpu_association +GO(glXGetGPUIDsAMD, uFup) +GO(glXGetGPUInfoAMD, iFuiuup) +GO(glXGetContextGPUIDAMD, uFp) +GO(glXCreateAssociatedContextAMD, pFup) +GO(glXCreateAssociatedContextAttribsAMD, pFupp) +GO(glXDeleteAssociatedContextAMD, iFp) +GO(glXMakeAssociatedContextCurrentAMD, iFp) +GO(glXGetCurrentAssociatedContextAMD, pFv) +GO(glXBlitContextFramebufferAMD, vFpiiiiiiiiuu) + //GL_EXT_debug_label GO(glGetObjectLabelEXT, vFuuipp) GO(glLabelObjectEXT, vFuuip) //GL_EXT_debug_marker -GO(glInsertEventMarkerEXT, vFlp) +GO(glInsertEventMarkerEXT, vFip) GO(glPushGroupMarkerEXT, vFip) GO(glPopGroupMarkerEXT, vFv) @@ -3082,8 +3094,8 @@ GO(glResolveMultisampleFramebufferAPPLE, vFv) GO(glTexPageCommitmentARB, vFuiiiiiiiC) //GL_ARB_sample_locations -GO(glFramebufferSampleLocationsfvARB, vFiulp) -GO(glNamedFramebufferSampleLocationsfvARB, vFuulp) +GO(glFramebufferSampleLocationsfvARB, vFuuip) +GO(glNamedFramebufferSampleLocationsfvARB, vFuuip) GO(glEvaluateDepthValuesARB, vFv) //GL_ARB_parallel_shader_compile @@ -3094,42 +3106,42 @@ GO(glMultiDrawArraysIndirectCountARB, vFuplii) GO(glMultiDrawElementsIndirectCountARB, vFuuplii) //GL_ARB_gpu_shader_int64 -GO(glUniform1i64ARB, vFil) -GO(glUniform2i64ARB, vFill) -GO(glUniform3i64ARB, vFilll) -GO(glUniform4i64ARB, vFillll) -GO(glUniform1i64vARB, vFilp) -GO(glUniform2i64vARB,vFilp) -GO(glUniform3i64vARB,vFilp) +GO(glUniform1i64ARB, vFiI) +GO(glUniform2i64ARB, vFiII) +GO(glUniform3i64ARB, vFiIII) +GO(glUniform4i64ARB, vFiIIII) +GO(glUniform1i64vARB, vFiip) +GO(glUniform2i64vARB, vFiip) +GO(glUniform3i64vARB, vFiip) GO(glUniform4i64vARB, vFiip) -GO(glUniform1ui64ARB,vFiU) -GO(glUniform2ui64ARB, vFiLL) -GO(glUniform3ui64ARB, vFiLLL) -GO(glUniform4ui64ARB, vFiLLLL) -GO(glUniform1ui64vARB, vFilp) -GO(glUniform2ui64vARB, vFilp) -GO(glUniform3ui64vARB, vFilp) -GO(glUniform4ui64vARB, vFilp) +GO(glUniform1ui64ARB, vFiU) +GO(glUniform2ui64ARB, vFiUU) +GO(glUniform3ui64ARB, vFiUUU) +GO(glUniform4ui64ARB, vFiUUUU) +GO(glUniform1ui64vARB, vFiip) +GO(glUniform2ui64vARB, vFiip) +GO(glUniform3ui64vARB, vFiip) +GO(glUniform4ui64vARB, vFiip) GO(glGetUniformi64vARB, vFuip) GO(glGetUniformui64vARB, vFuip) GO(glGetnUniformi64vARB, vFuiip) GO(glGetnUniformui64vARB, vFuiip) -GO(glProgramUniform1i64ARB, vFuil) -GO(glProgramUniform2i64ARB, vFuill) -GO(glProgramUniform3i64ARB, vFuilll) -GO(glProgramUniform4i64ARB, vFuillll) -GO(glProgramUniform1i64vARB, vFuilp) -GO(glProgramUniform2i64vARB, vFuilp) -GO(glProgramUniform3i64vARB, vFuilp) +GO(glProgramUniform1i64ARB, vFuiI) +GO(glProgramUniform2i64ARB, vFuiII) +GO(glProgramUniform3i64ARB, vFuiIII) +GO(glProgramUniform4i64ARB, vFuiIIII) +GO(glProgramUniform1i64vARB, vFuiip) +GO(glProgramUniform2i64vARB, vFuiip) +GO(glProgramUniform3i64vARB, vFuiip) GO(glProgramUniform4i64vARB, vFuiip) GO(glProgramUniform1ui64ARB, vFuiU) -GO(glProgramUniform2ui64ARB, vFuiLL) -GO(glProgramUniform3ui64ARB, vFuiLLL) -GO(glProgramUniform4ui64ARB, vFuiLLLL) -GO(glProgramUniform1ui64vARB, vFuilp) -GO(glProgramUniform2ui64vARB, vFuilp) -GO(glProgramUniform3ui64vARB, vFuilp) -GO(glProgramUniform4ui64vARB, vFuilp) +GO(glProgramUniform2ui64ARB, vFuiUU) +GO(glProgramUniform3ui64ARB, vFuiUUU) +GO(glProgramUniform4ui64ARB, vFuiUUUU) +GO(glProgramUniform1ui64vARB, vFuiip) +GO(glProgramUniform2ui64vARB, vFuiip) +GO(glProgramUniform3ui64vARB, vFuiip) +GO(glProgramUniform4ui64vARB, vFuiip) //GL_ARB_compute_variable_group_size GO(glDispatchComputeGroupSizeARB, vFuuuuuu) @@ -3142,21 +3154,21 @@ GO(glGetTextureHandleARB, UFu) GO(glGetTextureSamplerHandleARB, UFuu) GO(glMakeTextureHandleResidentARB, vFU) GO(glMakeTextureHandleNonResidentARB, vFU) -GO(glGetImageHandleARB, UFuiiii) -GO(glMakeImageHandleResidentARB, vFUi) +GO(glGetImageHandleARB, UFuiCiu) +GO(glMakeImageHandleResidentARB, vFUu) GO(glMakeImageHandleNonResidentARB, vFU) GO(glUniformHandleui64ARB, vFiU) -GO(glUniformHandleui64vARB, vFilp) +GO(glUniformHandleui64vARB, vFiip) GO(glProgramUniformHandleui64ARB, vFuiU) -GO(glProgramUniformHandleui64vARB, vFuilp) -GO(glIsTextureHandleResidentARB, iFU) -GO(glIsImageHandleResidentARB, iFU) +GO(glProgramUniformHandleui64vARB, vFuiip) +GO(glIsTextureHandleResidentARB, CFU) +GO(glIsImageHandleResidentARB, CFU) GO(glVertexAttribL1ui64ARB, vFuU) GO(glVertexAttribL1ui64vARB, vFup) -GO(glGetVertexAttribLui64vARB, vFuip) +GO(glGetVertexAttribLui64vARB, vFuup) //GL_OES_EGL_image -GO(glEGLImageTargetTexture2DOES, vFip) +GO(glEGLImageTargetTexture2DOES, vFup) GO(glEGLImageTargetRenderbufferStorageOES, vFup) //GL_MESA_program_debug @@ -3167,7 +3179,7 @@ GO(glGetProgramRegisterfvMESA, vFilpp) GO(glBlendEquationSeparateATI, vFuu) //GL_AMD_interleaved_elements -GO(glVertexAttribParameteriAMD, vFuii) +GO(glVertexAttribParameteriAMD, vFuui) //GL_AMD_occlusion_query_event GO(glQueryObjectParameteruiAMD, vFuuuu) @@ -3196,23 +3208,23 @@ GO(glMultiDrawArraysIndirectBindlessCountNV, vFupiiii) GO(glMultiDrawElementsIndirectBindlessCountNV, vFuupiiii) //GL_NV_blend_equation_advanced -GO(glBlendParameteriNV, vFii) +GO(glBlendParameteriNV, vFui) GO(glBlendBarrierNV, vFv) //GL_NV_command_list -GO(glCreateStatesNV, vFlp) -GO(glDeleteStatesNV, vFlp) -GO(glIsStateNV, iFu) -GO(glStateCaptureNV, vFui) +GO(glCreateStatesNV, vFip) +GO(glDeleteStatesNV, vFip) +GO(glIsStateNV, CFu) +GO(glStateCaptureNV, vFuu) GO(glGetCommandHeaderNV, uFuu) GO(glGetStageIndexNV, WFu) GO(glDrawCommandsNV, vFuuppu) GO(glDrawCommandsAddressNV, vFuppu) GO(glDrawCommandsStatesNV, vFuppppu) GO(glDrawCommandsStatesAddressNV, vFppppu) -GO(glCreateCommandListsNV, vFlp) -GO(glDeleteCommandListsNV, vFlp) -GO(glIsCommandListNV, iFu) +GO(glCreateCommandListsNV, vFip) +GO(glDeleteCommandListsNV, vFip) +GO(glIsCommandListNV, CFu) GO(glListDrawCommandsStatesClientNV, vFuuppppu) GO(glCommandListSegmentsNV, vFuu) GO(glCompileCommandListNV, vFu) @@ -3225,17 +3237,17 @@ GO(glSubpixelPrecisionBiasNV, vFuu) GO(glFragmentCoverageColorNV, vFu) //GL_NV_framebuffer_mixed_samples -GO(glCoverageModulationTableNV, vFlp) +GO(glCoverageModulationTableNV, vFip) GO(glGetCoverageModulationTableNV, vFip) -GO(glCoverageModulationNV, vFi) +GO(glCoverageModulationNV, vFu) //GL_NV_internalformat_sample_query GO(glGetInternalformatSampleivNV, vFuuiuip) //GL_NV_path_rendering -GO(glGenPathsNV, uFl) -GO(glDeletePathsNV, vFul) -GO(glIsPathNV, iFu) +GO(glGenPathsNV, uFi) +GO(glDeletePathsNV, vFui) +GO(glIsPathNV, CFu) GO(glPathCommandsNV, vFuipiup) GO(glPathCoordsNV, vFuiup) GO(glPathSubCommandsNV, vFuiiipiup) @@ -3246,25 +3258,25 @@ GO(glPathGlyphRangeNV, vFuupuuiuuf) GO(glWeightPathsNV, vFuipp) GO(glCopyPathNV, vFuu) GO(glInterpolatePathsNV, vFuuuf) -GO(glTransformPathNV, vFuuip) -GO(glPathParameterivNV, vFuip) -GO(glPathParameteriNV, vFuii) -GO(glPathParameterfvNV, vFuip) -GO(glPathParameterfNV, vFuif) -GO(glPathDashArrayNV, vFulp) +GO(glTransformPathNV, vFuuup) +GO(glPathParameterivNV, vFuup) +GO(glPathParameteriNV, vFuui) +GO(glPathParameterfvNV, vFuup) +GO(glPathParameterfNV, vFuuf) +GO(glPathDashArrayNV, vFuip) GO(glPathStencilFuncNV, vFuiu) GO(glPathStencilDepthOffsetNV, vFff) GO(glStencilFillPathNV, vFuuu) GO(glStencilStrokePathNV, vFuiu) GO(glStencilFillPathInstancedNV, vFiupuuuup) GO(glStencilStrokePathInstancedNV, vFiupuiuup) -GO(glPathCoverDepthFuncNV, vFi) -GO(glCoverFillPathNV, vFui) -GO(glCoverStrokePathNV, vFui) -GO(glCoverFillPathInstancedNV, vFlipuiip) +GO(glPathCoverDepthFuncNV, vFu) +GO(glCoverFillPathNV, vFuu) +GO(glCoverStrokePathNV, vFuu) +GO(glCoverFillPathInstancedNV, vFiupuuup) GO(glCoverStrokePathInstancedNV, vFiupuuup) -GO(glGetPathParameterivNV, vFuip) -GO(glGetPathParameterfvNV, vFuip) +GO(glGetPathParameterivNV, vFuup) +GO(glGetPathParameterfvNV, vFuup) GO(glGetPathCommandsNV, vFup) GO(glGetPathCoordsNV, vFup) GO(glGetPathDashArrayNV, vFup) @@ -3275,12 +3287,12 @@ GO(glIsPointInFillPathNV, CFuuff) GO(glIsPointInStrokePathNV, CFuff) GO(glGetPathLengthNV, fFuii) GO(glPointAlongPathNV, CFuiifpppp) -GO(glMatrixLoad3x2fNV, vFip) -GO(glMatrixLoad3x3fNV, vFip) -GO(glMatrixLoadTranspose3x3fNV, vFip) -GO(glMatrixMult3x2fNV, vFip) -GO(glMatrixMult3x3fNV, vFip) -GO(glMatrixMultTranspose3x3fNV, vFip) +GO(glMatrixLoad3x2fNV, vFup) +GO(glMatrixLoad3x3fNV, vFup) +GO(glMatrixLoadTranspose3x3fNV, vFup) +GO(glMatrixMult3x2fNV, vFup) +GO(glMatrixMult3x3fNV, vFup) +GO(glMatrixMultTranspose3x3fNV, vFup) GO(glStencilThenCoverFillPathNV, vFuuuu) GO(glStencilThenCoverStrokePathNV, vFuiuu) GO(glStencilThenCoverFillPathInstancedNV, vFiupuuuuup) @@ -3292,14 +3304,15 @@ GO(glProgramPathFragmentInputGenNV, vFuiuip) GO(glGetProgramResourcefvNV, vFuuuipipp) GO(glPathColorGenNV, vFuuup) GO(glPathTexGenNV, vFuuip) -GO(glPathFogGenNV, vFi) -GO(glGetPathColorGenivNV, vFiip) -GO(glGetPathColorGenfvNV, vFiip) -GO(glGetPathTexGenivNV, vFiip) -GO(glGetPathTexGenfvNV, vFiip) +GO(glPathFogGenNV, vFu) +GO(glGetPathColorGenivNV, vFuup) +GO(glGetPathColorGenfvNV, vFuup) +GO(glGetPathTexGenivNV, vFuup) +GO(glGetPathTexGenfvNV, vFuup) + //GL_NV_sample_locations -GO(glFramebufferSampleLocationsfvNV, vFiulp) +GO(glFramebufferSampleLocationsfvNV, vFuuip) GO(glNamedFramebufferSampleLocationsfvNV, vFuuip) GO(glResolveDepthValuesNV, vFv) @@ -3313,7 +3326,7 @@ GO(glGetnUniformuivKHR, vFuilp) // GLES stuff GO(glDiscardFramebuffer, vFilp) GO(glDiscardFramebufferARB, vFilp) -GO(glDiscardFramebufferEXT, vFilp) +GO(glDiscardFramebufferEXT, vFuip) GO(glDiscardFramebufferOES, vFilp) GO(glDiscardFramebufferANGLE, vFilp) GO(glDiscardFramebufferNV, vFilp) @@ -3322,16 +3335,16 @@ GO(glBlendBarrierARB, vFv) GO(glBlendBarrierEXT, vFv) GO(glBlendBarrierOES, vFv) GO(glBlendBarrierANGLE, vFv) -GO(glClearDepthfARB,vFf) -GO(glClipPlanefARB,vFup) -GO(glDepthRangefARB,vFff) -GO(glFrustumfARB,vFffffff) -GO(glGetClipPlanefARB,vFup) -GO(glOrthofARB,vFffffff) -GO(glClipPlanef,vFup) -GO(glFrustumf,vFffffff) -GO(glGetClipPlanef,vFup) -GO(glOrthof,vFffffff) +GO(glClearDepthfARB, vFf) +GO(glClipPlanefARB, vFup) +GO(glDepthRangefARB, vFff) +GO(glFrustumfARB, vFffffff) +GO(glGetClipPlanefARB, vFup) +GO(glOrthofARB, vFffffff) +GO(glClipPlanef, vFup) +GO(glFrustumf, vFffffff) +GO(glGetClipPlanef, vFup) +GO(glOrthof, vFffffff) GO(glActiveShaderProgramEXT, vFuu) GO(glBindProgramPipelineEXT, vFu) GO(glCreateShaderProgramvEXT, uFilp) @@ -3350,56 +3363,56 @@ GO(glWindowRectanglesEXT, vFuip) // GL_EXT_memory_object GO(glGetUnsignedBytevEXT, vFup) GO(glGetUnsignedBytei_vEXT, vFuup) -GO(glDeleteMemoryObjectsEXT, vFlp) -GO(glIsMemoryObjectEXT, iFu) -GO(glCreateMemoryObjectsEXT, vFlp) -GO(glMemoryObjectParameterivEXT, vFuip) -GO(glGetMemoryObjectParameterivEXT, vFuip) -GO(glTexStorageMem2DEXT, vFuiuiiuL) -GO(glTexStorageMem2DMultisampleEXT, vFuiuiiCuL) -GO(glTexStorageMem3DEXT, vFuiuiiiuL) -GO(glTexStorageMem3DMultisampleEXT, vFuiuiiiCuL) -GO(glBufferStorageMemEXT, vFuluL) -GO(glTextureStorageMem2DEXT, vFuiuiiuL) -GO(glTextureStorageMem2DMultisampleEXT, vFuiuiiCuL) -GO(glTextureStorageMem3DEXT, vFuiuiiiuL) -GO(glTextureStorageMem3DMultisampleEXT, vFuiuiiiCuL) -GO(glNamedBufferStorageMemEXT, vFuluL) -GO(glTexStorageMem1DEXT, vFuiuiuL) -GO(glTextureStorageMem1DEXT, vFuiuiuL) +GO(glDeleteMemoryObjectsEXT, vFip) +GO(glIsMemoryObjectEXT, CFu) +GO(glCreateMemoryObjectsEXT, vFip) +GO(glMemoryObjectParameterivEXT, vFuup) +GO(glGetMemoryObjectParameterivEXT, vFuup) +GO(glTexStorageMem2DEXT, vFuiuiiuU) +GO(glTexStorageMem2DMultisampleEXT, vFuiuiiCuU) +GO(glTexStorageMem3DEXT, vFuiuiiiuU) +GO(glTexStorageMem3DMultisampleEXT, vFuiuiiiCuU) +GO(glBufferStorageMemEXT, vFuluU) +GO(glTextureStorageMem2DEXT, vFuiuiiuU) +GO(glTextureStorageMem2DMultisampleEXT, vFuiuiiCuU) +GO(glTextureStorageMem3DEXT, vFuiuiiiuU) +GO(glTextureStorageMem3DMultisampleEXT, vFuiuiiiCuU) +GO(glNamedBufferStorageMemEXT, vFuluU) +GO(glTexStorageMem1DEXT, vFuiuiuU) +GO(glTextureStorageMem1DEXT, vFuiuiuU) // GL_EXT_semaphore -GO(glGenSemaphoresEXT, vFlp) -GO(glDeleteSemaphoresEXT, vFlp) -GO(glIsSemaphoreEXT, iFu) +GO(glGenSemaphoresEXT, vFip) +GO(glDeleteSemaphoresEXT, vFip) +GO(glIsSemaphoreEXT, CFu) GO(glSemaphoreParameterui64vEXT, vFuup) -GO(glGetSemaphoreParameterui64vEXT, vFuip) +GO(glGetSemaphoreParameterui64vEXT, vFuup) GO(glWaitSemaphoreEXT, vFuupupp) GO(glSignalSemaphoreEXT, vFuupupp) // GL_EXT_memory_object_fd -GO(glImportMemoryFdEXT, vFuLui) +GO(glImportMemoryFdEXT, vFuUui) // GL_KHR_parallel_shader_compile GO(glMaxShaderCompilerThreadsKHR, vFu) // GL_AMD_framebuffer_multisample_advanced -GO(glRenderbufferStorageMultisampleAdvancedAMD, vFillill) -GO(glNamedRenderbufferStorageMultisampleAdvancedAMD, vFullill) +GO(glRenderbufferStorageMultisampleAdvancedAMD, vFuiiuii) +GO(glNamedRenderbufferStorageMultisampleAdvancedAMD, vFuiiuii) // GL_EXT_semaphore_fd -GO(glImportSemaphoreFdEXT, vFuii) +GO(glImportSemaphoreFdEXT, vFuui) // GLX_SGI_make_current_read -GO(glXMakeCurrentReadSGI, iFpppp) -GO(glXGetCurrentReadDrawableSGI, pFv) +GO(glXMakeCurrentReadSGI, iFpLLp) +GO(glXGetCurrentReadDrawableSGI, LFv) // GL_IMG_multisampled_render_to_texture -GO(glFramebufferTexture2DMultisampleIMG, vFiiiuil) -GO(glRenderbufferStorageMultisampleIMG, vFilill) +GO(glFramebufferTexture2DMultisampleIMG, vFuuuuii) +GO(glRenderbufferStorageMultisampleIMG, vFuiuii) // GL_ANGLE_translated_shader_source -GO(glGetTranslatedShaderSourceANGLE, vFulpp) +GO(glGetTranslatedShaderSourceANGLE, vFuipp) // GL_EXT_EGL_image_storage GO(glEGLImageTargetTexStorageEXT, vFupp) @@ -3410,41 +3423,41 @@ GO(glBufferStorageExternalEXT, vFullpu) GO(glNamedBufferStorageExternalEXT, vFullpu) // GL_EXT_memory_object_win32 -GO(glImportMemoryWin32HandleEXT, vFuLup) -GO(glImportMemoryWin32NameEXT, vFuLup) +GO(glImportMemoryWin32HandleEXT, vFuUup) +GO(glImportMemoryWin32NameEXT, vFuUup) // GL_EXT_semaphore_win32 GO(glImportSemaphoreWin32HandleEXT, vFuup) -GO(glImportSemaphoreWin32NameEXT, vFuip) +GO(glImportSemaphoreWin32NameEXT, vFuup) // GL_EXT_shader_framebuffer_fetch_non_coherent GO(glFramebufferFetchBarrierEXT, vFv) // GL_EXT_win32_keyed_mutex -GO(glAcquireKeyedMutexWin32EXT, CFuLu) -GO(glReleaseKeyedMutexWin32EXT, CFuL) +GO(glAcquireKeyedMutexWin32EXT, CFuUu) +GO(glReleaseKeyedMutexWin32EXT, CFuU) // GL_INTEL_framebuffer_CMAA GO(glApplyFramebufferAttachmentCMAAINTEL, vFv) // GL_NV_alpha_to_coverage_dither_control -GO(glAlphaToCoverageDitherControlNV, vFi) +GO(glAlphaToCoverageDitherControlNV, vFu) // GL_NV_clip_space_w_scaling GO(glViewportPositionWScaleNV, vFuff) // GL_NV_conservative_raster_dilate -GO(glConservativeRasterParameterfNV, vFif) +GO(glConservativeRasterParameterfNV, vFuf) // GL_NV_conservative_raster_pre_snap_triangles -GO(glConservativeRasterParameteriNV, vFii) +GO(glConservativeRasterParameteriNV, vFui) // GL_NV_draw_vulkan_image -GO(glDrawVkImageNV, vFLufffffffff) +GO(glDrawVkImageNV, vFUufffffffff) GOM(glGetVkProcAddrNV, pFEp) GO(glWaitVkSemaphoreNV, vFU) GO(glSignalVkSemaphoreNV, vFU) -GO(glSignalVkFenceNV, vFL) +GO(glSignalVkFenceNV, vFU) // GL_NV_gpu_multicast GO(glRenderGpuMaskNV, vFu) @@ -3455,18 +3468,18 @@ GO(glMulticastBlitFramebufferNV, vFuuiiiiiiiiuu) GO(glMulticastFramebufferSampleLocationsfvNV, vFuuuip) GO(glMulticastBarrierNV, vFv) GO(glMulticastWaitSyncNV, vFuu) -GO(glMulticastGetQueryObjectivNV, vFuuip) +GO(glMulticastGetQueryObjectivNV, vFuuup) GO(glMulticastGetQueryObjectuivNV, vFuuup) GO(glMulticastGetQueryObjecti64vNV, vFuuup) GO(glMulticastGetQueryObjectui64vNV, vFuuup) // GL_NV_memory_attachment GO(glGetMemoryObjectDetachedResourcesuivNV, vFuuiip) -GO(glResetMemoryObjectParameterNV, vFui) -GO(glTexAttachMemoryNV, vFiuU) -GO(glBufferAttachMemoryNV, vFuuL) +GO(glResetMemoryObjectParameterNV, vFuu) +GO(glTexAttachMemoryNV, vFuuU) +GO(glBufferAttachMemoryNV, vFuuU) GO(glTextureAttachMemoryNV, vFuuU) -GO(glNamedBufferAttachMemoryNV, vFuuL) +GO(glNamedBufferAttachMemoryNV, vFuuU) // GL_NV_mesh_shader GO(glDrawMeshTasksNV, vFuu) @@ -3478,7 +3491,7 @@ GO(glMultiDrawMeshTasksIndirectCountNV, vFllii) GO(glQueryResourceNV, iFuiup) // GL_NV_query_resource_tag -GO(glGenQueryResourceTagNV, vFlp) +GO(glGenQueryResourceTagNV, vFip) GO(glDeleteQueryResourceTagNV, vFip) GO(glQueryResourceTagNV, vFip) @@ -3491,7 +3504,7 @@ GO(glBindShadingRateImageNV, vFu) GO(glShadingRateImagePaletteNV, vFuuip) GO(glGetShadingRateImagePaletteNV, vFuup) GO(glShadingRateImageBarrierNV, vFC) -GO(glShadingRateSampleOrderNV, vFi) +GO(glShadingRateSampleOrderNV, vFu) GO(glShadingRateSampleOrderCustomNV, vFuup) GO(glGetShadingRateSampleLocationivNV, vFuuup) @@ -3509,14 +3522,14 @@ GO(glGetFramebufferParameterfvAMD, vFuuuuip) GO(glGetNamedFramebufferParameterfvAMD, vFuuuuip) // GL_ANGLE_framebuffer_blit -GO(glBlitFramebufferANGLE, vFiiiiiiiiui) +GO(glBlitFramebufferANGLE, vFiiiiiiiiuu) // GL_ANGLE_framebuffer_multisample -GO(glRenderbufferStorageMultisampleANGLE, vFilill) +GO(glRenderbufferStorageMultisampleANGLE, vFuiuii) // GL_ANGLE_instanced_arrays -GO(glDrawArraysInstancedANGLE, vFiill) -GO(glDrawElementsInstancedANGLE, vFilipl) +GO(glDrawArraysInstancedANGLE, vFuiii) +GO(glDrawElementsInstancedANGLE, vFuiupi) GO(glVertexAttribDivisorANGLE, vFuu) // GL_ANGLE_timer_query @@ -3533,63 +3546,63 @@ GO(glIsQueryANGLE, iFu) GO(glQueryCounterANGLE, vFui) // GL_APPLE_copy_texture_levels -GO(glCopyTextureLevelsAPPLE, vFuuil) +GO(glCopyTextureLevelsAPPLE, vFuuii) // GL_APPLE_framebuffer_multisample -GO(glRenderbufferStorageMultisampleAPPLE, vFilill) +GO(glRenderbufferStorageMultisampleAPPLE, vFuiuii) // GL_APPLE_sync -GO(glFenceSyncAPPLE, pFiu) -GO(glIsSyncAPPLE, iFp) +GO(glFenceSyncAPPLE, pFuu) +GO(glIsSyncAPPLE, CFp) GO(glDeleteSyncAPPLE, vFp) -GO(glClientWaitSyncAPPLE, iFpuU) +GO(glClientWaitSyncAPPLE, uFpuU) GO(glWaitSyncAPPLE, vFpuU) -GO(glGetInteger64vAPPLE, vFip) -GO(glGetSyncivAPPLE, vFpilpp) +GO(glGetInteger64vAPPLE, vFup) +GO(glGetSyncivAPPLE, vFpuipp) // GL_EXT_base_instance -GO(glDrawArraysInstancedBaseInstanceEXT, vFiillu) -GO(glDrawElementsInstancedBaseInstanceEXT, vFiliplu) -GO(glDrawElementsInstancedBaseVertexBaseInstanceEXT, vFilipliu) +GO(glDrawArraysInstancedBaseInstanceEXT, vFuiiiu) +GO(glDrawElementsInstancedBaseInstanceEXT, vFuiupiu) +GO(glDrawElementsInstancedBaseVertexBaseInstanceEXT, vFuiupiiu) // GL_EXT_blend_func_extended GO(glBindFragDataLocationIndexedEXT, vFuuup) -GO(glGetProgramResourceLocationIndexEXT, iFuip) +GO(glGetProgramResourceLocationIndexEXT, iFuup) GO(glGetFragDataIndexEXT, iFup) // GL_EXT_buffer_storage -GO(glBufferStorageEXT, vFilpu) +GO(glBufferStorageEXT, vFulpu) // GL_EXT_clear_texture -GO(glClearTexImageEXT, vFuiiip) -GO(glClearTexSubImageEXT, vFuiiiillliip) +GO(glClearTexImageEXT, vFuiuup) +GO(glClearTexSubImageEXT, vFuiiiiiiiuup) // GL_EXT_copy_image -GO(glCopyImageSubDataEXT, vFuiiiiiuiiiiilll) +GO(glCopyImageSubDataEXT, vFuuiiiiuuiiiiiii) // GL_EXT_draw_buffers -GO(glDrawBuffersEXT, vFlp) +GO(glDrawBuffersEXT, vFip) // GL_EXT_draw_buffers_indexed -GO(glEnableiEXT, vFiu) -GO(glDisableiEXT, vFiu) -GO(glBlendEquationiEXT, vFui) -GO(glBlendEquationSeparateiEXT, vFuii) -GO(glBlendFunciEXT, vFuii) -GO(glBlendFuncSeparateiEXT, vFuiiii) -GO(glColorMaskiEXT, vFuiiii) -GO(glIsEnablediEXT, iFui) +GO(glEnableiEXT, vFuu) +GO(glDisableiEXT, vFuu) +GO(glBlendEquationiEXT, vFuu) +GO(glBlendEquationSeparateiEXT, vFuuu) +GO(glBlendFunciEXT, vFuuu) +GO(glBlendFuncSeparateiEXT, vFuuuuu) +GO(glColorMaskiEXT, vFuCCCC) +GO(glIsEnablediEXT, CFuu) // GL_EXT_draw_elements_base_vertex -GO(glDrawElementsBaseVertexEXT, vFilipi) -GO(glDrawRangeElementsBaseVertexEXT, vFilulipi) -GO(glDrawElementsInstancedBaseVertexEXT, vFilipli) +GO(glDrawElementsBaseVertexEXT, vFuiupi) +GO(glDrawRangeElementsBaseVertexEXT, vFuuuiupi) +GO(glDrawElementsInstancedBaseVertexEXT, vFuiupii) // GL_OES_draw_elements_base_vertex -GO(glDrawElementsBaseVertexOES, vFilipi) -GO(glDrawRangeElementsBaseVertexOES, vFiuulipi) -GO(glDrawElementsInstancedBaseVertexOES, vFilipli) -GO(glMultiDrawElementsBaseVertexEXT, vFipiplp) +GO(glDrawElementsBaseVertexOES, vFuiupi) +GO(glDrawRangeElementsBaseVertexOES, vFuuuiupi) +GO(glDrawElementsInstancedBaseVertexOES, vFuiupii) +GO(glMultiDrawElementsBaseVertexEXT, vFupupip) // GL_EXT_fragment_lighting GO(glFragmentLightModeliEXT, vFii) @@ -3615,29 +3628,29 @@ GO(glLightEnviEXT, vFii) GO(glVertexAttribDivisorEXT, vFuu) // GL_EXT_map_buffer_range -GO(glMapBufferRangeEXT, pFillu) -GO(glFlushMappedBufferRangeEXT, vFill) +GO(glMapBufferRangeEXT, pFullu) +GO(glFlushMappedBufferRangeEXT, vFull) // GL_EXT_multi_draw_indirect -GO(glMultiDrawArraysIndirectEXT, vFipll) -GO(glMultiDrawElementsIndirectEXT, vFiipll) +GO(glMultiDrawArraysIndirectEXT, vFupii) +GO(glMultiDrawElementsIndirectEXT, vFuupii) // GL_EXT_multiview_draw_buffers -GO(glReadBufferIndexedEXT, vFii) +GO(glReadBufferIndexedEXT, vFui) GO(glDrawBuffersIndexedEXT, vFipp) -GO(glGetIntegeri_vEXT, vFiup) +GO(glGetIntegeri_vEXT, vFuup) // GL_EXT_scene_marker GO(glBeginSceneEXT, vFv) GO(glEndSceneEXT, vFv) // GL_EXT_shader_pixel_local_storage2 -GO(glFramebufferPixelLocalStorageSizeEXT, vFul) -GO(glGetFramebufferPixelLocalStorageSizeEXT, lFu) -GO(glClearPixelLocalStorageuiEXT, vFllp) +GO(glFramebufferPixelLocalStorageSizeEXT, vFui) +GO(glGetFramebufferPixelLocalStorageSizeEXT, iFu) +GO(glClearPixelLocalStorageuiEXT, vFiip) // GL_EXT_sparse_texture -GO(glTexPageCommitmentEXT, vFiiiiillli) +GO(glTexPageCommitmentEXT, vFuiiiiiiiC) // GL_EXT_texture_storage GO(glTexStorage1DEXT, vFuiui) @@ -3645,7 +3658,7 @@ GO(glTexStorage2DEXT, vFuiuii) GO(glTexStorage3DEXT, vFuiuiii) // GL_EXT_texture_view -GO(glTextureViewEXT, vFuiuiuuuu) +GO(glTextureViewEXT, vFuuuuuuuu) // GL_EXT_vertex_array_setXXX GO(glCreateArraySetExt, pFv) @@ -3658,7 +3671,7 @@ GO(glTexScissorFuncINTEL, vFiii) // GL_NVX_linked_gpu_multicast GO(glLGPUNamedBufferSubDataNVX, vFuullp) -GO(glLGPUCopyImageSubDataNVX, vFuuuiiiiiuiiiiilll) +GO(glLGPUCopyImageSubDataNVX, vFuuuuiiiiuuiiiiiii) GO(glLGPUInterlockNVX, vFv) // GL_NV_3dvision_settings @@ -3666,34 +3679,34 @@ GO(glStereoParameteriNV, vFii) GO(glStereoParameterfNV, vFif) // GL_NV_copy_buffer -GO(glCopyBufferSubDataNV, vFiilll) +GO(glCopyBufferSubDataNV, vFuulll) // GL_NV_draw_buffers -GO(glDrawBuffersNV, vFlp) +GO(glDrawBuffersNV, vFip) // GL_NV_draw_instanced -GO(glDrawArraysInstancedNV, vFiill) -GO(glDrawElementsInstancedNV, vFilipl) +GO(glDrawArraysInstancedNV, vFuiii) +GO(glDrawElementsInstancedNV, vFuiupi) // GL_NV_framebuffer_blit -GO(glBlitFramebufferNV, vFiiiiiiiiui) +GO(glBlitFramebufferNV, vFiiiiiiiiuu) // GL_NV_framebuffer_multisample -GO(glRenderbufferStorageMultisampleNV, vFilill) +GO(glRenderbufferStorageMultisampleNV, vFuiuii) // GL_NV_instanced_arrays GO(glVertexAttribDivisorNV, vFuu) // GL_NV_non_square_matrices -GO(glUniformMatrix2x3fvNV, vFilip) -GO(glUniformMatrix3x2fvNV, vFilip) -GO(glUniformMatrix2x4fvNV, vFilip) -GO(glUniformMatrix4x2fvNV, vFilip) -GO(glUniformMatrix3x4fvNV, vFilip) -GO(glUniformMatrix4x3fvNV, vFilip) +GO(glUniformMatrix2x3fvNV, vFiiCp) +GO(glUniformMatrix3x2fvNV, vFiiCp) +GO(glUniformMatrix2x4fvNV, vFiiCp) +GO(glUniformMatrix4x2fvNV, vFiiCp) +GO(glUniformMatrix3x4fvNV, vFiiCp) +GO(glUniformMatrix4x3fvNV, vFiiCp) // GL_NV_polygon_mode -GO(glPolygonModeNV, vFii) +GO(glPolygonModeNV, vFuu) // GL_NV_texture_array GO(glTexImage3DNV, vFiiillliiip) @@ -3704,28 +3717,28 @@ GO(glCompressedTexSubImage3DNV, vFiiiiilllilp) GO(glFramebufferTextureLayerNV, vFiiuii) // GL_NV_viewport_array -GO(glViewportArrayvNV, vFulp) +GO(glViewportArrayvNV, vFuip) GO(glViewportIndexedfNV, vFuffff) GO(glViewportIndexedfvNV, vFup) -GO(glScissorArrayvNV, vFulp) -GO(glScissorIndexedNV, vFuiill) +GO(glScissorArrayvNV, vFuip) +GO(glScissorIndexedNV, vFuiiii) GO(glScissorIndexedvNV, vFup) -GO(glDepthRangeArrayfvNV, vFulp) +GO(glDepthRangeArrayfvNV, vFuip) GO(glDepthRangeIndexedfNV, vFuff) -GO(glGetFloati_vNV, vFiup) -GO(glEnableiNV, vFiu) -GO(glDisableiNV, vFiu) -GO(glIsEnablediNV, iFiu) +GO(glGetFloati_vNV, vFuup) +GO(glEnableiNV, vFuu) +GO(glDisableiNV, vFuu) +GO(glIsEnablediNV, CFuu) // GL_OVR_multiview_multisampled_render_to_texture -GO(glFramebufferTextureMultisampleMultiviewOVR, vFiiuilil) +GO(glFramebufferTextureMultisampleMultiviewOVR, vFuuuiiii) // GL_QCOM_alpha_test -GO(glAlphaFuncQCOM, vFif) +GO(glAlphaFuncQCOM, vFuf) // GL_QCOM_driver_control -GO(glGetDriverControlsQCOM, vFplp) -GO(glGetDriverControlStringQCOM, vFulpp) +GO(glGetDriverControlsQCOM, vFpip) +GO(glGetDriverControlStringQCOM, vFuipp) GO(glEnableDriverControlQCOM, vFu) GO(glDisableDriverControlQCOM, vFu) @@ -3734,16 +3747,16 @@ GO(glExtGetTexturesQCOM, vFpip) GO(glExtGetBuffersQCOM, vFpip) GO(glExtGetRenderbuffersQCOM, vFpip) GO(glExtGetFramebuffersQCOM, vFpip) -GO(glExtGetTexLevelParameterivQCOM, vFuiiip) -GO(glExtTexObjectStateOverrideiQCOM, vFiii) -GO(glExtGetTexSubImageQCOM, vFiiiiillliip) -GO(glExtGetBufferPointervQCOM, vFip) +GO(glExtGetTexLevelParameterivQCOM, vFuuiup) +GO(glExtTexObjectStateOverrideiQCOM, vFuui) +GO(glExtGetTexSubImageQCOM, vFuiiiiiiiuup) +GO(glExtGetBufferPointervQCOM, vFup) // GL_QCOM_extended_get2 GO(glExtGetShadersQCOM, vFpip) GO(glExtGetProgramsQCOM, vFpip) -GO(glExtIsProgramBinaryQCOM, iFu) -GO(glExtGetProgramBinarySourceQCOM, vFuipp) +GO(glExtIsProgramBinaryQCOM, CFu) +GO(glExtGetProgramBinarySourceQCOM, vFuupp) // GL_QCOM_framebuffer_foveated GO(glFramebufferFoveationConfigQCOM, vFuuuup) @@ -3915,12 +3928,12 @@ GO(wglSwapIntervalEXT, iFi) GO(wglGetSwapIntervalEXT, iFv) // GL_MESA_framebuffer_flip_y -GO(glFramebufferParameteriMESA, vFiii) -GO(glGetFramebufferParameterivMESA, vFiip) +GO(glFramebufferParameteriMESA, vFuui) +GO(glGetFramebufferParameterivMESA, vFuup) // GL_NVX_gpu_multicast2 GO(glUploadGpuMaskNVX, vFu) -GO(glMulticastViewportArrayvNVX, vFuulp) +GO(glMulticastViewportArrayvNVX, vFuuip) GO(glMulticastViewportPositionWScaleNVX, vFuuff) GO(glMulticastScissorArrayvNVX, vFuuip) GO(glAsyncCopyBufferSubDataNVX, uFippuuuulllipp) @@ -3928,124 +3941,132 @@ GO(glAsyncCopyImageSubDataNVX, uFippuuuuiiiiuuiiiiiiiipp) // GL_NVX_progress_fence GO(glCreateProgressFenceNVX, uFv) -GO(glSignalSemaphoreui64NVX, vFulpp) +GO(glSignalSemaphoreui64NVX, vFuipp) GO(glWaitSemaphoreui64NVX, vFuipp) GO(glClientWaitSemaphoreui64NVX, vFipp) // GL_NV_memory_object_sparse -GO(glBufferPageCommitmentMemNV, vFulluLC) -GO(glTexPageCommitmentMemNV, vFuiiiiiiiiuLC) -GO(glNamedBufferPageCommitmentMemNV, vFulluLC) -GO(glTexturePageCommitmentMemNV, vFuiiiiiiiiuLC) +GO(glBufferPageCommitmentMemNV, vFulluUC) +GO(glTexPageCommitmentMemNV, vFuiiiiiiiiuUC) +GO(glNamedBufferPageCommitmentMemNV, vFulluUC) +GO(glTexturePageCommitmentMemNV, vFuiiiiiiiiuUC) // GL_NV_vdpau_interop2 GO(glVDPAURegisterVideoSurfaceWithPictureStructureNV, lFpuipC) // Base EGL -GO(eglBindAPI, iFi) -GO(eglBindTexImage, iFppi) -GO(eglChooseConfig, iFpppip) +GO(eglBindAPI, uFu) +GO(eglBindTexImage, uFppi) +GO(eglChooseConfig, uFpppip) GO(eglClientWaitSync, iFppiU) -GO(eglCopyBuffers, iFppp) +GO(eglCopyBuffers, uFppL) GO(eglCreateContext, pFpppp) -GO(eglCreateImage, pFppuup) -GO(eglCreatePbufferFromClientBuffer, pFpippp) +GO(eglCreateImage, pFppupp) +GO(eglCreatePbufferFromClientBuffer, pFpuppp) GO(eglCreatePbufferSurface, pFppp) -GO(eglCreatePixmapSurface, pFpppp) +GO(eglCreatePixmapSurface, pFppLp) GO(eglCreatePlatformPixmapSurface, pFpppp) GO(eglCreatePlatformWindowSurface, pFpppp) GO(eglCreateSync, pFpup) -GO(eglCreateWindowSurface, pFpppp) -GO(eglDestroyContext, iFpp) -GO(eglDestroyImage, iFpp) -GO(eglDestroySurface, iFpp) -GO(eglDestroySync, iFpp) -GO(eglGetConfigAttrib, iFppip) -GO(eglGetConfigs, iFppip) +GO(eglCreateWindowSurface, pFppLp) +GO(eglDestroyContext, uFpp) +GO(eglDestroyImage, uFpp) +GO(eglDestroySurface, uFpp) +GO(eglDestroySync, uFpp) +GO(eglGetConfigAttrib, uFppip) +GO(eglGetConfigs, uFppip) GO(eglGetCurrentContext, pFv) GO(eglGetCurrentDisplay, pFv) GO(eglGetCurrentSurface, pFi) GO(eglGetDisplay, pFp) GO(eglGetError, iFv) -GO(eglGetPlatformDisplay, pFppp) +GO(eglGetPlatformDisplay, pFupp) //GOM(eglGetProcAddress, pFEp) -GO(eglGetSyncAttrib, iFppip) -GO(eglInitialize, iFppp) -GO(eglMakeCurrent, iFpppp) -GO(eglQueryAPI, iFv) -GO(eglQueryContext, iFppip) +GO(eglGetSyncAttrib, uFppip) +GO(eglInitialize, uFppp) +GO(eglMakeCurrent, uFpppp) +GO(eglQueryAPI, uFv) +GO(eglQueryContext, uFppip) GO(eglQueryString, pFpi) -GO(eglQuerySurface, iFppip) -GO(eglReleaseTexImage, iFppi) -GO(eglReleaseThread, iFv) -GO(eglSurfaceAttrib, iFppii) -GO(eglSwapBuffers, iFpp) -GO(eglSwapInterval, iFpi) -GO(eglTerminate, iFp) -GO(eglWaitClient, iFv) -GO(eglWaitGL, iFv) -GO(eglWaitNative, iFi) -GO(eglWaitSync, iFppi) +GO(eglQuerySurface, uFppip) +GO(eglReleaseTexImage, uFppi) +GO(eglReleaseThread, uFv) +GO(eglSurfaceAttrib, uFppii) +GO(eglSwapBuffers, uFpp) +GO(eglSwapInterval, uFpi) +GO(eglTerminate, uFp) +GO(eglWaitClient, uFv) +GO(eglWaitGL, uFv) +GO(eglWaitNative, uFi) +GO(eglWaitSync, uFppi) // EGL_KHR_debug GOM(eglDebugMessageControlKHR, iFEpp) -GO(eglQueryDebugKHR, iFip) +GO(eglQueryDebugKHR, uFip) GO(eglLabelObjectKHR, iFpupp) // EGL_MESA_image_dma_buf_export -GO(eglExportDMABUFImageQueryMESA, iFppppp) -GO(eglExportDMABUFImageMESA, iFppppp) +GO(eglExportDMABUFImageQueryMESA, uFppppp) +GO(eglExportDMABUFImageMESA, uFppppp) // EGL_ANGLE_sync_control_rate -GO(eglGetMscRateANGLE, iFpppp) +GO(eglGetMscRateANGLE, uFpppp) // EGL_CHROMIUM_sync_control -GO(eglGetSyncValuesCHROMIUM, iFppppp) +GO(eglGetSyncValuesCHROMIUM, uFppppp) // EGL_EXT_device_query -GO(eglQueryDeviceAttribEXT, iFpip) +GO(eglQueryDeviceAttribEXT, uFpip) GO(eglQueryDeviceStringEXT, pFpi) -GO(eglQueryDisplayAttribEXT, iFpip) +GO(eglQueryDisplayAttribEXT, uFpip) // EGL_EXT_device_enumeration -GO(eglQueryDevicesEXT, iFipp) +GO(eglQueryDevicesEXT, uFipp) + +// EGL_EXT_device_persistent_id +GO(eglQueryDeviceBinaryEXT, uFpiipp) // EGL_EXT_image_dma_buf_import_modifiers -GO(eglQueryDmaBufFormatsEXT, iFpipp) -GO(eglQueryDmaBufModifiersEXT, iFpiippp) +GO(eglQueryDmaBufFormatsEXT, uFpipp) +GO(eglQueryDmaBufModifiersEXT, uFpiippp) // EGL_ANDROID_blob_cache GOM(eglSetBlobCacheFuncsANDROID, vFEppp) // EGL_KHR_swap_buffers_with_damage -GO(eglSwapBuffersWithDamageKHR, iFpppi) +GO(eglSwapBuffersWithDamageKHR, uFpppi) // EGL_KHR_wait_sync GO(eglWaitSyncKHR, iFppi) // EGL_KHR_image_base GO(eglCreateImageKHR, pFppupp) -GO(eglDestroyImageKHR, iFpp) +GO(eglDestroyImageKHR, uFpp) // EGL_KHR_fence_sync GO(eglCreateSyncKHR, pFpup) -GO(eglDestroySyncKHR, iFpp) +GO(eglDestroySyncKHR, uFpp) GO(eglClientWaitSyncKHR, iFppiU) -GO(eglGetSyncAttribKHR, iFppip) +GO(eglGetSyncAttribKHR, uFppip) // EGL_ANDROID_native_fence_sync GO(eglDupNativeFenceFDANDROID, iFpp) // EGL_NV_post_sub_buffer -GO(eglPostSubBufferNV, iFppiiii) +GO(eglPostSubBufferNV, uFppiiii) + +// EGL_EXT_platform_base +GO(eglGetPlatformDisplayEXT, pFupp) +GO(eglCreatePlatformWindowSurfaceEXT, pFpppp) +GO(eglCreatePlatformPixmapSurfaceEXT, pFpppp) // GL_EXT_clip_control GO(glClipControlEXT, vFuu) // GL_EXT_disjoint_timer_query -GO(glGenQueriesEXT, vFlp) -GO(glDeleteQueriesEXT, vFlp) -GO(glIsQueryEXT, iFu) +GO(glGenQueriesEXT, vFip) +GO(glDeleteQueriesEXT, vFip) +GO(glIsQueryEXT, CFu) GO(glBeginQueryEXT, vFuu) GO(glEndQueryEXT, vFu) GO(glQueryCounterEXT, vFuu) @@ -4059,4 +4080,15 @@ GO(glGetInteger64vEXT, vFup) // GL_OES_mapbuffer GO(glGetBufferPointervOES, vFuup) GO(glMapBufferOES, pFuu) -GO(glUnmapBufferOES, iFu) +GO(glUnmapBufferOES, CFu) + +// GLX_NV_copy_buffer +GO(glXCopyBufferSubDataNV, vFpppuulll) +GO(glXNamedCopyBufferSubDataNV, vFpppuulll) + +// GLX_NV_delay_before_swap +GO(glXDelayBeforeSwapNV, iFpLf) + +// GL_ARB_viewport_array +GO(glDepthRangeArraydvNV, vFuip) +GO(glDepthRangeIndexeddNV, vFudd) diff --git a/src/wrapped/wrappedlibglu.c b/src/wrapped/wrappedlibglu.c index c3467ba..d575261 100644 --- a/src/wrapped/wrappedlibglu.c +++ b/src/wrapped/wrappedlibglu.c @@ -110,12 +110,12 @@ static void* findglu_callback5Fct(void* fct) // except for GLU_TESS_COMBINE and GLU_TESS_COMBINE_DATA #define GLU_TESS_COMBINE 100105 #define GLU_TESS_COMBINE_DATA 100111 -void EXPORT my_gluQuadricCallback(x64emu_t* emu, void* a, int32_t b, void* cb) +void EXPORT my_gluQuadricCallback(x64emu_t* emu, void* a, uint32_t b, void* cb) { (void)emu; my->gluQuadricCallback(a, b, findglu_callbackFct(cb)); } -void EXPORT my_gluTessCallback(x64emu_t* emu, void* a, int32_t b, void* cb) +void EXPORT my_gluTessCallback(x64emu_t* emu, void* a, uint32_t b, void* cb) { (void)emu; if(b==GLU_TESS_COMBINE) @@ -125,7 +125,7 @@ void EXPORT my_gluTessCallback(x64emu_t* emu, void* a, int32_t b, void* cb) else my->gluTessCallback(a, b, findglu_callbackFct(cb)); } -void EXPORT my_gluNurbsCallback(x64emu_t* emu, void* a, int32_t b, void* cb) +void EXPORT my_gluNurbsCallback(x64emu_t* emu, void* a, uint32_t b, void* cb) { (void)emu; my->gluNurbsCallback(a, b, findglu_callbackFct(cb)); diff --git a/src/wrapped/wrappedlibglu_private.h b/src/wrapped/wrappedlibglu_private.h index a7c6b4a..d40c079 100644 --- a/src/wrapped/wrappedlibglu_private.h +++ b/src/wrapped/wrappedlibglu_private.h @@ -1,63 +1,64 @@ -#if defined(GO) && defined(GOM) && defined(GO2) && defined(DATA) +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif GO(gluBeginCurve,vFp) -GO(gluBeginPolygon,vFp) -GO(gluBeginSurface,vFp) -GO(gluBeginTrim,vFp) -GO(gluBuild1DMipmapLevels,iFiiiiiiiip) -GO(gluBuild1DMipmaps,iFiiiiip) -GO(gluBuild2DMipmapLevels,iFiiiiiiiiip) -GO(gluBuild2DMipmaps,iFiiiiiip) -GO(gluBuild3DMipmapLevels,iFiiiiiiiiiip) -GO(gluBuild3DMipmaps,iFiiiiiiip) -GO(gluCheckExtension,iFpp) -GO(gluCylinder,vFpdddii) -GO(gluDeleteNurbsRenderer,vFp) -GO(gluDeleteQuadric,vFp) -GO(gluDeleteTess,vFp) -GO(gluDisk,vFpddii) -GO(gluEndCurve,vFp) -GO(gluEndPolygon,vFp) -GO(gluEndSurface,vFp) -GO(gluEndTrim,vFp) -GO(gluErrorString,pFi) -GO(gluGetNurbsProperty,vFpip) -GO(gluGetString,pFi) -GO(gluGetTessProperty,vFpip) -GO(gluLoadSamplingMatrices,vFpppp) -GO(gluLookAt,vFddddddddd) -GO(gluNewNurbsRenderer,pFv) -GO(gluNewQuadric,pFv) -GO(gluNewTess,pFv) -GO(gluNextContour,vFpi) -GOM(gluNurbsCallback,vFEpip) -GO(gluNurbsCallbackData,vFpp) // to check -GO(gluNurbsCallbackDataEXT,vFpp) // to check -GO(gluNurbsCurve,vFpipipii) -GO(gluNurbsProperty,vFpif) -GO(gluNurbsSurface,vFpipipiipiii) -GO(gluOrtho2D,vFdddd) -GO(gluPartialDisk,vFpddiidd) -GO(gluPerspective,vFdddd) -GO(gluPickMatrix,vFddddp) -GO(gluProject,iFdddpppppp) -GO(gluPwlCurve,vFpipii) -GOM(gluQuadricCallback,vFEpip) -GO(gluQuadricDrawStyle,vFpi) -GO(gluQuadricNormals,vFpi) -GO(gluQuadricOrientation,vFpi) -GO(gluQuadricTexture,vFpi) -GO(gluScaleImage,iFiiiipiiip) -GO(gluSphere,vFpdii) -GO(gluTessBeginContour,vFp) -GO(gluTessBeginPolygon,vFpp) -GOM(gluTessCallback,vFEpip) -GO(gluTessEndContour,vFp) -GO(gluTessEndPolygon,vFp) -GO(gluTessNormal,vFpddd) -GO(gluTessProperty,vFpid) -GO(gluTessVertex,vFppp) -GO(gluUnProject,iFdddpppppp) -GO(gluUnProject4,iFddddpppddpppp) +GO(gluBeginPolygon, vFp) +GO(gluBeginSurface, vFp) +GO(gluBeginTrim, vFp) +GO(gluBuild1DMipmapLevels, iFuiiuuiiip) +GO(gluBuild1DMipmaps, iFuiiuup) +GO(gluBuild2DMipmapLevels, iFuiiiuuiiip) +GO(gluBuild2DMipmaps, iFuiiiuup) +GO(gluBuild3DMipmapLevels, iFuiiiiuuiiip) +GO(gluBuild3DMipmaps, iFuiiiiuup) +GO(gluCheckExtension, CFpp) +GO(gluCylinder, vFpdddii) +GO(gluDeleteNurbsRenderer, vFp) +GO(gluDeleteQuadric, vFp) +GO(gluDeleteTess, vFp) +GO(gluDisk, vFpddii) +GO(gluEndCurve, vFp) +GO(gluEndPolygon, vFp) +GO(gluEndSurface, vFp) +GO(gluEndTrim, vFp) +GO(gluErrorString, pFu) +GO(gluGetNurbsProperty, vFpup) +GO(gluGetString, pFu) +GO(gluGetTessProperty, vFpup) +GO(gluLoadSamplingMatrices, vFpppp) +GO(gluLookAt, vFddddddddd) +GO(gluNewNurbsRenderer, pFv) +GO(gluNewQuadric, pFv) +GO(gluNewTess, pFv) +GO(gluNextContour, vFpu) +GOM(gluNurbsCallback, vFEpup) +GO(gluNurbsCallbackData, vFpp) +GO(gluNurbsCallbackDataEXT, vFpp) +GO(gluNurbsCurve, vFpipipiu) +GO(gluNurbsProperty, vFpuf) +GO(gluNurbsSurface, vFpipipiipiiu) +GO(gluOrtho2D, vFdddd) +GO(gluPartialDisk, vFpddiidd) +GO(gluPerspective, vFdddd) +GO(gluPickMatrix, vFddddp) +GO(gluProject, iFdddpppppp) +GO(gluPwlCurve, vFpipiu) +GOM(gluQuadricCallback, vFEpup) +GO(gluQuadricDrawStyle, vFpu) +GO(gluQuadricNormals, vFpu) +GO(gluQuadricOrientation, vFpu) +GO(gluQuadricTexture, vFpC) +GO(gluScaleImage, iFuiiupiiup) +GO(gluSphere, vFpdii) +GO(gluTessBeginContour, vFp) +GO(gluTessBeginPolygon, vFpp) +GOM(gluTessCallback, vFEpup) +GO(gluTessEndContour, vFp) +GO(gluTessEndPolygon, vFp) +GO(gluTessNormal, vFpddd) +GO(gluTessProperty, vFpud) +GO(gluTessVertex, vFppp) +GO(gluUnProject, iFdddpppppp) +GO(gluUnProject4, iFddddpppddpppp) -#endif \ No newline at end of file diff --git a/src/wrapped/wrappedlibglx.c b/src/wrapped/wrappedlibglx.c index 6b30a79..a6442bb 100644 --- a/src/wrapped/wrappedlibglx.c +++ b/src/wrapped/wrappedlibglx.c @@ -39,14 +39,14 @@ EXPORT void* myx_glXGetProcAddress(x64emu_t* emu, void* name) { khint_t k; const char* rname = (const char*)name; - return getGLProcAddress(emu, (glprocaddress_t)my->glXGetProcAddress, rname); + return getGLProcAddress(emu, NULL, (glprocaddress_t)my->glXGetProcAddress, rname); } EXPORT void* myx_glXGetProcAddressARB(x64emu_t* emu, void* name) { khint_t k; const char* rname = (const char*)name; - return getGLProcAddress(emu, (glprocaddress_t)my->glXGetProcAddressARB, rname); + return getGLProcAddress(emu, NULL, (glprocaddress_t)my->glXGetProcAddressARB, rname); } #define ALTMY myx_ diff --git a/src/wrapped/wrappedlibglxnvidia.c b/src/wrapped/wrappedlibglxnvidia.c new file mode 100644 index 0000000..808a94a --- /dev/null +++ b/src/wrapped/wrappedlibglxnvidia.c @@ -0,0 +1,255 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "box64context.h" +#include "librarian.h" +#include "callback.h" +#include "gltools.h" + +const char* libglxnvidiaName = "libGLX_nvidia.so.0"; +#define ALTNAME "libGLX_nvidia.so" +#define LIBNAME libglxnvidia + +#include "generated/wrappedlibglxnvidiatypes.h" + +#include "wrappercallback.h" + +// FIXME: old wrapped* type of file, cannot use generated/wrappedlibgltypes.h + +EXPORT void* mynv_glXGetProcAddress(x64emu_t* emu, void* name) +{ + pFp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXGetProcAddress; + khint_t k; + const char* rname = (const char*)name; + return getGLProcAddress(emu, "mynv_", (void*)fnc, rname); +} +EXPORT void* mynv_glXGetProcAddressARB(x64emu_t* emu, void* name) __attribute__((alias("mynv_glXGetProcAddress"))); + +typedef int (*iFi_t)(int); +typedef void (*vFpp_t)(void*, void*); +typedef void (*vFppp_t)(void*, void*, void*); +typedef void (*vFppi_t)(void*, void*, int); +typedef void*(*pFp_t)(void*); +typedef void (*debugProc_t)(int32_t, int32_t, uint32_t, int32_t, int32_t, void*, void*); + +typedef struct gl_wrappers_s { + glprocaddress_t procaddress; + kh_symbolmap_t *glwrappers; // the map of wrapper for glProcs (for GLX or SDL1/2) + kh_symbolmap_t *glmymap; // link to the mysymbolmap of libGL +} gl_wrappers_t; + +KHASH_MAP_INIT_INT64(gl_wrappers, gl_wrappers_t*) + +static kh_gl_wrappers_t *gl_wrappers = NULL; + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// debug_callback ... +#define GO(A) \ +static uintptr_t my_debug_callback_fct_##A = 0; \ +static void my_debug_callback_##A(int32_t a, int32_t b, uint32_t c, int32_t d, int32_t e, const char* f, const void* g) \ +{ \ + RunFunctionFmt(my_debug_callback_fct_##A, "iiuiipp", a, b, c, d, e, f, g); \ +} +SUPER() +#undef GO +static void* find_debug_callback_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_debug_callback_fct_##A == (uintptr_t)fct) return my_debug_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_debug_callback_fct_##A == 0) {my_debug_callback_fct_##A = (uintptr_t)fct; return my_debug_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL debug_callback callback\n"); + return NULL; +} +// egl_debug_callback ... +#define GO(A) \ +static uintptr_t my_egl_debug_callback_fct_##A = 0; \ + static void my_egl_debug_callback_##A(int a, void* b, int c, void* d, void* e, const char* f) \ +{ \ + RunFunctionFmt(my_egl_debug_callback_fct_##A, "ipippp", a, b, c, d, e, f); \ +} +SUPER() +#undef GO +static void* find_egl_debug_callback_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_egl_debug_callback_fct_##A == (uintptr_t)fct) return my_egl_debug_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_egl_debug_callback_fct_##A == 0) {my_egl_debug_callback_fct_##A = (uintptr_t)fct; return my_egl_debug_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL egl_debug_callback callback\n"); + return NULL; +} +// program_callback ... +#define GO(A) \ +static uintptr_t my_program_callback_fct_##A = 0; \ +static void my_program_callback_##A(int32_t a, void* b) \ +{ \ + RunFunctionFmt(my_program_callback_fct_##A, "ip", a, b); \ +} +SUPER() +#undef GO +static void* find_program_callback_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_program_callback_fct_##A == (uintptr_t)fct) return my_program_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_program_callback_fct_##A == 0) {my_program_callback_fct_##A = (uintptr_t)fct; return my_program_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL program_callback callback\n"); + return NULL; +} +// set_blob_func ... +#define GO(A) \ +static uintptr_t my_set_blob_func_fct_##A = 0; \ +static void my_set_blob_func_##A(void* a, ssize_t b, void* c, ssize_t d) \ +{ \ + RunFunctionFmt(my_set_blob_func_fct_##A, "plpl", a, b, c, d); \ +} +SUPER() +#undef GO +static void* find_set_blob_func_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_set_blob_func_fct_##A == (uintptr_t)fct) return my_set_blob_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_set_blob_func_fct_##A == 0) {my_set_blob_func_fct_##A = (uintptr_t)fct; return my_set_blob_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL set_blob_func callback\n"); + return NULL; +} +// get_blob_func ... +#define GO(A) \ +static uintptr_t my_get_blob_func_fct_##A = 0; \ +static ssize_t my_get_blob_func_##A(void* a, ssize_t b, void* c, ssize_t d) \ +{ \ + return (ssize_t)RunFunctionFmt(my_get_blob_func_fct_##A, "plpl", a, b, c, d); \ +} +SUPER() +#undef GO +static void* find_get_blob_func_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_get_blob_func_fct_##A == (uintptr_t)fct) return my_get_blob_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_get_blob_func_fct_##A == 0) {my_get_blob_func_fct_##A = (uintptr_t)fct; return my_get_blob_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL get_blob_func callback\n"); + return NULL; +} +#undef SUPER +#define ALTMY mynv +#include "wrappedlib_init.h" + +// glDebugMessageCallback +EXPORT void mynv_glDebugMessageCallback(x64emu_t* emu, void* prod, void* param) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallback; + fnc(find_debug_callback_Fct(prod), param); +} +// glDebugMessageCallbackARB +EXPORT void mynv_glDebugMessageCallbackARB(x64emu_t* emu, void* prod, void* param) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallbackARB; + fnc(find_debug_callback_Fct(prod), param); +} +// glDebugMessageCallbackAMD +EXPORT void mynv_glDebugMessageCallbackAMD(x64emu_t* emu, void* prod, void* param) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallbackAMD; + fnc(find_debug_callback_Fct(prod), param); +} +// glDebugMessageCallbackKHR +EXPORT void mynv_glDebugMessageCallbackKHR(x64emu_t* emu, void* prod, void* param) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallbackKHR; + fnc(find_debug_callback_Fct(prod), param); +} +// eglDebugMessageControlKHR +EXPORT int mynv_eglDebugMessageControlKHR(x64emu_t* emu, void* prod, void* param) +{ + iFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->eglDebugMessageControlKHR; + return fnc(find_debug_callback_Fct(prod), param); +} +// eglSetBlobCacheFuncsANDROID ... +EXPORT void mynv_eglSetBlobCacheFuncsANDROID(x64emu_t* emu, void* dpy, void* set, void* get) \ +{ \ + vFppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->eglSetBlobCacheFuncsANDROID; + fnc(dpy, find_set_blob_func_Fct(set), find_get_blob_func_Fct(get)); +} +// glXSwapIntervalMESA ... +EXPORT int mynv_dummy_glXSwapIntervalMESA(int interval) +{ + return 5; // GLX_BAD_CONTEXT +} +EXPORT int mynv_glXSwapIntervalMESA(x64emu_t* emu, int interval) +{ + iFi_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXSwapIntervalMESA; + if(!fnc) fnc=mynv_dummy_glXSwapIntervalMESA; + return fnc(interval); +} +// glXSwapIntervalEXT ... +EXPORT void mynv_dummy_glXSwapIntervalEXT(void* dpy, void* drawable, int interval) {} +EXPORT void mynv_glXSwapIntervalEXT(x64emu_t* emu, void* dpy, void* drawable, int interval) +{ + vFppi_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXSwapIntervalEXT; + if(!fnc) fnc=mynv_dummy_glXSwapIntervalEXT; + fnc(dpy, drawable, interval); +} +// glProgramCallbackMESA ... +EXPORT void mynv_glProgramCallbackMESA(x64emu_t* emu, int t, void* f, void* data) +{ + vFipp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glProgramCallbackMESA; + fnc(t, find_program_callback_Fct(f), data); +} +void* my_GetVkProcAddr(x64emu_t* emu, void* name, void*(*getaddr)(void*)); // defined in wrappedvulkan.c +// glGetVkProcAddrNV ... +EXPORT void* mynv_glGetVkProcAddrNV(x64emu_t* emu, void* name) +{ + pFp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glGetVkProcAddrNV; + return my_GetVkProcAddr(emu, name, fnc); +} diff --git a/src/wrapped/wrappedlibglxnvidia_private.h b/src/wrapped/wrappedlibglxnvidia_private.h new file mode 100644 index 0000000..e24dc59 --- /dev/null +++ b/src/wrapped/wrappedlibglxnvidia_private.h @@ -0,0 +1,4094 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//VERSION_1_0 +GO(glAccum, vFuf) +GO(glAlphaFunc, vFuf) +GO(glBegin, vFu) +GO(glBitmap, vFiiffffp) +GO(glBlendFunc, vFuu) +GO(glCallList, vFu) +GO(glCallLists, vFiup) +GO(glClear, vFu) +GO(glClearAccum, vFffff) +GO(glClearColor, vFffff) +GO(glClearDepth, vFd) +GO(glClearIndex, vFf) +GO(glClearStencil, vFi) +GO(glClipPlane, vFup) +GO(glColor3b, vFccc) +GO(glColor3bv, vFp) +GO(glColor3d, vFddd) +GO(glColor3dv, vFp) +GO(glColor3f, vFfff) +GO(glColor3fv, vFp) +GO(glColor3i, vFiii) +GO(glColor3iv, vFp) +GO(glColor3s, vFwww) +GO(glColor3sv, vFp) +GO(glColor3ub, vFCCC) +GO(glColor3ubv, vFp) +GO(glColor3ui, vFuuu) +GO(glColor3uiv, vFp) +GO(glColor3us, vFWWW) +GO(glColor3usv, vFp) +GO(glColor4b, vFcccc) +GO(glColor4bv, vFp) +GO(glColor4d, vFdddd) +GO(glColor4dv, vFp) +GO(glColor4f, vFffff) +GO(glColor4fv, vFp) +GO(glColor4i, vFiiii) +GO(glColor4iv, vFp) +GO(glColor4s, vFwwww) +GO(glColor4sv, vFp) +GO(glColor4ub, vFCCCC) +GO(glColor4ubv, vFp) +GO(glColor4ui, vFuuuu) +GO(glColor4uiv, vFp) +GO(glColor4us, vFWWWW) +GO(glColor4usv, vFp) +GO(glColorMask, vFCCCC) +GO(glColorMaterial, vFuu) +GO(glCopyPixels, vFiiiiu) +GO(glCullFace, vFu) +GO(glDeleteLists, vFui) +GO(glDepthFunc, vFu) +GO(glDepthMask, vFC) +GO(glDepthRange, vFdd) +GO(glDisable, vFu) +GO(glDrawBuffer, vFu) +GO(glDrawPixels, vFiiuup) +GO(glEdgeFlag, vFC) +GO(glEdgeFlagv, vFp) +GO(glEnable, vFu) +GO(glEnd, vFv) +GO(glEndList, vFv) +GO(glEvalCoord1d, vFd) +GO(glEvalCoord1dv, vFp) +GO(glEvalCoord1f, vFf) +GO(glEvalCoord1fv, vFp) +GO(glEvalCoord2d, vFdd) +GO(glEvalCoord2dv, vFp) +GO(glEvalCoord2f, vFff) +GO(glEvalCoord2fv, vFp) +GO(glEvalMesh1, vFuii) +GO(glEvalMesh2, vFuiiii) +GO(glEvalPoint1, vFi) +GO(glEvalPoint2, vFii) +GO(glFeedbackBuffer, vFiup) +GO(glFinish, vFv) +GO(glFlush, vFv) +GO(glFogf, vFuf) +GO(glFogfv, vFup) +GO(glFogi, vFui) +GO(glFogiv, vFup) +GO(glFrontFace, vFu) +GO(glFrustum, vFdddddd) +GO(glGenLists, uFi) +GO(glGetBooleanv, vFup) +GO(glGetClipPlane, vFup) +GO(glGetDoublev, vFup) +GO(glGetError, uFv) +GO(glGetFloatv, vFup) +GO(glGetIntegerv, vFup) +GO(glGetLightfv, vFuup) +GO(glGetLightiv, vFuup) +GO(glGetMapdv, vFuup) +GO(glGetMapfv, vFuup) +GO(glGetMapiv, vFuup) +GO(glGetMaterialfv, vFuup) +GO(glGetMaterialiv, vFuup) +GO(glGetPixelMapfv, vFup) +GO(glGetPixelMapuiv, vFup) +GO(glGetPixelMapusv, vFup) +GO(glGetPolygonStipple, vFp) +GO(glGetString, pFu) +GO(glGetTexEnvfv, vFuup) +GO(glGetTexEnviv, vFuup) +GO(glGetTexGendv, vFuup) +GO(glGetTexGenfv, vFuup) +GO(glGetTexGeniv, vFuup) +GO(glGetTexImage, vFuiuup) +GO(glGetTexLevelParameterfv, vFuiup) +GO(glGetTexLevelParameteriv, vFuiup) +GO(glGetTexParameterfv, vFuup) +GO(glGetTexParameteriv, vFuup) +GO(glHint, vFuu) +GO(glIndexMask, vFu) +GO(glIndexd, vFd) +GO(glIndexdv, vFp) +GO(glIndexf, vFf) +GO(glIndexfv, vFp) +GO(glIndexi, vFi) +GO(glIndexiv, vFp) +GO(glIndexs, vFw) +GO(glIndexsv, vFp) +GO(glInitNames, vFv) +GO(glIsEnabled, CFu) +GO(glIsList, CFu) +GO(glLightModelf, vFuf) +GO(glLightModelfv, vFup) +GO(glLightModeli, vFui) +GO(glLightModeliv, vFup) +GO(glLightf, vFuuf) +GO(glLightfv, vFuup) +GO(glLighti, vFuui) +GO(glLightiv, vFuup) +GO(glLineStipple, vFiW) +GO(glLineWidth, vFf) +GO(glListBase, vFu) +GO(glLoadIdentity, vFv) +GO(glLoadMatrixd, vFp) +GO(glLoadMatrixf, vFp) +GO(glLoadName, vFu) +GO(glLogicOp, vFu) +GO(glMap1d, vFuddiip) +GO(glMap1f, vFuffiip) +GO(glMap2d, vFuddiiddiip) +GO(glMap2f, vFuffiiffiip) +GO(glMapGrid1d, vFidd) +GO(glMapGrid1f, vFiff) +GO(glMapGrid2d, vFiddidd) +GO(glMapGrid2f, vFiffiff) +GO(glMaterialf, vFuuf) +GO(glMaterialfv, vFuup) +GO(glMateriali, vFuui) +GO(glMaterialiv, vFuup) +GO(glMatrixMode, vFu) +GO(glMultMatrixd, vFp) +GO(glMultMatrixf, vFp) +GO(glNewList, vFuu) +GO(glNormal3b, vFccc) +GO(glNormal3bv, vFp) +GO(glNormal3d, vFddd) +GO(glNormal3dv, vFp) +GO(glNormal3f, vFfff) +GO(glNormal3fv, vFp) +GO(glNormal3i, vFiii) +GO(glNormal3iv, vFp) +GO(glNormal3s, vFwww) +GO(glNormal3sv, vFp) +GO(glOrtho, vFdddddd) +GO(glPassThrough, vFf) +GO(glPixelMapfv, vFuip) +GO(glPixelMapuiv, vFuip) +GO(glPixelMapusv, vFuip) +GO(glPixelStoref, vFuf) +GO(glPixelStorei, vFui) +GO(glPixelTransferf, vFuf) +GO(glPixelTransferi, vFui) +GO(glPixelZoom, vFff) +GO(glPointSize, vFf) +GO(glPolygonMode, vFuu) +GO(glPolygonStipple, vFp) +GO(glPopAttrib, vFv) +GO(glPopMatrix, vFv) +GO(glPopName, vFv) +GO(glPushAttrib, vFu) +GO(glPushMatrix, vFv) +GO(glPushName, vFu) +GO(glRasterPos2d, vFdd) +GO(glRasterPos2dv, vFp) +GO(glRasterPos2f, vFff) +GO(glRasterPos2fv, vFp) +GO(glRasterPos2i, vFii) +GO(glRasterPos2iv, vFp) +GO(glRasterPos2s, vFww) +GO(glRasterPos2sv, vFp) +GO(glRasterPos3d, vFddd) +GO(glRasterPos3dv, vFp) +GO(glRasterPos3f, vFfff) +GO(glRasterPos3fv, vFp) +GO(glRasterPos3i, vFiii) +GO(glRasterPos3iv, vFp) +GO(glRasterPos3s, vFwww) +GO(glRasterPos3sv, vFp) +GO(glRasterPos4d, vFdddd) +GO(glRasterPos4dv, vFp) +GO(glRasterPos4f, vFffff) +GO(glRasterPos4fv, vFp) +GO(glRasterPos4i, vFiiii) +GO(glRasterPos4iv, vFp) +GO(glRasterPos4s, vFwwww) +GO(glRasterPos4sv, vFp) +GO(glReadBuffer, vFu) +GO(glReadPixels, vFiiiiuup) +GO(glRectd, vFdddd) +GO(glRectdv, vFpp) +GO(glRectf, vFffff) +GO(glRectfv, vFpp) +GO(glRecti, vFiiii) +GO(glRectiv, vFpp) +GO(glRects, vFwwww) +GO(glRectsv, vFpp) +GO(glRenderMode, iFu) +GO(glRotated, vFdddd) +GO(glRotatef, vFffff) +GO(glScaled, vFddd) +GO(glScalef, vFfff) +GO(glScissor, vFiiii) +GO(glSelectBuffer, vFip) +GO(glShadeModel, vFu) +GO(glStencilFunc, vFuiu) +GO(glStencilMask, vFu) +GO(glStencilOp, vFuuu) +GO(glTexCoord1d, vFd) +GO(glTexCoord1dv, vFp) +GO(glTexCoord1f, vFf) +GO(glTexCoord1fv, vFp) +GO(glTexCoord1i, vFi) +GO(glTexCoord1iv, vFp) +GO(glTexCoord1s, vFw) +GO(glTexCoord1sv, vFp) +GO(glTexCoord2d, vFdd) +GO(glTexCoord2dv, vFp) +GO(glTexCoord2f, vFff) +GO(glTexCoord2fv, vFp) +GO(glTexCoord2i, vFii) +GO(glTexCoord2iv, vFp) +GO(glTexCoord2s, vFww) +GO(glTexCoord2sv, vFp) +GO(glTexCoord3d, vFddd) +GO(glTexCoord3dv, vFp) +GO(glTexCoord3f, vFfff) +GO(glTexCoord3fv, vFp) +GO(glTexCoord3i, vFiii) +GO(glTexCoord3iv, vFp) +GO(glTexCoord3s, vFwww) +GO(glTexCoord3sv, vFp) +GO(glTexCoord4d, vFdddd) +GO(glTexCoord4dv, vFp) +GO(glTexCoord4f, vFffff) +GO(glTexCoord4fv, vFp) +GO(glTexCoord4i, vFiiii) +GO(glTexCoord4iv, vFp) +GO(glTexCoord4s, vFwwww) +GO(glTexCoord4sv, vFp) +GO(glTexEnvf, vFuuf) +GO(glTexEnvfv, vFuup) +GO(glTexEnvi, vFuui) +GO(glTexEnviv, vFuup) +GO(glTexGend, vFuud) +GO(glTexGendv, vFuup) +GO(glTexGenf, vFuuf) +GO(glTexGenfv, vFuup) +GO(glTexGeni, vFuui) +GO(glTexGeniv, vFuup) +GO(glTexImage1D, vFuiiiiuup) +GO(glTexImage2D, vFuiiiiiuup) +GO(glTexParameterf, vFuuf) +GO(glTexParameterfv, vFuup) +GO(glTexParameteri, vFuui) +GO(glTexParameteriv, vFuup) +GO(glTranslated, vFddd) +GO(glTranslatef, vFfff) +GO(glVertex2d, vFdd) +GO(glVertex2dv, vFp) +GO(glVertex2f, vFff) +GO(glVertex2fv, vFp) +GO(glVertex2i, vFii) +GO(glVertex2iv, vFp) +GO(glVertex2s, vFww) +GO(glVertex2sv, vFp) +GO(glVertex3d, vFddd) +GO(glVertex3dv, vFp) +GO(glVertex3f, vFfff) +GO(glVertex3fv, vFp) +GO(glVertex3i, vFiii) +GO(glVertex3iv, vFp) +GO(glVertex3s, vFwww) +GO(glVertex3sv, vFp) +GO(glVertex4d, vFdddd) +GO(glVertex4dv, vFp) +GO(glVertex4f, vFffff) +GO(glVertex4fv, vFp) +GO(glVertex4i, vFiiii) +GO(glVertex4iv, vFp) +GO(glVertex4s, vFwwww) +GO(glVertex4sv, vFp) +GO(glViewport, vFiiii) +//VERSION_1_1 +GO(glAreTexturesResident, CFipp) +GO(glArrayElement, vFi) +GO(glBindTexture, vFuu) +GO(glColorPointer, vFiuip) +GO(glCopyTexImage1D, vFuiuiiii) +GO(glCopyTexImage2D, vFuiuiiiii) +GO(glCopyTexSubImage1D, vFuiiiii) +GO(glCopyTexSubImage2D, vFuiiiiiii) +GO(glDeleteTextures, vFip) +GO(glDisableClientState, vFu) +GO(glDrawArrays, vFuii) +GO(glDrawElements, vFuiup) +GO(glEdgeFlagPointer, vFip) +GO(glEnableClientState, vFu) +GO(glGenTextures, vFip) +GO(glGetPointerv, vFup) +GO(glIndexPointer, vFuip) +GO(glIndexub, vFC) +GO(glIndexubv, vFp) +GO(glInterleavedArrays, vFuip) +GO(glIsTexture, CFu) +GO(glNormalPointer, vFuip) +GO(glPolygonOffset, vFff) +GO(glPopClientAttrib, vFv) +GO(glPrioritizeTextures, vFipp) +GO(glPushClientAttrib, vFu) +GO(glTexCoordPointer, vFiuip) +GO(glTexSubImage1D, vFuiiiuup) +GO(glTexSubImage2D, vFuiiiiiuup) +GO(glVertexPointer, vFiuip) +//VERSION_1_2 +GO(glBlendColor, vFffff) +GO(glBlendEquation, vFu) +GO(glColorSubTable, vFuiiuup) +GO(glColorTable, vFuuiuup) +GO(glColorTableParameterfv, vFuup) +GO(glColorTableParameteriv, vFuup) +GO(glConvolutionFilter1D, vFuuiuup) +GO(glConvolutionFilter2D, vFuuiiuup) +GO(glConvolutionParameterf, vFuuf) +GO(glConvolutionParameterfv, vFuup) +GO(glConvolutionParameteri, vFuui) +GO(glConvolutionParameteriv, vFuup) +GO(glCopyColorSubTable, vFuiiii) +GO(glCopyColorTable, vFuuiii) +GO(glCopyConvolutionFilter1D, vFuuiii) +GO(glCopyConvolutionFilter2D, vFuuiiii) +GO(glCopyTexSubImage3D, vFuiiiiiiii) +GO(glDrawRangeElements, vFuuuiup) +GO(glGetColorTable, vFuuup) +GO(glGetColorTableParameterfv, vFuup) +GO(glGetColorTableParameteriv, vFuup) +GO(glGetConvolutionFilter, vFuuup) +GO(glGetConvolutionParameterfv, vFuup) +GO(glGetConvolutionParameteriv, vFuup) +GO(glGetHistogram, vFuCuup) +GO(glGetHistogramParameterfv, vFuup) +GO(glGetHistogramParameteriv, vFuup) +GO(glGetMinmax, vFuCuup) +GO(glGetMinmaxParameterfv, vFuup) +GO(glGetMinmaxParameteriv, vFuup) +GO(glGetSeparableFilter, vFuuuppp) +GO(glHistogram, vFuiuC) +GO(glMinmax, vFuuC) +GO(glResetHistogram, vFu) +GO(glResetMinmax, vFu) +GO(glSeparableFilter2D, vFuuiiuupp) +GO(glTexImage3D, vFuiiiiiiuup) +GO(glTexSubImage3D, vFuiiiiiiiuup) +//VERSION_1_3 +GO(glActiveTexture, vFu) +GO(glClientActiveTexture, vFu) +GO(glCompressedTexImage1D, vFuiuiiip) +GO(glCompressedTexImage2D, vFuiuiiiip) +GO(glCompressedTexImage3D, vFuiuiiiiip) +GO(glCompressedTexSubImage1D, vFuiiiuip) +GO(glCompressedTexSubImage2D, vFuiiiiiuip) +GO(glCompressedTexSubImage3D, vFuiiiiiiiuip) +GO(glGetCompressedTexImage, vFuip) +GO(glLoadTransposeMatrixd, vFp) +GO(glLoadTransposeMatrixf, vFp) +GO(glMultTransposeMatrixd, vFp) +GO(glMultTransposeMatrixf, vFp) +GO(glMultiTexCoord1d, vFud) +GO(glMultiTexCoord1dv, vFup) +GO(glMultiTexCoord1f, vFuf) +GO(glMultiTexCoord1fv, vFup) +GO(glMultiTexCoord1i, vFui) +GO(glMultiTexCoord1iv, vFup) +GO(glMultiTexCoord1s, vFuw) +GO(glMultiTexCoord1sv, vFup) +GO(glMultiTexCoord2d, vFudd) +GO(glMultiTexCoord2dv, vFup) +GO(glMultiTexCoord2f, vFuff) +GO(glMultiTexCoord2fv, vFup) +GO(glMultiTexCoord2i, vFuii) +GO(glMultiTexCoord2iv, vFup) +GO(glMultiTexCoord2s, vFuww) +GO(glMultiTexCoord2sv, vFup) +GO(glMultiTexCoord3d, vFuddd) +GO(glMultiTexCoord3dv, vFup) +GO(glMultiTexCoord3f, vFufff) +GO(glMultiTexCoord3fv, vFup) +GO(glMultiTexCoord3i, vFuiii) +GO(glMultiTexCoord3iv, vFup) +GO(glMultiTexCoord3s, vFuwww) +GO(glMultiTexCoord3sv, vFup) +GO(glMultiTexCoord4d, vFudddd) +GO(glMultiTexCoord4dv, vFup) +GO(glMultiTexCoord4f, vFuffff) +GO(glMultiTexCoord4fv, vFup) +GO(glMultiTexCoord4i, vFuiiii) +GO(glMultiTexCoord4iv, vFup) +GO(glMultiTexCoord4s, vFuwwww) +GO(glMultiTexCoord4sv, vFup) +GO(glSampleCoverage, vFfC) +//VERSION_1_4 +GO(glBlendFuncSeparate, vFuuuu) +GO(glFogCoordPointer, vFuip) +GO(glFogCoordd, vFd) +GO(glFogCoorddv, vFp) +GO(glFogCoordf, vFf) +GO(glFogCoordfv, vFp) +GO(glMultiDrawArrays, vFuppi) +GO(glMultiDrawElements, vFupupi) +GO(glPointParameterf, vFuf) +GO(glPointParameterfv, vFup) +GO(glPointParameteri, vFui) +GO(glPointParameteriv, vFup) +GO(glSecondaryColor3b, vFccc) +GO(glSecondaryColor3bv, vFp) +GO(glSecondaryColor3d, vFddd) +GO(glSecondaryColor3dv, vFp) +GO(glSecondaryColor3f, vFfff) +GO(glSecondaryColor3fv, vFp) +GO(glSecondaryColor3i, vFiii) +GO(glSecondaryColor3iv, vFp) +GO(glSecondaryColor3s, vFwww) +GO(glSecondaryColor3sv, vFp) +GO(glSecondaryColor3ub, vFCCC) +GO(glSecondaryColor3ubv, vFp) +GO(glSecondaryColor3ui, vFuuu) +GO(glSecondaryColor3uiv, vFp) +GO(glSecondaryColor3us, vFWWW) +GO(glSecondaryColor3usv, vFp) +GO(glSecondaryColorPointer, vFiuip) +GO(glWindowPos2d, vFdd) +GO(glWindowPos2dv, vFp) +GO(glWindowPos2f, vFff) +GO(glWindowPos2fv, vFp) +GO(glWindowPos2i, vFii) +GO(glWindowPos2iv, vFp) +GO(glWindowPos2s, vFww) +GO(glWindowPos2sv, vFp) +GO(glWindowPos3d, vFddd) +GO(glWindowPos3dv, vFp) +GO(glWindowPos3f, vFfff) +GO(glWindowPos3fv, vFp) +GO(glWindowPos3i, vFiii) +GO(glWindowPos3iv, vFp) +GO(glWindowPos3s, vFwww) +GO(glWindowPos3sv, vFp) +//VERSION_1_5 +GO(glBeginQuery, vFuu) +GO(glBindBuffer, vFuu) +GO(glBufferData, vFulpu) +GO(glBufferSubData, vFullp) +GO(glDeleteBuffers, vFip) +GO(glDeleteQueries, vFip) +GO(glEndQuery, vFu) +GO(glGenBuffers, vFip) +GO(glGenQueries, vFip) +GO(glGetBufferParameteriv, vFuup) +GO(glGetBufferPointerv, vFuup) +GO(glGetBufferSubData, vFullp) +GO(glGetQueryObjectiv, vFuup) +GO(glGetQueryObjectuiv, vFuup) +GO(glGetQueryiv, vFuup) +GO(glIsBuffer, CFu) +GO(glIsQuery, CFu) +GO(glMapBuffer, pFuu) +GO(glUnmapBuffer, CFu) +//VERSION_2_0 +GO(glAttachShader, vFuu) +GO(glBindAttribLocation, vFuup) +GO(glBlendEquationSeparate, vFuu) +GO(glCompileShader, vFu) +GO(glCreateProgram, uFv) +GO(glCreateShader, uFu) +GO(glDeleteProgram, vFu) +GO(glDeleteShader, vFu) +GO(glDetachShader, vFuu) +GO(glDisableVertexAttribArray, vFu) +GO(glDrawBuffers, vFip) +GO(glEnableVertexAttribArray, vFu) +GO(glGetActiveAttrib, vFuuipppp) +GO(glGetActiveUniform, vFuuipppp) +GO(glGetAttachedShaders, vFuipp) +GO(glGetAttribLocation, iFup) +GO(glGetProgramInfoLog, vFuipp) +GO(glGetProgramiv, vFuup) +GO(glGetShaderInfoLog, vFuipp) +GO(glGetShaderSource, vFuipp) +GO(glGetShaderiv, vFuup) +GO(glGetUniformLocation, iFup) +GO(glGetUniformfv, vFuip) +GO(glGetUniformiv, vFuip) +GO(glGetVertexAttribPointerv, vFuup) +GO(glGetVertexAttribdv, vFuup) +GO(glGetVertexAttribfv, vFuup) +GO(glGetVertexAttribiv, vFuup) +GO(glIsProgram, CFu) +GO(glIsShader, CFu) +GO(glLinkProgram, vFu) +GO(glShaderSource, vFuipp) +GO(glStencilFuncSeparate, vFuuiu) +GO(glStencilMaskSeparate, vFuu) +GO(glStencilOpSeparate, vFuuuu) +GO(glUniform1f, vFif) +GO(glUniform1fv, vFiip) +GO(glUniform1i, vFii) +GO(glUniform1iv, vFiip) +GO(glUniform2f, vFiff) +GO(glUniform2fv, vFiip) +GO(glUniform2i, vFiii) +GO(glUniform2iv, vFiip) +GO(glUniform3f, vFifff) +GO(glUniform3fv, vFiip) +GO(glUniform3i, vFiiii) +GO(glUniform3iv, vFiip) +GO(glUniform4f, vFiffff) +GO(glUniform4fv, vFiip) +GO(glUniform4i, vFiiiii) +GO(glUniform4iv, vFiip) +GO(glUniformMatrix2fv, vFiiCp) +GO(glUniformMatrix3fv, vFiiCp) +GO(glUniformMatrix4fv, vFiiCp) +GO(glUseProgram, vFu) +GO(glValidateProgram, vFu) +GO(glVertexAttrib1d, vFud) +GO(glVertexAttrib1dv, vFup) +GO(glVertexAttrib1f, vFuf) +GO(glVertexAttrib1fv, vFup) +GO(glVertexAttrib1s, vFuw) +GO(glVertexAttrib1sv, vFup) +GO(glVertexAttrib2d, vFudd) +GO(glVertexAttrib2dv, vFup) +GO(glVertexAttrib2f, vFuff) +GO(glVertexAttrib2fv, vFup) +GO(glVertexAttrib2s, vFuww) +GO(glVertexAttrib2sv, vFup) +GO(glVertexAttrib3d, vFuddd) +GO(glVertexAttrib3dv, vFup) +GO(glVertexAttrib3f, vFufff) +GO(glVertexAttrib3fv, vFup) +GO(glVertexAttrib3s, vFuwww) +GO(glVertexAttrib3sv, vFup) +GO(glVertexAttrib4Nbv, vFup) +GO(glVertexAttrib4Niv, vFup) +GO(glVertexAttrib4Nsv, vFup) +GO(glVertexAttrib4Nub, vFuCCCC) +GO(glVertexAttrib4Nubv, vFup) +GO(glVertexAttrib4Nuiv, vFup) +GO(glVertexAttrib4Nusv, vFup) +GO(glVertexAttrib4bv, vFup) +GO(glVertexAttrib4d, vFudddd) +GO(glVertexAttrib4dv, vFup) +GO(glVertexAttrib4f, vFuffff) +GO(glVertexAttrib4fv, vFup) +GO(glVertexAttrib4iv, vFup) +GO(glVertexAttrib4s, vFuwwww) +GO(glVertexAttrib4sv, vFup) +GO(glVertexAttrib4ubv, vFup) +GO(glVertexAttrib4uiv, vFup) +GO(glVertexAttrib4usv, vFup) +GO(glVertexAttribPointer, vFuiuCip) +//VERSION_2_1 +GO(glUniformMatrix2x3fv, vFiiCp) +GO(glUniformMatrix2x4fv, vFiiCp) +GO(glUniformMatrix3x2fv, vFiiCp) +GO(glUniformMatrix3x4fv, vFiiCp) +GO(glUniformMatrix4x2fv, vFiiCp) +GO(glUniformMatrix4x3fv, vFiiCp) +//VERSION_3_0 +GO(glBeginConditionalRender, vFuu) +GO(glBeginTransformFeedback, vFu) +GO(glBindBufferBase, vFuuu) +GO(glBindBufferRange, vFuuull) +GO(glBindFragDataLocation, vFuup) +GO(glClampColor, vFuu) +GO(glClearBufferfi, vFuifi) +GO(glClearBufferfv, vFuip) +GO(glClearBufferiv, vFuip) +GO(glClearBufferuiv, vFuip) +GO(glColorMaski, vFuCCCC) +GO(glDisablei, vFuu) +GO(glEnablei, vFuu) +GO(glEndConditionalRender, vFv) +GO(glEndTransformFeedback, vFv) +GO(glGetBooleani_v, vFuup) +GO(glGetFragDataLocation, iFup) +GO(glGetIntegeri_v, vFuup) +GO(glGetStringi, pFuu) +GO(glGetTexParameterIiv, vFuup) +GO(glGetTexParameterIuiv, vFuup) +GO(glGetTransformFeedbackVarying, vFuuipppp) +GO(glGetUniformuiv, vFuip) +GO(glGetVertexAttribIiv, vFuup) +GO(glGetVertexAttribIuiv, vFuup) +GO(glIsEnabledi, CFuu) +GO(glTexParameterIiv, vFuup) +GO(glTexParameterIuiv, vFuup) +GO(glTransformFeedbackVaryings, vFuipu) +GO(glUniform1ui, vFiu) +GO(glUniform1uiv, vFiip) +GO(glUniform2ui, vFiuu) +GO(glUniform2uiv, vFiip) +GO(glUniform3ui, vFiuuu) +GO(glUniform3uiv, vFiip) +GO(glUniform4ui, vFiuuuu) +GO(glUniform4uiv, vFiip) +GO(glVertexAttribI1i, vFui) +GO(glVertexAttribI1iv, vFup) +GO(glVertexAttribI1ui, vFuu) +GO(glVertexAttribI1uiv, vFup) +GO(glVertexAttribI2i, vFuii) +GO(glVertexAttribI2iv, vFup) +GO(glVertexAttribI2ui, vFuuu) +GO(glVertexAttribI2uiv, vFup) +GO(glVertexAttribI3i, vFuiii) +GO(glVertexAttribI3iv, vFup) +GO(glVertexAttribI3ui, vFuuuu) +GO(glVertexAttribI3uiv, vFup) +GO(glVertexAttribI4bv, vFup) +GO(glVertexAttribI4i, vFuiiii) +GO(glVertexAttribI4iv, vFup) +GO(glVertexAttribI4sv, vFup) +GO(glVertexAttribI4ubv, vFup) +GO(glVertexAttribI4ui, vFuuuuu) +GO(glVertexAttribI4uiv, vFup) +GO(glVertexAttribI4usv, vFup) +GO(glVertexAttribIPointer, vFuiuip) +//VERSION_3_1 +GO(glDrawArraysInstanced, vFuiii) +GO(glDrawElementsInstanced, vFuiupi) +GO(glPrimitiveRestartIndex, vFu) +GO(glTexBuffer, vFuuu) +//VERSION_3_2 +GO(glFramebufferTexture, vFuuui) +GO(glGetBufferParameteri64v, vFuup) +GO(glGetInteger64i_v, vFuup) +//VERSION_3_3 +GO(glVertexAttribDivisor, vFuu) +//VERSION_4_0 +GO(glBlendEquationSeparatei, vFuuu) +GO(glBlendEquationi, vFuu) +GO(glBlendFuncSeparatei, vFuuuuu) +GO(glBlendFunci, vFuuu) +GO(glMinSampleShading, vFf) +//VERSION_4_3 +GO(glInvalidateNamedFramebuffer, vFiup) +//VERSION_4_4 +GO(glBindBuffersBase, vFuuip) +GO(glBindBuffersRange, vFuuippp) +GO(glBindImageTextures, vFuip) +GO(glBindSamplers, vFuip) +GO(glBindTextures, vFuip) +GO(glBindVertexBuffers, vFuippp) +GO(glBufferStorage, vFulpu) +GO(glClearTexImage, vFuiuup) +GO(glClearTexSubImage, vFuiiiiiiiuup) +//VERSION_4_5 +GO(glClipControl, vFuu) +GO(glCreateTransformFeedbacks, vFip) +GO(glTransformFeedbackBufferBase, vFuuu) +GO(glTransformFeedbackBufferRange, vFuuull) +GO(glGetTransformFeedbackiv, vFuup) +GO(glGetTransformFeedbacki_v, vFuuup) +GO(glGetTransformFeedbacki64_v, vFuuup) +GO(glCreateBuffers, vFip) +GO(glNamedBufferStorage, vFulpu) +GO(glNamedBufferStorageEXT, vFulpu) +GO(glNamedBufferData, vFulpu) +GO(glNamedBufferSubData, vFullp) +GO(glCopyNamedBufferSubData, vFuulll) +GO(glClearNamedBufferData, vFuuuup) +GO(glClearNamedBufferSubData, vFuulluup) +GO(glMapNamedBuffer, pFuu) +GO(glMapNamedBufferRange, pFullu) +GO(glUnmapNamedBuffer, CFu) +GO(glFlushMappedNamedBufferRange, vFull) +GO(glGetNamedBufferParameteriv, vFuup) +GO(glGetNamedBufferParameteri64v, vFuup) +GO(glGetNamedBufferPointerv, vFuup) +GO(glGetNamedBufferSubData, vFullp) +GO(glCreateFramebuffers, vFip) +GO(glNamedFramebufferRenderbuffer, vFuuuu) +GO(glNamedFramebufferParameteri, vFuui) +GO(glNamedFramebufferTexture, vFuuui) +GO(glNamedFramebufferTextureLayer, vFuuuii) +GO(glNamedFramebufferDrawBuffer, vFuu) +GO(glNamedFramebufferDrawBuffers, vFuip) +GO(glNamedFramebufferReadBuffer, vFuu) +GO(glInvalidateNamedFramebufferData, vFuip) +GO(glInvalidateNamedFramebufferSubData, vFuipiiii) +GO(glClearNamedFramebufferiv, vFuuip) +GO(glClearNamedFramebufferuiv, vFuuip) +GO(glClearNamedFramebufferfv, vFuuip) +GO(glClearNamedFramebufferfi, vFuuifi) +GO(glBlitNamedFramebuffer, vFuuiiiiiiiiuu) +GO(glCheckNamedFramebufferStatus, uFuu) +GO(glGetNamedFramebufferParameteriv, vFuup) +GO(glGetNamedFramebufferAttachmentParameteriv, vFuuup) +GO(glCreateRenderbuffers, vFip) +GO(glNamedRenderbufferStorage, vFuuii) +GO(glNamedRenderbufferStorageMultisample, vFuiuii) +GO(glGetNamedRenderbufferParameteriv, vFuup) +GO(glCreateTextures, vFuip) +GO(glTextureBuffer, vFuuu) +GO(glTextureBufferRange, vFuuull) +GO(glTextureStorage1D, vFuiui) +GO(glTextureStorage2D, vFuiuii) +GO(glTextureStorage3D, vFuiuiii) +GO(glTextureStorage2DMultisample, vFuiuiiC) +GO(glTextureStorage3DMultisample, vFuiuiiiC) +GO(glTextureSubImage1D, vFuiiiuup) +GO(glTextureSubImage2D, vFuiiiiiuup) +GO(glTextureSubImage3D, vFuiiiiiiiuup) +GO(glCompressedTextureSubImage1D, vFuiiiuip) +GO(glCompressedTextureSubImage2D, vFuiiiiiuip) +GO(glCompressedTextureSubImage3D, vFuiiiiiiiuip) +GO(glCopyTextureSubImage1D, vFuiiiii) +GO(glCopyTextureSubImage2D, vFuiiiiiii) +GO(glCopyTextureSubImage3D, vFuiiiiiiii) +GO(glTextureParameterf, vFuuf) +GO(glTextureParameterfv, vFuup) +GO(glTextureParameteri, vFuui) +GO(glTextureParameterIiv, vFuup) +GO(glTextureParameterIuiv, vFuup) +GO(glTextureParameteriv, vFuup) +GO(glGenerateTextureMipmap, vFu) +GO(glBindTextureUnit, vFuu) +GO(glGetTextureImage, vFuiuuip) +GO(glGetCompressedTextureImage, vFuiip) +GO(glGetTextureLevelParameterfv, vFuiup) +GO(glGetTextureLevelParameteriv, vFuiup) +GO(glGetTextureParameterfv, vFuup) +GO(glGetTextureParameterIiv, vFuup) +GO(glGetTextureParameterIuiv, vFuup) +GO(glGetTextureParameteriv, vFuup) +GO(glCreateVertexArrays, vFip) +GO(glDisableVertexArrayAttrib, vFuu) +GO(glEnableVertexArrayAttrib, vFuu) +GO(glVertexArrayElementBuffer, vFuu) +GO(glVertexArrayVertexBuffer, vFuuuli) +GO(glVertexArrayVertexBuffers, vFuuippp) +GO(glVertexArrayAttribBinding, vFuuu) +GO(glVertexArrayAttribFormat, vFuuiuCu) +GO(glVertexArrayAttribIFormat, vFuuiuu) +GO(glVertexArrayAttribLFormat, vFuuiuu) +GO(glVertexArrayBindingDivisor, vFuuu) +GO(glGetVertexArrayiv, vFuup) +GO(glGetVertexArrayIndexediv, vFuuup) +GO(glGetVertexArrayIndexed64iv, vFuuup) +GO(glCreateSamplers, vFip) +GO(glCreateProgramPipelines, vFip) +GO(glTextureBarrier, vFv) +GO(glTextureParameteriiv, vFuip) +GO(glTextureParameteriuiv, vFuip) +GO(glCreateQueries, vFuip) +GO(glGetQueryBufferObjecti64v, vFuuul) +GO(glGetQueryBufferObjectiv, vFuuul) +GO(glGetQueryBufferObjectui64v, vFuuul) +GO(glGetQueryBufferObjectuiv, vFuuul) +GO(glMemoryBarrierByRegion, vFu) +GO(glGetTextureSubImage, vFuiiiiiiiuuip) +GO(glGetCompressedTextureSubImage, vFuiiiiiiiip) +GO(glGetGraphicsResetStatus, uFv) +GO(glGetnUniformfv, vFuiip) +GO(glGetnUniformiv, vFuiip) +GO(glGetnUniformuiv, vFuiip) +GO(glReadnPixels, vFiiiiuuip) +//VERSION_4_6 +GO(glSpecializeShader, vFupupp) + +GO(glTexturePageCommitmentEXT, vFuiiiiiiiC) +GO(glVertexArrayVertexAttribDivisorEXT, vFuuu) + +// _fini +//3DFX_tbuffer +GO(glTbufferMask3DFX, vFu) +//AMD_debug_output +GOM(glDebugMessageCallbackAMD, vFEpp) +GO(glDebugMessageEnableAMD, vFuuipC) +GO(glDebugMessageInsertAMD, vFuuuip) +GO(glGetDebugMessageLogAMD, uFuippppp) +//AMD_draw_buffers_blend +GO(glBlendEquationIndexedAMD, vFuu) +GO(glBlendEquationSeparateIndexedAMD, vFuuu) +GO(glBlendFuncIndexedAMD, vFuuu) +GO(glBlendFuncSeparateIndexedAMD, vFuuuuu) +//AMD_multi_draw_indirect +GO(glMultiDrawArraysIndirectAMD, vFupii) +GO(glMultiDrawElementsIndirectAMD, vFuupii) +//AMD_name_gen_delete +GO(glDeleteNamesAMD, vFuup) +GO(glGenNamesAMD, vFuup) +GO(glIsNameAMD, CFuu) +//AMD_performance_monitor +GO(glBeginPerfMonitorAMD, vFu) +GO(glDeletePerfMonitorsAMD, vFip) +GO(glEndPerfMonitorAMD, vFu) +GO(glGenPerfMonitorsAMD, vFip) +GO(glGetPerfMonitorCounterDataAMD, vFuuipp) +GO(glGetPerfMonitorCounterInfoAMD, vFuuup) +GO(glGetPerfMonitorCounterStringAMD, vFuuipp) +GO(glGetPerfMonitorCountersAMD, vFuppip) +GO(glGetPerfMonitorGroupStringAMD, vFuipp) +GO(glGetPerfMonitorGroupsAMD, vFpip) +GO(glSelectPerfMonitorCountersAMD, vFuCuip) +//AMD_sample_positions +GO(glSetMultisamplefvAMD, vFuup) +//AMD_sparse_texture +GO(glTexStorageSparseAMD, vFuuiiiiu) +GO(glTextureStorageSparseAMD, vFuuuiiiiu) +//AMD_stencil_operation_extended +GO(glStencilOpValueAMD, vFuu) +//AMD_vertex_shader_tessellator +GO(glTessellationFactorAMD, vFf) +GO(glTessellationModeAMD, vFu) +//APPLE_element_array +GO(glDrawElementArrayAPPLE, vFuii) +GO(glDrawRangeElementArrayAPPLE, vFuuuii) +GO(glElementPointerAPPLE, vFup) +GO(glMultiDrawElementArrayAPPLE, vFuppi) +GO(glMultiDrawRangeElementArrayAPPLE, vFuuuppi) +//APPLE_fence +GO(glDeleteFencesAPPLE, vFip) +GO(glFinishFenceAPPLE, vFu) +GO(glFinishObjectAPPLE, vFui) +GO(glGenFencesAPPLE, vFip) +GO(glIsFenceAPPLE, CFu) +GO(glSetFenceAPPLE, vFu) +GO(glTestFenceAPPLE, CFu) +GO(glTestObjectAPPLE, CFuu) +//APPLE_flush_buffer_range +GO(glBufferParameteriAPPLE, vFuui) +GO(glFlushMappedBufferRangeAPPLE, vFull) +//APPLE_object_purgeable +GO(glGetObjectParameterivAPPLE, vFuuup) +GO(glObjectPurgeableAPPLE, uFuuu) +GO(glObjectUnpurgeableAPPLE, uFuuu) +//APPLE_texture_range +GO(glGetTexParameterPointervAPPLE, vFuup) +GO(glTextureRangeAPPLE, vFuip) +//APPLE_vertex_array_object +GO(glBindVertexArrayAPPLE, vFu) +GO(glDeleteVertexArraysAPPLE, vFip) +GO(glGenVertexArraysAPPLE, vFip) +GO(glIsVertexArrayAPPLE, CFu) +//APPLE_vertex_array_range +GO(glFlushVertexArrayRangeAPPLE, vFip) +GO(glVertexArrayParameteriAPPLE, vFui) +GO(glVertexArrayRangeAPPLE, vFip) +//APPLE_vertex_program_evaluators +GO(glDisableVertexAttribAPPLE, vFuu) +GO(glEnableVertexAttribAPPLE, vFuu) +GO(glIsVertexAttribEnabledAPPLE, CFuu) +GO(glMapVertexAttrib1dAPPLE, vFuuddiip) +GO(glMapVertexAttrib1fAPPLE, vFuuffiip) +GO(glMapVertexAttrib2dAPPLE, vFuuddiiddiip) +GO(glMapVertexAttrib2fAPPLE, vFuuffiiffiip) +//ARB_ES2_compatibility +GO(glClearDepthf, vFf) +GO(glDepthRangef, vFff) +GO(glGetShaderPrecisionFormat, vFuupp) +GO(glReleaseShaderCompiler, vFv) +GO(glShaderBinary, vFipupi) +//ARB_base_instance +GO(glDrawArraysInstancedBaseInstance, vFuiiiu) +GO(glDrawElementsInstancedBaseInstance, vFuiupiu) +GO(glDrawElementsInstancedBaseVertexBaseInstance, vFuiupiiu) +//ARB_blend_func_extended +GO(glBindFragDataLocationIndexed, vFuuup) +GO(glGetFragDataIndex, iFup) +//ARB_cl_event +GO(glCreateSyncFromCLeventARB, pFppu) +//ARB_clear_buffer_object +GO(glClearBufferData, vFuuuup) +GO(glClearBufferSubData, vFuulluup) +GO(glClearNamedBufferDataEXT, vFuuuup) +GO(glClearNamedBufferSubDataEXT, vFuulluup) +//ARB_color_buffer_float +GO(glClampColorARB, vFuu) +//ARB_compute_shader +GO(glDispatchCompute, vFuuu) +GO(glDispatchComputeIndirect, vFl) +//ARB_copy_buffer +GO(glCopyBufferSubData, vFuulll) +//ARB_copy_image +GO(glCopyImageSubData, vFuuiiiiuuiiiiiii) +//ARB_debug_output +GOM(glDebugMessageCallbackARB, vFEpp) +GO(glDebugMessageControlARB, vFuuuipC) +GO(glDebugMessageInsertARB, vFuuuuip) +GO(glGetDebugMessageLogARB, uFuipppppp) +//ARB_draw_buffers +GO(glDrawBuffersARB, vFip) +//ARB_draw_buffers_blend +GO(glBlendEquationSeparateiARB, vFuuu) +GO(glBlendEquationiARB, vFuu) +GO(glBlendFuncSeparateiARB, vFuuuuu) +GO(glBlendFunciARB, vFuuu) +//ARB_draw_elements_base_vertex +GO(glDrawElementsBaseVertex, vFuiupi) +GO(glDrawElementsInstancedBaseVertex, vFuiupii) +GO(glDrawRangeElementsBaseVertex, vFuuuiupi) +GO(glMultiDrawElementsBaseVertex, vFupupip) +//ARB_draw_indirect +GO(glDrawArraysIndirect, vFup) +GO(glDrawElementsIndirect, vFuup) +//ARB_draw_instanced +GO(glDrawArraysInstancedARB, vFuiii) +GO(glDrawElementsInstancedARB, vFuiupi) +//ARB_framebuffer_no_attachments +GO(glFramebufferParameteri, vFuui) +GO(glGetFramebufferParameteriv, vFuup) +GO(glGetNamedFramebufferParameterivEXT, vFuup) +GO(glNamedFramebufferParameteriEXT, vFuui) +//ARB_framebuffer_object +GO(glBindFramebuffer, vFuu) +GO(glBindRenderbuffer, vFuu) +GO(glBlitFramebuffer, vFiiiiiiiiuu) +GO(glCheckFramebufferStatus, uFu) +GO(glDeleteFramebuffers, vFip) +GO(glDeleteRenderbuffers, vFip) +GO(glFramebufferRenderbuffer, vFuuuu) +GO(glFramebufferTexture1D, vFuuuui) +GO(glFramebufferTexture2D, vFuuuui) +GO(glFramebufferTexture3D, vFuuuuii) +GO(glFramebufferTextureLayer, vFuuuii) +GO(glGenFramebuffers, vFip) +GO(glGenRenderbuffers, vFip) +GO(glGenerateMipmap, vFu) +GO(glGetFramebufferAttachmentParameteriv, vFuuup) +GO(glGetRenderbufferParameteriv, vFuup) +GO(glIsFramebuffer, CFu) +GO(glIsRenderbuffer, CFu) +GO(glRenderbufferStorage, vFuuii) +GO(glRenderbufferStorageMultisample, vFuiuii) +//ARB_geometry_shader4 +GO(glFramebufferTextureARB, vFuuui) +GO(glFramebufferTextureFaceARB, vFuuuiu) +GO(glFramebufferTextureLayerARB, vFuuuii) +GO(glProgramParameteriARB, vFuui) +//ARB_get_program_binary +GO(glGetProgramBinary, vFuippp) +GO(glProgramBinary, vFuupi) +GO(glProgramParameteri, vFuui) +//ARB_gpu_shader_fp64 +GO(glGetUniformdv, vFuip) +GO(glUniform1d, vFid) +GO(glUniform1dv, vFiip) +GO(glUniform2d, vFidd) +GO(glUniform2dv, vFiip) +GO(glUniform3d, vFiddd) +GO(glUniform3dv, vFiip) +GO(glUniform4d, vFidddd) +GO(glUniform4dv, vFiip) +GO(glUniformMatrix2dv, vFiiCp) +GO(glUniformMatrix2x3dv, vFiiCp) +GO(glUniformMatrix2x4dv, vFiiCp) +GO(glUniformMatrix3dv, vFiiCp) +GO(glUniformMatrix3x2dv, vFiiCp) +GO(glUniformMatrix3x4dv, vFiiCp) +GO(glUniformMatrix4dv, vFiiCp) +GO(glUniformMatrix4x2dv, vFiiCp) +GO(glUniformMatrix4x3dv, vFiiCp) +//ARB_instanced_arrays +GO(glVertexAttribDivisorARB, vFuu) +//ARB_internalformat_query +GO(glGetInternalformativ, vFuuuip) +//ARB_internalformat_query2 +GO(glGetInternalformati64v, vFuuuip) +//ARB_invalidate_subdata +GO(glInvalidateBufferData, vFu) +GO(glInvalidateBufferSubData, vFull) +GO(glInvalidateFramebuffer, vFuip) +GO(glInvalidateSubFramebuffer, vFuipiiii) +GO(glInvalidateTexImage, vFui) +GO(glInvalidateTexSubImage, vFuiiiiiii) +//ARB_map_buffer_range +GO(glFlushMappedBufferRange, vFull) +GO(glMapBufferRange, pFullu) +//ARB_matrix_palette +GO(glCurrentPaletteMatrixARB, vFi) +GO(glMatrixIndexPointerARB, vFiuip) +GO(glMatrixIndexubvARB, vFip) +GO(glMatrixIndexuivARB, vFip) +GO(glMatrixIndexusvARB, vFip) +//ARB_multi_draw_indirect +GO(glMultiDrawArraysIndirect, vFupii) +GO(glMultiDrawElementsIndirect, vFuupii) +//ARB_multisample +GO(glSampleCoverageARB, vFfC) +//ARB_multitexture +GO(glActiveTextureARB, vFu) +GO(glClientActiveTextureARB, vFu) +GO(glMultiTexCoord1dARB, vFud) +GO(glMultiTexCoord1dvARB, vFup) +GO(glMultiTexCoord1fARB, vFuf) +GO(glMultiTexCoord1fvARB, vFup) +GO(glMultiTexCoord1iARB, vFui) +GO(glMultiTexCoord1ivARB, vFup) +GO(glMultiTexCoord1sARB, vFuw) +GO(glMultiTexCoord1svARB, vFup) +GO(glMultiTexCoord2dARB, vFudd) +GO(glMultiTexCoord2dvARB, vFup) +GO(glMultiTexCoord2fARB, vFuff) +GO(glMultiTexCoord2fvARB, vFup) +GO(glMultiTexCoord2iARB, vFuii) +GO(glMultiTexCoord2ivARB, vFup) +GO(glMultiTexCoord2sARB, vFuww) +GO(glMultiTexCoord2svARB, vFup) +GO(glMultiTexCoord3dARB, vFuddd) +GO(glMultiTexCoord3dvARB, vFup) +GO(glMultiTexCoord3fARB, vFufff) +GO(glMultiTexCoord3fvARB, vFup) +GO(glMultiTexCoord3iARB, vFuiii) +GO(glMultiTexCoord3ivARB, vFup) +GO(glMultiTexCoord3sARB, vFuwww) +GO(glMultiTexCoord3svARB, vFup) +GO(glMultiTexCoord4dARB, vFudddd) +GO(glMultiTexCoord4dvARB, vFup) +GO(glMultiTexCoord4fARB, vFuffff) +GO(glMultiTexCoord4fvARB, vFup) +GO(glMultiTexCoord4iARB, vFuiiii) +GO(glMultiTexCoord4ivARB, vFup) +GO(glMultiTexCoord4sARB, vFuwwww) +GO(glMultiTexCoord4svARB, vFup) +//ARB_occlusion_query +GO(glBeginQueryARB, vFuu) +GO(glDeleteQueriesARB, vFip) +GO(glEndQueryARB, vFu) +GO(glGenQueriesARB, vFip) +GO(glGetQueryObjectivARB, vFuup) +GO(glGetQueryObjectuivARB, vFuup) +GO(glGetQueryivARB, vFuup) +GO(glIsQueryARB, CFu) +//ARB_point_parameters +GO(glPointParameterfARB, vFuf) +GO(glPointParameterfvARB, vFup) +//ARB_program_interface_query +GO(glGetProgramInterfaceiv, vFuuup) +GO(glGetProgramResourceIndex, uFuup) +GO(glGetProgramResourceLocation, iFuup) +GO(glGetProgramResourceLocationIndex, iFuup) +GO(glGetProgramResourceName, vFuuuipp) +GO(glGetProgramResourceiv, vFuuuipipp) +//ARB_provoking_vertex +GO(glProvokingVertex, vFu) +//ARB_robustness +GO(glGetGraphicsResetStatusARB, uFv) +GO(glGetnColorTableARB, vFuuuip) +GO(glGetnCompressedTexImageARB, vFuiip) +GO(glGetnConvolutionFilterARB, vFuuuip) +GO(glGetnHistogramARB, vFuCuuip) +GO(glGetnMapdvARB, vFuuip) +GO(glGetnMapfvARB, vFuuip) +GO(glGetnMapivARB, vFuuip) +GO(glGetnMinmaxARB, vFuCuuip) +GO(glGetnPixelMapfvARB, vFuip) +GO(glGetnPixelMapuivARB, vFuip) +GO(glGetnPixelMapusvARB, vFuip) +GO(glGetnPolygonStippleARB, vFip) +GO(glGetnSeparableFilterARB, vFuuuipipp) +GO(glGetnTexImageARB, vFuiuuip) +GO(glGetnUniformdvARB, vFuiip) +GO(glGetnUniformfvARB, vFuiip) +GO(glGetnUniformivARB, vFuiip) +GO(glGetnUniformuivARB, vFuiip) +GO(glReadnPixelsARB, vFiiiiuuip) +//ARB_sample_shading +GO(glMinSampleShadingARB, vFf) +//ARB_sampler_objects +GO(glBindSampler, vFuu) +GO(glDeleteSamplers, vFip) +GO(glGenSamplers, vFip) +GO(glGetSamplerParameterIiv, vFuup) +GO(glGetSamplerParameterIuiv, vFuup) +GO(glGetSamplerParameterfv, vFuup) +GO(glGetSamplerParameteriv, vFuup) +GO(glIsSampler, CFu) +GO(glSamplerParameterIiv, vFuup) +GO(glSamplerParameterIuiv, vFuup) +GO(glSamplerParameterf, vFuuf) +GO(glSamplerParameterfv, vFuup) +GO(glSamplerParameteri, vFuui) +GO(glSamplerParameteriv, vFuup) +//ARB_separate_shader_objects +GO(glActiveShaderProgram, vFuu) +GO(glBindProgramPipeline, vFu) +GO(glCreateShaderProgramv, uFuip) +GO(glDeleteProgramPipelines, vFip) +GO(glGenProgramPipelines, vFip) +GO(glGetProgramPipelineInfoLog, vFuipp) +GO(glGetProgramPipelineiv, vFuup) +GO(glIsProgramPipeline, CFu) +GO(glProgramUniform1d, vFuid) +GO(glProgramUniform1dv, vFuiip) +GO(glProgramUniform1f, vFuif) +GO(glProgramUniform1fv, vFuiip) +GO(glProgramUniform1i, vFuii) +GO(glProgramUniform1iv, vFuiip) +GO(glProgramUniform1ui, vFuiu) +GO(glProgramUniform1uiv, vFuiip) +GO(glProgramUniform2d, vFuidd) +GO(glProgramUniform2dv, vFuiip) +GO(glProgramUniform2f, vFuiff) +GO(glProgramUniform2fv, vFuiip) +GO(glProgramUniform2i, vFuiii) +GO(glProgramUniform2iv, vFuiip) +GO(glProgramUniform2ui, vFuiuu) +GO(glProgramUniform2uiv, vFuiip) +GO(glProgramUniform3d, vFuiddd) +GO(glProgramUniform3dv, vFuiip) +GO(glProgramUniform3f, vFuifff) +GO(glProgramUniform3fv, vFuiip) +GO(glProgramUniform3i, vFuiiii) +GO(glProgramUniform3iv, vFuiip) +GO(glProgramUniform3ui, vFuiuuu) +GO(glProgramUniform3uiv, vFuiip) +GO(glProgramUniform4d, vFuidddd) +GO(glProgramUniform4dv, vFuiip) +GO(glProgramUniform4f, vFuiffff) +GO(glProgramUniform4fv, vFuiip) +GO(glProgramUniform4i, vFuiiiii) +GO(glProgramUniform4iv, vFuiip) +GO(glProgramUniform4ui, vFuiuuuu) +GO(glProgramUniform4uiv, vFuiip) +GO(glProgramUniformMatrix2dv, vFuiiCp) +GO(glProgramUniformMatrix2fv, vFuiiCp) +GO(glProgramUniformMatrix2x3dv, vFuiiCp) +GO(glProgramUniformMatrix2x3fv, vFuiiCp) +GO(glProgramUniformMatrix2x4dv, vFuiiCp) +GO(glProgramUniformMatrix2x4fv, vFuiiCp) +GO(glProgramUniformMatrix3dv, vFuiiCp) +GO(glProgramUniformMatrix3fv, vFuiiCp) +GO(glProgramUniformMatrix3x2dv, vFuiiCp) +GO(glProgramUniformMatrix3x2fv, vFuiiCp) +GO(glProgramUniformMatrix3x4dv, vFuiiCp) +GO(glProgramUniformMatrix3x4fv, vFuiiCp) +GO(glProgramUniformMatrix4dv, vFuiiCp) +GO(glProgramUniformMatrix4fv, vFuiiCp) +GO(glProgramUniformMatrix4x2dv, vFuiiCp) +GO(glProgramUniformMatrix4x2fv, vFuiiCp) +GO(glProgramUniformMatrix4x3dv, vFuiiCp) +GO(glProgramUniformMatrix4x3fv, vFuiiCp) +GO(glUseProgramStages, vFuuu) +GO(glValidateProgramPipeline, vFu) +//ARB_shader_atomic_counters +GO(glGetActiveAtomicCounterBufferiv, vFuuup) +//ARB_shader_image_load_store +GO(glBindImageTexture, vFuuiCiuu) +GO(glMemoryBarrier, vFu) +//ARB_shader_objects +GO(glAttachObjectARB, vFuu) +GO(glCompileShaderARB, vFu) +GO(glCreateProgramObjectARB, uFv) +GO(glCreateShaderObjectARB, uFu) +GO(glDeleteObjectARB, vFu) +GO(glDetachObjectARB, vFuu) +GO(glGetActiveUniformARB, vFuuipppp) +GO(glGetAttachedObjectsARB, vFuipp) +GO(glGetHandleARB, uFu) +GO(glGetInfoLogARB, vFuipp) +GO(glGetObjectParameterfvARB, vFuup) +GO(glGetObjectParameterivARB, vFuup) +GO(glGetShaderSourceARB, vFuipp) +GO(glGetUniformLocationARB, iFup) +GO(glGetUniformfvARB, vFuip) +GO(glGetUniformivARB, vFuip) +GO(glLinkProgramARB, vFu) +GO(glShaderSourceARB, vFuipp) +GO(glUniform1fARB, vFif) +GO(glUniform1fvARB, vFiip) +GO(glUniform1iARB, vFii) +GO(glUniform1ivARB, vFiip) +GO(glUniform2fARB, vFiff) +GO(glUniform2fvARB, vFiip) +GO(glUniform2iARB, vFiii) +GO(glUniform2ivARB, vFiip) +GO(glUniform3fARB, vFifff) +GO(glUniform3fvARB, vFiip) +GO(glUniform3iARB, vFiiii) +GO(glUniform3ivARB, vFiip) +GO(glUniform4fARB, vFiffff) +GO(glUniform4fvARB, vFiip) +GO(glUniform4iARB, vFiiiii) +GO(glUniform4ivARB, vFiip) +GO(glUniformMatrix2fvARB, vFiiCp) +GO(glUniformMatrix3fvARB, vFiiCp) +GO(glUniformMatrix4fvARB, vFiiCp) +GO(glUseProgramObjectARB, vFu) +GO(glValidateProgramARB, vFu) +//ARB_shader_storage_buffer_object +GO(glShaderStorageBlockBinding, vFuuu) +//ARB_shader_subroutine +GO(glGetActiveSubroutineName, vFuuuipp) +GO(glGetActiveSubroutineUniformName, vFuuuipp) +GO(glGetActiveSubroutineUniformiv, vFuuuup) +GO(glGetProgramStageiv, vFuuup) +GO(glGetSubroutineIndex, uFuup) +GO(glGetSubroutineUniformLocation, iFuup) +GO(glGetUniformSubroutineuiv, vFuip) +GO(glUniformSubroutinesuiv, vFuip) +//ARB_shading_language_include +GO(glCompileShaderIncludeARB, vFuipp) +GO(glDeleteNamedStringARB, vFip) +GO(glGetNamedStringARB, vFipipp) +GO(glGetNamedStringivARB, vFipup) +GO(glIsNamedStringARB, CFip) +GO(glNamedStringARB, vFuipip) +//ARB_sync +GO(glClientWaitSync, uFpuU) +GO(glDeleteSync, vFp) +GO(glFenceSync, pFuu) +GO(glGetInteger64v, vFup) +GO(glGetSynciv, vFpuipp) +GO(glIsSync, CFp) +GO(glWaitSync, vFpuU) +//ARB_tessellation_shader +GO(glPatchParameterfv, vFup) +GO(glPatchParameteri, vFui) +//ARB_texture_buffer_object +GO(glTexBufferARB, vFuuu) +//ARB_texture_buffer_range +GO(glTexBufferRange, vFuuull) +GO(glTextureBufferRangeEXT, vFuuuull) +//ARB_texture_compression +GO(glCompressedTexImage1DARB, vFuiuiiip) +GO(glCompressedTexImage2DARB, vFuiuiiiip) +GO(glCompressedTexImage3DARB, vFuiuiiiiip) +GO(glCompressedTexSubImage1DARB, vFuiiiuip) +GO(glCompressedTexSubImage2DARB, vFuiiiiiuip) +GO(glCompressedTexSubImage3DARB, vFuiiiiiiiuip) +GO(glGetCompressedTexImageARB, vFuip) +//ARB_texture_multisample +GO(glGetMultisamplefv, vFuup) +GO(glSampleMaski, vFuu) +GO(glTexImage2DMultisample, vFuiuiiC) +GO(glTexImage3DMultisample, vFuiuiiiC) +//ARB_texture_storage +GO(glTexStorage1D, vFuiui) +GO(glTexStorage2D, vFuiuii) +GO(glTexStorage3D, vFuiuiii) +GO(glTextureStorage1DEXT, vFuuiui) +GO(glTextureStorage2DEXT, vFuuiuii) +GO(glTextureStorage3DEXT, vFuuiuiii) +//ARB_texture_storage_multisample +GO(glTexStorage2DMultisample, vFuiuiiC) +GO(glTexStorage3DMultisample, vFuiuiiiC) +GO(glTextureStorage2DMultisampleEXT, vFuuiuiiC) +GO(glTextureStorage3DMultisampleEXT, vFuuiuiiiC) +//ARB_texture_view +GO(glTextureView, vFuuuuuuuu) +//ARB_timer_query +GO(glGetQueryObjecti64v, vFuup) +GO(glGetQueryObjectui64v, vFuup) +GO(glQueryCounter, vFuu) +//ARB_transform_feedback2 +GO(glBindTransformFeedback, vFuu) +GO(glDeleteTransformFeedbacks, vFip) +GO(glDrawTransformFeedback, vFuu) +GO(glGenTransformFeedbacks, vFip) +GO(glIsTransformFeedback, CFu) +GO(glPauseTransformFeedback, vFv) +GO(glResumeTransformFeedback, vFv) +//ARB_transform_feedback3 +GO(glBeginQueryIndexed, vFuuu) +GO(glDrawTransformFeedbackStream, vFuuu) +GO(glEndQueryIndexed, vFuu) +GO(glGetQueryIndexediv, vFuuup) +//ARB_transform_feedback_instanced +GO(glDrawTransformFeedbackInstanced, vFuui) +GO(glDrawTransformFeedbackStreamInstanced, vFuuui) +//ARB_transpose_matrix +GO(glLoadTransposeMatrixdARB, vFp) +GO(glLoadTransposeMatrixfARB, vFp) +GO(glMultTransposeMatrixdARB, vFp) +GO(glMultTransposeMatrixfARB, vFp) +//ARB_uniform_buffer_object +GO(glGetActiveUniformBlockName, vFuuipp) +GO(glGetActiveUniformBlockiv, vFuuup) +GO(glGetActiveUniformName, vFuuipp) +GO(glGetActiveUniformsiv, vFuipup) +GO(glGetUniformBlockIndex, uFup) +GO(glGetUniformIndices, vFuipp) +GO(glUniformBlockBinding, vFuuu) +//ARB_vertex_array_object +GO(glBindVertexArray, vFu) +GO(glDeleteVertexArrays, vFip) +GO(glGenVertexArrays, vFip) +GO(glIsVertexArray, CFu) +//ARB_vertex_attrib_64bit +GO(glGetVertexAttribLdv, vFuup) +GO(glVertexAttribL1d, vFud) +GO(glVertexAttribL1dv, vFup) +GO(glVertexAttribL2d, vFudd) +GO(glVertexAttribL2dv, vFup) +GO(glVertexAttribL3d, vFuddd) +GO(glVertexAttribL3dv, vFup) +GO(glVertexAttribL4d, vFudddd) +GO(glVertexAttribL4dv, vFup) +GO(glVertexAttribLPointer, vFuiuip) +//ARB_vertex_attrib_binding +GO(glBindVertexBuffer, vFuuli) +GO(glVertexArrayBindVertexBufferEXT, vFuuuli) +GO(glVertexArrayVertexAttribBindingEXT, vFuuu) +GO(glVertexArrayVertexAttribFormatEXT, vFuuiuCu) +GO(glVertexArrayVertexAttribIFormatEXT, vFuuiuu) +GO(glVertexArrayVertexAttribLFormatEXT, vFuuiuu) +GO(glVertexArrayVertexBindingDivisorEXT, vFuuu) +GO(glVertexAttribBinding, vFuu) +GO(glVertexAttribFormat, vFuiuCu) +GO(glVertexAttribIFormat, vFuiuu) +GO(glVertexAttribLFormat, vFuiuu) +GO(glVertexBindingDivisor, vFuu) +//ARB_vertex_blend +GO(glVertexBlendARB, vFi) +GO(glWeightPointerARB, vFiuip) +GO(glWeightbvARB, vFip) +GO(glWeightdvARB, vFip) +GO(glWeightfvARB, vFip) +GO(glWeightivARB, vFip) +GO(glWeightsvARB, vFip) +GO(glWeightubvARB, vFip) +GO(glWeightuivARB, vFip) +GO(glWeightusvARB, vFip) +//ARB_vertex_buffer_object +GO(glBindBufferARB, vFuu) +GO(glBufferDataARB, vFulpu) +GO(glBufferSubDataARB, vFullp) +GO(glDeleteBuffersARB, vFip) +GO(glGenBuffersARB, vFip) +GO(glGetBufferParameterivARB, vFuup) +GO(glGetBufferPointervARB, vFuup) +GO(glGetBufferSubDataARB, vFullp) +GO(glIsBufferARB, CFu) +GO(glMapBufferARB, pFuu) +GO(glUnmapBufferARB, CFu) +//ARB_vertex_program +GO(glBindProgramARB, vFuu) +GO(glDeleteProgramsARB, vFip) +GO(glDisableVertexAttribArrayARB, vFu) +GO(glEnableVertexAttribArrayARB, vFu) +GO(glGenProgramsARB, vFip) +GO(glGetProgramEnvParameterdvARB, vFuup) +GO(glGetProgramEnvParameterfvARB, vFuup) +GO(glGetProgramLocalParameterdvARB, vFuup) +GO(glGetProgramLocalParameterfvARB, vFuup) +GO(glGetProgramStringARB, vFuup) +GO(glGetProgramivARB, vFuup) +GO(glGetVertexAttribPointervARB, vFuup) +GO(glGetVertexAttribdvARB, vFuup) +GO(glGetVertexAttribfvARB, vFuup) +GO(glGetVertexAttribivARB, vFuup) +GO(glIsProgramARB, CFu) +GO(glProgramEnvParameter4dARB, vFuudddd) +GO(glProgramEnvParameter4dvARB, vFuup) +GO(glProgramEnvParameter4fARB, vFuuffff) +GO(glProgramEnvParameter4fvARB, vFuup) +GO(glProgramLocalParameter4dARB, vFuudddd) +GO(glProgramLocalParameter4dvARB, vFuup) +GO(glProgramLocalParameter4fARB, vFuuffff) +GO(glProgramLocalParameter4fvARB, vFuup) +GO(glProgramStringARB, vFuuip) +GO(glVertexAttrib1dARB, vFud) +GO(glVertexAttrib1dvARB, vFup) +GO(glVertexAttrib1fARB, vFuf) +GO(glVertexAttrib1fvARB, vFup) +GO(glVertexAttrib1sARB, vFuw) +GO(glVertexAttrib1svARB, vFup) +GO(glVertexAttrib2dARB, vFudd) +GO(glVertexAttrib2dvARB, vFup) +GO(glVertexAttrib2fARB, vFuff) +GO(glVertexAttrib2fvARB, vFup) +GO(glVertexAttrib2sARB, vFuww) +GO(glVertexAttrib2svARB, vFup) +GO(glVertexAttrib3dARB, vFuddd) +GO(glVertexAttrib3dvARB, vFup) +GO(glVertexAttrib3fARB, vFufff) +GO(glVertexAttrib3fvARB, vFup) +GO(glVertexAttrib3sARB, vFuwww) +GO(glVertexAttrib3svARB, vFup) +GO(glVertexAttrib4NbvARB, vFup) +GO(glVertexAttrib4NivARB, vFup) +GO(glVertexAttrib4NsvARB, vFup) +GO(glVertexAttrib4NubARB, vFuCCCC) +GO(glVertexAttrib4NubvARB, vFup) +GO(glVertexAttrib4NuivARB, vFup) +GO(glVertexAttrib4NusvARB, vFup) +GO(glVertexAttrib4bvARB, vFup) +GO(glVertexAttrib4dARB, vFudddd) +GO(glVertexAttrib4dvARB, vFup) +GO(glVertexAttrib4fARB, vFuffff) +GO(glVertexAttrib4fvARB, vFup) +GO(glVertexAttrib4ivARB, vFup) +GO(glVertexAttrib4sARB, vFuwwww) +GO(glVertexAttrib4svARB, vFup) +GO(glVertexAttrib4ubvARB, vFup) +GO(glVertexAttrib4uivARB, vFup) +GO(glVertexAttrib4usvARB, vFup) +GO(glVertexAttribPointerARB, vFuiuCip) +//ARB_vertex_shader +GO(glBindAttribLocationARB, vFuup) +GO(glGetActiveAttribARB, vFuuipppp) +GO(glGetAttribLocationARB, iFup) +//ARB_vertex_type_2_10_10_10_rev +GO(glColorP3ui, vFuu) +GO(glColorP3uiv, vFup) +GO(glColorP4ui, vFuu) +GO(glColorP4uiv, vFup) +GO(glMultiTexCoordP1ui, vFuuu) +GO(glMultiTexCoordP1uiv, vFuup) +GO(glMultiTexCoordP2ui, vFuuu) +GO(glMultiTexCoordP2uiv, vFuup) +GO(glMultiTexCoordP3ui, vFuuu) +GO(glMultiTexCoordP3uiv, vFuup) +GO(glMultiTexCoordP4ui, vFuuu) +GO(glMultiTexCoordP4uiv, vFuup) +GO(glNormalP3ui, vFuu) +GO(glNormalP3uiv, vFup) +GO(glSecondaryColorP3ui, vFuu) +GO(glSecondaryColorP3uiv, vFup) +GO(glTexCoordP1ui, vFuu) +GO(glTexCoordP1uiv, vFup) +GO(glTexCoordP2ui, vFuu) +GO(glTexCoordP2uiv, vFup) +GO(glTexCoordP3ui, vFuu) +GO(glTexCoordP3uiv, vFup) +GO(glTexCoordP4ui, vFuu) +GO(glTexCoordP4uiv, vFup) +GO(glVertexAttribP1ui, vFuuCu) +GO(glVertexAttribP1uiv, vFuuCp) +GO(glVertexAttribP2ui, vFuuCu) +GO(glVertexAttribP2uiv, vFuuCp) +GO(glVertexAttribP3ui, vFuuCu) +GO(glVertexAttribP3uiv, vFuuCp) +GO(glVertexAttribP4ui, vFuuCu) +GO(glVertexAttribP4uiv, vFuuCp) +GO(glVertexP2ui, vFuu) +GO(glVertexP2uiv, vFup) +GO(glVertexP3ui, vFuu) +GO(glVertexP3uiv, vFup) +GO(glVertexP4ui, vFuu) +GO(glVertexP4uiv, vFup) +//ARB_viewport_array +GO(glDepthRangeArrayv, vFuip) +GO(glDepthRangeIndexed, vFudd) +GO(glGetDoublei_v, vFuup) +GO(glGetFloati_v, vFuup) +GO(glScissorArrayv, vFuip) +GO(glScissorIndexed, vFuiiii) +GO(glScissorIndexedv, vFup) +GO(glViewportArrayv, vFuip) +GO(glViewportIndexedf, vFuffff) +GO(glViewportIndexedfv, vFup) +//ARB_window_pos +GO(glWindowPos2dARB, vFdd) +GO(glWindowPos2dvARB, vFp) +GO(glWindowPos2fARB, vFff) +GO(glWindowPos2fvARB, vFp) +GO(glWindowPos2iARB, vFii) +GO(glWindowPos2ivARB, vFp) +GO(glWindowPos2sARB, vFww) +GO(glWindowPos2svARB, vFp) +GO(glWindowPos3dARB, vFddd) +GO(glWindowPos3dvARB, vFp) +GO(glWindowPos3fARB, vFfff) +GO(glWindowPos3fvARB, vFp) +GO(glWindowPos3iARB, vFiii) +GO(glWindowPos3ivARB, vFp) +GO(glWindowPos3sARB, vFwww) +GO(glWindowPos3svARB, vFp) +//ATI_draw_buffers +GO(glDrawBuffersATI, vFip) +//ATI_element_array +GO(glDrawElementArrayATI, vFui) +GO(glDrawRangeElementArrayATI, vFuuui) +GO(glElementPointerATI, vFup) +//ATI_envmap_bumpmap +GO(glGetTexBumpParameterfvATI, vFup) +GO(glGetTexBumpParameterivATI, vFup) +GO(glTexBumpParameterfvATI, vFup) +GO(glTexBumpParameterivATI, vFup) +//ATI_fragment_shader +GO(glAlphaFragmentOp1ATI, vFuuuuuu) +GO(glAlphaFragmentOp2ATI, vFuuuuuuuuu) +GO(glAlphaFragmentOp3ATI, vFuuuuuuuuuuuu) +GO(glBeginFragmentShaderATI, vFv) +GO(glBindFragmentShaderATI, vFu) +GO(glColorFragmentOp1ATI, vFuuuuuuu) +GO(glColorFragmentOp2ATI, vFuuuuuuuuuu) +GO(glColorFragmentOp3ATI, vFuuuuuuuuuuuuu) +GO(glDeleteFragmentShaderATI, vFu) +GO(glEndFragmentShaderATI, vFv) +GO(glGenFragmentShadersATI, uFu) +GO(glPassTexCoordATI, vFuuu) +GO(glSampleMapATI, vFuuu) +GO(glSetFragmentShaderConstantATI, vFup) +//ATI_map_object_buffer +GO(glMapObjectBufferATI, pFu) +GO(glUnmapObjectBufferATI, vFu) +//ATI_pn_triangles +GO(glPNTrianglesfATI, vFuf) +GO(glPNTrianglesiATI, vFui) +//ATI_separate_stencil +GO(glStencilFuncSeparateATI, vFuuiu) +GO(glStencilOpSeparateATI, vFuuuu) +//ATI_vertex_array_object +GO(glArrayObjectATI, vFuiuiuu) +GO(glFreeObjectBufferATI, vFu) +GO(glGetArrayObjectfvATI, vFuup) +GO(glGetArrayObjectivATI, vFuup) +GO(glGetObjectBufferfvATI, vFuup) +GO(glGetObjectBufferivATI, vFuup) +GO(glGetVariantArrayObjectfvATI, vFuup) +GO(glGetVariantArrayObjectivATI, vFuup) +GO(glIsObjectBufferATI, CFu) +GO(glNewObjectBufferATI, uFipu) +GO(glUpdateObjectBufferATI, vFuuipu) +GO(glVariantArrayObjectATI, vFuuiuu) +//ATI_vertex_attrib_array_object +GO(glGetVertexAttribArrayObjectfvATI, vFuup) +GO(glGetVertexAttribArrayObjectivATI, vFuup) +GO(glVertexAttribArrayObjectATI, vFuiuCiuu) +//ATI_vertex_streams +GO(glClientActiveVertexStreamATI, vFu) +GO(glNormalStream3bATI, vFuccc) +GO(glNormalStream3bvATI, vFup) +GO(glNormalStream3dATI, vFuddd) +GO(glNormalStream3dvATI, vFup) +GO(glNormalStream3fATI, vFufff) +GO(glNormalStream3fvATI, vFup) +GO(glNormalStream3iATI, vFuiii) +GO(glNormalStream3ivATI, vFup) +GO(glNormalStream3sATI, vFuwww) +GO(glNormalStream3svATI, vFup) +GO(glVertexBlendEnvfATI, vFuf) +GO(glVertexBlendEnviATI, vFui) +GO(glVertexStream1dATI, vFud) +GO(glVertexStream1dvATI, vFup) +GO(glVertexStream1fATI, vFuf) +GO(glVertexStream1fvATI, vFup) +GO(glVertexStream1iATI, vFui) +GO(glVertexStream1ivATI, vFup) +GO(glVertexStream1sATI, vFuw) +GO(glVertexStream1svATI, vFup) +GO(glVertexStream2dATI, vFudd) +GO(glVertexStream2dvATI, vFup) +GO(glVertexStream2fATI, vFuff) +GO(glVertexStream2fvATI, vFup) +GO(glVertexStream2iATI, vFuii) +GO(glVertexStream2ivATI, vFup) +GO(glVertexStream2sATI, vFuww) +GO(glVertexStream2svATI, vFup) +GO(glVertexStream3dATI, vFuddd) +GO(glVertexStream3dvATI, vFup) +GO(glVertexStream3fATI, vFufff) +GO(glVertexStream3fvATI, vFup) +GO(glVertexStream3iATI, vFuiii) +GO(glVertexStream3ivATI, vFup) +GO(glVertexStream3sATI, vFuwww) +GO(glVertexStream3svATI, vFup) +GO(glVertexStream4dATI, vFudddd) +GO(glVertexStream4dvATI, vFup) +GO(glVertexStream4fATI, vFuffff) +GO(glVertexStream4fvATI, vFup) +GO(glVertexStream4iATI, vFuiiii) +GO(glVertexStream4ivATI, vFup) +GO(glVertexStream4sATI, vFuwwww) +GO(glVertexStream4svATI, vFup) +//EXT_bindable_uniform +GO(glGetUniformBufferSizeEXT, iFui) +GO(glGetUniformOffsetEXT, lFui) +GO(glUniformBufferEXT, vFuiu) +//EXT_blend_color +GO(glBlendColorEXT, vFffff) +//EXT_blend_equation_separate +GO(glBlendEquationSeparateEXT, vFuu) +//EXT_blend_func_separate +GO(glBlendFuncSeparateEXT, vFuuuu) +//EXT_blend_minmax +GO(glBlendEquationEXT, vFu) +//EXT_color_subtable +GO(glColorSubTableEXT, vFuiiuup) +GO(glCopyColorSubTableEXT, vFuiiii) +//EXT_compiled_vertex_array +GO(glLockArraysEXT, vFii) +GO(glUnlockArraysEXT, vFv) +//EXT_convolution +GO(glConvolutionFilter1DEXT, vFuuiuup) +GO(glConvolutionFilter2DEXT, vFuuiiuup) +GO(glConvolutionParameterfEXT, vFuuf) +GO(glConvolutionParameterfvEXT, vFuup) +GO(glConvolutionParameteriEXT, vFuui) +GO(glConvolutionParameterivEXT, vFuup) +GO(glCopyConvolutionFilter1DEXT, vFuuiii) +GO(glCopyConvolutionFilter2DEXT, vFuuiiii) +GO(glGetConvolutionFilterEXT, vFuuup) +GO(glGetConvolutionParameterfvEXT, vFuup) +GO(glGetConvolutionParameterivEXT, vFuup) +GO(glGetSeparableFilterEXT, vFuuuppp) +GO(glSeparableFilter2DEXT, vFuuiiuupp) +//EXT_coordinate_frame +GO(glBinormal3bEXT, vFccc) +GO(glBinormal3bvEXT, vFp) +GO(glBinormal3dEXT, vFddd) +GO(glBinormal3dvEXT, vFp) +GO(glBinormal3fEXT, vFfff) +GO(glBinormal3fvEXT, vFp) +GO(glBinormal3iEXT, vFiii) +GO(glBinormal3ivEXT, vFp) +GO(glBinormal3sEXT, vFwww) +GO(glBinormal3svEXT, vFp) +GO(glBinormalPointerEXT, vFuip) +GO(glTangent3bEXT, vFccc) +GO(glTangent3bvEXT, vFp) +GO(glTangent3dEXT, vFddd) +GO(glTangent3dvEXT, vFp) +GO(glTangent3fEXT, vFfff) +GO(glTangent3fvEXT, vFp) +GO(glTangent3iEXT, vFiii) +GO(glTangent3ivEXT, vFp) +GO(glTangent3sEXT, vFwww) +GO(glTangent3svEXT, vFp) +GO(glTangentPointerEXT, vFuip) +//EXT_copy_texture +GO(glCopyTexImage1DEXT, vFuiuiiii) +GO(glCopyTexImage2DEXT, vFuiuiiiii) +GO(glCopyTexSubImage1DEXT, vFuiiiii) +GO(glCopyTexSubImage2DEXT, vFuiiiiiii) +GO(glCopyTexSubImage3DEXT, vFuiiiiiiii) +//EXT_cull_vertex +GO(glCullParameterdvEXT, vFup) +GO(glCullParameterfvEXT, vFup) +//EXT_depth_bounds_test +GO(glDepthBoundsEXT, vFdd) +//EXT_direct_state_access +GO(glBindMultiTextureEXT, vFuuu) +GO(glCheckNamedFramebufferStatusEXT, uFuu) +GO(glClientAttribDefaultEXT, vFu) +GO(glCompressedMultiTexImage1DEXT, vFuuiuiiip) +GO(glCompressedMultiTexImage2DEXT, vFuuiuiiiip) +GO(glCompressedMultiTexImage3DEXT, vFuuiuiiiiip) +GO(glCompressedMultiTexSubImage1DEXT, vFuuiiiuip) +GO(glCompressedMultiTexSubImage2DEXT, vFuuiiiiiuip) +GO(glCompressedMultiTexSubImage3DEXT, vFuuiiiiiiiuip) +GO(glCompressedTextureImage1DEXT, vFuuiuiiip) +GO(glCompressedTextureImage2DEXT, vFuuiuiiiip) +GO(glCompressedTextureImage3DEXT, vFuuiuiiiiip) +GO(glCompressedTextureSubImage1DEXT, vFuuiiiuip) +GO(glCompressedTextureSubImage2DEXT, vFuuiiiiiuip) +GO(glCompressedTextureSubImage3DEXT, vFuuiiiiiiiuip) +GO(glCopyMultiTexImage1DEXT, vFuuiuiiii) +GO(glCopyMultiTexImage2DEXT, vFuuiuiiiii) +GO(glCopyMultiTexSubImage1DEXT, vFuuiiiii) +GO(glCopyMultiTexSubImage2DEXT, vFuuiiiiiii) +GO(glCopyMultiTexSubImage3DEXT, vFuuiiiiiiii) +GO(glCopyTextureImage1DEXT, vFuuiuiiii) +GO(glCopyTextureImage2DEXT, vFuuiuiiiii) +GO(glCopyTextureSubImage1DEXT, vFuuiiiii) +GO(glCopyTextureSubImage2DEXT, vFuuiiiiiii) +GO(glCopyTextureSubImage3DEXT, vFuuiiiiiiii) +GO(glDisableClientStateIndexedEXT, vFuu) +GO(glDisableClientStateiEXT, vFuu) +GO(glDisableVertexArrayAttribEXT, vFuu) +GO(glDisableVertexArrayEXT, vFuu) +GO(glEnableClientStateIndexedEXT, vFuu) +GO(glEnableClientStateiEXT, vFuu) +GO(glEnableVertexArrayAttribEXT, vFuu) +GO(glEnableVertexArrayEXT, vFuu) +GO(glFlushMappedNamedBufferRangeEXT, vFull) +GO(glFramebufferDrawBufferEXT, vFuu) +GO(glFramebufferDrawBuffersEXT, vFuip) +GO(glFramebufferReadBufferEXT, vFuu) +GO(glGenerateMultiTexMipmapEXT, vFuu) +GO(glGenerateTextureMipmapEXT, vFuu) +GO(glGetCompressedMultiTexImageEXT, vFuuip) +GO(glGetCompressedTextureImageEXT, vFuuip) +GO(glGetDoubleIndexedvEXT, vFuup) +GO(glGetDoublei_vEXT, vFuup) +GO(glGetFloatIndexedvEXT, vFuup) +GO(glGetFloati_vEXT, vFuup) +GO(glGetFramebufferParameterivEXT, vFuup) +GO(glGetMultiTexEnvfvEXT, vFuuup) +GO(glGetMultiTexEnvivEXT, vFuuup) +GO(glGetMultiTexGendvEXT, vFuuup) +GO(glGetMultiTexGenfvEXT, vFuuup) +GO(glGetMultiTexGenivEXT, vFuuup) +GO(glGetMultiTexImageEXT, vFuuiuup) +GO(glGetMultiTexLevelParameterfvEXT, vFuuiup) +GO(glGetMultiTexLevelParameterivEXT, vFuuiup) +GO(glGetMultiTexParameterIivEXT, vFuuup) +GO(glGetMultiTexParameterIuivEXT, vFuuup) +GO(glGetMultiTexParameterfvEXT, vFuuup) +GO(glGetMultiTexParameterivEXT, vFuuup) +GO(glGetNamedBufferParameterivEXT, vFuup) +GO(glGetNamedBufferPointervEXT, vFuup) +GO(glGetNamedBufferSubDataEXT, vFullp) +GO(glGetNamedFramebufferAttachmentParameterivEXT, vFuuup) +GO(glGetNamedProgramLocalParameterIivEXT, vFuuup) +GO(glGetNamedProgramLocalParameterIuivEXT, vFuuup) +GO(glGetNamedProgramLocalParameterdvEXT, vFuuup) +GO(glGetNamedProgramLocalParameterfvEXT, vFuuup) +GO(glGetNamedProgramStringEXT, vFuuup) +GO(glGetNamedProgramivEXT, vFuuup) +GO(glGetNamedRenderbufferParameterivEXT, vFuup) +GO(glGetPointerIndexedvEXT, vFuup) +GO(glGetPointeri_vEXT, vFuup) +GO(glGetTextureImageEXT, vFuuiuup) +GO(glGetTextureLevelParameterfvEXT, vFuuiup) +GO(glGetTextureLevelParameterivEXT, vFuuiup) +GO(glGetTextureParameterIivEXT, vFuuup) +GO(glGetTextureParameterIuivEXT, vFuuup) +GO(glGetTextureParameterfvEXT, vFuuup) +GO(glGetTextureParameterivEXT, vFuuup) +GO(glGetVertexArrayIntegeri_vEXT, vFuuup) +GO(glGetVertexArrayIntegervEXT, vFuup) +GO(glGetVertexArrayPointeri_vEXT, vFuuup) +GO(glGetVertexArrayPointervEXT, vFuup) +GO(glMapNamedBufferEXT, pFuu) +GO(glMapNamedBufferRangeEXT, pFullu) +GO(glMatrixFrustumEXT, vFudddddd) +GO(glMatrixLoadIdentityEXT, vFu) +GO(glMatrixLoadTransposedEXT, vFup) +GO(glMatrixLoadTransposefEXT, vFup) +GO(glMatrixLoaddEXT, vFup) +GO(glMatrixLoadfEXT, vFup) +GO(glMatrixMultTransposedEXT, vFup) +GO(glMatrixMultTransposefEXT, vFup) +GO(glMatrixMultdEXT, vFup) +GO(glMatrixMultfEXT, vFup) +GO(glMatrixOrthoEXT, vFudddddd) +GO(glMatrixPopEXT, vFu) +GO(glMatrixPushEXT, vFu) +GO(glMatrixRotatedEXT, vFudddd) +GO(glMatrixRotatefEXT, vFuffff) +GO(glMatrixScaledEXT, vFuddd) +GO(glMatrixScalefEXT, vFufff) +GO(glMatrixTranslatedEXT, vFuddd) +GO(glMatrixTranslatefEXT, vFufff) +GO(glMultiTexBufferEXT, vFuuuu) +GO(glMultiTexCoordPointerEXT, vFuiuip) +GO(glMultiTexEnvfEXT, vFuuuf) +GO(glMultiTexEnvfvEXT, vFuuup) +GO(glMultiTexEnviEXT, vFuuui) +GO(glMultiTexEnvivEXT, vFuuup) +GO(glMultiTexGendEXT, vFuuud) +GO(glMultiTexGendvEXT, vFuuup) +GO(glMultiTexGenfEXT, vFuuuf) +GO(glMultiTexGenfvEXT, vFuuup) +GO(glMultiTexGeniEXT, vFuuui) +GO(glMultiTexGenivEXT, vFuuup) +GO(glMultiTexImage1DEXT, vFuuiiiiuup) +GO(glMultiTexImage2DEXT, vFuuiiiiiuup) +GO(glMultiTexImage3DEXT, vFuuiiiiiiuup) +GO(glMultiTexParameterIivEXT, vFuuup) +GO(glMultiTexParameterIuivEXT, vFuuup) +GO(glMultiTexParameterfEXT, vFuuuf) +GO(glMultiTexParameterfvEXT, vFuuup) +GO(glMultiTexParameteriEXT, vFuuui) +GO(glMultiTexParameterivEXT, vFuuup) +GO(glMultiTexRenderbufferEXT, vFuuu) +GO(glMultiTexSubImage1DEXT, vFuuiiiuup) +GO(glMultiTexSubImage2DEXT, vFuuiiiiiuup) +GO(glMultiTexSubImage3DEXT, vFuuiiiiiiiuup) +GO(glNamedBufferDataEXT, vFulpu) +GO(glNamedBufferSubDataEXT, vFullp) +GO(glNamedCopyBufferSubDataEXT, vFuulll) +GO(glNamedFramebufferRenderbufferEXT, vFuuuu) +GO(glNamedFramebufferTexture1DEXT, vFuuuui) +GO(glNamedFramebufferTexture2DEXT, vFuuuui) +GO(glNamedFramebufferTexture3DEXT, vFuuuuii) +GO(glNamedFramebufferTextureEXT, vFuuui) +GO(glNamedFramebufferTextureFaceEXT, vFuuuiu) +GO(glNamedFramebufferTextureLayerEXT, vFuuuii) +GO(glNamedProgramLocalParameter4dEXT, vFuuudddd) +GO(glNamedProgramLocalParameter4dvEXT, vFuuup) +GO(glNamedProgramLocalParameter4fEXT, vFuuuffff) +GO(glNamedProgramLocalParameter4fvEXT, vFuuup) +GO(glNamedProgramLocalParameterI4iEXT, vFuuuiiii) +GO(glNamedProgramLocalParameterI4ivEXT, vFuuup) +GO(glNamedProgramLocalParameterI4uiEXT, vFuuuuuuu) +GO(glNamedProgramLocalParameterI4uivEXT, vFuuup) +GO(glNamedProgramLocalParameters4fvEXT, vFuuuip) +GO(glNamedProgramLocalParametersI4ivEXT, vFuuuip) +GO(glNamedProgramLocalParametersI4uivEXT, vFuuuip) +GO(glNamedProgramStringEXT, vFuuuip) +GO(glNamedRenderbufferStorageEXT, vFuuii) +GO(glNamedRenderbufferStorageMultisampleCoverageEXT, vFuiiuii) +GO(glNamedRenderbufferStorageMultisampleEXT, vFuiuii) +GO(glProgramUniform1dEXT, vFuid) +GO(glProgramUniform1dvEXT, vFuiip) +GO(glProgramUniform1fEXT, vFuif) +GO(glProgramUniform1fvEXT, vFuiip) +GO(glProgramUniform1iEXT, vFuii) +GO(glProgramUniform1ivEXT, vFuiip) +GO(glProgramUniform1uiEXT, vFuiu) +GO(glProgramUniform1uivEXT, vFuiip) +GO(glProgramUniform2dEXT, vFuidd) +GO(glProgramUniform2dvEXT, vFuiip) +GO(glProgramUniform2fEXT, vFuiff) +GO(glProgramUniform2fvEXT, vFuiip) +GO(glProgramUniform2iEXT, vFuiii) +GO(glProgramUniform2ivEXT, vFuiip) +GO(glProgramUniform2uiEXT, vFuiuu) +GO(glProgramUniform2uivEXT, vFuiip) +GO(glProgramUniform3dEXT, vFuiddd) +GO(glProgramUniform3dvEXT, vFuiip) +GO(glProgramUniform3fEXT, vFuifff) +GO(glProgramUniform3fvEXT, vFuiip) +GO(glProgramUniform3iEXT, vFuiiii) +GO(glProgramUniform3ivEXT, vFuiip) +GO(glProgramUniform3uiEXT, vFuiuuu) +GO(glProgramUniform3uivEXT, vFuiip) +GO(glProgramUniform4dEXT, vFuidddd) +GO(glProgramUniform4dvEXT, vFuiip) +GO(glProgramUniform4fEXT, vFuiffff) +GO(glProgramUniform4fvEXT, vFuiip) +GO(glProgramUniform4iEXT, vFuiiiii) +GO(glProgramUniform4ivEXT, vFuiip) +GO(glProgramUniform4uiEXT, vFuiuuuu) +GO(glProgramUniform4uivEXT, vFuiip) +GO(glProgramUniformMatrix2dvEXT, vFuiiCp) +GO(glProgramUniformMatrix2fvEXT, vFuiiCp) +GO(glProgramUniformMatrix2x3dvEXT, vFuiiCp) +GO(glProgramUniformMatrix2x3fvEXT, vFuiiCp) +GO(glProgramUniformMatrix2x4dvEXT, vFuiiCp) +GO(glProgramUniformMatrix2x4fvEXT, vFuiiCp) +GO(glProgramUniformMatrix3dvEXT, vFuiiCp) +GO(glProgramUniformMatrix3fvEXT, vFuiiCp) +GO(glProgramUniformMatrix3x2dvEXT, vFuiiCp) +GO(glProgramUniformMatrix3x2fvEXT, vFuiiCp) +GO(glProgramUniformMatrix3x4dvEXT, vFuiiCp) +GO(glProgramUniformMatrix3x4fvEXT, vFuiiCp) +GO(glProgramUniformMatrix4dvEXT, vFuiiCp) +GO(glProgramUniformMatrix4fvEXT, vFuiiCp) +GO(glProgramUniformMatrix4x2dvEXT, vFuiiCp) +GO(glProgramUniformMatrix4x2fvEXT, vFuiiCp) +GO(glProgramUniformMatrix4x3dvEXT, vFuiiCp) +GO(glProgramUniformMatrix4x3fvEXT, vFuiiCp) +GO(glPushClientAttribDefaultEXT, vFu) +GO(glTextureBufferEXT, vFuuuu) +GO(glTextureImage1DEXT, vFuuiiiiuup) +GO(glTextureImage2DEXT, vFuuiiiiiuup) +GO(glTextureImage3DEXT, vFuuiiiiiiuup) +GO(glTextureParameterIivEXT, vFuuup) +GO(glTextureParameterIuivEXT, vFuuup) +GO(glTextureParameterfEXT, vFuuuf) +GO(glTextureParameterfvEXT, vFuuup) +GO(glTextureParameteriEXT, vFuuui) +GO(glTextureParameterivEXT, vFuuup) +GO(glTextureRenderbufferEXT, vFuuu) +GO(glTextureSubImage1DEXT, vFuuiiiuup) +GO(glTextureSubImage2DEXT, vFuuiiiiiuup) +GO(glTextureSubImage3DEXT, vFuuiiiiiiiuup) +GO(glUnmapNamedBufferEXT, CFu) +GO(glVertexArrayColorOffsetEXT, vFuuiuil) +GO(glVertexArrayEdgeFlagOffsetEXT, vFuuil) +GO(glVertexArrayFogCoordOffsetEXT, vFuuuil) +GO(glVertexArrayIndexOffsetEXT, vFuuuil) +GO(glVertexArrayMultiTexCoordOffsetEXT, vFuuuiuil) +GO(glVertexArrayNormalOffsetEXT, vFuuuil) +GO(glVertexArraySecondaryColorOffsetEXT, vFuuiuil) +GO(glVertexArrayTexCoordOffsetEXT, vFuuiuil) +GO(glVertexArrayVertexAttribIOffsetEXT, vFuuuiuil) +GO(glVertexArrayVertexAttribOffsetEXT, vFuuuiuCil) +GO(glVertexArrayVertexOffsetEXT, vFuuiuil) +//EXT_draw_buffers2 +GO(glColorMaskIndexedEXT, vFuCCCC) +GO(glDisableIndexedEXT, vFuu) +GO(glEnableIndexedEXT, vFuu) +GO(glGetBooleanIndexedvEXT, vFuup) +GO(glGetIntegerIndexedvEXT, vFuup) +GO(glIsEnabledIndexedEXT, CFuu) +//EXT_draw_instanced +GO(glDrawArraysInstancedEXT, vFuiii) +GO(glDrawElementsInstancedEXT, vFuiupi) +//EXT_draw_range_elements +GO(glDrawRangeElementsEXT, vFuuuiup) +//EXT_fog_coord +GO(glFogCoordPointerEXT, vFuip) +GO(glFogCoorddEXT, vFd) +GO(glFogCoorddvEXT, vFp) +GO(glFogCoordfEXT, vFf) +GO(glFogCoordfvEXT, vFp) +//EXT_framebuffer_blit +GO(glBlitFramebufferEXT, vFiiiiiiiiuu) +//EXT_framebuffer_object +GO(glBindFramebufferEXT, vFuu) +GO(glBindRenderbufferEXT, vFuu) +GO(glCheckFramebufferStatusEXT, uFu) +GO(glDeleteFramebuffersEXT, vFip) +GO(glDeleteRenderbuffersEXT, vFip) +GO(glFramebufferRenderbufferEXT, vFuuuu) +GO(glFramebufferTexture1DEXT, vFuuuui) +GO(glFramebufferTexture2DEXT, vFuuuui) +GO(glFramebufferTexture3DEXT, vFuuuuii) +GO(glGenFramebuffersEXT, vFip) +GO(glGenRenderbuffersEXT, vFip) +GO(glGenerateMipmapEXT, vFu) +GO(glGetFramebufferAttachmentParameterivEXT, vFuuup) +GO(glGetRenderbufferParameterivEXT, vFuup) +GO(glIsFramebufferEXT, CFu) +GO(glIsRenderbufferEXT, CFu) +GO(glRenderbufferStorageEXT, vFuuii) +//EXT_geometry_shader4 +GO(glProgramParameteriEXT, vFuui) +//EXT_gpu_program_parameters +GO(glProgramEnvParameters4fvEXT, vFuuip) +GO(glProgramLocalParameters4fvEXT, vFuuip) +//EXT_gpu_shader4 +GO(glBindFragDataLocationEXT, vFuup) +GO(glGetFragDataLocationEXT, iFup) +GO(glGetUniformuivEXT, vFuip) +GO(glUniform1uiEXT, vFiu) +GO(glUniform1uivEXT, vFiip) +GO(glUniform2uiEXT, vFiuu) +GO(glUniform2uivEXT, vFiip) +GO(glUniform3uiEXT, vFiuuu) +GO(glUniform3uivEXT, vFiip) +GO(glUniform4uiEXT, vFiuuuu) +GO(glUniform4uivEXT, vFiip) +//EXT_histogram +GO(glGetHistogramEXT, vFuCuup) +GO(glGetHistogramParameterfvEXT, vFuup) +GO(glGetHistogramParameterivEXT, vFuup) +GO(glGetMinmaxEXT, vFuCuup) +GO(glGetMinmaxParameterfvEXT, vFuup) +GO(glGetMinmaxParameterivEXT, vFuup) +GO(glHistogramEXT, vFuiuC) +GO(glMinmaxEXT, vFuuC) +GO(glResetHistogramEXT, vFu) +GO(glResetMinmaxEXT, vFu) +//EXT_index_func +GO(glIndexFuncEXT, vFuf) +//EXT_index_material +GO(glIndexMaterialEXT, vFuu) +//EXT_light_texture +GO(glApplyTextureEXT, vFu) +GO(glTextureLightEXT, vFu) +GO(glTextureMaterialEXT, vFuu) +//EXT_multi_draw_arrays +GO(glMultiDrawArraysEXT, vFuppi) +GO(glMultiDrawElementsEXT, vFupupi) +//EXT_multisample +GO(glSampleMaskEXT, vFfC) +GO(glSamplePatternEXT, vFu) +//EXT_paletted_texture +GO(glColorTableEXT, vFuuiuup) +GO(glGetColorTableEXT, vFuuup) +GO(glGetColorTableParameterfvEXT, vFuup) +GO(glGetColorTableParameterivEXT, vFuup) +//EXT_pixel_transform +GO(glGetPixelTransformParameterfvEXT, vFuup) +GO(glGetPixelTransformParameterivEXT, vFuup) +GO(glPixelTransformParameterfEXT, vFuuf) +GO(glPixelTransformParameterfvEXT, vFuup) +GO(glPixelTransformParameteriEXT, vFuui) +GO(glPixelTransformParameterivEXT, vFuup) +//EXT_point_parameters +GO(glPointParameterfEXT, vFuf) +GO(glPointParameterfvEXT, vFup) +//EXT_polygon_offset +GO(glPolygonOffsetEXT, vFff) +//EXT_provoking_vertex +GO(glProvokingVertexEXT, vFu) +//EXT_secondary_color +GO(glSecondaryColor3bEXT, vFccc) +GO(glSecondaryColor3bvEXT, vFp) +GO(glSecondaryColor3dEXT, vFddd) +GO(glSecondaryColor3dvEXT, vFp) +GO(glSecondaryColor3fEXT, vFfff) +GO(glSecondaryColor3fvEXT, vFp) +GO(glSecondaryColor3iEXT, vFiii) +GO(glSecondaryColor3ivEXT, vFp) +GO(glSecondaryColor3sEXT, vFwww) +GO(glSecondaryColor3svEXT, vFp) +GO(glSecondaryColor3ubEXT, vFCCC) +GO(glSecondaryColor3ubvEXT, vFp) +GO(glSecondaryColor3uiEXT, vFuuu) +GO(glSecondaryColor3uivEXT, vFp) +GO(glSecondaryColor3usEXT, vFWWW) +GO(glSecondaryColor3usvEXT, vFp) +GO(glSecondaryColorPointerEXT, vFiuip) +//EXT_separate_shader_objects +GO(glActiveProgramEXT, vFu) +GO(glCreateShaderProgramEXT, uFup) +GO(glUseShaderProgramEXT, vFuu) +//EXT_shader_image_load_store +GO(glBindImageTextureEXT, vFuuiCiui) +GO(glMemoryBarrierEXT, vFu) +//EXT_stencil_clear_tag +GO(glStencilClearTagEXT, vFiu) +//EXT_stencil_two_side +GO(glActiveStencilFaceEXT, vFu) +//EXT_subtexture +GO(glTexSubImage1DEXT, vFuiiiuup) +GO(glTexSubImage2DEXT, vFuiiiiiuup) +//EXT_texture3D +GO(glTexImage3DEXT, vFuiuiiiiuup) +GO(glTexSubImage3DEXT, vFuiiiiiiiuup) +//EXT_texture_buffer_object +GO(glTexBufferEXT, vFuuu) +//EXT_texture_integer +GO(glClearColorIiEXT, vFiiii) +GO(glClearColorIuiEXT, vFuuuu) +GO(glGetTexParameterIivEXT, vFuup) +GO(glGetTexParameterIuivEXT, vFuup) +GO(glTexParameterIivEXT, vFuup) +GO(glTexParameterIuivEXT, vFuup) +//EXT_texture_object +GO(glAreTexturesResidentEXT, CFipp) +GO(glBindTextureEXT, vFuu) +GO(glDeleteTexturesEXT, vFip) +GO(glGenTexturesEXT, vFip) +GO(glIsTextureEXT, CFu) +GO(glPrioritizeTexturesEXT, vFipp) +//EXT_texture_perturb_normal +GO(glTextureNormalEXT, vFu) +//EXT_transform_feedback +GO(glBeginTransformFeedbackEXT, vFu) +GO(glBindBufferBaseEXT, vFuuu) +GO(glBindBufferOffsetEXT, vFuuul) +GO(glBindBufferRangeEXT, vFuuull) +GO(glEndTransformFeedbackEXT, vFv) +GO(glGetTransformFeedbackVaryingEXT, vFuuipppp) +GO(glTransformFeedbackVaryingsEXT, vFuipu) +//EXT_vertex_array +GO(glArrayElementEXT, vFi) +GO(glColorPointerEXT, vFiuiip) +GO(glDrawArraysEXT, vFuii) +GO(glEdgeFlagPointerEXT, vFiip) +GO(glGetPointervEXT, vFup) +GO(glIndexPointerEXT, vFuiip) +GO(glNormalPointerEXT, vFuiip) +GO(glTexCoordPointerEXT, vFiuiip) +GO(glVertexPointerEXT, vFiuiip) +//EXT_vertex_attrib_64bit +GO(glGetVertexAttribLdvEXT, vFuup) +GO(glVertexArrayVertexAttribLOffsetEXT, vFuuuiuil) +GO(glVertexAttribL1dEXT, vFud) +GO(glVertexAttribL1dvEXT, vFup) +GO(glVertexAttribL2dEXT, vFudd) +GO(glVertexAttribL2dvEXT, vFup) +GO(glVertexAttribL3dEXT, vFuddd) +GO(glVertexAttribL3dvEXT, vFup) +GO(glVertexAttribL4dEXT, vFudddd) +GO(glVertexAttribL4dvEXT, vFup) +GO(glVertexAttribLPointerEXT, vFuiuip) +//EXT_vertex_shader +GO(glBeginVertexShaderEXT, vFv) +GO(glBindLightParameterEXT, uFuu) +GO(glBindMaterialParameterEXT, uFuu) +GO(glBindParameterEXT, uFu) +GO(glBindTexGenParameterEXT, uFuuu) +GO(glBindTextureUnitParameterEXT, uFuu) +GO(glBindVertexShaderEXT, vFu) +GO(glDeleteVertexShaderEXT, vFu) +GO(glDisableVariantClientStateEXT, vFu) +GO(glEnableVariantClientStateEXT, vFu) +GO(glEndVertexShaderEXT, vFv) +GO(glExtractComponentEXT, vFuuu) +GO(glGenSymbolsEXT, uFuuuu) +GO(glGenVertexShadersEXT, uFu) +GO(glGetInvariantBooleanvEXT, vFuup) +GO(glGetInvariantFloatvEXT, vFuup) +GO(glGetInvariantIntegervEXT, vFuup) +GO(glGetLocalConstantBooleanvEXT, vFuup) +GO(glGetLocalConstantFloatvEXT, vFuup) +GO(glGetLocalConstantIntegervEXT, vFuup) +GO(glGetVariantBooleanvEXT, vFuup) +GO(glGetVariantFloatvEXT, vFuup) +GO(glGetVariantIntegervEXT, vFuup) +GO(glGetVariantPointervEXT, vFuup) +GO(glInsertComponentEXT, vFuuu) +GO(glIsVariantEnabledEXT, CFuu) +GO(glSetInvariantEXT, vFuup) +GO(glSetLocalConstantEXT, vFuup) +GO(glShaderOp1EXT, vFuuu) +GO(glShaderOp2EXT, vFuuuu) +GO(glShaderOp3EXT, vFuuuuu) +GO(glSwizzleEXT, vFuuuuuu) +GO(glVariantPointerEXT, vFuuup) +GO(glVariantbvEXT, vFup) +GO(glVariantdvEXT, vFup) +GO(glVariantfvEXT, vFup) +GO(glVariantivEXT, vFup) +GO(glVariantsvEXT, vFup) +GO(glVariantubvEXT, vFup) +GO(glVariantuivEXT, vFup) +GO(glVariantusvEXT, vFup) +GO(glWriteMaskEXT, vFuuuuuu) +//EXT_vertex_weighting +GO(glVertexWeightPointerEXT, vFiuip) +GO(glVertexWeightfEXT, vFf) +GO(glVertexWeightfvEXT, vFp) +//EXT_x11_sync_object +GO(glImportSyncEXT, pFulu) +//GREMEDY_frame_terminator +GO(glFrameTerminatorGREMEDY, vFv) +//GREMEDY_string_marker +GO(glStringMarkerGREMEDY, vFip) +//HP_image_transform +GO(glGetImageTransformParameterfvHP, vFuup) +GO(glGetImageTransformParameterivHP, vFuup) +GO(glImageTransformParameterfHP, vFuuf) +GO(glImageTransformParameterfvHP, vFuup) +GO(glImageTransformParameteriHP, vFuui) +GO(glImageTransformParameterivHP, vFuup) +//IBM_multimode_draw_arrays +GO(glMultiModeDrawArraysIBM, vFpppii) +GO(glMultiModeDrawElementsIBM, vFppupii) +//IBM_static_data +GO(glFlushStaticDataIBM, vFu) +//IBM_vertex_array_lists +GO(glColorPointerListIBM, vFiuipi) +GO(glEdgeFlagPointerListIBM, vFipi) +GO(glFogCoordPointerListIBM, vFuipi) +GO(glIndexPointerListIBM, vFuipi) +GO(glNormalPointerListIBM, vFuipi) +GO(glSecondaryColorPointerListIBM, vFiuipi) +GO(glTexCoordPointerListIBM, vFiuipi) +GO(glVertexPointerListIBM, vFiuipi) +//INGR_blend_func_separate +GO(glBlendFuncSeparateINGR, vFuuuu) +//INTEL_map_texture +GO(glMapTexture2DINTEL, pFuiupp) +GO(glSyncTextureINTEL, vFu) +GO(glUnmapTexture2DINTEL, vFui) +//INTEL_parallel_arrays +GO(glColorPointervINTEL, vFiup) +GO(glNormalPointervINTEL, vFup) +GO(glTexCoordPointervINTEL, vFiup) +GO(glVertexPointervINTEL, vFiup) +//KHR_debug +GOM(glDebugMessageCallback, vFEpp) // not ideal, because the my_ version will always exist, even if glDebugMessageCallback doesn't +GO(glDebugMessageControl, vFuuuipC) +GO(glDebugMessageInsert, vFuuuuip) +GO(glGetDebugMessageLog, uFuipppppp) +GO(glGetObjectLabel, vFuuipp) +GO(glGetObjectPtrLabel, vFpipp) +GO(glObjectLabel, vFuuip) +GO(glObjectPtrLabel, vFpip) +GO(glPopDebugGroup, vFv) +GO(glPushDebugGroup, vFuuip) +//MESA_resize_buffers +GO(glResizeBuffersMESA, vFv) +//MESA_window_pos +GO(glWindowPos2dMESA, vFdd) +GO(glWindowPos2dvMESA, vFp) +GO(glWindowPos2fMESA, vFff) +GO(glWindowPos2fvMESA, vFp) +GO(glWindowPos2iMESA, vFii) +GO(glWindowPos2ivMESA, vFp) +GO(glWindowPos2sMESA, vFww) +GO(glWindowPos2svMESA, vFp) +GO(glWindowPos3dMESA, vFddd) +GO(glWindowPos3dvMESA, vFp) +GO(glWindowPos3fMESA, vFfff) +GO(glWindowPos3fvMESA, vFp) +GO(glWindowPos3iMESA, vFiii) +GO(glWindowPos3ivMESA, vFp) +GO(glWindowPos3sMESA, vFwww) +GO(glWindowPos3svMESA, vFp) +GO(glWindowPos4dMESA, vFdddd) +GO(glWindowPos4dvMESA, vFp) +GO(glWindowPos4fMESA, vFffff) +GO(glWindowPos4fvMESA, vFp) +GO(glWindowPos4iMESA, vFiiii) +GO(glWindowPos4ivMESA, vFp) +GO(glWindowPos4sMESA, vFwwww) +GO(glWindowPos4svMESA, vFp) +//NVX_conditional_render +GO(glBeginConditionalRenderNVX, vFu) +GO(glEndConditionalRenderNVX, vFv) +//NV_bindless_texture +GO(glGetImageHandleNV, UFuiCiu) +GO(glGetTextureHandleNV, UFu) +GO(glGetTextureSamplerHandleNV, UFuu) +GO(glIsImageHandleResidentNV, CFU) +GO(glIsTextureHandleResidentNV, CFU) +GO(glMakeImageHandleNonResidentNV, vFU) +GO(glMakeImageHandleResidentNV, vFUu) +GO(glMakeTextureHandleNonResidentNV, vFU) +GO(glMakeTextureHandleResidentNV, vFU) +GO(glProgramUniformHandleui64NV, vFuiU) +GO(glProgramUniformHandleui64vNV, vFuiip) +GO(glUniformHandleui64NV, vFiU) +GO(glUniformHandleui64vNV, vFiip) +//NV_conditional_render +GO(glBeginConditionalRenderNV, vFuu) +GO(glEndConditionalRenderNV, vFv) +//NV_copy_image +GO(glCopyImageSubDataNV, vFuuiiiiuuiiiiiii) +//NV_depth_buffer_float +GO(glClearDepthdNV, vFd) +GO(glDepthBoundsdNV, vFdd) +GO(glDepthRangedNV, vFdd) +//NV_draw_texture +GO(glDrawTextureNV, vFuufffffffff) +//NV_evaluators +GO(glEvalMapsNV, vFuu) +GO(glGetMapAttribParameterfvNV, vFuuup) +GO(glGetMapAttribParameterivNV, vFuuup) +GO(glGetMapControlPointsNV, vFuuuiiCp) +GO(glGetMapParameterfvNV, vFuup) +GO(glGetMapParameterivNV, vFuup) +GO(glMapControlPointsNV, vFuuuiiiiCp) +GO(glMapParameterfvNV, vFuup) +GO(glMapParameterivNV, vFuup) +//NV_explicit_multisample +GO(glGetMultisamplefvNV, vFuup) +GO(glSampleMaskIndexedNV, vFuu) +GO(glTexRenderbufferNV, vFuu) +//NV_fence +GO(glDeleteFencesNV, vFip) +GO(glFinishFenceNV, vFu) +GO(glGenFencesNV, vFip) +GO(glGetFenceivNV, vFuup) +GO(glIsFenceNV, CFu) +GO(glSetFenceNV, vFuu) +GO(glTestFenceNV, CFu) +//NV_fragment_program +GO(glGetProgramNamedParameterdvNV, vFuipp) +GO(glGetProgramNamedParameterfvNV, vFuipp) +GO(glProgramNamedParameter4dNV, vFuipdddd) +GO(glProgramNamedParameter4dvNV, vFuipp) +GO(glProgramNamedParameter4fNV, vFuipffff) +GO(glProgramNamedParameter4fvNV, vFuipp) +//NV_framebuffer_multisample_coverage +GO(glRenderbufferStorageMultisampleCoverageNV, vFuiiuii) +//NV_geometry_program4 +GO(glFramebufferTextureEXT, vFuuui) +GO(glFramebufferTextureFaceEXT, vFuuuiu) +GO(glFramebufferTextureLayerEXT, vFuuuii) +GO(glProgramVertexLimitNV, vFui) +//NV_gpu_program4 +GO(glGetProgramEnvParameterIivNV, vFuup) +GO(glGetProgramEnvParameterIuivNV, vFuup) +GO(glGetProgramLocalParameterIivNV, vFuup) +GO(glGetProgramLocalParameterIuivNV, vFuup) +GO(glProgramEnvParameterI4iNV, vFuuiiii) +GO(glProgramEnvParameterI4ivNV, vFuup) +GO(glProgramEnvParameterI4uiNV, vFuuuuuu) +GO(glProgramEnvParameterI4uivNV, vFuup) +GO(glProgramEnvParametersI4ivNV, vFuuip) +GO(glProgramEnvParametersI4uivNV, vFuuip) +GO(glProgramLocalParameterI4iNV, vFuuiiii) +GO(glProgramLocalParameterI4ivNV, vFuup) +GO(glProgramLocalParameterI4uiNV, vFuuuuuu) +GO(glProgramLocalParameterI4uivNV, vFuup) +GO(glProgramLocalParametersI4ivNV, vFuuip) +GO(glProgramLocalParametersI4uivNV, vFuuip) +//NV_gpu_program5 +GO(glGetProgramSubroutineParameteruivNV, vFuup) +GO(glProgramSubroutineParametersuivNV, vFuip) +//NV_gpu_shader5 +GO(glGetUniformi64vNV, vFuip) +GO(glProgramUniform1i64NV, vFuiI) +GO(glProgramUniform1i64vNV, vFuiip) +GO(glProgramUniform1ui64NV, vFuiU) +GO(glProgramUniform1ui64vNV, vFuiip) +GO(glProgramUniform2i64NV, vFuiII) +GO(glProgramUniform2i64vNV, vFuiip) +GO(glProgramUniform2ui64NV, vFuiUU) +GO(glProgramUniform2ui64vNV, vFuiip) +GO(glProgramUniform3i64NV, vFuiIII) +GO(glProgramUniform3i64vNV, vFuiip) +GO(glProgramUniform3ui64NV, vFuiUUU) +GO(glProgramUniform3ui64vNV, vFuiip) +GO(glProgramUniform4i64NV, vFuiIIII) +GO(glProgramUniform4i64vNV, vFuiip) +GO(glProgramUniform4ui64NV, vFuiUUUU) +GO(glProgramUniform4ui64vNV, vFuiip) +GO(glUniform1i64NV, vFiI) +GO(glUniform1i64vNV, vFiip) +GO(glUniform1ui64NV, vFiU) +GO(glUniform1ui64vNV, vFiip) +GO(glUniform2i64NV, vFiII) +GO(glUniform2i64vNV, vFiip) +GO(glUniform2ui64NV, vFiUU) +GO(glUniform2ui64vNV, vFiip) +GO(glUniform3i64NV, vFiIII) +GO(glUniform3i64vNV, vFiip) +GO(glUniform3ui64NV, vFiUUU) +GO(glUniform3ui64vNV, vFiip) +GO(glUniform4i64NV, vFiIIII) +GO(glUniform4i64vNV, vFiip) +GO(glUniform4ui64NV, vFiUUUU) +GO(glUniform4ui64vNV, vFiip) +//NV_half_float +GO(glColor3hNV, vFWWW) +GO(glColor3hvNV, vFp) +GO(glColor4hNV, vFWWWW) +GO(glColor4hvNV, vFp) +GO(glFogCoordhNV, vFW) +GO(glFogCoordhvNV, vFp) +GO(glMultiTexCoord1hNV, vFuW) +GO(glMultiTexCoord1hvNV, vFup) +GO(glMultiTexCoord2hNV, vFuWW) +GO(glMultiTexCoord2hvNV, vFup) +GO(glMultiTexCoord3hNV, vFuWWW) +GO(glMultiTexCoord3hvNV, vFup) +GO(glMultiTexCoord4hNV, vFuWWWW) +GO(glMultiTexCoord4hvNV, vFup) +GO(glNormal3hNV, vFWWW) +GO(glNormal3hvNV, vFp) +GO(glSecondaryColor3hNV, vFWWW) +GO(glSecondaryColor3hvNV, vFp) +GO(glTexCoord1hNV, vFW) +GO(glTexCoord1hvNV, vFp) +GO(glTexCoord2hNV, vFWW) +GO(glTexCoord2hvNV, vFp) +GO(glTexCoord3hNV, vFWWW) +GO(glTexCoord3hvNV, vFp) +GO(glTexCoord4hNV, vFWWWW) +GO(glTexCoord4hvNV, vFp) +GO(glVertex2hNV, vFWW) +GO(glVertex2hvNV, vFp) +GO(glVertex3hNV, vFWWW) +GO(glVertex3hvNV, vFp) +GO(glVertex4hNV, vFWWWW) +GO(glVertex4hvNV, vFp) +GO(glVertexAttrib1hNV, vFuW) +GO(glVertexAttrib1hvNV, vFup) +GO(glVertexAttrib2hNV, vFuWW) +GO(glVertexAttrib2hvNV, vFup) +GO(glVertexAttrib3hNV, vFuWWW) +GO(glVertexAttrib3hvNV, vFup) +GO(glVertexAttrib4hNV, vFuWWWW) +GO(glVertexAttrib4hvNV, vFup) +GO(glVertexAttribs1hvNV, vFuip) +GO(glVertexAttribs2hvNV, vFuip) +GO(glVertexAttribs3hvNV, vFuip) +GO(glVertexAttribs4hvNV, vFuip) +GO(glVertexWeighthNV, vFW) +GO(glVertexWeighthvNV, vFp) +//NV_occlusion_query +GO(glBeginOcclusionQueryNV, vFu) +GO(glDeleteOcclusionQueriesNV, vFip) +GO(glEndOcclusionQueryNV, vFv) +GO(glGenOcclusionQueriesNV, vFip) +GO(glGetOcclusionQueryivNV, vFuup) +GO(glGetOcclusionQueryuivNV, vFuup) +GO(glIsOcclusionQueryNV, CFu) +//NV_parameter_buffer_object +GO(glProgramBufferParametersIivNV, vFuuuip) +GO(glProgramBufferParametersIuivNV, vFuuuip) +GO(glProgramBufferParametersfvNV, vFuuuip) +//NV_pixel_data_range +GO(glFlushPixelDataRangeNV, vFu) +GO(glPixelDataRangeNV, vFuip) +//NV_point_sprite +GO(glPointParameteriNV, vFui) +GO(glPointParameterivNV, vFup) +//NV_present_video +GO(glGetVideoi64vNV, vFuup) +GO(glGetVideoivNV, vFuup) +GO(glGetVideoui64vNV, vFuup) +GO(glGetVideouivNV, vFuup) +GO(glPresentFrameDualFillNV, vFuUuuuuuuuuuuu) +GO(glPresentFrameKeyedNV, vFuUuuuuuuuuu) +//NV_primitive_restart +GO(glPrimitiveRestartIndexNV, vFu) +GO(glPrimitiveRestartNV, vFv) +//NV_register_combiners +GO(glCombinerInputNV, vFuuuuuu) +GO(glCombinerOutputNV, vFuuuuuuuCCC) +GO(glCombinerParameterfNV, vFuf) +GO(glCombinerParameterfvNV, vFup) +GO(glCombinerParameteriNV, vFui) +GO(glCombinerParameterivNV, vFup) +GO(glFinalCombinerInputNV, vFuuuu) +GO(glGetCombinerInputParameterfvNV, vFuuuup) +GO(glGetCombinerInputParameterivNV, vFuuuup) +GO(glGetCombinerOutputParameterfvNV, vFuuup) +GO(glGetCombinerOutputParameterivNV, vFuuup) +GO(glGetFinalCombinerInputParameterfvNV, vFuup) +GO(glGetFinalCombinerInputParameterivNV, vFuup) +//NV_register_combiners2 +GO(glCombinerStageParameterfvNV, vFuup) +GO(glGetCombinerStageParameterfvNV, vFuup) +//NV_shader_buffer_load +GO(glGetBufferParameterui64vNV, vFuup) +GO(glGetIntegerui64vNV, vFup) +GO(glGetNamedBufferParameterui64vNV, vFuup) +GO(glGetUniformui64vNV, vFuip) +GO(glIsBufferResidentNV, CFu) +GO(glIsNamedBufferResidentNV, CFu) +GO(glMakeBufferNonResidentNV, vFu) +GO(glMakeBufferResidentNV, vFuu) +GO(glMakeNamedBufferNonResidentNV, vFu) +GO(glMakeNamedBufferResidentNV, vFuu) +GO(glProgramUniformui64NV, vFuiU) +GO(glProgramUniformui64vNV, vFuiip) +GO(glUniformui64NV, vFiU) +GO(glUniformui64vNV, vFiip) +//NV_texture_barrier +GO(glTextureBarrierNV, vFv) +//NV_texture_multisample +GO(glTexImage2DMultisampleCoverageNV, vFuiiiiiC) +GO(glTexImage3DMultisampleCoverageNV, vFuiiiiiiC) +GO(glTextureImage2DMultisampleCoverageNV, vFuuiiiiiC) +GO(glTextureImage2DMultisampleNV, vFuuiiiiC) +GO(glTextureImage3DMultisampleCoverageNV, vFuuiiiiiiC) +GO(glTextureImage3DMultisampleNV, vFuuiiiiiC) +//NV_transform_feedback +GO(glActiveVaryingNV, vFup) +GO(glBeginTransformFeedbackNV, vFu) +GO(glBindBufferBaseNV, vFuuu) +GO(glBindBufferOffsetNV, vFuuul) +GO(glBindBufferRangeNV, vFuuull) +GO(glEndTransformFeedbackNV, vFv) +GO(glGetActiveVaryingNV, vFuuipppp) +GO(glGetTransformFeedbackVaryingNV, vFuup) +GO(glGetVaryingLocationNV, iFup) +GO(glTransformFeedbackAttribsNV, vFipu) +GO(glTransformFeedbackStreamAttribsNV, vFipipu) +GO(glTransformFeedbackVaryingsNV, vFuipu) +//NV_transform_feedback2 +GO(glBindTransformFeedbackNV, vFuu) +GO(glDeleteTransformFeedbacksNV, vFip) +GO(glDrawTransformFeedbackNV, vFuu) +GO(glGenTransformFeedbacksNV, vFip) +GO(glIsTransformFeedbackNV, CFu) +GO(glPauseTransformFeedbackNV, vFv) +GO(glResumeTransformFeedbackNV, vFv) +//NV_vdpau_interop +GO(glVDPAUFiniNV, vFv) +GO(glVDPAUGetSurfaceivNV, vFluipp) +GO(glVDPAUInitNV, vFpp) +GO(glVDPAUIsSurfaceNV, CFl) +GO(glVDPAUMapSurfacesNV, vFip) +GO(glVDPAURegisterOutputSurfaceNV, lFpuip) +GO(glVDPAURegisterVideoSurfaceNV, lFpuip) +GO(glVDPAUSurfaceAccessNV, vFlu) +GO(glVDPAUUnmapSurfacesNV, vFip) +GO(glVDPAUUnregisterSurfaceNV, vFl) +//NV_vertex_array_range +GO(glFlushVertexArrayRangeNV, vFv) +GO(glVertexArrayRangeNV, vFip) +//NV_vertex_attrib_integer_64bit +GO(glGetVertexAttribLi64vNV, vFuup) +GO(glGetVertexAttribLui64vNV, vFuup) +GO(glVertexAttribL1i64NV, vFuI) +GO(glVertexAttribL1i64vNV, vFup) +GO(glVertexAttribL1ui64NV, vFuU) +GO(glVertexAttribL1ui64vNV, vFup) +GO(glVertexAttribL2i64NV, vFuII) +GO(glVertexAttribL2i64vNV, vFup) +GO(glVertexAttribL2ui64NV, vFuUU) +GO(glVertexAttribL2ui64vNV, vFup) +GO(glVertexAttribL3i64NV, vFuIII) +GO(glVertexAttribL3i64vNV, vFup) +GO(glVertexAttribL3ui64NV, vFuUUU) +GO(glVertexAttribL3ui64vNV, vFup) +GO(glVertexAttribL4i64NV, vFuIIII) +GO(glVertexAttribL4i64vNV, vFup) +GO(glVertexAttribL4ui64NV, vFuUUUU) +GO(glVertexAttribL4ui64vNV, vFup) +GO(glVertexAttribLFormatNV, vFuiui) +//NV_vertex_buffer_unified_memory +GO(glBufferAddressRangeNV, vFuuUl) +GO(glColorFormatNV, vFiui) +GO(glEdgeFlagFormatNV, vFi) +GO(glFogCoordFormatNV, vFui) +GO(glGetIntegerui64i_vNV, vFuup) +GO(glIndexFormatNV, vFui) +GO(glNormalFormatNV, vFui) +GO(glSecondaryColorFormatNV, vFiui) +GO(glTexCoordFormatNV, vFiui) +GO(glVertexAttribFormatNV, vFuiuCi) +GO(glVertexAttribIFormatNV, vFuiui) +GO(glVertexFormatNV, vFiui) +//NV_vertex_program +GO(glAreProgramsResidentNV, CFipp) +GO(glBindProgramNV, vFuu) +GO(glDeleteProgramsNV, vFip) +GO(glExecuteProgramNV, vFuup) +GO(glGenProgramsNV, vFip) +GO(glGetProgramParameterdvNV, vFuuup) +GO(glGetProgramParameterfvNV, vFuuup) +GO(glGetProgramStringNV, vFuup) +GO(glGetProgramivNV, vFuup) +GO(glGetTrackMatrixivNV, vFuuup) +GO(glGetVertexAttribPointervNV, vFuup) +GO(glGetVertexAttribdvNV, vFuup) +GO(glGetVertexAttribfvNV, vFuup) +GO(glGetVertexAttribivNV, vFuup) +GO(glIsProgramNV, CFu) +GO(glLoadProgramNV, vFuuip) +GO(glProgramParameter4dNV, vFuudddd) +GO(glProgramParameter4dvNV, vFuup) +GO(glProgramParameter4fNV, vFuuffff) +GO(glProgramParameter4fvNV, vFuup) +GO(glProgramParameters4dvNV, vFuuip) +GO(glProgramParameters4fvNV, vFuuip) +GO(glRequestResidentProgramsNV, vFip) +GO(glTrackMatrixNV, vFuuuu) +GO(glVertexAttrib1dNV, vFud) +GO(glVertexAttrib1dvNV, vFup) +GO(glVertexAttrib1fNV, vFuf) +GO(glVertexAttrib1fvNV, vFup) +GO(glVertexAttrib1sNV, vFuw) +GO(glVertexAttrib1svNV, vFup) +GO(glVertexAttrib2dNV, vFudd) +GO(glVertexAttrib2dvNV, vFup) +GO(glVertexAttrib2fNV, vFuff) +GO(glVertexAttrib2fvNV, vFup) +GO(glVertexAttrib2sNV, vFuww) +GO(glVertexAttrib2svNV, vFup) +GO(glVertexAttrib3dNV, vFuddd) +GO(glVertexAttrib3dvNV, vFup) +GO(glVertexAttrib3fNV, vFufff) +GO(glVertexAttrib3fvNV, vFup) +GO(glVertexAttrib3sNV, vFuwww) +GO(glVertexAttrib3svNV, vFup) +GO(glVertexAttrib4dNV, vFudddd) +GO(glVertexAttrib4dvNV, vFup) +GO(glVertexAttrib4fNV, vFuffff) +GO(glVertexAttrib4fvNV, vFup) +GO(glVertexAttrib4sNV, vFuwwww) +GO(glVertexAttrib4svNV, vFup) +GO(glVertexAttrib4ubNV, vFuCCCC) +GO(glVertexAttrib4ubvNV, vFup) +GO(glVertexAttribPointerNV, vFuiuip) +GO(glVertexAttribs1dvNV, vFuip) +GO(glVertexAttribs1fvNV, vFuip) +GO(glVertexAttribs1svNV, vFuip) +GO(glVertexAttribs2dvNV, vFuip) +GO(glVertexAttribs2fvNV, vFuip) +GO(glVertexAttribs2svNV, vFuip) +GO(glVertexAttribs3dvNV, vFuip) +GO(glVertexAttribs3fvNV, vFuip) +GO(glVertexAttribs3svNV, vFuip) +GO(glVertexAttribs4dvNV, vFuip) +GO(glVertexAttribs4fvNV, vFuip) +GO(glVertexAttribs4svNV, vFuip) +GO(glVertexAttribs4ubvNV, vFuip) +//NV_vertex_program4 +GO(glGetVertexAttribIivEXT, vFuup) +GO(glGetVertexAttribIuivEXT, vFuup) +GO(glVertexAttribI1iEXT, vFui) +GO(glVertexAttribI1ivEXT, vFup) +GO(glVertexAttribI1uiEXT, vFuu) +GO(glVertexAttribI1uivEXT, vFup) +GO(glVertexAttribI2iEXT, vFuii) +GO(glVertexAttribI2ivEXT, vFup) +GO(glVertexAttribI2uiEXT, vFuuu) +GO(glVertexAttribI2uivEXT, vFup) +GO(glVertexAttribI3iEXT, vFuiii) +GO(glVertexAttribI3ivEXT, vFup) +GO(glVertexAttribI3uiEXT, vFuuuu) +GO(glVertexAttribI3uivEXT, vFup) +GO(glVertexAttribI4bvEXT, vFup) +GO(glVertexAttribI4iEXT, vFuiiii) +GO(glVertexAttribI4ivEXT, vFup) +GO(glVertexAttribI4svEXT, vFup) +GO(glVertexAttribI4ubvEXT, vFup) +GO(glVertexAttribI4uiEXT, vFuuuuu) +GO(glVertexAttribI4uivEXT, vFup) +GO(glVertexAttribI4usvEXT, vFup) +GO(glVertexAttribIPointerEXT, vFuiuip) +//NV_video_capture +GO(glBeginVideoCaptureNV, vFu) +GO(glBindVideoCaptureStreamBufferNV, vFuuul) +GO(glBindVideoCaptureStreamTextureNV, vFuuuuu) +GO(glEndVideoCaptureNV, vFu) +GO(glGetVideoCaptureStreamdvNV, vFuuup) +GO(glGetVideoCaptureStreamfvNV, vFuuup) +GO(glGetVideoCaptureStreamivNV, vFuuup) +GO(glGetVideoCaptureivNV, vFuup) +GO(glVideoCaptureNV, uFupp) +GO(glVideoCaptureStreamParameterdvNV, vFuuup) +GO(glVideoCaptureStreamParameterfvNV, vFuuup) +GO(glVideoCaptureStreamParameterivNV, vFuuup) +//OES_byte_coordinates +GO(glMultiTexCoord1bOES, vFuc) +GO(glMultiTexCoord1bvOES, vFup) +GO(glMultiTexCoord2bOES, vFucc) +GO(glMultiTexCoord2bvOES, vFup) +GO(glMultiTexCoord3bOES, vFuccc) +GO(glMultiTexCoord3bvOES, vFup) +GO(glMultiTexCoord4bOES, vFucccc) +GO(glMultiTexCoord4bvOES, vFup) +GO(glTexCoord1bOES, vFc) +GO(glTexCoord1bvOES, vFp) +GO(glTexCoord2bOES, vFcc) +GO(glTexCoord2bvOES, vFp) +GO(glTexCoord3bOES, vFccc) +GO(glTexCoord3bvOES, vFp) +GO(glTexCoord4bOES, vFcccc) +GO(glTexCoord4bvOES, vFp) +GO(glVertex2bOES, vFcc) +GO(glVertex2bvOES, vFp) +GO(glVertex3bOES, vFccc) +GO(glVertex3bvOES, vFp) +GO(glVertex4bOES, vFcccc) +GO(glVertex4bvOES, vFp) +//OES_fixed_point +GO(glAccumxOES, vFui) +GO(glAlphaFuncxOES, vFui) +GO(glBitmapxOES, vFiiiiiip) +GO(glBlendColorxOES, vFiiii) +GO(glClearAccumxOES, vFiiii) +GO(glClearColorxOES, vFiiii) +GO(glClearDepthxOES, vFi) +GO(glClipPlanexOES, vFup) +GO(glColor3xOES, vFiii) +GO(glColor3xvOES, vFp) +GO(glColor4xOES, vFiiii) +GO(glColor4xvOES, vFp) +GO(glConvolutionParameterxOES, vFuui) +GO(glConvolutionParameterxvOES, vFuup) +GO(glDepthRangexOES, vFii) +GO(glEvalCoord1xOES, vFi) +GO(glEvalCoord1xvOES, vFp) +GO(glEvalCoord2xOES, vFii) +GO(glEvalCoord2xvOES, vFp) +GO(glFeedbackBufferxOES, vFiup) +GO(glFogxOES, vFui) +GO(glFogxvOES, vFup) +GO(glFrustumxOES, vFiiiiii) +GO(glGetClipPlanexOES, vFup) +GO(glGetConvolutionParameterxvOES, vFuup) +GO(glGetFixedvOES, vFup) +GO(glGetHistogramParameterxvOES, vFuup) +GO(glGetLightxOES, vFuup) +GO(glGetMapxvOES, vFuup) +GO(glGetMaterialxOES, vFuui) +GO(glGetPixelMapxv, vFuip) +GO(glGetTexEnvxvOES, vFuup) +GO(glGetTexGenxvOES, vFuup) +GO(glGetTexLevelParameterxvOES, vFuiup) +GO(glGetTexParameterxvOES, vFuup) +GO(glIndexxOES, vFi) +GO(glIndexxvOES, vFp) +GO(glLightModelxOES, vFui) +GO(glLightModelxvOES, vFup) +GO(glLightxOES, vFuui) +GO(glLightxvOES, vFuup) +GO(glLineWidthxOES, vFi) +GO(glLoadMatrixxOES, vFp) +GO(glLoadTransposeMatrixxOES, vFp) +GO(glMap1xOES, vFuiiiii) +GO(glMap2xOES, vFuiiiiiiiii) +GO(glMapGrid1xOES, vFiii) +GO(glMapGrid2xOES, vFiiiii) +GO(glMaterialxOES, vFuui) +GO(glMaterialxvOES, vFuup) +GO(glMultMatrixxOES, vFp) +GO(glMultTransposeMatrixxOES, vFp) +GO(glMultiTexCoord1xOES, vFui) +GO(glMultiTexCoord1xvOES, vFup) +GO(glMultiTexCoord2xOES, vFuii) +GO(glMultiTexCoord2xvOES, vFup) +GO(glMultiTexCoord3xOES, vFuiii) +GO(glMultiTexCoord3xvOES, vFup) +GO(glMultiTexCoord4xOES, vFuiiii) +GO(glMultiTexCoord4xvOES, vFup) +GO(glNormal3xOES, vFiii) +GO(glNormal3xvOES, vFp) +GO(glOrthoxOES, vFiiiiii) +GO(glPassThroughxOES, vFi) +GO(glPixelMapx, vFuip) +GO(glPixelStorex, vFui) +GO(glPixelTransferxOES, vFui) +GO(glPixelZoomxOES, vFii) +GO(glPointParameterxvOES, vFup) +GO(glPointSizexOES, vFi) +GO(glPolygonOffsetxOES, vFii) +GO(glPrioritizeTexturesxOES, vFipp) +GO(glRasterPos2xOES, vFii) +GO(glRasterPos2xvOES, vFp) +GO(glRasterPos3xOES, vFiii) +GO(glRasterPos3xvOES, vFp) +GO(glRasterPos4xOES, vFiiii) +GO(glRasterPos4xvOES, vFp) +GO(glRectxOES, vFiiii) +GO(glRectxvOES, vFpp) +GO(glRotatexOES, vFiiii) +GO(glSampleCoverageOES, vFii) +GO(glScalexOES, vFiii) +GO(glTexCoord1xOES, vFi) +GO(glTexCoord1xvOES, vFp) +GO(glTexCoord2xOES, vFii) +GO(glTexCoord2xvOES, vFp) +GO(glTexCoord3xOES, vFiii) +GO(glTexCoord3xvOES, vFp) +GO(glTexCoord4xOES, vFiiii) +GO(glTexCoord4xvOES, vFp) +GO(glTexEnvxOES, vFuui) +GO(glTexEnvxvOES, vFuup) +GO(glTexGenxOES, vFuui) +GO(glTexGenxvOES, vFuup) +GO(glTexParameterxOES, vFuui) +GO(glTexParameterxvOES, vFuup) +GO(glTranslatexOES, vFiii) +GO(glVertex2xOES, vFi) +GO(glVertex2xvOES, vFp) +GO(glVertex3xOES, vFii) +GO(glVertex3xvOES, vFp) +GO(glVertex4xOES, vFiii) +GO(glVertex4xvOES, vFp) +//OES_query_matrix +GO(glQueryMatrixxOES, uFpp) +//OES_single_precision +GO(glClearDepthfOES, vFf) +GO(glClipPlanefOES, vFup) +GO(glDepthRangefOES, vFff) +GO(glFrustumfOES, vFffffff) +GO(glGetClipPlanefOES, vFup) +GO(glOrthofOES, vFffffff) +//PGI_misc_hints +GO(glHintPGI, vFui) +//SGIS_detail_texture +GO(glDetailTexFuncSGIS, vFuip) +GO(glGetDetailTexFuncSGIS, vFup) +//SGIS_fog_function +GO(glFogFuncSGIS, vFip) +GO(glGetFogFuncSGIS, vFp) +//SGIS_multisample +GO(glSampleMaskSGIS, vFfC) +GO(glSamplePatternSGIS, vFu) +//SGIS_pixel_texture +GO(glGetPixelTexGenParameterfvSGIS, vFup) +GO(glGetPixelTexGenParameterivSGIS, vFup) +GO(glPixelTexGenParameterfSGIS, vFuf) +GO(glPixelTexGenParameterfvSGIS, vFup) +GO(glPixelTexGenParameteriSGIS, vFui) +GO(glPixelTexGenParameterivSGIS, vFup) +//SGIS_point_parameters +GO(glPointParameterfSGIS, vFuf) +GO(glPointParameterfvSGIS, vFup) +//SGIS_sharpen_texture +GO(glGetSharpenTexFuncSGIS, vFup) +GO(glSharpenTexFuncSGIS, vFuip) +//SGIS_texture4D +GO(glTexImage4DSGIS, vFuiuiiiiiuup) +GO(glTexSubImage4DSGIS, vFuiiiiiiiiiuup) +//SGIS_texture_color_mask +GO(glTextureColorMaskSGIS, vFCCCC) +//SGIS_texture_filter4 +GO(glGetTexFilterFuncSGIS, vFuup) +GO(glTexFilterFuncSGIS, vFuuip) +//SGIX_async +GO(glAsyncMarkerSGIX, vFu) +GO(glDeleteAsyncMarkersSGIX, vFui) +GO(glFinishAsyncSGIX, iFp) +GO(glGenAsyncMarkersSGIX, uFi) +GO(glIsAsyncMarkerSGIX, CFu) +GO(glPollAsyncSGIX, iFp) +//SGIX_flush_raster +GO(glFlushRasterSGIX, vFv) +//SGIX_fragment_lighting +GO(glFragmentColorMaterialSGIX, vFuu) +GO(glFragmentLightModelfSGIX, vFuf) +GO(glFragmentLightModelfvSGIX, vFup) +GO(glFragmentLightModeliSGIX, vFui) +GO(glFragmentLightModelivSGIX, vFup) +GO(glFragmentLightfSGIX, vFuuf) +GO(glFragmentLightfvSGIX, vFuup) +GO(glFragmentLightiSGIX, vFuui) +GO(glFragmentLightivSGIX, vFuup) +GO(glFragmentMaterialfSGIX, vFuuf) +GO(glFragmentMaterialfvSGIX, vFuup) +GO(glFragmentMaterialiSGIX, vFuui) +GO(glFragmentMaterialivSGIX, vFuup) +GO(glGetFragmentLightfvSGIX, vFuup) +GO(glGetFragmentLightivSGIX, vFuup) +GO(glGetFragmentMaterialfvSGIX, vFuup) +GO(glGetFragmentMaterialivSGIX, vFuup) +GO(glLightEnviSGIX, vFui) +//SGIX_framezoom +GO(glFrameZoomSGIX, vFi) +//SGIX_igloo_interface +GO(glIglooInterfaceSGIX, vFup) +//SGIX_instruments +GO(glGetInstrumentsSGIX, iFv) +GO(glInstrumentsBufferSGIX, vFip) +GO(glPollInstrumentsSGIX, iFp) +GO(glReadInstrumentsSGIX, vFi) +GO(glStartInstrumentsSGIX, vFv) +GO(glStopInstrumentsSGIX, vFi) +//SGIX_list_priority +GO(glGetListParameterfvSGIX, vFuup) +GO(glGetListParameterivSGIX, vFuup) +GO(glListParameterfSGIX, vFuuf) +GO(glListParameterfvSGIX, vFuup) +GO(glListParameteriSGIX, vFuui) +GO(glListParameterivSGIX, vFuup) +//SGIX_pixel_texture +GO(glPixelTexGenSGIX, vFu) +//SGIX_polynomial_ffd +GO(glDeformSGIX, vFu) +GO(glDeformationMap3dSGIX, vFuddiiddiiddiip) +GO(glDeformationMap3fSGIX, vFuffiiffiiffiip) +GO(glLoadIdentityDeformationMapSGIX, vFu) +//SGIX_reference_plane +GO(glReferencePlaneSGIX, vFp) +//SGIX_sprite +GO(glSpriteParameterfSGIX, vFuf) +GO(glSpriteParameterfvSGIX, vFup) +GO(glSpriteParameteriSGIX, vFui) +GO(glSpriteParameterivSGIX, vFup) +//SGIX_tag_sample_buffer +GO(glTagSampleBufferSGIX, vFv) +//SGI_color_table +GO(glColorTableParameterfvSGI, vFuup) +GO(glColorTableParameterivSGI, vFuup) +GO(glColorTableSGI, vFuuiuup) +GO(glCopyColorTableSGI, vFuuiii) +GO(glGetColorTableParameterfvSGI, vFuup) +GO(glGetColorTableParameterivSGI, vFuup) +GO(glGetColorTableSGI, vFuuup) +//SUNX_constant_data +GO(glFinishTextureSUNX, vFv) +//SUN_global_alpha +GO(glGlobalAlphaFactorbSUN, vFc) +GO(glGlobalAlphaFactordSUN, vFd) +GO(glGlobalAlphaFactorfSUN, vFf) +GO(glGlobalAlphaFactoriSUN, vFi) +GO(glGlobalAlphaFactorsSUN, vFw) +GO(glGlobalAlphaFactorubSUN, vFC) +GO(glGlobalAlphaFactoruiSUN, vFu) +GO(glGlobalAlphaFactorusSUN, vFW) +//SUN_mesh_array +GO(glDrawMeshArraysSUN, vFuiii) +//SUN_triangle_list +GO(glReplacementCodePointerSUN, vFuip) +GO(glReplacementCodeubSUN, vFC) +GO(glReplacementCodeubvSUN, vFp) +GO(glReplacementCodeuiSUN, vFu) +GO(glReplacementCodeuivSUN, vFp) +GO(glReplacementCodeusSUN, vFW) +GO(glReplacementCodeusvSUN, vFp) +//SUN_vertex +GO(glColor3fVertex3fSUN, vFffffff) +GO(glColor3fVertex3fvSUN, vFpp) +GO(glColor4fNormal3fVertex3fSUN, vFffffffffff) +GO(glColor4fNormal3fVertex3fvSUN, vFppp) +GO(glColor4ubVertex2fSUN, vFCCCCff) +GO(glColor4ubVertex2fvSUN, vFpp) +GO(glColor4ubVertex3fSUN, vFCCCCfff) +GO(glColor4ubVertex3fvSUN, vFpp) +GO(glNormal3fVertex3fSUN, vFffffff) +GO(glNormal3fVertex3fvSUN, vFpp) +GO(glReplacementCodeuiColor3fVertex3fSUN, vFuffffff) +GO(glReplacementCodeuiColor3fVertex3fvSUN, vFppp) +GO(glReplacementCodeuiColor4fNormal3fVertex3fSUN, vFuffffffffff) +GO(glReplacementCodeuiColor4fNormal3fVertex3fvSUN, vFpppp) +GO(glReplacementCodeuiColor4ubVertex3fSUN, vFuCCCCfff) +GO(glReplacementCodeuiColor4ubVertex3fvSUN, vFppp) +GO(glReplacementCodeuiNormal3fVertex3fSUN, vFuffffff) +GO(glReplacementCodeuiNormal3fVertex3fvSUN, vFppp) +GO(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN, vFuffffffffffff) +GO(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN, vFppppp) +GO(glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN, vFuffffffff) +GO(glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN, vFpppp) +GO(glReplacementCodeuiTexCoord2fVertex3fSUN, vFufffff) +GO(glReplacementCodeuiTexCoord2fVertex3fvSUN, vFppp) +GO(glReplacementCodeuiVertex3fSUN, vFufff) +GO(glReplacementCodeuiVertex3fvSUN, vFpp) +GO(glTexCoord2fColor3fVertex3fSUN, vFffffffff) +GO(glTexCoord2fColor3fVertex3fvSUN, vFppp) +GO(glTexCoord2fColor4fNormal3fVertex3fSUN, vFffffffffffff) +GO(glTexCoord2fColor4fNormal3fVertex3fvSUN, vFpppp) +GO(glTexCoord2fColor4ubVertex3fSUN, vFffCCCCfff) +GO(glTexCoord2fColor4ubVertex3fvSUN, vFppp) +GO(glTexCoord2fNormal3fVertex3fSUN, vFffffffff) +GO(glTexCoord2fNormal3fVertex3fvSUN, vFppp) +GO(glTexCoord2fVertex3fSUN, vFfffff) +GO(glTexCoord2fVertex3fvSUN, vFpp) +GO(glTexCoord4fColor4fNormal3fVertex4fSUN, vFfffffffffffffff) +GO(glTexCoord4fColor4fNormal3fVertex4fvSUN, vFpppp) +GO(glTexCoord4fVertex4fSUN, vFffffffff) +GO(glTexCoord4fVertex4fvSUN, vFpp) + +//GL_ARB_polygon_offset_clamp +GO(glPolygonOffsetClamp, vFfff) + +//GL_EXT_polygon_offset_clamp +GO(glPolygonOffsetClampEXT, vFfff) + +//GL_EXT_multisampled_render_to_texture +GO(glRenderbufferStorageMultisampleEXT, vFuiuii) +GO(glFramebufferTexture2DMultisampleEXT, vFiiiuil) + +//GL_KTX_buffer_region +GO(glBufferRegionEnabled, uFv) +GO(glNewBufferRegion, uFi) +GO(glDeleteBufferRegion, vFi) +GO(glReadBufferRegion, vFuiiii) +GO(glDrawBufferRegion, vFuiiiiii) + +//GL_ARB_sparse_buffer +GO(glBufferPageCommitmentARB, vFullC) +GO(glNamedBufferPageCommitmentARB, vFullC) +GO(glNamedBufferPageCommitmentEXT, vFullC) + +//GL_ARB_sparse_texture +GO(TexPageCommitmentARB, vFiiiiiiiii) + +//glx +GO(glXBindHyperpipeSGIX, iFpi) +GO(glXBindTexImageEXT, vFppip) +GO(glXBindSwapBarrierNV, iFpuu) +GO(glXBindSwapBarrierSGIX,vFii) +GO(glXBindVideoCaptureDeviceNV, iFpup) +GO(glXBindVideoDeviceNV, iFpuup) +GO(glXBindVideoImageNV, iFpppi) +GO(glXChangeDrawableAttributes, vFp) +GO(glXChangeDrawableAttributesSGIX, vFp) +GO(glXClientInfo, vFv) +GO(glXCopyContext, vFppp) +GO(glXChooseFBConfig, pFpipp) +GO(glXChooseFBConfigSGIX, pFpipp) +GO(glXCreateContext,pFpppi) +GO(glXCreateContextAttribsARB, pFpppip) +GO(glXCreateContextWithConfigSGIX, pFppipi) +GO(glXCreateGLXPbufferSGIX, pFppuup) +GO(glXCreateGLXPixmap, pFppp) +GO(glXCreateGLXPixmapWithConfigSGIX, pFppp) +GO(glXCreateGLXVideoSourceSGIX, pFpippip) +GO(glXCreateNewContext, pFppipi) +GO(glXCreatePbuffer, pFppp) +GO(glXCreatePixmap, pFppp) +GO(glXCreateWindow, pFpppp) +GO(glXChooseVisual, pFpip) +GO(glXCopyImageSubDataNV, vFppuiiiiipuiiiiiiii) +GO(glXCopySubBufferMESA, vFppiiii) +GO(glXDestroyContext,vFpp) +GO(glXDestroyGLXPbufferSGIX,vFpp) +GO(glXDestroyGLXPixmap,vFpp) +GO(glXDestroyGLXVideoSourceSGIX,vFpp) +GO(glXDestroyHyperpipeConfigSGIX,iFpi) +GO(glXDestroyPbuffer,vFpp) +GO(glXDestroyPixmap,vFpp) +GO(glXDestroyWindow,vFpp) +GO(glXEnumerateVideoCaptureDevicesNV, pFpip) +GO(glXEnumerateVideoDevicesNV, pFpip) +GO(glXFreeContextEXT, vFpp) +GO(glXGetClientString, pFpi) +GO(glXGetConfig, iFppip) +GO(glXGetContextIDEXT, uFp) +GO(glXGetCurrentContext, pFv) +GO(glXGetCurrentDisplay, pFv) +GO(glXGetCurrentDrawable, pFv) +GO(glXGetCurrentReadDrawable, pFv) +GO(glXGetDrawableAttributes,vFi) +GO(glXGetDrawableAttributesSGIX,vFi) +GO(glXGetFBConfigs,pFpip) +GO(glXGetFBConfigAttrib, iFppip) +GO(glXGetFBConfigAttribSGIX, iFppip) +GO(glXGetFBConfigFromVisualSGIX, pFpp) +GO(glXGetFBConfigsSGIX,pFpip) +GO(glXGetSelectedEvent, vFppp) +GO(glXGetSelectedEventSGIX, vFppp) +GO(glXGetVideoDeviceNV, iFpiip) +GO(glXGetVideoInfoNV, iFpippp) +GO(glXGetVideoSyncSGI, iFp) +GO(glXGetVisualConfigs,pFpp) +GO(glXGetVisualFromFBConfig, pFpp) +GO(glXGetVisualFromFBConfigSGIX, pFpp) +GO(glXHyperpipeAttribSGIX,iFpiiip) +//GO(glXHyperpipeConfigSGIX, iFpiipp) +GO(glXImportContextEXT, pFpu) +GO(glXIsDirect,iFpp) +GO(glXJoinSwapGroupNV, iFppu) +GO(glXJoinSwapGroupSGIX,vFpp) +GO(glXLockVideoCaptureDeviceNV, vFpp) +GO(glXMakeContextCurrent,iFpppp) +GO(glXMakeCurrent,iFppp) +GO(glXQueryContext,iFppip) +GO(glXQueryContextInfoEXT,iFppip) +GO(glXQueryDrawable, iFppip) +GO(glXQueryExtension, iFppp) +GO(glXQueryExtensionsString,pFpi) +GO(glXQueryFrameCountNV, iFpip) +GO(glXQueryGLXPbufferSGIX, vFppip) +GO(glXQueryHyperpipeAttribSGIX,iFpiiip) +GO(glXQueryHyperpipeBestAttribSGIX,iFpiiipp) +GO(glXQueryHyperpipeConfigSGIX,pFpip) +GO(glXQueryHyperpipeNetworkSGIX,pFpp) +GO(glXQueryMaxSwapBarriersSGIX,pFpp) //? +GO(glXQueryMaxSwapGroupsNV, iFpipp) +GO(glXQueryServerString,pFpii) +GO(glXQuerySwapGroupNV, iFpipp) +GO(glXQueryVersion,iFppp) +GO(glXQueryVideoCaptureDeviceNV, iFppip) +GO(glXReleaseTexImageEXT, vFppi) +GO(glXReleaseVideoCaptureDeviceNV, vFpp) +GO(glXReleaseVideoDeviceNV, iFpip) +GO(glXReleaseVideoImageNV, iFpp) +//GO(glXRender, vFv) +//GO(glXRenderLarge, vFv) +GO(glXResetFrameCountNV, iFpi) +GO(glXSelectEvent, vFppu) +GO(glXSelectEventSGIX, vFppu) +GO(glXSendPbufferToVideoNV, iFppipi) +GO(glXSwapBuffers,vFpp) +GO(glXUseXFont,vFpiii) +//GO(glXVendorPrivate, vFv) +//GO(glXVendorPrivateWithReply, vFv) +GO(glXWaitGL,vFv) +GO(glXWaitVideoSyncSGI, iFiip) +GO(glXWaitX,vFv) + +GOM(glXGetProcAddress, pFEp) +GOM(glXGetProcAddressARB, pFEp) + +//GLX_MESA_query_renderer +GO(glXQueryRendererIntegerMESA, iFpiiip) +GO(glXQueryCurrentRendererIntegerMESA, iFip) +GO(glXQueryRendererStringMESA, pFpiii) +GO(glXQueryCurrentRendererStringMESA, pFi) + +//GLX_OML_sync_control +GO(glXGetSyncValuesOML, iFppppp) +GO(glXGetMscRateOML, iFpppp) +GO(glXSwapBuffersMscOML, IFppIII) +GO(glXWaitForMscOML, iFppIIIppp) +GO(glXWaitForSbcOML, iFppIppp) + +//GLX_EXT_swap_control +GOM(glXSwapIntervalEXT,vFEppi) +//GLX_EXT_swap_control_tear +//nothing + +//GLX_MESA_swap_control +GOM(glXSwapIntervalMESA,iFEi) +GO(glXGetSwapIntervalMESA, iFv) + +//GLX_SGI_swap_control +GO(glXSwapIntervalSGI,iFi) + +//GLX_NV_vertex_array_range +GO(glXAllocateMemoryNV, pFlfff) +GO(glXFreeMemoryNV, vFp) + +//GLX_ARB_???? +GO(glSpecializeShaderARB, vFupupp) + +//GLX_AMD_gpu_association +GO(glXGetGPUIDsAMD, uFup) +GO(glXGetGPUInfoAMD, iFuiuup) +GO(glXGetContextGPUIDAMD, uFp) +GO(glXCreateAssociatedContextAMD, pFup) +GO(glXCreateAssociatedContextAttribsAMD, pFupp) +GO(glXDeleteAssociatedContextAMD, iFp) +GO(glXMakeAssociatedContextCurrentAMD, iFp) +GO(glXGetCurrentAssociatedContextAMD, pFv) +GO(glXBlitContextFramebufferAMD, vFpiiiiiiiiuu) + +//GL_EXT_debug_label +GO(glGetObjectLabelEXT, vFuuipp) +GO(glLabelObjectEXT, vFuuip) + +//GL_EXT_debug_marker +GO(glInsertEventMarkerEXT, vFip) +GO(glPushGroupMarkerEXT, vFip) +GO(glPopGroupMarkerEXT, vFv) + +//GL_KHR_blend_equation_advanced +GO(glBlendBarrierKHR, vFv) + +//Some various other extension +GO(glResolveMultisampleFramebufferAPPLE, vFv) +GO(glTexPageCommitmentARB, vFuiiiiiiiC) + +//GL_ARB_sample_locations +GO(glFramebufferSampleLocationsfvARB, vFuuip) +GO(glNamedFramebufferSampleLocationsfvARB, vFuuip) +GO(glEvaluateDepthValuesARB, vFv) + +//GL_ARB_parallel_shader_compile +GO(glMaxShaderCompilerThreadsARB, vFu) + +//GL_ARB_indirect_parameters +GO(glMultiDrawArraysIndirectCountARB, vFuplii) +GO(glMultiDrawElementsIndirectCountARB, vFuuplii) + +//GL_ARB_gpu_shader_int64 +GO(glUniform1i64ARB, vFiI) +GO(glUniform2i64ARB, vFiII) +GO(glUniform3i64ARB, vFiIII) +GO(glUniform4i64ARB, vFiIIII) +GO(glUniform1i64vARB, vFiip) +GO(glUniform2i64vARB, vFiip) +GO(glUniform3i64vARB, vFiip) +GO(glUniform4i64vARB, vFiip) +GO(glUniform1ui64ARB, vFiU) +GO(glUniform2ui64ARB, vFiUU) +GO(glUniform3ui64ARB, vFiUUU) +GO(glUniform4ui64ARB, vFiUUUU) +GO(glUniform1ui64vARB, vFiip) +GO(glUniform2ui64vARB, vFiip) +GO(glUniform3ui64vARB, vFiip) +GO(glUniform4ui64vARB, vFiip) +GO(glGetUniformi64vARB, vFuip) +GO(glGetUniformui64vARB, vFuip) +GO(glGetnUniformi64vARB, vFuiip) +GO(glGetnUniformui64vARB, vFuiip) +GO(glProgramUniform1i64ARB, vFuiI) +GO(glProgramUniform2i64ARB, vFuiII) +GO(glProgramUniform3i64ARB, vFuiIII) +GO(glProgramUniform4i64ARB, vFuiIIII) +GO(glProgramUniform1i64vARB, vFuiip) +GO(glProgramUniform2i64vARB, vFuiip) +GO(glProgramUniform3i64vARB, vFuiip) +GO(glProgramUniform4i64vARB, vFuiip) +GO(glProgramUniform1ui64ARB, vFuiU) +GO(glProgramUniform2ui64ARB, vFuiUU) +GO(glProgramUniform3ui64ARB, vFuiUUU) +GO(glProgramUniform4ui64ARB, vFuiUUUU) +GO(glProgramUniform1ui64vARB, vFuiip) +GO(glProgramUniform2ui64vARB, vFuiip) +GO(glProgramUniform3ui64vARB, vFuiip) +GO(glProgramUniform4ui64vARB, vFuiip) + +//GL_ARB_compute_variable_group_size +GO(glDispatchComputeGroupSizeARB, vFuuuuuu) + +//GL_ARB_ES3_2_compatibility +GO(glPrimitiveBoundingBoxARB, vFffffffff) + +//GL_ARB_bindless_texture +GO(glGetTextureHandleARB, UFu) +GO(glGetTextureSamplerHandleARB, UFuu) +GO(glMakeTextureHandleResidentARB, vFU) +GO(glMakeTextureHandleNonResidentARB, vFU) +GO(glGetImageHandleARB, UFuiCiu) +GO(glMakeImageHandleResidentARB, vFUu) +GO(glMakeImageHandleNonResidentARB, vFU) +GO(glUniformHandleui64ARB, vFiU) +GO(glUniformHandleui64vARB, vFiip) +GO(glProgramUniformHandleui64ARB, vFuiU) +GO(glProgramUniformHandleui64vARB, vFuiip) +GO(glIsTextureHandleResidentARB, CFU) +GO(glIsImageHandleResidentARB, CFU) +GO(glVertexAttribL1ui64ARB, vFuU) +GO(glVertexAttribL1ui64vARB, vFup) +GO(glGetVertexAttribLui64vARB, vFuup) + +//GL_OES_EGL_image +GO(glEGLImageTargetTexture2DOES, vFup) +GO(glEGLImageTargetRenderbufferStorageOES, vFup) + +//GL_MESA_program_debug +GOM(glProgramCallbackMESA, vFEipp) +GO(glGetProgramRegisterfvMESA, vFilpp) + +//GL_????_ATI +GO(glBlendEquationSeparateATI, vFuu) + +//GL_AMD_interleaved_elements +GO(glVertexAttribParameteriAMD, vFuui) + +//GL_AMD_occlusion_query_event +GO(glQueryObjectParameteruiAMD, vFuuuu) + +//GL_EXT_raster_multisample +GO(glRasterSamplesEXT, vFuC) + +//GL_INTEL_performance_query +GO(glBeginPerfQueryINTEL, vFu) +GO(glCreatePerfQueryINTEL, vFup) +GO(glDeletePerfQueryINTEL, vFu) +GO(glEndPerfQueryINTEL, vFu) +GO(glGetFirstPerfQueryIdINTEL, vFp) +GO(glGetNextPerfQueryIdINTEL, vFup) +GO(glGetPerfCounterInfoINTEL, vFuuupupppppp) +GO(glGetPerfQueryDataINTEL, vFuuipp) +GO(glGetPerfQueryIdByNameINTEL, vFpp) +GO(glGetPerfQueryInfoINTEL, vFuuppppp) + +//GL_NV_bindless_multi_draw_indirect +GO(glMultiDrawArraysIndirectBindlessNV, vFupiii) +GO(glMultiDrawElementsIndirectBindlessNV, vFuupiii) + +//GL_NV_bindless_multi_draw_indirect_count +GO(glMultiDrawArraysIndirectBindlessCountNV, vFupiiii) +GO(glMultiDrawElementsIndirectBindlessCountNV, vFuupiiii) + +//GL_NV_blend_equation_advanced +GO(glBlendParameteriNV, vFui) +GO(glBlendBarrierNV, vFv) + +//GL_NV_command_list +GO(glCreateStatesNV, vFip) +GO(glDeleteStatesNV, vFip) +GO(glIsStateNV, CFu) +GO(glStateCaptureNV, vFuu) +GO(glGetCommandHeaderNV, uFuu) +GO(glGetStageIndexNV, WFu) +GO(glDrawCommandsNV, vFuuppu) +GO(glDrawCommandsAddressNV, vFuppu) +GO(glDrawCommandsStatesNV, vFuppppu) +GO(glDrawCommandsStatesAddressNV, vFppppu) +GO(glCreateCommandListsNV, vFip) +GO(glDeleteCommandListsNV, vFip) +GO(glIsCommandListNV, CFu) +GO(glListDrawCommandsStatesClientNV, vFuuppppu) +GO(glCommandListSegmentsNV, vFuu) +GO(glCompileCommandListNV, vFu) +GO(glCallCommandListNV, vFu) + +//GL_NV_conservative_raster +GO(glSubpixelPrecisionBiasNV, vFuu) + +//GL_NV_fragment_coverage_to_color +GO(glFragmentCoverageColorNV, vFu) + +//GL_NV_framebuffer_mixed_samples +GO(glCoverageModulationTableNV, vFip) +GO(glGetCoverageModulationTableNV, vFip) +GO(glCoverageModulationNV, vFu) + +//GL_NV_internalformat_sample_query +GO(glGetInternalformatSampleivNV, vFuuiuip) + +//GL_NV_path_rendering +GO(glGenPathsNV, uFi) +GO(glDeletePathsNV, vFui) +GO(glIsPathNV, CFu) +GO(glPathCommandsNV, vFuipiup) +GO(glPathCoordsNV, vFuiup) +GO(glPathSubCommandsNV, vFuiiipiup) +GO(glPathSubCoordsNV, vFuiiup) +GO(glPathStringNV, vFuuip) +GO(glPathGlyphsNV, vFuupuiupuuf) +GO(glPathGlyphRangeNV, vFuupuuiuuf) +GO(glWeightPathsNV, vFuipp) +GO(glCopyPathNV, vFuu) +GO(glInterpolatePathsNV, vFuuuf) +GO(glTransformPathNV, vFuuup) +GO(glPathParameterivNV, vFuup) +GO(glPathParameteriNV, vFuui) +GO(glPathParameterfvNV, vFuup) +GO(glPathParameterfNV, vFuuf) +GO(glPathDashArrayNV, vFuip) +GO(glPathStencilFuncNV, vFuiu) +GO(glPathStencilDepthOffsetNV, vFff) +GO(glStencilFillPathNV, vFuuu) +GO(glStencilStrokePathNV, vFuiu) +GO(glStencilFillPathInstancedNV, vFiupuuuup) +GO(glStencilStrokePathInstancedNV, vFiupuiuup) +GO(glPathCoverDepthFuncNV, vFu) +GO(glCoverFillPathNV, vFuu) +GO(glCoverStrokePathNV, vFuu) +GO(glCoverFillPathInstancedNV, vFiupuuup) +GO(glCoverStrokePathInstancedNV, vFiupuuup) +GO(glGetPathParameterivNV, vFuup) +GO(glGetPathParameterfvNV, vFuup) +GO(glGetPathCommandsNV, vFup) +GO(glGetPathCoordsNV, vFup) +GO(glGetPathDashArrayNV, vFup) +GO(glGetPathMetricsNV, vFuiupuip) +GO(glGetPathMetricRangeNV, vFuuiip) +GO(glGetPathSpacingNV, vFuiupuffup) +GO(glIsPointInFillPathNV, CFuuff) +GO(glIsPointInStrokePathNV, CFuff) +GO(glGetPathLengthNV, fFuii) +GO(glPointAlongPathNV, CFuiifpppp) +GO(glMatrixLoad3x2fNV, vFup) +GO(glMatrixLoad3x3fNV, vFup) +GO(glMatrixLoadTranspose3x3fNV, vFup) +GO(glMatrixMult3x2fNV, vFup) +GO(glMatrixMult3x3fNV, vFup) +GO(glMatrixMultTranspose3x3fNV, vFup) +GO(glStencilThenCoverFillPathNV, vFuuuu) +GO(glStencilThenCoverStrokePathNV, vFuiuu) +GO(glStencilThenCoverFillPathInstancedNV, vFiupuuuuup) +GO(glStencilThenCoverStrokePathInstancedNV, vFiupuiuuup) +GO(glPathGlyphIndexRangeNV, uFupuufp) +GO(glPathGlyphIndexArrayNV, uFuupuuiuf) +GO(glPathMemoryGlyphIndexArrayNV, uFuulpiuiuf) +GO(glProgramPathFragmentInputGenNV, vFuiuip) +GO(glGetProgramResourcefvNV, vFuuuipipp) +GO(glPathColorGenNV, vFuuup) +GO(glPathTexGenNV, vFuuip) +GO(glPathFogGenNV, vFu) +GO(glGetPathColorGenivNV, vFuup) +GO(glGetPathColorGenfvNV, vFuup) +GO(glGetPathTexGenivNV, vFuup) +GO(glGetPathTexGenfvNV, vFuup) + + +//GL_NV_sample_locations +GO(glFramebufferSampleLocationsfvNV, vFuuip) +GO(glNamedFramebufferSampleLocationsfvNV, vFuuip) +GO(glResolveDepthValuesNV, vFv) + +//GL_KHR_robustness +GO(glGetGraphicsResetStatusKHR, iFv) +GO(glReadnPixelsKHR, vFiilliilp) +GO(glGetnUniformfvKHR, vFuilp) +GO(glGetnUniformivKHR, vFuilp) +GO(glGetnUniformuivKHR, vFuilp) + +// GLES stuff +GO(glDiscardFramebuffer, vFilp) +GO(glDiscardFramebufferARB, vFilp) +GO(glDiscardFramebufferEXT, vFilp) +GO(glDiscardFramebufferOES, vFilp) +GO(glDiscardFramebufferANGLE, vFilp) +GO(glDiscardFramebufferNV, vFilp) +GO(glBlendBarrier, vFv) +GO(glBlendBarrierARB, vFv) +GO(glBlendBarrierEXT, vFv) +GO(glBlendBarrierOES, vFv) +GO(glBlendBarrierANGLE, vFv) +GO(glClearDepthfARB,vFf) +GO(glClipPlanefARB,vFup) +GO(glDepthRangefARB,vFff) +GO(glFrustumfARB,vFffffff) +GO(glGetClipPlanefARB,vFup) +GO(glOrthofARB,vFffffff) +GO(glClipPlanef,vFup) +GO(glFrustumf,vFffffff) +GO(glGetClipPlanef,vFup) +GO(glOrthof,vFffffff) +GO(glActiveShaderProgramEXT, vFuu) +GO(glBindProgramPipelineEXT, vFu) +GO(glCreateShaderProgramvEXT, uFilp) +GO(glDeleteProgramPipelinesEXT, vFilu) +GO(glGenProgramPipelinesEXT, vFlp) +GO(glGetProgramPipelineInfoLogEXT, vFulpp) +GO(glGetProgramPipelineivEXT, vFuip) +GO(glIsProgramPipelineEXT, iFu) +GO(glUseProgramStagesEXT, vFuuu) +GO(glValidateProgramPipelineEXT, vFu) +GO(glPrimitiveBoundingBox, vFffffffff) + +// GL_EXT_window_rectangles +GO(glWindowRectanglesEXT, vFuip) + +// GL_EXT_memory_object +GO(glGetUnsignedBytevEXT, vFup) +GO(glGetUnsignedBytei_vEXT, vFuup) +GO(glDeleteMemoryObjectsEXT, vFip) +GO(glIsMemoryObjectEXT, CFu) +GO(glCreateMemoryObjectsEXT, vFip) +GO(glMemoryObjectParameterivEXT, vFuup) +GO(glGetMemoryObjectParameterivEXT, vFuup) +GO(glTexStorageMem2DEXT, vFuiuiiuU) +GO(glTexStorageMem2DMultisampleEXT, vFuiuiiCuU) +GO(glTexStorageMem3DEXT, vFuiuiiiuU) +GO(glTexStorageMem3DMultisampleEXT, vFuiuiiiCuU) +GO(glBufferStorageMemEXT, vFuluU) +GO(glTextureStorageMem2DEXT, vFuiuiiuU) +GO(glTextureStorageMem2DMultisampleEXT, vFuiuiiCuU) +GO(glTextureStorageMem3DEXT, vFuiuiiiuU) +GO(glTextureStorageMem3DMultisampleEXT, vFuiuiiiCuU) +GO(glNamedBufferStorageMemEXT, vFuluU) +GO(glTexStorageMem1DEXT, vFuiuiuU) +GO(glTextureStorageMem1DEXT, vFuiuiuU) + +// GL_EXT_semaphore +GO(glGenSemaphoresEXT, vFip) +GO(glDeleteSemaphoresEXT, vFip) +GO(glIsSemaphoreEXT, CFu) +GO(glSemaphoreParameterui64vEXT, vFuup) +GO(glGetSemaphoreParameterui64vEXT, vFuup) +GO(glWaitSemaphoreEXT, vFuupupp) +GO(glSignalSemaphoreEXT, vFuupupp) + +// GL_EXT_memory_object_fd +GO(glImportMemoryFdEXT, vFuUui) + +// GL_KHR_parallel_shader_compile +GO(glMaxShaderCompilerThreadsKHR, vFu) + +// GL_AMD_framebuffer_multisample_advanced +GO(glRenderbufferStorageMultisampleAdvancedAMD, vFuiiuii) +GO(glNamedRenderbufferStorageMultisampleAdvancedAMD, vFuiiuii) + +// GL_EXT_semaphore_fd +GO(glImportSemaphoreFdEXT, vFuui) + +// GLX_SGI_make_current_read +GO(glXMakeCurrentReadSGI, iFpppp) +GO(glXGetCurrentReadDrawableSGI, pFv) + +// GL_IMG_multisampled_render_to_texture +GO(glFramebufferTexture2DMultisampleIMG, vFiiiuil) +GO(glRenderbufferStorageMultisampleIMG, vFilill) + +// GL_ANGLE_translated_shader_source +GO(glGetTranslatedShaderSourceANGLE, vFulpp) + +// GL_EXT_EGL_image_storage +GO(glEGLImageTargetTexStorageEXT, vFupp) +GO(glEGLImageTargetTextureStorageEXT, vFupp) + +// GL_EXT_external_buffer +GO(glBufferStorageExternalEXT, vFullpu) +GO(glNamedBufferStorageExternalEXT, vFullpu) + +// GL_EXT_memory_object_win32 +GO(glImportMemoryWin32HandleEXT, vFuUup) +GO(glImportMemoryWin32NameEXT, vFuUup) + +// GL_EXT_semaphore_win32 +GO(glImportSemaphoreWin32HandleEXT, vFuup) +GO(glImportSemaphoreWin32NameEXT, vFuup) + +// GL_EXT_shader_framebuffer_fetch_non_coherent +GO(glFramebufferFetchBarrierEXT, vFv) + +// GL_EXT_win32_keyed_mutex +GO(glAcquireKeyedMutexWin32EXT, CFuUu) +GO(glReleaseKeyedMutexWin32EXT, CFuU) + +// GL_INTEL_framebuffer_CMAA +GO(glApplyFramebufferAttachmentCMAAINTEL, vFv) + +// GL_NV_alpha_to_coverage_dither_control +GO(glAlphaToCoverageDitherControlNV, vFu) + +// GL_NV_clip_space_w_scaling +GO(glViewportPositionWScaleNV, vFuff) + +// GL_NV_conservative_raster_dilate +GO(glConservativeRasterParameterfNV, vFuf) + +// GL_NV_conservative_raster_pre_snap_triangles +GO(glConservativeRasterParameteriNV, vFui) + +// GL_NV_draw_vulkan_image +GO(glDrawVkImageNV, vFUufffffffff) +GOM(glGetVkProcAddrNV, pFEp) +GO(glWaitVkSemaphoreNV, vFU) +GO(glSignalVkSemaphoreNV, vFU) +GO(glSignalVkFenceNV, vFU) + +// GL_NV_gpu_multicast +GO(glRenderGpuMaskNV, vFu) +GO(glMulticastBufferSubDataNV, vFuullp) +GO(glMulticastCopyBufferSubDataNV, vFuuuulll) +GO(glMulticastCopyImageSubDataNV, vFuuuuiiiiuuiiiiiii) +GO(glMulticastBlitFramebufferNV, vFuuiiiiiiiiuu) +GO(glMulticastFramebufferSampleLocationsfvNV, vFuuuip) +GO(glMulticastBarrierNV, vFv) +GO(glMulticastWaitSyncNV, vFuu) +GO(glMulticastGetQueryObjectivNV, vFuuup) +GO(glMulticastGetQueryObjectuivNV, vFuuup) +GO(glMulticastGetQueryObjecti64vNV, vFuuup) +GO(glMulticastGetQueryObjectui64vNV, vFuuup) + +// GL_NV_memory_attachment +GO(glGetMemoryObjectDetachedResourcesuivNV, vFuuiip) +GO(glResetMemoryObjectParameterNV, vFuu) +GO(glTexAttachMemoryNV, vFuuU) +GO(glBufferAttachMemoryNV, vFuuU) +GO(glTextureAttachMemoryNV, vFuuU) +GO(glNamedBufferAttachMemoryNV, vFuuU) + +// GL_NV_mesh_shader +GO(glDrawMeshTasksNV, vFuu) +GO(glDrawMeshTasksIndirectNV, vFl) +GO(glMultiDrawMeshTasksIndirectNV, vFlii) +GO(glMultiDrawMeshTasksIndirectCountNV, vFllii) + +// GL_NV_query_resource +GO(glQueryResourceNV, iFuiup) + +// GL_NV_query_resource_tag +GO(glGenQueryResourceTagNV, vFip) +GO(glDeleteQueryResourceTagNV, vFip) +GO(glQueryResourceTagNV, vFip) + +// GL_NV_scissor_exclusive +GO(glScissorExclusiveArrayvNV, vFuip) +GO(glScissorExclusiveNV, vFiiii) + +// GL_NV_shading_rate_image +GO(glBindShadingRateImageNV, vFu) +GO(glShadingRateImagePaletteNV, vFuuip) +GO(glGetShadingRateImagePaletteNV, vFuup) +GO(glShadingRateImageBarrierNV, vFC) +GO(glShadingRateSampleOrderNV, vFu) +GO(glShadingRateSampleOrderCustomNV, vFuup) +GO(glGetShadingRateSampleLocationivNV, vFuuup) + +// GL_NV_viewport_swizzle +GO(glViewportSwizzleNV, vFuuuuu) + +// GL_OVR_multiview +GO(glFramebufferTextureMultiviewOVR, vFuuuiii) +GO(glNamedFramebufferTextureMultiviewOVR, vFuiuiil) + +// GL_AMD_framebuffer_sample_positions +GO(glFramebufferSamplePositionsfvAMD, vFuuup) +GO(glNamedFramebufferSamplePositionsfvAMD, vFuuup) +GO(glGetFramebufferParameterfvAMD, vFuuuuip) +GO(glGetNamedFramebufferParameterfvAMD, vFuuuuip) + +// GL_ANGLE_framebuffer_blit +GO(glBlitFramebufferANGLE, vFiiiiiiiiui) + +// GL_ANGLE_framebuffer_multisample +GO(glRenderbufferStorageMultisampleANGLE, vFilill) + +// GL_ANGLE_instanced_arrays +GO(glDrawArraysInstancedANGLE, vFiill) +GO(glDrawElementsInstancedANGLE, vFilipl) +GO(glVertexAttribDivisorANGLE, vFuu) + +// GL_ANGLE_timer_query +GO(glBeginQueryANGLE, vFiu) +GO(glDeleteQueriesANGLE, vFlp) +GO(glEndQueryANGLE, vFi) +GO(glGenQueriesANGLE, vFlp) +GO(glGetQueryObjecti64vANGLE, vFuip) +GO(glGetQueryObjectivANGLE, vFuip) +GO(glGetQueryObjectui64vANGLE, vFuip) +GO(glGetQueryObjectuivANGLE, vFuip) +GO(glGetQueryivANGLE, vFiip) +GO(glIsQueryANGLE, iFu) +GO(glQueryCounterANGLE, vFui) + +// GL_APPLE_copy_texture_levels +GO(glCopyTextureLevelsAPPLE, vFuuil) + +// GL_APPLE_framebuffer_multisample +GO(glRenderbufferStorageMultisampleAPPLE, vFilill) + +// GL_APPLE_sync +GO(glFenceSyncAPPLE, pFiu) +GO(glIsSyncAPPLE, iFp) +GO(glDeleteSyncAPPLE, vFp) +GO(glClientWaitSyncAPPLE, iFpuU) +GO(glWaitSyncAPPLE, vFpuU) +GO(glGetInteger64vAPPLE, vFip) +GO(glGetSyncivAPPLE, vFpilpp) + +// GL_EXT_base_instance +GO(glDrawArraysInstancedBaseInstanceEXT, vFiillu) +GO(glDrawElementsInstancedBaseInstanceEXT, vFiliplu) +GO(glDrawElementsInstancedBaseVertexBaseInstanceEXT, vFilipliu) + +// GL_EXT_blend_func_extended +GO(glBindFragDataLocationIndexedEXT, vFuuup) +GO(glGetProgramResourceLocationIndexEXT, iFuip) +GO(glGetFragDataIndexEXT, iFup) + +// GL_EXT_buffer_storage +GO(glBufferStorageEXT, vFilpu) + +// GL_EXT_clear_texture +GO(glClearTexImageEXT, vFuiiip) +GO(glClearTexSubImageEXT, vFuiiiillliip) + +// GL_EXT_copy_image +GO(glCopyImageSubDataEXT, vFuiiiiiuiiiiilll) + +// GL_EXT_draw_buffers +GO(glDrawBuffersEXT, vFlp) + +// GL_EXT_draw_buffers_indexed +GO(glEnableiEXT, vFiu) +GO(glDisableiEXT, vFiu) +GO(glBlendEquationiEXT, vFui) +GO(glBlendEquationSeparateiEXT, vFuii) +GO(glBlendFunciEXT, vFuii) +GO(glBlendFuncSeparateiEXT, vFuiiii) +GO(glColorMaskiEXT, vFuiiii) +GO(glIsEnablediEXT, iFui) + +// GL_EXT_draw_elements_base_vertex +GO(glDrawElementsBaseVertexEXT, vFilipi) +GO(glDrawRangeElementsBaseVertexEXT, vFilulipi) +GO(glDrawElementsInstancedBaseVertexEXT, vFilipli) + +// GL_OES_draw_elements_base_vertex +GO(glDrawElementsBaseVertexOES, vFilipi) +GO(glDrawRangeElementsBaseVertexOES, vFiuulipi) +GO(glDrawElementsInstancedBaseVertexOES, vFilipli) +GO(glMultiDrawElementsBaseVertexEXT, vFipiplp) + +// GL_EXT_fragment_lighting +GO(glFragmentLightModeliEXT, vFii) +GO(glFragmentLightModelfEXT, vFif) +GO(glFragmentLightModelivEXT, vFip) +GO(glFragmentLightModelfvEXT, vFip) +GO(glFragmentLightiEXT, vFiii) +GO(glFragmentLightfEXT, vFiif) +GO(glFragmentLightivEXT, vFiip) +GO(glFragmentLightfvEXT, vFiip) +GO(glGetFragmentLightivEXT, vFiip) +GO(glGetFragmentLightfvEXT, vFiip) +GO(glFragmentMaterialfEXT, vFiif) +GO(glFragmentMaterialiEXT, vFiii) +GO(glFragmentMaterialfvEXT, vFiip) +GO(glFragmentMaterialivEXT, vFiip) +GO(glFragmentColorMaterialEXT, vFii) +GO(glGetFragmentMaterialfvEXT, vFiip) +GO(glGetFragmentMaterialivEXT, vFiip) +GO(glLightEnviEXT, vFii) + +// GL_EXT_instanced_arrays +GO(glVertexAttribDivisorEXT, vFuu) + +// GL_EXT_map_buffer_range +GO(glMapBufferRangeEXT, pFillu) +GO(glFlushMappedBufferRangeEXT, vFill) + +// GL_EXT_multi_draw_indirect +GO(glMultiDrawArraysIndirectEXT, vFipll) +GO(glMultiDrawElementsIndirectEXT, vFiipll) + +// GL_EXT_multiview_draw_buffers +GO(glReadBufferIndexedEXT, vFii) +GO(glDrawBuffersIndexedEXT, vFipp) +GO(glGetIntegeri_vEXT, vFiup) + +// GL_EXT_scene_marker +GO(glBeginSceneEXT, vFv) +GO(glEndSceneEXT, vFv) + +// GL_EXT_shader_pixel_local_storage2 +GO(glFramebufferPixelLocalStorageSizeEXT, vFul) +GO(glGetFramebufferPixelLocalStorageSizeEXT, lFu) +GO(glClearPixelLocalStorageuiEXT, vFllp) + +// GL_EXT_sparse_texture +GO(glTexPageCommitmentEXT, vFiiiiillli) + +// GL_EXT_texture_storage +GO(glTexStorage1DEXT, vFuiui) +GO(glTexStorage2DEXT, vFuiuii) +GO(glTexStorage3DEXT, vFuiuiii) + +// GL_EXT_texture_view +GO(glTextureViewEXT, vFuiuiuuuu) + +// GL_EXT_vertex_array_setXXX +GO(glCreateArraySetExt, pFv) +GO(glBindArraySetEXT, vFp) +GO(glDeleteArraySetsEXT, vFlp) + +// GL_INTEL_texture_scissor +GO(glTexScissorINTEL, vFiff) +GO(glTexScissorFuncINTEL, vFiii) + +// GL_NVX_linked_gpu_multicast +GO(glLGPUNamedBufferSubDataNVX, vFuullp) +GO(glLGPUCopyImageSubDataNVX, vFuuuuiiiiuuiiiiiii) +GO(glLGPUInterlockNVX, vFv) + +// GL_NV_3dvision_settings +GO(glStereoParameteriNV, vFii) +GO(glStereoParameterfNV, vFif) + +// GL_NV_copy_buffer +GO(glCopyBufferSubDataNV, vFiilll) + +// GL_NV_draw_buffers +GO(glDrawBuffersNV, vFlp) + +// GL_NV_draw_instanced +GO(glDrawArraysInstancedNV, vFiill) +GO(glDrawElementsInstancedNV, vFilipl) + +// GL_NV_framebuffer_blit +GO(glBlitFramebufferNV, vFiiiiiiiiui) + +// GL_NV_framebuffer_multisample +GO(glRenderbufferStorageMultisampleNV, vFilill) + +// GL_NV_instanced_arrays +GO(glVertexAttribDivisorNV, vFuu) + +// GL_NV_non_square_matrices +GO(glUniformMatrix2x3fvNV, vFilip) +GO(glUniformMatrix3x2fvNV, vFilip) +GO(glUniformMatrix2x4fvNV, vFilip) +GO(glUniformMatrix4x2fvNV, vFilip) +GO(glUniformMatrix3x4fvNV, vFilip) +GO(glUniformMatrix4x3fvNV, vFilip) + +// GL_NV_polygon_mode +GO(glPolygonModeNV, vFii) + +// GL_NV_texture_array +GO(glTexImage3DNV, vFiiillliiip) +GO(glTexSubImage3DNV, vFiiiiillliip) +GO(glCopyTexSubImage3DNV, vFiiiiiiill) +GO(glCompressedTexImage3DNV, vFiiilllilp) +GO(glCompressedTexSubImage3DNV, vFiiiiilllilp) +GO(glFramebufferTextureLayerNV, vFiiuii) + +// GL_NV_viewport_array +GO(glViewportArrayvNV, vFulp) +GO(glViewportIndexedfNV, vFuffff) +GO(glViewportIndexedfvNV, vFup) +GO(glScissorArrayvNV, vFulp) +GO(glScissorIndexedNV, vFuiill) +GO(glScissorIndexedvNV, vFup) +GO(glDepthRangeArrayfvNV, vFulp) +GO(glDepthRangeIndexedfNV, vFuff) +GO(glGetFloati_vNV, vFiup) +GO(glEnableiNV, vFiu) +GO(glDisableiNV, vFiu) +GO(glIsEnablediNV, iFiu) + +// GL_OVR_multiview_multisampled_render_to_texture +GO(glFramebufferTextureMultisampleMultiviewOVR, vFiiuilil) + +// GL_QCOM_alpha_test +GO(glAlphaFuncQCOM, vFif) + +// GL_QCOM_driver_control +GO(glGetDriverControlsQCOM, vFplp) +GO(glGetDriverControlStringQCOM, vFulpp) +GO(glEnableDriverControlQCOM, vFu) +GO(glDisableDriverControlQCOM, vFu) + +// GL_QCOM_extended_get +GO(glExtGetTexturesQCOM, vFpip) +GO(glExtGetBuffersQCOM, vFpip) +GO(glExtGetRenderbuffersQCOM, vFpip) +GO(glExtGetFramebuffersQCOM, vFpip) +GO(glExtGetTexLevelParameterivQCOM, vFuiiip) +GO(glExtTexObjectStateOverrideiQCOM, vFiii) +GO(glExtGetTexSubImageQCOM, vFiiiiillliip) +GO(glExtGetBufferPointervQCOM, vFip) + +// GL_QCOM_extended_get2 +GO(glExtGetShadersQCOM, vFpip) +GO(glExtGetProgramsQCOM, vFpip) +GO(glExtIsProgramBinaryQCOM, iFu) +GO(glExtGetProgramBinarySourceQCOM, vFuipp) + +// GL_QCOM_framebuffer_foveated +GO(glFramebufferFoveationConfigQCOM, vFuuuup) +GO(glFramebufferFoveationParametersQCOM, vFuuufffff) + +// GL_QCOM_shader_framebuffer_fetch_noncoherent +GO(glFramebufferFetchBarrierQCOM, vFv) + +// GL_QCOM_tiled_rendering +GO(glStartTilingQCOM, vFuuuuu) +GO(glEndTilingQCOM, vFu) + +// GLES fixed point +GO(glAlphaFuncx, vFii) +GO(glClearColorx, vFiiii) +GO(glClearDepthx, vFi) +GO(glClipPlanex, vFip) +GO(glColor4x, vFiiii) +GO(glDepthRangex, vFii) +GO(glFogx, vFii) +GO(glFogxv, vFip) +GO(glFrustumx, vFiiiiii) +GO(glGetClipPlanex, vFip) +GO(glGetFixedv, vFip) +GO(glGetTexEnvxv, vFiip) +GO(glGetTexParameterxv, vFiip) +GO(glLightModelx, vFii) +GO(glLightModelxv, vFip) +GO(glLightx, vFiii) +GO(glLightxv, vFiip) +GO(glLineWidthx, vFi) +GO(glLoadMatrixx, vFp) +GO(glMaterialx, vFiii) +GO(glMaterialxv, vFiip) +GO(glMultMatrixx, vFp) +GO(glMultiTexCoord4x, vFiiiii) +GO(glNormal3x, vFiiii) +GO(glOrthox, vFiiiiii) +GO(glPointParameterxv, vFip) +GO(glPointSizex, vFi) +GO(glPolygonOffsetx, vFii) +GO(glRotatex, vFiiii) +GO(glScalex, vFiii) +GO(glTexEnvx, vFiii) +GO(glTexEnvxv, vFiip) +GO(glTexParameterx, vFiii) +GO(glTexParameterxv, vFiip) +GO(glTranslatex, vFiii) +GO(glAccumx, vFii) +GO(glBitmapx, vFlliiiip) +GO(glBlendColorx, vFiiii) +GO(glClearAccumx, vFiiii) +GO(glColor3x, vFiii) +GO(glColor3xv, vFp) +GO(glColor4xv, vFp) +GO(glConvolutionParameterx, vFiii) +GO(glConvolutionParameterxv, vFiip) +GO(glEvalCoord1x, vFi) +GO(glEvalCoord1xv, vFp) +GO(glEvalCoord2x, vFii) +GO(glEvalCoord2xv, vFp) +GO(glFeedbackBufferx, vFlip) +GO(glGetConvolutionParameterxv, vFiip) +GO(glGetHistogramParameterxv, vFiip) +GO(glGetLightx, vFiip) +GO(glGetMapxv, vFiip) +GO(glGetMaterialx, vFiii) +GO(glGetTexGenxv, vFiip) +GO(glGetTexLevelParameterxv, vFiiip) +GO(glIndexx, vFi) +GO(glIndexxv, vFp) +GO(glLoadTransposeMatrixx, vFp) +GO(glMap1x, vFiiiiii) +GO(glMap2x, vFiiiiiiiiii) +GO(glMapGrid1x, vFiii) +GO(glMapGrid2x, vFiiiii) +GO(glMultTransposeMatrixx, vFp) +GO(glMultiTexCoord1x, vFii) +GO(glMultiTexCoord1xv, vFip) +GO(glMultiTexCoord2x, vFiii) +GO(glMultiTexCoord2xv, vFip) +GO(glMultiTexCoord3x, vFiiii) +GO(glMultiTexCoord3xv, vFip) +GO(glMultiTexCoord4xv, vFip) +GO(glNormal3xv, vFp) +GO(glPassThroughx, vFi) +GO(glPixelM, vFiip) +GO(glPixelSto, vFii) +GO(glPixelTransferx, vFii) +GO(glPixelZoomx, vFii) +GO(glPrioritizeTexturesx, vFlpp) +GO(glRasterPos2x, vFii) +GO(glRasterPos2xv, vFp) +GO(glRasterPos3x, vFiii) +GO(glRasterPos3xv, vFp) +GO(glRasterPos4x, vFiiii) +GO(glRasterPos4xv, vFp) +GO(glRectx, vFiiii) +GO(glRectxv, vFpp) +GO(glTexCoord1x, vFi) +GO(glTexCoord1xv, vFp) +GO(glTexCoord2x, vFii) +GO(glTexCoord2xv, vFp) +GO(glTexCoord3x, vFiii) +GO(glTexCoord3xv, vFp) +GO(glTexCoord4x, vFiiii) +GO(glTexCoord4xv, vFp) +GO(glTexGenx, vFiii) +GO(glTexGenxv, vFiip) +GO(glVertex2x, vFi) +GO(glVertex2xv, vFp) +GO(glVertex3x, vFii) +GO(glVertex3xv, vFp) +GO(glVertex4x, vFiii) +GO(glVertex4xv, vFp) + +// GL_OES_point_size +GO(glPointSizePointerOES, vFilp) + +// GL_REGAL_error_string +GO(glErrorStringREGAL, pFi) + +// GL_REGAL_extension_query +GO(glGetExtensionREGAL, iFp) +GO(glIsSupportedREGAL, iFp) + +//glLogMessageCallbackREGAL +//glGetProcAddressREGAL + +// GL_SGIS_multitexture +GO(glInterleavedTextureCoordSetsSGIS, vFi) +GO(glSelectTextureCoordSetSGIS, vFi) +GO(glSelectTextureSGIS, vFi) +GO(glSelectTextureTransformSGIS, vFi) + +// GL_SGIS_shared_multisample +GO(glMultisampleSubRectPosSGIS, vFii) + +// GL_SGIX_datapipe +GO(glAddressSpace, vFiu) +GO(glDataPipe, iFi) + +// GL_SGIX_fog_layers +GO(glFogLayersSGIX, vFlp) +GO(glGetFogLayersSGIX, vFp) + +// GL_SGIX_fog_texture +GO(glTextureFogSGIX, vFu) + +// GL_ANGLE_request_extension +GO(glDisableExtensionANGLE, vFp) +GO(glRequestExtensionANGLE, vFp) + +// GL_KHR_debug +GO(glDebugMessageControlKHR, vFiiilpi) +GO(glDebugMessageInsertKHR, vFiiuilp) +GOM(glDebugMessageCallbackKHR, vFEpp) +GO(glGetDebugMessageLogKHR, uFulpppppp) +GO(glPushDebugGroupKHR, vFiulp) +GO(glPopDebugGroupKHR, vFv) +GO(glObjectLabelKHR, vFiulp) +GO(glGetObjectLabelKHR, vFiulpp) +GO(glObjectPtrLabelKHR, vFplp) +GO(glGetObjectPtrLabelKHR, vFplpp) +GO(glGetPointervKHR, vFip) + +// WGL_EXT_swap_control +GO(wglSwapIntervalEXT, iFi) +GO(wglGetSwapIntervalEXT, iFv) + +// GL_MESA_framebuffer_flip_y +GO(glFramebufferParameteriMESA, vFuui) +GO(glGetFramebufferParameterivMESA, vFuup) + +// GL_NVX_gpu_multicast2 +GO(glUploadGpuMaskNVX, vFu) +GO(glMulticastViewportArrayvNVX, vFuuip) +GO(glMulticastViewportPositionWScaleNVX, vFuuff) +GO(glMulticastScissorArrayvNVX, vFuuip) +GO(glAsyncCopyBufferSubDataNVX, uFippuuuulllipp) +GO(glAsyncCopyImageSubDataNVX, uFippuuuuiiiiuuiiiiiiiipp) + +// GL_NVX_progress_fence +GO(glCreateProgressFenceNVX, uFv) +GO(glSignalSemaphoreui64NVX, vFuipp) +GO(glWaitSemaphoreui64NVX, vFuipp) +GO(glClientWaitSemaphoreui64NVX, vFipp) + +// GL_NV_memory_object_sparse +GO(glBufferPageCommitmentMemNV, vFulluUC) +GO(glTexPageCommitmentMemNV, vFuiiiiiiiiuUC) +GO(glNamedBufferPageCommitmentMemNV, vFulluUC) +GO(glTexturePageCommitmentMemNV, vFuiiiiiiiiuUC) + +// GL_NV_vdpau_interop2 +GO(glVDPAURegisterVideoSurfaceWithPictureStructureNV, lFpuipC) + +// Base EGL +GO(eglBindAPI, iFi) +GO(eglBindTexImage, iFppi) +GO(eglChooseConfig, iFpppip) +GO(eglClientWaitSync, iFppiU) +GO(eglCopyBuffers, iFppp) +GO(eglCreateContext, pFpppp) +GO(eglCreateImage, pFppuup) +GO(eglCreatePbufferFromClientBuffer, pFpippp) +GO(eglCreatePbufferSurface, pFppp) +GO(eglCreatePixmapSurface, pFpppp) +GO(eglCreatePlatformPixmapSurface, pFpppp) +GO(eglCreatePlatformWindowSurface, pFpppp) +GO(eglCreateSync, pFpup) +GO(eglCreateWindowSurface, pFpppp) +GO(eglDestroyContext, iFpp) +GO(eglDestroyImage, iFpp) +GO(eglDestroySurface, iFpp) +GO(eglDestroySync, iFpp) +GO(eglGetConfigAttrib, iFppip) +GO(eglGetConfigs, iFppip) +GO(eglGetCurrentContext, pFv) +GO(eglGetCurrentDisplay, pFv) +GO(eglGetCurrentSurface, pFi) +GO(eglGetDisplay, pFp) +GO(eglGetError, iFv) +GO(eglGetPlatformDisplay, pFppp) +//GOM(eglGetProcAddress, pFEp) +GO(eglGetSyncAttrib, iFppip) +GO(eglInitialize, iFppp) +GO(eglMakeCurrent, iFpppp) +GO(eglQueryAPI, iFv) +GO(eglQueryContext, iFppip) +GO(eglQueryString, pFpi) +GO(eglQuerySurface, iFppip) +GO(eglReleaseTexImage, iFppi) +GO(eglReleaseThread, iFv) +GO(eglSurfaceAttrib, iFppii) +GO(eglSwapBuffers, iFpp) +GO(eglSwapInterval, iFpi) +GO(eglTerminate, iFp) +GO(eglWaitClient, iFv) +GO(eglWaitGL, iFv) +GO(eglWaitNative, iFi) +GO(eglWaitSync, iFppi) + +// EGL_KHR_debug +GOM(eglDebugMessageControlKHR, iFEpp) +GO(eglQueryDebugKHR, iFip) +GO(eglLabelObjectKHR, iFpupp) + +// EGL_MESA_image_dma_buf_export +GO(eglExportDMABUFImageQueryMESA, iFppppp) +GO(eglExportDMABUFImageMESA, iFppppp) + +// EGL_ANGLE_sync_control_rate +GO(eglGetMscRateANGLE, iFpppp) + +// EGL_CHROMIUM_sync_control +GO(eglGetSyncValuesCHROMIUM, iFppppp) + +// EGL_EXT_device_query +GO(eglQueryDeviceAttribEXT, iFpip) +GO(eglQueryDeviceStringEXT, pFpi) +GO(eglQueryDisplayAttribEXT, iFpip) + +// EGL_EXT_device_enumeration +GO(eglQueryDevicesEXT, iFipp) + +// EGL_EXT_device_persistent_id +GO(eglQueryDeviceBinaryEXT, iFpiipp) + +// EGL_EXT_image_dma_buf_import_modifiers +GO(eglQueryDmaBufFormatsEXT, iFpipp) +GO(eglQueryDmaBufModifiersEXT, iFpiippp) + +// EGL_ANDROID_blob_cache +GOM(eglSetBlobCacheFuncsANDROID, vFEppp) + +// EGL_KHR_swap_buffers_with_damage +GO(eglSwapBuffersWithDamageKHR, iFpppi) + +// EGL_KHR_wait_sync +GO(eglWaitSyncKHR, iFppi) + +// EGL_KHR_image_base +GO(eglCreateImageKHR, pFppupp) +GO(eglDestroyImageKHR, iFpp) + +// EGL_KHR_fence_sync +GO(eglCreateSyncKHR, pFpup) +GO(eglDestroySyncKHR, iFpp) +GO(eglClientWaitSyncKHR, iFppiU) +GO(eglGetSyncAttribKHR, iFppip) + +// EGL_ANDROID_native_fence_sync +GO(eglDupNativeFenceFDANDROID, iFpp) + +// EGL_NV_post_sub_buffer +GO(eglPostSubBufferNV, iFppiiii) + +// EGL_EXT_platform_base +GO(eglGetPlatformDisplayEXT, pFupp) +GO(eglCreatePlatformWindowSurfaceEXT, pFpppp) +GO(eglCreatePlatformPixmapSurfaceEXT, pFpppp) + +// GL_EXT_clip_control +GO(glClipControlEXT, vFuu) + +// GL_EXT_disjoint_timer_query +GO(glGenQueriesEXT, vFlp) +GO(glDeleteQueriesEXT, vFlp) +GO(glIsQueryEXT, iFu) +GO(glBeginQueryEXT, vFuu) +GO(glEndQueryEXT, vFu) +GO(glQueryCounterEXT, vFuu) +GO(glGetQueryivEXT, vFuup) +GO(glGetQueryObjectivEXT, vFuup) +GO(glGetQueryObjectuivEXT, vFuup) +GO(glGetQueryObjecti64vEXT, vFuup) +GO(glGetQueryObjectui64vEXT, vFuup) +GO(glGetInteger64vEXT, vFup) + +// GL_OES_mapbuffer +GO(glGetBufferPointervOES, vFuup) +GO(glMapBufferOES, pFuu) +GO(glUnmapBufferOES, iFu) + +// GLX_NV_copy_buffer +GO(glXCopyBufferSubDataNV, vFpppuulll) +GO(glXNamedCopyBufferSubDataNV, vFpppuulll) + +// GLX_NV_delay_before_swap +GO(glXDelayBeforeSwapNV, iFppf) + +// GL_ARB_viewport_array +GO(glDepthRangeArraydvNV, vFuip) +GO(glDepthRangeIndexeddNV, vFudd) diff --git a/src/wrapped/wrappedlibgpgme.c b/src/wrapped/wrappedlibgpgme.c new file mode 100644 index 0000000..0e08e03 --- /dev/null +++ b/src/wrapped/wrappedlibgpgme.c @@ -0,0 +1,147 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* libgpgmeName = "libgpgme.so.11"; +#define LIBNAME libgpgme + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedlibgpgmetypes.h" + +#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) + +typedef struct my_gpgme_data_cbs_s +{ + ssize_t (*read)(void*, void*, size_t); + ssize_t (*write)(void*, void*, size_t); + off_t (*seek) (void*, off_t, int); + void (*release) (void*); +} my_gpgme_data_cbs_t; + + +// read +#define GO(A) \ +static uintptr_t my_read_fct_##A = 0; \ +static ssize_t my_read_##A(void* a, void* b, size_t c) \ +{ \ + return (ssize_t)RunFunctionFmt(my_read_fct_##A, "ppL", a, b, c); \ +} +SUPER() +#undef GO +static void* find_read_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_read_fct_##A == (uintptr_t)fct) return my_read_##A; + SUPER() + #undef GO + #define GO(A) if(my_read_fct_##A == 0) {my_read_fct_##A = (uintptr_t)fct; return my_read_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libgpgme read callback\n"); + return NULL; +} +// write +#define GO(A) \ +static uintptr_t my_write_fct_##A = 0; \ +static ssize_t my_write_##A(void* a, void* b, size_t c) \ +{ \ + return (ssize_t)RunFunctionFmt(my_write_fct_##A, "ppL", a, b, c); \ +} +SUPER() +#undef GO +static void* find_write_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_write_fct_##A == (uintptr_t)fct) return my_write_##A; + SUPER() + #undef GO + #define GO(A) if(my_write_fct_##A == 0) {my_write_fct_##A = (uintptr_t)fct; return my_write_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libgpgme write callback\n"); + return NULL; +} +// seek +#define GO(A) \ +static uintptr_t my_seek_fct_##A = 0; \ +static off_t my_seek_##A(void* a, off_t b, int c) \ +{ \ + return (off_t)RunFunctionFmt(my_seek_fct_##A, "pLi", a, b, c); \ +} +SUPER() +#undef GO +static void* find_seek_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_seek_fct_##A == (uintptr_t)fct) return my_seek_##A; + SUPER() + #undef GO + #define GO(A) if(my_seek_fct_##A == 0) {my_seek_fct_##A = (uintptr_t)fct; return my_seek_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libgpgme seek callback\n"); + return NULL; +} +// release +#define GO(A) \ +static uintptr_t my_release_fct_##A = 0; \ +static void my_release_##A(void* a) \ +{ \ + RunFunctionFmt(my_release_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* find_release_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_release_fct_##A == (uintptr_t)fct) return my_release_##A; + SUPER() + #undef GO + #define GO(A) if(my_release_fct_##A == 0) {my_release_fct_##A = (uintptr_t)fct; return my_release_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libgpgme release callback\n"); + return NULL; +} + +#undef SUPER + +EXPORT uint32_t my_gpgme_data_new_from_cbs(x64emu_t* emu, void* data, my_gpgme_data_cbs_t* cbs, void* stream) +{ + my_gpgme_data_cbs_t cbs_ = {0}; + if(cbs) { + cbs_.read = find_read_Fct(cbs->read); + cbs_.write = find_write_Fct(cbs->write); + cbs_.seek = find_seek_Fct(cbs->seek); + cbs_.release = find_release_Fct(cbs->release); + } + return my->gpgme_data_new_from_cbs(data, cbs?&cbs_:NULL, stream); +} + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibgpgme_private.h b/src/wrapped/wrappedlibgpgme_private.h new file mode 100644 index 0000000..b599f10 --- /dev/null +++ b/src/wrapped/wrappedlibgpgme_private.h @@ -0,0 +1,216 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(gpgme_addrspec_from_uid, pFp) +GO(gpgme_cancel, uFp) +GO(gpgme_cancel_async, uFp) +GO(gpgme_check_version, pFp) +GO(gpgme_check_version_internal, pFpL) +GO(gpgme_conf_arg_new, uFpup) +GO(gpgme_conf_arg_release, vFpu) +GO(gpgme_conf_opt_change, uFpip) +GO(gpgme_conf_release, vFp) +GO(gpgme_ctx_get_engine_info, pFp) +GO(gpgme_ctx_set_engine_info, uFpupp) +GO(gpgme_data_get_encoding, uFp) +GO(gpgme_data_get_file_name, pFp) +GO(gpgme_data_identify, uFpi) +GO(gpgme_data_new, uFp) +GOM(gpgme_data_new_from_cbs, uFEppp) +GO(gpgme_data_new_from_estream, uFpp) +GO(gpgme_data_new_from_fd, uFpi) +GO(gpgme_data_new_from_file, uFppi) +GO(gpgme_data_new_from_filepart, uFppSlL) +GO(gpgme_data_new_from_mem, uFppLi) +GO(gpgme_data_new_from_stream, uFpS) +//GOM(gpgme_data_new_with_read_cb, uFEppp) +GO(gpgme_data_read, lFppL) +GO(gpgme_data_release, vFp) +GO(gpgme_data_release_and_get_mem, pFpp) +GO(gpgme_data_rewind, uFp) +GO(gpgme_data_seek, lFpli) +GO(gpgme_data_set_encoding, uFpu) +GO(gpgme_data_set_file_name, uFpp) +GO(gpgme_data_set_flag, uFppp) +GO(gpgme_data_write, lFppL) +GO(gpgme_engine_check_version, uFu) +GO(gpgme_err_code_from_errno, uFi) +GO(gpgme_err_code_from_syserror, uFv) +GO(gpgme_err_code_to_errno, iFu) +GO(gpgme_err_make_from_errno, uFui) +GO(gpgme_error_from_errno, uFi) +GO(gpgme_err_set_errno, vFi) +GO(gpgme_free, vFp) +GO(gpgme_get_armor, iFp) +GO(gpgme_get_ctx_flag, pFpp) +GO(gpgme_get_dirinfo, pFp) +GO(gpgme_get_engine_info, uFp) +GO(gpgme_get_include_certs, iFp) +//GOM(gpgme_get_io_cbs, vFEpp) +GO(gpgme_get_key, uFpppi) +GO(gpgme_get_keylist_mode, uFp) +GO(gpgme_get_offline, iFp) +//GOM(gpgme_get_passphrase_cb, vFEppp) +GO(gpgme_get_pinentry_mode, uFp) +//GOM(gpgme_get_progress_cb, vFEppp) +GO(gpgme_get_protocol, uFp) +GO(gpgme_get_protocol_name, pFu) +GO(gpgme_get_sender, pFp) +GO(gpgme_get_sig_key, uFpip) +GO(gpgme_get_sig_status, pFpipp) +//GO(gpgme_get_sig_string_attr, +//GO(gpgme_get_sig_ulong_attr, +//GOM(gpgme_get_status_cb, vFEppp) +GO(gpgme_get_sub_protocol, uFp) +GO(gpgme_get_textmode, iFp) +GO(gpgme_hash_algo_name, pFu) +GO(gpgme_io_read, lFipL) +GO(gpgme_io_write, lFipL) +GO(gpgme_io_writen, iFipL) +GO(gpgme_key_from_uid, uFpp) +//GO(gpgme_key_get_string_attr, +//GO(gpgme_key_get_ulong_attr, +GO(gpgme_key_ref, vFp) +GO(gpgme_key_release, vFp) +//GO(gpgme_key_sig_get_string_attr, +//GO(gpgme_key_sig_get_ulong_attr, +GO(gpgme_key_unref, vFp) +GO(gpgme_new, uFp) +GO(gpgme_op_adduid, uFpppu) +GO(gpgme_op_adduid_start, uFpppu) +GO(gpgme_op_assuan_result, pFp) +//GOM(gpgme_op_assuan_transact, uFEpppppppp) +//GOM(gpgme_op_assuan_transact_ext, uFEppppppppp) +//GOM(gpgme_op_assuan_transact_start, uFEpppppppp) +//GOM(gpgme_op_card_edit, uFEppppp) +//GOM(gpgme_op_card_edit_start, uFEppppp) +GO(gpgme_op_conf_dir, uFppp) +GO(gpgme_op_conf_load, uFpp) +GO(gpgme_op_conf_save, uFpp) +GO(gpgme_op_createkey, uFpppLLpu) +GO(gpgme_op_createkey_start, uFpppLLpu) +GO(gpgme_op_createsubkey, uFpppLLu) +GO(gpgme_op_createsubkey_start, uFpppLLu) +GO(gpgme_op_decrypt, uFppp) +GO(gpgme_op_decrypt_ext, uFpupp) +GO(gpgme_op_decrypt_ext_start, uFpupp) +GO(gpgme_op_decrypt_result, pFp) +GO(gpgme_op_decrypt_start, uFppp) +GO(gpgme_op_decrypt_verify, uFppp) +GO(gpgme_op_decrypt_verify_start, uFppp) +GO(gpgme_op_delete, uFppi) +GO(gpgme_op_delete_ext, uFppu) +GO(gpgme_op_delete_ext_start, uFppu) +GO(gpgme_op_delete_start, uFppi) +//GOM(gpgme_op_edit, uFEppppp) +//GOM(gpgme_op_edit_start, uFEppppp) +GO(gpgme_op_encrypt, uFppupp) +GO(gpgme_op_encrypt_ext, uFpppupp) +GO(gpgme_op_encrypt_ext_start, uFpppupp) +GO(gpgme_op_encrypt_result, pFp) +GO(gpgme_op_encrypt_sign, uFppupp) +GO(gpgme_op_encrypt_sign_ext, uFpppupp) +GO(gpgme_op_encrypt_sign_ext_start, uFpppupp) +GO(gpgme_op_encrypt_sign_start, uFppupp) +GO(gpgme_op_encrypt_start, uFppupp) +GO(gpgme_op_export, uFppup) +GO(gpgme_op_export_ext, uFppup) +GO(gpgme_op_export_ext_start, uFppup) +GO(gpgme_op_export_keys, uFppup) +GO(gpgme_op_export_keys_start, uFppup) +GO(gpgme_op_export_start, uFppup) +GO(gpgme_op_genkey, uFpppp) +GO(gpgme_op_genkey_result, pFp) +GO(gpgme_op_genkey_start, uFpppp) +GO(gpgme_op_getauditlog, uFppu) +GO(gpgme_op_getauditlog_start, uFppu) +GO(gpgme_op_import, uFpp) +GO(gpgme_op_import_ext, uFppp) +GO(gpgme_op_import_keys, uFpp) +GO(gpgme_op_import_keys_start, uFpp) +GO(gpgme_op_import_result, pFp) +GO(gpgme_op_import_start, uFpp) +//GOM(gpgme_op_interact, uFEppuppp) +//GOM(gpgme_op_interact_start, uFEppuppp) +GO(gpgme_op_keylist_end, uFp) +GO(gpgme_op_keylist_ext_start, uFppii) +GO(gpgme_op_keylist_from_data_start, uFppi) +GO(gpgme_op_keylist_next, uFpp) +GO(gpgme_op_keylist_result, pFp) +GO(gpgme_op_keylist_start, uFppi) +GO(gpgme_op_keysign, uFpppLu) +GO(gpgme_op_keysign_start, uFpppLu) +GO(gpgme_op_passwd, uFppu) +GO(gpgme_op_passwd_start, uFppu) +GO(gpgme_op_query_swdb, uFpppu) +GO(gpgme_op_query_swdb_result, pFp) +GO(gpgme_op_receive_keys, uFpp) +GO(gpgme_op_receive_keys_start, uFpp) +GO(gpgme_op_revsig, uFppppu) +GO(gpgme_op_revsig_start, uFppppu) +GO(gpgme_op_revuid, uFpppu) +GO(gpgme_op_revuid_start, uFpppu) +GO(gpgme_op_setexpire, uFppLpu) +GO(gpgme_op_setexpire_start, uFppLpu) +GO(gpgme_op_setownertrust, uFppp) +GO(gpgme_op_setownertrust_start, uFppp) +GO(gpgme_op_set_uid_flag, uFppppp) +GO(gpgme_op_set_uid_flag_start, uFppppp) +GO(gpgme_op_sign, uFpppu) +GO(gpgme_op_sign_result, pFp) +GO(gpgme_op_sign_start, uFpppu) +GO(gpgme_op_spawn, uFppppppu) +GO(gpgme_op_spawn_start, uFppppppu) +GO(gpgme_op_tofu_policy, uFppu) +GO(gpgme_op_tofu_policy_start, uFppu) +//GO(gpgme_op_trustlist_end, +//GO(gpgme_op_trustlist_next, +//GO(gpgme_op_trustlist_start, +GO(gpgme_op_verify, uFpppp) +GO(gpgme_op_verify_ext, uFpuppp) +GO(gpgme_op_verify_ext_start, uFpuppp) +GO(gpgme_op_verify_result, pFp) +GO(gpgme_op_verify_start, uFpppp) +GO(gpgme_op_vfs_create, uFpppup) +GO(gpgme_op_vfs_mount, uFpppup) +GO(gpgme_op_vfs_mount_result, pFp) +GO(gpgme_pubkey_algo_name, pFu) +GO(gpgme_pubkey_algo_string, pFp) +GO(gpgme_release, vFp) +GO(gpgme_result_ref, vFp) +GO(gpgme_result_unref, vFp) +GO(gpgme_set_armor, vFpi) +GO(gpgme_set_ctx_flag, uFppp) +GO(gpgme_set_engine_info, uFupp) +GO(gpgme_set_global_flag, iFpp) +GO(gpgme_set_include_certs, vFpi) +//GOM(gpgme_set_io_cbs, vFEpp) +GO(gpgme_set_keylist_mode, uFpu) +GO(gpgme_set_locale, uFpip) +GO(gpgme_set_offline, vFpi) +//GOM(gpgme_set_passphrase_cb, vFEppp) +GO(gpgme_set_pinentry_mode, uFpu) +//GOM(gpgme_set_progress_cb, vFEppp) +GO(gpgme_set_protocol, uFpu) +GO(gpgme_set_sender, uFpp) +//GOM(gpgme_set_status_cb, vFEppp) +GO(gpgme_set_sub_protocol, uFpu) +GO(gpgme_set_textmode, vFpi) +GO(gpgme_signers_add, uFpp) +GO(gpgme_signers_clear, vFp) +GO(gpgme_signers_count, uFp) +GO(gpgme_signers_enum, pFpi) +GO(gpgme_sig_notation_add, uFpppu) +GO(gpgme_sig_notation_clear, vFp) +GO(gpgme_sig_notation_get, pFp) +GO(gpgme_strerror, pFu) +GO(gpgme_strerror_r, iFupL) +GO(gpgme_strsource, pFu) +//GO(gpgme_trust_item_get_int_attr, +//GO(gpgme_trust_item_get_string_attr, +//GO(gpgme_trust_item_ref, +//GO(gpgme_trust_item_release, +//GO(gpgme_trust_item_unref, +GO(gpgme_wait, pFppi) +GO(gpgme_wait_ext, pFpppi) diff --git a/src/wrapped/wrappedlibharfbuzz.c b/src/wrapped/wrappedlibharfbuzz.c index c300a33..1c65488 100644 --- a/src/wrapped/wrappedlibharfbuzz.c +++ b/src/wrapped/wrappedlibharfbuzz.c @@ -1214,4 +1214,10 @@ EXPORT void* my_hb_ft_face_create(x64emu_t* emu, void* face, void* destroy) return my->hb_ft_face_create(face, find_destroy_Fct(destroy)); } +EXPORT void* my_hb_ft_font_create(x64emu_t* emu, void* face, void* destroy) +{ + (void)emu; + return my->hb_ft_font_create(face, find_destroy_Fct(destroy)); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibharfbuzz_private.h b/src/wrapped/wrappedlibharfbuzz_private.h index 464d827..a783285 100644 --- a/src/wrapped/wrappedlibharfbuzz_private.h +++ b/src/wrapped/wrappedlibharfbuzz_private.h @@ -224,7 +224,7 @@ GOM(hb_ft_face_create, pFEpp) GO(hb_ft_face_create_cached, pFp) GO(hb_ft_face_create_referenced, pFp) GO(hb_ft_font_changed, vFp) -//GO(hb_ft_font_create, +GOM(hb_ft_font_create, pFEpp) GO(hb_ft_font_create_referenced, pFp) GO(hb_ft_font_get_face, pFp) GO(hb_ft_font_get_load_flags, iFp) @@ -235,8 +235,8 @@ GO(hb_ft_font_unlock_face, vFp) GO(hb_ft_hb_font_changed, iFp) GO(hb_glib_blob_create, pFp) GO(hb_glib_get_unicode_funcs, pFv) -GO(hb_glib_script_from_script, uFu) -GO(hb_glib_script_to_script, uFu) +GO(hb_glib_script_from_script, iFu) +GO(hb_glib_script_to_script, uFi) GO(hb_glyph_info_get_glyph_flags, uFp) GO(hb_graphite2_face_get_gr_face, pFp) GO(hb_graphite2_font_get_gr_font, pFp) @@ -260,7 +260,7 @@ GO(hb_map_is_empty, iFp) GO(hb_map_is_equal, iFpp) GO(hb_map_reference, pFp) GO(hb_map_set, vFpuu) -//GO(hb_map_set_user_data, +//GOM(hb_map_set_user_data, iFEppppi) GO(hb_ot_color_glyph_get_layers, uFpuupp) GO(hb_ot_color_glyph_reference_png, pFpu) GO(hb_ot_color_glyph_reference_svg, pFpu) @@ -389,7 +389,7 @@ GO(hb_set_previous, iFpp) GO(hb_set_previous_range, iFppp) GO(hb_set_reference, pFp) GO(hb_set_set, vFpp) -//GO(hb_set_set_user_data, +//GOM(hb_set_set_user_data, iFEppppi) GO(hb_set_subtract, vFpp) GO(hb_set_symmetric_difference, vFpp) GO(hb_set_union, vFpp) @@ -406,7 +406,7 @@ GO(hb_shape_plan_get_empty, pFv) GO(hb_shape_plan_get_shaper, pFp) GO(hb_shape_plan_get_user_data, pFpp) GO(hb_shape_plan_reference, pFp) -//GO(hb_shape_plan_set_user_data, +//GOM(hb_shape_plan_set_user_data, iFEppppi) GO(hb_style_get_value, fFpu) GO(hb_tag_from_string, uFpi) GO(hb_tag_to_string, vFup) diff --git a/src/wrapped/wrappedlibhogweed6.c b/src/wrapped/wrappedlibhogweed6.c index 57823a9..4ef3447 100644 --- a/src/wrapped/wrappedlibhogweed6.c +++ b/src/wrapped/wrappedlibhogweed6.c @@ -6,12 +6,164 @@ #include "wrappedlibs.h" +#include "debug.h" #include "wrapper.h" #include "bridge.h" #include "librarian/library_private.h" #include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" const char* libhogweed6Name = "libhogweed.so.6"; #define LIBNAME libhogweed6 + +#define ADDED_FUNCTIONS() + +#include "generated/wrappedlibhogweed6types.h" + +#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) \ +GO(5) \ +GO(6) \ +GO(7) \ +GO(8) \ +GO(9) \ +GO(10) \ + +// nettle_random_func +#define GO(A) \ +static uintptr_t my_nettle_random_func_fct_##A = 0; \ +static void my_nettle_random_func_##A(void* a, size_t b, void* c) \ +{ \ + RunFunctionFmt(my_nettle_random_func_fct_##A, "pLp", a, b, c); \ +} +SUPER() +#undef GO +static void* findnettle_random_funcFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_nettle_random_func_fct_##A == (uintptr_t)fct) return my_nettle_random_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_nettle_random_func_fct_##A == 0) {my_nettle_random_func_fct_##A = (uintptr_t)fct; return my_nettle_random_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libhogweed.so.6 nettle_random_func callback\n"); + return NULL; +} + +// nettle_progress_func +#define GO(A) \ +static uintptr_t my_nettle_progress_func_fct_##A = 0; \ +static void my_nettle_progress_func_##A(void* a, int b) \ +{ \ + RunFunctionFmt(my_nettle_progress_func_fct_##A, "pi", a, b); \ +} +SUPER() +#undef GO +static void* findnettle_progress_funcFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_nettle_progress_func_fct_##A == (uintptr_t)fct) return my_nettle_progress_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_nettle_progress_func_fct_##A == 0) {my_nettle_progress_func_fct_##A = (uintptr_t)fct; return my_nettle_progress_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libhogweed.so.6 nettle_progress_func callback\n"); + return NULL; +} + +#undef SUPER + +EXPORT int my_nettle_dsa_generate_params(x64emu_t* emu, void* params, void* rnd_ctx, void* rnd, void* progress_ctx, void* progress, uint32_t p_bits, uint32_t q_bits) +{ + return my->nettle_dsa_generate_params(params, rnd_ctx, findnettle_random_funcFct(rnd), progress_ctx, findnettle_progress_funcFct(progress), p_bits, q_bits); +} + +EXPORT int my_nettle_dsa_sign(x64emu_t* emu, void* params, void* x, void* rnd_ctx, void* rnd, size_t len, void* digest, void* sign) +{ + return my->nettle_dsa_sign(params, x, rnd_ctx, findnettle_random_funcFct(rnd), len, digest, sign); +} + +EXPORT void my_nettle_ecdsa_generate_keypair(x64emu_t* emu, void* pub, void* key, void* ctx, void* f) +{ + my->nettle_ecdsa_generate_keypair(pub, key, ctx, findnettle_random_funcFct(f)); +} + +EXPORT void my_nettle_ecdsa_sign(x64emu_t* emu, void* key, void* ctx, void* f, size_t len, void* digest, void* sign) +{ + my->nettle_ecdsa_sign(key, ctx, findnettle_random_funcFct(f), len, digest, sign); +} + +EXPORT void my_nettle_gostdsa_sign(x64emu_t* emu, void* key, void* ctx, void* f, size_t len, void* digest, void* sign) +{ + my->nettle_gostdsa_sign(key, ctx, findnettle_random_funcFct(f), len, digest, sign); +} + +EXPORT void my_nettle_mpz_random(x64emu_t* emu, void* x, void* ctx, void* f, void* n) +{ + my->nettle_mpz_random(x, ctx, findnettle_random_funcFct(f), n); +} + +EXPORT void my_nettle_mpz_random_size(x64emu_t* emu, void* x, void* ctx, void* f, uint32_t n) +{ + my->nettle_mpz_random_size(x, ctx, findnettle_random_funcFct(f), n); +} + +EXPORT int my_nettle_rsa_decrypt_tr(x64emu_t* emu, void* pub, void* key, void* ctx, void* f, void* len, void* msg, void* gib) +{ + return my->nettle_rsa_decrypt_tr(pub, key, ctx, findnettle_random_funcFct(f), len, msg, gib); +} + +EXPORT int my_nettle_rsa_encrypt(x64emu_t* emu, void* key, void* ctx, void* f, size_t len, void* txt, void* cipher) +{ + return my->nettle_rsa_encrypt(key, ctx, findnettle_random_funcFct(f), len, txt, cipher); +} + +EXPORT int my_nettle_rsa_generate_keypair(x64emu_t* emu, void* pub, void* key, void* ctx_rnd, void* rnd, void* ctx_progress, void* progress, uint32_t n_size, uint32_t e_size) +{ + return my->nettle_rsa_generate_keypair(pub, key, ctx_rnd, findnettle_random_funcFct(rnd), ctx_progress, findnettle_progress_funcFct(progress), n_size, e_size); +} + +EXPORT int my_nettle_rsa_pkcs1_sign_tr(x64emu_t* emu, void* pub, void* key, void* ctx, void* f, size_t len, void* info, void* s) +{ + return my->nettle_rsa_pkcs1_sign_tr(pub, key, ctx, findnettle_random_funcFct(f), len, info, s); +} + +EXPORT int my_nettle_rsa_pss_sha256_sign_digest_tr(x64emu_t* emu, void* pub, void* key, void* ctx, void* f, size_t len, void* salt, void* dig, void* s) +{ + return my->nettle_rsa_pss_sha256_sign_digest_tr(pub, key, ctx, findnettle_random_funcFct(f), len, salt, dig, s); +} + +EXPORT int my_nettle_rsa_pss_sha384_sign_digest_tr(x64emu_t* emu, void* pub, void* key, void* ctx, void* f, size_t len, void* salt, void* dig, void* s) +{ + return my->nettle_rsa_pss_sha384_sign_digest_tr(pub, key, ctx, findnettle_random_funcFct(f), len, salt, dig, s); +} + +EXPORT int my_nettle_rsa_pss_sha512_sign_digest_tr(x64emu_t* emu, void* pub, void* key, void* ctx, void* f, size_t len, void* salt, void* dig, void* s) +{ + return my->nettle_rsa_pss_sha512_sign_digest_tr(pub, key, ctx, findnettle_random_funcFct(f), len, salt, dig, s); +} + +EXPORT int my_nettle_rsa_sec_decrypt(x64emu_t* emu, void* pub, void* key, void* ctx, void* f, size_t len, void* msg, void* s) +{ + return my->nettle_rsa_sec_decrypt(pub, key, ctx, findnettle_random_funcFct(f), len, msg, s); +} + +#define NEEDED_LIBS "libnettle.so.8" + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibhogweed6_private.h b/src/wrapped/wrappedlibhogweed6_private.h index 1497508..55e386a 100644 --- a/src/wrapped/wrappedlibhogweed6_private.h +++ b/src/wrapped/wrappedlibhogweed6_private.h @@ -1,17 +1,297 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -error Meh... +#error Meh... #endif -GO(nettle_rsa_pss_sha512_verify_digest, iFpipp) -GO(nettle_rsa_pss_sha384_verify_digest, iFpipp) -GO(nettle_rsa_pss_sha256_verify_digest, iFpipp) -GO(nettle_rsa_pss_sha384_sign_digest_tr, iFpppipp) -GO(nettle_rsa_pss_sha512_sign_digest_tr, iFpppipp) -GO(nettle_rsa_pss_sha256_sign_digest_tr, iFpppipp) -GO(nettle_ecc_size_a, iFp) -GO(nettle_ecc_point_init, vFpp) -GO(nettle_rsa_sec_decrypt, iFpppppip) -GO(nettle_ecc_point_clear, vFp) +// typedef __mpz_struct mpz_t[1]; so mpz_t is "p" when in function paramter (struct is 2 int + 1 pointer) +// typedef long int mp_size_t; + +GO(nettle_asn1_der_decode_bitstring, uFpp) +GO(nettle_asn1_der_decode_bitstring_last, uFp) +GO(nettle_asn1_der_decode_constructed, uFpp) +GO(nettle_asn1_der_decode_constructed_last, uFp) +GO(nettle_asn1_der_get_bignum, iFppu) +GO(nettle_asn1_der_get_uint32, iFpp) +GO(nettle_asn1_der_iterator_first, uFpLp) +GO(nettle_asn1_der_iterator_next, uFp) +//GO(_nettle_cnd_copy, +//DATA(_nettle_curve25519, +//GO(_nettle_curve25519_eh_to_x, +GO(nettle_curve25519_mul, vFppp) +GO(nettle_curve25519_mul_g, vFpp) +//DATA(_nettle_curve448, +//GO(_nettle_curve448_eh_to_x, +GO(nettle_curve448_mul, vFppp) +GO(nettle_curve448_mul_g, vFpp) +//GOM(nettle_dsa_compat_generate_keypair, iFEppppppuu) +//GOM(nettle_dsa_generate_keypair, vFEppppp) +GOM(nettle_dsa_generate_params, iFEpppppuu) +//GO(_nettle_dsa_hash, +GO(nettle_dsa_keypair_from_sexp_alist, iFpppuup) +GO(nettle_dsa_keypair_to_sexp, iFppppp) +GO(nettle_dsa_openssl_private_key_from_der_iterator, iFpppup) GO(nettle_dsa_params_clear, vFp) -GO(nettle_get_secp_192r1, pFv) +GO(nettle_dsa_params_from_der_iterator, iFpuup) +GO(nettle_dsa_params_init, vFp) +GO(nettle_dsa_private_key_clear, vFp) +GO(nettle_dsa_private_key_init, vFp) +GO(nettle_dsa_public_key_clear, vFp) +GO(nettle_dsa_public_key_from_der_iterator, iFppp) +GO(nettle_dsa_public_key_init, vFp) +GO(nettle_dsa_sha1_keypair_from_sexp, iFpppuLp) +//GOM(nettle_dsa_sha1_sign, iFEpppppp) +//GOM(nettle_dsa_sha1_sign_digest, iFEpppppp) +GO(nettle_dsa_sha1_verify, iFppp) +GO(nettle_dsa_sha1_verify_digest, iFppp) +GO(nettle_dsa_sha256_keypair_from_sexp, iFpppuLp) +//GOM(nettle_dsa_sha256_sign, iFEpppppp) +//GOM(nettle_dsa_sha256_sign_digest, iFEpppppp) +GO(nettle_dsa_sha256_verify, iFppp) +GO(nettle_dsa_sha256_verify_digest, iFppp) +GOM(nettle_dsa_sign, iFEppppLpp) +GO(nettle_dsa_signature_clear, vFp) +GO(nettle_dsa_signature_from_sexp, iFppu) +GO(nettle_dsa_signature_init, vFp) +GO(nettle_dsa_verify, iFppLpp) +//GO(_nettle_ecc_add_eh, +//GO(_nettle_ecc_add_ehh, +//GO(_nettle_ecc_add_jja, +//GO(_nettle_ecc_add_jjj, +//GO(_nettle_ecc_add_th, +//GO(_nettle_ecc_add_thh, +//GO(_nettle_ecc_a_to_j, +GO(nettle_ecc_bit_size, uFp) +//GO(_nettle_ecc_dup_eh, +//GO(_nettle_ecc_dup_jj, +//GO(_nettle_ecc_dup_th, +GO(nettle_ecc_ecdsa_sign, vFpppLpppp) +GO(nettle_ecc_ecdsa_sign_itch, lFp) +GO(nettle_ecc_ecdsa_verify, iFppLpppp) +GO(nettle_ecc_ecdsa_verify_itch, lFp) +//GO(_nettle_ecc_eh_to_a, +GO(nettle_ecc_gostdsa_sign, vFpppLpppp) +GO(nettle_ecc_gostdsa_sign_itch, lFp) +GO(nettle_ecc_gostdsa_verify, iFppLpppp) +GO(nettle_ecc_gostdsa_verify_itch, lFp) +//GO(_nettle_ecc_j_to_a, +//GO(_nettle_ecc_mod, +//GO(_nettle_ecc_mod_add, +//GO(_nettle_ecc_mod_addmul_1, +//GO(_nettle_ecc_mod_equal_p, +//GO(_nettle_ecc_mod_inv, +//GO(_nettle_ecc_mod_mul, +//GO(_nettle_ecc_mod_mul_1, +//GO(_nettle_ecc_mod_mul_canonical, +//GO(_nettle_ecc_mod_pow_2k, +//GO(_nettle_ecc_mod_pow_2k_mul, +//GO(_nettle_ecc_mod_random, +//GO(_nettle_ecc_mod_sqr, +//GO(_nettle_ecc_mod_sqr_canonical, +//GO(_nettle_ecc_mod_sub, +//GO(_nettle_ecc_mod_submul_1, +//GO(_nettle_ecc_mod_zero_p, +//GO(_nettle_ecc_mul_a, +//GO(_nettle_ecc_mul_a_eh, +//GO(_nettle_ecc_mul_g, +//GO(_nettle_ecc_mul_g_eh, +//GO(_nettle_ecc_mul_m, +//GO(_nettle_ecc_nonsec_add_jjj, +//GO(_nettle_ecc_pm1_redc, +GO(nettle_ecc_point_clear, vFp) +GO(nettle_ecc_point_get, vFppp) +GO(nettle_ecc_point_init, vFpp) +GO(nettle_ecc_point_mul, vFppp) +GO(nettle_ecc_point_mul_g, vFpp) +GO(nettle_ecc_point_set, iFppp) +//GO(_nettle_ecc_pp1_redc, +GO(nettle_ecc_scalar_clear, vFp) +GO(nettle_ecc_scalar_get, vFpp) +GO(nettle_ecc_scalar_init, vFpp) +//GOM(nettle_ecc_scalar_random, vFEppp) +GO(nettle_ecc_scalar_set, iFpp) +GO(nettle_ecc_size, lFp) +GO(nettle_ecc_size_a, lFp) +GO(nettle_ecc_size_j, lFp) +GOM(nettle_ecdsa_generate_keypair, vFEpppp) +GOM(nettle_ecdsa_sign, vFEpppLpp) +GO(nettle_ecdsa_verify, iFpLpp) +//DATA(_nettle_ed25519_sha512, +GO(nettle_ed25519_sha512_public_key, vFpp) +GO(nettle_ed25519_sha512_sign, vFppLpp) +GO(nettle_ed25519_sha512_verify, iFpLpp) +//DATA(_nettle_ed448_shake256, +GO(nettle_ed448_shake256_public_key, vFpp) +GO(nettle_ed448_shake256_sign, vFppLpp) +GO(nettle_ed448_shake256_verify, iFpLpp) +//GO(_nettle_eddsa_compress, +//GO(_nettle_eddsa_compress_itch, +//GO(_nettle_eddsa_decompress, +//GO(_nettle_eddsa_decompress_itch, +//GO(_nettle_eddsa_expand_key, +//GO(_nettle_eddsa_hash, +//GO(_nettle_eddsa_public_key, +//GO(_nettle_eddsa_public_key_itch, +//GO(_nettle_eddsa_sign, +//GO(_nettle_eddsa_sign_itch, +//GO(_nettle_eddsa_verify, +//GO(_nettle_eddsa_verify_itch, +//GO(_nettle_generate_pocklington_prime, GO(nettle_get_gost_gc256b, pFv) +GO(nettle_get_gost_gc512a, pFv) +GO(nettle_get_secp_192r1, pFv) +GO(nettle_get_secp_224r1, pFv) +GO(nettle_get_secp_256r1, pFv) +GO(nettle_get_secp_384r1, pFv) +GO(nettle_get_secp_521r1, pFv) +//GO(_nettle_gmp_alloc, +//GO(_nettle_gmp_alloc_limbs, +//GO(_nettle_gmp_free, +//GO(_nettle_gmp_free_limbs, +//GO(_nettle_gostdsa_hash, +GOM(nettle_gostdsa_sign, vFEpppLpp) +GO(nettle_gostdsa_verify, iFpLpp) +GO(nettle_gostdsa_vko, vFppLpp) +//DATA(_nettle_gost_gc256b, +//DATA(_nettle_gost_gc512a, +//GO(_nettle_mpn_get_base256, +//GO(_nettle_mpn_get_base256_le, +//GO(_nettle_mpn_set_base256, +//GO(_nettle_mpn_set_base256_le, +GO(nettle_mpz_get_str_256, vFLpp) +GO(nettle_mpz_init_set_str_256_s, vFpLp) +GO(nettle_mpz_init_set_str_256_u, vFpLp) +//GO(_nettle_mpz_limbs_copy, +GOM(nettle_mpz_random, vFEpppp) +GOM(nettle_mpz_random_size, vFEpppu) +//GO(_nettle_mpz_set_n, +GO(nettle_mpz_set_sexp, iFpup) +GO(nettle_mpz_set_str_256_s, vFpLp) +GO(nettle_mpz_set_str_256_u, vFpLp) +GO(nettle_mpz_sizeinbase_256_s, LFp) +GO(nettle_mpz_sizeinbase_256_u, LFp) +//GO(_nettle_oaep_decode_mgf1, +//GO(_nettle_oaep_encode_mgf1, +GO(nettle_openssl_provate_key_from_der, iFpppuLp) +GO(nettle_pgp_armor, iFppup) +GO(nettle_pgp_crc24, uFup) +GO(nettle_pgp_put_header, iFpuu) +GO(nettle_pgp_put_header_length, vFpuu) +GO(nettle_pgp_put_length, iFpu) +GO(nettle_pgp_put_mpi, iFpp) +GO(nettle_pgp_put_public_rsa_key, iFppl) +GO(nettle_pgp_put_rsa_sha1_signature, iFpppup) +GO(nettle_pgp_put_string, iFpup) +GO(nettle_pgp_put_sub_packet, iFpuup) +GO(nettle_pgp_put_uint16, iFpu) +GO(nettle_pgp_put_uint32, iFpu) +GO(nettle_pgp_put_userid, iFpup) +GO(nettle_pgp_sub_packet_end, vFpu) +GO(nettle_pgp_sub_packet_start, uFp) +GO(nettle_pkcs1_decrypt, iFLppp) +//GOM(nettle_pkcs1_encrypt, iFELppLpp) +GO(nettle_pkcs1_rsa_digest_encode, iFpLLp) +GO(nettle_pkcs1_rsa_md5_encode, iFpLp) +GO(nettle_pkcs1_rsa_md5_encode_digest, iFpLp) +GO(nettle_pkcs1_rsa_sha1_encode, iFpLp) +GO(nettle_pkcs1_rsa_sha1_encode_digest, iFpLp) +GO(nettle_pkcs1_rsa_sha256_encode, iFpLp) +GO(nettle_pkcs1_rsa_sha256_encode_digest, iFpLp) +GO(nettle_pkcs1_rsa_sha512_encode, iFpLp) +GO(nettle_pkcs1_rsa_sha512_encode_digest, iFpLp) +//GO(_nettle_pkcs1_sec_decrypt, +//GO(_nettle_pkcs1_sec_decrypt_variable, +//GO(_nettle_pkcs1_signature_prefix, +//GOM(nettle_pss_encode_mgf1, iFEpLpLpp) +//GOM(nettle_pss_mgf1, vFEppLp) +//GOM(nettle_pss_verify_mgf1, iFEpLpLp) +//GOM(nettle_random_prime, vFEpuipppp) +//GO(_nettle_rsa_blind, +//GO(_nettle_rsa_check_size, +GO(nettle_rsa_compute_root, vFppp) +//GOM(nettle_rsa_compute_root_tr, iFEpppppp) +GO(nettle_rsa_decrypt, iFpppp) +GOM(nettle_rsa_decrypt_tr, iFEppppppp) +GOM(nettle_rsa_encrypt, iFEpppLpp) +GOM(nettle_rsa_generate_keypair, iFEppppppuu) +GO(nettle_rsa_keypair_from_der, iFppuLp) +GO(nettle_rsa_keypair_from_sexp, iFppuLp) +GO(nettle_rsa_keypair_from_sexp_alist, iFppup) +GO(nettle_rsa_keypair_to_openpgp, iFpppp) +GO(nettle_rsa_keypair_to_sexp, iFpppp) +GO(nettle_rsa_md5_sign, iFppp) +GO(nettle_rsa_md5_sign_digest, iFppp) +//GOM(nettle_rsa_md5_sign_digest_tr, iFEpppppp) +//GOM(nettle_rsa_md5_sign_tr, iFEpppppp) +GO(nettle_rsa_md5_verify, iFppp) +GO(nettle_rsa_md5_verify_digest, iFppp) +//GO(_nettle_rsa_oaep_decrypt, +//GO(_nettle_rsa_oaep_encrypt, +//GOM(nettle_rsa_oaep_sha256_decrypt, iFEppppLpppp) +//GOM(nettle_rsa_oaep_sha256_encrypt, iFEpppLpLpp) +//GOM(nettle_rsa_oaep_sha384_decrypt, iFEppppLpppp) +//GOM(nettle_rsa_oaep_sha384_encrypt, iFEpppLpLpp) +//GOM(nettle_rsa_oaep_sha512_decrypt, iFEppppLpppp) +//GOM(nettle_rsa_oaep_sha512_encrypt, iFEpppLpLpp) +GO(nettle_rsa_pkcs1_sign, iFpLpp) +GOM(nettle_rsa_pkcs1_sign_tr, iFEppppLpp) +GO(nettle_rsa_pkcs1_verify, iFpLpp) +GO(nettle_rsa_private_key_clear, vFp) +GO(nettle_rsa_private_key_from_der_iterator, iFppup) +GO(nettle_rsa_private_key_init, vFp) +GO(nettle_rsa_private_key_prepare, iFp) +GOM(nettle_rsa_pss_sha256_sign_digest_tr, iFEppppLppp) +GO(nettle_rsa_pss_sha256_verify_digest, iFpLpp) +GOM(nettle_rsa_pss_sha384_sign_digest_tr, iFEppppLppp) +GO(nettle_rsa_pss_sha384_verify_digest, iFpLpp) +GOM(nettle_rsa_pss_sha512_sign_digest_tr, iFEppppLppp) +GO(nettle_rsa_pss_sha512_verify_digest, iFpLpp) +GO(nettle_rsa_public_key_clear, vFp) +GO(nettle_rsa_public_key_from_der_iterator, iFpup) +GO(nettle_rsa_public_key_init, vFp) +GO(nettle_rsa_public_key_prepare, iFp) +//GO(_nettle_rsa_sec_compute_root, +//GO(_nettle_rsa_sec_compute_root_itch, +//GO(_nettle_rsa_sec_compute_root_tr, +GOM(nettle_rsa_sec_decrypt, iFEppppLpp) +GO(nettle_rsa_sha1_sign, iFppp) +GO(nettle_rsa_sha1_sign_digest, iFppp) +//GOM(nettle_rsa_sha1_sign_digest_tr, iFEpppppp) +//GOM(nettle_rsa_sha1_sign_tr, iFEpppppp) +GO(nettle_rsa_sha1_verify, iFppp) +GO(nettle_rsa_sha1_verify_digest, iFppp) +GO(nettle_rsa_sha256_sign, iFppp) +GO(nettle_rsa_sha256_sign_digest, iFppp) +//GOM(nettle_rsa_sha256_sign_digest_tr, iFEpppppp) +//GOM(nettle_rsa_sha256_sign_tr, iFEpppppp) +GO(nettle_rsa_sha256_verify, iFppp) +GO(nettle_rsa_sha256_verify_digest, iFppp) +GO(nettle_rsa_sha512_sign, iFppp) +GO(nettle_rsa_sha512_sign_digest, iFppp) +//GOM(nettle_rsa_sha512_sign_digest_tr, iFEpppppp) +//GOM(nettle_rsa_sha512_sign_tr, iFEpppppp) +GO(nettle_rsa_sha512_verify, iFppp) +GO(nettle_rsa_sha512_verify_digest, iFppp) +//GO(_nettle_rsa_unblind, +//GO(_nettle_rsa_verify, +//GO(_nettle_rsa_verify_recover, +//GO(_nettle_sec_add_1, +//DATA(_nettle_secp_192r1, +//DATA(_nettle_secp_224r1, +//DATA(_nettle_secp_256r1, +//DATA(_nettle_secp_384r1, +//DATA(_nettle_secp_521r1, +//GO(_nettle_sec_sub_1, +//GO(_nettle_sec_zero_p, +//GOM(nettle_sexp_format, LFEppV) +GO(nettle_sexp_iterator_assoc, iFpupp) +GO(nettle_sexp_iterator_check_type, iFpp) +GO(nettle_sexp_iterator_check_types, pFpup) +GO(nettle_sexp_iterator_enter_list, iFp) +GO(nettle_sexp_iterator_exit_list, iFp) +GO(nettle_sexp_iterator_first, iFpLp) +GO(nettle_sexp_iterator_get_uint32, iFpp) +GO(nettle_sexp_iterator_next, iFp) +GO(nettle_sexp_iterator_subexpr, pFpp) +//GOM(nettle_sexp_transport_format, LFEppV) +GO(nettle_sexp_transport_iterator_first, iFpLp) +//GOM(nettle_sexp_transport_vformat, LFEppA) +//GOM(nettle_sexp_vformat, LFEppA) diff --git a/src/wrapped/wrappedlibibus.c b/src/wrapped/wrappedlibibus.c index f1ee426..0537f31 100644 --- a/src/wrapped/wrappedlibibus.c +++ b/src/wrapped/wrappedlibibus.c @@ -113,9 +113,8 @@ EXPORT void my_ibus_input_context_process_key_event_async(x64emu_t* emu, void* b my->ibus_input_context_process_key_event_async(bus, keyval, keycode, state, timeout, cancel, findGAsyncReadyCallbackFct(f), data); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define NEEDED_LIBS "libgio-2.0.so.0", "libgobject-2.0.so.0", "libglib-2.0.so.0" diff --git a/src/wrapped/wrappedliblapack.c b/src/wrapped/wrappedliblapack.c new file mode 100644 index 0000000..d6cf548 --- /dev/null +++ b/src/wrapped/wrappedliblapack.c @@ -0,0 +1,25 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" + +const char* liblapackName = "liblapack.so.3"; +#define ALTNAME "liblapack.so" + +#define LIBNAME liblapack + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedliblapack_private.h b/src/wrapped/wrappedliblapack_private.h new file mode 100644 index 0000000..6749259 --- /dev/null +++ b/src/wrapped/wrappedliblapack_private.h @@ -0,0 +1,1993 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(cbbcsd_, vFpppppppppppppppppppppppppppppLLLLL) +GO(cbdsqr_, vFpppppppppppppppL) +GO(cgbbrd_, vFpppppppppppppppppppL) +GO(cgbcon_, vFppppppppppppL) +GO(cgbequ_, vFpppppppppppp) +GO(cgbequb_, vFpppppppppppp) +GO(cgbrfs_, vFpppppppppppppppppppL) +GO(cgbsv_, vFpppppppppp) +GO(cgbsvx_, vFppppppppppppppppppppppppLLL) +//GO(cgbtf2_, +GO(cgbtrf_, vFpppppppp) +GO(cgbtrs_, vFpppppppppppL) +GO(cgebak_, vFppppppppppLL) +GO(cgebal_, vFppppppppL) +//GO(cgebd2_, +GO(cgebrd_, vFppppppppppp) +GO(cgecon_, vFpppppppppL) +GO(cgedmd_, vFpppppppppppppppppppppppppppppppLLLL) +GO(cgedmdq_, vFpppppppppppppppppppppppppppppppppppLLLLLL) +GO(cgeequ_, vFpppppppppp) +GO(cgeequb_, vFpppppppppp) +//GOM(cgees_, vFEpppppppppppppppLL) +//GOM(cgeesx_, vFEppppppppppppppppppLLL) +GO(cgeev_, vFppppppppppppppLL) +GO(cgeevx_, vFppppppppppppppppppppppLLLL) +//GO(cgegs_, +//GO(cgegv_, +//GO(cgehd2_, +GO(cgehrd_, vFppppppppp) +GO(cgejsv_, vFpppppppppppppppppppppLLLLLL) +GO(cgelq_, vFppppppppp) +GO(cgelq2_, vFppppppp) +GO(cgelqf_, vFpppppppp) +//GO(cgelqs_, +//GO(cgelqt_, +//GO(cgelqt3_, +GO(cgels_, vFpppppppppppL) +GO(cgelsd_, vFppppppppppppppp) +GO(cgelss_, vFpppppppppppppp) +//GO(cgelst_, +//GO(cgelsx_, +GO(cgelsy_, vFpppppppppppppp) +GO(cgemlq_, vFppppppppppppppLL) +//GO(cgemlqt_, +GO(cgemqr_, vFppppppppppppppLL) +GO(cgemqrt_, vFppppppppppppppLL) +GO(cgeql2_, vFppppppp) +GO(cgeqlf_, vFpppppppp) +GO(cgeqp3_, vFpppppppppp) +//GO(cgeqp3rk_, +GO(cgeqpf_, vFppppppppp) +GO(cgeqr_, vFppppppppp) +GO(cgeqr2_, vFppppppp) +//GO(cgeqr2p_, +GO(cgeqrf_, vFpppppppp) +GO(cgeqrfp_, vFpppppppp) +//GO(cgeqrs_, +GO(cgeqrt_, vFppppppppp) +GO(cgeqrt2_, vFppppppp) +GO(cgeqrt3_, vFppppppp) +GO(cgerfs_, vFpppppppppppppppppL) +GO(cgerq2_, vFppppppp) +GO(cgerqf_, vFpppppppp) +//GO(cgesc2_, +GO(cgesdd_, vFpppppppppppppppL) +GO(cgesv_, vFpppppppp) +GO(cgesvd_, vFpppppppppppppppLL) +GO(cgesvdq_, vFppppppppppppppppppppppLLLLL) +GO(cgesvdx_, vFppppppppppppppppppppppLLL) +GO(cgesvj_, vFppppppppppppppppLLL) +GO(cgesvx_, vFppppppppppppppppppppppLLL) +//GO(cgetc2_, +GO(cgetf2_, vFpppppp) +GO(cgetrf_, vFpppppp) +GO(cgetrf2_, vFpppppp) +GO(cgetri_, vFppppppp) +GO(cgetrs_, vFpppppppppL) +GO(cgetsls_, vFpppppppppppL) +GO(cgetsqrhrt_, vFpppppppppppp) +GO(cggbak_, vFpppppppppppLL) +GO(cggbal_, vFppppppppppppL) +//GOM(cgges_, vFEpppppppppppppppppppppLLL) +//GOM(cgges3_, vFEpppppppppppppppppppppLLL) +//GOM(cggesx_, vFEppppppppppppppppppppppppppLLLL) +GO(cggev_, vFpppppppppppppppppLL) +GO(cggev3_, vFpppppppppppppppppLL) +GO(cggevx_, vFpppppppppppppppppppppppppppppLLLL) +GO(cggglm_, vFppppppppppppp) +GO(cgghd3_, vFppppppppppppppppLL) +GO(cgghrd_, vFppppppppppppppLL) +GO(cgglse_, vFppppppppppppp) +GO(cggqrf_, vFpppppppppppp) +GO(cggrqf_, vFpppppppppppp) +GO(cggsvd_, iFppppppppppppppppppppppppLLL) +GO(cggsvd3_, vFpppppppppppppppppppppppppLLL) +GO(cggsvp_, iFpppppppppppppppppppppppppLLL) +GO(cggsvp3_, vFppppppppppppppppppppppppppLLL) +//GO(cgsvj0_, +//GO(cgsvj1_, +GO(cgtcon_, vFpppppppppppL) +GO(cgtrfs_, vFppppppppppppppppppppL) +GO(cgtsv_, vFpppppppp) +GO(cgtsvx_, vFppppppppppppppppppppppLL) +GO(cgttrf_, vFppppppp) +GO(cgttrs_, vFpppppppppppL) +//GO(cgtts2_, +//GO(chb2st_kernels_, +GO(chbev_, vFppppppppppppLL) +GO(chbev_2stage_, vFpppppppppppppLL) +GO(chbevd_, vFppppppppppppppppLL) +GO(chbevd_2stage_, vFppppppppppppppppLL) +GO(chbevx_, vFpppppppppppppppppppppppLLL) +GO(chbevx_2stage_, vFppppppppppppppppppppppppLLL) +GO(chbgst_, vFppppppppppppppLL) +GO(chbgv_, vFpppppppppppppppLL) +GO(chbgvd_, vFpppppppppppppppppppLL) +GO(chbgvx_, vFppppppppppppppppppppppppppLLL) +GO(chbtrd_, vFppppppppppppLL) +GO(checon_, vFpppppppppL) +GO(checon_3_, vFppppppppppL) +//GO(checon_rook_, +GO(cheequb_, vFpppppppppL) +GO(cheev_, vFppppppppppLL) +GO(cheev_2stage_, vFppppppppppLL) +GO(cheevd_, vFpppppppppppppLL) +GO(cheevd_2stage_, vFpppppppppppppLL) +GO(cheevr_, vFpppppppppppppppppppppppLLL) +GO(cheevr_2stage_, vFpppppppppppppppppppppppLLL) +GO(cheevx_, vFpppppppppppppppppppppLLL) +GO(cheevx_2stage_, vFpppppppppppppppppppppLLL) +//GO(chegs2_, +GO(chegst_, vFppppppppL) +GO(chegv_, vFpppppppppppppLL) +GO(chegv_2stage_, vFpppppppppppppLL) +GO(chegvd_, vFppppppppppppppppLL) +GO(chegvx_, vFppppppppppppppppppppppppLLL) +GO(cherfs_, vFpppppppppppppppppL) +GO(chesv_, vFpppppppppppL) +GO(chesv_aa_, vFpppppppppppL) +GO(chesv_aa_2stage_, vFppppppppppppppL) +GO(chesv_rk_, vFppppppppppppL) +GO(chesv_rook_, vFpppppppppppL) +GO(chesvx_, vFppppppppppppppppppppLL) +GO(cheswapr_, vFppppppL) +//GO(chetd2_, +//GO(chetf2_, +//GO(chetf2_rk_, +//GO(chetf2_rook_, +GO(chetrd_, vFppppppppppL) +GO(chetrd_2stage_, vFpppppppppppppLL) +//GO(chetrd_hb2st_, +//GO(chetrd_he2hb_, +GO(chetrf_, vFppppppppL) +GO(chetrf_aa_, vFppppppppL) +GO(chetrf_aa_2stage_, vFpppppppppppL) +GO(chetrf_rk_, vFpppppppppL) +GO(chetrf_rook_, vFppppppppL) +GO(chetri_, vFpppppppL) +GO(chetri2_, vFppppppppL) +GO(chetri2x_, vFppppppppL) +GO(chetri_3_, vFpppppppppL) +//GO(chetri_3x_, +//GO(chetri_rook_, +GO(chetrs_, vFpppppppppL) +GO(chetrs2_, vFppppppppppL) +GO(chetrs_3_, vFppppppppppL) +GO(chetrs_aa_, vFpppppppppppL) +GO(chetrs_aa_2stage_, vFppppppppppppL) +GO(chetrs_rook_, vFpppppppppL) +GO(chfrk_, vFppppppppppLLL) +GO(chgeqz_, vFppppppppppppppppppppLLL) +//GO(chla_transtype_, +GO(chpcon_, vFppppppppL) +GO(chpev_, vFppppppppppLL) +GO(chpevd_, vFppppppppppppppLL) +GO(chpevx_, vFpppppppppppppppppppLLL) +GO(chpgst_, vFppppppL) +GO(chpgv_, vFppppppppppppLL) +GO(chpgvd_, vFppppppppppppppppLL) +GO(chpgvx_, vFpppppppppppppppppppppLLL) +GO(chprfs_, vFpppppppppppppppL) +GO(chpsv_, vFppppppppL) +GO(chpsvx_, vFpppppppppppppppppLL) +GO(chptrd_, vFpppppppL) +GO(chptrf_, vFpppppL) +GO(chptri_, vFppppppL) +GO(chptrs_, vFppppppppL) +GO(chsein_, vFpppppppppppppppppppLLL) +GO(chseqr_, vFpppppppppppppLL) +//GO(clabrd_, +GO(clacgv_, vFppp) +GO(clacn2_, vFpppppp) +//GO(clacon_, +GO(clacp2_, vFpppppppL) +GO(clacpy_, vFpppppppL) +GO(clacrm_, vFppppppppp) +//GO(clacrt_, +//GO(cladiv_, +//GO(claed0_, +//GO(claed7_, +//GO(claed8_, +//GO(claein_, +//GO(claesy_, +//GO(claev2_, +GO(clag2z_, vFppppppp) +//GO(clags2_, +//GO(clagtm_, +//GO(clahef_, +//GO(clahef_aa_, +//GO(clahef_rk_, +//GO(clahef_rook_, +//GO(clahqr_, +//GO(clahr2_, +//GO(clahrd_, +//GO(claic1_, +//GO(clals0_, +//GO(clalsa_, +//GO(clalsd_, +//GO(clamswlq_, +//GO(clamtsqr_, +GO(clangb_, fFpppppppL) +GO(clange_, fFppppppL) +GO(clangt_, fFpppppL) +GO(clanhb_, fFpppppppLL) +GO(clanhe_, fFppppppLL) +//GO(clanhf_, +GO(clanhp_, fFpppppLL) +GO(clanhs_, fFpppppL) +GO(clanht_, fFppppL) +GO(clansb_, fFpppppppLL) +GO(clansp_, fFpppppLL) +GO(clansy_, fFppppppLL) +GO(clantb_, fFppppppppLLL) +GO(clantp_, fFppppppLLL) +GO(clantr_, fFppppppppLLL) +//GO(clapll_, +GO(clapmr_, vFpppppp) +GO(clapmt_, vFpppppp) +//GO(claqgb_, +//GO(claqge_, +//GO(claqhb_, +//GO(claqhe_, +//GO(claqhp_, +//GO(claqp2_, +//GO(claqp2rk_, +//GO(claqp3rk_, +//GO(claqps_, +//GO(claqr0_, +//GO(claqr1_, +//GO(claqr2_, +//GO(claqr3_, +//GO(claqr4_, +//GO(claqr5_, +//GO(claqsb_, +//GO(claqsp_, +//GO(claqsy_, +//GO(claqz0_, +//GO(claqz1_, +//GO(claqz2_, +//GO(claqz3_, +//GO(clar1v_, +//GO(clar2v_, +GO(clarcm_, vFppppppppp) +GO(clarf_, vFpppppppppL) +//GO(clarf1f_, +//GO(clarf1l_, +GO(clarfb_, vFpppppppppppppppLLLL) +//GO(clarfb_gett_, +GO(clarfg_, vFppppp) +//GO(clarfgp_, +GO(clarft_, vFpppppppppLL) +GO(clarfx_, vFppppppppL) +//GO(clarfy_, +//GO(clargv_, +GO(clarnv_, vFpppp) +//GO(clarrv_, +//GO(clartg_, +//GO(clartv_, +//GO(clarz_, +//GO(clarzb_, +//GO(clarzt_, +GO(clascl_, vFppppppppppL) +GO(claset_, vFpppppppL) +//GO(clasr_, +GO(classq_, vFppppp) +//GO(claswlq_, +GO(claswp_, vFppppppp) +//GO(clasyf_, +//GO(clasyf_aa_, +//GO(clasyf_rk_, +//GO(clasyf_rook_, +//GO(clatbs_, +//GO(clatdf_, +//GO(clatps_, +//GO(clatrd_, +//GO(clatrs_, +//GO(clatrs3_, +//GO(clatrz_, +//GO(clatsqr_, +//GO(clatzm_, +//GO(claunhr_col_getrfnp_, +//GO(claunhr_col_getrfnp2_, +//GO(clauu2_, +GO(clauum_, vFpppppL) +GO(cpbcon_, vFppppppppppL) +GO(cpbequ_, vFpppppppppL) +GO(cpbrfs_, vFpppppppppppppppppL) +GO(cpbstf_, vFppppppL) +GO(cpbsv_, vFpppppppppL) +GO(cpbsvx_, vFpppppppppppppppppppppLLL) +//GO(cpbtf2_, +GO(cpbtrf_, vFppppppL) +GO(cpbtrs_, vFpppppppppL) +GO(cpftrf_, vFpppppLL) +GO(cpftri_, vFpppppLL) +GO(cpftrs_, vFppppppppLL) +GO(cpocon_, vFpppppppppL) +GO(cpoequ_, vFppppppp) +GO(cpoequb_, vFppppppp) +GO(cporfs_, vFppppppppppppppppL) +GO(cposv_, vFppppppppL) +GO(cposvx_, vFppppppppppppppppppppLLL) +GO(cpotf2_, vFpppppL) +GO(cpotrf_, vFpppppL) +GO(cpotrf2_, vFpppppL) +GO(cpotri_, vFpppppL) +GO(cpotrs_, vFppppppppL) +GO(cppcon_, vFppppppppL) +GO(cppequ_, vFpppppppL) +GO(cpprfs_, vFppppppppppppppL) +GO(cppsv_, vFpppppppL) +GO(cppsvx_, vFppppppppppppppppppLLL) +GO(cpptrf_, vFppppL) +GO(cpptri_, vFppppL) +GO(cpptrs_, vFpppppppL) +//GO(cpstf2_, +GO(cpstrf_, vFpppppppppL) +GO(cptcon_, vFppppppp) +GO(cpteqr_, vFppppppppL) +GO(cptrfs_, vFppppppppppppppppL) +GO(cptsv_, vFppppppp) +GO(cptsvx_, vFpppppppppppppppppL) +GO(cpttrf_, vFpppp) +GO(cpttrs_, vFppppppppL) +//GO(cptts2_, +//GO(crot_, +//GO(crscl_, +GO(cspcon_, vFppppppppL) +//GO(cspmv_, +//GO(cspr_, +GO(csprfs_, vFpppppppppppppppL) +GO(cspsv_, vFppppppppL) +GO(cspsvx_, vFpppppppppppppppppLL) +GO(csptrf_, vFpppppL) +GO(csptri_, vFppppppL) +GO(csptrs_, vFppppppppL) +//GO(csrscl_, +GO(cstedc_, vFpppppppppppppL) +GO(cstegr_, vFppppppppppppppppppppLL) +GO(cstein_, vFppppppppppppp) +GO(cstemr_, vFpppppppppppppppppppppLL) +GO(csteqr_, vFppppppppL) +GO(csycon_, vFpppppppppL) +GO(csycon_3_, vFppppppppppL) +//GO(csycon_rook_, +GO(csyconv_, vFppppppppLL) +//GO(csyconvf_, +//GO(csyconvf_rook_, +GO(csyequb_, vFpppppppppL) +//GO(csymv_, +GO(csyr_, vFpppppppL) +GO(csyrfs_, vFpppppppppppppppppL) +GO(csysv_, vFpppppppppppL) +GO(csysv_aa_, vFpppppppppppL) +GO(csysv_aa_2stage_, vFppppppppppppppL) +GO(csysv_rk_, vFppppppppppppL) +GO(csysv_rook_, vFpppppppppppL) +GO(csysvx_, vFppppppppppppppppppppLL) +GO(csyswapr_, vFppppppL) +//GO(csytf2_, +//GO(csytf2_rk_, +//GO(csytf2_rook_, +GO(csytrf_, vFppppppppL) +GO(csytrf_aa_, vFppppppppL) +GO(csytrf_aa_2stage_, vFpppppppppppL) +GO(csytrf_rk_, vFpppppppppL) +GO(csytrf_rook_, vFppppppppL) +GO(csytri_, vFpppppppL) +GO(csytri2_, vFppppppppL) +GO(csytri2x_, vFppppppppL) +GO(csytri_3_, vFpppppppppL) +//GO(csytri_3x_, +//GO(csytri_rook_, +GO(csytrs_, vFpppppppppL) +GO(csytrs2_, vFppppppppppL) +GO(csytrs_3_, vFppppppppppL) +GO(csytrs_aa_, vFpppppppppppL) +GO(csytrs_aa_2stage_, vFppppppppppppL) +GO(csytrs_rook_, vFpppppppppL) +GO(ctbcon_, vFpppppppppppLLL) +GO(ctbrfs_, vFpppppppppppppppppLLL) +GO(ctbtrs_, vFpppppppppppLLL) +GO(ctfsm_, vFpppppppppppLLLLL) +GO(ctftri_, vFppppppLLL) +GO(ctfttp_, vFppppppLL) +GO(ctfttr_, vFpppppppLL) +GO(ctgevc_, vFpppppppppppppppppLL) +//GO(ctgex2_, +GO(ctgexc_, vFpppppppppppppp) +GO(ctgsen_, vFpppppppppppppppppppppppp) +GO(ctgsja_, vFpppppppppppppppppppppppppLLL) +GO(ctgsna_, vFppppppppppppppppppppLL) +//GO(ctgsy2_, +GO(ctgsyl_, vFppppppppppppppppppppppL) +GO(ctpcon_, vFpppppppppLLL) +GO(ctplqt_, vFpppppppppppp) +GO(ctplqt2_, vFpppppppppp) +GO(ctpmlqt_, vFpppppppppppppppppLL) +GO(ctpmqrt_, vFpppppppppppppppppLL) +GO(ctpqrt_, vFpppppppppppp) +GO(ctpqrt2_, vFpppppppppp) +GO(ctprfb_, vFppppppppppppppppppLLLL) +GO(ctprfs_, vFpppppppppppppppLLL) +GO(ctptri_, vFpppppLL) +GO(ctptrs_, vFpppppppppLLL) +GO(ctpttf_, vFppppppLL) +GO(ctpttr_, vFppppppL) +GO(ctrcon_, vFppppppppppLLL) +GO(ctrevc_, vFpppppppppppppppLL) +GO(ctrevc3_, vFpppppppppppppppppLL) +GO(ctrexc_, vFpppppppppL) +GO(ctrrfs_, vFppppppppppppppppLLL) +GO(ctrsen_, vFpppppppppppppppLL) +GO(ctrsna_, vFppppppppppppppppppLL) +GO(ctrsyl_, vFpppppppppppppLL) +GO(ctrsyl3_, vFpppppppppppppppLL) +//GO(ctrti2_, +GO(ctrtri_, vFppppppLL) +GO(ctrtrs_, vFppppppppppLLL) +GO(ctrttf_, vFpppppppLL) +GO(ctrttp_, vFppppppL) +//GO(ctzrqf_, +GO(ctzrzf_, vFpppppppp) +GO(cunbdb_, vFppppppppppppppppppppppLL) +//GO(cunbdb1_, +//GO(cunbdb2_, +//GO(cunbdb3_, +//GO(cunbdb4_, +//GO(cunbdb5_, +//GO(cunbdb6_, +GO(cuncsd_, vFppppppppppppppppppppppppppppppppLLLLLL) +GO(cuncsd2by1_, vFpppppppppppppppppppppppLLL) +//GO(cung2l_, +//GO(cung2r_, +GO(cungbr_, vFppppppppppL) +GO(cunghr_, vFppppppppp) +//GO(cungl2_, +GO(cunglq_, vFppppppppp) +GO(cungql_, vFppppppppp) +GO(cungqr_, vFppppppppp) +//GO(cungr2_, +GO(cungrq_, vFppppppppp) +GO(cungtr_, vFppppppppL) +//GO(cungtsqr_, +GO(cungtsqr_row_, vFppppppppppp) +GO(cunhr_col_, vFppppppppp) +//GO(cunm22_, +//GO(cunm2l_, +//GO(cunm2r_, +GO(cunmbr_, vFppppppppppppppLLL) +GO(cunmhr_, vFppppppppppppppLL) +//GO(cunml2_, +GO(cunmlq_, vFpppppppppppppLL) +GO(cunmql_, vFpppppppppppppLL) +GO(cunmqr_, vFpppppppppppppLL) +//GO(cunmr2_, +//GO(cunmr3_, +GO(cunmrq_, vFpppppppppppppLL) +GO(cunmrz_, vFppppppppppppppLL) +GO(cunmtr_, vFpppppppppppppLLL) +GO(cupgtr_, vFppppppppL) +GO(cupmtr_, vFpppppppppppLLL) +GO(dbbcsd_, vFpppppppppppppppppppppppppppppLLLLL) +GO(dbdsdc_, vFppppppppppppppLL) +GO(dbdsqr_, vFpppppppppppppppL) +GO(dbdsvdx_, vFpppppppppppppppppLLL) +GO(ddisna_, vFppppppL) +GO(dgbbrd_, vFppppppppppppppppppL) +GO(dgbcon_, vFppppppppppppL) +GO(dgbequ_, vFpppppppppppp) +GO(dgbequb_, vFpppppppppppp) +GO(dgbrfs_, vFpppppppppppppppppppL) +GO(dgbsv_, vFpppppppppp) +GO(dgbsvx_, vFppppppppppppppppppppppppLLL) +//GO(dgbtf2_, +GO(dgbtrf_, vFpppppppp) +GO(dgbtrs_, vFpppppppppppL) +GO(dgebak_, vFppppppppppLL) +GO(dgebal_, vFppppppppL) +//GO(dgebd2_, +GO(dgebrd_, vFppppppppppp) +GO(dgecon_, vFpppppppppL) +GO(dgedmd_, vFppppppppppppppppppppppppppppppLLLL) +GO(dgedmdq_, vFppppppppppppppppppppppppppppppppppLLLLLL) +GO(dgeequ_, vFpppppppppp) +GO(dgeequb_, vFpppppppppp) +//GOM(dgees_, vFEpppppppppppppppLL) +//GOM(dgeesx_, vFEppppppppppppppppppppLLL) +GO(dgeev_, vFppppppppppppppLL) +GO(dgeevx_, vFpppppppppppppppppppppppLLLL) +//GO(dgegs_, +//GO(dgegv_, +//GO(dgehd2_, +GO(dgehrd_, vFppppppppp) +GO(dgejsv_, vFpppppppppppppppppppLLLLLL) +GO(dgelq_, vFppppppppp) +GO(dgelq2_, vFppppppp) +GO(dgelqf_, vFpppppppp) +//GO(dgelqs_, +//GO(dgelqt_, +//GO(dgelqt3_, +GO(dgels_, vFpppppppppppL) +GO(dgelsd_, vFpppppppppppppp) +GO(dgelss_, vFppppppppppppp) +//GO(dgelst_, +//GO(dgelsx_, +GO(dgelsy_, vFppppppppppppp) +GO(dgemlq_, vFppppppppppppppLL) +//GO(dgemlqt_, +GO(dgemqr_, vFppppppppppppppLL) +GO(dgemqrt_, vFppppppppppppppLL) +GO(dgeql2_, vFppppppp) +GO(dgeqlf_, vFpppppppp) +GO(dgeqp3_, vFppppppppp) +//GO(dgeqp3rk_, +GO(dgeqpf_, vFpppppppp) +GO(dgeqr_, vFppppppppp) +GO(dgeqr2_, vFppppppp) +//GO(dgeqr2p_, +GO(dgeqrf_, vFpppppppp) +GO(dgeqrfp_, vFpppppppp) +//GO(dgeqrs_, +GO(dgeqrt_, vFppppppppp) +GO(dgeqrt2_, vFppppppp) +GO(dgeqrt3_, vFppppppp) +GO(dgerfs_, vFpppppppppppppppppL) +GO(dgerq2_, vFppppppp) +GO(dgerqf_, vFpppppppp) +//GO(dgesc2_, +GO(dgesdd_, vFppppppppppppppL) +GO(dgesv_, vFpppppppp) +GO(dgesvd_, vFppppppppppppppLL) +GO(dgesvdq_, vFppppppppppppppppppppppLLLLL) +GO(dgesvdx_, vFpppppppppppppppppppppLLL) +GO(dgesvj_, vFppppppppppppppLLL) +GO(dgesvx_, vFppppppppppppppppppppppLLL) +//GO(dgetc2_, +GO(dgetf2_, vFpppppp) +GO(dgetrf_, vFpppppp) +GO(dgetrf2_, vFpppppp) +GO(dgetri_, vFppppppp) +GO(dgetrs_, vFpppppppppL) +GO(dgetsls_, vFpppppppppppL) +GO(dgetsqrhrt_, vFpppppppppppp) +GO(dggbak_, vFpppppppppppLL) +GO(dggbal_, vFppppppppppppL) +//GOM(dgges_, vFEpppppppppppppppppppppLLL) +//GOM(dgges3_, vFEpppppppppppppppppppppLLL) +//GOM(dggesx_, vFEppppppppppppppppppppppppppLLLL) +GO(dggev_, vFpppppppppppppppppLL) +GO(dggev3_, vFpppppppppppppppppLL) +GO(dggevx_, vFpppppppppppppppppppppppppppppLLLL) +GO(dggglm_, vFppppppppppppp) +GO(dgghd3_, vFppppppppppppppppLL) +GO(dgghrd_, vFppppppppppppppLL) +GO(dgglse_, vFppppppppppppp) +GO(dggqrf_, vFpppppppppppp) +GO(dggrqf_, vFpppppppppppp) +GO(dggsvd_, iFpppppppppppppppppppppppLLL) +GO(dggsvd3_, vFppppppppppppppppppppppppLLL) +GO(dggsvp_, iFppppppppppppppppppppppppLLL) +GO(dggsvp3_, vFpppppppppppppppppppppppppLLL) +//GO(dgsvj0_, +//GO(dgsvj1_, +GO(dgtcon_, vFppppppppppppL) +GO(dgtrfs_, vFppppppppppppppppppppL) +GO(dgtsv_, vFpppppppp) +GO(dgtsvx_, vFppppppppppppppppppppppLL) +GO(dgttrf_, vFppppppp) +GO(dgttrs_, vFpppppppppppL) +//GO(dgtts2_, +GO(dhgeqz_, vFppppppppppppppppppppLLL) +GO(dhsein_, vFpppppppppppppppppppLLL) +GO(dhseqr_, vFppppppppppppppLL) +//GO(disnan_, +//GO(dlabad_, +//GO(dlabrd_, +GO(dlacn2_, vFppppppp) +//GO(dlacon_, +GO(dlacpy_, vFpppppppL) +//GO(dladiv_, +//GO(dladiv1_, +//GO(dladiv2_, +//GO(dlae2_, +//GO(dlaebz_, +//GO(dlaed0_, +//GO(dlaed1_, +//GO(dlaed2_, +//GO(dlaed3_, +//GO(dlaed4_, +//GO(dlaed5_, +//GO(dlaed6_, +//GO(dlaed7_, +//GO(dlaed8_, +//GO(dlaed9_, +//GO(dlaeda_, +//GO(dlaein_, +//GO(dlaev2_, +//GO(dlaexc_, +//GO(dlag2_, +GO(dlag2s_, vFppppppp) +//GO(dlags2_, +//GO(dlagtf_, +//GO(dlagtm_, +//GO(dlagts_, +//GO(dlagv2_, +//GO(dlahqr_, +//GO(dlahr2_, +//GO(dlahrd_, +//GO(dlaic1_, +//GO(dlaisnan_, +//GO(dlaln2_, +//GO(dlals0_, +//GO(dlalsa_, +//GO(dlalsd_, +//GO(dlamc3_, +GO(dlamch_, dFpL) +//GO(dlamrg_, +//GO(dlamswlq_, +//GO(dlamtsqr_, +//GO(dlaneg_, +GO(dlangb_, dFpppppppL) +GO(dlange_, dFppppppL) +GO(dlangt_, dFpppppL) +GO(dlanhs_, dFpppppL) +GO(dlansb_, dFpppppppLL) +//GO(dlansf_, +GO(dlansp_, dFpppppLL) +GO(dlanst_, dFppppL) +GO(dlansy_, dFppppppLL) +GO(dlantb_, dFppppppppLLL) +GO(dlantp_, dFppppppLLL) +GO(dlantr_, dFppppppppLLL) +//GO(dlanv2_, +//GO(dlaorhr_col_getrfnp_, +//GO(dlaorhr_col_getrfnp2_, +//GO(dlapll_, +GO(dlapmr_, vFpppppp) +GO(dlapmt_, vFpppppp) +GO(dlapy2_, dFpp) +GO(dlapy3_, dFppp) +//GO(dlaqgb_, +//GO(dlaqge_, +//GO(dlaqp2_, +//GO(dlaqp2rk_, +//GO(dlaqp3rk_, +//GO(dlaqps_, +//GO(dlaqr0_, +//GO(dlaqr1_, +//GO(dlaqr2_, +//GO(dlaqr3_, +//GO(dlaqr4_, +//GO(dlaqr5_, +//GO(dlaqsb_, +//GO(dlaqsp_, +//GO(dlaqsy_, +//GO(dlaqtr_, +//GO(dlaqz0_, +//GO(dlaqz1_, +//GO(dlaqz2_, +//GO(dlaqz3_, +//GO(dlaqz4_, +//GO(dlar1v_, +//GO(dlar2v_, +GO(dlarf_, vFpppppppppL) +//GO(dlarf1f_, +//GO(dlarf1l_, +GO(dlarfb_, vFpppppppppppppppLLLL) +//GO(dlarfb_gett_, +GO(dlarfg_, vFppppp) +//GO(dlarfgp_, +GO(dlarft_, vFpppppppppLL) +GO(dlarfx_, vFppppppppL) +//GO(dlarfy_, +//GO(dlargv_, +//GO(dlarmm_, +GO(dlarnv_, vFpppp) +//GO(dlarra_, +//GO(dlarrb_, +//GO(dlarrc_, +//GO(dlarrd_, +//GO(dlarre_, +//GO(dlarrf_, +//GO(dlarrj_, +//GO(dlarrk_, +//GO(dlarrr_, +//GO(dlarrv_, +//GO(dlartg_, +GO(dlartgp_, vFppppp) +GO(dlartgs_, vFppppp) +//GO(dlartv_, +//GO(dlaruv_, +//GO(dlarz_, +//GO(dlarzb_, +//GO(dlarzt_, +//GO(dlas2_, +GO(dlascl_, vFppppppppppL) +//GO(dlasd0_, +//GO(dlasd1_, +//GO(dlasd2_, +//GO(dlasd3_, +//GO(dlasd4_, +//GO(dlasd5_, +//GO(dlasd6_, +//GO(dlasd7_, +//GO(dlasd8_, +//GO(dlasda_, +//GO(dlasdq_, +//GO(dlasdt_, +GO(dlaset_, vFpppppppL) +//GO(dlasq1_, +//GO(dlasq2_, +//GO(dlasq3_, +//GO(dlasq4_, +//GO(dlasq5_, +//GO(dlasq6_, +//GO(dlasr_, +GO(dlasrt_, vFppppL) +GO(dlassq_, vFppppp) +//GO(dlasv2_, +//GO(dlaswlq_, +GO(dlaswp_, vFppppppp) +//GO(dlasy2_, +//GO(dlasyf_, +//GO(dlasyf_aa_, +//GO(dlasyf_rk_, +//GO(dlasyf_rook_, +//GO(dlat2s_, +//GO(dlatbs_, +//GO(dlatdf_, +//GO(dlatps_, +//GO(dlatrd_, +//GO(dlatrs_, +//GO(dlatrs3_, +//GO(dlatrz_, +//GO(dlatsqr_, +//GO(dlatzm_, +//GO(dlauu2_, +GO(dlauum_, vFpppppL) +GO(dopgtr_, vFppppppppL) +GO(dopmtr_, vFpppppppppppLLL) +GO(dorbdb_, vFppppppppppppppppppppppLL) +//GO(dorbdb1_, +//GO(dorbdb2_, +//GO(dorbdb3_, +//GO(dorbdb4_, +//GO(dorbdb5_, +//GO(dorbdb6_, +GO(dorcsd_, vFppppppppppppppppppppppppppppppLLLLLL) +GO(dorcsd2by1_, vFpppppppppppppppppppppLLL) +//GO(dorg2l_, +//GO(dorg2r_, +GO(dorgbr_, vFppppppppppL) +GO(dorghr_, vFppppppppp) +//GO(dorgl2_, +GO(dorglq_, vFppppppppp) +GO(dorgql_, vFppppppppp) +GO(dorgqr_, vFppppppppp) +//GO(dorgr2_, +GO(dorgrq_, vFppppppppp) +GO(dorgtr_, vFppppppppL) +//GO(dorgtsqr_, +GO(dorgtsqr_row_, vFppppppppppp) +GO(dorhr_col_, vFppppppppp) +//GO(dorm22_, +//GO(dorm2l_, +//GO(dorm2r_, +GO(dormbr_, vFppppppppppppppLLL) +GO(dormhr_, vFppppppppppppppLL) +//GO(dorml2_, +GO(dormlq_, vFpppppppppppppLL) +GO(dormql_, vFpppppppppppppLL) +GO(dormqr_, vFpppppppppppppLL) +//GO(dormr2_, +//GO(dormr3_, +GO(dormrq_, vFpppppppppppppLL) +GO(dormrz_, vFppppppppppppppLL) +GO(dormtr_, vFpppppppppppppLLL) +GO(dpbcon_, vFppppppppppL) +GO(dpbequ_, vFpppppppppL) +GO(dpbrfs_, vFpppppppppppppppppL) +GO(dpbstf_, vFppppppL) +GO(dpbsv_, vFpppppppppL) +GO(dpbsvx_, vFpppppppppppppppppppppLLL) +//GO(dpbtf2_, +GO(dpbtrf_, vFppppppL) +GO(dpbtrs_, vFpppppppppL) +GO(dpftrf_, vFpppppLL) +GO(dpftri_, vFpppppLL) +GO(dpftrs_, vFppppppppLL) +GO(dpocon_, vFpppppppppL) +GO(dpoequ_, vFppppppp) +GO(dpoequb_, vFppppppp) +GO(dporfs_, vFppppppppppppppppL) +GO(dposv_, vFppppppppL) +GO(dposvx_, vFppppppppppppppppppppLLL) +GO(dpotf2_, vFpppppL) +GO(dpotrf_, vFpppppL) +GO(dpotrf2_, vFpppppL) +GO(dpotri_, vFpppppL) +GO(dpotrs_, vFppppppppL) +GO(dppcon_, vFppppppppL) +GO(dppequ_, vFpppppppL) +GO(dpprfs_, vFppppppppppppppL) +GO(dppsv_, vFpppppppL) +GO(dppsvx_, vFppppppppppppppppppLLL) +GO(dpptrf_, vFppppL) +GO(dpptri_, vFppppL) +GO(dpptrs_, vFpppppppL) +//GO(dpstf2_, +GO(dpstrf_, vFpppppppppL) +GO(dptcon_, vFppppppp) +GO(dpteqr_, vFppppppppL) +GO(dptrfs_, vFpppppppppppppp) +GO(dptsv_, vFppppppp) +GO(dptsvx_, vFppppppppppppppppL) +GO(dpttrf_, vFpppp) +GO(dpttrs_, vFppppppp) +//GO(dptts2_, +//GO(droundup_lwork_, +//GO(drscl_, +//GO(dsb2st_kernels_, +GO(dsbev_, vFpppppppppppLL) +GO(dsbev_2stage_, vFppppppppppppLL) +GO(dsbevd_, vFppppppppppppppLL) +GO(dsbevd_2stage_, vFppppppppppppppLL) +GO(dsbevx_, vFppppppppppppppppppppppLLL) +GO(dsbevx_2stage_, vFpppppppppppppppppppppppLLL) +GO(dsbgst_, vFpppppppppppppLL) +GO(dsbgv_, vFppppppppppppppLL) +GO(dsbgvd_, vFpppppppppppppppppLL) +GO(dsbgvx_, vFpppppppppppppppppppppppppLLL) +GO(dsbtrd_, vFppppppppppppLL) +//GO(dsecnd_, +GO(dsfrk_, vFppppppppppLLL) +GO(dsgesv_, vFppppppppppppp) +GO(dspcon_, vFpppppppppL) +GO(dspev_, vFpppppppppLL) +GO(dspevd_, vFppppppppppppLL) +GO(dspevx_, vFppppppppppppppppppLLL) +GO(dspgst_, vFppppppL) +GO(dspgv_, vFpppppppppppLL) +GO(dspgvd_, vFppppppppppppppLL) +GO(dspgvx_, vFppppppppppppppppppppLLL) +GO(dsposv_, vFpppppppppppppL) +GO(dsprfs_, vFpppppppppppppppL) +GO(dspsv_, vFppppppppL) +GO(dspsvx_, vFpppppppppppppppppLL) +GO(dsptrd_, vFpppppppL) +GO(dsptrf_, vFpppppL) +GO(dsptri_, vFppppppL) +GO(dsptrs_, vFppppppppL) +GO(dstebz_, vFppppppppppppppppppLL) +GO(dstedc_, vFpppppppppppL) +GO(dstegr_, vFppppppppppppppppppppLL) +GO(dstein_, vFppppppppppppp) +GO(dstemr_, vFpppppppppppppppppppppLL) +GO(dsteqr_, vFppppppppL) +GO(dsterf_, vFpppp) +GO(dstev_, vFppppppppL) +GO(dstevd_, vFpppppppppppL) +GO(dstevr_, vFppppppppppppppppppppLL) +GO(dstevx_, vFppppppppppppppppppLL) +GO(dsycon_, vFppppppppppL) +GO(dsycon_3_, vFpppppppppppL) +//GO(dsycon_rook_, +GO(dsyconv_, vFppppppppLL) +//GO(dsyconvf_, +//GO(dsyconvf_rook_, +GO(dsyequb_, vFpppppppppL) +GO(dsyev_, vFpppppppppLL) +GO(dsyev_2stage_, vFpppppppppLL) +GO(dsyevd_, vFpppppppppppLL) +GO(dsyevd_2stage_, vFpppppppppppLL) +GO(dsyevr_, vFpppppppppppppppppppppLLL) +GO(dsyevr_2stage_, vFpppppppppppppppppppppLLL) +GO(dsyevx_, vFppppppppppppppppppppLLL) +GO(dsyevx_2stage_, vFppppppppppppppppppppLLL) +//GO(dsygs2_, +GO(dsygst_, vFppppppppL) +GO(dsygv_, vFppppppppppppLL) +GO(dsygv_2stage_, vFppppppppppppLL) +GO(dsygvd_, vFppppppppppppppLL) +GO(dsygvx_, vFpppppppppppppppppppppppLLL) +GO(dsyrfs_, vFpppppppppppppppppL) +GO(dsysv_, vFpppppppppppL) +GO(dsysv_aa_, vFpppppppppppL) +GO(dsysv_aa_2stage_, vFppppppppppppppL) +GO(dsysv_rk_, vFppppppppppppL) +GO(dsysv_rook_, vFpppppppppppL) +GO(dsysvx_, vFppppppppppppppppppppLL) +GO(dsyswapr_, vFppppppL) +//GO(dsytd2_, +//GO(dsytf2_, +//GO(dsytf2_rk_, +//GO(dsytf2_rook_, +GO(dsytrd_, vFppppppppppL) +GO(dsytrd_2stage_, vFpppppppppppppLL) +//GO(dsytrd_sb2st_, +//GO(dsytrd_sy2sb_, +GO(dsytrf_, vFppppppppL) +GO(dsytrf_aa_, vFppppppppL) +GO(dsytrf_aa_2stage_, vFpppppppppppL) +GO(dsytrf_rk_, vFpppppppppL) +GO(dsytrf_rook_, vFppppppppL) +GO(dsytri_, vFpppppppL) +GO(dsytri2_, vFppppppppL) +GO(dsytri2x_, vFppppppppL) +GO(dsytri_3_, vFpppppppppL) +//GO(dsytri_3x_, +//GO(dsytri_rook_, +GO(dsytrs_, vFpppppppppL) +GO(dsytrs2_, vFppppppppppL) +GO(dsytrs_3_, vFppppppppppL) +GO(dsytrs_aa_, vFpppppppppppL) +GO(dsytrs_aa_2stage_, vFppppppppppppL) +GO(dsytrs_rook_, vFpppppppppL) +GO(dtbcon_, vFpppppppppppLLL) +GO(dtbrfs_, vFpppppppppppppppppLLL) +GO(dtbtrs_, vFpppppppppppLLL) +GO(dtfsm_, vFpppppppppppLLLLL) +GO(dtftri_, vFppppppLLL) +GO(dtfttp_, vFppppppLL) +GO(dtfttr_, vFpppppppLL) +GO(dtgevc_, vFppppppppppppppppLL) +//GO(dtgex2_, +GO(dtgexc_, vFpppppppppppppppp) +GO(dtgsen_, vFppppppppppppppppppppppppp) +GO(dtgsja_, vFpppppppppppppppppppppppppLLL) +GO(dtgsna_, vFppppppppppppppppppppLL) +//GO(dtgsy2_, +GO(dtgsyl_, vFppppppppppppppppppppppL) +GO(dtpcon_, vFpppppppppLLL) +GO(dtplqt_, vFpppppppppppp) +GO(dtplqt2_, vFpppppppppp) +GO(dtpmlqt_, vFpppppppppppppppppLL) +GO(dtpmqrt_, vFpppppppppppppppppLL) +GO(dtpqrt_, vFpppppppppppp) +GO(dtpqrt2_, vFpppppppppp) +GO(dtprfb_, vFppppppppppppppppppLLLL) +GO(dtprfs_, vFpppppppppppppppLLL) +GO(dtptri_, vFpppppLL) +GO(dtptrs_, vFpppppppppLLL) +GO(dtpttf_, vFppppppLL) +GO(dtpttr_, vFppppppL) +GO(dtrcon_, vFppppppppppLLL) +GO(dtrevc_, vFppppppppppppppLL) +GO(dtrevc3_, vFpppppppppppppppLL) +GO(dtrexc_, vFppppppppppL) +GO(dtrrfs_, vFppppppppppppppppLLL) +GO(dtrsen_, vFppppppppppppppppppLL) +GO(dtrsna_, vFppppppppppppppppppLL) +GO(dtrsyl_, vFpppppppppppppLL) +GO(dtrsyl3_, vFpppppppppppppppppLL) +//GO(dtrti2_, +GO(dtrtri_, vFppppppLL) +GO(dtrtrs_, vFppppppppppLLL) +GO(dtrttf_, vFpppppppLL) +GO(dtrttp_, vFppppppL) +//GO(dtzrqf_, +GO(dtzrzf_, vFpppppppp) +//GO(dzsum1_, +//GO(icmax1_, +//GO(ieeeck_, +//GO(ilaclc_, +//GO(ilaclr_, +//GO(iladiag_, +//GO(iladlc_, +//GO(iladlr_, +//GO(ilaenv_, +//GO(ilaenv2stage_, +//GO(ilaprec_, +//GO(ilaslc_, +//GO(ilaslr_, +//GO(ilatrans_, +//GO(ilauplo_, +GO(ilaver_, vFppp) +//GO(ilazlc_, +//GO(ilazlr_, +//GO(iparam2stage_, +//GO(iparmq_, +//GO(izmax1_, +//GO(__la_xisnan_MOD_disnan, +//GO(__la_xisnan_MOD_sisnan, +GO(lsame_, iFppLL) +//GO(lsamen_, +GO(sbbcsd_, vFpppppppppppppppppppppppppppppLLLLL) +GO(sbdsdc_, vFppppppppppppppLL) +GO(sbdsqr_, vFpppppppppppppppL) +GO(sbdsvdx_, vFpppppppppppppppppLLL) +//GO(scsum1_, +GO(sdisna_, vFppppppL) +//GO(second_, +GO(sgbbrd_, vFppppppppppppppppppL) +GO(sgbcon_, vFppppppppppppL) +GO(sgbequ_, vFpppppppppppp) +GO(sgbequb_, vFpppppppppppp) +GO(sgbrfs_, vFpppppppppppppppppppL) +GO(sgbsv_, vFpppppppppp) +GO(sgbsvx_, vFppppppppppppppppppppppppLLL) +//GO(sgbtf2_, +GO(sgbtrf_, vFpppppppp) +GO(sgbtrs_, vFpppppppppppL) +GO(sgebak_, vFppppppppppLL) +GO(sgebal_, vFppppppppL) +//GO(sgebd2_, +GO(sgebrd_, vFppppppppppp) +GO(sgecon_, vFpppppppppL) +GO(sgedmd_, vFppppppppppppppppppppppppppppppLLLL) +GO(sgedmdq_, vFppppppppppppppppppppppppppppppppppLLLLLL) +GO(sgeequ_, vFpppppppppp) +GO(sgeequb_, vFpppppppppp) +//GOM(sgees_, vFEpppppppppppppppLL) +//GOM(sgeesx_, vFEppppppppppppppppppppLLL) +GO(sgeev_, vFppppppppppppppLL) +GO(sgeevx_, vFpppppppppppppppppppppppLLLL) +//GO(sgegs_, +//GO(sgegv_, +//GO(sgehd2_, +GO(sgehrd_, vFppppppppp) +GO(sgejsv_, vFpppppppppppppppppppLLLLLL) +GO(sgelq_, vFppppppppp) +GO(sgelq2_, vFppppppp) +GO(sgelqf_, vFpppppppp) +//GO(sgelqs_, +//GO(sgelqt_, +//GO(sgelqt3_, +GO(sgels_, vFpppppppppppL) +GO(sgelsd_, vFpppppppppppppp) +GO(sgelss_, vFppppppppppppp) +//GO(sgelst_, +//GO(sgelsx_, +GO(sgelsy_, vFppppppppppppp) +GO(sgemlq_, vFppppppppppppppLL) +//GO(sgemlqt_, +GO(sgemqr_, vFppppppppppppppLL) +GO(sgemqrt_, vFppppppppppppppLL) +GO(sgeql2_, vFppppppp) +GO(sgeqlf_, vFpppppppp) +GO(sgeqp3_, vFppppppppp) +//GO(sgeqp3rk_, +GO(sgeqpf_, vFpppppppp) +GO(sgeqr_, vFppppppppp) +GO(sgeqr2_, vFppppppp) +//GO(sgeqr2p_, +GO(sgeqrf_, vFpppppppp) +GO(sgeqrfp_, vFpppppppp) +//GO(sgeqrs_, +GO(sgeqrt_, vFppppppppp) +GO(sgeqrt2_, vFppppppp) +GO(sgeqrt3_, vFppppppp) +GO(sgerfs_, vFpppppppppppppppppL) +GO(sgerq2_, vFppppppp) +GO(sgerqf_, vFpppppppp) +//GO(sgesc2_, +GO(sgesdd_, vFppppppppppppppL) +GO(sgesv_, vFpppppppp) +GO(sgesvd_, vFppppppppppppppLL) +GO(sgesvdq_, vFppppppppppppppppppppppLLLLL) +GO(sgesvdx_, vFpppppppppppppppppppppLLL) +GO(sgesvj_, vFppppppppppppppLLL) +GO(sgesvx_, vFppppppppppppppppppppppLLL) +//GO(sgetc2_, +GO(sgetf2_, vFpppppp) +GO(sgetrf_, vFpppppp) +GO(sgetrf2_, vFpppppp) +GO(sgetri_, vFppppppp) +GO(sgetrs_, vFpppppppppL) +GO(sgetsls_, vFpppppppppppL) +GO(sgetsqrhrt_, vFpppppppppppp) +GO(sggbak_, vFpppppppppppLL) +GO(sggbal_, vFppppppppppppL) +//GOM(sgges_, vFEpppppppppppppppppppppLLL) +//GOM(sgges3_, vFEpppppppppppppppppppppLLL) +//GOM(sggesx_, vFEppppppppppppppppppppppppppLLLL) +GO(sggev_, vFpppppppppppppppppLL) +GO(sggev3_, vFpppppppppppppppppLL) +GO(sggevx_, vFpppppppppppppppppppppppppppppLLLL) +GO(sggglm_, vFppppppppppppp) +GO(sgghd3_, vFppppppppppppppppLL) +GO(sgghrd_, vFppppppppppppppLL) +GO(sgglse_, vFppppppppppppp) +GO(sggqrf_, vFpppppppppppp) +GO(sggrqf_, vFpppppppppppp) +GO(sggsvd_, iFpppppppppppppppppppppppLLL) +GO(sggsvd3_, vFppppppppppppppppppppppppLLL) +GO(sggsvp_, iFppppppppppppppppppppppppLLL) +GO(sggsvp3_, vFpppppppppppppppppppppppppLLL) +//GO(sgsvj0_, +//GO(sgsvj1_, +GO(sgtcon_, vFppppppppppppL) +GO(sgtrfs_, vFppppppppppppppppppppL) +GO(sgtsv_, vFpppppppp) +GO(sgtsvx_, vFppppppppppppppppppppppLL) +GO(sgttrf_, vFppppppp) +GO(sgttrs_, vFpppppppppppL) +//GO(sgtts2_, +GO(shgeqz_, vFppppppppppppppppppppLLL) +GO(shsein_, vFpppppppppppppppppppLLL) +GO(shseqr_, vFppppppppppppppLL) +//GO(sisnan_, +//GO(slabad_, +//GO(slabrd_, +GO(slacn2_, vFppppppp) +//GO(slacon_, +GO(slacpy_, vFpppppppL) +//GO(sladiv_, +//GO(sladiv1_, +//GO(sladiv2_, +//GO(slae2_, +//GO(slaebz_, +//GO(slaed0_, +//GO(slaed1_, +//GO(slaed2_, +//GO(slaed3_, +//GO(slaed4_, +//GO(slaed5_, +//GO(slaed6_, +//GO(slaed7_, +//GO(slaed8_, +//GO(slaed9_, +//GO(slaeda_, +//GO(slaein_, +//GO(slaev2_, +//GO(slaexc_, +//GO(slag2_, +GO(slag2d_, vFppppppp) +//GO(slags2_, +//GO(slagtf_, +//GO(slagtm_, +//GO(slagts_, +//GO(slagv2_, +//GO(slahqr_, +//GO(slahr2_, +//GO(slahrd_, +//GO(slaic1_, +//GO(slaisnan_, +//GO(slaln2_, +//GO(slals0_, +//GO(slalsa_, +//GO(slalsd_, +//GO(slamc3_, +GO(slamch_, fFpL) +//GO(slamrg_, +//GO(slamswlq_, +//GO(slamtsqr_, +//GO(slaneg_, +GO(slangb_, fFpppppppL) +GO(slange_, fFppppppL) +GO(slangt_, fFpppppL) +GO(slanhs_, fFpppppL) +GO(slansb_, fFpppppppLL) +//GO(slansf_, +GO(slansp_, fFpppppLL) +GO(slanst_, fFppppL) +GO(slansy_, fFppppppLL) +GO(slantb_, fFppppppppLLL) +GO(slantp_, fFppppppLLL) +GO(slantr_, fFppppppppLLL) +//GO(slanv2_, +//GO(slaorhr_col_getrfnp_, +//GO(slaorhr_col_getrfnp2_, +//GO(slapll_, +GO(slapmr_, vFpppppp) +GO(slapmt_, vFpppppp) +GO(slapy2_, fFpp) +GO(slapy3_, fFppp) +//GO(slaqgb_, +//GO(slaqge_, +//GO(slaqp2_, +//GO(slaqp2rk_, +//GO(slaqp3rk_, +//GO(slaqps_, +//GO(slaqr0_, +//GO(slaqr1_, +//GO(slaqr2_, +//GO(slaqr3_, +//GO(slaqr4_, +//GO(slaqr5_, +//GO(slaqsb_, +//GO(slaqsp_, +//GO(slaqsy_, +//GO(slaqtr_, +//GO(slaqz0_, +//GO(slaqz1_, +//GO(slaqz2_, +//GO(slaqz3_, +//GO(slaqz4_, +//GO(slar1v_, +//GO(slar2v_, +GO(slarf_, vFpppppppppL) +//GO(slarf1f_, +//GO(slarf1l_, +GO(slarfb_, vFpppppppppppppppLLLL) +//GO(slarfb_gett_, +GO(slarfg_, vFppppp) +//GO(slarfgp_, +GO(slarft_, vFpppppppppLL) +GO(slarfx_, vFppppppppL) +//GO(slarfy_, +//GO(slargv_, +//GO(slarmm_, +GO(slarnv_, vFpppp) +//GO(slarra_, +//GO(slarrb_, +//GO(slarrc_, +//GO(slarrd_, +//GO(slarre_, +//GO(slarrf_, +//GO(slarrj_, +//GO(slarrk_, +//GO(slarrr_, +//GO(slarrv_, +//GO(slartg_, +GO(slartgp_, vFppppp) +GO(slartgs_, vFppppp) +//GO(slartv_, +//GO(slaruv_, +//GO(slarz_, +//GO(slarzb_, +//GO(slarzt_, +//GO(slas2_, +GO(slascl_, vFppppppppppL) +//GO(slasd0_, +//GO(slasd1_, +//GO(slasd2_, +//GO(slasd3_, +//GO(slasd4_, +//GO(slasd5_, +//GO(slasd6_, +//GO(slasd7_, +//GO(slasd8_, +//GO(slasda_, +//GO(slasdq_, +//GO(slasdt_, +GO(slaset_, vFpppppppL) +//GO(slasq1_, +//GO(slasq2_, +//GO(slasq3_, +//GO(slasq4_, +//GO(slasq5_, +//GO(slasq6_, +//GO(slasr_, +GO(slasrt_, vFppppL) +GO(slassq_, vFppppp) +//GO(slasv2_, +//GO(slaswlq_, +GO(slaswp_, vFppppppp) +//GO(slasy2_, +//GO(slasyf_, +//GO(slasyf_aa_, +//GO(slasyf_rk_, +//GO(slasyf_rook_, +//GO(slatbs_, +//GO(slatdf_, +//GO(slatps_, +//GO(slatrd_, +//GO(slatrs_, +//GO(slatrs3_, +//GO(slatrz_, +//GO(slatsqr_, +//GO(slatzm_, +//GO(slauu2_, +GO(slauum_, vFpppppL) +GO(sopgtr_, vFppppppppL) +GO(sopmtr_, vFpppppppppppLLL) +GO(sorbdb_, vFppppppppppppppppppppppLL) +//GO(sorbdb1_, +//GO(sorbdb2_, +//GO(sorbdb3_, +//GO(sorbdb4_, +//GO(sorbdb5_, +//GO(sorbdb6_, +GO(sorcsd_, vFppppppppppppppppppppppppppppppLLLLLL) +GO(sorcsd2by1_, vFpppppppppppppppppppppLLL) +//GO(sorg2l_, +//GO(sorg2r_, +GO(sorgbr_, vFppppppppppL) +GO(sorghr_, vFppppppppp) +//GO(sorgl2_, +GO(sorglq_, vFppppppppp) +GO(sorgql_, vFppppppppp) +GO(sorgqr_, vFppppppppp) +//GO(sorgr2_, +GO(sorgrq_, vFppppppppp) +GO(sorgtr_, vFppppppppL) +//GO(sorgtsqr_, +GO(sorgtsqr_row_, vFppppppppppp) +GO(sorhr_col_, vFppppppppp) +//GO(sorm22_, +//GO(sorm2l_, +//GO(sorm2r_, +GO(sormbr_, vFppppppppppppppLLL) +GO(sormhr_, vFppppppppppppppLL) +//GO(sorml2_, +GO(sormlq_, vFpppppppppppppLL) +GO(sormql_, vFpppppppppppppLL) +GO(sormqr_, vFpppppppppppppLL) +//GO(sormr2_, +//GO(sormr3_, +GO(sormrq_, vFpppppppppppppLL) +GO(sormrz_, vFppppppppppppppLL) +GO(sormtr_, vFpppppppppppppLLL) +GO(spbcon_, vFppppppppppL) +GO(spbequ_, vFpppppppppL) +GO(spbrfs_, vFpppppppppppppppppL) +GO(spbstf_, vFppppppL) +GO(spbsv_, vFpppppppppL) +GO(spbsvx_, vFpppppppppppppppppppppLLL) +//GO(spbtf2_, +GO(spbtrf_, vFppppppL) +GO(spbtrs_, vFpppppppppL) +GO(spftrf_, vFpppppLL) +GO(spftri_, vFpppppLL) +GO(spftrs_, vFppppppppLL) +GO(spocon_, vFpppppppppL) +GO(spoequ_, vFppppppp) +GO(spoequb_, vFppppppp) +GO(sporfs_, vFppppppppppppppppL) +GO(sposv_, vFppppppppL) +GO(sposvx_, vFppppppppppppppppppppLLL) +GO(spotf2_, vFpppppL) +GO(spotrf_, vFpppppL) +GO(spotrf2_, vFpppppL) +GO(spotri_, vFpppppL) +GO(spotrs_, vFppppppppL) +GO(sppcon_, vFppppppppL) +GO(sppequ_, vFpppppppL) +GO(spprfs_, vFppppppppppppppL) +GO(sppsv_, vFpppppppL) +GO(sppsvx_, vFppppppppppppppppppLLL) +GO(spptrf_, vFppppL) +GO(spptri_, vFppppL) +GO(spptrs_, vFpppppppL) +//GO(spstf2_, +GO(spstrf_, vFpppppppppL) +GO(sptcon_, vFppppppp) +GO(spteqr_, vFppppppppL) +GO(sptrfs_, vFpppppppppppppp) +GO(sptsv_, vFppppppp) +GO(sptsvx_, vFppppppppppppppppL) +GO(spttrf_, vFpppp) +GO(spttrs_, vFppppppp) +//GO(sptts2_, +//GO(sroundup_lwork_, +//GO(srscl_, +//GO(ssb2st_kernels_, +GO(ssbev_, vFpppppppppppLL) +GO(ssbev_2stage_, vFppppppppppppLL) +GO(ssbevd_, vFppppppppppppppLL) +GO(ssbevd_2stage_, vFppppppppppppppLL) +GO(ssbevx_, vFppppppppppppppppppppppLLL) +GO(ssbevx_2stage_, vFpppppppppppppppppppppppLLL) +GO(ssbgst_, vFpppppppppppppLL) +GO(ssbgv_, vFppppppppppppppLL) +GO(ssbgvd_, vFpppppppppppppppppLL) +GO(ssbgvx_, vFpppppppppppppppppppppppppLLL) +GO(ssbtrd_, vFppppppppppppLL) +GO(ssfrk_, vFppppppppppLLL) +GO(sspcon_, vFpppppppppL) +GO(sspev_, vFpppppppppLL) +GO(sspevd_, vFppppppppppppLL) +GO(sspevx_, vFppppppppppppppppppLLL) +GO(sspgst_, vFppppppL) +GO(sspgv_, vFpppppppppppLL) +GO(sspgvd_, vFppppppppppppppLL) +GO(sspgvx_, vFppppppppppppppppppppLLL) +GO(ssprfs_, vFpppppppppppppppL) +GO(sspsv_, vFppppppppL) +GO(sspsvx_, vFpppppppppppppppppLL) +GO(ssptrd_, vFpppppppL) +GO(ssptrf_, vFpppppL) +GO(ssptri_, vFppppppL) +GO(ssptrs_, vFppppppppL) +GO(sstebz_, vFppppppppppppppppppLL) +GO(sstedc_, vFpppppppppppL) +GO(sstegr_, vFppppppppppppppppppppLL) +GO(sstein_, vFppppppppppppp) +GO(sstemr_, vFpppppppppppppppppppppLL) +GO(ssteqr_, vFppppppppL) +GO(ssterf_, vFpppp) +GO(sstev_, vFppppppppL) +GO(sstevd_, vFpppppppppppL) +GO(sstevr_, vFppppppppppppppppppppLL) +GO(sstevx_, vFppppppppppppppppppLL) +GO(ssycon_, vFppppppppppL) +GO(ssycon_3_, vFpppppppppppL) +//GO(ssycon_rook_, +GO(ssyconv_, vFppppppppLL) +//GO(ssyconvf_, +//GO(ssyconvf_rook_, +GO(ssyequb_, vFpppppppppL) +GO(ssyev_, vFpppppppppLL) +GO(ssyev_2stage_, vFpppppppppLL) +GO(ssyevd_, vFpppppppppppLL) +GO(ssyevd_2stage_, vFpppppppppppLL) +GO(ssyevr_, vFpppppppppppppppppppppLLL) +GO(ssyevr_2stage_, vFpppppppppppppppppppppLLL) +GO(ssyevx_, vFppppppppppppppppppppLLL) +GO(ssyevx_2stage_, vFppppppppppppppppppppLLL) +//GO(ssygs2_, +GO(ssygst_, vFppppppppL) +GO(ssygv_, vFppppppppppppLL) +GO(ssygv_2stage_, vFppppppppppppLL) +GO(ssygvd_, vFppppppppppppppLL) +GO(ssygvx_, vFpppppppppppppppppppppppLLL) +GO(ssyrfs_, vFpppppppppppppppppL) +GO(ssysv_, vFpppppppppppL) +GO(ssysv_aa_, vFpppppppppppL) +GO(ssysv_aa_2stage_, vFppppppppppppppL) +GO(ssysv_rk_, vFppppppppppppL) +GO(ssysv_rook_, vFpppppppppppL) +GO(ssysvx_, vFppppppppppppppppppppLL) +GO(ssyswapr_, vFppppppL) +//GO(ssytd2_, +//GO(ssytf2_, +//GO(ssytf2_rk_, +//GO(ssytf2_rook_, +GO(ssytrd_, vFppppppppppL) +GO(ssytrd_2stage_, vFpppppppppppppLL) +//GO(ssytrd_sb2st_, +//GO(ssytrd_sy2sb_, +GO(ssytrf_, vFppppppppL) +GO(ssytrf_aa_, vFppppppppL) +GO(ssytrf_aa_2stage_, vFpppppppppppL) +GO(ssytrf_rk_, vFpppppppppL) +GO(ssytrf_rook_, vFppppppppL) +GO(ssytri_, vFpppppppL) +GO(ssytri2_, vFppppppppL) +GO(ssytri2x_, vFppppppppL) +GO(ssytri_3_, vFpppppppppL) +//GO(ssytri_3x_, +//GO(ssytri_rook_, +GO(ssytrs_, vFpppppppppL) +GO(ssytrs2_, vFppppppppppL) +GO(ssytrs_3_, vFppppppppppL) +GO(ssytrs_aa_, vFpppppppppppL) +GO(ssytrs_aa_2stage_, vFppppppppppppL) +GO(ssytrs_rook_, vFpppppppppL) +GO(stbcon_, vFpppppppppppLLL) +GO(stbrfs_, vFpppppppppppppppppLLL) +GO(stbtrs_, vFpppppppppppLLL) +GO(stfsm_, vFpppppppppppLLLLL) +GO(stftri_, vFppppppLLL) +GO(stfttp_, vFppppppLL) +GO(stfttr_, vFpppppppLL) +GO(stgevc_, vFppppppppppppppppLL) +//GO(stgex2_, +GO(stgexc_, vFpppppppppppppppp) +GO(stgsen_, vFppppppppppppppppppppppppp) +GO(stgsja_, vFpppppppppppppppppppppppppLLL) +GO(stgsna_, vFppppppppppppppppppppLL) +//GO(stgsy2_, +GO(stgsyl_, vFppppppppppppppppppppppL) +GO(stpcon_, vFpppppppppLLL) +GO(stplqt_, vFpppppppppppp) +GO(stplqt2_, vFpppppppppp) +GO(stpmlqt_, vFpppppppppppppppppLL) +GO(stpmqrt_, vFpppppppppppppppppLL) +GO(stpqrt_, vFpppppppppppp) +GO(stpqrt2_, vFpppppppppp) +GO(stprfb_, vFppppppppppppppppppLLLL) +GO(stprfs_, vFpppppppppppppppLLL) +GO(stptri_, vFpppppLL) +GO(stptrs_, vFpppppppppLLL) +GO(stpttf_, vFppppppLL) +GO(stpttr_, vFppppppL) +GO(strcon_, vFppppppppppLLL) +GO(strevc_, vFppppppppppppppLL) +GO(strevc3_, vFpppppppppppppppLL) +GO(strexc_, vFppppppppppL) +GO(strrfs_, vFppppppppppppppppLLL) +GO(strsen_, vFppppppppppppppppppLL) +GO(strsna_, vFppppppppppppppppppLL) +GO(strsyl_, vFpppppppppppppLL) +GO(strsyl3_, vFpppppppppppppppppLL) +//GO(strti2_, +GO(strtri_, vFppppppLL) +GO(strtrs_, vFppppppppppLLL) +GO(strttf_, vFpppppppLL) +GO(strttp_, vFppppppL) +//GO(stzrqf_, +GO(stzrzf_, vFpppppppp) +//GO(__xerbla, +//GO(xerbla_array_, +GO(zbbcsd_, vFpppppppppppppppppppppppppppppLLLLL) +GO(zbdsqr_, vFpppppppppppppppL) +GO(zcgesv_, vFpppppppppppppp) +GO(zcposv_, vFppppppppppppppL) +//GO(zdrscl_, +GO(zgbbrd_, vFpppppppppppppppppppL) +GO(zgbcon_, vFppppppppppppL) +GO(zgbequ_, vFpppppppppppp) +GO(zgbequb_, vFpppppppppppp) +GO(zgbrfs_, vFpppppppppppppppppppL) +GO(zgbsv_, vFpppppppppp) +GO(zgbsvx_, vFppppppppppppppppppppppppLLL) +//GO(zgbtf2_, +GO(zgbtrf_, vFpppppppp) +GO(zgbtrs_, vFpppppppppppL) +GO(zgebak_, vFppppppppppLL) +GO(zgebal_, vFppppppppL) +//GO(zgebd2_, +GO(zgebrd_, vFppppppppppp) +GO(zgecon_, vFpppppppppL) +GO(zgedmd_, vFpppppppppppppppppppppppppppppppLLLL) +GO(zgedmdq_, vFpppppppppppppppppppppppppppppppppppLLLLLL) +GO(zgeequ_, vFpppppppppp) +GO(zgeequb_, vFpppppppppp) +//GOM(zgees_, vFEpppppppppppppppLL) +//GOM(zgeesx_, vFEppppppppppppppppppLLL) +GO(zgeev_, vFppppppppppppppLL) +GO(zgeevx_, vFppppppppppppppppppppppLLLL) +//GO(zgegs_, +//GO(zgegv_, +//GO(zgehd2_, +GO(zgehrd_, vFppppppppp) +GO(zgejsv_, vFpppppppppppppppppppppLLLLLL) +GO(zgelq_, vFppppppppp) +GO(zgelq2_, vFppppppp) +GO(zgelqf_, vFpppppppp) +//GO(zgelqs_, +//GO(zgelqt_, +//GO(zgelqt3_, +GO(zgels_, vFpppppppppppL) +GO(zgelsd_, vFppppppppppppppp) +GO(zgelss_, vFpppppppppppppp) +//GO(zgelst_, +//GO(zgelsx_, +GO(zgelsy_, vFpppppppppppppp) +GO(zgemlq_, vFppppppppppppppLL) +//GO(zgemlqt_, +GO(zgemqr_, vFppppppppppppppLL) +GO(zgemqrt_, vFppppppppppppppLL) +GO(zgeql2_, vFppppppp) +GO(zgeqlf_, vFpppppppp) +GO(zgeqp3_, vFpppppppppp) +//GO(zgeqp3rk_, +GO(zgeqpf_, vFppppppppp) +GO(zgeqr_, vFppppppppp) +GO(zgeqr2_, vFppppppp) +//GO(zgeqr2p_, +GO(zgeqrf_, vFpppppppp) +GO(zgeqrfp_, vFpppppppp) +//GO(zgeqrs_, +GO(zgeqrt_, vFppppppppp) +GO(zgeqrt2_, vFppppppp) +GO(zgeqrt3_, vFppppppp) +GO(zgerfs_, vFpppppppppppppppppL) +GO(zgerq2_, vFppppppp) +GO(zgerqf_, vFpppppppp) +//GO(zgesc2_, +GO(zgesdd_, vFpppppppppppppppL) +GO(zgesv_, vFpppppppp) +GO(zgesvd_, vFpppppppppppppppLL) +GO(zgesvdq_, vFppppppppppppppppppppppLLLLL) +GO(zgesvdx_, vFppppppppppppppppppppppLLL) +GO(zgesvj_, vFppppppppppppppppLLL) +GO(zgesvx_, vFppppppppppppppppppppppLLL) +//GO(zgetc2_, +GO(zgetf2_, vFpppppp) +GO(zgetrf_, vFpppppp) +GO(zgetrf2_, vFpppppp) +GO(zgetri_, vFppppppp) +GO(zgetrs_, vFpppppppppL) +GO(zgetsls_, vFpppppppppppL) +GO(zgetsqrhrt_, vFpppppppppppp) +GO(zggbak_, vFpppppppppppLL) +GO(zggbal_, vFppppppppppppL) +//GOM(zgges_, vFEpppppppppppppppppppppLLL) +//GOM(zgges3_, vFEpppppppppppppppppppppLLL) +//GOM(zggesx_, vFEppppppppppppppppppppppppppLLLL) +GO(zggev_, vFpppppppppppppppppLL) +GO(zggev3_, vFpppppppppppppppppLL) +GO(zggevx_, vFpppppppppppppppppppppppppppppLLLL) +GO(zggglm_, vFppppppppppppp) +GO(zgghd3_, vFppppppppppppppppLL) +GO(zgghrd_, vFppppppppppppppLL) +GO(zgglse_, vFppppppppppppp) +GO(zggqrf_, vFpppppppppppp) +GO(zggrqf_, vFpppppppppppp) +GO(zggsvd_, iFppppppppppppppppppppppppLLL) +GO(zggsvd3_, vFpppppppppppppppppppppppppLLL) +GO(zggsvp_, iFpppppppppppppppppppppppppLLL) +GO(zggsvp3_, vFppppppppppppppppppppppppppLLL) +//GO(zgsvj0_, +//GO(zgsvj1_, +GO(zgtcon_, vFpppppppppppL) +GO(zgtrfs_, vFppppppppppppppppppppL) +GO(zgtsv_, vFpppppppp) +GO(zgtsvx_, vFppppppppppppppppppppppLL) +GO(zgttrf_, vFppppppp) +GO(zgttrs_, vFpppppppppppL) +//GO(zgtts2_, +//GO(zhb2st_kernels_, +GO(zhbev_, vFppppppppppppLL) +GO(zhbev_2stage_, vFpppppppppppppLL) +GO(zhbevd_, vFppppppppppppppppLL) +GO(zhbevd_2stage_, vFppppppppppppppppLL) +GO(zhbevx_, vFpppppppppppppppppppppppLLL) +GO(zhbevx_2stage_, vFppppppppppppppppppppppppLLL) +GO(zhbgst_, vFppppppppppppppLL) +GO(zhbgv_, vFpppppppppppppppLL) +GO(zhbgvd_, vFpppppppppppppppppppLL) +GO(zhbgvx_, vFppppppppppppppppppppppppppLLL) +GO(zhbtrd_, vFppppppppppppLL) +GO(zhecon_, vFpppppppppL) +GO(zhecon_3_, vFppppppppppL) +//GO(zhecon_rook_, +GO(zheequb_, vFpppppppppL) +GO(zheev_, vFppppppppppLL) +GO(zheev_2stage_, vFppppppppppLL) +GO(zheevd_, vFpppppppppppppLL) +GO(zheevd_2stage_, vFpppppppppppppLL) +GO(zheevr_, vFpppppppppppppppppppppppLLL) +GO(zheevr_2stage_, vFpppppppppppppppppppppppLLL) +GO(zheevx_, vFpppppppppppppppppppppLLL) +GO(zheevx_2stage_, vFpppppppppppppppppppppLLL) +//GO(zhegs2_, +GO(zhegst_, vFppppppppL) +GO(zhegv_, vFpppppppppppppLL) +GO(zhegv_2stage_, vFpppppppppppppLL) +GO(zhegvd_, vFppppppppppppppppLL) +GO(zhegvx_, vFppppppppppppppppppppppppLLL) +GO(zherfs_, vFpppppppppppppppppL) +GO(zhesv_, vFpppppppppppL) +GO(zhesv_aa_, vFpppppppppppL) +GO(zhesv_aa_2stage_, vFppppppppppppppL) +GO(zhesv_rk_, vFppppppppppppL) +GO(zhesv_rook_, vFpppppppppppL) +GO(zhesvx_, vFppppppppppppppppppppLL) +GO(zheswapr_, vFppppppL) +//GO(zhetd2_, +//GO(zhetf2_, +//GO(zhetf2_rk_, +//GO(zhetf2_rook_, +GO(zhetrd_, vFppppppppppL) +GO(zhetrd_2stage_, vFpppppppppppppLL) +//GO(zhetrd_hb2st_, +//GO(zhetrd_he2hb_, +GO(zhetrf_, vFppppppppL) +GO(zhetrf_aa_, vFppppppppL) +GO(zhetrf_aa_2stage_, vFpppppppppppL) +GO(zhetrf_rk_, vFpppppppppL) +GO(zhetrf_rook_, vFppppppppL) +GO(zhetri_, vFpppppppL) +GO(zhetri2_, vFppppppppL) +GO(zhetri2x_, vFppppppppL) +GO(zhetri_3_, vFpppppppppL) +//GO(zhetri_3x_, +//GO(zhetri_rook_, +GO(zhetrs_, vFpppppppppL) +GO(zhetrs2_, vFppppppppppL) +GO(zhetrs_3_, vFppppppppppL) +GO(zhetrs_aa_, vFpppppppppppL) +GO(zhetrs_aa_2stage_, vFppppppppppppL) +GO(zhetrs_rook_, vFpppppppppL) +GO(zhfrk_, vFppppppppppLLL) +GO(zhgeqz_, vFppppppppppppppppppppLLL) +GO(zhpcon_, vFppppppppL) +GO(zhpev_, vFppppppppppLL) +GO(zhpevd_, vFppppppppppppppLL) +GO(zhpevx_, vFpppppppppppppppppppLLL) +GO(zhpgst_, vFppppppL) +GO(zhpgv_, vFppppppppppppLL) +GO(zhpgvd_, vFppppppppppppppppLL) +GO(zhpgvx_, vFpppppppppppppppppppppLLL) +GO(zhprfs_, vFpppppppppppppppL) +GO(zhpsv_, vFppppppppL) +GO(zhpsvx_, vFpppppppppppppppppLL) +GO(zhptrd_, vFpppppppL) +GO(zhptrf_, vFpppppL) +GO(zhptri_, vFppppppL) +GO(zhptrs_, vFppppppppL) +GO(zhsein_, vFpppppppppppppppppppLLL) +GO(zhseqr_, vFpppppppppppppLL) +//GO(zlabrd_, +GO(zlacgv_, vFppp) +GO(zlacn2_, vFpppppp) +//GO(zlacon_, +GO(zlacp2_, vFpppppppL) +GO(zlacpy_, vFpppppppL) +GO(zlacrm_, vFppppppppp) +//GO(zlacrt_, +//GO(zladiv_, +//GO(zlaed0_, +//GO(zlaed7_, +//GO(zlaed8_, +//GO(zlaein_, +//GO(zlaesy_, +//GO(zlaev2_, +GO(zlag2c_, vFppppppp) +//GO(zlags2_, +//GO(zlagtm_, +//GO(zlahef_, +//GO(zlahef_aa_, +//GO(zlahef_rk_, +//GO(zlahef_rook_, +//GO(zlahqr_, +//GO(zlahr2_, +//GO(zlahrd_, +//GO(zlaic1_, +//GO(zlals0_, +//GO(zlalsa_, +//GO(zlalsd_, +//GO(zlamswlq_, +//GO(zlamtsqr_, +GO(zlangb_, dFpppppppL) +GO(zlange_, dFppppppL) +GO(zlangt_, dFpppppL) +GO(zlanhb_, dFpppppppLL) +GO(zlanhe_, dFppppppLL) +//GO(zlanhf_, +GO(zlanhp_, dFpppppLL) +GO(zlanhs_, dFpppppL) +GO(zlanht_, dFppppL) +GO(zlansb_, dFpppppppLL) +GO(zlansp_, dFpppppLL) +GO(zlansy_, dFppppppLL) +GO(zlantb_, dFppppppppLLL) +GO(zlantp_, dFppppppLLL) +GO(zlantr_, dFppppppppLLL) +//GO(zlapll_, +GO(zlapmr_, vFpppppp) +GO(zlapmt_, vFpppppp) +//GO(zlaqgb_, +//GO(zlaqge_, +//GO(zlaqhb_, +//GO(zlaqhe_, +//GO(zlaqhp_, +//GO(zlaqp2_, +//GO(zlaqp2rk_, +//GO(zlaqp3rk_, +//GO(zlaqps_, +//GO(zlaqr0_, +//GO(zlaqr1_, +//GO(zlaqr2_, +//GO(zlaqr3_, +//GO(zlaqr4_, +//GO(zlaqr5_, +//GO(zlaqsb_, +//GO(zlaqsp_, +//GO(zlaqsy_, +//GO(zlaqz0_, +//GO(zlaqz1_, +//GO(zlaqz2_, +//GO(zlaqz3_, +//GO(zlar1v_, +//GO(zlar2v_, +GO(zlarcm_, vFppppppppp) +GO(zlarf_, vFpppppppppL) +//GO(zlarf1f_, +//GO(zlarf1l_, +GO(zlarfb_, vFpppppppppppppppLLLL) +//GO(zlarfb_gett_, +GO(zlarfg_, vFppppp) +//GO(zlarfgp_, +GO(zlarft_, vFpppppppppLL) +GO(zlarfx_, vFppppppppL) +//GO(zlarfy_, +//GO(zlargv_, +GO(zlarnv_, vFpppp) +//GO(zlarrv_, +//GO(zlartg_, +//GO(zlartv_, +//GO(zlarz_, +//GO(zlarzb_, +//GO(zlarzt_, +GO(zlascl_, vFppppppppppL) +GO(zlaset_, vFpppppppL) +//GO(zlasr_, +GO(zlassq_, vFppppp) +//GO(zlaswlq_, +GO(zlaswp_, vFppppppp) +//GO(zlasyf_, +//GO(zlasyf_aa_, +//GO(zlasyf_rk_, +//GO(zlasyf_rook_, +//GO(zlat2c_, +//GO(zlatbs_, +//GO(zlatdf_, +//GO(zlatps_, +//GO(zlatrd_, +//GO(zlatrs_, +//GO(zlatrs3_, +//GO(zlatrz_, +//GO(zlatsqr_, +//GO(zlatzm_, +//GO(zlaunhr_col_getrfnp_, +//GO(zlaunhr_col_getrfnp2_, +//GO(zlauu2_, +GO(zlauum_, vFpppppL) +GO(zpbcon_, vFppppppppppL) +GO(zpbequ_, vFpppppppppL) +GO(zpbrfs_, vFpppppppppppppppppL) +GO(zpbstf_, vFppppppL) +GO(zpbsv_, vFpppppppppL) +GO(zpbsvx_, vFpppppppppppppppppppppLLL) +//GO(zpbtf2_, +GO(zpbtrf_, vFppppppL) +GO(zpbtrs_, vFpppppppppL) +GO(zpftrf_, vFpppppLL) +GO(zpftri_, vFpppppLL) +GO(zpftrs_, vFppppppppLL) +GO(zpocon_, vFpppppppppL) +GO(zpoequ_, vFppppppp) +GO(zpoequb_, vFppppppp) +GO(zporfs_, vFppppppppppppppppL) +GO(zposv_, vFppppppppL) +GO(zposvx_, vFppppppppppppppppppppLLL) +GO(zpotf2_, vFpppppL) +GO(zpotrf_, vFpppppL) +GO(zpotrf2_, vFpppppL) +GO(zpotri_, vFpppppL) +GO(zpotrs_, vFppppppppL) +GO(zppcon_, vFppppppppL) +GO(zppequ_, vFpppppppL) +GO(zpprfs_, vFppppppppppppppL) +GO(zppsv_, vFpppppppL) +GO(zppsvx_, vFppppppppppppppppppLLL) +GO(zpptrf_, vFppppL) +GO(zpptri_, vFppppL) +GO(zpptrs_, vFpppppppL) +//GO(zpstf2_, +GO(zpstrf_, vFpppppppppL) +GO(zptcon_, vFppppppp) +GO(zpteqr_, vFppppppppL) +GO(zptrfs_, vFppppppppppppppppL) +GO(zptsv_, vFppppppp) +GO(zptsvx_, vFpppppppppppppppppL) +GO(zpttrf_, vFpppp) +GO(zpttrs_, vFppppppppL) +//GO(zptts2_, +//GO(zrot_, +//GO(zrscl_, +GO(zspcon_, vFppppppppL) +//GO(zspmv_, +//GO(zspr_, +GO(zsprfs_, vFpppppppppppppppL) +GO(zspsv_, vFppppppppL) +GO(zspsvx_, vFpppppppppppppppppLL) +GO(zsptrf_, vFpppppL) +GO(zsptri_, vFppppppL) +GO(zsptrs_, vFppppppppL) +GO(zstedc_, vFpppppppppppppL) +GO(zstegr_, vFppppppppppppppppppppLL) +GO(zstein_, vFppppppppppppp) +GO(zstemr_, vFpppppppppppppppppppppLL) +GO(zsteqr_, vFppppppppL) +GO(zsycon_, vFpppppppppL) +GO(zsycon_3_, vFppppppppppL) +//GO(zsycon_rook_, +GO(zsyconv_, vFppppppppLL) +//GO(zsyconvf_, +//GO(zsyconvf_rook_, +GO(zsyequb_, vFpppppppppL) +//GO(zsymv_, +GO(zsyr_, vFpppppppL) +GO(zsyrfs_, vFpppppppppppppppppL) +GO(zsysv_, vFpppppppppppL) +GO(zsysv_aa_, vFpppppppppppL) +GO(zsysv_aa_2stage_, vFppppppppppppppL) +GO(zsysv_rk_, vFppppppppppppL) +GO(zsysv_rook_, vFpppppppppppL) +GO(zsysvx_, vFppppppppppppppppppppLL) +GO(zsyswapr_, vFppppppL) +//GO(zsytf2_, +//GO(zsytf2_rk_, +//GO(zsytf2_rook_, +GO(zsytrf_, vFppppppppL) +GO(zsytrf_aa_, vFppppppppL) +GO(zsytrf_aa_2stage_, vFpppppppppppL) +GO(zsytrf_rk_, vFpppppppppL) +GO(zsytrf_rook_, vFppppppppL) +GO(zsytri_, vFpppppppL) +GO(zsytri2_, vFppppppppL) +GO(zsytri2x_, vFppppppppL) +GO(zsytri_3_, vFpppppppppL) +//GO(zsytri_3x_, +//GO(zsytri_rook_, +GO(zsytrs_, vFpppppppppL) +GO(zsytrs2_, vFppppppppppL) +GO(zsytrs_3_, vFppppppppppL) +GO(zsytrs_aa_, vFpppppppppppL) +GO(zsytrs_aa_2stage_, vFppppppppppppL) +GO(zsytrs_rook_, vFpppppppppL) +GO(ztbcon_, vFpppppppppppLLL) +GO(ztbrfs_, vFpppppppppppppppppLLL) +GO(ztbtrs_, vFpppppppppppLLL) +GO(ztfsm_, vFpppppppppppLLLLL) +GO(ztftri_, vFppppppLLL) +GO(ztfttp_, vFppppppLL) +GO(ztfttr_, vFpppppppLL) +GO(ztgevc_, vFpppppppppppppppppLL) +//GO(ztgex2_, +GO(ztgexc_, vFpppppppppppppp) +GO(ztgsen_, vFpppppppppppppppppppppppp) +GO(ztgsja_, vFpppppppppppppppppppppppppLLL) +GO(ztgsna_, vFppppppppppppppppppppLL) +//GO(ztgsy2_, +GO(ztgsyl_, vFppppppppppppppppppppppL) +GO(ztpcon_, vFpppppppppLLL) +GO(ztplqt_, vFpppppppppppp) +GO(ztplqt2_, vFpppppppppp) +GO(ztpmlqt_, vFpppppppppppppppppLL) +GO(ztpmqrt_, vFpppppppppppppppppLL) +GO(ztpqrt_, vFpppppppppppp) +GO(ztpqrt2_, vFpppppppppp) +GO(ztprfb_, vFppppppppppppppppppLLLL) +GO(ztprfs_, vFpppppppppppppppLLL) +GO(ztptri_, vFpppppLL) +GO(ztptrs_, vFpppppppppLLL) +GO(ztpttf_, vFppppppLL) +GO(ztpttr_, vFppppppL) +GO(ztrcon_, vFppppppppppLLL) +GO(ztrevc_, vFpppppppppppppppLL) +GO(ztrevc3_, vFpppppppppppppppppLL) +GO(ztrexc_, vFpppppppppL) +GO(ztrrfs_, vFppppppppppppppppLLL) +GO(ztrsen_, vFpppppppppppppppLL) +GO(ztrsna_, vFppppppppppppppppppLL) +GO(ztrsyl_, vFpppppppppppppLL) +GO(ztrsyl3_, vFpppppppppppppppLL) +//GO(ztrti2_, +GO(ztrtri_, vFppppppLL) +GO(ztrtrs_, vFppppppppppLLL) +GO(ztrttf_, vFpppppppLL) +GO(ztrttp_, vFppppppL) +//GO(ztzrqf_, +GO(ztzrzf_, vFpppppppp) +GO(zunbdb_, vFppppppppppppppppppppppLL) +//GO(zunbdb1_, +//GO(zunbdb2_, +//GO(zunbdb3_, +//GO(zunbdb4_, +//GO(zunbdb5_, +//GO(zunbdb6_, +GO(zuncsd_, vFppppppppppppppppppppppppppppppppLLLLLL) +GO(zuncsd2by1_, vFpppppppppppppppppppppppLLL) +//GO(zung2l_, +//GO(zung2r_, +GO(zungbr_, vFppppppppppL) +GO(zunghr_, vFppppppppp) +//GO(zungl2_, +GO(zunglq_, vFppppppppp) +GO(zungql_, vFppppppppp) +GO(zungqr_, vFppppppppp) +//GO(zungr2_, +GO(zungrq_, vFppppppppp) +GO(zungtr_, vFppppppppL) +//GO(zungtsqr_, +GO(zungtsqr_row_, vFppppppppppp) +GO(zunhr_col_, vFppppppppp) +//GO(zunm22_, +//GO(zunm2l_, +//GO(zunm2r_, +GO(zunmbr_, vFppppppppppppppLLL) +GO(zunmhr_, vFppppppppppppppLL) +//GO(zunml2_, +GO(zunmlq_, vFpppppppppppppLL) +GO(zunmql_, vFpppppppppppppLL) +GO(zunmqr_, vFpppppppppppppLL) +//GO(zunmr2_, +//GO(zunmr3_, +GO(zunmrq_, vFpppppppppppppLL) +GO(zunmrz_, vFppppppppppppppLL) +GO(zunmtr_, vFpppppppppppppLLL) +GO(zupgtr_, vFppppppppL) +GO(zupmtr_, vFpppppppppppLLL) diff --git a/src/wrapped/wrappedlibm.c b/src/wrapped/wrappedlibm.c index f1941cc..8ab3d8a 100644 --- a/src/wrapped/wrappedlibm.c +++ b/src/wrapped/wrappedlibm.c @@ -16,13 +16,8 @@ #include "debug.h" #include "emu/x64emu_private.h" -const char* libmName = -#ifdef ANDROID - "libm.so" -#else - "libm.so.6" -#endif - ; +const char* libmName = "libm.so.6"; +#define ALTNAME "libm.so" #define LIBNAME libm @@ -32,6 +27,9 @@ typedef float (*fFff_t) (float, float); typedef double (*dFdd_t) (double, double); typedef float (*fFf_t) (float); typedef double (*dFd_t) (double); +#ifdef HAVE_LD80BITS +typedef long double (*DFDD_t) (long double, long double); +#endif #undef GO_cFc @@ -86,6 +84,12 @@ F1D(log) F2F(fmodf) F2D(fmod) +#ifdef HAVE_LD80BITS +FINITE(powl, DFDD_t, long double, (long double a, long double b), a, b) +#else +EXPORT double my___powl_finite(double a, double b) __attribute__((alias("my___pow_finite"))); +#endif + #undef F2D #undef F2F #undef F1D @@ -132,10 +136,43 @@ F2D(fmod) #error Unknown architecture! #endif +static int x86_to_native_excepts(int e) { + int n = 0; + if (e & 0x01) n |= FE_INVALID; + if (e & 0x04) n |= FE_DIVBYZERO; + if (e & 0x08) n |= FE_OVERFLOW; + if (e & 0x10) n |= FE_UNDERFLOW; + if (e & 0x20) n |= FE_INEXACT; + return n; +} + +static int native_to_x86_excepts(int e) { + int x = 0; + if (e & FE_INVALID) x |= 0x01; + if (e & FE_DIVBYZERO) x |= 0x04; + if (e & FE_OVERFLOW) x |= 0x08; + if (e & FE_UNDERFLOW) x |= 0x10; + if (e & FE_INEXACT) x |= 0x20; + return x; +} + +EXPORT int my_feraiseexcept(x64emu_t* emu, int e){ + return feraiseexcept(x86_to_native_excepts(e)); +} + +EXPORT int my_feclearexcept(x64emu_t* emu, int e) { + return feclearexcept(x86_to_native_excepts(e)); +} + +EXPORT int my_fetestexcept(x64emu_t* emu, int e) { + int r = fetestexcept(x86_to_native_excepts(e)); + return native_to_x86_excepts(r); +} + // See https://github.com/bminor/glibc/blob/master/sysdeps/x86_64/fpu/fesetround.c EXPORT int my_fesetround(x64emu_t* emu, int round) { - if (box64_sync_rounding) { + if (BOX64ENV(sync_rounding)) { if ((round & ~0xc00) != 0) // round is not valid. return 1; @@ -155,7 +192,7 @@ EXPORT int my_fesetround(x64emu_t* emu, int round) // See https://github.com/bminor/glibc/blob/master/sysdeps/x86_64/fpu/fegetround.c EXPORT int my_fegetround(x64emu_t* emu) { - if (box64_sync_rounding) { + if (BOX64ENV(sync_rounding)) { return emu->cw.x16 & 0xc00; } else { return fegetround(); @@ -165,7 +202,7 @@ EXPORT int my_fegetround(x64emu_t* emu) #define FROUND(N, T, R) \ EXPORT R my_##N(x64emu_t* emu, T val) \ { \ - if (box64_sync_rounding) { \ + if (BOX64ENV(sync_rounding)) { \ int round = emu->cw.x16 & 0xc00; \ fesetround(TO_NATIVE(round)); \ } \ @@ -185,12 +222,20 @@ FROUND(llrintl, long double, long double) #else EXPORT double my_llrintl(x64emu_t* emu, double val) { - if (box64_sync_rounding) { + if (BOX64ENV(sync_rounding)) { int round = emu->cw.x16 & 0xc00; fesetround(TO_NATIVE(round)); } return llrint(val); } +EXPORT double my_nexttoward(x64emu_t* emu, double val, double to) +{ + return nexttoward(val, to); +} +EXPORT float my_nexttowardf(x64emu_t* emu, float val, double to) +{ + return nexttowardf(val, to); +} #endif #ifdef ANDROID diff --git a/src/wrapped/wrappedlibm_private.h b/src/wrapped/wrappedlibm_private.h index 2849d57..88a360d 100644 --- a/src/wrapped/wrappedlibm_private.h +++ b/src/wrapped/wrappedlibm_private.h @@ -10,67 +10,38 @@ GOW(acosh, dFd) GOW(acoshf, fFf) GOM(__acoshf_finite, fFf) GOM(__acosh_finite, dFd) -#ifdef HAVE_LD80BITS -GOW(acoshl, DFD) -#else -GO2(acoshl, KFK, acosh) -#endif -#ifdef HAVE_LD80BITS -GOW(acosl, DFD) -#else -GO2(acosl, KFK, acos) -#endif +GOWD(acoshl, DFD, acosh) +GOWD(acosl, DFD, acos) GOW(asin, dFd) GOW(asinf, fFf) GOM(__asinf_finite, fFf) GOM(__asin_finite, dFd) GOW(asinh, dFd) GOW(asinhf, fFf) -#ifdef HAVE_LD80BITS -GOW(asinhl, DFD) -#else -GO2(asinhl, KFK, asinh) -#endif -#ifdef HAVE_LD80BITS -GOW(asinl, DFD) -#else -GO2(asinl, KFK, asin) -#endif +GOWD(asinhl, DFD, asinh) +GOWD(asinl, DFD, asin) GO(atan, dFd) GOW(atan2, dFdd) GOW(atan2f, fFff) GOM(__atan2f_finite, fFff) GOM(__atan2_finite, dFdd) -#ifdef HAVE_LD80BITS -GOW(atan2l, lFDD) -#else -GO2(atan2l, lFKK, atan2) -#endif +GOWD(atan2l, lFDD, atan2) GOW(atanf, fFf) GOW(atanh, dFd) GOW(atanhf, fFf) // __atanhf_finite // __atanh_finite -#ifdef HAVE_LD80BITS -GOW(atanhl, DFD) -GOW(atanl, DFD) -#else -GO2(atanhl, KFK, atanh) -GO2(atanl, KFK, atan) -#endif +GOWD(atanhl, DFD, atanh) +GOWD(atanl, DFD, atan) GOW(cabs, XFX) GOW(cabsf, xFx) -#ifdef HAVE_LD80BITS -GOW(cabsl, DFY) -#else -GO2(cabsl, KFy, cabs) -#endif +GOWD(cabsl, DFY, cabs) GOW(cacos, XFX) GOW(cacosf, xFx) GOW(cacosh, XFX) GOW(cacoshf, xFx) -// cacoshl // Weak -// cacosl // Weak +GOWD(cacoshl, YFY, cacosh) +GOWD(cacosl, YFY, cacos) GOW(carg, XFX) GOW(cargf, xFx) // cargl // Weak @@ -78,46 +49,29 @@ GOW(casin, XFX) GOW(casinf, xFx) GOW(casinh, XFX) GOW(casinhf, xFx) -// casinhl // Weak -// casinl // Weak +GOWD(casinhl, YFY, casinh) +GOWD(casinl, YFY, casin) GOW(catan, XFX) GOW(catanf, xFx) GOW(catanh, XFX) GOW(catanhf, xFx) -// catanhl // Weak -// catanl // Weak +GOWD(catanhl, YFY, catanh) +GOWD(catanl, YFY, catan) GOW(cbrt, dFd) GOW(cbrtf, fFf) -#ifdef HAVE_LD80BITS -GOW(cbrtl, DFD) -#else -GO2(cbrtl, KFK, cbrt) -#endif +GOWD(cbrtl, DFD, cbrt) GOW(ccos, XFX) GOW(ccosf, xFx) GOW(ccosh, XFX) GOW(ccoshf, xFx) -#ifdef HAVE_LD80BITS -GOW(ccoshl, YFY) -GOW(ccosl, YFY) -#else -GO2(ccoshl, yFy, ccosh) -GO2(ccosl, yFy, ccos) -#endif +GOWD(ccoshl, YFY, ccosh) +GOWD(ccosl, YFY, ccos) GOW(ceil, dFd) GOW(ceilf, fFf) -#ifdef HAVE_LD80BITS -GOW(ceill, DFD) // Weak -#else -GO2(ceill, KFK, ceil) -#endif +GOWD(ceill, DFD, ceil) GOW(cexp, XFX) GOW(cexpf, xFx) -#ifdef HAVE_LD80BITS -GOW(cexpl, YFY) -#else -GO2(cexpl, yFy, cexp) -#endif +GOWD(cexpl, YFY, cexp) // cimag // Weak // cimagf // Weak // cimagl // Weak @@ -129,11 +83,7 @@ GOW(clog, XFX) // clog10l // Weak // __clog10l GOW(clogf, xFx) -#ifdef HAVE_LD80BITS -GOW(clogl, YFY) -#else -GO2(clogl, yFy, clog) -#endif +GOWD(clogl, YFY, clog) // conj // Weak // conjf // Weak // conjl // Weak @@ -146,20 +96,11 @@ GOW(cosh, dFd) GOW(coshf, fFf) GOM(__coshf_finite, fFf) GOM(__cosh_finite, dFd) -#ifdef HAVE_LD80BITS -GOW(coshl, DFD) -GOW(cosl, DFD) -#else -GO2(coshl, KFK, cosh) -GO2(cosl, KFK, cos) -#endif +GOWD(coshl, DFD, cosh) +GOWD(cosl, DFD, cos) GOW(cpow, XFXX) GOW(cpowf, xFxx) -#ifdef HAVE_LD80BITS -GOW(cpowl, YFYY) -#else -GO2(cpowl, yFyy, cpow) -#endif +GOWD(cpowl, YFYY, cpow) GOW(cproj, XFX) GOW(cprojf, xFx) // cprojl // Weak @@ -170,49 +111,27 @@ GOW(csin, XFX) GOW(csinf, xFx) GOW(csinh, XFX) GOW(csinhf, xFx) -#ifdef HAVE_LD80BITS -GOW(csinhl, YFY) -GOW(csinl, YFY) -#else -GO2(csinhl, yFy, csinh) -GO2(csinl, yFy, csin) -#endif +GOWD(csinhl, YFY, csinh) +GOWD(csinl, YFY, csin) GOW(csqrt, XFX) GOW(csqrtf, xFx) -#ifdef HAVE_LD80BITS -GOW(csqrtl, YFY) -#else -GO2(csqrtl, yFy, csqrt) -#endif +GOWD(csqrtl, YFY, csqrt) GOW(ctan, XFX) GOW(ctanf, xFx) GOW(ctanh, XFX) GOW(ctanhf, xFx) -#ifdef HAVE_LD80BITS -GOW(ctanhl, YFY) -GOW(ctanl, YFY) -#else -GO2(ctanhl, yFy, ctanh) -GO2(ctanl, yFy, ctan) -#endif +GOWD(ctanhl, YFY, ctanh) +GOWD(ctanl, YFY, ctan) // __cxa_finalize // Weak -// drem // Weak -// dremf // Weak -// dreml // Weak +GOW(drem, dFdd) +GOW(dremf, fFff) +// GOW(dreml, GOW(erf, dFd) GOW(erfc, dFd) GOW(erfcf, fFf) -#ifdef HAVE_LD80BITS -GOW(erfcl, DFD) -#else -GO2(erfcl, KFK, erfc) -#endif +GOWD(erfcl, DFD, erfc) GOW(erff, fFf) -#ifdef HAVE_LD80BITS -GOW(erfl, DFD) -#else -GO2(erfl, KFK, erf) -#endif +GOWD(erfl, DFD, erf) GOW(exp, dFd) GOW(exp10, dFd) GOW(exp10f, fFf) @@ -223,33 +142,21 @@ GOW(exp2, dFd) GOW(exp2f, fFf) GOM(__exp2f_finite, fFf) GOM(__exp2_finite, dFd) -#ifdef HAVE_LD80BITS -GOW(exp2l, DFD) -#else -GO2(exp2l, KFK, exp2) -#endif +GOWD(exp2l, DFD, exp2) GOW(expf, fFf) GOM(__expf_finite, fFf) GOM(__exp_finite, dFd) -#ifdef HAVE_LD80BITS -GOW(expl, DFD) -#else -GO2(expl, KFK, exp) -#endif +GOWD(expl, DFD, exp) GOW(expm1, dFd) GOW(expm1f, fFf) -#ifdef HAVE_LD80BITS -GOW(expm1l, DFD) -#else -GO2(expm1l, KFK, expm1) -#endif +GOWD(expm1l, DFD, expm1) GOW(fabs, dFd) GOW(fabsf, fFf) -// fabsl // Weak +GOWD(fabsl, DFD, fabs) GOW(fdim, dFdd) GOW(fdimf, fFff) // fdiml // Weak -GO(feclearexcept, iFi) +GOM(feclearexcept, iFEi) GO(fedisableexcept, iFi) GO(feenableexcept, iFi) GO(fegetenv, iFp) @@ -257,11 +164,11 @@ GO(fegetexcept, iFv) GO(fegetexceptflag, iFpi) GOM(fegetround, iFEv) GO(feholdexcept, iFp) -GO(feraiseexcept, iFi) +GOM(feraiseexcept, iFEi) GO(fesetenv, iFp) GO(fesetexceptflag, iFpi) GOM(fesetround, iFEi) -GO(fetestexcept, iFi) +GOM(fetestexcept, iFEi) GO(feupdateenv, iFp) GOW(finite, iFd) // __finite @@ -271,44 +178,28 @@ GO(__finitef, iFf) // __finitel GOW(floor, dFd) GOW(floorf, fFf) -#ifdef HAVE_LD80BITS -GOW(floorl, DFD) -#else -GO2(floorl, KFK, floor) -#endif +GOWD(floorl, DFD, floor) GOW(fma, dFddd) GOW(fmaf, fFfff) -#ifdef HAVE_LD80BITS -GOW(fmal, DFDDD) -#else -GO2(fmal, KFKKK, fma) -#endif +GOWD(fmal, DFDDD, fma) GOW(fmax, dFdd) GOW(fmaxf, fFff) -// fmaxl // Weak +GOWD(fmaxl, DFDD, fmax) GOW(fmin, dFdd) GOW(fminf, fFff) -// fminl // Weak +GOWD(fminl, DFDD, fmin) GOW(fmod, dFdd) GOW(fmodf, fFff) GOM(__fmodf_finite, fFff) GOM(__fmod_finite, dFdd) -#ifdef HAVE_LD80BITS -GOW(fmodl, DFDD) -#else -GO2(fmodl, KFKK, fmod) -#endif +GOWD(fmodl, DFDD, fmod) GO(__fpclassify, iFd) GO(__fpclassifyf, iFf) GOW(frexp, dFdp) GOW(frexpf, fFfp) -#ifdef HAVE_LD80BITS -GOW(frexpl, DFDp) -#else -GO2(frexpl, KFKp, frexp) -#endif -// gamma // Weak -// gammaf // Weak +GOWD(frexpl, DFDp, frexp) +GOW(gamma, dFd) +GOW(gammaf, fFf) // __gammaf_r_finite // gammal // Weak // __gamma_r_finite @@ -317,11 +208,7 @@ GOW(hypot, dFdd) GOW(hypotf, fFff) GOM(__hypotf_finite, fFff) GOM(__hypot_finite, dFdd) -#ifdef HAVE_LD80BITS -GOW(hypotl, DFDD) -#else -GO2(hypotl, KFKK, hypot) -#endif +GOWD(hypotl, DFDD, hypot) GOW(ilogb, iFd) GOW(ilogbf, iFf) // ilogbl // Weak @@ -343,32 +230,16 @@ GO(jn, dFid) GO(jnf, fFif) // __jnf_finite // __jn_finite -#ifdef HAVE_LD80BITS -GO(jnl, DFiD) -#else -GO2(jnl, KFiK, jn) -#endif +GOD(jnl, DFiD, jn) GOW(ldexp, dFdi) GOW(ldexpf, fFfi) -#ifdef HAVE_LD80BITS -GOW(ldexpl, DFD) -#else -GO2(ldexpl, KFK, ldexp) -#endif +GOWD(ldexpl, DFD, ldexp) GOW(lgamma, dFd) GOW(lgammaf, fFf) GOW(lgammaf_r, fFfp) // __lgammaf_r_finite -#ifdef HAVE_LD80BITS -GOW(lgammal, DFD) -#else -GO2(lgammal, KFK, lgamma) -#endif -#ifdef HAVE_LD80BITS -GOW(lgammal_r, DFDp) -#else -GO2(lgammal_r, KFKp, lgamma_r) -#endif +GOWD(lgammal, DFD, lgamma) +GOWD(lgammal_r, DFDp, lgamma_r) GOW(lgamma_r, dFdp) // __lgamma_r_finite #ifdef STATICBUILD @@ -378,61 +249,37 @@ DATAV(_LIB_VERSION, 8) #endif GOWM(llrint, IFEd) GOWM(llrintf, IFEf) -#ifdef HAVE_LD80BITS GOWM(llrintl, IFED) -#else -GOWM(llrintl, IFEK) -#endif GOW(llround, IFd) GOW(llroundf, IFf) -// llroundl // Weak +GOWD(llroundl, IFD, llround) GOW(log, dFd) GOW(log10, dFd) GOW(log10f, fFf) GOM(__log10f_finite, fFf) GOM(__log10_finite, dFd) -#ifdef HAVE_LD80BITS -GOW(log10l, DFD) -#else -GO2(log10l, KFK, log10) //Weak -#endif +GOWD(log10l, DFD, log10) //Weak GOW(log1p, dFd) GOW(log1pf, fFf) -#ifdef HAVE_LD80BITS -GOW(log1pl, DFD) -#else -GO2(log1pl, KFK, log1p) -#endif +GOWD(log1pl, DFD, log1p) GOW(log2, dFd) GOW(log2f, fFf) GOM(__log2f_finite, fFf) GOM(__log2_finite, dFd) -#ifdef HAVE_LD80BITS -GOW(log2l, DFD) -#else -GO2(log2l, KFK, log2) -#endif +GOWD(log2l, DFD, log2) GOW(logb, dFd) GOW(logbf, fFf) // logbl // Weak GOW(logf, fFf) GOM(__logf_finite, fFf) GOM(__log_finite, dFd) -#ifdef HAVE_LD80BITS -GOW(logl, DFD) -#else -GO2(logl, KFK, log) -#endif +GOWD(logl, DFD, log) GOWM(lrint, iFEd) GOWM(lrintf, iFEf) // lrintl // Weak GOW(lround, iFd) GOW(lroundf, iFf) -#ifdef HAVE_LD80BITS -GOW(lroundl, lFD) -#else -GO2(lroundl, lFK, lround) -#endif +GOWD(lroundl, lFD, lround) // matherr // Weak GOW(modf, dFdp) GOW(modff, fFfp) @@ -445,30 +292,19 @@ GOWM(nearbyintf, fFEf) // nearbyintl // Weak GOW(nextafter, dFdd) GOW(nextafterf, fFff) -#ifdef HAVE_LD80BITS -GOW(nextafterl, DFDD) -#else -GO2(nextafterl, KFKK, nextafter) -#endif -GOW(nexttoward, dFdD) -GOW(nexttowardf, fFfD) +GOWD(nextafterl, DFDD, nextafter) +GOWD(nexttoward, dFdD, my_nexttoward) // This loses precision +GOWD(nexttowardf, fFfD, my_nexttowardf) // This loses precision // nexttowardl // Weak GOW(pow, dFdd) GOWM(pow10, dFd) GOWM(pow10f, fFf) -#ifdef HAVE_LD80BITS GOWM(pow10l, DFD) -#else -GOWM(pow10l, KFK) -#endif GOW(powf, fFff) GOM(__powf_finite, fFff) GOM(__pow_finite, dFdd) -#ifdef HAVE_LD80BITS -GOW(powl, DFDD) -#else -GO2(powl, KFKK, pow) -#endif +GOM(__powl_finite, DFDD) +GOWD(powl, DFDD, pow) GOW(remainder, dFdd) GOW(remainderf, fFff) // __remainderf_finite @@ -479,19 +315,15 @@ GOW(remquof, fFffp) // remquol // Weak GOWM(rint, dFEd) GOWM(rintf, fFEf) -// rintl // Weak +GOWD(rintl, DFD, rint) GOW(round, dFd) GOW(roundf, fFf) GO(roundeven, dFd) //since C23 GO(roundevenf, fFf) //GO(roundevenl, DFD) -#ifdef HAVE_LD80BITS -GOW(roundl, DFD) -#else -GO2(roundl, KFK, round) -#endif -// scalb // Weak -// scalbf // Weak +GOWD(roundl, DFD, round) +GOW(scalb, dFdd) +GOW(scalbf, fFff) // __scalbf_finite // __scalb_finite // scalbl // Weak @@ -504,59 +336,37 @@ GOW(scalbnf, fFfi) // __signbit // __signbitf DATAB(signgam, 8) -// significand // Weak -// significandf // Weak +GOW(significand, dFd) +GOW(significandf, fFf) // significandl // Weak GOW(sin, dFd) GOW(sincos, vFdpp) GOW(sincosf, vFfpp) -#ifdef HAVE_LD80BITS -GOW(sincosl, vFDpp) -#else -GO2(sincosl, vFKpp, sincos) -#endif +GOWD(sincosl, vFDpp, sincos) GOW(sinf, fFf) GOW(sinh, dFd) GOW(sinhf, fFf) GOM(__sinhf_finite, fFf) GOM(__sinh_finite, dFd) -#ifdef HAVE_LD80BITS -GOW(sinhl, DFD) -GOW(sinl, DFD) -#else -GO2(sinhl, KFK, sinh) -GO2(sinl, KFK, sin) -#endif +GOWD(sinhl, DFD, sinh) +GOWD(sinl, DFD, sin) GOW(sqrt, dFd) GOW(sqrtf, fFf) GOM(__sqrtf_finite, fFf) GOM(__sqrt_finite, dFd) -#ifdef HAVE_LD80BITS -GOW(sqrtl, DFD) -#else -GO2(sqrtl, KFK, sqrt) // Weak -#endif +GOWD(sqrtl, DFD, sqrt) GO(tan, dFd) GOW(tanf, fFf) GOW(tanh, dFd) GOW(tanhf, fFf) -#ifdef HAVE_LD80BITS -GOW(tanhl, DFD) -GOW(tanl, DFD) -#else -GO2(tanhl, KFK, tanh) -GO2(tanl, KFK, tan) -#endif +GOWD(tanhl, DFD, tanh) +GOWD(tanl, DFD, tan) GOW(tgamma, dFd) GOW(tgammaf, fFf) -#ifdef HAVE_LD80BITS -GOW(tgammal, DFD) -#else -GO2(tgammal, KFK, tgamma) -#endif +GOWD(tgammal, DFD, tgamma) GOW(trunc, dFd) GOW(truncf, fFf) -// truncl // Weak +GOWD(truncl, DFD, trunc) GO(y0, dFd) GO(y0f, fFf) // __y0f_finite @@ -571,8 +381,4 @@ GO(yn, dFid) GO(ynf, fFif) // __ynf_finite // __yn_finite -#ifdef HAVE_LD80BITS -GO(ynl, DFiD) -#else -GO2(ynl, KFiK, yn) -#endif +GOD(ynl, DFiD, yn) diff --git a/src/wrapped/wrappedlibncurses.c b/src/wrapped/wrappedlibncurses.c index d602cf1..ffca618 100644 --- a/src/wrapped/wrappedlibncurses.c +++ b/src/wrapped/wrappedlibncurses.c @@ -83,6 +83,7 @@ EXPORT int my_mvprintw(x64emu_t* emu, int x, int y, void* fmt, void* b) EXPORT void* my_initscr() { + my_updateGlobalTInfo(); void* ret = my->initscr(); my_checkGlobalTInfo(); return ret; diff --git a/src/wrapped/wrappedlibncurses6.c b/src/wrapped/wrappedlibncurses6.c index 1880a26..055aa99 100644 --- a/src/wrapped/wrappedlibncurses6.c +++ b/src/wrapped/wrappedlibncurses6.c @@ -82,6 +82,7 @@ EXPORT int my6_mvprintw(x64emu_t* emu, int x, int y, void* fmt, void* b) EXPORT void* my6_initscr() { + my_updateGlobalTInfo(); void* ret = my->initscr(); my_checkGlobalTInfo(); return ret; diff --git a/src/wrapped/wrappedlibncurses6_private.h b/src/wrapped/wrappedlibncurses6_private.h index b7153d2..c0b838c 100644 --- a/src/wrapped/wrappedlibncurses6_private.h +++ b/src/wrapped/wrappedlibncurses6_private.h @@ -366,8 +366,6 @@ GO(use_default_colors_sp, iFp) GO(use_legacy_coding, iFi) GO(use_legacy_coding_sp, iFpi) //GO(use_screen, iFp@p) -GO(use_tioctl, vFi) -GO(use_tioctl_sp, vFpi) //GO(use_window, iFp@p) GO(vid_attr, iFuwp) GO(vid_attr_sp, iFpuwp) diff --git a/src/wrapped/wrappedlibncurses_private.h b/src/wrapped/wrappedlibncurses_private.h index ef182ab..1ed67a2 100644 --- a/src/wrapped/wrappedlibncurses_private.h +++ b/src/wrapped/wrappedlibncurses_private.h @@ -366,8 +366,6 @@ GO(use_default_colors_sp, iFp) GO(use_legacy_coding, iFi) GO(use_legacy_coding_sp, iFpi) //GO(use_screen, iFp@p) -GO(use_tioctl, vFi) -GO(use_tioctl_sp, vFpi) //GO(use_window, iFp@p) GO(vid_attr, iFuwp) GO(vid_attr_sp, iFpuwp) diff --git a/src/wrapped/wrappedlibncursesw.c b/src/wrapped/wrappedlibncursesw.c index 26eec25..2dba363 100644 --- a/src/wrapped/wrappedlibncursesw.c +++ b/src/wrapped/wrappedlibncursesw.c @@ -73,6 +73,7 @@ EXPORT int myw_mvprintw(x64emu_t* emu, int x, int y, void* fmt, void* b) EXPORT void* myw_initscr() { + my_updateGlobalTInfo(); void* ret = my->initscr(); my_checkGlobalTInfo(); return ret; diff --git a/src/wrapped/wrappedlibncursesw6.c b/src/wrapped/wrappedlibncursesw6.c index c283743..787b19f 100644 --- a/src/wrapped/wrappedlibncursesw6.c +++ b/src/wrapped/wrappedlibncursesw6.c @@ -73,6 +73,7 @@ EXPORT int myw6_mvprintw(x64emu_t* emu, int x, int y, void* fmt, void* b) EXPORT void* myw6_initscr() { + my_updateGlobalTInfo(); void* ret = my->initscr(); my_checkGlobalTInfo(); return ret; diff --git a/src/wrapped/wrappedlibncursesw6_private.h b/src/wrapped/wrappedlibncursesw6_private.h index ef182ab..1ed67a2 100644 --- a/src/wrapped/wrappedlibncursesw6_private.h +++ b/src/wrapped/wrappedlibncursesw6_private.h @@ -366,8 +366,6 @@ GO(use_default_colors_sp, iFp) GO(use_legacy_coding, iFi) GO(use_legacy_coding_sp, iFpi) //GO(use_screen, iFp@p) -GO(use_tioctl, vFi) -GO(use_tioctl_sp, vFpi) //GO(use_window, iFp@p) GO(vid_attr, iFuwp) GO(vid_attr_sp, iFpuwp) diff --git a/src/wrapped/wrappedlibncursesw_private.h b/src/wrapped/wrappedlibncursesw_private.h index b7153d2..c0b838c 100644 --- a/src/wrapped/wrappedlibncursesw_private.h +++ b/src/wrapped/wrappedlibncursesw_private.h @@ -366,8 +366,6 @@ GO(use_default_colors_sp, iFp) GO(use_legacy_coding, iFi) GO(use_legacy_coding_sp, iFpi) //GO(use_screen, iFp@p) -GO(use_tioctl, vFi) -GO(use_tioctl_sp, vFpi) //GO(use_window, iFp@p) GO(vid_attr, iFuwp) GO(vid_attr_sp, iFpuwp) diff --git a/src/wrapped/wrappedlibnettle8.c b/src/wrapped/wrappedlibnettle8.c index 5803aec..eecbc33 100644 --- a/src/wrapped/wrappedlibnettle8.c +++ b/src/wrapped/wrappedlibnettle8.c @@ -6,12 +6,392 @@ #include "wrappedlibs.h" +#include "debug.h" #include "wrapper.h" #include "bridge.h" #include "librarian/library_private.h" #include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" const char* libnettle8Name = "libnettle.so.8"; +#define ALTNAME "libnettle.so" #define LIBNAME libnettle8 +#define ADDED_FUNCTIONS() + +#include "generated/wrappedlibnettle8types.h" + +#include "wrappercallback.h" + +typedef void(*vFp_t)(void*); +typedef void(*vFpp_t)(void*, void*); +typedef void(*vFpLp_t)(void*, size_t, void*); +typedef void(*vFpLpp_t)(void*, size_t, void*, void*); + +typedef struct my_nettle_hash_s +{ + const char* name; + unsigned context_size; + unsigned digest_size; + unsigned block_size; + vFp_t init; + vFpLp_t update; + vFpLp_t digest; +} my_nettle_hash_t; + +typedef struct my_nettle_cipher_s +{ + const char* name; + unsigned context_size; + unsigned block_size; + unsigned key_size; + vFpp_t set_encrypt_key; + vFpp_t set_decrypt_key; + vFpLpp_t encrypt; + vFpLpp_t decrypt; +} my_nettle_cipher_t; + + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) \ +GO(5) \ +GO(6) \ +GO(7) \ +GO(8) \ +GO(9) \ +GO(10) \ + +// nettle_cipher_func +#define GO(A) \ +static uintptr_t my_nettle_cipher_func_fct_##A = 0; \ +static void my_nettle_cipher_func_##A(void* a, size_t b, void* c, void* d) \ +{ \ + RunFunctionFmt(my_nettle_cipher_func_fct_##A, "pLpp", a, b, c, d); \ +} +SUPER() +#undef GO +static void* findnettle_cipher_funcFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_nettle_cipher_func_fct_##A == (uintptr_t)fct) return my_nettle_cipher_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_nettle_cipher_func_fct_##A == 0) {my_nettle_cipher_func_fct_##A = (uintptr_t)fct; return my_nettle_cipher_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libnettle.so.8 nettle_cipher_func callback\n"); + return NULL; +} + +// nettle_cipher_set +#define GO(A) \ +static uintptr_t my_nettle_cipher_set_fct_##A = 0; \ +static void my_nettle_cipher_set_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_nettle_cipher_set_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* findnettle_cipher_setFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_nettle_cipher_set_fct_##A == (uintptr_t)fct) return my_nettle_cipher_set_##A; + SUPER() + #undef GO + #define GO(A) if(my_nettle_cipher_set_fct_##A == 0) {my_nettle_cipher_set_fct_##A = (uintptr_t)fct; return my_nettle_cipher_set_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libnettle.so.8 nettle_cipher_set callback\n"); + return NULL; +} + +// nettle_hash_update_func +#define GO(A) \ +static uintptr_t my_nettle_hash_update_func_fct_##A = 0; \ +static void my_nettle_hash_update_func_##A(void* a, size_t b, void* c) \ +{ \ + RunFunctionFmt(my_nettle_hash_update_func_fct_##A, "pLp", a, b, c); \ +} +SUPER() +#undef GO +static void* findnettle_hash_update_funcFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_nettle_hash_update_func_fct_##A == (uintptr_t)fct) return my_nettle_hash_update_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_nettle_hash_update_func_fct_##A == 0) {my_nettle_hash_update_func_fct_##A = (uintptr_t)fct; return my_nettle_hash_update_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libnettle.so.8 nettle_hash_update_func callback\n"); + return NULL; +} + +// nettle_hash_digest_func +#define GO(A) \ +static uintptr_t my_nettle_hash_digest_func_fct_##A = 0; \ +static void my_nettle_hash_digest_func_##A(void* a, size_t b, void* c) \ +{ \ + RunFunctionFmt(my_nettle_hash_digest_func_fct_##A, "pLp", a, b, c); \ +} +SUPER() +#undef GO +static void* findnettle_hash_digest_funcFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_nettle_hash_digest_func_fct_##A == (uintptr_t)fct) return my_nettle_hash_digest_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_nettle_hash_digest_func_fct_##A == 0) {my_nettle_hash_digest_func_fct_##A = (uintptr_t)fct; return my_nettle_hash_digest_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libnettle.so.8 nettle_hash_digest_func callback\n"); + return NULL; +} +// nettle_hash_init +#define GO(A) \ +static uintptr_t my_nettle_hash_init_fct_##A = 0; \ +static void my_nettle_hash_init_##A(void* a) \ +{ \ + RunFunctionFmt(my_nettle_hash_init_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findnettle_hash_initFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_nettle_hash_init_fct_##A == (uintptr_t)fct) return my_nettle_hash_init_##A; + SUPER() + #undef GO + #define GO(A) if(my_nettle_hash_init_fct_##A == 0) {my_nettle_hash_init_fct_##A = (uintptr_t)fct; return my_nettle_hash_init_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libnettle.so.8 nettle_hash_init callback\n"); + return NULL; +} + + +#undef SUPER + +my_nettle_hash_t* Wrap_nettle_hash(my_nettle_hash_t* d, my_nettle_hash_t* s) +{ + memcpy(d, s, sizeof(my_nettle_hash_t)); + d->init = findnettle_hash_initFct(s->init); + d->update = findnettle_hash_update_funcFct(s->update); + d->digest = findnettle_hash_digest_funcFct(s->digest); + return d; +} +my_nettle_cipher_t* Wrap_nettle_cipher(my_nettle_cipher_t* d, my_nettle_cipher_t* s) +{ + memcpy(d, s, sizeof(my_nettle_cipher_t)); + d->set_decrypt_key = findnettle_cipher_setFct(s->set_decrypt_key); + d->set_encrypt_key = findnettle_cipher_setFct(s->set_encrypt_key); + d->encrypt = findnettle_cipher_funcFct(s->encrypt); + d->decrypt = findnettle_cipher_funcFct(s->decrypt); + return d; +} + +EXPORT void my_nettle_ccm_encrypt_message(x64emu_t* emu, void* cipher, void* f, size_t nlen, void* nonce, size_t alen, void* adata, size_t tlen, size_t clen, void* dst, void* src) +{ + my->nettle_ccm_encrypt_message(cipher, findnettle_cipher_funcFct(f), nlen, nonce, alen, adata, tlen, clen, dst, src); +} + +EXPORT void my_nettle_cbc_decrypt(x64emu_t* emu, void* ctx, void* f, size_t bsize, void* iv, size_t len, void* dst, void* src) +{ + my->nettle_cbc_decrypt(ctx, findnettle_cipher_funcFct(f), bsize, iv, len, dst, src); +} + +EXPORT void my_nettle_cbc_encrypt(x64emu_t* emu, void* ctx, void* f, size_t bsize, void* iv, size_t len, void* dst, void* src) +{ + my->nettle_cbc_encrypt(ctx, findnettle_cipher_funcFct(f), bsize, iv, len, dst, src); +} + +EXPORT int my_nettle_ccm_decrypt_message(x64emu_t* emu, void* cipher, void* f, size_t nlen, void* nonce, size_t alen, void* adata, size_t tlen, size_t mlen, void* dst, void* src) +{ + return my->nettle_ccm_decrypt_message(cipher, findnettle_cipher_funcFct(f), nlen, nonce, alen, adata, tlen, mlen, dst, src); +} + +EXPORT void my_nettle_cfb_decrypt(x64emu_t* emu, void* cipher, void* f, size_t blen, void* iv, size_t len, void* dst, void* src) +{ + my->nettle_cfb_decrypt(cipher, findnettle_cipher_funcFct(f), blen, iv, len, dst, src); +} + +EXPORT void my_nettle_cfb_encrypt(x64emu_t* emu, void* cipher, void* f, size_t blen, void* iv, size_t len, void* dst, void* src) +{ + my->nettle_cfb_encrypt(cipher, findnettle_cipher_funcFct(f), blen, iv, len, dst, src); +} + +EXPORT void my_nettle_cfb8_decrypt(x64emu_t* emu, void* cipher, void* f, size_t blen, void* iv, size_t len, void* dst, void* src) +{ + my->nettle_cfb8_decrypt(cipher, findnettle_cipher_funcFct(f), blen, iv, len, dst, src); +} + +EXPORT void my_nettle_cfb8_encrypt(x64emu_t* emu, void* cipher, void* f, size_t blen, void* iv, size_t len, void* dst, void* src) +{ + my->nettle_cfb8_encrypt(cipher, findnettle_cipher_funcFct(f), blen, iv, len, dst, src); +} + +EXPORT void my_nettle_cmac128_digest(x64emu_t* emu, void* ctx, void* key, void* cipher, void* f, uint32_t len, void* digest) +{ + my->nettle_cmac128_digest(ctx, key, cipher, findnettle_cipher_funcFct(f), len, digest); +} + +EXPORT void my_nettle_cmac128_set_key(x64emu_t* emu, void* key, void* cipher, void* f) +{ + my->nettle_cmac128_set_key(key, cipher, findnettle_cipher_funcFct(f)); +} + +EXPORT void my_nettle_cmac128_update(x64emu_t* emu, void* ctx, void* cipher, void* f, size_t len, void* msg) +{ + my->nettle_cmac128_update(ctx, cipher, findnettle_cipher_funcFct(f), len, msg); +} + +EXPORT void my_nettle_cmac64_digest(x64emu_t* emu, void* ctx, void* key, void* cipher, void* f, uint32_t len, void* digest) +{ + my->nettle_cmac64_digest(ctx, key, cipher, findnettle_cipher_funcFct(f), len, digest); +} + +EXPORT void my_nettle_cmac64_set_key(x64emu_t* emu, void* key, void* cipher, void* f) +{ + my->nettle_cmac64_set_key(key, cipher, findnettle_cipher_funcFct(f)); +} + +EXPORT void my_nettle_cmac64_update(x64emu_t* emu, void* ctx, void* cipher, void* f, size_t len, void* msg) +{ + my->nettle_cmac64_update(ctx, cipher, findnettle_cipher_funcFct(f), len, msg); +} + +EXPORT void my_nettle_ctr_crypt(x64emu_t* emu, void* ctx, void* f, size_t bsize, void* ctr, size_t len, void* dst, void* src) +{ + my->nettle_ctr_crypt(ctx, findnettle_cipher_funcFct(f), bsize, ctr, len, dst, src); +} + +EXPORT void my_nettle_gcm_decrypt(x64emu_t* emu, void* ctx, void* key, void* cipher, void* f, size_t len, void* dst, void* src) +{ + my->nettle_gcm_decrypt(ctx, key, cipher, findnettle_cipher_funcFct(f), len, dst, src); +} + +EXPORT void my_nettle_gcm_digest(x64emu_t* emu, void* ctx, void* key, void* cipher, void* f, size_t len, void* digest) +{ + my->nettle_gcm_digest(ctx, key, cipher, findnettle_cipher_funcFct(f), len, digest); +} + +EXPORT void my_nettle_gcm_encrypt(x64emu_t* emu, void* ctx, void* key, void* cipher, void* f, size_t len, void* dst, void* src) +{ + my->nettle_gcm_encrypt(ctx, key, cipher, findnettle_cipher_funcFct(f), len, dst, src); +} + +EXPORT void my_nettle_gcm_set_key(x64emu_t* emu, void* key, void* cipher, void* f) +{ + my->nettle_gcm_set_key(key, cipher, findnettle_cipher_funcFct(f)); +} + +EXPORT void my_nettle_hkdf_expand(x64emu_t* emu, void* ctx, void* update, void* digest, size_t dsize, size_t isize, void* info, size_t len, void* dst) +{ + my->nettle_hkdf_expand(ctx, findnettle_hash_update_funcFct(update), findnettle_hash_digest_funcFct(digest), dsize, isize, info, len, dst); +} + +EXPORT void my_nettle_hkdf_extract(x64emu_t* emu, void* ctx, void* update, void* digest, size_t dsize, size_t ssz, void* secret, void* dst) +{ + my->nettle_hkdf_extract(ctx, findnettle_hash_update_funcFct(update), findnettle_hash_digest_funcFct(digest), dsize, ssz, secret, dst); +} + +EXPORT void my_nettle_pbkdf2(x64emu_t* emu, void* ctx, void* update, void* digest, size_t dsize, uint32_t iter, size_t ssalt, void* salt, size_t len, void* dst) +{ + my->nettle_pbkdf2(ctx, findnettle_hash_update_funcFct(update), findnettle_hash_digest_funcFct(digest), dsize, iter, ssalt, salt, len, dst); +} + +EXPORT void my_nettle_hmac_set_key(x64emu_t* emu, void* outer, void* inner, void* state, my_nettle_hash_t* hash, size_t l, void* key) +{ + my_nettle_hash_t save = {0}; + my->nettle_hmac_set_key(outer, inner, state, Wrap_nettle_hash(&save, hash), l, key); +} + +EXPORT void my_nettle_hmac_update(x64emu_t* emu, void* state, my_nettle_hash_t* hash, size_t l, void* key) +{ + my_nettle_hash_t save = {0}; + my->nettle_hmac_update(state, Wrap_nettle_hash(&save, hash), l, key); +} + +EXPORT void my_nettle_hmac_digest(x64emu_t* emu, void* outer, void* inner, void* state, my_nettle_hash_t* hash, size_t l, void* key) +{ + my_nettle_hash_t save = {0}; + my->nettle_hmac_digest(outer, inner, state, Wrap_nettle_hash(&save, hash), l, key); +} + +EXPORT void my_nettle_eax_decrypt(x64emu_t* emu, void* eax, void* key, void* cipher, void* f, unsigned long len, void* dst, void* src) +{ + my->nettle_eax_decrypt(eax, key, cipher, findnettle_cipher_funcFct(f), len, dst, src); +} + +EXPORT void my_nettle_eax_digest(x64emu_t* emu, void* eax, void* key, void* cipher, void* f, unsigned long len, void* digest) +{ + my->nettle_eax_digest(eax, key, cipher, findnettle_cipher_funcFct(f), len, digest); +} + +EXPORT void my_nettle_eax_encrypt(x64emu_t* emu, void* eax, void* key, void* cipher, void* f, unsigned long len, void* dst, void* src) +{ + my->nettle_eax_encrypt(eax, key, cipher, findnettle_cipher_funcFct(f), len, dst, src); +} + + +EXPORT void my_nettle_eax_set_key(x64emu_t* emu, void* key, void* cipher, void* f) +{ + my->nettle_eax_set_key(key, cipher, findnettle_cipher_funcFct(f)); +} + +EXPORT void my_nettle_eax_set_nonce(x64emu_t* emu, void* eax, void* key, void* cipher) +{ + +} + +EXPORT void my_nettle_eax_update(x64emu_t* emu, void* eax, void* key, void* cipher, void* f, unsigned long len, void* data) +{ + my->nettle_eax_update(eax, key, cipher, findnettle_cipher_funcFct(f), len, data); +} + +EXPORT void my_nettle_ocb_decrypt(x64emu_t* emu, void* ctx, void* key, void* encrypt_ctx, void* encrypt_f, void* decrypt_ctx, void* decrypt_f, unsigned long len, void* dst, void* src) +{ + my->nettle_ocb_decrypt(ctx, key, encrypt_ctx, findnettle_cipher_funcFct(encrypt_f), decrypt_ctx, findnettle_cipher_funcFct(decrypt_f), len, dst, src); +} + +EXPORT void my_nettle_ocb_digest(x64emu_t* emu, void* ctx, void* key, void* cipher, void* f, unsigned long len, void* digest) +{ + my->nettle_ocb_digest(ctx, key, cipher, findnettle_cipher_funcFct(f), len, digest); +} + +EXPORT void my_nettle_ocb_encrypt(x64emu_t* emu, void* ctx, void* key, void* cipher, void* f, unsigned long len, void* dst, void* src) +{ + my->nettle_ocb_encrypt(ctx, key, cipher, findnettle_cipher_funcFct(f), len, dst, src); +} + +EXPORT void my_nettle_ocb_set_key(x64emu_t* emu, void* key, void* cipher, void* f) +{ + my->nettle_ocb_set_key(key, cipher, findnettle_cipher_funcFct(f)); +} + +EXPORT void my_nettle_ocb_set_nonce(x64emu_t* emu, void* ctx, void* cipher, void* f, unsigned long len1, unsigned long len2, void* nonce) +{ + my->nettle_ocb_set_nonce(ctx, cipher, findnettle_cipher_funcFct(f), len1, len2, nonce); +} + +EXPORT void my_nettle_ocb_update(x64emu_t* emu, void* ctx, void* key, void* cipher, void* f, unsigned long len, void* data) +{ + my->nettle_ocb_update(ctx, key, cipher, findnettle_cipher_funcFct(f), len, data); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibnettle8_private.h b/src/wrapped/wrappedlibnettle8_private.h index 5f30b48..0948eb4 100644 --- a/src/wrapped/wrappedlibnettle8_private.h +++ b/src/wrapped/wrappedlibnettle8_private.h @@ -1,134 +1,583 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -error Meh... +#error Meh... #endif -GO(nettle_camellia_set_decrypt_key, vFpip) -GO(nettle_sha512_init, vFp) -GO(nettle_sha512_digest, vFpip) -GO(nettle_sha384_init, vFp) -GO(nettle_sha384_digest, vFpip) -GO(nettle_sha224_init, vFp) -GO(nettle_sha224_digest, vFpip) -GO(nettle_sha256_init, vFp) -GO(nettle_sha256_update, vFpip) -GO(nettle_sha256_digest, vFpip) -GO(nettle_aes256_encrypt, vFpipp) -GO(nettle_aes256_decrypt, vFpipp) -GO(nettle_gcm_aes256_update, vFpip) -GO(nettle_gcm_aes256_digest, vFpip) -GO(nettle_gcm_aes256_set_key, vFpp) -GO(nettle_gcm_aes256_set_iv, vFpip) -GO(nettle_aes256_set_encrypt_key, vFpp) -GO(nettle_aes256_set_decrypt_key, vFpp) -GO(nettle_camellia256_crypt, vFpipp) -GO(nettle_gcm_camellia256_update, vFpip) -GO(nettle_gcm_camellia256_digest, vFpip) -GO(nettle_gcm_camellia256_set_key, vFpp) -GO(nettle_gcm_camellia256_set_iv, vFpip) -GO(nettle_camellia256_set_encrypt_key, vFpp) -GO(nettle_camellia256_set_decrypt_key, vFpp) -GO(nettle_sha1_init, vFp) -GO(nettle_sha1_digest, vFpip) +//DATA(_nettle_aeads, +//DATA(nettle_aes128, +GO(nettle_aes128_decrypt, vFpLpp) +//GO(_nettle_aes128_decrypt_c, GO(nettle_aes128_encrypt, vFpipp) -GO(nettle_aes128_decrypt, vFpipp) -GO(nettle_gcm_aes128_update, vFpip) -GO(nettle_gcm_aes128_digest, vFpip) -GO(nettle_gcm_aes128_set_key, vFpp) -GO(nettle_gcm_aes128_set_iv, vFpip) -GO(nettle_aes128_set_encrypt_key, vFpp) +//GO(_nettle_aes128_encrypt_c, +GO(nettle_aes128_invert_key, vFpp) +GO(nettle_aes128_keyunwrap, iFppLpp) +GO(nettle_aes128_keywrap, vFppLpp) GO(nettle_aes128_set_decrypt_key, vFpp) -GO(nettle_camellia128_crypt, vFpipp) -GO(nettle_gcm_camellia128_update, vFpip) -GO(nettle_gcm_camellia128_digest, vFpip) -GO(nettle_gcm_camellia128_set_key, vFpp) -GO(nettle_gcm_camellia128_set_iv, vFpip) -GO(nettle_camellia128_set_encrypt_key, vFpp) -GO(nettle_camellia128_set_decrypt_key, vFpp) +GO(nettle_aes128_set_encrypt_key, vFpp) +//DATA(nettle_aes192, +GO(nettle_aes192_decrypt, vFpLpp) +//GO(_nettle_aes192_decrypt_c, GO(nettle_aes192_encrypt, vFpipp) -GO(nettle_aes192_decrypt, vFpipp) -GO(nettle_gcm_aes192_update, vFpip) -GO(nettle_gcm_aes192_digest, vFpip) -GO(nettle_gcm_aes192_set_key, vFpp) -GO(nettle_gcm_aes192_set_iv, vFpip) -GO(nettle_aes192_set_encrypt_key, vFpp) +//GO(_nettle_aes192_encrypt_c, +GO(nettle_aes192_invert_key, vFpp) +GO(nettle_aes192_keyunwrap, iFppLpp) +GO(nettle_aes192_keywrap, vFppLpp) GO(nettle_aes192_set_decrypt_key, vFpp) -GO(nettle_camellia192_set_encrypt_key, vFpp) -GO(nettle_camellia192_set_decrypt_key, vFpp) +GO(nettle_aes192_set_encrypt_key, vFpp) +//DATA(nettle_aes256, +GO(nettle_aes256_decrypt, vFpLpp) +//GO(_nettle_aes256_decrypt_c, +GO(nettle_aes256_encrypt, vFpipp) +//GO(_nettle_aes256_encrypt_c, +GO(nettle_aes256_invert_key, vFpp) +GO(nettle_aes256_keyunwrap, iFppLpp) +GO(nettle_aes256_keywrap, vFppLpp) +GO(nettle_aes256_set_decrypt_key, vFpp) +GO(nettle_aes256_set_encrypt_key, vFpp) +//GO(_nettle_aes_decrypt, +GO(nettle_aes_decrypt, vFpLpp) +//GO(_nettle_aes_encrypt, +//GO(nettle_aes_encrypt, +//GO(_nettle_aes_invert, +GO(nettle_aes_invert_key, vFpp) +GO(nettle_aes_set_decrypt_key, vFpLp) +//GO(nettle_aes_set_encrypt_key, +//GO(_nettle_aes_set_key, +GO(nettle_arcfour_crypt, vFpLpp) +GO(nettle_arcfour_set_key, vFpLp) +//DATA(nettle_arctwo128, +GO(nettle_arcfour128_set_key, vFpp) +GO(nettle_arctwo_decrypt, vFpLpp) GO(nettle_arctwo_encrypt, vFpipp) -GO(nettle_arctwo_decrypt, vFpipp) +//GO(nettle_arctwo_set_key, +GO(nettle_arctwo_set_key_ekb, vFpLpu) +GO(nettle_arctwo_set_key_gutmann, vFpLp) +//DATA(nettle_arctwo_gutmann128, +//GO(nettle_arctwo128_set_key, +GO(nettle_arctwo128_set_key_gutmann, vFpp) +//DATA(nettle_arctwo40, GO(nettle_arctwo40_set_key, vFpp) -GO(nettle_des_encrypt, vFpipp) -GO(nettle_des_decrypt, vFpipp) -GO(nettle_des3_encrypt, vFpipp) -GO(nettle_des3_decrypt, vFpipp) -GO(nettle_arcfour_crypt, vFpipp) -GO(nettle_arcfour_set_key, vFpip) -GO(nettle_arcfour128_set_key, vFpp) -GO(nettle_salsa20_crypt, vFpipp) -GO(nettle_salsa20_256_set_key, vFpp) -GO(nettle_salsa20r12_crypt, vFpipp) -GO(nettle_chacha_crypt32, vFpipp) -GO(nettle_chacha_set_key, vFpp) +//DATA(nettle_arctwo64, +//GO(nettle_arctwo64_set_key, +//DATA(_nettle_armors, +//GO(nettle_balloon, +GO(nettle_balloon_itch, LFLL) +//GO(nettle_balloon_sha1, +//GO(nettle_balloon_sha256, +//GO(nettle_balloon_sha384, +GO(nettle_balloon_sha512, vFLLLpLppp) +//DATA(nettle_base16, +GO(nettle_base16_decode_final, iFp) +GO(nettle_base16_decode_init, vFp) +GO(nettle_base16_decode_single, iFppc) +GO(nettle_base16_decode_update, iFpppLp) +GO(nettle_base16_encode_single, vFpC) +//GO(nettle_base16_encode_update, +//DATA(nettle_base64, +GO(nettle_base64_decode_final, iFp) +GO(nettle_base64_decode_init, vFp) +GO(nettle_base64_decode_single, iFppc) +GO(nettle_base64_decode_update, iFpppLp) +GO(nettle_base64_encode_final, LFpp) +GO(nettle_base64_encode_group, vFpu) +//GO(nettle_base64_encode_init, +GO(nettle_base64_encode_raw, vFpLp) +GO(nettle_base64_encode_single, LFppC) +GO(nettle_base64_encode_update, LFppLp) +//DATA(nettle_base64url, +GO(nettle_base64url_decode_init, vFp) +GO(nettle_base64url_encode_init, vFp) +GO(nettle_blowfish128_set_key, iFpp) +GO(nettle_blowfish_bcrypt_hash, iFpLpLpip) +GO(nettle_blowfish_bcrypt_verify, iFLpLp) +GO(nettle_blowfish_decrypt, vFpLpp) +//GO(_nettle_blowfish_encround, +//GO(nettle_blowfish_encrypt, +GO(nettle_blowfish_set_key, iFpLp) +//GO(nettle_buffer_clear, +//GO(nettle_buffer_copy, +//GO(nettle_buffer_grow, +//GO(nettle_buffer_init, +//GO(nettle_buffer_init_realloc, +//GO(nettle_buffer_init_size, +//GO(nettle_buffer_reset, +//GO(nettle_buffer_space, +//GO(nettle_buffer_write, +//GO(_nettle_camellia_absorb, +//GO(_nettle_camellia_crypt, +//GO(_nettle_camellia_invert_key, +GO(nettle_camellia_set_decrypt_key, vFpp) +//DATA(nettle_camellia128, +GO(nettle_camellia128_crypt, vFpLpp) +GO(nettle_camellia128_invert_key, vFpp) +GO(nettle_camellia128_set_decrypt_key, vFpp) +GO(nettle_camellia128_set_encrypt_key, vFpp) +//DATA(nettle_camellia192, +GO(nettle_camellia192_set_decrypt_key, vFpp) +GO(nettle_camellia192_set_encrypt_key, vFpp) +//DATA(nettle_camellia256, +GO(nettle_camellia256_crypt, vFpLpp) +GO(nettle_camellia256_invert_key, vFpp) +GO(nettle_camellia256_set_decrypt_key, vFpp) +GO(nettle_camellia256_set_encrypt_key, vFpp) +//DATA(nettle_cast128, +GO(nettle_cast128_decrypt, vFpLpp) +//GO(nettle_cast128_encrypt, +GO(nettle_cast128_set_key, vFpp) +GO(nettle_cast5_set_key, vFpLp) +GO(nettle_cbc_aes128_encrypt, vFppLpp) +GO(nettle_cbc_aes192_encrypt, vFppLpp) +GO(nettle_cbc_aes256_encrypt, vFppLpp) +GOM(nettle_cbc_decrypt, vFEppLpLpp) +GOM(nettle_cbc_encrypt, vFEppLpLpp) +GO(nettle_ccm_aes128_decrypt, vFpLpp) +GO(nettle_ccm_aes128_decrypt_message, iFpLpLpLLpp) +GO(nettle_ccm_aes128_digest, vFpLp) +//GO(nettle_ccm_aes128_encrypt, +GO(nettle_ccm_aes128_encrypt_message, vFpLpLpLLpp) +GO(nettle_ccm_aes128_set_key, vFpp) +GO(nettle_ccm_aes128_set_nonce, vFpLpLLL) +GO(nettle_ccm_aes128_update, vFpLp) +GO(nettle_ccm_aes192_decrypt, vFpLpp) +GO(nettle_ccm_aes192_decrypt_message, iFpLpLpLLpp) +GO(nettle_ccm_aes192_digest, vFpLp) +//GO(nettle_ccm_aes192_encrypt, +GO(nettle_ccm_aes192_encrypt_message, vFpLpLpLLpp) +GO(nettle_ccm_aes192_set_key, vFpp) +GO(nettle_ccm_aes192_set_nonce, vFpLpLLL) +GO(nettle_ccm_aes192_update, vFpLp) +GO(nettle_ccm_aes256_decrypt, vFpLpp) +GO(nettle_ccm_aes256_decrypt_message, iFpLpLpLLpp) +GO(nettle_ccm_aes256_digest, vFpLp) +//GO(nettle_ccm_aes256_encrypt, +GO(nettle_ccm_aes256_encrypt_message, vFpLpLpLLpp) +GO(nettle_ccm_aes256_set_key, vFpp) +GO(nettle_ccm_aes256_set_nonce, vFpLpLLL) +GO(nettle_ccm_aes256_update, vFpLp) +//GO(nettle_ccm_decrypt, +GOM(nettle_ccm_decrypt_message, iFEppLpLpLLpp) +//GO(nettle_ccm_digest, +//GO(nettle_ccm_encrypt, +GOM(nettle_ccm_encrypt_message, vFEppLpLpLLpp) +//GO(nettle_ccm_set_nonce, +//GO(nettle_ccm_update, +GOM(nettle_cfb8_decrypt, vFEppLpLpp) +GOM(nettle_cfb8_encrypt, vFEppLpLpp) +GOM(nettle_cfb_decrypt, vFEppLpLpp) +GOM(nettle_cfb_encrypt, vFEppLpLpp) +//GO(_nettle_chacha_2core, +//GO(_nettle_chacha_2core32, +//GO(_nettle_chacha_4core, +//GO(_nettle_chacha_4core32, +//GO(_nettle_chacha_core, GO(nettle_chacha_crypt, vFpipp) +GO(nettle_chacha_crypt32, vFpLpp) +//DATA(nettle_chacha_poly1305, +GO(nettle_chacha_poly1305_decrypt, vFpLpp) +GO(nettle_chacha_poly1305_digest, vFpLp) GO(nettle_chacha_poly1305_encrypt, vFpipp) -GO(nettle_chacha_poly1305_decrypt, vFpipp) -GO(nettle_chacha_poly1305_update, vFpip) -GO(nettle_chacha_poly1305_digest, vFpip) GO(nettle_chacha_poly1305_set_key, vFpp) -GO(nettle_siv_cmac_aes128_set_key, vFpp) -GO(nettle_siv_cmac_aes256_set_key, vFpp) -GO(nettle_streebog256_digest, vFpip) -GO(nettle_umac128_set_nonce, vFpp) -GO(nettle_hmac_streebog512_update, vFpip) -GO(nettle_umac96_set_nonce, vFpp) -GO(nettle_umac128_digest, vFpip) -GO(nettle_gosthash94cp_update, vFpip) -GO(nettle_gosthash94cp_digest, vFpip) -GO(nettle_sha3_256_update, vFpip) -GO(nettle_sha3_256_digest, vFpip) -GO(nettle_hmac_sha1_set_key, vFpip) -GO(nettle_hmac_sha512_set_key, vFpip) -GO(nettle_cmac_aes128_digest, vFpip) +GO(nettle_chacha_poly1305_set_nonce, vFpp) +GO(nettle_chacha_poly1305_update, vFpLp) +GO(nettle_chacha_set_counter, vFpp) +GO(nettle_chacha_set_counter32, vFpp) +GO(nettle_chacha_set_key, vFpp) +GO(nettle_chacha_set_nonce, vFpp) +GO(nettle_chacha_set_nonce96, vFpp) +//DATA(_nettle_ciphers, +GOM(nettle_cmac128_digest, vFEppppup) +GO(nettle_cmac128_init, vFp) +GOM(nettle_cmac128_set_key, vFEppp) +GOM(nettle_cmac128_update, vFEpppLp) +GOM(nettle_cmac64_digest, vFEppppup) +GO(nettle_cmac64_init, vFp) +GOM(nettle_cmac64_set_key, vFEppp) +GOM(nettle_cmac64_update, vFEpppLp) +//DATA(nettle_cmac_aes128, +GO(nettle_cmac_aes128_digest, vFpLp) +GO(nettle_cmac_aes128_set_key, vFpp) +GO(nettle_cmac_aes128_update, vFpLp) +//DATA(nettle_cmac_aes256, +GO(nettle_cmac_aes256_digest, vFpLp) +GO(nettle_cmac_aes256_set_key, vFpp) +GO(nettle_cmac_aes256_update, vFpLp) +//DATA(nettle_cmac_des3, +GO(nettle_cmac_des3_digest, vFpLp) +GO(nettle_cmac_des3_set_key, vFpp) +GO(nettle_cmac_des3_update, vFpLp) +GO(nettle_cnd_memcpy, vFippL) +GOM(nettle_ctr_crypt, vFEppLpLpp) +//GO(_nettle_ctr_crypt16, +GO(nettle_des_check_parity, iFLp) +GO(nettle_des_decrypt, vFpLpp) +GO(nettle_des_encrypt, vFpipp) +GO(nettle_des_fix_parity, vFLpp) +GO(nettle_des_set_key, iFpp) +GO(nettle_des3_decrypt, vFpLpp) +GO(nettle_des3_encrypt, vFpipp) +GO(nettle_des3_set_key, iFpp) +GO(nettle_drbg_ctr_aes256_init, vFpp) +GO(nettle_drbg_ctr_aes256_random, vFpLp) +//DATA(nettle_eax_aes128, +GO(nettle_eax_aes128_decrypt, vFpLpp) +GO(nettle_eax_aes128_digest, vFpLp) +//GO(nettle_eax_aes128_encrypt, +GO(nettle_eax_aes128_set_key, vFpp) +//GO(nettle_eax_aes128_set_nonce, +GO(nettle_eax_aes128_update, vFpLp) +GOM(nettle_eax_decrypt, vFEppppLpp) +GOM(nettle_eax_digest, vFEppppLp) +GOM(nettle_eax_encrypt, vFEppppLpp) +GOM(nettle_eax_set_key, vFEppp) +GOM(nettle_eax_set_nonce, vFEppppLp) +GOM(nettle_eax_update, vFEppppLp) +//DATA(nettle_gcm_aes128, +GO(nettle_gcm_aes128_decrypt, vFpLpp) +GO(nettle_gcm_aes128_digest, vFpLp) +//GO(nettle_gcm_aes128_encrypt, +GO(nettle_gcm_aes128_set_iv, vFpLp) +GO(nettle_gcm_aes128_set_key, vFpp) +GO(nettle_gcm_aes128_update, vFpip) +//DATA(nettle_gcm_aes192, +GO(nettle_gcm_aes192_decrypt, vFpLpp) +GO(nettle_gcm_aes192_digest, vFpLp) +//GO(nettle_gcm_aes192_encrypt, +GO(nettle_gcm_aes192_set_iv, vFpLp) +GO(nettle_gcm_aes192_set_key, vFpp) +GO(nettle_gcm_aes192_update, vFpip) +//DATA(nettle_gcm_aes256, +GO(nettle_gcm_aes256_decrypt, vFpLpp) +GO(nettle_gcm_aes256_digest, vFpLp) +//GO(nettle_gcm_aes256_encrypt, +GO(nettle_gcm_aes256_set_iv, vFpLp) +GO(nettle_gcm_aes256_set_key, vFpp) +GO(nettle_gcm_aes256_update, vFpip) +GO(nettle_gcm_aes_decrypt, vFpLpp) +GO(nettle_gcm_aes_digest, vFpLp) +//GO(nettle_gcm_aes_encrypt, +//GO(nettle_gcm_aes_set_iv, +//GO(nettle_gcm_aes_set_key, +GO(nettle_gcm_aes_update, vFpLp) +//DATA(nettle_gcm_camellia128, +GO(nettle_gcm_camellia128_decrypt, vFpLpp) +GO(nettle_gcm_camellia128_digest, vFpLp) +//GO(nettle_gcm_camellia128_encrypt, +GO(nettle_gcm_camellia128_set_iv, vFpip) +GO(nettle_gcm_camellia128_set_key, vFpp) +GO(nettle_gcm_camellia128_update, vFpLp) +//DATA(nettle_gcm_camellia256, +GO(nettle_gcm_camellia256_decrypt, vFpLpp) +GO(nettle_gcm_camellia256_digest, vFpLp) +//GO(nettle_gcm_camellia256_encrypt, +GO(nettle_gcm_camellia256_set_iv, vFpip) +GO(nettle_gcm_camellia256_set_key, vFpp) +GO(nettle_gcm_camellia256_update, vFpLp) +GOM(nettle_gcm_decrypt, vFEppppLpp) +GOM(nettle_gcm_digest, vFEppppLp) +GOM(nettle_gcm_encrypt, vFEppppLpp) +GO(nettle_gcm_set_iv, vFppLp) +GOM(nettle_gcm_set_key, vFEppp) +//DATA(nettle_gcm_sm4, +GO(nettle_gcm_sm4_decrypt, vFpLpp) +GO(nettle_gcm_sm4_digest, vFpLp) +//GO(nettle_gcm_sm4_encrypt, +//GO(nettle_gcm_sm4_set_iv, +GO(nettle_gcm_sm4_set_key, vFpp) +GO(nettle_gcm_sm4_update, vFpLp) +GO(nettle_gcm_update, vFppLp) +GO(nettle_get_aeads, pFv) +GO(nettle_get_armors, pFv) +GO(nettle_get_ciphers, pFv) +GO(nettle_get_hashes, pFv) +GO(nettle_get_macs, pFv) +//GO(_nettle_ghash_set_key, +//GO(_nettle_ghash_set_key_c, +//GO(_nettle_ghash_update, +//GO(_nettle_ghash_update_c, +//GO(_nettle_gost28147_encrypt_block, +//DATA(nettle_gosthash94, +GO(nettle_gosthash94cp_digest, vFpLp) +GO(nettle_gosthash94cp_update, vFpLp) +//GO(nettle_gosthash94_digest, +GO(nettle_gosthash94_init, vFp) +//GO(nettle_gosthash94_update, +//DATA(_nettle_hashes, +GOM(nettle_hkdf_expand, vFEpppLLpLp) +GOM(nettle_hkdf_extract, vFEpppLLpp) +GOM(nettle_hmac_digest, vFEppppLp) +GO(nettle_hmac_gosthash94cp_digest, vFpLp) +GO(nettle_hmac_gosthash94cp_set_key, vFpip) +GO(nettle_hmac_gosthash94cp_update, vFpLp) +GO(nettle_hmac_gosthash94_digest, vFpLp) +//GO(nettle_hmac_gosthash94_set_key, +GO(nettle_hmac_gosthash94_update, vFpLp) +//DATA(nettle_hmac_md5, +GO(nettle_hmac_md5_digest, vFpLp) GO(nettle_hmac_md5_set_key, vFpip) -GO(nettle_md5_update, vFpip) -GO(nettle_sha3_384_update, vFpip) -GO(nettle_sha1_update, vFpip) -GO(nettle_hmac_sha384_digest, vFpip) -GO(nettle_hmac_sha224_digest, vFpip) -GO(nettle_hmac_sha1_digest, vFpip) -GO(nettle_sha3_384_digest, vFpip) -GO(nettle_sha3_224_update, vFpip) -GO(nettle_sha3_512_update, vFpip) -GO(nettle_cmac_aes256_digest, vFpip) -GO(nettle_umac96_update, vFpip) +GO(nettle_hmac_md5_update, vFpLp) +//DATA(nettle_hmac_ripemd160, +GO(nettle_hmac_ripemd160_digest, vFpLp) +//GO(nettle_hmac_ripemd160_set_key, +GO(nettle_hmac_ripemd160_update, vFpLp) +GOM(nettle_hmac_set_key, vFEppppLp) +//DATA(nettle_hmac_sha1, +GO(nettle_hmac_sha1_digest, vFpLp) +GO(nettle_hmac_sha1_set_key, vFpip) +GO(nettle_hmac_sha1_update, vFpLp) +//DATA(nettle_hmac_sha224, +GO(nettle_hmac_sha224_digest, vFpLp) +GO(nettle_hmac_sha224_set_key, vFpLp) +//DATA(nettle_hmac_sha256, GO(nettle_hmac_sha256_digest, vFpip) -GO(nettle_hmac_streebog512_digest, vFpip) -GO(nettle_cmac_aes128_update, vFpip) -GO(nettle_sha512_update, vFpip) -GO(nettle_sha3_512_digest, vFpip) -GO(nettle_hmac_gosthash94cp_digest, vFpip) -GO(nettle_md2_digest, vFpip) -GO(nettle_umac128_update, vFpip) -GO(nettle_hmac_md5_digest, vFpip) -GO(nettle_streebog512_digest, vFpip) -GO(nettle_hmac_sha1_update, vFpip) -GO(nettle_cmac_aes256_update, vFpip) GO(nettle_hmac_sha256_set_key, vFpip) GO(nettle_hmac_sha256_update, vFpip) -GO(nettle_md5_digest, vFpip) -GO(nettle_umac96_digest, vFpip) -GO(nettle_hmac_streebog512_set_key, vFpip) -GO(nettle_hmac_streebog256_set_key, vFpip) -GO(nettle_sha3_224_digest, vFpip) +//DATA(nettle_hmac_sha384, +GO(nettle_hmac_sha384_digest, vFpLp) +GO(nettle_hmac_sha384_set_key, vFpLp) +//DATA(nettle_hmac_sha512, GO(nettle_hmac_sha512_digest, vFpip) -GO(nettle_hmac_gosthash94cp_update, vFpip) -GO(nettle_streebog512_update, vFpip) +GO(nettle_hmac_sha512_set_key, vFpip) GO(nettle_hmac_sha512_update, vFpip) -GO(nettle_hmac_md5_update, vFpip) -GO(nettle_hmac_streebog256_digest, vFpip) -GO(nettle_md2_update, vFpip) -GO(nettle_hmac_sha384_set_key, vFpip) -GO(nettle_hmac_gosthash94cp_set_key, vFpip) -GO(nettle_hmac_sha224_set_key, vFpip) -GO(nettle_sha3_384_init, vFp) +//DATA(nettle_hmac_sm3, +GO(nettle_hmac_sm3_digest, vFpLp) +//GO(nettle_hmac_sm3_set_key, +GO(nettle_hmac_sm3_update, vFpLp) +//DATA(nettle_hmac_streebog256, +GO(nettle_hmac_streebog256_digest, vFpLp) +GO(nettle_hmac_streebog256_set_key, vFpLp) +//DATA(nettle_hmac_streebog512, +GO(nettle_hmac_streebog512_digest, vFpip) +GO(nettle_hmac_streebog512_set_key, vFpip) +GO(nettle_hmac_streebog512_update, vFpip) +GOM(nettle_hmac_update, vFEppLp) +GO(nettle_knuth_lfib_get, uFp) +GO(nettle_knuth_lfib_get_array, vFpLp) +GO(nettle_knuth_lfib_init, vFpu) +GO(nettle_knuth_lfib_random, vFpLp) +//GO(nettle_lookup_hash, +//DATA(_nettle_macs, +//DATA(nettle_md2, +GO(nettle_md2_digest, vFpLp) +GO(nettle_md2_init, vFp) +GO(nettle_md2_update, vFpLp) +//DATA(nettle_md4, +GO(nettle_md4_digest, vFpLp) +GO(nettle_md4_init, vFp) +GO(nettle_md4_update, vFpLp) +//DATA(nettle_md5, +//GO(nettle_md5_compress, +GO(nettle_md5_digest, vFpLp) +GO(nettle_MD5Final, vFpp) +GO(nettle_md5_init, vFp) +GO(nettle_MD5Init, vFp) +GO(nettle_md5_update, vFpLp) +GO(nettle_MD5Update, vFppu) +GO(nettle_memeql_sec, iFppL) +GO(nettle_memxor, pFppL) +GO(nettle_memxor3, pFpppL) +//GO(nettle_nist_keyunwrap16, +//GO(nettle_nist_keywrap16, +GO(nettle_ocb_aes128_decrypt, vFpppLpp) +GO(nettle_ocb_aes128_decrypt_message, iFppLpLpLLpp) +GO(nettle_ocb_aes128_digest, vFppLp) +GO(nettle_ocb_aes128_encrypt, vFppLpp) +GO(nettle_ocb_aes128_encrypt_message, vFpLpLpLLpp) +GO(nettle_ocb_aes128_set_decrypt_key, vFppp) +GO(nettle_ocb_aes128_set_encrypt_key, vFpp) +GO(nettle_ocb_aes128_set_nonce, vFppLLp) +GO(nettle_ocb_aes128_update, vFppLp) +GOM(nettle_ocb_decrypt, vFEppppppLpp) +//GO(nettle_ocb_decrypt_message, +GOM(nettle_ocb_digest, vFEppppLp) +GOM(nettle_ocb_encrypt, vFEppppLpp) +//GO(nettle_ocb_encrypt_message, +GOM(nettle_ocb_set_key, vFEppp) +GOM(nettle_ocb_set_nonce, vFEpppLLp) +GOM(nettle_ocb_update, vFEppppLp) +GOM(nettle_pbkdf2, vFEpppLuLpLp) +GO(nettle_pbkdf2_hmac_gosthash94cp, vFLpuLpLp) +//GO(nettle_pbkdf2_hmac_sha1, +//GO(nettle_pbkdf2_hmac_sha256, +//GO(nettle_pbkdf2_hmac_sha384, +//GO(nettle_pbkdf2_hmac_sha512, +GO(nettle_poly1305_aes_digest, vFpLp) +//GO(nettle_poly1305_aes_set_key, +GO(nettle_poly1305_aes_set_nonce, vFpp) +GO(nettle_poly1305_aes_update, vFpLp) +//GO(_nettle_poly1305_block, +//GO(_nettle_poly1305_digest, +//GO(_nettle_poly1305_set_key, +//GO(_nettle_poly1305_update, +//GO(nettle_realloc, +//DATA(nettle_ripemd160, +//GO(_nettle_ripemd160_compress, +GO(nettle_ripemd160_digest, vFpLp) +GO(nettle_ripemd160_init, vFp) +GO(nettle_ripemd160_update, vFpLp) +//GO(nettle_salsa20_128_set_key, +GO(nettle_salsa20_256_set_key, vFpp) +//GO(_nettle_salsa20_core, +//GO(_nettle_salsa20_crypt, +GO(nettle_salsa20_crypt, vFpipp) +GO(nettle_salsa20r12_crypt, vFpLpp) +GO(nettle_salsa20_set_key, vFpLp) +GO(nettle_salsa20_set_nonce, vFpp) +//DATA(nettle_serpent128, +//GO(nettle_serpent128_set_key, +//DATA(nettle_serpent192, +//GO(nettle_serpent192_set_key, +//DATA(nettle_serpent256, +GO(nettle_serpent256_set_key, vFpp) +GO(nettle_serpent_decrypt, vFpLpp) +//GO(nettle_serpent_encrypt, +GO(nettle_serpent_set_key, vFpLp) +//DATA(nettle_sha1, +GO(nettle_sha1_compress, vFpp) +//GO(_nettle_sha1_compress_c, +GO(nettle_sha1_digest, vFpLp) +GO(nettle_sha1_init, vFp) +GO(nettle_sha1_update, vFpLp) +//DATA(nettle_sha224, +GO(nettle_sha224_digest, vFpLp) +GO(nettle_sha224_init, vFp) +//DATA(nettle_sha256, +//GO(nettle_sha256_compress, +//GO(_nettle_sha256_compress_n, +//GO(_nettle_sha256_compress_n_c, +GO(nettle_sha256_digest, vFpip) +GO(nettle_sha256_init, vFp) +GO(nettle_sha256_update, vFpLp) +GO(nettle_sha3_128_init, vFp) +//GO(nettle_sha3_128_shake, +GO(nettle_sha3_128_shake_output, vFpLp) +GO(nettle_sha3_128_update, vFpLp) +//DATA(nettle_sha3_224, +GO(nettle_sha3_224_digest, vFpLp) GO(nettle_sha3_224_init, vFp) +GO(nettle_sha3_224_update, vFpLp) +//DATA(nettle_sha3_256, +GO(nettle_sha3_256_digest, vFpip) +GO(nettle_sha3_256_init, vFp) +//GO(nettle_sha3_256_shake, +GO(nettle_sha3_256_shake_output, vFpLp) +GO(nettle_sha3_256_update, vFpLp) +//DATA(nettle_sha3_384, +GO(nettle_sha3_384_digest, vFpLp) +GO(nettle_sha3_384_init, vFp) +GO(nettle_sha3_384_update, vFpLp) +//DATA(nettle_sha3_512, +GO(nettle_sha3_512_digest, vFpLp) +GO(nettle_sha3_512_init, vFp) +GO(nettle_sha3_512_update, vFpLp) +//DATA(nettle_sha384, +GO(nettle_sha384_digest, vFpip) +GO(nettle_sha384_init, vFp) +//GO(_nettle_sha3_pad, +GO(nettle_sha3_permute, vFp) +//GO(_nettle_sha3_shake, +//GO(_nettle_sha3_shake_output, +//GO(_nettle_sha3_update, +//DATA(nettle_sha512, +//DATA(nettle_sha512_224, +//GO(nettle_sha512_224_digest, +//GO(nettle_sha512_224_init, +//DATA(nettle_sha512_256, +GO(nettle_sha512_256_digest, vFpLp) +GO(nettle_sha512_256_init, vFp) +//GO(_nettle_sha512_compress, +GO(nettle_sha512_compress, vFpp) +GO(nettle_sha512_digest, vFpip) +GO(nettle_sha512_init, vFp) +GO(nettle_sha512_update, vFpLp) +GO(nettle_siv_cmac_aes128_decrypt_message, iFpLpLpLpp) +GO(nettle_siv_cmac_aes128_encrypt_message, vFpLpLpLpp) +GO(nettle_siv_cmac_aes128_set_key, vFpp) +GO(nettle_siv_cmac_aes256_decrypt_message, iFpLpLpLpp) +GO(nettle_siv_cmac_aes256_encrypt_message, vFpLpLpLpp) +GO(nettle_siv_cmac_aes256_set_key, vFpp) +//GOM(nettle_siv_cmac_decrypt_message, +//GOM(nettle_siv_cmac_encrypt_message, +//GOM(nettle_siv_cmac_set_key, +GO(nettle_siv_gcm_aes128_decrypt_message, iFpLpLpLpp) +GO(nettle_siv_gcm_aes128_encrypt_message, vFpLpLpLpp) +GO(nettle_siv_gcm_aes256_decrypt_message, iFpLpLpLpp) +GO(nettle_siv_gcm_aes256_encrypt_message, vFpLpLpLpp) +//GOM(nettle_siv_gcm_decrypt_message, +//GOM(nettle_siv_gcm_encrypt_message, +//GO(_nettle_siv_ghash_set_key, +//GO(_nettle_siv_ghash_update, +//DATA(nettle_sm3, +GO(nettle_sm3_digest, vFpLp) +GO(nettle_sm3_init, vFp) +GO(nettle_sm3_update, vFpLp) +//DATA(nettle_sm4, +GO(nettle_sm4_crypt, vFpLpp) +GO(nettle_sm4_set_decrypt_key, vFpp) +//GO(nettle_sm4_set_encrypt_key, +//DATA(nettle_streebog256, +GO(nettle_streebog256_digest, vFpLp) +GO(nettle_streebog256_init, vFp) +//DATA(nettle_streebog512, +GO(nettle_streebog512_digest, vFpip) +GO(nettle_streebog512_init, vFp) +GO(nettle_streebog512_update, vFpLp) +//DATA(nettle_twofish128, +//GO(nettle_twofish128_set_key, +//DATA(nettle_twofish192, +//GO(nettle_twofish192_set_key, +//DATA(nettle_twofish256, +GO(nettle_twofish256_set_key, vFpp) +GO(nettle_twofish_decrypt, vFpLpp) +GO(nettle_twofish_encrypt, vFpLpp) +GO(nettle_twofish_set_key, vFpLp) +GO(nettle_umac128_digest, vFpLp) +GO(nettle_umac128_set_key, vFpp) +GO(nettle_umac128_set_nonce, vFpp) +GO(nettle_umac128_update, vFpLp) +GO(nettle_umac32_digest, vFpLp) +GO(nettle_umac32_set_key, vFpp) +//GO(nettle_umac32_set_nonce, +GO(nettle_umac32_update, vFpLp) +GO(nettle_umac64_digest, vFpLp) +GO(nettle_umac64_set_key, vFpp) +//GO(nettle_umac64_set_nonce, +GO(nettle_umac64_update, vFpLp) +GO(nettle_umac96_digest, vFpLp) +GO(nettle_umac96_set_key, vFpp) +GO(nettle_umac96_set_nonce, vFpp) +GO(nettle_umac96_update, vFpLp) +//GO(_nettle_umac_l2, +//GO(_nettle_umac_l2_final, +//GO(_nettle_umac_l2_init, +//GO(_nettle_umac_l3, +//GO(_nettle_umac_l3_init, +//GO(_nettle_umac_nh, +//GO(_nettle_umac_nh_n, +//GO(_nettle_umac_poly128, +//GO(_nettle_umac_poly64, +//GO(_nettle_umac_set_key, +GO(nettle_version_major, iFv) +GO(nettle_version_minor, iFv) +//GO(_nettle_write_be32, +//GO(_nettle_write_le32, +//GO(_nettle_write_le64, +GO(nettle_xrealloc, pFppL) +GO(nettle_xts_aes128_decrypt_message, vFppLpp) +GO(nettle_xts_aes128_encrypt_message, vFppLpp) +GO(nettle_xts_aes128_set_decrypt_key, vFpp) +GO(nettle_xts_aes128_set_encrypt_key, vFpp) +GO(nettle_xts_aes256_decrypt_message, vFppLpp) +GO(nettle_xts_aes256_encrypt_message, vFppLpp) +GO(nettle_xts_aes256_set_decrypt_key, vFpp) +GO(nettle_xts_aes256_set_encrypt_key, vFpp) +//GO(nettle_xts_decrypt_message, +//GO(nettle_xts_encrypt_message, +//GO(nettle_yarrow256_fast_reseed, +GO(nettle_yarrow256_init, vFpup) +GO(nettle_yarrow256_is_seeded, iFp) +GO(nettle_yarrow256_needed_sources, uFp) +GO(nettle_yarrow256_random, vFpLp) +GO(nettle_yarrow256_seed, vFpLp) +GO(nettle_yarrow256_slow_reseed, vFp) +GO(nettle_yarrow256_update, iFpuuLp) +GO(nettle_yarrow_key_event_estimate, uFpuu) +GO(nettle_yarrow_key_event_init, vFp) diff --git a/src/wrapped/wrappedlibogg.c b/src/wrapped/wrappedlibogg.c index f922d8a..b41fe78 100644 --- a/src/wrapped/wrappedlibogg.c +++ b/src/wrapped/wrappedlibogg.c @@ -12,6 +12,8 @@ #include "x64emu.h" const char* liboggName = "libogg.so.0"; +#define ALTNAME "libogg.so" + #define LIBNAME libogg #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibpcre216.c b/src/wrapped/wrappedlibpcre216.c new file mode 100644 index 0000000..13eaff3 --- /dev/null +++ b/src/wrapped/wrappedlibpcre216.c @@ -0,0 +1,242 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" + +const char* libpcre216Name = "libpcre2-16.so.0"; +#define LIBNAME libpcre216 + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedlibpcre216types.h" + +#include "wrappercallback.h" + +// utility functions +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// pcre2_jit_callback +#define GO(A) \ +static uintptr_t my_pcre2_jit_callback_fct_##A = 0; \ +static void* my_pcre2_jit_callback_##A(void* a) \ +{ \ + return (void*)RunFunctionFmt(my_pcre2_jit_callback_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* find_pcre2_jit_callback_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_pcre2_jit_callback_fct_##A == (uintptr_t)fct) return my_pcre2_jit_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_pcre2_jit_callback_fct_##A == 0) {my_pcre2_jit_callback_fct_##A = (uintptr_t)fct; return my_pcre2_jit_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcre216 pcre2_jit_callback callback\n"); + return NULL; +} +// callback_enumerate +#define GO(A) \ +static uintptr_t my_callback_enumerate_fct_##A = 0; \ +static int my_callback_enumerate_##A(void* a, void* b) \ +{ \ + return (int)RunFunctionFmt(my_callback_enumerate_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* find_callback_enumerate_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_callback_enumerate_fct_##A == (uintptr_t)fct) return my_callback_enumerate_##A; + SUPER() + #undef GO + #define GO(A) if(my_callback_enumerate_fct_##A == 0) {my_callback_enumerate_fct_##A = (uintptr_t)fct; return my_callback_enumerate_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcre216 callback_enumerate callback\n"); + return NULL; +} +// private_malloc +#define GO(A) \ +static uintptr_t my_private_malloc_fct_##A = 0; \ +static void* my_private_malloc_##A(size_t a, void* b) \ +{ \ + return (void*)RunFunctionFmt(my_private_malloc_fct_##A, "Lp", a, b); \ +} +SUPER() +#undef GO +static void* find_private_malloc_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_private_malloc_fct_##A == (uintptr_t)fct) return my_private_malloc_##A; + SUPER() + #undef GO + #define GO(A) if(my_private_malloc_fct_##A == 0) {my_private_malloc_fct_##A = (uintptr_t)fct; return my_private_malloc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcre216 private_malloc callback\n"); + return NULL; +} +// private_free +#define GO(A) \ +static uintptr_t my_private_free_fct_##A = 0; \ +static void my_private_free_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_private_free_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* find_private_free_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_private_free_fct_##A == (uintptr_t)fct) return my_private_free_##A; + SUPER() + #undef GO + #define GO(A) if(my_private_free_fct_##A == 0) {my_private_free_fct_##A = (uintptr_t)fct; return my_private_free_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcre216 private_free callback\n"); + return NULL; +} +// callout_function +#define GO(A) \ +static uintptr_t my_callout_function_fct_##A = 0; \ +static int my_callout_function_##A(void* a) \ +{ \ + return (int)RunFunctionFmt(my_callout_function_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* find_callout_function_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_callout_function_fct_##A == (uintptr_t)fct) return my_callout_function_##A; + SUPER() + #undef GO + #define GO(A) if(my_callout_function_fct_##A == 0) {my_callout_function_fct_##A = (uintptr_t)fct; return my_callout_function_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcre216 callout_function callback\n"); + return NULL; +} +// guard_function +#define GO(A) \ +static uintptr_t my_guard_function_fct_##A = 0; \ +static int my_guard_function_##A(uint32_t a, void* b) \ +{ \ + return (int)RunFunctionFmt(my_guard_function_fct_##A, "up", a, b); \ +} +SUPER() +#undef GO +static void* find_guard_function_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_guard_function_fct_##A == (uintptr_t)fct) return my_guard_function_##A; + SUPER() + #undef GO + #define GO(A) if(my_guard_function_fct_##A == 0) {my_guard_function_fct_##A = (uintptr_t)fct; return my_guard_function_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcre216 guard_function callback\n"); + return NULL; +} +// substitute +#define GO(A) \ +static uintptr_t my_substitute_fct_##A = 0; \ +static size_t my_substitute_##A(void* a, size_t b, void* c, size_t d, int e, void* f) \ +{ \ + return (size_t)RunFunctionFmt(my_substitute_fct_##A, "pLpLip", a, b, c, d, e, f); \ +} +SUPER() +#undef GO +static void* find_substitute_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_substitute_fct_##A == (uintptr_t)fct) return my_substitute_##A; + SUPER() + #undef GO + #define GO(A) if(my_substitute_fct_##A == 0) {my_substitute_fct_##A = (uintptr_t)fct; return my_substitute_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcre216 substitute callback\n"); + return NULL; +} + +#undef SUPER + +EXPORT void my_pcre2_jit_stack_assign_16(x64emu_t* emu, void* ctx, void* f, void* data) +{ + my->pcre2_jit_stack_assign_16(ctx, find_pcre2_jit_callback_Fct(f), data); +} + +EXPORT int my_pcre2_callout_enumerate_16(x64emu_t* emu, void* code, void* f, void* data) +{ + return my->pcre2_callout_enumerate_16(code, find_callback_enumerate_Fct(f), data); +} + +EXPORT void* my_pcre2_general_context_create_16(x64emu_t* emu, void* mc, void* fr, void* data) +{ + return my->pcre2_general_context_create_16(find_private_malloc_Fct(mc), find_private_free_Fct(fr), data); +} + +EXPORT int my_pcre2_set_callout_16(x64emu_t* emu, void* ctx, void* f, void* data) +{ + return my->pcre2_set_callout_16(ctx, find_callout_function_Fct(f), data); +} + +EXPORT int my_pcre2_set_compile_recursion_guard_16(x64emu_t* emu, void* ctx, void* f, void* data) +{ + return my->pcre2_set_compile_recursion_guard_16(ctx, find_guard_function_Fct(f), data); +} + +EXPORT int my_pcre2_set_recursion_memory_management_16(x64emu_t* emu, void* ctx, void* mc, void* fr, void* data) +{ + return my->pcre2_set_recursion_memory_management_16(ctx, find_private_malloc_Fct(mc), find_private_free_Fct(fr), data); +} + +EXPORT int my_pcre2_set_substitute_callout_16(x64emu_t* emu, void* ctx, void* f, void* data) +{ + return my->pcre2_set_substitute_callout_16(ctx, find_callback_enumerate_Fct(f), data); +} + +EXPORT int my_pcre2_set_substitute_case_callout_16(x64emu_t* emu, void* ctx, void* f, void* data) +{ + return my->pcre2_set_substitute_case_callout_16(ctx, find_substitute_Fct(f), data); +} + +#include "wrappedlib_init.h" + diff --git a/src/wrapped/wrappedlibpcre216_private.h b/src/wrapped/wrappedlibpcre216_private.h new file mode 100644 index 0000000..6adb2c7 --- /dev/null +++ b/src/wrapped/wrappedlibpcre216_private.h @@ -0,0 +1,82 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GOM(pcre2_callout_enumerate_16, iFEppp) +GO(pcre2_code_copy_16, pFp) +GO(pcre2_code_copy_with_tables_16, pFp) +GO(pcre2_code_free_16, vFp) +GO(pcre2_compile_16, pFpLuppp) +GO(pcre2_compile_context_copy_16, pFp) +GO(pcre2_compile_context_create_16, pFp) +GO(pcre2_compile_context_free_16, vFp) +GO(pcre2_config_16, iFup) +GO(pcre2_convert_context_copy_16, pFp) +GO(pcre2_convert_context_create_16, pFp) +GO(pcre2_convert_context_free_16, vFp) +GO(pcre2_converted_pattern_free_16, vFp) +GO(pcre2_dfa_match_16, iFppLLupppL) +GO(pcre2_general_context_copy_16, pFp) +GOM(pcre2_general_context_create_16, pFEppp) +GO(pcre2_general_context_free_16, vFp) +GO(pcre2_get_error_message_16, iFipL) +GO(pcre2_get_mark_16, pFp) +GO(pcre2_get_match_data_heapframes_size_16, LFp) +GO(pcre2_get_match_data_size_16, LFp) +GO(pcre2_get_ovector_count_16, uFp) +GO(pcre2_get_ovector_pointer_16, pFp) +GO(pcre2_get_startchar_16, LFp) +GO(pcre2_jit_compile_16, iFpu) +GO(pcre2_jit_free_unused_memory_16, vFp) +GO(pcre2_jit_match_16, iFppLLupp) +GOM(pcre2_jit_stack_assign_16, vFEppp) +GO(pcre2_jit_stack_create_16, pFLLp) +GO(pcre2_jit_stack_free_16, vFp) +GO(pcre2_maketables_16, pFp) +GO(pcre2_maketables_free_16, vFpp) +GO(pcre2_match_16, iFppLLupp) +GO(pcre2_match_context_copy_16, pFp) +GO(pcre2_match_context_create_16, pFp) +GO(pcre2_match_context_free_16, vFp) +GO(pcre2_match_data_create_16, pFup) +GO(pcre2_match_data_create_from_pattern_16, pFpp) +GO(pcre2_match_data_free_16, vFp) +GO(pcre2_pattern_convert_16, iFpLuppp) +GO(pcre2_pattern_info_16, iFpup) +GO(pcre2_serialize_decode_16, iFpipp) +GO(pcre2_serialize_encode_16, iFpippp) +GO(pcre2_serialize_free_16, vFp) +GO(pcre2_serialize_get_number_of_codes_16, iFp) +GO(pcre2_set_bsr_16, iFpu) +GOM(pcre2_set_callout_16, iFEppp) +GO(pcre2_set_character_tables_16, iFpp) +GO(pcre2_set_compile_extra_options_16, iFpu) +GOM(pcre2_set_compile_recursion_guard_16, iFEppp) +GO(pcre2_set_depth_limit_16, iFpu) +GO(pcre2_set_glob_escape_16, iFpu) +GO(pcre2_set_glob_separator_16, iFpu) +GO(pcre2_set_heap_limit_16, iFpu) +GO(pcre2_set_match_limit_16, iFpu) +GO(pcre2_set_max_pattern_compiled_length_16, iFpL) +GO(pcre2_set_max_pattern_length_16, iFpL) +GO(pcre2_set_max_varlookbehind_16, iFpu) +GO(pcre2_set_newline_16, iFpu) +GO(pcre2_set_offset_limit_16, iFpL) +GO(pcre2_set_optimize_16, iFpu) +GO(pcre2_set_parens_nest_limit_16, iFpu) +GO(pcre2_set_recursion_limit_16, iFpu) +GOM(pcre2_set_recursion_memory_management_16, iFEpppp) +GOM(pcre2_set_substitute_callout_16, iFEppp) +GOM(pcre2_set_substitute_case_callout_16, iFEppp) +GO(pcre2_substitute_16, iFppLLupppLpp) +GO(pcre2_substring_copy_byname_16, iFpppp) +GO(pcre2_substring_copy_bynumber_16, iFpupp) +GO(pcre2_substring_free_16, vFp) +GO(pcre2_substring_get_byname_16, iFpppp) +GO(pcre2_substring_get_bynumber_16, iFpupp) +GO(pcre2_substring_length_byname_16, iFppp) +GO(pcre2_substring_length_bynumber_16, iFpup) +GO(pcre2_substring_list_free_16, vFp) +GO(pcre2_substring_list_get_16, iFppp) +GO(pcre2_substring_nametable_scan_16, iFpppp) +GO(pcre2_substring_number_from_name_16, iFpp) diff --git a/src/wrapped/wrappedlibpthread.c b/src/wrapped/wrappedlibpthread.c index 2d25d66..1effff5 100644 --- a/src/wrapped/wrappedlibpthread.c +++ b/src/wrapped/wrappedlibpthread.c @@ -18,12 +18,9 @@ #include "box64context.h" #include "librarian.h" -const char* libpthreadName = -#ifdef ANDROID - "libc.so"; -#else - "libpthread.so.0"; -#endif +const char* libpthreadName = "libpthread.so.0"; +#define ALTNAME "libc.so" + #define LIBNAME libpthread //EXPORT int my_pthread_attr_setschedparam(x64emu_t* emu, void* attr, void* param) diff --git a/src/wrapped/wrappedlibpthread_private.h b/src/wrapped/wrappedlibpthread_private.h index da7d020..ae95435 100644 --- a/src/wrapped/wrappedlibpthread_private.h +++ b/src/wrapped/wrappedlibpthread_private.h @@ -60,6 +60,7 @@ GOM(pthread_attr_setschedpolicy, iFEpi) GOM(pthread_attr_setscope, iFEpi) GOM(pthread_attr_setstackaddr, iFEpp) #endif +GO2(pthread_attr_setaffinity_np@GLIBC_2.3.3, iFEpp, my_pthread_attr_setaffinity_np_old) GOM(pthread_attr_setstack, iFEppL) GOM(pthread_attr_setstacksize, iFEpL) #ifdef NOALIGN @@ -110,11 +111,18 @@ GOM(pthread_cond_init, iFEpp) GOM(pthread_cond_signal, iFEp) GOM(pthread_cond_timedwait, iFEppp) GOM(pthread_cond_wait, iFEpp) +GO2(pthread_cond_broadcast@GLIBC_2.2.5, iFEp, my_pthread_cond_broadcast_old) +GO2(pthread_cond_destroy@GLIBC_2.2.5, iFEp, my_pthread_cond_destroy_old) +GO2(pthread_cond_init@GLIBC_2.2.5, iFEpp, my_pthread_cond_init_old) +GO2(pthread_cond_signal@GLIBC_2.2.5, iFEp, my_pthread_cond_signal_old) +GO2(pthread_cond_timedwait@GLIBC_2.2.5, iFEppp, my_pthread_cond_timedwait_old) +GO2(pthread_cond_wait@GLIBC_2.2.5, iFEpp, my_pthread_cond_wait_old) GOM(pthread_create, iFEpppp) GOM(pthread_cond_clockwait, iFEppip) GO(pthread_detach, iFL) GO(pthread_equal, iFLL) GO(pthread_exit, vFp) +GO2(pthread_getaffinity_np@GLIBC_2.3.3, iFEpp, my_pthread_getaffinity_np_old) GOM(pthread_getaffinity_np, iFEpLp) #ifdef NOALIGN GO(pthread_getattr_np, iFLp) @@ -125,7 +133,7 @@ GOM(pthread_getattr_np, iFELp) GOM(pthread_getattr_default_np, iFEp) GOM(pthread_setattr_default_np, iFEp) #endif -//GO(pthread_getconcurrency, iFv) +GO(pthread_getconcurrency, iFv) GO(pthread_getcpuclockid, iFLp) GO(pthread_getschedparam, iFLpp) GO(__pthread_getspecific, pFL) @@ -156,7 +164,7 @@ GO(pthread_mutexattr_gettype, iFpp) GO(__pthread_mutexattr_init, iFp) GO(pthread_mutexattr_init, iFp) GO(pthread_mutexattr_setkind_np, iFpi) -//GO(pthread_mutexattr_setprioceiling, +GO(pthread_mutexattr_setprioceiling, iFpi) GO(pthread_mutexattr_setprotocol, iFpi) GO(pthread_mutexattr_setpshared, iFpi) GO(pthread_mutexattr_setrobust, iFpi) @@ -176,7 +184,7 @@ GOM(pthread_mutexattr_gettype, iFEpp) GOM(__pthread_mutexattr_init, iFEp) GOM(pthread_mutexattr_init, iFEp) GOM(pthread_mutexattr_setkind_np, iFEpi) -//GO(pthread_mutexattr_setprioceiling, +GOM(pthread_mutexattr_setprioceiling, iFEpi) GOM(pthread_mutexattr_setprotocol, iFEpi) GOM(pthread_mutexattr_setpshared, iFEpi) GOM(pthread_mutexattr_setrobust, iFEpi) @@ -232,6 +240,7 @@ GO(pthread_rwlock_unlock, iFp) GO(__pthread_rwlock_wrlock, iFp) GO(pthread_rwlock_wrlock, iFp) GO(pthread_self, LFv) +GO2(pthread_setaffinity_np@GLIBC_2.3.3, iFEpp, my_pthread_setaffinity_np_old) GOM(pthread_setaffinity_np, iFEpLp) GO(pthread_setcancelstate, iFip) GO(pthread_setcanceltype, iFip) @@ -262,7 +271,7 @@ GO(sem_clockwait, iFppp) GO(sem_destroy, iFp) GO(sem_getvalue, iFpp) GO(sem_init, iFpiu) -GO(sem_open, pFpOM) +GO(sem_open, pFpONN) GO(sem_post, iFp) GO(sem_timedwait, iFpp) GO(sem_trywait, iFp) diff --git a/src/wrapped/wrappedlibresolv.c b/src/wrapped/wrappedlibresolv.c index f36326d..412d26c 100644 --- a/src/wrapped/wrappedlibresolv.c +++ b/src/wrapped/wrappedlibresolv.c @@ -20,6 +20,104 @@ const char* libresolvName = "libresolv.so.2"; #define LIBNAME libresolv +#include "generated/wrappedlibresolvtypes.h" +#include "wrappercallback.h" + +#define FIND_REAL_DNS_FUNC(name) \ + void* my_func_##name = NULL; \ + if (my->name) \ + my_func_##name = my->name; \ + else if (my->__##name) \ + my_func_##name = my->__##name; \ + else { \ + my_func_##name = NULL; \ + printf_log(LOG_NONE, "Error: " #name " or __" #name " symbol not found in libresolv!\n"); \ + } + +EXPORT int my_res_search(x64emu_t* emu, void* dname, int class, int type, void* answer, int anslen) +{ + FIND_REAL_DNS_FUNC(res_search); + return ((iFpiipi_t)my_func_res_search)(dname, class, type, answer, anslen); +} + +EXPORT int my___res_search(x64emu_t* emu, void* dname, int class, int type, void* answer, int anslen) +{ + FIND_REAL_DNS_FUNC(res_search); + return ((iFpiipi_t)my_func_res_search)(dname, class, type, answer, anslen); +} + +EXPORT int my___dn_expand(x64emu_t* emu, void* msg, void* eomorig, void* comp_dn, void* exp_dn, int length) +{ + FIND_REAL_DNS_FUNC(dn_expand); + return ((iFppppi_t)my_func_dn_expand)(msg, eomorig, comp_dn, exp_dn, length); +} + +EXPORT int my_dn_expand(x64emu_t* emu, void* msg, void* eomorig, void* comp_dn, void* exp_dn, int length) +{ + FIND_REAL_DNS_FUNC(dn_expand); + return ((iFppppi_t)my_func_dn_expand)(msg, eomorig, comp_dn, exp_dn, length); +} + +EXPORT int my___res_nquery(x64emu_t* emu, void* statep, void* dname, int class, int type, void* answer, int anslen) +{ + FIND_REAL_DNS_FUNC(res_nquery); + return ((iFppiipi_t)my_func_res_nquery)(statep, dname, class, type, answer, anslen); +} + +EXPORT int my_res_nquery(x64emu_t* emu, void* statep, void* dname, int class, int type, void* answer, int anslen) +{ + FIND_REAL_DNS_FUNC(res_nquery); + return ((iFppiipi_t)my_func_res_nquery)(statep, dname, class, type, answer, anslen); +} + +EXPORT int my___res_nquerydomain(x64emu_t* emu, void* statep, void* dname, void* domain, int class, int type, void* answer, int anslen) +{ + FIND_REAL_DNS_FUNC(res_nquerydomain); + return ((iFpppiipi_t)my_func_res_nquerydomain)(statep, dname, domain, class, type, answer, anslen); +} + +EXPORT int my_res_nquerydomain(x64emu_t* emu, void* statep, void* dname, void* domain, int class, int type, void* answer, int anslen) +{ + FIND_REAL_DNS_FUNC(res_nquerydomain); + return ((iFpppiipi_t)my_func_res_nquerydomain)(statep, dname, domain, class, type, answer, anslen); +} + +EXPORT int my___res_query(x64emu_t* emu, void* dname, int class, int type, void* answer, int anslen) +{ + FIND_REAL_DNS_FUNC(res_query); + return ((iFpiipi_t)my_func_res_query)(dname, class, type, answer, anslen); +} + +EXPORT int my_res_query(x64emu_t* emu, void* dname, int class, int type, void* answer, int anslen) +{ + FIND_REAL_DNS_FUNC(res_query); + return ((iFpiipi_t)my_func_res_query)(dname, class, type, answer, anslen); +} + +EXPORT int my___res_querydomain(x64emu_t* emu, void* name, void* domain, int class, int type, void* answer, int anslen) +{ + FIND_REAL_DNS_FUNC(res_querydomain); + return ((iFppiipi_t)my_func_res_querydomain)(name, domain, class, type, answer, anslen); +} + +EXPORT int my_res_querydomain(x64emu_t* emu, void* name, void* domain, int class, int type, void* answer, int anslen) +{ + FIND_REAL_DNS_FUNC(res_querydomain); + return ((iFppiipi_t)my_func_res_querydomain)(name, domain, class, type, answer, anslen); +} + +EXPORT int my___res_mkquery(x64emu_t* emu, int op, void* dname, int class, int type, void* data, int datalen, void* newrr, void* buf, int buflen) +{ + FIND_REAL_DNS_FUNC(res_mkquery); + return ((iFipiipippi_t)my_func_res_mkquery)(op, dname, class, type, data, datalen, newrr, buf, buflen); +} + +EXPORT int my_res_mkquery(x64emu_t* emu, int op, void* dname, int class, int type, void* data, int datalen, void* newrr, void* buf, int buflen) +{ + FIND_REAL_DNS_FUNC(res_mkquery); + return ((iFipiipippi_t)my_func_res_mkquery)(op, dname, class, type, data, datalen, newrr, buf, buflen); +} + #ifdef STATICBUILD #include #include @@ -39,7 +137,7 @@ extern int __res_dnok(void* a) {return res_dnok(a);} extern int __res_hnok(void* a) {return res_hnok(a);} extern int __res_mailok(void* a) {return res_mailok(a);} extern int __res_mkquery(int a, void* b, int c, int d, void* e, int f, void* g, void* h, int i) {return res_mkquery(a, b, c, d, e, f, g, h, i);} -extern int __res_nquery(int a, void* b, int c, int d, void* e, int f) {return res_nquery(a, b, c, d, e, f);} +extern int __res_nquery(void* a, void* b, int c, int d, void* e, int f) {return res_nquery(a, b, c, d, e, f);} extern int __res_nsearch(void* a, void* b, int c, int d, void* e, int f) {return res_nsearch(a, b, c, d, e, f);} extern int __res_ownok(void* a) {return res_ownok(a);} extern int __res_query(void* a, int b, int c, void* d, int e) {return res_query(a, b, c, d, e);} diff --git a/src/wrapped/wrappedlibresolv_private.h b/src/wrapped/wrappedlibresolv_private.h index 28279f3..6cf599f 100644 --- a/src/wrapped/wrappedlibresolv_private.h +++ b/src/wrapped/wrappedlibresolv_private.h @@ -1,23 +1,23 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(__b64_ntop, iFpLpL) GO(__b64_pton, iFppL) GO(__dn_comp, iFppipp) GO(__dn_count_labels, iFp) -GO(__dn_expand, iFppppi) -GOW(dn_expand, iFppppi) +GOM(__dn_expand, iFEppppi) +GOM(dn_expand, iFEppppi) GO(__dn_skipname, iFpp) -GO(__fp_nquery, vFpip) -GO(__fp_query, vFpp) -//GO(__fp_resstat -//GO(_gethtbyaddr -//GO(_gethtbyname -//GO(_gethtbyname2 -//GO(_gethtent -//GO(_getlong -//GO(_getshort +GO(__fp_nquery, vFpiS) +GO(__fp_query, vFpS) +GO(__fp_resstat, vFpS) +//GO(_gethtbyaddr, +//GO(_gethtbyname, +//GO(_gethtbyname2, +//GO(_gethtent, +//GO(_getlong, +//GO(_getshort, GO(__hostalias, pFp) GO(inet_neta, pFupL) GO(inet_net_ntop, pFipipL) @@ -25,83 +25,95 @@ GO(inet_net_pton, iFippL) GO(__loc_aton, iFpp) GO(__loc_ntoa, pFpp) GO(ns_datetosecs, uFpp) -//GO(ns_format_ttl +GO(ns_format_ttl, iFLpL) GO(__ns_get16, uFp) GOW(ns_get16, uFp) GO(__ns_get32, LFp) GOW(ns_get32, LFp) GO(ns_initparse, iFpip) -//GO(ns_makecanon -//GO(ns_msg_getflag +GO(ns_makecanon, iFppL) +//GO(ns_msg_getflag, GO(ns_name_compress, iFppLpp) GO(ns_name_ntol, iFppL) GO(__ns_name_ntop, iFppL) -GOW(ns_name_ntop,iFppL) +GOW(ns_name_ntop, iFppL) GO(ns_name_pack, iFppipp) GO(ns_name_pton, iFppL) -GO(ns_name_rollback, iFpp) +GO(ns_name_rollback, vFppp) GO(ns_name_skip, iFpp) GO(ns_name_uncompress, iFppppL) GO(__ns_name_unpack, iFppppL) GOW(ns_name_unpack, iFppppL) -GO(ns_parserr, iFpiip) -//GO(ns_parse_ttl +GO(ns_parserr, iFpuip) +GO(ns_parse_ttl, iFpp) GO(ns_put16, vFup) GO(ns_put32, vFLp) -//GO(ns_samedomain -//GO(ns_samename -GO(ns_skiprr, iFppii) -//GO(ns_sprintrr -//GO(ns_sprintrrf -//GO(ns_subdomain -GO(__p_cdname, pFppp) -GO(__p_cdnname, pFppip) +GO(ns_samedomain, iFpp) +GO(ns_samename, iFpp) +GO(ns_skiprr, iFppui) +GO(ns_sprintrr, iFpppppL) +GO(ns_sprintrrf, iFpLpuuLpLpppL) +GO(ns_subdomain, iFpp) +GO(__p_cdname, pFppS) +GO(__p_cdnname, pFppiS) GO(__p_class, pFi) //DATA(__p_class_syms, 4) -GO(__p_fqname, pFppp) +GO(__p_fqname, pFppS) GO(__p_fqnname, pFppipi) GO(__p_option, pFL) GO(__p_query, vFp) GO(__p_rcode, pFi) -//GO(__p_secstodate -GO(__p_time, pFL) +//GO(__p_secstodate, +GO(__p_time, pFu) GO(__p_type, pFi) //DATA(__p_type_syms, 4) -GO(__putlong, vFLp) +GO(__putlong, vFup) GO(__putshort, vFWp) GO(__res_close, vFv) -//GO(__res_context_hostalias -//GO(__res_context_query -//GO(__res_context_search +//GO(__res_context_hostalias, +//GO(__res_context_query, +//GO(__res_context_search, GO(__res_dnok, iFp) -//GO(res_gethostbyaddr -//GO(res_gethostbyname -//GO(res_gethostbyname2 +//GO(res_gethostbyaddr, +//GO(res_gethostbyname, +//GO(res_gethostbyname2, GO(__res_hnok, iFp) -//GO(__res_hostalias +GO(__res_hostalias, pFpppL) GO(__res_isourserver, iFp) GO(__res_mailok, iFp) -GO(__res_mkquery, iFipiipippi) -GOW(res_mkquery, iFipiipippi) +GOM(__res_mkquery, iFEipiipippi) +GOM(res_mkquery, iFEipiipippi) GO(__res_nameinquery, iFpiipp) -//GO(__res_nmkquery -GO(__res_nquery, iFipiipi) -//GO(__res_nquerydomain +#ifdef STATICBUILD +//GO(__res_nmkquery, +#else +GO(__res_nmkquery, iFpipiipippi) +#endif +GO(res_nmkquery, iFpipiipippi) +GOM(__res_nquery, iFEppiipi) +GOM(res_nquery, iFEppiipi) +GOM(__res_nquerydomain, iFEpppiipi) +GOM(res_nquerydomain, iFEpppiipi) GO(__res_nsearch, iFppiipi) -//GO(__res_nsend +#ifdef STATICBUILD +//GO(__res_nsend, +#else +GO(__res_nsend, iFppipi) +#endif +GO(res_nsend, iFppipi) //DATA(_res_opcodes, 4) GO(__res_ownok, iFp) GO(__res_queriesmatch, iFpppp) -GO2(__res_query, iFpiipi, res_query) -GOW(res_query, iFpiipi) -GO2(__res_querydomain, iFppiipi, res_querydomain) -GOW(res_querydomain, iFppiipi) -GO2(__res_search, iFpiipi, res_search) -GOW(res_search, iFpiipi) +GOM(__res_query, iFEpiipi) +GOM(res_query, iFEpiipi) +GOM(__res_querydomain, iFEppiipi) +GOM(res_querydomain, iFEppiipi) +GOM(res_search, iFEpiipi) +GOM(__res_search, iFEpiipi) GO(__res_send, iFpipi) -//GO(res_send_setqhook -//GO(res_send_setrhook -//GO(_sethtent +//GO(res_send_setqhook, +//GO(res_send_setrhook, +//GO(_sethtent, GO(__sym_ntop, pFpip) GO(__sym_ntos, pFpip) GO(__sym_ston, iFppp) diff --git a/src/wrapped/wrappedlibrt.c b/src/wrapped/wrappedlibrt.c index 36ea882..438b331 100644 --- a/src/wrapped/wrappedlibrt.c +++ b/src/wrapped/wrappedlibrt.c @@ -159,7 +159,12 @@ EXPORT int my_lio_listio(x64emu_t* emu, int mode, void* list[], int nent, struct #include #include -extern int __mq_open_2(void*, int); +extern int __mq_open_2(const char*, int); #endif +#define PRE_INIT\ + if(1) \ + lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \ + else + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibrt_private.h b/src/wrapped/wrappedlibrt_private.h index 0f90829..574453f 100644 --- a/src/wrapped/wrappedlibrt_private.h +++ b/src/wrapped/wrappedlibrt_private.h @@ -32,7 +32,7 @@ GOM(lio_listio, iFEipip) GO(mq_close, iFi) GO(mq_getattr, iFip) GO(mq_notify, iFip) -GO(mq_open, iFpOM) +GO(mq_open, iFpONN) GO(__mq_open_2, iFpO) GO(mq_receive, lFipLp) GO(mq_send, iFipLu) diff --git a/src/wrapped/wrappedlibsndfile.c b/src/wrapped/wrappedlibsndfile.c index eaa5423..6e265b6 100644 --- a/src/wrapped/wrappedlibsndfile.c +++ b/src/wrapped/wrappedlibsndfile.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libsndfileName = "libsndfile.so"; -#else - const char* libsndfileName = "libsndfile.so.1"; -#endif +const char* libsndfileName = "libsndfile.so.1"; +#define ALTNAME "libsndfile.so" #define LIBNAME libsndfile diff --git a/src/wrapped/wrappedlibsqlite3.c b/src/wrapped/wrappedlibsqlite3.c index 8cf7f4d..f870a02 100644 --- a/src/wrapped/wrappedlibsqlite3.c +++ b/src/wrapped/wrappedlibsqlite3.c @@ -25,8 +25,194 @@ const char* libsqlite3Name = "libsqlite3.so.0"; #include "generated/wrappedlibsqlite3types.h" -//#include "wrappercallback.h" +#include "wrappercallback.h" + +typedef struct my_sqlite3_io_methods_s { + int iVersion; + int (*xClose)(void*); + int (*xRead)(void*, void*, int iAmt, int64_t iOfst); + int (*xWrite)(void*, const void*, int iAmt, int64_t iOfst); + int (*xTruncate)(void*, int64_t size); + int (*xSync)(void*, int flags); + int (*xFileSize)(void*, int64_t *pSize); + int (*xLock)(void*, int); + int (*xUnlock)(void*, int); + int (*xCheckReservedLock)(void*, int *pResOut); + int (*xFileControl)(void*, int op, void *pArg); + int (*xSectorSize)(void*); + int (*xDeviceCharacteristics)(void*); + int (*xShmMap)(void*, int iPg, int pgsz, int, void volatile**); + int (*xShmLock)(void*, int offset, int n, int flags); + void (*xShmBarrier)(void*); + int (*xShmUnmap)(void*, int deleteFlag); + int (*xFetch)(void*, int64_t iOfst, int iAmt, void **pp); + int (*xUnfetch)(void*, int64_t iOfst, void *p); +} my_sqlite3_io_methods_t; + +typedef struct my_sqlite3_file_s { + const my_sqlite3_io_methods_t *pMethods; +} my_sqlite3_file_t; + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// sqlite3_exec ... +#define GO(A) \ +static uintptr_t my_sqlite3_exec_fct_##A = 0; \ +static int my_sqlite3_exec_##A(void* a, int b, char** c, char** d) { \ + return RunFunctionFmt(my_sqlite3_exec_fct_##A, "pipp", a, b, c, d); \ +} +SUPER() +#undef GO +static void *find_sqlite3_exec_fct(void *fct) { + if (!fct) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if (my_sqlite3_exec_fct_##A == (uintptr_t)fct) return my_sqlite3_exec_##A; + SUPER() + #undef GO + #define GO(A) if (my_sqlite3_exec_fct_##A == 0) {my_sqlite3_exec_fct_##A = (uintptr_t)fct; return my_sqlite3_exec_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for sqlite3_exec callback\n"); + return NULL; +} +EXPORT int my_sqlite3_exec(x64emu_t* emu, void *db, char *sql, void* callback, void* data, char **errmsg) +{ + return my->sqlite3_exec(db, sql, find_sqlite3_exec_fct(callback), data, errmsg); +} + +// sqlite3_destroy ... +#define GO(A) \ +static uintptr_t my_sqlite3_destroy_fct_##A = 0; \ +static void my_sqlite3_destroy_##A(void* p) { \ + RunFunctionFmt(my_sqlite3_destroy_fct_##A, "p", p); \ +} +SUPER() +#undef GO +static void *find_sqlite3_destroy_fct(void *fct) { + if (!fct) return NULL; + if(fct == (void*)-1) return fct; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if (my_sqlite3_destroy_fct_##A == (uintptr_t)fct) return my_sqlite3_destroy_##A; + SUPER() + #undef GO + #define GO(A) if (my_sqlite3_destroy_fct_##A == 0) {my_sqlite3_destroy_fct_##A = (uintptr_t)fct; return my_sqlite3_destroy_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for sqlite3_destroy callback\n"); + return NULL; +} + +EXPORT int my_sqlite3_bind_blob(x64emu_t* emu, void* stmt, int idx, void* data, int n, void* dtor) { + return my->sqlite3_bind_blob(stmt, idx, data, n, find_sqlite3_destroy_fct(dtor)); +} + +EXPORT int my_sqlite3_bind_text(x64emu_t* emu, void* stmt, int idx, void* text, int n, void* dtor) { + return my->sqlite3_bind_text(stmt, idx, text, n, find_sqlite3_destroy_fct(dtor)); +} + +// sqlite3_func ... +#define GO(A) \ +static uintptr_t my_sqlite3_func_fct_##A = 0; \ +static void my_sqlite3_func_##A(void* ctx, int argc, void* argv) { \ + RunFunctionFmt(my_sqlite3_func_fct_##A, "pip", ctx, argc, argv); \ +} +SUPER() +#undef GO + +static void* find_sqlite3_func_fct(void* fct) { + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if (my_sqlite3_func_fct_##A == (uintptr_t)fct) return my_sqlite3_func_##A; + SUPER() + #undef GO + #define GO(A) if (my_sqlite3_func_fct_##A == 0) { my_sqlite3_func_fct_##A = (uintptr_t)fct; return my_sqlite3_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for sqlite3 func callback\n"); + return NULL; +} + +// salite_final +#define GO(A) \ +static uintptr_t my_sqlite3_final_fct_##A = 0; \ +static void my_sqlite3_final_##A(void* ctx) { \ + RunFunctionFmt(my_sqlite3_final_fct_##A, "p", ctx); \ +} +SUPER() +#undef GO + +static void* find_sqlite3_final_fct(void* fct) { + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if (my_sqlite3_final_fct_##A == (uintptr_t)fct) return my_sqlite3_final_##A; + SUPER() + #undef GO + #define GO(A) if (my_sqlite3_final_fct_##A == 0) { my_sqlite3_final_fct_##A = (uintptr_t)fct; return my_sqlite3_final_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for sqlite3 final callback\n"); + return NULL; +} + +EXPORT int my_sqlite3_create_function(x64emu_t* emu, + void* db, void* name, int nArg, int eTextRep, void* pApp, + void* xFunc, void* xStep, void* xFinal) +{ + return my->sqlite3_create_function( + db, name, nArg, eTextRep, pApp, + find_sqlite3_func_fct(xFunc), + find_sqlite3_func_fct(xStep), + find_sqlite3_final_fct(xFinal) + ); +} + +EXPORT void* my_sqlite3_vmprintf(x64emu_t *emu, void* fmt, x64_va_list_t b) { + (void)emu; + #ifdef CONVERT_VALIST + CONVERT_VALIST(b); + #else + myStackAlignValist(emu, (const char*)fmt, emu->scratch, b); + PREPARE_VALIST; + #endif + return my->sqlite3_vmprintf(fmt, VARARGS); +} +EXPORT void* my_sqlite3_mprintf(x64emu_t *emu, void* fmt, void* b) { + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 1); + PREPARE_VALIST; + return my->sqlite3_vmprintf(fmt, VARARGS); +} + +EXPORT void* my_sqlite3_database_file_object(x64emu_t* emu, void* a) +{ + my_sqlite3_file_t* ret = my->sqlite3_database_file_object(a); + // add autobridge on all the functions + #define GO(A, W) if(ret->pMethods->A) AddAutomaticBridge(my_lib->w.bridge, W, ret->pMethods->A, 0, #A) + GO(xClose, iFp); + GO(xRead, iFppiI); + GO(xWrite, iFppiI); + GO(xTruncate, iFpI); + GO(xSync, iFpi); + GO(xFileSize, iFpp); + GO(xLock, iFpi); + GO(xUnlock, iFpi); + GO(xCheckReservedLock, iFpp); + GO(xFileControl, iFpip); + GO(xSectorSize, iFp); + GO(xDeviceCharacteristics, iFp); + GO(xShmMap, iFpiiip); + GO(xShmLock, iFpiii); + GO(xShmBarrier, iFp); + GO(xShmUnmap, iFpi); + GO(xFetch, iFpIip); + GO(xUnfetch, iFpIp); + #undef GO + return ret; +} -// Insert my_* functions here... #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibsqlite3_private.h b/src/wrapped/wrappedlibsqlite3_private.h index 3d19be8..dce5f40 100644 --- a/src/wrapped/wrappedlibsqlite3_private.h +++ b/src/wrapped/wrappedlibsqlite3_private.h @@ -1,16 +1,16 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -error Meh... +#error Meh... #endif GO(sqlite3_aggregate_context, pFpi) GO(sqlite3_aggregate_count, iFp) -// GO(sqlite3_auto_extension, +//GOM(sqlite3_auto_extension, iFEp) GO(sqlite3_backup_finish, iFp) GO(sqlite3_backup_init, pFpppp) -// GO(sqlite3_backup_pagecount, iFp) +GO(sqlite3_backup_pagecount, iFp) GO(sqlite3_backup_step, iFpi) -// GO(sqlite3_bind_blob, -// GO(sqlite3_bind_blob64, +GOM(sqlite3_bind_blob, iFEpipip) +//GOM(sqlite3_bind_blob64, iFEpipUp) GO(sqlite3_bind_double, iFpid) GO(sqlite3_bind_int, iFpii) GO(sqlite3_bind_int64, iFpiI) @@ -18,10 +18,10 @@ GO(sqlite3_bind_null, iFpi) GO(sqlite3_bind_parameter_count, iFp) GO(sqlite3_bind_parameter_index, iFpp) GO(sqlite3_bind_parameter_name, pFpi) -// GO(sqlite3_bind_pointer, -// GO(sqlite3_bind_text, -// GO(sqlite3_bind_text16, -// GO(sqlite3_bind_text64, +//GOM(sqlite3_bind_pointer, iFEpippp) +GOM(sqlite3_bind_text, iFEpipip) +//GOM(sqlite3_bind_text16, iFEpipip) +//GOM(sqlite3_bind_text64, iFEpipUpC) GO(sqlite3_bind_value, iFpip) GO(sqlite3_bind_zeroblob, iFpii) GO(sqlite3_bind_zeroblob64, iFpiU) @@ -30,15 +30,15 @@ GO(sqlite3_blob_close, iFp) GO(sqlite3_blob_open, iFppppIip) GO(sqlite3_blob_read, iFppii) GO(sqlite3_blob_write, iFppii) -// GO(sqlite3_busy_handler, +//GOM(sqlite3_busy_handler, iFEppp) GO(sqlite3_busy_timeout, iFpi) -// GO(sqlite3_cancel_auto_extension, +//GOM(sqlite3_cancel_auto_extension, iFEp) GO(sqlite3_changes, iFp) GO(sqlite3_clear_bindings, iFp) GO(sqlite3_close_v2, iFp) GO(sqlite3_close, iFp) -// GO(sqlite3_collation_needed, -// GO(sqlite3_collation_needed16, +//GOM(sqlite3_collation_needed, iFEppp) +//GOM(sqlite3_collation_needed16, iFEppp) GO(sqlite3_column_blob, pFpi) GO(sqlite3_column_bytes, iFpi) GO(sqlite3_column_count, iFp) @@ -58,28 +58,28 @@ GO(sqlite3_column_table_name16, pFpi) GO(sqlite3_column_text16, pFpi) GO(sqlite3_column_type, iFpi) GO(sqlite3_column_value, pFpi) -// GO(sqlite3_commit_hook, +//GOM(sqlite3_commit_hook, pFEppp) GO(sqlite3_compileoption_get, pFi) GO(sqlite3_compileoption_used, iFp) GO(sqlite3_complete, iFp) GO(sqlite3_complete16, iFp) -// GO(sqlite3_config, +//GOM(sqlite3_config, iFEiV) GO(sqlite3_context_db_handle, pFp) -// GO(sqlite3_create_collation_v2, -// GO(sqlite3_create_collation, -// GO(sqlite3_create_collation16, +//GOM(sqlite3_create_collation_v2, iFEppippp) +//GOM(sqlite3_create_collation, iFEppipp) +//GOM(sqlite3_create_collation16, iFEppipp) GO(sqlite3_create_filename, pFpppip) -// GO(sqlite3_create_function_v2, -// GO(sqlite3_create_function, -// GO(sqlite3_create_function16, -// GO(sqlite3_create_module_v2, -// GO(sqlite3_create_module, -// GO(sqlite3_create_window_function, +//GOM(sqlite3_create_function_v2, iFEppiippppp) +GOM(sqlite3_create_function, iFEppiipppp) +//GOM(sqlite3_create_function16, iFEppiipppp) +//GOM(sqlite3_create_module_v2, iFEppppp) +//GOM(sqlite3_create_module, iFEpppp) +//GOM(sqlite3_create_window_function, iFEppiipppppp) GO(sqlite3_data_count, iFp) -// GO(sqlite3_data_directory, -GO(sqlite3_database_file_object, pFp) +DATA(sqlite3_data_directory, 8) +GOM(sqlite3_database_file_object, pFEp) GO(sqlite3_db_cacheflush, iFp) -// GO(sqlite3_db_config, +//GOM(sqlite3_db_config, iFEpiV) GO(sqlite3_db_filename, pFpp) GO(sqlite3_db_handle, pFp) GO(sqlite3_db_mutex, pFp) @@ -93,7 +93,7 @@ GO(sqlite3_errcode, iFp) GO(sqlite3_errmsg, pFp) GO(sqlite3_errmsg16, pFp) GO(sqlite3_errstr, pFi) -// GO(sqlite3_exec, +GOM(sqlite3_exec, iFEppppp) GO(sqlite3_expanded_sql, pFp) GO(sqlite3_extended_errcode, iFp) GO(sqlite3_extended_result_codes, iFpi) @@ -120,13 +120,13 @@ GO(sqlite3_libversion_number, iFv) GO(sqlite3_libversion, pFv) GO(sqlite3_limit, iFpii) GO(sqlite3_load_extension, iFpppp) -// GO(sqlite3_log, +//GOM(sqlite3_log, vFEipV) GO(sqlite3_malloc, pFi) GO(sqlite3_malloc64, pFU) -// GO(sqlite3_memory_alarm, +//GOM(sqlite3_memory_alarm, iFEppI) GO(sqlite3_memory_highwater, IFi) GO(sqlite3_memory_used, IFv) -// GO(sqlite3_mprintf, +GOM(sqlite3_mprintf, pFEpV) GO(sqlite3_msize, UFp) GO(sqlite3_mutex_alloc, pFi) GO(sqlite3_mutex_enter, vFp) @@ -139,20 +139,20 @@ GO(sqlite3_os_end, iFv) GO(sqlite3_os_init, iFv) GO(sqlite3_overload_function, iFppi) GO(sqlite3_prepare_v2, iFppipp) -GO(sqlite3_prepare_v3, iFppippp) +GO(sqlite3_prepare_v3, iFppiupp) GO(sqlite3_prepare16_v2, iFppipp) -GO(sqlite3_prepare16_v3, iFppippp) +GO(sqlite3_prepare16_v3, iFppiupp) GO(sqlite3_prepare16, iFppipp) -// GO(sqlite3_profile, -// GO(sqlite3_progress_handler, +//GOM(sqlite3_profile, pFEppp) +//GOM(sqlite3_progress_handler, vFEpipp) GO(sqlite3_randomness, vFip) GO(sqlite3_realloc, pFpi) GO(sqlite3_realloc64, pFpU) GO(sqlite3_release_memory, iFi) GO(sqlite3_reset_auto_extension, vFv) GO(sqlite3_reset, iFp) -// GO(sqlite3_result_blob, -// GO(sqlite3_result_blob64, +//GOM(sqlite3_result_blob, vFEppip) +//GOM(sqlite3_result_blob64, vFEppUp) GO(sqlite3_result_error_code, vFpi) GO(sqlite3_result_error_nomem, vFp) GO(sqlite3_result_error_toobig, vFp) @@ -161,25 +161,25 @@ GO(sqlite3_result_error16, vFppi) GO(sqlite3_result_int, vFpi) GO(sqlite3_result_int64, vFpI) GO(sqlite3_result_null, vFp) -// GO(sqlite3_result_pointer, +//GOM(sqlite3_result_pointer, vFEpppp) GO(sqlite3_result_subtype, vFpu) -// GO(sqlite3_result_text, -// GO(sqlite3_result_text16, -// GO(sqlite3_result_text16be, -// GO(sqlite3_result_text16le, -// GO(sqlite3_result_text64, +//GOM(sqlite3_result_text, vFEppip) +//GOM(sqlite3_result_text16, vFEppip) +//GOM(sqlite3_result_text16be, vFEppip) +//GOM(sqlite3_result_text16le, vFEppip) +//GOM(sqlite3_result_text64, vFEppUpC) GO(sqlite3_result_value, vFpp) GO(sqlite3_result_zeroblob, vFpi) GO(sqlite3_result_zeroblob64, iFpU) -// GO(sqlite3_rollback_hook, -// GO(sqlite3_rtree_geometry_callback, -// GO(sqlite3_rtree_query_callback, -// GO(sqlite3_set_authorizer, -// GO(sqlite3_set_auxdata, -// GO(sqlite3_set_last_insert_rowid, +//GOM(sqlite3_rollback_hook, pFEppp) +//GOM(sqlite3_rtree_geometry_callback, iFEpppp) +//GOM(sqlite3_rtree_query_callback, iFEppppp) +//GOM(sqlite3_set_authorizer, iFEppp) +//GOM(sqlite3_set_auxdata, vFEpipp) +GO(sqlite3_set_last_insert_rowid, vFpI) GO(sqlite3_shutdown, iFv) GO(sqlite3_sleep, iFi) -// GO(sqlite3_snprintf, +//GOM(sqlite3_snprintf, pFEippV) GO(sqlite3_soft_heap_limit, vFi) GO(sqlite3_soft_heap_limit64, IFI) GO(sqlite3_sourceid, pFv) @@ -194,37 +194,37 @@ GO(sqlite3_stmt_status, iFpii) GO(sqlite3_str_append, vFppi) GO(sqlite3_str_appendall, vFpp) GO(sqlite3_str_appendchar, vFpic) -// GO(sqlite3_str_appendf, +//GOM(sqlite3_str_appendf, vFEppV) GO(sqlite3_str_errcode, iFp) GO(sqlite3_str_finish, pFp) GO(sqlite3_str_length, iFp) GO(sqlite3_str_new, pFp) GO(sqlite3_str_reset, vFp) GO(sqlite3_str_value, pFp) -// GO(sqlite3_str_vappendf, +//GOM(sqlite3_str_vappendf, vFEppA) GO(sqlite3_strglob, iFpp) GO(sqlite3_stricmp, iFpp) GO(sqlite3_strlike, iFppu) GO(sqlite3_strnicmp, iFppi) GO(sqlite3_system_errno, iFp) -// GO(sqlite3_table_column_metadata, -// GO(sqlite3_temp_directory, -// GO(sqlite3_test_control, -// GO(sqlite3_thread_cleanup, -// GO(sqlite3_threadsafe, -// GO(sqlite3_total_changes, -// GO(sqlite3_trace_v2, -// GO(sqlite3_trace, -// GO(sqlite3_transfer_bindings, -// GO(sqlite3_txn_state, -// GO(sqlite3_unlock_notify, -// GO(sqlite3_unsupported_selecttrace, -// GO(sqlite3_update_hook, +GO(sqlite3_table_column_metadata, iFppppppppp) +DATA(sqlite3_temp_directory, 8) +//GOM(sqlite3_test_control, iFEiV) +GO(sqlite3_thread_cleanup, vFv) +GO(sqlite3_threadsafe, iFv) +GO(sqlite3_total_changes, iFp) +//GOM(sqlite3_trace_v2, iFEpupp) +//GOM(sqlite3_trace, pFEppp) +GO(sqlite3_transfer_bindings, iFpp) +GO(sqlite3_txn_state, iFpp) +//GOM(sqlite3_unlock_notify, iFEppp) +//GO(sqlite3_unsupported_selecttrace, +//GOM(sqlite3_update_hook, pFEppp) GO(sqlite3_uri_boolean, iFppi) GO(sqlite3_uri_int64, IFppI) GO(sqlite3_uri_key, pFpi) GO(sqlite3_uri_parameter, pFpp) -// GO(sqlite3_user_data, +GO(sqlite3_user_data, pFp) GO(sqlite3_value_blob, pFp) GO(sqlite3_value_bytes, iFp) GO(sqlite3_value_bytes16, iFp) @@ -242,20 +242,20 @@ GO(sqlite3_value_text16, pFp) GO(sqlite3_value_text16be, pFp) GO(sqlite3_value_text16le, pFp) GO(sqlite3_value_type, iFp) -// GO(sqlite3_version, -// GO(sqlite3_vfs_find, -// GO(sqlite3_vfs_register, -// GO(sqlite3_vfs_unregister, -// GO(sqlite3_vmprintf, -// GO(sqlite3_vsnprintf, -// GO(sqlite3_vtab_collation, -// GO(sqlite3_vtab_config, -// GO(sqlite3_vtab_nochange, -// GO(sqlite3_vtab_on_conflict, -// GO(sqlite3_wal_autocheckpoint, +//GO(sqlite3_version, +//GOM(sqlite3_vfs_find, pFEp) +//GOM(sqlite3_vfs_register, iFEpi) +//GOM(sqlite3_vfs_unregister, iFEp) +GOM(sqlite3_vmprintf, pFEpA) +//GOM(sqlite3_vsnprintf, pFEippA) +GO(sqlite3_vtab_collation, pFpi) +//GOM(sqlite3_vtab_config, iFEpiV) +GO(sqlite3_vtab_nochange, iFp) +GO(sqlite3_vtab_on_conflict, iFp) +GO(sqlite3_wal_autocheckpoint, iFpi) GO(sqlite3_wal_checkpoint_v2, iFppipp) GO(sqlite3_wal_checkpoint, iFpp) -// GO(sqlite3_wal_hook, +//GOM(sqlite3_wal_hook, pFEppp) GO(sqlite3_backup_remaining, iFp) GO(sqlite3_blob_reopen, iFpI) GO(sqlite3_column_bytes16, iFpi) @@ -267,3 +267,7 @@ GO(sqlite3_open, iFpp) GO(sqlite3_prepare, iFppipp) GO(sqlite3_result_double, vFpd) GO(sqlite3_value_pointer, pFpp) + +GO(dummy_iFppiI, iFppiI) +GO(dummy_iFpIip, iFpIip) +GO(dummy_iFpIp, iFpIp) \ No newline at end of file diff --git a/src/wrapped/wrappedlibssh2.c b/src/wrapped/wrappedlibssh2.c index 3dd0158..ee24fd5 100644 --- a/src/wrapped/wrappedlibssh2.c +++ b/src/wrapped/wrappedlibssh2.c @@ -6,14 +6,166 @@ #include "wrappedlibs.h" +#include "debug.h" #include "wrapper.h" #include "bridge.h" #include "librarian/library_private.h" #include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" const char* libssh2Name = "libssh2.so.1"; #define LIBNAME libssh2 #define NEEDED_LIBS "libgcrypt.so.20" +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedlibssh2types.h" + +#include "wrappercallback.h" + +// utility functions +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// alloc +#define GO(A) \ +static uintptr_t my_alloc_fct_##A = 0; \ +static void* my_alloc_##A(size_t a, void* b) \ +{ \ + return (void*)RunFunctionFmt(my_alloc_fct_##A, "lp", a, b); \ +} +SUPER() +#undef GO +static void* find_alloc_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_alloc_fct_##A == (uintptr_t)fct) return my_alloc_##A; + SUPER() + #undef GO + #define GO(A) if(my_alloc_fct_##A == 0) {my_alloc_fct_##A = (uintptr_t)fct; return my_alloc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libssh2 alloc callback\n"); + return NULL; +} +// realloc +#define GO(A) \ +static uintptr_t my_realloc_fct_##A = 0; \ +static void* my_realloc_##A(void* a, size_t b, void* c) \ +{ \ + return (void*)RunFunctionFmt(my_realloc_fct_##A, "plp", a, b, c); \ +} +SUPER() +#undef GO +static void* find_realloc_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_realloc_fct_##A == (uintptr_t)fct) return my_realloc_##A; + SUPER() + #undef GO + #define GO(A) if(my_realloc_fct_##A == 0) {my_realloc_fct_##A = (uintptr_t)fct; return my_realloc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libssh2 realloc callback\n"); + return NULL; +} +// free +#define GO(A) \ +static uintptr_t my_free_fct_##A = 0; \ +static void my_free_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_free_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* find_free_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_free_fct_##A == (uintptr_t)fct) return my_free_##A; + SUPER() + #undef GO + #define GO(A) if(my_free_fct_##A == 0) {my_free_fct_##A = (uintptr_t)fct; return my_free_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libssh2 free callback\n"); + return NULL; +} +// paaswd_changereq +#define GO(A) \ +static uintptr_t my_paaswd_changereq_fct_##A = 0; \ +static void my_paaswd_changereq_##A(void* a, int b, void* c, int d, void* e, int f, void* g) \ +{ \ + RunFunctionFmt(my_paaswd_changereq_fct_##A, "pipipip", a, b, c, d, e, f, g); \ +} +SUPER() +#undef GO +static void* find_paaswd_changereq_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_paaswd_changereq_fct_##A == (uintptr_t)fct) return my_paaswd_changereq_##A; + SUPER() + #undef GO + #define GO(A) if(my_paaswd_changereq_fct_##A == 0) {my_paaswd_changereq_fct_##A = (uintptr_t)fct; return my_paaswd_changereq_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libssh2 paaswd_changereq callback\n"); + return NULL; +} +// userauth_kbdint_response +#define GO(A) \ +static uintptr_t my_userauth_kbdint_response_fct_##A = 0; \ +static void my_userauth_kbdint_response_##A(void* a, int b, void* c, int d, int e, void* f, void* g, void* h) \ +{ \ + RunFunctionFmt(my_userauth_kbdint_response_fct_##A, "pipiippp", a, b, c, d, e, f, g, h); \ +} +SUPER() +#undef GO +static void* find_userauth_kbdint_response_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_userauth_kbdint_response_fct_##A == (uintptr_t)fct) return my_userauth_kbdint_response_##A; + SUPER() + #undef GO + #define GO(A) if(my_userauth_kbdint_response_fct_##A == 0) {my_userauth_kbdint_response_fct_##A = (uintptr_t)fct; return my_userauth_kbdint_response_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libssh2 userauth_kbdint_response callback\n"); + return NULL; +} +#undef SUPER + +EXPORT int my_libssh2_userauth_password_ex(x64emu_t* emu, void* session, void* username, uint32_t name_len, void* passw, uint32_t pwd_len, void* f) +{ + return my->libssh2_userauth_password_ex(session, username, name_len, passw, pwd_len, find_paaswd_changereq_Fct(f)); +} + +EXPORT void* my_libssh2_session_init_ex(x64emu_t* emu, void* my_alloc, void* my_free, void* my_realloc, void* abstract) +{ + return my->libssh2_session_init_ex(find_alloc_Fct(my_alloc), find_free_Fct(my_free), find_realloc_Fct(my_realloc), abstract); +} + +EXPORT int my_libssh2_userauth_keyboard_interactive_ex(x64emu_t* emu, void* session, void* username, uint32_t len, void* f) +{ + return my->libssh2_userauth_keyboard_interactive_ex(session, username, len, find_userauth_kbdint_response_Fct(f)); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibssh2_private.h b/src/wrapped/wrappedlibssh2_private.h index 6a33d91..dc40743 100644 --- a/src/wrapped/wrappedlibssh2_private.h +++ b/src/wrapped/wrappedlibssh2_private.h @@ -1,20 +1,22 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -error Meh... +#error Meh... #endif GO(libssh2_agent_connect, iFp) GO(libssh2_agent_disconnect, iFp) GO(libssh2_agent_free, vFp) GO(libssh2_agent_get_identity, iFppp) -GO(libssh2_agent_get_identity_path, iFpppi) +GO(libssh2_agent_get_identity_path, pFp) GO(libssh2_agent_init, pFp) GO(libssh2_agent_list_identities, iFp) GO(libssh2_agent_set_identity_path, vFpp) +GO(libssh2_agent_sign, iFpppppLpu) GO(libssh2_agent_userauth, iFppp) GO(libssh2_banner_set, iFpp) -GO(libssh2_base64_decode, iFppppi) +GO(libssh2_base64_decode, iFppppu) GO(libssh2_channel_close, iFp) -GO(libssh2_channel_direct_tcpip_ex, iFppipi) +GO(libssh2_channel_direct_streamlocal_ex, pFpppi) +GO(libssh2_channel_direct_tcpip_ex, pFppipi) GO(libssh2_channel_eof, iFp) GO(libssh2_channel_flush_ex, iFpi) GO(libssh2_channel_forward_accept, pFp) @@ -25,6 +27,119 @@ GO(libssh2_channel_get_exit_signal, iFppppppp) GO(libssh2_channel_get_exit_status, iFp) GO(libssh2_channel_handle_extended_data, vFpi) GO(libssh2_channel_handle_extended_data2, iFpi) +GO(libssh2_channel_open_ex, pFppuuupu) GO(libssh2_channel_process_startup, iFppupu) -GO(libssh2_channel_read_ex, iFpipi) -GO(libssh2_crypt_methods, pFv) +GO(libssh2_channel_read_ex, lFpipL) +GO(libssh2_channel_receive_window_adjust, LFpLC) +GO(libssh2_channel_receive_window_adjust2, iFpLCp) +GO(libssh2_channel_request_auth_agent, iFp) +GO(libssh2_channel_request_pty_ex, iFppupuiiii) +GO(libssh2_channel_request_pty_size_ex, iFpiiii) +GO(libssh2_channel_send_eof, iFp) +GO(libssh2_channel_set_blocking, vFpi) +GO(libssh2_channel_setenv_ex, iFppupu) +GO(libssh2_channel_signal_ex, iFppL) +GO(libssh2_channel_wait_closed, iFp) +GO(libssh2_channel_wait_eof, iFp) +GO(libssh2_channel_window_read_ex, LFppp) +GO(libssh2_channel_window_write_ex, LFpp) +GO(libssh2_channel_write_ex, lFpipL) +GO(libssh2_channel_x11_req_ex, iFpippi) +//GO(libssh2_crypt_methods, +GO(libssh2_crypto_engine, uFv) +GO(libssh2_exit, vFv) +GO(libssh2_free, vFpp) +GO(libssh2_hostkey_hash, pFpi) +//GO(libssh2_hostkey_methods, +GO(libssh2_init, iFi) +GO(libssh2_keepalive_config, vFpiu) +GO(libssh2_keepalive_send, iFpp) +GO(libssh2_knownhost_add, iFppppLip) +GO(libssh2_knownhost_addc, iFppppLpLip) +GO(libssh2_knownhost_check, iFpppLip) +GO(libssh2_knownhost_checkp, iFppipLip) +GO(libssh2_knownhost_del, iFpp) +GO(libssh2_knownhost_free, vFp) +GO(libssh2_knownhost_get, iFppp) +GO(libssh2_knownhost_init, pFp) +GO(libssh2_knownhost_readfile, iFppi) +GO(libssh2_knownhost_readline, iFppLi) +GO(libssh2_knownhost_writefile, iFppi) +GO(libssh2_knownhost_writeline, iFpppLpi) +GO(libssh2_poll, iFpul) +GO(libssh2_poll_channel_read, iFpi) +//GO(libssh2_publickey_add_ex, +//GO(libssh2_publickey_init, +//GO(libssh2_publickey_list_fetch, +//GO(libssh2_publickey_list_free, +//GO(libssh2_publickey_remove_ex, +//GO(libssh2_publickey_shutdown, +GO(libssh2_scp_recv, pFppp) +GO(libssh2_scp_recv2, pFppp) +GO(libssh2_scp_send64, pFppiIll) +GO(libssh2_scp_send_ex, pFppiLll) +GO(libssh2_session_abstract, pFp) +GO(libssh2_session_banner_get, pFp) +GO(libssh2_session_banner_set, iFpp) +GO(libssh2_session_block_directions, iFp) +GO(libssh2_session_callback_set, pFpip) +GO(libssh2_session_callback_set2, pFpip) +GO(libssh2_session_disconnect_ex, iFpipp) +GO(libssh2_session_flag, iFpii) +GO(libssh2_session_free, iFp) +GO(libssh2_session_get_blocking, iFp) +GO(libssh2_session_get_read_timeout, lFp) +GO(libssh2_session_get_timeout, lFp) +GO(libssh2_session_handshake, iFpi) +GO(libssh2_session_hostkey, pFppp) +GOM(libssh2_session_init_ex, pFEpppp) +GO(libssh2_session_last_errno, iFp) +GO(libssh2_session_last_error, iFpppi) +GO(libssh2_session_method_pref, iFpip) +GO(libssh2_session_methods, pFpi) +GO(libssh2_session_set_blocking, vFpi) +GO(libssh2_session_set_last_error, iFpip) +GO(libssh2_session_set_read_timeout, vFpl) +GO(libssh2_session_set_timeout, vFpl) +GO(libssh2_session_startup, iFpi) +GO(libssh2_session_supported_algs, iFpip) +GO(libssh2_sftp_close_handle, iFp) +//GO(libssh2_sftp_dtor, +GO(libssh2_sftp_fstat_ex, iFppi) +GO(libssh2_sftp_fstatvfs, iFpp) +GO(libssh2_sftp_fsync, iFp) +GO(libssh2_sftp_get_channel, pFp) +GO(libssh2_sftp_init, pFp) +GO(libssh2_sftp_last_error, LFp) +GO(libssh2_sftp_mkdir_ex, iFppul) +GO(libssh2_sftp_open_ex, pFppuLli) +GO(libssh2_sftp_open_ex_r, pFppLLlip) +GO(libssh2_sftp_posix_rename_ex, iFppLpL) +GO(libssh2_sftp_read, lFppL) +GO(libssh2_sftp_readdir_ex, iFppLpLp) +GO(libssh2_sftp_rename_ex, iFppupul) +GO(libssh2_sftp_rmdir_ex, iFppu) +GO(libssh2_sftp_seek, vFpL) +GO(libssh2_sftp_seek64, vFpU) +GO(libssh2_sftp_shutdown, iFp) +GO(libssh2_sftp_stat_ex, iFppuip) +GO(libssh2_sftp_statvfs, iFppLp) +GO(libssh2_sftp_symlink_ex, iFppupui) +GO(libssh2_sftp_tell, LFp) +GO(libssh2_sftp_tell64, UFp) +GO(libssh2_sftp_unlink_ex, iFppu) +GO(libssh2_sftp_write, lFppL) +GO(libssh2_sign_sk, iFppppLp) +GO(libssh2_trace, iFpi) +//GOM(libssh2_trace_sethandler, iFEppp) +GO(libssh2_userauth_authenticated, iFp) +GO(libssh2_userauth_banner, iFpp) +GO(libssh2_userauth_hostbased_fromfile_ex, iFppuppppupu) +GOM(libssh2_userauth_keyboard_interactive_ex, iFEppup) +GO(libssh2_userauth_list, pFppu) +GOM(libssh2_userauth_password_ex, iFEppupup) +//GOM(libssh2_userauth_publickey, iFEpppLpp) +GO(libssh2_userauth_publickey_fromfile_ex, iFppuppp) +GO(libssh2_userauth_publickey_frommemory, iFppLpLpLp) +//GOM(libssh2_userauth_publickey_sk, iFEppLpLpLppp) +GO(libssh2_version, pFi) diff --git a/src/wrapped/wrappedlibssl3.c b/src/wrapped/wrappedlibssl3.c index 4c75d92..20c1eb2 100644 --- a/src/wrapped/wrappedlibssl3.c +++ b/src/wrapped/wrappedlibssl3.c @@ -34,10 +34,10 @@ GO(4) // pem_passwd_cb #define GO(A) \ -static uintptr_t my3_pem_passwd_cb_fct_##A = 0; \ -static int my3_pem_passwd_cb_##A(void* buf, int size, int rwflag, void* password) \ +static uintptr_t my3_pem_passwd_cb_fct_##A = 0; \ +static int my3_pem_passwd_cb_##A(void* buf, int size, int rwflag, void* password) \ { \ - return (int)RunFunctionFmt(my3_pem_passwd_cb_fct_##A, "piip", buf, size, rwflag, password); \ + return (int)RunFunctionFmt(my3_pem_passwd_cb_fct_##A, "piip", buf, size, rwflag, password); \ } SUPER() #undef GO @@ -68,10 +68,10 @@ static void* reverse_pem_passwd_cb_Fct(void* fct) // anonymous #define GO(A) \ -static uintptr_t my3_anonymous_fct_##A = 0; \ -static void* my3_anonymous_##A(void* a, void* b, void* c, void *d) \ +static uintptr_t my3_anonymous_fct_##A = 0; \ +static void* my3_anonymous_##A(void* a, void* b, void* c, void *d) \ { \ - return (void*)RunFunctionFmt(my3_anonymous_fct_##A, "pppp", a, b, c, d); \ + return (void*)RunFunctionFmt(my3_anonymous_fct_##A, "pppp", a, b, c, d); \ } SUPER() #undef GO @@ -93,10 +93,10 @@ static void* find_anonymous_Fct(void* fct) // verify #define GO(A) \ -static uintptr_t my3_verify_fct_##A = 0; \ -static int my3_verify_##A(int a, void* b) \ -{ \ - return (int)RunFunctionFmt(my3_verify_fct_##A, "ip", a, b); \ +static uintptr_t my3_verify_fct_##A = 0; \ +static int my3_verify_##A(int a, void* b) \ +{ \ + return (int)RunFunctionFmt(my3_verify_fct_##A, "ip", a, b); \ } SUPER() #undef GO @@ -129,8 +129,8 @@ static void* reverse_verify_Fct(void* fct) #define GO(A) \ static uintptr_t my3_ex_new_fct_##A = 0; \ static void my3_ex_new_##A(void* parent, void* ptr, void* ad, int idx, long argl, void* argp) \ -{ \ - RunFunctionFmt(my3_ex_new_fct_##A, "pppilp", parent, ptr, ad, idx, argl, argp); \ +{ \ + RunFunctionFmt(my3_ex_new_fct_##A, "pppilp", parent, ptr, ad, idx, argl, argp); \ } SUPER() #undef GO @@ -151,10 +151,10 @@ static void* find_ex_new_Fct(void* fct) // ex_free #define GO(A) \ -static uintptr_t my3_ex_free_fct_##A = 0; \ -static void my3_ex_free_##A(void* parent, void* ptr, void* ad, int idx, long argl, void* argp) \ +static uintptr_t my3_ex_free_fct_##A = 0; \ +static void my3_ex_free_##A(void* parent, void* ptr, void* ad, int idx, long argl, void* argp) \ { \ - RunFunctionFmt(my3_ex_free_fct_##A, "pppilp", parent, ptr, ad, idx, argl, argp); \ + RunFunctionFmt(my3_ex_free_fct_##A, "pppilp", parent, ptr, ad, idx, argl, argp); \ } SUPER() #undef GO @@ -175,10 +175,10 @@ static void* find_ex_free_Fct(void* fct) // ex_dup #define GO(A) \ -static uintptr_t my3_ex_dup_fct_##A = 0; \ -static int my3_ex_dup_##A(void* to, void* from, void* from_d, int idx, long argl, void* argp) \ +static uintptr_t my3_ex_dup_fct_##A = 0; \ +static int my3_ex_dup_##A(void* to, void* from, void* from_d, int idx, long argl, void* argp) \ { \ - return (int) RunFunctionFmt(my3_ex_dup_fct_##A, "pppilp", to, from, from_d, idx, argl, argp); \ + return (int) RunFunctionFmt(my3_ex_dup_fct_##A, "pppilp", to, from, from_d, idx, argl, argp); \ } SUPER() #undef GO @@ -199,10 +199,10 @@ static void* find_ex_dup_Fct(void* fct) // client_cb #define GO(A) \ -static uintptr_t my3_client_cb_fct_##A = 0; \ -static uint32_t my3_client_cb_##A(void* ssl, void* hint, void* identity, uint32_t id_len, void* psk, uint32_t psk_len) \ +static uintptr_t my3_client_cb_fct_##A = 0; \ +static uint32_t my3_client_cb_##A(void* ssl, void* hint, void* identity, uint32_t id_len, void* psk, uint32_t psk_len) \ { \ - return RunFunctionFmt(my3_client_cb_fct_##A, "pppupu", ssl, hint, identity, id_len, psk, psk_len); \ + return RunFunctionFmt(my3_client_cb_fct_##A, "pppupu", ssl, hint, identity, id_len, psk, psk_len); \ } SUPER() #undef GO @@ -223,10 +223,10 @@ static void* find_client_cb_Fct(void* fct) // proto_select #define GO(A) \ -static uintptr_t my3_proto_select_fct_##A = 0; \ -static int my3_proto_select_##A(void* s, void* out, void* outlen, void* in, uint32_t inlen, void* arg) \ +static uintptr_t my3_proto_select_fct_##A = 0; \ +static int my3_proto_select_##A(void* s, void* out, void* outlen, void* in, uint32_t inlen, void* arg) \ { \ - return (int)RunFunctionFmt(my3_proto_select_fct_##A, "ppppup", s, out, outlen, in, inlen, arg); \ + return (int)RunFunctionFmt(my3_proto_select_fct_##A, "ppppup", s, out, outlen, in, inlen, arg); \ } SUPER() #undef GO @@ -247,9 +247,9 @@ static void* find_proto_select_Fct(void* fct) // client_cert #define GO(A) \ -static uintptr_t my3_client_cert_fct_##A = 0; \ -static int my3_client_cert_##A(void* a, void* b, void* c) \ -{ \ +static uintptr_t my3_client_cert_fct_##A = 0; \ +static int my3_client_cert_##A(void* a, void* b, void* c) \ +{ \ return (int)RunFunctionFmt(my3_client_cert_fct_##A, "ppp", a, b, c); \ } SUPER() @@ -274,7 +274,7 @@ static void* find_client_cert_Fct(void* fct) static uintptr_t my3_alpn_select_cb_fct_##A = 0; \ static int my3_alpn_select_cb_##A(void* a, void* b, void* c, void* d, uint32_t e, void* f) \ { \ - return (int)RunFunctionFmt(my3_alpn_select_cb_fct_##A, "ppppup", a, b, c, d, e, f); \ + return (int)RunFunctionFmt(my3_alpn_select_cb_fct_##A, "ppppup", a, b, c, d, e, f); \ } SUPER() #undef GO @@ -338,6 +338,259 @@ static void* find_msg_cb_Fct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for libSSL msg_cb callback\n"); return NULL; } +// info_cb +#define GO(A) \ +static uintptr_t my3_info_cb_fct_##A = 0; \ +static void my3_info_cb_##A(void* a, int b, int c) \ +{ \ + RunFunctionFmt(my3_info_cb_fct_##A, "pii", a, b, c); \ +} +SUPER() +#undef GO +static void* find_info_cb_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my3_info_cb_fct_##A == (uintptr_t)fct) return my3_info_cb_##A; + SUPER() + #undef GO + #define GO(A) if(my3_info_cb_fct_##A == 0) {my3_info_cb_fct_##A = (uintptr_t)fct; return my3_info_cb_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libSSL info_cb callback\n"); + return NULL; +} +// new_seesion_cb +#define GO(A) \ +static uintptr_t my_new_seesion_cb_fct_##A = 0; \ +static int my_new_seesion_cb_##A(void* a, void* b) \ +{ \ + return (int)RunFunctionFmt(my_new_seesion_cb_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* find_new_seesion_cb_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_new_seesion_cb_fct_##A == (uintptr_t)fct) return my_new_seesion_cb_##A; + SUPER() + #undef GO + #define GO(A) if(my_new_seesion_cb_fct_##A == 0) {my_new_seesion_cb_fct_##A = (uintptr_t)fct; return my_new_seesion_cb_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for ssl3 new_seesion_cb callback\n"); + return NULL; +} +// psk_use_session_cb +#define GO(A) \ +static uintptr_t my_psk_use_session_cb_fct_##A = 0; \ +static int my_psk_use_session_cb_##A(void* a, void* b, void* c, void* d, void* e) \ +{ \ + return (int)RunFunctionFmt(my_psk_use_session_cb_fct_##A, "ppppp", a, b, c, d, e); \ +} +SUPER() +#undef GO +static void* find_psk_use_session_cb_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_psk_use_session_cb_fct_##A == (uintptr_t)fct) return my_psk_use_session_cb_##A; + SUPER() + #undef GO + #define GO(A) if(my_psk_use_session_cb_fct_##A == 0) {my_psk_use_session_cb_fct_##A = (uintptr_t)fct; return my_psk_use_session_cb_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for ssl3 psk_use_session_cb callback\n"); + return NULL; +} +// app_verify_cookie_cb +#define GO(A) \ +static uintptr_t my_app_verify_cookie_cb_fct_##A = 0; \ +static int my_app_verify_cookie_cb_##A(void* a, void* b, uint32_t c) \ +{ \ + return (int)RunFunctionFmt(my_app_verify_cookie_cb_fct_##A, "ppu", a, b, c); \ +} +SUPER() +#undef GO +static void* find_app_verify_cookie_cb_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_app_verify_cookie_cb_fct_##A == (uintptr_t)fct) return my_app_verify_cookie_cb_##A; + SUPER() + #undef GO + #define GO(A) if(my_app_verify_cookie_cb_fct_##A == 0) {my_app_verify_cookie_cb_fct_##A = (uintptr_t)fct; return my_app_verify_cookie_cb_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for ssl3 app_verify_cookie_cb callback\n"); + return NULL; +} +// set_cookie_generate_cb +#define GO(A) \ +static uintptr_t my_set_cookie_generate_cb_fct_##A = 0; \ +static int my_set_cookie_generate_cb_##A(void* a, void* b, void* c) \ +{ \ + return (int)RunFunctionFmt(my_set_cookie_generate_cb_fct_##A, "ppp", a, b, c); \ +} +SUPER() +#undef GO +static void* find_set_cookie_generate_cb_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_set_cookie_generate_cb_fct_##A == (uintptr_t)fct) return my_set_cookie_generate_cb_##A; + SUPER() + #undef GO + #define GO(A) if(my_set_cookie_generate_cb_fct_##A == 0) {my_set_cookie_generate_cb_fct_##A = (uintptr_t)fct; return my_set_cookie_generate_cb_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for ssl3 set_cookie_generate_cb callback\n"); + return NULL; +} +// psk_server_cb +#define GO(A) \ +static uintptr_t my_psk_server_cb_fct_##A = 0; \ +static uint32_t my_psk_server_cb_##A(void* a, void* b, void* c, uint32_t d) \ +{ \ + return (uint32_t)RunFunctionFmt(my_psk_server_cb_fct_##A, "pppu", a, b, c, d); \ +} +SUPER() +#undef GO +static void* find_psk_server_cb_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_psk_server_cb_fct_##A == (uintptr_t)fct) return my_psk_server_cb_##A; + SUPER() + #undef GO + #define GO(A) if(my_psk_server_cb_fct_##A == 0) {my_psk_server_cb_fct_##A = (uintptr_t)fct; return my_psk_server_cb_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for ssl3 psk_server_cb callback\n"); + return NULL; +} +// psk_server_callback +#define GO(A) \ +static uintptr_t my_psk_server_callback_fct_##A = 0; \ +static uint32_t my_psk_server_callback_##A(void* a, void* b, void* c, int d) \ +{ \ + return (uint32_t)RunFunctionFmt(my_psk_server_callback_fct_##A, "pppi", a, b, c, d); \ +} +SUPER() +#undef GO +static void* find_psk_server_callback_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_psk_server_callback_fct_##A == (uintptr_t)fct) return my_psk_server_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_psk_server_callback_fct_##A == 0) {my_psk_server_callback_fct_##A = (uintptr_t)fct; return my_psk_server_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for ssl3 psk_server_callback callback\n"); + return NULL; +} +// read_write +#define GO(A) \ +static uintptr_t my_read_write_fct_##A = 0; \ +static int my_read_write_##A(void* a, void* b, int c) \ +{ \ + return (int)RunFunctionFmt(my_read_write_fct_##A, "ppi", a, b, c); \ +} +SUPER() +#undef GO +static void* find_read_write_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_read_write_fct_##A == (uintptr_t)fct) return my_read_write_##A; + SUPER() + #undef GO + #define GO(A) if(my_read_write_fct_##A == 0) {my_read_write_fct_##A = (uintptr_t)fct; return my_read_write_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for ssl3 read_write callback\n"); + return NULL; +} +// puts +#define GO(A) \ +static uintptr_t my_puts_fct_##A = 0; \ +static int my_puts_##A(void* a, void* b) \ +{ \ + return (int)RunFunctionFmt(my_puts_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* find_puts_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_puts_fct_##A == (uintptr_t)fct) return my_puts_##A; + SUPER() + #undef GO + #define GO(A) if(my_puts_fct_##A == 0) {my_puts_fct_##A = (uintptr_t)fct; return my_puts_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for ssl3 puts callback\n"); + return NULL; +} +// ctrl +#define GO(A) \ +static uintptr_t my_ctrl_fct_##A = 0; \ +static long my_ctrl_##A(void* a, int b, long c, void* d) \ +{ \ + return (long)RunFunctionFmt(my_ctrl_fct_##A, "pilp", a, b, c, d); \ +} +SUPER() +#undef GO +static void* find_ctrl_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_ctrl_fct_##A == (uintptr_t)fct) return my_ctrl_##A; + SUPER() + #undef GO + #define GO(A) if(my_ctrl_fct_##A == 0) {my_ctrl_fct_##A = (uintptr_t)fct; return my_ctrl_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for ssl3 ctrl callback\n"); + return NULL; +} +// create_destroy +#define GO(A) \ +static uintptr_t my_create_destroy_fct_##A = 0; \ +static int my_create_destroy_##A(void* a) \ +{ \ + return (int)RunFunctionFmt(my_create_destroy_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* find_create_destroy_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_create_destroy_fct_##A == (uintptr_t)fct) return my_create_destroy_##A; + SUPER() + #undef GO + #define GO(A) if(my_create_destroy_fct_##A == 0) {my_create_destroy_fct_##A = (uintptr_t)fct; return my_create_destroy_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for ssl3 create_destroy callback\n"); + return NULL; +} #undef SUPER @@ -437,6 +690,82 @@ EXPORT void my3_SSL_set_msg_callback(x64emu_t* emu, void* ctx, void* cb) my->SSL_set_msg_callback(ctx, find_msg_cb_Fct(cb)); } +EXPORT void my3_SSL_CTX_sess_set_new_cb(x64emu_t* emu, void *ctx, void* f) +{ + my->SSL_CTX_sess_set_new_cb(ctx, find_new_seesion_cb_Fct(f)); +} + +EXPORT void my3_SSL_set_info_callback(x64emu_t* emmu, void* ctx, void* f) +{ + my->SSL_set_info_callback(ctx, find_info_cb_Fct(f)); +} + +EXPORT void my3_SSL_CTX_set_info_callback(x64emu_t* emu, void* ctx, void* f) +{ + (void)emu; + my->SSL_CTX_set_info_callback(ctx, find_info_cb_Fct(f)); +} + +EXPORT void my3_SSL_set_psk_use_session_callback(x64emu_t* emu, void* ctx, void* f) +{ + my->SSL_set_psk_use_session_callback(ctx, find_psk_use_session_cb_Fct(f)); +} + +EXPORT void my3_SSL_CTX_set_cookie_verify_cb(x64emu_t* emu, void* ctx, void* f) +{ + my->SSL_CTX_set_cookie_verify_cb(ctx, find_app_verify_cookie_cb_Fct(f)); +} + +EXPORT void my3_SSL_CTX_set_cookie_generate_cb(x64emu_t* emu, void* ctx, void* f) +{ + my->SSL_CTX_set_cookie_generate_cb(ctx, find_set_cookie_generate_cb_Fct(f)); +} + +EXPORT void my3_SSL_set_psk_server_callback(x64emu_t* emu, void* ctx, void* f) +{ + my->SSL_set_psk_server_callback(ctx, find_psk_server_cb_Fct(f)); +} + +EXPORT int my3_BIO_meth_set_write(x64emu_t* emu, void* biom, void* f) +{ + return my->BIO_meth_set_write(biom, find_read_write_Fct(f)); +} + +EXPORT int my3_BIO_meth_set_read(x64emu_t* emu, void* biom, void* f) +{ + return my->BIO_meth_set_read(biom, find_read_write_Fct(f)); +} + +EXPORT int my3_BIO_meth_set_puts(x64emu_t* emu, void* biom, void* f) +{ + return my->BIO_meth_set_puts(biom, find_puts_Fct(f)); +} + +EXPORT int my3_BIO_meth_set_ctrl(x64emu_t* emu, void* biom, void* f) +{ + return my->BIO_meth_set_ctrl(biom, find_ctrl_Fct(f)); +} + +EXPORT int my3_BIO_meth_set_create(x64emu_t* emu, void* biom, void* f) +{ + return my->BIO_meth_set_create(biom, find_create_destroy_Fct(f)); +} + +EXPORT int my3_BIO_meth_set_destroy(x64emu_t* emu, void* biom, void* f) +{ + return my->BIO_meth_set_destroy(biom, find_create_destroy_Fct(f)); +} + +EXPORT void my3_SSL_CTX_set_psk_server_callback(x64emu_t* emu, void* ssl, void* cb) +{ + my->SSL_CTX_set_psk_server_callback(ssl, find_psk_server_callback_Fct(cb)); +} + +EXPORT void my3_SSL_CTX_set_psk_client_callback(x64emu_t* emu, void* ssl, void* cb) +{ + my->SSL_CTX_set_psk_client_callback(ssl, find_client_cb_Fct(cb)); +} + #define ALTMY my3_ #define NEEDED_LIBS "libcrypto.so.3", "libpthread.so.0" diff --git a/src/wrapped/wrappedlibssl3_private.h b/src/wrapped/wrappedlibssl3_private.h index ef44cf7..5b00945 100644 --- a/src/wrapped/wrappedlibssl3_private.h +++ b/src/wrapped/wrappedlibssl3_private.h @@ -1,13 +1,28 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//GO(BIO_f_ssl, -//GO(BIO_new_buffer_ssl_connect, -//GO(BIO_new_ssl, -//GO(BIO_new_ssl_connect, -//GO(BIO_ssl_copy_session_id, -//GO(BIO_ssl_shutdown, +GO(BIO_f_ssl, pFv) +GO(BIO_ADDR_free, vFp) +GO(BIO_ADDR_new, pFv) +GO(BIO_get_data, pFp) +GO(BIO_get_shutdown, iFp) +GO(BIO_new_buffer_ssl_connect, pFp) +GO(BIO_new_ssl, pFpi) +GO(BIO_new_ssl_connect, pFp) +GO(BIO_meth_free, vFp) +GO(BIO_meth_new, pFip) +GOM(BIO_meth_set_create, iFEpp) +GOM(BIO_meth_set_ctrl, iFEpp) +GOM(BIO_meth_set_destroy, iFEpp) +GOM(BIO_meth_set_puts, iFEpp) +GOM(BIO_meth_set_read, iFEpp) +GOM(BIO_meth_set_write, iFEpp) +GO(BIO_set_data, vFpp) +GO(BIO_set_init, vFpi) +GO(BIO_set_shutdown, vFpi) +GO(BIO_ssl_copy_session_id, iFpp) +GO(BIO_ssl_shutdown, vFp) //GO(custom_ext_add, //GO(custom_ext_init, //GO(custom_ext_parse, @@ -56,27 +71,28 @@ GO(d2i_SSL_SESSION, pFppl) //GO(dtls1_stop_timer, //GO(dtls1_write_app_data_bytes, //GO(dtls1_write_bytes, -//GO(DTLS_client_method, +GO(DTLS_client_method, pFv) GO(DTLS_method, pFv) GO(DTLS_server_method, pFv) GO(DTLSv1_2_client_method, pFv) GO(DTLSv1_2_method, pFv) GO(DTLSv1_2_server_method, pFv) GO(DTLSv1_client_method, pFv) +GO(DTLSv1_listen, iFpp) GO(DTLSv1_method, pFv) GO(DTLSv1_server_method, pFv) -//GO(ERR_load_SSL_strings, +GO(ERR_load_SSL_strings, iFv) //GO(_fini, GO(i2d_SSL_SESSION, iFpp) //GO(_init, //GO(n_ssl3_mac, //GO(OBJ_bsearch_ssl_cipher_id, GO(OPENSSL_init_ssl, iFUp) -//GO(PEM_read_bio_SSL_SESSION, -//GO(PEM_read_SSL_SESSION, -//GO(PEM_write_bio_SSL_SESSION, -//GO(PEM_write_SSL_SESSION, -//GO(SRP_Calc_A_param, +//GOM(PEM_read_bio_SSL_SESSION, pFEpppp) +//GOM(PEM_read_SSL_SESSION, pFESppp) +GO(PEM_write_bio_SSL_SESSION, iFpp) +GO(PEM_write_SSL_SESSION, iFSp) +GO(SRP_Calc_A_param, iFp) //GO(SRP_generate_client_master_secret, //GO(SRP_generate_server_master_secret, //GO(srp_verify_server_param, @@ -183,20 +199,25 @@ GO(OPENSSL_init_ssl, iFUp) //GO(ssl3_write_bytes, //GO(ssl3_write_pending, GO(SSL_accept, iFp) +GOW(SSL_CTX_load_verify_file, iFpp) +GOW(SSL_has_pending, iFp) +GOW(SSL_set0_rbio, vFpp) +GOW(SSL_set0_wbio, vFpp) +GOW(SSL_set1_host, iFpp) //GO(ssl_add_cert_chain, GO(SSL_add_client_CA, iFpp) //GO(ssl_add_clienthello_renegotiate_ext, //GO(ssl_add_clienthello_tlsext, //GO(ssl_add_clienthello_use_srtp_ext, -//GO(SSL_add_dir_cert_subjects_to_stack, -//GO(SSL_add_file_cert_subjects_to_stack, +GO(SSL_add_dir_cert_subjects_to_stack, iFpp) +GO(SSL_add_file_cert_subjects_to_stack, iFpp) //GO(ssl_add_serverhello_renegotiate_ext, //GO(ssl_add_serverhello_tlsext, //GO(ssl_add_serverhello_use_srtp_ext, -//GO(SSL_alert_desc_string, -//GO(SSL_alert_desc_string_long, -//GO(SSL_alert_type_string, -//GO(SSL_alert_type_string_long, +GO(SSL_alert_desc_string, pFi) +GO(SSL_alert_desc_string_long, pFi) +GO(SSL_alert_type_string, pFi) +GO(SSL_alert_type_string_long, pFi) //GO(ssl_bad_method, //GO(ssl_build_cert_chain, //GO(ssl_bytes_to_cipher_list, @@ -209,7 +230,7 @@ GOM(SSL_callback_ctrl, lFEpip) //GO(ssl_cert_free, //GO(ssl_cert_inst, //GO(ssl_cert_new, -//GO(SSL_certs_clear, +GO(SSL_certs_clear, vFp) //GO(ssl_cert_select_current, //GO(ssl_cert_set0_chain, //GO(ssl_cert_set1_chain, @@ -218,7 +239,7 @@ GOM(SSL_callback_ctrl, lFEpip) //GO(ssl_cert_set_current, //GO(ssl_cert_set_default_md, //GO(ssl_cert_type, -//GO(SSL_check_chain, +GO(SSL_check_chain, iFpppp) //GO(ssl_check_clienthello_tlsext_late, GO(SSL_check_private_key, iFp) //GO(ssl_check_serverhello_tlsext, @@ -243,210 +264,220 @@ GO(SSL_clear, iFp) //GO(ssl_clear_bad_session, //GO(ssl_clear_cipher_ctx, //GO(ssl_clear_hash_ctx, -//GO(SSL_COMP_add_compression_method, +GO(SSL_COMP_add_compression_method, iFip) //GO(SSL_COMP_free_compression_methods, -//GO(SSL_COMP_get_compression_methods, -//GO(SSL_COMP_get_name, -//GO(SSL_COMP_set0_compression_methods, -//GO(SSL_CONF_cmd, -//GO(SSL_CONF_cmd_argv, -//GO(SSL_CONF_cmd_value_type, -//GO(SSL_CONF_CTX_clear_flags, -//GO(SSL_CONF_CTX_finish, -//GO(SSL_CONF_CTX_free, -//GO(SSL_CONF_CTX_new, -//GO(SSL_CONF_CTX_set1_prefix, -//GO(SSL_CONF_CTX_set_flags, -//GO(SSL_CONF_CTX_set_ssl, -//GO(SSL_CONF_CTX_set_ssl_ctx, +GO(SSL_COMP_get_compression_methods, pFv) +GO(SSL_COMP_get_name, pFp) +GO(SSL_COMP_set0_compression_methods, pFp) +GO(SSL_CONF_cmd, iFppp) +GO(SSL_CONF_cmd_argv, iFppp) +GO(SSL_CONF_cmd_value_type, iFpp) +GO(SSL_CONF_CTX_clear_flags, uFpu) +GO(SSL_CONF_CTX_finish, iFp) +GO(SSL_CONF_CTX_free, vFp) +GO(SSL_CONF_CTX_new, pFv) +GO(SSL_CONF_CTX_set1_prefix, iFpp) +GO(SSL_CONF_CTX_set_flags, uFpu) +GO(SSL_CONF_CTX_set_ssl, vFpp) +GO(SSL_CONF_CTX_set_ssl_ctx, vFpp) GO(SSL_connect, iFp) -//GO(SSL_copy_session_id, +GO(SSL_copy_session_id, iFpp) //GO(ssl_create_cipher_list, GO(SSL_ctrl, lFpilp) GO(SSL_CTX_add_client_CA, iFpp) -//GO(SSL_CTX_add_client_custom_ext, -//GO(SSL_CTX_add_server_custom_ext, -//GO(SSL_CTX_add_session, +//GOM(SSL_CTX_add_client_custom_ext, iFEpuppppp) +//GOM(SSL_CTX_add_server_custom_ext, iFEpuppppp) +GO(SSL_CTX_add_session, iFpp) GOM(SSL_CTX_callback_ctrl, lFEpip) GO(SSL_CTX_check_private_key, iFp) GO(SSL_CTX_clear_options, UFpU) GO(SSL_CTX_config, iFpp) GO(SSL_CTX_ctrl, lFpilp) -//GO(SSL_CTX_flush_sessions, +GO(SSL_CTX_flush_sessions, vFpl) GO(SSL_CTX_free, vFp) -//GO(SSL_CTX_get0_certificate, +GO(SSL_CTX_get0_certificate, pFp) GO(SSL_CTX_get0_param, pFp) -//GO(SSL_CTX_get0_privatekey, +GO(SSL_CTX_get0_privatekey, pFp) GO(SSL_CTX_get_cert_store, pFp) -//GO(SSL_CTX_get_client_CA_list, -//GO(SSL_CTX_get_client_cert_cb, +GO(SSL_CTX_get_client_CA_list, pFp) +//GOM(SSL_CTX_get_client_cert_cb, pFEp) GOM(SSL_CTX_get_default_passwd_cb, pFEp) GO(SSL_CTX_get_default_passwd_cb_userdata, pFp) GO(SSL_CTX_get_ex_data, pFpi) //GO(SSL_CTX_get_ex_new_index, -//GO(SSL_CTX_get_info_callback, +//GOM(SSL_CTX_get_info_callback, pFEp) GO(SSL_CTX_get_num_tickets, LFp) -GO(SSL_CTX_get_options, UFp) -//GO(SSL_CTX_get_quiet_shutdown, +GO(SSL_CTX_get_options, UFp) +GO(SSL_CTX_get_quiet_shutdown, iFp) GO(SSL_CTX_get_security_level, iFp) -//GO(SSL_CTX_get_ssl_method, -//GO(SSL_CTX_get_timeout, +GO(SSL_CTX_get_ssl_method, pFp) +GO(SSL_CTX_get_timeout, lFp) GOM(SSL_CTX_get_verify_callback, pFEp) -//GO(SSL_CTX_get_verify_depth, +GO(SSL_CTX_get_verify_depth, iFp) GO(SSL_CTX_get_verify_mode, iFp) +GO(SSL_CTX_load_verify_dir, iFpp) GO(SSL_CTX_load_verify_locations, iFppp) GO(SSL_CTX_new, pFp) -//GO(SSL_CTX_remove_session, -//GO(SSL_CTX_sess_get_get_cb, -//GO(SSL_CTX_sess_get_new_cb, -//GO(SSL_CTX_sess_get_remove_cb, -//GO(SSL_CTX_sessions, -//GO(SSL_CTX_sess_set_get_cb, -//GO(SSL_CTX_sess_set_new_cb, -//GO(SSL_CTX_sess_set_remove_cb, -//GO(SSL_CTX_set1_param, +GO(SSL_CTX_new_ex, pFppp) +GO(SSL_CTX_up_ref, iFp) +GO(SSL_CTX_remove_session, iFpp) +//GOM(SSL_CTX_sess_get_get_cb, pFEp) +//GOM(SSL_CTX_sess_get_new_cb, pFEp) +//GOM(SSL_CTX_sess_get_remove_cb, pFEp) +GO(SSL_CTX_sessions, pFp) +//GOM(SSL_CTX_sess_set_get_cb, vFEpp) +GOM(SSL_CTX_sess_set_new_cb, vFEpp) +//GOM(SSL_CTX_sess_set_remove_cb, vFEpp) +GO(SSL_CTX_set1_param, iFpp) GO(SSL_CTX_set_alpn_protos, iFppu) GOM(SSL_CTX_set_alpn_select_cb, vFEppp) -//GO(SSL_CTX_set_cert_cb, +//GOM(SSL_CTX_set_cert_cb, vFEppp) GO(SSL_CTX_set_cert_store, vFpp) GOM(SSL_CTX_set_cert_verify_callback, vFEppp) GO(SSL_CTX_set_ciphersuites, iFpp) GO(SSL_CTX_set_cipher_list, iFpp) GO(SSL_CTX_set_client_CA_list, vFpp) GOM(SSL_CTX_set_client_cert_cb, vFEpp) -//GO(SSL_CTX_set_client_cert_engine, -//GO(SSL_CTX_set_cookie_generate_cb, -//GO(SSL_CTX_set_cookie_verify_cb, +GO(SSL_CTX_set_client_cert_engine, iFpp) +GOM(SSL_CTX_set_cookie_generate_cb, vFEpp) +GOM(SSL_CTX_set_cookie_verify_cb, vFEpp) GOM(SSL_CTX_set_default_passwd_cb, vFEpp) GO(SSL_CTX_set_default_passwd_cb_userdata, vFpp) GO(SSL_CTX_set_default_verify_paths, iFp) -//GO(SSL_CTX_set_ex_data, -//GO(SSL_CTX_set_generate_session_id, -//GO(SSL_CTX_set_info_callback, +GO(SSL_CTX_set_default_read_buffer_len, vFpL) +GO(SSL_CTX_set_ex_data, iFpip) +//GOM(SSL_CTX_set_generate_session_id, iFEpp) +GOM(SSL_CTX_set_info_callback, vFEpp) GOM(SSL_CTX_set_keylog_callback, vFEpp) GOM(SSL_CTX_set_msg_callback, vFEpp) -//GO(SSL_CTX_set_next_protos_advertised_cb, +//GOM(SSL_CTX_set_next_protos_advertised_cb, vFEppp) GOM(SSL_CTX_set_next_proto_select_cb, vFEppp) GO(SSL_CTX_set_num_tickets, iFpL) -GO(SSL_CTX_set_options, lFpl) +GO(SSL_CTX_set_options, UFpU) GO(SSL_CTX_set_post_handshake_auth, vFpi) -//GO(SSL_CTX_set_psk_client_callback, -//GO(SSL_CTX_set_psk_server_callback, -//GO(SSL_CTX_set_purpose, +GOM(SSL_CTX_set_psk_client_callback, vFEpp) +GOM(SSL_CTX_set_psk_server_callback, vFEpp) +GO(SSL_CTX_set_purpose, iFpi) GO(SSL_CTX_set_quiet_shutdown, vFpi) GO(SSL_CTX_set_security_level, vFpi) GO(SSL_CTX_set_session_id_context, iFppu) -//GO(SSL_CTX_set_srp_cb_arg, -//GO(SSL_CTX_set_srp_client_pwd_callback, -//GO(SSL_CTX_set_srp_password, -//GO(SSL_CTX_set_srp_strength, -//GO(SSL_CTX_set_srp_username, -//GO(SSL_CTX_set_srp_username_callback, -//GO(SSL_CTX_set_srp_verify_param_callback, -//GO(SSL_CTX_set_ssl_version, -//GO(SSL_CTX_set_timeout, -//GO(SSL_CTX_set_tlsext_use_srtp, -//GO(SSL_CTX_set_tmp_dh_callback, +GO(SSL_CTX_set_srp_cb_arg, iFpp) +//GOM(SSL_CTX_set_srp_client_pwd_callback, iFEpp) +GO(SSL_CTX_set_srp_password, iFpp) +GO(SSL_CTX_set_srp_strength, iFpi) +GO(SSL_CTX_set_srp_username, iFpp) +//GOM(SSL_CTX_set_srp_username_callback, iFEpp) +//GOM(SSL_CTX_set_srp_verify_param_callback, iFEpp) +GO(SSL_CTX_set_ssl_version, iFpp) +GO(SSL_CTX_set_timeout, lFpl) +GO(SSL_CTX_set_tlsext_use_srtp, iFpp) +//GOM(SSL_CTX_set_tmp_dh_callback, vFEpp) +GO(SSL_CTX_set0_tmp_dh_pkey, iFpp) //GO(SSL_CTX_set_tmp_ecdh_callback, //GO(SSL_CTX_set_tmp_rsa_callback, -//GO(SSL_CTX_set_trust, +GO(SSL_CTX_set_trust, iFpi) GOM(SSL_CTX_set_verify, vFEpip) GO(SSL_CTX_set_verify_depth, vFpi) -//GO(SSL_CTX_SRP_CTX_free, -//GO(SSL_CTX_SRP_CTX_init, +GO(SSL_CTX_SRP_CTX_free, iFp) +GO(SSL_CTX_SRP_CTX_init, iFp) GO(SSL_CTX_use_certificate, iFpp) GO(SSL_CTX_use_certificate_ASN1, iFpip) GO(SSL_CTX_use_certificate_chain_file, iFpp) GO(SSL_CTX_use_certificate_file, iFppi) GO(SSL_CTX_use_PrivateKey, iFpp) -GO(SSL_CTX_use_PrivateKey_ASN1, iFuppi) +GO(SSL_CTX_use_PrivateKey_ASN1, iFippl) GO(SSL_CTX_use_PrivateKey_file, iFppi) -//GO(SSL_CTX_use_psk_identity_hint, +GO(SSL_CTX_use_psk_identity_hint, iFpp) GO(SSL_CTX_use_RSAPrivateKey, iFpp) GO(SSL_CTX_use_RSAPrivateKey_ASN1, iFppl) GO(SSL_CTX_use_RSAPrivateKey_file, iFppi) -//GO(SSL_CTX_use_serverinfo, -//GO(SSL_CTX_use_serverinfo_file, +GO(SSL_CTX_use_serverinfo, iFppL) +GO(SSL_CTX_use_serverinfo_file, iFpp) //GO(ssl_do_client_cert_cb, GO(SSL_do_handshake, iFp) -//GO(SSL_dup, -//GO(SSL_dup_CA_list, -//GO(SSL_export_keying_material, -//GO(SSL_extension_supported, +GO(SSL_dup, pFp) +GO(SSL_dup_CA_list, pFp) +GO(SSL_export_keying_material, iFppLpLpLi) +GO(SSL_extension_supported, iFu) //GO(ssl_fill_hello_random, GO(SSL_free, vFp) //GO(ssl_free_wbio_buffer, -GO(SSL_get0_alpn_selected, iFppp) +GO(SSL_get0_alpn_selected, vFppp) GO(SSL_get0_next_proto_negotiated, vFppp) GO(SSL_get0_param, pFp) +GO(SSL_get0_group_name, pFp) GO(SSL_get0_peer_certificate, pFp) -GO(SSL_get0_session, pFp) +GO(SSL_get0_session, pFp) // Warning: failed to confirm GO(SSL_get0_verified_chain, pFp) GO(SSL_get1_peer_certificate, pFp) GO(SSL_get1_session, pFp) //GO(ssl_get_algorithm2, GO(SSL_get_certificate, pFp) //GO(ssl_get_cipher_by_char, -//GO(SSL_get_cipher_list, +GO(SSL_get_cipher_list, pFpi) GO(SSL_get_ciphers, pFp) //GO(ssl_get_ciphers_by_id, GO(SSL_get_client_CA_list, pFp) GO(SSL_get_client_ciphers, pFp) +GO(SSL_get_client_random, LFppL) GO(SSL_get_current_cipher, pFp) GO(SSL_get_current_compression, pFp) -//GO(SSL_get_current_expansion, -//GO(SSL_get_default_timeout, +GO(SSL_get_current_expansion, pFp) +GO(SSL_get_default_timeout, lFp) GO(SSL_get_error, iFpi) +GO(SSL_get_early_data_status, iFp) GO(SSL_get_ex_data, pFpi) GO(SSL_get_ex_data_X509_STORE_CTX_idx, iFv) -GOM(SSL_get_ex_new_index, iFElpppp) -//GO(SSL_get_fd, +GOM(SSL_get_ex_new_index, iFElpppp) // Warning: failed to confirm +GO(SSL_get_fd, iFp) GO(SSL_get_finished, LFppL) //GO(ssl_get_handshake_digest, -//GO(SSL_get_info_callback, +//GOM(SSL_get_info_callback, pFEp) //GO(ssl_get_new_session, GO(SSL_get_peer_cert_chain, pFp) +GO(SSL_get_peer_signature_type_nid, iFp) GO(SSL_get_peer_finished, LFppL) //GO(ssl_get_prev_session, GO(SSL_get_privatekey, pFp) -//GO(SSL_get_psk_identity, -//GO(SSL_get_psk_identity_hint, -//GO(SSL_get_quiet_shutdown, +GO(SSL_get_psk_identity, pFp) +GO(SSL_get_psk_identity_hint, pFp) +GO(SSL_get_quiet_shutdown, iFp) GO(SSL_get_rbio, pFp) -//GO(SSL_get_read_ahead, -//GO(SSL_get_rfd, -//GO(SSL_get_selected_srtp_profile, +GO(SSL_get_read_ahead, iFp) +GO(SSL_get_rfd, iFp) +GO(SSL_get_selected_srtp_profile, pFp) //GO(ssl_get_server_cert_serverinfo, GO(SSL_get_servername, pFpi) GO(SSL_get_servername_type, iFp) //GO(ssl_get_server_send_pkey, GO(SSL_get_session, pFp) -//GO(SSL_get_shared_ciphers, -//GO(SSL_get_shared_sigalgs, +GO(SSL_get_shared_ciphers, pFppi) +GO(SSL_get_shared_sigalgs, iFpippppp) GO(SSL_get_shutdown, iFp) -//GO(SSL_get_sigalgs, +GO(SSL_get_sigalgs, iFpippppp) //GO(ssl_get_sign_pkey, -//GO(SSL_get_srp_g, -//GO(SSL_get_srp_N, -//GO(SSL_get_srp_userinfo, -//GO(SSL_get_srp_username, -//GO(SSL_get_srtp_profiles, +GO(SSL_get_srp_g, pFp) +GO(SSL_get_srp_N, pFp) +GO(SSL_get_srp_userinfo, pFp) +GO(SSL_get_srp_username, pFp) +GO(SSL_get_srtp_profiles, pFp) GO(SSL_get_SSL_CTX, pFp) -//GO(SSL_get_ssl_method, +GO(SSL_get_ssl_method, pFp) GOM(SSL_get_verify_callback, pFEp) GO(SSL_get_verify_depth, iFp) GO(SSL_get_verify_mode, iFp) -GO(SSL_get_verify_result, iFp) +GO(SSL_get_verify_result, lFp) GO(SSL_get_version, pFp) GO(SSL_get_wbio, pFp) -//GO(SSL_get_wfd, -//GO(SSL_has_matching_session_id, +GO(SSL_get_wfd, iFp) +GO(SSL_has_matching_session_id, iFppu) +GO(SSL_in_init, iFp) //GO(ssl_init_wbio_buffer, GO(SSL_is_init_finished, iFp) GO(SSL_is_server, iFp) GO(SSL_library_init, iFv) //GO(ssl_load_ciphers, -//GO(SSL_load_client_CA_file, +GO(SSL_load_client_CA_file, pFp) GO(SSL_load_error_strings, vFv) GO(SSL_new, pFp) //GO(ssl_ok, @@ -466,84 +497,90 @@ GO(SSL_renegotiate, iFp) GO(SSL_renegotiate_abbreviated, iFp) GO(SSL_renegotiate_pending, iFp) //GO(ssl_replace_hash, -//GO(SSL_rstate_string, -//GO(SSL_rstate_string_long, +GO(SSL_rstate_string, pFp) +GO(SSL_rstate_string_long, pFp) GO(SSL_select_next_proto, iFpppupu) //GO(ssl_sess_cert_free, //GO(ssl_sess_cert_new, GO(ssl_session_dup, pFp) GO(SSL_SESSION_dup, pFp) GO(SSL_SESSION_free, vFp) -//GO(SSL_SESSION_get0_peer, -//GO(SSL_SESSION_get_compress_id, -//GO(SSL_SESSION_get_ex_data, +GO(SSL_SESSION_get0_peer, pFp) +GO(SSL_SESSION_get_compress_id, uFp) +GO(SSL_SESSION_get_ex_data, pFpi) //GO(SSL_SESSION_get_ex_new_index, GO(SSL_SESSION_get_id, pFpp) +GO(SSL_SESSION_get_master_key, LFppL) +GO(SSL_SESSION_get_max_early_data, uFp) GO(SSL_SESSION_get_ticket_lifetime_hint, LFp) GO(SSL_SESSION_get_time, lFp) GO(SSL_SESSION_get_timeout, lFp) +GO(SSL_SESSION_get_time_ex, LFp) GO(SSL_SESSION_has_ticket, iFp) +GO(SSL_SESSION_is_resumable, iFp) GO(SSL_SESSION_new, pFv) -//GO(SSL_SESSION_print, -//GO(SSL_SESSION_print_fp, +GO(SSL_SESSION_print, iFpp) +GO(SSL_SESSION_print_fp, iFSp) GO(SSL_session_reused, iFp) -//GO(SSL_SESSION_set1_id_context, -//GO(SSL_SESSION_set_ex_data, -//GO(SSL_SESSION_set_time, -//GO(SSL_SESSION_set_timeout, +GO(SSL_SESSION_set1_id_context, iFppu) +GO(SSL_SESSION_set_ex_data, iFpip) +GO(SSL_SESSION_set_time, lFpl) +GO(SSL_SESSION_set_timeout, lFpl) GO(SSL_SESSION_up_ref, iFp) -//GO(SSL_set1_param, +GO(SSL_set1_param, iFpp) GO(SSL_set_accept_state, vFp) -//GO(SSL_set_alpn_protos, +GO(SSL_set_alpn_protos, iFppu) GO(SSL_set_bio, vFppp) -//GO(SSL_set_cert_cb, +//GOM(SSL_set_cert_cb, vFEppp) //GO(ssl_set_cert_masks, GO(SSL_set_cipher_list, iFpp) +GO(SSL_set_ciphersuites, iFpp) GO(SSL_set_client_CA_list, vFpp) //GO(ssl_set_client_disabled, GO(SSL_set_connect_state, vFp) -//GO(SSL_set_debug, +GO(SSL_set_debug, vFpi) GO(SSL_set_ex_data, iFpip) GO(SSL_set_fd, iFpi) -//GO(SSL_set_generate_session_id, -//GO(SSL_set_info_callback, +//GOM(SSL_set_generate_session_id, iFEpp) +GOM(SSL_set_info_callback, vFEpp) GOM(SSL_set_msg_callback, vFEpp) GO(SSL_set_options, UFpU) //GO(ssl_set_peer_cert_type, GO(SSL_set_post_handshake_auth, vFpi) GOM(SSL_set_psk_client_callback, vFEpp) -//GO(SSL_set_psk_server_callback, -//GO(SSL_set_purpose, +GOM(SSL_set_psk_use_session_callback, vFEpp) +GOM(SSL_set_psk_server_callback, vFEpp) +GO(SSL_set_purpose, iFpi) GO(SSL_set_quiet_shutdown, vFpi) GO(SSL_set_read_ahead, vFpi) GO(SSL_set_rfd, iFpi) GO(SSL_set_session, iFpp) -//GO(SSL_set_session_id_context, -//GO(SSL_set_session_secret_cb, -//GO(SSL_set_session_ticket_ext, -//GO(SSL_set_session_ticket_ext_cb, -GO(SSL_set_shutdown, iFp) -//GO(SSL_set_srp_server_param, -//GO(SSL_set_srp_server_param_pw, +GO(SSL_set_session_id_context, iFppu) +//GOM(SSL_set_session_secret_cb, iFEppp) +GO(SSL_set_session_ticket_ext, iFppi) +//GOM(SSL_set_session_ticket_ext_cb, iFEppp) +GO(SSL_set_shutdown, vFpi) +GO(SSL_set_srp_server_param, iFpppppp) +GO(SSL_set_srp_server_param_pw, iFpppp) GO(SSL_set_SSL_CTX, pFpp) -//GO(SSL_set_ssl_method, +GO(SSL_set_ssl_method, iFpp) //GO(SSL_set_state, -//GO(SSL_set_tlsext_use_srtp, -//GO(SSL_set_tmp_dh_callback, +GO(SSL_set_tlsext_use_srtp, iFpp) +//GOM(SSL_set_tmp_dh_callback, vFEpp) //GO(SSL_set_tmp_ecdh_callback, //GO(SSL_set_tmp_rsa_callback, -//GO(SSL_set_trust, +GO(SSL_set_trust, iFpi) GOM(SSL_set_verify, vFEpip) GO(SSL_set_verify_depth, vFpi) -//GO(SSL_set_verify_result, +GO(SSL_set_verify_result, vFpl) GO(SSL_set_wfd, iFpi) GO(SSL_shutdown, iFp) -//GO(SSL_SRP_CTX_free, -//GO(SSL_SRP_CTX_init, -//GO(SSL_srp_server_param_with_username, +GO(SSL_SRP_CTX_free, iFp) +GO(SSL_SRP_CTX_init, iFp) +GO(SSL_srp_server_param_with_username, iFpp) GO(SSL_state, iFp) -//GO(SSL_state_string, -//GO(SSL_state_string_long, +GO(SSL_state_string, pFp) +GO(SSL_state_string_long, pFp) //GO(ssl_undefined_const_function, //GO(ssl_undefined_function, //GO(ssl_undefined_void_function, @@ -552,9 +589,9 @@ GO(SSL_use_certificate, iFpp) GO(SSL_use_certificate_ASN1, iFppi) GO(SSL_use_certificate_file, iFppi) GO(SSL_use_PrivateKey, iFpp) -GO(SSL_use_PrivateKey_ASN1, iFppl) +GO(SSL_use_PrivateKey_ASN1, iFippl) GO(SSL_use_PrivateKey_file, iFppi) -//GO(SSL_use_psk_identity_hint, +GO(SSL_use_psk_identity_hint, iFpp) GO(SSL_use_RSAPrivateKey, iFpp) GO(SSL_use_RSAPrivateKey_ASN1, iFppl) GO(SSL_use_RSAPrivateKey_file, iFppi) @@ -571,9 +608,10 @@ GO(SSLv3_server_method, pFv) //GO(ssl_verify_alarm_type, //GO(ssl_verify_cert_chain, GO(SSL_version, iFp) -//GO(SSL_want, +GO(SSL_want, iFp) GO(SSL_write, iFppi) GO(SSL_write_ex, iFppLp) +GO(SSL_write_early_data, iFppLp) //GO(tls12_check_peer_sigalg, //GO(tls12_get_hash, //GO(tls12_get_psigalgs, diff --git a/src/wrapped/wrappedlibssl_private.h b/src/wrapped/wrappedlibssl_private.h index fa2a083..5ccfa66 100644 --- a/src/wrapped/wrappedlibssl_private.h +++ b/src/wrapped/wrappedlibssl_private.h @@ -184,6 +184,11 @@ GO(OPENSSL_init_ssl, iFUp) //GO(ssl3_write_bytes, //GO(ssl3_write_pending, GO(SSL_accept, iFp) +GOW(SSL_CTX_load_verify_file, iFpp) +GOW(SSL_has_pending, iFp) +GOW(SSL_set0_rbio, vFpp) +GOW(SSL_set0_wbio, vFpp) +GOW(SSL_set1_host, iFpp) //GO(ssl_add_cert_chain, GO(SSL_add_client_CA, iFpp) //GO(ssl_add_clienthello_renegotiate_ext, @@ -430,7 +435,7 @@ GO(SSL_get_version, pFp) //GO(SSL_get_wfd, //GO(SSL_has_matching_session_id, //GO(ssl_init_wbio_buffer, -GO(SSL_in_init, iFP) +GO(SSL_in_init, iFp) GO(SSL_is_init_finished, iFp) GO(SSL_is_server, iFp) GO(SSL_library_init, iFv) diff --git a/src/wrapped/wrappedlibtasn1_private.h b/src/wrapped/wrappedlibtasn1_private.h index 392bf5a..8ab7110 100644 --- a/src/wrapped/wrappedlibtasn1_private.h +++ b/src/wrapped/wrappedlibtasn1_private.h @@ -1,46 +1,46 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -error Meh... +#error Meh... #endif GO(asn1_array2tree, iFppp) -GO(asn1_bit_der, iFpppp) +GO(asn1_bit_der, vFpipp) GO(asn1_check_version, pFp) -//GO(asn1_copy_node, -//GO(asn1_create_element, -GO(asn1_decode_simple_ber, iFpLp) -GO(asn1_decode_simple_der, iFpLp) -GO(asn1_delete_element, iFp) +GO(asn1_copy_node, iFpppp) +GO(asn1_create_element, iFppp) +GO(asn1_decode_simple_ber, iFupuppp) +GO(asn1_decode_simple_der, iFupupp) +GO(asn1_delete_element, iFpp) GO(asn1_delete_structure, iFp) -GO(asn1_delete_structure2, iFpp) -//GO(asn1_der_coding, +GO(asn1_delete_structure2, iFpu) +GO(asn1_der_coding, iFppppp) GO(asn1_der_decoding, iFppip) -GO(asn1_der_decoding2, iFppip) -GO(asn1_der_decoding_element, iFppip) +GO(asn1_der_decoding2, iFpppup) +GO(asn1_der_decoding_element, iFpppip) GO(asn1_der_decoding_startEnd, iFppippp) -//GO(asn1_dup_node, -GO(asn1_encode_simple_der, iFppppp) -//GO(asn1_expand_any_defined_by, -//GO(asn1_expand_octet_string, -//GO(asn1_find_node, -GO(asn1_find_structure_from_oid, iFpp) -//GO(asn1_get_bit_der, -GO(asn1_get_length_ber, iFpip) -GO(asn1_get_length_der, iFpip) -//GO(asn1_get_object_id_der, -//GO(asn1_get_octet_der, -//GO(asn1_get_tag_der, -//GO(asn1_length_der, -//GO(asn1_number_of_elements, -GO(asn1_object_id_der, iFppp) -GO(asn1_octet_der, iFpipp) -//GO(asn1_parser2array, -//GO(asn1_parser2tree, -GO(asn1_perror, vFpi) -//GO(asn1_print_structure, -//GO(asn1_read_node_value, -GO(asn1_read_tag, iFpip) -//GO(asn1_read_value, -//GO(asn1_read_value_type, +GO(asn1_dup_node, pFpp) +GO(asn1_encode_simple_der, iFupupp) +GO(asn1_expand_any_defined_by, iFpp) +GO(asn1_expand_octet_string, iFpppp) +GO(asn1_find_node, pFpp) +GO(asn1_find_structure_from_oid, pFpp) +GO(asn1_get_bit_der, iFpippip) +GO(asn1_get_length_ber, lFpip) +GO(asn1_get_length_der, lFpip) +GO(asn1_get_object_id_der, iFpippi) +GO(asn1_get_octet_der, iFpippip) +GO(asn1_get_tag_der, iFpippp) +GO(asn1_length_der, vFLpp) +GO(asn1_number_of_elements, iFppp) +GO(asn1_object_id_der, iFpppu) +GO(asn1_octet_der, vFpipp) +GO(asn1_parser2array, iFpppp) +GO(asn1_parser2tree, iFppp) +GO(asn1_perror, vFi) +GO(asn1_print_structure, vFSppi) +GO(asn1_read_node_value, iFpp) +GO(asn1_read_tag, iFpppp) +GO(asn1_read_value, iFpppp) +GO(asn1_read_value_type, iFppppp) GO(asn1_strerror, pFi) -//GO(asn1_write_value, +GO(asn1_write_value, iFpppi) diff --git a/src/wrapped/wrappedlibtiff5.c b/src/wrapped/wrappedlibtiff5.c new file mode 100644 index 0000000..7c1185a --- /dev/null +++ b/src/wrapped/wrappedlibtiff5.c @@ -0,0 +1,21 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" + +const char* libtiff5Name = "libtiff.so.5"; +#define LIBNAME libtiff5 + +#include "generated/wrappedlibtiff5types.h" + +// Insert code here + +#include "wrappedlib_init.h" \ No newline at end of file diff --git a/src/wrapped/wrappedlibtiff5_private.h b/src/wrapped/wrappedlibtiff5_private.h new file mode 100644 index 0000000..e3e95ab --- /dev/null +++ b/src/wrapped/wrappedlibtiff5_private.h @@ -0,0 +1,147 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh.... +#endif + +// GO(TIFFGetFieldDefaulted +// GO(TIFFSetField +// GO(TIFFReadEncodedStrip +// GO(TIFFTileSize +// GO(TIFFWarningExt +// GO(TIFFGetTagListCount +// GO(TIFFWriteCheck +// GO(TIFFReadRawTile +// GO(TIFFCurrentStrip +// GO(TIFFFieldTag +// GO(TIFFCurrentDirOffset +// GO(TIFFSetClientInfo +// GO(TIFFJPEGIsFullStripRequired +// GO(TIFFGetSeekProc +// GO(TIFFGetStrileOffset +// GO(TIFFReadTile +// GO(TIFFCurrentRow +// GO(TIFFSwabArrayOfDouble +// GO(TIFFFlushData1 +// GO(TIFFGetReadProc +// GO(TIFFInitPackBits +// GO(TIFFComputeStrip +// GO(TIFFInitZIP +// GO(TIFFErrorExt +GO(TIFFSwabLong8, vFp) +GO(TIFFSwabLong, vFp) +// GO(TIFFCreateDirectory +// GO(TIFFPredictorInit +// GO(TIFFPredictorCleanup +// GO(TIFFUnRegisterCODEC +// GO(TIFFFlushData +// GO(TIFFRGBAImageEnd +// GO(TIFFInitSGILog +// GO(TIFFGetTagListEntry +// GO(TIFFWriteEncodedStrip +GO(TIFFClose, vFp) +// GO(TIFFIsBigEndian +// GO(TIFFSwabDouble +// GO(TIFFReadRGBAStripExt +// GO(TIFFLastDirectory +// GO(TIFFInitCCITTRLE +// GO(TIFFSetWriteOffset +// GO(TIFFFieldName +// GO(TIFFFileName +// GO(TIFFScanlineSize +// GO(TIFFDataWidth +// GO(TIFFIsByteSwapped +// GO(TIFFReadBufferSetup +GO(TIFFCIELabToXYZ, vFpuiippp) +// GO(TIFFReadDirectory +// GO(TIFFFieldDataType +// GO(TIFFSetErrorHandlerExt +GO(TIFFIsCODECConfigured, iFW) +// GO(TIFFFaxMainTable +// GO(TIFFReadEXIFDirectory +// GO(TIFFAccessTagMethods +// GO(TIFFGetMapFileProc +// GO(TIFFSetErrorHandler +// GO(TIFFCheckpointDirectory +// GO(TIFFSetClientdata +// GO(TIFFGetVersion +// GO(TIFFWriteRawStrip +// GO(TIFFInitCCITTFax3 +// GO(TIFFInitCCITTFax4 +// GO(TIFFWriteEncodedTile +// GO(TIFFFieldPassCount +// GO(TIFFReadRGBAImageOriented +// GO(TIFFRGBAImageBegin +// GO(TIFFTileRowSize64 +// GO(TIFFRasterScanlineSize +// GO(TIFFSetWarningHandlerExt +// GO(TIFFInitLZW +// GO(TIFFWriteTile +GO(TIFFYCbCrtoRGB, vFpuiippp) +// GO(TIFFSetMode +// GO(TIFFRasterScanlineSize64 +// GO(TIFFSwabArrayOfFloat +// GO(TIFFRGBAImageGet +// GO(TIFFVStripSize +// GO(TIFFDefaultTileSize +// GO(TIFFSetFileno +// GO(TIFFGetSizeProc +// GO(TIFFIsUpSampled +// GO(TIFFGetClientInfo +// GO(TIFFDefaultDirectory +// GO(TIFFGetBitRevTable +// GO(TIFFError +// GO(TIFFGetStrileByteCount +// GO(TIFFSetDirectory +// GO(TIFFGetStrileByteCountWithErr +// GO(TIFFFieldWithName +// GO(TIFFRGBAImageOK +GO(TIFFGetConfiguredCODECs, pFW) +// GO(TIFFTileRowSize +// GO(TIFFCreateEXIFDirectory +// GO(TIFFInitJBIG +GO(TIFFXYZToRGB, vFpfffppp) +// GO(TIFFFillTile +// GO(TIFFInitZSTD +// GO(TIFFWriteScanline +// GO(TIFFCreateCustomDirectory +// GO(TIFFVGetFieldDefaulted +// GO(TIFFSetTagExtender +// GO(TIFFStripSize64 +// GO(TIFFCurrentDirectory +// GO(TIFFReadRawStrip +// GO(TIFFNumberOfStrips +// GO(TIFFSetupStrips +// GO(TIFFIsMSB2LSB +// GO(TIFFSwabFloat +// GO(TIFFReadRGBAImage +GO(TIFFFreeDirectory, iFp) +GO(TIFFCleanup, vFp) +GO(TIFFFlush, iFp) +GO(TIFFSetCompressionScheme, iFpi) +GO(TIFFSwabShort, vFp) +// GO(TIFFInitNeXT +// GO(TIFFInitDumpMode +// GO(TIFFSwabArrayOfLong8 +// GO(TIFFWriteCustomDirectory +// GO(TIFFReverseBits +// GO(TIFFInitWebP +// GO(TIFFCheckTile +// GO(TIFFVGetField +// GO(TIFFTileSize64 +// GO(TIFFReadRGBATileExt +// GO(TIFFVTileSize64 +// GO(TIFFVSetField +// GO(TIFFDefaultStripSize +// GO(TIFFInitJPEG +// GO(TIFFOpen +// GO(TIFFFaxWhiteCodes +// GO(TIFFUnsetField +// GO(TIFFVTileSize +// GO(TIFFRawStripSize +// GO(TIFFDeferStrileArrayWriting +// GO(TIFFStripSize +GO(TIFFCIELabToRGBInit, iFppp) +// GO(TIFFComputeTile +// GO(TIFFGetField +// GO(TIFFFaxWhiteTable +// GO(TIFFGetUnmapFileProc +// GO(TIFFFillStrip diff --git a/src/wrapped/wrappedlibtinfo6.c b/src/wrapped/wrappedlibtinfo6.c index 034b75e..cd27a73 100644 --- a/src/wrapped/wrappedlibtinfo6.c +++ b/src/wrapped/wrappedlibtinfo6.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "wrappedlibs.h" @@ -14,9 +15,10 @@ #include "emu/x64emu_private.h" #include "callback.h" #include "librarian.h" +#include "library.h" #include "box64context.h" -#include "emu/x64emu_private.h" #include "myalign.h" +#include "globalsymbols.h" const char* libtinfo6Name = "libtinfo.so.6"; #define LIBNAME libtinfo6 @@ -64,6 +66,82 @@ EXPORT int my6_tputs(x64emu_t* emu, void* str, int affcnt, void* f) return my->tputs(str, affcnt, find_putc_Fct(f)); } +EXPORT void* my6__nc_tiparm(x64emu_t* emu, int expected, void* fmt, void* b){ + CREATE_VALIST_FROM_VAARG(b, emu->scratch, 2); + long args[9] = {0}; + int n = expected; + if(n > 9) { + printf_log(LOG_NONE, "Warning: my6__nc_tiparm with %d parameters not handled\n", n); + return NULL; + } + for(int i = 0; i < n; ++i) args[i] = va_arg(VARARGS, long); + switch(n) { + case 0: return my->_nc_tiparm(expected, fmt); + case 1: return my->_nc_tiparm(expected, fmt, args[0]); + case 2: return my->_nc_tiparm(expected, fmt, args[0], args[1]); + case 3: return my->_nc_tiparm(expected, fmt, args[0], args[1], args[2]); + case 4: return my->_nc_tiparm(expected, fmt, args[0], args[1], args[2], args[3]); + case 5: return my->_nc_tiparm(expected, fmt, args[0], args[1], args[2], args[3], args[4]); + case 6: return my->_nc_tiparm(expected, fmt, args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return my->_nc_tiparm(expected, fmt, args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + case 8: return my->_nc_tiparm(expected, fmt, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]); + case 9: return my->_nc_tiparm(expected, fmt, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]); + } + return NULL; +} + +// ncurses exports cur_term as a global; we forward it through globalsymbols. +extern void* cur_term; + +// Refresh cur_term to the current native TERMINAL* and sync global mirrors. +static void update_shadow_from_native(void){ + void* native = NULL; + if(!native && my && my->set_curterm) { + // use set_curterm(NULL) to retrieve current native TERMINAL* + void* old = my->set_curterm(NULL); + if(old) { + my->set_curterm(old); + native = old; + printf_log(LOG_DEBUG, "tinfo cur_term: fetched via set_curterm native=%p\n", native); + } + } + if(!native) { + cur_term = NULL; + return; + } + cur_term = native; + printf_log(LOG_DEBUG, "tinfo cur_term: native=%p\n", native); + my_checkGlobalTInfo(); +} + +EXPORT int my6_setupterm(x64emu_t* emu, void* term, int fd, void* err) +{ + my_updateGlobalTInfo(); + printf_log(LOG_DEBUG, "my6_setupterm tinfo cur_term: after updateGlobal cur_term=%p\n", cur_term); + int ret = my->setupterm(term, fd, err); + // setupterm may replace cur_term, so refresh after the call. + update_shadow_from_native(); + return ret; +} + +EXPORT void* my6_set_curterm(x64emu_t* emu, void* term) +{ + my_updateGlobalTInfo(); + printf_log(LOG_DEBUG, "my6_set_curterm tinfo cur_term: after updateGlobal cur_term=%p\n", cur_term); + // set_curterm returns the previous native TERMINAL*. + void* old_native = my->set_curterm(term); + update_shadow_from_native(); + return old_native; +} + +EXPORT int my6_del_curterm(x64emu_t* emu, void* term) +{ + // del_curterm may clear cur_term; resync afterwards. + int ret = my->del_curterm(term); + update_shadow_from_native(); + return ret; +} + #define ALTMY my6_ #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibtinfo6_private.h b/src/wrapped/wrappedlibtinfo6_private.h index 41ec64f..acbbc7c 100644 --- a/src/wrapped/wrappedlibtinfo6_private.h +++ b/src/wrapped/wrappedlibtinfo6_private.h @@ -10,7 +10,7 @@ GO(define_key, iFpi) GO(def_prog_mode, iFv) GO(def_shell_mode, iFv) GO(delay_output, iFi) -GO(del_curterm, iFp) +GOM(del_curterm, iFEp) GO(erasechar, cFv) GO(flushinp, iFv) GO(halfdelay, iFi) @@ -29,10 +29,13 @@ GO(killchar, cFv) GO(longname, pFv) GO(meta, iFpi) GO(napms, iFi) +GO(_nc_basename, pFp) +GO(_nc_is_abs_path, iFp) +GO(_nc_rootname, pFp) +GOM(_nc_tiparm, pFEipV) //GO(_nc_access, //GO(_nc_add_to_try, //GO(_nc_align_termtype, -//GO(_nc_basename, //GO(_nc_baudrate, //GO(_nc_copy_termtype, //GO(_nc_delink_entry, @@ -63,7 +66,6 @@ GO(napms, iFi) //GO(_nc_home_terminfo, //GO(_nc_init_acs, //GO(_nc_init_keytry, -//GO(_nc_is_abs_path, //GO(_nc_is_dir_path, //GO(_nc_is_file_path, //GO(_nc_keep_tic_dir, @@ -85,7 +87,6 @@ GO(napms, iFi) //GO(_nc_read_termtype, //GO(_nc_remove_key, //GO(_nc_remove_string, -//GO(_nc_rootname, //GO(_nc_safe_strcat, //GO(_nc_safe_strcpy, //GO(_nc_screen_of, @@ -124,9 +125,9 @@ GO(reset_prog_mode, iFv) GO(reset_shell_mode, iFv) GO(resetty, iFv) GO(savetty, iFv) -GO(set_curterm, pFp) +GOM(set_curterm, pFEp) GO(set_tabsize, iFi) -GO(setupterm, iFpip) +GOM(setupterm, iFEpip) GO(termname, pFv) GO(tgetent, iFpp) GO(tgetflag, iFp) @@ -143,6 +144,7 @@ GO(typeahead, iFi) GO(unctrl, pFL) GO(use_env, vFi) GO(use_extended_names, iFi) +GO(use_tioctl, vFi) GO(wtimeout, vFpi) DATA(COLS, sizeof(int)) @@ -151,9 +153,10 @@ DATA(TABSIZE, sizeof(int)) DATA(curscr, sizeof(void*)) DATA(newscr, sizeof(void*)) DATA(stdscr, sizeof(void*)) -DATA(acs_map, 128*sizeof(void*)) +DATA(acs_map, 64*sizeof(void*)) DATA(UP, sizeof(void*)) DATA(BC, sizeof(void*)) DATA(PC, 1) DATA(ospeed, 2) -DATA(ttytype, sizeof(void*)) +DATA(ttytype, 32*sizeof(void*)) +DATA(cur_term, sizeof(void*)) diff --git a/src/wrapped/wrappedlibtinfo_private.h b/src/wrapped/wrappedlibtinfo_private.h index 41ec64f..1c1bfbe 100644 --- a/src/wrapped/wrappedlibtinfo_private.h +++ b/src/wrapped/wrappedlibtinfo_private.h @@ -151,9 +151,9 @@ DATA(TABSIZE, sizeof(int)) DATA(curscr, sizeof(void*)) DATA(newscr, sizeof(void*)) DATA(stdscr, sizeof(void*)) -DATA(acs_map, 128*sizeof(void*)) +DATA(acs_map, 64*sizeof(void*)) DATA(UP, sizeof(void*)) DATA(BC, sizeof(void*)) DATA(PC, 1) DATA(ospeed, 2) -DATA(ttytype, sizeof(void*)) +DATA(ttytype, 32*sizeof(void*)) diff --git a/src/wrapped/wrappedlibunistring2.c b/src/wrapped/wrappedlibunistring2.c index c444d96..0df1f27 100644 --- a/src/wrapped/wrappedlibunistring2.c +++ b/src/wrapped/wrappedlibunistring2.c @@ -12,6 +12,7 @@ #include "x64emu.h" const char* libunistring2Name = "libunistring.so.2"; +#define ALTNAME "libunistring.so" #define LIBNAME libunistring2 #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibunistring2_private.h b/src/wrapped/wrappedlibunistring2_private.h index 7896105..a69b308 100644 --- a/src/wrapped/wrappedlibunistring2_private.h +++ b/src/wrapped/wrappedlibunistring2_private.h @@ -1,43 +1,717 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -error Meh... +#error Meh... #endif -GO(uninorm_nfc, pFpipp) -GO(uninorm_nfkc, pFpipp) -GO(uc_is_property_join_control, iFu) -GO(u8_check, pFpi) -GO(u16_normalize, iFpipiii) -DATA(UC_CATEGORY_Me, 4) -DATA(UC_CATEGORY_Lo, 4) -DATA(UC_CATEGORY_Pc, 4) -DATA(UC_CATEGORY_Ps, 4) -DATA(UC_CATEGORY_Lm, 4) -DATA(UC_CATEGORY_Sm, 4) -DATA(UC_CATEGORY_Pf, 4) -DATA(UC_CATEGORY_Mc, 4) -DATA(UC_CATEGORY_Lu, 4) -DATA(UC_CATEGORY_Nd, 4) -DATA(UC_CATEGORY_Po, 4) -DATA(UC_CATEGORY_Zs, 4) -DATA(UC_CATEGORY_Nl, 4) -DATA(UC_CATEGORY_Sc, 4) -DATA(UC_CATEGORY_Pe, 4) -DATA(UC_CATEGORY_Pi, 4) -DATA(UC_CATEGORY_Cc, 4) -DATA(UC_CATEGORY_So, 4) -DATA(UC_CATEGORY_Sk, 4) -DATA(UC_CATEGORY_Mn, 4) -DATA(UC_CATEGORY_Lt, 4) -DATA(UC_CATEGORY_Ll, 4) -DATA(UC_CATEGORY_No, 4) -DATA(UC_CATEGORY_Pd, 4) -GO(u32_to_u8, pFpip) -GO(u8_to_u16, pFpip) -GO(uc_general_category_and_not, iFuLL) -GO(uc_general_category_or, iFuL) -GO(uc_is_property_not_a_character, iFuL) -GO(u32_normalize, iFpipi) +//GO(libunistring_amemxfrm, +//GO(libunistring_c_isalnum, +//GO(libunistring_c_isalpha, +//GO(libunistring_c_isascii, +//GO(libunistring_c_isblank, +//GO(libunistring_c_iscntrl, +//GO(libunistring_c_isdigit, +//GO(libunistring_c_isgraph, +//GO(libunistring_c_islower, +//GO(libunistring_c_isprint, +//GO(libunistring_c_ispunct, +//GO(libunistring_c_isspace, +//GO(libunistring_c_isupper, +//GO(libunistring_c_isxdigit, +//GO(libunistring_c_strcasecmp, +//GO(libunistring_c_strncasecmp, +//GO(libunistring_c_tolower, +//GO(libunistring_c_toupper, +//GO(libunistring_freea, +//GO(libunistring_fseterr, +//GO(libunistring_gl_locale_name, +//GO(libunistring_gl_locale_name_default, +//GO(libunistring_gl_locale_name_environ, +//GO(libunistring_gl_locale_name_posix, +//GO(libunistring_gl_locale_name_thread, +//GO(libunistring_glthread_once_multithreaded, +//GO(libunistring_glthread_once_singlethreaded, +//GO(libunistring_glthread_recursive_lock_init_multithreaded, +//GO(libunistring_glthread_rwlock_init_for_glibc, +//GO(libunistring_gl_unicase_special_lookup, +//DATAR(libunistring_gl_uninorm_decomp_chars_table, +//DATAR(libunistring_gl_uninorm_decomp_index_table, +//GO(libunistring_gl_uninorm_decompose_merge_sort_inplace, +//GO(libunistring_hard_locale, +//GO(libunistring_iconveh_close, +//GO(libunistring_iconveh_open, +//GO(libunistring_is_basic, +//DATAR(libunistring_is_basic_table, +//GO(libunistring_mb_copy, +//GO(libunistring_mbiter_multi_copy, +//GO(libunistring_mbiter_multi_next, +//GO(libunistring_mbiter_multi_reloc, +//GO(libunistring_mbsnlen, +//GO(libunistring_mb_width_aux, +//GO(libunistring_mem_cd_iconveh, +//GO(libunistring_memcmp2, +//GO(libunistring_mem_iconveh, +//GO(libunistring_mem_iconveha, +//GO(libunistring_mmalloca, +//GO(libunistring_printf_frexp, +//GO(libunistring_printf_frexpl, +//GO(libunistring_rpl_mbrtowc, +//GO(libunistring_setlocale_null, +//GO(libunistring_setlocale_null_r, +//GO(libunistring_str_cd_iconveh, +//GO(libunistring_str_iconveh, +//GO(libunistring_str_iconveha, +//GO(libunistring_u16_casemap, +//GO(libunistring_u16_is_invariant, +//GO(libunistring_u16_possible_linebreaks_loop, +//GO(libunistring_u16_printf_parse, +//GO(libunistring_u32_casemap, +//GO(libunistring_u32_is_invariant, +//GO(libunistring_u32_possible_linebreaks_loop, +//GO(libunistring_u32_printf_parse, +//GO(libunistring_u8_casemap, +//GO(libunistring_u8_is_invariant, +//GO(libunistring_u8_possible_linebreaks_loop, +//GO(libunistring_u8_printf_parse, +//GO(libunistring_u8_width_linebreaks_internal, +//GO(libunistring_uc_compat_decomposition, +//GO(libunistring_uc_is_cased, +//GO(libunistring_uc_is_case_ignorable, +//GO(libunistring_uc_tocasefold, +//GO(libunistring_ulc_printf_parse, +//GO(libunistring_uniconv_register_autodetect, +//GO(libunistring_unilbrk_is_all_ascii, +//GO(libunistring_unilbrk_is_utf8_encoding, +//DATAR(libunistring_unilbrkprop, +//DATAR(libunistring_unilbrk_table, +//DATAR(libunistring_uniwbrk_prop_index, +//DATAR(libunistring_uniwbrk_table, +//GO(libunistring_u_printf_fetchargs, +//DATAR(_libunistring_version, +//GO(libunistring_xmax, +//GO(libunistring_xsum, +//GO(libunistring_xsum3, +//GO(libunistring_xsum4, +GO(locale_charset, pFv) +//GO(u16_asnprintf, +//GO(u16_asprintf, +GO(u16_casecmp, iFpLpLppp) +GO(u16_casecoll, iFpLpLppp) +GO(u16_casefold, pFpLpppp) +GO(u16_casexfrm, pFpLpppp) +GO(u16_casing_prefix_context, UFpL) +//GO(u16_casing_prefixes_context, +GO(u16_casing_suffix_context, UFpL) +//GO(u16_casing_suffixes_context, +GO(u16_check, pFpL) +GO(u16_chr, pFpLu) +GO(u16_cmp, iFppL) +GO(u16_cmp2, iFpLpL) +GO(u16_conv_from_encoding, pFpupLppp) +GO(u16_conv_to_encoding, pFpupLppp) +GO(u16_cpy, pFppL) +GO(u16_cpy_alloc, pFpL) +//GO(u16_ct_casefold, +//GO(u16_ct_tolower, +//GO(u16_ct_totitle, +//GO(u16_ct_toupper, +GO(u16_endswith, iFpp) +GO(u16_grapheme_breaks, vFpLp) +GO(u16_grapheme_next, pFpp) +GO(u16_grapheme_prev, pFpp) +GO(u16_is_cased, iFpLpp) +GO(u16_is_casefolded, iFpLpp) +GO(u16_is_lowercase, iFpLpp) +GO(u16_is_titlecase, iFpLpp) +GO(u16_is_uppercase, iFpLpp) +GO(u16_mblen, iFpL) +GO(u16_mbsnlen, LFpL) +GO(u16_mbtouc, iFppL) +//GO(u16_mbtouc_aux, +GO(u16_mbtoucr, iFppL) +GO(u16_mbtouc_unsafe, iFppL) +//GO(u16_mbtouc_unsafe_aux, +GO(u16_move, pFppL) +GO(u16_next, pFpp) +GO(u16_normalize, pFppLpp) +GO(u16_normcmp, iFpLpLpp) +GO(u16_normcoll, iFpLpLpp) +GO(u16_normxfrm, pFpLppp) +GO(u16_possible_linebreaks, vFpLpp) +GO(u16_possible_linebreaks_v2, vFpLpp) +GO(u16_prev, pFppp) +GO(u16_set, pFpuL) +//GO(u16_snprintf, +//GO(u16_sprintf, +GO(u16_startswith, iFpp) +GO(u16_stpcpy, pFpp) +GO(u16_stpncpy, pFppL) +GO(u16_strcat, pFpp) +GO(u16_strchr, pFpu) +GO(u16_strcmp, iFpp) +GO(u16_strcoll, iFpp) +GO(u16_strconv_from_encoding, pFppu) +GO(u16_strconv_from_locale, pFp) +GO(u16_strconv_to_encoding, pFppu) +GO(u16_strconv_to_locale, pFp) +GO(u16_strcpy, pFpp) +GO(u16_strcspn, LFpp) +GO(u16_strdup, pFp) +GO(u16_strlen, LFp) +GO(u16_strmblen, iFp) +GO(u16_strmbtouc, iFpp) +GO(u16_strncat, pFppL) +GO(u16_strncmp, iFppL) +GO(u16_strncpy, pFppL) +GO(u16_strnlen, LFpL) +GO(u16_strpbrk, pFpp) +GO(u16_strrchr, pFpu) +GO(u16_strspn, LFpp) +GO(u16_strstr, pFpp) +GO(u16_strtok, pFppp) +GO(u16_strwidth, iFpp) +GO(u16_tolower, pFpLpppp) +GO(u16_totitle, pFpLpppp) +GO(u16_to_u32, pFpLpp) +GO(u16_to_u8, pFpLpp) +GO(u16_toupper, pFpLpppp) +//GO(u16_u16_asnprintf, +//GO(u16_u16_asprintf, +//GO(u16_u16_snprintf, +//GO(u16_u16_sprintf, +//GO(u16_u16_vasnprintf, +//GO(u16_u16_vasprintf, +//GO(u16_u16_vsnprintf, +//GO(u16_u16_vsprintf, +GO(u16_uctomb, iFpul) +GO(u16_uctomb_aux, iFpul) +//GO(u16_vasnprintf, +//GO(u16_vasprintf, +//GO(u16_vsnprintf, +//GO(u16_vsprintf, +GO(u16_width, iFpLp) +GO(u16_width_linebreaks, iFpLiiippp) +GO(u16_width_linebreaks_v2, iFpLiiippp) +GO(u16_wordbreaks, vFpLp) +//GO(u32_asnprintf, +//GO(u32_asprintf, +GO(u32_casecmp, iFpLpLppp) +GO(u32_casecoll, iFpLpLppp) +GO(u32_casefold, pFpLpppp) +GO(u32_casexfrm, pFpLpppp) +GO(u32_casing_prefix_context, UFpL) +//GO(u32_casing_prefixes_context, +GO(u32_casing_suffix_context, UFpL) +//GO(u32_casing_suffixes_context, +GO(u32_check, pFpL) +GO(u32_chr, pFpLu) +GO(u32_cmp, iFppL) +GO(u32_cmp2, iFpLpL) +GO(u32_conv_from_encoding, pFpupLppp) +GO(u32_conv_to_encoding, pFpupLppp) +GO(u32_cpy, pFppL) +GO(u32_cpy_alloc, pFpL) +//GO(u32_ct_casefold, +//GO(u32_ct_tolower, +//GO(u32_ct_totitle, +//GO(u32_ct_toupper, +GO(u32_endswith, iFpp) +GO(u32_grapheme_breaks, vFpLp) +GO(u32_grapheme_next, pFpp) +GO(u32_grapheme_prev, pFpp) +GO(u32_is_cased, iFpLpp) +GO(u32_is_casefolded, iFpLpp) +GO(u32_is_lowercase, iFpLpp) +GO(u32_is_titlecase, iFpLpp) +GO(u32_is_uppercase, iFpLpp) +GO(u32_mblen, iFpL) +GO(u32_mbsnlen, LFpL) +GO(u32_mbtouc, iFppL) +GO(u32_mbtoucr, iFppL) +GO(u32_mbtouc_unsafe, iFppL) +GO(u32_move, pFppL) +GO(u32_next, pFpp) +GO(u32_normalize, pFppLpp) +GO(u32_normcmp, iFpLpLpp) +GO(u32_normcoll, iFpLpLpp) +GO(u32_normxfrm, pFpLppp) +GO(u32_possible_linebreaks, vFpLpp) +GO(u32_possible_linebreaks_v2, vFpLpp) +GO(u32_prev, pFppp) +GO(u32_set, pFpuL) +//GO(u32_snprintf, +//GO(u32_sprintf, +GO(u32_startswith, iFpp) +GO(u32_stpcpy, pFpp) +GO(u32_stpncpy, pFppL) +GO(u32_strcat, pFpp) +GO(u32_strchr, pFpu) +GO(u32_strcmp, iFpp) +GO(u32_strcoll, iFpp) +GO(u32_strconv_from_encoding, pFppu) +GO(u32_strconv_from_locale, pFp) +GO(u32_strconv_to_encoding, pFppu) +GO(u32_strconv_to_locale, pFp) +GO(u32_strcpy, pFpp) +GO(u32_strcspn, LFpp) +GO(u32_strdup, pFp) +GO(u32_strlen, LFp) +GO(u32_strmblen, iFp) +GO(u32_strmbtouc, iFpp) +GO(u32_strncat, pFppL) +GO(u32_strncmp, iFppL) +GO(u32_strncpy, pFppL) +GO(u32_strnlen, LFpL) +GO(u32_strpbrk, pFpp) +GO(u32_strrchr, pFpu) +GO(u32_strspn, LFpp) +GO(u32_strstr, pFpp) +GO(u32_strtok, pFppp) +GO(u32_strwidth, iFpp) +GO(u32_tolower, pFpLpppp) +GO(u32_totitle, pFpLpppp) +GO(u32_to_u16, pFpLpp) +GO(u32_to_u8, pFpLpp) +GO(u32_toupper, pFpLpppp) +//GO(u32_u32_asnprintf, +//GO(u32_u32_asprintf, +//GO(u32_u32_snprintf, +//GO(u32_u32_sprintf, +//GO(u32_u32_vasnprintf, +//GO(u32_u32_vasprintf, +//GO(u32_u32_vsnprintf, +//GO(u32_u32_vsprintf, +GO(u32_uctomb, iFpul) +//GO(u32_vasnprintf, +//GO(u32_vasprintf, +//GO(u32_vsnprintf, +//GO(u32_vsprintf, +GO(u32_width, iFpLp) +GO(u32_width_linebreaks, iFpLiiippp) +GO(u32_width_linebreaks_v2, iFpLiiippp) +GO(u32_wordbreaks, vFpLp) +//GO(u8_asnprintf, +//GO(u8_asprintf, +GO(u8_casecmp, iFpLpLppp) +GO(u8_casecoll, iFpLpLppp) +GO(u8_casefold, pFpLpppp) +GO(u8_casexfrm, pFpLpppp) +GO(u8_casing_prefix_context, UFpL) +//GO(u8_casing_prefixes_context, +GO(u8_casing_suffix_context, UFpL) +//GO(u8_casing_suffixes_context, +GO(u8_check, pFpL) +GO(u8_chr, pFpLu) +GO(u8_cmp, iFppL) +GO(u8_cmp2, iFpLpL) +GO(u8_conv_from_encoding, pFpupLppp) +GO(u8_conv_to_encoding, pFpupLppp) +GO(u8_cpy, pFppL) +GO(u8_cpy_alloc, pFpL) +//GO(u8_ct_casefold, +//GO(u8_ct_tolower, +//GO(u8_ct_totitle, +//GO(u8_ct_toupper, +GO(u8_endswith, iFpp) +GO(u8_grapheme_breaks, vFpLp) +GO(u8_grapheme_next, pFpp) +GO(u8_grapheme_prev, pFpp) +GO(u8_is_cased, iFpLpp) +GO(u8_is_casefolded, iFpLpp) +GO(u8_is_lowercase, iFpLpp) +GO(u8_is_titlecase, iFpLpp) +GO(u8_is_uppercase, iFpLpp) +GO(u8_mblen, iFpL) +GO(u8_mbsnlen, LFpL) +GO(u8_mbtouc, iFppL) +//GO(u8_mbtouc_aux, +GO(u8_mbtoucr, iFppL) +GO(u8_mbtouc_unsafe, iFppL) +//GO(u8_mbtouc_unsafe_aux, +GO(u8_move, pFppL) +GO(u8_next, pFpp) +GO(u8_normalize, pFppLpp) +GO(u8_normcmp, iFpLpLpp) +GO(u8_normcoll, iFpLpLpp) +GO(u8_normxfrm, pFpLppp) +GO(u8_possible_linebreaks, vFpLpp) +GO(u8_possible_linebreaks_v2, vFpLpp) +GO(u8_prev, pFppp) +GO(u8_set, pFpuL) +//GO(u8_snprintf, +//GO(u8_sprintf, +GO(u8_startswith, iFpp) +GO(u8_stpcpy, pFpp) +GO(u8_stpncpy, pFppL) +GO(u8_strcat, pFpp) +GO(u8_strchr, pFpu) +GO(u8_strcmp, iFpp) +GO(u8_strcoll, iFpp) +GO(u8_strconv_from_encoding, pFppu) +GO(u8_strconv_from_locale, pFp) +GO(u8_strconv_to_encoding, pFppu) +GO(u8_strconv_to_locale, pFp) +GO(u8_strcpy, pFpp) +GO(u8_strcspn, LFpp) +GO(u8_strdup, pFp) +GO(u8_strlen, LFp) +GO(u8_strmblen, iFp) +GO(u8_strmbtouc, iFpp) +GO(u8_strncat, pFppL) +GO(u8_strncmp, iFppL) +GO(u8_strncpy, pFppL) +GO(u8_strnlen, LFpL) +GO(u8_strpbrk, pFpp) +GO(u8_strrchr, pFpu) +GO(u8_strspn, LFpp) +GO(u8_strstr, pFpp) +GO(u8_strtok, pFppp) +GO(u8_strwidth, iFpp) +GO(u8_tolower, pFpLpppp) +GO(u8_totitle, pFpLpppp) +GO(u8_to_u16, pFpLpp) +GO(u8_to_u32, pFpLpp) +GO(u8_toupper, pFpLpppp) +//GO(u8_u8_asnprintf, +//GO(u8_u8_asprintf, +//GO(u8_u8_snprintf, +//GO(u8_u8_sprintf, +//GO(u8_u8_vasnprintf, +//GO(u8_u8_vasprintf, +//GO(u8_u8_vsnprintf, +//GO(u8_u8_vsprintf, +GO(u8_uctomb, iFpul) +GO(u8_uctomb_aux, iFpul) +//GO(u8_vasnprintf, +//GO(u8_vasprintf, +//GO(u8_vsnprintf, +//GO(u8_vsprintf, +GO(u8_width, iFpLp) +GO(u8_width_linebreaks, iFpLiiippp) +GO(u8_width_linebreaks_v2, iFpLiiippp) +GO(u8_wordbreaks, vFpLp) +GO(uc_all_blocks, vFpp) +GO(uc_all_scripts, vFpp) +GO(uc_bidi_category, iFu) +GO(uc_bidi_category_byname, iFp) +GO(uc_bidi_category_name, pFi) +GO(uc_bidi_class, iFu) +GO(uc_bidi_class_byname, iFp) +GO(uc_bidi_class_long_name, pFi) +GO(uc_bidi_class_name, pFi) +GO(uc_block, pFu) +GO(uc_canonical_decomposition, iFup) +DATA(UC_CATEGORY_C, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Cc, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Cf, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Cn, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Co, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Cs, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_L, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_LC, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Ll, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Lm, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Lo, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Lt, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Lu, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_M, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Mc, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Me, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Mn, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_N, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Nd, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Nl, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_No, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(_UC_CATEGORY_NONE, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_P, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Pc, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Pd, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Pe, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Pf, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Pi, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Po, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Ps, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_S, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Sc, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Sk, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Sm, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_So, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Z, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Zl, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Zp, 16) // this is a uc_general_category_t wich might contain callback functions +DATA(UC_CATEGORY_Zs, 16) // this is a uc_general_category_t wich might contain callback functions +GO(uc_c_ident_category, iFu) +GO(uc_combining_class, iFu) +GO(uc_combining_class_byname, iFp) +GO(uc_combining_class_long_name, pFi) +GO(uc_combining_class_name, pFi) +GO(uc_composition, uFuu) +GO(uc_decimal_value, iFu) +GO(uc_decomposition, iFupp) +GO(uc_digit_value, iFu) +GO(uc_general_category, HFu) +GO(uc_general_category_and, HFHH) +GO(uc_general_category_and_not, HFHH) +GO(uc_general_category_byname, HFp) +//GO(uc_general_category_long_name, +//GO(uc_general_category_name, +GO(uc_general_category_or, HFHH) +GO(uc_grapheme_breaks, vFpLp) +GO(uc_graphemeclusterbreak_property, iFu) +GO(uc_is_alnum, iFu) +GO(uc_is_alpha, iFu) +GO(uc_is_bidi_category, iFui) +GO(uc_is_bidi_class, iFui) +GO(uc_is_blank, iFu) +GO(uc_is_block, iFup) +GO(uc_is_cntrl, iFu) +GO(uc_is_c_whitespace, iFu) +GO(uc_is_digit, iFu) +GO(uc_is_general_category, iFupp) // using pp instead of H here +GO(uc_is_general_category_withtable, iFuu) +GO(uc_is_graph, iFu) +GO(uc_is_grapheme_break, iFuu) +GO(uc_is_java_whitespace, iFu) +GO(uc_is_lower, iFu) +GO(uc_is_print, iFu) +//GOM(uc_is_property, iFEup) +GO(uc_is_property_alphabetic, iFu) +GO(uc_is_property_ascii_hex_digit, iFu) +GO(uc_is_property_bidi_arabic_digit, iFu) +GO(uc_is_property_bidi_arabic_right_to_left, iFu) +GO(uc_is_property_bidi_block_separator, iFu) +GO(uc_is_property_bidi_boundary_neutral, iFu) +GO(uc_is_property_bidi_common_separator, iFu) +GO(uc_is_property_bidi_control, iFu) +GO(uc_is_property_bidi_embedding_or_override, iFu) +GO(uc_is_property_bidi_eur_num_separator, iFu) +GO(uc_is_property_bidi_eur_num_terminator, iFu) +GO(uc_is_property_bidi_european_digit, iFu) +GO(uc_is_property_bidi_hebrew_right_to_left, iFu) +GO(uc_is_property_bidi_left_to_right, iFu) +GO(uc_is_property_bidi_non_spacing_mark, iFu) +GO(uc_is_property_bidi_other_neutral, iFu) +GO(uc_is_property_bidi_pdf, iFu) +GO(uc_is_property_bidi_segment_separator, iFu) +GO(uc_is_property_bidi_whitespace, iFu) +GO(uc_is_property_cased, iFu) +GO(uc_is_property_case_ignorable, iFu) +GO(uc_is_property_changes_when_casefolded, iFu) +GO(uc_is_property_changes_when_casemapped, iFu) +GO(uc_is_property_changes_when_lowercased, iFu) +GO(uc_is_property_changes_when_titlecased, iFu) +GO(uc_is_property_changes_when_uppercased, iFu) +GO(uc_is_property_combining, iFu) +GO(uc_is_property_composite, iFu) +GO(uc_is_property_currency_symbol, iFu) +GO(uc_is_property_dash, iFu) +GO(uc_is_property_decimal_digit, iFu) GO(uc_is_property_default_ignorable_code_point, iFu) -GO(uc_is_general_category, iFuL) -GO(u8_to_u32, pFpip) -GO(u16_to_u8, pFpip) +GO(uc_is_property_deprecated, iFu) +GO(uc_is_property_diacritic, iFu) +GO(uc_is_property_emoji, iFu) +GO(uc_is_property_emoji_component, iFu) +GO(uc_is_property_emoji_modifier, iFu) +GO(uc_is_property_emoji_modifier_base, iFu) +GO(uc_is_property_emoji_presentation, iFu) +GO(uc_is_property_extended_pictographic, iFu) +GO(uc_is_property_extender, iFu) +GO(uc_is_property_format_control, iFu) +GO(uc_is_property_grapheme_base, iFu) +GO(uc_is_property_grapheme_extend, iFu) +GO(uc_is_property_grapheme_link, iFu) +GO(uc_is_property_hex_digit, iFu) +GO(uc_is_property_hyphen, iFu) +GO(uc_is_property_id_continue, iFu) +GO(uc_is_property_ideographic, iFu) +GO(uc_is_property_ids_binary_operator, iFu) +GO(uc_is_property_id_start, iFu) +GO(uc_is_property_ids_trinary_operator, iFu) +GO(uc_is_property_ignorable_control, iFu) +GO(uc_is_property_iso_control, iFu) +GO(uc_is_property_join_control, iFu) +GO(uc_is_property_left_of_pair, iFu) +GO(uc_is_property_line_separator, iFu) +GO(uc_is_property_logical_order_exception, iFu) +GO(uc_is_property_lowercase, iFu) +GO(uc_is_property_math, iFu) +GO(uc_is_property_non_break, iFu) +GO(uc_is_property_not_a_character, iFu) +GO(uc_is_property_numeric, iFu) +GO(uc_is_property_other_alphabetic, iFu) +GO(uc_is_property_other_default_ignorable_code_point, iFu) +GO(uc_is_property_other_grapheme_extend, iFu) +GO(uc_is_property_other_id_continue, iFu) +GO(uc_is_property_other_id_start, iFu) +GO(uc_is_property_other_lowercase, iFu) +GO(uc_is_property_other_math, iFu) +GO(uc_is_property_other_uppercase, iFu) +GO(uc_is_property_paired_punctuation, iFu) +GO(uc_is_property_paragraph_separator, iFu) +GO(uc_is_property_pattern_syntax, iFu) +GO(uc_is_property_pattern_white_space, iFu) +GO(uc_is_property_private_use, iFu) +GO(uc_is_property_punctuation, iFu) +GO(uc_is_property_quotation_mark, iFu) +GO(uc_is_property_radical, iFu) +GO(uc_is_property_regional_indicator, iFu) +GO(uc_is_property_sentence_terminal, iFu) +GO(uc_is_property_soft_dotted, iFu) +GO(uc_is_property_space, iFu) +GO(uc_is_property_terminal_punctuation, iFu) +GO(uc_is_property_titlecase, iFu) +GO(uc_is_property_unassigned_code_value, iFu) +GO(uc_is_property_unified_ideograph, iFu) +GO(uc_is_property_uppercase, iFu) +GO(uc_is_property_variation_selector, iFu) +GO(uc_is_property_white_space, iFu) +GO(uc_is_property_xid_continue, iFu) +GO(uc_is_property_xid_start, iFu) +GO(uc_is_property_zero_width, iFu) +GO(uc_is_punct, iFu) +GO(uc_is_script, iFup) +GO(uc_is_space, iFu) +GO(uc_is_upper, iFu) +GO(uc_is_xdigit, iFu) +GO(uc_java_ident_category, iFu) +GO(uc_joining_group, iFu) +GO(uc_joining_group_byname, iFp) +GO(uc_joining_group_name, pFi) +GO(uc_joining_type, iFu) +GO(uc_joining_type_byname, iFp) +GO(uc_joining_type_long_name, pFi) +GO(uc_joining_type_name, pFi) +GO(uc_locale_language, pFv) +GO(uc_mirror_char, iFup) +GO(uc_numeric_value, UFu) +DATA(UC_PROPERTY_ALPHABETIC, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_ASCII_HEX_DIGIT, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_ARABIC_DIGIT, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_ARABIC_RIGHT_TO_LEFT, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_BLOCK_SEPARATOR, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_BOUNDARY_NEUTRAL, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_COMMON_SEPARATOR, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_CONTROL, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_EMBEDDING_OR_OVERRIDE, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_EUR_NUM_SEPARATOR, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_EUR_NUM_TERMINATOR, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_EUROPEAN_DIGIT, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_HEBREW_RIGHT_TO_LEFT, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_LEFT_TO_RIGHT, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_NON_SPACING_MARK, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_OTHER_NEUTRAL, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_PDF, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_SEGMENT_SEPARATOR, 8) //this is a uc_property_t which is a callback function +DATA(UC_PROPERTY_BIDI_WHITESPACE, 8) //this is a uc_property_t which is a callback function +GO(uc_property_byname, UFp) +DATA(UC_PROPERTY_CASED, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_CASE_IGNORABLE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_CHANGES_WHEN_CASEFOLDED, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_CHANGES_WHEN_CASEMAPPED, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_CHANGES_WHEN_LOWERCASED, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_CHANGES_WHEN_TITLECASED, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_CHANGES_WHEN_UPPERCASED, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_COMBINING, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_COMPOSITE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_CURRENCY_SYMBOL, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_DASH, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_DECIMAL_DIGIT, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_DEFAULT_IGNORABLE_CODE_POINT, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_DEPRECATED, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_DIACRITIC, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_EMOJI, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_EMOJI_COMPONENT, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_EMOJI_MODIFIER, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_EMOJI_MODIFIER_BASE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_EMOJI_PRESENTATION, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_EXTENDED_PICTOGRAPHIC, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_EXTENDER, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_FORMAT_CONTROL, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_GRAPHEME_BASE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_GRAPHEME_EXTEND, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_GRAPHEME_LINK, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_HEX_DIGIT, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_HYPHEN, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_ID_CONTINUE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_IDEOGRAPHIC, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_IDS_BINARY_OPERATOR, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_ID_START, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_IDS_TRINARY_OPERATOR, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_IGNORABLE_CONTROL, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_ISO_CONTROL, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_JOIN_CONTROL, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_LEFT_OF_PAIR, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_LINE_SEPARATOR, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_LOGICAL_ORDER_EXCEPTION, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_LOWERCASE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_MATH, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_NON_BREAK, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_NOT_A_CHARACTER, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_NUMERIC, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_OTHER_ALPHABETIC, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_OTHER_DEFAULT_IGNORABLE_CODE_POINT, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_OTHER_GRAPHEME_EXTEND, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_OTHER_ID_CONTINUE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_OTHER_ID_START, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_OTHER_LOWERCASE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_OTHER_MATH, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_OTHER_UPPERCASE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_PAIRED_PUNCTUATION, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_PARAGRAPH_SEPARATOR, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_PATTERN_SYNTAX, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_PATTERN_WHITE_SPACE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_PRIVATE_USE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_PUNCTUATION, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_QUOTATION_MARK, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_RADICAL, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_REGIONAL_INDICATOR, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_SENTENCE_TERMINAL, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_SOFT_DOTTED, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_SPACE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_TERMINAL_PUNCTUATION, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_TITLECASE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_UNASSIGNED_CODE_VALUE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_UNIFIED_IDEOGRAPH, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_UPPERCASE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_VARIATION_SELECTOR, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_WHITE_SPACE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_XID_CONTINUE, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_XID_START, 8) // this is a uc_property_t wich is a callback +DATA(UC_PROPERTY_ZERO_WIDTH, 8) // this is a uc_property_t wich is a callback +GO(uc_script, pFu) +GO(uc_script_byname, pFp) +GO(uc_tolower, uFu) +GO(uc_totitle, uFu) +GO(uc_toupper, uFu) +GO(uc_width, iFup) +GO(uc_wordbreak_property, iFu) +//GO(ulc_asnprintf, +//GO(ulc_asprintf, +GO(ulc_casecmp, iFpLpLppp) +GO(ulc_casecoll, iFpLpLppp) +GO(ulc_casexfrm, pFpLpppp) +//GO(ulc_fprintf, +GO(ulc_grapheme_breaks, vFpLp) +GO(ulc_possible_linebreaks, vFpLpp) +GO(ulc_possible_linebreaks_v2, vFpLpp) +//GO(ulc_snprintf, +//GO(ulc_sprintf, +//GO(ulc_vasnprintf, +//GO(ulc_vasprintf, +//GO(ulc_vfprintf, +//GO(ulc_vsnprintf, +//GO(ulc_vsprintf, +GO(ulc_width_linebreaks, iFpLiiippp) +GO(ulc_width_linebreaks_v2, iFpLiiippp) +GO(ulc_wordbreaks, vFpLp) +//DATAR(unicase_empty_prefix_context, +//DATAR(unicase_empty_suffix_context, +//GO(unicode_character_name, +//GO(unicode_name_character, +GO(uninorm_decomposing_form, pFp) +//GOM(uninorm_filter_create, pFEppp) +GO(uninorm_filter_flush, iFp) +GO(uninorm_filter_free, iFp) +GO(uninorm_filter_write, iFpu) +DATA(uninorm_nfc, 32) //unicode_normalization_form +DATA(uninorm_nfd, 32) //unicode_normalization_form +DATA(uninorm_nfkc, 32) //unicode_normalization_form +DATA(uninorm_nfkd, 32) //unicode_normalization_form diff --git a/src/wrapped/wrappedlibusb1.c b/src/wrapped/wrappedlibusb1.c index 77010dc..683931b 100644 --- a/src/wrapped/wrappedlibusb1.c +++ b/src/wrapped/wrappedlibusb1.c @@ -18,11 +18,8 @@ #include "emu/x64emu_private.h" #include "myalign.h" -#ifdef ANDROID - const char* libusb1Name = "libusb-1.0.so"; -#else - const char* libusb1Name = "libusb-1.0.so.0"; -#endif +const char* libusb1Name = "libusb-1.0.so.0"; +#define ALTNAME "libusb-1.0.so" #define LIBNAME libusb1 @@ -152,4 +149,10 @@ EXPORT int my_libusb_cancel_transfer(x64emu_t* emu, my_libusb_transfer_t* t) return my->libusb_cancel_transfer(t); } +EXPORT void my_libusb_free_transfer(x64emu_t* emu, my_libusb_transfer_t* t) +{ + t->callback = findtransfertFct(t->callback); + my->libusb_free_transfer(t); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibusb1_private.h b/src/wrapped/wrappedlibusb1_private.h index 6aa06db..0ad93ee 100644 --- a/src/wrapped/wrappedlibusb1_private.h +++ b/src/wrapped/wrappedlibusb1_private.h @@ -1,7 +1,8 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif +GO(libusb_alloc_streams, iFpupi) GOM(libusb_alloc_transfer, pFEi) GO(libusb_attach_kernel_driver, iFpi) GO(libusb_bulk_transfer, iFpCpipu) @@ -11,6 +12,8 @@ GO(libusb_clear_halt, iFpC) GO(libusb_close, vFp) GO(libusb_control_transfer, iFpCCWWpWu) GO(libusb_detach_kernel_driver, iFpi) +GO(libusb_dev_mem_alloc, pFpL) +GO(libusb_dev_mem_free, iFppL) GO(libusb_error_name, pFi) GO(libusb_event_handler_active, iFp) GO(libusb_event_handling_ok, iFp) @@ -19,11 +22,16 @@ GO(libusb_free_bos_descriptor, vFp) GO(libusb_free_config_descriptor, vFp) GO(libusb_free_container_id_descriptor, vFp) GO(libusb_free_device_list, vFpi) +GO(libusb_free_interface_association_descriptors, vFp) +GO(libusb_free_platform_descriptor, vFp) +GO(libusb_free_pollfds, vFp) GO(libusb_free_ss_endpoint_companion_descriptor, vFp) -GO(libusb_free_ss_usb_device_capability_descriptor, iFppp) -GO(libusb_free_transfer, vFp) +GO(libusb_free_ss_usb_device_capability_descriptor, vFp) +GO(libusb_free_streams, iFppi) +GOM(libusb_free_transfer, vFEp) GO(libusb_free_usb_2_0_extension_descriptor, vFp) GO(libusb_get_active_config_descriptor, iFpp) +GO(libusb_get_active_interface_association_descriptors, iFpp) GO(libusb_get_bos_descriptor, iFpp) GO(libusb_get_bus_number, CFp) GO(libusb_get_config_descriptor, iFpCp) @@ -35,10 +43,13 @@ GO(libusb_get_device_address, CFp) GO(libusb_get_device_descriptor, iFpp) GO(libusb_get_device_list, lFpp) GO(libusb_get_device_speed, iFp) +GO(libusb_get_interface_association_descriptors, iFpCp) +GO(libusb_get_max_alt_packet_size, iFpiiC) GO(libusb_get_max_iso_packet_size, iFpC) GO(libusb_get_max_packet_size, iFpC) GO(libusb_get_next_timeout, iFpp) GO(libusb_get_parent, pFp) +GO(libusb_get_platform_descriptor, iFppp) GO(libusb_get_pollfds, pFp) GO(libusb_get_port_number, CFp) GO(libusb_get_port_numbers, iFppi) @@ -55,10 +66,12 @@ GO(libusb_handle_events_timeout, iFpp) GO(libusb_handle_events_timeout_completed, iFppp) GO(libusb_has_capability, iFu) GO(libusb_hotplug_deregister_callback, vFpi) +GO(libusb_hotplug_get_user_data, pFpi) GOM(libusb_hotplug_register_callback, iFEpiiiiippp) GO(libusb_init, iFp) +//GOM(libusb_init_context, iFppi) +GO(libusb_interrupt_event_handler, vFp) GO(libusb_interrupt_transfer, iFpCpipu) -GO(libusb_interrupt_event_handler, iFp) // since 1.0.21 (API_VERSION > 0x01000105) GO(libusb_kernel_driver_active, iFpi) GO(libusb_lock_events, vFp) GO(libusb_lock_event_waiters, vFp) @@ -73,6 +86,8 @@ GO(libusb_set_configuration, iFpi) GO(libusb_set_debug, vFpi) GO(libusb_set_interface_alt_setting, iFpii) GO(libusb_setlocale, iFp) +//GOM(libusb_set_log_cb, vFppi) +//GO(libusb_set_option, iFpuV) //GOM(libusb_set_pollfd_notifiers, vFpppp) GO(libusb_strerror, pFi) GOM(libusb_submit_transfer, iFEp) @@ -83,3 +98,4 @@ GO(libusb_unlock_events, vFp) GO(libusb_unlock_event_waiters, vFp) GO(libusb_unref_device, vFp) GO(libusb_wait_for_event, iFpp) +GO(libusb_wrap_sys_device, iFplp) diff --git a/src/wrapped/wrappedlibvdpau.c b/src/wrapped/wrappedlibvdpau.c index ba6264c..fe18c91 100644 --- a/src/wrapped/wrappedlibvdpau.c +++ b/src/wrapped/wrappedlibvdpau.c @@ -20,6 +20,8 @@ const char* libvdpauName = "libvdpau.so.1"; #define LIBNAME libvdpau +typedef int (*iFpip_t) (void*, int, void*); +typedef int (*iFupp_t) (uint32_t, void*, void*); #define ADDED_FUNCTIONS() \ @@ -27,9 +29,206 @@ const char* libvdpauName = "libvdpau.so.1"; #include "wrappercallback.h" +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) + + +// VdpPreemptionCallback +#define GO(A) \ +static uintptr_t my_VdpPreemptionCallback_fct_##A = 0; \ +static void my_VdpPreemptionCallback_##A(uint32_t a, void* b) \ +{ \ + RunFunctionFmt(my_VdpPreemptionCallback_fct_##A, "up", a, b); \ +} +SUPER() +#undef GO +static void* findVdpPreemptionCallbackFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_VdpPreemptionCallback_fct_##A == (uintptr_t)fct) return my_VdpPreemptionCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_VdpPreemptionCallback_fct_##A == 0) {my_VdpPreemptionCallback_fct_##A = (uintptr_t)fct; return my_VdpPreemptionCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libvdpau VdpPreemptionCallback callback\n"); + return NULL; +} + +#undef SUPER + +#define VDP_FUNC_ID_GET_ERROR_STRING (0) +#define VDP_FUNC_ID_GET_PROC_ADDRESS (1) +#define VDP_FUNC_ID_GET_API_VERSION (2) +#define VDP_FUNC_ID_GET_INFORMATION_STRING (4) +#define VDP_FUNC_ID_DEVICE_DESTROY (5) +#define VDP_FUNC_ID_GENERATE_CSC_MATRIX (6) +#define VDP_FUNC_ID_VIDEO_SURFACE_QUERY_CAPABILITIES (7) +#define VDP_FUNC_ID_VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES (8) +#define VDP_FUNC_ID_VIDEO_SURFACE_CREATE (9) +#define VDP_FUNC_ID_VIDEO_SURFACE_DESTROY (10) +#define VDP_FUNC_ID_VIDEO_SURFACE_GET_PARAMETERS (11) +#define VDP_FUNC_ID_VIDEO_SURFACE_GET_BITS_Y_CB_CR (12) +#define VDP_FUNC_ID_VIDEO_SURFACE_PUT_BITS_Y_CB_CR (13) +#define VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_CAPABILITIES (14) +#define VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_GET_PUT_BITS_NATIVE_CAPABILITIES (15) +#define VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_INDEXED_CAPABILITIES (16) +#define VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_Y_CB_CR_CAPABILITIES (17) +#define VDP_FUNC_ID_OUTPUT_SURFACE_CREATE (18) +#define VDP_FUNC_ID_OUTPUT_SURFACE_DESTROY (19) +#define VDP_FUNC_ID_OUTPUT_SURFACE_GET_PARAMETERS (20) +#define VDP_FUNC_ID_OUTPUT_SURFACE_GET_BITS_NATIVE (21) +#define VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_NATIVE (22) +#define VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_INDEXED (23) +#define VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_Y_CB_CR (24) +#define VDP_FUNC_ID_BITMAP_SURFACE_QUERY_CAPABILITIES (25) +#define VDP_FUNC_ID_BITMAP_SURFACE_CREATE (26) +#define VDP_FUNC_ID_BITMAP_SURFACE_DESTROY (27) +#define VDP_FUNC_ID_BITMAP_SURFACE_GET_PARAMETERS (28) +#define VDP_FUNC_ID_BITMAP_SURFACE_PUT_BITS_NATIVE (29) +#define VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_OUTPUT_SURFACE (33) +#define VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_BITMAP_SURFACE (34) +#define VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_VIDEO_SURFACE_LUMA (35) +#define VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES (36) +#define VDP_FUNC_ID_DECODER_CREATE (37) +#define VDP_FUNC_ID_DECODER_DESTROY (38) +#define VDP_FUNC_ID_DECODER_GET_PARAMETERS (39) +#define VDP_FUNC_ID_DECODER_RENDER (40) +#define VDP_FUNC_ID_VIDEO_MIXER_QUERY_FEATURE_SUPPORT (41) +#define VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_SUPPORT (42) +#define VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_SUPPORT (43) +#define VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_VALUE_RANGE (44) +#define VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_VALUE_RANGE (45) +#define VDP_FUNC_ID_VIDEO_MIXER_CREATE (46) +#define VDP_FUNC_ID_VIDEO_MIXER_SET_FEATURE_ENABLES (47) +#define VDP_FUNC_ID_VIDEO_MIXER_SET_ATTRIBUTE_VALUES (48) +#define VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_SUPPORT (49) +#define VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_ENABLES (50) +#define VDP_FUNC_ID_VIDEO_MIXER_GET_PARAMETER_VALUES (51) +#define VDP_FUNC_ID_VIDEO_MIXER_GET_ATTRIBUTE_VALUES (52) +#define VDP_FUNC_ID_VIDEO_MIXER_DESTROY (53) +#define VDP_FUNC_ID_VIDEO_MIXER_RENDER (54) +#define VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_DESTROY (55) +#define VDP_FUNC_ID_PRESENTATION_QUEUE_CREATE (56) +#define VDP_FUNC_ID_PRESENTATION_QUEUE_DESTROY (57) +#define VDP_FUNC_ID_PRESENTATION_QUEUE_SET_BACKGROUND_COLOR (58) +#define VDP_FUNC_ID_PRESENTATION_QUEUE_GET_BACKGROUND_COLOR (59) +#define VDP_FUNC_ID_PRESENTATION_QUEUE_GET_TIME (62) +#define VDP_FUNC_ID_PRESENTATION_QUEUE_DISPLAY (63) +#define VDP_FUNC_ID_PRESENTATION_QUEUE_BLOCK_UNTIL_SURFACE_IDLE (64) +#define VDP_FUNC_ID_PRESENTATION_QUEUE_QUERY_SURFACE_STATUS (65) +#define VDP_FUNC_ID_PREEMPTION_CALLBACK_REGISTER (66) +#define VDP_FUNC_ID_DECODER_QUERY_CAPABILITY (67) +#define VDP_FUNC_ID_BASE_WINSYS 0x1000 +#define VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_CREATE_X11 (VDP_FUNC_ID_BASE_WINSYS + 0) + +void my_vdpau_wrap_function(int id, void** f); + +int my_VdpGetProcAddress(x64emu_t* emu, void* a, int b, void* c) +{ + iFpip_t f = getBridgeFnc2((void*)R_RIP); + if(!f) return 1; + int ret = f(a, b, c); + if(!ret) my_vdpau_wrap_function(b, c); + return ret; +} + +int my_VdpPreemptionCallbackRegister(x64emu_t* emu, uint32_t device, void* cb, void* ctx) +{ + iFupp_t f = getBridgeFnc2((void*)R_RIP); + if(!f) return 1; + return f(device, findVdpPreemptionCallbackFct(cb), ctx); +} + +void my_vdpau_wrap_function(int id, void** f) +{ + if(!f) return; + printf_dlsym(LOG_DEBUG, "vdpau:getprocaddress of id = %d (0x%x): %p\n", id, id, *f); + if(!*f) return; + switch(id) { +#define GO(A, B) case A: *f = (void*)AddCheckBridge(my_lib->w.bridge, B, *f, 0, "vdpau_" #A); break +#define GO2(A, B, C) case A: *f = (void*)AddCheckBridge2(my_lib->w.bridge, B, C, *f, 0, "vdpau_" #A); break; + + GO(VDP_FUNC_ID_GET_ERROR_STRING, pFi); + GO2(VDP_FUNC_ID_GET_PROC_ADDRESS, iFEpip, my_VdpGetProcAddress); + GO(VDP_FUNC_ID_GET_API_VERSION, iFp); + GO(VDP_FUNC_ID_GET_INFORMATION_STRING, iFp); + GO(VDP_FUNC_ID_DEVICE_DESTROY, iFu); + GO(VDP_FUNC_ID_GENERATE_CSC_MATRIX, iFpup); + GO(VDP_FUNC_ID_VIDEO_SURFACE_QUERY_CAPABILITIES, iFuuppp); + GO(VDP_FUNC_ID_VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES, iFuuup); + GO(VDP_FUNC_ID_VIDEO_SURFACE_CREATE, iFuuuup); + GO(VDP_FUNC_ID_VIDEO_SURFACE_DESTROY, iFu); + GO(VDP_FUNC_ID_VIDEO_SURFACE_GET_PARAMETERS, iFuppp); + GO(VDP_FUNC_ID_VIDEO_SURFACE_GET_BITS_Y_CB_CR, iFuupp); + GO(VDP_FUNC_ID_VIDEO_SURFACE_PUT_BITS_Y_CB_CR, iFuupp); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_CAPABILITIES, iFuuppp); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_GET_PUT_BITS_NATIVE_CAPABILITIES, iFuup); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_INDEXED_CAPABILITIES, iFuuuup); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_Y_CB_CR_CAPABILITIES, iFuuup); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_CREATE, iFuuuup); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_DESTROY, iFu); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_GET_PARAMETERS, iFuppp); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_GET_BITS_NATIVE, iFuppp); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_NATIVE, iFuppp); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_INDEXED, iFuupppup); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_Y_CB_CR, iFuupppp); + GO(VDP_FUNC_ID_BITMAP_SURFACE_QUERY_CAPABILITIES, iFuuppp); + GO(VDP_FUNC_ID_BITMAP_SURFACE_CREATE, iFuuuuip); + GO(VDP_FUNC_ID_BITMAP_SURFACE_DESTROY, iFu); + GO(VDP_FUNC_ID_BITMAP_SURFACE_GET_PARAMETERS, iFupppp); + GO(VDP_FUNC_ID_BITMAP_SURFACE_PUT_BITS_NATIVE, iFuppp); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_OUTPUT_SURFACE, iFupupppu); + GO(VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_BITMAP_SURFACE, iFupupppu); + //GO(VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_VIDEO_SURFACE_LUMA, + GO(VDP_FUNC_ID_DECODER_QUERY_CAPABILITY, iFuuup); + GO(VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES, iFuuppppp); + GO(VDP_FUNC_ID_DECODER_CREATE, iFuuuuup); + GO(VDP_FUNC_ID_DECODER_DESTROY, iFu); + GO(VDP_FUNC_ID_DECODER_GET_PARAMETERS, iFuppp); + GO(VDP_FUNC_ID_DECODER_RENDER, iFuupup); + GO(VDP_FUNC_ID_VIDEO_MIXER_QUERY_FEATURE_SUPPORT, iFuup); + GO(VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_SUPPORT, iFuup); + GO(VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_SUPPORT, iFuup); + GO(VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_VALUE_RANGE, iFuupp); + GO(VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_VALUE_RANGE, iFuupp); + GO(VDP_FUNC_ID_VIDEO_MIXER_CREATE, iFuupuppp); + GO(VDP_FUNC_ID_VIDEO_MIXER_SET_FEATURE_ENABLES, iFuupp); + GO(VDP_FUNC_ID_VIDEO_MIXER_SET_ATTRIBUTE_VALUES, iFuupp); + GO(VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_SUPPORT, iFuupp); + GO(VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_ENABLES, iFuupp); + GO(VDP_FUNC_ID_VIDEO_MIXER_GET_PARAMETER_VALUES, iFuupp); + GO(VDP_FUNC_ID_VIDEO_MIXER_GET_ATTRIBUTE_VALUES, iFuupp); + GO(VDP_FUNC_ID_VIDEO_MIXER_DESTROY, iFu); + GO(VDP_FUNC_ID_VIDEO_MIXER_RENDER, iFuupiupuuppuppup); + GO(VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_DESTROY, iFu); + GO(VDP_FUNC_ID_PRESENTATION_QUEUE_CREATE, iFuup); + GO(VDP_FUNC_ID_PRESENTATION_QUEUE_DESTROY, iFu); + GO(VDP_FUNC_ID_PRESENTATION_QUEUE_SET_BACKGROUND_COLOR, iFup); + GO(VDP_FUNC_ID_PRESENTATION_QUEUE_GET_BACKGROUND_COLOR, iFup); + GO(VDP_FUNC_ID_PRESENTATION_QUEUE_GET_TIME, iFup); + GO(VDP_FUNC_ID_PRESENTATION_QUEUE_DISPLAY, iFuuuuU); + GO(VDP_FUNC_ID_PRESENTATION_QUEUE_BLOCK_UNTIL_SURFACE_IDLE, iFuup); + GO(VDP_FUNC_ID_PRESENTATION_QUEUE_QUERY_SURFACE_STATUS, iFuupp); + GO2(VDP_FUNC_ID_PREEMPTION_CALLBACK_REGISTER, iFEupp, my_VdpPreemptionCallbackRegister); + + GO(VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_CREATE_X11, iFupp); +#undef GO +#undef GO2 + default: printf_log(LOG_NONE, "Error: vdpau function id=%d(0x%x) unsupported\n", id, id); + } +} + EXPORT uint32_t my_vdp_device_create_x11(x64emu_t* emu, void* display, int screen, void* device, void** get_proc_address) { - return 1; // VDP_STATUS_NO_IMPLEMENTATION + int ret = my->vdp_device_create_x11(display, screen, device, get_proc_address); + if(!ret && get_proc_address) + *get_proc_address = (void*)AddCheckBridge2(my_lib->w.bridge, iFEpip, my_VdpGetProcAddress, *get_proc_address, 0, "vdpau_my_VdpGetProcAddress");; + return ret; } #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibvdpau_private.h b/src/wrapped/wrappedlibvdpau_private.h index 9bfa63f..5113816 100644 --- a/src/wrapped/wrappedlibvdpau_private.h +++ b/src/wrapped/wrappedlibvdpau_private.h @@ -2,4 +2,20 @@ #error meh! #endif -GOM(vdp_device_create_x11, iFEpipp) // last is a pointer to a VdpGetProcAddress function \ No newline at end of file +GOM(vdp_device_create_x11, iFEpipp) // last is a pointer to a VdpGetProcAddress function + +// dummy signatures for getprocaddress +GO(dummy_iFuuppp, iFuuppp) +GO(dummy_iFuuup, iFuuup) +GO(dummy_iFuuuup, iFuuuup) +GO(dummy_iFuupppup, iFuupppup) +GO(dummy_iFuupppp, iFuupppp) +GO(dummy_iFuuuuip, iFuuuuip) +GO(dummy_iFupppp, iFupppp) +GO(dummy_iFupupppu, iFupupppu) +GO(dummy_iFuuppppp, iFuuppppp) +GO(dummy_iFuuuuup, iFuuuuup) +GO(dummy_iFuupup, iFuupup) +GO(dummy_iFuupuppp, iFuupuppp) +GO(dummy_iFuupiupuuppuppup, iFuupiupuuppuppup) +GO(dummy_iFuuuuU, iFuuuuU) diff --git a/src/wrapped/wrappedlibvorbis.c b/src/wrapped/wrappedlibvorbis.c index 0807e5b..26d6dcf 100644 --- a/src/wrapped/wrappedlibvorbis.c +++ b/src/wrapped/wrappedlibvorbis.c @@ -17,11 +17,8 @@ #include "librarian.h" #include "myalign.h" -#ifdef ANDROID - const char* libvorbisName = "libvorbis.so"; -#else - const char* libvorbisName = "libvorbis.so.0"; -#endif +const char* libvorbisName = "libvorbis.so.0"; +#define ALTNAME "libvorbis.so" #define LIBNAME libvorbis diff --git a/src/wrapped/wrappedlibx11.c b/src/wrapped/wrappedlibx11.c index 9f3880e..c6fc431 100644 --- a/src/wrapped/wrappedlibx11.c +++ b/src/wrapped/wrappedlibx11.c @@ -17,11 +17,8 @@ #include "emu/x64emu_private.h" #include "myalign.h" -#ifdef ANDROID - const char* libx11Name = "libX11.so"; -#else - const char* libx11Name = "libX11.so.6"; -#endif +const char* libx11Name = "libX11.so.6"; +#define ALTNAME "libX11.so" #define LIBNAME libx11 @@ -708,6 +705,30 @@ static void* find_async_handler_Fct(void* fct) return NULL; } +// ResourceAlloc +typedef unsigned long XID; +#define GO(A) \ +static uintptr_t my_ResourceAlloc_fct_##A = 0; \ +static XID my_ResourceAlloc_##A(void* dpy) \ +{ \ + return (XID)RunFunctionFmt(my_ResourceAlloc_fct_##A, "p", dpy); \ +} +SUPER() +#undef GO +static void* findResourceAllocFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_ResourceAlloc_fct_##A == (uintptr_t)fct) return my_ResourceAlloc_##A; + SUPER() + #undef GO + #define GO(A) if(my_ResourceAlloc_fct_##A == 0) {my_ResourceAlloc_fct_##A = (uintptr_t)fct; return my_ResourceAlloc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 ResourceAlloc callback\n"); + return NULL; +} + #undef SUPER void* my_XCreateImage(x64emu_t* emu, void* disp, void* vis, uint32_t depth, int32_t fmt, int32_t off @@ -715,16 +736,16 @@ void* my_XCreateImage(x64emu_t* emu, void* disp, void* vis, uint32_t depth, int3 int32_t my_XInitImage(x64emu_t* emu, void* img); -void* my_XGetImage(x64emu_t* emu, void* disp, void* drawable, int32_t x, int32_t y +void* my_XGetImage(x64emu_t* emu, void* disp, size_t drawable, int32_t x, int32_t y , uint32_t w, uint32_t h, uint32_t plane, int32_t fmt); -int32_t my_XPutImage(x64emu_t* emu, void* disp, void* drawable, void* gc, void* image +int32_t my_XPutImage(x64emu_t* emu, void* disp, size_t drawable, void* gc, void* image , int32_t src_x, int32_t src_y, int32_t dst_x, int32_t dst_y , uint32_t w, uint32_t h); -void* my_XGetSubImage(x64emu_t* emu, void* disp, void* drawable +void* my_XGetSubImage(x64emu_t* emu, void* disp, size_t drawable , int32_t x, int32_t y - , uint32_t w, uint32_t h, uint32_t plane, int32_t fmt + , uint32_t w, uint32_t h, size_t plane, int32_t fmt , void* image, int32_t dst_x, int32_t dst_y); void my_XDestroyImage(x64emu_t* emu, void* image); @@ -759,43 +780,7 @@ typedef struct { #define XNStringConversionCallback "stringConversionCallback" // utility functions -#define SUPER() \ -GO(0) \ -GO(1) \ -GO(2) \ -GO(3) \ -GO(4) \ -GO(5) \ -GO(6) \ -GO(7) \ -GO(8) \ -GO(9) \ -GO(10) \ -GO(11) \ -GO(12) \ -GO(13) \ -GO(14) \ -GO(15) \ -GO(16) \ -GO(17) \ -GO(18) \ -GO(19) \ -GO(20) \ -GO(21) \ -GO(22) \ -GO(23) \ -GO(24) \ -GO(25) \ -GO(26) \ -GO(27) \ -GO(28) \ -GO(29) \ -GO(30) \ -GO(31) - - - - +#include "super100.h" // XNGeometryCallback #define GO(A) \ @@ -1090,98 +1075,86 @@ GO(XNStatusDrawCallback) \ GO(XNR6PreeditCallback) \ GO(XNStringConversionCallback) -#define VA_CALL(FUNC, FIRST_ARG, VAARGS, VAARGSZ, RESULT) \ +#define VA_CALL(FUNC, FIRST_ARG, N, VAARGSZ, RESULT) \ switch (VAARGSZ) \ { \ case 2: \ - RESULT = FUNC(FIRST_ARG, VAARGS[0], VAARGS[1], NULL); \ + RESULT = FUNC(FIRST_ARG, getVArgs(emu, N, va, 0), getVArgs(emu, N, va, 1), NULL); \ break; \ case 4: \ - RESULT = FUNC(FIRST_ARG, VAARGS[0], VAARGS[1], VAARGS[2], VAARGS[3], NULL); \ + RESULT = FUNC(FIRST_ARG, getVArgs(emu, N, va, 0), getVArgs(emu, N, va, 1), getVArgs(emu, N, va, 2), getVArgs(emu, N, va, 3), NULL); \ break; \ case 6: \ - RESULT = FUNC(FIRST_ARG, VAARGS[0], VAARGS[1], VAARGS[2], VAARGS[3], VAARGS[4], VAARGS[5], NULL); \ + RESULT = FUNC(FIRST_ARG, getVArgs(emu, N, va, 0), getVArgs(emu, N, va, 1), getVArgs(emu, N, va, 2), getVArgs(emu, N, va, 3), getVArgs(emu, N, va, 4), getVArgs(emu, N, va, 5), NULL); \ break; \ case 8: \ - RESULT = FUNC(FIRST_ARG, VAARGS[0], VAARGS[1], VAARGS[2], VAARGS[3], VAARGS[4], VAARGS[5], VAARGS[6], VAARGS[7], NULL); \ + RESULT = FUNC(FIRST_ARG, getVArgs(emu, N, va, 0), getVArgs(emu, N, va, 1), getVArgs(emu, N, va, 2), getVArgs(emu, N, va, 3), getVArgs(emu, N, va, 4), getVArgs(emu, N, va, 5), getVArgs(emu, N, va, 6), getVArgs(emu, N, va, 7), NULL); \ break; \ case 10: \ - RESULT = FUNC(FIRST_ARG, VAARGS[0], VAARGS[1], VAARGS[2], VAARGS[3], VAARGS[4], VAARGS[5], VAARGS[6], VAARGS[7], VAARGS[8], VAARGS[9], NULL); \ + RESULT = FUNC(FIRST_ARG, getVArgs(emu, N, va, 0), getVArgs(emu, N, va, 1), getVArgs(emu, N, va, 2), getVArgs(emu, N, va, 3), getVArgs(emu, N, va, 4), getVArgs(emu, N, va, 5), getVArgs(emu, N, va, 6), getVArgs(emu, N, va, 7), getVArgs(emu, N, va, 8), getVArgs(emu, N, va, 9), NULL); \ break; \ case 12: \ - RESULT = FUNC(FIRST_ARG, VAARGS[0], VAARGS[1], VAARGS[2], VAARGS[3], VAARGS[4], VAARGS[5], VAARGS[6], VAARGS[7], VAARGS[8], VAARGS[9], VAARGS[10], VAARGS[11], NULL); \ + RESULT = FUNC(FIRST_ARG, getVArgs(emu, N, va, 0), getVArgs(emu, N, va, 1), getVArgs(emu, N, va, 2), getVArgs(emu, N, va, 3), getVArgs(emu, N, va, 4), getVArgs(emu, N, va, 5), getVArgs(emu, N, va, 6), getVArgs(emu, N, va, 7), getVArgs(emu, N, va, 8), getVArgs(emu, N, va, 9), getVArgs(emu, N, va, 10), getVArgs(emu, N, va, 11), NULL); \ break; \ case 14: \ - RESULT = FUNC(FIRST_ARG, VAARGS[0], VAARGS[1], VAARGS[2], VAARGS[3], VAARGS[4], VAARGS[5], VAARGS[6], VAARGS[7], VAARGS[8], VAARGS[9], VAARGS[10], VAARGS[11], VAARGS[12], VAARGS[13], NULL); \ + RESULT = FUNC(FIRST_ARG, getVArgs(emu, N, va, 0), getVArgs(emu, N, va, 1), getVArgs(emu, N, va, 2), getVArgs(emu, N, va, 3), getVArgs(emu, N, va, 4), getVArgs(emu, N, va, 5), getVArgs(emu, N, va, 6), getVArgs(emu, N, va, 7), getVArgs(emu, N, va, 8), getVArgs(emu, N, va, 9), getVArgs(emu, N, va, 10), getVArgs(emu, N, va, 11), getVArgs(emu, N, va, 12), getVArgs(emu, N, va, 13), NULL); \ break; \ case 16: \ - RESULT = FUNC(FIRST_ARG, VAARGS[0], VAARGS[1], VAARGS[2], VAARGS[3], VAARGS[4], VAARGS[5], VAARGS[6], VAARGS[7], VAARGS[8], VAARGS[9], VAARGS[10], VAARGS[11], VAARGS[12], VAARGS[13], VAARGS[14], VAARGS[15], NULL); \ + RESULT = FUNC(FIRST_ARG, getVArgs(emu, N, va, 0), getVArgs(emu, N, va, 1), getVArgs(emu, N, va, 2), getVArgs(emu, N, va, 3), getVArgs(emu, N, va, 4), getVArgs(emu, N, va, 5), getVArgs(emu, N, va, 6), getVArgs(emu, N, va, 7), getVArgs(emu, N, va, 8), getVArgs(emu, N, va, 9), getVArgs(emu, N, va, 10), getVArgs(emu, N, va, 11), getVArgs(emu, N, va, 12), getVArgs(emu, N, va, 13), getVArgs(emu, N, va, 14), getVArgs(emu, N, va, 15), NULL); \ break; \ case 18: \ - RESULT = FUNC(FIRST_ARG, VAARGS[0], VAARGS[1], VAARGS[2], VAARGS[3], VAARGS[4], VAARGS[5], VAARGS[6], VAARGS[7], VAARGS[8], VAARGS[9], VAARGS[10], VAARGS[11], VAARGS[12], VAARGS[13], VAARGS[14], VAARGS[15], VAARGS[16], VAARGS[17], NULL); \ + RESULT = FUNC(FIRST_ARG, getVArgs(emu, N, va, 0), getVArgs(emu, N, va, 1), getVArgs(emu, N, va, 2), getVArgs(emu, N, va, 3), getVArgs(emu, N, va, 4), getVArgs(emu, N, va, 5), getVArgs(emu, N, va, 6), getVArgs(emu, N, va, 7), getVArgs(emu, N, va, 8), getVArgs(emu, N, va, 9), getVArgs(emu, N, va, 10), getVArgs(emu, N, va, 11), getVArgs(emu, N, va, 12), getVArgs(emu, N, va, 13), getVArgs(emu, N, va, 14), getVArgs(emu, N, va, 15), getVArgs(emu, N, va, 16), getVArgs(emu, N, va, 17), NULL); \ break; \ case 20: \ - RESULT = FUNC(FIRST_ARG, VAARGS[0], VAARGS[1], VAARGS[2], VAARGS[3], VAARGS[4], VAARGS[5], VAARGS[6], VAARGS[7], VAARGS[8], VAARGS[9], VAARGS[10], VAARGS[11], VAARGS[12], VAARGS[13], VAARGS[14], VAARGS[15], VAARGS[16], VAARGS[17], VAARGS[18], VAARGS[19], NULL); \ + RESULT = FUNC(FIRST_ARG, getVArgs(emu, N, va, 0), getVArgs(emu, N, va, 1), getVArgs(emu, N, va, 2), getVArgs(emu, N, va, 3), getVArgs(emu, N, va, 4), getVArgs(emu, N, va, 5), getVArgs(emu, N, va, 6), getVArgs(emu, N, va, 7), getVArgs(emu, N, va, 8), getVArgs(emu, N, va, 9), getVArgs(emu, N, va, 10), getVArgs(emu, N, va, 11), getVArgs(emu, N, va, 12), getVArgs(emu, N, va, 13), getVArgs(emu, N, va, 14), getVArgs(emu, N, va, 15), getVArgs(emu, N, va, 16), getVArgs(emu, N, va, 17), getVArgs(emu, N, va, 18), getVArgs(emu, N, va, 19), NULL); \ break; \ default: \ printf_log(LOG_NONE, "warning: %s's vasize (%d) is too large, need create new call case!\n", __func__, VAARGSZ); \ break; \ } -#define GO(A) \ -if (new_va[i] && strcmp((char*)new_va[i], A) == 0) { \ - XICCallback* origin = (XICCallback*)new_va[i+1]; \ - new_va[i+1] = find##A##Fct(origin); \ +#define GO(A) \ +if (getVArgs(emu, 1, va, i) && strcmp((char*)getVArgs(emu, 1, va, i), A) == 0) { \ + XICCallback* origin = (XICCallback*)getVArgs(emu, 1, va, i+1); \ + setVArgs(emu, 1, va, i+1, (uintptr_t)find##A##Fct(origin)); \ } EXPORT void* my_XVaCreateNestedList(x64emu_t* emu, int unused, uintptr_t* va) { int n = 0; while (getVArgs(emu, 1, va, n)) n+=2 ; - void** new_va = box_malloc(sizeof(void*) * n); for (int i = 0; i < n; i += 2) { - new_va[i] = (void*)getVArgs(emu, 1, va, i); - new_va[i+1] = (void*)getVArgs(emu, 1, va, i+1); SUPER() } void* res = NULL; - VA_CALL(my->XVaCreateNestedList, unused, new_va, n, res); - box_free(new_va); + VA_CALL(my->XVaCreateNestedList, unused, 1, n, res); return res; } EXPORT void* my_XCreateIC(x64emu_t* emu, void* xim, uintptr_t* va) { int n = 0; while (getVArgs(emu, 1, va, n)) n+=2; - void** new_va = box_malloc(sizeof(void*) * n); for (int i = 0; i < n; i += 2) { - new_va[i] = (void*)getVArgs(emu, 1, va, i); - new_va[i+1] = (void*)getVArgs(emu, 1, va, i+1); SUPER() } void* res = NULL; - VA_CALL(my->XCreateIC, xim, new_va, n, res); - box_free(new_va); + VA_CALL(my->XCreateIC, xim, 1, n, res); return res; } EXPORT void* my_XSetICValues(x64emu_t* emu, void* xic, uintptr_t* va) { int n = 0; while (getVArgs(emu, 1, va, n)) n+=2; - void** new_va = box_malloc(sizeof(void*) * n); for (int i = 0; i < n; i += 2) { - new_va[i] = (void*)getVArgs(emu, 1, va, i); - new_va[i+1] = (void*)getVArgs(emu, 1, va, i+1); SUPER() } void* res = NULL; - VA_CALL(my->XSetICValues, xic, new_va, n, res); - box_free(new_va); + VA_CALL(my->XSetICValues, xic, 1, n, res); return res; } #undef GO @@ -1189,23 +1162,19 @@ EXPORT void* my_XSetICValues(x64emu_t* emu, void* xic, uintptr_t* va) { EXPORT void* my_XSetIMValues(x64emu_t* emu, void* xim, uintptr_t* va) { int n = 0; while (getVArgs(emu, 1, va, n)) n+=2; - void** new_va = box_malloc(sizeof(void*) * n); - #define GO(A) \ - if (new_va[i] && strcmp((char*)new_va[i], A) == 0) { \ - XIMCallback* origin = (XIMCallback*)new_va[i+1]; \ - new_va[i+1] = find##A##Fct(origin); \ + #define GO(A) \ + if (getVArgs(emu, 1, va, i) && strcmp((char*)getVArgs(emu, 1, va, i), A) == 0) { \ + XIMCallback* origin = (XIMCallback*)getVArgs(emu, 1, va, i+1); \ + setVArgs(emu, 1, va, i+1, (uintptr_t)find##A##Fct(origin)); \ } for (int i = 0; i < n; i += 2) { - new_va[i] = (void*)getVArgs(emu, 1, va, i); - new_va[i+1] = (void*)getVArgs(emu, 1, va, i+1); SUPER() } #undef GO void* res = NULL; - VA_CALL(my->XSetIMValues, xim, new_va, n, res) - box_free(new_va); + VA_CALL(my->XSetIMValues, xim, 1, n, res) return res; } #undef VA_CALL @@ -1318,7 +1287,7 @@ EXPORT int32_t my_XInitImage(x64emu_t* emu, void* img) return ret; } -EXPORT void* my_XGetImage(x64emu_t* emu, void* disp, void* drawable, int32_t x, int32_t y +EXPORT void* my_XGetImage(x64emu_t* emu, void* disp, size_t drawable, int32_t x, int32_t y , uint32_t w, uint32_t h, uint32_t plane, int32_t fmt) { @@ -1330,7 +1299,13 @@ EXPORT void* my_XGetImage(x64emu_t* emu, void* disp, void* drawable, int32_t x, return img; } -EXPORT int32_t my_XPutImage(x64emu_t* emu, void* disp, void* drawable, void* gc, void* image +EXPORT void my__XInitImageFuncPtrs(x64emu_t* emu, XImage* img) +{ + my->_XInitImageFuncPtrs(img); + BridgeImageFunc(emu, img); +} + +EXPORT int32_t my_XPutImage(x64emu_t* emu, void* disp, size_t drawable, void* gc, void* image , int32_t src_x, int32_t src_y, int32_t dst_x, int32_t dst_y , uint32_t w, uint32_t h) { @@ -1341,9 +1316,9 @@ EXPORT int32_t my_XPutImage(x64emu_t* emu, void* disp, void* drawable, void* gc, return r; } -EXPORT void* my_XGetSubImage(x64emu_t* emu, void* disp, void* drawable +EXPORT void* my_XGetSubImage(x64emu_t* emu, void* disp, size_t drawable , int32_t x, int32_t y - , uint32_t w, uint32_t h, uint32_t plane, int32_t fmt + , uint32_t w, uint32_t h, size_t plane, int32_t fmt , void* image, int32_t dst_x, int32_t dst_y) { @@ -1410,7 +1385,7 @@ EXPORT int my_XUnregisterIMInstantiateCallback(x64emu_t* emu, void* d, void* db, EXPORT int my_XQueryExtension(x64emu_t* emu, void* display, char* name, int* major, int* first_event, int* first_error) { int ret = my->XQueryExtension(display, name, major, first_event, first_error); - if(!ret && name && !strcmp(name, "GLX") && box64_x11glx) { + if(!ret && name && !strcmp(name, "GLX") && BOX64ENV(x11glx)) { // hack to force GLX to be accepted, even if not present // left major and first_XXX to default... ret = 1; @@ -1423,9 +1398,9 @@ EXPORT int my_XAddConnectionWatch(x64emu_t* emu, void* display, char* f, void* d return my->XAddConnectionWatch(display, findXConnectionWatchProcFct(f), data); } -EXPORT int my_XRemoveConnectionWatch(x64emu_t* emu, void* display, char* f, void* data) +EXPORT void my_XRemoveConnectionWatch(x64emu_t* emu, void* display, char* f, void* data) { - return my->XRemoveConnectionWatch(display, findXConnectionWatchProcFct(f), data); + my->XRemoveConnectionWatch(display, findXConnectionWatchProcFct(f), data); } EXPORT void* my_XSetAfterFunction(x64emu_t* emu, void* display, void* f) @@ -1439,7 +1414,6 @@ EXPORT void* my_XSynchronize(x64emu_t* emu, void* display, int onoff) return reverse_XSynchronizeProcFct(my_lib, my->XSynchronize(display, onoff)); } -typedef unsigned long XID; struct my_XFreeFuncs { void* atoms; void* modifiermap; @@ -1601,6 +1575,7 @@ EXPORT void* my_XOpenDisplay(x64emu_t* emu, void* d) if(!ret) return ret; + if(BOX64ENV(x11sync)) {my->XSynchronize(ret, 1); printf_log(LOG_INFO, "Forcing Syncronized opration on Display %p\n", ret);} bridge_t* system = emu->context->system; #define GO(A, W)\ @@ -1647,7 +1622,7 @@ EXPORT void* my_XOpenDisplay(x64emu_t* emu, void* d) return ret; } -EXPORT void* my__XGetRequest(x64emu_t* emu, my_XDisplay_t* dpy, int type, size_t len) +EXPORT void* my__XGetRequest(x64emu_t* emu, my_XDisplay_t* dpy, uint8_t type, size_t len) { // check if asynchandler needs updated wrapping struct my_XInternalAsync * p = dpy->async_handlers; @@ -1664,13 +1639,41 @@ EXPORT void* my__XGetRequest(x64emu_t* emu, my_XDisplay_t* dpy, int type, size_t return my->_XGetRequest(dpy, type, len); } +EXPORT uintptr_t my_XCreateWindow(x64emu_t* emu, my_XDisplay_t* dpy, uintptr_t v2, int32_t v3, int32_t v4, uint32_t v5, uint32_t v6, uint32_t v7, int32_t v8, uint32_t v9, void* v10, uintptr_t v11, void* v12) +{ + dpy->resource_alloc = findResourceAllocFct(dpy->resource_alloc); + uintptr_t ret = my->XCreateWindow(dpy, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); + return ret; +} + +EXPORT void* my_XOpenIM(x64emu_t* emu, my_XDisplay_t* dpy, void* v2, void* v3, void* v4) +{ + void* ret = my->XOpenIM(dpy, v2, v3, v4); + bridge_t* system = emu->context->system; + + #define GO(A, W)\ + if(dpy->A) \ + if(!CheckBridged(system, dpy->A)) \ + AddAutomaticBridge(system, W, dpy->A, 0, #A); \ + + GO(resource_alloc, LFp) + #undef GO + + return ret; +} + +EXPORT int my_XCloseDisplay(x64emu_t* emu, void* dpy) +{ + int ret = my->XCloseDisplay(dpy); + if(!ret) unregister_xcb_display(dpy); + return ret; +} + #define CUSTOM_INIT \ - if(box64_x11threads) my->XInitThreads(); + AddAutomaticBridge(lib->w.bridge, vFp, *(void**)dlsym(lib->w.lib, "_XLockMutex_fn"), 0, "_XLockMutex_fn"); \ + AddAutomaticBridge(lib->w.bridge, vFp, *(void**)dlsym(lib->w.lib, "_XUnlockMutex_fn"), 0, "_XUnlockMutex_fn"); \ + if(BOX64ENV(x11threads)) my->XInitThreads(); -#ifdef ANDROID -#define NEEDED_LIBS "libxcb.so" -#else #define NEEDED_LIBS "libxcb.so.1" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibx11_private.h b/src/wrapped/wrappedlibx11_private.h index 9cf6952..d6c3f1e 100644 --- a/src/wrapped/wrappedlibx11_private.h +++ b/src/wrapped/wrappedlibx11_private.h @@ -1,43 +1,29 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -// all those bss stuff are suspicious -//DATAB(__bss_end__, 4) -//DATAB(_bss_end__, 4) -//DATAB(__bss_start, 4) -//DATAB(__bss_start__, 4) -//DATA(__data_start, 4) -//DATA(_edata, 4) -//DATAB(_end, 4) -//DATAB(__end__, 4) -// __exidx_end // type r -// __exidx_start // type r -// _fini -// _init -// KeySymToUcs4 -DATAB(_qfree, 4) -//GO(_Utf8GetConvByName, -//GO(XActivateScreenSaver +DATAB(_qfree, 4) // Warning: failed to confirm + +GO(XActivateScreenSaver, iFp) GOM(XAddConnectionWatch, iFEppp) GO(XAddExtension, pFp) -GO(XAddHost, vFpp) -GO(XAddHosts, vFppi) +GO(XAddHost, iFpp) +GO(XAddHosts, iFppi) GO(XAddPixel, vFpl) -GO(XAddToExtensionList, vFpp) -//GO(XAddToSaveSet +GO(XAddToExtensionList, iFpp) +GO(XAddToSaveSet, iFpL) GO(XAllocClassHint, pFv) -GO(XAllocColor, iFppp) +GO(XAllocColor, iFpLp) GO(XAllocColorCells, iFpLipupu) GO(XAllocColorPlanes, iFpLipiiiippp) GO(XAllocIconSize, pFv) GO(_XAllocID, LFp) GO(_XAllocIDs, vFppi) -GO(XAllocNamedColor, iFppppp) -//GO(_XAllocScratch, +GO(XAllocNamedColor, iFpLppp) +GO(_XAllocScratch, pFpL) GO(XAllocSizeHints, pFv) GO(XAllocStandardColormap, pFv) -//GO(_XAllocTemp, +GO(_XAllocTemp, pFpL) GO(XAllocWMHints, pFv) GO(XAllowEvents, iFpiL) GO(XAllPlanes, LFv) @@ -50,99 +36,99 @@ GO(XBitmapBitOrder, iFp) GO(XBitmapPad, iFp) GO(XBitmapUnit, iFp) GO(XBlackPixel, LFpi) -//GO(XBlackPixelOfScreen -//GO(XCellsOfScreen +GO(XBlackPixelOfScreen, LFp) +GO(XCellsOfScreen, iFp) GO(XChangeActivePointerGrab, iFpuLL) GO(XChangeGC, iFppLp) GO(XChangeKeyboardControl, iFpLp) GO(XChangeKeyboardMapping, iFpiipi) GO(XChangePointerControl, iFpiiiii) GO(XChangeProperty, iFpLLLiipi) -//GO(XChangeSaveSet +GO(XChangeSaveSet, iFpLi) GO(XChangeWindowAttributes, iFpLLp) GOM(XCheckIfEvent, iFEpppp) GO(XCheckMaskEvent, iFplp) GO(XCheckTypedEvent, iFpip) GO(XCheckTypedWindowEvent, iFpLip) -GO(XCheckWindowEvent, iFpplp) +GO(XCheckWindowEvent, iFpLlp) GO(XCirculateSubwindows, iFpLi) -//GO(XCirculateSubwindowsDown -//GO(XCirculateSubwindowsUp +GO(XCirculateSubwindowsDown, iFpL) +GO(XCirculateSubwindowsUp, iFpL) GO(XClearArea, iFpLiiuui) -GO(XClearWindow, iFpp) +GO(XClearWindow, iFpL) GO(XClipBox, iFpp) -GO(XCloseDisplay, iFp) +GOM(XCloseDisplay, iFEp) GO(XCloseIM, iFp) //GO(_XCloseLC, GO(XCloseOM, iFp) //GO(_XcmsAddCmapRec, -//GO(XcmsAddColorSpace -//GO(XcmsAddFunctionSet -//GO(XcmsAllocColor -//GO(XcmsAllocNamedColor +//GOM(XcmsAddColorSpace, iFEp) +GO(XcmsAddFunctionSet, iFp) +GO(XcmsAllocColor, iFpLpL) +GO(XcmsAllocNamedColor, iFpLpppL) //GO(_XcmsArcTangent, -//GO(XcmsCCCOfColormap -//GO(XcmsCIELabClipab -//GO(XcmsCIELabClipL -//GO(XcmsCIELabClipLab +//GOM(XcmsCCCOfColormap, pFEpL) +//GOM(XcmsCIELabClipab, iFEppuup) +//GOM(XcmsCIELabClipL, iFEppuup) +//GOM(XcmsCIELabClipLab, iFEppuup) DATA(XcmsCIELabColorSpace, 6*sizeof(void*)) -//GO(_XcmsCIELab_prefix // type r, -//GO(XcmsCIELabQueryMaxC -//GO(XcmsCIELabQueryMaxL -//GO(XcmsCIELabQueryMaxLC +//DATA(_XcmsCIELab_prefix, +//GOM(XcmsCIELabQueryMaxC, iFEpddp) +//GOM(XcmsCIELabQueryMaxL, iFEpddp) +//GOM(XcmsCIELabQueryMaxLC, iFEpdp) //GO(_XcmsCIELabQueryMaxLCRGB, -//GO(XcmsCIELabQueryMinL -//GO(XcmsCIELabToCIEXYZ -//GO(XcmsCIELabWhiteShiftColors -//GO(XcmsCIELuvClipL -//GO(XcmsCIELuvClipLuv -//GO(XcmsCIELuvClipuv +//GOM(XcmsCIELabQueryMinL, iFEpddp) +//GOM(XcmsCIELabToCIEXYZ, iFEpppu) +//GOM(XcmsCIELabWhiteShiftColors, iFEpppLpup) +//GOM(XcmsCIELuvClipL, iFEppuup) +//GOM(XcmsCIELuvClipLuv, iFEppuup) +//GOM(XcmsCIELuvClipuv, iFEppuup) DATA(XcmsCIELuvColorSpace, 6*sizeof(void*)) -//GO(_XcmsCIELuv_prefix // type r, -//GO(XcmsCIELuvQueryMaxC -//GO(XcmsCIELuvQueryMaxL -//GO(XcmsCIELuvQueryMaxLC +//DATA(_XcmsCIELuv_prefix, +//GOM(XcmsCIELuvQueryMaxC, iFEpddp) +//GOM(XcmsCIELuvQueryMaxL, iFEpddp) +//GOM(XcmsCIELuvQueryMaxLC, iFEpdp) //GO(_XcmsCIELuvQueryMaxLCRGB, -//GO(XcmsCIELuvQueryMinL -//GO(XcmsCIELuvToCIEuvY -//GO(XcmsCIELuvWhiteShiftColors +//GOM(XcmsCIELuvQueryMinL, iFEpddp) +//GOM(XcmsCIELuvToCIEuvY, iFEpppu) +//GOM(XcmsCIELuvWhiteShiftColors, iFEpppLpup) DATA(XcmsCIEuvYColorSpace, 6*sizeof(void*)) -//GO(_XcmsCIEuvY_prefix // type r, -//GO(XcmsCIEuvYToCIELuv -//GO(XcmsCIEuvYToCIEXYZ -//GO(XcmsCIEuvYToTekHVC +//DATA(_XcmsCIEuvY_prefix, +//GOM(XcmsCIEuvYToCIELuv, iFEpppu) +//GOM(XcmsCIEuvYToCIEXYZ, iFEpppu) +//GOM(XcmsCIEuvYToTekHVC, iFEpppu) //GO(_XcmsCIEuvY_ValidSpec, DATA(XcmsCIExyYColorSpace, 6*sizeof(void*)) // probably need some wrapping -//GO(_XcmsCIExyY_prefix // type r, -//GO(XcmsCIExyYToCIEXYZ +//DATA(_XcmsCIExyY_prefix, +//GOM(XcmsCIExyYToCIEXYZ, iFEpppu) DATA(XcmsCIEXYZColorSpace, 6*sizeof(void*)) -//GO(_XcmsCIEXYZ_prefix // type r, -//GO(XcmsCIEXYZToCIELab -//GO(XcmsCIEXYZToCIEuvY -//GO(XcmsCIEXYZToCIExyY -//GO(XcmsCIEXYZToRGBi +//DATA(_XcmsCIEXYZ_prefix, +//GOM(XcmsCIEXYZToCIELab, iFEpppu) +//GOM(XcmsCIEXYZToCIEuvY, iFEpppu) +//GOM(XcmsCIEXYZToCIExyY, iFEpppu) +//GOM(XcmsCIEXYZToRGBi, iFEppup) //GO(_XcmsCIEXYZ_ValidSpec, -//GO(XcmsClientWhitePointOfCCC -//GO(XcmsConvertColors +//GOM(XcmsClientWhitePointOfCCC, pFEp) +//GOM(XcmsConvertColors, iFEppuLp) //GO(_XcmsConvertColorsWithWhitePt, //GO(_XcmsCopyCmapRecAndFree, //GO(_XcmsCopyISOLatin1Lowered, //GO(_XcmsCopyPointerArray, //GO(_XcmsCosine, -//GO(XcmsCreateCCC +//GOM(XcmsCreateCCC, pFEpipppppp) //GO(_XcmsCubeRoot, DATA(_XcmsDDColorSpaces, 6*sizeof(void*)) DATA(_XcmsDDColorSpacesInit, 6*sizeof(void*)) //GO(_XcmsDDConvertColors, -//GO(XcmsDefaultCCC +//GOM(XcmsDefaultCCC, pFEpi) //GO(_XcmsDeleteCmapRec, DATA(_XcmsDIColorSpaces, 6*sizeof(void*)) DATA(_XcmsDIColorSpacesInit, 6*sizeof(void*)) //GO(_XcmsDIConvertColors, -//GO(XcmsDisplayOfCCC +//GOM(XcmsDisplayOfCCC, pFEp) //GO(_XcmsEqualWhitePts, GO(XcmsFormatOfPrefix, LFp) -//GO(XcmsFreeCCC +GOM(XcmsFreeCCC, vFp) //GO(_XcmsFreeIntensityMaps, //GO(_XcmsFreePointerArray, //GO(_XcmsGetElement, @@ -155,72 +141,72 @@ GO(XcmsLookupColor, iFpLpppL) //GO(_XcmsLRGB_InitScrnDefault, GO(XcmsPrefixOfFormat, pFL) //GO(_XcmsPushPointerArray, -//GO(XcmsQueryBlack -//GO(XcmsQueryBlue +//GOM(XcmsQueryBlack, iFEpLp) +//GOM(XcmsQueryBlue, iFEpLp) GO(XcmsQueryColor, iFpLpL) GO(XcmsQueryColors, iFpLpuL) -//GO(XcmsQueryGreen -//GO(XcmsQueryRed -//GO(XcmsQueryWhite +//GOM(XcmsQueryGreen, iFEpLp) +//GOM(XcmsQueryRed, iFEpLp) +//GOM(XcmsQueryWhite, iFEpLp) DATA(_XcmsRegColorSpaces, 6*sizeof(void*)) //GO(_XcmsRegFormatOfPrefix, //GO(_XcmsResolveColor, //GO(_XcmsResolveColorString, DATA(XcmsRGBColorSpace, 6*sizeof(void*)) DATA(XcmsRGBiColorSpace, 6*sizeof(void*)) -//GO(_XcmsRGBi_prefix // type r, -//GO(XcmsRGBiToCIEXYZ -//GO(XcmsRGBiToRGB -//GO(_XcmsRGB_prefix // type r, -//GO(XcmsRGBToRGBi +//DATA(_XcmsRGBi_prefix, +//GOM(XcmsRGBiToCIEXYZ, iFEppup) +//GOM(XcmsRGBiToRGB, iFEppup) +//DATA(_XcmsRGB_prefix, +//GOM(XcmsRGBToRGBi, iFEppup) //GO(_XcmsRGB_to_XColor, DATA(_XcmsSCCFuncSets, 3*sizeof(void*)) DATA(_XcmsSCCFuncSetsInit, 3*sizeof(void*)) -//GO(XcmsScreenNumberOfCCC -//GO(XcmsScreenWhitePointOfCCC -//GO(XcmsSetCCCOfColormap -//GO(XcmsSetCompressionProc +//GOM(XcmsScreenNumberOfCCC, iFEp) +//GOM(XcmsScreenWhitePointOfCCC, pFEp) +//GOM(XcmsSetCCCOfColormap, pFEpLp) +//GOM(XcmsSetCompressionProc, pFEppp) //GO(_XcmsSetGetColor, //GO(_XcmsSetGetColors, -//GO(XcmsSetWhiteAdjustProc -//GO(XcmsSetWhitePoint +//GOM(XcmsSetWhiteAdjustProc, pFEppp) +//GOM(XcmsSetWhitePoint, iFEpp) //GO(_XcmsSine, //GO(_XcmsSquareRoot, GO(XcmsStoreColor, iFpLp) GO(XcmsStoreColors, iFpLpup) //GO(_XcmsTekHVC_CheckModify, -//GO(XcmsTekHVCClipC -//GO(XcmsTekHVCClipV -//GO(XcmsTekHVCClipVC +//GOM(XcmsTekHVCClipC, iFEppuup) +//GOM(XcmsTekHVCClipV, iFEppuup) +//GOM(XcmsTekHVCClipVC, iFEppuup) DATA(XcmsTekHVCColorSpace, 6*sizeof(void*)) -//GO(_XcmsTekHVC_prefix // type r, -//GO(XcmsTekHVCQueryMaxC -//GO(XcmsTekHVCQueryMaxV -//GO(XcmsTekHVCQueryMaxVC +//DATA(_XcmsTekHVC_prefix, +//GOM(XcmsTekHVCQueryMaxC, iFEpddp) +//GOM(XcmsTekHVCQueryMaxV, iFEpddp) +//GOM(XcmsTekHVCQueryMaxVC, iFEpdp) //GO(_XcmsTekHVCQueryMaxVCRGB, -//GO(XcmsTekHVCQueryMaxVSamples -//GO(XcmsTekHVCQueryMinV -//GO(XcmsTekHVCToCIEuvY -//GO(XcmsTekHVCWhiteShiftColors +//GOM(XcmsTekHVCQueryMaxVSamples, iFEpdpu) +//GOM(XcmsTekHVCQueryMinV, iFEpddp) +//GOM(XcmsTekHVCToCIEuvY, iFEpppu) +//GOM(XcmsTekHVCWhiteShiftColors, iFEpppLpup) DATA(XcmsUNDEFINEDColorSpace, 6*sizeof(void*)) //GO(_XcmsUnresolveColor, -//GO(XcmsVisualOfCCC +//GOM(XcmsVisualOfCCC, pFEp) //GO(_XColor_to_XcmsRGB, GO(XConfigureWindow, iFpLup) GO(XConnectionNumber, iFp) //GO(_XConnectXCB, -//GO(XContextDependentDrawing +GO(XContextDependentDrawing, iFp) GO(XContextualDrawing, iFp) GO(XConvertCase, vFLpp) GO(XConvertSelection, iFpLLLLL) GO(XCopyArea, iFpLLpiiuuii) GO(XCopyColormapAndFree, LFpL) -//GO(_XCopyEventCookie, +GO(_XCopyEventCookie, iFppp) GO(XCopyGC, iFppLp) GO(XCopyPlane, iFpLLpiiuuiiL) //GO(_XCopyToArg, GO(XCreateBitmapFromData, LFpLpuu) -GO(XCreateColormap, pFpppi) +GO(XCreateColormap, LFpLpi) GO(XCreateFontCursor, LFpu) GO(XCreateFontSet, pFppppp) GO(XCreateGC, pFpLLp) @@ -229,22 +215,23 @@ GOM(XCreateIC, pFEpV) // use vararg GOM(XCreateImage, pFEppuiipuuii) GO(dummy_XCreateImage, pFppuiipuuii) // to have the wrapper DATAB(_XCreateMutex_fn, sizeof(void*)) -GO(XCreateOC, pFp) +GO(XCreateOC, pFppppppppppppppppppp) // is pFpV GO(XCreatePixmap, LFpLuuu) GO(XCreatePixmapCursor, LFpLLppuu) GO(XCreatePixmapFromBitmapData, LFpLpuuLLu) GO(XCreateRegion, pFv) GO(XCreateSimpleWindow, LFpLiiuuuLL) -GO(XCreateWindow, pFppiiuuuiupLp) +GOM(XCreateWindow, LFEpLiiuuuiupLp) DATAB(_Xdebug, sizeof(void*)) GO(XDefaultColormap, LFpi) GO(XDefaultColormapOfScreen, LFp) GO(XDefaultDepth, iFpi) GO(XDefaultDepthOfScreen, iFp) -//GO(_XDefaultError, +GO(_XDefaultError, iFpp) GO(XDefaultGC, pFpi) GO(XDefaultGCOfScreen, pFp) GO(_XDefaultIOError, iFp) +GO(_XDefaultIOErrorExit, vFpp) //GO(_XDefaultOpenIM, //GO(_XDefaultOpenOM, GO(XDefaultRootWindow, LFp) @@ -253,46 +240,46 @@ GO(XDefaultScreenOfDisplay, pFp) GO(XDefaultString, pFv) GO(XDefaultVisual, pFpi) GO(XDefaultVisualOfScreen, pFp) -//GO(_XDefaultWireError, +GO(_XDefaultWireError, iFppp) GO(XDefineCursor, iFpLL) GO(XDeleteContext, iFpLi) -//GO(XDeleteModifiermapEntry +GO(XDeleteModifiermapEntry, pFpCi) GO(XDeleteProperty, iFpLL) -//GO(_XDeq, +GO(_XDeq, vFppp) GOM(_XDeqAsyncHandler, vFEpp) GO(XDestroyIC, vFp) GOM(XDestroyImage, iFEp) //need to unbridge GO(XDestroyOC, vFp) GO(XDestroyRegion, iFp) -GO(XDestroySubwindows, iFpp) -GO(XDestroyWindow, iFpp) -//GO(XDirectionalDependentDrawing -GO(XDisableAccessControl, vFp) +GO(XDestroySubwindows, iFpL) +GO(XDestroyWindow, iFpL) +GO(XDirectionalDependentDrawing, iFp) +GO(XDisableAccessControl, iFp) GO(XDisplayCells, iFpi) GO(XDisplayHeight, iFpi) GO(XDisplayHeightMM, iFpi) GO(XDisplayKeycodes, iFppp) -//GO(XDisplayMotionBufferSize +GO(XDisplayMotionBufferSize, LFp) GO(XDisplayName, pFp) GO(XDisplayOfIM, pFp) GO(XDisplayOfOM, pFp) GO(XDisplayOfScreen, pFp) -//GO(XDisplayPlanes +GO(XDisplayPlanes, iFpi) GO(XDisplayString, pFp) GO(XDisplayWidth, iFpi) GO(XDisplayWidthMM, iFpi) -//GO(XDoesBackingStore -//GO(XDoesSaveUnders -GO(XDrawArc, iFpppiiuuii) -//GO(XDrawArcs -//GO(XDrawImageString -//GO(XDrawImageString16 +GO(XDoesBackingStore, iFp) +GO(XDoesSaveUnders, iFp) +GO(XDrawArc, iFpLpiiuuii) +GO(XDrawArcs, iFpLppi) +GO(XDrawImageString, iFpLpiipi) +GO(XDrawImageString16, iFpLpiipi) GO(XDrawLine, iFpLpiiii) -GO(XDrawLines, iFppppii) +GO(XDrawLines, iFpLppii) GO(XDrawPoint, iFpLpii) GO(XDrawPoints, iFpLppii) -GO(XDrawRectangle, iFpppiiuu) -GO(XDrawRectangles, iFppppi) +GO(XDrawRectangle, iFpLpiiuu) +GO(XDrawRectangles, iFpLppi) GO(XDrawSegments, iFpLppi) GO(XDrawString, iFpLpiipi) GO(XDrawString16, iFpLpiipi) @@ -300,42 +287,42 @@ GO(XDrawText, iFpLpiipi) GO(XDrawText16, iFpLpiipi) GO(_XEatData, vFpL) GO(_XEatDataWords, vFpL) -//GO(XEHeadOfExtensionList +//GO(XEHeadOfExtensionList, GO(XEmptyRegion, iFp) -GO(XEnableAccessControl, vFp) +GO(XEnableAccessControl, iFp) GO(_XEnq, vFpp) GO(XEqualRegion, iFpp) -//GO(_XError, +GO(_XError, iFpp) DATAB(_XErrorFunction, sizeof(void*)) -//GO(XESetBeforeFlush +//GOM(XESetBeforeFlush, pFEpip) GOM(XESetCloseDisplay, pFEpip) -//GO(XESetCopyEventCookie -//GO(XESetCopyGC -//GO(XESetCreateFont -//GO(XESetCreateGC +//GOM(XESetCopyEventCookie, pFEpip) +//GOM(XESetCopyGC, pFEpip) +//GOM(XESetCreateFont, pFEpip) +//GOM(XESetCreateGC, pFEpip) GOM(XESetError, pFEpip) -//GO(XESetErrorString +//GOM(XESetErrorString, pFEpip) GOM(XESetEventToWire, pFEpip) -//GO(XESetFlushGC -//GO(XESetFreeFont -//GO(XESetFreeGC -//GO(XESetPrintErrorValues -//GO(XESetWireToError +//GOM(XESetFlushGC, pFEpip) +//GOM(XESetFreeFont, pFEpip) +//GOM(XESetFreeGC, pFEpip) +//GOM(XESetPrintErrorValues, pFEpip) +//GOM(XESetWireToError, pFEpip) GOM(XESetWireToEvent, pFEpip) -//GO(XESetWireToEventCookie +//GOM(XESetWireToEventCookie, pFEpip) GO(XEventMaskOfScreen, lFp) +GO(_XEventsQueued, iFpi) GO(XEventsQueued, iFpi) -//GO(_XEventsQueued, -//GO(_Xevent_to_mask // type r, -//GO(_XEventToWire, +//DATA(_Xevent_to_mask, +GO(_XEventToWire, iFppp) GO(XExtendedMaxRequestSize, lFp) GO(XExtentsOfFontSet, pFp) //GO(_XF86BigfontFreeFontMetrics, -//GO(_XF86LoadQueryLocaleFont, +GO(_XF86LoadQueryLocaleFont, iFpppp) GO(XFetchBuffer, pFppi) GO(XFetchBytes, pFpp) -//GO(_XFetchEventCookie, -GO(XFetchName, iFppp) +GO(_XFetchEventCookie, iFpp) +GO(XFetchName, iFpLp) GO(XFillArc, iFpLpiiuuii) GO(XFillArcs, iFpLppi) GO(XFillPolygon, iFpLppiii) @@ -343,23 +330,23 @@ GO(XFillRectangle, iFpLpiiuu) GO(XFillRectangles, iFpLppi) GO(XFilterEvent, iFpL) GO(XFindContext, iFpLip) -//GO(XFindOnExtensionList -GO(XFlush, iFp) +GO(XFindOnExtensionList, pFpi) GO(_XFlush, vFp) +GO(XFlush, iFp) GO(XFlushGC, vFpp) GO(_XFlushGCCache, vFpp) GO(XFontsOfFontSet, iFppp) GO(XForceScreenSaver, iFpi) GO(XFree, iFp) //GO(_XFreeAtomTable, -GO(XFreeColormap, iFpp) +GO(XFreeColormap, iFpL) GO(XFreeColors, iFpLpiL) GO(XFreeCursor, iFpL) DATAB(_XFreeDisplayLock_fn, sizeof(void*)) //GO(_XFreeDisplayStructure, -//GO(_XFreeEventCookies, +GO(_XFreeEventCookies, vFp) GO(XFreeEventData, vFpp) -//GO(_XFreeExtData, +GO(_XFreeExtData, iFp) GO(XFreeExtensionList, iFp) GO(XFreeFont, iFpp) GO(XFreeFontInfo, iFppi) @@ -371,7 +358,8 @@ GO(XFreeModifiermap, iFp) DATAB(_XFreeMutex_fn, sizeof(void*)) GO(XFreePixmap, iFpL) GO(XFreeStringList, vFp) -//GO(_XFreeTemp, +GO(_XFreeTemp, vFppL) +GO(XFreeThreads, iFv) //GO(_XFreeX11XCBStructure, GO(XGContextFromGC, LFp) GO(XGeometry, iFpippuuuiipppp) @@ -380,7 +368,7 @@ GO(_XGetAsyncReply, pFppppiii) GO(XGetAtomName, pFpL) GO(XGetAtomNames, iFppip) //GO(_XGetBitsPerPixel, -GO(XGetClassHint, iFppp) +GO(XGetClassHint, iFpLp) GO(XGetCommand, iFpLpp) GO(XGetDefault, pFppp) GO(XGetErrorDatabaseText, iFpppppi) @@ -394,7 +382,7 @@ GO(_XGetHostname, iFpi) GO(XGetIconName, iFpLp) GO(XGetIconSizes, iFpLpp) GO(XGetICValues, pFpppppppppp) // use varargs... -GOM(XGetImage, pFEppiiuuLi) // return an XImage with callbacks that needs wrapping +GOM(XGetImage, pFEpLiiuuLi) // return an XImage with callbacks that needs wrapping GO(XGetIMValues, pFppppppp) // use varargs GO(XGetInputFocus, iFppp) GO(XGetKeyboardControl, iFpp) @@ -402,36 +390,36 @@ GO(XGetKeyboardMapping, pFpCip) //GO(_XGetLCValues, GO(XGetModifierMapping, pFp) GO(XGetMotionEvents, pFpLLLp) -GO(XGetNormalHints, iFppp) +GO(XGetNormalHints, iFpLp) GO(XGetOCValues, pFpppppppppp) // use varargs GO(XGetOMValues, pFp) //GOM(XGetPixel, LFEpii) // need unbridging GO(dummy_XGetPixel, LFpii) // for the wrapper GO(XGetPointerControl, iFpppp) GO(XGetPointerMapping, iFppi) -GOM(_XGetRequest, pFEpuL) +GOM(_XGetRequest, pFEpCL) GO(XGetRGBColormaps, iFpLppL) //GO(_XGetScanlinePad, GO(XGetScreenSaver, iFppppp) GO(XGetSelectionOwner, LFpL) -//GO(XGetSizeHints +GO(XGetSizeHints, iFpLpL) GO(XGetStandardColormap, iFpLpL) -GOM(XGetSubImage, pFEppiiuuuipii) +GOM(XGetSubImage, pFEpLiiuuLipii) GO(XGetTextProperty, iFpLpL) GO(XGetTransientForHint, iFpLp) GO(XGetVisualInfo, pFplpp) -GO(XGetWindowAttributes, iFppp) -//GO(_XGetWindowAttributes, +GO(_XGetWindowAttributes, iFpLp) +GO(XGetWindowAttributes, iFpLp) GO(XGetWindowProperty, iFpLLlliLppppp) -//GO(XGetWMClientMachine +GO(XGetWMClientMachine, iFpLp) GO(XGetWMColormapWindows, iFpLpp) GO(XGetWMHints, pFpL) -GO(XGetWMIconName, iFppp) +GO(XGetWMIconName, iFpLp) GO(XGetWMName, iFpLp) GO(XGetWMNormalHints, iFpLpp) GO(XGetWMProtocols, iFpLpp) GO(XGetWMSizeHints, iFpLppL) -//GO(XGetZoomHints +GO(XGetZoomHints, iFpLp) DATAB(_Xglobal_lock, sizeof(void*)) GO(XGrabButton, iFpuuLiuiiLL) GO(XGrabKey, iFpiuLiii) @@ -442,16 +430,137 @@ DATAB(_XHeadOfDisplayList, sizeof(void*)) GO(XHeightMMOfScreen, iFp) GO(XHeightOfScreen, iFp) DATAB(_Xi18n_lock, sizeof(void*)) -GO(XIconifyWindow, iFppi) +GO(XIconifyWindow, iFpLi) GOM(XIfEvent, iFEpppp) GO(XImageByteOrder, iFp) +//GO(_XimCbDispatch, +//GO(_XimCheckCreateICValues, +//GO(_XimCheckDataSize, +//GO(_XimCheckICMode, +//GO(_XimCheckIfLocalProcessing, +//GO(_XimCheckIfThaiProcessing, +//GO(_XimCheckIMMode, +//GO(_XimCheckLocalInputStyle, +//GO(_XimCommitCallback, //GO(_XIMCompileResourceList, +//GO(_XimConnect, +//GO(_Ximctstombs, +//GO(_Ximctstoutf8, +//GO(_Ximctstowcs, +//GO(_XimDecodeICATTRIBUTE, +//GO(_XimDecodeIMATTRIBUTE, +//GO(_XimDecodeLocalICAttr, +//GO(_XimDecodeLocalIMAttr, +//GO(_XimDestroyIMStructureList, +//GO(_XimDispatchInit, +//GO(_XimEncodeICATTRIBUTE, +//GO(_XimEncodeIMATTRIBUTE, +//GO(_XimEncodeLocalICAttr, +//GO(_XimEncodeLocalIMAttr, +//GO(_XimError, +//GO(_XimErrorCallback, +//GO(_XimExtension, +//GO(_XimFilterWaitEvent, +//GO(_XimFlush, +//GO(_XimForwardEvent, +//GO(_XimForwardEventCallback, +//GO(_XimFreeCommitInfo, +//GO(_XimFreeProtoIntrCallback, +//GO(_XimFreeTransIntrCallback, +//GO(_XimGetAttributeID, //GO(_XimGetCharCode, +//GO(_XimGetCurrentICValues, +//GO(_XimGetCurrentIMValues, +//GO(_XimGetICValueData, +//GO(_XimGetIMValueData, //GO(_XimGetLocaleCode, +//GO(_XimGetMyEndian, +//GO(_XimGetResourceListRec, +//GO(_XimGetResourceListRecByQuark, +//GO(_XimGetWindowEventmask, +//GO(_XimICOfXICID, +//DATA(_XimImSportRec, +//GO(_XimInitialResourceInfo, +//GO(_XimLcctstombs, +//GO(_XimLcctstoutf8, +//GO(_XimLcctstowcs, +//GO(_XimLocalCreateIC, +//GO(_XimLocalFilter, +//GO(_XimLocalGetICValues, +//GO(_XimLocalGetIMValues, +//GO(_XimLocalIMFree, +//GO(_XimLocalMbLookupString, +//GO(_XimLocalOpenIM, +//GO(_XimLocalSetICValues, +//GO(_XimLocalSetIMValues, +//GO(_XimLocalUtf8LookupString, +//GO(_XimLocalWcLookupString, //GO(_XimLookupMBText, //GO(_XimLookupUTF8Text, //GO(_XimLookupWCText, +//GO(_XimMakeICAttrIDList, +//GO(_XimMakeIMAttrIDList, GO(XIMOfIC, pFp) +//GO(_XimOpenIM, +//GO(_XimParseStringFile, +//GO(_XimProcError, +//GO(_XimProcSyncReply, +//GO(_XimProtoCreateIC, +//GO(_XimProtoEventToWire, +//GO(_XimProtoIMFree, +//GO(_XimProtoMbLookupString, +//GO(_XimProtoOpenIM, +//GO(_XimProtoUtf8LookupString, +//GO(_XimProtoWcLookupString, +//GO(_XimProtoWireToEvent, +//GO(_XimRead, +//GO(_XimRegisterDispatcher, +//GO(_XimRegisterFilter, +//GO(_XimRegisterIMInstantiateCallback, +//GO(_XimRegisterServerFilter, +//GO(_XimRegisterTriggerKeysCallback, +//GO(_XimRegProtoIntrCallback, +//GO(_XimReregisterFilter, +//GO(_XimResetIMInstantiateCallback, +//GO(_XimRespSyncReply, +//GO(_XimServerDestroy, +//GO(_XimSetCurrentICValues, +//GO(_XimSetCurrentIMValues, +//GO(_XimSetEventMaskCallback, +//GO(_XimSetHeader, +//GO(_XimSetICDefaults, +//GO(_XimSetICMode, +//GO(_XimSetICResourceList, +//GO(_XimSetICValueData, +//GO(_XimSetIMMode, +//GO(_XimSetIMResourceList, +//GO(_XimSetIMValueData, +//GO(_XimSetInnerICResourceList, +//GO(_XimSetInnerIMResourceList, +//GO(_XimSetLocalIMDefaults, +//GO(_XimShutdown, +//GO(_XimSync, +//GO(_XimSyncCallback, +//GO(_XimThaiCloseIM, +//GO(_XimThaiCreateIC, +//GO(_XimThaiFilter, +//GO(_XimThaiIMFree, +//GO(_XimThaiOpenIM, +//GO(_XimTransCallDispatcher, +//GO(_XimTransConf, +//GO(_XimTransFilterWaitEvent, +//GO(_XimTransFlush, +//GO(_XimTransInternalConnection, +//DATA(_XimTransportRec, +//GO(_XimTransRead, +//GO(_XimTransRegisterDispatcher, +//GO(_XimTransWrite, +//GO(_XimTriggerNotify, +//GO(_XimUnregisterFilter, +//GO(_XimUnRegisterIMInstantiateCallback, +//GO(_XimUnregisterServerFilter, +//GO(_XimWrite, +//GO(_XimXConf, //GO(_XimXTransBytesReadable, //GO(_XimXTransClose, //GO(_XimXTransCloseForCloning, @@ -460,10 +569,8 @@ GO(XIMOfIC, pFp) //GO(_XimXTransFreeConnInfo, //GO(_XimXTransGetConnectionNumber, //GO(_XimXTransGetHostname, -//GO(_XimXTransGetMyAddr, //GO(_XimXTransGetPeerAddr, //GO(_XimXTransIsLocal, -//GO(_XimXTransOpenCLTSClient, //GO(_XimXTransOpenCOTSClient, //GO(_XimXTransRead, //GO(_XimXTransReadv, @@ -475,137 +582,135 @@ DATA(_XimXTransSocketTCPFuncs, sizeof(void*)) DATA(_XimXTransSocketUNIXFuncs, sizeof(void*)) //GO(_XimXTransWrite, //GO(_XimXTransWritev, -//GO(_XInitDefaultIM, -//GO(_XInitDefaultOM, DATAB(_XInitDisplayLock_fn, sizeof(void*)) -//GO(_XInitDynamicIM, -//GO(_XInitDynamicOM, GO(XInitExtension, pFpp) +//GO(_XInitIM, GOM(XInitImage, iFEp) -//GO(_XInitImageFuncPtrs, +GOM(_XInitImageFuncPtrs, iFEp) //GO(_XInitKeysymDB, +//GO(_XInitOM, GO(XInitThreads, iFv) GO(XInsertModifiermapEntry, pFpCi) -GO(XInstallColormap, iFpp) +GO(XInstallColormap, iFpL) GO(XInternalConnectionNumbers, iFppp) GO(XInternAtom, LFppi) GO(XInternAtoms, iFppiip) GO(XIntersectRegion, iFppp) GO(_XIOError, iFp) DATAB(_XIOErrorFunction, sizeof(void*)) -//GO(_XIsEventCookie, +GO(_XIsEventCookie, iFpp) GO(XkbAddDeviceLedInfo, pFpuu) -//GO(XkbAddGeomColor -//GO(XkbAddGeomDoodad -//GO(XkbAddGeomKey -//GO(XkbAddGeomKeyAlias -//GO(XkbAddGeomOutline -//GO(XkbAddGeomOverlay -//GO(XkbAddGeomOverlayKey -//GO(XkbAddGeomOverlayRow -//GO(XkbAddGeomProperty -//GO(XkbAddGeomRow -//GO(XkbAddGeomSection -//GO(XkbAddGeomShape +GO(XkbAddGeomColor, pFppu) +GO(XkbAddGeomDoodad, pFppL) +GO(XkbAddGeomKey, pFp) +GO(XkbAddGeomKeyAlias, pFppp) +GO(XkbAddGeomOutline, pFpi) +GO(XkbAddGeomOverlay, pFpLi) +GO(XkbAddGeomOverlayKey, pFpppp) +GO(XkbAddGeomOverlayRow, pFpii) +GO(XkbAddGeomProperty, pFppp) +GO(XkbAddGeomRow, pFpi) +GO(XkbAddGeomSection, pFpLiii) +GO(XkbAddGeomShape, pFpLi) GO(XkbAddKeyType, pFpLiii) -//GO(XkbAllocClientMap +GO(XkbAllocClientMap, iFpuu) GO(XkbAllocCompatMap, iFpuu) GO(XkbAllocControls, iFpu) GO(XkbAllocDeviceInfo, pFuuu) -//GO(XkbAllocGeomColors -//GO(XkbAllocGeomDoodads -//GO(XkbAllocGeometry -//GO(XkbAllocGeomKeyAliases -//GO(XkbAllocGeomKeys -//GO(XkbAllocGeomOutlines -//GO(XkbAllocGeomOverlayKeys -//GO(XkbAllocGeomOverlayRows -//GO(XkbAllocGeomOverlays -//GO(XkbAllocGeomPoints -//GO(XkbAllocGeomProps -//GO(XkbAllocGeomRows -//GO(XkbAllocGeomSectionDoodads -//GO(XkbAllocGeomSections -//GO(XkbAllocGeomShapes +GO(XkbAllocGeomColors, iFpi) +GO(XkbAllocGeomDoodads, iFpi) +GO(XkbAllocGeometry, iFpp) +GO(XkbAllocGeomKeyAliases, iFpi) +GO(XkbAllocGeomKeys, iFpi) +GO(XkbAllocGeomOutlines, iFpi) +GO(XkbAllocGeomOverlayKeys, iFpi) +GO(XkbAllocGeomOverlayRows, iFpi) +GO(XkbAllocGeomOverlays, iFpi) +GO(XkbAllocGeomPoints, iFpi) +GO(XkbAllocGeomProps, iFpi) +GO(XkbAllocGeomRows, iFpi) +GO(XkbAllocGeomSectionDoodads, iFpi) +GO(XkbAllocGeomSections, iFpi) +GO(XkbAllocGeomShapes, iFpi) GO(XkbAllocIndicatorMaps, iFp) GO(XkbAllocKeyboard, pFv) GO(XkbAllocNames, iFpuii) -//GO(XkbAllocServerMap +GO(XkbAllocServerMap, iFpuu) GO(XkbApplyCompatMapToKey, iFpCp) GO(XkbApplyVirtualModChanges, iFpup) -GO(XkbBell, iFppip) +GO(XkbBell, iFpLiL) GO(XkbBellEvent, iFpLiL) GO(XkbChangeDeviceInfo, iFppp) -//GO(XkbChangeEnabledControls +GO(XkbChangeEnabledControls, iFpuuu) GO(XkbChangeKeycodeRange, iFpiip) GO(XkbChangeMap, iFppp) GO(XkbChangeNames, iFppp) GO(XkbChangeTypesOfKey, iFpiiupp) GO(XkbComputeEffectiveMap, iFppp) -//GO(XkbComputeRowBounds -//GO(XkbComputeSectionBounds -//GO(XkbComputeShapeBounds -//GO(XkbComputeShapeTop +GO(XkbComputeRowBounds, iFppp) +GO(XkbComputeSectionBounds, iFpp) +GO(XkbComputeShapeBounds, iFp) +GO(XkbComputeShapeTop, iFpp) //GO(_XkbCopyFromReadBuffer, GO(XkbCopyKeyType, iFpp) GO(XkbCopyKeyTypes, iFppi) -//GO(XkbDeviceBell +GO(XkbDeviceBell, iFpLiiiiL) GO(XkbDeviceBellEvent, iFpLiiiiL) -//GO(XkbFindOverlayForKey +GO(XkbFindOverlayForKey, pFppp) GO(XkbForceBell, iFpi) GO(XkbForceDeviceBell, iFpiiii) GO(XkbFreeClientMap, vFpui) -//GO(XkbFreeCompatMap +GO(XkbFreeCompatMap, vFpui) GO(XkbFreeComponentList, vFp) -//GO(XkbFreeControls +GO(XkbFreeControls, vFpui) GO(XkbFreeDeviceInfo, vFpui) -//GO(XkbFreeGeomColors -//GO(XkbFreeGeomDoodads -//GO(XkbFreeGeometry -//GO(XkbFreeGeomKeyAliases -//GO(XkbFreeGeomKeys -//GO(XkbFreeGeomOutlines -//GO(XkbFreeGeomOverlayKeys -//GO(XkbFreeGeomOverlayRows -//GO(XkbFreeGeomOverlays -//GO(XkbFreeGeomPoints -//GO(XkbFreeGeomProperties -//GO(XkbFreeGeomRows -//GO(XkbFreeGeomSections -//GO(XkbFreeGeomShapes +GO(XkbFreeGeomColors, vFpiii) +GO(XkbFreeGeomDoodads, vFpii) +GO(XkbFreeGeometry, vFpui) +GO(XkbFreeGeomKeyAliases, vFpiii) +GO(XkbFreeGeomKeys, vFpiii) +GO(XkbFreeGeomOutlines, vFpiii) +GO(XkbFreeGeomOverlayKeys, vFpiii) +GO(XkbFreeGeomOverlayRows, vFpiii) +GO(XkbFreeGeomOverlays, vFpiii) +GO(XkbFreeGeomPoints, vFpiii) +GO(XkbFreeGeomProperties, vFpiii) +GO(XkbFreeGeomRows, vFpiii) +GO(XkbFreeGeomSections, vFpiii) +GO(XkbFreeGeomShapes, vFpiii) GO(XkbFreeIndicatorMaps, vFp) GO(XkbFreeKeyboard, vFpui) GO(XkbFreeNames, vFpui) //GO(_XkbFreeReadBuffer, -//GO(XkbFreeServerMap +GO(XkbFreeServerMap, vFpui) DATA(_XkbGetAtomNameFunc, sizeof(void*)) -//GO(XkbGetAutoRepeatRate +GO(XkbGetAutoRepeatRate, iFpupp) GO(XkbGetAutoResetControls, iFppp) //GO(_XkbGetCharset, -//GO(XkbGetCompatMap +GO(XkbGetCompatMap, iFpup) GO(XkbGetControls, iFpLp) //GO(_XkbGetConverters, GO(XkbGetDetectableAutoRepeat, iFpp) GO(XkbGetDeviceButtonActions, iFppiuu) GO(XkbGetDeviceInfo, pFpuuuu) -//GO(XkbGetDeviceInfoChanges -//GO(XkbGetDeviceLedInfo -//GO(XkbGetGeometry -//GO(XkbGetIndicatorMap +GO(XkbGetDeviceInfoChanges, iFppp) +GO(XkbGetDeviceLedInfo, iFppuuu) +GO(XkbGetGeometry, iFpp) +GO(XkbGetIndicatorMap, iFpLp) GO(XkbGetIndicatorState, iFpup) -//GO(XkbGetKeyActions -//GO(XkbGetKeyBehaviors +GO(XkbGetKeyActions, iFpuup) +GO(XkbGetKeyBehaviors, iFpuup) GO(XkbGetKeyboard, pFpuu) GO(XkbGetKeyboardByName, pFpupuui) -//GO(XkbGetKeyExplicitComponents -//GO(XkbGetKeyModifierMap -//GO(XkbGetKeySyms -//GO(XkbGetKeyTypes +GO(XkbGetKeyExplicitComponents, iFpuup) +GO(XkbGetKeyModifierMap, iFpuup) +GO(XkbGetKeySyms, iFpuup) +GO(XkbGetKeyTypes, iFpuup) GO(XkbGetKeyVirtualModMap, iFpuup) GO(XkbGetMap, pFpuu) -//GO(XkbGetMapChanges +GO(XkbGetMapChanges, iFppp) GO(XkbGetNamedDeviceIndicator, iFpuuuLpppp) -//GO(XkbGetNamedGeometry +GO(XkbGetNamedGeometry, iFppL) GO(XkbGetNamedIndicator, iFpLpppp) GO(XkbGetNames, iFpup) GO(XkbGetPerClientControls, iFpp) @@ -613,7 +718,7 @@ GO(XkbGetPerClientControls, iFpp) //GO(_XkbGetReadBufferPtr, GO(XkbGetState, iFpup) GO(XkbGetUpdatedMap, iFpup) -//GO(XkbGetVirtualMods +GO(XkbGetVirtualMods, iFpup) GO(XkbGetXlibControls, uFp) GO(XkbIgnoreExtension, iFi) GO(XkbInitCanonicalKeyTypes, iFpui) @@ -626,8 +731,8 @@ GO(XkbLatchGroup, iFpuu) GO(XkbLatchModifiers, iFpuuu) GO(XkbLibraryVersion, iFpp) GO(XkbListComponents, pFpupp) -//GO(XkbLockGroup -//GO(XkbLockModifiers +GO(XkbLockGroup, iFpuu) +GO(XkbLockModifiers, iFpuuu) GO(XkbLookupKeyBinding, iFpLupip) GO(XkbLookupKeySym, iFpCupp) GO(XkbNoteControlsChanges, vFppu) @@ -638,7 +743,9 @@ GO(XkbNoteNameChanges, vFppu) GO(XkbOpenDisplay, pFpppppp) //GO(_XkbPeekAtReadBuffer, GO(XkbQueryExtension, iFpppppp) +//GO(_XkbReadBufferCopy32, //GO(_XkbReadBufferCopyKeySyms, +//GO(_XkbReadCopyData32, //GO(_XkbReadCopyKeySyms, //GO(_XkbReadGetCompatMapReply, //GO(_XkbReadGetGeometryReply, @@ -652,30 +759,30 @@ GO(XkbResizeKeyActions, pFpii) GO(XkbResizeKeySyms, pFpii) GO(XkbResizeKeyType, iFpiiii) GO(XkbSelectEventDetails, iFpuuLL) -GO(XkbSelectEvents, iFpuLL) -//GO(XkbSetAtomFuncs -//GO(XkbSetAutoRepeatRate +GO(XkbSelectEvents, iFpuuu) +//GOM(XkbSetAtomFuncs, vFEpp) +GO(XkbSetAutoRepeatRate, iFpuuu) GO(XkbSetAutoResetControls, iFpupp) GO(XkbSetCompatMap, iFpupi) -//GO(XkbSetControlslib +GO(XkbSetControls, iFpLp) GO(XkbSetDebuggingFlags, iFpuupuupp) GO(XkbSetDetectableAutoRepeat, iFpip) GO(XkbSetDeviceButtonActions, iFppuu) GO(XkbSetDeviceInfo, iFpup) GO(XkbSetDeviceLedInfo, iFppuuu) -//GO(XkbSetGeometry +GO(XkbSetGeometry, iFpup) GO(XkbSetIgnoreLockMods, iFpuuuuu) -//GO(XkbSetIndicatorMap +GO(XkbSetIndicatorMap, iFpLp) GO(XkbSetMap, iFpup) GO(XkbSetNamedDeviceIndicator, iFpuuuLiiip) GO(XkbSetNamedIndicator, iFpLiiip) GO(XkbSetNames, iFpuuup) GO(XkbSetPerClientControls, iFpup) -//GO(XkbSetServerInternalMods +GO(XkbSetServerInternalMods, iFpuuuuu) GO(XkbSetXlibControls, uFpuu) //GO(_XkbSkipReadBufferData, -GO(XkbToControl, CFC) -//GO(XkbTranslateKey +GO(XkbToControl, cFc) +//GO(XkbTranslateKey, GO(XkbTranslateKeyCode, iFpCupp) GO(XkbTranslateKeySym, iFppupip) GO(XkbUpdateActionVirtualMods, iFppu) @@ -683,16 +790,17 @@ GO(XkbUpdateKeyTypeVirtualMods, vFppup) GO(XkbUpdateMapFromCore, iFpCiipp) GO(XkbUseExtension, iFppp) GO(XkbVirtualModsToReal, iFpup) +//GO(_XkbWriteCopyData32, //GO(_XkbWriteCopyKeySyms, GO(XkbXlibControlsImplemented, uFv) -GO(XKeycodeToKeysym, LFpCi) //GO(_XKeycodeToKeysym, +GO(XKeycodeToKeysym, LFpCi) //GO(_XKeyInitialize, -GO(XKeysymToKeycode, CFpL) //GO(_XKeysymToKeycode, +GO(XKeysymToKeycode, CFpL) //GO(_XKeysymToModifiers, GO(XKeysymToString, pFL) -//GO(_XkeyTable // type r, +//DATA(_XkeyTable, GO(XKillClient, iFpL) GO(XLastKnownRequestProcessed, LFp) //GO(_XlcAddCharSet, @@ -713,12 +821,13 @@ GO(XLastKnownRequestProcessed, LFp) //GO(_XlcCreateLocaleDataBase, //GO(_XlcCurrentLC, //GO(_XlcDbg_printValue, +//GO(_XlcDefaultLoader, //GO(_XlcDefaultMapModifiers, //GO(_XlcDeInitLoader, //GO(_XlcDestroyLC, //GO(_XlcDestroyLocaleDataBase, -//GO(_XlcDynamicLoad, //GO(_XlcFileName, +//GO(_XlcGenericLoader, DATA(_XlcGenericMethods, sizeof(void*)) //GO(_XlcGetCharSet, //GO(_XlcGetCharSetWithSide, @@ -745,6 +854,7 @@ DATA(_XlcPublicMethods, sizeof(void*)) //GO(_XlcResolveLocaleName, //GO(_XlcSetConverter, //GO(_XlcSetValues, +//GO(_XlcUtf8Loader, //GO(_XlcValidModSyntax, //GO(_XlcVaToArgList, //GO(_Xlcwcstombs, @@ -759,43 +869,53 @@ GO(XListPixmapFormats, pFpp) GO(XListProperties, pFpLp) GO(XLoadFont, LFpp) GO(XLoadQueryFont, pFpp) -// xlocaledir +GO(xlocaledir, vFpi) GO(XLocaleOfFontSet, pFp) GO(XLocaleOfIM, pFp) GO(XLocaleOfOM, pFp) GO(XLockDisplay, vFp) DATAB(_XLockMutex_fn, sizeof(void*)) GO(XLookupColor, iFpLppp) -GO(XLookupKeysym, LFpi) //GO(_XLookupKeysym, -GO(XLookupString, iFppipp) +GO(XLookupKeysym, LFpi) //GO(_XLookupString, -GO(XLowerWindow, iFpp) -GO(XMapRaised, iFpp) -GO(XMapSubwindows, iFpp) -GO(XMapWindow, iFpp) +GO(XLookupString, iFppipp) +GO(XLowerWindow, iFpL) +GO(XMapRaised, iFpL) +GO(XMapSubwindows, iFpL) +GO(XMapWindow, iFpL) GO(XMaskEvent, iFplp) GO(XMatchVisualInfo, iFpiiip) -//GO(XMaxCmapsOfScreen -GO(XMaxRequestSize, iFp) -//GO(XmbDrawImageString -GO(XmbDrawString, vFppppiipi) -//GO(XmbDrawText +GO(XMaxCmapsOfScreen, iFp) +GO(XMaxRequestSize, lFp) +//GO(_XmbDefaultDrawImageString, +//GO(_XmbDefaultDrawString, +//GO(_XmbDefaultTextEscapement, +//GO(_XmbDefaultTextExtents, +//GO(_XmbDefaultTextPerCharExtents, +GO(XmbDrawImageString, vFpLppiipi) +GO(XmbDrawString, vFpLppiipi) +GO(XmbDrawText, vFpLpiipi) +//GO(_XmbGenericDrawImageString, +//GO(_XmbGenericDrawString, +//GO(_XmbGenericTextEscapement, +//GO(_XmbGenericTextExtents, +//GO(_XmbGenericTextPerCharExtents, GO(_Xmblen, iFpi) GO(XmbLookupString, iFpppipp) GO(XmbResetIC, pFp) -GO(XmbSetWMProperties, vFpppppippp) +GO(XmbSetWMProperties, vFpLpppippp) //GO(_Xmbstoutf8, //GO(_Xmbstowcs, GO(XmbTextEscapement, iFppi) GO(XmbTextExtents, iFppipp) -GO(XmbTextListToTextProperty, iFppiip) //GO(_XmbTextListToTextProperty, -GO(XmbTextPerCharExtents, iFppippppp) -GO(XmbTextPropertyToTextList, iFpppp) +GO(XmbTextListToTextProperty, iFppiup) +GO(XmbTextPerCharExtents, iFppippippp) //GO(_XmbTextPropertyToTextList, +GO(XmbTextPropertyToTextList, iFpppp) GO(_Xmbtowc, iFppi) -//GO(XMinCmapsOfScreen +GO(XMinCmapsOfScreen, iFp) GO(XMoveResizeWindow, iFpLiiuu) GO(XMoveWindow, iFpLii) GO(XNewModifiermap, pFi) @@ -805,9 +925,15 @@ GO(XNoOp, iFp) //GO(_XNoticeCreateBitmap, //GO(_XNoticePutBitmap, GO(XOffsetRegion, iFpii) +//GO(_XomConvert, +//GO(_XomGenericDrawString, +//GO(_XomGenericOpenOM, +//GO(_XomGenericTextExtents, +//GO(_XomGetFontDataFromFontSet, +//GO(_XomInitConverter, GO(XOMOfOC, pFp) GOM(XOpenDisplay, pFEp) -GO(XOpenIM, pFpppp) +GOM(XOpenIM, pFEpppp) //GO(_XOpenLC, GO(XOpenOM, pFpppp) //GO(_XParseBaseFontNameList, @@ -816,29 +942,29 @@ GO(XParseGeometry, iFppppp) GO(XPeekEvent, iFpp) GOM(XPeekIfEvent, iFEpppp) GO(XPending, iFp) -//GO(Xpermalloc +GO(Xpermalloc, pFu) GO(XPlanesOfScreen, iFp) -GO(XPointInRegion, iFpp) -//GO(_XPollfdCacheAdd, -//GO(_XPollfdCacheDel, -//GO(_XPollfdCacheInit, +GO(XPointInRegion, iFpii) +GO(_XPollfdCacheAdd, vFpi) +GO(_XPollfdCacheDel, vFpi) +GO(_XPollfdCacheInit, iFp) GO(XPolygonRegion, pFpii) +//GOM(_XProcessInternalConnection, vFEpp) GO(XProcessInternalConnection, vFpi) -//GO(_XProcessInternalConnection, -//GO(_XProcessWindowAttributes, +GO(_XProcessWindowAttributes, vFppLp) GO(XProtocolRevision, iFp) GO(XProtocolVersion, iFp) +GO(_XPutBackEvent, iFpp) GO(XPutBackEvent, iFpp) -//GO(_XPutBackEvent, -GOM(XPutImage, iFEppppiiiiuu) -//GO(XPutPixel +GOM(XPutImage, iFEpLppiiiiuu) +//GO(XPutPixel, GO(XQLength, iFp) -GO(XQueryBestCursor, iFppuupp) +GO(XQueryBestCursor, iFpLuupp) GO(XQueryBestSize, iFpiLuupp) -//GO(XQueryBestStipple +GO(XQueryBestStipple, iFpLuupp) GO(XQueryBestTile, iFpLuupp) -GO(XQueryColor, iFppp) -GO(XQueryColors, iFpppi) +GO(XQueryColor, iFpLp) +GO(XQueryColors, iFpLpi) GOM(XQueryExtension, iFEppppp) GO(XQueryFont, pFpL) GO(XQueryKeymap, iFpp) @@ -846,24 +972,24 @@ GO(XQueryPointer, iFpLppppppp) GO(XQueryTextExtents, iFpLpipppp) GO(XQueryTextExtents16, iFpLpipppp) GO(XQueryTree, iFpLpppp) -GO(XRaiseWindow, iFpp) -GO(_XRead, iFppi) +GO(XRaiseWindow, iFpL) +GO(_XRead, iFppl) GO(XReadBitmapFile, iFpLpppppp) GO(XReadBitmapFileData, iFpppppp) GO(_XReadEvents, vFp) -GO(_XReadPad, vFppi) +GO(_XReadPad, vFppl) GO(XRebindKeysym, iFpLpipi) GO(XRecolorCursor, iFpLpp) GO(XReconfigureWMWindow, iFpLiup) GO(XRectInRegion, iFpiiuu) -GO(XRefreshKeyboardMapping, iFp) //GO(_XRefreshKeyboardMapping, +GO(XRefreshKeyboardMapping, iFp) //GO(_XRegisterFilterByMask, //GO(_XRegisterFilterByType, GOM(XRegisterIMInstantiateCallback, iFEpppppp) -//GO(_XRegisterInternalConnection, -GOM(XRemoveConnectionWatch, iFEppp) -//GO(XRemoveFromSaveSet +//GOM(_XRegisterInternalConnection, iFEpipp) +GOM(XRemoveConnectionWatch, vFEppp) +GO(XRemoveFromSaveSet, iFpL) GO(XRemoveHost, iFpp) GO(XRemoveHosts, iFppi) GO(XReparentWindow, iFpLLii) @@ -877,7 +1003,7 @@ GO(XrmCombineDatabase, vFppi) GO(XrmCombineFileDatabase, iFppi) //GO(_XrmDefaultInitParseInfo, GO(XrmDestroyDatabase, vFp) -//GOM(XrmEnumerateDatabase +//GOM(XrmEnumerateDatabase, iFEpppipp) GO(XrmGetDatabase, pFp) GO(XrmGetFileDatabase, pFp) GO(XrmGetResource, iFppppp) @@ -885,25 +1011,25 @@ GO(XrmGetStringDatabase, pFp) GO(XrmInitialize, vFv) //GO(_XrmInitParseInfo, //GO(_XrmInternalStringToQuark, -//GO(XrmLocaleOfDatabase -//GO(XrmMergeDatabases -//GO(XrmParseCommand -//GO(XrmPermStringToQuark -//GO(XrmPutFileDatabase -//GO(XrmPutLineResource -//GO(XrmPutResource -//GO(XrmPutStringResource -//GO(XrmQGetResource -//GO(XrmQGetSearchList -//GO(XrmQGetSearchResource -//GO(XrmQPutResource -//GO(XrmQPutStringResource -//GO(XrmQuarkToString -//GO(XrmSetDatabase -//GO(XrmStringToBindingQuarkList -//GO(XrmStringToQuark -//GO(XrmStringToQuarkList -GO(XrmUniqueQuark, iFv) //typedef int XrmQuark, *XrmQuarkList; +GO(XrmLocaleOfDatabase, pFp) +GO(XrmMergeDatabases, vFpp) +GO(XrmParseCommand, vFppippp) +GO(XrmPermStringToQuark, iFp) +GO(XrmPutFileDatabase, vFpp) +GO(XrmPutLineResource, vFpp) +GO(XrmPutResource, vFpppp) +GO(XrmPutStringResource, vFppp) +GO(XrmQGetResource, iFppppp) +GO(XrmQGetSearchList, iFppppi) +GO(XrmQGetSearchResource, iFpiipp) +GO(XrmQPutResource, vFpppip) +GO(XrmQPutStringResource, vFpppp) +GO(XrmQuarkToString, pFi) +GO(XrmSetDatabase, vFpp) +GO(XrmStringToBindingQuarkList, vFppp) +GO(XrmStringToQuark, iFp) +GO(XrmStringToQuarkList, vFpp) +GO(XrmUniqueQuark, iFv) GO(XRootWindow, LFpi) GO(XRootWindowOfScreen, LFp) GO(XRotateBuffers, iFpi) @@ -912,48 +1038,49 @@ GO(XSaveContext, iFpLip) GO(XScreenCount, iFp) GO(XScreenNumberOfScreen, iFp) GO(XScreenOfDisplay, pFpi) -//GO(_XScreenOfWindow, +GO(_XScreenOfWindow, pFpL) GO(XScreenResourceString, pFp) GO(XSelectInput, iFpLl) -GO(_XSend, vFppi) +GO(_XSend, vFppl) GO(XSendEvent, iFpLilp) GO(XServerVendor, pFp) -GO(XSetAccessControl, vFpi) +GO(XSetAccessControl, iFpi) GOM(XSetAfterFunction, pFEpp) GO(XSetArcMode, iFppi) GO(XSetAuthorization, vFpipi) GO(XSetBackground, iFppL) GO(XSetClassHint, iFpLp) -GO(XSetClipMask, iFppp) +GO(XSetClipMask, iFppL) GO(XSetClipOrigin, iFppii) +GO(_XSetClipRectangles, vFppiipii) GO(XSetClipRectangles, iFppiipii) -//GO(_XSetClipRectangles, GO(XSetCloseDownMode, iFpi) GO(XSetCommand, iFpLpi) GO(XSetDashes, iFppipi) GOM(XSetErrorHandler, pFEp) GO(XSetFillRule, iFppi) -GO(XSetFillStyle, iFppp) +GO(XSetFillStyle, iFppi) GO(XSetFont, iFppL) GO(XSetFontPath, iFppi) GO(XSetForeground, iFppL) GO(XSetFunction, iFppi) GO(XSetGraphicsExposures, iFppi) GO(XSetICFocus, vFp) -GO(XSetIconName, iFppp) +GO(XSetIconName, iFpLp) GO(XSetIconSizes, iFpLpi) -GOM(XSetICValues, pFEpV) // use vaarg +GOM(XSetICValues, pFEpV) //GO(_XSetImage, -GOM(XSetIMValues, pFEpV) // use vaarg +GOM(XSetIMValues, pFEpV) GO(XSetInputFocus, iFpLiL) +//GOM(XSetIOErrorExitHandler, vFEppp) GOM(XSetIOErrorHandler, pFEp) -GO(_XSetLastRequestRead, uFpp) +GO(_XSetLastRequestRead, LFpp) GO(XSetLineAttributes, iFppuiii) GO(XSetLocaleModifiers, pFp) GO(XSetModifierMapping, iFpp) -GO(XSetNormalHints, iFpppp) +GO(XSetNormalHints, iFpLp) GO(XSetOCValues, pFpppppppppppppppp) // use vaarg -GO(XSetOMValues, pFp) +GO(XSetOMValues, pFpppppppppppppppp) // use vaarg GO(XSetPlaneMask, iFppL) GO(XSetPointerMapping, iFppi) GO(XSetRegion, iFppp) @@ -964,22 +1091,22 @@ GO(XSetSizeHints, iFpLpL) GO(XSetStandardColormap, vFpLpL) GO(XSetStandardProperties, iFpLppLpip) GO(XSetState, iFppLLiL) -GO(XSetStipple, iFppp) +GO(XSetStipple, iFppL) GO(XSetSubwindowMode, iFppi) GO(XSetTextProperty, vFpLpL) GO(XSetTile, iFppL) GO(XSetTransientForHint, iFpLL) GO(XSetTSOrigin, iFppii) -GO(XSetWindowBackground, iFppu) -GO(XSetWindowBackgroundPixmap, iFppp) +GO(XSetWindowBackground, iFpLL) +GO(XSetWindowBackgroundPixmap, iFpLL) GO(XSetWindowBorder, iFpLL) GO(XSetWindowBorderPixmap, iFpLL) GO(XSetWindowBorderWidth, iFpLu) GO(XSetWindowColormap, iFpLL) -GO(XSetWMClientMachine, vFppp) +GO(XSetWMClientMachine, vFpLp) GO(XSetWMColormapWindows, iFpLpi) GO(XSetWMHints, iFpLp) -GO(XSetWMIconName, vFppp) +GO(XSetWMIconName, vFpLp) GO(XSetWMName, vFpLp) GO(XSetWMNormalHints, vFpLp) GO(XSetWMProperties, vFpLpppippp) @@ -991,12 +1118,12 @@ GO(XStoreBuffer, iFppii) GO(XStoreBytes, iFppi) GO(XStoreColor, iFpLp) GO(XStoreColors, iFpLpi) -//GO(_XStoreEventCookie, +GO(_XStoreEventCookie, vFpp) GO(XStoreName, iFpLp) GO(XStoreNamedColor, iFpLpLi) GO(XStringListToTextProperty, iFpip) GO(XStringToKeysym, LFp) -//GOM(XSubImage, pFEpiiuu) // need unbridging +//GOM(XSubImage, pFEpiiuu) // need unbridging GO(dummy_XSubImage, pFpiiuu) // for the wrapper GO(XSubtractRegion, iFppp) GO(XSupportsLocale, iFv) @@ -1014,7 +1141,7 @@ GO(XTranslateCoordinates, iFpLLiippp) //GO(_XTranslateKey, //GO(_XTranslateKeySym, //GO(_XTryShapeBitmapCursor, -GO(XUndefineCursor, iFpp) +GO(XUndefineCursor, iFpL) GO(XUngrabButton, iFpuuL) GO(XUngrabKey, iFpiuL) GO(XUngrabKeyboard, iFpL) @@ -1023,45 +1150,65 @@ GO(XUngrabServer, iFp) GO(XUninstallColormap, iFpL) GO(XUnionRectWithRegion, iFppp) GO(XUnionRegion, iFppp) -//GO(_XUnknownCopyEventCookie, -//GO(_XUnknownNativeEvent, -//GO(_XUnknownWireEvent, -//GO(_XUnknownWireEventCookie, +GO(_XUnknownCopyEventCookie, iFppp) +GO(_XUnknownNativeEvent, iFppp) +GO(_XUnknownWireEvent, iFppp) +GO(_XUnknownWireEventCookie, iFppp) GO(XUnloadFont, iFpL) GO(XUnlockDisplay, vFp) -DATAB(_XUnlockMutex_fn, sizeof(void*)) -GO(XUnmapSubwindows, iFpp) +DATA(_XUnlockMutex_fn, sizeof(void*)) +GO(XUnmapSubwindows, iFpL) GO(XUnmapWindow, iFpL) //GO(_XUnregisterFilter, GOM(XUnregisterIMInstantiateCallback, iFEpppppp) -//GO(_XUnregisterInternalConnection, +GO(_XUnregisterInternalConnection, vFpi) //GO(_XUnresolveColor, GO(XUnsetICFocus, vFp) //GO(_XUpdateAtomCache, //GO(_XUpdateGCCache, +//GO(_Xutf8DefaultDrawImageString, +//GO(_Xutf8DefaultDrawString, +//GO(_Xutf8DefaultTextEscapement, +//GO(_Xutf8DefaultTextExtents, +//GO(_Xutf8DefaultTextPerCharExtents, GO(Xutf8DrawImageString, vFpLppiipi) -GO(Xutf8DrawString, vFppppiipi) +GO(Xutf8DrawString, vFpLppiipi) GO(Xutf8DrawText, vFpLpiipi) +//GO(_Xutf8GenericDrawImageString, +//GO(_Xutf8GenericDrawString, +//GO(_Xutf8GenericTextEscapement, +//GO(_Xutf8GenericTextExtents, +//GO(_Xutf8GenericTextPerCharExtents, GO(Xutf8LookupString, iFpppipp) GO(Xutf8ResetIC, pFp) GO(Xutf8SetWMProperties, vFpLpppippp) GO(Xutf8TextEscapement, iFppi) GO(Xutf8TextExtents, iFppipp) -GO(Xutf8TextListToTextProperty, iFppiup) //GO(_Xutf8TextListToTextProperty, +GO(Xutf8TextListToTextProperty, iFppiup) GO(Xutf8TextPerCharExtents, iFppippippp) -GO(Xutf8TextPropertyToTextList, iFpppp) //GO(_Xutf8TextPropertyToTextList, +GO(Xutf8TextPropertyToTextList, iFpppp) GOM(XVaCreateNestedList, pFEiV) GO(XVendorRelease, iFp) -//GO(_XVIDtoVisual, +GO(_XVIDtoVisual, pFpL) GO(XVisualIDFromVisual, LFp) GO(XWarpPointer, iFpLLiiuuii) +//GO(_XwcDefaultDrawImageString, +//GO(_XwcDefaultDrawString, +//GO(_XwcDefaultTextEscapement, +//GO(_XwcDefaultTextExtents, +//GO(_XwcDefaultTextPerCharExtents, GO(XwcDrawImageString, vFpLppiipi) -GO(XwcDrawString, vFppppiipi) +GO(XwcDrawString, vFpLppiipi) GO(XwcDrawText, vFpLpiipi) -GO(XwcFreeStringList, vFp) //GO(_XwcFreeStringList, +GO(XwcFreeStringList, vFp) +//GO(_XwcGenericDrawImageString, +//GO(_XwcGenericDrawString, +//GO(_XwcGenericTextEscapement, +//GO(_XwcGenericTextExtents, +//GO(_XwcGenericTextPerCharExtents, GO(XwcLookupString, iFpppipp) GO(XwcResetIC, pFp) //GO(_Xwcscmp, @@ -1072,25 +1219,25 @@ GO(XwcResetIC, pFp) //GO(_Xwcstombs, GO(XwcTextEscapement, iFppi) GO(XwcTextExtents, iFppipp) -GO(XwcTextListToTextProperty, iFppiup) //GO(_XwcTextListToTextProperty, +GO(XwcTextListToTextProperty, iFppiup) GO(XwcTextPerCharExtents, iFppippippp) -GO(XwcTextPropertyToTextList, iFpppp) //GO(_XwcTextPropertyToTextList, -GO(_Xwctomb, iFpu) +GO(XwcTextPropertyToTextList, iFpppp) +GO(_Xwctomb, iFpi) GO(XWhitePixel, LFpi) GO(XWhitePixelOfScreen, LFp) -//GO(XWidthMMOfScreen +GO(XWidthMMOfScreen, iFp) GO(XWidthOfScreen, iFp) GO(XWindowEvent, iFpLlp) GO(_XWireToEvent, iFppp) -GO(XWithdrawWindow, iFppi) +GO(XWithdrawWindow, iFpLi) GO(XWMGeometry, iFpippupppppp) GO(XWriteBitmapFile, iFppLuuii) GO(XXorRegion, iFppp) GO(_XData32, iFppu) -GO(_XRead32, iFppL) +GO(_XRead32, vFppl) GO(dummy_putpixel, iFpiiL) GO(dummy_addpixel, iFpl) diff --git a/src/wrapped/wrappedlibx11xcb.c b/src/wrapped/wrappedlibx11xcb.c index bac9270..1ad2af5 100644 --- a/src/wrapped/wrappedlibx11xcb.c +++ b/src/wrapped/wrappedlibx11xcb.c @@ -18,6 +18,7 @@ #include "myalign.h" const char* libx11xcbName = "libX11-xcb.so.1"; +#define ALTNAME "libX11-xcb.so" #define LIBNAME libx11xcb #define ADDED_FUNCTIONS() \ @@ -28,7 +29,9 @@ const char* libx11xcbName = "libX11-xcb.so.1"; EXPORT void* my_XGetXCBConnection(x64emu_t* emu, void* a) { - return add_xcb_connection(my->XGetXCBConnection(a)); + void* ret = add_xcb_connection(my->XGetXCBConnection(a)); + register_xcb_display(a, ret); + return ret; } #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxau.c b/src/wrapped/wrappedlibxau.c index b03e75e..3d3c72c 100644 --- a/src/wrapped/wrappedlibxau.c +++ b/src/wrapped/wrappedlibxau.c @@ -11,11 +11,8 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* libxauName = "libXau.so"; -#else - const char* libxauName = "libXau.so.6"; -#endif +const char* libxauName = "libXau.so.6"; +#define ALTNAME "libXau.so" #define LIBNAME libxau diff --git a/src/wrapped/wrappedlibxaw.c b/src/wrapped/wrappedlibxaw.c new file mode 100644 index 0000000..d2d7ed4 --- /dev/null +++ b/src/wrapped/wrappedlibxaw.c @@ -0,0 +1,21 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" + +const char* libxawName = "libXaw.so.7"; +#define ALTNAME "libXaw.so" + +#define LIBNAME libxaw + +#define NEEDED_LIBS "libX11.so.6", "libXext.so.6", "libXmu.so.6", "libXt.so.6" + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxaw_private.h b/src/wrapped/wrappedlibxaw_private.h new file mode 100644 index 0000000..23de159 --- /dev/null +++ b/src/wrapped/wrappedlibxaw_private.h @@ -0,0 +1,189 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//GO(XawAddPixmapLoader, +GO(XawAsciiSave, iFp) +GO(XawAsciiSaveAsFile, iFpp) +GO(XawAsciiSourceChanged, iFp) +GO(XawAsciiSourceFreeString, vFp) +//GO(_Xaw_atowc, +//GO(XawBooleanExpression, +//GO(XawCallProcAction, +//GO(XawCreateDisplayList, +//GO(XawCreateDisplayListClass, +//GO(XawDeclareAction, +//GO(XawDeclareDisplayListProc, +//DATA(_XawDefaultTextTranslations, +//GO(XawDestroyDisplayList, +//GOM(XawDialogAddButton, vFEpppp) +GO(XawDialogGetValueString, pFp) +//GO(XawDisplayListInitialize, +//GO(XawDisplayListString, +//GO(XawFindArgVal, +//DATAB(XawFmt8Bit, 8) +//DATAB(XawFmtWide, 8) +GO(XawFormDoLayout, vFpc) +//GO(XawFreeParamsStruct, +//GO(XawGetActionResList, +//GO(XawGetActionVarList, +//GO(XawGetDisplayListClass, +//GO(_XawGetPageSize, +//GO(XawGetValuesAction, +GO(_XawImCallVendorShellExtResize, vFp) +GO(_XawImDestroy, vFpp) +GO(_XawImGetImAreaHeight, iFp) +GO(_XawImGetShellHeight, WFp) +GO(_XawImInitialize, vFpp) +GO(_XawImRealize, vFp) +GO(_XawImReconnect, vFp) +GO(_XawImRegister, vFp) +GO(_XawImResizeVendorShell, vFp) +GO(_XawImSetFocusValues, vFppu) +GO(_XawImSetValues, vFppu) +GO(_XawImUnregister, vFp) +GO(_XawImUnsetFocus, vFp) +GO(_XawImWcLookupString, iFpppip) +GO(XawInitializeDefaultConverters, vFv) +GO(XawInitializeWidgetSet, vFv) +//GO(_Xaw_iswalnum, +GO(XawListChange, vFppiic) +GO(XawListHighlight, vFpi) +GO(XawListShowCurrent, pFp) +GO(XawListUnhighlight, vFp) +//GO(XawLoadPixmap, +GO(_XawLookupString, iFpppip) +GO(_XawMultiSave, iFp) +GO(_XawMultiSaveAsFile, iFpp) +GO(_XawMultiSinkPosToXY, vFplpp) +GO(_XawMultiSourceFreeString, vFp) +//GOM(XawOpenApplication, pFEpppppppp) +GO(XawPanedAllowResize, vFpc) +GO(XawPanedGetMinMax, vFppp) +GO(XawPanedGetNumSub, iFp) +GO(XawPanedSetMinMax, vFpii) +GO(XawPanedSetRefigureMode, vFpc) +//GO(XawParseBoolean, +//GO(XawParseParamsString, +//GO(XawPixmapFromXPixmap, +//GO(XawPixmapsInitialize, +//GO(XawPrintActionErrorMsg, +//GO(XawReshapeWidget, +//GO(XawRunDisplayList, +GO(XawScrollbarSetThumb, vFpff) +//GO(XawSetValuesAction, +GO(XawSimpleMenuAddGlobalActions, vFp) +GO(XawSimpleMenuClearActiveEntry, vFp) +GO(XawSimpleMenuGetActiveEntry, pFp) +//GO(_XawSourceAddText, +//GO(_XawSourceRemoveText, +//GO(_XawSourceSetUndoErase, +//GO(_XawSourceSetUndoMerge, +//DATA(_XawTextActionsTable, +//DATA(_XawTextActionsTableCount, 4) +//GO(_XawTextAlterSelection, +//GOM(_XawTextBuildLineTable, vFEplc) +//GO(_XawTextCheckResize, +//GO(_XawTextClearAndCenterDisplay, +GO(XawTextDisableRedisplay, vFp) +GO(XawTextDisplay, vFp) +GO(XawTextDisplayCaret, vFpc) +//GO(_XawTextDoReplaceAction, +//GO(_XawTextDoSearchAction, +GO(XawTextEnableRedisplay, vFp) +//GO(_XawTextExecuteUpdate, +//GOM(_XawTextFormat, iFEp) +GO(XawTextGetInsertionPoint, lFp) +GO(XawTextGetSelectionPos, vFppp) +GO(XawTextGetSink, pFp) +GO(XawTextGetSource, pFp) +//GOM(_XawTextGetSTRING, pFEpll) +//GO(_XawTextGetText, +//GO(_XawTextInsertFile, +//GO(_XawTextInsertFileAction, +GO(XawTextInvalidate, vFpll) +//DATAB(xaw_text_kill_ring, 8) +GO(XawTextLastPosition, lFp) +GO(_XawTextMBToWC, pFppp) +//GOM(_XawTextNeedsUpdating, vFEpll) +//GO(_XawTextPopdownSearchAction, +GO(_XawTextPosToXY, vFplpp) +//GO(_XawTextPrepareToUpdate, +//GO(_XawTextReplace, +GO(XawTextReplace, iFpllp) +//GOM(_XawTextSaltAwaySelection, vFEppi) +//GO(XawTextScroll, +//GO(_XawTextSearch, +GO(XawTextSearch, lFpup) +//GO(_XawTextSelectionList, +//GO(_XawTextSetField, +GO(XawTextSetInsertionPoint, vFpl) +//GO(_XawTextSetLineAndColumnNumber, +//GO(_XawTextSetScrollBars, +//GO(_XawTextSetSelection, +GO(XawTextSetSelection, vFpll) +GO(XawTextSetSelectionArray, vFpp) +//GO(_XawTextSetSource, +GO(XawTextSetSource, vFppl) +//GO(_XawTextShowPosition, +//GOM(XawTextSinkAddProperty, pFEpp) +GO(XawTextSinkBeginPaint, iFp) +//GO(_XawTextSinkClearToBackground, +GO(XawTextSinkClearToBackground, vFpwwWW) +//GOM(XawTextSinkCombineProperty, pFEpppi) +//GOM(XawTextSinkConvertPropertyList, pFEpppLi) +//GOM(XawTextSinkCopyProperty, pFEpi) +//GO(_XawTextSinkDisplayText, +GO(XawTextSinkDisplayText, vFpwwllc) +GO(XawTextSinkDoPaint, vFp) +GO(XawTextSinkEndPaint, iFp) +GO(XawTextSinkFindDistance, vFplilppp) +GO(XawTextSinkFindPosition, vFpliicppp) +GO(XawTextSinkGetCursorBounds, vFpp) +//GOM(XawTextSinkGetProperty, pFEpi) +GO(XawTextSinkInsertCursor, vFpwwu) +GO(XawTextSinkMaxHeight, iFpi) +GO(XawTextSinkMaxLines, iFpW) +GO(XawTextSinkPreparePaint, vFpiilli) +GO(XawTextSinkResolve, vFpliip) +GO(XawTextSinkSetTabs, vFpip) +GO(XawTextSourceAddAnchor, pFpl) +GO(XawTextSourceAddEntity, pFpiiplui) +GO(XawTextSourceAnchorAndEntity, iFplpp) +//GO(_XawTextSourceChanged, +GO(XawTextSourceClearEntities, vFpll) +GO(XawTextSourceConvertSelection, cFppppppp) +//GO(_XawTextSourceFindAnchor, +GO(XawTextSourceFindAnchor, pFpl) +//GO(_XawTextSourceNewLineAtEOF, +GO(XawTextSourceNextAnchor, pFpp) +GO(XawTextSourcePrevAnchor, pFpp) +GO(XawTextSourceRead, lFplpi) +GO(XawTextSourceRemoveAnchor, pFpp) +GO(XawTextSourceReplace, iFpllp) +GO(XawTextSourceScan, lFpluuic) +GO(XawTextSourceSearch, lFplup) +GO(XawTextSourceSetSelection, vFpllL) +//GO(_XawTextSrcToggleUndo, +//GO(_XawTextSrcUndo, +GO(XawTextTopPosition, lFp) +GO(XawTextUnsetSelection, vFp) +//GO(_XawTextVScroll, +GO(_XawTextWCToMB, pFppp) +//GO(_XawTextZapSelection, +GO(XawTipDisable, vFp) +GO(XawTipEnable, vFp) +GO(XawToggleChangeRadioGroup, vFpp) +GO(XawToggleGetCurrent, pFp) +GO(XawToggleSetCurrent, vFpp) +GO(XawToggleUnsetCurrent, vFp) +GO(XawTreeForceLayout, vFp) +//GO(XawTypeToStringWarning, +//DATA(xawvendorShellExtClassRec, +//GO(XawVendorShellExtResize, +//DATA(xawvendorShellExtWidgetClass, +//GO(XawVendorStructureNotifyHandler, +GO(XawViewportSetCoordinates, vFpww) +GO(XawViewportSetLocation, vFpff) +//DATA(XawWidgetArray, +//DATA(XawWidgetCount, 4) diff --git a/src/wrapped/wrappedlibxcb.c b/src/wrapped/wrappedlibxcb.c index 46b78d7..8fedfa4 100644 --- a/src/wrapped/wrappedlibxcb.c +++ b/src/wrapped/wrappedlibxcb.c @@ -17,11 +17,8 @@ #include "emu/x64emu_private.h" #include "myalign.h" -#ifdef ANDROID - const char* libxcbName = "libxcb.so"; -#else - const char* libxcbName = "libxcb.so.1"; -#endif +const char* libxcbName = "libxcb.so.1"; +#define ALTNAME "libxcb.so" #define LIBNAME libxcb @@ -36,16 +33,22 @@ EXPORT void* my_xcb_connect(x64emu_t* emu, void* dispname, void* screen) return add_xcb_connection(my->xcb_connect(dispname, screen)); } +EXPORT void* my_xcb_connect_to_display_with_auth_info(x64emu_t* emu, void* dispname, void* auth, void* screen) +{ + return add_xcb_connection(my->xcb_connect_to_display_with_auth_info(dispname, auth, screen)); +} + +EXPORT void* my_xcb_connect_to_fd(x64emu_t* emu, int fd, void* auth) +{ + return add_xcb_connection(my->xcb_connect_to_fd(fd, auth)); +} + EXPORT void my_xcb_disconnect(x64emu_t* emu, void* conn) { my->xcb_disconnect(align_xcb_connection(conn)); del_xcb_connection(conn); } -#ifdef ANDROID -#define NEEDED_LIBS "libXau.so", "libXdmcp.so" -#else #define NEEDED_LIBS "libXau.so.6", "libXdmcp.so.6" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxcb_private.h b/src/wrapped/wrappedlibxcb_private.h index 1f90a87..93040ab 100644 --- a/src/wrapped/wrappedlibxcb_private.h +++ b/src/wrapped/wrappedlibxcb_private.h @@ -1,678 +1,678 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -GO(xcb_alloc_color, pFbuWWW) -//GO(xcb_alloc_color_cells, -//GO(xcb_alloc_color_cells_masks, -//GO(xcb_alloc_color_cells_masks_end, -//GO(xcb_alloc_color_cells_masks_length, -//GO(xcb_alloc_color_cells_pixels, -//GO(xcb_alloc_color_cells_pixels_end, -//GO(xcb_alloc_color_cells_pixels_length, -//GO(xcb_alloc_color_cells_reply, -//GO(xcb_alloc_color_cells_sizeof, -//GO(xcb_alloc_color_cells_unchecked, -//GO(xcb_alloc_color_planes, -//GO(xcb_alloc_color_planes_pixels, -//GO(xcb_alloc_color_planes_pixels_end, -//GO(xcb_alloc_color_planes_pixels_length, -//GO(xcb_alloc_color_planes_reply, -//GO(xcb_alloc_color_planes_sizeof, -//GO(xcb_alloc_color_planes_unchecked, +GO(xcb_alloc_color, UFbuWWW) +GO(xcb_alloc_color_cells, UFbCuWW) +GO(xcb_alloc_color_cells_masks, pFp) +GO(xcb_alloc_color_cells_masks_end, HFp) +GO(xcb_alloc_color_cells_masks_length, iFp) +GO(xcb_alloc_color_cells_pixels, pFp) +GO(xcb_alloc_color_cells_pixels_end, HFp) +GO(xcb_alloc_color_cells_pixels_length, iFp) +GO(xcb_alloc_color_cells_reply, pFbup) +GO(xcb_alloc_color_cells_sizeof, iFp) +GO(xcb_alloc_color_cells_unchecked, UFbCuWW) +GO(xcb_alloc_color_planes, UFbCuWWWW) +GO(xcb_alloc_color_planes_pixels, pFp) +GO(xcb_alloc_color_planes_pixels_end, HFp) +GO(xcb_alloc_color_planes_pixels_length, iFp) +GO(xcb_alloc_color_planes_reply, pFbup) +GO(xcb_alloc_color_planes_sizeof, iFp) +GO(xcb_alloc_color_planes_unchecked, UFbCuWWWW) GO(xcb_alloc_color_reply, pFbup) -//GO(xcb_alloc_color_unchecked, -//GO(xcb_alloc_named_color, -//GO(xcb_alloc_named_color_reply, -//GO(xcb_alloc_named_color_sizeof, -//GO(xcb_alloc_named_color_unchecked, -//GO(xcb_allow_events, -//GO(xcb_allow_events_checked, +GO(xcb_alloc_color_unchecked, UFbuWWW) +GO(xcb_alloc_named_color, UFbuWp) +GO(xcb_alloc_named_color_reply, pFbup) +GO(xcb_alloc_named_color_sizeof, iFp) +GO(xcb_alloc_named_color_unchecked, UFbuWp) +GO(xcb_allow_events, UFbCu) +GO(xcb_allow_events_checked, UFbCu) //GO(xcb_arc_end, -//GO(xcb_arc_next, +GO(xcb_arc_next, vFp) //GO(xcb_atom_end, -//GO(xcb_atom_next, -GO(xcb_bell, pFbC) -//GO(xcb_bell_checked, -//GO(xcb_big_requests_enable, -//GO(xcb_big_requests_enable_reply, -//GO(xcb_big_requests_enable_unchecked, -DATA(xcb_big_requests_id, sizeof(void*)) +GO(xcb_atom_next, vFp) +GO(xcb_bell, UFbc) +GO(xcb_bell_checked, UFbc) +GO(xcb_big_requests_enable, UFb) +GO(xcb_big_requests_enable_reply, pFbup) +GO(xcb_big_requests_enable_unchecked, UFb) +DATA(xcb_big_requests_id, 16) //GO(xcb_bool32_end, -//GO(xcb_bool32_next, +GO(xcb_bool32_next, vFp) //GO(xcb_button_end, -//GO(xcb_button_next, -//GO(xcb_change_active_pointer_grab, -//GO(xcb_change_active_pointer_grab_checked, -GO(xcb_change_gc, pFbuup) -//GO(xcb_change_gc_aux, -//GO(xcb_change_gc_aux_checked, -GO(xcb_change_gc_checked, pFbuup) -//GO(xcb_change_gc_sizeof, -//GO(xcb_change_gc_value_list, -//GO(xcb_change_gc_value_list_serialize, -//GO(xcb_change_gc_value_list_sizeof, -//GO(xcb_change_gc_value_list_unpack, -//GO(xcb_change_hosts, -//GO(xcb_change_hosts_address, -//GO(xcb_change_hosts_address_end, -//GO(xcb_change_hosts_address_length, -//GO(xcb_change_hosts_checked, -//GO(xcb_change_hosts_sizeof, -GO(xcb_change_keyboard_control, pFbup) -//GO(xcb_change_keyboard_control_aux, -//GO(xcb_change_keyboard_control_aux_checked, -//GO(xcb_change_keyboard_control_checked, -//GO(xcb_change_keyboard_control_sizeof, -//GO(xcb_change_keyboard_control_value_list, -//GO(xcb_change_keyboard_control_value_list_serialize, -//GO(xcb_change_keyboard_control_value_list_sizeof, -//GO(xcb_change_keyboard_control_value_list_unpack, -//GO(xcb_change_keyboard_mapping, -//GO(xcb_change_keyboard_mapping_checked, -//GO(xcb_change_keyboard_mapping_keysyms, -//GO(xcb_change_keyboard_mapping_keysyms_end, -//GO(xcb_change_keyboard_mapping_keysyms_length, -//GO(xcb_change_keyboard_mapping_sizeof, -//GO(xcb_change_pointer_control, -//GO(xcb_change_pointer_control_checked, -GO(xcb_change_property, uFbCuuuCup) -GO(xcb_change_property_checked, uFbCuuuCup) -//GO(xcb_change_property_data, -//GO(xcb_change_property_data_end, -//GO(xcb_change_property_data_length, -//GO(xcb_change_property_sizeof, -//GO(xcb_change_save_set, -//GO(xcb_change_save_set_checked, -GO(xcb_change_window_attributes, uFbuup) -//GO(xcb_change_window_attributes_aux, -//GO(xcb_change_window_attributes_aux_checked, -GO(xcb_change_window_attributes_checked, pFbuup) -//GO(xcb_change_window_attributes_sizeof, -//GO(xcb_change_window_attributes_value_list, -//GO(xcb_change_window_attributes_value_list_serialize, -//GO(xcb_change_window_attributes_value_list_sizeof, -//GO(xcb_change_window_attributes_value_list_unpack, +GO(xcb_button_next, vFp) +GO(xcb_change_active_pointer_grab, UFbuuW) +GO(xcb_change_active_pointer_grab_checked, UFbuuW) +GO(xcb_change_gc, UFbuup) +GO(xcb_change_gc_aux, UFbuup) +GO(xcb_change_gc_aux_checked, UFbuup) +GO(xcb_change_gc_checked, UFbuup) +GO(xcb_change_gc_sizeof, iFp) +GO(xcb_change_gc_value_list, pFp) +GO(xcb_change_gc_value_list_serialize, iFpup) +GO(xcb_change_gc_value_list_sizeof, iFpu) +GO(xcb_change_gc_value_list_unpack, iFpup) +GO(xcb_change_hosts, UFbCCWp) +GO(xcb_change_hosts_address, pFp) +GO(xcb_change_hosts_address_end, HFp) +GO(xcb_change_hosts_address_length, iFp) +GO(xcb_change_hosts_checked, UFbCCWp) +GO(xcb_change_hosts_sizeof, iFp) +GO(xcb_change_keyboard_control, UFbup) +GO(xcb_change_keyboard_control_aux, UFbup) +GO(xcb_change_keyboard_control_aux_checked, UFbup) +GO(xcb_change_keyboard_control_checked, UFbup) +GO(xcb_change_keyboard_control_sizeof, iFp) +GO(xcb_change_keyboard_control_value_list, pFp) +GO(xcb_change_keyboard_control_value_list_serialize, iFpup) +GO(xcb_change_keyboard_control_value_list_sizeof, iFpu) +GO(xcb_change_keyboard_control_value_list_unpack, iFpup) +GO(xcb_change_keyboard_mapping, UFbCCCp) +GO(xcb_change_keyboard_mapping_checked, UFbCCCp) +GO(xcb_change_keyboard_mapping_keysyms, pFp) +GO(xcb_change_keyboard_mapping_keysyms_end, HFp) +GO(xcb_change_keyboard_mapping_keysyms_length, iFp) +GO(xcb_change_keyboard_mapping_sizeof, iFp) +GO(xcb_change_pointer_control, UFbwwwCC) +GO(xcb_change_pointer_control_checked, UFbwwwCC) +GO(xcb_change_property, UFbCuuuCup) +GO(xcb_change_property_checked, UFbCuuuCup) +GO(xcb_change_property_data, pFp) +GO(xcb_change_property_data_end, HFp) +GO(xcb_change_property_data_length, iFp) +GO(xcb_change_property_sizeof, iFp) +GO(xcb_change_save_set, UFbCu) +GO(xcb_change_save_set_checked, UFbCu) +GO(xcb_change_window_attributes, UFbuup) +GO(xcb_change_window_attributes_aux, UFbuup) +GO(xcb_change_window_attributes_aux_checked, UFbuup) +GO(xcb_change_window_attributes_checked, UFbuup) +GO(xcb_change_window_attributes_sizeof, iFp) +GO(xcb_change_window_attributes_value_list, pFp) +GO(xcb_change_window_attributes_value_list_serialize, iFpup) +GO(xcb_change_window_attributes_value_list_sizeof, iFpu) +GO(xcb_change_window_attributes_value_list_unpack, iFpup) //GO(xcb_char2b_end, -//GO(xcb_char2b_next, +GO(xcb_char2b_next, vFp) //GO(xcb_charinfo_end, -//GO(xcb_charinfo_next, -//GO(xcb_circulate_window, -//GO(xcb_circulate_window_checked, -GO(xcb_clear_area, pFbCuwwWW) -//GO(xcb_clear_area_checked, +GO(xcb_charinfo_next, vFp) +GO(xcb_circulate_window, UFbCu) +GO(xcb_circulate_window_checked, UFbCu) +GO(xcb_clear_area, UFbCuwwWW) +GO(xcb_clear_area_checked, UFbCuwwWW) //GO(xcb_client_message_data_end, -//GO(xcb_client_message_data_next, -GO(xcb_close_font, pFbu) -GO(xcb_close_font_checked, pFbu) +GO(xcb_client_message_data_next, vFp) +GO(xcb_close_font, UFbu) +GO(xcb_close_font_checked, UFbu) //GO(xcb_coloritem_end, -//GO(xcb_coloritem_next, +GO(xcb_coloritem_next, vFp) //GO(xcb_colormap_end, -//GO(xcb_colormap_next, -GO(xcb_configure_window, pFbuWp) -//GO(xcb_configure_window_aux, -//GO(xcb_configure_window_aux_checked, -//GO(xcb_configure_window_checked, -//GO(xcb_configure_window_sizeof, -//GO(xcb_configure_window_value_list, -//GO(xcb_configure_window_value_list_serialize, -//GO(xcb_configure_window_value_list_sizeof, -//GO(xcb_configure_window_value_list_unpack, +GO(xcb_colormap_next, vFp) +GO(xcb_configure_window, UFbuWp) +GO(xcb_configure_window_aux, UFbuWp) +GO(xcb_configure_window_aux_checked, UFbuWp) +GO(xcb_configure_window_checked, UFbuWp) +GO(xcb_configure_window_sizeof, iFp) +GO(xcb_configure_window_value_list, pFp) +GO(xcb_configure_window_value_list_serialize, iFpWp) +GO(xcb_configure_window_value_list_sizeof, iFpW) +GO(xcb_configure_window_value_list_unpack, iFpWp) GOM(xcb_connect, pFEpp) GO(xcb_connection_has_error, iFb) -//GO(xcb_connect_to_display_with_auth_info, -//GO(xcb_connect_to_fd, -GO(xcb_convert_selection, pFbuuuuu) -//GO(xcb_convert_selection_checked, -GO(xcb_copy_area, pFbuuuwwwwWW) -GO(xcb_copy_area_checked, pFbuuuwwwwWW) -//GO(xcb_copy_colormap_and_free, -//GO(xcb_copy_colormap_and_free_checked, -//GO(xcb_copy_gc, -//GO(xcb_copy_gc_checked, -//GO(xcb_copy_plane, -//GO(xcb_copy_plane_checked, -GO(xcb_create_colormap, uFbCuuu) -GO(xcb_create_colormap_checked, uFbCuuu) -GO(xcb_create_cursor, pFbuuuWWWWWWWW) -//GO(xcb_create_cursor_checked, -GO(xcb_create_gc, uFbuuup) -//GO(xcb_create_gc_aux, -//GO(xcb_create_gc_aux_checked, -GO(xcb_create_gc_checked, uFbuuup) -//GO(xcb_create_gc_sizeof, -//GO(xcb_create_gc_value_list, -//GO(xcb_create_gc_value_list_serialize, -//GO(xcb_create_gc_value_list_sizeof, -//GO(xcb_create_gc_value_list_unpack, -GO(xcb_create_glyph_cursor, pFbuuuWWWWWWWW) -//GO(xcb_create_glyph_cursor_checked, -GO(xcb_create_pixmap, uFbCuuWW) -GO(xcb_create_pixmap_checked, uFbCuuWW) -GO(xcb_create_window, uFbCuuwwWWWWuup) -//GO(xcb_create_window_aux, -//GO(xcb_create_window_aux_checked, -GO(xcb_create_window_checked, uFbCuuwwWWWWuup) -//GO(xcb_create_window_sizeof, -//GO(xcb_create_window_value_list, -//GO(xcb_create_window_value_list_serialize, -//GO(xcb_create_window_value_list_sizeof, -//GO(xcb_create_window_value_list_unpack, +GOM(xcb_connect_to_display_with_auth_info, pFEppp) +GOM(xcb_connect_to_fd, pFEip) +GO(xcb_convert_selection, UFbuuuuu) +GO(xcb_convert_selection_checked, UFbuuuuu) +GO(xcb_copy_area, UFbuuuwwwwWW) +GO(xcb_copy_area_checked, UFbuuuwwwwWW) +GO(xcb_copy_colormap_and_free, UFbuu) +GO(xcb_copy_colormap_and_free_checked, UFbuu) +GO(xcb_copy_gc, UFbuuu) +GO(xcb_copy_gc_checked, UFbuuu) +GO(xcb_copy_plane, UFbuuuwwwwWWu) +GO(xcb_copy_plane_checked, UFbuuuwwwwWWu) +GO(xcb_create_colormap, UFbCuuu) +GO(xcb_create_colormap_checked, UFbCuuu) +GO(xcb_create_cursor, UFbuuuWWWWWWWW) +GO(xcb_create_cursor_checked, UFbuuuWWWWWWWW) +GO(xcb_create_gc, UFbuuup) +GO(xcb_create_gc_aux, UFbuuup) +GO(xcb_create_gc_aux_checked, UFbuuup) +GO(xcb_create_gc_checked, UFbuuup) +GO(xcb_create_gc_sizeof, iFp) +GO(xcb_create_gc_value_list, pFp) +GO(xcb_create_gc_value_list_serialize, iFpup) +GO(xcb_create_gc_value_list_sizeof, iFpu) +GO(xcb_create_gc_value_list_unpack, iFpup) +GO(xcb_create_glyph_cursor, UFbuuuWWWWWWWW) +GO(xcb_create_glyph_cursor_checked, UFbuuuWWWWWWWW) +GO(xcb_create_pixmap, UFbCuuWW) +GO(xcb_create_pixmap_checked, UFbCuuWW) +GO(xcb_create_window, UFbCuuwwWWWWuup) +GO(xcb_create_window_aux, UFbCuuwwWWWWuup) +GO(xcb_create_window_aux_checked, UFbCuuwwWWWWuup) +GO(xcb_create_window_checked, UFbCuuwwWWWWuup) +GO(xcb_create_window_sizeof, iFp) +GO(xcb_create_window_value_list, pFp) +GO(xcb_create_window_value_list_serialize, iFpup) +GO(xcb_create_window_value_list_sizeof, iFpu) +GO(xcb_create_window_value_list_unpack, iFpup) //GO(xcb_cursor_end, -//GO(xcb_cursor_next, -GO(xcb_delete_property, uFbuu) -GO(xcb_delete_property_checked, uFbuu) +GO(xcb_cursor_next, vFp) +GO(xcb_delete_property, UFbuu) +GO(xcb_delete_property_checked, UFbuu) //GO(xcb_depth_end, GO(xcb_depth_next, vFp) GO(xcb_depth_sizeof, iFp) GO(xcb_depth_visuals, pFp) -GO(xcb_depth_visuals_iterator, HFp) //xcb_visualtype_iterator_t is a structure -//GO(xcb_depth_visuals_length, -//GO(xcb_destroy_subwindows, -//GO(xcb_destroy_subwindows_checked, -GO(xcb_destroy_window, pFbu) -//GO(xcb_destroy_window_checked, +GO(xcb_depth_visuals_iterator, HFp) +GO(xcb_depth_visuals_length, iFp) +GO(xcb_destroy_subwindows, UFbu) +GO(xcb_destroy_subwindows_checked, UFbu) +GO(xcb_destroy_window, UFbu) +GO(xcb_destroy_window_checked, UFbu) GO(xcb_discard_reply, vFbu) GO(xcb_discard_reply64, vFbU) GOM(xcb_disconnect, vFEp) //GO(xcb_drawable_end, -//GO(xcb_drawable_next, -//GO(xcb_fill_poly, -//GO(xcb_fill_poly_checked, -//GO(xcb_fill_poly_points, -//GO(xcb_fill_poly_points_iterator, -//GO(xcb_fill_poly_points_length, -//GO(xcb_fill_poly_sizeof, +GO(xcb_drawable_next, vFp) +GO(xcb_fill_poly, UFbuuCCup) +GO(xcb_fill_poly_checked, UFbuuCCup) +GO(xcb_fill_poly_points, pFp) +GO(xcb_fill_poly_points_iterator, HFp) +GO(xcb_fill_poly_points_length, iFp) +GO(xcb_fill_poly_sizeof, iFpu) GO(xcb_flush, iFb) //GO(xcb_fontable_end, -//GO(xcb_fontable_next, +GO(xcb_fontable_next, vFp) //GO(xcb_font_end, -//GO(xcb_font_next, +GO(xcb_font_next, vFp) //GO(xcb_fontprop_end, -//GO(xcb_fontprop_next, -//GO(xcb_force_screen_saver, -//GO(xcb_force_screen_saver_checked, +GO(xcb_fontprop_next, vFp) +GO(xcb_force_screen_saver, UFbC) +GO(xcb_force_screen_saver_checked, UFbC) //GO(xcb_format_end, GO(xcb_format_next, vFp) -GO(xcb_free_colormap, pFbu) -GO(xcb_free_colormap_checked, pFbu) -//GO(xcb_free_colors, -//GO(xcb_free_colors_checked, -//GO(xcb_free_colors_pixels, -//GO(xcb_free_colors_pixels_end, -//GO(xcb_free_colors_pixels_length, -//GO(xcb_free_colors_sizeof, -GO(xcb_free_cursor, pFbp) -//GO(xcb_free_cursor_checked, -GO(xcb_free_gc, uFbu) -GO(xcb_free_gc_checked, uFbu) -GO(xcb_free_pixmap, uFbu) -GO(xcb_free_pixmap_checked, uFbu) +GO(xcb_free_colormap, UFbu) +GO(xcb_free_colormap_checked, UFbu) +GO(xcb_free_colors, UFbuuup) +GO(xcb_free_colors_checked, UFbuuup) +GO(xcb_free_colors_pixels, pFp) +GO(xcb_free_colors_pixels_end, HFp) +GO(xcb_free_colors_pixels_length, iFp) +GO(xcb_free_colors_sizeof, iFpu) +GO(xcb_free_cursor, UFbu) +GO(xcb_free_cursor_checked, UFbu) +GO(xcb_free_gc, UFbu) +GO(xcb_free_gc_checked, UFbu) +GO(xcb_free_pixmap, UFbu) +GO(xcb_free_pixmap_checked, UFbu) //GO(xcb_gcontext_end, -//GO(xcb_gcontext_next, +GO(xcb_gcontext_next, vFp) GO(xcb_generate_id, uFb) -GO(xcb_get_atom_name, uFbu) +GO(xcb_get_atom_name, UFbu) GO(xcb_get_atom_name_name, pFp) -//GO(xcb_get_atom_name_name_end, +GO(xcb_get_atom_name_name_end, HFp) GO(xcb_get_atom_name_name_length, iFp) GO(xcb_get_atom_name_reply, pFbup) -//GO(xcb_get_atom_name_sizeof, -//GO(xcb_get_atom_name_unchecked, +GO(xcb_get_atom_name_sizeof, iFp) +GO(xcb_get_atom_name_unchecked, UFbu) GO(xcb_get_extension_data, pFbp) GO(xcb_get_file_descriptor, iFb) -//GO(xcb_get_font_path, -//GO(xcb_get_font_path_path_iterator, -//GO(xcb_get_font_path_path_length, -//GO(xcb_get_font_path_reply, -//GO(xcb_get_font_path_sizeof, -//GO(xcb_get_font_path_unchecked, -GO(xcb_get_geometry, pFbu) +GO(xcb_get_font_path, UFb) +GO(xcb_get_font_path_path_iterator, HFp) +GO(xcb_get_font_path_path_length, iFp) +GO(xcb_get_font_path_reply, pFbup) +GO(xcb_get_font_path_sizeof, iFp) +GO(xcb_get_font_path_unchecked, UFb) +GO(xcb_get_geometry, UFbu) GO(xcb_get_geometry_reply, pFbup) -GO(xcb_get_geometry_unchecked, pFbu) -GO(xcb_get_image, pFbCuwwWWu) +GO(xcb_get_geometry_unchecked, UFbu) +GO(xcb_get_image, UFbCuwwWWu) GO(xcb_get_image_data, pFp) -//GO(xcb_get_image_data_end, +GO(xcb_get_image_data_end, HFp) GO(xcb_get_image_data_length, iFp) GO(xcb_get_image_reply, pFbup) -//GO(xcb_get_image_sizeof, -GO(xcb_get_image_unchecked, pFbCuwwWWu) -GO(xcb_get_input_focus, uFb) +GO(xcb_get_image_sizeof, iFp) +GO(xcb_get_image_unchecked, UFbCuwwWWu) +GO(xcb_get_input_focus, UFb) GO(xcb_get_input_focus_reply, pFbup) -//GO(xcb_get_input_focus_unchecked, -//GO(xcb_get_keyboard_control, -//GO(xcb_get_keyboard_control_reply, -//GO(xcb_get_keyboard_control_unchecked, -GO(xcb_get_keyboard_mapping, pFbCC) +GO(xcb_get_input_focus_unchecked, UFb) +GO(xcb_get_keyboard_control, UFb) +GO(xcb_get_keyboard_control_reply, pFbup) +GO(xcb_get_keyboard_control_unchecked, UFb) +GO(xcb_get_keyboard_mapping, UFbCC) GO(xcb_get_keyboard_mapping_keysyms, pFp) -//GO(xcb_get_keyboard_mapping_keysyms_end, +GO(xcb_get_keyboard_mapping_keysyms_end, HFp) GO(xcb_get_keyboard_mapping_keysyms_length, iFp) GO(xcb_get_keyboard_mapping_reply, pFbup) -//GO(xcb_get_keyboard_mapping_sizeof, -//GO(xcb_get_keyboard_mapping_unchecked, +GO(xcb_get_keyboard_mapping_sizeof, iFp) +GO(xcb_get_keyboard_mapping_unchecked, UFbCC) GO(xcb_get_maximum_request_length, uFb) -GO(xcb_get_modifier_mapping, pFb) +GO(xcb_get_modifier_mapping, UFb) GO(xcb_get_modifier_mapping_keycodes, pFp) -//GO(xcb_get_modifier_mapping_keycodes_end, +GO(xcb_get_modifier_mapping_keycodes_end, HFp) GO(xcb_get_modifier_mapping_keycodes_length, iFp) GO(xcb_get_modifier_mapping_reply, pFbup) -//GO(xcb_get_modifier_mapping_sizeof, pFp) -//GO(xcb_get_modifier_mapping_unchecked, -//GO(xcb_get_motion_events, -//GO(xcb_get_motion_events_events, -//GO(xcb_get_motion_events_events_iterator, -//GO(xcb_get_motion_events_events_length, -//GO(xcb_get_motion_events_reply, -//GO(xcb_get_motion_events_sizeof, -//GO(xcb_get_motion_events_unchecked, -//GO(xcb_get_pointer_control, -//GO(xcb_get_pointer_control_reply, -//GO(xcb_get_pointer_control_unchecked, -//GO(xcb_get_pointer_mapping, -//GO(xcb_get_pointer_mapping_map, -//GO(xcb_get_pointer_mapping_map_end, -//GO(xcb_get_pointer_mapping_map_length, -//GO(xcb_get_pointer_mapping_reply, -//GO(xcb_get_pointer_mapping_sizeof, -//GO(xcb_get_pointer_mapping_unchecked, -GO(xcb_get_property, uFbCuuuuu) +GO(xcb_get_modifier_mapping_sizeof, iFp) +GO(xcb_get_modifier_mapping_unchecked, UFb) +GO(xcb_get_motion_events, UFbuuu) +GO(xcb_get_motion_events_events, pFp) +GO(xcb_get_motion_events_events_iterator, HFp) +GO(xcb_get_motion_events_events_length, iFp) +GO(xcb_get_motion_events_reply, pFbup) +GO(xcb_get_motion_events_sizeof, iFp) +GO(xcb_get_motion_events_unchecked, UFbuuu) +GO(xcb_get_pointer_control, UFb) +GO(xcb_get_pointer_control_reply, pFbup) +GO(xcb_get_pointer_control_unchecked, UFb) +GO(xcb_get_pointer_mapping, UFb) +GO(xcb_get_pointer_mapping_map, pFp) +GO(xcb_get_pointer_mapping_map_end, HFp) +GO(xcb_get_pointer_mapping_map_length, iFp) +GO(xcb_get_pointer_mapping_reply, pFbup) +GO(xcb_get_pointer_mapping_sizeof, iFp) +GO(xcb_get_pointer_mapping_unchecked, UFb) +GO(xcb_get_property, UFbCuuuuu) GO(xcb_get_property_reply, pFbup) -//GO(xcb_get_property_sizeof, -GO(xcb_get_property_unchecked, uFbCuuuuu) +GO(xcb_get_property_sizeof, iFp) +GO(xcb_get_property_unchecked, UFbCuuuuu) GO(xcb_get_property_value, pFp) -//GO(xcb_get_property_value_end, +GO(xcb_get_property_value_end, HFp) GO(xcb_get_property_value_length, iFp) -GO(xcb_get_reply_fds, pFbpu) -//GO(xcb_get_screen_saver, -//GO(xcb_get_screen_saver_reply, -//GO(xcb_get_screen_saver_unchecked, -GO(xcb_get_selection_owner, uFbu) +GO(xcb_get_reply_fds, pFbpL) +GO(xcb_get_screen_saver, UFb) +GO(xcb_get_screen_saver_reply, pFbup) +GO(xcb_get_screen_saver_unchecked, UFb) +GO(xcb_get_selection_owner, UFbu) GO(xcb_get_selection_owner_reply, pFbup) -GO(xcb_get_selection_owner_unchecked, uFbu) +GO(xcb_get_selection_owner_unchecked, UFbu) GO(xcb_get_setup, pFb) -GO(xcb_get_window_attributes, uFbu) +GO(xcb_get_window_attributes, UFbu) GO(xcb_get_window_attributes_reply, pFbup) -GO(xcb_get_window_attributes_unchecked, uFbu) -GO(xcb_grab_button, pFbCuWCCuuCW) -GO(xcb_grab_button_checked, pFbCuWCCuuCW) -GO(xcb_grab_key, pFbCuWCCC) -GO(xcb_grab_keyboard, pFbCuuCC) +GO(xcb_get_window_attributes_unchecked, UFbu) +GO(xcb_grab_button, UFbCuWCCuuCW) +GO(xcb_grab_button_checked, UFbCuWCCuuCW) +GO(xcb_grab_key, UFbCuWCCC) +GO(xcb_grab_keyboard, UFbCuuCC) GO(xcb_grab_keyboard_reply, pFbup) -//GO(xcb_grab_keyboard_unchecked, -GO(xcb_grab_key_checked, pFbCuWCCC) -GO(xcb_grab_pointer, pFbCuWCCuuu) +GO(xcb_grab_keyboard_unchecked, UFbCuuCC) +GO(xcb_grab_key_checked, UFbCuWCCC) +GO(xcb_grab_pointer, UFbCuWCCuuu) GO(xcb_grab_pointer_reply, pFbup) -//GO(xcb_grab_pointer_unchecked, -GO(xcb_grab_server, uFb) -GO(xcb_grab_server_checked, uFb) -//GO(xcb_host_address, -//GO(xcb_host_address_end, -//GO(xcb_host_address_length, +GO(xcb_grab_pointer_unchecked, UFbCuWCCuuu) +GO(xcb_grab_server, UFb) +GO(xcb_grab_server_checked, UFb) +GO(xcb_host_address, pFp) +GO(xcb_host_address_end, HFp) +GO(xcb_host_address_length, iFp) //GO(xcb_host_end, -//GO(xcb_host_next, -//GO(xcb_host_sizeof, -//GO(xcb_image_text_16, -//GO(xcb_image_text_16_checked, -//GO(xcb_image_text_16_sizeof, -//GO(xcb_image_text_16_string, -//GO(xcb_image_text_16_string_iterator, -//GO(xcb_image_text_16_string_length, -GO(xcb_image_text_8, pFbCuuwwp) -GO(xcb_image_text_8_checked, pFbCuuwwp) -//GO(xcb_image_text_8_sizeof, -//GO(xcb_image_text_8_string, -//GO(xcb_image_text_8_string_end, -//GO(xcb_image_text_8_string_length, -//GO(xcb_install_colormap, -//GO(xcb_install_colormap_checked, -GO(xcb_intern_atom, uFbCWp) +GO(xcb_host_next, vFp) +GO(xcb_host_sizeof, iFp) +GO(xcb_image_text_16, UFbCuuwwp) +GO(xcb_image_text_16_checked, UFbCuuwwp) +GO(xcb_image_text_16_sizeof, iFp) +GO(xcb_image_text_16_string, pFp) +GO(xcb_image_text_16_string_iterator, HFp) +GO(xcb_image_text_16_string_length, iFp) +GO(xcb_image_text_8, UFbCuuwwp) +GO(xcb_image_text_8_checked, UFbCuuwwp) +GO(xcb_image_text_8_sizeof, iFp) +GO(xcb_image_text_8_string, pFp) +GO(xcb_image_text_8_string_end, HFp) +GO(xcb_image_text_8_string_length, iFp) +GO(xcb_install_colormap, UFbu) +GO(xcb_install_colormap_checked, UFbu) +GO(xcb_intern_atom, UFbCWp) GO(xcb_intern_atom_reply, pFbup) -//GO(xcb_intern_atom_sizeof, -GO(xcb_intern_atom_unchecked, uFbCWp) +GO(xcb_intern_atom_sizeof, iFp) +GO(xcb_intern_atom_unchecked, UFbCWp) //GO(xcb_keycode32_end, -//GO(xcb_keycode32_next, +GO(xcb_keycode32_next, vFp) //GO(xcb_keycode_end, -//GO(xcb_keycode_next, +GO(xcb_keycode_next, vFp) //GO(xcb_keysym_end, -//GO(xcb_keysym_next, -//GO(xcb_kill_client, -//GO(xcb_kill_client_checked, -//GO(xcb_list_extensions, -//GO(xcb_list_extensions_names_iterator, -//GO(xcb_list_extensions_names_length, -//GO(xcb_list_extensions_reply, -//GO(xcb_list_extensions_sizeof, -//GO(xcb_list_extensions_unchecked, -//GO(xcb_list_fonts, -//GO(xcb_list_fonts_names_iterator, -//GO(xcb_list_fonts_names_length, -//GO(xcb_list_fonts_reply, -//GO(xcb_list_fonts_sizeof, -//GO(xcb_list_fonts_unchecked, -//GO(xcb_list_fonts_with_info, -//GO(xcb_list_fonts_with_info_name, -//GO(xcb_list_fonts_with_info_name_end, -//GO(xcb_list_fonts_with_info_name_length, -//GO(xcb_list_fonts_with_info_properties, -//GO(xcb_list_fonts_with_info_properties_iterator, -//GO(xcb_list_fonts_with_info_properties_length, -//GO(xcb_list_fonts_with_info_reply, -//GO(xcb_list_fonts_with_info_sizeof, -//GO(xcb_list_fonts_with_info_unchecked, -//GO(xcb_list_hosts, -//GO(xcb_list_hosts_hosts_iterator, -//GO(xcb_list_hosts_hosts_length, -//GO(xcb_list_hosts_reply, -//GO(xcb_list_hosts_sizeof, -//GO(xcb_list_hosts_unchecked, -//GO(xcb_list_installed_colormaps, -//GO(xcb_list_installed_colormaps_cmaps, -//GO(xcb_list_installed_colormaps_cmaps_end, -//GO(xcb_list_installed_colormaps_cmaps_length, -//GO(xcb_list_installed_colormaps_reply, -//GO(xcb_list_installed_colormaps_sizeof, -//GO(xcb_list_installed_colormaps_unchecked, -//GO(xcb_list_properties, -//GO(xcb_list_properties_atoms, -//GO(xcb_list_properties_atoms_end, -//GO(xcb_list_properties_atoms_length, -//GO(xcb_list_properties_reply, -//GO(xcb_list_properties_sizeof, -//GO(xcb_list_properties_unchecked, -//GO(xcb_lookup_color, -//GO(xcb_lookup_color_reply, -//GO(xcb_lookup_color_sizeof, -//GO(xcb_lookup_color_unchecked, -GO(xcb_map_subwindows, uFbu) -//GO(xcb_map_subwindows_checked, -GO(xcb_map_window, uFbu) -GO(xcb_map_window_checked, uFbu) -//GO(xcb_no_operation, -//GO(xcb_no_operation_checked, -GO(xcb_open_font, uFbuWp) -GO(xcb_open_font_checked, uFbuWp) -//GO(xcb_open_font_name, -//GO(xcb_open_font_name_end, -//GO(xcb_open_font_name_length, -//GO(xcb_open_font_sizeof, +GO(xcb_keysym_next, vFp) +GO(xcb_kill_client, UFbu) +GO(xcb_kill_client_checked, UFbu) +GO(xcb_list_extensions, UFb) +GO(xcb_list_extensions_names_iterator, HFp) +GO(xcb_list_extensions_names_length, iFp) +GO(xcb_list_extensions_reply, pFbup) +GO(xcb_list_extensions_sizeof, iFp) +GO(xcb_list_extensions_unchecked, UFb) +GO(xcb_list_fonts, UFbWWp) +GO(xcb_list_fonts_names_iterator, HFp) +GO(xcb_list_fonts_names_length, iFp) +GO(xcb_list_fonts_reply, pFbup) +GO(xcb_list_fonts_sizeof, iFp) +GO(xcb_list_fonts_unchecked, UFbWWp) +GO(xcb_list_fonts_with_info, UFbWWp) +GO(xcb_list_fonts_with_info_name, pFp) +GO(xcb_list_fonts_with_info_name_end, HFp) +GO(xcb_list_fonts_with_info_name_length, iFp) +GO(xcb_list_fonts_with_info_properties, pFp) +GO(xcb_list_fonts_with_info_properties_iterator, HFp) +GO(xcb_list_fonts_with_info_properties_length, iFp) +GO(xcb_list_fonts_with_info_reply, pFbup) +GO(xcb_list_fonts_with_info_sizeof, iFp) +GO(xcb_list_fonts_with_info_unchecked, UFbWWp) +GO(xcb_list_hosts, UFb) +GO(xcb_list_hosts_hosts_iterator, HFp) +GO(xcb_list_hosts_hosts_length, iFp) +GO(xcb_list_hosts_reply, pFbup) +GO(xcb_list_hosts_sizeof, iFp) +GO(xcb_list_hosts_unchecked, UFb) +GO(xcb_list_installed_colormaps, UFbu) +GO(xcb_list_installed_colormaps_cmaps, pFp) +GO(xcb_list_installed_colormaps_cmaps_end, HFp) +GO(xcb_list_installed_colormaps_cmaps_length, iFp) +GO(xcb_list_installed_colormaps_reply, pFbup) +GO(xcb_list_installed_colormaps_sizeof, iFp) +GO(xcb_list_installed_colormaps_unchecked, UFbu) +GO(xcb_list_properties, UFbu) +GO(xcb_list_properties_atoms, pFp) +GO(xcb_list_properties_atoms_end, HFp) +GO(xcb_list_properties_atoms_length, iFp) +GO(xcb_list_properties_reply, pFbup) +GO(xcb_list_properties_sizeof, iFp) +GO(xcb_list_properties_unchecked, UFbu) +GO(xcb_lookup_color, UFbuWp) +GO(xcb_lookup_color_reply, pFbup) +GO(xcb_lookup_color_sizeof, iFp) +GO(xcb_lookup_color_unchecked, UFbuWp) +GO(xcb_map_subwindows, UFbu) +GO(xcb_map_subwindows_checked, UFbu) +GO(xcb_map_window, UFbu) +GO(xcb_map_window_checked, UFbu) +GO(xcb_no_operation, UFb) +GO(xcb_no_operation_checked, UFb) +GO(xcb_open_font, UFbuWp) +GO(xcb_open_font_checked, UFbuWp) +GO(xcb_open_font_name, pFp) +GO(xcb_open_font_name_end, HFp) +GO(xcb_open_font_name_length, iFp) +GO(xcb_open_font_sizeof, iFp) GO(xcb_parse_display, iFpppp) //GO(xcb_pixmap_end, -//GO(xcb_pixmap_next, +GO(xcb_pixmap_next, vFp) //GO(xcb_point_end, -//GO(xcb_point_next, +GO(xcb_point_next, vFp) GO(xcb_poll_for_event, pFb) GO(xcb_poll_for_queued_event, pFb) GO(xcb_poll_for_reply, iFbupp) -//GO(xcb_poll_for_reply64, +GO(xcb_poll_for_reply64, iFbUpp) GO(xcb_poll_for_special_event, pFbp) -GO(xcb_poly_arc, pFbuuup) -//GO(xcb_poly_arc_arcs, -//GO(xcb_poly_arc_arcs_iterator, -//GO(xcb_poly_arc_arcs_length, -//GO(xcb_poly_arc_checked, -//GO(xcb_poly_arc_sizeof, -//GO(xcb_poly_fill_arc, -//GO(xcb_poly_fill_arc_arcs, -//GO(xcb_poly_fill_arc_arcs_iterator, -//GO(xcb_poly_fill_arc_arcs_length, -//GO(xcb_poly_fill_arc_checked, -//GO(xcb_poly_fill_arc_sizeof, -GO(xcb_poly_fill_rectangle, pFbuuup) -//GO(xcb_poly_fill_rectangle_checked, -//GO(xcb_poly_fill_rectangle_rectangles, -//GO(xcb_poly_fill_rectangle_rectangles_iterator, -//GO(xcb_poly_fill_rectangle_rectangles_length, -//GO(xcb_poly_fill_rectangle_sizeof, -GO(xcb_poly_line, pFbCuuup) -GO(xcb_poly_line_checked, pFbCuuup) -//GO(xcb_poly_line_points, -//GO(xcb_poly_line_points_iterator, -//GO(xcb_poly_line_points_length, -//GO(xcb_poly_line_sizeof, -GO(xcb_poly_point, pFbCuuup) -//GO(xcb_poly_point_checked, -//GO(xcb_poly_point_points, -//GO(xcb_poly_point_points_iterator, -//GO(xcb_poly_point_points_length, -//GO(xcb_poly_point_sizeof, -GO(xcb_poly_rectangle, pFbuuup) -//GO(xcb_poly_rectangle_checked, -//GO(xcb_poly_rectangle_rectangles, -//GO(xcb_poly_rectangle_rectangles_iterator, -//GO(xcb_poly_rectangle_rectangles_length, -//GO(xcb_poly_rectangle_sizeof, -GO(xcb_poly_segment, pFbuuup) -//GO(xcb_poly_segment_checked, -//GO(xcb_poly_segment_segments, -//GO(xcb_poly_segment_segments_iterator, -//GO(xcb_poly_segment_segments_length, -//GO(xcb_poly_segment_sizeof, -//GO(xcb_poly_text_16, -//GO(xcb_poly_text_16_checked, -//GO(xcb_poly_text_16_items, -//GO(xcb_poly_text_16_items_end, -//GO(xcb_poly_text_16_items_length, -//GO(xcb_poly_text_16_sizeof, -//GO(xcb_poly_text_8, -//GO(xcb_poly_text_8_checked, -//GO(xcb_poly_text_8_items, -//GO(xcb_poly_text_8_items_end, -//GO(xcb_poly_text_8_items_length, -//GO(xcb_poly_text_8_sizeof, +GO(xcb_poly_arc, UFbuuup) +GO(xcb_poly_arc_arcs, pFp) +GO(xcb_poly_arc_arcs_iterator, HFp) +GO(xcb_poly_arc_arcs_length, iFp) +GO(xcb_poly_arc_checked, UFbuuup) +GO(xcb_poly_arc_sizeof, iFpu) +GO(xcb_poly_fill_arc, UFbuuup) +GO(xcb_poly_fill_arc_arcs, pFp) +GO(xcb_poly_fill_arc_arcs_iterator, HFp) +GO(xcb_poly_fill_arc_arcs_length, iFp) +GO(xcb_poly_fill_arc_checked, UFbuuup) +GO(xcb_poly_fill_arc_sizeof, iFpu) +GO(xcb_poly_fill_rectangle, UFbuuup) +GO(xcb_poly_fill_rectangle_checked, UFbuuup) +GO(xcb_poly_fill_rectangle_rectangles, pFp) +GO(xcb_poly_fill_rectangle_rectangles_iterator, HFp) +GO(xcb_poly_fill_rectangle_rectangles_length, iFp) +GO(xcb_poly_fill_rectangle_sizeof, iFpu) +GO(xcb_poly_line, UFbCuuup) +GO(xcb_poly_line_checked, UFbCuuup) +GO(xcb_poly_line_points, pFp) +GO(xcb_poly_line_points_iterator, HFp) +GO(xcb_poly_line_points_length, iFp) +GO(xcb_poly_line_sizeof, iFpu) +GO(xcb_poly_point, UFbCuuup) +GO(xcb_poly_point_checked, UFbCuuup) +GO(xcb_poly_point_points, pFp) +GO(xcb_poly_point_points_iterator, HFp) +GO(xcb_poly_point_points_length, iFp) +GO(xcb_poly_point_sizeof, iFpu) +GO(xcb_poly_rectangle, UFbuuup) +GO(xcb_poly_rectangle_checked, UFbuuup) +GO(xcb_poly_rectangle_rectangles, pFp) +GO(xcb_poly_rectangle_rectangles_iterator, HFp) +GO(xcb_poly_rectangle_rectangles_length, iFp) +GO(xcb_poly_rectangle_sizeof, iFpu) +GO(xcb_poly_segment, UFbuuup) +GO(xcb_poly_segment_checked, UFbuuup) +GO(xcb_poly_segment_segments, pFp) +GO(xcb_poly_segment_segments_iterator, HFp) +GO(xcb_poly_segment_segments_length, iFp) +GO(xcb_poly_segment_sizeof, iFpu) +GO(xcb_poly_text_16, UFbuuwwup) +GO(xcb_poly_text_16_checked, UFbuuwwup) +GO(xcb_poly_text_16_items, pFp) +GO(xcb_poly_text_16_items_end, HFp) +GO(xcb_poly_text_16_items_length, iFp) +GO(xcb_poly_text_16_sizeof, iFpu) +GO(xcb_poly_text_8, UFbuuwwup) +GO(xcb_poly_text_8_checked, UFbuuwwup) +GO(xcb_poly_text_8_items, pFp) +GO(xcb_poly_text_8_items_end, HFp) +GO(xcb_poly_text_8_items_length, iFp) +GO(xcb_poly_text_8_sizeof, iFpu) GO(xcb_popcount, iFu) GO(xcb_prefetch_extension_data, vFbp) GO(xcb_prefetch_maximum_request_length, vFb) -GO(xcb_put_image, pFbCuuWWwwCCup) -GO(xcb_put_image_checked, pFbCuuWWwwCCup) -//GO(xcb_put_image_data, -//GO(xcb_put_image_data_end, -//GO(xcb_put_image_data_length, -//GO(xcb_put_image_sizeof, -//GO(xcb_query_best_size, -//GO(xcb_query_best_size_reply, -//GO(xcb_query_best_size_unchecked, -//GO(xcb_query_colors, -//GO(xcb_query_colors_colors, -//GO(xcb_query_colors_colors_iterator, -//GO(xcb_query_colors_colors_length, -//GO(xcb_query_colors_reply, -//GO(xcb_query_colors_sizeof, -//GO(xcb_query_colors_unchecked, -//GO(xcb_query_extension, -//GO(xcb_query_extension_reply, -//GO(xcb_query_extension_sizeof, -//GO(xcb_query_extension_unchecked, -//GO(xcb_query_font, -//GO(xcb_query_font_char_infos, -//GO(xcb_query_font_char_infos_iterator, -//GO(xcb_query_font_char_infos_length, -//GO(xcb_query_font_properties, -//GO(xcb_query_font_properties_iterator, -//GO(xcb_query_font_properties_length, -//GO(xcb_query_font_reply, -//GO(xcb_query_font_sizeof, -//GO(xcb_query_font_unchecked, -GO(xcb_query_keymap, pFbp) +GO(xcb_put_image, UFbCuuWWwwCCup) +GO(xcb_put_image_checked, UFbCuuWWwwCCup) +GO(xcb_put_image_data, pFp) +GO(xcb_put_image_data_end, HFp) +GO(xcb_put_image_data_length, iFp) +GO(xcb_put_image_sizeof, iFpu) +GO(xcb_query_best_size, UFbCuWW) +GO(xcb_query_best_size_reply, pFbup) +GO(xcb_query_best_size_unchecked, UFbCuWW) +GO(xcb_query_colors, UFbuup) +GO(xcb_query_colors_colors, pFp) +GO(xcb_query_colors_colors_iterator, HFp) +GO(xcb_query_colors_colors_length, iFp) +GO(xcb_query_colors_reply, pFbup) +GO(xcb_query_colors_sizeof, iFpu) +GO(xcb_query_colors_unchecked, UFbuup) +GO(xcb_query_extension, UFbWp) +GO(xcb_query_extension_reply, pFbup) +GO(xcb_query_extension_sizeof, iFp) +GO(xcb_query_extension_unchecked, UFbWp) +GO(xcb_query_font, UFbu) +GO(xcb_query_font_char_infos, pFp) +GO(xcb_query_font_char_infos_iterator, HFp) +GO(xcb_query_font_char_infos_length, iFp) +GO(xcb_query_font_properties, pFp) +GO(xcb_query_font_properties_iterator, HFp) +GO(xcb_query_font_properties_length, iFp) +GO(xcb_query_font_reply, pFbup) +GO(xcb_query_font_sizeof, iFp) +GO(xcb_query_font_unchecked, UFbu) +GO(xcb_query_keymap, UFb) GO(xcb_query_keymap_reply, pFbup) -GO(xcb_query_keymap_unchecked, pFbp) -GO(xcb_query_pointer, uFbu) +GO(xcb_query_keymap_unchecked, UFb) +GO(xcb_query_pointer, UFbu) GO(xcb_query_pointer_reply, pFbup) -GO(xcb_query_pointer_unchecked, uFbu) -GO(xcb_query_text_extents, pFbuup) +GO(xcb_query_pointer_unchecked, UFbu) +GO(xcb_query_text_extents, UFbuup) GO(xcb_query_text_extents_reply, pFbup) -//GO(xcb_query_text_extents_sizeof, -//GO(xcb_query_text_extents_unchecked, -GO(xcb_query_tree, pFbu) +GO(xcb_query_text_extents_sizeof, iFpu) +GO(xcb_query_text_extents_unchecked, UFbuup) +GO(xcb_query_tree, UFbu) GO(xcb_query_tree_children, pFp) -//GO(xcb_query_tree_children_end, +GO(xcb_query_tree_children_end, HFp) GO(xcb_query_tree_children_length, iFp) GO(xcb_query_tree_reply, pFbup) -//GO(xcb_query_tree_sizeof, -GO(xcb_query_tree_unchecked, pFbu) -//GO(xcb_recolor_cursor, -//GO(xcb_recolor_cursor_checked, +GO(xcb_query_tree_sizeof, iFp) +GO(xcb_query_tree_unchecked, UFbu) +GO(xcb_recolor_cursor, UFbuWWWWWW) +GO(xcb_recolor_cursor_checked, UFbuWWWWWW) //GO(xcb_rectangle_end, -//GO(xcb_rectangle_next, +GO(xcb_rectangle_next, vFp) GO(xcb_register_for_special_xge, pFbpup) -GO(xcb_reparent_window, pFbuuWW) -//GO(xcb_reparent_window_checked, +GO(xcb_reparent_window, UFbuuww) +GO(xcb_reparent_window_checked, UFbuuww) GO(xcb_request_check, pFbu) //GO(xcb_rgb_end, -//GO(xcb_rgb_next, -//GO(xcb_rotate_properties, -//GO(xcb_rotate_properties_atoms, -//GO(xcb_rotate_properties_atoms_end, -//GO(xcb_rotate_properties_atoms_length, -//GO(xcb_rotate_properties_checked, -//GO(xcb_rotate_properties_sizeof, -GO(xcb_screen_allowed_depths_iterator, HFp) //xcb_depth_iterator_t is a structure -//GO(xcb_screen_allowed_depths_length, +GO(xcb_rgb_next, vFp) +GO(xcb_rotate_properties, UFbuWwp) +GO(xcb_rotate_properties_atoms, pFp) +GO(xcb_rotate_properties_atoms_end, HFp) +GO(xcb_rotate_properties_atoms_length, iFp) +GO(xcb_rotate_properties_checked, UFbuWwp) +GO(xcb_rotate_properties_sizeof, iFp) +GO(xcb_screen_allowed_depths_iterator, HFp) +GO(xcb_screen_allowed_depths_length, iFp) //GO(xcb_screen_end, GO(xcb_screen_next, vFp) -//GO(xcb_screen_sizeof, +GO(xcb_screen_sizeof, iFp) //GO(xcb_segment_end, -//GO(xcb_segment_next, -GO(xcb_send_event, uFbCuup) -GO(xcb_send_event_checked, uFbCuup) +GO(xcb_segment_next, vFp) +GO(xcb_send_event, UFbCuup) +GO(xcb_send_event_checked, UFbCuup) GO(xcb_send_fd, vFbi) GO(xcb_send_request, uFbipp) GO(xcb_send_request64, UFbipp) GO(xcb_send_request_with_fds, uFbippup) GO(xcb_send_request_with_fds64, UFbippup) -//GO(xcb_set_access_control, -//GO(xcb_set_access_control_checked, -GO(xcb_set_clip_rectangles, pFbCpWWup) -GO(xcb_set_clip_rectangles_checked, pFbCpWWup) -//GO(xcb_set_clip_rectangles_rectangles, -//GO(xcb_set_clip_rectangles_rectangles_iterator, -//GO(xcb_set_clip_rectangles_rectangles_length, -//GO(xcb_set_clip_rectangles_sizeof, -//GO(xcb_set_close_down_mode, -//GO(xcb_set_close_down_mode_checked, -//GO(xcb_set_dashes, -//GO(xcb_set_dashes_checked, -//GO(xcb_set_dashes_dashes, -//GO(xcb_set_dashes_dashes_end, -//GO(xcb_set_dashes_dashes_length, -//GO(xcb_set_dashes_sizeof, -//GO(xcb_set_font_path, -//GO(xcb_set_font_path_checked, -//GO(xcb_set_font_path_font_iterator, -//GO(xcb_set_font_path_font_length, -//GO(xcb_set_font_path_sizeof, -GO(xcb_set_input_focus, pFbCuu) // xcb_void_cookie_t is a struct with only 1 uint inside -//GO(xcb_set_input_focus_checked, -//GO(xcb_set_modifier_mapping, -//GO(xcb_set_modifier_mapping_reply, -//GO(xcb_set_modifier_mapping_sizeof, -//GO(xcb_set_modifier_mapping_unchecked, -//GO(xcb_set_pointer_mapping, -//GO(xcb_set_pointer_mapping_reply, -//GO(xcb_set_pointer_mapping_sizeof, -//GO(xcb_set_pointer_mapping_unchecked, -//GO(xcb_set_screen_saver, -//GO(xcb_set_screen_saver_checked, -GO(xcb_set_selection_owner, pFbpppp) -GO(xcb_set_selection_owner_checked, pFbpppp) +GO(xcb_set_access_control, UFbC) +GO(xcb_set_access_control_checked, UFbC) +GO(xcb_set_clip_rectangles, UFbCuwwup) +GO(xcb_set_clip_rectangles_checked, UFbCuwwup) +GO(xcb_set_clip_rectangles_rectangles, pFp) +GO(xcb_set_clip_rectangles_rectangles_iterator, HFp) +GO(xcb_set_clip_rectangles_rectangles_length, iFp) +GO(xcb_set_clip_rectangles_sizeof, iFpu) +GO(xcb_set_close_down_mode, UFbC) +GO(xcb_set_close_down_mode_checked, UFbC) +GO(xcb_set_dashes, UFbuWWp) +GO(xcb_set_dashes_checked, UFbuWWp) +GO(xcb_set_dashes_dashes, pFp) +GO(xcb_set_dashes_dashes_end, HFp) +GO(xcb_set_dashes_dashes_length, iFp) +GO(xcb_set_dashes_sizeof, iFp) +GO(xcb_set_font_path, UFbWp) +GO(xcb_set_font_path_checked, UFbWp) +GO(xcb_set_font_path_font_iterator, HFp) +GO(xcb_set_font_path_font_length, iFp) +GO(xcb_set_font_path_sizeof, iFp) +GO(xcb_set_input_focus, UFbCuu) +GO(xcb_set_input_focus_checked, UFbCuu) +GO(xcb_set_modifier_mapping, UFbCp) +GO(xcb_set_modifier_mapping_reply, pFbup) +GO(xcb_set_modifier_mapping_sizeof, iFp) +GO(xcb_set_modifier_mapping_unchecked, UFbCp) +GO(xcb_set_pointer_mapping, UFbCp) +GO(xcb_set_pointer_mapping_reply, pFbup) +GO(xcb_set_pointer_mapping_sizeof, iFp) +GO(xcb_set_pointer_mapping_unchecked, UFbCp) +GO(xcb_set_screen_saver, UFbwwCC) +GO(xcb_set_screen_saver_checked, UFbwwCC) +GO(xcb_set_selection_owner, UFbuuu) +GO(xcb_set_selection_owner_checked, UFbuuu) //GO(xcb_setup_authenticate_end, -//GO(xcb_setup_authenticate_next, -//GO(xcb_setup_authenticate_reason, -//GO(xcb_setup_authenticate_reason_end, -//GO(xcb_setup_authenticate_reason_length, -//GO(xcb_setup_authenticate_sizeof, +GO(xcb_setup_authenticate_next, vFp) +GO(xcb_setup_authenticate_reason, pFp) +GO(xcb_setup_authenticate_reason_end, HFp) +GO(xcb_setup_authenticate_reason_length, iFp) +GO(xcb_setup_authenticate_sizeof, iFp) //GO(xcb_setup_end, //GO(xcb_setup_failed_end, -//GO(xcb_setup_failed_next, -//GO(xcb_setup_failed_reason, -//GO(xcb_setup_failed_reason_end, -//GO(xcb_setup_failed_reason_length, -//GO(xcb_setup_failed_sizeof, -//GO(xcb_setup_next, +GO(xcb_setup_failed_next, vFp) +GO(xcb_setup_failed_reason, pFp) +GO(xcb_setup_failed_reason_end, HFp) +GO(xcb_setup_failed_reason_length, iFp) +GO(xcb_setup_failed_sizeof, iFp) +GO(xcb_setup_next, vFp) GO(xcb_setup_pixmap_formats, pFp) GO(xcb_setup_pixmap_formats_iterator, HFp) GO(xcb_setup_pixmap_formats_length, iFp) -//GO(xcb_setup_request_authorization_protocol_data, -//GO(xcb_setup_request_authorization_protocol_data_end, -//GO(xcb_setup_request_authorization_protocol_data_length, -//GO(xcb_setup_request_authorization_protocol_name, -//GO(xcb_setup_request_authorization_protocol_name_end, -//GO(xcb_setup_request_authorization_protocol_name_length, +GO(xcb_setup_request_authorization_protocol_data, pFp) +GO(xcb_setup_request_authorization_protocol_data_end, HFp) +GO(xcb_setup_request_authorization_protocol_data_length, iFp) +GO(xcb_setup_request_authorization_protocol_name, pFp) +GO(xcb_setup_request_authorization_protocol_name_end, HFp) +GO(xcb_setup_request_authorization_protocol_name_length, iFp) //GO(xcb_setup_request_end, -//GO(xcb_setup_request_next, -//GO(xcb_setup_request_sizeof, +GO(xcb_setup_request_next, vFp) +GO(xcb_setup_request_sizeof, iFp) GO(xcb_setup_roots_iterator, HFp) GO(xcb_setup_roots_length, iFp) -//GO(xcb_setup_sizeof, -//GO(xcb_setup_vendor, -//GO(xcb_setup_vendor_end, -//GO(xcb_setup_vendor_length, -//GO(xcb_store_colors, -//GO(xcb_store_colors_checked, -//GO(xcb_store_colors_items, -//GO(xcb_store_colors_items_iterator, -//GO(xcb_store_colors_items_length, -//GO(xcb_store_colors_sizeof, -//GO(xcb_store_named_color, -//GO(xcb_store_named_color_checked, -//GO(xcb_store_named_color_name, -//GO(xcb_store_named_color_name_end, -//GO(xcb_store_named_color_name_length, -//GO(xcb_store_named_color_sizeof, +GO(xcb_setup_sizeof, iFp) +GO(xcb_setup_vendor, pFp) +GO(xcb_setup_vendor_end, HFp) +GO(xcb_setup_vendor_length, iFp) +GO(xcb_store_colors, UFbuup) +GO(xcb_store_colors_checked, UFbuup) +GO(xcb_store_colors_items, pFp) +GO(xcb_store_colors_items_iterator, HFp) +GO(xcb_store_colors_items_length, iFp) +GO(xcb_store_colors_sizeof, iFpu) +GO(xcb_store_named_color, UFbCuuWp) +GO(xcb_store_named_color_checked, UFbCuuWp) +GO(xcb_store_named_color_name, pFp) +GO(xcb_store_named_color_name_end, HFp) +GO(xcb_store_named_color_name_length, iFp) +GO(xcb_store_named_color_sizeof, iFp) //GO(xcb_str_end, -//GO(xcb_str_name, -//GO(xcb_str_name_end, -//GO(xcb_str_name_length, -//GO(xcb_str_next, +GO(xcb_str_name, pFp) +GO(xcb_str_name_end, HFp) +GO(xcb_str_name_length, iFp) +GO(xcb_str_next, vFp) GO(xcb_str_sizeof, iFp) -//GO(xcb_sumof, -//GO(xcb_take_socket, +GO(xcb_sumof, iFpi) +//GOM(xcb_take_socket, iFEbppip) //GO(xcb_timecoord_end, -//GO(xcb_timecoord_next, +GO(xcb_timecoord_next, vFp) //GO(xcb_timestamp_end, -//GO(xcb_timestamp_next, -GO(xcb_translate_coordinates, pFbuuWW) +GO(xcb_timestamp_next, vFp) +GO(xcb_translate_coordinates, UFbuuww) GO(xcb_translate_coordinates_reply, pFbup) -GO(xcb_translate_coordinates_unchecked, pFbuuWW) -GO(xcb_ungrab_button, pFbCuW) -GO(xcb_ungrab_button_checked, pFbCuW) -GO(xcb_ungrab_key, pFbCuW) -GO(xcb_ungrab_keyboard, pFbu) -GO(xcb_ungrab_keyboard_checked, pFbu) -GO(xcb_ungrab_key_checked, pFbCuW) -GO(xcb_ungrab_pointer, pFbu) -//GO(xcb_ungrab_pointer_checked, -GO(xcb_ungrab_server, uFb) -GO(xcb_ungrab_server_checked, uFb) -//GO(xcb_uninstall_colormap, -//GO(xcb_uninstall_colormap_checked, -//GO(xcb_unmap_subwindows, -//GO(xcb_unmap_subwindows_checked, -GO(xcb_unmap_window, pFbu) -//GO(xcb_unmap_window_checked, +GO(xcb_translate_coordinates_unchecked, UFbuuww) +GO(xcb_ungrab_button, UFbCuW) +GO(xcb_ungrab_button_checked, UFbCuW) +GO(xcb_ungrab_key, UFbCuW) +GO(xcb_ungrab_keyboard, UFbu) +GO(xcb_ungrab_keyboard_checked, UFbu) +GO(xcb_ungrab_key_checked, UFbCuW) +GO(xcb_ungrab_pointer, UFbu) +GO(xcb_ungrab_pointer_checked, UFbu) +GO(xcb_ungrab_server, UFb) +GO(xcb_ungrab_server_checked, UFb) +GO(xcb_uninstall_colormap, UFbu) +GO(xcb_uninstall_colormap_checked, UFbu) +GO(xcb_unmap_subwindows, UFbu) +GO(xcb_unmap_subwindows_checked, UFbu) +GO(xcb_unmap_window, UFbu) +GO(xcb_unmap_window_checked, UFbu) GO(xcb_unregister_for_special_event, vFbp) //GO(xcb_visualid_end, -//GO(xcb_visualid_next, +GO(xcb_visualid_next, vFp) //GO(xcb_visualtype_end, GO(xcb_visualtype_next, vFp) GO(xcb_wait_for_event, pFb) GO(xcb_wait_for_reply, pFbup) GO(xcb_wait_for_reply64, pFbUp) GO(xcb_wait_for_special_event, pFbp) -GO(xcb_warp_pointer, pFbuuwwWWww) -//GO(xcb_warp_pointer_checked, +GO(xcb_warp_pointer, UFbuuwwWWww) +GO(xcb_warp_pointer_checked, UFbuuwwWWww) //GO(xcb_window_end, -//GO(xcb_window_next, -//GO(xcb_writev, -//GO(xcb_xc_misc_get_version, -//GO(xcb_xc_misc_get_version_reply, -//GO(xcb_xc_misc_get_version_unchecked, -//GO(xcb_xc_misc_get_xid_list, -//GO(xcb_xc_misc_get_xid_list_ids, -//GO(xcb_xc_misc_get_xid_list_ids_end, -//GO(xcb_xc_misc_get_xid_list_ids_length, -//GO(xcb_xc_misc_get_xid_list_reply, -//GO(xcb_xc_misc_get_xid_list_sizeof, -//GO(xcb_xc_misc_get_xid_list_unchecked, -//GO(xcb_xc_misc_get_xid_range, -//GO(xcb_xc_misc_get_xid_range_reply, -//GO(xcb_xc_misc_get_xid_range_unchecked, -DATA(xcb_xc_misc_id, 4) +GO(xcb_window_next, vFp) +GO(xcb_writev, iFbpiU) +GO(xcb_xc_misc_get_version, UFbWW) +GO(xcb_xc_misc_get_version_reply, pFbup) +GO(xcb_xc_misc_get_version_unchecked, UFbWW) +GO(xcb_xc_misc_get_xid_list, UFbu) +GO(xcb_xc_misc_get_xid_list_ids, pFp) +GO(xcb_xc_misc_get_xid_list_ids_end, HFp) +GO(xcb_xc_misc_get_xid_list_ids_length, iFp) +GO(xcb_xc_misc_get_xid_list_reply, pFbup) +GO(xcb_xc_misc_get_xid_list_sizeof, iFp) +GO(xcb_xc_misc_get_xid_list_unchecked, UFbu) +GO(xcb_xc_misc_get_xid_range, UFb) +GO(xcb_xc_misc_get_xid_range_reply, pFbup) +GO(xcb_xc_misc_get_xid_range_unchecked, UFb) +DATA(xcb_xc_misc_id, 16) diff --git a/src/wrapped/wrappedlibxcbcursor.c b/src/wrapped/wrappedlibxcbcursor.c index e4d1f2d..aaddba1 100644 --- a/src/wrapped/wrappedlibxcbcursor.c +++ b/src/wrapped/wrappedlibxcbcursor.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbcursorName = "libxcb-cursor.so"; -#else - const char* libxcbcursorName = "libxcb-cursor.so.0"; -#endif +const char* libxcbcursorName = "libxcb-cursor.so.0"; +#define ALTNAME "libxcb-cursor.so" #define LIBNAME libxcbcursor diff --git a/src/wrapped/wrappedlibxcbdri2.c b/src/wrapped/wrappedlibxcbdri2.c index 4745c51..335b8b3 100644 --- a/src/wrapped/wrappedlibxcbdri2.c +++ b/src/wrapped/wrappedlibxcbdri2.c @@ -18,6 +18,8 @@ #include "emu/x64emu_private.h" const char* libxcbdri2Name = "libxcb-dri2.so.0"; +#define ALTNAME "libxcb-dri2.so" + #define LIBNAME libxcbdri2 #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxcbdri3.c b/src/wrapped/wrappedlibxcbdri3.c index b351dbe..d6ae5d3 100644 --- a/src/wrapped/wrappedlibxcbdri3.c +++ b/src/wrapped/wrappedlibxcbdri3.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbdri3Name = "libxcb-dri3.so"; -#else - const char* libxcbdri3Name = "libxcb-dri3.so.0"; -#endif +const char* libxcbdri3Name = "libxcb-dri3.so.0"; +#define ALTNAME "libxcb-dri3.so" #define LIBNAME libxcbdri3 diff --git a/src/wrapped/wrappedlibxcbglx.c b/src/wrapped/wrappedlibxcbglx.c index 806c58d..d67714f 100644 --- a/src/wrapped/wrappedlibxcbglx.c +++ b/src/wrapped/wrappedlibxcbglx.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbglxName = "libxcb-glx.so"; -#else - const char* libxcbglxName = "libxcb-glx.so.0"; -#endif +const char* libxcbglxName = "libxcb-glx.so.0"; +#define ALTNAME "libxcb-glx.so" #define LIBNAME libxcbglx diff --git a/src/wrapped/wrappedlibxcbicccm.c b/src/wrapped/wrappedlibxcbicccm.c index 29c9b55..7b380db 100644 --- a/src/wrapped/wrappedlibxcbicccm.c +++ b/src/wrapped/wrappedlibxcbicccm.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbicccmName = "libxcb-icccm.so"; -#else - const char* libxcbicccmName = "libxcb-icccm.so.4"; -#endif +const char* libxcbicccmName = "libxcb-icccm.so.4"; +#define ALTNAME "libxcb-icccm.so" #define LIBNAME libxcbicccm diff --git a/src/wrapped/wrappedlibxcbimage.c b/src/wrapped/wrappedlibxcbimage.c index 6ef51ed..30ae193 100644 --- a/src/wrapped/wrappedlibxcbimage.c +++ b/src/wrapped/wrappedlibxcbimage.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbimageName = "libxcb-image.so"; -#else - const char* libxcbimageName = "libxcb-image.so.0"; -#endif +const char* libxcbimageName = "libxcb-image.so.0"; +#define ALTNAME "libxcb-image.so" #define LIBNAME libxcbimage diff --git a/src/wrapped/wrappedlibxcbimage_private.h b/src/wrapped/wrappedlibxcbimage_private.h index cebd340..ded11dd 100644 --- a/src/wrapped/wrappedlibxcbimage_private.h +++ b/src/wrapped/wrappedlibxcbimage_private.h @@ -11,9 +11,9 @@ GO(xcb_image_create_native, pFbWWiCpup) GO(xcb_image_destroy, vFp) GO(xcb_image_get, pFbdwwWWui) GO(xcb_image_get_pixel, uFpuu) -GO(xcb_image_native, pFppi) +GO(xcb_image_native, pFbpi) GO(xcb_image_put, uFbuupwwC) GO(xcb_image_put_pixel, vFpuuu) GO(xcb_image_shm_get, iFbupppWWu) //xcb_shm_segment_info_t is a struct with "u u p" => transform to pp? -GO(xcb_image_shm_put, pFpuupppwwwwWWC) +GO(xcb_image_shm_put, pFbuupppwwwwWWC) GO(xcb_image_subimage, pFpuuuupup) diff --git a/src/wrapped/wrappedlibxcbkeysyms.c b/src/wrapped/wrappedlibxcbkeysyms.c index 72c0022..08894bb 100644 --- a/src/wrapped/wrappedlibxcbkeysyms.c +++ b/src/wrapped/wrappedlibxcbkeysyms.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbkeysymsName = "libxcb-keysyms.so"; -#else - const char* libxcbkeysymsName = "libxcb-keysyms.so.1"; -#endif +const char* libxcbkeysymsName = "libxcb-keysyms.so.1"; +#define altname "libxcb-keysyms.so" #define LIBNAME libxcbkeysyms diff --git a/src/wrapped/wrappedlibxcbpresent.c b/src/wrapped/wrappedlibxcbpresent.c index 4f63285..d142d50 100644 --- a/src/wrapped/wrappedlibxcbpresent.c +++ b/src/wrapped/wrappedlibxcbpresent.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbpresentName = "libxcb-present.so"; -#else - const char* libxcbpresentName = "libxcb-present.so.0"; -#endif +const char* libxcbpresentName = "libxcb-present.so.0"; +#define ALTNAME "libxcb-present.so" #define LIBNAME libxcbpresent diff --git a/src/wrapped/wrappedlibxcbrandr.c b/src/wrapped/wrappedlibxcbrandr.c index d4c8cbb..910867f 100644 --- a/src/wrapped/wrappedlibxcbrandr.c +++ b/src/wrapped/wrappedlibxcbrandr.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbrandrName = "libxcb-randr.so"; -#else - const char* libxcbrandrName = "libxcb-randr.so.0"; -#endif +const char* libxcbrandrName = "libxcb-randr.so.0"; +#define ALTNAME "libxcb-randr.so" #define LIBNAME libxcbrandr diff --git a/src/wrapped/wrappedlibxcbrender.c b/src/wrapped/wrappedlibxcbrender.c index 5deeed1..225d334 100644 --- a/src/wrapped/wrappedlibxcbrender.c +++ b/src/wrapped/wrappedlibxcbrender.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbrenderName = "libxcb-render.so"; -#else - const char* libxcbrenderName = "libxcb-render.so.0"; -#endif +const char* libxcbrenderName = "libxcb-render.so.0"; +#define ALTNAME "libxcb-render.so" #define LIBNAME libxcbrender diff --git a/src/wrapped/wrappedlibxcbrender_private.h b/src/wrapped/wrappedlibxcbrender_private.h index b64e6bc..492e745 100644 --- a/src/wrapped/wrappedlibxcbrender_private.h +++ b/src/wrapped/wrappedlibxcbrender_private.h @@ -53,8 +53,8 @@ GO(xcb_render_composite, pFbpCpppwwwwwwWW) //GO(xcb_render_composite_glyphs_8_glyphcmds_end, //GO(xcb_render_composite_glyphs_8_glyphcmds_length, //GO(xcb_render_composite_glyphs_8_sizeof, -//GO(xcb_render_create_anim_cursor, -//GO(xcb_render_create_anim_cursor_checked, +GO(xcb_render_create_anim_cursor, pFbpup) +GO(xcb_render_create_anim_cursor_checked, pFbpup) //GO(xcb_render_create_anim_cursor_cursors, //GO(xcb_render_create_anim_cursor_cursors_iterator, //GO(xcb_render_create_anim_cursor_cursors_length, diff --git a/src/wrapped/wrappedlibxcbrenderutil.c b/src/wrapped/wrappedlibxcbrenderutil.c index 6a1f7d8..79449a3 100644 --- a/src/wrapped/wrappedlibxcbrenderutil.c +++ b/src/wrapped/wrappedlibxcbrenderutil.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbrenderutilName = "libxcb-render-util.so"; -#else - const char* libxcbrenderutilName = "libxcb-render-util.so.0"; -#endif +const char* libxcbrenderutilName = "libxcb-render-util.so.0"; +#define ALTNAME "libxcb-render-util.so" #define LIBNAME libxcbrenderutil diff --git a/src/wrapped/wrappedlibxcbres.c b/src/wrapped/wrappedlibxcbres.c new file mode 100644 index 0000000..1841476 --- /dev/null +++ b/src/wrapped/wrappedlibxcbres.c @@ -0,0 +1,25 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" + +const char* libxcbresName = "libxcb-res.so.0"; +#define ALTNAME "libxcb-res.so" + +#define LIBNAME libxcbres + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxcbres_private.h b/src/wrapped/wrappedlibxcbres_private.h new file mode 100644 index 0000000..e4712e0 --- /dev/null +++ b/src/wrapped/wrappedlibxcbres_private.h @@ -0,0 +1,59 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//GO(xcb_res_client_end, +//GO(xcb_res_client_id_spec_end, +GO(xcb_res_client_id_spec_next, vFp) +//GO(xcb_res_client_id_value_end, +GO(xcb_res_client_id_value_next, vFp) +GO(xcb_res_client_id_value_sizeof, iFp) +GO(xcb_res_client_id_value_value, pFp) +GO(xcb_res_client_id_value_value_end, HFp) +GO(xcb_res_client_id_value_value_length, iFp) +GO(xcb_res_client_next, vFp) +DATA(xcb_res_id, 16) +GO(xcb_res_query_client_ids, UFbup) +GO(xcb_res_query_client_ids_ids_iterator, HFp) +GO(xcb_res_query_client_ids_ids_length, iFp) +GO(xcb_res_query_client_ids_reply, pFbup) +GO(xcb_res_query_client_ids_sizeof, iFp) +GO(xcb_res_query_client_ids_unchecked, UFbup) +GO(xcb_res_query_client_pixmap_bytes, UFbu) +GO(xcb_res_query_client_pixmap_bytes_reply, pFbup) +GO(xcb_res_query_client_pixmap_bytes_unchecked, UFbu) +GO(xcb_res_query_client_resources, UFbu) +GO(xcb_res_query_client_resources_reply, pFbup) +GO(xcb_res_query_client_resources_sizeof, iFp) +GO(xcb_res_query_client_resources_types, pFp) +GO(xcb_res_query_client_resources_types_iterator, HFp) +GO(xcb_res_query_client_resources_types_length, iFp) +GO(xcb_res_query_client_resources_unchecked, UFbu) +GO(xcb_res_query_clients, UFb) +GO(xcb_res_query_clients_clients, pFp) +GO(xcb_res_query_clients_clients_iterator, HFp) +GO(xcb_res_query_clients_clients_length, iFp) +GO(xcb_res_query_clients_reply, pFbup) +GO(xcb_res_query_clients_sizeof, iFp) +GO(xcb_res_query_clients_unchecked, UFb) +GO(xcb_res_query_resource_bytes, UFbuup) +GO(xcb_res_query_resource_bytes_reply, pFbup) +GO(xcb_res_query_resource_bytes_sizeof, iFp) +GO(xcb_res_query_resource_bytes_sizes_iterator, HFp) +GO(xcb_res_query_resource_bytes_sizes_length, iFp) +GO(xcb_res_query_resource_bytes_unchecked, UFbuup) +GO(xcb_res_query_version, UFbCC) +GO(xcb_res_query_version_reply, pFbup) +GO(xcb_res_query_version_unchecked, UFbCC) +//GO(xcb_res_resource_id_spec_end, +GO(xcb_res_resource_id_spec_next, vFp) +//GO(xcb_res_resource_size_spec_end, +GO(xcb_res_resource_size_spec_next, vFp) +GO(xcb_res_resource_size_value_cross_references, pFp) +GO(xcb_res_resource_size_value_cross_references_iterator, HFp) +GO(xcb_res_resource_size_value_cross_references_length, iFp) +//GO(xcb_res_resource_size_value_end, +GO(xcb_res_resource_size_value_next, vFp) +GO(xcb_res_resource_size_value_sizeof, iFp) +//GO(xcb_res_type_end, +GO(xcb_res_type_next, vFp) diff --git a/src/wrapped/wrappedlibxcbshape.c b/src/wrapped/wrappedlibxcbshape.c index f1eb4e8..687fc83 100644 --- a/src/wrapped/wrappedlibxcbshape.c +++ b/src/wrapped/wrappedlibxcbshape.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbshapeName = "libxcb-shape.so"; -#else - const char* libxcbshapeName = "libxcb-shape.so.0"; -#endif +const char* libxcbshapeName = "libxcb-shape.so.0"; +#define ALTNAME "libxcb-shape.so" #define LIBNAME libxcbshape diff --git a/src/wrapped/wrappedlibxcbshm.c b/src/wrapped/wrappedlibxcbshm.c index 886d2aa..1895c7b 100644 --- a/src/wrapped/wrappedlibxcbshm.c +++ b/src/wrapped/wrappedlibxcbshm.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbshmName = "libxcb-shm.so"; -#else - const char* libxcbshmName = "libxcb-shm.so.0"; -#endif +const char* libxcbshmName = "libxcb-shm.so.0"; +#define ALTNAME "libxcb-shm.so" #define LIBNAME libxcbshm diff --git a/src/wrapped/wrappedlibxcbsync.c b/src/wrapped/wrappedlibxcbsync.c index 81e4687..762e861 100644 --- a/src/wrapped/wrappedlibxcbsync.c +++ b/src/wrapped/wrappedlibxcbsync.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbsyncName = "libxcb-sync.so"; -#else - const char* libxcbsyncName = "libxcb-sync.so.1"; -#endif +const char* libxcbsyncName = "libxcb-sync.so.1"; +#define ALTNAME "libxcb-sync.so" #define LIBNAME libxcbsync diff --git a/src/wrapped/wrappedlibxcbutil.c b/src/wrapped/wrappedlibxcbutil.c index 943d8b9..7535a38 100644 --- a/src/wrapped/wrappedlibxcbutil.c +++ b/src/wrapped/wrappedlibxcbutil.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbutilName = "libxcb-util.so"; -#else - const char* libxcbutilName = "libxcb-util.so.1"; -#endif +const char* libxcbutilName = "libxcb-util.so.1"; +#define ALTNAME "libxcb-util.so" #define LIBNAME libxcbutil diff --git a/src/wrapped/wrappedlibxcbxfixes.c b/src/wrapped/wrappedlibxcbxfixes.c index ac95078..ecf58b8 100644 --- a/src/wrapped/wrappedlibxcbxfixes.c +++ b/src/wrapped/wrappedlibxcbxfixes.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbxfixesName = "libxcb-xfixes.so"; -#else - const char* libxcbxfixesName = "libxcb-xfixes.so.0"; -#endif +const char* libxcbxfixesName = "libxcb-xfixes.so.0"; +#define ALTNAME "libxcb-xfixes.so" #define LIBNAME libxcbxfixes diff --git a/src/wrapped/wrappedlibxcbxinerama.c b/src/wrapped/wrappedlibxcbxinerama.c index 856d7e2..064588e 100644 --- a/src/wrapped/wrappedlibxcbxinerama.c +++ b/src/wrapped/wrappedlibxcbxinerama.c @@ -17,11 +17,9 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbxineramaName = "libxcb-xinerama.so"; -#else - const char* libxcbxineramaName = "libxcb-xinerama.so.0"; -#endif +const char* libxcbxineramaName = "libxcb-xinerama.so.0"; +#define ALTNAME "libxcb-xinerama.so" + #define LIBNAME libxcbxinerama #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxcbxinput.c b/src/wrapped/wrappedlibxcbxinput.c index b5b5568..e9962f9 100644 --- a/src/wrapped/wrappedlibxcbxinput.c +++ b/src/wrapped/wrappedlibxcbxinput.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbxinputName = "libxcb-xinput.so"; -#else - const char* libxcbxinputName = "libxcb-xinput.so.0"; -#endif +const char* libxcbxinputName = "libxcb-xinput.so.0"; +#define ALTNAME "libxcb-xinput.so" #define LIBNAME libxcbxinput #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxcbxinput_private.h b/src/wrapped/wrappedlibxcbxinput_private.h index 5732550..3736c54 100644 --- a/src/wrapped/wrappedlibxcbxinput_private.h +++ b/src/wrapped/wrappedlibxcbxinput_private.h @@ -335,7 +335,7 @@ GO(xcb_input_xi_query_version, uFbWW) GO(xcb_input_xi_query_version_reply, pFbup) //GO(xcb_input_button_class_state, GO(xcb_input_button_class_labels_length, iFp) -GO(xcb_input_button_class_labels_end, pFp) +GO(xcb_input_button_class_labels_end, HFp) GO(xcb_input_button_class_labels, pFp) //GO(xcb_input_button_class_next, //GO(xcb_input_button_class_end, @@ -359,14 +359,14 @@ GO(xcb_input_button_class_labels, pFp) //GO(xcb_input_device_class_data_serialize, //GO(xcb_input_device_class_data_unpack, GO(xcb_input_device_class_next, vFp) -GO(xcb_input_device_class_end, HFpp) +GO(xcb_input_device_class_end, HFH) GO(xcb_input_xi_device_info_classes_length, iFp) GO(xcb_input_xi_device_info_classes_iterator, HFp) GO(xcb_input_xi_device_info_name, pFp) GO(xcb_input_xi_device_info_name_length, iFp) GO(xcb_input_xi_device_info_name_end, pFp) GO(xcb_input_xi_device_info_next, vFp) -GO(xcb_input_xi_device_info_end, HFpp) +GO(xcb_input_xi_device_info_end, HFH) GO(xcb_input_xi_query_device, uFbu) GO(xcb_input_xi_query_device_unchecked, uFbu) GO(xcb_input_xi_query_device_infos_length, iFp) @@ -375,9 +375,11 @@ GO(xcb_input_xi_query_device_reply, pFbup) //GO(xcb_input_xi_set_focus, //GO(xcb_input_xi_get_focus_unchecked, //GO(xcb_input_xi_get_focus_reply, -//GO(xcb_input_xi_grab_device_unchecked, -//GO(xcb_input_xi_grab_device_reply, -//GO(xcb_input_xi_ungrab_device, +GO(xcb_input_xi_grab_device, uFbuuuWCCCWp) +GO(xcb_input_xi_grab_device_unchecked, uFbuuuWCCCWp) +GO(xcb_input_xi_grab_device_reply, pFbup) +GO(xcb_input_xi_ungrab_device, uFbuu) +GO(xcb_input_xi_ungrab_device_checked, uFbuu) //GO(xcb_input_xi_allow_events, //GO(xcb_input_grab_modifier_info_next, //GO(xcb_input_grab_modifier_info_end, diff --git a/src/wrapped/wrappedlibxcbxkb.c b/src/wrapped/wrappedlibxcbxkb.c index cc7672b..4076642 100644 --- a/src/wrapped/wrappedlibxcbxkb.c +++ b/src/wrapped/wrappedlibxcbxkb.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbxkbName = "libxcb-xkb.so"; -#else - const char* libxcbxkbName = "libxcb-xkb.so.1"; -#endif +const char* libxcbxkbName = "libxcb-xkb.so.1"; +#define ALTNAME "libxcb-xkb.so" #define LIBNAME libxcbxkb diff --git a/src/wrapped/wrappedlibxcbxtest.c b/src/wrapped/wrappedlibxcbxtest.c index 211efb4..e9c98f7 100644 --- a/src/wrapped/wrappedlibxcbxtest.c +++ b/src/wrapped/wrappedlibxcbxtest.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxcbxtestName = "libxcb-xtest.so"; -#else - const char* libxcbxtestName = "libxcb-xtest.so.0"; -#endif +const char* libxcbxtestName = "libxcb-xtest.so.0"; +#define ALTNAME "libxcb-xtest.so" #define LIBNAME libxcbxtest diff --git a/src/wrapped/wrappedlibxcomposite.c b/src/wrapped/wrappedlibxcomposite.c index 0521f93..1fa7f55 100644 --- a/src/wrapped/wrappedlibxcomposite.c +++ b/src/wrapped/wrappedlibxcomposite.c @@ -12,11 +12,8 @@ #include "x64emu.h" #include "debug.h" -#ifdef ANDROID - const char* libxcompositeName = "libXcomposite.so"; -#else - const char* libxcompositeName = "libXcomposite.so.1"; -#endif +const char* libxcompositeName = "libXcomposite.so.1"; +#define ALTNAME "libXcomposite.so" #define LIBNAME libxcomposite diff --git a/src/wrapped/wrappedlibxcomposite_private.h b/src/wrapped/wrappedlibxcomposite_private.h index 9c52d04..c60a4c3 100644 --- a/src/wrapped/wrappedlibxcomposite_private.h +++ b/src/wrapped/wrappedlibxcomposite_private.h @@ -1,5 +1,5 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(XCompositeCreateRegionFromBorderClip, LFpL) diff --git a/src/wrapped/wrappedlibxcursor.c b/src/wrapped/wrappedlibxcursor.c index b70911a..c9d7992 100644 --- a/src/wrapped/wrappedlibxcursor.c +++ b/src/wrapped/wrappedlibxcursor.c @@ -11,19 +11,12 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* libxcursorName = "libXcursor.so"; -#else - const char* libxcursorName = "libXcursor.so.1"; -#endif +const char* libxcursorName = "libXcursor.so.1"; +#define ALTNAME "libXcursor.so" #define LIBNAME libxcursor -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so", "libXfixes.so", "libXrender.so" -#else #define NEEDED_LIBS "libX11.so.6", "libXfixes.so.3", "libXrender.so.1" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxcursor_private.h b/src/wrapped/wrappedlibxcursor_private.h index 493b933..417b3f1 100644 --- a/src/wrapped/wrappedlibxcursor_private.h +++ b/src/wrapped/wrappedlibxcursor_private.h @@ -1,10 +1,10 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif GO(XcursorAnimateCreate, pFp) GO(XcursorAnimateDestroy, vFp) -GO(XcursorAnimateNext, pFp) +GO(XcursorAnimateNext, LFp) GO(XcursorCommentCreate, pFui) GO(XcursorCommentDestroy, vFp) GO(XcursorCommentsCreate, pFi) @@ -13,20 +13,20 @@ GO(XcursorCommentsDestroy, vFp) //GO(_XcursorCreateGlyphCursor, GO(XcursorCursorsCreate, pFpi) GO(XcursorCursorsDestroy, vFp) -GO(XcursorFileLoad, pFppp) -GO(XcursorFileLoadAllImages, pFp) -GO(XcursorFileLoadImage, pFpi) -GO(XcursorFileLoadImages, pFpi) +GO(XcursorFileLoad, iFSpp) +GO(XcursorFileLoadAllImages, pFS) +GO(XcursorFileLoadImage, pFSi) +GO(XcursorFileLoadImages, pFSi) GO(XcursorFilenameLoad, iFppp) GO(XcursorFilenameLoadAllImages, pFp) -GO(XcursorFilenameLoadCursor, pFpp) +GO(XcursorFilenameLoadCursor, LFpp) GO(XcursorFilenameLoadCursors, pFpp) GO(XcursorFilenameLoadImage, pFpi) GO(XcursorFilenameLoadImages, pFpi) GO(XcursorFilenameSave, iFppp) GO(XcursorFilenameSaveImages, iFpp) -GO(XcursorFileSave, iFppp) -GO(XcursorFileSaveImages, iFpp) +GO(XcursorFileSave, iFSpp) +GO(XcursorFileSaveImages, iFSp) GO(XcursorGetDefaultSize, iFp) //GO(_XcursorGetDisplayInfo, GO(XcursorGetTheme, pFp) @@ -34,31 +34,31 @@ GO(XcursorGetThemeCore, iFp) GO(XcursorImageCreate, pFii) GO(XcursorImageDestroy, vFp) //GOM(XcursorImageHash, vFEpp) // needs unbridge XImage (first p) -GO(XcursorImageLoadCursor, pFpp) +GO(XcursorImageLoadCursor, LFpp) GO(XcursorImagesCreate, pFi) GO(XcursorImagesDestroy, vFp) -GO(XcursorImagesLoadCursor, pFpp) +GO(XcursorImagesLoadCursor, LFpp) GO(XcursorImagesLoadCursors, pFpp) GO(XcursorImagesSetName, vFpp) -GO(XcursorLibraryLoadCursor, pFpp) +GO(XcursorLibraryLoadCursor, LFpp) GO(XcursorLibraryLoadCursors, pFpp) GO(XcursorLibraryLoadImage, pFppi) GO(XcursorLibraryLoadImages, pFppi) GO(XcursorLibraryPath, pFv) GO(XcursorLibraryShape, iFp) -GO(XcursorNoticeCreateBitmap, vFppuu) -//GOM(XcursorNoticePutBitmap, vFEppp) //needs unbridge XImage (last p) +GO(XcursorNoticeCreateBitmap, vFpLuu) +//GOM(XcursorNoticePutBitmap, vFEpLp) //needs unbridge XImage (last p) GO(XcursorSetDefaultSize, iFpi) GO(XcursorSetTheme, iFpp) GO(XcursorSetThemeCore, iFpi) -GO(XcursorShapeLoadCursor, pFpu) +GO(XcursorShapeLoadCursor, LFpu) GO(XcursorShapeLoadCursors, pFpu) GO(XcursorShapeLoadImage, pFupi) GO(XcursorShapeLoadImages, pFupi) GO(XcursorSupportsAnim, iFp) GO(XcursorSupportsARGB, iFp) -GO(XcursorTryShapeBitmapCursor, pFpppppuu) -GO(XcursorTryShapeCursor, pFpppuupp) +GO(XcursorTryShapeBitmapCursor, LFpLLppuu) +GO(XcursorTryShapeCursor, LFpLLuupp) GO(XcursorXcFileLoad, iFppp) GO(XcursorXcFileLoadAllImages, pFp) GO(XcursorXcFileLoadImage, pFpi) diff --git a/src/wrapped/wrappedlibxdamage.c b/src/wrapped/wrappedlibxdamage.c index 8637f2a..71be3d3 100644 --- a/src/wrapped/wrappedlibxdamage.c +++ b/src/wrapped/wrappedlibxdamage.c @@ -12,11 +12,8 @@ #include "x64emu.h" #include "debug.h" -#ifdef ANDROID - const char* libxdamageName = "libXdamage.so"; -#else - const char* libxdamageName = "libXdamage.so.1"; -#endif +const char* libxdamageName = "libXdamage.so.1"; +#define ALTNAME "libXdamage.so" #define LIBNAME libxdamage diff --git a/src/wrapped/wrappedlibxdmcp.c b/src/wrapped/wrappedlibxdmcp.c index 39a47d0..c7822f0 100644 --- a/src/wrapped/wrappedlibxdmcp.c +++ b/src/wrapped/wrappedlibxdmcp.c @@ -11,11 +11,8 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* libxdmcpName = "libXdmcp.so"; -#else - const char* libxdmcpName = "libXdmcp.so.6"; -#endif +const char* libxdmcpName = "libXdmcp.so.6"; +#define ALTNAME "libXdmcp.so" #define LIBNAME libxdmcp diff --git a/src/wrapped/wrappedlibxext.c b/src/wrapped/wrappedlibxext.c index 0b7cfd9..e224b64 100644 --- a/src/wrapped/wrappedlibxext.c +++ b/src/wrapped/wrappedlibxext.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxextName = "libXext.so"; -#else - const char* libxextName = "libXext.so.6"; -#endif +const char* libxextName = "libXext.so.6"; +#define ALTNAME "libXext.so" #define LIBNAME libxext @@ -344,7 +341,7 @@ EXPORT void* my_XShmCreateImage(x64emu_t* emu, void* disp, void* vis, uint32_t d return img; } -EXPORT int32_t my_XShmPutImage(x64emu_t* emu, void* disp, void* drawable, void* gc, void* image +EXPORT int32_t my_XShmPutImage(x64emu_t* emu, void* disp, size_t drawable, void* gc, void* image , int32_t src_x, int32_t src_y, int32_t dst_x, int32_t dst_y , uint32_t w, uint32_t h, int32_t sendevt) { @@ -355,7 +352,7 @@ EXPORT int32_t my_XShmPutImage(x64emu_t* emu, void* disp, void* drawable, void* return r; } -EXPORT int32_t my_XShmGetImage(x64emu_t* emu, void* disp, void* drawable, void* image, int32_t x, int32_t y, uint32_t plane) +EXPORT int32_t my_XShmGetImage(x64emu_t* emu, void* disp, size_t drawable, void* image, int32_t x, int32_t y, size_t plane) { UnbridgeImageFunc(emu, (XImage*)image); int32_t r = my->XShmGetImage(disp, drawable, image, x, y, plane); @@ -390,10 +387,6 @@ EXPORT void* my_XextAddDisplay(x64emu_t* emu, void* extinfo, void* dpy, void* ex return ret; } -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so", "libxcb.so", "libXau.so", "libdl.so", "libXdmcp.so" -#else #define NEEDED_LIBS "libX11.so.6", "libxcb.so.1", "libXau.so.6", "libdl.so.2", "libXdmcp.so.6" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxext_private.h b/src/wrapped/wrappedlibxext_private.h index 7d98106..d6dfa2d 100644 --- a/src/wrapped/wrappedlibxext_private.h +++ b/src/wrapped/wrappedlibxext_private.h @@ -1,119 +1,119 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif GO(DPMSCapable, iFp) GO(DPMSDisable, iFp) GO(DPMSEnable, iFp) -GO(DPMSForceLevel, iFpu) +GO(DPMSForceLevel, iFpW) GO(DPMSGetTimeouts, iFpppp) GO(DPMSGetVersion, iFppp) GO(DPMSInfo, iFppp) GO(DPMSQueryExtension, iFppp) -GO(DPMSSetTimeouts, iFpuuu) -//GO(XagCreateAssociation, -//GO(XagCreateEmbeddedApplicationGroup, -//GO(XagCreateNonembeddedApplicationGroup, -//GO(XagDestroyApplicationGroup, -//GO(XagDestroyAssociation, -//GO(XagGetApplicationGroupAttributes, -//GO(XagQueryApplicationGroup, -//GO(XagQueryVersion, -//GO(XcupGetReservedColormapEntries, -//GO(XcupQueryVersion, -//GO(XcupStoreColors, -GO(XdbeAllocateBackBufferName, pFppu) +GO(DPMSSetTimeouts, iFpWWW) +GO(XagCreateAssociation, iFppp) +GO(XagCreateEmbeddedApplicationGroup, iFpLLLLp) +GO(XagCreateNonembeddedApplicationGroup, iFpp) +GO(XagDestroyApplicationGroup, iFpL) +GO(XagDestroyAssociation, iFpL) +//GOM(XagGetApplicationGroupAttributes, iFEpLV) +GO(XagQueryApplicationGroup, iFpLp) +GO(XagQueryVersion, iFppp) +GO(XcupGetReservedColormapEntries, iFpipp) +GO(XcupQueryVersion, iFppp) +GO(XcupStoreColors, iFpLpi) +GO(XdbeAllocateBackBufferName, LFpLC) GO(XdbeBeginIdiom, iFp) -GO(XdbeDeallocateBackBufferName, iFpp) +GO(XdbeDeallocateBackBufferName, iFpL) GO(XdbeEndIdiom, iFp) GO(XdbeFreeVisualInfo, vFp) -GO(XdbeGetBackBufferAttributes, pFpp) +GO(XdbeGetBackBufferAttributes, pFpL) GO(XdbeGetVisualInfo, pFppp) GO(XdbeQueryExtension, iFppp) GO(XdbeSwapBuffers, iFppi) -//GO(XeviGetVisualInfo, -//GO(XeviQueryExtension, -//GO(XeviQueryVersion, +GO(XeviGetVisualInfo, iFppipp) +GO(XeviQueryExtension, iFp) +GO(XeviQueryVersion, iFppp) GOM(XextAddDisplay, pFEppppip) GO(XextCreateExtension, pFv) GO(XextDestroyExtension, vFp) -DATAB(_XExtensionErrorFunction, 4) +DATAB(_XExtensionErrorFunction, sizeof(void*)) GO(XextFindDisplay, pFpp) GO(XextRemoveDisplay, iFpp) -//GO(XGEQueryExtension, -//GO(XGEQueryVersion, -//GO(XLbxGetEventBase, -//GO(XLbxQueryExtension, -//GO(XLbxQueryVersion, -//GO(XmbufChangeBufferAttributes, -//GO(XmbufChangeWindowAttributes, -//GO(XmbufClearBufferArea, -//GO(XmbufCreateBuffers, -//GO(XmbufCreateStereoWindow, -//GO(XmbufDestroyBuffers, -//GO(XmbufDisplayBuffers, -//GO(XmbufGetBufferAttributes, -//GO(XmbufGetScreenInfo, -//GO(XmbufGetVersion, -//GO(XmbufGetWindowAttributes, -//GO(XmbufQueryExtension, +GO(XGEQueryExtension, iFppp) +GO(XGEQueryVersion, iFppp) +GO(XLbxGetEventBase, iFp) +GO(XLbxQueryExtension, iFpppp) +GO(XLbxQueryVersion, iFppp) +GO(XmbufChangeBufferAttributes, vFpLLp) +GO(XmbufChangeWindowAttributes, vFpLLp) +GO(XmbufClearBufferArea, vFpLiiuui) +GO(XmbufCreateBuffers, iFpLiiip) +//GOM(XmbufCreateStereoWindow, LFEpLiiuuuiupLppp) +GO(XmbufDestroyBuffers, vFpL) +GO(XmbufDisplayBuffers, vFpipii) +GO(XmbufGetBufferAttributes, iFpLp) +GO(XmbufGetScreenInfo, iFpLpppp) +GO(XmbufGetVersion, iFppp) +GO(XmbufGetWindowAttributes, iFpLp) +GO(XmbufQueryExtension, iFppp) GO(XMissingExtension, iFpp) -//GO(XMITMiscGetBugMode, -//GO(XMITMiscQueryExtension, -//GO(XMITMiscSetBugMode, -//GO(XSecurityAllocXauth, -//GO(XSecurityFreeXauth, -//GO(XSecurityGenerateAuthorization, -//GO(XSecurityQueryExtension, -//GO(XSecurityRevokeAuthorization, +GO(XMITMiscGetBugMode, iFp) +GO(XMITMiscQueryExtension, iFppp) +GO(XMITMiscSetBugMode, iFpi) +GO(XSecurityAllocXauth, pFv) +GO(XSecurityFreeXauth, vFp) +GO(XSecurityGenerateAuthorization, pFppLpp) +GO(XSecurityQueryExtension, iFppp) +GO(XSecurityRevokeAuthorization, iFpL) GOM(XSetExtensionErrorHandler, pFEp) -GO(XShapeCombineMask, vFppiiipi) -GO(XShapeCombineRectangles, vFppiiipiii) -GO(XShapeCombineRegion, vFppiiipi) -GO(XShapeCombineShape, vFppiiipii) -GO(XShapeGetRectangles, pFppipp) -GO(XShapeInputSelected, uFpp) -GO(XShapeOffsetShape, vFppiii) +GO(XShapeCombineMask, vFpLiiiLi) +GO(XShapeCombineRectangles, vFpLiiipiii) +GO(XShapeCombineRegion, vFpLiiipi) +GO(XShapeCombineShape, vFpLiiiLii) +GO(XShapeGetRectangles, pFpLipp) +GO(XShapeInputSelected, LFpL) +GO(XShapeOffsetShape, vFpLiii) GO(XShapeQueryExtension, iFppp) -GO(XShapeQueryExtents, iFpppppppppppp) +GO(XShapeQueryExtents, iFpLpppppppppp) GO(XShapeQueryVersion, iFppp) -GO(XShapeSelectInput, vFppu) +GO(XShapeSelectInput, vFpLL) GO(XShmAttach, iFpp) GOM(XShmCreateImage, pFEppuippuu) //need brige/unbridge... -GO(XShmCreatePixmap, pFppppuuu) +GO(XShmCreatePixmap, LFpLppuuu) GO(XShmDetach, iFpp) GO(XShmGetEventBase, iFp) -GOM(XShmGetImage, iFEpppiiu) //need brige/unbridge... +GOM(XShmGetImage, iFEpLpiiL) //need brige/unbridge... GO(XShmPixmapFormat, iFp) -GOM(XShmPutImage, iFEppppiiiiuui) //need brige/unbridge... +GOM(XShmPutImage, iFEpLppiiiiuui) //need brige/unbridge... GO(XShmQueryExtension, iFp) GO(XShmQueryVersion, iFpppp) GO(XSyncAwait, iFppi) -//GO(XSyncAwaitFence, -GO(XSyncChangeAlarm, iFpuLp) +GO(XSyncAwaitFence, iFppi) +GO(XSyncChangeAlarm, iFpLLp) GO(XSyncChangeCounter, iFpuU) -GO(XSyncCreateAlarm, uFpLp) // XSyncAlarm is an XID +GO(XSyncCreateAlarm, LFpLp) // XSyncAlarm is an XID GO(XSyncCreateCounter, uFpU) // XSyncValue is a struct of 2 int -//GO(XSyncCreateFence, -GO(XSyncDestroyAlarm, iFpu) -GO(XSyncDestroyCounter, iFpu) -//GO(XSyncDestroyFence, +GO(XSyncCreateFence, LFpLi) +GO(XSyncDestroyAlarm, iFpL) +GO(XSyncDestroyCounter, iFpL) +GO(XSyncDestroyFence, iFpL) GO(XSyncFreeSystemCounterList, vFp) -GO(XSyncGetPriority, iFpup) +GO(XSyncGetPriority, iFpLp) GO(XSyncInitialize, iFppp) GO(XSyncIntsToValue, vFpui) GO(XSyncIntToValue, vFpi) GO(XSyncListSystemCounters, pFpp) -//GO(XSyncMaxValue, -//GO(XSyncMinValue, -GO(XSyncQueryAlarm, iFpup) -GO(XSyncQueryCounter, iFpup) +GO(XSyncMaxValue, vFp) +GO(XSyncMinValue, vFp) +GO(XSyncQueryAlarm, iFpLp) +GO(XSyncQueryCounter, iFpLp) GO(XSyncQueryExtension, iFppp) -//GO(XSyncQueryFence, -//GO(XSyncResetFence, +GO(XSyncQueryFence, iFpLp) +GO(XSyncResetFence, iFpL) GO(XSyncSetCounter, iFpuU) // XSyncCounter is an XID -GO(XSyncSetPriority, iFpui) -//GO(XSyncTriggerFence, +GO(XSyncSetPriority, iFpLi) +GO(XSyncTriggerFence, iFpL) //GO(XSyncValueAdd, //GO(XSyncValueEqual, //GO(XSyncValueGreaterOrEqual, @@ -127,13 +127,13 @@ GO(XSyncValueIsZero, iFp) //GO(XSyncValueLow32, //GO(XSyncValueSubtract, DATA(XTestFakeAckType, sizeof(void*)) -//GO(XTestFakeInput, -//GO(XTestFlush, -//GO(XTestGetInput, +GO(XTestFakeInput, iFppii) +GO(XTestFlush, iFp) +GO(XTestGetInput, iFpi) DATAB(XTestInputActionType, sizeof(void*)) -//GO(XTestMovePointer, -//GO(XTestPressButton, -//GO(XTestPressKey, -//GO(XTestQueryInputSize, -//GO(XTestReset, -//GO(XTestStopInput, +GO(XTestMovePointer, iFpipppu) +GO(XTestPressButton, iFpiLuu) +GO(XTestPressKey, iFpiLuu) +GO(XTestQueryInputSize, iFpp) +GO(XTestReset, iFp) +GO(XTestStopInput, iFp) diff --git a/src/wrapped/wrappedlibxfixes.c b/src/wrapped/wrappedlibxfixes.c index 1def73a..b68766c 100644 --- a/src/wrapped/wrappedlibxfixes.c +++ b/src/wrapped/wrappedlibxfixes.c @@ -11,18 +11,11 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* libxfixesName = "libXfixes.so"; -#else - const char* libxfixesName = "libXfixes.so.3"; -#endif +const char* libxfixesName = "libXfixes.so.3"; +#define ALTNAME "libXfixes.so" #define LIBNAME libxfixes -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so", "libxcb.so", "libXau.so", "libXdmcp.so" -#else #define NEEDED_LIBS "libX11.so.6", "libxcb.so.1", "libXau.so.6", "libXdmcp.so.6" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxfixes_private.h b/src/wrapped/wrappedlibxfixes_private.h index b388944..1a5eae0 100644 --- a/src/wrapped/wrappedlibxfixes_private.h +++ b/src/wrapped/wrappedlibxfixes_private.h @@ -1,42 +1,42 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif -GO(XFixesChangeCursor, vFppp) -GO(XFixesChangeCursorByName, vFppp) -GO(XFixesChangeSaveSet, vFppiii) -GO(XFixesCopyRegion, vFppp) -GO(XFixesCreatePointerBarrier, pFppiiiiiip) -GO(XFixesCreateRegion, pFppi) -GO(XFixesCreateRegionFromBitmap, pFpp) -GO(XFixesCreateRegionFromGC, pFpp) -GO(XFixesCreateRegionFromPicture, pFpp) -GO(XFixesCreateRegionFromWindow, pFppi) -GO(XFixesDestroyPointerBarrier, vFpp) -GO(XFixesDestroyRegion, vFpp) -GO(XFixesExpandRegion, vFpppuuuu) +GO(XFixesChangeCursor, vFpLL) +GO(XFixesChangeCursorByName, vFpLp) +GO(XFixesChangeSaveSet, vFpLiii) +GO(XFixesCopyRegion, vFpLL) +GO(XFixesCreatePointerBarrier, LFpLiiiiiip) +GO(XFixesCreateRegion, LFppi) +GO(XFixesCreateRegionFromBitmap, LFpL) +GO(XFixesCreateRegionFromGC, LFpp) +GO(XFixesCreateRegionFromPicture, LFpL) +GO(XFixesCreateRegionFromWindow, LFpLi) +GO(XFixesDestroyPointerBarrier, vFpL) +GO(XFixesDestroyRegion, vFpL) +GO(XFixesExpandRegion, vFpLLuuuu) DATA(XFixesExtensionInfo, sizeof(void*)) //B DATA(XFixesExtensionName, sizeof(void*)) //D -GO(XFixesFetchRegion, pFppp) -GO(XFixesFetchRegionAndBounds, pFpppp) -GO(XFixesFindDisplay, pFp) +GO(XFixesFetchRegion, pFpLp) +GO(XFixesFetchRegionAndBounds, pFpLpp) +GO(XFixesFindDisplay, pFp) // Warning: failed to confirm GO(XFixesGetCursorImage, pFp) -GO(XFixesGetCursorName, pFppp) -GO(XFixesHideCursor, vFpp) -GO(XFixesIntersectRegion, vFpppp) -GO(XFixesInvertRegion, vFpppp) +GO(XFixesGetCursorName, pFpLp) +GO(XFixesHideCursor, vFpL) +GO(XFixesIntersectRegion, vFpLLL) +GO(XFixesInvertRegion, vFpLpL) GO(XFixesQueryExtension, iFppp) GO(XFixesQueryVersion, iFppp) -GO(XFixesRegionExtents, vFppp) -GO(XFixesSelectCursorInput, vFppu) -GO(XFixesSelectSelectionInput, vFpppu) -GO(XFixesSetCursorName, vFppp) -GO(XFixesSetGCClipRegion, vFppiip) -GO(XFixesSetPictureClipRegion, vFppiip) -GO(XFixesSetRegion, vFpppi) -GO(XFixesSetWindowShapeRegion, vFppiiip) -GO(XFixesShowCursor, vFpp) -GO(XFixesSubtractRegion, vFpppp) -GO(XFixesTranslateRegion, vFppii) -GO(XFixesUnionRegion, vFpppp) +GO(XFixesRegionExtents, vFpLL) +GO(XFixesSelectCursorInput, vFpLL) +GO(XFixesSelectSelectionInput, vFpLLL) +GO(XFixesSetCursorName, vFpLp) +GO(XFixesSetGCClipRegion, vFppiiL) +GO(XFixesSetPictureClipRegion, vFpLiiL) +GO(XFixesSetRegion, vFpLpi) +GO(XFixesSetWindowShapeRegion, vFpLiiiL) +GO(XFixesShowCursor, vFpL) +GO(XFixesSubtractRegion, vFpLLL) +GO(XFixesTranslateRegion, vFpLii) +GO(XFixesUnionRegion, vFpLLL) GO(XFixesVersion, iFv) diff --git a/src/wrapped/wrappedlibxft.c b/src/wrapped/wrappedlibxft.c index 633e406..4338280 100644 --- a/src/wrapped/wrappedlibxft.c +++ b/src/wrapped/wrappedlibxft.c @@ -6,23 +6,51 @@ #include "wrappedlibs.h" +#include "debug.h" #include "wrapper.h" #include "bridge.h" #include "librarian/library_private.h" #include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" -#ifdef ANDROID - const char* libxftName = "libXft.so"; -#else - const char* libxftName = "libXft.so.2"; -#endif +const char* libxftName = "libXft.so.2"; +#define ALTNAME "libXft.so" #define LIBNAME libxft -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so", "libfontconfig.so", "libXrender.so", "libfreetype.so" -#else +typedef void(*vFp_t)(void*); +typedef void*(*pFpp_t)(void*, void*); +typedef void*(*pFpipp_t)(void*, int, void*, void*); + +#define ADDED_FUNCTIONS() \ + GO(XftFontMatch, pFpipp_t) \ + GO(XftFontOpenPattern, pFpp_t) \ + GO(FcPatternDestroy, vFp_t) + +#include "generated/wrappedlibxfttypes.h" + +#include "wrappercallback.h" + +void* my_FcPatternBuild(x64emu_t* emu, void* pattern, uint64_t* b); // from fontconfig +EXPORT void* my_XftFontOpen(x64emu_t* emu, void* dpy, int screen, uintptr_t* b) +{ + int result; + void* pat = my_FcPatternBuild(emu, NULL, b); + void* match = my->XftFontMatch(dpy, screen, pat, &result); + my->FcPatternDestroy(pat); + if(!match) + return NULL; + void* ret = my->XftFontOpenPattern(dpy, match); + if(!ret) + my->FcPatternDestroy(match); + return ret; +} + #define NEEDED_LIBS "libX11.so.6", "libfontconfig.so.1", "libXrender.so.1", "libfreetype.so.6" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxft_private.h b/src/wrapped/wrappedlibxft_private.h index 843213b..5c920e9 100644 --- a/src/wrapped/wrappedlibxft_private.h +++ b/src/wrapped/wrappedlibxft_private.h @@ -1,81 +1,81 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif -//GO(XftCharExists, -//GO(XftCharFontSpecRender, -//GO(XftCharIndex, -//GO(XftCharSpecRender, -GO(XftColorAllocName, iFppupp) -//GO(XftColorAllocValue, -GO(XftColorFree, vFppup) -//GO(XftDefaultHasRender, -//GO(XftDefaultSet, -//GO(XftDefaultSubstitute, -GO(XftDrawChange, vFpp) -//GO(XftDrawCharFontSpec, -//GO(XftDrawCharSpec, -//GO(XftDrawColormap, -GO(XftDrawCreate, pFpppp) -//GO(XftDrawCreateAlpha, -//GO(XftDrawCreateBitmap, +GO(XftCharExists, iFppu) +GO(XftCharFontSpecRender, vFpiLLiipi) +GO(XftCharIndex, uFppu) +GO(XftCharSpecRender, vFpiLpLiipi) +GO(XftColorAllocName, iFppLpp) +GO(XftColorAllocValue, iFppLpp) +GO(XftColorFree, vFppLp) +GO(XftDefaultHasRender, iFp) +GO(XftDefaultSet, iFpp) +GO(XftDefaultSubstitute, vFpip) +GO(XftDrawChange, vFpL) +GO(XftDrawCharFontSpec, vFpppi) +GO(XftDrawCharSpec, vFppppi) +GO(XftDrawColormap, LFp) +GO(XftDrawCreate, pFpLpL) +GO(XftDrawCreateAlpha, pFpLi) +GO(XftDrawCreateBitmap, pFpL) GO(XftDrawDestroy, vFp) -//GO(XftDrawDisplay, -//GO(XftDrawDrawable, -//GO(XftDrawGlyphFontSpec, -//GO(XftDrawGlyphs, -//GO(XftDrawGlyphSpec, -//GO(XftDrawPicture, +GO(XftDrawDisplay, pFp) +GO(XftDrawDrawable, LFp) +GO(XftDrawGlyphFontSpec, vFpppi) +GO(XftDrawGlyphs, vFpppiipi) +GO(XftDrawGlyphSpec, vFppppi) +GO(XftDrawPicture, LFp) GO(XftDrawRect, vFppiiuu) GO(XftDrawSetClip, iFpp) -//GO(XftDrawSetClipRectangles, -//GO(XftDrawSetSubwindowMode, -//GO(XftDrawSrcPicture, +GO(XftDrawSetClipRectangles, iFpiipi) +GO(XftDrawSetSubwindowMode, vFpi) +GO(XftDrawSrcPicture, LFpp) GO(XftDrawString16, vFpppiipi) GO(XftDrawString32, vFpppiipi) -//GO(XftDrawString8, -//GO(XftDrawStringUtf16, -//GO(XftDrawStringUtf8, -//GO(XftDrawVisual, -//GO(XftFontCheckGlyph, +GO(XftDrawString8, vFpppiipi) +GO(XftDrawStringUtf16, vFpppiipui) +GO(XftDrawStringUtf8, vFpppiipi) +GO(XftDrawVisual, pFp) +GO(XftFontCheckGlyph, iFppiupp) GO(XftFontClose, vFpp) GO(XftFontCopy, pFpp) -//GO(XftFontInfoCreate, -//GO(XftFontInfoDestroy, -//GO(XftFontInfoEqual, -//GO(XftFontInfoHash, -//GO(XftFontLoadGlyphs, +GO(XftFontInfoCreate, pFpp) +GO(XftFontInfoDestroy, vFpp) +GO(XftFontInfoEqual, iFpp) +GO(XftFontInfoHash, uFp) +GO(XftFontLoadGlyphs, vFppipi) GO(XftFontMatch, pFpipp) -GO(XftFontOpen, pFpippppppppppppppppp) // use ... -//GO(XftFontOpenInfo, +GOM(XftFontOpen, pFEpiV) +GO(XftFontOpenInfo, pFppp) GO(XftFontOpenName, pFpip) GO(XftFontOpenPattern, pFpp) GO(XftFontOpenXlfd, pFpip) -//GO(XftFontUnloadGlyphs, -//GO(XftGetVersion, -//GO(XftGlyphExtents, -//GO(XftGlyphFontSpecRender, -//GO(XftGlyphRender, -//GO(XftGlyphSpecRender, -//GO(XftInit, -//GO(XftInitFtLibrary, -//GO(XftListFonts, -//GO(XftLockFace, -//GO(XftNameParse, +GO(XftFontUnloadGlyphs, vFpppi) +GO(XftGetVersion, iFv) +GO(XftGlyphExtents, vFpppip) +GO(XftGlyphFontSpecRender, vFpiLLiipi) +GO(XftGlyphRender, vFpiLpLiiiipi) +GO(XftGlyphSpecRender, vFpiLpLiipi) +GO(XftInit, iFp) +GO(XftInitFtLibrary, iFv) +GO(XftListFonts, pFpipppppppppppppp) // actually pFpiV +GO(XftLockFace, pFp) +GO(XftNameParse, pFp) GO(XftNameUnparse, iFppi) GO(XftTextExtents16, vFpppip) GO(XftTextExtents32, vFpppip) -//GO(XftTextExtents8, -//GO(XftTextExtentsUtf16, -//GO(XftTextExtentsUtf8, -//GO(XftTextRender16, -//GO(XftTextRender16BE, -//GO(XftTextRender16LE, -//GO(XftTextRender32, -//GO(XftTextRender32BE, -//GO(XftTextRender32LE, -//GO(XftTextRender8, -//GO(XftTextRenderUtf16, -//GO(XftTextRenderUtf8, -//GO(XftUnlockFace, -//GO(XftXlfdParse, +GO(XftTextExtents8, vFpppip) +GO(XftTextExtentsUtf16, vFpppuip) +GO(XftTextExtentsUtf8, vFpppip) +GO(XftTextRender16, vFpiLpLiiiipi) +GO(XftTextRender16BE, vFpiLpLiiiipi) +GO(XftTextRender16LE, vFpiLpLiiiipi) +GO(XftTextRender32, vFpiLpLiiiipi) +GO(XftTextRender32BE, vFpiLpLiiiipi) +GO(XftTextRender32LE, vFpiLpLiiiipi) +GO(XftTextRender8, vFpiLpLiiiipi) +GO(XftTextRenderUtf16, vFpiLpLiiiipui) +GO(XftTextRenderUtf8, vFpiLpLiiiipi) +GO(XftUnlockFace, vFp) +GO(XftXlfdParse, pFpii) diff --git a/src/wrapped/wrappedlibxi.c b/src/wrapped/wrappedlibxi.c index 271048c..c502e30 100644 --- a/src/wrapped/wrappedlibxi.c +++ b/src/wrapped/wrappedlibxi.c @@ -11,18 +11,11 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* libxiName = "libXi.so"; -#else - const char* libxiName = "libXi.so.6"; -#endif +const char* libxiName = "libXi.so.6"; +#define ALTNAME "libXi.so" #define LIBNAME libxi -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so", "libXext.so" -#else #define NEEDED_LIBS "libX11.so.6", "libXext.so.6" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxi_private.h b/src/wrapped/wrappedlibxi_private.h index 6e10da5..1f5169d 100644 --- a/src/wrapped/wrappedlibxi_private.h +++ b/src/wrapped/wrappedlibxi_private.h @@ -1,88 +1,88 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif -//GO(XAllowDeviceEvents, -//GO(XChangeDeviceControl, -//GO(XChangeDeviceDontPropagateList, -//GO(XChangeDeviceKeyMapping, -GO(XChangeDeviceProperty, vFppppiipi) -//GO(XChangeFeedbackControl, -//GO(XChangeKeyboardDevice, -//GO(XChangePointerDevice, +GO(XAllowDeviceEvents, iFppiL) +GO(XChangeDeviceControl, iFppip) +GO(XChangeDeviceDontPropagateList, iFpLipi) +GO(XChangeDeviceKeyMapping, iFppiipi) +GO(XChangeDeviceProperty, vFppLLiipi) +GO(XChangeFeedbackControl, iFppLp) +GO(XChangeKeyboardDevice, iFpp) +GO(XChangePointerDevice, iFppii) GO(XCloseDevice, iFpp) -GO(XDeleteDeviceProperty, vFppp) -//GO(XDeviceBell, -//GO(XFreeDeviceControl, -GO(XFreeDeviceList, iFp) -GO(XFreeDeviceMotionEvents, iFv) +GO(XDeleteDeviceProperty, vFppL) +GO(XDeviceBell, iFppLLi) +GO(XFreeDeviceControl, vFp) +GO(XFreeDeviceList, vFp) +GO(XFreeDeviceMotionEvents, vFp) GO(XFreeDeviceState, vFp) -//GO(XFreeFeedbackList, -GO(XGetDeviceButtonMapping, iFpppi) -//GO(XGetDeviceControl, -//GO(XGetDeviceDontPropagateList, -//GO(XGetDeviceFocus, -//GO(XGetDeviceKeyMapping, -//GO(XGetDeviceModifierMapping, -GO(XGetDeviceMotionEvents, pFppuuppp) -GO(XGetDeviceProperty, iFpppllipppppp) +GO(XFreeFeedbackList, vFp) +GO(XGetDeviceButtonMapping, iFpppu) +GO(XGetDeviceControl, pFppi) +GO(XGetDeviceDontPropagateList, pFpLp) +GO(XGetDeviceFocus, iFppppp) +GO(XGetDeviceKeyMapping, pFppCip) +GO(XGetDeviceModifierMapping, pFpp) +GO(XGetDeviceMotionEvents, pFppLLppp) +GO(XGetDeviceProperty, iFppLlliLppppp) GO(XGetExtensionVersion, pFpp) -//GO(XGetFeedbackControl, -//GO(XGetSelectedExtensionEvents, -GO(XGrabDevice, iFpppiipiiu) -//GO(XGrabDeviceButton, -//GO(XGrabDeviceKey, -//GO(XIAllowEvents, -//GO(XIAllowTouchEvents, -GO(XIBarrierReleasePointer, vFpipp) +GO(XGetFeedbackControl, pFppp) +GO(XGetSelectedExtensionEvents, iFpLpppp) +GO(XGrabDevice, iFppLiipiiL) +GO(XGrabDeviceButton, iFppuupLiupii) +GO(XGrabDeviceKey, iFppuupLiupii) +GO(XIAllowEvents, iFpiiL) +GO(XIAllowTouchEvents, iFpiuLi) +GO(XIBarrierReleasePointer, vFpiLu) GO(XIBarrierReleasePointers, vFppi) -//GO(XIChangeHierarchy, -GO(XIChangeProperty, vFpippiipi) -GO(XIDefineCursor, iFpipp) -GO(XIDeleteProperty, vFpip) +GO(XIChangeHierarchy, iFppi) +GO(XIChangeProperty, vFpiLLiipi) +GO(XIDefineCursor, iFpiLL) +GO(XIDeleteProperty, vFpiL) GO(XIFreeDeviceInfo, vFp) -GO(XIGetClientPointer, iFppp) -//GO(XIGetFocus, -GO(XIGetProperty, iFpipllipppppp) -GO(XIGetSelectedEvents, iFpppi) -GO(XIGrabButton, iFpiippiiipip) -GO(XIGrabDevice, iFpipLpiiip) -//GO(XIGrabEnter, -//GO(XIGrabFocusIn, -GO(XIGrabKeycode, iFpiipiiipip) -GO(XIGrabTouchBegin, iFpipipip) -//GO(XIListProperties, +GO(XIGetClientPointer, iFpLp) +GO(XIGetFocus, iFpip) +GO(XIGetProperty, iFpiLlliLppppp) +GO(XIGetSelectedEvents, pFpLp) +GO(XIGrabButton, iFpiiLLiiipip) +GO(XIGrabDevice, iFpiLLLiiip) +GO(XIGrabEnter, iFpiLLiiipip) +GO(XIGrabFocusIn, iFpiLiiipip) +GO(XIGrabKeycode, iFpiiLiiipip) +GO(XIGrabTouchBegin, iFpiLipip) +GO(XIListProperties, pFpip) GO(XIQueryDevice, pFpip) -GO(XIQueryPointer, iFpipppppppppp) +GO(XIQueryPointer, iFpiLppppppppp) GO(XIQueryVersion, iFppp) -GO(XISelectEvents, iFpppi) -GO(XISetClientPointer, iFppi) -//GO(XISetFocus, -GO(XIUndefineCursor, iFpip) -GO(XIUngrabButton, iFpiipip) +GO(XISelectEvents, iFpLpi) +GO(XISetClientPointer, iFpLi) +GO(XISetFocus, iFpiLL) +GO(XIUndefineCursor, iFpiL) +GO(XIUngrabButton, iFpiiLip) GO(XIUngrabDevice, iFpiL) -//GO(XIUngrabEnter, -//GO(XIUngrabFocusIn, -GO(XIUngrabKeycode, iFpiipip) -GO(XIUngrabTouchBegin, iFpipip) -GO(XIWarpPointer, iFpippddiidd) -//GO(XListDeviceProperties, +GO(XIUngrabEnter, iFpiLip) +GO(XIUngrabFocusIn, iFpiLip) +GO(XIUngrabKeycode, iFpiiLip) +GO(XIUngrabTouchBegin, iFpiLip) +GO(XIWarpPointer, iFpiLLdduudd) +GO(XListDeviceProperties, pFppp) GO(XListInputDevices, pFpp) -GO(XOpenDevice, pFpp) +GO(XOpenDevice, pFpL) GO(XQueryDeviceState, pFpp) -GO(XSelectExtensionEvent, iFpppi) -//GO(XSendExtensionEvent, +GO(XSelectExtensionEvent, iFpLpi) +GO(XSendExtensionEvent, iFppLiipp) GO(XSetDeviceButtonMapping, iFpppi) -//GO(XSetDeviceFocus, -//GO(XSetDeviceMode, -//GO(XSetDeviceModifierMapping, -//GO(XSetDeviceValuators, -GO(XUngrabDevice, iFppu) -//GO(XUngrabDeviceButton, -//GO(XUngrabDeviceKey, +GO(XSetDeviceFocus, iFppLiL) +GO(XSetDeviceMode, iFppi) +GO(XSetDeviceModifierMapping, iFppp) +GO(XSetDeviceValuators, iFpppii) +GO(XUngrabDevice, iFppL) +GO(XUngrabDeviceButton, iFppuupL) +GO(XUngrabDeviceKey, iFppuupL) GO(_XiGetDevicePresenceNotifyEvent, iFp) -//GO(_xibadclass, -//GO(_xibaddevice, -//GO(_xibadevent, -//GO(_xibadmode, -//GO(_xidevicebusy, +GO(_xibadclass, vFpp) +GO(_xibaddevice, vFpp) +GO(_xibadevent, vFpp) +GO(_xibadmode, vFpp) +GO(_xidevicebusy, vFpp) diff --git a/src/wrapped/wrappedlibxmu.c b/src/wrapped/wrappedlibxmu.c index f4229df..a520f92 100644 --- a/src/wrapped/wrappedlibxmu.c +++ b/src/wrapped/wrappedlibxmu.c @@ -11,18 +11,11 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* libxmuName = "libXmu.so"; -#else - const char* libxmuName = "libXmu.so.6"; -#endif +const char* libxmuName = "libXmu.so.6"; +#define ALTNAME "libXmu.so" #define LIBNAME libxmu -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so", "libXext.so" -#else #define NEEDED_LIBS "libX11.so.6", "libXext.so.6" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxpm.c b/src/wrapped/wrappedlibxpm.c index 418ee87..22fde5e 100644 --- a/src/wrapped/wrappedlibxpm.c +++ b/src/wrapped/wrappedlibxpm.c @@ -11,18 +11,11 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* libxpmName = "libXpm.so"; -#else - const char* libxpmName = "libXpm.so.4"; -#endif +const char* libxpmName = "libXpm.so.4"; +#define ALTNAME "libXpm.so" #define LIBNAME libxpm -#ifdef ANDROID - #define NEEDED_LIBS "libX11.so", "libXext.so" -#else - #define NEEDED_LIBS "libX11.so.6", "libXext.so.6" -#endif +#define NEEDED_LIBS "libX11.so.6", "libXext.so.6" #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxpresent.c b/src/wrapped/wrappedlibxpresent.c index 2a5ec87..a1ef31d 100644 --- a/src/wrapped/wrappedlibxpresent.c +++ b/src/wrapped/wrappedlibxpresent.c @@ -12,11 +12,8 @@ #include "x64emu.h" #include "debug.h" -#ifdef ANDROID - const char* libxpresentName = "libXpresent.so"; -#else - const char* libxpresentName = "libXpresent.so.1"; -#endif +const char* libxpresentName = "libXpresent.so.1"; +#define ALTNAME "libXpresent.so" #define LIBNAME libxpresent diff --git a/src/wrapped/wrappedlibxrandr.c b/src/wrapped/wrappedlibxrandr.c index eb8a418..4394449 100644 --- a/src/wrapped/wrappedlibxrandr.c +++ b/src/wrapped/wrappedlibxrandr.c @@ -17,18 +17,11 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxrandrName = "libXrandr.so"; -#else - const char* libxrandrName = "libXrandr.so.2"; -#endif +const char* libxrandrName = "libXrandr.so.2"; +#define ALTNAME "libXrandr.so" #define LIBNAME libxrandr -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so", "libXext.so", "libXrender.so" -#else #define NEEDED_LIBS "libX11.so.6", "libXext.so.6", "libXrender.so.1" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxrandr_private.h b/src/wrapped/wrappedlibxrandr_private.h index d71c628..7c671b7 100644 --- a/src/wrapped/wrappedlibxrandr_private.h +++ b/src/wrapped/wrappedlibxrandr_private.h @@ -1,73 +1,73 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -GO(XRRQueryVersion,iFppp) -GO(XRRFreeScreenConfigInfo,vFp) -GO(XRRGetCrtcInfo, pFppu) -GO(XRRListOutputProperties, pFpup) +GO(XRRQueryVersion, iFppp) +GO(XRRFreeScreenConfigInfo, vFp) +GO(XRRGetCrtcInfo, pFppL) +GO(XRRListOutputProperties, pFpLp) GO(XRRQueryExtension, iFppp) -//GO(XRRAllocModeInfo -//GO(XRRGetProviderProperty -//GO(XRRListProviderProperties -GO(XRRRotations,uFpip) -//GO(XRRSetCrtcTransform -GO(XRRGetCrtcGammaSize, iFpu) -GO(XRRConfigRotations,uFpp) -GO(XRRGetProviderInfo, pFppp) -//GO(XRRConfigureOutputProperty -//GO(XRRSetOutputPrimary +GO(XRRAllocModeInfo, pFpi) +GO(XRRGetProviderProperty, iFpLLlliiLppppp) +GO(XRRListProviderProperties, pFpLp) +GO(XRRRotations, WFpip) +GO(XRRSetCrtcTransform, vFpLpppi) +GO(XRRGetCrtcGammaSize, iFpL) +GO(XRRConfigRotations, WFpp) +GO(XRRGetProviderInfo, pFppL) +GO(XRRConfigureOutputProperty, vFpLLiiip) +GO(XRRSetOutputPrimary, vFpLL) GO(XRRFreeOutputInfo, vFp) -GO(XRRUpdateConfiguration,iFp) -GO(XRRGetScreenResources, pFpp) -GO(XRRConfigSizes,pFpp) -//GO(XRRQueryProviderProperty -//GO(XRRDeleteOutputProperty -//GO(XRRDeleteProviderProperty -GO(XRRSetScreenConfig,iFpppiuu) +GO(XRRUpdateConfiguration, iFp) +GO(XRRGetScreenResources, pFpL) +GO(XRRConfigSizes, pFpp) +GO(XRRQueryProviderProperty, pFpLL) +GO(XRRDeleteOutputProperty, vFpLL) +GO(XRRDeleteProviderProperty, vFpLL) +GO(XRRSetScreenConfig, iFppLiWL) GO(XRRAllocGamma, pFi) -GO(XRRSetScreenSize, vFppiiii) -GO(XRRSetScreenConfigAndRate,iFpppiuwu) +GO(XRRSetScreenSize, vFpLiiii) +GO(XRRSetScreenConfigAndRate, iFppLiWwL) GO(XRRFreeScreenResources, vFp) -GO(XRRGetOutputPrimary, uFpp) -//GO(XRRCreateMode -GO(XRRConfigCurrentRate,wFp) -//GO(XRRDestroyMode -GO(XRRSetCrtcConfig, iFppuuiiuupi) -GO(XRRConfigCurrentConfiguration,uFpp) -GO(XRRSizes,pFpip) -//GO(XRRAddOutputMode +GO(XRRGetOutputPrimary, LFpL) +GO(XRRCreateMode, LFpLp) +GO(XRRConfigCurrentRate, wFp) +GO(XRRDestroyMode, vFpL) +GO(XRRSetCrtcConfig, iFppLLiiLWpi) +GO(XRRConfigCurrentConfiguration, WFpp) +GO(XRRSizes, pFpip) +GO(XRRAddOutputMode, vFpLL) GO(XRRFreePanning, vFp) GO(XRRFreeProviderResources, vFp) -//GO(XRRChangeProviderProperty -GO(XRRGetPanning, pFppu) -//GO(XRRSetProviderOffloadSink -GO(XRRGetScreenResourcesCurrent, pFpp) -GO(XRRConfigTimes,uFpp) -GO(XRRSetCrtcGamma, vFppp) -//GO(XRRSetProviderOutputSource -GO(XRRGetScreenSizeRange, iFpppppp) -GO(XRRRates,pFpiip) +GO(XRRChangeProviderProperty, vFpLLLiipi) +GO(XRRGetPanning, pFppL) +GO(XRRSetProviderOffloadSink, iFpLL) +GO(XRRGetScreenResourcesCurrent, pFpL) +GO(XRRConfigTimes, LFpp) +GO(XRRSetCrtcGamma, vFpLp) +GO(XRRSetProviderOutputSource, iFpLL) +GO(XRRGetScreenSizeRange, iFpLpppp) +GO(XRRRates, pFpiip) GO(XRRFreeProviderInfo, vFp) -GO(XRRConfigRates,pFpip) -GO(XRRQueryOutputProperty, pFpup) -GO(XRRGetOutputProperty, iFpupiiiipppppp) +GO(XRRConfigRates, pFpip) +GO(XRRQueryOutputProperty, pFpLL) +GO(XRRGetOutputProperty, iFpLLlliiLppppp) GO(XRRFreeGamma, vFp) -GO(XRRRootToScreen,iFpp) -GO(XRRGetScreenInfo,pFpp) +GO(XRRRootToScreen, iFpL) +GO(XRRGetScreenInfo, pFpL) GO(XRRFreeCrtcInfo, vFp) -GO(XRRGetProviderResources, pFpp) -//GO(XRRFreeModeInfo -//GO(XRRChangeOutputProperty -GO(XRRGetCrtcGamma, pFpu) -GO(XRRSetPanning, pFppu) -GO(XRRSelectInput,vFppi) -GO(XRRGetCrtcTransform, iFppp) -GO(XRRTimes,uFpip) -//GO(XRRDeleteOutputMode -GO(XRRGetOutputInfo, pFppu) -//GO(XRRConfigureProviderProperty +GO(XRRGetProviderResources, pFpL) +GO(XRRFreeModeInfo, vFp) +GO(XRRChangeOutputProperty, vFpLLLiipi) +GO(XRRGetCrtcGamma, pFpL) +GO(XRRSetPanning, iFppLp) +GO(XRRSelectInput, vFpLi) +GO(XRRGetCrtcTransform, iFpLp) +GO(XRRTimes, LFpip) +GO(XRRDeleteOutputMode, vFpLL) +GO(XRRGetOutputInfo, pFppL) +GO(XRRConfigureProviderProperty, vFpLLiiip) GO(XRRAllocateMonitor, pFpi) -GO(XRRGetMonitors, pFppip) -GO(XRRSetMonitor, vFppp) -GO(XRRFreeMonitors, vFp) \ No newline at end of file +GO(XRRGetMonitors, pFpLip) +GO(XRRSetMonitor, vFpLp) +GO(XRRFreeMonitors, vFp) diff --git a/src/wrapped/wrappedlibxrender.c b/src/wrapped/wrappedlibxrender.c index 3c25b2d..4b92d24 100644 --- a/src/wrapped/wrappedlibxrender.c +++ b/src/wrapped/wrappedlibxrender.c @@ -11,18 +11,11 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* libxrenderName = "libXrender.so"; -#else - const char* libxrenderName = "libXrender.so.1"; -#endif +const char* libxrenderName = "libXrender.so.1"; +#define ALTNAME "libXrender.so" #define LIBNAME libxrender -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so" -#else #define NEEDED_LIBS "libX11.so.6" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxrender_private.h b/src/wrapped/wrappedlibxrender_private.h index 5c25670..1b913a4 100644 --- a/src/wrapped/wrappedlibxrender_private.h +++ b/src/wrapped/wrappedlibxrender_private.h @@ -1,51 +1,51 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif -GO(XRenderAddGlyphs, vFppppipi) -GO(XRenderAddTraps, vFppiipi) -GO(XRenderChangePicture, vFppLp) -GO(XRenderComposite, vFpipppiiiiiiuu) -GO(XRenderCompositeDoublePoly, vFpipppiiiipii) -GO(XRenderCompositeString16, vFpippppiiiipi) -GO(XRenderCompositeString32, vFpippppiiiipi) -GO(XRenderCompositeString8, vFpippppiiiipi) -GO(XRenderCompositeText16, vFpipppiiiipi) -GO(XRenderCompositeText32, vFpipppiiiipi) -GO(XRenderCompositeText8, vFpipppiiiipi) -GO(XRenderCompositeTrapezoids, vFpipppiipi) -GO(XRenderCompositeTriangles, vFpipppiipi) -GO(XRenderCompositeTriFan, vFpipppiipi) -GO(XRenderCompositeTriStrip, vFpipppiipi) -GO(XRenderCreateAnimCursor, pFpip) -GO(XRenderCreateConicalGradient, pFppppi) -GO(XRenderCreateCursor, pFppii) -GO(XRenderCreateGlyphSet, pFpp) -GO(XRenderCreateLinearGradient, pFppppi) -GO(XRenderCreatePicture, pFpppup) -GO(XRenderCreateRadialGradient, pFppppi) -GO(XRenderCreateSolidFill, pFpp) +GO(XRenderAddGlyphs, vFpLppipi) +GO(XRenderAddTraps, vFpLiipi) +GO(XRenderChangePicture, vFpLLp) +GO(XRenderComposite, vFpiLLLiiiiiiuu) +GO(XRenderCompositeDoublePoly, vFpiLLpiiiipii) +GO(XRenderCompositeString16, vFpiLLpLiiiipi) +GO(XRenderCompositeString32, vFpiLLpLiiiipi) +GO(XRenderCompositeString8, vFpiLLpLiiiipi) +GO(XRenderCompositeText16, vFpiLLpiiiipi) +GO(XRenderCompositeText32, vFpiLLpiiiipi) +GO(XRenderCompositeText8, vFpiLLpiiiipi) +GO(XRenderCompositeTrapezoids, vFpiLLpiipi) +GO(XRenderCompositeTriangles, vFpiLLpiipi) +GO(XRenderCompositeTriFan, vFpiLLpiipi) +GO(XRenderCompositeTriStrip, vFpiLLpiipi) +GO(XRenderCreateAnimCursor, LFpip) +GO(XRenderCreateConicalGradient, LFppppi) +GO(XRenderCreateCursor, LFpLuu) +GO(XRenderCreateGlyphSet, LFpp) +GO(XRenderCreateLinearGradient, LFppppi) +GO(XRenderCreatePicture, LFpLpLp) +GO(XRenderCreateRadialGradient, LFppppi) +GO(XRenderCreateSolidFill, LFpp) DATAB(XRenderExtensionInfo, sizeof(void*)) DATA(XRenderExtensionName, sizeof(void*)) //D -GO(XRenderFillRectangle, vFpippiiuu) -GO(XRenderFillRectangles, vFpipppi) +GO(XRenderFillRectangle, vFpiLpiiuu) +GO(XRenderFillRectangles, vFpiLppi) GO(XRenderFindDisplay, pFp) -GO(XRenderFindFormat, pFpupi) +GO(XRenderFindFormat, pFpLpi) GO(XRenderFindStandardFormat, pFpi) GO(XRenderFindVisualFormat, pFpp) -GO(XRenderFreeGlyphs, vFpppi) -GO(XRenderFreeGlyphSet, vFpp) -GO(XRenderFreePicture, vFpp) +GO(XRenderFreeGlyphs, vFpLpi) +GO(XRenderFreeGlyphSet, vFpL) +GO(XRenderFreePicture, vFpL) GO(XRenderParseColor, iFppp) GO(XRenderQueryExtension, iFppp) -GO(XRenderQueryFilters, pFpp) +GO(XRenderQueryFilters, pFpL) GO(XRenderQueryFormats, iFp) GO(XRenderQueryPictIndexValues, pFppp) GO(XRenderQuerySubpixelOrder, iFpi) GO(XRenderQueryVersion, iFppp) -GO(XRenderReferenceGlyphSet, pFpp) -GO(XRenderSetPictureClipRectangles, vFppiipi) -GO(XRenderSetPictureClipRegion, vFppp) -GO(XRenderSetPictureFilter, vFppppi) -GO(XRenderSetPictureTransform, vFppp) +GO(XRenderReferenceGlyphSet, LFpL) +GO(XRenderSetPictureClipRectangles, vFpLiipi) +GO(XRenderSetPictureClipRegion, vFpLp) +GO(XRenderSetPictureFilter, vFpLppi) +GO(XRenderSetPictureTransform, vFpLp) GO(XRenderSetSubpixelOrder, iFpii) diff --git a/src/wrapped/wrappedlibxss.c b/src/wrapped/wrappedlibxss.c index b635936..aea2d7d 100644 --- a/src/wrapped/wrappedlibxss.c +++ b/src/wrapped/wrappedlibxss.c @@ -11,18 +11,11 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* libxssName = "libXss.so"; -#else - const char* libxssName = "libXss.so.1"; -#endif +const char* libxssName = "libXss.so.1"; +#define ALTNAME "libXss.so" #define LIBNAME libxss -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so", "libXext.so" -#else #define NEEDED_LIBS "libX11.so.6", "libXext.so.6" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxss_private.h b/src/wrapped/wrappedlibxss_private.h index d345f04..62c0e9c 100644 --- a/src/wrapped/wrappedlibxss_private.h +++ b/src/wrapped/wrappedlibxss_private.h @@ -1,15 +1,15 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif GO(XScreenSaverAllocInfo, pFv) -GO(XScreenSaverGetRegistered, uFpipp) +GO(XScreenSaverGetRegistered, iFpipp) GO(XScreenSaverQueryExtension, iFppp) -GO(XScreenSaverQueryInfo, iFppp) +GO(XScreenSaverQueryInfo, iFpLp) GO(XScreenSaverQueryVersion, iFppp) -GO(XScreenSaverRegister, vFpiup) -GO(XScreenSaverSelectInput, vFppu) -GO(XScreenSaverSetAttributes, vFppiiuuuiupup) +GO(XScreenSaverRegister, iFpiLL) +GO(XScreenSaverSelectInput, vFpLL) +GO(XScreenSaverSetAttributes, vFpLiiuuuiupLp) //need GOM? GO(XScreenSaverSuspend, vFpi) GO(XScreenSaverUnregister, iFpi) -GO(XScreenSaverUnsetAttributes, vFpp) +GO(XScreenSaverUnsetAttributes, vFpL) diff --git a/src/wrapped/wrappedlibxt.c b/src/wrapped/wrappedlibxt.c index 382b03a..b89333c 100644 --- a/src/wrapped/wrappedlibxt.c +++ b/src/wrapped/wrappedlibxt.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxtName = "libXt.so"; -#else - const char* libxtName = "libXt.so.6"; -#endif +const char* libxtName = "libXt.so.6"; +#define ALTNAME "libXt.so" #define LIBNAME libxt @@ -219,10 +216,6 @@ EXPORT void my_XtAddRawEventHandler(x64emu_t* emu, void* w, uint32_t mask, int n my->XtAddRawEventHandler(w, mask, nonmaskable, findXtEventHandlerFct(f), data); } -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so", "libXext.so" -#else #define NEEDED_LIBS "libX11.so.6", "libXext.so.6" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxtst.c b/src/wrapped/wrappedlibxtst.c index ba71efe..bb226aa 100644 --- a/src/wrapped/wrappedlibxtst.c +++ b/src/wrapped/wrappedlibxtst.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxtstName = "libXtst.so"; -#else - const char* libxtstName = "libXtst.so.6"; -#endif +const char* libxtstName = "libXtst.so.6"; +#define ALTNAME "libXtst.so" #define LIBNAME libxtst @@ -71,10 +68,6 @@ EXPORT int my_XRecordEnableContext(x64emu_t* emu, void* display, void* context, return my->XRecordEnableContext(display, context, find_XRecordInterceptProc_Fct(cb), closure); } -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so", "libXext.so" -#else #define NEEDED_LIBS "libX11.so.6", "libXext.so.6" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxxf86vm.c b/src/wrapped/wrappedlibxxf86vm.c index 7292482..e19e95b 100644 --- a/src/wrapped/wrappedlibxxf86vm.c +++ b/src/wrapped/wrappedlibxxf86vm.c @@ -17,18 +17,11 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* libxxf86vmName = "libXxf86vm.so"; -#else - const char* libxxf86vmName = "libXxf86vm.so.1"; -#endif +const char* libxxf86vmName = "libXxf86vm.so.1"; +#define ALTNAME "libXxf86vm.so" #define LIBNAME libxxf86vm -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so", "libXext.so" -#else #define NEEDED_LIBS "libX11.so.6", "libXext.so.6" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedlibxxf86vm_private.h b/src/wrapped/wrappedlibxxf86vm_private.h index b418072..5dd5a76 100644 --- a/src/wrapped/wrappedlibxxf86vm_private.h +++ b/src/wrapped/wrappedlibxxf86vm_private.h @@ -1,5 +1,5 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(XF86VidModeGetViewPort, iFpipp) @@ -17,7 +17,7 @@ GO(XF86VidModeSetGammaRamp, iFpiippp) GO(XF86VidModeGetPermissions, iFpip) GO(XF86VidModeModModeLine, iFpip) GO(XF86VidModeSetViewPort, iFpiii) -GO(XF86VidModeSwitchMode, iFpip) +GO(XF86VidModeSwitchMode, iFpii) GO(XF86VidModeAddModeLine, iFpipp) GO(XF86VidModeSwitchToMode, iFpip) GO(XF86VidModeQueryExtension, iFppp) diff --git a/src/wrapped/wrappedlibz.c b/src/wrapped/wrappedlibz.c index 843ab95..d9a07d8 100644 --- a/src/wrapped/wrappedlibz.c +++ b/src/wrapped/wrappedlibz.c @@ -15,11 +15,8 @@ #include "emu/x64emu_private.h" #include "box64context.h" -#ifdef ANDROID - const char* libzName = "libz.so"; -#else - const char* libzName = "libz.so.1"; -#endif +const char* libzName = "libz.so.1"; +#define ALTNAME "libz.so" #define LIBNAME libz diff --git a/src/wrapped/wrappedlzma.c b/src/wrapped/wrappedlzma.c index 19f9ad9..e59e2ee 100644 --- a/src/wrapped/wrappedlzma.c +++ b/src/wrapped/wrappedlzma.c @@ -181,7 +181,6 @@ EXPORT int my_lzma_stream_encoder(x64emu_t* emu, lzma_stream_t* stream, void* fi return ret; } - EXPORT int my_lzma_easy_encoder(x64emu_t* emu, lzma_stream_t* stream, uint32_t precheck, uint32_t check) { wrap_alloc_struct(stream->allocator); @@ -238,6 +237,14 @@ EXPORT int my_lzma_stream_encoder_mt(x64emu_t* emu, lzma_stream_t* stream, void* return ret; } +EXPORT int my_lzma_stream_decoder_mt(x64emu_t* emu, lzma_stream_t* stream, void* options) +{ + wrap_alloc_struct(stream->allocator); + int ret = my->lzma_stream_decoder_mt(stream, options); + unwrap_alloc_struct(stream->allocator); + return ret; +} + EXPORT int my_lzma_code(x64emu_t* emu, lzma_stream_t* stream, int a) { wrap_alloc_struct(stream->allocator); diff --git a/src/wrapped/wrappedlzma_private.h b/src/wrapped/wrappedlzma_private.h index 6f8b476..32b29bf 100644 --- a/src/wrapped/wrappedlzma_private.h +++ b/src/wrapped/wrappedlzma_private.h @@ -68,8 +68,8 @@ GO(lzma_index_stream_padding, uFpL) //GO(lzma_index_total_size, GO(lzma_index_uncompressed_size, LFp) GO(lzma_lzma_preset, CFpu) -//GO(lzma_memlimit_get, -//GO(lzma_memlimit_set, +GO(lzma_memlimit_get, UFp) +GO(lzma_memlimit_set, iFpU) GO(lzma_memusage, UFp) GO(lzma_mf_is_supported, CFu) GO(lzma_mode_is_supported, CFu) @@ -89,6 +89,7 @@ GOM(lzma_stream_buffer_decode, iFEpupppLppL) GOM(lzma_stream_decoder, iFEpUi) GOM(lzma_stream_encoder, iFEppi) GOM(lzma_stream_encoder_mt, iFEpp) +GOM(lzma_stream_decoder_mt, iFEpp) GO(lzma_stream_encoder_mt_memusage, LFp) GO(lzma_stream_flags_compare, uFpp) GO(lzma_stream_footer_decode, uFpp) diff --git a/src/wrapped/wrappedmpg123.c b/src/wrapped/wrappedmpg123.c index 642c01f..1d06978 100644 --- a/src/wrapped/wrappedmpg123.c +++ b/src/wrapped/wrappedmpg123.c @@ -17,13 +17,9 @@ #include "box64context.h" #include "emu/x64emu_private.h" -const char* mpg123Name = -#ifdef ANDROID - "libmpg123.so" -#else - "libmpg123.so.0" -#endif - ; +const char* mpg123Name = "libmpg123.so.0"; +#define ALTNAME "libmpg123.so" + #define LIBNAME mpg123 #define ADDED_FUNCTIONS() \ diff --git a/src/wrapped/wrappednotify.c b/src/wrapped/wrappednotify.c index 1a5e0d8..967f372 100644 --- a/src/wrapped/wrappednotify.c +++ b/src/wrapped/wrappednotify.c @@ -23,9 +23,8 @@ const char* notifyName = "libnotify.so.4"; #define LIBNAME notify -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappednss3_private.h b/src/wrapped/wrappednss3_private.h index 6590765..6f2de09 100644 --- a/src/wrapped/wrappednss3_private.h +++ b/src/wrapped/wrappednss3_private.h @@ -203,7 +203,7 @@ GO(CERT_IsCACert, iFpp) GO(CERT_IsCADERCert, iFpp) GO(CERT_IsRootDERCert, iFp) //DATA(CERT_IssuerAndSNTemplate, -//GO(CERT_IsUserCert, +GO(CERT_IsUserCert, iFp) //GO(CERT_KeyFromDERCrl, GO(CERT_MakeCANickname, pFp) GO(CERT_MergeExtensions, iFpp) diff --git a/src/wrapped/wrappednvml.c b/src/wrapped/wrappednvml.c new file mode 100644 index 0000000..7008ba5 --- /dev/null +++ b/src/wrapped/wrappednvml.c @@ -0,0 +1,23 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" + +const char* nvmlName = "libnvidia-ml.so.1"; +#define ALTNAME "libnvidia-ml.so" + +#define LIBNAME nvml + +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappednvml_private.h b/src/wrapped/wrappednvml_private.h new file mode 100644 index 0000000..9686f2e --- /dev/null +++ b/src/wrapped/wrappednvml_private.h @@ -0,0 +1,407 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + + +GO(nvmlComputeInstanceDestroy, uFp) +//GO(nvmlComputeInstanceGetInfo, +GO(nvmlComputeInstanceGetInfo_v2, uFpp) +GO(nvmlDeviceClearAccountingPids, uFp) +GO(nvmlDeviceClearCpuAffinity, uFp) +GO(nvmlDeviceClearEccErrorCounts, uFpu) +GO(nvmlDeviceClearFieldValues, uFpip) +GO(nvmlDeviceCreateGpuInstance, uFpup) +GO(nvmlDeviceCreateGpuInstanceWithPlacement, uFpupp) +GO(nvmlDeviceDiscoverGpus, uFp) +GO(nvmlDeviceFreezeNvLinkUtilizationCounter, uFpuuu) +GO(nvmlDeviceGetAccountingBufferSize, uFpp) +GO(nvmlDeviceGetAccountingMode, uFpp) +GO(nvmlDeviceGetAccountingPids, uFppp) +GO(nvmlDeviceGetAccountingStats, uFpup) +GO(nvmlDeviceGetActiveVgpus, uFppp) +GO(nvmlDeviceGetAdaptiveClockInfoStatus, uFpp) +GO(nvmlDeviceGetAddressingMode, uFpp) +GO(nvmlDeviceGetAPIRestriction, uFpup) +GO(nvmlDeviceGetApplicationsClock, uFpup) +GO(nvmlDeviceGetArchitecture, uFpp) +//GO(nvmlDeviceGetAttributes, +GO(nvmlDeviceGetAttributes_v2, uFpp) +GO(nvmlDeviceGetAutoBoostedClocksEnabled, uFppp) +GO(nvmlDeviceGetBAR1MemoryInfo, uFpp) +GO(nvmlDeviceGetBoardId, uFpp) +GO(nvmlDeviceGetBoardPartNumber, uFppu) +GO(nvmlDeviceGetBrand, uFpp) +GO(nvmlDeviceGetBridgeChipInfo, uFpp) +GO(nvmlDeviceGetBusType, uFpp) +GO(nvmlDeviceGetC2cModeInfoV, uFpp) +GO(nvmlDeviceGetCapabilities, uFpp) +GO(nvmlDeviceGetClkMonStatus, uFpp) +GO(nvmlDeviceGetClock, uFpuup) +GO(nvmlDeviceGetClockInfo, uFpup) +GO(nvmlDeviceGetClockOffsets, uFpp) +GO(nvmlDeviceGetComputeInstanceId, uFpp) +GO(nvmlDeviceGetComputeMode, uFpp) +//GO(nvmlDeviceGetComputeRunningProcesses, +//GO(nvmlDeviceGetComputeRunningProcesses_v2, +GO(nvmlDeviceGetComputeRunningProcesses_v3, uFppp) +GO(nvmlDeviceGetConfComputeGpuAttestationReport, uFpp) +GO(nvmlDeviceGetConfComputeGpuCertificate, uFpp) +GO(nvmlDeviceGetConfComputeMemSizeInfo, uFpp) +GO(nvmlDeviceGetConfComputeProtectedMemoryUsage, uFpp) +GO(nvmlDeviceGetCoolerInfo, uFpp) +//GO(nvmlDeviceGetCount, +GO(nvmlDeviceGetCount_v2, uFp) +GO(nvmlDeviceGetCpuAffinity, uFpup) +GO(nvmlDeviceGetCpuAffinityWithinScope, uFpupu) +GO(nvmlDeviceGetCreatableVgpus, uFppp) +GO(nvmlDeviceGetCudaComputeCapability, uFppp) +GO(nvmlDeviceGetCurrentClockFreqs, uFpp) +GO(nvmlDeviceGetCurrentClocksEventReasons, uFpp) +GO(nvmlDeviceGetCurrentClocksThrottleReasons, uFpp) +GO(nvmlDeviceGetCurrPcieLinkGeneration, uFpp) +GO(nvmlDeviceGetCurrPcieLinkWidth, uFpp) +GO(nvmlDeviceGetDecoderUtilization, uFppp) +GO(nvmlDeviceGetDefaultApplicationsClock, uFpup) +GO(nvmlDeviceGetDefaultEccMode, uFpp) +GO(nvmlDeviceGetDetailedEccErrors, uFpuup) +GO(nvmlDeviceGetDeviceHandleFromMigDeviceHandle, uFpp) +GO(nvmlDeviceGetDisplayActive, uFpp) +GO(nvmlDeviceGetDisplayMode, uFpp) +GO(nvmlDeviceGetDramEncryptionMode, uFppp) +//GO(nvmlDeviceGetDriverModel, +GO(nvmlDeviceGetDriverModel_v2, uFppp) +GO(nvmlDeviceGetDynamicPstatesInfo, uFpp) +GO(nvmlDeviceGetEccMode, uFppp) +GO(nvmlDeviceGetEncoderCapacity, uFpup) +GO(nvmlDeviceGetEncoderSessions, uFppp) +GO(nvmlDeviceGetEncoderStats, uFpppp) +GO(nvmlDeviceGetEncoderUtilization, uFppp) +GO(nvmlDeviceGetEnforcedPowerLimit, uFpp) +GO(nvmlDeviceGetFanControlPolicy_v2, uFpup) +GO(nvmlDeviceGetFanSpeed, uFpp) +GO(nvmlDeviceGetFanSpeedRPM, uFpp) +GO(nvmlDeviceGetFanSpeed_v2, uFpup) +GO(nvmlDeviceGetFBCSessions, uFppp) +GO(nvmlDeviceGetFBCStats, uFpp) +GO(nvmlDeviceGetFieldValues, uFpip) +GO(nvmlDeviceGetGpcClkMinMaxVfOffset, uFppp) +GO(nvmlDeviceGetGpcClkVfOffset, uFpp) +GO(nvmlDeviceGetGpuFabricInfo, uFpp) +GO(nvmlDeviceGetGpuFabricInfoV, uFpp) +GO(nvmlDeviceGetGpuInstanceById, uFpup) +GO(nvmlDeviceGetGpuInstanceId, uFpp) +//GO(nvmlDeviceGetGpuInstancePossiblePlacements, +GO(nvmlDeviceGetGpuInstancePossiblePlacements_v2, uFpupp) +GO(nvmlDeviceGetGpuInstanceProfileInfo, uFpup) +GO(nvmlDeviceGetGpuInstanceProfileInfoByIdV, uFpup) +GO(nvmlDeviceGetGpuInstanceProfileInfoV, uFpup) +GO(nvmlDeviceGetGpuInstanceRemainingCapacity, uFpup) +GO(nvmlDeviceGetGpuInstances, uFpupp) +GO(nvmlDeviceGetGpuMaxPcieLinkGeneration, uFpp) +GO(nvmlDeviceGetGpuOperationMode, uFppp) +//GO(nvmlDeviceGetGraphicsRunningProcesses, +//GO(nvmlDeviceGetGraphicsRunningProcesses_v2, +GO(nvmlDeviceGetGraphicsRunningProcesses_v3, uFppp) +//GO(nvmlDeviceGetGridLicensableFeatures, +//GO(nvmlDeviceGetGridLicensableFeatures_v2, +//GO(nvmlDeviceGetGridLicensableFeatures_v3, +GO(nvmlDeviceGetGridLicensableFeatures_v4, uFpp) +GO(nvmlDeviceGetGspFirmwareMode, uFppp) +GO(nvmlDeviceGetGspFirmwareVersion, uFpp) +//GO(nvmlDeviceGetHandleByIndex, +GO(nvmlDeviceGetHandleByIndex_v2, uFup) +//GO(nvmlDeviceGetHandleByPciBusId, +GO(nvmlDeviceGetHandleByPciBusId_v2, uFpp) +GO(nvmlDeviceGetHandleBySerial, uFpp) +GO(nvmlDeviceGetHandleByUUID, uFpp) +GO(nvmlDeviceGetHandleByUUIDV, uFpp) +GO(nvmlDeviceGetHostname_v1, uFpp) +GO(nvmlDeviceGetHostVgpuMode, uFpp) +GO(nvmlDeviceGetIndex, uFpp) +GO(nvmlDeviceGetInforomConfigurationChecksum, uFpp) +GO(nvmlDeviceGetInforomImageVersion, uFppu) +GO(nvmlDeviceGetInforomVersion, uFpupu) +GO(nvmlDeviceGetIrqNum, uFpp) +GO(nvmlDeviceGetJpgUtilization, uFppp) +GO(nvmlDeviceGetLastBBXFlushTime, uFppp) +GO(nvmlDeviceGetMarginTemperature, uFpp) +GO(nvmlDeviceGetMaxClockInfo, uFpup) +GO(nvmlDeviceGetMaxCustomerBoostClock, uFpup) +GO(nvmlDeviceGetMaxMigDeviceCount, uFpp) +GO(nvmlDeviceGetMaxPcieLinkGeneration, uFpp) +GO(nvmlDeviceGetMaxPcieLinkWidth, uFpp) +GO(nvmlDeviceGetMemClkMinMaxVfOffset, uFppp) +GO(nvmlDeviceGetMemClkVfOffset, uFpp) +GO(nvmlDeviceGetMemoryAffinity, uFpupu) +GO(nvmlDeviceGetMemoryBusWidth, uFpp) +GO(nvmlDeviceGetMemoryErrorCounter, uFpuuup) +GO(nvmlDeviceGetMemoryInfo, uFpp) +GO(nvmlDeviceGetMemoryInfo_v2, uFpp) +GO(nvmlDeviceGetMigDeviceHandleByIndex, uFpup) +GO(nvmlDeviceGetMigMode, uFppp) +GO(nvmlDeviceGetMinMaxClockOfPState, uFpuupp) +GO(nvmlDeviceGetMinMaxFanSpeed, uFppp) +GO(nvmlDeviceGetMinorNumber, uFpp) +GO(nvmlDeviceGetModuleId, uFpp) +//GO(nvmlDeviceGetMPSComputeRunningProcesses, +//GO(nvmlDeviceGetMPSComputeRunningProcesses_v2, +GO(nvmlDeviceGetMPSComputeRunningProcesses_v3, uFppp) +GO(nvmlDeviceGetMultiGpuBoard, uFpp) +GO(nvmlDeviceGetName, uFppu) +GO(nvmlDeviceGetNumaNodeId, uFpp) +GO(nvmlDeviceGetNumFans, uFpp) +GO(nvmlDeviceGetNumGpuCores, uFpp) +GO(nvmlDeviceGetNvlinkBwMode, uFpp) +GO(nvmlDeviceGetNvLinkCapability, uFpuup) +GO(nvmlDeviceGetNvLinkErrorCounter, uFpuup) +GO(nvmlDeviceGetNvLinkInfo, uFpp) +GO(nvmlDeviceGetNvLinkRemoteDeviceType, uFpup) +//GO(nvmlDeviceGetNvLinkRemotePciInfo, +GO(nvmlDeviceGetNvLinkRemotePciInfo_v2, uFpup) +GO(nvmlDeviceGetNvLinkState, uFpup) +GO(nvmlDeviceGetNvlinkSupportedBwModes, uFpp) +GO(nvmlDeviceGetNvLinkUtilizationControl, uFpuup) +GO(nvmlDeviceGetNvLinkUtilizationCounter, uFpuupp) +GO(nvmlDeviceGetNvLinkVersion, uFpup) +GO(nvmlDeviceGetOfaUtilization, uFppp) +GO(nvmlDeviceGetP2PStatus, uFppup) +GO(nvmlDeviceGetPcieLinkMaxSpeed, uFpp) +GO(nvmlDeviceGetPcieReplayCounter, uFpp) +GO(nvmlDeviceGetPcieSpeed, uFpp) +GO(nvmlDeviceGetPcieThroughput, uFpup) +//GO(nvmlDeviceGetPciInfo, +GO(nvmlDeviceGetPciInfoExt, uFpp) +//GO(nvmlDeviceGetPciInfo_v2, +GO(nvmlDeviceGetPciInfo_v3, uFpp) +GO(nvmlDeviceGetPdi, uFpp) +GO(nvmlDeviceGetPerformanceModes, uFpp) +GO(nvmlDeviceGetPerformanceState, uFpp) +GO(nvmlDeviceGetPersistenceMode, uFpp) +GO(nvmlDeviceGetPgpuMetadataString, uFppp) +GO(nvmlDeviceGetPlatformInfo, uFpp) +GO(nvmlDeviceGetPowerManagementDefaultLimit, uFpp) +GO(nvmlDeviceGetPowerManagementLimit, uFpp) +GO(nvmlDeviceGetPowerManagementLimitConstraints, uFppp) +GO(nvmlDeviceGetPowerManagementMode, uFpp) +GO(nvmlDeviceGetPowerMizerMode_v1, uFpp) +GO(nvmlDeviceGetPowerSource, uFpp) +GO(nvmlDeviceGetPowerState, uFpp) +GO(nvmlDeviceGetPowerUsage, uFpp) +GO(nvmlDeviceGetProcessesUtilizationInfo, uFpp) +GO(nvmlDeviceGetProcessUtilization, uFpppU) +GO(nvmlDeviceGetRemappedRows, uFppppp) +GO(nvmlDeviceGetRepairStatus, uFpp) +GO(nvmlDeviceGetRetiredPages, uFpupp) +GO(nvmlDeviceGetRetiredPagesPendingStatus, uFpp) +GO(nvmlDeviceGetRetiredPages_v2, uFpuppp) +GO(nvmlDeviceGetRowRemapperHistogram, uFpp) +GO(nvmlDeviceGetRunningProcessDetailList, uFpp) +GO(nvmlDeviceGetSamples, uFpuUppp) +GO(nvmlDeviceGetSerial, uFppu) +GO(nvmlDeviceGetSramEccErrorStatus, uFpp) +GO(nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts, uFpp) +GO(nvmlDeviceGetSupportedClocksEventReasons, uFpp) +GO(nvmlDeviceGetSupportedClocksThrottleReasons, uFpp) +GO(nvmlDeviceGetSupportedEventTypes, uFpp) +GO(nvmlDeviceGetSupportedGraphicsClocks, uFpupp) +GO(nvmlDeviceGetSupportedMemoryClocks, uFppp) +GO(nvmlDeviceGetSupportedPerformanceStates, uFppu) +GO(nvmlDeviceGetSupportedVgpus, uFppp) +GO(nvmlDeviceGetTargetFanSpeed, uFpup) +GO(nvmlDeviceGetTemperature, uFpup) +GO(nvmlDeviceGetTemperatureThreshold, uFpup) +GO(nvmlDeviceGetTemperatureV, uFpp) +GO(nvmlDeviceGetThermalSettings, uFpup) +GO(nvmlDeviceGetTopologyCommonAncestor, uFppp) +GO(nvmlDeviceGetTopologyNearestGpus, uFpupp) +GO(nvmlDeviceGetTotalEccErrors, uFpuup) +GO(nvmlDeviceGetTotalEnergyConsumption, uFpp) +GO(nvmlDeviceGetUtilizationRates, uFpp) +GO(nvmlDeviceGetUUID, uFppu) +GO(nvmlDeviceGetVbiosVersion, uFppu) +GO(nvmlDeviceGetVgpuCapabilities, uFpup) +GO(nvmlDeviceGetVgpuHeterogeneousMode, uFpp) +GO(nvmlDeviceGetVgpuInstancesUtilizationInfo, uFpp) +GO(nvmlDeviceGetVgpuMetadata, uFppp) +GO(nvmlDeviceGetVgpuProcessesUtilizationInfo, uFpp) +GO(nvmlDeviceGetVgpuProcessUtilization, uFpUpp) +GO(nvmlDeviceGetVgpuSchedulerCapabilities, uFpp) +GO(nvmlDeviceGetVgpuSchedulerLog, uFpp) +GO(nvmlDeviceGetVgpuSchedulerState, uFpp) +GO(nvmlDeviceGetVgpuTypeCreatablePlacements, uFpup) +GO(nvmlDeviceGetVgpuTypeSupportedPlacements, uFpup) +GO(nvmlDeviceGetVgpuUtilization, uFpUppp) +GO(nvmlDeviceGetViolationStatus, uFpup) +GO(nvmlDeviceGetVirtualizationMode, uFpp) +GO(nvmlDeviceIsMigDeviceHandle, uFpp) +GO(nvmlDeviceModifyDrainState, uFpu) +GO(nvmlDeviceOnSameBoard, uFppp) +GO(nvmlDevicePowerSmoothingActivatePresetProfile, uFpp) +GO(nvmlDevicePowerSmoothingSetState, uFpp) +GO(nvmlDevicePowerSmoothingUpdatePresetProfileParam, uFpp) +GO(nvmlDeviceQueryDrainState, uFpp) +GO(nvmlDeviceReadPRMCounters_v1, uFpp) +GO(nvmlDeviceReadWritePRM_v1, uFpp) +GO(nvmlDeviceRegisterEvents, uFpUp) +//GO(nvmlDeviceRemoveGpu, +GO(nvmlDeviceRemoveGpu_v2, uFpuu) +GO(nvmlDeviceResetApplicationsClocks, uFp) +GO(nvmlDeviceResetGpuLockedClocks, uFp) +GO(nvmlDeviceResetMemoryLockedClocks, uFp) +GO(nvmlDeviceResetNvLinkErrorCounters, uFpu) +GO(nvmlDeviceResetNvLinkUtilizationCounter, uFpuu) +GO(nvmlDeviceSetAccountingMode, uFpu) +GO(nvmlDeviceSetAPIRestriction, uFpuu) +GO(nvmlDeviceSetApplicationsClocks, uFpuu) +GO(nvmlDeviceSetAutoBoostedClocksEnabled, uFpu) +GO(nvmlDeviceSetClockOffsets, uFpp) +GO(nvmlDeviceSetComputeMode, uFpu) +GO(nvmlDeviceSetConfComputeUnprotectedMemSize, uFpU) +GO(nvmlDeviceSetCpuAffinity, uFp) +GO(nvmlDeviceSetDefaultAutoBoostedClocksEnabled, uFpuu) +GO(nvmlDeviceSetDefaultFanSpeed_v2, uFpu) +GO(nvmlDeviceSetDramEncryptionMode, uFpp) +GO(nvmlDeviceSetDriverModel, uFpuu) +GO(nvmlDeviceSetEccMode, uFpu) +GO(nvmlDeviceSetFanControlPolicy, uFpuu) +GO(nvmlDeviceSetFanSpeed_v2, uFpuu) +GO(nvmlDeviceSetGpcClkVfOffset, uFpi) +GO(nvmlDeviceSetGpuLockedClocks, uFpuu) +GO(nvmlDeviceSetGpuOperationMode, uFpu) +GO(nvmlDeviceSetHostname_v1, uFpp) +GO(nvmlDeviceSetMemClkVfOffset, uFpi) +GO(nvmlDeviceSetMemoryLockedClocks, uFpuu) +GO(nvmlDeviceSetMigMode, uFpup) +GO(nvmlDeviceSetNvlinkBwMode, uFpp) +GO(nvmlDeviceSetNvLinkDeviceLowPowerThreshold, uFpp) +GO(nvmlDeviceSetNvLinkUtilizationControl, uFpuupu) +GO(nvmlDeviceSetPersistenceMode, uFpu) +GO(nvmlDeviceSetPowerManagementLimit, uFpu) +GO(nvmlDeviceSetPowerManagementLimit_v2, uFpp) +GO(nvmlDeviceSetPowerMizerMode_v1, uFpp) +GO(nvmlDeviceSetTemperatureThreshold, uFpup) +GO(nvmlDeviceSetVgpuCapabilities, uFpuu) +GO(nvmlDeviceSetVgpuHeterogeneousMode, uFpp) +GO(nvmlDeviceSetVgpuSchedulerState, uFpp) +GO(nvmlDeviceSetVirtualizationMode, uFpu) +GO(nvmlDeviceValidateInforom, uFp) +GO(nvmlDeviceWorkloadPowerProfileClearRequestedProfiles, uFpp) +GO(nvmlDeviceWorkloadPowerProfileGetCurrentProfiles, uFpp) +GO(nvmlDeviceWorkloadPowerProfileGetProfilesInfo, uFpp) +GO(nvmlDeviceWorkloadPowerProfileSetRequestedProfiles, uFpp) +GO(nvmlErrorString, pFu) +GO(nvmlEventSetCreate, uFp) +GO(nvmlEventSetFree, uFp) +//GO(nvmlEventSetWait, +GO(nvmlEventSetWait_v2, uFppu) +//GO(nvmlGetBlacklistDeviceCount, +//GO(nvmlGetBlacklistDeviceInfoByIndex, +GO(nvmlGetExcludedDeviceCount, uFp) +GO(nvmlGetExcludedDeviceInfoByIndex, uFup) +GO(nvmlGetVgpuCompatibility, uFppp) +GO(nvmlGetVgpuDriverCapabilities, uFup) +GO(nvmlGetVgpuVersion, uFpp) +GO(nvmlGpmMetricsGet, uFp) +GO(nvmlGpmMigSampleGet, uFpup) +GO(nvmlGpmQueryDeviceSupport, uFpp) +GO(nvmlGpmQueryIfStreamingEnabled, uFpp) +GO(nvmlGpmSampleAlloc, uFp) +GO(nvmlGpmSampleFree, uFp) +GO(nvmlGpmSampleGet, uFpp) +GO(nvmlGpmSetStreamingEnabled, uFpu) +GO(nvmlGpuInstanceCreateComputeInstance, uFpup) +GO(nvmlGpuInstanceCreateComputeInstanceWithPlacement, uFpupp) +GO(nvmlGpuInstanceDestroy, uFp) +GO(nvmlGpuInstanceGetActiveVgpus, uFpp) +GO(nvmlGpuInstanceGetComputeInstanceById, uFpup) +GO(nvmlGpuInstanceGetComputeInstancePossiblePlacements, uFpupp) +GO(nvmlGpuInstanceGetComputeInstanceProfileInfo, uFpuup) +GO(nvmlGpuInstanceGetComputeInstanceProfileInfoV, uFpuup) +GO(nvmlGpuInstanceGetComputeInstanceRemainingCapacity, uFpup) +GO(nvmlGpuInstanceGetComputeInstances, uFpupp) +GO(nvmlGpuInstanceGetCreatableVgpus, uFpp) +GO(nvmlGpuInstanceGetInfo, uFpp) +GO(nvmlGpuInstanceGetVgpuHeterogeneousMode, uFpp) +GO(nvmlGpuInstanceGetVgpuSchedulerLog, uFpp) +GO(nvmlGpuInstanceGetVgpuSchedulerState, uFpp) +GO(nvmlGpuInstanceGetVgpuTypeCreatablePlacements, uFpp) +GO(nvmlGpuInstanceSetVgpuHeterogeneousMode, uFpp) +GO(nvmlGpuInstanceSetVgpuSchedulerState, uFpp) +//GO(nvmlInit, +GO(nvmlInit_v2, uFv) +GO(nvmlInitWithFlags, uFu) +//GO(nvmlInternalGetExportTable, +GO(nvmlSetVgpuVersion, uFp) +GO(nvmlShutdown, uFv) +GO(nvmlSystemEventSetCreate, uFp) +GO(nvmlSystemEventSetFree, uFp) +GO(nvmlSystemEventSetWait, uFp) +GO(nvmlSystemGetConfComputeCapabilities, uFp) +GO(nvmlSystemGetConfComputeGpusReadyState, uFp) +GO(nvmlSystemGetConfComputeKeyRotationThresholdInfo, uFp) +GO(nvmlSystemGetConfComputeSettings, uFp) +GO(nvmlSystemGetConfComputeState, uFp) +GO(nvmlSystemGetCudaDriverVersion, uFp) +GO(nvmlSystemGetCudaDriverVersion_v2, uFp) +GO(nvmlSystemGetDriverBranch, uFpu) +GO(nvmlSystemGetDriverVersion, uFpu) +GO(nvmlSystemGetHicVersion, uFpp) +GO(nvmlSystemGetNvlinkBwMode, uFp) +GO(nvmlSystemGetNVMLVersion, uFpu) +GO(nvmlSystemGetProcessName, uFupu) +GO(nvmlSystemGetTopologyGpuSet, uFupp) +GO(nvmlSystemRegisterEvents, uFp) +GO(nvmlSystemSetConfComputeGpusReadyState, uFu) +GO(nvmlSystemSetConfComputeKeyRotationThresholdInfo, uFp) +GO(nvmlSystemSetNvlinkBwMode, uFu) +GO(nvmlUnitGetCount, uFp) +GO(nvmlUnitGetDevices, uFppp) +GO(nvmlUnitGetFanSpeedInfo, uFpp) +GO(nvmlUnitGetHandleByIndex, uFup) +GO(nvmlUnitGetLedState, uFpp) +GO(nvmlUnitGetPsuInfo, uFpp) +GO(nvmlUnitGetTemperature, uFpup) +GO(nvmlUnitGetUnitInfo, uFpp) +GO(nvmlUnitSetLedState, uFpu) +GO(nvmlVgpuInstanceClearAccountingPids, uFu) +GO(nvmlVgpuInstanceGetAccountingMode, uFup) +GO(nvmlVgpuInstanceGetAccountingPids, uFupp) +GO(nvmlVgpuInstanceGetAccountingStats, uFuup) +GO(nvmlVgpuInstanceGetEccMode, uFup) +GO(nvmlVgpuInstanceGetEncoderCapacity, uFup) +GO(nvmlVgpuInstanceGetEncoderSessions, uFupp) +GO(nvmlVgpuInstanceGetEncoderStats, uFuppp) +GO(nvmlVgpuInstanceGetFBCSessions, uFupp) +GO(nvmlVgpuInstanceGetFBCStats, uFup) +GO(nvmlVgpuInstanceGetFbUsage, uFup) +GO(nvmlVgpuInstanceGetFrameRateLimit, uFup) +GO(nvmlVgpuInstanceGetGpuInstanceId, uFup) +GO(nvmlVgpuInstanceGetGpuPciId, uFupp) +//GO(nvmlVgpuInstanceGetLicenseInfo, +GO(nvmlVgpuInstanceGetLicenseInfo_v2, uFup) +GO(nvmlVgpuInstanceGetLicenseStatus, uFup) +GO(nvmlVgpuInstanceGetMdevUUID, uFupu) +GO(nvmlVgpuInstanceGetMetadata, uFupp) +GO(nvmlVgpuInstanceGetPlacementId, uFup) +GO(nvmlVgpuInstanceGetRuntimeStateSize, uFup) +GO(nvmlVgpuInstanceGetType, uFup) +GO(nvmlVgpuInstanceGetUUID, uFupu) +GO(nvmlVgpuInstanceGetVmDriverVersion, uFupu) +GO(nvmlVgpuInstanceGetVmID, uFupup) +GO(nvmlVgpuInstanceSetEncoderCapacity, uFuu) +GO(nvmlVgpuTypeGetBAR1Info, uFup) +GO(nvmlVgpuTypeGetCapabilities, uFuup) +GO(nvmlVgpuTypeGetClass, uFupp) +GO(nvmlVgpuTypeGetDeviceID, uFupp) +GO(nvmlVgpuTypeGetFbReservation, uFup) +GO(nvmlVgpuTypeGetFramebufferSize, uFup) +GO(nvmlVgpuTypeGetFrameRateLimit, uFup) +GO(nvmlVgpuTypeGetGpuInstanceProfileId, uFup) +GO(nvmlVgpuTypeGetGspHeapSize, uFup) +GO(nvmlVgpuTypeGetLicense, uFupu) +GO(nvmlVgpuTypeGetMaxInstances, uFpup) +GO(nvmlVgpuTypeGetMaxInstancesPerGpuInstance, uFp) +GO(nvmlVgpuTypeGetMaxInstancesPerVm, uFup) +GO(nvmlVgpuTypeGetName, uFupp) +GO(nvmlVgpuTypeGetNumDisplayHeads, uFup) +GO(nvmlVgpuTypeGetResolution, uFuupp) diff --git a/src/wrapped/wrappedopenal.c b/src/wrapped/wrappedopenal.c index 75695c6..c1fcd0a 100644 --- a/src/wrapped/wrappedopenal.c +++ b/src/wrapped/wrappedopenal.c @@ -63,9 +63,7 @@ void my_alRequestFoldbackStop(x64emu_t* emu); #include "wrappedlib_init.h" - - -void fillALProcWrapper() +void fillALProcWrapper(box64context_t* context) { int cnt, ret; khint_t k; @@ -84,7 +82,7 @@ void fillALProcWrapper() kh_value(symbolmap, k).w = openalmysymbolmap[i].w; kh_value(symbolmap, k).resolved = 0; } - my_context->alwrappers = symbolmap; + context->alwrappers = symbolmap; // fill my_* map symbolmap = kh_init(symbolmap); cnt = sizeof(MAPNAME(mysymbolmap))/sizeof(map_onesymbol_t); @@ -93,7 +91,7 @@ void fillALProcWrapper() kh_value(symbolmap, k).w = openalmysymbolmap[i].w; kh_value(symbolmap, k).resolved = 0; } - my_context->almymap = symbolmap; + context->almymap = symbolmap; } void freeALProcWrapper(box64context_t* context) { @@ -149,7 +147,7 @@ EXPORT void* my_alcGetProcAddress(x64emu_t* emu, void* device, void* name) const char* rname = (const char*)name; printf_log(LOG_DEBUG, "Calling alcGetProcAddress(%p, %s)\n", device, rname); if(!emu->context->alwrappers) // could be moved in "my" structure... - fillALProcWrapper(); + fillALProcWrapper(emu->context); // get proc adress using actual alGetProcAddress k = kh_get(symbolmap, emu->context->almymap, rname); int is_my = (k==kh_end(emu->context->almymap))?0:1; diff --git a/src/wrapped/wrappedopenal_private.h b/src/wrapped/wrappedopenal_private.h index b0749c1..60aa4c0 100644 --- a/src/wrapped/wrappedopenal_private.h +++ b/src/wrapped/wrappedopenal_private.h @@ -2,166 +2,166 @@ #error Meh... #endif -GO(alDopplerFactor,vFf) -GO(alDopplerVelocity,vFf) -GO(alSpeedOfSound,vFf) -GO(alDistanceModel,vFi) -GO(alEnable,vFi) -GO(alDisable,vFi) -GO(alIsEnabled,cFi) -GO(alGetString,pFi) -GO(alGetBooleanv,vFip) -GO(alGetIntegerv,vFip) -GO(alGetFloatv,vFip) -GO(alGetDoublev,vFip) -GO(alGetBoolean, CFi) -GO(alGetInteger,iFi) -GO(alGetFloat,fFi) -GO(alGetDouble,dFi) -GO(alGetError,iFv) -GO(alIsExtensionPresent, CFp) -GOM(alGetProcAddress,pFEp) -GO(alGetEnumValue,iFp) -GO(alListenerf,vFif) -GO(alListener3f,vFifff) -GO(alListenerfv,vFip) -GO(alListeneri,vFii) -GO(alListener3i,vFiiii) -GO(alListeneriv,vFip) -GO(alGetListenerf,vFip) -GO(alGetListener3f,vFippp) -GO(alGetListenerfv,vFip) -GO(alGetListeneri,vFip) -GO(alGetListener3i,vFippp) -GO(alGetListeneriv,vFip) -GO(alGenSources,vFip) -GO(alDeleteSources,vFip) -GO(alIsSource,cFu) -GO(alSourcef,vFuif) -GO(alSource3f,vFuifff) -GO(alSourcefv,vFuip) -GO(alSourcei,vFuii) -GO(alSource3i,vFuiiii) -GO(alSourceiv,vFuip) -GO(alGetSourcef,vFuip) -GO(alGetSource3f,vFuippp) -GO(alGetSourcefv,vFuip) -GO(alGetSourcei,vFuip) -GO(alGetSource3i,vFuippp) -GO(alGetSourceiv,vFuip) -GO(alSourcePlayv,vFip) -GO(alSourceStopv,vFip) -GO(alSourceRewindv,vFip) -GO(alSourcePausev,vFip) -GO(alSourcePlay,vFu) -GO(alSourceStop,vFu) -GO(alSourceRewind,vFu) -GO(alSourcePause,vFu) -GO(alSourceQueueBuffers,vFuip) -GO(alSourceUnqueueBuffers,vFuip) -GO(alGenBuffers,vFip) -GO(alDeleteBuffers,vFip) -GO(alIsBuffer, CFu) -GO(alBufferData,vFuipii) -GO(alBufferf,vFuif) -GO(alBuffer3f,vFuifff) -GO(alBufferfv,vFuip) -GO(alBufferi,vFuii) -GO(alBuffer3i,vFuiiii) -GO(alBufferiv,vFuip) -GO(alGetBufferf,vFuip) -GO(alGetBuffer3f,vFuippp) -GO(alGetBufferfv,vFuip) -GO(alGetBufferi,vFuip) -GO(alGetBuffer3i,vFuippp) -GO(alGetBufferiv,vFuip) +GO(alDopplerFactor, vFf) +GO(alDopplerVelocity, vFf) +GO(alSpeedOfSound, vFf) +GO(alDistanceModel, vFi) +GO(alEnable, vFi) +GO(alDisable, vFi) +GO(alIsEnabled, cFi) +GO(alGetString, pFi) +GO(alGetBooleanv, vFip) +GO(alGetIntegerv, vFip) +GO(alGetFloatv, vFip) +GO(alGetDoublev, vFip) +GO(alGetBoolean, cFi) +GO(alGetInteger, iFi) +GO(alGetFloat, fFi) +GO(alGetDouble, dFi) +GO(alGetError, iFv) +GO(alIsExtensionPresent, cFp) +GOM(alGetProcAddress, pFEp) +GO(alGetEnumValue, iFp) +GO(alListenerf, vFif) +GO(alListener3f, vFifff) +GO(alListenerfv, vFip) +GO(alListeneri, vFii) +GO(alListener3i, vFiiii) +GO(alListeneriv, vFip) +GO(alGetListenerf, vFip) +GO(alGetListener3f, vFippp) +GO(alGetListenerfv, vFip) +GO(alGetListeneri, vFip) +GO(alGetListener3i, vFippp) +GO(alGetListeneriv, vFip) +GO(alGenSources, vFip) +GO(alDeleteSources, vFip) +GO(alIsSource, cFu) +GO(alSourcef, vFuif) +GO(alSource3f, vFuifff) +GO(alSourcefv, vFuip) +GO(alSourcei, vFuii) +GO(alSource3i, vFuiiii) +GO(alSourceiv, vFuip) +GO(alGetSourcef, vFuip) +GO(alGetSource3f, vFuippp) +GO(alGetSourcefv, vFuip) +GO(alGetSourcei, vFuip) +GO(alGetSource3i, vFuippp) +GO(alGetSourceiv, vFuip) +GO(alSourcePlayv, vFip) +GO(alSourceStopv, vFip) +GO(alSourceRewindv, vFip) +GO(alSourcePausev, vFip) +GO(alSourcePlay, vFu) +GO(alSourceStop, vFu) +GO(alSourceRewind, vFu) +GO(alSourcePause, vFu) +GO(alSourceQueueBuffers, vFuip) +GO(alSourceUnqueueBuffers, vFuip) +GO(alGenBuffers, vFip) +GO(alDeleteBuffers, vFip) +GO(alIsBuffer, cFu) +GO(alBufferData, vFuipii) +GO(alBufferf, vFuif) +GO(alBuffer3f, vFuifff) +GO(alBufferfv, vFuip) +GO(alBufferi, vFuii) +GO(alBuffer3i, vFuiiii) +GO(alBufferiv, vFuip) +GO(alGetBufferf, vFuip) +GO(alGetBuffer3f, vFuippp) +GO(alGetBufferfv, vFuip) +GO(alGetBufferi, vFuip) +GO(alGetBuffer3i, vFuippp) +GO(alGetBufferiv, vFuip) -GO(alcCreateContext,pFpp) -GO(alcMakeContextCurrent, CFp) -GO(alcProcessContext,vFp) -GO(alcSuspendContext,vFp) -GO(alcDestroyContext,vFp) -GO(alcGetCurrentContext,pFv) -GO(alcGetContextsDevice,pFp) -GO(alcOpenDevice,pFp) -GO(alcCloseDevice,iFp) -GO(alcGetError,iFp) -GO(alcIsExtensionPresent, CFpp) -GOM(alcGetProcAddress,pFEpp) -GO(alcGetEnumValue,iFpp) -GO(alcGetString,pFpi) -GO(alcGetIntegerv,vFpiip) -GO(alcCaptureOpenDevice,pFpuii) -GO(alcCaptureCloseDevice, CFp) -GO(alcCaptureStart,vFp) -GO(alcCaptureStop,vFp) -GO(alcCaptureSamples,vFppi) +GO(alcCreateContext, pFpp) +GO(alcMakeContextCurrent, cFp) +GO(alcProcessContext, vFp) +GO(alcSuspendContext, vFp) +GO(alcDestroyContext, vFp) +GO(alcGetCurrentContext, pFv) +GO(alcGetContextsDevice, pFp) +GO(alcOpenDevice, pFp) +GO(alcCloseDevice, cFp) +GO(alcGetError, iFp) +GO(alcIsExtensionPresent, cFpp) +GOM(alcGetProcAddress, pFEpp) +GO(alcGetEnumValue, iFpp) +GO(alcGetString, pFpi) +GO(alcGetIntegerv, vFpiip) +GO(alcCaptureOpenDevice, pFpuii) +GO(alcCaptureCloseDevice, cFp) +GO(alcCaptureStart, vFp) +GO(alcCaptureStop, vFp) +GO(alcCaptureSamples, vFppi) GO(alcGetThreadContext, pFv) -GO(alcSetThreadContext, CFp) +GO(alcSetThreadContext, cFp) GO(alcLoopbackOpenDeviceSOFT, pFp) -GO(alcIsRenderFormatSupportedSOFT, CFpiii) +GO(alcIsRenderFormatSupportedSOFT, cFpiii) GO(alcRenderSamplesSOFT, vFppi) GO(alcDevicePauseSOFT, vFp) GO(alcDeviceResumeSOFT, vFp) GO(alcGetStringiSOFT, pFpii) -GO(alcResetDeviceSOFT, CFpp) +GO(alcResetDeviceSOFT, cFpp) GO(alcGetInteger64vSOFT, vFpiip) -GO(alBufferDataStatic,vFiipii) -GO(alBufferSubDataSOFT,vFuipii) -GOM(alRequestFoldbackStart,vFEiiipp) -GOM(alRequestFoldbackStop,vFEv) -GO(alBufferSamplesSOFT,vFuuiiiip) -GO(alBufferSubSamplesSOFT,vFuiiiip) -GO(alGetBufferSamplesSOFT,vFuiiiip) -GO(alIsBufferFormatSupportedSOFT, CFi) -GO(alSourcedSOFT,vFuid) -GO(alSource3dSOFT,vFuiddd) -GO(alSourcedvSOFT,vFuip) -GO(alGetSourcedSOFT,vFuip) -GO(alGetSource3dSOFT,vFuippp) -GO(alGetSourcedvSOFT,vFuip) -GO(alSourcei64SOFT, vFuil) -GO(alSource3i64SOFT, vFuilll) -GO(alSourcei64vSOFT,vFuip) -GO(alGetSourcei64SOFT,vFuip) -GO(alGetSource3i64SOFT,vFuippp) -GO(alGetSourcei64vSOFT,vFuip) -GO(alDeferUpdatesSOFT,vFv) -GO(alProcessUpdatesSOFT,vFv) -GO(alGetStringiSOFT,pFii) +GO(alBufferDataStatic, vFuipii) +GO(alBufferSubDataSOFT, vFuipii) +GOM(alRequestFoldbackStart, vFEiiipp) +GOM(alRequestFoldbackStop, vFEv) +GO(alBufferSamplesSOFT, vFuuiiiip) +GO(alBufferSubSamplesSOFT, vFuiiiip) +GO(alGetBufferSamplesSOFT, vFuiiiip) +GO(alIsBufferFormatSupportedSOFT, cFi) +GO(alSourcedSOFT, vFuid) +GO(alSource3dSOFT, vFuiddd) +GO(alSourcedvSOFT, vFuip) +GO(alGetSourcedSOFT, vFuip) +GO(alGetSource3dSOFT, vFuippp) +GO(alGetSourcedvSOFT, vFuip) +GO(alSourcei64SOFT, vFuiI) +GO(alSource3i64SOFT, vFuiIII) +GO(alSourcei64vSOFT, vFuip) +GO(alGetSourcei64SOFT, vFuip) +GO(alGetSource3i64SOFT, vFuippp) +GO(alGetSourcei64vSOFT, vFuip) +GO(alDeferUpdatesSOFT, vFv) +GO(alProcessUpdatesSOFT, vFv) +GO(alGetStringiSOFT, pFii) -GO(alGenEffects,vFip) -GO(alDeleteEffects,vFip) -GO(alIsEffect,cFu) -GO(alEffecti,vFuii) -GO(alEffectiv,vFuip) -GO(alEffectf,vFuif) -GO(alEffectfv,vFuip) -GO(alGetEffecti,vFuip) -GO(alGetEffectiv,vFuip) -GO(alGetEffectf,vFuip) -GO(alGetEffectfv,vFuip) -GO(alGenFilters,vFip) -GO(alDeleteFilters,vFip) -GO(alIsFilter,cFu) -GO(alFilteri,vFuii) -GO(alFilteriv,vFuip) -GO(alFilterf,vFuif) -GO(alFilterfv,vFuip) -GO(alGetFilteri,vFuip) -GO(alGetFilteriv,vFuip) -GO(alGetFilterf,vFuip) -GO(alGetFilterfv,vFuip) -GO(alGenAuxiliaryEffectSlots,vFip) -GO(alDeleteAuxiliaryEffectSlots,vFip) -GO(alIsAuxiliaryEffectSlot, CFu) -GO(alAuxiliaryEffectSloti,vFuii) -GO(alAuxiliaryEffectSlotiv,vFuip) -GO(alAuxiliaryEffectSlotf,vFuif) -GO(alAuxiliaryEffectSlotfv,vFuip) -GO(alGetAuxiliaryEffectSloti,vFuip) -GO(alGetAuxiliaryEffectSlotiv,vFuip) -GO(alGetAuxiliaryEffectSlotf,vFuip) -GO(alGetAuxiliaryEffectSlotfv,vFuip) +GO(alGenEffects, vFip) +GO(alDeleteEffects, vFip) +GO(alIsEffect, cFu) +GO(alEffecti, vFuii) +GO(alEffectiv, vFuip) +GO(alEffectf, vFuif) +GO(alEffectfv, vFuip) +GO(alGetEffecti, vFuip) +GO(alGetEffectiv, vFuip) +GO(alGetEffectf, vFuip) +GO(alGetEffectfv, vFuip) +GO(alGenFilters, vFip) +GO(alDeleteFilters, vFip) +GO(alIsFilter, cFu) +GO(alFilteri, vFuii) +GO(alFilteriv, vFuip) +GO(alFilterf, vFuif) +GO(alFilterfv, vFuip) +GO(alGetFilteri, vFuip) +GO(alGetFilteriv, vFuip) +GO(alGetFilterf, vFuip) +GO(alGetFilterfv, vFuip) +GO(alGenAuxiliaryEffectSlots, vFip) +GO(alDeleteAuxiliaryEffectSlots, vFip) +GO(alIsAuxiliaryEffectSlot, cFu) +GO(alAuxiliaryEffectSloti, vFuii) +GO(alAuxiliaryEffectSlotiv, vFuip) +GO(alAuxiliaryEffectSlotf, vFuif) +GO(alAuxiliaryEffectSlotfv, vFuip) +GO(alGetAuxiliaryEffectSloti, vFuip) +GO(alGetAuxiliaryEffectSlotiv, vFuip) +GO(alGetAuxiliaryEffectSlotf, vFuip) +GO(alGetAuxiliaryEffectSlotfv, vFuip) diff --git a/src/wrapped/wrappedopencl.c b/src/wrapped/wrappedopencl.c index 9ac1fd7..b3f0e58 100644 --- a/src/wrapped/wrappedopencl.c +++ b/src/wrapped/wrappedopencl.c @@ -19,6 +19,7 @@ const char* openclName = "libOpenCL.so.1"; #define LIBNAME opencl +#define ALTNAME "libOpenCL.so" #include "generated/wrappedopencltypes.h" @@ -75,6 +76,50 @@ static void* find_notity_context_Fct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for opencl notity_context callback\n"); return NULL; } +// notity_event ... +#define GO(A) \ +static uintptr_t my_notity_event_fct_##A = 0; \ +static void my_notity_event_##A(void* a, int b, void* c) \ +{ \ + RunFunctionFmt(my_notity_event_fct_##A, "pip", a, b, c); \ +} +SUPER() +#undef GO +static void* find_notity_event_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_notity_event_fct_##A == (uintptr_t)fct) return my_notity_event_##A; + SUPER() + #undef GO + #define GO(A) if(my_notity_event_fct_##A == 0) {my_notity_event_fct_##A = (uintptr_t)fct; return my_notity_event_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for opencl notity_event callback\n"); + return NULL; +} +// user_function ... +#define GO(A) \ +static uintptr_t my_user_function_fct_##A = 0; \ +static void my_user_function_##A(void* a) \ +{ \ + RunFunctionFmt(my_user_function_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* find_user_function_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_user_function_fct_##A == (uintptr_t)fct) return my_user_function_##A; + SUPER() + #undef GO + #define GO(A) if(my_user_function_fct_##A == 0) {my_user_function_fct_##A = (uintptr_t)fct; return my_user_function_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for opencl user_function callback\n"); + return NULL; +} #undef SUPER @@ -93,4 +138,29 @@ EXPORT void* my_clCreateContextFromType(x64emu_t* emu, void* prop, uint32_t type return my->clCreateContextFromType(prop, type, find_notity_context_Fct(f), data, ret); } +EXPORT int my_clEnqueueNativeKernel(x64emu_t* emu, void* f, void* args, size_t nb_args, uint32_t nb_mem, void* mem, void* mem_loc, uint32_t nb_events, void* events, void* event) +{ + return my->clEnqueueNativeKernel(find_user_function_Fct(f), args, nb_args, nb_mem, mem, mem_loc, nb_events, events, event); +} + +EXPORT int my_clSetMemObjectDestructorCallback(x64emu_t* emu, void* mem, void* f, void* data) +{ + return my->clSetMemObjectDestructorCallback(mem, find_notify_program_Fct(f), data); +} + +EXPORT int my_clSetEventCallback(x64emu_t* emu, void* event, void*f, void* data) +{ + return my->clSetEventCallback(event, find_notity_event_Fct(f), data); +} + +EXPORT int my_clCompileProgram(x64emu_t* emu, void* program, uint32_t nb_devices, void* devices, void* options, uint32_t nb_headers, void* headers, void* headers_inc, void* f, void* data) +{ + return my->clCompileProgram(program, nb_devices, devices, options, nb_headers, headers, headers_inc, find_notify_program_Fct(f), data); +} + +EXPORT void* my_clLinkProgram(x64emu_t* emu, void* context, uint32_t nb_devices, void* devices, void* options, uint32_t nb_progs, void* progs, void* f, void* data, void* ret) +{ + return my->clLinkProgram(context, nb_devices, devices, options, nb_progs, progs, find_notify_program_Fct(f), data, ret); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedopencl_private.h b/src/wrapped/wrappedopencl_private.h index c4c818f..1caf6ed 100644 --- a/src/wrapped/wrappedopencl_private.h +++ b/src/wrapped/wrappedopencl_private.h @@ -4,7 +4,7 @@ GOM(clBuildProgram, iFEpupppp) //GO(clCloneKernel, -//GO(clCompileProgram, +GOM(clCompileProgram, iFEpuppupppp) GO(clCreateBuffer, pFpuLpp) //GO(clCreateBufferWithProperties, GO(clCreateCommandQueue, pFppup) @@ -47,7 +47,7 @@ GO(clEnqueueMapImage, pFppuuppppuppp) GO(clEnqueueMarker, iFpp) GO(clEnqueueMarkerWithWaitList, iFpupp) GO(clEnqueueMigrateMemObjects, iFpupuupp) -//GO(clEnqueueNativeKernel, +GOM(clEnqueueNativeKernel, iFEppLuppupp) GO(clEnqueueNDRangeKernel, iFppupppupp) GO(clEnqueueReadBuffer, iFppuLLpupp) GO(clEnqueueReadBufferRect, iFppupppLLLLpupp) @@ -92,7 +92,7 @@ GO(clGetProgramBuildInfo, iFppuLpp) GO(clGetProgramInfo, iFpuLpL) GO(clGetSamplerInfo, iFpuLpp) GO(clGetSupportedImageFormats, iFpuuupp) -//GO(clLinkProgram, +GOM(clLinkProgram, pFEpuppupppp) GO(clReleaseCommandQueue, iFp) GO(clReleaseContext, iFp) GO(clReleaseDevice, iFp) @@ -112,11 +112,11 @@ GO(clRetainSampler, iFp) //GO(clSetCommandQueueProperty, //GO(clSetContextDestructorCallback, //GO(clSetDefaultDeviceCommandQueue, -//GO(clSetEventCallback, +GOM(clSetEventCallback, iFEppp) GO(clSetKernelArg, iFpuLp) //GO(clSetKernelArgSVMPointer, //GO(clSetKernelExecInfo, -//GO(clSetMemObjectDestructorCallback, +GOM(clSetMemObjectDestructorCallback, iFEppp) //GO(clSetProgramReleaseCallback, //GO(clSetProgramSpecializationConstant, GO(clSetUserEventStatus, iFpi) diff --git a/src/wrapped/wrappedp11kit.c b/src/wrapped/wrappedp11kit.c index 8808bc4..d46a3fc 100644 --- a/src/wrapped/wrappedp11kit.c +++ b/src/wrapped/wrappedp11kit.c @@ -6,12 +6,89 @@ #include "wrappedlibs.h" +#include "debug.h" #include "wrapper.h" #include "bridge.h" #include "librarian/library_private.h" #include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" const char* p11kitName = "libp11-kit.so.0"; #define LIBNAME p11kit +#define ADDED_FUNCTIONS() + +#include "generated/wrappedp11kittypes.h" + +#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) + +// p11_kit_pin_destroy_func +#define GO(A) \ +static uintptr_t my_p11_kit_pin_destroy_func_fct_##A = 0; \ +static void my_p11_kit_pin_destroy_func_##A(void* a) \ +{ \ + RunFunctionFmt(my_p11_kit_pin_destroy_func_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findp11_kit_pin_destroy_funcFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_p11_kit_pin_destroy_func_fct_##A == (uintptr_t)fct) return my_p11_kit_pin_destroy_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_p11_kit_pin_destroy_func_fct_##A == 0) {my_p11_kit_pin_destroy_func_fct_##A = (uintptr_t)fct; return my_p11_kit_pin_destroy_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libp11-kit.so.0 p11_kit_pin_destroy_func callback\n"); + return NULL; +} + +// p11_kit_pin_callback +#define GO(A) \ +static uintptr_t my_p11_kit_pin_callback_fct_##A = 0; \ +static void* my_p11_kit_pin_callback_##A(void* a, void* b, void* c, uint32_t d, void* e) \ +{ \ + return (void*)RunFunctionFmt(my_p11_kit_pin_callback_fct_##A, "pppup", a, b, c, d, e); \ +} +SUPER() +#undef GO +static void* findp11_kit_pin_callbackFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_p11_kit_pin_callback_fct_##A == (uintptr_t)fct) return my_p11_kit_pin_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_p11_kit_pin_callback_fct_##A == 0) {my_p11_kit_pin_callback_fct_##A = (uintptr_t)fct; return my_p11_kit_pin_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libp11-kit.so.0 p11_kit_pin_callback callback\n"); + return NULL; +} + +#undef SUPER + +EXPORT int my_p11_kit_pin_register_callback(x64emu_t* emu, void* source, void* f, void* data, void* d) +{ + return my->p11_kit_pin_register_callback(source, findp11_kit_pin_callbackFct(f), data, findp11_kit_pin_destroy_funcFct(d)); +} + +EXPORT void my_p11_kit_pin_unregister_callback(x64emu_t* emu, void* source, void* f, void* data) +{ + my->p11_kit_pin_unregister_callback(source, findp11_kit_pin_callbackFct(f), data); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedp11kit_private.h b/src/wrapped/wrappedp11kit_private.h index bb848fe..3ecbe70 100644 --- a/src/wrapped/wrappedp11kit_private.h +++ b/src/wrapped/wrappedp11kit_private.h @@ -1,28 +1,106 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -error Meh... +#error Meh... #endif +//GOM(C_GetFunctionList, LFEp) +GO(C_GetInterface, LFpppL) +GO(C_GetInterfaceList, LFpp) GO(p11_kit_be_loud, vFv) GO(p11_kit_be_quiet, vFv) -GO(p11_kit_config_option, pFp) -GO(p11_kit_finalize_module, vFp) -GO(p11_kit_finalize_registered, vFv) +GO(p11_kit_config_option, pFpp) +GO(p11_kit_finalize_module, LFp) +GO(p11_kit_finalize_registered, LFv) GO(p11_kit_initialize_module, LFp) -GO(p11_kit_initialize_registered, vFv) +GO(p11_kit_initialize_registered, LFv) +//GO(p11_kit_iter_add_callback, +GO(p11_kit_iter_add_filter, vFppL) +GO(p11_kit_iter_begin_with, vFppLL) +//GO(p11_kit_iter_begin, GO(p11_kit_iter_destroy_object, LFp) GO(p11_kit_iter_free, vFp) +GO(p11_kit_iter_get_attributes, LFppL) +//GO(p11_kit_iter_get_kind, GO(p11_kit_iter_get_module, pFp) +GO(p11_kit_iter_get_object, LFp) +//GO(p11_kit_iter_get_session, +//GO(p11_kit_iter_get_slot_info, +//GO(p11_kit_iter_get_slot, +//GO(p11_kit_iter_get_token, GO(p11_kit_iter_keep_session, vFp) GO(p11_kit_iter_load_attributes, LFppL) +GO(p11_kit_iter_new, pFpi) GO(p11_kit_iter_next, LFp) GO(p11_kit_iter_set_uri, vFpp) -GO(p11_kit_load_initialize_module, pFp) +GO(p11_kit_load_initialize_module, LFpp) GO(p11_kit_message, pFv) GO(p11_kit_module_finalize, LFp) -GO(p11_kit_module_for_name, pFp) +GO(p11_kit_module_for_name, pFpp) GO(p11_kit_module_get_filename, pFp) -GO(p11_kit_module_get_flags, LFp) +GO(p11_kit_module_get_flags, iFp) GO(p11_kit_module_get_name, pFp) GO(p11_kit_module_initialize, LFp) -GO(p11_kit_module_load, pFpp) +GO(p11_kit_module_load, pFpi) GO(p11_kit_module_release, vFp) +GO(p11_kit_modules_finalize_and_release, vFp) +GO(p11_kit_modules_finalize, LFp) +GO(p11_kit_modules_initialize, LFpp) +GO(p11_kit_modules_load_and_initialize, pFi) +GO(p11_kit_modules_load, pFpi) +GO(p11_kit_modules_release, vFp) +//GO(p11_kit_override_system_files, +GO(p11_kit_pin_file_callback, pFpppup) +GO(p11_kit_pin_get_length, LFp) +GO(p11_kit_pin_get_value, pFpp) +//GOM(p11_kit_pin_new_for_buffer, pFEpLp) +GO(p11_kit_pin_new_for_string, pFp) +GO(p11_kit_pin_new, pFpL) +GO(p11_kit_pin_ref, pFp) +GOM(p11_kit_pin_register_callback, iFEpppp) +GO(p11_kit_pin_request, pFpppu) +GO(p11_kit_pin_unref, vFp) +GOM(p11_kit_pin_unregister_callback, vFEppp) +GO(p11_kit_registered_module_to_name, pFp) +GO(p11_kit_registered_modules, pFv) +GO(p11_kit_registered_name_to_module, pFp) +GO(p11_kit_registered_option, pFpp) +//GO(p11_kit_remote_serve_module, +//GO(p11_kit_remote_serve_token, +//GO(p11_kit_remote_serve_tokens, +//GO(p11_kit_set_progname, +GO(p11_kit_space_strdup, pFpL) +GO(p11_kit_space_strlen, LFpL) +GO(p11_kit_strerror, pFL) +GO(p11_kit_uri_any_unrecognized, iFp) +GO(p11_kit_uri_clear_attribute, iFpL) +GO(p11_kit_uri_clear_attributes, vFp) +GO(p11_kit_uri_format, iFpup) +GO(p11_kit_uri_free, vFp) +GO(p11_kit_uri_get_attribute, pFpL) +GO(p11_kit_uri_get_attributes, pFpp) +GO(p11_kit_uri_get_module_info, pFp) +GO(p11_kit_uri_get_module_name, pFp) +GO(p11_kit_uri_get_module_path, pFp) +GO(p11_kit_uri_get_pin_source, pFp) +GO(p11_kit_uri_get_pin_value, pFp) +GO(p11_kit_uri_get_pinfile, pFp) +GO(p11_kit_uri_get_slot_id, LFp) +GO(p11_kit_uri_get_slot_info, pFp) +GO(p11_kit_uri_get_token_info, pFp) +GO(p11_kit_uri_get_vendor_query, pFpp) +GO(p11_kit_uri_match_attributes, iFppL) +GO(p11_kit_uri_match_module_info, iFpp) +GO(p11_kit_uri_match_slot_info, iFpp) +GO(p11_kit_uri_match_token_info, iFpp) +GO(p11_kit_uri_message, pFi) +GO(p11_kit_uri_new, pFv) +GO(p11_kit_uri_parse, iFpup) +GO(p11_kit_uri_set_attribute, iFpp) +GO(p11_kit_uri_set_attributes, iFppL) +GO(p11_kit_uri_set_module_name, vFpp) +GO(p11_kit_uri_set_module_path, vFpp) +GO(p11_kit_uri_set_pin_source, vFpp) +GO(p11_kit_uri_set_pin_value, vFpp) +GO(p11_kit_uri_set_pinfile, vFpp) +GO(p11_kit_uri_set_slot_id, vFpL) +GO(p11_kit_uri_set_unrecognized, vFpi) +GO(p11_kit_uri_set_vendor_query, iFppp) diff --git a/src/wrapped/wrappedpam.c b/src/wrapped/wrappedpam.c index 9c1fa3d..0c535ff 100644 --- a/src/wrapped/wrappedpam.c +++ b/src/wrapped/wrappedpam.c @@ -11,8 +11,68 @@ #include "bridge.h" #include "librarian/library_private.h" #include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" const char* pamName = "libpam.so.0"; #define LIBNAME pam +#define ADDED_FUNCTIONS() + +#include "generated/wrappedpamtypes.h" + +#include "wrappercallback.h" + +typedef struct my_pam_conv_s { + int conv_version; + void* (*conv)(int num_msg, void** msg, void** resp, void* appdata_ptr); + void* appdata_ptr; +} my_pam_conv_t; + +#define SUPER() \ + GO(0) \ + GO(1) \ + GO(2) \ + GO(3) \ + GO(4) + +#define GO(A) \ + static uintptr_t my_pam_conv_conv_##A = 0; \ + static void* my_pam_conv_convfct##A(int num_msg, void** msg, void** resp, void* appdata_ptr) \ + { \ + return (void*)RunFunctionFmt(my_pam_conv_conv_##A, "ippp", num_msg, msg, resp, appdata_ptr); \ + } +SUPER() +#undef GO +static void* find_pam_conv_Fct(void* fct) +{ + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_pam_conv_conv_##A == (uintptr_t)fct) return my_pam_conv_convfct##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_pam_conv_conv_##A == 0) { \ + my_pam_conv_conv_##A = (uintptr_t)fct; \ + return my_pam_conv_convfct##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for pam conv callback\n"); + return NULL; +} + +EXPORT int my_pam_start(x64emu_t* emu, void* service_name, void* user, my_pam_conv_t* pam_conversation, void** pamh) +{ + void* conv = NULL; + if (pam_conversation) + conv = find_pam_conv_Fct(pam_conversation->conv); + return my->pam_start(service_name, user, conv ? &(my_pam_conv_t) { pam_conversation->conv_version, conv, pam_conversation->appdata_ptr } : NULL, pamh); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedpam_private.h b/src/wrapped/wrappedpam_private.h index ca696f5..f1c7b65 100644 --- a/src/wrapped/wrappedpam_private.h +++ b/src/wrapped/wrappedpam_private.h @@ -1,48 +1,48 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif -//GO(pam_acct_mgmt, -//GO(pam_authenticate, -//GO(pam_chauthtok, -//GO(pam_close_session, -//GO(pam_end, -//GO(pam_fail_delay, -//GO(pam_get_authtok, -//GO(pam_get_authtok_noverify, -//GO(pam_get_authtok_verify, -//GO(pam_get_data, -//GO(pam_getenv, -//GO(pam_getenvlist, -//GO(pam_get_item, -//GO(pam_get_user, -//GO(pam_modutil_audit_write, -//GO(pam_modutil_check_user_in_passwd, -//GO(pam_modutil_drop_priv, -//GO(pam_modutil_getgrgid, -//GO(pam_modutil_getgrnam, -//GO(pam_modutil_getlogin, -//GO(pam_modutil_getpwnam, -//GO(pam_modutil_getpwuid, -//GO(pam_modutil_getspnam, -//GO(pam_modutil_read, -//GO(pam_modutil_regain_priv, -//GO(pam_modutil_sanitize_helper_fds, -//GO(pam_modutil_search_key, -//GO(pam_modutil_user_in_group_nam_gid, -//GO(pam_modutil_user_in_group_nam_nam, -//GO(pam_modutil_user_in_group_uid_gid, -//GO(pam_modutil_user_in_group_uid_nam, -//GO(pam_modutil_write, -//GO(pam_open_session, -//GO(pam_prompt, -//GO(pam_putenv, -//GO(pam_setcred, -//GO(pam_set_data, -//GO(pam_set_item, -//GO(pam_start, -//GO(pam_start_confdir, -//GO(pam_strerror, -//GO(pam_syslog, -//GO(pam_vprompt, -//GO(pam_vsyslog, +GO(pam_acct_mgmt, iFpi) +GO(pam_authenticate, iFpi) +GO(pam_chauthtok, iFpi) +GO(pam_close_session, iFpi) +GO(pam_end, iFpi) +GO(pam_fail_delay, iFpu) +GO(pam_get_authtok, iFpipp) +GO(pam_get_authtok_noverify, iFppp) +GO(pam_get_authtok_verify, iFppp) +GO(pam_get_data, iFppp) +GO(pam_getenv, pFpp) +GO(pam_getenvlist, pFp) +GO(pam_get_item, iFpip) +GO(pam_get_user, iFppp) +GO(pam_modutil_audit_write, iFpipi) +GO(pam_modutil_check_user_in_passwd, iFppp) +GO(pam_modutil_drop_priv, iFppp) +GO(pam_modutil_getgrgid, pFpu) +GO(pam_modutil_getgrnam, pFpp) +GO(pam_modutil_getlogin, pFp) +GO(pam_modutil_getpwnam, pFpp) +GO(pam_modutil_getpwuid, pFpu) +GO(pam_modutil_getspnam, pFpp) +GO(pam_modutil_read, iFipi) +GO(pam_modutil_regain_priv, iFpp) +GO(pam_modutil_sanitize_helper_fds, iFpuuu) +GO(pam_modutil_search_key, pFppp) +GO(pam_modutil_user_in_group_nam_gid, iFppu) +GO(pam_modutil_user_in_group_nam_nam, iFppp) +GO(pam_modutil_user_in_group_uid_gid, iFpuu) +GO(pam_modutil_user_in_group_uid_nam, iFpup) +GO(pam_modutil_write, iFipi) +GO(pam_open_session, iFpi) +// GOM(pam_prompt, iFEpippV) +GO(pam_putenv, iFpp) +GO(pam_setcred, iFpi) +// GOM(pam_set_data, iFEpppp) +GO(pam_set_item, iFpip) +GOM(pam_start, iFEpppp) +// GOM(pam_start_confdir, iFEppppp) +GO(pam_strerror, pFpi) +// GOM(pam_syslog, vFEpipV) +// GOM(pam_vprompt, iFEpippA) +// GOM(pam_vsyslog, vFEpipA) diff --git a/src/wrapped/wrappedpango.c b/src/wrapped/wrappedpango.c index 5a47288..783eb34 100644 --- a/src/wrapped/wrappedpango.c +++ b/src/wrapped/wrappedpango.c @@ -17,11 +17,8 @@ #include "box64context.h" #include "emu/x64emu_private.h" -#ifdef ANDROID - const char* pangoName = "libpango-1.0.so"; -#else - const char* pangoName = "libpango-1.0.so.0"; -#endif +const char* pangoName = "libpango-1.0.so.0"; +#define ALTNAME "libpango-1.0.so" #define LIBNAME pango #include "generated/wrappedpangotypes.h" @@ -96,14 +93,9 @@ EXPORT void my_pango_attribute_init(x64emu_t* emu, void* attr, my_PangoAttrClass my->pango_attribute_init(attr, find_PangoAttrClass_Fct(klass)); } -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; -#ifdef ANDROID -#define NEEDED_LIBS "libgobject-2.0.so", "libglib-2.0.so" -#else #define NEEDED_LIBS "libgobject-2.0.so.0", "libglib-2.0.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedpangocairo.c b/src/wrapped/wrappedpangocairo.c index bd4464d..0b13879 100644 --- a/src/wrapped/wrappedpangocairo.c +++ b/src/wrapped/wrappedpangocairo.c @@ -12,21 +12,15 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* pangocairoName = "libpangocairo-1.0.so"; -#else - const char* pangocairoName = "libpangocairo-1.0.so.0"; -#endif +const char* pangocairoName = "libpangocairo-1.0.so.0"; +#define ALTNAME "libpangocairo-1.0.so" + #define LIBNAME pangocairo -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; + -#ifdef ANDROID -#define NEEDED_LIBS "libpango-1.0.so" -#else #define NEEDED_LIBS "libpango-1.0.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedpangoft2.c b/src/wrapped/wrappedpangoft2.c index 4734196..454b186 100644 --- a/src/wrapped/wrappedpangoft2.c +++ b/src/wrapped/wrappedpangoft2.c @@ -14,9 +14,8 @@ const char* pangoft2Name = "libpangoft2-1.0.so.0"; #define LIBNAME pangoft2 -#define PRE_INIT \ - if(box64_nogtk) \ - return -1; +#define PRE_INIT \ + if (BOX64ENV(nogtk)) return -2; #define NEEDED_LIBS "libfontconfig.so.1", "libfreetype.so.6" diff --git a/src/wrapped/wrappedpangoft2_private.h b/src/wrapped/wrappedpangoft2_private.h index 0d12f7f..3adaf8a 100644 --- a/src/wrapped/wrappedpangoft2_private.h +++ b/src/wrapped/wrappedpangoft2_private.h @@ -1,29 +1,29 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(pango_fc_decoder_get_charset, pFpp) GO(pango_fc_decoder_get_glyph, uFppu) -GO(pango_fc_decoder_get_type, iFv) +GO(pango_fc_decoder_get_type, LFv) GO(pango_fc_font_create_base_metrics_for_context, pFpp) GO(pango_fc_font_description_from_pattern, pFpi) GO(pango_fc_font_get_glyph, uFpu) GO(pango_fc_font_get_raw_extents, vFpupp) -GO(pango_fc_font_get_type, iFv) +GO(pango_fc_font_get_type, LFv) GO(pango_fc_font_get_unknown_glyph, uFpu) GO(pango_fc_font_has_char, iFpu) GO(pango_fc_font_kern_glyphs, vFpp) GO(pango_fc_font_key_get_context_key, pFp) GO(pango_fc_font_key_get_matrix, pFp) GO(pango_fc_font_key_get_pattern, pFp) -GO(pango_fc_font_lock_face, pFp) -//GOM(pango_fc_font_map_add_decoder_find_func, vFEpBpp) +GOM(pango_fc_font_lock_face, pFp) +//GOM(pango_fc_font_map_add_decoder_find_func, vFEpppp) GO(pango_fc_font_map_cache_clear, vFp) GO(pango_fc_font_map_config_changed, vFp) GO(pango_fc_font_map_create_context, pFp) GO(pango_fc_font_map_find_decoder, pFpp) GO(pango_fc_font_map_get_config, pFp) -GO(pango_fc_font_map_get_type, iFv) +GO(pango_fc_font_map_get_type, LFv) GO(pango_fc_font_map_shutdown, vFp) GO(pango_fc_font_map_set_config, vFpp) GO(pango_fc_fontset_key_get_absolute_size, dFp) @@ -41,7 +41,7 @@ GO(pango_ft2_font_map_create_context, pFp) GO(pango_ft2_font_map_for_display, pFv) GO(pango_ft2_font_map_get_type, LFv) GO(pango_ft2_font_map_new, pFv) -//GOM(pango_ft2_font_map_set_default_substitute, vFEpBpB) +//GOM(pango_ft2_font_map_set_default_substitute, vFEpppp) GO(pango_ft2_font_map_set_resolution, vFpdd) GO(pango_ft2_font_map_substitute_changed, vFp) GO(pango_ft2_get_context, pFdd) diff --git a/src/wrapped/wrappedpcap.c b/src/wrapped/wrappedpcap.c new file mode 100644 index 0000000..8706df2 --- /dev/null +++ b/src/wrapped/wrappedpcap.c @@ -0,0 +1,18 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" + +const char* pcapName = "libpcap.so.0.8"; +#define LIBNAME pcap + +#include "wrappedlib_init.h" + diff --git a/src/wrapped/wrappedpcap_private.h b/src/wrapped/wrappedpcap_private.h new file mode 100644 index 0000000..3a6719c --- /dev/null +++ b/src/wrapped/wrappedpcap_private.h @@ -0,0 +1,100 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(bpf_dump, vFpi) +GO(bpf_filter, uFppuu) +GO(bpf_image, pFpi) +GO(bpf_validate, iFpi) +//DATA(eproto_db, +GO(pcap_activate, iFp) +GO(pcap_breakloop, vFp) +GO(pcap_bufsize, iFp) +GO(pcap_can_set_rfmon, iFp) +GO(pcap_close, vFp) +GO(pcap_compile, iFpppiu) +GO(pcap_compile_nopcap, iFiippiu) +GO(pcap_create, pFpp) +GO(pcap_datalink, iFp) +GO(pcap_datalink_ext, iFp) +GO(pcap_datalink_name_to_val, iFp) +GO(pcap_datalink_val_to_description, pFi) +GO(pcap_datalink_val_to_description_or_dlt, pFi) +GO(pcap_datalink_val_to_name, pFi) +//GOM(pcap_dispatch, iFEpipp) +GO(pcap_dump, vFppp) +GO(pcap_dump_close, vFp) +GO(pcap_dump_file, SFp) +GO(pcap_dump_flush, iFp) +GO(pcap_dump_fopen, pFpS) +GO(pcap_dump_ftell, lFp) +GO(pcap_dump_ftell64, IFp) +GO(pcap_dump_open, pFpp) +GO(pcap_dump_open_append, pFpp) +GO(pcap_ether_aton, pFp) +GO(pcap_ether_hostton, pFp) +GO(pcap_file, SFp) +GO(pcap_fileno, iFp) +GO(pcap_findalldevs, iFpp) +GO(pcap_fopen_offline, pFSp) +GO(pcap_fopen_offline_with_tstamp_precision, pFSup) +GO(pcap_freealldevs, vFp) +GO(pcap_freecode, vFp) +GO(pcap_free_datalinks, vFp) +GO(pcap_free_tstamp_types, vFp) +GO(pcap_geterr, pFp) +GO(pcap_getnonblock, iFpp) +GO(pcap_get_required_select_timeout, pFp) +GO(pcap_get_selectable_fd, iFp) +GO(pcap_get_tstamp_precision, iFp) +GO(pcap_init, iFup) +GO(pcap_inject, iFppL) +GO(pcap_is_swapped, iFp) +GO(pcap_lib_version, pFv) +GO(pcap_list_datalinks, iFpp) +GO(pcap_list_tstamp_types, iFpp) +GO(pcap_lookupdev, pFp) +GO(pcap_lookupnet, iFpppp) +//GOM(pcap_loop, iFEpipp) +GO(pcap_major_version, iFp) +GO(pcap_minor_version, iFp) +GO(pcap_nametoaddr, pFp) +GO(pcap_nametoaddrinfo, pFp) +GO(pcap_nametoeproto, iFp) +GO(pcap_nametollc, iFp) +GO(pcap_nametonetaddr, uFp) +GO(pcap_nametoport, iFppp) +GO(pcap_nametoportrange, iFpppp) +GO(pcap_nametoproto, iFp) +GO(pcap_next, pFpp) +GO(pcap_next_etherent, pFS) +GO(pcap_next_ex, iFppp) +GO(pcap_offline_filter, iFppp) +GO(pcap_open_dead, pFii) +GO(pcap_open_dead_with_tstamp_precision, pFiiu) +GO(pcap_open_live, pFpiiip) +GO(pcap_open_offline, pFpp) +GO(pcap_open_offline_with_tstamp_precision, pFpup) +GO(pcap_perror, vFpp) +GO(pcap_sendpacket, iFppi) +GO(pcap_set_buffer_size, iFpi) +GO(pcap_set_datalink, iFpi) +GO(pcap_setdirection, iFpu) +GO(pcap_setfilter, iFpp) +GO(pcap_set_immediate_mode, iFpi) +GO(pcap_setnonblock, iFpip) +GO(pcap_set_promisc, iFpi) +GO(pcap_set_protocol_linux, iFpi) +GO(pcap_set_rfmon, iFpi) +GO(pcap_set_snaplen, iFpi) +GO(pcap_set_timeout, iFpi) +GO(pcap_set_tstamp_precision, iFpi) +GO(pcap_set_tstamp_type, iFpi) +GO(pcap_snapshot, iFp) +GO(pcap_stats, iFpp) +GO(pcap_statustostr, pFi) +GO(pcap_strerror, pFi) +GO(pcap_tstamp_type_name_to_val, iFp) +GO(pcap_tstamp_type_val_to_description, pFi) +GO(pcap_tstamp_type_val_to_name, pFi) +//DATA(pcap_version, diff --git a/src/wrapped/wrappedpng16.c b/src/wrapped/wrappedpng16.c index c1953f8..89cb5fe 100644 --- a/src/wrapped/wrappedpng16.c +++ b/src/wrapped/wrappedpng16.c @@ -17,13 +17,9 @@ #include "box64context.h" #include "emu/x64emu_private.h" -const char* png16Name = -#ifdef ANDROID - "libpng16.so" -#else - "libpng16.so.16" -#endif - ; +const char* png16Name = "libpng16.so.16"; +#define ALTNAME "libpng16.so" + #define LIBNAME png16 #include "generated/wrappedpng16types.h" diff --git a/src/wrapped/wrappedpng16_private.h b/src/wrapped/wrappedpng16_private.h index dd4d3dd..a55f9b4 100644 --- a/src/wrapped/wrappedpng16_private.h +++ b/src/wrapped/wrappedpng16_private.h @@ -1,107 +1,260 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -# error meh! +#error Meh... #endif -GO(png_convert_from_time_t, vFpu) -GOM(png_create_read_struct, pFEpppp) +GO(png_access_version_number, uFv) +GO(png_benign_error, vFpp) +GO(png_build_grayscale_palette, vFip) +GO(png_calloc, pFpL) +GO(png_chunk_benign_error, vFpp) +GO(png_chunk_error, vFpp) +GO(png_chunk_warning, vFpp) +GO(png_convert_from_struct_tm, vFpp) +GO(png_convert_from_time_t, vFpl) +GO(png_convert_to_rfc1123, pFpp) +GO(png_convert_to_rfc1123_buffer, iFpp) GO(png_create_info_struct, pFp) -GO(png_create_write_struct, pFpppp) +GOM(png_create_read_struct, pFEpppp) +GOM(png_create_read_struct_2, pFEppppppp) +//GOM(png_create_write_struct, pFEpppp) +GOM(png_create_write_struct_2, pFEppppppp) +GO(png_data_freer, vFppiu) +GO(png_destroy_info_struct, vFpp) GO(png_destroy_read_struct, vFppp) GO(png_destroy_write_struct, vFpp) GO(png_error, vFpp) GO(png_free, vFpp) +GO(png_free_data, vFppui) +GO(png_free_default, vFpp) GO(png_get_bit_depth, CFpp) +GO(png_get_bKGD, uFppp) +GO(png_get_channels, CFpp) +GO(png_get_cHRM, uFpppppppppp) +GO(png_get_cHRM_fixed, uFpppppppppp) +GO(png_get_cHRM_XYZ, uFppppppppppp) +GO(png_get_cHRM_XYZ_fixed, uFppppppppppp) +GO(png_get_chunk_cache_max, uFp) +GO(png_get_chunk_malloc_max, LFp) +GO(png_get_cICP, uFpppppp) +GO(png_get_cLLI, uFpppp) +GO(png_get_cLLI_fixed, uFpppp) GO(png_get_color_type, CFpp) +GO(png_get_compression_buffer_size, LFp) +GO(png_get_compression_type, CFpp) +GO(png_get_copyright, pFp) +GO(png_get_current_pass_number, CFp) +GO(png_get_current_row_number, uFp) GO(png_get_error_ptr, pFp) -GO(png_get_header_version, CFp) +GO(png_get_eXIf, uFppp) +GO(png_get_eXIf_1, uFpppp) +GO(png_get_filter_type, CFpp) +GO(png_get_gAMA, uFppp) +GO(png_get_gAMA_fixed, uFppp) +GO(png_get_header_ver, pFp) +GO(png_get_header_version, pFp) +GO(png_get_hIST, uFppp) GO(png_get_iCCP, uFpppppp) GO(png_get_IHDR, uFppppppppp) GO(png_get_image_height, uFpp) GO(png_get_image_width, uFpp) +GO(png_get_int_32, iFp) +GO(png_get_interlace_type, CFpp) +GO(png_get_io_chunk_type, uFp) GO(png_get_io_ptr, pFp) -GO(png_get_PLTE, uFpppp) +GO(png_get_io_state, uFp) +GO(png_get_libpng_ver, pFp) +GO(png_get_mDCV, uFpppppppppppp) +GO(png_get_mDCV_fixed, uFpppppppppppp) +GO(png_get_mem_ptr, pFp) +GO(png_get_oFFs, uFppppp) +GO(png_get_palette_max, iFpp) +GO(png_get_pCAL, uFppppppppp) GO(png_get_pHYs, uFppppp) +GO(png_get_pHYs_dpi, uFppppp) +GO(png_get_pixel_aspect_ratio, fFpp) +GO(png_get_pixel_aspect_ratio_fixed, iFpp) +GO(png_get_pixels_per_inch, uFpp) +GO(png_get_pixels_per_meter, uFpp) +GO(png_get_PLTE, uFpppp) +GO(png_get_progressive_ptr, pFp) +GO(png_get_rgb_to_gray_status, CFp) +GO(png_get_rowbytes, LFpp) GO(png_get_rows, pFpp) +GO(png_get_sBIT, uFppp) +GO(png_get_sCAL, uFppppp) +GO(png_get_sCAL_fixed, uFppppp) +GO(png_get_sCAL_s, uFppppp) +GO(png_get_signature, pFpp) +GO(png_get_sPLT, iFppp) +GO(png_get_sRGB, uFppp) +GO(png_get_text, iFpppp) +GO(png_get_tIME, uFppp) GO(png_get_tRNS, uFppppp) +GO(png_get_uint_16, WFp) +GO(png_get_uint_31, uFpp) +GO(png_get_uint_32, uFp) +GO(png_get_unknown_chunks, iFppp) +GO(png_get_user_chunk_ptr, pFp) +GO(png_get_user_height_max, uFp) +GO(png_get_user_transform_ptr, pFp) +GO(png_get_user_width_max, uFp) GO(png_get_valid, uFppu) -GO(png_init_io, vFpp) -GO(png_malloc, pFpu) +GO(png_get_x_offset_inches, fFpp) +GO(png_get_x_offset_inches_fixed, iFpp) +GO(png_get_x_offset_microns, iFpp) +GO(png_get_x_offset_pixels, iFpp) +GO(png_get_x_pixels_per_inch, uFpp) +GO(png_get_x_pixels_per_meter, uFpp) +GO(png_get_y_offset_inches, fFpp) +GO(png_get_y_offset_inches_fixed, iFpp) +GO(png_get_y_offset_microns, iFpp) +GO(png_get_y_offset_pixels, iFpp) +GO(png_get_y_pixels_per_inch, uFpp) +GO(png_get_y_pixels_per_meter, uFpp) +GO(png_handle_as_unknown, iFpp) +GO(png_image_begin_read_from_file, iFpp) +GO(png_image_begin_read_from_memory, iFppL) +GO(png_image_begin_read_from_stdio, iFpS) +GO(png_image_finish_read, iFpppip) +GO(png_image_free, vFp) +GO(png_image_write_to_file, iFppipip) +GO(png_image_write_to_memory, iFpppipip) +GO(png_image_write_to_stdio, iFpSipip) +GO(png_info_init_3, vFpL) +GO(png_init_io, vFpS) +GO(png_longjmp, vFpi) +GO(png_malloc, pFpL) +GO(png_malloc_default, pFpL) +GO(png_malloc_warn, pFpL) +GO(png_permit_mng_features, uFpu) +GO(png_process_data, vFpppL) +GO(png_process_data_pause, LFpi) +GO(png_process_data_skip, uFp) +GO(png_progressive_combine_row, vFppp) GO(png_read_end, vFpp) GO(png_read_image, vFpp) GO(png_read_info, vFpp) GO(png_read_png, vFppip) +GO(png_read_row, vFppp) +GO(png_read_rows, vFpppu) GO(png_read_update_info, vFpp) +GO(png_reset_zstream, iFp) +GO(png_save_int_32, vFpi) +GO(png_save_uint_16, vFpu) +GO(png_save_uint_32, vFpu) +GO(png_set_add_alpha, vFpui) +GO(png_set_alpha_mode, vFpid) +GO(png_set_alpha_mode_fixed, vFpii) +GO(png_set_background, vFppiid) +GO(png_set_background_fixed, vFppiii) +GO(png_set_benign_errors, vFpi) GO(png_set_bgr, vFp) +GO(png_set_bKGD, vFppp) +GO(png_set_check_for_invalid_index, vFpi) +GO(png_set_cHRM, vFppdddddddd) +GO(png_set_cHRM_fixed, vFppiiiiiiii) +GO(png_set_cHRM_XYZ, vFppddddddddd) +GO(png_set_cHRM_XYZ_fixed, vFppiiiiiiiii) +GO(png_set_chunk_cache_max, vFpu) +GO(png_set_chunk_malloc_max, vFpL) +GO(png_set_cICP, vFppCCCC) +GO(png_set_cLLI, vFppdd) +GO(png_set_cLLI_fixed, vFppuu) +GO(png_set_compression_buffer_size, vFpL) GO(png_set_compression_level, vFpi) +GO(png_set_compression_mem_level, vFpi) +GO(png_set_compression_method, vFpi) +GO(png_set_compression_strategy, vFpi) +GO(png_set_compression_window_bits, vFpi) GO(png_set_crc_action, vFpii) GOM(png_set_error_fn, vFEpppp) +GO(png_set_eXIf, vFppp) +GO(png_set_eXIf_1, vFppup) GO(png_set_expand, vFp) +GO(png_set_expand_16, vFp) GO(png_set_expand_gray_1_2_4_to_8, vFp) GO(png_set_filler, vFpui) GO(png_set_filter, vFpii) +GO(png_set_filter_heuristics, vFpiipp) +GO(png_set_filter_heuristics_fixed, vFpiipp) +GO(png_set_flush, vFpi) +GO(png_set_gAMA, vFppd) +GO(png_set_gAMA_fixed, vFppi) +GO(png_set_gamma, vFpdd) +GO(png_set_gamma_fixed, vFpii) GO(png_set_gray_to_rgb, vFp) +GO(png_set_hIST, vFppp) +GO(png_set_iCCP, vFpppipu) GO(png_set_IHDR, vFppuuiiiii) GO(png_set_interlace_handling, iFp) -GO(png_set_longjmp_fn, pFppu) //TODO: need wrapping? +GO(png_set_invalid, vFppi) +GO(png_set_invert_alpha, vFp) +GO(png_set_invert_mono, vFp) +GO(png_set_keep_unknown_chunks, vFpipi) +//GOM(png_set_longjmp_fn, pFEppL) +GO(png_set_mDCV, vFppdddddddddd) +GO(png_set_mDCV_fixed, vFppiiiiiiiiuu) +//GOM(png_set_mem_fn, vFEpppp) +GO(png_set_oFFs, vFppiii) +GO(png_set_option, iFpii) GO(png_set_packing, vFp) GO(png_set_packswap, vFp) GO(png_set_palette_to_rgb, vFp) -GO(png_set_PLTE, vFpppi) +GO(png_set_pCAL, vFpppiiiipp) GO(png_set_pHYs, vFppuui) +GO(png_set_PLTE, vFpppi) +GOM(png_set_progressive_read_fn, vFEppppp) +GO(png_set_quantize, vFppiipi) GOM(png_set_read_fn, vFEppp) +//GOM(png_set_read_status_fn, vFEpp) +//GOM(png_set_read_user_chunk_fn, vFEppp) GOM(png_set_read_user_transform_fn, vFEpp) +GO(png_set_rgb_to_gray, vFpidd) +GO(png_set_rgb_to_gray_fixed, vFpiii) GO(png_set_rows, vFppp) -GO(png_set_shift, vFpC) +GO(png_set_sBIT, vFppp) +GO(png_set_sCAL, vFppidd) +GO(png_set_scale_16, vFp) +GO(png_set_sCAL_fixed, vFppiii) +GO(png_set_sCAL_s, vFppipp) +GO(png_set_shift, vFpp) GO(png_set_sig_bytes, vFpi) +GO(png_set_sPLT, vFpppi) +GO(png_set_sRGB, vFppi) +GO(png_set_sRGB_gAMA_and_cHRM, vFppi) GO(png_set_strip_16, vFp) +GO(png_set_strip_alpha, vFp) +GO(png_set_swap, vFp) +GO(png_set_swap_alpha, vFp) +GO(png_set_text, vFpppi) +GO(png_set_text_compression_level, vFpi) +GO(png_set_text_compression_mem_level, vFpi) +GO(png_set_text_compression_method, vFpi) +GO(png_set_text_compression_strategy, vFpi) +GO(png_set_text_compression_window_bits, vFpi) GO(png_set_tIME, vFppp) GO(png_set_tRNS, vFpppip) GO(png_set_tRNS_to_alpha, vFp) +GO(png_set_unknown_chunk_location, vFppii) +GO(png_set_unknown_chunks, vFpppi) +GO(png_set_user_limits, vFpuu) +GO(png_set_user_transform_info, vFppii) GOM(png_set_write_fn, vFEpppp) -GO(png_set_swap, vFp) -GO(png_sig_cmp, iFpuu) +//GOM(png_set_write_status_fn, vFEpp) +//GOM(png_set_write_user_transform_fn, vFEpp) +GO(png_sig_cmp, iFpLL) +GO(png_start_read_image, vFp) GO(png_warning, vFpp) +GO(png_write_chunk, vFpppL) +GO(png_write_chunk_data, vFppL) +GO(png_write_chunk_end, vFp) +GO(png_write_chunk_start, vFppu) GO(png_write_end, vFpp) -GO(png_write_chunk, vFpppu) +GO(png_write_flush, vFp) +GO(png_write_image, vFpp) GO(png_write_info, vFpp) +GO(png_write_info_before_PLTE, vFpp) GO(png_write_png, vFppip) GO(png_write_row, vFpp) GO(png_write_rows, vFppu) -GO(png_get_rowbytes, uFpp) -GO(png_set_add_alpha, vFpui) -GO(png_get_sRGB, uFppp) -GO(png_set_gamma, vFpdd) -GO(png_get_gAMA, uFppp) -GO(png_read_row, vFppp) -GO(png_get_channels, CFpp) -GO(png_set_iCCP, vFpppipu) -GO(png_set_sRGB, vFppi) -GO(png_set_compression_mem_level, vFpi) -GO(png_set_text, vFpppi) -GO(png_get_cHRM, uFpppppppppp) -GO(png_set_compression_strategy, vFpi) -GO(png_set_gAMA, vFppd) -GOM(png_create_read_struct_2, pFEppppppp) -GO(png_get_header_ver, pFp) -GO(png_set_compression_buffer_size, vFpu) -GOM(png_create_write_struct_2, pFEppppppp) -GO(png_set_cHRM, vFppdddddddd) -GO(png_permit_mng_features, uFpu) -GO(png_set_keep_unknown_chunks, vFpipi) -GO(png_set_oFFs, vFppiii) -GO(png_set_option, iFpii) -GO(png_get_libpng_ver, pFp) -GO(png_get_text, uFpppp) -GO(png_set_sBIT, vFppp) -GO(png_set_bKGD, vFppp) -GO(png_get_x_offset_pixels, iFpp) -GO(png_get_y_offset_pixels, iFpp) -GO(png_write_image, vFpp) -GO(png_process_data, vFpppL) -GO(png_progressive_combine_row, vFppp) -GO(png_get_progressive_ptr, pFp) -GO(png_get_interlace_type, CFpp) -GOM(png_set_progressive_read_fn, vFEppppp) -GO(png_image_begin_read_from_memory, iFppL) -GO(png_image_finish_read, iFpppip) -GO(png_image_free, vFp) +GO(png_write_sig, vFp) diff --git a/src/wrapped/wrappedpsl5_private.h b/src/wrapped/wrappedpsl5_private.h index 9b6c691..e71981f 100644 --- a/src/wrapped/wrappedpsl5_private.h +++ b/src/wrapped/wrappedpsl5_private.h @@ -1,7 +1,26 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -error Meh... +#error Meh... #endif -GO(psl_str_to_utf8lower, pFp) +GO(psl_builtin, pFv) +GO(psl_builtin_filename, pFv) +GO(psl_builtin_file_time, lFv) +GO(psl_builtin_outdated, iFv) +GO(psl_builtin_sha1sum, pFv) +GO(psl_check_version_number, iFi) +GO(psl_dist_filename, pFv) +GO(psl_free, vFp) +GO(psl_free_string, vFp) +GO(psl_get_version, pFv) GO(psl_is_cookie_domain_acceptable, iFppp) +GO(psl_is_public_suffix, iFpp) +GO(psl_is_public_suffix2, iFppi) GO(psl_latest, pFp) +GO(psl_load_file, pFp) +GO(psl_load_fp, pFS) +GO(psl_registrable_domain, pFpp) +GO(psl_str_to_utf8lower, iFpppp) +GO(psl_suffix_count, iFp) +GO(psl_suffix_exception_count, iFp) +GO(psl_suffix_wildcard_count, iFp) +GO(psl_unregistrable_domain, pFpp) diff --git a/src/wrapped/wrappedpulse.c b/src/wrapped/wrappedpulse.c index cbdb538..1a02b27 100644 --- a/src/wrapped/wrappedpulse.c +++ b/src/wrapped/wrappedpulse.c @@ -17,11 +17,8 @@ #include "librarian.h" #include "myalign.h" -#ifdef ANDROID - const char* pulseName = "libpulse.so"; -#else - const char* pulseName = "libpulse.so.0"; -#endif +const char* pulseName = "libpulse.so.0"; +#define ALTNAME "libpulse.so" #define LIBNAME pulse @@ -537,6 +534,29 @@ static void* find_subscribe_context_Fct(void* fct) return NULL; } +// operation_state +#define GO(A) \ +static uintptr_t my_operation_state_fct_##A = 0; \ +static void my_operation_state_##A(void* o, void* data) \ +{ \ + RunFunctionFmt(my_operation_state_fct_##A, "pp", o, data); \ +} +SUPER() +#undef GO +static void* find_operation_state_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_operation_state_fct_##A == (uintptr_t)fct) return my_operation_state_##A; + SUPER() + #undef GO + #define GO(A) if(my_operation_state_fct_##A == 0) {my_operation_state_fct_##A = (uintptr_t)fct; return my_operation_state_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for pulse audio operation_state callback\n"); + return NULL; +} + // stream_state #define GO(A) \ static uintptr_t my_stream_state_fct_##A = 0; \ @@ -912,6 +932,28 @@ static void* find_time_free_Fct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for pulse audio time_free callback\n"); return NULL; } +// pa_time_event_destroy_cb +#define GO(A) \ +static uintptr_t my_pa_time_event_destroy_cb_fct_##A = 0; \ +static void my_pa_time_event_destroy_cb_##A(void* a, void* e, void* u) \ +{ \ + RunFunctionFmt(my_pa_time_event_destroy_cb_fct_##A, "ppp", a, e, u); \ +} +SUPER() +#undef GO +static void* find_pa_time_event_destroy_cb_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_pa_time_event_destroy_cb_fct_##A == (uintptr_t)fct) return my_pa_time_event_destroy_cb_##A; + SUPER() + #undef GO + #define GO(A) if(my_pa_time_event_destroy_cb_fct_##A == 0) {my_pa_time_event_destroy_cb_fct_##A = (uintptr_t)fct; return my_pa_time_event_destroy_cb_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for pulse audio pa_time_event_destroy_cb callback\n"); + return NULL; +} // time_set_destroy #define GO(A) \ static uintptr_t my_time_set_destroy_fct_##A = 0; \ @@ -934,6 +976,27 @@ static void* find_time_set_destroy_Fct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for pulse audio time_set_destroy callback\n"); return NULL; } +#define GO(A) \ +static vFpp_t my_time_set_destroy_native_fct_##A = NULL; \ +static void my_time_set_destroy_native_##A(void* e, void* cb) \ +{ \ + cb = find_pa_time_event_destroy_cb_Fct(cb); \ + my_time_set_destroy_native_fct_##A (e, cb); \ +} +SUPER() +#undef GO +static void* find_time_set_destroy_native_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(my_time_set_destroy_native_fct_##A == fct) return my_time_set_destroy_native_##A; + SUPER() + #undef GO + #define GO(A) if(!my_time_set_destroy_native_fct_##A) {my_time_set_destroy_native_fct_##A = fct; return my_time_set_destroy_native_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for pulse audio time_set_destroy native wrapper\n"); + return NULL; +} // defer_new #define GO(A) \ static uintptr_t my_defer_new_fct_##A = 0; \ @@ -1052,7 +1115,8 @@ static void UpdateautobridgeMainloopAPI(x64emu_t* emu, bridge_t* bridge, my_pa_m if(!api) { return; } - #define GO(A, W) if(api->A!=my_mainloop_api.A) {api->A=find_##A##_Fct(api->A); AddAutomaticBridge(bridge, W, api->A, 0, NULL);} + #define GO(A, W) if(api->A!=my_mainloop_api.A) {api->A=find_##A##_Fct(api->A); AddAutomaticBridge(bridge, W, api->A, 0, "pulse_" #A);} + #define GO2(A, W) if(api->A!=my_mainloop_api.A) {api->A=find_##A##_Fct(api->A); AddAutomaticBridgeAlt(bridge, W, api->A, find_##A##_native_Fct(api->A), 0, "pulse_" #A);} GO(io_new, pFpiipp); GO(io_enable, vFpi); GO(io_free, vFp); @@ -1060,13 +1124,14 @@ static void UpdateautobridgeMainloopAPI(x64emu_t* emu, bridge_t* bridge, my_pa_m GO(time_new, pFpppp); GO(time_restart, vFpp); GO(time_free, vFp); - GO(time_set_destroy, vFpp); + GO2(time_set_destroy, vFpp); GO(defer_new, pFppp); GO(defer_enable, vFpi); GO(defer_free, vFp); GO(defer_set_destroy, vFpp); GO(quit, vFpi); #undef GO + #undef GO2 memcpy(&my_mainloop_api, api, sizeof(my_mainloop_api)); return; } @@ -1076,7 +1141,8 @@ static void autobridgeMainloopAPI(x64emu_t* emu, bridge_t* bridge, my_pa_mainloo if(!api) { return; } - #define GO(A, W) if(api->A) AddAutomaticBridge(bridge, W, api->A, 0, NULL) + #define GO(A, W) if(api->A) AddAutomaticBridge(bridge, W, api->A, 0, "pulse_" #A) + #define GO2(A, W) if(api->A) AddAutomaticBridgeAlt(bridge, W, api->A, find_##A##_native_Fct(api->A), 0, "pulse_" #A) GO(io_new, pFpiipp); GO(io_enable, vFpi); GO(io_free, vFp); @@ -1084,13 +1150,14 @@ static void autobridgeMainloopAPI(x64emu_t* emu, bridge_t* bridge, my_pa_mainloo GO(time_new, pFpppp); GO(time_restart, vFpp); GO(time_free, vFp); - GO(time_set_destroy, vFpp); + GO2(time_set_destroy, vFpp); GO(defer_new, pFppp); GO(defer_enable, vFpi); GO(defer_free, vFp); GO(defer_set_destroy, vFpp); GO(quit, vFpi); #undef GO + #undef GO2 memcpy(&my_mainloop_api, api, sizeof(my_mainloop_api)); return; } @@ -1331,6 +1398,14 @@ EXPORT void* my_pa_context_get_source_info_by_name(x64emu_t* emu, void* context, return my->pa_context_get_source_info_by_name(context, name, find_module_info_Fct(cb), data); } +// Operation functions + +EXPORT void my_pa_operation_set_state_callback(x64emu_t* emu, void* stream, void* cb, void* data) +{ + my->pa_operation_set_state_callback(stream, find_operation_state_Fct(cb), data); +} + + // Stream functions EXPORT void* my_pa_stream_drain(x64emu_t* emu, void* stream, void* cb, void* data) @@ -1581,7 +1656,7 @@ void my_autobridge_mainloop_api(x64emu_t* emu, void* api) } #define PRE_INIT \ - if(box64_nopulse) \ + if(BOX64ENV(nopulse)) \ return -1; #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedpulse_private.h b/src/wrapped/wrappedpulse_private.h index fed2e1a..132e70d 100644 --- a/src/wrapped/wrappedpulse_private.h +++ b/src/wrapped/wrappedpulse_private.h @@ -12,7 +12,7 @@ GO(pa_channel_map_can_fade, iFp) GO(pa_channel_map_compatible, iFpp) GO(pa_channel_map_equal, iFpp) GO(pa_channel_map_init, pFp) -GO(pa_channel_map_init_auto, pFpui) +GO(pa_channel_map_init_auto, pFpuu) GO(pa_channel_map_init_extend, pFpuu) GO(pa_channel_map_init_mono, pFp) GO(pa_channel_map_init_stereo, pFp) @@ -24,27 +24,27 @@ GO(pa_channel_map_to_pretty_name, pFp) GO(pa_channel_map_valid, iFp) GO(pa_channel_position_to_pretty_string, pFi) GO(pa_channel_position_to_string, pFi) -//GO(pa_context_add_autoload, -GOM(pa_context_connect, iFEppip) +//GOM(pa_context_add_autoload, pFppupppp) +GOM(pa_context_connect, iFEppup) GO(pa_context_disconnect, vFp) GOM(pa_context_drain, pFEppp) GO(pa_context_errno, iFp) GOM(pa_context_exit_daemon, pFEppp) -//GO(pa_context_get_autoload_info_by_index, -//GO(pa_context_get_autoload_info_by_name, -//GO(pa_context_get_autoload_info_list, +//GOM(pa_context_get_autoload_info_by_index, pFpupp) +//GOM(pa_context_get_autoload_info_by_name, pFppupp) +//GOM(pa_context_get_autoload_info_list, pFppp) GOM(pa_context_get_card_info_by_index, pFEpupp) -//GO(pa_context_get_card_info_by_name, +//GOM(pa_context_get_card_info_by_name, pFpppp) GOM(pa_context_get_card_info_list, pFEppp) GOM(pa_context_get_client_info, pFEpupp) GOM(pa_context_get_client_info_list, pFEppp) GO(pa_context_get_index, uFp) -//GO(pa_context_get_module_info, +//GOM(pa_context_get_module_info, pFpupp) GOM(pa_context_get_module_info_list, pFEppp) GO(pa_context_get_protocol_version, uFp) -//GO(pa_context_get_sample_info_by_index, -//GO(pa_context_get_sample_info_by_name, -//GO(pa_context_get_sample_info_list, +//GOM(pa_context_get_sample_info_by_index, pFpupp) +//GOM(pa_context_get_sample_info_by_name, pFpppp) +//GOM(pa_context_get_sample_info_list, pFppp) GO(pa_context_get_server, pFp) GOM(pa_context_get_server_info, pFEppp) GO(pa_context_get_server_protocol_version, uFp) @@ -61,27 +61,28 @@ GOM(pa_context_get_source_output_info_list, pFEppp) GO(pa_context_get_state, uFp) GO(pa_context_is_local, iFp) GO(pa_context_is_pending, iFp) -//GO(pa_context_kill_client, -//GO(pa_context_kill_sink_input, -//GO(pa_context_kill_source_output, +//GOM(pa_context_kill_client, pFpupp) +//GOM(pa_context_kill_sink_input, pFpupp) +//GOM(pa_context_kill_source_output, pFpupp) GOM(pa_context_load_module, pFEppppp) GOM(pa_context_move_sink_input_by_index, pFEpuupp) -//GO(pa_context_move_sink_input_by_name, +//GOM(pa_context_move_sink_input_by_name, pFpuppp) GOM(pa_context_move_source_output_by_index, pFEpuupp) -//GO(pa_context_move_source_output_by_name, +//GOM(pa_context_move_source_output_by_name, pFpuppp) GOM(pa_context_new, pFEpp) GOM(pa_context_new_with_proplist, pFEppp) -//GO(pa_context_play_sample, -//GO(pa_context_play_sample_with_proplist, +//GOM(pa_context_play_sample, pFpppupp) +//GOM(pa_context_play_sample_with_proplist, pFpppuppp) GOM(pa_context_proplist_remove, pFEpppp) -GOM(pa_context_proplist_update, pFEpippp) +GOM(pa_context_proplist_update, pFEpuppp) GO(pa_context_ref, pFp) -//GO(pa_context_remove_autoload_by_index, -//GO(pa_context_remove_autoload_by_name, -//GO(pa_context_remove_sample, +//GOM(pa_context_remove_autoload_by_index, pFpupp) +//GOM(pa_context_remove_autoload_by_name, pFppupp) +//GOM(pa_context_remove_sample, pFpppp) GOM(pa_context_rttime_new, pFEpUpp) +GO(pa_context_rttime_restart, vFppU) GOM(pa_context_set_card_profile_by_index, pFEpuppp) -//GO(pa_context_set_card_profile_by_name, +//GOM(pa_context_set_card_profile_by_name, pFppppp) GOM(pa_context_set_default_sink, pFEpppp) GOM(pa_context_set_default_source, pFEpppp) GOM(pa_context_set_event_callback, vFEppp) @@ -89,24 +90,24 @@ GOM(pa_context_set_name, pFEpppp) GOM(pa_context_set_sink_input_mute, pFEpuipp) GOM(pa_context_set_sink_input_volume, pFEpuppp) GOM(pa_context_set_sink_mute_by_index, pFEpuipp) -//GO(pa_context_set_sink_mute_by_name, +//GOM(pa_context_set_sink_mute_by_name, pFppipp) GOM(pa_context_set_sink_port_by_index, pFEpuppp) GOM(pa_context_set_sink_port_by_name, pFEppppp) GOM(pa_context_set_sink_volume_by_index, pFEpuppp) -//GO(pa_context_set_sink_volume_by_name, +//GOM(pa_context_set_sink_volume_by_name, pFppppp) GOM(pa_context_set_source_mute_by_index, pFEpuipp) -//GO(pa_context_set_source_mute_by_name, +//GOM(pa_context_set_source_mute_by_name, pFppipp) GOM(pa_context_set_source_port_by_index, pFEpuppp) GOM(pa_context_set_source_volume_by_index, pFEpuppp) GOM(pa_context_set_source_volume_by_name, pFEppppp) GOM(pa_context_set_state_callback, vFEppp) GOM(pa_context_set_subscribe_callback, vFEppp) -//GO(pa_context_stat, +//GOM(pa_context_stat, pFppp) GOM(pa_context_subscribe, pFEpupp) -//GO(pa_context_suspend_sink_by_index, -//GO(pa_context_suspend_sink_by_name, -//GO(pa_context_suspend_source_by_index, -//GO(pa_context_suspend_source_by_name, +//GOM(pa_context_suspend_sink_by_index, pFpuipp) +//GOM(pa_context_suspend_sink_by_name, pFppipp) +//GOM(pa_context_suspend_source_by_index, pFpuipp) +//GOM(pa_context_suspend_source_by_name, pFppipp) GOM(pa_context_unload_module, pFEpupp) GO(pa_context_unref, vFp) GO(pa_cvolume_avg, uFp) @@ -123,7 +124,7 @@ GO(pa_cvolume_scale, pFpu) GO(pa_cvolume_set, pFpuu) GO(pa_cvolume_set_balance, pFppf) GO(pa_cvolume_set_fade, pFppf) -GO(pa_cvolume_snprint, pFplp) +GO(pa_cvolume_snprint, pFpLp) GO(pa_cvolume_valid, iFp) GOM(pa_ext_device_restore_read_formats, pFEpiupp) GOM(pa_ext_device_restore_read_formats_all, pFEppp) @@ -145,7 +146,7 @@ GO(pa_get_host_name, pFpL) GO(pa_get_library_version, pFv) GO(pa_gettimeofday, pFp) GO(pa_get_user_name, pFpL) -//GO(pa_locale_to_utf8, +GO(pa_locale_to_utf8, pFp) GOM(pa_mainloop_api_once, vFEppp) GO(pa_mainloop_dispatch, iFp) GOM(pa_mainloop_free, vFEp) @@ -163,6 +164,7 @@ GO(pa_msleep, iFL) GO(pa_operation_cancel, vFp) GO(pa_operation_get_state, uFp) GO(pa_operation_ref, pFp) +GOM(pa_operation_set_state_callback, vFEppp) GO(pa_operation_unref, vFp) GO(pa_parse_sample_format, iFp) GO(pa_path_get_filename, pFp) @@ -227,7 +229,7 @@ GO(pa_stream_new_with_proplist, pFppppp) GO(pa_stream_peek, iFppp) GOM(pa_stream_prebuf, pFEppp) GOM(pa_stream_proplist_remove, pFEpppp) -GOM(pa_stream_proplist_update, pFEpippp) +GOM(pa_stream_proplist_update, pFEpuppp) GO(pa_stream_readable_size, LFp) GO(pa_stream_ref, pFp) GOM(pa_stream_set_buffer_attr, pFEpppp) @@ -249,7 +251,7 @@ GO(pa_stream_unref, vFp) GOM(pa_stream_update_sample_rate, pFEpupp) GOM(pa_stream_update_timing_info, pFEppp) GO(pa_stream_writable_size, LFp) -GOM(pa_stream_write, iFEppLpIi) +GOM(pa_stream_write, iFEppLpIu) GO(pa_strerror, pFi) GO(pa_sw_cvolume_divide, pFppp) GO(pa_sw_cvolume_multiply, pFppp) @@ -268,6 +270,7 @@ GO(pa_threaded_mainloop_get_retval, iFp) GO(pa_threaded_mainloop_in_thread, iFp) GO(pa_threaded_mainloop_lock, vFp) GO(pa_threaded_mainloop_new, pFv) +GO(pa_threaded_mainloop_set_name, vFpp) GO(pa_threaded_mainloop_signal, vFpi) GO(pa_threaded_mainloop_start, iFp) GO(pa_threaded_mainloop_stop, vFp) diff --git a/src/wrapped/wrappedpulsemainloopglib.c b/src/wrapped/wrappedpulsemainloopglib.c index b2d7aa9..58fcedd 100644 --- a/src/wrapped/wrappedpulsemainloopglib.c +++ b/src/wrapped/wrappedpulsemainloopglib.c @@ -17,11 +17,8 @@ #include "librarian.h" #include "myalign.h" -#ifdef ANDROID - const char* pulsemainloopglibName = "libpulse-mainloop-glib.so"; -#else - const char* pulsemainloopglibName = "libpulse-mainloop-glib.so.0"; -#endif +const char* pulsemainloopglibName = "libpulse-mainloop-glib.so.0"; +#define ALTNAME "libpulse-mainloop-glib.so" #define LIBNAME pulsemainloopglib @@ -38,14 +35,9 @@ EXPORT void* my_pa_glib_mainloop_get_api(x64emu_t* emu, void* mainloop) } #define PRE_INIT \ - if(box64_nopulse) \ + if(BOX64ENV(nopulse)) \ return -1; -#ifdef ANDROID -#define NEEDED_LIBS "libpulse.so" -#else #define NEEDED_LIBS "libpulse.so.0" -#endif - #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedpulsesimple.c b/src/wrapped/wrappedpulsesimple.c index b448040..d4e24c7 100644 --- a/src/wrapped/wrappedpulsesimple.c +++ b/src/wrapped/wrappedpulsesimple.c @@ -17,22 +17,15 @@ #include "librarian.h" #include "myalign.h" -#ifdef ANDROID - const char* pulsesimpleName = "libpulse-simple.so"; -#else - const char* pulsesimpleName = "libpulse-simple.so.0"; -#endif +const char* pulsesimpleName = "libpulse-simple.so.0"; +#define ALTNAME "libpulse-simple.so" #define LIBNAME pulsesimple -#define PRE_INIT \ - if(box64_nopulse) \ +#define PRE_INIT \ + if(BOX64ENV(nopulse)) \ return -1; -#ifdef ANDROID -#define NEEDED_LIBS "libpulse.so" -#else #define NEEDED_LIBS "libpulse.so.0" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedpulsesimple_private.h b/src/wrapped/wrappedpulsesimple_private.h index fb602d8..c2bd718 100644 --- a/src/wrapped/wrappedpulsesimple_private.h +++ b/src/wrapped/wrappedpulsesimple_private.h @@ -6,6 +6,6 @@ GO(pa_simple_drain, iFpp) GO(pa_simple_flush, iFpp) GO(pa_simple_free, vFp) GO(pa_simple_get_latency, UFpp) -GO(pa_simple_new, pFppipppppp) +GO(pa_simple_new, pFppupppppp) GO(pa_simple_read, iFppLp) GO(pa_simple_write, iFppLp) diff --git a/src/wrapped/wrappedsdl1.c b/src/wrapped/wrappedsdl1.c index 1ffdfac..c11980d 100644 --- a/src/wrapped/wrappedsdl1.c +++ b/src/wrapped/wrappedsdl1.c @@ -358,7 +358,7 @@ EXPORT void* my_SDL_GL_GetProcAddress(x64emu_t* emu, void* name) { khint_t k; const char* rname = (const char*)name; - return getGLProcAddress(emu, (glprocaddress_t)my->SDL_GL_GetProcAddress, rname); + return getGLProcAddress(emu, NULL, (glprocaddress_t)my->SDL_GL_GetProcAddress, rname); } // DL functions from wrappedlibdl.c diff --git a/src/wrapped/wrappedsdl2.c b/src/wrapped/wrappedsdl2.c index 33cbfab..60ac6e6 100644 --- a/src/wrapped/wrappedsdl2.c +++ b/src/wrapped/wrappedsdl2.c @@ -42,8 +42,17 @@ int EXPORT my2_SDL_HasRDTSC(void) __attribute__((alias("sdl_Yes"))); int EXPORT my2_SDL_HasSSE(void) __attribute__((alias("sdl_Yes"))); int EXPORT my2_SDL_HasSSE2(void) __attribute__((alias("sdl_Yes"))); int EXPORT my2_SDL_HasSSE3(void) __attribute__((alias("sdl_Yes"))); -int EXPORT my2_SDL_HasSSE41(void) __attribute__((alias("sdl_No"))); -int EXPORT my2_SDL_HasSSE42(void) __attribute__((alias("sdl_No"))); +int EXPORT my2_SDL_HasSSE41(void) __attribute__((alias("sdl_Yes"))); +int EXPORT my2_SDL_HasSSE42(void) { + return BOX64ENV(sse42)?1:0; +} +int EXPORT my2_SDL_HasAVX(void) { + return BOX64ENV(avx)?1:0; +} +int EXPORT my2_SDL_HasAVX2(void) { + return BOX64ENV(avx2)?1:0; +} +int EXPORT my2_SDL_HasAVX512F(void) __attribute__((alias("sdl_No"))); typedef struct { int32_t freq; @@ -215,6 +224,39 @@ static void* reverse_LogOutput_Fct(void* fct) return (void*)AddBridge(my_lib->w.bridge, vFpiip, fct, 0, NULL); } +// Hint +#define GO(A) \ +static uintptr_t my_Hint_fct_##A = 0; \ +static void my_Hint_##A(void* userdata, const char* name, const char* oldValue, const char* newValue) \ +{ \ + RunFunctionFmt(my_Hint_fct_##A, "pppp", userdata, name, oldValue, newValue); \ +} +SUPER() +#undef GO +static void* find_Hint_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_Hint_fct_##A == (uintptr_t)fct) return my_Hint_##A; + SUPER() + #undef GO + #define GO(A) if(my_Hint_fct_##A == 0) {my_Hint_fct_##A = (uintptr_t)fct; return my_Hint_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for SDL2 Hint callback\n"); + return NULL; +} +static void* reverse_Hint_Fct(void* fct) +{ + if(!fct) return fct; + if(CheckBridged(my_lib->w.bridge, fct)) + return (void*)CheckBridged(my_lib->w.bridge, fct); + #define GO(A) if(my_Hint_##A == fct) return (void*)my_Hint_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(my_lib->w.bridge, vFpppp, fct, 0, NULL); +} + #undef SUPER // TODO: track the memory for those callback @@ -237,19 +279,15 @@ EXPORT int64_t my2_SDL_OpenAudio(x64emu_t* emu, void* d, void* o) return ret; } -EXPORT int64_t my2_SDL_OpenAudioDevice(x64emu_t* emu, void* device, int64_t iscapture, void* d, void* o, int64_t allowed) +EXPORT uint32_t my2_SDL_OpenAudioDevice(x64emu_t* emu, void* device, int iscapture, void* d, void* o, int allowed) { - SDL2_AudioSpec *desired = (SDL2_AudioSpec*)d; + SDL2_AudioSpec* desired = (SDL2_AudioSpec*)d; // create a callback - void *fnc = (void*)desired->callback; + void* fnc = (void*)desired->callback; desired->callback = find_AudioCallback_Fct(fnc); - int ret = my->SDL_OpenAudioDevice(device, iscapture, desired, (SDL2_AudioSpec*)o, allowed); - if (ret<=0) { - // error, clean the callback... - desired->callback = fnc; - return ret; - } + uint32_t ret = my->SDL_OpenAudioDevice(device, iscapture, desired, (SDL2_AudioSpec*)o, allowed); + // put back stuff in place? desired->callback = fnc; @@ -288,10 +326,10 @@ EXPORT void *my2_SDL_LoadWAV_RW(x64emu_t* emu, void* a, int b, void* c, void* d, RWNativeEnd2(rw); return r; } -EXPORT int64_t my2_SDL_GameControllerAddMappingsFromRW(x64emu_t* emu, void* a, int b) +EXPORT int my2_SDL_GameControllerAddMappingsFromRW(x64emu_t* emu, void* a, int b) { SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); - int64_t r = my->SDL_GameControllerAddMappingsFromRW(rw, b); + int r = my->SDL_GameControllerAddMappingsFromRW(rw, b); if(b==0) RWNativeEnd2(rw); return r; @@ -416,7 +454,7 @@ EXPORT void *my2_SDL_RWFromMem(x64emu_t* emu, void* a, int b) return AddNativeRW2(emu, (SDL2_RWops_t*)r); } -EXPORT int64_t my2_SDL_RWseek(x64emu_t* emu, void* a, int64_t offset, int64_t whence) +EXPORT int64_t my2_SDL_RWseek(x64emu_t* emu, void* a, int64_t offset, int whence) { //sdl2_my_t *my = (sdl2_my_t *)emu->context->sdl2lib->priv.w.p2; SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); @@ -431,17 +469,17 @@ EXPORT int64_t my2_SDL_RWtell(x64emu_t* emu, void* a) RWNativeEnd2(rw); return ret; } -EXPORT uint64_t my2_SDL_RWread(x64emu_t* emu, void* a, void* ptr, uint64_t size, uint64_t maxnum) +EXPORT size_t my2_SDL_RWread(x64emu_t* emu, void* a, void* ptr, size_t size, size_t maxnum) { SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); - uint64_t ret = RWNativeRead2(rw, ptr, size, maxnum); + size_t ret = RWNativeRead2(rw, ptr, size, maxnum); RWNativeEnd2(rw); return ret; } -EXPORT uint64_t my2_SDL_RWwrite(x64emu_t* emu, void* a, const void* ptr, uint64_t size, uint64_t maxnum) +EXPORT size_t my2_SDL_RWwrite(x64emu_t* emu, void* a, const void* ptr, size_t size, size_t maxnum) { SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); - uint64_t ret = RWNativeWrite2(rw, ptr, size, maxnum); + size_t ret = RWNativeWrite2(rw, ptr, size, maxnum); RWNativeEnd2(rw); return ret; } @@ -501,6 +539,15 @@ EXPORT void my2_SDL_LogSetOutputFunction(x64emu_t* emu, void* f, void* arg) my->SDL_LogSetOutputFunction(find_LogOutput_Fct(f), arg); } +EXPORT void my2_SDL_AddHintCallback(x64emu_t* emu, char* name, void* callback, void* userdata) +{ + my->SDL_AddHintCallback(name, find_Hint_Fct(callback), userdata); +} +EXPORT void my2_SDL_DelHintCallback(x64emu_t* emu, char* name, void* callback, void* userdata) +{ + my->SDL_DelHintCallback(name, reverse_Hint_Fct(callback), userdata); +} + EXPORT int my2_SDL_vsnprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) { (void)emu; @@ -550,7 +597,6 @@ static int get_sdl_priv(x64emu_t* emu, const char *sym_str, void **w, void **f) *f = dlsym(emu->context->box64lib, "my2_"#sym); \ return *f != NULL; \ } - #define GOS(sym, _w) GOM(sym, _w) #define DATA if(0); @@ -559,7 +605,6 @@ static int get_sdl_priv(x64emu_t* emu, const char *sym_str, void **w, void **f) #undef GO #undef GOM #undef GO2 - #undef GOS #undef DATA return 0; } @@ -654,11 +699,11 @@ EXPORT void* my2_SDL_GL_GetProcAddress(x64emu_t* emu, void* name) if(!lib_checked) { lib_checked = 1; // check if libGL is loaded, load it if not (helps some Haxe games, like DeadCells or Nuclear Blaze) - if(!my_glhandle && !GetLibInternal(box64_libGL?box64_libGL:"libGL.so.1")) + if(!my_glhandle && !GetLibInternal(BOX64ENV(libgl)?BOX64ENV(libgl):"libGL.so.1")) // use a my_dlopen to actually open that lib, like SDL2 is doing... - my_glhandle = my_dlopen(emu, box64_libGL?box64_libGL:"libGL.so.1", RTLD_LAZY|RTLD_GLOBAL); + my_glhandle = my_dlopen(emu, BOX64ENV(libgl)?BOX64ENV(libgl):"libGL.so.1", RTLD_LAZY|RTLD_GLOBAL); } - return getGLProcAddress(emu, (glprocaddress_t)my->SDL_GL_GetProcAddress, rname); + return getGLProcAddress(emu, NULL, (glprocaddress_t)my->SDL_GL_GetProcAddress, rname); } #define nb_once 16 @@ -803,7 +848,7 @@ EXPORT void my2_SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, uint16_t *vend, u { uint16_t dummy = 0; if(my->SDL_GetJoystickGUIDInfo) - my->SDL_GetJoystickGUIDInfo(guid, vend, prod, ver, box64_sdl2_jguid?(&dummy):crc16); + my->SDL_GetJoystickGUIDInfo(guid, vend, prod, ver, BOX64ENV(sdl2_jguid)?(&dummy):crc16); // fallback else { uint16_t *guid16 = (uint16_t *)guid.data; @@ -831,6 +876,29 @@ EXPORT unsigned long my2_SDL_GetThreadID(x64emu_t* emu, void* thread) return ret; } +EXPORT int my2_SDL_GetCPUCount(x64emu_t* emu) +{ + int ret = my->SDL_GetCPUCount(); + if(BOX64ENV(maxcpu) && ret>BOX64ENV(maxcpu)) + ret = BOX64ENV(maxcpu); + return ret; +} + +struct my_FilterEvents_data { + uintptr_t callback; + void *userdata; +}; +static int my_FilterEvents_callback(struct my_FilterEvents_data* data, void* event) { + return (int) RunFunctionFmt(data->callback, "pp", data->userdata, event); +} +EXPORT void my2_SDL_FilterEvents(x64emu_t* emu, void* filter, void* userdata) { + struct my_FilterEvents_data data = { + .callback = (uintptr_t) filter, + .userdata = userdata, + }; + my->SDL_FilterEvents(my_FilterEvents_callback, &data); +} + #undef HAS_MY #define ALTMY my2_ diff --git a/src/wrapped/wrappedsdl2_private.h b/src/wrapped/wrappedsdl2_private.h old mode 100644 new mode 100755 index b3c100c..683f441 --- a/src/wrapped/wrappedsdl2_private.h +++ b/src/wrapped/wrappedsdl2_private.h @@ -11,7 +11,7 @@ GO(SDL_abs, iFi) GO(SDL_acos, dFd) GO(SDL_acosf, fFf) GOM(SDL_AddEventWatch, vFEpp) -// SDL_AddHintCallback +GOM(SDL_AddHintCallback, vFEppp) GOM(SDL_AddTimer, pFEupp) GO(SDL_AllocFormat, pFu) GO(SDL_AllocPalette, pFi) @@ -87,7 +87,7 @@ GO(SDL_CreateWindowAndRenderer, iFiiupp) GO(SDL_CreateWindowFrom, pFp) GO(SDL_Delay, vFu) GOM(SDL_DelEventWatch, vFEpp) -// SDL_DelHintCallback +GOM(SDL_DelHintCallback, vFEppp) GO(SDL_DequeueAudio, uFupu) GO(SDL_DestroyCond, vFp) GO(SDL_DestroyMutex, vFp) @@ -110,7 +110,7 @@ GO(SDL_fabs, dFd) GO(SDL_fabsf, fFf) GO(SDL_FillRect, iFppu) GO(SDL_FillRects, iFppiu) -// SDL_FilterEvents +GOM(SDL_FilterEvents, vFEpp) GO(SDL_floor, dFd) GO(SDL_floorf,fFf) GO(SDL_FlushEvent, vFu) @@ -153,6 +153,7 @@ GO(SDL_GameControllerGetStringForButton, pFi) GO(SDL_GameControllerGetTouchpadFinger, iFpiipppp) GO(SDL_GameControllerGetType, uFp) GO(SDL_GameControllerGetVendor, WFp) +GO(SDL_GameControllerHasAxis, iFpu) GO(SDL_GameControllerHasButton, uFpi) GO(SDL_GameControllerHasLED, iFp) GO(SDL_GameControllerHasRumble, iFp) @@ -188,7 +189,7 @@ GO(SDL_GetClipRect, vFpp) GO(SDL_GetClosestDisplayMode, pFipp) GO(SDL_GetColorKey, iFpp) GO(SDL_GetCPUCacheLineSize, iFv) -GO(SDL_GetCPUCount, iFv) +GOM(SDL_GetCPUCount, iFEv) GO(SDL_GetCurrentAudioDriver, pFv) GO(SDL_GetCurrentDisplayMode, iFip) GO(SDL_GetCurrentVideoDriver, pFv) @@ -483,7 +484,7 @@ GO(SDL_NumHaptics, iFv) GO(SDL_NumJoysticks, iFv) GO(SDL_NumSensors, iFv) GOM(SDL_OpenAudio, iFEpp) -GOM(SDL_OpenAudioDevice, iFEpippi) +GOM(SDL_OpenAudioDevice, uFEpippi) GO(SDL_PauseAudio, vFi) GO(SDL_PauseAudioDevice, vFui) GO(SDL_PeepEvents, iFpiuuu) @@ -532,6 +533,7 @@ GO(SDL_RenderFillRect, iFpp) GO(SDL_RenderFillRects, iFppi) // SDL_RenderFillRectsF // SDL_RenderFlush +GO(SDL_RenderGeometryRaw, iFpppipipiipii) GO(SDL_RenderGetClipRect, vFpp) GO(SDL_RenderGetIntegerScale, iFp) GO(SDL_RenderGetLogicalSize, vFppp) @@ -597,7 +599,7 @@ GO(SDL_SetMainReady, vFv) //GOM(SDL_SetMemoryFunctions, GO(SDL_SetModState, vFu) GO(SDL_SetPaletteColors, iFppii) -// SDL_SetPixelFormatPalette +GO(SDL_SetPixelFormatPalette, iFpp) GO(SDL_SetPrimarySelectionText, iFp) GO(SDL_SetRelativeMouseMode, iFi) GO(SDL_SetRenderDrawBlendMode, iFpu) @@ -624,11 +626,11 @@ GO(SDL_SetWindowGammaRamp, iFpppp) GO(SDL_SetWindowGrab, vFpi) // SDL_SetWindowHitTest GO(SDL_SetWindowIcon, vFpp) -// SDL_SetWindowInputFocus +GO(SDL_SetWindowInputFocus, iFp) GO(SDL_SetWindowMaximumSize, vFpii) GO(SDL_SetWindowMinimumSize, vFpii) -// SDL_SetWindowModalFor -// SDL_SetWindowOpacity +GO(SDL_SetWindowModalFor, iFpp) +GO(SDL_SetWindowOpacity, iFpf) GO(SDL_SetWindowPosition, vFpii) GO(SDL_SetWindowResizable, vFpi) GO(SDL_SetWindowShape, iFppp) @@ -731,8 +733,8 @@ GOM(SDL_WriteU8, uFEpu) GOM(SDL_RWseek, IFEpIi) GOM(SDL_RWtell, IFEp) -GOM(SDL_RWread, uFEppuu) -GOM(SDL_RWwrite, uFEppuu) +GOM(SDL_RWread, LFEppLL) +GOM(SDL_RWwrite, LFEppLL) GOM(SDL_RWclose, iFEp) GO2(SDL_mutexP, iFp, SDL_LockMutex) diff --git a/src/wrapped/wrappedsdl2image.c b/src/wrapped/wrappedsdl2image.c index af45e39..d8ad07b 100644 --- a/src/wrapped/wrappedsdl2image.c +++ b/src/wrapped/wrappedsdl2image.c @@ -47,6 +47,11 @@ GO(IMG_LoadWEBP_RW) GO(IMG_LoadXCF_RW) GO(IMG_LoadXPM_RW) GO(IMG_LoadXV_RW) +GO(IMG_LoadAVIF_RW) +GO(IMG_LoadJXL_RW) +GO(IMG_LoadSVG_RW) +GO(IMG_LoadQOI_RW) +GO(IMG_LoadGIFAnimation_RW) #undef GO EXPORT void *my2_IMG_LoadTyped_RW(x64emu_t* emu, void* a, int32_t b, void* c) @@ -82,6 +87,14 @@ EXPORT int32_t my2_IMG_SavePNG_RW(x64emu_t* emu, void* s, void* a, int32_t b) } return r; } +EXPORT int my2_IMG_SaveJPG_RW(x64emu_t* emu, void* surface, void* dst, int freedst, int quality) +{ + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)dst); + int r = my->IMG_SaveJPG_RW(surface, rw, freedst, quality); + if(freedst==0) + RWNativeEnd2(rw); + return r; +} EXPORT void* my2_IMG_LoadTexture_RW(x64emu_t* emu, void* rend, void* a, int32_t b) { @@ -101,6 +114,32 @@ EXPORT void* my2_IMG_LoadTextureTyped_RW(x64emu_t* emu, void* rend, void* a, int return r; } +EXPORT void* my2_IMG_LoadSizedSVG_RW(x64emu_t* emu, void* src, int width, int height) +{ + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)src); + void* r = my->IMG_LoadSizedSVG_RW(rw, width, height); + RWNativeEnd2(rw); + return r; +} + +EXPORT void* my2_IMG_LoadAnimation_RW(x64emu_t* emu, void* src, int freesrc) +{ + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)src); + void* r = my->IMG_LoadAnimation_RW(rw, freesrc); + if(freesrc==0) + RWNativeEnd2(rw); + return r; +} + +EXPORT void* my2_IMG_LoadAnimationTyped_RW(x64emu_t* emu, void* src, int freesrc, char* type) +{ + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)src); + void* r = my->IMG_LoadAnimationTyped_RW(rw, freesrc, type); + if(freesrc==0) + RWNativeEnd2(rw); + return r; +} + #define ALTMY my2_ #define NEEDED_LIBS "libSDL2-2.0.so.0" diff --git a/src/wrapped/wrappedsdl2image_private.h b/src/wrapped/wrappedsdl2image_private.h index fac7878..f35ce3c 100644 --- a/src/wrapped/wrappedsdl2image_private.h +++ b/src/wrapped/wrappedsdl2image_private.h @@ -25,9 +25,14 @@ GOM(IMG_LoadWEBP_RW,pFEp) GOM(IMG_LoadXCF_RW,pFEp) GOM(IMG_LoadXPM_RW,pFEp) GOM(IMG_LoadXV_RW,pFEp) +GOM(IMG_LoadAVIF_RW, pFEp) +GOM(IMG_LoadJXL_RW, pFEp) +GOM(IMG_LoadQOI_RW, pFEp) +GOM(IMG_LoadGIFAnimation_RW, pFEp) GOM(IMG_Load_RW,pFEpi) GO(IMG_Quit,vFv) GO(IMG_ReadXPMFromArray,pFp) +GO(IMG_ReadXPMFromArrayToRGB888, pFp) GO(IMG_isBMP,iFp) GO(IMG_isCUR,iFp) GO(IMG_isGIF,iFp) @@ -42,12 +47,16 @@ GO(IMG_isWEBP,iFp) GO(IMG_isXCF,iFp) GO(IMG_isXPM,iFp) GO(IMG_isXV,iFp) +GO(IMG_isAVIF, iFp) +GO(IMG_isJXL, iFp) +GO(IMG_isQOI, iFp) // IMG_InitJPG // IMG_InitPNG // IMG_InitTIF // IMG_InitWEBP -// IMG_isSVG -// IMG_LoadSVG_RW +GO(IMG_isSVG, iFp) +GOM(IMG_LoadSVG_RW, pFEp) +GOM(IMG_LoadSizedSVG_RW, pFEpii) GO(IMG_LoadTexture, pFpp) GOM(IMG_LoadTexture_RW, pFEppi) GOM(IMG_LoadTextureTyped_RW, pFEppip) @@ -55,8 +64,8 @@ GOM(IMG_LoadTextureTyped_RW, pFEppip) // IMG_QuitPNG // IMG_QuitTIF // IMG_QuitWEBP -// IMG_SaveJPG -// IMG_SaveJPG_RW +GO(IMG_SaveJPG, iFppi) +GOM(IMG_SaveJPG_RW, iFEppii) GO(IMG_SavePNG, iFpp) GOM(IMG_SavePNG_RW, iFEppi) // _init @@ -67,3 +76,7 @@ DATA(nsvg__colors, 4) // nsvgParse // nsvg__parseXML // nsvgRasterize +GO(IMG_LoadAnimation, pFp) +GOM(IMG_LoadAnimation_RW, pFEpi) +GOM(IMG_LoadAnimationTyped_RW, pFEpip) +GO(IMG_FreeAnimation, vFp) diff --git a/src/wrapped/wrappedsdl2mixer.c b/src/wrapped/wrappedsdl2mixer.c index 4a46215..094c4b4 100644 --- a/src/wrapped/wrappedsdl2mixer.c +++ b/src/wrapped/wrappedsdl2mixer.c @@ -225,6 +225,21 @@ EXPORT int my2_MinorityMix_SetPosition(x64emu_t* emu, int channel, int16_t angle return my->Mix_SetPosition(channel, angle, 0); } +struct my_EachSoundFont_data { + uintptr_t callback; + void *userdata; +}; +static int my_EachSoundFont_callback(const char* a, struct my_EachSoundFont_data* data) { + return (int) RunFunctionFmt(data->callback, "pp", a, data->userdata); +} +EXPORT int my2_Mix_EachSoundFont(x64emu_t* emu, void* callback, void* userdata) { + struct my_EachSoundFont_data data = { + .callback = (uintptr_t) callback, + .userdata = userdata, + }; + return my->Mix_EachSoundFont(my_EachSoundFont_callback, &data); +} + #define ALTMY my2_ #define CUSTOM_INIT \ diff --git a/src/wrapped/wrappedsdl2mixer_private.h b/src/wrapped/wrappedsdl2mixer_private.h index 5b78eec..f85d4a1 100644 --- a/src/wrapped/wrappedsdl2mixer_private.h +++ b/src/wrapped/wrappedsdl2mixer_private.h @@ -11,6 +11,7 @@ GOM(Mix_ChannelFinished, vFEp) GO(Mix_CloseAudio, vFv) // Mix_EachSoundFont GO(Mix_ExpireChannel,iFii) +GO(Mix_FadeInChannel, iFipii) GO(Mix_FadeInChannelTimed,iFipiii) GO(Mix_FadeInMusic,iFpii) GO(Mix_FadeInMusicPos,iFpiid) @@ -26,6 +27,16 @@ GO(Mix_GetChunkDecoder,pFi) GO(Mix_GetMusicDecoder,pFi) GO(Mix_GetMusicHookData,pFv) GO(Mix_GetMusicType, uFp) +GO(Mix_GetMusicTitle, pFp) +GO(Mix_GetMusicTitleTag, pFp) +GO(Mix_GetMusicArtistTag, pFp) +GO(Mix_GetMusicAlbumTag, pFp) +GO(Mix_GetMusicCopyrightTag, pFp) +GO(Mix_GetMusicVolume, iFp) +GO(Mix_GetMusicPosition, dFp) +GO(Mix_GetMusicLoopStartTime, dFp) +GO(Mix_GetMusicLoopEndTime, dFp) +GO(Mix_GetMusicLoopLengthTime, dFp) GO(Mix_GetNumChunkDecoders,iFv) GO(Mix_GetNumMusicDecoders,iFv) GO(Mix_GetSoundFonts,pFv) @@ -39,7 +50,8 @@ GO(Mix_GroupOldest,iFi) GO(Mix_HaltChannel,iFi) GO(Mix_HaltGroup,iFi) GO(Mix_HaltMusic,iFv) -// Mix_HasChunkDecoder +GO(Mix_HasChunkDecoder, iFp) +GO(Mix_HasMusicDecoder, iFp) GOM(Mix_HookMusic, vFEpp) GOM(Mix_HookMusicFinished, vFEp) GO(Mix_Init,iFi) @@ -84,3 +96,9 @@ GOM(Mix_UnregisterEffect, iFEip) GO(Mix_Volume,iFii) GO(Mix_VolumeChunk,iFpi) GO(Mix_VolumeMusic,iFi) +GO(Mix_MasterVolume, iFi) +GO(Mix_ModMusicJumpToOrder, iFi) +GO(Mix_MusicDuration, dFp) +GOM(Mix_EachSoundFont, iFEpp) +GO(Mix_SetTimidityCfg, iFp) +GO(Mix_GetTimidityCfg, pFv) diff --git a/src/wrapped/wrappedselinux.c b/src/wrapped/wrappedselinux.c index 9e58f20..95ed8e0 100644 --- a/src/wrapped/wrappedselinux.c +++ b/src/wrapped/wrappedselinux.c @@ -1,18 +1,268 @@ #include #include +#include #include +#include +#include #define _GNU_SOURCE /* See feature_test_macros(7) */ #include #include "wrappedlibs.h" +#include "debug.h" #include "wrapper.h" #include "bridge.h" #include "librarian/library_private.h" #include "x64emu.h" +#include "callback.h" const char* selinuxName = "libselinux.so.1"; #define LIBNAME selinux -#include "wrappedlib_init.h" +typedef unsigned short security_class_t; + +union selinux_callback { + int (*func_log)(int type, const char* fmt, ...); + int (*func_audit)(void* auditdata, security_class_t cls, char* msgbuf, size_t msgbufsize); + int (*func_validate)(char** ctx); + int (*func_setenforce)(int enforcing); + int (*func_policyload)(int seqno); +}; + +#define SELINUX_CB_LOG 0 +#define SELINUX_CB_AUDIT 1 +#define SELINUX_CB_VALIDATE 2 +#define SELINUX_CB_SETENFORCE 3 +#define SELINUX_CB_POLICYLOAD 4 + +#include "generated/wrappedselinuxtypes.h" +#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// log callback: int (*func_log)(int type, const char* fmt, ...) +#define GO(A) \ +static uintptr_t my_log_fct_##A = 0; \ +static int my_log_##A(int type, const char* fmt, ...) \ +{ \ + va_list args; \ + char buff[1024]; \ + va_start(args, fmt); \ + vsnprintf(buff, sizeof(buff), fmt, args); \ + va_end(args); \ + return (int)RunFunction(my_log_fct_##A, 3, type, "%s", buff); \ +} +SUPER() +#undef GO +static void* find_log_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_log_fct_##A == (uintptr_t)fct) return my_log_##A; + SUPER() + #undef GO + #define GO(A) if(my_log_fct_##A == 0) {my_log_fct_##A = (uintptr_t)fct; return my_log_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for selinux log callback\n"); + return NULL; +} + +// audit callback: int (*func_audit)(void*, security_class_t, char*, size_t) +#define GO(A) \ +static uintptr_t my_audit_fct_##A = 0; \ +static int my_audit_##A(void* auditdata, security_class_t cls, char* msgbuf, size_t msgbufsize) \ +{ \ + return (int)RunFunctionFmt(my_audit_fct_##A, "pWpL", auditdata, cls, msgbuf, msgbufsize); \ +} +SUPER() +#undef GO +static void* find_audit_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_audit_fct_##A == (uintptr_t)fct) return my_audit_##A; + SUPER() + #undef GO + #define GO(A) if(my_audit_fct_##A == 0) {my_audit_fct_##A = (uintptr_t)fct; return my_audit_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for selinux audit callback\n"); + return NULL; +} + +// validate callback: int (*func_validate)(char**) +#define GO(A) \ +static uintptr_t my_validate_fct_##A = 0; \ +static int my_validate_##A(char** ctx) \ +{ \ + return (int)RunFunctionFmt(my_validate_fct_##A, "p", ctx); \ +} +SUPER() +#undef GO +static void* find_validate_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_validate_fct_##A == (uintptr_t)fct) return my_validate_##A; + SUPER() + #undef GO + #define GO(A) if(my_validate_fct_##A == 0) {my_validate_fct_##A = (uintptr_t)fct; return my_validate_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for selinux validate callback\n"); + return NULL; +} + +// setenforce callback: int (*func_setenforce)(int) +#define GO(A) \ +static uintptr_t my_setenforce_fct_##A = 0; \ +static int my_setenforce_##A(int enforcing) \ +{ \ + return (int)RunFunctionFmt(my_setenforce_fct_##A, "i", enforcing); \ +} +SUPER() +#undef GO +static void* find_setenforce_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_setenforce_fct_##A == (uintptr_t)fct) return my_setenforce_##A; + SUPER() + #undef GO + #define GO(A) if(my_setenforce_fct_##A == 0) {my_setenforce_fct_##A = (uintptr_t)fct; return my_setenforce_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for selinux setenforce callback\n"); + return NULL; +} + +// policyload callback: int (*func_policyload)(int) +#define GO(A) \ +static uintptr_t my_policyload_fct_##A = 0; \ +static int my_policyload_##A(int seqno) \ +{ \ + return (int)RunFunctionFmt(my_policyload_fct_##A, "i", seqno); \ +} +SUPER() +#undef GO +static void* find_policyload_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_policyload_fct_##A == (uintptr_t)fct) return my_policyload_##A; + SUPER() + #undef GO + #define GO(A) if(my_policyload_fct_##A == 0) {my_policyload_fct_##A = (uintptr_t)fct; return my_policyload_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for selinux policyload callback\n"); + return NULL; +} +EXPORT void my_selinux_set_callback(x64emu_t* emu, int type, union selinux_callback cb) +{ + (void)emu; + void* cbp = NULL; + switch(type) { + case SELINUX_CB_LOG: + cbp = find_log_Fct((void*)cb.func_log); + break; + case SELINUX_CB_AUDIT: + cbp = find_audit_Fct((void*)cb.func_audit); + break; + case SELINUX_CB_VALIDATE: + cbp = find_validate_Fct((void*)cb.func_validate); + break; + case SELINUX_CB_SETENFORCE: + cbp = find_setenforce_Fct((void*)cb.func_setenforce); + break; + case SELINUX_CB_POLICYLOAD: + cbp = find_policyload_Fct((void*)cb.func_policyload); + break; + default: + break; + } + my->selinux_set_callback(type, cbp); +} + +static void* reverse_setenforce_Fct(void* fct) +{ + if(!fct) return NULL; + if(CheckBridged(my_lib->w.bridge, fct)) + return (void*)CheckBridged(my_lib->w.bridge, fct); + #define GO(A) if(my_setenforce_##A == fct) return (void*)my_setenforce_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(my_lib->w.bridge, iFi, fct, 0, NULL); +} + +static void* reverse_log_Fct(void* fct) +{ + if(!fct) return NULL; + #define GO(A) if(my_log_##A == fct) return (void*)my_log_fct_##A; + SUPER() + #undef GO + return fct; +} + +static void* reverse_audit_Fct(void* fct) +{ + if(!fct) return NULL; + if(CheckBridged(my_lib->w.bridge, fct)) + return (void*)CheckBridged(my_lib->w.bridge, fct); + #define GO(A) if(my_audit_##A == fct) return (void*)my_audit_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(my_lib->w.bridge, iFpipL, fct, 0, NULL); +} + +static void* reverse_validate_Fct(void* fct) +{ + if(!fct) return NULL; + if(CheckBridged(my_lib->w.bridge, fct)) + return (void*)CheckBridged(my_lib->w.bridge, fct); + #define GO(A) if(my_validate_##A == fct) return (void*)my_validate_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(my_lib->w.bridge, iFp, fct, 0, NULL); +} + +static void* reverse_policyload_Fct(void* fct) +{ + if(!fct) return NULL; + if(CheckBridged(my_lib->w.bridge, fct)) + return (void*)CheckBridged(my_lib->w.bridge, fct); + #define GO(A) if(my_policyload_##A == fct) return (void*)my_policyload_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(my_lib->w.bridge, iFi, fct, 0, NULL); +} + +#undef SUPER + +EXPORT void* my_selinux_get_callback(x64emu_t* emu, int type) +{ + (void)emu; + void* fct = my->selinux_get_callback(type); + switch(type) { + case SELINUX_CB_LOG: return reverse_log_Fct(fct); + case SELINUX_CB_AUDIT: return reverse_audit_Fct(fct); + case SELINUX_CB_VALIDATE: return reverse_validate_Fct(fct); + case SELINUX_CB_SETENFORCE: return reverse_setenforce_Fct(fct); + case SELINUX_CB_POLICYLOAD: return reverse_policyload_Fct(fct); + default: return fct; + } +} + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedselinux_private.h b/src/wrapped/wrappedselinux_private.h index 661e5c9..09b4226 100644 --- a/src/wrapped/wrappedselinux_private.h +++ b/src/wrapped/wrappedselinux_private.h @@ -28,19 +28,19 @@ //GO(avc_sid_to_context, //GO(avc_sid_to_context_raw, //GO(checkPasswdAccess, -//GO(context_free, -//GO(context_new, +GO(context_free, vFp) +GO(context_new, pFp) //GO(context_range_get, //GO(context_range_set, //GO(context_role_get, //GO(context_role_set, -//GO(context_str, -//GO(context_type_get, -//GO(context_type_set, +GO(context_str, pFp) +GO(context_type_get, iFpp) +GO(context_type_set, iFpp) //GO(context_user_get, //GO(context_user_set, //DATAB(dir_xattr_list, -//GO(fgetfilecon, +GO(fgetfilecon, iFip) GO(fgetfilecon_raw, iFip) //GO(fini_selinuxmnt, GO(freecon, vFp) @@ -48,7 +48,7 @@ GO(freeconary, vFp) //GO(fsetfilecon, GO(fsetfilecon_raw, iFip) //GO(getcon, -//GO(getcon_raw, +GO(getcon_raw, iFp) //GO(get_default_context, //GO(get_default_context_with_level, //GO(get_default_context_with_role, @@ -56,10 +56,10 @@ GO(fsetfilecon_raw, iFip) //GO(get_default_type, //GO(getexeccon, //GO(getexeccon_raw, -//GO(getfilecon, +GO(getfilecon, iFpp) GO(getfilecon_raw, iFpp) -//GO(getfscreatecon, -//GO(getfscreatecon_raw, +GO(getfscreatecon, iFp) +GO(getfscreatecon_raw, iFp) //GO(getkeycreatecon, //GO(getkeycreatecon_raw, //GO(get_ordered_context_list, @@ -69,7 +69,7 @@ GO(getfilecon_raw, iFpp) //GO(getpidcon, //GO(getpidcon_raw, //GO(getprevcon, -//GO(getprevcon_raw, +GO(getprevcon_raw, iFp) //GO(getseuser, //GO(getseuserbyname, //GO(getsockcreatecon, @@ -95,7 +95,7 @@ GO(lsetfilecon_raw, iFpp) //GO(matchpathcon_index, //GO(matchpathcon_init, //GO(matchpathcon_init_prefix, -//GO(mode_to_security_class, +GO(mode_to_security_class, iFup) //DATAB(myprintf_compat, //GO(print_access_vector, //GO(query_user_context, @@ -116,7 +116,7 @@ GO(lsetfilecon_raw, iFpp) //GO(security_compute_create, //GO(security_compute_create_name, //GO(security_compute_create_name_raw, -//GO(security_compute_create_raw, +GO(security_compute_create_raw, iFpppp) //GO(security_compute_member, //GO(security_compute_member_raw, //GO(security_compute_relabel, @@ -125,11 +125,11 @@ GO(lsetfilecon_raw, iFpp) //GO(security_compute_user_raw, //GO(security_deny_unknown, //GO(security_disable, -//GO(security_get_boolean_active, -//GO(security_get_boolean_names, +GO(security_get_boolean_active, iFp) +GO(security_get_boolean_names, iFpp) //GO(security_get_boolean_pending, //GO(security_get_checkreqprot, -//GO(security_getenforce, +GO(security_getenforce, iFv) //GO(security_get_initial_context, //GO(security_get_initial_context_raw, //GO(security_load_booleans, @@ -137,11 +137,11 @@ GO(lsetfilecon_raw, iFpp) //GO(security_policyvers, //GO(security_reject_unknown, //GO(security_set_boolean, -//GO(security_set_boolean_list, +GO(security_set_boolean_list, iFLpi) //GO(security_setenforce, //GO(security_validatetrans, //GO(security_validatetrans_raw, -//GO(selabel_close, +GO(selabel_close, vFp) //GO(selabel_cmp, //GO(selabel_digest, //GO(selabel_get_digests_all_partial_matches, @@ -149,15 +149,15 @@ GO(lsetfilecon_raw, iFpp) //GO(selabel_lookup, //GO(selabel_lookup_best_match, //GO(selabel_lookup_best_match_raw, -//GO(selabel_lookup_raw, -//GO(selabel_open, +GO(selabel_lookup_raw, iFppp) +GO(selabel_open, pFipL) //GO(selabel_partial_match, //GO(selabel_stats, -//GO(selinux_binary_policy_path, +GO(selinux_binary_policy_path, pFv) //GO(selinux_booleans_path, //GO(selinux_booleans_subs_path, -//GO(selinux_boolean_sub, -//GO(selinux_check_access, +GO(selinux_boolean_sub, pFp) +GO(selinux_check_access, iFppppv) //GO(selinux_check_passwd_access, //GO(selinux_check_securetty_context, //GO(selinux_colors_path, @@ -168,14 +168,14 @@ GO(lsetfilecon_raw, iFpp) //GO(selinux_default_type_path, //GO(selinux_failsafe_context_path, //GO(selinux_file_context_cmp, -//GO(selinux_file_context_homedir_path, -//GO(selinux_file_context_local_path, -//GO(selinux_file_context_path, +GO(selinux_file_context_homedir_path, pFv) +GO(selinux_file_context_local_path, pFv) +GO(selinux_file_context_path, pFv) //GO(selinux_file_context_subs_dist_path, //GO(selinux_file_context_subs_path, //GO(selinux_file_context_verify, //GO(selinuxfs_exists, -//GO(selinux_get_callback, +GOM(selinux_get_callback, pFi) //GO(selinux_getenforcemode, //GO(selinux_getpolicytype, //GO(selinux_homedir_context_path, @@ -185,51 +185,51 @@ GO(lsetfilecon_raw, iFpp) //GO(selinux_media_context_path, //GO(selinux_mkload_policy, //DATAB(selinux_mnt, -//GO(selinux_netfilter_context_path, +GO(selinux_netfilter_context_path, pFv) //GO(selinux_openrc_contexts_path, //GO(selinux_openssh_contexts_path, -//GO(selinux_path, -//GO(selinux_policy_root, +GO(selinux_path, pFv) +GO(selinux_policy_root, pFv) //GO(selinux_raw_context_to_color, //GO(selinux_raw_to_trans_context, //GO(selinux_removable_context_path, //GO(selinux_reset_config, -//GO(selinux_restorecon, -//GO(selinux_restorecon_default_handle, +GO(selinux_restorecon, iFpu) +GO(selinux_restorecon_default_handle, pFv) //GO(selinux_restorecon_set_alt_rootpath, //GO(selinux_restorecon_set_exclude_list, -//GO(selinux_restorecon_set_sehandle, +GO(selinux_restorecon_set_sehandle, vFp) //GO(selinux_restorecon_xattr, //GO(selinux_securetty_types_path, //GO(selinux_sepgsql_context_path, -//GO(selinux_set_callback, +GOM(selinux_set_callback, vFEip) //GO(selinux_set_mapping, -//GO(selinux_set_policy_root, +GO(selinux_set_policy_root, iFp) //GO(selinux_snapperd_contexts_path, -//GO(selinux_status_close, +GO(selinux_status_close, vFv) //GO(selinux_status_deny_unknown, //GO(selinux_status_getenforce, -//GO(selinux_status_open, +GO(selinux_status_open, iFi) //GO(selinux_status_policyload, -//GO(selinux_status_updated, +GO(selinux_status_updated, iFv) //GO(selinux_systemd_contexts_path, //GO(selinux_translations_path, GO(selinux_trans_to_raw_context, iFpp) //GO(selinux_user_contexts_path, -//GO(selinux_usersconf_path, +GO(selinux_usersconf_path, pFv) //GO(selinux_users_path, //GO(selinux_virtual_domain_context_path, //GO(selinux_virtual_image_context_path, //GO(selinux_x_context_path, -//GO(setcon, +GO(setcon, iFp) //GO(setcon_raw, //GO(setexeccon, //GO(setexeccon_raw, -//GO(setexecfilecon, -//GO(setfilecon, +GO(setexecfilecon, iFpp) +GO(setfilecon, iFpp) GO(setfilecon_raw, iFpp) -//GO(setfscreatecon, -//GO(setfscreatecon_raw, +GO(setfscreatecon, iFp) +GO(setfscreatecon_raw, iFp) //GO(setkeycreatecon, //GO(setkeycreatecon_raw, //GO(set_matchpathcon_canoncon, diff --git a/src/wrapped/wrappedtbbbind.c b/src/wrapped/wrappedtbbbind.c index 997438e..ec5a95f 100644 --- a/src/wrapped/wrappedtbbbind.c +++ b/src/wrapped/wrappedtbbbind.c @@ -6,6 +6,7 @@ #include "wrappedlibs.h" +#include "debug.h" #include "wrapper.h" #include "bridge.h" #include "librarian/library_private.h" @@ -37,10 +38,9 @@ EXPORT void my___TBB_internal_deallocate_binding_handler(void* handler) EXPORT void my___TBB_internal_destroy_system_topology() { } -int getNCpu(); EXPORT int my___TBB_internal_get_default_concurrency(int numa_id, int core_type, int max_threads_per_core) { - return getNCpu(); + return box64_sysinfo.box64_ncpu; } EXPORT void my___TBB_internal_restore_affinity(void* handler, int slot) diff --git a/src/wrapped/wrappedtermuxexec_private.h b/src/wrapped/wrappedtermuxexec_private.h index a0ed8e1..4c8e334 100644 --- a/src/wrapped/wrappedtermuxexec_private.h +++ b/src/wrapped/wrappedtermuxexec_private.h @@ -1,4 +1,4 @@ -#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA) && defined(GOS)) +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) #error Meh... #endif diff --git a/src/wrapped/wrappedudev1.c b/src/wrapped/wrappedudev1.c index b16b3a5..fc20efe 100644 --- a/src/wrapped/wrappedudev1.c +++ b/src/wrapped/wrappedudev1.c @@ -35,23 +35,14 @@ GO(3) \ GO(4) // log_fn ... -#ifdef CONVERT_VALIST #define GO(A) \ static uintptr_t my_log_fn_fct_##A = 0; \ -static void my_log_fn_##A(void* udev, int p, void *f, int l, void* fn, void* fmt, x64_va_list_t args) \ +static void my_log_fn_##A(void* udev, int p, void *f, int l, void* fn, void* fmt, va_list args) \ { \ - CONVERT_VALIST(args) \ - RunFunction(my_log_fn_fct_##A, 7, udev, p, f, l, fn, fmt, VARARGS); \ + char buff[1024] = {0}; \ + vsnprintf(buff, 1023, fmt, args); \ + RunFunction(my_log_fn_fct_##A, 7, udev, p, f, l, fn, "%s", buff); \ } -#else -#define GO(A) \ -static uintptr_t my_log_fn_fct_##A = 0; \ -static void my_log_fn_##A(void* udev, int p, void *f, int l, void* fn, void* fmt, x64_va_list_t args) \ -{ \ - CREATE_VALIST_FROM_VALIST(args, thread_get_emu()->scratch); \ - RunFunction(my_log_fn_fct_##A, 7, udev, p, f, l, fn, fmt, VARARGS); \ -} -#endif SUPER() #undef GO static void* find_log_fn_Fct(void* fct) diff --git a/src/wrapped/wrappedudev1_private.h b/src/wrapped/wrappedudev1_private.h index 3a6f1d9..0eb88ce 100644 --- a/src/wrapped/wrappedudev1_private.h +++ b/src/wrapped/wrappedudev1_private.h @@ -1,12 +1,12 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif GO(udev_device_ref, pFp) GO(udev_device_unref, pFp) GO(udev_device_get_udev, pFp) GO(udev_device_new_from_syspath, pFpp) -GO(udev_device_new_from_devnum, pFpCu) +GO(udev_device_new_from_devnum, pFpcU) GO(udev_device_new_from_subsystem_sysname, pFppp) GO(udev_device_new_from_environment, pFp) GO(udev_device_get_parent, pFp) @@ -24,7 +24,7 @@ GO(udev_device_get_properties_list_entry, pFp) GO(udev_device_get_tags_list_entry, pFp) GO(udev_device_get_property_value, pFpp) GO(udev_device_get_driver, pFp) -GO(udev_device_get_devnum, uFp) +GO(udev_device_get_devnum, UFp) GO(udev_device_get_action, pFp) GO(udev_device_get_sysattr_value, pFpp) GO(udev_device_get_sysattr_list_entry, pFp) @@ -69,7 +69,7 @@ GO(udev_new, pFv) GO(udev_ref, pFp) GO(udev_unref, pFp) GO(udev_queue_ref, pFp) -GO(udev_queue_unref, vFp) +GO(udev_queue_unref, pFp) GO(udev_queue_get_udev, pFp) GO(udev_queue_new, pFp) GO(udev_queue_get_kernel_seqnum, UFp) @@ -93,4 +93,4 @@ GO(udev_hwdb_ref, pFp) GO(udev_hwdb_unref, pFp) GO(udev_hwdb_new, pFp) GO(udev_hwdb_get_properties_list_entry, pFppu) -GO(udev_util_encode_string, iFppL) \ No newline at end of file +GO(udev_util_encode_string, iFppL) diff --git a/src/wrapped/wrappedvorbisfile.c b/src/wrapped/wrappedvorbisfile.c index 5ab7a55..4021904 100644 --- a/src/wrapped/wrappedvorbisfile.c +++ b/src/wrapped/wrappedvorbisfile.c @@ -18,11 +18,8 @@ #include "myalign.h" #include "bridge.h" -#ifdef ANDROID - const char* vorbisfileName = "libvorbisfile.so"; -#else - const char* vorbisfileName = "libvorbisfile.so.3"; -#endif +const char* vorbisfileName = "libvorbisfile.so.3"; +#define ALTNAME "libvorbisfile.so" #define LIBNAME vorbisfile @@ -164,10 +161,4 @@ EXPORT int32_t my_ov_test_callbacks(x64emu_t* emu, void* datasource, void* vf, v return ret; } -#ifdef PANDORA -// No really ok, because it will depends on the order of initialisation -#define PRE_INIT \ - vorbisfileName = (box86->sdl1mixerlib || box86->sdl2mixerlib)?vorbisfileNameAlt:vorbisfileNameReg; -#endif - #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedvulkan.c b/src/wrapped/wrappedvulkan.c index 82f137f..7345503 100644 --- a/src/wrapped/wrappedvulkan.c +++ b/src/wrapped/wrappedvulkan.c @@ -16,6 +16,7 @@ #include "librarian.h" #include "callback.h" #include "myalign.h" +#include "build_info.h" //extern char* libvulkan; @@ -28,22 +29,9 @@ typedef void(*vFpUp_t) (void*, uint64_t, void*); #include "generated/wrappedvulkantypes.h" -#define ADDED_STRUCT() \ - void* currentInstance; // track current instance. If using multiple instance, that will be a mess! - #define ADDED_SUPER 1 #include "wrappercallback.h" -static void updateInstance(x64emu_t* emu, vulkan_my_t* my) -{ - void* p; - #define GO(A, W) p = my_context->vkprocaddress(my->currentInstance, #A); if(p) my->A = p; - SUPER() - #undef GO - symbol1_t* s; - kh_foreach_value_ref(emu->context->vkwrappers, s, s->resolved = 0;) -} - void fillVulkanProcWrapper(box64context_t*); void freeVulkanProcWrapper(box64context_t*); @@ -59,7 +47,7 @@ static symbol1_t* getWrappedSymbol(x64emu_t* emu, const char* rname, int warning } if(k==kh_end(emu->context->vkwrappers)) { if(warning) { - printf_dlsym(LOG_DEBUG, "%p\n", NULL); + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", NULL); printf_dlsym(LOG_INFO, "Warning, no wrapper for %s\n", rname); } return NULL; @@ -67,18 +55,17 @@ static symbol1_t* getWrappedSymbol(x64emu_t* emu, const char* rname, int warning return &kh_value(emu->context->vkwrappers, k); } -static void* resolveSymbol(x64emu_t* emu, void* symbol, const char* rname) +static void* resolveSymbol(x64emu_t* emu, void* symbol, void* fnc, const char* rname) { // get wrapper symbol1_t *s = getWrappedSymbol(emu, rname, 1); - if(!s->resolved) { - khint_t k = kh_get(symbolmap, emu->context->vkwrappers, rname); - const char* constname = kh_key(emu->context->vkwrappers, k); - s->addr = AddCheckBridge(emu->context->system, s->w, symbol, 0, constname); - s->resolved = 1; - } + + khint_t k = kh_get(symbolmap, emu->context->vkwrappers, rname); + const char* constname = kh_key(emu->context->vkwrappers, k); + s->addr = AddCheckBridge2(emu->context->system, s->w, symbol, fnc, 0, constname); + void* ret = (void*)s->addr; - printf_dlsym(LOG_DEBUG, "%p (%p)\n", ret, symbol); + printf_dlsym_prefix(0, LOG_DEBUG, "%p (%p)\n", ret, symbol); return ret; } @@ -87,34 +74,34 @@ EXPORT void* my_vkGetDeviceProcAddr(x64emu_t* emu, void* device, void* name) khint_t k; const char* rname = (const char*)name; - printf_dlsym(LOG_DEBUG, "Calling my_vkGetDeviceProcAddr(%p, \"%s\") => ", device, rname); + pFpp_t getprocaddr = getBridgeFnc2((void*)R_RIP); + if(!getprocaddr) getprocaddr=my->vkGetDeviceProcAddr; + + printf_dlsym(LOG_DEBUG, "Calling my_vkGetDeviceProcAddr[%p](%p, \"%s\") => ", getprocaddr, device, rname); if(!emu->context->vkwrappers) fillVulkanProcWrapper(emu->context); - symbol1_t* s = getWrappedSymbol(emu, rname, 0); - if(s && s->resolved) { - void* ret = (void*)s->addr; - printf_dlsym(LOG_DEBUG, "%p (cached)\n", ret); - return ret; - } + k = kh_get(symbolmap, emu->context->vkmymap, rname); int is_my = (k==kh_end(emu->context->vkmymap))?0:1; - void* symbol = my->vkGetDeviceProcAddr(device, name); + void* symbol = getprocaddr(device, name); + void* fnc = NULL; if(symbol && is_my) { // only wrap if symbol exist // try again, by using custom "my_" now... char tmp[200]; strcpy(tmp, "my_"); strcat(tmp, rname); + fnc = symbol; symbol = dlsym(emu->context->box64lib, tmp); // need to update symbol link maybe - #define GO(A, W) if(!strcmp(rname, #A)) my->A = (W)my->vkGetDeviceProcAddr(device, name); + #define GO(A, W) if(!strcmp(rname, #A)) my->A = (W)getprocaddr(device, name); SUPER() #undef GO } if(!symbol) { - printf_dlsym(LOG_DEBUG, "%p\n", NULL); + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", NULL); return NULL; // easy } - return resolveSymbol(emu, symbol, rname); + return resolveSymbol(emu, symbol, fnc, rname); } EXPORT void* my_vkGetInstanceProcAddr(x64emu_t* emu, void* instance, void* name) @@ -122,26 +109,21 @@ EXPORT void* my_vkGetInstanceProcAddr(x64emu_t* emu, void* instance, void* name) khint_t k; const char* rname = (const char*)name; - printf_dlsym(LOG_DEBUG, "Calling my_vkGetInstanceProcAddr(%p, \"%s\") => ", instance, rname); + pFpp_t getprocaddr = getBridgeFnc2((void*)R_RIP); + if(!getprocaddr) getprocaddr=(pFpp_t)my_context->vkprocaddress; + + printf_dlsym(LOG_DEBUG, "Calling my_vkGetInstanceProcAddr[%p](%p, \"%s\") => ", getprocaddr, instance, rname); if(!emu->context->vkwrappers) fillVulkanProcWrapper(emu->context); - if(instance!=my->currentInstance) { - my->currentInstance = instance; - updateInstance(emu, my); - } - symbol1_t* s = getWrappedSymbol(emu, rname, 0); - if(s && s->resolved) { - void* ret = (void*)s->addr; - printf_dlsym(LOG_DEBUG, "%p (cached)\n", ret); - return ret; - } + // check if vkprocaddress is filled, and search for lib and fill it if needed // get proc adress using actual glXGetProcAddress k = kh_get(symbolmap, emu->context->vkmymap, rname); int is_my = (k==kh_end(emu->context->vkmymap))?0:1; - void* symbol = my_context->vkprocaddress(instance, rname); + void* symbol = getprocaddr(instance, (void*)rname); + void* fnc = NULL; if(!symbol) { - printf_dlsym(LOG_DEBUG, "%p\n", NULL); + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", NULL); return NULL; // easy } if(is_my) { @@ -149,13 +131,14 @@ EXPORT void* my_vkGetInstanceProcAddr(x64emu_t* emu, void* instance, void* name) char tmp[200]; strcpy(tmp, "my_"); strcat(tmp, rname); + fnc = symbol; symbol = dlsym(emu->context->box64lib, tmp); // need to update symbol link maybe - #define GO(A, W) if(!strcmp(rname, #A)) my->A = (W)my_context->vkprocaddress(instance, rname);; + #define GO(A, W) if(!strcmp(rname, #A)) my->A = (W)getprocaddr(instance, (void*)rname);; SUPER() #undef GO } - return resolveSymbol(emu, symbol, rname); + return resolveSymbol(emu, symbol, fnc, rname); } void* my_GetVkProcAddr(x64emu_t* emu, void* name, void*(*getaddr)(const char*)) @@ -166,35 +149,64 @@ void* my_GetVkProcAddr(x64emu_t* emu, void* name, void*(*getaddr)(const char*)) printf_dlsym(LOG_DEBUG, "Calling my_GetVkProcAddr(\"%s\", %p) => ", rname, getaddr); if(!emu->context->vkwrappers) fillVulkanProcWrapper(emu->context); - symbol1_t* s = getWrappedSymbol(emu, rname, 0); - if(s && s->resolved) { - void* ret = (void*)s->addr; - printf_dlsym(LOG_DEBUG, "%p (cached)\n", ret); - return ret; - } + // check if vkprocaddress is filled, and search for lib and fill it if needed // get proc adress using actual glXGetProcAddress k = kh_get(symbolmap, emu->context->vkmymap, rname); int is_my = (k==kh_end(emu->context->vkmymap))?0:1; void* symbol = getaddr(rname); if(!symbol) { - printf_dlsym(LOG_DEBUG, "%p\n", NULL); + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", NULL); return NULL; // easy } + void* fnc = NULL; if(is_my) { // try again, by using custom "my_" now... char tmp[200]; strcpy(tmp, "my_"); strcat(tmp, rname); + fnc = symbol; symbol = dlsym(emu->context->box64lib, tmp); // need to update symbol link maybe #define GO(A, W) if(!strcmp(rname, #A)) my->A = (W)getaddr(rname); SUPER() #undef GO } - return resolveSymbol(emu, symbol, rname); + return resolveSymbol(emu, symbol, fnc, rname); } +void* my_GetVkProcAddr2(x64emu_t* emu, void* a, void* name, void*(*getaddr)(void* a, const char*)) +{ + khint_t k; + const char* rname = (const char*)name; + + printf_dlsym(LOG_DEBUG, "Calling my_GetVkProcAddr2(%p, \"%s\", %p) => ", a, rname, getaddr); + if(!emu->context->vkwrappers) + fillVulkanProcWrapper(emu->context); + + // get proc adress using actual glXGetProcAddress + k = kh_get(symbolmap, emu->context->vkmymap, rname); + int is_my = (k==kh_end(emu->context->vkmymap))?0:1; + void* symbol = getaddr(a, rname); + if(!symbol) { + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", NULL); + return NULL; // easy + } + void* fnc = NULL; + if(is_my) { + // try again, by using custom "my_" now... + char tmp[200]; + strcpy(tmp, "my_"); + strcat(tmp, rname); + fnc = symbol; + symbol = dlsym(emu->context->box64lib, tmp); + // need to update symbol link maybe + #define GO(A, W) if(!strcmp(rname, #A)) my->A = (W)getaddr(a, rname); + SUPER() + #undef GO + } + return resolveSymbol(emu, symbol, fnc, rname); +} #undef SUPER @@ -233,6 +245,18 @@ typedef struct my_VkXcbSurfaceCreateInfoKHR_s { int window; } my_VkXcbSurfaceCreateInfoKHR_t; +#define VK_MAX_DRIVER_NAME_SIZE 256 +#define VK_MAX_DRIVER_INFO_SIZE 256 + +typedef struct my_VkPhysicalDeviceVulkan12Properties_s { + int sType; + void* pNext; + int driverID; + char driverName[VK_MAX_DRIVER_NAME_SIZE]; + char driverInfo[VK_MAX_DRIVER_INFO_SIZE]; + uint32_t __others[49]; +} my_VkPhysicalDeviceVulkan12Properties_t; + typedef struct my_VkStruct_s { int sType; struct my_VkStruct_s* pNext; @@ -404,8 +428,8 @@ static void* find_DebugUtilsMessengerCallback_Fct(void* fct) //#define PRE_INIT if(libGL) {lib->w.lib = dlopen(libGL, RTLD_LAZY | RTLD_GLOBAL); lib->path = box_strdup(libGL);} else -#define PRE_INIT \ - if(box64_novulkan) \ +#define PRE_INIT \ + if(BOX64ENV(novulkan)) \ return -1; #define CUSTOM_INIT \ @@ -472,19 +496,33 @@ my_VkAllocationCallbacks_t* find_VkAllocationCallbacks(my_VkAllocationCallbacks_ EXPORT int my_##A(x64emu_t* emu, void* device, void* pAllocateInfo, my_VkAllocationCallbacks_t* pAllocator, void* p) \ { \ my_VkAllocationCallbacks_t my_alloc; \ - return my->A(device, pAllocateInfo, find_VkAllocationCallbacks(&my_alloc, pAllocator), p); \ + iFpppp_t fnc = getBridgeFnc2((void*)R_RIP); \ + if(!fnc) fnc=my->A; \ + return fnc(device, pAllocateInfo, find_VkAllocationCallbacks(&my_alloc, pAllocator), p); \ } #define DESTROY(A) \ EXPORT void my_##A(x64emu_t* emu, void* device, void* p, my_VkAllocationCallbacks_t* pAllocator) \ { \ my_VkAllocationCallbacks_t my_alloc; \ - my->A(device, p, find_VkAllocationCallbacks(&my_alloc, pAllocator)); \ + vFppp_t fnc = getBridgeFnc2((void*)R_RIP); \ + if(!fnc) fnc=my->A; \ + fnc(device, p, find_VkAllocationCallbacks(&my_alloc, pAllocator)); \ +} +#define IDESTROY(A) \ +EXPORT int my_##A(x64emu_t* emu, void* device, void* p, my_VkAllocationCallbacks_t* pAllocator) \ +{ \ + my_VkAllocationCallbacks_t my_alloc; \ + iFppp_t fnc = getBridgeFnc2((void*)R_RIP); \ + if(!fnc) fnc=my->A; \ + return fnc(device, p, find_VkAllocationCallbacks(&my_alloc, pAllocator)); \ } #define DESTROY64(A) \ EXPORT void my_##A(x64emu_t* emu, void* device, uint64_t p, my_VkAllocationCallbacks_t* pAllocator) \ { \ my_VkAllocationCallbacks_t my_alloc; \ - my->A(device, p, find_VkAllocationCallbacks(&my_alloc, pAllocator)); \ + vFpUp_t fnc = getBridgeFnc2((void*)R_RIP); \ + if(!fnc) fnc=my->A; \ + fnc(device, p, find_VkAllocationCallbacks(&my_alloc, pAllocator)); \ } CREATE(vkAllocateMemory) @@ -495,7 +533,9 @@ CREATE(vkCreateCommandPool) EXPORT int my_vkCreateComputePipelines(x64emu_t* emu, void* device, uint64_t pipelineCache, uint32_t count, void* pCreateInfos, my_VkAllocationCallbacks_t* pAllocator, void* pPipelines) { my_VkAllocationCallbacks_t my_alloc; - int ret = my->vkCreateComputePipelines(device, pipelineCache, count, pCreateInfos, find_VkAllocationCallbacks(&my_alloc, pAllocator), pPipelines); + iFpUuppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateComputePipelines; + int ret = fnc(device, pipelineCache, count, pCreateInfos, find_VkAllocationCallbacks(&my_alloc, pAllocator), pPipelines); return ret; } @@ -508,7 +548,9 @@ CREATE(vkCreateDevice) EXPORT int my_vkCreateDisplayModeKHR(x64emu_t* emu, void* physical, uint64_t display, void* pCreateInfo, my_VkAllocationCallbacks_t* pAllocator, void* pMode) { my_VkAllocationCallbacks_t my_alloc; - return my->vkCreateDisplayModeKHR(physical, display, pCreateInfo, find_VkAllocationCallbacks(&my_alloc, pAllocator), pMode); + iFpUppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateDisplayModeKHR; + return fnc(physical, display, pCreateInfo, find_VkAllocationCallbacks(&my_alloc, pAllocator), pMode); } CREATE(vkCreateDisplayPlaneSurfaceKHR) @@ -519,7 +561,9 @@ CREATE(vkCreateFramebuffer) EXPORT int my_vkCreateGraphicsPipelines(x64emu_t* emu, void* device, uint64_t pipelineCache, uint32_t count, void* pCreateInfos, my_VkAllocationCallbacks_t* pAllocator, void* pPipelines) { my_VkAllocationCallbacks_t my_alloc; - int ret = my->vkCreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, find_VkAllocationCallbacks(&my_alloc, pAllocator), pPipelines); + iFpUuppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateGraphicsPipelines; + int ret = fnc(device, pipelineCache, count, pCreateInfos, find_VkAllocationCallbacks(&my_alloc, pAllocator), pPipelines); return ret; } @@ -530,6 +574,8 @@ CREATE(vkCreateImageView) #define VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT 1000128004 EXPORT int my_vkCreateInstance(x64emu_t* emu, void* pCreateInfos, my_VkAllocationCallbacks_t* pAllocator, void* pInstance) { + iFppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateInstance; my_VkAllocationCallbacks_t my_alloc; my_VkStruct_t *p = (my_VkStruct_t*)pCreateInfos; void* old[20] = {0}; @@ -548,7 +594,7 @@ EXPORT int my_vkCreateInstance(x64emu_t* emu, void* pCreateInfos, my_VkAllocatio } p = p->pNext; } - int ret = my->vkCreateInstance(pCreateInfos, find_VkAllocationCallbacks(&my_alloc, pAllocator), pInstance); + int ret = fnc(pCreateInfos, find_VkAllocationCallbacks(&my_alloc, pAllocator), pInstance); if(old_i) {// restore, just in case it's re-used? p = (my_VkStruct_t*)pCreateInfos; old_i = 0; @@ -579,8 +625,10 @@ CREATE(vkCreateShaderModule) EXPORT int my_vkCreateSharedSwapchainsKHR(x64emu_t* emu, void* device, uint32_t count, void** pCreateInfos, my_VkAllocationCallbacks_t* pAllocator, void* pSwapchains) { + iFpuppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateSharedSwapchainsKHR; my_VkAllocationCallbacks_t my_alloc; - int ret = my->vkCreateSharedSwapchainsKHR(device, count, pCreateInfos, find_VkAllocationCallbacks(&my_alloc, pAllocator), pSwapchains); + int ret = fnc(device, count, pCreateInfos, find_VkAllocationCallbacks(&my_alloc, pAllocator), pSwapchains); return ret; } @@ -588,11 +636,13 @@ CREATE(vkCreateSwapchainKHR) CREATE(vkCreateWaylandSurfaceKHR) EXPORT int my_vkCreateXcbSurfaceKHR(x64emu_t* emu, void* instance, void* info, my_VkAllocationCallbacks_t* pAllocator, void* pFence) { + iFpppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateXcbSurfaceKHR; my_VkAllocationCallbacks_t my_alloc; my_VkXcbSurfaceCreateInfoKHR_t* surfaceinfo = info; void* old_conn = surfaceinfo->connection; surfaceinfo->connection = align_xcb_connection(old_conn); - int ret = my->vkCreateXcbSurfaceKHR(instance, info, find_VkAllocationCallbacks(&my_alloc, pAllocator), pFence); + int ret = fnc(instance, info, find_VkAllocationCallbacks(&my_alloc, pAllocator), pFence); surfaceinfo->connection = old_conn; return ret; } @@ -603,28 +653,36 @@ CREATE(vkCreateRenderPass2KHR) EXPORT int my_vkRegisterDeviceEventEXT(x64emu_t* emu, void* device, void* info, my_VkAllocationCallbacks_t* pAllocator, void* pFence) { + iFpppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkRegisterDeviceEventEXT; my_VkAllocationCallbacks_t my_alloc; - return my->vkRegisterDeviceEventEXT(device, info, find_VkAllocationCallbacks(&my_alloc, pAllocator), pFence); + return fnc(device, info, find_VkAllocationCallbacks(&my_alloc, pAllocator), pFence); } EXPORT int my_vkRegisterDisplayEventEXT(x64emu_t* emu, void* device, uint64_t disp, void* info, my_VkAllocationCallbacks_t* pAllocator, void* pFence) { + iFpUppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkRegisterDisplayEventEXT; my_VkAllocationCallbacks_t my_alloc; - return my->vkRegisterDisplayEventEXT(device, disp, info, find_VkAllocationCallbacks(&my_alloc, pAllocator), pFence); + return fnc(device, disp, info, find_VkAllocationCallbacks(&my_alloc, pAllocator), pFence); } CREATE(vkCreateValidationCacheEXT) EXPORT int my_vkCreateShadersEXT(x64emu_t* emu, void* device, uint32_t count, void** pCreateInfos, my_VkAllocationCallbacks_t* pAllocator, void* pShaders) { + iFpuppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateShadersEXT; my_VkAllocationCallbacks_t my_alloc; - int ret = my->vkCreateShadersEXT(device, count, pCreateInfos, find_VkAllocationCallbacks(&my_alloc, pAllocator), pShaders); + int ret = fnc(device, count, pCreateInfos, find_VkAllocationCallbacks(&my_alloc, pAllocator), pShaders); return ret; } EXPORT int my_vkCreateExecutionGraphPipelinesAMDX(x64emu_t* emu, void* device, uint64_t pipelineCache, uint32_t count, void** pCreateInfos, my_VkAllocationCallbacks_t* pAllocator, void* pPipeLines) { + iFpUuppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateExecutionGraphPipelinesAMDX; my_VkAllocationCallbacks_t my_alloc; - int ret = my->vkCreateExecutionGraphPipelinesAMDX(device, pipelineCache, count, pCreateInfos, find_VkAllocationCallbacks(&my_alloc, pAllocator), pPipeLines); + int ret = fnc(device, pipelineCache, count, pCreateInfos, find_VkAllocationCallbacks(&my_alloc, pAllocator), pPipeLines); return ret; } @@ -641,8 +699,10 @@ DESTROY64(vkDestroyDescriptorUpdateTemplateKHR) EXPORT void my_vkDestroyDevice(x64emu_t* emu, void* pDevice, my_VkAllocationCallbacks_t* pAllocator) { + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkDestroyDevice; my_VkAllocationCallbacks_t my_alloc; - my->vkDestroyDevice(pDevice, find_VkAllocationCallbacks(&my_alloc, pAllocator)); + fnc(pDevice, find_VkAllocationCallbacks(&my_alloc, pAllocator)); } DESTROY64(vkDestroyEvent) @@ -653,8 +713,10 @@ DESTROY64(vkDestroyImageView) EXPORT void my_vkDestroyInstance(x64emu_t* emu, void* instance, my_VkAllocationCallbacks_t* pAllocator) { + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkDestroyInstance; my_VkAllocationCallbacks_t my_alloc; - my->vkDestroyInstance(instance, find_VkAllocationCallbacks(&my_alloc, pAllocator)); + fnc(instance, find_VkAllocationCallbacks(&my_alloc, pAllocator)); } DESTROY64(vkDestroyPipeline) @@ -672,6 +734,8 @@ DESTROY64(vkFreeMemory) EXPORT int my_vkCreateDebugUtilsMessengerEXT(x64emu_t* emu, void* device, my_VkDebugUtilsMessengerCreateInfoEXT_t* pAllocateInfo, my_VkAllocationCallbacks_t* pAllocator, void* p) { + iFpppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateDebugUtilsMessengerEXT; #define VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT 1000128004 my_VkAllocationCallbacks_t my_alloc; my_VkDebugUtilsMessengerCreateInfoEXT_t* info = pAllocateInfo; @@ -679,12 +743,13 @@ EXPORT int my_vkCreateDebugUtilsMessengerEXT(x64emu_t* emu, void* device, my_VkD info->pfnUserCallback = find_DebugUtilsMessengerCallback_Fct(info->pfnUserCallback); info = (my_VkDebugUtilsMessengerCreateInfoEXT_t*)info->pNext; } - return my->vkCreateDebugUtilsMessengerEXT(device, pAllocateInfo, find_VkAllocationCallbacks(&my_alloc, pAllocator), p); + return fnc(device, pAllocateInfo, find_VkAllocationCallbacks(&my_alloc, pAllocator), p); } DESTROY(vkDestroyDebugUtilsMessengerEXT) DESTROY64(vkDestroySurfaceKHR) +CREATE(vkCreateSamplerYcbcrConversionKHR) DESTROY64(vkDestroySamplerYcbcrConversionKHR) DESTROY64(vkDestroyValidationCacheEXT) @@ -704,15 +769,19 @@ DESTROY64(vkDestroyAccelerationStructureKHR) EXPORT int my_vkCreateDeferredOperationKHR(x64emu_t* emu, void* device, my_VkAllocationCallbacks_t* pAllocator, void* p) { + iFppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateDeferredOperationKHR; my_VkAllocationCallbacks_t my_alloc; - return my->vkCreateDeferredOperationKHR(device, find_VkAllocationCallbacks(&my_alloc, pAllocator), p); + return fnc(device, find_VkAllocationCallbacks(&my_alloc, pAllocator), p); } DESTROY64(vkDestroyDeferredOperationKHR) EXPORT int my_vkCreateRayTracingPipelinesKHR(x64emu_t* emu, void* device, uint64_t op, uint64_t pipeline, uint32_t count, void* infos, my_VkAllocationCallbacks_t* pAllocator, void* p) { + iFpUUuppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateRayTracingPipelinesKHR; my_VkAllocationCallbacks_t my_alloc; - return my->vkCreateRayTracingPipelinesKHR(device, op, pipeline, count, infos, find_VkAllocationCallbacks(&my_alloc, pAllocator), p); + return fnc(device, op, pipeline, count, infos, find_VkAllocationCallbacks(&my_alloc, pAllocator), p); } CREATE(vkCreateCuFunctionNVX) @@ -726,8 +795,10 @@ DESTROY64(vkDestroyIndirectCommandsLayoutNV) CREATE(vkCreateAccelerationStructureNV) EXPORT int my_vkCreateRayTracingPipelinesNV(x64emu_t* emu, void* device, uint64_t pipeline, uint32_t count, void* infos, my_VkAllocationCallbacks_t* pAllocator, void* p) { + iFpUuppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateRayTracingPipelinesNV; my_VkAllocationCallbacks_t my_alloc; - return my->vkCreateRayTracingPipelinesNV(device, pipeline, count, infos, find_VkAllocationCallbacks(&my_alloc, pAllocator), p); + return fnc(device, pipeline, count, infos, find_VkAllocationCallbacks(&my_alloc, pAllocator), p); } DESTROY64(vkDestroyAccelerationStructureNV) @@ -743,58 +814,70 @@ CREATE(vkCreateCudaModuleNV) DESTROY64(vkDestroyCudaFunctionNV) DESTROY64(vkDestroyCudaModuleNV) -EXPORT void my_vkGetPhysicalDeviceProperties(x64emu_t* emu, void* device, void* pProps) -{ - my->vkGetPhysicalDeviceProperties(device, pProps); -} - -EXPORT void my_vkGetPhysicalDeviceSparseImageFormatProperties(x64emu_t* emu, void* device, int format, int type, int samples, uint32_t usage, int tiling, uint32_t* count, void** pProps) +EXPORT int my_vkCreateDebugReportCallbackEXT(x64emu_t* emu, void* instance, + my_VkDebugReportCallbackCreateInfoEXT_t* create, + my_VkAllocationCallbacks_t* alloc, void* callback) { - my->vkGetPhysicalDeviceSparseImageFormatProperties(device, format, type, samples, usage, tiling, count, pProps); + iFpppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateDebugReportCallbackEXT; + my_VkDebugReportCallbackCreateInfoEXT_t dbg = *create; + my_VkAllocationCallbacks_t my_alloc; + dbg.pfnCallback = find_DebugReportCallbackEXT_Fct(dbg.pfnCallback); + return fnc(instance, &dbg, find_VkAllocationCallbacks(&my_alloc, alloc), callback); } -EXPORT void my_vkUpdateDescriptorSets(x64emu_t* emu, void* device, uint32_t writeCount, void* writeSet, uint32_t copyCount, void* copySet) +EXPORT void my_vkDestroyDebugReportCallbackEXT(x64emu_t* emu, void* instance, void* callback, void* alloc) { - my->vkUpdateDescriptorSets(device, writeCount, writeSet, copyCount, copySet); + vFppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkDestroyDebugReportCallbackEXT; + my_VkAllocationCallbacks_t my_alloc; + fnc(instance, callback, find_VkAllocationCallbacks(&my_alloc, alloc)); } -EXPORT int my_vkGetDisplayPlaneCapabilitiesKHR(x64emu_t* emu, void* device, uint64_t mode, uint32_t index, void* pCap) -{ - int ret = my->vkGetDisplayPlaneCapabilitiesKHR(device, mode, index, pCap); - return ret; -} +CREATE(vkCreateHeadlessSurfaceEXT) -EXPORT int my_vkGetPhysicalDeviceDisplayPropertiesKHR(x64emu_t* emu, void* device, uint32_t* count, void* pProp) -{ - int ret = my->vkGetPhysicalDeviceDisplayPropertiesKHR(device, count, pProp); - return ret; +EXPORT void my_vkGetPhysicalDeviceProperties2(x64emu_t* emu, void* device, void* pProps) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkGetPhysicalDeviceProperties2; + fnc(device, pProps); + my_VkStruct_t *p = pProps; + while (p != NULL) { + // find VkPhysicalDeviceVulkan12Properties + // VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES = 52 + if(p->sType == 52) { + my_VkPhysicalDeviceVulkan12Properties_t *pp = (my_VkPhysicalDeviceVulkan12Properties_t*)p; + strncat(pp->driverInfo, " with " BOX64_BUILD_INFO_STRING, VK_MAX_DRIVER_INFO_SIZE - strlen(pp->driverInfo) - 1); + break; + } + p = p->pNext; + } } -EXPORT void my_vkGetPhysicalDeviceMemoryProperties(x64emu_t* emu, void* device, void* pProps) -{ - my->vkGetPhysicalDeviceMemoryProperties(device, pProps); -} +CREATE(vkCreateIndirectCommandsLayoutEXT) +CREATE(vkCreateIndirectExecutionSetEXT) +DESTROY64(vkDestroyIndirectCommandsLayoutEXT) +DESTROY64(vkDestroyIndirectExecutionSetEXT) -EXPORT void my_vkCmdPipelineBarrier(x64emu_t* emu, void* device, uint32_t src, uint32_t dst, uint32_t dep, - uint32_t barrierCount, void* pBarriers, uint32_t bufferCount, void* pBuffers, uint32_t imageCount, void* pImages) -{ - my->vkCmdPipelineBarrier(device, src, dst, dep, barrierCount, pBarriers, bufferCount, pBuffers, imageCount, pImages); -} +CREATE(vkCreatePipelineBinariesKHR) +DESTROY64(vkDestroyPipelineBinaryKHR) +IDESTROY(vkReleaseCapturedPipelineDataKHR) -EXPORT int my_vkCreateDebugReportCallbackEXT(x64emu_t* emu, void* instance, - my_VkDebugReportCallbackCreateInfoEXT_t* create, - my_VkAllocationCallbacks_t* alloc, void* callback) -{ - my_VkDebugReportCallbackCreateInfoEXT_t dbg = *create; - my_VkAllocationCallbacks_t my_alloc; - dbg.pfnCallback = find_DebugReportCallbackEXT_Fct(dbg.pfnCallback); - return my->vkCreateDebugReportCallbackEXT(instance, &dbg, find_VkAllocationCallbacks(&my_alloc, alloc), callback); -} +CREATE(vkCreateTensorARM) +CREATE(vkCreateTensorViewARM) +DESTROY64(vkDestroyTensorARM) +DESTROY64(vkDestroyTensorViewARM) -EXPORT void my_vkDestroyDebugReportCallbackEXT(x64emu_t* emu, void* instance, void* callback, void* alloc) +CREATE(vkCreateDataGraphPipelineSessionARM) +EXPORT int my_vkCreateDataGraphPipelinesARM(x64emu_t* emu, void* device, uint64_t deferredOperation, uint64_t pipelineCache, + uint32_t createInfoCount, void* pCreateInfos, + my_VkAllocationCallbacks_t* alloc, void* pPipelines) { + iFpUUuppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->vkCreateDataGraphPipelinesARM; my_VkAllocationCallbacks_t my_alloc; - my->vkDestroyDebugReportCallbackEXT(instance, callback, find_VkAllocationCallbacks(&my_alloc, alloc)); + return fnc(device, deferredOperation, pipelineCache, createInfoCount, pCreateInfos, find_VkAllocationCallbacks(&my_alloc, alloc), pPipelines); } +DESTROY64(vkDestroyDataGraphPipelineSessionARM) -CREATE(vkCreateHeadlessSurfaceEXT) +CREATE(vkCreateWin32SurfaceKHR) \ No newline at end of file diff --git a/src/wrapped/wrappedvulkan_private.h b/src/wrapped/wrappedvulkan_private.h index 436ee0d..1a14c89 100644 --- a/src/wrapped/wrappedvulkan_private.h +++ b/src/wrapped/wrappedvulkan_private.h @@ -70,7 +70,7 @@ GO(vkCmdEndRenderPass, vFp) GO(vkCmdExecuteCommands, vFpup) GO(vkCmdFillBuffer, vFpUUUu) GO(vkCmdNextSubpass, vFpi) -GOM(vkCmdPipelineBarrier, vFEpuuuupupup) +GO(vkCmdPipelineBarrier, vFpuuuupupup) GO(vkCmdPushConstants, vFpUuuup) GO(vkCmdResetEvent, vFpUu) GO(vkCmdResetQueryPool, vFpUuu) @@ -139,7 +139,7 @@ GO(vkEnumeratePhysicalDevices, iFppp) GO(vkFlushMappedMemoryRanges, iFpup) // should wrap the array of VkMappedMemoryRange GO(vkFreeCommandBuffers, vFpUup) GO(vkFreeDescriptorSets, iFpUup) -GOM(vkFreeMemory, iFEpUp) +GOM(vkFreeMemory, vFEpUp) GO(vkGetBufferMemoryRequirements, vFpUp) GO(vkGetDeviceMemoryCommitment, vFpUp) GOM(vkGetDeviceProcAddr, pFEpp) @@ -153,10 +153,10 @@ GOM(vkGetInstanceProcAddr, pFEpp) GO(vkGetPhysicalDeviceFeatures, vFpp) GO(vkGetPhysicalDeviceFormatProperties, vFpip) GO(vkGetPhysicalDeviceImageFormatProperties, iFpiiiuup) // VkImageFormatProperties sems OK -GOM(vkGetPhysicalDeviceMemoryProperties, vFEpp) -GOM(vkGetPhysicalDeviceProperties, vFEpp) +GO(vkGetPhysicalDeviceMemoryProperties, vFpp) +GO(vkGetPhysicalDeviceProperties, vFpp) GO(vkGetPhysicalDeviceQueueFamilyProperties, vFppp) //VkQueueFamilyProperties is OK -GOM(vkGetPhysicalDeviceSparseImageFormatProperties, vFEpiiiuipp) +GO(vkGetPhysicalDeviceSparseImageFormatProperties, vFpiiiuipp) GO(vkGetPipelineCacheData, iFpUpp) GO(vkGetQueryPoolResults, iFpUuuLpUu) GO(vkGetRenderAreaGranularity, vFpUp) @@ -173,7 +173,7 @@ GO(vkResetEvent, iFpU) GO(vkResetFences, iFpup) GO(vkSetEvent, iFpU) GO(vkUnmapMemory, vFpU) -GOM(vkUpdateDescriptorSets, vFEpupup) +GO(vkUpdateDescriptorSets, vFpupup) GO(vkWaitForFences, iFpupuU) // VK_VERSION_1_1 @@ -200,7 +200,7 @@ GO(vkGetPhysicalDeviceFeatures2, vFpp) GO(vkGetPhysicalDeviceFormatProperties2, vFpip) GO(vkGetPhysicalDeviceImageFormatProperties2, iFppp) GO(vkGetPhysicalDeviceMemoryProperties2, vFpp) -GO(vkGetPhysicalDeviceProperties2, vFpp) +GOM(vkGetPhysicalDeviceProperties2, vFEpp) GO(vkGetPhysicalDeviceQueueFamilyProperties2, vFppp) //VkQueueFamilyProperties2 seems OK GO(vkGetPhysicalDeviceSparseImageFormatProperties2, vFpppp) //VkSparseImageFormatProperties2 seems OK GO(vkGetPhysicalDeviceToolProperties, iFppp) @@ -262,6 +262,27 @@ GO(vkCmdSetStencilOp, vFpuiiii) GO(vkCmdSetStencilTestEnable, vFpu) GO(vkCmdSetViewportWithCount, vFpup) +// VK_VERSION_1_4 +GO(vkCmdBindDescriptorSets2, vFpp) +GO(vkCmdBindIndexBuffer2, vFpUUUi) +GO(vkCmdPushConstants2, vFpp) +GO(vkCmdPushDescriptorSet, vFpiUuup) +GO(vkCmdPushDescriptorSet2,vFpp) +GO(vkCmdPushDescriptorSetWithTemplate, vFpUUup) +GO(vkCmdPushDescriptorSetWithTemplate2, vFpp) +GO(vkCmdSetLineStipple, vFpuW) +GO(vkCmdSetRenderingAttachmentLocations, vFpp) +GO(vkCmdSetRenderingInputAttachmentIndices, vFpp) +GO(vkCopyImageToImage, iFpp) +GO(vkCopyImageToMemory, iFpp) +GO(vkCopyMemoryToImage, iFpp) +GO(vkGetDeviceImageSubresourceLayout, vFppp) +GO(vkGetImageSubresourceLayout2, vFpUpp) +GO(vkGetRenderingAreaGranularity, vFppp) +GO(vkMapMemory2, iFppp) +GO(vkTransitionImageLayout, iFpup) +GO(vkUnmapMemory2, iFpp) + // VK_EXT_debug_report GOM(vkCreateDebugReportCallbackEXT, iFEpppp) GO(vkDebugReportMessageEXT, vFpuiULipp) @@ -333,10 +354,10 @@ GO(vkBindImageMemory2KHR, iFpup) GOM(vkCreateDisplayModeKHR, iFEpUppp) GOM(vkCreateDisplayPlaneSurfaceKHR, iFEpppp) GO(vkGetDisplayModePropertiesKHR, iFpUpp) //VkDisplayModePropertiesKHR seems OK -GOM(vkGetDisplayPlaneCapabilitiesKHR, iFEpUup) +GO(vkGetDisplayPlaneCapabilitiesKHR, iFpUup) GO(vkGetDisplayPlaneSupportedDisplaysKHR, iFpupp) GO(vkGetPhysicalDeviceDisplayPlanePropertiesKHR, iFppp) //VkDisplayPlanePropertiesKHR is OK -GOM(vkGetPhysicalDeviceDisplayPropertiesKHR, iFEppp) +GO(vkGetPhysicalDeviceDisplayPropertiesKHR, iFppp) // VK_KHR_descriptor_update_template GOM(vkCreateDescriptorUpdateTemplateKHR, iFEpppp) @@ -458,6 +479,11 @@ GO(vkReleaseProfilingLockKHR, vFp) // VK_NV_cooperative_matrix GO(vkGetPhysicalDeviceCooperativeMatrixPropertiesNV, iFppp) +// VK_NV_cooperative_vector +GO(vkCmdConvertCooperativeVectorMatrixNV, vFpup) +GO(vkConvertCooperativeVectorMatrixNV, iFpp) +GO(vkGetPhysicalDeviceCooperativeVectorPropertiesNV, iFppp) + // VK_KHR_fragment_shading_rate GO(vkCmdSetFragmentShadingRateKHR, vFppp) GO(vkGetPhysicalDeviceFragmentShadingRatesKHR, iFppp) @@ -701,6 +727,9 @@ GO(vkGetPipelineExecutableStatisticsKHR, iFpppp) // VK_KHR_present_wait GO(vkWaitForPresentKHR, iFpUUU) +// VK_KHR_present_wait2 +GO(vkWaitForPresent2KHR, iFpUp) + // VK_KHR_ray_tracing_pipeline GO(vkCmdSetRayTracingPipelineStackSizeKHR, vFpu) GO(vkCmdTraceRaysIndirectKHR, vFpppppU) @@ -737,6 +766,7 @@ GOM(vkDestroyCuModuleNVX, vFEpUp) // VK_NVX_image_view_handle GO(vkGetImageViewAddressNVX, iFpUp) +GO(vkGetImageViewHandle64NVX, UFpp) GO(vkGetImageViewHandleNVX, uFpp) // VK_NV_device_generated_commands @@ -983,3 +1013,95 @@ GO(vkCmdSetRenderingInputAttachmentIndicesKHR, vFpp) // VK_KHR_line_rasterization GO(vkCmdSetLineStippleKHR, vFpuW) + +// VK_KHR_external_semaphore_win32 +GO(vkGetSemaphoreWin32HandleKHR, iFppp) +GO(vkImportSemaphoreWin32HandleKHR, iFpp) + +// VK_KHR_win32_keyed_mutex +GO(wine_vkAcquireKeyedMutex, iFpUUu) +GO(wine_vkReleaseKeyedMutex, iFpUU) + +// VK_NV_cooperative_matrix2 +GO(vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV, iFppp) + +// VK_AMD_anti_lag +GO(vkAntiLagUpdateAMD, vFpp) + +// VK_EXT_device_generated_commands +GO(vkCmdExecuteGeneratedCommandsEXT, vFpup) +GO(vkCmdPreprocessGeneratedCommandsEXT, vFppp) +GOM(vkCreateIndirectCommandsLayoutEXT, iFEpppp) +GOM(vkCreateIndirectExecutionSetEXT, iFEpppp) +GOM(vkDestroyIndirectCommandsLayoutEXT, vFEpUp) +GOM(vkDestroyIndirectExecutionSetEXT, vFEpUp) +GO(vkGetGeneratedCommandsMemoryRequirementsEXT, vFppp) +GO(vkUpdateIndirectExecutionSetPipelineEXT, vFpUup) +GO(vkUpdateIndirectExecutionSetShaderEXT, vFpUup) + +// VK_KHR_pipeline_binary +GOM(vkCreatePipelineBinariesKHR, iFEpppp) +GOM(vkDestroyPipelineBinaryKHR, vFEpUp) +GO(vkGetPipelineBinaryDataKHR, iFppppp) +GO(vkGetPipelineKeyKHR, iFppp) +GOM(vkReleaseCapturedPipelineDataKHR, iFEppp) + +// VK_EXT_depth_clamp_control +GO(vkCmdSetDepthClampRangeEXT, vFpup) + +// VK_ARM_tensors +GO(vkBindTensorMemoryARM, iFpup) +GO(vkCmdCopyTensorARM, vFpp) +GOM(vkCreateTensorARM, iFEpppp) +GOM(vkCreateTensorViewARM, iFEpppp) +GOM(vkDestroyTensorARM, vFEpUp) +GOM(vkDestroyTensorViewARM, vFEpUp) +GO(vkGetDeviceTensorMemoryRequirementsARM, vFppp) +GO(vkGetPhysicalDeviceExternalTensorPropertiesARM, vFppp) +GO(vkGetTensorMemoryRequirementsARM, vFppp) + +// VK_EXT_descriptor_buffer + VK_ARM_tensors +GO(vkGetTensorOpaqueCaptureDescriptorDataARM, iFppp) +GO(vkGetTensorViewOpaqueCaptureDescriptorDataARM, iFppp) + +// VK_ARM_data_graph +GO(vkBindDataGraphPipelineSessionMemoryARM, iFpup) +GO(vkCmdDispatchDataGraphARM, vFpUp) +GOM(vkCreateDataGraphPipelineSessionARM, iFEpppp) +GOM(vkCreateDataGraphPipelinesARM, iFEpUUuppp) +GOM(vkDestroyDataGraphPipelineSessionARM, vFEpUp) +GO(vkGetDataGraphPipelineAvailablePropertiesARM, iFpppp) +GO(vkGetDataGraphPipelinePropertiesARM, iFpppp) +GO(vkGetDataGraphPipelineSessionBindPointRequirementsARM, iFpppp) +GO(vkGetDataGraphPipelineSessionMemoryRequirementsARM, vFppp) +GO(vkGetPhysicalDeviceQueueFamilyDataGraphProcessingEnginePropertiesARM, vFppp) +GO(vkGetPhysicalDeviceQueueFamilyDataGraphPropertiesARM, iFpupp) + +// VK_ARM_performance_counters_by_region +GO(vkEnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM, iFpuppp) + +// VK_EXT_descriptor_heap +GO(vkCmdBindResourceHeapEXT, iFpp) +GO(vkCmdBindSamplerHeapEXT, iFpp) +GO(vkCmdPushDataEXT, vFpp) +GO(vkGetImageOpaqueCaptureDataEXT, iFpupp) +GO(vkGetPhysicalDeviceDescriptorSizeEXT, UFpu) +GO(vkWriteResourceDescriptorsEXT, iFpupp) +GO(vkWriteSamplerDescriptorsEXT, iFpupp) + +// VK_EXT_descriptor_heap + VK_ARM_tensors +GO(vkGetTensorOpaqueCaptureDataARM, iFpupp) + +// VK_EXT_descriptor_heap + VK_EXT_custom_border_color +GO(vkRegisterCustomBorderColorEXT, iFppip) +GO(vkUnregisterCustomBorderColorEXT, vFpu) + +// VK_EXT_custom_border_color +// no new functions + +// VK_KHR_win32_surface +GOM(vkCreateWin32SurfaceKHR, iFEpppp) +GO(vkGetPhysicalDeviceWin32PresentationSupportKHR, iFpu) + +// Layer stuffs +//GO(vkNegotiateLoaderLayerInterfaceVersion, iFp) // structure needs wrapping diff --git a/src/wrapped/wrappedwaylandclient.c b/src/wrapped/wrappedwaylandclient.c index 4fe3b8f..83a2b93 100644 --- a/src/wrapped/wrappedwaylandclient.c +++ b/src/wrapped/wrappedwaylandclient.c @@ -3,6 +3,7 @@ #include #define _GNU_SOURCE /* See feature_test_macros(7) */ #include +#include #include "wrappedlibs.h" @@ -32,7 +33,46 @@ GO(0) \ GO(1) \ GO(2) \ GO(3) \ -GO(4) +GO(4) \ +GO(5) \ +GO(6) \ +GO(7) \ +GO(8) \ +GO(9) \ + +//wl_log_func_t +#ifdef CONVERT_VALIST +#define GO(A) \ +static uintptr_t my_wl_log_func_t_fct_##A = 0; \ +static void my_wl_log_func_t_##A(void* fmt, x64_va_list_t args) \ +{ \ + CONVERT_VALIST(args) \ + RunFunction(my_wl_log_func_t_fct_##A, 2, fmt, VARARGS); \ + } + #else +#define GO(A) \ +static uintptr_t my_wl_log_func_t_fct_##A = 0; \ +static void my_wl_log_func_t_##A(void* fmt, x64_va_list_t args) \ +{ \ + CREATE_VALIST_FROM_VALIST(args, thread_get_emu()->scratch); \ + RunFunction(my_wl_log_func_t_fct_##A, 2, fmt, VARARGS); \ +} +#endif +SUPER() +#undef GO +static void* find_wl_log_func_t_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_wl_log_func_t_fct_##A == (uintptr_t)fct) return my_wl_log_func_t_##A; + SUPER() + #undef GO + #define GO(A) if(my_wl_log_func_t_fct_##A == 0) {my_wl_log_func_t_fct_##A = (uintptr_t)fct; return my_wl_log_func_t_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_log_func_t callback\n"); + return NULL; +} // wl_registry_listener ... typedef struct my_wl_registry_listener_s { @@ -367,7 +407,7 @@ static void* find_wl_pointer_listener_Fct(void* fct) // wl_keyboard_listener ... typedef struct my_wl_keyboard_listener_s { uintptr_t keymap; //vFppuiu - uintptr_t enter; //vFppup + uintptr_t enter; //vFppupp uintptr_t leave; //vFppup uintptr_t key; //vFppuuuuu uintptr_t modifiers; //vFppuuuuu @@ -379,9 +419,9 @@ static void my_wl_keyboard_listener_keymap_##A(void* a, void* b, uint32_t c, int { \ RunFunctionFmt(ref_wl_keyboard_listener_##A->keymap, "ppuiu", a, b, c, d, e); \ } \ -static void my_wl_keyboard_listener_enter_##A(void* a, void* b, uint32_t c, void* d) \ +static void my_wl_keyboard_listener_enter_##A(void* a, void* b, uint32_t c, void* d, void* e) \ { \ - RunFunctionFmt(ref_wl_keyboard_listener_##A->enter, "ppup", a, b, c, d); \ + RunFunctionFmt(ref_wl_keyboard_listener_##A->enter, "ppupp", a, b, c, d, e); \ } \ static void my_wl_keyboard_listener_leave_##A(void* a, void* b, uint32_t c, void* d) \ { \ @@ -526,7 +566,583 @@ static void* find_zxdg_output_v1_listener_Fct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for wayland-client zxdg_output_v1_listener callback\n"); return NULL; } - +// wl_data_device_listener ... +typedef struct my_wl_data_device_listener_s { + uintptr_t data_offer; //vFppp + uintptr_t enter; //vFppupiip + uintptr_t leave; //vFpp + uintptr_t motion; //vFppuii + uintptr_t drop; //vFpp + uintptr_t selection; //vFppp +} my_wl_data_device_listener_t; +#define GO(A) \ +static my_wl_data_device_listener_t* ref_wl_data_device_listener_##A = NULL; \ +static void my_wl_data_device_listener_data_offer_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_wl_data_device_listener_##A->data_offer, "ppp", a, b, c); \ +} \ +static void my_wl_data_device_listener_enter_##A(void* a, void* b, uint32_t c, void* d, int e, int f, void* g) \ +{ \ + RunFunctionFmt(ref_wl_data_device_listener_##A->enter, "ppupiip", a, b, c, d, e, f, g); \ +} \ +static void my_wl_data_device_listener_leave_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(ref_wl_data_device_listener_##A->leave, "pp", a, b); \ +} \ +static void my_wl_data_device_listener_motion_##A(void* a, void* b, uint32_t c, int d, int e) \ +{ \ + RunFunctionFmt(ref_wl_data_device_listener_##A->motion, "ppuii", a, b, c, d, e); \ +} \ +static void my_wl_data_device_listener_drop_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(ref_wl_data_device_listener_##A->drop, "pp", a, b); \ +} \ +static void my_wl_data_device_listener_selection_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_wl_data_device_listener_##A->selection, "ppp", a, b, c); \ +} \ +static my_wl_data_device_listener_t my_wl_data_device_listener_fct_##A = { \ + (uintptr_t)my_wl_data_device_listener_data_offer_##A, \ + (uintptr_t)my_wl_data_device_listener_enter_##A, \ + (uintptr_t)my_wl_data_device_listener_leave_##A, \ + (uintptr_t)my_wl_data_device_listener_motion_##A, \ + (uintptr_t)my_wl_data_device_listener_drop_##A, \ + (uintptr_t)my_wl_data_device_listener_selection_##A, \ +}; +SUPER() +#undef GO +static void* find_wl_data_device_listener_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(ref_wl_data_device_listener_##A == fct) return &my_wl_data_device_listener_fct_##A; + SUPER() + #undef GO + #define GO(A) if(ref_wl_data_device_listener_##A == 0) {ref_wl_data_device_listener_##A = fct; return &my_wl_data_device_listener_fct_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_data_device_listener callback\n"); + return NULL; +} +// wl_touch_listener ... +typedef struct my_wl_touch_listener_s { + uintptr_t down; //vFppuupiii + uintptr_t up; //vFppuui + uintptr_t motion; //vFppuiii + uintptr_t frame; //vFpp + uintptr_t cancel; //vFpp +} my_wl_touch_listener_t; +#define GO(A) \ +static my_wl_touch_listener_t* ref_wl_touch_listener_##A = NULL; \ +static void my_wl_touch_listener_down_##A(void* a, void* b, uint32_t c, uint32_t d, void* e, int f, int g, int h) \ +{ \ + RunFunctionFmt(ref_wl_touch_listener_##A->down, "ppuuppiii", a, b, c, d, e, f, g, h); \ +} \ +static void my_wl_touch_listener_up_##A(void* a, void* b, uint32_t c, uint32_t d, int e) \ +{ \ + RunFunctionFmt(ref_wl_touch_listener_##A->up, "ppuui", a, b, c, d, e); \ +} \ +static void my_wl_touch_listener_motion_##A(void* a, void* b, uint32_t c, int d, int e, int f) \ +{ \ + RunFunctionFmt(ref_wl_touch_listener_##A->motion, "ppuiii", a, b, c, d, e, f); \ +} \ +static void my_wl_touch_listener_frame_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(ref_wl_touch_listener_##A->frame, "pp", a, b); \ +} \ +static void my_wl_touch_listener_cancel_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(ref_wl_touch_listener_##A->cancel, "pp", a, b); \ +} \ +static my_wl_touch_listener_t my_wl_touch_listener_fct_##A = { \ + (uintptr_t)my_wl_touch_listener_down_##A, \ + (uintptr_t)my_wl_touch_listener_up_##A, \ + (uintptr_t)my_wl_touch_listener_motion_##A, \ + (uintptr_t)my_wl_touch_listener_frame_##A, \ + (uintptr_t)my_wl_touch_listener_cancel_##A, \ +}; +SUPER() +#undef GO +static void* find_wl_touch_listener_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(ref_wl_touch_listener_##A == fct) return &my_wl_touch_listener_fct_##A; + SUPER() + #undef GO + #define GO(A) if(ref_wl_touch_listener_##A == 0) {ref_wl_touch_listener_##A = fct; return &my_wl_touch_listener_fct_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_touch_listener callback\n"); + return NULL; +} +// zwp_text_input_v3_listener ... +typedef struct my_zwp_text_input_v3_listener_s { + uintptr_t enter; //vFppp + uintptr_t leave; //vFppp + uintptr_t preedit_string; //vFpppii + uintptr_t commit_string; //vFppp + uintptr_t delete_surrounding_text; //vFpppuu + uintptr_t done; //vFppu +} my_zwp_text_input_v3_listener_t; +#define GO(A) \ +static my_zwp_text_input_v3_listener_t* ref_zwp_text_input_v3_listener_##A = NULL; \ +static void my_zwp_text_input_v3_listener_enter_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_zwp_text_input_v3_listener_##A->enter, "ppp", a, b, c); \ +} \ +static void my_zwp_text_input_v3_listener_leave_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_zwp_text_input_v3_listener_##A->leave, "ppp", a, b, c); \ +} \ +static void my_zwp_text_input_v3_listener_preedit_string_##A(void* a, void* b, void* c, int d, int e) \ +{ \ + RunFunctionFmt(ref_zwp_text_input_v3_listener_##A->preedit_string, "pppii", a, b, c, d, e); \ +} \ +static void my_zwp_text_input_v3_listener_commit_string_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_zwp_text_input_v3_listener_##A->commit_string, "ppp", a, b, c); \ +} \ +static void my_zwp_text_input_v3_listener_delete_surrounding_text_##A(void* a, void* b, void* c, uint32_t d, uint32_t e) \ +{ \ + RunFunctionFmt(ref_zwp_text_input_v3_listener_##A->delete_surrounding_text, "pppuu", a, b, c, d, e); \ +} \ +static void my_zwp_text_input_v3_listener_done_##A(void* a, void* b, uint32_t c) \ +{ \ + RunFunctionFmt(ref_zwp_text_input_v3_listener_##A->done, "ppu", a, b, c); \ +} \ +static my_zwp_text_input_v3_listener_t my_zwp_text_input_v3_listener_fct_##A = { \ + (uintptr_t)my_zwp_text_input_v3_listener_enter_##A, \ + (uintptr_t)my_zwp_text_input_v3_listener_leave_##A, \ + (uintptr_t)my_zwp_text_input_v3_listener_preedit_string_##A, \ + (uintptr_t)my_zwp_text_input_v3_listener_commit_string_##A, \ + (uintptr_t)my_zwp_text_input_v3_listener_delete_surrounding_text_##A, \ + (uintptr_t)my_zwp_text_input_v3_listener_done_##A, \ +}; +SUPER() +#undef GO +static void* find_zwp_text_input_v3_listener_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(ref_zwp_text_input_v3_listener_##A == fct) return &my_zwp_text_input_v3_listener_fct_##A; + SUPER() + #undef GO + #define GO(A) if(ref_zwp_text_input_v3_listener_##A == 0) {ref_zwp_text_input_v3_listener_##A = fct; return &my_zwp_text_input_v3_listener_fct_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client zwp_text_input_v3_listener callback\n"); + return NULL; +} +// zwp_tablet_seat_v2_listener ... +typedef struct my_zwp_tablet_seat_v2_listener_s { + uintptr_t tablet_added; //vFppp + uintptr_t tool_added; //vFppp + uintptr_t pad_added; //vFppp +} my_zwp_tablet_seat_v2_listener_t; +#define GO(A) \ +static my_zwp_tablet_seat_v2_listener_t* ref_zwp_tablet_seat_v2_listener_##A = NULL; \ +static void my_zwp_tablet_seat_v2_listener_tablet_added_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_zwp_tablet_seat_v2_listener_##A->tablet_added, "ppp", a, b, c); \ +} \ +static void my_zwp_tablet_seat_v2_listener_tool_added_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_zwp_tablet_seat_v2_listener_##A->tool_added, "ppp", a, b, c); \ +} \ +static void my_zwp_tablet_seat_v2_listener_pad_added_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_zwp_tablet_seat_v2_listener_##A->pad_added, "ppp", a, b, c); \ +} \ +static my_zwp_tablet_seat_v2_listener_t my_zwp_tablet_seat_v2_listener_fct_##A = { \ + (uintptr_t)my_zwp_tablet_seat_v2_listener_tablet_added_##A, \ + (uintptr_t)my_zwp_tablet_seat_v2_listener_tool_added_##A, \ + (uintptr_t)my_zwp_tablet_seat_v2_listener_pad_added_##A, \ +}; +SUPER() +#undef GO +static void* find_zwp_tablet_seat_v2_listener_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(ref_zwp_tablet_seat_v2_listener_##A == fct) return &my_zwp_tablet_seat_v2_listener_fct_##A; + SUPER() + #undef GO + #define GO(A) if(ref_zwp_tablet_seat_v2_listener_##A == 0) {ref_zwp_tablet_seat_v2_listener_##A = fct; return &my_zwp_tablet_seat_v2_listener_fct_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client zwp_tablet_seat_v2_listener callback\n"); + return NULL; +} +// xdg_activation_token_v1_listener ... +typedef struct my_xdg_activation_token_v1_listener_s { + uintptr_t done; //vFppp +} my_xdg_activation_token_v1_listener_t; +#define GO(A) \ +static my_xdg_activation_token_v1_listener_t* ref_xdg_activation_token_v1_listener_##A = NULL; \ +static void my_xdg_activation_token_v1_listener_done_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_xdg_activation_token_v1_listener_##A->done, "ppp", a, b, c); \ +} \ +static my_xdg_activation_token_v1_listener_t my_xdg_activation_token_v1_listener_fct_##A = { \ + (uintptr_t)my_xdg_activation_token_v1_listener_done_##A, \ +}; +SUPER() +#undef GO +static void* find_xdg_activation_token_v1_listener_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(ref_xdg_activation_token_v1_listener_##A == fct) return &my_xdg_activation_token_v1_listener_fct_##A; + SUPER() + #undef GO + #define GO(A) if(ref_xdg_activation_token_v1_listener_##A == 0) {ref_xdg_activation_token_v1_listener_##A = fct; return &my_xdg_activation_token_v1_listener_fct_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client xdg_activation_token_v1_listener callback\n"); + return NULL; +} +// wl_surface_listener ... +typedef struct my_wl_surface_listener_s { + uintptr_t enter; //vFppp + uintptr_t leave; //vFppp +} my_wl_surface_listener_t; +#define GO(A) \ +static my_wl_surface_listener_t* ref_wl_surface_listener_##A = NULL; \ +static void my_wl_surface_listener_enter_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_wl_surface_listener_##A->enter, "ppp", a, b, c); \ +} \ +static void my_wl_surface_listener_leave_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_wl_surface_listener_##A->leave, "ppp", a, b, c); \ +} \ +static my_wl_surface_listener_t my_wl_surface_listener_fct_##A = { \ + (uintptr_t)my_wl_surface_listener_enter_##A, \ + (uintptr_t)my_wl_surface_listener_leave_##A, \ +}; +SUPER() +#undef GO +static void* find_wl_surface_listener_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(ref_wl_surface_listener_##A == fct) return &my_wl_surface_listener_fct_##A; + SUPER() + #undef GO + #define GO(A) if(ref_wl_surface_listener_##A == 0) {ref_wl_surface_listener_##A = fct; return &my_wl_surface_listener_fct_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_surface_listener callback\n"); + return NULL; +} +// wl_callback_listener ... +typedef struct my_wl_callback_listener_s { + uintptr_t done; //vFppp +} my_wl_callback_listener_t; +#define GO(A) \ +static my_wl_callback_listener_t* ref_wl_callback_listener_##A = NULL; \ +static void my_wl_callback_listener_done_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_wl_callback_listener_##A->done, "ppp", a, b, c); \ +} \ +static my_wl_callback_listener_t my_wl_callback_listener_fct_##A = { \ + (uintptr_t)my_wl_callback_listener_done_##A, \ +}; +SUPER() +#undef GO +static void* find_wl_callback_listener_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(ref_wl_callback_listener_##A == fct) return &my_wl_callback_listener_fct_##A; + SUPER() + #undef GO + #define GO(A) if(ref_wl_callback_listener_##A == 0) {ref_wl_callback_listener_##A = fct; return &my_wl_callback_listener_fct_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_callback_listener callback\n"); + return NULL; +} +// wp_fractional_scale_v1_listener ... +typedef struct my_wp_fractional_scale_v1_listener_s { + uintptr_t prefered_scale; //vFppu +} my_wp_fractional_scale_v1_listener_t; +#define GO(A) \ +static my_wp_fractional_scale_v1_listener_t* ref_wp_fractional_scale_v1_listener_##A = NULL; \ +static void my_wp_fractional_scale_v1_listener_prefered_scale_##A(void* a, void* b, uint32_t c) \ +{ \ + RunFunctionFmt(ref_wp_fractional_scale_v1_listener_##A->prefered_scale, "ppu", a, b, c); \ +} \ +static my_wp_fractional_scale_v1_listener_t my_wp_fractional_scale_v1_listener_fct_##A = { \ + (uintptr_t)my_wp_fractional_scale_v1_listener_prefered_scale_##A, \ +}; +SUPER() +#undef GO +static void* find_wp_fractional_scale_v1_listener_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(ref_wp_fractional_scale_v1_listener_##A == fct) return &my_wp_fractional_scale_v1_listener_fct_##A; + SUPER() + #undef GO + #define GO(A) if(ref_wp_fractional_scale_v1_listener_##A == 0) {ref_wp_fractional_scale_v1_listener_##A = fct; return &my_wp_fractional_scale_v1_listener_fct_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client wp_fractional_scale_v1_listener callback\n"); + return NULL; +} +// zwp_primary_selection_device_v1_listener ... +typedef struct my_zwp_primary_selection_device_v1_listener_s { + uintptr_t data_offer; //vFppp + uintptr_t selection; //vFppp +} my_zwp_primary_selection_device_v1_listener_t; +#define GO(A) \ +static my_zwp_primary_selection_device_v1_listener_t* ref_zwp_primary_selection_device_v1_listener_##A = NULL; \ +static void my_zwp_primary_selection_device_v1_listener_data_offer_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_zwp_primary_selection_device_v1_listener_##A->data_offer, "ppp", a, b, c); \ +} \ +static void my_zwp_primary_selection_device_v1_listener_selection_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_zwp_primary_selection_device_v1_listener_##A->selection, "ppp", a, b, c); \ +} \ +static my_zwp_primary_selection_device_v1_listener_t my_zwp_primary_selection_device_v1_listener_fct_##A = { \ + (uintptr_t)my_zwp_primary_selection_device_v1_listener_data_offer_##A, \ + (uintptr_t)my_zwp_primary_selection_device_v1_listener_selection_##A, \ +}; +SUPER() +#undef GO +static void* find_zwp_primary_selection_device_v1_listener_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(ref_zwp_primary_selection_device_v1_listener_##A == fct) return &my_zwp_primary_selection_device_v1_listener_fct_##A; + SUPER() + #undef GO + #define GO(A) if(ref_zwp_primary_selection_device_v1_listener_##A == 0) {ref_zwp_primary_selection_device_v1_listener_##A = fct; return &my_zwp_primary_selection_device_v1_listener_fct_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client zwp_primary_selection_device_v1_listener callback\n"); + return NULL; +} +// wl_data_offer_listener ... +typedef struct my_wl_data_offer_listener_s { + uintptr_t offer; //vFppp + uintptr_t source_actions; //vFppu + uintptr_t action; //vFppu +} my_wl_data_offer_listener_t; +#define GO(A) \ +static my_wl_data_offer_listener_t* ref_wl_data_offer_listener_##A = NULL; \ +static void my_wl_data_offer_listener_offer_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_wl_data_offer_listener_##A->offer, "ppp", a, b, c); \ +} \ +static void my_wl_data_offer_listener_source_actions_##A(void* a, void* b, uint32_t c) \ +{ \ + RunFunctionFmt(ref_wl_data_offer_listener_##A->source_actions, "ppu", a, b, c); \ +} \ +static void my_wl_data_offer_listener_action_##A(void* a, void* b, uint32_t c) \ +{ \ + RunFunctionFmt(ref_wl_data_offer_listener_##A->action, "ppu", a, b, c); \ +} \ +static my_wl_data_offer_listener_t my_wl_data_offer_listener_fct_##A = { \ + (uintptr_t)my_wl_data_offer_listener_offer_##A, \ + (uintptr_t)my_wl_data_offer_listener_source_actions_##A, \ + (uintptr_t)my_wl_data_offer_listener_action_##A, \ +}; +SUPER() +#undef GO +static void* find_wl_data_offer_listener_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(ref_wl_data_offer_listener_##A == fct) return &my_wl_data_offer_listener_fct_##A; + SUPER() + #undef GO + #define GO(A) if(ref_wl_data_offer_listener_##A == 0) {ref_wl_data_offer_listener_##A = fct; return &my_wl_data_offer_listener_fct_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_data_offer_listener callback\n"); + return NULL; +} +// zwp_primary_selection_offer_v1_listener ... +typedef struct my_zwp_primary_selection_offer_v1_listener_s { + uintptr_t primary_offer; //vFppp +} my_zwp_primary_selection_offer_v1_listener_t; +#define GO(A) \ +static my_zwp_primary_selection_offer_v1_listener_t* ref_zwp_primary_selection_offer_v1_listener_##A = NULL; \ +static void my_zwp_primary_selection_offer_v1_listener_primary_offer_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(ref_zwp_primary_selection_offer_v1_listener_##A->primary_offer, "ppp", a, b, c); \ +} \ +static my_zwp_primary_selection_offer_v1_listener_t my_zwp_primary_selection_offer_v1_listener_fct_##A = { \ + (uintptr_t)my_zwp_primary_selection_offer_v1_listener_primary_offer_##A, \ +}; +SUPER() +#undef GO +static void* find_zwp_primary_selection_offer_v1_listener_Fct(void* fct) +{ + if(!fct) return fct; + #define GO(A) if(ref_zwp_primary_selection_offer_v1_listener_##A == fct) return &my_zwp_primary_selection_offer_v1_listener_fct_##A; + SUPER() + #undef GO + #define GO(A) if(ref_zwp_primary_selection_offer_v1_listener_##A == 0) {ref_zwp_primary_selection_offer_v1_listener_##A = fct; return &my_zwp_primary_selection_offer_v1_listener_fct_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client zwp_primary_selection_offer_v1_listener callback\n"); + return NULL; +} +// wp_color_management_output_v1 ... +typedef struct my_wp_color_management_output_v1_listener_s { + uintptr_t image_description_changed; // vFpp +} my_wp_color_management_output_v1_listener_t; +#define GO(A) \ + static my_wp_color_management_output_v1_listener_t* ref_wp_color_management_output_v1_listener_##A = NULL; \ + static void my_wp_color_management_output_v1_listener_image_description_changed_##A(void* a, void* b) \ + { \ + RunFunctionFmt(ref_wp_color_management_output_v1_listener_##A->image_description_changed, "pp", a, b); \ + } \ + static my_wp_color_management_output_v1_listener_t my_wp_color_management_output_v1_listener_fct_##A = { \ + (uintptr_t)my_wp_color_management_output_v1_listener_image_description_changed_##A, \ + }; +SUPER() +#undef GO +static void* find_wp_color_management_output_v1_listener_Fct(void* fct) +{ + if (!fct) return fct; +#define GO(A) \ + if (ref_wp_color_management_output_v1_listener_##A == fct) return &my_wp_color_management_output_v1_listener_fct_##A; + SUPER() +#undef GO +#define GO(A) \ + if (ref_wp_color_management_output_v1_listener_##A == 0) { \ + ref_wp_color_management_output_v1_listener_##A = fct; \ + return &my_wp_color_management_output_v1_listener_fct_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client wp_color_management_output_v1_listener callback\n"); + return NULL; +} +// wp_image_description_info_v1 ... +typedef struct my_wp_image_description_info_v1_listener_s { + uintptr_t done; // vFpp + uintptr_t icc_file; // vFppiu + uintptr_t primaries; // vFppiiiiiiii + uintptr_t primaries_named; // vFppu + uintptr_t tf_power; // vFppu + uintptr_t tf_named; // vFppu + uintptr_t luminances; // vFppuuu + uintptr_t target_primaries; // vFppiiiiiiii + uintptr_t target_luminance; // vFppuu + uintptr_t target_max_cll; // vFppu + uintptr_t target_max_fall; // vFppu +} my_wp_image_description_info_v1_listener_t; +#define GO(A) \ + static my_wp_image_description_info_v1_listener_t* ref_wp_image_description_info_v1_listener_##A = NULL; \ + static void my_wp_image_description_info_v1_listener_done_##A(void* a, void* b) \ + { \ + RunFunctionFmt(ref_wp_image_description_info_v1_listener_##A->done, "pp", a, b); \ + } \ + static void my_wp_image_description_info_v1_listener_icc_file_##A(void* a, void* b, int32_t c, uint32_t d) \ + { \ + RunFunctionFmt(ref_wp_image_description_info_v1_listener_##A->icc_file, "ppiu", a, b, c, d); \ + } \ + static void my_wp_image_description_info_v1_listener_primaries_##A(void* a, void* b, \ + int32_t i1, int32_t i2, int32_t i3, int32_t i4, int32_t i5, int32_t i6, int32_t i7, int32_t i8) \ + { \ + RunFunctionFmt(ref_wp_image_description_info_v1_listener_##A->primaries, "ppiiiiiiii", a, b, \ + i1, i2, i3, i4, i5, i6, i7, i8); \ + } \ + static void my_wp_image_description_info_v1_listener_primaries_named_##A(void* a, void* b, uint32_t c) \ + { \ + RunFunctionFmt(ref_wp_image_description_info_v1_listener_##A->primaries_named, "ppu", a, b, c); \ + } \ + static void my_wp_image_description_info_v1_listener_tf_power_##A(void* a, void* b, uint32_t c) \ + { \ + RunFunctionFmt(ref_wp_image_description_info_v1_listener_##A->tf_power, "ppu", a, b, c); \ + } \ + static void my_wp_image_description_info_v1_listener_tf_named_##A(void* a, void* b, uint32_t c) \ + { \ + RunFunctionFmt(ref_wp_image_description_info_v1_listener_##A->tf_named, "ppu", a, b, c); \ + } \ + static void my_wp_image_description_info_v1_listener_luminances_##A(void* a, void* b, uint32_t c, uint32_t d, uint32_t e) \ + { \ + RunFunctionFmt(ref_wp_image_description_info_v1_listener_##A->luminances, "ppuuu", a, b, c, d, e); \ + } \ + static void my_wp_image_description_info_v1_listener_target_primaries_##A(void* a, void* b, \ + int32_t i1, int32_t i2, int32_t i3, int32_t i4, int32_t i5, int32_t i6, int32_t i7, int32_t i8) \ + { \ + RunFunctionFmt(ref_wp_image_description_info_v1_listener_##A->target_primaries, "ppiiiiiiii", a, b, \ + i1, i2, i3, i4, i5, i6, i7, i8); \ + } \ + static void my_wp_image_description_info_v1_listener_target_luminance_##A(void* a, void* b, uint32_t c, uint32_t d) \ + { \ + RunFunctionFmt(ref_wp_image_description_info_v1_listener_##A->target_luminance, "ppuu", a, b, c, d); \ + } \ + static void my_wp_image_description_info_v1_listener_target_max_cll_##A(void* a, void* b, uint32_t c) \ + { \ + RunFunctionFmt(ref_wp_image_description_info_v1_listener_##A->target_max_cll, "ppu", a, b, c); \ + } \ + static void my_wp_image_description_info_v1_listener_target_max_fall_##A(void* a, void* b, uint32_t c) \ + { \ + RunFunctionFmt(ref_wp_image_description_info_v1_listener_##A->target_max_fall, "ppu", a, b, c); \ + } \ + static my_wp_image_description_info_v1_listener_t my_wp_image_description_info_v1_listener_fct_##A = { \ + (uintptr_t)my_wp_image_description_info_v1_listener_done_##A, \ + (uintptr_t)my_wp_image_description_info_v1_listener_icc_file_##A, \ + (uintptr_t)my_wp_image_description_info_v1_listener_primaries_##A, \ + (uintptr_t)my_wp_image_description_info_v1_listener_primaries_named_##A, \ + (uintptr_t)my_wp_image_description_info_v1_listener_tf_power_##A, \ + (uintptr_t)my_wp_image_description_info_v1_listener_tf_named_##A, \ + (uintptr_t)my_wp_image_description_info_v1_listener_luminances_##A, \ + (uintptr_t)my_wp_image_description_info_v1_listener_target_primaries_##A, \ + (uintptr_t)my_wp_image_description_info_v1_listener_target_luminance_##A, \ + (uintptr_t)my_wp_image_description_info_v1_listener_target_max_cll_##A, \ + (uintptr_t)my_wp_image_description_info_v1_listener_target_max_fall_##A, \ + }; +SUPER() +#undef GO +static void* find_wp_image_description_info_v1_listener_Fct(void* fct) +{ + if (!fct) return fct; +#define GO(A) \ + if (ref_wp_image_description_info_v1_listener_##A == fct) return &my_wp_image_description_info_v1_listener_fct_##A; + SUPER() +#undef GO +#define GO(A) \ + if (ref_wp_image_description_info_v1_listener_##A == 0) { \ + ref_wp_image_description_info_v1_listener_##A = fct; \ + return &my_wp_image_description_info_v1_listener_fct_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client wp_image_description_info_v1_listener callback\n"); + return NULL; +} +// zxdg_toplevel_decoration_v1 ... +typedef struct my_zxdg_toplevel_decoration_v1_listener_s { + uintptr_t configure; // vFppu +} my_zxdg_toplevel_decoration_v1_listener_t; +#define GO(A) \ + static my_zxdg_toplevel_decoration_v1_listener_t* ref_zxdg_toplevel_decoration_v1_listener_##A = NULL; \ + static void my_zxdg_toplevel_decoration_v1_listener_configure_##A(void* a, void* b, uint32_t c) \ + { \ + RunFunctionFmt(ref_zxdg_toplevel_decoration_v1_listener_##A->configure, "ppu", a, b, c); \ + } \ + static my_zxdg_toplevel_decoration_v1_listener_t my_zxdg_toplevel_decoration_v1_listener_fct_##A = { \ + (uintptr_t)my_zxdg_toplevel_decoration_v1_listener_configure_##A, \ + }; +SUPER() +#undef GO +static void* find_zxdg_toplevel_decoration_v1_listener_Fct(void* fct) +{ + if (!fct) return fct; +#define GO(A) \ + if (ref_zxdg_toplevel_decoration_v1_listener_##A == fct) return &my_zxdg_toplevel_decoration_v1_listener_fct_##A; + SUPER() +#undef GO +#define GO(A) \ + if (ref_zxdg_toplevel_decoration_v1_listener_##A == 0) { \ + ref_zxdg_toplevel_decoration_v1_listener_##A = fct; \ + return &my_zxdg_toplevel_decoration_v1_listener_fct_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client zxdg_toplevel_decoration_v1_listener_listener callback\n"); + return NULL; +} #undef SUPER EXPORT int my_wl_proxy_add_listener(x64emu_t* emu, void* proxy, void** l, void* data) @@ -556,9 +1172,42 @@ EXPORT int my_wl_proxy_add_listener(x64emu_t* emu, void* proxy, void** l, void* l = find_zwp_relative_pointer_v1_listener_Fct(l); } else if(!strcmp(proxy_name, "zxdg_output_v1")) { l = find_zxdg_output_v1_listener_Fct(l); + } else if(!strcmp(proxy_name, "wl_data_device")) { + l = find_wl_data_device_listener_Fct(l); + } else if(!strcmp(proxy_name, "wl_touch")) { + l = find_wl_touch_listener_Fct(l); + } else if(!strcmp(proxy_name, "zwp_text_input_v3")) { + l = find_zwp_text_input_v3_listener_Fct(l); + } else if(!strcmp(proxy_name, "zwp_tablet_seat_v2")) { + l = find_zwp_tablet_seat_v2_listener_Fct(l); + } else if(!strcmp(proxy_name, "xdg_activation_token_v1")) { + l = find_xdg_activation_token_v1_listener_Fct(l); + } else if(!strcmp(proxy_name, "wl_surface")) { + l = find_wl_surface_listener_Fct(l); + } else if(!strcmp(proxy_name, "wl_callback")) { + l = find_wl_callback_listener_Fct(l); + } else if(!strcmp(proxy_name, "wp_fractional_scale_v1")) { + l = find_wp_fractional_scale_v1_listener_Fct(l); + } else if(!strcmp(proxy_name, "zwp_primary_selection_device_v1")) { + l = find_zwp_primary_selection_device_v1_listener_Fct(l); + } else if(!strcmp(proxy_name, "wl_data_offer")) { + l = find_wl_data_offer_listener_Fct(l); + } else if(!strcmp(proxy_name, "zwp_primary_selection_offer_v1")) { + l = find_zwp_primary_selection_offer_v1_listener_Fct(l); + } else if (!strcmp(proxy_name, "wp_color_management_output_v1")) { + l = find_wp_color_management_output_v1_listener_Fct(l); + } else if (!strcmp(proxy_name, "wp_image_description_info_v1")) { + l = find_wp_image_description_info_v1_listener_Fct(l); + } else if (!strcmp(proxy_name, "zxdg_toplevel_decoration_v1")) { + l = find_zxdg_toplevel_decoration_v1_listener_Fct(l); } else - printf_log(LOG_INFO, "BOX64: Error, Wayland-client, add_listener to %s unknown, will crash soon!\n", proxy_name); + printf_log(LOG_INFO, "Error, Wayland-client, add_listener to %s unknown, will crash soon!\n", proxy_name); return my->wl_proxy_add_listener(proxy, l, data); } +EXPORT void my_wl_log_set_handler_client(x64emu_t* emu, void* f) +{ + my->wl_log_set_handler_client(find_wl_log_func_t_Fct(f)); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedwaylandclient_private.h b/src/wrapped/wrappedwaylandclient_private.h index ba81df1..b0be9ba 100644 --- a/src/wrapped/wrappedwaylandclient_private.h +++ b/src/wrapped/wrappedwaylandclient_private.h @@ -1,18 +1,18 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(wl_array_add, pFpL) -//GO(wl_array_copy, +GO(wl_array_copy, iFpp) GO(wl_array_init, vFp) GO(wl_array_release, vFp) DATA(wl_buffer_interface, 40) -//DATA(wl_callback_interface, +DATA(wl_callback_interface, 40) DATA(wl_compositor_interface, 40) -//DATA(wl_data_device_interface, -//DATA(wl_data_device_manager_interface, -//DATA(wl_data_offer_interface, -//DATA(wl_data_source_interface, +DATA(wl_data_device_interface, 40) +DATA(wl_data_device_manager_interface, 40) +DATA(wl_data_offer_interface, 40) +DATA(wl_data_source_interface, 40) GO(wl_display_cancel_read, vFp) GO(wl_display_connect, pFp) GO(wl_display_connect_to_fd, pFi) @@ -25,7 +25,7 @@ GO(wl_display_dispatch_queue_pending, iFpp) GO(wl_display_flush, iFp) GO(wl_display_get_error, iFp) GO(wl_display_get_fd, iFp) -//GO(wl_display_get_protocol_error, +GO(wl_display_get_protocol_error, uFppp) DATA(wl_display_interface, 40) GO(wl_display_prepare_read, iFp) GO(wl_display_prepare_read_queue, iFpp) @@ -34,36 +34,36 @@ GO(wl_display_roundtrip, iFp) GO(wl_display_roundtrip_queue, iFpp) GO(wl_event_queue_destroy, vFp) DATA(wl_keyboard_interface, 40) -//GO(wl_list_empty, +GO(wl_list_empty, iFp) GO(wl_list_init, vFp) GO(wl_list_insert, vFpp) -//GO(wl_list_insert_list, -//GO(wl_list_length, +GO(wl_list_insert_list, vFpp) +GO(wl_list_length, iFp) GO(wl_list_remove, vFp) -//GO(wl_log_set_handler_client, +GOM(wl_log_set_handler_client, vFEp) DATA(wl_output_interface, 40) DATA(wl_pointer_interface, 40) -//GO(wl_proxy_add_dispatcher, +//GOM(wl_proxy_add_dispatcher, iFEpppp) GOM(wl_proxy_add_listener, iFEppp) GO(wl_proxy_create, pFpp) GO(wl_proxy_create_wrapper, pFp) GO(wl_proxy_destroy, vFp) -//GO(wl_proxy_get_class, +GO(wl_proxy_get_class, pFp) GO(wl_proxy_get_id, uFp) GO(wl_proxy_get_listener, pFp) -//GO(wl_proxy_get_tag, +GO(wl_proxy_get_tag, pFp) GO(wl_proxy_get_user_data, pFp) GO(wl_proxy_get_version, uFp) GO(wl_proxy_marshal, vFpupppppppppp) //VAARGS GO(wl_proxy_marshal_array, vFpup) GO(wl_proxy_marshal_array_constructor, pFpupp) GO(wl_proxy_marshal_array_constructor_versioned, pFpuppu) -//GO(wl_proxy_marshal_array_flags, +GO(wl_proxy_marshal_array_flags, pFpupuup) GO(wl_proxy_marshal_constructor, pFpupppppppppppppppp) //VAARGS GO(wl_proxy_marshal_constructor_versioned, pFpupupppppppppppppppp) //VAARGS GO(wl_proxy_marshal_flags, pFpupuupppppppppppppppppppp) //VAARGS GO(wl_proxy_set_queue, vFpp) -//GO(wl_proxy_set_tag, +GO(wl_proxy_set_tag, vFpp) GO(wl_proxy_set_user_data, vFpp) GO(wl_proxy_wrapper_destroy, vFp) DATA(wl_region_interface, 40) diff --git a/src/wrapped/wrappedxinerama.c b/src/wrapped/wrappedxinerama.c index a3807b8..4bc5e3b 100644 --- a/src/wrapped/wrappedxinerama.c +++ b/src/wrapped/wrappedxinerama.c @@ -11,18 +11,11 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* xineramaName = "libXinerama.so"; -#else - const char* xineramaName = "libXinerama.so.1"; -#endif +const char* xineramaName = "libXinerama.so.1"; +#define ALTNAME "libXinerama.so" #define LIBNAME xinerama -#ifdef ANDROID -#define NEEDED_LIBS "libX11.so", "libXext.so" -#else #define NEEDED_LIBS "libX11.so.6", "libXext.so.6" -#endif #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedxinerama_private.h b/src/wrapped/wrappedxinerama_private.h index ddc9c29..16acfa4 100644 --- a/src/wrapped/wrappedxinerama_private.h +++ b/src/wrapped/wrappedxinerama_private.h @@ -1,5 +1,5 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(XineramaIsActive, iFp) @@ -7,8 +7,8 @@ GO(XineramaQueryExtension, iFppp) GO(XineramaQueryScreens, pFpp) GO(XineramaQueryVersion, iFppp) GO(XPanoramiXAllocInfo, pFv) -GO(XPanoramiXGetScreenCount, iFppp) -GO(XPanoramiXGetScreenSize, iFppip) -GO(XPanoramiXGetState, iFppp) +GO(XPanoramiXGetScreenCount, iFpLp) +GO(XPanoramiXGetScreenSize, iFpLip) +GO(XPanoramiXGetState, iFpLp) GO(XPanoramiXQueryExtension, iFppp) GO(XPanoramiXQueryVersion, iFppp) diff --git a/src/wrapped/wrappedxkbcommon.c b/src/wrapped/wrappedxkbcommon.c index c0be8c6..91ad8ac 100644 --- a/src/wrapped/wrappedxkbcommon.c +++ b/src/wrapped/wrappedxkbcommon.c @@ -6,13 +6,61 @@ #include "wrappedlibs.h" +#include "debug.h" #include "wrapper.h" #include "bridge.h" #include "librarian/library_private.h" #include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "box64context.h" +#include "librarian.h" +#include "myalign.h" const char* xkbcommonName = "libxkbcommon.so.0"; +#define ALTNAME "libxkbcommon.so" + #define LIBNAME xkbcommon -#include "wrappedlib_init.h" +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedxkbcommontypes.h" + +#include "wrappercallback.h" +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ + +//xkb_keymap_key_iter_t +#define GO(A) \ +static uintptr_t my_xkb_keymap_key_iter_t_fct_##A = 0; \ +static void my_xkb_keymap_key_iter_t_##A(void* a, uint32_t b, void* c) \ +{ \ + RunFunctionFmt(my_xkb_keymap_key_iter_t_fct_##A, "pup", a, b, c); \ +} +SUPER() +#undef GO +static void* find_xkb_keymap_key_iter_t_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_xkb_keymap_key_iter_t_fct_##A == (uintptr_t)fct) return my_xkb_keymap_key_iter_t_##A; + SUPER() + #undef GO + #define GO(A) if(my_xkb_keymap_key_iter_t_fct_##A == 0) {my_xkb_keymap_key_iter_t_fct_##A = (uintptr_t)fct; return my_xkb_keymap_key_iter_t_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for xkbcommon xkb_keymap_key_iter_t callback\n"); + return NULL; +} +#undef SUPER + +EXPORT void my_xkb_keymap_key_for_each(x64emu_t* emu, void* keymap, void* f, void* data) +{ + my->xkb_keymap_key_for_each(keymap, find_xkb_keymap_key_iter_t_Fct(f), data); +} + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedxkbcommon_private.h b/src/wrapped/wrappedxkbcommon_private.h index ccbc71e..c6051a5 100644 --- a/src/wrapped/wrappedxkbcommon_private.h +++ b/src/wrapped/wrappedxkbcommon_private.h @@ -1,41 +1,47 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif //typedef uint32_t xkb_keycode_t -GO(xkb_compose_state_feed, iFpu) -//GO(xkb_compose_state_get_compose_table, -//GO(xkb_compose_state_get_one_sym, -GO(xkb_compose_state_get_status, iFp) -//GO(xkb_compose_state_get_utf8, -GO(xkb_compose_state_new, pFpi) -//GO(xkb_compose_state_ref, +GO(xkb_compose_state_feed, uFpu) +GO(xkb_compose_state_get_compose_table, pFp) +GO(xkb_compose_state_get_one_sym, uFp) +GO(xkb_compose_state_get_status, uFp) +GO(xkb_compose_state_get_utf8, iFppL) +GO(xkb_compose_state_new, pFpu) +GO(xkb_compose_state_ref, pFp) GO(xkb_compose_state_reset, vFp) GO(xkb_compose_state_unref, vFp) -//GO(xkb_compose_table_new_from_buffer, -//GO(xkb_compose_table_new_from_file, -GO(xkb_compose_table_new_from_locale, pFppi) -//GO(xkb_compose_table_ref, +GO(xkb_compose_table_entry_utf8, pFp) +GO(xkb_compose_table_entry_keysym, uFp) +GO(xkb_compose_table_iterator_free, vFp) +GO(xkb_compose_table_iterator_new, pFp) +GO(xkb_compose_table_iterator_next, pFp) +GO(xkb_compose_table_entry_sequence, pFpp) +GO(xkb_compose_table_new_from_buffer, pFppLpuu) +GO(xkb_compose_table_new_from_file, pFpSpuu) +GO(xkb_compose_table_new_from_locale, pFppu) +GO(xkb_compose_table_ref, pFp) GO(xkb_compose_table_unref, vFp) -//GO(xkb_context_get_log_level, -//GO(xkb_context_get_log_verbosity, +GO(xkb_context_get_log_level, uFp) +GO(xkb_context_get_log_verbosity, iFp) GO(xkb_context_get_user_data, pFp) GO(xkb_context_include_path_append, iFpp) -//GO(xkb_context_include_path_append_default, -//GO(xkb_context_include_path_clear, -//GO(xkb_context_include_path_get, -//GO(xkb_context_include_path_reset_defaults, -GO(xkb_context_new, pFi) -//GO(xkb_context_num_include_paths, +GO(xkb_context_include_path_append_default, iFp) +GO(xkb_context_include_path_clear, vFp) +GO(xkb_context_include_path_get, pFpu) +GO(xkb_context_include_path_reset_defaults, iFp) +GO(xkb_context_new, pFu) +GO(xkb_context_num_include_paths, uFp) GO(xkb_context_ref, pFp) //GOM(xkb_context_set_log_fn, vFEpp) -GO(xkb_context_set_log_level, vFpi) +GO(xkb_context_set_log_level, vFpu) GO(xkb_context_set_log_verbosity, vFpi) GO(xkb_context_set_user_data, vFpp) GO(xkb_context_unref, vFp) -GO(xkb_keymap_get_as_string, pFpi) +GO(xkb_keymap_get_as_string, pFpu) GO(xkb_keymap_key_by_name, uFpp) -//GOM(xkb_keymap_key_for_each, vFEppp) +GOM(xkb_keymap_key_for_each, vFEppp) GO(xkb_keymap_key_get_name, pFpu) GO(xkb_keymap_key_get_syms_by_level, iFpuuup) GO(xkb_keymap_key_repeats, iFpu) @@ -47,10 +53,10 @@ GO(xkb_keymap_max_keycode, uFp) GO(xkb_keymap_min_keycode, uFp) GO(xkb_keymap_mod_get_index, uFpp) GO(xkb_keymap_mod_get_name, pFpu) -GO(xkb_keymap_new_from_buffer, pFppLii) -//GO(xkb_keymap_new_from_file, -GO(xkb_keymap_new_from_names, pFppi) -GO(xkb_keymap_new_from_string, pFppii) +GO(xkb_keymap_new_from_buffer, pFppLuu) +GO(xkb_keymap_new_from_file, pFpSuu) +GO(xkb_keymap_new_from_names, pFppu) +GO(xkb_keymap_new_from_string, pFppuu) GO(xkb_keymap_num_layouts, uFp) GO(xkb_keymap_num_layouts_for_key, uFpu) GO(xkb_keymap_num_leds, uFp) @@ -58,7 +64,7 @@ GO(xkb_keymap_num_levels_for_key, uFpuu) GO(xkb_keymap_num_mods, uFp) GO(xkb_keymap_ref, pFp) GO(xkb_keymap_unref, vFp) -GO(xkb_keysym_from_name, uFpi) +GO(xkb_keysym_from_name, uFpu) GO(xkb_keysym_get_name, iFupL) GO(xkb_keysym_to_lower, uFu) GO(xkb_keysym_to_upper, uFu) @@ -66,28 +72,28 @@ GO(xkb_keysym_to_utf32, uFu) GO(xkb_keysym_to_utf8, iFupL) GO(xkb_state_get_keymap, pFp) GO(xkb_state_key_get_consumed_mods, uFpu) -GO(xkb_state_key_get_consumed_mods2, uFpui) -GO(xkb_state_key_get_layout, iFpu) -GO(xkb_state_key_get_level, iFpui) +GO(xkb_state_key_get_consumed_mods2, uFpuu) +GO(xkb_state_key_get_layout, uFpu) +GO(xkb_state_key_get_level, uFpuu) GO(xkb_state_key_get_one_sym, uFpu) -GO(xkb_state_key_get_syms, iFpip) +GO(xkb_state_key_get_syms, iFpup) GO(xkb_state_key_get_utf32, uFpu) GO(xkb_state_key_get_utf8, iFpupL) -GO(xkb_state_layout_index_is_active, iFpii) -GO(xkb_state_layout_name_is_active, iFppi) -GO(xkb_state_led_index_is_active, iFpi) +GO(xkb_state_layout_index_is_active, iFpuu) +GO(xkb_state_layout_name_is_active, iFppu) +GO(xkb_state_led_index_is_active, iFpu) GO(xkb_state_led_name_is_active, iFpp) -GO(xkb_state_mod_index_is_active, iFpii) +GO(xkb_state_mod_index_is_active, iFpuu) GO(xkb_state_mod_index_is_consumed, iFpuu) -GO(xkb_state_mod_index_is_consumed2, iFpuui) -//GO(xkb_state_mod_indices_are_active, iFpiiV) +GO(xkb_state_mod_index_is_consumed2, iFpuuu) +//GOM(xkb_state_mod_indices_are_active, iFEpuuV) GO(xkb_state_mod_mask_remove_consumed, uFpuu) -GO(xkb_state_mod_name_is_active, iFppi) -//GO(xkb_state_mod_names_are_active, iFpiiV) +GO(xkb_state_mod_name_is_active, iFppu) +//GOM(xkb_state_mod_names_are_active, iFEpuuV) GO(xkb_state_new, pFp) GO(xkb_state_ref, pFp) -GO(xkb_state_serialize_layout, uFpi) -GO(xkb_state_serialize_mods, uFpi) +GO(xkb_state_serialize_layout, uFpu) +GO(xkb_state_serialize_mods, uFpu) GO(xkb_state_unref, vFp) -GO(xkb_state_update_key, iFpui) -GO(xkb_state_update_mask, iFpiiiiii) +GO(xkb_state_update_key, uFpuu) +GO(xkb_state_update_mask, uFpuuuuuu) diff --git a/src/wrapped/wrappedxkbcommonx11.c b/src/wrapped/wrappedxkbcommonx11.c index 04f945e..81c8e5b 100644 --- a/src/wrapped/wrappedxkbcommonx11.c +++ b/src/wrapped/wrappedxkbcommonx11.c @@ -12,6 +12,8 @@ #include "x64emu.h" const char* xkbcommonx11Name = "libxkbcommon-x11.so.0"; +#define ALTNAME "libxkbcommon-x11.so" + #define LIBNAME xkbcommonx11 #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedxkbregistry.c b/src/wrapped/wrappedxkbregistry.c index 437b8a8..94287fb 100644 --- a/src/wrapped/wrappedxkbregistry.c +++ b/src/wrapped/wrappedxkbregistry.c @@ -12,6 +12,8 @@ #include "x64emu.h" const char* xkbregistryName = "libxkbregistry.so.0"; +#define ALTNAME "libxkbregistry.so" + #define LIBNAME xkbregistry #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedxml2.c b/src/wrapped/wrappedxml2.c index 1c352c6..71f47d9 100644 --- a/src/wrapped/wrappedxml2.c +++ b/src/wrapped/wrappedxml2.c @@ -18,13 +18,10 @@ #include "callback.h" #include "myalign.h" -const char* xml2Name = -#ifdef ANDROID - "libxml2.so" -#else - "libxml2.so.2" -#endif - ; +const char* xml2Name = "libxml2.so.2"; +#define ALTNAME "libxml2.so" +#define ALTNAME2 "libxml2.so.16" + #define LIBNAME xml2 @@ -64,6 +61,7 @@ void* my_wrap_xmlMemStrdup(void* p) } #define ADDED_FUNCTIONS() \ + GO(xmlXPathValuePush, iFpp_t) #include "generated/wrappedxml2types.h" @@ -1239,6 +1237,98 @@ static void* find_xmlTextReaderErrorFunc_Fct(void* fct) // this one have a VAArg return NULL; } +// xmlFreeFunc ... +#define GO(A) \ +static uintptr_t my_xmlFreeFunc_fct_##A = 0; \ +static void my_xmlFreeFunc_##A(void* a) \ +{ \ + return (void)RunFunctionFmt(my_xmlFreeFunc_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* find_xmlFreeFunc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_xmlFreeFunc_fct_##A == (uintptr_t)fct) return my_xmlFreeFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_xmlFreeFunc_fct_##A == 0) {my_xmlFreeFunc_fct_##A = (uintptr_t)fct; return my_xmlFreeFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlFreeFunc callback\n"); + return NULL; +} + +// xmlMallocFunc ... +#define GO(A) \ +static uintptr_t my_xmlMallocFunc_fct_##A = 0; \ +static void* my_xmlMallocFunc_##A(size_t a) \ +{ \ + return (void*)RunFunctionFmt(my_xmlMallocFunc_fct_##A, "L", a); \ +} +SUPER() +#undef GO +static void* find_xmlMallocFunc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_xmlMallocFunc_fct_##A == (uintptr_t)fct) return my_xmlMallocFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_xmlMallocFunc_fct_##A == 0) {my_xmlMallocFunc_fct_##A = (uintptr_t)fct; return my_xmlMallocFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlMallocFunc callback\n"); + return NULL; +} + +// xmlReallocFunc ... +#define GO(A) \ +static uintptr_t my_xmlReallocFunc_fct_##A = 0; \ +static void* my_xmlReallocFunc_##A(void* a, size_t b) \ +{ \ + return (void*)RunFunctionFmt(my_xmlReallocFunc_fct_##A, "pL", a, b); \ +} +SUPER() +#undef GO +static void* find_xmlReallocFunc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_xmlReallocFunc_fct_##A == (uintptr_t)fct) return my_xmlReallocFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_xmlReallocFunc_fct_##A == 0) {my_xmlReallocFunc_fct_##A = (uintptr_t)fct; return my_xmlReallocFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlReallocFunc callback\n"); + return NULL; +} + +// xmlStrdupFunc ... +#define GO(A) \ +static uintptr_t my_xmlStrdupFunc_fct_##A = 0; \ +static char* my_xmlStrdupFunc_##A(char* a) \ +{ \ + return (char*)RunFunctionFmt(my_xmlStrdupFunc_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* find_xmlStrdupFunc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_xmlStrdupFunc_fct_##A == (uintptr_t)fct) return my_xmlStrdupFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_xmlStrdupFunc_fct_##A == 0) {my_xmlStrdupFunc_fct_##A = (uintptr_t)fct; return my_xmlStrdupFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlStrdupFunc callback\n"); + return NULL; +} + #undef SUPER EXPORT void* my_xmlHashCopy(x64emu_t* emu, void* table, void* f) @@ -1415,6 +1505,18 @@ static void restoreSaxHandler(my_xmlSAXHandler_t* sav, my_xmlSAXHandler_t* v) #undef SUPER +EXPORT void* my_xmlCreatePushParserCtxt(x64emu_t* emu, my_xmlSAXHandler_t* p, void* user_data, void* chunk, + int size, void* filename) +{ + // handling of wine that change the default sax handler of... + my_xmlSAXHandler_t* old_saxhandler = p; + my_xmlSAXHandler_t sax_handler = {0}; + wrapSaxHandler(&sax_handler, old_saxhandler); + void* ret = my->xmlCreatePushParserCtxt(p, user_data, chunk, size, filename); + restoreSaxHandler(&sax_handler, old_saxhandler); + return ret; +} + EXPORT int my_xmlParseDocument(x64emu_t* emu, my_xmlSAXHandler_t** p) { // handling of wine that change the default sax handler of... @@ -1495,4 +1597,18 @@ EXPORT void* my_xmlCtxtReadIO(x64emu_t* emu, void* ctxt, void* ioread, void* ioc return my->xmlCtxtReadIO(ctxt, find_xmlInputReadCallback_Fct(ioread), find_xmlInputCloseCallback_Fct(ioclose), ioctx, url, encoding, options); } +EXPORT int my_xmlMemSetup(x64emu_t* emu, void* v1, void* v2, void* v3, void* v4) +{ + int ret = my->xmlMemSetup(find_xmlFreeFunc_Fct(v1), find_xmlMallocFunc_Fct(v2), find_xmlReallocFunc_Fct(v3), find_xmlStrdupFunc_Fct(v4)); + return ret; +} + +EXPORT int my_valuePush(x64emu_t* emu, void* a, void* b) +{ + if(my->valuePush) + return my->valuePush(a, b); + else + return my->xmlXPathValuePush(a, b); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedxml2_private.h b/src/wrapped/wrappedxml2_private.h index 2f6a4b3..4de20d5 100644 --- a/src/wrapped/wrappedxml2_private.h +++ b/src/wrapped/wrappedxml2_private.h @@ -88,7 +88,7 @@ GO(nodePush, iFpp) //GO(UTF8ToHtml, GO(UTF8Toisolat1, iFpppp) GO(valuePop, pFp) -GO(valuePush, iFpp) +GOM(valuePush, iFEpp) //GO(xlinkGetDefaultDetect, //GO(xlinkGetDefaultHandler, //GO(xlinkIsLink, @@ -243,7 +243,7 @@ GO(xmlCreateFileParserCtxt, pFp) GO(xmlCreateIntSubset, pFpppp) GOM(xmlCreateIOParserCtxt, pFEpppppi) GO(xmlCreateMemoryParserCtxt, pFpi) -GO(xmlCreatePushParserCtxt, pFpppip) +GOM(xmlCreatePushParserCtxt, pFEpppip) //GO(xmlCreateURI, GO(xmlCreateURLParserCtxt, pFpi) GO(xmlCtxtGetLastError, pFp) @@ -519,12 +519,12 @@ GO(xmlLoadExternalEntity, pFppp) //GO(xmlMemDisplay, //GO(xmlMemDisplayLast, //GO(xmlMemFree, -//GO(xmlMemGet, +GO(xmlMemGet, iFpppp) //GO(xmlMemMalloc, //GO(xmlMemoryDump, //GO(xmlMemoryStrdup, //GO(xmlMemRealloc, -//GO(xmlMemSetup, +GOM(xmlMemSetup, iFEpppp) //GO(xmlMemShow, //GO(xmlMemStrdupLoc, //GO(xmlMemUsed, @@ -1573,6 +1573,7 @@ GO(xmlXPathTrailingSorted, pFpp) GO(xmlXPathTranslateFunction, vFpi) GO(xmlXPathTrueFunction, vFpi) GO(xmlXPathValueFlipSign, vFp) +GO(xmlXPathValuePush, iFpp) GO(xmlXPathVariableLookup, pFpp) GO(xmlXPathVariableLookupNS, pFppp) GO(xmlXPathWrapCString, pFp) diff --git a/src/wrapped/wrappedxshmfence.c b/src/wrapped/wrappedxshmfence.c index e6f83b8..91c4e20 100644 --- a/src/wrapped/wrappedxshmfence.c +++ b/src/wrapped/wrappedxshmfence.c @@ -11,11 +11,8 @@ #include "librarian/library_private.h" #include "x64emu.h" -#ifdef ANDROID - const char* xshmfenceName = "libxshmfence.so"; -#else - const char* xshmfenceName = "libxshmfence.so.1"; -#endif +const char* xshmfenceName = "libxshmfence.so.1"; +#define ALTNAME "libxshmfence.so" #define LIBNAME xshmfence diff --git a/src/wrapped/wrappedxslt.c b/src/wrapped/wrappedxslt.c index 35bcc75..01cff42 100644 --- a/src/wrapped/wrappedxslt.c +++ b/src/wrapped/wrappedxslt.c @@ -17,13 +17,9 @@ #include "callback.h" #include "globalsymbols.h" -const char *xsltName = -#ifdef ANDROID - "libxslt.so" -#else - "libxslt.so.1" -#endif - ; +const char *xsltName = "libxslt.so.1"; +#define ALTNAME "libxslt.so" + #define LIBNAME xslt #define ADDED_FUNCTIONS() \ diff --git a/src/wrapped/wrappedzstd.c b/src/wrapped/wrappedzstd.c new file mode 100644 index 0000000..af9bf64 --- /dev/null +++ b/src/wrapped/wrappedzstd.c @@ -0,0 +1,19 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" + +const char* zstdName = "libzstd.so.1"; +#define LIBNAME zstd +#define ALTNAME "libzstd.so" + +#include "wrappedlib_init.h" + diff --git a/src/wrapped/wrappedzstd_private.h b/src/wrapped/wrappedzstd_private.h new file mode 100644 index 0000000..646d2cd --- /dev/null +++ b/src/wrapped/wrappedzstd_private.h @@ -0,0 +1,588 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//GO(COVER_best_destroy, +//GO(COVER_best_finish, +//GO(COVER_best_init, +//GO(COVER_best_start, +//GO(COVER_best_wait, +//GO(COVER_checkTotalCompressedSize, +//GO(COVER_computeEpochs, +//GO(COVER_dictSelectionError, +//GO(COVER_dictSelectionFree, +//GO(COVER_dictSelectionIsError, +//GO(COVER_selectDict, +//GO(COVER_sum, +//GO(COVER_warnOnSmallCorpus, +//GO(divbwt, +//GO(divsufsort, +//GO(ERR_getErrorString, +//GO(FSE_buildCTable, +//GO(FSE_buildCTable_raw, +//GO(FSE_buildCTable_rle, +//GO(FSE_buildCTable_wksp, +//GO(FSE_buildDTable, +//GO(FSE_buildDTable_raw, +//GO(FSE_buildDTable_rle, +//GO(FSE_buildDTable_wksp, +//GO(FSE_compress, +//GO(FSE_compress2, +//GO(FSE_compressBound, +//GO(FSE_compress_usingCTable, +//GO(FSE_compress_wksp, +//GO(FSE_createCTable, +//GO(FSE_createDTable, +//GO(FSE_decompress, +//GO(FSE_decompress_usingDTable, +//GO(FSE_decompress_wksp, +//GO(FSE_decompress_wksp_bmi2, +//GO(FSE_freeCTable, +//GO(FSE_freeDTable, +//GO(FSE_getErrorName, +//GO(FSE_isError, +//GO(FSE_NCountWriteBound, +//GO(FSE_normalizeCount, +//GO(FSE_optimalTableLog, +//GO(FSE_optimalTableLog_internal, +//GO(FSE_readNCount, +//GO(FSE_readNCount_bmi2, +//GO(FSEv05_buildDTable, +//GO(FSEv05_buildDTable_raw, +//GO(FSEv05_buildDTable_rle, +//GO(FSEv05_createDTable, +//GO(FSEv05_decompress, +//GO(FSEv05_decompress_usingDTable, +//GO(FSEv05_freeDTable, +//GO(FSEv05_getErrorName, +//GO(FSEv05_isError, +//GO(FSEv05_readNCount, +//GO(FSEv06_buildDTable, +//GO(FSEv06_buildDTable_raw, +//GO(FSEv06_buildDTable_rle, +//GO(FSEv06_createDTable, +//GO(FSEv06_decompress, +//GO(FSEv06_decompress_usingDTable, +//GO(FSEv06_freeDTable, +//GO(FSEv06_getErrorName, +//GO(FSEv06_isError, +//GO(FSEv06_readNCount, +//GO(FSEv07_buildDTable, +//GO(FSEv07_buildDTable_raw, +//GO(FSEv07_buildDTable_rle, +//GO(FSEv07_createDTable, +//GO(FSEv07_decompress, +//GO(FSEv07_decompress_usingDTable, +//GO(FSEv07_freeDTable, +//GO(FSEv07_getErrorName, +//GO(FSEv07_isError, +//GO(FSEv07_readNCount, +//GO(FSE_versionNumber, +//GO(FSE_writeNCount, +//DATAB(g_debuglevel, +//DATAB(g_ZSTD_threading_useless_symbol, +//GO(HIST_count, +//GO(HIST_countFast, +//GO(HIST_countFast_wksp, +//GO(HIST_count_simple, +//GO(HIST_count_wksp, +//GO(HIST_isError, +//GO(HUF_buildCTable, +//GO(HUF_buildCTable_wksp, +//GO(HUF_compress, +//GO(HUF_compress1X, +//GO(HUF_compress1X_repeat, +//GO(HUF_compress1X_usingCTable, +//GO(HUF_compress1X_wksp, +//GO(HUF_compress2, +//GO(HUF_compress4X_repeat, +//GO(HUF_compress4X_usingCTable, +//GO(HUF_compress4X_wksp, +//GO(HUF_compressBound, +//GO(HUF_decompress, +//GO(HUF_decompress1X1, +//GO(HUF_decompress1X1_DCtx, +//GO(HUF_decompress1X1_DCtx_wksp, +//GO(HUF_decompress1X1_DCtx_wksp_bmi2, +//GO(HUF_decompress1X1_usingDTable, +//GO(HUF_decompress1X2, +//GO(HUF_decompress1X2_DCtx, +//GO(HUF_decompress1X2_DCtx_wksp, +//GO(HUF_decompress1X2_usingDTable, +//GO(HUF_decompress1X_DCtx, +//GO(HUF_decompress1X_DCtx_wksp, +//GO(HUF_decompress1X_usingDTable, +//GO(HUF_decompress1X_usingDTable_bmi2, +//GO(HUF_decompress4X1, +//GO(HUF_decompress4X1_DCtx, +//GO(HUF_decompress4X1_DCtx_wksp, +//GO(HUF_decompress4X1_usingDTable, +//GO(HUF_decompress4X2, +//GO(HUF_decompress4X2_DCtx, +//GO(HUF_decompress4X2_DCtx_wksp, +//GO(HUF_decompress4X2_usingDTable, +//GO(HUF_decompress4X_DCtx, +//GO(HUF_decompress4X_hufOnly, +//GO(HUF_decompress4X_hufOnly_wksp, +//GO(HUF_decompress4X_hufOnly_wksp_bmi2, +//GO(HUF_decompress4X_usingDTable, +//GO(HUF_decompress4X_usingDTable_bmi2, +//GO(HUF_estimateCompressedSize, +//GO(HUF_getErrorName, +//GO(HUF_getNbBits, +//GO(HUF_isError, +//GO(HUF_optimalTableLog, +//GO(HUF_readCTable, +//GO(HUF_readDTableX1, +//GO(HUF_readDTableX1_wksp, +//GO(HUF_readDTableX1_wksp_bmi2, +//GO(HUF_readDTableX2, +//GO(HUF_readDTableX2_wksp, +//GO(HUF_readStats, +//GO(HUF_readStats_wksp, +//GO(HUF_selectDecoder, +//GO(HUFv05_decompress, +//GO(HUFv05_decompress1X2, +//GO(HUFv05_decompress1X2_usingDTable, +//GO(HUFv05_decompress1X4, +//GO(HUFv05_decompress1X4_usingDTable, +//GO(HUFv05_decompress4X2, +//GO(HUFv05_decompress4X2_usingDTable, +//GO(HUFv05_decompress4X4, +//GO(HUFv05_decompress4X4_usingDTable, +//GO(HUFv05_getErrorName, +//GO(HUFv05_isError, +//GO(HUFv05_readDTableX2, +//GO(HUFv05_readDTableX4, +//GO(HUFv06_decompress, +//GO(HUFv06_decompress1X2, +//GO(HUFv06_decompress1X2_usingDTable, +//GO(HUFv06_decompress1X4, +//GO(HUFv06_decompress1X4_usingDTable, +//GO(HUFv06_decompress4X2, +//GO(HUFv06_decompress4X2_usingDTable, +//GO(HUFv06_decompress4X4, +//GO(HUFv06_decompress4X4_usingDTable, +//GO(HUFv06_readDTableX2, +//GO(HUFv06_readDTableX4, +//GO(HUFv07_decompress, +//GO(HUFv07_decompress1X2, +//GO(HUFv07_decompress1X2_DCtx, +//GO(HUFv07_decompress1X2_usingDTable, +//GO(HUFv07_decompress1X4, +//GO(HUFv07_decompress1X4_DCtx, +//GO(HUFv07_decompress1X4_usingDTable, +//GO(HUFv07_decompress1X_DCtx, +//GO(HUFv07_decompress1X_usingDTable, +//GO(HUFv07_decompress4X2, +//GO(HUFv07_decompress4X2_DCtx, +//GO(HUFv07_decompress4X2_usingDTable, +//GO(HUFv07_decompress4X4, +//GO(HUFv07_decompress4X4_DCtx, +//GO(HUFv07_decompress4X4_usingDTable, +//GO(HUFv07_decompress4X_DCtx, +//GO(HUFv07_decompress4X_hufOnly, +//GO(HUFv07_decompress4X_usingDTable, +//GO(HUFv07_getErrorName, +//GO(HUFv07_isError, +//GO(HUFv07_readDTableX2, +//GO(HUFv07_readDTableX4, +//GO(HUFv07_readStats, +//GO(HUFv07_selectDecoder, +//GO(HUF_validateCTable, +//GO(HUF_writeCTable, +//GO(POOL_add, +//GO(POOL_create, +//GO(POOL_create_advanced, +//GO(POOL_free, +//GO(POOL_resize, +//GO(POOL_sizeof, +//GO(POOL_tryAdd, +//GO(ZBUFF_compressContinue, +//GO(ZBUFF_compressEnd, +//GO(ZBUFF_compressFlush, +//GO(ZBUFF_compressInit, +//GO(ZBUFF_compressInit_advanced, +//GO(ZBUFF_compressInitDictionary, +//GO(ZBUFF_createCCtx, +//GO(ZBUFF_createCCtx_advanced, +//GO(ZBUFF_createDCtx, +//GO(ZBUFF_createDCtx_advanced, +//GO(ZBUFF_decompressContinue, +//GO(ZBUFF_decompressInit, +//GO(ZBUFF_decompressInitDictionary, +//GO(ZBUFF_freeCCtx, +//GO(ZBUFF_freeDCtx, +//GO(ZBUFF_getErrorName, +//GO(ZBUFF_isError, +//GO(ZBUFF_recommendedCInSize, +//GO(ZBUFF_recommendedCOutSize, +//GO(ZBUFF_recommendedDInSize, +//GO(ZBUFF_recommendedDOutSize, +//GO(ZBUFFv05_createDCtx, +//GO(ZBUFFv05_decompressContinue, +//GO(ZBUFFv05_decompressInit, +//GO(ZBUFFv05_decompressInitDictionary, +//GO(ZBUFFv05_freeDCtx, +//GO(ZBUFFv05_getErrorName, +//GO(ZBUFFv05_isError, +//GO(ZBUFFv05_recommendedDInSize, +//GO(ZBUFFv05_recommendedDOutSize, +//GO(ZBUFFv06_createDCtx, +//GO(ZBUFFv06_decompressContinue, +//GO(ZBUFFv06_decompressInit, +//GO(ZBUFFv06_decompressInitDictionary, +//GO(ZBUFFv06_freeDCtx, +//GO(ZBUFFv06_getErrorName, +//GO(ZBUFFv06_isError, +//GO(ZBUFFv06_recommendedDInSize, +//GO(ZBUFFv06_recommendedDOutSize, +//GO(ZBUFFv07_createDCtx, +//GO(ZBUFFv07_createDCtx_advanced, +//GO(ZBUFFv07_decompressContinue, +//GO(ZBUFFv07_decompressInit, +//GO(ZBUFFv07_decompressInitDictionary, +//GO(ZBUFFv07_freeDCtx, +//GO(ZBUFFv07_getErrorName, +//GO(ZBUFFv07_isError, +//GO(ZBUFFv07_recommendedDInSize, +//GO(ZBUFFv07_recommendedDOutSize, +//GO(ZDICT_addEntropyTablesFromBuffer, +GO(ZDICT_finalizeDictionary, LFpLpLppuH) // last param afet LFpLpLppu is ZDICT_params_t, a struct with iuu +GO(ZDICT_getDictHeaderSize, LFpL) +GO(ZDICT_getDictID, uFpL) +GO(ZDICT_getErrorName, pFL) +GO(ZDICT_isError, uFL) +//GO(ZDICT_optimizeTrainFromBuffer_cover, +//GO(ZDICT_optimizeTrainFromBuffer_fastCover, +GO(ZDICT_trainFromBuffer, LFpLppu) +//GO(ZDICT_trainFromBuffer_cover, +//GO(ZDICT_trainFromBuffer_fastCover, +//GO(ZDICT_trainFromBuffer_legacy, +//GO(ZDICT_trainFromBuffer_unsafe_legacy, +//GO(ZSTD_adjustCParams, +//GO(ZSTD_buildCTable, +//GO(ZSTD_buildFSETable, +GO(ZSTD_CCtx_getParameter, LFpup) +GO(ZSTD_CCtx_loadDictionary, LFppL) +GO(ZSTD_CCtx_loadDictionary_advanced, LFppLuu) +GO(ZSTD_CCtx_loadDictionary_byReference, LFppL) +GO(ZSTD_CCtxParams_getParameter, LFpup) +GO(ZSTD_CCtxParams_init, LFpi) +//GO(ZSTD_CCtxParams_init_advanced, +GO(ZSTD_CCtxParams_reset, LFp) +GO(ZSTD_CCtxParams_setParameter, LFpui) +GO(ZSTD_CCtx_refCDict, LFpp) +GO(ZSTD_CCtx_refPrefix, LFppL) +GO(ZSTD_CCtx_refPrefix_advanced, LFppLu) +GO(ZSTD_CCtx_refThreadPool, LFpp) +GO(ZSTD_CCtx_reset, LFpu) +GO(ZSTD_CCtx_setParameter, LFpui) +GO(ZSTD_CCtx_setParametersUsingCCtxParams, LFpp) +GO(ZSTD_CCtx_setPledgedSrcSize, LFpU) +//GO(ZSTD_checkContinuity, +//GO(ZSTD_checkCParams, +GO(ZSTD_compress, LFpLpLi) +GO(ZSTD_compress2, LFppLpL) +//GO(ZSTD_compress_advanced, +//GO(ZSTD_compress_advanced_internal, +GO(ZSTD_compressBegin, LFpi) +//GO(ZSTD_compressBegin_advanced, +//GO(ZSTD_compressBegin_advanced_internal, +GO(ZSTD_compressBegin_usingCDict, LFpp) +//GO(ZSTD_compressBegin_usingCDict_advanced, +GO(ZSTD_compressBegin_usingDict, LFppLi) +GO(ZSTD_compressBlock, LFppLpL) +//GO(ZSTD_compressBlock_btlazy2, +//GO(ZSTD_compressBlock_btlazy2_dictMatchState, +//GO(ZSTD_compressBlock_btlazy2_extDict, +//GO(ZSTD_compressBlock_btopt, +//GO(ZSTD_compressBlock_btopt_dictMatchState, +//GO(ZSTD_compressBlock_btopt_extDict, +//GO(ZSTD_compressBlock_btultra, +//GO(ZSTD_compressBlock_btultra2, +//GO(ZSTD_compressBlock_btultra_dictMatchState, +//GO(ZSTD_compressBlock_btultra_extDict, +//GO(ZSTD_compressBlock_doubleFast, +//GO(ZSTD_compressBlock_doubleFast_dictMatchState, +//GO(ZSTD_compressBlock_doubleFast_extDict, +//GO(ZSTD_compressBlock_fast, +//GO(ZSTD_compressBlock_fast_dictMatchState, +//GO(ZSTD_compressBlock_fast_extDict, +//GO(ZSTD_compressBlock_greedy, +//GO(ZSTD_compressBlock_greedy_dedicatedDictSearch, +//GO(ZSTD_compressBlock_greedy_dictMatchState, +//GO(ZSTD_compressBlock_greedy_extDict, +//GO(ZSTD_compressBlock_lazy, +//GO(ZSTD_compressBlock_lazy2, +//GO(ZSTD_compressBlock_lazy2_dedicatedDictSearch, +//GO(ZSTD_compressBlock_lazy2_dictMatchState, +//GO(ZSTD_compressBlock_lazy2_extDict, +//GO(ZSTD_compressBlock_lazy_dedicatedDictSearch, +//GO(ZSTD_compressBlock_lazy_dictMatchState, +//GO(ZSTD_compressBlock_lazy_extDict, +GO(ZSTD_compressBound, LFL) +GO(ZSTD_compressCCtx, LFppLpLi) +GO(ZSTD_compressContinue, LFppLpL) +GO(ZSTD_compressEnd, LFppLpL) +//GO(ZSTD_compressLiterals, +//GO(ZSTD_compressRleLiteralsBlock, +GO(ZSTD_compressSequences, LFppLpLpL) +GO(ZSTD_compressStream, LFppp) +GO(ZSTD_compressStream2, LFpppu) +GO(ZSTD_compressStream2_simpleArgs, LFppLppLpu) +//GO(ZSTD_compressSuperBlock, +GO(ZSTD_compress_usingCDict, LFppLpLp) +//GO(ZSTD_compress_usingCDict_advanced, +GO(ZSTD_compress_usingDict, LFppLpLpLi) +GO(ZSTD_copyCCtx, LFppU) +GO(ZSTD_copyDCtx, vFpp) +//GO(ZSTD_copyDDictParameters, +GO(ZSTD_cParam_getBounds, HFu) +GO(ZSTD_createCCtx, pFv) +//GO(ZSTD_createCCtx_advanced, +GO(ZSTD_createCCtxParams, pFv) +GO(ZSTD_createCDict, pFpLi) +//GO(ZSTD_createCDict_advanced, +//GO(ZSTD_createCDict_advanced2, +GO(ZSTD_createCDict_byReference, pFpLi) +GO(ZSTD_createCStream, pFv) +//GO(ZSTD_createCStream_advanced, +GO(ZSTD_createDCtx, pFv) +//GO(ZSTD_createDCtx_advanced, +GO(ZSTD_createDDict, pFpL) +//GO(ZSTD_createDDict_advanced, +GO(ZSTD_createDDict_byReference, pFpL) +GO(ZSTD_createDStream, pFv) +//GO(ZSTD_createDStream_advanced, +//GO(ZSTD_crossEntropyCost, +GO(ZSTD_CStreamInSize, LFv) +GO(ZSTD_CStreamOutSize, LFv) +//GO(ZSTD_customCalloc, +//GO(ZSTD_customFree, +//GO(ZSTD_customMalloc, +//GO(ZSTD_cycleLog, +GO(ZSTD_DCtx_getParameter, LFpup) +GO(ZSTD_DCtx_loadDictionary, LFppL) +GO(ZSTD_DCtx_loadDictionary_advanced, LFppLuu) +GO(ZSTD_DCtx_loadDictionary_byReference, LFppL) +GO(ZSTD_DCtx_refDDict, LFpp) +GO(ZSTD_DCtx_refPrefix, LFppL) +GO(ZSTD_DCtx_refPrefix_advanced, LFppLu) +GO(ZSTD_DCtx_reset, LFpu) +GO(ZSTD_DCtx_setFormat, LFpu) +GO(ZSTD_DCtx_setMaxWindowSize, LFpL) +GO(ZSTD_DCtx_setParameter, LFpui) +//GO(ZSTD_DDict_dictContent, +//GO(ZSTD_DDict_dictSize, +//GO(ZSTD_decodeLiteralsBlock, +//GO(ZSTD_decodeSeqHeaders, +GO(ZSTD_decodingBufferSize_min, LFUU) +GO(ZSTD_decompress, LFpLpL) +GO(ZSTD_decompressBegin, LFp) +GO(ZSTD_decompressBegin_usingDDict, LFpp) +GO(ZSTD_decompressBegin_usingDict, LFppL) +GO(ZSTD_decompressBlock, LFppLpL) +//GO(ZSTD_decompressBlock_internal, +GO(ZSTD_decompressBound, UFpL) +GO(ZSTD_decompressContinue, LFppLpL) +GO(ZSTD_decompressDCtx, LFppLpL) +GO(ZSTD_decompressStream, LFppp) +GO(ZSTD_decompressStream_simpleArgs, LFppLppLp) +GO(ZSTD_decompress_usingDDict, LFppLpLp) +GO(ZSTD_decompress_usingDict, LFppLpLpL) +//GO(ZSTD_dedicatedDictSearch_lazy_loadDictionary, +GO(ZSTD_defaultCLevel, iFv) +GO(ZSTD_dParam_getBounds, HFu) +GO(ZSTD_DStreamInSize, LFv) +GO(ZSTD_DStreamOutSize, LFv) +//GO(ZSTD_encodeSequences, +GO(ZSTD_endStream, LFpp) +GO(ZSTD_estimateCCtxSize, LFi) +GO(ZSTD_estimateCCtxSize_usingCCtxParams, LFp) +//GO(ZSTD_estimateCCtxSize_usingCParams, +GO(ZSTD_estimateCDictSize, LFLi) +//GO(ZSTD_estimateCDictSize_advanced, +GO(ZSTD_estimateCStreamSize, LFi) +GO(ZSTD_estimateCStreamSize_usingCCtxParams, LFp) +//GO(ZSTD_estimateCStreamSize_usingCParams, +GO(ZSTD_estimateDCtxSize, LFv) +GO(ZSTD_estimateDDictSize, LFLu) +GO(ZSTD_estimateDStreamSize, LFL) +GO(ZSTD_estimateDStreamSize_fromFrame, LFpL) +//GO(ZSTD_fillDoubleHashTable, +//GO(ZSTD_fillHashTable, +GO(ZSTD_findDecompressedSize, UFpL) +GO(ZSTD_findFrameCompressedSize, LFpL) +GO(ZSTD_flushStream, LFpp) +GO(ZSTD_frameHeaderSize, LFpL) +GO(ZSTD_freeCCtx, LFp) +GO(ZSTD_freeCCtxParams, LFp) +GO(ZSTD_freeCDict, LFp) +GO(ZSTD_freeCStream, LFp) +GO(ZSTD_freeDCtx, LFp) +GO(ZSTD_freeDDict, LFp) +GO(ZSTD_freeDStream, LFp) +//GO(ZSTD_fseBitCost, +GO(ZSTD_generateSequences, LFppLpL) +GO(ZSTD_getBlockSize, LFp) +//GO(ZSTD_getcBlockSize, +GO(ZSTD_getCParams, pFpiUL) +//GO(ZSTD_getCParamsFromCCtxParams, +//GO(ZSTD_getCParamsFromCDict, +GO(ZSTD_getDecompressedSize, UFpL) +GO(ZSTD_getDictID_fromCDict, uFp) +GO(ZSTD_getDictID_fromDDict, uFp) +GO(ZSTD_getDictID_fromDict, uFpL) +GO(ZSTD_getDictID_fromFrame, uFpL) +GO(ZSTD_getErrorCode, uFL) +GO(ZSTD_getErrorName, pFL) +GO(ZSTD_getErrorString, pFu) +GO(ZSTD_getFrameContentSize, UFpL) +GO(ZSTD_getFrameHeader, LFppL) +GO(ZSTD_getFrameHeader_advanced, LFppLu) +GO(ZSTD_getFrameProgression, pFpp) +GO(ZSTD_getParams, pFpiUL) +//GO(ZSTD_getSeqStore, +GO(ZSTD_initCStream, LFpi) +//GO(ZSTD_initCStream_advanced, +//GO(ZSTD_initCStream_internal, +GO(ZSTD_initCStream_srcSize, LFpiU) +GO(ZSTD_initCStream_usingCDict, LFpp) +//GO(ZSTD_initCStream_usingCDict_advanced, +GO(ZSTD_initCStream_usingDict, LFppLi) +GO(ZSTD_initDStream, LFp) +GO(ZSTD_initDStream_usingDDict, LFpp) +GO(ZSTD_initDStream_usingDict, LFppL) +GO(ZSTD_initStaticCCtx, pFpL) +//GO(ZSTD_initStaticCDict, +GO(ZSTD_initStaticCStream, pFpL) +GO(ZSTD_initStaticDCtx, pFpL) +GO(ZSTD_initStaticDDict, pFpLpLuu) +GO(ZSTD_initStaticDStream, pFpL) +//GO(ZSTD_insertAndFindFirstIndex, +GO(ZSTD_insertBlock, LFppL) +//GO(ZSTD_invalidateRepCodes, +GO(ZSTD_isError, uFL) +GO(ZSTD_isFrame, uFpL) +//GO(ZSTD_ldm_adjustParameters, +//GO(ZSTD_ldm_blockCompress, +//GO(ZSTD_ldm_fillHashTable, +//GO(ZSTD_ldm_generateSequences, +//GO(ZSTD_ldm_getMaxNbSeq, +//GO(ZSTD_ldm_getTableSize, +//GO(ZSTD_ldm_skipRawSeqStoreBytes, +//GO(ZSTD_ldm_skipSequences, +//GO(ZSTD_loadCEntropy, +//GO(ZSTD_loadDEntropy, +GO(ZSTD_maxCLevel, iFv) +GO(ZSTD_mergeBlockDelimiters, LFpL) +GO(ZSTD_minCLevel, iFv) +//GO(ZSTDMT_compressStream_generic, +//GO(ZSTDMT_createCCtx_advanced, +//GO(ZSTDMT_freeCCtx, +//GO(ZSTDMT_getFrameProgression, +//GO(ZSTDMT_initCStream_internal, +//GO(ZSTDMT_nextInputSizeHint, +//GO(ZSTDMT_sizeof_CCtx, +//GO(ZSTDMT_toFlushNow, +//GO(ZSTDMT_updateCParams_whileCompressing, +GO(ZSTD_nextInputType, uFp) +GO(ZSTD_nextSrcSizeToDecompress, LFp) +//GO(ZSTD_noCompressLiterals, +//GO(ZSTD_referenceExternalSequences, +//GO(ZSTD_reset_compressedBlockState, +GO(ZSTD_resetCStream, LFpU) +GO(ZSTD_resetDStream, LFp) +//GO(ZSTD_resetSeqStore, +//GO(ZSTD_selectBlockCompressor, +//GO(ZSTD_selectEncodingType, +//GO(ZSTD_seqToCodes, +GO(ZSTD_sizeof_CCtx, LFp) +GO(ZSTD_sizeof_CDict, LFp) +GO(ZSTD_sizeof_CStream, LFp) +GO(ZSTD_sizeof_DCtx, LFp) +GO(ZSTD_sizeof_DDict, LFp) +GO(ZSTD_sizeof_DStream, LFp) +GO(ZSTD_toFlushNow, LFp) +//GO(ZSTD_updateTree, +//GO(ZSTDv05_copyDCtx, +//GO(ZSTDv05_createDCtx, +//GO(ZSTDv05_decompress, +//GO(ZSTDv05_decompressBegin, +//GO(ZSTDv05_decompressBegin_usingDict, +//GO(ZSTDv05_decompressBlock, +//GO(ZSTDv05_decompressContinue, +//GO(ZSTDv05_decompressDCtx, +//GO(ZSTDv05_decompress_usingDict, +//GO(ZSTDv05_decompress_usingPreparedDCtx, +//GO(ZSTDv05_findFrameSizeInfoLegacy, +//GO(ZSTDv05_freeDCtx, +//GO(ZSTDv05_getErrorName, +//GO(ZSTDv05_getFrameParams, +//GO(ZSTDv05_isError, +//GO(ZSTDv05_nextSrcSizeToDecompress, +//GO(ZSTDv05_sizeofDCtx, +//GO(ZSTDv06_copyDCtx, +//GO(ZSTDv06_createDCtx, +//GO(ZSTDv06_decompress, +//GO(ZSTDv06_decompressBegin, +//GO(ZSTDv06_decompressBegin_usingDict, +//GO(ZSTDv06_decompressBlock, +//GO(ZSTDv06_decompressContinue, +//GO(ZSTDv06_decompressDCtx, +//GO(ZSTDv06_decompress_usingDict, +//GO(ZSTDv06_decompress_usingPreparedDCtx, +//GO(ZSTDv06_findFrameSizeInfoLegacy, +//GO(ZSTDv06_freeDCtx, +//GO(ZSTDv06_getErrorName, +//GO(ZSTDv06_getFrameParams, +//GO(ZSTDv06_isError, +//GO(ZSTDv06_nextSrcSizeToDecompress, +//GO(ZSTDv06_sizeofDCtx, +//GO(ZSTDv07_copyDCtx, +//GO(ZSTDv07_createDCtx, +//GO(ZSTDv07_createDCtx_advanced, +//GO(ZSTDv07_createDDict, +//GO(ZSTDv07_decompress, +//GO(ZSTDv07_decompressBegin, +//GO(ZSTDv07_decompressBegin_usingDict, +//GO(ZSTDv07_decompressBlock, +//GO(ZSTDv07_decompressContinue, +//GO(ZSTDv07_decompressDCtx, +//GO(ZSTDv07_decompress_usingDDict, +//GO(ZSTDv07_decompress_usingDict, +//GO(ZSTDv07_estimateDCtxSize, +//GO(ZSTDv07_findFrameSizeInfoLegacy, +//GO(ZSTDv07_freeDCtx, +//GO(ZSTDv07_freeDDict, +//GO(ZSTDv07_getDecompressedSize, +//GO(ZSTDv07_getErrorName, +//GO(ZSTDv07_getFrameParams, +//GO(ZSTDv07_insertBlock, +//GO(ZSTDv07_isError, +//GO(ZSTDv07_isSkipFrame, +//GO(ZSTDv07_nextSrcSizeToDecompress, +//GO(ZSTDv07_sizeofDCtx, +GO(ZSTD_versionNumber, uFv) +GO(ZSTD_versionString, pFv) +//GO(ZSTD_writeLastEmptyBlock, +//GO(ZSTD_XXH32, +//GO(ZSTD_XXH32_canonicalFromHash, +//GO(ZSTD_XXH32_copyState, +//GO(ZSTD_XXH32_createState, +//GO(ZSTD_XXH32_digest, +//GO(ZSTD_XXH32_freeState, +//GO(ZSTD_XXH32_hashFromCanonical, +//GO(ZSTD_XXH32_reset, +//GO(ZSTD_XXH32_update, +//GO(ZSTD_XXH64, +//GO(ZSTD_XXH64_canonicalFromHash, +//GO(ZSTD_XXH64_copyState, +//GO(ZSTD_XXH64_createState, +//GO(ZSTD_XXH64_digest, +//GO(ZSTD_XXH64_freeState, +//GO(ZSTD_XXH64_hashFromCanonical, +//GO(ZSTD_XXH64_reset, +//GO(ZSTD_XXH64_update, +//GO(ZSTD_XXH_versionNumber, diff --git a/src/wrapped32/generated/converter32.c b/src/wrapped32/generated/converter32.c new file mode 100644 index 0000000..c220a3d --- /dev/null +++ b/src/wrapped32/generated/converter32.c @@ -0,0 +1,1139 @@ +// Manually created for now +#include "converter32.h" + +void from_struct_p(struct_p_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_p(ptr_t d, const struct_p_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; +} + +void from_struct_l(struct_l_t *dest, ptr_t s) { + if(!s) return; + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_long(*(long_t*)src); src += 4; +} +void to_struct_l(ptr_t d, const struct_l_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(long_t*)dest = to_long(src->L0); dest += 4; +} + +void from_struct_L(struct_L_t *dest, ptr_t s) { + if(!s) return; + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(ulong_t*)src); src += 4; +} +void to_struct_L(ptr_t d, const struct_L_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; +} + +void from_struct_ll(struct_ll_t *dest, ptr_t s) { + if(!s) return; + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_long(*(long_t*)src); src += 4; + dest->L1 = from_long(*(long_t*)src); src += 4; +} +void to_struct_ll(ptr_t d, const struct_ll_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(long_t*)dest = to_long(src->L0); dest += 4; + *(long_t*)dest = to_long(src->L1); dest += 4; +} + +void from_struct_LL(struct_LL_t *dest, ptr_t s) { + if(!s) return; + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(ulong_t*)src); src += 4; + dest->L1 = from_ulong(*(ulong_t*)src); src += 4; +} +void to_struct_LL(ptr_t d, const struct_LL_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(ulong_t*)dest = to_ulong(src->L1); dest += 4; +} +void from_struct_LC(struct_LC_t *dest, ptr_t s) { + if(!s) return; + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(ulong_t*)src); src += 4; + dest->C1 = *(uint8_t*)src; src += 1; +} +void to_struct_LC(ptr_t d, const struct_LC_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(uint8_t*)dest = to_ulong(src->C1); dest += 1; +} + +void from_struct_liu(struct_liu_t *dest, ptr_t s) { + if(!s) return; + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->l0 = from_long(*(long_t*)src); src += 4; + dest->i1 = *(int*)src; src += 4; + dest->u2 = *(uint32_t*)src; src += 4; +} +void to_struct_liu(ptr_t d, const struct_liu_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(long_t*)dest = to_long(src->l0); dest += 4; + *(int*)dest = src->i1; dest += 2; + *(uint32_t*)dest = src->u2; dest += 2; +} + +void from_struct_llll(struct_llll_t *dest, ptr_t s) { + if(!s) return; + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->l0 = from_long(*(ulong_t*)src); src += 4; + dest->l1 = from_long(*(ulong_t*)src); src += 4; + dest->l2 = from_long(*(ulong_t*)src); src += 4; + dest->l3 = from_long(*(ulong_t*)src); src += 4; +} +void to_struct_llll(ptr_t d, const struct_llll_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_long(src->l0); dest += 4; + *(ulong_t*)dest = to_long(src->l1); dest += 4; + *(ulong_t*)dest = to_long(src->l2); dest += 4; + *(ulong_t*)dest = to_long(src->l3); dest += 4; +} + +void from_struct_LLLL(struct_LLLL_t *dest, ptr_t s) { + if(!s) return; + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(ulong_t*)src); src += 4; + dest->L1 = from_ulong(*(ulong_t*)src); src += 4; + dest->L2 = from_ulong(*(ulong_t*)src); src += 4; + dest->L3 = from_ulong(*(ulong_t*)src); src += 4; +} +void to_struct_LLLL(ptr_t d, const struct_LLLL_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(ulong_t*)dest = to_ulong(src->L1); dest += 4; + *(ulong_t*)dest = to_ulong(src->L2); dest += 4; + *(ulong_t*)dest = to_ulong(src->L3); dest += 4; +} + +void from_struct_LLLLLLLLLL(struct_LLLLLLLLLL_t *dest, ptr_t s) { + if(!s) return; + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(ulong_t*)src); src += 4; + dest->L1 = from_ulong(*(ulong_t*)src); src += 4; + dest->L2 = from_ulong(*(ulong_t*)src); src += 4; + dest->L3 = from_ulong(*(ulong_t*)src); src += 4; + dest->L4 = from_ulong(*(ulong_t*)src); src += 4; + dest->L5 = from_ulong(*(ulong_t*)src); src += 4; + dest->L6 = from_ulong(*(ulong_t*)src); src += 4; + dest->L7 = from_ulong(*(ulong_t*)src); src += 4; + dest->L8 = from_ulong(*(ulong_t*)src); src += 4; + dest->L9 = from_ulong(*(ulong_t*)src); src += 4; +} +void to_struct_LLLLLLLLLL(ptr_t d, const struct_LLLLLLLLLL_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(ulong_t*)dest = to_ulong(src->L1); dest += 4; + *(ulong_t*)dest = to_ulong(src->L2); dest += 4; + *(ulong_t*)dest = to_ulong(src->L3); dest += 4; + *(ulong_t*)dest = to_ulong(src->L4); dest += 4; + *(ulong_t*)dest = to_ulong(src->L5); dest += 4; + *(ulong_t*)dest = to_ulong(src->L6); dest += 4; + *(ulong_t*)dest = to_ulong(src->L7); dest += 4; + *(ulong_t*)dest = to_ulong(src->L8); dest += 4; + *(ulong_t*)dest = to_ulong(src->L9); dest += 4; +} + +void from_struct_LLLLLLLLLLLLLLLLLL(struct_LLLLLLLLLLLLLLLLLL_t *dest, ptr_t s) { + if(!s) return; + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(ulong_t*)src); src += 4; + dest->L1 = from_ulong(*(ulong_t*)src); src += 4; + dest->L2 = from_ulong(*(ulong_t*)src); src += 4; + dest->L3 = from_ulong(*(ulong_t*)src); src += 4; + dest->L4 = from_ulong(*(ulong_t*)src); src += 4; + dest->L5 = from_ulong(*(ulong_t*)src); src += 4; + dest->L6 = from_ulong(*(ulong_t*)src); src += 4; + dest->L7 = from_ulong(*(ulong_t*)src); src += 4; + dest->L8 = from_ulong(*(ulong_t*)src); src += 4; + dest->L9 = from_ulong(*(ulong_t*)src); src += 4; + dest->L10 = from_ulong(*(ulong_t*)src); src += 4; + dest->L11 = from_ulong(*(ulong_t*)src); src += 4; + dest->L12 = from_ulong(*(ulong_t*)src); src += 4; + dest->L13 = from_ulong(*(ulong_t*)src); src += 4; + dest->L14 = from_ulong(*(ulong_t*)src); src += 4; + dest->L15 = from_ulong(*(ulong_t*)src); src += 4; + dest->L16 = from_ulong(*(ulong_t*)src); src += 4; + dest->L17 = from_ulong(*(ulong_t*)src); src += 4; +} +void to_struct_LLLLLLLLLLLLLLLLLL(ptr_t d, const struct_LLLLLLLLLLLLLLLLLL_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(ulong_t*)dest = to_ulong(src->L1); dest += 4; + *(ulong_t*)dest = to_ulong(src->L2); dest += 4; + *(ulong_t*)dest = to_ulong(src->L3); dest += 4; + *(ulong_t*)dest = to_ulong(src->L4); dest += 4; + *(ulong_t*)dest = to_ulong(src->L5); dest += 4; + *(ulong_t*)dest = to_ulong(src->L6); dest += 4; + *(ulong_t*)dest = to_ulong(src->L7); dest += 4; + *(ulong_t*)dest = to_ulong(src->L8); dest += 4; + *(ulong_t*)dest = to_ulong(src->L9); dest += 4; + *(ulong_t*)dest = to_ulong(src->L10); dest += 4; + *(ulong_t*)dest = to_ulong(src->L11); dest += 4; + *(ulong_t*)dest = to_ulong(src->L12); dest += 4; + *(ulong_t*)dest = to_ulong(src->L13); dest += 4; + *(ulong_t*)dest = to_ulong(src->L14); dest += 4; + *(ulong_t*)dest = to_ulong(src->L15); dest += 4; + *(ulong_t*)dest = to_ulong(src->L16); dest += 4; + *(ulong_t*)dest = to_ulong(src->L17); dest += 4; +} + +void from_struct_LpCC(struct_LpCC_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(ulong_t*)src); src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; + dest->C2 = *(uint8_t*)src; src += 1; + dest->C3 = *(uint8_t*)src; src += 1; +} +void to_struct_LpCC(ptr_t d, const struct_LpCC_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; + *(uint8_t*)dest = src->C2; dest += 1; + *(uint8_t*)dest = src->C3; dest += 1; +} + +void from_struct_h(struct_h_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->h0 = from_hash(*(ulong_t*)src); src += 4; +} +void to_struct_h(ptr_t d, const struct_h_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_hash(src->h0); dest += 4; +} + +void from_struct_H(struct_H_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->H0 = from_hash_d(*(ulong_t*)src); src += 4; +} +void to_struct_H(ptr_t d, const struct_H_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_hash_d(src->H0); dest += 4; +} + +void from_struct_pL(struct_pL_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->L1 = from_ulong(*(long_t*)src); src += 4; +} +void to_struct_pL(ptr_t d, const struct_pL_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ulong_t*)dest = to_ulong(src->L1); dest += 4; +} + +void from_struct_ppppii(struct_ppppii_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p2 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p3 = from_ptrv(*(ptr_t*)src); src += 4; + dest->i4 = *(int*)src; src += 4; + dest->i5 = *(int*)src; src += 4; +} +void to_struct_ppppii(ptr_t d, const struct_ppppii_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p2); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p3); dest += 4; + *(int*)dest = src->i4; dest += 4; + *(int*)dest = src->i5; dest += 4; +} + +void from_struct_ppppp(struct_ppppp_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p2 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p3 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p4 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_ppppp(ptr_t d, const struct_ppppp_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p2); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p3); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p4); dest += 4; +} + +void from_struct_iiiiiiiiilt(struct_iiiiiiiiilt_t* dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->i0 = *(int*)src; src += 4; + dest->i1 = *(int*)src; src += 4; + dest->i2 = *(int*)src; src += 4; + dest->i3 = *(int*)src; src += 4; + dest->i4 = *(int*)src; src += 4; + dest->i5 = *(int*)src; src += 4; + dest->i6 = *(int*)src; src += 4; + dest->i7 = *(int*)src; src += 4; + dest->i8 = *(int*)src; src += 4; + dest->l9 = from_long(*(long_t*)src); src += 4; + dest->p10 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_iiiiiiiiilt(ptr_t d, const struct_iiiiiiiiilt_t* src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(int*)dest = src->i0; dest += 4; + *(int*)dest = src->i1; dest += 4; + *(int*)dest = src->i2; dest += 4; + *(int*)dest = src->i3; dest += 4; + *(int*)dest = src->i4; dest += 4; + *(int*)dest = src->i5; dest += 4; + *(int*)dest = src->i6; dest += 4; + *(int*)dest = src->i7; dest += 4; + *(int*)dest = src->i8; dest += 4; + *(long_t*)dest = to_long(src->l9); dest += 4; + *(ptr_t*)dest = to_cstring(src->p10); dest += 4; +} +void from_struct_up(struct_up_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->u0 = *(uint32_t*)src; src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_up(ptr_t d, const struct_up_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(uint32_t*)dest = src->u0; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; +} +void from_struct_upi(struct_upi_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->u0 = *(uint32_t*)src; src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; + dest->i2 = *(int*)src; src += 4; +} +void to_struct_upi(ptr_t d, const struct_upi_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(uint32_t*)dest = src->u0; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; + *(int*)dest = src->i2; dest += 4; +} +void from_struct_Ldd(struct_Ldd_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(ulong_t*)src); src += 4; + dest->d1 = *(double*)src; src += 8; + dest->d2 = *(double*)src; src += 8; +} +void to_struct_Ldd(ptr_t d, const struct_Ldd_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(double*)dest = src->d1; dest += 8; + *(double*)dest = src->d2; dest += 8; +} + +void from_struct_upu(struct_upu_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->u0 = *(uint32_t*)src; src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; + dest->u2 = *(uint32_t*)src; src += 4; +} +void to_struct_upu(ptr_t d, const struct_upu_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(uint32_t*)dest = src->u0; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; + *(uint32_t*)dest = src->u2; dest += 4; +} + +void from_struct_LWWWcc(struct_LWWWcc_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(uint32_t*)src); src += 4; + dest->W1 = *(uint16_t*)src; src += 2; + dest->W2 = *(uint16_t*)src; src += 2; + dest->W3 = *(uint16_t*)src; src += 2; + dest->c4 = *(char*)src; src += 1; + dest->c5 = *(char*)src; src += 1; +} +void to_struct_LWWWcc(ptr_t d, const struct_LWWWcc_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(uint32_t*)dest = to_ulong(src->L0); dest += 4; + *(uint16_t*)dest = src->W1; dest += 2; + *(uint16_t*)dest = src->W2; dest += 2; + *(uint16_t*)dest = src->W3; dest += 2; + *(char*)dest = src->c4; dest += 1; + *(char*)dest = src->c5; dest += 1; +} +void from_struct_pLiL(struct_pLiL_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->L1 = from_ulong(*(ulong_t*)src); src += 4; + dest->i2 = *(int*)src; src += 4; + dest->L3 = from_ulong(*(ulong_t*)src); src += 4; +} +void to_struct_pLiL(ptr_t d, const struct_pLiL_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ulong_t*)dest = to_ulong(src->L1); dest += 4; + *(int*)dest = src->i2; dest += 4; + *(ulong_t*)dest = to_ulong(src->L3); dest += 4; +} +void from_struct_Lip(struct_Lip_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(ulong_t*)src); src += 4; + dest->i1 = *(int*)src; src += 4; + dest->p2 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_Lip(ptr_t d, const struct_Lip_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(int*)dest = src->i1; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p2); dest += 4; +} +void from_struct_Lipi(struct_Lipi_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(ulong_t*)src); src += 4; + dest->i1 = *(int*)src; src += 4; + dest->p2 = from_ptrv(*(ptr_t*)src); src += 4; + dest->i3 = *(int*)src; src += 4; +} +void to_struct_Lipi(ptr_t d, const struct_Lipi_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(int*)dest = src->i1; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p2); dest += 4; + *(int*)dest = src->i3; dest += 4; +} +void from_struct_LLii(struct_LLii_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(ulong_t*)src); src += 4; + dest->L1 = from_ulong(*(ulong_t*)src); src += 4; + dest->i2 = *(int*)src; src += 4; + dest->i3 = *(int*)src; src += 4; +} +void to_struct_LLii(ptr_t d, const struct_LLii_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(ulong_t*)dest = to_ulong(src->L1); dest += 4; + *(int*)dest = src->i2; dest += 4; + *(int*)dest = src->i3; dest += 4; +} +void from_struct_uuipWCCp(struct_uuipWCCp_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->u0 = *(uint32_t*)src; src += 4; + dest->u1 = *(uint32_t*)src; src += 4; + dest->i2 = *(int*)src; src += 4; + dest->p3 = from_ptrv(*(ptr_t*)src); src += 4; + dest->u4 = *(uint16_t*)src; src += 2; + dest->u5 = *(uint8_t*)src; src += 1; + dest->u6 = *(uint8_t*)src; src += 1; + dest->p7 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_uuipWCCp(ptr_t d, const struct_uuipWCCp_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(uint32_t*)dest = src->u0; dest += 4; + *(uint32_t*)dest = src->u1; dest += 4; + *(int*)dest = src->i2; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p3); dest += 4; + *(uint16_t*)dest = src->u4; dest += 2; + *(uint8_t*)dest = src->u5; dest += 1; + *(uint8_t*)dest = src->u6; dest += 1; + *(ptr_t*)dest = to_ptrv(src->p7); dest += 4; +} + +void from_struct_pLiLLLii(struct_pLiLLLii_t *dest, ptr_t s) +{ + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->L1 = from_ulong(*(ulong_t*)src); src += 4; + dest->i2 = *(int*)src; src += 4; + dest->L3 = from_ulong(*(ulong_t*)src); src += 4; + dest->L4 = from_ulong(*(ulong_t*)src); src += 4; + dest->L5 = from_ulong(*(ulong_t*)src); src += 4; + dest->i6 = *(int*)src; src += 4; + dest->i7 = *(int*)src; src += 4; +} +void to_struct_pLiLLLii(ptr_t d, const struct_pLiLLLii_t *src) +{ + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ulong_t*)dest = to_ulong(src->L1); dest += 4; + *(int*)dest = src->i2; dest += 4; + *(ulong_t*)dest = to_ulong(src->L3); dest += 4; + *(ulong_t*)dest = to_ulong(src->L4); dest += 4; + *(ulong_t*)dest = to_ulong(src->L5); dest += 4; + *(int*)dest = src->i6; dest += 4; + *(int*)dest = src->i7; dest += 4; +} + +void from_struct_WWpWpWpWp(struct_WWpWpWpWp_t *dest, ptr_t s) +{ + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->W0 = *(uint16_t*)src; src += 2; + dest->W1 = *(uint16_t*)src; src += 2; + dest->p2 = from_ptrv(*(ptr_t*)src); src += 4; + dest->W3 = *(uint16_t*)src; src += 4; // align + dest->p4 = from_ptrv(*(ptr_t*)src); src += 4; + dest->W5 = *(uint16_t*)src; src += 4; // align + dest->p6 = from_ptrv(*(ptr_t*)src); src += 4; + dest->W7 = *(uint16_t*)src; src += 4; // align + dest->p8 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_WWpWpWpWp(ptr_t d, const struct_WWpWpWpWp_t *src) +{ + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(uint16_t*)dest = src->W0; dest += 2; + *(uint16_t*)dest = src->W1; dest += 2; + *(ptr_t*)dest = to_ptrv(src->p2); dest += 4; + *(uint16_t*)dest = src->W3; dest += 4; // align + *(ptr_t*)dest = to_ptrv(src->p4); dest += 4; + *(uint16_t*)dest = src->W5; dest += 4; // align + *(ptr_t*)dest = to_ptrv(src->p6); dest += 4; + *(uint16_t*)dest = src->W7; dest += 4; // align + *(ptr_t*)dest = to_ptrv(src->p8); dest += 4; +} + +void from_struct_pi(struct_pi_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->i1 = *(int*)src; src += 4; +} +void to_struct_pi(ptr_t d, const struct_pi_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(int*)dest = src->i1; dest += 4; +} + +void from_struct_pp(struct_pp_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_pp(ptr_t d, const struct_pp_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; +} + +void from_struct_pu(struct_pu_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->u1 = *(uint32_t*)src; src += 4; +} +void to_struct_pu(ptr_t d, const struct_pu_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(uint32_t*)dest = src->u1; dest += 4; +} + +void from_struct_ppi(struct_ppi_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; + dest->i2 = *(int*)src; src += 4; +} +void to_struct_ppi(ptr_t d, const struct_ppi_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; + *(int*)dest = src->i2; dest += 4; +} + +void from_struct_ip(struct_ip_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->i0 = *(int*)src; src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_ip(ptr_t d, const struct_ip_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(int*)dest = src->i0; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; +} + +void from_struct_iip(struct_iip_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->i0 = *(int*)src; src += 4; + dest->i1 = *(int*)src; src += 4; + dest->p2 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_iip(ptr_t d, const struct_iip_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(int*)dest = src->i0; dest += 4; + *(int*)dest = src->i1; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p2); dest += 4; +} + +void from_struct_puu(struct_puu_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->u1 = *(uint32_t*)src; src += 4; + dest->u2 = *(uint32_t*)src; src += 4; +} +void to_struct_puu(ptr_t d, const struct_puu_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(uint32_t*)dest = src->u1; dest += 4; + *(uint32_t*)dest = src->u2; dest += 4; +} + +void from_struct_pii(struct_pii_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->i1 = *(int*)src; src += 4; + dest->i2 = *(int*)src; src += 4; +} +void to_struct_pii(ptr_t d, const struct_pii_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(int*)dest = src->i1; dest += 4; + *(int*)dest = src->i2; dest += 4; +} + +void from_struct_piiL(struct_piiL_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->i1 = *(int*)src; src += 4; + dest->i2 = *(int*)src; src += 4; + dest->L3 = from_ulong(*(ulong_t*)src); src += 4; +} +void to_struct_piiL(ptr_t d, const struct_piiL_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(int*)dest = src->i1; dest += 4; + *(int*)dest = src->i2; dest += 4; + *(ulong_t*)dest = to_ulong(src->L3); dest += 4; +} + +void from_struct_ipip(struct_ipip_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->i0 = *(int*)src; src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; + dest->i2 = *(int*)src; src += 4; + dest->p3 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_ipip(ptr_t d, const struct_ipip_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(int*)dest = src->i0; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; + *(int*)dest = src->i2; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p3); dest += 4; +} + +void from_struct_piip(struct_piip_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->i1 = *(int*)src; src += 4; + dest->i2 = *(int*)src; src += 4; + dest->p3 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_piip(ptr_t d, const struct_piip_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(int*)dest = src->i1; dest += 4; + *(int*)dest = src->i2; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p3); dest += 4; +} + +void from_struct_ppup(struct_ppup_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; + dest->u2 = *(uint32_t*)src; src += 4; + dest->p3 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_ppup(ptr_t d, const struct_ppup_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; + *(uint32_t*)dest = src->u2; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p3); dest += 4; +} +void from_struct_iiiiiLi(struct_iiiiiLi_t* dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->i0 = *(int*)src; src += 4; + dest->i1 = *(int*)src; src += 4; + dest->i2 = *(int*)src; src += 4; + dest->i3 = *(int*)src; src += 4; + dest->i4 = *(int*)src; src += 4; + dest->L5 = from_ulong(*(long_t*)src); src += 4; + dest->i6 = *(int*)src; src += 4; +} +void to_struct_iiiiiLi(ptr_t d, const struct_iiiiiLi_t* src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(int*)dest = src->i0; dest += 4; + *(int*)dest = src->i1; dest += 4; + *(int*)dest = src->i2; dest += 4; + *(int*)dest = src->i3; dest += 4; + *(int*)dest = src->i4; dest += 4; + *(ulong_t*)dest = to_ulong(src->L5); dest += 4; + *(int*)dest = src->i6; dest += 4; +} +void from_struct_iLLLiiiiiiiLLiiLiiiiLic(struct_iLLLiiiiiiiLLiiLiiiiLic_t* dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->i0 = *(int*)src; src += 4; + dest->L1 = from_ulong(*(long_t*)src); src += 4; + dest->L2 = from_ulong(*(long_t*)src); src += 4; + dest->L3 = from_ulong(*(long_t*)src); src += 4; + dest->i4 = *(int*)src; src += 4; + dest->i5 = *(int*)src; src += 4; + dest->i6 = *(int*)src; src += 4; + dest->i7 = *(int*)src; src += 4; + dest->i8 = *(int*)src; src += 4; + dest->i9 = *(int*)src; src += 4; + dest->i10 = *(int*)src; src += 4; + dest->L11 = from_ulong(*(long_t*)src); src += 4; + dest->L12 = from_ulong(*(long_t*)src); src += 4; + dest->i13 = *(int*)src; src += 4; + dest->i14 = *(int*)src; src += 4; + dest->L15 = from_ulong(*(long_t*)src); src += 4; + dest->i16 = *(int*)src; src += 4; + dest->i17 = *(int*)src; src += 4; + dest->i18 = *(int*)src; src += 4; + dest->i19 = *(int*)src; src += 4; + dest->L20 = from_ulong(*(long_t*)src); src += 4; + dest->i21 = *(int*)src; src += 4; + dest->c22 = *(int8_t*)src; src += 1; +} +void to_struct_iLLLiiiiiiiLLiiLiiiiLic(ptr_t d, const struct_iLLLiiiiiiiLLiiLiiiiLic_t* src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(int*)dest = src->i0; dest += 4; + *(ulong_t*)dest = to_ulong(src->L1); dest += 4; + *(ulong_t*)dest = to_ulong(src->L2); dest += 4; + *(ulong_t*)dest = to_ulong(src->L3); dest += 4; + *(int*)dest = src->i4; dest += 4; + *(int*)dest = src->i5; dest += 4; + *(int*)dest = src->i6; dest += 4; + *(int*)dest = src->i7; dest += 4; + *(int*)dest = src->i8; dest += 4; + *(int*)dest = src->i9; dest += 4; + *(int*)dest = src->i10; dest += 4; + *(ulong_t*)dest = to_ulong(src->L11); dest += 4; + *(ulong_t*)dest = to_ulong(src->L12); dest += 4; + *(int*)dest = src->i13; dest += 4; + *(int*)dest = src->i14; dest += 4; + *(ulong_t*)dest = to_ulong(src->L15); dest += 4; + *(int*)dest = src->i16; dest += 4; + *(int*)dest = src->i17; dest += 4; + *(int*)dest = src->i18; dest += 4; + *(int*)dest = src->i19; dest += 4; + *(ulong_t*)dest = to_ulong(src->L20); dest += 4; + *(int*)dest = src->i21; dest += 4; + *(int8_t*)dest = src->c22; dest += 1; +} +void from_struct_LLLLiiiLLilliLL(struct_LLLLiiiLLilliLL_t* dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(long_t*)src); src += 4; + dest->L1 = from_ulong(*(long_t*)src); src += 4; + dest->L2 = from_ulong(*(long_t*)src); src += 4; + dest->L3 = from_ulong(*(long_t*)src); src += 4; + dest->i4 = *(int*)src; src += 4; + dest->i5 = *(int*)src; src += 4; + dest->i6 = *(int*)src; src += 4; + dest->i7 = *(int*)src; src += 4; + dest->L8 = from_ulong(*(long_t*)src); src += 4; + dest->L9 = from_ulong(*(long_t*)src); src += 4; + dest->i10 = *(int*)src; src += 4; + dest->l11 = from_long(*(long_t*)src); src += 4; + dest->l12 = from_long(*(long_t*)src); src += 4; + dest->i13 = *(int*)src; src += 4; + dest->L14 = from_ulong(*(long_t*)src); src += 4; + dest->L15 = from_ulong(*(long_t*)src); src += 4; +} +void to_struct_LLLLiiiLLilliLL(ptr_t d, const struct_LLLLiiiLLilliLL_t* src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(ulong_t*)dest = to_ulong(src->L1); dest += 4; + *(ulong_t*)dest = to_ulong(src->L2); dest += 4; + *(ulong_t*)dest = to_ulong(src->L3); dest += 4; + *(int*)dest = src->i4; dest += 4; + *(int*)dest = src->i5; dest += 4; + *(int*)dest = src->i6; dest += 4; + *(int*)dest = src->i7; dest += 4; + *(ulong_t*)dest = to_ulong(src->L8); dest += 4; + *(ulong_t*)dest = to_ulong(src->L9); dest += 4; + *(int*)dest = src->i10; dest += 4; + *(ulong_t*)dest = to_long(src->l11); dest += 4; + *(ulong_t*)dest = to_long(src->l12); dest += 4; + *(int*)dest = src->i13; dest += 4; + *(ulong_t*)dest = to_ulong(src->L14); dest += 4; + *(ulong_t*)dest = to_ulong(src->L15); dest += 4; +} + +void from_struct_iiuuLip(struct_iiuuLip_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->i0 = *(int*)src; src += 4; + dest->i1 = *(int*)src; src += 4; + dest->u2 = *(uint32_t*)src; src += 4; + dest->u3 = *(uint32_t*)src; src += 4; + dest->L4 = from_ulong(*(long_t*)src); src += 4; + dest->i5 = *(int*)src; src += 4; + dest->p6 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_iiuuLip(ptr_t d, const struct_iiuuLip_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(int*)dest = src->i0; dest += 4; + *(int*)dest = src->i1; dest += 4; + *(uint32_t*)dest = src->u2; dest += 4; + *(uint32_t*)dest = src->u3; dest += 4; + *(ulong_t*)dest = to_ulong(src->L4); dest += 4; + *(int*)dest = src->i5; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p6); dest += 4; +} + +void from_struct_pLiiiLLLii(struct_pLiiiLLLii_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->L1 = from_ulong(*(long_t*)src); src += 4; + dest->i2 = *(int*)src; src += 4; + dest->i3 = *(int*)src; src += 4; + dest->i4 = *(int*)src; src += 4; + dest->L5 = from_ulong(*(long_t*)src); src += 4; + dest->L6 = from_ulong(*(long_t*)src); src += 4; + dest->L7 = from_ulong(*(long_t*)src); src += 4; + dest->i8 = *(int*)src; src += 4; + dest->i9 = *(int*)src; src += 4; +} +void to_struct_pLiiiLLLii(ptr_t d, const struct_pLiiiLLLii_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ulong_t*)dest = to_ulong(src->L1); dest += 4; + *(int*)dest = src->i2; dest += 4; + *(int*)dest = src->i3; dest += 4; + *(int*)dest = src->i4; dest += 4; + *(ulong_t*)dest = to_ulong(src->L5); dest += 4; + *(ulong_t*)dest = to_ulong(src->L6); dest += 4; + *(ulong_t*)dest = to_ulong(src->L7); dest += 4; + *(int*)dest = src->i8; dest += 4; + *(int*)dest = src->i9; dest += 4; +} + +void from_struct_LiiuL(struct_LiiuL_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(long_t*)src); src += 4; + dest->i1 = *(int*)src; src += 4; + dest->i2 = *(int*)src; src += 4; + dest->u3 = *(uint32_t*)src; src += 4; + dest->L4 = from_ulong(*(long_t*)src); src += 4; +} +void to_struct_LiiuL(ptr_t d, const struct_LiiuL_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(int*)dest = src->i1; dest += 4; + *(int*)dest = src->i2; dest += 4; + *(uint32_t*)dest = src->u3; dest += 4; + *(ulong_t*)dest = to_ulong(src->L4); dest += 4; +} + +void from_struct_WWWWWWWWWuip(struct_WWWWWWWWWuip_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->W0 = *(uint16_t*)src; src += 2; + dest->W1 = *(uint16_t*)src; src += 2; + dest->W2 = *(uint16_t*)src; src += 2; + dest->W3 = *(uint16_t*)src; src += 2; + dest->W4 = *(uint16_t*)src; src += 2; + dest->W5 = *(uint16_t*)src; src += 2; + dest->W6 = *(uint16_t*)src; src += 2; + dest->W7 = *(uint16_t*)src; src += 2; + dest->W8 = *(uint16_t*)src; src += 2; + dest->u9 = *(uint32_t*)src; src += 4; + dest->i10 = *(int*)src; src += 4; + dest->p11 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_WWWWWWWWWuip(ptr_t d, const struct_WWWWWWWWWuip_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(uint16_t*)dest = src->W0; dest += 2; + *(uint16_t*)dest = src->W1; dest += 2; + *(uint16_t*)dest = src->W2; dest += 2; + *(uint16_t*)dest = src->W3; dest += 2; + *(uint16_t*)dest = src->W4; dest += 2; + *(uint16_t*)dest = src->W5; dest += 2; + *(uint16_t*)dest = src->W6; dest += 2; + *(uint16_t*)dest = src->W7; dest += 2; + *(uint16_t*)dest = src->W8; dest += 2; + *(uint32_t*)dest = src->u9; dest += 4; + *(int*)dest = src->i10; dest += 4; + *(ulong_t*)dest = to_ptrv(src->p11); dest += 4; +} + +void from_struct_LiiwwwwwwwwL(struct_LiiwwwwwwwwL_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(long_t*)src); src += 4; + dest->i1 = *(int*)src; src += 4; + dest->i2 = *(int*)src; src += 4; + dest->w3 = *(short*)src; src += 2; + dest->w4 = *(short*)src; src += 2; + dest->w5 = *(short*)src; src += 2; + dest->w6 = *(short*)src; src += 2; + dest->w7 = *(short*)src; src += 2; + dest->w8 = *(short*)src; src += 2; + dest->w9 = *(short*)src; src += 2; + dest->w10 = *(short*)src; src += 2; + dest->L11 = from_ulong(*(long_t*)src); src += 4; +} +void to_struct_LiiwwwwwwwwL(ptr_t d, const struct_LiiwwwwwwwwL_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_ulong(src->L0); dest += 4; + *(int*)dest = src->i1; dest += 4; + *(int*)dest = src->i2; dest += 4; + *(short*)dest = src->w3; dest += 2; + *(short*)dest = src->w4; dest += 2; + *(short*)dest = src->w5; dest += 2; + *(short*)dest = src->w6; dest += 2; + *(short*)dest = src->w7; dest += 2; + *(short*)dest = src->w8; dest += 2; + *(short*)dest = src->w9; dest += 2; + *(short*)dest = src->w10; dest += 2; + *(ulong_t*)dest = to_ulong(src->L11); dest += 4; +} + +void from_struct_iLiiiiLiiiiLi(struct_iLiiiiLiiiiLi_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->i0 = *(int*)src; src += 4; + dest->L1 = from_ulong(*(long_t*)src); src += 4; + dest->i2 = *(int*)src; src += 4; + dest->i3 = *(int*)src; src += 4; + dest->i4 = *(int*)src; src += 4; + dest->i5 = *(int*)src; src += 4; + dest->L6 = from_ulong(*(long_t*)src); src += 4; + dest->i7 = *(int*)src; src += 4; + dest->i8 = *(int*)src; src += 4; + dest->i9 = *(int*)src; src += 4; + dest->i10 = *(int*)src; src += 4; + dest->L11 = from_ulong(*(long_t*)src); src += 4; + dest->i12 = *(int*)src; src += 4; +} +void to_struct_iLiiiiLiiiiLi(ptr_t d, const struct_iLiiiiLiiiiLi_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(int*)dest = src->i0; dest += 4; + *(ulong_t*)dest = to_ulong(src->L1); dest += 4; + *(int*)dest = src->i2; dest += 4; + *(int*)dest = src->i3; dest += 4; + *(int*)dest = src->i4; dest += 4; + *(int*)dest = src->i5; dest += 4; + *(ulong_t*)dest = to_ulong(src->L6); dest += 4; + *(int*)dest = src->i7; dest += 4; + *(int*)dest = src->i8; dest += 4; + *(int*)dest = src->i9; dest += 4; + *(int*)dest = src->i10; dest += 4; + *(ulong_t*)dest = to_ulong(src->L11); dest += 4; + *(int*)dest = src->i12; dest += 4; +} + +void from_struct_pppiiip(struct_pppiiip_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p2 = from_ptrv(*(ptr_t*)src); src += 4; + dest->i3 = *(int*)src; src += 4; + dest->i4 = *(int*)src; src += 4; + dest->i5 = *(int*)src; src += 4; + dest->p6 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_pppiiip(ptr_t d, const struct_pppiiip_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p2); dest += 4; + *(int*)dest = src->i3; dest += 4; + *(int*)dest = src->i4; dest += 4; + *(int*)dest = src->i5; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p6); dest += 4; +} + +void from_struct_LWww(struct_LWww_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->L0 = from_ulong(*(uint32_t*)src); src += 4; + dest->W1 = *(uint16_t*)src; src += 2; + dest->W2 = *(int16_t*)src; src += 2; + dest->W3 = *(int16_t*)src; src += 2; +} +void to_struct_LWww(ptr_t d, const struct_LWww_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(uint32_t*)dest = to_ulong(src->L0); dest += 4; + *(uint16_t*)dest = src->W1; dest += 2; + *(int16_t*)dest = src->W2; dest += 2; + *(int16_t*)dest = src->W3; dest += 2; +} + +void from_struct_ppuuuuup(struct_ppuuuuup_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; + dest->u2 = *(uint32_t*)src; src += 4; + dest->u3 = *(uint32_t*)src; src += 4; + dest->u4 = *(uint32_t*)src; src += 4; + dest->u5 = *(uint32_t*)src; src += 4; + dest->u6 = *(uint32_t*)src; src += 4; + dest->p7 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_ppuuuuup(ptr_t d, const struct_ppuuuuup_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; + *(uint32_t*)dest = src->u2; dest += 4; + *(uint32_t*)dest = src->u3; dest += 4; + *(uint32_t*)dest = src->u4; dest += 4; + *(uint32_t*)dest = src->u5; dest += 4; + *(uint32_t*)dest = src->u6; dest += 4; + *(ptr_t*)dest = to_ptrv(src->p7); dest += 4; +} + +void from_struct_ppuii(struct_ppuii_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; + dest->u2 = *(uint32_t*)src; src += 4; + dest->i3 = *(int32_t*)src; src += 4; + dest->i4 = *(int32_t*)src; src += 4; +} +void to_struct_ppuii(ptr_t d, const struct_ppuii_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; + *(uint32_t*)dest = src->u2; dest += 4; + *(int32_t*)dest = src->i3; dest += 4; + *(int32_t*)dest = src->i4; dest += 4; +} + +void from_struct_ppuiiiiiiiiipp(struct_ppuiiiiiiiiipp_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->p0 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p1 = from_ptrv(*(ptr_t*)src); src += 4; + dest->u2 = *(uint32_t*)src; src += 4; + dest->i3 = *(int32_t*)src; src += 4; + dest->i4 = *(int32_t*)src; src += 4; + dest->i5 = *(int32_t*)src; src += 4; + dest->i6 = *(int32_t*)src; src += 4; + dest->i7 = *(int32_t*)src; src += 4; + dest->i8 = *(int32_t*)src; src += 4; + dest->i9 = *(int32_t*)src; src += 4; + dest->i10 = *(int32_t*)src; src += 4; + dest->i11 = *(int32_t*)src; src += 4; + dest->p12 = from_ptrv(*(ptr_t*)src); src += 4; + dest->p13 = from_ptrv(*(ptr_t*)src); src += 4; +} +void to_struct_ppuiiiiiiiiipp(ptr_t d, const struct_ppuiiiiiiiiipp_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ptr_t*)dest = to_ptrv(src->p0); dest += 4; + *(ptr_t*)dest = to_ptrv(src->p1); dest += 4; + *(uint32_t*)dest = src->u2; dest += 4; + *(int32_t*)dest = src->i3; dest += 4; + *(int32_t*)dest = src->i4; dest += 4; + *(int32_t*)dest = src->i5; dest += 4; + *(int32_t*)dest = src->i6; dest += 4; + *(int32_t*)dest = src->i7; dest += 4; + *(int32_t*)dest = src->i8; dest += 4; + *(int32_t*)dest = src->i9; dest += 4; + *(int32_t*)dest = src->i10; dest += 4; + *(int32_t*)dest = src->i11; dest += 4; + *(ptr_t*)dest = to_ptrv_silent(src->p12); dest += 4; + *(ptr_t*)dest = to_ptrv_silent(src->p13); dest += 4; +} + +void from_struct_lii(struct_lii_t *dest, ptr_t s) { + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->l0 = from_long(*(long_t*)src); src += 4; + dest->i1 = *(int*)src; src += 4; + dest->i2 = *(int*)src; src += 4; +} +void to_struct_lii(ptr_t d, const struct_lii_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(ulong_t*)dest = to_long(src->l0); dest += 4; + *(int*)dest = src->i1; dest += 4; + *(int*)dest = src->i2; dest += 4; +} + +void from_struct_UUUULLLLLLLLLLLLLL(struct_UUUULLLLLLLLLLLLLL_t *dest, ptr_t s) { + if(!s) return; + uint8_t* src = (uint8_t*)from_ptrv(s); + dest->U0 = *(uint64_t*)src; src += 8; + dest->U1 = *(uint64_t*)src; src += 8; + dest->U2 = *(uint64_t*)src; src += 8; + dest->U3 = *(uint64_t*)src; src += 8; + dest->L4 = from_ulong(*(ulong_t*)src); src += 4; + dest->L5 = from_ulong(*(ulong_t*)src); src += 4; + dest->L6 = from_ulong(*(ulong_t*)src); src += 4; + dest->L7 = from_ulong(*(ulong_t*)src); src += 4; + dest->L8 = from_ulong(*(ulong_t*)src); src += 4; + dest->L9 = from_ulong(*(ulong_t*)src); src += 4; + dest->L10 = from_ulong(*(ulong_t*)src); src += 4; + dest->L11 = from_ulong(*(ulong_t*)src); src += 4; + dest->L12 = from_ulong(*(ulong_t*)src); src += 4; + dest->L13 = from_ulong(*(ulong_t*)src); src += 4; + dest->L14 = from_ulong(*(ulong_t*)src); src += 4; + dest->L15 = from_ulong(*(ulong_t*)src); src += 4; + dest->L16 = from_ulong(*(ulong_t*)src); src += 4; + dest->L17 = from_ulong(*(ulong_t*)src); src += 4; +} +void to_struct_UUUULLLLLLLLLLLLLL(ptr_t d, const struct_UUUULLLLLLLLLLLLLL_t *src) { + if (!src) return; + uint8_t* dest = (uint8_t*)from_ptrv(d); + *(uint64_t*)dest = src->U0; dest += 8; + *(uint64_t*)dest = src->U1; dest += 8; + *(uint64_t*)dest = src->U2; dest += 8; + *(uint64_t*)dest = src->U3; dest += 8; + *(ulong_t*)dest = to_ulong(src->L4); dest += 4; + *(ulong_t*)dest = to_ulong(src->L5); dest += 4; + *(ulong_t*)dest = to_ulong(src->L6); dest += 4; + *(ulong_t*)dest = to_ulong(src->L7); dest += 4; + *(ulong_t*)dest = to_ulong(src->L8); dest += 4; + *(ulong_t*)dest = to_ulong(src->L9); dest += 4; + *(ulong_t*)dest = to_ulong(src->L10); dest += 4; + *(ulong_t*)dest = to_ulong(src->L11); dest += 4; + *(ulong_t*)dest = to_ulong(src->L12); dest += 4; + *(ulong_t*)dest = to_ulong(src->L13); dest += 4; + *(ulong_t*)dest = to_ulong(src->L14); dest += 4; + *(ulong_t*)dest = to_ulong(src->L15); dest += 4; + *(ulong_t*)dest = to_ulong(src->L16); dest += 4; + *(ulong_t*)dest = to_ulong(src->L17); dest += 4; +} \ No newline at end of file diff --git a/src/wrapped32/generated/converter32.h b/src/wrapped32/generated/converter32.h new file mode 100644 index 0000000..ef11ac4 --- /dev/null +++ b/src/wrapped32/generated/converter32.h @@ -0,0 +1,577 @@ +// Manually created for now +#ifndef __CONVERTER_H_ +#define __CONVERTER_H_ + +#include "box32.h" + +typedef struct struct_p_s { + void *p0; +} struct_p_t; +void from_struct_p(struct_p_t *dest, ptr_t src); +void to_struct_p(ptr_t dest, const struct_p_t *src); +typedef struct struct_l_s { + long L0; +} struct_l_t; +void from_struct_l(struct_l_t *dest, ptr_t src); +void to_struct_l(ptr_t dest, const struct_l_t *src); +typedef struct struct_L_s { + unsigned long L0; +} struct_L_t; +void from_struct_L(struct_L_t *dest, ptr_t src); +void to_struct_L(ptr_t dest, const struct_L_t *src); +typedef struct struct_ll_s { + long L0; + long L1; +} struct_ll_t; +void from_struct_ll(struct_ll_t *dest, ptr_t src); +void to_struct_ll(ptr_t dest, const struct_ll_t *src); +typedef struct struct_LL_s { + unsigned long L0; + unsigned long L1; +} struct_LL_t; +void from_struct_LL(struct_LL_t *dest, ptr_t src); +void to_struct_LL(ptr_t dest, const struct_LL_t *src); +typedef struct struct_LC_s { + unsigned long L0; + uint8_t C1; +} struct_LC_t; +void from_struct_LC(struct_LC_t *dest, ptr_t src); +void to_struct_LC(ptr_t dest, const struct_LC_t *src); +typedef struct struct_liu_s { + long l0; + int i1; + uint32_t u2; +} struct_liu_t; +void from_struct_liu(struct_liu_t *dest, ptr_t src); +void to_struct_liu(ptr_t dest, const struct_liu_t *src); +typedef struct struct_llll_s { + long l0; + long l1; + long l2; + long l3; +} struct_llll_t; +void from_struct_llll(struct_llll_t *dest, ptr_t src); +void to_struct_llll(ptr_t dest, const struct_llll_t *src); +typedef struct struct_LLLL_s { + unsigned long L0; + unsigned long L1; + unsigned long L2; + unsigned long L3; +} struct_LLLL_t; +void from_struct_LLLL(struct_LLLL_t *dest, ptr_t src); +void to_struct_LLLL(ptr_t dest, const struct_LLLL_t *src); +typedef struct struct_LLLLLLLLLL_s { + unsigned long L0; + unsigned long L1; + unsigned long L2; + unsigned long L3; + unsigned long L4; + unsigned long L5; + unsigned long L6; + unsigned long L7; + unsigned long L8; + unsigned long L9; +} struct_LLLLLLLLLL_t; +void from_struct_LLLLLLLLLL(struct_LLLLLLLLLL_t *dest, ptr_t src); +void to_struct_LLLLLLLLLL(ptr_t dest, const struct_LLLLLLLLLL_t *src); +typedef struct struct_LLLLLLLLLLLLLLLLLL_s { + unsigned long L0; + unsigned long L1; + unsigned long L2; + unsigned long L3; + unsigned long L4; + unsigned long L5; + unsigned long L6; + unsigned long L7; + unsigned long L8; + unsigned long L9; + unsigned long L10; + unsigned long L11; + unsigned long L12; + unsigned long L13; + unsigned long L14; + unsigned long L15; + unsigned long L16; + unsigned long L17; +} struct_LLLLLLLLLLLLLLLLLL_t; +void from_struct_LLLLLLLLLLLLLLLLLL(struct_LLLLLLLLLLLLLLLLLL_t *dest, ptr_t src); +void to_struct_LLLLLLLLLLLLLLLLLL(ptr_t dest, const struct_LLLLLLLLLLLLLLLLLL_t *src); +typedef struct struct_LpCC_s { + unsigned long L0; + void* p1; + uint8_t C2; + uint8_t C3; +} struct_LpCC_t; +void from_struct_LpCC(struct_LpCC_t *dest, ptr_t src); +void to_struct_LpCC(ptr_t dest, const struct_LpCC_t *src); +typedef struct struct_h_s { + uintptr_t h0; +} struct_h_t; +void from_struct_h(struct_h_t *dest, ptr_t src); +void to_struct_h(ptr_t dest, const struct_h_t *src); +typedef struct struct_H_s { + uintptr_t H0; +} struct_H_t; +void from_struct_H(struct_H_t *dest, ptr_t src); +void to_struct_H(ptr_t dest, const struct_H_t *src); +typedef struct struct_pL_s { + void* p0; + unsigned long L1; +} struct_pL_t; +void from_struct_pL(struct_pL_t *dest, ptr_t src); +void to_struct_pL(ptr_t dest, const struct_pL_t *src); +typedef struct struct_ppppii_s { + void* p0; + void* p1; + void* p2; + void* p3; + int i4; + int i5; +} struct_ppppii_t; +void from_struct_ppppii(struct_ppppii_t *dest, ptr_t src); +void to_struct_ppppii(ptr_t dest, const struct_ppppii_t *src); +typedef struct struct_ppppp_s { + void* p0; + void* p1; + void* p2; + void* p3; + void* p4; +} struct_ppppp_t; +void from_struct_ppppp(struct_ppppp_t *dest, ptr_t src); +void to_struct_ppppp(ptr_t dest, const struct_ppppp_t *src); +typedef struct struct_iiiiiiiiilt_s { + int i0; + int i1; + int i2; + int i3; + int i4; + int i5; + int i6; + int i7; + int i8; + long l9; + void* p10; +} struct_iiiiiiiiilt_t; +void from_struct_iiiiiiiiilt(struct_iiiiiiiiilt_t* dest, ptr_t src); +void to_struct_iiiiiiiiilt(ptr_t dest, const struct_iiiiiiiiilt_t* src); +typedef struct struct_up_s { + uint32_t u0; + void* p1; +} struct_up_t; +void from_struct_up(struct_up_t *dest, ptr_t src); +void to_struct_up(ptr_t dest, const struct_up_t *src); +typedef struct struct_upi_s { + uint32_t u0; + void* p1; + int i2; +} struct_upi_t; +void from_struct_upi(struct_upi_t *dest, ptr_t src); +void to_struct_upi(ptr_t dest, const struct_upi_t *src); +typedef struct struct_Ldd_s { + unsigned long L0; + double d1; + double d2; +} struct_Ldd_t; +void from_struct_Ldd(struct_Ldd_t *dest, ptr_t src); +void to_struct_Ldd(ptr_t dest, const struct_Ldd_t *src); +typedef struct struct_upu_s { + uint32_t u0; + void* p1; + uint32_t u2; +} struct_upu_t; +void from_struct_upu(struct_upu_t *dest, ptr_t src); +void to_struct_upu(ptr_t dest, const struct_upu_t *src); +typedef struct struct_LWWWcc_s { + unsigned long L0; + unsigned short W1; + unsigned short W2; + unsigned short W3; + char c4; + char c5; +} struct_LWWWcc_t; +void from_struct_LWWWcc(struct_LWWWcc_t *dest, ptr_t src); +void to_struct_LWWWcc(ptr_t dest, const struct_LWWWcc_t *src); +typedef struct struct_pLiL_s { + void* p0; + unsigned long L1; + int i2; + unsigned long L3; +} struct_pLiL_t; +void from_struct_pLiL(struct_pLiL_t *dest, ptr_t src); +void to_struct_pLiL(ptr_t dest, const struct_pLiL_t *src); +typedef struct struct_Lip_s { + unsigned long L0; + int i1; + void* p2; +} struct_Lip_t; +void from_struct_Lip(struct_Lip_t *dest, ptr_t src); +void to_struct_Lip(ptr_t dest, const struct_Lip_t *src); +typedef struct struct_Lipi_s { + unsigned long L0; + int i1; + void* p2; + int i3; +} struct_Lipi_t; +void from_struct_Lipi(struct_Lipi_t *dest, ptr_t src); +void to_struct_Lipi(ptr_t dest, const struct_Lipi_t *src); +typedef struct struct_LLii_s { + unsigned long L0; + unsigned long L1; + int i2; + int i3; +} struct_LLii_t; +void from_struct_LLii(struct_LLii_t *dest, ptr_t src); +void to_struct_LLii(ptr_t dest, const struct_LLii_t *src); +typedef struct struct_uuipWCCp_s { + uint32_t u0; + uint32_t u1; + int i2; + void* p3; + uint16_t u4; + uint8_t u5; + uint8_t u6; + void* p7; +} struct_uuipWCCp_t; +void from_struct_uuipWCCp(struct_uuipWCCp_t *dest, ptr_t src); +void to_struct_uuipWCCp(ptr_t dest, const struct_uuipWCCp_t *src); +typedef struct struct_pLiLLLii_s { + void* p0; + unsigned long L1; + int i2; + unsigned long L3; + unsigned long L4; + unsigned long L5; + int i6; + int i7; +} struct_pLiLLLii_t; +void from_struct_pLiLLLii(struct_pLiLLLii_t *dest, ptr_t src); +void to_struct_pLiLLLii(ptr_t dest, const struct_pLiLLLii_t *src); +typedef struct struct_WWpWpWpWp_s { + uint16_t W0; + uint16_t W1; + void* p2; + uint16_t W3; + void* p4; + uint16_t W5; + void* p6; + uint16_t W7; + void* p8; +} struct_WWpWpWpWp_t; +void from_struct_WWpWpWpWp(struct_WWpWpWpWp_t *dest, ptr_t src); +void to_struct_WWpWpWpWp(ptr_t dest, const struct_WWpWpWpWp_t *src); +typedef struct struct_ip_s { + int i0; + void* p1; +} struct_ip_t; +void from_struct_ip(struct_ip_t *dest, ptr_t src); +void to_struct_ip(ptr_t dest, const struct_ip_t *src); +typedef struct struct_pi_s { + void* p0; + int i1; +} struct_pi_t; +void from_struct_pi(struct_pi_t *dest, ptr_t src); +void to_struct_pi(ptr_t dest, const struct_pi_t *src); +typedef struct struct_pp_s { + void* p0; + void* p1; +} struct_pp_t; +void from_struct_pp(struct_pp_t *dest, ptr_t src); +void to_struct_pp(ptr_t dest, const struct_pp_t *src); +typedef struct struct_pu_s { + void* p0; + uint32_t u1; +} struct_pu_t; +void from_struct_pu(struct_pu_t *dest, ptr_t src); +void to_struct_pu(ptr_t dest, const struct_pu_t *src); +typedef struct struct_ppi_s { + void* p0; + void* p1; + int i2; +} struct_ppi_t; +void from_struct_ppi(struct_ppi_t *dest, ptr_t src); +void to_struct_ppi(ptr_t dest, const struct_ppi_t *src); +typedef struct struct_iip_s { + int i0; + int i1; + void* p2; +} struct_iip_t; +void from_struct_iip(struct_iip_t *dest, ptr_t src); +void to_struct_iip(ptr_t dest, const struct_iip_t *src); +typedef struct struct_puu_s { + void* p0; + uint32_t u1; + uint32_t u2; +} struct_puu_t; +void from_struct_puu(struct_puu_t *dest, ptr_t src); +void to_struct_puu(ptr_t dest, const struct_puu_t *src); +typedef struct struct_pii_s { + void* p0; + int i1; + int i2; +} struct_pii_t; +void from_struct_pii(struct_pii_t *dest, ptr_t src); +void to_struct_pii(ptr_t dest, const struct_pii_t *src); +typedef struct struct_piiL_s { + void* p0; + int i1; + int i2; + unsigned long L3; +} struct_piiL_t; +void from_struct_piiL(struct_piiL_t *dest, ptr_t src); +void to_struct_piiL(ptr_t dest, const struct_piiL_t *src); +typedef struct struct_piip_s { + void* p0; + int i1; + int i2; + void* p3; +} struct_piip_t; +void from_struct_piip(struct_piip_t *dest, ptr_t src); +void to_struct_piip(ptr_t dest, const struct_piip_t *src); +typedef struct struct_ppup_s { + void* p0; + void* p1; + uint32_t u2; + void* p3; +} struct_ppup_t; +void from_struct_ppup(struct_ppup_t *dest, ptr_t src); +void to_struct_ppup(ptr_t dest, const struct_ppup_t *src); +typedef struct struct_ipip_s { + int i0; + void* p1; + int i2; + void* p3; +} struct_ipip_t; +void from_struct_ipip(struct_ipip_t *dest, ptr_t src); +void to_struct_ipip(ptr_t dest, const struct_ipip_t *src); +typedef struct struct_iiiiiLi_s { + int i0; + int i1; + int i2; + int i3; + int i4; + unsigned long L5; + int i6; +} struct_iiiiiLi_t; +void from_struct_iiiiiLi(struct_iiiiiLi_t* dest, ptr_t src); +void to_struct_iiiiiLi(ptr_t dest, const struct_iiiiiLi_t* src); +typedef struct struct_iLLLiiiiiiiLLiiLiiiiLic_s { + int i0; + unsigned long L1; + unsigned long L2; + unsigned long L3; + int i4; + int i5; + int i6; + int i7; + int i8; + int i9; + int i10; + unsigned long L11; + unsigned long L12; + int i13; + int i14; + unsigned long L15; + int i16; + int i17; + int i18; + int i19; + unsigned long L20; + int i21; + int8_t c22; +} struct_iLLLiiiiiiiLLiiLiiiiLic_t; +void from_struct_iLLLiiiiiiiLLiiLiiiiLic(struct_iLLLiiiiiiiLLiiLiiiiLic_t* dest, ptr_t src); +void to_struct_iLLLiiiiiiiLLiiLiiiiLic(ptr_t dest, const struct_iLLLiiiiiiiLLiiLiiiiLic_t* src); +typedef struct struct_LLLLiiiLLilliLL_s { + unsigned long L0; + unsigned long L1; + unsigned long L2; + unsigned long L3; + int i4; + int i5; + int i6; + int i7; + unsigned long L8; + unsigned long L9; + int i10; + long l11; + long l12; + int i13; + unsigned long L14; + unsigned long L15; +} struct_LLLLiiiLLilliLL_t; +void from_struct_LLLLiiiLLilliLL(struct_LLLLiiiLLilliLL_t* dest, ptr_t src); +void to_struct_LLLLiiiLLilliLL(ptr_t dest, const struct_LLLLiiiLLilliLL_t* src); +typedef struct struct_iiuuLip_s { + int i0; + int i1; + uint32_t u2; + uint32_t u3; + unsigned long L4; + int i5; + void* p6; +} struct_iiuuLip_t; +void from_struct_iiuuLip(struct_iiuuLip_t *dest, ptr_t src); +void to_struct_iiuuLip(ptr_t dest, const struct_iiuuLip_t *src); +typedef struct struct_pLiiiLLLii_s { + void* p0; + unsigned long L1; + int i2; + int i3; + int i4; + unsigned long L5; + unsigned long L6; + unsigned long L7; + int i8; + int i9; +} struct_pLiiiLLLii_t; +void from_struct_pLiiiLLLii(struct_pLiiiLLLii_t *dest, ptr_t src); +void to_struct_pLiiiLLLii(ptr_t dest, const struct_pLiiiLLLii_t *src); +typedef struct struct_LiiuL_s { + unsigned long L0; + int i1; + int i2; + uint32_t u3; + unsigned long L4; +} struct_LiiuL_t; +void from_struct_LiiuL(struct_LiiuL_t *dest, ptr_t src); +void to_struct_LiiuL(ptr_t dest, const struct_LiiuL_t *src); +typedef struct struct_WWWWWWWWWuip_s { + uint16_t W0; + uint16_t W1; + uint16_t W2; + uint16_t W3; + uint16_t W4; + uint16_t W5; + uint16_t W6; + uint16_t W7; + uint16_t W8; + uint32_t u9; + int i10; + void* p11; + unsigned long L4; +} struct_WWWWWWWWWuip_t; +void from_struct_WWWWWWWWWuip(struct_WWWWWWWWWuip_t *dest, ptr_t src); +void to_struct_WWWWWWWWWuip(ptr_t dest, const struct_WWWWWWWWWuip_t *src); +typedef struct struct_LiiwwwwwwwwL_s { + unsigned long L0; + int i1; + int i2; + short w3; + short w4; + short w5; + short w6; + short w7; + short w8; + short w9; + short w10; + unsigned long L11; +} struct_LiiwwwwwwwwL_t; +void from_struct_LiiwwwwwwwwL(struct_LiiwwwwwwwwL_t *dest, ptr_t src); +void to_struct_LiiwwwwwwwwL(ptr_t dest, const struct_LiiwwwwwwwwL_t *src); +typedef struct struct_iLiiiiLiiiiLi_s { + int i0; + unsigned long L1; + int i2; + int i3; + int i4; + int i5; + unsigned long L6; + int i7; + int i8; + int i9; + int i10; + unsigned long L11; + int i12; +} struct_iLiiiiLiiiiLi_t; +void from_struct_iLiiiiLiiiiLi(struct_iLiiiiLiiiiLi_t* dest, ptr_t src); +void to_struct_iLiiiiLiiiiLi(ptr_t dest, const struct_iLiiiiLiiiiLi_t* src); +typedef struct struct_pppiiip_s { + void* p0; + void* p1; + void* p2; + int i3; + int i4; + int i5; + void* p6; +} struct_pppiiip_t; +void from_struct_pppiiip(struct_pppiiip_t *dest, ptr_t src); +void to_struct_pppiiip(ptr_t dest, const struct_pppiiip_t *src); +typedef struct struct_LWww_s { + unsigned long L0; + unsigned short W1; + short W2; + short W3; +} struct_LWww_t; +void from_struct_LWww(struct_LWww_t *dest, ptr_t src); +void to_struct_LWww(ptr_t dest, const struct_LWww_t *src); +typedef struct struct_ppuuuuup_s { + void* p0; + void* p1; + uint32_t u2; + uint32_t u3; + uint32_t u4; + uint32_t u5; + uint32_t u6; + void* p7; +} struct_ppuuuuup_t; +void from_struct_ppuuuuup(struct_ppuuuuup_t *dest, ptr_t src); +void to_struct_ppuuuuup(ptr_t dest, const struct_ppuuuuup_t *src); +typedef struct struct_ppuii_s { + void* p0; + void* p1; + uint32_t u2; + int32_t i3; + int32_t i4; +} struct_ppuii_t; +void from_struct_ppuii(struct_ppuii_t *dest, ptr_t src); +void to_struct_ppuii(ptr_t dest, const struct_ppuii_t *src); +void from_struct_ppuuuuup(struct_ppuuuuup_t *dest, ptr_t src); +void to_struct_ppuuuuup(ptr_t dest, const struct_ppuuuuup_t *src); +typedef struct struct_ppuiiiiiiiiipp_s { + void* p0; + void* p1; + uint32_t u2; + int32_t i3; + int32_t i4; + int32_t i5; + int32_t i6; + int32_t i7; + int32_t i8; + int32_t i9; + int32_t i10; + int32_t i11; + void* p12; + void* p13; +} struct_ppuiiiiiiiiipp_t; +void from_struct_ppuiiiiiiiiipp(struct_ppuiiiiiiiiipp_t *dest, ptr_t src); +void to_struct_ppuiiiiiiiiipp(ptr_t dest, const struct_ppuiiiiiiiiipp_t *src); +typedef struct struct_lii_s { + long l0; + int i1; + int i2; +} struct_lii_t; +void from_struct_lii(struct_lii_t *dest, ptr_t src); +void to_struct_lii(ptr_t dest, const struct_lii_t *src); +typedef struct struct_UUUULLLLLLLLLLLLLL_s { + uint64_t U0; + uint64_t U1; + uint64_t U2; + uint64_t U3; + unsigned long L4; + unsigned long L5; + unsigned long L6; + unsigned long L7; + unsigned long L8; + unsigned long L9; + unsigned long L10; + unsigned long L11; + unsigned long L12; + unsigned long L13; + unsigned long L14; + unsigned long L15; + unsigned long L16; + unsigned long L17; +} struct_UUUULLLLLLLLLLLLLL_t; +void from_struct_UUUULLLLLLLLLLLLLL(struct_UUUULLLLLLLLLLLLLL_t *dest, ptr_t src); +void to_struct_UUUULLLLLLLLLLLLLL(ptr_t dest, const struct_UUUULLLLLLLLLLLLLL_t *src); +#endif // __CONVERTER_H_ diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt new file mode 100644 index 0000000..5f863f7 --- /dev/null +++ b/src/wrapped32/generated/functions_list.txt @@ -0,0 +1,3643 @@ +#() vEv -> vEv +#() vFv -> vFv +#() vFc -> vFc +#() vFw -> vFw +#() vEi -> vEi +#() vFi -> vFi +#() vFC -> vFC +#() vFW -> vFW +#() vEu -> vEu +#() vFu -> vFu +#() vFU -> vFU +#() vFf -> vFf +#() vFd -> vFd +#() vEl -> vEl +#() vFl -> vFl +#() vEp -> vEp +#() vFp -> vFp +#() vEA -> vEA +#() vES -> vES +#() vFS -> vFS +#() vFX -> vFX +#() vFn -> vFn +#() cFc -> cFc +#() cFi -> cFi +#() cFu -> cFu +#() cFp -> cFp +#() wFp -> wFp +#() iEv -> iEv +#() iFv -> iFv +#() iEi -> iEi +#() iFi -> iFi +#() iEI -> iEI +#() iEu -> iEu +#() iFu -> iFu +#() iFU -> iFU +#() iEf -> iEf +#() iEd -> iEd +#() iEl -> iEl +#() iEL -> iEL +#() iFL -> iFL +#() iEp -> iEp +#() iFp -> iFp +#() iEh -> iEh +#() iES -> iES +#() iFX -> iFX +#() iFn -> iFn +#() IFi -> IFi +#() IEf -> IEf +#() IEd -> IEd +#() IEp -> IEp +#() IFp -> IFp +#() IES -> IES +#() CFv -> CFv +#() CFi -> CFi +#() CFu -> CFu +#() CFU -> CFU +#() CFl -> CFl +#() CFp -> CFp +#() WFi -> WFi +#() WEW -> WEW +#() WFu -> WFu +#() WFp -> WFp +#() uEv -> uEv +#() uFv -> uFv +#() uEi -> uEi +#() uFi -> uFi +#() uEu -> uEu +#() uFu -> uFu +#() uEU -> uEU +#() uEp -> uEp +#() uFp -> uFp +#() uES -> uES +#() uFX -> uFX +#() uFn -> uFn +#() UFv -> UFv +#() UFi -> UFi +#() UFu -> UFu +#() UEp -> UEp +#() UFp -> UFp +#() UEs -> UEs +#() fFi -> fFi +#() fEf -> fEf +#() fFf -> fFf +#() dEv -> dEv +#() dFi -> dFi +#() dEd -> dEd +#() dFd -> dFd +#() dEp -> dEp +#() dFp -> dFp +#() lEv -> lEv +#() lFu -> lFu +#() lEl -> lEl +#() lFl -> lFl +#() lEp -> lEp +#() lFp -> lFp +#() lES -> lES +#() lFX -> lFX +#() LEv -> LEv +#() LFv -> LFv +#() LFi -> LFi +#() LFu -> LFu +#() LEL -> LEL +#() LEp -> LEp +#() LFp -> LFp +#() LFX -> LFX +#() pEv -> pEv +#() pFv -> pFv +#() pEi -> pEi +#() pFi -> pFi +#() pFI -> pFI +#() pFW -> pFW +#() pFu -> pFu +#() pEu -> pEu +#() pFU -> pFU +#() pEl -> pEl +#() pFl -> pFl +#() pEL -> pEL +#() pFL -> pFL +#() pEp -> pEp +#() pFp -> pFp +#() pFX -> pFX +#() pFn -> pFn +#() hEv -> hEv +#() hFv -> hFv +#() aEa -> aEa +#() tEv -> tEv +#() tEi -> tEi +#() tEu -> tEu +#() tEp -> tEp +#() tFp -> tFp +#() XFv -> XFv +#() XFp -> XFp +#() vFbp_ -> vFB +#() iFbp_ -> iFB +#() iFBp_ -> iFB +#() LEBL_ -> LEB +#() pErl_ -> pEB +#() pFbp_ -> pFB +#() iFbpu_ -> iFB +#() IFbpu_ -> IFB +#() lFrll_ -> lFB +#() vFbpii_ -> vFB +#() vFbLdd_ -> vFB +#() vFbupi_ -> vFB +#() iErLWww_ -> iEB +#() iEBllll_ -> iEB +#() iFbppuii_ -> iFB +#() uFbppuii_ -> uFB +#() pFbppuii_ -> pFB +#() vFbuuipWCCp_ -> vFB +#() vFbppuuuuup_ -> vFB +#() uFbppuuuuup_ -> uFB +#() vFbWWpWpWpWp_ -> vFB +#() LEbiiiiiiiiilt_ -> LEB +#() pEriiiiiiiiilt_ -> pEB +#() iFbppuiiiiiiiiipp_ -> iFB +#() uFbppuiiiiiiiiipp_ -> uFB +#() pFbppuiiiiiiiiipp_ -> pFB +#() vEEv -> vEEv +#() vFEv -> vFEv +#() vFEi -> vFEi +#() vEEp -> vEEp +#() vFEp -> vFEp +#() vFEX -> vFEX +#() vFcc -> vFcc +#() vFww -> vFww +#() vFii -> vFii +#() vFiI -> vFiI +#() vFiW -> vFiW +#() vFiu -> vFiu +#() vFiU -> vFiU +#() vFif -> vFif +#() vFid -> vFid +#() vFip -> vFip +#() vFWW -> vFWW +#() vFWu -> vFWu +#() vFuc -> vFuc +#() vFuw -> vFuw +#() vFui -> vFui +#() vFuI -> vFuI +#() vFuC -> vFuC +#() vFuW -> vFuW +#() vFuu -> vFuu +#() vFuU -> vFuU +#() vFuf -> vFuf +#() vFud -> vFud +#() vFul -> vFul +#() vFup -> vFup +#() vFUu -> vFUu +#() vFfC -> vFfC +#() vFff -> vFff +#() vFdd -> vFdd +#() vFlu -> vFlu +#() vFlp -> vFlp +#() vEpi -> vEpi +#() vFpi -> vFpi +#() vFpC -> vFpC +#() vFpu -> vFpu +#() vFpd -> vFpd +#() vFpl -> vFpl +#() vEpL -> vEpL +#() vFpL -> vFpL +#() vEpp -> vEpp +#() vFpp -> vFpp +#() vESp -> vESp +#() vFXi -> vFXi +#() vFXu -> vFXu +#() vFXL -> vFXL +#() vFXp -> vFXp +#() vFni -> vFni +#() vFnu -> vFnu +#() vFnU -> vFnU +#() vFnp -> vFnp +#() cFpp -> cFpp +#() wFpi -> wFpi +#() iEEv -> iEEv +#() iFEv -> iFEv +#() iEEi -> iEEi +#() iFEi -> iFEi +#() iEEL -> iEEL +#() iEEp -> iEEp +#() iFEp -> iFEp +#() iEEh -> iEEh +#() iEEO -> iEEO +#() iFEX -> iFEX +#() iEii -> iEii +#() iFii -> iFii +#() iEiI -> iEiI +#() iEiu -> iEiu +#() iFiu -> iFiu +#() iEil -> iEil +#() iFiL -> iFiL +#() iEip -> iEip +#() iFip -> iFip +#() iEiS -> iEiS +#() iEui -> iEui +#() iFui -> iFui +#() iEuu -> iEuu +#() iEuL -> iEuL +#() iEup -> iEup +#() iFup -> iFup +#() iEua -> iEua +#() iFpw -> iFpw +#() iEpi -> iEpi +#() iFpi -> iFpi +#() iFpI -> iFpI +#() iFpW -> iFpW +#() iEpu -> iEpu +#() iFpu -> iFpu +#() iFpU -> iFpU +#() iFpf -> iFpf +#() iFpd -> iFpd +#() iFpl -> iFpl +#() iEpL -> iEpL +#() iFpL -> iFpL +#() iEpp -> iEpp +#() iFpp -> iFpp +#() iEpV -> iEpV +#() iEpO -> iEpO +#() iEpS -> iEpS +#() iFpS -> iFpS +#() iEhi -> iEhi +#() iEhp -> iEhp +#() iEhh -> iEhh +#() iESi -> iESi +#() iESU -> iESU +#() iESp -> iESp +#() iFXi -> iFXi +#() iFXW -> iFXW +#() iFXL -> iFXL +#() iFXp -> iFXp +#() IFEp -> IFEp +#() IEII -> IEII +#() IFpI -> IFpI +#() IFpu -> IFpu +#() CFip -> CFip +#() CFCi -> CFCi +#() CFui -> CFui +#() CFuu -> CFuu +#() CFuU -> CFuU +#() CFpi -> CFpi +#() CFpu -> CFpu +#() CFpp -> CFpp +#() CFXL -> CFXL +#() WFEp -> WFEp +#() WFpp -> WFpp +#() uFEp -> uFEp +#() uFii -> uFii +#() uEiS -> uEiS +#() uFWp -> uFWp +#() uFuu -> uFuu +#() uFup -> uFup +#() uEua -> uEua +#() uEuS -> uEuS +#() uFpi -> uFpi +#() uFpu -> uFpu +#() uFpp -> uFpp +#() uFXL -> uFXL +#() UFEp -> UFEp +#() UEuu -> UEuu +#() UFuu -> UFuu +#() UEUU -> UEUU +#() UEss -> UEss +#() fEif -> fEif +#() fFfi -> fFfi +#() fEfi -> fEfi +#() fEff -> fEff +#() fFff -> fFff +#() fEfD -> fEfD +#() fEfp -> fEfp +#() dEid -> dEid +#() dFdi -> dFdi +#() dEdi -> dEdi +#() dEdd -> dEdd +#() dFdd -> dFdd +#() dEdD -> dEdD +#() dFdp -> dFdp +#() dEdp -> dEdp +#() dEll -> dEll +#() dFpp -> dFpp +#() lEEi -> lEEi +#() lEES -> lEES +#() lEii -> lEii +#() lFiL -> lFiL +#() lFui -> lFui +#() lFll -> lFll +#() lEpi -> lEpi +#() lFpu -> lFpu +#() lFpl -> lFpl +#() lFpL -> lFpL +#() LEEL -> LEEL +#() LFEp -> LFEp +#() LFLi -> LFLi +#() LFpc -> LFpc +#() LEpL -> LEpL +#() LEpp -> LEpp +#() LFXi -> LFXi +#() LFXu -> LFXu +#() LFXU -> LFXU +#() LFXL -> LFXL +#() LFXp -> LFXp +#() pFEv -> pFEv +#() pEEv -> pEEv +#() pFEi -> pFEi +#() pEEu -> pEEu +#() pFEp -> pFEp +#() pEEp -> pEEp +#() pEES -> pEES +#() pFEX -> pFEX +#() pFii -> pFii +#() pFiu -> pFiu +#() pFip -> pFip +#() pEia -> pEia +#() pFWu -> pFWu +#() pFuu -> pFuu +#() pEup -> pEup +#() pFup -> pFup +#() pELL -> pELL +#() pFLL -> pFLL +#() pEpi -> pEpi +#() pFpi -> pFpi +#() pFpu -> pFpu +#() pFpU -> pFpU +#() pEpL -> pEpL +#() pFpL -> pFpL +#() pEpp -> pEpp +#() pFpp -> pFpp +#() pFXi -> pFXi +#() pFXu -> pFXu +#() pFXL -> pFXL +#() pFXp -> pFXp +#() pFnu -> pFnu +#() pFnp -> pFnp +#() hFEp -> hFEp +#() hEpa -> hEpa +#() SEip -> SEip +#() SEpp -> SEpp +#() tEip -> tEip +#() tEia -> tEia +#() tFuu -> tFuu +#() tEpL -> tEpL +#() tEpp -> tEpp +#() vFuBp_ -> vFuB +#() vFpbp_ -> vFpB +#() vFbp_p -> vFBp +#() iEEbp_ -> iEEB +#() iFibp_ -> iFiB +#() iFLbp_ -> iFLB +#() iFpbp_ -> iFpB +#() iFpbl_ -> iFpB +#() iFpBL_ -> iFpB +#() iFpbL_ -> iFpB +#() iEHBp_ -> iEHB +#() iFbp_i -> iFBi +#() iFbp_u -> iFBu +#() iFbp_p -> iFBp +#() iFXbL_ -> iFXB +#() uFpbp_ -> uFpB +#() uFpbL_ -> uFpB +#() fEpBp_ -> fEpB +#() dEpBp_ -> dEpB +#() lFpbp_ -> lFpB +#() LFpbp_ -> LFpB +#() LFpbL_ -> LFpB +#() pFpbp_ -> pFpB +#() pErl_p -> pEBp +#() vFibpp_ -> vFiB +#() vFpbpu_ -> vFpB +#() vFBll_l -> vFBl +#() vFnbpi_ -> vFnB +#() iEuBLL_ -> iEuB +#() iEprll_ -> iEpB +#() iEpbup_ -> iEpB +#() iEprLL_ -> iEpB +#() iFpbpu_ -> iFpB +#() iFbpi_i -> iFBi +#() iFbpu_u -> iFBu +#() iEBll_p -> iEBp +#() iFXbip_ -> iFXB +#() uFpbpu_ -> uFpB +#() pFnbpi_ -> pFnB +#() vFpbupi_ -> vFpB +#() iEpBlii_ -> iEpB +#() iESBliu_ -> iESB +#() iFbppi_i -> iFBi +#() iFbp_bp_ -> iFBB +#() iFXbiip_ -> iFXB +#() vFbppuii_p -> vFBp +#() iErLL_BLL_ -> iEBB +#() iFbpu_bpu_ -> iFBB +#() pErppppii_p -> pEBp +#() vFbll_rllll_ -> vFBB +#() iEbpppiiip_p -> iEBp +#() iFXbiiuuLip_ -> iFXB +#() iFpruuipWCCp_ -> iFpB +#() uFpbppuuuuup_ -> uFpB +#() uFbppuuuuup_p -> uFBp +#() pFubppuuuuup_ -> pFuB +#() pFpbppuuuuup_ -> pFpB +#() vFbppuii_bppuii_ -> vFBB +#() lEEriiiiiiiiilt_ -> lEEB +#() pEriiiiiiiiilt_p -> pEBp +#() LFXrLiiwwwwwwwwL_ -> LFXB +#() vFpbppuiiiiiiiiipp_ -> vFpB +#() vFbppuiiiiiiiiipp_p -> vFBp +#() uFpbppuiiiiiiiiipp_ -> uFpB +#() vFbppuuuuup_bppuuuuup_ -> vFBB +#() iEiBLLLLLLLLLLLLLLLLLL_ -> iEiB +#() iEiBUUUULLLLLLLLLLLLLL_ -> iEiB +#() vFbppuiiiiiiiiipp_bppuiiiiiiiiipp_ -> vFBB +#() uFbppuiiiiiiiiipp_bppuiiiiiiiiipp_ -> uFBB +#() vEEip -> vEEip +#() vFEip -> vFEip +#() vEEpi -> vEEpi +#() vEEpu -> vEEpu +#() vFEpp -> vFEpp +#() vFEpV -> vFEpV +#() vFEXp -> vFEXp +#() vFccc -> vFccc +#() vFwww -> vFwww +#() vFiii -> vFiii +#() vFiif -> vFiif +#() vFiip -> vFiip +#() vFiII -> vFiII +#() vFiui -> vFiui +#() vFiuu -> vFiuu +#() vFiup -> vFiup +#() vFiUU -> vFiUU +#() vFiff -> vFiff +#() vFidd -> vFidd +#() vFilu -> vFilu +#() vFill -> vFill +#() vFilp -> vFilp +#() vFipu -> vFipu +#() vFipp -> vFipp +#() vFCCC -> vFCCC +#() vFWWW -> vFWWW +#() vFucc -> vFucc +#() vFuww -> vFuww +#() vFuii -> vFuii +#() vFuiI -> vFuiI +#() vFuiu -> vFuiu +#() vFuiU -> vFuiU +#() vFuif -> vFuif +#() vFuid -> vFuid +#() vFuip -> vFuip +#() vFuII -> vFuII +#() vFuWW -> vFuWW +#() vFuui -> vFuui +#() vFuuC -> vFuuC +#() vFuuu -> vFuuu +#() vFuuU -> vFuuU +#() vFuuf -> vFuuf +#() vFuud -> vFuud +#() vFuup -> vFuup +#() vFuUU -> vFuUU +#() vFuff -> vFuff +#() vFudd -> vFudd +#() vFull -> vFull +#() vFulp -> vFulp +#() vFupp -> vFupp +#() vFfff -> vFfff +#() vEfpp -> vEfpp +#() vFddd -> vFddd +#() vEdpp -> vEdpp +#() vFlii -> vFlii +#() vFlip -> vFlip +#() vFllp -> vFllp +#() vFlpp -> vFlpp +#() vEpii -> vEpii +#() vFpii -> vFpii +#() vFpiL -> vFpiL +#() vFpip -> vFpip +#() vFpui -> vFpui +#() vFpuI -> vFpuI +#() vFpuC -> vFpuC +#() vFpuu -> vFpuu +#() vFpuU -> vFpuU +#() vFpuf -> vFpuf +#() vFpud -> vFpud +#() vFpul -> vFpul +#() vFpup -> vFpup +#() vFpdd -> vFpdd +#() vFplp -> vFplp +#() vFppi -> vFppi +#() vEppu -> vEppu +#() vFppu -> vFppu +#() vFppL -> vFppL +#() vFppp -> vFppp +#() vFXiL -> vFXiL +#() vFXLi -> vFXLi +#() vFXLL -> vFXLL +#() vFXLp -> vFXLp +#() vFXpi -> vFXpi +#() vFXpl -> vFXpl +#() vFXpL -> vFXpL +#() vFXpp -> vFXpp +#() iFEip -> iFEip +#() iEEip -> iEEip +#() iEEup -> iEEup +#() iFEup -> iFEup +#() iEEpi -> iEEpi +#() iFEpi -> iFEpi +#() iFEpu -> iFEpu +#() iFEpl -> iFEpl +#() iEEpL -> iEEpL +#() iFEpL -> iFEpL +#() iEEpp -> iEEpp +#() iFEpp -> iFEpp +#() iEEpV -> iEEpV +#() iFEpX -> iFEpX +#() iEEhi -> iEEhi +#() iEEhp -> iEEhp +#() iFEXp -> iFEXp +#() iEiii -> iEiii +#() iEiiI -> iEiiI +#() iFiiu -> iFiiu +#() iEiil -> iEiil +#() iEiip -> iEiip +#() iFiip -> iFiip +#() iEiiO -> iEiiO +#() iEiiN -> iEiiN +#() iEiII -> iEiII +#() iFiui -> iFiui +#() iEiuu -> iEiuu +#() iFiuu -> iFiuu +#() iFiuL -> iFiuL +#() iEiup -> iEiup +#() iFiup -> iFiup +#() iFiUU -> iFiUU +#() iFiUp -> iFiUp +#() iFidd -> iFidd +#() iEill -> iEill +#() iEiLi -> iEiLi +#() iEiLp -> iEiLp +#() iFiLp -> iFiLp +#() iFipi -> iFipi +#() iEipi -> iEipi +#() iEipu -> iEipu +#() iFipu -> iFipu +#() iEipL -> iEipL +#() iEipp -> iEipp +#() iFipp -> iFipp +#() iEipO -> iEipO +#() iFuip -> iFuip +#() iEuui -> iEuui +#() iEuuu -> iEuuu +#() iFuup -> iFuup +#() iEuLa -> iEuLa +#() iFupL -> iFupL +#() iFUip -> iFUip +#() iFfff -> iFfff +#() iELLi -> iELLi +#() iFpii -> iFpii +#() iEpiu -> iEpiu +#() iFpiu -> iFpiu +#() iFpil -> iFpil +#() iEpip -> iEpip +#() iFpip -> iFpip +#() iFpII -> iFpII +#() iFpWp -> iFpWp +#() iFpui -> iFpui +#() iFpuC -> iFpuC +#() iEpuu -> iEpuu +#() iFpuu -> iFpuu +#() iFpuU -> iFpuU +#() iFpup -> iFpup +#() iFpUU -> iFpUU +#() iFpfu -> iFpfu +#() iFpff -> iFpff +#() iFpdd -> iFpdd +#() iFpli -> iFpli +#() iFpll -> iFpll +#() iEpLi -> iEpLi +#() iEpLu -> iEpLu +#() iEpLp -> iEpLp +#() iFpLp -> iFpLp +#() iEppi -> iEppi +#() iFppi -> iFppi +#() iFppI -> iFppI +#() iEppu -> iEppu +#() iFppu -> iFppu +#() iFppU -> iFppU +#() iFppd -> iFppd +#() iEppL -> iEppL +#() iFppL -> iFppL +#() iEppp -> iEppp +#() iFppp -> iFppp +#() iEppa -> iEppa +#() iEpOu -> iEpOu +#() iFpSp -> iFpSp +#() iEhip -> iEhip +#() iEhpL -> iEhpL +#() iEhpp -> iEhpp +#() iESIi -> iESIi +#() iESli -> iESli +#() iFXii -> iFXii +#() iFXiL -> iFXiL +#() iFXip -> iFXip +#() iFXuu -> iFXuu +#() iFXup -> iFXup +#() iFXLi -> iFXLi +#() iFXLu -> iFXLu +#() iFXLU -> iFXLU +#() iFXLf -> iFXLf +#() iFXLl -> iFXLl +#() iFXLL -> iFXLL +#() iFXLp -> iFXLp +#() iFXpi -> iFXpi +#() iFXpu -> iFXpu +#() iFXpl -> iFXpl +#() iFXpL -> iFXpL +#() iFXpp -> iFXpp +#() IEiIi -> IEiIi +#() IFpIi -> IFpIi +#() IEppi -> IEppi +#() CFipp -> CFipp +#() CFuUu -> CFuUu +#() CFuff -> CFuff +#() WFXip -> WFXip +#() uFEpW -> uFEpW +#() uFEpu -> uFEpu +#() uFEpU -> uFEpU +#() uFEpL -> uFEpL +#() uFEpp -> uFEpp +#() uFilp -> uFilp +#() uFipu -> uFipu +#() uFuuu -> uFuuu +#() uFuup -> uFuup +#() uFupp -> uFupp +#() uFpii -> uFpii +#() uFpip -> uFpip +#() uFpuU -> uFpuU +#() uEpup -> uEpup +#() uFpup -> uFpup +#() uFppi -> uFppi +#() uFppu -> uFppu +#() uEppL -> uEppL +#() uFppL -> uFppL +#() uFppp -> uFppp +#() uFXuu -> uFXuu +#() UEppi -> UEppi +#() fFuii -> fFuii +#() fEfff -> fEfff +#() fEffp -> fEffp +#() dEddd -> dEddd +#() dEddp -> dEddp +#() lEEuV -> lEEuV +#() lEili -> lEili +#() lEipi -> lEipi +#() lEipL -> lEipL +#() lFlll -> lFlll +#() lElpi -> lElpi +#() lFpLd -> lFpLd +#() lFpLL -> lFpLL +#() lFppi -> lFppi +#() lFppL -> lFppL +#() lFppp -> lFppp +#() LFEpi -> LFEpi +#() LFEpp -> LFEpp +#() LFEXp -> LFEXp +#() LFpii -> LFpii +#() LEpip -> LEpip +#() LFppi -> LFppi +#() LEppL -> LEppL +#() LFppL -> LFppL +#() LFXip -> LFXip +#() LFXCi -> LFXCi +#() LFXLi -> LFXLi +#() LFXLC -> LFXLC +#() LFXpi -> LFXpi +#() LFXpp -> LFXpp +#() pFEii -> pFEii +#() pFEiu -> pFEiu +#() pEEip -> pEEip +#() pFEiV -> pFEiV +#() pEEpi -> pEEpi +#() pFEpi -> pFEpi +#() pFEpu -> pFEpu +#() pEEpp -> pEEpp +#() pFEpp -> pFEpp +#() pFEpV -> pFEpV +#() pFEpX -> pFEpX +#() pFEXi -> pFEXi +#() pFEXL -> pFEXL +#() pFEXp -> pFEXp +#() pFiii -> pFiii +#() pFipp -> pFipp +#() pFIpi -> pFIpi +#() pFuuu -> pFuuu +#() pFulu -> pFulu +#() pFupi -> pFupi +#() pFupp -> pFupp +#() pFddd -> pFddd +#() pFLpi -> pFLpi +#() pFpcU -> pFpcU +#() pEpii -> pEpii +#() pFpii -> pFpii +#() pFpiu -> pFpiu +#() pEpiL -> pEpiL +#() pFpiL -> pFpiL +#() pFpip -> pFpip +#() pEpiS -> pEpiS +#() pEpII -> pEpII +#() pFpuu -> pFpuu +#() pFpup -> pFpup +#() pFpUi -> pFpUi +#() pFpdd -> pFpdd +#() pEpLL -> pEpLL +#() pFppi -> pFppi +#() pFppu -> pFppu +#() pEppL -> pEppL +#() pFppL -> pFppL +#() pFppp -> pFppp +#() pEpOM -> pEpOM +#() pFXii -> pFXii +#() pFXip -> pFXip +#() pFXLp -> pFXLp +#() pFXpi -> pFXpi +#() pFXpp -> pFXpp +#() pFnpL -> pFnpL +#() aEipa -> aEipa +#() SEEpp -> SEEpp +#() SEppS -> SEppS +#() tEipu -> tEipu +#() tEipL -> tEipL +#() tEppi -> tEppi +#() vFibp_i -> vFiBi +#() vFuibp_ -> vFuiB +#() vFuuBp_ -> vFuuB +#() vFuubp_ -> vFuuB +#() vFpbp_i -> vFpBi +#() vFbp_pp -> vFBpp +#() vFXLbL_ -> vFXLB +#() vFXbL_i -> vFXBi +#() iFEpBp_ -> iFEpB +#() iFWubp_ -> iFWuB +#() iFuubp_ -> iFuuB +#() iFUpbp_ -> iFUpB +#() iFLbp_p -> iFLBp +#() iFpibl_ -> iFpiB +#() iFpibp_ -> iFpiB +#() iFpubp_ -> iFpuB +#() iFpubL_ -> iFpuB +#() iFplbl_ -> iFplB +#() iEppBp_ -> iEppB +#() iFppbp_ -> iFppB +#() iFppbL_ -> iFppB +#() iFpbp_i -> iFpBi +#() iFpbL_i -> iFpBi +#() iFpbp_u -> iFpBu +#() iFpbL_p -> iFpBp +#() iFpbp_p -> iFpBp +#() iFbp_Wp -> iFBWp +#() iFbp_up -> iFBup +#() iEBp_LL -> iEBLL +#() iFBp_LL -> iFBLL +#() iFbp_pi -> iFBpi +#() iFbL_pi -> iFBpi +#() iFbp_pI -> iFBpI +#() iFbp_pu -> iFBpu +#() iFbp_pd -> iFBpd +#() iFbp_pl -> iFBpl +#() iFbp_pp -> iFBpp +#() iFbp_Si -> iFBSi +#() iFXibL_ -> iFXiB +#() iFXLbp_ -> iFXLB +#() iFXLbL_ -> iFXLB +#() iFXbL_i -> iFXBi +#() iFXbp_i -> iFXBi +#() iFXBL_p -> iFXBp +#() iFXbp_p -> iFXBp +#() iFXbL_p -> iFXBp +#() IEpBp_i -> IEpBi +#() uFppbp_ -> uFppB +#() uFpbp_p -> uFpBp +#() UEpBp_i -> UEpBi +#() fEpBp_p -> fEpBp +#() fEpBp_a -> fEpBa +#() dEpBp_i -> dEpBi +#() dEpBp_a -> dEpBa +#() lEpBp_i -> lEpBi +#() lFpbp_L -> lFpBL +#() LEpBp_i -> LEpBi +#() pFuXbl_ -> pFuXB +#() pFpibp_ -> pFpiB +#() pFpubl_ -> pFpuB +#() pEppbp_ -> pEppB +#() pEppBp_ -> pEppB +#() pFppbp_ -> pFppB +#() pFXLbL_ -> pFXLB +#() pFnubp_ -> pFnuB +#() pFnUbp_ -> pFnUB +#() vFpibpp_ -> vFpiB +#() vFpbpu_u -> vFpBu +#() vFpbpu_p -> vFpBp +#() iFLbpi_i -> iFLBi +#() iFpibpu_ -> iFpiB +#() iFpibpp_ -> iFpiB +#() iFpubpu_ -> iFpuB +#() iEpprLL_ -> iEppB +#() iFppbpu_ -> iFppB +#() iFpbpu_u -> iFpBu +#() iFpbpu_p -> iFpBp +#() iFXLbpp_ -> iFXLB +#() iFXbLC_i -> iFXBi +#() uFpubpu_ -> uFpuB +#() vFLbL_bL_ -> vFLBB +#() vFpbLdd_i -> vFpBi +#() vFpbp_bp_ -> vFpBB +#() iFpbl_bl_ -> iFpBB +#() iFpbL_bL_ -> iFpBB +#() iFpbp_bp_ -> iFpBB +#() iFbp_pbp_ -> iFBpB +#() iFbp_bp_p -> iFBBp +#() iFXbiip_i -> iFXBi +#() iFXbLip_L -> iFXBL +#() vFXLbpLiL_ -> vFXLB +#() vFXLrpLiL_ -> vFXLB +#() iFbp_ubpu_ -> iFBuB +#() iFbpu_pbL_ -> iFBpB +#() iFXLbpLiL_ -> iFXLB +#() iFXLbLLii_ -> iFXLB +#() vFpbpu_bpu_ -> vFpBB +#() iFubpu_bpu_ -> iFuBB +#() iFpbpu_bpu_ -> iFpBB +#() iFbpu_bpu_u -> iFBBu +#() iFXLbLWWWcc_ -> iFXLB +#() vFppbppuuuuup_ -> vFppB +#() vFbppuuuuup_pp -> vFBpp +#() iFppbppuuuuup_ -> iFppB +#() iFbpu_bpu_bpu_ -> iFBBB +#() uFppbppuuuuup_ -> uFppB +#() LFppbppuuuuup_ -> LFppB +#() pFpibppuuuuup_ -> pFpiB +#() iEirLLLL_BLLLL_ -> iEiBB +#() pEppriiiiiiiiilt_ -> pEppB +#() pFXrLiiwwwwwwwwL_p -> pFXBp +#() vFbppuiiiiiiiiipp_pp -> vFBpp +#() vEEipp -> vEEipp +#() vFEipp -> vFEipp +#() vEEipV -> vEEipV +#() vFEpui -> vFEpui +#() vEEpuu -> vEEpuu +#() vEEpup -> vEEpup +#() vFEpup -> vFEpup +#() vFEpll -> vFEpll +#() vEEppp -> vEEppp +#() vFEppp -> vFEppp +#() vFEXLp -> vFEXLp +#() vFEXpi -> vFEXpi +#() vFcccc -> vFcccc +#() vFwwww -> vFwwww +#() vFiiii -> vFiiii +#() vFiiip -> vFiiip +#() vFiiCp -> vFiiCp +#() vFiill -> vFiill +#() vFiIII -> vFiIII +#() vFiuip -> vFiuip +#() vFiuuu -> vFiuuu +#() vFiulp -> vFiulp +#() vFiupV -> vFiupV +#() vFiUUU -> vFiUUU +#() vFifff -> vFifff +#() vFiddd -> vFiddd +#() vFilip -> vFilip +#() vFilpu -> vFilpu +#() vFilpp -> vFilpp +#() vFipup -> vFipup +#() vFipll -> vFipll +#() vFippp -> vFippp +#() vFCCCC -> vFCCCC +#() vFWWWW -> vFWWWW +#() vFuccc -> vFuccc +#() vFuwww -> vFuwww +#() vFuiii -> vFuiii +#() vFuiip -> vFuiip +#() vFuiII -> vFuiII +#() vFuiui -> vFuiui +#() vFuiuC -> vFuiuC +#() vFuiuu -> vFuiuu +#() vFuiup -> vFuiup +#() vFuiUU -> vFuiUU +#() vFuifi -> vFuifi +#() vFuiff -> vFuiff +#() vFuidd -> vFuidd +#() vFuilp -> vFuilp +#() vFuipu -> vFuipu +#() vFuipp -> vFuipp +#() vFuIII -> vFuIII +#() vFuWWW -> vFuWWW +#() vFuuii -> vFuuii +#() vFuuiu -> vFuuiu +#() vFuuil -> vFuuil +#() vFuuip -> vFuuip +#() vFuuCu -> vFuuCu +#() vFuuCp -> vFuuCp +#() vFuuui -> vFuuui +#() vFuuuu -> vFuuuu +#() vFuuuf -> vFuuuf +#() vFuuud -> vFuuud +#() vFuuul -> vFuuul +#() vFuuup -> vFuuup +#() vFuuUl -> vFuuUl +#() vFuuff -> vFuuff +#() vFuuli -> vFuuli +#() vFuupi -> vFuupi +#() vFuupp -> vFuupp +#() vFuUui -> vFuUui +#() vFuUup -> vFuUup +#() vFuUUU -> vFuUUU +#() vFufff -> vFufff +#() vFuddd -> vFuddd +#() vFuluU -> vFuluU +#() vFullC -> vFullC +#() vFullp -> vFullp +#() vFulpu -> vFulpu +#() vFulpp -> vFulpp +#() vFupii -> vFupii +#() vFuppi -> vFuppi +#() vFuppu -> vFuppu +#() vFUUpi -> vFUUpi +#() vFffff -> vFffff +#() vFdddd -> vFdddd +#() vFllii -> vFllii +#() vFLiii -> vFLiii +#() vFpiip -> vFpiip +#() vFpipi -> vFpipi +#() vFpipp -> vFpipp +#() vFpudd -> vFpudd +#() vFpdii -> vFpdii +#() vFpddd -> vFpddd +#() vFplpp -> vFplpp +#() vFppid -> vFppid +#() vEppip -> vEppip +#() vFppui -> vFppui +#() vFppuu -> vFppuu +#() vFppdd -> vFppdd +#() vFpppp -> vFpppp +#() vFXiiL -> vFXiiL +#() vFXiLu -> vFXiLu +#() vFXLii -> vFXLii +#() vFXLip -> vFXLip +#() vFXLuu -> vFXLuu +#() vFXLLL -> vFXLLL +#() vFXLLp -> vFXLLp +#() vFXLpi -> vFXLpi +#() vFXLpL -> vFXLpL +#() vFXpip -> vFXpip +#() vFXppL -> vFXppL +#() cFpiii -> cFpiii +#() iEEiip -> iEEiip +#() iEEiiN -> iEEiiN +#() iEEiLp -> iEEiLp +#() iEEipp -> iEEipp +#() iFEipp -> iFEipp +#() iEEipV -> iEEipV +#() iEEpii -> iEEpii +#() iEEpip -> iEEpip +#() iFEpip -> iFEpip +#() iFEpui -> iFEpui +#() iFEpuu -> iFEpuu +#() iEEpup -> iEEpup +#() iFEpup -> iFEpup +#() iFEpll -> iFEpll +#() iEEpLi -> iEEpLi +#() iFEpLi -> iFEpLi +#() iEEppi -> iEEppi +#() iFEppi -> iFEppi +#() iFEppu -> iFEppu +#() iEEppL -> iEEppL +#() iEEppp -> iEEppp +#() iFEppp -> iFEppp +#() iEEppV -> iEEppV +#() iFEppV -> iFEppV +#() iEEpON -> iEEpON +#() iEEhup -> iEEhup +#() iEESpp -> iEESpp +#() iEESpV -> iEESpV +#() iFEXip -> iFEXip +#() iFEXup -> iFEXup +#() iFEXlp -> iFEXlp +#() iFEXLp -> iFEXLp +#() iFEXpp -> iFEXpp +#() iFiiii -> iFiiii +#() iFiiiu -> iFiiiu +#() iEiiip -> iEiiip +#() iEiiiN -> iEiiiN +#() iEiiII -> iEiiII +#() iEiIIi -> iEiIIi +#() iFiuii -> iFiuii +#() iFiuuU -> iFiuuU +#() iFiuup -> iFiuup +#() iFiupu -> iFiupu +#() iFiupp -> iFiupp +#() iEilli -> iEilli +#() iFiLpL -> iFiLpL +#() iEipii -> iEipii +#() iEipip -> iEipip +#() iEipui -> iEipui +#() iFipup -> iFipup +#() iFipLp -> iFipLp +#() iEippi -> iEippi +#() iFippu -> iFippu +#() iEippL -> iEippL +#() iFippp -> iFippp +#() iEipON -> iEipON +#() iFuiup -> iFuiup +#() iFupLp -> iFupLp +#() iFuppp -> iFuppp +#() iFUpLp -> iFUpLp +#() iFpiii -> iFpiii +#() iFpiiL -> iFpiiL +#() iFpiip -> iFpiip +#() iFpiII -> iFpiII +#() iFpiuu -> iFpiuu +#() iFpili -> iFpili +#() iFpipu -> iFpipu +#() iFpipL -> iFpipL +#() iEpipp -> iEpipp +#() iFpipp -> iFpipp +#() iFpCCC -> iFpCCC +#() iFpWWu -> iFpWWu +#() iEpuiL -> iEpuiL +#() iFpuuu -> iFpuuu +#() iFpuuU -> iFpuuU +#() iFpuup -> iFpuup +#() iFpuLp -> iFpuLp +#() iFpupi -> iFpupi +#() iFpupu -> iFpupu +#() iFpupL -> iFpupL +#() iFpupp -> iFpupp +#() iFpLuu -> iFpLuu +#() iFpLpp -> iFpLpp +#() iFppii -> iFppii +#() iFppiU -> iFppiU +#() iFppip -> iFppip +#() iFppWp -> iFppWp +#() iFppuw -> iFppuw +#() iFppui -> iFppui +#() iFppuu -> iFppuu +#() iFppup -> iFppup +#() iFppLi -> iFppLi +#() iFppLI -> iFppLI +#() iFppLu -> iFppLu +#() iFppLp -> iFppLp +#() iFpppi -> iFpppi +#() iFpppu -> iFpppu +#() iEpppL -> iEpppL +#() iFpppL -> iFpppL +#() iEpppp -> iEpppp +#() iFpppp -> iFpppp +#() iESpiL -> iESpiL +#() iFXiii -> iFXiii +#() iFXiiL -> iFXiiL +#() iFXiip -> iFXiip +#() iFXiuL -> iFXiuL +#() iFXiLL -> iFXiLL +#() iFXipi -> iFXipi +#() iFXipp -> iFXipp +#() iFXWWW -> iFXWWW +#() iFXuuu -> iFXuuu +#() iFXuuL -> iFXuuL +#() iFXuup -> iFXuup +#() iFXuLL -> iFXuLL +#() iFXupp -> iFXupp +#() iFXLii -> iFXLii +#() iFXLiL -> iFXLiL +#() iFXLip -> iFXLip +#() iFXLuu -> iFXLuu +#() iFXLLL -> iFXLLL +#() iFXLLp -> iFXLLp +#() iFXLpi -> iFXLpi +#() iFXpii -> iFXpii +#() iFXpip -> iFXpip +#() iFXpLp -> iFXpLp +#() iFXppi -> iFXppi +#() iFXppp -> iFXppp +#() IFEpIi -> IFEpIi +#() CFuuff -> CFuuff +#() uFEuip -> uFEuip +#() uFEpii -> uFEpii +#() uFEpip -> uFEpip +#() uFEpiV -> uFEpiV +#() uFEpup -> uFEpup +#() uFEpLL -> uFEpLL +#() uFuuuu -> uFuuuu +#() uFuppd -> uFuppd +#() uFpiip -> uFpiip +#() uFpCCC -> uFpCCC +#() uFppii -> uFppii +#() uFppip -> uFppip +#() uFpppi -> uFpppi +#() uFpppd -> uFpppd +#() uFpppp -> uFpppp +#() lEEipi -> lEEipi +#() lEEipL -> lEEipL +#() lEEppL -> lEEppL +#() lEiipL -> lEiipL +#() lEipLi -> lEipLi +#() lEipLI -> lEipLI +#() lEipLl -> lEipLl +#() lEipLL -> lEipLL +#() lFpuip -> lFpuip +#() lFppLp -> lFppLp +#() LFEpLp -> LFEpLp +#() LFEXii -> LFEXii +#() LEpLLS -> LEpLLS +#() LEppLL -> LEppLL +#() LEppLp -> LEppLp +#() LEppLa -> LEppLa +#() LFXCii -> LFXCii +#() LFXLuu -> LFXLuu +#() LFXpLp -> LFXpLp +#() pFEupi -> pFEupi +#() pFEupp -> pFEupp +#() pEEpii -> pEEpii +#() pEEpip -> pEEpip +#() pFEpip -> pFEpip +#() pFEpui -> pFEpui +#() pEEppi -> pEEppi +#() pFEppi -> pFEppi +#() pEEppp -> pEEppp +#() pFEppp -> pFEppp +#() pFEXip -> pFEXip +#() pFEXCL -> pFEXCL +#() pFEXuu -> pFEXuu +#() pFEXLL -> pFEXLL +#() pFEXLp -> pFEXLp +#() pFEXpL -> pFEXpL +#() pFEXpp -> pFEXpp +#() pFiiiu -> pFiiiu +#() pFifff -> pFifff +#() pFillu -> pFillu +#() pEippu -> pEippu +#() pFullu -> pFullu +#() pFdddd -> pFdddd +#() pFpiii -> pFpiii +#() pFpiip -> pFpiip +#() pEpiLL -> pEpiLL +#() pFpipc -> pFpipc +#() pFpipi -> pFpipi +#() pFpipp -> pFpipp +#() pFpuii -> pFpuii +#() pFpupu -> pFpupu +#() pFpupp -> pFpupp +#() pEpLiS -> pEpLiS +#() pEpLpL -> pEpLpL +#() pFpLpL -> pFpLpL +#() pEppLL -> pEppLL +#() pFppLp -> pFppLp +#() pFpppi -> pFpppi +#() pFpppL -> pFpppL +#() pFpppp -> pFpppp +#() pFXiii -> pFXiii +#() pFXiip -> pFXiip +#() pFXLpp -> pFXLpp +#() pFXppp -> pFXppp +#() vFuibp_i -> vFuiBi +#() vFuuuBp_ -> vFuuuB +#() vFbp_ppp -> vFBppp +#() vFXLLbL_ -> vFXLLB +#() iFEpbL_p -> iFEpBp +#() iFpipbL_ -> iFpipB +#() iFpupbL_ -> iFpupB +#() iFpubp_u -> iFpuBu +#() iFplibl_ -> iFpliB +#() iFpLpbL_ -> iFpLpB +#() iFppWbp_ -> iFppWB +#() iFpppbp_ -> iFpppB +#() iFpppbL_ -> iFpppB +#() iFppbp_u -> iFppBu +#() iFppbL_p -> iFppBp +#() iFpbp_ii -> iFpBii +#() iFpbp_ip -> iFpBip +#() iFpbp_uu -> iFpBuu +#() iFpbp_pp -> iFpBpp +#() iFbp_upL -> iFBupL +#() iFbp_pii -> iFBpii +#() iFbp_pip -> iFBpip +#() iFBp_pui -> iFBpui +#() iFbp_ppu -> iFBppu +#() iFXLiBp_ -> iFXLiB +#() iFXLbp_i -> iFXLBi +#() iFXLbL_i -> iFXLBi +#() iFXLbp_p -> iFXLBp +#() IEpBp_ii -> IEpBii +#() IEpBp_ia -> IEpBia +#() uFppibp_ -> uFppiB +#() uFppibl_ -> uFppiB +#() uFppbp_i -> uFppBi +#() uFpbp_ip -> uFpBip +#() UEpBp_ii -> UEpBii +#() UEpBp_ia -> UEpBia +#() lEiibl_L -> lEiiBL +#() LEpBp_ii -> LEpBii +#() LEpbp_Lp -> LEpBLp +#() pFpppbl_ -> pFpppB +#() vFpibpp_i -> vFpiBi +#() iEEpprLL_ -> iEEppB +#() iFuubpu_u -> iFuuBu +#() iFpuubpu_ -> iFpuuB +#() iFpupbpu_ -> iFpupB +#() iFpubpu_u -> iFpuBu +#() iEpurLL_p -> iEpuBp +#() iFppubpu_ -> iFppuB +#() iFppbpu_u -> iFppBu +#() iFpbpu_uu -> iFpBuu +#() iFpbpu_up -> iFpBup +#() iFbpu_ppp -> iFBppp +#() iFnbpL_iU -> iFnBiU +#() lFppLbLL_ -> lFppLB +#() pFnbpi_up -> pFnBup +#() vFppbp_bL_ -> vFppBB +#() vFpbLdd_ip -> vFpBip +#() vFpbupu_uu -> vFpBuu +#() iFupbp_bp_ -> iFupBB +#() iFppbL_bL_ -> iFppBB +#() iFppbp_bp_ -> iFppBB +#() iFppbp_bL_ -> iFppBB +#() iFpbupu_up -> iFpBup +#() iFbp_urp_u -> iFBuBu +#() iFrpuu_Lui -> iFBLui +#() iEbp_bL_iS -> iEBBiS +#() iFbp_bp_pi -> iFBBpi +#() iFXbL_ibp_ -> iFXBiB +#() iFnubp_bp_ -> iFnuBB +#() iFnUbp_bp_ -> iFnUBB +#() vFEpuBLLLL_ -> vFEpuB +#() vFbp_ppbup_ -> vFBppB +#() vFXLbpLiL_L -> vFXLBL +#() iFubpu_pbL_ -> iFuBpB +#() iFpbpu_pbL_ -> iFpBpB +#() iFpbpu_bp_u -> iFpBBu +#() iFbpu_upbL_ -> iFBupB +#() iFbp_pbpu_u -> iFBpBu +#() iFXLbpLiL_L -> iFXLBL +#() iEiirLL_BLL_ -> iEiiBB +#() iEuirLL_BLL_ -> iEuiBB +#() iFpubpu_bpu_ -> iFpuBB +#() iFppbpu_bpu_ -> iFppBB +#() iFpbpu_Lbpu_ -> iFpBLB +#() iFpbpu_bpu_u -> iFpBBu +#() iFpbpu_bpu_p -> iFpBBp +#() iFXLpbLWWWcc_ -> iFXLpB +#() iFXLbLWWWcc_i -> iFXLBi +#() pESBppppii_pi -> pESBpi +#() iFEprllll_rll_ -> iFEpBB +#() iEupuBpppiiip_ -> iEupuB +#() iFbp_ubpu_bpu_ -> iFBuBB +#() iFXLuriiiiiLi_ -> iFXLuB +#() uFnibpL_bLpCC_ -> uFniBB +#() iFppubppuuuuup_ -> iFppuB +#() iFpruuipWCCp_ll -> iFpBll +#() iFpbLL_bLL_bLL_ -> iFpBBB +#() pFppibppuuuuup_ -> pFppiB +#() vFXLbLLLLLLLLLL_L -> vFXLBL +#() iFXLbLLLLLLLLLL_L -> iFXLBL +#() LEpLpriiiiiiiiilt_ -> LEpLpB +#() iFXipBWWWWWWWWWuip_ -> iFXipB +#() iFXLbLWWWcc_bLWWWcc_ -> iFXLBB +#() uFEbppuiiiiiiiiipp_ip -> uFEBip +#() uFbppuiiiiiiiiipp_ipi -> uFBipi +#() iFpruuipWCCp_buuipWCCp_i -> iFpBBi +#() iFXpLriLLLiiiiiiiLLiiLiiiiLic_ -> iFXpLB +#() iFXpLbiLLLiiiiiiiLLiiLiiiiLic_ -> iFXpLB +#() pFXLLbiLLLiiiiiiiLLiiLiiiiLic_ -> pFXLLB +#() uFbppuiiiiiiiiipp_ipbppuiiiiiiiiipp_ -> uFBipB +#() vEEiipp -> vEEiipp +#() vEEiipV -> vEEiipV +#() vFEuipu -> vFEuipu +#() vFEuipp -> vFEuipp +#() vEEpLLp -> vEEpLLp +#() vEEppiV -> vEEppiV +#() vFEpppp -> vFEpppp +#() vFEXLpL -> vFEXLpL +#() vFiiiii -> vFiiiii +#() vFiiiiu -> vFiiiiu +#() vFiiuii -> vFiiuii +#() vFiiuup -> vFiiuup +#() vFiillu -> vFiillu +#() vFiilll -> vFiilll +#() vFiipll -> vFiipll +#() vFiIIII -> vFiIIII +#() vFiuiip -> vFiuiip +#() vFiuuuu -> vFiuuuu +#() vFiulpp -> vFiulpp +#() vFiUUUU -> vFiUUUU +#() vFiffff -> vFiffff +#() vFidddd -> vFidddd +#() vFilill -> vFilill +#() vFilipi -> vFilipi +#() vFilipl -> vFilipl +#() vFipipu -> vFipipu +#() vFipipp -> vFipipp +#() vFipupi -> vFipupi +#() vFucccc -> vFucccc +#() vFuwwww -> vFuwwww +#() vFuiiii -> vFuiiii +#() vFuiiiu -> vFuiiiu +#() vFuiiip -> vFuiiip +#() vFuiiCp -> vFuiiCp +#() vFuiiup -> vFuiiup +#() vFuiill -> vFuiill +#() vFuiIII -> vFuiIII +#() vFuiuii -> vFuiuii +#() vFuiuip -> vFuiuip +#() vFuiuCi -> vFuiuCi +#() vFuiuCu -> vFuiuCu +#() vFuiuuu -> vFuiuuu +#() vFuiuup -> vFuiuup +#() vFuiupi -> vFuiupi +#() vFuiUUU -> vFuiUUU +#() vFuifff -> vFuifff +#() vFuiddd -> vFuiddd +#() vFuipii -> vFuipii +#() vFuipip -> vFuipip +#() vFuipup -> vFuipup +#() vFuippp -> vFuippp +#() vFuIIII -> vFuIIII +#() vFuCCCC -> vFuCCCC +#() vFuCuip -> vFuCuip +#() vFuCuup -> vFuCuup +#() vFuWWWW -> vFuWWWW +#() vFuuiii -> vFuuiii +#() vFuuiip -> vFuuiip +#() vFuuiui -> vFuuiui +#() vFuuiuu -> vFuuiuu +#() vFuuiup -> vFuuiup +#() vFuuifi -> vFuuifi +#() vFuuipC -> vFuuipC +#() vFuuipu -> vFuuipu +#() vFuuipp -> vFuuipp +#() vFuuuii -> vFuuuii +#() vFuuuiu -> vFuuuiu +#() vFuuuil -> vFuuuil +#() vFuuuip -> vFuuuip +#() vFuuuui -> vFuuuui +#() vFuuuuu -> vFuuuuu +#() vFuuuup -> vFuuuup +#() vFuuuli -> vFuuuli +#() vFuuull -> vFuuull +#() vFuulll -> vFuulll +#() vFuullp -> vFuullp +#() vFuupii -> vFuupii +#() vFuUUUU -> vFuUUUU +#() vFuffff -> vFuffff +#() vFudddd -> vFudddd +#() vFullpu -> vFullpu +#() vFupiii -> vFupiii +#() vFupupp -> vFupupp +#() vFuplii -> vFuplii +#() vFuppip -> vFuppip +#() vFupppp -> vFupppp +#() vFfffff -> vFfffff +#() vFddddp -> vFddddp +#() vFluipp -> vFluipp +#() vFpiiii -> vFpiiii +#() vFpilpp -> vFpilpp +#() vFpipiu -> vFpipiu +#() vFpuipp -> vFpuipp +#() vFpuddd -> vFpuddd +#() vFpddii -> vFpddii +#() vFpdddd -> vFpdddd +#() vFppWui -> vFppWui +#() vFpppii -> vFpppii +#() vFppppu -> vFppppu +#() vFppppp -> vFppppp +#() vFXLiii -> vFXLiii +#() vFXLiiL -> vFXLiiL +#() vFXLppi -> vFXLppi +#() vFXpiiL -> vFXpiiL +#() iEEiiip -> iEEiiip +#() iEEiipV -> iEEiipV +#() iEEipii -> iEEipii +#() iEEipuu -> iEEipuu +#() iEEipup -> iEEipup +#() iEEippi -> iEEippi +#() iEEippL -> iEEippL +#() iEEuupi -> iEEuupi +#() iFEpiup -> iFEpiup +#() iEEpipp -> iEEpipp +#() iFEpipp -> iFEpipp +#() iEEpipV -> iEEpipV +#() iFEpuip -> iFEpuip +#() iFEpupu -> iFEpupu +#() iEEpLpp -> iEEpLpp +#() iFEpLpp -> iFEpLpp +#() iEEpLpV -> iEEpLpV +#() iFEpLpV -> iFEpLpV +#() iEEppii -> iEEppii +#() iFEpplp -> iFEpplp +#() iEEpppi -> iEEpppi +#() iEEpppp -> iEEpppp +#() iFEpppp -> iFEpppp +#() iEESipp -> iEESipp +#() iEESipV -> iEESipV +#() iFEXipp -> iFEXipp +#() iFEXLip -> iFEXLip +#() iFEXLlp -> iFEXLlp +#() iFEXLLp -> iFEXLLp +#() iFEXLpi -> iFEXLpi +#() iFEXLpp -> iFEXLpp +#() iFEXpii -> iFEXpii +#() iFEXpLp -> iFEXpLp +#() iFEXppu -> iFEXppu +#() iFEXppp -> iFEXppp +#() iFiiiui -> iFiiiui +#() iEiiipu -> iEiiipu +#() iEiiipp -> iEiiipp +#() iFiuuuu -> iFiuuuu +#() iFiuuuU -> iFiuuuU +#() iFiuuup -> iFiuuup +#() iFipiip -> iFipiip +#() iEipLLi -> iEipLLi +#() iFippuu -> iFippuu +#() iEippLi -> iEippLi +#() iEipppi -> iEipppi +#() iEipppp -> iEipppp +#() iFuiuup -> iFuiuup +#() iFuupid -> iFuupid +#() iFpiiuu -> iFpiiuu +#() iFpiipp -> iFpiipp +#() iFpippL -> iFpippL +#() iFpippp -> iFpippp +#() iFpCCCC -> iFpCCCC +#() iFpuipp -> iFpuipp +#() iFpupuu -> iFpupuu +#() iFpupLu -> iFpupLu +#() iFpuppp -> iFpuppp +#() iFppiUi -> iFppiUi +#() iFppipp -> iFppipp +#() iFppWup -> iFppWup +#() iFppuip -> iFppuip +#() iFppupu -> iFppupu +#() iFppLpL -> iFppLpL +#() iFpppip -> iFpppip +#() iFpppuu -> iFpppuu +#() iEpppLi -> iEpppLi +#() iFpppLu -> iFpppLu +#() iEpppLp -> iEpppLp +#() iFppppi -> iFppppi +#() iFppppu -> iFppppu +#() iFppppd -> iFppppd +#() iFppppL -> iFppppL +#() iFppppp -> iFppppp +#() iFXiiii -> iFXiiii +#() iFXiiip -> iFXiiip +#() iFXiuLi -> iFXiuLi +#() iFXiLip -> iFXiLip +#() iFXiLuu -> iFXiLuu +#() iFXuuLL -> iFXuuLL +#() iFXLLii -> iFXLLii +#() iFXLpii -> iFXLpii +#() iFXLpLi -> iFXLpLi +#() iFXLppi -> iFXLppi +#() iFXpipi -> iFXpipi +#() iFXpppp -> iFXpppp +#() IFXpIII -> IFXpIII +#() uEEippu -> uEEippu +#() uFEpipp -> uFEpipp +#() uFEpppp -> uFEpppp +#() uFpuupp -> uFpuupp +#() uEpLLLS -> uEpLLLS +#() uFppppp -> uFppppp +#() UFuiCiu -> UFuiCiu +#() lFpuipC -> lFpuipC +#() lFppLpL -> lFppLpL +#() LFEppLL -> LFEppLL +#() LFEXLpi -> LFEXLpi +#() LFuuuuu -> LFuuuuu +#() LEpLppa -> LEpLppa +#() LFXLuuu -> LFXLuuu +#() LFXLpuu -> LFXLpuu +#() LFXpppi -> LFXpppi +#() pFEppip -> pFEppip +#() pFEppdd -> pFEppdd +#() pFEpnuu -> pFEpnuu +#() pFEpnup -> pFEpnup +#() pFEXipp -> pFEXipp +#() pFEXCip -> pFEXCip +#() pFEXlpp -> pFEXlpp +#() pFEXLip -> pFEXLip +#() pFEXpip -> pFEXpip +#() pFEXppi -> pFEXppi +#() pFuiupp -> pFuiupp +#() pFpiiii -> pFpiiii +#() pFpiiuu -> pFpiiuu +#() pFpiipi -> pFpiipi +#() pFpipii -> pFpipii +#() pFpipip -> pFpipip +#() pFpippi -> pFpippi +#() pFpippp -> pFpippp +#() pFpuiii -> pFpuiii +#() pFpuuuu -> pFpuuuu +#() pFpuppp -> pFpuppp +#() pFpdddd -> pFpdddd +#() pFpLLip -> pFpLLip +#() pFppipi -> pFppipi +#() pFppuup -> pFppuup +#() pFppupp -> pFppupp +#() pFpppii -> pFpppii +#() pFppppi -> pFppppi +#() pFXLipp -> pFXLipp +#() pFXpipi -> pFXpipi +#() pFXpuup -> pFXpuup +#() pFXppip -> pFXppip +#() tEpppLi -> tEpppLi +#() vFiuibp_i -> vFiuiBi +#() vFXibL_ii -> vFXiBii +#() iEEBh_ppp -> iEEBppp +#() iFpupbL_p -> iFpupBp +#() iFppibp_I -> iFppiBI +#() iFppWpbp_ -> iFppWpB +#() iFppupbL_ -> iFppupB +#() iFppppbp_ -> iFppppB +#() iFppbL_pu -> iFppBpu +#() iFppbL_pL -> iFppBpL +#() iFppbp_pp -> iFppBpp +#() iFpbp_iii -> iFpBiii +#() iFpbp_ipi -> iFpBipi +#() iFpbp_uuu -> iFpBuuu +#() iFpbp_uup -> iFpBuup +#() iFbp_piip -> iFBpiip +#() iFbp_puip -> iFBpuip +#() iFbp_pppi -> iFBpppi +#() iFXiibL_i -> iFXiiBi +#() iFXCupbL_ -> iFXCupB +#() iFXLbL_ii -> iFXLBii +#() uFppbp_ip -> uFppBip +#() LEpbp_LLp -> LEpBLLp +#() LEpBp_LLp -> LEpBLLp +#() pFpipibp_ -> pFpipiB +#() pFppupbl_ -> pFppupB +#() pFppLbp_p -> pFppLBp +#() iEippprLL_ -> iEipppB +#() iFpuibpu_p -> iFpuiBp +#() iFpupubpu_ -> iFpupuB +#() iEpurLL_pL -> iEpuBpL +#() iFppubpu_u -> iFppuBu +#() iFppubpu_p -> iFppuBp +#() iFpppibpp_ -> iFpppiB +#() iFppppbup_ -> iFppppB +#() iFpppbpu_u -> iFpppBu +#() iFppbpu_uu -> iFppBuu +#() iFppbpu_pu -> iFppBpu +#() iFpbpu_upu -> iFpBupu +#() iFpbpu_upp -> iFpBupp +#() iFpbpu_puu -> iFpBpuu +#() iFiiuBp_Bp_ -> iFiiuBB +#() iFppbp_bp_p -> iFppBBp +#() iFbp_bp_pip -> iFBBpip +#() vFbp_ppibup_ -> vFBppiB +#() iFEXbpLiL_pp -> iFEXBpp +#() iFpubp_bpu_u -> iFpuBBu +#() iFpppbp_bup_ -> iFpppBB +#() iFbp_pbpu_uu -> iFBpBuu +#() iFpibp_bp_bL_ -> iFpiBBB +#() iFpuubpu_bpu_ -> iFpuuBB +#() iFpubpu_pbpu_ -> iFpuBpB +#() iFppbpu_bpu_u -> iFppBBu +#() iFpbpu_bpu_uu -> iFpBBuu +#() iFpbpu_bpu_pu -> iFpBBpu +#() iFpbpu_bpu_bp_u -> iFpBBBu +#() iFXLiuriiiiiLi_ -> iFXLiuB +#() LELbp_bL_bp_bL_ -> LELBBBB +#() iFpubpu_bpu_bpu_ -> iFpuBBB +#() iFppbpu_bpu_bpu_ -> iFppBBB +#() uFEpbppuuuuup_ip -> uFEpBip +#() uFEpbppuuuuup_iV -> uFEpBiV +#() uFppupbppuuuuup_ -> uFppupB +#() iFbp_bp_bL_bp_bL_ -> iFBBBBB +#() vFXLbLLLLLLLLLL_iL -> vFXLBiL +#() iFXiiiBpLiiiLLLii_ -> iFXiiiB +#() iFpbpu_bpu_bpu_bpu_ -> iFpBBBB +#() LEpLpriiiiiiiiilt_a -> LEpLpBa +#() pFEXLrLiiwwwwwwwwL_i -> pFEXLBi +#() iFXLpbLWWWcc_bLWWWcc_ -> iFXLpBB +#() iFXLpBLWWWcc_BLWWWcc_ -> iFXLpBB +#() LFXLrLiiwwwwwwwwL_LriLiiiiLiiiiLi_ -> LFXLBLB +#() vFEiiipp -> vFEiiipp +#() vFEuippp -> vFEuippp +#() vFEupupi -> vFEupupi +#() vFiiiiii -> vFiiiiii +#() vFiiiuil -> vFiiiuil +#() vFiiilpi -> vFiiilpi +#() vFiiuilp -> vFiiuilp +#() vFiffiff -> vFiffiff +#() vFiddidd -> vFiddidd +#() vFilipli -> vFilipli +#() vFiliplu -> vFiliplu +#() vFipiplp -> vFipiplp +#() vFCCCCff -> vFCCCCff +#() vFuiiiii -> vFuiiiii +#() vFuiiiip -> vFuiiiip +#() vFuiiuii -> vFuiiuii +#() vFuiiuup -> vFuiiuup +#() vFuiIIII -> vFuiIIII +#() vFuiuiii -> vFuiuiii +#() vFuiuiiC -> vFuiuiiC +#() vFuiuiil -> vFuiuiil +#() vFuiuiuu -> vFuiuiuu +#() vFuiuiuU -> vFuiuiuU +#() vFuiuCip -> vFuiuCip +#() vFuiuuip -> vFuiuuip +#() vFuiuuuu -> vFuiuuuu +#() vFuiupii -> vFuiupii +#() vFuiupiu -> vFuiupiu +#() vFuiUUUU -> vFuiUUUU +#() vFuiffff -> vFuiffff +#() vFuidddd -> vFuidddd +#() vFuipiup -> vFuipiup +#() vFuCuuip -> vFuCuuip +#() vFuuiiii -> vFuuiiii +#() vFuuiuii -> vFuuiuii +#() vFuuiuil -> vFuuiuil +#() vFuuiuip -> vFuuiuip +#() vFuuiuCu -> vFuuiuCu +#() vFuuiuup -> vFuuiuup +#() vFuuuiii -> vFuuuiii +#() vFuuuiup -> vFuuuiup +#() vFuuuipC -> vFuuuipC +#() vFuuuipp -> vFuuuipp +#() vFuuuuii -> vFuuuuii +#() vFuuuuip -> vFuuuuip +#() vFuuuuuu -> vFuuuuuu +#() vFuuuull -> vFuuuull +#() vFuuuppi -> vFuuuppi +#() vFuuuppp -> vFuuuppp +#() vFuuffff -> vFuuffff +#() vFuudddd -> vFuudddd +#() vFuupiii -> vFuupiii +#() vFuupupp -> vFuupupp +#() vFuuplii -> vFuuplii +#() vFuffiip -> vFuffiip +#() vFufffff -> vFufffff +#() vFuddiip -> vFuddiip +#() vFulluUC -> vFulluUC +#() vFupiiii -> vFupiiii +#() vFffffff -> vFffffff +#() vFdddddd -> vFdddddd +#() vFpipipV -> vFpipipV +#() vFpudddd -> vFpudddd +#() vFpdddii -> vFpdddii +#() vFpddddd -> vFpddddd +#() vFpppppp -> vFpppppp +#() vFXiLppi -> vFXiLppi +#() vFXLiiii -> vFXLiiii +#() vFXLiiiL -> vFXLiiiL +#() vFXLiipi -> vFXLiipi +#() vFXLpppi -> vFXLpppi +#() vFXpiiii -> vFXpiiii +#() iEEiippi -> iEEiippi +#() iEEiLLLL -> iEEiLLLL +#() iEEipiup -> iEEipiup +#() iEEippup -> iEEippup +#() iEEuppLp -> iEEuppLp +#() iEEpiipi -> iEEpiipi +#() iFEpiipi -> iFEpiipi +#() iEEpiipV -> iEEpiipV +#() iFEpiuuu -> iFEpiuuu +#() iEEpiLpp -> iEEpiLpp +#() iEEpipOi -> iEEpipOi +#() iFEpuuip -> iFEpuuip +#() iFEpuuup -> iFEpuuup +#() iFEplluu -> iFEplluu +#() iFEpLlpp -> iFEpLlpp +#() iFEppipp -> iFEppipp +#() iEEppupi -> iEEppupi +#() iFEppllp -> iFEppllp +#() iEEpppup -> iEEpppup +#() iEEpppLp -> iEEpppLp +#() iFEXLilp -> iFEXLilp +#() iFEXLpiL -> iFEXLpiL +#() iFEXpiip -> iFEXpiip +#() iFEXpiup -> iFEXpiup +#() iFEXpppp -> iFEXpppp +#() iFiuuuup -> iFiuuuup +#() iFiuuupu -> iFiuuupu +#() iFiuuUpU -> iFiuuUpU +#() iFiuuppp -> iFiuuppp +#() iFiuUuUu -> iFiuUuUu +#() iEipipLu -> iEipipLu +#() iFipuIup -> iFipuIup +#() iFuiiuup -> iFuiiuup +#() iFupLpLp -> iFupLpLp +#() iFpiippp -> iFpiippp +#() iFppiiii -> iFppiiii +#() iFppiipi -> iFppiipi +#() iFppipip -> iFppipip +#() iFppippi -> iFppippi +#() iFppuIII -> iFppuIII +#() iFppulll -> iFppulll +#() iFpppuuu -> iFpppuuu +#() iFpppupu -> iFpppupu +#() iFpppppp -> iFpppppp +#() iFpppppS -> iFpppppS +#() iFXiiiii -> iFXiiiii +#() iFXiiLip -> iFXiiLip +#() iFXiippp -> iFXiippp +#() iFXuuuuu -> iFXuuuuu +#() iFXLiiiL -> iFXLiiiL +#() iFXLiiip -> iFXLiiip +#() iFXLiiuu -> iFXLiiuu +#() iFXLuupp -> iFXLuupp +#() iFXLupip -> iFXLupip +#() iFXLLLLL -> iFXLLLLL +#() iFXLppii -> iFXLppii +#() iFXLpppp -> iFXLpppp +#() iFXpIppp -> iFXpIppp +#() iFXpuiii -> iFXpuiii +#() iFXpLiWL -> iFXpLiWL +#() iFXpLLiL -> iFXpLLiL +#() iFXppppi -> iFXppppi +#() uFEpippi -> uFEpippi +#() uFupuufp -> uFupuufp +#() uFpppppp -> uFpppppp +#() lEipLipu -> lEipLipu +#() lEipLipp -> lEipLipp +#() pFEpiiuu -> pFEpiiuu +#() pEEpLLiN -> pEEpLLiN +#() pEEppLLp -> pEEppLLp +#() pFEpnCWp -> pFEpnCWp +#() pFEXLLLp -> pFEXLLLp +#() pFEXLpii -> pFEXLpii +#() pFEXpppp -> pFEXpppp +#() pFWCiWCi -> pFWCiWCi +#() pFdddddd -> pFdddddd +#() pFLppppp -> pFLppppp +#() pFpiiiiu -> pFpiiiiu +#() pFpiipip -> pFpiipip +#() pFpiippp -> pFpiippp +#() pFpipipL -> pFpipipL +#() pFpipipp -> pFpipipp +#() pFpipuii -> pFpipuii +#() pFpuuupu -> pFpuuupu +#() XFpppppp -> XFpppppp +#() iFpupupbL_ -> iFpupupB +#() iFpupbL_pp -> iFpupBpp +#() iFppuupbL_ -> iFppuupB +#() iFppupbL_p -> iFppupBp +#() iFpppibp_p -> iFpppiBp +#() iFpppppbp_ -> iFpppppB +#() iFpppbp_pp -> iFpppBpp +#() iFpbp_iuii -> iFpBiuii +#() iFXibL_ppu -> iFXiBppu +#() iFXLiiibL_ -> iFXLiiiB +#() iFXLLLLbL_ -> iFXLLLLB +#() iFXLbL_ipi -> iFXLBipi +#() iFXbL_upip -> iFXBupip +#() pFEppibp_p -> pFEppiBp +#() pEEppbL_Lp -> pEEppBLp +#() iEEipuurLL_ -> iEEipuuB +#() iEippprLL_p -> iEipppBp +#() iFupupLbpu_ -> iFupupLB +#() iFppppibpp_ -> iFppppiB +#() iFpppbpu_uu -> iFpppBuu +#() iFpbpu_uppu -> iFpBuppu +#() iFbpu_pLpLp -> iFBpLpLp +#() iFpuuubupu_u -> iFpuuuBu +#() iFppbL_pbL_p -> iFppBpBp +#() iFppbp_pbp_p -> iFppBpBp +#() iFpibp_pibpp_ -> iFpiBpiB +#() iFpuubpu_pbL_ -> iFpuuBpB +#() iFbpu_puupbL_ -> iFBpuupB +#() iFpppbp_bp_bL_ -> iFpppBBB +#() iFpbpu_bpu_uuu -> iFpBBuuu +#() iFpbpu_bpu_upu -> iFpBBupu +#() iFpbp_bp_bp_ii -> iFpBBBii +#() iFrpuu_Lrpuu_Lui -> iFBLBLui +#() iFXbLip_uubLip_L -> iFXBuuBL +#() vFbp_bppup_ippbp_ -> vFBBippB +#() iFpupbpu_bpu_bpu_ -> iFpupBBB +#() iFpubpu_bpu_bpu_p -> iFpuBBBp +#() iFpbpu_bpu_bpu_uu -> iFpBBBuu +#() uFEppppbppuuuuup_ -> uFEppppB +#() iFpubpu_bpu_bpu_bpu_ -> iFpuBBBB +#() iFppbpu_bpu_bpu_bpu_ -> iFppBBBB +#() iFpbpu_bpu_bpu_bpu_bpu_ -> iFpBBBBB +#() vFEuuippp -> vFEuuippp +#() vFEupupip -> vFEupupip +#() vFEppupui -> vFEppupui +#() vFiiiiiip -> vFiiiiiip +#() vFiiiiuup -> vFiiiiuup +#() vFiiuilil -> vFiiuilil +#() vFiiffffp -> vFiiffffp +#() vFiuulipi -> vFiuulipi +#() vFiupuuup -> vFiupuuup +#() vFilipliu -> vFilipliu +#() vFilulipi -> vFilulipi +#() vFCCCCfff -> vFCCCCfff +#() vFuiiiiii -> vFuiiiiii +#() vFuiiiiiC -> vFuiiiiiC +#() vFuiiiuip -> vFuiiiuip +#() vFuiiiuup -> vFuiiiuup +#() vFuiuiiii -> vFuiuiiii +#() vFuiuiiiC -> vFuiuiiiC +#() vFuiuiiip -> vFuiuiiip +#() vFuiuiiuU -> vFuiuiiuU +#() vFuiuCiuu -> vFuiuCiuu +#() vFuiupiiu -> vFuiupiiu +#() vFuiupuip -> vFuiupuip +#() vFuipiiii -> vFuipiiii +#() vFuipffff -> vFuipffff +#() vFuipdddd -> vFuipdddd +#() vFuuiiiii -> vFuuiiiii +#() vFuuiiiiC -> vFuuiiiiC +#() vFuuiiiiu -> vFuuiiiiu +#() vFuuiiiip -> vFuuiiiip +#() vFuuiiuup -> vFuuiiuup +#() vFuuiCiui -> vFuuiCiui +#() vFuuiCiuu -> vFuuiCiuu +#() vFuuiuiii -> vFuuiuiii +#() vFuuiuiiC -> vFuuiuiiC +#() vFuuipppp -> vFuuipppp +#() vFuuuiiii -> vFuuuiiii +#() vFuuuiiCp -> vFuuuiiCp +#() vFuuuiuil -> vFuuuiuil +#() vFuuuiupi -> vFuuuiupi +#() vFuuuuuuu -> vFuuuuuuu +#() vFuuuulll -> vFuuuulll +#() vFuuuffff -> vFuuuffff +#() vFuuudddd -> vFuuudddd +#() vFuuffiip -> vFuuffiip +#() vFuuddiip -> vFuuddiip +#() vFuulluup -> vFuulluup +#() vFuupiiii -> vFuupiiii +#() vFuuppppp -> vFuuppppp +#() vFuffffff -> vFuffffff +#() vFudddddd -> vFudddddd +#() vFlliiiip -> vFlliiiip +#() vFpipipiu -> vFpipipiu +#() vFpddiidd -> vFpddiidd +#() vFpdddddd -> vFpdddddd +#() vFXLiiiLi -> vFXLiiiLi +#() vFXLiiipi -> vFXLiiipi +#() vFXLiiuui -> vFXLiiuui +#() vFXLLuuuu -> vFXLLuuuu +#() vFXLppipi -> vFXLppipi +#() vFXpiipii -> vFXpiipii +#() vFXppiiii -> vFXppiiii +#() iFElppppp -> iFElppppp +#() iEEpLiipp -> iEEpLiipp +#() iEEpLiipV -> iEEpLiipV +#() iEEpLiLpV -> iEEpLiLpV +#() iFEpppipp -> iFEpppipp +#() iFEpppupp -> iFEpppupp +#() iEEpppppp -> iEEpppppp +#() iFEXLpiiL -> iFEXLpiiL +#() iFEXLpppp -> iFEXLpppp +#() iFEXppppp -> iFEXppppp +#() iFiuuuuii -> iFiuuuuii +#() iFippuIup -> iFippuIup +#() iFuiiiuup -> iFuiiiuup +#() iFpiuuuiu -> iFpiuuuiu +#() iFpWCiWCi -> iFpWCiWCi +#() iEpupupui -> iEpupupui +#() iFpLpLpLp -> iFpLpLpLp +#() iFpLppiip -> iFpLppiip +#() iFppupipi -> iFppupipi +#() iFXiuLiii -> iFXiuLiii +#() iFXiLuupp -> iFXiLuupp +#() iFXLiiiiL -> iFXLiiiiL +#() iFXLiiuui -> iFXLiiuui +#() iFXLpiiii -> iFXLpiiii +#() iFXLpiiuu -> iFXLpiiuu +#() iFXLpiipi -> iFXLpiipi +#() iFXLppiii -> iFXLppiii +#() iFXpiipii -> iFXpiipii +#() iFXpLiWwL -> iFXpLiWwL +#() iFXpLuuii -> iFXpLuuii +#() uFEpppppp -> uFEpppppp +#() uFuippppp -> uFuippppp +#() uFpippppp -> uFpippppp +#() uFpuupppp -> uFpuupppp +#() uFppppppp -> uFppppppp +#() lEEipLpLL -> lEEipLpLL +#() pFEpiiiiu -> pFEpiiiiu +#() pFEpLiiii -> pFEpLiiii +#() pEEpLiiiI -> pEEpLiiiI +#() pFEpLiiiI -> pFEpLiiiI +#() pEEpLiiil -> pEEpLiiil +#() pFEpXppip -> pFEpXppip +#() pFpipiupp -> pFpipiupp +#() pFpuuupuu -> pFpuuupuu +#() pFppppiii -> pFppppiii +#() vFXLLiiibl_ -> vFXLLiiiB +#() iFppppppbp_ -> iFppppppB +#() pFpiipipbp_ -> pFpiipipB +#() iFppppubpu_u -> iFppppuBu +#() iFXiLibiip_ip -> iFXiLiBip +#() iFXLibL_ubL_u -> iFXLiBuBu +#() iFppibp_pibpp_ -> iFppiBpiB +#() iFXLpiibpiiL_i -> iFXLpiiBi +#() iFppbupu_uubpu_u -> iFppBuuBu +#() iFppubpu_bpu_bpu_bpu_ -> iFppuBBBB +#() LFXLLuubLWWWcc_bLWWWcc_ -> LFXLLuuBB +#() LFXLLbLWWWcc_bLWWWcc_uu -> LFXLLBBuu +#() iFpubpu_bpu_bpu_bpu_bpu_ -> iFpuBBBBB +#() iFpbpu_bpu_bpu_bpu_bpu_bpu_ -> iFpBBBBBB +#() vFEXLpiipi -> vFEXLpiipi +#() vFiiiiuuip -> vFiiiiuuip +#() vFiilliilp -> vFiilliilp +#() vFiupuiuup -> vFiupuiuup +#() vFiupuuuup -> vFiupuuuup +#() vFuiiiiiii -> vFuiiiiiii +#() vFuiiiiiiC -> vFuiiiiiiC +#() vFuiiiiuup -> vFuiiiiuup +#() vFuiiipiup -> vFuiiipiup +#() vFuiuiiiii -> vFuiuiiiii +#() vFuiuiiiip -> vFuiuiiiip +#() vFuiuiiiuU -> vFuiuiiiuU +#() vFuiuiiCuU -> vFuiuiiCuU +#() vFuiuiuuuu -> vFuiuiuuuu +#() vFuCCCCfff -> vFuCCCCfff +#() vFuuiiiiiC -> vFuuiiiiiC +#() vFuuiiiuip -> vFuuiiiuip +#() vFuuiiiuup -> vFuuiiiuup +#() vFuuiiuupp -> vFuuiiuupp +#() vFuuiuiiii -> vFuuiuiiii +#() vFuuiuiiiC -> vFuuiuiiiC +#() vFuuiuiiip -> vFuuiuiiip +#() vFuuuiiiiu -> vFuuuiiiiu +#() vFuuuiuCil -> vFuuuiuCil +#() vFuuuipipp -> vFuuuipipp +#() vFuuuuuuuu -> vFuuuuuuuu +#() vFuuufffff -> vFuuufffff +#() vFffffffff -> vFffffffff +#() vFXiLLiipi -> vFXiLLiipi +#() vFXiLpiiuu -> vFXiLpiiuu +#() vFXLiiiLii -> vFXLiiiLii +#() vFXLLLiipi -> vFXLLLiipi +#() vFXppuulll -> vFXppuulll +#() iFEpippupp -> iFEpippupp +#() iEEpippppp -> iEEpippppp +#() iEEpLiLppp -> iEEpLiLppp +#() iFEppipppp -> iFEppipppp +#() iFiipppppp -> iFiipppppp +#() iFiuuCCuup -> iFiuuCCuup +#() iFiuuuupip -> iFiuuuupip +#() iFuiiiiuup -> iFuiiiiuup +#() iFupipppip -> iFupipppip +#() iFpuuiiuuu -> iFpuuiiuuu +#() iFpLpiLpLp -> iFpLpiLpLp +#() iFXuupuupp -> iFXuupuupp +#() iFXLpipppp -> iFXLpipppp +#() iFXLppLpip -> iFXLppLpip +#() iFXpIIIppp -> iFXpIIIppp +#() CFuiifpppp -> CFuiifpppp +#() uFuipppppp -> uFuipppppp +#() uFuupuuiuf -> uFuupuuiuf +#() uFulpppppp -> uFulpppppp +#() LFEXLppuuu -> LFEXLppuuu +#() LFXLpuuLLu -> LFXLpuuLLu +#() pFEppipipp -> pFEppipipp +#() pFEXpLLppp -> pFEXpLLppp +#() iFXLLiippBL_ -> iFXLLiippB +#() iFXLpppbL_pp -> iFXLpppBpp +#() pFpuuuuupbp_ -> pFpuuuuupB +#() iFppppubpu_Iu -> iFppppuBIu +#() iFpppbpu_ppuu -> iFpppBppuu +#() vFppibLdd_ipiu -> vFppiBipiu +#() iFpupbL_ppbL_p -> iFpupBppBp +#() iFpppibp_pbp_p -> iFpppiBpBp +#() iFbpu_upppppbp_ -> iFBupppppB +#() iFbp_ubp_ubp_uup -> iFBuBuBuup +#() iFpubpu_bpu_bpu_bpu_bpu_bpu_ -> iFpuBBBBBB +#() vFEXLppiipi -> vFEXLppiipi +#() vFiiiiiiiii -> vFiiiiiiiii +#() vFiiiiiiill -> vFiiiiiiill +#() vFiiiiillli -> vFiiiiillli +#() vFiiilllilp -> vFiiilllilp +#() vFiupuiuuup -> vFiupuiuuup +#() vFiupuuuuup -> vFiupuuuuup +#() vFuiiiiiiii -> vFuiiiiiiii +#() vFuiiiiiiiC -> vFuiiiiiiiC +#() vFuiiiiiuip -> vFuiiiiiuip +#() vFuiiiiiuup -> vFuiiiiiuup +#() vFuiuiiiiip -> vFuiuiiiiip +#() vFuiuiiiCuU -> vFuiuiiiCuU +#() vFuiupuffup -> vFuiupuffup +#() vFuuiiiiiii -> vFuuiiiiiii +#() vFuuiiiiiiC -> vFuuiiiiiiC +#() vFuuiiiiuup -> vFuuiiiiuup +#() vFuuiuiiiii -> vFuuiuiiiii +#() vFuuiuiiiip -> vFuuiuiiiip +#() vFuuuiiiiCp -> vFuuuiiiiCp +#() vFuuuuuuuuu -> vFuuuuuuuuu +#() vFuupuuiuuf -> vFuupuuiuuf +#() vFuffffffff -> vFuffffffff +#() vFffCCCCfff -> vFffCCCCfff +#() vFddddddddd -> vFddddddddd +#() vFXiLLpiipi -> vFXiLLpiipi +#() vFXLiiipiii -> vFXLiiipiii +#() iFEpuippupp -> iFEpuippupp +#() iFEXLLLiipi -> iFEXLLLiipi +#() iFiuuuppppu -> iFiuuuppppu +#() iFuiiuuiiip -> iFuiiuuiiip +#() iFuiiupiiup -> iFuiiupiiup +#() iFdddpppppp -> iFdddpppppp +#() iFXuuuLiiip -> iFXuuuLiiip +#() iFXuuuLpppp -> iFXuuuLpppp +#() iFXLiuiiLLL -> iFXLiuiiLLL +#() iFXLLiiuuii -> iFXLLiiuuii +#() iFXLpiiuuii -> iFXLpiiuuii +#() uFuulpiuiuf -> uFuulpiuiuf +#() LFXLiiiiiip -> LFXLiiiiiip +#() LFXLiiuuuLL -> LFXLiiuuuLL +#() pFEuiiiuuuu -> pFEuiiiuuuu +#() pFEpnCuuuuu -> pFEpnCuuuuu +#() pFEXLiiuuLi -> pFEXLiiuuLi +#() pFpiiiiuuuu -> pFpiiiiuuuu +#() iFXLbL_pppppp -> iFXLBpppppp +#() iFXiLiiibiip_ip -> iFXiLiiiBip +#() iFXiLLLiiibiip_ -> iFXiLLLiiiB +#() iFXLbL_bL_ppppp -> iFXLBBppppp +#() iFuuppuubpu_bpu_u -> iFuuppuuBBu +#() iFpuuuuuubpu_bpu_ -> iFpuuuuuuBB +#() iFpuupbpu_ubpu_uu -> iFpuupBuBuu +#() pFEXbpLiLLLii_uippuu -> pFEXBuippuu +#() vFXiLLrLiiwwwwwwwwL_iipi -> vFXiLLBiipi +#() iFpbpu_bpu_bpu_bpu_bpu_bpu_bpu_bpu_ -> iFpBBBBBBBB +#() vFEXLpppippp -> vFEXLpppippp +#() vFiiiiiiiiii -> vFiiiiiiiiii +#() vFiiiiiiiiui -> vFiiiiiiiiui +#() vFiiiiiiiiuu -> vFiiiiiiiiuu +#() vFiiillliiip -> vFiiillliiip +#() vFuiiiiiiiii -> vFuiiiiiiiii +#() vFuiiiiiiiip -> vFuiiiiiiiip +#() vFuiiiiiiuup -> vFuiiiiiiuup +#() vFuiuiiiiuup -> vFuiuiiiiuup +#() vFuuiiiiiiii -> vFuuiiiiiiii +#() vFuuiiiiiuip -> vFuuiiiiiuip +#() vFuuiiiiiuup -> vFuuiiiiiuup +#() vFuuiuiiiiip -> vFuuiuiiiiip +#() vFuuuuuuuCCC -> vFuuuuuuuCCC +#() vFuuuuuuuuuu -> vFuuuuuuuuuu +#() vFuupuiupuuf -> vFuupuiupuuf +#() vFuffiiffiip -> vFuffiiffiip +#() vFuddiiddiip -> vFuddiiddiip +#() vFffffffffff -> vFffffffffff +#() vFppipipippi -> vFppipipippi +#() iFEppippippp -> iFEppippippp +#() iFEppppppppu -> iFEppppppppu +#() iFEXpLiipiiL -> iFEXpLiipiiL +#() iFiuuupppppu -> iFiuuupppppu +#() iFuiiiuuiiip -> iFuiiiuuiiip +#() iFppuuiiuuuu -> iFppuuiiuuuu +#() iFXiLLdduudd -> iFXiLLdduudd +#() iFXuuLiuiiLL -> iFXuuLiuiiLL +#() iFXLLpiiuuii -> iFXLLpiiuuii +#() pFEpiiiiuuuu -> pFEpiiiiuuuu +#() pFEpnCuuuCup -> pFEpnCuuuCup +#() pFXpuiipuuii -> pFXpuiipuuii +#() iFppLpLLpLpbL_ -> iFppLpLLpLpB +#() iFXiiLiiibiip_ip -> iFXiiLiiiBip +#() iFXiLLiiibiip_ip -> iFXiLLiiiBip +#() vFiiiiillliip -> vFiiiiillliip +#() vFiiiiilllilp -> vFiiiiilllilp +#() vFuiiiiiiiuip -> vFuiiiiiiiuip +#() vFuiiiiiiiuup -> vFuiiiiiiiuup +#() vFuiiiillliip -> vFuiiiillliip +#() vFuiuiiiiiuup -> vFuiuiiiiiuup +#() vFuuiiiiiiuup -> vFuuiiiiiiuup +#() vFuuupupppppp -> vFuuupupppppp +#() vFuuffiiffiip -> vFuuffiiffiip +#() vFuufffffffff -> vFuufffffffff +#() vFuuddiiddiip -> vFuuddiiddiip +#() vFuUuuuuuuuuu -> vFuUuuuuuuuuu +#() vFuffffffffff -> vFuffffffffff +#() vFUufffffffff -> vFUufffffffff +#() vFpiiiiiiiiuu -> vFpiiiiiiiiuu +#() vFpipipiipiiu -> vFpipipiipiiu +#() iFEXLppiiiiuu -> iFEXLppiiiiuu +#() iFEXpLLiiLWpi -> iFEXpLLiiLWpi +#() iFuiiiiuuiiip -> iFuiiiiuuiiip +#() iFuppipipippi -> iFuppipipippi +#() iFXLLpiiuuiiL -> iFXLLpiiuuiiL +#() pFEXpuiipuuii -> pFEXpuiipuuii +#() iFXiiLLiiibiip_ip -> iFXiiLLiiiBip +#() iFXLibL_iiiibL_bL_bL_ -> iFXLiBiiiiBBB +#() vFXiLLrLiiwwwwwwwwL_iiiipi -> vFXiLLBiiiipi +#() vFuiiiiiiiiuUC -> vFuiiiiiiiiuUC +#() vFuiiiiiiiuuip -> vFuiiiiiiiuuip +#() vFuuiiiiiiiiuu -> vFuuiiiiiiiiuu +#() vFuuiiiiiiiuip -> vFuuiiiiiiiuip +#() vFuuiiiiiiiuup -> vFuuiiiiiiiuup +#() vFuuuuuuuuuuuu -> vFuuuuuuuuuuuu +#() vFffffffffffff -> vFffffffffffff +#() vFXiLLpiiiipii -> vFXiLLpiiiipii +#() iFEXLppiiiiuui -> iFEXLppiiiiuui +#() iFXLpppppppppp -> iFXLpppppppppp +#() pFEXLiiuuLipii -> pFEXLiiuuLipii +#() iFXiLbL_bL_ppppbip_pp -> iFXiLBBppppBpp +#() iFXiLlliLBL_pBL_BL_bp_ -> iFXiLlliLBpBBB +#() vFXiLLrLiiwwwwwwwwL_Liiiipi -> vFXiLLBLiiiipi +#() vFuiiiiiiiiiuup -> vFuiiiiiiiiiuup +#() vFuuuuuuuuuuuuu -> vFuuuuuuuuuuuuu +#() vFuUuuuuuuuuuuu -> vFuUuuuuuuuuuuu +#() vFuffffffffffff -> vFuffffffffffff +#() vFXiLLLiiiiiiuu -> vFXiLLLiiiiiiuu +#() iFEXLLlliLppppp -> iFEXLLlliLppppp +#() iFiuuuuiiuuuuuu -> iFiuuuuiiuuuuuu +#() iFddddpppddpppp -> iFddddpppddpppp +#() iFXippuuuiipppp -> iFXippuuuiipppp +#() uFippuuuulllipp -> uFippuuuulllipp +#() LFEXLiiuuuiupLp -> LFEXLiiuuuiupLp +#() iFXLLlliiLBL_pBL_BL_Bp_ -> iFXLLlliiLBpBBB +#() vFuffiiffiiffiip -> vFuffiiffiiffiip +#() vFuddiiddiiddiip -> vFuddiiddiiddiip +#() vFuiiiiiuiiiiilll -> vFuiiiiiuiiiiilll +#() vFuuiiiiuuiiiiiii -> vFuuiiiiuuiiiiiii +#() vFfffffffffffffff -> vFfffffffffffffff +#() iFpppppppppppppppp -> iFpppppppppppppppp +#() pFEppnCuuwwWWWWuup -> pFEppnCuuwwWWWWuup +#() vFuuuuiiiiuuiiiiiii -> vFuuuuiiiiuuiiiiiii +#() vFXpuiiiiipuiiiiiiii -> vFXpuiiiiipuiiiiiiii +#() uFippuuuuiiiiuuiiiiiiiipp -> uFippuuuuiiiiuuiiiiiiiipp +#defined(HAVE_LD80BITS) DED -> DED +#defined(HAVE_LD80BITS) DFDi -> DFDi +#defined(HAVE_LD80BITS) DEDD -> DEDD +#defined(HAVE_LD80BITS) DFDp -> DFDp +#defined(HAVE_LD80BITS) DEDp -> DEDp +#defined(HAVE_LD80BITS) DEpBp_a -> DEpBa +#!defined(HAVE_LD80BITS) KEK -> KEK +#!defined(HAVE_LD80BITS) KFKi -> KFKi +#!defined(HAVE_LD80BITS) KEKK -> KEKK +#!defined(HAVE_LD80BITS) KFKp -> KFKp +#!defined(HAVE_LD80BITS) KEKp -> KEKp +#!defined(HAVE_LD80BITS) KEpBp_a -> KEpBa +#defined(WINLATOR_GLIBC) pEipi -> pEipi +#!defined(WINLATOR_GLIBC) pEEipi -> pEEipi +#() UEsvvs -> UEss +wrappedblkid: +wrappedcairo: +- pFp: + - cairo_ft_scaled_font_lock_face + - cairo_xcb_device_get_connection +- uFpppp: + - cairo_pattern_set_user_data + - cairo_set_user_data + - cairo_surface_set_user_data +- pFppdd: + - cairo_pdf_surface_create_for_stream +- pFXLpii: + - cairo_xlib_surface_create + - cairo_xlib_surface_create_for_bitmap +wrappedcrashhandler: +wrappedcurl: +- iFpup: + - curl_multi_setopt +- uFpup: + - curl_easy_setopt + - curl_share_setopt +- iFlppppp: + - curl_global_init_mem +wrappeddbus: +- vFp: + - dbus_free_string_array +- vFppp: + - dbus_connection_remove_filter + - dbus_timeout_set_data + - dbus_watch_set_data +- uFpip: +- uFpiV: + - dbus_message_append_args +- uFbppuiiiiiiiiipp_ip: + - dbus_message_iter_append_basic +- vFpppp: + - dbus_connection_set_dispatch_status_function + - dbus_connection_set_wakeup_main_function +- uFpipp: + - dbus_connection_set_data +- uFpppp: + - dbus_connection_add_filter + - dbus_pending_call_set_notify +- uFpbppuuuuup_ip: +- uFpbppuuuuup_iV: + - dbus_message_get_args +- uFppppbppuuuuup_: + - dbus_connection_try_register_object_path +- uFpppppp: + - dbus_connection_set_timeout_functions + - dbus_connection_set_watch_functions +wrappedexpat: +- vFpp: + - XML_SetCharacterDataHandler +- vFppp: + - XML_SetDoctypeDeclHandler + - XML_SetElementHandler +- uFpii: + - XML_ParseBuffer +wrappedfontconfig: +- vFp: + - FcFontSetDestroy +- pFv: + - FcFontSetCreate +- pFp: + - FcCacheCopySet +- iFpp: + - FcFontSetAdd +- uFpu: + - FcFreeTypeCharIndex +- pFpu: + - FcConfigGetFonts +- pFpp: +- pFpV: + - FcObjectSetBuild + - FcPatternBuild +- pFppp: + - FcFontList +- iFppiUi: + - FcPatternAdd +- pFppibp_p: + - FcFontSort +- pFppipipp: + - FcFontSetSort +wrappedfreetype: +- vFp: + - FT_Done_Glyph +- iFp: + - FT_Activate_Size + - FT_Done_Face + - FT_Done_Size + - FT_GlyphSlot_Own_Bitmap + - FT_Has_PS_Glyph_Names + - FT_Reference_Face +- WFp: + - FT_Get_FSType_Flags +- uFp: + - FT_Get_Sfnt_Name_Count +- pFp: + - FT_Get_Postscript_Name + - FT_Get_X11_Font_Format +- vFpp: + - FT_Matrix_Multiply + - FT_Outline_Get_CBox + - FT_Outline_Transform +- iFpi: + - FT_Select_Charmap + - FT_Select_Size +- iFpu: + - FT_Render_Glyph +- iFpl: + - FT_Outline_Embolden +- iFpp: + - FT_Done_MM_Var + - FT_Get_Glyph + - FT_Get_MM_Var + - FT_Get_PS_Font_Info + - FT_Get_WinFNT_Header + - FT_New_Size + - FT_Outline_Copy + - FT_Outline_Done + - FT_Request_Size + - FT_Set_Charmap +- uFpL: + - FT_Get_Char_Index +- uFpp: + - FT_Get_Name_Index +- LFpp: + - FT_Get_First_Char +- pFpi: + - FT_Get_Sfnt_Table +- iFpBp_: + - FT_Glyph_Copy +- vFpll: + - FT_Outline_Translate +- vFppp: + - FT_Set_Transform +- iFpip: + - FT_Get_Sfnt_Name +- iFpui: + - FT_Load_Glyph +- iFpuu: + - FT_Set_Pixel_Sizes +- iFpup: + - FT_Get_Var_Blend_Coordinates + - FT_Set_Var_Blend_Coordinates + - FT_Set_Var_Design_Coordinates +- iFpll: + - FT_Outline_EmboldenXY +- iFpLi: + - FT_Load_Char +- iFppp: + - FT_Get_BDF_Property + - FT_Outline_Decompose + - FT_Outline_Get_Bitmap +- uFpLL: + - FT_Face_GetCharVariantIndex +- LFpLp: + - FT_Get_Next_Char +- vFpuBLLLL_: + - FT_Glyph_Get_CBox +- iFprllll_rll_: + - FT_Glyph_Transform +- iFpiup: + - FT_Get_Advance +- iFpuip: + - FT_Outline_New +- iFpupu: + - FT_Get_Glyph_Name +- iFpplp: + - FT_New_Face + - FT_Open_Face +- iFpuuip: + - FT_Get_Advances +- iFpuuup: + - FT_Get_Kerning +- iFplluu: + - FT_Set_Char_Size +- iFpLlpp: + - FT_Load_Sfnt_Table +- iFppllp: + - FT_New_Memory_Face +wrappedgbm: +% z my_gbm_bo_handle_t U +- zFpp: +- vFppp: + - gbm_bo_set_user_data +% zFEpp -> pFEppp +wrappedgnutls: +- vFp: + - gnutls_global_set_log_function +- vFpp: + - gnutls_transport_set_pull_function + - gnutls_transport_set_pull_timeout_function + - gnutls_transport_set_push_function +- pFpp: + - gnutls_certificate_get_peers +- iFppppppppu: + - gnutls_pkcs12_simple_parse +wrappedldlinux: +- pFv: + - ___tls_get_addr +- pFp: + - __tls_get_addr +wrappedlibasound: +- iFp: + - snd_device_name_free_hint +- iFipp: + - snd_device_name_hint +- iFpppp: + - snd_pcm_mmap_begin +wrappedlibc: +- vEv: +- vFi: + - exit +- vEp: + - __libc_free + - freeaddrinfo + - regfree +- vFp: + - _ZGTtdlPv +- iEv: +- iEi: + - __close_nocancel +- iEL: +- iEp: + - shmdt + - sysinfo +- iEO: +- IEp: + - __time64 +- uEp: +- uES: + - getwc +- UEp: +- lEi: + - __sysconf + - sysconf +- lEp: + - atol +- lES: + - ftell +- LEL: +- LEp: + - __mktime64 +- pEv: + - __ctype_b_loc + - __ctype_tolower_loc + - __ctype_toupper_loc + - __errno_location + - __res_state + - getpwent + - localeconv +- pFv: + - __h_errno_location +- pEu: + - getpwuid +- pFu: + - _ZGTtnaj +- pEL: + - __libc_malloc + - __libc_pvalloc + - __libc_valloc +- pFL: + - _ZGTtnaX + - _ZGTtnam +- pEp: + - __ctime64 + - __gmtime64 + - __localtime64 + - getgrnam + - getprotobyname + - getpwnam + - gmtime + - localtime +- pFp: + - gethostbyname +- pES: + - getmntent +- tEp: + - __secure_getenv +- iEbp_: + - getifaddrs +- pErl_: + - ctime +- lEriiiiiiiiilt_: +- pEriiiiiiiiilt_: + - asctime +- vEip: +- vEpi: + - _obstack_newchunk +- vEpu: +- vEpp: +- iEip: + - __futimens64 + - fstatvfs + - fstatvfs64 + - futimens + - futimes +- iFip: + - __fstat64_time64 +- iEup: + - getrlimit + - setrlimit +- iEpi: + - backtrace +- iEpL: +- iEpp: + - __gettimeofday64 + - __lstat64_time64 + - __nanosleep64 + - __stat64_time64 + - alphasort64 + - statvfs + - statvfs64 + - utimes +- iEpV: + - execl + - execlp +- IEII: +- UEUU: +- KFKi: + - ldexpl +- KFKp: + - frexpl +- lEuV: +- pEip: + - signal +- pELL: + - __libc_calloc + - __libc_memalign + - aligned_alloc +- pEpi: + - backtrace_symbols +- pEpL: + - __libc_realloc +- pEpp: + - __cmsg_nxthdr + - __gmtime_r + - getservbyname + - gmtime_r + - localtime_r +- SEpp: +- iErLL_BLL_: +- iEiBUUUULLLLLLLLLLLLLL_: + - __getrusage64 +- vEipp: + - vsyslog +- vEipV: + - syslog +- vEpuu: +- vEpup: + - _ITM_addUserCommitAction +- vEppu: +- iEiip: +- iEiiN: + - __fcntl_time64 +- iEiLp: + - __ioctl_time64 + - ioctl +- iEipp: +- iEipV: +- iEpii: +- iEpLi: +- iEppi: + - regcomp +- iEppp: + - __isoc23_vsscanf + - vswscanf +- iEppV: + - __isoc23_sscanf + - swscanf +- iEpON: +- iESpp: +- iESpV: + - __isoc23_fscanf + - __isoc99_fscanf + - fscanf +- lEipi: + - __recvmsg64 + - __sendmsg64 + - readv + - recvmsg + - sendmsg + - writev +- lEipL: + - write +- lEppL: +- pEipi: + - shmat +- pEpii: +- pEpip: + - fts_open +- pEpII: +- pFpui: + - gethostbyaddr +- pEpLL: +- pEppi: + - __realpath_chk +- IEpBp_i: + - __isoc23_strtoll +- UEpBp_i: + - __isoc23_strtoull +- KEpBp_a: + - __strtold_l + - strtold_l +- lEpBp_i: + - __isoc23_strtol + - __isoc23_wcstol + - wcstol +- LEpBp_i: + - __isoc23_strtoul + - wcstoul +- vEiipp: + - __vsyslog_chk +- vEiipV: + - __syslog_chk +- vEpLLp: +- vEppiV: +- iEiiip: +- iEiipV: +- iEipii: +- iEipuu: + - sendmmsg +- iEipup: + - __xmknod +- iEippi: + - __fstatat64_time64 + - fstatat + - fstatat64 + - utimensat +- iEippL: + - readlinkat +- iEuupi: + - waitid +- iEpipp: +- iEpipV: +- iEpuiL: +- iEpLpp: +- iEpLpV: +- iEppii: +- iEpppp: + - getaddrinfo +- iESipp: +- iESipV: +- uEippu: + - regerror +- IEpBp_ia: + - __isoc23_strtoll_l +- UEpBp_ia: + - __isoc23_strtoull_l +- LEpBp_ii: +- iEiiipu: + - __setsockopt64 +- iEiiipp: + - __getsockopt64 +- iEiippi: +- iEiLLLL: + - __prctl_time64 + - prctl +- iEipiup: + - statx +- iEippup: + - getprotobynumber_r +- iEipppp: + - __select64 + - getopt_long +- iEuppLp: + - getgrgid_r + - getpwuid_r +- iEpiipi: + - res_query + - res_search +- iEpiipV: +- iEpiLpp: +- iEpipOi: +- iEppupi: + - regexec +- iEpppup: + - getprotobyname_r +- iEpppLp: + - getgrnam_r + - getpwnam_r +- pEpLLiN: +- pEppLLp: +- pEppbL_Lp: +- iEipuurLL_: + - recvmmsg +- iEpLiipp: +- iEpLiipV: +- iEpLiLpV: +- iFpppupp: + - gethostbyname_r +- iEpppppp: +- lEipLpLL: + - process_vm_readv + - process_vm_writev +- pEpLiiiI: +- pEpLiiil: +- iFpippupp: + - gethostbyname2_r +- iEpippppp: +- iEpLiLppp: +- iFpuippupp: + - gethostbyaddr_r +wrappedlibcups: +- iFp: + - cupsGetDests +- vFip: + - cupsFreeDests +- pFpip: + - cupsGetOption +wrappedlibdl: +- iEp: + - dlclose +- pEv: + - dlerror +- iEpp: + - _dl_find_object + - dladdr +- pEpi: + - dlopen +- pEpp: + - dlsym +- iEpip: + - dlinfo +- pEppi: + - dlmopen +- pEppp: + - dlvsym +- iEpppi: + - dladdr1 +wrappedlibdrm: +- vFp: + - drmFreeVersion + - drmModeFreeConnector + - drmModeFreeResources +- pFi: + - drmGetVersion + - drmModeGetResources +- iFip: + - drmHandleEvent +- pFiu: + - drmModeGetConnector + - drmModeGetConnectorCurrent +wrappedlibegl: +- pFp: + - eglGetProcAddress +wrappedlibgl: +- iFi: + - glXSwapIntervalMESA +- pFp: + - glGetVkProcAddrNV + - glXGetProcAddress + - glXGetProcAddressARB +- vFip: + - glVDPAUMapSurfacesNV + - glVDPAUUnmapSurfacesNV +- vFpp: + - glDebugMessageCallback + - glDebugMessageCallbackAMD + - glDebugMessageCallbackARB + - glDebugMessageCallbackKHR +- iFpp: + - eglDebugMessageControlKHR +- pFXp: + - glXGetFBConfigFromVisualSGIX + - glXGetVisualFromFBConfig + - glXGetVisualFromFBConfigSGIX +- vFipp: + - glProgramCallbackMESA +- vFppp: + - eglSetBlobCacheFuncsANDROID +- vFXpi: + - glXSwapIntervalEXT +- uFuip: + - glCreateShaderProgramv +- pFXip: + - glXChooseVisual + - glXGetFBConfigs +- vFuipu: + - glTransformFeedbackVaryings + - glTransformFeedbackVaryingsEXT +- vFuipp: + - glCompileShaderIncludeARB + - glGetUniformIndices + - glShaderSource + - glShaderSourceARB +- pFXipp: + - glXChooseFBConfig + - glXChooseFBConfigSGIX +- pFXppi: + - glXCreateContext +- vFuippp: + - glBindVertexBuffers +- vFupupi: + - glMultiDrawElements + - glMultiDrawElementsEXT +- vFuuippp: + - glBindBuffersRange + - glVertexArrayVertexBuffers +- vFupupip: + - glMultiDrawElementsBaseVertex +- vFppupui: + - glMultiModeDrawElementsIBM +wrappedlibglu: +- vFpup: + - gluNurbsCallback + - gluQuadricCallback + - gluTessCallback +wrappedlibglx: +- pFp: + - glXGetProcAddress + - glXGetProcAddressARB +- pFXp: + - glXGetVisualFromFBConfig +- pFXip: + - glXChooseVisual + - glXGetFBConfigs +- pFXipp: + - glXChooseFBConfig +- pFXppi: + - glXCreateContext +wrappedlibglxnvidia: +- iFi: + - glXSwapIntervalMESA +- pFp: + - glGetVkProcAddrNV + - glXGetProcAddress + - glXGetProcAddressARB +- vFip: + - glVDPAUMapSurfacesNV + - glVDPAUUnmapSurfacesNV +- vFpp: + - glDebugMessageCallback + - glDebugMessageCallbackAMD + - glDebugMessageCallbackARB + - glDebugMessageCallbackKHR +- iFpp: + - eglDebugMessageControlKHR +- pFXp: + - glXGetFBConfigFromVisualSGIX + - glXGetVisualFromFBConfig + - glXGetVisualFromFBConfigSGIX +- vFipp: + - glProgramCallbackMESA +- vFppp: + - eglSetBlobCacheFuncsANDROID +- vFXpi: + - glXSwapIntervalEXT +- uFuip: + - glCreateShaderProgramv +- pFXip: + - glXChooseVisual + - glXGetFBConfigs +- vFuipu: + - glTransformFeedbackVaryings + - glTransformFeedbackVaryingsEXT +- vFuipp: + - glCompileShaderIncludeARB + - glGetUniformIndices + - glShaderSource + - glShaderSourceARB +- pFXipp: + - glXChooseFBConfig + - glXChooseFBConfigSGIX +- pFXppi: + - glXCreateContext +- vFuippp: + - glBindVertexBuffers +- vFupupi: + - glMultiDrawElements + - glMultiDrawElementsEXT +- vFuuippp: + - glBindBuffersRange + - glVertexArrayVertexBuffers +- vFupupip: + - glMultiDrawElementsBaseVertex +- vFppupui: + - glMultiModeDrawElementsIBM +wrappedlibm: +- UEs: + - cacosf + - cacoshf + - casinf + - casinhf + - catanf + - catanhf + - ccosf + - ccoshf + - cexpf + - clogf + - cprojf + - csinf + - csinhf + - csqrtf + - ctanf + - ctanhf +- fEf: + - __acosf_finite + - __acoshf_finite + - __asinf_finite + - __coshf_finite + - __exp2f_finite + - __expf_finite + - __log10f_finite + - __log2f_finite + - __logf_finite + - __sinhf_finite + - __sqrtf_finite +- dEd: + - __acos_finite + - __acosh_finite + - __asin_finite + - __cosh_finite + - __exp2_finite + - __exp_finite + - __log10_finite + - __log2_finite + - __log_finite + - __sinh_finite + - __sqrt_finite +- DED: + - pow10l +- KEK: + - acoshl + - acosl + - asinhl + - asinl + - atanhl + - cbrtl + - erfcl + - erfl + - ldexpl + - lgammal + - logl + - pow10l + - tgammal +- fEff: + - __atan2f_finite + - __hypotf_finite + - __powf_finite +- dEdd: + - __atan2_finite + - __hypot_finite + - __pow_finite +- KEKK: + - fmodl + - powl +- KEKp: + - frexpl + - lgammal_r +- UEsvvs: + - cpowf +wrappedlibpthread: +- vEv: + - __pthread_initialize +- vEp: + - __pthread_register_cancel + - __pthread_unregister_cancel + - __pthread_unwind_next +- iEv: + - pthread_yield +- iEp: + - __pthread_mutex_destroy + - __pthread_mutex_lock + - __pthread_mutex_trylock + - __pthread_mutex_unlock + - __pthread_mutexattr_init + - pthread_attr_destroy + - pthread_attr_init + - pthread_cond_broadcast + - pthread_cond_broadcast@GLIBC_2.0 + - pthread_cond_destroy + - pthread_cond_destroy@GLIBC_2.0 + - pthread_cond_signal + - pthread_cond_signal@GLIBC_2.0 + - pthread_mutex_destroy + - pthread_mutex_lock + - pthread_mutex_trylock + - pthread_mutex_unlock + - pthread_mutexattr_init + - pthread_rwlock_destroy + - pthread_rwlock_unlock + - pthread_rwlock_wrlock + - sem_close + - sem_destroy + - sem_post + - sem_trywait + - sem_wait +- iEh: + - pthread_detach +- vEpi: + - _pthread_cleanup_pop + - _pthread_cleanup_pop_restore +- iEpi: + - pthread_attr_setdetachstate + - pthread_attr_setinheritsched + - pthread_attr_setschedpolicy + - pthread_attr_setscope + - pthread_mutexattr_setkind_np +- iEpL: + - pthread_attr_setguardsize + - pthread_attr_setstacksize +- iEpp: + - __pthread_key_create + - __pthread_mutex_init + - __pthread_once + - __pthread_rwlock_init + - pthread_attr_getdetachstate + - pthread_attr_getguardsize + - pthread_attr_getinheritsched + - pthread_attr_getschedparam + - pthread_attr_getschedpolicy + - pthread_attr_getscope + - pthread_attr_getstackaddr + - pthread_attr_getstacksize + - pthread_attr_setschedparam + - pthread_attr_setstackaddr + - pthread_cond_init + - pthread_cond_init@GLIBC_2.0 + - pthread_cond_wait + - pthread_cond_wait@GLIBC_2.0 + - pthread_key_create + - pthread_mutex_init + - pthread_mutex_timedlock + - pthread_once + - pthread_rwlock_init + - sem_getvalue +- iEhi: + - pthread_kill + - pthread_kill@GLIBC_2.0 +- iEhp: + - pthread_getattr_np +- iEprLL_: + - sem_timedwait +- vEppp: + - _pthread_cleanup_push + - _pthread_cleanup_push_defer +- iEpiu: + - sem_init +- iEpup: + - pthread_attr_setaffinity_np +- iEppL: + - pthread_attr_setstack +- iEppp: + - __pthread_atfork + - pthread_atfork + - pthread_attr_getstack +- iEhup: + - pthread_getaffinity_np + - pthread_setaffinity_np +- pEpOM: + - sem_open +- iEpprLL_: + - pthread_cond_timedwait + - pthread_cond_timedwait@GLIBC_2.0 +- iEBh_ppp: + - pthread_create +wrappedlibresolv: +- iFpip: + - ns_initparse +- iFpuip: + - ns_parserr +- iEpiipi: + - __res_query + - res_query + - res_search +- iFpiipi: + - __res_search +- iFppppi: + - __dn_expand +- iFppiipi: + - __res_nquery + - __res_nsearch +wrappedlibrt: +- iEup: + - __clock_getres64 + - __clock_gettime64 +- iEuBLL_: + - __clock_gettime +wrappedlibuuid: +wrappedlibvdpau: +- iFpipp: + - vdp_device_create_x11 +wrappedlibx11: +- vFp: + - XFreeStringList +- vFX: + - XLockDisplay +- iFp: + - XContextDependentDrawing + - XContextualDrawing + - XDestroyImage + - XDirectionalDependentDrawing + - XFreeExtensionList + - XFreeFontNames + - XFreeModifiermap + - XInitImage + - XRefreshKeyboardMapping + - XScreenNumberOfScreen + - _XInitImageFuncPtrs +- iEp: + - XkbRefreshKeyboardMapping +- iFX: + - XCloseDisplay + - XGrabServer +- LFp: + - XVisualIDFromVisual +- pFp: + - XBaseFontNameListOfFontSet + - XExtentsOfFontSet + - XLocaleOfFontSet + - XSetErrorHandler + - XSetIOErrorHandler +- pFX: + - XGetModifierMapping +- XFp: + - XOpenDisplay +- vFXp: + - XFreeEventData + - XFreeFontSet + - _XDeqAsyncHandler +- iFpL: + - XFilterEvent +- iFXp: + - XFreeFont + - XGetEventData + - XNextEvent + - XPeekEvent + - XPutBackEvent +- LFpi: + - XLookupKeysym +- pFiV: + - XVaCreateNestedList +- pFpV: + - XCreateIC + - XGetICValues + - XGetIMValues + - XSetICValues + - XSetIMValues +- pFXi: + - XSynchronize +- pFXL: + - XGetWMHints + - XQueryFont +- pFXp: + - XListExtensions + - XLoadQueryFont +- vFpui: + - XkbFreeKeyboard +- vFXLp: + - XSetWMNormalHints +- iFpip: + - XStringListToTextProperty +- iFppi: + - XFreeFontInfo + - XTextWidth + - XTextWidth16 + - XmbTextEscapement + - Xutf8TextEscapement + - XwcTextEscapement +- iFppp: + - XFontsOfFontSet +- iFXip: + - XCheckTypedEvent +- iFXup: + - XkbGetNames + - XkbGetUpdatedMap +- iFXlp: + - XCheckMaskEvent + - XMaskEvent +- iFXLp: + - XGetWindowAttributes + - XSetWMHints + - XkbGetControls +- iFXpp: + - XAddConnectionWatch +- LFXii: + - XGetPixel +- pFXip: + - XESetCloseDisplay + - XESetEventToWire + - XESetWireToEvent +- pFXCL: + - _XGetRequest +- pFXuu: + - XkbGetMap +- vFXLpL: + - XSetWMSizeHints +- iFXLip: + - XCheckTypedWindowEvent +- iFXLlp: + - XCheckWindowEvent + - XWindowEvent +- iFXLLp: + - XChangeWindowAttributes +- iFXLpi: + - XQueryColors + - XSetWMProtocols + - XStoreColors +- iFXLpp: + - XGetWMColormapWindows + - XGetWMNormalHints + - XGetWMProtocols +- iFXpii: + - _XReply +- iFXppp: + - XCheckIfEvent + - XIfEvent + - XPeekIfEvent +- LFXLpi: + - XCreateColormap +- pFXCip: + - XGetKeyboardMapping +- pFXlpp: + - XGetVisualInfo +- pFXpip: + - XListFonts +- iFXbpLiL_pp: + - XmbTextPropertyToTextList + - Xutf8TextPropertyToTextList + - XwcTextPropertyToTextList +- iFppipp: + - XLookupString + - XmbTextExtents + - Xutf8TextExtents + - XwcTextExtents +- iFXLilp: + - XSendEvent +- iFXLpiL: + - XFreeColors +- iFXpiip: + - XInternAtoms +- iFXpiup: + - XmbTextListToTextProperty + - Xutf8TextListToTextProperty + - XwcTextListToTextProperty +- iFXpppp: + - XQueryExtension +- pFpiiuu: + - XSubImage +- pFXLLLp: + - XGetMotionEvents +- pFXpppp: + - XCreateFontSet +- iFpppipp: + - XmbLookupString + - Xutf8LookupString + - XwcLookupString +- iFXLpppp: + - XQueryTree +- iFXppppp: + - XRegisterIMInstantiateCallback + - XUnregisterIMInstantiateCallback + - XkbQueryExtension +- vFXLpiipi: + - XmbDrawText + - Xutf8DrawText + - XwcDrawText +- iFppipppp: + - XTextExtents + - XTextExtents16 +- vFXLppiipi: + - XmbDrawImageString + - XmbDrawString + - Xutf8DrawImageString + - Xutf8DrawString + - XwcDrawImageString + - XwcDrawString +- iFXLLLiipi: + - XChangeProperty +- pFXLiiuuLi: + - XGetImage +- vFXLpppippp: + - XSetWMProperties + - XmbSetWMProperties + - Xutf8SetWMProperties +- iFppippippp: + - XmbTextPerCharExtents + - Xutf8TextPerCharExtents + - XwcTextPerCharExtents +- iFXLppiiiiuu: + - XPutImage +- pFXpuiipuuii: + - XCreateImage +- pFXLiiuuLipii: + - XGetSubImage +- iFXLLlliLppppp: + - XGetWindowProperty +- LFXLiiuuuiupLp: + - XCreateWindow +wrappedlibx11xcb: +- pFX: + - XGetXCBConnection +wrappedlibxcb: +% Z my_xcb_XXX_iterator_t pii +% z my_xcb_cookie_t u +- vFp: + - xcb_disconnect +- pFpp: + - xcb_connect +- ZFpp: +- zFnuu: +- zFnCWp: +- zFnCuuuuu: +- zFnCuuuCup: +- zFpnCuuwwWWWWuup: +% ZFEpp -> pFEppp +% zFEnuu -> pFEpnuu +% zFEnCWp -> pFEpnCWp +% zFEnCuuuuu -> pFEpnCuuuuu +% zFEnCuuuCup -> pFEpnCuuuCup +% zFEpnCuuwwWWWWuup -> pFEppnCuuwwWWWWuup +wrappedlibxcbres: +% Z my_xcb_XXX_iterator_t pii +% z my_xcb_cookie_t u +- ZFp: +- zFnup: +% ZFEp -> pFEpp +% zFEnup -> pFEpnup +wrappedlibxcomposite: +wrappedlibxcursor: +- vFp: + - XcursorCursorsDestroy + - XcursorImageDestroy + - XcursorImagesDestroy +- pFi: + - XcursorImagesCreate +- LFXp: + - XcursorImageLoadCursor + - XcursorImagesLoadCursor +- pFii: + - XcursorImageCreate +- pFXi: + - XcursorCursorsCreate +- pFXp: + - XcursorImagesLoadCursors +- pFupi: + - XcursorShapeLoadImages +- pFppi: + - XcursorLibraryLoadImages +wrappedlibxdamage: +wrappedlibxext: +- vFp: + - XdbeFreeVisualInfo + - XextDestroyExtension +- pFv: + - XextCreateExtension +- pFp: + - XSetExtensionErrorHandler +- iFpX: + - XextRemoveDisplay +- iFXp: + - XShmAttach + - XShmDetach +- pFpX: + - XextFindDisplay +- pFXpp: + - XdbeGetVisualInfo +- iFXLpiiL: + - XShmGetImage +- pFpXppip: + - XextAddDisplay +- LFXLppuuu: + - XShmCreatePixmap +- pFXbpLiLLLii_uippuu: + - XShmCreateImage +- iFXLppiiiiuui: + - XShmPutImage +wrappedlibxfixes: +- pFX: + - XFixesGetCursorImage +- iFXpp: + - XFixesQueryExtension +wrappedlibxi: +- vFp: + - XFreeDeviceList + - XFreeDeviceMotionEvents + - XFreeDeviceState + - XIFreeDeviceInfo +- iFXp: + - XCloseDevice +- pFXL: + - XOpenDevice +- pFXp: + - XListInputDevices + - XQueryDeviceState +- pFXip: + - XIQueryDevice +- pFXLp: + - XIGetSelectedEvents +- iFXLpi: + - XISelectEvents +- iFXppu: + - XGetDeviceButtonMapping +- pFXpLLppp: + - XGetDeviceMotionEvents +- iFXpLiipiiL: + - XGrabDevice +wrappedlibxrandr: +- vFp: + - XRRFreeMonitors + - XRRFreeProviderInfo + - XRRFreeProviderResources +- iFp: + - XRRUpdateConfiguration +- pFXL: + - XRRGetProviderResources + - XRRGetScreenResources + - XRRGetScreenResourcesCurrent +- iFXLp: + - XRRGetCrtcTransform +- iFXpp: + - XRRQueryExtension +- pFXLL: + - XRRQueryOutputProperty +- pFXLp: + - XRRListOutputProperties +- pFXpL: + - XRRGetCrtcInfo + - XRRGetOutputInfo + - XRRGetPanning + - XRRGetProviderInfo +- iFXpLp: + - XRRSetPanning +- pFXLip: + - XRRGetMonitors +- iFXpLLiiLWpi: + - XRRSetCrtcConfig +wrappedlibxrender: +- pFXi: + - XRenderFindStandardFormat +- pFXL: + - XRenderQueryFilters +- pFXp: + - XRenderFindVisualFormat +- pFXLrLiiwwwwwwwwL_i: + - XRenderFindFormat +wrappedlibxss: +wrappedlibxxf86vm: +- iFXipp: + - XF86VidModeGetAllModeLines +wrappedmount: +- pFi: + - mnt_get_builtin_optmap +- iFpip: + - mnt_table_uniq_fs +- iFpbL_p: + - mnt_optstr_get_flags +wrappednsl: +wrappedopenal: +- vFv: + - alRequestFoldbackStop +- pFp: + - alGetProcAddress +- pFpp: + - alcGetProcAddress +- vFiiipp: + - alRequestFoldbackStart +wrappedsdl1: +- vFv: + - SDL_Quit +- vFp: + - SDL_FreeSurface + - SDL_KillThread + - SDL_UnloadObject + - SDL_UnlockSurface +- iFv: + - SDL_Has3DNow + - SDL_Has3DNowExt + - SDL_HasAltiVec + - SDL_HasMMX + - SDL_HasMMXExt + - SDL_HasRDTSC + - SDL_HasSSE + - SDL_HasSSE2 +- iFp: + - SDL_ConvertAudio + - SDL_Flip + - SDL_LockSurface + - SDL_PollEvent + - SDL_PushEvent + - SDL_RemoveTimer +- uFp: + - SDL_ReadLE32 +- pFv: + - SDL_GetVideoInfo + - SDL_GetVideoSurface +- pFp: + - SDL_GL_GetProcAddress + - SDL_LoadObject +- vFpp: + - SDL_WM_SetIcon +- iFup: + - SDL_SetTimer +- iFpp: + - SDL_OpenAudio +- pFpi: + - SDL_LoadBMP_RW + - SDL_RWFromMem +- pFpu: + - SDL_ListModes +- pFpp: + - SDL_CreateThread + - SDL_LoadFunction + - SDL_RWFromFile +- iFpuu: + - SDL_SetColorKey +- pFupp: + - SDL_AddTimer +- iFpiuu: + - SDL_PeepEvents +- uFpCCC: + - SDL_MapRGB +- pFiiiu: + - SDL_SetVideoMode +- vFupppp: + - SDL_GetRGB +- iFpWCiWCi: + - SDL_BuildAudioCVT +- pFpiiiiuuuu: + - SDL_CreateRGBSurfaceFrom +wrappedsdl2: +% J SDL2_GUID_t uuuu +- vFp: + - SDL_FreeSurface +- iFv: + - SDL_GetCPUCount +- iFp: + - SDL_PollEvent + - SDL_PushEvent + - SDL_RWclose +- IFp: + - SDL_RWsize + - SDL_RWtell +- uFp: + - SDL_ReadBE16 + - SDL_ReadBE32 + - SDL_ReadLE16 + - SDL_ReadLE32 + - SDL_ReadU8 +- UFp: + - SDL_ReadBE64 + - SDL_ReadLE64 +- pFv: + - SDL_GetBasePath +- pFp: + - SDL_GL_GetProcAddress +- hFp: + - SDL_GetThreadID +- JFi: + - SDL_JoystickGetDeviceGUID +- JFp: + - SDL_JoystickGetGUIDFromString +- vFpp: + - SDL_AddEventWatch + - SDL_DelEventWatch + - SDL_SetEventFilter + - SDL_SetWindowIcon +- vFpV: + - SDL_Log +- iFip: + - SDL_GetCurrentDisplayMode + - SDL_GetDesktopDisplayMode +- iFpi: + - SDL_GameControllerAddMappingsFromRW + - SDL_WaitEventTimeout +- iFpp: + - SDL_GetWindowDisplayMode + - SDL_GetWindowWMInfo + - SDL_OpenAudio + - SDL_SetWindowDisplayMode + - SDL_ShowMessageBox +- uFpW: + - SDL_WriteBE16 + - SDL_WriteLE16 +- uFpu: + - SDL_WriteBE32 + - SDL_WriteLE32 + - SDL_WriteU8 +- uFpU: + - SDL_WriteBE64 + - SDL_WriteLE64 +- pFpi: + - SDL_LoadBMP_RW + - SDL_RWFromMem + - SDL_notreal +- pFpp: + - SDL_CreateTextureFromSurface + - SDL_RWFromFile +- iFiip: + - SDL_GetDisplayMode +- iFpiu: + - SDL_SetColorKey +- iFppu: + - SDL_FillRect +- iFppV: + - SDL_sscanf +- IFpIi: + - SDL_RWseek +- pFipp: + - SDL_GetClosestDisplayMode +- pFpii: + - SDL_CreateColorCursor +- pFpuu: + - SDL_ConvertSurfaceFormat +- pFppu: + - SDL_ConvertSurface +- pFppp: + - SDL_CreateThread +- iFpLpp: + - SDL_vsnprintf +- iFpLpV: + - SDL_snprintf +- LFppLL: + - SDL_RWread + - SDL_RWwrite +- iFpiuuu: + - SDL_PeepEvents +- uFpippi: + - SDL_OpenAudioDevice +- pFpiiiiu: + - SDL_CreateRGBSurfaceWithFormatFrom +- pFuiiiuuuu: + - SDL_CreateRGBSurface +- pFpiiiiuuuu: + - SDL_CreateRGBSurfaceFrom +% JFEi -> pFEpi +% JFEp -> pFEpp +wrappedsdl2image: +- pFp: + - IMG_Load + - IMG_LoadBMP_RW + - IMG_LoadCUR_RW + - IMG_LoadGIF_RW + - IMG_LoadICO_RW + - IMG_LoadJPG_RW + - IMG_LoadLBM_RW + - IMG_LoadPCX_RW + - IMG_LoadPNG_RW + - IMG_LoadPNM_RW + - IMG_LoadTGA_RW + - IMG_LoadTIF_RW + - IMG_LoadWEBP_RW + - IMG_LoadXCF_RW + - IMG_LoadXPM_RW + - IMG_LoadXV_RW +- pFpi: + - IMG_Load_RW +- pFpip: + - IMG_LoadTyped_RW +- pFppi: + - IMG_LoadTexture_RW +- pFppip: + - IMG_LoadTextureTyped_RW +wrappedselinux: +wrappedtcmallocminimal: +- pFp: +- iFpL: + - munmap +- pFpLiiii: + - mmap +- pFpLiiiI: + - mmap64 +wrappedudev0: +wrappedudev1: +- vFpp: + - udev_set_log_fn +wrappedxinerama: diff --git a/src/wrapped32/generated/wrappedblkiddefs32.h b/src/wrapped32/generated/wrappedblkiddefs32.h new file mode 100644 index 0000000..a9a9428 --- /dev/null +++ b/src/wrapped32/generated/wrappedblkiddefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedblkidDEFS32_H_ +#define __wrappedblkidDEFS32_H_ + + +#endif // __wrappedblkidDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedblkidtypes32.h b/src/wrapped32/generated/wrappedblkidtypes32.h new file mode 100644 index 0000000..c4f222d --- /dev/null +++ b/src/wrapped32/generated/wrappedblkidtypes32.h @@ -0,0 +1,17 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedblkidTYPES32_H_ +#define __wrappedblkidTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedblkidTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedblkidundefs32.h b/src/wrapped32/generated/wrappedblkidundefs32.h new file mode 100644 index 0000000..c189dde --- /dev/null +++ b/src/wrapped32/generated/wrappedblkidundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedblkidUNDEFS32_H_ +#define __wrappedblkidUNDEFS32_H_ + + +#endif // __wrappedblkidUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedcairodefs32.h b/src/wrapped32/generated/wrappedcairodefs32.h new file mode 100644 index 0000000..8435d20 --- /dev/null +++ b/src/wrapped32/generated/wrappedcairodefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedcairoDEFS32_H_ +#define __wrappedcairoDEFS32_H_ + + +#endif // __wrappedcairoDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedcairotypes32.h b/src/wrapped32/generated/wrappedcairotypes32.h new file mode 100644 index 0000000..47999c1 --- /dev/null +++ b/src/wrapped32/generated/wrappedcairotypes32.h @@ -0,0 +1,29 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedcairoTYPES32_H_ +#define __wrappedcairoTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void* (*pFp_t)(void*); +typedef uint32_t (*uFpppp_t)(void*, void*, void*, void*); +typedef void* (*pFppdd_t)(void*, void*, double, double); +typedef void* (*pFXLpii_t)(void*, uintptr_t, void*, int32_t, int32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(cairo_ft_scaled_font_lock_face, pFp_t) \ + GO(cairo_xcb_device_get_connection, pFp_t) \ + GO(cairo_pattern_set_user_data, uFpppp_t) \ + GO(cairo_set_user_data, uFpppp_t) \ + GO(cairo_surface_set_user_data, uFpppp_t) \ + GO(cairo_pdf_surface_create_for_stream, pFppdd_t) \ + GO(cairo_xlib_surface_create, pFXLpii_t) \ + GO(cairo_xlib_surface_create_for_bitmap, pFXLpii_t) + +#endif // __wrappedcairoTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedcairoundefs32.h b/src/wrapped32/generated/wrappedcairoundefs32.h new file mode 100644 index 0000000..79d6164 --- /dev/null +++ b/src/wrapped32/generated/wrappedcairoundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedcairoUNDEFS32_H_ +#define __wrappedcairoUNDEFS32_H_ + + +#endif // __wrappedcairoUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedcrashhandlerdefs32.h b/src/wrapped32/generated/wrappedcrashhandlerdefs32.h new file mode 100644 index 0000000..120becb --- /dev/null +++ b/src/wrapped32/generated/wrappedcrashhandlerdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedcrashhandlerDEFS32_H_ +#define __wrappedcrashhandlerDEFS32_H_ + + +#endif // __wrappedcrashhandlerDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedcrashhandlertypes32.h b/src/wrapped32/generated/wrappedcrashhandlertypes32.h new file mode 100644 index 0000000..905288e --- /dev/null +++ b/src/wrapped32/generated/wrappedcrashhandlertypes32.h @@ -0,0 +1,17 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedcrashhandlerTYPES32_H_ +#define __wrappedcrashhandlerTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedcrashhandlerTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedcrashhandlerundefs32.h b/src/wrapped32/generated/wrappedcrashhandlerundefs32.h new file mode 100644 index 0000000..8e12284 --- /dev/null +++ b/src/wrapped32/generated/wrappedcrashhandlerundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedcrashhandlerUNDEFS32_H_ +#define __wrappedcrashhandlerUNDEFS32_H_ + + +#endif // __wrappedcrashhandlerUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedcurldefs32.h b/src/wrapped32/generated/wrappedcurldefs32.h new file mode 100644 index 0000000..c154a87 --- /dev/null +++ b/src/wrapped32/generated/wrappedcurldefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedcurlDEFS32_H_ +#define __wrappedcurlDEFS32_H_ + + +#endif // __wrappedcurlDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedcurltypes32.h b/src/wrapped32/generated/wrappedcurltypes32.h new file mode 100644 index 0000000..0633c46 --- /dev/null +++ b/src/wrapped32/generated/wrappedcurltypes32.h @@ -0,0 +1,24 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedcurlTYPES32_H_ +#define __wrappedcurlTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef int32_t (*iFpup_t)(void*, uint32_t, void*); +typedef uint32_t (*uFpup_t)(void*, uint32_t, void*); +typedef int32_t (*iFlppppp_t)(intptr_t, void*, void*, void*, void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(curl_multi_setopt, iFpup_t) \ + GO(curl_easy_setopt, uFpup_t) \ + GO(curl_share_setopt, uFpup_t) \ + GO(curl_global_init_mem, iFlppppp_t) + +#endif // __wrappedcurlTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedcurlundefs32.h b/src/wrapped32/generated/wrappedcurlundefs32.h new file mode 100644 index 0000000..fa5e4d1 --- /dev/null +++ b/src/wrapped32/generated/wrappedcurlundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedcurlUNDEFS32_H_ +#define __wrappedcurlUNDEFS32_H_ + + +#endif // __wrappedcurlUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappeddbusdefs32.h b/src/wrapped32/generated/wrappeddbusdefs32.h new file mode 100644 index 0000000..8fab3f3 --- /dev/null +++ b/src/wrapped32/generated/wrappeddbusdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappeddbusDEFS32_H_ +#define __wrappeddbusDEFS32_H_ + + +#endif // __wrappeddbusDEFS32_H_ diff --git a/src/wrapped32/generated/wrappeddbustypes32.h b/src/wrapped32/generated/wrappeddbustypes32.h new file mode 100644 index 0000000..a0cc2a7 --- /dev/null +++ b/src/wrapped32/generated/wrappeddbustypes32.h @@ -0,0 +1,44 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappeddbusTYPES32_H_ +#define __wrappeddbusTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFp_t)(void*); +typedef void (*vFppp_t)(void*, void*, void*); +typedef uint32_t (*uFpip_t)(void*, int32_t, void*); +typedef uint32_t (*uFpiV_t)(void*, int32_t, ...); +typedef uint32_t (*uFbppuiiiiiiiiipp_ip_t)(struct_ppuiiiiiiiiipp_t*, int32_t, void*); +typedef void (*vFpppp_t)(void*, void*, void*, void*); +typedef uint32_t (*uFpipp_t)(void*, int32_t, void*, void*); +typedef uint32_t (*uFpppp_t)(void*, void*, void*, void*); +typedef uint32_t (*uFpbppuuuuup_ip_t)(void*, struct_ppuuuuup_t*, int32_t, void*); +typedef uint32_t (*uFpbppuuuuup_iV_t)(void*, struct_ppuuuuup_t*, int32_t, ...); +typedef uint32_t (*uFppppbppuuuuup__t)(void*, void*, void*, void*, struct_ppuuuuup_t*); +typedef uint32_t (*uFpppppp_t)(void*, void*, void*, void*, void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(dbus_free_string_array, vFp_t) \ + GO(dbus_connection_remove_filter, vFppp_t) \ + GO(dbus_timeout_set_data, vFppp_t) \ + GO(dbus_watch_set_data, vFppp_t) \ + GO(dbus_message_append_args, uFpiV_t) \ + GO(dbus_message_iter_append_basic, uFbppuiiiiiiiiipp_ip_t) \ + GO(dbus_connection_set_dispatch_status_function, vFpppp_t) \ + GO(dbus_connection_set_wakeup_main_function, vFpppp_t) \ + GO(dbus_connection_set_data, uFpipp_t) \ + GO(dbus_connection_add_filter, uFpppp_t) \ + GO(dbus_pending_call_set_notify, uFpppp_t) \ + GO(dbus_message_get_args, uFpbppuuuuup_iV_t) \ + GO(dbus_connection_try_register_object_path, uFppppbppuuuuup__t) \ + GO(dbus_connection_set_timeout_functions, uFpppppp_t) \ + GO(dbus_connection_set_watch_functions, uFpppppp_t) + +#endif // __wrappeddbusTYPES32_H_ diff --git a/src/wrapped32/generated/wrappeddbusundefs32.h b/src/wrapped32/generated/wrappeddbusundefs32.h new file mode 100644 index 0000000..1edc9c9 --- /dev/null +++ b/src/wrapped32/generated/wrappeddbusundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappeddbusUNDEFS32_H_ +#define __wrappeddbusUNDEFS32_H_ + + +#endif // __wrappeddbusUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedexpatdefs32.h b/src/wrapped32/generated/wrappedexpatdefs32.h new file mode 100644 index 0000000..af198fb --- /dev/null +++ b/src/wrapped32/generated/wrappedexpatdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedexpatDEFS32_H_ +#define __wrappedexpatDEFS32_H_ + + +#endif // __wrappedexpatDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedexpattypes32.h b/src/wrapped32/generated/wrappedexpattypes32.h new file mode 100644 index 0000000..df0307a --- /dev/null +++ b/src/wrapped32/generated/wrappedexpattypes32.h @@ -0,0 +1,24 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedexpatTYPES32_H_ +#define __wrappedexpatTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFpp_t)(void*, void*); +typedef void (*vFppp_t)(void*, void*, void*); +typedef uint32_t (*uFpii_t)(void*, int32_t, int32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(XML_SetCharacterDataHandler, vFpp_t) \ + GO(XML_SetDoctypeDeclHandler, vFppp_t) \ + GO(XML_SetElementHandler, vFppp_t) \ + GO(XML_ParseBuffer, uFpii_t) + +#endif // __wrappedexpatTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedexpatundefs32.h b/src/wrapped32/generated/wrappedexpatundefs32.h new file mode 100644 index 0000000..71e08a0 --- /dev/null +++ b/src/wrapped32/generated/wrappedexpatundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedexpatUNDEFS32_H_ +#define __wrappedexpatUNDEFS32_H_ + + +#endif // __wrappedexpatUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedfontconfigdefs32.h b/src/wrapped32/generated/wrappedfontconfigdefs32.h new file mode 100644 index 0000000..170be55 --- /dev/null +++ b/src/wrapped32/generated/wrappedfontconfigdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedfontconfigDEFS32_H_ +#define __wrappedfontconfigDEFS32_H_ + + +#endif // __wrappedfontconfigDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedfontconfigtypes32.h b/src/wrapped32/generated/wrappedfontconfigtypes32.h new file mode 100644 index 0000000..50cff09 --- /dev/null +++ b/src/wrapped32/generated/wrappedfontconfigtypes32.h @@ -0,0 +1,41 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedfontconfigTYPES32_H_ +#define __wrappedfontconfigTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFp_t)(void*); +typedef void* (*pFv_t)(void); +typedef void* (*pFp_t)(void*); +typedef int32_t (*iFpp_t)(void*, void*); +typedef uint32_t (*uFpu_t)(void*, uint32_t); +typedef void* (*pFpu_t)(void*, uint32_t); +typedef void* (*pFpp_t)(void*, void*); +typedef void* (*pFpV_t)(void*, ...); +typedef void* (*pFppp_t)(void*, void*, void*); +typedef int32_t (*iFppiUi_t)(void*, void*, int32_t, uint64_t, int32_t); +typedef void* (*pFppibp_p_t)(void*, void*, int32_t, struct_p_t*, void*); +typedef void* (*pFppipipp_t)(void*, void*, int32_t, void*, int32_t, void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(FcFontSetDestroy, vFp_t) \ + GO(FcFontSetCreate, pFv_t) \ + GO(FcCacheCopySet, pFp_t) \ + GO(FcFontSetAdd, iFpp_t) \ + GO(FcFreeTypeCharIndex, uFpu_t) \ + GO(FcConfigGetFonts, pFpu_t) \ + GO(FcObjectSetBuild, pFpV_t) \ + GO(FcPatternBuild, pFpV_t) \ + GO(FcFontList, pFppp_t) \ + GO(FcPatternAdd, iFppiUi_t) \ + GO(FcFontSort, pFppibp_p_t) \ + GO(FcFontSetSort, pFppipipp_t) + +#endif // __wrappedfontconfigTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedfontconfigundefs32.h b/src/wrapped32/generated/wrappedfontconfigundefs32.h new file mode 100644 index 0000000..52ed712 --- /dev/null +++ b/src/wrapped32/generated/wrappedfontconfigundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedfontconfigUNDEFS32_H_ +#define __wrappedfontconfigUNDEFS32_H_ + + +#endif // __wrappedfontconfigUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedfreetypedefs32.h b/src/wrapped32/generated/wrappedfreetypedefs32.h new file mode 100644 index 0000000..8951041 --- /dev/null +++ b/src/wrapped32/generated/wrappedfreetypedefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedfreetypeDEFS32_H_ +#define __wrappedfreetypeDEFS32_H_ + + +#endif // __wrappedfreetypeDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedfreetypetypes32.h b/src/wrapped32/generated/wrappedfreetypetypes32.h new file mode 100644 index 0000000..d6a7c25 --- /dev/null +++ b/src/wrapped32/generated/wrappedfreetypetypes32.h @@ -0,0 +1,114 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedfreetypeTYPES32_H_ +#define __wrappedfreetypeTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFp_t)(void*); +typedef int32_t (*iFp_t)(void*); +typedef uint16_t (*WFp_t)(void*); +typedef uint32_t (*uFp_t)(void*); +typedef void* (*pFp_t)(void*); +typedef void (*vFpp_t)(void*, void*); +typedef int32_t (*iFpi_t)(void*, int32_t); +typedef int32_t (*iFpu_t)(void*, uint32_t); +typedef int32_t (*iFpl_t)(void*, intptr_t); +typedef int32_t (*iFpp_t)(void*, void*); +typedef uint32_t (*uFpL_t)(void*, uintptr_t); +typedef uint32_t (*uFpp_t)(void*, void*); +typedef uintptr_t (*LFpp_t)(void*, void*); +typedef void* (*pFpi_t)(void*, int32_t); +typedef int32_t (*iFpBp__t)(void*, struct_p_t*); +typedef void (*vFpll_t)(void*, intptr_t, intptr_t); +typedef void (*vFppp_t)(void*, void*, void*); +typedef int32_t (*iFpip_t)(void*, int32_t, void*); +typedef int32_t (*iFpui_t)(void*, uint32_t, int32_t); +typedef int32_t (*iFpuu_t)(void*, uint32_t, uint32_t); +typedef int32_t (*iFpup_t)(void*, uint32_t, void*); +typedef int32_t (*iFpll_t)(void*, intptr_t, intptr_t); +typedef int32_t (*iFpLi_t)(void*, uintptr_t, int32_t); +typedef int32_t (*iFppp_t)(void*, void*, void*); +typedef uint32_t (*uFpLL_t)(void*, uintptr_t, uintptr_t); +typedef uintptr_t (*LFpLp_t)(void*, uintptr_t, void*); +typedef void (*vFpuBLLLL__t)(void*, uint32_t, struct_LLLL_t*); +typedef int32_t (*iFprllll_rll__t)(void*, struct_llll_t*, struct_ll_t*); +typedef int32_t (*iFpiup_t)(void*, int32_t, uint32_t, void*); +typedef int32_t (*iFpuip_t)(void*, uint32_t, int32_t, void*); +typedef int32_t (*iFpupu_t)(void*, uint32_t, void*, uint32_t); +typedef int32_t (*iFpplp_t)(void*, void*, intptr_t, void*); +typedef int32_t (*iFpuuip_t)(void*, uint32_t, uint32_t, int32_t, void*); +typedef int32_t (*iFpuuup_t)(void*, uint32_t, uint32_t, uint32_t, void*); +typedef int32_t (*iFplluu_t)(void*, intptr_t, intptr_t, uint32_t, uint32_t); +typedef int32_t (*iFpLlpp_t)(void*, uintptr_t, intptr_t, void*, void*); +typedef int32_t (*iFppllp_t)(void*, void*, intptr_t, intptr_t, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(FT_Done_Glyph, vFp_t) \ + GO(FT_Activate_Size, iFp_t) \ + GO(FT_Done_Face, iFp_t) \ + GO(FT_Done_Size, iFp_t) \ + GO(FT_GlyphSlot_Own_Bitmap, iFp_t) \ + GO(FT_Has_PS_Glyph_Names, iFp_t) \ + GO(FT_Reference_Face, iFp_t) \ + GO(FT_Get_FSType_Flags, WFp_t) \ + GO(FT_Get_Sfnt_Name_Count, uFp_t) \ + GO(FT_Get_Postscript_Name, pFp_t) \ + GO(FT_Get_X11_Font_Format, pFp_t) \ + GO(FT_Matrix_Multiply, vFpp_t) \ + GO(FT_Outline_Get_CBox, vFpp_t) \ + GO(FT_Outline_Transform, vFpp_t) \ + GO(FT_Select_Charmap, iFpi_t) \ + GO(FT_Select_Size, iFpi_t) \ + GO(FT_Render_Glyph, iFpu_t) \ + GO(FT_Outline_Embolden, iFpl_t) \ + GO(FT_Done_MM_Var, iFpp_t) \ + GO(FT_Get_Glyph, iFpp_t) \ + GO(FT_Get_MM_Var, iFpp_t) \ + GO(FT_Get_PS_Font_Info, iFpp_t) \ + GO(FT_Get_WinFNT_Header, iFpp_t) \ + GO(FT_New_Size, iFpp_t) \ + GO(FT_Outline_Copy, iFpp_t) \ + GO(FT_Outline_Done, iFpp_t) \ + GO(FT_Request_Size, iFpp_t) \ + GO(FT_Set_Charmap, iFpp_t) \ + GO(FT_Get_Char_Index, uFpL_t) \ + GO(FT_Get_Name_Index, uFpp_t) \ + GO(FT_Get_First_Char, LFpp_t) \ + GO(FT_Get_Sfnt_Table, pFpi_t) \ + GO(FT_Glyph_Copy, iFpBp__t) \ + GO(FT_Outline_Translate, vFpll_t) \ + GO(FT_Set_Transform, vFppp_t) \ + GO(FT_Get_Sfnt_Name, iFpip_t) \ + GO(FT_Load_Glyph, iFpui_t) \ + GO(FT_Set_Pixel_Sizes, iFpuu_t) \ + GO(FT_Get_Var_Blend_Coordinates, iFpup_t) \ + GO(FT_Set_Var_Blend_Coordinates, iFpup_t) \ + GO(FT_Set_Var_Design_Coordinates, iFpup_t) \ + GO(FT_Outline_EmboldenXY, iFpll_t) \ + GO(FT_Load_Char, iFpLi_t) \ + GO(FT_Get_BDF_Property, iFppp_t) \ + GO(FT_Outline_Decompose, iFppp_t) \ + GO(FT_Outline_Get_Bitmap, iFppp_t) \ + GO(FT_Face_GetCharVariantIndex, uFpLL_t) \ + GO(FT_Get_Next_Char, LFpLp_t) \ + GO(FT_Glyph_Get_CBox, vFpuBLLLL__t) \ + GO(FT_Glyph_Transform, iFprllll_rll__t) \ + GO(FT_Get_Advance, iFpiup_t) \ + GO(FT_Outline_New, iFpuip_t) \ + GO(FT_Get_Glyph_Name, iFpupu_t) \ + GO(FT_New_Face, iFpplp_t) \ + GO(FT_Open_Face, iFpplp_t) \ + GO(FT_Get_Advances, iFpuuip_t) \ + GO(FT_Get_Kerning, iFpuuup_t) \ + GO(FT_Set_Char_Size, iFplluu_t) \ + GO(FT_Load_Sfnt_Table, iFpLlpp_t) \ + GO(FT_New_Memory_Face, iFppllp_t) + +#endif // __wrappedfreetypeTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedfreetypeundefs32.h b/src/wrapped32/generated/wrappedfreetypeundefs32.h new file mode 100644 index 0000000..a37e684 --- /dev/null +++ b/src/wrapped32/generated/wrappedfreetypeundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedfreetypeUNDEFS32_H_ +#define __wrappedfreetypeUNDEFS32_H_ + + +#endif // __wrappedfreetypeUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedgbmdefs32.h b/src/wrapped32/generated/wrappedgbmdefs32.h new file mode 100644 index 0000000..c396be5 --- /dev/null +++ b/src/wrapped32/generated/wrappedgbmdefs32.h @@ -0,0 +1,10 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedgbmDEFS32_H_ +#define __wrappedgbmDEFS32_H_ + +#define zFEpp pFEppp +#define zFEpp_32 pFEppp_32 + +#endif // __wrappedgbmDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedgbmtypes32.h b/src/wrapped32/generated/wrappedgbmtypes32.h new file mode 100644 index 0000000..ac96ecb --- /dev/null +++ b/src/wrapped32/generated/wrappedgbmtypes32.h @@ -0,0 +1,20 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedgbmTYPES32_H_ +#define __wrappedgbmTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef my_gbm_bo_handle_t (*zFpp_t)(void*, void*); +typedef void (*vFppp_t)(void*, void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(gbm_bo_set_user_data, vFppp_t) + +#endif // __wrappedgbmTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedgbmundefs32.h b/src/wrapped32/generated/wrappedgbmundefs32.h new file mode 100644 index 0000000..2c5ced0 --- /dev/null +++ b/src/wrapped32/generated/wrappedgbmundefs32.h @@ -0,0 +1,10 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedgbmUNDEFS32_H_ +#define __wrappedgbmUNDEFS32_H_ + +#undef zFEpp +#undef zFEpp_32 + +#endif // __wrappedgbmUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedgnutlsdefs32.h b/src/wrapped32/generated/wrappedgnutlsdefs32.h new file mode 100644 index 0000000..f5d93de --- /dev/null +++ b/src/wrapped32/generated/wrappedgnutlsdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedgnutlsDEFS32_H_ +#define __wrappedgnutlsDEFS32_H_ + + +#endif // __wrappedgnutlsDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedgnutlstypes32.h b/src/wrapped32/generated/wrappedgnutlstypes32.h new file mode 100644 index 0000000..cec3c6c --- /dev/null +++ b/src/wrapped32/generated/wrappedgnutlstypes32.h @@ -0,0 +1,27 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedgnutlsTYPES32_H_ +#define __wrappedgnutlsTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFp_t)(void*); +typedef void (*vFpp_t)(void*, void*); +typedef void* (*pFpp_t)(void*, void*); +typedef int32_t (*iFppppppppu_t)(void*, void*, void*, void*, void*, void*, void*, void*, uint32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(gnutls_global_set_log_function, vFp_t) \ + GO(gnutls_transport_set_pull_function, vFpp_t) \ + GO(gnutls_transport_set_pull_timeout_function, vFpp_t) \ + GO(gnutls_transport_set_push_function, vFpp_t) \ + GO(gnutls_certificate_get_peers, pFpp_t) \ + GO(gnutls_pkcs12_simple_parse, iFppppppppu_t) + +#endif // __wrappedgnutlsTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedgnutlsundefs32.h b/src/wrapped32/generated/wrappedgnutlsundefs32.h new file mode 100644 index 0000000..afe2a3a --- /dev/null +++ b/src/wrapped32/generated/wrappedgnutlsundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedgnutlsUNDEFS32_H_ +#define __wrappedgnutlsUNDEFS32_H_ + + +#endif // __wrappedgnutlsUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedldlinuxdefs32.h b/src/wrapped32/generated/wrappedldlinuxdefs32.h new file mode 100644 index 0000000..6c726b5 --- /dev/null +++ b/src/wrapped32/generated/wrappedldlinuxdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedldlinuxDEFS32_H_ +#define __wrappedldlinuxDEFS32_H_ + + +#endif // __wrappedldlinuxDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedldlinuxtypes32.h b/src/wrapped32/generated/wrappedldlinuxtypes32.h new file mode 100644 index 0000000..6604873 --- /dev/null +++ b/src/wrapped32/generated/wrappedldlinuxtypes32.h @@ -0,0 +1,21 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedldlinuxTYPES32_H_ +#define __wrappedldlinuxTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void* (*pFv_t)(void); +typedef void* (*pFp_t)(void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(___tls_get_addr, pFv_t) \ + GO(__tls_get_addr, pFp_t) + +#endif // __wrappedldlinuxTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedldlinuxundefs32.h b/src/wrapped32/generated/wrappedldlinuxundefs32.h new file mode 100644 index 0000000..20d6542 --- /dev/null +++ b/src/wrapped32/generated/wrappedldlinuxundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedldlinuxUNDEFS32_H_ +#define __wrappedldlinuxUNDEFS32_H_ + + +#endif // __wrappedldlinuxUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibasounddefs32.h b/src/wrapped32/generated/wrappedlibasounddefs32.h new file mode 100644 index 0000000..79a9382 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibasounddefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibasoundDEFS32_H_ +#define __wrappedlibasoundDEFS32_H_ + + +#endif // __wrappedlibasoundDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibasoundtypes32.h b/src/wrapped32/generated/wrappedlibasoundtypes32.h new file mode 100644 index 0000000..298952d --- /dev/null +++ b/src/wrapped32/generated/wrappedlibasoundtypes32.h @@ -0,0 +1,23 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibasoundTYPES32_H_ +#define __wrappedlibasoundTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef int32_t (*iFp_t)(void*); +typedef int32_t (*iFipp_t)(int32_t, void*, void*); +typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(snd_device_name_free_hint, iFp_t) \ + GO(snd_device_name_hint, iFipp_t) \ + GO(snd_pcm_mmap_begin, iFpppp_t) + +#endif // __wrappedlibasoundTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibasoundundefs32.h b/src/wrapped32/generated/wrappedlibasoundundefs32.h new file mode 100644 index 0000000..386c207 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibasoundundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibasoundUNDEFS32_H_ +#define __wrappedlibasoundUNDEFS32_H_ + + +#endif // __wrappedlibasoundUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibcdefs32.h b/src/wrapped32/generated/wrappedlibcdefs32.h new file mode 100644 index 0000000..9a15408 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibcdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibcDEFS32_H_ +#define __wrappedlibcDEFS32_H_ + + +#endif // __wrappedlibcDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibctypes32.h b/src/wrapped32/generated/wrappedlibctypes32.h new file mode 100644 index 0000000..e572226 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibctypes32.h @@ -0,0 +1,310 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibcTYPES32_H_ +#define __wrappedlibcTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vEv_t)(void); +typedef void (*vFi_t)(int32_t); +typedef void (*vEp_t)(void*); +typedef void (*vFp_t)(void*); +typedef int32_t (*iEv_t)(void); +typedef int32_t (*iEi_t)(int32_t); +typedef int32_t (*iEL_t)(uintptr_t); +typedef int32_t (*iEp_t)(void*); +typedef int32_t (*iEO_t)(int32_t); +typedef int64_t (*IEp_t)(void*); +typedef uint32_t (*uEp_t)(void*); +typedef uint32_t (*uES_t)(void*); +typedef uint64_t (*UEp_t)(void*); +typedef intptr_t (*lEi_t)(int32_t); +typedef intptr_t (*lEp_t)(void*); +typedef intptr_t (*lES_t)(void*); +typedef uintptr_t (*LEL_t)(uintptr_t); +typedef uintptr_t (*LEp_t)(void*); +typedef void* (*pEv_t)(void); +typedef void* (*pFv_t)(void); +typedef void* (*pEu_t)(uint32_t); +typedef void* (*pFu_t)(uint32_t); +typedef void* (*pEL_t)(uintptr_t); +typedef void* (*pFL_t)(uintptr_t); +typedef void* (*pEp_t)(void*); +typedef void* (*pFp_t)(void*); +typedef void* (*pES_t)(void*); +typedef char* (*tEp_t)(void*); +typedef int32_t (*iEbp__t)(struct_p_t*); +typedef void* (*pErl__t)(struct_l_t*); +typedef intptr_t (*lEriiiiiiiiilt__t)(struct_iiiiiiiiilt_t*); +typedef void* (*pEriiiiiiiiilt__t)(struct_iiiiiiiiilt_t*); +typedef void (*vEip_t)(int32_t, void*); +typedef void (*vEpi_t)(void*, int32_t); +typedef void (*vEpu_t)(void*, uint32_t); +typedef void (*vEpp_t)(void*, void*); +typedef int32_t (*iEip_t)(int32_t, void*); +typedef int32_t (*iFip_t)(int32_t, void*); +typedef int32_t (*iEup_t)(uint32_t, void*); +typedef int32_t (*iEpi_t)(void*, int32_t); +typedef int32_t (*iEpL_t)(void*, uintptr_t); +typedef int32_t (*iEpp_t)(void*, void*); +typedef int32_t (*iEpV_t)(void*, ...); +typedef int64_t (*IEII_t)(int64_t, int64_t); +typedef uint64_t (*UEUU_t)(uint64_t, uint64_t); +typedef double (*KFKi_t)(double, int32_t); +typedef double (*KFKp_t)(double, void*); +typedef intptr_t (*lEuV_t)(uint32_t, ...); +typedef void* (*pEip_t)(int32_t, void*); +typedef void* (*pELL_t)(uintptr_t, uintptr_t); +typedef void* (*pEpi_t)(void*, int32_t); +typedef void* (*pEpL_t)(void*, uintptr_t); +typedef void* (*pEpp_t)(void*, void*); +typedef void* (*SEpp_t)(void*, void*); +typedef int32_t (*iErLL_BLL__t)(struct_LL_t*, struct_LL_t*); +typedef int32_t (*iEiBUUUULLLLLLLLLLLLLL__t)(int32_t, struct_UUUULLLLLLLLLLLLLL_t*); +typedef void (*vEipp_t)(int32_t, void*, void*); +typedef void (*vEipV_t)(int32_t, void*, ...); +typedef void (*vEpuu_t)(void*, uint32_t, uint32_t); +typedef void (*vEpup_t)(void*, uint32_t, void*); +typedef void (*vEppu_t)(void*, void*, uint32_t); +typedef int32_t (*iEiip_t)(int32_t, int32_t, void*); +typedef int32_t (*iEiiN_t)(int32_t, int32_t, ...); +typedef int32_t (*iEiLp_t)(int32_t, uintptr_t, void*); +typedef int32_t (*iEipp_t)(int32_t, void*, void*); +typedef int32_t (*iEipV_t)(int32_t, void*, ...); +typedef int32_t (*iEpii_t)(void*, int32_t, int32_t); +typedef int32_t (*iEpLi_t)(void*, uintptr_t, int32_t); +typedef int32_t (*iEppi_t)(void*, void*, int32_t); +typedef int32_t (*iEppp_t)(void*, void*, void*); +typedef int32_t (*iEppV_t)(void*, void*, ...); +typedef int32_t (*iEpON_t)(void*, int32_t, ...); +typedef int32_t (*iESpp_t)(void*, void*, void*); +typedef int32_t (*iESpV_t)(void*, void*, ...); +typedef intptr_t (*lEipi_t)(int32_t, void*, int32_t); +typedef intptr_t (*lEipL_t)(int32_t, void*, uintptr_t); +typedef intptr_t (*lEppL_t)(void*, void*, uintptr_t); +typedef void* (*pEipi_t)(int32_t, void*, int32_t); +typedef void* (*pEpii_t)(void*, int32_t, int32_t); +typedef void* (*pEpip_t)(void*, int32_t, void*); +typedef void* (*pEpII_t)(void*, int64_t, int64_t); +typedef void* (*pFpui_t)(void*, uint32_t, int32_t); +typedef void* (*pEpLL_t)(void*, uintptr_t, uintptr_t); +typedef void* (*pEppi_t)(void*, void*, int32_t); +typedef int64_t (*IEpBp_i_t)(void*, struct_p_t*, int32_t); +typedef uint64_t (*UEpBp_i_t)(void*, struct_p_t*, int32_t); +typedef double (*KEpBp_a_t)(void*, struct_p_t*, void*); +typedef intptr_t (*lEpBp_i_t)(void*, struct_p_t*, int32_t); +typedef uintptr_t (*LEpBp_i_t)(void*, struct_p_t*, int32_t); +typedef void (*vEiipp_t)(int32_t, int32_t, void*, void*); +typedef void (*vEiipV_t)(int32_t, int32_t, void*, ...); +typedef void (*vEpLLp_t)(void*, uintptr_t, uintptr_t, void*); +typedef void (*vEppiV_t)(void*, void*, int32_t, ...); +typedef int32_t (*iEiiip_t)(int32_t, int32_t, int32_t, void*); +typedef int32_t (*iEiipV_t)(int32_t, int32_t, void*, ...); +typedef int32_t (*iEipii_t)(int32_t, void*, int32_t, int32_t); +typedef int32_t (*iEipuu_t)(int32_t, void*, uint32_t, uint32_t); +typedef int32_t (*iEipup_t)(int32_t, void*, uint32_t, void*); +typedef int32_t (*iEippi_t)(int32_t, void*, void*, int32_t); +typedef int32_t (*iEippL_t)(int32_t, void*, void*, uintptr_t); +typedef int32_t (*iEuupi_t)(uint32_t, uint32_t, void*, int32_t); +typedef int32_t (*iEpipp_t)(void*, int32_t, void*, void*); +typedef int32_t (*iEpipV_t)(void*, int32_t, void*, ...); +typedef int32_t (*iEpuiL_t)(void*, uint32_t, int32_t, uintptr_t); +typedef int32_t (*iEpLpp_t)(void*, uintptr_t, void*, void*); +typedef int32_t (*iEpLpV_t)(void*, uintptr_t, void*, ...); +typedef int32_t (*iEppii_t)(void*, void*, int32_t, int32_t); +typedef int32_t (*iEpppp_t)(void*, void*, void*, void*); +typedef int32_t (*iESipp_t)(void*, int32_t, void*, void*); +typedef int32_t (*iESipV_t)(void*, int32_t, void*, ...); +typedef uint32_t (*uEippu_t)(int32_t, void*, void*, uint32_t); +typedef int64_t (*IEpBp_ia_t)(void*, struct_p_t*, int32_t, void*); +typedef uint64_t (*UEpBp_ia_t)(void*, struct_p_t*, int32_t, void*); +typedef uintptr_t (*LEpBp_ii_t)(void*, struct_p_t*, int32_t, int32_t); +typedef int32_t (*iEiiipu_t)(int32_t, int32_t, int32_t, void*, uint32_t); +typedef int32_t (*iEiiipp_t)(int32_t, int32_t, int32_t, void*, void*); +typedef int32_t (*iEiippi_t)(int32_t, int32_t, void*, void*, int32_t); +typedef int32_t (*iEiLLLL_t)(int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +typedef int32_t (*iEipiup_t)(int32_t, void*, int32_t, uint32_t, void*); +typedef int32_t (*iEippup_t)(int32_t, void*, void*, uint32_t, void*); +typedef int32_t (*iEipppp_t)(int32_t, void*, void*, void*, void*); +typedef int32_t (*iEuppLp_t)(uint32_t, void*, void*, uintptr_t, void*); +typedef int32_t (*iEpiipi_t)(void*, int32_t, int32_t, void*, int32_t); +typedef int32_t (*iEpiipV_t)(void*, int32_t, int32_t, void*, ...); +typedef int32_t (*iEpiLpp_t)(void*, int32_t, uintptr_t, void*, void*); +typedef int32_t (*iEpipOi_t)(void*, int32_t, void*, int32_t, int32_t); +typedef int32_t (*iEppupi_t)(void*, void*, uint32_t, void*, int32_t); +typedef int32_t (*iEpppup_t)(void*, void*, void*, uint32_t, void*); +typedef int32_t (*iEpppLp_t)(void*, void*, void*, uintptr_t, void*); +typedef void* (*pEpLLiN_t)(void*, uintptr_t, uintptr_t, int32_t, ...); +typedef void* (*pEppLLp_t)(void*, void*, uintptr_t, uintptr_t, void*); +typedef void* (*pEppbL_Lp_t)(void*, void*, struct_L_t*, uintptr_t, void*); +typedef int32_t (*iEipuurLL__t)(int32_t, void*, uint32_t, uint32_t, struct_LL_t*); +typedef int32_t (*iEpLiipp_t)(void*, uintptr_t, int32_t, int32_t, void*, void*); +typedef int32_t (*iEpLiipV_t)(void*, uintptr_t, int32_t, int32_t, void*, ...); +typedef int32_t (*iEpLiLpV_t)(void*, uintptr_t, int32_t, uintptr_t, void*, ...); +typedef int32_t (*iFpppupp_t)(void*, void*, void*, uint32_t, void*, void*); +typedef int32_t (*iEpppppp_t)(void*, void*, void*, void*, void*, void*); +typedef intptr_t (*lEipLpLL_t)(int32_t, void*, uintptr_t, void*, uintptr_t, uintptr_t); +typedef void* (*pEpLiiiI_t)(void*, uintptr_t, int32_t, int32_t, int32_t, int64_t); +typedef void* (*pEpLiiil_t)(void*, uintptr_t, int32_t, int32_t, int32_t, intptr_t); +typedef int32_t (*iFpippupp_t)(void*, int32_t, void*, void*, uint32_t, void*, void*); +typedef int32_t (*iEpippppp_t)(void*, int32_t, void*, void*, void*, void*, void*); +typedef int32_t (*iEpLiLppp_t)(void*, uintptr_t, int32_t, uintptr_t, void*, void*, void*); +typedef int32_t (*iFpuippupp_t)(void*, uint32_t, int32_t, void*, void*, uint32_t, void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(exit, vFi_t) \ + GO(__libc_free, vEp_t) \ + GO(freeaddrinfo, vEp_t) \ + GO(regfree, vEp_t) \ + GO(_ZGTtdlPv, vFp_t) \ + GO(__close_nocancel, iEi_t) \ + GO(shmdt, iEp_t) \ + GO(sysinfo, iEp_t) \ + GO(__time64, IEp_t) \ + GO(getwc, uES_t) \ + GO(__sysconf, lEi_t) \ + GO(sysconf, lEi_t) \ + GO(atol, lEp_t) \ + GO(ftell, lES_t) \ + GO(__mktime64, LEp_t) \ + GO(__ctype_b_loc, pEv_t) \ + GO(__ctype_tolower_loc, pEv_t) \ + GO(__ctype_toupper_loc, pEv_t) \ + GO(__errno_location, pEv_t) \ + GO(__res_state, pEv_t) \ + GO(getpwent, pEv_t) \ + GO(localeconv, pEv_t) \ + GO(__h_errno_location, pFv_t) \ + GO(getpwuid, pEu_t) \ + GO(_ZGTtnaj, pFu_t) \ + GO(__libc_malloc, pEL_t) \ + GO(__libc_pvalloc, pEL_t) \ + GO(__libc_valloc, pEL_t) \ + GO(_ZGTtnaX, pFL_t) \ + GO(_ZGTtnam, pFL_t) \ + GO(__ctime64, pEp_t) \ + GO(__gmtime64, pEp_t) \ + GO(__localtime64, pEp_t) \ + GO(getgrnam, pEp_t) \ + GO(getprotobyname, pEp_t) \ + GO(getpwnam, pEp_t) \ + GO(gmtime, pEp_t) \ + GO(localtime, pEp_t) \ + GO(gethostbyname, pFp_t) \ + GO(getmntent, pES_t) \ + GO(__secure_getenv, tEp_t) \ + GO(getifaddrs, iEbp__t) \ + GO(ctime, pErl__t) \ + GO(asctime, pEriiiiiiiiilt__t) \ + GO(_obstack_newchunk, vEpi_t) \ + GO(__futimens64, iEip_t) \ + GO(fstatvfs, iEip_t) \ + GO(fstatvfs64, iEip_t) \ + GO(futimens, iEip_t) \ + GO(futimes, iEip_t) \ + GO(__fstat64_time64, iFip_t) \ + GO(getrlimit, iEup_t) \ + GO(setrlimit, iEup_t) \ + GO(backtrace, iEpi_t) \ + GO(__gettimeofday64, iEpp_t) \ + GO(__lstat64_time64, iEpp_t) \ + GO(__nanosleep64, iEpp_t) \ + GO(__stat64_time64, iEpp_t) \ + GO(alphasort64, iEpp_t) \ + GO(statvfs, iEpp_t) \ + GO(statvfs64, iEpp_t) \ + GO(utimes, iEpp_t) \ + GO(execl, iEpV_t) \ + GO(execlp, iEpV_t) \ + GO(ldexpl, KFKi_t) \ + GO(frexpl, KFKp_t) \ + GO(signal, pEip_t) \ + GO(__libc_calloc, pELL_t) \ + GO(__libc_memalign, pELL_t) \ + GO(aligned_alloc, pELL_t) \ + GO(backtrace_symbols, pEpi_t) \ + GO(__libc_realloc, pEpL_t) \ + GO(__cmsg_nxthdr, pEpp_t) \ + GO(__gmtime_r, pEpp_t) \ + GO(getservbyname, pEpp_t) \ + GO(gmtime_r, pEpp_t) \ + GO(localtime_r, pEpp_t) \ + GO(__getrusage64, iEiBUUUULLLLLLLLLLLLLL__t) \ + GO(vsyslog, vEipp_t) \ + GO(syslog, vEipV_t) \ + GO(_ITM_addUserCommitAction, vEpup_t) \ + GO(__fcntl_time64, iEiiN_t) \ + GO(__ioctl_time64, iEiLp_t) \ + GO(ioctl, iEiLp_t) \ + GO(regcomp, iEppi_t) \ + GO(__isoc23_vsscanf, iEppp_t) \ + GO(vswscanf, iEppp_t) \ + GO(__isoc23_sscanf, iEppV_t) \ + GO(swscanf, iEppV_t) \ + GO(__isoc23_fscanf, iESpV_t) \ + GO(__isoc99_fscanf, iESpV_t) \ + GO(fscanf, iESpV_t) \ + GO(__recvmsg64, lEipi_t) \ + GO(__sendmsg64, lEipi_t) \ + GO(readv, lEipi_t) \ + GO(recvmsg, lEipi_t) \ + GO(sendmsg, lEipi_t) \ + GO(writev, lEipi_t) \ + GO(write, lEipL_t) \ + GO(shmat, pEipi_t) \ + GO(fts_open, pEpip_t) \ + GO(gethostbyaddr, pFpui_t) \ + GO(__realpath_chk, pEppi_t) \ + GO(__isoc23_strtoll, IEpBp_i_t) \ + GO(__isoc23_strtoull, UEpBp_i_t) \ + GO(__strtold_l, KEpBp_a_t) \ + GO(strtold_l, KEpBp_a_t) \ + GO(__isoc23_strtol, lEpBp_i_t) \ + GO(__isoc23_wcstol, lEpBp_i_t) \ + GO(wcstol, lEpBp_i_t) \ + GO(__isoc23_strtoul, LEpBp_i_t) \ + GO(wcstoul, LEpBp_i_t) \ + GO(__vsyslog_chk, vEiipp_t) \ + GO(__syslog_chk, vEiipV_t) \ + GO(sendmmsg, iEipuu_t) \ + GO(__xmknod, iEipup_t) \ + GO(__fstatat64_time64, iEippi_t) \ + GO(fstatat, iEippi_t) \ + GO(fstatat64, iEippi_t) \ + GO(utimensat, iEippi_t) \ + GO(readlinkat, iEippL_t) \ + GO(waitid, iEuupi_t) \ + GO(getaddrinfo, iEpppp_t) \ + GO(regerror, uEippu_t) \ + GO(__isoc23_strtoll_l, IEpBp_ia_t) \ + GO(__isoc23_strtoull_l, UEpBp_ia_t) \ + GO(__setsockopt64, iEiiipu_t) \ + GO(__getsockopt64, iEiiipp_t) \ + GO(__prctl_time64, iEiLLLL_t) \ + GO(prctl, iEiLLLL_t) \ + GO(statx, iEipiup_t) \ + GO(getprotobynumber_r, iEippup_t) \ + GO(__select64, iEipppp_t) \ + GO(getopt_long, iEipppp_t) \ + GO(getgrgid_r, iEuppLp_t) \ + GO(getpwuid_r, iEuppLp_t) \ + GO(res_query, iEpiipi_t) \ + GO(res_search, iEpiipi_t) \ + GO(regexec, iEppupi_t) \ + GO(getprotobyname_r, iEpppup_t) \ + GO(getgrnam_r, iEpppLp_t) \ + GO(getpwnam_r, iEpppLp_t) \ + GO(recvmmsg, iEipuurLL__t) \ + GO(gethostbyname_r, iFpppupp_t) \ + GO(process_vm_readv, lEipLpLL_t) \ + GO(process_vm_writev, lEipLpLL_t) \ + GO(gethostbyname2_r, iFpippupp_t) \ + GO(gethostbyaddr_r, iFpuippupp_t) + +#endif // __wrappedlibcTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibcundefs32.h b/src/wrapped32/generated/wrappedlibcundefs32.h new file mode 100644 index 0000000..a2a8943 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibcundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibcUNDEFS32_H_ +#define __wrappedlibcUNDEFS32_H_ + + +#endif // __wrappedlibcUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibcupsdefs32.h b/src/wrapped32/generated/wrappedlibcupsdefs32.h new file mode 100644 index 0000000..c64f3c9 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibcupsdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibcupsDEFS32_H_ +#define __wrappedlibcupsDEFS32_H_ + + +#endif // __wrappedlibcupsDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibcupstypes32.h b/src/wrapped32/generated/wrappedlibcupstypes32.h new file mode 100644 index 0000000..3c3b63f --- /dev/null +++ b/src/wrapped32/generated/wrappedlibcupstypes32.h @@ -0,0 +1,23 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibcupsTYPES32_H_ +#define __wrappedlibcupsTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef int32_t (*iFp_t)(void*); +typedef void (*vFip_t)(int32_t, void*); +typedef void* (*pFpip_t)(void*, int32_t, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(cupsGetDests, iFp_t) \ + GO(cupsFreeDests, vFip_t) \ + GO(cupsGetOption, pFpip_t) + +#endif // __wrappedlibcupsTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibcupsundefs32.h b/src/wrapped32/generated/wrappedlibcupsundefs32.h new file mode 100644 index 0000000..3241709 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibcupsundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibcupsUNDEFS32_H_ +#define __wrappedlibcupsUNDEFS32_H_ + + +#endif // __wrappedlibcupsUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibdldefs32.h b/src/wrapped32/generated/wrappedlibdldefs32.h new file mode 100644 index 0000000..d28fcd9 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibdldefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibdlDEFS32_H_ +#define __wrappedlibdlDEFS32_H_ + + +#endif // __wrappedlibdlDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibdltypes32.h b/src/wrapped32/generated/wrappedlibdltypes32.h new file mode 100644 index 0000000..ecb896d --- /dev/null +++ b/src/wrapped32/generated/wrappedlibdltypes32.h @@ -0,0 +1,36 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibdlTYPES32_H_ +#define __wrappedlibdlTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef int32_t (*iEp_t)(void*); +typedef void* (*pEv_t)(void); +typedef int32_t (*iEpp_t)(void*, void*); +typedef void* (*pEpi_t)(void*, int32_t); +typedef void* (*pEpp_t)(void*, void*); +typedef int32_t (*iEpip_t)(void*, int32_t, void*); +typedef void* (*pEppi_t)(void*, void*, int32_t); +typedef void* (*pEppp_t)(void*, void*, void*); +typedef int32_t (*iEpppi_t)(void*, void*, void*, int32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(dlclose, iEp_t) \ + GO(dlerror, pEv_t) \ + GO(_dl_find_object, iEpp_t) \ + GO(dladdr, iEpp_t) \ + GO(dlopen, pEpi_t) \ + GO(dlsym, pEpp_t) \ + GO(dlinfo, iEpip_t) \ + GO(dlmopen, pEppi_t) \ + GO(dlvsym, pEppp_t) \ + GO(dladdr1, iEpppi_t) + +#endif // __wrappedlibdlTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibdlundefs32.h b/src/wrapped32/generated/wrappedlibdlundefs32.h new file mode 100644 index 0000000..f7d7a4d --- /dev/null +++ b/src/wrapped32/generated/wrappedlibdlundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibdlUNDEFS32_H_ +#define __wrappedlibdlUNDEFS32_H_ + + +#endif // __wrappedlibdlUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibdrmdefs32.h b/src/wrapped32/generated/wrappedlibdrmdefs32.h new file mode 100644 index 0000000..251db44 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibdrmdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibdrmDEFS32_H_ +#define __wrappedlibdrmDEFS32_H_ + + +#endif // __wrappedlibdrmDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibdrmtypes32.h b/src/wrapped32/generated/wrappedlibdrmtypes32.h new file mode 100644 index 0000000..28ede34 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibdrmtypes32.h @@ -0,0 +1,29 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibdrmTYPES32_H_ +#define __wrappedlibdrmTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFp_t)(void*); +typedef void* (*pFi_t)(int32_t); +typedef int32_t (*iFip_t)(int32_t, void*); +typedef void* (*pFiu_t)(int32_t, uint32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(drmFreeVersion, vFp_t) \ + GO(drmModeFreeConnector, vFp_t) \ + GO(drmModeFreeResources, vFp_t) \ + GO(drmGetVersion, pFi_t) \ + GO(drmModeGetResources, pFi_t) \ + GO(drmHandleEvent, iFip_t) \ + GO(drmModeGetConnector, pFiu_t) \ + GO(drmModeGetConnectorCurrent, pFiu_t) + +#endif // __wrappedlibdrmTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibdrmundefs32.h b/src/wrapped32/generated/wrappedlibdrmundefs32.h new file mode 100644 index 0000000..9138d28 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibdrmundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibdrmUNDEFS32_H_ +#define __wrappedlibdrmUNDEFS32_H_ + + +#endif // __wrappedlibdrmUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibegldefs32.h b/src/wrapped32/generated/wrappedlibegldefs32.h new file mode 100644 index 0000000..aeae796 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibegldefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibeglDEFS32_H_ +#define __wrappedlibeglDEFS32_H_ + + +#endif // __wrappedlibeglDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibegltypes32.h b/src/wrapped32/generated/wrappedlibegltypes32.h new file mode 100644 index 0000000..9822103 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibegltypes32.h @@ -0,0 +1,19 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibeglTYPES32_H_ +#define __wrappedlibeglTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void* (*pFp_t)(void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(eglGetProcAddress, pFp_t) + +#endif // __wrappedlibeglTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibeglundefs32.h b/src/wrapped32/generated/wrappedlibeglundefs32.h new file mode 100644 index 0000000..1753f5d --- /dev/null +++ b/src/wrapped32/generated/wrappedlibeglundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibeglUNDEFS32_H_ +#define __wrappedlibeglUNDEFS32_H_ + + +#endif // __wrappedlibeglUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibgldefs32.h b/src/wrapped32/generated/wrappedlibgldefs32.h new file mode 100644 index 0000000..6e6b748 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibgldefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibglDEFS32_H_ +#define __wrappedlibglDEFS32_H_ + + +#endif // __wrappedlibglDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibgltypes32.h b/src/wrapped32/generated/wrappedlibgltypes32.h new file mode 100644 index 0000000..f39e829 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibgltypes32.h @@ -0,0 +1,73 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibglTYPES32_H_ +#define __wrappedlibglTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef int32_t (*iFi_t)(int32_t); +typedef void* (*pFp_t)(void*); +typedef void (*vFip_t)(int32_t, void*); +typedef void (*vFpp_t)(void*, void*); +typedef int32_t (*iFpp_t)(void*, void*); +typedef void* (*pFXp_t)(void*, void*); +typedef void (*vFipp_t)(int32_t, void*, void*); +typedef void (*vFppp_t)(void*, void*, void*); +typedef void (*vFXpi_t)(void*, void*, int32_t); +typedef uint32_t (*uFuip_t)(uint32_t, int32_t, void*); +typedef void* (*pFXip_t)(void*, int32_t, void*); +typedef void (*vFuipu_t)(uint32_t, int32_t, void*, uint32_t); +typedef void (*vFuipp_t)(uint32_t, int32_t, void*, void*); +typedef void* (*pFXipp_t)(void*, int32_t, void*, void*); +typedef void* (*pFXppi_t)(void*, void*, void*, int32_t); +typedef void (*vFuippp_t)(uint32_t, int32_t, void*, void*, void*); +typedef void (*vFupupi_t)(uint32_t, void*, uint32_t, void*, int32_t); +typedef void (*vFuuippp_t)(uint32_t, uint32_t, int32_t, void*, void*, void*); +typedef void (*vFupupip_t)(uint32_t, void*, uint32_t, void*, int32_t, void*); +typedef void (*vFppupui_t)(void*, void*, uint32_t, void*, uint32_t, int32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(glXSwapIntervalMESA, iFi_t) \ + GO(glGetVkProcAddrNV, pFp_t) \ + GO(glXGetProcAddress, pFp_t) \ + GO(glXGetProcAddressARB, pFp_t) \ + GO(glVDPAUMapSurfacesNV, vFip_t) \ + GO(glVDPAUUnmapSurfacesNV, vFip_t) \ + GO(glDebugMessageCallback, vFpp_t) \ + GO(glDebugMessageCallbackAMD, vFpp_t) \ + GO(glDebugMessageCallbackARB, vFpp_t) \ + GO(glDebugMessageCallbackKHR, vFpp_t) \ + GO(eglDebugMessageControlKHR, iFpp_t) \ + GO(glXGetFBConfigFromVisualSGIX, pFXp_t) \ + GO(glXGetVisualFromFBConfig, pFXp_t) \ + GO(glXGetVisualFromFBConfigSGIX, pFXp_t) \ + GO(glProgramCallbackMESA, vFipp_t) \ + GO(eglSetBlobCacheFuncsANDROID, vFppp_t) \ + GO(glXSwapIntervalEXT, vFXpi_t) \ + GO(glCreateShaderProgramv, uFuip_t) \ + GO(glXChooseVisual, pFXip_t) \ + GO(glXGetFBConfigs, pFXip_t) \ + GO(glTransformFeedbackVaryings, vFuipu_t) \ + GO(glTransformFeedbackVaryingsEXT, vFuipu_t) \ + GO(glCompileShaderIncludeARB, vFuipp_t) \ + GO(glGetUniformIndices, vFuipp_t) \ + GO(glShaderSource, vFuipp_t) \ + GO(glShaderSourceARB, vFuipp_t) \ + GO(glXChooseFBConfig, pFXipp_t) \ + GO(glXChooseFBConfigSGIX, pFXipp_t) \ + GO(glXCreateContext, pFXppi_t) \ + GO(glBindVertexBuffers, vFuippp_t) \ + GO(glMultiDrawElements, vFupupi_t) \ + GO(glMultiDrawElementsEXT, vFupupi_t) \ + GO(glBindBuffersRange, vFuuippp_t) \ + GO(glVertexArrayVertexBuffers, vFuuippp_t) \ + GO(glMultiDrawElementsBaseVertex, vFupupip_t) \ + GO(glMultiModeDrawElementsIBM, vFppupui_t) + +#endif // __wrappedlibglTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibgludefs32.h b/src/wrapped32/generated/wrappedlibgludefs32.h new file mode 100644 index 0000000..75f7410 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibgludefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibgluDEFS32_H_ +#define __wrappedlibgluDEFS32_H_ + + +#endif // __wrappedlibgluDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibglundefs32.h b/src/wrapped32/generated/wrappedlibglundefs32.h new file mode 100644 index 0000000..6007d81 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibglundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibglUNDEFS32_H_ +#define __wrappedlibglUNDEFS32_H_ + + +#endif // __wrappedlibglUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibglutypes32.h b/src/wrapped32/generated/wrappedlibglutypes32.h new file mode 100644 index 0000000..c73f16c --- /dev/null +++ b/src/wrapped32/generated/wrappedlibglutypes32.h @@ -0,0 +1,21 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibgluTYPES32_H_ +#define __wrappedlibgluTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFpup_t)(void*, uint32_t, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(gluNurbsCallback, vFpup_t) \ + GO(gluQuadricCallback, vFpup_t) \ + GO(gluTessCallback, vFpup_t) + +#endif // __wrappedlibgluTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibgluundefs32.h b/src/wrapped32/generated/wrappedlibgluundefs32.h new file mode 100644 index 0000000..875c468 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibgluundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibgluUNDEFS32_H_ +#define __wrappedlibgluUNDEFS32_H_ + + +#endif // __wrappedlibgluUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibglxdefs32.h b/src/wrapped32/generated/wrappedlibglxdefs32.h new file mode 100644 index 0000000..79be6f7 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibglxdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibglxDEFS32_H_ +#define __wrappedlibglxDEFS32_H_ + + +#endif // __wrappedlibglxDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibglxnvidiadefs32.h b/src/wrapped32/generated/wrappedlibglxnvidiadefs32.h new file mode 100644 index 0000000..6d8adcc --- /dev/null +++ b/src/wrapped32/generated/wrappedlibglxnvidiadefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibglxnvidiaDEFS32_H_ +#define __wrappedlibglxnvidiaDEFS32_H_ + + +#endif // __wrappedlibglxnvidiaDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibglxnvidiatypes32.h b/src/wrapped32/generated/wrappedlibglxnvidiatypes32.h new file mode 100644 index 0000000..699d359 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibglxnvidiatypes32.h @@ -0,0 +1,73 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibglxnvidiaTYPES32_H_ +#define __wrappedlibglxnvidiaTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef int32_t (*iFi_t)(int32_t); +typedef void* (*pFp_t)(void*); +typedef void (*vFip_t)(int32_t, void*); +typedef void (*vFpp_t)(void*, void*); +typedef int32_t (*iFpp_t)(void*, void*); +typedef void* (*pFXp_t)(void*, void*); +typedef void (*vFipp_t)(int32_t, void*, void*); +typedef void (*vFppp_t)(void*, void*, void*); +typedef void (*vFXpi_t)(void*, void*, int32_t); +typedef uint32_t (*uFuip_t)(uint32_t, int32_t, void*); +typedef void* (*pFXip_t)(void*, int32_t, void*); +typedef void (*vFuipu_t)(uint32_t, int32_t, void*, uint32_t); +typedef void (*vFuipp_t)(uint32_t, int32_t, void*, void*); +typedef void* (*pFXipp_t)(void*, int32_t, void*, void*); +typedef void* (*pFXppi_t)(void*, void*, void*, int32_t); +typedef void (*vFuippp_t)(uint32_t, int32_t, void*, void*, void*); +typedef void (*vFupupi_t)(uint32_t, void*, uint32_t, void*, int32_t); +typedef void (*vFuuippp_t)(uint32_t, uint32_t, int32_t, void*, void*, void*); +typedef void (*vFupupip_t)(uint32_t, void*, uint32_t, void*, int32_t, void*); +typedef void (*vFppupui_t)(void*, void*, uint32_t, void*, uint32_t, int32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(glXSwapIntervalMESA, iFi_t) \ + GO(glGetVkProcAddrNV, pFp_t) \ + GO(glXGetProcAddress, pFp_t) \ + GO(glXGetProcAddressARB, pFp_t) \ + GO(glVDPAUMapSurfacesNV, vFip_t) \ + GO(glVDPAUUnmapSurfacesNV, vFip_t) \ + GO(glDebugMessageCallback, vFpp_t) \ + GO(glDebugMessageCallbackAMD, vFpp_t) \ + GO(glDebugMessageCallbackARB, vFpp_t) \ + GO(glDebugMessageCallbackKHR, vFpp_t) \ + GO(eglDebugMessageControlKHR, iFpp_t) \ + GO(glXGetFBConfigFromVisualSGIX, pFXp_t) \ + GO(glXGetVisualFromFBConfig, pFXp_t) \ + GO(glXGetVisualFromFBConfigSGIX, pFXp_t) \ + GO(glProgramCallbackMESA, vFipp_t) \ + GO(eglSetBlobCacheFuncsANDROID, vFppp_t) \ + GO(glXSwapIntervalEXT, vFXpi_t) \ + GO(glCreateShaderProgramv, uFuip_t) \ + GO(glXChooseVisual, pFXip_t) \ + GO(glXGetFBConfigs, pFXip_t) \ + GO(glTransformFeedbackVaryings, vFuipu_t) \ + GO(glTransformFeedbackVaryingsEXT, vFuipu_t) \ + GO(glCompileShaderIncludeARB, vFuipp_t) \ + GO(glGetUniformIndices, vFuipp_t) \ + GO(glShaderSource, vFuipp_t) \ + GO(glShaderSourceARB, vFuipp_t) \ + GO(glXChooseFBConfig, pFXipp_t) \ + GO(glXChooseFBConfigSGIX, pFXipp_t) \ + GO(glXCreateContext, pFXppi_t) \ + GO(glBindVertexBuffers, vFuippp_t) \ + GO(glMultiDrawElements, vFupupi_t) \ + GO(glMultiDrawElementsEXT, vFupupi_t) \ + GO(glBindBuffersRange, vFuuippp_t) \ + GO(glVertexArrayVertexBuffers, vFuuippp_t) \ + GO(glMultiDrawElementsBaseVertex, vFupupip_t) \ + GO(glMultiModeDrawElementsIBM, vFppupui_t) + +#endif // __wrappedlibglxnvidiaTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibglxnvidiaundefs32.h b/src/wrapped32/generated/wrappedlibglxnvidiaundefs32.h new file mode 100644 index 0000000..4b62be4 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibglxnvidiaundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibglxnvidiaUNDEFS32_H_ +#define __wrappedlibglxnvidiaUNDEFS32_H_ + + +#endif // __wrappedlibglxnvidiaUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibglxtypes32.h b/src/wrapped32/generated/wrappedlibglxtypes32.h new file mode 100644 index 0000000..4e2436e --- /dev/null +++ b/src/wrapped32/generated/wrappedlibglxtypes32.h @@ -0,0 +1,29 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibglxTYPES32_H_ +#define __wrappedlibglxTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void* (*pFp_t)(void*); +typedef void* (*pFXp_t)(void*, void*); +typedef void* (*pFXip_t)(void*, int32_t, void*); +typedef void* (*pFXipp_t)(void*, int32_t, void*, void*); +typedef void* (*pFXppi_t)(void*, void*, void*, int32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(glXGetProcAddress, pFp_t) \ + GO(glXGetProcAddressARB, pFp_t) \ + GO(glXGetVisualFromFBConfig, pFXp_t) \ + GO(glXChooseVisual, pFXip_t) \ + GO(glXGetFBConfigs, pFXip_t) \ + GO(glXChooseFBConfig, pFXipp_t) \ + GO(glXCreateContext, pFXppi_t) + +#endif // __wrappedlibglxTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibglxundefs32.h b/src/wrapped32/generated/wrappedlibglxundefs32.h new file mode 100644 index 0000000..5d7cddd --- /dev/null +++ b/src/wrapped32/generated/wrappedlibglxundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibglxUNDEFS32_H_ +#define __wrappedlibglxUNDEFS32_H_ + + +#endif // __wrappedlibglxUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibmdefs32.h b/src/wrapped32/generated/wrappedlibmdefs32.h new file mode 100644 index 0000000..278ad52 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibmdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibmDEFS32_H_ +#define __wrappedlibmDEFS32_H_ + + +#endif // __wrappedlibmDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibmtypes32.h b/src/wrapped32/generated/wrappedlibmtypes32.h new file mode 100644 index 0000000..98f7b96 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibmtypes32.h @@ -0,0 +1,90 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibmTYPES32_H_ +#define __wrappedlibmTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef uint64_t (*UEs_t)(void*); +typedef float (*fEf_t)(float); +typedef double (*dEd_t)(double); +typedef long double (*DED_t)(long double); +typedef double (*KEK_t)(double); +typedef float (*fEff_t)(float, float); +typedef double (*dEdd_t)(double, double); +typedef double (*KEKK_t)(double, double); +typedef double (*KEKp_t)(double, void*); +typedef uint64_t (*UEsvvs_t)(void*, void, void, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(cacosf, UEs_t) \ + GO(cacoshf, UEs_t) \ + GO(casinf, UEs_t) \ + GO(casinhf, UEs_t) \ + GO(catanf, UEs_t) \ + GO(catanhf, UEs_t) \ + GO(ccosf, UEs_t) \ + GO(ccoshf, UEs_t) \ + GO(cexpf, UEs_t) \ + GO(clogf, UEs_t) \ + GO(cprojf, UEs_t) \ + GO(csinf, UEs_t) \ + GO(csinhf, UEs_t) \ + GO(csqrtf, UEs_t) \ + GO(ctanf, UEs_t) \ + GO(ctanhf, UEs_t) \ + GO(__acosf_finite, fEf_t) \ + GO(__acoshf_finite, fEf_t) \ + GO(__asinf_finite, fEf_t) \ + GO(__coshf_finite, fEf_t) \ + GO(__exp2f_finite, fEf_t) \ + GO(__expf_finite, fEf_t) \ + GO(__log10f_finite, fEf_t) \ + GO(__log2f_finite, fEf_t) \ + GO(__logf_finite, fEf_t) \ + GO(__sinhf_finite, fEf_t) \ + GO(__sqrtf_finite, fEf_t) \ + GO(__acos_finite, dEd_t) \ + GO(__acosh_finite, dEd_t) \ + GO(__asin_finite, dEd_t) \ + GO(__cosh_finite, dEd_t) \ + GO(__exp2_finite, dEd_t) \ + GO(__exp_finite, dEd_t) \ + GO(__log10_finite, dEd_t) \ + GO(__log2_finite, dEd_t) \ + GO(__log_finite, dEd_t) \ + GO(__sinh_finite, dEd_t) \ + GO(__sqrt_finite, dEd_t) \ + GO(pow10l, DED_t) \ + GO(acoshl, KEK_t) \ + GO(acosl, KEK_t) \ + GO(asinhl, KEK_t) \ + GO(asinl, KEK_t) \ + GO(atanhl, KEK_t) \ + GO(cbrtl, KEK_t) \ + GO(erfcl, KEK_t) \ + GO(erfl, KEK_t) \ + GO(ldexpl, KEK_t) \ + GO(lgammal, KEK_t) \ + GO(logl, KEK_t) \ + GO(pow10l, KEK_t) \ + GO(tgammal, KEK_t) \ + GO(__atan2f_finite, fEff_t) \ + GO(__hypotf_finite, fEff_t) \ + GO(__powf_finite, fEff_t) \ + GO(__atan2_finite, dEdd_t) \ + GO(__hypot_finite, dEdd_t) \ + GO(__pow_finite, dEdd_t) \ + GO(fmodl, KEKK_t) \ + GO(powl, KEKK_t) \ + GO(frexpl, KEKp_t) \ + GO(lgammal_r, KEKp_t) \ + GO(cpowf, UEsvvs_t) + +#endif // __wrappedlibmTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibmundefs32.h b/src/wrapped32/generated/wrappedlibmundefs32.h new file mode 100644 index 0000000..7168794 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibmundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibmUNDEFS32_H_ +#define __wrappedlibmUNDEFS32_H_ + + +#endif // __wrappedlibmUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibpthreaddefs32.h b/src/wrapped32/generated/wrappedlibpthreaddefs32.h new file mode 100644 index 0000000..4f9db3f --- /dev/null +++ b/src/wrapped32/generated/wrappedlibpthreaddefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibpthreadDEFS32_H_ +#define __wrappedlibpthreadDEFS32_H_ + + +#endif // __wrappedlibpthreadDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibpthreadtypes32.h b/src/wrapped32/generated/wrappedlibpthreadtypes32.h new file mode 100644 index 0000000..39fcf66 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibpthreadtypes32.h @@ -0,0 +1,121 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibpthreadTYPES32_H_ +#define __wrappedlibpthreadTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vEv_t)(void); +typedef void (*vEp_t)(void*); +typedef int32_t (*iEv_t)(void); +typedef int32_t (*iEp_t)(void*); +typedef int32_t (*iEh_t)(uintptr_t); +typedef void (*vEpi_t)(void*, int32_t); +typedef int32_t (*iEpi_t)(void*, int32_t); +typedef int32_t (*iEpL_t)(void*, uintptr_t); +typedef int32_t (*iEpp_t)(void*, void*); +typedef int32_t (*iEhi_t)(uintptr_t, int32_t); +typedef int32_t (*iEhp_t)(uintptr_t, void*); +typedef int32_t (*iEprLL__t)(void*, struct_LL_t*); +typedef void (*vEppp_t)(void*, void*, void*); +typedef int32_t (*iEpiu_t)(void*, int32_t, uint32_t); +typedef int32_t (*iEpup_t)(void*, uint32_t, void*); +typedef int32_t (*iEppL_t)(void*, void*, uintptr_t); +typedef int32_t (*iEppp_t)(void*, void*, void*); +typedef int32_t (*iEhup_t)(uintptr_t, uint32_t, void*); +typedef void* (*pEpOM_t)(void*, int32_t, ...); +typedef int32_t (*iEpprLL__t)(void*, void*, struct_LL_t*); +typedef int32_t (*iEBh_ppp_t)(struct_h_t*, void*, void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(__pthread_initialize, vEv_t) \ + GO(__pthread_register_cancel, vEp_t) \ + GO(__pthread_unregister_cancel, vEp_t) \ + GO(__pthread_unwind_next, vEp_t) \ + GO(pthread_yield, iEv_t) \ + GO(__pthread_mutex_destroy, iEp_t) \ + GO(__pthread_mutex_lock, iEp_t) \ + GO(__pthread_mutex_trylock, iEp_t) \ + GO(__pthread_mutex_unlock, iEp_t) \ + GO(__pthread_mutexattr_init, iEp_t) \ + GO(pthread_attr_destroy, iEp_t) \ + GO(pthread_attr_init, iEp_t) \ + GO(pthread_cond_broadcast, iEp_t) \ + GO(pthread_cond_broadcast@GLIBC_2.0, iEp_t) \ + GO(pthread_cond_destroy, iEp_t) \ + GO(pthread_cond_destroy@GLIBC_2.0, iEp_t) \ + GO(pthread_cond_signal, iEp_t) \ + GO(pthread_cond_signal@GLIBC_2.0, iEp_t) \ + GO(pthread_mutex_destroy, iEp_t) \ + GO(pthread_mutex_lock, iEp_t) \ + GO(pthread_mutex_trylock, iEp_t) \ + GO(pthread_mutex_unlock, iEp_t) \ + GO(pthread_mutexattr_init, iEp_t) \ + GO(pthread_rwlock_destroy, iEp_t) \ + GO(pthread_rwlock_unlock, iEp_t) \ + GO(pthread_rwlock_wrlock, iEp_t) \ + GO(sem_close, iEp_t) \ + GO(sem_destroy, iEp_t) \ + GO(sem_post, iEp_t) \ + GO(sem_trywait, iEp_t) \ + GO(sem_wait, iEp_t) \ + GO(pthread_detach, iEh_t) \ + GO(_pthread_cleanup_pop, vEpi_t) \ + GO(_pthread_cleanup_pop_restore, vEpi_t) \ + GO(pthread_attr_setdetachstate, iEpi_t) \ + GO(pthread_attr_setinheritsched, iEpi_t) \ + GO(pthread_attr_setschedpolicy, iEpi_t) \ + GO(pthread_attr_setscope, iEpi_t) \ + GO(pthread_mutexattr_setkind_np, iEpi_t) \ + GO(pthread_attr_setguardsize, iEpL_t) \ + GO(pthread_attr_setstacksize, iEpL_t) \ + GO(__pthread_key_create, iEpp_t) \ + GO(__pthread_mutex_init, iEpp_t) \ + GO(__pthread_once, iEpp_t) \ + GO(__pthread_rwlock_init, iEpp_t) \ + GO(pthread_attr_getdetachstate, iEpp_t) \ + GO(pthread_attr_getguardsize, iEpp_t) \ + GO(pthread_attr_getinheritsched, iEpp_t) \ + GO(pthread_attr_getschedparam, iEpp_t) \ + GO(pthread_attr_getschedpolicy, iEpp_t) \ + GO(pthread_attr_getscope, iEpp_t) \ + GO(pthread_attr_getstackaddr, iEpp_t) \ + GO(pthread_attr_getstacksize, iEpp_t) \ + GO(pthread_attr_setschedparam, iEpp_t) \ + GO(pthread_attr_setstackaddr, iEpp_t) \ + GO(pthread_cond_init, iEpp_t) \ + GO(pthread_cond_init@GLIBC_2.0, iEpp_t) \ + GO(pthread_cond_wait, iEpp_t) \ + GO(pthread_cond_wait@GLIBC_2.0, iEpp_t) \ + GO(pthread_key_create, iEpp_t) \ + GO(pthread_mutex_init, iEpp_t) \ + GO(pthread_mutex_timedlock, iEpp_t) \ + GO(pthread_once, iEpp_t) \ + GO(pthread_rwlock_init, iEpp_t) \ + GO(sem_getvalue, iEpp_t) \ + GO(pthread_kill, iEhi_t) \ + GO(pthread_kill@GLIBC_2.0, iEhi_t) \ + GO(pthread_getattr_np, iEhp_t) \ + GO(sem_timedwait, iEprLL__t) \ + GO(_pthread_cleanup_push, vEppp_t) \ + GO(_pthread_cleanup_push_defer, vEppp_t) \ + GO(sem_init, iEpiu_t) \ + GO(pthread_attr_setaffinity_np, iEpup_t) \ + GO(pthread_attr_setstack, iEppL_t) \ + GO(__pthread_atfork, iEppp_t) \ + GO(pthread_atfork, iEppp_t) \ + GO(pthread_attr_getstack, iEppp_t) \ + GO(pthread_getaffinity_np, iEhup_t) \ + GO(pthread_setaffinity_np, iEhup_t) \ + GO(sem_open, pEpOM_t) \ + GO(pthread_cond_timedwait, iEpprLL__t) \ + GO(pthread_cond_timedwait@GLIBC_2.0, iEpprLL__t) \ + GO(pthread_create, iEBh_ppp_t) + +#endif // __wrappedlibpthreadTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibpthreadundefs32.h b/src/wrapped32/generated/wrappedlibpthreadundefs32.h new file mode 100644 index 0000000..0dfc159 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibpthreadundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibpthreadUNDEFS32_H_ +#define __wrappedlibpthreadUNDEFS32_H_ + + +#endif // __wrappedlibpthreadUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibresolvdefs32.h b/src/wrapped32/generated/wrappedlibresolvdefs32.h new file mode 100644 index 0000000..8846868 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibresolvdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibresolvDEFS32_H_ +#define __wrappedlibresolvDEFS32_H_ + + +#endif // __wrappedlibresolvDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibresolvtypes32.h b/src/wrapped32/generated/wrappedlibresolvtypes32.h new file mode 100644 index 0000000..373a015 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibresolvtypes32.h @@ -0,0 +1,32 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibresolvTYPES32_H_ +#define __wrappedlibresolvTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef int32_t (*iFpip_t)(void*, int32_t, void*); +typedef int32_t (*iFpuip_t)(void*, uint32_t, int32_t, void*); +typedef int32_t (*iEpiipi_t)(void*, int32_t, int32_t, void*, int32_t); +typedef int32_t (*iFpiipi_t)(void*, int32_t, int32_t, void*, int32_t); +typedef int32_t (*iFppppi_t)(void*, void*, void*, void*, int32_t); +typedef int32_t (*iFppiipi_t)(void*, void*, int32_t, int32_t, void*, int32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(ns_initparse, iFpip_t) \ + GO(ns_parserr, iFpuip_t) \ + GO(__res_query, iEpiipi_t) \ + GO(res_query, iEpiipi_t) \ + GO(res_search, iEpiipi_t) \ + GO(__res_search, iFpiipi_t) \ + GO(__dn_expand, iFppppi_t) \ + GO(__res_nquery, iFppiipi_t) \ + GO(__res_nsearch, iFppiipi_t) + +#endif // __wrappedlibresolvTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibresolvundefs32.h b/src/wrapped32/generated/wrappedlibresolvundefs32.h new file mode 100644 index 0000000..1d11ace --- /dev/null +++ b/src/wrapped32/generated/wrappedlibresolvundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibresolvUNDEFS32_H_ +#define __wrappedlibresolvUNDEFS32_H_ + + +#endif // __wrappedlibresolvUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibrtdefs32.h b/src/wrapped32/generated/wrappedlibrtdefs32.h new file mode 100644 index 0000000..f812f2e --- /dev/null +++ b/src/wrapped32/generated/wrappedlibrtdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibrtDEFS32_H_ +#define __wrappedlibrtDEFS32_H_ + + +#endif // __wrappedlibrtDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibrttypes32.h b/src/wrapped32/generated/wrappedlibrttypes32.h new file mode 100644 index 0000000..9b2e8e9 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibrttypes32.h @@ -0,0 +1,22 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibrtTYPES32_H_ +#define __wrappedlibrtTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef int32_t (*iEup_t)(uint32_t, void*); +typedef int32_t (*iEuBLL__t)(uint32_t, struct_LL_t*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(__clock_getres64, iEup_t) \ + GO(__clock_gettime64, iEup_t) \ + GO(__clock_gettime, iEuBLL__t) + +#endif // __wrappedlibrtTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibrtundefs32.h b/src/wrapped32/generated/wrappedlibrtundefs32.h new file mode 100644 index 0000000..c82749d --- /dev/null +++ b/src/wrapped32/generated/wrappedlibrtundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibrtUNDEFS32_H_ +#define __wrappedlibrtUNDEFS32_H_ + + +#endif // __wrappedlibrtUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibuuiddefs32.h b/src/wrapped32/generated/wrappedlibuuiddefs32.h new file mode 100644 index 0000000..d965081 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibuuiddefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibuuidDEFS32_H_ +#define __wrappedlibuuidDEFS32_H_ + + +#endif // __wrappedlibuuidDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibuuidtypes32.h b/src/wrapped32/generated/wrappedlibuuidtypes32.h new file mode 100644 index 0000000..10e237d --- /dev/null +++ b/src/wrapped32/generated/wrappedlibuuidtypes32.h @@ -0,0 +1,17 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibuuidTYPES32_H_ +#define __wrappedlibuuidTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedlibuuidTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibuuidundefs32.h b/src/wrapped32/generated/wrappedlibuuidundefs32.h new file mode 100644 index 0000000..dd05c73 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibuuidundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibuuidUNDEFS32_H_ +#define __wrappedlibuuidUNDEFS32_H_ + + +#endif // __wrappedlibuuidUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibvdpaudefs32.h b/src/wrapped32/generated/wrappedlibvdpaudefs32.h new file mode 100644 index 0000000..78de7a7 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibvdpaudefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibvdpauDEFS32_H_ +#define __wrappedlibvdpauDEFS32_H_ + + +#endif // __wrappedlibvdpauDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibvdpautypes32.h b/src/wrapped32/generated/wrappedlibvdpautypes32.h new file mode 100644 index 0000000..dcc89d0 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibvdpautypes32.h @@ -0,0 +1,19 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibvdpauTYPES32_H_ +#define __wrappedlibvdpauTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(vdp_device_create_x11, iFpipp_t) + +#endif // __wrappedlibvdpauTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibvdpauundefs32.h b/src/wrapped32/generated/wrappedlibvdpauundefs32.h new file mode 100644 index 0000000..9714977 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibvdpauundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibvdpauUNDEFS32_H_ +#define __wrappedlibvdpauUNDEFS32_H_ + + +#endif // __wrappedlibvdpauUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibx11defs32.h b/src/wrapped32/generated/wrappedlibx11defs32.h new file mode 100644 index 0000000..8328f1d --- /dev/null +++ b/src/wrapped32/generated/wrappedlibx11defs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibx11DEFS32_H_ +#define __wrappedlibx11DEFS32_H_ + + +#endif // __wrappedlibx11DEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibx11types32.h b/src/wrapped32/generated/wrappedlibx11types32.h new file mode 100644 index 0000000..98818ff --- /dev/null +++ b/src/wrapped32/generated/wrappedlibx11types32.h @@ -0,0 +1,223 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibx11TYPES32_H_ +#define __wrappedlibx11TYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFp_t)(void*); +typedef void (*vFX_t)(void*); +typedef int32_t (*iFp_t)(void*); +typedef int32_t (*iEp_t)(void*); +typedef int32_t (*iFX_t)(void*); +typedef uintptr_t (*LFp_t)(void*); +typedef void* (*pFp_t)(void*); +typedef void* (*pFX_t)(void*); +typedef void* (*XFp_t)(void*); +typedef void (*vFXp_t)(void*, void*); +typedef int32_t (*iFpL_t)(void*, uintptr_t); +typedef int32_t (*iFXp_t)(void*, void*); +typedef uintptr_t (*LFpi_t)(void*, int32_t); +typedef void* (*pFiV_t)(int32_t, ...); +typedef void* (*pFpV_t)(void*, ...); +typedef void* (*pFXi_t)(void*, int32_t); +typedef void* (*pFXL_t)(void*, uintptr_t); +typedef void* (*pFXp_t)(void*, void*); +typedef void (*vFpui_t)(void*, uint32_t, int32_t); +typedef void (*vFXLp_t)(void*, uintptr_t, void*); +typedef int32_t (*iFpip_t)(void*, int32_t, void*); +typedef int32_t (*iFppi_t)(void*, void*, int32_t); +typedef int32_t (*iFppp_t)(void*, void*, void*); +typedef int32_t (*iFXip_t)(void*, int32_t, void*); +typedef int32_t (*iFXup_t)(void*, uint32_t, void*); +typedef int32_t (*iFXlp_t)(void*, intptr_t, void*); +typedef int32_t (*iFXLp_t)(void*, uintptr_t, void*); +typedef int32_t (*iFXpp_t)(void*, void*, void*); +typedef uintptr_t (*LFXii_t)(void*, int32_t, int32_t); +typedef void* (*pFXip_t)(void*, int32_t, void*); +typedef void* (*pFXCL_t)(void*, uint8_t, uintptr_t); +typedef void* (*pFXuu_t)(void*, uint32_t, uint32_t); +typedef void (*vFXLpL_t)(void*, uintptr_t, void*, uintptr_t); +typedef int32_t (*iFXLip_t)(void*, uintptr_t, int32_t, void*); +typedef int32_t (*iFXLlp_t)(void*, uintptr_t, intptr_t, void*); +typedef int32_t (*iFXLLp_t)(void*, uintptr_t, uintptr_t, void*); +typedef int32_t (*iFXLpi_t)(void*, uintptr_t, void*, int32_t); +typedef int32_t (*iFXLpp_t)(void*, uintptr_t, void*, void*); +typedef int32_t (*iFXpii_t)(void*, void*, int32_t, int32_t); +typedef int32_t (*iFXppp_t)(void*, void*, void*, void*); +typedef uintptr_t (*LFXLpi_t)(void*, uintptr_t, void*, int32_t); +typedef void* (*pFXCip_t)(void*, uint8_t, int32_t, void*); +typedef void* (*pFXlpp_t)(void*, intptr_t, void*, void*); +typedef void* (*pFXpip_t)(void*, void*, int32_t, void*); +typedef int32_t (*iFXbpLiL_pp_t)(void*, struct_pLiL_t*, void*, void*); +typedef int32_t (*iFppipp_t)(void*, void*, int32_t, void*, void*); +typedef int32_t (*iFXLilp_t)(void*, uintptr_t, int32_t, intptr_t, void*); +typedef int32_t (*iFXLpiL_t)(void*, uintptr_t, void*, int32_t, uintptr_t); +typedef int32_t (*iFXpiip_t)(void*, void*, int32_t, int32_t, void*); +typedef int32_t (*iFXpiup_t)(void*, void*, int32_t, uint32_t, void*); +typedef int32_t (*iFXpppp_t)(void*, void*, void*, void*, void*); +typedef void* (*pFpiiuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t); +typedef void* (*pFXLLLp_t)(void*, uintptr_t, uintptr_t, uintptr_t, void*); +typedef void* (*pFXpppp_t)(void*, void*, void*, void*, void*); +typedef int32_t (*iFpppipp_t)(void*, void*, void*, int32_t, void*, void*); +typedef int32_t (*iFXLpppp_t)(void*, uintptr_t, void*, void*, void*, void*); +typedef int32_t (*iFXppppp_t)(void*, void*, void*, void*, void*, void*); +typedef void (*vFXLpiipi_t)(void*, uintptr_t, void*, int32_t, int32_t, void*, int32_t); +typedef int32_t (*iFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*); +typedef void (*vFXLppiipi_t)(void*, uintptr_t, void*, void*, int32_t, int32_t, void*, int32_t); +typedef int32_t (*iFXLLLiipi_t)(void*, uintptr_t, uintptr_t, uintptr_t, int32_t, int32_t, void*, int32_t); +typedef void* (*pFXLiiuuLi_t)(void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, uintptr_t, int32_t); +typedef void (*vFXLpppippp_t)(void*, uintptr_t, void*, void*, void*, int32_t, void*, void*, void*); +typedef int32_t (*iFppippippp_t)(void*, void*, int32_t, void*, void*, int32_t, void*, void*, void*); +typedef int32_t (*iFXLppiiiiuu_t)(void*, uintptr_t, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); +typedef void* (*pFXpuiipuuii_t)(void*, void*, uint32_t, int32_t, int32_t, void*, uint32_t, uint32_t, int32_t, int32_t); +typedef void* (*pFXLiiuuLipii_t)(void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, uintptr_t, int32_t, void*, int32_t, int32_t); +typedef int32_t (*iFXLLlliLppppp_t)(void*, uintptr_t, uintptr_t, intptr_t, intptr_t, int32_t, uintptr_t, void*, void*, void*, void*, void*); +typedef uintptr_t (*LFXLiiuuuiupLp_t)(void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, int32_t, uint32_t, void*, uintptr_t, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(XFreeStringList, vFp_t) \ + GO(XLockDisplay, vFX_t) \ + GO(XContextDependentDrawing, iFp_t) \ + GO(XContextualDrawing, iFp_t) \ + GO(XDestroyImage, iFp_t) \ + GO(XDirectionalDependentDrawing, iFp_t) \ + GO(XFreeExtensionList, iFp_t) \ + GO(XFreeFontNames, iFp_t) \ + GO(XFreeModifiermap, iFp_t) \ + GO(XInitImage, iFp_t) \ + GO(XRefreshKeyboardMapping, iFp_t) \ + GO(XScreenNumberOfScreen, iFp_t) \ + GO(_XInitImageFuncPtrs, iFp_t) \ + GO(XkbRefreshKeyboardMapping, iEp_t) \ + GO(XCloseDisplay, iFX_t) \ + GO(XGrabServer, iFX_t) \ + GO(XVisualIDFromVisual, LFp_t) \ + GO(XBaseFontNameListOfFontSet, pFp_t) \ + GO(XExtentsOfFontSet, pFp_t) \ + GO(XLocaleOfFontSet, pFp_t) \ + GO(XSetErrorHandler, pFp_t) \ + GO(XSetIOErrorHandler, pFp_t) \ + GO(XGetModifierMapping, pFX_t) \ + GO(XOpenDisplay, XFp_t) \ + GO(XFreeEventData, vFXp_t) \ + GO(XFreeFontSet, vFXp_t) \ + GO(_XDeqAsyncHandler, vFXp_t) \ + GO(XFilterEvent, iFpL_t) \ + GO(XFreeFont, iFXp_t) \ + GO(XGetEventData, iFXp_t) \ + GO(XNextEvent, iFXp_t) \ + GO(XPeekEvent, iFXp_t) \ + GO(XPutBackEvent, iFXp_t) \ + GO(XLookupKeysym, LFpi_t) \ + GO(XVaCreateNestedList, pFiV_t) \ + GO(XCreateIC, pFpV_t) \ + GO(XGetICValues, pFpV_t) \ + GO(XGetIMValues, pFpV_t) \ + GO(XSetICValues, pFpV_t) \ + GO(XSetIMValues, pFpV_t) \ + GO(XSynchronize, pFXi_t) \ + GO(XGetWMHints, pFXL_t) \ + GO(XQueryFont, pFXL_t) \ + GO(XListExtensions, pFXp_t) \ + GO(XLoadQueryFont, pFXp_t) \ + GO(XkbFreeKeyboard, vFpui_t) \ + GO(XSetWMNormalHints, vFXLp_t) \ + GO(XStringListToTextProperty, iFpip_t) \ + GO(XFreeFontInfo, iFppi_t) \ + GO(XTextWidth, iFppi_t) \ + GO(XTextWidth16, iFppi_t) \ + GO(XmbTextEscapement, iFppi_t) \ + GO(Xutf8TextEscapement, iFppi_t) \ + GO(XwcTextEscapement, iFppi_t) \ + GO(XFontsOfFontSet, iFppp_t) \ + GO(XCheckTypedEvent, iFXip_t) \ + GO(XkbGetNames, iFXup_t) \ + GO(XkbGetUpdatedMap, iFXup_t) \ + GO(XCheckMaskEvent, iFXlp_t) \ + GO(XMaskEvent, iFXlp_t) \ + GO(XGetWindowAttributes, iFXLp_t) \ + GO(XSetWMHints, iFXLp_t) \ + GO(XkbGetControls, iFXLp_t) \ + GO(XAddConnectionWatch, iFXpp_t) \ + GO(XGetPixel, LFXii_t) \ + GO(XESetCloseDisplay, pFXip_t) \ + GO(XESetEventToWire, pFXip_t) \ + GO(XESetWireToEvent, pFXip_t) \ + GO(_XGetRequest, pFXCL_t) \ + GO(XkbGetMap, pFXuu_t) \ + GO(XSetWMSizeHints, vFXLpL_t) \ + GO(XCheckTypedWindowEvent, iFXLip_t) \ + GO(XCheckWindowEvent, iFXLlp_t) \ + GO(XWindowEvent, iFXLlp_t) \ + GO(XChangeWindowAttributes, iFXLLp_t) \ + GO(XQueryColors, iFXLpi_t) \ + GO(XSetWMProtocols, iFXLpi_t) \ + GO(XStoreColors, iFXLpi_t) \ + GO(XGetWMColormapWindows, iFXLpp_t) \ + GO(XGetWMNormalHints, iFXLpp_t) \ + GO(XGetWMProtocols, iFXLpp_t) \ + GO(_XReply, iFXpii_t) \ + GO(XCheckIfEvent, iFXppp_t) \ + GO(XIfEvent, iFXppp_t) \ + GO(XPeekIfEvent, iFXppp_t) \ + GO(XCreateColormap, LFXLpi_t) \ + GO(XGetKeyboardMapping, pFXCip_t) \ + GO(XGetVisualInfo, pFXlpp_t) \ + GO(XListFonts, pFXpip_t) \ + GO(XmbTextPropertyToTextList, iFXbpLiL_pp_t) \ + GO(Xutf8TextPropertyToTextList, iFXbpLiL_pp_t) \ + GO(XwcTextPropertyToTextList, iFXbpLiL_pp_t) \ + GO(XLookupString, iFppipp_t) \ + GO(XmbTextExtents, iFppipp_t) \ + GO(Xutf8TextExtents, iFppipp_t) \ + GO(XwcTextExtents, iFppipp_t) \ + GO(XSendEvent, iFXLilp_t) \ + GO(XFreeColors, iFXLpiL_t) \ + GO(XInternAtoms, iFXpiip_t) \ + GO(XmbTextListToTextProperty, iFXpiup_t) \ + GO(Xutf8TextListToTextProperty, iFXpiup_t) \ + GO(XwcTextListToTextProperty, iFXpiup_t) \ + GO(XQueryExtension, iFXpppp_t) \ + GO(XSubImage, pFpiiuu_t) \ + GO(XGetMotionEvents, pFXLLLp_t) \ + GO(XCreateFontSet, pFXpppp_t) \ + GO(XmbLookupString, iFpppipp_t) \ + GO(Xutf8LookupString, iFpppipp_t) \ + GO(XwcLookupString, iFpppipp_t) \ + GO(XQueryTree, iFXLpppp_t) \ + GO(XRegisterIMInstantiateCallback, iFXppppp_t) \ + GO(XUnregisterIMInstantiateCallback, iFXppppp_t) \ + GO(XkbQueryExtension, iFXppppp_t) \ + GO(XmbDrawText, vFXLpiipi_t) \ + GO(Xutf8DrawText, vFXLpiipi_t) \ + GO(XwcDrawText, vFXLpiipi_t) \ + GO(XTextExtents, iFppipppp_t) \ + GO(XTextExtents16, iFppipppp_t) \ + GO(XmbDrawImageString, vFXLppiipi_t) \ + GO(XmbDrawString, vFXLppiipi_t) \ + GO(Xutf8DrawImageString, vFXLppiipi_t) \ + GO(Xutf8DrawString, vFXLppiipi_t) \ + GO(XwcDrawImageString, vFXLppiipi_t) \ + GO(XwcDrawString, vFXLppiipi_t) \ + GO(XChangeProperty, iFXLLLiipi_t) \ + GO(XGetImage, pFXLiiuuLi_t) \ + GO(XSetWMProperties, vFXLpppippp_t) \ + GO(XmbSetWMProperties, vFXLpppippp_t) \ + GO(Xutf8SetWMProperties, vFXLpppippp_t) \ + GO(XmbTextPerCharExtents, iFppippippp_t) \ + GO(Xutf8TextPerCharExtents, iFppippippp_t) \ + GO(XwcTextPerCharExtents, iFppippippp_t) \ + GO(XPutImage, iFXLppiiiiuu_t) \ + GO(XCreateImage, pFXpuiipuuii_t) \ + GO(XGetSubImage, pFXLiiuuLipii_t) \ + GO(XGetWindowProperty, iFXLLlliLppppp_t) \ + GO(XCreateWindow, LFXLiiuuuiupLp_t) + +#endif // __wrappedlibx11TYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibx11undefs32.h b/src/wrapped32/generated/wrappedlibx11undefs32.h new file mode 100644 index 0000000..ae79adf --- /dev/null +++ b/src/wrapped32/generated/wrappedlibx11undefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibx11UNDEFS32_H_ +#define __wrappedlibx11UNDEFS32_H_ + + +#endif // __wrappedlibx11UNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibx11xcbdefs32.h b/src/wrapped32/generated/wrappedlibx11xcbdefs32.h new file mode 100644 index 0000000..b5fbf50 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibx11xcbdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibx11xcbDEFS32_H_ +#define __wrappedlibx11xcbDEFS32_H_ + + +#endif // __wrappedlibx11xcbDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibx11xcbtypes32.h b/src/wrapped32/generated/wrappedlibx11xcbtypes32.h new file mode 100644 index 0000000..808653e --- /dev/null +++ b/src/wrapped32/generated/wrappedlibx11xcbtypes32.h @@ -0,0 +1,19 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibx11xcbTYPES32_H_ +#define __wrappedlibx11xcbTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void* (*pFX_t)(void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(XGetXCBConnection, pFX_t) + +#endif // __wrappedlibx11xcbTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibx11xcbundefs32.h b/src/wrapped32/generated/wrappedlibx11xcbundefs32.h new file mode 100644 index 0000000..61d387e --- /dev/null +++ b/src/wrapped32/generated/wrappedlibx11xcbundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibx11xcbUNDEFS32_H_ +#define __wrappedlibx11xcbUNDEFS32_H_ + + +#endif // __wrappedlibx11xcbUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxcbdefs32.h b/src/wrapped32/generated/wrappedlibxcbdefs32.h new file mode 100644 index 0000000..e685a2d --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxcbdefs32.h @@ -0,0 +1,20 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxcbDEFS32_H_ +#define __wrappedlibxcbDEFS32_H_ + +#define ZFEpp pFEppp +#define ZFEpp_32 pFEppp_32 +#define zFEnuu pFEpnuu +#define zFEnuu_32 pFEpnuu_32 +#define zFEnCWp pFEpnCWp +#define zFEnCWp_32 pFEpnCWp_32 +#define zFEnCuuuuu pFEpnCuuuuu +#define zFEnCuuuuu_32 pFEpnCuuuuu_32 +#define zFEnCuuuCup pFEpnCuuuCup +#define zFEnCuuuCup_32 pFEpnCuuuCup_32 +#define zFEpnCuuwwWWWWuup pFEppnCuuwwWWWWuup +#define zFEpnCuuwwWWWWuup_32 pFEppnCuuwwWWWWuup_32 + +#endif // __wrappedlibxcbDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxcbresdefs32.h b/src/wrapped32/generated/wrappedlibxcbresdefs32.h new file mode 100644 index 0000000..c73534c --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxcbresdefs32.h @@ -0,0 +1,12 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxcbresDEFS32_H_ +#define __wrappedlibxcbresDEFS32_H_ + +#define ZFEp pFEpp +#define ZFEp_32 pFEpp_32 +#define zFEnup pFEpnup +#define zFEnup_32 pFEpnup_32 + +#endif // __wrappedlibxcbresDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxcbrestypes32.h b/src/wrapped32/generated/wrappedlibxcbrestypes32.h new file mode 100644 index 0000000..024594d --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxcbrestypes32.h @@ -0,0 +1,19 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxcbresTYPES32_H_ +#define __wrappedlibxcbresTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef my_xcb_XXX_iterator_t (*ZFp_t)(void*); +typedef my_xcb_cookie_t (*zFnup_t)(void*, uint32_t, void*); + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedlibxcbresTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibxcbresundefs32.h b/src/wrapped32/generated/wrappedlibxcbresundefs32.h new file mode 100644 index 0000000..d82e56e --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxcbresundefs32.h @@ -0,0 +1,12 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxcbresUNDEFS32_H_ +#define __wrappedlibxcbresUNDEFS32_H_ + +#undef ZFEp +#undef ZFEp_32 +#undef zFEnup +#undef zFEnup_32 + +#endif // __wrappedlibxcbresUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxcbtypes32.h b/src/wrapped32/generated/wrappedlibxcbtypes32.h new file mode 100644 index 0000000..925d2a3 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxcbtypes32.h @@ -0,0 +1,27 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxcbTYPES32_H_ +#define __wrappedlibxcbTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFp_t)(void*); +typedef void* (*pFpp_t)(void*, void*); +typedef my_xcb_XXX_iterator_t (*ZFpp_t)(void*, void*); +typedef my_xcb_cookie_t (*zFnuu_t)(void*, uint32_t, uint32_t); +typedef my_xcb_cookie_t (*zFnCWp_t)(void*, uint8_t, uint16_t, void*); +typedef my_xcb_cookie_t (*zFnCuuuuu_t)(void*, uint8_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef my_xcb_cookie_t (*zFnCuuuCup_t)(void*, uint8_t, uint32_t, uint32_t, uint32_t, uint8_t, uint32_t, void*); +typedef my_xcb_cookie_t (*zFpnCuuwwWWWWuup_t)(void*, void*, uint8_t, uint32_t, uint32_t, int16_t, int16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint32_t, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(xcb_disconnect, vFp_t) \ + GO(xcb_connect, pFpp_t) + +#endif // __wrappedlibxcbTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibxcbundefs32.h b/src/wrapped32/generated/wrappedlibxcbundefs32.h new file mode 100644 index 0000000..060385b --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxcbundefs32.h @@ -0,0 +1,20 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxcbUNDEFS32_H_ +#define __wrappedlibxcbUNDEFS32_H_ + +#undef ZFEpp +#undef ZFEpp_32 +#undef zFEnuu +#undef zFEnuu_32 +#undef zFEnCWp +#undef zFEnCWp_32 +#undef zFEnCuuuuu +#undef zFEnCuuuuu_32 +#undef zFEnCuuuCup +#undef zFEnCuuuCup_32 +#undef zFEpnCuuwwWWWWuup +#undef zFEpnCuuwwWWWWuup_32 + +#endif // __wrappedlibxcbUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxcompositedefs32.h b/src/wrapped32/generated/wrappedlibxcompositedefs32.h new file mode 100644 index 0000000..599b117 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxcompositedefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxcompositeDEFS32_H_ +#define __wrappedlibxcompositeDEFS32_H_ + + +#endif // __wrappedlibxcompositeDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxcompositetypes32.h b/src/wrapped32/generated/wrappedlibxcompositetypes32.h new file mode 100644 index 0000000..d5d4287 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxcompositetypes32.h @@ -0,0 +1,17 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxcompositeTYPES32_H_ +#define __wrappedlibxcompositeTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedlibxcompositeTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibxcompositeundefs32.h b/src/wrapped32/generated/wrappedlibxcompositeundefs32.h new file mode 100644 index 0000000..f8fade0 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxcompositeundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxcompositeUNDEFS32_H_ +#define __wrappedlibxcompositeUNDEFS32_H_ + + +#endif // __wrappedlibxcompositeUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxcursordefs32.h b/src/wrapped32/generated/wrappedlibxcursordefs32.h new file mode 100644 index 0000000..e822bef --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxcursordefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxcursorDEFS32_H_ +#define __wrappedlibxcursorDEFS32_H_ + + +#endif // __wrappedlibxcursorDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxcursortypes32.h b/src/wrapped32/generated/wrappedlibxcursortypes32.h new file mode 100644 index 0000000..0f5ab7e --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxcursortypes32.h @@ -0,0 +1,36 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxcursorTYPES32_H_ +#define __wrappedlibxcursorTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFp_t)(void*); +typedef void* (*pFi_t)(int32_t); +typedef uintptr_t (*LFXp_t)(void*, void*); +typedef void* (*pFii_t)(int32_t, int32_t); +typedef void* (*pFXi_t)(void*, int32_t); +typedef void* (*pFXp_t)(void*, void*); +typedef void* (*pFupi_t)(uint32_t, void*, int32_t); +typedef void* (*pFppi_t)(void*, void*, int32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(XcursorCursorsDestroy, vFp_t) \ + GO(XcursorImageDestroy, vFp_t) \ + GO(XcursorImagesDestroy, vFp_t) \ + GO(XcursorImagesCreate, pFi_t) \ + GO(XcursorImageLoadCursor, LFXp_t) \ + GO(XcursorImagesLoadCursor, LFXp_t) \ + GO(XcursorImageCreate, pFii_t) \ + GO(XcursorCursorsCreate, pFXi_t) \ + GO(XcursorImagesLoadCursors, pFXp_t) \ + GO(XcursorShapeLoadImages, pFupi_t) \ + GO(XcursorLibraryLoadImages, pFppi_t) + +#endif // __wrappedlibxcursorTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibxcursorundefs32.h b/src/wrapped32/generated/wrappedlibxcursorundefs32.h new file mode 100644 index 0000000..7ae3f43 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxcursorundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxcursorUNDEFS32_H_ +#define __wrappedlibxcursorUNDEFS32_H_ + + +#endif // __wrappedlibxcursorUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxdamagedefs32.h b/src/wrapped32/generated/wrappedlibxdamagedefs32.h new file mode 100644 index 0000000..d2231de --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxdamagedefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxdamageDEFS32_H_ +#define __wrappedlibxdamageDEFS32_H_ + + +#endif // __wrappedlibxdamageDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxdamagetypes32.h b/src/wrapped32/generated/wrappedlibxdamagetypes32.h new file mode 100644 index 0000000..57c9932 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxdamagetypes32.h @@ -0,0 +1,17 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxdamageTYPES32_H_ +#define __wrappedlibxdamageTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedlibxdamageTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibxdamageundefs32.h b/src/wrapped32/generated/wrappedlibxdamageundefs32.h new file mode 100644 index 0000000..a1baf95 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxdamageundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxdamageUNDEFS32_H_ +#define __wrappedlibxdamageUNDEFS32_H_ + + +#endif // __wrappedlibxdamageUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxextdefs32.h b/src/wrapped32/generated/wrappedlibxextdefs32.h new file mode 100644 index 0000000..459b2b4 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxextdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxextDEFS32_H_ +#define __wrappedlibxextDEFS32_H_ + + +#endif // __wrappedlibxextDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxexttypes32.h b/src/wrapped32/generated/wrappedlibxexttypes32.h new file mode 100644 index 0000000..ef459e2 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxexttypes32.h @@ -0,0 +1,43 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxextTYPES32_H_ +#define __wrappedlibxextTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFp_t)(void*); +typedef void* (*pFv_t)(void); +typedef void* (*pFp_t)(void*); +typedef int32_t (*iFpX_t)(void*, void*); +typedef int32_t (*iFXp_t)(void*, void*); +typedef void* (*pFpX_t)(void*, void*); +typedef void* (*pFXpp_t)(void*, void*, void*); +typedef int32_t (*iFXLpiiL_t)(void*, uintptr_t, void*, int32_t, int32_t, uintptr_t); +typedef void* (*pFpXppip_t)(void*, void*, void*, void*, int32_t, void*); +typedef uintptr_t (*LFXLppuuu_t)(void*, uintptr_t, void*, void*, uint32_t, uint32_t, uint32_t); +typedef void* (*pFXbpLiLLLii_uippuu_t)(void*, struct_pLiLLLii_t*, uint32_t, int32_t, void*, void*, uint32_t, uint32_t); +typedef int32_t (*iFXLppiiiiuui_t)(void*, uintptr_t, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(XdbeFreeVisualInfo, vFp_t) \ + GO(XextDestroyExtension, vFp_t) \ + GO(XextCreateExtension, pFv_t) \ + GO(XSetExtensionErrorHandler, pFp_t) \ + GO(XextRemoveDisplay, iFpX_t) \ + GO(XShmAttach, iFXp_t) \ + GO(XShmDetach, iFXp_t) \ + GO(XextFindDisplay, pFpX_t) \ + GO(XdbeGetVisualInfo, pFXpp_t) \ + GO(XShmGetImage, iFXLpiiL_t) \ + GO(XextAddDisplay, pFpXppip_t) \ + GO(XShmCreatePixmap, LFXLppuuu_t) \ + GO(XShmCreateImage, pFXbpLiLLLii_uippuu_t) \ + GO(XShmPutImage, iFXLppiiiiuui_t) + +#endif // __wrappedlibxextTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibxextundefs32.h b/src/wrapped32/generated/wrappedlibxextundefs32.h new file mode 100644 index 0000000..e7f1599 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxextundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxextUNDEFS32_H_ +#define __wrappedlibxextUNDEFS32_H_ + + +#endif // __wrappedlibxextUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxfixesdefs32.h b/src/wrapped32/generated/wrappedlibxfixesdefs32.h new file mode 100644 index 0000000..9216f73 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxfixesdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxfixesDEFS32_H_ +#define __wrappedlibxfixesDEFS32_H_ + + +#endif // __wrappedlibxfixesDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxfixestypes32.h b/src/wrapped32/generated/wrappedlibxfixestypes32.h new file mode 100644 index 0000000..aa9eeb3 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxfixestypes32.h @@ -0,0 +1,21 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxfixesTYPES32_H_ +#define __wrappedlibxfixesTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void* (*pFX_t)(void*); +typedef int32_t (*iFXpp_t)(void*, void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(XFixesGetCursorImage, pFX_t) \ + GO(XFixesQueryExtension, iFXpp_t) + +#endif // __wrappedlibxfixesTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibxfixesundefs32.h b/src/wrapped32/generated/wrappedlibxfixesundefs32.h new file mode 100644 index 0000000..2cb82d4 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxfixesundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxfixesUNDEFS32_H_ +#define __wrappedlibxfixesUNDEFS32_H_ + + +#endif // __wrappedlibxfixesUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxidefs32.h b/src/wrapped32/generated/wrappedlibxidefs32.h new file mode 100644 index 0000000..de50f73 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxidefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxiDEFS32_H_ +#define __wrappedlibxiDEFS32_H_ + + +#endif // __wrappedlibxiDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxitypes32.h b/src/wrapped32/generated/wrappedlibxitypes32.h new file mode 100644 index 0000000..a39bd1e --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxitypes32.h @@ -0,0 +1,41 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxiTYPES32_H_ +#define __wrappedlibxiTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFp_t)(void*); +typedef int32_t (*iFXp_t)(void*, void*); +typedef void* (*pFXL_t)(void*, uintptr_t); +typedef void* (*pFXp_t)(void*, void*); +typedef void* (*pFXip_t)(void*, int32_t, void*); +typedef void* (*pFXLp_t)(void*, uintptr_t, void*); +typedef int32_t (*iFXLpi_t)(void*, uintptr_t, void*, int32_t); +typedef int32_t (*iFXppu_t)(void*, void*, void*, uint32_t); +typedef void* (*pFXpLLppp_t)(void*, void*, uintptr_t, uintptr_t, void*, void*, void*); +typedef int32_t (*iFXpLiipiiL_t)(void*, void*, uintptr_t, int32_t, int32_t, void*, int32_t, int32_t, uintptr_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(XFreeDeviceList, vFp_t) \ + GO(XFreeDeviceMotionEvents, vFp_t) \ + GO(XFreeDeviceState, vFp_t) \ + GO(XIFreeDeviceInfo, vFp_t) \ + GO(XCloseDevice, iFXp_t) \ + GO(XOpenDevice, pFXL_t) \ + GO(XListInputDevices, pFXp_t) \ + GO(XQueryDeviceState, pFXp_t) \ + GO(XIQueryDevice, pFXip_t) \ + GO(XIGetSelectedEvents, pFXLp_t) \ + GO(XISelectEvents, iFXLpi_t) \ + GO(XGetDeviceButtonMapping, iFXppu_t) \ + GO(XGetDeviceMotionEvents, pFXpLLppp_t) \ + GO(XGrabDevice, iFXpLiipiiL_t) + +#endif // __wrappedlibxiTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibxiundefs32.h b/src/wrapped32/generated/wrappedlibxiundefs32.h new file mode 100644 index 0000000..6ae0845 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxiundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxiUNDEFS32_H_ +#define __wrappedlibxiUNDEFS32_H_ + + +#endif // __wrappedlibxiUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxrandrdefs32.h b/src/wrapped32/generated/wrappedlibxrandrdefs32.h new file mode 100644 index 0000000..6d811e6 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxrandrdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxrandrDEFS32_H_ +#define __wrappedlibxrandrDEFS32_H_ + + +#endif // __wrappedlibxrandrDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxrandrtypes32.h b/src/wrapped32/generated/wrappedlibxrandrtypes32.h new file mode 100644 index 0000000..3cdc818 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxrandrtypes32.h @@ -0,0 +1,46 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxrandrTYPES32_H_ +#define __wrappedlibxrandrTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFp_t)(void*); +typedef int32_t (*iFp_t)(void*); +typedef void* (*pFXL_t)(void*, uintptr_t); +typedef int32_t (*iFXLp_t)(void*, uintptr_t, void*); +typedef int32_t (*iFXpp_t)(void*, void*, void*); +typedef void* (*pFXLL_t)(void*, uintptr_t, uintptr_t); +typedef void* (*pFXLp_t)(void*, uintptr_t, void*); +typedef void* (*pFXpL_t)(void*, void*, uintptr_t); +typedef int32_t (*iFXpLp_t)(void*, void*, uintptr_t, void*); +typedef void* (*pFXLip_t)(void*, uintptr_t, int32_t, void*); +typedef int32_t (*iFXpLLiiLWpi_t)(void*, void*, uintptr_t, uintptr_t, int32_t, int32_t, uintptr_t, uint16_t, void*, int32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(XRRFreeMonitors, vFp_t) \ + GO(XRRFreeProviderInfo, vFp_t) \ + GO(XRRFreeProviderResources, vFp_t) \ + GO(XRRUpdateConfiguration, iFp_t) \ + GO(XRRGetProviderResources, pFXL_t) \ + GO(XRRGetScreenResources, pFXL_t) \ + GO(XRRGetScreenResourcesCurrent, pFXL_t) \ + GO(XRRGetCrtcTransform, iFXLp_t) \ + GO(XRRQueryExtension, iFXpp_t) \ + GO(XRRQueryOutputProperty, pFXLL_t) \ + GO(XRRListOutputProperties, pFXLp_t) \ + GO(XRRGetCrtcInfo, pFXpL_t) \ + GO(XRRGetOutputInfo, pFXpL_t) \ + GO(XRRGetPanning, pFXpL_t) \ + GO(XRRGetProviderInfo, pFXpL_t) \ + GO(XRRSetPanning, iFXpLp_t) \ + GO(XRRGetMonitors, pFXLip_t) \ + GO(XRRSetCrtcConfig, iFXpLLiiLWpi_t) + +#endif // __wrappedlibxrandrTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibxrandrundefs32.h b/src/wrapped32/generated/wrappedlibxrandrundefs32.h new file mode 100644 index 0000000..9059dc7 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxrandrundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxrandrUNDEFS32_H_ +#define __wrappedlibxrandrUNDEFS32_H_ + + +#endif // __wrappedlibxrandrUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxrenderdefs32.h b/src/wrapped32/generated/wrappedlibxrenderdefs32.h new file mode 100644 index 0000000..d46f6fa --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxrenderdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxrenderDEFS32_H_ +#define __wrappedlibxrenderDEFS32_H_ + + +#endif // __wrappedlibxrenderDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxrendertypes32.h b/src/wrapped32/generated/wrappedlibxrendertypes32.h new file mode 100644 index 0000000..48853e5 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxrendertypes32.h @@ -0,0 +1,25 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxrenderTYPES32_H_ +#define __wrappedlibxrenderTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void* (*pFXi_t)(void*, int32_t); +typedef void* (*pFXL_t)(void*, uintptr_t); +typedef void* (*pFXp_t)(void*, void*); +typedef void* (*pFXLrLiiwwwwwwwwL_i_t)(void*, uintptr_t, struct_LiiwwwwwwwwL_t*, int32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(XRenderFindStandardFormat, pFXi_t) \ + GO(XRenderQueryFilters, pFXL_t) \ + GO(XRenderFindVisualFormat, pFXp_t) \ + GO(XRenderFindFormat, pFXLrLiiwwwwwwwwL_i_t) + +#endif // __wrappedlibxrenderTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibxrenderundefs32.h b/src/wrapped32/generated/wrappedlibxrenderundefs32.h new file mode 100644 index 0000000..ee38607 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxrenderundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxrenderUNDEFS32_H_ +#define __wrappedlibxrenderUNDEFS32_H_ + + +#endif // __wrappedlibxrenderUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxssdefs32.h b/src/wrapped32/generated/wrappedlibxssdefs32.h new file mode 100644 index 0000000..38a3d5b --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxssdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxssDEFS32_H_ +#define __wrappedlibxssDEFS32_H_ + + +#endif // __wrappedlibxssDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxsstypes32.h b/src/wrapped32/generated/wrappedlibxsstypes32.h new file mode 100644 index 0000000..d1fdc5b --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxsstypes32.h @@ -0,0 +1,17 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxssTYPES32_H_ +#define __wrappedlibxssTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedlibxssTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibxssundefs32.h b/src/wrapped32/generated/wrappedlibxssundefs32.h new file mode 100644 index 0000000..5ecfd68 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxssundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxssUNDEFS32_H_ +#define __wrappedlibxssUNDEFS32_H_ + + +#endif // __wrappedlibxssUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxxf86vmdefs32.h b/src/wrapped32/generated/wrappedlibxxf86vmdefs32.h new file mode 100644 index 0000000..a58bfac --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxxf86vmdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxxf86vmDEFS32_H_ +#define __wrappedlibxxf86vmDEFS32_H_ + + +#endif // __wrappedlibxxf86vmDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedlibxxf86vmtypes32.h b/src/wrapped32/generated/wrappedlibxxf86vmtypes32.h new file mode 100644 index 0000000..2611329 --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxxf86vmtypes32.h @@ -0,0 +1,19 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxxf86vmTYPES32_H_ +#define __wrappedlibxxf86vmTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef int32_t (*iFXipp_t)(void*, int32_t, void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(XF86VidModeGetAllModeLines, iFXipp_t) + +#endif // __wrappedlibxxf86vmTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedlibxxf86vmundefs32.h b/src/wrapped32/generated/wrappedlibxxf86vmundefs32.h new file mode 100644 index 0000000..cde7bec --- /dev/null +++ b/src/wrapped32/generated/wrappedlibxxf86vmundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedlibxxf86vmUNDEFS32_H_ +#define __wrappedlibxxf86vmUNDEFS32_H_ + + +#endif // __wrappedlibxxf86vmUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedmountdefs32.h b/src/wrapped32/generated/wrappedmountdefs32.h new file mode 100644 index 0000000..e7d8659 --- /dev/null +++ b/src/wrapped32/generated/wrappedmountdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedmountDEFS32_H_ +#define __wrappedmountDEFS32_H_ + + +#endif // __wrappedmountDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedmounttypes32.h b/src/wrapped32/generated/wrappedmounttypes32.h new file mode 100644 index 0000000..3e6a47a --- /dev/null +++ b/src/wrapped32/generated/wrappedmounttypes32.h @@ -0,0 +1,23 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedmountTYPES32_H_ +#define __wrappedmountTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void* (*pFi_t)(int32_t); +typedef int32_t (*iFpip_t)(void*, int32_t, void*); +typedef int32_t (*iFpbL_p_t)(void*, struct_L_t*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(mnt_get_builtin_optmap, pFi_t) \ + GO(mnt_table_uniq_fs, iFpip_t) \ + GO(mnt_optstr_get_flags, iFpbL_p_t) + +#endif // __wrappedmountTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedmountundefs32.h b/src/wrapped32/generated/wrappedmountundefs32.h new file mode 100644 index 0000000..f57fc6a --- /dev/null +++ b/src/wrapped32/generated/wrappedmountundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedmountUNDEFS32_H_ +#define __wrappedmountUNDEFS32_H_ + + +#endif // __wrappedmountUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappednsldefs32.h b/src/wrapped32/generated/wrappednsldefs32.h new file mode 100644 index 0000000..85423d6 --- /dev/null +++ b/src/wrapped32/generated/wrappednsldefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappednslDEFS32_H_ +#define __wrappednslDEFS32_H_ + + +#endif // __wrappednslDEFS32_H_ diff --git a/src/wrapped32/generated/wrappednsltypes32.h b/src/wrapped32/generated/wrappednsltypes32.h new file mode 100644 index 0000000..264bccc --- /dev/null +++ b/src/wrapped32/generated/wrappednsltypes32.h @@ -0,0 +1,17 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappednslTYPES32_H_ +#define __wrappednslTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappednslTYPES32_H_ diff --git a/src/wrapped32/generated/wrappednslundefs32.h b/src/wrapped32/generated/wrappednslundefs32.h new file mode 100644 index 0000000..a76d47d --- /dev/null +++ b/src/wrapped32/generated/wrappednslundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappednslUNDEFS32_H_ +#define __wrappednslUNDEFS32_H_ + + +#endif // __wrappednslUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedopenaldefs32.h b/src/wrapped32/generated/wrappedopenaldefs32.h new file mode 100644 index 0000000..3a93560 --- /dev/null +++ b/src/wrapped32/generated/wrappedopenaldefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedopenalDEFS32_H_ +#define __wrappedopenalDEFS32_H_ + + +#endif // __wrappedopenalDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedopenaltypes32.h b/src/wrapped32/generated/wrappedopenaltypes32.h new file mode 100644 index 0000000..7ebb634 --- /dev/null +++ b/src/wrapped32/generated/wrappedopenaltypes32.h @@ -0,0 +1,25 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedopenalTYPES32_H_ +#define __wrappedopenalTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFv_t)(void); +typedef void* (*pFp_t)(void*); +typedef void* (*pFpp_t)(void*, void*); +typedef void (*vFiiipp_t)(int32_t, int32_t, int32_t, void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(alRequestFoldbackStop, vFv_t) \ + GO(alGetProcAddress, pFp_t) \ + GO(alcGetProcAddress, pFpp_t) \ + GO(alRequestFoldbackStart, vFiiipp_t) + +#endif // __wrappedopenalTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedopenalundefs32.h b/src/wrapped32/generated/wrappedopenalundefs32.h new file mode 100644 index 0000000..4d2b0c2 --- /dev/null +++ b/src/wrapped32/generated/wrappedopenalundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedopenalUNDEFS32_H_ +#define __wrappedopenalUNDEFS32_H_ + + +#endif // __wrappedopenalUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedsdl1defs32.h b/src/wrapped32/generated/wrappedsdl1defs32.h new file mode 100644 index 0000000..d02a838 --- /dev/null +++ b/src/wrapped32/generated/wrappedsdl1defs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedsdl1DEFS32_H_ +#define __wrappedsdl1DEFS32_H_ + + +#endif // __wrappedsdl1DEFS32_H_ diff --git a/src/wrapped32/generated/wrappedsdl1types32.h b/src/wrapped32/generated/wrappedsdl1types32.h new file mode 100644 index 0000000..ae4cfa6 --- /dev/null +++ b/src/wrapped32/generated/wrappedsdl1types32.h @@ -0,0 +1,79 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedsdl1TYPES32_H_ +#define __wrappedsdl1TYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFv_t)(void); +typedef void (*vFp_t)(void*); +typedef int32_t (*iFv_t)(void); +typedef int32_t (*iFp_t)(void*); +typedef uint32_t (*uFp_t)(void*); +typedef void* (*pFv_t)(void); +typedef void* (*pFp_t)(void*); +typedef void (*vFpp_t)(void*, void*); +typedef int32_t (*iFup_t)(uint32_t, void*); +typedef int32_t (*iFpp_t)(void*, void*); +typedef void* (*pFpi_t)(void*, int32_t); +typedef void* (*pFpu_t)(void*, uint32_t); +typedef void* (*pFpp_t)(void*, void*); +typedef int32_t (*iFpuu_t)(void*, uint32_t, uint32_t); +typedef void* (*pFupp_t)(uint32_t, void*, void*); +typedef int32_t (*iFpiuu_t)(void*, int32_t, uint32_t, uint32_t); +typedef uint32_t (*uFpCCC_t)(void*, uint8_t, uint8_t, uint8_t); +typedef void* (*pFiiiu_t)(int32_t, int32_t, int32_t, uint32_t); +typedef void (*vFupppp_t)(uint32_t, void*, void*, void*, void*); +typedef int32_t (*iFpWCiWCi_t)(void*, uint16_t, uint8_t, int32_t, uint16_t, uint8_t, int32_t); +typedef void* (*pFpiiiiuuuu_t)(void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(SDL_Quit, vFv_t) \ + GO(SDL_FreeSurface, vFp_t) \ + GO(SDL_KillThread, vFp_t) \ + GO(SDL_UnloadObject, vFp_t) \ + GO(SDL_UnlockSurface, vFp_t) \ + GO(SDL_Has3DNow, iFv_t) \ + GO(SDL_Has3DNowExt, iFv_t) \ + GO(SDL_HasAltiVec, iFv_t) \ + GO(SDL_HasMMX, iFv_t) \ + GO(SDL_HasMMXExt, iFv_t) \ + GO(SDL_HasRDTSC, iFv_t) \ + GO(SDL_HasSSE, iFv_t) \ + GO(SDL_HasSSE2, iFv_t) \ + GO(SDL_ConvertAudio, iFp_t) \ + GO(SDL_Flip, iFp_t) \ + GO(SDL_LockSurface, iFp_t) \ + GO(SDL_PollEvent, iFp_t) \ + GO(SDL_PushEvent, iFp_t) \ + GO(SDL_RemoveTimer, iFp_t) \ + GO(SDL_ReadLE32, uFp_t) \ + GO(SDL_GetVideoInfo, pFv_t) \ + GO(SDL_GetVideoSurface, pFv_t) \ + GO(SDL_GL_GetProcAddress, pFp_t) \ + GO(SDL_LoadObject, pFp_t) \ + GO(SDL_WM_SetIcon, vFpp_t) \ + GO(SDL_SetTimer, iFup_t) \ + GO(SDL_OpenAudio, iFpp_t) \ + GO(SDL_LoadBMP_RW, pFpi_t) \ + GO(SDL_RWFromMem, pFpi_t) \ + GO(SDL_ListModes, pFpu_t) \ + GO(SDL_CreateThread, pFpp_t) \ + GO(SDL_LoadFunction, pFpp_t) \ + GO(SDL_RWFromFile, pFpp_t) \ + GO(SDL_SetColorKey, iFpuu_t) \ + GO(SDL_AddTimer, pFupp_t) \ + GO(SDL_PeepEvents, iFpiuu_t) \ + GO(SDL_MapRGB, uFpCCC_t) \ + GO(SDL_SetVideoMode, pFiiiu_t) \ + GO(SDL_GetRGB, vFupppp_t) \ + GO(SDL_BuildAudioCVT, iFpWCiWCi_t) \ + GO(SDL_CreateRGBSurfaceFrom, pFpiiiiuuuu_t) + +#endif // __wrappedsdl1TYPES32_H_ diff --git a/src/wrapped32/generated/wrappedsdl1undefs32.h b/src/wrapped32/generated/wrappedsdl1undefs32.h new file mode 100644 index 0000000..f08371b --- /dev/null +++ b/src/wrapped32/generated/wrappedsdl1undefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedsdl1UNDEFS32_H_ +#define __wrappedsdl1UNDEFS32_H_ + + +#endif // __wrappedsdl1UNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedsdl2defs32.h b/src/wrapped32/generated/wrappedsdl2defs32.h new file mode 100644 index 0000000..ea9404d --- /dev/null +++ b/src/wrapped32/generated/wrappedsdl2defs32.h @@ -0,0 +1,12 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedsdl2DEFS32_H_ +#define __wrappedsdl2DEFS32_H_ + +#define JFEi pFEpi +#define JFEi_32 pFEpi_32 +#define JFEp pFEpp +#define JFEp_32 pFEpp_32 + +#endif // __wrappedsdl2DEFS32_H_ diff --git a/src/wrapped32/generated/wrappedsdl2imagedefs32.h b/src/wrapped32/generated/wrappedsdl2imagedefs32.h new file mode 100644 index 0000000..c11135c --- /dev/null +++ b/src/wrapped32/generated/wrappedsdl2imagedefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedsdl2imageDEFS32_H_ +#define __wrappedsdl2imageDEFS32_H_ + + +#endif // __wrappedsdl2imageDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedsdl2imagetypes32.h b/src/wrapped32/generated/wrappedsdl2imagetypes32.h new file mode 100644 index 0000000..74fe53d --- /dev/null +++ b/src/wrapped32/generated/wrappedsdl2imagetypes32.h @@ -0,0 +1,42 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedsdl2imageTYPES32_H_ +#define __wrappedsdl2imageTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void* (*pFp_t)(void*); +typedef void* (*pFpi_t)(void*, int32_t); +typedef void* (*pFpip_t)(void*, int32_t, void*); +typedef void* (*pFppi_t)(void*, void*, int32_t); +typedef void* (*pFppip_t)(void*, void*, int32_t, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(IMG_Load, pFp_t) \ + GO(IMG_LoadBMP_RW, pFp_t) \ + GO(IMG_LoadCUR_RW, pFp_t) \ + GO(IMG_LoadGIF_RW, pFp_t) \ + GO(IMG_LoadICO_RW, pFp_t) \ + GO(IMG_LoadJPG_RW, pFp_t) \ + GO(IMG_LoadLBM_RW, pFp_t) \ + GO(IMG_LoadPCX_RW, pFp_t) \ + GO(IMG_LoadPNG_RW, pFp_t) \ + GO(IMG_LoadPNM_RW, pFp_t) \ + GO(IMG_LoadTGA_RW, pFp_t) \ + GO(IMG_LoadTIF_RW, pFp_t) \ + GO(IMG_LoadWEBP_RW, pFp_t) \ + GO(IMG_LoadXCF_RW, pFp_t) \ + GO(IMG_LoadXPM_RW, pFp_t) \ + GO(IMG_LoadXV_RW, pFp_t) \ + GO(IMG_Load_RW, pFpi_t) \ + GO(IMG_LoadTyped_RW, pFpip_t) \ + GO(IMG_LoadTexture_RW, pFppi_t) \ + GO(IMG_LoadTextureTyped_RW, pFppip_t) + +#endif // __wrappedsdl2imageTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedsdl2imageundefs32.h b/src/wrapped32/generated/wrappedsdl2imageundefs32.h new file mode 100644 index 0000000..67b7687 --- /dev/null +++ b/src/wrapped32/generated/wrappedsdl2imageundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedsdl2imageUNDEFS32_H_ +#define __wrappedsdl2imageUNDEFS32_H_ + + +#endif // __wrappedsdl2imageUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedsdl2types32.h b/src/wrapped32/generated/wrappedsdl2types32.h new file mode 100644 index 0000000..800218d --- /dev/null +++ b/src/wrapped32/generated/wrappedsdl2types32.h @@ -0,0 +1,120 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedsdl2TYPES32_H_ +#define __wrappedsdl2TYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFp_t)(void*); +typedef int32_t (*iFv_t)(void); +typedef int32_t (*iFp_t)(void*); +typedef int64_t (*IFp_t)(void*); +typedef uint32_t (*uFp_t)(void*); +typedef uint64_t (*UFp_t)(void*); +typedef void* (*pFv_t)(void); +typedef void* (*pFp_t)(void*); +typedef uintptr_t (*hFp_t)(void*); +typedef SDL2_GUID_t (*JFi_t)(int32_t); +typedef SDL2_GUID_t (*JFp_t)(void*); +typedef void (*vFpp_t)(void*, void*); +typedef void (*vFpV_t)(void*, ...); +typedef int32_t (*iFip_t)(int32_t, void*); +typedef int32_t (*iFpi_t)(void*, int32_t); +typedef int32_t (*iFpp_t)(void*, void*); +typedef uint32_t (*uFpW_t)(void*, uint16_t); +typedef uint32_t (*uFpu_t)(void*, uint32_t); +typedef uint32_t (*uFpU_t)(void*, uint64_t); +typedef void* (*pFpi_t)(void*, int32_t); +typedef void* (*pFpp_t)(void*, void*); +typedef int32_t (*iFiip_t)(int32_t, int32_t, void*); +typedef int32_t (*iFpiu_t)(void*, int32_t, uint32_t); +typedef int32_t (*iFppu_t)(void*, void*, uint32_t); +typedef int32_t (*iFppV_t)(void*, void*, ...); +typedef int64_t (*IFpIi_t)(void*, int64_t, int32_t); +typedef void* (*pFipp_t)(int32_t, void*, void*); +typedef void* (*pFpii_t)(void*, int32_t, int32_t); +typedef void* (*pFpuu_t)(void*, uint32_t, uint32_t); +typedef void* (*pFppu_t)(void*, void*, uint32_t); +typedef void* (*pFppp_t)(void*, void*, void*); +typedef int32_t (*iFpLpp_t)(void*, uintptr_t, void*, void*); +typedef int32_t (*iFpLpV_t)(void*, uintptr_t, void*, ...); +typedef uintptr_t (*LFppLL_t)(void*, void*, uintptr_t, uintptr_t); +typedef int32_t (*iFpiuuu_t)(void*, int32_t, uint32_t, uint32_t, uint32_t); +typedef uint32_t (*uFpippi_t)(void*, int32_t, void*, void*, int32_t); +typedef void* (*pFpiiiiu_t)(void*, int32_t, int32_t, int32_t, int32_t, uint32_t); +typedef void* (*pFuiiiuuuu_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void* (*pFpiiiiuuuu_t)(void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(SDL_FreeSurface, vFp_t) \ + GO(SDL_GetCPUCount, iFv_t) \ + GO(SDL_PollEvent, iFp_t) \ + GO(SDL_PushEvent, iFp_t) \ + GO(SDL_RWclose, iFp_t) \ + GO(SDL_RWsize, IFp_t) \ + GO(SDL_RWtell, IFp_t) \ + GO(SDL_ReadBE16, uFp_t) \ + GO(SDL_ReadBE32, uFp_t) \ + GO(SDL_ReadLE16, uFp_t) \ + GO(SDL_ReadLE32, uFp_t) \ + GO(SDL_ReadU8, uFp_t) \ + GO(SDL_ReadBE64, UFp_t) \ + GO(SDL_ReadLE64, UFp_t) \ + GO(SDL_GetBasePath, pFv_t) \ + GO(SDL_GL_GetProcAddress, pFp_t) \ + GO(SDL_GetThreadID, hFp_t) \ + GO(SDL_JoystickGetDeviceGUID, JFi_t) \ + GO(SDL_JoystickGetGUIDFromString, JFp_t) \ + GO(SDL_AddEventWatch, vFpp_t) \ + GO(SDL_DelEventWatch, vFpp_t) \ + GO(SDL_SetEventFilter, vFpp_t) \ + GO(SDL_SetWindowIcon, vFpp_t) \ + GO(SDL_Log, vFpV_t) \ + GO(SDL_GetCurrentDisplayMode, iFip_t) \ + GO(SDL_GetDesktopDisplayMode, iFip_t) \ + GO(SDL_GameControllerAddMappingsFromRW, iFpi_t) \ + GO(SDL_WaitEventTimeout, iFpi_t) \ + GO(SDL_GetWindowDisplayMode, iFpp_t) \ + GO(SDL_GetWindowWMInfo, iFpp_t) \ + GO(SDL_OpenAudio, iFpp_t) \ + GO(SDL_SetWindowDisplayMode, iFpp_t) \ + GO(SDL_ShowMessageBox, iFpp_t) \ + GO(SDL_WriteBE16, uFpW_t) \ + GO(SDL_WriteLE16, uFpW_t) \ + GO(SDL_WriteBE32, uFpu_t) \ + GO(SDL_WriteLE32, uFpu_t) \ + GO(SDL_WriteU8, uFpu_t) \ + GO(SDL_WriteBE64, uFpU_t) \ + GO(SDL_WriteLE64, uFpU_t) \ + GO(SDL_LoadBMP_RW, pFpi_t) \ + GO(SDL_RWFromMem, pFpi_t) \ + GO(SDL_notreal, pFpi_t) \ + GO(SDL_CreateTextureFromSurface, pFpp_t) \ + GO(SDL_RWFromFile, pFpp_t) \ + GO(SDL_GetDisplayMode, iFiip_t) \ + GO(SDL_SetColorKey, iFpiu_t) \ + GO(SDL_FillRect, iFppu_t) \ + GO(SDL_sscanf, iFppV_t) \ + GO(SDL_RWseek, IFpIi_t) \ + GO(SDL_GetClosestDisplayMode, pFipp_t) \ + GO(SDL_CreateColorCursor, pFpii_t) \ + GO(SDL_ConvertSurfaceFormat, pFpuu_t) \ + GO(SDL_ConvertSurface, pFppu_t) \ + GO(SDL_CreateThread, pFppp_t) \ + GO(SDL_vsnprintf, iFpLpp_t) \ + GO(SDL_snprintf, iFpLpV_t) \ + GO(SDL_RWread, LFppLL_t) \ + GO(SDL_RWwrite, LFppLL_t) \ + GO(SDL_PeepEvents, iFpiuuu_t) \ + GO(SDL_OpenAudioDevice, uFpippi_t) \ + GO(SDL_CreateRGBSurfaceWithFormatFrom, pFpiiiiu_t) \ + GO(SDL_CreateRGBSurface, pFuiiiuuuu_t) \ + GO(SDL_CreateRGBSurfaceFrom, pFpiiiiuuuu_t) + +#endif // __wrappedsdl2TYPES32_H_ diff --git a/src/wrapped32/generated/wrappedsdl2undefs32.h b/src/wrapped32/generated/wrappedsdl2undefs32.h new file mode 100644 index 0000000..13a187a --- /dev/null +++ b/src/wrapped32/generated/wrappedsdl2undefs32.h @@ -0,0 +1,12 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedsdl2UNDEFS32_H_ +#define __wrappedsdl2UNDEFS32_H_ + +#undef JFEi +#undef JFEi_32 +#undef JFEp +#undef JFEp_32 + +#endif // __wrappedsdl2UNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedselinuxdefs32.h b/src/wrapped32/generated/wrappedselinuxdefs32.h new file mode 100644 index 0000000..8eda29f --- /dev/null +++ b/src/wrapped32/generated/wrappedselinuxdefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedselinuxDEFS32_H_ +#define __wrappedselinuxDEFS32_H_ + + +#endif // __wrappedselinuxDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedselinuxtypes32.h b/src/wrapped32/generated/wrappedselinuxtypes32.h new file mode 100644 index 0000000..bdaa07d --- /dev/null +++ b/src/wrapped32/generated/wrappedselinuxtypes32.h @@ -0,0 +1,17 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedselinuxTYPES32_H_ +#define __wrappedselinuxTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedselinuxTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedselinuxundefs32.h b/src/wrapped32/generated/wrappedselinuxundefs32.h new file mode 100644 index 0000000..76e2a24 --- /dev/null +++ b/src/wrapped32/generated/wrappedselinuxundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedselinuxUNDEFS32_H_ +#define __wrappedselinuxUNDEFS32_H_ + + +#endif // __wrappedselinuxUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedtcmallocminimaldefs32.h b/src/wrapped32/generated/wrappedtcmallocminimaldefs32.h new file mode 100644 index 0000000..4f69b00 --- /dev/null +++ b/src/wrapped32/generated/wrappedtcmallocminimaldefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedtcmallocminimalDEFS32_H_ +#define __wrappedtcmallocminimalDEFS32_H_ + + +#endif // __wrappedtcmallocminimalDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedtcmallocminimaltypes32.h b/src/wrapped32/generated/wrappedtcmallocminimaltypes32.h new file mode 100644 index 0000000..93898fa --- /dev/null +++ b/src/wrapped32/generated/wrappedtcmallocminimaltypes32.h @@ -0,0 +1,24 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedtcmallocminimalTYPES32_H_ +#define __wrappedtcmallocminimalTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void* (*pFp_t)(void*); +typedef int32_t (*iFpL_t)(void*, uintptr_t); +typedef void* (*pFpLiiii_t)(void*, uintptr_t, int32_t, int32_t, int32_t, int32_t); +typedef void* (*pFpLiiiI_t)(void*, uintptr_t, int32_t, int32_t, int32_t, int64_t); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(munmap, iFpL_t) \ + GO(mmap, pFpLiiii_t) \ + GO(mmap64, pFpLiiiI_t) + +#endif // __wrappedtcmallocminimalTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedtcmallocminimalundefs32.h b/src/wrapped32/generated/wrappedtcmallocminimalundefs32.h new file mode 100644 index 0000000..c2b7d5e --- /dev/null +++ b/src/wrapped32/generated/wrappedtcmallocminimalundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedtcmallocminimalUNDEFS32_H_ +#define __wrappedtcmallocminimalUNDEFS32_H_ + + +#endif // __wrappedtcmallocminimalUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedudev0defs32.h b/src/wrapped32/generated/wrappedudev0defs32.h new file mode 100644 index 0000000..da982e1 --- /dev/null +++ b/src/wrapped32/generated/wrappedudev0defs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedudev0DEFS32_H_ +#define __wrappedudev0DEFS32_H_ + + +#endif // __wrappedudev0DEFS32_H_ diff --git a/src/wrapped32/generated/wrappedudev0types32.h b/src/wrapped32/generated/wrappedudev0types32.h new file mode 100644 index 0000000..e5c033b --- /dev/null +++ b/src/wrapped32/generated/wrappedudev0types32.h @@ -0,0 +1,17 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedudev0TYPES32_H_ +#define __wrappedudev0TYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedudev0TYPES32_H_ diff --git a/src/wrapped32/generated/wrappedudev0undefs32.h b/src/wrapped32/generated/wrappedudev0undefs32.h new file mode 100644 index 0000000..b14de87 --- /dev/null +++ b/src/wrapped32/generated/wrappedudev0undefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedudev0UNDEFS32_H_ +#define __wrappedudev0UNDEFS32_H_ + + +#endif // __wrappedudev0UNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedudev1defs32.h b/src/wrapped32/generated/wrappedudev1defs32.h new file mode 100644 index 0000000..065f83e --- /dev/null +++ b/src/wrapped32/generated/wrappedudev1defs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedudev1DEFS32_H_ +#define __wrappedudev1DEFS32_H_ + + +#endif // __wrappedudev1DEFS32_H_ diff --git a/src/wrapped32/generated/wrappedudev1types32.h b/src/wrapped32/generated/wrappedudev1types32.h new file mode 100644 index 0000000..774e668 --- /dev/null +++ b/src/wrapped32/generated/wrappedudev1types32.h @@ -0,0 +1,19 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedudev1TYPES32_H_ +#define __wrappedudev1TYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef void (*vFpp_t)(void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(udev_set_log_fn, vFpp_t) + +#endif // __wrappedudev1TYPES32_H_ diff --git a/src/wrapped32/generated/wrappedudev1undefs32.h b/src/wrapped32/generated/wrappedudev1undefs32.h new file mode 100644 index 0000000..7e3d743 --- /dev/null +++ b/src/wrapped32/generated/wrappedudev1undefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedudev1UNDEFS32_H_ +#define __wrappedudev1UNDEFS32_H_ + + +#endif // __wrappedudev1UNDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedxineramadefs32.h b/src/wrapped32/generated/wrappedxineramadefs32.h new file mode 100644 index 0000000..d334187 --- /dev/null +++ b/src/wrapped32/generated/wrappedxineramadefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedxineramaDEFS32_H_ +#define __wrappedxineramaDEFS32_H_ + + +#endif // __wrappedxineramaDEFS32_H_ diff --git a/src/wrapped32/generated/wrappedxineramatypes32.h b/src/wrapped32/generated/wrappedxineramatypes32.h new file mode 100644 index 0000000..31abe34 --- /dev/null +++ b/src/wrapped32/generated/wrappedxineramatypes32.h @@ -0,0 +1,17 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedxineramaTYPES32_H_ +#define __wrappedxineramaTYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedxineramaTYPES32_H_ diff --git a/src/wrapped32/generated/wrappedxineramaundefs32.h b/src/wrapped32/generated/wrappedxineramaundefs32.h new file mode 100644 index 0000000..18d75de --- /dev/null +++ b/src/wrapped32/generated/wrappedxineramaundefs32.h @@ -0,0 +1,8 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __wrappedxineramaUNDEFS32_H_ +#define __wrappedxineramaUNDEFS32_H_ + + +#endif // __wrappedxineramaUNDEFS32_H_ diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c new file mode 100644 index 0000000..cfad146 --- /dev/null +++ b/src/wrapped32/generated/wrapper32.c @@ -0,0 +1,4522 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#include +#include +#include +#include + +#include "wrapper32.h" +#include "emu/x64emu_private.h" +#include "emu/x87emu_private.h" +#include "regs.h" +#include "x64emu.h" +#include "box32.h" +#include "converter32.h" + +typedef union ui64_s { + int64_t i; + uint64_t u; + uint32_t d[2]; +} ui64_t; + +typedef struct _2uint_struct_s { + uint32_t a; + uint32_t b; +} _2uint_struct_t; + +extern void* my__IO_2_1_stderr_; +extern void* my__IO_2_1_stdin_ ; +extern void* my__IO_2_1_stdout_; + +static void* io_convert32(void* v) +{ + if(!v) + return v; + if(v==my__IO_2_1_stderr_) + return stderr; + if(v==my__IO_2_1_stdin_) + return stdin; + if(v==my__IO_2_1_stdout_) + return stdout; + return v; +} + +static void* io_convert_from(void* v) +{ + if(!v) + return v; + if(v==stderr) + return my__IO_2_1_stderr_; + if(v==stdin) + return my__IO_2_1_stdin_; + if(v==stdout) + return my__IO_2_1_stdout_; + return v; +} + +typedef struct my_GValue_s +{ + int g_type; + union { + int v_int; + int64_t v_int64; + uint64_t v_uint64; + float v_float; + double v_double; + void* v_pointer; + } data[2]; +} my_GValue_t; + +static void alignGValue(my_GValue_t* v, void* value) +{ + v->g_type = *(int*)value; + memcpy(v->data, value+4, 2*sizeof(double)); +} +static void unalignGValue(void* value, my_GValue_t* v) +{ + *(int*)value = v->g_type; + memcpy(value+4, v->data, 2*sizeof(double)); +} + +void* VulkanFromx86(void* src, void** save); +void VulkanTox86(void* src, void* save); + +#define ST0val ST0.d + +int of_convert32(int); + +void* getDisplay(void*); +void* addDisplay(void*); + +void* align_xcb_connection32(void* src); +void unalign_xcb_connection32(void* src, void* dst); + +typedef void (*vEv_t)(void); +typedef void (*vFv_t)(void); +typedef void (*vFc_t)(int8_t); +typedef void (*vFw_t)(int16_t); +typedef void (*vEi_t)(int32_t); +typedef void (*vFi_t)(int32_t); +typedef void (*vFC_t)(uint8_t); +typedef void (*vFW_t)(uint16_t); +typedef void (*vEu_t)(uint32_t); +typedef void (*vFu_t)(uint32_t); +typedef void (*vFU_t)(uint64_t); +typedef void (*vFf_t)(float); +typedef void (*vFd_t)(double); +typedef void (*vEl_t)(intptr_t); +typedef void (*vFl_t)(intptr_t); +typedef void (*vEp_t)(void*); +typedef void (*vFp_t)(void*); +typedef void (*vEA_t)(void*); +typedef void (*vES_t)(void*); +typedef void (*vFS_t)(void*); +typedef void (*vFX_t)(void*); +typedef void (*vFn_t)(void*); +typedef int8_t (*cFc_t)(int8_t); +typedef int8_t (*cFi_t)(int32_t); +typedef int8_t (*cFu_t)(uint32_t); +typedef int8_t (*cFp_t)(void*); +typedef int16_t (*wFp_t)(void*); +typedef int32_t (*iEv_t)(void); +typedef int32_t (*iFv_t)(void); +typedef int32_t (*iEi_t)(int32_t); +typedef int32_t (*iFi_t)(int32_t); +typedef int32_t (*iEI_t)(int64_t); +typedef int32_t (*iEu_t)(uint32_t); +typedef int32_t (*iFu_t)(uint32_t); +typedef int32_t (*iFU_t)(uint64_t); +typedef int32_t (*iEf_t)(float); +typedef int32_t (*iEd_t)(double); +typedef int32_t (*iEl_t)(intptr_t); +typedef int32_t (*iEL_t)(uintptr_t); +typedef int32_t (*iFL_t)(uintptr_t); +typedef int32_t (*iEp_t)(void*); +typedef int32_t (*iFp_t)(void*); +typedef int32_t (*iEh_t)(uintptr_t); +typedef int32_t (*iES_t)(void*); +typedef int32_t (*iFX_t)(void*); +typedef int32_t (*iFn_t)(void*); +typedef int64_t (*IFi_t)(int32_t); +typedef int64_t (*IEf_t)(float); +typedef int64_t (*IEd_t)(double); +typedef int64_t (*IEp_t)(void*); +typedef int64_t (*IFp_t)(void*); +typedef int64_t (*IES_t)(void*); +typedef uint8_t (*CFv_t)(void); +typedef uint8_t (*CFi_t)(int32_t); +typedef uint8_t (*CFu_t)(uint32_t); +typedef uint8_t (*CFU_t)(uint64_t); +typedef uint8_t (*CFl_t)(intptr_t); +typedef uint8_t (*CFp_t)(void*); +typedef uint16_t (*WFi_t)(int32_t); +typedef uint16_t (*WEW_t)(uint16_t); +typedef uint16_t (*WFu_t)(uint32_t); +typedef uint16_t (*WFp_t)(void*); +typedef uint32_t (*uEv_t)(void); +typedef uint32_t (*uFv_t)(void); +typedef uint32_t (*uEi_t)(int32_t); +typedef uint32_t (*uFi_t)(int32_t); +typedef uint32_t (*uEu_t)(uint32_t); +typedef uint32_t (*uFu_t)(uint32_t); +typedef uint32_t (*uEU_t)(uint64_t); +typedef uint32_t (*uEp_t)(void*); +typedef uint32_t (*uFp_t)(void*); +typedef uint32_t (*uES_t)(void*); +typedef uint32_t (*uFX_t)(void*); +typedef uint32_t (*uFn_t)(void*); +typedef uint64_t (*UFv_t)(void); +typedef uint64_t (*UFi_t)(int32_t); +typedef uint64_t (*UFu_t)(uint32_t); +typedef uint64_t (*UEp_t)(void*); +typedef uint64_t (*UFp_t)(void*); +typedef uint64_t (*UEs_t)(void*); +typedef float (*fFi_t)(int32_t); +typedef float (*fEf_t)(float); +typedef float (*fFf_t)(float); +typedef double (*dEv_t)(void); +typedef double (*dFi_t)(int32_t); +typedef double (*dEd_t)(double); +typedef double (*dFd_t)(double); +typedef double (*dEp_t)(void*); +typedef double (*dFp_t)(void*); +typedef intptr_t (*lEv_t)(void); +typedef intptr_t (*lFu_t)(uint32_t); +typedef intptr_t (*lEl_t)(intptr_t); +typedef intptr_t (*lFl_t)(intptr_t); +typedef intptr_t (*lEp_t)(void*); +typedef intptr_t (*lFp_t)(void*); +typedef intptr_t (*lES_t)(void*); +typedef intptr_t (*lFX_t)(void*); +typedef uintptr_t (*LEv_t)(void); +typedef uintptr_t (*LFv_t)(void); +typedef uintptr_t (*LFi_t)(int32_t); +typedef uintptr_t (*LFu_t)(uint32_t); +typedef uintptr_t (*LEL_t)(uintptr_t); +typedef uintptr_t (*LEp_t)(void*); +typedef uintptr_t (*LFp_t)(void*); +typedef uintptr_t (*LFX_t)(void*); +typedef void* (*pEv_t)(void); +typedef void* (*pFv_t)(void); +typedef void* (*pEi_t)(int32_t); +typedef void* (*pFi_t)(int32_t); +typedef void* (*pFI_t)(int64_t); +typedef void* (*pFW_t)(uint16_t); +typedef void* (*pFu_t)(uint32_t); +typedef void* (*pEu_t)(uint32_t); +typedef void* (*pFU_t)(uint64_t); +typedef void* (*pEl_t)(intptr_t); +typedef void* (*pFl_t)(intptr_t); +typedef void* (*pEL_t)(uintptr_t); +typedef void* (*pFL_t)(uintptr_t); +typedef void* (*pEp_t)(void*); +typedef void* (*pFp_t)(void*); +typedef void* (*pFX_t)(void*); +typedef void* (*pFn_t)(void*); +typedef uintptr_t (*hEv_t)(void); +typedef uintptr_t (*hFv_t)(void); +typedef void* (*aEa_t)(void*); +typedef char* (*tEv_t)(void); +typedef char* (*tEi_t)(int32_t); +typedef char* (*tEu_t)(uint32_t); +typedef char* (*tEp_t)(void*); +typedef char* (*tFp_t)(void*); +typedef void* (*XFv_t)(void); +typedef void* (*XFp_t)(void*); +typedef void (*vFbp__t)(struct_p_t*); +typedef int32_t (*iFbp__t)(struct_p_t*); +typedef int32_t (*iFBp__t)(struct_p_t*); +typedef uintptr_t (*LEBL__t)(struct_L_t*); +typedef void* (*pErl__t)(struct_l_t*); +typedef void* (*pFbp__t)(struct_p_t*); +typedef int32_t (*iFbpu__t)(struct_pu_t*); +typedef int64_t (*IFbpu__t)(struct_pu_t*); +typedef intptr_t (*lFrll__t)(struct_ll_t*); +typedef void (*vFbpii__t)(struct_pii_t*); +typedef void (*vFbLdd__t)(struct_Ldd_t*); +typedef void (*vFbupi__t)(struct_upi_t*); +typedef int32_t (*iErLWww__t)(struct_LWww_t*); +typedef int32_t (*iEBllll__t)(struct_llll_t*); +typedef int32_t (*iFbppuii__t)(struct_ppuii_t*); +typedef uint32_t (*uFbppuii__t)(struct_ppuii_t*); +typedef void* (*pFbppuii__t)(struct_ppuii_t*); +typedef void (*vFbuuipWCCp__t)(struct_uuipWCCp_t*); +typedef void (*vFbppuuuuup__t)(struct_ppuuuuup_t*); +typedef uint32_t (*uFbppuuuuup__t)(struct_ppuuuuup_t*); +typedef void (*vFbWWpWpWpWp__t)(struct_WWpWpWpWp_t*); +typedef uintptr_t (*LEbiiiiiiiiilt__t)(struct_iiiiiiiiilt_t*); +typedef void* (*pEriiiiiiiiilt__t)(struct_iiiiiiiiilt_t*); +typedef int32_t (*iFbppuiiiiiiiiipp__t)(struct_ppuiiiiiiiiipp_t*); +typedef uint32_t (*uFbppuiiiiiiiiipp__t)(struct_ppuiiiiiiiiipp_t*); +typedef void* (*pFbppuiiiiiiiiipp__t)(struct_ppuiiiiiiiiipp_t*); +typedef void (*vEEv_t)(x64emu_t*); +typedef void (*vFEv_t)(x64emu_t*); +typedef void (*vFEi_t)(x64emu_t*, int32_t); +typedef void (*vEEp_t)(x64emu_t*, void*); +typedef void (*vFEp_t)(x64emu_t*, void*); +typedef void (*vFEX_t)(x64emu_t*, void*); +typedef void (*vFcc_t)(int8_t, int8_t); +typedef void (*vFww_t)(int16_t, int16_t); +typedef void (*vFii_t)(int32_t, int32_t); +typedef void (*vFiI_t)(int32_t, int64_t); +typedef void (*vFiW_t)(int32_t, uint16_t); +typedef void (*vFiu_t)(int32_t, uint32_t); +typedef void (*vFiU_t)(int32_t, uint64_t); +typedef void (*vFif_t)(int32_t, float); +typedef void (*vFid_t)(int32_t, double); +typedef void (*vFip_t)(int32_t, void*); +typedef void (*vFWW_t)(uint16_t, uint16_t); +typedef void (*vFWu_t)(uint16_t, uint32_t); +typedef void (*vFuc_t)(uint32_t, int8_t); +typedef void (*vFuw_t)(uint32_t, int16_t); +typedef void (*vFui_t)(uint32_t, int32_t); +typedef void (*vFuI_t)(uint32_t, int64_t); +typedef void (*vFuC_t)(uint32_t, uint8_t); +typedef void (*vFuW_t)(uint32_t, uint16_t); +typedef void (*vFuu_t)(uint32_t, uint32_t); +typedef void (*vFuU_t)(uint32_t, uint64_t); +typedef void (*vFuf_t)(uint32_t, float); +typedef void (*vFud_t)(uint32_t, double); +typedef void (*vFul_t)(uint32_t, intptr_t); +typedef void (*vFup_t)(uint32_t, void*); +typedef void (*vFUu_t)(uint64_t, uint32_t); +typedef void (*vFfC_t)(float, uint8_t); +typedef void (*vFff_t)(float, float); +typedef void (*vFdd_t)(double, double); +typedef void (*vFlu_t)(intptr_t, uint32_t); +typedef void (*vFlp_t)(intptr_t, void*); +typedef void (*vEpi_t)(void*, int32_t); +typedef void (*vFpi_t)(void*, int32_t); +typedef void (*vFpC_t)(void*, uint8_t); +typedef void (*vFpu_t)(void*, uint32_t); +typedef void (*vFpd_t)(void*, double); +typedef void (*vFpl_t)(void*, intptr_t); +typedef void (*vEpL_t)(void*, uintptr_t); +typedef void (*vFpL_t)(void*, uintptr_t); +typedef void (*vEpp_t)(void*, void*); +typedef void (*vFpp_t)(void*, void*); +typedef void (*vESp_t)(void*, void*); +typedef void (*vFXi_t)(void*, int32_t); +typedef void (*vFXu_t)(void*, uint32_t); +typedef void (*vFXL_t)(void*, uintptr_t); +typedef void (*vFXp_t)(void*, void*); +typedef void (*vFni_t)(void*, int32_t); +typedef void (*vFnu_t)(void*, uint32_t); +typedef void (*vFnU_t)(void*, uint64_t); +typedef void (*vFnp_t)(void*, void*); +typedef int8_t (*cFpp_t)(void*, void*); +typedef int16_t (*wFpi_t)(void*, int32_t); +typedef int32_t (*iEEv_t)(x64emu_t*); +typedef int32_t (*iFEv_t)(x64emu_t*); +typedef int32_t (*iEEi_t)(x64emu_t*, int32_t); +typedef int32_t (*iFEi_t)(x64emu_t*, int32_t); +typedef int32_t (*iEEL_t)(x64emu_t*, uintptr_t); +typedef int32_t (*iEEp_t)(x64emu_t*, void*); +typedef int32_t (*iFEp_t)(x64emu_t*, void*); +typedef int32_t (*iEEh_t)(x64emu_t*, uintptr_t); +typedef int32_t (*iEEO_t)(x64emu_t*, int32_t); +typedef int32_t (*iFEX_t)(x64emu_t*, void*); +typedef int32_t (*iEii_t)(int32_t, int32_t); +typedef int32_t (*iFii_t)(int32_t, int32_t); +typedef int32_t (*iEiI_t)(int32_t, int64_t); +typedef int32_t (*iEiu_t)(int32_t, uint32_t); +typedef int32_t (*iFiu_t)(int32_t, uint32_t); +typedef int32_t (*iEil_t)(int32_t, intptr_t); +typedef int32_t (*iFiL_t)(int32_t, uintptr_t); +typedef int32_t (*iEip_t)(int32_t, void*); +typedef int32_t (*iFip_t)(int32_t, void*); +typedef int32_t (*iEiS_t)(int32_t, void*); +typedef int32_t (*iEui_t)(uint32_t, int32_t); +typedef int32_t (*iFui_t)(uint32_t, int32_t); +typedef int32_t (*iEuu_t)(uint32_t, uint32_t); +typedef int32_t (*iEuL_t)(uint32_t, uintptr_t); +typedef int32_t (*iEup_t)(uint32_t, void*); +typedef int32_t (*iFup_t)(uint32_t, void*); +typedef int32_t (*iEua_t)(uint32_t, void*); +typedef int32_t (*iFpw_t)(void*, int16_t); +typedef int32_t (*iEpi_t)(void*, int32_t); +typedef int32_t (*iFpi_t)(void*, int32_t); +typedef int32_t (*iFpI_t)(void*, int64_t); +typedef int32_t (*iFpW_t)(void*, uint16_t); +typedef int32_t (*iEpu_t)(void*, uint32_t); +typedef int32_t (*iFpu_t)(void*, uint32_t); +typedef int32_t (*iFpU_t)(void*, uint64_t); +typedef int32_t (*iFpf_t)(void*, float); +typedef int32_t (*iFpd_t)(void*, double); +typedef int32_t (*iFpl_t)(void*, intptr_t); +typedef int32_t (*iEpL_t)(void*, uintptr_t); +typedef int32_t (*iFpL_t)(void*, uintptr_t); +typedef int32_t (*iEpp_t)(void*, void*); +typedef int32_t (*iFpp_t)(void*, void*); +typedef int32_t (*iEpV_t)(void*, void*); +typedef int32_t (*iEpO_t)(void*, int32_t); +typedef int32_t (*iEpS_t)(void*, void*); +typedef int32_t (*iFpS_t)(void*, void*); +typedef int32_t (*iEhi_t)(uintptr_t, int32_t); +typedef int32_t (*iEhp_t)(uintptr_t, void*); +typedef int32_t (*iEhh_t)(uintptr_t, uintptr_t); +typedef int32_t (*iESi_t)(void*, int32_t); +typedef int32_t (*iESU_t)(void*, uint64_t); +typedef int32_t (*iESp_t)(void*, void*); +typedef int32_t (*iFXi_t)(void*, int32_t); +typedef int32_t (*iFXW_t)(void*, uint16_t); +typedef int32_t (*iFXL_t)(void*, uintptr_t); +typedef int32_t (*iFXp_t)(void*, void*); +typedef int64_t (*IFEp_t)(x64emu_t*, void*); +typedef int64_t (*IEII_t)(int64_t, int64_t); +typedef int64_t (*IFpI_t)(void*, int64_t); +typedef int64_t (*IFpu_t)(void*, uint32_t); +typedef uint8_t (*CFip_t)(int32_t, void*); +typedef uint8_t (*CFCi_t)(uint8_t, int32_t); +typedef uint8_t (*CFui_t)(uint32_t, int32_t); +typedef uint8_t (*CFuu_t)(uint32_t, uint32_t); +typedef uint8_t (*CFuU_t)(uint32_t, uint64_t); +typedef uint8_t (*CFpi_t)(void*, int32_t); +typedef uint8_t (*CFpu_t)(void*, uint32_t); +typedef uint8_t (*CFpp_t)(void*, void*); +typedef uint8_t (*CFXL_t)(void*, uintptr_t); +typedef uint16_t (*WFEp_t)(x64emu_t*, void*); +typedef uint16_t (*WFpp_t)(void*, void*); +typedef uint32_t (*uFEp_t)(x64emu_t*, void*); +typedef uint32_t (*uFii_t)(int32_t, int32_t); +typedef uint32_t (*uEiS_t)(int32_t, void*); +typedef uint32_t (*uFWp_t)(uint16_t, void*); +typedef uint32_t (*uFuu_t)(uint32_t, uint32_t); +typedef uint32_t (*uFup_t)(uint32_t, void*); +typedef uint32_t (*uEua_t)(uint32_t, void*); +typedef uint32_t (*uEuS_t)(uint32_t, void*); +typedef uint32_t (*uFpi_t)(void*, int32_t); +typedef uint32_t (*uFpu_t)(void*, uint32_t); +typedef uint32_t (*uFpp_t)(void*, void*); +typedef uint32_t (*uFXL_t)(void*, uintptr_t); +typedef uint64_t (*UFEp_t)(x64emu_t*, void*); +typedef uint64_t (*UEuu_t)(uint32_t, uint32_t); +typedef uint64_t (*UFuu_t)(uint32_t, uint32_t); +typedef uint64_t (*UEUU_t)(uint64_t, uint64_t); +typedef uint64_t (*UEss_t)(void*, void*); +typedef float (*fEif_t)(int32_t, float); +typedef float (*fFfi_t)(float, int32_t); +typedef float (*fEfi_t)(float, int32_t); +typedef float (*fEff_t)(float, float); +typedef float (*fFff_t)(float, float); +typedef float (*fEfD_t)(float, long double); +typedef float (*fEfp_t)(float, void*); +typedef double (*dEid_t)(int32_t, double); +typedef double (*dFdi_t)(double, int32_t); +typedef double (*dEdi_t)(double, int32_t); +typedef double (*dEdd_t)(double, double); +typedef double (*dFdd_t)(double, double); +typedef double (*dEdD_t)(double, long double); +typedef double (*dFdp_t)(double, void*); +typedef double (*dEdp_t)(double, void*); +typedef double (*dEll_t)(intptr_t, intptr_t); +typedef double (*dFpp_t)(void*, void*); +typedef intptr_t (*lEEi_t)(x64emu_t*, int32_t); +typedef intptr_t (*lEES_t)(x64emu_t*, void*); +typedef intptr_t (*lEii_t)(int32_t, int32_t); +typedef intptr_t (*lFiL_t)(int32_t, uintptr_t); +typedef intptr_t (*lFui_t)(uint32_t, int32_t); +typedef intptr_t (*lFll_t)(intptr_t, intptr_t); +typedef intptr_t (*lEpi_t)(void*, int32_t); +typedef intptr_t (*lFpu_t)(void*, uint32_t); +typedef intptr_t (*lFpl_t)(void*, intptr_t); +typedef intptr_t (*lFpL_t)(void*, uintptr_t); +typedef uintptr_t (*LEEL_t)(x64emu_t*, uintptr_t); +typedef uintptr_t (*LFEp_t)(x64emu_t*, void*); +typedef uintptr_t (*LFLi_t)(uintptr_t, int32_t); +typedef uintptr_t (*LFpc_t)(void*, int8_t); +typedef uintptr_t (*LEpL_t)(void*, uintptr_t); +typedef uintptr_t (*LEpp_t)(void*, void*); +typedef uintptr_t (*LFXi_t)(void*, int32_t); +typedef uintptr_t (*LFXu_t)(void*, uint32_t); +typedef uintptr_t (*LFXU_t)(void*, uint64_t); +typedef uintptr_t (*LFXL_t)(void*, uintptr_t); +typedef uintptr_t (*LFXp_t)(void*, void*); +typedef void* (*pFEv_t)(x64emu_t*); +typedef void* (*pEEv_t)(x64emu_t*); +typedef void* (*pFEi_t)(x64emu_t*, int32_t); +typedef void* (*pEEu_t)(x64emu_t*, uint32_t); +typedef void* (*pFEp_t)(x64emu_t*, void*); +typedef void* (*pEEp_t)(x64emu_t*, void*); +typedef void* (*pEES_t)(x64emu_t*, void*); +typedef void* (*pFEX_t)(x64emu_t*, void*); +typedef void* (*pFii_t)(int32_t, int32_t); +typedef void* (*pFiu_t)(int32_t, uint32_t); +typedef void* (*pFip_t)(int32_t, void*); +typedef void* (*pEia_t)(int32_t, void*); +typedef void* (*pFWu_t)(uint16_t, uint32_t); +typedef void* (*pFuu_t)(uint32_t, uint32_t); +typedef void* (*pEup_t)(uint32_t, void*); +typedef void* (*pFup_t)(uint32_t, void*); +typedef void* (*pELL_t)(uintptr_t, uintptr_t); +typedef void* (*pFLL_t)(uintptr_t, uintptr_t); +typedef void* (*pEpi_t)(void*, int32_t); +typedef void* (*pFpi_t)(void*, int32_t); +typedef void* (*pFpu_t)(void*, uint32_t); +typedef void* (*pFpU_t)(void*, uint64_t); +typedef void* (*pEpL_t)(void*, uintptr_t); +typedef void* (*pFpL_t)(void*, uintptr_t); +typedef void* (*pEpp_t)(void*, void*); +typedef void* (*pFpp_t)(void*, void*); +typedef void* (*pFXi_t)(void*, int32_t); +typedef void* (*pFXu_t)(void*, uint32_t); +typedef void* (*pFXL_t)(void*, uintptr_t); +typedef void* (*pFXp_t)(void*, void*); +typedef void* (*pFnu_t)(void*, uint32_t); +typedef void* (*pFnp_t)(void*, void*); +typedef uintptr_t (*hFEp_t)(x64emu_t*, void*); +typedef uintptr_t (*hEpa_t)(void*, void*); +typedef void* (*SEip_t)(int32_t, void*); +typedef void* (*SEpp_t)(void*, void*); +typedef char* (*tEip_t)(int32_t, void*); +typedef char* (*tEia_t)(int32_t, void*); +typedef char* (*tFuu_t)(uint32_t, uint32_t); +typedef char* (*tEpL_t)(void*, uintptr_t); +typedef char* (*tEpp_t)(void*, void*); +typedef void (*vFuBp__t)(uint32_t, struct_p_t*); +typedef void (*vFpbp__t)(void*, struct_p_t*); +typedef void (*vFbp_p_t)(struct_p_t*, void*); +typedef int32_t (*iEEbp__t)(x64emu_t*, struct_p_t*); +typedef int32_t (*iFibp__t)(int32_t, struct_p_t*); +typedef int32_t (*iFLbp__t)(uintptr_t, struct_p_t*); +typedef int32_t (*iFpbp__t)(void*, struct_p_t*); +typedef int32_t (*iFpbl__t)(void*, struct_l_t*); +typedef int32_t (*iFpBL__t)(void*, struct_L_t*); +typedef int32_t (*iFpbL__t)(void*, struct_L_t*); +typedef int32_t (*iEHBp__t)(uintptr_t, struct_p_t*); +typedef int32_t (*iFbp_i_t)(struct_p_t*, int32_t); +typedef int32_t (*iFbp_u_t)(struct_p_t*, uint32_t); +typedef int32_t (*iFbp_p_t)(struct_p_t*, void*); +typedef int32_t (*iFXbL__t)(void*, struct_L_t*); +typedef uint32_t (*uFpbp__t)(void*, struct_p_t*); +typedef uint32_t (*uFpbL__t)(void*, struct_L_t*); +typedef float (*fEpBp__t)(void*, struct_p_t*); +typedef double (*dEpBp__t)(void*, struct_p_t*); +typedef intptr_t (*lFpbp__t)(void*, struct_p_t*); +typedef uintptr_t (*LFpbp__t)(void*, struct_p_t*); +typedef uintptr_t (*LFpbL__t)(void*, struct_L_t*); +typedef void* (*pFpbp__t)(void*, struct_p_t*); +typedef void* (*pErl_p_t)(struct_l_t*, void*); +typedef void (*vFibpp__t)(int32_t, struct_pp_t*); +typedef void (*vFpbpu__t)(void*, struct_pu_t*); +typedef void (*vFBll_l_t)(struct_ll_t*, intptr_t); +typedef void (*vFnbpi__t)(void*, struct_pi_t*); +typedef int32_t (*iEuBLL__t)(uint32_t, struct_LL_t*); +typedef int32_t (*iEprll__t)(void*, struct_ll_t*); +typedef int32_t (*iEpbup__t)(void*, struct_up_t*); +typedef int32_t (*iEprLL__t)(void*, struct_LL_t*); +typedef int32_t (*iFpbpu__t)(void*, struct_pu_t*); +typedef int32_t (*iFbpi_i_t)(struct_pi_t*, int32_t); +typedef int32_t (*iFbpu_u_t)(struct_pu_t*, uint32_t); +typedef int32_t (*iEBll_p_t)(struct_ll_t*, void*); +typedef int32_t (*iFXbip__t)(void*, struct_ip_t*); +typedef uint32_t (*uFpbpu__t)(void*, struct_pu_t*); +typedef void* (*pFnbpi__t)(void*, struct_pi_t*); +typedef void (*vFpbupi__t)(void*, struct_upi_t*); +typedef int32_t (*iEpBlii__t)(void*, struct_lii_t*); +typedef int32_t (*iESBliu__t)(void*, struct_liu_t*); +typedef int32_t (*iFbppi_i_t)(struct_ppi_t*, int32_t); +typedef int32_t (*iFbp_bp__t)(struct_p_t*, struct_p_t*); +typedef int32_t (*iFXbiip__t)(void*, struct_iip_t*); +typedef void (*vFbppuii_p_t)(struct_ppuii_t*, void*); +typedef int32_t (*iErLL_BLL__t)(struct_LL_t*, struct_LL_t*); +typedef int32_t (*iFbpu_bpu__t)(struct_pu_t*, struct_pu_t*); +typedef void* (*pErppppii_p_t)(struct_ppppii_t*, void*); +typedef void (*vFbll_rllll__t)(struct_ll_t*, struct_llll_t*); +typedef int32_t (*iEbpppiiip_p_t)(struct_pppiiip_t*, void*); +typedef int32_t (*iFXbiiuuLip__t)(void*, struct_iiuuLip_t*); +typedef int32_t (*iFpruuipWCCp__t)(void*, struct_uuipWCCp_t*); +typedef uint32_t (*uFpbppuuuuup__t)(void*, struct_ppuuuuup_t*); +typedef uint32_t (*uFbppuuuuup_p_t)(struct_ppuuuuup_t*, void*); +typedef void* (*pFubppuuuuup__t)(uint32_t, struct_ppuuuuup_t*); +typedef void* (*pFpbppuuuuup__t)(void*, struct_ppuuuuup_t*); +typedef void (*vFbppuii_bppuii__t)(struct_ppuii_t*, struct_ppuii_t*); +typedef intptr_t (*lEEriiiiiiiiilt__t)(x64emu_t*, struct_iiiiiiiiilt_t*); +typedef void* (*pEriiiiiiiiilt_p_t)(struct_iiiiiiiiilt_t*, void*); +typedef uintptr_t (*LFXrLiiwwwwwwwwL__t)(void*, struct_LiiwwwwwwwwL_t*); +typedef void (*vFpbppuiiiiiiiiipp__t)(void*, struct_ppuiiiiiiiiipp_t*); +typedef void (*vFbppuiiiiiiiiipp_p_t)(struct_ppuiiiiiiiiipp_t*, void*); +typedef uint32_t (*uFpbppuiiiiiiiiipp__t)(void*, struct_ppuiiiiiiiiipp_t*); +typedef void (*vFbppuuuuup_bppuuuuup__t)(struct_ppuuuuup_t*, struct_ppuuuuup_t*); +typedef int32_t (*iEiBLLLLLLLLLLLLLLLLLL__t)(int32_t, struct_LLLLLLLLLLLLLLLLLL_t*); +typedef int32_t (*iEiBUUUULLLLLLLLLLLLLL__t)(int32_t, struct_UUUULLLLLLLLLLLLLL_t*); +typedef void (*vFbppuiiiiiiiiipp_bppuiiiiiiiiipp__t)(struct_ppuiiiiiiiiipp_t*, struct_ppuiiiiiiiiipp_t*); +typedef uint32_t (*uFbppuiiiiiiiiipp_bppuiiiiiiiiipp__t)(struct_ppuiiiiiiiiipp_t*, struct_ppuiiiiiiiiipp_t*); +typedef void (*vEEip_t)(x64emu_t*, int32_t, void*); +typedef void (*vFEip_t)(x64emu_t*, int32_t, void*); +typedef void (*vEEpi_t)(x64emu_t*, void*, int32_t); +typedef void (*vEEpu_t)(x64emu_t*, void*, uint32_t); +typedef void (*vFEpp_t)(x64emu_t*, void*, void*); +typedef void (*vFEpV_t)(x64emu_t*, void*, void*); +typedef void (*vFEXp_t)(x64emu_t*, void*, void*); +typedef void (*vFccc_t)(int8_t, int8_t, int8_t); +typedef void (*vFwww_t)(int16_t, int16_t, int16_t); +typedef void (*vFiii_t)(int32_t, int32_t, int32_t); +typedef void (*vFiif_t)(int32_t, int32_t, float); +typedef void (*vFiip_t)(int32_t, int32_t, void*); +typedef void (*vFiII_t)(int32_t, int64_t, int64_t); +typedef void (*vFiui_t)(int32_t, uint32_t, int32_t); +typedef void (*vFiuu_t)(int32_t, uint32_t, uint32_t); +typedef void (*vFiup_t)(int32_t, uint32_t, void*); +typedef void (*vFiUU_t)(int32_t, uint64_t, uint64_t); +typedef void (*vFiff_t)(int32_t, float, float); +typedef void (*vFidd_t)(int32_t, double, double); +typedef void (*vFilu_t)(int32_t, intptr_t, uint32_t); +typedef void (*vFill_t)(int32_t, intptr_t, intptr_t); +typedef void (*vFilp_t)(int32_t, intptr_t, void*); +typedef void (*vFipu_t)(int32_t, void*, uint32_t); +typedef void (*vFipp_t)(int32_t, void*, void*); +typedef void (*vFCCC_t)(uint8_t, uint8_t, uint8_t); +typedef void (*vFWWW_t)(uint16_t, uint16_t, uint16_t); +typedef void (*vFucc_t)(uint32_t, int8_t, int8_t); +typedef void (*vFuww_t)(uint32_t, int16_t, int16_t); +typedef void (*vFuii_t)(uint32_t, int32_t, int32_t); +typedef void (*vFuiI_t)(uint32_t, int32_t, int64_t); +typedef void (*vFuiu_t)(uint32_t, int32_t, uint32_t); +typedef void (*vFuiU_t)(uint32_t, int32_t, uint64_t); +typedef void (*vFuif_t)(uint32_t, int32_t, float); +typedef void (*vFuid_t)(uint32_t, int32_t, double); +typedef void (*vFuip_t)(uint32_t, int32_t, void*); +typedef void (*vFuII_t)(uint32_t, int64_t, int64_t); +typedef void (*vFuWW_t)(uint32_t, uint16_t, uint16_t); +typedef void (*vFuui_t)(uint32_t, uint32_t, int32_t); +typedef void (*vFuuC_t)(uint32_t, uint32_t, uint8_t); +typedef void (*vFuuu_t)(uint32_t, uint32_t, uint32_t); +typedef void (*vFuuU_t)(uint32_t, uint32_t, uint64_t); +typedef void (*vFuuf_t)(uint32_t, uint32_t, float); +typedef void (*vFuud_t)(uint32_t, uint32_t, double); +typedef void (*vFuup_t)(uint32_t, uint32_t, void*); +typedef void (*vFuUU_t)(uint32_t, uint64_t, uint64_t); +typedef void (*vFuff_t)(uint32_t, float, float); +typedef void (*vFudd_t)(uint32_t, double, double); +typedef void (*vFull_t)(uint32_t, intptr_t, intptr_t); +typedef void (*vFulp_t)(uint32_t, intptr_t, void*); +typedef void (*vFupp_t)(uint32_t, void*, void*); +typedef void (*vFfff_t)(float, float, float); +typedef void (*vEfpp_t)(float, void*, void*); +typedef void (*vFddd_t)(double, double, double); +typedef void (*vEdpp_t)(double, void*, void*); +typedef void (*vFlii_t)(intptr_t, int32_t, int32_t); +typedef void (*vFlip_t)(intptr_t, int32_t, void*); +typedef void (*vFllp_t)(intptr_t, intptr_t, void*); +typedef void (*vFlpp_t)(intptr_t, void*, void*); +typedef void (*vEpii_t)(void*, int32_t, int32_t); +typedef void (*vFpii_t)(void*, int32_t, int32_t); +typedef void (*vFpiL_t)(void*, int32_t, uintptr_t); +typedef void (*vFpip_t)(void*, int32_t, void*); +typedef void (*vFpui_t)(void*, uint32_t, int32_t); +typedef void (*vFpuI_t)(void*, uint32_t, int64_t); +typedef void (*vFpuC_t)(void*, uint32_t, uint8_t); +typedef void (*vFpuu_t)(void*, uint32_t, uint32_t); +typedef void (*vFpuU_t)(void*, uint32_t, uint64_t); +typedef void (*vFpuf_t)(void*, uint32_t, float); +typedef void (*vFpud_t)(void*, uint32_t, double); +typedef void (*vFpul_t)(void*, uint32_t, intptr_t); +typedef void (*vFpup_t)(void*, uint32_t, void*); +typedef void (*vFpdd_t)(void*, double, double); +typedef void (*vFplp_t)(void*, intptr_t, void*); +typedef void (*vFppi_t)(void*, void*, int32_t); +typedef void (*vEppu_t)(void*, void*, uint32_t); +typedef void (*vFppu_t)(void*, void*, uint32_t); +typedef void (*vFppL_t)(void*, void*, uintptr_t); +typedef void (*vFppp_t)(void*, void*, void*); +typedef void (*vFXiL_t)(void*, int32_t, uintptr_t); +typedef void (*vFXLi_t)(void*, uintptr_t, int32_t); +typedef void (*vFXLL_t)(void*, uintptr_t, uintptr_t); +typedef void (*vFXLp_t)(void*, uintptr_t, void*); +typedef void (*vFXpi_t)(void*, void*, int32_t); +typedef void (*vFXpl_t)(void*, void*, intptr_t); +typedef void (*vFXpL_t)(void*, void*, uintptr_t); +typedef void (*vFXpp_t)(void*, void*, void*); +typedef int32_t (*iFEip_t)(x64emu_t*, int32_t, void*); +typedef int32_t (*iEEip_t)(x64emu_t*, int32_t, void*); +typedef int32_t (*iEEup_t)(x64emu_t*, uint32_t, void*); +typedef int32_t (*iFEup_t)(x64emu_t*, uint32_t, void*); +typedef int32_t (*iEEpi_t)(x64emu_t*, void*, int32_t); +typedef int32_t (*iFEpi_t)(x64emu_t*, void*, int32_t); +typedef int32_t (*iFEpu_t)(x64emu_t*, void*, uint32_t); +typedef int32_t (*iFEpl_t)(x64emu_t*, void*, intptr_t); +typedef int32_t (*iEEpL_t)(x64emu_t*, void*, uintptr_t); +typedef int32_t (*iFEpL_t)(x64emu_t*, void*, uintptr_t); +typedef int32_t (*iEEpp_t)(x64emu_t*, void*, void*); +typedef int32_t (*iFEpp_t)(x64emu_t*, void*, void*); +typedef int32_t (*iEEpV_t)(x64emu_t*, void*, void*); +typedef int32_t (*iFEpX_t)(x64emu_t*, void*, void*); +typedef int32_t (*iEEhi_t)(x64emu_t*, uintptr_t, int32_t); +typedef int32_t (*iEEhp_t)(x64emu_t*, uintptr_t, void*); +typedef int32_t (*iFEXp_t)(x64emu_t*, void*, void*); +typedef int32_t (*iEiii_t)(int32_t, int32_t, int32_t); +typedef int32_t (*iEiiI_t)(int32_t, int32_t, int64_t); +typedef int32_t (*iFiiu_t)(int32_t, int32_t, uint32_t); +typedef int32_t (*iEiil_t)(int32_t, int32_t, intptr_t); +typedef int32_t (*iEiip_t)(int32_t, int32_t, void*); +typedef int32_t (*iFiip_t)(int32_t, int32_t, void*); +typedef int32_t (*iEiiO_t)(int32_t, int32_t, int32_t); +typedef int32_t (*iEiiN_t)(int32_t, int32_t, ...); +typedef int32_t (*iEiII_t)(int32_t, int64_t, int64_t); +typedef int32_t (*iFiui_t)(int32_t, uint32_t, int32_t); +typedef int32_t (*iEiuu_t)(int32_t, uint32_t, uint32_t); +typedef int32_t (*iFiuu_t)(int32_t, uint32_t, uint32_t); +typedef int32_t (*iFiuL_t)(int32_t, uint32_t, uintptr_t); +typedef int32_t (*iEiup_t)(int32_t, uint32_t, void*); +typedef int32_t (*iFiup_t)(int32_t, uint32_t, void*); +typedef int32_t (*iFiUU_t)(int32_t, uint64_t, uint64_t); +typedef int32_t (*iFiUp_t)(int32_t, uint64_t, void*); +typedef int32_t (*iFidd_t)(int32_t, double, double); +typedef int32_t (*iEill_t)(int32_t, intptr_t, intptr_t); +typedef int32_t (*iEiLi_t)(int32_t, uintptr_t, int32_t); +typedef int32_t (*iEiLp_t)(int32_t, uintptr_t, void*); +typedef int32_t (*iFiLp_t)(int32_t, uintptr_t, void*); +typedef int32_t (*iFipi_t)(int32_t, void*, int32_t); +typedef int32_t (*iEipi_t)(int32_t, void*, int32_t); +typedef int32_t (*iEipu_t)(int32_t, void*, uint32_t); +typedef int32_t (*iFipu_t)(int32_t, void*, uint32_t); +typedef int32_t (*iEipL_t)(int32_t, void*, uintptr_t); +typedef int32_t (*iEipp_t)(int32_t, void*, void*); +typedef int32_t (*iFipp_t)(int32_t, void*, void*); +typedef int32_t (*iEipO_t)(int32_t, void*, int32_t); +typedef int32_t (*iFuip_t)(uint32_t, int32_t, void*); +typedef int32_t (*iEuui_t)(uint32_t, uint32_t, int32_t); +typedef int32_t (*iEuuu_t)(uint32_t, uint32_t, uint32_t); +typedef int32_t (*iFuup_t)(uint32_t, uint32_t, void*); +typedef int32_t (*iEuLa_t)(uint32_t, uintptr_t, void*); +typedef int32_t (*iFupL_t)(uint32_t, void*, uintptr_t); +typedef int32_t (*iFUip_t)(uint64_t, int32_t, void*); +typedef int32_t (*iFfff_t)(float, float, float); +typedef int32_t (*iELLi_t)(uintptr_t, uintptr_t, int32_t); +typedef int32_t (*iFpii_t)(void*, int32_t, int32_t); +typedef int32_t (*iEpiu_t)(void*, int32_t, uint32_t); +typedef int32_t (*iFpiu_t)(void*, int32_t, uint32_t); +typedef int32_t (*iFpil_t)(void*, int32_t, intptr_t); +typedef int32_t (*iEpip_t)(void*, int32_t, void*); +typedef int32_t (*iFpip_t)(void*, int32_t, void*); +typedef int32_t (*iFpII_t)(void*, int64_t, int64_t); +typedef int32_t (*iFpWp_t)(void*, uint16_t, void*); +typedef int32_t (*iFpui_t)(void*, uint32_t, int32_t); +typedef int32_t (*iFpuC_t)(void*, uint32_t, uint8_t); +typedef int32_t (*iEpuu_t)(void*, uint32_t, uint32_t); +typedef int32_t (*iFpuu_t)(void*, uint32_t, uint32_t); +typedef int32_t (*iFpuU_t)(void*, uint32_t, uint64_t); +typedef int32_t (*iFpup_t)(void*, uint32_t, void*); +typedef int32_t (*iFpUU_t)(void*, uint64_t, uint64_t); +typedef int32_t (*iFpfu_t)(void*, float, uint32_t); +typedef int32_t (*iFpff_t)(void*, float, float); +typedef int32_t (*iFpdd_t)(void*, double, double); +typedef int32_t (*iFpli_t)(void*, intptr_t, int32_t); +typedef int32_t (*iFpll_t)(void*, intptr_t, intptr_t); +typedef int32_t (*iEpLi_t)(void*, uintptr_t, int32_t); +typedef int32_t (*iEpLu_t)(void*, uintptr_t, uint32_t); +typedef int32_t (*iEpLp_t)(void*, uintptr_t, void*); +typedef int32_t (*iFpLp_t)(void*, uintptr_t, void*); +typedef int32_t (*iEppi_t)(void*, void*, int32_t); +typedef int32_t (*iFppi_t)(void*, void*, int32_t); +typedef int32_t (*iFppI_t)(void*, void*, int64_t); +typedef int32_t (*iEppu_t)(void*, void*, uint32_t); +typedef int32_t (*iFppu_t)(void*, void*, uint32_t); +typedef int32_t (*iFppU_t)(void*, void*, uint64_t); +typedef int32_t (*iFppd_t)(void*, void*, double); +typedef int32_t (*iEppL_t)(void*, void*, uintptr_t); +typedef int32_t (*iFppL_t)(void*, void*, uintptr_t); +typedef int32_t (*iEppp_t)(void*, void*, void*); +typedef int32_t (*iFppp_t)(void*, void*, void*); +typedef int32_t (*iEppa_t)(void*, void*, void*); +typedef int32_t (*iEpOu_t)(void*, int32_t, uint32_t); +typedef int32_t (*iFpSp_t)(void*, void*, void*); +typedef int32_t (*iEhip_t)(uintptr_t, int32_t, void*); +typedef int32_t (*iEhpL_t)(uintptr_t, void*, uintptr_t); +typedef int32_t (*iEhpp_t)(uintptr_t, void*, void*); +typedef int32_t (*iESIi_t)(void*, int64_t, int32_t); +typedef int32_t (*iESli_t)(void*, intptr_t, int32_t); +typedef int32_t (*iFXii_t)(void*, int32_t, int32_t); +typedef int32_t (*iFXiL_t)(void*, int32_t, uintptr_t); +typedef int32_t (*iFXip_t)(void*, int32_t, void*); +typedef int32_t (*iFXuu_t)(void*, uint32_t, uint32_t); +typedef int32_t (*iFXup_t)(void*, uint32_t, void*); +typedef int32_t (*iFXLi_t)(void*, uintptr_t, int32_t); +typedef int32_t (*iFXLu_t)(void*, uintptr_t, uint32_t); +typedef int32_t (*iFXLU_t)(void*, uintptr_t, uint64_t); +typedef int32_t (*iFXLf_t)(void*, uintptr_t, float); +typedef int32_t (*iFXLl_t)(void*, uintptr_t, intptr_t); +typedef int32_t (*iFXLL_t)(void*, uintptr_t, uintptr_t); +typedef int32_t (*iFXLp_t)(void*, uintptr_t, void*); +typedef int32_t (*iFXpi_t)(void*, void*, int32_t); +typedef int32_t (*iFXpu_t)(void*, void*, uint32_t); +typedef int32_t (*iFXpl_t)(void*, void*, intptr_t); +typedef int32_t (*iFXpL_t)(void*, void*, uintptr_t); +typedef int32_t (*iFXpp_t)(void*, void*, void*); +typedef int64_t (*IEiIi_t)(int32_t, int64_t, int32_t); +typedef int64_t (*IFpIi_t)(void*, int64_t, int32_t); +typedef int64_t (*IEppi_t)(void*, void*, int32_t); +typedef uint8_t (*CFipp_t)(int32_t, void*, void*); +typedef uint8_t (*CFuUu_t)(uint32_t, uint64_t, uint32_t); +typedef uint8_t (*CFuff_t)(uint32_t, float, float); +typedef uint16_t (*WFXip_t)(void*, int32_t, void*); +typedef uint32_t (*uFEpW_t)(x64emu_t*, void*, uint16_t); +typedef uint32_t (*uFEpu_t)(x64emu_t*, void*, uint32_t); +typedef uint32_t (*uFEpU_t)(x64emu_t*, void*, uint64_t); +typedef uint32_t (*uFEpL_t)(x64emu_t*, void*, uintptr_t); +typedef uint32_t (*uFEpp_t)(x64emu_t*, void*, void*); +typedef uint32_t (*uFilp_t)(int32_t, intptr_t, void*); +typedef uint32_t (*uFipu_t)(int32_t, void*, uint32_t); +typedef uint32_t (*uFuuu_t)(uint32_t, uint32_t, uint32_t); +typedef uint32_t (*uFuup_t)(uint32_t, uint32_t, void*); +typedef uint32_t (*uFupp_t)(uint32_t, void*, void*); +typedef uint32_t (*uFpii_t)(void*, int32_t, int32_t); +typedef uint32_t (*uFpip_t)(void*, int32_t, void*); +typedef uint32_t (*uFpuU_t)(void*, uint32_t, uint64_t); +typedef uint32_t (*uEpup_t)(void*, uint32_t, void*); +typedef uint32_t (*uFpup_t)(void*, uint32_t, void*); +typedef uint32_t (*uFppi_t)(void*, void*, int32_t); +typedef uint32_t (*uFppu_t)(void*, void*, uint32_t); +typedef uint32_t (*uEppL_t)(void*, void*, uintptr_t); +typedef uint32_t (*uFppL_t)(void*, void*, uintptr_t); +typedef uint32_t (*uFppp_t)(void*, void*, void*); +typedef uint32_t (*uFXuu_t)(void*, uint32_t, uint32_t); +typedef uint64_t (*UEppi_t)(void*, void*, int32_t); +typedef float (*fFuii_t)(uint32_t, int32_t, int32_t); +typedef float (*fEfff_t)(float, float, float); +typedef float (*fEffp_t)(float, float, void*); +typedef double (*dEddd_t)(double, double, double); +typedef double (*dEddp_t)(double, double, void*); +typedef intptr_t (*lEEuV_t)(x64emu_t*, uint32_t, void*); +typedef intptr_t (*lEili_t)(int32_t, intptr_t, int32_t); +typedef intptr_t (*lEipi_t)(int32_t, void*, int32_t); +typedef intptr_t (*lEipL_t)(int32_t, void*, uintptr_t); +typedef intptr_t (*lFlll_t)(intptr_t, intptr_t, intptr_t); +typedef intptr_t (*lElpi_t)(intptr_t, void*, int32_t); +typedef intptr_t (*lFpLd_t)(void*, uintptr_t, double); +typedef intptr_t (*lFpLL_t)(void*, uintptr_t, uintptr_t); +typedef intptr_t (*lFppi_t)(void*, void*, int32_t); +typedef intptr_t (*lFppL_t)(void*, void*, uintptr_t); +typedef intptr_t (*lFppp_t)(void*, void*, void*); +typedef uintptr_t (*LFEpi_t)(x64emu_t*, void*, int32_t); +typedef uintptr_t (*LFEpp_t)(x64emu_t*, void*, void*); +typedef uintptr_t (*LFEXp_t)(x64emu_t*, void*, void*); +typedef uintptr_t (*LFpii_t)(void*, int32_t, int32_t); +typedef uintptr_t (*LEpip_t)(void*, int32_t, void*); +typedef uintptr_t (*LFppi_t)(void*, void*, int32_t); +typedef uintptr_t (*LEppL_t)(void*, void*, uintptr_t); +typedef uintptr_t (*LFppL_t)(void*, void*, uintptr_t); +typedef uintptr_t (*LFXip_t)(void*, int32_t, void*); +typedef uintptr_t (*LFXCi_t)(void*, uint8_t, int32_t); +typedef uintptr_t (*LFXLi_t)(void*, uintptr_t, int32_t); +typedef uintptr_t (*LFXLC_t)(void*, uintptr_t, uint8_t); +typedef uintptr_t (*LFXpi_t)(void*, void*, int32_t); +typedef uintptr_t (*LFXpp_t)(void*, void*, void*); +typedef void* (*pFEii_t)(x64emu_t*, int32_t, int32_t); +typedef void* (*pFEiu_t)(x64emu_t*, int32_t, uint32_t); +typedef void* (*pEEip_t)(x64emu_t*, int32_t, void*); +typedef void* (*pFEiV_t)(x64emu_t*, int32_t, void*); +typedef void* (*pEEpi_t)(x64emu_t*, void*, int32_t); +typedef void* (*pFEpi_t)(x64emu_t*, void*, int32_t); +typedef void* (*pFEpu_t)(x64emu_t*, void*, uint32_t); +typedef void* (*pEEpp_t)(x64emu_t*, void*, void*); +typedef void* (*pFEpp_t)(x64emu_t*, void*, void*); +typedef void* (*pFEpV_t)(x64emu_t*, void*, void*); +typedef void* (*pFEpX_t)(x64emu_t*, void*, void*); +typedef void* (*pFEXi_t)(x64emu_t*, void*, int32_t); +typedef void* (*pFEXL_t)(x64emu_t*, void*, uintptr_t); +typedef void* (*pFEXp_t)(x64emu_t*, void*, void*); +typedef void* (*pFiii_t)(int32_t, int32_t, int32_t); +typedef void* (*pFipp_t)(int32_t, void*, void*); +typedef void* (*pFIpi_t)(int64_t, void*, int32_t); +typedef void* (*pFuuu_t)(uint32_t, uint32_t, uint32_t); +typedef void* (*pFulu_t)(uint32_t, intptr_t, uint32_t); +typedef void* (*pFupi_t)(uint32_t, void*, int32_t); +typedef void* (*pFupp_t)(uint32_t, void*, void*); +typedef void* (*pFddd_t)(double, double, double); +typedef void* (*pFLpi_t)(uintptr_t, void*, int32_t); +typedef void* (*pFpcU_t)(void*, int8_t, uint64_t); +typedef void* (*pEpii_t)(void*, int32_t, int32_t); +typedef void* (*pFpii_t)(void*, int32_t, int32_t); +typedef void* (*pFpiu_t)(void*, int32_t, uint32_t); +typedef void* (*pEpiL_t)(void*, int32_t, uintptr_t); +typedef void* (*pFpiL_t)(void*, int32_t, uintptr_t); +typedef void* (*pFpip_t)(void*, int32_t, void*); +typedef void* (*pEpiS_t)(void*, int32_t, void*); +typedef void* (*pEpII_t)(void*, int64_t, int64_t); +typedef void* (*pFpuu_t)(void*, uint32_t, uint32_t); +typedef void* (*pFpup_t)(void*, uint32_t, void*); +typedef void* (*pFpUi_t)(void*, uint64_t, int32_t); +typedef void* (*pFpdd_t)(void*, double, double); +typedef void* (*pEpLL_t)(void*, uintptr_t, uintptr_t); +typedef void* (*pFppi_t)(void*, void*, int32_t); +typedef void* (*pFppu_t)(void*, void*, uint32_t); +typedef void* (*pEppL_t)(void*, void*, uintptr_t); +typedef void* (*pFppL_t)(void*, void*, uintptr_t); +typedef void* (*pFppp_t)(void*, void*, void*); +typedef void* (*pEpOM_t)(void*, int32_t, ...); +typedef void* (*pFXii_t)(void*, int32_t, int32_t); +typedef void* (*pFXip_t)(void*, int32_t, void*); +typedef void* (*pFXLp_t)(void*, uintptr_t, void*); +typedef void* (*pFXpi_t)(void*, void*, int32_t); +typedef void* (*pFXpp_t)(void*, void*, void*); +typedef void* (*pFnpL_t)(void*, void*, uintptr_t); +typedef void* (*aEipa_t)(int32_t, void*, void*); +typedef void* (*SEEpp_t)(x64emu_t*, void*, void*); +typedef void* (*SEppS_t)(void*, void*, void*); +typedef char* (*tEipu_t)(int32_t, void*, uint32_t); +typedef char* (*tEipL_t)(int32_t, void*, uintptr_t); +typedef char* (*tEppi_t)(void*, void*, int32_t); +typedef void (*vFibp_i_t)(int32_t, struct_p_t*, int32_t); +typedef void (*vFuibp__t)(uint32_t, int32_t, struct_p_t*); +typedef void (*vFuuBp__t)(uint32_t, uint32_t, struct_p_t*); +typedef void (*vFuubp__t)(uint32_t, uint32_t, struct_p_t*); +typedef void (*vFpbp_i_t)(void*, struct_p_t*, int32_t); +typedef void (*vFbp_pp_t)(struct_p_t*, void*, void*); +typedef void (*vFXLbL__t)(void*, uintptr_t, struct_L_t*); +typedef void (*vFXbL_i_t)(void*, struct_L_t*, int32_t); +typedef int32_t (*iFEpBp__t)(x64emu_t*, void*, struct_p_t*); +typedef int32_t (*iFWubp__t)(uint16_t, uint32_t, struct_p_t*); +typedef int32_t (*iFuubp__t)(uint32_t, uint32_t, struct_p_t*); +typedef int32_t (*iFUpbp__t)(uint64_t, void*, struct_p_t*); +typedef int32_t (*iFLbp_p_t)(uintptr_t, struct_p_t*, void*); +typedef int32_t (*iFpibl__t)(void*, int32_t, struct_l_t*); +typedef int32_t (*iFpibp__t)(void*, int32_t, struct_p_t*); +typedef int32_t (*iFpubp__t)(void*, uint32_t, struct_p_t*); +typedef int32_t (*iFpubL__t)(void*, uint32_t, struct_L_t*); +typedef int32_t (*iFplbl__t)(void*, intptr_t, struct_l_t*); +typedef int32_t (*iEppBp__t)(void*, void*, struct_p_t*); +typedef int32_t (*iFppbp__t)(void*, void*, struct_p_t*); +typedef int32_t (*iFppbL__t)(void*, void*, struct_L_t*); +typedef int32_t (*iFpbp_i_t)(void*, struct_p_t*, int32_t); +typedef int32_t (*iFpbL_i_t)(void*, struct_L_t*, int32_t); +typedef int32_t (*iFpbp_u_t)(void*, struct_p_t*, uint32_t); +typedef int32_t (*iFpbL_p_t)(void*, struct_L_t*, void*); +typedef int32_t (*iFpbp_p_t)(void*, struct_p_t*, void*); +typedef int32_t (*iFbp_Wp_t)(struct_p_t*, uint16_t, void*); +typedef int32_t (*iFbp_up_t)(struct_p_t*, uint32_t, void*); +typedef int32_t (*iEBp_LL_t)(struct_p_t*, uintptr_t, uintptr_t); +typedef int32_t (*iFBp_LL_t)(struct_p_t*, uintptr_t, uintptr_t); +typedef int32_t (*iFbp_pi_t)(struct_p_t*, void*, int32_t); +typedef int32_t (*iFbL_pi_t)(struct_L_t*, void*, int32_t); +typedef int32_t (*iFbp_pI_t)(struct_p_t*, void*, int64_t); +typedef int32_t (*iFbp_pu_t)(struct_p_t*, void*, uint32_t); +typedef int32_t (*iFbp_pd_t)(struct_p_t*, void*, double); +typedef int32_t (*iFbp_pl_t)(struct_p_t*, void*, intptr_t); +typedef int32_t (*iFbp_pp_t)(struct_p_t*, void*, void*); +typedef int32_t (*iFbp_Si_t)(struct_p_t*, void*, int32_t); +typedef int32_t (*iFXibL__t)(void*, int32_t, struct_L_t*); +typedef int32_t (*iFXLbp__t)(void*, uintptr_t, struct_p_t*); +typedef int32_t (*iFXLbL__t)(void*, uintptr_t, struct_L_t*); +typedef int32_t (*iFXbL_i_t)(void*, struct_L_t*, int32_t); +typedef int32_t (*iFXbp_i_t)(void*, struct_p_t*, int32_t); +typedef int32_t (*iFXBL_p_t)(void*, struct_L_t*, void*); +typedef int32_t (*iFXbp_p_t)(void*, struct_p_t*, void*); +typedef int32_t (*iFXbL_p_t)(void*, struct_L_t*, void*); +typedef int64_t (*IEpBp_i_t)(void*, struct_p_t*, int32_t); +typedef uint32_t (*uFppbp__t)(void*, void*, struct_p_t*); +typedef uint32_t (*uFpbp_p_t)(void*, struct_p_t*, void*); +typedef uint64_t (*UEpBp_i_t)(void*, struct_p_t*, int32_t); +typedef float (*fEpBp_p_t)(void*, struct_p_t*, void*); +typedef float (*fEpBp_a_t)(void*, struct_p_t*, void*); +typedef double (*dEpBp_i_t)(void*, struct_p_t*, int32_t); +typedef double (*dEpBp_a_t)(void*, struct_p_t*, void*); +typedef intptr_t (*lEpBp_i_t)(void*, struct_p_t*, int32_t); +typedef intptr_t (*lFpbp_L_t)(void*, struct_p_t*, uintptr_t); +typedef uintptr_t (*LEpBp_i_t)(void*, struct_p_t*, int32_t); +typedef void* (*pFuXbl__t)(uint32_t, void*, struct_l_t*); +typedef void* (*pFpibp__t)(void*, int32_t, struct_p_t*); +typedef void* (*pFpubl__t)(void*, uint32_t, struct_l_t*); +typedef void* (*pEppbp__t)(void*, void*, struct_p_t*); +typedef void* (*pEppBp__t)(void*, void*, struct_p_t*); +typedef void* (*pFppbp__t)(void*, void*, struct_p_t*); +typedef void* (*pFXLbL__t)(void*, uintptr_t, struct_L_t*); +typedef void* (*pFnubp__t)(void*, uint32_t, struct_p_t*); +typedef void* (*pFnUbp__t)(void*, uint64_t, struct_p_t*); +typedef void (*vFpibpp__t)(void*, int32_t, struct_pp_t*); +typedef void (*vFpbpu_u_t)(void*, struct_pu_t*, uint32_t); +typedef void (*vFpbpu_p_t)(void*, struct_pu_t*, void*); +typedef int32_t (*iFLbpi_i_t)(uintptr_t, struct_pi_t*, int32_t); +typedef int32_t (*iFpibpu__t)(void*, int32_t, struct_pu_t*); +typedef int32_t (*iFpibpp__t)(void*, int32_t, struct_pp_t*); +typedef int32_t (*iFpubpu__t)(void*, uint32_t, struct_pu_t*); +typedef int32_t (*iEpprLL__t)(void*, void*, struct_LL_t*); +typedef int32_t (*iFppbpu__t)(void*, void*, struct_pu_t*); +typedef int32_t (*iFpbpu_u_t)(void*, struct_pu_t*, uint32_t); +typedef int32_t (*iFpbpu_p_t)(void*, struct_pu_t*, void*); +typedef int32_t (*iFXLbpp__t)(void*, uintptr_t, struct_pp_t*); +typedef int32_t (*iFXbLC_i_t)(void*, struct_LC_t*, int32_t); +typedef uint32_t (*uFpubpu__t)(void*, uint32_t, struct_pu_t*); +typedef void (*vFLbL_bL__t)(uintptr_t, struct_L_t*, struct_L_t*); +typedef void (*vFpbLdd_i_t)(void*, struct_Ldd_t*, int32_t); +typedef void (*vFpbp_bp__t)(void*, struct_p_t*, struct_p_t*); +typedef int32_t (*iFpbl_bl__t)(void*, struct_l_t*, struct_l_t*); +typedef int32_t (*iFpbL_bL__t)(void*, struct_L_t*, struct_L_t*); +typedef int32_t (*iFpbp_bp__t)(void*, struct_p_t*, struct_p_t*); +typedef int32_t (*iFbp_pbp__t)(struct_p_t*, void*, struct_p_t*); +typedef int32_t (*iFbp_bp_p_t)(struct_p_t*, struct_p_t*, void*); +typedef int32_t (*iFXbiip_i_t)(void*, struct_iip_t*, int32_t); +typedef int32_t (*iFXbLip_L_t)(void*, struct_Lip_t*, uintptr_t); +typedef void (*vFXLbpLiL__t)(void*, uintptr_t, struct_pLiL_t*); +typedef void (*vFXLrpLiL__t)(void*, uintptr_t, struct_pLiL_t*); +typedef int32_t (*iFbp_ubpu__t)(struct_p_t*, uint32_t, struct_pu_t*); +typedef int32_t (*iFbpu_pbL__t)(struct_pu_t*, void*, struct_L_t*); +typedef int32_t (*iFXLbpLiL__t)(void*, uintptr_t, struct_pLiL_t*); +typedef int32_t (*iFXLbLLii__t)(void*, uintptr_t, struct_LLii_t*); +typedef void (*vFpbpu_bpu__t)(void*, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFubpu_bpu__t)(uint32_t, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFpbpu_bpu__t)(void*, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFbpu_bpu_u_t)(struct_pu_t*, struct_pu_t*, uint32_t); +typedef int32_t (*iFXLbLWWWcc__t)(void*, uintptr_t, struct_LWWWcc_t*); +typedef void (*vFppbppuuuuup__t)(void*, void*, struct_ppuuuuup_t*); +typedef void (*vFbppuuuuup_pp_t)(struct_ppuuuuup_t*, void*, void*); +typedef int32_t (*iFppbppuuuuup__t)(void*, void*, struct_ppuuuuup_t*); +typedef int32_t (*iFbpu_bpu_bpu__t)(struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef uint32_t (*uFppbppuuuuup__t)(void*, void*, struct_ppuuuuup_t*); +typedef uintptr_t (*LFppbppuuuuup__t)(void*, void*, struct_ppuuuuup_t*); +typedef void* (*pFpibppuuuuup__t)(void*, int32_t, struct_ppuuuuup_t*); +typedef int32_t (*iEirLLLL_BLLLL__t)(int32_t, struct_LLLL_t*, struct_LLLL_t*); +typedef void* (*pEppriiiiiiiiilt__t)(void*, void*, struct_iiiiiiiiilt_t*); +typedef void* (*pFXrLiiwwwwwwwwL_p_t)(void*, struct_LiiwwwwwwwwL_t*, void*); +typedef void (*vFbppuiiiiiiiiipp_pp_t)(struct_ppuiiiiiiiiipp_t*, void*, void*); +typedef void (*vEEipp_t)(x64emu_t*, int32_t, void*, void*); +typedef void (*vFEipp_t)(x64emu_t*, int32_t, void*, void*); +typedef void (*vEEipV_t)(x64emu_t*, int32_t, void*, void*); +typedef void (*vFEpui_t)(x64emu_t*, void*, uint32_t, int32_t); +typedef void (*vEEpuu_t)(x64emu_t*, void*, uint32_t, uint32_t); +typedef void (*vEEpup_t)(x64emu_t*, void*, uint32_t, void*); +typedef void (*vFEpup_t)(x64emu_t*, void*, uint32_t, void*); +typedef void (*vFEpll_t)(x64emu_t*, void*, intptr_t, intptr_t); +typedef void (*vEEppp_t)(x64emu_t*, void*, void*, void*); +typedef void (*vFEppp_t)(x64emu_t*, void*, void*, void*); +typedef void (*vFEXLp_t)(x64emu_t*, void*, uintptr_t, void*); +typedef void (*vFEXpi_t)(x64emu_t*, void*, void*, int32_t); +typedef void (*vFcccc_t)(int8_t, int8_t, int8_t, int8_t); +typedef void (*vFwwww_t)(int16_t, int16_t, int16_t, int16_t); +typedef void (*vFiiii_t)(int32_t, int32_t, int32_t, int32_t); +typedef void (*vFiiip_t)(int32_t, int32_t, int32_t, void*); +typedef void (*vFiiCp_t)(int32_t, int32_t, uint8_t, void*); +typedef void (*vFiill_t)(int32_t, int32_t, intptr_t, intptr_t); +typedef void (*vFiIII_t)(int32_t, int64_t, int64_t, int64_t); +typedef void (*vFiuip_t)(int32_t, uint32_t, int32_t, void*); +typedef void (*vFiuuu_t)(int32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFiulp_t)(int32_t, uint32_t, intptr_t, void*); +typedef void (*vFiupV_t)(int32_t, uint32_t, void*, void*); +typedef void (*vFiUUU_t)(int32_t, uint64_t, uint64_t, uint64_t); +typedef void (*vFifff_t)(int32_t, float, float, float); +typedef void (*vFiddd_t)(int32_t, double, double, double); +typedef void (*vFilip_t)(int32_t, intptr_t, int32_t, void*); +typedef void (*vFilpu_t)(int32_t, intptr_t, void*, uint32_t); +typedef void (*vFilpp_t)(int32_t, intptr_t, void*, void*); +typedef void (*vFipup_t)(int32_t, void*, uint32_t, void*); +typedef void (*vFipll_t)(int32_t, void*, intptr_t, intptr_t); +typedef void (*vFippp_t)(int32_t, void*, void*, void*); +typedef void (*vFCCCC_t)(uint8_t, uint8_t, uint8_t, uint8_t); +typedef void (*vFWWWW_t)(uint16_t, uint16_t, uint16_t, uint16_t); +typedef void (*vFuccc_t)(uint32_t, int8_t, int8_t, int8_t); +typedef void (*vFuwww_t)(uint32_t, int16_t, int16_t, int16_t); +typedef void (*vFuiii_t)(uint32_t, int32_t, int32_t, int32_t); +typedef void (*vFuiip_t)(uint32_t, int32_t, int32_t, void*); +typedef void (*vFuiII_t)(uint32_t, int32_t, int64_t, int64_t); +typedef void (*vFuiui_t)(uint32_t, int32_t, uint32_t, int32_t); +typedef void (*vFuiuC_t)(uint32_t, int32_t, uint32_t, uint8_t); +typedef void (*vFuiuu_t)(uint32_t, int32_t, uint32_t, uint32_t); +typedef void (*vFuiup_t)(uint32_t, int32_t, uint32_t, void*); +typedef void (*vFuiUU_t)(uint32_t, int32_t, uint64_t, uint64_t); +typedef void (*vFuifi_t)(uint32_t, int32_t, float, int32_t); +typedef void (*vFuiff_t)(uint32_t, int32_t, float, float); +typedef void (*vFuidd_t)(uint32_t, int32_t, double, double); +typedef void (*vFuilp_t)(uint32_t, int32_t, intptr_t, void*); +typedef void (*vFuipu_t)(uint32_t, int32_t, void*, uint32_t); +typedef void (*vFuipp_t)(uint32_t, int32_t, void*, void*); +typedef void (*vFuIII_t)(uint32_t, int64_t, int64_t, int64_t); +typedef void (*vFuWWW_t)(uint32_t, uint16_t, uint16_t, uint16_t); +typedef void (*vFuuii_t)(uint32_t, uint32_t, int32_t, int32_t); +typedef void (*vFuuiu_t)(uint32_t, uint32_t, int32_t, uint32_t); +typedef void (*vFuuil_t)(uint32_t, uint32_t, int32_t, intptr_t); +typedef void (*vFuuip_t)(uint32_t, uint32_t, int32_t, void*); +typedef void (*vFuuCu_t)(uint32_t, uint32_t, uint8_t, uint32_t); +typedef void (*vFuuCp_t)(uint32_t, uint32_t, uint8_t, void*); +typedef void (*vFuuui_t)(uint32_t, uint32_t, uint32_t, int32_t); +typedef void (*vFuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuuuf_t)(uint32_t, uint32_t, uint32_t, float); +typedef void (*vFuuud_t)(uint32_t, uint32_t, uint32_t, double); +typedef void (*vFuuul_t)(uint32_t, uint32_t, uint32_t, intptr_t); +typedef void (*vFuuup_t)(uint32_t, uint32_t, uint32_t, void*); +typedef void (*vFuuUl_t)(uint32_t, uint32_t, uint64_t, intptr_t); +typedef void (*vFuuff_t)(uint32_t, uint32_t, float, float); +typedef void (*vFuuli_t)(uint32_t, uint32_t, intptr_t, int32_t); +typedef void (*vFuupi_t)(uint32_t, uint32_t, void*, int32_t); +typedef void (*vFuupp_t)(uint32_t, uint32_t, void*, void*); +typedef void (*vFuUui_t)(uint32_t, uint64_t, uint32_t, int32_t); +typedef void (*vFuUup_t)(uint32_t, uint64_t, uint32_t, void*); +typedef void (*vFuUUU_t)(uint32_t, uint64_t, uint64_t, uint64_t); +typedef void (*vFufff_t)(uint32_t, float, float, float); +typedef void (*vFuddd_t)(uint32_t, double, double, double); +typedef void (*vFuluU_t)(uint32_t, intptr_t, uint32_t, uint64_t); +typedef void (*vFullC_t)(uint32_t, intptr_t, intptr_t, uint8_t); +typedef void (*vFullp_t)(uint32_t, intptr_t, intptr_t, void*); +typedef void (*vFulpu_t)(uint32_t, intptr_t, void*, uint32_t); +typedef void (*vFulpp_t)(uint32_t, intptr_t, void*, void*); +typedef void (*vFupii_t)(uint32_t, void*, int32_t, int32_t); +typedef void (*vFuppi_t)(uint32_t, void*, void*, int32_t); +typedef void (*vFuppu_t)(uint32_t, void*, void*, uint32_t); +typedef void (*vFUUpi_t)(uint64_t, uint64_t, void*, int32_t); +typedef void (*vFffff_t)(float, float, float, float); +typedef void (*vFdddd_t)(double, double, double, double); +typedef void (*vFllii_t)(intptr_t, intptr_t, int32_t, int32_t); +typedef void (*vFLiii_t)(uintptr_t, int32_t, int32_t, int32_t); +typedef void (*vFpiip_t)(void*, int32_t, int32_t, void*); +typedef void (*vFpipi_t)(void*, int32_t, void*, int32_t); +typedef void (*vFpipp_t)(void*, int32_t, void*, void*); +typedef void (*vFpudd_t)(void*, uint32_t, double, double); +typedef void (*vFpdii_t)(void*, double, int32_t, int32_t); +typedef void (*vFpddd_t)(void*, double, double, double); +typedef void (*vFplpp_t)(void*, intptr_t, void*, void*); +typedef void (*vFppid_t)(void*, void*, int32_t, double); +typedef void (*vEppip_t)(void*, void*, int32_t, void*); +typedef void (*vFppui_t)(void*, void*, uint32_t, int32_t); +typedef void (*vFppuu_t)(void*, void*, uint32_t, uint32_t); +typedef void (*vFppdd_t)(void*, void*, double, double); +typedef void (*vFpppp_t)(void*, void*, void*, void*); +typedef void (*vFXiiL_t)(void*, int32_t, int32_t, uintptr_t); +typedef void (*vFXiLu_t)(void*, int32_t, uintptr_t, uint32_t); +typedef void (*vFXLii_t)(void*, uintptr_t, int32_t, int32_t); +typedef void (*vFXLip_t)(void*, uintptr_t, int32_t, void*); +typedef void (*vFXLuu_t)(void*, uintptr_t, uint32_t, uint32_t); +typedef void (*vFXLLL_t)(void*, uintptr_t, uintptr_t, uintptr_t); +typedef void (*vFXLLp_t)(void*, uintptr_t, uintptr_t, void*); +typedef void (*vFXLpi_t)(void*, uintptr_t, void*, int32_t); +typedef void (*vFXLpL_t)(void*, uintptr_t, void*, uintptr_t); +typedef void (*vFXpip_t)(void*, void*, int32_t, void*); +typedef void (*vFXppL_t)(void*, void*, void*, uintptr_t); +typedef int8_t (*cFpiii_t)(void*, int32_t, int32_t, int32_t); +typedef int32_t (*iEEiip_t)(x64emu_t*, int32_t, int32_t, void*); +typedef int32_t (*iEEiiN_t)(x64emu_t*, int32_t, int32_t, ...); +typedef int32_t (*iEEiLp_t)(x64emu_t*, int32_t, uintptr_t, void*); +typedef int32_t (*iEEipp_t)(x64emu_t*, int32_t, void*, void*); +typedef int32_t (*iFEipp_t)(x64emu_t*, int32_t, void*, void*); +typedef int32_t (*iEEipV_t)(x64emu_t*, int32_t, void*, void*); +typedef int32_t (*iEEpii_t)(x64emu_t*, void*, int32_t, int32_t); +typedef int32_t (*iEEpip_t)(x64emu_t*, void*, int32_t, void*); +typedef int32_t (*iFEpip_t)(x64emu_t*, void*, int32_t, void*); +typedef int32_t (*iFEpui_t)(x64emu_t*, void*, uint32_t, int32_t); +typedef int32_t (*iFEpuu_t)(x64emu_t*, void*, uint32_t, uint32_t); +typedef int32_t (*iEEpup_t)(x64emu_t*, void*, uint32_t, void*); +typedef int32_t (*iFEpup_t)(x64emu_t*, void*, uint32_t, void*); +typedef int32_t (*iFEpll_t)(x64emu_t*, void*, intptr_t, intptr_t); +typedef int32_t (*iEEpLi_t)(x64emu_t*, void*, uintptr_t, int32_t); +typedef int32_t (*iFEpLi_t)(x64emu_t*, void*, uintptr_t, int32_t); +typedef int32_t (*iEEppi_t)(x64emu_t*, void*, void*, int32_t); +typedef int32_t (*iFEppi_t)(x64emu_t*, void*, void*, int32_t); +typedef int32_t (*iFEppu_t)(x64emu_t*, void*, void*, uint32_t); +typedef int32_t (*iEEppL_t)(x64emu_t*, void*, void*, uintptr_t); +typedef int32_t (*iEEppp_t)(x64emu_t*, void*, void*, void*); +typedef int32_t (*iFEppp_t)(x64emu_t*, void*, void*, void*); +typedef int32_t (*iEEppV_t)(x64emu_t*, void*, void*, void*); +typedef int32_t (*iFEppV_t)(x64emu_t*, void*, void*, void*); +typedef int32_t (*iEEpON_t)(x64emu_t*, void*, int32_t, ...); +typedef int32_t (*iEEhup_t)(x64emu_t*, uintptr_t, uint32_t, void*); +typedef int32_t (*iEESpp_t)(x64emu_t*, void*, void*, void*); +typedef int32_t (*iEESpV_t)(x64emu_t*, void*, void*, void*); +typedef int32_t (*iFEXip_t)(x64emu_t*, void*, int32_t, void*); +typedef int32_t (*iFEXup_t)(x64emu_t*, void*, uint32_t, void*); +typedef int32_t (*iFEXlp_t)(x64emu_t*, void*, intptr_t, void*); +typedef int32_t (*iFEXLp_t)(x64emu_t*, void*, uintptr_t, void*); +typedef int32_t (*iFEXpp_t)(x64emu_t*, void*, void*, void*); +typedef int32_t (*iFiiii_t)(int32_t, int32_t, int32_t, int32_t); +typedef int32_t (*iFiiiu_t)(int32_t, int32_t, int32_t, uint32_t); +typedef int32_t (*iEiiip_t)(int32_t, int32_t, int32_t, void*); +typedef int32_t (*iEiiiN_t)(int32_t, int32_t, int32_t, ...); +typedef int32_t (*iEiiII_t)(int32_t, int32_t, int64_t, int64_t); +typedef int32_t (*iEiIIi_t)(int32_t, int64_t, int64_t, int32_t); +typedef int32_t (*iFiuii_t)(int32_t, uint32_t, int32_t, int32_t); +typedef int32_t (*iFiuuU_t)(int32_t, uint32_t, uint32_t, uint64_t); +typedef int32_t (*iFiuup_t)(int32_t, uint32_t, uint32_t, void*); +typedef int32_t (*iFiupu_t)(int32_t, uint32_t, void*, uint32_t); +typedef int32_t (*iFiupp_t)(int32_t, uint32_t, void*, void*); +typedef int32_t (*iEilli_t)(int32_t, intptr_t, intptr_t, int32_t); +typedef int32_t (*iFiLpL_t)(int32_t, uintptr_t, void*, uintptr_t); +typedef int32_t (*iEipii_t)(int32_t, void*, int32_t, int32_t); +typedef int32_t (*iEipip_t)(int32_t, void*, int32_t, void*); +typedef int32_t (*iEipui_t)(int32_t, void*, uint32_t, int32_t); +typedef int32_t (*iFipup_t)(int32_t, void*, uint32_t, void*); +typedef int32_t (*iFipLp_t)(int32_t, void*, uintptr_t, void*); +typedef int32_t (*iEippi_t)(int32_t, void*, void*, int32_t); +typedef int32_t (*iFippu_t)(int32_t, void*, void*, uint32_t); +typedef int32_t (*iEippL_t)(int32_t, void*, void*, uintptr_t); +typedef int32_t (*iFippp_t)(int32_t, void*, void*, void*); +typedef int32_t (*iEipON_t)(int32_t, void*, int32_t, ...); +typedef int32_t (*iFuiup_t)(uint32_t, int32_t, uint32_t, void*); +typedef int32_t (*iFupLp_t)(uint32_t, void*, uintptr_t, void*); +typedef int32_t (*iFuppp_t)(uint32_t, void*, void*, void*); +typedef int32_t (*iFUpLp_t)(uint64_t, void*, uintptr_t, void*); +typedef int32_t (*iFpiii_t)(void*, int32_t, int32_t, int32_t); +typedef int32_t (*iFpiiL_t)(void*, int32_t, int32_t, uintptr_t); +typedef int32_t (*iFpiip_t)(void*, int32_t, int32_t, void*); +typedef int32_t (*iFpiII_t)(void*, int32_t, int64_t, int64_t); +typedef int32_t (*iFpiuu_t)(void*, int32_t, uint32_t, uint32_t); +typedef int32_t (*iFpili_t)(void*, int32_t, intptr_t, int32_t); +typedef int32_t (*iFpipu_t)(void*, int32_t, void*, uint32_t); +typedef int32_t (*iFpipL_t)(void*, int32_t, void*, uintptr_t); +typedef int32_t (*iEpipp_t)(void*, int32_t, void*, void*); +typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*); +typedef int32_t (*iFpCCC_t)(void*, uint8_t, uint8_t, uint8_t); +typedef int32_t (*iFpWWu_t)(void*, uint16_t, uint16_t, uint32_t); +typedef int32_t (*iEpuiL_t)(void*, uint32_t, int32_t, uintptr_t); +typedef int32_t (*iFpuuu_t)(void*, uint32_t, uint32_t, uint32_t); +typedef int32_t (*iFpuuU_t)(void*, uint32_t, uint32_t, uint64_t); +typedef int32_t (*iFpuup_t)(void*, uint32_t, uint32_t, void*); +typedef int32_t (*iFpuLp_t)(void*, uint32_t, uintptr_t, void*); +typedef int32_t (*iFpupi_t)(void*, uint32_t, void*, int32_t); +typedef int32_t (*iFpupu_t)(void*, uint32_t, void*, uint32_t); +typedef int32_t (*iFpupL_t)(void*, uint32_t, void*, uintptr_t); +typedef int32_t (*iFpupp_t)(void*, uint32_t, void*, void*); +typedef int32_t (*iFpLuu_t)(void*, uintptr_t, uint32_t, uint32_t); +typedef int32_t (*iFpLpp_t)(void*, uintptr_t, void*, void*); +typedef int32_t (*iFppii_t)(void*, void*, int32_t, int32_t); +typedef int32_t (*iFppiU_t)(void*, void*, int32_t, uint64_t); +typedef int32_t (*iFppip_t)(void*, void*, int32_t, void*); +typedef int32_t (*iFppWp_t)(void*, void*, uint16_t, void*); +typedef int32_t (*iFppuw_t)(void*, void*, uint32_t, int16_t); +typedef int32_t (*iFppui_t)(void*, void*, uint32_t, int32_t); +typedef int32_t (*iFppuu_t)(void*, void*, uint32_t, uint32_t); +typedef int32_t (*iFppup_t)(void*, void*, uint32_t, void*); +typedef int32_t (*iFppLi_t)(void*, void*, uintptr_t, int32_t); +typedef int32_t (*iFppLI_t)(void*, void*, uintptr_t, int64_t); +typedef int32_t (*iFppLu_t)(void*, void*, uintptr_t, uint32_t); +typedef int32_t (*iFppLp_t)(void*, void*, uintptr_t, void*); +typedef int32_t (*iFpppi_t)(void*, void*, void*, int32_t); +typedef int32_t (*iFpppu_t)(void*, void*, void*, uint32_t); +typedef int32_t (*iEpppL_t)(void*, void*, void*, uintptr_t); +typedef int32_t (*iFpppL_t)(void*, void*, void*, uintptr_t); +typedef int32_t (*iEpppp_t)(void*, void*, void*, void*); +typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); +typedef int32_t (*iESpiL_t)(void*, void*, int32_t, uintptr_t); +typedef int32_t (*iFXiii_t)(void*, int32_t, int32_t, int32_t); +typedef int32_t (*iFXiiL_t)(void*, int32_t, int32_t, uintptr_t); +typedef int32_t (*iFXiip_t)(void*, int32_t, int32_t, void*); +typedef int32_t (*iFXiuL_t)(void*, int32_t, uint32_t, uintptr_t); +typedef int32_t (*iFXiLL_t)(void*, int32_t, uintptr_t, uintptr_t); +typedef int32_t (*iFXipi_t)(void*, int32_t, void*, int32_t); +typedef int32_t (*iFXipp_t)(void*, int32_t, void*, void*); +typedef int32_t (*iFXWWW_t)(void*, uint16_t, uint16_t, uint16_t); +typedef int32_t (*iFXuuu_t)(void*, uint32_t, uint32_t, uint32_t); +typedef int32_t (*iFXuuL_t)(void*, uint32_t, uint32_t, uintptr_t); +typedef int32_t (*iFXuup_t)(void*, uint32_t, uint32_t, void*); +typedef int32_t (*iFXuLL_t)(void*, uint32_t, uintptr_t, uintptr_t); +typedef int32_t (*iFXupp_t)(void*, uint32_t, void*, void*); +typedef int32_t (*iFXLii_t)(void*, uintptr_t, int32_t, int32_t); +typedef int32_t (*iFXLiL_t)(void*, uintptr_t, int32_t, uintptr_t); +typedef int32_t (*iFXLip_t)(void*, uintptr_t, int32_t, void*); +typedef int32_t (*iFXLuu_t)(void*, uintptr_t, uint32_t, uint32_t); +typedef int32_t (*iFXLLL_t)(void*, uintptr_t, uintptr_t, uintptr_t); +typedef int32_t (*iFXLLp_t)(void*, uintptr_t, uintptr_t, void*); +typedef int32_t (*iFXLpi_t)(void*, uintptr_t, void*, int32_t); +typedef int32_t (*iFXpii_t)(void*, void*, int32_t, int32_t); +typedef int32_t (*iFXpip_t)(void*, void*, int32_t, void*); +typedef int32_t (*iFXpLp_t)(void*, void*, uintptr_t, void*); +typedef int32_t (*iFXppi_t)(void*, void*, void*, int32_t); +typedef int32_t (*iFXppp_t)(void*, void*, void*, void*); +typedef int64_t (*IFEpIi_t)(x64emu_t*, void*, int64_t, int32_t); +typedef uint8_t (*CFuuff_t)(uint32_t, uint32_t, float, float); +typedef uint32_t (*uFEuip_t)(x64emu_t*, uint32_t, int32_t, void*); +typedef uint32_t (*uFEpii_t)(x64emu_t*, void*, int32_t, int32_t); +typedef uint32_t (*uFEpip_t)(x64emu_t*, void*, int32_t, void*); +typedef uint32_t (*uFEpiV_t)(x64emu_t*, void*, int32_t, void*); +typedef uint32_t (*uFEpup_t)(x64emu_t*, void*, uint32_t, void*); +typedef uint32_t (*uFEpLL_t)(x64emu_t*, void*, uintptr_t, uintptr_t); +typedef uint32_t (*uFuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t); +typedef uint32_t (*uFuppd_t)(uint32_t, void*, void*, double); +typedef uint32_t (*uFpiip_t)(void*, int32_t, int32_t, void*); +typedef uint32_t (*uFpCCC_t)(void*, uint8_t, uint8_t, uint8_t); +typedef uint32_t (*uFppii_t)(void*, void*, int32_t, int32_t); +typedef uint32_t (*uFppip_t)(void*, void*, int32_t, void*); +typedef uint32_t (*uFpppi_t)(void*, void*, void*, int32_t); +typedef uint32_t (*uFpppd_t)(void*, void*, void*, double); +typedef uint32_t (*uFpppp_t)(void*, void*, void*, void*); +typedef intptr_t (*lEEipi_t)(x64emu_t*, int32_t, void*, int32_t); +typedef intptr_t (*lEEipL_t)(x64emu_t*, int32_t, void*, uintptr_t); +typedef intptr_t (*lEEppL_t)(x64emu_t*, void*, void*, uintptr_t); +typedef intptr_t (*lEiipL_t)(int32_t, int32_t, void*, uintptr_t); +typedef intptr_t (*lEipLi_t)(int32_t, void*, uintptr_t, int32_t); +typedef intptr_t (*lEipLI_t)(int32_t, void*, uintptr_t, int64_t); +typedef intptr_t (*lEipLl_t)(int32_t, void*, uintptr_t, intptr_t); +typedef intptr_t (*lEipLL_t)(int32_t, void*, uintptr_t, uintptr_t); +typedef intptr_t (*lFpuip_t)(void*, uint32_t, int32_t, void*); +typedef intptr_t (*lFppLp_t)(void*, void*, uintptr_t, void*); +typedef uintptr_t (*LFEpLp_t)(x64emu_t*, void*, uintptr_t, void*); +typedef uintptr_t (*LFEXii_t)(x64emu_t*, void*, int32_t, int32_t); +typedef uintptr_t (*LEpLLS_t)(void*, uintptr_t, uintptr_t, void*); +typedef uintptr_t (*LEppLL_t)(void*, void*, uintptr_t, uintptr_t); +typedef uintptr_t (*LEppLp_t)(void*, void*, uintptr_t, void*); +typedef uintptr_t (*LEppLa_t)(void*, void*, uintptr_t, void*); +typedef uintptr_t (*LFXCii_t)(void*, uint8_t, int32_t, int32_t); +typedef uintptr_t (*LFXLuu_t)(void*, uintptr_t, uint32_t, uint32_t); +typedef uintptr_t (*LFXpLp_t)(void*, void*, uintptr_t, void*); +typedef void* (*pFEupi_t)(x64emu_t*, uint32_t, void*, int32_t); +typedef void* (*pFEupp_t)(x64emu_t*, uint32_t, void*, void*); +typedef void* (*pEEpii_t)(x64emu_t*, void*, int32_t, int32_t); +typedef void* (*pEEpip_t)(x64emu_t*, void*, int32_t, void*); +typedef void* (*pFEpip_t)(x64emu_t*, void*, int32_t, void*); +typedef void* (*pFEpui_t)(x64emu_t*, void*, uint32_t, int32_t); +typedef void* (*pEEppi_t)(x64emu_t*, void*, void*, int32_t); +typedef void* (*pFEppi_t)(x64emu_t*, void*, void*, int32_t); +typedef void* (*pEEppp_t)(x64emu_t*, void*, void*, void*); +typedef void* (*pFEppp_t)(x64emu_t*, void*, void*, void*); +typedef void* (*pFEXip_t)(x64emu_t*, void*, int32_t, void*); +typedef void* (*pFEXCL_t)(x64emu_t*, void*, uint8_t, uintptr_t); +typedef void* (*pFEXuu_t)(x64emu_t*, void*, uint32_t, uint32_t); +typedef void* (*pFEXLL_t)(x64emu_t*, void*, uintptr_t, uintptr_t); +typedef void* (*pFEXLp_t)(x64emu_t*, void*, uintptr_t, void*); +typedef void* (*pFEXpL_t)(x64emu_t*, void*, void*, uintptr_t); +typedef void* (*pFEXpp_t)(x64emu_t*, void*, void*, void*); +typedef void* (*pFiiiu_t)(int32_t, int32_t, int32_t, uint32_t); +typedef void* (*pFifff_t)(int32_t, float, float, float); +typedef void* (*pFillu_t)(int32_t, intptr_t, intptr_t, uint32_t); +typedef void* (*pEippu_t)(int32_t, void*, void*, uint32_t); +typedef void* (*pFullu_t)(uint32_t, intptr_t, intptr_t, uint32_t); +typedef void* (*pFdddd_t)(double, double, double, double); +typedef void* (*pFpiii_t)(void*, int32_t, int32_t, int32_t); +typedef void* (*pFpiip_t)(void*, int32_t, int32_t, void*); +typedef void* (*pEpiLL_t)(void*, int32_t, uintptr_t, uintptr_t); +typedef void* (*pFpipc_t)(void*, int32_t, void*, int8_t); +typedef void* (*pFpipi_t)(void*, int32_t, void*, int32_t); +typedef void* (*pFpipp_t)(void*, int32_t, void*, void*); +typedef void* (*pFpuii_t)(void*, uint32_t, int32_t, int32_t); +typedef void* (*pFpupu_t)(void*, uint32_t, void*, uint32_t); +typedef void* (*pFpupp_t)(void*, uint32_t, void*, void*); +typedef void* (*pEpLiS_t)(void*, uintptr_t, int32_t, void*); +typedef void* (*pEpLpL_t)(void*, uintptr_t, void*, uintptr_t); +typedef void* (*pFpLpL_t)(void*, uintptr_t, void*, uintptr_t); +typedef void* (*pEppLL_t)(void*, void*, uintptr_t, uintptr_t); +typedef void* (*pFppLp_t)(void*, void*, uintptr_t, void*); +typedef void* (*pFpppi_t)(void*, void*, void*, int32_t); +typedef void* (*pFpppL_t)(void*, void*, void*, uintptr_t); +typedef void* (*pFpppp_t)(void*, void*, void*, void*); +typedef void* (*pFXiii_t)(void*, int32_t, int32_t, int32_t); +typedef void* (*pFXiip_t)(void*, int32_t, int32_t, void*); +typedef void* (*pFXLpp_t)(void*, uintptr_t, void*, void*); +typedef void* (*pFXppp_t)(void*, void*, void*, void*); +typedef void (*vFuibp_i_t)(uint32_t, int32_t, struct_p_t*, int32_t); +typedef void (*vFuuuBp__t)(uint32_t, uint32_t, uint32_t, struct_p_t*); +typedef void (*vFbp_ppp_t)(struct_p_t*, void*, void*, void*); +typedef void (*vFXLLbL__t)(void*, uintptr_t, uintptr_t, struct_L_t*); +typedef int32_t (*iFEpbL_p_t)(x64emu_t*, void*, struct_L_t*, void*); +typedef int32_t (*iFpipbL__t)(void*, int32_t, void*, struct_L_t*); +typedef int32_t (*iFpupbL__t)(void*, uint32_t, void*, struct_L_t*); +typedef int32_t (*iFpubp_u_t)(void*, uint32_t, struct_p_t*, uint32_t); +typedef int32_t (*iFplibl__t)(void*, intptr_t, int32_t, struct_l_t*); +typedef int32_t (*iFpLpbL__t)(void*, uintptr_t, void*, struct_L_t*); +typedef int32_t (*iFppWbp__t)(void*, void*, uint16_t, struct_p_t*); +typedef int32_t (*iFpppbp__t)(void*, void*, void*, struct_p_t*); +typedef int32_t (*iFpppbL__t)(void*, void*, void*, struct_L_t*); +typedef int32_t (*iFppbp_u_t)(void*, void*, struct_p_t*, uint32_t); +typedef int32_t (*iFppbL_p_t)(void*, void*, struct_L_t*, void*); +typedef int32_t (*iFpbp_ii_t)(void*, struct_p_t*, int32_t, int32_t); +typedef int32_t (*iFpbp_ip_t)(void*, struct_p_t*, int32_t, void*); +typedef int32_t (*iFpbp_uu_t)(void*, struct_p_t*, uint32_t, uint32_t); +typedef int32_t (*iFpbp_pp_t)(void*, struct_p_t*, void*, void*); +typedef int32_t (*iFbp_upL_t)(struct_p_t*, uint32_t, void*, uintptr_t); +typedef int32_t (*iFbp_pii_t)(struct_p_t*, void*, int32_t, int32_t); +typedef int32_t (*iFbp_pip_t)(struct_p_t*, void*, int32_t, void*); +typedef int32_t (*iFBp_pui_t)(struct_p_t*, void*, uint32_t, int32_t); +typedef int32_t (*iFbp_ppu_t)(struct_p_t*, void*, void*, uint32_t); +typedef int32_t (*iFXLiBp__t)(void*, uintptr_t, int32_t, struct_p_t*); +typedef int32_t (*iFXLbp_i_t)(void*, uintptr_t, struct_p_t*, int32_t); +typedef int32_t (*iFXLbL_i_t)(void*, uintptr_t, struct_L_t*, int32_t); +typedef int32_t (*iFXLbp_p_t)(void*, uintptr_t, struct_p_t*, void*); +typedef int64_t (*IEpBp_ii_t)(void*, struct_p_t*, int32_t, int32_t); +typedef int64_t (*IEpBp_ia_t)(void*, struct_p_t*, int32_t, void*); +typedef uint32_t (*uFppibp__t)(void*, void*, int32_t, struct_p_t*); +typedef uint32_t (*uFppibl__t)(void*, void*, int32_t, struct_l_t*); +typedef uint32_t (*uFppbp_i_t)(void*, void*, struct_p_t*, int32_t); +typedef uint32_t (*uFpbp_ip_t)(void*, struct_p_t*, int32_t, void*); +typedef uint64_t (*UEpBp_ii_t)(void*, struct_p_t*, int32_t, int32_t); +typedef uint64_t (*UEpBp_ia_t)(void*, struct_p_t*, int32_t, void*); +typedef intptr_t (*lEiibl_L_t)(int32_t, int32_t, struct_l_t*, uintptr_t); +typedef uintptr_t (*LEpBp_ii_t)(void*, struct_p_t*, int32_t, int32_t); +typedef uintptr_t (*LEpbp_Lp_t)(void*, struct_p_t*, uintptr_t, void*); +typedef void* (*pFpppbl__t)(void*, void*, void*, struct_l_t*); +typedef void (*vFpibpp_i_t)(void*, int32_t, struct_pp_t*, int32_t); +typedef int32_t (*iEEpprLL__t)(x64emu_t*, void*, void*, struct_LL_t*); +typedef int32_t (*iFuubpu_u_t)(uint32_t, uint32_t, struct_pu_t*, uint32_t); +typedef int32_t (*iFpuubpu__t)(void*, uint32_t, uint32_t, struct_pu_t*); +typedef int32_t (*iFpupbpu__t)(void*, uint32_t, void*, struct_pu_t*); +typedef int32_t (*iFpubpu_u_t)(void*, uint32_t, struct_pu_t*, uint32_t); +typedef int32_t (*iEpurLL_p_t)(void*, uint32_t, struct_LL_t*, void*); +typedef int32_t (*iFppubpu__t)(void*, void*, uint32_t, struct_pu_t*); +typedef int32_t (*iFppbpu_u_t)(void*, void*, struct_pu_t*, uint32_t); +typedef int32_t (*iFpbpu_uu_t)(void*, struct_pu_t*, uint32_t, uint32_t); +typedef int32_t (*iFpbpu_up_t)(void*, struct_pu_t*, uint32_t, void*); +typedef int32_t (*iFbpu_ppp_t)(struct_pu_t*, void*, void*, void*); +typedef int32_t (*iFnbpL_iU_t)(void*, struct_pL_t*, int32_t, uint64_t); +typedef intptr_t (*lFppLbLL__t)(void*, void*, uintptr_t, struct_LL_t*); +typedef void* (*pFnbpi_up_t)(void*, struct_pi_t*, uint32_t, void*); +typedef void (*vFppbp_bL__t)(void*, void*, struct_p_t*, struct_L_t*); +typedef void (*vFpbLdd_ip_t)(void*, struct_Ldd_t*, int32_t, void*); +typedef void (*vFpbupu_uu_t)(void*, struct_upu_t*, uint32_t, uint32_t); +typedef int32_t (*iFupbp_bp__t)(uint32_t, void*, struct_p_t*, struct_p_t*); +typedef int32_t (*iFppbL_bL__t)(void*, void*, struct_L_t*, struct_L_t*); +typedef int32_t (*iFppbp_bp__t)(void*, void*, struct_p_t*, struct_p_t*); +typedef int32_t (*iFppbp_bL__t)(void*, void*, struct_p_t*, struct_L_t*); +typedef int32_t (*iFpbupu_up_t)(void*, struct_upu_t*, uint32_t, void*); +typedef int32_t (*iFbp_urp_u_t)(struct_p_t*, uint32_t, struct_p_t*, uint32_t); +typedef int32_t (*iFrpuu_Lui_t)(struct_puu_t*, uintptr_t, uint32_t, int32_t); +typedef int32_t (*iEbp_bL_iS_t)(struct_p_t*, struct_L_t*, int32_t, void*); +typedef int32_t (*iFbp_bp_pi_t)(struct_p_t*, struct_p_t*, void*, int32_t); +typedef int32_t (*iFXbL_ibp__t)(void*, struct_L_t*, int32_t, struct_p_t*); +typedef int32_t (*iFnubp_bp__t)(void*, uint32_t, struct_p_t*, struct_p_t*); +typedef int32_t (*iFnUbp_bp__t)(void*, uint64_t, struct_p_t*, struct_p_t*); +typedef void (*vFEpuBLLLL__t)(x64emu_t*, void*, uint32_t, struct_LLLL_t*); +typedef void (*vFbp_ppbup__t)(struct_p_t*, void*, void*, struct_up_t*); +typedef void (*vFXLbpLiL_L_t)(void*, uintptr_t, struct_pLiL_t*, uintptr_t); +typedef int32_t (*iFubpu_pbL__t)(uint32_t, struct_pu_t*, void*, struct_L_t*); +typedef int32_t (*iFpbpu_pbL__t)(void*, struct_pu_t*, void*, struct_L_t*); +typedef int32_t (*iFpbpu_bp_u_t)(void*, struct_pu_t*, struct_p_t*, uint32_t); +typedef int32_t (*iFbpu_upbL__t)(struct_pu_t*, uint32_t, void*, struct_L_t*); +typedef int32_t (*iFbp_pbpu_u_t)(struct_p_t*, void*, struct_pu_t*, uint32_t); +typedef int32_t (*iFXLbpLiL_L_t)(void*, uintptr_t, struct_pLiL_t*, uintptr_t); +typedef int32_t (*iEiirLL_BLL__t)(int32_t, int32_t, struct_LL_t*, struct_LL_t*); +typedef int32_t (*iEuirLL_BLL__t)(uint32_t, int32_t, struct_LL_t*, struct_LL_t*); +typedef int32_t (*iFpubpu_bpu__t)(void*, uint32_t, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFppbpu_bpu__t)(void*, void*, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFpbpu_Lbpu__t)(void*, struct_pu_t*, uintptr_t, struct_pu_t*); +typedef int32_t (*iFpbpu_bpu_u_t)(void*, struct_pu_t*, struct_pu_t*, uint32_t); +typedef int32_t (*iFpbpu_bpu_p_t)(void*, struct_pu_t*, struct_pu_t*, void*); +typedef int32_t (*iFXLpbLWWWcc__t)(void*, uintptr_t, void*, struct_LWWWcc_t*); +typedef int32_t (*iFXLbLWWWcc_i_t)(void*, uintptr_t, struct_LWWWcc_t*, int32_t); +typedef void* (*pESBppppii_pi_t)(void*, struct_ppppii_t*, void*, int32_t); +typedef int32_t (*iFEprllll_rll__t)(x64emu_t*, void*, struct_llll_t*, struct_ll_t*); +typedef int32_t (*iEupuBpppiiip__t)(uint32_t, void*, uint32_t, struct_pppiiip_t*); +typedef int32_t (*iFbp_ubpu_bpu__t)(struct_p_t*, uint32_t, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFXLuriiiiiLi__t)(void*, uintptr_t, uint32_t, struct_iiiiiLi_t*); +typedef uint32_t (*uFnibpL_bLpCC__t)(void*, int32_t, struct_pL_t*, struct_LpCC_t*); +typedef int32_t (*iFppubppuuuuup__t)(void*, void*, uint32_t, struct_ppuuuuup_t*); +typedef int32_t (*iFpruuipWCCp_ll_t)(void*, struct_uuipWCCp_t*, intptr_t, intptr_t); +typedef int32_t (*iFpbLL_bLL_bLL__t)(void*, struct_LL_t*, struct_LL_t*, struct_LL_t*); +typedef void* (*pFppibppuuuuup__t)(void*, void*, int32_t, struct_ppuuuuup_t*); +typedef void (*vFXLbLLLLLLLLLL_L_t)(void*, uintptr_t, struct_LLLLLLLLLL_t*, uintptr_t); +typedef int32_t (*iFXLbLLLLLLLLLL_L_t)(void*, uintptr_t, struct_LLLLLLLLLL_t*, uintptr_t); +typedef uintptr_t (*LEpLpriiiiiiiiilt__t)(void*, uintptr_t, void*, struct_iiiiiiiiilt_t*); +typedef int32_t (*iFXipBWWWWWWWWWuip__t)(void*, int32_t, void*, struct_WWWWWWWWWuip_t*); +typedef int32_t (*iFXLbLWWWcc_bLWWWcc__t)(void*, uintptr_t, struct_LWWWcc_t*, struct_LWWWcc_t*); +typedef uint32_t (*uFEbppuiiiiiiiiipp_ip_t)(x64emu_t*, struct_ppuiiiiiiiiipp_t*, int32_t, void*); +typedef uint32_t (*uFbppuiiiiiiiiipp_ipi_t)(struct_ppuiiiiiiiiipp_t*, int32_t, void*, int32_t); +typedef int32_t (*iFpruuipWCCp_buuipWCCp_i_t)(void*, struct_uuipWCCp_t*, struct_uuipWCCp_t*, int32_t); +typedef int32_t (*iFXpLriLLLiiiiiiiLLiiLiiiiLic__t)(void*, void*, uintptr_t, struct_iLLLiiiiiiiLLiiLiiiiLic_t*); +typedef int32_t (*iFXpLbiLLLiiiiiiiLLiiLiiiiLic__t)(void*, void*, uintptr_t, struct_iLLLiiiiiiiLLiiLiiiiLic_t*); +typedef void* (*pFXLLbiLLLiiiiiiiLLiiLiiiiLic__t)(void*, uintptr_t, uintptr_t, struct_iLLLiiiiiiiLLiiLiiiiLic_t*); +typedef uint32_t (*uFbppuiiiiiiiiipp_ipbppuiiiiiiiiipp__t)(struct_ppuiiiiiiiiipp_t*, int32_t, void*, struct_ppuiiiiiiiiipp_t*); +typedef void (*vEEiipp_t)(x64emu_t*, int32_t, int32_t, void*, void*); +typedef void (*vEEiipV_t)(x64emu_t*, int32_t, int32_t, void*, void*); +typedef void (*vFEuipu_t)(x64emu_t*, uint32_t, int32_t, void*, uint32_t); +typedef void (*vFEuipp_t)(x64emu_t*, uint32_t, int32_t, void*, void*); +typedef void (*vEEpLLp_t)(x64emu_t*, void*, uintptr_t, uintptr_t, void*); +typedef void (*vEEppiV_t)(x64emu_t*, void*, void*, int32_t, void*); +typedef void (*vFEpppp_t)(x64emu_t*, void*, void*, void*, void*); +typedef void (*vFEXLpL_t)(x64emu_t*, void*, uintptr_t, void*, uintptr_t); +typedef void (*vFiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFiiiiu_t)(int32_t, int32_t, int32_t, int32_t, uint32_t); +typedef void (*vFiiuii_t)(int32_t, int32_t, uint32_t, int32_t, int32_t); +typedef void (*vFiiuup_t)(int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFiillu_t)(int32_t, int32_t, intptr_t, intptr_t, uint32_t); +typedef void (*vFiilll_t)(int32_t, int32_t, intptr_t, intptr_t, intptr_t); +typedef void (*vFiipll_t)(int32_t, int32_t, void*, intptr_t, intptr_t); +typedef void (*vFiIIII_t)(int32_t, int64_t, int64_t, int64_t, int64_t); +typedef void (*vFiuiip_t)(int32_t, uint32_t, int32_t, int32_t, void*); +typedef void (*vFiuuuu_t)(int32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFiulpp_t)(int32_t, uint32_t, intptr_t, void*, void*); +typedef void (*vFiUUUU_t)(int32_t, uint64_t, uint64_t, uint64_t, uint64_t); +typedef void (*vFiffff_t)(int32_t, float, float, float, float); +typedef void (*vFidddd_t)(int32_t, double, double, double, double); +typedef void (*vFilill_t)(int32_t, intptr_t, int32_t, intptr_t, intptr_t); +typedef void (*vFilipi_t)(int32_t, intptr_t, int32_t, void*, int32_t); +typedef void (*vFilipl_t)(int32_t, intptr_t, int32_t, void*, intptr_t); +typedef void (*vFipipu_t)(int32_t, void*, int32_t, void*, uint32_t); +typedef void (*vFipipp_t)(int32_t, void*, int32_t, void*, void*); +typedef void (*vFipupi_t)(int32_t, void*, uint32_t, void*, int32_t); +typedef void (*vFucccc_t)(uint32_t, int8_t, int8_t, int8_t, int8_t); +typedef void (*vFuwwww_t)(uint32_t, int16_t, int16_t, int16_t, int16_t); +typedef void (*vFuiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuiiiu_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t); +typedef void (*vFuiiip_t)(uint32_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFuiiCp_t)(uint32_t, int32_t, int32_t, uint8_t, void*); +typedef void (*vFuiiup_t)(uint32_t, int32_t, int32_t, uint32_t, void*); +typedef void (*vFuiill_t)(uint32_t, int32_t, int32_t, intptr_t, intptr_t); +typedef void (*vFuiIII_t)(uint32_t, int32_t, int64_t, int64_t, int64_t); +typedef void (*vFuiuii_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t); +typedef void (*vFuiuip_t)(uint32_t, int32_t, uint32_t, int32_t, void*); +typedef void (*vFuiuCi_t)(uint32_t, int32_t, uint32_t, uint8_t, int32_t); +typedef void (*vFuiuCu_t)(uint32_t, int32_t, uint32_t, uint8_t, uint32_t); +typedef void (*vFuiuuu_t)(uint32_t, int32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuiuup_t)(uint32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuiupi_t)(uint32_t, int32_t, uint32_t, void*, int32_t); +typedef void (*vFuiUUU_t)(uint32_t, int32_t, uint64_t, uint64_t, uint64_t); +typedef void (*vFuifff_t)(uint32_t, int32_t, float, float, float); +typedef void (*vFuiddd_t)(uint32_t, int32_t, double, double, double); +typedef void (*vFuipii_t)(uint32_t, int32_t, void*, int32_t, int32_t); +typedef void (*vFuipip_t)(uint32_t, int32_t, void*, int32_t, void*); +typedef void (*vFuipup_t)(uint32_t, int32_t, void*, uint32_t, void*); +typedef void (*vFuippp_t)(uint32_t, int32_t, void*, void*, void*); +typedef void (*vFuIIII_t)(uint32_t, int64_t, int64_t, int64_t, int64_t); +typedef void (*vFuCCCC_t)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t); +typedef void (*vFuCuip_t)(uint32_t, uint8_t, uint32_t, int32_t, void*); +typedef void (*vFuCuup_t)(uint32_t, uint8_t, uint32_t, uint32_t, void*); +typedef void (*vFuWWWW_t)(uint32_t, uint16_t, uint16_t, uint16_t, uint16_t); +typedef void (*vFuuiii_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t); +typedef void (*vFuuiip_t)(uint32_t, uint32_t, int32_t, int32_t, void*); +typedef void (*vFuuiui_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t); +typedef void (*vFuuiuu_t)(uint32_t, uint32_t, int32_t, uint32_t, uint32_t); +typedef void (*vFuuiup_t)(uint32_t, uint32_t, int32_t, uint32_t, void*); +typedef void (*vFuuifi_t)(uint32_t, uint32_t, int32_t, float, int32_t); +typedef void (*vFuuipC_t)(uint32_t, uint32_t, int32_t, void*, uint8_t); +typedef void (*vFuuipu_t)(uint32_t, uint32_t, int32_t, void*, uint32_t); +typedef void (*vFuuipp_t)(uint32_t, uint32_t, int32_t, void*, void*); +typedef void (*vFuuuii_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t); +typedef void (*vFuuuiu_t)(uint32_t, uint32_t, uint32_t, int32_t, uint32_t); +typedef void (*vFuuuil_t)(uint32_t, uint32_t, uint32_t, int32_t, intptr_t); +typedef void (*vFuuuip_t)(uint32_t, uint32_t, uint32_t, int32_t, void*); +typedef void (*vFuuuui_t)(uint32_t, uint32_t, uint32_t, uint32_t, int32_t); +typedef void (*vFuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuuuup_t)(uint32_t, uint32_t, uint32_t, uint32_t, void*); +typedef void (*vFuuuli_t)(uint32_t, uint32_t, uint32_t, intptr_t, int32_t); +typedef void (*vFuuull_t)(uint32_t, uint32_t, uint32_t, intptr_t, intptr_t); +typedef void (*vFuulll_t)(uint32_t, uint32_t, intptr_t, intptr_t, intptr_t); +typedef void (*vFuullp_t)(uint32_t, uint32_t, intptr_t, intptr_t, void*); +typedef void (*vFuupii_t)(uint32_t, uint32_t, void*, int32_t, int32_t); +typedef void (*vFuUUUU_t)(uint32_t, uint64_t, uint64_t, uint64_t, uint64_t); +typedef void (*vFuffff_t)(uint32_t, float, float, float, float); +typedef void (*vFudddd_t)(uint32_t, double, double, double, double); +typedef void (*vFullpu_t)(uint32_t, intptr_t, intptr_t, void*, uint32_t); +typedef void (*vFupiii_t)(uint32_t, void*, int32_t, int32_t, int32_t); +typedef void (*vFupupp_t)(uint32_t, void*, uint32_t, void*, void*); +typedef void (*vFuplii_t)(uint32_t, void*, intptr_t, int32_t, int32_t); +typedef void (*vFuppip_t)(uint32_t, void*, void*, int32_t, void*); +typedef void (*vFupppp_t)(uint32_t, void*, void*, void*, void*); +typedef void (*vFfffff_t)(float, float, float, float, float); +typedef void (*vFddddp_t)(double, double, double, double, void*); +typedef void (*vFluipp_t)(intptr_t, uint32_t, int32_t, void*, void*); +typedef void (*vFpiiii_t)(void*, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFpilpp_t)(void*, int32_t, intptr_t, void*, void*); +typedef void (*vFpipiu_t)(void*, int32_t, void*, int32_t, uint32_t); +typedef void (*vFpuipp_t)(void*, uint32_t, int32_t, void*, void*); +typedef void (*vFpuddd_t)(void*, uint32_t, double, double, double); +typedef void (*vFpddii_t)(void*, double, double, int32_t, int32_t); +typedef void (*vFpdddd_t)(void*, double, double, double, double); +typedef void (*vFppWui_t)(void*, void*, uint16_t, uint32_t, int32_t); +typedef void (*vFpppii_t)(void*, void*, void*, int32_t, int32_t); +typedef void (*vFppppu_t)(void*, void*, void*, void*, uint32_t); +typedef void (*vFppppp_t)(void*, void*, void*, void*, void*); +typedef void (*vFXLiii_t)(void*, uintptr_t, int32_t, int32_t, int32_t); +typedef void (*vFXLiiL_t)(void*, uintptr_t, int32_t, int32_t, uintptr_t); +typedef void (*vFXLppi_t)(void*, uintptr_t, void*, void*, int32_t); +typedef void (*vFXpiiL_t)(void*, void*, int32_t, int32_t, uintptr_t); +typedef int32_t (*iEEiiip_t)(x64emu_t*, int32_t, int32_t, int32_t, void*); +typedef int32_t (*iEEiipV_t)(x64emu_t*, int32_t, int32_t, void*, void*); +typedef int32_t (*iEEipii_t)(x64emu_t*, int32_t, void*, int32_t, int32_t); +typedef int32_t (*iEEipuu_t)(x64emu_t*, int32_t, void*, uint32_t, uint32_t); +typedef int32_t (*iEEipup_t)(x64emu_t*, int32_t, void*, uint32_t, void*); +typedef int32_t (*iEEippi_t)(x64emu_t*, int32_t, void*, void*, int32_t); +typedef int32_t (*iEEippL_t)(x64emu_t*, int32_t, void*, void*, uintptr_t); +typedef int32_t (*iEEuupi_t)(x64emu_t*, uint32_t, uint32_t, void*, int32_t); +typedef int32_t (*iFEpiup_t)(x64emu_t*, void*, int32_t, uint32_t, void*); +typedef int32_t (*iEEpipp_t)(x64emu_t*, void*, int32_t, void*, void*); +typedef int32_t (*iFEpipp_t)(x64emu_t*, void*, int32_t, void*, void*); +typedef int32_t (*iEEpipV_t)(x64emu_t*, void*, int32_t, void*, void*); +typedef int32_t (*iFEpuip_t)(x64emu_t*, void*, uint32_t, int32_t, void*); +typedef int32_t (*iFEpupu_t)(x64emu_t*, void*, uint32_t, void*, uint32_t); +typedef int32_t (*iEEpLpp_t)(x64emu_t*, void*, uintptr_t, void*, void*); +typedef int32_t (*iFEpLpp_t)(x64emu_t*, void*, uintptr_t, void*, void*); +typedef int32_t (*iEEpLpV_t)(x64emu_t*, void*, uintptr_t, void*, void*); +typedef int32_t (*iFEpLpV_t)(x64emu_t*, void*, uintptr_t, void*, void*); +typedef int32_t (*iEEppii_t)(x64emu_t*, void*, void*, int32_t, int32_t); +typedef int32_t (*iFEpplp_t)(x64emu_t*, void*, void*, intptr_t, void*); +typedef int32_t (*iEEpppi_t)(x64emu_t*, void*, void*, void*, int32_t); +typedef int32_t (*iEEpppp_t)(x64emu_t*, void*, void*, void*, void*); +typedef int32_t (*iFEpppp_t)(x64emu_t*, void*, void*, void*, void*); +typedef int32_t (*iEESipp_t)(x64emu_t*, void*, int32_t, void*, void*); +typedef int32_t (*iEESipV_t)(x64emu_t*, void*, int32_t, void*, void*); +typedef int32_t (*iFEXipp_t)(x64emu_t*, void*, int32_t, void*, void*); +typedef int32_t (*iFEXLip_t)(x64emu_t*, void*, uintptr_t, int32_t, void*); +typedef int32_t (*iFEXLlp_t)(x64emu_t*, void*, uintptr_t, intptr_t, void*); +typedef int32_t (*iFEXLLp_t)(x64emu_t*, void*, uintptr_t, uintptr_t, void*); +typedef int32_t (*iFEXLpi_t)(x64emu_t*, void*, uintptr_t, void*, int32_t); +typedef int32_t (*iFEXLpp_t)(x64emu_t*, void*, uintptr_t, void*, void*); +typedef int32_t (*iFEXpii_t)(x64emu_t*, void*, void*, int32_t, int32_t); +typedef int32_t (*iFEXpLp_t)(x64emu_t*, void*, void*, uintptr_t, void*); +typedef int32_t (*iFEXppu_t)(x64emu_t*, void*, void*, void*, uint32_t); +typedef int32_t (*iFEXppp_t)(x64emu_t*, void*, void*, void*, void*); +typedef int32_t (*iFiiiui_t)(int32_t, int32_t, int32_t, uint32_t, int32_t); +typedef int32_t (*iEiiipu_t)(int32_t, int32_t, int32_t, void*, uint32_t); +typedef int32_t (*iEiiipp_t)(int32_t, int32_t, int32_t, void*, void*); +typedef int32_t (*iFiuuuu_t)(int32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef int32_t (*iFiuuuU_t)(int32_t, uint32_t, uint32_t, uint32_t, uint64_t); +typedef int32_t (*iFiuuup_t)(int32_t, uint32_t, uint32_t, uint32_t, void*); +typedef int32_t (*iFipiip_t)(int32_t, void*, int32_t, int32_t, void*); +typedef int32_t (*iEipLLi_t)(int32_t, void*, uintptr_t, uintptr_t, int32_t); +typedef int32_t (*iFippuu_t)(int32_t, void*, void*, uint32_t, uint32_t); +typedef int32_t (*iEippLi_t)(int32_t, void*, void*, uintptr_t, int32_t); +typedef int32_t (*iEipppi_t)(int32_t, void*, void*, void*, int32_t); +typedef int32_t (*iEipppp_t)(int32_t, void*, void*, void*, void*); +typedef int32_t (*iFuiuup_t)(uint32_t, int32_t, uint32_t, uint32_t, void*); +typedef int32_t (*iFuupid_t)(uint32_t, uint32_t, void*, int32_t, double); +typedef int32_t (*iFpiiuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t); +typedef int32_t (*iFpiipp_t)(void*, int32_t, int32_t, void*, void*); +typedef int32_t (*iFpippL_t)(void*, int32_t, void*, void*, uintptr_t); +typedef int32_t (*iFpippp_t)(void*, int32_t, void*, void*, void*); +typedef int32_t (*iFpCCCC_t)(void*, uint8_t, uint8_t, uint8_t, uint8_t); +typedef int32_t (*iFpuipp_t)(void*, uint32_t, int32_t, void*, void*); +typedef int32_t (*iFpupuu_t)(void*, uint32_t, void*, uint32_t, uint32_t); +typedef int32_t (*iFpupLu_t)(void*, uint32_t, void*, uintptr_t, uint32_t); +typedef int32_t (*iFpuppp_t)(void*, uint32_t, void*, void*, void*); +typedef int32_t (*iFppiUi_t)(void*, void*, int32_t, uint64_t, int32_t); +typedef int32_t (*iFppipp_t)(void*, void*, int32_t, void*, void*); +typedef int32_t (*iFppWup_t)(void*, void*, uint16_t, uint32_t, void*); +typedef int32_t (*iFppuip_t)(void*, void*, uint32_t, int32_t, void*); +typedef int32_t (*iFppupu_t)(void*, void*, uint32_t, void*, uint32_t); +typedef int32_t (*iFppLpL_t)(void*, void*, uintptr_t, void*, uintptr_t); +typedef int32_t (*iFpppip_t)(void*, void*, void*, int32_t, void*); +typedef int32_t (*iFpppuu_t)(void*, void*, void*, uint32_t, uint32_t); +typedef int32_t (*iEpppLi_t)(void*, void*, void*, uintptr_t, int32_t); +typedef int32_t (*iFpppLu_t)(void*, void*, void*, uintptr_t, uint32_t); +typedef int32_t (*iEpppLp_t)(void*, void*, void*, uintptr_t, void*); +typedef int32_t (*iFppppi_t)(void*, void*, void*, void*, int32_t); +typedef int32_t (*iFppppu_t)(void*, void*, void*, void*, uint32_t); +typedef int32_t (*iFppppd_t)(void*, void*, void*, void*, double); +typedef int32_t (*iFppppL_t)(void*, void*, void*, void*, uintptr_t); +typedef int32_t (*iFppppp_t)(void*, void*, void*, void*, void*); +typedef int32_t (*iFXiiii_t)(void*, int32_t, int32_t, int32_t, int32_t); +typedef int32_t (*iFXiiip_t)(void*, int32_t, int32_t, int32_t, void*); +typedef int32_t (*iFXiuLi_t)(void*, int32_t, uint32_t, uintptr_t, int32_t); +typedef int32_t (*iFXiLip_t)(void*, int32_t, uintptr_t, int32_t, void*); +typedef int32_t (*iFXiLuu_t)(void*, int32_t, uintptr_t, uint32_t, uint32_t); +typedef int32_t (*iFXuuLL_t)(void*, uint32_t, uint32_t, uintptr_t, uintptr_t); +typedef int32_t (*iFXLLii_t)(void*, uintptr_t, uintptr_t, int32_t, int32_t); +typedef int32_t (*iFXLpii_t)(void*, uintptr_t, void*, int32_t, int32_t); +typedef int32_t (*iFXLpLi_t)(void*, uintptr_t, void*, uintptr_t, int32_t); +typedef int32_t (*iFXLppi_t)(void*, uintptr_t, void*, void*, int32_t); +typedef int32_t (*iFXpipi_t)(void*, void*, int32_t, void*, int32_t); +typedef int32_t (*iFXpppp_t)(void*, void*, void*, void*, void*); +typedef int64_t (*IFXpIII_t)(void*, void*, int64_t, int64_t, int64_t); +typedef uint32_t (*uEEippu_t)(x64emu_t*, int32_t, void*, void*, uint32_t); +typedef uint32_t (*uFEpipp_t)(x64emu_t*, void*, int32_t, void*, void*); +typedef uint32_t (*uFEpppp_t)(x64emu_t*, void*, void*, void*, void*); +typedef uint32_t (*uFpuupp_t)(void*, uint32_t, uint32_t, void*, void*); +typedef uint32_t (*uEpLLLS_t)(void*, uintptr_t, uintptr_t, uintptr_t, void*); +typedef uint32_t (*uFppppp_t)(void*, void*, void*, void*, void*); +typedef uint64_t (*UFuiCiu_t)(uint32_t, int32_t, uint8_t, int32_t, uint32_t); +typedef intptr_t (*lFpuipC_t)(void*, uint32_t, int32_t, void*, uint8_t); +typedef intptr_t (*lFppLpL_t)(void*, void*, uintptr_t, void*, uintptr_t); +typedef uintptr_t (*LFEppLL_t)(x64emu_t*, void*, void*, uintptr_t, uintptr_t); +typedef uintptr_t (*LFEXLpi_t)(x64emu_t*, void*, uintptr_t, void*, int32_t); +typedef uintptr_t (*LFuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef uintptr_t (*LEpLppa_t)(void*, uintptr_t, void*, void*, void*); +typedef uintptr_t (*LFXLuuu_t)(void*, uintptr_t, uint32_t, uint32_t, uint32_t); +typedef uintptr_t (*LFXLpuu_t)(void*, uintptr_t, void*, uint32_t, uint32_t); +typedef uintptr_t (*LFXpppi_t)(void*, void*, void*, void*, int32_t); +typedef void* (*pFEppip_t)(x64emu_t*, void*, void*, int32_t, void*); +typedef void* (*pFEppdd_t)(x64emu_t*, void*, void*, double, double); +typedef void* (*pFEpnuu_t)(x64emu_t*, void*, void*, uint32_t, uint32_t); +typedef void* (*pFEpnup_t)(x64emu_t*, void*, void*, uint32_t, void*); +typedef void* (*pFEXipp_t)(x64emu_t*, void*, int32_t, void*, void*); +typedef void* (*pFEXCip_t)(x64emu_t*, void*, uint8_t, int32_t, void*); +typedef void* (*pFEXlpp_t)(x64emu_t*, void*, intptr_t, void*, void*); +typedef void* (*pFEXLip_t)(x64emu_t*, void*, uintptr_t, int32_t, void*); +typedef void* (*pFEXpip_t)(x64emu_t*, void*, void*, int32_t, void*); +typedef void* (*pFEXppi_t)(x64emu_t*, void*, void*, void*, int32_t); +typedef void* (*pFuiupp_t)(uint32_t, int32_t, uint32_t, void*, void*); +typedef void* (*pFpiiii_t)(void*, int32_t, int32_t, int32_t, int32_t); +typedef void* (*pFpiiuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t); +typedef void* (*pFpiipi_t)(void*, int32_t, int32_t, void*, int32_t); +typedef void* (*pFpipii_t)(void*, int32_t, void*, int32_t, int32_t); +typedef void* (*pFpipip_t)(void*, int32_t, void*, int32_t, void*); +typedef void* (*pFpippi_t)(void*, int32_t, void*, void*, int32_t); +typedef void* (*pFpippp_t)(void*, int32_t, void*, void*, void*); +typedef void* (*pFpuiii_t)(void*, uint32_t, int32_t, int32_t, int32_t); +typedef void* (*pFpuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void* (*pFpuppp_t)(void*, uint32_t, void*, void*, void*); +typedef void* (*pFpdddd_t)(void*, double, double, double, double); +typedef void* (*pFpLLip_t)(void*, uintptr_t, uintptr_t, int32_t, void*); +typedef void* (*pFppipi_t)(void*, void*, int32_t, void*, int32_t); +typedef void* (*pFppuup_t)(void*, void*, uint32_t, uint32_t, void*); +typedef void* (*pFppupp_t)(void*, void*, uint32_t, void*, void*); +typedef void* (*pFpppii_t)(void*, void*, void*, int32_t, int32_t); +typedef void* (*pFppppi_t)(void*, void*, void*, void*, int32_t); +typedef void* (*pFXLipp_t)(void*, uintptr_t, int32_t, void*, void*); +typedef void* (*pFXpipi_t)(void*, void*, int32_t, void*, int32_t); +typedef void* (*pFXpuup_t)(void*, void*, uint32_t, uint32_t, void*); +typedef void* (*pFXppip_t)(void*, void*, void*, int32_t, void*); +typedef char* (*tEpppLi_t)(void*, void*, void*, uintptr_t, int32_t); +typedef void (*vFiuibp_i_t)(int32_t, uint32_t, int32_t, struct_p_t*, int32_t); +typedef void (*vFXibL_ii_t)(void*, int32_t, struct_L_t*, int32_t, int32_t); +typedef int32_t (*iEEBh_ppp_t)(x64emu_t*, struct_h_t*, void*, void*, void*); +typedef int32_t (*iFpupbL_p_t)(void*, uint32_t, void*, struct_L_t*, void*); +typedef int32_t (*iFppibp_I_t)(void*, void*, int32_t, struct_p_t*, int64_t); +typedef int32_t (*iFppWpbp__t)(void*, void*, uint16_t, void*, struct_p_t*); +typedef int32_t (*iFppupbL__t)(void*, void*, uint32_t, void*, struct_L_t*); +typedef int32_t (*iFppppbp__t)(void*, void*, void*, void*, struct_p_t*); +typedef int32_t (*iFppbL_pu_t)(void*, void*, struct_L_t*, void*, uint32_t); +typedef int32_t (*iFppbL_pL_t)(void*, void*, struct_L_t*, void*, uintptr_t); +typedef int32_t (*iFppbp_pp_t)(void*, void*, struct_p_t*, void*, void*); +typedef int32_t (*iFpbp_iii_t)(void*, struct_p_t*, int32_t, int32_t, int32_t); +typedef int32_t (*iFpbp_ipi_t)(void*, struct_p_t*, int32_t, void*, int32_t); +typedef int32_t (*iFpbp_uuu_t)(void*, struct_p_t*, uint32_t, uint32_t, uint32_t); +typedef int32_t (*iFpbp_uup_t)(void*, struct_p_t*, uint32_t, uint32_t, void*); +typedef int32_t (*iFbp_piip_t)(struct_p_t*, void*, int32_t, int32_t, void*); +typedef int32_t (*iFbp_puip_t)(struct_p_t*, void*, uint32_t, int32_t, void*); +typedef int32_t (*iFbp_pppi_t)(struct_p_t*, void*, void*, void*, int32_t); +typedef int32_t (*iFXiibL_i_t)(void*, int32_t, int32_t, struct_L_t*, int32_t); +typedef int32_t (*iFXCupbL__t)(void*, uint8_t, uint32_t, void*, struct_L_t*); +typedef int32_t (*iFXLbL_ii_t)(void*, uintptr_t, struct_L_t*, int32_t, int32_t); +typedef uint32_t (*uFppbp_ip_t)(void*, void*, struct_p_t*, int32_t, void*); +typedef uintptr_t (*LEpbp_LLp_t)(void*, struct_p_t*, uintptr_t, uintptr_t, void*); +typedef uintptr_t (*LEpBp_LLp_t)(void*, struct_p_t*, uintptr_t, uintptr_t, void*); +typedef void* (*pFpipibp__t)(void*, int32_t, void*, int32_t, struct_p_t*); +typedef void* (*pFppupbl__t)(void*, void*, uint32_t, void*, struct_l_t*); +typedef void* (*pFppLbp_p_t)(void*, void*, uintptr_t, struct_p_t*, void*); +typedef int32_t (*iEippprLL__t)(int32_t, void*, void*, void*, struct_LL_t*); +typedef int32_t (*iFpuibpu_p_t)(void*, uint32_t, int32_t, struct_pu_t*, void*); +typedef int32_t (*iFpupubpu__t)(void*, uint32_t, void*, uint32_t, struct_pu_t*); +typedef int32_t (*iEpurLL_pL_t)(void*, uint32_t, struct_LL_t*, void*, uintptr_t); +typedef int32_t (*iFppubpu_u_t)(void*, void*, uint32_t, struct_pu_t*, uint32_t); +typedef int32_t (*iFppubpu_p_t)(void*, void*, uint32_t, struct_pu_t*, void*); +typedef int32_t (*iFpppibpp__t)(void*, void*, void*, int32_t, struct_pp_t*); +typedef int32_t (*iFppppbup__t)(void*, void*, void*, void*, struct_up_t*); +typedef int32_t (*iFpppbpu_u_t)(void*, void*, void*, struct_pu_t*, uint32_t); +typedef int32_t (*iFppbpu_uu_t)(void*, void*, struct_pu_t*, uint32_t, uint32_t); +typedef int32_t (*iFppbpu_pu_t)(void*, void*, struct_pu_t*, void*, uint32_t); +typedef int32_t (*iFpbpu_upu_t)(void*, struct_pu_t*, uint32_t, void*, uint32_t); +typedef int32_t (*iFpbpu_upp_t)(void*, struct_pu_t*, uint32_t, void*, void*); +typedef int32_t (*iFpbpu_puu_t)(void*, struct_pu_t*, void*, uint32_t, uint32_t); +typedef int32_t (*iFiiuBp_Bp__t)(int32_t, int32_t, uint32_t, struct_p_t*, struct_p_t*); +typedef int32_t (*iFppbp_bp_p_t)(void*, void*, struct_p_t*, struct_p_t*, void*); +typedef int32_t (*iFbp_bp_pip_t)(struct_p_t*, struct_p_t*, void*, int32_t, void*); +typedef void (*vFbp_ppibup__t)(struct_p_t*, void*, void*, int32_t, struct_up_t*); +typedef int32_t (*iFEXbpLiL_pp_t)(x64emu_t*, void*, struct_pLiL_t*, void*, void*); +typedef int32_t (*iFpubp_bpu_u_t)(void*, uint32_t, struct_p_t*, struct_pu_t*, uint32_t); +typedef int32_t (*iFpppbp_bup__t)(void*, void*, void*, struct_p_t*, struct_up_t*); +typedef int32_t (*iFbp_pbpu_uu_t)(struct_p_t*, void*, struct_pu_t*, uint32_t, uint32_t); +typedef int32_t (*iFpibp_bp_bL__t)(void*, int32_t, struct_p_t*, struct_p_t*, struct_L_t*); +typedef int32_t (*iFpuubpu_bpu__t)(void*, uint32_t, uint32_t, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFpubpu_pbpu__t)(void*, uint32_t, struct_pu_t*, void*, struct_pu_t*); +typedef int32_t (*iFppbpu_bpu_u_t)(void*, void*, struct_pu_t*, struct_pu_t*, uint32_t); +typedef int32_t (*iFpbpu_bpu_uu_t)(void*, struct_pu_t*, struct_pu_t*, uint32_t, uint32_t); +typedef int32_t (*iFpbpu_bpu_pu_t)(void*, struct_pu_t*, struct_pu_t*, void*, uint32_t); +typedef int32_t (*iFpbpu_bpu_bp_u_t)(void*, struct_pu_t*, struct_pu_t*, struct_p_t*, uint32_t); +typedef int32_t (*iFXLiuriiiiiLi__t)(void*, uintptr_t, int32_t, uint32_t, struct_iiiiiLi_t*); +typedef uintptr_t (*LELbp_bL_bp_bL__t)(uintptr_t, struct_p_t*, struct_L_t*, struct_p_t*, struct_L_t*); +typedef int32_t (*iFpubpu_bpu_bpu__t)(void*, uint32_t, struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFppbpu_bpu_bpu__t)(void*, void*, struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef uint32_t (*uFEpbppuuuuup_ip_t)(x64emu_t*, void*, struct_ppuuuuup_t*, int32_t, void*); +typedef uint32_t (*uFEpbppuuuuup_iV_t)(x64emu_t*, void*, struct_ppuuuuup_t*, int32_t, void*); +typedef uint32_t (*uFppupbppuuuuup__t)(void*, void*, uint32_t, void*, struct_ppuuuuup_t*); +typedef int32_t (*iFbp_bp_bL_bp_bL__t)(struct_p_t*, struct_p_t*, struct_L_t*, struct_p_t*, struct_L_t*); +typedef void (*vFXLbLLLLLLLLLL_iL_t)(void*, uintptr_t, struct_LLLLLLLLLL_t*, int32_t, uintptr_t); +typedef int32_t (*iFXiiiBpLiiiLLLii__t)(void*, int32_t, int32_t, int32_t, struct_pLiiiLLLii_t*); +typedef int32_t (*iFpbpu_bpu_bpu_bpu__t)(void*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef uintptr_t (*LEpLpriiiiiiiiilt_a_t)(void*, uintptr_t, void*, struct_iiiiiiiiilt_t*, void*); +typedef void* (*pFEXLrLiiwwwwwwwwL_i_t)(x64emu_t*, void*, uintptr_t, struct_LiiwwwwwwwwL_t*, int32_t); +typedef int32_t (*iFXLpbLWWWcc_bLWWWcc__t)(void*, uintptr_t, void*, struct_LWWWcc_t*, struct_LWWWcc_t*); +typedef int32_t (*iFXLpBLWWWcc_BLWWWcc__t)(void*, uintptr_t, void*, struct_LWWWcc_t*, struct_LWWWcc_t*); +typedef uintptr_t (*LFXLrLiiwwwwwwwwL_LriLiiiiLiiiiLi__t)(void*, uintptr_t, struct_LiiwwwwwwwwL_t*, uintptr_t, struct_iLiiiiLiiiiLi_t*); +typedef void (*vFEiiipp_t)(x64emu_t*, int32_t, int32_t, int32_t, void*, void*); +typedef void (*vFEuippp_t)(x64emu_t*, uint32_t, int32_t, void*, void*, void*); +typedef void (*vFEupupi_t)(x64emu_t*, uint32_t, void*, uint32_t, void*, int32_t); +typedef void (*vFiiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFiiiuil_t)(int32_t, int32_t, int32_t, uint32_t, int32_t, intptr_t); +typedef void (*vFiiilpi_t)(int32_t, int32_t, int32_t, intptr_t, void*, int32_t); +typedef void (*vFiiuilp_t)(int32_t, int32_t, uint32_t, int32_t, intptr_t, void*); +typedef void (*vFiffiff_t)(int32_t, float, float, int32_t, float, float); +typedef void (*vFiddidd_t)(int32_t, double, double, int32_t, double, double); +typedef void (*vFilipli_t)(int32_t, intptr_t, int32_t, void*, intptr_t, int32_t); +typedef void (*vFiliplu_t)(int32_t, intptr_t, int32_t, void*, intptr_t, uint32_t); +typedef void (*vFipiplp_t)(int32_t, void*, int32_t, void*, intptr_t, void*); +typedef void (*vFCCCCff_t)(uint8_t, uint8_t, uint8_t, uint8_t, float, float); +typedef void (*vFuiiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuiiiip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFuiiuii_t)(uint32_t, int32_t, int32_t, uint32_t, int32_t, int32_t); +typedef void (*vFuiiuup_t)(uint32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuiIIII_t)(uint32_t, int32_t, int64_t, int64_t, int64_t, int64_t); +typedef void (*vFuiuiii_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t); +typedef void (*vFuiuiiC_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, uint8_t); +typedef void (*vFuiuiil_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, intptr_t); +typedef void (*vFuiuiuu_t)(uint32_t, int32_t, uint32_t, int32_t, uint32_t, uint32_t); +typedef void (*vFuiuiuU_t)(uint32_t, int32_t, uint32_t, int32_t, uint32_t, uint64_t); +typedef void (*vFuiuCip_t)(uint32_t, int32_t, uint32_t, uint8_t, int32_t, void*); +typedef void (*vFuiuuip_t)(uint32_t, int32_t, uint32_t, uint32_t, int32_t, void*); +typedef void (*vFuiuuuu_t)(uint32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuiupii_t)(uint32_t, int32_t, uint32_t, void*, int32_t, int32_t); +typedef void (*vFuiupiu_t)(uint32_t, int32_t, uint32_t, void*, int32_t, uint32_t); +typedef void (*vFuiUUUU_t)(uint32_t, int32_t, uint64_t, uint64_t, uint64_t, uint64_t); +typedef void (*vFuiffff_t)(uint32_t, int32_t, float, float, float, float); +typedef void (*vFuidddd_t)(uint32_t, int32_t, double, double, double, double); +typedef void (*vFuipiup_t)(uint32_t, int32_t, void*, int32_t, uint32_t, void*); +typedef void (*vFuCuuip_t)(uint32_t, uint8_t, uint32_t, uint32_t, int32_t, void*); +typedef void (*vFuuiiii_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuuiuii_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t); +typedef void (*vFuuiuil_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, intptr_t); +typedef void (*vFuuiuip_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, void*); +typedef void (*vFuuiuCu_t)(uint32_t, uint32_t, int32_t, uint32_t, uint8_t, uint32_t); +typedef void (*vFuuiuup_t)(uint32_t, uint32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuuuiii_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t); +typedef void (*vFuuuiup_t)(uint32_t, uint32_t, uint32_t, int32_t, uint32_t, void*); +typedef void (*vFuuuipC_t)(uint32_t, uint32_t, uint32_t, int32_t, void*, uint8_t); +typedef void (*vFuuuipp_t)(uint32_t, uint32_t, uint32_t, int32_t, void*, void*); +typedef void (*vFuuuuii_t)(uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t); +typedef void (*vFuuuuip_t)(uint32_t, uint32_t, uint32_t, uint32_t, int32_t, void*); +typedef void (*vFuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuuuull_t)(uint32_t, uint32_t, uint32_t, uint32_t, intptr_t, intptr_t); +typedef void (*vFuuuppi_t)(uint32_t, uint32_t, uint32_t, void*, void*, int32_t); +typedef void (*vFuuuppp_t)(uint32_t, uint32_t, uint32_t, void*, void*, void*); +typedef void (*vFuuffff_t)(uint32_t, uint32_t, float, float, float, float); +typedef void (*vFuudddd_t)(uint32_t, uint32_t, double, double, double, double); +typedef void (*vFuupiii_t)(uint32_t, uint32_t, void*, int32_t, int32_t, int32_t); +typedef void (*vFuupupp_t)(uint32_t, uint32_t, void*, uint32_t, void*, void*); +typedef void (*vFuuplii_t)(uint32_t, uint32_t, void*, intptr_t, int32_t, int32_t); +typedef void (*vFuffiip_t)(uint32_t, float, float, int32_t, int32_t, void*); +typedef void (*vFufffff_t)(uint32_t, float, float, float, float, float); +typedef void (*vFuddiip_t)(uint32_t, double, double, int32_t, int32_t, void*); +typedef void (*vFulluUC_t)(uint32_t, intptr_t, intptr_t, uint32_t, uint64_t, uint8_t); +typedef void (*vFupiiii_t)(uint32_t, void*, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFffffff_t)(float, float, float, float, float, float); +typedef void (*vFdddddd_t)(double, double, double, double, double, double); +typedef void (*vFpipipV_t)(void*, int32_t, void*, int32_t, void*, void*); +typedef void (*vFpudddd_t)(void*, uint32_t, double, double, double, double); +typedef void (*vFpdddii_t)(void*, double, double, double, int32_t, int32_t); +typedef void (*vFpddddd_t)(void*, double, double, double, double, double); +typedef void (*vFpppppp_t)(void*, void*, void*, void*, void*, void*); +typedef void (*vFXiLppi_t)(void*, int32_t, uintptr_t, void*, void*, int32_t); +typedef void (*vFXLiiii_t)(void*, uintptr_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFXLiiiL_t)(void*, uintptr_t, int32_t, int32_t, int32_t, uintptr_t); +typedef void (*vFXLiipi_t)(void*, uintptr_t, int32_t, int32_t, void*, int32_t); +typedef void (*vFXLpppi_t)(void*, uintptr_t, void*, void*, void*, int32_t); +typedef void (*vFXpiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t); +typedef int32_t (*iEEiippi_t)(x64emu_t*, int32_t, int32_t, void*, void*, int32_t); +typedef int32_t (*iEEiLLLL_t)(x64emu_t*, int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +typedef int32_t (*iEEipiup_t)(x64emu_t*, int32_t, void*, int32_t, uint32_t, void*); +typedef int32_t (*iEEippup_t)(x64emu_t*, int32_t, void*, void*, uint32_t, void*); +typedef int32_t (*iEEuppLp_t)(x64emu_t*, uint32_t, void*, void*, uintptr_t, void*); +typedef int32_t (*iEEpiipi_t)(x64emu_t*, void*, int32_t, int32_t, void*, int32_t); +typedef int32_t (*iFEpiipi_t)(x64emu_t*, void*, int32_t, int32_t, void*, int32_t); +typedef int32_t (*iEEpiipV_t)(x64emu_t*, void*, int32_t, int32_t, void*, void*); +typedef int32_t (*iFEpiuuu_t)(x64emu_t*, void*, int32_t, uint32_t, uint32_t, uint32_t); +typedef int32_t (*iEEpiLpp_t)(x64emu_t*, void*, int32_t, uintptr_t, void*, void*); +typedef int32_t (*iEEpipOi_t)(x64emu_t*, void*, int32_t, void*, int32_t, int32_t); +typedef int32_t (*iFEpuuip_t)(x64emu_t*, void*, uint32_t, uint32_t, int32_t, void*); +typedef int32_t (*iFEpuuup_t)(x64emu_t*, void*, uint32_t, uint32_t, uint32_t, void*); +typedef int32_t (*iFEplluu_t)(x64emu_t*, void*, intptr_t, intptr_t, uint32_t, uint32_t); +typedef int32_t (*iFEpLlpp_t)(x64emu_t*, void*, uintptr_t, intptr_t, void*, void*); +typedef int32_t (*iFEppipp_t)(x64emu_t*, void*, void*, int32_t, void*, void*); +typedef int32_t (*iEEppupi_t)(x64emu_t*, void*, void*, uint32_t, void*, int32_t); +typedef int32_t (*iFEppllp_t)(x64emu_t*, void*, void*, intptr_t, intptr_t, void*); +typedef int32_t (*iEEpppup_t)(x64emu_t*, void*, void*, void*, uint32_t, void*); +typedef int32_t (*iEEpppLp_t)(x64emu_t*, void*, void*, void*, uintptr_t, void*); +typedef int32_t (*iFEXLilp_t)(x64emu_t*, void*, uintptr_t, int32_t, intptr_t, void*); +typedef int32_t (*iFEXLpiL_t)(x64emu_t*, void*, uintptr_t, void*, int32_t, uintptr_t); +typedef int32_t (*iFEXpiip_t)(x64emu_t*, void*, void*, int32_t, int32_t, void*); +typedef int32_t (*iFEXpiup_t)(x64emu_t*, void*, void*, int32_t, uint32_t, void*); +typedef int32_t (*iFEXpppp_t)(x64emu_t*, void*, void*, void*, void*, void*); +typedef int32_t (*iFiuuuup_t)(int32_t, uint32_t, uint32_t, uint32_t, uint32_t, void*); +typedef int32_t (*iFiuuupu_t)(int32_t, uint32_t, uint32_t, uint32_t, void*, uint32_t); +typedef int32_t (*iFiuuUpU_t)(int32_t, uint32_t, uint32_t, uint64_t, void*, uint64_t); +typedef int32_t (*iFiuuppp_t)(int32_t, uint32_t, uint32_t, void*, void*, void*); +typedef int32_t (*iFiuUuUu_t)(int32_t, uint32_t, uint64_t, uint32_t, uint64_t, uint32_t); +typedef int32_t (*iEipipLu_t)(int32_t, void*, int32_t, void*, uintptr_t, uint32_t); +typedef int32_t (*iFipuIup_t)(int32_t, void*, uint32_t, int64_t, uint32_t, void*); +typedef int32_t (*iFuiiuup_t)(uint32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef int32_t (*iFupLpLp_t)(uint32_t, void*, uintptr_t, void*, uintptr_t, void*); +typedef int32_t (*iFpiippp_t)(void*, int32_t, int32_t, void*, void*, void*); +typedef int32_t (*iFppiiii_t)(void*, void*, int32_t, int32_t, int32_t, int32_t); +typedef int32_t (*iFppiipi_t)(void*, void*, int32_t, int32_t, void*, int32_t); +typedef int32_t (*iFppipip_t)(void*, void*, int32_t, void*, int32_t, void*); +typedef int32_t (*iFppippi_t)(void*, void*, int32_t, void*, void*, int32_t); +typedef int32_t (*iFppuIII_t)(void*, void*, uint32_t, int64_t, int64_t, int64_t); +typedef int32_t (*iFppulll_t)(void*, void*, uint32_t, intptr_t, intptr_t, intptr_t); +typedef int32_t (*iFpppuuu_t)(void*, void*, void*, uint32_t, uint32_t, uint32_t); +typedef int32_t (*iFpppupu_t)(void*, void*, void*, uint32_t, void*, uint32_t); +typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*); +typedef int32_t (*iFpppppS_t)(void*, void*, void*, void*, void*, void*); +typedef int32_t (*iFXiiiii_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef int32_t (*iFXiiLip_t)(void*, int32_t, int32_t, uintptr_t, int32_t, void*); +typedef int32_t (*iFXiippp_t)(void*, int32_t, int32_t, void*, void*, void*); +typedef int32_t (*iFXuuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef int32_t (*iFXLiiiL_t)(void*, uintptr_t, int32_t, int32_t, int32_t, uintptr_t); +typedef int32_t (*iFXLiiip_t)(void*, uintptr_t, int32_t, int32_t, int32_t, void*); +typedef int32_t (*iFXLiiuu_t)(void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t); +typedef int32_t (*iFXLuupp_t)(void*, uintptr_t, uint32_t, uint32_t, void*, void*); +typedef int32_t (*iFXLupip_t)(void*, uintptr_t, uint32_t, void*, int32_t, void*); +typedef int32_t (*iFXLLLLL_t)(void*, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +typedef int32_t (*iFXLppii_t)(void*, uintptr_t, void*, void*, int32_t, int32_t); +typedef int32_t (*iFXLpppp_t)(void*, uintptr_t, void*, void*, void*, void*); +typedef int32_t (*iFXpIppp_t)(void*, void*, int64_t, void*, void*, void*); +typedef int32_t (*iFXpuiii_t)(void*, void*, uint32_t, int32_t, int32_t, int32_t); +typedef int32_t (*iFXpLiWL_t)(void*, void*, uintptr_t, int32_t, uint16_t, uintptr_t); +typedef int32_t (*iFXpLLiL_t)(void*, void*, uintptr_t, uintptr_t, int32_t, uintptr_t); +typedef int32_t (*iFXppppi_t)(void*, void*, void*, void*, void*, int32_t); +typedef uint32_t (*uFEpippi_t)(x64emu_t*, void*, int32_t, void*, void*, int32_t); +typedef uint32_t (*uFupuufp_t)(uint32_t, void*, uint32_t, uint32_t, float, void*); +typedef uint32_t (*uFpppppp_t)(void*, void*, void*, void*, void*, void*); +typedef intptr_t (*lEipLipu_t)(int32_t, void*, uintptr_t, int32_t, void*, uint32_t); +typedef intptr_t (*lEipLipp_t)(int32_t, void*, uintptr_t, int32_t, void*, void*); +typedef void* (*pFEpiiuu_t)(x64emu_t*, void*, int32_t, int32_t, uint32_t, uint32_t); +typedef void* (*pEEpLLiN_t)(x64emu_t*, void*, uintptr_t, uintptr_t, int32_t, ...); +typedef void* (*pEEppLLp_t)(x64emu_t*, void*, void*, uintptr_t, uintptr_t, void*); +typedef void* (*pFEpnCWp_t)(x64emu_t*, void*, void*, uint8_t, uint16_t, void*); +typedef void* (*pFEXLLLp_t)(x64emu_t*, void*, uintptr_t, uintptr_t, uintptr_t, void*); +typedef void* (*pFEXLpii_t)(x64emu_t*, void*, uintptr_t, void*, int32_t, int32_t); +typedef void* (*pFEXpppp_t)(x64emu_t*, void*, void*, void*, void*, void*); +typedef void* (*pFWCiWCi_t)(uint16_t, uint8_t, int32_t, uint16_t, uint8_t, int32_t); +typedef void* (*pFdddddd_t)(double, double, double, double, double, double); +typedef void* (*pFLppppp_t)(uintptr_t, void*, void*, void*, void*, void*); +typedef void* (*pFpiiiiu_t)(void*, int32_t, int32_t, int32_t, int32_t, uint32_t); +typedef void* (*pFpiipip_t)(void*, int32_t, int32_t, void*, int32_t, void*); +typedef void* (*pFpiippp_t)(void*, int32_t, int32_t, void*, void*, void*); +typedef void* (*pFpipipL_t)(void*, int32_t, void*, int32_t, void*, uintptr_t); +typedef void* (*pFpipipp_t)(void*, int32_t, void*, int32_t, void*, void*); +typedef void* (*pFpipuii_t)(void*, int32_t, void*, uint32_t, int32_t, int32_t); +typedef void* (*pFpuuupu_t)(void*, uint32_t, uint32_t, uint32_t, void*, uint32_t); +typedef void* (*XFpppppp_t)(void*, void*, void*, void*, void*, void*); +typedef int32_t (*iFpupupbL__t)(void*, uint32_t, void*, uint32_t, void*, struct_L_t*); +typedef int32_t (*iFpupbL_pp_t)(void*, uint32_t, void*, struct_L_t*, void*, void*); +typedef int32_t (*iFppuupbL__t)(void*, void*, uint32_t, uint32_t, void*, struct_L_t*); +typedef int32_t (*iFppupbL_p_t)(void*, void*, uint32_t, void*, struct_L_t*, void*); +typedef int32_t (*iFpppibp_p_t)(void*, void*, void*, int32_t, struct_p_t*, void*); +typedef int32_t (*iFpppppbp__t)(void*, void*, void*, void*, void*, struct_p_t*); +typedef int32_t (*iFpppbp_pp_t)(void*, void*, void*, struct_p_t*, void*, void*); +typedef int32_t (*iFpbp_iuii_t)(void*, struct_p_t*, int32_t, uint32_t, int32_t, int32_t); +typedef int32_t (*iFXibL_ppu_t)(void*, int32_t, struct_L_t*, void*, void*, uint32_t); +typedef int32_t (*iFXLiiibL__t)(void*, uintptr_t, int32_t, int32_t, int32_t, struct_L_t*); +typedef int32_t (*iFXLLLLbL__t)(void*, uintptr_t, uintptr_t, uintptr_t, uintptr_t, struct_L_t*); +typedef int32_t (*iFXLbL_ipi_t)(void*, uintptr_t, struct_L_t*, int32_t, void*, int32_t); +typedef int32_t (*iFXbL_upip_t)(void*, struct_L_t*, uint32_t, void*, int32_t, void*); +typedef void* (*pFEppibp_p_t)(x64emu_t*, void*, void*, int32_t, struct_p_t*, void*); +typedef void* (*pEEppbL_Lp_t)(x64emu_t*, void*, void*, struct_L_t*, uintptr_t, void*); +typedef int32_t (*iEEipuurLL__t)(x64emu_t*, int32_t, void*, uint32_t, uint32_t, struct_LL_t*); +typedef int32_t (*iEippprLL_p_t)(int32_t, void*, void*, void*, struct_LL_t*, void*); +typedef int32_t (*iFupupLbpu__t)(uint32_t, void*, uint32_t, void*, uintptr_t, struct_pu_t*); +typedef int32_t (*iFppppibpp__t)(void*, void*, void*, void*, int32_t, struct_pp_t*); +typedef int32_t (*iFpppbpu_uu_t)(void*, void*, void*, struct_pu_t*, uint32_t, uint32_t); +typedef int32_t (*iFpbpu_uppu_t)(void*, struct_pu_t*, uint32_t, void*, void*, uint32_t); +typedef int32_t (*iFbpu_pLpLp_t)(struct_pu_t*, void*, uintptr_t, void*, uintptr_t, void*); +typedef int32_t (*iFpuuubupu_u_t)(void*, uint32_t, uint32_t, uint32_t, struct_upu_t*, uint32_t); +typedef int32_t (*iFppbL_pbL_p_t)(void*, void*, struct_L_t*, void*, struct_L_t*, void*); +typedef int32_t (*iFppbp_pbp_p_t)(void*, void*, struct_p_t*, void*, struct_p_t*, void*); +typedef int32_t (*iFpibp_pibpp__t)(void*, int32_t, struct_p_t*, void*, int32_t, struct_pp_t*); +typedef int32_t (*iFpuubpu_pbL__t)(void*, uint32_t, uint32_t, struct_pu_t*, void*, struct_L_t*); +typedef int32_t (*iFbpu_puupbL__t)(struct_pu_t*, void*, uint32_t, uint32_t, void*, struct_L_t*); +typedef int32_t (*iFpppbp_bp_bL__t)(void*, void*, void*, struct_p_t*, struct_p_t*, struct_L_t*); +typedef int32_t (*iFpbpu_bpu_uuu_t)(void*, struct_pu_t*, struct_pu_t*, uint32_t, uint32_t, uint32_t); +typedef int32_t (*iFpbpu_bpu_upu_t)(void*, struct_pu_t*, struct_pu_t*, uint32_t, void*, uint32_t); +typedef int32_t (*iFpbp_bp_bp_ii_t)(void*, struct_p_t*, struct_p_t*, struct_p_t*, int32_t, int32_t); +typedef int32_t (*iFrpuu_Lrpuu_Lui_t)(struct_puu_t*, uintptr_t, struct_puu_t*, uintptr_t, uint32_t, int32_t); +typedef int32_t (*iFXbLip_uubLip_L_t)(void*, struct_Lip_t*, uint32_t, uint32_t, struct_Lip_t*, uintptr_t); +typedef void (*vFbp_bppup_ippbp__t)(struct_p_t*, struct_ppup_t*, int32_t, void*, void*, struct_p_t*); +typedef int32_t (*iFpupbpu_bpu_bpu__t)(void*, uint32_t, void*, struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFpubpu_bpu_bpu_p_t)(void*, uint32_t, struct_pu_t*, struct_pu_t*, struct_pu_t*, void*); +typedef int32_t (*iFpbpu_bpu_bpu_uu_t)(void*, struct_pu_t*, struct_pu_t*, struct_pu_t*, uint32_t, uint32_t); +typedef uint32_t (*uFEppppbppuuuuup__t)(x64emu_t*, void*, void*, void*, void*, struct_ppuuuuup_t*); +typedef int32_t (*iFpubpu_bpu_bpu_bpu__t)(void*, uint32_t, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFppbpu_bpu_bpu_bpu__t)(void*, void*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFpbpu_bpu_bpu_bpu_bpu__t)(void*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef void (*vFEuuippp_t)(x64emu_t*, uint32_t, uint32_t, int32_t, void*, void*, void*); +typedef void (*vFEupupip_t)(x64emu_t*, uint32_t, void*, uint32_t, void*, int32_t, void*); +typedef void (*vFEppupui_t)(x64emu_t*, void*, void*, uint32_t, void*, uint32_t, int32_t); +typedef void (*vFiiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFiiiiuup_t)(int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFiiuilil_t)(int32_t, int32_t, uint32_t, int32_t, intptr_t, int32_t, intptr_t); +typedef void (*vFiiffffp_t)(int32_t, int32_t, float, float, float, float, void*); +typedef void (*vFiuulipi_t)(int32_t, uint32_t, uint32_t, intptr_t, int32_t, void*, int32_t); +typedef void (*vFiupuuup_t)(int32_t, uint32_t, void*, uint32_t, uint32_t, uint32_t, void*); +typedef void (*vFilipliu_t)(int32_t, intptr_t, int32_t, void*, intptr_t, int32_t, uint32_t); +typedef void (*vFilulipi_t)(int32_t, intptr_t, uint32_t, intptr_t, int32_t, void*, int32_t); +typedef void (*vFCCCCfff_t)(uint8_t, uint8_t, uint8_t, uint8_t, float, float, float); +typedef void (*vFuiiiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuiiiiiC_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint8_t); +typedef void (*vFuiiiuip_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, void*); +typedef void (*vFuiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuiuiiii_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuiuiiiC_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, uint8_t); +typedef void (*vFuiuiiip_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFuiuiiuU_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, uint32_t, uint64_t); +typedef void (*vFuiuCiuu_t)(uint32_t, int32_t, uint32_t, uint8_t, int32_t, uint32_t, uint32_t); +typedef void (*vFuiupiiu_t)(uint32_t, int32_t, uint32_t, void*, int32_t, int32_t, uint32_t); +typedef void (*vFuiupuip_t)(uint32_t, int32_t, uint32_t, void*, uint32_t, int32_t, void*); +typedef void (*vFuipiiii_t)(uint32_t, int32_t, void*, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuipffff_t)(uint32_t, int32_t, void*, float, float, float, float); +typedef void (*vFuipdddd_t)(uint32_t, int32_t, void*, double, double, double, double); +typedef void (*vFuuiiiii_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuuiiiiC_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint8_t); +typedef void (*vFuuiiiiu_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t); +typedef void (*vFuuiiiip_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFuuiiuup_t)(uint32_t, uint32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuuiCiui_t)(uint32_t, uint32_t, int32_t, uint8_t, int32_t, uint32_t, int32_t); +typedef void (*vFuuiCiuu_t)(uint32_t, uint32_t, int32_t, uint8_t, int32_t, uint32_t, uint32_t); +typedef void (*vFuuiuiii_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t); +typedef void (*vFuuiuiiC_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, uint8_t); +typedef void (*vFuuipppp_t)(uint32_t, uint32_t, int32_t, void*, void*, void*, void*); +typedef void (*vFuuuiiii_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuuuiiCp_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, uint8_t, void*); +typedef void (*vFuuuiuil_t)(uint32_t, uint32_t, uint32_t, int32_t, uint32_t, int32_t, intptr_t); +typedef void (*vFuuuiupi_t)(uint32_t, uint32_t, uint32_t, int32_t, uint32_t, void*, int32_t); +typedef void (*vFuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuuuulll_t)(uint32_t, uint32_t, uint32_t, uint32_t, intptr_t, intptr_t, intptr_t); +typedef void (*vFuuuffff_t)(uint32_t, uint32_t, uint32_t, float, float, float, float); +typedef void (*vFuuudddd_t)(uint32_t, uint32_t, uint32_t, double, double, double, double); +typedef void (*vFuuffiip_t)(uint32_t, uint32_t, float, float, int32_t, int32_t, void*); +typedef void (*vFuuddiip_t)(uint32_t, uint32_t, double, double, int32_t, int32_t, void*); +typedef void (*vFuulluup_t)(uint32_t, uint32_t, intptr_t, intptr_t, uint32_t, uint32_t, void*); +typedef void (*vFuupiiii_t)(uint32_t, uint32_t, void*, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuuppppp_t)(uint32_t, uint32_t, void*, void*, void*, void*, void*); +typedef void (*vFuffffff_t)(uint32_t, float, float, float, float, float, float); +typedef void (*vFudddddd_t)(uint32_t, double, double, double, double, double, double); +typedef void (*vFlliiiip_t)(intptr_t, intptr_t, int32_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFpipipiu_t)(void*, int32_t, void*, int32_t, void*, int32_t, uint32_t); +typedef void (*vFpddiidd_t)(void*, double, double, int32_t, int32_t, double, double); +typedef void (*vFpdddddd_t)(void*, double, double, double, double, double, double); +typedef void (*vFXLiiiLi_t)(void*, uintptr_t, int32_t, int32_t, int32_t, uintptr_t, int32_t); +typedef void (*vFXLiiipi_t)(void*, uintptr_t, int32_t, int32_t, int32_t, void*, int32_t); +typedef void (*vFXLiiuui_t)(void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, int32_t); +typedef void (*vFXLLuuuu_t)(void*, uintptr_t, uintptr_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFXLppipi_t)(void*, uintptr_t, void*, void*, int32_t, void*, int32_t); +typedef void (*vFXpiipii_t)(void*, void*, int32_t, int32_t, void*, int32_t, int32_t); +typedef void (*vFXppiiii_t)(void*, void*, void*, int32_t, int32_t, int32_t, int32_t); +typedef int32_t (*iFElppppp_t)(x64emu_t*, intptr_t, void*, void*, void*, void*, void*); +typedef int32_t (*iEEpLiipp_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, void*, void*); +typedef int32_t (*iEEpLiipV_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, void*, void*); +typedef int32_t (*iEEpLiLpV_t)(x64emu_t*, void*, uintptr_t, int32_t, uintptr_t, void*, void*); +typedef int32_t (*iFEpppipp_t)(x64emu_t*, void*, void*, void*, int32_t, void*, void*); +typedef int32_t (*iFEpppupp_t)(x64emu_t*, void*, void*, void*, uint32_t, void*, void*); +typedef int32_t (*iEEpppppp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*); +typedef int32_t (*iFEXLpiiL_t)(x64emu_t*, void*, uintptr_t, void*, int32_t, int32_t, uintptr_t); +typedef int32_t (*iFEXLpppp_t)(x64emu_t*, void*, uintptr_t, void*, void*, void*, void*); +typedef int32_t (*iFEXppppp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*); +typedef int32_t (*iFiuuuuii_t)(int32_t, uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t); +typedef int32_t (*iFippuIup_t)(int32_t, void*, void*, uint32_t, int64_t, uint32_t, void*); +typedef int32_t (*iFuiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef int32_t (*iFpiuuuiu_t)(void*, int32_t, uint32_t, uint32_t, uint32_t, int32_t, uint32_t); +typedef int32_t (*iFpWCiWCi_t)(void*, uint16_t, uint8_t, int32_t, uint16_t, uint8_t, int32_t); +typedef int32_t (*iEpupupui_t)(void*, uint32_t, void*, uint32_t, void*, uint32_t, int32_t); +typedef int32_t (*iFpLpLpLp_t)(void*, uintptr_t, void*, uintptr_t, void*, uintptr_t, void*); +typedef int32_t (*iFpLppiip_t)(void*, uintptr_t, void*, void*, int32_t, int32_t, void*); +typedef int32_t (*iFppupipi_t)(void*, void*, uint32_t, void*, int32_t, void*, int32_t); +typedef int32_t (*iFXiuLiii_t)(void*, int32_t, uint32_t, uintptr_t, int32_t, int32_t, int32_t); +typedef int32_t (*iFXiLuupp_t)(void*, int32_t, uintptr_t, uint32_t, uint32_t, void*, void*); +typedef int32_t (*iFXLiiiiL_t)(void*, uintptr_t, int32_t, int32_t, int32_t, int32_t, uintptr_t); +typedef int32_t (*iFXLiiuui_t)(void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, int32_t); +typedef int32_t (*iFXLpiiii_t)(void*, uintptr_t, void*, int32_t, int32_t, int32_t, int32_t); +typedef int32_t (*iFXLpiiuu_t)(void*, uintptr_t, void*, int32_t, int32_t, uint32_t, uint32_t); +typedef int32_t (*iFXLpiipi_t)(void*, uintptr_t, void*, int32_t, int32_t, void*, int32_t); +typedef int32_t (*iFXLppiii_t)(void*, uintptr_t, void*, void*, int32_t, int32_t, int32_t); +typedef int32_t (*iFXpiipii_t)(void*, void*, int32_t, int32_t, void*, int32_t, int32_t); +typedef int32_t (*iFXpLiWwL_t)(void*, void*, uintptr_t, int32_t, uint16_t, int16_t, uintptr_t); +typedef int32_t (*iFXpLuuii_t)(void*, void*, uintptr_t, uint32_t, uint32_t, int32_t, int32_t); +typedef uint32_t (*uFEpppppp_t)(x64emu_t*, void*, void*, void*, void*, void*, void*); +typedef uint32_t (*uFuippppp_t)(uint32_t, int32_t, void*, void*, void*, void*, void*); +typedef uint32_t (*uFpippppp_t)(void*, int32_t, void*, void*, void*, void*, void*); +typedef uint32_t (*uFpuupppp_t)(void*, uint32_t, uint32_t, void*, void*, void*, void*); +typedef uint32_t (*uFppppppp_t)(void*, void*, void*, void*, void*, void*, void*); +typedef intptr_t (*lEEipLpLL_t)(x64emu_t*, int32_t, void*, uintptr_t, void*, uintptr_t, uintptr_t); +typedef void* (*pFEpiiiiu_t)(x64emu_t*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t); +typedef void* (*pFEpLiiii_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, int32_t, int32_t); +typedef void* (*pEEpLiiiI_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, int32_t, int64_t); +typedef void* (*pFEpLiiiI_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, int32_t, int64_t); +typedef void* (*pEEpLiiil_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, int32_t, intptr_t); +typedef void* (*pFEpXppip_t)(x64emu_t*, void*, void*, void*, void*, int32_t, void*); +typedef void* (*pFpipiupp_t)(void*, int32_t, void*, int32_t, uint32_t, void*, void*); +typedef void* (*pFpuuupuu_t)(void*, uint32_t, uint32_t, uint32_t, void*, uint32_t, uint32_t); +typedef void* (*pFppppiii_t)(void*, void*, void*, void*, int32_t, int32_t, int32_t); +typedef void (*vFXLLiiibl__t)(void*, uintptr_t, uintptr_t, int32_t, int32_t, int32_t, struct_l_t*); +typedef int32_t (*iFppppppbp__t)(void*, void*, void*, void*, void*, void*, struct_p_t*); +typedef void* (*pFpiipipbp__t)(void*, int32_t, int32_t, void*, int32_t, void*, struct_p_t*); +typedef int32_t (*iFppppubpu_u_t)(void*, void*, void*, void*, uint32_t, struct_pu_t*, uint32_t); +typedef int32_t (*iFXiLibiip_ip_t)(void*, int32_t, uintptr_t, int32_t, struct_iip_t*, int32_t, void*); +typedef int32_t (*iFXLibL_ubL_u_t)(void*, uintptr_t, int32_t, struct_L_t*, uint32_t, struct_L_t*, uint32_t); +typedef int32_t (*iFppibp_pibpp__t)(void*, void*, int32_t, struct_p_t*, void*, int32_t, struct_pp_t*); +typedef int32_t (*iFXLpiibpiiL_i_t)(void*, uintptr_t, void*, int32_t, int32_t, struct_piiL_t*, int32_t); +typedef int32_t (*iFppbupu_uubpu_u_t)(void*, void*, struct_upu_t*, uint32_t, uint32_t, struct_pu_t*, uint32_t); +typedef int32_t (*iFppubpu_bpu_bpu_bpu__t)(void*, void*, uint32_t, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef uintptr_t (*LFXLLuubLWWWcc_bLWWWcc__t)(void*, uintptr_t, uintptr_t, uint32_t, uint32_t, struct_LWWWcc_t*, struct_LWWWcc_t*); +typedef uintptr_t (*LFXLLbLWWWcc_bLWWWcc_uu_t)(void*, uintptr_t, uintptr_t, struct_LWWWcc_t*, struct_LWWWcc_t*, uint32_t, uint32_t); +typedef int32_t (*iFpubpu_bpu_bpu_bpu_bpu__t)(void*, uint32_t, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFpbpu_bpu_bpu_bpu_bpu_bpu__t)(void*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef void (*vFEXLpiipi_t)(x64emu_t*, void*, uintptr_t, void*, int32_t, int32_t, void*, int32_t); +typedef void (*vFiiiiuuip_t)(int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, void*); +typedef void (*vFiilliilp_t)(int32_t, int32_t, intptr_t, intptr_t, int32_t, int32_t, intptr_t, void*); +typedef void (*vFiupuiuup_t)(int32_t, uint32_t, void*, uint32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFiupuuuup_t)(int32_t, uint32_t, void*, uint32_t, uint32_t, uint32_t, uint32_t, void*); +typedef void (*vFuiiiiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuiiiiiiC_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint8_t); +typedef void (*vFuiiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuiiipiup_t)(uint32_t, int32_t, int32_t, int32_t, void*, int32_t, uint32_t, void*); +typedef void (*vFuiuiiiii_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuiuiiiip_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFuiuiiiuU_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, uint32_t, uint64_t); +typedef void (*vFuiuiiCuU_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, uint8_t, uint32_t, uint64_t); +typedef void (*vFuiuiuuuu_t)(uint32_t, int32_t, uint32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuCCCCfff_t)(uint32_t, uint8_t, uint8_t, uint8_t, uint8_t, float, float, float); +typedef void (*vFuuiiiiiC_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint8_t); +typedef void (*vFuuiiiuip_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, void*); +typedef void (*vFuuiiiuup_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuuiiuupp_t)(uint32_t, uint32_t, int32_t, int32_t, uint32_t, uint32_t, void*, void*); +typedef void (*vFuuiuiiii_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuuiuiiiC_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, uint8_t); +typedef void (*vFuuiuiiip_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFuuuiiiiu_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t); +typedef void (*vFuuuiuCil_t)(uint32_t, uint32_t, uint32_t, int32_t, uint32_t, uint8_t, int32_t, intptr_t); +typedef void (*vFuuuipipp_t)(uint32_t, uint32_t, uint32_t, int32_t, void*, int32_t, void*, void*); +typedef void (*vFuuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuuufffff_t)(uint32_t, uint32_t, uint32_t, float, float, float, float, float); +typedef void (*vFffffffff_t)(float, float, float, float, float, float, float, float); +typedef void (*vFXiLLiipi_t)(void*, int32_t, uintptr_t, uintptr_t, int32_t, int32_t, void*, int32_t); +typedef void (*vFXiLpiiuu_t)(void*, int32_t, uintptr_t, void*, int32_t, int32_t, uint32_t, uint32_t); +typedef void (*vFXLiiiLii_t)(void*, uintptr_t, int32_t, int32_t, int32_t, uintptr_t, int32_t, int32_t); +typedef void (*vFXLLLiipi_t)(void*, uintptr_t, uintptr_t, uintptr_t, int32_t, int32_t, void*, int32_t); +typedef void (*vFXppuulll_t)(void*, void*, void*, uint32_t, uint32_t, intptr_t, intptr_t, intptr_t); +typedef int32_t (*iFEpippupp_t)(x64emu_t*, void*, int32_t, void*, void*, uint32_t, void*, void*); +typedef int32_t (*iEEpippppp_t)(x64emu_t*, void*, int32_t, void*, void*, void*, void*, void*); +typedef int32_t (*iEEpLiLppp_t)(x64emu_t*, void*, uintptr_t, int32_t, uintptr_t, void*, void*, void*); +typedef int32_t (*iFEppipppp_t)(x64emu_t*, void*, void*, int32_t, void*, void*, void*, void*); +typedef int32_t (*iFiipppppp_t)(int32_t, int32_t, void*, void*, void*, void*, void*, void*); +typedef int32_t (*iFiuuCCuup_t)(int32_t, uint32_t, uint32_t, uint8_t, uint8_t, uint32_t, uint32_t, void*); +typedef int32_t (*iFiuuuupip_t)(int32_t, uint32_t, uint32_t, uint32_t, uint32_t, void*, int32_t, void*); +typedef int32_t (*iFuiiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef int32_t (*iFupipppip_t)(uint32_t, void*, int32_t, void*, void*, void*, int32_t, void*); +typedef int32_t (*iFpuuiiuuu_t)(void*, uint32_t, uint32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t); +typedef int32_t (*iFpLpiLpLp_t)(void*, uintptr_t, void*, int32_t, uintptr_t, void*, uintptr_t, void*); +typedef int32_t (*iFXuupuupp_t)(void*, uint32_t, uint32_t, void*, uint32_t, uint32_t, void*, void*); +typedef int32_t (*iFXLpipppp_t)(void*, uintptr_t, void*, int32_t, void*, void*, void*, void*); +typedef int32_t (*iFXLppLpip_t)(void*, uintptr_t, void*, void*, uintptr_t, void*, int32_t, void*); +typedef int32_t (*iFXpIIIppp_t)(void*, void*, int64_t, int64_t, int64_t, void*, void*, void*); +typedef uint8_t (*CFuiifpppp_t)(uint32_t, int32_t, int32_t, float, void*, void*, void*, void*); +typedef uint32_t (*uFuipppppp_t)(uint32_t, int32_t, void*, void*, void*, void*, void*, void*); +typedef uint32_t (*uFuupuuiuf_t)(uint32_t, uint32_t, void*, uint32_t, uint32_t, int32_t, uint32_t, float); +typedef uint32_t (*uFulpppppp_t)(uint32_t, intptr_t, void*, void*, void*, void*, void*, void*); +typedef uintptr_t (*LFEXLppuuu_t)(x64emu_t*, void*, uintptr_t, void*, void*, uint32_t, uint32_t, uint32_t); +typedef uintptr_t (*LFXLpuuLLu_t)(void*, uintptr_t, void*, uint32_t, uint32_t, uintptr_t, uintptr_t, uint32_t); +typedef void* (*pFEppipipp_t)(x64emu_t*, void*, void*, int32_t, void*, int32_t, void*, void*); +typedef void* (*pFEXpLLppp_t)(x64emu_t*, void*, void*, uintptr_t, uintptr_t, void*, void*, void*); +typedef int32_t (*iFXLLiippBL__t)(void*, uintptr_t, uintptr_t, int32_t, int32_t, void*, void*, struct_L_t*); +typedef int32_t (*iFXLpppbL_pp_t)(void*, uintptr_t, void*, void*, void*, struct_L_t*, void*, void*); +typedef void* (*pFpuuuuupbp__t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, void*, struct_p_t*); +typedef int32_t (*iFppppubpu_Iu_t)(void*, void*, void*, void*, uint32_t, struct_pu_t*, int64_t, uint32_t); +typedef int32_t (*iFpppbpu_ppuu_t)(void*, void*, void*, struct_pu_t*, void*, void*, uint32_t, uint32_t); +typedef void (*vFppibLdd_ipiu_t)(void*, void*, int32_t, struct_Ldd_t*, int32_t, void*, int32_t, uint32_t); +typedef int32_t (*iFpupbL_ppbL_p_t)(void*, uint32_t, void*, struct_L_t*, void*, void*, struct_L_t*, void*); +typedef int32_t (*iFpppibp_pbp_p_t)(void*, void*, void*, int32_t, struct_p_t*, void*, struct_p_t*, void*); +typedef int32_t (*iFbpu_upppppbp__t)(struct_pu_t*, uint32_t, void*, void*, void*, void*, void*, struct_p_t*); +typedef int32_t (*iFbp_ubp_ubp_uup_t)(struct_p_t*, uint32_t, struct_p_t*, uint32_t, struct_p_t*, uint32_t, uint32_t, void*); +typedef int32_t (*iFpubpu_bpu_bpu_bpu_bpu_bpu__t)(void*, uint32_t, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef void (*vFEXLppiipi_t)(x64emu_t*, void*, uintptr_t, void*, void*, int32_t, int32_t, void*, int32_t); +typedef void (*vFiiiiiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFiiiiiiill_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t); +typedef void (*vFiiiiillli_t)(int32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t, int32_t); +typedef void (*vFiiilllilp_t)(int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t, int32_t, intptr_t, void*); +typedef void (*vFiupuiuuup_t)(int32_t, uint32_t, void*, uint32_t, int32_t, uint32_t, uint32_t, uint32_t, void*); +typedef void (*vFiupuuuuup_t)(int32_t, uint32_t, void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, void*); +typedef void (*vFuiiiiiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuiiiiiiiC_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint8_t); +typedef void (*vFuiiiiiuip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, void*); +typedef void (*vFuiiiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuiuiiiiip_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFuiuiiiCuU_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, uint8_t, uint32_t, uint64_t); +typedef void (*vFuiupuffup_t)(uint32_t, int32_t, uint32_t, void*, uint32_t, float, float, uint32_t, void*); +typedef void (*vFuuiiiiiii_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuuiiiiiiC_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint8_t); +typedef void (*vFuuiiiiuup_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuuiuiiiii_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuuiuiiiip_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFuuuiiiiCp_t)(uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint8_t, void*); +typedef void (*vFuuuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuupuuiuuf_t)(uint32_t, uint32_t, void*, uint32_t, uint32_t, int32_t, uint32_t, uint32_t, float); +typedef void (*vFuffffffff_t)(uint32_t, float, float, float, float, float, float, float, float); +typedef void (*vFffCCCCfff_t)(float, float, uint8_t, uint8_t, uint8_t, uint8_t, float, float, float); +typedef void (*vFddddddddd_t)(double, double, double, double, double, double, double, double, double); +typedef void (*vFXiLLpiipi_t)(void*, int32_t, uintptr_t, uintptr_t, void*, int32_t, int32_t, void*, int32_t); +typedef void (*vFXLiiipiii_t)(void*, uintptr_t, int32_t, int32_t, int32_t, void*, int32_t, int32_t, int32_t); +typedef int32_t (*iFEpuippupp_t)(x64emu_t*, void*, uint32_t, int32_t, void*, void*, uint32_t, void*, void*); +typedef int32_t (*iFEXLLLiipi_t)(x64emu_t*, void*, uintptr_t, uintptr_t, uintptr_t, int32_t, int32_t, void*, int32_t); +typedef int32_t (*iFiuuuppppu_t)(int32_t, uint32_t, uint32_t, uint32_t, void*, void*, void*, void*, uint32_t); +typedef int32_t (*iFuiiuuiiip_t)(uint32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, void*); +typedef int32_t (*iFuiiupiiup_t)(uint32_t, int32_t, int32_t, uint32_t, void*, int32_t, int32_t, uint32_t, void*); +typedef int32_t (*iFdddpppppp_t)(double, double, double, void*, void*, void*, void*, void*, void*); +typedef int32_t (*iFXuuuLiiip_t)(void*, uint32_t, uint32_t, uint32_t, uintptr_t, int32_t, int32_t, int32_t, void*); +typedef int32_t (*iFXuuuLpppp_t)(void*, uint32_t, uint32_t, uint32_t, uintptr_t, void*, void*, void*, void*); +typedef int32_t (*iFXLiuiiLLL_t)(void*, uintptr_t, int32_t, uint32_t, int32_t, int32_t, uintptr_t, uintptr_t, uintptr_t); +typedef int32_t (*iFXLLiiuuii_t)(void*, uintptr_t, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t); +typedef int32_t (*iFXLpiiuuii_t)(void*, uintptr_t, void*, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t); +typedef uint32_t (*uFuulpiuiuf_t)(uint32_t, uint32_t, intptr_t, void*, int32_t, uint32_t, int32_t, uint32_t, float); +typedef uintptr_t (*LFXLiiiiiip_t)(void*, uintptr_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); +typedef uintptr_t (*LFXLiiuuuLL_t)(void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uintptr_t, uintptr_t); +typedef void* (*pFEuiiiuuuu_t)(x64emu_t*, uint32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void* (*pFEpnCuuuuu_t)(x64emu_t*, void*, void*, uint8_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void* (*pFEXLiiuuLi_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, uintptr_t, int32_t); +typedef void* (*pFpiiiiuuuu_t)(void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef int32_t (*iFXLbL_pppppp_t)(void*, uintptr_t, struct_L_t*, void*, void*, void*, void*, void*, void*); +typedef int32_t (*iFXiLiiibiip_ip_t)(void*, int32_t, uintptr_t, int32_t, int32_t, int32_t, struct_iip_t*, int32_t, void*); +typedef int32_t (*iFXiLLLiiibiip__t)(void*, int32_t, uintptr_t, uintptr_t, uintptr_t, int32_t, int32_t, int32_t, struct_iip_t*); +typedef int32_t (*iFXLbL_bL_ppppp_t)(void*, uintptr_t, struct_L_t*, struct_L_t*, void*, void*, void*, void*, void*); +typedef int32_t (*iFuuppuubpu_bpu_u_t)(uint32_t, uint32_t, void*, void*, uint32_t, uint32_t, struct_pu_t*, struct_pu_t*, uint32_t); +typedef int32_t (*iFpuuuuuubpu_bpu__t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, struct_pu_t*, struct_pu_t*); +typedef int32_t (*iFpuupbpu_ubpu_uu_t)(void*, uint32_t, uint32_t, void*, struct_pu_t*, uint32_t, struct_pu_t*, uint32_t, uint32_t); +typedef void* (*pFEXbpLiLLLii_uippuu_t)(x64emu_t*, void*, struct_pLiLLLii_t*, uint32_t, int32_t, void*, void*, uint32_t, uint32_t); +typedef void (*vFXiLLrLiiwwwwwwwwL_iipi_t)(void*, int32_t, uintptr_t, uintptr_t, struct_LiiwwwwwwwwL_t*, int32_t, int32_t, void*, int32_t); +typedef int32_t (*iFpbpu_bpu_bpu_bpu_bpu_bpu_bpu_bpu__t)(void*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*, struct_pu_t*); +typedef void (*vFEXLpppippp_t)(x64emu_t*, void*, uintptr_t, void*, void*, void*, int32_t, void*, void*, void*); +typedef void (*vFiiiiiiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFiiiiiiiiui_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t); +typedef void (*vFiiiiiiiiuu_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); +typedef void (*vFiiillliiip_t)(int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFuiiiiiiiii_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuiiiiiiiip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFuiiiiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuiuiiiiuup_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuuiiiiiiii_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFuuiiiiiuip_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, void*); +typedef void (*vFuuiiiiiuup_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuuiuiiiiip_t)(uint32_t, uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); +typedef void (*vFuuuuuuuCCC_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint8_t, uint8_t, uint8_t); +typedef void (*vFuuuuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuupuiupuuf_t)(uint32_t, uint32_t, void*, uint32_t, int32_t, uint32_t, void*, uint32_t, uint32_t, float); +typedef void (*vFuffiiffiip_t)(uint32_t, float, float, int32_t, int32_t, float, float, int32_t, int32_t, void*); +typedef void (*vFuddiiddiip_t)(uint32_t, double, double, int32_t, int32_t, double, double, int32_t, int32_t, void*); +typedef void (*vFffffffffff_t)(float, float, float, float, float, float, float, float, float, float); +typedef void (*vFppipipippi_t)(void*, void*, int32_t, void*, int32_t, void*, int32_t, void*, void*, int32_t); +typedef int32_t (*iFEppippippp_t)(x64emu_t*, void*, void*, int32_t, void*, void*, int32_t, void*, void*, void*); +typedef int32_t (*iFEppppppppu_t)(x64emu_t*, void*, void*, void*, void*, void*, void*, void*, void*, uint32_t); +typedef int32_t (*iFEXpLiipiiL_t)(x64emu_t*, void*, void*, uintptr_t, int32_t, int32_t, void*, int32_t, int32_t, uintptr_t); +typedef int32_t (*iFiuuupppppu_t)(int32_t, uint32_t, uint32_t, uint32_t, void*, void*, void*, void*, void*, uint32_t); +typedef int32_t (*iFuiiiuuiiip_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, void*); +typedef int32_t (*iFppuuiiuuuu_t)(void*, void*, uint32_t, uint32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef int32_t (*iFXiLLdduudd_t)(void*, int32_t, uintptr_t, uintptr_t, double, double, uint32_t, uint32_t, double, double); +typedef int32_t (*iFXuuLiuiiLL_t)(void*, uint32_t, uint32_t, uintptr_t, int32_t, uint32_t, int32_t, int32_t, uintptr_t, uintptr_t); +typedef int32_t (*iFXLLpiiuuii_t)(void*, uintptr_t, uintptr_t, void*, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t); +typedef void* (*pFEpiiiiuuuu_t)(x64emu_t*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void* (*pFEpnCuuuCup_t)(x64emu_t*, void*, void*, uint8_t, uint32_t, uint32_t, uint32_t, uint8_t, uint32_t, void*); +typedef void* (*pFXpuiipuuii_t)(void*, void*, uint32_t, int32_t, int32_t, void*, uint32_t, uint32_t, int32_t, int32_t); +typedef int32_t (*iFppLpLLpLpbL__t)(void*, void*, uintptr_t, void*, uintptr_t, uintptr_t, void*, uintptr_t, void*, struct_L_t*); +typedef int32_t (*iFXiiLiiibiip_ip_t)(void*, int32_t, int32_t, uintptr_t, int32_t, int32_t, int32_t, struct_iip_t*, int32_t, void*); +typedef int32_t (*iFXiLLiiibiip_ip_t)(void*, int32_t, uintptr_t, uintptr_t, int32_t, int32_t, int32_t, struct_iip_t*, int32_t, void*); +typedef void (*vFiiiiillliip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t, int32_t, int32_t, void*); +typedef void (*vFiiiiilllilp_t)(int32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t, int32_t, intptr_t, void*); +typedef void (*vFuiiiiiiiuip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, void*); +typedef void (*vFuiiiiiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuiiiillliip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t, int32_t, int32_t, void*); +typedef void (*vFuiuiiiiiuup_t)(uint32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuuiiiiiiuup_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuuupupppppp_t)(uint32_t, uint32_t, uint32_t, void*, uint32_t, void*, void*, void*, void*, void*, void*); +typedef void (*vFuuffiiffiip_t)(uint32_t, uint32_t, float, float, int32_t, int32_t, float, float, int32_t, int32_t, void*); +typedef void (*vFuufffffffff_t)(uint32_t, uint32_t, float, float, float, float, float, float, float, float, float); +typedef void (*vFuuddiiddiip_t)(uint32_t, uint32_t, double, double, int32_t, int32_t, double, double, int32_t, int32_t, void*); +typedef void (*vFuUuuuuuuuuu_t)(uint32_t, uint64_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuffffffffff_t)(uint32_t, float, float, float, float, float, float, float, float, float, float); +typedef void (*vFUufffffffff_t)(uint64_t, uint32_t, float, float, float, float, float, float, float, float, float); +typedef void (*vFpiiiiiiiiuu_t)(void*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); +typedef void (*vFpipipiipiiu_t)(void*, int32_t, void*, int32_t, void*, int32_t, int32_t, void*, int32_t, int32_t, uint32_t); +typedef int32_t (*iFEXLppiiiiuu_t)(x64emu_t*, void*, uintptr_t, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); +typedef int32_t (*iFEXpLLiiLWpi_t)(x64emu_t*, void*, void*, uintptr_t, uintptr_t, int32_t, int32_t, uintptr_t, uint16_t, void*, int32_t); +typedef int32_t (*iFuiiiiuuiiip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, void*); +typedef int32_t (*iFuppipipippi_t)(uint32_t, void*, void*, int32_t, void*, int32_t, void*, int32_t, void*, void*, int32_t); +typedef int32_t (*iFXLLpiiuuiiL_t)(void*, uintptr_t, uintptr_t, void*, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, uintptr_t); +typedef void* (*pFEXpuiipuuii_t)(x64emu_t*, void*, void*, uint32_t, int32_t, int32_t, void*, uint32_t, uint32_t, int32_t, int32_t); +typedef int32_t (*iFXiiLLiiibiip_ip_t)(void*, int32_t, int32_t, uintptr_t, uintptr_t, int32_t, int32_t, int32_t, struct_iip_t*, int32_t, void*); +typedef int32_t (*iFXLibL_iiiibL_bL_bL__t)(void*, uintptr_t, int32_t, struct_L_t*, int32_t, int32_t, int32_t, int32_t, struct_L_t*, struct_L_t*, struct_L_t*); +typedef void (*vFXiLLrLiiwwwwwwwwL_iiiipi_t)(void*, int32_t, uintptr_t, uintptr_t, struct_LiiwwwwwwwwL_t*, int32_t, int32_t, int32_t, int32_t, void*, int32_t); +typedef void (*vFuiiiiiiiiuUC_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint64_t, uint8_t); +typedef void (*vFuiiiiiiiuuip_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, void*); +typedef void (*vFuuiiiiiiiiuu_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); +typedef void (*vFuuiiiiiiiuip_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, void*); +typedef void (*vFuuiiiiiiiuup_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuuuuuuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFffffffffffff_t)(float, float, float, float, float, float, float, float, float, float, float, float); +typedef void (*vFXiLLpiiiipii_t)(void*, int32_t, uintptr_t, uintptr_t, void*, int32_t, int32_t, int32_t, int32_t, void*, int32_t, int32_t); +typedef int32_t (*iFEXLppiiiiuui_t)(x64emu_t*, void*, uintptr_t, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t); +typedef int32_t (*iFXLpppppppppp_t)(void*, uintptr_t, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); +typedef void* (*pFEXLiiuuLipii_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, uintptr_t, int32_t, void*, int32_t, int32_t); +typedef int32_t (*iFXiLbL_bL_ppppbip_pp_t)(void*, int32_t, uintptr_t, struct_L_t*, struct_L_t*, void*, void*, void*, void*, struct_ip_t*, void*, void*); +typedef int32_t (*iFXiLlliLBL_pBL_BL_bp__t)(void*, int32_t, uintptr_t, intptr_t, intptr_t, int32_t, uintptr_t, struct_L_t*, void*, struct_L_t*, struct_L_t*, struct_p_t*); +typedef void (*vFXiLLrLiiwwwwwwwwL_Liiiipi_t)(void*, int32_t, uintptr_t, uintptr_t, struct_LiiwwwwwwwwL_t*, uintptr_t, int32_t, int32_t, int32_t, int32_t, void*, int32_t); +typedef void (*vFuiiiiiiiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef void (*vFuuuuuuuuuuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuUuuuuuuuuuuu_t)(uint32_t, uint64_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef void (*vFuffffffffffff_t)(uint32_t, float, float, float, float, float, float, float, float, float, float, float, float); +typedef void (*vFXiLLLiiiiiiuu_t)(void*, int32_t, uintptr_t, uintptr_t, uintptr_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t); +typedef int32_t (*iFEXLLlliLppppp_t)(x64emu_t*, void*, uintptr_t, uintptr_t, intptr_t, intptr_t, int32_t, uintptr_t, void*, void*, void*, void*, void*); +typedef int32_t (*iFiuuuuiiuuuuuu_t)(int32_t, uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef int32_t (*iFddddpppddpppp_t)(double, double, double, double, void*, void*, void*, double, double, void*, void*, void*, void*); +typedef int32_t (*iFXippuuuiipppp_t)(void*, int32_t, void*, void*, uint32_t, uint32_t, uint32_t, int32_t, int32_t, void*, void*, void*, void*); +typedef uint32_t (*uFippuuuulllipp_t)(int32_t, void*, void*, uint32_t, uint32_t, uint32_t, uint32_t, intptr_t, intptr_t, intptr_t, int32_t, void*, void*); +typedef uintptr_t (*LFEXLiiuuuiupLp_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, uint32_t, uint32_t, uint32_t, int32_t, uint32_t, void*, uintptr_t, void*); +typedef int32_t (*iFXLLlliiLBL_pBL_BL_Bp__t)(void*, uintptr_t, uintptr_t, intptr_t, intptr_t, int32_t, int32_t, uintptr_t, struct_L_t*, void*, struct_L_t*, struct_L_t*, struct_p_t*); +typedef void (*vFuffiiffiiffiip_t)(uint32_t, float, float, int32_t, int32_t, float, float, int32_t, int32_t, float, float, int32_t, int32_t, void*); +typedef void (*vFuddiiddiiddiip_t)(uint32_t, double, double, int32_t, int32_t, double, double, int32_t, int32_t, double, double, int32_t, int32_t, void*); +typedef void (*vFuiiiiiuiiiiilll_t)(uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, intptr_t, intptr_t, intptr_t); +typedef void (*vFuuiiiiuuiiiiiii_t)(uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFfffffffffffffff_t)(float, float, float, float, float, float, float, float, float, float, float, float, float, float, float); +typedef int32_t (*iFpppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*); +typedef void* (*pFEppnCuuwwWWWWuup_t)(x64emu_t*, void*, void*, void*, uint8_t, uint32_t, uint32_t, int16_t, int16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint32_t, void*); +typedef void (*vFuuuuiiiiuuiiiiiii_t)(uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef void (*vFXpuiiiiipuiiiiiiii_t)(void*, void*, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); +typedef uint32_t (*uFippuuuuiiiiuuiiiiiiiipp_t)(int32_t, void*, void*, uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*, void*); + +#if defined(HAVE_LD80BITS) +typedef long double (*DED_t)(long double); +typedef long double (*DFDi_t)(long double, int32_t); +typedef long double (*DEDD_t)(long double, long double); +typedef long double (*DFDp_t)(long double, void*); +typedef long double (*DEDp_t)(long double, void*); +typedef long double (*DEpBp_a_t)(void*, struct_p_t*, void*); +#endif + +#if !defined(HAVE_LD80BITS) +typedef double (*KEK_t)(double); +typedef double (*KFKi_t)(double, int32_t); +typedef double (*KEKK_t)(double, double); +typedef double (*KFKp_t)(double, void*); +typedef double (*KEKp_t)(double, void*); +typedef double (*KEpBp_a_t)(void*, struct_p_t*, void*); +#endif + +#if defined(WINLATOR_GLIBC) +typedef void* (*pEipi_t)(int32_t, void*, int32_t); +#endif + +#if !defined(WINLATOR_GLIBC) +typedef void* (*pEEipi_t)(x64emu_t*, int32_t, void*, int32_t); +#endif + +void vEv_32(x64emu_t *emu, uintptr_t fcn) { vEv_t fn = (vEv_t)fcn; errno = emu->libc_err; fn(); emu->libc_err = errno; } +void vFv_32(x64emu_t *emu, uintptr_t fcn) { vFv_t fn = (vFv_t)fcn; fn(); } +void vFc_32(x64emu_t *emu, uintptr_t fcn) { vFc_t fn = (vFc_t)fcn; fn(from_ptri(int8_t, R_ESP + 4)); } +void vFw_32(x64emu_t *emu, uintptr_t fcn) { vFw_t fn = (vFw_t)fcn; fn(from_ptri(int16_t, R_ESP + 4)); } +void vEi_32(x64emu_t *emu, uintptr_t fcn) { vEi_t fn = (vEi_t)fcn; errno = emu->libc_err; fn(from_ptri(int32_t, R_ESP + 4)); emu->libc_err = errno; } +void vFi_32(x64emu_t *emu, uintptr_t fcn) { vFi_t fn = (vFi_t)fcn; fn(from_ptri(int32_t, R_ESP + 4)); } +void vFC_32(x64emu_t *emu, uintptr_t fcn) { vFC_t fn = (vFC_t)fcn; fn(from_ptri(uint8_t, R_ESP + 4)); } +void vFW_32(x64emu_t *emu, uintptr_t fcn) { vFW_t fn = (vFW_t)fcn; fn(from_ptri(uint16_t, R_ESP + 4)); } +void vEu_32(x64emu_t *emu, uintptr_t fcn) { vEu_t fn = (vEu_t)fcn; errno = emu->libc_err; fn(from_ptri(uint32_t, R_ESP + 4)); emu->libc_err = errno; } +void vFu_32(x64emu_t *emu, uintptr_t fcn) { vFu_t fn = (vFu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4)); } +void vFU_32(x64emu_t *emu, uintptr_t fcn) { vFU_t fn = (vFU_t)fcn; fn(from_ptri(uint64_t, R_ESP + 4)); } +void vFf_32(x64emu_t *emu, uintptr_t fcn) { vFf_t fn = (vFf_t)fcn; fn(from_ptri(float, R_ESP + 4)); } +void vFd_32(x64emu_t *emu, uintptr_t fcn) { vFd_t fn = (vFd_t)fcn; fn(from_ptri(double, R_ESP + 4)); } +void vEl_32(x64emu_t *emu, uintptr_t fcn) { vEl_t fn = (vEl_t)fcn; errno = emu->libc_err; fn(from_long(from_ptri(long_t, R_ESP + 4))); emu->libc_err = errno; } +void vFl_32(x64emu_t *emu, uintptr_t fcn) { vFl_t fn = (vFl_t)fcn; fn(from_long(from_ptri(long_t, R_ESP + 4))); } +void vEp_32(x64emu_t *emu, uintptr_t fcn) { vEp_t fn = (vEp_t)fcn; errno = emu->libc_err; fn(from_ptriv(R_ESP + 4)); emu->libc_err = errno; } +void vFp_32(x64emu_t *emu, uintptr_t fcn) { vFp_t fn = (vFp_t)fcn; fn(from_ptriv(R_ESP + 4)); } +void vEA_32(x64emu_t *emu, uintptr_t fcn) { vEA_t fn = (vEA_t)fcn; errno = emu->libc_err; fn(from_locale_d(from_ptri(ptr_t, R_ESP + 4))); emu->libc_err = errno; } +void vES_32(x64emu_t *emu, uintptr_t fcn) { vES_t fn = (vES_t)fcn; errno = emu->libc_err; fn(io_convert32(from_ptriv(R_ESP + 4))); emu->libc_err = errno; } +void vFS_32(x64emu_t *emu, uintptr_t fcn) { vFS_t fn = (vFS_t)fcn; fn(io_convert32(from_ptriv(R_ESP + 4))); } +void vFX_32(x64emu_t *emu, uintptr_t fcn) { vFX_t fn = (vFX_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4))); } +void vFn_32(x64emu_t *emu, uintptr_t fcn) { vFn_t fn = (vFn_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); fn(aligned_xcb); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); } +void cFc_32(x64emu_t *emu, uintptr_t fcn) { cFc_t fn = (cFc_t)fcn; R_EAX = fn(from_ptri(int8_t, R_ESP + 4)); } +void cFi_32(x64emu_t *emu, uintptr_t fcn) { cFi_t fn = (cFi_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4)); } +void cFu_32(x64emu_t *emu, uintptr_t fcn) { cFu_t fn = (cFu_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4)); } +void cFp_32(x64emu_t *emu, uintptr_t fcn) { cFp_t fn = (cFp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4)); } +void wFp_32(x64emu_t *emu, uintptr_t fcn) { wFp_t fn = (wFp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4)); } +void iEv_32(x64emu_t *emu, uintptr_t fcn) { iEv_t fn = (iEv_t)fcn; errno = emu->libc_err; R_EAX = fn(); emu->libc_err = errno; } +void iFv_32(x64emu_t *emu, uintptr_t fcn) { iFv_t fn = (iFv_t)fcn; R_EAX = fn(); } +void iEi_32(x64emu_t *emu, uintptr_t fcn) { iEi_t fn = (iEi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4)); emu->libc_err = errno; } +void iFi_32(x64emu_t *emu, uintptr_t fcn) { iFi_t fn = (iFi_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4)); } +void iEI_32(x64emu_t *emu, uintptr_t fcn) { iEI_t fn = (iEI_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int64_t, R_ESP + 4)); emu->libc_err = errno; } +void iEu_32(x64emu_t *emu, uintptr_t fcn) { iEu_t fn = (iEu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4)); emu->libc_err = errno; } +void iFu_32(x64emu_t *emu, uintptr_t fcn) { iFu_t fn = (iFu_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4)); } +void iFU_32(x64emu_t *emu, uintptr_t fcn) { iFU_t fn = (iFU_t)fcn; R_EAX = fn(from_ptri(uint64_t, R_ESP + 4)); } +void iEf_32(x64emu_t *emu, uintptr_t fcn) { iEf_t fn = (iEf_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(float, R_ESP + 4)); emu->libc_err = errno; } +void iEd_32(x64emu_t *emu, uintptr_t fcn) { iEd_t fn = (iEd_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(double, R_ESP + 4)); emu->libc_err = errno; } +void iEl_32(x64emu_t *emu, uintptr_t fcn) { iEl_t fn = (iEl_t)fcn; errno = emu->libc_err; R_EAX = fn(from_long(from_ptri(long_t, R_ESP + 4))); emu->libc_err = errno; } +void iEL_32(x64emu_t *emu, uintptr_t fcn) { iEL_t fn = (iEL_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ulong(from_ptri(ulong_t, R_ESP + 4))); emu->libc_err = errno; } +void iFL_32(x64emu_t *emu, uintptr_t fcn) { iFL_t fn = (iFL_t)fcn; R_EAX = fn(from_ulong(from_ptri(ulong_t, R_ESP + 4))); } +void iEp_32(x64emu_t *emu, uintptr_t fcn) { iEp_t fn = (iEp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4)); emu->libc_err = errno; } +void iFp_32(x64emu_t *emu, uintptr_t fcn) { iFp_t fn = (iFp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4)); } +void iEh_32(x64emu_t *emu, uintptr_t fcn) { iEh_t fn = (iEh_t)fcn; errno = emu->libc_err; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4))); emu->libc_err = errno; } +void iES_32(x64emu_t *emu, uintptr_t fcn) { iES_t fn = (iES_t)fcn; errno = emu->libc_err; R_EAX = fn(io_convert32(from_ptriv(R_ESP + 4))); emu->libc_err = errno; } +void iFX_32(x64emu_t *emu, uintptr_t fcn) { iFX_t fn = (iFX_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4))); } +void iFn_32(x64emu_t *emu, uintptr_t fcn) { iFn_t fn = (iFn_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); R_EAX = fn(aligned_xcb); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); } +void IFi_32(x64emu_t *emu, uintptr_t fcn) { IFi_t fn = (IFi_t)fcn; ui64_t r; r.i = fn(from_ptri(int32_t, R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void IEf_32(x64emu_t *emu, uintptr_t fcn) { IEf_t fn = (IEf_t)fcn; errno = emu->libc_err; ui64_t r; r.i = fn(from_ptri(float, R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void IEd_32(x64emu_t *emu, uintptr_t fcn) { IEd_t fn = (IEd_t)fcn; errno = emu->libc_err; ui64_t r; r.i = fn(from_ptri(double, R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void IEp_32(x64emu_t *emu, uintptr_t fcn) { IEp_t fn = (IEp_t)fcn; errno = emu->libc_err; ui64_t r; r.i = fn(from_ptriv(R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void IFp_32(x64emu_t *emu, uintptr_t fcn) { IFp_t fn = (IFp_t)fcn; ui64_t r; r.i = fn(from_ptriv(R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void IES_32(x64emu_t *emu, uintptr_t fcn) { IES_t fn = (IES_t)fcn; errno = emu->libc_err; ui64_t r; r.i = fn(io_convert32(from_ptriv(R_ESP + 4))); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void CFv_32(x64emu_t *emu, uintptr_t fcn) { CFv_t fn = (CFv_t)fcn; R_EAX = (unsigned char)fn(); } +void CFi_32(x64emu_t *emu, uintptr_t fcn) { CFi_t fn = (CFi_t)fcn; R_EAX = (unsigned char)fn(from_ptri(int32_t, R_ESP + 4)); } +void CFu_32(x64emu_t *emu, uintptr_t fcn) { CFu_t fn = (CFu_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint32_t, R_ESP + 4)); } +void CFU_32(x64emu_t *emu, uintptr_t fcn) { CFU_t fn = (CFU_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint64_t, R_ESP + 4)); } +void CFl_32(x64emu_t *emu, uintptr_t fcn) { CFl_t fn = (CFl_t)fcn; R_EAX = (unsigned char)fn(from_long(from_ptri(long_t, R_ESP + 4))); } +void CFp_32(x64emu_t *emu, uintptr_t fcn) { CFp_t fn = (CFp_t)fcn; R_EAX = (unsigned char)fn(from_ptriv(R_ESP + 4)); } +void WFi_32(x64emu_t *emu, uintptr_t fcn) { WFi_t fn = (WFi_t)fcn; R_EAX = (unsigned short)fn(from_ptri(int32_t, R_ESP + 4)); } +void WEW_32(x64emu_t *emu, uintptr_t fcn) { WEW_t fn = (WEW_t)fcn; errno = emu->libc_err; R_EAX = (unsigned short)fn(from_ptri(uint16_t, R_ESP + 4)); emu->libc_err = errno; } +void WFu_32(x64emu_t *emu, uintptr_t fcn) { WFu_t fn = (WFu_t)fcn; R_EAX = (unsigned short)fn(from_ptri(uint32_t, R_ESP + 4)); } +void WFp_32(x64emu_t *emu, uintptr_t fcn) { WFp_t fn = (WFp_t)fcn; R_EAX = (unsigned short)fn(from_ptriv(R_ESP + 4)); } +void uEv_32(x64emu_t *emu, uintptr_t fcn) { uEv_t fn = (uEv_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(); emu->libc_err = errno; } +void uFv_32(x64emu_t *emu, uintptr_t fcn) { uFv_t fn = (uFv_t)fcn; R_EAX = (uint32_t)fn(); } +void uEi_32(x64emu_t *emu, uintptr_t fcn) { uEi_t fn = (uEi_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(from_ptri(int32_t, R_ESP + 4)); emu->libc_err = errno; } +void uFi_32(x64emu_t *emu, uintptr_t fcn) { uFi_t fn = (uFi_t)fcn; R_EAX = (uint32_t)fn(from_ptri(int32_t, R_ESP + 4)); } +void uEu_32(x64emu_t *emu, uintptr_t fcn) { uEu_t fn = (uEu_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4)); emu->libc_err = errno; } +void uFu_32(x64emu_t *emu, uintptr_t fcn) { uFu_t fn = (uFu_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4)); } +void uEU_32(x64emu_t *emu, uintptr_t fcn) { uEU_t fn = (uEU_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(from_ptri(uint64_t, R_ESP + 4)); emu->libc_err = errno; } +void uEp_32(x64emu_t *emu, uintptr_t fcn) { uEp_t fn = (uEp_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4)); emu->libc_err = errno; } +void uFp_32(x64emu_t *emu, uintptr_t fcn) { uFp_t fn = (uFp_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4)); } +void uES_32(x64emu_t *emu, uintptr_t fcn) { uES_t fn = (uES_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(io_convert32(from_ptriv(R_ESP + 4))); emu->libc_err = errno; } +void uFX_32(x64emu_t *emu, uintptr_t fcn) { uFX_t fn = (uFX_t)fcn; R_EAX = (uint32_t)fn(getDisplay(from_ptriv(R_ESP + 4))); } +void uFn_32(x64emu_t *emu, uintptr_t fcn) { uFn_t fn = (uFn_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); R_EAX = (uint32_t)fn(aligned_xcb); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); } +void UFv_32(x64emu_t *emu, uintptr_t fcn) { UFv_t fn = (UFv_t)fcn; ui64_t r; r.u = (uint64_t)fn(); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void UFi_32(x64emu_t *emu, uintptr_t fcn) { UFi_t fn = (UFi_t)fcn; ui64_t r; r.u = (uint64_t)fn(from_ptri(int32_t, R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void UFu_32(x64emu_t *emu, uintptr_t fcn) { UFu_t fn = (UFu_t)fcn; ui64_t r; r.u = (uint64_t)fn(from_ptri(uint32_t, R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void UEp_32(x64emu_t *emu, uintptr_t fcn) { UEp_t fn = (UEp_t)fcn; errno = emu->libc_err; ui64_t r; r.u = (uint64_t)fn(from_ptriv(R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void UFp_32(x64emu_t *emu, uintptr_t fcn) { UFp_t fn = (UFp_t)fcn; ui64_t r; r.u = (uint64_t)fn(from_ptriv(R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void UEs_32(x64emu_t *emu, uintptr_t fcn) { UEs_t fn = (UEs_t)fcn; errno = emu->libc_err; ui64_t r; r.u = (uint64_t)fn(from_ptrv(R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void fFi_32(x64emu_t *emu, uintptr_t fcn) { fFi_t fn = (fFi_t)fcn; float fl = fn(from_ptri(int32_t, R_ESP + 4)); fpu_do_push(emu); ST0val = fl; } +void fEf_32(x64emu_t *emu, uintptr_t fcn) { fEf_t fn = (fEf_t)fcn; errno = emu->libc_err; float fl = fn(from_ptri(float, R_ESP + 4)); fpu_do_push(emu); ST0val = fl; emu->libc_err = errno; } +void fFf_32(x64emu_t *emu, uintptr_t fcn) { fFf_t fn = (fFf_t)fcn; float fl = fn(from_ptri(float, R_ESP + 4)); fpu_do_push(emu); ST0val = fl; } +void dEv_32(x64emu_t *emu, uintptr_t fcn) { dEv_t fn = (dEv_t)fcn; errno = emu->libc_err; double db = fn(); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void dFi_32(x64emu_t *emu, uintptr_t fcn) { dFi_t fn = (dFi_t)fcn; double db = fn(from_ptri(int32_t, R_ESP + 4)); fpu_do_push(emu); ST0val = db; } +void dEd_32(x64emu_t *emu, uintptr_t fcn) { dEd_t fn = (dEd_t)fcn; errno = emu->libc_err; double db = fn(from_ptri(double, R_ESP + 4)); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void dFd_32(x64emu_t *emu, uintptr_t fcn) { dFd_t fn = (dFd_t)fcn; double db = fn(from_ptri(double, R_ESP + 4)); fpu_do_push(emu); ST0val = db; } +void dEp_32(x64emu_t *emu, uintptr_t fcn) { dEp_t fn = (dEp_t)fcn; errno = emu->libc_err; double db = fn(from_ptriv(R_ESP + 4)); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void dFp_32(x64emu_t *emu, uintptr_t fcn) { dFp_t fn = (dFp_t)fcn; double db = fn(from_ptriv(R_ESP + 4)); fpu_do_push(emu); ST0val = db; } +void lEv_32(x64emu_t *emu, uintptr_t fcn) { lEv_t fn = (lEv_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn()); emu->libc_err = errno; } +void lFu_32(x64emu_t *emu, uintptr_t fcn) { lFu_t fn = (lFu_t)fcn; R_EAX = to_long(fn(from_ptri(uint32_t, R_ESP + 4))); } +void lEl_32(x64emu_t *emu, uintptr_t fcn) { lEl_t fn = (lEl_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_long(from_ptri(long_t, R_ESP + 4)))); emu->libc_err = errno; } +void lFl_32(x64emu_t *emu, uintptr_t fcn) { lFl_t fn = (lFl_t)fcn; R_EAX = to_long(fn(from_long(from_ptri(long_t, R_ESP + 4)))); } +void lEp_32(x64emu_t *emu, uintptr_t fcn) { lEp_t fn = (lEp_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptriv(R_ESP + 4))); emu->libc_err = errno; } +void lFp_32(x64emu_t *emu, uintptr_t fcn) { lFp_t fn = (lFp_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4))); } +void lES_32(x64emu_t *emu, uintptr_t fcn) { lES_t fn = (lES_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(io_convert32(from_ptriv(R_ESP + 4)))); emu->libc_err = errno; } +void lFX_32(x64emu_t *emu, uintptr_t fcn) { lFX_t fn = (lFX_t)fcn; R_EAX = to_long(fn(getDisplay(from_ptriv(R_ESP + 4)))); } +void LEv_32(x64emu_t *emu, uintptr_t fcn) { LEv_t fn = (LEv_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn()); emu->libc_err = errno; } +void LFv_32(x64emu_t *emu, uintptr_t fcn) { LFv_t fn = (LFv_t)fcn; R_EAX = to_ulong(fn()); } +void LFi_32(x64emu_t *emu, uintptr_t fcn) { LFi_t fn = (LFi_t)fcn; R_EAX = to_ulong(fn(from_ptri(int32_t, R_ESP + 4))); } +void LFu_32(x64emu_t *emu, uintptr_t fcn) { LFu_t fn = (LFu_t)fcn; R_EAX = to_ulong(fn(from_ptri(uint32_t, R_ESP + 4))); } +void LEL_32(x64emu_t *emu, uintptr_t fcn) { LEL_t fn = (LEL_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)))); emu->libc_err = errno; } +void LEp_32(x64emu_t *emu, uintptr_t fcn) { LEp_t fn = (LEp_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4))); emu->libc_err = errno; } +void LFp_32(x64emu_t *emu, uintptr_t fcn) { LFp_t fn = (LFp_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4))); } +void LFX_32(x64emu_t *emu, uintptr_t fcn) { LFX_t fn = (LFX_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)))); } +void pEv_32(x64emu_t *emu, uintptr_t fcn) { pEv_t fn = (pEv_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn()); emu->libc_err = errno; } +void pFv_32(x64emu_t *emu, uintptr_t fcn) { pFv_t fn = (pFv_t)fcn; R_EAX = to_ptrv(fn()); } +void pEi_32(x64emu_t *emu, uintptr_t fcn) { pEi_t fn = (pEi_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4))); emu->libc_err = errno; } +void pFi_32(x64emu_t *emu, uintptr_t fcn) { pFi_t fn = (pFi_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4))); } +void pFI_32(x64emu_t *emu, uintptr_t fcn) { pFI_t fn = (pFI_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int64_t, R_ESP + 4))); } +void pFW_32(x64emu_t *emu, uintptr_t fcn) { pFW_t fn = (pFW_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint16_t, R_ESP + 4))); } +void pFu_32(x64emu_t *emu, uintptr_t fcn) { pFu_t fn = (pFu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4))); } +void pEu_32(x64emu_t *emu, uintptr_t fcn) { pEu_t fn = (pEu_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4))); emu->libc_err = errno; } +void pFU_32(x64emu_t *emu, uintptr_t fcn) { pFU_t fn = (pFU_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint64_t, R_ESP + 4))); } +void pEl_32(x64emu_t *emu, uintptr_t fcn) { pEl_t fn = (pEl_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_long(from_ptri(long_t, R_ESP + 4)))); emu->libc_err = errno; } +void pFl_32(x64emu_t *emu, uintptr_t fcn) { pFl_t fn = (pFl_t)fcn; R_EAX = to_ptrv(fn(from_long(from_ptri(long_t, R_ESP + 4)))); } +void pEL_32(x64emu_t *emu, uintptr_t fcn) { pEL_t fn = (pEL_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)))); emu->libc_err = errno; } +void pFL_32(x64emu_t *emu, uintptr_t fcn) { pFL_t fn = (pFL_t)fcn; R_EAX = to_ptrv(fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)))); } +void pEp_32(x64emu_t *emu, uintptr_t fcn) { pEp_t fn = (pEp_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4))); emu->libc_err = errno; } +void pFp_32(x64emu_t *emu, uintptr_t fcn) { pFp_t fn = (pFp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4))); } +void pFX_32(x64emu_t *emu, uintptr_t fcn) { pFX_t fn = (pFX_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)))); } +void pFn_32(x64emu_t *emu, uintptr_t fcn) { pFn_t fn = (pFn_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); R_EAX = to_ptrv(fn(aligned_xcb)); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); } +void hEv_32(x64emu_t *emu, uintptr_t fcn) { hEv_t fn = (hEv_t)fcn; errno = emu->libc_err; R_EAX = to_hash(fn()); emu->libc_err = errno; } +void hFv_32(x64emu_t *emu, uintptr_t fcn) { hFv_t fn = (hFv_t)fcn; R_EAX = to_hash(fn()); } +void aEa_32(x64emu_t *emu, uintptr_t fcn) { aEa_t fn = (aEa_t)fcn; errno = emu->libc_err; R_EAX = to_locale(fn(from_locale(from_ptri(ptr_t, R_ESP + 4)))); emu->libc_err = errno; } +void tEv_32(x64emu_t *emu, uintptr_t fcn) { tEv_t fn = (tEv_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn()); emu->libc_err = errno; } +void tEi_32(x64emu_t *emu, uintptr_t fcn) { tEi_t fn = (tEi_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptri(int32_t, R_ESP + 4))); emu->libc_err = errno; } +void tEu_32(x64emu_t *emu, uintptr_t fcn) { tEu_t fn = (tEu_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptri(uint32_t, R_ESP + 4))); emu->libc_err = errno; } +void tEp_32(x64emu_t *emu, uintptr_t fcn) { tEp_t fn = (tEp_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptriv(R_ESP + 4))); emu->libc_err = errno; } +void tFp_32(x64emu_t *emu, uintptr_t fcn) { tFp_t fn = (tFp_t)fcn; R_EAX = to_cstring(fn(from_ptriv(R_ESP + 4))); } +void XFv_32(x64emu_t *emu, uintptr_t fcn) { XFv_t fn = (XFv_t)fcn; R_EAX = to_ptrv(addDisplay(fn())); } +void XFp_32(x64emu_t *emu, uintptr_t fcn) { XFp_t fn = (XFp_t)fcn; R_EAX = to_ptrv(addDisplay(fn(from_ptriv(R_ESP + 4)))); } +void vFbp__32(x64emu_t *emu, uintptr_t fcn) { vFbp__t fn = (vFbp__t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp__32(x64emu_t *emu, uintptr_t fcn) { iFbp__t fn = (iFbp__t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFBp__32(x64emu_t *emu, uintptr_t fcn) { iFBp__t fn = (iFBp__t)fcn; struct_p_t arg_4={0}; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void LEBL__32(x64emu_t *emu, uintptr_t fcn) { LEBL__t fn = (LEBL__t)fcn; errno = emu->libc_err; struct_L_t arg_4={0}; R_EAX = to_ulong(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); emu->libc_err = errno; } +void pErl__32(x64emu_t *emu, uintptr_t fcn) { pErl__t fn = (pErl__t)fcn; errno = emu->libc_err; struct_l_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_l(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ptrv(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL)); emu->libc_err = errno; } +void pFbp__32(x64emu_t *emu, uintptr_t fcn) { pFbp__t fn = (pFbp__t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ptrv(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbpu__32(x64emu_t *emu, uintptr_t fcn) { iFbpu__t fn = (iFbpu__t)fcn; struct_pu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void IFbpu__32(x64emu_t *emu, uintptr_t fcn) { IFbpu__t fn = (IFbpu__t)fcn; struct_pu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); ui64_t r; r.i = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); R_EAX = r.d[0]; R_EDX = r.d[1]; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void lFrll__32(x64emu_t *emu, uintptr_t fcn) { lFrll__t fn = (lFrll__t)fcn; struct_ll_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ll(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_long(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL)); } +void vFbpii__32(x64emu_t *emu, uintptr_t fcn) { vFbpii__t fn = (vFbpii__t)fcn; struct_pii_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pii(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pii(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void vFbLdd__32(x64emu_t *emu, uintptr_t fcn) { vFbLdd__t fn = (vFbLdd__t)fcn; struct_Ldd_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_Ldd(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_Ldd(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void vFbupi__32(x64emu_t *emu, uintptr_t fcn) { vFbupi__t fn = (vFbupi__t)fcn; struct_upi_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_upi(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_upi(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iErLWww__32(x64emu_t *emu, uintptr_t fcn) { iErLWww__t fn = (iErLWww__t)fcn; errno = emu->libc_err; struct_LWww_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_LWww(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); emu->libc_err = errno; } +void iEBllll__32(x64emu_t *emu, uintptr_t fcn) { iEBllll__t fn = (iEBllll__t)fcn; errno = emu->libc_err; struct_llll_t arg_4={0}; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_llll(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); emu->libc_err = errno; } +void iFbppuii__32(x64emu_t *emu, uintptr_t fcn) { iFbppuii__t fn = (iFbppuii__t)fcn; struct_ppuii_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuii(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuii(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void uFbppuii__32(x64emu_t *emu, uintptr_t fcn) { uFbppuii__t fn = (uFbppuii__t)fcn; struct_ppuii_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuii(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = (uint32_t)fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuii(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void pFbppuii__32(x64emu_t *emu, uintptr_t fcn) { pFbppuii__t fn = (pFbppuii__t)fcn; struct_ppuii_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuii(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ptrv(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuii(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void vFbuuipWCCp__32(x64emu_t *emu, uintptr_t fcn) { vFbuuipWCCp__t fn = (vFbuuipWCCp__t)fcn; struct_uuipWCCp_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_uuipWCCp(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_uuipWCCp(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void vFbppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { vFbppuuuuup__t fn = (vFbppuuuuup__t)fcn; struct_ppuuuuup_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuuuuup(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void uFbppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { uFbppuuuuup__t fn = (uFbppuuuuup__t)fcn; struct_ppuuuuup_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuuuuup(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = (uint32_t)fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void vFbWWpWpWpWp__32(x64emu_t *emu, uintptr_t fcn) { vFbWWpWpWpWp__t fn = (vFbWWpWpWpWp__t)fcn; struct_WWpWpWpWp_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_WWpWpWpWp(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_WWpWpWpWp(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void LEbiiiiiiiiilt__32(x64emu_t *emu, uintptr_t fcn) { LEbiiiiiiiiilt__t fn = (LEbiiiiiiiiilt__t)fcn; errno = emu->libc_err; struct_iiiiiiiiilt_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_iiiiiiiiilt(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ulong(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_iiiiiiiiilt(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); emu->libc_err = errno; } +void pEriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fcn) { pEriiiiiiiiilt__t fn = (pEriiiiiiiiilt__t)fcn; errno = emu->libc_err; struct_iiiiiiiiilt_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_iiiiiiiiilt(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ptrv(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL)); emu->libc_err = errno; } +void iFbppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fcn) { iFbppuiiiiiiiiipp__t fn = (iFbppuiiiiiiiiipp__t)fcn; struct_ppuiiiiiiiiipp_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuiiiiiiiiipp(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void uFbppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fcn) { uFbppuiiiiiiiiipp__t fn = (uFbppuiiiiiiiiipp__t)fcn; struct_ppuiiiiiiiiipp_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuiiiiiiiiipp(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = (uint32_t)fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void pFbppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fcn) { pFbppuiiiiiiiiipp__t fn = (pFbppuiiiiiiiiipp__t)fcn; struct_ppuiiiiiiiiipp_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuiiiiiiiiipp(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ptrv(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void vEEv_32(x64emu_t *emu, uintptr_t fcn) { vEEv_t fn = (vEEv_t)fcn; errno = emu->libc_err; fn(emu); emu->libc_err = errno; } +void vFEv_32(x64emu_t *emu, uintptr_t fcn) { vFEv_t fn = (vFEv_t)fcn; fn(emu); } +void vFEi_32(x64emu_t *emu, uintptr_t fcn) { vFEi_t fn = (vFEi_t)fcn; fn(emu, from_ptri(int32_t, R_ESP + 4)); } +void vEEp_32(x64emu_t *emu, uintptr_t fcn) { vEEp_t fn = (vEEp_t)fcn; errno = emu->libc_err; fn(emu, from_ptriv(R_ESP + 4)); emu->libc_err = errno; } +void vFEp_32(x64emu_t *emu, uintptr_t fcn) { vFEp_t fn = (vFEp_t)fcn; fn(emu, from_ptriv(R_ESP + 4)); } +void vFEX_32(x64emu_t *emu, uintptr_t fcn) { vFEX_t fn = (vFEX_t)fcn; fn(emu, getDisplay(from_ptriv(R_ESP + 4))); } +void vFcc_32(x64emu_t *emu, uintptr_t fcn) { vFcc_t fn = (vFcc_t)fcn; fn(from_ptri(int8_t, R_ESP + 4), from_ptri(int8_t, R_ESP + 8)); } +void vFww_32(x64emu_t *emu, uintptr_t fcn) { vFww_t fn = (vFww_t)fcn; fn(from_ptri(int16_t, R_ESP + 4), from_ptri(int16_t, R_ESP + 8)); } +void vFii_32(x64emu_t *emu, uintptr_t fcn) { vFii_t fn = (vFii_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void vFiI_32(x64emu_t *emu, uintptr_t fcn) { vFiI_t fn = (vFiI_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8)); } +void vFiW_32(x64emu_t *emu, uintptr_t fcn) { vFiW_t fn = (vFiW_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint16_t, R_ESP + 8)); } +void vFiu_32(x64emu_t *emu, uintptr_t fcn) { vFiu_t fn = (vFiu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } +void vFiU_32(x64emu_t *emu, uintptr_t fcn) { vFiU_t fn = (vFiU_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8)); } +void vFif_32(x64emu_t *emu, uintptr_t fcn) { vFif_t fn = (vFif_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(float, R_ESP + 8)); } +void vFid_32(x64emu_t *emu, uintptr_t fcn) { vFid_t fn = (vFid_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(double, R_ESP + 8)); } +void vFip_32(x64emu_t *emu, uintptr_t fcn) { vFip_t fn = (vFip_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } +void vFWW_32(x64emu_t *emu, uintptr_t fcn) { vFWW_t fn = (vFWW_t)fcn; fn(from_ptri(uint16_t, R_ESP + 4), from_ptri(uint16_t, R_ESP + 8)); } +void vFWu_32(x64emu_t *emu, uintptr_t fcn) { vFWu_t fn = (vFWu_t)fcn; fn(from_ptri(uint16_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } +void vFuc_32(x64emu_t *emu, uintptr_t fcn) { vFuc_t fn = (vFuc_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int8_t, R_ESP + 8)); } +void vFuw_32(x64emu_t *emu, uintptr_t fcn) { vFuw_t fn = (vFuw_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int16_t, R_ESP + 8)); } +void vFui_32(x64emu_t *emu, uintptr_t fcn) { vFui_t fn = (vFui_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void vFuI_32(x64emu_t *emu, uintptr_t fcn) { vFuI_t fn = (vFuI_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8)); } +void vFuC_32(x64emu_t *emu, uintptr_t fcn) { vFuC_t fn = (vFuC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint8_t, R_ESP + 8)); } +void vFuW_32(x64emu_t *emu, uintptr_t fcn) { vFuW_t fn = (vFuW_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint16_t, R_ESP + 8)); } +void vFuu_32(x64emu_t *emu, uintptr_t fcn) { vFuu_t fn = (vFuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } +void vFuU_32(x64emu_t *emu, uintptr_t fcn) { vFuU_t fn = (vFuU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8)); } +void vFuf_32(x64emu_t *emu, uintptr_t fcn) { vFuf_t fn = (vFuf_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8)); } +void vFud_32(x64emu_t *emu, uintptr_t fcn) { vFud_t fn = (vFud_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(double, R_ESP + 8)); } +void vFul_32(x64emu_t *emu, uintptr_t fcn) { vFul_t fn = (vFul_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8))); } +void vFup_32(x64emu_t *emu, uintptr_t fcn) { vFup_t fn = (vFup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } +void vFUu_32(x64emu_t *emu, uintptr_t fcn) { vFUu_t fn = (vFUu_t)fcn; fn(from_ptri(uint64_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 12)); } +void vFfC_32(x64emu_t *emu, uintptr_t fcn) { vFfC_t fn = (vFfC_t)fcn; fn(from_ptri(float, R_ESP + 4), from_ptri(uint8_t, R_ESP + 8)); } +void vFff_32(x64emu_t *emu, uintptr_t fcn) { vFff_t fn = (vFff_t)fcn; fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8)); } +void vFdd_32(x64emu_t *emu, uintptr_t fcn) { vFdd_t fn = (vFdd_t)fcn; fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12)); } +void vFlu_32(x64emu_t *emu, uintptr_t fcn) { vFlu_t fn = (vFlu_t)fcn; fn(from_long(from_ptri(long_t, R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8)); } +void vFlp_32(x64emu_t *emu, uintptr_t fcn) { vFlp_t fn = (vFlp_t)fcn; fn(from_long(from_ptri(long_t, R_ESP + 4)), from_ptriv(R_ESP + 8)); } +void vEpi_32(x64emu_t *emu, uintptr_t fcn) { vEpi_t fn = (vEpi_t)fcn; errno = emu->libc_err; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); emu->libc_err = errno; } +void vFpi_32(x64emu_t *emu, uintptr_t fcn) { vFpi_t fn = (vFpi_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void vFpC_32(x64emu_t *emu, uintptr_t fcn) { vFpC_t fn = (vFpC_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint8_t, R_ESP + 8)); } +void vFpu_32(x64emu_t *emu, uintptr_t fcn) { vFpu_t fn = (vFpu_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } +void vFpd_32(x64emu_t *emu, uintptr_t fcn) { vFpd_t fn = (vFpd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8)); } +void vFpl_32(x64emu_t *emu, uintptr_t fcn) { vFpl_t fn = (vFpl_t)fcn; fn(from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8))); } +void vEpL_32(x64emu_t *emu, uintptr_t fcn) { vEpL_t fn = (vEpL_t)fcn; errno = emu->libc_err; fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8))); emu->libc_err = errno; } +void vFpL_32(x64emu_t *emu, uintptr_t fcn) { vFpL_t fn = (vFpL_t)fcn; fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8))); } +void vEpp_32(x64emu_t *emu, uintptr_t fcn) { vEpp_t fn = (vEpp_t)fcn; errno = emu->libc_err; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); emu->libc_err = errno; } +void vFpp_32(x64emu_t *emu, uintptr_t fcn) { vFpp_t fn = (vFpp_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); } +void vESp_32(x64emu_t *emu, uintptr_t fcn) { vESp_t fn = (vESp_t)fcn; errno = emu->libc_err; fn(io_convert32(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8)); emu->libc_err = errno; } +void vFXi_32(x64emu_t *emu, uintptr_t fcn) { vFXi_t fn = (vFXi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8)); } +void vFXu_32(x64emu_t *emu, uintptr_t fcn) { vFXu_t fn = (vFXu_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8)); } +void vFXL_32(x64emu_t *emu, uintptr_t fcn) { vFXL_t fn = (vFXL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8))); } +void vFXp_32(x64emu_t *emu, uintptr_t fcn) { vFXp_t fn = (vFXp_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8)); } +void vFni_32(x64emu_t *emu, uintptr_t fcn) { vFni_t fn = (vFni_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); fn(aligned_xcb, from_ptri(int32_t, R_ESP + 8)); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); } +void vFnu_32(x64emu_t *emu, uintptr_t fcn) { vFnu_t fn = (vFnu_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); fn(aligned_xcb, from_ptri(uint32_t, R_ESP + 8)); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); } +void vFnU_32(x64emu_t *emu, uintptr_t fcn) { vFnU_t fn = (vFnU_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); fn(aligned_xcb, from_ptri(uint64_t, R_ESP + 8)); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); } +void vFnp_32(x64emu_t *emu, uintptr_t fcn) { vFnp_t fn = (vFnp_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); fn(aligned_xcb, from_ptriv(R_ESP + 8)); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); } +void cFpp_32(x64emu_t *emu, uintptr_t fcn) { cFpp_t fn = (cFpp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); } +void wFpi_32(x64emu_t *emu, uintptr_t fcn) { wFpi_t fn = (wFpi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void iEEv_32(x64emu_t *emu, uintptr_t fcn) { iEEv_t fn = (iEEv_t)fcn; errno = emu->libc_err; R_EAX = fn(emu); emu->libc_err = errno; } +void iFEv_32(x64emu_t *emu, uintptr_t fcn) { iFEv_t fn = (iFEv_t)fcn; R_EAX = fn(emu); } +void iEEi_32(x64emu_t *emu, uintptr_t fcn) { iEEi_t fn = (iEEi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4)); emu->libc_err = errno; } +void iFEi_32(x64emu_t *emu, uintptr_t fcn) { iFEi_t fn = (iFEi_t)fcn; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4)); } +void iEEL_32(x64emu_t *emu, uintptr_t fcn) { iEEL_t fn = (iEEL_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ulong(from_ptri(ulong_t, R_ESP + 4))); emu->libc_err = errno; } +void iEEp_32(x64emu_t *emu, uintptr_t fcn) { iEEp_t fn = (iEEp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4)); emu->libc_err = errno; } +void iFEp_32(x64emu_t *emu, uintptr_t fcn) { iFEp_t fn = (iFEp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4)); } +void iEEh_32(x64emu_t *emu, uintptr_t fcn) { iEEh_t fn = (iEEh_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_hash(from_ptri(ptr_t, R_ESP + 4))); emu->libc_err = errno; } +void iEEO_32(x64emu_t *emu, uintptr_t fcn) { iEEO_t fn = (iEEO_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, of_convert32(from_ptri(int32_t, R_ESP + 4))); emu->libc_err = errno; } +void iFEX_32(x64emu_t *emu, uintptr_t fcn) { iFEX_t fn = (iFEX_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4))); } +void iEii_32(x64emu_t *emu, uintptr_t fcn) { iEii_t fn = (iEii_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); emu->libc_err = errno; } +void iFii_32(x64emu_t *emu, uintptr_t fcn) { iFii_t fn = (iFii_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void iEiI_32(x64emu_t *emu, uintptr_t fcn) { iEiI_t fn = (iEiI_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8)); emu->libc_err = errno; } +void iEiu_32(x64emu_t *emu, uintptr_t fcn) { iEiu_t fn = (iEiu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); emu->libc_err = errno; } +void iFiu_32(x64emu_t *emu, uintptr_t fcn) { iFiu_t fn = (iFiu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } +void iEil_32(x64emu_t *emu, uintptr_t fcn) { iEil_t fn = (iEil_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8))); emu->libc_err = errno; } +void iFiL_32(x64emu_t *emu, uintptr_t fcn) { iFiL_t fn = (iFiL_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8))); } +void iEip_32(x64emu_t *emu, uintptr_t fcn) { iEip_t fn = (iEip_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); emu->libc_err = errno; } +void iFip_32(x64emu_t *emu, uintptr_t fcn) { iFip_t fn = (iFip_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } +void iEiS_32(x64emu_t *emu, uintptr_t fcn) { iEiS_t fn = (iEiS_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), io_convert32(from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void iEui_32(x64emu_t *emu, uintptr_t fcn) { iEui_t fn = (iEui_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); emu->libc_err = errno; } +void iFui_32(x64emu_t *emu, uintptr_t fcn) { iFui_t fn = (iFui_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void iEuu_32(x64emu_t *emu, uintptr_t fcn) { iEuu_t fn = (iEuu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); emu->libc_err = errno; } +void iEuL_32(x64emu_t *emu, uintptr_t fcn) { iEuL_t fn = (iEuL_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8))); emu->libc_err = errno; } +void iEup_32(x64emu_t *emu, uintptr_t fcn) { iEup_t fn = (iEup_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); emu->libc_err = errno; } +void iFup_32(x64emu_t *emu, uintptr_t fcn) { iFup_t fn = (iFup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } +void iEua_32(x64emu_t *emu, uintptr_t fcn) { iEua_t fn = (iEua_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_locale(from_ptri(ptr_t, R_ESP + 8))); emu->libc_err = errno; } +void iFpw_32(x64emu_t *emu, uintptr_t fcn) { iFpw_t fn = (iFpw_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int16_t, R_ESP + 8)); } +void iEpi_32(x64emu_t *emu, uintptr_t fcn) { iEpi_t fn = (iEpi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); emu->libc_err = errno; } +void iFpi_32(x64emu_t *emu, uintptr_t fcn) { iFpi_t fn = (iFpi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void iFpI_32(x64emu_t *emu, uintptr_t fcn) { iFpI_t fn = (iFpI_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int64_t, R_ESP + 8)); } +void iFpW_32(x64emu_t *emu, uintptr_t fcn) { iFpW_t fn = (iFpW_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint16_t, R_ESP + 8)); } +void iEpu_32(x64emu_t *emu, uintptr_t fcn) { iEpu_t fn = (iEpu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); emu->libc_err = errno; } +void iFpu_32(x64emu_t *emu, uintptr_t fcn) { iFpu_t fn = (iFpu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } +void iFpU_32(x64emu_t *emu, uintptr_t fcn) { iFpU_t fn = (iFpU_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint64_t, R_ESP + 8)); } +void iFpf_32(x64emu_t *emu, uintptr_t fcn) { iFpf_t fn = (iFpf_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(float, R_ESP + 8)); } +void iFpd_32(x64emu_t *emu, uintptr_t fcn) { iFpd_t fn = (iFpd_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8)); } +void iFpl_32(x64emu_t *emu, uintptr_t fcn) { iFpl_t fn = (iFpl_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8))); } +void iEpL_32(x64emu_t *emu, uintptr_t fcn) { iEpL_t fn = (iEpL_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8))); emu->libc_err = errno; } +void iFpL_32(x64emu_t *emu, uintptr_t fcn) { iFpL_t fn = (iFpL_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8))); } +void iEpp_32(x64emu_t *emu, uintptr_t fcn) { iEpp_t fn = (iEpp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); emu->libc_err = errno; } +void iFpp_32(x64emu_t *emu, uintptr_t fcn) { iFpp_t fn = (iFpp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); } +void iEpV_32(x64emu_t *emu, uintptr_t fcn) { iEpV_t fn = (iEpV_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptrv(R_ESP + 8)); emu->libc_err = errno; } +void iEpO_32(x64emu_t *emu, uintptr_t fcn) { iEpO_t fn = (iEpO_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), of_convert32(from_ptri(int32_t, R_ESP + 8))); emu->libc_err = errno; } +void iEpS_32(x64emu_t *emu, uintptr_t fcn) { iEpS_t fn = (iEpS_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), io_convert32(from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void iFpS_32(x64emu_t *emu, uintptr_t fcn) { iFpS_t fn = (iFpS_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), io_convert32(from_ptriv(R_ESP + 8))); } +void iEhi_32(x64emu_t *emu, uintptr_t fcn) { iEhi_t fn = (iEhi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptri(int32_t, R_ESP + 8)); emu->libc_err = errno; } +void iEhp_32(x64emu_t *emu, uintptr_t fcn) { iEhp_t fn = (iEhp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptriv(R_ESP + 8)); emu->libc_err = errno; } +void iEhh_32(x64emu_t *emu, uintptr_t fcn) { iEhh_t fn = (iEhh_t)fcn; errno = emu->libc_err; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), from_hash(from_ptri(ptr_t, R_ESP + 8))); emu->libc_err = errno; } +void iESi_32(x64emu_t *emu, uintptr_t fcn) { iESi_t fn = (iESi_t)fcn; errno = emu->libc_err; R_EAX = fn(io_convert32(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8)); emu->libc_err = errno; } +void iESU_32(x64emu_t *emu, uintptr_t fcn) { iESU_t fn = (iESU_t)fcn; errno = emu->libc_err; R_EAX = fn(io_convert32(from_ptriv(R_ESP + 4)), from_ptri(uint64_t, R_ESP + 8)); emu->libc_err = errno; } +void iESp_32(x64emu_t *emu, uintptr_t fcn) { iESp_t fn = (iESp_t)fcn; errno = emu->libc_err; R_EAX = fn(io_convert32(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8)); emu->libc_err = errno; } +void iFXi_32(x64emu_t *emu, uintptr_t fcn) { iFXi_t fn = (iFXi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8)); } +void iFXW_32(x64emu_t *emu, uintptr_t fcn) { iFXW_t fn = (iFXW_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint16_t, R_ESP + 8)); } +void iFXL_32(x64emu_t *emu, uintptr_t fcn) { iFXL_t fn = (iFXL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8))); } +void iFXp_32(x64emu_t *emu, uintptr_t fcn) { iFXp_t fn = (iFXp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8)); } +void IFEp_32(x64emu_t *emu, uintptr_t fcn) { IFEp_t fn = (IFEp_t)fcn; ui64_t r; r.i = fn(emu, from_ptriv(R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void IEII_32(x64emu_t *emu, uintptr_t fcn) { IEII_t fn = (IEII_t)fcn; errno = emu->libc_err; ui64_t r; r.i = fn(from_ptri(int64_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 12)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void IFpI_32(x64emu_t *emu, uintptr_t fcn) { IFpI_t fn = (IFpI_t)fcn; ui64_t r; r.i = fn(from_ptriv(R_ESP + 4), from_ptri(int64_t, R_ESP + 8)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void IFpu_32(x64emu_t *emu, uintptr_t fcn) { IFpu_t fn = (IFpu_t)fcn; ui64_t r; r.i = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void CFip_32(x64emu_t *emu, uintptr_t fcn) { CFip_t fn = (CFip_t)fcn; R_EAX = (unsigned char)fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } +void CFCi_32(x64emu_t *emu, uintptr_t fcn) { CFCi_t fn = (CFCi_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint8_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void CFui_32(x64emu_t *emu, uintptr_t fcn) { CFui_t fn = (CFui_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void CFuu_32(x64emu_t *emu, uintptr_t fcn) { CFuu_t fn = (CFuu_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } +void CFuU_32(x64emu_t *emu, uintptr_t fcn) { CFuU_t fn = (CFuU_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8)); } +void CFpi_32(x64emu_t *emu, uintptr_t fcn) { CFpi_t fn = (CFpi_t)fcn; R_EAX = (unsigned char)fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void CFpu_32(x64emu_t *emu, uintptr_t fcn) { CFpu_t fn = (CFpu_t)fcn; R_EAX = (unsigned char)fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } +void CFpp_32(x64emu_t *emu, uintptr_t fcn) { CFpp_t fn = (CFpp_t)fcn; R_EAX = (unsigned char)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); } +void CFXL_32(x64emu_t *emu, uintptr_t fcn) { CFXL_t fn = (CFXL_t)fcn; R_EAX = (unsigned char)fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8))); } +void WFEp_32(x64emu_t *emu, uintptr_t fcn) { WFEp_t fn = (WFEp_t)fcn; R_EAX = (unsigned short)fn(emu, from_ptriv(R_ESP + 4)); } +void WFpp_32(x64emu_t *emu, uintptr_t fcn) { WFpp_t fn = (WFpp_t)fcn; R_EAX = (unsigned short)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); } +void uFEp_32(x64emu_t *emu, uintptr_t fcn) { uFEp_t fn = (uFEp_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4)); } +void uFii_32(x64emu_t *emu, uintptr_t fcn) { uFii_t fn = (uFii_t)fcn; R_EAX = (uint32_t)fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void uEiS_32(x64emu_t *emu, uintptr_t fcn) { uEiS_t fn = (uEiS_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(from_ptri(int32_t, R_ESP + 4), io_convert32(from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void uFWp_32(x64emu_t *emu, uintptr_t fcn) { uFWp_t fn = (uFWp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint16_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } +void uFuu_32(x64emu_t *emu, uintptr_t fcn) { uFuu_t fn = (uFuu_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } +void uFup_32(x64emu_t *emu, uintptr_t fcn) { uFup_t fn = (uFup_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } +void uEua_32(x64emu_t *emu, uintptr_t fcn) { uEua_t fn = (uEua_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_locale(from_ptri(ptr_t, R_ESP + 8))); emu->libc_err = errno; } +void uEuS_32(x64emu_t *emu, uintptr_t fcn) { uEuS_t fn = (uEuS_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), io_convert32(from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void uFpi_32(x64emu_t *emu, uintptr_t fcn) { uFpi_t fn = (uFpi_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void uFpu_32(x64emu_t *emu, uintptr_t fcn) { uFpu_t fn = (uFpu_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } +void uFpp_32(x64emu_t *emu, uintptr_t fcn) { uFpp_t fn = (uFpp_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); } +void uFXL_32(x64emu_t *emu, uintptr_t fcn) { uFXL_t fn = (uFXL_t)fcn; R_EAX = (uint32_t)fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8))); } +void UFEp_32(x64emu_t *emu, uintptr_t fcn) { UFEp_t fn = (UFEp_t)fcn; ui64_t r; r.u = (uint64_t)fn(emu, from_ptriv(R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void UEuu_32(x64emu_t *emu, uintptr_t fcn) { UEuu_t fn = (UEuu_t)fcn; errno = emu->libc_err; ui64_t r; r.u = (uint64_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void UFuu_32(x64emu_t *emu, uintptr_t fcn) { UFuu_t fn = (UFuu_t)fcn; ui64_t r; r.u = (uint64_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void UEUU_32(x64emu_t *emu, uintptr_t fcn) { UEUU_t fn = (UEUU_t)fcn; errno = emu->libc_err; ui64_t r; r.u = (uint64_t)fn(from_ptri(uint64_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 12)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void UEss_32(x64emu_t *emu, uintptr_t fcn) { UEss_t fn = (UEss_t)fcn; errno = emu->libc_err; ui64_t r; r.u = (uint64_t)fn(from_ptrv(R_ESP + 4), from_ptrv(R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void fEif_32(x64emu_t *emu, uintptr_t fcn) { fEif_t fn = (fEif_t)fcn; errno = emu->libc_err; float fl = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(float, R_ESP + 8)); fpu_do_push(emu); ST0val = fl; emu->libc_err = errno; } +void fFfi_32(x64emu_t *emu, uintptr_t fcn) { fFfi_t fn = (fFfi_t)fcn; float fl = fn(from_ptri(float, R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); fpu_do_push(emu); ST0val = fl; } +void fEfi_32(x64emu_t *emu, uintptr_t fcn) { fEfi_t fn = (fEfi_t)fcn; errno = emu->libc_err; float fl = fn(from_ptri(float, R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); fpu_do_push(emu); ST0val = fl; emu->libc_err = errno; } +void fEff_32(x64emu_t *emu, uintptr_t fcn) { fEff_t fn = (fEff_t)fcn; errno = emu->libc_err; float fl = fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8)); fpu_do_push(emu); ST0val = fl; emu->libc_err = errno; } +void fFff_32(x64emu_t *emu, uintptr_t fcn) { fFff_t fn = (fFff_t)fcn; float fl = fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8)); fpu_do_push(emu); ST0val = fl; } +void fEfD_32(x64emu_t *emu, uintptr_t fcn) { fEfD_t fn = (fEfD_t)fcn; errno = emu->libc_err; float fl = fn(from_ptri(float, R_ESP + 4), LD2localLD(from_ptrv(R_ESP + 8))); fpu_do_push(emu); ST0val = fl; emu->libc_err = errno; } +void fEfp_32(x64emu_t *emu, uintptr_t fcn) { fEfp_t fn = (fEfp_t)fcn; errno = emu->libc_err; float fl = fn(from_ptri(float, R_ESP + 4), from_ptriv(R_ESP + 8)); fpu_do_push(emu); ST0val = fl; emu->libc_err = errno; } +void dEid_32(x64emu_t *emu, uintptr_t fcn) { dEid_t fn = (dEid_t)fcn; errno = emu->libc_err; double db = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(double, R_ESP + 8)); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void dFdi_32(x64emu_t *emu, uintptr_t fcn) { dFdi_t fn = (dFdi_t)fcn; double db = fn(from_ptri(double, R_ESP + 4), from_ptri(int32_t, R_ESP + 12)); fpu_do_push(emu); ST0val = db; } +void dEdi_32(x64emu_t *emu, uintptr_t fcn) { dEdi_t fn = (dEdi_t)fcn; errno = emu->libc_err; double db = fn(from_ptri(double, R_ESP + 4), from_ptri(int32_t, R_ESP + 12)); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void dEdd_32(x64emu_t *emu, uintptr_t fcn) { dEdd_t fn = (dEdd_t)fcn; errno = emu->libc_err; double db = fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12)); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void dFdd_32(x64emu_t *emu, uintptr_t fcn) { dFdd_t fn = (dFdd_t)fcn; double db = fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12)); fpu_do_push(emu); ST0val = db; } +void dEdD_32(x64emu_t *emu, uintptr_t fcn) { dEdD_t fn = (dEdD_t)fcn; errno = emu->libc_err; double db = fn(from_ptri(double, R_ESP + 4), LD2localLD(from_ptrv(R_ESP + 12))); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void dFdp_32(x64emu_t *emu, uintptr_t fcn) { dFdp_t fn = (dFdp_t)fcn; double db = fn(from_ptri(double, R_ESP + 4), from_ptriv(R_ESP + 12)); fpu_do_push(emu); ST0val = db; } +void dEdp_32(x64emu_t *emu, uintptr_t fcn) { dEdp_t fn = (dEdp_t)fcn; errno = emu->libc_err; double db = fn(from_ptri(double, R_ESP + 4), from_ptriv(R_ESP + 12)); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void dEll_32(x64emu_t *emu, uintptr_t fcn) { dEll_t fn = (dEll_t)fcn; errno = emu->libc_err; double db = fn(from_long(from_ptri(long_t, R_ESP + 4)), from_long(from_ptri(long_t, R_ESP + 8))); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void dFpp_32(x64emu_t *emu, uintptr_t fcn) { dFpp_t fn = (dFpp_t)fcn; double db = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); fpu_do_push(emu); ST0val = db; } +void lEEi_32(x64emu_t *emu, uintptr_t fcn) { lEEi_t fn = (lEEi_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(emu, from_ptri(int32_t, R_ESP + 4))); emu->libc_err = errno; } +void lEES_32(x64emu_t *emu, uintptr_t fcn) { lEES_t fn = (lEES_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(emu, io_convert32(from_ptriv(R_ESP + 4)))); emu->libc_err = errno; } +void lEii_32(x64emu_t *emu, uintptr_t fcn) { lEii_t fn = (lEii_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); emu->libc_err = errno; } +void lFiL_32(x64emu_t *emu, uintptr_t fcn) { lFiL_t fn = (lFiL_t)fcn; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); } +void lFui_32(x64emu_t *emu, uintptr_t fcn) { lFui_t fn = (lFui_t)fcn; R_EAX = to_long(fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); } +void lFll_32(x64emu_t *emu, uintptr_t fcn) { lFll_t fn = (lFll_t)fcn; R_EAX = to_long(fn(from_long(from_ptri(long_t, R_ESP + 4)), from_long(from_ptri(long_t, R_ESP + 8)))); } +void lEpi_32(x64emu_t *emu, uintptr_t fcn) { lEpi_t fn = (lEpi_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); emu->libc_err = errno; } +void lFpu_32(x64emu_t *emu, uintptr_t fcn) { lFpu_t fn = (lFpu_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8))); } +void lFpl_32(x64emu_t *emu, uintptr_t fcn) { lFpl_t fn = (lFpl_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)))); } +void lFpL_32(x64emu_t *emu, uintptr_t fcn) { lFpL_t fn = (lFpL_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); } +void LEEL_32(x64emu_t *emu, uintptr_t fcn) { LEEL_t fn = (LEEL_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn(emu, from_ulong(from_ptri(ulong_t, R_ESP + 4)))); emu->libc_err = errno; } +void LFEp_32(x64emu_t *emu, uintptr_t fcn) { LFEp_t fn = (LFEp_t)fcn; R_EAX = to_ulong(fn(emu, from_ptriv(R_ESP + 4))); } +void LFLi_32(x64emu_t *emu, uintptr_t fcn) { LFLi_t fn = (LFLi_t)fcn; R_EAX = to_ulong(fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), from_ptri(int32_t, R_ESP + 8))); } +void LFpc_32(x64emu_t *emu, uintptr_t fcn) { LFpc_t fn = (LFpc_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptri(int8_t, R_ESP + 8))); } +void LEpL_32(x64emu_t *emu, uintptr_t fcn) { LEpL_t fn = (LEpL_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); emu->libc_err = errno; } +void LEpp_32(x64emu_t *emu, uintptr_t fcn) { LEpp_t fn = (LEpp_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void LFXi_32(x64emu_t *emu, uintptr_t fcn) { LFXi_t fn = (LFXi_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8))); } +void LFXu_32(x64emu_t *emu, uintptr_t fcn) { LFXu_t fn = (LFXu_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8))); } +void LFXU_32(x64emu_t *emu, uintptr_t fcn) { LFXU_t fn = (LFXU_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint64_t, R_ESP + 8))); } +void LFXL_32(x64emu_t *emu, uintptr_t fcn) { LFXL_t fn = (LFXL_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); } +void LFXp_32(x64emu_t *emu, uintptr_t fcn) { LFXp_t fn = (LFXp_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8))); } +void pFEv_32(x64emu_t *emu, uintptr_t fcn) { pFEv_t fn = (pFEv_t)fcn; R_EAX = to_ptrv(fn(emu)); } +void pEEv_32(x64emu_t *emu, uintptr_t fcn) { pEEv_t fn = (pEEv_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu)); emu->libc_err = errno; } +void pFEi_32(x64emu_t *emu, uintptr_t fcn) { pFEi_t fn = (pFEi_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptri(int32_t, R_ESP + 4))); } +void pEEu_32(x64emu_t *emu, uintptr_t fcn) { pEEu_t fn = (pEEu_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptri(uint32_t, R_ESP + 4))); emu->libc_err = errno; } +void pFEp_32(x64emu_t *emu, uintptr_t fcn) { pFEp_t fn = (pFEp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4))); } +void pEEp_32(x64emu_t *emu, uintptr_t fcn) { pEEp_t fn = (pEEp_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4))); emu->libc_err = errno; } +void pEES_32(x64emu_t *emu, uintptr_t fcn) { pEES_t fn = (pEES_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, io_convert32(from_ptriv(R_ESP + 4)))); emu->libc_err = errno; } +void pFEX_32(x64emu_t *emu, uintptr_t fcn) { pFEX_t fn = (pFEX_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)))); } +void pFii_32(x64emu_t *emu, uintptr_t fcn) { pFii_t fn = (pFii_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); } +void pFiu_32(x64emu_t *emu, uintptr_t fcn) { pFiu_t fn = (pFiu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8))); } +void pFip_32(x64emu_t *emu, uintptr_t fcn) { pFip_t fn = (pFip_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8))); } +void pEia_32(x64emu_t *emu, uintptr_t fcn) { pEia_t fn = (pEia_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_locale(from_ptri(ptr_t, R_ESP + 8)))); emu->libc_err = errno; } +void pFWu_32(x64emu_t *emu, uintptr_t fcn) { pFWu_t fn = (pFWu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint16_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8))); } +void pFuu_32(x64emu_t *emu, uintptr_t fcn) { pFuu_t fn = (pFuu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8))); } +void pEup_32(x64emu_t *emu, uintptr_t fcn) { pEup_t fn = (pEup_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void pFup_32(x64emu_t *emu, uintptr_t fcn) { pFup_t fn = (pFup_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8))); } +void pELL_32(x64emu_t *emu, uintptr_t fcn) { pELL_t fn = (pELL_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); emu->libc_err = errno; } +void pFLL_32(x64emu_t *emu, uintptr_t fcn) { pFLL_t fn = (pFLL_t)fcn; R_EAX = to_ptrv(fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); } +void pEpi_32(x64emu_t *emu, uintptr_t fcn) { pEpi_t fn = (pEpi_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); emu->libc_err = errno; } +void pFpi_32(x64emu_t *emu, uintptr_t fcn) { pFpi_t fn = (pFpi_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); } +void pFpu_32(x64emu_t *emu, uintptr_t fcn) { pFpu_t fn = (pFpu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8))); } +void pFpU_32(x64emu_t *emu, uintptr_t fcn) { pFpU_t fn = (pFpU_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint64_t, R_ESP + 8))); } +void pEpL_32(x64emu_t *emu, uintptr_t fcn) { pEpL_t fn = (pEpL_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); emu->libc_err = errno; } +void pFpL_32(x64emu_t *emu, uintptr_t fcn) { pFpL_t fn = (pFpL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); } +void pEpp_32(x64emu_t *emu, uintptr_t fcn) { pEpp_t fn = (pEpp_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void pFpp_32(x64emu_t *emu, uintptr_t fcn) { pFpp_t fn = (pFpp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); } +void pFXi_32(x64emu_t *emu, uintptr_t fcn) { pFXi_t fn = (pFXi_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8))); } +void pFXu_32(x64emu_t *emu, uintptr_t fcn) { pFXu_t fn = (pFXu_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8))); } +void pFXL_32(x64emu_t *emu, uintptr_t fcn) { pFXL_t fn = (pFXL_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); } +void pFXp_32(x64emu_t *emu, uintptr_t fcn) { pFXp_t fn = (pFXp_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8))); } +void pFnu_32(x64emu_t *emu, uintptr_t fcn) { pFnu_t fn = (pFnu_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); R_EAX = to_ptrv(fn(aligned_xcb, from_ptri(uint32_t, R_ESP + 8))); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); } +void pFnp_32(x64emu_t *emu, uintptr_t fcn) { pFnp_t fn = (pFnp_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); R_EAX = to_ptrv(fn(aligned_xcb, from_ptriv(R_ESP + 8))); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); } +void hFEp_32(x64emu_t *emu, uintptr_t fcn) { hFEp_t fn = (hFEp_t)fcn; R_EAX = to_hash(fn(emu, from_ptriv(R_ESP + 4))); } +void hEpa_32(x64emu_t *emu, uintptr_t fcn) { hEpa_t fn = (hEpa_t)fcn; errno = emu->libc_err; R_EAX = to_hash(fn(from_ptriv(R_ESP + 4), from_locale(from_ptri(ptr_t, R_ESP + 8)))); emu->libc_err = errno; } +void SEip_32(x64emu_t *emu, uintptr_t fcn) { SEip_t fn = (SEip_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(io_convert_from(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)))); emu->libc_err = errno; } +void SEpp_32(x64emu_t *emu, uintptr_t fcn) { SEpp_t fn = (SEpp_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(io_convert_from(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)))); emu->libc_err = errno; } +void tEip_32(x64emu_t *emu, uintptr_t fcn) { tEip_t fn = (tEip_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void tEia_32(x64emu_t *emu, uintptr_t fcn) { tEia_t fn = (tEia_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptri(int32_t, R_ESP + 4), from_locale(from_ptri(ptr_t, R_ESP + 8)))); emu->libc_err = errno; } +void tFuu_32(x64emu_t *emu, uintptr_t fcn) { tFuu_t fn = (tFuu_t)fcn; R_EAX = to_cstring(fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8))); } +void tEpL_32(x64emu_t *emu, uintptr_t fcn) { tEpL_t fn = (tEpL_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); emu->libc_err = errno; } +void tEpp_32(x64emu_t *emu, uintptr_t fcn) { tEpp_t fn = (tEpp_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void vFuBp__32(x64emu_t *emu, uintptr_t fcn) { vFuBp__t fn = (vFuBp__t)fcn; struct_p_t arg_8={0}; fn(from_ptri(uint32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFpbp__32(x64emu_t *emu, uintptr_t fcn) { vFpbp__t fn = (vFpbp__t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFbp_p_32(x64emu_t *emu, uintptr_t fcn) { vFbp_p_t fn = (vFbp_p_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iEEbp__32(x64emu_t *emu, uintptr_t fcn) { iEEbp__t fn = (iEEbp__t)fcn; errno = emu->libc_err; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(emu, *(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); emu->libc_err = errno; } +void iFibp__32(x64emu_t *emu, uintptr_t fcn) { iFibp__t fn = (iFibp__t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptri(int32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFLbp__32(x64emu_t *emu, uintptr_t fcn) { iFLbp__t fn = (iFLbp__t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbp__32(x64emu_t *emu, uintptr_t fcn) { iFpbp__t fn = (iFpbp__t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbl__32(x64emu_t *emu, uintptr_t fcn) { iFpbl__t fn = (iFpbl__t)fcn; struct_l_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_l(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpBL__32(x64emu_t *emu, uintptr_t fcn) { iFpBL__t fn = (iFpBL__t)fcn; struct_L_t arg_8={0}; R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbL__32(x64emu_t *emu, uintptr_t fcn) { iFpbL__t fn = (iFpbL__t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iEHBp__32(x64emu_t *emu, uintptr_t fcn) { iEHBp__t fn = (iEHBp__t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; R_EAX = fn(from_hash_d(from_ptri(ptr_t, R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void iFbp_i_32(x64emu_t *emu, uintptr_t fcn) { iFbp_i_t fn = (iFbp_i_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(int32_t, R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_u_32(x64emu_t *emu, uintptr_t fcn) { iFbp_u_t fn = (iFbp_u_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(uint32_t, R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_p_32(x64emu_t *emu, uintptr_t fcn) { iFbp_p_t fn = (iFbp_p_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFXbL__32(x64emu_t *emu, uintptr_t fcn) { iFXbL__t fn = (iFXbL__t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void uFpbp__32(x64emu_t *emu, uintptr_t fcn) { uFpbp__t fn = (uFpbp__t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void uFpbL__32(x64emu_t *emu, uintptr_t fcn) { uFpbL__t fn = (uFpbL__t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void fEpBp__32(x64emu_t *emu, uintptr_t fcn) { fEpBp__t fn = (fEpBp__t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; float fl = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); fpu_do_push(emu); ST0val = fl; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void dEpBp__32(x64emu_t *emu, uintptr_t fcn) { dEpBp__t fn = (dEpBp__t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; double db = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); fpu_do_push(emu); ST0val = db; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void lFpbp__32(x64emu_t *emu, uintptr_t fcn) { lFpbp__t fn = (lFpbp__t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_long(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void LFpbp__32(x64emu_t *emu, uintptr_t fcn) { LFpbp__t fn = (LFpbp__t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void LFpbL__32(x64emu_t *emu, uintptr_t fcn) { LFpbL__t fn = (LFpbL__t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void pFpbp__32(x64emu_t *emu, uintptr_t fcn) { pFpbp__t fn = (pFpbp__t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void pErl_p_32(x64emu_t *emu, uintptr_t fcn) { pErl_p_t fn = (pErl_p_t)fcn; errno = emu->libc_err; struct_l_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_l(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ptrv(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void vFibpp__32(x64emu_t *emu, uintptr_t fcn) { vFibpp__t fn = (vFibpp__t)fcn; struct_pp_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pp(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptri(int32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pp(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFpbpu__32(x64emu_t *emu, uintptr_t fcn) { vFpbpu__t fn = (vFpbpu__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFBll_l_32(x64emu_t *emu, uintptr_t fcn) { vFBll_l_t fn = (vFBll_l_t)fcn; struct_ll_t arg_4={0}; fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_long(from_ptri(long_t, R_ESP + 8))); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ll(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void vFnbpi__32(x64emu_t *emu, uintptr_t fcn) { vFnbpi__t fn = (vFnbpi__t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); struct_pi_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pi(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(aligned_xcb, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pi(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iEuBLL__32(x64emu_t *emu, uintptr_t fcn) { iEuBLL__t fn = (iEuBLL__t)fcn; errno = emu->libc_err; struct_LL_t arg_8={0}; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void iEprll__32(x64emu_t *emu, uintptr_t fcn) { iEprll__t fn = (iEprll__t)fcn; errno = emu->libc_err; struct_ll_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ll(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); emu->libc_err = errno; } +void iEpbup__32(x64emu_t *emu, uintptr_t fcn) { iEpbup__t fn = (iEpbup__t)fcn; errno = emu->libc_err; struct_up_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_up(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_up(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void iEprLL__32(x64emu_t *emu, uintptr_t fcn) { iEprLL__t fn = (iEprLL__t)fcn; errno = emu->libc_err; struct_LL_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_LL(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); emu->libc_err = errno; } +void iFpbpu__32(x64emu_t *emu, uintptr_t fcn) { iFpbpu__t fn = (iFpbpu__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFbpi_i_32(x64emu_t *emu, uintptr_t fcn) { iFbpi_i_t fn = (iFbpi_i_t)fcn; struct_pi_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pi(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(int32_t, R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pi(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFbpu_u_t fn = (iFbpu_u_t)fcn; struct_pu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(uint32_t, R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iEBll_p_32(x64emu_t *emu, uintptr_t fcn) { iEBll_p_t fn = (iEBll_p_t)fcn; errno = emu->libc_err; struct_ll_t arg_4={0}; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ll(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); emu->libc_err = errno; } +void iFXbip__32(x64emu_t *emu, uintptr_t fcn) { iFXbip__t fn = (iFXbip__t)fcn; struct_ip_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ip(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ip(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void uFpbpu__32(x64emu_t *emu, uintptr_t fcn) { uFpbpu__t fn = (uFpbpu__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void pFnbpi__32(x64emu_t *emu, uintptr_t fcn) { pFnbpi__t fn = (pFnbpi__t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); struct_pi_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pi(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ptrv(fn(aligned_xcb, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL)); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pi(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFpbupi__32(x64emu_t *emu, uintptr_t fcn) { vFpbupi__t fn = (vFpbupi__t)fcn; struct_upi_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_upi(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_upi(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iEpBlii__32(x64emu_t *emu, uintptr_t fcn) { iEpBlii__t fn = (iEpBlii__t)fcn; errno = emu->libc_err; struct_lii_t arg_8={0}; R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_lii(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void iESBliu__32(x64emu_t *emu, uintptr_t fcn) { iESBliu__t fn = (iESBliu__t)fcn; errno = emu->libc_err; struct_liu_t arg_8={0}; R_EAX = fn(io_convert32(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_liu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void iFbppi_i_32(x64emu_t *emu, uintptr_t fcn) { iFbppi_i_t fn = (iFbppi_i_t)fcn; struct_ppi_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppi(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(int32_t, R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppi(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_bp__32(x64emu_t *emu, uintptr_t fcn) { iFbp_bp__t fn = (iFbp_bp__t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFXbiip__32(x64emu_t *emu, uintptr_t fcn) { iFXbiip__t fn = (iFXbiip__t)fcn; struct_iip_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_iip(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_iip(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFbppuii_p_32(x64emu_t *emu, uintptr_t fcn) { vFbppuii_p_t fn = (vFbppuii_p_t)fcn; struct_ppuii_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuii(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuii(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iErLL_BLL__32(x64emu_t *emu, uintptr_t fcn) { iErLL_BLL__t fn = (iErLL_BLL__t)fcn; errno = emu->libc_err; struct_LL_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_LL(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_LL_t arg_8={0}; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void iFbpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFbpu_bpu__t fn = (iFbpu_bpu__t)fcn; struct_pu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void pErppppii_p_32(x64emu_t *emu, uintptr_t fcn) { pErppppii_p_t fn = (pErppppii_p_t)fcn; errno = emu->libc_err; struct_ppppii_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppppii(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ptrv(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void vFbll_rllll__32(x64emu_t *emu, uintptr_t fcn) { vFbll_rllll__t fn = (vFbll_rllll__t)fcn; struct_ll_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ll(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_llll_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_llll(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ll(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iEbpppiiip_p_32(x64emu_t *emu, uintptr_t fcn) { iEbpppiiip_p_t fn = (iEbpppiiip_p_t)fcn; errno = emu->libc_err; struct_pppiiip_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pppiiip(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pppiiip(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); emu->libc_err = errno; } +void iFXbiiuuLip__32(x64emu_t *emu, uintptr_t fcn) { iFXbiiuuLip__t fn = (iFXbiiuuLip__t)fcn; struct_iiuuLip_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_iiuuLip(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_iiuuLip(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpruuipWCCp__32(x64emu_t *emu, uintptr_t fcn) { iFpruuipWCCp__t fn = (iFpruuipWCCp__t)fcn; struct_uuipWCCp_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_uuipWCCp(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); } +void uFpbppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { uFpbppuuuuup__t fn = (uFpbppuuuuup__t)fcn; struct_ppuuuuup_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ppuuuuup(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void uFbppuuuuup_p_32(x64emu_t *emu, uintptr_t fcn) { uFbppuuuuup_p_t fn = (uFbppuuuuup_p_t)fcn; struct_ppuuuuup_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuuuuup(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = (uint32_t)fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void pFubppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { pFubppuuuuup__t fn = (pFubppuuuuup__t)fcn; struct_ppuuuuup_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ppuuuuup(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void pFpbppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { pFpbppuuuuup__t fn = (pFpbppuuuuup__t)fcn; struct_ppuuuuup_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ppuuuuup(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFbppuii_bppuii__32(x64emu_t *emu, uintptr_t fcn) { vFbppuii_bppuii__t fn = (vFbppuii_bppuii__t)fcn; struct_ppuii_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuii(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_ppuii_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ppuii(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuii(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppuii(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void lEEriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fcn) { lEEriiiiiiiiilt__t fn = (lEEriiiiiiiiilt__t)fcn; errno = emu->libc_err; struct_iiiiiiiiilt_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_iiiiiiiiilt(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_long(fn(emu, *(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL)); emu->libc_err = errno; } +void pEriiiiiiiiilt_p_32(x64emu_t *emu, uintptr_t fcn) { pEriiiiiiiiilt_p_t fn = (pEriiiiiiiiilt_p_t)fcn; errno = emu->libc_err; struct_iiiiiiiiilt_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_iiiiiiiiilt(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ptrv(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void LFXrLiiwwwwwwwwL__32(x64emu_t *emu, uintptr_t fcn) { LFXrLiiwwwwwwwwL__t fn = (LFXrLiiwwwwwwwwL__t)fcn; struct_LiiwwwwwwwwL_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_LiiwwwwwwwwL(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL)); } +void vFpbppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fcn) { vFpbppuiiiiiiiiipp__t fn = (vFpbppuiiiiiiiiipp__t)fcn; struct_ppuiiiiiiiiipp_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ppuiiiiiiiiipp(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFbppuiiiiiiiiipp_p_32(x64emu_t *emu, uintptr_t fcn) { vFbppuiiiiiiiiipp_p_t fn = (vFbppuiiiiiiiiipp_p_t)fcn; struct_ppuiiiiiiiiipp_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuiiiiiiiiipp(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void uFpbppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fcn) { uFpbppuiiiiiiiiipp__t fn = (uFpbppuiiiiiiiiipp__t)fcn; struct_ppuiiiiiiiiipp_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ppuiiiiiiiiipp(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFbppuuuuup_bppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { vFbppuuuuup_bppuuuuup__t fn = (vFbppuuuuup_bppuuuuup__t)fcn; struct_ppuuuuup_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuuuuup(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_ppuuuuup_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ppuuuuup(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iEiBLLLLLLLLLLLLLLLLLL__32(x64emu_t *emu, uintptr_t fcn) { iEiBLLLLLLLLLLLLLLLLLL__t fn = (iEiBLLLLLLLLLLLLLLLLLL__t)fcn; errno = emu->libc_err; struct_LLLLLLLLLLLLLLLLLL_t arg_8={0}; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_LLLLLLLLLLLLLLLLLL(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void iEiBUUUULLLLLLLLLLLLLL__32(x64emu_t *emu, uintptr_t fcn) { iEiBUUUULLLLLLLLLLLLLL__t fn = (iEiBUUUULLLLLLLLLLLLLL__t)fcn; errno = emu->libc_err; struct_UUUULLLLLLLLLLLLLL_t arg_8={0}; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_UUUULLLLLLLLLLLLLL(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void vFbppuiiiiiiiiipp_bppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fcn) { vFbppuiiiiiiiiipp_bppuiiiiiiiiipp__t fn = (vFbppuiiiiiiiiipp_bppuiiiiiiiiipp__t)fcn; struct_ppuiiiiiiiiipp_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuiiiiiiiiipp(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_ppuiiiiiiiiipp_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ppuiiiiiiiiipp(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void uFbppuiiiiiiiiipp_bppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fcn) { uFbppuiiiiiiiiipp_bppuiiiiiiiiipp__t fn = (uFbppuiiiiiiiiipp_bppuiiiiiiiiipp__t)fcn; struct_ppuiiiiiiiiipp_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuiiiiiiiiipp(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_ppuiiiiiiiiipp_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ppuiiiiiiiiipp(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = (uint32_t)fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vEEip_32(x64emu_t *emu, uintptr_t fcn) { vEEip_t fn = (vEEip_t)fcn; errno = emu->libc_err; fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); emu->libc_err = errno; } +void vFEip_32(x64emu_t *emu, uintptr_t fcn) { vFEip_t fn = (vFEip_t)fcn; fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } +void vEEpi_32(x64emu_t *emu, uintptr_t fcn) { vEEpi_t fn = (vEEpi_t)fcn; errno = emu->libc_err; fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); emu->libc_err = errno; } +void vEEpu_32(x64emu_t *emu, uintptr_t fcn) { vEEpu_t fn = (vEEpu_t)fcn; errno = emu->libc_err; fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); emu->libc_err = errno; } +void vFEpp_32(x64emu_t *emu, uintptr_t fcn) { vFEpp_t fn = (vFEpp_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); } +void vFEpV_32(x64emu_t *emu, uintptr_t fcn) { vFEpV_t fn = (vFEpV_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_ptrv(R_ESP + 8)); } +void vFEXp_32(x64emu_t *emu, uintptr_t fcn) { vFEXp_t fn = (vFEXp_t)fcn; fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8)); } +void vFccc_32(x64emu_t *emu, uintptr_t fcn) { vFccc_t fn = (vFccc_t)fcn; fn(from_ptri(int8_t, R_ESP + 4), from_ptri(int8_t, R_ESP + 8), from_ptri(int8_t, R_ESP + 12)); } +void vFwww_32(x64emu_t *emu, uintptr_t fcn) { vFwww_t fn = (vFwww_t)fcn; fn(from_ptri(int16_t, R_ESP + 4), from_ptri(int16_t, R_ESP + 8), from_ptri(int16_t, R_ESP + 12)); } +void vFiii_32(x64emu_t *emu, uintptr_t fcn) { vFiii_t fn = (vFiii_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void vFiif_32(x64emu_t *emu, uintptr_t fcn) { vFiif_t fn = (vFiif_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(float, R_ESP + 12)); } +void vFiip_32(x64emu_t *emu, uintptr_t fcn) { vFiip_t fn = (vFiip_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vFiII_32(x64emu_t *emu, uintptr_t fcn) { vFiII_t fn = (vFiII_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 16)); } +void vFiui_32(x64emu_t *emu, uintptr_t fcn) { vFiui_t fn = (vFiui_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void vFiuu_32(x64emu_t *emu, uintptr_t fcn) { vFiuu_t fn = (vFiuu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void vFiup_32(x64emu_t *emu, uintptr_t fcn) { vFiup_t fn = (vFiup_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vFiUU_32(x64emu_t *emu, uintptr_t fcn) { vFiUU_t fn = (vFiUU_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 16)); } +void vFiff_32(x64emu_t *emu, uintptr_t fcn) { vFiff_t fn = (vFiff_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12)); } +void vFidd_32(x64emu_t *emu, uintptr_t fcn) { vFidd_t fn = (vFidd_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16)); } +void vFilu_32(x64emu_t *emu, uintptr_t fcn) { vFilu_t fn = (vFilu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12)); } +void vFill_32(x64emu_t *emu, uintptr_t fcn) { vFill_t fn = (vFill_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12))); } +void vFilp_32(x64emu_t *emu, uintptr_t fcn) { vFilp_t fn = (vFilp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void vFipu_32(x64emu_t *emu, uintptr_t fcn) { vFipu_t fn = (vFipu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void vFipp_32(x64emu_t *emu, uintptr_t fcn) { vFipp_t fn = (vFipp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vFCCC_32(x64emu_t *emu, uintptr_t fcn) { vFCCC_t fn = (vFCCC_t)fcn; fn(from_ptri(uint8_t, R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12)); } +void vFWWW_32(x64emu_t *emu, uintptr_t fcn) { vFWWW_t fn = (vFWWW_t)fcn; fn(from_ptri(uint16_t, R_ESP + 4), from_ptri(uint16_t, R_ESP + 8), from_ptri(uint16_t, R_ESP + 12)); } +void vFucc_32(x64emu_t *emu, uintptr_t fcn) { vFucc_t fn = (vFucc_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int8_t, R_ESP + 8), from_ptri(int8_t, R_ESP + 12)); } +void vFuww_32(x64emu_t *emu, uintptr_t fcn) { vFuww_t fn = (vFuww_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int16_t, R_ESP + 8), from_ptri(int16_t, R_ESP + 12)); } +void vFuii_32(x64emu_t *emu, uintptr_t fcn) { vFuii_t fn = (vFuii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void vFuiI_32(x64emu_t *emu, uintptr_t fcn) { vFuiI_t fn = (vFuiI_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 12)); } +void vFuiu_32(x64emu_t *emu, uintptr_t fcn) { vFuiu_t fn = (vFuiu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void vFuiU_32(x64emu_t *emu, uintptr_t fcn) { vFuiU_t fn = (vFuiU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 12)); } +void vFuif_32(x64emu_t *emu, uintptr_t fcn) { vFuif_t fn = (vFuif_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(float, R_ESP + 12)); } +void vFuid_32(x64emu_t *emu, uintptr_t fcn) { vFuid_t fn = (vFuid_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(double, R_ESP + 12)); } +void vFuip_32(x64emu_t *emu, uintptr_t fcn) { vFuip_t fn = (vFuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vFuII_32(x64emu_t *emu, uintptr_t fcn) { vFuII_t fn = (vFuII_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 16)); } +void vFuWW_32(x64emu_t *emu, uintptr_t fcn) { vFuWW_t fn = (vFuWW_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint16_t, R_ESP + 8), from_ptri(uint16_t, R_ESP + 12)); } +void vFuui_32(x64emu_t *emu, uintptr_t fcn) { vFuui_t fn = (vFuui_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void vFuuC_32(x64emu_t *emu, uintptr_t fcn) { vFuuC_t fn = (vFuuC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12)); } +void vFuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuu_t fn = (vFuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void vFuuU_32(x64emu_t *emu, uintptr_t fcn) { vFuuU_t fn = (vFuuU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 12)); } +void vFuuf_32(x64emu_t *emu, uintptr_t fcn) { vFuuf_t fn = (vFuuf_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(float, R_ESP + 12)); } +void vFuud_32(x64emu_t *emu, uintptr_t fcn) { vFuud_t fn = (vFuud_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(double, R_ESP + 12)); } +void vFuup_32(x64emu_t *emu, uintptr_t fcn) { vFuup_t fn = (vFuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vFuUU_32(x64emu_t *emu, uintptr_t fcn) { vFuUU_t fn = (vFuUU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 16)); } +void vFuff_32(x64emu_t *emu, uintptr_t fcn) { vFuff_t fn = (vFuff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12)); } +void vFudd_32(x64emu_t *emu, uintptr_t fcn) { vFudd_t fn = (vFudd_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16)); } +void vFull_32(x64emu_t *emu, uintptr_t fcn) { vFull_t fn = (vFull_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12))); } +void vFulp_32(x64emu_t *emu, uintptr_t fcn) { vFulp_t fn = (vFulp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void vFupp_32(x64emu_t *emu, uintptr_t fcn) { vFupp_t fn = (vFupp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vFfff_32(x64emu_t *emu, uintptr_t fcn) { vFfff_t fn = (vFfff_t)fcn; fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12)); } +void vEfpp_32(x64emu_t *emu, uintptr_t fcn) { vEfpp_t fn = (vEfpp_t)fcn; errno = emu->libc_err; fn(from_ptri(float, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void vFddd_32(x64emu_t *emu, uintptr_t fcn) { vFddd_t fn = (vFddd_t)fcn; fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20)); } +void vEdpp_32(x64emu_t *emu, uintptr_t fcn) { vEdpp_t fn = (vEdpp_t)fcn; errno = emu->libc_err; fn(from_ptri(double, R_ESP + 4), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void vFlii_32(x64emu_t *emu, uintptr_t fcn) { vFlii_t fn = (vFlii_t)fcn; fn(from_long(from_ptri(long_t, R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void vFlip_32(x64emu_t *emu, uintptr_t fcn) { vFlip_t fn = (vFlip_t)fcn; fn(from_long(from_ptri(long_t, R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vFllp_32(x64emu_t *emu, uintptr_t fcn) { vFllp_t fn = (vFllp_t)fcn; fn(from_long(from_ptri(long_t, R_ESP + 4)), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void vFlpp_32(x64emu_t *emu, uintptr_t fcn) { vFlpp_t fn = (vFlpp_t)fcn; fn(from_long(from_ptri(long_t, R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vEpii_32(x64emu_t *emu, uintptr_t fcn) { vEpii_t fn = (vEpii_t)fcn; errno = emu->libc_err; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); emu->libc_err = errno; } +void vFpii_32(x64emu_t *emu, uintptr_t fcn) { vFpii_t fn = (vFpii_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void vFpiL_32(x64emu_t *emu, uintptr_t fcn) { vFpiL_t fn = (vFpiL_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void vFpip_32(x64emu_t *emu, uintptr_t fcn) { vFpip_t fn = (vFpip_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vFpui_32(x64emu_t *emu, uintptr_t fcn) { vFpui_t fn = (vFpui_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void vFpuI_32(x64emu_t *emu, uintptr_t fcn) { vFpuI_t fn = (vFpuI_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 12)); } +void vFpuC_32(x64emu_t *emu, uintptr_t fcn) { vFpuC_t fn = (vFpuC_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12)); } +void vFpuu_32(x64emu_t *emu, uintptr_t fcn) { vFpuu_t fn = (vFpuu_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void vFpuU_32(x64emu_t *emu, uintptr_t fcn) { vFpuU_t fn = (vFpuU_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 12)); } +void vFpuf_32(x64emu_t *emu, uintptr_t fcn) { vFpuf_t fn = (vFpuf_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(float, R_ESP + 12)); } +void vFpud_32(x64emu_t *emu, uintptr_t fcn) { vFpud_t fn = (vFpud_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(double, R_ESP + 12)); } +void vFpul_32(x64emu_t *emu, uintptr_t fcn) { vFpul_t fn = (vFpul_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12))); } +void vFpup_32(x64emu_t *emu, uintptr_t fcn) { vFpup_t fn = (vFpup_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vFpdd_32(x64emu_t *emu, uintptr_t fcn) { vFpdd_t fn = (vFpdd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16)); } +void vFplp_32(x64emu_t *emu, uintptr_t fcn) { vFplp_t fn = (vFplp_t)fcn; fn(from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void vFppi_32(x64emu_t *emu, uintptr_t fcn) { vFppi_t fn = (vFppi_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void vEppu_32(x64emu_t *emu, uintptr_t fcn) { vEppu_t fn = (vEppu_t)fcn; errno = emu->libc_err; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); emu->libc_err = errno; } +void vFppu_32(x64emu_t *emu, uintptr_t fcn) { vFppu_t fn = (vFppu_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void vFppL_32(x64emu_t *emu, uintptr_t fcn) { vFppL_t fn = (vFppL_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void vFppp_32(x64emu_t *emu, uintptr_t fcn) { vFppp_t fn = (vFppp_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vFXiL_32(x64emu_t *emu, uintptr_t fcn) { vFXiL_t fn = (vFXiL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void vFXLi_32(x64emu_t *emu, uintptr_t fcn) { vFXLi_t fn = (vFXLi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12)); } +void vFXLL_32(x64emu_t *emu, uintptr_t fcn) { vFXLL_t fn = (vFXLL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void vFXLp_32(x64emu_t *emu, uintptr_t fcn) { vFXLp_t fn = (vFXLp_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void vFXpi_32(x64emu_t *emu, uintptr_t fcn) { vFXpi_t fn = (vFXpi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void vFXpl_32(x64emu_t *emu, uintptr_t fcn) { vFXpl_t fn = (vFXpl_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12))); } +void vFXpL_32(x64emu_t *emu, uintptr_t fcn) { vFXpL_t fn = (vFXpL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void vFXpp_32(x64emu_t *emu, uintptr_t fcn) { vFXpp_t fn = (vFXpp_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFEip_32(x64emu_t *emu, uintptr_t fcn) { iFEip_t fn = (iFEip_t)fcn; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } +void iEEip_32(x64emu_t *emu, uintptr_t fcn) { iEEip_t fn = (iEEip_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); emu->libc_err = errno; } +void iEEup_32(x64emu_t *emu, uintptr_t fcn) { iEEup_t fn = (iEEup_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); emu->libc_err = errno; } +void iFEup_32(x64emu_t *emu, uintptr_t fcn) { iFEup_t fn = (iFEup_t)fcn; R_EAX = fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } +void iEEpi_32(x64emu_t *emu, uintptr_t fcn) { iEEpi_t fn = (iEEpi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); emu->libc_err = errno; } +void iFEpi_32(x64emu_t *emu, uintptr_t fcn) { iFEpi_t fn = (iFEpi_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } +void iFEpu_32(x64emu_t *emu, uintptr_t fcn) { iFEpu_t fn = (iFEpu_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } +void iFEpl_32(x64emu_t *emu, uintptr_t fcn) { iFEpl_t fn = (iFEpl_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8))); } +void iEEpL_32(x64emu_t *emu, uintptr_t fcn) { iEEpL_t fn = (iEEpL_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8))); emu->libc_err = errno; } +void iFEpL_32(x64emu_t *emu, uintptr_t fcn) { iFEpL_t fn = (iFEpL_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8))); } +void iEEpp_32(x64emu_t *emu, uintptr_t fcn) { iEEpp_t fn = (iEEpp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); emu->libc_err = errno; } +void iFEpp_32(x64emu_t *emu, uintptr_t fcn) { iFEpp_t fn = (iFEpp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); } +void iEEpV_32(x64emu_t *emu, uintptr_t fcn) { iEEpV_t fn = (iEEpV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptrv(R_ESP + 8)); emu->libc_err = errno; } +void iFEpX_32(x64emu_t *emu, uintptr_t fcn) { iFEpX_t fn = (iFEpX_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), getDisplay(from_ptriv(R_ESP + 8))); } +void iEEhi_32(x64emu_t *emu, uintptr_t fcn) { iEEhi_t fn = (iEEhi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptri(int32_t, R_ESP + 8)); emu->libc_err = errno; } +void iEEhp_32(x64emu_t *emu, uintptr_t fcn) { iEEhp_t fn = (iEEhp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptriv(R_ESP + 8)); emu->libc_err = errno; } +void iFEXp_32(x64emu_t *emu, uintptr_t fcn) { iFEXp_t fn = (iFEXp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8)); } +void iEiii_32(x64emu_t *emu, uintptr_t fcn) { iEiii_t fn = (iEiii_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); emu->libc_err = errno; } +void iEiiI_32(x64emu_t *emu, uintptr_t fcn) { iEiiI_t fn = (iEiiI_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 12)); emu->libc_err = errno; } +void iFiiu_32(x64emu_t *emu, uintptr_t fcn) { iFiiu_t fn = (iFiiu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void iEiil_32(x64emu_t *emu, uintptr_t fcn) { iEiil_t fn = (iEiil_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12))); emu->libc_err = errno; } +void iEiip_32(x64emu_t *emu, uintptr_t fcn) { iEiip_t fn = (iEiip_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iFiip_32(x64emu_t *emu, uintptr_t fcn) { iFiip_t fn = (iFiip_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iEiiO_32(x64emu_t *emu, uintptr_t fcn) { iEiiO_t fn = (iEiiO_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), of_convert32(from_ptri(int32_t, R_ESP + 12))); emu->libc_err = errno; } +void iEiiN_32(x64emu_t *emu, uintptr_t fcn) { iEiiN_t fn = (iEiiN_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iEiII_32(x64emu_t *emu, uintptr_t fcn) { iEiII_t fn = (iEiII_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 16)); emu->libc_err = errno; } +void iFiui_32(x64emu_t *emu, uintptr_t fcn) { iFiui_t fn = (iFiui_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void iEiuu_32(x64emu_t *emu, uintptr_t fcn) { iEiuu_t fn = (iEiuu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); emu->libc_err = errno; } +void iFiuu_32(x64emu_t *emu, uintptr_t fcn) { iFiuu_t fn = (iFiuu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void iFiuL_32(x64emu_t *emu, uintptr_t fcn) { iFiuL_t fn = (iFiuL_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void iEiup_32(x64emu_t *emu, uintptr_t fcn) { iEiup_t fn = (iEiup_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iFiup_32(x64emu_t *emu, uintptr_t fcn) { iFiup_t fn = (iFiup_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFiUU_32(x64emu_t *emu, uintptr_t fcn) { iFiUU_t fn = (iFiUU_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 16)); } +void iFiUp_32(x64emu_t *emu, uintptr_t fcn) { iFiUp_t fn = (iFiUp_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptriv(R_ESP + 16)); } +void iFidd_32(x64emu_t *emu, uintptr_t fcn) { iFidd_t fn = (iFidd_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16)); } +void iEill_32(x64emu_t *emu, uintptr_t fcn) { iEill_t fn = (iEill_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12))); emu->libc_err = errno; } +void iEiLi_32(x64emu_t *emu, uintptr_t fcn) { iEiLi_t fn = (iEiLi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12)); emu->libc_err = errno; } +void iEiLp_32(x64emu_t *emu, uintptr_t fcn) { iEiLp_t fn = (iEiLp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iFiLp_32(x64emu_t *emu, uintptr_t fcn) { iFiLp_t fn = (iFiLp_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void iFipi_32(x64emu_t *emu, uintptr_t fcn) { iFipi_t fn = (iFipi_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void iEipi_32(x64emu_t *emu, uintptr_t fcn) { iEipi_t fn = (iEipi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); emu->libc_err = errno; } +void iEipu_32(x64emu_t *emu, uintptr_t fcn) { iEipu_t fn = (iEipu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); emu->libc_err = errno; } +void iFipu_32(x64emu_t *emu, uintptr_t fcn) { iFipu_t fn = (iFipu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void iEipL_32(x64emu_t *emu, uintptr_t fcn) { iEipL_t fn = (iEipL_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); emu->libc_err = errno; } +void iEipp_32(x64emu_t *emu, uintptr_t fcn) { iEipp_t fn = (iEipp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iFipp_32(x64emu_t *emu, uintptr_t fcn) { iFipp_t fn = (iFipp_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iEipO_32(x64emu_t *emu, uintptr_t fcn) { iEipO_t fn = (iEipO_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), of_convert32(from_ptri(int32_t, R_ESP + 12))); emu->libc_err = errno; } +void iFuip_32(x64emu_t *emu, uintptr_t fcn) { iFuip_t fn = (iFuip_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iEuui_32(x64emu_t *emu, uintptr_t fcn) { iEuui_t fn = (iEuui_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); emu->libc_err = errno; } +void iEuuu_32(x64emu_t *emu, uintptr_t fcn) { iEuuu_t fn = (iEuuu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); emu->libc_err = errno; } +void iFuup_32(x64emu_t *emu, uintptr_t fcn) { iFuup_t fn = (iFuup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iEuLa_32(x64emu_t *emu, uintptr_t fcn) { iEuLa_t fn = (iEuLa_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_locale(from_ptri(ptr_t, R_ESP + 12))); emu->libc_err = errno; } +void iFupL_32(x64emu_t *emu, uintptr_t fcn) { iFupL_t fn = (iFupL_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void iFUip_32(x64emu_t *emu, uintptr_t fcn) { iFUip_t fn = (iFUip_t)fcn; R_EAX = fn(from_ptri(uint64_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFfff_32(x64emu_t *emu, uintptr_t fcn) { iFfff_t fn = (iFfff_t)fcn; R_EAX = fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12)); } +void iELLi_32(x64emu_t *emu, uintptr_t fcn) { iELLi_t fn = (iELLi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12)); emu->libc_err = errno; } +void iFpii_32(x64emu_t *emu, uintptr_t fcn) { iFpii_t fn = (iFpii_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void iEpiu_32(x64emu_t *emu, uintptr_t fcn) { iEpiu_t fn = (iEpiu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); emu->libc_err = errno; } +void iFpiu_32(x64emu_t *emu, uintptr_t fcn) { iFpiu_t fn = (iFpiu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void iFpil_32(x64emu_t *emu, uintptr_t fcn) { iFpil_t fn = (iFpil_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12))); } +void iEpip_32(x64emu_t *emu, uintptr_t fcn) { iEpip_t fn = (iEpip_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iFpip_32(x64emu_t *emu, uintptr_t fcn) { iFpip_t fn = (iFpip_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFpII_32(x64emu_t *emu, uintptr_t fcn) { iFpII_t fn = (iFpII_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 16)); } +void iFpWp_32(x64emu_t *emu, uintptr_t fcn) { iFpWp_t fn = (iFpWp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint16_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFpui_32(x64emu_t *emu, uintptr_t fcn) { iFpui_t fn = (iFpui_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void iFpuC_32(x64emu_t *emu, uintptr_t fcn) { iFpuC_t fn = (iFpuC_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12)); } +void iEpuu_32(x64emu_t *emu, uintptr_t fcn) { iEpuu_t fn = (iEpuu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); emu->libc_err = errno; } +void iFpuu_32(x64emu_t *emu, uintptr_t fcn) { iFpuu_t fn = (iFpuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void iFpuU_32(x64emu_t *emu, uintptr_t fcn) { iFpuU_t fn = (iFpuU_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 12)); } +void iFpup_32(x64emu_t *emu, uintptr_t fcn) { iFpup_t fn = (iFpup_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFpUU_32(x64emu_t *emu, uintptr_t fcn) { iFpUU_t fn = (iFpUU_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 16)); } +void iFpfu_32(x64emu_t *emu, uintptr_t fcn) { iFpfu_t fn = (iFpfu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void iFpff_32(x64emu_t *emu, uintptr_t fcn) { iFpff_t fn = (iFpff_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12)); } +void iFpdd_32(x64emu_t *emu, uintptr_t fcn) { iFpdd_t fn = (iFpdd_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16)); } +void iFpli_32(x64emu_t *emu, uintptr_t fcn) { iFpli_t fn = (iFpli_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12)); } +void iFpll_32(x64emu_t *emu, uintptr_t fcn) { iFpll_t fn = (iFpll_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12))); } +void iEpLi_32(x64emu_t *emu, uintptr_t fcn) { iEpLi_t fn = (iEpLi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12)); emu->libc_err = errno; } +void iEpLu_32(x64emu_t *emu, uintptr_t fcn) { iEpLu_t fn = (iEpLu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12)); emu->libc_err = errno; } +void iEpLp_32(x64emu_t *emu, uintptr_t fcn) { iEpLp_t fn = (iEpLp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iFpLp_32(x64emu_t *emu, uintptr_t fcn) { iFpLp_t fn = (iFpLp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void iEppi_32(x64emu_t *emu, uintptr_t fcn) { iEppi_t fn = (iEppi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); emu->libc_err = errno; } +void iFppi_32(x64emu_t *emu, uintptr_t fcn) { iFppi_t fn = (iFppi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void iFppI_32(x64emu_t *emu, uintptr_t fcn) { iFppI_t fn = (iFppI_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int64_t, R_ESP + 12)); } +void iEppu_32(x64emu_t *emu, uintptr_t fcn) { iEppu_t fn = (iEppu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); emu->libc_err = errno; } +void iFppu_32(x64emu_t *emu, uintptr_t fcn) { iFppu_t fn = (iFppu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void iFppU_32(x64emu_t *emu, uintptr_t fcn) { iFppU_t fn = (iFppU_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint64_t, R_ESP + 12)); } +void iFppd_32(x64emu_t *emu, uintptr_t fcn) { iFppd_t fn = (iFppd_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(double, R_ESP + 12)); } +void iEppL_32(x64emu_t *emu, uintptr_t fcn) { iEppL_t fn = (iEppL_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); emu->libc_err = errno; } +void iFppL_32(x64emu_t *emu, uintptr_t fcn) { iFppL_t fn = (iFppL_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void iEppp_32(x64emu_t *emu, uintptr_t fcn) { iEppp_t fn = (iEppp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iFppp_32(x64emu_t *emu, uintptr_t fcn) { iFppp_t fn = (iFppp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iEppa_32(x64emu_t *emu, uintptr_t fcn) { iEppa_t fn = (iEppa_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_locale(from_ptri(ptr_t, R_ESP + 12))); emu->libc_err = errno; } +void iEpOu_32(x64emu_t *emu, uintptr_t fcn) { iEpOu_t fn = (iEpOu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), of_convert32(from_ptri(int32_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12)); emu->libc_err = errno; } +void iFpSp_32(x64emu_t *emu, uintptr_t fcn) { iFpSp_t fn = (iFpSp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), io_convert32(from_ptriv(R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void iEhip_32(x64emu_t *emu, uintptr_t fcn) { iEhip_t fn = (iEhip_t)fcn; errno = emu->libc_err; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iEhpL_32(x64emu_t *emu, uintptr_t fcn) { iEhpL_t fn = (iEhpL_t)fcn; errno = emu->libc_err; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); emu->libc_err = errno; } +void iEhpp_32(x64emu_t *emu, uintptr_t fcn) { iEhpp_t fn = (iEhpp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iESIi_32(x64emu_t *emu, uintptr_t fcn) { iESIi_t fn = (iESIi_t)fcn; errno = emu->libc_err; R_EAX = fn(io_convert32(from_ptriv(R_ESP + 4)), from_ptri(int64_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 16)); emu->libc_err = errno; } +void iESli_32(x64emu_t *emu, uintptr_t fcn) { iESli_t fn = (iESli_t)fcn; errno = emu->libc_err; R_EAX = fn(io_convert32(from_ptriv(R_ESP + 4)), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12)); emu->libc_err = errno; } +void iFXii_32(x64emu_t *emu, uintptr_t fcn) { iFXii_t fn = (iFXii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void iFXiL_32(x64emu_t *emu, uintptr_t fcn) { iFXiL_t fn = (iFXiL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void iFXip_32(x64emu_t *emu, uintptr_t fcn) { iFXip_t fn = (iFXip_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFXuu_32(x64emu_t *emu, uintptr_t fcn) { iFXuu_t fn = (iFXuu_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void iFXup_32(x64emu_t *emu, uintptr_t fcn) { iFXup_t fn = (iFXup_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFXLi_32(x64emu_t *emu, uintptr_t fcn) { iFXLi_t fn = (iFXLi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12)); } +void iFXLu_32(x64emu_t *emu, uintptr_t fcn) { iFXLu_t fn = (iFXLu_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12)); } +void iFXLU_32(x64emu_t *emu, uintptr_t fcn) { iFXLU_t fn = (iFXLU_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint64_t, R_ESP + 12)); } +void iFXLf_32(x64emu_t *emu, uintptr_t fcn) { iFXLf_t fn = (iFXLf_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(float, R_ESP + 12)); } +void iFXLl_32(x64emu_t *emu, uintptr_t fcn) { iFXLl_t fn = (iFXLl_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12))); } +void iFXLL_32(x64emu_t *emu, uintptr_t fcn) { iFXLL_t fn = (iFXLL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void iFXLp_32(x64emu_t *emu, uintptr_t fcn) { iFXLp_t fn = (iFXLp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void iFXpi_32(x64emu_t *emu, uintptr_t fcn) { iFXpi_t fn = (iFXpi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void iFXpu_32(x64emu_t *emu, uintptr_t fcn) { iFXpu_t fn = (iFXpu_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void iFXpl_32(x64emu_t *emu, uintptr_t fcn) { iFXpl_t fn = (iFXpl_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12))); } +void iFXpL_32(x64emu_t *emu, uintptr_t fcn) { iFXpL_t fn = (iFXpL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void iFXpp_32(x64emu_t *emu, uintptr_t fcn) { iFXpp_t fn = (iFXpp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void IEiIi_32(x64emu_t *emu, uintptr_t fcn) { IEiIi_t fn = (IEiIi_t)fcn; errno = emu->libc_err; ui64_t r; r.i = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 16)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void IFpIi_32(x64emu_t *emu, uintptr_t fcn) { IFpIi_t fn = (IFpIi_t)fcn; ui64_t r; r.i = fn(from_ptriv(R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 16)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void IEppi_32(x64emu_t *emu, uintptr_t fcn) { IEppi_t fn = (IEppi_t)fcn; errno = emu->libc_err; ui64_t r; r.i = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void CFipp_32(x64emu_t *emu, uintptr_t fcn) { CFipp_t fn = (CFipp_t)fcn; R_EAX = (unsigned char)fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void CFuUu_32(x64emu_t *emu, uintptr_t fcn) { CFuUu_t fn = (CFuUu_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 16)); } +void CFuff_32(x64emu_t *emu, uintptr_t fcn) { CFuff_t fn = (CFuff_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12)); } +void WFXip_32(x64emu_t *emu, uintptr_t fcn) { WFXip_t fn = (WFXip_t)fcn; R_EAX = (unsigned short)fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void uFEpW_32(x64emu_t *emu, uintptr_t fcn) { uFEpW_t fn = (uFEpW_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint16_t, R_ESP + 8)); } +void uFEpu_32(x64emu_t *emu, uintptr_t fcn) { uFEpu_t fn = (uFEpu_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } +void uFEpU_32(x64emu_t *emu, uintptr_t fcn) { uFEpU_t fn = (uFEpU_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint64_t, R_ESP + 8)); } +void uFEpL_32(x64emu_t *emu, uintptr_t fcn) { uFEpL_t fn = (uFEpL_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8))); } +void uFEpp_32(x64emu_t *emu, uintptr_t fcn) { uFEpp_t fn = (uFEpp_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); } +void uFilp_32(x64emu_t *emu, uintptr_t fcn) { uFilp_t fn = (uFilp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void uFipu_32(x64emu_t *emu, uintptr_t fcn) { uFipu_t fn = (uFipu_t)fcn; R_EAX = (uint32_t)fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void uFuuu_32(x64emu_t *emu, uintptr_t fcn) { uFuuu_t fn = (uFuuu_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void uFuup_32(x64emu_t *emu, uintptr_t fcn) { uFuup_t fn = (uFuup_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void uFupp_32(x64emu_t *emu, uintptr_t fcn) { uFupp_t fn = (uFupp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void uFpii_32(x64emu_t *emu, uintptr_t fcn) { uFpii_t fn = (uFpii_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void uFpip_32(x64emu_t *emu, uintptr_t fcn) { uFpip_t fn = (uFpip_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void uFpuU_32(x64emu_t *emu, uintptr_t fcn) { uFpuU_t fn = (uFpuU_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 12)); } +void uEpup_32(x64emu_t *emu, uintptr_t fcn) { uEpup_t fn = (uEpup_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void uFpup_32(x64emu_t *emu, uintptr_t fcn) { uFpup_t fn = (uFpup_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void uFppi_32(x64emu_t *emu, uintptr_t fcn) { uFppi_t fn = (uFppi_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void uFppu_32(x64emu_t *emu, uintptr_t fcn) { uFppu_t fn = (uFppu_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void uEppL_32(x64emu_t *emu, uintptr_t fcn) { uEppL_t fn = (uEppL_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); emu->libc_err = errno; } +void uFppL_32(x64emu_t *emu, uintptr_t fcn) { uFppL_t fn = (uFppL_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void uFppp_32(x64emu_t *emu, uintptr_t fcn) { uFppp_t fn = (uFppp_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void uFXuu_32(x64emu_t *emu, uintptr_t fcn) { uFXuu_t fn = (uFXuu_t)fcn; R_EAX = (uint32_t)fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void UEppi_32(x64emu_t *emu, uintptr_t fcn) { UEppi_t fn = (UEppi_t)fcn; errno = emu->libc_err; ui64_t r; r.u = (uint64_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } +void fFuii_32(x64emu_t *emu, uintptr_t fcn) { fFuii_t fn = (fFuii_t)fcn; float fl = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); fpu_do_push(emu); ST0val = fl; } +void fEfff_32(x64emu_t *emu, uintptr_t fcn) { fEfff_t fn = (fEfff_t)fcn; errno = emu->libc_err; float fl = fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12)); fpu_do_push(emu); ST0val = fl; emu->libc_err = errno; } +void fEffp_32(x64emu_t *emu, uintptr_t fcn) { fEffp_t fn = (fEffp_t)fcn; errno = emu->libc_err; float fl = fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptriv(R_ESP + 12)); fpu_do_push(emu); ST0val = fl; emu->libc_err = errno; } +void dEddd_32(x64emu_t *emu, uintptr_t fcn) { dEddd_t fn = (dEddd_t)fcn; errno = emu->libc_err; double db = fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20)); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void dEddp_32(x64emu_t *emu, uintptr_t fcn) { dEddp_t fn = (dEddp_t)fcn; errno = emu->libc_err; double db = fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptriv(R_ESP + 20)); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void lEEuV_32(x64emu_t *emu, uintptr_t fcn) { lEEuV_t fn = (lEEuV_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptrv(R_ESP + 8))); emu->libc_err = errno; } +void lEili_32(x64emu_t *emu, uintptr_t fcn) { lEili_t fn = (lEili_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12))); emu->libc_err = errno; } +void lEipi_32(x64emu_t *emu, uintptr_t fcn) { lEipi_t fn = (lEipi_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); emu->libc_err = errno; } +void lEipL_32(x64emu_t *emu, uintptr_t fcn) { lEipL_t fn = (lEipL_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); emu->libc_err = errno; } +void lFlll_32(x64emu_t *emu, uintptr_t fcn) { lFlll_t fn = (lFlll_t)fcn; R_EAX = to_long(fn(from_long(from_ptri(long_t, R_ESP + 4)), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12)))); } +void lElpi_32(x64emu_t *emu, uintptr_t fcn) { lElpi_t fn = (lElpi_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_long(from_ptri(long_t, R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); emu->libc_err = errno; } +void lFpLd_32(x64emu_t *emu, uintptr_t fcn) { lFpLd_t fn = (lFpLd_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(double, R_ESP + 12))); } +void lFpLL_32(x64emu_t *emu, uintptr_t fcn) { lFpLL_t fn = (lFpLL_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); } +void lFppi_32(x64emu_t *emu, uintptr_t fcn) { lFppi_t fn = (lFppi_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void lFppL_32(x64emu_t *emu, uintptr_t fcn) { lFppL_t fn = (lFppL_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); } +void lFppp_32(x64emu_t *emu, uintptr_t fcn) { lFppp_t fn = (lFppp_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } +void LFEpi_32(x64emu_t *emu, uintptr_t fcn) { LFEpi_t fn = (LFEpi_t)fcn; R_EAX = to_ulong(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); } +void LFEpp_32(x64emu_t *emu, uintptr_t fcn) { LFEpp_t fn = (LFEpp_t)fcn; R_EAX = to_ulong(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); } +void LFEXp_32(x64emu_t *emu, uintptr_t fcn) { LFEXp_t fn = (LFEXp_t)fcn; R_EAX = to_ulong(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8))); } +void LFpii_32(x64emu_t *emu, uintptr_t fcn) { LFpii_t fn = (LFpii_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void LEpip_32(x64emu_t *emu, uintptr_t fcn) { LEpip_t fn = (LEpip_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12))); emu->libc_err = errno; } +void LFppi_32(x64emu_t *emu, uintptr_t fcn) { LFppi_t fn = (LFppi_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void LEppL_32(x64emu_t *emu, uintptr_t fcn) { LEppL_t fn = (LEppL_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); emu->libc_err = errno; } +void LFppL_32(x64emu_t *emu, uintptr_t fcn) { LFppL_t fn = (LFppL_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); } +void LFXip_32(x64emu_t *emu, uintptr_t fcn) { LFXip_t fn = (LFXip_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12))); } +void LFXCi_32(x64emu_t *emu, uintptr_t fcn) { LFXCi_t fn = (LFXCi_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint8_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void LFXLi_32(x64emu_t *emu, uintptr_t fcn) { LFXLi_t fn = (LFXLi_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12))); } +void LFXLC_32(x64emu_t *emu, uintptr_t fcn) { LFXLC_t fn = (LFXLC_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint8_t, R_ESP + 12))); } +void LFXpi_32(x64emu_t *emu, uintptr_t fcn) { LFXpi_t fn = (LFXpi_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void LFXpp_32(x64emu_t *emu, uintptr_t fcn) { LFXpp_t fn = (LFXpp_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pFEii_32(x64emu_t *emu, uintptr_t fcn) { pFEii_t fn = (pFEii_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); } +void pFEiu_32(x64emu_t *emu, uintptr_t fcn) { pFEiu_t fn = (pFEiu_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8))); } +void pEEip_32(x64emu_t *emu, uintptr_t fcn) { pEEip_t fn = (pEEip_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void pFEiV_32(x64emu_t *emu, uintptr_t fcn) { pFEiV_t fn = (pFEiV_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptrv(R_ESP + 8))); } +void pEEpi_32(x64emu_t *emu, uintptr_t fcn) { pEEpi_t fn = (pEEpi_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); emu->libc_err = errno; } +void pFEpi_32(x64emu_t *emu, uintptr_t fcn) { pFEpi_t fn = (pFEpi_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); } +void pFEpu_32(x64emu_t *emu, uintptr_t fcn) { pFEpu_t fn = (pFEpu_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8))); } +void pEEpp_32(x64emu_t *emu, uintptr_t fcn) { pEEpp_t fn = (pEEpp_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); emu->libc_err = errno; } +void pFEpp_32(x64emu_t *emu, uintptr_t fcn) { pFEpp_t fn = (pFEpp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); } +void pFEpV_32(x64emu_t *emu, uintptr_t fcn) { pFEpV_t fn = (pFEpV_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptrv(R_ESP + 8))); } +void pFEpX_32(x64emu_t *emu, uintptr_t fcn) { pFEpX_t fn = (pFEpX_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), getDisplay(from_ptriv(R_ESP + 8)))); } +void pFEXi_32(x64emu_t *emu, uintptr_t fcn) { pFEXi_t fn = (pFEXi_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8))); } +void pFEXL_32(x64emu_t *emu, uintptr_t fcn) { pFEXL_t fn = (pFEXL_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); } +void pFEXp_32(x64emu_t *emu, uintptr_t fcn) { pFEXp_t fn = (pFEXp_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8))); } +void pFiii_32(x64emu_t *emu, uintptr_t fcn) { pFiii_t fn = (pFiii_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void pFipp_32(x64emu_t *emu, uintptr_t fcn) { pFipp_t fn = (pFipp_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pFIpi_32(x64emu_t *emu, uintptr_t fcn) { pFIpi_t fn = (pFIpi_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int64_t, R_ESP + 4), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } +void pFuuu_32(x64emu_t *emu, uintptr_t fcn) { pFuuu_t fn = (pFuuu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12))); } +void pFulu_32(x64emu_t *emu, uintptr_t fcn) { pFulu_t fn = (pFulu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12))); } +void pFupi_32(x64emu_t *emu, uintptr_t fcn) { pFupi_t fn = (pFupi_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void pFupp_32(x64emu_t *emu, uintptr_t fcn) { pFupp_t fn = (pFupp_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pFddd_32(x64emu_t *emu, uintptr_t fcn) { pFddd_t fn = (pFddd_t)fcn; R_EAX = to_ptrv(fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20))); } +void pFLpi_32(x64emu_t *emu, uintptr_t fcn) { pFLpi_t fn = (pFLpi_t)fcn; R_EAX = to_ptrv(fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void pFpcU_32(x64emu_t *emu, uintptr_t fcn) { pFpcU_t fn = (pFpcU_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int8_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 12))); } +void pEpii_32(x64emu_t *emu, uintptr_t fcn) { pEpii_t fn = (pEpii_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); emu->libc_err = errno; } +void pFpii_32(x64emu_t *emu, uintptr_t fcn) { pFpii_t fn = (pFpii_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void pFpiu_32(x64emu_t *emu, uintptr_t fcn) { pFpiu_t fn = (pFpiu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12))); } +void pEpiL_32(x64emu_t *emu, uintptr_t fcn) { pEpiL_t fn = (pEpiL_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); emu->libc_err = errno; } +void pFpiL_32(x64emu_t *emu, uintptr_t fcn) { pFpiL_t fn = (pFpiL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); } +void pFpip_32(x64emu_t *emu, uintptr_t fcn) { pFpip_t fn = (pFpip_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pEpiS_32(x64emu_t *emu, uintptr_t fcn) { pEpiS_t fn = (pEpiS_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), io_convert32(from_ptriv(R_ESP + 12)))); emu->libc_err = errno; } +void pEpII_32(x64emu_t *emu, uintptr_t fcn) { pEpII_t fn = (pEpII_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 16))); emu->libc_err = errno; } +void pFpuu_32(x64emu_t *emu, uintptr_t fcn) { pFpuu_t fn = (pFpuu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12))); } +void pFpup_32(x64emu_t *emu, uintptr_t fcn) { pFpup_t fn = (pFpup_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pFpUi_32(x64emu_t *emu, uintptr_t fcn) { pFpUi_t fn = (pFpUi_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 16))); } +void pFpdd_32(x64emu_t *emu, uintptr_t fcn) { pFpdd_t fn = (pFpdd_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16))); } +void pEpLL_32(x64emu_t *emu, uintptr_t fcn) { pEpLL_t fn = (pEpLL_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); emu->libc_err = errno; } +void pFppi_32(x64emu_t *emu, uintptr_t fcn) { pFppi_t fn = (pFppi_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void pFppu_32(x64emu_t *emu, uintptr_t fcn) { pFppu_t fn = (pFppu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12))); } +void pEppL_32(x64emu_t *emu, uintptr_t fcn) { pEppL_t fn = (pEppL_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); emu->libc_err = errno; } +void pFppL_32(x64emu_t *emu, uintptr_t fcn) { pFppL_t fn = (pFppL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); } +void pFppp_32(x64emu_t *emu, uintptr_t fcn) { pFppp_t fn = (pFppp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pEpOM_32(x64emu_t *emu, uintptr_t fcn) { pEpOM_t fn = (pEpOM_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), of_convert32(from_ptri(int32_t, R_ESP + 8)), from_ptriv(R_ESP + 12),from_ptriv(R_ESP + 12 + 4))); emu->libc_err = errno; } +void pFXii_32(x64emu_t *emu, uintptr_t fcn) { pFXii_t fn = (pFXii_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void pFXip_32(x64emu_t *emu, uintptr_t fcn) { pFXip_t fn = (pFXip_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pFXLp_32(x64emu_t *emu, uintptr_t fcn) { pFXLp_t fn = (pFXLp_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12))); } +void pFXpi_32(x64emu_t *emu, uintptr_t fcn) { pFXpi_t fn = (pFXpi_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void pFXpp_32(x64emu_t *emu, uintptr_t fcn) { pFXpp_t fn = (pFXpp_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pFnpL_32(x64emu_t *emu, uintptr_t fcn) { pFnpL_t fn = (pFnpL_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); R_EAX = to_ptrv(fn(aligned_xcb, from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); } +void aEipa_32(x64emu_t *emu, uintptr_t fcn) { aEipa_t fn = (aEipa_t)fcn; errno = emu->libc_err; R_EAX = to_locale(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_locale(from_ptri(ptr_t, R_ESP + 12)))); emu->libc_err = errno; } +void SEEpp_32(x64emu_t *emu, uintptr_t fcn) { SEEpp_t fn = (SEEpp_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(io_convert_from(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)))); emu->libc_err = errno; } +void SEppS_32(x64emu_t *emu, uintptr_t fcn) { SEppS_t fn = (SEppS_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(io_convert_from(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), io_convert32(from_ptriv(R_ESP + 12))))); emu->libc_err = errno; } +void tEipu_32(x64emu_t *emu, uintptr_t fcn) { tEipu_t fn = (tEipu_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12))); emu->libc_err = errno; } +void tEipL_32(x64emu_t *emu, uintptr_t fcn) { tEipL_t fn = (tEipL_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); emu->libc_err = errno; } +void tEppi_32(x64emu_t *emu, uintptr_t fcn) { tEppi_t fn = (tEppi_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); emu->libc_err = errno; } +void vFibp_i_32(x64emu_t *emu, uintptr_t fcn) { vFibp_i_t fn = (vFibp_i_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptri(int32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFuibp__32(x64emu_t *emu, uintptr_t fcn) { vFuibp__t fn = (vFuibp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFuuBp__32(x64emu_t *emu, uintptr_t fcn) { vFuuBp__t fn = (vFuuBp__t)fcn; struct_p_t arg_12={0}; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFuubp__32(x64emu_t *emu, uintptr_t fcn) { vFuubp__t fn = (vFuubp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFpbp_i_32(x64emu_t *emu, uintptr_t fcn) { vFpbp_i_t fn = (vFpbp_i_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFbp_pp_32(x64emu_t *emu, uintptr_t fcn) { vFbp_pp_t fn = (vFbp_pp_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void vFXLbL__32(x64emu_t *emu, uintptr_t fcn) { vFXLbL__t fn = (vFXLbL__t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFXbL_i_32(x64emu_t *emu, uintptr_t fcn) { vFXbL_i_t fn = (vFXbL_i_t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFEpBp__32(x64emu_t *emu, uintptr_t fcn) { iFEpBp__t fn = (iFEpBp__t)fcn; struct_p_t arg_8={0}; R_EAX = fn(emu, from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFWubp__32(x64emu_t *emu, uintptr_t fcn) { iFWubp__t fn = (iFWubp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptri(uint16_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFuubp__32(x64emu_t *emu, uintptr_t fcn) { iFuubp__t fn = (iFuubp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFUpbp__32(x64emu_t *emu, uintptr_t fcn) { iFUpbp__t fn = (iFUpbp__t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptri(uint64_t, R_ESP + 4), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFLbp_p_32(x64emu_t *emu, uintptr_t fcn) { iFLbp_p_t fn = (iFLbp_p_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpibl__32(x64emu_t *emu, uintptr_t fcn) { iFpibl__t fn = (iFpibl__t)fcn; struct_l_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_l(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpibp__32(x64emu_t *emu, uintptr_t fcn) { iFpibp__t fn = (iFpibp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpubp__32(x64emu_t *emu, uintptr_t fcn) { iFpubp__t fn = (iFpubp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpubL__32(x64emu_t *emu, uintptr_t fcn) { iFpubL__t fn = (iFpubL__t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFplbl__32(x64emu_t *emu, uintptr_t fcn) { iFplbl__t fn = (iFplbl__t)fcn; struct_l_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_l(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iEppBp__32(x64emu_t *emu, uintptr_t fcn) { iEppBp__t fn = (iEppBp__t)fcn; errno = emu->libc_err; struct_p_t arg_12={0}; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); emu->libc_err = errno; } +void iFppbp__32(x64emu_t *emu, uintptr_t fcn) { iFppbp__t fn = (iFppbp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFppbL__32(x64emu_t *emu, uintptr_t fcn) { iFppbL__t fn = (iFppbL__t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbp_i_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_i_t fn = (iFpbp_i_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbL_i_32(x64emu_t *emu, uintptr_t fcn) { iFpbL_i_t fn = (iFpbL_i_t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbp_u_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_u_t fn = (iFpbp_u_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbL_p_32(x64emu_t *emu, uintptr_t fcn) { iFpbL_p_t fn = (iFpbL_p_t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbp_p_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_p_t fn = (iFpbp_p_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFbp_Wp_32(x64emu_t *emu, uintptr_t fcn) { iFbp_Wp_t fn = (iFbp_Wp_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(uint16_t, R_ESP + 8), from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_up_32(x64emu_t *emu, uintptr_t fcn) { iFbp_up_t fn = (iFbp_up_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iEBp_LL_32(x64emu_t *emu, uintptr_t fcn) { iEBp_LL_t fn = (iEBp_LL_t)fcn; errno = emu->libc_err; struct_p_t arg_4={0}; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12))); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); emu->libc_err = errno; } +void iFBp_LL_32(x64emu_t *emu, uintptr_t fcn) { iFBp_LL_t fn = (iFBp_LL_t)fcn; struct_p_t arg_4={0}; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12))); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_pi_32(x64emu_t *emu, uintptr_t fcn) { iFbp_pi_t fn = (iFbp_pi_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbL_pi_32(x64emu_t *emu, uintptr_t fcn) { iFbL_pi_t fn = (iFbL_pi_t)fcn; struct_L_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_L(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_pI_32(x64emu_t *emu, uintptr_t fcn) { iFbp_pI_t fn = (iFbp_pI_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptri(int64_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_pu_32(x64emu_t *emu, uintptr_t fcn) { iFbp_pu_t fn = (iFbp_pu_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_pd_32(x64emu_t *emu, uintptr_t fcn) { iFbp_pd_t fn = (iFbp_pd_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptri(double, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_pl_32(x64emu_t *emu, uintptr_t fcn) { iFbp_pl_t fn = (iFbp_pl_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12))); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_pp_32(x64emu_t *emu, uintptr_t fcn) { iFbp_pp_t fn = (iFbp_pp_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_Si_32(x64emu_t *emu, uintptr_t fcn) { iFbp_Si_t fn = (iFbp_Si_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, io_convert32(from_ptriv(R_ESP + 8)), from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFXibL__32(x64emu_t *emu, uintptr_t fcn) { iFXibL__t fn = (iFXibL__t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXLbp__32(x64emu_t *emu, uintptr_t fcn) { iFXLbp__t fn = (iFXLbp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXLbL__32(x64emu_t *emu, uintptr_t fcn) { iFXLbL__t fn = (iFXLbL__t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXbL_i_32(x64emu_t *emu, uintptr_t fcn) { iFXbL_i_t fn = (iFXbL_i_t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFXbp_i_32(x64emu_t *emu, uintptr_t fcn) { iFXbp_i_t fn = (iFXbp_i_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFXBL_p_32(x64emu_t *emu, uintptr_t fcn) { iFXBL_p_t fn = (iFXBL_p_t)fcn; struct_L_t arg_8={0}; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFXbp_p_32(x64emu_t *emu, uintptr_t fcn) { iFXbp_p_t fn = (iFXbp_p_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFXbL_p_32(x64emu_t *emu, uintptr_t fcn) { iFXbL_p_t fn = (iFXbL_p_t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void IEpBp_i_32(x64emu_t *emu, uintptr_t fcn) { IEpBp_i_t fn = (IEpBp_i_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; ui64_t r; r.i = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); R_EAX = r.d[0]; R_EDX = r.d[1]; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void uFppbp__32(x64emu_t *emu, uintptr_t fcn) { uFppbp__t fn = (uFppbp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void uFpbp_p_32(x64emu_t *emu, uintptr_t fcn) { uFpbp_p_t fn = (uFpbp_p_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void UEpBp_i_32(x64emu_t *emu, uintptr_t fcn) { UEpBp_i_t fn = (UEpBp_i_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; ui64_t r; r.u = (uint64_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); R_EAX = r.d[0]; R_EDX = r.d[1]; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void fEpBp_p_32(x64emu_t *emu, uintptr_t fcn) { fEpBp_p_t fn = (fEpBp_p_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; float fl = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12)); fpu_do_push(emu); ST0val = fl; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void fEpBp_a_32(x64emu_t *emu, uintptr_t fcn) { fEpBp_a_t fn = (fEpBp_a_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; float fl = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_locale(from_ptri(ptr_t, R_ESP + 12))); fpu_do_push(emu); ST0val = fl; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void dEpBp_i_32(x64emu_t *emu, uintptr_t fcn) { dEpBp_i_t fn = (dEpBp_i_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; double db = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); fpu_do_push(emu); ST0val = db; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void dEpBp_a_32(x64emu_t *emu, uintptr_t fcn) { dEpBp_a_t fn = (dEpBp_a_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; double db = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_locale(from_ptri(ptr_t, R_ESP + 12))); fpu_do_push(emu); ST0val = db; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void lEpBp_i_32(x64emu_t *emu, uintptr_t fcn) { lEpBp_i_t fn = (lEpBp_i_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void lFpbp_L_32(x64emu_t *emu, uintptr_t fcn) { lFpbp_L_t fn = (lFpbp_L_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_long(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 12)))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void LEpBp_i_32(x64emu_t *emu, uintptr_t fcn) { LEpBp_i_t fn = (LEpBp_i_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void pFuXbl__32(x64emu_t *emu, uintptr_t fcn) { pFuXbl__t fn = (pFuXbl__t)fcn; struct_l_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_l(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), getDisplay(from_ptriv(R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void pFpibp__32(x64emu_t *emu, uintptr_t fcn) { pFpibp__t fn = (pFpibp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void pFpubl__32(x64emu_t *emu, uintptr_t fcn) { pFpubl__t fn = (pFpubl__t)fcn; struct_l_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_l(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void pEppbp__32(x64emu_t *emu, uintptr_t fcn) { pEppbp__t fn = (pEppbp__t)fcn; errno = emu->libc_err; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); emu->libc_err = errno; } +void pEppBp__32(x64emu_t *emu, uintptr_t fcn) { pEppBp__t fn = (pEppBp__t)fcn; errno = emu->libc_err; struct_p_t arg_12={0}; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); emu->libc_err = errno; } +void pFppbp__32(x64emu_t *emu, uintptr_t fcn) { pFppbp__t fn = (pFppbp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void pFXLbL__32(x64emu_t *emu, uintptr_t fcn) { pFXLbL__t fn = (pFXLbL__t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void pFnubp__32(x64emu_t *emu, uintptr_t fcn) { pFnubp__t fn = (pFnubp__t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(aligned_xcb, from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void pFnUbp__32(x64emu_t *emu, uintptr_t fcn) { pFnUbp__t fn = (pFnUbp__t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_ptrv(fn(aligned_xcb, from_ptri(uint64_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL)); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void vFpibpp__32(x64emu_t *emu, uintptr_t fcn) { vFpibpp__t fn = (vFpibpp__t)fcn; struct_pp_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pp(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pp(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFpbpu_u_32(x64emu_t *emu, uintptr_t fcn) { vFpbpu_u_t fn = (vFpbpu_u_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFpbpu_p_32(x64emu_t *emu, uintptr_t fcn) { vFpbpu_p_t fn = (vFpbpu_p_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFLbpi_i_32(x64emu_t *emu, uintptr_t fcn) { iFLbpi_i_t fn = (iFLbpi_i_t)fcn; struct_pi_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pi(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pi(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpibpu__32(x64emu_t *emu, uintptr_t fcn) { iFpibpu__t fn = (iFpibpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpibpp__32(x64emu_t *emu, uintptr_t fcn) { iFpibpp__t fn = (iFpibpp__t)fcn; struct_pp_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pp(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pp(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpubpu__32(x64emu_t *emu, uintptr_t fcn) { iFpubpu__t fn = (iFpubpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iEpprLL__32(x64emu_t *emu, uintptr_t fcn) { iEpprLL__t fn = (iEpprLL__t)fcn; errno = emu->libc_err; struct_LL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); emu->libc_err = errno; } +void iFppbpu__32(x64emu_t *emu, uintptr_t fcn) { iFppbpu__t fn = (iFppbpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_u_t fn = (iFpbpu_u_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbpu_p_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_p_t fn = (iFpbpu_p_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFXLbpp__32(x64emu_t *emu, uintptr_t fcn) { iFXLbpp__t fn = (iFXLbpp__t)fcn; struct_pp_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pp(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pp(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXbLC_i_32(x64emu_t *emu, uintptr_t fcn) { iFXbLC_i_t fn = (iFXbLC_i_t)fcn; struct_LC_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_LC(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_LC(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void uFpubpu__32(x64emu_t *emu, uintptr_t fcn) { uFpubpu__t fn = (uFpubpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFLbL_bL__32(x64emu_t *emu, uintptr_t fcn) { vFLbL_bL__t fn = (vFLbL_bL__t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFpbLdd_i_32(x64emu_t *emu, uintptr_t fcn) { vFpbLdd_i_t fn = (vFpbLdd_i_t)fcn; struct_Ldd_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_Ldd(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_Ldd(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFpbp_bp__32(x64emu_t *emu, uintptr_t fcn) { vFpbp_bp__t fn = (vFpbp_bp__t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbl_bl__32(x64emu_t *emu, uintptr_t fcn) { iFpbl_bl__t fn = (iFpbl_bl__t)fcn; struct_l_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_l(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_l_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_l(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbL_bL__32(x64emu_t *emu, uintptr_t fcn) { iFpbL_bL__t fn = (iFpbL_bL__t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbp_bp__32(x64emu_t *emu, uintptr_t fcn) { iFpbp_bp__t fn = (iFpbp_bp__t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFbp_pbp__32(x64emu_t *emu, uintptr_t fcn) { iFbp_pbp__t fn = (iFbp_pbp__t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFbp_bp_p_32(x64emu_t *emu, uintptr_t fcn) { iFbp_bp_p_t fn = (iFbp_bp_p_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFXbiip_i_32(x64emu_t *emu, uintptr_t fcn) { iFXbiip_i_t fn = (iFXbiip_i_t)fcn; struct_iip_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_iip(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_iip(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFXbLip_L_32(x64emu_t *emu, uintptr_t fcn) { iFXbLip_L_t fn = (iFXbLip_L_t)fcn; struct_Lip_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_Lip(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 12))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_Lip(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFXLbpLiL__32(x64emu_t *emu, uintptr_t fcn) { vFXLbpLiL__t fn = (vFXLbpLiL__t)fcn; struct_pLiL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pLiL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pLiL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFXLrpLiL__32(x64emu_t *emu, uintptr_t fcn) { vFXLrpLiL__t fn = (vFXLrpLiL__t)fcn; struct_pLiL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pLiL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); } +void iFbp_ubpu__32(x64emu_t *emu, uintptr_t fcn) { iFbp_ubpu__t fn = (iFbp_ubpu__t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFbpu_pbL__32(x64emu_t *emu, uintptr_t fcn) { iFbpu_pbL__t fn = (iFbpu_pbL__t)fcn; struct_pu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXLbpLiL__32(x64emu_t *emu, uintptr_t fcn) { iFXLbpLiL__t fn = (iFXLbpLiL__t)fcn; struct_pLiL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pLiL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pLiL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXLbLLii__32(x64emu_t *emu, uintptr_t fcn) { iFXLbLLii__t fn = (iFXLbLLii__t)fcn; struct_LLii_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LLii(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_LLii(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFpbpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { vFpbpu_bpu__t fn = (vFpbpu_bpu__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFubpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFubpu_bpu__t fn = (iFubpu_bpu__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu__t fn = (iFpbpu_bpu__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFbpu_bpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFbpu_bpu_u_t fn = (iFbpu_bpu_u_t)fcn; struct_pu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFXLbLWWWcc__32(x64emu_t *emu, uintptr_t fcn) { iFXLbLWWWcc__t fn = (iFXLbLWWWcc__t)fcn; struct_LWWWcc_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LWWWcc(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFppbppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { vFppbppuuuuup__t fn = (vFppbppuuuuup__t)fcn; struct_ppuuuuup_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_ppuuuuup(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFbppuuuuup_pp_32(x64emu_t *emu, uintptr_t fcn) { vFbppuuuuup_pp_t fn = (vFbppuuuuup_pp_t)fcn; struct_ppuuuuup_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuuuuup(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFppbppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { iFppbppuuuuup__t fn = (iFppbppuuuuup__t)fcn; struct_ppuuuuup_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_ppuuuuup(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFbpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFbpu_bpu_bpu__t fn = (iFbpu_bpu_bpu__t)fcn; struct_pu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void uFppbppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { uFppbppuuuuup__t fn = (uFppbppuuuuup__t)fcn; struct_ppuuuuup_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_ppuuuuup(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void LFppbppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { LFppbppuuuuup__t fn = (LFppbppuuuuup__t)fcn; struct_ppuuuuup_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_ppuuuuup(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void pFpibppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { pFpibppuuuuup__t fn = (pFpibppuuuuup__t)fcn; struct_ppuuuuup_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_ppuuuuup(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iEirLLLL_BLLLL__32(x64emu_t *emu, uintptr_t fcn) { iEirLLLL_BLLLL__t fn = (iEirLLLL_BLLLL__t)fcn; errno = emu->libc_err; struct_LLLL_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_LLLL(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_LLLL_t arg_12={0}; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_LLLL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); emu->libc_err = errno; } +void pEppriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fcn) { pEppriiiiiiiiilt__t fn = (pEppriiiiiiiiilt__t)fcn; errno = emu->libc_err; struct_iiiiiiiiilt_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_iiiiiiiiilt(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); emu->libc_err = errno; } +void pFXrLiiwwwwwwwwL_p_32(x64emu_t *emu, uintptr_t fcn) { pFXrLiiwwwwwwwwL_p_t fn = (pFXrLiiwwwwwwwwL_p_t)fcn; struct_LiiwwwwwwwwL_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_LiiwwwwwwwwL(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12))); } +void vFbppuiiiiiiiiipp_pp_32(x64emu_t *emu, uintptr_t fcn) { vFbppuiiiiiiiiipp_pp_t fn = (vFbppuiiiiiiiiipp_pp_t)fcn; struct_ppuiiiiiiiiipp_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuiiiiiiiiipp(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void vEEipp_32(x64emu_t *emu, uintptr_t fcn) { vEEipp_t fn = (vEEipp_t)fcn; errno = emu->libc_err; fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void vFEipp_32(x64emu_t *emu, uintptr_t fcn) { vFEipp_t fn = (vFEipp_t)fcn; fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vEEipV_32(x64emu_t *emu, uintptr_t fcn) { vEEipV_t fn = (vEEipV_t)fcn; errno = emu->libc_err; fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptrv(R_ESP + 12)); emu->libc_err = errno; } +void vFEpui_32(x64emu_t *emu, uintptr_t fcn) { vFEpui_t fn = (vFEpui_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void vEEpuu_32(x64emu_t *emu, uintptr_t fcn) { vEEpuu_t fn = (vEEpuu_t)fcn; errno = emu->libc_err; fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); emu->libc_err = errno; } +void vEEpup_32(x64emu_t *emu, uintptr_t fcn) { vEEpup_t fn = (vEEpup_t)fcn; errno = emu->libc_err; fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void vFEpup_32(x64emu_t *emu, uintptr_t fcn) { vFEpup_t fn = (vFEpup_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vFEpll_32(x64emu_t *emu, uintptr_t fcn) { vFEpll_t fn = (vFEpll_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12))); } +void vEEppp_32(x64emu_t *emu, uintptr_t fcn) { vEEppp_t fn = (vEEppp_t)fcn; errno = emu->libc_err; fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void vFEppp_32(x64emu_t *emu, uintptr_t fcn) { vFEppp_t fn = (vFEppp_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void vFEXLp_32(x64emu_t *emu, uintptr_t fcn) { vFEXLp_t fn = (vFEXLp_t)fcn; fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void vFEXpi_32(x64emu_t *emu, uintptr_t fcn) { vFEXpi_t fn = (vFEXpi_t)fcn; fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void vFcccc_32(x64emu_t *emu, uintptr_t fcn) { vFcccc_t fn = (vFcccc_t)fcn; fn(from_ptri(int8_t, R_ESP + 4), from_ptri(int8_t, R_ESP + 8), from_ptri(int8_t, R_ESP + 12), from_ptri(int8_t, R_ESP + 16)); } +void vFwwww_32(x64emu_t *emu, uintptr_t fcn) { vFwwww_t fn = (vFwwww_t)fcn; fn(from_ptri(int16_t, R_ESP + 4), from_ptri(int16_t, R_ESP + 8), from_ptri(int16_t, R_ESP + 12), from_ptri(int16_t, R_ESP + 16)); } +void vFiiii_32(x64emu_t *emu, uintptr_t fcn) { vFiiii_t fn = (vFiiii_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFiiip_32(x64emu_t *emu, uintptr_t fcn) { vFiiip_t fn = (vFiiip_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFiiCp_32(x64emu_t *emu, uintptr_t fcn) { vFiiCp_t fn = (vFiiCp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFiill_32(x64emu_t *emu, uintptr_t fcn) { vFiill_t fn = (vFiill_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16))); } +void vFiIII_32(x64emu_t *emu, uintptr_t fcn) { vFiIII_t fn = (vFiIII_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 16), from_ptri(int64_t, R_ESP + 24)); } +void vFiuip_32(x64emu_t *emu, uintptr_t fcn) { vFiuip_t fn = (vFiuip_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFiuuu_32(x64emu_t *emu, uintptr_t fcn) { vFiuuu_t fn = (vFiuuu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void vFiulp_32(x64emu_t *emu, uintptr_t fcn) { vFiulp_t fn = (vFiulp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void vFiupV_32(x64emu_t *emu, uintptr_t fcn) { vFiupV_t fn = (vFiupV_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptrv(R_ESP + 16)); } +void vFiUUU_32(x64emu_t *emu, uintptr_t fcn) { vFiUUU_t fn = (vFiUUU_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 16), from_ptri(uint64_t, R_ESP + 24)); } +void vFifff_32(x64emu_t *emu, uintptr_t fcn) { vFifff_t fn = (vFifff_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16)); } +void vFiddd_32(x64emu_t *emu, uintptr_t fcn) { vFiddd_t fn = (vFiddd_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24)); } +void vFilip_32(x64emu_t *emu, uintptr_t fcn) { vFilip_t fn = (vFilip_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFilpu_32(x64emu_t *emu, uintptr_t fcn) { vFilpu_t fn = (vFilpu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void vFilpp_32(x64emu_t *emu, uintptr_t fcn) { vFilpp_t fn = (vFilpp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFipup_32(x64emu_t *emu, uintptr_t fcn) { vFipup_t fn = (vFipup_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFipll_32(x64emu_t *emu, uintptr_t fcn) { vFipll_t fn = (vFipll_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16))); } +void vFippp_32(x64emu_t *emu, uintptr_t fcn) { vFippp_t fn = (vFippp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFCCCC_32(x64emu_t *emu, uintptr_t fcn) { vFCCCC_t fn = (vFCCCC_t)fcn; fn(from_ptri(uint8_t, R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16)); } +void vFWWWW_32(x64emu_t *emu, uintptr_t fcn) { vFWWWW_t fn = (vFWWWW_t)fcn; fn(from_ptri(uint16_t, R_ESP + 4), from_ptri(uint16_t, R_ESP + 8), from_ptri(uint16_t, R_ESP + 12), from_ptri(uint16_t, R_ESP + 16)); } +void vFuccc_32(x64emu_t *emu, uintptr_t fcn) { vFuccc_t fn = (vFuccc_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int8_t, R_ESP + 8), from_ptri(int8_t, R_ESP + 12), from_ptri(int8_t, R_ESP + 16)); } +void vFuwww_32(x64emu_t *emu, uintptr_t fcn) { vFuwww_t fn = (vFuwww_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int16_t, R_ESP + 8), from_ptri(int16_t, R_ESP + 12), from_ptri(int16_t, R_ESP + 16)); } +void vFuiii_32(x64emu_t *emu, uintptr_t fcn) { vFuiii_t fn = (vFuiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFuiip_32(x64emu_t *emu, uintptr_t fcn) { vFuiip_t fn = (vFuiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFuiII_32(x64emu_t *emu, uintptr_t fcn) { vFuiII_t fn = (vFuiII_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 12), from_ptri(int64_t, R_ESP + 20)); } +void vFuiui_32(x64emu_t *emu, uintptr_t fcn) { vFuiui_t fn = (vFuiui_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFuiuC_32(x64emu_t *emu, uintptr_t fcn) { vFuiuC_t fn = (vFuiuC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16)); } +void vFuiuu_32(x64emu_t *emu, uintptr_t fcn) { vFuiuu_t fn = (vFuiuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void vFuiup_32(x64emu_t *emu, uintptr_t fcn) { vFuiup_t fn = (vFuiup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFuiUU_32(x64emu_t *emu, uintptr_t fcn) { vFuiUU_t fn = (vFuiUU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 12), from_ptri(uint64_t, R_ESP + 20)); } +void vFuifi_32(x64emu_t *emu, uintptr_t fcn) { vFuifi_t fn = (vFuifi_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFuiff_32(x64emu_t *emu, uintptr_t fcn) { vFuiff_t fn = (vFuiff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16)); } +void vFuidd_32(x64emu_t *emu, uintptr_t fcn) { vFuidd_t fn = (vFuidd_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20)); } +void vFuilp_32(x64emu_t *emu, uintptr_t fcn) { vFuilp_t fn = (vFuilp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void vFuipu_32(x64emu_t *emu, uintptr_t fcn) { vFuipu_t fn = (vFuipu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void vFuipp_32(x64emu_t *emu, uintptr_t fcn) { vFuipp_t fn = (vFuipp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFuIII_32(x64emu_t *emu, uintptr_t fcn) { vFuIII_t fn = (vFuIII_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 16), from_ptri(int64_t, R_ESP + 24)); } +void vFuWWW_32(x64emu_t *emu, uintptr_t fcn) { vFuWWW_t fn = (vFuWWW_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint16_t, R_ESP + 8), from_ptri(uint16_t, R_ESP + 12), from_ptri(uint16_t, R_ESP + 16)); } +void vFuuii_32(x64emu_t *emu, uintptr_t fcn) { vFuuii_t fn = (vFuuii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFuuiu_32(x64emu_t *emu, uintptr_t fcn) { vFuuiu_t fn = (vFuuiu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void vFuuil_32(x64emu_t *emu, uintptr_t fcn) { vFuuil_t fn = (vFuuil_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16))); } +void vFuuip_32(x64emu_t *emu, uintptr_t fcn) { vFuuip_t fn = (vFuuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFuuCu_32(x64emu_t *emu, uintptr_t fcn) { vFuuCu_t fn = (vFuuCu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void vFuuCp_32(x64emu_t *emu, uintptr_t fcn) { vFuuCp_t fn = (vFuuCp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFuuui_32(x64emu_t *emu, uintptr_t fcn) { vFuuui_t fn = (vFuuui_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuuu_t fn = (vFuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void vFuuuf_32(x64emu_t *emu, uintptr_t fcn) { vFuuuf_t fn = (vFuuuf_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(float, R_ESP + 16)); } +void vFuuud_32(x64emu_t *emu, uintptr_t fcn) { vFuuud_t fn = (vFuuud_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(double, R_ESP + 16)); } +void vFuuul_32(x64emu_t *emu, uintptr_t fcn) { vFuuul_t fn = (vFuuul_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16))); } +void vFuuup_32(x64emu_t *emu, uintptr_t fcn) { vFuuup_t fn = (vFuuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFuuUl_32(x64emu_t *emu, uintptr_t fcn) { vFuuUl_t fn = (vFuuUl_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 20))); } +void vFuuff_32(x64emu_t *emu, uintptr_t fcn) { vFuuff_t fn = (vFuuff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16)); } +void vFuuli_32(x64emu_t *emu, uintptr_t fcn) { vFuuli_t fn = (vFuuli_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16)); } +void vFuupi_32(x64emu_t *emu, uintptr_t fcn) { vFuupi_t fn = (vFuupi_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFuupp_32(x64emu_t *emu, uintptr_t fcn) { vFuupp_t fn = (vFuupp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFuUui_32(x64emu_t *emu, uintptr_t fcn) { vFuUui_t fn = (vFuUui_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuUup_32(x64emu_t *emu, uintptr_t fcn) { vFuUup_t fn = (vFuUup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuUUU_32(x64emu_t *emu, uintptr_t fcn) { vFuUUU_t fn = (vFuUUU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 16), from_ptri(uint64_t, R_ESP + 24)); } +void vFufff_32(x64emu_t *emu, uintptr_t fcn) { vFufff_t fn = (vFufff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16)); } +void vFuddd_32(x64emu_t *emu, uintptr_t fcn) { vFuddd_t fn = (vFuddd_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24)); } +void vFuluU_32(x64emu_t *emu, uintptr_t fcn) { vFuluU_t fn = (vFuluU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint64_t, R_ESP + 16)); } +void vFullC_32(x64emu_t *emu, uintptr_t fcn) { vFullC_t fn = (vFullC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12)), from_ptri(uint8_t, R_ESP + 16)); } +void vFullp_32(x64emu_t *emu, uintptr_t fcn) { vFullp_t fn = (vFullp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void vFulpu_32(x64emu_t *emu, uintptr_t fcn) { vFulpu_t fn = (vFulpu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void vFulpp_32(x64emu_t *emu, uintptr_t fcn) { vFulpp_t fn = (vFulpp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFupii_32(x64emu_t *emu, uintptr_t fcn) { vFupii_t fn = (vFupii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFuppi_32(x64emu_t *emu, uintptr_t fcn) { vFuppi_t fn = (vFuppi_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFuppu_32(x64emu_t *emu, uintptr_t fcn) { vFuppu_t fn = (vFuppu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void vFUUpi_32(x64emu_t *emu, uintptr_t fcn) { vFUUpi_t fn = (vFUUpi_t)fcn; fn(from_ptri(uint64_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 12), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFffff_32(x64emu_t *emu, uintptr_t fcn) { vFffff_t fn = (vFffff_t)fcn; fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16)); } +void vFdddd_32(x64emu_t *emu, uintptr_t fcn) { vFdddd_t fn = (vFdddd_t)fcn; fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28)); } +void vFllii_32(x64emu_t *emu, uintptr_t fcn) { vFllii_t fn = (vFllii_t)fcn; fn(from_long(from_ptri(long_t, R_ESP + 4)), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFLiii_32(x64emu_t *emu, uintptr_t fcn) { vFLiii_t fn = (vFLiii_t)fcn; fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFpiip_32(x64emu_t *emu, uintptr_t fcn) { vFpiip_t fn = (vFpiip_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFpipi_32(x64emu_t *emu, uintptr_t fcn) { vFpipi_t fn = (vFpipi_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFpipp_32(x64emu_t *emu, uintptr_t fcn) { vFpipp_t fn = (vFpipp_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFpudd_32(x64emu_t *emu, uintptr_t fcn) { vFpudd_t fn = (vFpudd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20)); } +void vFpdii_32(x64emu_t *emu, uintptr_t fcn) { vFpdii_t fn = (vFpdii_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFpddd_32(x64emu_t *emu, uintptr_t fcn) { vFpddd_t fn = (vFpddd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24)); } +void vFplpp_32(x64emu_t *emu, uintptr_t fcn) { vFplpp_t fn = (vFplpp_t)fcn; fn(from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFppid_32(x64emu_t *emu, uintptr_t fcn) { vFppid_t fn = (vFppid_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(double, R_ESP + 16)); } +void vEppip_32(x64emu_t *emu, uintptr_t fcn) { vEppip_t fn = (vEppip_t)fcn; errno = emu->libc_err; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void vFppui_32(x64emu_t *emu, uintptr_t fcn) { vFppui_t fn = (vFppui_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFppuu_32(x64emu_t *emu, uintptr_t fcn) { vFppuu_t fn = (vFppuu_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void vFppdd_32(x64emu_t *emu, uintptr_t fcn) { vFppdd_t fn = (vFppdd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20)); } +void vFpppp_32(x64emu_t *emu, uintptr_t fcn) { vFpppp_t fn = (vFpppp_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFXiiL_32(x64emu_t *emu, uintptr_t fcn) { vFXiiL_t fn = (vFXiiL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void vFXiLu_32(x64emu_t *emu, uintptr_t fcn) { vFXiLu_t fn = (vFXiLu_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16)); } +void vFXLii_32(x64emu_t *emu, uintptr_t fcn) { vFXLii_t fn = (vFXLii_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFXLip_32(x64emu_t *emu, uintptr_t fcn) { vFXLip_t fn = (vFXLip_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFXLuu_32(x64emu_t *emu, uintptr_t fcn) { vFXLuu_t fn = (vFXLuu_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void vFXLLL_32(x64emu_t *emu, uintptr_t fcn) { vFXLLL_t fn = (vFXLLL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void vFXLLp_32(x64emu_t *emu, uintptr_t fcn) { vFXLLp_t fn = (vFXLLp_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void vFXLpi_32(x64emu_t *emu, uintptr_t fcn) { vFXLpi_t fn = (vFXLpi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void vFXLpL_32(x64emu_t *emu, uintptr_t fcn) { vFXLpL_t fn = (vFXLpL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void vFXpip_32(x64emu_t *emu, uintptr_t fcn) { vFXpip_t fn = (vFXpip_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFXppL_32(x64emu_t *emu, uintptr_t fcn) { vFXppL_t fn = (vFXppL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void cFpiii_32(x64emu_t *emu, uintptr_t fcn) { cFpiii_t fn = (cFpiii_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iEEiip_32(x64emu_t *emu, uintptr_t fcn) { iEEiip_t fn = (iEEiip_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iEEiiN_32(x64emu_t *emu, uintptr_t fcn) { iEEiiN_t fn = (iEEiiN_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iEEiLp_32(x64emu_t *emu, uintptr_t fcn) { iEEiLp_t fn = (iEEiLp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iEEipp_32(x64emu_t *emu, uintptr_t fcn) { iEEipp_t fn = (iEEipp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iFEipp_32(x64emu_t *emu, uintptr_t fcn) { iFEipp_t fn = (iFEipp_t)fcn; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iEEipV_32(x64emu_t *emu, uintptr_t fcn) { iEEipV_t fn = (iEEipV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptrv(R_ESP + 12)); emu->libc_err = errno; } +void iEEpii_32(x64emu_t *emu, uintptr_t fcn) { iEEpii_t fn = (iEEpii_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); emu->libc_err = errno; } +void iEEpip_32(x64emu_t *emu, uintptr_t fcn) { iEEpip_t fn = (iEEpip_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iFEpip_32(x64emu_t *emu, uintptr_t fcn) { iFEpip_t fn = (iFEpip_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFEpui_32(x64emu_t *emu, uintptr_t fcn) { iFEpui_t fn = (iFEpui_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void iFEpuu_32(x64emu_t *emu, uintptr_t fcn) { iFEpuu_t fn = (iFEpuu_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void iEEpup_32(x64emu_t *emu, uintptr_t fcn) { iEEpup_t fn = (iEEpup_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iFEpup_32(x64emu_t *emu, uintptr_t fcn) { iFEpup_t fn = (iFEpup_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFEpll_32(x64emu_t *emu, uintptr_t fcn) { iFEpll_t fn = (iFEpll_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12))); } +void iEEpLi_32(x64emu_t *emu, uintptr_t fcn) { iEEpLi_t fn = (iEEpLi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12)); emu->libc_err = errno; } +void iFEpLi_32(x64emu_t *emu, uintptr_t fcn) { iFEpLi_t fn = (iFEpLi_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12)); } +void iEEppi_32(x64emu_t *emu, uintptr_t fcn) { iEEppi_t fn = (iEEppi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); emu->libc_err = errno; } +void iFEppi_32(x64emu_t *emu, uintptr_t fcn) { iFEppi_t fn = (iFEppi_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void iFEppu_32(x64emu_t *emu, uintptr_t fcn) { iFEppu_t fn = (iFEppu_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } +void iEEppL_32(x64emu_t *emu, uintptr_t fcn) { iEEppL_t fn = (iEEppL_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12))); emu->libc_err = errno; } +void iEEppp_32(x64emu_t *emu, uintptr_t fcn) { iEEppp_t fn = (iEEppp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iFEppp_32(x64emu_t *emu, uintptr_t fcn) { iFEppp_t fn = (iFEppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iEEppV_32(x64emu_t *emu, uintptr_t fcn) { iEEppV_t fn = (iEEppV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptrv(R_ESP + 12)); emu->libc_err = errno; } +void iFEppV_32(x64emu_t *emu, uintptr_t fcn) { iFEppV_t fn = (iFEppV_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptrv(R_ESP + 12)); } +void iEEpON_32(x64emu_t *emu, uintptr_t fcn) { iEEpON_t fn = (iEEpON_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), of_convert32(from_ptri(int32_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iEEhup_32(x64emu_t *emu, uintptr_t fcn) { iEEhup_t fn = (iEEhup_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iEESpp_32(x64emu_t *emu, uintptr_t fcn) { iEESpp_t fn = (iEESpp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, io_convert32(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; } +void iEESpV_32(x64emu_t *emu, uintptr_t fcn) { iEESpV_t fn = (iEESpV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, io_convert32(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptrv(R_ESP + 12)); emu->libc_err = errno; } +void iFEXip_32(x64emu_t *emu, uintptr_t fcn) { iFEXip_t fn = (iFEXip_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFEXup_32(x64emu_t *emu, uintptr_t fcn) { iFEXup_t fn = (iFEXup_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFEXlp_32(x64emu_t *emu, uintptr_t fcn) { iFEXlp_t fn = (iFEXlp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void iFEXLp_32(x64emu_t *emu, uintptr_t fcn) { iFEXLp_t fn = (iFEXLp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } +void iFEXpp_32(x64emu_t *emu, uintptr_t fcn) { iFEXpp_t fn = (iFEXpp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFiiii_32(x64emu_t *emu, uintptr_t fcn) { iFiiii_t fn = (iFiiii_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFiiiu_32(x64emu_t *emu, uintptr_t fcn) { iFiiiu_t fn = (iFiiiu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iEiiip_32(x64emu_t *emu, uintptr_t fcn) { iEiiip_t fn = (iEiiip_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iEiiiN_32(x64emu_t *emu, uintptr_t fcn) { iEiiiN_t fn = (iEiiiN_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iEiiII_32(x64emu_t *emu, uintptr_t fcn) { iEiiII_t fn = (iEiiII_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 12), from_ptri(int64_t, R_ESP + 20)); emu->libc_err = errno; } +void iEiIIi_32(x64emu_t *emu, uintptr_t fcn) { iEiIIi_t fn = (iEiIIi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 24)); emu->libc_err = errno; } +void iFiuii_32(x64emu_t *emu, uintptr_t fcn) { iFiuii_t fn = (iFiuii_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFiuuU_32(x64emu_t *emu, uintptr_t fcn) { iFiuuU_t fn = (iFiuuU_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint64_t, R_ESP + 16)); } +void iFiuup_32(x64emu_t *emu, uintptr_t fcn) { iFiuup_t fn = (iFiuup_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFiupu_32(x64emu_t *emu, uintptr_t fcn) { iFiupu_t fn = (iFiupu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iFiupp_32(x64emu_t *emu, uintptr_t fcn) { iFiupp_t fn = (iFiupp_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iEilli_32(x64emu_t *emu, uintptr_t fcn) { iEilli_t fn = (iEilli_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16)); emu->libc_err = errno; } +void iFiLpL_32(x64emu_t *emu, uintptr_t fcn) { iFiLpL_t fn = (iFiLpL_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void iEipii_32(x64emu_t *emu, uintptr_t fcn) { iEipii_t fn = (iEipii_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); emu->libc_err = errno; } +void iEipip_32(x64emu_t *emu, uintptr_t fcn) { iEipip_t fn = (iEipip_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iEipui_32(x64emu_t *emu, uintptr_t fcn) { iEipui_t fn = (iEipui_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); emu->libc_err = errno; } +void iFipup_32(x64emu_t *emu, uintptr_t fcn) { iFipup_t fn = (iFipup_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFipLp_32(x64emu_t *emu, uintptr_t fcn) { iFipLp_t fn = (iFipLp_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void iEippi_32(x64emu_t *emu, uintptr_t fcn) { iEippi_t fn = (iEippi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); emu->libc_err = errno; } +void iFippu_32(x64emu_t *emu, uintptr_t fcn) { iFippu_t fn = (iFippu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iEippL_32(x64emu_t *emu, uintptr_t fcn) { iEippL_t fn = (iEippL_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); emu->libc_err = errno; } +void iFippp_32(x64emu_t *emu, uintptr_t fcn) { iFippp_t fn = (iFippp_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iEipON_32(x64emu_t *emu, uintptr_t fcn) { iEipON_t fn = (iEipON_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), of_convert32(from_ptri(int32_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iFuiup_32(x64emu_t *emu, uintptr_t fcn) { iFuiup_t fn = (iFuiup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFupLp_32(x64emu_t *emu, uintptr_t fcn) { iFupLp_t fn = (iFupLp_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void iFuppp_32(x64emu_t *emu, uintptr_t fcn) { iFuppp_t fn = (iFuppp_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFUpLp_32(x64emu_t *emu, uintptr_t fcn) { iFUpLp_t fn = (iFUpLp_t)fcn; R_EAX = fn(from_ptri(uint64_t, R_ESP + 4), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20)); } +void iFpiii_32(x64emu_t *emu, uintptr_t fcn) { iFpiii_t fn = (iFpiii_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFpiiL_32(x64emu_t *emu, uintptr_t fcn) { iFpiiL_t fn = (iFpiiL_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void iFpiip_32(x64emu_t *emu, uintptr_t fcn) { iFpiip_t fn = (iFpiip_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFpiII_32(x64emu_t *emu, uintptr_t fcn) { iFpiII_t fn = (iFpiII_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 12), from_ptri(int64_t, R_ESP + 20)); } +void iFpiuu_32(x64emu_t *emu, uintptr_t fcn) { iFpiuu_t fn = (iFpiuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iFpili_32(x64emu_t *emu, uintptr_t fcn) { iFpili_t fn = (iFpili_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16)); } +void iFpipu_32(x64emu_t *emu, uintptr_t fcn) { iFpipu_t fn = (iFpipu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iFpipL_32(x64emu_t *emu, uintptr_t fcn) { iFpipL_t fn = (iFpipL_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void iEpipp_32(x64emu_t *emu, uintptr_t fcn) { iEpipp_t fn = (iEpipp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iFpipp_32(x64emu_t *emu, uintptr_t fcn) { iFpipp_t fn = (iFpipp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFpCCC_32(x64emu_t *emu, uintptr_t fcn) { iFpCCC_t fn = (iFpCCC_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16)); } +void iFpWWu_32(x64emu_t *emu, uintptr_t fcn) { iFpWWu_t fn = (iFpWWu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint16_t, R_ESP + 8), from_ptri(uint16_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iEpuiL_32(x64emu_t *emu, uintptr_t fcn) { iEpuiL_t fn = (iEpuiL_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); emu->libc_err = errno; } +void iFpuuu_32(x64emu_t *emu, uintptr_t fcn) { iFpuuu_t fn = (iFpuuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iFpuuU_32(x64emu_t *emu, uintptr_t fcn) { iFpuuU_t fn = (iFpuuU_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint64_t, R_ESP + 16)); } +void iFpuup_32(x64emu_t *emu, uintptr_t fcn) { iFpuup_t fn = (iFpuup_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFpuLp_32(x64emu_t *emu, uintptr_t fcn) { iFpuLp_t fn = (iFpuLp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void iFpupi_32(x64emu_t *emu, uintptr_t fcn) { iFpupi_t fn = (iFpupi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFpupu_32(x64emu_t *emu, uintptr_t fcn) { iFpupu_t fn = (iFpupu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iFpupL_32(x64emu_t *emu, uintptr_t fcn) { iFpupL_t fn = (iFpupL_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void iFpupp_32(x64emu_t *emu, uintptr_t fcn) { iFpupp_t fn = (iFpupp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFpLuu_32(x64emu_t *emu, uintptr_t fcn) { iFpLuu_t fn = (iFpLuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iFpLpp_32(x64emu_t *emu, uintptr_t fcn) { iFpLpp_t fn = (iFpLpp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFppii_32(x64emu_t *emu, uintptr_t fcn) { iFppii_t fn = (iFppii_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFppiU_32(x64emu_t *emu, uintptr_t fcn) { iFppiU_t fn = (iFppiU_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint64_t, R_ESP + 16)); } +void iFppip_32(x64emu_t *emu, uintptr_t fcn) { iFppip_t fn = (iFppip_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFppWp_32(x64emu_t *emu, uintptr_t fcn) { iFppWp_t fn = (iFppWp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint16_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFppuw_32(x64emu_t *emu, uintptr_t fcn) { iFppuw_t fn = (iFppuw_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int16_t, R_ESP + 16)); } +void iFppui_32(x64emu_t *emu, uintptr_t fcn) { iFppui_t fn = (iFppui_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFppuu_32(x64emu_t *emu, uintptr_t fcn) { iFppuu_t fn = (iFppuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iFppup_32(x64emu_t *emu, uintptr_t fcn) { iFppup_t fn = (iFppup_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFppLi_32(x64emu_t *emu, uintptr_t fcn) { iFppLi_t fn = (iFppLi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16)); } +void iFppLI_32(x64emu_t *emu, uintptr_t fcn) { iFppLI_t fn = (iFppLI_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int64_t, R_ESP + 16)); } +void iFppLu_32(x64emu_t *emu, uintptr_t fcn) { iFppLu_t fn = (iFppLu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16)); } +void iFppLp_32(x64emu_t *emu, uintptr_t fcn) { iFppLp_t fn = (iFppLp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void iFpppi_32(x64emu_t *emu, uintptr_t fcn) { iFpppi_t fn = (iFpppi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFpppu_32(x64emu_t *emu, uintptr_t fcn) { iFpppu_t fn = (iFpppu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iEpppL_32(x64emu_t *emu, uintptr_t fcn) { iEpppL_t fn = (iEpppL_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); emu->libc_err = errno; } +void iFpppL_32(x64emu_t *emu, uintptr_t fcn) { iFpppL_t fn = (iFpppL_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void iEpppp_32(x64emu_t *emu, uintptr_t fcn) { iEpppp_t fn = (iEpppp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iFpppp_32(x64emu_t *emu, uintptr_t fcn) { iFpppp_t fn = (iFpppp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iESpiL_32(x64emu_t *emu, uintptr_t fcn) { iESpiL_t fn = (iESpiL_t)fcn; errno = emu->libc_err; R_EAX = fn(io_convert32(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); emu->libc_err = errno; } +void iFXiii_32(x64emu_t *emu, uintptr_t fcn) { iFXiii_t fn = (iFXiii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFXiiL_32(x64emu_t *emu, uintptr_t fcn) { iFXiiL_t fn = (iFXiiL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void iFXiip_32(x64emu_t *emu, uintptr_t fcn) { iFXiip_t fn = (iFXiip_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFXiuL_32(x64emu_t *emu, uintptr_t fcn) { iFXiuL_t fn = (iFXiuL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void iFXiLL_32(x64emu_t *emu, uintptr_t fcn) { iFXiLL_t fn = (iFXiLL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void iFXipi_32(x64emu_t *emu, uintptr_t fcn) { iFXipi_t fn = (iFXipi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFXipp_32(x64emu_t *emu, uintptr_t fcn) { iFXipp_t fn = (iFXipp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFXWWW_32(x64emu_t *emu, uintptr_t fcn) { iFXWWW_t fn = (iFXWWW_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint16_t, R_ESP + 8), from_ptri(uint16_t, R_ESP + 12), from_ptri(uint16_t, R_ESP + 16)); } +void iFXuuu_32(x64emu_t *emu, uintptr_t fcn) { iFXuuu_t fn = (iFXuuu_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iFXuuL_32(x64emu_t *emu, uintptr_t fcn) { iFXuuL_t fn = (iFXuuL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void iFXuup_32(x64emu_t *emu, uintptr_t fcn) { iFXuup_t fn = (iFXuup_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFXuLL_32(x64emu_t *emu, uintptr_t fcn) { iFXuLL_t fn = (iFXuLL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void iFXupp_32(x64emu_t *emu, uintptr_t fcn) { iFXupp_t fn = (iFXupp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFXLii_32(x64emu_t *emu, uintptr_t fcn) { iFXLii_t fn = (iFXLii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFXLiL_32(x64emu_t *emu, uintptr_t fcn) { iFXLiL_t fn = (iFXLiL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void iFXLip_32(x64emu_t *emu, uintptr_t fcn) { iFXLip_t fn = (iFXLip_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFXLuu_32(x64emu_t *emu, uintptr_t fcn) { iFXLuu_t fn = (iFXLuu_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iFXLLL_32(x64emu_t *emu, uintptr_t fcn) { iFXLLL_t fn = (iFXLLL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void iFXLLp_32(x64emu_t *emu, uintptr_t fcn) { iFXLLp_t fn = (iFXLLp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void iFXLpi_32(x64emu_t *emu, uintptr_t fcn) { iFXLpi_t fn = (iFXLpi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFXpii_32(x64emu_t *emu, uintptr_t fcn) { iFXpii_t fn = (iFXpii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFXpip_32(x64emu_t *emu, uintptr_t fcn) { iFXpip_t fn = (iFXpip_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFXpLp_32(x64emu_t *emu, uintptr_t fcn) { iFXpLp_t fn = (iFXpLp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void iFXppi_32(x64emu_t *emu, uintptr_t fcn) { iFXppi_t fn = (iFXppi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFXppp_32(x64emu_t *emu, uintptr_t fcn) { iFXppp_t fn = (iFXppp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void IFEpIi_32(x64emu_t *emu, uintptr_t fcn) { IFEpIi_t fn = (IFEpIi_t)fcn; ui64_t r; r.i = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 16)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void CFuuff_32(x64emu_t *emu, uintptr_t fcn) { CFuuff_t fn = (CFuuff_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16)); } +void uFEuip_32(x64emu_t *emu, uintptr_t fcn) { uFEuip_t fn = (uFEuip_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void uFEpii_32(x64emu_t *emu, uintptr_t fcn) { uFEpii_t fn = (uFEpii_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } +void uFEpip_32(x64emu_t *emu, uintptr_t fcn) { uFEpip_t fn = (uFEpip_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void uFEpiV_32(x64emu_t *emu, uintptr_t fcn) { uFEpiV_t fn = (uFEpiV_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptrv(R_ESP + 12)); } +void uFEpup_32(x64emu_t *emu, uintptr_t fcn) { uFEpup_t fn = (uFEpup_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void uFEpLL_32(x64emu_t *emu, uintptr_t fcn) { uFEpLL_t fn = (uFEpLL_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12))); } +void uFuuuu_32(x64emu_t *emu, uintptr_t fcn) { uFuuuu_t fn = (uFuuuu_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void uFuppd_32(x64emu_t *emu, uintptr_t fcn) { uFuppd_t fn = (uFuppd_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(double, R_ESP + 16)); } +void uFpiip_32(x64emu_t *emu, uintptr_t fcn) { uFpiip_t fn = (uFpiip_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void uFpCCC_32(x64emu_t *emu, uintptr_t fcn) { uFpCCC_t fn = (uFpCCC_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16)); } +void uFppii_32(x64emu_t *emu, uintptr_t fcn) { uFppii_t fn = (uFppii_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void uFppip_32(x64emu_t *emu, uintptr_t fcn) { uFppip_t fn = (uFppip_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void uFpppi_32(x64emu_t *emu, uintptr_t fcn) { uFpppi_t fn = (uFpppi_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void uFpppd_32(x64emu_t *emu, uintptr_t fcn) { uFpppd_t fn = (uFpppd_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(double, R_ESP + 16)); } +void uFpppp_32(x64emu_t *emu, uintptr_t fcn) { uFpppp_t fn = (uFpppp_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void lEEipi_32(x64emu_t *emu, uintptr_t fcn) { lEEipi_t fn = (lEEipi_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); emu->libc_err = errno; } +void lEEipL_32(x64emu_t *emu, uintptr_t fcn) { lEEipL_t fn = (lEEipL_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); emu->libc_err = errno; } +void lEEppL_32(x64emu_t *emu, uintptr_t fcn) { lEEppL_t fn = (lEEppL_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); emu->libc_err = errno; } +void lEiipL_32(x64emu_t *emu, uintptr_t fcn) { lEiipL_t fn = (lEiipL_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)))); emu->libc_err = errno; } +void lEipLi_32(x64emu_t *emu, uintptr_t fcn) { lEipLi_t fn = (lEipLi_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16))); emu->libc_err = errno; } +void lEipLI_32(x64emu_t *emu, uintptr_t fcn) { lEipLI_t fn = (lEipLI_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int64_t, R_ESP + 16))); emu->libc_err = errno; } +void lEipLl_32(x64emu_t *emu, uintptr_t fcn) { lEipLl_t fn = (lEipLl_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16)))); emu->libc_err = errno; } +void lEipLL_32(x64emu_t *emu, uintptr_t fcn) { lEipLL_t fn = (lEipLL_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)))); emu->libc_err = errno; } +void lFpuip_32(x64emu_t *emu, uintptr_t fcn) { lFpuip_t fn = (lFpuip_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16))); } +void lFppLp_32(x64emu_t *emu, uintptr_t fcn) { lFppLp_t fn = (lFppLp_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16))); } +void LFEpLp_32(x64emu_t *emu, uintptr_t fcn) { LFEpLp_t fn = (LFEpLp_t)fcn; R_EAX = to_ulong(fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12))); } +void LFEXii_32(x64emu_t *emu, uintptr_t fcn) { LFEXii_t fn = (LFEXii_t)fcn; R_EAX = to_ulong(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void LEpLLS_32(x64emu_t *emu, uintptr_t fcn) { LEpLLS_t fn = (LEpLLS_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), io_convert32(from_ptriv(R_ESP + 16)))); emu->libc_err = errno; } +void LEppLL_32(x64emu_t *emu, uintptr_t fcn) { LEppLL_t fn = (LEppLL_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)))); emu->libc_err = errno; } +void LEppLp_32(x64emu_t *emu, uintptr_t fcn) { LEppLp_t fn = (LEppLp_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16))); emu->libc_err = errno; } +void LEppLa_32(x64emu_t *emu, uintptr_t fcn) { LEppLa_t fn = (LEppLa_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_locale(from_ptri(ptr_t, R_ESP + 16)))); emu->libc_err = errno; } +void LFXCii_32(x64emu_t *emu, uintptr_t fcn) { LFXCii_t fn = (LFXCii_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint8_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } +void LFXLuu_32(x64emu_t *emu, uintptr_t fcn) { LFXLuu_t fn = (LFXLuu_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16))); } +void LFXpLp_32(x64emu_t *emu, uintptr_t fcn) { LFXpLp_t fn = (LFXpLp_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16))); } +void pFEupi_32(x64emu_t *emu, uintptr_t fcn) { pFEupi_t fn = (pFEupi_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void pFEupp_32(x64emu_t *emu, uintptr_t fcn) { pFEupp_t fn = (pFEupp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pEEpii_32(x64emu_t *emu, uintptr_t fcn) { pEEpii_t fn = (pEEpii_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); emu->libc_err = errno; } +void pEEpip_32(x64emu_t *emu, uintptr_t fcn) { pEEpip_t fn = (pEEpip_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12))); emu->libc_err = errno; } +void pFEpip_32(x64emu_t *emu, uintptr_t fcn) { pFEpip_t fn = (pFEpip_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pFEpui_32(x64emu_t *emu, uintptr_t fcn) { pFEpui_t fn = (pFEpui_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void pEEppi_32(x64emu_t *emu, uintptr_t fcn) { pEEppi_t fn = (pEEppi_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); emu->libc_err = errno; } +void pFEppi_32(x64emu_t *emu, uintptr_t fcn) { pFEppi_t fn = (pFEppi_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void pEEppp_32(x64emu_t *emu, uintptr_t fcn) { pEEppp_t fn = (pEEppp_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); emu->libc_err = errno; } +void pFEppp_32(x64emu_t *emu, uintptr_t fcn) { pFEppp_t fn = (pFEppp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pFEXip_32(x64emu_t *emu, uintptr_t fcn) { pFEXip_t fn = (pFEXip_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pFEXCL_32(x64emu_t *emu, uintptr_t fcn) { pFEXCL_t fn = (pFEXCL_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint8_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); } +void pFEXuu_32(x64emu_t *emu, uintptr_t fcn) { pFEXuu_t fn = (pFEXuu_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12))); } +void pFEXLL_32(x64emu_t *emu, uintptr_t fcn) { pFEXLL_t fn = (pFEXLL_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); } +void pFEXLp_32(x64emu_t *emu, uintptr_t fcn) { pFEXLp_t fn = (pFEXLp_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12))); } +void pFEXpL_32(x64emu_t *emu, uintptr_t fcn) { pFEXpL_t fn = (pFEXpL_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); } +void pFEXpp_32(x64emu_t *emu, uintptr_t fcn) { pFEXpp_t fn = (pFEXpp_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } +void pFiiiu_32(x64emu_t *emu, uintptr_t fcn) { pFiiiu_t fn = (pFiiiu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16))); } +void pFifff_32(x64emu_t *emu, uintptr_t fcn) { pFifff_t fn = (pFifff_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16))); } +void pFillu_32(x64emu_t *emu, uintptr_t fcn) { pFillu_t fn = (pFillu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16))); } +void pEippu_32(x64emu_t *emu, uintptr_t fcn) { pEippu_t fn = (pEippu_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16))); emu->libc_err = errno; } +void pFullu_32(x64emu_t *emu, uintptr_t fcn) { pFullu_t fn = (pFullu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16))); } +void pFdddd_32(x64emu_t *emu, uintptr_t fcn) { pFdddd_t fn = (pFdddd_t)fcn; R_EAX = to_ptrv(fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28))); } +void pFpiii_32(x64emu_t *emu, uintptr_t fcn) { pFpiii_t fn = (pFpiii_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } +void pFpiip_32(x64emu_t *emu, uintptr_t fcn) { pFpiip_t fn = (pFpiip_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16))); } +void pEpiLL_32(x64emu_t *emu, uintptr_t fcn) { pEpiLL_t fn = (pEpiLL_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)))); emu->libc_err = errno; } +void pFpipc_32(x64emu_t *emu, uintptr_t fcn) { pFpipc_t fn = (pFpipc_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int8_t, R_ESP + 16))); } +void pFpipi_32(x64emu_t *emu, uintptr_t fcn) { pFpipi_t fn = (pFpipi_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } +void pFpipp_32(x64emu_t *emu, uintptr_t fcn) { pFpipp_t fn = (pFpipp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16))); } +void pFpuii_32(x64emu_t *emu, uintptr_t fcn) { pFpuii_t fn = (pFpuii_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } +void pFpupu_32(x64emu_t *emu, uintptr_t fcn) { pFpupu_t fn = (pFpupu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16))); } +void pFpupp_32(x64emu_t *emu, uintptr_t fcn) { pFpupp_t fn = (pFpupp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16))); } +void pEpLiS_32(x64emu_t *emu, uintptr_t fcn) { pEpLiS_t fn = (pEpLiS_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), io_convert32(from_ptriv(R_ESP + 16)))); emu->libc_err = errno; } +void pEpLpL_32(x64emu_t *emu, uintptr_t fcn) { pEpLpL_t fn = (pEpLpL_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)))); emu->libc_err = errno; } +void pFpLpL_32(x64emu_t *emu, uintptr_t fcn) { pFpLpL_t fn = (pFpLpL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)))); } +void pEppLL_32(x64emu_t *emu, uintptr_t fcn) { pEppLL_t fn = (pEppLL_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)))); emu->libc_err = errno; } +void pFppLp_32(x64emu_t *emu, uintptr_t fcn) { pFppLp_t fn = (pFppLp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16))); } +void pFpppi_32(x64emu_t *emu, uintptr_t fcn) { pFpppi_t fn = (pFpppi_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } +void pFpppL_32(x64emu_t *emu, uintptr_t fcn) { pFpppL_t fn = (pFpppL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)))); } +void pFpppp_32(x64emu_t *emu, uintptr_t fcn) { pFpppp_t fn = (pFpppp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16))); } +void pFXiii_32(x64emu_t *emu, uintptr_t fcn) { pFXiii_t fn = (pFXiii_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } +void pFXiip_32(x64emu_t *emu, uintptr_t fcn) { pFXiip_t fn = (pFXiip_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16))); } +void pFXLpp_32(x64emu_t *emu, uintptr_t fcn) { pFXLpp_t fn = (pFXLpp_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16))); } +void pFXppp_32(x64emu_t *emu, uintptr_t fcn) { pFXppp_t fn = (pFXppp_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16))); } +void vFuibp_i_32(x64emu_t *emu, uintptr_t fcn) { vFuibp_i_t fn = (vFuibp_i_t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFuuuBp__32(x64emu_t *emu, uintptr_t fcn) { vFuuuBp__t fn = (vFuuuBp__t)fcn; struct_p_t arg_16={0}; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void vFbp_ppp_32(x64emu_t *emu, uintptr_t fcn) { vFbp_ppp_t fn = (vFbp_ppp_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void vFXLLbL__32(x64emu_t *emu, uintptr_t fcn) { vFXLLbL__t fn = (vFXLLbL__t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFEpbL_p_32(x64emu_t *emu, uintptr_t fcn) { iFEpbL_p_t fn = (iFEpbL_p_t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(emu, from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpipbL__32(x64emu_t *emu, uintptr_t fcn) { iFpipbL__t fn = (iFpipbL__t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpupbL__32(x64emu_t *emu, uintptr_t fcn) { iFpupbL__t fn = (iFpupbL__t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpubp_u_32(x64emu_t *emu, uintptr_t fcn) { iFpubp_u_t fn = (iFpubp_u_t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFplibl__32(x64emu_t *emu, uintptr_t fcn) { iFplibl__t fn = (iFplibl__t)fcn; struct_l_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_l(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpLpbL__32(x64emu_t *emu, uintptr_t fcn) { iFpLpbL__t fn = (iFpLpbL__t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppWbp__32(x64emu_t *emu, uintptr_t fcn) { iFppWbp__t fn = (iFppWbp__t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint16_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpppbp__32(x64emu_t *emu, uintptr_t fcn) { iFpppbp__t fn = (iFpppbp__t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpppbL__32(x64emu_t *emu, uintptr_t fcn) { iFpppbL__t fn = (iFpppbL__t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppbp_u_32(x64emu_t *emu, uintptr_t fcn) { iFppbp_u_t fn = (iFppbp_u_t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFppbL_p_32(x64emu_t *emu, uintptr_t fcn) { iFppbL_p_t fn = (iFppbL_p_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbp_ii_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_ii_t fn = (iFpbp_ii_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbp_ip_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_ip_t fn = (iFpbp_ip_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbp_uu_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_uu_t fn = (iFpbp_uu_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbp_pp_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_pp_t fn = (iFpbp_pp_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFbp_upL_32(x64emu_t *emu, uintptr_t fcn) { iFbp_upL_t fn = (iFbp_upL_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_pii_32(x64emu_t *emu, uintptr_t fcn) { iFbp_pii_t fn = (iFbp_pii_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_pip_32(x64emu_t *emu, uintptr_t fcn) { iFbp_pip_t fn = (iFbp_pip_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFBp_pui_32(x64emu_t *emu, uintptr_t fcn) { iFBp_pui_t fn = (iFBp_pui_t)fcn; struct_p_t arg_4={0}; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_ppu_32(x64emu_t *emu, uintptr_t fcn) { iFbp_ppu_t fn = (iFbp_ppu_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFXLiBp__32(x64emu_t *emu, uintptr_t fcn) { iFXLiBp__t fn = (iFXLiBp__t)fcn; struct_p_t arg_16={0}; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFXLbp_i_32(x64emu_t *emu, uintptr_t fcn) { iFXLbp_i_t fn = (iFXLbp_i_t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXLbL_i_32(x64emu_t *emu, uintptr_t fcn) { iFXLbL_i_t fn = (iFXLbL_i_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXLbp_p_32(x64emu_t *emu, uintptr_t fcn) { iFXLbp_p_t fn = (iFXLbp_p_t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void IEpBp_ii_32(x64emu_t *emu, uintptr_t fcn) { IEpBp_ii_t fn = (IEpBp_ii_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; ui64_t r; r.i = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); R_EAX = r.d[0]; R_EDX = r.d[1]; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void IEpBp_ia_32(x64emu_t *emu, uintptr_t fcn) { IEpBp_ia_t fn = (IEpBp_ia_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; ui64_t r; r.i = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_locale(from_ptri(ptr_t, R_ESP + 16))); R_EAX = r.d[0]; R_EDX = r.d[1]; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void uFppibp__32(x64emu_t *emu, uintptr_t fcn) { uFppibp__t fn = (uFppibp__t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void uFppibl__32(x64emu_t *emu, uintptr_t fcn) { uFppibl__t fn = (uFppibl__t)fcn; struct_l_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_l(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void uFppbp_i_32(x64emu_t *emu, uintptr_t fcn) { uFppbp_i_t fn = (uFppbp_i_t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void uFpbp_ip_32(x64emu_t *emu, uintptr_t fcn) { uFpbp_ip_t fn = (uFpbp_ip_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void UEpBp_ii_32(x64emu_t *emu, uintptr_t fcn) { UEpBp_ii_t fn = (UEpBp_ii_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; ui64_t r; r.u = (uint64_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); R_EAX = r.d[0]; R_EDX = r.d[1]; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void UEpBp_ia_32(x64emu_t *emu, uintptr_t fcn) { UEpBp_ia_t fn = (UEpBp_ia_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; ui64_t r; r.u = (uint64_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_locale(from_ptri(ptr_t, R_ESP + 16))); R_EAX = r.d[0]; R_EDX = r.d[1]; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void lEiibl_L_32(x64emu_t *emu, uintptr_t fcn) { lEiibl_L_t fn = (lEiibl_L_t)fcn; errno = emu->libc_err; struct_l_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_l(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 16)))); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); emu->libc_err = errno; } +void LEpBp_ii_32(x64emu_t *emu, uintptr_t fcn) { LEpBp_ii_t fn = (LEpBp_ii_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void LEpbp_Lp_32(x64emu_t *emu, uintptr_t fcn) { LEpbp_Lp_t fn = (LEpbp_Lp_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void pFpppbl__32(x64emu_t *emu, uintptr_t fcn) { pFpppbl__t fn = (pFpppbl__t)fcn; struct_l_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_l(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void vFpibpp_i_32(x64emu_t *emu, uintptr_t fcn) { vFpibpp_i_t fn = (vFpibpp_i_t)fcn; struct_pp_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pp(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pp(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iEEpprLL__32(x64emu_t *emu, uintptr_t fcn) { iEEpprLL__t fn = (iEEpprLL__t)fcn; errno = emu->libc_err; struct_LL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); emu->libc_err = errno; } +void iFuubpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFuubpu_u_t fn = (iFuubpu_u_t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpuubpu__32(x64emu_t *emu, uintptr_t fcn) { iFpuubpu__t fn = (iFpuubpu__t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpupbpu__32(x64emu_t *emu, uintptr_t fcn) { iFpupbpu__t fn = (iFpupbpu__t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpubpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFpubpu_u_t fn = (iFpubpu_u_t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iEpurLL_p_32(x64emu_t *emu, uintptr_t fcn) { iEpurLL_p_t fn = (iEpurLL_p_t)fcn; errno = emu->libc_err; struct_LL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iFppubpu__32(x64emu_t *emu, uintptr_t fcn) { iFppubpu__t fn = (iFppubpu__t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppbpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFppbpu_u_t fn = (iFppbpu_u_t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbpu_uu_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_uu_t fn = (iFpbpu_uu_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbpu_up_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_up_t fn = (iFpbpu_up_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFbpu_ppp_32(x64emu_t *emu, uintptr_t fcn) { iFbpu_ppp_t fn = (iFbpu_ppp_t)fcn; struct_pu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFnbpL_iU_32(x64emu_t *emu, uintptr_t fcn) { iFnbpL_iU_t fn = (iFnbpL_iU_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); struct_pL_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pL(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(aligned_xcb, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptri(uint64_t, R_ESP + 16)); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pL(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void lFppLbLL__32(x64emu_t *emu, uintptr_t fcn) { lFppLbLL__t fn = (lFppLbLL__t)fcn; struct_LL_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_LL(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void pFnbpi_up_32(x64emu_t *emu, uintptr_t fcn) { pFnbpi_up_t fn = (pFnbpi_up_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); struct_pi_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pi(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ptrv(fn(aligned_xcb, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16))); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pi(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFppbp_bL__32(x64emu_t *emu, uintptr_t fcn) { vFppbp_bL__t fn = (vFppbp_bL__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void vFpbLdd_ip_32(x64emu_t *emu, uintptr_t fcn) { vFpbLdd_ip_t fn = (vFpbLdd_ip_t)fcn; struct_Ldd_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_Ldd(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_Ldd(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFpbupu_uu_32(x64emu_t *emu, uintptr_t fcn) { vFpbupu_uu_t fn = (vFpbupu_uu_t)fcn; struct_upu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_upu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_upu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFupbp_bp__32(x64emu_t *emu, uintptr_t fcn) { iFupbp_bp__t fn = (iFupbp_bp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppbL_bL__32(x64emu_t *emu, uintptr_t fcn) { iFppbL_bL__t fn = (iFppbL_bL__t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppbp_bp__32(x64emu_t *emu, uintptr_t fcn) { iFppbp_bp__t fn = (iFppbp_bp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppbp_bL__32(x64emu_t *emu, uintptr_t fcn) { iFppbp_bL__t fn = (iFppbp_bL__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpbupu_up_32(x64emu_t *emu, uintptr_t fcn) { iFpbupu_up_t fn = (iFpbupu_up_t)fcn; struct_upu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_upu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_upu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFbp_urp_u_32(x64emu_t *emu, uintptr_t fcn) { iFbp_urp_u_t fn = (iFbp_urp_u_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFrpuu_Lui_32(x64emu_t *emu, uintptr_t fcn) { iFrpuu_Lui_t fn = (iFrpuu_Lui_t)fcn; struct_puu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_puu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iEbp_bL_iS_32(x64emu_t *emu, uintptr_t fcn) { iEbp_bL_iS_t fn = (iEbp_bL_iS_t)fcn; errno = emu->libc_err; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), io_convert32(from_ptriv(R_ESP + 16))); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void iFbp_bp_pi_32(x64emu_t *emu, uintptr_t fcn) { iFbp_bp_pi_t fn = (iFbp_bp_pi_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFXbL_ibp__32(x64emu_t *emu, uintptr_t fcn) { iFXbL_ibp__t fn = (iFXbL_ibp__t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFnubp_bp__32(x64emu_t *emu, uintptr_t fcn) { iFnubp_bp__t fn = (iFnubp_bp__t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(aligned_xcb, from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFnUbp_bp__32(x64emu_t *emu, uintptr_t fcn) { iFnUbp_bp__t fn = (iFnUbp_bp__t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_p_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_p(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(aligned_xcb, from_ptri(uint64_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void vFEpuBLLLL__32(x64emu_t *emu, uintptr_t fcn) { vFEpuBLLLL__t fn = (vFEpuBLLLL__t)fcn; struct_LLLL_t arg_12={0}; fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_LLLL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void vFbp_ppbup__32(x64emu_t *emu, uintptr_t fcn) { vFbp_ppbup__t fn = (vFbp_ppbup__t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_up_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_up(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_up(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void vFXLbpLiL_L_32(x64emu_t *emu, uintptr_t fcn) { vFXLbpLiL_L_t fn = (vFXLbpLiL_L_t)fcn; struct_pLiL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pLiL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 16))); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pLiL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFubpu_pbL__32(x64emu_t *emu, uintptr_t fcn) { iFubpu_pbL__t fn = (iFubpu_pbL__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpbpu_pbL__32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_pbL__t fn = (iFpbpu_pbL__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpbpu_bp_u_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bp_u_t fn = (iFpbpu_bp_u_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFbpu_upbL__32(x64emu_t *emu, uintptr_t fcn) { iFbpu_upbL__t fn = (iFbpu_upbL__t)fcn; struct_pu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFbp_pbpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFbp_pbpu_u_t fn = (iFbp_pbpu_u_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXLbpLiL_L_32(x64emu_t *emu, uintptr_t fcn) { iFXLbpLiL_L_t fn = (iFXLbpLiL_L_t)fcn; struct_pLiL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pLiL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 16))); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pLiL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iEiirLL_BLL__32(x64emu_t *emu, uintptr_t fcn) { iEiirLL_BLL__t fn = (iEiirLL_BLL__t)fcn; errno = emu->libc_err; struct_LL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_LL_t arg_16={0}; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); emu->libc_err = errno; } +void iEuirLL_BLL__32(x64emu_t *emu, uintptr_t fcn) { iEuirLL_BLL__t fn = (iEuirLL_BLL__t)fcn; errno = emu->libc_err; struct_LL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_LL_t arg_16={0}; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); emu->libc_err = errno; } +void iFpubpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpubpu_bpu__t fn = (iFpubpu_bpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppbpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFppbpu_bpu__t fn = (iFppbpu_bpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpbpu_Lbpu__32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_Lbpu__t fn = (iFpbpu_Lbpu__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 12)), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpbpu_bpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu_u_t fn = (iFpbpu_bpu_u_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbpu_bpu_p_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu_p_t fn = (iFpbpu_bpu_p_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXLpbLWWWcc__32(x64emu_t *emu, uintptr_t fcn) { iFXLpbLWWWcc__t fn = (iFXLpbLWWWcc__t)fcn; struct_LWWWcc_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_LWWWcc(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFXLbLWWWcc_i_32(x64emu_t *emu, uintptr_t fcn) { iFXLbLWWWcc_i_t fn = (iFXLbLWWWcc_i_t)fcn; struct_LWWWcc_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LWWWcc(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void pESBppppii_pi_32(x64emu_t *emu, uintptr_t fcn) { pESBppppii_pi_t fn = (pESBppppii_pi_t)fcn; errno = emu->libc_err; struct_ppppii_t arg_8={0}; R_EAX = to_ptrv(fn(io_convert32(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppppii(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void iFEprllll_rll__32(x64emu_t *emu, uintptr_t fcn) { iFEprllll_rll__t fn = (iFEprllll_rll__t)fcn; struct_llll_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_llll(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_ll_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_ll(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(emu, from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); } +void iEupuBpppiiip__32(x64emu_t *emu, uintptr_t fcn) { iEupuBpppiiip__t fn = (iEupuBpppiiip__t)fcn; errno = emu->libc_err; struct_pppiiip_t arg_16={0}; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pppiiip(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); emu->libc_err = errno; } +void iFbp_ubpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFbp_ubpu_bpu__t fn = (iFbp_ubpu_bpu__t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFXLuriiiiiLi__32(x64emu_t *emu, uintptr_t fcn) { iFXLuriiiiiLi__t fn = (iFXLuriiiiiLi__t)fcn; struct_iiiiiLi_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_iiiiiLi(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); } +void uFnibpL_bLpCC__32(x64emu_t *emu, uintptr_t fcn) { uFnibpL_bLpCC__t fn = (uFnibpL_bLpCC__t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); struct_pL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_LpCC_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_LpCC(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = (uint32_t)fn(aligned_xcb, from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_LpCC(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppubppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { iFppubppuuuuup__t fn = (iFppubppuuuuup__t)fcn; struct_ppuuuuup_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_ppuuuuup(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpruuipWCCp_ll_32(x64emu_t *emu, uintptr_t fcn) { iFpruuipWCCp_ll_t fn = (iFpruuipWCCp_ll_t)fcn; struct_uuipWCCp_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_uuipWCCp(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_long(from_ptri(long_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16))); } +void iFpbLL_bLL_bLL__32(x64emu_t *emu, uintptr_t fcn) { iFpbLL_bLL_bLL__t fn = (iFpbLL_bLL_bLL__t)fcn; struct_LL_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_LL(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_LL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_LL_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_LL(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void pFppibppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { pFppibppuuuuup__t fn = (pFppibppuuuuup__t)fcn; struct_ppuuuuup_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_ppuuuuup(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void vFXLbLLLLLLLLLL_L_32(x64emu_t *emu, uintptr_t fcn) { vFXLbLLLLLLLLLL_L_t fn = (vFXLbLLLLLLLLLL_L_t)fcn; struct_LLLLLLLLLL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LLLLLLLLLL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 16))); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_LLLLLLLLLL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXLbLLLLLLLLLL_L_32(x64emu_t *emu, uintptr_t fcn) { iFXLbLLLLLLLLLL_L_t fn = (iFXLbLLLLLLLLLL_L_t)fcn; struct_LLLLLLLLLL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LLLLLLLLLL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 16))); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_LLLLLLLLLL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void LEpLpriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fcn) { LEpLpriiiiiiiiilt__t fn = (LEpLpriiiiiiiiilt__t)fcn; errno = emu->libc_err; struct_iiiiiiiiilt_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_iiiiiiiiilt(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL)); emu->libc_err = errno; } +void iFXipBWWWWWWWWWuip__32(x64emu_t *emu, uintptr_t fcn) { iFXipBWWWWWWWWWuip__t fn = (iFXipBWWWWWWWWWuip__t)fcn; struct_WWWWWWWWWuip_t arg_16={0}; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_WWWWWWWWWuip(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFXLbLWWWcc_bLWWWcc__32(x64emu_t *emu, uintptr_t fcn) { iFXLbLWWWcc_bLWWWcc__t fn = (iFXLbLWWWcc_bLWWWcc__t)fcn; struct_LWWWcc_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LWWWcc(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_LWWWcc_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_LWWWcc(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void uFEbppuiiiiiiiiipp_ip_32(x64emu_t *emu, uintptr_t fcn) { uFEbppuiiiiiiiiipp_ip_t fn = (uFEbppuiiiiiiiiipp_ip_t)fcn; struct_ppuiiiiiiiiipp_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuiiiiiiiiipp(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = (uint32_t)fn(emu, *(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void uFbppuiiiiiiiiipp_ipi_32(x64emu_t *emu, uintptr_t fcn) { uFbppuiiiiiiiiipp_ipi_t fn = (uFbppuiiiiiiiiipp_ipi_t)fcn; struct_ppuiiiiiiiiipp_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuiiiiiiiiipp(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = (uint32_t)fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFpruuipWCCp_buuipWCCp_i_32(x64emu_t *emu, uintptr_t fcn) { iFpruuipWCCp_buuipWCCp_i_t fn = (iFpruuipWCCp_buuipWCCp_i_t)fcn; struct_uuipWCCp_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_uuipWCCp(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_uuipWCCp_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_uuipWCCp(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_uuipWCCp(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXpLriLLLiiiiiiiLLiiLiiiiLic__32(x64emu_t *emu, uintptr_t fcn) { iFXpLriLLLiiiiiiiLLiiLiiiiLic__t fn = (iFXpLriLLLiiiiiiiLLiiLiiiiLic__t)fcn; struct_iLLLiiiiiiiLLiiLiiiiLic_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_iLLLiiiiiiiLLiiLiiiiLic(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); } +void iFXpLbiLLLiiiiiiiLLiiLiiiiLic__32(x64emu_t *emu, uintptr_t fcn) { iFXpLbiLLLiiiiiiiLLiiLiiiiLic__t fn = (iFXpLbiLLLiiiiiiiLLiiLiiiiLic__t)fcn; struct_iLLLiiiiiiiLLiiLiiiiLic_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_iLLLiiiiiiiLLiiLiiiiLic(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_iLLLiiiiiiiLLiiLiiiiLic(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void pFXLLbiLLLiiiiiiiLLiiLiiiiLic__32(x64emu_t *emu, uintptr_t fcn) { pFXLLbiLLLiiiiiiiLLiiLiiiiLic__t fn = (pFXLLbiLLLiiiiiiiLLiiLiiiiLic__t)fcn; struct_iLLLiiiiiiiLLiiLiiiiLic_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_iLLLiiiiiiiLLiiLiiiiLic(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_iLLLiiiiiiiLLiiLiiiiLic(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void uFbppuiiiiiiiiipp_ipbppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fcn) { uFbppuiiiiiiiiipp_ipbppuiiiiiiiiipp__t fn = (uFbppuiiiiiiiiipp_ipbppuiiiiiiiiipp__t)fcn; struct_ppuiiiiiiiiipp_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppuiiiiiiiiipp(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_ppuiiiiiiiiipp_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_ppuiiiiiiiiipp(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = (uint32_t)fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_ppuiiiiiiiiipp(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void vEEiipp_32(x64emu_t *emu, uintptr_t fcn) { vEEiipp_t fn = (vEEiipp_t)fcn; errno = emu->libc_err; fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void vEEiipV_32(x64emu_t *emu, uintptr_t fcn) { vEEiipV_t fn = (vEEiipV_t)fcn; errno = emu->libc_err; fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptrv(R_ESP + 16)); emu->libc_err = errno; } +void vFEuipu_32(x64emu_t *emu, uintptr_t fcn) { vFEuipu_t fn = (vFEuipu_t)fcn; fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void vFEuipp_32(x64emu_t *emu, uintptr_t fcn) { vFEuipp_t fn = (vFEuipp_t)fcn; fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vEEpLLp_32(x64emu_t *emu, uintptr_t fcn) { vEEpLLp_t fn = (vEEpLLp_t)fcn; errno = emu->libc_err; fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void vEEppiV_32(x64emu_t *emu, uintptr_t fcn) { vEEppiV_t fn = (vEEppiV_t)fcn; errno = emu->libc_err; fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptrv(R_ESP + 16)); emu->libc_err = errno; } +void vFEpppp_32(x64emu_t *emu, uintptr_t fcn) { vFEpppp_t fn = (vFEpppp_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFEXLpL_32(x64emu_t *emu, uintptr_t fcn) { vFEXLpL_t fn = (vFEXLpL_t)fcn; fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); } +void vFiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFiiiii_t fn = (vFiiiii_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFiiiiu_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiu_t fn = (vFiiiiu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFiiuii_32(x64emu_t *emu, uintptr_t fcn) { vFiiuii_t fn = (vFiiuii_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFiiuup_t fn = (vFiiuup_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFiillu_32(x64emu_t *emu, uintptr_t fcn) { vFiillu_t fn = (vFiillu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16)), from_ptri(uint32_t, R_ESP + 20)); } +void vFiilll_32(x64emu_t *emu, uintptr_t fcn) { vFiilll_t fn = (vFiilll_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16)), from_long(from_ptri(long_t, R_ESP + 20))); } +void vFiipll_32(x64emu_t *emu, uintptr_t fcn) { vFiipll_t fn = (vFiipll_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_long(from_ptri(long_t, R_ESP + 20))); } +void vFiIIII_32(x64emu_t *emu, uintptr_t fcn) { vFiIIII_t fn = (vFiIIII_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 16), from_ptri(int64_t, R_ESP + 24), from_ptri(int64_t, R_ESP + 32)); } +void vFiuiip_32(x64emu_t *emu, uintptr_t fcn) { vFiuiip_t fn = (vFiuiip_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFiuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFiuuuu_t fn = (vFiuuuu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFiulpp_32(x64emu_t *emu, uintptr_t fcn) { vFiulpp_t fn = (vFiulpp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFiUUUU_32(x64emu_t *emu, uintptr_t fcn) { vFiUUUU_t fn = (vFiUUUU_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 16), from_ptri(uint64_t, R_ESP + 24), from_ptri(uint64_t, R_ESP + 32)); } +void vFiffff_32(x64emu_t *emu, uintptr_t fcn) { vFiffff_t fn = (vFiffff_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20)); } +void vFidddd_32(x64emu_t *emu, uintptr_t fcn) { vFidddd_t fn = (vFidddd_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24), from_ptri(double, R_ESP + 32)); } +void vFilill_32(x64emu_t *emu, uintptr_t fcn) { vFilill_t fn = (vFilill_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_long(from_ptri(long_t, R_ESP + 20))); } +void vFilipi_32(x64emu_t *emu, uintptr_t fcn) { vFilipi_t fn = (vFilipi_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFilipl_32(x64emu_t *emu, uintptr_t fcn) { vFilipl_t fn = (vFilipl_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_long(from_ptri(long_t, R_ESP + 20))); } +void vFipipu_32(x64emu_t *emu, uintptr_t fcn) { vFipipu_t fn = (vFipipu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFipipp_32(x64emu_t *emu, uintptr_t fcn) { vFipipp_t fn = (vFipipp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFipupi_32(x64emu_t *emu, uintptr_t fcn) { vFipupi_t fn = (vFipupi_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFucccc_32(x64emu_t *emu, uintptr_t fcn) { vFucccc_t fn = (vFucccc_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int8_t, R_ESP + 8), from_ptri(int8_t, R_ESP + 12), from_ptri(int8_t, R_ESP + 16), from_ptri(int8_t, R_ESP + 20)); } +void vFuwwww_32(x64emu_t *emu, uintptr_t fcn) { vFuwwww_t fn = (vFuwwww_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int16_t, R_ESP + 8), from_ptri(int16_t, R_ESP + 12), from_ptri(int16_t, R_ESP + 16), from_ptri(int16_t, R_ESP + 20)); } +void vFuiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuiiii_t fn = (vFuiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuiiiu_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiu_t fn = (vFuiiiu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFuiiip_32(x64emu_t *emu, uintptr_t fcn) { vFuiiip_t fn = (vFuiiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuiiCp_32(x64emu_t *emu, uintptr_t fcn) { vFuiiCp_t fn = (vFuiiCp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuiiup_32(x64emu_t *emu, uintptr_t fcn) { vFuiiup_t fn = (vFuiiup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuiill_32(x64emu_t *emu, uintptr_t fcn) { vFuiill_t fn = (vFuiill_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_long(from_ptri(long_t, R_ESP + 20))); } +void vFuiIII_32(x64emu_t *emu, uintptr_t fcn) { vFuiIII_t fn = (vFuiIII_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 12), from_ptri(int64_t, R_ESP + 20), from_ptri(int64_t, R_ESP + 28)); } +void vFuiuii_32(x64emu_t *emu, uintptr_t fcn) { vFuiuii_t fn = (vFuiuii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuiuip_32(x64emu_t *emu, uintptr_t fcn) { vFuiuip_t fn = (vFuiuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuiuCi_32(x64emu_t *emu, uintptr_t fcn) { vFuiuCi_t fn = (vFuiuCi_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuiuCu_32(x64emu_t *emu, uintptr_t fcn) { vFuiuCu_t fn = (vFuiuCu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFuiuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuiuuu_t fn = (vFuiuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFuiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuiuup_t fn = (vFuiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuiupi_32(x64emu_t *emu, uintptr_t fcn) { vFuiupi_t fn = (vFuiupi_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuiUUU_32(x64emu_t *emu, uintptr_t fcn) { vFuiUUU_t fn = (vFuiUUU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 12), from_ptri(uint64_t, R_ESP + 20), from_ptri(uint64_t, R_ESP + 28)); } +void vFuifff_32(x64emu_t *emu, uintptr_t fcn) { vFuifff_t fn = (vFuifff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20)); } +void vFuiddd_32(x64emu_t *emu, uintptr_t fcn) { vFuiddd_t fn = (vFuiddd_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28)); } +void vFuipii_32(x64emu_t *emu, uintptr_t fcn) { vFuipii_t fn = (vFuipii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuipip_32(x64emu_t *emu, uintptr_t fcn) { vFuipip_t fn = (vFuipip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuipup_32(x64emu_t *emu, uintptr_t fcn) { vFuipup_t fn = (vFuipup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuippp_32(x64emu_t *emu, uintptr_t fcn) { vFuippp_t fn = (vFuippp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuIIII_32(x64emu_t *emu, uintptr_t fcn) { vFuIIII_t fn = (vFuIIII_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 16), from_ptri(int64_t, R_ESP + 24), from_ptri(int64_t, R_ESP + 32)); } +void vFuCCCC_32(x64emu_t *emu, uintptr_t fcn) { vFuCCCC_t fn = (vFuCCCC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(uint8_t, R_ESP + 20)); } +void vFuCuip_32(x64emu_t *emu, uintptr_t fcn) { vFuCuip_t fn = (vFuCuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuCuup_32(x64emu_t *emu, uintptr_t fcn) { vFuCuup_t fn = (vFuCuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuWWWW_32(x64emu_t *emu, uintptr_t fcn) { vFuWWWW_t fn = (vFuWWWW_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint16_t, R_ESP + 8), from_ptri(uint16_t, R_ESP + 12), from_ptri(uint16_t, R_ESP + 16), from_ptri(uint16_t, R_ESP + 20)); } +void vFuuiii_32(x64emu_t *emu, uintptr_t fcn) { vFuuiii_t fn = (vFuuiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuuiip_32(x64emu_t *emu, uintptr_t fcn) { vFuuiip_t fn = (vFuuiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuuiui_32(x64emu_t *emu, uintptr_t fcn) { vFuuiui_t fn = (vFuuiui_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuuiuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuu_t fn = (vFuuiuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFuuiup_32(x64emu_t *emu, uintptr_t fcn) { vFuuiup_t fn = (vFuuiup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuuifi_32(x64emu_t *emu, uintptr_t fcn) { vFuuifi_t fn = (vFuuifi_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuuipC_32(x64emu_t *emu, uintptr_t fcn) { vFuuipC_t fn = (vFuuipC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint8_t, R_ESP + 20)); } +void vFuuipu_32(x64emu_t *emu, uintptr_t fcn) { vFuuipu_t fn = (vFuuipu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFuuipp_32(x64emu_t *emu, uintptr_t fcn) { vFuuipp_t fn = (vFuuipp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuuuii_32(x64emu_t *emu, uintptr_t fcn) { vFuuuii_t fn = (vFuuuii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuuuiu_32(x64emu_t *emu, uintptr_t fcn) { vFuuuiu_t fn = (vFuuuiu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFuuuil_32(x64emu_t *emu, uintptr_t fcn) { vFuuuil_t fn = (vFuuuil_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_long(from_ptri(long_t, R_ESP + 20))); } +void vFuuuip_32(x64emu_t *emu, uintptr_t fcn) { vFuuuip_t fn = (vFuuuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuuuui_32(x64emu_t *emu, uintptr_t fcn) { vFuuuui_t fn = (vFuuuui_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuuuu_t fn = (vFuuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFuuuup_32(x64emu_t *emu, uintptr_t fcn) { vFuuuup_t fn = (vFuuuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuuuli_32(x64emu_t *emu, uintptr_t fcn) { vFuuuli_t fn = (vFuuuli_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); } +void vFuuull_32(x64emu_t *emu, uintptr_t fcn) { vFuuull_t fn = (vFuuull_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_long(from_ptri(long_t, R_ESP + 20))); } +void vFuulll_32(x64emu_t *emu, uintptr_t fcn) { vFuulll_t fn = (vFuulll_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16)), from_long(from_ptri(long_t, R_ESP + 20))); } +void vFuullp_32(x64emu_t *emu, uintptr_t fcn) { vFuullp_t fn = (vFuullp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16)), from_ptriv(R_ESP + 20)); } +void vFuupii_32(x64emu_t *emu, uintptr_t fcn) { vFuupii_t fn = (vFuupii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuUUUU_32(x64emu_t *emu, uintptr_t fcn) { vFuUUUU_t fn = (vFuUUUU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 16), from_ptri(uint64_t, R_ESP + 24), from_ptri(uint64_t, R_ESP + 32)); } +void vFuffff_32(x64emu_t *emu, uintptr_t fcn) { vFuffff_t fn = (vFuffff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20)); } +void vFudddd_32(x64emu_t *emu, uintptr_t fcn) { vFudddd_t fn = (vFudddd_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24), from_ptri(double, R_ESP + 32)); } +void vFullpu_32(x64emu_t *emu, uintptr_t fcn) { vFullpu_t fn = (vFullpu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFupiii_32(x64emu_t *emu, uintptr_t fcn) { vFupiii_t fn = (vFupiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFupupp_32(x64emu_t *emu, uintptr_t fcn) { vFupupp_t fn = (vFupupp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFuplii_32(x64emu_t *emu, uintptr_t fcn) { vFuplii_t fn = (vFuplii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFuppip_32(x64emu_t *emu, uintptr_t fcn) { vFuppip_t fn = (vFuppip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFupppp_32(x64emu_t *emu, uintptr_t fcn) { vFupppp_t fn = (vFupppp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFfffff_32(x64emu_t *emu, uintptr_t fcn) { vFfffff_t fn = (vFfffff_t)fcn; fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20)); } +void vFddddp_32(x64emu_t *emu, uintptr_t fcn) { vFddddp_t fn = (vFddddp_t)fcn; fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28), from_ptriv(R_ESP + 36)); } +void vFluipp_32(x64emu_t *emu, uintptr_t fcn) { vFluipp_t fn = (vFluipp_t)fcn; fn(from_long(from_ptri(long_t, R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFpiiii_32(x64emu_t *emu, uintptr_t fcn) { vFpiiii_t fn = (vFpiiii_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFpilpp_32(x64emu_t *emu, uintptr_t fcn) { vFpilpp_t fn = (vFpilpp_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFpipiu_32(x64emu_t *emu, uintptr_t fcn) { vFpipiu_t fn = (vFpipiu_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFpuipp_32(x64emu_t *emu, uintptr_t fcn) { vFpuipp_t fn = (vFpuipp_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFpuddd_32(x64emu_t *emu, uintptr_t fcn) { vFpuddd_t fn = (vFpuddd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28)); } +void vFpddii_32(x64emu_t *emu, uintptr_t fcn) { vFpddii_t fn = (vFpddii_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFpdddd_32(x64emu_t *emu, uintptr_t fcn) { vFpdddd_t fn = (vFpdddd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24), from_ptri(double, R_ESP + 32)); } +void vFppWui_32(x64emu_t *emu, uintptr_t fcn) { vFppWui_t fn = (vFppWui_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint16_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFpppii_32(x64emu_t *emu, uintptr_t fcn) { vFpppii_t fn = (vFpppii_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFppppu_32(x64emu_t *emu, uintptr_t fcn) { vFppppu_t fn = (vFppppu_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void vFppppp_32(x64emu_t *emu, uintptr_t fcn) { vFppppp_t fn = (vFppppp_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFXLiii_32(x64emu_t *emu, uintptr_t fcn) { vFXLiii_t fn = (vFXLiii_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFXLiiL_32(x64emu_t *emu, uintptr_t fcn) { vFXLiiL_t fn = (vFXLiiL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20))); } +void vFXLppi_32(x64emu_t *emu, uintptr_t fcn) { vFXLppi_t fn = (vFXLppi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFXpiiL_32(x64emu_t *emu, uintptr_t fcn) { vFXpiiL_t fn = (vFXpiiL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20))); } +void iEEiiip_32(x64emu_t *emu, uintptr_t fcn) { iEEiiip_t fn = (iEEiiip_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iEEiipV_32(x64emu_t *emu, uintptr_t fcn) { iEEiipV_t fn = (iEEiipV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptrv(R_ESP + 16)); emu->libc_err = errno; } +void iEEipii_32(x64emu_t *emu, uintptr_t fcn) { iEEipii_t fn = (iEEipii_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); emu->libc_err = errno; } +void iEEipuu_32(x64emu_t *emu, uintptr_t fcn) { iEEipuu_t fn = (iEEipuu_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); emu->libc_err = errno; } +void iEEipup_32(x64emu_t *emu, uintptr_t fcn) { iEEipup_t fn = (iEEipup_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iEEippi_32(x64emu_t *emu, uintptr_t fcn) { iEEippi_t fn = (iEEippi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); emu->libc_err = errno; } +void iEEippL_32(x64emu_t *emu, uintptr_t fcn) { iEEippL_t fn = (iEEippL_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); emu->libc_err = errno; } +void iEEuupi_32(x64emu_t *emu, uintptr_t fcn) { iEEuupi_t fn = (iEEuupi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); emu->libc_err = errno; } +void iFEpiup_32(x64emu_t *emu, uintptr_t fcn) { iFEpiup_t fn = (iFEpiup_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iEEpipp_32(x64emu_t *emu, uintptr_t fcn) { iEEpipp_t fn = (iEEpipp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iFEpipp_32(x64emu_t *emu, uintptr_t fcn) { iFEpipp_t fn = (iFEpipp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iEEpipV_32(x64emu_t *emu, uintptr_t fcn) { iEEpipV_t fn = (iEEpipV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptrv(R_ESP + 16)); emu->libc_err = errno; } +void iFEpuip_32(x64emu_t *emu, uintptr_t fcn) { iFEpuip_t fn = (iFEpuip_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFEpupu_32(x64emu_t *emu, uintptr_t fcn) { iFEpupu_t fn = (iFEpupu_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iEEpLpp_32(x64emu_t *emu, uintptr_t fcn) { iEEpLpp_t fn = (iEEpLpp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iFEpLpp_32(x64emu_t *emu, uintptr_t fcn) { iFEpLpp_t fn = (iFEpLpp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iEEpLpV_32(x64emu_t *emu, uintptr_t fcn) { iEEpLpV_t fn = (iEEpLpV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptrv(R_ESP + 16)); emu->libc_err = errno; } +void iFEpLpV_32(x64emu_t *emu, uintptr_t fcn) { iFEpLpV_t fn = (iFEpLpV_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptrv(R_ESP + 16)); } +void iEEppii_32(x64emu_t *emu, uintptr_t fcn) { iEEppii_t fn = (iEEppii_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); emu->libc_err = errno; } +void iFEpplp_32(x64emu_t *emu, uintptr_t fcn) { iFEpplp_t fn = (iFEpplp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void iEEpppi_32(x64emu_t *emu, uintptr_t fcn) { iEEpppi_t fn = (iEEpppi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); emu->libc_err = errno; } +void iEEpppp_32(x64emu_t *emu, uintptr_t fcn) { iEEpppp_t fn = (iEEpppp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iFEpppp_32(x64emu_t *emu, uintptr_t fcn) { iFEpppp_t fn = (iFEpppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iEESipp_32(x64emu_t *emu, uintptr_t fcn) { iEESipp_t fn = (iEESipp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, io_convert32(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; } +void iEESipV_32(x64emu_t *emu, uintptr_t fcn) { iEESipV_t fn = (iEESipV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, io_convert32(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptrv(R_ESP + 16)); emu->libc_err = errno; } +void iFEXipp_32(x64emu_t *emu, uintptr_t fcn) { iFEXipp_t fn = (iFEXipp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFEXLip_32(x64emu_t *emu, uintptr_t fcn) { iFEXLip_t fn = (iFEXLip_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFEXLlp_32(x64emu_t *emu, uintptr_t fcn) { iFEXLlp_t fn = (iFEXLlp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void iFEXLLp_32(x64emu_t *emu, uintptr_t fcn) { iFEXLLp_t fn = (iFEXLLp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void iFEXLpi_32(x64emu_t *emu, uintptr_t fcn) { iFEXLpi_t fn = (iFEXLpi_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFEXLpp_32(x64emu_t *emu, uintptr_t fcn) { iFEXLpp_t fn = (iFEXLpp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFEXpii_32(x64emu_t *emu, uintptr_t fcn) { iFEXpii_t fn = (iFEXpii_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } +void iFEXpLp_32(x64emu_t *emu, uintptr_t fcn) { iFEXpLp_t fn = (iFEXpLp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void iFEXppu_32(x64emu_t *emu, uintptr_t fcn) { iFEXppu_t fn = (iFEXppu_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void iFEXppp_32(x64emu_t *emu, uintptr_t fcn) { iFEXppp_t fn = (iFEXppp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void iFiiiui_32(x64emu_t *emu, uintptr_t fcn) { iFiiiui_t fn = (iFiiiui_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void iEiiipu_32(x64emu_t *emu, uintptr_t fcn) { iEiiipu_t fn = (iEiiipu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); emu->libc_err = errno; } +void iEiiipp_32(x64emu_t *emu, uintptr_t fcn) { iEiiipp_t fn = (iEiiipp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); emu->libc_err = errno; } +void iFiuuuu_32(x64emu_t *emu, uintptr_t fcn) { iFiuuuu_t fn = (iFiuuuu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void iFiuuuU_32(x64emu_t *emu, uintptr_t fcn) { iFiuuuU_t fn = (iFiuuuU_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint64_t, R_ESP + 20)); } +void iFiuuup_32(x64emu_t *emu, uintptr_t fcn) { iFiuuup_t fn = (iFiuuup_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFipiip_32(x64emu_t *emu, uintptr_t fcn) { iFipiip_t fn = (iFipiip_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iEipLLi_32(x64emu_t *emu, uintptr_t fcn) { iEipLLi_t fn = (iEipLLi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); emu->libc_err = errno; } +void iFippuu_32(x64emu_t *emu, uintptr_t fcn) { iFippuu_t fn = (iFippuu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void iEippLi_32(x64emu_t *emu, uintptr_t fcn) { iEippLi_t fn = (iEippLi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); emu->libc_err = errno; } +void iEipppi_32(x64emu_t *emu, uintptr_t fcn) { iEipppi_t fn = (iEipppi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); emu->libc_err = errno; } +void iEipppp_32(x64emu_t *emu, uintptr_t fcn) { iEipppp_t fn = (iEipppp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); emu->libc_err = errno; } +void iFuiuup_32(x64emu_t *emu, uintptr_t fcn) { iFuiuup_t fn = (iFuiuup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFuupid_32(x64emu_t *emu, uintptr_t fcn) { iFuupid_t fn = (iFuupid_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(double, R_ESP + 20)); } +void iFpiiuu_32(x64emu_t *emu, uintptr_t fcn) { iFpiiuu_t fn = (iFpiiuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void iFpiipp_32(x64emu_t *emu, uintptr_t fcn) { iFpiipp_t fn = (iFpiipp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFpippL_32(x64emu_t *emu, uintptr_t fcn) { iFpippL_t fn = (iFpippL_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20))); } +void iFpippp_32(x64emu_t *emu, uintptr_t fcn) { iFpippp_t fn = (iFpippp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFpCCCC_32(x64emu_t *emu, uintptr_t fcn) { iFpCCCC_t fn = (iFpCCCC_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(uint8_t, R_ESP + 20)); } +void iFpuipp_32(x64emu_t *emu, uintptr_t fcn) { iFpuipp_t fn = (iFpuipp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFpupuu_32(x64emu_t *emu, uintptr_t fcn) { iFpupuu_t fn = (iFpupuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void iFpupLu_32(x64emu_t *emu, uintptr_t fcn) { iFpupLu_t fn = (iFpupLu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(uint32_t, R_ESP + 20)); } +void iFpuppp_32(x64emu_t *emu, uintptr_t fcn) { iFpuppp_t fn = (iFpuppp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFppiUi_32(x64emu_t *emu, uintptr_t fcn) { iFppiUi_t fn = (iFppiUi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint64_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 24)); } +void iFppipp_32(x64emu_t *emu, uintptr_t fcn) { iFppipp_t fn = (iFppipp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFppWup_32(x64emu_t *emu, uintptr_t fcn) { iFppWup_t fn = (iFppWup_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint16_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFppuip_32(x64emu_t *emu, uintptr_t fcn) { iFppuip_t fn = (iFppuip_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFppupu_32(x64emu_t *emu, uintptr_t fcn) { iFppupu_t fn = (iFppupu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void iFppLpL_32(x64emu_t *emu, uintptr_t fcn) { iFppLpL_t fn = (iFppLpL_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20))); } +void iFpppip_32(x64emu_t *emu, uintptr_t fcn) { iFpppip_t fn = (iFpppip_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFpppuu_32(x64emu_t *emu, uintptr_t fcn) { iFpppuu_t fn = (iFpppuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void iEpppLi_32(x64emu_t *emu, uintptr_t fcn) { iEpppLi_t fn = (iEpppLi_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); emu->libc_err = errno; } +void iFpppLu_32(x64emu_t *emu, uintptr_t fcn) { iFpppLu_t fn = (iFpppLu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(uint32_t, R_ESP + 20)); } +void iEpppLp_32(x64emu_t *emu, uintptr_t fcn) { iEpppLp_t fn = (iEpppLp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20)); emu->libc_err = errno; } +void iFppppi_32(x64emu_t *emu, uintptr_t fcn) { iFppppi_t fn = (iFppppi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void iFppppu_32(x64emu_t *emu, uintptr_t fcn) { iFppppu_t fn = (iFppppu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void iFppppd_32(x64emu_t *emu, uintptr_t fcn) { iFppppd_t fn = (iFppppd_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(double, R_ESP + 20)); } +void iFppppL_32(x64emu_t *emu, uintptr_t fcn) { iFppppL_t fn = (iFppppL_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20))); } +void iFppppp_32(x64emu_t *emu, uintptr_t fcn) { iFppppp_t fn = (iFppppp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFXiiii_32(x64emu_t *emu, uintptr_t fcn) { iFXiiii_t fn = (iFXiiii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void iFXiiip_32(x64emu_t *emu, uintptr_t fcn) { iFXiiip_t fn = (iFXiiip_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFXiuLi_32(x64emu_t *emu, uintptr_t fcn) { iFXiuLi_t fn = (iFXiuLi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); } +void iFXiLip_32(x64emu_t *emu, uintptr_t fcn) { iFXiLip_t fn = (iFXiLip_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFXiLuu_32(x64emu_t *emu, uintptr_t fcn) { iFXiLuu_t fn = (iFXiLuu_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void iFXuuLL_32(x64emu_t *emu, uintptr_t fcn) { iFXuuLL_t fn = (iFXuuLL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ulong(from_ptri(ulong_t, R_ESP + 20))); } +void iFXLLii_32(x64emu_t *emu, uintptr_t fcn) { iFXLLii_t fn = (iFXLLii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void iFXLpii_32(x64emu_t *emu, uintptr_t fcn) { iFXLpii_t fn = (iFXLpii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void iFXLpLi_32(x64emu_t *emu, uintptr_t fcn) { iFXLpLi_t fn = (iFXLpLi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); } +void iFXLppi_32(x64emu_t *emu, uintptr_t fcn) { iFXLppi_t fn = (iFXLppi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void iFXpipi_32(x64emu_t *emu, uintptr_t fcn) { iFXpipi_t fn = (iFXpipi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void iFXpppp_32(x64emu_t *emu, uintptr_t fcn) { iFXpppp_t fn = (iFXpppp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void IFXpIII_32(x64emu_t *emu, uintptr_t fcn) { IFXpIII_t fn = (IFXpIII_t)fcn; ui64_t r; r.i = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int64_t, R_ESP + 12), from_ptri(int64_t, R_ESP + 20), from_ptri(int64_t, R_ESP + 28)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void uEEippu_32(x64emu_t *emu, uintptr_t fcn) { uEEippu_t fn = (uEEippu_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); emu->libc_err = errno; } +void uFEpipp_32(x64emu_t *emu, uintptr_t fcn) { uFEpipp_t fn = (uFEpipp_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void uFEpppp_32(x64emu_t *emu, uintptr_t fcn) { uFEpppp_t fn = (uFEpppp_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } +void uFpuupp_32(x64emu_t *emu, uintptr_t fcn) { uFpuupp_t fn = (uFpuupp_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void uEpLLLS_32(x64emu_t *emu, uintptr_t fcn) { uEpLLLS_t fn = (uEpLLLS_t)fcn; errno = emu->libc_err; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), io_convert32(from_ptriv(R_ESP + 20))); emu->libc_err = errno; } +void uFppppp_32(x64emu_t *emu, uintptr_t fcn) { uFppppp_t fn = (uFppppp_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void UFuiCiu_32(x64emu_t *emu, uintptr_t fcn) { UFuiCiu_t fn = (UFuiCiu_t)fcn; ui64_t r; r.u = (uint64_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void lFpuipC_32(x64emu_t *emu, uintptr_t fcn) { lFpuipC_t fn = (lFpuipC_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint8_t, R_ESP + 20))); } +void lFppLpL_32(x64emu_t *emu, uintptr_t fcn) { lFppLpL_t fn = (lFppLpL_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20)))); } +void LFEppLL_32(x64emu_t *emu, uintptr_t fcn) { LFEppLL_t fn = (LFEppLL_t)fcn; R_EAX = to_ulong(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)))); } +void LFEXLpi_32(x64emu_t *emu, uintptr_t fcn) { LFEXLpi_t fn = (LFEXLpi_t)fcn; R_EAX = to_ulong(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } +void LFuuuuu_32(x64emu_t *emu, uintptr_t fcn) { LFuuuuu_t fn = (LFuuuuu_t)fcn; R_EAX = to_ulong(fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20))); } +void LEpLppa_32(x64emu_t *emu, uintptr_t fcn) { LEpLppa_t fn = (LEpLppa_t)fcn; errno = emu->libc_err; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_locale(from_ptri(ptr_t, R_ESP + 20)))); emu->libc_err = errno; } +void LFXLuuu_32(x64emu_t *emu, uintptr_t fcn) { LFXLuuu_t fn = (LFXLuuu_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20))); } +void LFXLpuu_32(x64emu_t *emu, uintptr_t fcn) { LFXLpuu_t fn = (LFXLpuu_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20))); } +void LFXpppi_32(x64emu_t *emu, uintptr_t fcn) { LFXpppi_t fn = (LFXpppi_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } +void pFEppip_32(x64emu_t *emu, uintptr_t fcn) { pFEppip_t fn = (pFEppip_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16))); } +void pFEppdd_32(x64emu_t *emu, uintptr_t fcn) { pFEppdd_t fn = (pFEppdd_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20))); } +void pFEpnuu_32(x64emu_t *emu, uintptr_t fcn) { pFEpnuu_t fn = (pFEpnuu_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 8)); R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), aligned_xcb, from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16))); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 8)); } +void pFEpnup_32(x64emu_t *emu, uintptr_t fcn) { pFEpnup_t fn = (pFEpnup_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 8)); R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), aligned_xcb, from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16))); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 8)); } +void pFEXipp_32(x64emu_t *emu, uintptr_t fcn) { pFEXipp_t fn = (pFEXipp_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16))); } +void pFEXCip_32(x64emu_t *emu, uintptr_t fcn) { pFEXCip_t fn = (pFEXCip_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint8_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16))); } +void pFEXlpp_32(x64emu_t *emu, uintptr_t fcn) { pFEXlpp_t fn = (pFEXlpp_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16))); } +void pFEXLip_32(x64emu_t *emu, uintptr_t fcn) { pFEXLip_t fn = (pFEXLip_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16))); } +void pFEXpip_32(x64emu_t *emu, uintptr_t fcn) { pFEXpip_t fn = (pFEXpip_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16))); } +void pFEXppi_32(x64emu_t *emu, uintptr_t fcn) { pFEXppi_t fn = (pFEXppi_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } +void pFuiupp_32(x64emu_t *emu, uintptr_t fcn) { pFuiupp_t fn = (pFuiupp_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20))); } +void pFpiiii_32(x64emu_t *emu, uintptr_t fcn) { pFpiiii_t fn = (pFpiiii_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } +void pFpiiuu_32(x64emu_t *emu, uintptr_t fcn) { pFpiiuu_t fn = (pFpiiuu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20))); } +void pFpiipi_32(x64emu_t *emu, uintptr_t fcn) { pFpiipi_t fn = (pFpiipi_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } +void pFpipii_32(x64emu_t *emu, uintptr_t fcn) { pFpipii_t fn = (pFpipii_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } +void pFpipip_32(x64emu_t *emu, uintptr_t fcn) { pFpipip_t fn = (pFpipip_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20))); } +void pFpippi_32(x64emu_t *emu, uintptr_t fcn) { pFpippi_t fn = (pFpippi_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } +void pFpippp_32(x64emu_t *emu, uintptr_t fcn) { pFpippp_t fn = (pFpippp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20))); } +void pFpuiii_32(x64emu_t *emu, uintptr_t fcn) { pFpuiii_t fn = (pFpuiii_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } +void pFpuuuu_32(x64emu_t *emu, uintptr_t fcn) { pFpuuuu_t fn = (pFpuuuu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20))); } +void pFpuppp_32(x64emu_t *emu, uintptr_t fcn) { pFpuppp_t fn = (pFpuppp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20))); } +void pFpdddd_32(x64emu_t *emu, uintptr_t fcn) { pFpdddd_t fn = (pFpdddd_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24), from_ptri(double, R_ESP + 32))); } +void pFpLLip_32(x64emu_t *emu, uintptr_t fcn) { pFpLLip_t fn = (pFpLLip_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20))); } +void pFppipi_32(x64emu_t *emu, uintptr_t fcn) { pFppipi_t fn = (pFppipi_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } +void pFppuup_32(x64emu_t *emu, uintptr_t fcn) { pFppuup_t fn = (pFppuup_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20))); } +void pFppupp_32(x64emu_t *emu, uintptr_t fcn) { pFppupp_t fn = (pFppupp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20))); } +void pFpppii_32(x64emu_t *emu, uintptr_t fcn) { pFpppii_t fn = (pFpppii_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } +void pFppppi_32(x64emu_t *emu, uintptr_t fcn) { pFppppi_t fn = (pFppppi_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } +void pFXLipp_32(x64emu_t *emu, uintptr_t fcn) { pFXLipp_t fn = (pFXLipp_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20))); } +void pFXpipi_32(x64emu_t *emu, uintptr_t fcn) { pFXpipi_t fn = (pFXpipi_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } +void pFXpuup_32(x64emu_t *emu, uintptr_t fcn) { pFXpuup_t fn = (pFXpuup_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20))); } +void pFXppip_32(x64emu_t *emu, uintptr_t fcn) { pFXppip_t fn = (pFXppip_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20))); } +void tEpppLi_32(x64emu_t *emu, uintptr_t fcn) { tEpppLi_t fn = (tEpppLi_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20))); emu->libc_err = errno; } +void vFiuibp_i_32(x64emu_t *emu, uintptr_t fcn) { vFiuibp_i_t fn = (vFiuibp_i_t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(int32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void vFXibL_ii_32(x64emu_t *emu, uintptr_t fcn) { vFXibL_ii_t fn = (vFXibL_ii_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iEEBh_ppp_32(x64emu_t *emu, uintptr_t fcn) { iEEBh_ppp_t fn = (iEEBh_ppp_t)fcn; errno = emu->libc_err; struct_h_t arg_4={0}; R_EAX = fn(emu, *(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_h(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); emu->libc_err = errno; } +void iFpupbL_p_32(x64emu_t *emu, uintptr_t fcn) { iFpupbL_p_t fn = (iFpupbL_p_t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppibp_I_32(x64emu_t *emu, uintptr_t fcn) { iFppibp_I_t fn = (iFppibp_I_t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(int64_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppWpbp__32(x64emu_t *emu, uintptr_t fcn) { iFppWpbp__t fn = (iFppWpbp__t)fcn; struct_p_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_p(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint16_t, R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFppupbL__32(x64emu_t *emu, uintptr_t fcn) { iFppupbL__t fn = (iFppupbL__t)fcn; struct_L_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_L(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFppppbp__32(x64emu_t *emu, uintptr_t fcn) { iFppppbp__t fn = (iFppppbp__t)fcn; struct_p_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_p(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFppbL_pu_32(x64emu_t *emu, uintptr_t fcn) { iFppbL_pu_t fn = (iFppbL_pu_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFppbL_pL_32(x64emu_t *emu, uintptr_t fcn) { iFppbL_pL_t fn = (iFppbL_pL_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20))); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFppbp_pp_32(x64emu_t *emu, uintptr_t fcn) { iFppbp_pp_t fn = (iFppbp_pp_t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbp_iii_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_iii_t fn = (iFpbp_iii_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbp_ipi_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_ipi_t fn = (iFpbp_ipi_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbp_uuu_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_uuu_t fn = (iFpbp_uuu_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbp_uup_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_uup_t fn = (iFpbp_uup_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFbp_piip_32(x64emu_t *emu, uintptr_t fcn) { iFbp_piip_t fn = (iFbp_piip_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_puip_32(x64emu_t *emu, uintptr_t fcn) { iFbp_puip_t fn = (iFbp_puip_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFbp_pppi_32(x64emu_t *emu, uintptr_t fcn) { iFbp_pppi_t fn = (iFbp_pppi_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFXiibL_i_32(x64emu_t *emu, uintptr_t fcn) { iFXiibL_i_t fn = (iFXiibL_i_t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(int32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFXCupbL__32(x64emu_t *emu, uintptr_t fcn) { iFXCupbL__t fn = (iFXCupbL__t)fcn; struct_L_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_L(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFXLbL_ii_32(x64emu_t *emu, uintptr_t fcn) { iFXLbL_ii_t fn = (iFXLbL_ii_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void uFppbp_ip_32(x64emu_t *emu, uintptr_t fcn) { uFppbp_ip_t fn = (uFppbp_ip_t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void LEpbp_LLp_32(x64emu_t *emu, uintptr_t fcn) { LEpbp_LLp_t fn = (LEpbp_LLp_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void LEpBp_LLp_32(x64emu_t *emu, uintptr_t fcn) { LEpBp_LLp_t fn = (LEpBp_LLp_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +void pFpipibp__32(x64emu_t *emu, uintptr_t fcn) { pFpipibp__t fn = (pFpipibp__t)fcn; struct_p_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_p(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void pFppupbl__32(x64emu_t *emu, uintptr_t fcn) { pFppupbl__t fn = (pFppupbl__t)fcn; struct_l_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_l(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void pFppLbp_p_32(x64emu_t *emu, uintptr_t fcn) { pFppLbp_p_t fn = (pFppLbp_p_t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20))); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iEippprLL__32(x64emu_t *emu, uintptr_t fcn) { iEippprLL__t fn = (iEippprLL__t)fcn; errno = emu->libc_err; struct_LL_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_LL(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); emu->libc_err = errno; } +void iFpuibpu_p_32(x64emu_t *emu, uintptr_t fcn) { iFpuibpu_p_t fn = (iFpuibpu_p_t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpupubpu__32(x64emu_t *emu, uintptr_t fcn) { iFpupubpu__t fn = (iFpupubpu__t)fcn; struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iEpurLL_pL_32(x64emu_t *emu, uintptr_t fcn) { iEpurLL_pL_t fn = (iEpurLL_pL_t)fcn; errno = emu->libc_err; struct_LL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20))); emu->libc_err = errno; } +void iFppubpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFppubpu_u_t fn = (iFppubpu_u_t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppubpu_p_32(x64emu_t *emu, uintptr_t fcn) { iFppubpu_p_t fn = (iFppubpu_p_t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpppibpp__32(x64emu_t *emu, uintptr_t fcn) { iFpppibpp__t fn = (iFpppibpp__t)fcn; struct_pp_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pp(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pp(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFppppbup__32(x64emu_t *emu, uintptr_t fcn) { iFppppbup__t fn = (iFppppbup__t)fcn; struct_up_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_up(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_up(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFpppbpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFpppbpu_u_t fn = (iFpppbpu_u_t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppbpu_uu_32(x64emu_t *emu, uintptr_t fcn) { iFppbpu_uu_t fn = (iFppbpu_uu_t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFppbpu_pu_32(x64emu_t *emu, uintptr_t fcn) { iFppbpu_pu_t fn = (iFppbpu_pu_t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbpu_upu_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_upu_t fn = (iFpbpu_upu_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbpu_upp_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_upp_t fn = (iFpbpu_upp_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpbpu_puu_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_puu_t fn = (iFpbpu_puu_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFiiuBp_Bp__32(x64emu_t *emu, uintptr_t fcn) { iFiiuBp_Bp__t fn = (iFiiuBp_Bp__t)fcn; struct_p_t arg_16={0}; struct_p_t arg_20={0}; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFppbp_bp_p_32(x64emu_t *emu, uintptr_t fcn) { iFppbp_bp_p_t fn = (iFppbp_bp_p_t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFbp_bp_pip_32(x64emu_t *emu, uintptr_t fcn) { iFbp_bp_pip_t fn = (iFbp_bp_pip_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFbp_ppibup__32(x64emu_t *emu, uintptr_t fcn) { vFbp_ppibup__t fn = (vFbp_ppibup__t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_up_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_up(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_up(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFEXbpLiL_pp_32(x64emu_t *emu, uintptr_t fcn) { iFEXbpLiL_pp_t fn = (iFEXbpLiL_pp_t)fcn; struct_pLiL_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pLiL(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pLiL(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFpubp_bpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFpubp_bpu_u_t fn = (iFpubp_bpu_u_t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpppbp_bup__32(x64emu_t *emu, uintptr_t fcn) { iFpppbp_bup__t fn = (iFpppbp_bup__t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_up_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_up(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_up(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFbp_pbpu_uu_32(x64emu_t *emu, uintptr_t fcn) { iFbp_pbpu_uu_t fn = (iFbp_pbpu_uu_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpibp_bp_bL__32(x64emu_t *emu, uintptr_t fcn) { iFpibp_bp_bL__t fn = (iFpibp_bp_bL__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_L_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_L(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFpuubpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpuubpu_bpu__t fn = (iFpuubpu_bpu__t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFpubpu_pbpu__32(x64emu_t *emu, uintptr_t fcn) { iFpubpu_pbpu__t fn = (iFpubpu_pbpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFppbpu_bpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFppbpu_bpu_u_t fn = (iFppbpu_bpu_u_t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpbpu_bpu_uu_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu_uu_t fn = (iFpbpu_bpu_uu_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbpu_bpu_pu_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu_pu_t fn = (iFpbpu_bpu_pu_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbpu_bpu_bp_u_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu_bp_u_t fn = (iFpbpu_bpu_bp_u_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(uint32_t, R_ESP + 20)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFXLiuriiiiiLi__32(x64emu_t *emu, uintptr_t fcn) { iFXLiuriiiiiLi__t fn = (iFXLiuriiiiiLi__t)fcn; struct_iiiiiLi_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_iiiiiLi(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); } +void LELbp_bL_bp_bL__32(x64emu_t *emu, uintptr_t fcn) { LELbp_bL_bp_bL__t fn = (LELbp_bL_bp_bL__t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_L_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_L(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = to_ulong(fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); emu->libc_err = errno; } +void iFpubpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpubpu_bpu_bpu__t fn = (iFpubpu_bpu_bpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFppbpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFppbpu_bpu_bpu__t fn = (iFppbpu_bpu_bpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void uFEpbppuuuuup_ip_32(x64emu_t *emu, uintptr_t fcn) { uFEpbppuuuuup_ip_t fn = (uFEpbppuuuuup_ip_t)fcn; struct_ppuuuuup_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ppuuuuup(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void uFEpbppuuuuup_iV_32(x64emu_t *emu, uintptr_t fcn) { uFEpbppuuuuup_iV_t fn = (uFEpbppuuuuup_iV_t)fcn; struct_ppuuuuup_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ppuuuuup(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptrv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void uFppupbppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { uFppupbppuuuuup__t fn = (uFppupbppuuuuup__t)fcn; struct_ppuuuuup_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_ppuuuuup(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFbp_bp_bL_bp_bL__32(x64emu_t *emu, uintptr_t fcn) { iFbp_bp_bL_bp_bL__t fn = (iFbp_bp_bL_bp_bL__t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_L_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_L(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void vFXLbLLLLLLLLLL_iL_32(x64emu_t *emu, uintptr_t fcn) { vFXLbLLLLLLLLLL_iL_t fn = (vFXLbLLLLLLLLLL_iL_t)fcn; struct_LLLLLLLLLL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LLLLLLLLLL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20))); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_LLLLLLLLLL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXiiiBpLiiiLLLii__32(x64emu_t *emu, uintptr_t fcn) { iFXiiiBpLiiiLLLii__t fn = (iFXiiiBpLiiiLLLii__t)fcn; struct_pLiiiLLLii_t arg_20={0}; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pLiiiLLLii(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFpbpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu_bpu_bpu__t fn = (iFpbpu_bpu_bpu_bpu__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void LEpLpriiiiiiiiilt_a_32(x64emu_t *emu, uintptr_t fcn) { LEpLpriiiiiiiiilt_a_t fn = (LEpLpriiiiiiiiilt_a_t)fcn; errno = emu->libc_err; struct_iiiiiiiiilt_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_iiiiiiiiilt(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_locale(from_ptri(ptr_t, R_ESP + 20)))); emu->libc_err = errno; } +void pFEXLrLiiwwwwwwwwL_i_32(x64emu_t *emu, uintptr_t fcn) { pFEXLrLiiwwwwwwwwL_i_t fn = (pFEXLrLiiwwwwwwwwL_i_t)fcn; struct_LiiwwwwwwwwL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LiiwwwwwwwwL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16))); } +void iFXLpbLWWWcc_bLWWWcc__32(x64emu_t *emu, uintptr_t fcn) { iFXLpbLWWWcc_bLWWWcc__t fn = (iFXLpbLWWWcc_bLWWWcc__t)fcn; struct_LWWWcc_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_LWWWcc(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_LWWWcc_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_LWWWcc(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFXLpBLWWWcc_BLWWWcc__32(x64emu_t *emu, uintptr_t fcn) { iFXLpBLWWWcc_BLWWWcc__t fn = (iFXLpBLWWWcc_BLWWWcc__t)fcn; struct_LWWWcc_t arg_16={0}; struct_LWWWcc_t arg_20={0}; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void LFXLrLiiwwwwwwwwL_LriLiiiiLiiiiLi__32(x64emu_t *emu, uintptr_t fcn) { LFXLrLiiwwwwwwwwL_LriLiiiiLiiiiLi__t fn = (LFXLrLiiwwwwwwwwL_LriLiiiiLiiiiLi__t)fcn; struct_LiiwwwwwwwwL_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_LiiwwwwwwwwL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_iLiiiiLiiiiLi_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_iLiiiiLiiiiLi(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 16)), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL)); } +void vFEiiipp_32(x64emu_t *emu, uintptr_t fcn) { vFEiiipp_t fn = (vFEiiipp_t)fcn; fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFEuippp_32(x64emu_t *emu, uintptr_t fcn) { vFEuippp_t fn = (vFEuippp_t)fcn; fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void vFEupupi_32(x64emu_t *emu, uintptr_t fcn) { vFEupupi_t fn = (vFEupupi_t)fcn; fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void vFiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiii_t fn = (vFiiiiii_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFiiiuil_32(x64emu_t *emu, uintptr_t fcn) { vFiiiuil_t fn = (vFiiiuil_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_long(from_ptri(long_t, R_ESP + 24))); } +void vFiiilpi_32(x64emu_t *emu, uintptr_t fcn) { vFiiilpi_t fn = (vFiiilpi_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFiiuilp_32(x64emu_t *emu, uintptr_t fcn) { vFiiuilp_t fn = (vFiiuilp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_long(from_ptri(long_t, R_ESP + 20)), from_ptriv(R_ESP + 24)); } +void vFiffiff_32(x64emu_t *emu, uintptr_t fcn) { vFiffiff_t fn = (vFiffiff_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24)); } +void vFiddidd_32(x64emu_t *emu, uintptr_t fcn) { vFiddidd_t fn = (vFiddidd_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(int32_t, R_ESP + 24), from_ptri(double, R_ESP + 28), from_ptri(double, R_ESP + 36)); } +void vFilipli_32(x64emu_t *emu, uintptr_t fcn) { vFilipli_t fn = (vFilipli_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_long(from_ptri(long_t, R_ESP + 20)), from_ptri(int32_t, R_ESP + 24)); } +void vFiliplu_32(x64emu_t *emu, uintptr_t fcn) { vFiliplu_t fn = (vFiliplu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_long(from_ptri(long_t, R_ESP + 20)), from_ptri(uint32_t, R_ESP + 24)); } +void vFipiplp_32(x64emu_t *emu, uintptr_t fcn) { vFipiplp_t fn = (vFipiplp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_long(from_ptri(long_t, R_ESP + 20)), from_ptriv(R_ESP + 24)); } +void vFCCCCff_32(x64emu_t *emu, uintptr_t fcn) { vFCCCCff_t fn = (vFCCCCff_t)fcn; fn(from_ptri(uint8_t, R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24)); } +void vFuiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiii_t fn = (vFuiiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFuiiiip_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiip_t fn = (vFuiiiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuiiuii_32(x64emu_t *emu, uintptr_t fcn) { vFuiiuii_t fn = (vFuiiuii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFuiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuiiuup_t fn = (vFuiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuiIIII_32(x64emu_t *emu, uintptr_t fcn) { vFuiIIII_t fn = (vFuiIIII_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 12), from_ptri(int64_t, R_ESP + 20), from_ptri(int64_t, R_ESP + 28), from_ptri(int64_t, R_ESP + 36)); } +void vFuiuiii_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiii_t fn = (vFuiuiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFuiuiiC_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiC_t fn = (vFuiuiiC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint8_t, R_ESP + 24)); } +void vFuiuiil_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiil_t fn = (vFuiuiil_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_long(from_ptri(long_t, R_ESP + 24))); } +void vFuiuiuu_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiuu_t fn = (vFuiuiuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); } +void vFuiuiuU_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiuU_t fn = (vFuiuiuU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint64_t, R_ESP + 24)); } +void vFuiuCip_32(x64emu_t *emu, uintptr_t fcn) { vFuiuCip_t fn = (vFuiuCip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuiuuip_32(x64emu_t *emu, uintptr_t fcn) { vFuiuuip_t fn = (vFuiuuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuiuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuiuuuu_t fn = (vFuiuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); } +void vFuiupii_32(x64emu_t *emu, uintptr_t fcn) { vFuiupii_t fn = (vFuiupii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFuiupiu_32(x64emu_t *emu, uintptr_t fcn) { vFuiupiu_t fn = (vFuiupiu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); } +void vFuiUUUU_32(x64emu_t *emu, uintptr_t fcn) { vFuiUUUU_t fn = (vFuiUUUU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 12), from_ptri(uint64_t, R_ESP + 20), from_ptri(uint64_t, R_ESP + 28), from_ptri(uint64_t, R_ESP + 36)); } +void vFuiffff_32(x64emu_t *emu, uintptr_t fcn) { vFuiffff_t fn = (vFuiffff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24)); } +void vFuidddd_32(x64emu_t *emu, uintptr_t fcn) { vFuidddd_t fn = (vFuidddd_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28), from_ptri(double, R_ESP + 36)); } +void vFuipiup_32(x64emu_t *emu, uintptr_t fcn) { vFuipiup_t fn = (vFuipiup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuCuuip_32(x64emu_t *emu, uintptr_t fcn) { vFuCuuip_t fn = (vFuCuuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuuiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiii_t fn = (vFuuiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFuuiuii_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuii_t fn = (vFuuiuii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFuuiuil_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuil_t fn = (vFuuiuil_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_long(from_ptri(long_t, R_ESP + 24))); } +void vFuuiuip_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuip_t fn = (vFuuiuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuuiuCu_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuCu_t fn = (vFuuiuCu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint8_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); } +void vFuuiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuup_t fn = (vFuuiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuuuiii_32(x64emu_t *emu, uintptr_t fcn) { vFuuuiii_t fn = (vFuuuiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFuuuiup_32(x64emu_t *emu, uintptr_t fcn) { vFuuuiup_t fn = (vFuuuiup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuuuipC_32(x64emu_t *emu, uintptr_t fcn) { vFuuuipC_t fn = (vFuuuipC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(uint8_t, R_ESP + 24)); } +void vFuuuipp_32(x64emu_t *emu, uintptr_t fcn) { vFuuuipp_t fn = (vFuuuipp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuuuuii_32(x64emu_t *emu, uintptr_t fcn) { vFuuuuii_t fn = (vFuuuuii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFuuuuip_32(x64emu_t *emu, uintptr_t fcn) { vFuuuuip_t fn = (vFuuuuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuuuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuuuuu_t fn = (vFuuuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); } +void vFuuuull_32(x64emu_t *emu, uintptr_t fcn) { vFuuuull_t fn = (vFuuuull_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_long(from_ptri(long_t, R_ESP + 20)), from_long(from_ptri(long_t, R_ESP + 24))); } +void vFuuuppi_32(x64emu_t *emu, uintptr_t fcn) { vFuuuppi_t fn = (vFuuuppi_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFuuuppp_32(x64emu_t *emu, uintptr_t fcn) { vFuuuppp_t fn = (vFuuuppp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuuffff_32(x64emu_t *emu, uintptr_t fcn) { vFuuffff_t fn = (vFuuffff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24)); } +void vFuudddd_32(x64emu_t *emu, uintptr_t fcn) { vFuudddd_t fn = (vFuudddd_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28), from_ptri(double, R_ESP + 36)); } +void vFuupiii_32(x64emu_t *emu, uintptr_t fcn) { vFuupiii_t fn = (vFuupiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFuupupp_32(x64emu_t *emu, uintptr_t fcn) { vFuupupp_t fn = (vFuupupp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFuuplii_32(x64emu_t *emu, uintptr_t fcn) { vFuuplii_t fn = (vFuuplii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFuffiip_32(x64emu_t *emu, uintptr_t fcn) { vFuffiip_t fn = (vFuffiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFufffff_32(x64emu_t *emu, uintptr_t fcn) { vFufffff_t fn = (vFufffff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24)); } +void vFuddiip_32(x64emu_t *emu, uintptr_t fcn) { vFuddiip_t fn = (vFuddiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void vFulluUC_32(x64emu_t *emu, uintptr_t fcn) { vFulluUC_t fn = (vFulluUC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint64_t, R_ESP + 20), from_ptri(uint8_t, R_ESP + 28)); } +void vFupiiii_32(x64emu_t *emu, uintptr_t fcn) { vFupiiii_t fn = (vFupiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFffffff_32(x64emu_t *emu, uintptr_t fcn) { vFffffff_t fn = (vFffffff_t)fcn; fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24)); } +void vFdddddd_32(x64emu_t *emu, uintptr_t fcn) { vFdddddd_t fn = (vFdddddd_t)fcn; fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28), from_ptri(double, R_ESP + 36), from_ptri(double, R_ESP + 44)); } +void vFpipipV_32(x64emu_t *emu, uintptr_t fcn) { vFpipipV_t fn = (vFpipipV_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptrv(R_ESP + 24)); } +void vFpudddd_32(x64emu_t *emu, uintptr_t fcn) { vFpudddd_t fn = (vFpudddd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28), from_ptri(double, R_ESP + 36)); } +void vFpdddii_32(x64emu_t *emu, uintptr_t fcn) { vFpdddii_t fn = (vFpdddii_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36)); } +void vFpddddd_32(x64emu_t *emu, uintptr_t fcn) { vFpddddd_t fn = (vFpddddd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24), from_ptri(double, R_ESP + 32), from_ptri(double, R_ESP + 40)); } +void vFpppppp_32(x64emu_t *emu, uintptr_t fcn) { vFpppppp_t fn = (vFpppppp_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFXiLppi_32(x64emu_t *emu, uintptr_t fcn) { vFXiLppi_t fn = (vFXiLppi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFXLiiii_32(x64emu_t *emu, uintptr_t fcn) { vFXLiiii_t fn = (vFXLiiii_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFXLiiiL_32(x64emu_t *emu, uintptr_t fcn) { vFXLiiiL_t fn = (vFXLiiiL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ulong(from_ptri(ulong_t, R_ESP + 24))); } +void vFXLiipi_32(x64emu_t *emu, uintptr_t fcn) { vFXLiipi_t fn = (vFXLiipi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFXLpppi_32(x64emu_t *emu, uintptr_t fcn) { vFXLpppi_t fn = (vFXLpppi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFXpiiii_32(x64emu_t *emu, uintptr_t fcn) { vFXpiiii_t fn = (vFXpiiii_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void iEEiippi_32(x64emu_t *emu, uintptr_t fcn) { iEEiippi_t fn = (iEEiippi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); emu->libc_err = errno; } +void iEEiLLLL_32(x64emu_t *emu, uintptr_t fcn) { iEEiLLLL_t fn = (iEEiLLLL_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ulong(from_ptri(ulong_t, R_ESP + 20))); emu->libc_err = errno; } +void iEEipiup_32(x64emu_t *emu, uintptr_t fcn) { iEEipiup_t fn = (iEEipiup_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); emu->libc_err = errno; } +void iEEippup_32(x64emu_t *emu, uintptr_t fcn) { iEEippup_t fn = (iEEippup_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); emu->libc_err = errno; } +void iEEuppLp_32(x64emu_t *emu, uintptr_t fcn) { iEEuppLp_t fn = (iEEuppLp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20)); emu->libc_err = errno; } +void iEEpiipi_32(x64emu_t *emu, uintptr_t fcn) { iEEpiipi_t fn = (iEEpiipi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); emu->libc_err = errno; } +void iFEpiipi_32(x64emu_t *emu, uintptr_t fcn) { iFEpiipi_t fn = (iFEpiipi_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void iEEpiipV_32(x64emu_t *emu, uintptr_t fcn) { iEEpiipV_t fn = (iEEpiipV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptrv(R_ESP + 20)); emu->libc_err = errno; } +void iFEpiuuu_32(x64emu_t *emu, uintptr_t fcn) { iFEpiuuu_t fn = (iFEpiuuu_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void iEEpiLpp_32(x64emu_t *emu, uintptr_t fcn) { iEEpiLpp_t fn = (iEEpiLpp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); emu->libc_err = errno; } +void iEEpipOi_32(x64emu_t *emu, uintptr_t fcn) { iEEpipOi_t fn = (iEEpipOi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), of_convert32(from_ptri(int32_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); emu->libc_err = errno; } +void iFEpuuip_32(x64emu_t *emu, uintptr_t fcn) { iFEpuuip_t fn = (iFEpuuip_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFEpuuup_32(x64emu_t *emu, uintptr_t fcn) { iFEpuuup_t fn = (iFEpuuup_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFEplluu_32(x64emu_t *emu, uintptr_t fcn) { iFEplluu_t fn = (iFEplluu_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } +void iFEpLlpp_32(x64emu_t *emu, uintptr_t fcn) { iFEpLlpp_t fn = (iFEpLlpp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_long(from_ptri(long_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFEppipp_32(x64emu_t *emu, uintptr_t fcn) { iFEppipp_t fn = (iFEppipp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iEEppupi_32(x64emu_t *emu, uintptr_t fcn) { iEEppupi_t fn = (iEEppupi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); emu->libc_err = errno; } +void iFEppllp_32(x64emu_t *emu, uintptr_t fcn) { iFEppllp_t fn = (iFEppllp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16)), from_ptriv(R_ESP + 20)); } +void iEEpppup_32(x64emu_t *emu, uintptr_t fcn) { iEEpppup_t fn = (iEEpppup_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); emu->libc_err = errno; } +void iEEpppLp_32(x64emu_t *emu, uintptr_t fcn) { iEEpppLp_t fn = (iEEpppLp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20)); emu->libc_err = errno; } +void iFEXLilp_32(x64emu_t *emu, uintptr_t fcn) { iFEXLilp_t fn = (iFEXLilp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_ptriv(R_ESP + 20)); } +void iFEXLpiL_32(x64emu_t *emu, uintptr_t fcn) { iFEXLpiL_t fn = (iFEXLpiL_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20))); } +void iFEXpiip_32(x64emu_t *emu, uintptr_t fcn) { iFEXpiip_t fn = (iFEXpiip_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFEXpiup_32(x64emu_t *emu, uintptr_t fcn) { iFEXpiup_t fn = (iFEXpiup_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFEXpppp_32(x64emu_t *emu, uintptr_t fcn) { iFEXpppp_t fn = (iFEXpppp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFiuuuup_32(x64emu_t *emu, uintptr_t fcn) { iFiuuuup_t fn = (iFiuuuup_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFiuuupu_32(x64emu_t *emu, uintptr_t fcn) { iFiuuupu_t fn = (iFiuuupu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); } +void iFiuuUpU_32(x64emu_t *emu, uintptr_t fcn) { iFiuuUpU_t fn = (iFiuuUpU_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint64_t, R_ESP + 16), from_ptriv(R_ESP + 24), from_ptri(uint64_t, R_ESP + 28)); } +void iFiuuppp_32(x64emu_t *emu, uintptr_t fcn) { iFiuuppp_t fn = (iFiuuppp_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFiuUuUu_32(x64emu_t *emu, uintptr_t fcn) { iFiuUuUu_t fn = (iFiuUuUu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint64_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 32)); } +void iEipipLu_32(x64emu_t *emu, uintptr_t fcn) { iEipipLu_t fn = (iEipipLu_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ptri(uint32_t, R_ESP + 24)); emu->libc_err = errno; } +void iFipuIup_32(x64emu_t *emu, uintptr_t fcn) { iFipuIup_t fn = (iFipuIup_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int64_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void iFuiiuup_32(x64emu_t *emu, uintptr_t fcn) { iFuiiuup_t fn = (iFuiiuup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFupLpLp_32(x64emu_t *emu, uintptr_t fcn) { iFupLpLp_t fn = (iFupLpLp_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ptriv(R_ESP + 24)); } +void iFpiippp_32(x64emu_t *emu, uintptr_t fcn) { iFpiippp_t fn = (iFpiippp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFppiiii_32(x64emu_t *emu, uintptr_t fcn) { iFppiiii_t fn = (iFppiiii_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void iFppiipi_32(x64emu_t *emu, uintptr_t fcn) { iFppiipi_t fn = (iFppiipi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void iFppipip_32(x64emu_t *emu, uintptr_t fcn) { iFppipip_t fn = (iFppipip_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFppippi_32(x64emu_t *emu, uintptr_t fcn) { iFppippi_t fn = (iFppippi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void iFppuIII_32(x64emu_t *emu, uintptr_t fcn) { iFppuIII_t fn = (iFppuIII_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int64_t, R_ESP + 16), from_ptri(int64_t, R_ESP + 24), from_ptri(int64_t, R_ESP + 32)); } +void iFppulll_32(x64emu_t *emu, uintptr_t fcn) { iFppulll_t fn = (iFppulll_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_long(from_ptri(long_t, R_ESP + 20)), from_long(from_ptri(long_t, R_ESP + 24))); } +void iFpppuuu_32(x64emu_t *emu, uintptr_t fcn) { iFpppuuu_t fn = (iFpppuuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); } +void iFpppupu_32(x64emu_t *emu, uintptr_t fcn) { iFpppupu_t fn = (iFpppupu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); } +void iFpppppp_32(x64emu_t *emu, uintptr_t fcn) { iFpppppp_t fn = (iFpppppp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFpppppS_32(x64emu_t *emu, uintptr_t fcn) { iFpppppS_t fn = (iFpppppS_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), io_convert32(from_ptriv(R_ESP + 24))); } +void iFXiiiii_32(x64emu_t *emu, uintptr_t fcn) { iFXiiiii_t fn = (iFXiiiii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void iFXiiLip_32(x64emu_t *emu, uintptr_t fcn) { iFXiiLip_t fn = (iFXiiLip_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFXiippp_32(x64emu_t *emu, uintptr_t fcn) { iFXiippp_t fn = (iFXiippp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFXuuuuu_32(x64emu_t *emu, uintptr_t fcn) { iFXuuuuu_t fn = (iFXuuuuu_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); } +void iFXLiiiL_32(x64emu_t *emu, uintptr_t fcn) { iFXLiiiL_t fn = (iFXLiiiL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ulong(from_ptri(ulong_t, R_ESP + 24))); } +void iFXLiiip_32(x64emu_t *emu, uintptr_t fcn) { iFXLiiip_t fn = (iFXLiiip_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFXLiiuu_32(x64emu_t *emu, uintptr_t fcn) { iFXLiiuu_t fn = (iFXLiiuu_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); } +void iFXLuupp_32(x64emu_t *emu, uintptr_t fcn) { iFXLuupp_t fn = (iFXLuupp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFXLupip_32(x64emu_t *emu, uintptr_t fcn) { iFXLupip_t fn = (iFXLupip_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFXLLLLL_32(x64emu_t *emu, uintptr_t fcn) { iFXLLLLL_t fn = (iFXLLLLL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ulong(from_ptri(ulong_t, R_ESP + 24))); } +void iFXLppii_32(x64emu_t *emu, uintptr_t fcn) { iFXLppii_t fn = (iFXLppii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void iFXLpppp_32(x64emu_t *emu, uintptr_t fcn) { iFXLpppp_t fn = (iFXLpppp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFXpIppp_32(x64emu_t *emu, uintptr_t fcn) { iFXpIppp_t fn = (iFXpIppp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int64_t, R_ESP + 12), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); } +void iFXpuiii_32(x64emu_t *emu, uintptr_t fcn) { iFXpuiii_t fn = (iFXpuiii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void iFXpLiWL_32(x64emu_t *emu, uintptr_t fcn) { iFXpLiWL_t fn = (iFXpLiWL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptri(uint16_t, R_ESP + 20), from_ulong(from_ptri(ulong_t, R_ESP + 24))); } +void iFXpLLiL_32(x64emu_t *emu, uintptr_t fcn) { iFXpLLiL_t fn = (iFXpLLiL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ulong(from_ptri(ulong_t, R_ESP + 24))); } +void iFXppppi_32(x64emu_t *emu, uintptr_t fcn) { iFXppppi_t fn = (iFXppppi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void uFEpippi_32(x64emu_t *emu, uintptr_t fcn) { uFEpippi_t fn = (uFEpippi_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20)); } +void uFupuufp_32(x64emu_t *emu, uintptr_t fcn) { uFupuufp_t fn = (uFupuufp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void uFpppppp_32(x64emu_t *emu, uintptr_t fcn) { uFpppppp_t fn = (uFpppppp_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void lEipLipu_32(x64emu_t *emu, uintptr_t fcn) { lEipLipu_t fn = (lEipLipu_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(uint32_t, R_ESP + 24))); emu->libc_err = errno; } +void lEipLipp_32(x64emu_t *emu, uintptr_t fcn) { lEipLipp_t fn = (lEipLipp_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24))); emu->libc_err = errno; } +void pFEpiiuu_32(x64emu_t *emu, uintptr_t fcn) { pFEpiiuu_t fn = (pFEpiiuu_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20))); } +void pEEpLLiN_32(x64emu_t *emu, uintptr_t fcn) { pEEpLLiN_t fn = (pEEpLLiN_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20))); emu->libc_err = errno; } +void pEEppLLp_32(x64emu_t *emu, uintptr_t fcn) { pEEppLLp_t fn = (pEEppLLp_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20))); emu->libc_err = errno; } +void pFEpnCWp_32(x64emu_t *emu, uintptr_t fcn) { pFEpnCWp_t fn = (pFEpnCWp_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 8)); R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), aligned_xcb, from_ptri(uint8_t, R_ESP + 12), from_ptri(uint16_t, R_ESP + 16), from_ptriv(R_ESP + 20))); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 8)); } +void pFEXLLLp_32(x64emu_t *emu, uintptr_t fcn) { pFEXLLLp_t fn = (pFEXLLLp_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20))); } +void pFEXLpii_32(x64emu_t *emu, uintptr_t fcn) { pFEXLpii_t fn = (pFEXLpii_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } +void pFEXpppp_32(x64emu_t *emu, uintptr_t fcn) { pFEXpppp_t fn = (pFEXpppp_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20))); } +void pFWCiWCi_32(x64emu_t *emu, uintptr_t fcn) { pFWCiWCi_t fn = (pFWCiWCi_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint16_t, R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint16_t, R_ESP + 16), from_ptri(uint8_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24))); } +void pFdddddd_32(x64emu_t *emu, uintptr_t fcn) { pFdddddd_t fn = (pFdddddd_t)fcn; R_EAX = to_ptrv(fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28), from_ptri(double, R_ESP + 36), from_ptri(double, R_ESP + 44))); } +void pFLppppp_32(x64emu_t *emu, uintptr_t fcn) { pFLppppp_t fn = (pFLppppp_t)fcn; R_EAX = to_ptrv(fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24))); } +void pFpiiiiu_32(x64emu_t *emu, uintptr_t fcn) { pFpiiiiu_t fn = (pFpiiiiu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24))); } +void pFpiipip_32(x64emu_t *emu, uintptr_t fcn) { pFpiipip_t fn = (pFpiipip_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24))); } +void pFpiippp_32(x64emu_t *emu, uintptr_t fcn) { pFpiippp_t fn = (pFpiippp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24))); } +void pFpipipL_32(x64emu_t *emu, uintptr_t fcn) { pFpipipL_t fn = (pFpipipL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ulong(from_ptri(ulong_t, R_ESP + 24)))); } +void pFpipipp_32(x64emu_t *emu, uintptr_t fcn) { pFpipipp_t fn = (pFpipipp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24))); } +void pFpipuii_32(x64emu_t *emu, uintptr_t fcn) { pFpipuii_t fn = (pFpipuii_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24))); } +void pFpuuupu_32(x64emu_t *emu, uintptr_t fcn) { pFpuuupu_t fn = (pFpuuupu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(uint32_t, R_ESP + 24))); } +void XFpppppp_32(x64emu_t *emu, uintptr_t fcn) { XFpppppp_t fn = (XFpppppp_t)fcn; R_EAX = to_ptrv(addDisplay(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)))); } +void iFpupupbL__32(x64emu_t *emu, uintptr_t fcn) { iFpupupbL__t fn = (iFpupupbL__t)fcn; struct_L_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_L(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFpupbL_pp_32(x64emu_t *emu, uintptr_t fcn) { iFpupbL_pp_t fn = (iFpupbL_pp_t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFppuupbL__32(x64emu_t *emu, uintptr_t fcn) { iFppuupbL__t fn = (iFppuupbL__t)fcn; struct_L_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_L(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFppupbL_p_32(x64emu_t *emu, uintptr_t fcn) { iFppupbL_p_t fn = (iFppupbL_p_t)fcn; struct_L_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_L(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptriv(R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFpppibp_p_32(x64emu_t *emu, uintptr_t fcn) { iFpppibp_p_t fn = (iFpppibp_p_t)fcn; struct_p_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_p(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptriv(R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFpppppbp__32(x64emu_t *emu, uintptr_t fcn) { iFpppppbp__t fn = (iFpppppbp__t)fcn; struct_p_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_p(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFpppbp_pp_32(x64emu_t *emu, uintptr_t fcn) { iFpppbp_pp_t fn = (iFpppbp_pp_t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpbp_iuii_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_iuii_t fn = (iFpbp_iuii_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFXibL_ppu_32(x64emu_t *emu, uintptr_t fcn) { iFXibL_ppu_t fn = (iFXibL_ppu_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXLiiibL__32(x64emu_t *emu, uintptr_t fcn) { iFXLiiibL__t fn = (iFXLiiibL__t)fcn; struct_L_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_L(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFXLLLLbL__32(x64emu_t *emu, uintptr_t fcn) { iFXLLLLbL__t fn = (iFXLLLLbL__t)fcn; struct_L_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_L(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ulong(from_ptri(ulong_t, R_ESP + 20)), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFXLbL_ipi_32(x64emu_t *emu, uintptr_t fcn) { iFXLbL_ipi_t fn = (iFXLbL_ipi_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXbL_upip_32(x64emu_t *emu, uintptr_t fcn) { iFXbL_upip_t fn = (iFXbL_upip_t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void pFEppibp_p_32(x64emu_t *emu, uintptr_t fcn) { pFEppibp_p_t fn = (pFEppibp_p_t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20))); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void pEEppbL_Lp_32(x64emu_t *emu, uintptr_t fcn) { pEEppbL_Lp_t fn = (pEEppbL_Lp_t)fcn; errno = emu->libc_err; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20))); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); emu->libc_err = errno; } +void iEEipuurLL__32(x64emu_t *emu, uintptr_t fcn) { iEEipuurLL__t fn = (iEEipuurLL__t)fcn; errno = emu->libc_err; struct_LL_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_LL(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); emu->libc_err = errno; } +void iEippprLL_p_32(x64emu_t *emu, uintptr_t fcn) { iEippprLL_p_t fn = (iEippprLL_p_t)fcn; errno = emu->libc_err; struct_LL_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_LL(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptriv(R_ESP + 24)); emu->libc_err = errno; } +void iFupupLbpu__32(x64emu_t *emu, uintptr_t fcn) { iFupupLbpu__t fn = (iFupupLbpu__t)fcn; struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20)), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFppppibpp__32(x64emu_t *emu, uintptr_t fcn) { iFppppibpp__t fn = (iFppppibpp__t)fcn; struct_pp_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pp(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pp(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFpppbpu_uu_32(x64emu_t *emu, uintptr_t fcn) { iFpppbpu_uu_t fn = (iFpppbpu_uu_t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpbpu_uppu_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_uppu_t fn = (iFpbpu_uppu_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void iFbpu_pLpLp_32(x64emu_t *emu, uintptr_t fcn) { iFbpu_pLpLp_t fn = (iFbpu_pLpLp_t)fcn; struct_pu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ptriv(R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void iFpuuubupu_u_32(x64emu_t *emu, uintptr_t fcn) { iFpuuubupu_u_t fn = (iFpuuubupu_u_t)fcn; struct_upu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_upu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptri(uint32_t, R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_upu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFppbL_pbL_p_32(x64emu_t *emu, uintptr_t fcn) { iFppbL_pbL_p_t fn = (iFppbL_pbL_p_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_L_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_L(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptriv(R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFppbp_pbp_p_32(x64emu_t *emu, uintptr_t fcn) { iFppbp_pbp_p_t fn = (iFppbp_pbp_p_t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_p(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptriv(R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFpibp_pibpp__32(x64emu_t *emu, uintptr_t fcn) { iFpibp_pibpp__t fn = (iFpibp_pibpp__t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pp_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pp(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pp(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFpuubpu_pbL__32(x64emu_t *emu, uintptr_t fcn) { iFpuubpu_pbL__t fn = (iFpuubpu_pbL__t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_L_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_L(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFbpu_puupbL__32(x64emu_t *emu, uintptr_t fcn) { iFbpu_puupbL__t fn = (iFbpu_puupbL__t)fcn; struct_pu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_L_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_L(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFpppbp_bp_bL__32(x64emu_t *emu, uintptr_t fcn) { iFpppbp_bp_bL__t fn = (iFpppbp_bp_bL__t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_p_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_p(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_L_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_L(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFpbpu_bpu_uuu_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu_uuu_t fn = (iFpbpu_bpu_uuu_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbpu_bpu_upu_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu_upu_t fn = (iFpbpu_bpu_upu_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFpbp_bp_bp_ii_32(x64emu_t *emu, uintptr_t fcn) { iFpbp_bp_bp_ii_t fn = (iFpbp_bp_bp_ii_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFrpuu_Lrpuu_Lui_32(x64emu_t *emu, uintptr_t fcn) { iFrpuu_Lrpuu_Lui_t fn = (iFrpuu_Lrpuu_Lui_t)fcn; struct_puu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_puu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_puu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_puu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void iFXbLip_uubLip_L_32(x64emu_t *emu, uintptr_t fcn) { iFXbLip_uubLip_L_t fn = (iFXbLip_uubLip_L_t)fcn; struct_Lip_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_Lip(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_Lip_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_Lip(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 24))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_Lip(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_Lip(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void vFbp_bppup_ippbp__32(x64emu_t *emu, uintptr_t fcn) { vFbp_bppup_ippbp__t fn = (vFbp_bppup_ippbp__t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_ppup_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_ppup(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_p_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_p(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_ppup(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFpupbpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpupbpu_bpu_bpu__t fn = (iFpupbpu_bpu_bpu__t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFpubpu_bpu_bpu_p_32(x64emu_t *emu, uintptr_t fcn) { iFpubpu_bpu_bpu_p_t fn = (iFpubpu_bpu_bpu_p_t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptriv(R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFpbpu_bpu_bpu_uu_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu_bpu_uu_t fn = (iFpbpu_bpu_bpu_uu_t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void uFEppppbppuuuuup__32(x64emu_t *emu, uintptr_t fcn) { uFEppppbppuuuuup__t fn = (uFEppppbppuuuuup__t)fcn; struct_ppuuuuup_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_ppuuuuup(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_ppuuuuup(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFpubpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpubpu_bpu_bpu_bpu__t fn = (iFpubpu_bpu_bpu_bpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFppbpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFppbpu_bpu_bpu_bpu__t fn = (iFppbpu_bpu_bpu_bpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFpbpu_bpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu_bpu_bpu_bpu__t fn = (iFpbpu_bpu_bpu_bpu_bpu__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void vFEuuippp_32(x64emu_t *emu, uintptr_t fcn) { vFEuuippp_t fn = (vFEuuippp_t)fcn; fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFEupupip_32(x64emu_t *emu, uintptr_t fcn) { vFEupupip_t fn = (vFEupupip_t)fcn; fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24)); } +void vFEppupui_32(x64emu_t *emu, uintptr_t fcn) { vFEppupui_t fn = (vFEppupui_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFiiiiiip_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiiip_t fn = (vFiiiiiip_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiuup_t fn = (vFiiiiuup_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFiiuilil_32(x64emu_t *emu, uintptr_t fcn) { vFiiuilil_t fn = (vFiiuilil_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_long(from_ptri(long_t, R_ESP + 20)), from_ptri(int32_t, R_ESP + 24), from_long(from_ptri(long_t, R_ESP + 28))); } +void vFiiffffp_32(x64emu_t *emu, uintptr_t fcn) { vFiiffffp_t fn = (vFiiffffp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFiuulipi_32(x64emu_t *emu, uintptr_t fcn) { vFiuulipi_t fn = (vFiuulipi_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFiupuuup_32(x64emu_t *emu, uintptr_t fcn) { vFiupuuup_t fn = (vFiupuuup_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFilipliu_32(x64emu_t *emu, uintptr_t fcn) { vFilipliu_t fn = (vFilipliu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_long(from_ptri(long_t, R_ESP + 20)), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28)); } +void vFilulipi_32(x64emu_t *emu, uintptr_t fcn) { vFilulipi_t fn = (vFilulipi_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFCCCCfff_32(x64emu_t *emu, uintptr_t fcn) { vFCCCCfff_t fn = (vFCCCCfff_t)fcn; fn(from_ptri(uint8_t, R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28)); } +void vFuiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiii_t fn = (vFuiiiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFuiiiiiC_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiC_t fn = (vFuiiiiiC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint8_t, R_ESP + 28)); } +void vFuiiiuip_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiuip_t fn = (vFuiiiuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFuiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiuup_t fn = (vFuiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFuiuiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiii_t fn = (vFuiuiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFuiuiiiC_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiC_t fn = (vFuiuiiiC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint8_t, R_ESP + 28)); } +void vFuiuiiip_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiip_t fn = (vFuiuiiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFuiuiiuU_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiuU_t fn = (vFuiuiiuU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint64_t, R_ESP + 28)); } +void vFuiuCiuu_32(x64emu_t *emu, uintptr_t fcn) { vFuiuCiuu_t fn = (vFuiuCiuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28)); } +void vFuiupiiu_32(x64emu_t *emu, uintptr_t fcn) { vFuiupiiu_t fn = (vFuiupiiu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28)); } +void vFuiupuip_32(x64emu_t *emu, uintptr_t fcn) { vFuiupuip_t fn = (vFuiupuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFuipiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuipiiii_t fn = (vFuipiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFuipffff_32(x64emu_t *emu, uintptr_t fcn) { vFuipffff_t fn = (vFuipffff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28)); } +void vFuipdddd_32(x64emu_t *emu, uintptr_t fcn) { vFuipdddd_t fn = (vFuipdddd_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24), from_ptri(double, R_ESP + 32), from_ptri(double, R_ESP + 40)); } +void vFuuiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiii_t fn = (vFuuiiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFuuiiiiC_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiC_t fn = (vFuuiiiiC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint8_t, R_ESP + 28)); } +void vFuuiiiiu_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiu_t fn = (vFuuiiiiu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28)); } +void vFuuiiiip_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiip_t fn = (vFuuiiiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFuuiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiuup_t fn = (vFuuiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFuuiCiui_32(x64emu_t *emu, uintptr_t fcn) { vFuuiCiui_t fn = (vFuuiCiui_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFuuiCiuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuiCiuu_t fn = (vFuuiCiuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28)); } +void vFuuiuiii_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuiii_t fn = (vFuuiuiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFuuiuiiC_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiC_t fn = (vFuuiuiiC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint8_t, R_ESP + 28)); } +void vFuuipppp_32(x64emu_t *emu, uintptr_t fcn) { vFuuipppp_t fn = (vFuuipppp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFuuuiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuuuiiii_t fn = (vFuuuiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFuuuiiCp_32(x64emu_t *emu, uintptr_t fcn) { vFuuuiiCp_t fn = (vFuuuiiCp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint8_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFuuuiuil_32(x64emu_t *emu, uintptr_t fcn) { vFuuuiuil_t fn = (vFuuuiuil_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_long(from_ptri(long_t, R_ESP + 28))); } +void vFuuuiupi_32(x64emu_t *emu, uintptr_t fcn) { vFuuuiupi_t fn = (vFuuuiupi_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFuuuuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuu_t fn = (vFuuuuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28)); } +void vFuuuulll_32(x64emu_t *emu, uintptr_t fcn) { vFuuuulll_t fn = (vFuuuulll_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_long(from_ptri(long_t, R_ESP + 20)), from_long(from_ptri(long_t, R_ESP + 24)), from_long(from_ptri(long_t, R_ESP + 28))); } +void vFuuuffff_32(x64emu_t *emu, uintptr_t fcn) { vFuuuffff_t fn = (vFuuuffff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28)); } +void vFuuudddd_32(x64emu_t *emu, uintptr_t fcn) { vFuuudddd_t fn = (vFuuudddd_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24), from_ptri(double, R_ESP + 32), from_ptri(double, R_ESP + 40)); } +void vFuuffiip_32(x64emu_t *emu, uintptr_t fcn) { vFuuffiip_t fn = (vFuuffiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFuuddiip_32(x64emu_t *emu, uintptr_t fcn) { vFuuddiip_t fn = (vFuuddiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void vFuulluup_32(x64emu_t *emu, uintptr_t fcn) { vFuulluup_t fn = (vFuulluup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16)), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFuupiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuupiiii_t fn = (vFuupiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFuuppppp_32(x64emu_t *emu, uintptr_t fcn) { vFuuppppp_t fn = (vFuuppppp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFuffffff_32(x64emu_t *emu, uintptr_t fcn) { vFuffffff_t fn = (vFuffffff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28)); } +void vFudddddd_32(x64emu_t *emu, uintptr_t fcn) { vFudddddd_t fn = (vFudddddd_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24), from_ptri(double, R_ESP + 32), from_ptri(double, R_ESP + 40), from_ptri(double, R_ESP + 48)); } +void vFlliiiip_32(x64emu_t *emu, uintptr_t fcn) { vFlliiiip_t fn = (vFlliiiip_t)fcn; fn(from_long(from_ptri(long_t, R_ESP + 4)), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void vFpipipiu_32(x64emu_t *emu, uintptr_t fcn) { vFpipipiu_t fn = (vFpipipiu_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28)); } +void vFpddiidd_32(x64emu_t *emu, uintptr_t fcn) { vFpddiidd_t fn = (vFpddiidd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(double, R_ESP + 32), from_ptri(double, R_ESP + 40)); } +void vFpdddddd_32(x64emu_t *emu, uintptr_t fcn) { vFpdddddd_t fn = (vFpdddddd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24), from_ptri(double, R_ESP + 32), from_ptri(double, R_ESP + 40), from_ptri(double, R_ESP + 48)); } +void vFXLiiiLi_32(x64emu_t *emu, uintptr_t fcn) { vFXLiiiLi_t fn = (vFXLiiiLi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ulong(from_ptri(ulong_t, R_ESP + 24)), from_ptri(int32_t, R_ESP + 28)); } +void vFXLiiipi_32(x64emu_t *emu, uintptr_t fcn) { vFXLiiipi_t fn = (vFXLiiipi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFXLiiuui_32(x64emu_t *emu, uintptr_t fcn) { vFXLiiuui_t fn = (vFXLiiuui_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFXLLuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFXLLuuuu_t fn = (vFXLLuuuu_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28)); } +void vFXLppipi_32(x64emu_t *emu, uintptr_t fcn) { vFXLppipi_t fn = (vFXLppipi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFXpiipii_32(x64emu_t *emu, uintptr_t fcn) { vFXpiipii_t fn = (vFXpiipii_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFXppiiii_32(x64emu_t *emu, uintptr_t fcn) { vFXppiiii_t fn = (vFXppiiii_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void iFElppppp_32(x64emu_t *emu, uintptr_t fcn) { iFElppppp_t fn = (iFElppppp_t)fcn; R_EAX = fn(emu, from_long(from_ptri(long_t, R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iEEpLiipp_32(x64emu_t *emu, uintptr_t fcn) { iEEpLiipp_t fn = (iEEpLiipp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); emu->libc_err = errno; } +void iEEpLiipV_32(x64emu_t *emu, uintptr_t fcn) { iEEpLiipV_t fn = (iEEpLiipV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptrv(R_ESP + 24)); emu->libc_err = errno; } +void iEEpLiLpV_32(x64emu_t *emu, uintptr_t fcn) { iEEpLiLpV_t fn = (iEEpLiLpV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20), from_ptrv(R_ESP + 24)); emu->libc_err = errno; } +void iFEpppipp_32(x64emu_t *emu, uintptr_t fcn) { iFEpppipp_t fn = (iFEpppipp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFEpppupp_32(x64emu_t *emu, uintptr_t fcn) { iFEpppupp_t fn = (iFEpppupp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iEEpppppp_32(x64emu_t *emu, uintptr_t fcn) { iEEpppppp_t fn = (iEEpppppp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); emu->libc_err = errno; } +void iFEXLpiiL_32(x64emu_t *emu, uintptr_t fcn) { iFEXLpiiL_t fn = (iFEXLpiiL_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ulong(from_ptri(ulong_t, R_ESP + 24))); } +void iFEXLpppp_32(x64emu_t *emu, uintptr_t fcn) { iFEXLpppp_t fn = (iFEXLpppp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFEXppppp_32(x64emu_t *emu, uintptr_t fcn) { iFEXppppp_t fn = (iFEXppppp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void iFiuuuuii_32(x64emu_t *emu, uintptr_t fcn) { iFiuuuuii_t fn = (iFiuuuuii_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void iFippuIup_32(x64emu_t *emu, uintptr_t fcn) { iFippuIup_t fn = (iFippuIup_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int64_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void iFuiiiuup_32(x64emu_t *emu, uintptr_t fcn) { iFuiiiuup_t fn = (iFuiiiuup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void iFpiuuuiu_32(x64emu_t *emu, uintptr_t fcn) { iFpiuuuiu_t fn = (iFpiuuuiu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28)); } +void iFpWCiWCi_32(x64emu_t *emu, uintptr_t fcn) { iFpWCiWCi_t fn = (iFpWCiWCi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint16_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint16_t, R_ESP + 20), from_ptri(uint8_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void iEpupupui_32(x64emu_t *emu, uintptr_t fcn) { iEpupupui_t fn = (iEpupupui_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); emu->libc_err = errno; } +void iFpLpLpLp_32(x64emu_t *emu, uintptr_t fcn) { iFpLpLpLp_t fn = (iFpLpLpLp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20), from_ulong(from_ptri(ulong_t, R_ESP + 24)), from_ptriv(R_ESP + 28)); } +void iFpLppiip_32(x64emu_t *emu, uintptr_t fcn) { iFpLppiip_t fn = (iFpLppiip_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void iFppupipi_32(x64emu_t *emu, uintptr_t fcn) { iFppupipi_t fn = (iFppupipi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void iFXiuLiii_32(x64emu_t *emu, uintptr_t fcn) { iFXiuLiii_t fn = (iFXiuLiii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void iFXiLuupp_32(x64emu_t *emu, uintptr_t fcn) { iFXiLuupp_t fn = (iFXiLuupp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); } +void iFXLiiiiL_32(x64emu_t *emu, uintptr_t fcn) { iFXLiiiiL_t fn = (iFXLiiiiL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ulong(from_ptri(ulong_t, R_ESP + 28))); } +void iFXLiiuui_32(x64emu_t *emu, uintptr_t fcn) { iFXLiiuui_t fn = (iFXLiiuui_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void iFXLpiiii_32(x64emu_t *emu, uintptr_t fcn) { iFXLpiiii_t fn = (iFXLpiiii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void iFXLpiiuu_32(x64emu_t *emu, uintptr_t fcn) { iFXLpiiuu_t fn = (iFXLpiiuu_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28)); } +void iFXLpiipi_32(x64emu_t *emu, uintptr_t fcn) { iFXLpiipi_t fn = (iFXLpiipi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void iFXLppiii_32(x64emu_t *emu, uintptr_t fcn) { iFXLppiii_t fn = (iFXLppiii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void iFXpiipii_32(x64emu_t *emu, uintptr_t fcn) { iFXpiipii_t fn = (iFXpiipii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void iFXpLiWwL_32(x64emu_t *emu, uintptr_t fcn) { iFXpLiWwL_t fn = (iFXpLiWwL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptri(uint16_t, R_ESP + 20), from_ptri(int16_t, R_ESP + 24), from_ulong(from_ptri(ulong_t, R_ESP + 28))); } +void iFXpLuuii_32(x64emu_t *emu, uintptr_t fcn) { iFXpLuuii_t fn = (iFXpLuuii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void uFEpppppp_32(x64emu_t *emu, uintptr_t fcn) { uFEpppppp_t fn = (uFEpppppp_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } +void uFuippppp_32(x64emu_t *emu, uintptr_t fcn) { uFuippppp_t fn = (uFuippppp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); } +void uFpippppp_32(x64emu_t *emu, uintptr_t fcn) { uFpippppp_t fn = (uFpippppp_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); } +void uFpuupppp_32(x64emu_t *emu, uintptr_t fcn) { uFpuupppp_t fn = (uFpuupppp_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); } +void uFppppppp_32(x64emu_t *emu, uintptr_t fcn) { uFppppppp_t fn = (uFppppppp_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); } +void lEEipLpLL_32(x64emu_t *emu, uintptr_t fcn) { lEEipLpLL_t fn = (lEEipLpLL_t)fcn; errno = emu->libc_err; R_EAX = to_long(fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ulong(from_ptri(ulong_t, R_ESP + 24)))); emu->libc_err = errno; } +void pFEpiiiiu_32(x64emu_t *emu, uintptr_t fcn) { pFEpiiiiu_t fn = (pFEpiiiiu_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24))); } +void pFEpLiiii_32(x64emu_t *emu, uintptr_t fcn) { pFEpLiiii_t fn = (pFEpLiiii_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24))); } +void pEEpLiiiI_32(x64emu_t *emu, uintptr_t fcn) { pEEpLiiiI_t fn = (pEEpLiiiI_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int64_t, R_ESP + 24))); emu->libc_err = errno; } +void pFEpLiiiI_32(x64emu_t *emu, uintptr_t fcn) { pFEpLiiiI_t fn = (pFEpLiiiI_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int64_t, R_ESP + 24))); } +void pEEpLiiil_32(x64emu_t *emu, uintptr_t fcn) { pEEpLiiil_t fn = (pEEpLiiil_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_long(from_ptri(long_t, R_ESP + 24)))); emu->libc_err = errno; } +void pFEpXppip_32(x64emu_t *emu, uintptr_t fcn) { pFEpXppip_t fn = (pFEpXppip_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), getDisplay(from_ptriv(R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24))); } +void pFpipiupp_32(x64emu_t *emu, uintptr_t fcn) { pFpipiupp_t fn = (pFpipiupp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28))); } +void pFpuuupuu_32(x64emu_t *emu, uintptr_t fcn) { pFpuuupuu_t fn = (pFpuuupuu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28))); } +void pFppppiii_32(x64emu_t *emu, uintptr_t fcn) { pFppppiii_t fn = (pFppppiii_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28))); } +void vFXLLiiibl__32(x64emu_t *emu, uintptr_t fcn) { vFXLLiiibl__t fn = (vFXLLiiibl__t)fcn; struct_l_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_l(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } +void iFppppppbp__32(x64emu_t *emu, uintptr_t fcn) { iFppppppbp__t fn = (iFppppppbp__t)fcn; struct_p_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_p(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } +void pFpiipipbp__32(x64emu_t *emu, uintptr_t fcn) { pFpiipipbp__t fn = (pFpiipipbp__t)fcn; struct_p_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_p(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } +void iFppppubpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFppppubpu_u_t fn = (iFppppubpu_u_t)fcn; struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, from_ptri(uint32_t, R_ESP + 28)); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFXiLibiip_ip_32(x64emu_t *emu, uintptr_t fcn) { iFXiLibiip_ip_t fn = (iFXiLibiip_ip_t)fcn; struct_iip_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_iip(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_iip(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFXLibL_ubL_u_32(x64emu_t *emu, uintptr_t fcn) { iFXLibL_ubL_u_t fn = (iFXLibL_ubL_u_t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_L_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_L(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(uint32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, from_ptri(uint32_t, R_ESP + 28)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFppibp_pibpp__32(x64emu_t *emu, uintptr_t fcn) { iFppibp_pibpp__t fn = (iFppibp_pibpp__t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pp_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_pp(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_pp(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } +void iFXLpiibpiiL_i_32(x64emu_t *emu, uintptr_t fcn) { iFXLpiibpiiL_i_t fn = (iFXLpiibpiiL_i_t)fcn; struct_piiL_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_piiL(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, from_ptri(int32_t, R_ESP + 28)); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_piiL(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFppbupu_uubpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFppbupu_uubpu_u_t fn = (iFppbupu_uubpu_u_t)fcn; struct_upu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_upu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, from_ptri(uint32_t, R_ESP + 28)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_upu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFppubpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFppubpu_bpu_bpu_bpu__t fn = (iFppubpu_bpu_bpu_bpu__t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); struct_pu_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_pu(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } +void LFXLLuubLWWWcc_bLWWWcc__32(x64emu_t *emu, uintptr_t fcn) { LFXLLuubLWWWcc_bLWWWcc__t fn = (LFXLLuubLWWWcc_bLWWWcc__t)fcn; struct_LWWWcc_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_LWWWcc(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); struct_LWWWcc_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_LWWWcc(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } +void LFXLLbLWWWcc_bLWWWcc_uu_32(x64emu_t *emu, uintptr_t fcn) { LFXLLbLWWWcc_bLWWWcc_uu_t fn = (LFXLLbLWWWcc_bLWWWcc_uu_t)fcn; struct_LWWWcc_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_LWWWcc(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_LWWWcc_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_LWWWcc(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28))); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFpubpu_bpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpubpu_bpu_bpu_bpu_bpu__t fn = (iFpubpu_bpu_bpu_bpu_bpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); struct_pu_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_pu(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } +void iFpbpu_bpu_bpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu_bpu_bpu_bpu_bpu__t fn = (iFpbpu_bpu_bpu_bpu_bpu_bpu__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); struct_pu_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_pu(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } +void vFEXLpiipi_32(x64emu_t *emu, uintptr_t fcn) { vFEXLpiipi_t fn = (vFEXLpiipi_t)fcn; fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } +void vFiiiiuuip_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiuuip_t fn = (vFiiiiuuip_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void vFiilliilp_32(x64emu_t *emu, uintptr_t fcn) { vFiilliilp_t fn = (vFiilliilp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_long(from_ptri(long_t, R_ESP + 28)), from_ptriv(R_ESP + 32)); } +void vFiupuiuup_32(x64emu_t *emu, uintptr_t fcn) { vFiupuiuup_t fn = (vFiupuiuup_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void vFiupuuuup_32(x64emu_t *emu, uintptr_t fcn) { vFiupuuuup_t fn = (vFiupuuuup_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void vFuiiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiii_t fn = (vFuiiiiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32)); } +void vFuiiiiiiC_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiC_t fn = (vFuiiiiiiC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint8_t, R_ESP + 32)); } +void vFuiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiuup_t fn = (vFuiiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void vFuiiipiup_32(x64emu_t *emu, uintptr_t fcn) { vFuiiipiup_t fn = (vFuiiipiup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void vFuiuiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiii_t fn = (vFuiuiiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32)); } +void vFuiuiiiip_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiip_t fn = (vFuiuiiiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void vFuiuiiiuU_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiuU_t fn = (vFuiuiiiuU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint64_t, R_ESP + 32)); } +void vFuiuiiCuU_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiCuU_t fn = (vFuiuiiCuU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint8_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint64_t, R_ESP + 32)); } +void vFuiuiuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiuuuu_t fn = (vFuiuiuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32)); } +void vFuCCCCfff_32(x64emu_t *emu, uintptr_t fcn) { vFuCCCCfff_t fn = (vFuCCCCfff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(uint8_t, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32)); } +void vFuuiiiiiC_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiC_t fn = (vFuuiiiiiC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint8_t, R_ESP + 32)); } +void vFuuiiiuip_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiuip_t fn = (vFuuiiiuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void vFuuiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiuup_t fn = (vFuuiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void vFuuiiuupp_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiuupp_t fn = (vFuuiiuupp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); } +void vFuuiuiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiii_t fn = (vFuuiuiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32)); } +void vFuuiuiiiC_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiiC_t fn = (vFuuiuiiiC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint8_t, R_ESP + 32)); } +void vFuuiuiiip_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiip_t fn = (vFuuiuiiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void vFuuuiiiiu_32(x64emu_t *emu, uintptr_t fcn) { vFuuuiiiiu_t fn = (vFuuuiiiiu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32)); } +void vFuuuiuCil_32(x64emu_t *emu, uintptr_t fcn) { vFuuuiuCil_t fn = (vFuuuiuCil_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint8_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_long(from_ptri(long_t, R_ESP + 32))); } +void vFuuuipipp_32(x64emu_t *emu, uintptr_t fcn) { vFuuuipipp_t fn = (vFuuuipipp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); } +void vFuuuuuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuuu_t fn = (vFuuuuuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32)); } +void vFuuufffff_32(x64emu_t *emu, uintptr_t fcn) { vFuuufffff_t fn = (vFuuufffff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32)); } +void vFffffffff_32(x64emu_t *emu, uintptr_t fcn) { vFffffffff_t fn = (vFffffffff_t)fcn; fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32)); } +void vFXiLLiipi_32(x64emu_t *emu, uintptr_t fcn) { vFXiLLiipi_t fn = (vFXiLLiipi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptri(int32_t, R_ESP + 32)); } +void vFXiLpiiuu_32(x64emu_t *emu, uintptr_t fcn) { vFXiLpiiuu_t fn = (vFXiLpiiuu_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32)); } +void vFXLiiiLii_32(x64emu_t *emu, uintptr_t fcn) { vFXLiiiLii_t fn = (vFXLiiiLii_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ulong(from_ptri(ulong_t, R_ESP + 24)), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32)); } +void vFXLLLiipi_32(x64emu_t *emu, uintptr_t fcn) { vFXLLLiipi_t fn = (vFXLLLiipi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptri(int32_t, R_ESP + 32)); } +void vFXppuulll_32(x64emu_t *emu, uintptr_t fcn) { vFXppuulll_t fn = (vFXppuulll_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_long(from_ptri(long_t, R_ESP + 24)), from_long(from_ptri(long_t, R_ESP + 28)), from_long(from_ptri(long_t, R_ESP + 32))); } +void iFEpippupp_32(x64emu_t *emu, uintptr_t fcn) { iFEpippupp_t fn = (iFEpippupp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); } +void iEEpippppp_32(x64emu_t *emu, uintptr_t fcn) { iEEpippppp_t fn = (iEEpippppp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); emu->libc_err = errno; } +void iEEpLiLppp_32(x64emu_t *emu, uintptr_t fcn) { iEEpLiLppp_t fn = (iEEpLiLppp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); emu->libc_err = errno; } +void iFEppipppp_32(x64emu_t *emu, uintptr_t fcn) { iFEppipppp_t fn = (iFEppipppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); } +void iFiipppppp_32(x64emu_t *emu, uintptr_t fcn) { iFiipppppp_t fn = (iFiipppppp_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); } +void iFiuuCCuup_32(x64emu_t *emu, uintptr_t fcn) { iFiuuCCuup_t fn = (iFiuuCCuup_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(uint8_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void iFiuuuupip_32(x64emu_t *emu, uintptr_t fcn) { iFiuuuupip_t fn = (iFiuuuupip_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void iFuiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { iFuiiiiuup_t fn = (iFuiiiiuup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void iFupipppip_32(x64emu_t *emu, uintptr_t fcn) { iFupipppip_t fn = (iFupipppip_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void iFpuuiiuuu_32(x64emu_t *emu, uintptr_t fcn) { iFpuuiiuuu_t fn = (iFpuuiiuuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32)); } +void iFpLpiLpLp_32(x64emu_t *emu, uintptr_t fcn) { iFpLpiLpLp_t fn = (iFpLpiLpLp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ptriv(R_ESP + 24), from_ulong(from_ptri(ulong_t, R_ESP + 28)), from_ptriv(R_ESP + 32)); } +void iFXuupuupp_32(x64emu_t *emu, uintptr_t fcn) { iFXuupuupp_t fn = (iFXuupuupp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); } +void iFXLpipppp_32(x64emu_t *emu, uintptr_t fcn) { iFXLpipppp_t fn = (iFXLpipppp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); } +void iFXLppLpip_32(x64emu_t *emu, uintptr_t fcn) { iFXLppLpip_t fn = (iFXLppLpip_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } +void iFXpIIIppp_32(x64emu_t *emu, uintptr_t fcn) { iFXpIIIppp_t fn = (iFXpIIIppp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int64_t, R_ESP + 12), from_ptri(int64_t, R_ESP + 20), from_ptri(int64_t, R_ESP + 28), from_ptriv(R_ESP + 36), from_ptriv(R_ESP + 40), from_ptriv(R_ESP + 44)); } +void CFuiifpppp_32(x64emu_t *emu, uintptr_t fcn) { CFuiifpppp_t fn = (CFuiifpppp_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); } +void uFuipppppp_32(x64emu_t *emu, uintptr_t fcn) { uFuipppppp_t fn = (uFuipppppp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); } +void uFuupuuiuf_32(x64emu_t *emu, uintptr_t fcn) { uFuupuuiuf_t fn = (uFuupuuiuf_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(float, R_ESP + 32)); } +void uFulpppppp_32(x64emu_t *emu, uintptr_t fcn) { uFulpppppp_t fn = (uFulpppppp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); } +void LFEXLppuuu_32(x64emu_t *emu, uintptr_t fcn) { LFEXLppuuu_t fn = (LFEXLppuuu_t)fcn; R_EAX = to_ulong(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28))); } +void LFXLpuuLLu_32(x64emu_t *emu, uintptr_t fcn) { LFXLpuuLLu_t fn = (LFXLpuuLLu_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ulong(from_ptri(ulong_t, R_ESP + 24)), from_ulong(from_ptri(ulong_t, R_ESP + 28)), from_ptri(uint32_t, R_ESP + 32))); } +void pFEppipipp_32(x64emu_t *emu, uintptr_t fcn) { pFEppipipp_t fn = (pFEppipipp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28))); } +void pFEXpLLppp_32(x64emu_t *emu, uintptr_t fcn) { pFEXpLLppp_t fn = (pFEXpLLppp_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28))); } +void iFXLLiippBL__32(x64emu_t *emu, uintptr_t fcn) { iFXLLiippBL__t fn = (iFXLLiippBL__t)fcn; struct_L_t arg_32={0}; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), *(ptr_t*)(from_ptr((R_ESP + 32))) ? &arg_32 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 32)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 32))), &arg_32); } +void iFXLpppbL_pp_32(x64emu_t *emu, uintptr_t fcn) { iFXLpppbL_pp_t fn = (iFXLpppbL_pp_t)fcn; struct_L_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_L(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void pFpuuuuupbp__32(x64emu_t *emu, uintptr_t fcn) { pFpuuuuupbp__t fn = (pFpuuuuupbp__t)fcn; struct_p_t arg_32={0}; if (*(ptr_t*)(from_ptr((R_ESP + 32)))) from_struct_p(&arg_32, *(ptr_t*)(from_ptr((R_ESP + 32)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28), *(ptr_t*)(from_ptr((R_ESP + 32))) ? &arg_32 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 32)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 32))), &arg_32); } +void iFppppubpu_Iu_32(x64emu_t *emu, uintptr_t fcn) { iFppppubpu_Iu_t fn = (iFppppubpu_Iu_t)fcn; struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, from_ptri(int64_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 36)); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void iFpppbpu_ppuu_32(x64emu_t *emu, uintptr_t fcn) { iFpppbpu_ppuu_t fn = (iFpppbpu_ppuu_t)fcn; struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void vFppibLdd_ipiu_32(x64emu_t *emu, uintptr_t fcn) { vFppibLdd_ipiu_t fn = (vFppibLdd_ipiu_t)fcn; struct_Ldd_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_Ldd(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_Ldd(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFpupbL_ppbL_p_32(x64emu_t *emu, uintptr_t fcn) { iFpupbL_ppbL_p_t fn = (iFpupbL_ppbL_p_t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_L_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_L(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL, from_ptriv(R_ESP + 32)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } +void iFpppibp_pbp_p_32(x64emu_t *emu, uintptr_t fcn) { iFpppibp_pbp_p_t fn = (iFpppibp_pbp_p_t)fcn; struct_p_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_p(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_p_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_p(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptriv(R_ESP + 24), *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL, from_ptriv(R_ESP + 32)); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } +void iFbpu_upppppbp__32(x64emu_t *emu, uintptr_t fcn) { iFbpu_upppppbp__t fn = (iFbpu_upppppbp__t)fcn; struct_pu_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_pu(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_p_t arg_32={0}; if (*(ptr_t*)(from_ptr((R_ESP + 32)))) from_struct_p(&arg_32, *(ptr_t*)(from_ptr((R_ESP + 32)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), *(ptr_t*)(from_ptr((R_ESP + 32))) ? &arg_32 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 32)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 32))), &arg_32); } +void iFbp_ubp_ubp_uup_32(x64emu_t *emu, uintptr_t fcn) { iFbp_ubp_ubp_uup_t fn = (iFbp_ubp_ubp_uup_t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_p(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(uint32_t, R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void iFpubpu_bpu_bpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpubpu_bpu_bpu_bpu_bpu_bpu__t fn = (iFpubpu_bpu_bpu_bpu_bpu_bpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); struct_pu_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_pu(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); struct_pu_t arg_32={0}; if (*(ptr_t*)(from_ptr((R_ESP + 32)))) from_struct_pu(&arg_32, *(ptr_t*)(from_ptr((R_ESP + 32)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL, *(ptr_t*)(from_ptr((R_ESP + 32))) ? &arg_32 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); if (*(ptr_t*)(from_ptr((R_ESP + 32)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 32))), &arg_32); } +void vFEXLppiipi_32(x64emu_t *emu, uintptr_t fcn) { vFEXLppiipi_t fn = (vFEXLppiipi_t)fcn; fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptri(int32_t, R_ESP + 32)); } +void vFiiiiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiiii_t fn = (vFiiiiiiiii_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36)); } +void vFiiiiiiill_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiill_t fn = (vFiiiiiiill_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_long(from_ptri(long_t, R_ESP + 32)), from_long(from_ptri(long_t, R_ESP + 36))); } +void vFiiiiillli_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiillli_t fn = (vFiiiiillli_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_long(from_ptri(long_t, R_ESP + 24)), from_long(from_ptri(long_t, R_ESP + 28)), from_long(from_ptri(long_t, R_ESP + 32)), from_ptri(int32_t, R_ESP + 36)); } +void vFiiilllilp_32(x64emu_t *emu, uintptr_t fcn) { vFiiilllilp_t fn = (vFiiilllilp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_long(from_ptri(long_t, R_ESP + 20)), from_long(from_ptri(long_t, R_ESP + 24)), from_ptri(int32_t, R_ESP + 28), from_long(from_ptri(long_t, R_ESP + 32)), from_ptriv(R_ESP + 36)); } +void vFiupuiuuup_32(x64emu_t *emu, uintptr_t fcn) { vFiupuiuuup_t fn = (vFiupuiuuup_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void vFiupuuuuup_32(x64emu_t *emu, uintptr_t fcn) { vFiupuuuuup_t fn = (vFiupuuuuup_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void vFuiiiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiii_t fn = (vFuiiiiiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36)); } +void vFuiiiiiiiC_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiC_t fn = (vFuiiiiiiiC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint8_t, R_ESP + 36)); } +void vFuiiiiiuip_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiuip_t fn = (vFuiiiiiuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void vFuiiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiuup_t fn = (vFuiiiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void vFuiuiiiiip_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiiip_t fn = (vFuiuiiiiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void vFuiuiiiCuU_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiCuU_t fn = (vFuiuiiiCuU_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint8_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint64_t, R_ESP + 36)); } +void vFuiupuffup_32(x64emu_t *emu, uintptr_t fcn) { vFuiupuffup_t fn = (vFuiupuffup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void vFuuiiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiii_t fn = (vFuuiiiiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36)); } +void vFuuiiiiiiC_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiC_t fn = (vFuuiiiiiiC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint8_t, R_ESP + 36)); } +void vFuuiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiuup_t fn = (vFuuiiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void vFuuiuiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiiii_t fn = (vFuuiuiiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36)); } +void vFuuiuiiiip_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiiip_t fn = (vFuuiuiiiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void vFuuuiiiiCp_32(x64emu_t *emu, uintptr_t fcn) { vFuuuiiiiCp_t fn = (vFuuuiiiiCp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint8_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void vFuuuuuuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuuuu_t fn = (vFuuuuuuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36)); } +void vFuupuuiuuf_32(x64emu_t *emu, uintptr_t fcn) { vFuupuuiuuf_t fn = (vFuupuuiuuf_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(float, R_ESP + 36)); } +void vFuffffffff_32(x64emu_t *emu, uintptr_t fcn) { vFuffffffff_t fn = (vFuffffffff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32), from_ptri(float, R_ESP + 36)); } +void vFffCCCCfff_32(x64emu_t *emu, uintptr_t fcn) { vFffCCCCfff_t fn = (vFffCCCCfff_t)fcn; fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(uint8_t, R_ESP + 20), from_ptri(uint8_t, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32), from_ptri(float, R_ESP + 36)); } +void vFddddddddd_32(x64emu_t *emu, uintptr_t fcn) { vFddddddddd_t fn = (vFddddddddd_t)fcn; fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28), from_ptri(double, R_ESP + 36), from_ptri(double, R_ESP + 44), from_ptri(double, R_ESP + 52), from_ptri(double, R_ESP + 60), from_ptri(double, R_ESP + 68)); } +void vFXiLLpiipi_32(x64emu_t *emu, uintptr_t fcn) { vFXiLLpiipi_t fn = (vFXiLLpiipi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32), from_ptri(int32_t, R_ESP + 36)); } +void vFXLiiipiii_32(x64emu_t *emu, uintptr_t fcn) { vFXLiiipiii_t fn = (vFXLiiipiii_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36)); } +void iFEpuippupp_32(x64emu_t *emu, uintptr_t fcn) { iFEpuippupp_t fn = (iFEpuippupp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); } +void iFEXLLLiipi_32(x64emu_t *emu, uintptr_t fcn) { iFEXLLLiipi_t fn = (iFEXLLLiipi_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptri(int32_t, R_ESP + 32)); } +void iFiuuuppppu_32(x64emu_t *emu, uintptr_t fcn) { iFiuuuppppu_t fn = (iFiuuuppppu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptri(uint32_t, R_ESP + 36)); } +void iFuiiuuiiip_32(x64emu_t *emu, uintptr_t fcn) { iFuiiuuiiip_t fn = (iFuiiuuiiip_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void iFuiiupiiup_32(x64emu_t *emu, uintptr_t fcn) { iFuiiupiiup_t fn = (iFuiiupiiup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void iFdddpppppp_32(x64emu_t *emu, uintptr_t fcn) { iFdddpppppp_t fn = (iFdddpppppp_t)fcn; R_EAX = fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36), from_ptriv(R_ESP + 40), from_ptriv(R_ESP + 44), from_ptriv(R_ESP + 48)); } +void iFXuuuLiiip_32(x64emu_t *emu, uintptr_t fcn) { iFXuuuLiiip_t fn = (iFXuuuLiiip_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); } +void iFXuuuLpppp_32(x64emu_t *emu, uintptr_t fcn) { iFXuuuLpppp_t fn = (iFXuuuLpppp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36)); } +void iFXLiuiiLLL_32(x64emu_t *emu, uintptr_t fcn) { iFXLiuiiLLL_t fn = (iFXLiuiiLLL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ulong(from_ptri(ulong_t, R_ESP + 28)), from_ulong(from_ptri(ulong_t, R_ESP + 32)), from_ulong(from_ptri(ulong_t, R_ESP + 36))); } +void iFXLLiiuuii_32(x64emu_t *emu, uintptr_t fcn) { iFXLLiiuuii_t fn = (iFXLLiiuuii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36)); } +void iFXLpiiuuii_32(x64emu_t *emu, uintptr_t fcn) { iFXLpiiuuii_t fn = (iFXLpiiuuii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36)); } +void uFuulpiuiuf_32(x64emu_t *emu, uintptr_t fcn) { uFuulpiuiuf_t fn = (uFuulpiuiuf_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_long(from_ptri(long_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(float, R_ESP + 36)); } +void LFXLiiiiiip_32(x64emu_t *emu, uintptr_t fcn) { LFXLiiiiiip_t fn = (LFXLiiiiiip_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptriv(R_ESP + 36))); } +void LFXLiiuuuLL_32(x64emu_t *emu, uintptr_t fcn) { LFXLiiuuuLL_t fn = (LFXLiiuuuLL_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ulong(from_ptri(ulong_t, R_ESP + 32)), from_ulong(from_ptri(ulong_t, R_ESP + 36)))); } +void pFEuiiiuuuu_32(x64emu_t *emu, uintptr_t fcn) { pFEuiiiuuuu_t fn = (pFEuiiiuuuu_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32))); } +void pFEpnCuuuuu_32(x64emu_t *emu, uintptr_t fcn) { pFEpnCuuuuu_t fn = (pFEpnCuuuuu_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 8)); R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), aligned_xcb, from_ptri(uint8_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32))); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 8)); } +void pFEXLiiuuLi_32(x64emu_t *emu, uintptr_t fcn) { pFEXLiiuuLi_t fn = (pFEXLiiuuLi_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ulong(from_ptri(ulong_t, R_ESP + 28)), from_ptri(int32_t, R_ESP + 32))); } +void pFpiiiiuuuu_32(x64emu_t *emu, uintptr_t fcn) { pFpiiiiuuuu_t fn = (pFpiiiiuuuu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36))); } +void iFXLbL_pppppp_32(x64emu_t *emu, uintptr_t fcn) { iFXLbL_pppppp_t fn = (iFXLbL_pppppp_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } +void iFXiLiiibiip_ip_32(x64emu_t *emu, uintptr_t fcn) { iFXiLiiibiip_ip_t fn = (iFXiLiiibiip_ip_t)fcn; struct_iip_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_iip(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL, from_ptri(int32_t, R_ESP + 32), from_ptriv(R_ESP + 36)); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_iip(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } +void iFXiLLLiiibiip__32(x64emu_t *emu, uintptr_t fcn) { iFXiLLLiiibiip__t fn = (iFXiLLLiiibiip__t)fcn; struct_iip_t arg_36={0}; if (*(ptr_t*)(from_ptr((R_ESP + 36)))) from_struct_iip(&arg_36, *(ptr_t*)(from_ptr((R_ESP + 36)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), *(ptr_t*)(from_ptr((R_ESP + 36))) ? &arg_36 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 36)))) to_struct_iip(*(ptr_t*)(from_ptr((R_ESP + 36))), &arg_36); } +void iFXLbL_bL_ppppp_32(x64emu_t *emu, uintptr_t fcn) { iFXLbL_bL_ppppp_t fn = (iFXLbL_bL_ppppp_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } +void iFuuppuubpu_bpu_u_32(x64emu_t *emu, uintptr_t fcn) { iFuuppuubpu_bpu_u_t fn = (iFuuppuubpu_bpu_u_t)fcn; struct_pu_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_pu(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); struct_pu_t arg_32={0}; if (*(ptr_t*)(from_ptr((R_ESP + 32)))) from_struct_pu(&arg_32, *(ptr_t*)(from_ptr((R_ESP + 32)))); R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL, *(ptr_t*)(from_ptr((R_ESP + 32))) ? &arg_32 : NULL, from_ptri(uint32_t, R_ESP + 36)); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); if (*(ptr_t*)(from_ptr((R_ESP + 32)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 32))), &arg_32); } +void iFpuuuuuubpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpuuuuuubpu_bpu__t fn = (iFpuuuuuubpu_bpu__t)fcn; struct_pu_t arg_32={0}; if (*(ptr_t*)(from_ptr((R_ESP + 32)))) from_struct_pu(&arg_32, *(ptr_t*)(from_ptr((R_ESP + 32)))); struct_pu_t arg_36={0}; if (*(ptr_t*)(from_ptr((R_ESP + 36)))) from_struct_pu(&arg_36, *(ptr_t*)(from_ptr((R_ESP + 36)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), *(ptr_t*)(from_ptr((R_ESP + 32))) ? &arg_32 : NULL, *(ptr_t*)(from_ptr((R_ESP + 36))) ? &arg_36 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 32)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 32))), &arg_32); if (*(ptr_t*)(from_ptr((R_ESP + 36)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 36))), &arg_36); } +void iFpuupbpu_ubpu_uu_32(x64emu_t *emu, uintptr_t fcn) { iFpuupbpu_ubpu_uu_t fn = (iFpuupbpu_ubpu_uu_t)fcn; struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_pu_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_pu(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptri(uint32_t, R_ESP + 24), *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL, from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36)); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } +void pFEXbpLiLLLii_uippuu_32(x64emu_t *emu, uintptr_t fcn) { pFEXbpLiLLLii_uippuu_t fn = (pFEXbpLiLLLii_uippuu_t)fcn; struct_pLiLLLii_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pLiLLLii(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pLiLLLii(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void vFXiLLrLiiwwwwwwwwL_iipi_32(x64emu_t *emu, uintptr_t fcn) { vFXiLLrLiiwwwwwwwwL_iipi_t fn = (vFXiLLrLiiwwwwwwwwL_iipi_t)fcn; struct_LiiwwwwwwwwL_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_LiiwwwwwwwwL(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32), from_ptri(int32_t, R_ESP + 36)); } +void iFpbpu_bpu_bpu_bpu_bpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_bpu_bpu_bpu_bpu_bpu_bpu_bpu__t fn = (iFpbpu_bpu_bpu_bpu_bpu_bpu_bpu_bpu__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_pu_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_pu(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_pu_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_pu(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_pu_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_pu(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); struct_pu_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_pu(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); struct_pu_t arg_32={0}; if (*(ptr_t*)(from_ptr((R_ESP + 32)))) from_struct_pu(&arg_32, *(ptr_t*)(from_ptr((R_ESP + 32)))); struct_pu_t arg_36={0}; if (*(ptr_t*)(from_ptr((R_ESP + 36)))) from_struct_pu(&arg_36, *(ptr_t*)(from_ptr((R_ESP + 36)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL, *(ptr_t*)(from_ptr((R_ESP + 32))) ? &arg_32 : NULL, *(ptr_t*)(from_ptr((R_ESP + 36))) ? &arg_36 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); if (*(ptr_t*)(from_ptr((R_ESP + 32)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 32))), &arg_32); if (*(ptr_t*)(from_ptr((R_ESP + 36)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 36))), &arg_36); } +void vFEXLpppippp_32(x64emu_t *emu, uintptr_t fcn) { vFEXLpppippp_t fn = (vFEXLpppippp_t)fcn; fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36)); } +void vFiiiiiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiiiii_t fn = (vFiiiiiiiiii_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40)); } +void vFiiiiiiiiui_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiiiui_t fn = (vFiiiiiiiiui_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40)); } +void vFiiiiiiiiuu_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiiiuu_t fn = (vFiiiiiiiiuu_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40)); } +void vFiiillliiip_32(x64emu_t *emu, uintptr_t fcn) { vFiiillliiip_t fn = (vFiiillliiip_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_long(from_ptri(long_t, R_ESP + 16)), from_long(from_ptri(long_t, R_ESP + 20)), from_long(from_ptri(long_t, R_ESP + 24)), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptriv(R_ESP + 40)); } +void vFuiiiiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiii_t fn = (vFuiiiiiiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40)); } +void vFuiiiiiiiip_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiip_t fn = (vFuiiiiiiiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptriv(R_ESP + 40)); } +void vFuiiiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiuup_t fn = (vFuiiiiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptriv(R_ESP + 40)); } +void vFuiuiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiiuup_t fn = (vFuiuiiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptriv(R_ESP + 40)); } +void vFuuiiiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiii_t fn = (vFuuiiiiiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40)); } +void vFuuiiiiiuip_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiuip_t fn = (vFuuiiiiiuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptriv(R_ESP + 40)); } +void vFuuiiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiuup_t fn = (vFuuiiiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptriv(R_ESP + 40)); } +void vFuuiuiiiiip_32(x64emu_t *emu, uintptr_t fcn) { vFuuiuiiiiip_t fn = (vFuuiuiiiiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptriv(R_ESP + 40)); } +void vFuuuuuuuCCC_32(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuuCCC_t fn = (vFuuuuuuuCCC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint8_t, R_ESP + 32), from_ptri(uint8_t, R_ESP + 36), from_ptri(uint8_t, R_ESP + 40)); } +void vFuuuuuuuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuuuuu_t fn = (vFuuuuuuuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40)); } +void vFuupuiupuuf_32(x64emu_t *emu, uintptr_t fcn) { vFuupuiupuuf_t fn = (vFuupuiupuuf_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(float, R_ESP + 40)); } +void vFuffiiffiip_32(x64emu_t *emu, uintptr_t fcn) { vFuffiiffiip_t fn = (vFuffiiffiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptriv(R_ESP + 40)); } +void vFuddiiddiip_32(x64emu_t *emu, uintptr_t fcn) { vFuddiiddiip_t fn = (vFuddiiddiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(double, R_ESP + 32), from_ptri(double, R_ESP + 40), from_ptri(int32_t, R_ESP + 48), from_ptri(int32_t, R_ESP + 52), from_ptriv(R_ESP + 56)); } +void vFffffffffff_32(x64emu_t *emu, uintptr_t fcn) { vFffffffffff_t fn = (vFffffffffff_t)fcn; fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32), from_ptri(float, R_ESP + 36), from_ptri(float, R_ESP + 40)); } +void vFppipipippi_32(x64emu_t *emu, uintptr_t fcn) { vFppipipippi_t fn = (vFppipipippi_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36), from_ptri(int32_t, R_ESP + 40)); } +void iFEppippippp_32(x64emu_t *emu, uintptr_t fcn) { iFEppippippp_t fn = (iFEppippippp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36)); } +void iFEppppppppu_32(x64emu_t *emu, uintptr_t fcn) { iFEppppppppu_t fn = (iFEppppppppu_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptri(uint32_t, R_ESP + 36)); } +void iFEXpLiipiiL_32(x64emu_t *emu, uintptr_t fcn) { iFEXpLiipiiL_t fn = (iFEXpLiipiiL_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ulong(from_ptri(ulong_t, R_ESP + 36))); } +void iFiuuupppppu_32(x64emu_t *emu, uintptr_t fcn) { iFiuuupppppu_t fn = (iFiuuupppppu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36), from_ptri(uint32_t, R_ESP + 40)); } +void iFuiiiuuiiip_32(x64emu_t *emu, uintptr_t fcn) { iFuiiiuuiiip_t fn = (iFuiiiuuiiip_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptriv(R_ESP + 40)); } +void iFppuuiiuuuu_32(x64emu_t *emu, uintptr_t fcn) { iFppuuiiuuuu_t fn = (iFppuuiiuuuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40)); } +void iFXiLLdduudd_32(x64emu_t *emu, uintptr_t fcn) { iFXiLLdduudd_t fn = (iFXiLLdduudd_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(double, R_ESP + 44), from_ptri(double, R_ESP + 52)); } +void iFXuuLiuiiLL_32(x64emu_t *emu, uintptr_t fcn) { iFXuuLiuiiLL_t fn = (iFXuuLiuiiLL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ulong(from_ptri(ulong_t, R_ESP + 36)), from_ulong(from_ptri(ulong_t, R_ESP + 40))); } +void iFXLLpiiuuii_32(x64emu_t *emu, uintptr_t fcn) { iFXLLpiiuuii_t fn = (iFXLLpiiuuii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40)); } +void pFEpiiiiuuuu_32(x64emu_t *emu, uintptr_t fcn) { pFEpiiiiuuuu_t fn = (pFEpiiiiuuuu_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36))); } +void pFEpnCuuuCup_32(x64emu_t *emu, uintptr_t fcn) { pFEpnCuuuCup_t fn = (pFEpnCuuuCup_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 8)); R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), aligned_xcb, from_ptri(uint8_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint8_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptriv(R_ESP + 36))); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 8)); } +void pFXpuiipuuii_32(x64emu_t *emu, uintptr_t fcn) { pFXpuiipuuii_t fn = (pFXpuiipuuii_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40))); } +void iFppLpLLpLpbL__32(x64emu_t *emu, uintptr_t fcn) { iFppLpLLpLpbL__t fn = (iFppLpLLpLpbL__t)fcn; struct_L_t arg_40={0}; if (*(ptr_t*)(from_ptr((R_ESP + 40)))) from_struct_L(&arg_40, *(ptr_t*)(from_ptr((R_ESP + 40)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ulong(from_ptri(ulong_t, R_ESP + 24)), from_ptriv(R_ESP + 28), from_ulong(from_ptri(ulong_t, R_ESP + 32)), from_ptriv(R_ESP + 36), *(ptr_t*)(from_ptr((R_ESP + 40))) ? &arg_40 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 40)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 40))), &arg_40); } +void iFXiiLiiibiip_ip_32(x64emu_t *emu, uintptr_t fcn) { iFXiiLiiibiip_ip_t fn = (iFXiiLiiibiip_ip_t)fcn; struct_iip_t arg_32={0}; if (*(ptr_t*)(from_ptr((R_ESP + 32)))) from_struct_iip(&arg_32, *(ptr_t*)(from_ptr((R_ESP + 32)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), *(ptr_t*)(from_ptr((R_ESP + 32))) ? &arg_32 : NULL, from_ptri(int32_t, R_ESP + 36), from_ptriv(R_ESP + 40)); if (*(ptr_t*)(from_ptr((R_ESP + 32)))) to_struct_iip(*(ptr_t*)(from_ptr((R_ESP + 32))), &arg_32); } +void iFXiLLiiibiip_ip_32(x64emu_t *emu, uintptr_t fcn) { iFXiLLiiibiip_ip_t fn = (iFXiLLiiibiip_ip_t)fcn; struct_iip_t arg_32={0}; if (*(ptr_t*)(from_ptr((R_ESP + 32)))) from_struct_iip(&arg_32, *(ptr_t*)(from_ptr((R_ESP + 32)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), *(ptr_t*)(from_ptr((R_ESP + 32))) ? &arg_32 : NULL, from_ptri(int32_t, R_ESP + 36), from_ptriv(R_ESP + 40)); if (*(ptr_t*)(from_ptr((R_ESP + 32)))) to_struct_iip(*(ptr_t*)(from_ptr((R_ESP + 32))), &arg_32); } +void vFiiiiillliip_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiillliip_t fn = (vFiiiiillliip_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_long(from_ptri(long_t, R_ESP + 24)), from_long(from_ptri(long_t, R_ESP + 28)), from_long(from_ptri(long_t, R_ESP + 32)), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptriv(R_ESP + 44)); } +void vFiiiiilllilp_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiilllilp_t fn = (vFiiiiilllilp_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_long(from_ptri(long_t, R_ESP + 24)), from_long(from_ptri(long_t, R_ESP + 28)), from_long(from_ptri(long_t, R_ESP + 32)), from_ptri(int32_t, R_ESP + 36), from_long(from_ptri(long_t, R_ESP + 40)), from_ptriv(R_ESP + 44)); } +void vFuiiiiiiiuip_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiuip_t fn = (vFuiiiiiiiuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptriv(R_ESP + 44)); } +void vFuiiiiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiuup_t fn = (vFuiiiiiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptriv(R_ESP + 44)); } +void vFuiiiillliip_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiillliip_t fn = (vFuiiiillliip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_long(from_ptri(long_t, R_ESP + 24)), from_long(from_ptri(long_t, R_ESP + 28)), from_long(from_ptri(long_t, R_ESP + 32)), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptriv(R_ESP + 44)); } +void vFuiuiiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuiuiiiiiuup_t fn = (vFuiuiiiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptriv(R_ESP + 44)); } +void vFuuiiiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiuup_t fn = (vFuuiiiiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptriv(R_ESP + 44)); } +void vFuuupupppppp_32(x64emu_t *emu, uintptr_t fcn) { vFuuupupppppp_t fn = (vFuuupupppppp_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36), from_ptriv(R_ESP + 40), from_ptriv(R_ESP + 44)); } +void vFuuffiiffiip_32(x64emu_t *emu, uintptr_t fcn) { vFuuffiiffiip_t fn = (vFuuffiiffiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptriv(R_ESP + 44)); } +void vFuufffffffff_32(x64emu_t *emu, uintptr_t fcn) { vFuufffffffff_t fn = (vFuufffffffff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32), from_ptri(float, R_ESP + 36), from_ptri(float, R_ESP + 40), from_ptri(float, R_ESP + 44)); } +void vFuuddiiddiip_32(x64emu_t *emu, uintptr_t fcn) { vFuuddiiddiip_t fn = (vFuuddiiddiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(double, R_ESP + 36), from_ptri(double, R_ESP + 44), from_ptri(int32_t, R_ESP + 52), from_ptri(int32_t, R_ESP + 56), from_ptriv(R_ESP + 60)); } +void vFuUuuuuuuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuUuuuuuuuuu_t fn = (vFuUuuuuuuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(uint32_t, R_ESP + 44), from_ptri(uint32_t, R_ESP + 48)); } +void vFuffffffffff_32(x64emu_t *emu, uintptr_t fcn) { vFuffffffffff_t fn = (vFuffffffffff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32), from_ptri(float, R_ESP + 36), from_ptri(float, R_ESP + 40), from_ptri(float, R_ESP + 44)); } +void vFUufffffffff_32(x64emu_t *emu, uintptr_t fcn) { vFUufffffffff_t fn = (vFUufffffffff_t)fcn; fn(from_ptri(uint64_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32), from_ptri(float, R_ESP + 36), from_ptri(float, R_ESP + 40), from_ptri(float, R_ESP + 44), from_ptri(float, R_ESP + 48)); } +void vFpiiiiiiiiuu_32(x64emu_t *emu, uintptr_t fcn) { vFpiiiiiiiiuu_t fn = (vFpiiiiiiiiuu_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(uint32_t, R_ESP + 44)); } +void vFpipipiipiiu_32(x64emu_t *emu, uintptr_t fcn) { vFpipipiipiiu_t fn = (vFpipipiipiiu_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptri(uint32_t, R_ESP + 44)); } +void iFEXLppiiiiuu_32(x64emu_t *emu, uintptr_t fcn) { iFEXLppiiiiuu_t fn = (iFEXLppiiiiuu_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40)); } +void iFEXpLLiiLWpi_32(x64emu_t *emu, uintptr_t fcn) { iFEXpLLiiLWpi_t fn = (iFEXpLLiiLWpi_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ulong(from_ptri(ulong_t, R_ESP + 28)), from_ptri(uint16_t, R_ESP + 32), from_ptriv(R_ESP + 36), from_ptri(int32_t, R_ESP + 40)); } +void iFuiiiiuuiiip_32(x64emu_t *emu, uintptr_t fcn) { iFuiiiiuuiiip_t fn = (iFuiiiiuuiiip_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptriv(R_ESP + 44)); } +void iFuppipipippi_32(x64emu_t *emu, uintptr_t fcn) { iFuppipipippi_t fn = (iFuppipipippi_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptriv(R_ESP + 36), from_ptriv(R_ESP + 40), from_ptri(int32_t, R_ESP + 44)); } +void iFXLLpiiuuiiL_32(x64emu_t *emu, uintptr_t fcn) { iFXLLpiiuuiiL_t fn = (iFXLLpiiuuiiL_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ulong(from_ptri(ulong_t, R_ESP + 44))); } +void pFEXpuiipuuii_32(x64emu_t *emu, uintptr_t fcn) { pFEXpuiipuuii_t fn = (pFEXpuiipuuii_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40))); } +void iFXiiLLiiibiip_ip_32(x64emu_t *emu, uintptr_t fcn) { iFXiiLLiiibiip_ip_t fn = (iFXiiLLiiibiip_ip_t)fcn; struct_iip_t arg_36={0}; if (*(ptr_t*)(from_ptr((R_ESP + 36)))) from_struct_iip(&arg_36, *(ptr_t*)(from_ptr((R_ESP + 36)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), *(ptr_t*)(from_ptr((R_ESP + 36))) ? &arg_36 : NULL, from_ptri(int32_t, R_ESP + 40), from_ptriv(R_ESP + 44)); if (*(ptr_t*)(from_ptr((R_ESP + 36)))) to_struct_iip(*(ptr_t*)(from_ptr((R_ESP + 36))), &arg_36); } +void iFXLibL_iiiibL_bL_bL__32(x64emu_t *emu, uintptr_t fcn) { iFXLibL_iiiibL_bL_bL__t fn = (iFXLibL_iiiibL_bL_bL__t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_L_t arg_36={0}; if (*(ptr_t*)(from_ptr((R_ESP + 36)))) from_struct_L(&arg_36, *(ptr_t*)(from_ptr((R_ESP + 36)))); struct_L_t arg_40={0}; if (*(ptr_t*)(from_ptr((R_ESP + 40)))) from_struct_L(&arg_40, *(ptr_t*)(from_ptr((R_ESP + 40)))); struct_L_t arg_44={0}; if (*(ptr_t*)(from_ptr((R_ESP + 44)))) from_struct_L(&arg_44, *(ptr_t*)(from_ptr((R_ESP + 44)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), *(ptr_t*)(from_ptr((R_ESP + 36))) ? &arg_36 : NULL, *(ptr_t*)(from_ptr((R_ESP + 40))) ? &arg_40 : NULL, *(ptr_t*)(from_ptr((R_ESP + 44))) ? &arg_44 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 36)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 36))), &arg_36); if (*(ptr_t*)(from_ptr((R_ESP + 40)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 40))), &arg_40); if (*(ptr_t*)(from_ptr((R_ESP + 44)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 44))), &arg_44); } +void vFXiLLrLiiwwwwwwwwL_iiiipi_32(x64emu_t *emu, uintptr_t fcn) { vFXiLLrLiiwwwwwwwwL_iiiipi_t fn = (vFXiLLrLiiwwwwwwwwL_iiiipi_t)fcn; struct_LiiwwwwwwwwL_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_LiiwwwwwwwwL(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptriv(R_ESP + 40), from_ptri(int32_t, R_ESP + 44)); } +void vFuiiiiiiiiuUC_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiiuUC_t fn = (vFuiiiiiiiiuUC_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(uint64_t, R_ESP + 44), from_ptri(uint8_t, R_ESP + 52)); } +void vFuiiiiiiiuuip_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiuuip_t fn = (vFuiiiiiiiuuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(int32_t, R_ESP + 44), from_ptriv(R_ESP + 48)); } +void vFuuiiiiiiiiuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiiiuu_t fn = (vFuuiiiiiiiiuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptri(uint32_t, R_ESP + 44), from_ptri(uint32_t, R_ESP + 48)); } +void vFuuiiiiiiiuip_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiiuip_t fn = (vFuuiiiiiiiuip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(int32_t, R_ESP + 44), from_ptriv(R_ESP + 48)); } +void vFuuiiiiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiiiiuup_t fn = (vFuuiiiiiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(uint32_t, R_ESP + 44), from_ptriv(R_ESP + 48)); } +void vFuuuuuuuuuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuuuuuuu_t fn = (vFuuuuuuuuuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(uint32_t, R_ESP + 44), from_ptri(uint32_t, R_ESP + 48)); } +void vFffffffffffff_32(x64emu_t *emu, uintptr_t fcn) { vFffffffffffff_t fn = (vFffffffffffff_t)fcn; fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32), from_ptri(float, R_ESP + 36), from_ptri(float, R_ESP + 40), from_ptri(float, R_ESP + 44), from_ptri(float, R_ESP + 48)); } +void vFXiLLpiiiipii_32(x64emu_t *emu, uintptr_t fcn) { vFXiLLpiiiipii_t fn = (vFXiLLpiiiipii_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptriv(R_ESP + 40), from_ptri(int32_t, R_ESP + 44), from_ptri(int32_t, R_ESP + 48)); } +void iFEXLppiiiiuui_32(x64emu_t *emu, uintptr_t fcn) { iFEXLppiiiiuui_t fn = (iFEXLppiiiiuui_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(int32_t, R_ESP + 44)); } +void iFXLpppppppppp_32(x64emu_t *emu, uintptr_t fcn) { iFXLpppppppppp_t fn = (iFXLpppppppppp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36), from_ptriv(R_ESP + 40), from_ptriv(R_ESP + 44), from_ptriv(R_ESP + 48)); } +void pFEXLiiuuLipii_32(x64emu_t *emu, uintptr_t fcn) { pFEXLiiuuLipii_t fn = (pFEXLiiuuLipii_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ulong(from_ptri(ulong_t, R_ESP + 28)), from_ptri(int32_t, R_ESP + 32), from_ptriv(R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptri(int32_t, R_ESP + 44))); } +void iFXiLbL_bL_ppppbip_pp_32(x64emu_t *emu, uintptr_t fcn) { iFXiLbL_bL_ppppbip_pp_t fn = (iFXiLbL_bL_ppppbip_pp_t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_L_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_L(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); struct_ip_t arg_40={0}; if (*(ptr_t*)(from_ptr((R_ESP + 40)))) from_struct_ip(&arg_40, *(ptr_t*)(from_ptr((R_ESP + 40)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36), *(ptr_t*)(from_ptr((R_ESP + 40))) ? &arg_40 : NULL, from_ptriv(R_ESP + 44), from_ptriv(R_ESP + 48)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); if (*(ptr_t*)(from_ptr((R_ESP + 40)))) to_struct_ip(*(ptr_t*)(from_ptr((R_ESP + 40))), &arg_40); } +void iFXiLlliLBL_pBL_BL_bp__32(x64emu_t *emu, uintptr_t fcn) { iFXiLlliLBL_pBL_BL_bp__t fn = (iFXiLlliLBL_pBL_BL_bp__t)fcn; struct_L_t arg_32={0}; struct_L_t arg_40={0}; struct_L_t arg_44={0}; struct_p_t arg_48={0}; if (*(ptr_t*)(from_ptr((R_ESP + 48)))) from_struct_p(&arg_48, *(ptr_t*)(from_ptr((R_ESP + 48)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16)), from_long(from_ptri(long_t, R_ESP + 20)), from_ptri(int32_t, R_ESP + 24), from_ulong(from_ptri(ulong_t, R_ESP + 28)), *(ptr_t*)(from_ptr((R_ESP + 32))) ? &arg_32 : NULL, from_ptriv(R_ESP + 36), *(ptr_t*)(from_ptr((R_ESP + 40))) ? &arg_40 : NULL, *(ptr_t*)(from_ptr((R_ESP + 44))) ? &arg_44 : NULL, *(ptr_t*)(from_ptr((R_ESP + 48))) ? &arg_48 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 32)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 32))), &arg_32); if (*(ptr_t*)(from_ptr((R_ESP + 40)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 40))), &arg_40); if (*(ptr_t*)(from_ptr((R_ESP + 44)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 44))), &arg_44); if (*(ptr_t*)(from_ptr((R_ESP + 48)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 48))), &arg_48); } +void vFXiLLrLiiwwwwwwwwL_Liiiipi_32(x64emu_t *emu, uintptr_t fcn) { vFXiLLrLiiwwwwwwwwL_Liiiipi_t fn = (vFXiLLrLiiwwwwwwwwL_Liiiipi_t)fcn; struct_LiiwwwwwwwwL_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_LiiwwwwwwwwL(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 24)), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptriv(R_ESP + 44), from_ptri(int32_t, R_ESP + 48)); } +void vFuiiiiiiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiiiiiuup_t fn = (vFuiiiiiiiiiuup_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptri(uint32_t, R_ESP + 44), from_ptri(uint32_t, R_ESP + 48), from_ptriv(R_ESP + 52)); } +void vFuuuuuuuuuuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuuuuuuuuuuuuu_t fn = (vFuuuuuuuuuuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(uint32_t, R_ESP + 44), from_ptri(uint32_t, R_ESP + 48), from_ptri(uint32_t, R_ESP + 52)); } +void vFuUuuuuuuuuuuu_32(x64emu_t *emu, uintptr_t fcn) { vFuUuuuuuuuuuuu_t fn = (vFuUuuuuuuuuuuu_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint64_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(uint32_t, R_ESP + 44), from_ptri(uint32_t, R_ESP + 48), from_ptri(uint32_t, R_ESP + 52), from_ptri(uint32_t, R_ESP + 56)); } +void vFuffffffffffff_32(x64emu_t *emu, uintptr_t fcn) { vFuffffffffffff_t fn = (vFuffffffffffff_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32), from_ptri(float, R_ESP + 36), from_ptri(float, R_ESP + 40), from_ptri(float, R_ESP + 44), from_ptri(float, R_ESP + 48), from_ptri(float, R_ESP + 52)); } +void vFXiLLLiiiiiiuu_32(x64emu_t *emu, uintptr_t fcn) { vFXiLLLiiiiiiuu_t fn = (vFXiLLLiiiiiiuu_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptri(int32_t, R_ESP + 44), from_ptri(uint32_t, R_ESP + 48), from_ptri(uint32_t, R_ESP + 52)); } +void iFEXLLlliLppppp_32(x64emu_t *emu, uintptr_t fcn) { iFEXLLlliLppppp_t fn = (iFEXLLlliLppppp_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16)), from_long(from_ptri(long_t, R_ESP + 20)), from_ptri(int32_t, R_ESP + 24), from_ulong(from_ptri(ulong_t, R_ESP + 28)), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36), from_ptriv(R_ESP + 40), from_ptriv(R_ESP + 44), from_ptriv(R_ESP + 48)); } +void iFiuuuuiiuuuuuu_32(x64emu_t *emu, uintptr_t fcn) { iFiuuuuiiuuuuuu_t fn = (iFiuuuuiiuuuuuu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(uint32_t, R_ESP + 44), from_ptri(uint32_t, R_ESP + 48), from_ptri(uint32_t, R_ESP + 52)); } +void iFddddpppddpppp_32(x64emu_t *emu, uintptr_t fcn) { iFddddpppddpppp_t fn = (iFddddpppddpppp_t)fcn; R_EAX = fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20), from_ptri(double, R_ESP + 28), from_ptriv(R_ESP + 36), from_ptriv(R_ESP + 40), from_ptriv(R_ESP + 44), from_ptri(double, R_ESP + 48), from_ptri(double, R_ESP + 56), from_ptriv(R_ESP + 64), from_ptriv(R_ESP + 68), from_ptriv(R_ESP + 72), from_ptriv(R_ESP + 76)); } +void iFXippuuuiipppp_32(x64emu_t *emu, uintptr_t fcn) { iFXippuuuiipppp_t fn = (iFXippuuuiipppp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptriv(R_ESP + 40), from_ptriv(R_ESP + 44), from_ptriv(R_ESP + 48), from_ptriv(R_ESP + 52)); } +void uFippuuuulllipp_32(x64emu_t *emu, uintptr_t fcn) { uFippuuuulllipp_t fn = (uFippuuuulllipp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_long(from_ptri(long_t, R_ESP + 32)), from_long(from_ptri(long_t, R_ESP + 36)), from_long(from_ptri(long_t, R_ESP + 40)), from_ptri(int32_t, R_ESP + 44), from_ptriv(R_ESP + 48), from_ptriv(R_ESP + 52)); } +void LFEXLiiuuuiupLp_32(x64emu_t *emu, uintptr_t fcn) { LFEXLiiuuuiupLp_t fn = (LFEXLiiuuuiupLp_t)fcn; R_EAX = to_ulong(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptriv(R_ESP + 40), from_ulong(from_ptri(ulong_t, R_ESP + 44)), from_ptriv(R_ESP + 48))); } +void iFXLLlliiLBL_pBL_BL_Bp__32(x64emu_t *emu, uintptr_t fcn) { iFXLLlliiLBL_pBL_BL_Bp__t fn = (iFXLLlliiLBL_pBL_BL_Bp__t)fcn; struct_L_t arg_36={0}; struct_L_t arg_44={0}; struct_L_t arg_48={0}; struct_p_t arg_52={0}; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_long(from_ptri(long_t, R_ESP + 16)), from_long(from_ptri(long_t, R_ESP + 20)), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ulong(from_ptri(ulong_t, R_ESP + 32)), *(ptr_t*)(from_ptr((R_ESP + 36))) ? &arg_36 : NULL, from_ptriv(R_ESP + 40), *(ptr_t*)(from_ptr((R_ESP + 44))) ? &arg_44 : NULL, *(ptr_t*)(from_ptr((R_ESP + 48))) ? &arg_48 : NULL, *(ptr_t*)(from_ptr((R_ESP + 52))) ? &arg_52 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 36)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 36))), &arg_36); if (*(ptr_t*)(from_ptr((R_ESP + 44)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 44))), &arg_44); if (*(ptr_t*)(from_ptr((R_ESP + 48)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 48))), &arg_48); if (*(ptr_t*)(from_ptr((R_ESP + 52)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 52))), &arg_52); } +void vFuffiiffiiffiip_32(x64emu_t *emu, uintptr_t fcn) { vFuffiiffiiffiip_t fn = (vFuffiiffiiffiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(float, R_ESP + 40), from_ptri(float, R_ESP + 44), from_ptri(int32_t, R_ESP + 48), from_ptri(int32_t, R_ESP + 52), from_ptriv(R_ESP + 56)); } +void vFuddiiddiiddiip_32(x64emu_t *emu, uintptr_t fcn) { vFuddiiddiiddiip_t fn = (vFuddiiddiiddiip_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(double, R_ESP + 32), from_ptri(double, R_ESP + 40), from_ptri(int32_t, R_ESP + 48), from_ptri(int32_t, R_ESP + 52), from_ptri(double, R_ESP + 56), from_ptri(double, R_ESP + 64), from_ptri(int32_t, R_ESP + 72), from_ptri(int32_t, R_ESP + 76), from_ptriv(R_ESP + 80)); } +void vFuiiiiiuiiiiilll_32(x64emu_t *emu, uintptr_t fcn) { vFuiiiiiuiiiiilll_t fn = (vFuiiiiiuiiiiilll_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptri(int32_t, R_ESP + 44), from_ptri(int32_t, R_ESP + 48), from_long(from_ptri(long_t, R_ESP + 52)), from_long(from_ptri(long_t, R_ESP + 56)), from_long(from_ptri(long_t, R_ESP + 60))); } +void vFuuiiiiuuiiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuuiiiiuuiiiiiii_t fn = (vFuuiiiiuuiiiiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptri(int32_t, R_ESP + 44), from_ptri(int32_t, R_ESP + 48), from_ptri(int32_t, R_ESP + 52), from_ptri(int32_t, R_ESP + 56), from_ptri(int32_t, R_ESP + 60)); } +void vFfffffffffffffff_32(x64emu_t *emu, uintptr_t fcn) { vFfffffffffffffff_t fn = (vFfffffffffffffff_t)fcn; fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16), from_ptri(float, R_ESP + 20), from_ptri(float, R_ESP + 24), from_ptri(float, R_ESP + 28), from_ptri(float, R_ESP + 32), from_ptri(float, R_ESP + 36), from_ptri(float, R_ESP + 40), from_ptri(float, R_ESP + 44), from_ptri(float, R_ESP + 48), from_ptri(float, R_ESP + 52), from_ptri(float, R_ESP + 56), from_ptri(float, R_ESP + 60)); } +void iFpppppppppppppppp_32(x64emu_t *emu, uintptr_t fcn) { iFpppppppppppppppp_t fn = (iFpppppppppppppppp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36), from_ptriv(R_ESP + 40), from_ptriv(R_ESP + 44), from_ptriv(R_ESP + 48), from_ptriv(R_ESP + 52), from_ptriv(R_ESP + 56), from_ptriv(R_ESP + 60), from_ptriv(R_ESP + 64)); } +void pFEppnCuuwwWWWWuup_32(x64emu_t *emu, uintptr_t fcn) { pFEppnCuuwwWWWWuup_t fn = (pFEppnCuuwwWWWWuup_t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 12)); R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), aligned_xcb, from_ptri(uint8_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(int16_t, R_ESP + 28), from_ptri(int16_t, R_ESP + 32), from_ptri(uint16_t, R_ESP + 36), from_ptri(uint16_t, R_ESP + 40), from_ptri(uint16_t, R_ESP + 44), from_ptri(uint16_t, R_ESP + 48), from_ptri(uint32_t, R_ESP + 52), from_ptri(uint32_t, R_ESP + 56), from_ptriv(R_ESP + 60))); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 12)); } +void vFuuuuiiiiuuiiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFuuuuiiiiuuiiiiiii_t fn = (vFuuuuiiiiuuiiiiiii_t)fcn; fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(int32_t, R_ESP + 44), from_ptri(int32_t, R_ESP + 48), from_ptri(int32_t, R_ESP + 52), from_ptri(int32_t, R_ESP + 56), from_ptri(int32_t, R_ESP + 60), from_ptri(int32_t, R_ESP + 64), from_ptri(int32_t, R_ESP + 68)); } +void vFXpuiiiiipuiiiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFXpuiiiiipuiiiiiiii_t fn = (vFXpuiiiiipuiiiiiiii_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptriv(R_ESP + 36), from_ptri(uint32_t, R_ESP + 40), from_ptri(int32_t, R_ESP + 44), from_ptri(int32_t, R_ESP + 48), from_ptri(int32_t, R_ESP + 52), from_ptri(int32_t, R_ESP + 56), from_ptri(int32_t, R_ESP + 60), from_ptri(int32_t, R_ESP + 64), from_ptri(int32_t, R_ESP + 68), from_ptri(int32_t, R_ESP + 72)); } +void uFippuuuuiiiiuuiiiiiiiipp_32(x64emu_t *emu, uintptr_t fcn) { uFippuuuuiiiiuuiiiiiiiipp_t fn = (uFippuuuuiiiiuuiiiiiiiipp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40), from_ptri(int32_t, R_ESP + 44), from_ptri(uint32_t, R_ESP + 48), from_ptri(uint32_t, R_ESP + 52), from_ptri(int32_t, R_ESP + 56), from_ptri(int32_t, R_ESP + 60), from_ptri(int32_t, R_ESP + 64), from_ptri(int32_t, R_ESP + 68), from_ptri(int32_t, R_ESP + 72), from_ptri(int32_t, R_ESP + 76), from_ptri(int32_t, R_ESP + 80), from_ptri(int32_t, R_ESP + 84), from_ptriv(R_ESP + 88), from_ptriv(R_ESP + 92)); } + +#if defined(HAVE_LD80BITS) +void DED_32(x64emu_t *emu, uintptr_t fcn) { DED_t fn = (DED_t)fcn; errno = emu->libc_err; long double ld = fn(LD2localLD(from_ptrv(R_ESP + 4))); fpu_do_push(emu); ST0val = ld; emu->libc_err = errno; } +void DFDi_32(x64emu_t *emu, uintptr_t fcn) { DFDi_t fn = (DFDi_t)fcn; long double ld = fn(LD2localLD(from_ptrv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 16)); fpu_do_push(emu); ST0val = ld; } +void DEDD_32(x64emu_t *emu, uintptr_t fcn) { DEDD_t fn = (DEDD_t)fcn; errno = emu->libc_err; long double ld = fn(LD2localLD(from_ptrv(R_ESP + 4)), LD2localLD(from_ptrv(R_ESP + 16))); fpu_do_push(emu); ST0val = ld; emu->libc_err = errno; } +void DFDp_32(x64emu_t *emu, uintptr_t fcn) { DFDp_t fn = (DFDp_t)fcn; long double ld = fn(LD2localLD(from_ptrv(R_ESP + 4)), from_ptriv(R_ESP + 16)); fpu_do_push(emu); ST0val = ld; } +void DEDp_32(x64emu_t *emu, uintptr_t fcn) { DEDp_t fn = (DEDp_t)fcn; errno = emu->libc_err; long double ld = fn(LD2localLD(from_ptrv(R_ESP + 4)), from_ptriv(R_ESP + 16)); fpu_do_push(emu); ST0val = ld; emu->libc_err = errno; } +void DEpBp_a_32(x64emu_t *emu, uintptr_t fcn) { DEpBp_a_t fn = (DEpBp_a_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; long double ld = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_locale(from_ptri(ptr_t, R_ESP + 12))); fpu_do_push(emu); ST0val = ld; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +#endif + +#if !defined(HAVE_LD80BITS) +void KEK_32(x64emu_t *emu, uintptr_t fcn) { KEK_t fn = (KEK_t)fcn; errno = emu->libc_err; double db = fn(FromLD(from_ptrv(R_ESP + 4))); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void KFKi_32(x64emu_t *emu, uintptr_t fcn) { KFKi_t fn = (KFKi_t)fcn; double db = fn(FromLD(from_ptrv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 16)); fpu_do_push(emu); ST0val = db; } +void KEKK_32(x64emu_t *emu, uintptr_t fcn) { KEKK_t fn = (KEKK_t)fcn; errno = emu->libc_err; double db = fn(FromLD(from_ptrv(R_ESP + 4)), FromLD(from_ptrv(R_ESP + 16))); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void KFKp_32(x64emu_t *emu, uintptr_t fcn) { KFKp_t fn = (KFKp_t)fcn; double db = fn(FromLD(from_ptrv(R_ESP + 4)), from_ptriv(R_ESP + 16)); fpu_do_push(emu); ST0val = db; } +void KEKp_32(x64emu_t *emu, uintptr_t fcn) { KEKp_t fn = (KEKp_t)fcn; errno = emu->libc_err; double db = fn(FromLD(from_ptrv(R_ESP + 4)), from_ptriv(R_ESP + 16)); fpu_do_push(emu); ST0val = db; emu->libc_err = errno; } +void KEpBp_a_32(x64emu_t *emu, uintptr_t fcn) { KEpBp_a_t fn = (KEpBp_a_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; double db = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_locale(from_ptri(ptr_t, R_ESP + 12))); fpu_do_push(emu); ST0val = db; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } +#endif + +#if defined(WINLATOR_GLIBC) +void pEipi_32(x64emu_t *emu, uintptr_t fcn) { pEipi_t fn = (pEipi_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); emu->libc_err = errno; } +#endif + +#if !defined(WINLATOR_GLIBC) +void pEEipi_32(x64emu_t *emu, uintptr_t fcn) { pEEipi_t fn = (pEEipi_t)fcn; errno = emu->libc_err; R_EAX = to_ptrv(fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); emu->libc_err = errno; } +#endif + +void UEsvvs_32(x64emu_t *emu, uintptr_t fcn) { UEss_t fn = (UEss_t)fcn; errno = emu->libc_err; ui64_t r; r.u = (uint64_t)fn(from_ptrv(R_ESP + 4), from_ptrv(R_ESP + 12)); R_EAX = r.d[0]; R_EDX = r.d[1]; emu->libc_err = errno; } + +int isRetX87Wrapper32(wrapper_t fun) { + if (fun == &fFi_32) return 1; + if (fun == &fEf_32) return 1; + if (fun == &fFf_32) return 1; + if (fun == &dEv_32) return 1; + if (fun == &dFi_32) return 1; + if (fun == &dEd_32) return 1; + if (fun == &dFd_32) return 1; + if (fun == &dEp_32) return 1; + if (fun == &dFp_32) return 1; + if (fun == &fEif_32) return 1; + if (fun == &fFfi_32) return 1; + if (fun == &fEfi_32) return 1; + if (fun == &fEff_32) return 1; + if (fun == &fFff_32) return 1; + if (fun == &fEfD_32) return 1; + if (fun == &fEfp_32) return 1; + if (fun == &dEid_32) return 1; + if (fun == &dFdi_32) return 1; + if (fun == &dEdi_32) return 1; + if (fun == &dEdd_32) return 1; + if (fun == &dFdd_32) return 1; + if (fun == &dEdD_32) return 1; + if (fun == &dFdp_32) return 1; + if (fun == &dEdp_32) return 1; + if (fun == &dEll_32) return 1; + if (fun == &dFpp_32) return 1; + if (fun == &fEpBp__32) return 1; + if (fun == &dEpBp__32) return 1; + if (fun == &fFuii_32) return 1; + if (fun == &fEfff_32) return 1; + if (fun == &fEffp_32) return 1; + if (fun == &dEddd_32) return 1; + if (fun == &dEddp_32) return 1; + if (fun == &fEpBp_p_32) return 1; + if (fun == &fEpBp_a_32) return 1; + if (fun == &dEpBp_i_32) return 1; + if (fun == &dEpBp_a_32) return 1; +#if defined(HAVE_LD80BITS) + if (fun == &DED_32) return 1; + if (fun == &DFDi_32) return 1; + if (fun == &DEDD_32) return 1; + if (fun == &DFDp_32) return 1; + if (fun == &DEDp_32) return 1; + if (fun == &DEpBp_a_32) return 1; +#endif +#if !defined(HAVE_LD80BITS) + if (fun == &KEK_32) return 1; + if (fun == &KFKi_32) return 1; + if (fun == &KEKK_32) return 1; + if (fun == &KFKp_32) return 1; + if (fun == &KEKp_32) return 1; + if (fun == &KEpBp_a_32) return 1; +#endif + return 0; +} diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h new file mode 100644 index 0000000..d5f3872 --- /dev/null +++ b/src/wrapped32/generated/wrapper32.h @@ -0,0 +1,2228 @@ +/********************************************************************* + * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) * + *********************************************************************/ +#ifndef __WRAPPER32_H_ +#define __WRAPPER32_H_ +#include +#include + +typedef struct x64emu_s x64emu_t; + +// the generic wrapper pointer functions +typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc); + +// list of defined wrappers +// E = current x64emu struct +// v = void +// C = unsigned byte c = char +// W = unsigned short w = short +// u = uint32, i = int32 +// U = uint64, I = int64 +// L = unsigned long, l = signed long (long is an int with the size of a pointer) +// p = pointer +// h = hash (32<->64bits) +// H = hash (32<->64bits) that will be deleted from hashmaps +// a = locale +// A = locale that will be deleted from hashmaps +// f = float, d = double, D = long double, K = fake long double +// V = vaargs, s = address on the stack (doesn't move forward the pointer) +// O = libc O_ flags bitfield +// o = stdout +// S = _IO_2_1_stdXXX_ pointer (or FILE*) +// 2 = struct of 2 uint +// N = ... automatically sending 1 arg +// M = ... automatically sending 2 args +// P = Vulkan struct pointer +// r..._ = pointer to read-only structure +// B..._ = pointer to write-only structure +// b..._ = pointer to read-write structure +// t = char* as a return value (copies to a lower address if the return address is too high) +// X = Display* + +void vEv_32(x64emu_t *emu, uintptr_t fnc); +void vFv_32(x64emu_t *emu, uintptr_t fnc); +void vFc_32(x64emu_t *emu, uintptr_t fnc); +void vFw_32(x64emu_t *emu, uintptr_t fnc); +void vEi_32(x64emu_t *emu, uintptr_t fnc); +void vFi_32(x64emu_t *emu, uintptr_t fnc); +void vFC_32(x64emu_t *emu, uintptr_t fnc); +void vFW_32(x64emu_t *emu, uintptr_t fnc); +void vEu_32(x64emu_t *emu, uintptr_t fnc); +void vFu_32(x64emu_t *emu, uintptr_t fnc); +void vFU_32(x64emu_t *emu, uintptr_t fnc); +void vFf_32(x64emu_t *emu, uintptr_t fnc); +void vFd_32(x64emu_t *emu, uintptr_t fnc); +void vEl_32(x64emu_t *emu, uintptr_t fnc); +void vFl_32(x64emu_t *emu, uintptr_t fnc); +void vEp_32(x64emu_t *emu, uintptr_t fnc); +void vFp_32(x64emu_t *emu, uintptr_t fnc); +void vEA_32(x64emu_t *emu, uintptr_t fnc); +void vES_32(x64emu_t *emu, uintptr_t fnc); +void vFS_32(x64emu_t *emu, uintptr_t fnc); +void vFX_32(x64emu_t *emu, uintptr_t fnc); +void vFn_32(x64emu_t *emu, uintptr_t fnc); +void cFc_32(x64emu_t *emu, uintptr_t fnc); +void cFi_32(x64emu_t *emu, uintptr_t fnc); +void cFu_32(x64emu_t *emu, uintptr_t fnc); +void cFp_32(x64emu_t *emu, uintptr_t fnc); +void wFp_32(x64emu_t *emu, uintptr_t fnc); +void iEv_32(x64emu_t *emu, uintptr_t fnc); +void iFv_32(x64emu_t *emu, uintptr_t fnc); +void iEi_32(x64emu_t *emu, uintptr_t fnc); +void iFi_32(x64emu_t *emu, uintptr_t fnc); +void iEI_32(x64emu_t *emu, uintptr_t fnc); +void iEu_32(x64emu_t *emu, uintptr_t fnc); +void iFu_32(x64emu_t *emu, uintptr_t fnc); +void iFU_32(x64emu_t *emu, uintptr_t fnc); +void iEf_32(x64emu_t *emu, uintptr_t fnc); +void iEd_32(x64emu_t *emu, uintptr_t fnc); +void iEl_32(x64emu_t *emu, uintptr_t fnc); +void iEL_32(x64emu_t *emu, uintptr_t fnc); +void iFL_32(x64emu_t *emu, uintptr_t fnc); +void iEp_32(x64emu_t *emu, uintptr_t fnc); +void iFp_32(x64emu_t *emu, uintptr_t fnc); +void iEh_32(x64emu_t *emu, uintptr_t fnc); +void iES_32(x64emu_t *emu, uintptr_t fnc); +void iFX_32(x64emu_t *emu, uintptr_t fnc); +void iFn_32(x64emu_t *emu, uintptr_t fnc); +void IFi_32(x64emu_t *emu, uintptr_t fnc); +void IEf_32(x64emu_t *emu, uintptr_t fnc); +void IEd_32(x64emu_t *emu, uintptr_t fnc); +void IEp_32(x64emu_t *emu, uintptr_t fnc); +void IFp_32(x64emu_t *emu, uintptr_t fnc); +void IES_32(x64emu_t *emu, uintptr_t fnc); +void CFv_32(x64emu_t *emu, uintptr_t fnc); +void CFi_32(x64emu_t *emu, uintptr_t fnc); +void CFu_32(x64emu_t *emu, uintptr_t fnc); +void CFU_32(x64emu_t *emu, uintptr_t fnc); +void CFl_32(x64emu_t *emu, uintptr_t fnc); +void CFp_32(x64emu_t *emu, uintptr_t fnc); +void WFi_32(x64emu_t *emu, uintptr_t fnc); +void WEW_32(x64emu_t *emu, uintptr_t fnc); +void WFu_32(x64emu_t *emu, uintptr_t fnc); +void WFp_32(x64emu_t *emu, uintptr_t fnc); +void uEv_32(x64emu_t *emu, uintptr_t fnc); +void uFv_32(x64emu_t *emu, uintptr_t fnc); +void uEi_32(x64emu_t *emu, uintptr_t fnc); +void uFi_32(x64emu_t *emu, uintptr_t fnc); +void uEu_32(x64emu_t *emu, uintptr_t fnc); +void uFu_32(x64emu_t *emu, uintptr_t fnc); +void uEU_32(x64emu_t *emu, uintptr_t fnc); +void uEp_32(x64emu_t *emu, uintptr_t fnc); +void uFp_32(x64emu_t *emu, uintptr_t fnc); +void uES_32(x64emu_t *emu, uintptr_t fnc); +void uFX_32(x64emu_t *emu, uintptr_t fnc); +void uFn_32(x64emu_t *emu, uintptr_t fnc); +void UFv_32(x64emu_t *emu, uintptr_t fnc); +void UFi_32(x64emu_t *emu, uintptr_t fnc); +void UFu_32(x64emu_t *emu, uintptr_t fnc); +void UEp_32(x64emu_t *emu, uintptr_t fnc); +void UFp_32(x64emu_t *emu, uintptr_t fnc); +void UEs_32(x64emu_t *emu, uintptr_t fnc); +void fFi_32(x64emu_t *emu, uintptr_t fnc); +void fEf_32(x64emu_t *emu, uintptr_t fnc); +void fFf_32(x64emu_t *emu, uintptr_t fnc); +void dEv_32(x64emu_t *emu, uintptr_t fnc); +void dFi_32(x64emu_t *emu, uintptr_t fnc); +void dEd_32(x64emu_t *emu, uintptr_t fnc); +void dFd_32(x64emu_t *emu, uintptr_t fnc); +void dEp_32(x64emu_t *emu, uintptr_t fnc); +void dFp_32(x64emu_t *emu, uintptr_t fnc); +void lEv_32(x64emu_t *emu, uintptr_t fnc); +void lFu_32(x64emu_t *emu, uintptr_t fnc); +void lEl_32(x64emu_t *emu, uintptr_t fnc); +void lFl_32(x64emu_t *emu, uintptr_t fnc); +void lEp_32(x64emu_t *emu, uintptr_t fnc); +void lFp_32(x64emu_t *emu, uintptr_t fnc); +void lES_32(x64emu_t *emu, uintptr_t fnc); +void lFX_32(x64emu_t *emu, uintptr_t fnc); +void LEv_32(x64emu_t *emu, uintptr_t fnc); +void LFv_32(x64emu_t *emu, uintptr_t fnc); +void LFi_32(x64emu_t *emu, uintptr_t fnc); +void LFu_32(x64emu_t *emu, uintptr_t fnc); +void LEL_32(x64emu_t *emu, uintptr_t fnc); +void LEp_32(x64emu_t *emu, uintptr_t fnc); +void LFp_32(x64emu_t *emu, uintptr_t fnc); +void LFX_32(x64emu_t *emu, uintptr_t fnc); +void pEv_32(x64emu_t *emu, uintptr_t fnc); +void pFv_32(x64emu_t *emu, uintptr_t fnc); +void pEi_32(x64emu_t *emu, uintptr_t fnc); +void pFi_32(x64emu_t *emu, uintptr_t fnc); +void pFI_32(x64emu_t *emu, uintptr_t fnc); +void pFW_32(x64emu_t *emu, uintptr_t fnc); +void pFu_32(x64emu_t *emu, uintptr_t fnc); +void pEu_32(x64emu_t *emu, uintptr_t fnc); +void pFU_32(x64emu_t *emu, uintptr_t fnc); +void pEl_32(x64emu_t *emu, uintptr_t fnc); +void pFl_32(x64emu_t *emu, uintptr_t fnc); +void pEL_32(x64emu_t *emu, uintptr_t fnc); +void pFL_32(x64emu_t *emu, uintptr_t fnc); +void pEp_32(x64emu_t *emu, uintptr_t fnc); +void pFp_32(x64emu_t *emu, uintptr_t fnc); +void pFX_32(x64emu_t *emu, uintptr_t fnc); +void pFn_32(x64emu_t *emu, uintptr_t fnc); +void hEv_32(x64emu_t *emu, uintptr_t fnc); +void hFv_32(x64emu_t *emu, uintptr_t fnc); +void aEa_32(x64emu_t *emu, uintptr_t fnc); +void tEv_32(x64emu_t *emu, uintptr_t fnc); +void tEi_32(x64emu_t *emu, uintptr_t fnc); +void tEu_32(x64emu_t *emu, uintptr_t fnc); +void tEp_32(x64emu_t *emu, uintptr_t fnc); +void tFp_32(x64emu_t *emu, uintptr_t fnc); +void XFv_32(x64emu_t *emu, uintptr_t fnc); +void XFp_32(x64emu_t *emu, uintptr_t fnc); +void vFbp__32(x64emu_t *emu, uintptr_t fnc); +void iFbp__32(x64emu_t *emu, uintptr_t fnc); +void iFBp__32(x64emu_t *emu, uintptr_t fnc); +void LEBL__32(x64emu_t *emu, uintptr_t fnc); +void pErl__32(x64emu_t *emu, uintptr_t fnc); +void pFbp__32(x64emu_t *emu, uintptr_t fnc); +void iFbpu__32(x64emu_t *emu, uintptr_t fnc); +void IFbpu__32(x64emu_t *emu, uintptr_t fnc); +void lFrll__32(x64emu_t *emu, uintptr_t fnc); +void vFbpii__32(x64emu_t *emu, uintptr_t fnc); +void vFbLdd__32(x64emu_t *emu, uintptr_t fnc); +void vFbupi__32(x64emu_t *emu, uintptr_t fnc); +void iErLWww__32(x64emu_t *emu, uintptr_t fnc); +void iEBllll__32(x64emu_t *emu, uintptr_t fnc); +void iFbppuii__32(x64emu_t *emu, uintptr_t fnc); +void uFbppuii__32(x64emu_t *emu, uintptr_t fnc); +void pFbppuii__32(x64emu_t *emu, uintptr_t fnc); +void vFbuuipWCCp__32(x64emu_t *emu, uintptr_t fnc); +void vFbppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void uFbppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void vFbWWpWpWpWp__32(x64emu_t *emu, uintptr_t fnc); +void LEbiiiiiiiiilt__32(x64emu_t *emu, uintptr_t fnc); +void pEriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fnc); +void iFbppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fnc); +void uFbppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fnc); +void pFbppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fnc); +void vEEv_32(x64emu_t *emu, uintptr_t fnc); +void vFEv_32(x64emu_t *emu, uintptr_t fnc); +void vFEi_32(x64emu_t *emu, uintptr_t fnc); +void vEEp_32(x64emu_t *emu, uintptr_t fnc); +void vFEp_32(x64emu_t *emu, uintptr_t fnc); +void vFEX_32(x64emu_t *emu, uintptr_t fnc); +void vFcc_32(x64emu_t *emu, uintptr_t fnc); +void vFww_32(x64emu_t *emu, uintptr_t fnc); +void vFii_32(x64emu_t *emu, uintptr_t fnc); +void vFiI_32(x64emu_t *emu, uintptr_t fnc); +void vFiW_32(x64emu_t *emu, uintptr_t fnc); +void vFiu_32(x64emu_t *emu, uintptr_t fnc); +void vFiU_32(x64emu_t *emu, uintptr_t fnc); +void vFif_32(x64emu_t *emu, uintptr_t fnc); +void vFid_32(x64emu_t *emu, uintptr_t fnc); +void vFip_32(x64emu_t *emu, uintptr_t fnc); +void vFWW_32(x64emu_t *emu, uintptr_t fnc); +void vFWu_32(x64emu_t *emu, uintptr_t fnc); +void vFuc_32(x64emu_t *emu, uintptr_t fnc); +void vFuw_32(x64emu_t *emu, uintptr_t fnc); +void vFui_32(x64emu_t *emu, uintptr_t fnc); +void vFuI_32(x64emu_t *emu, uintptr_t fnc); +void vFuC_32(x64emu_t *emu, uintptr_t fnc); +void vFuW_32(x64emu_t *emu, uintptr_t fnc); +void vFuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuU_32(x64emu_t *emu, uintptr_t fnc); +void vFuf_32(x64emu_t *emu, uintptr_t fnc); +void vFud_32(x64emu_t *emu, uintptr_t fnc); +void vFul_32(x64emu_t *emu, uintptr_t fnc); +void vFup_32(x64emu_t *emu, uintptr_t fnc); +void vFUu_32(x64emu_t *emu, uintptr_t fnc); +void vFfC_32(x64emu_t *emu, uintptr_t fnc); +void vFff_32(x64emu_t *emu, uintptr_t fnc); +void vFdd_32(x64emu_t *emu, uintptr_t fnc); +void vFlu_32(x64emu_t *emu, uintptr_t fnc); +void vFlp_32(x64emu_t *emu, uintptr_t fnc); +void vEpi_32(x64emu_t *emu, uintptr_t fnc); +void vFpi_32(x64emu_t *emu, uintptr_t fnc); +void vFpC_32(x64emu_t *emu, uintptr_t fnc); +void vFpu_32(x64emu_t *emu, uintptr_t fnc); +void vFpd_32(x64emu_t *emu, uintptr_t fnc); +void vFpl_32(x64emu_t *emu, uintptr_t fnc); +void vEpL_32(x64emu_t *emu, uintptr_t fnc); +void vFpL_32(x64emu_t *emu, uintptr_t fnc); +void vEpp_32(x64emu_t *emu, uintptr_t fnc); +void vFpp_32(x64emu_t *emu, uintptr_t fnc); +void vESp_32(x64emu_t *emu, uintptr_t fnc); +void vFXi_32(x64emu_t *emu, uintptr_t fnc); +void vFXu_32(x64emu_t *emu, uintptr_t fnc); +void vFXL_32(x64emu_t *emu, uintptr_t fnc); +void vFXp_32(x64emu_t *emu, uintptr_t fnc); +void vFni_32(x64emu_t *emu, uintptr_t fnc); +void vFnu_32(x64emu_t *emu, uintptr_t fnc); +void vFnU_32(x64emu_t *emu, uintptr_t fnc); +void vFnp_32(x64emu_t *emu, uintptr_t fnc); +void cFpp_32(x64emu_t *emu, uintptr_t fnc); +void wFpi_32(x64emu_t *emu, uintptr_t fnc); +void iEEv_32(x64emu_t *emu, uintptr_t fnc); +void iFEv_32(x64emu_t *emu, uintptr_t fnc); +void iEEi_32(x64emu_t *emu, uintptr_t fnc); +void iFEi_32(x64emu_t *emu, uintptr_t fnc); +void iEEL_32(x64emu_t *emu, uintptr_t fnc); +void iEEp_32(x64emu_t *emu, uintptr_t fnc); +void iFEp_32(x64emu_t *emu, uintptr_t fnc); +void iEEh_32(x64emu_t *emu, uintptr_t fnc); +void iEEO_32(x64emu_t *emu, uintptr_t fnc); +void iFEX_32(x64emu_t *emu, uintptr_t fnc); +void iEii_32(x64emu_t *emu, uintptr_t fnc); +void iFii_32(x64emu_t *emu, uintptr_t fnc); +void iEiI_32(x64emu_t *emu, uintptr_t fnc); +void iEiu_32(x64emu_t *emu, uintptr_t fnc); +void iFiu_32(x64emu_t *emu, uintptr_t fnc); +void iEil_32(x64emu_t *emu, uintptr_t fnc); +void iFiL_32(x64emu_t *emu, uintptr_t fnc); +void iEip_32(x64emu_t *emu, uintptr_t fnc); +void iFip_32(x64emu_t *emu, uintptr_t fnc); +void iEiS_32(x64emu_t *emu, uintptr_t fnc); +void iEui_32(x64emu_t *emu, uintptr_t fnc); +void iFui_32(x64emu_t *emu, uintptr_t fnc); +void iEuu_32(x64emu_t *emu, uintptr_t fnc); +void iEuL_32(x64emu_t *emu, uintptr_t fnc); +void iEup_32(x64emu_t *emu, uintptr_t fnc); +void iFup_32(x64emu_t *emu, uintptr_t fnc); +void iEua_32(x64emu_t *emu, uintptr_t fnc); +void iFpw_32(x64emu_t *emu, uintptr_t fnc); +void iEpi_32(x64emu_t *emu, uintptr_t fnc); +void iFpi_32(x64emu_t *emu, uintptr_t fnc); +void iFpI_32(x64emu_t *emu, uintptr_t fnc); +void iFpW_32(x64emu_t *emu, uintptr_t fnc); +void iEpu_32(x64emu_t *emu, uintptr_t fnc); +void iFpu_32(x64emu_t *emu, uintptr_t fnc); +void iFpU_32(x64emu_t *emu, uintptr_t fnc); +void iFpf_32(x64emu_t *emu, uintptr_t fnc); +void iFpd_32(x64emu_t *emu, uintptr_t fnc); +void iFpl_32(x64emu_t *emu, uintptr_t fnc); +void iEpL_32(x64emu_t *emu, uintptr_t fnc); +void iFpL_32(x64emu_t *emu, uintptr_t fnc); +void iEpp_32(x64emu_t *emu, uintptr_t fnc); +void iFpp_32(x64emu_t *emu, uintptr_t fnc); +void iEpV_32(x64emu_t *emu, uintptr_t fnc); +void iEpO_32(x64emu_t *emu, uintptr_t fnc); +void iEpS_32(x64emu_t *emu, uintptr_t fnc); +void iFpS_32(x64emu_t *emu, uintptr_t fnc); +void iEhi_32(x64emu_t *emu, uintptr_t fnc); +void iEhp_32(x64emu_t *emu, uintptr_t fnc); +void iEhh_32(x64emu_t *emu, uintptr_t fnc); +void iESi_32(x64emu_t *emu, uintptr_t fnc); +void iESU_32(x64emu_t *emu, uintptr_t fnc); +void iESp_32(x64emu_t *emu, uintptr_t fnc); +void iFXi_32(x64emu_t *emu, uintptr_t fnc); +void iFXW_32(x64emu_t *emu, uintptr_t fnc); +void iFXL_32(x64emu_t *emu, uintptr_t fnc); +void iFXp_32(x64emu_t *emu, uintptr_t fnc); +void IFEp_32(x64emu_t *emu, uintptr_t fnc); +void IEII_32(x64emu_t *emu, uintptr_t fnc); +void IFpI_32(x64emu_t *emu, uintptr_t fnc); +void IFpu_32(x64emu_t *emu, uintptr_t fnc); +void CFip_32(x64emu_t *emu, uintptr_t fnc); +void CFCi_32(x64emu_t *emu, uintptr_t fnc); +void CFui_32(x64emu_t *emu, uintptr_t fnc); +void CFuu_32(x64emu_t *emu, uintptr_t fnc); +void CFuU_32(x64emu_t *emu, uintptr_t fnc); +void CFpi_32(x64emu_t *emu, uintptr_t fnc); +void CFpu_32(x64emu_t *emu, uintptr_t fnc); +void CFpp_32(x64emu_t *emu, uintptr_t fnc); +void CFXL_32(x64emu_t *emu, uintptr_t fnc); +void WFEp_32(x64emu_t *emu, uintptr_t fnc); +void WFpp_32(x64emu_t *emu, uintptr_t fnc); +void uFEp_32(x64emu_t *emu, uintptr_t fnc); +void uFii_32(x64emu_t *emu, uintptr_t fnc); +void uEiS_32(x64emu_t *emu, uintptr_t fnc); +void uFWp_32(x64emu_t *emu, uintptr_t fnc); +void uFuu_32(x64emu_t *emu, uintptr_t fnc); +void uFup_32(x64emu_t *emu, uintptr_t fnc); +void uEua_32(x64emu_t *emu, uintptr_t fnc); +void uEuS_32(x64emu_t *emu, uintptr_t fnc); +void uFpi_32(x64emu_t *emu, uintptr_t fnc); +void uFpu_32(x64emu_t *emu, uintptr_t fnc); +void uFpp_32(x64emu_t *emu, uintptr_t fnc); +void uFXL_32(x64emu_t *emu, uintptr_t fnc); +void UFEp_32(x64emu_t *emu, uintptr_t fnc); +void UEuu_32(x64emu_t *emu, uintptr_t fnc); +void UFuu_32(x64emu_t *emu, uintptr_t fnc); +void UEUU_32(x64emu_t *emu, uintptr_t fnc); +void UEss_32(x64emu_t *emu, uintptr_t fnc); +void fEif_32(x64emu_t *emu, uintptr_t fnc); +void fFfi_32(x64emu_t *emu, uintptr_t fnc); +void fEfi_32(x64emu_t *emu, uintptr_t fnc); +void fEff_32(x64emu_t *emu, uintptr_t fnc); +void fFff_32(x64emu_t *emu, uintptr_t fnc); +void fEfD_32(x64emu_t *emu, uintptr_t fnc); +void fEfp_32(x64emu_t *emu, uintptr_t fnc); +void dEid_32(x64emu_t *emu, uintptr_t fnc); +void dFdi_32(x64emu_t *emu, uintptr_t fnc); +void dEdi_32(x64emu_t *emu, uintptr_t fnc); +void dEdd_32(x64emu_t *emu, uintptr_t fnc); +void dFdd_32(x64emu_t *emu, uintptr_t fnc); +void dEdD_32(x64emu_t *emu, uintptr_t fnc); +void dFdp_32(x64emu_t *emu, uintptr_t fnc); +void dEdp_32(x64emu_t *emu, uintptr_t fnc); +void dEll_32(x64emu_t *emu, uintptr_t fnc); +void dFpp_32(x64emu_t *emu, uintptr_t fnc); +void lEEi_32(x64emu_t *emu, uintptr_t fnc); +void lEES_32(x64emu_t *emu, uintptr_t fnc); +void lEii_32(x64emu_t *emu, uintptr_t fnc); +void lFiL_32(x64emu_t *emu, uintptr_t fnc); +void lFui_32(x64emu_t *emu, uintptr_t fnc); +void lFll_32(x64emu_t *emu, uintptr_t fnc); +void lEpi_32(x64emu_t *emu, uintptr_t fnc); +void lFpu_32(x64emu_t *emu, uintptr_t fnc); +void lFpl_32(x64emu_t *emu, uintptr_t fnc); +void lFpL_32(x64emu_t *emu, uintptr_t fnc); +void LEEL_32(x64emu_t *emu, uintptr_t fnc); +void LFEp_32(x64emu_t *emu, uintptr_t fnc); +void LFLi_32(x64emu_t *emu, uintptr_t fnc); +void LFpc_32(x64emu_t *emu, uintptr_t fnc); +void LEpL_32(x64emu_t *emu, uintptr_t fnc); +void LEpp_32(x64emu_t *emu, uintptr_t fnc); +void LFXi_32(x64emu_t *emu, uintptr_t fnc); +void LFXu_32(x64emu_t *emu, uintptr_t fnc); +void LFXU_32(x64emu_t *emu, uintptr_t fnc); +void LFXL_32(x64emu_t *emu, uintptr_t fnc); +void LFXp_32(x64emu_t *emu, uintptr_t fnc); +void pFEv_32(x64emu_t *emu, uintptr_t fnc); +void pEEv_32(x64emu_t *emu, uintptr_t fnc); +void pFEi_32(x64emu_t *emu, uintptr_t fnc); +void pEEu_32(x64emu_t *emu, uintptr_t fnc); +void pFEp_32(x64emu_t *emu, uintptr_t fnc); +void pEEp_32(x64emu_t *emu, uintptr_t fnc); +void pEES_32(x64emu_t *emu, uintptr_t fnc); +void pFEX_32(x64emu_t *emu, uintptr_t fnc); +void pFii_32(x64emu_t *emu, uintptr_t fnc); +void pFiu_32(x64emu_t *emu, uintptr_t fnc); +void pFip_32(x64emu_t *emu, uintptr_t fnc); +void pEia_32(x64emu_t *emu, uintptr_t fnc); +void pFWu_32(x64emu_t *emu, uintptr_t fnc); +void pFuu_32(x64emu_t *emu, uintptr_t fnc); +void pEup_32(x64emu_t *emu, uintptr_t fnc); +void pFup_32(x64emu_t *emu, uintptr_t fnc); +void pELL_32(x64emu_t *emu, uintptr_t fnc); +void pFLL_32(x64emu_t *emu, uintptr_t fnc); +void pEpi_32(x64emu_t *emu, uintptr_t fnc); +void pFpi_32(x64emu_t *emu, uintptr_t fnc); +void pFpu_32(x64emu_t *emu, uintptr_t fnc); +void pFpU_32(x64emu_t *emu, uintptr_t fnc); +void pEpL_32(x64emu_t *emu, uintptr_t fnc); +void pFpL_32(x64emu_t *emu, uintptr_t fnc); +void pEpp_32(x64emu_t *emu, uintptr_t fnc); +void pFpp_32(x64emu_t *emu, uintptr_t fnc); +void pFXi_32(x64emu_t *emu, uintptr_t fnc); +void pFXu_32(x64emu_t *emu, uintptr_t fnc); +void pFXL_32(x64emu_t *emu, uintptr_t fnc); +void pFXp_32(x64emu_t *emu, uintptr_t fnc); +void pFnu_32(x64emu_t *emu, uintptr_t fnc); +void pFnp_32(x64emu_t *emu, uintptr_t fnc); +void hFEp_32(x64emu_t *emu, uintptr_t fnc); +void hEpa_32(x64emu_t *emu, uintptr_t fnc); +void SEip_32(x64emu_t *emu, uintptr_t fnc); +void SEpp_32(x64emu_t *emu, uintptr_t fnc); +void tEip_32(x64emu_t *emu, uintptr_t fnc); +void tEia_32(x64emu_t *emu, uintptr_t fnc); +void tFuu_32(x64emu_t *emu, uintptr_t fnc); +void tEpL_32(x64emu_t *emu, uintptr_t fnc); +void tEpp_32(x64emu_t *emu, uintptr_t fnc); +void vFuBp__32(x64emu_t *emu, uintptr_t fnc); +void vFpbp__32(x64emu_t *emu, uintptr_t fnc); +void vFbp_p_32(x64emu_t *emu, uintptr_t fnc); +void iEEbp__32(x64emu_t *emu, uintptr_t fnc); +void iFibp__32(x64emu_t *emu, uintptr_t fnc); +void iFLbp__32(x64emu_t *emu, uintptr_t fnc); +void iFpbp__32(x64emu_t *emu, uintptr_t fnc); +void iFpbl__32(x64emu_t *emu, uintptr_t fnc); +void iFpBL__32(x64emu_t *emu, uintptr_t fnc); +void iFpbL__32(x64emu_t *emu, uintptr_t fnc); +void iEHBp__32(x64emu_t *emu, uintptr_t fnc); +void iFbp_i_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_u_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_p_32(x64emu_t *emu, uintptr_t fnc); +void iFXbL__32(x64emu_t *emu, uintptr_t fnc); +void uFpbp__32(x64emu_t *emu, uintptr_t fnc); +void uFpbL__32(x64emu_t *emu, uintptr_t fnc); +void fEpBp__32(x64emu_t *emu, uintptr_t fnc); +void dEpBp__32(x64emu_t *emu, uintptr_t fnc); +void lFpbp__32(x64emu_t *emu, uintptr_t fnc); +void LFpbp__32(x64emu_t *emu, uintptr_t fnc); +void LFpbL__32(x64emu_t *emu, uintptr_t fnc); +void pFpbp__32(x64emu_t *emu, uintptr_t fnc); +void pErl_p_32(x64emu_t *emu, uintptr_t fnc); +void vFibpp__32(x64emu_t *emu, uintptr_t fnc); +void vFpbpu__32(x64emu_t *emu, uintptr_t fnc); +void vFBll_l_32(x64emu_t *emu, uintptr_t fnc); +void vFnbpi__32(x64emu_t *emu, uintptr_t fnc); +void iEuBLL__32(x64emu_t *emu, uintptr_t fnc); +void iEprll__32(x64emu_t *emu, uintptr_t fnc); +void iEpbup__32(x64emu_t *emu, uintptr_t fnc); +void iEprLL__32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu__32(x64emu_t *emu, uintptr_t fnc); +void iFbpi_i_32(x64emu_t *emu, uintptr_t fnc); +void iFbpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iEBll_p_32(x64emu_t *emu, uintptr_t fnc); +void iFXbip__32(x64emu_t *emu, uintptr_t fnc); +void uFpbpu__32(x64emu_t *emu, uintptr_t fnc); +void pFnbpi__32(x64emu_t *emu, uintptr_t fnc); +void vFpbupi__32(x64emu_t *emu, uintptr_t fnc); +void iEpBlii__32(x64emu_t *emu, uintptr_t fnc); +void iESBliu__32(x64emu_t *emu, uintptr_t fnc); +void iFbppi_i_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_bp__32(x64emu_t *emu, uintptr_t fnc); +void iFXbiip__32(x64emu_t *emu, uintptr_t fnc); +void vFbppuii_p_32(x64emu_t *emu, uintptr_t fnc); +void iErLL_BLL__32(x64emu_t *emu, uintptr_t fnc); +void iFbpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void pErppppii_p_32(x64emu_t *emu, uintptr_t fnc); +void vFbll_rllll__32(x64emu_t *emu, uintptr_t fnc); +void iEbpppiiip_p_32(x64emu_t *emu, uintptr_t fnc); +void iFXbiiuuLip__32(x64emu_t *emu, uintptr_t fnc); +void iFpruuipWCCp__32(x64emu_t *emu, uintptr_t fnc); +void uFpbppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void uFbppuuuuup_p_32(x64emu_t *emu, uintptr_t fnc); +void pFubppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void pFpbppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void vFbppuii_bppuii__32(x64emu_t *emu, uintptr_t fnc); +void lEEriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fnc); +void pEriiiiiiiiilt_p_32(x64emu_t *emu, uintptr_t fnc); +void LFXrLiiwwwwwwwwL__32(x64emu_t *emu, uintptr_t fnc); +void vFpbppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fnc); +void vFbppuiiiiiiiiipp_p_32(x64emu_t *emu, uintptr_t fnc); +void uFpbppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fnc); +void vFbppuuuuup_bppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void iEiBLLLLLLLLLLLLLLLLLL__32(x64emu_t *emu, uintptr_t fnc); +void iEiBUUUULLLLLLLLLLLLLL__32(x64emu_t *emu, uintptr_t fnc); +void vFbppuiiiiiiiiipp_bppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fnc); +void uFbppuiiiiiiiiipp_bppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fnc); +void vEEip_32(x64emu_t *emu, uintptr_t fnc); +void vFEip_32(x64emu_t *emu, uintptr_t fnc); +void vEEpi_32(x64emu_t *emu, uintptr_t fnc); +void vEEpu_32(x64emu_t *emu, uintptr_t fnc); +void vFEpp_32(x64emu_t *emu, uintptr_t fnc); +void vFEpV_32(x64emu_t *emu, uintptr_t fnc); +void vFEXp_32(x64emu_t *emu, uintptr_t fnc); +void vFccc_32(x64emu_t *emu, uintptr_t fnc); +void vFwww_32(x64emu_t *emu, uintptr_t fnc); +void vFiii_32(x64emu_t *emu, uintptr_t fnc); +void vFiif_32(x64emu_t *emu, uintptr_t fnc); +void vFiip_32(x64emu_t *emu, uintptr_t fnc); +void vFiII_32(x64emu_t *emu, uintptr_t fnc); +void vFiui_32(x64emu_t *emu, uintptr_t fnc); +void vFiuu_32(x64emu_t *emu, uintptr_t fnc); +void vFiup_32(x64emu_t *emu, uintptr_t fnc); +void vFiUU_32(x64emu_t *emu, uintptr_t fnc); +void vFiff_32(x64emu_t *emu, uintptr_t fnc); +void vFidd_32(x64emu_t *emu, uintptr_t fnc); +void vFilu_32(x64emu_t *emu, uintptr_t fnc); +void vFill_32(x64emu_t *emu, uintptr_t fnc); +void vFilp_32(x64emu_t *emu, uintptr_t fnc); +void vFipu_32(x64emu_t *emu, uintptr_t fnc); +void vFipp_32(x64emu_t *emu, uintptr_t fnc); +void vFCCC_32(x64emu_t *emu, uintptr_t fnc); +void vFWWW_32(x64emu_t *emu, uintptr_t fnc); +void vFucc_32(x64emu_t *emu, uintptr_t fnc); +void vFuww_32(x64emu_t *emu, uintptr_t fnc); +void vFuii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiI_32(x64emu_t *emu, uintptr_t fnc); +void vFuiu_32(x64emu_t *emu, uintptr_t fnc); +void vFuiU_32(x64emu_t *emu, uintptr_t fnc); +void vFuif_32(x64emu_t *emu, uintptr_t fnc); +void vFuid_32(x64emu_t *emu, uintptr_t fnc); +void vFuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuII_32(x64emu_t *emu, uintptr_t fnc); +void vFuWW_32(x64emu_t *emu, uintptr_t fnc); +void vFuui_32(x64emu_t *emu, uintptr_t fnc); +void vFuuC_32(x64emu_t *emu, uintptr_t fnc); +void vFuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuU_32(x64emu_t *emu, uintptr_t fnc); +void vFuuf_32(x64emu_t *emu, uintptr_t fnc); +void vFuud_32(x64emu_t *emu, uintptr_t fnc); +void vFuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuUU_32(x64emu_t *emu, uintptr_t fnc); +void vFuff_32(x64emu_t *emu, uintptr_t fnc); +void vFudd_32(x64emu_t *emu, uintptr_t fnc); +void vFull_32(x64emu_t *emu, uintptr_t fnc); +void vFulp_32(x64emu_t *emu, uintptr_t fnc); +void vFupp_32(x64emu_t *emu, uintptr_t fnc); +void vFfff_32(x64emu_t *emu, uintptr_t fnc); +void vEfpp_32(x64emu_t *emu, uintptr_t fnc); +void vFddd_32(x64emu_t *emu, uintptr_t fnc); +void vEdpp_32(x64emu_t *emu, uintptr_t fnc); +void vFlii_32(x64emu_t *emu, uintptr_t fnc); +void vFlip_32(x64emu_t *emu, uintptr_t fnc); +void vFllp_32(x64emu_t *emu, uintptr_t fnc); +void vFlpp_32(x64emu_t *emu, uintptr_t fnc); +void vEpii_32(x64emu_t *emu, uintptr_t fnc); +void vFpii_32(x64emu_t *emu, uintptr_t fnc); +void vFpiL_32(x64emu_t *emu, uintptr_t fnc); +void vFpip_32(x64emu_t *emu, uintptr_t fnc); +void vFpui_32(x64emu_t *emu, uintptr_t fnc); +void vFpuI_32(x64emu_t *emu, uintptr_t fnc); +void vFpuC_32(x64emu_t *emu, uintptr_t fnc); +void vFpuu_32(x64emu_t *emu, uintptr_t fnc); +void vFpuU_32(x64emu_t *emu, uintptr_t fnc); +void vFpuf_32(x64emu_t *emu, uintptr_t fnc); +void vFpud_32(x64emu_t *emu, uintptr_t fnc); +void vFpul_32(x64emu_t *emu, uintptr_t fnc); +void vFpup_32(x64emu_t *emu, uintptr_t fnc); +void vFpdd_32(x64emu_t *emu, uintptr_t fnc); +void vFplp_32(x64emu_t *emu, uintptr_t fnc); +void vFppi_32(x64emu_t *emu, uintptr_t fnc); +void vEppu_32(x64emu_t *emu, uintptr_t fnc); +void vFppu_32(x64emu_t *emu, uintptr_t fnc); +void vFppL_32(x64emu_t *emu, uintptr_t fnc); +void vFppp_32(x64emu_t *emu, uintptr_t fnc); +void vFXiL_32(x64emu_t *emu, uintptr_t fnc); +void vFXLi_32(x64emu_t *emu, uintptr_t fnc); +void vFXLL_32(x64emu_t *emu, uintptr_t fnc); +void vFXLp_32(x64emu_t *emu, uintptr_t fnc); +void vFXpi_32(x64emu_t *emu, uintptr_t fnc); +void vFXpl_32(x64emu_t *emu, uintptr_t fnc); +void vFXpL_32(x64emu_t *emu, uintptr_t fnc); +void vFXpp_32(x64emu_t *emu, uintptr_t fnc); +void iFEip_32(x64emu_t *emu, uintptr_t fnc); +void iEEip_32(x64emu_t *emu, uintptr_t fnc); +void iEEup_32(x64emu_t *emu, uintptr_t fnc); +void iFEup_32(x64emu_t *emu, uintptr_t fnc); +void iEEpi_32(x64emu_t *emu, uintptr_t fnc); +void iFEpi_32(x64emu_t *emu, uintptr_t fnc); +void iFEpu_32(x64emu_t *emu, uintptr_t fnc); +void iFEpl_32(x64emu_t *emu, uintptr_t fnc); +void iEEpL_32(x64emu_t *emu, uintptr_t fnc); +void iFEpL_32(x64emu_t *emu, uintptr_t fnc); +void iEEpp_32(x64emu_t *emu, uintptr_t fnc); +void iFEpp_32(x64emu_t *emu, uintptr_t fnc); +void iEEpV_32(x64emu_t *emu, uintptr_t fnc); +void iFEpX_32(x64emu_t *emu, uintptr_t fnc); +void iEEhi_32(x64emu_t *emu, uintptr_t fnc); +void iEEhp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXp_32(x64emu_t *emu, uintptr_t fnc); +void iEiii_32(x64emu_t *emu, uintptr_t fnc); +void iEiiI_32(x64emu_t *emu, uintptr_t fnc); +void iFiiu_32(x64emu_t *emu, uintptr_t fnc); +void iEiil_32(x64emu_t *emu, uintptr_t fnc); +void iEiip_32(x64emu_t *emu, uintptr_t fnc); +void iFiip_32(x64emu_t *emu, uintptr_t fnc); +void iEiiO_32(x64emu_t *emu, uintptr_t fnc); +void iEiiN_32(x64emu_t *emu, uintptr_t fnc); +void iEiII_32(x64emu_t *emu, uintptr_t fnc); +void iFiui_32(x64emu_t *emu, uintptr_t fnc); +void iEiuu_32(x64emu_t *emu, uintptr_t fnc); +void iFiuu_32(x64emu_t *emu, uintptr_t fnc); +void iFiuL_32(x64emu_t *emu, uintptr_t fnc); +void iEiup_32(x64emu_t *emu, uintptr_t fnc); +void iFiup_32(x64emu_t *emu, uintptr_t fnc); +void iFiUU_32(x64emu_t *emu, uintptr_t fnc); +void iFiUp_32(x64emu_t *emu, uintptr_t fnc); +void iFidd_32(x64emu_t *emu, uintptr_t fnc); +void iEill_32(x64emu_t *emu, uintptr_t fnc); +void iEiLi_32(x64emu_t *emu, uintptr_t fnc); +void iEiLp_32(x64emu_t *emu, uintptr_t fnc); +void iFiLp_32(x64emu_t *emu, uintptr_t fnc); +void iFipi_32(x64emu_t *emu, uintptr_t fnc); +void iEipi_32(x64emu_t *emu, uintptr_t fnc); +void iEipu_32(x64emu_t *emu, uintptr_t fnc); +void iFipu_32(x64emu_t *emu, uintptr_t fnc); +void iEipL_32(x64emu_t *emu, uintptr_t fnc); +void iEipp_32(x64emu_t *emu, uintptr_t fnc); +void iFipp_32(x64emu_t *emu, uintptr_t fnc); +void iEipO_32(x64emu_t *emu, uintptr_t fnc); +void iFuip_32(x64emu_t *emu, uintptr_t fnc); +void iEuui_32(x64emu_t *emu, uintptr_t fnc); +void iEuuu_32(x64emu_t *emu, uintptr_t fnc); +void iFuup_32(x64emu_t *emu, uintptr_t fnc); +void iEuLa_32(x64emu_t *emu, uintptr_t fnc); +void iFupL_32(x64emu_t *emu, uintptr_t fnc); +void iFUip_32(x64emu_t *emu, uintptr_t fnc); +void iFfff_32(x64emu_t *emu, uintptr_t fnc); +void iELLi_32(x64emu_t *emu, uintptr_t fnc); +void iFpii_32(x64emu_t *emu, uintptr_t fnc); +void iEpiu_32(x64emu_t *emu, uintptr_t fnc); +void iFpiu_32(x64emu_t *emu, uintptr_t fnc); +void iFpil_32(x64emu_t *emu, uintptr_t fnc); +void iEpip_32(x64emu_t *emu, uintptr_t fnc); +void iFpip_32(x64emu_t *emu, uintptr_t fnc); +void iFpII_32(x64emu_t *emu, uintptr_t fnc); +void iFpWp_32(x64emu_t *emu, uintptr_t fnc); +void iFpui_32(x64emu_t *emu, uintptr_t fnc); +void iFpuC_32(x64emu_t *emu, uintptr_t fnc); +void iEpuu_32(x64emu_t *emu, uintptr_t fnc); +void iFpuu_32(x64emu_t *emu, uintptr_t fnc); +void iFpuU_32(x64emu_t *emu, uintptr_t fnc); +void iFpup_32(x64emu_t *emu, uintptr_t fnc); +void iFpUU_32(x64emu_t *emu, uintptr_t fnc); +void iFpfu_32(x64emu_t *emu, uintptr_t fnc); +void iFpff_32(x64emu_t *emu, uintptr_t fnc); +void iFpdd_32(x64emu_t *emu, uintptr_t fnc); +void iFpli_32(x64emu_t *emu, uintptr_t fnc); +void iFpll_32(x64emu_t *emu, uintptr_t fnc); +void iEpLi_32(x64emu_t *emu, uintptr_t fnc); +void iEpLu_32(x64emu_t *emu, uintptr_t fnc); +void iEpLp_32(x64emu_t *emu, uintptr_t fnc); +void iFpLp_32(x64emu_t *emu, uintptr_t fnc); +void iEppi_32(x64emu_t *emu, uintptr_t fnc); +void iFppi_32(x64emu_t *emu, uintptr_t fnc); +void iFppI_32(x64emu_t *emu, uintptr_t fnc); +void iEppu_32(x64emu_t *emu, uintptr_t fnc); +void iFppu_32(x64emu_t *emu, uintptr_t fnc); +void iFppU_32(x64emu_t *emu, uintptr_t fnc); +void iFppd_32(x64emu_t *emu, uintptr_t fnc); +void iEppL_32(x64emu_t *emu, uintptr_t fnc); +void iFppL_32(x64emu_t *emu, uintptr_t fnc); +void iEppp_32(x64emu_t *emu, uintptr_t fnc); +void iFppp_32(x64emu_t *emu, uintptr_t fnc); +void iEppa_32(x64emu_t *emu, uintptr_t fnc); +void iEpOu_32(x64emu_t *emu, uintptr_t fnc); +void iFpSp_32(x64emu_t *emu, uintptr_t fnc); +void iEhip_32(x64emu_t *emu, uintptr_t fnc); +void iEhpL_32(x64emu_t *emu, uintptr_t fnc); +void iEhpp_32(x64emu_t *emu, uintptr_t fnc); +void iESIi_32(x64emu_t *emu, uintptr_t fnc); +void iESli_32(x64emu_t *emu, uintptr_t fnc); +void iFXii_32(x64emu_t *emu, uintptr_t fnc); +void iFXiL_32(x64emu_t *emu, uintptr_t fnc); +void iFXip_32(x64emu_t *emu, uintptr_t fnc); +void iFXuu_32(x64emu_t *emu, uintptr_t fnc); +void iFXup_32(x64emu_t *emu, uintptr_t fnc); +void iFXLi_32(x64emu_t *emu, uintptr_t fnc); +void iFXLu_32(x64emu_t *emu, uintptr_t fnc); +void iFXLU_32(x64emu_t *emu, uintptr_t fnc); +void iFXLf_32(x64emu_t *emu, uintptr_t fnc); +void iFXLl_32(x64emu_t *emu, uintptr_t fnc); +void iFXLL_32(x64emu_t *emu, uintptr_t fnc); +void iFXLp_32(x64emu_t *emu, uintptr_t fnc); +void iFXpi_32(x64emu_t *emu, uintptr_t fnc); +void iFXpu_32(x64emu_t *emu, uintptr_t fnc); +void iFXpl_32(x64emu_t *emu, uintptr_t fnc); +void iFXpL_32(x64emu_t *emu, uintptr_t fnc); +void iFXpp_32(x64emu_t *emu, uintptr_t fnc); +void IEiIi_32(x64emu_t *emu, uintptr_t fnc); +void IFpIi_32(x64emu_t *emu, uintptr_t fnc); +void IEppi_32(x64emu_t *emu, uintptr_t fnc); +void CFipp_32(x64emu_t *emu, uintptr_t fnc); +void CFuUu_32(x64emu_t *emu, uintptr_t fnc); +void CFuff_32(x64emu_t *emu, uintptr_t fnc); +void WFXip_32(x64emu_t *emu, uintptr_t fnc); +void uFEpW_32(x64emu_t *emu, uintptr_t fnc); +void uFEpu_32(x64emu_t *emu, uintptr_t fnc); +void uFEpU_32(x64emu_t *emu, uintptr_t fnc); +void uFEpL_32(x64emu_t *emu, uintptr_t fnc); +void uFEpp_32(x64emu_t *emu, uintptr_t fnc); +void uFilp_32(x64emu_t *emu, uintptr_t fnc); +void uFipu_32(x64emu_t *emu, uintptr_t fnc); +void uFuuu_32(x64emu_t *emu, uintptr_t fnc); +void uFuup_32(x64emu_t *emu, uintptr_t fnc); +void uFupp_32(x64emu_t *emu, uintptr_t fnc); +void uFpii_32(x64emu_t *emu, uintptr_t fnc); +void uFpip_32(x64emu_t *emu, uintptr_t fnc); +void uFpuU_32(x64emu_t *emu, uintptr_t fnc); +void uEpup_32(x64emu_t *emu, uintptr_t fnc); +void uFpup_32(x64emu_t *emu, uintptr_t fnc); +void uFppi_32(x64emu_t *emu, uintptr_t fnc); +void uFppu_32(x64emu_t *emu, uintptr_t fnc); +void uEppL_32(x64emu_t *emu, uintptr_t fnc); +void uFppL_32(x64emu_t *emu, uintptr_t fnc); +void uFppp_32(x64emu_t *emu, uintptr_t fnc); +void uFXuu_32(x64emu_t *emu, uintptr_t fnc); +void UEppi_32(x64emu_t *emu, uintptr_t fnc); +void fFuii_32(x64emu_t *emu, uintptr_t fnc); +void fEfff_32(x64emu_t *emu, uintptr_t fnc); +void fEffp_32(x64emu_t *emu, uintptr_t fnc); +void dEddd_32(x64emu_t *emu, uintptr_t fnc); +void dEddp_32(x64emu_t *emu, uintptr_t fnc); +void lEEuV_32(x64emu_t *emu, uintptr_t fnc); +void lEili_32(x64emu_t *emu, uintptr_t fnc); +void lEipi_32(x64emu_t *emu, uintptr_t fnc); +void lEipL_32(x64emu_t *emu, uintptr_t fnc); +void lFlll_32(x64emu_t *emu, uintptr_t fnc); +void lElpi_32(x64emu_t *emu, uintptr_t fnc); +void lFpLd_32(x64emu_t *emu, uintptr_t fnc); +void lFpLL_32(x64emu_t *emu, uintptr_t fnc); +void lFppi_32(x64emu_t *emu, uintptr_t fnc); +void lFppL_32(x64emu_t *emu, uintptr_t fnc); +void lFppp_32(x64emu_t *emu, uintptr_t fnc); +void LFEpi_32(x64emu_t *emu, uintptr_t fnc); +void LFEpp_32(x64emu_t *emu, uintptr_t fnc); +void LFEXp_32(x64emu_t *emu, uintptr_t fnc); +void LFpii_32(x64emu_t *emu, uintptr_t fnc); +void LEpip_32(x64emu_t *emu, uintptr_t fnc); +void LFppi_32(x64emu_t *emu, uintptr_t fnc); +void LEppL_32(x64emu_t *emu, uintptr_t fnc); +void LFppL_32(x64emu_t *emu, uintptr_t fnc); +void LFXip_32(x64emu_t *emu, uintptr_t fnc); +void LFXCi_32(x64emu_t *emu, uintptr_t fnc); +void LFXLi_32(x64emu_t *emu, uintptr_t fnc); +void LFXLC_32(x64emu_t *emu, uintptr_t fnc); +void LFXpi_32(x64emu_t *emu, uintptr_t fnc); +void LFXpp_32(x64emu_t *emu, uintptr_t fnc); +void pFEii_32(x64emu_t *emu, uintptr_t fnc); +void pFEiu_32(x64emu_t *emu, uintptr_t fnc); +void pEEip_32(x64emu_t *emu, uintptr_t fnc); +void pFEiV_32(x64emu_t *emu, uintptr_t fnc); +void pEEpi_32(x64emu_t *emu, uintptr_t fnc); +void pFEpi_32(x64emu_t *emu, uintptr_t fnc); +void pFEpu_32(x64emu_t *emu, uintptr_t fnc); +void pEEpp_32(x64emu_t *emu, uintptr_t fnc); +void pFEpp_32(x64emu_t *emu, uintptr_t fnc); +void pFEpV_32(x64emu_t *emu, uintptr_t fnc); +void pFEpX_32(x64emu_t *emu, uintptr_t fnc); +void pFEXi_32(x64emu_t *emu, uintptr_t fnc); +void pFEXL_32(x64emu_t *emu, uintptr_t fnc); +void pFEXp_32(x64emu_t *emu, uintptr_t fnc); +void pFiii_32(x64emu_t *emu, uintptr_t fnc); +void pFipp_32(x64emu_t *emu, uintptr_t fnc); +void pFIpi_32(x64emu_t *emu, uintptr_t fnc); +void pFuuu_32(x64emu_t *emu, uintptr_t fnc); +void pFulu_32(x64emu_t *emu, uintptr_t fnc); +void pFupi_32(x64emu_t *emu, uintptr_t fnc); +void pFupp_32(x64emu_t *emu, uintptr_t fnc); +void pFddd_32(x64emu_t *emu, uintptr_t fnc); +void pFLpi_32(x64emu_t *emu, uintptr_t fnc); +void pFpcU_32(x64emu_t *emu, uintptr_t fnc); +void pEpii_32(x64emu_t *emu, uintptr_t fnc); +void pFpii_32(x64emu_t *emu, uintptr_t fnc); +void pFpiu_32(x64emu_t *emu, uintptr_t fnc); +void pEpiL_32(x64emu_t *emu, uintptr_t fnc); +void pFpiL_32(x64emu_t *emu, uintptr_t fnc); +void pFpip_32(x64emu_t *emu, uintptr_t fnc); +void pEpiS_32(x64emu_t *emu, uintptr_t fnc); +void pEpII_32(x64emu_t *emu, uintptr_t fnc); +void pFpuu_32(x64emu_t *emu, uintptr_t fnc); +void pFpup_32(x64emu_t *emu, uintptr_t fnc); +void pFpUi_32(x64emu_t *emu, uintptr_t fnc); +void pFpdd_32(x64emu_t *emu, uintptr_t fnc); +void pEpLL_32(x64emu_t *emu, uintptr_t fnc); +void pFppi_32(x64emu_t *emu, uintptr_t fnc); +void pFppu_32(x64emu_t *emu, uintptr_t fnc); +void pEppL_32(x64emu_t *emu, uintptr_t fnc); +void pFppL_32(x64emu_t *emu, uintptr_t fnc); +void pFppp_32(x64emu_t *emu, uintptr_t fnc); +void pEpOM_32(x64emu_t *emu, uintptr_t fnc); +void pFXii_32(x64emu_t *emu, uintptr_t fnc); +void pFXip_32(x64emu_t *emu, uintptr_t fnc); +void pFXLp_32(x64emu_t *emu, uintptr_t fnc); +void pFXpi_32(x64emu_t *emu, uintptr_t fnc); +void pFXpp_32(x64emu_t *emu, uintptr_t fnc); +void pFnpL_32(x64emu_t *emu, uintptr_t fnc); +void aEipa_32(x64emu_t *emu, uintptr_t fnc); +void SEEpp_32(x64emu_t *emu, uintptr_t fnc); +void SEppS_32(x64emu_t *emu, uintptr_t fnc); +void tEipu_32(x64emu_t *emu, uintptr_t fnc); +void tEipL_32(x64emu_t *emu, uintptr_t fnc); +void tEppi_32(x64emu_t *emu, uintptr_t fnc); +void vFibp_i_32(x64emu_t *emu, uintptr_t fnc); +void vFuibp__32(x64emu_t *emu, uintptr_t fnc); +void vFuuBp__32(x64emu_t *emu, uintptr_t fnc); +void vFuubp__32(x64emu_t *emu, uintptr_t fnc); +void vFpbp_i_32(x64emu_t *emu, uintptr_t fnc); +void vFbp_pp_32(x64emu_t *emu, uintptr_t fnc); +void vFXLbL__32(x64emu_t *emu, uintptr_t fnc); +void vFXbL_i_32(x64emu_t *emu, uintptr_t fnc); +void iFEpBp__32(x64emu_t *emu, uintptr_t fnc); +void iFWubp__32(x64emu_t *emu, uintptr_t fnc); +void iFuubp__32(x64emu_t *emu, uintptr_t fnc); +void iFUpbp__32(x64emu_t *emu, uintptr_t fnc); +void iFLbp_p_32(x64emu_t *emu, uintptr_t fnc); +void iFpibl__32(x64emu_t *emu, uintptr_t fnc); +void iFpibp__32(x64emu_t *emu, uintptr_t fnc); +void iFpubp__32(x64emu_t *emu, uintptr_t fnc); +void iFpubL__32(x64emu_t *emu, uintptr_t fnc); +void iFplbl__32(x64emu_t *emu, uintptr_t fnc); +void iEppBp__32(x64emu_t *emu, uintptr_t fnc); +void iFppbp__32(x64emu_t *emu, uintptr_t fnc); +void iFppbL__32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_i_32(x64emu_t *emu, uintptr_t fnc); +void iFpbL_i_32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_u_32(x64emu_t *emu, uintptr_t fnc); +void iFpbL_p_32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_p_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_Wp_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_up_32(x64emu_t *emu, uintptr_t fnc); +void iEBp_LL_32(x64emu_t *emu, uintptr_t fnc); +void iFBp_LL_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_pi_32(x64emu_t *emu, uintptr_t fnc); +void iFbL_pi_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_pI_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_pu_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_pd_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_pl_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_pp_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_Si_32(x64emu_t *emu, uintptr_t fnc); +void iFXibL__32(x64emu_t *emu, uintptr_t fnc); +void iFXLbp__32(x64emu_t *emu, uintptr_t fnc); +void iFXLbL__32(x64emu_t *emu, uintptr_t fnc); +void iFXbL_i_32(x64emu_t *emu, uintptr_t fnc); +void iFXbp_i_32(x64emu_t *emu, uintptr_t fnc); +void iFXBL_p_32(x64emu_t *emu, uintptr_t fnc); +void iFXbp_p_32(x64emu_t *emu, uintptr_t fnc); +void iFXbL_p_32(x64emu_t *emu, uintptr_t fnc); +void IEpBp_i_32(x64emu_t *emu, uintptr_t fnc); +void uFppbp__32(x64emu_t *emu, uintptr_t fnc); +void uFpbp_p_32(x64emu_t *emu, uintptr_t fnc); +void UEpBp_i_32(x64emu_t *emu, uintptr_t fnc); +void fEpBp_p_32(x64emu_t *emu, uintptr_t fnc); +void fEpBp_a_32(x64emu_t *emu, uintptr_t fnc); +void dEpBp_i_32(x64emu_t *emu, uintptr_t fnc); +void dEpBp_a_32(x64emu_t *emu, uintptr_t fnc); +void lEpBp_i_32(x64emu_t *emu, uintptr_t fnc); +void lFpbp_L_32(x64emu_t *emu, uintptr_t fnc); +void LEpBp_i_32(x64emu_t *emu, uintptr_t fnc); +void pFuXbl__32(x64emu_t *emu, uintptr_t fnc); +void pFpibp__32(x64emu_t *emu, uintptr_t fnc); +void pFpubl__32(x64emu_t *emu, uintptr_t fnc); +void pEppbp__32(x64emu_t *emu, uintptr_t fnc); +void pEppBp__32(x64emu_t *emu, uintptr_t fnc); +void pFppbp__32(x64emu_t *emu, uintptr_t fnc); +void pFXLbL__32(x64emu_t *emu, uintptr_t fnc); +void pFnubp__32(x64emu_t *emu, uintptr_t fnc); +void pFnUbp__32(x64emu_t *emu, uintptr_t fnc); +void vFpibpp__32(x64emu_t *emu, uintptr_t fnc); +void vFpbpu_u_32(x64emu_t *emu, uintptr_t fnc); +void vFpbpu_p_32(x64emu_t *emu, uintptr_t fnc); +void iFLbpi_i_32(x64emu_t *emu, uintptr_t fnc); +void iFpibpu__32(x64emu_t *emu, uintptr_t fnc); +void iFpibpp__32(x64emu_t *emu, uintptr_t fnc); +void iFpubpu__32(x64emu_t *emu, uintptr_t fnc); +void iEpprLL__32(x64emu_t *emu, uintptr_t fnc); +void iFppbpu__32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_p_32(x64emu_t *emu, uintptr_t fnc); +void iFXLbpp__32(x64emu_t *emu, uintptr_t fnc); +void iFXbLC_i_32(x64emu_t *emu, uintptr_t fnc); +void uFpubpu__32(x64emu_t *emu, uintptr_t fnc); +void vFLbL_bL__32(x64emu_t *emu, uintptr_t fnc); +void vFpbLdd_i_32(x64emu_t *emu, uintptr_t fnc); +void vFpbp_bp__32(x64emu_t *emu, uintptr_t fnc); +void iFpbl_bl__32(x64emu_t *emu, uintptr_t fnc); +void iFpbL_bL__32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_bp__32(x64emu_t *emu, uintptr_t fnc); +void iFbp_pbp__32(x64emu_t *emu, uintptr_t fnc); +void iFbp_bp_p_32(x64emu_t *emu, uintptr_t fnc); +void iFXbiip_i_32(x64emu_t *emu, uintptr_t fnc); +void iFXbLip_L_32(x64emu_t *emu, uintptr_t fnc); +void vFXLbpLiL__32(x64emu_t *emu, uintptr_t fnc); +void vFXLrpLiL__32(x64emu_t *emu, uintptr_t fnc); +void iFbp_ubpu__32(x64emu_t *emu, uintptr_t fnc); +void iFbpu_pbL__32(x64emu_t *emu, uintptr_t fnc); +void iFXLbpLiL__32(x64emu_t *emu, uintptr_t fnc); +void iFXLbLLii__32(x64emu_t *emu, uintptr_t fnc); +void vFpbpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFubpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFbpu_bpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFXLbLWWWcc__32(x64emu_t *emu, uintptr_t fnc); +void vFppbppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void vFbppuuuuup_pp_32(x64emu_t *emu, uintptr_t fnc); +void iFppbppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void iFbpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void uFppbppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void LFppbppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void pFpibppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void iEirLLLL_BLLLL__32(x64emu_t *emu, uintptr_t fnc); +void pEppriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fnc); +void pFXrLiiwwwwwwwwL_p_32(x64emu_t *emu, uintptr_t fnc); +void vFbppuiiiiiiiiipp_pp_32(x64emu_t *emu, uintptr_t fnc); +void vEEipp_32(x64emu_t *emu, uintptr_t fnc); +void vFEipp_32(x64emu_t *emu, uintptr_t fnc); +void vEEipV_32(x64emu_t *emu, uintptr_t fnc); +void vFEpui_32(x64emu_t *emu, uintptr_t fnc); +void vEEpuu_32(x64emu_t *emu, uintptr_t fnc); +void vEEpup_32(x64emu_t *emu, uintptr_t fnc); +void vFEpup_32(x64emu_t *emu, uintptr_t fnc); +void vFEpll_32(x64emu_t *emu, uintptr_t fnc); +void vEEppp_32(x64emu_t *emu, uintptr_t fnc); +void vFEppp_32(x64emu_t *emu, uintptr_t fnc); +void vFEXLp_32(x64emu_t *emu, uintptr_t fnc); +void vFEXpi_32(x64emu_t *emu, uintptr_t fnc); +void vFcccc_32(x64emu_t *emu, uintptr_t fnc); +void vFwwww_32(x64emu_t *emu, uintptr_t fnc); +void vFiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFiiCp_32(x64emu_t *emu, uintptr_t fnc); +void vFiill_32(x64emu_t *emu, uintptr_t fnc); +void vFiIII_32(x64emu_t *emu, uintptr_t fnc); +void vFiuip_32(x64emu_t *emu, uintptr_t fnc); +void vFiuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFiulp_32(x64emu_t *emu, uintptr_t fnc); +void vFiupV_32(x64emu_t *emu, uintptr_t fnc); +void vFiUUU_32(x64emu_t *emu, uintptr_t fnc); +void vFifff_32(x64emu_t *emu, uintptr_t fnc); +void vFiddd_32(x64emu_t *emu, uintptr_t fnc); +void vFilip_32(x64emu_t *emu, uintptr_t fnc); +void vFilpu_32(x64emu_t *emu, uintptr_t fnc); +void vFilpp_32(x64emu_t *emu, uintptr_t fnc); +void vFipup_32(x64emu_t *emu, uintptr_t fnc); +void vFipll_32(x64emu_t *emu, uintptr_t fnc); +void vFippp_32(x64emu_t *emu, uintptr_t fnc); +void vFCCCC_32(x64emu_t *emu, uintptr_t fnc); +void vFWWWW_32(x64emu_t *emu, uintptr_t fnc); +void vFuccc_32(x64emu_t *emu, uintptr_t fnc); +void vFuwww_32(x64emu_t *emu, uintptr_t fnc); +void vFuiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiII_32(x64emu_t *emu, uintptr_t fnc); +void vFuiui_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuC_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuiup_32(x64emu_t *emu, uintptr_t fnc); +void vFuiUU_32(x64emu_t *emu, uintptr_t fnc); +void vFuifi_32(x64emu_t *emu, uintptr_t fnc); +void vFuiff_32(x64emu_t *emu, uintptr_t fnc); +void vFuidd_32(x64emu_t *emu, uintptr_t fnc); +void vFuilp_32(x64emu_t *emu, uintptr_t fnc); +void vFuipu_32(x64emu_t *emu, uintptr_t fnc); +void vFuipp_32(x64emu_t *emu, uintptr_t fnc); +void vFuIII_32(x64emu_t *emu, uintptr_t fnc); +void vFuWWW_32(x64emu_t *emu, uintptr_t fnc); +void vFuuii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuil_32(x64emu_t *emu, uintptr_t fnc); +void vFuuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuCu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuCp_32(x64emu_t *emu, uintptr_t fnc); +void vFuuui_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuf_32(x64emu_t *emu, uintptr_t fnc); +void vFuuud_32(x64emu_t *emu, uintptr_t fnc); +void vFuuul_32(x64emu_t *emu, uintptr_t fnc); +void vFuuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuUl_32(x64emu_t *emu, uintptr_t fnc); +void vFuuff_32(x64emu_t *emu, uintptr_t fnc); +void vFuuli_32(x64emu_t *emu, uintptr_t fnc); +void vFuupi_32(x64emu_t *emu, uintptr_t fnc); +void vFuupp_32(x64emu_t *emu, uintptr_t fnc); +void vFuUui_32(x64emu_t *emu, uintptr_t fnc); +void vFuUup_32(x64emu_t *emu, uintptr_t fnc); +void vFuUUU_32(x64emu_t *emu, uintptr_t fnc); +void vFufff_32(x64emu_t *emu, uintptr_t fnc); +void vFuddd_32(x64emu_t *emu, uintptr_t fnc); +void vFuluU_32(x64emu_t *emu, uintptr_t fnc); +void vFullC_32(x64emu_t *emu, uintptr_t fnc); +void vFullp_32(x64emu_t *emu, uintptr_t fnc); +void vFulpu_32(x64emu_t *emu, uintptr_t fnc); +void vFulpp_32(x64emu_t *emu, uintptr_t fnc); +void vFupii_32(x64emu_t *emu, uintptr_t fnc); +void vFuppi_32(x64emu_t *emu, uintptr_t fnc); +void vFuppu_32(x64emu_t *emu, uintptr_t fnc); +void vFUUpi_32(x64emu_t *emu, uintptr_t fnc); +void vFffff_32(x64emu_t *emu, uintptr_t fnc); +void vFdddd_32(x64emu_t *emu, uintptr_t fnc); +void vFllii_32(x64emu_t *emu, uintptr_t fnc); +void vFLiii_32(x64emu_t *emu, uintptr_t fnc); +void vFpiip_32(x64emu_t *emu, uintptr_t fnc); +void vFpipi_32(x64emu_t *emu, uintptr_t fnc); +void vFpipp_32(x64emu_t *emu, uintptr_t fnc); +void vFpudd_32(x64emu_t *emu, uintptr_t fnc); +void vFpdii_32(x64emu_t *emu, uintptr_t fnc); +void vFpddd_32(x64emu_t *emu, uintptr_t fnc); +void vFplpp_32(x64emu_t *emu, uintptr_t fnc); +void vFppid_32(x64emu_t *emu, uintptr_t fnc); +void vEppip_32(x64emu_t *emu, uintptr_t fnc); +void vFppui_32(x64emu_t *emu, uintptr_t fnc); +void vFppuu_32(x64emu_t *emu, uintptr_t fnc); +void vFppdd_32(x64emu_t *emu, uintptr_t fnc); +void vFpppp_32(x64emu_t *emu, uintptr_t fnc); +void vFXiiL_32(x64emu_t *emu, uintptr_t fnc); +void vFXiLu_32(x64emu_t *emu, uintptr_t fnc); +void vFXLii_32(x64emu_t *emu, uintptr_t fnc); +void vFXLip_32(x64emu_t *emu, uintptr_t fnc); +void vFXLuu_32(x64emu_t *emu, uintptr_t fnc); +void vFXLLL_32(x64emu_t *emu, uintptr_t fnc); +void vFXLLp_32(x64emu_t *emu, uintptr_t fnc); +void vFXLpi_32(x64emu_t *emu, uintptr_t fnc); +void vFXLpL_32(x64emu_t *emu, uintptr_t fnc); +void vFXpip_32(x64emu_t *emu, uintptr_t fnc); +void vFXppL_32(x64emu_t *emu, uintptr_t fnc); +void cFpiii_32(x64emu_t *emu, uintptr_t fnc); +void iEEiip_32(x64emu_t *emu, uintptr_t fnc); +void iEEiiN_32(x64emu_t *emu, uintptr_t fnc); +void iEEiLp_32(x64emu_t *emu, uintptr_t fnc); +void iEEipp_32(x64emu_t *emu, uintptr_t fnc); +void iFEipp_32(x64emu_t *emu, uintptr_t fnc); +void iEEipV_32(x64emu_t *emu, uintptr_t fnc); +void iEEpii_32(x64emu_t *emu, uintptr_t fnc); +void iEEpip_32(x64emu_t *emu, uintptr_t fnc); +void iFEpip_32(x64emu_t *emu, uintptr_t fnc); +void iFEpui_32(x64emu_t *emu, uintptr_t fnc); +void iFEpuu_32(x64emu_t *emu, uintptr_t fnc); +void iEEpup_32(x64emu_t *emu, uintptr_t fnc); +void iFEpup_32(x64emu_t *emu, uintptr_t fnc); +void iFEpll_32(x64emu_t *emu, uintptr_t fnc); +void iEEpLi_32(x64emu_t *emu, uintptr_t fnc); +void iFEpLi_32(x64emu_t *emu, uintptr_t fnc); +void iEEppi_32(x64emu_t *emu, uintptr_t fnc); +void iFEppi_32(x64emu_t *emu, uintptr_t fnc); +void iFEppu_32(x64emu_t *emu, uintptr_t fnc); +void iEEppL_32(x64emu_t *emu, uintptr_t fnc); +void iEEppp_32(x64emu_t *emu, uintptr_t fnc); +void iFEppp_32(x64emu_t *emu, uintptr_t fnc); +void iEEppV_32(x64emu_t *emu, uintptr_t fnc); +void iFEppV_32(x64emu_t *emu, uintptr_t fnc); +void iEEpON_32(x64emu_t *emu, uintptr_t fnc); +void iEEhup_32(x64emu_t *emu, uintptr_t fnc); +void iEESpp_32(x64emu_t *emu, uintptr_t fnc); +void iEESpV_32(x64emu_t *emu, uintptr_t fnc); +void iFEXip_32(x64emu_t *emu, uintptr_t fnc); +void iFEXup_32(x64emu_t *emu, uintptr_t fnc); +void iFEXlp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXpp_32(x64emu_t *emu, uintptr_t fnc); +void iFiiii_32(x64emu_t *emu, uintptr_t fnc); +void iFiiiu_32(x64emu_t *emu, uintptr_t fnc); +void iEiiip_32(x64emu_t *emu, uintptr_t fnc); +void iEiiiN_32(x64emu_t *emu, uintptr_t fnc); +void iEiiII_32(x64emu_t *emu, uintptr_t fnc); +void iEiIIi_32(x64emu_t *emu, uintptr_t fnc); +void iFiuii_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuU_32(x64emu_t *emu, uintptr_t fnc); +void iFiuup_32(x64emu_t *emu, uintptr_t fnc); +void iFiupu_32(x64emu_t *emu, uintptr_t fnc); +void iFiupp_32(x64emu_t *emu, uintptr_t fnc); +void iEilli_32(x64emu_t *emu, uintptr_t fnc); +void iFiLpL_32(x64emu_t *emu, uintptr_t fnc); +void iEipii_32(x64emu_t *emu, uintptr_t fnc); +void iEipip_32(x64emu_t *emu, uintptr_t fnc); +void iEipui_32(x64emu_t *emu, uintptr_t fnc); +void iFipup_32(x64emu_t *emu, uintptr_t fnc); +void iFipLp_32(x64emu_t *emu, uintptr_t fnc); +void iEippi_32(x64emu_t *emu, uintptr_t fnc); +void iFippu_32(x64emu_t *emu, uintptr_t fnc); +void iEippL_32(x64emu_t *emu, uintptr_t fnc); +void iFippp_32(x64emu_t *emu, uintptr_t fnc); +void iEipON_32(x64emu_t *emu, uintptr_t fnc); +void iFuiup_32(x64emu_t *emu, uintptr_t fnc); +void iFupLp_32(x64emu_t *emu, uintptr_t fnc); +void iFuppp_32(x64emu_t *emu, uintptr_t fnc); +void iFUpLp_32(x64emu_t *emu, uintptr_t fnc); +void iFpiii_32(x64emu_t *emu, uintptr_t fnc); +void iFpiiL_32(x64emu_t *emu, uintptr_t fnc); +void iFpiip_32(x64emu_t *emu, uintptr_t fnc); +void iFpiII_32(x64emu_t *emu, uintptr_t fnc); +void iFpiuu_32(x64emu_t *emu, uintptr_t fnc); +void iFpili_32(x64emu_t *emu, uintptr_t fnc); +void iFpipu_32(x64emu_t *emu, uintptr_t fnc); +void iFpipL_32(x64emu_t *emu, uintptr_t fnc); +void iEpipp_32(x64emu_t *emu, uintptr_t fnc); +void iFpipp_32(x64emu_t *emu, uintptr_t fnc); +void iFpCCC_32(x64emu_t *emu, uintptr_t fnc); +void iFpWWu_32(x64emu_t *emu, uintptr_t fnc); +void iEpuiL_32(x64emu_t *emu, uintptr_t fnc); +void iFpuuu_32(x64emu_t *emu, uintptr_t fnc); +void iFpuuU_32(x64emu_t *emu, uintptr_t fnc); +void iFpuup_32(x64emu_t *emu, uintptr_t fnc); +void iFpuLp_32(x64emu_t *emu, uintptr_t fnc); +void iFpupi_32(x64emu_t *emu, uintptr_t fnc); +void iFpupu_32(x64emu_t *emu, uintptr_t fnc); +void iFpupL_32(x64emu_t *emu, uintptr_t fnc); +void iFpupp_32(x64emu_t *emu, uintptr_t fnc); +void iFpLuu_32(x64emu_t *emu, uintptr_t fnc); +void iFpLpp_32(x64emu_t *emu, uintptr_t fnc); +void iFppii_32(x64emu_t *emu, uintptr_t fnc); +void iFppiU_32(x64emu_t *emu, uintptr_t fnc); +void iFppip_32(x64emu_t *emu, uintptr_t fnc); +void iFppWp_32(x64emu_t *emu, uintptr_t fnc); +void iFppuw_32(x64emu_t *emu, uintptr_t fnc); +void iFppui_32(x64emu_t *emu, uintptr_t fnc); +void iFppuu_32(x64emu_t *emu, uintptr_t fnc); +void iFppup_32(x64emu_t *emu, uintptr_t fnc); +void iFppLi_32(x64emu_t *emu, uintptr_t fnc); +void iFppLI_32(x64emu_t *emu, uintptr_t fnc); +void iFppLu_32(x64emu_t *emu, uintptr_t fnc); +void iFppLp_32(x64emu_t *emu, uintptr_t fnc); +void iFpppi_32(x64emu_t *emu, uintptr_t fnc); +void iFpppu_32(x64emu_t *emu, uintptr_t fnc); +void iEpppL_32(x64emu_t *emu, uintptr_t fnc); +void iFpppL_32(x64emu_t *emu, uintptr_t fnc); +void iEpppp_32(x64emu_t *emu, uintptr_t fnc); +void iFpppp_32(x64emu_t *emu, uintptr_t fnc); +void iESpiL_32(x64emu_t *emu, uintptr_t fnc); +void iFXiii_32(x64emu_t *emu, uintptr_t fnc); +void iFXiiL_32(x64emu_t *emu, uintptr_t fnc); +void iFXiip_32(x64emu_t *emu, uintptr_t fnc); +void iFXiuL_32(x64emu_t *emu, uintptr_t fnc); +void iFXiLL_32(x64emu_t *emu, uintptr_t fnc); +void iFXipi_32(x64emu_t *emu, uintptr_t fnc); +void iFXipp_32(x64emu_t *emu, uintptr_t fnc); +void iFXWWW_32(x64emu_t *emu, uintptr_t fnc); +void iFXuuu_32(x64emu_t *emu, uintptr_t fnc); +void iFXuuL_32(x64emu_t *emu, uintptr_t fnc); +void iFXuup_32(x64emu_t *emu, uintptr_t fnc); +void iFXuLL_32(x64emu_t *emu, uintptr_t fnc); +void iFXupp_32(x64emu_t *emu, uintptr_t fnc); +void iFXLii_32(x64emu_t *emu, uintptr_t fnc); +void iFXLiL_32(x64emu_t *emu, uintptr_t fnc); +void iFXLip_32(x64emu_t *emu, uintptr_t fnc); +void iFXLuu_32(x64emu_t *emu, uintptr_t fnc); +void iFXLLL_32(x64emu_t *emu, uintptr_t fnc); +void iFXLLp_32(x64emu_t *emu, uintptr_t fnc); +void iFXLpi_32(x64emu_t *emu, uintptr_t fnc); +void iFXpii_32(x64emu_t *emu, uintptr_t fnc); +void iFXpip_32(x64emu_t *emu, uintptr_t fnc); +void iFXpLp_32(x64emu_t *emu, uintptr_t fnc); +void iFXppi_32(x64emu_t *emu, uintptr_t fnc); +void iFXppp_32(x64emu_t *emu, uintptr_t fnc); +void IFEpIi_32(x64emu_t *emu, uintptr_t fnc); +void CFuuff_32(x64emu_t *emu, uintptr_t fnc); +void uFEuip_32(x64emu_t *emu, uintptr_t fnc); +void uFEpii_32(x64emu_t *emu, uintptr_t fnc); +void uFEpip_32(x64emu_t *emu, uintptr_t fnc); +void uFEpiV_32(x64emu_t *emu, uintptr_t fnc); +void uFEpup_32(x64emu_t *emu, uintptr_t fnc); +void uFEpLL_32(x64emu_t *emu, uintptr_t fnc); +void uFuuuu_32(x64emu_t *emu, uintptr_t fnc); +void uFuppd_32(x64emu_t *emu, uintptr_t fnc); +void uFpiip_32(x64emu_t *emu, uintptr_t fnc); +void uFpCCC_32(x64emu_t *emu, uintptr_t fnc); +void uFppii_32(x64emu_t *emu, uintptr_t fnc); +void uFppip_32(x64emu_t *emu, uintptr_t fnc); +void uFpppi_32(x64emu_t *emu, uintptr_t fnc); +void uFpppd_32(x64emu_t *emu, uintptr_t fnc); +void uFpppp_32(x64emu_t *emu, uintptr_t fnc); +void lEEipi_32(x64emu_t *emu, uintptr_t fnc); +void lEEipL_32(x64emu_t *emu, uintptr_t fnc); +void lEEppL_32(x64emu_t *emu, uintptr_t fnc); +void lEiipL_32(x64emu_t *emu, uintptr_t fnc); +void lEipLi_32(x64emu_t *emu, uintptr_t fnc); +void lEipLI_32(x64emu_t *emu, uintptr_t fnc); +void lEipLl_32(x64emu_t *emu, uintptr_t fnc); +void lEipLL_32(x64emu_t *emu, uintptr_t fnc); +void lFpuip_32(x64emu_t *emu, uintptr_t fnc); +void lFppLp_32(x64emu_t *emu, uintptr_t fnc); +void LFEpLp_32(x64emu_t *emu, uintptr_t fnc); +void LFEXii_32(x64emu_t *emu, uintptr_t fnc); +void LEpLLS_32(x64emu_t *emu, uintptr_t fnc); +void LEppLL_32(x64emu_t *emu, uintptr_t fnc); +void LEppLp_32(x64emu_t *emu, uintptr_t fnc); +void LEppLa_32(x64emu_t *emu, uintptr_t fnc); +void LFXCii_32(x64emu_t *emu, uintptr_t fnc); +void LFXLuu_32(x64emu_t *emu, uintptr_t fnc); +void LFXpLp_32(x64emu_t *emu, uintptr_t fnc); +void pFEupi_32(x64emu_t *emu, uintptr_t fnc); +void pFEupp_32(x64emu_t *emu, uintptr_t fnc); +void pEEpii_32(x64emu_t *emu, uintptr_t fnc); +void pEEpip_32(x64emu_t *emu, uintptr_t fnc); +void pFEpip_32(x64emu_t *emu, uintptr_t fnc); +void pFEpui_32(x64emu_t *emu, uintptr_t fnc); +void pEEppi_32(x64emu_t *emu, uintptr_t fnc); +void pFEppi_32(x64emu_t *emu, uintptr_t fnc); +void pEEppp_32(x64emu_t *emu, uintptr_t fnc); +void pFEppp_32(x64emu_t *emu, uintptr_t fnc); +void pFEXip_32(x64emu_t *emu, uintptr_t fnc); +void pFEXCL_32(x64emu_t *emu, uintptr_t fnc); +void pFEXuu_32(x64emu_t *emu, uintptr_t fnc); +void pFEXLL_32(x64emu_t *emu, uintptr_t fnc); +void pFEXLp_32(x64emu_t *emu, uintptr_t fnc); +void pFEXpL_32(x64emu_t *emu, uintptr_t fnc); +void pFEXpp_32(x64emu_t *emu, uintptr_t fnc); +void pFiiiu_32(x64emu_t *emu, uintptr_t fnc); +void pFifff_32(x64emu_t *emu, uintptr_t fnc); +void pFillu_32(x64emu_t *emu, uintptr_t fnc); +void pEippu_32(x64emu_t *emu, uintptr_t fnc); +void pFullu_32(x64emu_t *emu, uintptr_t fnc); +void pFdddd_32(x64emu_t *emu, uintptr_t fnc); +void pFpiii_32(x64emu_t *emu, uintptr_t fnc); +void pFpiip_32(x64emu_t *emu, uintptr_t fnc); +void pEpiLL_32(x64emu_t *emu, uintptr_t fnc); +void pFpipc_32(x64emu_t *emu, uintptr_t fnc); +void pFpipi_32(x64emu_t *emu, uintptr_t fnc); +void pFpipp_32(x64emu_t *emu, uintptr_t fnc); +void pFpuii_32(x64emu_t *emu, uintptr_t fnc); +void pFpupu_32(x64emu_t *emu, uintptr_t fnc); +void pFpupp_32(x64emu_t *emu, uintptr_t fnc); +void pEpLiS_32(x64emu_t *emu, uintptr_t fnc); +void pEpLpL_32(x64emu_t *emu, uintptr_t fnc); +void pFpLpL_32(x64emu_t *emu, uintptr_t fnc); +void pEppLL_32(x64emu_t *emu, uintptr_t fnc); +void pFppLp_32(x64emu_t *emu, uintptr_t fnc); +void pFpppi_32(x64emu_t *emu, uintptr_t fnc); +void pFpppL_32(x64emu_t *emu, uintptr_t fnc); +void pFpppp_32(x64emu_t *emu, uintptr_t fnc); +void pFXiii_32(x64emu_t *emu, uintptr_t fnc); +void pFXiip_32(x64emu_t *emu, uintptr_t fnc); +void pFXLpp_32(x64emu_t *emu, uintptr_t fnc); +void pFXppp_32(x64emu_t *emu, uintptr_t fnc); +void vFuibp_i_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuBp__32(x64emu_t *emu, uintptr_t fnc); +void vFbp_ppp_32(x64emu_t *emu, uintptr_t fnc); +void vFXLLbL__32(x64emu_t *emu, uintptr_t fnc); +void iFEpbL_p_32(x64emu_t *emu, uintptr_t fnc); +void iFpipbL__32(x64emu_t *emu, uintptr_t fnc); +void iFpupbL__32(x64emu_t *emu, uintptr_t fnc); +void iFpubp_u_32(x64emu_t *emu, uintptr_t fnc); +void iFplibl__32(x64emu_t *emu, uintptr_t fnc); +void iFpLpbL__32(x64emu_t *emu, uintptr_t fnc); +void iFppWbp__32(x64emu_t *emu, uintptr_t fnc); +void iFpppbp__32(x64emu_t *emu, uintptr_t fnc); +void iFpppbL__32(x64emu_t *emu, uintptr_t fnc); +void iFppbp_u_32(x64emu_t *emu, uintptr_t fnc); +void iFppbL_p_32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_ii_32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_ip_32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_uu_32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_pp_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_upL_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_pii_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_pip_32(x64emu_t *emu, uintptr_t fnc); +void iFBp_pui_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_ppu_32(x64emu_t *emu, uintptr_t fnc); +void iFXLiBp__32(x64emu_t *emu, uintptr_t fnc); +void iFXLbp_i_32(x64emu_t *emu, uintptr_t fnc); +void iFXLbL_i_32(x64emu_t *emu, uintptr_t fnc); +void iFXLbp_p_32(x64emu_t *emu, uintptr_t fnc); +void IEpBp_ii_32(x64emu_t *emu, uintptr_t fnc); +void IEpBp_ia_32(x64emu_t *emu, uintptr_t fnc); +void uFppibp__32(x64emu_t *emu, uintptr_t fnc); +void uFppibl__32(x64emu_t *emu, uintptr_t fnc); +void uFppbp_i_32(x64emu_t *emu, uintptr_t fnc); +void uFpbp_ip_32(x64emu_t *emu, uintptr_t fnc); +void UEpBp_ii_32(x64emu_t *emu, uintptr_t fnc); +void UEpBp_ia_32(x64emu_t *emu, uintptr_t fnc); +void lEiibl_L_32(x64emu_t *emu, uintptr_t fnc); +void LEpBp_ii_32(x64emu_t *emu, uintptr_t fnc); +void LEpbp_Lp_32(x64emu_t *emu, uintptr_t fnc); +void pFpppbl__32(x64emu_t *emu, uintptr_t fnc); +void vFpibpp_i_32(x64emu_t *emu, uintptr_t fnc); +void iEEpprLL__32(x64emu_t *emu, uintptr_t fnc); +void iFuubpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFpuubpu__32(x64emu_t *emu, uintptr_t fnc); +void iFpupbpu__32(x64emu_t *emu, uintptr_t fnc); +void iFpubpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iEpurLL_p_32(x64emu_t *emu, uintptr_t fnc); +void iFppubpu__32(x64emu_t *emu, uintptr_t fnc); +void iFppbpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_uu_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_up_32(x64emu_t *emu, uintptr_t fnc); +void iFbpu_ppp_32(x64emu_t *emu, uintptr_t fnc); +void iFnbpL_iU_32(x64emu_t *emu, uintptr_t fnc); +void lFppLbLL__32(x64emu_t *emu, uintptr_t fnc); +void pFnbpi_up_32(x64emu_t *emu, uintptr_t fnc); +void vFppbp_bL__32(x64emu_t *emu, uintptr_t fnc); +void vFpbLdd_ip_32(x64emu_t *emu, uintptr_t fnc); +void vFpbupu_uu_32(x64emu_t *emu, uintptr_t fnc); +void iFupbp_bp__32(x64emu_t *emu, uintptr_t fnc); +void iFppbL_bL__32(x64emu_t *emu, uintptr_t fnc); +void iFppbp_bp__32(x64emu_t *emu, uintptr_t fnc); +void iFppbp_bL__32(x64emu_t *emu, uintptr_t fnc); +void iFpbupu_up_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_urp_u_32(x64emu_t *emu, uintptr_t fnc); +void iFrpuu_Lui_32(x64emu_t *emu, uintptr_t fnc); +void iEbp_bL_iS_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_bp_pi_32(x64emu_t *emu, uintptr_t fnc); +void iFXbL_ibp__32(x64emu_t *emu, uintptr_t fnc); +void iFnubp_bp__32(x64emu_t *emu, uintptr_t fnc); +void iFnUbp_bp__32(x64emu_t *emu, uintptr_t fnc); +void vFEpuBLLLL__32(x64emu_t *emu, uintptr_t fnc); +void vFbp_ppbup__32(x64emu_t *emu, uintptr_t fnc); +void vFXLbpLiL_L_32(x64emu_t *emu, uintptr_t fnc); +void iFubpu_pbL__32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_pbL__32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bp_u_32(x64emu_t *emu, uintptr_t fnc); +void iFbpu_upbL__32(x64emu_t *emu, uintptr_t fnc); +void iFbp_pbpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFXLbpLiL_L_32(x64emu_t *emu, uintptr_t fnc); +void iEiirLL_BLL__32(x64emu_t *emu, uintptr_t fnc); +void iEuirLL_BLL__32(x64emu_t *emu, uintptr_t fnc); +void iFpubpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFppbpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_Lbpu__32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu_p_32(x64emu_t *emu, uintptr_t fnc); +void iFXLpbLWWWcc__32(x64emu_t *emu, uintptr_t fnc); +void iFXLbLWWWcc_i_32(x64emu_t *emu, uintptr_t fnc); +void pESBppppii_pi_32(x64emu_t *emu, uintptr_t fnc); +void iFEprllll_rll__32(x64emu_t *emu, uintptr_t fnc); +void iEupuBpppiiip__32(x64emu_t *emu, uintptr_t fnc); +void iFbp_ubpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFXLuriiiiiLi__32(x64emu_t *emu, uintptr_t fnc); +void uFnibpL_bLpCC__32(x64emu_t *emu, uintptr_t fnc); +void iFppubppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void iFpruuipWCCp_ll_32(x64emu_t *emu, uintptr_t fnc); +void iFpbLL_bLL_bLL__32(x64emu_t *emu, uintptr_t fnc); +void pFppibppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void vFXLbLLLLLLLLLL_L_32(x64emu_t *emu, uintptr_t fnc); +void iFXLbLLLLLLLLLL_L_32(x64emu_t *emu, uintptr_t fnc); +void LEpLpriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fnc); +void iFXipBWWWWWWWWWuip__32(x64emu_t *emu, uintptr_t fnc); +void iFXLbLWWWcc_bLWWWcc__32(x64emu_t *emu, uintptr_t fnc); +void uFEbppuiiiiiiiiipp_ip_32(x64emu_t *emu, uintptr_t fnc); +void uFbppuiiiiiiiiipp_ipi_32(x64emu_t *emu, uintptr_t fnc); +void iFpruuipWCCp_buuipWCCp_i_32(x64emu_t *emu, uintptr_t fnc); +void iFXpLriLLLiiiiiiiLLiiLiiiiLic__32(x64emu_t *emu, uintptr_t fnc); +void iFXpLbiLLLiiiiiiiLLiiLiiiiLic__32(x64emu_t *emu, uintptr_t fnc); +void pFXLLbiLLLiiiiiiiLLiiLiiiiLic__32(x64emu_t *emu, uintptr_t fnc); +void uFbppuiiiiiiiiipp_ipbppuiiiiiiiiipp__32(x64emu_t *emu, uintptr_t fnc); +void vEEiipp_32(x64emu_t *emu, uintptr_t fnc); +void vEEiipV_32(x64emu_t *emu, uintptr_t fnc); +void vFEuipu_32(x64emu_t *emu, uintptr_t fnc); +void vFEuipp_32(x64emu_t *emu, uintptr_t fnc); +void vEEpLLp_32(x64emu_t *emu, uintptr_t fnc); +void vEEppiV_32(x64emu_t *emu, uintptr_t fnc); +void vFEpppp_32(x64emu_t *emu, uintptr_t fnc); +void vFEXLpL_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiu_32(x64emu_t *emu, uintptr_t fnc); +void vFiiuii_32(x64emu_t *emu, uintptr_t fnc); +void vFiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFiillu_32(x64emu_t *emu, uintptr_t fnc); +void vFiilll_32(x64emu_t *emu, uintptr_t fnc); +void vFiipll_32(x64emu_t *emu, uintptr_t fnc); +void vFiIIII_32(x64emu_t *emu, uintptr_t fnc); +void vFiuiip_32(x64emu_t *emu, uintptr_t fnc); +void vFiuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFiulpp_32(x64emu_t *emu, uintptr_t fnc); +void vFiUUUU_32(x64emu_t *emu, uintptr_t fnc); +void vFiffff_32(x64emu_t *emu, uintptr_t fnc); +void vFidddd_32(x64emu_t *emu, uintptr_t fnc); +void vFilill_32(x64emu_t *emu, uintptr_t fnc); +void vFilipi_32(x64emu_t *emu, uintptr_t fnc); +void vFilipl_32(x64emu_t *emu, uintptr_t fnc); +void vFipipu_32(x64emu_t *emu, uintptr_t fnc); +void vFipipp_32(x64emu_t *emu, uintptr_t fnc); +void vFipupi_32(x64emu_t *emu, uintptr_t fnc); +void vFucccc_32(x64emu_t *emu, uintptr_t fnc); +void vFuwwww_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiu_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiCp_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiup_32(x64emu_t *emu, uintptr_t fnc); +void vFuiill_32(x64emu_t *emu, uintptr_t fnc); +void vFuiIII_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuCi_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuCu_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuiupi_32(x64emu_t *emu, uintptr_t fnc); +void vFuiUUU_32(x64emu_t *emu, uintptr_t fnc); +void vFuifff_32(x64emu_t *emu, uintptr_t fnc); +void vFuiddd_32(x64emu_t *emu, uintptr_t fnc); +void vFuipii_32(x64emu_t *emu, uintptr_t fnc); +void vFuipip_32(x64emu_t *emu, uintptr_t fnc); +void vFuipup_32(x64emu_t *emu, uintptr_t fnc); +void vFuippp_32(x64emu_t *emu, uintptr_t fnc); +void vFuIIII_32(x64emu_t *emu, uintptr_t fnc); +void vFuCCCC_32(x64emu_t *emu, uintptr_t fnc); +void vFuCuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuCuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuWWWW_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiui_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuifi_32(x64emu_t *emu, uintptr_t fnc); +void vFuuipC_32(x64emu_t *emu, uintptr_t fnc); +void vFuuipu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuipp_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuiu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuil_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuui_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuli_32(x64emu_t *emu, uintptr_t fnc); +void vFuuull_32(x64emu_t *emu, uintptr_t fnc); +void vFuulll_32(x64emu_t *emu, uintptr_t fnc); +void vFuullp_32(x64emu_t *emu, uintptr_t fnc); +void vFuupii_32(x64emu_t *emu, uintptr_t fnc); +void vFuUUUU_32(x64emu_t *emu, uintptr_t fnc); +void vFuffff_32(x64emu_t *emu, uintptr_t fnc); +void vFudddd_32(x64emu_t *emu, uintptr_t fnc); +void vFullpu_32(x64emu_t *emu, uintptr_t fnc); +void vFupiii_32(x64emu_t *emu, uintptr_t fnc); +void vFupupp_32(x64emu_t *emu, uintptr_t fnc); +void vFuplii_32(x64emu_t *emu, uintptr_t fnc); +void vFuppip_32(x64emu_t *emu, uintptr_t fnc); +void vFupppp_32(x64emu_t *emu, uintptr_t fnc); +void vFfffff_32(x64emu_t *emu, uintptr_t fnc); +void vFddddp_32(x64emu_t *emu, uintptr_t fnc); +void vFluipp_32(x64emu_t *emu, uintptr_t fnc); +void vFpiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFpilpp_32(x64emu_t *emu, uintptr_t fnc); +void vFpipiu_32(x64emu_t *emu, uintptr_t fnc); +void vFpuipp_32(x64emu_t *emu, uintptr_t fnc); +void vFpuddd_32(x64emu_t *emu, uintptr_t fnc); +void vFpddii_32(x64emu_t *emu, uintptr_t fnc); +void vFpdddd_32(x64emu_t *emu, uintptr_t fnc); +void vFppWui_32(x64emu_t *emu, uintptr_t fnc); +void vFpppii_32(x64emu_t *emu, uintptr_t fnc); +void vFppppu_32(x64emu_t *emu, uintptr_t fnc); +void vFppppp_32(x64emu_t *emu, uintptr_t fnc); +void vFXLiii_32(x64emu_t *emu, uintptr_t fnc); +void vFXLiiL_32(x64emu_t *emu, uintptr_t fnc); +void vFXLppi_32(x64emu_t *emu, uintptr_t fnc); +void vFXpiiL_32(x64emu_t *emu, uintptr_t fnc); +void iEEiiip_32(x64emu_t *emu, uintptr_t fnc); +void iEEiipV_32(x64emu_t *emu, uintptr_t fnc); +void iEEipii_32(x64emu_t *emu, uintptr_t fnc); +void iEEipuu_32(x64emu_t *emu, uintptr_t fnc); +void iEEipup_32(x64emu_t *emu, uintptr_t fnc); +void iEEippi_32(x64emu_t *emu, uintptr_t fnc); +void iEEippL_32(x64emu_t *emu, uintptr_t fnc); +void iEEuupi_32(x64emu_t *emu, uintptr_t fnc); +void iFEpiup_32(x64emu_t *emu, uintptr_t fnc); +void iEEpipp_32(x64emu_t *emu, uintptr_t fnc); +void iFEpipp_32(x64emu_t *emu, uintptr_t fnc); +void iEEpipV_32(x64emu_t *emu, uintptr_t fnc); +void iFEpuip_32(x64emu_t *emu, uintptr_t fnc); +void iFEpupu_32(x64emu_t *emu, uintptr_t fnc); +void iEEpLpp_32(x64emu_t *emu, uintptr_t fnc); +void iFEpLpp_32(x64emu_t *emu, uintptr_t fnc); +void iEEpLpV_32(x64emu_t *emu, uintptr_t fnc); +void iFEpLpV_32(x64emu_t *emu, uintptr_t fnc); +void iEEppii_32(x64emu_t *emu, uintptr_t fnc); +void iFEpplp_32(x64emu_t *emu, uintptr_t fnc); +void iEEpppi_32(x64emu_t *emu, uintptr_t fnc); +void iEEpppp_32(x64emu_t *emu, uintptr_t fnc); +void iFEpppp_32(x64emu_t *emu, uintptr_t fnc); +void iEESipp_32(x64emu_t *emu, uintptr_t fnc); +void iEESipV_32(x64emu_t *emu, uintptr_t fnc); +void iFEXipp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLip_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLlp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLLp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLpi_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLpp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXpii_32(x64emu_t *emu, uintptr_t fnc); +void iFEXpLp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXppu_32(x64emu_t *emu, uintptr_t fnc); +void iFEXppp_32(x64emu_t *emu, uintptr_t fnc); +void iFiiiui_32(x64emu_t *emu, uintptr_t fnc); +void iEiiipu_32(x64emu_t *emu, uintptr_t fnc); +void iEiiipp_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuuu_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuuU_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuup_32(x64emu_t *emu, uintptr_t fnc); +void iFipiip_32(x64emu_t *emu, uintptr_t fnc); +void iEipLLi_32(x64emu_t *emu, uintptr_t fnc); +void iFippuu_32(x64emu_t *emu, uintptr_t fnc); +void iEippLi_32(x64emu_t *emu, uintptr_t fnc); +void iEipppi_32(x64emu_t *emu, uintptr_t fnc); +void iEipppp_32(x64emu_t *emu, uintptr_t fnc); +void iFuiuup_32(x64emu_t *emu, uintptr_t fnc); +void iFuupid_32(x64emu_t *emu, uintptr_t fnc); +void iFpiiuu_32(x64emu_t *emu, uintptr_t fnc); +void iFpiipp_32(x64emu_t *emu, uintptr_t fnc); +void iFpippL_32(x64emu_t *emu, uintptr_t fnc); +void iFpippp_32(x64emu_t *emu, uintptr_t fnc); +void iFpCCCC_32(x64emu_t *emu, uintptr_t fnc); +void iFpuipp_32(x64emu_t *emu, uintptr_t fnc); +void iFpupuu_32(x64emu_t *emu, uintptr_t fnc); +void iFpupLu_32(x64emu_t *emu, uintptr_t fnc); +void iFpuppp_32(x64emu_t *emu, uintptr_t fnc); +void iFppiUi_32(x64emu_t *emu, uintptr_t fnc); +void iFppipp_32(x64emu_t *emu, uintptr_t fnc); +void iFppWup_32(x64emu_t *emu, uintptr_t fnc); +void iFppuip_32(x64emu_t *emu, uintptr_t fnc); +void iFppupu_32(x64emu_t *emu, uintptr_t fnc); +void iFppLpL_32(x64emu_t *emu, uintptr_t fnc); +void iFpppip_32(x64emu_t *emu, uintptr_t fnc); +void iFpppuu_32(x64emu_t *emu, uintptr_t fnc); +void iEpppLi_32(x64emu_t *emu, uintptr_t fnc); +void iFpppLu_32(x64emu_t *emu, uintptr_t fnc); +void iEpppLp_32(x64emu_t *emu, uintptr_t fnc); +void iFppppi_32(x64emu_t *emu, uintptr_t fnc); +void iFppppu_32(x64emu_t *emu, uintptr_t fnc); +void iFppppd_32(x64emu_t *emu, uintptr_t fnc); +void iFppppL_32(x64emu_t *emu, uintptr_t fnc); +void iFppppp_32(x64emu_t *emu, uintptr_t fnc); +void iFXiiii_32(x64emu_t *emu, uintptr_t fnc); +void iFXiiip_32(x64emu_t *emu, uintptr_t fnc); +void iFXiuLi_32(x64emu_t *emu, uintptr_t fnc); +void iFXiLip_32(x64emu_t *emu, uintptr_t fnc); +void iFXiLuu_32(x64emu_t *emu, uintptr_t fnc); +void iFXuuLL_32(x64emu_t *emu, uintptr_t fnc); +void iFXLLii_32(x64emu_t *emu, uintptr_t fnc); +void iFXLpii_32(x64emu_t *emu, uintptr_t fnc); +void iFXLpLi_32(x64emu_t *emu, uintptr_t fnc); +void iFXLppi_32(x64emu_t *emu, uintptr_t fnc); +void iFXpipi_32(x64emu_t *emu, uintptr_t fnc); +void iFXpppp_32(x64emu_t *emu, uintptr_t fnc); +void IFXpIII_32(x64emu_t *emu, uintptr_t fnc); +void uEEippu_32(x64emu_t *emu, uintptr_t fnc); +void uFEpipp_32(x64emu_t *emu, uintptr_t fnc); +void uFEpppp_32(x64emu_t *emu, uintptr_t fnc); +void uFpuupp_32(x64emu_t *emu, uintptr_t fnc); +void uEpLLLS_32(x64emu_t *emu, uintptr_t fnc); +void uFppppp_32(x64emu_t *emu, uintptr_t fnc); +void UFuiCiu_32(x64emu_t *emu, uintptr_t fnc); +void lFpuipC_32(x64emu_t *emu, uintptr_t fnc); +void lFppLpL_32(x64emu_t *emu, uintptr_t fnc); +void LFEppLL_32(x64emu_t *emu, uintptr_t fnc); +void LFEXLpi_32(x64emu_t *emu, uintptr_t fnc); +void LFuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void LEpLppa_32(x64emu_t *emu, uintptr_t fnc); +void LFXLuuu_32(x64emu_t *emu, uintptr_t fnc); +void LFXLpuu_32(x64emu_t *emu, uintptr_t fnc); +void LFXpppi_32(x64emu_t *emu, uintptr_t fnc); +void pFEppip_32(x64emu_t *emu, uintptr_t fnc); +void pFEppdd_32(x64emu_t *emu, uintptr_t fnc); +void pFEpnuu_32(x64emu_t *emu, uintptr_t fnc); +void pFEpnup_32(x64emu_t *emu, uintptr_t fnc); +void pFEXipp_32(x64emu_t *emu, uintptr_t fnc); +void pFEXCip_32(x64emu_t *emu, uintptr_t fnc); +void pFEXlpp_32(x64emu_t *emu, uintptr_t fnc); +void pFEXLip_32(x64emu_t *emu, uintptr_t fnc); +void pFEXpip_32(x64emu_t *emu, uintptr_t fnc); +void pFEXppi_32(x64emu_t *emu, uintptr_t fnc); +void pFuiupp_32(x64emu_t *emu, uintptr_t fnc); +void pFpiiii_32(x64emu_t *emu, uintptr_t fnc); +void pFpiiuu_32(x64emu_t *emu, uintptr_t fnc); +void pFpiipi_32(x64emu_t *emu, uintptr_t fnc); +void pFpipii_32(x64emu_t *emu, uintptr_t fnc); +void pFpipip_32(x64emu_t *emu, uintptr_t fnc); +void pFpippi_32(x64emu_t *emu, uintptr_t fnc); +void pFpippp_32(x64emu_t *emu, uintptr_t fnc); +void pFpuiii_32(x64emu_t *emu, uintptr_t fnc); +void pFpuuuu_32(x64emu_t *emu, uintptr_t fnc); +void pFpuppp_32(x64emu_t *emu, uintptr_t fnc); +void pFpdddd_32(x64emu_t *emu, uintptr_t fnc); +void pFpLLip_32(x64emu_t *emu, uintptr_t fnc); +void pFppipi_32(x64emu_t *emu, uintptr_t fnc); +void pFppuup_32(x64emu_t *emu, uintptr_t fnc); +void pFppupp_32(x64emu_t *emu, uintptr_t fnc); +void pFpppii_32(x64emu_t *emu, uintptr_t fnc); +void pFppppi_32(x64emu_t *emu, uintptr_t fnc); +void pFXLipp_32(x64emu_t *emu, uintptr_t fnc); +void pFXpipi_32(x64emu_t *emu, uintptr_t fnc); +void pFXpuup_32(x64emu_t *emu, uintptr_t fnc); +void pFXppip_32(x64emu_t *emu, uintptr_t fnc); +void tEpppLi_32(x64emu_t *emu, uintptr_t fnc); +void vFiuibp_i_32(x64emu_t *emu, uintptr_t fnc); +void vFXibL_ii_32(x64emu_t *emu, uintptr_t fnc); +void iEEBh_ppp_32(x64emu_t *emu, uintptr_t fnc); +void iFpupbL_p_32(x64emu_t *emu, uintptr_t fnc); +void iFppibp_I_32(x64emu_t *emu, uintptr_t fnc); +void iFppWpbp__32(x64emu_t *emu, uintptr_t fnc); +void iFppupbL__32(x64emu_t *emu, uintptr_t fnc); +void iFppppbp__32(x64emu_t *emu, uintptr_t fnc); +void iFppbL_pu_32(x64emu_t *emu, uintptr_t fnc); +void iFppbL_pL_32(x64emu_t *emu, uintptr_t fnc); +void iFppbp_pp_32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_iii_32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_ipi_32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_uuu_32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_uup_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_piip_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_puip_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_pppi_32(x64emu_t *emu, uintptr_t fnc); +void iFXiibL_i_32(x64emu_t *emu, uintptr_t fnc); +void iFXCupbL__32(x64emu_t *emu, uintptr_t fnc); +void iFXLbL_ii_32(x64emu_t *emu, uintptr_t fnc); +void uFppbp_ip_32(x64emu_t *emu, uintptr_t fnc); +void LEpbp_LLp_32(x64emu_t *emu, uintptr_t fnc); +void LEpBp_LLp_32(x64emu_t *emu, uintptr_t fnc); +void pFpipibp__32(x64emu_t *emu, uintptr_t fnc); +void pFppupbl__32(x64emu_t *emu, uintptr_t fnc); +void pFppLbp_p_32(x64emu_t *emu, uintptr_t fnc); +void iEippprLL__32(x64emu_t *emu, uintptr_t fnc); +void iFpuibpu_p_32(x64emu_t *emu, uintptr_t fnc); +void iFpupubpu__32(x64emu_t *emu, uintptr_t fnc); +void iEpurLL_pL_32(x64emu_t *emu, uintptr_t fnc); +void iFppubpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFppubpu_p_32(x64emu_t *emu, uintptr_t fnc); +void iFpppibpp__32(x64emu_t *emu, uintptr_t fnc); +void iFppppbup__32(x64emu_t *emu, uintptr_t fnc); +void iFpppbpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFppbpu_uu_32(x64emu_t *emu, uintptr_t fnc); +void iFppbpu_pu_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_upu_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_upp_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_puu_32(x64emu_t *emu, uintptr_t fnc); +void iFiiuBp_Bp__32(x64emu_t *emu, uintptr_t fnc); +void iFppbp_bp_p_32(x64emu_t *emu, uintptr_t fnc); +void iFbp_bp_pip_32(x64emu_t *emu, uintptr_t fnc); +void vFbp_ppibup__32(x64emu_t *emu, uintptr_t fnc); +void iFEXbpLiL_pp_32(x64emu_t *emu, uintptr_t fnc); +void iFpubp_bpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFpppbp_bup__32(x64emu_t *emu, uintptr_t fnc); +void iFbp_pbpu_uu_32(x64emu_t *emu, uintptr_t fnc); +void iFpibp_bp_bL__32(x64emu_t *emu, uintptr_t fnc); +void iFpuubpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFpubpu_pbpu__32(x64emu_t *emu, uintptr_t fnc); +void iFppbpu_bpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu_uu_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu_pu_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu_bp_u_32(x64emu_t *emu, uintptr_t fnc); +void iFXLiuriiiiiLi__32(x64emu_t *emu, uintptr_t fnc); +void LELbp_bL_bp_bL__32(x64emu_t *emu, uintptr_t fnc); +void iFpubpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFppbpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void uFEpbppuuuuup_ip_32(x64emu_t *emu, uintptr_t fnc); +void uFEpbppuuuuup_iV_32(x64emu_t *emu, uintptr_t fnc); +void uFppupbppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void iFbp_bp_bL_bp_bL__32(x64emu_t *emu, uintptr_t fnc); +void vFXLbLLLLLLLLLL_iL_32(x64emu_t *emu, uintptr_t fnc); +void iFXiiiBpLiiiLLLii__32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void LEpLpriiiiiiiiilt_a_32(x64emu_t *emu, uintptr_t fnc); +void pFEXLrLiiwwwwwwwwL_i_32(x64emu_t *emu, uintptr_t fnc); +void iFXLpbLWWWcc_bLWWWcc__32(x64emu_t *emu, uintptr_t fnc); +void iFXLpBLWWWcc_BLWWWcc__32(x64emu_t *emu, uintptr_t fnc); +void LFXLrLiiwwwwwwwwL_LriLiiiiLiiiiLi__32(x64emu_t *emu, uintptr_t fnc); +void vFEiiipp_32(x64emu_t *emu, uintptr_t fnc); +void vFEuippp_32(x64emu_t *emu, uintptr_t fnc); +void vFEupupi_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiuil_32(x64emu_t *emu, uintptr_t fnc); +void vFiiilpi_32(x64emu_t *emu, uintptr_t fnc); +void vFiiuilp_32(x64emu_t *emu, uintptr_t fnc); +void vFiffiff_32(x64emu_t *emu, uintptr_t fnc); +void vFiddidd_32(x64emu_t *emu, uintptr_t fnc); +void vFilipli_32(x64emu_t *emu, uintptr_t fnc); +void vFiliplu_32(x64emu_t *emu, uintptr_t fnc); +void vFipiplp_32(x64emu_t *emu, uintptr_t fnc); +void vFCCCCff_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiuii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuiIIII_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiC_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiil_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiuU_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuCip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuiupii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiupiu_32(x64emu_t *emu, uintptr_t fnc); +void vFuiUUUU_32(x64emu_t *emu, uintptr_t fnc); +void vFuiffff_32(x64emu_t *emu, uintptr_t fnc); +void vFuidddd_32(x64emu_t *emu, uintptr_t fnc); +void vFuipiup_32(x64emu_t *emu, uintptr_t fnc); +void vFuCuuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuil_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuCu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuiup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuipC_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuipp_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuuii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuull_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuppi_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuppp_32(x64emu_t *emu, uintptr_t fnc); +void vFuuffff_32(x64emu_t *emu, uintptr_t fnc); +void vFuudddd_32(x64emu_t *emu, uintptr_t fnc); +void vFuupiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuupupp_32(x64emu_t *emu, uintptr_t fnc); +void vFuuplii_32(x64emu_t *emu, uintptr_t fnc); +void vFuffiip_32(x64emu_t *emu, uintptr_t fnc); +void vFufffff_32(x64emu_t *emu, uintptr_t fnc); +void vFuddiip_32(x64emu_t *emu, uintptr_t fnc); +void vFulluUC_32(x64emu_t *emu, uintptr_t fnc); +void vFupiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFffffff_32(x64emu_t *emu, uintptr_t fnc); +void vFdddddd_32(x64emu_t *emu, uintptr_t fnc); +void vFpipipV_32(x64emu_t *emu, uintptr_t fnc); +void vFpudddd_32(x64emu_t *emu, uintptr_t fnc); +void vFpdddii_32(x64emu_t *emu, uintptr_t fnc); +void vFpddddd_32(x64emu_t *emu, uintptr_t fnc); +void vFpppppp_32(x64emu_t *emu, uintptr_t fnc); +void vFXiLppi_32(x64emu_t *emu, uintptr_t fnc); +void vFXLiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFXLiiiL_32(x64emu_t *emu, uintptr_t fnc); +void vFXLiipi_32(x64emu_t *emu, uintptr_t fnc); +void vFXLpppi_32(x64emu_t *emu, uintptr_t fnc); +void vFXpiiii_32(x64emu_t *emu, uintptr_t fnc); +void iEEiippi_32(x64emu_t *emu, uintptr_t fnc); +void iEEiLLLL_32(x64emu_t *emu, uintptr_t fnc); +void iEEipiup_32(x64emu_t *emu, uintptr_t fnc); +void iEEippup_32(x64emu_t *emu, uintptr_t fnc); +void iEEuppLp_32(x64emu_t *emu, uintptr_t fnc); +void iEEpiipi_32(x64emu_t *emu, uintptr_t fnc); +void iFEpiipi_32(x64emu_t *emu, uintptr_t fnc); +void iEEpiipV_32(x64emu_t *emu, uintptr_t fnc); +void iFEpiuuu_32(x64emu_t *emu, uintptr_t fnc); +void iEEpiLpp_32(x64emu_t *emu, uintptr_t fnc); +void iEEpipOi_32(x64emu_t *emu, uintptr_t fnc); +void iFEpuuip_32(x64emu_t *emu, uintptr_t fnc); +void iFEpuuup_32(x64emu_t *emu, uintptr_t fnc); +void iFEplluu_32(x64emu_t *emu, uintptr_t fnc); +void iFEpLlpp_32(x64emu_t *emu, uintptr_t fnc); +void iFEppipp_32(x64emu_t *emu, uintptr_t fnc); +void iEEppupi_32(x64emu_t *emu, uintptr_t fnc); +void iFEppllp_32(x64emu_t *emu, uintptr_t fnc); +void iEEpppup_32(x64emu_t *emu, uintptr_t fnc); +void iEEpppLp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLilp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLpiL_32(x64emu_t *emu, uintptr_t fnc); +void iFEXpiip_32(x64emu_t *emu, uintptr_t fnc); +void iFEXpiup_32(x64emu_t *emu, uintptr_t fnc); +void iFEXpppp_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuuup_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuupu_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuUpU_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuppp_32(x64emu_t *emu, uintptr_t fnc); +void iFiuUuUu_32(x64emu_t *emu, uintptr_t fnc); +void iEipipLu_32(x64emu_t *emu, uintptr_t fnc); +void iFipuIup_32(x64emu_t *emu, uintptr_t fnc); +void iFuiiuup_32(x64emu_t *emu, uintptr_t fnc); +void iFupLpLp_32(x64emu_t *emu, uintptr_t fnc); +void iFpiippp_32(x64emu_t *emu, uintptr_t fnc); +void iFppiiii_32(x64emu_t *emu, uintptr_t fnc); +void iFppiipi_32(x64emu_t *emu, uintptr_t fnc); +void iFppipip_32(x64emu_t *emu, uintptr_t fnc); +void iFppippi_32(x64emu_t *emu, uintptr_t fnc); +void iFppuIII_32(x64emu_t *emu, uintptr_t fnc); +void iFppulll_32(x64emu_t *emu, uintptr_t fnc); +void iFpppuuu_32(x64emu_t *emu, uintptr_t fnc); +void iFpppupu_32(x64emu_t *emu, uintptr_t fnc); +void iFpppppp_32(x64emu_t *emu, uintptr_t fnc); +void iFpppppS_32(x64emu_t *emu, uintptr_t fnc); +void iFXiiiii_32(x64emu_t *emu, uintptr_t fnc); +void iFXiiLip_32(x64emu_t *emu, uintptr_t fnc); +void iFXiippp_32(x64emu_t *emu, uintptr_t fnc); +void iFXuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void iFXLiiiL_32(x64emu_t *emu, uintptr_t fnc); +void iFXLiiip_32(x64emu_t *emu, uintptr_t fnc); +void iFXLiiuu_32(x64emu_t *emu, uintptr_t fnc); +void iFXLuupp_32(x64emu_t *emu, uintptr_t fnc); +void iFXLupip_32(x64emu_t *emu, uintptr_t fnc); +void iFXLLLLL_32(x64emu_t *emu, uintptr_t fnc); +void iFXLppii_32(x64emu_t *emu, uintptr_t fnc); +void iFXLpppp_32(x64emu_t *emu, uintptr_t fnc); +void iFXpIppp_32(x64emu_t *emu, uintptr_t fnc); +void iFXpuiii_32(x64emu_t *emu, uintptr_t fnc); +void iFXpLiWL_32(x64emu_t *emu, uintptr_t fnc); +void iFXpLLiL_32(x64emu_t *emu, uintptr_t fnc); +void iFXppppi_32(x64emu_t *emu, uintptr_t fnc); +void uFEpippi_32(x64emu_t *emu, uintptr_t fnc); +void uFupuufp_32(x64emu_t *emu, uintptr_t fnc); +void uFpppppp_32(x64emu_t *emu, uintptr_t fnc); +void lEipLipu_32(x64emu_t *emu, uintptr_t fnc); +void lEipLipp_32(x64emu_t *emu, uintptr_t fnc); +void pFEpiiuu_32(x64emu_t *emu, uintptr_t fnc); +void pEEpLLiN_32(x64emu_t *emu, uintptr_t fnc); +void pEEppLLp_32(x64emu_t *emu, uintptr_t fnc); +void pFEpnCWp_32(x64emu_t *emu, uintptr_t fnc); +void pFEXLLLp_32(x64emu_t *emu, uintptr_t fnc); +void pFEXLpii_32(x64emu_t *emu, uintptr_t fnc); +void pFEXpppp_32(x64emu_t *emu, uintptr_t fnc); +void pFWCiWCi_32(x64emu_t *emu, uintptr_t fnc); +void pFdddddd_32(x64emu_t *emu, uintptr_t fnc); +void pFLppppp_32(x64emu_t *emu, uintptr_t fnc); +void pFpiiiiu_32(x64emu_t *emu, uintptr_t fnc); +void pFpiipip_32(x64emu_t *emu, uintptr_t fnc); +void pFpiippp_32(x64emu_t *emu, uintptr_t fnc); +void pFpipipL_32(x64emu_t *emu, uintptr_t fnc); +void pFpipipp_32(x64emu_t *emu, uintptr_t fnc); +void pFpipuii_32(x64emu_t *emu, uintptr_t fnc); +void pFpuuupu_32(x64emu_t *emu, uintptr_t fnc); +void XFpppppp_32(x64emu_t *emu, uintptr_t fnc); +void iFpupupbL__32(x64emu_t *emu, uintptr_t fnc); +void iFpupbL_pp_32(x64emu_t *emu, uintptr_t fnc); +void iFppuupbL__32(x64emu_t *emu, uintptr_t fnc); +void iFppupbL_p_32(x64emu_t *emu, uintptr_t fnc); +void iFpppibp_p_32(x64emu_t *emu, uintptr_t fnc); +void iFpppppbp__32(x64emu_t *emu, uintptr_t fnc); +void iFpppbp_pp_32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_iuii_32(x64emu_t *emu, uintptr_t fnc); +void iFXibL_ppu_32(x64emu_t *emu, uintptr_t fnc); +void iFXLiiibL__32(x64emu_t *emu, uintptr_t fnc); +void iFXLLLLbL__32(x64emu_t *emu, uintptr_t fnc); +void iFXLbL_ipi_32(x64emu_t *emu, uintptr_t fnc); +void iFXbL_upip_32(x64emu_t *emu, uintptr_t fnc); +void pFEppibp_p_32(x64emu_t *emu, uintptr_t fnc); +void pEEppbL_Lp_32(x64emu_t *emu, uintptr_t fnc); +void iEEipuurLL__32(x64emu_t *emu, uintptr_t fnc); +void iEippprLL_p_32(x64emu_t *emu, uintptr_t fnc); +void iFupupLbpu__32(x64emu_t *emu, uintptr_t fnc); +void iFppppibpp__32(x64emu_t *emu, uintptr_t fnc); +void iFpppbpu_uu_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_uppu_32(x64emu_t *emu, uintptr_t fnc); +void iFbpu_pLpLp_32(x64emu_t *emu, uintptr_t fnc); +void iFpuuubupu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFppbL_pbL_p_32(x64emu_t *emu, uintptr_t fnc); +void iFppbp_pbp_p_32(x64emu_t *emu, uintptr_t fnc); +void iFpibp_pibpp__32(x64emu_t *emu, uintptr_t fnc); +void iFpuubpu_pbL__32(x64emu_t *emu, uintptr_t fnc); +void iFbpu_puupbL__32(x64emu_t *emu, uintptr_t fnc); +void iFpppbp_bp_bL__32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu_uuu_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu_upu_32(x64emu_t *emu, uintptr_t fnc); +void iFpbp_bp_bp_ii_32(x64emu_t *emu, uintptr_t fnc); +void iFrpuu_Lrpuu_Lui_32(x64emu_t *emu, uintptr_t fnc); +void iFXbLip_uubLip_L_32(x64emu_t *emu, uintptr_t fnc); +void vFbp_bppup_ippbp__32(x64emu_t *emu, uintptr_t fnc); +void iFpupbpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFpubpu_bpu_bpu_p_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu_bpu_uu_32(x64emu_t *emu, uintptr_t fnc); +void uFEppppbppuuuuup__32(x64emu_t *emu, uintptr_t fnc); +void iFpubpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFppbpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void vFEuuippp_32(x64emu_t *emu, uintptr_t fnc); +void vFEupupip_32(x64emu_t *emu, uintptr_t fnc); +void vFEppupui_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFiiuilil_32(x64emu_t *emu, uintptr_t fnc); +void vFiiffffp_32(x64emu_t *emu, uintptr_t fnc); +void vFiuulipi_32(x64emu_t *emu, uintptr_t fnc); +void vFiupuuup_32(x64emu_t *emu, uintptr_t fnc); +void vFilipliu_32(x64emu_t *emu, uintptr_t fnc); +void vFilulipi_32(x64emu_t *emu, uintptr_t fnc); +void vFCCCCfff_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiC_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiiC_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiuU_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuCiuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuiupiiu_32(x64emu_t *emu, uintptr_t fnc); +void vFuiupuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuipiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuipffff_32(x64emu_t *emu, uintptr_t fnc); +void vFuipdddd_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiC_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiCiui_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiCiuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuiiC_32(x64emu_t *emu, uintptr_t fnc); +void vFuuipppp_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuiiCp_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuiuil_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuiupi_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuulll_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuffff_32(x64emu_t *emu, uintptr_t fnc); +void vFuuudddd_32(x64emu_t *emu, uintptr_t fnc); +void vFuuffiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuddiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuulluup_32(x64emu_t *emu, uintptr_t fnc); +void vFuupiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuppppp_32(x64emu_t *emu, uintptr_t fnc); +void vFuffffff_32(x64emu_t *emu, uintptr_t fnc); +void vFudddddd_32(x64emu_t *emu, uintptr_t fnc); +void vFlliiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFpipipiu_32(x64emu_t *emu, uintptr_t fnc); +void vFpddiidd_32(x64emu_t *emu, uintptr_t fnc); +void vFpdddddd_32(x64emu_t *emu, uintptr_t fnc); +void vFXLiiiLi_32(x64emu_t *emu, uintptr_t fnc); +void vFXLiiipi_32(x64emu_t *emu, uintptr_t fnc); +void vFXLiiuui_32(x64emu_t *emu, uintptr_t fnc); +void vFXLLuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFXLppipi_32(x64emu_t *emu, uintptr_t fnc); +void vFXpiipii_32(x64emu_t *emu, uintptr_t fnc); +void vFXppiiii_32(x64emu_t *emu, uintptr_t fnc); +void iFElppppp_32(x64emu_t *emu, uintptr_t fnc); +void iEEpLiipp_32(x64emu_t *emu, uintptr_t fnc); +void iEEpLiipV_32(x64emu_t *emu, uintptr_t fnc); +void iEEpLiLpV_32(x64emu_t *emu, uintptr_t fnc); +void iFEpppipp_32(x64emu_t *emu, uintptr_t fnc); +void iFEpppupp_32(x64emu_t *emu, uintptr_t fnc); +void iEEpppppp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLpiiL_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLpppp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXppppp_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuuuii_32(x64emu_t *emu, uintptr_t fnc); +void iFippuIup_32(x64emu_t *emu, uintptr_t fnc); +void iFuiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void iFpiuuuiu_32(x64emu_t *emu, uintptr_t fnc); +void iFpWCiWCi_32(x64emu_t *emu, uintptr_t fnc); +void iEpupupui_32(x64emu_t *emu, uintptr_t fnc); +void iFpLpLpLp_32(x64emu_t *emu, uintptr_t fnc); +void iFpLppiip_32(x64emu_t *emu, uintptr_t fnc); +void iFppupipi_32(x64emu_t *emu, uintptr_t fnc); +void iFXiuLiii_32(x64emu_t *emu, uintptr_t fnc); +void iFXiLuupp_32(x64emu_t *emu, uintptr_t fnc); +void iFXLiiiiL_32(x64emu_t *emu, uintptr_t fnc); +void iFXLiiuui_32(x64emu_t *emu, uintptr_t fnc); +void iFXLpiiii_32(x64emu_t *emu, uintptr_t fnc); +void iFXLpiiuu_32(x64emu_t *emu, uintptr_t fnc); +void iFXLpiipi_32(x64emu_t *emu, uintptr_t fnc); +void iFXLppiii_32(x64emu_t *emu, uintptr_t fnc); +void iFXpiipii_32(x64emu_t *emu, uintptr_t fnc); +void iFXpLiWwL_32(x64emu_t *emu, uintptr_t fnc); +void iFXpLuuii_32(x64emu_t *emu, uintptr_t fnc); +void uFEpppppp_32(x64emu_t *emu, uintptr_t fnc); +void uFuippppp_32(x64emu_t *emu, uintptr_t fnc); +void uFpippppp_32(x64emu_t *emu, uintptr_t fnc); +void uFpuupppp_32(x64emu_t *emu, uintptr_t fnc); +void uFppppppp_32(x64emu_t *emu, uintptr_t fnc); +void lEEipLpLL_32(x64emu_t *emu, uintptr_t fnc); +void pFEpiiiiu_32(x64emu_t *emu, uintptr_t fnc); +void pFEpLiiii_32(x64emu_t *emu, uintptr_t fnc); +void pEEpLiiiI_32(x64emu_t *emu, uintptr_t fnc); +void pFEpLiiiI_32(x64emu_t *emu, uintptr_t fnc); +void pEEpLiiil_32(x64emu_t *emu, uintptr_t fnc); +void pFEpXppip_32(x64emu_t *emu, uintptr_t fnc); +void pFpipiupp_32(x64emu_t *emu, uintptr_t fnc); +void pFpuuupuu_32(x64emu_t *emu, uintptr_t fnc); +void pFppppiii_32(x64emu_t *emu, uintptr_t fnc); +void vFXLLiiibl__32(x64emu_t *emu, uintptr_t fnc); +void iFppppppbp__32(x64emu_t *emu, uintptr_t fnc); +void pFpiipipbp__32(x64emu_t *emu, uintptr_t fnc); +void iFppppubpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFXiLibiip_ip_32(x64emu_t *emu, uintptr_t fnc); +void iFXLibL_ubL_u_32(x64emu_t *emu, uintptr_t fnc); +void iFppibp_pibpp__32(x64emu_t *emu, uintptr_t fnc); +void iFXLpiibpiiL_i_32(x64emu_t *emu, uintptr_t fnc); +void iFppbupu_uubpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFppubpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void LFXLLuubLWWWcc_bLWWWcc__32(x64emu_t *emu, uintptr_t fnc); +void LFXLLbLWWWcc_bLWWWcc_uu_32(x64emu_t *emu, uintptr_t fnc); +void iFpubpu_bpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu_bpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void vFEXLpiipi_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiuuip_32(x64emu_t *emu, uintptr_t fnc); +void vFiilliilp_32(x64emu_t *emu, uintptr_t fnc); +void vFiupuiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFiupuuuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiiC_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiipiup_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiiuU_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiCuU_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuCCCCfff_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiiC_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiuupp_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuiiiC_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuiiiiu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuiuCil_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuipipp_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuufffff_32(x64emu_t *emu, uintptr_t fnc); +void vFffffffff_32(x64emu_t *emu, uintptr_t fnc); +void vFXiLLiipi_32(x64emu_t *emu, uintptr_t fnc); +void vFXiLpiiuu_32(x64emu_t *emu, uintptr_t fnc); +void vFXLiiiLii_32(x64emu_t *emu, uintptr_t fnc); +void vFXLLLiipi_32(x64emu_t *emu, uintptr_t fnc); +void vFXppuulll_32(x64emu_t *emu, uintptr_t fnc); +void iFEpippupp_32(x64emu_t *emu, uintptr_t fnc); +void iEEpippppp_32(x64emu_t *emu, uintptr_t fnc); +void iEEpLiLppp_32(x64emu_t *emu, uintptr_t fnc); +void iFEppipppp_32(x64emu_t *emu, uintptr_t fnc); +void iFiipppppp_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuCCuup_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuuupip_32(x64emu_t *emu, uintptr_t fnc); +void iFuiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void iFupipppip_32(x64emu_t *emu, uintptr_t fnc); +void iFpuuiiuuu_32(x64emu_t *emu, uintptr_t fnc); +void iFpLpiLpLp_32(x64emu_t *emu, uintptr_t fnc); +void iFXuupuupp_32(x64emu_t *emu, uintptr_t fnc); +void iFXLpipppp_32(x64emu_t *emu, uintptr_t fnc); +void iFXLppLpip_32(x64emu_t *emu, uintptr_t fnc); +void iFXpIIIppp_32(x64emu_t *emu, uintptr_t fnc); +void CFuiifpppp_32(x64emu_t *emu, uintptr_t fnc); +void uFuipppppp_32(x64emu_t *emu, uintptr_t fnc); +void uFuupuuiuf_32(x64emu_t *emu, uintptr_t fnc); +void uFulpppppp_32(x64emu_t *emu, uintptr_t fnc); +void LFEXLppuuu_32(x64emu_t *emu, uintptr_t fnc); +void LFXLpuuLLu_32(x64emu_t *emu, uintptr_t fnc); +void pFEppipipp_32(x64emu_t *emu, uintptr_t fnc); +void pFEXpLLppp_32(x64emu_t *emu, uintptr_t fnc); +void iFXLLiippBL__32(x64emu_t *emu, uintptr_t fnc); +void iFXLpppbL_pp_32(x64emu_t *emu, uintptr_t fnc); +void pFpuuuuupbp__32(x64emu_t *emu, uintptr_t fnc); +void iFppppubpu_Iu_32(x64emu_t *emu, uintptr_t fnc); +void iFpppbpu_ppuu_32(x64emu_t *emu, uintptr_t fnc); +void vFppibLdd_ipiu_32(x64emu_t *emu, uintptr_t fnc); +void iFpupbL_ppbL_p_32(x64emu_t *emu, uintptr_t fnc); +void iFpppibp_pbp_p_32(x64emu_t *emu, uintptr_t fnc); +void iFbpu_upppppbp__32(x64emu_t *emu, uintptr_t fnc); +void iFbp_ubp_ubp_uup_32(x64emu_t *emu, uintptr_t fnc); +void iFpubpu_bpu_bpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void vFEXLppiipi_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiiiill_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiillli_32(x64emu_t *emu, uintptr_t fnc); +void vFiiilllilp_32(x64emu_t *emu, uintptr_t fnc); +void vFiupuiuuup_32(x64emu_t *emu, uintptr_t fnc); +void vFiupuuuuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiiiC_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiiCuU_32(x64emu_t *emu, uintptr_t fnc); +void vFuiupuffup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiiiC_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuiiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuiiiiCp_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuuuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuupuuiuuf_32(x64emu_t *emu, uintptr_t fnc); +void vFuffffffff_32(x64emu_t *emu, uintptr_t fnc); +void vFffCCCCfff_32(x64emu_t *emu, uintptr_t fnc); +void vFddddddddd_32(x64emu_t *emu, uintptr_t fnc); +void vFXiLLpiipi_32(x64emu_t *emu, uintptr_t fnc); +void vFXLiiipiii_32(x64emu_t *emu, uintptr_t fnc); +void iFEpuippupp_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLLLiipi_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuuppppu_32(x64emu_t *emu, uintptr_t fnc); +void iFuiiuuiiip_32(x64emu_t *emu, uintptr_t fnc); +void iFuiiupiiup_32(x64emu_t *emu, uintptr_t fnc); +void iFdddpppppp_32(x64emu_t *emu, uintptr_t fnc); +void iFXuuuLiiip_32(x64emu_t *emu, uintptr_t fnc); +void iFXuuuLpppp_32(x64emu_t *emu, uintptr_t fnc); +void iFXLiuiiLLL_32(x64emu_t *emu, uintptr_t fnc); +void iFXLLiiuuii_32(x64emu_t *emu, uintptr_t fnc); +void iFXLpiiuuii_32(x64emu_t *emu, uintptr_t fnc); +void uFuulpiuiuf_32(x64emu_t *emu, uintptr_t fnc); +void LFXLiiiiiip_32(x64emu_t *emu, uintptr_t fnc); +void LFXLiiuuuLL_32(x64emu_t *emu, uintptr_t fnc); +void pFEuiiiuuuu_32(x64emu_t *emu, uintptr_t fnc); +void pFEpnCuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void pFEXLiiuuLi_32(x64emu_t *emu, uintptr_t fnc); +void pFpiiiiuuuu_32(x64emu_t *emu, uintptr_t fnc); +void iFXLbL_pppppp_32(x64emu_t *emu, uintptr_t fnc); +void iFXiLiiibiip_ip_32(x64emu_t *emu, uintptr_t fnc); +void iFXiLLLiiibiip__32(x64emu_t *emu, uintptr_t fnc); +void iFXLbL_bL_ppppp_32(x64emu_t *emu, uintptr_t fnc); +void iFuuppuubpu_bpu_u_32(x64emu_t *emu, uintptr_t fnc); +void iFpuuuuuubpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void iFpuupbpu_ubpu_uu_32(x64emu_t *emu, uintptr_t fnc); +void pFEXbpLiLLLii_uippuu_32(x64emu_t *emu, uintptr_t fnc); +void vFXiLLrLiiwwwwwwwwL_iipi_32(x64emu_t *emu, uintptr_t fnc); +void iFpbpu_bpu_bpu_bpu_bpu_bpu_bpu_bpu__32(x64emu_t *emu, uintptr_t fnc); +void vFEXLpppippp_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiiiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiiiiiui_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiiiiiuu_32(x64emu_t *emu, uintptr_t fnc); +void vFiiillliiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiiuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiuiiiiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuuuuuCCC_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuuuuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuupuiupuuf_32(x64emu_t *emu, uintptr_t fnc); +void vFuffiiffiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuddiiddiip_32(x64emu_t *emu, uintptr_t fnc); +void vFffffffffff_32(x64emu_t *emu, uintptr_t fnc); +void vFppipipippi_32(x64emu_t *emu, uintptr_t fnc); +void iFEppippippp_32(x64emu_t *emu, uintptr_t fnc); +void iFEppppppppu_32(x64emu_t *emu, uintptr_t fnc); +void iFEXpLiipiiL_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuupppppu_32(x64emu_t *emu, uintptr_t fnc); +void iFuiiiuuiiip_32(x64emu_t *emu, uintptr_t fnc); +void iFppuuiiuuuu_32(x64emu_t *emu, uintptr_t fnc); +void iFXiLLdduudd_32(x64emu_t *emu, uintptr_t fnc); +void iFXuuLiuiiLL_32(x64emu_t *emu, uintptr_t fnc); +void iFXLLpiiuuii_32(x64emu_t *emu, uintptr_t fnc); +void pFEpiiiiuuuu_32(x64emu_t *emu, uintptr_t fnc); +void pFEpnCuuuCup_32(x64emu_t *emu, uintptr_t fnc); +void pFXpuiipuuii_32(x64emu_t *emu, uintptr_t fnc); +void iFppLpLLpLpbL__32(x64emu_t *emu, uintptr_t fnc); +void iFXiiLiiibiip_ip_32(x64emu_t *emu, uintptr_t fnc); +void iFXiLLiiibiip_ip_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiillliip_32(x64emu_t *emu, uintptr_t fnc); +void vFiiiiilllilp_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiiiuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiillliip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiuiiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuupupppppp_32(x64emu_t *emu, uintptr_t fnc); +void vFuuffiiffiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuufffffffff_32(x64emu_t *emu, uintptr_t fnc); +void vFuuddiiddiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuUuuuuuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuffffffffff_32(x64emu_t *emu, uintptr_t fnc); +void vFUufffffffff_32(x64emu_t *emu, uintptr_t fnc); +void vFpiiiiiiiiuu_32(x64emu_t *emu, uintptr_t fnc); +void vFpipipiipiiu_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLppiiiiuu_32(x64emu_t *emu, uintptr_t fnc); +void iFEXpLLiiLWpi_32(x64emu_t *emu, uintptr_t fnc); +void iFuiiiiuuiiip_32(x64emu_t *emu, uintptr_t fnc); +void iFuppipipippi_32(x64emu_t *emu, uintptr_t fnc); +void iFXLLpiiuuiiL_32(x64emu_t *emu, uintptr_t fnc); +void pFEXpuiipuuii_32(x64emu_t *emu, uintptr_t fnc); +void iFXiiLLiiibiip_ip_32(x64emu_t *emu, uintptr_t fnc); +void iFXLibL_iiiibL_bL_bL__32(x64emu_t *emu, uintptr_t fnc); +void vFXiLLrLiiwwwwwwwwL_iiiipi_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiiiiuUC_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiiiuuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiiiiiuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiiiiuip_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuuuuuuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFffffffffffff_32(x64emu_t *emu, uintptr_t fnc); +void vFXiLLpiiiipii_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLppiiiiuui_32(x64emu_t *emu, uintptr_t fnc); +void iFXLpppppppppp_32(x64emu_t *emu, uintptr_t fnc); +void pFEXLiiuuLipii_32(x64emu_t *emu, uintptr_t fnc); +void iFXiLbL_bL_ppppbip_pp_32(x64emu_t *emu, uintptr_t fnc); +void iFXiLlliLBL_pBL_BL_bp__32(x64emu_t *emu, uintptr_t fnc); +void vFXiLLrLiiwwwwwwwwL_Liiiipi_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiiiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuuuuuuuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuUuuuuuuuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void vFuffffffffffff_32(x64emu_t *emu, uintptr_t fnc); +void vFXiLLLiiiiiiuu_32(x64emu_t *emu, uintptr_t fnc); +void iFEXLLlliLppppp_32(x64emu_t *emu, uintptr_t fnc); +void iFiuuuuiiuuuuuu_32(x64emu_t *emu, uintptr_t fnc); +void iFddddpppddpppp_32(x64emu_t *emu, uintptr_t fnc); +void iFXippuuuiipppp_32(x64emu_t *emu, uintptr_t fnc); +void uFippuuuulllipp_32(x64emu_t *emu, uintptr_t fnc); +void LFEXLiiuuuiupLp_32(x64emu_t *emu, uintptr_t fnc); +void iFXLLlliiLBL_pBL_BL_Bp__32(x64emu_t *emu, uintptr_t fnc); +void vFuffiiffiiffiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuddiiddiiddiip_32(x64emu_t *emu, uintptr_t fnc); +void vFuiiiiiuiiiiilll_32(x64emu_t *emu, uintptr_t fnc); +void vFuuiiiiuuiiiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFfffffffffffffff_32(x64emu_t *emu, uintptr_t fnc); +void iFpppppppppppppppp_32(x64emu_t *emu, uintptr_t fnc); +void pFEppnCuuwwWWWWuup_32(x64emu_t *emu, uintptr_t fnc); +void vFuuuuiiiiuuiiiiiii_32(x64emu_t *emu, uintptr_t fnc); +void vFXpuiiiiipuiiiiiiii_32(x64emu_t *emu, uintptr_t fnc); +void uFippuuuuiiiiuuiiiiiiiipp_32(x64emu_t *emu, uintptr_t fnc); + +#if defined(HAVE_LD80BITS) +void DED_32(x64emu_t *emu, uintptr_t fnc); +void DFDi_32(x64emu_t *emu, uintptr_t fnc); +void DEDD_32(x64emu_t *emu, uintptr_t fnc); +void DFDp_32(x64emu_t *emu, uintptr_t fnc); +void DEDp_32(x64emu_t *emu, uintptr_t fnc); +void DEpBp_a_32(x64emu_t *emu, uintptr_t fnc); +#endif + +#if !defined(HAVE_LD80BITS) +void KEK_32(x64emu_t *emu, uintptr_t fnc); +void KFKi_32(x64emu_t *emu, uintptr_t fnc); +void KEKK_32(x64emu_t *emu, uintptr_t fnc); +void KFKp_32(x64emu_t *emu, uintptr_t fnc); +void KEKp_32(x64emu_t *emu, uintptr_t fnc); +void KEpBp_a_32(x64emu_t *emu, uintptr_t fnc); +#endif + +#if defined(WINLATOR_GLIBC) +void pEipi_32(x64emu_t *emu, uintptr_t fnc); +#endif + +#if !defined(WINLATOR_GLIBC) +void pEEipi_32(x64emu_t *emu, uintptr_t fnc); +#endif + +void UEsvvs_32(x64emu_t *emu, uintptr_t fnc); +#endif // __WRAPPER32_H_ diff --git a/src/wrapped32/wrappedblkid.c b/src/wrapped32/wrappedblkid.c new file mode 100644 index 0000000..29b9f0a --- /dev/null +++ b/src/wrapped32/wrappedblkid.c @@ -0,0 +1,19 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "box32context.h" + +static const char* blkidName = "libblkid.so.1"; +#define LIBNAME blkid + +#include "wrappedlib_init32.h" + diff --git a/src/wrapped32/wrappedblkid_private.h b/src/wrapped32/wrappedblkid_private.h new file mode 100644 index 0000000..93584f9 --- /dev/null +++ b/src/wrapped32/wrappedblkid_private.h @@ -0,0 +1,115 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(blkid_dev_devname, pFp) +GO(blkid_dev_has_tag, iFppp) +GO(blkid_dev_iterate_begin, pFp) +GO(blkid_dev_iterate_end, vFp) +GO(blkid_dev_next, iFpbp_) +GO(blkid_devno_to_devname, pFU) +GO(blkid_devno_to_wholedisk, iFUpLp) +GO(blkid_dev_set_search, iFppp) +GO(blkid_do_fullprobe, iFp) +GO(blkid_do_probe, iFp) +GO(blkid_do_safeprobe, iFp) +GO(blkid_do_wipe, iFpi) +GO(blkid_encode_string, iFppL) +GO(blkid_evaluate_spec, pFpbp_) +GO(blkid_evaluate_tag, pFppbp_) +GO(blkid_find_dev_with_tag, pFppp) +GO(blkid_free_probe, vFp) +GO(blkid_gc_cache, vFp) +GO(blkid_get_cache, iFbp_p) +GO(blkid_get_dev, pFppi) +GO(blkid_get_devname, pFppp) +GO(blkid_get_dev_size, IFi) +GO(blkid_get_library_version, iFbp_bp_) +GO(blkid_get_tag_value, pFppp) +GO(blkid_init_debug, vFi) +GO(blkid_known_fstype, iFp) +GO(blkid_known_pttype, iFp) +GO(blkid_new_probe, pFv) +GO(blkid_new_probe_from_filename, pFp) +GO(blkid_parse_tag_string, iFpbp_bp_) +GO(blkid_parse_version_string, iFp) +GO(blkid_partition_get_flags, UFp) +GO(blkid_partition_get_name, pFp) +GO(blkid_partition_get_partno, iFp) +GO(blkid_partition_get_size, IFp) +GO(blkid_partition_get_start, IFp) +GO(blkid_partition_get_table, pFp) +GO(blkid_partition_get_type, iFp) +GO(blkid_partition_get_type_string, pFp) +GO(blkid_partition_get_uuid, pFp) +GO(blkid_partition_is_extended, iFp) +GO(blkid_partition_is_logical, iFp) +GO(blkid_partition_is_primary, iFp) +GO(blkid_partitions_get_name, iFLbp_) +GO(blkid_partlist_devno_to_partition, pFpU) +GO(blkid_partlist_get_partition, pFpi) +GO(blkid_partlist_get_partition_by_partno, pFpi) +GO(blkid_partlist_get_table, pFp) +GO(blkid_partlist_numof_partitions, iFp) +GO(blkid_parttable_get_id, pFp) +GO(blkid_parttable_get_offset, IFp) +GO(blkid_parttable_get_parent, pFp) +GO(blkid_parttable_get_type, pFp) +GO(blkid_probe_all, iFp) +GO(blkid_probe_all_new, iFp) +GO(blkid_probe_all_removable, iFp) +GO(blkid_probe_enable_partitions, iFpi) +GO(blkid_probe_enable_superblocks, iFpi) +GO(blkid_probe_enable_topology, iFpi) +GO(blkid_probe_filter_partitions_type, iFpibp_) +GO(blkid_probe_filter_superblocks_type, iFpibp_) +GO(blkid_probe_filter_superblocks_usage, iFpii) +GO(blkid_probe_filter_types, iFpibp_) +GO(blkid_probe_filter_usage, iFpii) +GO(blkid_probe_get_devno, UFp) +GO(blkid_probe_get_fd, iFp) +GO(blkid_probe_get_offset, IFp) +GO(blkid_probe_get_partitions, pFp) +GO(blkid_probe_get_sectors, IFp) +GO(blkid_probe_get_sectorsize, uFp) +GO(blkid_probe_get_size, IFp) +GO(blkid_probe_get_topology, pFp) +GO(blkid_probe_get_value, iFpibp_bp_bL_) +GO(blkid_probe_get_wholedisk_devno, UFp) +GO(blkid_probe_has_value, iFpp) +GO(blkid_probe_hide_range, iFpUU) +GO(blkid_probe_invert_filter, iFp) +GO(blkid_probe_invert_partitions_filter, iFp) +GO(blkid_probe_invert_superblocks_filter, iFp) +GO(blkid_probe_is_wholedisk, iFp) +GO(blkid_probe_lookup_value, iFppbp_bL_) +GO(blkid_probe_numof_values, iFp) +GO(blkid_probe_reset_buffers, iFp) +GO(blkid_probe_reset_filter, iFp) +GO(blkid_probe_reset_hints, vFp) +GO(blkid_probe_reset_partitions_filter, iFp) +GO(blkid_probe_reset_superblocks_filter, iFp) +GO(blkid_probe_set_device, iFpiII) +GO(blkid_probe_set_hint, iFppU) +GO(blkid_probe_set_partitions_flags, iFpi) +GO(blkid_probe_set_request, iFpi) +GO(blkid_probe_set_sectorsize, iFpu) +GO(blkid_probe_set_superblocks_flags, iFpi) +GO(blkid_probe_step_back, iFp) +GO(blkid_put_cache, vFp) +GO(blkid_reset_probe, vFp) +GO(blkid_safe_string, iFppL) +GO(blkid_send_uevent, iFpp) +GO(blkid_superblocks_get_name, iFLbp_p) +GO(blkid_tag_iterate_begin, pFp) +GO(blkid_tag_iterate_end, vFp) +GO(blkid_tag_next, iFpbp_bp_) +GO(blkid_topology_get_alignment_offset, LFp) +GO(blkid_topology_get_dax, LFp) +GO(blkid_topology_get_diskseq, UFp) +GO(blkid_topology_get_logical_sector_size, LFp) +GO(blkid_topology_get_minimum_io_size, LFp) +GO(blkid_topology_get_optimal_io_size, LFp) +GO(blkid_topology_get_physical_sector_size, LFp) +GO(blkid_verify, pFpp) +GO(blkid_wipe_all, iFp) diff --git a/src/wrapped32/wrappedcairo.c b/src/wrapped32/wrappedcairo.c new file mode 100644 index 0000000..65bab43 --- /dev/null +++ b/src/wrapped32/wrappedcairo.c @@ -0,0 +1,137 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "converter32.h" +#include "libtools/my_x11_conv.h" + +static const char* cairoName = "libcairo.so.2"; +#define LIBNAME cairo + +#include "generated/wrappedcairotypes32.h" + +#include "wrappercallback32.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// destroy ... +#define GO(A) \ +static uintptr_t my_destroy_fct_##A = 0; \ +static void my_destroy_##A(void* a) \ +{ \ + RunFunctionFmt(my_destroy_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* find_destroy_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_destroy_fct_##A == (uintptr_t)fct) return my_destroy_##A; + SUPER() + #undef GO + #define GO(A) if(my_destroy_fct_##A == 0) {my_destroy_fct_##A = (uintptr_t)fct; return my_destroy_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for cairo destroy callback\n"); + return NULL; +} +static void* reverse_destroy_Fct(void* fct) +{ + if(!fct) return fct; + if(CheckBridged(my_lib->w.bridge, fct)) + return (void*)CheckBridged(my_lib->w.bridge, fct); + #define GO(A) if(my_destroy_##A == fct) return (void*)my_destroy_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(my_lib->w.bridge, vFp_32, fct, 0, NULL); +} +// cairo_write_func ... +#define GO(A) \ +static uintptr_t my_cairo_write_func_fct_##A = 0; \ +static uint32_t my_cairo_write_func_##A(void* a, void* b, uint32_t c) \ +{ \ + return RunFunctionFmt(my_cairo_write_func_fct_##A, "ppu", a, b, c); \ +} +SUPER() +#undef GO +static void* find_cairo_write_func_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_cairo_write_func_fct_##A == (uintptr_t)fct) return my_cairo_write_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_cairo_write_func_fct_##A == 0) {my_cairo_write_func_fct_##A = (uintptr_t)fct; return my_cairo_write_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for cairo cairo_write_func callback\n"); + return NULL; +} +#undef SUPER + +EXPORT void* my32_cairo_xcb_device_get_connection(x64emu_t* emu, void* a) +{ + return add_xcb_connection32(my->cairo_xcb_device_get_connection(a)); +} + +EXPORT uint32_t my32_cairo_surface_set_user_data(x64emu_t* emu, void* surf, void* key, void* data, void* d) +{ + return my->cairo_surface_set_user_data(surf, key, data, find_destroy_Fct(d)); +} + +EXPORT uint32_t my32_cairo_set_user_data(x64emu_t* emu, void* cr, void* key, void* data, void* d) +{ + return my->cairo_set_user_data(cr, key, data, find_destroy_Fct(d)); +} + +void inplace_FT_FaceRec_shrink(void* a); +EXPORT void* my32_cairo_ft_scaled_font_lock_face(x64emu_t* emu, void* font) +{ + void* ret = my->cairo_ft_scaled_font_lock_face(font); + inplace_FT_FaceRec_shrink(ret); + return ret; +} + +EXPORT void* my32_cairo_pdf_surface_create_for_stream(x64emu_t* emu, void* f, void* closure, double width, double height) +{ + return my->cairo_pdf_surface_create_for_stream(find_cairo_write_func_Fct(f), closure, width, height); +} + +EXPORT uint32_t my32_cairo_pattern_set_user_data(x64emu_t* emu, void* pat, void* key, void* data, void* d) +{ + return my->cairo_pattern_set_user_data(pat, key, data, find_destroy_Fct(d)); +} + +EXPORT void* my32_cairo_xlib_surface_create(x64emu_t* emu, void* dpy, XID d, void* vis, int w, int h) +{ + return my->cairo_xlib_surface_create(dpy, d, convert_Visual_to_64(dpy, vis), w, h); +} + +EXPORT void* my32_cairo_xlib_surface_create_for_bitmap(x64emu_t* emu, void* dpy, XID d, void* screen, int w, int h) +{ + + return my->cairo_xlib_surface_create_for_bitmap(dpy, d, getScreen64(dpy, screen), w, h); +} + +#include "wrappedlib_init32.h" \ No newline at end of file diff --git a/src/wrapped32/wrappedcairo_private.h b/src/wrapped32/wrappedcairo_private.h new file mode 100644 index 0000000..6dd05e8 --- /dev/null +++ b/src/wrapped32/wrappedcairo_private.h @@ -0,0 +1,399 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(cairo_append_path, vFpbupi_) +GO(cairo_arc, vFpddddd) +GO(cairo_arc_negative, vFpddddd) +GO(cairo_clip, vFp) +GO(cairo_clip_extents, vFppppp) +GO(cairo_clip_preserve, vFp) +GO(cairo_close_path, vFp) +//GOM(cairo_copy_clip_rectangle_list, pFEp) +GO(cairo_copy_page, vFp) +//GOM(cairo_copy_path, pFEp) +//GOM(cairo_copy_path_flat, pFEp) +GO(cairo_create, pFp) +GO(cairo_curve_to, vFpdddddd) +GO(cairo_debug_reset_static_data, vFv) +GO(cairo_destroy, vFp) +GO(cairo_device_acquire, uFp) +GO(cairo_device_destroy, vFp) +GO(cairo_device_finish, vFp) +GO(cairo_device_flush, vFp) +GO(cairo_device_get_reference_count, uFp) +GO(cairo_device_get_type, iFp) +GO(cairo_device_get_user_data, pFpp) +GO(cairo_device_observer_elapsed, dFp) +GO(cairo_device_observer_fill_elapsed, dFp) +GO(cairo_device_observer_glyphs_elapsed, dFp) +GO(cairo_device_observer_mask_elapsed, dFp) +GO(cairo_device_observer_paint_elapsed, dFp) +//GOM(cairo_device_observer_print, uFEppp) +GO(cairo_device_observer_stroke_elapsed, dFp) +GO(cairo_device_reference, pFp) +GO(cairo_device_release, vFp) +//GOM(cairo_device_set_user_data, uFEpppp) +GO(cairo_device_status, uFp) +GO(cairo_device_to_user, vFppp) +GO(cairo_device_to_user_distance, vFppp) +GO(cairo_fill, vFp) +GO(cairo_fill_extents, vFppppp) +GO(cairo_fill_preserve, vFp) +GO(cairo_font_extents, vFpp) +GO(cairo_font_face_destroy, vFp) +GO(cairo_font_face_get_reference_count, uFp) +GO(cairo_font_face_get_type, uFp) +GO(cairo_font_face_get_user_data, pFpp) +GO(cairo_font_face_reference, pFp) +//GOM(cairo_font_face_set_user_data, uFEpppp) +GO(cairo_font_face_status, uFp) +GO(cairo_font_options_copy, pFp) +GO(cairo_font_options_create, pFv) +GO(cairo_font_options_destroy, vFp) +GO(cairo_font_options_equal, iFpp) +GO(cairo_font_options_get_antialias, uFp) +GO(cairo_font_options_get_hint_metrics, uFp) +GO(cairo_font_options_get_hint_style, uFp) +GO(cairo_font_options_get_subpixel_order, uFp) +GO(cairo_font_options_hash, LFp) +GO(cairo_font_options_merge, vFpp) +GO(cairo_font_options_set_antialias, vFpu) +GO(cairo_font_options_set_hint_metrics, vFpu) +GO(cairo_font_options_set_hint_style, vFpu) +GO(cairo_font_options_set_subpixel_order, vFpu) +GO(cairo_font_options_status, uFp) +GO(cairo_format_stride_for_width, iFii) +//GO(cairo_ft_font_face_create_for_ft_face, pFpi) +GO(cairo_ft_font_face_create_for_pattern, pFp) // have an FcPattern in arg +//GO(cairo_ft_font_face_get_synthesize, uFp) +//GO(cairo_ft_font_face_set_synthesize, vFpu) +//GO(cairo_ft_font_face_unset_synthesize, vFpu) +GO(cairo_ft_font_options_substitute, vFpp) //have an FcPattern in 2nd arg +GOM(cairo_ft_scaled_font_lock_face, pFEp) +GO(cairo_ft_scaled_font_unlock_face, vFp) +GO(cairo_get_antialias, uFp) +GO(cairo_get_current_point, vFppp) +GO(cairo_get_dash, vFppp) +GO(cairo_get_dash_count, iFp) +GO(cairo_get_fill_rule, uFp) +GO(cairo_get_font_face, pFp) +GO(cairo_get_font_matrix, vFpp) +GO(cairo_get_font_options, vFpp) +GO(cairo_get_group_target, pFp) +GO(cairo_get_line_cap, uFp) +GO(cairo_get_line_join, uFp) +GO(cairo_get_line_width, dFp) +GO(cairo_get_matrix, vFpp) +GO(cairo_get_miter_limit, dFp) +GO(cairo_get_operator, uFp) +GO(cairo_get_reference_count, uFp) +GO(cairo_get_scaled_font, pFp) +GO(cairo_get_source, pFp) +GO(cairo_get_target, pFp) +GO(cairo_get_tolerance, dFp) +GO(cairo_get_user_data, pFpp) +//GOM(cairo_glyph_allocate, pFEi) +GO(cairo_glyph_extents, vFpbLdd_ip) +GO(cairo_glyph_free, vFbLdd_) +GO(cairo_glyph_path, vFpbLdd_i) +GO(cairo_has_current_point, iFp) +GO(cairo_identity_matrix, vFp) +GO(cairo_image_surface_create, pFiii) +GO(cairo_image_surface_create_for_data, pFpiiii) +GO(cairo_image_surface_create_from_png, pFp) +//GOM(cairo_image_surface_create_from_png_stream, pFEpp) +GO(cairo_image_surface_get_data, pFp) +GO(cairo_image_surface_get_format, iFp) +GO(cairo_image_surface_get_height, iFp) +GO(cairo_image_surface_get_stride, iFp) +GO(cairo_image_surface_get_width, iFp) +GO(cairo_in_clip, iFpdd) +GO(cairo_in_fill, iFpdd) +GO(cairo_in_stroke, iFpdd) +GO(cairo_line_to, vFpdd) +GO(cairo_mask, vFpp) +GO(cairo_mask_surface, vFppdd) +GO(cairo_matrix_init, vFpdddddd) +GO(cairo_matrix_init_identity, vFp) +GO(cairo_matrix_init_rotate, vFpd) +GO(cairo_matrix_init_scale, vFpdd) +GO(cairo_matrix_init_translate, vFpdd) +GO(cairo_matrix_invert, uFp) +GO(cairo_matrix_multiply, vFppp) +GO(cairo_matrix_rotate, vFpd) +GO(cairo_matrix_scale, vFpdd) +GO(cairo_matrix_transform_distance, vFppp) +GO(cairo_matrix_transform_point, vFppp) +GO(cairo_matrix_translate, vFpdd) +GO(cairo_mesh_pattern_begin_patch, vFp) +GO(cairo_mesh_pattern_curve_to, vFpdddddd) +GO(cairo_mesh_pattern_end_patch, vFp) +GO(cairo_mesh_pattern_get_control_point, uFpuupp) +GO(cairo_mesh_pattern_get_corner_color_rgba, uFpuupppp) +GO(cairo_mesh_pattern_get_patch_count, uFpp) +//GOM(cairo_mesh_pattern_get_path, pFEpu) +GO(cairo_mesh_pattern_line_to, vFpdd) +GO(cairo_mesh_pattern_move_to, vFpdd) +GO(cairo_mesh_pattern_set_control_point, vFpudd) +GO(cairo_mesh_pattern_set_corner_color_rgb, vFpuddd) +GO(cairo_mesh_pattern_set_corner_color_rgba, vFpudddd) +GO(cairo_move_to, vFpdd) +GO(cairo_new_path, vFp) +GO(cairo_new_sub_path, vFp) +GO(cairo_paint, vFp) +GO(cairo_paint_with_alpha, vFpd) +GO(cairo_path_destroy, vFbupi_) +GO(cairo_path_extents, vFppppp) +GO(cairo_pattern_add_color_stop_rgb, vFpdddd) +GO(cairo_pattern_add_color_stop_rgba, vFpddddd) +GO(cairo_pattern_create_for_surface, pFp) +GO(cairo_pattern_create_linear, pFdddd) +GO(cairo_pattern_create_mesh, pFv) +GO(cairo_pattern_create_radial, pFdddddd) +GO(cairo_pattern_create_raster_source, pFpuii) +GO(cairo_pattern_create_rgb, pFddd) +GO(cairo_pattern_create_rgba, pFdddd) +GO(cairo_pattern_destroy, vFp) +GO(cairo_pattern_get_color_stop_count, uFpp) +GO(cairo_pattern_get_color_stop_rgba, uFpippppp) +GO(cairo_pattern_get_extend, uFp) +GO(cairo_pattern_get_filter, uFp) +GO(cairo_pattern_get_linear_points, uFppppp) +GO(cairo_pattern_get_matrix, vFpp) +GO(cairo_pattern_get_radial_circles, uFppppppp) +GO(cairo_pattern_get_reference_count, uFp) +GO(cairo_pattern_get_rgba, uFppppp) +GO(cairo_pattern_get_surface, uFpbp_) +GO(cairo_pattern_get_type, uFp) +GO(cairo_pattern_get_user_data, pFpp) +GO(cairo_pattern_reference, pFp) +GO(cairo_pattern_set_extend, vFpu) +GO(cairo_pattern_set_filter, vFpu) +GO(cairo_pattern_set_matrix, vFpp) +GOM(cairo_pattern_set_user_data, uFEpppp) +GO(cairo_pattern_status, uFp) +//GO(cairo_pdf_get_versions, vFpp) +GO(cairo_pdf_surface_create, pFpdd) +GOM(cairo_pdf_surface_create_for_stream, pFEppdd) +//GO(cairo_pdf_surface_restrict_to_version, vFpu) +GO(cairo_pdf_surface_set_size, vFpdd) +//GO(cairo_pdf_version_to_string, pFu) +GO(cairo_pop_group, pFp) +GO(cairo_pop_group_to_source, vFp) +//GO(cairo_ps_get_levels, vFpp) +//GO(cairo_ps_level_to_string, pFu) +//GO(cairo_ps_surface_create, pFpdd) +//GO(cairo_ps_surface_create_for_stream, +GO(cairo_ps_surface_dsc_begin_page_setup, vFp) +//GO(cairo_ps_surface_dsc_begin_setup, +GO(cairo_ps_surface_dsc_comment, vFpp) +//GO(cairo_ps_surface_get_eps, iFp) +//GO(cairo_ps_surface_restrict_to_level, vFpu) +//GO(cairo_ps_surface_set_eps, vFpi) +GO(cairo_ps_surface_set_size, vFpdd) +GO(cairo_push_group, vFp) +GO(cairo_push_group_with_content, vFpu) +//GOM(cairo_raster_source_pattern_get_acquire, vFEpbp_bp_) +GO(cairo_raster_source_pattern_get_callback_data, pFp) +//GOM(cairo_raster_source_pattern_get_copy, pFEp) +//GOM(cairo_raster_source_pattern_get_finish, pFEp) +//GOM(cairo_raster_source_pattern_get_snapshot, pFEp) +//GOM(cairo_raster_source_pattern_set_acquire, vFEppp) +GO(cairo_raster_source_pattern_set_callback_data, vFpp) +//GOM(cairo_raster_source_pattern_set_copy, vFEpp) +//GOM(cairo_raster_source_pattern_set_finish, vFEpp) +//GOM(cairo_raster_source_pattern_set_snapshot, vFEpp) +GO(cairo_recording_surface_create, pFup) +GO(cairo_recording_surface_get_extents, iFpp) +GO(cairo_recording_surface_ink_extents, vFppppp) +GO(cairo_rectangle, vFpdddd) +GO(cairo_rectangle_list_destroy, vFbupi_) +GO(cairo_reference, pFp) +GO(cairo_region_contains_point, iFpii) +GO(cairo_region_contains_rectangle, uFpp) +GO(cairo_region_copy, pFp) +GO(cairo_region_create, pFv) +GO(cairo_region_create_rectangle, pFp) +GO(cairo_region_create_rectangles, pFpi) +GO(cairo_region_destroy, vFp) +GO(cairo_region_equal, iFpp) +GO(cairo_region_get_extents, vFpp) +GO(cairo_region_get_rectangle, vFpip) +GO(cairo_region_intersect, uFpp) +GO(cairo_region_intersect_rectangle, uFpp) +GO(cairo_region_is_empty, iFp) +GO(cairo_region_num_rectangles, iFp) +GO(cairo_region_reference, pFp) +GO(cairo_region_status, uFp) +GO(cairo_region_subtract, uFpp) +GO(cairo_region_subtract_rectangle, uFpp) +GO(cairo_region_translate, vFpii) +GO(cairo_region_union, uFpp) +GO(cairo_region_union_rectangle, uFpp) +GO(cairo_region_xor, uFpp) +GO(cairo_region_xor_rectangle, uFpp) +GO(cairo_rel_curve_to, vFpdddddd) +GO(cairo_rel_line_to, vFpdd) +GO(cairo_rel_move_to, vFpdd) +GO(cairo_reset_clip, vFp) +GO(cairo_restore, vFp) +GO(cairo_rotate, vFpd) +GO(cairo_save, vFp) +GO(cairo_scale, vFpdd) +GO(cairo_scaled_font_create, pFpppp) +GO(cairo_scaled_font_destroy, vFp) +GO(cairo_scaled_font_extents, vFpp) +GO(cairo_scaled_font_get_ctm, vFpp) +GO(cairo_scaled_font_get_font_face, pFp) +GO(cairo_scaled_font_get_font_matrix, vFpp) +GO(cairo_scaled_font_get_font_options, vFpp) +GO(cairo_scaled_font_get_reference_count, uFp) +GO(cairo_scaled_font_get_scale_matrix, vFpp) +GO(cairo_scaled_font_get_type, uFp) +GO(cairo_scaled_font_get_user_data, pFpp) +GO(cairo_scaled_font_glyph_extents, vFpbLdd_ip) +GO(cairo_scaled_font_reference, pFp) +//GOM(cairo_scaled_font_set_user_data, uFEpppp) +GO(cairo_scaled_font_status, uFp) +GO(cairo_scaled_font_text_extents, vFppp) +//GOM(cairo_scaled_font_text_to_glyphs, uFEpddpibp_pbp_pp) +//GO(cairo_script_create, pFp) +//GO(cairo_script_create_for_stream, +//GO(cairo_script_from_recording_surface, uFpp) +//GO(cairo_script_get_mode, uFp) +//GO(cairo_script_set_mode, vFpu) +//GO(cairo_script_surface_create, pFpudd) +//GO(cairo_script_surface_create_for_target, pFpp) +//GO(cairo_script_write_comment, vFppi) +GO(cairo_select_font_face, vFppuu) +GO(cairo_set_antialias, vFpu) +GO(cairo_set_dash, vFppid) +GO(cairo_set_fill_rule, vFpu) +GO(cairo_set_font_face, vFpp) +GO(cairo_set_font_matrix, vFpp) +GO(cairo_set_font_options, vFpp) +GO(cairo_set_font_size, vFpd) +GO(cairo_set_line_cap, vFpu) +GO(cairo_set_line_join, vFpu) +GO(cairo_set_line_width, vFpd) +GO(cairo_set_matrix, vFpp) +GO(cairo_set_miter_limit, vFpd) +GO(cairo_set_operator, vFpu) +GO(cairo_set_scaled_font, vFpp) +GO(cairo_set_source, vFpp) +GO(cairo_set_source_rgb, vFpddd) +GO(cairo_set_source_rgba, vFpdddd) +GO(cairo_set_source_surface, vFppdd) +GO(cairo_set_tolerance, vFpd) +GOM(cairo_set_user_data, uFEpppp) +GO(cairo_show_glyphs, vFpbLdd_i) +GO(cairo_show_page, vFp) +GO(cairo_show_text, vFpp) +GO(cairo_show_text_glyphs, vFppibLdd_ipiu) +GO(cairo_status, uFp) +GO(cairo_status_to_string, pFu) +GO(cairo_stroke, vFp) +GO(cairo_stroke_extents, vFppppp) +GO(cairo_stroke_preserve, vFp) +GO(cairo_surface_copy_page, vFp) +GO(cairo_surface_create_for_rectangle, pFpdddd) +GO(cairo_surface_create_observer, pFpu) +GO(cairo_surface_create_similar, pFpuii) +GO(cairo_surface_create_similar_image, pFpiii) +GO(cairo_surface_destroy, vFp) +GO(cairo_surface_finish, vFp) +GO(cairo_surface_flush, vFp) +GO(cairo_surface_get_content, uFp) +GO(cairo_surface_get_device, pFp) +GO(cairo_surface_get_device_offset, vFppp) +GO(cairo_surface_get_device_scale, vFppp) +GO(cairo_surface_get_fallback_resolution, vFppp) +GO(cairo_surface_get_font_options, vFpp) +GO(cairo_surface_get_mime_data, vFppbp_bL_) +GO(cairo_surface_get_reference_count, uFp) +GO(cairo_surface_get_type, uFp) +GO(cairo_surface_get_user_data, pFpp) +GO(cairo_surface_has_show_text_glyphs, iFp) +GO(cairo_surface_map_to_image, pFpp) +GO(cairo_surface_mark_dirty, vFp) +GO(cairo_surface_mark_dirty_rectangle, vFpiiii) +//GOM(cairo_surface_observer_add_fill_callback, uFEppp) +//GOM(cairo_surface_observer_add_finish_callback, uFEppp) +//GOM(cairo_surface_observer_add_flush_callback, uFEppp) +//GOM(cairo_surface_observer_add_glyphs_callback, uFEppp) +//GOM(cairo_surface_observer_add_mask_callback, uFEppp) +//GOM(cairo_surface_observer_add_paint_callback, uFEppp) +//GOM(cairo_surface_observer_add_stroke_callback, uFEppp) +GO(cairo_surface_observer_elapsed, dFp) +//GOM(cairo_surface_observer_print, uFEppp) +GO(cairo_surface_reference, pFp) +GO(cairo_surface_set_device_offset, vFpdd) +GO(cairo_surface_set_device_scale, vFpdd) +GO(cairo_surface_set_fallback_resolution, vFpdd) +//GOM(cairo_surface_set_mime_data, uFEpppLpp) +GOM(cairo_surface_set_user_data, uFEpppp) +GO(cairo_surface_show_page, vFp) +GO(cairo_surface_status, uFp) +GO(cairo_surface_supports_mime_type, iFpp) +GO(cairo_surface_unmap_image, vFpp) +GO(cairo_surface_write_to_png, uFpp) +//GOM(cairo_surface_write_to_png_stream, uFEppp) +//GO(cairo_svg_get_versions, vFpp) +//GO(cairo_svg_surface_create, pFpdd) +//GO(cairo_svg_surface_create_for_stream, +//GO(cairo_svg_surface_restrict_to_version, vFpu) +//GO(cairo_svg_version_to_string, pFu) +GO(cairo_text_cluster_allocate, pFi) +GO(cairo_text_cluster_free, vFp) +GO(cairo_text_extents, vFppp) +GO(cairo_text_path, vFpp) +GO(cairo_toy_font_face_create, pFpuu) +GO(cairo_toy_font_face_get_family, pFp) +GO(cairo_toy_font_face_get_slant, uFp) +GO(cairo_toy_font_face_get_weight, uFp) +GO(cairo_transform, vFpp) +GO(cairo_translate, vFpdd) +GO(cairo_user_font_face_create, pFv) +//GOM(cairo_user_font_face_get_init_func, pFEp) +//GOM(cairo_user_font_face_get_render_glyph_func, pFEp) +//GOM(cairo_user_font_face_get_text_to_glyphs_func, pFEp) +//GOM(cairo_user_font_face_get_unicode_to_glyph_func, pFEp) +//GOM(cairo_user_font_face_set_init_func, vFEpp) +//GOM(cairo_user_font_face_set_render_glyph_func, vFEpp) +//GOM(cairo_user_font_face_set_text_to_glyphs_func, vFEpp) +//GOM(cairo_user_font_face_set_unicode_to_glyph_func, vFEpp) +GO(cairo_user_to_device, vFppp) +GO(cairo_user_to_device_distance, vFppp) +GO(cairo_version, iFv) +GO(cairo_version_string, pFv) +//GO(cairo_xcb_device_debug_cap_xrender_version, vFpii) +//GO(cairo_xcb_device_debug_cap_xshm_version, +//GO(cairo_xcb_device_debug_get_precision, iFp) +//GO(cairo_xcb_device_debug_set_precision, vFpi) +GOM(cairo_xcb_device_get_connection, pFEp) +//GO(cairo_xcb_surface_create, pFbupii) +//GO(cairo_xcb_surface_create_for_bitmap, pFbpuii) +//GO(cairo_xcb_surface_create_with_xrender_format, pFbpupii) +//GO(cairo_xcb_surface_set_drawable, vFpuii) +//GO(cairo_xcb_surface_set_size, vFpii) +//GO(cairo_xlib_device_debug_cap_xrender_version, vFpii) +//GO(cairo_xlib_device_debug_get_precision, iFp) +//GO(cairo_xlib_device_debug_set_precision, vFpi) +GOM(cairo_xlib_surface_create, pFEXLpii) +GOM(cairo_xlib_surface_create_for_bitmap, pFEXLpii) +//GO(cairo_xlib_surface_create_with_xrender_format, pFpLppii) +//GO(cairo_xlib_surface_get_depth, +//GO(cairo_xlib_surface_get_display, pFp) +//GO(cairo_xlib_surface_get_drawable, LFp) +//GO(cairo_xlib_surface_get_height, iFp) +//GO(cairo_xlib_surface_get_screen, pFp) +//GO(cairo_xlib_surface_get_visual, +//GO(cairo_xlib_surface_get_width, +//GO(cairo_xlib_surface_get_xrender_format, pFp) +//GO(cairo_xlib_surface_set_drawable, vFpLii) +GO(cairo_xlib_surface_set_size, vFpii) +//GO(cairo_xml_create, +//GO(cairo_xml_create_for_stream, +//GO(cairo_xml_for_recording_surface, +//GO(cairo_xml_surface_create, diff --git a/src/wrapped32/wrappedcrashhandler.c b/src/wrapped32/wrappedcrashhandler.c new file mode 100755 index 0000000..430c5a5 --- /dev/null +++ b/src/wrapped32/wrappedcrashhandler.c @@ -0,0 +1,32 @@ +#define _GNU_SOURCE +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" + +static const char* crashhandlerName = "crashhandler.so"; +#define LIBNAME crashhandler + +#define PRE_INIT \ + if(!BOX64ENV(dummy_crashhandler)) \ + return -1; \ + if(1) \ + lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL);\ + else + + +#include "wrappedlib_init32.h" + diff --git a/src/wrapped32/wrappedcrashhandler_private.h b/src/wrapped32/wrappedcrashhandler_private.h new file mode 100755 index 0000000..52ed57d --- /dev/null +++ b/src/wrapped32/wrappedcrashhandler_private.h @@ -0,0 +1,49 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh.... +#endif + +//GO(Breakpad_SetSteamID, +//DATAB(__bss_start, +//GO(CreateInterface, +//DATAB(_edata, +//DATAB(_end, +//GO(_fini, +//GO(_init, +//GO(SteamRealPath, +//GO(__wrap_access, +//GO(__wrap_chmod, +//GO(__wrap_chown, +//GO(__wrap_dlmopen, +//GO(__wrap_dlopen, +//GO(__wrap_fopen, +//GO(__wrap_fopen64, +//GO(__wrap_freopen, +//GO(__wrap_lchown, +//GO(__wrap_link, +//GO(__wrap_lstat, +//GO(__wrap_lstat64, +//GO(__wrap___lxstat, +//GO(__wrap___lxstat64, +//GO(__wrap_mkdir, +//GO(__wrap_mkfifo, +//GO(__wrap_mknod, +//GO(__wrap_mount, +//GO(__wrap_open, +//GO(__wrap_open64, +//GO(__wrap_opendir, +//GO(__wrap_rename, +//GO(__wrap_rmdir, +//GO(__wrap_scandir, +//GO(__wrap_scandir64, +//GO(__wrap_stat, +//GO(__wrap_stat64, +//GO(__wrap_statfs, +//GO(__wrap_statfs64, +//GO(__wrap_statvfs, +//GO(__wrap_statvfs64, +//GO(__wrap_symlink, +//GO(__wrap_unlink, +//GO(__wrap_utime, +//GO(__wrap_utimes, +//GO(__wrap___xstat, +//GO(__wrap___xstat64, diff --git a/src/wrapped32/wrappedcurl.c b/src/wrapped32/wrappedcurl.c new file mode 100644 index 0000000..8175d6f --- /dev/null +++ b/src/wrapped32/wrappedcurl.c @@ -0,0 +1,946 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "debug.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "elfloader.h" + +static const char* curlName = "libcurl.so.4"; +#define ALTNAME "libcurl.so" + +#define ALTNAME2 "libcurl-gnutls.so.4" +#define LIBNAME curl + +#include "generated/wrappedcurltypes32.h" + +#include "wrappercallback32.h" + +#define LONG 0 +#define OBJECTPOINT 10000 +#define STRINGPOINT 10000 +#define FUNCTIONPOINT 20000 +#define OFF_T 30000 +#define BLOB 40000 +#define CINIT(name,type,number) CURLOPT_ ## name = type + number +#define CURLOPT(na,t,nu) na = t + nu + +typedef enum { + CINIT(WRITEDATA, OBJECTPOINT, 1), + CINIT(URL, STRINGPOINT, 2), + CINIT(PORT, LONG, 3), + CINIT(PROXY, STRINGPOINT, 4), + CINIT(USERPWD, STRINGPOINT, 5), + CINIT(PROXYUSERPWD, STRINGPOINT, 6), + CINIT(RANGE, STRINGPOINT, 7), + CINIT(READDATA, OBJECTPOINT, 9), + CINIT(ERRORBUFFER, OBJECTPOINT, 10), + CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11), + CINIT(READFUNCTION, FUNCTIONPOINT, 12), + CINIT(TIMEOUT, LONG, 13), + CINIT(INFILESIZE, LONG, 14), + CINIT(POSTFIELDS, OBJECTPOINT, 15), + CINIT(REFERER, STRINGPOINT, 16), + CINIT(FTPPORT, STRINGPOINT, 17), + CINIT(USERAGENT, STRINGPOINT, 18), + CINIT(LOW_SPEED_LIMIT, LONG, 19), + CINIT(LOW_SPEED_TIME, LONG, 20), + CINIT(RESUME_FROM, LONG, 21), + CINIT(COOKIE, STRINGPOINT, 22), + CINIT(HTTPHEADER, OBJECTPOINT, 23), + CINIT(HTTPPOST, OBJECTPOINT, 24), + CINIT(SSLCERT, STRINGPOINT, 25), + CINIT(KEYPASSWD, STRINGPOINT, 26), + CINIT(CRLF, LONG, 27), + CINIT(QUOTE, OBJECTPOINT, 28), + CINIT(HEADERDATA, OBJECTPOINT, 29), + CINIT(COOKIEFILE, STRINGPOINT, 31), + CINIT(SSLVERSION, LONG, 32), + CINIT(TIMECONDITION, LONG, 33), + CINIT(TIMEVALUE, LONG, 34), + CINIT(CUSTOMREQUEST, STRINGPOINT, 36), + CINIT(STDERR, OBJECTPOINT, 37), + CINIT(POSTQUOTE, OBJECTPOINT, 39), + CINIT(OBSOLETE40, OBJECTPOINT, 40), + CINIT(VERBOSE, LONG, 41), + CINIT(HEADER, LONG, 42), + CINIT(NOPROGRESS, LONG, 43), + CINIT(NOBODY, LONG, 44), + CINIT(FAILONERROR, LONG, 45), + CINIT(UPLOAD, LONG, 46), + CINIT(POST, LONG, 47), + CINIT(DIRLISTONLY, LONG, 48), + CINIT(APPEND, LONG, 50), + CINIT(NETRC, LONG, 51), + CINIT(FOLLOWLOCATION, LONG, 52), + CINIT(TRANSFERTEXT, LONG, 53), + CINIT(PUT, LONG, 54), + CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), + CINIT(PROGRESSDATA, OBJECTPOINT, 57), +#define CURLOPT_XFERINFODATA CURLOPT_PROGRESSDATA + CINIT(AUTOREFERER, LONG, 58), + CINIT(PROXYPORT, LONG, 59), + CINIT(POSTFIELDSIZE, LONG, 60), + CINIT(HTTPPROXYTUNNEL, LONG, 61), + CINIT(INTERFACE, STRINGPOINT, 62), + CINIT(KRBLEVEL, STRINGPOINT, 63), + CINIT(SSL_VERIFYPEER, LONG, 64), + CINIT(CAINFO, STRINGPOINT, 65), + CINIT(MAXREDIRS, LONG, 68), + CINIT(FILETIME, LONG, 69), + CINIT(TELNETOPTIONS, OBJECTPOINT, 70), + CINIT(MAXCONNECTS, LONG, 71), + CINIT(OBSOLETE72, LONG, 72), + CINIT(FRESH_CONNECT, LONG, 74), + CINIT(FORBID_REUSE, LONG, 75), + CINIT(RANDOM_FILE, STRINGPOINT, 76), + CINIT(EGDSOCKET, STRINGPOINT, 77), + CINIT(CONNECTTIMEOUT, LONG, 78), + CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79), + CINIT(HTTPGET, LONG, 80), + CINIT(SSL_VERIFYHOST, LONG, 81), + CINIT(COOKIEJAR, STRINGPOINT, 82), + CINIT(SSL_CIPHER_LIST, STRINGPOINT, 83), + CINIT(HTTP_VERSION, LONG, 84), + CINIT(FTP_USE_EPSV, LONG, 85), + CINIT(SSLCERTTYPE, STRINGPOINT, 86), + CINIT(SSLKEY, STRINGPOINT, 87), + CINIT(SSLKEYTYPE, STRINGPOINT, 88), + CINIT(SSLENGINE, STRINGPOINT, 89), + CINIT(SSLENGINE_DEFAULT, LONG, 90), + CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), + CINIT(DNS_CACHE_TIMEOUT, LONG, 92), + CINIT(PREQUOTE, OBJECTPOINT, 93), + CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94), + CINIT(DEBUGDATA, OBJECTPOINT, 95), + CINIT(COOKIESESSION, LONG, 96), + CINIT(CAPATH, STRINGPOINT, 97), + CINIT(BUFFERSIZE, LONG, 98), + CINIT(NOSIGNAL, LONG, 99), + CINIT(SHARE, OBJECTPOINT, 100), + CINIT(PROXYTYPE, LONG, 101), + CINIT(ACCEPT_ENCODING, STRINGPOINT, 102), + CINIT(PRIVATE, OBJECTPOINT, 103), + CINIT(HTTP200ALIASES, OBJECTPOINT, 104), + CINIT(UNRESTRICTED_AUTH, LONG, 105), + CINIT(FTP_USE_EPRT, LONG, 106), + CINIT(HTTPAUTH, LONG, 107), + CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108), + CINIT(SSL_CTX_DATA, OBJECTPOINT, 109), + CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110), + CINIT(PROXYAUTH, LONG, 111), + CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112), +#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT + CINIT(IPRESOLVE, LONG, 113), + CINIT(MAXFILESIZE, LONG, 114), + CINIT(INFILESIZE_LARGE, OFF_T, 115), + CINIT(RESUME_FROM_LARGE, OFF_T, 116), + CINIT(MAXFILESIZE_LARGE, OFF_T, 117), + CINIT(NETRC_FILE, STRINGPOINT, 118), + CINIT(USE_SSL, LONG, 119), + CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120), + CINIT(TCP_NODELAY, LONG, 121), + CINIT(FTPSSLAUTH, LONG, 129), + CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130), + CINIT(IOCTLDATA, OBJECTPOINT, 131), + CINIT(FTP_ACCOUNT, STRINGPOINT, 134), + CINIT(COOKIELIST, STRINGPOINT, 135), + CINIT(IGNORE_CONTENT_LENGTH, LONG, 136), + CINIT(FTP_SKIP_PASV_IP, LONG, 137), + CINIT(FTP_FILEMETHOD, LONG, 138), + CINIT(LOCALPORT, LONG, 139), + CINIT(LOCALPORTRANGE, LONG, 140), + CINIT(CONNECT_ONLY, LONG, 141), + CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142), + CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143), + CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144), + CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145), + CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146), + CINIT(FTP_ALTERNATIVE_TO_USER, STRINGPOINT, 147), + CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148), + CINIT(SOCKOPTDATA, OBJECTPOINT, 149), + CINIT(SSL_SESSIONID_CACHE, LONG, 150), + CINIT(SSH_AUTH_TYPES, LONG, 151), + CINIT(SSH_PUBLIC_KEYFILE, STRINGPOINT, 152), + CINIT(SSH_PRIVATE_KEYFILE, STRINGPOINT, 153), + CINIT(FTP_SSL_CCC, LONG, 154), + CINIT(TIMEOUT_MS, LONG, 155), + CINIT(CONNECTTIMEOUT_MS, LONG, 156), + CINIT(HTTP_TRANSFER_DECODING, LONG, 157), + CINIT(HTTP_CONTENT_DECODING, LONG, 158), + CINIT(NEW_FILE_PERMS, LONG, 159), + CINIT(NEW_DIRECTORY_PERMS, LONG, 160), + CINIT(POSTREDIR, LONG, 161), + CINIT(SSH_HOST_PUBLIC_KEY_MD5, STRINGPOINT, 162), + CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163), + CINIT(OPENSOCKETDATA, OBJECTPOINT, 164), + CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165), + CINIT(PROXY_TRANSFER_MODE, LONG, 166), + CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167), + CINIT(SEEKDATA, OBJECTPOINT, 168), + CINIT(CRLFILE, STRINGPOINT, 169), + CINIT(ISSUERCERT, STRINGPOINT, 170), + CINIT(ADDRESS_SCOPE, LONG, 171), + CINIT(CERTINFO, LONG, 172), + CINIT(USERNAME, STRINGPOINT, 173), + CINIT(PASSWORD, STRINGPOINT, 174), + CINIT(PROXYUSERNAME, STRINGPOINT, 175), + CINIT(PROXYPASSWORD, STRINGPOINT, 176), + CINIT(NOPROXY, STRINGPOINT, 177), + CINIT(TFTP_BLKSIZE, LONG, 178), + CINIT(SOCKS5_GSSAPI_SERVICE, STRINGPOINT, 179), + CINIT(SOCKS5_GSSAPI_NEC, LONG, 180), + CINIT(PROTOCOLS, LONG, 181), + CINIT(REDIR_PROTOCOLS, LONG, 182), + CINIT(SSH_KNOWNHOSTS, STRINGPOINT, 183), + CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184), + CINIT(SSH_KEYDATA, OBJECTPOINT, 185), + CINIT(MAIL_FROM, STRINGPOINT, 186), + CINIT(MAIL_RCPT, OBJECTPOINT, 187), + CINIT(FTP_USE_PRET, LONG, 188), + CINIT(RTSP_REQUEST, LONG, 189), + CINIT(RTSP_SESSION_ID, STRINGPOINT, 190), + CINIT(RTSP_STREAM_URI, STRINGPOINT, 191), + CINIT(RTSP_TRANSPORT, STRINGPOINT, 192), + CINIT(RTSP_CLIENT_CSEQ, LONG, 193), + CINIT(RTSP_SERVER_CSEQ, LONG, 194), + CINIT(INTERLEAVEDATA, OBJECTPOINT, 195), + CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196), + CINIT(WILDCARDMATCH, LONG, 197), + CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198), + CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199), + CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200), + CINIT(CHUNK_DATA, OBJECTPOINT, 201), + CINIT(FNMATCH_DATA, OBJECTPOINT, 202), + CINIT(RESOLVE, OBJECTPOINT, 203), + CINIT(TLSAUTH_USERNAME, STRINGPOINT, 204), + CINIT(TLSAUTH_PASSWORD, STRINGPOINT, 205), + CINIT(TLSAUTH_TYPE, STRINGPOINT, 206), + CINIT(TRANSFER_ENCODING, LONG, 207), + CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208), + CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209), + CINIT(GSSAPI_DELEGATION, LONG, 210), + CINIT(DNS_SERVERS, STRINGPOINT, 211), + CINIT(ACCEPTTIMEOUT_MS, LONG, 212), + CINIT(TCP_KEEPALIVE, LONG, 213), + CINIT(TCP_KEEPIDLE, LONG, 214), + CINIT(TCP_KEEPINTVL, LONG, 215), + CINIT(SSL_OPTIONS, LONG, 216), + CINIT(MAIL_AUTH, STRINGPOINT, 217), + CINIT(SASL_IR, LONG, 218), + CINIT(XFERINFOFUNCTION, FUNCTIONPOINT, 219), + CINIT(XOAUTH2_BEARER, STRINGPOINT, 220), + CINIT(DNS_INTERFACE, STRINGPOINT, 221), + CINIT(DNS_LOCAL_IP4, STRINGPOINT, 222), + CINIT(DNS_LOCAL_IP6, STRINGPOINT, 223), + CINIT(LOGIN_OPTIONS, STRINGPOINT, 224), + CINIT(SSL_ENABLE_NPN, LONG, 225), + CINIT(SSL_ENABLE_ALPN, LONG, 226), + CINIT(EXPECT_100_TIMEOUT_MS, LONG, 227), + CINIT(PROXYHEADER, OBJECTPOINT, 228), + CINIT(HEADEROPT, LONG, 229), + CINIT(PINNEDPUBLICKEY, STRINGPOINT, 230), + CINIT(UNIX_SOCKET_PATH, STRINGPOINT, 231), + CINIT(SSL_VERIFYSTATUS, LONG, 232), + CINIT(SSL_FALSESTART, LONG, 233), + CINIT(PATH_AS_IS, LONG, 234), + CINIT(PROXY_SERVICE_NAME, STRINGPOINT, 235), + CINIT(SERVICE_NAME, STRINGPOINT, 236), + CINIT(PIPEWAIT, LONG, 237), + CINIT(DEFAULT_PROTOCOL, STRINGPOINT, 238), + CINIT(STREAM_WEIGHT, LONG, 239), + CINIT(STREAM_DEPENDS, OBJECTPOINT, 240), + CINIT(STREAM_DEPENDS_E, OBJECTPOINT, 241), + CINIT(TFTP_NO_OPTIONS, LONG, 242), + CINIT(CONNECT_TO, OBJECTPOINT, 243), + CINIT(TCP_FASTOPEN, LONG, 244), + CINIT(KEEP_SENDING_ON_ERROR, LONG, 245), + CINIT(PROXY_CAINFO, STRINGPOINT, 246), + CINIT(PROXY_CAPATH, STRINGPOINT, 247), + CINIT(PROXY_SSL_VERIFYPEER, LONG, 248), + CINIT(PROXY_SSL_VERIFYHOST, LONG, 249), + CINIT(PROXY_SSLVERSION, LONG, 250), + CINIT(PROXY_TLSAUTH_USERNAME, STRINGPOINT, 251), + CINIT(PROXY_TLSAUTH_PASSWORD, STRINGPOINT, 252), + CINIT(PROXY_TLSAUTH_TYPE, STRINGPOINT, 253), + CINIT(PROXY_SSLCERT, STRINGPOINT, 254), + CINIT(PROXY_SSLCERTTYPE, STRINGPOINT, 255), + CINIT(PROXY_SSLKEY, STRINGPOINT, 256), + CINIT(PROXY_SSLKEYTYPE, STRINGPOINT, 257), + CINIT(PROXY_KEYPASSWD, STRINGPOINT, 258), + CINIT(PROXY_SSL_CIPHER_LIST, STRINGPOINT, 259), + CINIT(PROXY_CRLFILE, STRINGPOINT, 260), + CINIT(PROXY_SSL_OPTIONS, LONG, 261), + CINIT(PRE_PROXY, STRINGPOINT, 262), + CINIT(PROXY_PINNEDPUBLICKEY, STRINGPOINT, 263), + CINIT(ABSTRACT_UNIX_SOCKET, STRINGPOINT, 264), + CINIT(SUPPRESS_CONNECT_HEADERS, LONG, 265), + CINIT(REQUEST_TARGET, STRINGPOINT, 266), + CINIT(SOCKS5_AUTH, LONG, 267), + CINIT(SSH_COMPRESSION, LONG, 268), + CINIT(MIMEPOST, OBJECTPOINT, 269), + CINIT(TIMEVALUE_LARGE, OFF_T, 270), + CINIT(HAPPY_EYEBALLS_TIMEOUT_MS, LONG, 271), + CINIT(RESOLVER_START_FUNCTION, FUNCTIONPOINT, 272), + CINIT(RESOLVER_START_DATA, OBJECTPOINT, 273), + CINIT(HAPROXYPROTOCOL, LONG, 274), + CINIT(DNS_SHUFFLE_ADDRESSES, LONG, 275), + CINIT(TLS13_CIPHERS, STRINGPOINT, 276), + CINIT(PROXY_TLS13_CIPHERS, STRINGPOINT, 277), + CINIT(DISALLOW_USERNAME_IN_URL, LONG, 278), + CINIT(DOH_URL, STRINGPOINT, 279), + CINIT(UPLOAD_BUFFERSIZE, LONG, 280), + CINIT(UPKEEP_INTERVAL_MS, LONG, 281), + CINIT(CURLU, OBJECTPOINT, 282), + CINIT(TRAILERFUNCTION, FUNCTIONPOINT, 283), + CINIT(TRAILERDATA, OBJECTPOINT, 284), + CINIT(HTTP09_ALLOWED, LONG, 285), + CINIT(ALTSVC_CTRL, LONG, 286), + CINIT(ALTSVC, STRINGPOINT, 287), + CINIT(MAXAGE_CONN, LONG, 288), + CINIT(SASL_AUTHZID, STRINGPOINT, 289), + CINIT(MAIL_RCPT_ALLOWFAILS, LONG, 290), + CINIT(SSLCERT_BLOB, BLOB, 291), + CINIT(SSLKEY_BLOB, BLOB, 292), + CINIT(PROXY_SSLCERT_BLOB, BLOB, 293), + CINIT(PROXY_SSLKEY_BLOB, BLOB, 294), + CINIT(ISSUERCERT_BLOB, BLOB, 295), + CINIT(PROXY_ISSUERCERT, STRINGPOINT, 296), + CINIT(PROXY_ISSUERCERT_BLOB, BLOB, 297), + CINIT(SSL_EC_CURVES, STRINGPOINT, 298), + CINIT(HSTS_CTRL, LONG, 299), + CINIT(HSTS, STRINGPOINT, 300), + CINIT(HSTSREADFUNCTION, FUNCTIONPOINT, 301), + CINIT(HSTSREADDATA, OBJECTPOINT, 302), + CINIT(HSTSWRITEFUNCTION, FUNCTIONPOINT, 303), + CINIT(HSTSWRITEDATA, OBJECTPOINT, 304), + CINIT(AWS_SIGV4, STRINGPOINT, 305), + CINIT(DOH_SSL_VERIFYPEER, LONG, 306), + CINIT(DOH_SSL_VERIFYHOST, LONG, 307), + CINIT(DOH_SSL_VERIFYSTATUS, LONG, 308), + CINIT(CAINFO_BLOB, BLOB, 309), + CINIT(PROXY_CAINFO_BLOB, BLOB, 310), + CINIT(SSH_HOST_PUBLIC_KEY_SHA256, STRINGPOINT, 311), + CINIT(PREREQFUNCTION, FUNCTIONPOINT, 312), + CINIT(PREREQDATA, OBJECTPOINT, 313), + CINIT(MAXLIFETIME_CONN, LONG, 314), + CINIT(MIME_OPTIONS, LONG, 315), + CINIT(SSH_HOSTKEYFUNCTION, FUNCTIONPOINT, 316), + CINIT(SSH_HOSTKEYDATA, OBJECTPOINT, 317), + CINIT(PROTOCOLS_STR, STRINGPOINT, 318), + CINIT(REDIR_PROTOCOLS_STR, STRINGPOINT, 319), + CINIT(WS_OPTIONS, LONG, 320), + CINIT(CA_CACHE_TIMEOUT, LONG, 321), + CINIT(QUICK_EXIT, LONG, 322), + CINIT(HAPROXY_CLIENT_IP, STRINGPOINT, 323), + CINIT(SERVER_RESPONSE_TIMEOUT_MS, LONG, 324), + CURLOPT_LASTENTRY /* the last unused */ +} CURLoption; + +typedef enum { + CURLOPT(CURLMOPT_SOCKETFUNCTION, FUNCTIONPOINT, 1), + CURLOPT(CURLMOPT_SOCKETDATA, OBJECTPOINT, 2), + CURLOPT(CURLMOPT_PIPELINING, LONG, 3), + CURLOPT(CURLMOPT_TIMERFUNCTION, FUNCTIONPOINT, 4), + CURLOPT(CURLMOPT_TIMERDATA, OBJECTPOINT, 5), + CURLOPT(CURLMOPT_MAXCONNECTS, LONG, 6), + CURLOPT(CURLMOPT_MAX_HOST_CONNECTIONS, LONG, 7), + CURLOPT(CURLMOPT_MAX_PIPELINE_LENGTH, LONG, 8), + CURLOPT(CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9), + CURLOPT(CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10), + CURLOPT(CURLMOPT_PIPELINING_SITE_BL, OBJECTPOINT, 11), + CURLOPT(CURLMOPT_PIPELINING_SERVER_BL, OBJECTPOINT, 12), + CURLOPT(CURLMOPT_MAX_TOTAL_CONNECTIONS, LONG, 13), + CURLOPT(CURLMOPT_PUSHFUNCTION, FUNCTIONPOINT, 14), + CURLOPT(CURLMOPT_PUSHDATA, OBJECTPOINT, 15), + CURLOPT(CURLMOPT_MAX_CONCURRENT_STREAMS, LONG, 16), + CURLMOPT_LASTENTRY /* the last unused */ +} CURLMoption; + +typedef enum { + CURLSHOPT_NONE, + CURLSHOPT_SHARE, + CURLSHOPT_UNSHARE, + CURLSHOPT_LOCKFUNC, + CURLSHOPT_UNLOCKFUNC, + CURLSHOPT_USERDATA, + CURLSHOPT_LAST /* never use */ +} CURLSHoption; + + +#undef LONG +#undef OBJECTPOINT +#undef STRINGPOINT +#undef FUNCTIONPOINT +#undef OFF_T +#undef CURLOPT +#undef CINIT + +#define SUPER() \ + GO(0) \ + GO(1) \ + GO(2) \ + GO(3) + +// write +#define GO(A) \ +static uintptr_t my_write_fct_##A = 0; \ +static size_t my_write_##A(char* ptr, size_t size, size_t nmemb, void* userdata) \ +{ \ + return (size_t)RunFunctionFmt(my_write_fct_##A, "pLLp", ptr, size, nmemb, userdata);\ +} +SUPER() +#undef GO +static void* find_write_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_write_fct_##A == (uintptr_t)fct) return my_write_##A; + SUPER() + #undef GO + #define GO(A) if(my_write_fct_##A == 0) {my_write_fct_##A = (uintptr_t)fct; return my_write_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl write callback\n"); + return NULL; +} + +// read +#define GO(A) \ +static uintptr_t my_read_fct_##A = 0; \ +static size_t my_read_##A(char* buffer, size_t size, size_t nitems, void* userdata) \ +{ \ + return (size_t)RunFunctionFmt(my_read_fct_##A, "pLLp", buffer, size, nitems, userdata);\ +} +SUPER() +#undef GO +static void* find_read_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_read_fct_##A == (uintptr_t)fct) return my_read_##A; + SUPER() + #undef GO + #define GO(A) if(my_read_fct_##A == 0) {my_read_fct_##A = (uintptr_t)fct; return my_read_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl read callback\n"); + return NULL; +} + +// ioctl +#define GO(A) \ +static uintptr_t my_ioctl_fct_##A = 0; \ +static size_t my_ioctl_##A(void* handle, int32_t fnc, void* userdata) \ +{ \ + return (size_t)RunFunctionFmt(my_ioctl_fct_##A, "pip", handle, fnc, userdata);\ +} +SUPER() +#undef GO +static void* find_ioctl_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_ioctl_fct_##A == (uintptr_t)fct) return my_ioctl_##A; + SUPER() + #undef GO + #define GO(A) if(my_ioctl_fct_##A == 0) {my_ioctl_fct_##A = (uintptr_t)fct; return my_ioctl_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl ioctl callback\n"); + return NULL; +} + +// seek +#define GO(A) \ +static uintptr_t my_seek_fct_##A = 0; \ +static int32_t my_seek_##A(void* userdata, int64_t off, int32_t origin) \ +{ \ + return (int32_t)RunFunctionFmt(my_seek_fct_##A, "pIi", userdata, off, origin);\ +} +SUPER() +#undef GO +static void* find_seek_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_seek_fct_##A == (uintptr_t)fct) return my_seek_##A; + SUPER() + #undef GO + #define GO(A) if(my_seek_fct_##A == 0) {my_seek_fct_##A = (uintptr_t)fct; return my_seek_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl seek callback\n"); + return NULL; +} + +// header +#define GO(A) \ +static uintptr_t my_header_fct_##A = 0; \ +static size_t my_header_##A(char* buffer, size_t size, size_t nitems, void* userdata) \ +{ \ + return (size_t)RunFunctionFmt(my_header_fct_##A, "pLLp", buffer, size, nitems, userdata);\ +} +SUPER() +#undef GO +static void* find_header_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_header_fct_##A == (uintptr_t)fct) return my_header_##A; + SUPER() + #undef GO + #define GO(A) if(my_header_fct_##A == 0) {my_header_fct_##A = (uintptr_t)fct; return my_header_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl header callback\n"); + return NULL; +} + +// progress +#define GO(A) \ +static uintptr_t my_progress_fct_##A = 0; \ +static int my_progress_##A(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) \ +{ \ + return (int)RunFunctionFmt(my_progress_fct_##A, "pdddd", clientp, dltotal, dlnow, ultotal, ulnow);\ +} +SUPER() +#undef GO +static void* find_progress_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_progress_fct_##A == (uintptr_t)fct) return my_progress_##A; + SUPER() + #undef GO + #define GO(A) if(my_progress_fct_##A == 0) {my_progress_fct_##A = (uintptr_t)fct; return my_progress_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl progress callback\n"); + return NULL; +} + +// progress_int +#define GO(A) \ +static uintptr_t my_progress_int_fct_##A = 0; \ +static int my_progress_int_##A(void *clientp, uint64_t dltotal, uint64_t dlnow, uint64_t ultotal, uint64_t ulnow) \ +{ \ + return (int)RunFunctionFmt(my_progress_int_fct_##A, "pUUUU", clientp, dltotal, dlnow, ultotal, ulnow);\ +} +SUPER() +#undef GO +static void* find_progress_int_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_progress_int_fct_##A == (uintptr_t)fct) return my_progress_int_##A; + SUPER() + #undef GO + #define GO(A) if(my_progress_int_fct_##A == 0) {my_progress_int_fct_##A = (uintptr_t)fct; return my_progress_int_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl progress_int callback\n"); + return NULL; +} + +// socket +#define GO(A) \ +static uintptr_t my_socket_fct_##A = 0; \ +static int my_socket_##A(void *a, int b, int c, void* d, void* e) \ +{ \ + return (int)RunFunctionFmt(my_socket_fct_##A, "piipp", a, b, c, d, e); \ +} +SUPER() +#undef GO +static void* find_socket_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_socket_fct_##A == (uintptr_t)fct) return my_socket_##A; + SUPER() + #undef GO + #define GO(A) if(my_socket_fct_##A == 0) {my_socket_fct_##A = (uintptr_t)fct; return my_socket_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl socket callback\n"); + return NULL; +} + +// timer +#define GO(A) \ +static uintptr_t my_timer_fct_##A = 0; \ +static int my_timer_##A(void *a, long b, void* c) \ +{ \ + return (int)RunFunctionFmt(my_timer_fct_##A, "plp", a, b, c); \ +} +SUPER() +#undef GO +static void* find_timer_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_timer_fct_##A == (uintptr_t)fct) return my_timer_##A; + SUPER() + #undef GO + #define GO(A) if(my_timer_fct_##A == 0) {my_timer_fct_##A = (uintptr_t)fct; return my_timer_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl timer callback\n"); + return NULL; +} + +// push +#define GO(A) \ +static uintptr_t my_push_fct_##A = 0; \ +static int my_push_##A(void *a, void* b, size_t c, void* d, void* e) \ +{ \ + return (int)RunFunctionFmt(my_push_fct_##A, "ppLpp", a, b, c, d, e); \ +} +SUPER() +#undef GO +static void* find_push_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_push_fct_##A == (uintptr_t)fct) return my_push_##A; + SUPER() + #undef GO + #define GO(A) if(my_push_fct_##A == 0) {my_push_fct_##A = (uintptr_t)fct; return my_push_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl push callback\n"); + return NULL; +} + +// debug +#define GO(A) \ +static uintptr_t my_debug_fct_##A = 0; \ +static int my_debug_##A(void *a, int b, void* c, size_t d, void* e) \ +{ \ + return (int)RunFunctionFmt(my_debug_fct_##A, "pipLp", a, b, c, d, e); \ +} +SUPER() +#undef GO +static void* find_debug_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_debug_fct_##A == (uintptr_t)fct) return my_debug_##A; + SUPER() + #undef GO + #define GO(A) if(my_debug_fct_##A == 0) {my_debug_fct_##A = (uintptr_t)fct; return my_debug_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl debug callback\n"); + return NULL; +} + +// lockcb +#define GO(A) \ +static uintptr_t my_lockcb_fct_##A = 0; \ +static void my_lockcb_##A(void *a, int b, int c, void* d) \ +{ \ + RunFunctionFmt(my_lockcb_fct_##A, "piip", a, b, c, d); \ +} +SUPER() +#undef GO +static void* find_lockcb_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_lockcb_fct_##A == (uintptr_t)fct) return my_lockcb_##A; + SUPER() + #undef GO + #define GO(A) if(my_lockcb_fct_##A == 0) {my_lockcb_fct_##A = (uintptr_t)fct; return my_lockcb_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl lockcb callback\n"); + return NULL; +} + +// unlockcb +#define GO(A) \ +static uintptr_t my_unlockcb_fct_##A = 0; \ +static void my_unlockcb_##A(void *a, int b, void* c) \ +{ \ + RunFunctionFmt(my_unlockcb_fct_##A, "pip", a, b, c); \ +} +SUPER() +#undef GO +static void* find_unlockcb_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_unlockcb_fct_##A == (uintptr_t)fct) return my_unlockcb_##A; + SUPER() + #undef GO + #define GO(A) if(my_unlockcb_fct_##A == 0) {my_unlockcb_fct_##A = (uintptr_t)fct; return my_unlockcb_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl unlockcb callback\n"); + return NULL; +} + +// ssl_ctx_callback +#define GO(A) \ +static uintptr_t my_ssl_ctx_callback_fct_##A = 0; \ +static int my_ssl_ctx_callback_##A(void *a, void* b, void* c) \ +{ \ + return (int)RunFunctionFmt(my_ssl_ctx_callback_fct_##A, "ppp", a, b, c); \ +} +SUPER() +#undef GO +static void* find_ssl_ctx_callback_Fct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_ssl_ctx_callback_fct_##A == (uintptr_t)fct) return my_ssl_ctx_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_ssl_ctx_callback_fct_##A == 0) {my_ssl_ctx_callback_fct_##A = (uintptr_t)fct; return my_ssl_ctx_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl ssl_ctx_callback callback\n"); + return NULL; +} + +// malloc_callback +#define GO(A) \ + static uintptr_t my_malloc_callback_fct_##A = 0; \ + static void* my_malloc_callback_##A(size_t a) \ + { \ + return (void*)RunFunctionFmt(my_malloc_callback_fct_##A, "L", a); \ + } +SUPER() +#undef GO +static void* find_malloc_callback_Fct(void* fct) +{ + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_malloc_callback_fct_##A == (uintptr_t)fct) return my_malloc_callback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_malloc_callback_fct_##A == 0) { \ + my_malloc_callback_fct_##A = (uintptr_t)fct; \ + return my_malloc_callback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl malloc_callback callback\n"); + return NULL; +} + +// free_callback +#define GO(A) \ + static uintptr_t my_free_callback_fct_##A = 0; \ + static void my_free_callback_##A(void* a) \ + { \ + RunFunctionFmt(my_free_callback_fct_##A, "p", a); \ + } +SUPER() +#undef GO +static void* find_free_callback_Fct(void* fct) +{ + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_free_callback_fct_##A == (uintptr_t)fct) return my_free_callback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_free_callback_fct_##A == 0) { \ + my_free_callback_fct_##A = (uintptr_t)fct; \ + return my_free_callback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl free_callback callback\n"); + return NULL; +} + +// realloc_callback +#define GO(A) \ + static uintptr_t my_realloc_callback_fct_##A = 0; \ + static void* my_realloc_callback_##A(void* a, size_t b) \ + { \ + return (void*)RunFunctionFmt(my_realloc_callback_fct_##A, "pL", a, b); \ + } +SUPER() +#undef GO +static void* find_realloc_callback_Fct(void* fct) +{ + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_realloc_callback_fct_##A == (uintptr_t)fct) return my_realloc_callback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_realloc_callback_fct_##A == 0) { \ + my_realloc_callback_fct_##A = (uintptr_t)fct; \ + return my_realloc_callback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl realloc_callback callback\n"); + return NULL; +} + +// strdup_callback +#define GO(A) \ + static uintptr_t my_strdup_callback_fct_##A = 0; \ + static void* my_strdup_callback_##A(void* a) \ + { \ + return (void*)RunFunctionFmt(my_strdup_callback_fct_##A, "p", a); \ + } +SUPER() +#undef GO +static void* find_strdup_callback_Fct(void* fct) +{ + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_strdup_callback_fct_##A == (uintptr_t)fct) return my_strdup_callback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_strdup_callback_fct_##A == 0) { \ + my_strdup_callback_fct_##A = (uintptr_t)fct; \ + return my_strdup_callback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl strdup_callback callback\n"); + return NULL; +} + + +// calloc_callback +#define GO(A) \ + static uintptr_t my_calloc_callback_fct_##A = 0; \ + static void* my_calloc_callback_##A(size_t a, size_t b) \ + { \ + return (void*)RunFunctionFmt(my_calloc_callback_fct_##A, "LL", a, b); \ + } +SUPER() +#undef GO +static void* find_calloc_callback_Fct(void* fct) +{ + if (!fct) return NULL; + if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); +#define GO(A) \ + if (my_calloc_callback_fct_##A == (uintptr_t)fct) return my_calloc_callback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my_calloc_callback_fct_##A == 0) { \ + my_calloc_callback_fct_##A = (uintptr_t)fct; \ + return my_calloc_callback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for curl calloc_callback callback\n"); + return NULL; +} +#undef SUPER + +EXPORT uint32_t my32_curl_easy_setopt(x64emu_t* emu, void* handle, uint32_t option, void* param) +{ + (void)emu; + + switch(option) { + case CURLOPT_WRITEFUNCTION: + return my->curl_easy_setopt(handle, option, find_write_Fct(param)); + case CURLOPT_READFUNCTION: + return my->curl_easy_setopt(handle, option, find_read_Fct(param)); + case CURLOPT_IOCTLFUNCTION: + return my->curl_easy_setopt(handle, option, find_ioctl_Fct(param)); + case CURLOPT_SEEKFUNCTION: + return my->curl_easy_setopt(handle, option, find_seek_Fct(param)); + case CURLOPT_HEADERFUNCTION: + return my->curl_easy_setopt(handle, option, find_header_Fct(param)); + case CURLOPT_PROGRESSFUNCTION: + return my->curl_easy_setopt(handle, option, find_progress_Fct(param)); + case CURLOPT_XFERINFOFUNCTION: + return my->curl_easy_setopt(handle, option, find_progress_int_Fct(param)); + case CURLOPT_DEBUGFUNCTION: + return my->curl_easy_setopt(handle, option, find_debug_Fct(param)); + case CURLOPT_SSL_CTX_FUNCTION: + return my->curl_easy_setopt(handle, option, find_ssl_ctx_callback_Fct(param)); + case CURLOPT_SSL_CTX_DATA: + return my->curl_easy_setopt(handle, option, param); + case CURLOPT_SOCKOPTFUNCTION: + case CURLOPT_OPENSOCKETFUNCTION: + case CURLOPT_CLOSESOCKETFUNCTION: + case CURLOPT_CONV_TO_NETWORK_FUNCTION: + case CURLOPT_CONV_FROM_NETWORK_FUNCTION: + case CURLOPT_CONV_FROM_UTF8_FUNCTION: + case CURLOPT_INTERLEAVEFUNCTION: + case CURLOPT_CHUNK_BGN_FUNCTION: + case CURLOPT_CHUNK_END_FUNCTION: + case CURLOPT_FNMATCH_FUNCTION: + case CURLOPT_RESOLVER_START_FUNCTION: + case CURLOPT_TRAILERFUNCTION: + case CURLOPT_HSTSREADFUNCTION: + case CURLOPT_HSTSWRITEFUNCTION: + case CURLOPT_PREREQFUNCTION: + case CURLOPT_SSH_HOSTKEYFUNCTION: + printf_log(LOG_NONE, "Error: unimplemented option %u in curl_easy_setopt\n", option); + return 48; //unknown option... + default: + return my->curl_easy_setopt(handle, option, param); + } +} + +EXPORT uint32_t my32_curl_multi_setopt(x64emu_t* emu, void* handle, uint32_t option, void* param) +{ + (void)emu; + + switch(option) { + case CURLMOPT_SOCKETFUNCTION: + return my->curl_multi_setopt(handle, option, find_socket_Fct(param)); + case CURLMOPT_TIMERFUNCTION: + return my->curl_multi_setopt(handle, option, find_timer_Fct(param)); + case CURLMOPT_PUSHFUNCTION: + return my->curl_multi_setopt(handle, option, find_push_Fct(param)); + default: + return my->curl_multi_setopt(handle, option, param); + } +} + +EXPORT uint32_t my32_curl_share_setopt(x64emu_t* emu, void* handle, CURLSHoption option, void* param) +{ + switch(option) { + case CURLSHOPT_LOCKFUNC: + return my->curl_share_setopt(handle, option, find_lockcb_Fct(param)); + case CURLSHOPT_UNLOCKFUNC: + return my->curl_share_setopt(handle, option, find_unlockcb_Fct(param)); + default: + return my->curl_share_setopt(handle, option, param); + } +} + +EXPORT int my32_curl_global_init_mem(x64emu_t* emu, long flags, void* m, void* f, void* r, void* s, void* c) +{ + return my->curl_global_init_mem(flags, + find_malloc_callback_Fct(m), + find_free_callback_Fct(f), + find_realloc_callback_Fct(r), + find_strdup_callback_Fct(s), + find_calloc_callback_Fct(c)); +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedcurl_private.h b/src/wrapped32/wrappedcurl_private.h new file mode 100644 index 0000000..ce198ab --- /dev/null +++ b/src/wrapped32/wrappedcurl_private.h @@ -0,0 +1,85 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh.... +#endif + +GO(curl_easy_cleanup, vFp) +GO(curl_easy_duphandle, pFp) +GO(curl_easy_escape, pFppi) +GO(curl_easy_getinfo, uFpppppp) //vararg +GO(curl_easy_init, pFv) +//GO(curl_easy_pause, +GO(curl_easy_perform, uFp) +GO(curl_easy_recv, iFppLp) +GO(curl_easy_reset, vFp) +GO(curl_easy_send, iFppLp) +GOM(curl_easy_setopt, uFEpup) // can set many callbacks! +GO(curl_easy_strerror, pFu) +//GO(curl_easy_unescape, +//GO(curl_escape, +GO(curl_formadd, iFpppppppppppppppp) // there is a vararg here. Should GOM and use CURLFORM_ARRAY instead +GO(curl_formfree, vFp) +//GO(curl_formget, +GO(curl_free, vFp) +//GO(curl_getdate, +//GO(curl_getenv, +GO(curl_global_cleanup, vFv) +GO(curl_global_init, uFu) +GOM(curl_global_init_mem, iFElppppp) +GO(curl_global_sslset, uFupp) +// GO(curl_maprintf, +// GO(curl_mfprintf, +GO(curl_mime_addpart, pFp) +GO(curl_mime_data, iFppL) +// GO(curl_mime_data_cb, +// GO(curl_mime_encoder, +GO(curl_mime_filedata, iFpp) +// GO(curl_mime_filename, +// GO(curl_mime_free, +// GO(curl_mime_headers, +GO(curl_mime_init, pFp) +GO(curl_mime_name, iFpp) +//GO(curl_mime_subparts, +//GO(curl_mime_type, +//GO(curl_mprintf, +//GO(curl_msnprintf, +//GO(curl_msprintf, +GO(curl_multi_add_handle, uFpp) +GO(curl_multi_assign, uFpip) +GO(curl_multi_cleanup, uFp) +GO(curl_multi_fdset, uFppppp) +GO(curl_multi_info_read, pFpp) +GO(curl_multi_init, pFv) +GO(curl_multi_perform, uFpp) +GO(curl_multi_poll, iFppuip) // since 7.66.0 +GO(curl_multi_remove_handle, uFpp) +GOM(curl_multi_setopt, iFEpup) +//GO(curl_multi_socket, +GO(curl_multi_socket_action, uFpiip) +//GO(curl_multi_socket_all, +GO(curl_multi_strerror, pFi) +GO(curl_multi_timeout, iFpp) +GO(curl_multi_wait, iFppuip) +//GO(curl_mvaprintf, +//GO(curl_mvfprintf, +//GO(curl_mvprintf, +//GO(curl_mvsnprintf, +//GO(curl_mvsprintf, +//GO(curl_pushheader_byname, +//GO(curl_pushheader_bynum, +GO(curl_share_cleanup, uFp) +GO(curl_share_init, pFv) +GOM(curl_share_setopt, uFEpup) +//GO(curl_share_strerror, +GO(curl_slist_append, pFpp) +GO(curl_slist_free_all, vFp) +//GO(curl_strequal, +//GO(curl_strnequal, +//GO(curl_unescape, +GO(curl_url, pFv) +GO(curl_url_cleanup, vFp) +GO(curl_url_dup, pFp) +GO(curl_url_get, iFpipu) +GO(curl_url_set, iFpipu) +GO(curl_url_strerror, pFi) +GO(curl_version, pFv) +GO(curl_version_info, pFi) diff --git a/src/wrapped32/wrappeddbus.c b/src/wrapped32/wrappeddbus.c new file mode 100644 index 0000000..ec64862 --- /dev/null +++ b/src/wrapped32/wrappeddbus.c @@ -0,0 +1,736 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "myalign32.h" +#include "converter32.h" + +static const char* dbusName = "libdbus-1.so.3"; +#define LIBNAME dbus + +typedef uint32_t (*uFpiA_t)(void*, int, va_list); +typedef uint32_t (*uFppiA_t)(void*, void*, int, va_list); + +#define ADDED_FUNCTIONS() \ +GO(dbus_message_append_args_valist, uFpiA_t) \ +GO(dbus_message_get_args_valist, uFppiA_t) \ + +#include "generated/wrappeddbustypes32.h" + +#include "wrappercallback32.h" + + +#define NF 4 +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) + +// DBusFreeFunction +#define GO(A) \ +static uintptr_t my_DBusFreeFunction_fct_##A = 0; \ +static void my_DBusFreeFunction_##A(void* p) \ +{ \ + RunFunctionFmt(my_DBusFreeFunction_fct_##A, "p", p); \ +} +SUPER() +#undef GO +static void* find_DBusFreeFunction_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusFreeFunction_fct_##A == (uintptr_t)fct) return my_DBusFreeFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusFreeFunction_fct_##A == 0) {my_DBusFreeFunction_fct_##A = (uintptr_t)fct; return my_DBusFreeFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusFreeFunction callback\n"); + return NULL; +} +// DBusHandleMessageFunction +#define GO(A) \ +static uintptr_t my_DBusHandleMessageFunction_fct_##A = 0; \ +static int my_DBusHandleMessageFunction_##A(void* a, void* b, void* c) \ +{ \ + return RunFunctionFmt(my_DBusHandleMessageFunction_fct_##A, "ppp", a, b, c); \ +} +SUPER() +#undef GO +static void* find_DBusHandleMessageFunction_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusHandleMessageFunction_fct_##A == (uintptr_t)fct) return my_DBusHandleMessageFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusHandleMessageFunction_fct_##A == 0) {my_DBusHandleMessageFunction_fct_##A = (uintptr_t)fct; return my_DBusHandleMessageFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusHandleMessageFunction callback\n"); + return NULL; +} +// DBusAddTimeoutFunction +#define GO(A) \ +static uintptr_t my_DBusAddTimeoutFunction_fct_##A = 0; \ +static int my_DBusAddTimeoutFunction_##A(void* a, void* b) \ +{ \ + return RunFunctionFmt(my_DBusAddTimeoutFunction_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* find_DBusAddTimeoutFunction_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusAddTimeoutFunction_fct_##A == (uintptr_t)fct) return my_DBusAddTimeoutFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusAddTimeoutFunction_fct_##A == 0) {my_DBusAddTimeoutFunction_fct_##A = (uintptr_t)fct; return my_DBusAddTimeoutFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusAddTimeoutFunction callback\n"); + return NULL; +} +// DBusRemoveTimeoutFunction +#define GO(A) \ +static uintptr_t my_DBusRemoveTimeoutFunction_fct_##A = 0; \ +static void my_DBusRemoveTimeoutFunction_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_DBusRemoveTimeoutFunction_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* find_DBusRemoveTimeoutFunction_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusRemoveTimeoutFunction_fct_##A == (uintptr_t)fct) return my_DBusRemoveTimeoutFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusRemoveTimeoutFunction_fct_##A == 0) {my_DBusRemoveTimeoutFunction_fct_##A = (uintptr_t)fct; return my_DBusRemoveTimeoutFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusRemoveTimeoutFunction callback\n"); + return NULL; +} +// DBusTimeoutToggledFunction +#define GO(A) \ +static uintptr_t my_DBusTimeoutToggledFunction_fct_##A = 0; \ +static void my_DBusTimeoutToggledFunction_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_DBusTimeoutToggledFunction_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* find_DBusTimeoutToggledFunction_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusTimeoutToggledFunction_fct_##A == (uintptr_t)fct) return my_DBusTimeoutToggledFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusTimeoutToggledFunction_fct_##A == 0) {my_DBusTimeoutToggledFunction_fct_##A = (uintptr_t)fct; return my_DBusTimeoutToggledFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusTimeoutToggledFunction callback\n"); + return NULL; +} +// DBusWakeupMainFunction +#define GO(A) \ +static uintptr_t my_DBusWakeupMainFunction_fct_##A = 0; \ +static void my_DBusWakeupMainFunction_##A(void* a) \ +{ \ + RunFunctionFmt(my_DBusWakeupMainFunction_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* find_DBusWakeupMainFunction_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusWakeupMainFunction_fct_##A == (uintptr_t)fct) return my_DBusWakeupMainFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusWakeupMainFunction_fct_##A == 0) {my_DBusWakeupMainFunction_fct_##A = (uintptr_t)fct; return my_DBusWakeupMainFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusWakeupMainFunction callback\n"); + return NULL; +} + +// DBusPendingCallNotifyFunction +#define GO(A) \ +static uintptr_t my_DBusPendingCallNotifyFunction_fct_##A = 0; \ +static void my_DBusPendingCallNotifyFunction_##A(void* pending, void* data) \ +{ \ + RunFunctionFmt(my_DBusPendingCallNotifyFunction_fct_##A, "pp", pending, data);\ +} +SUPER() +#undef GO +static void* findDBusPendingCallNotifyFunctionFct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusPendingCallNotifyFunction_fct_##A == (uintptr_t)fct) return my_DBusPendingCallNotifyFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusPendingCallNotifyFunction_fct_##A == 0) {my_DBusPendingCallNotifyFunction_fct_##A = (uintptr_t)fct; return my_DBusPendingCallNotifyFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for dbus DBusPendingCallNotifyFunction callback\n"); + return NULL; +} + +// DBusDispatchStatusFunction +#define GO(A) \ +static uintptr_t my_DBusDispatchStatusFunction_fct_##A = 0; \ +static void my_DBusDispatchStatusFunction_##A(void* connection, int new_status, void* data) \ +{ \ + RunFunctionFmt(my_DBusDispatchStatusFunction_fct_##A, "pip", connection, new_status, data);\ +} +SUPER() +#undef GO +static void* findDBusDispatchStatusFunctionFct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusDispatchStatusFunction_fct_##A == (uintptr_t)fct) return my_DBusDispatchStatusFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusDispatchStatusFunction_fct_##A == 0) {my_DBusDispatchStatusFunction_fct_##A = (uintptr_t)fct; return my_DBusDispatchStatusFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for dbus DBusDispatchStatusFunction callback\n"); + return NULL; +} + +// DBusAddWatchFunction +#define GO(A) \ +static uintptr_t my_DBusAddWatchFunction_fct_##A = 0; \ +static int my_DBusAddWatchFunction_##A(void* watch, void* data) \ +{ \ + return (int)RunFunctionFmt(my_DBusAddWatchFunction_fct_##A, "pp", watch, data);\ +} +SUPER() +#undef GO +static void* findDBusAddWatchFunctionFct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusAddWatchFunction_fct_##A == (uintptr_t)fct) return my_DBusAddWatchFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusAddWatchFunction_fct_##A == 0) {my_DBusAddWatchFunction_fct_##A = (uintptr_t)fct; return my_DBusAddWatchFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for dbus DBusAddWatchFunction callback\n"); + return NULL; +} + +// DBusRemoveWatchFunction +#define GO(A) \ +static uintptr_t my_DBusRemoveWatchFunction_fct_##A = 0; \ +static void my_DBusRemoveWatchFunction_##A(void* watch, void* data) \ +{ \ + RunFunctionFmt(my_DBusRemoveWatchFunction_fct_##A, "pp", watch, data);\ +} +SUPER() +#undef GO +static void* findDBusRemoveWatchFunctionFct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusRemoveWatchFunction_fct_##A == (uintptr_t)fct) return my_DBusRemoveWatchFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusRemoveWatchFunction_fct_##A == 0) {my_DBusRemoveWatchFunction_fct_##A = (uintptr_t)fct; return my_DBusRemoveWatchFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for dbus DBusRemoveWatchFunction callback\n"); + return NULL; +} + +// DBusWatchToggledFunction +#define GO(A) \ +static uintptr_t my_DBusWatchToggledFunction_fct_##A = 0; \ +static void my_DBusWatchToggledFunction_##A(void* watch, void* data) \ +{ \ + RunFunctionFmt(my_DBusWatchToggledFunction_fct_##A, "pp", watch, data);\ +} +SUPER() +#undef GO +static void* findDBusWatchToggledFunctionFct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusWatchToggledFunction_fct_##A == (uintptr_t)fct) return my_DBusWatchToggledFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusWatchToggledFunction_fct_##A == 0) {my_DBusWatchToggledFunction_fct_##A = (uintptr_t)fct; return my_DBusWatchToggledFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for dbus DBusWatchToggledFunction callback\n"); + return NULL; +} + +// DBusObjectPathUnregisterFunction +#define GO(A) \ +static uintptr_t my_DBusObjectPathUnregisterFunction_fct_##A = 0; \ +static void my_DBusObjectPathUnregisterFunction_##A(void* connection, void* data) \ +{ \ + RunFunctionFmt(my_DBusObjectPathUnregisterFunction_fct_##A, "pp", connection, data);\ +} +SUPER() +#undef GO +static void* findDBusObjectPathUnregisterFunctionFct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusObjectPathUnregisterFunction_fct_##A == (uintptr_t)fct) return my_DBusObjectPathUnregisterFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusObjectPathUnregisterFunction_fct_##A == 0) {my_DBusObjectPathUnregisterFunction_fct_##A = (uintptr_t)fct; return my_DBusObjectPathUnregisterFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for dbus DBusObjectPathUnregisterFunction callback\n"); + return NULL; +} + +// DBusObjectPathMessageFunction +#define GO(A) \ +static uintptr_t my_DBusObjectPathMessageFunction_fct_##A = 0; \ +static void my_DBusObjectPathMessageFunction_##A(void* connection, void* message, void* data) \ +{ \ + RunFunctionFmt(my_DBusObjectPathMessageFunction_fct_##A, "ppp", connection, message, data);\ +} +SUPER() +#undef GO +static void* findDBusObjectPathMessageFunctionFct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusObjectPathMessageFunction_fct_##A == (uintptr_t)fct) return my_DBusObjectPathMessageFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusObjectPathMessageFunction_fct_##A == 0) {my_DBusObjectPathMessageFunction_fct_##A = (uintptr_t)fct; return my_DBusObjectPathMessageFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for dbus DBusObjectPathMessageFunction callback\n"); + return NULL; +} + +// dbus_internal_pad +#define GO(A) \ +static uintptr_t my_dbus_internal_pad_fct_##A = 0; \ +static void my_dbus_internal_pad_##A(void* a, void* b, void* c, void* d) \ +{ \ + RunFunctionFmt(my_dbus_internal_pad_fct_##A, "pppp", a, b, c, d);\ +} +SUPER() +#undef GO +static void* finddbus_internal_padFct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_dbus_internal_pad_fct_##A == (uintptr_t)fct) return my_dbus_internal_pad_##A; + SUPER() + #undef GO + #define GO(A) if(my_dbus_internal_pad_fct_##A == 0) {my_dbus_internal_pad_fct_##A = (uintptr_t)fct; return my_dbus_internal_pad_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for dbus dbus_internal_pad callback\n"); + return NULL; +} + +// DBusNewConnectionFunction +#define GO(A) \ +static uintptr_t my_DBusNewConnectionFunction_fct_##A = 0; \ +static void my_DBusNewConnectionFunction_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my_DBusNewConnectionFunction_fct_##A, "pppp", a, b, c); \ +} +SUPER() +#undef GO +static void* findDBusNewConnectionFunctionFct(void* fct) +{ + if(!fct) return NULL; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_DBusNewConnectionFunction_fct_##A == (uintptr_t)fct) return my_DBusNewConnectionFunction_##A; + SUPER() + #undef GO + #define GO(A) if(my_DBusNewConnectionFunction_fct_##A == 0) {my_DBusNewConnectionFunction_fct_##A = (uintptr_t)fct; return my_DBusNewConnectionFunction_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for dbus DBusNewConnectionFunction callback\n"); + return NULL; +} + + +#undef SUPER + +EXPORT void my32_dbus_timeout_set_data(x64emu_t* emu, void* e, void* p, void* f) +{ + (void)emu; + my->dbus_timeout_set_data(e, p, find_DBusFreeFunction_Fct(f)); +} + +EXPORT int32_t my32_dbus_connection_set_timeout_functions(x64emu_t* emu, void* c, void* a, void* r, void* t, void* d, void* f) +{ + (void)emu; + return my->dbus_connection_set_timeout_functions(c, + find_DBusAddTimeoutFunction_Fct(a), + find_DBusRemoveTimeoutFunction_Fct(r), + find_DBusTimeoutToggledFunction_Fct(t), + d, find_DBusFreeFunction_Fct(f)); +} +EXPORT int my32_dbus_connection_add_filter(x64emu_t* emu, void* connection, void* fnc, void* data, void* fr) +{ + (void)emu; + return my->dbus_connection_add_filter(connection, find_DBusHandleMessageFunction_Fct(fnc), data, find_DBusFreeFunction_Fct(fr)); +} +EXPORT void my32_dbus_connection_remove_filter(x64emu_t* emu, void* connection, void* fnc, void* data) +{ + (void)emu; + my->dbus_connection_remove_filter(connection, find_DBusHandleMessageFunction_Fct(fnc), data); +} + +static void* inplace_shrink_arraystring(void* a) +{ + if(!a) return a; + void** src = a; + ptr_t* dst = a; + // need to find n first + int n = 0; + while(src[n]) ++n; + for(int i=0; i<=n; ++i) // convert last NULL value + dst[i] = to_ptrv(src[i]); + return a; +} + +static void* inplace_expand_arraystring(void* a) +{ + if(!a) return a; + void** dst = a; + ptr_t* src = a; + // need to find n first + int n = 0; + while(src[n]) ++n; + for(int i=n; i>=0; --i) //expand, including final NULL + dst[i] = from_ptrv(src[i]); + return a; +} + +EXPORT int my32_dbus_message_get_args(x64emu_t* emu, void* message, void* e, int arg, ptr_t* V) +{ + (void)emu; + int idx = 0; + int type = arg; + int nstr = 0; + // count + while(type) { + if(type == ((int)'a')) {idx+=2; nstr+=2;} + else if((type == (int)'s') || (type == (int)'o') || (type == (int)'g')) { nstr++; idx++;} + else idx++; + type = V[idx*2+1]; + } + int count = idx*2; + void* array[count + nstr]; + memset(array, 0, sizeof(void*)*(count+nstr)); + type = arg; + idx = 0; + nstr = 0; + // prepare the array + while(type) { + if(type == ((int)'a')) { + array[idx*2+0] = from_ptrv(V[idx*2+0]); + array[idx*2+1] = &array[count + nstr]; + ++nstr; + array[idx*2+2] = &array[count + nstr]; // size of the array + ++nstr; + ++idx; + } else if((type == (int)'s') || (type == (int)'o') || (type == (int)'g')) { + array[idx*2+0] = &array[count+nstr]; + ++nstr; + } else { + array[idx*2+0] = from_ptrv(V[idx*2]); + ++nstr; + } + //go next + type = V[idx*2+1]; + array[idx*2+1] = (void*)(uintptr_t)type; + ++idx; + } + CREATE_SYSV_VALIST_32(array); + uint32_t ret = my->dbus_message_get_args_valist(message, e, arg, VARARGS_32); + // fill back the pointers for strings + if(nstr) { + type = arg; + idx = 0; + nstr = 0; + // done + while(type) { + if(type == ((int)'a')) { + int subtype = V[idx*2]; + void* value = array[count + nstr++]; + V[idx*2] = to_ptrv(value); + int* n = array[count + nstr++]; + V[idx*2] = to_ptrv(n); + if((subtype==(int)'s') || subtype==(int)'o' || (subtype==(int)'g')) + inplace_shrink_arraystring(value); + ++idx; + } else if((type == (int)'s') || (type == (int)'o') || (type == (int)'g')) { + void* value = array[count + nstr++]; + from_ptri(ptr_t, V[idx*2]) = to_ptrv(value); + } + //go next + type = V[idx*2+1]; + ++idx; + } + } + return ret; +} +EXPORT int my32_dbus_message_get_args_valist(x64emu_t* emu, void* message, void* e, int arg, ptr_t* b) __attribute__((alias("my32_dbus_message_get_args"))); + +EXPORT int my32_dbus_message_append_args(x64emu_t* emu, void* message, int arg, ptr_t* V) +{ + (void)emu; + int idx = 0; + int type = arg; + int nstr = 0; + // count + while(type) { + if(type == ((int)'s')) nstr++; + else if(type == ((int)'a')) { + nstr++; + type = V[idx*2+0]; + if((type == ((int)'s')) || (type == ((int)'o')) || (type == ((int)'g'))) { + int n = V[idx*2+2]; + nstr += n; + } + idx++; + } + type = V[idx*2+1]; + idx++; + } + int count = idx*2; + void* array[count + nstr]; + memset(array, 0, sizeof(void*)*(count+nstr)); + type = arg; + idx = 0; + nstr = 0; + // fill the array + while(type) { + void* value = from_ptrv(V[idx*2]); + if((type == (int)'s')) { + array[count + nstr] = from_ptrv(*(ptr_t*)value); + array[idx*2+0] = &array[count + nstr++]; + } else if(type == ((int)'a')) { + array[idx*2+0] = value; + int subtype = (int)(uintptr_t)value; + value = from_ptrv(V[idx*2+1]); // array pointer + array[count + nstr] = from_ptrv(*(ptr_t*)value); + array[idx*2+1] = &array[count + nstr]; + ++nstr; + int n = V[idx*2+2]; + array[idx*2+2] = from_ptrv(n); // size of the array + if((subtype==(int)'s') || (subtype==(int)'o') || (subtype==(int)'g')) { + // expand string array + ptr_t* pvalue = value; + for(int i=0; idbus_message_append_args_valist(message, arg, VARARGS_32); +} +EXPORT int my32_dbus_message_append_args_valist(x64emu_t* emu, void* message, int arg, ptr_t* b) __attribute__((alias("my32_dbus_message_append_args"))); + +#if 0 +EXPORT int my32_dbus_message_set_data(x64emu_t* emu, void* message, int32_t slot, void* data, void* free_func) +{ + (void)emu; + return my->dbus_message_set_data(message, slot, data, find_DBusFreeFunction_Fct(free_func)); +} +#endif +EXPORT int my32_dbus_pending_call_set_notify(x64emu_t* emu, void* pending, void* func, void* data, void* free_func) +{ + (void)emu; + return my->dbus_pending_call_set_notify(pending, findDBusPendingCallNotifyFunctionFct(func), data, find_DBusFreeFunction_Fct(free_func)); +} +#if 0 +EXPORT int my32_dbus_pending_call_set_data(x64emu_t* emu, void* pending, int32_t slot, void* data, void* free_func) +{ + (void)emu; + return my->dbus_pending_call_set_data(pending, slot, data, find_DBusFreeFunction_Fct(free_func)); +} +#endif +EXPORT void my32_dbus_watch_set_data(x64emu_t* emu, void* watch, void* data, void* free_func) +{ + (void)emu; + my->dbus_watch_set_data(watch, data, find_DBusFreeFunction_Fct(free_func)); +} +EXPORT void my32_dbus_connection_set_dispatch_status_function(x64emu_t* emu, void* connection, void* dispatch, void* data, void* free_func) +{ + (void)emu; + my->dbus_connection_set_dispatch_status_function(connection, findDBusDispatchStatusFunctionFct(dispatch), data, find_DBusFreeFunction_Fct(free_func)); + } + + +EXPORT int my32_dbus_connection_set_watch_functions(x64emu_t* emu, void* connection, void* add, void* remove, void* toggled, void* data, void* free_func) +{ + (void)emu; + return my->dbus_connection_set_watch_functions(connection, findDBusAddWatchFunctionFct(add), findDBusRemoveWatchFunctionFct(remove), findDBusWatchToggledFunctionFct(toggled), data, find_DBusFreeFunction_Fct(free_func)); +} + +typedef struct my_DBusObjectPathVTable_s +{ + void* unregister_function; + void* message_function; + void* pad1; + void* pad2; + void* pad3; + void* pad4; +} my_DBusObjectPathVTable_t; +typedef struct my_DBusObjectPathVTable_32_s +{ + ptr_t unregister_function; + ptr_t message_function; + ptr_t pad1; + ptr_t pad2; + ptr_t pad3; + ptr_t pad4; +} my_DBusObjectPathVTable_32_t; + +EXPORT int my32_dbus_connection_try_register_object_path(x64emu_t* emu, void* connection, void* path, my_DBusObjectPathVTable_32_t* vtable, void* data, void* error) +{ + (void)emu; + my_DBusObjectPathVTable_t vt = {0}; + if(vtable) { + vt.unregister_function = findDBusObjectPathUnregisterFunctionFct(from_ptrv(vtable->unregister_function)); + vt.message_function = findDBusObjectPathMessageFunctionFct(from_ptrv(vtable->message_function)); + vt.pad1 = finddbus_internal_padFct(from_ptrv(vtable->pad1)); + vt.pad2 = finddbus_internal_padFct(from_ptrv(vtable->pad2)); + vt.pad3 = finddbus_internal_padFct(from_ptrv(vtable->pad3)); + vt.pad4 = finddbus_internal_padFct(from_ptrv(vtable->pad4)); + } + + return my->dbus_connection_try_register_object_path(connection, path, vtable?&vt:NULL, data, error); +} +#if 0 +EXPORT int my32_dbus_connection_register_fallback(x64emu_t* emu, void* connection, void* path, my_DBusObjectPathVTable_t* vtable, void* data) +{ + (void)emu; + my_DBusObjectPathVTable_t vt = {0}; + if(vtable) { + vt.unregister_function = findDBusObjectPathUnregisterFunctionFct(vtable->unregister_function); + vt.message_function = findDBusObjectPathMessageFunctionFct(vtable->message_function); + vt.pad1 = finddbus_internal_padFct(vtable->pad1); + vt.pad2 = finddbus_internal_padFct(vtable->pad2); + vt.pad3 = finddbus_internal_padFct(vtable->pad3); + vt.pad4 = finddbus_internal_padFct(vtable->pad4); + } + + return my->dbus_connection_register_fallback(connection, path, vtable?&vt:NULL, data); +} + +EXPORT int my32_dbus_connection_set_data(x64emu_t* emu, void* connection, int slot, void* data, void* free_func) +{ + (void)emu; + return my->dbus_connection_set_data(connection, slot, data, find_DBusFreeFunction_Fct(free_func)); +} +#endif +EXPORT void my32_dbus_connection_set_wakeup_main_function(x64emu_t* emu, void* connection, void* wakeup, void* data, void* free_func) +{ + (void)emu; + my->dbus_connection_set_wakeup_main_function(connection, find_DBusWakeupMainFunction_Fct(wakeup), data, find_DBusFreeFunction_Fct(free_func)); +} +#if 0 +EXPORT int my32_dbus_connection_try_register_fallback(x64emu_t* emu, void* connection, void* path, my_DBusObjectPathVTable_t* vtable, void* data, void* error) +{ + (void)emu; + my_DBusObjectPathVTable_t vt = {0}; + if(vtable) { + vt.unregister_function = findDBusObjectPathUnregisterFunctionFct(vtable->unregister_function); + vt.message_function = findDBusObjectPathMessageFunctionFct(vtable->message_function); + vt.pad1 = finddbus_internal_padFct(vtable->pad1); + vt.pad2 = finddbus_internal_padFct(vtable->pad2); + vt.pad3 = finddbus_internal_padFct(vtable->pad3); + vt.pad4 = finddbus_internal_padFct(vtable->pad4); + } + + return my->dbus_connection_try_register_fallback(connection, path, vtable?&vt:NULL, data, error); +} + +EXPORT int my32_dbus_server_set_watch_functions(x64emu_t* emu, void* server, void* add, void* rem, void* toggle, void* data, void* d) +{ + return my->dbus_server_set_watch_functions(server, findDBusAddWatchFunctionFct(add), findDBusRemoveWatchFunctionFct(rem), findDBusWatchToggledFunctionFct(toggle), data, find_DBusFreeFunction_Fct(d)); +} + +EXPORT void my32_dbus_server_set_new_connection_function(x64emu_t* emu, void* server, void* f, void* data, void* d) +{ + my->dbus_server_set_new_connection_function(server, findDBusNewConnectionFunctionFct(f), data, find_DBusFreeFunction_Fct(d)); +} + +EXPORT int my32_dbus_server_set_timeout_functions(x64emu_t* emu, void* server, void* add, void* rem, void* toggle, void* data, void* d) +{ + return my->dbus_server_set_timeout_functions(server, find_DBusAddTimeoutFunction_Fct(add), find_DBusRemoveTimeoutFunction_Fct(rem), find_DBusTimeoutToggledFunction_Fct(toggle), data, find_DBusFreeFunction_Fct(d)); +} + +EXPORT int my32_dbus_server_set_data(x64emu_t* emu, void* server, int slot, void* data, void* d) +{ + return my->dbus_server_set_data(server, slot, data, find_DBusFreeFunction_Fct(d)); +} +#endif + +EXPORT uint32_t my32_dbus_message_iter_append_basic(x64emu_t* emu, void* iter, int type, void* value) +{ + void* str; + void* value_l = value; + switch(type) { + case 's': + str = from_ptrv(*(ptr_t*)value); + value_l = &str; + break; + case 'b': // nothing to do + case 'i': + case 'd': + break; + default: + printf_log(LOG_INFO, "dbus_message_iter_append_basic called with type %d(%c)\n", type, type); + } + return my->dbus_message_iter_append_basic(iter, type, value_l); +} + +EXPORT void my32_dbus_free_string_array(x64emu_t* emu, void* l) +{ + my->dbus_free_string_array(inplace_expand_arraystring(l)); +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappeddbus_private.h b/src/wrapped32/wrappeddbus_private.h new file mode 100644 index 0000000..3f82ec7 --- /dev/null +++ b/src/wrapped32/wrappeddbus_private.h @@ -0,0 +1,235 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(dbus_address_entries_free, vFbp_) +GO(dbus_address_entry_get_method, pFp) +GO(dbus_address_entry_get_value, pFpp) +GO(dbus_address_escape_value, pFp) +GO(dbus_address_unescape_value, pFpbppuuuuup_) +GO(dbus_bus_add_match, vFppbppuuuuup_) +GO(dbus_bus_get, pFubppuuuuup_) +GO(dbus_bus_get_id, pFpbppuuuuup_) +GO(dbus_bus_get_private, pFubppuuuuup_) +GO(dbus_bus_get_unique_name, pFp) +GO(dbus_bus_get_unix_user, LFppbppuuuuup_) +GO(dbus_bus_name_has_owner, uFppbppuuuuup_) +GO(dbus_bus_register, uFpbppuuuuup_) +GO(dbus_bus_release_name, iFppbppuuuuup_) +GO(dbus_bus_remove_match, vFppbppuuuuup_) +GO(dbus_bus_request_name, iFppubppuuuuup_) +GO(dbus_bus_set_unique_name, uFpp) +GO(dbus_bus_start_service_by_name, uFppupbppuuuuup_) +GOM(dbus_connection_add_filter, uFEpppp) +GO(dbus_connection_allocate_data_slot, uFp) +GO(dbus_connection_borrow_message, pFp) +GO(dbus_connection_can_send_type, uFpi) +GO(dbus_connection_close, vFp) +GO(dbus_connection_dispatch, uFp) +GO(dbus_connection_flush, vFp) +GO(dbus_connection_free_data_slot, vFp) +GO(dbus_connection_free_preallocated_send, vFpp) +GO(dbus_connection_get_adt_audit_session_data, uFpbp_p) +GO(dbus_connection_get_data, pFpi) +GO(dbus_connection_get_dispatch_status, uFp) +GO(dbus_connection_get_is_anonymous, uFp) +GO(dbus_connection_get_is_authenticated, uFp) +GO(dbus_connection_get_is_connected, uFp) +GO(dbus_connection_get_max_message_size, lFp) +GO(dbus_connection_get_max_received_size, lFp) +GO(dbus_connection_get_object_path_data, uFppbp_) +GO(dbus_connection_get_outgoing_size, lFp) +GO(dbus_connection_get_server_id, pFp) +GO(dbus_connection_get_socket, uFpp) +GO(dbus_connection_get_unix_fd, uFpp) +GO(dbus_connection_get_unix_process_id, uFpbL_) +GO(dbus_connection_get_unix_user, uFpbL_) +GO(dbus_connection_get_windows_user, uFpbp_) +GO(dbus_connection_has_messages_to_send, uFp) +//GOM(dbus_connection_list_registered, uFEppbp_) +GO(dbus_connection_open, pFpbppuuuuup_) +GO(dbus_connection_open_private, pFpbppuuuuup_) +GO(dbus_connection_pop_message, pFp) +GO(dbus_connection_preallocate_send, pFp) +GO(dbus_connection_read_write, uFpi) +GO(dbus_connection_read_write_dispatch, uFpi) +GO(dbus_connection_ref, pFp) +//GOM(dbus_connection_register_fallback, uFEppbpppppp_p) +//GOM(dbus_connection_register_object_path, uFEppbpppppp_p) +GOM(dbus_connection_remove_filter, vFEppp) +GO(dbus_connection_return_message, vFpp) +GO(dbus_connection_send, uFppp) +GO(dbus_connection_send_preallocated, vFpppp) +GO(dbus_connection_send_with_reply, uFppbp_i) +GO(dbus_connection_send_with_reply_and_block, pFppibppuuuuup_) +GO(dbus_connection_set_allow_anonymous, vFpu) +GO(dbus_connection_set_change_sigpipe, vFu) +GOM(dbus_connection_set_data, uFEpipp) +GOM(dbus_connection_set_dispatch_status_function, vFEpppp) +GO(dbus_connection_set_exit_on_disconnect, vFpu) +GO(dbus_connection_set_max_message_size, vFpl) +GO(dbus_connection_set_max_received_size, vFpl) +GO(dbus_connection_set_route_peer_messages, vFpu) +GOM(dbus_connection_set_timeout_functions, uFEpppppp) +//GOM(dbus_connection_set_unix_user_function, vFEpppp) +GOM(dbus_connection_set_wakeup_main_function, vFEpppp) +GOM(dbus_connection_set_watch_functions, uFEpppppp) +//GOM(dbus_connection_set_windows_user_function, vFEpppp) +GO(dbus_connection_steal_borrowed_message, vFpp) +//GOM(dbus_connection_try_register_fallback, uFEppbpppppp_pbppuuuuup_) +GOM(dbus_connection_try_register_object_path, uFEppppbppuuuuup_) +GO(dbus_connection_unref, vFp) +GO(dbus_connection_unregister_object_path, uFpp) +GO(dbus_error_free, vFbppuuuuup_) +GO(dbus_error_has_name, uFbppuuuuup_p) +GO(dbus_error_init, vFbppuuuuup_) +GO(dbus_error_is_set, uFbppuuuuup_) +GO(dbus_free, vFp) +GOM(dbus_free_string_array, vFEp) +GO(dbus_get_local_machine_id, pFv) +GO(dbus_get_version, vFppp) +//GO(dbus_internal_do_not_use_create_uuid, +//GO(dbus_internal_do_not_use_get_uuid, +GO(dbus_malloc, pFL) +GO(dbus_malloc0, pFL) +GO(dbus_message_allocate_data_slot, uFp) +GOM(dbus_message_append_args, uFEpiV) +GOM(dbus_message_append_args_valist, uFEpip) //%% +GO(dbus_message_copy, pFp) +GO(dbus_message_demarshal, pFpibppuuuuup_) +GO(dbus_message_demarshal_bytes_needed, iFpi) +GO(dbus_message_free_data_slot, vFp) +GOM(dbus_message_get_args, uFEpbppuuuuup_iV) +GO(dbus_message_get_allow_interactive_authorization, uFp) +GOM(dbus_message_get_args_valist, uFEpbppuuuuup_ip) //%% +GO(dbus_message_get_auto_start, uFp) +GO(dbus_message_get_data, pFpi) +GO(dbus_message_get_destination, pFp) +GO(dbus_message_get_error_name, pFp) +GO(dbus_message_get_interface, pFp) +GO(dbus_message_get_member, pFp) +GO(dbus_message_get_no_reply, uFp) +GO(dbus_message_get_path, pFp) +//GOM(dbus_message_get_path_decomposed, uFEpbp_) +GO(dbus_message_get_reply_serial, uFp) +GO(dbus_message_get_sender, pFp) +GO(dbus_message_get_serial, uFp) +GO(dbus_message_get_signature, pFp) +GO(dbus_message_get_type, iFp) +GO(dbus_message_has_destination, uFpp) +GO(dbus_message_has_interface, uFpp) +GO(dbus_message_has_member, uFpp) +GO(dbus_message_has_path, uFpp) +GO(dbus_message_has_sender, uFpp) +GO(dbus_message_has_signature, uFpp) +GO(dbus_message_is_error, uFpp) +GO(dbus_message_is_method_call, uFppp) +GO(dbus_message_is_signal, uFppp) +GO(dbus_message_iter_abandon_container, vFbppuiiiiiiiiipp_bppuiiiiiiiiipp_) +GOM(dbus_message_iter_append_basic, uFEbppuiiiiiiiiipp_ip) +GO(dbus_message_iter_append_fixed_array, uFbppuiiiiiiiiipp_ipi) +GO(dbus_message_iter_close_container, uFbppuiiiiiiiiipp_bppuiiiiiiiiipp_) +GO(dbus_message_iter_get_arg_type, iFbppuiiiiiiiiipp_) +GO(dbus_message_iter_get_array_len, iFbppuiiiiiiiiipp_) +GO(dbus_message_iter_get_basic, vFbppuiiiiiiiiipp_p) +GO(dbus_message_iter_get_element_type, iFbppuiiiiiiiiipp_) +GO(dbus_message_iter_get_element_count, iFbppuiiiiiiiiipp_) +GO(dbus_message_iter_get_fixed_array, vFbppuiiiiiiiiipp_pp) +GO(dbus_message_iter_get_signature, pFbppuiiiiiiiiipp_) +GO(dbus_message_iter_has_next, uFbppuiiiiiiiiipp_) +GO(dbus_message_iter_init, uFpbppuiiiiiiiiipp_) +GO(dbus_message_iter_init_append, vFpbppuiiiiiiiiipp_) +GO(dbus_message_iter_next, uFbppuiiiiiiiiipp_) +GO(dbus_message_iter_open_container, uFbppuiiiiiiiiipp_ipbppuiiiiiiiiipp_) +GO(dbus_message_iter_recurse, vFbppuiiiiiiiiipp_bppuiiiiiiiiipp_) +GO(dbus_message_lock, vFp) +GO(dbus_message_marshal, uFpbp_p) +GO(dbus_message_new, pFi) +GO(dbus_message_new_error, pFppp) +//GOM(dbus_message_new_error_printf, pFEpppV) +GO(dbus_message_new_method_call, pFpppp) +GO(dbus_message_new_method_return, pFp) +GO(dbus_message_new_signal, pFppp) +GO(dbus_message_ref, pFp) +GO(dbus_message_set_allow_interactive_authorization, vFpu) +GO(dbus_message_set_auto_start, vFpu) +//GOM(dbus_message_set_data, uFEpipp) +GO(dbus_message_set_destination, uFpp) +GO(dbus_message_set_error_name, uFpp) +GO(dbus_message_set_interface, uFpp) +GO(dbus_message_set_member, uFpp) +GO(dbus_message_set_no_reply, vFpu) +GO(dbus_message_set_path, uFpp) +GO(dbus_message_set_reply_serial, uFpu) +GO(dbus_message_set_sender, uFpp) +GO(dbus_message_set_serial, vFpu) +GO(dbus_message_type_from_string, iFp) +GO(dbus_message_type_to_string, pFi) +GO(dbus_message_unref, vFp) +GO(dbus_move_error, vFbppuuuuup_bppuuuuup_) +//GOM(dbus_parse_address, uFEpbp_pbppuuuuup_) +GO(dbus_pending_call_allocate_data_slot, uFp) +GO(dbus_pending_call_block, vFp) +GO(dbus_pending_call_cancel, vFp) +GO(dbus_pending_call_free_data_slot, vFp) +GO(dbus_pending_call_get_completed, uFp) +GO(dbus_pending_call_get_data, pFpi) +GO(dbus_pending_call_ref, pFp) +//GOM(dbus_pending_call_set_data, uFEpipp) +GOM(dbus_pending_call_set_notify, uFEpppp) +GO(dbus_pending_call_steal_reply, pFp) +GO(dbus_pending_call_unref, vFp) +GO(dbus_realloc, pFpL) +GO(dbus_server_allocate_data_slot, uFp) +GO(dbus_server_disconnect, vFp) +GO(dbus_server_free_data_slot, vFp) +GO(dbus_server_get_address, pFp) +GO(dbus_server_get_data, pFpi) +GO(dbus_server_get_id, pFp) +GO(dbus_server_get_is_connected, uFp) +GO(dbus_server_listen, pFpbppuuuuup_) +GO(dbus_server_ref, pFp) +GO(dbus_server_set_auth_mechanisms, uFpbp_) +//GOM(dbus_server_set_data, uFEpipp) +//GOM(dbus_server_set_new_connection_function, vFEpppp) +//GOM(dbus_server_set_timeout_functions, uFEpppppp) +//GOM(dbus_server_set_watch_functions, uFEpppppp) +GO(dbus_server_unref, vFp) +//GOM(dbus_set_error, vFEbppuuuuup_ppV) +GO(dbus_set_error_const, vFbppuuuuup_pp) +GO(dbus_set_error_from_message, uFbppuuuuup_p) +GO(dbus_shutdown, vFv) +GO(dbus_signature_iter_get_current_type, iFbppuii_) +GO(dbus_signature_iter_get_element_type, iFbppuii_) +GO(dbus_signature_iter_get_signature, pFbppuii_) +GO(dbus_signature_iter_init, vFbppuii_p) +GO(dbus_signature_iter_next, uFbppuii_) +GO(dbus_signature_iter_recurse, vFbppuii_bppuii_) +GO(dbus_signature_validate, uFpbppuuuuup_) +GO(dbus_signature_validate_single, uFpbppuuuuup_) +//GOM(dbus_threads_init, uFEbupppppppppppppppppp_) +GO(dbus_threads_init_default, uFv) +GO(dbus_timeout_get_data, pFp) +GO(dbus_timeout_get_enabled, uFp) +GO(dbus_timeout_get_interval, iFp) +GO(dbus_timeout_handle, uFp) +GOM(dbus_timeout_set_data, vFEppp) +GO(dbus_try_get_local_machine_id, pFpbppuuuuup_) +GO(dbus_type_is_basic, uFi) +GO(dbus_type_is_container, uFi) +GO(dbus_type_is_fixed, uFi) +GO(dbus_type_is_valid, uFi) +GO(dbus_validate_bus_name, uFpbppuuuuup_) +GO(dbus_validate_error_name, uFpbppuuuuup_) +GO(dbus_validate_interface, uFpbppuuuuup_) +GO(dbus_validate_member, uFpbppuuuuup_) +GO(dbus_validate_path, uFpbppuuuuup_) +GO(dbus_validate_utf8, uFpbppuuuuup_) +GO(dbus_watch_get_data, pFp) +GO(dbus_watch_get_enabled, uFp) +GO(dbus_watch_get_fd, iFp) +GO(dbus_watch_get_flags, uFp) +GO(dbus_watch_get_socket, iFp) +GO(dbus_watch_get_unix_fd, iFp) +GO(dbus_watch_handle, uFpu) +GOM(dbus_watch_set_data, vFEppp) diff --git a/src/wrapped32/wrappedexpat.c b/src/wrapped32/wrappedexpat.c new file mode 100644 index 0000000..e63d394 --- /dev/null +++ b/src/wrapped32/wrappedexpat.c @@ -0,0 +1,795 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" + +static const char* expatName = "libexpat.so.1"; +#define LIBNAME expat + +#include "generated/wrappedexpattypes32.h" + +#include "wrappercallback32.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// StartElementHandler ... +#define GO(A) \ +static uintptr_t my_StartElementHandler_fct_##A = 0; \ +static void* my_StartElementHandler_##A(void* data, void* name, void** attr) \ +{ \ + int cnt = 0; \ + while(attr[cnt]) cnt+=2; \ + ++cnt; \ + ptr_t attr_s[cnt]; \ + for(int i=0; iXML_SetElementHandler(p, find_StartElementHandler_Fct(start), find_End_Fct(end)); +} + +EXPORT void my32_XML_SetCharacterDataHandler(x64emu_t* emu, void* p, void* h) +{ + my->XML_SetCharacterDataHandler(p, find_CharData_Fct(h)); +} + +//EXPORT void my32_XML_SetNamespaceDeclHandler(x64emu_t* emu, void* p, void* start, void* end) +//{ +// my->XML_SetNamespaceDeclHandler(p, find_StartNamespaceDecl_Fct(start), find_EndNamespaceDecl_Fct(end)); +//} + +//EXPORT void my32_XML_SetEntityDeclHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetEntityDeclHandler(p, find_EntityDecl_Fct(f)); +//} + +//EXPORT void my32_XML_SetStartDoctypeDeclHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetStartDoctypeDeclHandler(p, find_StartDoctypeDecl_Fct(f)); +//} + +//EXPORT void my32_XML_SetEndDoctypeDeclHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetEndDoctypeDeclHandler(p, find_EndDoctypeDecl_Fct(f)); +//} + +//EXPORT void my32_XML_SetElementDeclHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetElementDeclHandler(p, find_ElementDecl_Fct(f)); +//} + +//EXPORT void my32_XML_SetDefaultHandlerExpand(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetDefaultHandlerExpand(p, find_Default_Fct(f)); +//} + +//EXPORT void my32_XML_SetCommentHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetCommentHandler(p, find_Comment_Fct(f)); +//} + +//EXPORT void my32_XML_SetProcessingInstructionHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetProcessingInstructionHandler(p, find_ProcessingInstruction_Fct(f)); +//} + +//EXPORT void my32_XML_SetStartElementHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetStartElementHandler(p, find_StartElement_Fct(f)); +//} + +//EXPORT void my32_XML_SetEndElementHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetEndElementHandler(p, find_EndElement_Fct(f)); +//} + +//EXPORT void my32_XML_SetUnknownEncodingHandler(x64emu_t* emu, void* p, void* f, void* d) +//{ +// my->XML_SetUnknownEncodingHandler(p, find_UnknownEncoding_Fct(f), d); +//} + +//EXPORT void my32_XML_SetUnparsedEntityDeclHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetUnparsedEntityDeclHandler(p, find_UnparsedEntityDecl_Fct(f)); +//} + +//EXPORT void my32_XML_SetNotationDeclHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetNotationDeclHandler(p, find_NotationDecl_Fct(f)); +//} + +//EXPORT void my32_XML_SetStartNamespaceDeclHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetStartNamespaceDeclHandler(p, find_StartNamespaceDecl_Fct(f)); +//} + +//EXPORT void my32_XML_SetEndNamespaceDeclHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetEndNamespaceDeclHandler(p, find_EndNamespaceDecl_Fct(f)); +//} + +//EXPORT void my32_XML_SetStartCdataSectionHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetStartCdataSectionHandler(p, find_StartCdataSection_Fct(f)); +//} + +//EXPORT void my32_XML_SetEndCdataSectionHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetEndCdataSectionHandler(p, find_EndCdataSection_Fct(f)); +//} + +//EXPORT void my32_XML_SetDefaultHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetDefaultHandler(p, find_Default_Fct(f)); +//} + +//EXPORT void my32_XML_SetNotStandaloneHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetNotStandaloneHandler(p, find_NotStandalone_Fct(f)); +//} + +//EXPORT void my32_XML_SetExternalEntityRefHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetExternalEntityRefHandler(p, find_ExternalEntityRef_Fct(f)); +//} + +//EXPORT void my32_XML_SetXmlDeclHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetXmlDeclHandler(p, find_XmlDecl_Fct(f)); +//} + +//EXPORT void my32_XML_SetAttlistDeclHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetAttlistDeclHandler(p, find_AttlistDecl_Fct(f)); +//} + +//EXPORT void my32_XML_SetSkippedEntityHandler(x64emu_t* emu, void* p, void* f) +//{ +// my->XML_SetSkippedEntityHandler(p, find_SkippedEntity_Fct(f)); +//} + +EXPORT void my32_XML_SetDoctypeDeclHandler(x64emu_t* emu, void* p, void* start, void* end) +{ + (void)emu; + my->XML_SetDoctypeDeclHandler(p, find_StartDoctypeDecl_Fct(start), find_EndDoctypeDecl_Fct(end)); +} + +// this function will call the callbacks with many structures created on the stack, wich might be a 64bits walue on the initial thred +// so using a swapcontext trick to use a 32bits stack temporarily +// TODO: generalise this on main? +static void func1(uint32_t* ret, void* p, int a, int b) +{ + *ret = my->XML_ParseBuffer(p, a, b); +} +ucontext_t uctx_main, uctx_func1; + +#ifndef ANDROID +EXPORT uint32_t my32_XML_ParseBuffer(x64emu_t* emu, void* p, int a, int b) +{ + getcontext(&uctx_func1); + size_t stack_size = 1024*1024; + void* func1_stack = mmap(NULL, stack_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_32BIT|MAP_ANONYMOUS|MAP_GROWSDOWN, -1, 0); + uctx_func1.uc_stack.ss_sp = func1_stack; + uctx_func1.uc_stack.ss_size = stack_size; + uctx_func1.uc_link = &uctx_main; + uint32_t ret = 0; + makecontext(&uctx_func1, (void*)func1, 4, &ret, p, a, b); + swapcontext(&uctx_main, &uctx_func1); + munmap(func1_stack, stack_size); + return ret; +} +#endif + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedexpat_private.h b/src/wrapped32/wrappedexpat_private.h new file mode 100644 index 0000000..5de7b18 --- /dev/null +++ b/src/wrapped32/wrappedexpat_private.h @@ -0,0 +1,71 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//GO(_INTERNAL_trim_to_complete_utf8_characters, +//GO(XML_DefaultCurrent, vFp) +GO(XML_ErrorString, pFu) +//GO(XML_ExpatVersion, pFv) +//GO(XML_ExpatVersionInfo, pFp) // return a struct of 3 int. Use shadow pointer on ARM64 and x86_64 +//GO(XML_ExternalEntityParserCreate, pFppp) +//GO(XML_FreeContentModel, vFpp) +//GO(XML_GetBase, pFp) +GO(XML_GetBuffer, pFpi) +//GO(XML_GetCurrentByteCount, iFp) +//GO(XML_GetCurrentByteIndex, lFp) +//GO(XML_GetCurrentColumnNumber, LFp) +GO(XML_GetCurrentLineNumber, LFp) +GO(XML_GetErrorCode, uFp) +//GO(XML_GetFeatureList, pFv) +//GO(XML_GetIdAttributeIndex, iFp) +//GO(XML_GetInputContext, pFppp) +//GO(XML_GetParsingStatus, vFpp) +//GO(XML_GetSpecifiedAttributeCount, iFp) +//GO(XML_MemFree, vFpp) +//GO(XML_MemMalloc, pFpL) +//GO(XML_MemRealloc, pFppL) +//GO(XML_Parse, uFppii) +GOM(XML_ParseBuffer, uFEpii) +GO(XML_ParserCreate, pFp) +//GO(XML_ParserCreate_MM, pFpppp) // return a structure +//GO(XML_ParserCreateNS, pFpc) +GO(XML_ParserFree, vFp) +//GO(XML_ParserReset, CFpp) +//GO(XML_ResumeParser, uFp) +//GOM(XML_SetAttlistDeclHandler, vFEpp) +//GO(XML_SetBase, uFpp) +//GOM(XML_SetCdataSectionHandler, vFEppp) +GOM(XML_SetCharacterDataHandler, vFEpp) +//GOM(XML_SetCommentHandler, vFEpp) +//GOM(XML_SetDefaultHandler, vFEpp) +//GOM(XML_SetDefaultHandlerExpand, vFEpp) +GOM(XML_SetDoctypeDeclHandler, vFEppp) +//GOM(XML_SetElementDeclHandler, vFEpp) +GOM(XML_SetElementHandler, vFEppp) +//GO(XML_SetEncoding, uFpp) +//GOM(XML_SetEndCdataSectionHandler, vFEpp) +//GOM(XML_SetEndDoctypeDeclHandler, vFEpp) +//GOM(XML_SetEndElementHandler, vFEpp) +//GOM(XML_SetEndNamespaceDeclHandler, vFEpp) +//GOM(XML_SetEntityDeclHandler, vFEpp) +//GOM(XML_SetExternalEntityRefHandler, vFEpp) +//GO(XML_SetExternalEntityRefHandlerArg, vFpp) +//GO(XML_SetHashSalt, iFpL) +//GOM(XML_SetNamespaceDeclHandler, vFEppp) +//GOM(XML_SetNotationDeclHandler, vFEpp) +//GOM(XML_SetNotStandaloneHandler, vFEpp) +//GO(XML_SetParamEntityParsing, iFpu) +//GOM(XML_SetProcessingInstructionHandler, vFEpp) +//GO(XML_SetReturnNSTriplet, vFpi) +//GOM(XML_SetSkippedEntityHandler, vFEpp) +//GOM(XML_SetStartCdataSectionHandler, vFEpp) +//GOM(XML_SetStartDoctypeDeclHandler, vFEpp) +//GOM(XML_SetStartElementHandler, vFEpp) +//GOM(XML_SetStartNamespaceDeclHandler, vFEpp) +//GOM(XML_SetUnknownEncodingHandler, vFEppp) +//GOM(XML_SetUnparsedEntityDeclHandler, vFEpp) +GO(XML_SetUserData, vFpp) +//GOM(XML_SetXmlDeclHandler, vFEpp) +//GO(XML_StopParser, uFpC) +//GO(XML_UseForeignDTD, uFpC) +//GO(XML_UseParserAsHandlerArg, vFp) diff --git a/src/wrapped32/wrappedfontconfig.c b/src/wrapped32/wrappedfontconfig.c new file mode 100644 index 0000000..f720789 --- /dev/null +++ b/src/wrapped32/wrappedfontconfig.c @@ -0,0 +1,326 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "converter32.h" + +typedef struct FcValue_s { + int type; + union { + const char *s; + int i; + int b; + double d; + void *m; //const FcMatrix + void *c; //const FcCharSet + void *f; + void *l; //const FcLangSet + } u; +} FcValue_t; + +typedef struct FcPattern_s { + int num; + int size; + intptr_t elts_offset; + int ref; +} FcPattern_t; + +typedef struct FcFontSet_s { + int nfont; + int sfont; + FcPattern_t **fonts; +} FcFontSet_t; + +typedef struct FcStrSet_s { + int ref; + int num; + int size; + void **strs; +} FcStrSet_t; + +typedef struct FcBlanks_s { + int nblank; + int sblank; + void *blanks; +} FcBlanks_t; + +typedef struct FcConfig_s { + FcStrSet_t *configDirs; + FcBlanks_t *blanks; + FcStrSet_t *fontDirs; + FcStrSet_t *cacheDirs; + FcStrSet_t *configFiles; + void *substPattern; //FcSubst + void *substFont; //FcSubst + void *substScan; //FcSubst + int maxObjects; + FcStrSet_t *acceptGlobs; + FcStrSet_t *rejectGlobs; + FcFontSet_t *acceptPatterns; + FcFontSet_t *rejectPatterns; + FcFontSet_t *fonts[2]; + time_t rescanTime; + int rescanInterval; + int ref; + void *expr_pool; //FcExprPage +} FcConfig_t; + +// 32bits structures + +typedef struct __attribute__((packed, aligned(4))) FcValue_32_s { + int type; + union { + ptr_t s;//const char * + int i; + int b; + double d; + ptr_t m; //const FcMatrix* + ptr_t c; //const FcCharSet* + ptr_t f; //void* + ptr_t l; //const FcLangSet* + } u; +} FcValue_32_t; + +typedef struct FcPattern_32_s { + int num; + int size; + long_t elts_offset; + int ref; +} FcPattern_32_t; + +typedef struct FcFontSet_32_s { + int nfont; + int sfont; + ptr_t fonts;//FcPattern_t ** +} FcFontSet_32_t; + +typedef struct FcStrSet_32_s { + int ref; + int num; + int size; + ptr_t strs; //void ** +} FcStrSet_32_t; + +typedef struct FcBlanks_32_s { + int nblank; + int sblank; + ptr_t blanks; //void * +} FcBlanks_32_t; + +typedef struct FcConfig_32_s { + ptr_t configDirs; //FcStrSet_t* + ptr_t blanks; //FcBlanks_t* + ptr_t fontDirs; //FcStrSet_t* + ptr_t cacheDirs; //FcStrSet_t* + ptr_t configFiles; //FcStrSet_t* + ptr_t substPattern; //FcSubst* + ptr_t substFont; //FcSubst* + ptr_t substScan; //FcSubst* + int maxObjects; + ptr_t acceptGlobs; //FcStrSet_t* + ptr_t rejectGlobs; //FcStrSet_t* + ptr_t acceptPatterns; //FcFontSet_t* + ptr_t rejectPatterns; //FcFontSet_t* + ptr_t fonts[2]; //FcFontSet_t* + long_t rescanTime; + int rescanInterval; + int ref; + ptr_t expr_pool; //FcExprPage* +} FcConfig_32_t; + +#ifdef ANDROID + static const char* fontconfigName = "libfontconfig.so"; +#else + static const char* fontconfigName = "libfontconfig.so.1"; +#endif + +#define LIBNAME fontconfig + +#define ADDED_STRUCT() \ + iFppSi_t FcPatternAdd_; \ + +#define ADDED_INIT() \ + my->FcPatternAdd_ = (void*)my->FcPatternAdd;\ + +typedef int (*iFppSi_t)(void*, void*, FcValue_t, int); +typedef void*(*pFpA_t)(void*, va_list); + +#define ADDED_FUNCTIONS() \ + GO(FcObjectSetVaBuild, pFpA_t); \ + GO(FcPatternVaBuild, pFpA_t); \ + +#include "generated/wrappedfontconfigtypes32.h" + +#include "wrappercallback32.h" + +EXPORT void* my32_FcObjectSetVaBuild(x64emu_t* emu, void* first, void* V) +{ + PREPARE_VALIST_32_(V); + return my->FcObjectSetVaBuild(first, VARARGS_32_(V)); +} +EXPORT void* my32_FcObjectSetBuild(x64emu_t* emu, void* first, uint64_t* b) +{ + if(!first) + return my->FcObjectSetBuild(first, NULL); + PREPARE_VALIST_32_(b); + return my->FcObjectSetVaBuild(first, VARARGS_32_(b)); +} + +EXPORT void* my32_FcPatternVaBuild(x64emu_t* emu, void* pattern, void* V) +{ + PREPARE_VALIST_32_(V); + return my->FcPatternVaBuild(pattern, VARARGS_32_(V)); +} +EXPORT void* my32_FcPatternBuild(x64emu_t* emu, void* pattern, uint64_t* b) +{ + if(!pattern) + return my->FcPatternBuild(pattern, NULL); + PREPARE_VALIST_32_(b); + return my->FcPatternVaBuild(pattern, VARARGS_32_(b)); +} + +typedef union fcvalue_32s { + ptr_t p; + double d; + int i; +} fcvalue_32_t; +EXPORT int my32_FcPatternAdd(void* p, void* object, int type, fcvalue_32_t t, int append) +{ + // adjusting value "t" of the FcValue + FcValue_t val = {0}; + val.type = type; + switch(type) { + case 3: + case 5: + case 6: + case 7: + case 8: + case 9: + val.u.c = from_ptrv(t.p); + break; + case 2: + val.u.d = t.d; + break; + case 1: + case 4: // just in case + val.u.i = t.i; + break; + } + return my->FcPatternAdd_(p, object, val, append); +} + +void inplace_FT_FaceRec_shrink(void* face); +void inplace_FT_FaceRec_enlarge(void* face); +EXPORT uint32_t my32_FcFreeTypeCharIndex(x64emu_t* emu, void* face, uint32_t u) +{ + inplace_FT_FaceRec_enlarge(face); + uint32_t ret = my->FcFreeTypeCharIndex(face, u); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +void* inplace_FcFontSet_shrink(void* set) +{ + if(!set) return set; + FcFontSet_t* src = set; + FcFontSet_32_t* dst = set; + + for(int i=0; infont; ++i) { + ((ptr_t*)src->fonts)[i] = to_ptrv(src->fonts[i]); + } + dst->nfont = src->nfont; + dst->sfont = src->sfont; + dst->fonts = to_ptrv(src->fonts); + + return set; +} +void* inplace_FcFontSet_enlarge(void* set) +{ + FcFontSet_32_t* src = set; + FcFontSet_t* dst = set; + + dst->fonts = from_ptrv(src->fonts); + dst->sfont = src->sfont; + dst->nfont = src->nfont; + for(int i=src->nfont-1; i>=0; --i) { + dst->fonts[i] = from_ptrv(((ptr_t*)dst->fonts)[i]); + } + + return set; +} + +EXPORT void* my32_FcFontList(x64emu_t* emu, void* config, void* pattern, void* os) +{ + return inplace_FcFontSet_shrink(my->FcFontList(config, pattern, os)); +} + +EXPORT void* my32_FcFontSort(x64emu_t* emu, void* config, void* pattern, int trim, void* csp, int* result) +{ + return inplace_FcFontSet_shrink(my->FcFontSort(config, pattern, trim, csp, result)); +} + +EXPORT void* my32_FcCacheCopySet(x64emu_t* emu, void* cache) +{ + return inplace_FcFontSet_shrink(my->FcCacheCopySet(cache)); +} + +EXPORT void my32_FcFontSetDestroy(x64emu_t* emu, void* set) +{ + my->FcFontSetDestroy(inplace_FcFontSet_enlarge(set)); +} + +EXPORT void* my32_FcFontSetCreate(x64emu_t* emu) +{ + void* ret = my->FcFontSetCreate(); + return inplace_FcFontSet_shrink(ret); +} + +EXPORT int my32_FcFontSetAdd(x64emu_t* emu, void* set, void* pattern) +{ + inplace_FcFontSet_enlarge(set); + int ret = my->FcFontSetAdd(set, pattern); + inplace_FcFontSet_shrink(set); + return ret; +} + +EXPORT void* my32_FcConfigGetFonts(x64emu_t* emu, void* config, uint32_t name) +{ + return inplace_FcFontSet_shrink(my->FcConfigGetFonts(config, name)); // that's probably a bad idea, as the font is own by the config +} + +EXPORT void* my32_FcFontSetSort(x64emu_t* emu, void* config, ptr_t* sets, int nsets, void* pattern, int trim, ptr_t* csp, void* result) +{ + void** sets_l[nsets]; + void* csp_l = csp?from_ptrv(*csp):NULL; + for(int i=0; iFcFontSetSort(config, sets_l, nsets, pattern, trim, csp?(&csp_l):NULL, result); + + for(int i=0; i so 3 "u32" on the stack + +GO(FcAtomicCreate, pFp) +GO(FcAtomicDeleteNew, vFp) +GO(FcAtomicDestroy, vFp) +GO(FcAtomicLock, iFp) +GO(FcAtomicNewFile, pFp) +GO(FcAtomicOrigFile, pFp) +GO(FcAtomicReplaceOrig, iFp) +GO(FcAtomicUnlock, vFp) +GO(FcBlanksAdd, iFpu) +GO(FcBlanksCreate, pFv) +GO(FcBlanksDestroy, vFp) +GO(FcBlanksIsMember, iFpu) +GOM(FcCacheCopySet, pFEp) +GO(FcCacheDir, pFp) +GO(FcCacheNumFont, iFp) +GO(FcCacheNumSubdir, iFp) +GO(FcCacheSubdir, pFpi) +GO(FcCharSetAddChar, iFpu) +GO(FcCharSetCopy, pFp) +GO(FcCharSetCount, uFp) +GO(FcCharSetCoverage, uFpup) +GO(FcCharSetCreate, pFv) +GO(FcCharSetDelChar, uFpu) +GO(FcCharSetDestroy, vFp) +GO(FcCharSetEqual, iFpp) +GO(FcCharSetFirstPage, uFppp) // second p is a fixed sized array +GO(FcCharSetHasChar, iFpu) +GO(FcCharSetIntersect, pFpp) +GO(FcCharSetIntersectCount, uFpp) +GO(FcCharSetIsSubset, iFpp) +GO(FcCharSetMerge, iFppp) +GO(FcCharSetNew, pFv) +GO(FcCharSetNextPage, uFppp) +GO(FcCharSetSubtract, pFpp) +GO(FcCharSetSubtractCount, uFpp) +GO(FcCharSetUnion, pFpp) +GO(FcConfigAppFontAddDir, iFpp) +GO(FcConfigAppFontAddFile, iFpp) +GO(FcConfigAppFontClear, vFp) +GO(FcConfigBuildFonts, iFp) +GO(FcConfigCreate, pFv) +GO(FcConfigDestroy, vFp) +GO(FcConfigEnableHome, iFi) +GO(FcConfigFilename, pFp) +GO(FcConfigGetBlanks, pFp) +GO(FcConfigGetCache, pFp) +GO(FcConfigGetCacheDirs, pFp) +GO(FcConfigGetConfigDirs, pFp) +GO(FcConfigGetConfigFiles, pFp) +GO(FcConfigGetCurrent, pFv) // need wrapping for FcConfig? +GO(FcConfigGetFontDirs, pFp) +GOM(FcConfigGetFonts, pFEpu) +GO(FcConfigGetRescanInterval, iFp) +//GO(FcConfigGetRescanInverval, +GO(FcConfigGetSysRoot, pFp) +GO(FcConfigHome, pFv) +GO(FcConfigParseAndLoad, iFppi) +GO(FcConfigReference, pFp) +GO(FcConfigSetCurrent, iFp) +GO(FcConfigSetRescanInterval, iFpi) +//GO(FcConfigSetRescanInverval, +GO(FcConfigSubstitute, iFppu) // might need wrapping, 1st arg is FcConfig +GO(FcConfigSubstituteWithPat, iFpppu) +GO(FcConfigUptoDate, iFp) +GO(FcDefaultSubstitute, vFp) +GO(FcDirCacheLoad, pFppbp_) +//GO(FcDirCacheLoadFile, pFpp) +GO(FcDirCacheRead, pFpip) +GO(FcDirCacheUnlink, iFpp) +GO(FcDirCacheUnload, vFp) +GO(FcDirCacheValid, iFp) +//GO(FcDirSave, iFbiibp__pp) +//GO(FcDirScan, iFbiibp__ppppi) +GO(FcFileIsDir, iFp) +//GO(FcFileScan, iFbiibp__ppppi) +GO(FcFini, vFv) +GOM(FcFontList, pFEppp) +GO(FcFontMatch, pFppp) +GO(FcFontRenderPrepare, pFppp) +GOM(FcFontSetAdd, iFEpp) +GOM(FcFontSetCreate, pFEv) +GOM(FcFontSetDestroy, vFEp) +//GO(FcFontSetList, biibp__Fpbbiibp___ipbiibp__) +//GO(FcFontSetMatch, pFpbbiibp___ipp) +//GO(FcFontSetPrint, vFbiibp__) +GOM(FcFontSetSort, pFEppipipp) +//GO(FcFontSetSortDestroy, vFbiibp__) +GOM(FcFontSort, pFEppibp_p) +GOM(FcFreeTypeCharIndex, uFEpu) +//GO(FcFreeTypeCharSet, +//GO(FcFreeTypeCharSetAndSpacing, +GO(FcFreeTypeQuery, pFpupp) +//GO(FcFreeTypeQueryFace, pFppip) +GO(FcGetLangs, pFv) +GO(FcGetVersion, iFv) +GO(FcInit, iFv) +GO(FcInitBringUptoDate, iFv) +GO(FcInitLoadConfig, pFv) +GO(FcInitLoadConfigAndFonts, pFv) +GO(FcInitReinitialize, iFv) +GO(FcLangGetCharSet, pFp) +GO(FcLangSetAdd, iFpp) +GO(FcLangSetCompare, uFpp) +GO(FcLangSetContains, iFpp) +GO(FcLangSetCopy, pFp) +GO(FcLangSetCreate, pFv) +GO(FcLangSetDestroy, vFp) +GO(FcLangSetEqual, iFpp) +GO(FcLangSetGetLangs, pFp) +GO(FcLangSetHash, uFp) +GO(FcLangSetHasLang, uFpp) +GO(FcMatrixCopy, pFp) +GO(FcMatrixEqual, iFpp) +GO(FcMatrixMultiply, vFppp) +GO(FcMatrixRotate, vFpdd) +GO(FcMatrixScale, vFpdd) +GO(FcMatrixShear, vFpdd) +GO(FcNameConstant, iFpp) +//GO(FcNameGetConstant, bppi_Fp) +//GO(FcNameGetObjectType, bpi_Fp) +GO(FcNameParse, pFp) +GO(FcNameRegisterConstants, iFbppi_i) +GO(FcNameRegisterObjectTypes, iFbpi_i) +GO(FcNameUnparse, pFp) +GO(FcNameUnregisterConstants, iFbppi_i) +GO(FcNameUnregisterObjectTypes, iFbpi_i) +GO(FcObjectSetAdd, iFpp) //GO(FcObjectSetAdd, iFbiibp__p) +GOM(FcObjectSetBuild, pFEpV) //GOM(FcObjectSetBuild, biibp__FEpV) +GO(FcObjectSetCreate, pFv) //GO(FcObjectSetCreate, biibp__Fv) +GO(FcObjectSetDestroy, vFp) //GO(FcObjectSetDestroy, vFbiibp__) +GOM(FcObjectSetVaBuild, pFEpp) //%% +GOM(FcPatternAdd, iFppiUi) //%noE //need M for the iU that is a an FcValue +GO(FcPatternAddBool, iFppi) +GO(FcPatternAddCharSet, iFppp) +GO(FcPatternAddDouble, iFppd) +//GO(FcPatternAddFTFace, iFppp) +GO(FcPatternAddInteger, iFppi) +GO(FcPatternAddLangSet, iFppp) +GO(FcPatternAddMatrix, iFppp) +GO(FcPatternAddString, iFppp) +//GO(FcPatternAddWeak, iFppiLi) +GOM(FcPatternBuild, pFEpV) +GO(FcPatternCreate, pFv) +GO(FcPatternDel, iFpp) +GO(FcPatternDestroy, vFp) +GO(FcPatternDuplicate, pFp) +GO(FcPatternEqual, iFpp) +//GO(FcPatternEqualSubset, iFppbiibp__) +//GO(FcPatternFilter, pFpbiibp__) +GO(FcPatternFormat, pFpp) +GO(FcPatternGet, uFppip) +GO(FcPatternGetBool, uFppip) +GO(FcPatternGetCharSet, uFppibp_) +GO(FcPatternGetDouble, uFppip) +//GO(FcPatternGetFTFace, iFppip) +GO(FcPatternGetInteger, uFppip) +GO(FcPatternGetLangSet, uFppibp_) +GO(FcPatternGetMatrix, uFppibp_) +GO(FcPatternGetString, uFppibp_) +GO(FcPatternHash, uFp) +GO(FcPatternPrint, vFp) +GO(FcPatternReference, vFp) +GO(FcPatternRemove, iFppi) +GOM(FcPatternVaBuild, pFEpp) //%% +GO(FcStrBasename, pFp) +GO(FcStrCmp, iFpp) +GO(FcStrCmpIgnoreCase, iFpp) +GO(FcStrCopy, pFp) +GO(FcStrCopyFilename, pFp) +GO(FcStrDirname, pFp) +GO(FcStrDowncase, pFp) +GO(FcStrFree, vFp) +GO(FcStrListCreate, pFp) +GO(FcStrListDone, vFp) +GO(FcStrListFirst, vFp) +GO(FcStrListNext, pFp) +GO(FcStrPlus, pFpp) +GO(FcStrSetAdd, iFpp) +GO(FcStrSetAddFilename, iFpp) +GO(FcStrSetCreate, pFv) +GO(FcStrSetDel, iFpp) +GO(FcStrSetDestroy, vFp) +GO(FcStrSetEqual, iFpp) +GO(FcStrSetMember, iFpp) +GO(FcStrStr, pFpp) +GO(FcStrStrIgnoreCase, pFpp) +GO(FcUcs4ToUtf8, iFup) +GO(FcUtf16Len, iFpuipp) +GO(FcUtf16ToUcs4, iFpupi) +GO(FcUtf8Len, iFpipp) +GO(FcUtf8ToUcs4, iFppi) +//GO(FcValueDestroy, +//GO(FcValueEqual, +//GO(FcValuePrint, +//GO(FcValueSave, +GO(FcWeightFromOpenTypeDouble, dFd) +GO(FcWeightToOpenTypeDouble, dFd) +//GO(_fini, +//GO(_init, diff --git a/src/wrapped32/wrappedfreetype.c b/src/wrapped32/wrappedfreetype.c new file mode 100644 index 0000000..2368dcf --- /dev/null +++ b/src/wrapped32/wrappedfreetype.c @@ -0,0 +1,2863 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "converter32.h" + +#include "khash.h" + +static const char* freetypeName = +#ifdef ANDROID + "libfreetype.so" +#else + "libfreetype.so.6" +#endif + ; +#define LIBNAME freetype + +typedef void (*vFp_t)(void*); + +#define FT_GLYPH_FORMAT_OUTLINE (('o'<<24)|('u'<<16)|('t'<<8)|'l') +#define FT_GLYPH_FORMAT_BITMAP (('b'<<24)|('i'<<16)|('t'<<8)|'s') + +// 64bits FreeType structures +typedef union FT_StreamDesc_s +{ + long value; + void* pointer; +} FT_StreamDesc_t; + +typedef struct FT_StreamRec_s +{ + unsigned char* base; + unsigned long size; + unsigned long pos; + FT_StreamDesc_t descriptor; + FT_StreamDesc_t pathname; + void* read; + void* close; + void* memory; + unsigned char* cursor; + unsigned char* limit; +} FT_StreamRec_t; + +typedef struct FT_BBox_s +{ + signed long xMin, yMin; + signed long xMax, yMax; +} FT_BBox_t; +typedef struct FT_Generic_s +{ + void* data; + vFp_t finalizer; +} FT_Generic_t; +typedef struct FT_ListRec_s +{ + void* head; + void* tail; +} FT_ListRec_t; + +typedef struct FT_Vector_s +{ + long x; + long y; +} FT_Vector_t; + +typedef struct FT_Bitmap_Size_s +{ + short height; + short width; + long size; + long x_ppem; + long y_ppem; +} FT_Bitmap_Size_t; + +typedef struct FT_Glyph_Metrics_s +{ + long width; + long height; + long horiBearingX; + long horiBearingY; + long horiAdvance; + long vertBearingX; + long vertBearingY; + long vertAdvance; +} FT_Glyph_Metrics_t; + +typedef struct FT_Outline_s +{ + unsigned short n_contours; + unsigned short n_points; + FT_Vector_t* points; + unsigned char* tags; + unsigned short* contours; + int flags; +} FT_Outline_t; + +typedef struct FT_Bitmap_s +{ + unsigned int rows; + unsigned int width; + int pitch; + unsigned char* buffer; + unsigned short num_grays; + unsigned char pixel_mode; + unsigned char palette_mode; + void* palette; +} FT_Bitmap_t; + +typedef struct FT_GlyphSlotRec_s +{ + void* library; //FT_Library + void* face; //FT_Face + struct FT_GlyphSlotRec_s* next; + uint32_t glyph_index; + FT_Generic_t generic; + FT_Glyph_Metrics_t metrics; + long linearHoriAdvance; + long linearVertAdvance; + FT_Vector_t advance; + int format; + FT_Bitmap_t bitmap; + int bitmap_left; + int bitmap_top; + FT_Outline_t outline; + uint32_t num_subglyphs; + void* subglyphs; //FT_SubGlyph + void* control_data; + long control_len; + long lsb_delta; + long rsb_delta; + void* other; + void* internal; +} FT_GlyphSlotRec_t; + +typedef struct FT_CharMapRec_s +{ + void* face; //FT_FaceRec_t* + int encoding; + uint16_t platform_id; + uint16_t encoding_id; +} FT_CharMapRec_t; + +typedef struct FT_Size_Metrics_s +{ + uint16_t x_ppem; + uint16_t y_ppem; + long x_scale; + long y_scale; + long ascender; + long descender; + long height; + long max_advance; +} FT_Size_Metrics_t; + +typedef struct FT_SizeRec_s +{ + void* face; //FT_FaceRec_t* + FT_Generic_t generic; + FT_Size_Metrics_t metrics; + void* internal; //FT_Size_Internal +} FT_SizeRec_t; + +typedef struct FT_FaceRec_s +{ + signed long num_faces; + signed long face_index; + signed long face_flags; + signed long style_flags; + signed long num_glyphs; + char* family_name; + char* style_name; + int num_fixed_sizes; + FT_Bitmap_Size_t* available_sizes; + int num_charmaps; + FT_CharMapRec_t** charmaps; + FT_Generic_t generic; + FT_BBox_t bbox; + uint16_t units_per_EM; + int16_t ascender; + int16_t descender; + int16_t height; + int16_t max_advance_width; + int16_t max_advance_height; + int16_t underline_position; + int16_t underline_thickness; + FT_GlyphSlotRec_t* glyph; + FT_SizeRec_t* size; + void* charmap; //FT_CharMapRec_t* + /*@private begin */ + void* driver; + void* memory; + FT_StreamDesc_t* stream; + FT_ListRec_t sizes_list; + FT_Generic_t autohint; /* face-specific auto-hinter data */ + void* extensions; /* unused */ + void* internal; +} FT_FaceRec_t; + +typedef struct FT_MemoryRec_s +{ + void* user; + void* alloc; + void* free; + void* realloc; +} FT_MemoryRec_t; + +typedef struct PS_PrivateRec_s +{ + int unique_id; + int lenIV; + uint8_t num_blue_values; + uint8_t num_other_blues; + uint8_t num_family_blues; + uint8_t num_family_other_blues; + int16_t blue_values[14]; + int16_t other_blues[10]; + int16_t family_blues [14]; + int16_t family_other_blues[10]; + long blue_scale; + int blue_shift; + int blue_fuzz; + uint16_t standard_width[1]; + uint16_t standard_height[1]; + uint8_t num_snap_widths; + uint8_t num_snap_heights; + uint8_t force_bold; + uint8_t round_stem_up; + int16_t snap_widths [13]; + int16_t snap_heights[13]; + long expansion_factor; + long language_group; + long password; + int16_t min_feature[2]; +} PS_PrivateRec_t; + +typedef struct BDF_PropertyRec_s +{ + int type; + union { + void* atom; //const char* + int integer; + uint32_t cardinal; + + } u; +} BDF_PropertyRec_t; + +typedef struct FT_Size_RequestRec_s +{ + int type; + long width; + long height; + uint32_t horiResolution; + uint32_t vertResolution; +} FT_Size_RequestRec_t; + +typedef struct FT_Parameter_s +{ + unsigned long tag; + void* data; +} FT_Parameter_t; + +typedef struct FT_Open_Args_s +{ + uint32_t flags; + uint8_t* memory_base; + long memory_size; + char* pathname; + FT_StreamRec_t* stream; + void* driver; //FT_ModuleRec + int num_params; + FT_Parameter_t* params; +} FT_Open_Args_t; + +typedef struct FT_WinFNT_HeaderRec_s +{ + uint16_t version; + unsigned long file_size; + uint8_t copyright[60]; + uint16_t file_type; + uint16_t nominal_point_size; + uint16_t vertical_resolution; + uint16_t horizontal_resolution; + uint16_t ascent; + uint16_t internal_leading; + uint16_t external_leading; + uint8_t italic; + uint8_t underline; + uint8_t strike_out; + uint16_t weight; + uint8_t charset; + uint16_t pixel_width; + uint16_t pixel_height; + uint8_t pitch_and_family; + uint16_t avg_width; + uint16_t max_width; + uint8_t first_char; + uint8_t last_char; + uint8_t default_char; + uint8_t break_char; + uint16_t bytes_per_row; + unsigned long device_offset; + unsigned long face_name_offset; + unsigned long bits_pointer; + unsigned long bits_offset; + uint8_t reserved; + unsigned long flags; + uint16_t A_space; + uint16_t B_space; + uint16_t C_space; + uint16_t color_table_offset; + unsigned long reserved1[4]; +} FT_WinFNT_HeaderRec_t; + +typedef struct FT_Matrix_s +{ + long xx, xy; + long yx, yy; +} FT_Matrix_t; + +typedef struct FT_GlyphRec_s +{ + void* library; //FT_Library + void* clazz; //const FT_Glyph_Class* + uint32_t format; + FT_Vector_t advance; +} FT_GlyphRec_t; + +typedef struct FT_BitmapGlyphRec_s +{ + FT_GlyphRec_t root; + int left; + int top; + FT_Bitmap_t bitmap; +} FT_BitmapGlyphRec_t; + +typedef struct TT_Header_s +{ + signed long Table_Version; + signed long Font_Revision; + long CheckSum_Adjust; + long Magic_Number; + uint16_t Flags; + uint16_t Units_Per_EM; + unsigned long Created [2]; + unsigned long Modified[2]; + int16_t xMin; + int16_t yMin; + int16_t xMax; + int16_t yMax; + uint16_t Mac_Style; + uint16_t Lowest_Rec_PPEM; + int16_t Font_Direction; + int16_t Index_To_Loc_Format; + int16_t Glyph_Data_Format; +} TT_Header_t; +typedef struct TT_MaxProfile_s +{ + signed long version; + uint16_t numGlyphs; + uint16_t maxPoints; + uint16_t maxContours; + uint16_t maxCompositePoints; + uint16_t maxCompositeContours; + uint16_t maxZones; + uint16_t maxTwilightPoints; + uint16_t maxStorage; + uint16_t maxFunctionDefs; + uint16_t maxInstructionDefs; + uint16_t maxStackElements; + uint16_t maxSizeOfInstructions; + uint16_t maxComponentElements; + uint16_t maxComponentDepth; +} TT_MaxProfile_t; +typedef struct TT_OS2_s +{ + uint16_t version; + int16_t xAvgCharWidth; + uint16_t usWeightClass; + uint16_t usWidthClass; + uint16_t fsType; + int16_t ySubscriptXSize; + int16_t ySubscriptYSize; + int16_t ySubscriptXOffset; + int16_t ySubscriptYOffset; + int16_t ySuperscriptXSize; + int16_t ySuperscriptYSize; + int16_t ySuperscriptXOffset; + int16_t ySuperscriptYOffset; + int16_t yStrikeoutSize; + int16_t yStrikeoutPosition; + int16_t sFamilyClass; + uint8_t panose[10]; + unsigned long ulUnicodeRange1; + unsigned long ulUnicodeRange2; + unsigned long ulUnicodeRange3; + unsigned long ulUnicodeRange4; + signed char achVendID[4]; + uint16_t fsSelection; + uint16_t usFirstCharIndex; + uint16_t usLastCharIndex; + int16_t sTypoAscender; + int16_t sTypoDescender; + int16_t sTypoLineGap; + uint16_t usWinAscent; + uint16_t usWinDescent; + /* only version 1 and higher: */ + unsigned long ulCodePageRange1; + unsigned long ulCodePageRange2; + /* only version 2 and higher: */ + int16_t sxHeight; + int16_t sCapHeight; + uint16_t usDefaultChar; + uint16_t usBreakChar; + uint16_t usMaxContext; + /* only version 5 and higher: */ + uint16_t usLowerOpticalPointSize; + uint16_t usUpperOpticalPointSize; +} TT_OS2_t; +typedef struct TT_HoriHeader_s +{ + signed long Version; + int16_t Ascender; + int16_t Descender; + int16_t Line_Gap; + uint16_t advance_Width_Max; + int16_t min_Left_Side_Bearing; + int16_t min_Right_Side_Bearing; + int16_t xMax_Extent; + int16_t caret_Slope_Rise; + int16_t caret_Slope_Run; + int16_t caret_Offset; + int16_t Reserved[4]; + int16_t metric_Data_Format; + uint16_t number_Of_HMetrics; + void* long_metrics; + void* short_metrics; +} TT_HoriHeader_t; +typedef struct TT_VertHeader_s +{ + signed long Version; + int16_t Ascender; + int16_t Descender; + int16_t Line_Gap; + uint16_t advance_Height_Max; + int16_t min_Top_Side_Bearing; + int16_t min_Bottom_Side_Bearing; + int16_t yMax_Extent; + int16_t caret_Slope_Rise; + int16_t caret_Slope_Run; + int16_t caret_Offset; + int16_t Reserved[4]; + int16_t metric_Data_Format; + uint16_t number_Of_VMetrics; + void* long_metrics; + void* short_metrics; +} TT_VertHeader_t; +typedef struct TT_Postscript_s +{ + signed long FormatType; + signed long italicAngle; + int16_t underlinePosition; + int16_t underlineThickness; + unsigned long isFixedPitch; + unsigned long minMemType42; + unsigned long maxMemType42; + unsigned long minMemType1; + unsigned long maxMemType1; +} TT_Postscript_t; +typedef struct TT_PCLT_s +{ + signed long Version; + unsigned long FontNumber; + uint16_t Pitch; + uint16_t xHeight; + uint16_t Style; + uint16_t TypeFamily; + uint16_t CapHeight; + uint16_t SymbolSet; + signed char TypeFace[16]; + signed char CharacterComplement[8]; + signed char FileName[6]; + signed char StrokeWeight; + signed char WidthType; + uint8_t SerifStyle; + uint8_t Reserved; +} TT_PCLT_t; + +typedef struct FT_Var_Axis_s +{ + void* name; //string + long minimum; + long def; + long maximum; + unsigned long tag; + uint32_t strid; +} FT_Var_Axis_t; + +typedef struct FT_Var_Named_Style_s +{ + long* coords; // one entry per axis + uint32_t strid; + uint32_t psid; +} FT_Var_Named_Style_t; + +typedef struct FT_MM_Var_s +{ + uint32_t num_axis; + uint32_t num_designs; + uint32_t num_namedstyles; + FT_Var_Axis_t* axis; + FT_Var_Named_Style_t* namedstyle; +} FT_MM_Var_t; +// =============================================== +// 32bits FreeType structures +// =============================================== + +typedef union __attribute__((packed, aligned(4))) FT_StreamDesc_32_s +{ + long_t value; + ptr_t pointer; //void* +} FT_StreamDesc_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_StreamRec_32_s +{ + ptr_t base; //unsigned char* + ulong_t size; + ulong_t pos; + + FT_StreamDesc_32_t descriptor; + FT_StreamDesc_32_t pathname; + ptr_t read; //void* + ptr_t close; //void* + + ptr_t memory; //void* + ptr_t cursor; //unsigned char* + ptr_t limit; //unsigned char* + +} FT_StreamRec_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_BBox_32_s +{ + long_t xMin, yMin; + long_t xMax, yMax; +} FT_BBox_32_t; +typedef struct __attribute__((packed, aligned(4))) FT_Generic_32_s +{ + ptr_t data; //void* + ptr_t finalizer; //vFp_t +} FT_Generic_32_t; +typedef struct __attribute__((packed, aligned(4))) FT_ListRec_32_s +{ + ptr_t head; //void* + ptr_t tail; //void* +} FT_ListRec_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_Vector_32_s +{ + long_t x; + long_t y; +} FT_Vector_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_Bitmap_Size_32_s +{ + short height; + short width; + long_t size; + long_t x_ppem; + long_t y_ppem; +} FT_Bitmap_Size_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_Glyph_Metrics_32_s +{ + long_t width; + long_t height; + long_t horiBearingX; + long_t horiBearingY; + long_t horiAdvance; + long_t vertBearingX; + long_t vertBearingY; + long_t vertAdvance; +} FT_Glyph_Metrics_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_Outline_32_s +{ + unsigned short n_contours; + unsigned short n_points; + ptr_t points; //FT_Vector_32_t* + ptr_t tags; //unsigned char* + ptr_t contours; //unsigned short* + int flags; +} FT_Outline_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_Bitmap_32_s +{ + unsigned int rows; + unsigned int width; + int pitch; + ptr_t buffer; //unsigned char* + unsigned short num_grays; + unsigned char pixel_mode; + unsigned char palette_mode; + ptr_t palette; //void* +} FT_Bitmap_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_GlyphSlotRec_32_s +{ + ptr_t library; //FT_Library + ptr_t face; //FT_Face + ptr_t next; //struct FT_GlyphSlotRec_s* + uint32_t glyph_index; + FT_Generic_32_t generic; //0x10 + FT_Glyph_Metrics_32_t metrics; //0x18 + long_t linearHoriAdvance; //0x38 + long_t linearVertAdvance; + FT_Vector_32_t advance; //0x40 + int format; + FT_Bitmap_32_t bitmap; //0x4c + int bitmap_left; + int bitmap_top; + FT_Outline_32_t outline; + uint32_t num_subglyphs; + ptr_t subglyphs; //FT_SubGlyph + ptr_t control_data; + long_t control_len; + long_t lsb_delta; + long_t rsb_delta; + ptr_t other; + ptr_t internal; +} FT_GlyphSlotRec_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_CharMapRec_32_s +{ + ptr_t face; //FT_FaceRec_t* + int encoding; + uint16_t platform_id; + uint16_t encoding_id; +} FT_CharMapRec_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_Size_Metrics_32_s +{ + uint16_t x_ppem; + uint16_t y_ppem; + long_t x_scale; + long_t y_scale; + long_t ascender; + long_t descender; + long_t height; + long_t max_advance; +} FT_Size_Metrics_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_SizeRec_32_s +{ + ptr_t face; //FT_FaceRec_t* + FT_Generic_32_t generic; + FT_Size_Metrics_32_t metrics; + ptr_t internal; //FT_Size_Internal +} FT_SizeRec_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_FaceRec_32_s +{ + long_t num_faces; + long_t face_index; + long_t face_flags; + long_t style_flags; + long_t num_glyphs; //0x10 + ptr_t family_name; //char* + ptr_t style_name; //char* + int num_fixed_sizes; + ptr_t available_sizes; //FT_Bitmap_32_t* //0x20 + int num_charmaps; + ptr_t charmaps; //FT_CharMapRec_32_t** + FT_Generic_32_t generic; //0x28 + FT_BBox_32_t bbox; //0x30 + uint16_t units_per_EM; //0x40 + int16_t ascender; + int16_t descender; + int16_t height; + int16_t max_advance_width; + int16_t max_advance_height; + int16_t underline_position; + int16_t underline_thickness; + ptr_t glyph; //FT_GlyphSlotRec_t* //0x50 + ptr_t size; //FT_SizeRec_32_t* + ptr_t charmap; //void* + /*@private begin */ + ptr_t driver; //void* //0x5c + ptr_t memory; //void* + ptr_t stream; //FT_StreamDesc_t* + FT_ListRec_32_t sizes_list; + FT_Generic_32_t autohint; /* face-specific auto-hinter data */ + ptr_t extensions; /* unused */ //void* + ptr_t internal; //void* +} FT_FaceRec_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_MemoryRec_32_s +{ + ptr_t user; //void* + ptr_t alloc; //void* + ptr_t free; //void* + ptr_t realloc;//void* +} FT_MemoryRec_32_t; + +typedef struct __attribute__((packed, aligned(4))) PS_PrivateRec_32_s +{ + int unique_id; + int lenIV; + uint8_t num_blue_values; + uint8_t num_other_blues; + uint8_t num_family_blues; + uint8_t num_family_other_blues; + int16_t blue_values[14]; + int16_t other_blues[10]; + int16_t family_blues [14]; + int16_t family_other_blues[10]; + long_t blue_scale; + int blue_shift; + int blue_fuzz; + uint16_t standard_width[1]; + uint16_t standard_height[1]; + uint8_t num_snap_widths; + uint8_t num_snap_heights; + uint8_t force_bold; + uint8_t round_stem_up; + int16_t snap_widths [13]; + int16_t snap_heights[13]; + long_t expansion_factor; + long_t language_group; + long_t password; + int16_t min_feature[2]; +} PS_PrivateRec_32_t; + +typedef struct __attribute__((packed, aligned(4))) BDF_PropertyRec_32_s +{ + int type; + union { + ptr_t atom; //const char* + int integer; + uint32_t cardinal; + + } u; +} BDF_PropertyRec_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_Size_RequestRec_32_s +{ + int type; + long_t width; + long_t height; + uint32_t horiResolution; + uint32_t vertResolution; +} FT_Size_RequestRec_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_Parameter_32_s +{ + ulong_t tag; + ptr_t data; //void* +} FT_Parameter_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_Open_Args_32_s +{ + uint32_t flags; + ptr_t memory_base; //uint8_t* + long_t memory_size; + ptr_t pathname; //char* + ptr_t stream; //FT_StreamRec_t* + ptr_t driver; //FT_ModuleRec + int num_params; + ptr_t params; //FT_Parameter_t* +} FT_Open_Args_32_t; + +typedef struct FT_WinFNT_HeaderRec_32_s // removed the packed attribute +{ + uint16_t version; + ulong_t file_size; + uint8_t copyright[60]; + uint16_t file_type; + uint16_t nominal_point_size; + uint16_t vertical_resolution; + uint16_t horizontal_resolution; + uint16_t ascent; + uint16_t internal_leading; + uint16_t external_leading; + uint8_t italic; + uint8_t underline; + uint8_t strike_out; + uint16_t weight; + uint8_t charset; + uint16_t pixel_width; + uint16_t pixel_height; + uint8_t pitch_and_family; + uint16_t avg_width; + uint16_t max_width; + uint8_t first_char; + uint8_t last_char; + uint8_t default_char; + uint8_t break_char; + uint16_t bytes_per_row; + ulong_t device_offset; + ulong_t face_name_offset; + ulong_t bits_pointer; + ulong_t bits_offset; + uint8_t reserved; + ulong_t flags; + uint16_t A_space; + uint16_t B_space; + uint16_t C_space; + uint16_t color_table_offset; + ulong_t reserved1[4]; +} FT_WinFNT_HeaderRec_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_Matrix_32_s +{ + long_t xx, xy; + long_t yx, yy; +} FT_Matrix_32_t; + +typedef struct __attribute__((packed, aligned(4))) FT_GlyphRec_32_s +{ + ptr_t library; //FT_Library + ptr_t clazz; //const FT_Glyph_Class* + uint32_t format; + FT_Vector_32_t advance; +} FT_GlyphRec_32_t; + +typedef struct FT_BitmapGlyphRec_32_s +{ + FT_GlyphRec_32_t root; + int left; + int top; + FT_Bitmap_32_t bitmap; +} FT_BitmapGlyphRec_32_t; +typedef struct TT_Header_32_s //no align +{ + long_t Table_Version; + long_t Font_Revision; + long_t CheckSum_Adjust; + long_t Magic_Number; + uint16_t Flags; + uint16_t Units_Per_EM; + ulong_t Created [2]; + ulong_t Modified[2]; + int16_t xMin; + int16_t yMin; + int16_t xMax; + int16_t yMax; + uint16_t Mac_Style; + uint16_t Lowest_Rec_PPEM; + int16_t Font_Direction; + int16_t Index_To_Loc_Format; + int16_t Glyph_Data_Format; +} TT_Header_32_t; +typedef struct TT_MaxProfile_32_s //no align +{ + long_t version; + uint16_t numGlyphs; + uint16_t maxPoints; + uint16_t maxContours; + uint16_t maxCompositePoints; + uint16_t maxCompositeContours; + uint16_t maxZones; + uint16_t maxTwilightPoints; + uint16_t maxStorage; + uint16_t maxFunctionDefs; + uint16_t maxInstructionDefs; + uint16_t maxStackElements; + uint16_t maxSizeOfInstructions; + uint16_t maxComponentElements; + uint16_t maxComponentDepth; +} TT_MaxProfile_32_t; +typedef struct TT_OS2_32_s //no align +{ + uint16_t version; + int16_t xAvgCharWidth; + uint16_t usWeightClass; + uint16_t usWidthClass; + uint16_t fsType; + int16_t ySubscriptXSize; + int16_t ySubscriptYSize; + int16_t ySubscriptXOffset; + int16_t ySubscriptYOffset; + int16_t ySuperscriptXSize; + int16_t ySuperscriptYSize; + int16_t ySuperscriptXOffset; + int16_t ySuperscriptYOffset; + int16_t yStrikeoutSize; + int16_t yStrikeoutPosition; + int16_t sFamilyClass; + uint8_t panose[10]; + ulong_t ulUnicodeRange1; + ulong_t ulUnicodeRange2; + ulong_t ulUnicodeRange3; + ulong_t ulUnicodeRange4; + signed char achVendID[4]; + uint16_t fsSelection; + uint16_t usFirstCharIndex; + uint16_t usLastCharIndex; + int16_t sTypoAscender; + int16_t sTypoDescender; + int16_t sTypoLineGap; + uint16_t usWinAscent; + uint16_t usWinDescent; + /* only version 1 and higher: */ + ulong_t ulCodePageRange1; + ulong_t ulCodePageRange2; + /* only version 2 and higher: */ + int16_t sxHeight; + int16_t sCapHeight; + uint16_t usDefaultChar; + uint16_t usBreakChar; + uint16_t usMaxContext; + /* only version 5 and higher: */ + uint16_t usLowerOpticalPointSize; + uint16_t usUpperOpticalPointSize; +} TT_OS2_32_t; +typedef struct TT_HoriHeader_32_s //no align +{ + long_t Version; + int16_t Ascender; + int16_t Descender; + int16_t Line_Gap; + uint16_t advance_Width_Max; + int16_t min_Left_Side_Bearing; + int16_t min_Right_Side_Bearing; + int16_t xMax_Extent; + int16_t caret_Slope_Rise; + int16_t caret_Slope_Run; + int16_t caret_Offset; + int16_t Reserved[4]; + int16_t metric_Data_Format; + uint16_t number_Of_HMetrics; + ptr_t long_metrics; + ptr_t short_metrics; +} TT_HoriHeader_32_t; +typedef struct TT_VertHeader_32_s //no align +{ + long_t Version; + int16_t Ascender; + int16_t Descender; + int16_t Line_Gap; + uint16_t advance_Height_Max; + int16_t min_Top_Side_Bearing; + int16_t min_Bottom_Side_Bearing; + int16_t yMax_Extent; + int16_t caret_Slope_Rise; + int16_t caret_Slope_Run; + int16_t caret_Offset; + int16_t Reserved[4]; + int16_t metric_Data_Format; + uint16_t number_Of_VMetrics; + ptr_t long_metrics; + ptr_t short_metrics; +} TT_VertHeader_32_t; +typedef struct TT_Postscript_32_s //no align +{ + long_t FormatType; + long_t italicAngle; + int16_t underlinePosition; + int16_t underlineThickness; + ulong_t isFixedPitch; + ulong_t minMemType42; + ulong_t maxMemType42; + ulong_t minMemType1; + ulong_t maxMemType1; +} TT_Postscript_32_t; +typedef struct TT_PCLT_32_s //no align +{ + long_t Version; + ulong_t FontNumber; + uint16_t Pitch; + uint16_t xHeight; + uint16_t Style; + uint16_t TypeFamily; + uint16_t CapHeight; + uint16_t SymbolSet; + signed char TypeFace[16]; + signed char CharacterComplement[8]; + signed char FileName[6]; + signed char StrokeWeight; + signed char WidthType; + uint8_t SerifStyle; + uint8_t Reserved; +} TT_PCLT_32_t; + +typedef struct FT_Var_Axis_32_s +{ + ptr_t name; //string + long_t minimum; + long_t def; + long_t maximum; + ulong_t tag; + uint32_t strid; +} FT_Var_Axis_32_t; + +typedef struct FT_Var_Named_Style_32_s +{ + ptr_t coords; // long_t* + uint32_t strid; + uint32_t psid; +} FT_Var_Named_Style_32_t; + +typedef struct FT_MM_Var_32_s +{ + uint32_t num_axis; + uint32_t num_designs; + uint32_t num_namedstyles; + ptr_t axis; //FT_Var_Axis_32_t* + ptr_t namedstyle; //FT_Var_Named_Style_32_t* +} FT_MM_Var_32_t; + +// ================================== +// Convertions +// ================================== + +void convert_FT_StreamRec_to_32(void* d, void* s) +{ + FT_StreamRec_t* src = s; + FT_StreamRec_32_t* dst = d; + + dst-> base = to_ptrv(src->base); + dst-> size = to_ulong(src->size); + dst-> pos = to_ulong(src->pos); + dst-> descriptor.value = to_long(src->descriptor.value); + dst-> descriptor.pointer = to_ptrv(src->descriptor.pointer); + dst-> pathname.value = to_long(src->pathname.value); + dst-> pathname.pointer = to_ptrv(src->pathname.pointer); + dst-> read = to_ptrv(src->read); + dst-> close = to_ptrv(src->close); + dst-> memory = to_ptrv(src->memory); + dst-> cursor = to_ptrv(src->cursor); + dst-> limit = to_ptrv(src->limit); +} +void convert_FT_StreamRec_to_64(void* d, void* s) +{ + FT_StreamRec_32_t* src = s; + FT_StreamRec_t* dst = d; + + dst-> limit = from_ptrv(src->limit); + dst-> cursor = from_ptrv(src->cursor); + dst-> memory = from_ptrv(src->memory); + dst-> close = from_ptrv(src->close); + dst-> read = from_ptrv(src->read); + dst-> pathname.pointer = from_ptrv(src->pathname.pointer); + dst-> pathname.value = from_long(src->pathname.value); + dst-> descriptor.pointer = from_ptrv(src->descriptor.pointer); + dst-> descriptor.value = from_long(src->descriptor.value); + dst-> pos = from_ulong(src->pos); + dst-> size = from_ulong(src->size); + dst-> base = from_ptrv(src->base); +} + +void convert_FT_GlyphSlot_to_32(void* d, void* s) +{ + FT_GlyphSlotRec_t* src = s; + FT_GlyphSlotRec_32_t* dst = d; + + dst->library = to_ptrv(src->library); + dst->face = to_ptrv(src->face); + dst->next = to_ptrv(src->next); + dst->glyph_index = src->glyph_index; + dst->generic.data = to_ptrv(src->generic.data); + dst->generic.finalizer = to_ptrv(src->generic.finalizer); + dst->metrics.width = to_long(src->metrics.width); + dst->metrics.height = to_long(src->metrics.height); + dst->metrics.horiBearingX = to_long(src->metrics.horiBearingX); + dst->metrics.horiBearingY = to_long(src->metrics.horiBearingY); + dst->metrics.horiAdvance = to_long(src->metrics.horiAdvance); + dst->metrics.vertBearingX = to_long(src->metrics.vertBearingX); + dst->metrics.vertBearingY = to_long(src->metrics.vertBearingY); + dst->metrics.vertAdvance = to_long(src->metrics.vertAdvance); + dst->linearHoriAdvance = to_long(src->linearHoriAdvance); + dst->linearVertAdvance = to_long(src->linearVertAdvance); + dst->advance.x = to_long(src->advance.x); + dst->advance.y = to_long(src->advance.y); + dst->format = src->format; + dst->bitmap.rows = src->bitmap.rows; + dst->bitmap.width = src->bitmap.width; + dst->bitmap.pitch = src->bitmap.pitch; + dst->bitmap.buffer = to_ptrv(src->bitmap.buffer); + dst->bitmap.num_grays = src->bitmap.num_grays; + dst->bitmap.pixel_mode = src->bitmap.pixel_mode; + dst->bitmap.palette_mode = src->bitmap.palette_mode; + dst->bitmap.palette = to_ptrv(src->bitmap.palette); + dst->bitmap_left = src->bitmap_left; + dst->bitmap_top = src->bitmap_top; + dst->outline.n_contours = src->outline.n_contours; + for(int i=0; ioutline.n_points; ++i) { + ((FT_Vector_32_t*)src->outline.points)[i].x = to_long(src->outline.points[i].x); + ((FT_Vector_32_t*)src->outline.points)[i].y = to_long(src->outline.points[i].y); + } + dst->outline.n_points = src->outline.n_points; + dst->outline.points = to_ptrv(src->outline.points); + dst->outline.tags = to_ptrv(src->outline.tags); + dst->outline.contours = to_ptrv(src->outline.contours); + dst->outline.flags = src->outline.flags; + dst->num_subglyphs = src->num_subglyphs; + dst->subglyphs = to_ptrv(src->subglyphs); + dst->control_data = to_ptrv(src->control_data); + dst->control_len = to_long(src->control_len); + dst->lsb_delta = to_long(src->lsb_delta); + dst->rsb_delta = to_long(src->rsb_delta); + dst->other = to_ptrv(src->other); + dst->internal = to_ptrv(src->internal); +} + +void convert_FT_GlyphSlot_to_64(void* d, void* s) +{ + FT_GlyphSlotRec_32_t* src = s; + FT_GlyphSlotRec_t* dst = d; + + dst->internal = from_ptrv(src->internal); + dst->other = from_ptrv(src->other); + dst->rsb_delta = from_long(src->rsb_delta); + dst->lsb_delta = from_long(src->lsb_delta); + dst->control_len = from_long(src->control_len); + dst->control_data = from_ptrv(src->control_data); + dst->subglyphs = from_ptrv(src->subglyphs); + dst->num_subglyphs = src->num_subglyphs; + dst->outline.flags = src->outline.flags; + dst->outline.contours = from_ptrv(src->outline.contours); + dst->outline.tags = from_ptrv(src->outline.tags); + dst->outline.points = from_ptrv(src->outline.points); + dst->outline.n_points = src->outline.n_points; + for(int i=dst->outline.n_points-1; i>=0; --i) { + dst->outline.points[i].y = from_long(((FT_Vector_32_t*)dst->outline.points)[i].y); + dst->outline.points[i].x = from_long(((FT_Vector_32_t*)dst->outline.points)[i].x); + } + dst->outline.n_contours = src->outline.n_contours; + dst->bitmap_top = src->bitmap_top; + dst->bitmap_left = src->bitmap_left; + dst->bitmap.palette = from_ptrv(src->bitmap.palette); + dst->bitmap.palette_mode = src->bitmap.palette_mode; + dst->bitmap.pixel_mode = src->bitmap.pixel_mode; + dst->bitmap.num_grays = src->bitmap.num_grays; + dst->bitmap.buffer = from_ptrv(src->bitmap.buffer); + dst->bitmap.pitch = src->bitmap.pitch; + dst->bitmap.width = src->bitmap.width; + dst->bitmap.rows = src->bitmap.rows; + dst->format = src->format; + dst->advance.y = from_long(src->advance.y); + dst->advance.x = from_long(src->advance.x); + dst->linearVertAdvance = from_long(src->linearVertAdvance); + dst->linearHoriAdvance = from_long(src->linearHoriAdvance); + dst->metrics.vertAdvance = from_long(src->metrics.vertAdvance); + dst->metrics.vertBearingY = from_long(src->metrics.vertBearingY); + dst->metrics.vertBearingX = from_long(src->metrics.vertBearingX); + dst->metrics.horiAdvance = from_long(src->metrics.horiAdvance); + dst->metrics.horiBearingY = from_long(src->metrics.horiBearingY); + dst->metrics.horiBearingX = from_long(src->metrics.horiBearingX); + dst->metrics.height = from_long(src->metrics.height); + dst->metrics.width = from_long(src->metrics.width); + dst->generic.finalizer = from_ptrv(src->generic.finalizer); + dst->generic.data = from_ptrv(src->generic.data); + dst->glyph_index = src->glyph_index; + dst->next = from_ptrv(src->next); // no shinking of the whole chain? + dst->face = from_ptrv(src->face); + dst->library = from_ptrv(src->library); +} + +void inplace_FT_GlyphSlot_shrink(void* a) +{ + if(!a) return; + FT_GlyphSlotRec_t* src = a; + FT_GlyphSlotRec_32_t* dst = a; + void* next = src->next; + + convert_FT_GlyphSlot_to_32(dst, src); + + inplace_FT_GlyphSlot_shrink(next); +} + +void inplace_FT_GlyphSlot_enlarge(void* a) +{ + if(!a) return; + FT_GlyphSlotRec_32_t* src = a; + FT_GlyphSlotRec_t* dst = a; + void* next = from_ptrv(src->next); + + convert_FT_GlyphSlot_to_64(dst, src); + + inplace_FT_GlyphSlot_enlarge(next); +} + +void convert_FT_CharMapRec_to_32(void* d, void* s) +{ + FT_CharMapRec_t* src = s; + FT_CharMapRec_32_t* dst = d; + + dst->face = to_ptrv(src->face); + dst->encoding = src->encoding; + dst->platform_id = src->platform_id; + dst->encoding_id = src->encoding_id; +} +void convert_FT_CharMapRec_to_64(void* d, void* s) +{ + FT_CharMapRec_32_t* src = s; + FT_CharMapRec_t* dst = d; + + dst->encoding_id = src->encoding_id; + dst->platform_id = src->platform_id; + dst->encoding = src->encoding; + dst->face = from_ptrv(src->face); +} + +void inplace_FT_CharMapRec_shrink(void* a) +{ + if(!a) return; + + convert_FT_CharMapRec_to_32(a, a); +} +void inplace_FT_CharMapRec_enlarge(void* a) +{ + if(!a) return; + + convert_FT_CharMapRec_to_64(a, a); +} + +void convert_FT_SizeRec_to_32(void* d, void* s) +{ + FT_SizeRec_t* src = s; + FT_SizeRec_32_t* dst = d; + + dst->face = to_ptrv(src->face); + dst->generic.data = to_ptrv(src->generic.data); + dst->generic.finalizer = to_ptrv(src->generic.finalizer); + dst->metrics.x_ppem = src->metrics.x_ppem; + dst->metrics.y_ppem = src->metrics.y_ppem; + dst->metrics.x_scale = to_long(src->metrics.x_scale); + dst->metrics.y_scale = to_long(src->metrics.y_scale); + dst->metrics.ascender = to_long(src->metrics.ascender); + dst->metrics.descender = to_long(src->metrics.descender); + dst->metrics.height = to_long(src->metrics.height); + dst->metrics.max_advance = to_long(src->metrics.max_advance); + dst->internal = to_ptrv(src->internal); +} +void convert_FT_SizeRec_to_64(void* d, void* s) +{ + FT_SizeRec_32_t* src = s; + FT_SizeRec_t* dst = d; + + dst->internal = from_ptrv(src->internal); + dst->metrics.max_advance = from_long(src->metrics.max_advance); + dst->metrics.height = from_long(src->metrics.height); + dst->metrics.descender = from_long(src->metrics.descender); + dst->metrics.ascender = from_long(src->metrics.ascender); + dst->metrics.y_scale = from_long(src->metrics.y_scale); + dst->metrics.x_scale = from_long(src->metrics.x_scale); + dst->metrics.y_ppem = src->metrics.y_ppem; + dst->metrics.x_ppem = src->metrics.x_ppem; + dst->generic.finalizer = from_ptrv(src->generic.finalizer); + dst->generic.data = from_ptrv(src->generic.data); + dst->face = from_ptrv(src->face); +} + +void inplace_FT_SizeRec_shrink(void* a) +{ + if(!a) return; + + convert_FT_SizeRec_to_32(a, a); +} +void inplace_FT_SizeRec_enlarge(void* a) +{ + if(!a) return; + + convert_FT_SizeRec_to_64(a, a); +} + + +void inplace_FT_FaceRec_shrink(void* a) +{ + if(!a) return; + FT_FaceRec_t* src = a; + FT_FaceRec_32_t* dst = a; + void* glyphslot = src->glyph; + + dst->num_faces = to_long(src->num_faces); + dst->face_index = to_long(src->face_index); + dst->face_flags = to_long(src->face_flags); + dst->style_flags = to_long(src->style_flags); + dst->num_glyphs = to_long(src->num_glyphs); + dst->family_name = to_ptrv(src->family_name); + dst->style_name = to_ptrv(src->style_name); + { + FT_Bitmap_Size_32_t* dst_sizes = (void*)src->available_sizes; + for(int i=0; inum_fixed_sizes; ++i) { + dst_sizes[i].height = src->available_sizes[i].height; + dst_sizes[i].width = src->available_sizes[i].width; + dst_sizes[i].size = to_long(src->available_sizes[i].size); + dst_sizes[i].x_ppem = to_long(src->available_sizes[i].x_ppem); + dst_sizes[i].y_ppem = to_long(src->available_sizes[i].y_ppem); + } + } + dst->num_fixed_sizes = src->num_fixed_sizes; + dst->available_sizes = to_ptrv(src->available_sizes); + //convert charmaps content then pointers array + for(int i=0; inum_charmaps; ++i) + inplace_FT_CharMapRec_shrink(src->charmaps[i]); + for(int i=0; inum_charmaps; ++i) + ((ptr_t*)src->charmaps)[i] = to_ptrv(src->charmaps[i]); + dst->num_charmaps = src->num_charmaps; + dst->charmaps = to_ptrv(src->charmaps); + dst->generic.data = to_ptrv(src->generic.data); + dst->generic.finalizer = to_ptrv(src->generic.finalizer); + dst->bbox.xMin = to_long(src->bbox.xMin); + dst->bbox.yMin = to_long(src->bbox.yMin); + dst->bbox.xMax = to_long(src->bbox.xMax); + dst->bbox.yMax = to_long(src->bbox.yMax); + dst->units_per_EM = src->units_per_EM; + dst->ascender = src->ascender; + dst->descender = src->descender; + dst->height = src->height; + dst->max_advance_width = src->max_advance_width; + dst->max_advance_height = src->max_advance_height; + dst->underline_position = src->underline_position; + dst->underline_thickness = src->underline_thickness; + inplace_FT_SizeRec_shrink(src->size); + dst->glyph = to_ptrv(src->glyph); + dst->size = to_ptrv(src->size); + dst->charmap = to_ptrv(src->charmap); + dst->driver = to_ptrv(src->driver); + dst->memory = to_ptrv(src->memory); + //((FT_StreamDesc_32_t*)src->stream)->value = to_long(src->stream->value); + //((FT_StreamDesc_32_t*)src->stream)->pointer = to_ptrv(src->stream->pointer); + dst->stream = to_ptrv(src->stream); + dst->sizes_list.head = to_ptrv(src->sizes_list.head); + dst->sizes_list.tail = to_ptrv(src->sizes_list.tail); + dst->autohint.data = to_ptrv(src->autohint.data); + dst->autohint.finalizer = to_ptrv(src->autohint.finalizer); + dst->extensions = to_ptrv(src->extensions); + dst->internal = to_ptrv(src->internal); + + inplace_FT_GlyphSlot_shrink(glyphslot); +} + +void inplace_FT_FaceRec_enlarge(void* a) +{ + if(!a) return; + FT_FaceRec_32_t* src = a; + FT_FaceRec_t* dst = a; + void* glyphslot = from_ptrv(src->glyph); + + dst->internal = from_ptrv(src->internal); + dst->extensions = from_ptrv(src->extensions); + dst->autohint.finalizer = from_ptrv(src->autohint.finalizer); + dst->autohint.data = from_ptrv(src->autohint.data); + dst->sizes_list.tail = from_ptrv(src->sizes_list.tail); + dst->sizes_list.head = from_ptrv(src->sizes_list.head); + dst->stream = from_ptrv(src->stream); + //dst->stream->pointer = from_ptrv(((FT_StreamDesc_32_t*)dst->stream)->pointer); + //dst->stream->value = from_long(((FT_StreamDesc_32_t*)dst->stream)->value); + dst->memory = from_ptrv(src->memory); + dst->driver = from_ptrv(src->driver); + dst->charmap = from_ptrv(src->charmap); + dst->size = from_ptrv(src->size); + inplace_FT_SizeRec_enlarge(dst->size); + dst->glyph = from_ptrv(src->glyph); + dst->underline_thickness = src->underline_thickness; + dst->underline_position = src->underline_position; + dst->max_advance_height = src->max_advance_height; + dst->max_advance_width = src->max_advance_width; + dst->height = src->height; + dst->descender = src->descender; + dst->ascender = src->ascender; + dst->units_per_EM = src->units_per_EM; + dst->bbox.yMax = from_long(src->bbox.yMax); + dst->bbox.xMax = from_long(src->bbox.xMax); + dst->bbox.yMin = from_long(src->bbox.yMin); + dst->bbox.xMin = from_long(src->bbox.xMin); + dst->generic.finalizer = from_ptrv(src->generic.finalizer); + dst->generic.data = from_ptrv(src->generic.data); + dst->charmaps = from_ptrv(src->charmaps); + dst->num_charmaps = src->num_charmaps; + //convert charmaps pointer array then content + for(int i=dst->num_charmaps-1; i>=0; --i) + dst->charmaps[i] = from_ptrv(((ptr_t*)dst->charmaps)[i]); + for(int i=dst->num_charmaps-1; i>=0; --i) + inplace_FT_CharMapRec_enlarge(dst->charmaps[i]); + dst->available_sizes = from_ptrv(src->available_sizes); + dst->num_fixed_sizes = src->num_fixed_sizes; + { + FT_Bitmap_Size_32_t* src_sizes = (void*)dst->available_sizes; + for(int i=dst->num_fixed_sizes-1; i>=0; --i) { + dst->available_sizes[i].height = src_sizes[i].height; + dst->available_sizes[i].width = src_sizes[i].width; + dst->available_sizes[i].size = from_long(src_sizes[i].size); + dst->available_sizes[i].x_ppem = from_long(src_sizes[i].x_ppem); + dst->available_sizes[i].y_ppem = from_long(src_sizes[i].y_ppem); + } + } + dst->style_name = from_ptrv(src->style_name); + dst->family_name = from_ptrv(src->family_name); + dst->num_glyphs = from_long(src->num_glyphs); + dst->style_flags = from_long(src->style_flags); + dst->face_flags = from_long(src->face_flags); + dst->face_index = from_long(src->face_index); + dst->num_faces = from_long(src->num_faces); + + inplace_FT_GlyphSlot_enlarge(glyphslot); +} + +void convert_PS_PrivateRec_to_32(void* d, void* s) +{ + PS_PrivateRec_t* src = s; + PS_PrivateRec_32_t* dst = d; + + dst->unique_id = src->unique_id; + dst->lenIV = src->lenIV; + dst->num_blue_values = src->num_blue_values; + dst->num_other_blues = src->num_other_blues; + dst->num_family_blues = src->num_family_blues; + dst->num_family_other_blues = src->num_family_other_blues; + memcpy(dst->blue_values, src->blue_values, sizeof(dst->blue_values)); + memcpy(dst->other_blues, src->other_blues, sizeof(dst->other_blues)); + memcpy(dst->family_blues, src->family_blues, sizeof(dst->family_blues)); + memcpy(dst->family_other_blues, src->family_other_blues, sizeof(dst->family_other_blues)); + dst->blue_scale = src->blue_scale; + dst->blue_shift = src->blue_shift; + dst->blue_fuzz = src->blue_fuzz; + dst->standard_width[0] = src->standard_width[0]; + dst->standard_height[0] = src->standard_height[0]; + dst->num_snap_widths = src->num_snap_widths; + dst->num_snap_heights = src->num_snap_heights; + dst->force_bold = src->force_bold; + dst->round_stem_up = src->round_stem_up; + memcpy(dst->snap_widths, src->snap_widths, sizeof(dst->snap_widths)); + memcpy(dst->snap_heights, src->snap_heights, sizeof(dst->snap_heights)); + dst->expansion_factor = src->expansion_factor; + dst->language_group = src->language_group; + dst->password = src->password; + dst->min_feature[0] = src->min_feature[0]; + dst->min_feature[1] = src->min_feature[1]; +} + +void convert_BDF_PropertyRec_to_32(void* d, void* s) +{ + BDF_PropertyRec_t* src = s; + BDF_PropertyRec_32_t* dst = d; + + dst->type = src->type; + switch(dst->type) { + case 0: break; + case 1: dst->u.atom = to_ptrv(src->u.atom); break; + case 2: dst->u.integer = src->u.integer; break; + case 3: dst->u.cardinal = src->u.cardinal; break; + } +} + +void convert_FT_Size_RequestRec_to_64(void* d, void* s) +{ + FT_Size_RequestRec_t* src = s; + FT_Size_RequestRec_32_t* dst = d; + + dst->type = src->type; + dst->width = from_long(src->width); + dst->height = from_long(src->height); + dst->horiResolution = src->horiResolution; + dst->vertResolution = src->vertResolution; +} + +void convert_FT_WinFNT_HeaderRec_to_32(void* d, void* s) +{ + FT_WinFNT_HeaderRec_t* src = s; + FT_WinFNT_HeaderRec_32_t* dst = d; + + dst->version = src->version; + dst->file_size = to_ulong(src->file_size); + memcpy(dst->copyright, src->copyright, sizeof(dst->copyright)); + dst->file_type = src->file_type; + dst->nominal_point_size = src->nominal_point_size; + dst->vertical_resolution = src->vertical_resolution; + dst->horizontal_resolution = src->horizontal_resolution; + dst->ascent = src->ascent; + dst->internal_leading = src->internal_leading; + dst->external_leading = src->external_leading; + dst->italic = src->italic; + dst->underline = src->underline; + dst->strike_out = src->strike_out; + dst->weight = src->weight; + dst->charset = src->charset; + dst->pixel_width = src->pixel_width; + dst->pixel_height = src->pixel_height; + dst->pitch_and_family = src->pitch_and_family; + dst->avg_width = src->avg_width; + dst->max_width = src->max_width; + dst->first_char = src->first_char; + dst->last_char = src->last_char; + dst->default_char = src->default_char; + dst->break_char = src->break_char; + dst->bytes_per_row = src->bytes_per_row; + dst->device_offset = to_ulong(src->device_offset); + dst->face_name_offset = to_ulong(src->face_name_offset); + dst->bits_pointer = to_ulong(src->bits_pointer); + dst->bits_offset = to_ulong(src->bits_offset); + dst->reserved = src->reserved; + dst->flags = to_ulong(src->flags); + dst->A_space = src->A_space; + dst->B_space = src->B_space; + dst->C_space = src->C_space; + dst->color_table_offset = src->color_table_offset; + dst->reserved1[0] = to_ulong(src->reserved1[0]); + dst->reserved1[1] = to_ulong(src->reserved1[1]); + dst->reserved1[2] = to_ulong(src->reserved1[2]); + dst->reserved1[3] = to_ulong(src->reserved1[3]); +} + +void convert_FT_Matrix_to_32(void* d, void* s) +{ + FT_Matrix_t* src = s; + FT_Matrix_32_t* dst = d; + + dst->xx = to_long(src->xx); + dst->xy = to_long(src->xy); + dst->yx = to_long(src->yx); + dst->yy = to_long(src->yy); +} +void convert_FT_Matrix_to_64(void* d, void* s) +{ + FT_Matrix_32_t* src = s; + FT_Matrix_t* dst = d; + + dst->yy = from_long(src->yy); + dst->yx = from_long(src->yx); + dst->xy = from_long(src->xy); + dst->xx = from_long(src->xx); +} + +void convert_FT_Bitmap_to_32(void* d, void* s) +{ + FT_Bitmap_t* src = s; + FT_Bitmap_32_t* dst = d; + + dst->rows = src->rows; + dst->width = src->width; + dst->pitch = src->pitch; + dst->buffer = to_ptrv(src->buffer); + dst->num_grays = src->num_grays; + dst->pixel_mode = src->pixel_mode; + dst->palette_mode = src->palette_mode; + dst->palette = to_ptrv(src->palette); +} +void convert_FT_Bitmap_to_64(void* d, void* s) +{ + FT_Bitmap_32_t* src = s; + FT_Bitmap_t* dst = d; + + dst->palette = from_ptrv(src->palette); + dst->palette_mode = src->palette_mode; + dst->pixel_mode = src->pixel_mode; + dst->num_grays = src->num_grays; + dst->buffer = from_ptrv(src->buffer); + dst->pitch = src->pitch; + dst->width = src->width; + dst->rows = src->rows; +} + +void convert_FT_Outline_to_32(void* d, void* s) +{ + if(!s || !d) return; + FT_Outline_t* src = s; + FT_Outline_32_t* dst = d; + + dst->n_contours = src->n_contours; + dst->n_points = src->n_points; + dst->points = to_ptrv(src->points); + dst->tags = to_ptrv(src->tags); + dst->contours = to_ptrv(src->contours); + dst->flags = src->flags; + int n = dst->n_points; + FT_Vector_32_t* vec = from_ptrv(dst->points); + for(int i=0; ipoints[i].x); + vec[i].y = to_long(src->points[i].y); + } +} + +void convert_FT_Outline_to_64(void* d, void* s) +{ + if(!s || !d) return; + FT_Outline_32_t* src = s; + FT_Outline_t* dst = d; + + dst->flags = src->flags; + dst->contours = from_ptrv(src->contours); + dst->tags = from_ptrv(src->tags); + dst->points = from_ptrv(src->points); + dst->n_points = src->n_points; + dst->n_contours = src->n_contours; + int n = dst->n_points; + FT_Vector_32_t* vec = (FT_Vector_32_t*)dst->points; + for(int i=n-1; i>=0; --i) { + dst->points[i].x = from_long(vec[i].x); + dst->points[i].y = from_long(vec[i].y); + } +} + +void inplace_FT_Glyph_shrink(void* a) +{ + if(!a) + return; + + FT_GlyphRec_t* src = a; + FT_GlyphRec_32_t* dst = a; + + dst->library = to_ptrv(src->library); + dst->clazz = to_ptrv(src->clazz); + dst->format = src->format; + dst->advance.x = to_long(src->advance.x); + dst->advance.y = to_long(src->advance.y); + + if(dst->format == FT_GLYPH_FORMAT_OUTLINE) { + FT_Outline_t* src_o = (FT_Outline_t*)(src+1); + FT_Outline_32_t* dst_o = (FT_Outline_32_t*)(dst+1); + + convert_FT_Outline_to_32(dst_o, src_o); + } else if(dst->format == FT_GLYPH_FORMAT_BITMAP) { + FT_BitmapGlyphRec_t* src_b = a; + FT_BitmapGlyphRec_32_t* dst_b = a; + + dst_b->left = src_b->left; + dst_b->top = src_b->top; + convert_FT_Bitmap_to_32(&dst_b->bitmap, &src_b->bitmap); + } else { + printf_log(LOG_NONE, "Warning, unsupported glyph format 0x%x (%c%c%c%c)\n", dst->format, dst->format >> 24, (dst->format >> 16) & 0xff, (dst->format >> 8) & 0xff, dst->format & 0xff); + } +} + +void inplace_FT_Glyph_enlarge(void* a) +{ + if(!a) + return; + + FT_GlyphRec_32_t* src = a; + FT_GlyphRec_t* dst = a; + + dst->advance.y = from_long(src->advance.y); + dst->advance.x = from_long(src->advance.x); + dst->format = src->format; + dst->clazz = from_ptrv(src->clazz); + dst->library = from_ptrv(src->library); + + if(dst->format == FT_GLYPH_FORMAT_OUTLINE) { + FT_Outline_t* dst_o = (FT_Outline_t*)(dst+1); + FT_Outline_32_t* src_o = (FT_Outline_32_t*)(src+1); + + convert_FT_Outline_to_64(dst_o, src_o); + } else if(dst->format == FT_GLYPH_FORMAT_BITMAP) { + FT_BitmapGlyphRec_32_t* src_b = a; + FT_BitmapGlyphRec_t* dst_b = a; + + convert_FT_Bitmap_to_64(&dst_b->bitmap, &src_b->bitmap); + dst_b->top = src_b->top; + dst_b->left = src_b->left; + } +} + +void convert_TT_Header_to_32(void* d, void* s) +{ + if(!s || !d) return; + TT_Header_t* src = s; + TT_Header_32_t* dst = d; + + dst->Table_Version = to_long(src->Table_Version); + dst->Font_Revision = to_long(src->Font_Revision); + dst->CheckSum_Adjust = to_long(src->CheckSum_Adjust); + dst->Magic_Number = to_long(src->Magic_Number); + dst->Flags = src->Flags; + dst->Units_Per_EM = src->Units_Per_EM; + dst->Created [0] = to_ulong(src->Created[0]); + dst->Created [1] = to_ulong(src->Created[1]); + dst->Modified[0] = to_ulong(src->Modified[0]); + dst->Modified[1] = to_ulong(src->Modified[1]); + dst->xMin = src->xMin; + dst->yMin = src->yMin; + dst->xMax = src->xMax; + dst->yMax = src->yMax; + dst->Mac_Style = src->Mac_Style; + dst->Lowest_Rec_PPEM = src->Lowest_Rec_PPEM; + dst->Font_Direction = src->Font_Direction; + dst->Index_To_Loc_Format = src->Index_To_Loc_Format; + dst->Glyph_Data_Format = src->Glyph_Data_Format; +} +void convert_TT_MaxProfile_to_32(void* d, void* s) +{ + if(!s || !d) return; + TT_MaxProfile_t* src = s; + TT_MaxProfile_32_t* dst = d; + + dst->version = to_long(src->version); + dst->numGlyphs = src->numGlyphs; + dst->maxPoints = src->maxPoints; + dst->maxContours = src->maxContours; + dst->maxCompositePoints = src->maxCompositePoints; + dst->maxCompositeContours = src->maxCompositeContours; + dst->maxZones = src->maxZones; + dst->maxTwilightPoints = src->maxTwilightPoints; + dst->maxStorage = src->maxStorage; + dst->maxFunctionDefs = src->maxFunctionDefs; + dst->maxInstructionDefs = src->maxInstructionDefs; + dst->maxStackElements = src->maxStackElements; + dst->maxSizeOfInstructions = src->maxSizeOfInstructions; + dst->maxComponentElements = src->maxComponentElements; + dst->maxComponentDepth = src->maxComponentDepth; +} +void convert_TT_OS2_to_32(void* d, void* s) +{ + if(!s || !d) return; + TT_OS2_t* src = s; + TT_OS2_32_t* dst = d; + + dst->version = src->version; + dst->xAvgCharWidth = src->xAvgCharWidth; + dst->usWeightClass = src->usWeightClass; + dst->usWidthClass = src->usWidthClass; + dst->fsType = src->fsType; + dst->ySubscriptXSize = src->ySubscriptXSize; + dst->ySubscriptYSize = src->ySubscriptYSize; + dst->ySubscriptXOffset = src->ySubscriptXOffset; + dst->ySubscriptYOffset = src->ySubscriptYOffset; + dst->ySuperscriptXSize = src->ySuperscriptXSize; + dst->ySuperscriptYSize = src->ySuperscriptYSize; + dst->ySuperscriptXOffset = src->ySuperscriptXOffset; + dst->ySuperscriptYOffset = src->ySuperscriptYOffset; + dst->yStrikeoutSize = src->yStrikeoutSize; + dst->yStrikeoutPosition = src->yStrikeoutPosition; + dst->sFamilyClass = src->sFamilyClass; + for(int i=0; i<10; ++i) + dst->panose[i] = src->panose[i]; + dst->ulUnicodeRange1 = src->ulUnicodeRange1; + dst->ulUnicodeRange2 = src->ulUnicodeRange2; + dst->ulUnicodeRange3 = src->ulUnicodeRange3; + dst->ulUnicodeRange4 = src->ulUnicodeRange4; + for(int i=0; i<4; ++i) + dst->achVendID[i] = src->achVendID[i]; + dst->fsSelection = src->fsSelection; + dst->usFirstCharIndex = src->usFirstCharIndex; + dst->usLastCharIndex = src->usLastCharIndex; + dst->sTypoAscender = src->sTypoAscender; + dst->sTypoDescender = src->sTypoDescender; + dst->sTypoLineGap = src->sTypoLineGap; + dst->usWinAscent = src->usWinAscent; + dst->usWinDescent = src->usWinDescent; + if(dst->version<1) return; + dst->ulCodePageRange1 = to_ulong(src->ulCodePageRange1); + dst->ulCodePageRange2 = to_ulong(src->ulCodePageRange2); + if(dst->version<2) return; + dst->sxHeight = src->sxHeight; + dst->sCapHeight = src->sCapHeight; + dst->usDefaultChar = src->usDefaultChar; + dst->usBreakChar = src->usBreakChar; + dst->usMaxContext = src->usMaxContext; + if(dst->version<5) return; + dst->usLowerOpticalPointSize = src->usLowerOpticalPointSize; + dst->usUpperOpticalPointSize = src->usUpperOpticalPointSize; +} +void convert_TT_HoriHeader_to_32(void* d, void* s) +{ + if(!s || !d) return; + TT_HoriHeader_t* src = s; + TT_HoriHeader_32_t* dst = d; + + dst->Version = to_long(src->Version); + dst->Ascender = src->Ascender; + dst->Descender = src->Descender; + dst->Line_Gap = src->Line_Gap; + dst->advance_Width_Max = src->advance_Width_Max; + dst->min_Left_Side_Bearing = src->min_Left_Side_Bearing; + dst->min_Right_Side_Bearing = src->min_Right_Side_Bearing; + dst->xMax_Extent = src->xMax_Extent; + dst->caret_Slope_Rise = src->caret_Slope_Rise; + dst->caret_Slope_Run = src->caret_Slope_Run; + dst->caret_Offset = src->caret_Offset; + for(int i=0; i<4; ++i) + dst->Reserved[i] = src->Reserved[i]; + dst->metric_Data_Format = src->metric_Data_Format; + dst->number_Of_HMetrics = src->number_Of_HMetrics; + dst->long_metrics = to_ptrv(src->long_metrics); + dst->short_metrics = to_ptrv(src->short_metrics); +} +void convert_TT_VertHeader_to_32(void* d, void* s) +{ + if(!s || !d) return; + TT_VertHeader_t* src = s; + TT_VertHeader_32_t* dst = d; + + dst->Version = to_long(src->Version); + dst->Ascender = src->Ascender; + dst->Descender = src->Descender; + dst->Line_Gap = src->Line_Gap; + dst->advance_Height_Max = src->advance_Height_Max; + dst->min_Top_Side_Bearing = src->min_Top_Side_Bearing; + dst->min_Bottom_Side_Bearing = src->min_Bottom_Side_Bearing; + dst->yMax_Extent = src->yMax_Extent; + dst->caret_Slope_Rise = src->caret_Slope_Rise; + dst->caret_Slope_Run = src->caret_Slope_Run; + dst->caret_Offset = src->caret_Offset; + for(int i=0; i<4; ++i) + dst->Reserved[i] = src->Reserved[i]; + dst->metric_Data_Format = src->metric_Data_Format; + dst->number_Of_VMetrics = src->number_Of_VMetrics; + dst->long_metrics = to_ptrv(src->long_metrics); + dst->short_metrics = to_ptrv(src->short_metrics); +} +void convert_TT_Postscript_to_32(void* d, void* s) +{ + if(!s || !d) return; + TT_Postscript_t* src = s; + TT_Postscript_32_t* dst = d; + + dst->FormatType = to_long(src->FormatType); + dst->italicAngle = to_long(src->italicAngle); + dst->underlinePosition = src->underlinePosition; + dst->underlineThickness = src->underlineThickness; + dst->isFixedPitch = to_ulong(src->isFixedPitch); + dst->minMemType42 = to_ulong(src->minMemType42); + dst->maxMemType42 = to_ulong(src->maxMemType42); + dst->minMemType1 = to_ulong(src->minMemType1); + dst->maxMemType1 = to_ulong(src->maxMemType1); +} +void convert_TT_PCLT_to_32(void* d, void* s) +{ + if(!s || !d) return; + TT_PCLT_t* src = s; + TT_PCLT_32_t* dst = d; + + dst->Version = to_long(src->Version); + dst->FontNumber = to_ulong(src->FontNumber); + dst->Pitch = src->Pitch; + dst->xHeight = src->xHeight; + dst->Style = src->Style; + dst->TypeFamily = src->TypeFamily; + dst->CapHeight = src->CapHeight; + dst->SymbolSet = src->SymbolSet; + for(int i=0; i<16; ++i) + dst->TypeFace[i] = src->TypeFace[i]; + for(int i=0; i<8; ++i) + dst->CharacterComplement[i] = src->CharacterComplement[i]; + for(int i=0; i<6; ++i) + dst->FileName[i] = src->FileName[i]; + dst->StrokeWeight = src->StrokeWeight; + dst->WidthType = src->WidthType; + dst->SerifStyle = src->SerifStyle; + dst->Reserved = src->Reserved; +} +// ================================== +// Wrapping +// ================================== + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedfreetypetypes32.h" + +#include "wrappercallback32.h" + +// utility functions +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// FT_Generic_Finalizer +#define GO(A) \ +static uintptr_t my_FT_Generic_Finalizer_fct_##A = 0; \ +static void my_FT_Generic_Finalizer_##A(void* object) \ +{ \ + RunFunctionFmt(my_FT_Generic_Finalizer_fct_##A, "p", object); \ +} +SUPER() +#undef GO +static void* find_FT_Generic_Finalizer_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_FT_Generic_Finalizer_fct_##A == (uintptr_t)fct) return my_FT_Generic_Finalizer_##A; + SUPER() + #undef GO + #define GO(A) if(my_FT_Generic_Finalizer_fct_##A == 0) {my_FT_Generic_Finalizer_fct_##A = (uintptr_t)fct; return my_FT_Generic_Finalizer_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libfreetype FT_Generic_Finalizer callback\n"); + return NULL; +} +// FTC_Face_Requester +#define GO(A) \ +static uintptr_t my_FTC_Face_Requester_fct_##A = 0; \ +static int my_FTC_Face_Requester_##A(void* face_id, void* lib, void* req, void* aface) \ +{ \ + int ret = (int)RunFunctionFmt(my_FTC_Face_Requester_fct_##A, "pppp", face_id, lib, req, aface); \ + if(aface && *(void**)aface) { \ + FT_FaceRec_t *f = *(FT_FaceRec_t**)aface; \ + f->generic.finalizer = find_FT_Generic_Finalizer_Fct(f->generic.finalizer); \ + } \ + return ret; \ +} +SUPER() +#undef GO +static void* find_FTC_Face_Requester_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_FTC_Face_Requester_fct_##A == (uintptr_t)fct) return my_FTC_Face_Requester_##A; + SUPER() + #undef GO + #define GO(A) if(my_FTC_Face_Requester_fct_##A == 0) {my_FTC_Face_Requester_fct_##A = (uintptr_t)fct; return my_FTC_Face_Requester_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libfreetype FTC_Face_Requester callback\n"); + return NULL; +} +// FT_Alloc +#define GO(A) \ +static uintptr_t my_FT_Alloc_fct_##A = 0; \ +static void* my_FT_Alloc_##A(void* memory, long size) \ +{ \ + return (void*)RunFunctionFmt(my_FT_Alloc_fct_##A, "pl", memory, size); \ +} +SUPER() +#undef GO +static void* find_FT_Alloc_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_FT_Alloc_fct_##A == (uintptr_t)fct) return my_FT_Alloc_##A; + SUPER() + #undef GO + #define GO(A) if(my_FT_Alloc_fct_##A == 0) {my_FT_Alloc_fct_##A = (uintptr_t)fct; return my_FT_Alloc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libfreetype FT_Alloc callback\n"); + return NULL; +} +// FT_Free +#define GO(A) \ +static uintptr_t my_FT_Free_fct_##A = 0; \ +static void my_FT_Free_##A(void* memory, void* p) \ +{ \ + RunFunctionFmt(my_FT_Free_fct_##A, "pp", memory, p); \ +} +SUPER() +#undef GO +static void* find_FT_Free_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_FT_Free_fct_##A == (uintptr_t)fct) return my_FT_Free_##A; + SUPER() + #undef GO + #define GO(A) if(my_FT_Free_fct_##A == 0) {my_FT_Free_fct_##A = (uintptr_t)fct; return my_FT_Free_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libfreetype FT_Free callback\n"); + return NULL; +} +// FT_Realloc +#define GO(A) \ +static uintptr_t my_FT_Realloc_fct_##A = 0; \ +static void* my_FT_Realloc_##A(void* memory, long cur, long size, void* p) \ +{ \ + return (void*)RunFunctionFmt(my_FT_Realloc_fct_##A, "pllp", memory, cur, size, p); \ +} +SUPER() +#undef GO +static void* find_FT_Realloc_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_FT_Realloc_fct_##A == (uintptr_t)fct) return my_FT_Realloc_##A; + SUPER() + #undef GO + #define GO(A) if(my_FT_Realloc_fct_##A == 0) {my_FT_Realloc_fct_##A = (uintptr_t)fct; return my_FT_Realloc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libfreetype FT_Realloc callback\n"); + return NULL; +} +// FT_Outline_MoveToFunc +#define GO(A) \ +static uintptr_t my_FT_Outline_MoveToFunc_fct_##A = 0; \ +static int my_FT_Outline_MoveToFunc_##A(void* to, void* user) \ +{ \ + return (int)RunFunctionFmt(my_FT_Outline_MoveToFunc_fct_##A, "pp", to, user); \ +} +SUPER() +#undef GO +static void* find_FT_Outline_MoveToFunc_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_FT_Outline_MoveToFunc_fct_##A == (uintptr_t)fct) return my_FT_Outline_MoveToFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_FT_Outline_MoveToFunc_fct_##A == 0) {my_FT_Outline_MoveToFunc_fct_##A = (uintptr_t)fct; return my_FT_Outline_MoveToFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libfreetype FT_Outline_MoveToFunc callback\n"); + return NULL; +} + +// FT_Outline_LineToFunc +#define GO(A) \ +static uintptr_t my_FT_Outline_LineToFunc_fct_##A = 0; \ +static int my_FT_Outline_LineToFunc_##A(void* to, void* user) \ +{ \ + return (int)RunFunctionFmt(my_FT_Outline_LineToFunc_fct_##A, "pp", to, user); \ +} +SUPER() +#undef GO +static void* find_FT_Outline_LineToFunc_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_FT_Outline_LineToFunc_fct_##A == (uintptr_t)fct) return my_FT_Outline_LineToFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_FT_Outline_LineToFunc_fct_##A == 0) {my_FT_Outline_LineToFunc_fct_##A = (uintptr_t)fct; return my_FT_Outline_LineToFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libfreetype FT_Outline_LineToFunc callback\n"); + return NULL; +} + +// FT_Outline_ConicToFunc +#define GO(A) \ +static uintptr_t my_FT_Outline_ConicToFunc_fct_##A = 0; \ +static int my_FT_Outline_ConicToFunc_##A(void* ctl, void* to, void* user) \ +{ \ + return (int)RunFunctionFmt(my_FT_Outline_ConicToFunc_fct_##A, "ppp", ctl, to, user); \ +} +SUPER() +#undef GO +static void* find_FT_Outline_ConicToFunc_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_FT_Outline_ConicToFunc_fct_##A == (uintptr_t)fct) return my_FT_Outline_ConicToFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_FT_Outline_ConicToFunc_fct_##A == 0) {my_FT_Outline_ConicToFunc_fct_##A = (uintptr_t)fct; return my_FT_Outline_ConicToFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libfreetype FT_Outline_ConicToFunc callback\n"); + return NULL; +} + +// FT_Outline_CubicToFunc +#define GO(A) \ +static uintptr_t my_FT_Outline_CubicToFunc_fct_##A = 0; \ +static int my_FT_Outline_CubicToFunc_##A(void* ctl1, void* ctl2, void* to, void* user) \ +{ \ + return (int)RunFunctionFmt(my_FT_Outline_CubicToFunc_fct_##A, "pppp", ctl1, ctl2, to, user); \ +} +SUPER() +#undef GO +static void* find_FT_Outline_CubicToFunc_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_FT_Outline_CubicToFunc_fct_##A == (uintptr_t)fct) return my_FT_Outline_CubicToFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_FT_Outline_CubicToFunc_fct_##A == 0) {my_FT_Outline_CubicToFunc_fct_##A = (uintptr_t)fct; return my_FT_Outline_CubicToFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libfreetype FT_Outline_CubicToFunc callback\n"); + return NULL; +} + +// structures +#define GO(A) \ +static FT_MemoryRec_t my_FT_MemoryRec_struct_##A = {0}; \ +static FT_MemoryRec_t* my_FT_MemoryRec_ref_##A = NULL; +SUPER() +#undef GO +static void wrap_FT_MemoryRec(FT_MemoryRec_t* dst, FT_MemoryRec_t* src) { + dst->user = src->user; + dst->alloc = find_FT_Alloc_Fct(src->alloc); + dst->free = find_FT_Free_Fct(src->free); + dst->realloc = find_FT_Realloc_Fct(src->realloc); +} +static FT_MemoryRec_t* find_FT_MemoryRec_Struct(FT_MemoryRec_t* s) +{ + if(!s) return NULL; + #define GO(A) if(my_FT_MemoryRec_ref_##A == s) return &my_FT_MemoryRec_struct_##A; + SUPER() + #undef GO + #define GO(A) if(!my_FT_MemoryRec_ref_##A) {wrap_FT_MemoryRec(&my_FT_MemoryRec_struct_##A, s); my_FT_MemoryRec_ref_##A = s; return &my_FT_MemoryRec_struct_##A;} + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libfreetype Struct FT_MemoryRec wrapping\n"); + return s; +} + + +#undef SUPER + +static uintptr_t my_iofunc = 0; +static unsigned long my_FT_Stream_IoFunc(FT_StreamRec_t* stream, unsigned long offset, unsigned char* buffer, unsigned long count ) +{ + static FT_StreamRec_32_t stream_s; + convert_FT_StreamRec_to_32(&stream_s, stream); + unsigned char* buffer_s = buffer; + if((uintptr_t)buffer_s>=0x100000000LL) { + buffer_s = malloc(count); + memcpy(buffer_s, buffer, count); + } + unsigned long ret = (unsigned long)RunFunctionFmt(my_iofunc, "pLpL", &stream_s, offset, buffer_s, count); + convert_FT_StreamRec_to_64(stream, &stream_s); + if(buffer_s!=buffer) { + memcpy(buffer, buffer_s, count); + free(buffer_s); + } + return ret; +} + +static uintptr_t my_closefunc = 0; +static void my_FT_Stream_CloseFunc(FT_StreamRec_t* stream) +{ + static FT_StreamRec_32_t stream_s; + convert_FT_StreamRec_to_32(&stream_s, stream); + RunFunctionFmt(my_closefunc, "p", &stream_s); + convert_FT_StreamRec_to_64(stream, &stream_s); +} + +EXPORT int my32_FT_Open_Face(x64emu_t* emu, void* library, FT_Open_Args_32_t* args, long face_index, ptr_t* aface) +{ + (void)emu; + void* aface_l = NULL; + FT_Open_Args_t args_l = {0}; + // keep streams alive and in low memory, as they are living until FT_Face_Done is done. A better way would be to dynamicaly allocate it + // and free when done, but needs to detect when stream is actualy allocated on box side... + static FT_StreamRec_t streams[16] = {0}; + static int streams_idx = 0; + FT_StreamRec_t *stream = &streams[streams_idx]; + streams_idx = (streams_idx+1)&15; + FT_Parameter_t params[50]; + args_l.flags = args->flags; + args_l.memory_base = from_ptrv(args->memory_base); + args_l.memory_size = from_long(args->memory_size); + args_l.pathname = from_ptrv(args->pathname); + args_l.stream = args->stream?stream:NULL; + if(args->stream) + convert_FT_StreamRec_to_64(stream, from_ptrv(args->stream)); + args_l.driver = from_ptrv(args->driver); + args_l.num_params = args->num_params; + args_l.params = args->params?params:NULL; + for(int i=0; args_l.num_params; ++i) { + params[i].tag = from_ulong(((FT_Parameter_32_t*)from_ptrv(args->params))[i].tag); + params[i].data = from_ptrv(((FT_Parameter_32_t*)from_ptrv(args->params))[i].data); + } + int wrapstream = (args->flags&0x02)?1:0; + if(wrapstream) { + my_iofunc = (uintptr_t)args_l.stream->read; + if(my_iofunc) { + args_l.stream->read = GetNativeFnc(my_iofunc); + if(!args_l.stream->read) + args_l.stream->read = my_FT_Stream_IoFunc; + } + my_closefunc = (uintptr_t)args_l.stream->close; + if(my_closefunc) { + args_l.stream->close = GetNativeFnc(my_closefunc); + if(!args_l.stream->close) + args_l.stream->close = my_FT_Stream_CloseFunc; + } + } + int ret = my->FT_Open_Face(library, &args_l, face_index, &aface_l); + /*if(wrapstream) { + args->stream->read = (void*)my_iofunc; + args->stream->close = (void*)my_closefunc; + }*/ + *aface = to_ptrv(aface_l); + inplace_FT_FaceRec_shrink(aface_l); + return ret; +} + +//EXPORT int my_FTC_Manager_New(x64emu_t* emu, void* l, uint32_t max_faces, uint32_t max_sizes, uintptr_t max_bytes, void* req, void* data, void* aman) +//{ +// (void)emu; +// return my->FTC_Manager_New(l, max_faces, max_sizes, max_bytes, find_FTC_Face_Requester_Fct(req), data, aman); +//} + +//EXPORT int my_FT_New_Library(x64emu_t* emu, FT_MemoryRec_t* memory, void* p) +//{ +// return my->FT_New_Library(find_FT_MemoryRec_Struct(memory), p); +//} + +typedef struct my_FT_Outline_Funcs_s +{ + void* move_to; + void* line_to; + void* conic_to; + void* cubic_to; + int shift; + signed long delta; +} my_FT_Outline_Funcs_t; + +EXPORT int my32_FT_New_Face(x64emu_t* emu, void* lib, void* name, long index, ptr_t* face) +{ + FT_FaceRec_t* res = NULL; + int ret = my->FT_New_Face(lib, name, index, &res); + if(ret) return ret; + *face = to_ptrv(res); + inplace_FT_FaceRec_shrink(res); + return ret; +} + +EXPORT int my32_FT_New_Memory_Face(x64emu_t* emu, void* lib, void* base, long size, long index, ptr_t* face) +{ + FT_FaceRec_t* res = NULL; + int ret = my->FT_New_Memory_Face(lib, base, size, index, &res); + if(ret) return ret; + *face = to_ptrv(res); + inplace_FT_FaceRec_shrink(res); + return ret; +} + +EXPORT uint32_t my32_FT_Get_Sfnt_Name_Count(x64emu_t* emu, void* face) +{ + inplace_FT_FaceRec_enlarge(face); + uint32_t ret = my->FT_Get_Sfnt_Name_Count(face); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT uint32_t my32_FT_Get_Sfnt_Name(x64emu_t* emu, void* face, uint32_t idx, void* name) +{ + inplace_FT_FaceRec_enlarge(face); + uint32_t ret = my->FT_Get_Sfnt_Name(face, idx, name); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Get_Glyph_Name(x64emu_t* emu, void* face, uint32_t index, void* buff, uint32_t size) +{ + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Get_Glyph_Name(face, index, buff, size); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT void* my32_FT_Get_X11_Font_Format(x64emu_t* emu, void* face) +{ + inplace_FT_FaceRec_enlarge(face); + void* ret = my->FT_Get_X11_Font_Format(face); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT void* my32_FT_Get_Postscript_Name(x64emu_t* emu, void* face) +{ + inplace_FT_FaceRec_enlarge(face); + void* ret = my->FT_Get_Postscript_Name(face); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Load_Sfnt_Table(x64emu_t* emu, void* face, unsigned long tag, long offset, void* buff, ulong_t* length) +{ + unsigned long len_l = 0; + if(length) len_l = from_ulong(*length); + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Load_Sfnt_Table(face, tag, offset, buff, length?(&len_l):NULL); + inplace_FT_FaceRec_shrink(face); + if(length) *length = to_ulong(len_l); + return ret; +} + +EXPORT unsigned long my32_FT_Get_First_Char(x64emu_t* emu, void* face, uint32_t* index) +{ + inplace_FT_FaceRec_enlarge(face); + unsigned long ret = my->FT_Get_First_Char(face, index); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Get_PS_Font_Info(x64emu_t* emu, void* face, PS_PrivateRec_32_t* info) +{ + PS_PrivateRec_t info_l = {0}; + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Get_PS_Font_Info(face, &info_l); + inplace_FT_FaceRec_shrink(face); + convert_PS_PrivateRec_to_32(info, &info_l); + return ret; +} + +EXPORT int my32_FT_Select_Charmap(x64emu_t* emu, void* face, int encoding) +{ + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Select_Charmap(face, encoding); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT void* my32_FT_Get_Sfnt_Table(x64emu_t* emu, void* face, int tag) +{ + inplace_FT_FaceRec_enlarge(face); + void* ret = my->FT_Get_Sfnt_Table(face, tag); + inplace_FT_FaceRec_shrink(face); + if(!ret) return ret; + static TT_Header_32_t tt_head = {0}; + static TT_MaxProfile_32_t tt_max = {0}; + static TT_OS2_32_t tt_os2 = {0}; + static TT_HoriHeader_32_t tt_hori = {0}; + static TT_VertHeader_32_t tt_vert = {0}; + static TT_Postscript_32_t tt_post = {0}; + static TT_PCLT_32_t tt_pclt = {0}; + switch(tag) { + case 0: convert_TT_Header_to_32(&tt_head, ret); return &tt_head; + case 1: convert_TT_MaxProfile_to_32(&tt_max, ret); return &tt_max; + case 2: convert_TT_OS2_to_32(&tt_os2, ret); return &tt_os2; + case 3: convert_TT_HoriHeader_to_32(&tt_hori, ret); return &tt_hori; + case 4: convert_TT_VertHeader_to_32(&tt_vert, ret); return &tt_vert; + case 5: convert_TT_Postscript_to_32(&tt_post, ret); return &tt_post; + case 6: convert_TT_PCLT_to_32(&tt_pclt, ret); return &tt_pclt; + } + printf_log(LOG_NONE, "Warning, unsupported type %d for FT_Get_Sfnt_Table\n", tag); + return ret; +} + +EXPORT int my32_FT_Select_Size(x64emu_t* emu, void* face, int index) +{ + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Select_Size(face, index); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT unsigned long my32_FT_Get_Next_Char(x64emu_t* emu, void* face, unsigned long code, void* buff) +{ + inplace_FT_FaceRec_enlarge(face); + unsigned long ret = my->FT_Get_Next_Char(face, code, buff); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Has_PS_Glyph_Names(x64emu_t* emu, void* face) +{ + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Has_PS_Glyph_Names(face); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Get_BDF_Property(x64emu_t* emu, void* face, void* name, BDF_PropertyRec_32_t* prop) +{ + BDF_PropertyRec_t prop_l = {0}; + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Get_BDF_Property(face, name, &prop_l); + inplace_FT_FaceRec_shrink(face); + convert_BDF_PropertyRec_to_32(prop, &prop_l); + return ret; +} + +KHASH_MAP_INIT_INT(face_ref, uintptr_t); + +static kh_face_ref_t *face_ref = NULL; + +EXPORT int my32_FT_Reference_Face(x64emu_t* emu, void* face) +{ + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Reference_Face(face); + inplace_FT_FaceRec_shrink(face); + if(!ret) { + if(!face_ref) face_ref = kh_init(face_ref); + } + khint_t k = kh_get(face_ref, face_ref, (uintptr_t)face); + if(k==kh_end(face_ref)) { + int ret; + k = kh_put(face_ref, face_ref, (uintptr_t)face, &ret); + kh_value(face_ref, k) = 0; + } + ++kh_value(face_ref, k); + return ret; +} + +EXPORT int my32_FT_Done_Face(x64emu_t* emu, void* face) +{ + int will_keep = 0; + khint_t k; + if(face_ref && ((k=kh_get(face_ref, face_ref, (uintptr_t)face)!=kh_end(face_ref)))) + will_keep = 1; + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Done_Face(face); + if(will_keep) { + inplace_FT_FaceRec_shrink(face); + --kh_value(face_ref, k); + if(!kh_value(face_ref, k)) + kh_del(face_ref, face_ref, k); + } + return ret; +} + +EXPORT void my32_FT_Set_Transform(x64emu_t* emu, void* face, FT_Matrix_32_t* matrix, FT_Vector_32_t* delta) +{ + FT_Matrix_t matrix_l = {0}; + FT_Vector_t delta_l = {0}; + inplace_FT_FaceRec_enlarge(face); + if(matrix) + convert_FT_Matrix_to_64(&delta_l, matrix); + if(delta) { + delta_l.x = from_long(delta->x); + delta_l.y = from_long(delta->y); + } + my->FT_Set_Transform(face, matrix?(&matrix_l):NULL, delta?(&delta_l):NULL); + inplace_FT_FaceRec_shrink(face); +} + + +EXPORT int my32_FT_Get_Kerning(x64emu_t* emu, void* face, uint32_t left, uint32_t right, uint32_t kern, FT_Vector_32_t* kerning) +{ + FT_Vector_t kerning_l = {0}; + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Get_Kerning(face, left, right, kern, &kerning_l); + inplace_FT_FaceRec_shrink(face); + kerning->x = kerning_l.x; + kerning->y = kerning_l.y; + return ret; +} + +EXPORT int my32_FT_Set_Char_Size(x64emu_t* emu, void* face, long char_width, long char_height, uint32_t horz, uint32_t vert) +{ + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Set_Char_Size(face, char_width, char_height, horz, vert); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Set_Pixel_Sizes(x64emu_t* emu, void* face, uint32_t width, uint32_t height) +{ + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Set_Pixel_Sizes(face, width, height); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Request_Size(x64emu_t* emu, void* face, FT_Size_RequestRec_32_t* req) +{ + FT_Size_RequestRec_t req_l = {0}; + convert_FT_Size_RequestRec_to_64(&req_l, req); + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Request_Size(face, &req_l); + inplace_FT_FaceRec_enlarge(face); + return ret; +} + +EXPORT uint32_t my32_FT_Get_Char_Index(x64emu_t* emu, void* face, unsigned long code) +{ + inplace_FT_FaceRec_enlarge(face); + uint32_t ret = my->FT_Get_Char_Index(face, code); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Load_Char(x64emu_t* emu, void* face, unsigned long code, int flags) +{ + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Load_Char(face, code, flags); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Load_Glyph(x64emu_t* emu, void* face, uint32_t index, int flags) +{ + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Load_Glyph(face, index, flags); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Set_Charmap(x64emu_t* emu, void* face, void* charmap) +{ + // do not enlarge charmap, as it's already part of the face and so is expanded already + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Set_Charmap(face, charmap); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Get_Advance(x64emu_t* emu, void* face, uint32_t gindex, int load_flags, long_t*padvance) +{ + signed long advance_l = 0; + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Get_Advance(face, gindex, load_flags, &advance_l); + inplace_FT_FaceRec_shrink(face); + *padvance = to_long(advance_l); + return ret; +} + +EXPORT int my32_FT_Get_MM_Var(x64emu_t* emu, void* face, FT_MM_Var_32_t* amaster) +{ + FT_MM_Var_t* amaster_l = NULL; + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Get_MM_Var(face, amaster_l); + inplace_FT_FaceRec_shrink(face); + if(!amaster_l) return ret; + // create a 32bits structure... + size_t sz = sizeof(FT_MM_Var_32_t)+sizeof(void*); + if(amaster_l->axis) + sz += amaster_l->num_axis*sizeof(FT_Var_Axis_32_t); + if(amaster->namedstyle) + sz += amaster_l->num_namedstyles*(sizeof(FT_Var_Named_Style_32_t) + amaster_l->num_axis*sizeof(long_t)); + void* p = box32_calloc(1, sz); + amaster = p; p += sizeof(FT_MM_Var_32_t); + *(void**)p = amaster_l; // save original value + p += sizeof(void*); + amaster->num_axis = amaster_l->num_axis; + amaster->num_designs = amaster_l->num_designs; + amaster->num_namedstyles = amaster_l->num_namedstyles; + if(amaster_l->axis) { + amaster->axis = to_ptrv(p); + FT_Var_Axis_32_t* axis = p; + p += amaster_l->num_axis*sizeof(FT_Var_Axis_32_t); + for(uint32_t i=0; inum_axis; ++i) { + axis[i].name = to_cstring(amaster_l->axis[i].name); + axis[i].minimum = to_long(amaster_l->axis[i].minimum); + axis[i].def = to_long(amaster_l->axis[i].def); + axis[i].maximum = to_long(amaster_l->axis[i].maximum); + axis[i].tag = to_ulong(amaster_l->axis[i].tag); + axis[i].strid = amaster_l->axis[i].strid; + } + } else + amaster->axis = 0; + if(amaster_l->namedstyle) { + amaster->axis = to_ptrv(p); + FT_Var_Named_Style_32_t* axis = p; + p += amaster_l->num_axis*sizeof(FT_Var_Named_Style_32_t); + for(uint32_t i=0; inum_namedstyles; ++i) { + axis[i].coords = to_ptrv(p); + long_t* coords = p; + p += sizeof(long_t)*amaster_l->num_axis; + for(uint32_t j=0; jnum_axis; ++j) + coords[j] = to_long(amaster_l->namedstyle[i].coords[j]); + } + } else + amaster->namedstyle = 0; + return ret; +} + +EXPORT int my32_FT_Done_MM_Var(x64emu_t* emu, void* face, FT_MM_Var_32_t* amaster) +{ + inplace_FT_FaceRec_enlarge(face); + void* amaster_l = amaster+1; + int ret = my->FT_Done_MM_Var(face, amaster_l); + inplace_FT_FaceRec_shrink(face); + box32_free(amaster); // should check result first? + return ret; +} + +EXPORT int my32_FT_Set_Var_Design_Coordinates(x64emu_t* emu, void* face, uint32_t num_coords, long_t* coords) +{ + long coords_l[num_coords]; + for(uint32_t i=0; iFT_Set_Var_Design_Coordinates(face, num_coords, coords_l); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Set_Var_Blend_Coordinates(x64emu_t* emu, void* face, uint32_t num_coords, long_t* coords) +{ + long coords_l[num_coords]; + for(uint32_t i=0; iFT_Set_Var_Blend_Coordinates(face, num_coords, coords_l); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Get_Var_Blend_Coordinates(x64emu_t* emu, void* face, uint32_t num_coords, long_t* coords) +{ + long coords_l[num_coords]; + memset(coords_l, 0, sizeof(coords_l)); + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Get_Var_Blend_Coordinates(face, num_coords, coords_l); + inplace_FT_FaceRec_shrink(face); + for(uint32_t i=0; iFT_Face_GetCharVariantIndex(face, charcode, variantSel); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT uint32_t my32_FT_Get_Name_Index(x64emu_t* emu, void* face, void* name) +{ + inplace_FT_FaceRec_enlarge(face); + uint32_t ret = my->FT_Get_Name_Index(face, name); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT uint16_t my32_FT_Get_FSType_Flags(x64emu_t* emu, void* face) +{ + inplace_FT_FaceRec_enlarge(face); + uint16_t ret = my->FT_Get_FSType_Flags(face); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Get_Advances(x64emu_t* emu, void* face, uint32_t start, uint32_t count, int flags, long_t* padvances) +{ + signed long advances_l[count]; + memset(advances_l, 0, sizeof(advances_l)); + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Get_Advances(face, start, count, flags, advances_l); + inplace_FT_FaceRec_shrink(face); + for(uint32_t i=0; iFT_Outline_Get_CBox(&outline_l, &res); + bbox->xMin = to_long(res.xMin); + bbox->yMin = to_long(res.yMin); + bbox->xMax = to_long(res.xMax); + bbox->yMax = to_long(res.yMax); +} + +EXPORT int my32_FT_Outline_Copy(x64emu_t* emu, FT_Outline_32_t* source, FT_Outline_32_t* target) +{ + FT_Outline_t source_l = {0}, target_l = {0}; + convert_FT_Outline_to_64(&source_l, source); + convert_FT_Outline_to_64(&target_l, target); + int ret = my->FT_Outline_Copy(source, target); + convert_FT_Outline_to_32(target, &target_l); + return ret; +} + +EXPORT int my32_FT_Render_Glyph(x64emu_t* emu, FT_GlyphSlotRec_32_t* glyph, uint32_t mode) +{ + #if 1 + void* face = from_ptrv(glyph->face); + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Render_Glyph(glyph, mode); + inplace_FT_FaceRec_shrink(face); + #else + FT_GlyphSlotRec_t slot = {0}; + convert_FT_GlyphSlot_to_64(&slot, glyph); + int ret = my->FT_Render_Glyph(&slot, mode); + convert_FT_GlyphSlot_to_32(glyph, &slot); + #endif + return ret; +} + +EXPORT int my32_FT_Get_WinFNT_Header(x64emu_t* emu, void* face, FT_WinFNT_HeaderRec_32_t* aheader) +{ + FT_WinFNT_HeaderRec_t aheader_l = {0}; + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Get_WinFNT_Header(face, &aheader_l); + inplace_FT_FaceRec_shrink(face); + if(!ret) + convert_FT_WinFNT_HeaderRec_to_32(aheader, &aheader_l); + return ret; +} + +EXPORT void my32_FT_Matrix_Multiply(x64emu_t* emu, FT_Matrix_32_t* a, FT_Matrix_32_t* b) +{ + FT_Matrix_t a_l, b_l; + convert_FT_Matrix_to_64(&a_l, a); + convert_FT_Matrix_to_64(&b_l, b); + my->FT_Matrix_Multiply(&a_l, &b_l); + convert_FT_Matrix_to_32(b, &b_l); +} + +EXPORT int my32_FT_Outline_Get_Bitmap(x64emu_t* emu, void* lib, FT_Outline_32_t* outline, FT_Bitmap_32_t* bitmap) +{ + FT_Bitmap_t bitmap_l = {0}; + FT_Outline_t outline_l = {0}; + convert_FT_Outline_to_64(&outline_l, outline); + convert_FT_Bitmap_to_64(&bitmap_l, bitmap); + int ret = my->FT_Outline_Get_Bitmap(lib, &outline_l, &bitmap_l); + convert_FT_Bitmap_to_32(bitmap, &bitmap_l); + convert_FT_Outline_to_32(outline, &outline_l); //usefull? + return ret; +} + +EXPORT void my32_FT_Outline_Transform(x64emu_t* emu, FT_Outline_32_t* outline, FT_Matrix_32_t* matrix) +{ + FT_Matrix_t matrix_l = {0}; + FT_Outline_t outline_l = {0}; + convert_FT_Outline_to_64(&outline_l, outline); + convert_FT_Matrix_to_64(&matrix_l, matrix); + my->FT_Outline_Transform(&outline_l, &matrix_l); + convert_FT_Outline_to_32(outline, &outline_l); +} + +EXPORT void my32_FT_Outline_Translate(x64emu_t* emu, FT_Outline_32_t* outline, long x, long y) +{ + FT_Outline_t outline_l = {0}; + convert_FT_Outline_to_64(&outline_l, outline); + my->FT_Outline_Translate(&outline_l, x, y); + convert_FT_Outline_to_32(outline, &outline_l); +} + +EXPORT void my32_FT_Outline_Embolden(x64emu_t* emu, FT_Outline_32_t* outline, long strength) +{ + FT_Outline_t outline_l = {0}; + convert_FT_Outline_to_64(&outline_l, outline); + my->FT_Outline_Embolden(&outline_l, strength); + convert_FT_Outline_to_32(outline, &outline_l); +} + +EXPORT void my32_FT_Outline_EmboldenXY(x64emu_t* emu, FT_Outline_32_t* outline, long xstrength, long ystrength) +{ + FT_Outline_t outline_l = {0}; + convert_FT_Outline_to_64(&outline_l, outline); + my->FT_Outline_EmboldenXY(&outline_l, xstrength, ystrength); + convert_FT_Outline_to_32(outline, &outline_l); +} + +EXPORT int my32_FT_Outline_Decompose(x64emu_t* emu, FT_Outline_32_t* outline, my_FT_Outline_Funcs_t* tbl, void* data) +{ + FT_Outline_t outline_l = {0}; + convert_FT_Outline_to_64(&outline_l, outline); + // + my_FT_Outline_Funcs_t f = {0}; + if(tbl) { + f.move_to = find_FT_Outline_MoveToFunc_Fct(tbl->move_to); + f.line_to = find_FT_Outline_LineToFunc_Fct(tbl->line_to); + f.conic_to = find_FT_Outline_ConicToFunc_Fct(tbl->conic_to); + f.cubic_to = find_FT_Outline_CubicToFunc_Fct(tbl->cubic_to); + f.shift = tbl->shift; + f.delta = tbl->delta; + } + int ret = my->FT_Outline_Decompose(&outline_l, tbl?(&f):tbl, data); + convert_FT_Outline_to_32(outline, &outline_l); + return ret; +} + +EXPORT int my32_FT_Outline_Done(x64emu_t* emu, void* library, FT_Outline_32_t* outline) +{ + FT_Outline_t outline_l = {0}; + convert_FT_Outline_to_64(&outline_l, outline); + int ret = my->FT_Outline_Done(library, &outline_l); + return ret; +} + +EXPORT int my32_FT_Outline_New(x64emu_t* emu, void* library, uint32_t numPoints, int numContours, FT_Outline_32_t* outline) +{ + FT_Outline_t outline_l = {0}; + int ret = my->FT_Outline_New(library, numPoints, numContours, &outline_l); + convert_FT_Outline_to_32(outline, &outline_l); + return ret; +} + + +EXPORT int my32_FT_Activate_Size(x64emu_t* emu, FT_SizeRec_32_t* size) +{ + //FT_SizeRec_t size_l = {0}; + //convert_FT_SizeRec_to_64(&size_l, size); + FT_FaceRec_t* face = from_ptrv(size->face); + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Activate_Size(size); + inplace_FT_FaceRec_shrink(face); + return ret; +} +EXPORT int my32_FT_Done_Size(x64emu_t* emu, FT_SizeRec_32_t* size) +{ + //FT_SizeRec_t size_l = {0}; + //convert_FT_SizeRec_to_64(&size_l, size); + FT_FaceRec_t* face = from_ptrv(size->face); + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_Done_Size(size); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_New_Size(x64emu_t* emu, FT_FaceRec_32_t* face, ptr_t* size) +{ + void* size_l = NULL; + inplace_FT_FaceRec_enlarge(face); + int ret = my->FT_New_Size(face, &size_l); + *size = to_ptrv(size_l); + inplace_FT_FaceRec_shrink(face); + return ret; +} + +EXPORT int my32_FT_Get_Glyph(x64emu_t* emu, FT_GlyphSlotRec_32_t* slot, ptr_t* glyph) +{ + FT_GlyphSlotRec_t slot_l = {0}; + convert_FT_GlyphSlot_to_64(&slot_l, slot); + void* glyph_l; + int ret = my->FT_Get_Glyph(&slot_l, &glyph_l); + *glyph = to_ptrv(glyph_l); + convert_FT_GlyphSlot_to_32(slot, &slot_l); + inplace_FT_Glyph_shrink(glyph_l); + return ret; +} + +EXPORT int my32_FT_GlyphSlot_Own_Bitmap(x64emu_t* emu, FT_GlyphSlotRec_32_t* slot) +{ + FT_GlyphSlotRec_t slot_l = {0}; + convert_FT_GlyphSlot_to_64(&slot_l, slot); + int ret = my->FT_GlyphSlot_Own_Bitmap(&slot_l); + convert_FT_GlyphSlot_to_32(slot, &slot_l); //usefull? + return ret; +} + +EXPORT int my32_FT_Glyph_Copy(x64emu_t* emu, void* src, void** dst) +{ + inplace_FT_Glyph_enlarge(src); + int ret = my->FT_Glyph_Copy(src, (void*)dst); + inplace_FT_Glyph_shrink(src); + inplace_FT_Glyph_shrink(*dst); + return ret; +} + +EXPORT void my32_FT_Glyph_Get_CBox(x64emu_t* emu, void* glyph, uint32_t mode, void* bbox) +{ + inplace_FT_Glyph_enlarge(glyph); + my->FT_Glyph_Get_CBox(glyph, mode, bbox); + inplace_FT_Glyph_shrink(glyph); +} + +EXPORT int my32_FT_Glyph_Transform(x64emu_t* emu, void* glyph, void* mat, void* vec) +{ + inplace_FT_Glyph_enlarge(glyph); + int ret = my->FT_Glyph_Transform(glyph, mat, vec); + inplace_FT_Glyph_shrink(glyph); + return ret; +} + +EXPORT void my32_FT_Done_Glyph(x64emu_t* emu, void* glyph) +{ + inplace_FT_FaceRec_enlarge(glyph); + my->FT_Done_Glyph(glyph); +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedfreetype_private.h b/src/wrapped32/wrappedfreetype_private.h new file mode 100644 index 0000000..c0f82bd --- /dev/null +++ b/src/wrapped32/wrappedfreetype_private.h @@ -0,0 +1,213 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error meh! +#endif + +// FT_Bitmap is struct uuipWCCp + +GOM(FT_Activate_Size, iFEp) +//GO(FT_Add_Default_Modules, vFp) +//GO(FT_Add_Module, +//GO(FT_Angle_Diff, lFll) +//GO(FT_Atan2, lFll) +//GO(FT_Attach_File, iFpp) +//GO(FT_Attach_Stream, iFpp) +GO(FT_Bitmap_Convert, iFpruuipWCCp_buuipWCCp_i) +//GO(FT_Bitmap_Copy, iFppp) +GO(FT_Bitmap_Done, iFpruuipWCCp_) +GO(FT_Bitmap_Embolden, iFpruuipWCCp_ll) +GO(FT_Bitmap_Init, vFbuuipWCCp_) +GO(FT_Bitmap_New, vFbuuipWCCp_) +//GO(FT_CeilFix, +//GO(FT_ClassicKern_Free, +//GO(FT_ClassicKern_Validate, +GO(FT_Cos, lFl) +GO(FT_DivFix, lFll) +GOM(FT_Done_Face, iFEp) +GO(FT_Done_FreeType, iFp) +GOM(FT_Done_Glyph, vFEp) +//GO(FT_Done_Library, iFp) +GOM(FT_Done_MM_Var, iFEpp) +GOM(FT_Done_Size, iFEp) +//GO(FT_Face_CheckTrueTypePatents, +//GO(FT_Face_GetCharsOfVariant, +GOM(FT_Face_GetCharVariantIndex, uFEpLL) +//GO(FT_Face_GetCharVariantIsDefault, +//GO(FT_Face_GetVariantSelectors, +//GO(FT_Face_GetVariantsOfChar, +//GO(FT_Face_Properties, iFpup) +//GO(FT_Face_SetUnpatentedHinting, +GO(FT_FloorFix, lFl) +GOM(FT_Get_Advance, iFEpiup) +GOM(FT_Get_Advances, iFEpuuip) +//GO(FT_Get_BDF_Charset_ID, +GOM(FT_Get_BDF_Property, iFEppp) +GOM(FT_Get_Char_Index, uFEpL) +//GO(FT_Get_Charmap_Index, iFp) +//GO(FT_Get_Color_Glyph_Layer, iFpupp) +//GO(FT_Get_Color_Glyph_Paint, iFpuip) +//GO(FT_Get_Color_Glyph_ClipBox, iFpup) +//GO(FT_Get_Colorline_Stops, iFppp) +//GO(FT_Get_CID_From_Glyph_Index, +//GO(FT_Get_CID_Is_Internally_CID_Keyed, +//GO(FT_Get_CID_Registry_Ordering_Supplement, +//GO(FT_Get_CMap_Format, +//GO(FT_Get_CMap_Language_ID, +GOM(FT_Get_First_Char, LFEpp) +//GO(FT_Get_Font_Format, pFp) +GOM(FT_Get_FSType_Flags, WFEp) +//GO(FT_Get_Gasp, +GOM(FT_Get_Glyph, iFEpp) +GOM(FT_Get_Glyph_Name, iFEpupu) +GOM(FT_Get_Kerning, iFEpuuup) +//GO(FT_Get_MM_Blend_Coordinates, +GOM(FT_Get_MM_Var, iFEpp) +//GO(FT_Get_Module, pFpp) +//GO(FT_Get_Multi_Master, +GOM(FT_Get_Name_Index, uFEpp) +GOM(FT_Get_Next_Char, LFEpLp) +//GO(FT_Get_Paint, iFppip) // FT_OpaquePaint is a struct with "pi" +//GO(FT_Get_Paint_Layers, iFppp) +//GO(FT_Get_PFR_Advance, +//GO(FT_Get_PFR_Kerning, +//GO(FT_Get_PFR_Metrics, +GOM(FT_Get_Postscript_Name, pFEp) +GOM(FT_Get_PS_Font_Info, iFEpp) +//GO(FT_Get_PS_Font_Private, +//GO(FT_Get_PS_Font_Value, +//GO(FT_Get_Renderer, pFpu) +//GO(FT_Get_Sfnt_LangTag, +GOM(FT_Get_Sfnt_Name, iFEpip) +GOM(FT_Get_Sfnt_Name_Count, uFEp) +GOM(FT_Get_Sfnt_Table, pFEpi) +//GO(FT_Get_SubGlyph_Info, iFpuppppp) +//GO(FT_Get_Track_Kerning, iFplip) +//GO(FT_Get_Transform, vFppp) +GO(FT_Get_TrueType_Engine_Type, uFp) +GOM(FT_Get_Var_Blend_Coordinates, iFEpup) +//GO(FT_Get_Var_Design_Coordinates, +GOM(FT_Get_WinFNT_Header, iFEpp) +GOM(FT_Get_X11_Font_Format, pFEp) +GOM(FT_Glyph_Copy, iFEpBp_) +GOM(FT_Glyph_Get_CBox, vFEpuBLLLL_) +//GO(FT_GlyphSlot_Embolden, vFp) +//GO(FT_GlyphSlot_Oblique, vFp) +GOM(FT_GlyphSlot_Own_Bitmap, iFEp) +//GO(FT_Glyph_Stroke, iFppC) +//GO(FT_Glyph_StrokeBorder, iFppCC) +//GO(FT_Glyph_To_Bitmap, iFpupC) +GOM(FT_Glyph_Transform, iFEprllll_rll_) +//GO(FT_Gzip_Uncompress, +GOM(FT_Has_PS_Glyph_Names, iFEp) +GO(FT_Init_FreeType, iFBp_) +GO(FT_Library_SetLcdFilter, iFpu) +//GO(FT_Library_SetLcdFilterWeights, iFpp) +GO(FT_Library_Version, vFpppp) +//GO(FT_List_Add, +//GO(FT_List_Finalize, +//GO(FT_List_Find, pFpp) +//GO(FT_List_Insert, +//GO(FT_List_Iterate, +//GO(FT_List_Remove, +//GO(FT_List_Up, vFpp) +GOM(FT_Load_Char, iFEpLi) +GOM(FT_Load_Glyph, iFEpui) +GOM(FT_Load_Sfnt_Table, iFEpLlpp) +//GO(FT_Matrix_Invert, iFp) +GOM(FT_Matrix_Multiply, vFEpp) +GO(FT_MulDiv, lFlll) +GO(FT_MulFix, lFll) +GOM(FT_New_Face, iFEpplp) +//GOM(FT_New_Library, iFEpp) +GOM(FT_New_Memory_Face, iFEppllp) +GOM(FT_New_Size, iFEpp) +GOM(FT_Open_Face, iFEpplp) +//GO(FT_OpenType_Free, vFpp) +//GO(FT_OpenType_Validate, iFpuppppp) +//GO(FT_Outline_Check, iFp) +GOM(FT_Outline_Copy, iFEpp) +GOM(FT_Outline_Decompose, iFEppp) +GOM(FT_Outline_Done, iFEpp) +//GO(FT_Outline_Done_Internal, +GOM(FT_Outline_Embolden, iFEpl) +GOM(FT_Outline_EmboldenXY, iFEpll) +//GO(FT_Outline_Get_BBox, iFpp) +GOM(FT_Outline_Get_Bitmap, iFEppp) +GOM(FT_Outline_Get_CBox, vFEpp) +//GO(FT_Outline_GetInsideBorder, +//GO(FT_Outline_Get_Orientation, uFp) +//GO(FT_Outline_GetOutsideBorder, uFp) +GOM(FT_Outline_New, iFEpuip) +//GO(FT_Outline_New_Internal, +//GO(FT_Outline_Render, iFppp) +//GO(FT_Outline_Reverse, vFp) +GOM(FT_Outline_Transform, vFEpp) +GOM(FT_Outline_Translate, vFEpll) +//GO(FT_Palette_Select, iFpWp) +//GO(FT_Property_Get, iFpppp) +GO(FT_Property_Set, iFpppp) +GOM(FT_Reference_Face, iFEp) +//GO(FT_Reference_Library, +//GO(FT_Remove_Module, iFpp) +GOM(FT_Render_Glyph, iFEpu) +GOM(FT_Request_Size, iFEpp) +//GO(FT_RoundFix, +GOM(FT_Select_Charmap, iFEpi) +GOM(FT_Select_Size, iFEpi) +GOM(FT_Set_Charmap, iFEpp) +GOM(FT_Set_Char_Size, iFEplluu) +//GO(FT_Set_Debug_Hook, +//GO(FT_Set_Default_Properties, vFp) +//GO(FT_Set_MM_Blend_Coordinates, +//GO(FT_Set_MM_Design_Coordinates, iFpup) +GOM(FT_Set_Pixel_Sizes, iFEpuu) +//GO(FT_Set_Renderer, iFppup) +GOM(FT_Set_Transform, vFEppp) +GOM(FT_Set_Var_Blend_Coordinates, iFEpup) +GOM(FT_Set_Var_Design_Coordinates, iFEpup) +//GO(FT_Sfnt_Table_Info, iFpupp) +//GO(FT_Sin, lFl) +//GO(FT_Stream_OpenBzip2, +//GO(FT_Stream_OpenGzip, +//GO(FT_Stream_OpenLZW, +//GO(FT_Stroker_BeginSubPath, iFppC) +//GO(FT_Stroker_ConicTo, iFppp) +//GO(FT_Stroker_CubicTo, iFpppp) +//GO(FT_Stroker_Done, vFp) +//GO(FT_Stroker_EndSubPath, iFp) +//GO(FT_Stroker_Export, vFpp) +//GO(FT_Stroker_ExportBorder, vFpup) +//GO(FT_Stroker_GetBorderCounts, iFpupp) +//GO(FT_Stroker_GetCounts, iFppp) +//GO(FT_Stroker_LineTo, iFpp) +//GO(FT_Stroker_New, iFpp) +//GO(FT_Stroker_ParseOutline, iFppC) +//GO(FT_Stroker_Rewind, vFp) +//GO(FT_Stroker_Set, vFpluul) +//GO(FT_Tan, lFl) +//GO(FT_TrueTypeGX_Free, +//GO(FT_TrueTypeGX_Validate, +//GO(FT_Vector_From_Polar, vFpll) +GO(FT_Vector_Length, lFrll_) +//GO(FT_Vector_Polarize, vFppp) +//GO(FT_Vector_Rotate, vFpl) +GO(FT_Vector_Transform, vFbll_rllll_) +GO(FT_Vector_Unit, vFBll_l) + +//GO(FTC_CMapCache_Lookup, uFppiu) +//GO(FTC_CMapCache_New, iFpp) +//GO(FTC_ImageCache_Lookup, iFppupp) +//GO(FTC_ImageCache_LookupScaler, iFppLupp) +//GO(FTC_ImageCache_New, iFpp) +//GO(FTC_Manager_Done, vFp) +//GO(FTC_Manager_LookupFace, iFppp) +//GO(FTC_Manager_LookupSize, iFppp) +//GOM(FTC_Manager_New, iFEpuuLppp) +//GO(FTC_Manager_RemoveFaceID, vFpp) +//GO(FTC_Manager_Reset, vFp) +//GO(FTC_Node_Unref, vFpp) +//GO(FTC_SBitCache_Lookup, iFppupp) +//GO(FTC_SBitCache_LookupScaler, iFppLupp) +//GO(FTC_SBitCache_New, iFpp) + +//GO(TT_New_Context, +//GO(TT_RunIns, diff --git a/src/wrapped32/wrappedgbm.c b/src/wrapped32/wrappedgbm.c new file mode 100644 index 0000000..9c0e0c4 --- /dev/null +++ b/src/wrapped32/wrappedgbm.c @@ -0,0 +1,82 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" + +static const char* gbmName = "libgbm.so.1"; +#define LIBNAME gbm + +typedef union my_gbm_bo_handle_s { + uint64_t data; +} my_gbm_bo_handle_t; + +typedef my_gbm_bo_handle_t (*zFpp_t)(void*, void*); + +#define ADDED_FUNCTIONS() \ +GO(gbm_bo_get_handle, zFpp_t) \ + +#include "generated/wrappedgbmtypes32.h" + +#include "wrappercallback32.h" + +// utility functions +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// destroy_user_data +#define GO(A) \ +static uintptr_t my_destroy_user_data_fct_##A = 0; \ +static void my_destroy_user_data_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my_destroy_user_data_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* find_destroy_user_data_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_destroy_user_data_fct_##A == (uintptr_t)fct) return my_destroy_user_data_##A; + SUPER() + #undef GO + #define GO(A) if(my_destroy_user_data_fct_##A == 0) {my_destroy_user_data_fct_##A = (uintptr_t)fct; return my_destroy_user_data_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libgbm destroy_user_data callback\n"); + return NULL; +} + +#undef SUPER + +EXPORT void my32_gbm_bo_set_user_data(x64emu_t* emu, void* bo, void* data, void *f) +{ + my->gbm_bo_set_user_data(bo, data, find_destroy_user_data_Fct(f)); +} + +EXPORT void* my32_gbm_bo_get_handle(x64emu_t* emu, my_gbm_bo_handle_t* ret, void* a, void* b) +{ + *ret = my->gbm_bo_get_handle(a, b); + return ret; +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedgbm_private.h b/src/wrapped32/wrappedgbm_private.h new file mode 100644 index 0000000..8f25336 --- /dev/null +++ b/src/wrapped32/wrappedgbm_private.h @@ -0,0 +1,44 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//%S z my_gbm_bo_handle_t U + +GO(gbm_bo_create, pFpuuuu) +GO(gbm_bo_create_with_modifiers, pFpuuupu) +GO(gbm_bo_create_with_modifiers2, pFpuuupuu) +GO(gbm_bo_destroy, vFp) +GO(gbm_bo_get_bpp, uFp) +GO(gbm_bo_get_device, pFp) +GO(gbm_bo_get_fd, iFp) +GO(gbm_bo_get_fd_for_plane, iFpi) +GO(gbm_bo_get_format, uFp) +GOS(gbm_bo_get_handle, zFEpp) //%% +//GOS(gbm_bo_get_handle_for_plane, pFppi) +GO(gbm_bo_get_height, uFp) +GO(gbm_bo_get_modifier, UFp) +GO(gbm_bo_get_offset, uFpi) +GO(gbm_bo_get_plane_count, iFp) +GO(gbm_bo_get_stride, uFp) +GO(gbm_bo_get_stride_for_plane, uFpi) +GO(gbm_bo_get_user_data, pFp) +GO(gbm_bo_get_width, uFp) +GO(gbm_bo_import, pFpupu) +GO(gbm_bo_map, pFpuuuuupbp_) +GOM(gbm_bo_set_user_data, vFEppp) +GO(gbm_bo_unmap, vFpp) +GO(gbm_bo_write, iFppL) +GO(gbm_create_device, pFi) +GO(gbm_device_destroy, vFp) +GO(gbm_device_get_backend_name, pFp) +GO(gbm_device_get_fd, iFp) +GO(gbm_device_get_format_modifier_plane_count, iFpuU) +GO(gbm_device_is_format_supported, iFpuu) +GO(gbm_format_get_name, pFup) +GO(gbm_surface_create, pFpuuuu) +GO(gbm_surface_create_with_modifiers, pFpuuupu) +GO(gbm_surface_create_with_modifiers2, pFpuuupuu) +GO(gbm_surface_destroy, vFp) +GO(gbm_surface_has_free_buffers, iFp) +GO(gbm_surface_lock_front_buffer, pFp) +GO(gbm_surface_release_buffer, vFpp) diff --git a/src/wrapped32/wrappedgnutls.c b/src/wrapped32/wrappedgnutls.c new file mode 100644 index 0000000..5271c05 --- /dev/null +++ b/src/wrapped32/wrappedgnutls.c @@ -0,0 +1,176 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "converter32.h" + +static const char* gnutlsName = "libgnutls.so.30"; +#define ALTNAME "libgnutls.so" + +#define LIBNAME gnutls + +#include "generated/wrappedgnutlstypes32.h" + +#include "wrappercallback32.h" + +// utility functions +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// gnutls_log +#define GO(A) \ +static uintptr_t my_gnutls_log_fct_##A = 0; \ +static void my_gnutls_log_##A(int level, const char* p) \ +{ \ + RunFunctionFmt(my_gnutls_log_fct_##A, "ip", level, p); \ +} +SUPER() +#undef GO +static void* find_gnutls_log_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_gnutls_log_fct_##A == (uintptr_t)fct) return my_gnutls_log_##A; + SUPER() + #undef GO + #define GO(A) if(my_gnutls_log_fct_##A == 0) {my_gnutls_log_fct_##A = (uintptr_t)fct; return my_gnutls_log_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libgnutls.so.30 gnutls_log callback\n"); + return NULL; +} + +// pullpush +#define GO(A) \ +static uintptr_t my_pullpush_fct_##A = 0; \ +static long my_pullpush_##A(void* p, void* d, size_t l) \ +{ \ + long_t ret = (long_t)RunFunctionFmt(my_pullpush_fct_##A, "ppL", p, d, l); \ + return from_long(ret);\ +} +SUPER() +#undef GO +static void* find_pullpush_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_pullpush_fct_##A == (uintptr_t)fct) return my_pullpush_##A; + SUPER() + #undef GO + #define GO(A) if(my_pullpush_fct_##A == 0) {my_pullpush_fct_##A = (uintptr_t)fct; return my_pullpush_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libgnutls.so.30 pullpush callback\n"); + return NULL; +} + +// timeout +#define GO(A) \ +static uintptr_t my_timeout_fct_##A = 0; \ +static int my_timeout_##A(void* p, uint32_t t) \ +{ \ + return (int)RunFunctionFmt(my_timeout_fct_##A, "pu", p, t); \ +} +SUPER() +#undef GO +static void* find_timeout_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_timeout_fct_##A == (uintptr_t)fct) return my_timeout_##A; + SUPER() + #undef GO + #define GO(A) if(my_timeout_fct_##A == 0) {my_timeout_fct_##A = (uintptr_t)fct; return my_timeout_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libgnutls.so.30 timeout callback\n"); + return NULL; +} + +#undef SUPER + +typedef struct datum_32_s { + ptr_t data; + uint32_t size; +} datum_32_t; + +EXPORT void* my32_gnutls_certificate_get_peers(x64emu_t* emu, void* session, int* size) +{ + int num = 0; + struct_pu_t* ret = my->gnutls_certificate_get_peers(session, &num); + if(size) *size = num; + if(!ret) return NULL; + static datum_32_t res[128]; + if (num > 128) { + printf_log(LOG_NONE, "Warning, return buffer for gnutls_certificate_get_peers too small: %d\n", num); + num = 128; + } + for(int i=0; ignutls_global_set_log_function(find_gnutls_log_Fct(f)); +} + +EXPORT void my32_gnutls_transport_set_pull_function(x64emu_t* emu, void* session, void* f) +{ + (void)emu; + my->gnutls_transport_set_pull_function(session, find_pullpush_Fct(f)); +} +EXPORT void my32_gnutls_transport_set_push_function(x64emu_t* emu, void* session, void* f) +{ + (void)emu; + my->gnutls_transport_set_push_function(session, find_pullpush_Fct(f)); +} + +EXPORT void my32_gnutls_transport_set_pull_timeout_function(x64emu_t* emu, void* session, void* f) +{ + (void)emu; + my->gnutls_transport_set_pull_timeout_function(session, find_timeout_Fct(f)); +} + +EXPORT int my32_gnutls_pkcs12_simple_parse(x64emu_t* emu, void* p12, void* pwd, ptr_t* key, ptr_t* chain, uint32_t* chain_len, ptr_t* extra_certs, uint32_t* extra_certs_len, ptr_t* crtl, uint32_t flags) +{ + void* key_l = key?from_ptrv(*key):NULL; + void* chain_l = chain?from_ptrv(*chain):NULL; + void* extra_certs_l = extra_certs?from_ptrv(*extra_certs):NULL; + void* crtl_l = crtl?from_ptrv(*crtl):NULL; + int ret = my->gnutls_pkcs12_simple_parse(p12, pwd, key?(&key_l):NULL, chain?(&chain_l):NULL, chain_len, extra_certs?(&extra_certs_l):NULL, extra_certs_len, crtl?(&crtl_l):NULL, flags); + if(ret>=0) { + if(key) *key = to_ptrv(key_l); + if(chain) *chain = to_ptrv(chain_l); + if(extra_certs) *extra_certs = to_ptrv(extra_certs_l); + if(crtl) *crtl = to_ptrv(crtl_l); + } + return ret; +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedgnutls_private.h b/src/wrapped32/wrappedgnutls_private.h new file mode 100644 index 0000000..d7437f3 --- /dev/null +++ b/src/wrapped32/wrappedgnutls_private.h @@ -0,0 +1,1135 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//gnutls_session_t is p +//gnutls_channel_binding_t is i + +//GO(_dsa_generate_dss_g, +//GO(dsa_generate_dss_keypair, +//GO(_dsa_generate_dss_pq, +//GO(_dsa_validate_dss_g, +//GO(_dsa_validate_dss_pq, +GO(gnutls_aead_cipher_decrypt, iFppLpLLpLpbL_) +GO(gnutls_aead_cipher_deinit, vFp) +GO(gnutls_aead_cipher_encrypt, iFppLpLLpLpbL_) +GO(gnutls_aead_cipher_init, iFbp_ubpu_) +GO(gnutls_alert_get, uFp) +GO(gnutls_alert_get_name, pFu) +GO(gnutls_alert_get_strname, pFu) +GO(gnutls_alert_send, iFpuu) +GO(gnutls_alert_send_appropriate, iFpi) +GO(gnutls_alpn_get_selected_protocol, iFpbpu_) +GO(gnutls_alpn_set_protocols, iFpbpu_uu) +GO(gnutls_anon_allocate_client_credentials, iFbp_) +GO(gnutls_anon_allocate_server_credentials, iFbp_) +GO(gnutls_anon_free_client_credentials, vFp) +GO(gnutls_anon_free_server_credentials, vFp) +//GOM(gnutls_anon_set_params_function, vFEpp) +GO(gnutls_anon_set_server_dh_params, vFpp) +GO(gnutls_anon_set_server_known_dh_params, iFpu) +//GOM(gnutls_anon_set_server_params_function, vFEpp) +GO(gnutls_auth_client_get_type, uFp) +GO(gnutls_auth_get_type, uFp) +GO(gnutls_auth_server_get_type, uFp) +//GO(_gnutls_bin2hex, +GO(gnutls_buffer_append_data, iFppL) +//GO(_gnutls_buffer_append_str, +//GO(_gnutls_buffer_init, +//GO(_gnutls_buffer_to_datum, +GO(gnutls_bye, iFpu) +GO(gnutls_certificate_activation_time_peers, IFp) +GO(gnutls_certificate_allocate_credentials, iFbp_) +GO(gnutls_certificate_client_get_request_status, uFp) +GO(gnutls_certificate_expiration_time_peers, IFp) +GO(gnutls_certificate_free_ca_names, vFp) +GO(gnutls_certificate_free_cas, vFp) +GO(gnutls_certificate_free_credentials, vFp) +GO(gnutls_certificate_free_crls, vFp) +GO(gnutls_certificate_free_keys, vFp) +GO(gnutls_certificate_get_crt_raw, iFpuubpu_) +GO(gnutls_certificate_get_issuer, iFppbp_u) +//GO(gnutls_certificate_get_openpgp_crt, iFpubbp__p) +GO(gnutls_certificate_get_openpgp_key, iFpubp_) +//GO(gnutls_certificate_get_ours, bpu_Fp) +GOM(gnutls_certificate_get_peers, pFEpp) +GO(gnutls_certificate_get_peers_subkey_id, iFpbpu_) +GO(gnutls_certificate_get_trust_list, vFpbp_) +GO(gnutls_certificate_get_verify_flags, uFp) +//GO(gnutls_certificate_get_x509_crt, iFpubbp__p) +GO(gnutls_certificate_get_x509_key, iFpubp_) +GO(gnutls_certificate_send_x509_rdn_sequence, vFpi) +GO(gnutls_certificate_server_set_request, vFpu) +GO(gnutls_certificate_set_dh_params, vFpp) +GO(gnutls_certificate_set_flags, vFpu) +GO(gnutls_certificate_set_key, iFppipip) // Warning: failed to confirm +GO(gnutls_certificate_set_known_dh_params, iFpu) +GO(gnutls_certificate_set_ocsp_status_request_file, iFppu) +//GOM(gnutls_certificate_set_ocsp_status_request_function, vFEppp) +//GOM(gnutls_certificate_set_ocsp_status_request_function2, iFEpupp) +GO(gnutls_certificate_set_openpgp_key, iFppp) +GO(gnutls_certificate_set_openpgp_key_file, iFpppu) +GO(gnutls_certificate_set_openpgp_key_file2, iFppppu) +GO(gnutls_certificate_set_openpgp_key_mem, iFpbpu_bpu_u) +GO(gnutls_certificate_set_openpgp_key_mem2, iFpbpu_bpu_pu) +GO(gnutls_certificate_set_openpgp_keyring_file, iFppu) +GO(gnutls_certificate_set_openpgp_keyring_mem, iFppLu) +//GOM(gnutls_certificate_set_params_function, vFEpp) +//GOM(gnutls_certificate_set_pin_function, vFEppp) +//GOM(gnutls_certificate_set_retrieve_function, vFEpp) +//GOM(gnutls_certificate_set_retrieve_function2, vFEpp) +GO(gnutls_certificate_set_trust_list, vFppu) +GO(gnutls_certificate_set_verify_flags, vFpu) +//GOM(gnutls_certificate_set_verify_function, vFEpp) +GO(gnutls_certificate_set_verify_limits, vFpuu) +GO(gnutls_certificate_set_x509_crl, iFpbp_i) +GO(gnutls_certificate_set_x509_crl_file, iFppu) +GO(gnutls_certificate_set_x509_crl_mem, iFpbpu_u) +GO(gnutls_certificate_set_x509_key, iFpbp_ip) +GO(gnutls_certificate_set_x509_key_file, iFpppu) +GO(gnutls_certificate_set_x509_key_file2, iFpppupu) +GO(gnutls_certificate_set_x509_key_mem, iFpbpu_bpu_u) +GO(gnutls_certificate_set_x509_key_mem2, iFpbpu_bpu_upu) +GO(gnutls_certificate_set_x509_simple_pkcs12_file, iFppup) +GO(gnutls_certificate_set_x509_simple_pkcs12_mem, iFpbpu_up) +GO(gnutls_certificate_set_x509_system_trust, iFp) +GO(gnutls_certificate_set_x509_trust, iFpbp_i) +GO(gnutls_certificate_set_x509_trust_dir, iFppu) +GO(gnutls_certificate_set_x509_trust_file, iFppu) +GO(gnutls_certificate_set_x509_trust_mem, iFpbpu_u) +GO(gnutls_certificate_type_get, uFp) +GO(gnutls_certificate_type_get_id, uFp) +GO(gnutls_certificate_type_get_name, pFu) +GO(gnutls_certificate_type_list, pFv) +GO(gnutls_certificate_verification_status_print, iFuubpu_u) +GO(gnutls_certificate_verify_peers, iFpbupu_up) +GO(gnutls_certificate_verify_peers2, iFpp) +GO(gnutls_certificate_verify_peers3, iFppp) +GO(gnutls_check_version, pFp) +//GO(_gnutls_cidr_to_string, +GO(gnutls_cipher_add_auth, iFppL) +GO(gnutls_cipher_decrypt, iFppL) +GO(gnutls_cipher_decrypt2, iFppLpL) +GO(gnutls_cipher_deinit, vFp) +GO(gnutls_cipher_encrypt, iFppL) +GO(gnutls_cipher_encrypt2, iFppLpL) +GO(gnutls_cipher_get, uFp) +GO(gnutls_cipher_get_block_size, uFu) +GO(gnutls_cipher_get_id, uFp) +GO(gnutls_cipher_get_iv_size, uFu) +GO(gnutls_cipher_get_key_size, LFu) +GO(gnutls_cipher_get_name, pFu) +GO(gnutls_cipher_get_tag_size, uFu) +GO(gnutls_cipher_init, iFbp_ubpu_bpu_) +GO(gnutls_cipher_list, pFv) +GO(gnutls_cipher_set_iv, vFppL) +GO(gnutls_cipher_suite_get_name, pFuuu) +GO(gnutls_cipher_suite_info, pFLppppp) +GO(gnutls_cipher_tag, iFppL) +GO(gnutls_compression_get, uFp) +GO(gnutls_compression_get_id, uFp) +GO(gnutls_compression_get_name, pFu) +GO(gnutls_compression_list, pFv) +GO(gnutls_credentials_clear, vFp) +GO(gnutls_credentials_get, iFpubp_) +GO(gnutls_credentials_set, iFpup) +//GOM(gnutls_crypto_register_aead_cipher, iFEuippppp) +//GOM(gnutls_crypto_register_cipher, iFEuipppppp) +//GOM(gnutls_crypto_register_digest, iFEuippppp) +//GOM(gnutls_crypto_register_mac, iFEuippppppp) +//GO(gnutls_db_check_entry, +GO(gnutls_db_check_entry_time, IFbpu_) +GO(gnutls_db_get_default_cache_expiration, uFv) +GO(gnutls_db_get_ptr, pFp) +GO(gnutls_db_remove_session, vFp) +GO(gnutls_db_set_cache_expiration, vFpi) +GO(gnutls_db_set_ptr, vFpp) +//GOM(gnutls_db_set_remove_function, vFEpp) +//GOM(gnutls_db_set_retrieve_function, vFEpp) +//GOM(gnutls_db_set_store_function, vFEpp) +GO(gnutls_decode_rs_value, iFbpu_bpu_bpu_) +GO(gnutls_decode_ber_digest_info, iFbpu_ppp) +//GO(_gnutls_decode_ber_rs_raw, +GO(gnutls_deinit, vFp) +GO(gnutls_dh_get_group, iFpbpu_bpu_) +GO(gnutls_dh_get_peers_public_bits, iFp) +GO(gnutls_dh_get_prime_bits, iFp) +GO(gnutls_dh_get_pubkey, iFpbpu_) +GO(gnutls_dh_get_secret_bits, iFp) +GO(gnutls_dh_params_cpy, iFpp) +GO(gnutls_dh_params_deinit, vFp) +GO(gnutls_dh_params_export2_pkcs3, iFpubpu_) +GO(gnutls_dh_params_export_pkcs3, iFpupbL_) +GO(gnutls_dh_params_export_raw, iFpbpu_bpu_p) +GO(gnutls_dh_params_generate2, iFpu) +GO(gnutls_dh_params_import_dsa, iFpp) +GO(gnutls_dh_params_import_pkcs3, iFpbpu_u) +GO(gnutls_dh_params_import_raw, iFpbpu_bpu_) +GO(gnutls_dh_params_import_raw2, iFpbpu_bpu_u) +GO(gnutls_dh_params_init, iFbp_) +GO(gnutls_dh_set_prime_bits, vFpu) +//GO(_gnutls_digest_exists, +GO(gnutls_digest_get_id, uFp) +GO(gnutls_digest_get_name, pFu) +GO(gnutls_digest_get_oid, pFu) +GO(gnutls_digest_list, pFv) +//GOM(gnutls_dtls_cookie_send, iFEbpu_pLppp) +GO(gnutls_dtls_cookie_verify, iFbpu_pLpLp) +GO(gnutls_dtls_get_data_mtu, uFp) +GO(gnutls_dtls_get_mtu, uFp) +GO(gnutls_dtls_get_timeout, uFp) +GO(gnutls_dtls_prestate_set, vFpp) +GO(gnutls_dtls_set_data_mtu, iFpu) +GO(gnutls_dtls_set_mtu, vFpu) +GO(gnutls_dtls_set_timeouts, vFpuu) +GO(gnutls_ecc_curve_get, uFp) +GO(gnutls_ecc_curve_get_id, uFp) +GO(gnutls_ecc_curve_get_name, pFu) +GO(gnutls_ecc_curve_get_oid, pFu) +GO(gnutls_ecc_curve_get_pk, uFu) +GO(gnutls_ecc_curve_get_size, iFu) +GO(gnutls_ecc_curve_list, pFv) +//GO(_gnutls_ecdh_compute_key, iFipppppp) +//GO(gnutls_ecdh_compute_key, iFipppppp) +GO(gnutls_encode_ber_digest_info, iFubpu_bpu_) +//GO(_gnutls_encode_ber_rs_raw, +GO(gnutls_error_is_fatal, iFi) +GO(gnutls_error_to_alert, iFip) +GO(gnutls_est_record_overhead_size, LFuuuuu) +GO(gnutls_privkey_export_dh_raw, iFppbpu_bpu_u) +GO(gnutls_ext_get_data, iFpubp_) +GO(gnutls_ext_get_name, pFu) +//GOM(gnutls_ext_register, iFEpiuppppp) +GO(gnutls_ext_set_data, vFpup) +GO(gnutls_fingerprint, iFubpu_pbL_) +GO(gnutls_fips140_mode_enabled, uFv) +GO(gnutls_fips140_set_mode, vFuu) +GO(gnutls_free, vFp)//DATAM(gnutls_free, 4) +GO(gnutls_global_deinit, vFv) +GO(gnutls_global_init, iFv) +//GOM(gnutls_global_set_audit_log_function, vFEp) +GOM(gnutls_global_set_log_function, vFEp) +GO(gnutls_global_set_log_level, vFi) +//GOM(gnutls_global_set_mem_functions, vFEppppp) +//GOM(gnutls_global_set_mutex, vFEpppp) +//GOM(gnutls_global_set_time_function, vFEp) +GO(gnutls_handshake, iFp) +GO(gnutls_handshake_description_get_name, pFu) +GO(gnutls_handshake_get_last_in, uFp) +GO(gnutls_handshake_get_last_out, uFp) +//GOM(gnutls_handshake_set_hook_function, vFEpuip) +GO(gnutls_handshake_set_max_packet_length, vFpL) +//GOM(gnutls_handshake_set_post_client_hello_function, vFEpp) +GO(gnutls_handshake_set_private_extensions, vFpi) +GO(gnutls_handshake_set_random, iFpbpu_) +GO(gnutls_handshake_set_timeout, vFpu) +GO(gnutls_hash, iFppL) +GO(gnutls_hash_deinit, vFpp) +GO(gnutls_hash_fast, iFupLp) +GO(gnutls_hash_get_len, uFu) +GO(gnutls_hash_init, iFbp_u) +GO(gnutls_hash_output, vFpp) +GO(gnutls_heartbeat_allowed, uFpu) +GO(gnutls_heartbeat_enable, vFpu) +GO(gnutls_heartbeat_get_timeout, uFp) +GO(gnutls_heartbeat_ping, iFpLuu) +GO(gnutls_heartbeat_pong, iFpu) +GO(gnutls_heartbeat_set_timeouts, vFpuu) +//GO(_gnutls_hello_set_default_version, +GO(gnutls_hex2bin, iFpLpbL_) +GO(gnutls_hex_decode, iFbpu_pbL_) +GO(gnutls_hex_decode2, iFbpu_bpu_) +GO(gnutls_hex_encode, iFbpu_pbL_) +GO(gnutls_hex_encode2, iFbpu_bpu_) +GO(gnutls_hmac, iFppL) +GO(gnutls_hmac_deinit, vFpp) +GO(gnutls_hmac_fast, iFupLpLp) +GO(gnutls_hmac_get_len, uFu) +GO(gnutls_hmac_init, iFbp_upL) +GO(gnutls_hmac_output, vFpp) +GO(gnutls_hmac_set_nonce, vFppL) +GO(gnutls_idna_map, iFpubpu_u) +GO(gnutls_idna_reverse_map, iFpubpu_u) +GO(gnutls_init, iFbp_u) +//GO(_gnutls_ip_to_string, +GO(gnutls_key_generate, iFbpu_u) +GO(gnutls_kx_get, uFp) +GO(gnutls_kx_get_id, uFp) +GO(gnutls_kx_get_name, pFu) +GO(gnutls_kx_list, pFv) +//GO(_gnutls_lib_simulate_error, +GO(gnutls_load_file, iFpbpu_) +//GO(_gnutls_log, +GO(gnutls_mac_get, uFp) +GO(gnutls_mac_get_id, uFp) +GO(gnutls_mac_get_key_size, LFu) +GO(gnutls_mac_get_name, pFu) +GO(gnutls_mac_get_nonce_size, LFu) +GO(gnutls_mac_list, pFv) +//GO(_gnutls_mac_to_entry, +GO(gnutls_memcmp, iFppL) +GO(gnutls_memset, vFpiL) +//GO(_gnutls_mpi_log, +GO(gnutls_ocsp_req_add_cert, iFpupp) +GO(gnutls_ocsp_req_add_cert_id, iFpubpu_bpu_bpu_) +GO(gnutls_ocsp_req_deinit, vFp) +GO(gnutls_ocsp_req_export, iFpbpu_) +GO(gnutls_ocsp_req_get_cert_id, iFpupbpu_bpu_bpu_) +GO(gnutls_ocsp_req_get_extension, iFpubpu_pbpu_) +GO(gnutls_ocsp_req_get_nonce, iFppbpu_) +GO(gnutls_ocsp_req_get_version, iFp) +GO(gnutls_ocsp_req_import, iFpbpu_) +GO(gnutls_ocsp_req_init, iFbp_) +GO(gnutls_ocsp_req_print, iFpubpu_) +GO(gnutls_ocsp_req_randomize_nonce, iFp) +GO(gnutls_ocsp_req_set_extension, iFppubpu_) +GO(gnutls_ocsp_req_set_nonce, iFpubpu_) +GO(gnutls_ocsp_resp_check_crt, iFpup) +GO(gnutls_ocsp_resp_deinit, vFp) +GO(gnutls_ocsp_resp_export, iFpbpu_) +//GO(gnutls_ocsp_resp_get_certs, iFpbbp__bL_) +GO(gnutls_ocsp_resp_get_extension, iFpubpu_pbpu_) +GO(gnutls_ocsp_resp_get_nonce, iFppbpu_) +GO(gnutls_ocsp_resp_get_produced, IFp) +GO(gnutls_ocsp_resp_get_responder, iFpbpu_) +GO(gnutls_ocsp_resp_get_responder2, iFpbpu_u) +GO(gnutls_ocsp_resp_get_responder_raw_id, iFpubpu_) +GO(gnutls_ocsp_resp_get_response, iFpbpu_bpu_) +GO(gnutls_ocsp_resp_get_signature, iFpbpu_) +GO(gnutls_ocsp_resp_get_signature_algorithm, iFp) +//GO(gnutls_ocsp_resp_get_single, iFpuppppppppp) +GO(gnutls_ocsp_resp_get_status, iFp) +GO(gnutls_ocsp_resp_get_version, iFp) +GO(gnutls_ocsp_resp_import, iFpbpu_) +GO(gnutls_ocsp_resp_init, iFbp_) +GO(gnutls_ocsp_resp_print, iFpubpu_) +GO(gnutls_ocsp_resp_verify, iFpppu) +GO(gnutls_ocsp_resp_verify_direct, iFpppu) +GO(gnutls_ocsp_status_request_enable_client, iFpbpu_Lbpu_) +GO(gnutls_ocsp_status_request_get, iFpbpu_) +GO(gnutls_ocsp_status_request_is_checked, uFpu) +GO(gnutls_oid_to_digest, uFp) +GO(gnutls_oid_to_ecc_curve, uFp) +GO(gnutls_oid_to_mac, uFp) +GO(gnutls_oid_to_pk, uFp) +GO(gnutls_oid_to_sign, uFp) +GO(gnutls_openpgp_crt_check_email, iFppu) +GO(gnutls_openpgp_crt_check_hostname, iFpp) +GO(gnutls_openpgp_crt_check_hostname2, iFppu) +GO(gnutls_openpgp_crt_deinit, vFp) +GO(gnutls_openpgp_crt_export, iFpupbL_) +GO(gnutls_openpgp_crt_export2, iFpubpu_) +GO(gnutls_openpgp_crt_get_auth_subkey, iFppu) +GO(gnutls_openpgp_crt_get_creation_time, IFp) +GO(gnutls_openpgp_crt_get_expiration_time, IFp) +GO(gnutls_openpgp_crt_get_fingerprint, iFppbL_) +GO(gnutls_openpgp_crt_get_key_id, iFpp) +GO(gnutls_openpgp_crt_get_key_usage, iFpp) +GO(gnutls_openpgp_crt_get_name, iFpipbL_) +GO(gnutls_openpgp_crt_get_pk_algorithm, uFpp) +GO(gnutls_openpgp_crt_get_pk_dsa_raw, iFpbpu_bpu_bpu_bpu_) +GO(gnutls_openpgp_crt_get_pk_rsa_raw, iFpbpu_bpu_) +GO(gnutls_openpgp_crt_get_preferred_key_id, iFpp) +GO(gnutls_openpgp_crt_get_revoked_status, iFp) +GO(gnutls_openpgp_crt_get_subkey_count, iFp) +GO(gnutls_openpgp_crt_get_subkey_creation_time, IFpu) +GO(gnutls_openpgp_crt_get_subkey_expiration_time, IFpu) +GO(gnutls_openpgp_crt_get_subkey_fingerprint, iFpupbL_) +GO(gnutls_openpgp_crt_get_subkey_id, iFpup) +GO(gnutls_openpgp_crt_get_subkey_idx, iFpp) +GO(gnutls_openpgp_crt_get_subkey_pk_algorithm, uFpup) +GO(gnutls_openpgp_crt_get_subkey_pk_dsa_raw, iFpubpu_bpu_bpu_bpu_) +GO(gnutls_openpgp_crt_get_subkey_pk_rsa_raw, iFpubpu_bpu_) +GO(gnutls_openpgp_crt_get_subkey_revoked_status, iFpu) +GO(gnutls_openpgp_crt_get_subkey_usage, iFpup) +GO(gnutls_openpgp_crt_get_version, iFp) +GO(gnutls_openpgp_crt_import, iFpbpu_u) +GO(gnutls_openpgp_crt_init, iFbp_) +GO(gnutls_openpgp_crt_print, iFpubpu_) +GO(gnutls_openpgp_crt_set_preferred_key_id, iFpp) +GO(gnutls_openpgp_crt_verify_ring, iFppup) +GO(gnutls_openpgp_crt_verify_self, iFpup) +GO(gnutls_openpgp_keyring_check_id, iFppu) +GO(gnutls_openpgp_keyring_deinit, vFp) +GO(gnutls_openpgp_keyring_get_crt, iFpubp_) +GO(gnutls_openpgp_keyring_get_crt_count, iFp) +GO(gnutls_openpgp_keyring_import, iFpbpu_u) +GO(gnutls_openpgp_keyring_init, iFbp_) +GO(gnutls_openpgp_privkey_deinit, vFp) +GO(gnutls_openpgp_privkey_export, iFpupupbL_) +GO(gnutls_openpgp_privkey_export2, iFpupubpu_) +GO(gnutls_openpgp_privkey_export_dsa_raw, iFpbpu_bpu_bpu_bpu_bpu_) +GO(gnutls_openpgp_privkey_export_rsa_raw, iFpbpu_bpu_bpu_bpu_bpu_bpu_) +GO(gnutls_openpgp_privkey_export_subkey_dsa_raw, iFpubpu_bpu_bpu_bpu_bpu_) +GO(gnutls_openpgp_privkey_export_subkey_rsa_raw, iFpubpu_bpu_bpu_bpu_bpu_bpu_) +GO(gnutls_openpgp_privkey_get_fingerprint, iFppbL_) +GO(gnutls_openpgp_privkey_get_key_id, iFpp) +GO(gnutls_openpgp_privkey_get_pk_algorithm, uFpp) +GO(gnutls_openpgp_privkey_get_preferred_key_id, iFpp) +GO(gnutls_openpgp_privkey_get_revoked_status, iFp) +GO(gnutls_openpgp_privkey_get_subkey_count, iFp) +GO(gnutls_openpgp_privkey_get_subkey_creation_time, IFpu) +GO(gnutls_openpgp_privkey_get_subkey_expiration_time, IFpu) +GO(gnutls_openpgp_privkey_get_subkey_fingerprint, iFpupbL_) +GO(gnutls_openpgp_privkey_get_subkey_id, iFpup) +GO(gnutls_openpgp_privkey_get_subkey_idx, iFpp) +GO(gnutls_openpgp_privkey_get_subkey_pk_algorithm, uFpup) +GO(gnutls_openpgp_privkey_get_subkey_revoked_status, iFpu) +GO(gnutls_openpgp_privkey_import, iFpbpu_upu) +GO(gnutls_openpgp_privkey_init, iFbp_) +GO(gnutls_openpgp_privkey_sec_param, uFp) +GO(gnutls_openpgp_privkey_set_preferred_key_id, iFpp) +GO(gnutls_openpgp_privkey_sign_hash, iFpbpu_bpu_) +GO(gnutls_openpgp_send_cert, vFpu) +//GOM(gnutls_openpgp_set_recv_key_function, vFEpp) +GO(gnutls_packet_deinit, vFp) +GO(gnutls_packet_get, vFpbpu_p) +GO(gnutls_pcert_deinit, vFp) // Warning: failed to confirm +GO(gnutls_pcert_export_openpgp, iFpp) // Warning: failed to confirm +GO(gnutls_pcert_export_x509, iFpp) // Warning: failed to confirm +GO(gnutls_pcert_import_openpgp, iFppu) // Warning: failed to confirm +GO(gnutls_pcert_import_openpgp_raw, iFppupu) // Warning: failed to confirm +GO(gnutls_pcert_import_x509, iFppu) // Warning: failed to confirm +GO(gnutls_pcert_import_x509_list, iFpppu) // Warning: failed to confirm +GO(gnutls_pcert_import_x509_raw, iFppuu) // Warning: failed to confirm +GO(gnutls_pcert_list_import_x509_raw, iFpppuu) // Warning: failed to confirm +GO(gnutls_pem_base64_decode, iFpbpu_pbL_) +GO(gnutls_pem_base64_decode2, iFpbpu_bpu_) +GO(gnutls_pem_base64_encode, iFpbpu_pbL_) +GO(gnutls_pem_base64_encode2, iFpbpu_bpu_) +GO(gnutls_perror, vFi) +GO(gnutls_pk_algorithm_get_name, pFu) +GO(gnutls_pk_bits_to_sec_param, uFuu) +GO(gnutls_pkcs11_add_provider, iFpp) +GO(gnutls_pkcs11_copy_attached_extension, iFppbpu_pu) +GO(gnutls_pkcs11_copy_pubkey, iFpppbpu_uu) +GO(gnutls_pkcs11_copy_secret_key, iFpbpu_puu) +GO(gnutls_pkcs11_copy_x509_crt2, iFpppbpu_u) +GO(gnutls_pkcs11_copy_x509_privkey2, iFpppbpu_uu) +GO(gnutls_pkcs11_crt_is_known, uFppu) +GO(gnutls_pkcs11_deinit, vFv) +GO(gnutls_pkcs11_delete_url, iFpu) +//GOM(gnutls_pkcs11_get_pin_function, pFEbp_) +GO(gnutls_pkcs11_get_raw_issuer, iFppbpu_uu) +GO(gnutls_pkcs11_get_raw_issuer_by_dn, iFpbpu_bpu_uu) +GO(gnutls_pkcs11_get_raw_issuer_by_subject_key_id, iFpbpu_bpu_bpu_uu) +GO(gnutls_pkcs11_init, iFup) +GO(gnutls_pkcs11_obj_deinit, vFp) +GO(gnutls_pkcs11_obj_export, iFppbL_) +GO(gnutls_pkcs11_obj_export2, iFpbpu_) +GO(gnutls_pkcs11_obj_export3, iFpubpu_) +GO(gnutls_pkcs11_obj_export_url, iFpubp_) +GO(gnutls_pkcs11_obj_flags_get_str, pFu) +GO(gnutls_pkcs11_obj_get_exts, iFpppu) // Warning: failed to confirm +GO(gnutls_pkcs11_obj_get_flags, iFpp) +GO(gnutls_pkcs11_obj_get_info, iFpupbL_) +GO(gnutls_pkcs11_obj_get_type, uFp) +GO(gnutls_pkcs11_obj_import_url, iFppu) +GO(gnutls_pkcs11_obj_init, iFbp_) +GO(gnutls_pkcs11_obj_list_import_url3, iFbp_ppu) +//GO(gnutls_pkcs11_obj_list_import_url4, iFbbp__ppu) +GO(gnutls_pkcs11_obj_set_info, iFpupLu) +//GOM(gnutls_pkcs11_obj_set_pin_function, vFEppp) +GO(gnutls_pkcs11_privkey_cpy, iFpp) +GO(gnutls_pkcs11_privkey_deinit, vFp) +GO(gnutls_pkcs11_privkey_export_pubkey, iFpubpu_u) +GO(gnutls_pkcs11_privkey_export_url, iFpubp_) +GO(gnutls_pkcs11_privkey_generate3, iFpuupbpu_ubpu_uu) +GO(gnutls_pkcs11_privkey_get_info, iFpupbL_) +GO(gnutls_pkcs11_privkey_get_pk_algorithm, iFpp) +GO(gnutls_pkcs11_privkey_import_url, iFppu) +GO(gnutls_pkcs11_privkey_init, iFbp_) +//GOM(gnutls_pkcs11_privkey_set_pin_function, vFEppp) +GO(gnutls_pkcs11_privkey_status, uFp) +GO(gnutls_pkcs11_reinit, iFv) +//GOM(gnutls_pkcs11_set_pin_function, vFEpp) +//GOM(gnutls_pkcs11_set_token_function, vFEpp) +GO(gnutls_pkcs11_token_get_flags, iFpp) +GO(gnutls_pkcs11_token_get_info, iFpupbL_) +GO(gnutls_pkcs11_token_get_mechanism, iFpubL_) +GO(gnutls_pkcs11_token_get_random, iFppL) +GO(gnutls_pkcs11_token_get_url, iFuubp_) +GO(gnutls_pkcs11_token_init, iFppp) +GO(gnutls_pkcs11_token_set_pin, iFpppu) +GO(gnutls_pkcs11_type_get_name, pFu) +GO(gnutls_pkcs12_bag_decrypt, iFpp) +GO(gnutls_pkcs12_bag_deinit, vFp) +GO(gnutls_pkcs12_bag_enc_info, iFppppppbp_) +GO(gnutls_pkcs12_bag_encrypt, iFppu) +GO(gnutls_pkcs12_bag_get_count, iFp) +GO(gnutls_pkcs12_bag_get_data, iFpubpu_) +GO(gnutls_pkcs12_bag_get_friendly_name, iFpubp_) +GO(gnutls_pkcs12_bag_get_key_id, iFpubpu_) +GO(gnutls_pkcs12_bag_get_type, iFpu) +GO(gnutls_pkcs12_bag_init, iFbp_) +GO(gnutls_pkcs12_bag_set_crl, iFpp) +GO(gnutls_pkcs12_bag_set_crt, iFpp) +GO(gnutls_pkcs12_bag_set_data, iFpubpu_) +GO(gnutls_pkcs12_bag_set_friendly_name, iFpup) +GO(gnutls_pkcs12_bag_set_key_id, iFpubpu_) +GO(gnutls_pkcs12_bag_set_privkey, iFpppu) +GO(gnutls_pkcs12_deinit, vFp) +GO(gnutls_pkcs12_export, iFpupbL_) +GO(gnutls_pkcs12_export2, iFpubpu_) +GO(gnutls_pkcs12_generate_mac, iFpp) +GO(gnutls_pkcs12_generate_mac2, iFpup) +GO(gnutls_pkcs12_get_bag, iFpip) +GO(gnutls_pkcs12_import, iFpbpu_uu) +GO(gnutls_pkcs12_init, iFbp_) +GO(gnutls_pkcs12_mac_info, iFpppppbp_) +GO(gnutls_pkcs12_set_bag, iFpp) +GOM(gnutls_pkcs12_simple_parse, iFEppppppppu) +//GO(_gnutls_pkcs12_string_to_key, +GO(gnutls_pkcs12_verify_mac, iFpp) +GO(gnutls_pkcs7_add_attr, iFbp_pbpu_u) +GO(gnutls_pkcs7_attrs_deinit, vFp) +GO(gnutls_pkcs7_deinit, vFp) +GO(gnutls_pkcs7_delete_crl, iFpi) +GO(gnutls_pkcs7_delete_crt, iFpi) +GO(gnutls_pkcs7_export, iFpupbL_) +GO(gnutls_pkcs7_export2, iFpubpu_) +GO(gnutls_pkcs7_get_attr, iFpubp_bpu_u) +GO(gnutls_pkcs7_get_crl_count, iFp) +GO(gnutls_pkcs7_get_crl_raw, iFpupbL_) +GO(gnutls_pkcs7_get_crl_raw2, iFpubpu_) +GO(gnutls_pkcs7_get_crt_count, iFp) +GO(gnutls_pkcs7_get_crt_raw, iFpupbL_) +GO(gnutls_pkcs7_get_crt_raw2, iFpubpu_) +GO(gnutls_pkcs7_get_embedded_data, iFpubpu_) +GO(gnutls_pkcs7_get_embedded_data_oid, pFp) +GO(gnutls_pkcs7_get_signature_count, iFp) +//GO(gnutls_pkcs7_get_signature_info, iFpup) +GO(gnutls_pkcs7_import, iFpbpu_u) +GO(gnutls_pkcs7_init, iFbp_) +GO(gnutls_pkcs7_print, iFpubpu_) +GO(gnutls_pkcs7_set_crl, iFpp) +GO(gnutls_pkcs7_set_crl_raw, iFpbpu_) +GO(gnutls_pkcs7_set_crt, iFpp) +GO(gnutls_pkcs7_set_crt_raw, iFpbpu_) +GO(gnutls_pkcs7_sign, iFpppbpu_ppuu) +//GO(gnutls_pkcs7_signature_info_deinit, vFp) +GO(gnutls_pkcs7_verify, iFppbupu_uubpu_u) +GO(gnutls_pkcs7_verify_direct, iFppubpu_u) +GO(gnutls_pkcs8_info, iFbpu_upppppbp_) +GO(gnutls_pkcs_schema_get_name, pFu) +GO(gnutls_pkcs_schema_get_oid, pFu) +GO(gnutls_pk_get_id, uFp) +GO(gnutls_pk_get_name, pFu) +GO(gnutls_pk_get_oid, pFu) +GO(gnutls_pk_list, pFv) +GO(gnutls_pk_to_sign, uFuu) +GO(gnutls_prf, iFpLpiLpLp) +GO(gnutls_prf_raw, iFpLpLpLp) +GO(gnutls_prf_rfc5705, iFpLpLpLp) +GO(gnutls_priority_certificate_type_list, iFpbp_) +GO(gnutls_priority_cipher_list, iFpbp_) +GO(gnutls_priority_compression_list, iFpbp_) +GO(gnutls_priority_deinit, vFp) +GO(gnutls_priority_ecc_curve_list, iFpbp_) +GO(gnutls_priority_get_cipher_suite_index, iFpup) +GO(gnutls_priority_init, iFbp_pbp_) +GO(gnutls_priority_kx_list, iFpbp_) +GO(gnutls_priority_mac_list, iFpbp_) +GO(gnutls_priority_protocol_list, iFpbp_) +GO(gnutls_priority_set, iFpp) +GO(gnutls_priority_set_direct, iFppbp_) +GO(gnutls_priority_sign_list, iFpbp_) +GO(gnutls_priority_string_list, pFuu) +GO(gnutls_privkey_decrypt_data, iFpubpu_bpu_) +GO(gnutls_privkey_deinit, vFp) +GO(gnutls_privkey_derive_secret, iFppbpu_bpu_u) +GO(gnutls_privkey_export_dsa_raw, iFpbpu_bpu_bpu_bpu_bpu_) +GO(gnutls_privkey_export_ecc_raw, iFppbpu_bpu_bpu_) +GO(gnutls_privkey_export_openpgp, iFpbp_) +GO(gnutls_privkey_export_pkcs11, iFpbp_) +GO(gnutls_privkey_export_rsa_raw, iFpbpu_bpu_bpu_bpu_bpu_bpu_bpu_bpu_) +GO(gnutls_privkey_export_x509, iFpbp_) +GO(gnutls_privkey_generate, iFpuuu) +GO(gnutls_privkey_generate2, iFpuuubupu_u) +GO(gnutls_privkey_get_pk_algorithm, iFpp) +GO(gnutls_privkey_get_seed, iFpppbL_) +GO(gnutls_privkey_get_type, uFp) +GO(gnutls_privkey_import_dh_raw, iFppbpu_bpu_) +GO(gnutls_privkey_import_dsa_raw, iFpbpu_bpu_bpu_bpu_bpu_) +GO(gnutls_privkey_import_ecc_raw, iFpubpu_bpu_bpu_) +//GOM(gnutls_privkey_import_ext, iFEpupppu) +//GOM(gnutls_privkey_import_ext2, iFEpuppppu) +//GOM(gnutls_privkey_import_ext3, iFEppppppu) +GO(gnutls_privkey_import_openpgp, iFppu) +GO(gnutls_privkey_import_openpgp_raw, iFpbpu_upp) +GO(gnutls_privkey_import_pkcs11, iFppu) +GO(gnutls_privkey_import_rsa_raw, iFpbpu_bpu_bpu_bpu_bpu_bpu_bpu_bpu_) +GO(gnutls_privkey_import_tpm_raw, iFpbpu_uppu) +GO(gnutls_privkey_import_tpm_url, iFppppu) +GO(gnutls_privkey_import_url, iFppu) +GO(gnutls_privkey_import_x509, iFppu) +GO(gnutls_privkey_import_x509_raw, iFpbpu_upu) +GO(gnutls_privkey_init, iFbp_) +GO(gnutls_privkey_set_flags, vFpu) +//GOM(gnutls_privkey_set_pin_function, vFEppp) +GO(gnutls_privkey_set_spki, iFppu) +GO(gnutls_privkey_sign_data, iFpuubpu_bpu_) +GO(gnutls_privkey_sign_hash, iFpuubpu_bpu_) +GO(gnutls_privkey_status, iFp) +GO(gnutls_privkey_verify_params, iFp) +GO(gnutls_privkey_verify_seed, iFpupL) +GO(gnutls_protocol_get_id, uFp) +GO(gnutls_protocol_get_name, pFu) +GO(gnutls_protocol_get_version, uFp) +GO(gnutls_protocol_list, pFv) +GO(gnutls_psk_allocate_client_credentials, iFbp_) +GO(gnutls_psk_allocate_server_credentials, iFbp_) +GO(gnutls_psk_client_get_hint, pFp) +GO(gnutls_psk_free_client_credentials, vFp) +GO(gnutls_psk_free_server_credentials, vFp) +GO(gnutls_psk_server_get_username, pFp) +GO(gnutls_psk_set_client_credentials, iFppbpu_u) +//GOM(gnutls_psk_set_client_credentials_function, vFEpp) +//GOM(gnutls_psk_set_params_function, vFEpp) +GO(gnutls_psk_set_server_credentials_file, iFpp) +//GOM(gnutls_psk_set_server_credentials_function, vFEpp) +GO(gnutls_psk_set_server_credentials_hint, iFpp) +GO(gnutls_psk_set_server_dh_params, vFpp) +GO(gnutls_psk_set_server_known_dh_params, iFpu) +//GOM(gnutls_psk_set_server_params_function, vFEpp) +GO(gnutls_pubkey_deinit, vFp) +GO(gnutls_pubkey_encrypt_data, iFpubpu_bpu_) +GO(gnutls_pubkey_export, iFpupbL_) +GO(gnutls_pubkey_export2, iFpubpu_) +GO(gnutls_pubkey_export_dsa_raw, iFpbpu_bpu_bpu_bpu_) +GO(gnutls_pubkey_export_dh_raw, iFppbpu_u) +GO(gnutls_pubkey_export_ecc_raw, iFppbpu_bpu_) +GO(gnutls_pubkey_export_ecc_x962, iFpbpu_bpu_) +GO(gnutls_pubkey_export_rsa_raw, iFpbpu_bpu_) +GO(gnutls_pubkey_get_key_id, iFpupbL_) +GO(gnutls_pubkey_get_key_usage, iFpp) +GO(gnutls_pubkey_get_openpgp_key_id, iFpupbL_p) +GO(gnutls_pubkey_get_pk_algorithm, iFpp) +GO(gnutls_pubkey_get_preferred_hash_algorithm, iFppp) +GO(gnutls_pubkey_import, iFpbpu_u) +GO(gnutls_pubkey_import_dh_raw, iFppbpu_) +GO(gnutls_pubkey_import_dsa_raw, iFpbpu_bpu_bpu_bpu_) +GO(gnutls_pubkey_import_ecc_raw, iFpubpu_bpu_) +GO(gnutls_pubkey_import_ecc_x962, iFpbpu_bpu_) +GO(gnutls_pubkey_import_openpgp, iFppu) +GO(gnutls_pubkey_import_openpgp_raw, iFpbpu_upu) +GO(gnutls_pubkey_import_pkcs11, iFppu) +GO(gnutls_pubkey_import_privkey, iFppuu) +GO(gnutls_pubkey_import_rsa_raw, iFpbpu_bpu_) +GO(gnutls_pubkey_import_tpm_raw, iFpbpu_upu) +GO(gnutls_pubkey_import_tpm_url, iFpppu) +GO(gnutls_pubkey_import_url, iFppu) +GO(gnutls_pubkey_import_x509, iFppu) +GO(gnutls_pubkey_import_x509_crq, iFppu) +GO(gnutls_pubkey_import_x509_raw, iFpbpu_uu) +GO(gnutls_pubkey_init, iFbp_) +GO(gnutls_pubkey_print, iFpubpu_) +GO(gnutls_pubkey_set_key_usage, iFpu) +//GOM(gnutls_pubkey_set_pin_function, vFEppp) +GO(gnutls_pubkey_set_spki, iFppu) +GO(gnutls_pubkey_verify_data2, iFpuubpu_bpu_) +GO(gnutls_pubkey_verify_hash2, iFpuubpu_bpu_) +GO(gnutls_pubkey_verify_params, iFp) +GO(gnutls_random_art, iFupupLbpu_) +GO(gnutls_range_split, iFpbLL_bLL_bLL_) +GO(gnutls_record_can_use_length_hiding, uFp) +GO(gnutls_record_check_corked, LFp) +GO(gnutls_record_check_pending, LFp) +GO(gnutls_record_cork, vFp) +GO(gnutls_record_disable_padding, vFp) +GO(gnutls_record_discard_queued, LFp) +GO(gnutls_record_get_direction, iFp) +GO(gnutls_record_get_discarded, uFp) +GO(gnutls_record_get_max_size, LFp) +GO(gnutls_record_get_state, iFpubpu_bpu_bpu_p) +GO(gnutls_record_overhead_size, LFp) +GO(gnutls_record_recv, lFppL) +GO(gnutls_record_recv_packet, lFpbp_) +GO(gnutls_record_recv_seq, lFppLp) +GO(gnutls_record_send, lFppL) +GO(gnutls_record_send_range, lFppLbLL_) +//GO(_gnutls_record_set_default_version, +GO(gnutls_record_set_max_size, lFpL) +GO(gnutls_record_set_state, iFpup) +GO(gnutls_record_set_timeout, vFpu) +GO(gnutls_record_uncork, iFpu) +//GO(gnutls_register_custom_url, +GO(gnutls_rehandshake, iFp) +//GO(_gnutls_resolve_priorities, +GO(gnutls_rnd, iFupL) +GO(gnutls_rnd_refresh, vFv) +//GO(_gnutls_rsa_pms_set_version, +GO(gnutls_safe_renegotiation_status, uFp) +GO(gnutls_sec_param_get_name, pFu) +GO(gnutls_sec_param_to_pk_bits, uFuu) +GO(gnutls_sec_param_to_symmetric_bits, uFu) +GO(gnutls_server_name_get, iFppbL_pu) +GO(gnutls_server_name_set, iFpupL) +//GO(_gnutls_server_name_set_raw, +GO(gnutls_session_channel_binding, iFpubpu_) +GO(gnutls_session_enable_compatibility_mode, vFp) +GO(gnutls_session_etm_status, uFp) +GO(gnutls_session_ext_master_secret_status, uFp) +//GOM(gnutls_session_ext_register, iFEppiupppppu) +GO(gnutls_session_force_valid, vFp) +GO(gnutls_session_get_data, iFppbL_) +GO(gnutls_session_get_data2, iFpbpu_) +GO(gnutls_session_get_desc, pFp) +GO(gnutls_session_get_flags, uFp) +GO(gnutls_session_get_id, iFppbL_) +GO(gnutls_session_get_id2, iFpbpu_) +GO(gnutls_session_get_master_secret, vFpbpu_) +GO(gnutls_session_get_ptr, pFp) +GO(gnutls_session_get_random, vFpbpu_bpu_) +GO(gnutls_session_get_verify_cert_status, uFp) +GO(gnutls_session_is_resumed, iFp) +GO(gnutls_session_resumption_requested, iFp) +GO(gnutls_session_set_data, iFppL) +GO(gnutls_session_set_id, iFpbpu_) +GO(gnutls_session_set_premaster, iFpuuuuuubpu_bpu_) +GO(gnutls_session_set_ptr, vFpp) +GO(gnutls_session_set_verify_cert, vFppu) +GO(gnutls_session_set_verify_cert2, vFpbupu_uu) +//GOM(gnutls_session_set_verify_function, vFEpp) +//GOM(gnutls_session_supplemental_register, iFEppuppu) +GO(gnutls_session_ticket_enable_client, iFp) +GO(gnutls_session_ticket_enable_server, iFpbpu_) +GO(gnutls_session_ticket_key_generate, iFbpu_) +GO(gnutls_set_default_priority, iFp) +GO(gnutls_sign_algorithm_get, iFp) +GO(gnutls_sign_algorithm_get_client, iFp) +GO(gnutls_sign_algorithm_get_requested, iFpLp) +GO(gnutls_sign_get_hash_algorithm, uFu) +GO(gnutls_sign_get_id, uFp) +GO(gnutls_sign_get_name, pFu) +GO(gnutls_sign_get_oid, pFu) +GO(gnutls_sign_get_pk_algorithm, uFu) +GO(gnutls_sign_is_secure, uFu) +GO(gnutls_sign_list, pFv) +GO(gnutls_srp_allocate_client_credentials, iFbp_) +GO(gnutls_srp_allocate_server_credentials, iFbp_) +GO(gnutls_srp_base64_decode, iFbpu_pbL_) +GO(gnutls_srp_base64_decode2, iFbpu_bpu_) +GO(gnutls_srp_base64_encode, iFbpu_pbL_) +GO(gnutls_srp_base64_encode2, iFbpu_bpu_) +GO(gnutls_srp_free_client_credentials, vFp) +GO(gnutls_srp_free_server_credentials, vFp) +GO(gnutls_srp_server_get_username, pFp) +GO(gnutls_srp_set_client_credentials, iFppp) +//GOM(gnutls_srp_set_client_credentials_function, vFEpp) +GO(gnutls_srp_set_prime_bits, vFpu) +GO(gnutls_srp_set_server_credentials_file, iFppp) +//GOM(gnutls_srp_set_server_credentials_function, vFEpp) +GO(gnutls_srp_set_server_fake_salt_seed, vFpbpu_u) +GO(gnutls_srp_verifier, iFppbpu_bpu_bpu_bpu_) +GO(gnutls_srtp_get_keys, iFppubpu_bpu_bpu_bpu_) +GO(gnutls_srtp_get_mki, iFpbpu_) +GO(gnutls_srtp_get_profile_id, iFpp) +GO(gnutls_srtp_get_profile_name, pFu) +GO(gnutls_srtp_get_selected_profile, iFpp) +GO(gnutls_srtp_set_mki, iFpbpu_) +GO(gnutls_srtp_set_profile, iFpu) +GO(gnutls_srtp_set_profile_direct, iFppbp_) +GO(gnutls_store_commitment, iFppppubpu_Iu) +GO(gnutls_store_pubkey, iFppppubpu_Iu) +GO(gnutls_strerror, pFi) +GO(gnutls_strerror_name, pFi) +//GO(gnutls_subject_alt_names_deinit, +//GO(gnutls_subject_alt_names_get, +//GO(gnutls_subject_alt_names_init, +//GO(gnutls_subject_alt_names_set, +GO(gnutls_supplemental_get_name, pFu) +GO(gnutls_supplemental_recv, vFpu) +//GOM(gnutls_supplemental_register, iFEpupp) +GO(gnutls_supplemental_send, vFpu) +//GO(gnutls_system_key_add_x509, +//GO(gnutls_system_key_delete, +//GO(gnutls_system_key_iter_deinit, +//GO(gnutls_system_key_iter_get_info, +GO(gnutls_system_recv_timeout, iFpu) +GO(gnutls_tdb_deinit, vFp) +GO(gnutls_tdb_init, iFbp_) +//GOM(gnutls_tdb_set_store_commitment_func, vFEpp) +//GOM(gnutls_tdb_set_store_func, vFEpp) +//GOM(gnutls_tdb_set_verify_func, vFEpp) +GO(gnutls_tpm_get_registered, iFbp_) +GO(gnutls_tpm_key_list_deinit, vFp) +GO(gnutls_tpm_key_list_get_url, iFpubp_u) +GO(gnutls_tpm_privkey_delete, iFpp) +GO(gnutls_tpm_privkey_generate, iFuuppuubpu_bpu_u) +GO(gnutls_transport_get_int, iFp) +GO(gnutls_transport_get_int2, vFppp) +GO(gnutls_transport_get_ptr, pFp) +GO(gnutls_transport_get_ptr2, vFpbp_bp_) +GO(gnutls_transport_set_errno, vFpi) +//GOM(gnutls_transport_set_errno_function, vFEpp) +//GO(gnutls_transport_set_fastopen, +GO(gnutls_transport_set_int2, vFpii) +GO(gnutls_transport_set_ptr, vFpp) +GO(gnutls_transport_set_ptr2, vFppp) +GOM(gnutls_transport_set_pull_function, vFEpp) +GOM(gnutls_transport_set_pull_timeout_function, vFEpp) +GOM(gnutls_transport_set_push_function, vFEpp) +//GOM(gnutls_transport_set_vec_push_function, vFEpp) +//GO(_gnutls_ucs2_to_utf8, +GO(gnutls_url_is_supported, uFp) +GO(gnutls_utf8_password_normalize, iFpubpu_u) +//GO(_gnutls_utf8_to_ucs2, +GO(gnutls_verify_stored_pubkey, iFppppubpu_u) +//GO(gnutls_x509_aia_deinit, +//GO(gnutls_x509_aia_get, +//GO(gnutls_x509_aia_init, +//GO(gnutls_x509_aia_set, +//GO(gnutls_x509_aki_deinit, +//GO(gnutls_x509_aki_get_cert_issuer, +//GO(gnutls_x509_aki_get_id, +//GO(gnutls_x509_aki_init, +//GO(gnutls_x509_aki_set_cert_issuer, +//GO(gnutls_x509_aki_set_id, +GO(gnutls_x509_cidr_to_rfc5280, iFpbpu_) +GO(gnutls_x509_crl_check_issuer, uFpp) +GO(gnutls_x509_crl_deinit, vFp) +//GO(gnutls_x509_crl_dist_points_deinit, +//GO(gnutls_x509_crl_dist_points_get, +//GO(gnutls_x509_crl_dist_points_init, +//GO(gnutls_x509_crl_dist_points_set, +GO(gnutls_x509_crl_export, iFpupbL_) +GO(gnutls_x509_crl_export2, iFpubpu_) +GO(gnutls_x509_crl_get_authority_key_gn_serial, iFpupbL_ppbL_p) +GO(gnutls_x509_crl_get_authority_key_id, iFppbL_p) +GO(gnutls_x509_crl_get_crt_count, iFp) +GO(gnutls_x509_crl_get_crt_serial, iFpuppp) // Warning: failed to confirm +GO(gnutls_x509_crl_get_dn_oid, iFpupbL_) +GO(gnutls_x509_crl_get_extension_data, iFpupbL_) +GO(gnutls_x509_crl_get_extension_data2, iFpubpu_) +GO(gnutls_x509_crl_get_extension_info, iFpupbL_p) +GO(gnutls_x509_crl_get_extension_oid, iFpupbL_) +GO(gnutls_x509_crl_get_issuer_dn, iFppbL_) +GO(gnutls_x509_crl_get_issuer_dn2, iFpbpu_) +GO(gnutls_x509_crl_get_issuer_dn3, iFpbpu_u) +GO(gnutls_x509_crl_get_issuer_dn_by_oid, iFppuupbL_) +GO(gnutls_x509_crl_get_next_update, IFp) +GO(gnutls_x509_crl_get_number, iFppbL_p) +GO(gnutls_x509_crl_get_raw_issuer_dn, iFpbpu_) +GO(gnutls_x509_crl_get_signature, iFppbL_) +GO(gnutls_x509_crl_get_signature_algorithm, iFp) +GO(gnutls_x509_crl_get_signature_oid, iFppbL_) +GO(gnutls_x509_crl_get_this_update, IFp) +GO(gnutls_x509_crl_get_version, iFp) +GO(gnutls_x509_crl_import, iFpbpu_u) +GO(gnutls_x509_crl_init, iFbp_) +GO(gnutls_x509_crl_iter_crt_serial, iFppppp) // Warning: failed to confirm +GO(gnutls_x509_crl_iter_deinit, vFp) +GO(gnutls_x509_crl_list_import, iFbp_pbpu_uu) +//GO(gnutls_x509_crl_list_import2, iFbbp__pbpu_uu) +GO(gnutls_x509_crl_print, iFpubpu_) +GO(gnutls_x509_crl_privkey_sign, iFpppuu) +GO(gnutls_x509_crl_set_authority_key_id, iFppL) +GO(gnutls_x509_crl_set_crt, iFppI) +GO(gnutls_x509_crl_set_crt_serial, iFppLI) +GO(gnutls_x509_crl_set_next_update, iFpI) +GO(gnutls_x509_crl_set_number, iFppL) +GO(gnutls_x509_crl_set_this_update, iFpI) +GO(gnutls_x509_crl_set_version, iFpu) +GO(gnutls_x509_crl_sign, iFppp) +GO(gnutls_x509_crl_sign2, iFpppuu) +GO(gnutls_x509_crl_verify, iFpbp_uup) +GO(gnutls_x509_crq_deinit, vFp) +GO(gnutls_x509_crq_export, iFpupbL_) +GO(gnutls_x509_crq_export2, iFpubpu_) +GO(gnutls_x509_crq_get_attribute_by_oid, iFppupbL_) +GO(gnutls_x509_crq_get_attribute_data, iFpupbL_) +GO(gnutls_x509_crq_get_attribute_info, iFpupbL_) +GO(gnutls_x509_crq_get_basic_constraints, iFpppp) +GO(gnutls_x509_crq_get_challenge_password, iFppbL_) +GO(gnutls_x509_crq_get_dn, iFppbL_) +GO(gnutls_x509_crq_get_dn2, iFpbpu_) +GO(gnutls_x509_crq_get_dn3, iFpbpu_u) +GO(gnutls_x509_crq_get_dn_by_oid, iFppuupbL_) +GO(gnutls_x509_crq_get_dn_oid, iFpupbL_) +GO(gnutls_x509_crq_get_extension_by_oid, iFppupbL_p) +GO(gnutls_x509_crq_get_extension_by_oid2, iFppubpu_p) +GO(gnutls_x509_crq_get_extension_data, iFpupbL_) +GO(gnutls_x509_crq_get_extension_data2, iFpubpu_) +GO(gnutls_x509_crq_get_extension_info, iFpupbL_p) +GO(gnutls_x509_crq_get_key_id, iFpupbL_) +GO(gnutls_x509_crq_get_key_purpose_oid, iFpupbL_p) +GO(gnutls_x509_crq_get_key_rsa_raw, iFpbpu_bpu_) +GO(gnutls_x509_crq_get_key_usage, iFppp) +GO(gnutls_x509_crq_get_pk_algorithm, iFpp) +GO(gnutls_x509_crq_get_pk_oid, iFppbL_) +GO(gnutls_x509_crq_get_private_key_usage_period, iFpppp) // Warning: failed to confirm +GO(gnutls_x509_crq_get_signature_algorithm, iFp) +GO(gnutls_x509_crq_get_signature_oid, iFppbL_) +GO(gnutls_x509_crq_get_subject_alt_name, iFpupbL_pp) +GO(gnutls_x509_crq_get_subject_alt_othername_oid, iFpupbL_) +GO(gnutls_x509_crq_get_tlsfeatures, iFppup) +GO(gnutls_x509_crq_get_version, iFp) +GO(gnutls_x509_crq_import, iFpbpu_u) +GO(gnutls_x509_crq_init, iFbp_) +GO(gnutls_x509_crq_print, iFpubpu_) +GO(gnutls_x509_crq_privkey_sign, iFppuu) +GO(gnutls_x509_crq_set_attribute_by_oid, iFpppL) +GO(gnutls_x509_crq_set_basic_constraints, iFpui) +GO(gnutls_x509_crq_set_challenge_password, iFpp) +GO(gnutls_x509_crq_set_dn, iFppbp_) +GO(gnutls_x509_crq_set_dn_by_oid, iFppupu) +GO(gnutls_x509_crq_set_extension_by_oid, iFpppLu) +GO(gnutls_x509_crq_set_key, iFpp) +GO(gnutls_x509_crq_set_key_purpose_oid, iFppu) +GO(gnutls_x509_crq_set_key_rsa_raw, iFpbpu_bpu_) +GO(gnutls_x509_crq_set_key_usage, iFpu) +GO(gnutls_x509_crq_set_private_key_usage_period, iFpII) +GO(gnutls_x509_crq_set_pubkey, iFpp) +GO(gnutls_x509_crq_set_subject_alt_name, iFpupuu) +GO(gnutls_x509_crq_set_subject_alt_othername, iFpppuu) +GO(gnutls_x509_crq_set_tlsfeatures, iFpp) +GO(gnutls_x509_crq_set_version, iFpu) +GO(gnutls_x509_crq_sign, iFpp) +GO(gnutls_x509_crq_sign2, iFppuu) +GO(gnutls_x509_crq_verify, iFpu) +GO(gnutls_x509_crt_check_email, uFppu) +GO(gnutls_x509_crt_check_hostname, uFpp) +GO(gnutls_x509_crt_check_hostname2, uFppu) +GO(gnutls_x509_crt_check_issuer, uFpp) +GO(gnutls_x509_crt_check_key_purpose, uFppu) +GO(gnutls_x509_crt_check_revocation, iFpbp_u) +GO(gnutls_x509_crt_cpy_crl_dist_points, iFpp) +GO(gnutls_x509_crt_deinit, vFp) +GO(gnutls_x509_crt_equals, uFpp) +GO(gnutls_x509_crt_equals2, uFpbpu_) +GO(gnutls_x509_crt_export, iFpupbL_) +GO(gnutls_x509_crt_export2, iFpubpu_) +GO(gnutls_x509_crt_get_activation_time, IFp) +GO(gnutls_x509_crt_get_authority_info_access, iFpuibpu_p) +GO(gnutls_x509_crt_get_authority_key_gn_serial, iFpupbL_ppbL_p) +GO(gnutls_x509_crt_get_authority_key_id, iFppbL_p) +GO(gnutls_x509_crt_get_basic_constraints, iFpppp) +GO(gnutls_x509_crt_get_ca_status, iFpp) +GO(gnutls_x509_crt_get_crl_dist_points, iFpupbL_pp) +GO(gnutls_x509_crt_get_dn, iFppbL_) +GO(gnutls_x509_crt_get_dn2, iFpbpu_) +GO(gnutls_x509_crt_get_dn3, iFpbpu_u) +GO(gnutls_x509_crt_get_dn_by_oid, iFppuupbL_) +GO(gnutls_x509_crt_get_dn_oid, iFpupbL_) +GO(gnutls_x509_crt_get_expiration_time, IFp) +GO(gnutls_x509_crt_get_extension_by_oid, iFppupbL_p) +GO(gnutls_x509_crt_get_extension_by_oid2, iFppubpu_p) +GO(gnutls_x509_crt_get_extension_data, iFpupbL_) +GO(gnutls_x509_crt_get_extension_data2, iFpubpu_) +GO(gnutls_x509_crt_get_extension_info, iFpupbL_p) +GO(gnutls_x509_crt_get_extension_oid, iFpupbL_) +GO(gnutls_x509_crt_get_fingerprint, iFpupbL_) +GO(gnutls_x509_crt_get_issuer, iFpbp_) +GO(gnutls_x509_crt_get_issuer_alt_name, iFpupbL_p) +GO(gnutls_x509_crt_get_issuer_alt_name2, iFpupbL_pp) +GO(gnutls_x509_crt_get_issuer_alt_othername_oid, iFpupbL_) +GO(gnutls_x509_crt_get_issuer_dn, iFppbL_) +GO(gnutls_x509_crt_get_issuer_dn2, iFpbpu_) +GO(gnutls_x509_crt_get_issuer_dn3, iFpbpu_u) +GO(gnutls_x509_crt_get_issuer_dn_by_oid, iFppuupbL_) +GO(gnutls_x509_crt_get_issuer_dn_oid, iFpupbL_) +GO(gnutls_x509_crt_get_issuer_unique_id, iFppbL_) +GO(gnutls_x509_crt_get_key_id, iFpupbL_) +GO(gnutls_x509_crt_get_key_purpose_oid, iFpupbL_p) +GO(gnutls_x509_crt_get_key_usage, iFppp) +GO(gnutls_x509_crt_get_name_constraints, iFppup) +GO(gnutls_x509_crt_get_pk_algorithm, iFpp) +GO(gnutls_x509_crt_get_pk_dsa_raw, iFpbpu_bpu_bpu_bpu_) +GO(gnutls_x509_crt_get_pk_ecc_raw, iFppbpu_bpu_) +GO(gnutls_x509_crt_get_pk_oid, iFppbL_) +GO(gnutls_x509_crt_get_pk_rsa_raw, iFpbpu_bpu_) +GO(gnutls_x509_crt_get_policy, iFpupp) // Warning: failed to confirm +GO(gnutls_x509_crt_get_preferred_hash_algorithm, iFppp) +GO(gnutls_x509_crt_get_private_key_usage_period, iFpppp) // Warning: failed to confirm +GO(gnutls_x509_crt_get_proxy, iFpppbp_bp_bL_) +GO(gnutls_x509_crt_get_raw_dn, iFpbpu_) +GO(gnutls_x509_crt_get_raw_issuer_dn, iFpbpu_) +GO(gnutls_x509_crt_get_serial, iFppbL_) +GO(gnutls_x509_crt_get_signature, iFppbL_) +GO(gnutls_x509_crt_get_signature_algorithm, iFp) +GO(gnutls_x509_crt_get_signature_oid, iFppbL_) +GO(gnutls_x509_crt_get_subject, iFpbp_) +GO(gnutls_x509_crt_get_subject_alt_name, iFpupbL_p) +GO(gnutls_x509_crt_get_subject_alt_name2, iFpupbL_pp) +GO(gnutls_x509_crt_get_subject_alt_othername_oid, iFpupbL_) +GO(gnutls_x509_crt_get_subject_key_id, iFppbL_p) +GO(gnutls_x509_crt_get_subject_unique_id, iFppbL_) +GO(gnutls_x509_crt_get_tlsfeatures, iFppup) +GO(gnutls_x509_crt_get_version, iFp) +GO(gnutls_x509_crt_import, iFpbpu_u) +GO(gnutls_x509_crt_import_pkcs11, iFpp) +GO(gnutls_x509_crt_import_url, iFppu) +GO(gnutls_x509_crt_init, iFbp_) +GO(gnutls_x509_crt_list_import, iFbp_pbpu_uu) +//GO(gnutls_x509_crt_list_import2, iFbbp__pbpu_uu) +GO(gnutls_x509_crt_list_import_pkcs11, iFbp_urp_u) +GO(gnutls_x509_crt_list_verify, iFbp_ubp_ubp_uup) +GO(gnutls_x509_crt_print, iFpubpu_) +GO(gnutls_x509_crt_privkey_sign, iFpppuu) +GO(gnutls_x509_crt_set_activation_time, iFpI) +GO(gnutls_x509_crt_set_authority_info_access, iFpibpu_) +GO(gnutls_x509_crt_set_authority_key_id, iFppL) +GO(gnutls_x509_crt_set_basic_constraints, iFpui) +GO(gnutls_x509_crt_set_ca_status, iFpu) +GO(gnutls_x509_crt_set_crl_dist_points, iFpupu) +GO(gnutls_x509_crt_set_crl_dist_points2, iFpupuu) +GO(gnutls_x509_crt_set_crq, iFpp) +GO(gnutls_x509_crt_set_crq_extension_by_oid, iFpppu) +GO(gnutls_x509_crt_set_crq_extensions, iFpp) +GO(gnutls_x509_crt_set_dn, iFppbp_) +GO(gnutls_x509_crt_set_dn_by_oid, iFppupu) +GO(gnutls_x509_crt_set_expiration_time, iFpI) +GO(gnutls_x509_crt_set_extension_by_oid, iFpppLu) +GO(gnutls_x509_crt_set_issuer_alt_name, iFpupuu) +GO(gnutls_x509_crt_set_issuer_alt_othername, iFpppuu) +GO(gnutls_x509_crt_set_issuer_dn, iFppbp_) +GO(gnutls_x509_crt_set_issuer_dn_by_oid, iFppupu) +GO(gnutls_x509_crt_set_issuer_unique_id, iFppL) +GO(gnutls_x509_crt_set_key, iFpp) +GO(gnutls_x509_crt_set_key_purpose_oid, iFppu) +GO(gnutls_x509_crt_set_key_usage, iFpu) +GO(gnutls_x509_crt_set_name_constraints, iFppu) +//GOM(gnutls_x509_crt_set_pin_function, vFEppp) +GO(gnutls_x509_crt_set_policy, iFppu) // Warning: failed to confirm +GO(gnutls_x509_crt_set_private_key_usage_period, iFpII) +GO(gnutls_x509_crt_set_proxy, iFpippL) +GO(gnutls_x509_crt_set_proxy_dn, iFppupu) +GO(gnutls_x509_crt_set_pubkey, iFpp) +GO(gnutls_x509_crt_set_serial, iFppL) +GO(gnutls_x509_crt_set_subject_alternative_name, iFpup) +GO(gnutls_x509_crt_set_subject_alt_name, iFpupuu) +GO(gnutls_x509_crt_set_subject_alt_othername, iFpppuu) +GO(gnutls_x509_crt_set_subject_key_id, iFppL) +GO(gnutls_x509_crt_set_subject_unique_id, iFppL) +GO(gnutls_x509_crt_set_tlsfeatures, iFpp) +GO(gnutls_x509_crt_set_version, iFpu) +GO(gnutls_x509_crt_sign, iFppp) +GO(gnutls_x509_crt_sign2, iFpppuu) +GO(gnutls_x509_crt_verify, iFpbp_uup) +GO(gnutls_x509_crt_verify_data2, iFpuubpu_bpu_) +GO(gnutls_x509_dn_deinit, vFp) +GO(gnutls_x509_dn_export, iFpupbL_) +GO(gnutls_x509_dn_export2, iFpubpu_) +GO(gnutls_x509_dn_get_rdn_ava, iFpiip) // Warning: failed to confirm +GO(gnutls_x509_dn_get_str, iFpbpu_) +GO(gnutls_x509_dn_get_str2, iFpbpu_u) +GO(gnutls_x509_dn_import, iFpbpu_) +GO(gnutls_x509_dn_init, iFbp_) +GO(gnutls_x509_dn_oid_known, iFp) +GO(gnutls_x509_dn_oid_name, pFpu) +GO(gnutls_x509_dn_set_str, iFppbp_) +GO(gnutls_x509_ext_deinit, vFp) // Warning: failed to confirm +//GO(gnutls_x509_ext_export_aia, +//GO(gnutls_x509_ext_export_authority_key_id, +//GO(gnutls_x509_ext_export_basic_constraints, +//GO(gnutls_x509_ext_export_crl_dist_points, +//GO(gnutls_x509_ext_export_key_purposes, +//GO(gnutls_x509_ext_export_key_usage, +//GO(gnutls_x509_ext_export_name_constraints, +//GO(gnutls_x509_ext_export_policies, +//GO(gnutls_x509_ext_export_private_key_usage_period, +//GO(gnutls_x509_ext_export_proxy, +//GO(gnutls_x509_ext_export_subject_alt_names, +//GO(gnutls_x509_ext_export_subject_key_id, +//GO(gnutls_x509_ext_export_tlsfeatures, +//GO(gnutls_x509_ext_import_aia, +//GO(gnutls_x509_ext_import_authority_key_id, +//GO(gnutls_x509_ext_import_basic_constraints, +//GO(gnutls_x509_ext_import_crl_dist_points, +//GO(gnutls_x509_ext_import_key_purposes, +//GO(gnutls_x509_ext_import_key_usage, +//GO(gnutls_x509_ext_import_name_constraints, +//GO(gnutls_x509_ext_import_policies, +//GO(gnutls_x509_ext_import_private_key_usage_period, +//GO(gnutls_x509_ext_import_proxy, +//GO(gnutls_x509_ext_import_subject_alt_names, +//GO(gnutls_x509_ext_import_subject_key_id, +//GO(gnutls_x509_ext_import_tlsfeatures, +GO(gnutls_x509_ext_print, iFpuup) // Warning: failed to confirm +//GO(gnutls_x509_key_purpose_deinit, +//GO(gnutls_x509_key_purpose_get, +//GO(gnutls_x509_key_purpose_init, +//GO(gnutls_x509_key_purpose_set, +GO(gnutls_x509_name_constraints_add_excluded, iFpubpu_) +GO(gnutls_x509_name_constraints_add_permitted, iFpubpu_) +GO(gnutls_x509_name_constraints_check, uFpubpu_) +GO(gnutls_x509_name_constraints_check_crt, uFpup) +GO(gnutls_x509_name_constraints_deinit, vFp) +GO(gnutls_x509_name_constraints_get_excluded, iFpupbpu_) +GO(gnutls_x509_name_constraints_get_permitted, iFpupbpu_) +GO(gnutls_x509_name_constraints_init, iFbp_) +//GO(_gnutls_x509_name_constraints_merge, +//GO(gnutls_x509_othername_to_virtual, +//GO(gnutls_x509_policies_deinit, +//GO(gnutls_x509_policies_get, +//GO(gnutls_x509_policies_init, +//GO(gnutls_x509_policies_set, +GO(gnutls_x509_policy_release, vFp) // Warning: failed to confirm +GO(gnutls_x509_privkey_cpy, iFpp) +GO(gnutls_x509_privkey_deinit, vFp) +GO(gnutls_x509_privkey_export, iFpupbL_) +GO(gnutls_x509_privkey_export2, iFpubpu_) +GO(gnutls_x509_privkey_export2_pkcs8, iFpupubpu_) +GO(gnutls_x509_privkey_export_dsa_raw, iFpbpu_bpu_bpu_bpu_bpu_) +GO(gnutls_x509_privkey_export_ecc_raw, iFppbpu_bpu_bpu_) +GO(gnutls_x509_privkey_export_pkcs8, iFpupupbL_) +GO(gnutls_x509_privkey_export_rsa_raw, iFpbpu_bpu_bpu_bpu_bpu_bpu_) +GO(gnutls_x509_privkey_export_rsa_raw2, iFpbpu_bpu_bpu_bpu_bpu_bpu_bpu_bpu_) +GO(gnutls_x509_privkey_fix, iFp) +GO(gnutls_x509_privkey_generate, iFpuuu) +GO(gnutls_x509_privkey_generate2, iFpuuubupu_u) +GO(gnutls_x509_privkey_get_key_id, iFpupbL_) +GO(gnutls_x509_privkey_get_pk_algorithm, iFp) +GO(gnutls_x509_privkey_get_pk_algorithm2, iFpp) +GO(gnutls_x509_privkey_get_seed, iFpppbL_) +GO(gnutls_x509_privkey_import, iFpbpu_u) +GO(gnutls_x509_privkey_import2, iFpbpu_upu) +GO(gnutls_x509_privkey_import_dsa_raw, iFpbpu_bpu_bpu_bpu_bpu_) +GO(gnutls_x509_privkey_import_ecc_raw, iFpubpu_bpu_bpu_) +GO(gnutls_x509_privkey_import_openssl, iFpbpu_p) +GO(gnutls_x509_privkey_import_pkcs8, iFpbpu_upu) +GO(gnutls_x509_privkey_import_rsa_raw, iFpbpu_bpu_bpu_bpu_bpu_bpu_) +GO(gnutls_x509_privkey_import_rsa_raw2, iFpbpu_bpu_bpu_bpu_bpu_bpu_bpu_bpu_) +GO(gnutls_x509_privkey_init, iFbp_) +GO(gnutls_x509_privkey_sec_param, uFp) +GO(gnutls_x509_privkey_set_flags, vFpu) +//GOM(gnutls_x509_privkey_set_pin_function, vFEppp) +GO(gnutls_x509_privkey_sign_data, iFpuubpu_pbL_) +GO(gnutls_x509_privkey_sign_hash, iFpbpu_bpu_) +GO(gnutls_x509_privkey_verify_params, iFp) +GO(gnutls_x509_privkey_verify_seed, iFpupL) +GO(gnutls_x509_rdn_get, iFbpu_pbL_) +GO(gnutls_x509_rdn_get2, iFbpu_bpu_u) +GO(gnutls_x509_rdn_get_by_oid, iFbpu_puupbL_) +GO(gnutls_x509_rdn_get_oid, iFbpu_upbL_) +GO(gnutls_x509_spki_deinit, vFp) +GO(gnutls_x509_spki_init, iFbp_) +GO(gnutls_x509_spki_set_rsa_oaep_params, iFpubpu_) +GO(gnutls_x509_spki_set_rsa_pss_params, vFpuu) +//GO(gnutls_x509_tlsfeatures_add, +GO(gnutls_x509_tlsfeatures_check_crt, uFpp) +GO(gnutls_x509_tlsfeatures_deinit, vFp) +GO(gnutls_x509_tlsfeatures_get, iFpup) +GO(gnutls_x509_tlsfeatures_init, iFbp_) +GO(gnutls_x509_trust_list_add_cas, iFpbp_uu) +GO(gnutls_x509_trust_list_add_crls, iFpbp_uuu) +GO(gnutls_x509_trust_list_add_named_crt, iFpppLu) +GO(gnutls_x509_trust_list_add_system_trust, iFpuu) +GO(gnutls_x509_trust_list_add_trust_dir, iFpppuuu) +GO(gnutls_x509_trust_list_add_trust_file, iFpppuuu) +GO(gnutls_x509_trust_list_add_trust_mem, iFpbpu_bpu_uuu) +GO(gnutls_x509_trust_list_deinit, vFpu) +GO(gnutls_x509_trust_list_get_issuer, iFppbp_u) +GO(gnutls_x509_trust_list_get_issuer_by_dn, iFpbpu_bp_u) +GO(gnutls_x509_trust_list_get_issuer_by_subject_key_id, iFpbpu_bpu_bp_u) +GO(gnutls_x509_trust_list_init, iFbp_u) +GO(gnutls_x509_trust_list_iter_deinit, vFp) +GO(gnutls_x509_trust_list_iter_get_ca, iFpbp_bp_) +GO(gnutls_x509_trust_list_remove_cas, iFpbp_u) +GO(gnutls_x509_trust_list_remove_trust_file, iFppu) +GO(gnutls_x509_trust_list_remove_trust_mem, iFpbpu_u) +//GOM(gnutls_x509_trust_list_verify_crt, iFEpbp_uupp) +//GOM(gnutls_x509_trust_list_verify_crt2, iFEpbp_ubupu_uupp) +//GOM(gnutls_x509_trust_list_verify_named_crt, iFEpppLupp) +//GO(_rsa_generate_fips186_4_keypair, diff --git a/src/wrapped32/wrappedldlinux.c b/src/wrapped32/wrappedldlinux.c new file mode 100755 index 0000000..bb138d5 --- /dev/null +++ b/src/wrapped32/wrappedldlinux.c @@ -0,0 +1,59 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "elfloader.h" +#include "box32context.h" + +typedef struct __attribute__((packed, aligned(4))) my32_tls_s { + int i; + uint32_t o; +} my32_tls_t; + +EXPORT void* my32___tls_get_addr(x64emu_t* emu, void* p) +{ + my32_tls_t *t = (my32_tls_t*)p; + return GetDTatOffset(emu, t->i, t->o); +} + +EXPORT void* my32____tls_get_addr(x64emu_t* emu) +{ + // the GNU version (with 3 '_') use register for the parameter! + my32_tls_t *t = (my32_tls_t*)from_ptrv(R_EAX); + return GetDTatOffset(emu, t->i, t->o); +} + +EXPORT ptr_t my32___libc_stack_end; +static void stSetup32(box64context_t* context) +{ + my32___libc_stack_end = to_ptrv(context->stack); // is this the end, or should I add stasz? +} + +// don't try to load the actual ld-linux (because name is variable), just use box64 itself, as it's linked to ld-linux +static const char* ldlinuxName = "ld-linux.so.3"; +#define LIBNAME ldlinux +#define ALTNAME "ld-linux.so.2" + +// fake (ignored) _r_data structure +EXPORT void* my32__r_debug[5]; + +#define PRE_INIT\ + if(1) \ + lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \ + else + +#define CUSTOM_INIT \ + stSetup32(box64); \ + +#include "wrappedlib_init32.h" + diff --git a/src/wrapped32/wrappedldlinux_private.h b/src/wrapped32/wrappedldlinux_private.h new file mode 100755 index 0000000..cfff773 --- /dev/null +++ b/src/wrapped32/wrappedldlinux_private.h @@ -0,0 +1,25 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error meh! +#endif + +// _dl_allocate_tls +// _dl_allocate_tls_init +// _dl_argv //type B +// _dl_cache_libcmp +// _dl_deallocate_tls +// _dl_debug_state +// _dl_get_tls_static_info +// _dl_make_stack_executable +// _dl_mcount +// _dl_rtld_di_serinfo +// _dl_tls_setup +DATA(__libc_enable_secure, 4) +DATA(__libc_stack_end, 4) +DATA(__pointer_chk_guard, 4) +DATAM(_r_debug, 20) //type B +DATA(_rtld_global, 4) +DATA(_rtld_global_ro, 4) +DATA(__stack_chk_guard, 4) +// defini dans glibc/sysdeps/i386/dl-tls.h +GOM(___tls_get_addr, pFEv) //the parameter tls_index is in a register (EAX?) +GOM(__tls_get_addr, pFEp) //same, but the parameter is in the stack diff --git a/src/wrapped32/wrappedlib_init32.h b/src/wrapped32/wrappedlib_init32.h new file mode 100644 index 0000000..0f91ee9 --- /dev/null +++ b/src/wrapped32/wrappedlib_init32.h @@ -0,0 +1,333 @@ +#ifndef LIBNAME +#error Meh +#endif + +#include "debug.h" +#include "librarian/library_inner.h" + +#define FUNC3(M,N) wrapped##M##N +#define FUNC2(M,N) FUNC3(M,N) +#define FUNC(N) FUNC2(LIBNAME,N) +#define QUOTE(M) #M +#define PRIVATE2(P) QUOTE(wrapped##P##_private.h) +#define PRIVATE(P) PRIVATE2(P) +#define MAPNAME3(N,M) N##M +#define MAPNAME2(N,M) MAPNAME3(N,M) +#define MAPNAME(N) MAPNAME2(LIBNAME,N) + +// prepare the maps +#define _DOIT(P,Q) QUOTE(generated/wrapped##P##Q.h) +#define DOIT(P,Q) _DOIT(P,Q) +#include DOIT(LIBNAME,defs32) + +// regular symbol mapped to itself +#define GO(N, W) +// regular symbol mapped to itself, but weak +#define GOW(N, W) +// symbol mapped to my32_symbol +#define GOM(N, W) +// symbol mapped to my32_symbol, but weak +#define GOWM(N, W) +// regular symbol mapped to itself, that returns a structure +#define GOS(N, W) +// weak symbol mapped to itself, that returns a structure +#define GOWS(N, W) +// symbol mapped to another one +#define GO2(N, W, O) +// weak symbol mapped to another one +#define GOW2(N, W, O) +// data +#define DATA(N, S) +// data, Weak (type V) +#define DATAV(N, S) +// data, Uninitialized (type B) +#define DATAB(N, S) +// data, "my32_" type +#define DATAM(N, S) + +// #define the 4 maps first +#undef GO +#undef GOW +#ifdef STATICBUILD +#define GO(N, W) {#N, W##_32, 0, &N}, +#define GOW(N, W) {#N, W##_32, 1, &N}, +#else +#define GO(N, W) {#N, W##_32, 0}, +#define GOW(N, W) {#N, W##_32, 1}, +#endif +static const map_onesymbol_t MAPNAME(symbolmap)[] = { + #include PRIVATE(LIBNAME) +}; +#undef GO +#undef GOW +#undef GOM +#undef GOWM +#define GO(N, W) +#define GOW(N, W) +#ifdef STATICBUILD +#define GOM(N, W) {#N, W##_32, 0, &my32_##N}, +#define GOWM(N, W) {#N, W##_32, 1, &my32_##N}, +#else +#define GOM(N, W) {#N, W##_32, 0}, +#define GOWM(N, W) {#N, W##_32, 1}, +#endif +static const map_onesymbol_t MAPNAME(mysymbolmap)[] = { + #include PRIVATE(LIBNAME) +}; +#undef GOM +#undef GOWM +#define GOM(N, W) +#define GOWM(N, W) +#undef GOS +#undef GOWS +#ifdef STATICBUILD +#define GOS(N, W) {#N, W##_32, 0, &my32_##N}, +#define GOWS(N, W) {#N, W##_32, 1, &my32_##N}, +#else +#define GOS(N, W) {#N, W##_32, 0}, +#define GOWS(N, W) {#N, W##_32, 1}, +#endif +static const map_onesymbol_t MAPNAME(stsymbolmap)[] = { + #include PRIVATE(LIBNAME) +}; +#undef GOS +#undef GOWS +#define GOS(N, W) +#define GOWS(N, W) +#undef GO2 +#undef GOW2 +#ifdef STATICBUILD +#define GO2(N, W, O) {#N, W##_32, 0, #O, &O}, +#define GOW2(N, W, O) {#N, W##_32, 1, #O, &O}, +#else +#define GO2(N, W, O) {#N, W##_32, 0, #O}, +#define GOW2(N, W, O) {#N, W##_32, 1, #O}, +#endif +static const map_onesymbol2_t MAPNAME(symbol2map)[] = { + #include PRIVATE(LIBNAME) +}; +#undef GO2 +#define GO2(N, W, O) +#undef GOW2 +#define GOW2(N, W, O) +#undef DATA +#undef DATAV +#undef DATAB +#ifdef STATICBUILD +#define DATA(N, S) {#N, S, 0, (void*)&N}, +#define DATAV(N, S) {#N, S, 1, (void*)&N}, +#define DATAB(N, S) {#N, S, 0, (void*)&N}, +#else +#define DATA(N, S) {#N, S, 0}, +#define DATAV(N, S) {#N, S, 1}, +#define DATAB(N, S) {#N, S, 0}, +#endif +static const map_onedata_t MAPNAME(datamap)[] = { + #include PRIVATE(LIBNAME) +}; +#undef DATA +#undef DATAV +#undef DATAB +#define DATA(N, S) +#define DATAV(N, S) +#define DATAB(N, S) +#undef DATAM +#ifdef STATICBUILD +#define DATAM(N, S) {#N, S, 0, &my32_##N}, +#else +#define DATAM(N, S) {#N, S, 0}, +#endif +static const map_onedata_t MAPNAME(mydatamap)[] = { + #include PRIVATE(LIBNAME) +}; + +#undef GO +#undef GOW +#undef GOM +#undef GOWM +#undef GO2 +#undef GOS +#undef GOWS +#undef DATA +#undef DATAV +#undef DATAB +#undef DATAM + +#include DOIT(LIBNAME,undefs32) +#undef DOIT +#undef _DOIT + +#if !defined(ALTNAME) && defined(ALTNAME2) +#error Please define ALTNAME before defining ALTNAME2 +#endif + +#define COUNT_NARGS(...) COUNT_NARGS_AUX(__VA_ARGS__, 5, 4, 3, 2, 1, 0) +#define COUNT_NARGS_AUX(_1, _2, _3, _4, _5, n, ...) COUNT_NARGS_AUX##n(This should not appear, too many libraries) +#define COUNT_NARGS_AUX1(v1, v2) 1 +#define COUNT_NARGS_AUX2(v1, v2) 2 +#define COUNT_NARGS_AUX3(v1, v2) 3 +#define COUNT_NARGS_AUX4(v1, v2) 4 +#define COUNT_NARGS_AUX5(v1, v2) 5 + +int FUNC(_init32)(library_t* lib, box64context_t* box64) +{ + (void)box64; + + // Init first + box_free(lib->path); lib->path=NULL; +#ifdef PRE_INIT + PRE_INIT +#endif + { +#ifndef STATICBUILD + lib->w.lib = dlopen(MAPNAME(Name), RTLD_LAZY | RTLD_GLOBAL); + if(!lib->w.lib) { +#ifdef ALTNAME + lib->w.lib = dlopen(ALTNAME, RTLD_LAZY | RTLD_GLOBAL); + if(!lib->w.lib) { +#ifdef ALTNAME2 + lib->w.lib = dlopen(ALTNAME2, RTLD_LAZY | RTLD_GLOBAL); + if(!lib->w.lib) +#endif +#endif + return -1; +#ifdef ALTNAME +#ifdef ALTNAME2 + else lib->path = box_strdup(ALTNAME2); +#endif + } else lib->path = box_strdup(ALTNAME); +#endif + } else lib->path = box_strdup(MAPNAME(Name)); +#else + lib->path = box_strdup(MAPNAME(Name)); +#endif + } + WrappedLib_CommonInit(lib); + + khint_t k; + int ret; + int cnt; + + // populates maps... +#ifdef STATICBUILD +#define DOIT(mapname) \ + cnt = sizeof(MAPNAME(mapname))/sizeof(map_onesymbol_t); \ + for (int i = 0; i < cnt; ++i) { \ + if (MAPNAME(mapname)[i].weak) { \ + k = kh_put(symbolmap, lib->w.w##mapname, MAPNAME(mapname)[i].name, &ret); \ + kh_value(lib->w.w##mapname, k).w = MAPNAME(mapname)[i].w; \ + kh_value(lib->w.w##mapname, k).resolved = 0; \ + kh_value(lib->w.w##mapname, k).addr = (uintptr_t)MAPNAME(mapname)[i].addr; \ + } else { \ + k = kh_put(symbolmap, lib->w.mapname, MAPNAME(mapname)[i].name, &ret); \ + kh_value(lib->w.mapname, k).w = MAPNAME(mapname)[i].w; \ + kh_value(lib->w.mapname, k).resolved = 0; \ + kh_value(lib->w.mapname, k).addr = (uintptr_t)MAPNAME(mapname)[i].addr; \ + } \ + if (strchr(MAPNAME(mapname)[i].name, '@')) \ + AddDictionnary(box64->versym, MAPNAME(mapname)[i].name); \ + } +#else +#define DOIT(mapname) \ + cnt = sizeof(MAPNAME(mapname))/sizeof(map_onesymbol_t); \ + for (int i = 0; i < cnt; ++i) { \ + if (MAPNAME(mapname)[i].weak) { \ + k = kh_put(symbolmap, lib->w.w##mapname, MAPNAME(mapname)[i].name, &ret); \ + kh_value(lib->w.w##mapname, k).w = MAPNAME(mapname)[i].w; \ + kh_value(lib->w.w##mapname, k).resolved = 0; \ + } else { \ + k = kh_put(symbolmap, lib->w.mapname, MAPNAME(mapname)[i].name, &ret); \ + kh_value(lib->w.mapname, k).w = MAPNAME(mapname)[i].w; \ + kh_value(lib->w.mapname, k).resolved = 0; \ + } \ + if (strchr(MAPNAME(mapname)[i].name, '@')) \ + AddDictionnary(box64->versym, MAPNAME(mapname)[i].name); \ + } +#endif + DOIT(symbolmap) + DOIT(mysymbolmap) +#undef DOIT + cnt = sizeof(MAPNAME(stsymbolmap))/sizeof(map_onesymbol_t); + for (int i=0; iw.stsymbolmap, MAPNAME(stsymbolmap)[i].name, &ret); + kh_value(lib->w.stsymbolmap, k).w = MAPNAME(stsymbolmap)[i].w; + #ifdef STATICBUILD + kh_value(lib->w.stsymbolmap, k).resolved = 1; + kh_value(lib->w.stsymbolmap, k).addr = (uintptr_t)MAPNAME(stsymbolmap)[i].addr; + #else + kh_value(lib->w.stsymbolmap, k).resolved = 0; + #endif + if(strchr(MAPNAME(stsymbolmap)[i].name, '@')) + AddDictionnary(box64->versym, MAPNAME(stsymbolmap)[i].name); + } + cnt = sizeof(MAPNAME(symbol2map))/sizeof(map_onesymbol2_t); + for (int i=0; iw.symbol2map, MAPNAME(symbol2map)[i].name, &ret); + kh_value(lib->w.symbol2map, k).name = MAPNAME(symbol2map)[i].name2; + kh_value(lib->w.symbol2map, k).w = MAPNAME(symbol2map)[i].w; + kh_value(lib->w.symbol2map, k).weak = MAPNAME(symbol2map)[i].weak; + #ifdef STATICBUILD + kh_value(lib->w.symbol2map, k).resolved = 1; + kh_value(lib->w.symbol2map, k).addr = (uintptr_t)MAPNAME(symbol2map)[i].addr; + #else + kh_value(lib->w.symbol2map, k).resolved = 0; + #endif + if(strchr(MAPNAME(symbol2map)[i].name, '@')) + AddDictionnary(box64->versym, MAPNAME(symbol2map)[i].name); + } + cnt = sizeof(MAPNAME(datamap))/sizeof(map_onedata_t); + for (int i=0; iw.wdatamap, MAPNAME(datamap)[i].name, &ret); + #ifdef STATICBUILD + kh_value(lib->w.wdatamap, k).size = MAPNAME(datamap)[i].sz; + kh_value(lib->w.wdatamap, k).addr = (uintptr_t)MAPNAME(datamap)[i].addr; + #else + kh_value(lib->w.wdatamap, k) = MAPNAME(datamap)[i].sz; + #endif + } else { + k = kh_put(datamap, lib->w.datamap, MAPNAME(datamap)[i].name, &ret); + #ifdef STATICBUILD + kh_value(lib->w.datamap, k).size = MAPNAME(datamap)[i].sz; + kh_value(lib->w.datamap, k).addr = (uintptr_t)MAPNAME(datamap)[i].addr; + #else + kh_value(lib->w.datamap, k) = MAPNAME(datamap)[i].sz; + #endif + } + } + cnt = sizeof(MAPNAME(mydatamap))/sizeof(map_onedata_t); + for (int i=0; iw.mydatamap, MAPNAME(mydatamap)[i].name, &ret); + #ifdef STATICBUILD + kh_value(lib->w.mydatamap, k).size = MAPNAME(mydatamap)[i].sz; + kh_value(lib->w.mydatamap, k).addr = (uintptr_t)MAPNAME(mydatamap)[i].addr; + #else + kh_value(lib->w.mydatamap, k) = MAPNAME(mydatamap)[i].sz; + #endif + } +#ifdef ALTMY + SETALT(ALTMY); +#endif +#ifdef HAS_MY + getMy(lib); +#endif +#ifdef CUSTOM_INIT + CUSTOM_INIT +#endif +#ifdef NEEDED_LIBS + setNeededLibs(lib, COUNT_NARGS(NEEDED_LIBS), NEEDED_LIBS); +#endif + + return 0; +} + +void FUNC(_fini32)(library_t* lib) +{ +#ifdef HAS_MY + freeMy(); +#endif +#ifdef CUSTOM_FINI + CUSTOM_FINI +#endif + WrappedLib_FinishFini(lib); +} diff --git a/src/wrapped32/wrappedlibasound.c b/src/wrapped32/wrappedlibasound.c new file mode 100644 index 0000000..b189b83 --- /dev/null +++ b/src/wrapped32/wrappedlibasound.c @@ -0,0 +1,377 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "bridge.h" +#include "box32.h" + +#define LIBNAME libasound +static const char* libasoundName = "libasound.so.2"; + +typedef int (*iFpp_t)(void*, void*); +typedef size_t(*LFv_t)(); + +#define ADDED_FUNCTIONS() \ + GO(snd_pcm_hw_params_current, iFpp_t) \ + GO(snd_pcm_hw_params_get_channels, iFpp_t) \ + GO(snd_pcm_hw_params_sizeof, LFv_t) \ + +#include "generated/wrappedlibasoundtypes32.h" + +EXPORT uintptr_t my32_snd_lib_error = 0; +static void default_error_handler(const char *file, int line, const char *function, int err, const char *fmt, va_list ap) +{ + (void)file; (void)line; (void)function; (void)err; + vprintf(fmt, ap); +} + +#define ADDED_INIT() \ + my32_snd_lib_error = AddCheckBridge(my_lib->w.bridge, vFpipipV_32, default_error_handler, 0, "ASoundCustomErrorHandler"); + +#define ADDED_FINI() \ + my32_snd_lib_error = 0; // no removing of bridge + +#include "wrappercallback32.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) + +// snd_async_callback_t +#define GO(A) \ +static uintptr_t my32_async_fct_##A = 0; \ +static void* my32_async_##A(void* handler) \ +{ \ + return (void*)RunFunctionFmt(my32_async_fct_##A, "p", handler); \ +} +SUPER() +#undef GO +static void* findAsyncFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_async_fct_##A == (uintptr_t)fct) return my32_async_##A; + SUPER() + #undef GO + #define GO(A) if(my32_async_fct_##A == 0) {my32_async_fct_##A = (uintptr_t)fct; return my32_async_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Asound Async callback\n"); + return NULL; +} +// snd_mixer_elem_callback_t +#define GO(A) \ +static uintptr_t my32_elem_fct_##A = 0; \ +static int my32_elem_##A(void* elem, uint32_t mask) \ +{ \ + return (int)RunFunctionFmt(my32_elem_fct_##A, "pu", elem, mask); \ +} +SUPER() +#undef GO +static void* findElemFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_elem_fct_##A == (uintptr_t)fct) return my32_elem_##A; + SUPER() + #undef GO + #define GO(A) if(my32_elem_fct_##A == 0) {my32_elem_fct_##A = (uintptr_t)fct; return my32_elem_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Asound Elem callback\n"); + return NULL; +} +// snd_pcm_hook_func_t +#define GO(A) \ +static uintptr_t my32_pcm_hook_fct_##A = 0; \ +static int my32_pcm_hook_##A(void* a) \ +{ \ + return (int)RunFunctionFmt(my32_pcm_hook_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findPCMHookFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_pcm_hook_fct_##A == (uintptr_t)fct) return my32_elem_##A; + SUPER() + #undef GO + #define GO(A) if(my32_pcm_hook_fct_##A == 0) {my32_pcm_hook_fct_##A = (uintptr_t)fct; return my32_pcm_hook_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Asound PCMHook callback\n"); + return NULL; +} +// snd_mixer_compare_t +#define GO(A) \ +static uintptr_t my32_mixer_compare_fct_##A = 0; \ +static int my32_mixer_compare_##A(void* a) \ +{ \ + return (int)RunFunctionFmt(my32_mixer_compare_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findMixerCompareFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_mixer_compare_fct_##A == (uintptr_t)fct) return my32_elem_##A; + SUPER() + #undef GO + #define GO(A) if(my32_mixer_compare_fct_##A == 0) {my32_mixer_compare_fct_##A = (uintptr_t)fct; return my32_mixer_compare_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Asound Mixer Compare callback\n"); + return NULL; +} +// private_free +#define GO(A) \ +static uintptr_t my32_private_free_fct_##A = 0; \ +static int my32_private_free_##A(void* a) \ +{ \ + return (int)RunFunctionFmt(my32_private_free_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findPrivateFreeFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_private_free_fct_##A == (uintptr_t)fct) return my32_elem_##A; + SUPER() + #undef GO + #define GO(A) if(my32_private_free_fct_##A == 0) {my32_private_free_fct_##A = (uintptr_t)fct; return my32_private_free_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Asound PrivateFree callback\n"); + return NULL; +} +// snd_mixer_event_t +#define GO(A) \ +static uintptr_t my32_mixer_event_fct_##A = 0; \ +static int my32_mixer_event_##A(void* a, uint32_t b, void* c, void* d) \ +{ \ + return (int)RunFunctionFmt(my32_mixer_event_fct_##A, "pupp", a, b, c, d); \ +} +SUPER() +#undef GO +static void* findMixerEventFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_mixer_event_fct_##A == (uintptr_t)fct) return my32_elem_##A; + SUPER() + #undef GO + #define GO(A) if(my32_mixer_event_fct_##A == 0) {my32_mixer_event_fct_##A = (uintptr_t)fct; return my32_mixer_event_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Asound MixerEvent callback\n"); + return NULL; +} + + +//EXPORT int my32_snd_async_add_handler(x64emu_t *emu, void *handler, int fd, void* callback, void *private_data) +//{ +// return my->snd_async_add_handler(handler, fd, findAsyncFct(callback), private_data); +//} + +//EXPORT int my32_snd_async_add_pcm_handler(x64emu_t *emu, void *handler, void* pcm, void* callback, void *private_data) +//{ +// return my->snd_async_add_pcm_handler(handler, pcm, findAsyncFct(callback), private_data); +//} + +static void* current_error_handler = NULL; +static void dummy32_error_handler(const char *file, int line, const char *function, int err, const char *fmt, ...) +{ + (void)function; (void)err; + va_list ap; + + fprintf(stderr, "Warning: this is a dummy snd_lib error handler\n"); + fprintf(stderr, "Error in file %s on line %i: ", file, line); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); +} + +static void empty_error_handler(const char *file, int line, const char *function, int err, const char *fmt, ...) +{ + (void)file; (void)line; (void)function; (void)err; (void)fmt; + // do nothing +} + +//EXPORT int my32_snd_lib_error_set_handler(x64emu_t* emu, void* handler) +//{ +// current_error_handler = handler; +// void *error_handler; +// uint8_t *code = (uint8_t *)handler; +// if (code) { +// if ((code[0] == 0xC3) || ((code[0] == 0xF3) && (code[1] == 0xC3))) { +// error_handler = &empty_error_handler; +// } else { +// error_handler = &dummy32_error_handler; +// printf_log(LOG_NONE, "Warning: snd_lib_error_set_handler: using dummy error handler\n"); +// } +// } else error_handler = NULL; +// +// return my->snd_lib_error_set_handler(error_handler); +//} + +//EXPORT void my32_snd_mixer_elem_set_callback(x64emu_t* emu, void* handler, void* f) +//{ +// my->snd_mixer_elem_set_callback(handler, findElemFct(f)); +//} + +//EXPORT int my32_snd_pcm_hook_add(x64emu_t* emu, void* hook, void* pcm, uint32_t type, void* f, void* data) +//{ +// return my->snd_pcm_hook_add(hook, pcm, type, findPCMHookFct(f), data); +//} + +//EXPORT int my32_snd_mixer_set_compare(x64emu_t* emu, void* mixer, void* f) +//{ +// return my->snd_mixer_set_compare(mixer, findMixerCompareFct(f)); +//} + +//EXPORT int my32_snd_mixer_elem_new(x64emu_t* emu, void* elem, uint32_t type, int weight, void* data, void* f) +//{ +// return my->snd_mixer_elem_new(elem, type, weight, data, findPrivateFreeFct(f)); +//} + +//EXPORT void* my32_snd_mixer_class_get_event(x64emu_t* emu, void* class) +//{ +// void* ret = my->snd_mixer_class_get_event(class); +// AddAutomaticBridge(my_lib->w.bridge, iFpupp, ret, 0, "snd_event_t"); +// return ret; +//} + +//EXPORT void* my32_snd_mixer_class_get_compare(x64emu_t* emu, void* class) +//{ +// void* ret = my->snd_mixer_class_get_compare(class); +// AddAutomaticBridge(my_lib->w.bridge, iFpp, ret, 0, "snd_mixer_compare_t"); +// return ret; +//} + +//EXPORT int my32_snd_mixer_class_set_event(x64emu_t* emu, void* class, void* f) +//{ +// return my->snd_mixer_class_set_event(class, findMixerEventFct(f)); +//} + +//EXPORT int my32_snd_mixer_class_set_private_free(x64emu_t* emu, void* class, void* f) +//{ +// return my->snd_mixer_class_set_private_free(class, findPrivateFreeFct(f)); +//} + +//EXPORT int my32_snd_mixer_class_set_compare(x64emu_t* emu, void* class, void* f) +//{ +// return my->snd_mixer_class_set_compare(class, findMixerCompareFct(f)); +//} + +typedef struct _my_snd_pcm_channel_area_s { + void *addr; + unsigned int first; + unsigned int step; +} my_snd_pcm_channel_area_t; +typedef struct __attribute__((packed, aligned(4))) _my_snd_pcm_channel_area_32_s { + ptr_t addr; + unsigned int first; + unsigned int step; +} my_snd_pcm_channel_area_32_t; + +EXPORT int my32_snd_pcm_mmap_begin(x64emu_t* emu, void* pcm, ptr_t* areas, ulong_t* offset, ulong_t* frames) +{ + my_snd_pcm_channel_area_t *l_areas; + unsigned long l_offset; + unsigned long l_frames = from_ulong(*frames); + int ret = my->snd_pcm_mmap_begin(pcm, &l_areas, &l_offset, &l_frames); + if(ret) + return ret; + *offset = to_ulong(l_offset); + *frames = to_ulong(l_frames); + static my_snd_pcm_channel_area_32_t my_areas[15] = {0}; + static void* last_pcm = NULL; + static int last_nch = 0; + // get the number of channels + unsigned int nch = 0; + if(pcm==last_pcm) + nch = last_nch; + else { + void* hw=alloca(my->snd_pcm_hw_params_sizeof()); + my->snd_pcm_hw_params_current(pcm, hw); + my->snd_pcm_hw_params_get_channels(hw, &nch); + last_pcm = pcm; + last_nch = nch; + } + if(nch>15) {printf_log(LOG_INFO, "Warning, too many channels in pcm of 32bits alsa: %d\n", nch); nch=15; } + for(unsigned int i=0; isnd_device_name_hint(card, iface, &hints_l); + if(ret) return ret; + *hints = to_ptrv(hints_l); + // inplace shrink + int n = 0; + while(hints_l[n]) ++n; + ++n; + for(int i=0; i=0; --i) + hints_l[i] = from_ptrv(hints[i]); + return my->snd_device_name_free_hint(hints_l); +} + +void* my_dlopen(x64emu_t* emu, void *filename, int flag); // defined in wrappedlibdl.c +char* my_dlerror(x64emu_t* emu); +int my_dlclose(x64emu_t* emu, void *handle); +void* my_dlvsym(x64emu_t* emu, void *handle, void *symbol, void *version); +EXPORT void * my32_snd_dlopen(x64emu_t* emu, void* name, int mode, void* errbuf, size_t errbuflen) +{ + void* ret = my_dlopen(emu, name, mode); // Does NULL name (so dlopen libasound) need special treatment? + if(!ret && errbuf) { + strncpy(errbuf, my_dlerror(emu), errbuflen); + } + return ret; +} +EXPORT int my32_snd_dlclose(x64emu_t* emu, void* handle) +{ + return my_dlclose(emu, handle); +} +EXPORT void* my32_snd_dlsym(x64emu_t* emu, void* handle, void* name, void* version) +{ + return my_dlvsym(emu, handle, name, version); +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibasound_private.h b/src/wrapped32/wrappedlibasound_private.h new file mode 100644 index 0000000..1de9210 --- /dev/null +++ b/src/wrapped32/wrappedlibasound_private.h @@ -0,0 +1,1279 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//DATAB(alsa_lisp_nil, 4) +//DATAB(alsa_lisp_t, 4) +//DATAM(snd_config, 4) +//DATAB(_snd_config_hook_load_dlsym_config_hook_001, 4) +//DATAB(_snd_config_hook_load_for_all_cards_dlsym_config_hook_001, 4) +//DATAB(__snd_ctl_hw_open_dlsym_control_001, 4) +//DATAB(__snd_ctl_shm_open_dlsym_control_001, 4) +//DATAB(_snd_func_card_driver_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_card_id_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_card_inum_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_card_name_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_concat_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_datadir_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_getenv_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_iadd_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_igetenv_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_imul_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_pcm_args_by_class_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_pcm_id_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_private_card_driver_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_private_pcm_subdevice_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_private_string_dlsym_config_evaluate_001, 4) +//DATAB(_snd_func_refer_dlsym_config_evaluate_001, 4) +//DATAB(__snd_hwdep_hw_open_dlsym_hwdep_001, 4) +//DATAB(__snd_pcm_adpcm_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_alaw_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_asym_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_copy_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_dmix_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_dshare_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_dsnoop_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_empty_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_file_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_hook_ctl_elems_install_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_hooks_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_hw_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_iec958_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_ladspa_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_lfloat_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_linear_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_mmap_emul_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_mulaw_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_multi_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_null_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_plug_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_rate_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_route_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_share_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_shm_open_dlsym_pcm_001, 4) +//DATAB(__snd_pcm_softvol_open_dlsym_pcm_001, 4) +//DATAB(__snd_rawmidi_hw_open_dlsym_rawmidi_001, 4) +//DATAB(__snd_rawmidi_virtual_open_dlsym_rawmidi_001, 4) +//DATAB(__snd_seq_hw_open_dlsym_seq_001, 4) +//DATAB(__snd_timer_hw_open_dlsym_timer_001, 4) +//DATAB(__snd_timer_query_hw_open_dlsym_timer_query_001, 4) + +GO(snd_asoundlib_version, pFv) +//GOM(snd_dlopen, pFEpipL) +//GOM(snd_dlsym, pFEppp) +//GOM(snd_dlclose, iFEp) +//GOM(snd_async_add_handler, iFEbp_ipp) +GO(snd_async_del_handler, iFp) +GO(snd_async_handler_get_fd, iFp) +GO(snd_async_handler_get_signo, iFp) +GO(snd_async_handler_get_callback_private, pFp) +GO(snd_shm_area_create, pFip) +GO(snd_shm_area_share, pFp) +GO(snd_shm_area_destroy, iFp) +GO(snd_user_file, iFpbp_) +GO(snd_input_stdio_open, iFbp_pp) +GO(snd_input_stdio_attach, iFbp_Si) +GO(snd_input_buffer_open, iFbp_pl) +GO(snd_input_close, iFp) +//GOM(snd_input_scanf, iFEppV) +GO(snd_input_gets, pFppL) +GO(snd_input_getc, iFp) +GO(snd_input_ungetc, iFpi) +GO(snd_output_stdio_open, iFbp_pp) +GO(snd_output_stdio_attach, iFbp_Si) +GO(snd_output_buffer_open, iFbp_) +GO(snd_output_buffer_string, LFpbp_) +GO(snd_output_close, iFp) +//GOM(snd_output_printf, iFEppV) +//GOM(snd_output_vprintf, iFEppp) +GO(snd_output_puts, iFpp) +GO(snd_output_putc, iFpi) +GO(snd_output_flush, iFp) +GO(snd_strerror, pFi) +//GOM(snd_lib_error_set_handler, iFEp) +GO(snd_config_top, iFbp_) +GO(snd_config_load, iFpp) +GO(snd_config_load_override, iFpp) +GO(snd_config_save, iFpp) +GO(snd_config_update, iFv) +GO(snd_config_update_r, iFbp_bp_p) +GO(snd_config_update_free, iFp) +GO(snd_config_update_free_global, iFv) +GO(snd_config_search, iFppbp_) +//GOM(snd_config_searchv, iFEpbp_V) +GO(snd_config_search_definition, iFpppbp_) +GO(snd_config_expand, iFppppbp_) +GO(snd_config_evaluate, iFpppbp_) +GO(snd_config_add, iFpp) +GO(snd_config_delete, iFp) +GO(snd_config_delete_compound_members, iFp) +GO(snd_config_copy, iFbp_p) +GO(snd_config_make, iFbp_pu) +GO(snd_config_make_integer, iFbp_p) +GO(snd_config_make_integer64, iFbp_p) +GO(snd_config_make_real, iFbp_p) +GO(snd_config_make_string, iFbp_p) +GO(snd_config_make_pointer, iFbp_p) +GO(snd_config_make_compound, iFbp_pi) +GO(snd_config_imake_integer, iFbp_pl) +GO(snd_config_imake_integer64, iFbp_pI) +GO(snd_config_imake_real, iFbp_pd) +GO(snd_config_imake_string, iFbp_pp) +GO(snd_config_imake_pointer, iFbp_pp) +GO(snd_config_get_type, uFp) +GO(snd_config_set_id, iFpp) +GO(snd_config_set_integer, iFpl) +GO(snd_config_set_integer64, iFpI) +GO(snd_config_set_real, iFpd) +GO(snd_config_set_string, iFpp) +GO(snd_config_set_ascii, iFpp) +GO(snd_config_set_pointer, iFpp) +GO(snd_config_get_id, iFpbp_) +GO(snd_config_get_integer, iFpbl_) +GO(snd_config_get_integer64, iFpp) +GO(snd_config_get_real, iFpp) +GO(snd_config_get_ireal, iFpp) +GO(snd_config_get_string, iFpbp_) +GO(snd_config_get_ascii, iFpbp_) +GO(snd_config_get_pointer, iFpbp_) +GO(snd_config_test_id, iFpp) +GO(snd_config_iterator_first, pFp) +GO(snd_config_iterator_next, pFp) +GO(snd_config_iterator_end, pFp) +GO(snd_config_iterator_entry, pFp) +GO(snd_config_get_bool_ascii, iFp) +GO(snd_config_get_bool, iFp) +GO(snd_config_get_ctl_iface_ascii, iFp) +GO(snd_config_get_ctl_iface, iFp) +GOM(snd_device_name_free_hint, iFEp) +GO(snd_device_name_get_hint, pFpp) +GOM(snd_device_name_hint, iFEipp) +//GOM(snd_names_list, iFEpbp_) +//GOM(snd_names_list_free, vFEp) +GO(snd_pcm_format_mask_sizeof, LFv) +GO(snd_pcm_subformat_mask_sizeof, LFv) +GO(snd_pcm_status_sizeof, LFv) +//GOM(snd_async_add_pcm_handler, iFEbp_ppp) +GO(snd_async_handler_get_pcm, pFp) +GO(snd_pcm_access_mask_any, vFp) +GO(snd_pcm_access_mask_copy, vFpp) +GO(snd_pcm_access_mask_empty, iFp) +GO(snd_pcm_access_mask_free, vFp) +GO(snd_pcm_access_mask_malloc, iFbp_) +GO(snd_pcm_access_mask_none, vFp) +GO(snd_pcm_access_mask_reset, vFpu) +GO(snd_pcm_access_mask_set, vFpu) +GO(snd_pcm_access_mask_test, iFpu) +GO(snd_pcm_access_name, pFu) +GO(snd_pcm_area_copy, iFrpuu_Lrpuu_Lui) +GO(snd_pcm_area_silence, iFrpuu_Lui) +//GO(snd_pcm_areas_copy, iFbpuu_Lbpuu_LuLi) // it's arrays, 1 per channel, not simple pointers +//GO(snd_pcm_areas_silence, iFbpuu_LuLi) // same +GO(snd_pcm_avail, lFp) +GO(snd_pcm_avail_delay, iFpbl_bl_) +GO(snd_pcm_avail_update, lFp) +GO(snd_pcm_build_linear_format, iFiiii) +GO(snd_pcm_bytes_to_frames, lFpl) +GO(snd_pcm_bytes_to_samples, lFpl) +GO(snd_pcm_chmap_type_name, pFu) +GO(snd_pcm_chmap_name, pFu) +GO(snd_pcm_chmap_long_name, pFu) +GO(snd_pcm_chmap_print, iFpLp) +GO(snd_pcm_chmap_from_string, uFp) +GO(snd_pcm_chmap_parse_string, pFp) +GO(snd_pcm_close, iFp) +GO(snd_pcm_delay, iFpBL_) +GO(snd_pcm_drain, iFp) +GO(snd_pcm_drop, iFp) +GO(snd_pcm_dump, iFpp) +GO(snd_pcm_dump_hw_setup, iFpp) +GO(snd_pcm_dump_setup, iFpp) +GO(snd_pcm_dump_sw_setup, iFpp) +GO(snd_pcm_format_big_endian, iFi) +GO(snd_pcm_format_cpu_endian, iFi) +GO(snd_pcm_format_description, pFi) +GO(snd_pcm_format_float, iFi) +GO(snd_pcm_format_linear, iFi) +GO(snd_pcm_format_little_endian, iFi) +GO(snd_pcm_format_mask_any, vFp) +GO(snd_pcm_format_mask_copy, vFpp) +GO(snd_pcm_format_mask_empty, iFp) +GO(snd_pcm_format_mask_free, vFp) +GO(snd_pcm_format_mask_malloc, iFbp_) +GO(snd_pcm_format_mask_none, vFp) +GO(snd_pcm_format_mask_reset, vFpi) +GO(snd_pcm_format_mask_set, vFpi) +GO(snd_pcm_format_mask_test, iFpi) +GO(snd_pcm_format_name, pFi) +GO(snd_pcm_format_physical_width, iFi) +GO(snd_pcm_format_set_silence, iFipu) +GO(snd_pcm_format_signed, iFi) +GO(snd_pcm_format_silence, CFi) +GO(snd_pcm_format_silence_16, WFi) +GO(snd_pcm_format_silence_32, uFi) +GO(snd_pcm_format_silence_64, UFi) +GO(snd_pcm_format_size, lFiL) +GO(snd_pcm_format_unsigned, iFi) +GO(snd_pcm_format_value, iFp) +GO(snd_pcm_format_width, iFi) +GO(snd_pcm_forward, lFpL) +GO(snd_pcm_frames_to_bytes, lFpl) +GO(snd_pcm_get_params, iFpbL_bL_) +GO(snd_pcm_get_chmap, pFp) +//GOM(snd_pcm_hook_add, iFEbp_pupp) +GO(snd_pcm_hook_get_pcm, pFp) +GO(snd_pcm_hook_get_private, pFp) +GO(snd_pcm_hook_remove, iFp) +GO(snd_pcm_hook_set_private, vFpp) +GO(snd_pcm_hw_free, iFp) +GO(snd_pcm_hw_params, iFpp) +GO(snd_pcm_hw_params_any, iFpp) +GO(snd_pcm_hw_params_can_mmap_sample_resolution, iFp) +GO(snd_pcm_hw_params_can_overrange, iFp) +GO(snd_pcm_hw_params_can_pause, iFp) +GO(snd_pcm_hw_params_can_resume, iFp) +GO(snd_pcm_hw_params_can_sync_start, iFp) +GO(snd_pcm_hw_params_copy, vFpp) +GO(snd_pcm_hw_params_current, iFpp) +GO(snd_pcm_hw_params_dump, iFpp) +GO(snd_pcm_hw_params_free, vFp) +GO(snd_pcm_hw_params_get_access, iFpp) +GO(snd_pcm_hw_params_get_access_mask, iFpp) +GO(snd_pcm_hw_params_get_buffer_size, iFpBL_) +GO(snd_pcm_hw_params_get_buffer_size_max, iFpBL_) +GO(snd_pcm_hw_params_get_buffer_size_min, iFpBL_) +GO(snd_pcm_hw_params_get_buffer_time, iFppp) +GO(snd_pcm_hw_params_get_buffer_time_max, iFppp) +GO(snd_pcm_hw_params_get_buffer_time_min, iFppp) +GO(snd_pcm_hw_params_get_channels, iFpp) +GO(snd_pcm_hw_params_get_channels_max, iFpp) +GO(snd_pcm_hw_params_get_channels_min, iFpp) +GO(snd_pcm_hw_params_get_export_buffer, iFppp) +GO(snd_pcm_hw_params_get_fifo_size, iFp) +GO(snd_pcm_hw_params_get_format, iFpp) +GO(snd_pcm_hw_params_get_format_mask, vFpp) +GO(snd_pcm_hw_params_get_min_align, iFpBL_) +GO(snd_pcm_hw_params_get_period_size, iFpbL_p) +GO(snd_pcm_hw_params_get_period_size_max, iFpbL_p) +GO(snd_pcm_hw_params_get_period_size_min, iFpbL_p) +GO(snd_pcm_hw_params_get_period_time, iFppp) +GO(snd_pcm_hw_params_get_period_time_max, iFppp) +GO(snd_pcm_hw_params_get_period_time_min, iFppp) +GO(snd_pcm_hw_params_get_periods, iFppp) +GO(snd_pcm_hw_params_get_periods_max, iFppp) +GO(snd_pcm_hw_params_get_periods_min, iFppp) +GO(snd_pcm_hw_params_get_rate, iFppp) +GO(snd_pcm_hw_params_get_rate_max, iFppp) +GO(snd_pcm_hw_params_get_rate_min, iFppp) +GO(snd_pcm_hw_params_get_rate_numden, iFppp) +GO(snd_pcm_hw_params_get_rate_resample, iFppp) +GO(snd_pcm_hw_params_get_sbits, iFp) +GO(snd_pcm_hw_params_get_subformat, iFpp) +GO(snd_pcm_hw_params_get_subformat_mask, vFpp) +GO(snd_pcm_hw_params_get_tick_time, iFppp) +GO(snd_pcm_hw_params_get_tick_time_max, iFppp) +GO(snd_pcm_hw_params_get_tick_time_min, iFppp) +GO(snd_pcm_hw_params_is_batch, iFp) +GO(snd_pcm_hw_params_is_block_transfer, iFp) +GO(snd_pcm_hw_params_is_double, iFp) +GO(snd_pcm_hw_params_is_half_duplex, iFp) +GO(snd_pcm_hw_params_is_joint_duplex, iFp) +GO(snd_pcm_hw_params_malloc, iFBp_) +GO(snd_pcm_hw_params_set_access, iFppu) +GO(snd_pcm_hw_params_set_access_first, iFppp) +GO(snd_pcm_hw_params_set_access_last, iFppp) +GO(snd_pcm_hw_params_set_access_mask, iFppp) +GO(snd_pcm_hw_params_set_buffer_size, iFppL) +GO(snd_pcm_hw_params_set_buffer_size_first, iFppbL_) +GO(snd_pcm_hw_params_set_buffer_size_last, iFppbL_) +GO(snd_pcm_hw_params_set_buffer_size_max, iFppbL_) +GO(snd_pcm_hw_params_set_buffer_size_min, iFppbL_) +GO(snd_pcm_hw_params_set_buffer_size_minmax, iFppbL_bL_) +GO(snd_pcm_hw_params_set_buffer_size_near, iFppbL_) +GO(snd_pcm_hw_params_set_buffer_time, iFppui) +GO(snd_pcm_hw_params_set_buffer_time_first, iFpppp) +GO(snd_pcm_hw_params_set_buffer_time_last, iFpppp) +GO(snd_pcm_hw_params_set_buffer_time_max, iFpppp) +GO(snd_pcm_hw_params_set_buffer_time_min, iFpppp) +GO(snd_pcm_hw_params_set_buffer_time_minmax, iFpppppp) +GO(snd_pcm_hw_params_set_buffer_time_near, iFpppp) +GO(snd_pcm_hw_params_set_channels, iFppu) +GO(snd_pcm_hw_params_set_channels_first, iFppp) +GO(snd_pcm_hw_params_set_channels_last, iFppp) +GO(snd_pcm_hw_params_set_channels_max, iFppp) +GO(snd_pcm_hw_params_set_channels_min, iFppp) +GO(snd_pcm_hw_params_set_channels_minmax, iFpppp) +GO(snd_pcm_hw_params_set_channels_near, iFppp) +GO(snd_pcm_hw_params_set_export_buffer, iFppu) +GO(snd_pcm_hw_params_set_format, iFppi) +GO(snd_pcm_hw_params_set_format_first, iFppp) +GO(snd_pcm_hw_params_set_format_last, iFppp) +GO(snd_pcm_hw_params_set_format_mask, iFppp) +GO(snd_pcm_hw_params_set_period_size, iFppLi) +GO(snd_pcm_hw_params_set_period_size_first, iFppbL_p) +GO(snd_pcm_hw_params_set_period_size_integer, iFpp) +GO(snd_pcm_hw_params_set_period_size_last, iFppbL_p) +GO(snd_pcm_hw_params_set_period_size_max, iFppbL_p) +GO(snd_pcm_hw_params_set_period_size_min, iFppbL_p) +GO(snd_pcm_hw_params_set_period_size_minmax, iFppbL_pbL_p) +GO(snd_pcm_hw_params_set_period_size_near, iFppbL_p) +GO(snd_pcm_hw_params_set_period_time, iFppui) +GO(snd_pcm_hw_params_set_period_time_first, iFpppp) +GO(snd_pcm_hw_params_set_period_time_last, iFpppp) +GO(snd_pcm_hw_params_set_period_time_max, iFpppp) +GO(snd_pcm_hw_params_set_period_time_min, iFpppp) +GO(snd_pcm_hw_params_set_period_time_minmax, iFpppppp) +GO(snd_pcm_hw_params_set_period_time_near, iFpppp) +GO(snd_pcm_hw_params_set_periods, iFppui) +GO(snd_pcm_hw_params_set_periods_first, iFpppp) +GO(snd_pcm_hw_params_set_periods_integer, iFpp) +GO(snd_pcm_hw_params_set_periods_last, iFpppp) +GO(snd_pcm_hw_params_set_periods_max, iFpppp) +GO(snd_pcm_hw_params_set_periods_min, iFpppp) +GO(snd_pcm_hw_params_set_periods_minmax, iFpppppp) +GO(snd_pcm_hw_params_set_periods_near, iFpppp) +GO(snd_pcm_hw_params_set_rate, iFppui) +GO(snd_pcm_hw_params_set_rate_first, iFpppp) +GO(snd_pcm_hw_params_set_rate_last, iFpppp) +GO(snd_pcm_hw_params_set_rate_max, iFpppp) +GO(snd_pcm_hw_params_set_rate_min, iFpppp) +GO(snd_pcm_hw_params_set_rate_minmax, iFpppppp) +GO(snd_pcm_hw_params_set_rate_near, iFpppp) +GO(snd_pcm_hw_params_set_rate_resample, iFppu) +GO(snd_pcm_hw_params_set_subformat, iFppi) +GO(snd_pcm_hw_params_set_subformat_first, iFppp) +GO(snd_pcm_hw_params_set_subformat_last, iFppp) +GO(snd_pcm_hw_params_set_subformat_mask, iFppp) +GO(snd_pcm_hw_params_set_tick_time, iFppui) +GO(snd_pcm_hw_params_set_tick_time_first, iFpppp) +GO(snd_pcm_hw_params_set_tick_time_last, iFpppp) +GO(snd_pcm_hw_params_set_tick_time_max, iFpppp) +GO(snd_pcm_hw_params_set_tick_time_min, iFpppp) +GO(snd_pcm_hw_params_set_tick_time_minmax, iFpppppp) +GO(snd_pcm_hw_params_set_tick_time_near, iFpppp) +GO(snd_pcm_hw_params_test_access, iFppu) +GO(snd_pcm_hw_params_test_buffer_size, iFppL) +GO(snd_pcm_hw_params_test_buffer_time, iFppui) +GO(snd_pcm_hw_params_test_channels, iFppu) +GO(snd_pcm_hw_params_test_format, iFppi) +GO(snd_pcm_hw_params_test_period_size, iFppLi) +GO(snd_pcm_hw_params_test_period_time, iFppui) +GO(snd_pcm_hw_params_test_periods, iFppui) +GO(snd_pcm_hw_params_test_rate, iFppui) +GO(snd_pcm_hw_params_test_subformat, iFppi) +GO(snd_pcm_hw_params_test_tick_time, iFppui) +GO(snd_pcm_hwsync, iFp) +GO(snd_pcm_info, iFpp) +GO(snd_pcm_info_copy, vFpp) +GO(snd_pcm_info_free, vFp) +GO(snd_pcm_info_get_card, iFp) +GO(snd_pcm_info_get_class, uFp) +GO(snd_pcm_info_get_device, uFp) +GO(snd_pcm_info_get_id, pFp) +GO(snd_pcm_info_get_name, pFp) +GO(snd_pcm_info_get_stream, uFp) +GO(snd_pcm_info_get_subclass, uFp) +GO(snd_pcm_info_get_subdevice, uFp) +GO(snd_pcm_info_get_subdevice_name, pFp) +GO(snd_pcm_info_get_subdevices_avail, uFp) +GO(snd_pcm_info_get_subdevices_count, uFp) +//GOS(snd_pcm_info_get_sync, pFpp) +GO(snd_pcm_info_malloc, iFBp_) +GO(snd_pcm_info_sizeof, LFv) +GO(snd_pcm_access_mask_sizeof, LFv) +GO(snd_pcm_info_set_device, vFpu) +GO(snd_pcm_info_set_stream, vFpu) +GO(snd_pcm_info_set_subdevice, vFpu) +GO(snd_pcm_link, iFpp) +GO(snd_pcm_meter_add_scope, iFpp) +GO(snd_pcm_meter_get_boundary, LFp) +GO(snd_pcm_meter_get_bufsize, LFp) +GO(snd_pcm_meter_get_channels, uFp) +GO(snd_pcm_meter_get_now, LFp) +GO(snd_pcm_meter_get_rate, uFp) +GO(snd_pcm_meter_search_scope, pFpp) +GOM(snd_pcm_mmap_begin, iFEpppp) +GO(snd_pcm_mmap_commit, lFpLL) +GO(snd_pcm_mmap_readi, lFppL) +GO(snd_pcm_mmap_readn, lFpbp_L) +GO(snd_pcm_mmap_writei, lFppL) +GO(snd_pcm_mmap_writen, lFpbp_L) +GO(snd_pcm_name, pFp) +GO(snd_pcm_nonblock, iFpi) +GO(snd_pcm_open, iFBp_pui) +GO(snd_pcm_open_lconf, iFbp_puip) +GO(snd_pcm_pause, iFpi) +GO(snd_pcm_poll_descriptors, iFppu) +GO(snd_pcm_poll_descriptors_count, iFp) +GO(snd_pcm_poll_descriptors_revents, iFppup) +GO(snd_pcm_prepare, iFp) +GO(snd_pcm_readi, lFppL) +GO(snd_pcm_readn, lFpbp_L) +GO(snd_pcm_recover, iFpii) +GO(snd_pcm_reset, iFp) +GO(snd_pcm_resume, iFp) +GO(snd_pcm_rewind, lFpL) +GO(snd_pcm_samples_to_bytes, lFpl) +//GOM(snd_pcm_scope_get_callback_private, pFEp) +GO(snd_pcm_scope_get_name, pFp) +GO(snd_pcm_scope_malloc, iFBp_) +GO(snd_pcm_scope_s16_get_channel_buffer, pFpu) +GO(snd_pcm_scope_s16_open, iFppbp_) +//GOM(snd_pcm_scope_set_callback_private, vFEpp) +GO(snd_pcm_hw_params_sizeof, LFv) +GO(snd_pcm_sw_params_sizeof, LFv) +GO(snd_pcm_hw_params_is_monotonic, iFp) +GO(snd_pcm_scope_set_name, vFpp) +//GOM(snd_pcm_scope_set_ops, vFEpbppppppp_) +GO(snd_pcm_set_chmap, iFpp) +GO(snd_pcm_set_params, iFpiuuuiu) +GO(snd_pcm_start, iFp) +GO(snd_pcm_start_mode_name, pFu) +GO(snd_pcm_state, uFp) +GO(snd_pcm_state_name, pFu) +GO(snd_pcm_status, iFpp) +GO(snd_pcm_status_copy, vFpp) +GO(snd_pcm_status_dump, iFpp) +GO(snd_pcm_status_free, vFp) +GO(snd_pcm_status_get_avail, LFp) +GO(snd_pcm_status_get_avail_max, LFp) +GO(snd_pcm_status_get_delay, lFp) +//GO(snd_pcm_status_get_htstamp, vFpp) +GO(snd_pcm_status_get_overrange, LFp) +GO(snd_pcm_status_get_state, uFp) +//GO(snd_pcm_status_get_trigger_htstamp, vFpp) +//GO(snd_pcm_status_get_trigger_tstamp, vFpp) +//GO(snd_pcm_status_get_tstamp, vFpp) +GO(snd_pcm_status_malloc, iFbp_) +GO(snd_pcm_stream, uFp) +GO(snd_pcm_stream_name, pFu) +GO(snd_pcm_subformat_description, pFi) +GO(snd_pcm_subformat_mask_any, vFp) +GO(snd_pcm_subformat_mask_copy, vFpp) +GO(snd_pcm_subformat_mask_empty, iFp) +GO(snd_pcm_subformat_mask_free, vFp) +GO(snd_pcm_subformat_mask_malloc, iFbp_) +GO(snd_pcm_subformat_mask_none, vFp) +GO(snd_pcm_subformat_mask_reset, vFpi) +GO(snd_pcm_subformat_mask_set, vFpi) +GO(snd_pcm_subformat_mask_test, iFpi) +GO(snd_pcm_subformat_name, pFi) +GO(snd_pcm_sw_params, iFpp) +GO(snd_pcm_sw_params_copy, vFpp) +GO(snd_pcm_sw_params_current, iFpp) +GO(snd_pcm_sw_params_dump, iFpp) +GO(snd_pcm_sw_params_free, vFp) +GO(snd_pcm_sw_params_get_avail_min, iFpbL_) +GO(snd_pcm_sw_params_get_boundary, iFpbL_) +GO(snd_pcm_sw_params_get_silence_size, iFpbL_) +GO(snd_pcm_sw_params_get_silence_threshold, iFpbL_) +GO(snd_pcm_sw_params_get_sleep_min, iFpp) +GO(snd_pcm_sw_params_get_start_mode, uFp) +GO(snd_pcm_sw_params_get_start_threshold, iFpbL_) +GO(snd_pcm_sw_params_get_stop_threshold, iFpbL_) +GO(snd_pcm_sw_params_get_tstamp_mode, iFpp) +GO(snd_pcm_sw_params_get_xfer_align, iFpbL_) +GO(snd_pcm_sw_params_get_xrun_mode, uFp) +GO(snd_pcm_sw_params_malloc, iFbp_) +GO(snd_pcm_sw_params_set_avail_min, iFppL) +GO(snd_pcm_sw_params_set_period_event, iFppi) +GO(snd_pcm_sw_params_set_silence_size, iFppL) +GO(snd_pcm_sw_params_set_silence_threshold, iFppL) +GO(snd_pcm_sw_params_set_sleep_min, iFppu) +GO(snd_pcm_sw_params_set_start_mode, iFppu) +GO(snd_pcm_sw_params_set_start_threshold, iFppL) +GO(snd_pcm_sw_params_set_stop_threshold, iFppL) +GO(snd_pcm_sw_params_set_tstamp_mode, iFppu) +GO(snd_pcm_sw_params_set_tstamp_type, iFppu) +GO(snd_pcm_sw_params_set_xfer_align, iFppL) +GO(snd_pcm_sw_params_set_xrun_mode, iFppu) +GO(snd_pcm_tstamp_mode_name, pFu) +GO(snd_pcm_type, uFp) +GO(snd_pcm_type_name, pFu) +GO(snd_pcm_unlink, iFp) +GO(snd_pcm_wait, iFpi) +GO(snd_pcm_writei, lFppL) +GO(snd_pcm_writen, lFpbp_L) +GO(snd_pcm_xrun_mode_name, pFu) +GO(snd_spcm_init, iFpuuiiuuu) +GO(snd_spcm_init_duplex, iFppuuiiuuuu) +GO(snd_spcm_init_get_params, iFppbL_bL_) +GO(snd_rawmidi_open, iFbp_bp_pi) +GO(snd_rawmidi_open_lconf, iFbp_bp_pip) +GO(snd_rawmidi_close, iFp) +GO(snd_rawmidi_poll_descriptors_count, iFp) +GO(snd_rawmidi_poll_descriptors, iFppu) +GO(snd_rawmidi_poll_descriptors_revents, iFppup) +GO(snd_rawmidi_nonblock, iFpi) +GO(snd_rawmidi_info_sizeof, LFv) +GO(snd_rawmidi_info_malloc, iFbp_) +GO(snd_rawmidi_info_free, vFp) +GO(snd_rawmidi_info_copy, vFpp) +GO(snd_rawmidi_info_get_device, uFp) +GO(snd_rawmidi_info_get_subdevice, uFp) +GO(snd_rawmidi_info_get_stream, uFp) +GO(snd_rawmidi_info_get_card, iFp) +GO(snd_rawmidi_info_get_flags, uFp) +GO(snd_rawmidi_info_get_id, pFp) +GO(snd_rawmidi_info_get_name, pFp) +GO(snd_rawmidi_info_get_subdevice_name, pFp) +GO(snd_rawmidi_info_get_subdevices_count, uFp) +GO(snd_rawmidi_info_get_subdevices_avail, uFp) +GO(snd_rawmidi_info_set_device, vFpu) +GO(snd_rawmidi_info_set_subdevice, vFpu) +GO(snd_rawmidi_info_set_stream, vFpu) +GO(snd_rawmidi_info, iFpp) +GO(snd_rawmidi_params_sizeof, LFv) +GO(snd_rawmidi_params_malloc, iFbp_) +GO(snd_rawmidi_params_free, vFp) +GO(snd_rawmidi_params_copy, vFpp) +GO(snd_rawmidi_params_set_buffer_size, iFppL) +GO(snd_rawmidi_params_get_buffer_size, LFp) +GO(snd_rawmidi_params_set_avail_min, iFppL) +GO(snd_rawmidi_params_get_avail_min, LFp) +GO(snd_rawmidi_params_set_no_active_sensing, iFppi) +GO(snd_rawmidi_params_get_no_active_sensing, iFp) +GO(snd_rawmidi_params, iFpp) +GO(snd_rawmidi_params_current, iFpp) +GO(snd_rawmidi_status_sizeof, LFv) +GO(snd_rawmidi_status_malloc, iFbp_) +GO(snd_rawmidi_status_free, vFp) +GO(snd_rawmidi_status_copy, vFpp) +//GO(snd_rawmidi_status_get_tstamp, vFpp) +GO(snd_rawmidi_status_get_avail, LFp) +GO(snd_rawmidi_status_get_xruns, LFp) +GO(snd_rawmidi_status, iFpp) +GO(snd_rawmidi_drain, iFp) +GO(snd_rawmidi_drop, iFp) +GO(snd_rawmidi_write, lFppL) +GO(snd_rawmidi_read, lFppL) +GO(snd_rawmidi_name, pFp) +GO(snd_rawmidi_type, uFp) +GO(snd_rawmidi_stream, uFp) +GO(snd_timer_query_open, iFbp_pi) +GO(snd_timer_query_open_lconf, iFbp_pip) +GO(snd_timer_query_close, iFp) +GO(snd_timer_query_next_device, iFpp) +GO(snd_timer_query_info, iFpp) +GO(snd_timer_query_params, iFpp) +GO(snd_timer_query_status, iFpp) +GO(snd_timer_open, iFbp_pi) +GO(snd_timer_open_lconf, iFbp_pip) +GO(snd_timer_close, iFp) +//GOM(snd_async_add_timer_handler, iFEbp_ppp) +GO(snd_async_handler_get_timer, pFp) +GO(snd_timer_poll_descriptors_count, iFp) +GO(snd_timer_poll_descriptors, iFppu) +GO(snd_timer_poll_descriptors_revents, iFppup) +GO(snd_timer_info, iFpp) +GO(snd_timer_params, iFpp) +GO(snd_timer_status, iFpp) +GO(snd_timer_start, iFp) +GO(snd_timer_stop, iFp) +GO(snd_timer_continue, iFp) +GO(snd_timer_read, lFppL) +GO(snd_timer_id_sizeof, LFv) +GO(snd_timer_id_malloc, iFbp_) +GO(snd_timer_id_free, vFp) +GO(snd_timer_id_copy, vFpp) +GO(snd_timer_id_set_class, vFpi) +GO(snd_timer_id_get_class, iFp) +GO(snd_timer_id_set_sclass, vFpi) +GO(snd_timer_id_get_sclass, iFp) +GO(snd_timer_id_set_card, vFpi) +GO(snd_timer_id_get_card, iFp) +GO(snd_timer_id_set_device, vFpi) +GO(snd_timer_id_get_device, iFp) +GO(snd_timer_id_set_subdevice, vFpi) +GO(snd_timer_id_get_subdevice, iFp) +GO(snd_timer_ginfo_sizeof, LFv) +GO(snd_timer_ginfo_malloc, iFbp_) +GO(snd_timer_ginfo_free, vFp) +GO(snd_timer_ginfo_copy, vFpp) +GO(snd_timer_ginfo_set_tid, iFpp) +GO(snd_timer_ginfo_get_tid, pFp) +GO(snd_timer_ginfo_get_flags, uFp) +GO(snd_timer_ginfo_get_card, iFp) +GO(snd_timer_ginfo_get_id, pFp) +GO(snd_timer_ginfo_get_name, pFp) +GO(snd_timer_ginfo_get_resolution, LFp) +GO(snd_timer_ginfo_get_resolution_min, LFp) +GO(snd_timer_ginfo_get_resolution_max, LFp) +GO(snd_timer_ginfo_get_clients, uFp) +GO(snd_timer_info_sizeof, LFv) +GO(snd_timer_info_malloc, iFbp_) +GO(snd_timer_info_free, vFp) +GO(snd_timer_info_copy, vFpp) +GO(snd_timer_info_is_slave, iFp) +GO(snd_timer_info_get_card, iFp) +GO(snd_timer_info_get_id, pFp) +GO(snd_timer_info_get_name, pFp) +GO(snd_timer_info_get_resolution, lFp) +GO(snd_timer_params_sizeof, LFv) +GO(snd_timer_params_malloc, iFbp_) +GO(snd_timer_params_free, vFp) +GO(snd_timer_params_copy, vFpp) +GO(snd_timer_params_set_auto_start, iFpi) +GO(snd_timer_params_get_auto_start, iFp) +GO(snd_timer_params_set_exclusive, iFpi) +GO(snd_timer_params_get_exclusive, iFp) +GO(snd_timer_params_set_early_event, iFpi) +GO(snd_timer_params_get_early_event, iFp) +GO(snd_timer_params_set_ticks, vFpl) +GO(snd_timer_params_get_ticks, lFp) +GO(snd_timer_params_set_queue_size, vFpl) +GO(snd_timer_params_get_queue_size, lFp) +GO(snd_timer_params_set_filter, vFpu) +GO(snd_timer_params_get_filter, uFp) +GO(snd_timer_status_sizeof, LFv) +GO(snd_timer_status_malloc, iFbp_) +GO(snd_timer_status_free, vFp) +GO(snd_timer_status_copy, vFpp) +//GOS(snd_timer_status_get_timestamp, pFpp) +GO(snd_timer_status_get_resolution, lFp) +GO(snd_timer_status_get_lost, lFp) +GO(snd_timer_status_get_overrun, lFp) +GO(snd_timer_status_get_queue, lFp) +GO(snd_timer_info_get_ticks, lFp) +GO(snd_hwdep_open, iFbp_pi) +GO(snd_hwdep_close, iFp) +GO(snd_hwdep_poll_descriptors, iFppu) +GO(snd_hwdep_poll_descriptors_revents, iFppup) +GO(snd_hwdep_nonblock, iFpi) +GO(snd_hwdep_info, iFpp) +GO(snd_hwdep_dsp_status, iFpp) +GO(snd_hwdep_dsp_load, iFpp) +GO(snd_hwdep_ioctl, iFpup) +GO(snd_hwdep_write, lFppL) +GO(snd_hwdep_read, lFppL) +GO(snd_hwdep_info_sizeof, LFv) +GO(snd_hwdep_dsp_status_sizeof, LFv) +GO(snd_hwdep_dsp_status_malloc, iFbp_) +GO(snd_hwdep_dsp_status_free, vFp) +GO(snd_hwdep_dsp_status_copy, vFpp) +GO(snd_hwdep_dsp_status_get_version, uFp) +GO(snd_hwdep_dsp_status_get_id, pFp) +GO(snd_hwdep_dsp_status_get_num_dsps, uFp) +GO(snd_hwdep_dsp_status_get_dsp_loaded, uFp) +GO(snd_hwdep_dsp_status_get_chip_ready, uFp) +GO(snd_hwdep_dsp_image_sizeof, LFv) +GO(snd_hwdep_dsp_image_malloc, iFbp_) +GO(snd_hwdep_dsp_image_free, vFp) +GO(snd_hwdep_dsp_image_copy, vFpp) +GO(snd_hwdep_dsp_image_get_index, uFp) +GO(snd_hwdep_dsp_image_get_name, pFp) +GO(snd_hwdep_dsp_image_get_image, pFp) +GO(snd_hwdep_dsp_image_get_length, LFp) +GO(snd_hwdep_dsp_image_set_index, vFpu) +GO(snd_hwdep_dsp_image_set_name, vFpp) +GO(snd_hwdep_dsp_image_set_image, vFpp) +GO(snd_hwdep_dsp_image_set_length, vFpL) +GO(snd_card_load, iFi) +GO(snd_card_next, iFp) +GO(snd_card_get_index, iFp) +GO(snd_card_get_name, iFibp_) +GO(snd_card_get_longname, iFibp_) +GO(snd_ctl_open, iFbp_pi) +GO(snd_ctl_open_lconf, iFbp_pip) +GO(snd_ctl_close, iFp) +GO(snd_ctl_nonblock, iFpi) +//GOM(snd_async_add_ctl_handler, iFEbp_ppp) +GO(snd_async_handler_get_ctl, pFp) +GO(snd_ctl_poll_descriptors_count, iFp) +GO(snd_ctl_poll_descriptors, iFppu) +GO(snd_ctl_poll_descriptors_revents, iFppup) +GO(snd_ctl_subscribe_events, iFpi) +GO(snd_ctl_card_info, iFpp) +GO(snd_ctl_elem_list, iFpp) +GO(snd_ctl_elem_info, iFpp) +GO(snd_ctl_elem_read, iFpp) +GO(snd_ctl_elem_write, iFpp) +GO(snd_ctl_elem_lock, iFpp) +GO(snd_ctl_elem_unlock, iFpp) +GO(snd_ctl_elem_tlv_read, iFpppu) +GO(snd_ctl_elem_tlv_write, iFppp) +GO(snd_ctl_elem_tlv_command, iFppp) +GO(snd_ctl_hwdep_next_device, iFpp) +GO(snd_ctl_hwdep_info, iFpp) +GO(snd_ctl_pcm_next_device, iFpp) +GO(snd_ctl_pcm_info, iFpp) +GO(snd_ctl_pcm_prefer_subdevice, iFpi) +GO(snd_ctl_rawmidi_next_device, iFpp) +GO(snd_ctl_rawmidi_info, iFpp) +GO(snd_ctl_rawmidi_prefer_subdevice, iFpi) +GO(snd_ctl_set_power_state, iFpu) +GO(snd_ctl_get_power_state, iFpp) +GO(snd_ctl_read, iFpp) +GO(snd_ctl_wait, iFpi) +GO(snd_ctl_name, pFp) +GO(snd_ctl_type, uFp) +GO(snd_ctl_elem_type_name, pFu) +GO(snd_ctl_elem_iface_name, pFu) +GO(snd_ctl_event_type_name, pFu) +GO(snd_ctl_event_elem_get_mask, uFp) +GO(snd_ctl_event_elem_get_numid, uFp) +GO(snd_ctl_event_elem_get_id, vFpp) +GO(snd_ctl_event_elem_get_interface, uFp) +GO(snd_ctl_event_elem_get_device, uFp) +GO(snd_ctl_event_elem_get_subdevice, uFp) +GO(snd_ctl_event_elem_get_name, pFp) +GO(snd_ctl_event_elem_get_index, uFp) +GO(snd_ctl_elem_list_alloc_space, iFpu) +GO(snd_ctl_elem_list_free_space, vFp) +GO(snd_ctl_elem_id_sizeof, LFv) +GO(snd_ctl_elem_id_malloc, iFbp_) +GO(snd_ctl_elem_id_free, vFp) +GO(snd_ctl_elem_id_clear, vFp) +GO(snd_ctl_elem_id_copy, vFpp) +GO(snd_ctl_elem_id_get_numid, uFp) +GO(snd_ctl_elem_id_get_interface, uFp) +GO(snd_ctl_elem_id_get_device, uFp) +GO(snd_ctl_elem_id_get_subdevice, uFp) +GO(snd_ctl_elem_id_get_name, pFp) +GO(snd_ctl_elem_id_get_index, uFp) +GO(snd_ctl_elem_id_set_numid, vFpu) +GO(snd_ctl_elem_id_set_interface, vFpu) +GO(snd_ctl_elem_id_set_device, vFpu) +GO(snd_ctl_elem_id_set_subdevice, vFpu) +GO(snd_ctl_elem_id_set_name, vFpp) +GO(snd_ctl_elem_id_set_index, vFpu) +GO(snd_ctl_card_info_sizeof, LFv) +GO(snd_ctl_card_info_malloc, iFBp_) +GO(snd_ctl_card_info_free, vFp) +GO(snd_ctl_card_info_clear, vFp) +GO(snd_ctl_card_info_copy, vFpp) +GO(snd_ctl_card_info_get_card, iFp) +GO(snd_ctl_card_info_get_id, pFp) +GO(snd_ctl_card_info_get_driver, pFp) +GO(snd_ctl_card_info_get_name, pFp) +GO(snd_ctl_card_info_get_longname, pFp) +GO(snd_ctl_card_info_get_mixername, pFp) +GO(snd_ctl_card_info_get_components, pFp) +GO(snd_ctl_event_sizeof, LFv) +GO(snd_ctl_event_malloc, iFbp_) +GO(snd_ctl_event_free, vFp) +GO(snd_ctl_event_clear, vFp) +GO(snd_ctl_event_copy, vFpp) +GO(snd_ctl_event_get_type, uFp) +GO(snd_ctl_elem_list_sizeof, LFv) +GO(snd_ctl_elem_list_malloc, iFbp_) +GO(snd_ctl_elem_list_free, vFp) +GO(snd_ctl_elem_list_clear, vFp) +GO(snd_ctl_elem_list_copy, vFpp) +GO(snd_ctl_elem_list_set_offset, vFpu) +GO(snd_ctl_elem_list_get_used, uFp) +GO(snd_ctl_elem_list_get_count, uFp) +GO(snd_ctl_elem_list_get_id, vFpup) +GO(snd_ctl_elem_list_get_numid, uFpu) +GO(snd_ctl_elem_list_get_interface, uFpu) +GO(snd_ctl_elem_list_get_device, uFpu) +GO(snd_ctl_elem_list_get_subdevice, uFpu) +GO(snd_ctl_elem_list_get_name, pFpu) +GO(snd_ctl_elem_list_get_index, uFpu) +GO(snd_ctl_elem_info_sizeof, LFv) +GO(snd_ctl_elem_info_malloc, iFbp_) +GO(snd_ctl_elem_info_free, vFp) +GO(snd_ctl_elem_info_clear, vFp) +GO(snd_ctl_elem_info_copy, vFpp) +GO(snd_ctl_elem_info_get_type, uFp) +GO(snd_ctl_elem_info_is_readable, iFp) +GO(snd_ctl_elem_info_is_writable, iFp) +GO(snd_ctl_elem_info_is_volatile, iFp) +GO(snd_ctl_elem_info_is_inactive, iFp) +GO(snd_ctl_elem_info_is_locked, iFp) +GO(snd_ctl_elem_info_is_tlv_readable, iFp) +GO(snd_ctl_elem_info_is_tlv_writable, iFp) +GO(snd_ctl_elem_info_is_tlv_commandable, iFp) +GO(snd_ctl_elem_info_is_owner, iFp) +GO(snd_ctl_elem_info_is_user, iFp) +GO(snd_ctl_elem_info_get_owner, iFp) +GO(snd_ctl_elem_info_get_count, uFp) +GO(snd_ctl_elem_info_get_min, lFp) +GO(snd_ctl_elem_info_get_max, lFp) +GO(snd_ctl_elem_info_get_step, lFp) +GO(snd_ctl_elem_info_get_min64, IFp) +GO(snd_ctl_elem_info_get_max64, IFp) +GO(snd_ctl_elem_info_get_step64, IFp) +GO(snd_ctl_elem_info_get_items, uFp) +GO(snd_ctl_elem_info_set_item, vFpu) +GO(snd_ctl_elem_info_get_item_name, pFp) +GO(snd_ctl_elem_info_get_dimensions, iFp) +GO(snd_ctl_elem_info_get_dimension, iFpu) +GO(snd_ctl_elem_info_get_id, vFpp) +GO(snd_ctl_elem_info_get_numid, uFp) +GO(snd_ctl_elem_info_get_interface, uFp) +GO(snd_ctl_elem_info_get_device, uFp) +GO(snd_ctl_elem_info_get_subdevice, uFp) +GO(snd_ctl_elem_info_get_name, pFp) +GO(snd_ctl_elem_info_get_index, uFp) +GO(snd_ctl_elem_info_set_id, vFpp) +GO(snd_ctl_elem_info_set_numid, vFpu) +GO(snd_ctl_elem_info_set_interface, vFpu) +GO(snd_ctl_elem_info_set_device, vFpu) +GO(snd_ctl_elem_info_set_subdevice, vFpu) +GO(snd_ctl_elem_info_set_name, vFpp) +GO(snd_ctl_elem_info_set_index, vFpu) +GO(snd_ctl_elem_add_integer, iFppulll) +GO(snd_ctl_elem_add_integer64, iFppuIII) +GO(snd_ctl_elem_add_boolean, iFppu) +GO(snd_ctl_elem_add_iec958, iFpp) +GO(snd_ctl_elem_remove, iFpp) +GO(snd_ctl_elem_value_sizeof, LFv) +GO(snd_ctl_elem_value_malloc, iFbp_) +GO(snd_ctl_elem_value_free, vFp) +GO(snd_ctl_elem_value_clear, vFp) +GO(snd_ctl_elem_value_copy, vFpp) +GO(snd_ctl_elem_value_get_id, vFpp) +GO(snd_ctl_elem_value_get_numid, uFp) +GO(snd_ctl_elem_value_get_interface, uFp) +GO(snd_ctl_elem_value_get_device, uFp) +GO(snd_ctl_elem_value_get_subdevice, uFp) +GO(snd_ctl_elem_value_get_name, pFp) +GO(snd_ctl_elem_value_get_index, uFp) +GO(snd_ctl_elem_value_set_id, vFpp) +GO(snd_ctl_elem_value_set_numid, vFpu) +GO(snd_ctl_elem_value_set_interface, vFpu) +GO(snd_ctl_elem_value_set_device, vFpu) +GO(snd_ctl_elem_value_set_subdevice, vFpu) +GO(snd_ctl_elem_value_set_name, vFpp) +GO(snd_ctl_elem_value_set_index, vFpu) +GO(snd_ctl_elem_value_get_boolean, iFpu) +GO(snd_ctl_elem_value_get_integer, lFpu) +GO(snd_ctl_elem_value_get_integer64, IFpu) +GO(snd_ctl_elem_value_get_enumerated, uFpu) +GO(snd_ctl_elem_value_get_byte, CFpu) +GO(snd_ctl_elem_value_set_boolean, vFpul) +GO(snd_ctl_elem_value_set_integer, vFpul) +GO(snd_ctl_elem_value_set_integer64, vFpuI) +GO(snd_ctl_elem_value_set_enumerated, vFpuu) +GO(snd_ctl_elem_value_set_byte, vFpuC) +GO(snd_ctl_elem_set_bytes, vFppL) +GO(snd_ctl_elem_value_get_bytes, pFp) +GO(snd_ctl_elem_value_get_iec958, vFpp) +GO(snd_ctl_elem_value_set_iec958, vFpp) +GO(snd_hctl_compare_fast, iFpp) +GO(snd_hctl_open, iFbp_pi) +GO(snd_hctl_open_ctl, iFbp_p) +GO(snd_hctl_close, iFp) +GO(snd_hctl_nonblock, iFpi) +GO(snd_hctl_poll_descriptors_count, iFp) +GO(snd_hctl_poll_descriptors, iFppu) +GO(snd_hctl_poll_descriptors_revents, iFppup) +GO(snd_hctl_get_count, uFp) +//GOM(snd_hctl_set_compare, iFEpp) +GO(snd_hctl_first_elem, pFp) +GO(snd_hctl_last_elem, pFp) +GO(snd_hctl_find_elem, pFpp) +//GOM(snd_hctl_set_callback, vFEpp) +GO(snd_hctl_set_callback_private, vFpp) +GO(snd_hctl_get_callback_private, pFp) +GO(snd_hctl_load, iFp) +GO(snd_hctl_free, iFp) +GO(snd_hctl_handle_events, iFp) +GO(snd_hctl_name, pFp) +GO(snd_hctl_wait, iFpi) +GO(snd_hctl_ctl, pFp) +GO(snd_hctl_elem_next, pFp) +GO(snd_hctl_elem_prev, pFp) +GO(snd_hctl_elem_info, iFpp) +GO(snd_hctl_elem_read, iFpp) +GO(snd_hctl_elem_write, iFpp) +GO(snd_hctl_elem_tlv_read, iFppu) +GO(snd_hctl_elem_tlv_write, iFpp) +GO(snd_hctl_elem_tlv_command, iFpp) +GO(snd_hctl_elem_get_hctl, pFp) +GO(snd_hctl_elem_get_id, vFpp) +GO(snd_hctl_elem_get_numid, uFp) +GO(snd_hctl_elem_get_interface, uFp) +GO(snd_hctl_elem_get_device, uFp) +GO(snd_hctl_elem_get_subdevice, uFp) +GO(snd_hctl_elem_get_name, pFp) +GO(snd_hctl_elem_get_index, uFp) +//GOM(snd_hctl_elem_set_callback, vFEpp) +GO(snd_hctl_elem_get_callback_private, pFp) +GO(snd_hctl_elem_set_callback_private, vFpp) +GO(snd_sctl_build, iFbp_pppi) +GO(snd_sctl_free, iFp) +GO(snd_sctl_install, iFp) +GO(snd_sctl_remove, iFp) +GO(snd_mixer_open, iFbp_i) +GO(snd_mixer_close, iFp) +GO(snd_mixer_first_elem, pFp) +GO(snd_mixer_last_elem, pFp) +GO(snd_mixer_handle_events, iFp) +GO(snd_mixer_attach, iFpp) +GO(snd_mixer_attach_hctl, iFpp) +GO(snd_mixer_detach, iFpp) +GO(snd_mixer_detach_hctl, iFpp) +GO(snd_mixer_get_hctl, iFppbp_) +GO(snd_mixer_poll_descriptors_count, iFp) +GO(snd_mixer_poll_descriptors, iFppu) +GO(snd_mixer_poll_descriptors_revents, iFppup) +GO(snd_mixer_load, iFp) +GO(snd_mixer_free, vFp) +GO(snd_mixer_wait, iFpi) +//GOM(snd_mixer_set_compare, iFEpp) +//GOM(snd_mixer_set_callback, vFEpp) +GO(snd_mixer_get_callback_private, pFp) +GO(snd_mixer_set_callback_private, vFpp) +GO(snd_mixer_get_count, uFp) +GO(snd_mixer_class_unregister, iFp) +GO(snd_mixer_elem_next, pFp) +GO(snd_mixer_elem_prev, pFp) +//GOM(snd_mixer_elem_set_callback, vFEpp) +GO(snd_mixer_elem_get_callback_private, pFp) +GO(snd_mixer_elem_set_callback_private, vFpp) +GO(snd_mixer_elem_get_type, uFp) +GO(snd_mixer_class_register, iFpp) +//GO(snd_mixer_add_elem, iFpp) +//GO(snd_mixer_remove_elem, iFpp) +//GOM(snd_mixer_elem_new, iFEbp_uipp) +GO(snd_mixer_elem_add, iFpp) +GO(snd_mixer_elem_remove, iFp) +GO(snd_mixer_elem_free, vFp) +GO(snd_mixer_elem_info, iFp) +GO(snd_mixer_elem_value, iFp) +GO(snd_mixer_elem_attach, iFpp) +GO(snd_mixer_elem_detach, iFpp) +GO(snd_mixer_elem_empty, iFp) +GO(snd_mixer_elem_get_private, pFp) +GO(snd_mixer_class_sizeof, LFv) +GO(snd_mixer_class_malloc, iFBp_) +GO(snd_mixer_class_free, vFp) +GO(snd_mixer_class_copy, vFpp) +GO(snd_mixer_class_get_mixer, pFp) +//GOM(snd_mixer_class_get_event, pFEp) +GO(snd_mixer_class_get_private, pFp) +//GOM(snd_mixer_class_get_compare, pFEp) +//GOM(snd_mixer_class_set_event, iFEpp) +GO(snd_mixer_class_set_private, iFpp) +//GOM(snd_mixer_class_set_private_free, iFEpp) +//GOM(snd_mixer_class_set_compare, iFEpp) +GO(snd_mixer_selem_channel_name, pFi) +//GO(snd_mixer_selem_register, iFpbiuppp_bp_) +GO(snd_mixer_selem_get_id, vFpp) +GO(snd_mixer_selem_get_name, pFp) +GO(snd_mixer_selem_get_index, uFp) +GO(snd_mixer_find_selem, pFpp) +GO(snd_mixer_selem_ask_playback_dB_vol, iFplibl_) +GO(snd_mixer_selem_ask_playback_vol_dB, iFplbl_) +GO(snd_mixer_selem_is_active, iFp) +GO(snd_mixer_selem_is_playback_mono, iFp) +GO(snd_mixer_selem_has_playback_channel, iFpi) +GO(snd_mixer_selem_is_capture_mono, iFp) +GO(snd_mixer_selem_has_capture_channel, iFpi) +GO(snd_mixer_selem_get_capture_group, iFp) +GO(snd_mixer_selem_has_common_volume, iFp) +GO(snd_mixer_selem_has_playback_volume, iFp) +GO(snd_mixer_selem_has_playback_volume_joined, iFp) +GO(snd_mixer_selem_has_capture_volume, iFp) +GO(snd_mixer_selem_has_capture_volume_joined, iFp) +GO(snd_mixer_selem_has_common_switch, iFp) +GO(snd_mixer_selem_has_playback_switch, iFp) +GO(snd_mixer_selem_has_playback_switch_joined, iFp) +GO(snd_mixer_selem_has_capture_switch, iFp) +GO(snd_mixer_selem_has_capture_switch_joined, iFp) +GO(snd_mixer_selem_has_capture_switch_exclusive, iFp) +GO(snd_mixer_selem_get_playback_volume, iFpibl_) +GO(snd_mixer_selem_get_capture_volume, iFpibl_) +GO(snd_mixer_selem_get_playback_dB, iFpibl_) +GO(snd_mixer_selem_get_capture_dB, iFpibl_) +GO(snd_mixer_selem_get_playback_switch, iFpip) +GO(snd_mixer_selem_get_capture_switch, iFpip) +GO(snd_mixer_selem_set_playback_volume, iFpil) +GO(snd_mixer_selem_set_capture_volume, iFpil) +GO(snd_mixer_selem_set_playback_dB, iFpili) +GO(snd_mixer_selem_set_capture_dB, iFpili) +GO(snd_mixer_selem_set_playback_volume_all, iFpl) +GO(snd_mixer_selem_set_capture_volume_all, iFpl) +GO(snd_mixer_selem_set_playback_dB_all, iFpli) +GO(snd_mixer_selem_set_capture_dB_all, iFpli) +GO(snd_mixer_selem_set_playback_switch, iFpii) +GO(snd_mixer_selem_set_capture_switch, iFpii) +GO(snd_mixer_selem_set_playback_switch_all, iFpi) +GO(snd_mixer_selem_set_capture_switch_all, iFpi) +GO(snd_mixer_selem_get_playback_volume_range, iFpbl_bl_) +GO(snd_mixer_selem_get_playback_dB_range, iFpbl_bl_) +GO(snd_mixer_selem_set_playback_volume_range, iFpll) +GO(snd_mixer_selem_get_capture_volume_range, iFpbl_bl_) +GO(snd_mixer_selem_get_capture_dB_range, iFpbl_bl_) +GO(snd_mixer_selem_set_capture_volume_range, iFpll) +GO(snd_mixer_selem_is_enumerated, iFp) +GO(snd_mixer_selem_is_enum_playback, iFp) +GO(snd_mixer_selem_is_enum_capture, iFp) +GO(snd_mixer_selem_get_enum_items, iFp) +GO(snd_mixer_selem_get_enum_item_name, iFpuLp) +GO(snd_mixer_selem_get_enum_item, iFpip) +GO(snd_mixer_selem_set_enum_item, iFpiu) +GO(snd_mixer_selem_id_sizeof, LFv) +GO(snd_mixer_selem_id_malloc, iFbp_) +GO(snd_mixer_selem_id_free, vFp) +GO(snd_mixer_selem_id_copy, vFpp) +GO(snd_mixer_selem_id_get_name, pFp) +GO(snd_mixer_selem_id_get_index, uFp) +GO(snd_mixer_selem_id_set_name, vFpp) +GO(snd_mixer_selem_id_set_index, vFpu) +GO(snd_seq_open, iFbp_pii) +GO(snd_seq_open_lconf, iFbp_piip) +GO(snd_seq_name, pFp) +GO(snd_seq_type, uFp) +GO(snd_seq_close, iFp) +GO(snd_seq_poll_descriptors_count, iFpw) +GO(snd_seq_poll_descriptors, iFppuw) +GO(snd_seq_poll_descriptors_revents, iFppup) +GO(snd_seq_nonblock, iFpi) +GO(snd_seq_client_id, iFp) +GO(snd_seq_get_output_buffer_size, LFp) +GO(snd_seq_get_input_buffer_size, LFp) +GO(snd_seq_set_output_buffer_size, iFpL) +GO(snd_seq_set_input_buffer_size, iFpL) +GO(snd_seq_system_info_sizeof, LFv) +GO(snd_seq_system_info_malloc, iFbp_) +GO(snd_seq_system_info_free, vFp) +GO(snd_seq_system_info_copy, vFpp) +GO(snd_seq_system_info_get_queues, iFp) +GO(snd_seq_system_info_get_clients, iFp) +GO(snd_seq_system_info_get_ports, iFp) +GO(snd_seq_system_info_get_channels, iFp) +GO(snd_seq_system_info_get_cur_clients, iFp) +GO(snd_seq_system_info_get_cur_queues, iFp) +GO(snd_seq_system_info, iFpp) +GO(snd_seq_client_info_sizeof, LFv) +GO(snd_seq_client_info_malloc, iFbp_) +GO(snd_seq_client_info_free, vFp) +GO(snd_seq_client_info_copy, vFpp) +GO(snd_seq_client_info_get_client, iFp) +GO(snd_seq_client_info_get_type, uFp) +GO(snd_seq_client_info_get_name, pFp) +GO(snd_seq_client_info_get_broadcast_filter, iFp) +GO(snd_seq_client_info_get_error_bounce, iFp) +GO(snd_seq_client_info_get_event_filter, pFp) +GO(snd_seq_client_info_get_num_ports, iFp) +GO(snd_seq_client_info_get_event_lost, iFp) +GO(snd_seq_client_info_set_client, vFpi) +GO(snd_seq_client_info_set_name, vFpp) +GO(snd_seq_client_info_set_broadcast_filter, vFpi) +GO(snd_seq_client_info_set_error_bounce, vFpi) +GO(snd_seq_client_info_set_event_filter, vFpp) +GO(snd_seq_get_client_info, iFpp) +GO(snd_seq_get_any_client_info, iFpip) +GO(snd_seq_set_client_info, iFpp) +GO(snd_seq_query_next_client, iFpp) +GO(snd_seq_client_pool_sizeof, LFv) +GO(snd_seq_client_pool_malloc, iFbp_) +GO(snd_seq_client_pool_free, vFp) +GO(snd_seq_client_pool_copy, vFpp) +GO(snd_seq_client_pool_get_client, iFp) +GO(snd_seq_client_pool_get_output_pool, LFp) +GO(snd_seq_client_pool_get_input_pool, LFp) +GO(snd_seq_client_pool_get_output_room, LFp) +GO(snd_seq_client_pool_get_output_free, LFp) +GO(snd_seq_client_pool_get_input_free, LFp) +GO(snd_seq_client_pool_set_output_pool, vFpL) +GO(snd_seq_client_pool_set_input_pool, vFpL) +GO(snd_seq_client_pool_set_output_room, vFpL) +GO(snd_seq_get_client_pool, iFpp) +GO(snd_seq_set_client_pool, iFpp) +GO(snd_seq_port_info_sizeof, LFv) +GO(snd_seq_port_info_malloc, iFbp_) +GO(snd_seq_port_info_free, vFp) +GO(snd_seq_port_info_copy, vFpp) +GO(snd_seq_port_info_get_client, iFp) +GO(snd_seq_port_info_get_port, iFp) +GO(snd_seq_port_info_get_addr, pFp) +GO(snd_seq_port_info_get_name, pFp) +GO(snd_seq_port_info_get_capability, uFp) +GO(snd_seq_port_info_get_type, uFp) +GO(snd_seq_port_info_get_midi_channels, iFp) +GO(snd_seq_port_info_get_midi_voices, iFp) +GO(snd_seq_port_info_get_synth_voices, iFp) +GO(snd_seq_port_info_get_read_use, iFp) +GO(snd_seq_port_info_get_write_use, iFp) +GO(snd_seq_port_info_get_port_specified, iFp) +GO(snd_seq_port_info_get_timestamping, iFp) +GO(snd_seq_port_info_get_timestamp_real, iFp) +GO(snd_seq_port_info_get_timestamp_queue, iFp) +GO(snd_seq_port_info_set_client, vFpi) +GO(snd_seq_port_info_set_port, vFpi) +GO(snd_seq_port_info_set_addr, vFpp) +GO(snd_seq_port_info_set_name, vFpp) +GO(snd_seq_port_info_set_capability, vFpu) +GO(snd_seq_port_info_set_type, vFpu) +GO(snd_seq_port_info_set_midi_channels, vFpi) +GO(snd_seq_port_info_set_midi_voices, vFpi) +GO(snd_seq_port_info_set_synth_voices, vFpi) +GO(snd_seq_port_info_set_port_specified, vFpi) +GO(snd_seq_port_info_set_timestamping, vFpi) +GO(snd_seq_port_info_set_timestamp_real, vFpi) +GO(snd_seq_port_info_set_timestamp_queue, vFpi) +GO(snd_seq_create_port, iFpp) +GO(snd_seq_delete_port, iFpi) +GO(snd_seq_get_port_info, iFpip) +GO(snd_seq_get_any_port_info, iFpiip) +GO(snd_seq_set_port_info, iFpip) +GO(snd_seq_query_next_port, iFpp) +GO(snd_seq_port_subscribe_sizeof, LFv) +GO(snd_seq_port_subscribe_malloc, iFbp_) +GO(snd_seq_port_subscribe_free, vFp) +GO(snd_seq_port_subscribe_copy, vFpp) +GO(snd_seq_port_subscribe_get_sender, pFp) +GO(snd_seq_port_subscribe_get_dest, pFp) +GO(snd_seq_port_subscribe_get_queue, iFp) +GO(snd_seq_port_subscribe_get_exclusive, iFp) +GO(snd_seq_port_subscribe_get_time_update, iFp) +GO(snd_seq_port_subscribe_get_time_real, iFp) +GO(snd_seq_port_subscribe_set_sender, vFpp) +GO(snd_seq_port_subscribe_set_dest, vFpp) +GO(snd_seq_port_subscribe_set_queue, vFpi) +GO(snd_seq_port_subscribe_set_exclusive, vFpi) +GO(snd_seq_port_subscribe_set_time_update, vFpi) +GO(snd_seq_port_subscribe_set_time_real, vFpi) +GO(snd_seq_get_port_subscription, iFpp) +GO(snd_seq_subscribe_port, iFpp) +GO(snd_seq_unsubscribe_port, iFpp) +GO(snd_seq_query_subscribe_sizeof, LFv) +GO(snd_seq_query_subscribe_malloc, iFbp_) +GO(snd_seq_query_subscribe_free, vFp) +GO(snd_seq_query_subscribe_copy, vFpp) +GO(snd_seq_query_subscribe_get_client, iFp) +GO(snd_seq_query_subscribe_get_port, iFp) +GO(snd_seq_query_subscribe_get_root, pFp) +GO(snd_seq_query_subscribe_get_type, uFp) +GO(snd_seq_query_subscribe_get_index, iFp) +GO(snd_seq_query_subscribe_get_num_subs, iFp) +GO(snd_seq_query_subscribe_get_addr, pFp) +GO(snd_seq_query_subscribe_get_queue, iFp) +GO(snd_seq_query_subscribe_get_exclusive, iFp) +GO(snd_seq_query_subscribe_get_time_update, iFp) +GO(snd_seq_query_subscribe_get_time_real, iFp) +GO(snd_seq_query_subscribe_set_client, vFpi) +GO(snd_seq_query_subscribe_set_port, vFpi) +GO(snd_seq_query_subscribe_set_root, vFpp) +GO(snd_seq_query_subscribe_set_type, vFpu) +GO(snd_seq_query_subscribe_set_index, vFpi) +GO(snd_seq_query_port_subscribers, iFpp) +GO(snd_seq_queue_info_sizeof, LFv) +GO(snd_seq_queue_info_malloc, iFbp_) +GO(snd_seq_queue_info_free, vFp) +GO(snd_seq_queue_info_copy, vFpp) +GO(snd_seq_queue_info_get_queue, iFp) +GO(snd_seq_queue_info_get_name, pFp) +GO(snd_seq_queue_info_get_owner, iFp) +GO(snd_seq_queue_info_get_locked, iFp) +GO(snd_seq_queue_info_get_flags, uFp) +GO(snd_seq_queue_info_set_name, vFpp) +GO(snd_seq_queue_info_set_owner, vFpi) +GO(snd_seq_queue_info_set_locked, vFpi) +GO(snd_seq_queue_info_set_flags, vFpu) +GO(snd_seq_create_queue, iFpp) +GO(snd_seq_alloc_named_queue, iFpp) +GO(snd_seq_alloc_queue, iFp) +GO(snd_seq_free_queue, iFpi) +GO(snd_seq_get_queue_info, iFpip) +GO(snd_seq_set_queue_info, iFpip) +GO(snd_seq_query_named_queue, iFpp) +GO(snd_seq_get_queue_usage, iFpi) +GO(snd_seq_set_queue_usage, iFpii) +GO(snd_seq_queue_status_sizeof, LFv) +GO(snd_seq_queue_status_malloc, iFbp_) +GO(snd_seq_queue_status_free, vFp) +GO(snd_seq_queue_status_copy, vFpp) +GO(snd_seq_queue_status_get_queue, iFp) +GO(snd_seq_queue_status_get_events, iFp) +GO(snd_seq_queue_status_get_tick_time, uFp) +GO(snd_seq_queue_status_get_real_time, pFp) +GO(snd_seq_queue_status_get_status, uFp) +GO(snd_seq_get_queue_status, iFpip) +GO(snd_seq_queue_tempo_sizeof, LFv) +GO(snd_seq_queue_tempo_malloc, iFbp_) +GO(snd_seq_queue_tempo_free, vFp) +GO(snd_seq_queue_tempo_copy, vFpp) +GO(snd_seq_queue_tempo_get_queue, iFp) +GO(snd_seq_queue_tempo_get_tempo, uFp) +GO(snd_seq_queue_tempo_get_ppq, iFp) +GO(snd_seq_queue_tempo_get_skew, uFp) +GO(snd_seq_queue_tempo_get_skew_base, uFp) +GO(snd_seq_queue_tempo_set_tempo, vFpu) +GO(snd_seq_queue_tempo_set_ppq, vFpi) +GO(snd_seq_queue_tempo_set_skew, vFpu) +GO(snd_seq_queue_tempo_set_skew_base, vFpu) +GO(snd_seq_get_queue_tempo, iFpip) +GO(snd_seq_set_queue_tempo, iFpip) +GO(snd_seq_queue_timer_sizeof, LFv) +GO(snd_seq_queue_timer_malloc, iFbp_) +GO(snd_seq_queue_timer_free, vFp) +GO(snd_seq_queue_timer_copy, vFpp) +GO(snd_seq_queue_timer_get_queue, iFp) +GO(snd_seq_queue_timer_get_type, uFp) +GO(snd_seq_queue_timer_get_id, pFp) +GO(snd_seq_queue_timer_get_resolution, uFp) +GO(snd_seq_queue_timer_set_type, vFpu) +GO(snd_seq_queue_timer_set_id, vFpp) +GO(snd_seq_queue_timer_set_resolution, vFpu) +GO(snd_seq_get_queue_timer, iFpip) +GO(snd_seq_set_queue_timer, iFpip) +GO(snd_seq_free_event, iFp) +//GO(snd_seq_event_length, lFp) +//GO(snd_seq_event_output, iFpp) +//GO(snd_seq_event_output_buffer, iFpp) +GO(snd_seq_event_output_direct, iFpp) +GO(snd_seq_event_input, iFpbp_) //TODO: does snd_seq_event needs wrapping? +GO(snd_seq_event_input_pending, iFpi) +GO(snd_seq_drain_output, iFp) +GO(snd_seq_event_output_pending, iFp) +//GO(snd_seq_extract_output, iFpp) +GO(snd_seq_drop_output, iFp) +GO(snd_seq_drop_output_buffer, iFp) +GO(snd_seq_drop_input, iFp) +GO(snd_seq_drop_input_buffer, iFp) +GO(snd_seq_remove_events_sizeof, LFv) +GO(snd_seq_remove_events_malloc, iFbp_) +GO(snd_seq_remove_events_free, vFp) +GO(snd_seq_remove_events_copy, vFpp) +GO(snd_seq_remove_events_get_condition, uFp) +GO(snd_seq_remove_events_get_queue, iFp) +GO(snd_seq_remove_events_get_time, pFp) +GO(snd_seq_remove_events_get_dest, pFp) +GO(snd_seq_remove_events_get_channel, iFp) +GO(snd_seq_remove_events_get_event_type, iFp) +GO(snd_seq_remove_events_get_tag, iFp) +GO(snd_seq_remove_events_set_condition, vFpu) +GO(snd_seq_remove_events_set_queue, vFpi) +GO(snd_seq_remove_events_set_time, vFpp) +GO(snd_seq_remove_events_set_dest, vFpp) +GO(snd_seq_remove_events_set_channel, vFpi) +GO(snd_seq_remove_events_set_event_type, vFpi) +GO(snd_seq_remove_events_set_tag, vFpi) +GO(snd_seq_remove_events, iFpp) +GO(snd_seq_set_bit, vFip) +GO(snd_seq_change_bit, iFip) +GO(snd_seq_get_bit, iFip) +GO(snd_midi_event_new, iFLbp_) +GO(snd_midi_event_resize_buffer, iFpL) +GO(snd_midi_event_free, vFp) +GO(snd_midi_event_init, vFp) +GO(snd_midi_event_reset_encode, vFp) +GO(snd_midi_event_reset_decode, vFp) +GO(snd_midi_event_no_status, vFpi) +//GO(snd_midi_event_encode, lFpplp) +GO(snd_midi_event_encode_byte, iFpip) +//GO(snd_midi_event_decode, lFpplp) +//GO(snd_seq_control_queue, iFpiiip) +GO(snd_seq_create_simple_port, iFppuu) +GO(snd_seq_delete_simple_port, iFpi) +GO(snd_seq_connect_from, iFpiii) +GO(snd_seq_connect_to, iFpiii) +GO(snd_seq_disconnect_from, iFpiii) +GO(snd_seq_disconnect_to, iFpiii) +GO(snd_seq_set_client_name, iFpp) +GO(snd_seq_set_client_event_filter, iFpi) +GO(snd_seq_set_client_pool_output_room, iFpL) +GO(snd_seq_set_client_pool_input, iFpL) +GO(snd_seq_reset_pool_output, iFp) +GO(snd_seq_reset_pool_input, iFp) +GO(snd_seq_sync_output_queue, iFp) +GO(snd_seq_parse_address, iFppp) + +GO(snd_hwdep_info_get_iface, uFp) +//DATAM(snd_lib_error, 4) +GO(superdummy_error_handler, vFpipipV) // dummy to have the bridge definition diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c new file mode 100755 index 0000000..1c24d9d --- /dev/null +++ b/src/wrapped32/wrappedlibc.c @@ -0,0 +1,3707 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef WINLATOR_GLIBC +#include +#include +#endif +#include + +#include "wrappedlibs.h" + +#include "box64stack.h" +#include "x64emu.h" +#include "box64cpu.h" +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "callback.h" +#include "librarian.h" +#include "librarian/library_private.h" +#include "emu/x64emu_private.h" +#include "box32context.h" +#include "myalign32.h" +#include "signals.h" +#include "fileutils.h" +#include "auxval.h" +#include "elfloader.h" +#include "bridge.h" +#include "globalsymbols.h" +#include "box32.h" +#include "converter32.h" +#include "cleanup.h" +#include "box32_inputevent.h" + +// need to undef all read / read64 stuffs! +#undef pread +#undef pwrite +#undef lseek +#undef fseeko +#undef ftello +#undef fseekpos +#undef fsetpos +#undef fgetpos +#undef fopen +#undef statfs +#undef fstatfs +#undef freopen +#undef truncate +#undef ftruncate +#undef tmpfile +#undef lockf +#undef fscanf +#undef scanf +#undef sscanf +#undef vfscanf +#undef vscanf +#undef vsscanf +#undef getc +#undef putc +#undef mkstemp +#undef mkstemps +#undef mkostemp +#undef mkostemps +#undef open +#undef openat +#undef read +#undef write +#undef creat +#undef scandir +#undef mmap +#undef fcntl +#undef stat +#undef __xstat +#undef xstat +#undef scandir +#undef ftw +#undef nftw +#undef glob + +#define MY32_F_GETLK 5 +#define MY32_F_SETLK 6 +#define MY32_F_SETLKW 7 +#define MY32_F_GETLK64 12 +#define MY32_F_SETLK64 13 +#define MY32_F_SETLKW64 14 + +#define LIBNAME libc + +static const char* libcName = +#ifdef ANDROID + "libc.so" +#else + "libc.so.6" +#endif + ; + +typedef int32_t (*iFiiV_t)(int32_t, int32_t, ...); +typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*); +#if 0 +typedef int (*iFL_t)(unsigned long); +typedef void (*vFpp_t)(void*, void*); +typedef void (*vFpp_t)(void*, void*); +typedef void (*vFipp_t)(int32_t, void*, void*); +typedef int32_t (*iFpi_t)(void*, int32_t); +typedef int32_t (*iFpp_t)(void*, void*); +typedef int32_t (*iFpL_t)(void*, size_t); +typedef int32_t (*iFiip_t)(int32_t, int32_t, void*); +typedef int32_t (*iFipp_t)(int32_t, void*, void*); +typedef int32_t (*iFppi_t)(void*, void*, int32_t); +typedef int32_t (*iFpup_t)(void*, uint32_t, void*); +typedef int32_t (*iFpuu_t)(void*, uint32_t, uint32_t); +typedef int32_t (*iFiiII_t)(int, int, int64_t, int64_t); +typedef int32_t (*iFiiiV_t)(int, int, int, ...); +typedef int32_t (*iFippi_t)(int32_t, void*, void*, int32_t); +typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); +typedef int32_t (*iFppii_t)(void*, void*, int32_t, int32_t); +typedef int32_t (*iFipuu_t)(int32_t, void*, uint32_t, uint32_t); +typedef int32_t (*iFipiI_t)(int32_t, void*, int32_t, int64_t); +typedef int32_t (*iFipuup_t)(int32_t, void*, uint32_t, uint32_t, void*); +typedef void* (*pFp_t)(void*); +typedef void* (*pFu_t)(uint32_t); +#define SUPER() \ + GO(_ITM_addUserCommitAction, iFpup_t) \ + GO(_IO_file_stat, iFpp_t) + +#endif + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedlibctypes32.h" + +#include "wrappercallback32.h" + +struct i386_stat { + uint64_t st_dev; + uint32_t __pad1; + uint32_t st_ino; + uint32_t st_mode; + uint32_t st_nlink; + uint32_t st_uid; + uint32_t st_gid; + uint64_t st_rdev; + uint32_t __pad2; + int32_t st_size; + int32_t st_blksize; + int32_t st_blocks; + int32_t st_atime_sec; + uint32_t st_atime_nsec; + int32_t st_mtime_sec; + uint32_t st_mtime_nsec; + int32_t st_ctime_sec; + uint32_t st_ctime_nsec; + uint32_t __unused4; + uint32_t __unused5; +} __attribute__((packed)); + +static int FillStatFromStat64(int vers, const struct stat64 *st64, void *st32) +{ + struct i386_stat *i386st = (struct i386_stat *)st32; + + if (vers != 3) + { + errno = EINVAL; + return -1; + } + + i386st->st_dev = st64->st_dev; + i386st->__pad1 = 0; + if (BOX64ENV(fix_64bit_inodes)) + { + i386st->st_ino = st64->st_ino ^ (st64->st_ino >> 32); + } + else + { + i386st->st_ino = st64->st_ino; + if ((st64->st_ino >> 32) != 0) + { + errno = EOVERFLOW; + return -1; + } + } + i386st->st_mode = st64->st_mode; + i386st->st_nlink = st64->st_nlink; + i386st->st_uid = st64->st_uid; + i386st->st_gid = st64->st_gid; + i386st->st_rdev = st64->st_rdev; + i386st->__pad2 = 0; + i386st->st_size = st64->st_size; + if ((i386st->st_size >> 31) != (int32_t)(st64->st_size >> 32)) + { + errno = EOVERFLOW; + return -1; + } + i386st->st_blksize = st64->st_blksize; + i386st->st_blocks = st64->st_blocks; + if ((i386st->st_blocks >> 31) != (int32_t)(st64->st_blocks >> 32)) + { + errno = EOVERFLOW; + return -1; + } + i386st->st_atime_sec = st64->st_atim.tv_sec; + i386st->st_atime_nsec = st64->st_atim.tv_nsec; + i386st->st_mtime_sec = st64->st_mtim.tv_sec; + i386st->st_mtime_nsec = st64->st_mtim.tv_nsec; + i386st->st_ctime_sec = st64->st_ctim.tv_sec; + i386st->st_ctime_nsec = st64->st_ctim.tv_nsec; + i386st->__unused4 = 0; + i386st->__unused5 = 0; + return 0; +} + +// utility functions +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) \ +GO(5) \ +GO(6) \ +GO(7) \ +GO(8) \ +GO(9) \ +GO(10) \ +GO(11) \ +GO(12) \ +GO(13) \ +GO(14) \ +GO(15) + +// compare +#define GO(A) \ +static uintptr_t my32_compare_fct_##A = 0; \ +static int my32_compare_##A(void* a, void* b) \ +{ \ + return (int)RunFunctionFmt(my32_compare_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* findcompareFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_compare_fct_##A == (uintptr_t)fct) return my32_compare_##A; + SUPER() + #undef GO + #define GO(A) if(my32_compare_fct_##A == 0) {my32_compare_fct_##A = (uintptr_t)fct; return my32_compare_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc compare callback\n"); + return NULL; +} + +// ftw +#define GO(A) \ +static uintptr_t my32_ftw_fct_##A = 0; \ +static int my32_ftw_##A(void* fpath, void* sb, int flag) \ +{ \ + static struct i386_stat i386st; \ + FillStatFromStat64(3, sb, &i386st); \ + return (int)RunFunctionFmt(my32_ftw_fct_##A, "ppi", fpath, &i386st, flag); \ +} +SUPER() +#undef GO +static void* findftwFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_ftw_fct_##A == (uintptr_t)fct) return my32_ftw_##A; + SUPER() + #undef GO + #define GO(A) if(my32_ftw_fct_##A == 0) {my32_ftw_fct_##A = (uintptr_t)fct; return my32_ftw_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc ftw callback\n"); + return NULL; +} +// ftw64 +#define GO(A) \ +static uintptr_t my32_ftw64_fct_##A = 0; \ +static int my32_ftw64_##A(void* fpath, void* sb, int flag) \ +{ \ + static struct i386_stat64 i386st; \ + UnalignStat64_32(sb, &i386st); \ + return (int)RunFunctionFmt(my32_ftw64_fct_##A, "ppi", fpath, &i386st, flag); \ +} +SUPER() +#undef GO +static void* findftw64Fct(void* fct) +{ + if(!fct) return NULL; + #define GO(A) if(my32_ftw64_fct_##A == (uintptr_t)fct) return my32_ftw64_##A; + SUPER() + #undef GO + #define GO(A) if(my32_ftw64_fct_##A == 0) {my32_ftw64_fct_##A = (uintptr_t)fct; return my32_ftw64_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc ftw64 callback\n"); + return NULL; +} +// nftw +#define GO(A) \ +static uintptr_t my32_nftw_fct_##A = 0; \ +static int my32_nftw_##A(void* fpath, void* sb, int flag, struct FTW* ftwbuff) \ +{ \ + static struct i386_stat i386st; \ + static struct FTW ftw; \ + FillStatFromStat64(3, sb, &i386st); \ + ftw.base = ftwbuff->base; \ + ftw.level = ftwbuff->level; \ + return (int)RunFunctionFmt(my32_nftw_fct_##A, "ppip", fpath, &i386st, flag, &ftw); \ +} +SUPER() +#undef GO +static void* findnftwFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_nftw_fct_##A == (uintptr_t)fct) return my32_nftw_##A; + SUPER() + #undef GO + #define GO(A) if(my32_nftw_fct_##A == 0) {my32_nftw_fct_##A = (uintptr_t)fct; return my32_nftw_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc nftw callback\n"); + return NULL; +} + +// nftw64 +#define GO(A) \ +static uintptr_t my32_nftw64_fct_##A = 0; \ +static int my32_nftw64_##A(void* fpath, void* sb, int flag, void* ftwbuff) \ +{ \ + struct i386_stat64 i386st; \ + UnalignStat64_32(sb, &i386st); \ + return (int)RunFunctionFmt(my32_nftw64_fct_##A, "ppip", fpath, &i386st, flag, ftwbuff); \ +} +SUPER() +#undef GO +static void* findnftw64Fct(void* fct) +{ + if(!fct) return NULL; + #define GO(A) if(my32_nftw64_fct_##A == (uintptr_t)fct) return my32_nftw64_##A; + SUPER() + #undef GO + #define GO(A) if(my32_nftw64_fct_##A == 0) {my32_nftw64_fct_##A = (uintptr_t)fct; return my32_nftw64_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc nftw64 callback\n"); + return NULL; +} + +// globerr +#define GO(A) \ +static uintptr_t my32_globerr_fct_##A = 0; \ +static int my32_globerr_##A(void* epath, int eerrno) \ +{ \ + return (int)RunFunctionFmt(my32_globerr_fct_##A, "pi", epath, eerrno); \ +} +SUPER() +#undef GO +static void* findgloberrFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_globerr_fct_##A == (uintptr_t)fct) return my32_globerr_##A; + SUPER() + #undef GO + #define GO(A) if(my32_globerr_fct_##A == 0) {my32_globerr_fct_##A = (uintptr_t)fct; return my32_globerr_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc globerr callback\n"); + return NULL; +} + +#undef dirent +// filter_dir +#define GO(A) \ +static uintptr_t my32_filter_dir_fct_##A = 0; \ +static int my32_filter_dir_##A(const struct dirent64* a) \ +{ \ + static struct i386_dirent d = {0}; \ + UnalignDirent_32(a, &d); \ + return (int)RunFunctionFmt(my32_filter_dir_fct_##A, "p", &d); \ +} +SUPER() +#undef GO +static void* findfilter_dirFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_filter_dir_fct_##A == (uintptr_t)fct) return my32_filter_dir_##A; + SUPER() + #undef GO + #define GO(A) if(my32_filter_dir_fct_##A == 0) {my32_filter_dir_fct_##A = (uintptr_t)fct; return my32_filter_dir_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc filter_dir callback\n"); + return NULL; +} +// compare_dir +#define GO(A) \ +static uintptr_t my32_compare_dir_fct_##A = 0; \ +static int my32_compare_dir_##A(const struct dirent* a, const struct dirent* b) \ +{ \ + static struct i386_dirent d1, d2; \ + UnalignDirent_32(a, &d1); \ + UnalignDirent_32(a, &d2); \ + return (int)RunFunctionFmt(my32_compare_dir_fct_##A, "pp", &d1, &d2); \ +} +SUPER() +#undef GO +int my32_alphasort64(x64emu_t* emu, ptr_t* d1_, ptr_t* d2_); +static void* findcompare_dirFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) { if(p==my32_alphasort64) return alphasort64; else return p; } + #define GO(A) if(my32_compare_dir_fct_##A == (uintptr_t)fct) return my32_compare_dir_##A; + SUPER() + #undef GO + #define GO(A) if(my32_compare_dir_fct_##A == 0) {my32_compare_dir_fct_##A = (uintptr_t)fct; return my32_compare_dir_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc compare_dir callback\n"); + return NULL; +} +// filter64 +#define GO(A) \ +static uintptr_t my32_filter64_fct_##A = 0; \ +static int my32_filter64_##A(const struct dirent64* a) \ +{ \ + return (int)RunFunctionFmt(my32_filter64_fct_##A, "p", a); \ +} +SUPER() +#undef GO +static void* findfilter64Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_filter64_fct_##A == (uintptr_t)fct) return my32_filter64_##A; + SUPER() + #undef GO + #define GO(A) if(my32_filter64_fct_##A == 0) {my32_filter64_fct_##A = (uintptr_t)fct; return my32_filter64_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc filter64 callback\n"); + return NULL; +} +// compare64 +#define GO(A) \ +static uintptr_t my32_compare64_fct_##A = 0; \ +static int my32_compare64_##A(const struct dirent64* a, const struct dirent64* b) \ +{ \ + return (int)RunFunctionFmt(my32_compare64_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* findcompare64Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) { if(p==my32_alphasort64) return alphasort64; else return p; } + #define GO(A) if(my32_compare64_fct_##A == (uintptr_t)fct) return my32_compare64_##A; + SUPER() + #undef GO + #define GO(A) if(my32_compare64_fct_##A == 0) {my32_compare64_fct_##A = (uintptr_t)fct; return my32_compare64_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc compare64 callback\n"); + return NULL; +} +#if 0 +// on_exit +#define GO(A) \ +static uintptr_t my32_on_exit_fct_##A = 0; \ +static void my32_on_exit_##A(int a, const void* b) \ +{ \ + RunFunction(my_context, my32_on_exit_fct_##A, 2, a, b); \ +} +SUPER() +#undef GO +static void* findon_exitFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_on_exit_fct_##A == (uintptr_t)fct) return my32_on_exit_##A; + SUPER() + #undef GO + #define GO(A) if(my32_on_exit_fct_##A == 0) {my32_on_exit_fct_##A = (uintptr_t)fct; return my32_on_exit_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libc on_exit callback\n"); + return NULL; +} +#endif +#undef SUPER + +EXPORT int my32_statvfs64(x64emu_t* emu, void* f, void* r) +{ + struct statvfs s = {0}; + int ret = statvfs(f, r?&s:NULL); + if(r) + UnalignStatVFS64_32(&s, r); + return ret; +} + +EXPORT int my32_statvfs(x64emu_t* emu, void* f, void* r) +{ + struct statvfs s = {0}; + int ret = statvfs(f, r?&s:NULL); + if(r) + UnalignStatVFS_32(&s, r); + return ret; +} + +EXPORT int my32_fstatvfs64(x64emu_t* emu, int fd, void* r) +{ + struct statvfs s = {0}; + int ret = fstatvfs(fd, r?&s:NULL); + if(r) + UnalignStatVFS64_32(&s, r); + return ret; +} + +EXPORT int my32_fstatvfs(x64emu_t* emu, int fd, void* r) +{ + struct statvfs s = {0}; + int ret = fstatvfs(fd, r?&s:NULL); + if(r) + UnalignStatVFS_32(&s, r); + return ret; +} + +EXPORT int my32_fstatat(x64emu_t* emu, int fd, void* name, void* buff, int flags) +{ + struct stat64 s = {0}; + int ret = fstatat64(fd, name, buff?&s:NULL, flags); + if(buff) + FillStatFromStat64(3, &s, buff); + return ret; +} + +EXPORT int my32_fstatat64(x64emu_t* emu, int fd, void* name, void* buff, int flags) +{ + struct stat64 s = {0}; + int ret = fstatat64(fd, name, buff?&s:NULL, flags); + if(buff) + UnalignStat64_32(&s, buff); + return ret; +} + +EXPORT int my32___stat64_time64(x64emu_t* emu, void* f, void* r) +{ + struct stat64 s = {0}; + int ret = stat64(f, r?&s:NULL); + if(r) + UnalignStat64_32_t64(&s, r); + return ret; +} + +EXPORT int my32___lstat64_time64(x64emu_t* emu, void* f, void* r) +{ + struct stat64 s = {0}; + int ret = lstat64(f, r?&s:NULL); + if(r) + UnalignStat64_32_t64(&s, r); + return ret; +} + +EXPORT int my32___fstat64_time64(x64emu_t* emu, int fd, void* r) +{ + struct stat64 s = {0}; + int ret = fstat64(fd, r?&s:NULL); + if(r) + UnalignStat64_32_t64(&s, r); + return ret; +} + +// some my32_XXX declare and defines +#ifdef ANDROID +void my32___libc_init(x64emu_t* emu, void* raw_args , void (*onexit)(void) , int (*main)(int, char**, char**), void const * const structors ); +#else +int32_t my32___libc_start_main(x64emu_t* emu, int *(main) (int, char * *, char * *), + int argc, char * * ubp_av, void (*init) (void), void (*fini) (void), + void (*rtld_fini) (void), void (* stack_end)); // implemented in x64run_private.c +#endif + +EXPORT void my32___libc_init_first(x64emu_t* emu, int argc, char* arg0, char** b) +{ + // do nothing specific for now + return; +} + +uint32_t my32_syscall(x64emu_t *emu); // implemented in x64syscall.c +void EXPORT my32___stack_chk_fail(x64emu_t* emu) +{ + char buff[200]; + void* addr = from_ptrv(*(ptr_t*)from_ptrv(R_ESP)); + const char* name = getAddrFunctionName((uintptr_t)addr); + #ifdef HAVE_TRACE + sprintf(buff, "%p: Stack is corrupted, aborting (prev IP=%p) ESP=0x%x %s\n", addr, (void*)emu->prev2_ip, R_ESP, name); + #else + sprintf(buff, "%p: Stack is corrupted, aborting ESP=0x%x %s\n", addr, R_ESP, name); + #endif + print_rolling_log(LOG_INFO); + StopEmu(emu, buff, 1); +} +int EXPORT my32___xmknod(x64emu_t* emu, int ver, const char* path, mode_t mode, dev_t* dev) +{ + return mknod(path, mode, *dev); +} +void EXPORT my32___gmon_start__(x64emu_t *emu) +{ + printf_log(LOG_DEBUG, "__gmon_start__ called (dummy call)\n"); +} +int EXPORT my32___cxa_atexit(x64emu_t* emu, void* p, void* a, void* d) +{ + AddCleanup1Arg(emu, p, a,FindElfAddress(my_context, (uintptr_t)d)); + return 0; +} +void EXPORT my32___cxa_finalize(x64emu_t* emu, void* p) +{ + if(!p) { + // p is null, call (and remove) all Cleanup functions + CallAllCleanup(emu); + return; + } + CallCleanup(emu, FindElfAddress(my_context, (uintptr_t)p)); +} +int EXPORT my32_atexit(x64emu_t* emu, void *p) +{ + AddCleanup(emu, p); + return 0; +} + + +int my32_getcontext(x64emu_t* emu, void* ucp); +int my32_setcontext(x64emu_t* emu, void* ucp); +void my32_makecontext(x64emu_t* emu, void* ucp, void* fnc, int32_t argc, void* argv); +int my32_swapcontext(x64emu_t* emu, void* ucp1, void* ucp2); + +// All signal and context functions defined in signals.c + +// All fts function defined in myfts.c + +// getauxval implemented in auxval.c + + +// this one is defined in elfloader.c +int my32_dl_iterate_phdr(x64emu_t *emu, void* F, void *data); + +pid_t EXPORT my32_fork(x64emu_t* emu) +{ + #if 1 + emu->quit = 1; + emu->fork = 1; + return 0; + #else + // execute atforks prepare functions, in reverse order + for (int i=my_context->atfork_sz-1; i>=0; --i) + if(my_context->atforks[i].prepare) + RunFunctionWithEmu(emu, 0, my_context->atforks[i].prepare, 0); + int type = emu->type; + pid_t v; + v = fork(); + if(type == EMUTYPE_MAIN) + thread_set_emu(emu); + if(v<0) { + printf_log(LOG_NONE, "Warning, fork errored... (%d)\n", v); + // error... + } else if(v>0) { + // execute atforks parent functions + for (int i=0; iatfork_sz; ++i) + if(my_context->atforks[i].parent) + RunFunctionWithEmu(emu, 0, my_context->atforks[i].parent, 0); + + } else /*if(v==0)*/ { + // execute atforks child functions + for (int i=0; iatfork_sz; ++i) + if(my_context->atforks[i].child) + RunFunctionWithEmu(emu, 0, my_context->atforks[i].child, 0); + } + return v; + #endif +} +pid_t EXPORT my32___fork(x64emu_t* emu) __attribute__((alias("my32_fork"))); +pid_t EXPORT my32_vfork(x64emu_t* emu) +{ + #if 1 + emu->quit = 1; + emu->fork = 3; + return 0; + #else + return 0; + #endif +} + +int EXPORT my32_uname(struct utsname *buf) +{ + //TODO: check sizeof(struct utsname) == 390 + int ret = uname(buf); + strcpy(buf->machine, "x86_64"); + return ret; +} + +// X86_O_RDONLY 0x00 +#define X86_O_WRONLY 0x01 // octal 01 +#define X86_O_RDWR 0x02 // octal 02 +#define X86_O_CREAT 0x40 // octal 0100 +#define X86_O_EXCL 0x80 // octal 0200 +#define X86_O_NOCTTY 0x100 // octal 0400 +#define X86_O_TRUNC 0x200 // octal 01000 +#define X86_O_APPEND 0x400 // octal 02000 +#define X86_O_NONBLOCK 0x800 // octal 04000 +#define X86_O_SYNC 0x101000 // octal 04010000 +#define X86_O_DSYNC 0x1000 // octal 010000 +#define X86_O_RSYNC X86_O_SYNC +#define X86_FASYNC 020000 +#define X86_O_DIRECT 040000 +#define X86_O_LARGEFILE 0100000 +#define X86_O_DIRECTORY 0200000 +#define X86_O_NOFOLLOW 0400000 +#define X86_O_NOATIME 01000000 +#define X86_O_CLOEXEC 02000000 +#define X86_O_PATH 010000000 +#define X86_O_TMPFILE 020200000 + +#ifndef O_TMPFILE +#define O_TMPFILE (020000000 | O_DIRECTORY) +#endif +#ifndef O_PATH +#define O_PATH 010000000 +#endif + +#define SUPER() \ + GO(O_WRONLY) \ + GO(O_RDWR) \ + GO(O_CREAT) \ + GO(O_EXCL) \ + GO(O_NOCTTY) \ + GO(O_TRUNC) \ + GO(O_APPEND) \ + GO(O_NONBLOCK) \ + GO(O_SYNC) \ + GO(O_DSYNC) \ + GO(O_RSYNC) \ + GO(FASYNC) \ + GO(O_DIRECT) \ + GO(O_LARGEFILE) \ + GO(O_TMPFILE) \ + GO(O_DIRECTORY) \ + GO(O_NOFOLLOW) \ + GO(O_NOATIME) \ + GO(O_CLOEXEC) \ + GO(O_PATH) \ + +// x86->arm +int of_convert32(int a) +{ + if(!a || a==-1) return a; + int b=0; + #define GO(A) if((a&X86_##A)==X86_##A) {a&=~X86_##A; b|=A;} + SUPER(); + #undef GO + if(a) { + printf_log(LOG_NONE, "Warning, of_convert32(...) left over 0x%x, converted 0x%x\n", a, b); + } + return a|b; +} + +// arm->x86 +int of_unconvert32(int a) +{ + if(!a || a==-1) return a; + int b=0; + #define GO(A) if((a&A)==A) {a&=~A; b|=X86_##A;} + SUPER(); + #undef GO + int missing = 0; + #ifdef ARM64 + if(!O_LARGEFILE) { + if((a&(0400000))==(0400000)) {a&=~(0400000); b|=(X86_O_LARGEFILE);} + } + #else + if(!O_LARGEFILE) missing |= X86_O_LARGEFILE; + #endif + if(a && (a&~missing)) { + printf_log(LOG_NONE, "Warning, of_unconvert32(...) left over 0x%x, converted 0x%x\n", a, b); + } + return a|b; +} +#undef SUPER + +EXPORT void* my32__ZGTtnaX (size_t a) { printf("warning 32bits _ZGTtnaX called\n"); return NULL; } +EXPORT void* my32__ZGTtnam (size_t a) { (void)a; printf("warning 32bits _ZGTtnam called\n"); return NULL; } +EXPORT void* my32__ZGTtnaj (uint32_t a) { printf("warning 32bits _ZGTtnaj called\n"); return NULL; } +EXPORT void my32__ZGTtdlPv (void* a) { printf("warning 32bits _ZGTtdlPv called\n"); } +EXPORT uint8_t my32__ITM_RU1(const uint8_t * a) { printf("warning 32bits _ITM_RU1 called\n"); return 0; } +EXPORT uint32_t my32__ITM_RU4(const uint32_t * a) { printf("warning 32bits _ITM_RU4 called\n"); return 0; } +EXPORT uint64_t my32__ITM_RU8(const uint64_t * a) { printf("warning 32bits _ITM_RU8 called\n"); return 0; } +EXPORT void my32__ITM_memcpyRtWn(void * a, const void * b, size_t c) {printf("warning 32bits _ITM_memcpyRtWn called\n"); } +EXPORT void my32__ITM_memcpyRnWt(void * a, const void * b, size_t c) {printf("warning 32bits _ITM_memcpyRtWn called\n"); } + +EXPORT void my32_longjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p, int32_t __val); +EXPORT void my32__longjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p, int32_t __val) __attribute__((alias("my32_longjmp"))); +EXPORT void my32_siglongjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p, int32_t __val) __attribute__((alias("my32_longjmp"))); +EXPORT void my32___longjmp_chk(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p, int32_t __val) __attribute__((alias("my32_longjmp"))); + +//EXPORT int32_t my32_setjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p); +//EXPORT int32_t my32__setjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p) __attribute__((alias("my32_setjmp"))); +//EXPORT int32_t my32___sigsetjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p) __attribute__((alias("my32_setjmp"))); +#if 0 +EXPORT void my32_exit(x64emu_t *emu, int32_t status) +{ + R_EAX = (uint32_t)status; + emu->quit = 1; +} +EXPORT void my32__exit(x64emu_t *emu, int32_t status) __attribute__((alias("my32_exit"))); +EXPORT void my32__Exit(x64emu_t *emu, int32_t status) __attribute__((alias("my32_exit"))); +#endif +extern int vsyslog(int, const char*, va_list); +EXPORT int my32_vsyslog(x64emu_t* emu, int priority, void* fmt, void* b) { + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vsyslog(priority, (const char*)fmt, VARARGS_32); +} +EXPORT int my32_syslog(x64emu_t* emu, int priority, void* fmt, void* b) { + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vsyslog(priority, (const char*)fmt, VARARGS_32); +} +EXPORT int my32___vsyslog_chk(x64emu_t* emu, int priority, int flag, void* fmt, void* b) { + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vsyslog(priority, (const char*)fmt, VARARGS_32); +} +EXPORT int my32___syslog_chk(x64emu_t* emu, int priority, int flags, void* fmt, void* b) { + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vsyslog(priority, (const char*)fmt, VARARGS_32); +} +EXPORT int my32_printf(x64emu_t *emu, void* fmt, void* b) { + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vprintf((const char*)fmt, VARARGS_32); +} +EXPORT int my32___printf_chk(x64emu_t *emu, int a, void* fmt, void* b) { + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vprintf((const char*)fmt, VARARGS_32); +} + +EXPORT int my32_vprintf(x64emu_t *emu, void* fmt, void* b) { + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vprintf(fmt, VARARGS_32); +} +EXPORT int my32___vprintf_chk(x64emu_t *emu, int a, void* fmt, void* b) { + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vprintf(fmt, VARARGS_32); +} + +EXPORT int my32_vfprintf(x64emu_t *emu, void* F, void* fmt, void* b) { + // need to align on arm + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vfprintf(F, fmt, VARARGS_32); +} +EXPORT int my32__IO_vfprintf(x64emu_t *emu, void* F, void* fmt, void* b) __attribute__((alias("my32_vfprintf"))); +EXPORT int my32___vfprintf_chk(x64emu_t *emu, void* F, int a1, void* fmt, void* b) { + // need to align on arm + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vfprintf(F, fmt, VARARGS_32); +} + +EXPORT int my32_dprintf(x64emu_t *emu, int fd, void* fmt, void* V) { + // need to align on arm + myStackAlign32((const char*)fmt, V, emu->scratch); + PREPARE_VALIST_32; + return vdprintf(fd, fmt, VARARGS_32); +} +EXPORT int my32___dprintf_chk(x64emu_t *emu, int fd, int a, void* fmt, void* V) { + // need to align on arm + myStackAlign32((const char*)fmt, V, emu->scratch); + PREPARE_VALIST_32; + return vdprintf(fd, fmt, VARARGS_32); +} + +EXPORT int my32_fprintf(x64emu_t *emu, void* F, void* fmt, void* V) { + // need to align on arm + myStackAlign32((const char*)fmt, V, emu->scratch); + PREPARE_VALIST_32; + return vfprintf(F, fmt, VARARGS_32); +} +EXPORT int my32___fprintf_chk(x64emu_t *emu, void* F, int a, void* fmt, void* V) { + // need to align on arm + myStackAlign32((const char*)fmt, V, emu->scratch); + PREPARE_VALIST_32; + return vfprintf(F, fmt, VARARGS_32); +} +extern int box64_stdout_no_w; +EXPORT int my32_wprintf(x64emu_t *emu, void* fmt, void* V) { + // need to align on arm + myStackAlignW32((const char*)fmt, V, emu->scratch); + PREPARE_VALIST_32; + if(box64_stdout_no_w) { + wchar_t buff[2048]; + int ret = vswprintf(buff, 2047, fmt, VARARGS_32); + printf("%S", buff); + return ret; + } + return vwprintf(fmt, VARARGS_32); +} +#if 0 +EXPORT int my32___wprintf_chk(x64emu_t *emu, int flag, void* fmt, void* V) { + #ifndef NOALIGN + // need to align on arm + myStackAlignW((const char*)fmt, V, emu->scratch); + PREPARE_VALIST_32; + void* f = vwprintf; + return ((iFpp_t)f)(fmt, VARARGS_32); + #else + // other platform don't need that + return vwprintf((const wchar_t*)fmt, (va_list)V); + #endif +} +EXPORT int my32_fwprintf(x64emu_t *emu, void* F, void* fmt, void* V) { + #ifndef NOALIGN + // need to align on arm + myStackAlignW((const char*)fmt, V, emu->scratch); + PREPARE_VALIST_32; + void* f = vfwprintf; + return ((iFppp_t)f)(F, fmt, VARARGS_32); + #else + // other platform don't need that + return vfwprintf((FILE*)F, (const wchar_t*)fmt, V); + #endif +} +EXPORT int my32___fwprintf_chk(x64emu_t *emu, void* F, void* fmt, void* V) __attribute__((alias("my32_fwprintf"))); + +EXPORT int my32_vfwprintf(x64emu_t *emu, void* F, void* fmt, void* b) { + #ifndef NOALIGN + myStackAlignW((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + void* f = vfwprintf; + return ((iFppp_t)f)(F, fmt, VARARGS_32); + #else + return vfwprintf(F, fmt, b); + #endif +} + +EXPORT int my32_vwprintf(x64emu_t *emu, void* fmt, void* b) { + #ifndef NOALIGN + myStackAlignW((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + void* f = vwprintf; + return ((iFpp_t)f)(fmt, VARARGS_32); + #else + void* f = vwprintf; + return ((iFpp_t)f)(fmt, b); + #endif +} +#endif +EXPORT void *my32_div(void *result, int numerator, int denominator) { + *(div_t *)result = div(numerator, denominator); + return result; +} + +EXPORT int my32_snprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, void * b) { + // need to align on arm + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vsnprintf(buff, s, fmt, VARARGS_32); +} +EXPORT int my32___snprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, void * b) __attribute__((alias("my32_snprintf"))); + +EXPORT int my32___snprintf_chk(x64emu_t* emu, void* buff, size_t s, int f1, int f2, void * fmt, void * b) { + (void)f1; (void)f2; + // need to align on arm + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vsnprintf(buff, s, fmt, VARARGS_32); +} + +EXPORT int my32_sprintf(x64emu_t* emu, void* buff, void * fmt, void * b) { + // need to align on arm + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vsprintf(buff, fmt, VARARGS_32); +} +EXPORT int my32___sprintf_chk(x64emu_t* emu, void* buff, int a1, int a2, void * fmt, void * b) { + // need to align on arm + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vsprintf(buff, fmt, VARARGS_32); +} + +EXPORT int my32_asprintf(x64emu_t* emu, ptr_t* buff, void * fmt, void * b) { + // need to align on arm + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + char* res = NULL; + int ret = vasprintf(&res, fmt, VARARGS_32); + *buff = to_ptrv(res); + return ret; +} +EXPORT int my32___asprintf(x64emu_t* emu, void** buff, void * fmt, void * b) __attribute__((alias("my32_asprintf"))); + +EXPORT int my32_vsprintf(x64emu_t* emu, void* buff, void * fmt, uint32_t * b) { + // need to align on arm + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + int r = vsprintf(buff, fmt, VARARGS_32); + return r; +} +EXPORT int my32___vsprintf_chk(x64emu_t* emu, void* buff, int flags, size_t len, void * fmt, uint32_t * b) { + // need to align on arm + myStackAlign32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + int r = vsprintf(buff, fmt, VARARGS_32); + return r; +} + +EXPORT int my32_vfscanf(x64emu_t* emu, void* stream, void* fmt, void* b) // probably unnecessary to do a GOM, a simple wrap should be enough +{ + int n = myStackAlignScanf32((const char*)fmt, (uint32_t*)b, emu->scratch, N_SCRATCH); + PREPARE_VALIST_32; + int ret = vfscanf(stream, fmt, VARARGS_32); + if(n) myStackAlignScanf32_final((const char*)fmt, (uint32_t*)b, emu->scratch, N_SCRATCH, ret); + return ret; +} +EXPORT int my32__IO_vfscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my32_vfscanf"))); +EXPORT int my32___isoc99_vfscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my32_vfscanf"))); +EXPORT int my32___isoc99_fscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my32_vfscanf"))); +EXPORT int my32_fscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my32_vfscanf"))); + +EXPORT int my32_vsscanf(x64emu_t* emu, void* buff, void* fmt, void* b) +{ + int n = myStackAlignScanf32((const char*)fmt, (uint32_t*)b, emu->scratch, N_SCRATCH); + PREPARE_VALIST_32; + int ret = vsscanf(buff, fmt, VARARGS_32); + if(ret>0) myStackAlignScanf32_final((const char*)fmt, (uint32_t*)b, emu->scratch, N_SCRATCH, ret); + return ret; +} +EXPORT int my32___isoc99_vsscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my32_vsscanf"))); +EXPORT int my32__vsscanf(x64emu_t* emu, void* buff, void* fmt, void* b) __attribute__((alias("my32_vsscanf"))); +EXPORT int my32_sscanf(x64emu_t* emu, void* buff, void* fmt, void* b) __attribute__((alias("my32_vsscanf"))); +EXPORT int my32___isoc99_sscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my32_vsscanf"))); + +EXPORT int my32_vsnprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, void * b) { + // need to align on arm + myStackAlign32((const char*)fmt, (uint32_t*)b, emu->scratch); + PREPARE_VALIST_32; + int r = vsnprintf(buff, s, fmt, VARARGS_32); + return r; +} +EXPORT int my32___vsnprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, void * b) __attribute__((alias("my32_vsnprintf"))); +EXPORT int my32___vsnprintf_chk(x64emu_t* emu, void* buff, size_t s, int a1, int a2, void * fmt, void * b) { + // need to align on arm + myStackAlign32((const char*)fmt, (uint32_t*)b, emu->scratch); + PREPARE_VALIST_32; + int r = vsnprintf(buff, s, fmt, VARARGS_32); + return r; +} +EXPORT int my32_vasprintf(x64emu_t* emu, ptr_t* strp, void* fmt, void* b) +{ + // need to align on arm + myStackAlign32((const char*)fmt, (uint32_t*)b, emu->scratch); + PREPARE_VALIST_32; + char* res = NULL; + int r = vasprintf(&res, fmt, VARARGS_32); + *strp = to_ptrv(res); + return r; +} +EXPORT int my32___vasprintf_chk(x64emu_t* emu, ptr_t* strp, int flags, void* fmt, void* b) +{ + // need to align on arm + myStackAlign32((const char*)fmt, (uint32_t*)b, emu->scratch); + PREPARE_VALIST_32; + char* p = NULL; + int r = vasprintf(&p, fmt, VARARGS_32); + *strp = to_ptrv(p); + return r; +} + +EXPORT int my32___asprintf_chk(x64emu_t* emu, ptr_t* result_ptr, int flags, void* fmt, void* b) +{ + myStackAlign32((const char*)fmt, b, emu->scratch); + char* p = NULL; + PREPARE_VALIST_32; + int ret = vasprintf(&p, fmt, VARARGS_32); + *result_ptr = to_ptrv(p); + return ret; +} + +EXPORT int my32_vswprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, uint32_t * b) { + // need to align on arm + myStackAlignW32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + int r = vswprintf(buff, s, fmt, VARARGS_32); + return r; +} +EXPORT int my32___vswprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, uint32_t* b) __attribute__((alias("my32_vswprintf"))); + +EXPORT int my32___vswprintf_chk(x64emu_t* emu, void* buff, size_t s, int flags, size_t m, void * fmt, void * b, va_list V) { + // need to align on arm + myStackAlignW32((const char*)fmt, (uint32_t*)b, emu->scratch); + PREPARE_VALIST_32; + return vswprintf(buff, s, fmt, VARARGS_32); +} + +EXPORT int my32_vswscanf(x64emu_t* emu, void* buff, void* fmt, void* b) +{ + int n = myStackAlignScanfW32((const char*)fmt, (uint32_t*)b, emu->scratch, N_SCRATCH); + PREPARE_VALIST_32; + int ret = vswscanf(buff, fmt, VARARGS_32); + if(n) myStackAlignScanfW32_final((const char*)fmt, (uint32_t*)b, emu->scratch, N_SCRATCH, ret); + return ret; +} + +EXPORT int my32__vswscanf(x64emu_t* emu, void* buff, void* fmt, void* b) __attribute__((alias("my32_vswscanf"))); +EXPORT int my32_swscanf(x64emu_t* emu, void* buff, void* fmt, void* b) __attribute__((alias("my32_vswscanf"))); +EXPORT int my32___isoc99_swscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my32_vswscanf"))); + +#if 0 +EXPORT void my32_verr(x64emu_t* emu, int eval, void* fmt, void* b) { + #ifndef NOALIGN + myStackAlignW((const char*)fmt, (uint32_t*)b, emu->scratch); + PREPARE_VALIST_32; + void* f = verr; + ((vFipp_t)f)(eval, fmt, VARARGS_32); + #else + void* f = verr; + ((vFipp_t)f)(eval, fmt, (uint32_t*)b); + #endif +} + +EXPORT void my32_vwarn(x64emu_t* emu, void* fmt, void* b) { + #ifndef NOALIGN + myStackAlignW((const char*)fmt, (uint32_t*)b, emu->scratch); + PREPARE_VALIST_32; + void* f = vwarn; + ((vFpp_t)f)(fmt, VARARGS_32); + #else + void* f = vwarn; + ((vFpp_t)f)(fmt, (uint32_t*)b); + #endif +} + +#endif +EXPORT int my32___swprintf_chk(x64emu_t* emu, void* s, uint32_t n, int32_t flag, uint32_t slen, void* fmt, void * b) +{ + myStackAlignW32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + return vswprintf(s, n, fmt, VARARGS_32); +} +EXPORT int my32_swprintf(x64emu_t* emu, void* s, uint32_t n, void* fmt, void *b) +{ + myStackAlignW32((const char*)fmt, b, emu->scratch); + PREPARE_VALIST_32; + int r = vswprintf(s, n, fmt, VARARGS_32); + return r; +} + +EXPORT void my32__ITM_addUserCommitAction(x64emu_t* emu, void* cb, uint32_t b, void* c) +{ + // disabled for now... Are all this _ITM_ stuff really mendatory? + #if 0 + // quick and dirty... Should store the callback to be removed later.... + libc_my32_t *my = (libc_my32_t *)emu->context->libclib->priv.w.p2; + x64emu_t *cbemu = AddCallback(emu, (uintptr_t)cb, 1, c, NULL, NULL, NULL); + my->_ITM_addUserCommitAction(libc1ArgCallback, b, cbemu); + // should keep track of cbemu to remove at some point... + #else + printf("warning _ITM_addUserCommitAction called\n"); + #endif +} + +EXPORT void my32__ITM_registerTMCloneTable(x64emu_t* emu, void* p, uint32_t s) {} +EXPORT void my32__ITM_deregisterTMCloneTable(x64emu_t* emu, void* p) {} + +EXPORT int my32_stat(char* path, void* buf) +{ + struct stat64 st; + int r = stat64(path, &st); + FillStatFromStat64(3, &st, buf); + return r; +} + +EXPORT int my32_fstat(int fd, void* buf) +{ + struct stat64 st; + int r = fstat64(fd, &st); + FillStatFromStat64(3, &st, buf); + return r; +} + +EXPORT int my32_lstat(char* path, void* buf) +{ + struct stat64 st; + int r = lstat64(path, &st); + FillStatFromStat64(3, &st, buf); + return r; +} + +EXPORT int my32___fxstat(x64emu_t *emu, int vers, int fd, void* buf) +{ + struct stat64 st; + int r = fstat64(fd, &st); + if (r) return r; + r = FillStatFromStat64(vers, &st, buf); + return r; +} + +EXPORT int my32___fxstat64(x64emu_t *emu, int vers, int fd, void* buf) +{ + struct stat64 st; + int r = fstat64(fd, &st); + //int r = syscall(__NR_stat64, fd, &st); + UnalignStat64_32(&st, buf); + return r; +} + +EXPORT int my32_statx(x64emu_t* emu, int dirfd, void* path, int flags, uint32_t mask, void* buf) +{ + // no need to convert the structure? + int ret = -1; + if(my->statx) + ret = my->statx(dirfd, path, flags, mask, buf); + else + #ifdef __NR_statx + { + ret = syscall(__NR_statx, dirfd, path, flags, mask, buf); + if(ret<0) { + errno = -ret; + ret = -1; + } + } + #else + errno = ENOSYS; + #endif + return ret; +} + +EXPORT int my32_stat64(void* path, void* buf) +{ + struct stat64 st; + int r = stat64(path, &st); + UnalignStat64_32(&st, buf); + return r; +} +EXPORT int my32_lstat64(void* path, void* buf) +{ + struct stat64 st; + int r = lstat64(path, &st); + UnalignStat64_32(&st, buf); + return r; +} +EXPORT int my32_fstat64(int fd, void* buf) +{ + struct stat64 st; + int r = fstat64(fd, &st); + UnalignStat64_32(&st, buf); + return r; +} + +EXPORT int my32___xstat(x64emu_t* emu, int v, void* path, void* buf) +{ + struct stat64 st; + int r = stat64((const char*)path, &st); + if (r) return r; + r = FillStatFromStat64(v, &st, buf); + return r; +} + +EXPORT int my32___xstat64(x64emu_t* emu, int v, void* path, void* buf) +{ + struct stat64 st; + int r = stat64((const char*)path, &st); + UnalignStat64_32(&st, buf); + return r; +} + +EXPORT int my32___lxstat(x64emu_t* emu, int v, void* name, void* buf) +{ + struct stat64 st; + int r = lstat64((const char*)name, &st); + if (r) return r; + r = FillStatFromStat64(v, &st, buf); + return r; +} + +EXPORT int my32___lxstat64(x64emu_t* emu, int v, void* name, void* buf) +{ + struct stat64 st; + int r = lstat64((const char*)name, &st); + UnalignStat64_32(&st, buf); + return r; +} +#if 0 +EXPORT int my32___fxstatat(x64emu_t* emu, int v, int d, void* path, void* buf, int flags) +{ + struct stat64 st; + int r = fstatat64(d, path, &st, flags); + if (r) return r; + r = FillStatFromStat64(v, &st, buf); + return r; +} +#endif +EXPORT int my32___fxstatat64(x64emu_t* emu, int v, int d, void* path, void* buf, int flags) +{ + struct stat64 st; + int r = fstatat64(d, path, &st, flags); + UnalignStat64_32(&st, buf); + return r; +} +#if 0 +EXPORT int my32__IO_file_stat(x64emu_t* emu, void* f, void* buf) +{ + struct stat64 st; + libc_my32_t *my = (libc_my32_t *)emu->context->libclib->priv.w.p2; + int r = my->_IO_file_stat(f, &st); + UnalignStat64(&st, buf); + return r; +} +#endif +EXPORT int my32_fstatfs(int fd, void* buf) +{ + struct statfs64 st; + int r = fstatfs64(fd, &st); + UnalignStatFS_32(&st, buf); + return r; +} +EXPORT int my32_fstatfs64(int fd, void* buf) +{ + struct statfs64 st; + int r = fstatfs64(fd, &st); + UnalignStatFS64_32(&st, buf); + return r; +} + +EXPORT int my32_statfs(const char* path, void* buf) +{ + struct statfs64 st; + int r = statfs64(path, &st); + UnalignStatFS_32(&st, buf); + return r; +} +EXPORT int my32_statfs64(const char* path, void* buf) +{ + struct statfs64 st; + int r = statfs64(path, &st); + UnalignStatFS64_32(&st, buf); + return r; +} +#if 0 + +#ifdef ANDROID +typedef int (*__compar_d_fn_t)(const void*, const void*, void*); + +static size_t qsort_r_partition(void* base, size_t size, __compar_d_fn_t compar, void* arg, size_t lo, size_t hi) +{ + void* tmp = malloc(size); + void* pivot = ((char*)base) + lo * size; + size_t i = lo; + for (size_t j = lo; j <= hi; j++) + { + void* base_i = ((char*)base) + i * size; + void* base_j = ((char*)base) + j * size; + if (compar(base_j, pivot, arg) < 0) + { + memcpy(tmp, base_i, size); + memcpy(base_i, base_j, size); + memcpy(base_j, tmp, size); + i++; + } + } + void* base_i = ((char *)base) + i * size; + void* base_hi = ((char *)base) + hi * size; + memcpy(tmp, base_i, size); + memcpy(base_i, base_hi, size); + memcpy(base_hi, tmp, size); + free(tmp); + return i; +} + +static void qsort_r_helper(void* base, size_t size, __compar_d_fn_t compar, void* arg, ssize_t lo, ssize_t hi) +{ + if (lo < hi) + { + size_t p = qsort_r_partition(base, size, compar, arg, lo, hi); + qsort_r_helper(base, size, compar, arg, lo, p - 1); + qsort_r_helper(base, size, compar, arg, p + 1, hi); + } +} + +static void qsort_r(void* base, size_t nmemb, size_t size, __compar_d_fn_t compar, void* arg) +{ + return qsort_r_helper(base, size, compar, arg, 0, nmemb - 1); +} +#endif +#endif +typedef struct compare_r_s { + x64emu_t* emu; + uintptr_t f; + void* data; + int r; +} compare_r_t; + +static int my32_compare_r_cb(void* a, void* b, compare_r_t* arg) +{ + return (int)RunFunctionWithEmu(arg->emu, 0, arg->f, 2+arg->r, a, b, arg->data); +} + +#ifndef ANDROID +EXPORT void my32_qsort(x64emu_t* emu, void* base, size_t nmemb, size_t size, void* fnc) +{ + compare_r_t args; + args.emu = emu; args.f = (uintptr_t)fnc; args.r = 0; args.data = NULL; + qsort_r(base, nmemb, size, (__compar_d_fn_t)my32_compare_r_cb, &args); +} +EXPORT void my32_qsort_r(x64emu_t* emu, void* base, size_t nmemb, size_t size, void* fnc, void* data) +{ + compare_r_t args; + args.emu = emu; args.f = (uintptr_t)fnc; args.r = 1; args.data = data; + qsort_r(base, nmemb, size, (__compar_d_fn_t)my32_compare_r_cb, &args); +} +#endif + +EXPORT void* my32_bsearch(x64emu_t* emu, void* key, void* base, size_t nmemb, size_t size, void* fnc) +{ + return bsearch(key, base, nmemb, size, findcompareFct(fnc)); +} + +EXPORT void* my32_lsearch(x64emu_t* emu, void* key, void* base, size_t* nmemb, size_t size, void* fnc) +{ + return lsearch(key, base, nmemb, size, findcompareFct(fnc)); +} +EXPORT void* my32_lfind(x64emu_t* emu, void* key, void* base, size_t* nmemb, size_t size, void* fnc) +{ + return lfind(key, base, nmemb, size, findcompareFct(fnc)); +} + +EXPORT void* my32_fts_open(x64emu_t* emu, void* path, int options, void* c) +{ + return fts_open(path, options, findcompareFct(c)); +} + +EXPORT void* my32_readdir(x64emu_t* emu, void* dirp) +{ + struct dirent64 *dp64 = readdir64((DIR *)dirp); + if (!dp64) return NULL; + static struct i386_dirent dp32 = {0}; + uint32_t ino32 = dp64->d_ino ^ (dp64->d_ino >> 32); + int32_t off32 = dp64->d_off; + dp32.d_ino = ino32; + dp32.d_off = off32; + dp32.d_reclen = sizeof(struct i386_dirent); + dp32.d_type = dp64->d_type; + strncpy(dp32.d_name, dp64->d_name, sizeof(dp32.d_name)); + return &dp32; +} +#if 0 + +EXPORT int32_t my32_readdir_r(x64emu_t* emu, void* dirp, void* entry, void** result) +{ + struct dirent64 d64, *dp64; + if (BOX64ENV(fix_64bit_inodes) && (sizeof(d64.d_name) > 1)) + { + static iFppp_t f = NULL; + if(!f) { + library_t* lib = my_lib; + if(!lib) + { + *result = NULL; + return 0; + } + f = (iFppp_t)dlsym(lib->priv.w.lib, "readdir64_r"); + } + + int r = f(dirp, &d64, &dp64); + if (r || !dp64 || !entry) + { + *result = NULL; + return r; + } + + struct i386_dirent *dp32 = (struct i386_dirent *)entry; + int namelen = dp64->d_reclen - offsetof(struct dirent64, d_name); + if (namelen > sizeof(dp32->d_name)) + { + *result = NULL; + return ENAMETOOLONG; + } + + dp32->d_ino = dp64->d_ino ^ (dp64->d_ino >> 32); + dp32->d_off = dp64->d_off; + dp32->d_reclen = namelen + offsetof(struct i386_dirent, d_name); + dp32->d_type = dp64->d_type; + memcpy(dp32->d_name, dp64->d_name, namelen); + *result = dp32; + return 0; + } + else + { + static iFppp_t f = NULL; + if(!f) { + library_t* lib = my_lib; + if(!lib) + { + *result = NULL; + return 0; + } + f = (iFppp_t)dlsym(lib->priv.w.lib, "readdir_r"); + } + + return f(dirp, entry, result); + } +} +#endif +static int isProcSelf(const char *path, const char* w) +{ + if(strncmp(path, "/proc/", 6)==0) { + char tmp[64]; + // check if self .... + sprintf(tmp, "/proc/self/%s", w); + if(strcmp((const char*)path, tmp)==0) + return 1; + // check if self PID .... + pid_t pid = getpid(); + sprintf(tmp, "/proc/%d/%s", pid, w); + if(strcmp((const char*)path, tmp)==0) + return 1; + } + return 0; +} + +#ifdef ANDROID +static int shm_open(const char *name, int oflag, mode_t mode) { + return -1; +} +static int shm_unlink(const char *name) { + return -1; +} +#endif + + +#ifdef DYNAREC +static int hasDBFromAddress(uintptr_t addr) +{ + int idx = (addr>>DYNAMAP_SHIFT); + return getDB(idx)?1:0; +} +#endif + +#ifndef input_event_sec +#define input_event_sec time.tv_sec +#endif +#ifndef input_event_usec +#define input_event_usec time.tv_usec +#endif + +EXPORT ssize_t my32_write(x64emu_t* emu, int fd, void* buf, size_t count) +{ + ssize_t ret; + if(isFDInputEvent(fd) && !(count%sizeof(my_input_event_32_t))) { + int n = count/sizeof(my_input_event_32_t); + struct input_event events[n]; + my_input_event_32_t* s = buf; + for(int i=0; i0) { + n = ret/sizeof(struct input_event); + ret = n*sizeof(my_input_event_32_t); + } + return ret; + } + return write(fd, buf, count); +} + +EXPORT ssize_t my32_read(int fd, void* buf, size_t count) +{ + ssize_t ret; + if(isFDInputEvent(fd) && !(count%sizeof(my_input_event_32_t))) { + int n = count/sizeof(my_input_event_32_t); + struct input_event events[n]; + ret = read(fd, events, sizeof(events)); + if(ret>0) { + n = ret/sizeof(struct input_event); + my_input_event_32_t* d = buf; + for(int i=0; i0 && BOX64ENV(dynarec)) { + // continue reading... + void* p = buf+ret; + if(hasDBFromAddress((uintptr_t)p)) { + // allow writing the whole block (this happens with HalfLife, libMiles load code directly from .mix and other file like that) + unprotectDB((uintptr_t)p, count-ret, 1); + int l; + do { + l = read(fd, p, count-ret); + if(l>0) { + p+=l; ret+=l; + } + } while(l>0); + } + } +#endif + return ret; +} + +EXPORT int my32_mkstemps64(x64emu_t* emu, char* template, int suffixlen) +{ +#if 0 + // No iFpi_t. Redundant until further notice. + library_t* lib = my_lib; + if(!lib) return 0; + void* f = dlsym(lib->priv.w.lib, "mkstemps64"); + if(f) + return ((iFpi_t)f)(template, suffixlen); +#endif + // implement own version... + // TODO: check size of template, and if really XXXXXX is there + char* fname = strdup(template); + do { + strcpy(fname, template); + char num[8]; + sprintf(num, "%06d", rand()%999999); + memcpy(fname+strlen(fname)-suffixlen-6, num, 6); + } while(!FileExist(fname, -1)); + int ret = open64(fname, O_EXCL); + free(fname); + return ret; +} + +EXPORT int32_t my32_ftw(x64emu_t* emu, void* pathname, void* B, int32_t nopenfd) +{ + return ftw64(pathname, findftwFct(B), nopenfd); +} +EXPORT int32_t my32_nftw(x64emu_t* emu, void* pathname, void* B, int32_t nopenfd, int32_t flags) +{ + return nftw64(pathname, findnftwFct(B), nopenfd, flags); +} + +EXPORT void* my32_ldiv(x64emu_t* emu, void* p, int32_t num, int32_t den) +{ + *((div_t*)p) = div(num, den); + return p; +} + +EXPORT int my32_epoll_create(x64emu_t* emu, int size) +{ + return epoll_create(size); +} +EXPORT int my32_epoll_create1(x64emu_t* emu, int flags) +{ + return epoll_create1(flags); +} +EXPORT int32_t my32_epoll_ctl(x64emu_t* emu, int32_t epfd, int32_t op, int32_t fd, void* event) +{ + struct epoll_event _event[1] = {0}; + if(event && (op!=EPOLL_CTL_DEL)) + AlignEpollEvent32(_event, event, 1); + return epoll_ctl(epfd, op, fd, event?_event:event); +} +EXPORT int32_t my32_epoll_wait(x64emu_t* emu, int32_t epfd, void* events, int32_t maxevents, int32_t timeout) +{ + struct epoll_event _events[maxevents]; + //AlignEpollEvent(_events, events, maxevents); + int32_t ret = epoll_wait(epfd, events?_events:NULL, maxevents, timeout); + if(ret>0) + UnalignEpollEvent32(events, _events, ret); + return ret; +} +typedef struct my_glob_32_s +{ + ulong_t gl_pathc; + ptr_t gl_pathv; //char** + ulong_t gl_offs; + int gl_flags; + ptr_t gl_closedir; //void (*gl_closedir) (void *); + ptr_t gl_readir; //struct dirent *(*gl_readdir) (void *); + ptr_t gl_opendir; //void *(*gl_opendir) (const char *); + ptr_t gl_lstat; //int (*gl_lstat) (const char *__restrict, struct stat *__restrict); + ptr_t gl_stat; //int (*gl_stat) (const char *__restrict, struct stat *__restrict); +} my_glob_32_t; +// glob64 is identical, except function are 64bits versions + +static void convert_glob_to_32(void* d, void* s, int is64) +{ + if(!d || !s) return; + glob_t* src = s; + my_glob_32_t* dst = d; + for(ulong_t i=0; igl_pathc; ++i) + ((ptr_t*)src->gl_pathv)[i] = to_ptrv(src->gl_pathv[i]); + dst->gl_pathc = to_ulong(src->gl_pathc); + dst->gl_pathv = to_ptrv(src->gl_pathv); + dst->gl_offs = to_ulong(src->gl_offs); + dst->gl_flags = src->gl_flags; + // TODO: functions pointers +} +static void convert_glob_to_64(void* d, void* s, int is64) +{ + if(!d || !s) return; + my_glob_32_t* src = s; + glob_t* dst = d; + dst->gl_pathc = from_ulong(src->gl_pathc); + dst->gl_pathv = from_ptrv(src->gl_pathv); + dst->gl_offs = from_ulong(src->gl_offs); + dst->gl_flags = src->gl_flags; + for(ulong_t i=dst->gl_pathc; i--;) + dst->gl_pathv[i] = from_ptrv(((ptr_t*)dst->gl_pathv)[i]); + // TODO: functions pointers +} + +EXPORT int32_t my32_glob(x64emu_t *emu, void* pat, int32_t flags, void* errfnc, void* pglob) +{ + glob64_t glob_l = {0}; + if(flags & GLOB_ALTDIRFUNC) printf_log(LOG_NONE, "Error: using unsupport GLOB_ALTDIRFUNC in glob\n"); + if(flags&(1<<5)) // GLOB_APPEND is used, so convert also before + convert_glob_to_64(&glob_l, pglob, 0); + int ret = glob64(pat, flags, findgloberrFct(errfnc), &glob_l); + convert_glob_to_32(pglob, &glob_l, 0); + return ret; +} +EXPORT void my32_globfree(x64emu_t* emu, void* pglob) +{ + glob64_t glob_l = {0}; + convert_glob_to_64(&glob_l, pglob, 0); + globfree64(&glob_l); +} +#ifndef ANDROID +EXPORT int32_t my32_glob64(x64emu_t *emu, void* pat, int32_t flags, void* errfnc, void* pglob) +{ + glob64_t glob_l = {0}; + if(flags & GLOB_ALTDIRFUNC) printf_log(LOG_NONE, "Error: using unsupport GLOB_ALTDIRFUNC in glob64\n"); + if(flags&(1<<5)) // GLOB_APPEND is used, so convert also before + convert_glob_to_64(&glob_l, pglob, 1); + int ret = glob64(pat, flags, findgloberrFct(errfnc), &glob_l); + convert_glob_to_32(pglob, &glob_l, 1); + return ret; +} +EXPORT void my32_globfree64(x64emu_t* emu, void* pglob) +{ + glob64_t glob_l = {0}; + convert_glob_to_64(&glob_l, pglob, 1); + globfree64(&glob_l); +} +#endif +EXPORT int my32_scandir(x64emu_t *emu, void* dir, ptr_t* namelist, void* sel, void* comp) +{ + struct dirent64** list = NULL; + int ret = scandir64(dir, &list, findfilter_dirFct(sel), findcompare_dirFct(comp)); + *namelist = to_ptrv(list); + if (ret>0) { + // adjust the array of dirent... inplace adjust of listname and inplace of dirent too + for(int i=0; id_ino ^ (dp64->d_ino >> 32); + int32_t off32 = dp64->d_off; + dp32->d_ino = ino32; + dp32->d_off = off32; + dp32->d_reclen = dp64->d_reclen-12; + dp32->d_type = dp64->d_type; + memmove(dp32->d_name, dp64->d_name, dp32->d_reclen-(sizeof(struct i386_dirent)-sizeof(dp32->d_name))); + // inplace shrink pointer to + ((ptr_t*)list)[i] = to_ptrv(list[i]); + } + } + return ret; +} +EXPORT int my32_scandir64(x64emu_t *emu, void* dir, ptr_t* namelist, void* sel, void* comp) +{ + struct dirent64** list; + int ret = scandir64(dir, &list, findfilter64Fct(sel), findcompare64Fct(comp)); + if(ret>=0) + *namelist = to_ptrv(list); + if (ret>0) { + // inplace shrink of the array of dirent pointer (the dirent themselves are ok) + for(int i=0; i0) { + n = ret/sizeof(struct input_event); + my_input_event_32_t* d = from_ptrv(iov[0].iov_base); + for(int i=0; ibashpath && FileIsShell(path))?1:0; + printf_log(LOG_DEBUG, "execv(\"%s\", %p[%s, %s]) is x64=%d, x86=%d, script=%d\n", path, argv, argv[0]?from_ptrv(argv[0]):"", argv[1]?from_ptrv(argv[1]):"", x64, x86, script); + if (x86 || x64 || script || self) { + int skip_first = 0; + if(strlen(path)>=strlen("wine-preloader") && strcmp(path+strlen(path)-strlen("wine-preloader"), "wine-preloader")==0) + skip_first++; + // count argv... + int n=skip_first; + while(argv[n]) ++n; + int toadd = script?2:1; + const char** newargv = (const char**)box_calloc(n+toadd+2, sizeof(char*)); + newargv[0] = x64?emu->context->box64path:emu->context->box64path; + if(script) newargv[1] = emu->context->bashpath; // script needs to be launched with bash + for(int i=0; icontext->fullpath; + else { + // TODO check if envp is not environ and add the value on a copy + if(strcmp(newargv[toadd], skip_first?from_ptrv(argv[skip_first]):path)) + setenv(x86?"BOX86_ARG0":"BOX64_ARG0", newargv[toadd], 1); + newargv[toadd] = skip_first?from_ptrv(argv[skip_first]):path; + } + printf_log(LOG_DEBUG, " => execv(\"%s\", %p [\"%s\", \"%s\", \"%s\"...:%d])\n", emu->context->box64path, newargv, newargv[0], n?newargv[1]:"", (n>1)?newargv[2]:"",n); + ret = execv(newargv[0], (char* const*)newargv); + box_free(newargv); + return ret; + } + // count argv and create the 64bits argv version + int n=0; + while(argv[n]) ++n; + char** newargv = (char**)box_calloc(n+1, sizeof(char*)); + for(int i=0; i<=n; ++i) + newargv[i] = from_ptrv(argv[i]); + if (BOX64ENV(steam_vulkan) && n == 3 && !strcmp(newargv[0], "sh") && !strcmp(newargv[1], "-c") && strstr(newargv[2], "steamwebhelper.sh")) { + // For some reason, Steam UI on RISC-V/LoongArch does not have hardware accel. + // To workaround this, we insert `--enable-features=Vulkan` to the exec of steamwebhelper to force Vulkan. + // For cases where there is an existing `--enable-features=` string: + static const char* vulkanstr1 = "Vulkan,"; + static const char* searchstr1 = "--enable-features="; + // For cases where there is no existing `--enable-features=` string: + static const char* vulkanstr2 = "--enable-features=Vulkan "; + static const char* searchstr2 = "--disable-features="; + + size_t bufsize = strlen(newargv[2]) + strlen(vulkanstr1); + char* pos = strstr(newargv[2], searchstr1); + if (!pos) { + size_t bufsize = strlen(newargv[2]) + strlen(vulkanstr2); + pos = strstr(newargv[2], searchstr2); + if (!pos) goto do_exec; + + char* newstr = (char*)box_calloc(bufsize + 1, 1); + size_t insertat = pos - newargv[2]; + strncpy(newstr, newargv[2], insertat); + newstr[insertat] = '\0'; + strcat(newstr, vulkanstr2); + strcat(newstr, newargv[2] + insertat); + newargv[2] = newstr; + goto do_exec; + } + char* newstr = (char*)box_calloc(bufsize + 1, 1); + size_t insertat = pos - newargv[2] + strlen(searchstr1); + strncpy(newstr, newargv[2], insertat); + newstr[insertat] = '\0'; + strcat(newstr, vulkanstr1); + strcat(newstr, newargv[2] + insertat); + newargv[2] = newstr; + } +do_exec: + ret = execv(path, (void*)newargv); + box_free(newargv); + return ret; +} + +EXPORT int32_t my32_execve(x64emu_t* emu, const char* path, ptr_t argv[], ptr_t envp[]) +{ + int self = isProcSelf(path, "exe"); + int x86 = FileIsX86ELF(path); + int x64 = FileIsX64ELF(path); + char** newenvp = NULL; + // hack to update the environ var if needed + if(envp == from_ptrv(my_context->envv32) && environ) + newenvp = environ; + else { + int n=0; + while(envp[n]) ++n; + newenvp = (char**)box_calloc(n+1, sizeof(char*)); + for(int i=0; i<=n; ++i) + newenvp[i] = from_ptrv(envp[i]); + } + int ret; + printf_log(LOG_DEBUG, "execve(\"%s\", %p, %p(%p)) is x86=%d\n", path, argv, envp, newenvp, x86); + if (x86 || x64 || self) { + int skip_first = 0; + if(strlen(path)>=strlen("wine-preloader") && strcmp(path+strlen(path)-strlen("wine-preloader"), "wine-preloader")==0) + skip_first++; + // count argv... + int n=skip_first; + while(argv[n]) ++n; + const char** newargv = (const char**)box_calloc(n+2, sizeof(char*)); + newargv[0] = x64?emu->context->box64path:emu->context->box64path; + for(int i=0; icontext->fullpath; + printf_log(LOG_DEBUG, " => execve(\"%s\", %p [\"%s\", \"%s\", \"%s\"...:%d])\n", emu->context->box64path, newargv, newargv[0], n?newargv[1]:"", (n>1)?newargv[2]:"",n); + ret = execve(newargv[0], (char* const*)newargv, newenvp); + box_free(newargv); + box_free(newenvp); + return ret; + } + // count argv and create the 64bits argv version + int n=0; + while(argv[n]) ++n; + const char** newargv = (const char**)box_calloc(n+1, sizeof(char*)); + for(int i=0; i<=n; ++i) + newargv[i] = from_ptrv(argv[i]); + + if(!strcmp(path + strlen(path) - strlen("/uname"), "/uname") + && newargv[1] && (!strcmp(newargv[1], "-m") || !strcmp(newargv[1], "-p") || !strcmp(newargv[1], "-i")) + && !newargv[2]) { + // uname -m is redirected to box32 -m + path = my_context->box64path; + const char *argv2[3] = { my_context->box64path, newargv[1], NULL }; + ret = execve(path, (void*)argv2, newenvp); + } else + ret = execve(path, (void*)newargv, newenvp); + box_free(newenvp); + return ret; +} + +// execvp should use PATH to search for the program first +EXPORT int32_t my32_execvp(x64emu_t* emu, const char* path, ptr_t argv[]) +{ + // need to use BOX32_PATH / PATH here... + char* fullpath = ResolveFile(path, &my_context->box64_path); + // use fullpath now + int self = isProcSelf(fullpath, "exe"); + int x86 = FileIsX86ELF(fullpath); + int x64 = FileIsX64ELF(fullpath); + int script = (my_context->bashpath && FileIsShell(path))?1:0; + int ret; + printf_log(LOG_DEBUG, "execvp(\"%s\", %p) is x86=%d, x64=%d script=%d\n", fullpath, argv, x86, x64, script); + if (x86 || x64 || script || self) { + int skip_first = 0; + if(strlen(fullpath)>=strlen("wine-preloader") && strcmp(fullpath+strlen(fullpath)-strlen("wine-preloader"), "wine-preloader")==0) + skip_first++; + // count argv... + int n=skip_first; + while(argv[n]) ++n; + int toadd = script?2:1; + const char** newargv = (const char**)box_calloc(n+toadd+2, sizeof(char*)); + newargv[0] = x64?emu->context->box64path:emu->context->box64path; + if(script) newargv[1] = emu->context->bashpath; // script needs to be launched with bash + for(int i=0; icontext->fullpath; + printf_log(LOG_DEBUG, " => execv(\"%s\", %p [\"%s\", \"%s\", \"%s\"...:%d])\n", emu->context->box64path, newargv, newargv[0], n?newargv[1]:"", (n>1)?newargv[2]:"",n); + int ret = execv(newargv[0], (char* const*)newargv); + box_free(newargv); + return ret; + } + // count argv and create the 64bits argv version + int n=0; + while(argv[n]) ++n; + char** newargv = (char**)box_calloc(n+1, sizeof(char*)); + for(int i=0; i<=n; ++i) + newargv[i] = from_ptrv(argv[i]); + if(!strcmp(path + strlen(path) - strlen("/uname"), "/uname") + && newargv[1] && (!strcmp(newargv[1], "-m") || !strcmp(newargv[1], "-p") || !strcmp(newargv[1], "-i")) + && !newargv[2]) { + // uname -m is redirected to box32 -m + path = my_context->box64path; + const char *argv2[3] = { my_context->box64path, newargv[1], NULL }; + ret = execv(path, (void*)argv2); + } else + ret = execv(fullpath, (void*)newargv); + box_free(newargv); + return ret; +} +// execvp should use PATH to search for the program first +EXPORT int32_t my32_execvpe(x64emu_t* emu, const char* path, ptr_t argv[], ptr_t envp[]) +{ + // need to use BOX32_PATH / PATH here... + char* fullpath = ResolveFile(path, &my_context->box64_path); + // use fullpath now + int self = isProcSelf(fullpath, "exe"); + int x86 = FileIsX86ELF(fullpath); + int x64 = FileIsX64ELF(fullpath); + int script = (my_context->bashpath && FileIsShell(path))?1:0; + char** newenvp = NULL; + // hack to update the environ var if needed + if(envp == from_ptrv(my_context->envv32) && environ) + newenvp = environ; + else { + int n=0; + while(envp[n]) ++n; + newenvp = (char**)box_calloc(n+1, sizeof(char*)); + for(int i=0; i<=n; ++i) + newenvp[i] = from_ptrv(envp[i]); + } + printf_log(LOG_DEBUG, "execvpe(\"%s\", %p, %p(%p%s)) is x86=%d x64=%d, scrit=%d\n", fullpath, argv, envp, newenvp, (newenvp==environ)?"=environ":"", x86, x64, script); + if (x86 || x64 || script || self) { + int skip_first = 0; + if(strlen(fullpath)>=strlen("wine-preloader") && strcmp(fullpath+strlen(fullpath)-strlen("wine-preloader"), "wine-preloader")==0) + skip_first++; + // count argv... + int n=skip_first; + while(argv[n]) ++n; + int toadd = script?2:1; + const char** newargv = (const char**)box_calloc(n+toadd+2, sizeof(char*)); + newargv[0] = x64?emu->context->box64path:emu->context->box64path; + if(script) newargv[1] = emu->context->bashpath; // script needs to be launched with bash + for(int i=0; i<=n; ++i) + newargv[i+toadd] = from_ptrv(argv[skip_first+i]); + if(self) newargv[1] = emu->context->fullpath; + printf_log(LOG_DEBUG, " => execv(\"%s\", %p [\"%s\", \"%s\", \"%s\"...:%d], %p)\n", emu->context->box64path, newargv, newargv[0], n?newargv[1]:"", (n>1)?newargv[2]:"",n, newenvp); + int ret = execve(newargv[0], (char* const*)newargv, (char* const*)newenvp); + box_free(newargv); + box_free(newenvp); + return ret; + } + // count argv and create the 64bits argv version + int n=0; + while(argv[n]) ++n; + char** newargv = (char**)calloc(n+1, sizeof(char*)); + for(int i=0; i<=n; ++i) + newargv[i] = from_ptrv(argv[i]); + if((!strcmp(fullpath + strlen(fullpath) - strlen("/uname"), "/uname") || !strcmp(path, "uname")) + && newargv[1] && (!strcmp(newargv[1], "-m") || !strcmp(newargv[1], "-p") || !strcmp(newargv[1], "-i")) + && !newargv[2]) { + // uname -m is redirected to box64 -m + path = my_context->box64path; + char *argv2[3] = { my_context->box64path, newargv[1], NULL }; + + int ret = execvpe(path, argv2, newenvp); + box_free(newargv); + box_free(newenvp); + return ret; + } + int ret = execve(fullpath, (void*)newargv, (void*)newenvp); + box_free(newargv); + box_free(newenvp); + return ret; +} + +typedef struct +{ + int __allocated; + int __used; + ptr_t __actions;//struct __spawn_action * + int __pad[16]; +} posix_spawn_file_actions_32_t; + +void convert_file_action_to_32(void* d, void* s) +{ + posix_spawn_file_actions_32_t* dst = d; + posix_spawn_file_actions_t* src = s; + dst->__allocated = src->__allocated; + dst->__used = src->__used; + dst->__actions = to_ptrv(src->__actions); +} +void convert_file_action_to_64(void* d, void* s) +{ + posix_spawn_file_actions_t* dst = d; + posix_spawn_file_actions_32_t* src = s; + dst->__actions = from_ptrv(src->__actions); + dst->__used = src->__used; + dst->__allocated = src->__allocated; +} + +EXPORT int my32_posix_spawn_file_actions_init(x64emu_t* emu, posix_spawn_file_actions_32_t* action) +{ + posix_spawn_file_actions_t action_l; + int ret = posix_spawn_file_actions_init(&action_l); + convert_file_action_to_32(action, &action_l); + return ret; +} +EXPORT int my32_posix_spawn_file_actions_addopen(x64emu_t* emu, posix_spawn_file_actions_32_t* action, int fides, const char* path, int oflag, int modes) +{ + posix_spawn_file_actions_t action_l = {0}; + convert_file_action_to_64(&action_l, action); + int ret = posix_spawn_file_actions_addopen(&action_l, fides, path, oflag, modes); + convert_file_action_to_32(action, &action_l); + return ret; +} + +EXPORT int my32_posix_spawn_file_actions_addclose(x64emu_t* emu, posix_spawn_file_actions_32_t* action, int fides) +{ + posix_spawn_file_actions_t action_l = {0}; + convert_file_action_to_64(&action_l, action); + int ret = posix_spawn_file_actions_addclose(&action_l, fides); + convert_file_action_to_32(action, &action_l); + return ret; +} + +EXPORT int my32_posix_spawn_file_actions_adddup2(x64emu_t* emu, posix_spawn_file_actions_32_t* action, int fides, int newfides) +{ + posix_spawn_file_actions_t action_l = {0}; + convert_file_action_to_64(&action_l, action); + int ret = posix_spawn_file_actions_adddup2(&action_l, fides, newfides); + convert_file_action_to_32(action, &action_l); + return ret; +} + +EXPORT int my32_posix_spawn_file_actions_destroy(x64emu_t* emu, posix_spawn_file_actions_32_t* action) +{ + posix_spawn_file_actions_t action_l; + convert_file_action_to_64(&action_l, action); + int ret = posix_spawn_file_actions_destroy(&action_l); + convert_file_action_to_32(action, &action_l); // just in case? + return ret; +} + +EXPORT int32_t my32_posix_spawn(x64emu_t* emu, pid_t* pid, const char* fullpath, + posix_spawn_file_actions_32_t *actions_s, const posix_spawnattr_t* attrp, ptr_t const argv[], ptr_t const envp[]) +{ + posix_spawn_file_actions_t actions_l = {0}; + posix_spawn_file_actions_t *actions = NULL; + if(actions_s) { + actions = &actions_l; + convert_file_action_to_64(actions, actions_s); + } + // use fullpath... + int self = isProcSelf(fullpath, "exe"); + int x86 = FileIsX86ELF(fullpath); + int x64 = FileIsX64ELF(fullpath); + char** newenvp = NULL; + // hack to update the environ var if needed + if(envp == from_ptrv(my_context->envv32) && environ) + newenvp = environ; + else { + int n=0; + while(envp[n]) ++n; + const char** newenvp = (const char**)calloc(n+1, sizeof(char*)); + for(int i=0; i<=n; ++i) + newenvp[i] = from_ptrv(envp[i]); + } + printf_log(LOG_DEBUG, "posix_spawn(%p, \"%s\", %p, %p, %p, %p), IsX86=%d / fullpath=\"%s\"\n", pid, fullpath, actions, attrp, argv, envp, x86, fullpath); + if ((x86 || self)) { + // count argv... + int i=0; + while(argv[i]) ++i; + char** newargv = (char**)calloc(i+2, sizeof(char*)); + newargv[0] = x64?emu->context->box64path:emu->context->box64path; + for (int j=0; jcontext->fullpath; + printf_log(LOG_DEBUG, " => posix_spawn(%p, \"%s\", %p, %p, %p [\"%s\", \"%s\"...:%d], %p)\n", pid, newargv[0], actions, attrp, newargv, newargv[1], i?newargv[2]:"", i, envp); + int ret = posix_spawnp(pid, newargv[0], actions, attrp, newargv, newenvp); + printf_log(LOG_DEBUG, "posix_spawn returned %d\n", ret); + //free(newargv); + return ret; + } + // count argv and create the 64bits argv version + int n=0; + while(argv[n]) ++n; + char** newargv = (char**)calloc(n+1, sizeof(char*)); + for(int i=0; i<=n; ++i) + newargv[i] = from_ptrv(argv[i]); + return posix_spawn(pid, fullpath, actions, attrp, newargv, newenvp); +} + +EXPORT int32_t my32_posix_spawnp(x64emu_t* emu, pid_t* pid, const char* path, + posix_spawn_file_actions_32_t *actions_s, const posix_spawnattr_t* attrp, ptr_t const argv[], ptr_t const envp[]) +{ + posix_spawn_file_actions_t actions_l = {0}; + posix_spawn_file_actions_t *actions = NULL; + if(actions_s) { + actions = &actions_l; + convert_file_action_to_64(actions, actions_s); + } + // need to use BOX32_PATH / PATH here... + char* fullpath = ResolveFile(path, &my_context->box64_path); + // use fullpath... + int self = isProcSelf(fullpath, "exe"); + int x86 = FileIsX86ELF(fullpath); + int x64 = FileIsX64ELF(fullpath); + char** newenvp = NULL; + // hack to update the environ var if needed + if(envp == from_ptrv(my_context->envv32) && environ) + newenvp = environ; + else { + int n=0; + while(envp[n]) ++n; + const char** newenvp = (const char**)calloc(n+1, sizeof(char*)); + for(int i=0; i<=n; ++i) + newenvp[i] = from_ptrv(envp[i]); + } + printf_log(LOG_DEBUG, "posix_spawnp(%p, \"%s\", %p, %p, %p, %p), IsX86=%d / fullpath=\"%s\"\n", pid, path, actions, attrp, argv, envp, x86, fullpath); + free(fullpath); + if ((x86 || self)) { + // count argv... + int i=0; + while(argv[i]) ++i; + char** newargv = (char**)calloc(i+2, sizeof(char*)); + newargv[0] = x64?emu->context->box64path:emu->context->box64path; + for (int j=0; jcontext->fullpath; + printf_log(LOG_DEBUG, " => posix_spawnp(%p, \"%s\", %p, %p, %p [\"%s\", \"%s\"...:%d], %p)\n", pid, newargv[0], actions, attrp, newargv, newargv[1], i?newargv[2]:"", i, envp); + int ret = posix_spawnp(pid, newargv[0], actions, attrp, newargv, newenvp); + printf_log(LOG_DEBUG, "posix_spawnp returned %d\n", ret); + //free(newargv); + return ret; + } + // count argv and create the 64bits argv version + int n=0; + while(argv[n]) ++n; + char** newargv = (char**)calloc(n+1, sizeof(char*)); + for(int i=0; i<=n; ++i) + newargv[i] = from_ptrv(argv[i]); + return posix_spawnp(pid, path, actions, attrp, newargv, newenvp); +} + +EXPORT void my32__Jv_RegisterClasses() {} + +EXPORT int32_t my32___cxa_thread_atexit_impl(x64emu_t* emu, void* dtor, void* obj, void* dso) +{ + printf_log(LOG_INFO, "Warning, call to __cxa_thread_atexit_impl(%p, %p, %p) ignored\n", dtor, obj, dso); + return 0; +} +#ifndef ANDROID +extern void __chk_fail(); +EXPORT unsigned long int my32___fdelt_chk (unsigned long int d) +{ + if (d >= FD_SETSIZE) + __chk_fail (); + + return d / __NFDBITS; +} +#endif + +EXPORT int my32_getrlimit(x64emu_t* emu, int what, uint32_t* pr) +{ + struct rlimit64 l = {0}; + int ret = getrlimit64(what, &l); + if(pr) { + pr[0] = (l.rlim_cur<0x100000000LL)?l.rlim_cur:0xffffffff; + pr[1] = (l.rlim_max<0x100000000LL)?l.rlim_max:0xffffffff; + } + return ret; +} +EXPORT int my32_setrlimit(x64emu_t* emu, int what, uint32_t* pr) +{ + struct rlimit64 l = {0}; + l.rlim_cur = (pr[0]!=0xffffffff)?pr[0]:0xffffffffffffffffLL; + l.rlim_max = (pr[1]!=0xffffffff)?pr[1]:0xffffffffffffffffLL; + return setrlimit64(what, &l); +} + +EXPORT void* my32___localtime64(x64emu_t* emu, void* t) +{ + static struct tm l = {}; + l = *localtime(t); + return &l; +} + +EXPORT void* my32_localtime(x64emu_t* emu, void* t) +{ + struct_L_t t_ = {0}; + static struct_iiiiiiiiilt_t res_ = {0}; + if(t) from_struct_L(&t_, to_ptrv(t)); + void* ret = localtime(t?((void*)&t_):NULL); + if(ret) { + to_struct_iiiiiiiiilt(to_ptrv(&res_), ret); + return &res_; + } + return NULL; +} + +EXPORT long my32_timegm(x64emu_t* emu, void* t) +{ + long ret = timegm(t); + if((ret>0 && ret>0x7fffffffLL) || (ret<0 && ret<-0x80000000LL)) { + ret = -1; + errno = EOVERFLOW; + } + return ret; +} + +EXPORT void* my32_localtime_r(x64emu_t* emu, void* t, void* res) +{ + struct_L_t t_ = {0}; + struct_iiiiiiiiilt_t res_ = {0}; + if(t) from_struct_L(&t_, to_ptrv(t)); + if(res) from_struct_iiiiiiiiilt(&res_, to_ptrv(res)); + void* ret = localtime_r(t?((void*)&t_):NULL, res?((void*)&res_):NULL); + if(ret==&res_) { + to_struct_iiiiiiiiilt(to_ptrv(res), &res_); + return res; + } + return NULL; +} + +EXPORT void* my32_gmtime(x64emu_t* emu, void* t) +{ + struct_L_t t_ = {0}; + static struct_iiiiiiiiilt_t res_ = {0}; + if(t) from_struct_L(&t_, to_ptrv(t)); + void* ret = gmtime(t?((void*)&t_):NULL); + if(ret) { + to_struct_iiiiiiiiilt(to_ptrv(&res_), ret); + return &res_; + } + return NULL; +} + +EXPORT void* my32___gmtime64(x64emu_t* emu, void* t) +{ + static struct_iiiiiiiiilt_t res_ = {0}; + void* ret = gmtime(t); + if(ret) { + to_struct_iiiiiiiiilt(to_ptrv(&res_), ret); + return &res_; + } + return NULL; +} + +EXPORT void* my32_gmtime_r(x64emu_t* emu, void* t, void* res) +{ + struct_L_t t_ = {0}; + struct_iiiiiiiiilt_t res_ = {0}; + if(t) from_struct_L(&t_, to_ptrv(t)); + if(res) from_struct_iiiiiiiiilt(&res_, to_ptrv(res)); + void* ret = gmtime_r(t?((void*)&t_):NULL, res?((void*)&res_):NULL); + if(ret==&res_) { + to_struct_iiiiiiiiilt(to_ptrv(res), &res_); + return res; + } + return NULL; +} + +EXPORT void* my32_asctime(void* t) +{ + static char ret[200]; + char* r = asctime(t); + if(!r) return NULL; + strncpy(ret, r, sizeof(ret)-1); + return &ret; +} +EXPORT void* my32_ctime(void* t) +{ + static char ret[200]; + char* r = ctime(t); + if(!r) return NULL; + strncpy(ret, r, sizeof(ret)-1); + return &ret; +} + +EXPORT int my32_utimensat(int dirfd, void* name, void* times, int flags) +{ + struct timespec times_l[2] = {0}; + from_struct_LL((struct_LL_t*)×_l[0], to_ptrv(times)); + from_struct_LL((struct_LL_t*)×_l[1], to_ptrv(times)+8); + return utimensat(dirfd, name, times_l, flags); +} + +#ifndef ANDROID +struct mallinfo { + int arena; + int ordblks; + int smblks; + int hblks; + int hblkhd; + int usmblks; + int fsmblks; + int uordblks; + int fordblks; + int keepcost; +}; +#endif + +EXPORT void* my32_mallinfo(x86emu_t* emu, void* p) +{ + (void)emu; + static struct mallinfo(*p_mallinfo)() = NULL; + if(!p_mallinfo) p_mallinfo = dlsym(NULL, "mallinfo"); + *((struct mallinfo*)p) = p_mallinfo(); + return p; +} + + +EXPORT void* my32_getpwuid(x64emu_t* emu, uint32_t uid) +{ + static struct i386_passwd ret; + struct passwd* p = getpwuid(uid); + if(p) { + ret.pw_name = to_cstring(p->pw_name); + ret.pw_passwd = to_cstring(p->pw_passwd); + ret.pw_uid = p->pw_uid; + ret.pw_gid = p->pw_gid; + ret.pw_gecos = to_cstring(p->pw_gecos); + ret.pw_dir = to_cstring(p->pw_dir); + ret.pw_shell = to_cstring(p->pw_shell); + return &ret; + } + return NULL; +} + +EXPORT int my32_getpwuid_r(x64emu_t* emu, uint32_t uid, struct i386_passwd* pwd, char *buf, size_t buflen, ptr_t* result) +{ + struct passwd _result = {0}; + struct passwd *r = NULL; + int ret = getpwuid_r(uid, &_result, buf, buflen, &r); + if(!r) { + *result = 0; + return ret; + } + *result = to_ptrv(pwd); + struct i386_passwd *res = pwd; + res->pw_name = to_ptrv(r->pw_name); + res->pw_passwd = to_ptrv(r->pw_passwd); + res->pw_uid = r->pw_uid; + res->pw_gid = r->pw_gid; + res->pw_gecos = to_ptrv(r->pw_gecos); + res->pw_dir = to_ptrv(r->pw_dir); + res->pw_shell = to_ptrv(r->pw_shell); + return ret; +} + +EXPORT void* my32_getpwent(x64emu_t* emu) +{ + static struct i386_passwd ret; + struct passwd* p = getpwent(); + if(p) { + ret.pw_name = to_cstring(p->pw_name); + ret.pw_passwd = to_cstring(p->pw_passwd); + ret.pw_uid = p->pw_uid; + ret.pw_gid = p->pw_gid; + ret.pw_gecos = to_cstring(p->pw_gecos); + ret.pw_dir = to_cstring(p->pw_dir); + ret.pw_shell = to_cstring(p->pw_shell); + return &ret; + } + return NULL; +} + +EXPORT int my32_getgrnam_r(x64emu_t* emu, const char* name, struct i386_group *grp, char *buf, size_t buflen, ptr_t* result) +{ + struct group _result = {0}; + struct group *r = NULL; + int ret = getgrnam_r(name, &_result, buf, buflen, &r); + if(!r) { + *result = 0; + return ret; + } + *result = to_ptrv(grp); + struct i386_group *res = grp; + res->gr_name = to_ptrv(r->gr_name); + res->gr_passwd = to_ptrv(r->gr_passwd); + res->gr_gid = r->gr_gid; + res->gr_mem = to_ptrv(r->gr_mem); + return ret; +} + +EXPORT void* my32_getgrnam(x64emu_t* emu, void* name) +{ + static struct i386_group ret; + struct group *grp = getgrnam(name); + if(!grp) return NULL; + ret.gr_name = to_ptrv(grp->gr_name); + ret.gr_passwd = to_ptrv(grp->gr_passwd); + ret.gr_gid = grp->gr_gid; + ret.gr_mem = to_ptrv(grp->gr_mem); + return &ret; +} + +EXPORT int my32_getgrgid_r(x64emu_t* emu, gid_t gid, struct i386_group *grp, char *buf, size_t buflen, ptr_t* result) +{ + struct group _result = {0}; + struct group *r = NULL; + int ret = getgrgid_r(gid, &_result, buf, buflen, &r); + if(!r) { + *result = 0; + return ret; + } + *result = to_ptrv(grp); + struct i386_group *res = grp; + res->gr_name = to_ptrv(r->gr_name); + res->gr_passwd = to_ptrv(r->gr_passwd); + res->gr_gid = r->gr_gid; + res->gr_mem = to_ptrv(r->gr_mem); + return ret; +} + +EXPORT int32_t my32___register_atfork(x64emu_t *emu, void* prepare, void* parent, void* child, void* handle) +{ + // this is partly incorrect, because the emulated funcionts should be executed by actual fork and not by my32_atfork... + if(my_context->atfork_sz==my_context->atfork_cap) { + my_context->atfork_cap += 4; + my_context->atforks = (atfork_fnc_t*)realloc(my_context->atforks, my_context->atfork_cap*sizeof(atfork_fnc_t)); + } + int i = my_context->atfork_sz++; + my_context->atforks[i].prepare = (uintptr_t)prepare; + my_context->atforks[i].parent = (uintptr_t)parent; + my_context->atforks[i].child = (uintptr_t)child; + my_context->atforks[i].handle = handle; + return 0; +} + +EXPORT uint64_t my32___umoddi3(uint64_t a, uint64_t b) +{ + return a%b; +} +EXPORT uint64_t my32___udivdi3(uint64_t a, uint64_t b) +{ + return a/b; +} +EXPORT int64_t my32___divdi3(int64_t a, int64_t b) +{ + return a/b; +} + +EXPORT int32_t my32___poll_chk(void* a, uint32_t b, int c, size_t l) +{ + return poll(a, b, c); // no check... +} + +EXPORT int32_t my32_fcntl64(x64emu_t* emu, int32_t a, int32_t b, uint32_t d1, uint32_t d2, uint32_t d3, uint32_t d4, uint32_t d5, uint32_t d6) +{ + // Implemented starting glibc 2.14+ + library_t* lib = my_lib; + if(!lib) return 0; + if(b==F_SETFL) + d1 = of_convert32(d1); + if (b == MY32_F_GETLK64 || b == MY32_F_SETLK64 || b == MY32_F_SETLKW64) { + my_flock64_t fl = {0}; + AlignFlock64_32(&fl, from_ptrv(d1)); + int ret = fcntl(a, b - (MY32_F_GETLK64 - MY32_F_GETLK), &fl); + UnalignFlock64_32(from_ptrv(d1), &fl); + return ret; + } + if (b == MY32_F_GETLK || b == MY32_F_SETLK || b == MY32_F_SETLKW) { + struct flock fl = {0}; + AlignFlock_32(&fl, from_ptrv(d1)); + int ret = fcntl(a, b, &fl); + UnalignFlock_32(from_ptrv(d1), &fl); + return ret; + //TODO: there might be some time related wells that need wrapping too + } + //TODO: check if better to use the syscall or regular fcntl? + //return syscall(__NR_fcntl64, a, b, d1); // should be enough + int ret = fcntl(a, b, d1); + + if(b==F_GETFL && ret!=-1) + ret = of_unconvert32(ret); + + return ret; +} + +EXPORT int32_t my32_fcntl(x64emu_t* emu, int32_t a, int32_t b, uint32_t d1, uint32_t d2, uint32_t d3, uint32_t d4, uint32_t d5, uint32_t d6) +{ + if(b==F_SETFL && d1==0xFFFFF7FF) { + // special case for ~O_NONBLOCK... + int flags = fcntl(a, F_GETFL); + if(flags&X86_O_NONBLOCK) { + flags &= ~O_NONBLOCK; + return fcntl(a, b, flags); + } + return 0; + } + if(b==F_SETFL) + d1 = of_convert32(d1); + if (b == MY32_F_GETLK64 || b == MY32_F_SETLK64 || b == MY32_F_SETLKW64) { + my_flock64_t fl = {0}; + AlignFlock64_32(&fl, from_ptrv(d1)); + int ret = fcntl(a, b - (MY32_F_GETLK64 - MY32_F_GETLK), &fl); + UnalignFlock64_32(from_ptrv(d1), &fl); + return ret; + } + if (b == MY32_F_GETLK || b == MY32_F_SETLK || b == MY32_F_SETLKW) { + struct flock fl = {0}; + AlignFlock_32(&fl, from_ptrv(d1)); + int ret = fcntl(a, b, &fl); + UnalignFlock_32(from_ptrv(d1), &fl); + return ret; + } + int ret = fcntl(a, b, d1); + if(b==F_GETFL && ret!=-1) + ret = of_unconvert32(ret); + + return ret; +} +EXPORT int32_t my32___fcntl(x64emu_t* emu, int32_t a, int32_t b, uint32_t d1, uint32_t d2, uint32_t d3, uint32_t d4, uint32_t d5, uint32_t d6) __attribute__((alias("my32_fcntl"))); +#if 0 +EXPORT int32_t my32_preadv64(x64emu_t* emu, int32_t fd, void* v, int32_t c, int64_t o) +{ + library_t* lib = my_lib; + if(!lib) return 0; + void* f = dlsym(lib->priv.w.lib, "preadv64"); + if(f) + return ((iFipiI_t)f)(fd, v, c, o); + return syscall(__NR_preadv, fd, v, c,(uint32_t)(o&0xffffffff), (uint32_t)((o>>32)&0xffffffff)); +} + +EXPORT int32_t my32_pwritev64(x64emu_t* emu, int32_t fd, void* v, int32_t c, int64_t o) +{ + library_t* lib = my_lib; + if(!lib) return 0; + void* f = dlsym(lib->priv.w.lib, "pwritev64"); + if(f) + return ((iFipiI_t)f)(fd, v, c, o); + #ifdef __arm__ + return syscall(__NR_pwritev, fd, v, c, 0, (uint32_t)(o&0xffffffff), (uint32_t)((o>>32)&0xffffffff)); + // on arm, 64bits args needs to be on even/odd register, so need to put a 0 for aligment + #else + return syscall(__NR_pwritev, fd, v, c,(uint32_t)(o&0xffffffff), (uint32_t)((o>>32)&0xffffffff)); + #endif +} + +EXPORT int32_t my32_accept4(x64emu_t* emu, int32_t fd, void* a, void* l, int32_t flags) +{ + library_t* lib = my_lib; + if(!lib) return 0; + void* f = dlsym(lib->priv.w.lib, "accept4"); + if(f) + return ((iFippi_t)f)(fd, a, l, flags); + if(!flags) + return accept(fd, a, l); + return syscall(__NR_accept4, fd, a, l, flags); +} + +EXPORT int my32_getopt(int argc, char* const argv[], const char *optstring) +{ + int ret = getopt(argc, argv, optstring); + my32_checkGlobalOpt(); + return ret; +} + +#endif +EXPORT int my32_getopt_long(int argc, char* const argv[], const char* optstring, const struct option *longopts, int *longindex) +{ + int ret = getopt_long(argc, argv, optstring, longopts, longindex); + my32_checkGlobalOpt(); + return ret; +} + +EXPORT int my32_getopt_long_only(int argc, char* const argv[], const char* optstring, const struct option *longopts, int *longindex) +{ + int ret = getopt_long_only(argc, argv, optstring, longopts, longindex); + my32_checkGlobalOpt(); + return ret; +} + +EXPORT int my32_alphasort64(x64emu_t* emu, ptr_t* d1_, ptr_t* d2_) +{ + const struct dirent64* d1 = NULL; + const struct dirent64* d2 = NULL; + if(d1_) d1 = (struct dirent64*)from_ptrv(*d1_); + if(d2_) d2 = (struct dirent64*)from_ptrv(*d2_); + return alphasort64(d1_?(&d1):NULL, d2_?(&d2):NULL); +} + +#ifndef ANDROID +EXPORT void* my32___ctype_b_loc(x64emu_t* emu) +{ + const unsigned short** src =__ctype_b_loc(); + if(*src != emu->ref_ctype) { + memcpy(emu->libctype, &((*src)[-128]), 384*sizeof(short)); + emu->ref_ctype = *src; + emu->ctype = emu->libctype+128; + } + return &emu->ctype; +} +EXPORT void* my32___ctype_tolower_loc(x64emu_t* emu) +{ + const int** src =__ctype_tolower_loc(); + if(*src != emu->ref_tolower) { + memcpy(emu->libctolower, &((*src)[-128]), 384*sizeof(int)); + emu->ref_tolower = *src; + emu->tolower = emu->libctolower+128; + } + return &emu->tolower; +} +EXPORT void* my32___ctype_toupper_loc(x64emu_t* emu) +{ + const int** src =__ctype_toupper_loc(); + if(*src != emu->ref_toupper) { + memcpy(emu->libctoupper, &((*src)[-128]), 384*sizeof(int)); + emu->ref_toupper = *src; + emu->toupper = emu->libctoupper+128; + } + return &emu->toupper; +} +#endif + +// Backtrace stuff: TODO in 32bits + +//#include "elfs/elfdwarf_private.h" +EXPORT int my32_backtrace(x64emu_t* emu, void** buffer, int size) +{ + if (!size) return 0; + #if 0 + dwarf_unwind_t *unwind = init_dwarf_unwind_registers(emu); + int idx = 0; + char success = 0; + uintptr_t addr = *(uintptr_t*)R_RSP; + buffer[0] = (void*)addr; + while (++idx < size) { + uintptr_t ret_addr = get_parent_registers(unwind, FindElfAddress(my_context, addr), addr, &success); + if (ret_addr == my_context->exit_bridge) { + // TODO: do something to be able to get the function name + buffer[idx] = (void*)ret_addr; + success = 2; + // See elfdwarf_private.c for the register mapping + unwind->regs[7] = unwind->regs[6]; // mov rsp, rbp + unwind->regs[6] = *(uint64_t*)unwind->regs[7]; // pop rbp + unwind->regs[7] += 8; + ret_addr = *(uint64_t*)unwind->regs[7]; // ret + unwind->regs[7] += 8; + if (++idx < size) buffer[idx] = (void*)ret_addr; + } else if (!success) break; + else buffer[idx] = (void*)ret_addr; + addr = ret_addr; + } + free_dwarf_unwind_registers(&unwind); + return idx; + #else + uintptr_t addr = from_ptr(*(ptr_t*)from_ptrv(R_ESP)); + buffer[0] = (void*)addr; + return 1; + #endif +} + +EXPORT void* my32_backtrace_symbols(x64emu_t* emu, ptr_t* buffer, int size) +{ + (void)emu; + ptr_t* ret = (ptr_t*)calloc(1, size*sizeof(ptr_t) + size*200); // capping each strings to 200 chars, not using box_calloc (program space) + char* s = (char*)(ret+size); + for (int i=0; i=start && (buffer[i]<(start+sz) || !sz)) { + snprintf(s, 200, "%s(%s+%lx) [%p]", ElfName(hdr), symbname, buffer[i] - start, from_ptrv(buffer[i])); + } else if (hdr) { + snprintf(s, 200, "%s+%lx [%p]", ElfName(hdr), buffer[i] - (uintptr_t)GetBaseAddress(hdr), from_ptrv(buffer[i])); + } else { + snprintf(s, 200, "??? [%p]", from_ptrv(buffer[i])); + } + ret[i] = to_ptrv(s); + s += 200; + } + return ret; +} + +struct i386_lconv +{ + ptr_t decimal_point; // char * + ptr_t thousands_sep; // char * + ptr_t grouping; // char * + ptr_t int_curr_symbol; // char * + ptr_t currency_symbol; // char * + ptr_t mon_decimal_point; // char * + ptr_t mon_thousands_sep; // char * + ptr_t mon_grouping; // char * + ptr_t positive_sign; // char * + ptr_t negative_sign; // char * + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; + char int_p_cs_precedes; + char int_p_sep_by_space; + char int_n_cs_precedes; + char int_n_sep_by_space; + char int_p_sign_posn; + char int_n_sign_posn; +}; +EXPORT void* my32_localeconv(x64emu_t* emu) +{ + static struct i386_lconv ret = {0}; + struct lconv* l = localeconv(); + ret.decimal_point = to_cstring(l->decimal_point); + ret.thousands_sep = to_cstring(l->thousands_sep); + ret.grouping = to_cstring(l->grouping); + ret.int_curr_symbol = to_cstring(l->int_curr_symbol); + ret.currency_symbol = to_cstring(l->currency_symbol); + ret.mon_decimal_point = to_cstring(l->mon_decimal_point); + ret.mon_thousands_sep = to_cstring(l->mon_thousands_sep); + ret.mon_grouping = to_cstring(l->mon_grouping); + ret.positive_sign = to_cstring(l->positive_sign); + ret.negative_sign = to_cstring(l->negative_sign); + memcpy(&ret.int_frac_digits, &l->int_frac_digits, 14); + return &ret; +} +locale_t l; +EXPORT struct __processor_model +{ + unsigned int __cpu_vendor; + unsigned int __cpu_type; + unsigned int __cpu_subtype; + unsigned int __cpu_features[1]; +} my32___cpu_model; + +#include "cpu_info.h" +void InitCpuModel() +{ + // some pseudo random cpu info... + my32___cpu_model.__cpu_vendor = VENDOR_INTEL; + my32___cpu_model.__cpu_type = INTEL_PENTIUM_M; + my32___cpu_model.__cpu_subtype = 0; // N/A + my32___cpu_model.__cpu_features[0] = (1<__jmpbuf; + //restore regs + R_EBX = jpbuff->save_ebx; + R_ESI = jpbuff->save_esi; + R_EDI = jpbuff->save_edi; + R_EBP = jpbuff->save_ebp; + R_ESP = jpbuff->save_esp; + // jmp to saved location, plus restore val to eax + R_EAX = __val?__val:1; + R_EIP = jpbuff->save_eip; + if(((__jmp_buf_tag_t*)p)->__mask_was_saved) { + sigprocmask(SIG_SETMASK, &((__jmp_buf_tag_t*)p)->__saved_mask, NULL); + } + if(emu->flags.quitonlongjmp) { + emu->flags.longjmp = 1; + emu->quit = 1; + } +} + +EXPORT int32_t my32___sigsetjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p, int savesigs) +{ + jump_buff_i386_t *jpbuff = &((__jmp_buf_tag_t*)p)->__jmpbuf; + // save the buffer + jpbuff->save_ebx = R_EBX; + jpbuff->save_esi = R_ESI; + jpbuff->save_edi = R_EDI; + jpbuff->save_ebp = R_EBP; + jpbuff->save_esp = R_ESP+4; // include "return address" + jpbuff->save_eip = *(uint32_t*)from_ptr(R_ESP); + if(savesigs) { + if(sigprocmask(SIG_SETMASK, NULL, &((__jmp_buf_tag_t*)p)->__saved_mask)) + ((__jmp_buf_tag_t*)p)->__mask_was_saved = 0; + else + ((__jmp_buf_tag_t*)p)->__mask_was_saved = 1; + } else + ((__jmp_buf_tag_t*)p)->__mask_was_saved = 0; + return 0; +} + +EXPORT int32_t my32__setjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p) +{ + return my32___sigsetjmp(emu, p, 0); +} +EXPORT int32_t my32_setjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void *p) +{ + return my32___sigsetjmp(emu, p, 1); +} +EXPORT void my32___explicit_bzero_chk(x64emu_t* emu, void* dst, uint32_t len, uint32_t dstlen) +{ + memset(dst, 0, len); +} + +EXPORT void* my32_getpwnam(x64emu_t* emu, const char* name) +{ + static struct i386_passwd ret; + struct passwd *r = getpwnam(name); + if(!r) + return NULL; + ret.pw_name = to_ptrv(r->pw_name); + ret.pw_passwd = to_ptrv(r->pw_passwd); + ret.pw_uid = r->pw_uid; + ret.pw_gid = r->pw_gid; + ret.pw_gecos = to_ptrv(r->pw_gecos); + ret.pw_dir = to_ptrv(r->pw_dir); + ret.pw_shell = to_ptrv(r->pw_shell); + return &ret; +} + +EXPORT int my32_getpwnam_r(x64emu_t* emu, const char *name, struct i386_passwd *pwd, char *buf, size_t buflen, ptr_t *result) +{ + struct passwd _result = {0}; + struct passwd *r = NULL; + int ret = getpwnam_r(name, &_result, buf, buflen, &r); + if(!r) { + *result = 0; + return ret; + } + *result = to_ptrv(pwd); + struct i386_passwd *res = pwd; + res->pw_name = to_ptrv(r->pw_name); + res->pw_passwd = to_ptrv(r->pw_passwd); + res->pw_uid = r->pw_uid; + res->pw_gid = r->pw_gid; + res->pw_gecos = to_ptrv(r->pw_gecos); + res->pw_dir = to_ptrv(r->pw_dir); + res->pw_shell = to_ptrv(r->pw_shell); + return ret; +} + +EXPORT void* my32_realpath(x64emu_t* emu, void* path, void* resolved_path) +{ + + if(isProcSelf(path, "exe")) { + return realpath(emu->context->fullpath, resolved_path); + } + return realpath(path, resolved_path); +} + +EXPORT int my32_readlinkat(x64emu_t* emu, int fd, void* path, void* buf, size_t bufsize) +{ + if(isProcSelf(path, "exe")) { + strncpy(buf, emu->context->fullpath, bufsize); + size_t l = strlen(emu->context->fullpath); + return (l>bufsize)?bufsize:(l+1); + } + return readlinkat(fd, path, buf, bufsize); +} + +struct i386_mntent { + ptr_t mnt_fsname; // char * + ptr_t mnt_dir; // char * + ptr_t mnt_type; // char * + ptr_t mnt_opts; // char * + int mnt_freq; + int mnt_passno; +}; + +EXPORT void* my32_getmntent(x64emu_t* emu, void* f) +{ + static struct i386_mntent ret; + struct mntent* r = getmntent(f); + if(!r) return NULL; + ret.mnt_fsname = to_cstring(r->mnt_fsname); + ret.mnt_dir = to_cstring(r->mnt_dir); + ret.mnt_type = to_cstring(r->mnt_type); + ret.mnt_opts = to_cstring(r->mnt_opts); + ret.mnt_freq = r->mnt_freq; + ret.mnt_passno = r->mnt_passno; + return &ret; +} + +void* my_mmap64(x64emu_t* emu, void *addr, size_t length, int prot, int flags, int fd, ssize_t offset); +void* my_mremap(x64emu_t* emu, void* old_addr, size_t old_size, size_t new_size, int flags, void* new_addr); +int my_munmap(x64emu_t* emu, void* addr, size_t length); +int my_mprotect(x64emu_t* emu, void *addr, size_t len, int prot); + +EXPORT void* my32_mmap64(x64emu_t* emu, void *addr, size_t length, int prot, int flags, int fd, int64_t offset) +{ + void* ret = my_mmap64(emu, addr, length, prot, flags|MAP_32BIT, fd, offset); + if((ret!=MAP_FAILED) && (((uintptr_t)ret>0xffffffff) || ((uintptr_t)ret+length>0xffffffff))) { + my_munmap(emu, ret, length); + errno = EEXIST; + return MAP_FAILED; + } + if((ret!=MAP_FAILED) && addr && (retr, 3, cookie->cookie, buf, size); +} +static ssize_t my32_cookie_write(void *p, const char *buf, size_t size) +{ + my32_cookie_t* cookie = (my32_cookie_t*)p; + return (ssize_t)RunFunction(my_context, cookie->w, 3, cookie->cookie, buf, size); +} +static int my32_cookie_seek(void *p, off64_t *offset, int whence) +{ + my32_cookie_t* cookie = (my32_cookie_t*)p; + return RunFunction(my_context, cookie->s, 3, cookie->cookie, offset, whence); +} +static int my32_cookie_close(void *p) +{ + my32_cookie_t* cookie = (my32_cookie_t*)p; + int ret = 0; + if(cookie->c) + ret = RunFunction(my_context, cookie->c, 1, cookie->cookie); + free(cookie); + return ret; +} +EXPORT void* my32_fopencookie(x64emu_t* emu, void* cookie, void* mode, void* read, void* write, void* seek, void* close) +{ + cookie_io_functions_t io_funcs = {read?my32_cookie_read:NULL, write?my32_cookie_write:NULL, seek?my32_cookie_seek:NULL, my32_cookie_close}; + my32_cookie_t *cb = (my32_cookie_t*)calloc(1, sizeof(my32_cookie_t)); + cb->r = (uintptr_t)read; + cb->w = (uintptr_t)write; + cb->s = (uintptr_t)seek; + cb->c = (uintptr_t)close; + cb->cookie = cookie; + return fopencookie(cb, mode, io_funcs); +} +#endif + +EXPORT long my32_prlimit64(void* pid, uint32_t res, void* new_rlim, void* old_rlim) +{ + return syscall(__NR_prlimit64, pid, res, new_rlim, old_rlim); +} +#endif +EXPORT void* my32_reallocarray(void* ptr, size_t nmemb, size_t size) +{ + return realloc(ptr, nmemb*size); +} +#if 0 +#ifndef __OPEN_NEEDS_MODE +# define __OPEN_NEEDS_MODE(oflag) \ + (((oflag) & O_CREAT) != 0) +// || ((oflag) & __O_TMPFILE) == __O_TMPFILE) +#endif +EXPORT int my32___open_nocancel(x64emu_t* emu, void* file, int oflag, int* b) +{ + int mode = 0; + if (__OPEN_NEEDS_MODE (oflag)) + mode = b[0]; + return openat(AT_FDCWD, file, oflag, mode); +} + +EXPORT int my32___libc_alloca_cutoff(x64emu_t* emu, size_t size) +{ + // not always implemented on old linux version... + library_t* lib = my_lib; + if(!lib) return 0; + void* f = dlsym(lib->priv.w.lib, "__libc_alloca_cutoff"); + if(f) + return ((iFL_t)f)(size); + // approximate version but it's better than nothing.... + return (size<=(65536*4)); +} + +// DL functions from wrappedlibdl.c +void* my32_dlopen(x64emu_t* emu, void *filename, int flag); +int my32_dlclose(x64emu_t* emu, void *handle); +void* my32_dlsym(x64emu_t* emu, void *handle, void *symbol); +EXPORT int my32___libc_dlclose(x64emu_t* emu, void* handle) +{ + return my32_dlclose(emu, handle); +} +EXPORT void* my32___libc_dlopen_mode(x64emu_t* emu, void* name, int mode) +{ + return my32_dlopen(emu, name, mode); +} +EXPORT void* my32___libc_dlsym(x64emu_t* emu, void* handle, void* name) +{ + return my32_dlsym(emu, handle, name); +} +#endif +// all obstack function defined in obstack.c file +void obstackSetup(); + +EXPORT int my32_nanosleep(const struct timespec *req, struct timespec *rem) +{ + if(!req) + return 0; // workaround for some strange calls + return nanosleep(req, rem); +} + +EXPORT int my32_utimes(x64emu_t* emu, const char* name, uint32_t* times) +{ + struct timeval tm[2]; + tm[0].tv_sec = times[0]; + tm[0].tv_usec = times[1]; + tm[1].tv_sec = times[2]; + tm[1].tv_usec = times[3]; + return utimes(name, tm); +} + +EXPORT int my32_futimes(x64emu_t* emu, int fd, uint32_t* times) +{ + struct timeval tm[2]; + tm[0].tv_sec = times[0]; + tm[0].tv_usec = times[1]; + tm[1].tv_sec = times[2]; + tm[1].tv_usec = times[3]; + return futimes(fd, tm); +} + +EXPORT int my32_futimens(x64emu_t* emu, int fd, uint32_t* times) +{ + struct timespec tm[2]; + tm[0].tv_sec = times[0]; + tm[0].tv_nsec = times[1]; + tm[1].tv_sec = times[2]; + tm[1].tv_nsec = times[3]; + return futimens(fd, tm); +} + +EXPORT long my32_strtol(const char* s, char** endp, int base) +{ + long ret = strtol(s, endp, base); + if (retINT_MAX) { + ret = INT_MAX; + errno = ERANGE; + } + return ret; +} + +EXPORT unsigned long my32_strtoul(const char* s, char** endp, int base) +{ + unsigned long ret = strtoul(s, endp, base); + if(ret>UINT_MAX) { + ret = UINT_MAX; + errno = ERANGE; + } + return ret; +} + +EXPORT long my32_wcstol(const wchar_t* s, wchar_t** endp, int base) +{ + long ret = wcstol(s, endp, base); + if (retINT_MAX) { + ret = INT_MAX; + errno = ERANGE; + } + return ret; +} + +EXPORT unsigned long my32_wcstoul(const wchar_t* s, wchar_t** endp, int base) +{ + unsigned long ret = wcstoul(s, endp, base); + if(ret>UINT_MAX) { + ret = UINT_MAX; + errno = ERANGE; + } + return ret; +} + +EXPORT long my32_ftell(x64emu_t* emu, FILE* f) +{ + long ret = ftell(f); + if(ret==-1) + return ret; + if(ret==LONG_MAX) + return INT_MAX; + if(ret>INT_MAX) { + ret = -1; + errno = ERANGE; + } + return ret; +} + +// wrapped malloc using calloc, it seems x86 malloc set alloc'd block to zero somehow +EXPORT void* my32_malloc(unsigned long size) +{ + return calloc(1, size); +} + +struct sysinfo_32 { + long_t uptime; + ulong_t loads[3]; + ulong_t totalram; + ulong_t freeram; + ulong_t sharedram; + ulong_t bufferram; + ulong_t totalswap; + ulong_t freeswap; + uint16_t procs; + uint16_t pad; + ulong_t totalhigh; + ulong_t freehigh; + uint32_t mem_unit; + // removed padding +}; + +EXPORT int my32_sysinfo(struct sysinfo_32* p) +{ + struct sysinfo info = {0}; + int ret = sysinfo(&info); + p->uptime = from_long(info.uptime); + p->loads[0] = from_ulong(info.loads[0]); + p->loads[1] = from_ulong(info.loads[1]); + p->loads[2] = from_ulong(info.loads[2]); + p->totalram = from_ulong(info.totalram); + p->freeram = from_ulong(info.freeram); + p->sharedram = from_ulong(info.sharedram); + p->bufferram = from_ulong(info.bufferram); + p->totalswap = from_ulong(info.totalswap); + p->freeswap = from_ulong(info.freeswap); + p->procs = info.procs; + p->pad = info.pad; + p->totalhigh = from_ulong(info.totalhigh); + p->freehigh = from_ulong(info.freehigh); + p->mem_unit = info.mem_unit; + return ret; +} + +EXPORT ssize_t my32_process_vm_readv(x64emu_t* emu, int pid, struct i386_iovec* local_iovec, size_t liovect, struct i386_iovec* remote_iovec, size_t riovect, unsigned long flags) +{ + struct iovec local_iovec_l[liovect]; + struct iovec remove_iovec_l[riovect]; + for (size_t i=0; i=0) + sz = ds.shm_segsz; + } + if(!shmaddr && sz) { + shmaddr = find31bitBlockNearHint(shmaddr, sz, 0); + } + void* ret = shmat(shmid, shmaddr, flags); + /*if(ret!=MAP_FAILED) { + would need to keep size somewhere, there is no way to get it back when doing shmdt + setProtection_mmap(ret, sz, (flags&SHM_RDONLY)?PROT_READ:(PROT_READ|PROT_WRITE)); + }*/ + return ret; +} + +EXPORT int my32_shmdt(x64emu_t* emu, void* addr) +{ + return shmdt(addr); +} +#endif + +#if 0 +#ifndef __NR_memfd_create +#define MFD_CLOEXEC 0x0001U +#define MFD_ALLOW_SEALING 0x0002U +EXPORT int my32_memfd_create(x64emu_t* emu, void* name, uint32_t flags) +{ + // try to simulate that function + uint32_t fl = O_RDWR | O_CREAT; + if(flags&MFD_CLOEXEC) + fl |= O_CLOEXEC; + int tmp = shm_open(name, fl, S_IRWXU); + if(tmp<0) return -1; + shm_unlink(name); // remove the shm file, but it will still exist because it's currently in use + return tmp; +} +#endif + +#ifndef GRND_RANDOM +#define GRND_RANDOM 0x0002 +#endif +EXPORT int my32_getentropy(x64emu_t* emu, void* buffer, size_t length) +{ + library_t* lib = my_lib; + if(!lib) return 0; + void* f = dlsym(lib->priv.w.lib, "getentropy"); + if(f) + return ((iFpL_t)f)(buffer, length); + // custom implementation + if(length>256) { + errno = EIO; + return -1; + } + int ret = my32_getrandom(emu, buffer, length, GRND_RANDOM); + if(ret!=length) { + errno = EIO; + return -1; + } + return 0; +} + +EXPORT void my32_mcount(void* frompc, void* selfpc) +{ + // stub doing nothing... + return; +} + +#ifndef ANDROID +union semun { + int val; /* Value for SETVAL */ + struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ + unsigned short *array; /* Array for GETALL, SETALL */ + struct seminfo *__buf; /* Buffer for IPC_INFO + (Linux-specific) */ +}; +#endif + +EXPORT int my32_semctl(x64emu_t* emu, int semid, int semnum, int cmd, union semun b) +{ + iFiiiV_t f = semctl; + return ((iFiiiV_t)f)(semid, semnum, cmd, b); +} + +#ifndef ANDROID +EXPORT int my32_on_exit(x64emu_t* emu, void* f, void* args) +{ + return on_exit(findon_exitFct(f), args); +} +#endif +#endif + +EXPORT char* my32___progname = NULL; +EXPORT char* my32___progname_full = NULL; +EXPORT char* my32_program_invocation_name = NULL; +EXPORT char* my32_program_invocation_short_name = NULL; + +EXPORT ptr_t my32_stdin = 0; +EXPORT ptr_t my32_stdout = 0; +EXPORT ptr_t my32_stderr = 0; + +EXPORT int __libc_enable_secure = 1; + +EXPORT ptr_t my32_tzname[2]; + +EXPORT long_t my32_timezone = 0; +EXPORT long_t my32___timezone = 0; +EXPORT void my32_tzset() +{ + tzset(); + my32_timezone = to_long(timezone); // this might not be usefull, and we can probably just redirect to the original symbol + my32___timezone = to_long(timezone); + my32_tzname[0] = to_cstring(tzname[0]); + my32_tzname[1] = to_cstring(tzname[1]); +} + +EXPORT int my32___libc_single_threaded = 0; + +EXPORT char my32__libc_intl_domainname[] = "libc"; + +EXPORT void* my32___errno_location(x64emu_t* emu) +{ + // TODO: Find a better way to do this + // cannot use __thread as it makes the address not 32bits + //emu->libc_err = errno; + return &emu->libc_err; +} + +void convert_siginfo_to_32(void* d, void* s, int sig); +EXPORT int my32_waitid(x64emu_t* emu, uint32_t idtype, uint32_t id, void* siginfo, int options) +{ + siginfo_t siginfo_l; + int ret = waitid(idtype, id, siginfo?(&siginfo_l):NULL, options); + convert_siginfo_to_32(siginfo, &siginfo_l, X64_SIGCHLD); + return ret; +} + +EXPORT int my32___prctl_time64(x64emu_t* emu, int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) +{ + if(option==PR_SET_NAME) { + printf_log(LOG_DEBUG, "set process name to \"%s\"\n", (char*)arg2); + ApplyEnvFileEntry((char*)arg2); + size_t l = strlen((char*)arg2); + if(l>4 && !strcasecmp((char*)arg2+l-4, ".exe")) { + printf_log(LOG_DEBUG, "hacking orig command line to \"%s\"\n", (char*)arg2); + strcpy(my_context->orig_argv[0], (char*)arg2); + } + } + if(option==PR_SET_SECCOMP) { + printf_log(LOG_INFO, "ignoring prctl(PR_SET_SECCOMP, ...)\n"); + return 0; + } + return prctl(option, arg2, arg3, arg4, arg5); +} + +EXPORT int my32_prctl(x64emu_t* emu, int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) +{ + // PR_GET_TID_ADDRESS has int** as arg2 + // is there a call that have a time arg? + if(option==PR_SET_NAME) { + printf_log(LOG_DEBUG, "set process name to \"%s\"\n", (char*)arg2); + ApplyEnvFileEntry((char*)arg2); + size_t l = strlen((char*)arg2); + if(l>4 && !strcasecmp((char*)arg2+l-4, ".exe")) { + printf_log(LOG_DEBUG, "hacking orig command line to \"%s\"\n", (char*)arg2); + strcpy(my_context->orig_argv[0], (char*)arg2); + } + } + if(option==PR_SET_SECCOMP) { + printf_log(LOG_INFO, "ignoring prctl(PR_SET_SECCOMP, ...)\n"); + return 0; + } + return prctl(option, arg2, arg3, arg4, arg5); +} + +int32_t my_open(x64emu_t* emu, void* pathname, int32_t flags, uint32_t mode); +EXPORT int my32_open(x64emu_t* emu, void* pathname, int32_t flags, uint32_t mode) +{ + int ret = my_open(emu, pathname, flags, mode); + addInputEventFD(ret); + return ret; +} +EXPORT int32_t my_open64(x64emu_t* emu, void* pathname, int32_t flags, uint32_t mode); +EXPORT int my32_open64(x64emu_t* emu, void* pathname, int32_t flags, uint32_t mode) +{ + int ret = my_open64(emu, pathname, flags, mode); + addInputEventFD(ret); + return ret; +} + +EXPORT int my32_close(x64emu_t* emu, int fd) +{ + removeInputEventFD(fd); + return close(fd); +} + +extern int ioctl_cgifconf(x64emu_t* emu, int fd, void* arg); +EXPORT int my32_ioctl(x64emu_t* emu, int fd, unsigned long op, void* arg) +{ + switch(op) + { + case SIOCGIFCONF: + return ioctl_cgifconf(emu, fd, arg); + default: + return ioctl(fd, op, arg); + } +} + +#undef HAS_MY + +#define PRE_INIT\ + if(1) \ + my_lib = lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL);\ + else + +#ifdef ANDROID +//#define NEEDED_LIBS \ +// "libm.so", "libdl.so" +#else +#define NEEDED_LIBS \ + "ld-linux.so.2", "libpthread.so.0", "librt.so.1", "libdl.so.2" +#endif + +extern void* my__IO_2_1_stderr_; +extern void* my__IO_2_1_stdin_ ; +extern void* my__IO_2_1_stdout_; + +void libc32_net_init(); + +#define CUSTOM_INIT \ + box64->libclib = lib; \ + my_lib = lib; \ + InitCpuModel(); \ + ctSetup(); \ + libc32_net_init(); \ + /*obstackSetup();*/ \ + my32_environ = my32__environ = my32___environ = box64->envv32; \ + my32___progname_full = my32_program_invocation_name = box64->argv[0]; \ + my32___progname = my32_program_invocation_short_name = \ + strrchr(box64->argv[0], '/'); \ + my32_tzname[0] = to_cstring(tzname[0]); \ + my32_tzname[1] = to_cstring(tzname[1]); \ + my32_stdin = to_ptrv(my__IO_2_1_stdin_); \ + my32_stdout = to_ptrv(my__IO_2_1_stdout_); \ + my32_stderr = to_ptrv(my__IO_2_1_stderr_); + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h new file mode 100755 index 0000000..7301f71 --- /dev/null +++ b/src/wrapped32/wrappedlibc_private.h @@ -0,0 +1,2257 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA) && defined(GOS)) +#error Meh... +#endif + +//DATA not M cannot work on libc wbecause it's loaded in high memory + +// FILE* is S +// locale_t needs special handling, with to_locale / from_locale (and is a / A) +// struct utimbuf is: LL +// struct timespec is: LL +// struct timeval is: LL +// struct itimerval is LLLL +// struct tm is: iiiiiiiiilt +// struct tms is: llll +// struct rusage is LLLLLLLLLLLLLLLLLL (2 timeval + 14 longs) +// time_t is: L +// socklen_t is u +// struct sockaddr is fine, no wrap needed +// wctype_t is h (used with locale_t) + +// a64l +GO(abort, vEv) +GO(abs, iEi) +GOW(accept, iEipp) +GOW(accept4, iEippi) +GOW(access, iEpi) +// acct +//GOW(addmntent, iEpp) +// addseverity +// adjtime // Weak +// adjtimex // Weak +// __adjtimex +// advance // Weak +// __aeabi_assert +// __aeabi_atexit +// __aeabi_errno_addr +// __aeabi_localeconv +// __aeabi_MB_CUR_MAX +// __aeabi_memclr +// __aeabi_memclr4 +// __aeabi_memclr8 +// __aeabi_memcpy +// __aeabi_memcpy4 +// __aeabi_memcpy8 +// __aeabi_memmove +// __aeabi_memmove4 +// __aeabi_memmove8 +// __aeabi_memset +// __aeabi_memset4 +// __aeabi_memset8 +//DATAV(__after_morecore_hook, 4) +GO(alarm, uEu) +GO2(aligned_alloc, pELL, memalign) +GO(alphasort, iEpp) +GOM(alphasort64, iEEpp) +//DATA(argp_err_exit_status, 4) +// argp_error // Weak +// argp_failure // Weak +// argp_help // Weak +// argp_parse // Weak +// argp_program_bug_address // type B +// argp_program_version // type B +// argp_program_version_hook // type B +// argp_state_help // Weak +// argp_usage // Weak +// argz_add // Weak +// argz_add_sep // Weak +// argz_append // Weak +// __argz_count +// argz_count // Weak +// argz_create // Weak +//GOW(argz_create_sep, iEpipp) +// argz_delete +// argz_extract // Weak +//GOW(argz_insert, iEpppp) +// __argz_next +//GOW(argz_next, pEpLp) +// argz_replace // Weak +// __argz_stringify +//GOW(argz_stringify, vEpLi) +GOM(asctime, pEriiiiiiiiilt_) //%noE +GOW(asctime_r, pEriiiiiiiiilt_p) +GOWM(asprintf, iEEppV) //%% +//GOM(__asprintf, iEEppV) //%% +GOM(__asprintf_chk, iEEpipV) //%% +// __assert +GO(__assert_fail, vEppip) +//GO(__assert_perror_fail, vEipup) +GO(atof, dEp) +GO(atoi, iEp) +GO2(atol, lEp, atoi) +GO(atoll, IEp) +// authdes_create +// authdes_getucred +// authdes_pk_create +// _authenticate +// authnone_create +// authunix_create +// authunix_create_default +GOWM(backtrace, iEEpi) +//GO(__backtrace, iEpi) +//GO(__backtrace_symbols, pEpi) +GOWM(backtrace_symbols, pEEpi) +//GO(__backtrace_symbols_fd, vEpii) +//GOW(backtrace_symbols_fd, vEpii) +GO(basename, pEp) +GOW(bcmp, iEppL) +//GO(bcopy, vEppL) +// bdflush +GOW(bind, iEipu) +// bindresvport +GOW(bindtextdomain, tEpp) +GOW(bind_textdomain_codeset, tEpp) +//GOW(brk, iEp) +// __bsd_getpgrp +// bsd_signal // Weak +GOM(bsearch, pEEppLLp) //%% +GOW(btowc, uEi) +GOW(bzero, vEpL) +GO(__bzero, vEpL) +GOW(calloc, pELL) +// callrpc +//GOW(canonicalize_file_name, pEp) +GO(capget, iFpp) +GO(capset, iFpp) +//GO(catclose, iEp) +//GO(catgets, pEpiip) +//GO(catopen, pEpi) +// cbc_crypt +GO(cfgetispeed, uEp) +GO(cfgetospeed, uEp) +//GO(cfmakeraw, vEp) +//GOW(cfree, vEp) +GO(cfsetispeed, iEpu) +GO(cfsetospeed, iEpu) +GO(cfsetspeed, iEpi) +GOW(chdir, iEp) +//DATA(__check_rhosts_file, 4) +// chflags +// __chk_fail +GOW(chmod, iEpu) +GOW(chown, iEpuu) +GO(chroot, iEp) +GOW(clearenv, iEv) +GO(clearerr, vES) +//GO(clearerr_unlocked, vEp) +// clnt_broadcast +// clnt_create +// clnt_pcreateerror +// clnt_perrno +// clnt_perror +// clntraw_create +// clnt_spcreateerror +// clnt_sperrno +// clnt_sperror +// clnttcp_create +// clntudp_bufcreate +// clntudp_create +// clntunix_create +GO(clock, lEv) +// clone // Weak +// __clone +GOWM(close, iEEi) //%% +// __close // Weak +GOW(closedir, iEp) +GO(closelog, vEv) +GO(close_range, iEuui) +GOM(__cmsg_nxthdr, pEpp) //%noE +//GO(confstr, uEipu) +// __confstr_chk +GOW(connect, iEipu) +GOW(__connect, iEipu) +// copysign // Weak +// copysignf // Weak +// copysignl // Weak +GOW(creat, iEpu) +GO(creat64, iEpu) +// create_module // Weak +GO(ctermid, tEp) +GOM(ctime, pErl_) //%noE +GO2(__ctime64, pEp, ctime) +GO(ctime_r, pErl_p) +DATAM(__ctype_b, 4) +GOM(__ctype_b_loc, pEEv) +GOW(__ctype_get_mb_cur_max, LEv) +DATAM(__ctype_tolower, 4) +GOM(__ctype_tolower_loc, pEEv) +DATAM(__ctype_toupper, 4) +GOM(__ctype_toupper_loc, pEEv) +// __curbrk // type B +GO(cuserid, tEp) +GOM(__cxa_atexit, iEEppp) //%% +GOM(atexit, iEEp) //%% just in case +GOM(__cxa_finalize, vEEp) //%% +DATAM(__cpu_model, 16) +GOM(__cxa_thread_atexit_impl, iEEppp) //%% +// __cyg_profile_func_enter +// __cyg_profile_func_exit +// daemon +DATAV(daylight, 4) +// __daylight // type B +GOW(dcgettext, tEppi) +GO(__dcgettext, tEppi) +GOW(dcngettext, tEpppLi) +// __default_morecore +// __default_rt_sa_restorer_v1 +// __default_rt_sa_restorer_v2 +// __default_sa_restorer_v1 +// __default_sa_restorer_v2 +// delete_module +// des_setparity +GOW(dgettext, pEpp) +GO(__dgettext, pEpp) +GO(difftime, dEll) +GO(dirfd, iEp) +GO(dirname, tEp) +GOS(div, pEpii) //%%,noE +// _dl_addr +GOW2(dl_iterate_phdr, iEEpp, my_dl_iterate_phdr) //%% +// _dl_mcount_wrapper +// _dl_mcount_wrapper_check +// _dl_open_hook // type B +// _dl_starting_up // Weak +// _dl_sym +// _dl_vsym +//GOW(dngettext, pEpppu) +//GOM(dprintf, iEEipV) +GOM(__dprintf_chk, iEEiipV) //%% +GO(drand48, dEv) +// drand48_r +GOW(dup, iEi) +GOW(dup2, iEii) +GO(__dup2, iEii) +GO(dup3, iEiiO) +//GOW(duplocale, pEp) +GO(__duplocale, aEa) +// dysize +//GOW(eaccess, iEpi) +// ecb_crypt +// ecvt +//GO(ecvt_r, iEdipppL) +// endaliasent +// endfsent +GO(endgrent, vEv) +GO(endhostent, vFv) +GOW(endmntent, iES) +// __endmntent +// endnetent +// endnetgrent +GO(endprotoent, vEv) +GO(endpwent, vEv) +// endrpcent +GO(endservent, vEv) +GO(endspent, vEv) +// endttyent +// endusershell +GOW(endutent, vEv) +// endutxent +DATAM(environ, 4) +DATAM(_environ, 4) +DATAM(__environ, 4) // type B +// envz_add +// envz_entry +// envz_get +// envz_merge +// envz_remove +// envz_strip +GOM(epoll_create, iEEi) //%% not needed, but used in syscall +GOM(epoll_create1, iEEO) //%% +GOM(epoll_ctl, iEEiiip) //%% align epool_event structure +// epoll_pwait +GOM(epoll_wait, iEEipii) //%% need realign of epoll_event structure +// erand48 +// erand48_r // Weak +//GO(err, vEippppppppp) +// errno // type B +GOM(__errno_location, pEEv) +//GOW(error, vEiippppppppp) // Simple attempt: there is a vararg, but the alignment will/may be off if it tries some Double in the "printf" part +// error_at_line // Weak +// error_message_count // type B +// error_one_per_line // type B +// error_print_progname // type B +//GO(errx, vEippppppppp) +//GO(ether_aton, pEp) +//GO(ether_aton_r, pEpp) +//GO(ether_hostton, iEpp) +//GO(ether_line, iEppp) +//GO(ether_ntoa, pEp) +//GO(ether_ntoa_r, pEpp) +//GO(ether_ntohost, iEpp) +//GOW(euidaccess, iEpi) +GO(eventfd, iEui) +//GO(eventfd_read, iEip) +//GO(eventfd_write, iEiU) +GO2(execl, iEEpV, my32_execv) +//GO2(execle, iEEpV, my32_execve) // Nope! This one needs wrapping, because is char*, char*, ..., char*[] +GO2(execlp, iEpV, my32_execvp) +GOWM(execv, iEEpp) //%% +GOM(execve, iEEppp) //%% and this one too... +GOWM(execvp, iEEpp) //%% +GOWM(execvpe, iEEppp) //%% +GO2(exit, vFEi, my_exit) +GO(_exit, vEi) +GOW(_Exit, vEi) +GOM(__explicit_bzero_chk, vEEpuu) //%% not always defined +GO(faccessat, iEipii) +// fattach +//GO(__fbufsize, uEp) +GOW(fchdir, iEi) +// fchflags +GOW(fchmod, iEiu) +GO(fchmodat, iEipui) +GOW(fchown, iEiuu) +//GO(fchownat, iEipuii) +GO(fclose, iES) +GOW(fcloseall, iEv) +GOM(fcntl, iEEiiN) //%% this also use a vararg for 3rd argument +GOM(__fcntl, iEEiiN) //%% +GO2(__fcntl_time64, iEiiN, my_fcntl) +GOM(fcntl64, iEEiiN) //%% +//GO(fcvt, pEdipp) +//GO(fcvt_r, iEdipppL) +GO(fdatasync, iEi) +// fdetach +GO(fdopen, SEip) +GOW(fdopendir, pEi) +GOW(feof, iES) +//GO(feof_unlocked, iEp) +GOW(ferror, iES) +//GO(ferror_unlocked, iEp) +//GO(fexecve, iEipp) //TODO: Check if needed to be wrapped, and target checked for x86 / native? +GOW(fflush, iES) +GO(fflush_unlocked, iES) +GO(ffs, iEi) +// __ffs +GOW(ffsl, iEl) +GO(ffsll, iEI) +GOW(fgetc, iES) +GOW(fgetc_unlocked, iES) +// fgetgrent +// fgetgrent_r // Weak +GO(fgetpos, iESBliu_) +GO(fgetpos64, iESp) +// fgetpwent +// fgetpwent_r // Weak +GOW(fgets, pEpiS) +GO(__fgets_chk, pEpLiS) +// fgetspent +// fgetspent_r // Weak +GOW(fgets_unlocked, pEpiS) +// __fgets_unlocked_chk +//GOW(fgetwc, iEp) +//GOW(fgetwc_unlocked, iEp) +//GO(fgetws, pEpip) +// __fgetws_chk +//GO(fgetws_unlocked, pEpip) +// __fgetws_unlocked_chk +GO(fgetxattr, iEippL) +GO(fileno, iES) +GOW(fileno_unlocked, iES) +GOW(finite, iEd) +GO(__finite, iEd) +GOW(finitef, iEf) +// __finitef +// finitel // Weak +// __finitel +// __flbf +GO(flistxattr, iEipL) +GOW(flock, iEii) +GOW(flockfile, vFS) +GOW(_flushlbf, vEv) +//GO(fmemopen, pEpup) +// fmtmsg +GO(fnmatch, iEppi) +GO2(fopen, SEEpp, my_fopen) //%% +GOW2(fopen64, SEEpp, my_fopen64) //%% +//GOM(fopencookie, pEEpppppp) //%% last 4p are a struct with 4 callbacks... +GOWM(fork, iEEv) //%% +GOM(__fork, iEEv) //%% +// __fortify_fail +GOW(fpathconf, lEii) +//GO(__fpending, uEp) +GOM(fprintf, iEESpV) //%% +GOM(__fprintf_chk, iEESipV) //%% +// __fpu_control // type B +//GO(__fpurge, vEp) +GOW(fputc, iEiS) +//GO(fputc_unlocked, iEip) +GOW(fputs, iEpS) // Weak +//GO(fputs_unlocked, iEpp) +GO(fputwc, uEiS) +//GO(fputwc_unlocked, iEip) +//GO(fputws, iEpp) +//GO(fputws_unlocked, iEpp) +GOW(fread, LEpLLS) +//GO(__freadable, iEp) +GO(__fread_chk, uEpLLLS) +//GO(__freading, iEp) +GO(fread_unlocked, LEpLLS) +//GO(__fread_unlocked_chk, uEpuuup) +GO(free, vEp) +GOM(freeaddrinfo, vEEp) +//DATAV(__free_hook, 4) +GO(freeifaddrs, vEp) +GOW(freelocale, vEA) +GO(__freelocale, vEA) +GO(fremovexattr, iEip) +GO(freopen, SEppS) +GO(freopen64, SEppS) +GOW(frexp, dFdp) +// frexpf // Weak +#ifdef HAVE_LD80BITS +GOW(frexpl, DFDp) +#else +GOW2(frexpl, KFKp, frexp) +#endif +GOM(fscanf, iEESpV) +GO(fseek, iESli) +GO(fseeko, iESli) +GO(fseeko64, iESIi) +GO(__fsetlocking, iESi) +GO(fsetpos, iEpBlii_) +//GO(fsetpos64, iEpp) +GO(fsetxattr, iEippLi) +GOM(fstat, iEip) //%%,noE +GOM(fstat64, iEip) //%%,noE +GOM(__fstat64_time64, iFEip) +GOM(fstatat, iEEippi) +GOM(fstatat64, iEEippi) +GO2(__fstatat64_time64, iEippi, fstatat) +GOWM(fstatfs, iEip) //%%,noE +GOWM(fstatfs64, iEip) //%%,noE +GOM(fstatvfs, iEEip) +GOWM(fstatvfs64, iEEip) +GOW(fsync, iEi) +GOWM(ftell, lEES) +GO(ftello, lES) +GO(ftello64, IES) +GO(ftime, iErLWww_) +GO(ftok, iEpi) +GOW(ftruncate, iEil) +GOW(ftruncate64, iEiI) +//GOW(ftrylockfile, iEp) +//GOM(fts_children, pEEpi) //%% +GO(fts_close, iEp) +GOM(fts_open, pEEpip) +GO(fts_read, pEp) +GO(fts_set, iEppi) +GOM(ftw, iEEppi) //%% +GOM(ftw64, iEEppi) //%% +GOW(funlockfile, vFS) +GOM(futimens, iEEip) +GO2(__futimens64, iEip, futimens) +GOWM(futimes, iEEip) +//GO(futimesat, iEippp) +// fwide +//GOWM(fwprintf, iEEppV) //%% +//GOM(__fwprintf_chk, iEEpvpV) //%% +//GO(__fwritable, iEp) +GOW(fwrite, LEpLLS) +GO(fwrite_unlocked, LEpLLS) +//GO(__fwriting, iEp) +// fwscanf +GOM(__fxstat, iEEiip) //%% +GOM(__fxstat64, iEEiip) //%% need reaalign of struct stat64 +//GOM(__fxstatat, iEEiippi) //%% +GOM(__fxstatat64, iEEiippi) //%% struct stat64 again +// __gai_sigqueue +GO(gai_strerror, tEi) +// __gconv_get_alias_db +// __gconv_get_cache +// __gconv_get_modules_db +// gcvt +GOM(getaddrinfo, iEEpppp) +// getaliasbyname +// getaliasbyname_r +// getaliasent +// getaliasent_r +// get_avphys_pages // Weak +GOW(getc, iES) +GOW(getchar, iEv) +GO(getchar_unlocked, iEv) +GOM(getcontext, iEEp) //%% +//GOW(getc_unlocked, iEp) +GO(get_current_dir_name, pEv) +GOW(getcwd, tEpL) +//GO(__getcwd_chk, pEpLL) +//GO(getdate, pEp) +// getdate_err // type B +// getdate_r // Weak +//GOW(getdelim, iEbp_bL_iS) +GOW(__getdelim, iEbp_bL_iS) +// getdirentries +// getdirentries64 +//GO(getdomainname, iEpu) +// __getdomainname_chk +GOW(getdtablesize, iEv) +GOW(getegid, uEv) +GO(getenv, tEp) +GOW(geteuid, uEv) +// getfsent +// getfsfile +// getfsspec +GOW(getgid, uEv) +//GO(getgrent, pEv) +// getgrent_r +//GO(getgrgid, pEu) +GOM(getgrgid_r, iEEuppLp) +GOM(getgrnam, pEEp) +GOM(getgrnam_r, iEEpppLp) +GO(getgrouplist, iEpipp) +GOW(getgroups, iEip) +GO(__getgroups_chk, iEipL) +GOM(gethostbyaddr, pFEpui) +GOM(gethostbyaddr_r, iFEpuippupp) +GOM(gethostbyname, pFEp) +//GO(gethostbyname2, pFpi) +GOM(gethostbyname2_r, iFEpippupp) +GOM(gethostbyname_r, iFEpppupp) +//GO(gethostent, pFv) +//GO(gethostent_r, iFppupp) +GO(gethostid, LFv) +GOW(gethostname, iEpL) +// __gethostname_chk +GOM(getifaddrs, iEEbp_) +// getipv4sourcefilter +//GOW(getitimer, iEip) +// get_kernel_syms // Weak +//GOW(getline, iEppp) +GO(getloadavg, iEpi) +GO(getlogin, pEv) +GO(getlogin_r, iEpL) +// __getlogin_r_chk +GOM(getmntent, pEES) +// __getmntent_r +GOW(getmntent_r, pESBppppii_pi) +// getmsg +// get_myaddress +GO(getnameinfo, iEpupupui) +// getnetbyaddr +// getnetbyaddr_r +// getnetbyname +// getnetbyname_r +// getnetent +// getnetent_r +// getnetgrent +// getnetgrent_r // Weak +// getnetname +GOW(get_nprocs, iEv) +//GOW(get_nprocs_conf, iEv) +//GOM(getopt, iEipp) //%noE +GOM(getopt_long, iEipppp) //%noE +//GOM(getopt_long_only, iEipppp) //%noE +GOW(getpagesize, iEv) +GO(__getpagesize, iEv) +GO(getpass, tEp) +GOW(getpeername, iEipp) +GOW(getpgid, iEi) +// __getpgid +GO(getpgrp, iEv) +// get_phys_pages // Weak +GO(getpid, iEv) +GO(__getpid, uEv) +// getpmsg +GOW(getppid, iEv) +GO(getpriority, iEuu) +GO(getrandom, iEpLu) +GOM(getprotobyname, pEEp) +GOM(getprotobyname_r, iEEpppup) +//GO(getprotobynumber, pEi) +GOM(getprotobynumber_r, iEEippup) +//GO(getprotoent, pEv) +//GO(getprotoent_r, iEppup) +GOW(getpt, iEv) +// getpublickey +// getpw // Weak +GOM(getpwent, pEEv) +// getpwent_r +GOM(getpwnam, pEEp) +GOM(getpwnam_r, iEEpppLp) +GOM(getpwuid, pEEu) +GOM(getpwuid_r, iEEuppLp) +GOW(getresgid, iEppp) +GOW(getresuid, iEppp) +GOM(getrlimit, iEEup) +GO(getrlimit64, iEup) +// getrpcbyname +// getrpcbyname_r +// getrpcbynumber +// getrpcbynumber_r +// getrpcent +// getrpcent_r +// getrpcport +GOW(getrusage, iEiBLLLLLLLLLLLLLLLLLL_) +GO2(__getrusage64, iEiBUUUULLLLLLLLLLLLLL_, getrusage) +//GOW(gets, pEp) +// __gets_chk +// getsecretkey +GOM(getservbyname, pEEpp) +//GO(getservbyname_r, iEppppup) +//GO(getservbyport, pEip) +//GO(getservbyport_r, iEipppup) +// getservent +//GO(getservent_r, iEppup) +GO(getsid, iEi) +GOW(getsockname, iEipp) +GOW(getsockopt, iEiiipp) // might need wrapping! +GO2(__getsockopt64, iEiiipp, getsockopt) +// getsourcefilter +//GO(getspent, pEv) +// getspent_r +//GO(getspnam, pEp) +// getspnam_r +// getsubopt +GOW(gettext, pEp) +GOW(gettid, iEv) +GOW(gettimeofday, iEBll_p) +//GO(__gettimeofday, iEpp) +GO2(__gettimeofday64, iEpp, gettimeofday) +// getttyent +// getttynam +GOW(getuid, uEv) +// getusershell +//GOW(getutent, pEv) +//GOW(getutent_r, iEpp) +//GOW(getutid, pEp) +//GOW(getutid_r, iEppp) +//GOW(getutline, pEp) +//GOW(getutline_r, iEppp) +// getutmp +// getutmpx +// getutxent +// getutxid +// getutxline +// getw +GO2(getwc, uES, fgetwc) +GO(getwchar, uEv) +GO(getwchar_unlocked, uEv) +//GOW(getwc_unlocked, iEp) +//GO(getwd, pEp) +// __getwd_chk +GO(getxattr, iEpppL) +GOM(glob, iEEpipp) //%% +GOM(glob64, iEEpipp) //%% +GOM(globfree, vEEp) //%% +GOM(globfree64, vEEp) //%% +// glob_pattern_p // Weak +GOM(gmtime, pEEp) +GOM(__gmtime64, pEEp) +GO2(__gmtime_r, pEpp, my32_gmtime_r) +GOWM(gmtime_r, pEEpp) +GO(gnu_dev_major, uEU) +GO(gnu_dev_makedev, UEuu) +GO(gnu_dev_minor, uEU) +GOW(gnu_get_libc_release, tEv) +GOW(gnu_get_libc_version, tEv) +// __gnu_mcount_nc +// __gnu_Unwind_Find_exidx +GO(grantpt, iEi) +// group_member // Weak +// gsignal // Weak +// gtty +GOW(hasmntopt, pErppppii_p) +// hcreate +// hcreate_r +// hdestroy // Weak +// hdestroy_r +//DATA(h_errlist, 4) +// h_errno // type B +GOM(__h_errno_location, pFEv) +//GO(herror, vFp) +// h_nerr // type R +// host2netname +// hsearch +// hsearch_r +//GO(hstrerror, pFi) +GO(htonl, uEu) +GO(htons, WEW) +GO(iconv, LELbp_bL_bp_bL_) +//GO(iconv_canonicalize, pEp) +GO(iconv_close, iEp) +GO(iconv_open, pEpp) +//GO(if_freenameindex, vEp) +GOW(if_indextoname, pEup) +//GO(if_nameindex, pEv) +GO(if_nametoindex, uEp) +// imaxabs // Weak +GOWS(imaxdiv, pEpII) //%% +DATAM(in6addr_any, 16) // type R +DATAM(in6addr_loopback, 16) // type R +// inb // Weak +//GOW(index, pEpi) +// inet6_opt_append +// inet6_opt_find +// inet6_opt_finish +// inet6_opt_get_val +// inet6_opt_init +// inet6_option_alloc +// inet6_option_append +// inet6_option_find +// inet6_option_init +// inet6_option_next +// inet6_option_space +// inet6_opt_next +// inet6_opt_set_val +// inet6_rth_add +// inet6_rth_getaddr +// inet6_rth_init +// inet6_rth_reverse +// inet6_rth_segments +// inet6_rth_space +GO(inet_addr, uEp) +GOW(inet_aton, iEpp) +// inet_lnaof +// inet_makeaddr +// inet_netof +//GO(inet_network, iEp) +// inet_nsap_addr +//GO(inet_nsap_ntoa, pEipp) +GO(inet_ntoa, tEu) +GO(inet_ntop, pEippu) +GO(inet_pton, iEipp) +//GO(initgroups, iEpi) +// init_module +// initstate // Weak +GOW(initstate_r, iEupuBpppiiip_) +// inl // Weak +GO(innetgr, iEpppp) +GO(inotify_add_watch, iEipu) +GO(inotify_init, iEv) +GO(inotify_init1, iEi) +GO(inotify_rm_watch, iEii) +// insque +// __internal_endnetgrent +// __internal_getnetgrent_r +// __internal_setnetgrent +// inw // Weak +//DATA(_IO_2_1_stderr_, 152) //sizeof(struct _IO_FILE_plus) +//DATA(_IO_2_1_stdin_, 152) +//DATA(_IO_2_1_stdout_, 152) +//GO(_IO_adjust_column, uEupi) +// _IO_adjust_wcolumn +GOM(ioctl, iEEiLp) //the vararg is just to have optional arg of various type, but only 1 arg +GO2(__ioctl_time64, iEiLp, ioctl) +//GO(_IO_default_doallocate, iES) +//GO(_IO_default_finish, vESi) +//GO(_IO_default_pbackfail, iESi) +//GO(_IO_default_uflow, iES) +//GO(_IO_default_xsgetn, LESpL) +//GO(_IO_default_xsputn, LESpL) +//GO(_IO_doallocbuf, vES) +//GO(_IO_do_write, iESpL) +// _IO_fclose +// _IO_fdopen +// _IO_feof +// _IO_ferror +// _IO_fflush +// _IO_fgetpos +// _IO_fgetpos64 +// _IO_fgets +//GO(_IO_file_attach, pESi) +//GO(_IO_file_close, iES) +//GO(_IO_file_close_it, iES) +//GO(_IO_file_doallocate, iES) +// _IO_file_finish +//GO(_IO_file_fopen, pESppi) +//GO(_IO_file_init, vES) +//DATA(_IO_file_jumps, 4) +//GO(_IO_file_open, pESpiiii) +//GO(_IO_file_overflow, iESi) +//GO(_IO_file_read, lESpl) +//GO(_IO_file_seek, IESIi) +//GO(_IO_file_seekoff, IESIii) +//GO(_IO_file_setbuf, pESpl) +//GOM(_IO_file_stat, iEESp) +//GO(_IO_file_sync, iES) +//GO(_IO_file_underflow, iES) +//GO(_IO_file_write, lESpl) +//GO(_IO_file_xsputn, LESpL) +//GO(_IO_flockfile, vES) +//GO(_IO_flush_all, iEv) +//GO(_IO_flush_all_linebuffered, vEv) +// _IO_fopen +// _IO_fprintf // Weak +// _IO_fputs +// _IO_fread +//GO(_IO_free_backup_area, vES) +// _IO_free_wbackup_area +// _IO_fsetpos +// _IO_fsetpos64 +// _IO_ftell +// _IO_ftrylockfile +//GO(_IO_funlockfile, vES) +// _IO_fwrite +GO(_IO_getc, iES) +// _IO_getline +//GO(_IO_getline_info, LESpLiip) +// _IO_gets +//GO(_IO_init, vESi) +//GO(_IO_init_marker, vEpS) +// _IO_init_wmarker +// _IO_iter_begin +// _IO_iter_end +// _IO_iter_file +// _IO_iter_next +// _IO_least_wmarker +//GO(_IO_link_in, vEp) +//DATA(_IO_list_all, 4) +// _IO_list_lock +// _IO_list_resetlock +// _IO_list_unlock +//GO(_IO_marker_delta, iEp) +//GO(_IO_marker_difference, iEpp) +//GO(_IO_padn, iEpii) +//GO(_IO_peekc_locked, iEp) +GOW(ioperm, iELLi) +GOW(iopl, iEi) +// _IO_popen +// _IO_printf +//GO(_IO_proc_close, iES) +//GO(_IO_proc_open, pESpp) +GO(_IO_putc, iEiS) +// _IO_puts +//GO(_IO_remove_marker, vEp) +//GO(_IO_seekmark, iESpi) +//GO(_IO_seekoff, IESIii) +//GO(_IO_seekpos, IESIi) +// _IO_seekwmark +//GO(_IO_setb, vESppi) +// _IO_setbuffer +// _IO_setvbuf +//GO(_IO_sgetn, uEppu) +// _IO_sprintf +//GO(_IO_sputbackc, iESi) +// _IO_sputbackwc +// _IO_sscanf +//GO(_IO_str_init_readonly, vEppi) +//GO(_IO_str_init_static, vEppup) +//GO(_IO_str_overflow, iESi) +//GO(_IO_str_pbackfail, iESi) +//GO(_IO_str_seekoff, UESUii) +//GO(_IO_str_underflow, iES) +//GO(_IO_sungetc, iEp) +// _IO_sungetwc +//GO(_IO_switch_to_get_mode, iEp) +// _IO_switch_to_main_wget_area +// _IO_switch_to_wbackup_area +// _IO_switch_to_wget_mode +// _IO_ungetc +//GO(_IO_un_link, vEp) +//GO(_IO_unsave_markers, vEp) +// _IO_unsave_wmarkers +//GOM(_IO_vfprintf, iEEpppp) //%% +//GOM(_IO_vfscanf, iEEppp) //%% +// _IO_vsprintf +// _IO_wdefault_doallocate +// _IO_wdefault_finish +// _IO_wdefault_pbackfail +// _IO_wdefault_uflow +// _IO_wdefault_xsgetn +// _IO_wdefault_xsputn +// _IO_wdoallocbuf +// _IO_wdo_write +//DATA(_IO_wfile_jumps, 4) +// _IO_wfile_overflow +// _IO_wfile_seekoff +// _IO_wfile_sync +// _IO_wfile_underflow +// _IO_wfile_xsputn +// _IO_wmarker_delta +// _IO_wsetb +// iruserok +// iruserok_af +GO(isalnum, iEi) +// __isalnum_l +// isalnum_l // Weak +GO(isalpha, iEi) +// __isalpha_l +// isalpha_l // Weak +GO(isascii, iEi) +// __isascii_l // Weak +// isastream +GOW(isatty, iEi) +GO(isblank, iEi) +// __isblank_l +// isblank_l // Weak +GO(iscntrl, iEi) +// __iscntrl_l +// iscntrl_l // Weak +// isctype // Weak +// __isctype +GO(isdigit, iEi) +// __isdigit_l +// isdigit_l // Weak +// isfdtype +GO(isgraph, iEi) +// __isgraph_l +// isgraph_l // Weak +GOW(isinf, iEd) +GO(__isinf, iEd) +GOW(isinff, iEf) +GO(__isinff, iEf) +// isinfl // Weak +// __isinfl +GO(islower, iEi) +// __islower_l +// islower_l // Weak +GOW(isnan, iEd) +GO(__isnan, iEd) +GOW(isnanf, iEf) +GO(__isnanf, iEf) +// isnanl // Weak +// __isnanl +GO2(__isoc99_fscanf, iEESpV, my32_fscanf) +// __isoc99_fwscanf +// __isoc99_scanf +GOM(__isoc99_sscanf, iEEppV) //%% +GOM(__isoc99_swscanf, iEEppV) //%% +//GOM(__isoc99_vfscanf, iEEppp) //%% +// __isoc99_vfwscanf +// __isoc99_vscanf +//GOM(__isoc99_vsscanf, iEEppp) //%% TODO: check if ok +// __isoc99_vswscanf +// __isoc99_vwscanf +// __isoc99_wscanf +GO2(__isoc23_fscanf, iEESpV, my32_fscanf) +GO2(__isoc23_sscanf, iEEppV, my32_sscanf) +GO2(__isoc23_vsscanf, iEEppp, my32_vsscanf) +GO2(__isoc23_wcstol, lEpBp_i, my32_wcstol) +GO2(__isoc23_strtoll, IEpBp_i, strtoll) +GO2(__isoc23_strtoull, UEpBp_i, strtoull) +GO2(__isoc23_strtol, lEpBp_i, my32_strtol) +GO2(__isoc23_strtoul, LEpBp_i, my32_strtoul) +GO(isprint, iEi) +// __isprint_l +// isprint_l // Weak +GO(ispunct, iEi) +// __ispunct_l +// ispunct_l // Weak +GO(isspace, iEi) +// __isspace_l +// isspace_l // Weak +GO(isupper, iEi) +// __isupper_l +// isupper_l // Weak +GOW(iswalnum, iEu) +// __iswalnum_l +//GOW(iswalnum_l, iEua) +GOW(iswalpha, iEu) +// __iswalpha_l +//GOW(iswalpha_l, iEua) +GOW(iswblank, iEu) +// __iswblank_l +GOW(iswblank_l, iEua) +GOW(iswcntrl, iEu) +// __iswcntrl_l +GOW(iswcntrl_l, iEua) +GOW(iswctype, iEuL) +// __iswctype +GO(__iswctype_l, iEuLa) +// iswctype_l // Weak +GOW(iswdigit, iEu) +// __iswdigit_l +//GOW(iswdigit_l, iEua) +GOW(iswgraph, iEu) +// __iswgraph_l +//GOW(iswgraph_l, iEua) +GOW(iswlower, iEu) +// __iswlower_l +//GOW(iswlower_l, iEua) +GOW(iswprint, iEu) +// __iswprint_l +//GOW(iswprint_l, iEua) +GOW(iswpunct, iEu) +// __iswpunct_l +//GOW(iswpunct_l, iEua) +GOW(iswspace, iEu) +// __iswspace_l +//GOW(iswspace_l, iEua) +GOW(iswupper, iEu) +// __iswupper_l +//GOW(iswupper_l, iEua) +GOW(iswxdigit, iEu) +// __iswxdigit_l +//GOW(iswxdigit_l, iEua) +GO(isxdigit, iEi) +// __isxdigit_l +// isxdigit_l // Weak +// _itoa_lower_digits // type R +// __ivaliduser +GO(jrand48, lEp) +// jrand48_r // Weak +// key_decryptsession +// key_decryptsession_pk +// __key_decryptsession_pk_LOCAL // type B +// key_encryptsession +// key_encryptsession_pk +// __key_encryptsession_pk_LOCAL // type B +// key_gendes +// __key_gendes_LOCAL // type B +// key_get_conv +// key_secretkey_is_set +// key_setnet +// key_setsecret +GOW(kill, iEii) +GO(killpg, iEii) +// klogctl +// l64a +GO(labs, lEl) +// lchmod +GOW(lchown, iEpuu) +// lckpwdf // Weak +// lcong48 +// lcong48_r // Weak +GOW(ldexp, dFdi) +GOW(ldexpf, fFfi) +#ifdef HAVE_LD80BITS +GOW(ldexpl, DFDi) +#else +GOW2(ldexpl, KFKi, ldexp) +#endif +GOS(ldiv, pEEpii) //%% return a struct, so address of stuct is on the stack, as a shadow 1st element +GOM(lfind, pEEppbL_Lp) //%% +GO(lgetxattr, iEpppL) +GOM(__libc_alloca_cutoff, iEEL) //%% +// __libc_allocate_rtsig +// __libc_allocate_rtsig_private +GO2(__libc_calloc, pELL, calloc) +// __libc_clntudp_bufcreate +GO(__libc_current_sigrtmax, iEv) +// __libc_current_sigrtmax_private +GO(__libc_current_sigrtmin, iEv) +// __libc_current_sigrtmin_private +//GOM(__libc_dlclose, iEEp) //%% +// __libc_dl_error_tsd +//GOM(__libc_dlopen_mode, pEEpi) //%% +//GOM(__libc_dlsym, pEEpp) //%% +// __libc_fatal +// __libc_fork +GO2(__libc_free, vEp, free) +// __libc_freeres +GOM(__libc_init_first, vEEipV) //%% +DATAM(_libc_intl_domainname, 4) // type R +//GO2(__libc_open, iEEpOu, my_open) +// __libc_longjmp +// __libc_mallinfo +GO2(__libc_malloc, pEL, malloc) +// __libc_mallopt +GO2(__libc_memalign, pELL, memalign) +// __libc_pthread_init +GO2(__libc_pvalloc, pEL, pvalloc) +// __libc_pwrite +//GO2(__libc_read, lEipL, my_read) //%%,noE +GO2(__libc_realloc, pEpL, realloc) +// __libc_sa_len +// __libc_siglongjmp +GOM(__libc_start_main, iEEpippppp) //%% +GO2(__libc_sigaction, iEEipp, my32_sigaction) //%% +// __libc_system +// __libc_thread_freeres +GO2(__libc_valloc, pEL, valloc) +GOW(link, iEpp) +//GO(linkat, iEipipi) +GOW(listen, iEii) +GO(listxattr, iEppL) +// llabs +// lldiv +GO(llistxattr, iEppL) +// llseek // Weak +// loc1 // type B +// loc2 // type B +GOWM(localeconv, pEEv) +GOM(localtime, pEEp) +GOM(__localtime64, pEEp) +GOWM(localtime_r, pEEpp) +GO(lockf, iEiil) +GO(lockf64, iEiiI) +// locs // type B +GOM(longjmp, vEEpi) //%% +GOM(_longjmp, vEEpi) //%% +GOM(__longjmp_chk, vEEpi) //%% +GO(lrand48, lEv) +// lrand48_r +GO(lremovexattr, iEpp) +GOM(lsearch, pEEppbL_Lp) //%% +GOW(lseek, lEili) +// __lseek // Weak +GOW(lseek64, IEiIi) +GO(lsetxattr, iEpppLi) +//GO(lutimes, iEpp) +GOM(__lxstat, iEEipp) //%% +GOM(__lxstat64, iEEipp) //%% +GO(madvise, iEpLi) +GOWM(makecontext, vEEppiV) //%% +GOW(mallinfo, pEv) +GOM(malloc, pEL) //%%,noE +// malloc_get_state // Weak +//DATAV(__malloc_hook, 4) +//DATAV(__malloc_initialize_hook, 4) +// malloc_set_state // Weak +// malloc_stats // Weak +GOW(malloc_trim, iEL) +GOW(malloc_usable_size, LEp) +GOW(mallopt, iEii) // Weak +// mallwatch // type B +//GO(mblen, iEpL) +//GOW(mbrlen, LEpLp) +//GO(__mbrlen, LEpLp) +GOW(mbrtowc, LEppLp) +GO(__mbrtowc, LEppLp) +GOW(mbsinit, iEp) +GOW(mbsnrtowcs, LEpbp_LLp) +// __mbsnrtowcs_chk +GOW(mbsrtowcs, LEpbp_Lp) +// __mbsrtowcs_chk +GO(mbstowcs, LEppL) +GO(__mbstowcs_chk, LEppLL) +GO(mbtowc, iEppL) +// mcheck +// mcheck_check_all +// mcheck_pedantic +// _mcleanup +//GOWM(mcount, vEpp) //%%,noE +// _mcount +GOW(memalign, pELL) +//DATAV(__memalign_hook, 4) +//GOW(memccpy, pEppiL) +GO(memchr, pEpiL) +GO(memcmp, iEppL) +GO(memcpy, pEppL) +GO(__memcpy_chk, pEppLL) +// memfrob +GO(memfd_create, iEpu) +GO(memmem, pEpLpL) +GO(memmove, pEppL) +GO(__memmove_chk, pEppLL) +GO(mempcpy, pEppL) +GO(__mempcpy, pEppL) +// __mempcpy_chk +// __mempcpy_small +GOW(memrchr, pEpiL) +GO(memset, pEpiL) +GO(__memset_chk, pEpiLL) +GO(mincore, iEpLp) +GOW(mkdir, iEpu) +GO(mkdirat, iEipu) +GO(mkdtemp, pEp) +GO(mkfifo, iEpu) +//GO(mkfifoat, iEipu) +GO(mkostemp, iEpi) +GO(mkostemp64, iEpi) +GO(mkstemp, iEp) +GO(mkstemp64, iEp) +//GO(mktemp, pEp) +GO(mktime, LEbiiiiiiiiilt_) +GO2(__mktime64, LEp, mktime) +GO(mlock, iEpL) +GO(mlockall, iEi) +GOM(mmap, pEEpLiiil) //%% +GOM(mmap64, pEEpLiiiI) //%% +// modf // Weak +// modff // Weak +// modfl // Weak +// moncontrol // Weak +// monstartup // Weak +// __monstartup +//DATA(__morecore, 4) +GOW(mount, iEpppLp) +// mprobe +GOM(mprotect, iEEpLi) //%% +// mrand48 +// mrand48_r +GOWM(mremap, pEEpLLiN) //%% 5th hidden paramerer "void* new_addr" if flags is MREMAP_FIXED +//GO(msgctl, iEiip) +//GOW(msgget, iEpi) +//GOW(msgrcv, lEipLli) +//GOW(msgsnd, iEipLi) +GOW(msync, iEpLi) +GO(mtrace, vFv) +GO(munlock, iEpL) +GO(munlockall, iEv) +GOM(munmap, iEEpL) //%% +GO(muntrace, vFv) +GOWM(nanosleep, iErLL_BLL_) //%%,noE +GO2(__nanosleep64, iEpp, nanosleep) +// __nanosleep // Weak +// netname2host +// netname2user +GOW(newlocale, aEipa) +GO(__newlocale, aEipa) +// nfsservctl +GOM(nftw, iEEppii) //%% +GOM(nftw64, iEEppii) //%% +//GOW(ngettext, pEppu) +GO(nice, iEi) +// _nl_default_dirname // type R +// _nl_domain_bindings // type B +GO(nl_langinfo, tEi) +GO(__nl_langinfo_l, tEia) +//GOW(nl_langinfo_l, pEup) +//DATAB(_nl_msg_cat_cntr, 4) // type B +// nrand48 +// nrand48_r // Weak +// __nss_configure_lookup +// __nss_database_lookup +// __nss_disable_nscd +// _nss_files_parse_grent +// _nss_files_parse_pwent +// _nss_files_parse_spent +// __nss_group_lookup +// __nss_group_lookup2 +// __nss_hostname_digits_dots +// __nss_hosts_lookup +// __nss_hosts_lookup2 +// __nss_lookup_function +// __nss_next +// __nss_next2 +// __nss_passwd_lookup +// __nss_passwd_lookup2 +// __nss_services_lookup2 +GOW(ntohl, uEu) +GOW(ntohs, WEW) +// ntp_adjtime // Weak +// ntp_gettime +// _null_auth // type B +// _obstack_allocated_p +//DATAM(obstack_alloc_failed_handler, 4) +//GOM(_obstack_begin, iEpLLpp) //%%,noE +// _obstack_begin_1 +//DATA(obstack_exit_failure, 4) +//GOM(_obstack_free, vEpp) //%%,noE +//GOM(obstack_free, vEpp) //%%,noE +// _obstack_memory_used +GOM(_obstack_newchunk, vEEpi) +// obstack_printf // Weak +// __obstack_printf_chk +GOWM(obstack_vprintf, iEEpppp) //%% +// __obstack_vprintf_chk +//GOWM(on_exit, iEEpp) //%% +//GO2(__on_exit, iEEpp, my_on_exit) //%% +GOWM(open, iEEpON) //%% +GOW2(__open, iEEpON, my32_open) //%% +GO(__open_2, iEpO) +GOWM(open64, iEEpON) //%% +// __open64 // Weak +GO(__open64_2, iEpO) +//GOW(openat, iEipON) +GO(__openat_2, iEipO) +GOW(openat64, iEipON) +//GO(__openat64_2, iEipON) +// __open_catalog +GOW(opendir, pEp) +GO(openlog, vEpii) +GOW(open_memstream, SEpp) +// open_wmemstream +//DATAB(optarg, 4) +//DATA(opterr, 4) +DATA(optind, 4) +//DATA(optopt, 4) +// outb // Weak +// outl // Weak +// outw // Weak +//GO(__overflow, iEpi) +GO(parse_printf_format, uEpup) +// passwd2des +GOW(pathconf, lEpi) +GOW(pause, iEv) +GO(pclose, iES) +GO(perror, vEp) +GOW(personality, iFL) +GOW(pipe, iEp) +// __pipe +GOW(pipe2, iEpO) // assuming this works the same as pipe, so pointer for array of 2 int +// pivot_root +// pmap_getmaps +// pmap_getport +// pmap_rmtcall +// pmap_set +// pmap_unset +GOW(poll, iEpLi) // poll have an array of struct as 1st argument +GO(__poll, iEpLi) +GO(popen, SEpp) +GO(posix_fadvise, iEilli) +GO(posix_fadvise64, iEiIIi) +GO(posix_fallocate, iEill) +GO(posix_fallocate64, iEiII) +GO(posix_madvise, iEpLi) +GOW(posix_memalign, iEBp_LL) +// posix_openpt // Weak +GOM(posix_spawn, iEEpppppp) //%% +GO(posix_spawnattr_destroy, iFp) +// posix_spawnattr_getflags +// posix_spawnattr_getpgroup +// posix_spawnattr_getschedparam +// posix_spawnattr_getschedpolicy +// posix_spawnattr_getsigdefault +// posix_spawnattr_getsigmask +GO(posix_spawnattr_init, iFp) +GOW(posix_spawnattr_setflags, iFpw) +// posix_spawnattr_setpgroup +// posix_spawnattr_setschedparam +// posix_spawnattr_setschedpolicy +GOW(posix_spawnattr_setsigdefault, iFpp) +// posix_spawnattr_setsigmask +GOM(posix_spawn_file_actions_addclose, iEEpi) //%% +GOM(posix_spawn_file_actions_adddup2, iEEpii) //%% +GOM(posix_spawn_file_actions_addopen, iEEpipOi) //%% +GOM(posix_spawn_file_actions_destroy, iEEp) //%% +GOM(posix_spawn_file_actions_init, iEEp) //%% +GOM(posix_spawnp, iEEpppppp) //%% +GO(ppoll, iEpurLL_p) +GO(__ppoll_chk, iEpurLL_pL) +GOWM(prctl, iEEiLLLL) +GOWM(__prctl_time64, iEEiLLLL) +GOW(pread, lEipLl) +GOW(pread64, lEipLI) +// __pread64 // Weak +// __pread64_chk +//GOM(preadv64, lEEipiI) //%% not always present +// __pread_chk +GOM(printf, iEEpV) //%% +GOM(__printf_chk, iEEipV) //%% +//GO(__printf_fp, iEppp) // does this needs aligment? +// printf_size +// printf_size_info +// profil // Weak +// __profile_frequency +DATAM(__progname, 4) +DATAM(__progname_full, 4) +DATAM(program_invocation_name, 4) +DATAM(program_invocation_short_name, 4) +GOW(pselect, iEippprLL_p) +// psignal +//GO(ptrace, iEiupp) // will that work??? +//GO(ptsname, pEi) +//GOW(ptsname_r, iEipu) +// __ptsname_r_chk +GOW(putc, iEiS) +GO(putchar, iEi) +GO(putchar_unlocked, iEi) +//GO(putc_unlocked, iEip) +GO(putenv, iEp) +// putgrent +// putmsg +// putpmsg +// putpwent +GOW(puts, iEp) +// putspent +//GOW(pututline, pEp) +// pututxline +// putw +GO(putwc, uEiS) +// putwchar +GO(putwchar_unlocked, uEi) +//GO(putwc_unlocked, iEip) +// pvalloc // Weak +// pwrite // Weak +GOW(pwrite64, lEipLI) +// __pwrite64 // Weak +//GOM(pwritev64, lEEipiI) //%% not always present +// qecvt +#ifdef HAVE_LD80BITS +//GO(qecvt_r, iEDipppL) +#else +//GO(qecvt_r, iEKipppL) +#endif +// qfcvt +#ifdef HAVE_LD80BITS +//GO(qfcvt_r, iEDipppL) +#else +//GO(qfcvt_r, iEKipppL) +#endif +// qgcvt +GOM(qsort, vEEpLLp) //%% +//GOM(qsort_r, vEEpLLpp) //%% +// query_module // Weak +//GO(quotactl, iEipip) +GO(raise, iEi) +GO(rand, iEv) +GOW(random, lEv) +GOW(random_r, iEbpppiiip_p) +GO(rand_r, iEp) +GOW(rawmemchr, pEpi) +GO(__rawmemchr, pEpi) +// rcmd +// rcmd_af +// __rcmd_errstr // type B +GOM(read, lEipL) //%%,noE +//GOW(__read, lEipL) +// readahead // Weak +GO(__read_chk, lEipLL) +GOWM(readdir, pEEp) //%% +GO(readdir64, pEp) // check if alignement is correct +//GOM(readdir_r, iEEppp) //%% should also be weak +GO2(readlink, lEEppL, my_readlink) //%% +GOM(readlinkat, iEEippL) +// __readlinkat_chk +// __readlink_chk +GOM(readv, lEEipi) +GO(realloc, pEpL) +//DATAV(__realloc_hook, 4) +GOM(realpath, pEEpp) //%% +GO2(__realpath_chk, pEEppi, my32_realpath) +// reboot +// re_comp // Weak +// re_compile_fastmap // Weak +//GOW(re_compile_pattern, pEpup) +GO(recv, lEipLi) +GO(__recv_chk, iEipLLi) +GOW(recvfrom, lEipLipp) +// __recvfrom_chk +GOM(recvmmsg, iEEipuurLL_) +GOWM(recvmsg, lEEipi) +GO2(__recvmsg64, lEipi, recvmsg) +// re_exec // Weak +GOWM(regcomp, iEEppi) +GOWM(regerror, uEEippu) +GOM(regexec, iEEppupi) +GOWM(regfree, vEEp) +GOM(__register_atfork, iEEpppp) //%% +// register_printf_function // Weak +// registerrpc +// remap_file_pages // Weak +//GOW(re_match, iEppiip) +// re_match_2 // Weak +GO(remove, iEp) +GO(removexattr, iEpp) +// remque +GO(rename, iEpp) +GO(renameat, iEipip) +//GO(renameat2, iEipipu) +// _res // type B +//GOW(re_search, iEppiiip) +//GOW(re_search_2, iEppipiiipi) +// re_set_registers // Weak +GOW(re_set_syntax, LEL) +// _res_hconf // type B +GO(__res_iclose, vEpi) +GO(__res_init, iEv) +//GO(__res_maybe_init, iEpi) +GO(__res_nclose, vEp) +GO(__res_ninit, iEp) +//DATA(__resp, 4) +// __res_randomid +GOM(__res_state, pEEv) +//DATA(re_syntax_options, 4) // type B +// revoke +GO(rewind, vES) +GO(rewinddir, vEp) +// rexec +// rexec_af +// rexecoptions // type B +GOW(rindex, pEpi) +GOW(rmdir, iEp) +GO(readdir64_r, iEppBp_) +// rpc_createerr // type B +// _rpc_dtablesize +// __rpc_thread_createerr +// __rpc_thread_svc_fdset +// __rpc_thread_svc_max_pollfd +// __rpc_thread_svc_pollfd +//GO(rpmatch, iEp) +// rresvport +// rresvport_af +// rtime +// ruserok +// ruserok_af +// ruserpass +GOW(sbrk, pEl) +GO(__sbrk, pEl) +// scalbn // Weak +// scalbnf // Weak +// scalbnl // Weak +GOM(scandir, iEEpppp) //%% +GOM(scandir64, iEEpppp) //%% +//GO2(scanf, iEpp, vscanf) +//GO(__sched_cpualloc, pEu) //TODO: check, return cpu_set_t* : should this be aligned/changed? +GO(__sched_cpucount, iEup) +//GO(__sched_cpufree, vEp) +GO(sched_getaffinity, iEiup) +GO(sched_getcpu, iEv) +GO(__sched_getparam, iEip) +GOW(sched_getparam, iEip) +GO(__sched_get_priority_max, iEi) +GOW(sched_get_priority_max, iEi) +GO(__sched_get_priority_min, iEi) +GOW(sched_get_priority_min, iEi) +GO(__sched_getscheduler, iEi) +GOW(sched_getscheduler, iEi) +//GOW(sched_rr_get_interval, iEip) +GO(sched_setaffinity, iEiup) +//GOW(sched_setparam, iEip) +GO(__sched_setscheduler, iEiip) +GOW(sched_setscheduler, iEiip) +GO(__sched_yield, iEv) +GOW(sched_yield, iEv) +GO2(__secure_getenv, tEp, secure_getenv) +GO(secure_getenv, tEp) +// seed48 +// seed48_r // Weak +//GO(seekdir, vEpi) +GOW(select, iEippprLL_) +GO(__select, iEippprLL_) +GO2(__select64, iEipppp, select) +GO(semctl, iEiiiN) +GOW(semget, iEiii) +GOW(semop, iEipL) +//GO(semtimedop, iEipup) +GOW(send, lEipLi) +// __send // Weak +GO(sendfile, lEiibl_L) +GO(sendfile64, lEiipL) +GOWM(sendmsg, lEEipi) +GO2(__sendmsg64, lEipi, sendmsg) +GOM(sendmmsg, iEEipuu) +GOW(sendto, lEipLipu) +// setaliasent +GOW(setbuf, vESp) +//GOW(setbuffer, vEppL) +GOM(setcontext, iEEp) //%% +// setdomainname +GO(setegid, iEu) +GOW(setenv, iEppi) +// _seterr_reply +GO(seteuid, iEu) +// setfsent +// setfsgid +// setfsuid +GOW(setgid, iEu) +GO(setgrent, vEv) +GO(setgroups, iEup) +GO(sethostent, vFi) +// sethostid +//GO(sethostname, iEpu) +// setipv4sourcefilter +GOW(setitimer, iEirLLLL_BLLLL_) +GOM(setjmp, iEEp) //%% +GOM(_setjmp, iEEp) //%% +GO(setlinebuf, vES) +GO(setlocale, tEip) +// setlogin +GO(setlogmask, iEi) +GOW(setmntent, SEpp) +// __setmntent +// setnetent +// setnetgrent +GO(setns, iEii) +GOW(setpgid, iEii) +// __setpgid +GO(setpgrp, iEv) +GO(setpriority, iEuui) +GO(setprotoent, vEi) +GO(setpwent, vEv) +GOW(setregid, iEuu) +GOW(setresgid, iEuuu) +GOW(setresuid, iEuuu) +GOW(setreuid, iEuu) +GOM(setrlimit, iEEup) +GO(setrlimit64, iEup) +// setrpcent +// setservent +GOW(setsid, iEv) +GOW(setsockopt, iEiiipu) +GO2(__setsockopt64, iEiiipu, setsockopt) +// setsourcefilter +GO(setspent, vEv) +// setstate // Weak +//GOW(setstate_r, iEpp) +//GOW(settimeofday, iEpp) +// setttyent +GOW(setuid, iEu) +// setusershell +GOW(setutent, vEv) +// setutxent +GOW(setvbuf, iESpiL) +GO(setxattr, iEpppLi) +// sgetspent +// sgetspent_r // Weak +#ifdef WINLATOR_GLIBC +GOW(shmat, pEipi) +GOW(shmdt, iEp) +#else +GOWM(shmat, pEEipi) +GOWM(shmdt, iEEp) +#endif +GOW(shmctl, iEiip) +GOW(shmget, iEiLi) +GOW(shutdown, iEii) +GOWM(sigaction, iEEipp) //%% +//GOWM(__sigaction, iEEipp) //%% +GO(sigaddset, iEpi) +// __sigaddset +GOWM(sigaltstack, iEEpp) //%% +// sigandset +GOW(sigblock, iEi) +GO(sigdelset, iEpi) +// __sigdelset +GO(sigemptyset, iEp) +GO(sigfillset, iEp) +GO(siggetmask, iEv) +// sighold +// sigignore +GO(siginterrupt, iEii) // no need to wrap this one? +GO(sigisemptyset, iFp) +GO(sigismember, iEpi) +// __sigismember +GOM(siglongjmp, vEEip) //%% +GOW2(signal, pEEip, my_signal) +GO(signalfd, iFipi) +GO(__signbit, iEd) +GO(__signbitf, iEf) +// sigorset +// sigpause // Weak +// __sigpause +//GO(sigpending, iEp) +GOW(sigprocmask, iEipp) +// sigqueue // Weak +// sigrelse +// sigreturn // Weak +GOM(sigset, pEEip) //%% +GOM(__sigsetjmp, iEEp) //%% +GOW(sigsetmask, iEi) +// sigstack +GOW(sigsuspend, iEp) +// __sigsuspend +GOW(sigtimedwait, iEpprLL_) +//GOW(sigvec, iEipp) +GOW(sigwait, iEpp) +//GOW(sigwaitinfo, iEpp) +GOW(sleep, uEu) +GOM(snprintf, iEEpLpV) //%% +GOM(__snprintf_chk, iEEpLiipV) //%% +//GOM(__snprintf, iEEpLpV) //%% +// sockatmark +GOW(socket, iEiii) +GOW(socketpair, iEiiip) +GO(splice, iEipipLu) +GOM(sprintf, iEEppV) //%% +GOM(__sprintf_chk, iEEpiipV) //%% +// sprofil // Weak +GOW(srand, vEu) +GO(srand48, vEl) +// srand48_r // Weak +GOW(srandom, vEu) +//GOW(srandom_r, iEup) +GOM(sscanf, iEEppV) //%% +// ssignal // Weak +// sstk +GOM(__stack_chk_fail, vEEv) //%% +GOM(lstat64, iEpp) //%%,noE +GOM(__lstat64_time64, iEEpp) +GOM(stat64, iEpp) //%%,noE +GOM(__stat64_time64, iEEpp) +GOM(stat, iEpp) //%%,noE +GOWM(statfs, iEpp) //%%,noE +// __statfs +GOWM(statfs64, iEpp) //%%,noE +GOM(statvfs, iEEpp) +GOWM(statvfs64, iEEpp) +GOM(statx, iEEipiup) +DATAM(stderr, 4) +DATAM(stdin, 4) +DATAM(stdout, 4) +// step // Weak +// stime +GO(stpcpy, pEpp) +// __stpcpy +GO(__stpcpy_chk, pEppL) +// __stpcpy_small +GOW(stpncpy, pEppL) +//GO(__stpncpy, pEppL) +//GO(__stpncpy_chk, pEppLL) +GOW(strcasecmp, iEpp) +//GO(__strcasecmp, iEpp) +// __strcasecmp_l +// strcasecmp_l // Weak +GOW(strcasestr, pEpp) +GO(__strcasestr, pEpp) +GO(strcat, pEpp) +GO(__strcat_chk, pEppL) +GO(strchr, pEpi) +GOW(strchrnul, pEpi) +GO(strcmp, iEpp) +GO(strcoll, iEpp) +GO(__strcoll_l, iEppa) +//GOW(strcoll_l, iEppp) +GO(strcpy, pEpp) +GO(__strcpy_chk, pEppL) +// __strcpy_small +GO(strcspn, LEpp) +// __strcspn_c1 +// __strcspn_c2 +// __strcspn_c3 +GOW(strdup, pEp) +GO(__strdup, pEp) +GO(strerror, tEi) +GO(strerror_l, pEia) +GO(__strerror_r, tEipL) +GOW(strerror_r, tEipL) +//GO(strfmon, lEpLpppppppppp) //vaarg, probably needs align, there are just double... +// __strfmon_l +// strfmon_l // Weak +// strfry +GO(strftime, LEpLpriiiiiiiiilt_) +GO(__strftime_l, LEpLpriiiiiiiiilt_a) +GOW(strftime_l, LEpLpriiiiiiiiilt_a) +GO(strlen, LEp) +GOW(strncasecmp, iEppL) +// __strncasecmp_l +// strncasecmp_l // Weak +GO(strlcat, pEppL) +GO(strlcpy, pEppL) +GO(strncat, pEppL) +GO(__strncat_chk, pEppLL) +GO(strncmp, iEppL) +GO(strncpy, pEppL) +GO(__strncpy_chk, pEppLL) +GOW(strndup, pEpL) +GO(__strndup, pEpL) +GO(strnlen, LEpL) +GO(strpbrk, pEpp) +// __strpbrk_c2 +// __strpbrk_c3 +GO(strptime, pEppriiiiiiiiilt_) +// strptime_l // Weak +GO(strrchr, pEpi) +//GOW(strsep, pEpp) +// __strsep_1c +// __strsep_2c +// __strsep_3c +// __strsep_g +GO(strsignal, tEi) +GO(strspn, LEpp) +// __strspn_c1 +// __strspn_c2 +// __strspn_c3 +GO(strstr, pEpp) +GO(strtod, dEpBp_) +GO(__strtod_internal, dEpBp_i) +GO(__strtod_l, dEpBp_a) +GOW(strtod_l, dEpBp_a) +GO(strtof, fEpBp_) +GO(__strtof_internal, fEpBp_p) +GO(__strtof_l, fEpBp_a) +//GOW(strtof_l, fEppu) +//GO(strtoimax, IEppi) +GO(strtok, pEpp) +GO(__strtok_r, pEppbp_) +GOW(strtok_r, pEppbp_) +// __strtok_r_1c +GOM(strtol, lEpBp_i) //%%,noE +#ifdef HAVE_LD80BITS +//GO(strtold, DEpp) +//GO(__strtold_internal, DEppi) +GO(__strtold_l, DEpBp_a) +GOW(strtold_l, DEpBp_a) +#else +//GO(strtold, KEpp) +//GO2(__strtold_internal, KEppi, __strtod_internal) +GO2(__strtold_l, KEpBp_a, __strtod_l) +GOW2(strtold_l, KEpBp_a, strtod_l) +#endif +GO2(__strtol_internal, lEpBp_i, my32_strtol) //%%,noE +GO(strtoll, IEpBp_i) +//GO(__strtol_l, lEppiip) +//GOW(strtol_l, lEppiip) +GO(__strtoll_internal, IEpBp_ii) +GO(__strtoll_l, IEpBp_ia) +GO2(__isoc23_strtoll_l, IEpBp_ia, __strtoll_l) +GOW(strtoll_l, IEpBp_ia) +GOW(strtoq, IEppi) // is that ok? +GOM(strtoul, LEpBp_i) //%%,noE +GO2(__strtoul_internal, LEpBp_ii, my32_strtoul) //%%,noE +GO(strtoull, UEpBp_i) +//GO(__strtoul_l, uEppip) +//GOW(strtoul_l, LEppip) +GO(__strtoull_internal, UEpBp_ii) +GO(__strtoull_l, UEpBp_ia) +GO2(__isoc23_strtoull_l, UEpBp_ia, __strtoull_l) +GOW(strtoull_l, UEpBp_ia) +//GO(strtoumax, UEppi) +GOW(strtouq, UEppi) // ok? +GOW(strverscmp, iEpp) +// __strverscmp +GO(strxfrm, uEppL) +GO(__strxfrm_l, LEppLa) +//GO(strxfrm_l, uEppup) +// stty +// svcauthdes_stats // type B +// svcerr_auth +// svcerr_decode +// svcerr_noproc +// svcerr_noprog +// svcerr_progvers +// svcerr_systemerr +// svcerr_weakauth +// svc_exit +// svcfd_create +// svc_fdset // type B +// svc_getreq +// svc_getreq_common +// svc_getreq_poll +// svc_getreqset +// svc_max_pollfd // type B +// svc_pollfd // type B +// svcraw_create +// svc_register +// svc_run +// svc_sendreply +// svctcp_create +// svcudp_bufcreate +// svcudp_create +// svcudp_enablecache +// svcunix_create +// svcunixfd_create +// svc_unregister +//GO(swab, vEppi) +GOM(swapcontext, iEEpp) //%% +// swapoff // Weak +// swapon // Weak +GOM(swprintf, iEEpLpV) //%% +GOM(__swprintf_chk, iEEpLiLpV) //%% +GOM(swscanf, iEEppV) +GOW(symlink, iEpp) +GO(symlinkat, iEpip) +GO(sync, vEv) +GO(syncfs, iEi) +// sync_file_range +GOM(syscall, lEEuV) //%% +GOW2(sysconf, lEEi, my_sysconf) +GO2(__sysconf, lEEi, my_sysconf) +// sysctl // Weak +//GO(__sysctl, iEp) +//DATA(_sys_errlist, 4) +//DATA(sys_errlist, 4) +GOM(sysinfo, iEp) //%noE +GOM(syslog, vEEipV) +GOM(__syslog_chk, vEEiipV) +//DATA(_sys_nerr, 4) // type R +//DATA(sys_nerr, 4) // type R +//DATA(sys_sigabbrev, 4) +//DATA(_sys_siglist, 4) +//DATA(sys_siglist, 4) +GOW(system, iEp) // Need to wrap to use box86 if needed? +GO2(__sysv_signal, pEEip, my___sysv_signal) //%% +//GOWM(sysv_signal, pEEip) //%% +GOW(tcdrain, iEi) +GO(tcflow, iEii) +GO(tcflush, iEii) +GOW(tcgetattr, iEip) +GO(tcgetpgrp, iEi) +// tcgetsid +GO(tcsendbreak, iEii) +GO(tcsetattr, iEiip) +GO(tcsetpgrp, iEii) +// tdelete // Weak +// tdestroy // Weak +// tee +//GO(telldir, iEp) +GO(tempnam, pEpp) +GOW(textdomain, tEp) +// tfind // Weak +GO(time, LEBL_) +GO2(__time64, IEp, time) +GOM(timegm, lEEriiiiiiiiilt_) //%% +// timelocal // Weak +GO(timerfd_create, iEii) +//GO(timerfd_gettime, iEip) +GO(timerfd_settime, iEiirLL_BLL_) +GOW(times, iEBllll_) +DATAM(timezone, 4) +DATAM(__timezone, 4) // type B +GO(tmpfile, pEv) +GO(tmpfile64, pEv) +GO(tmpnam, pEp) +//GO(tmpnam_r, pEp) +GO(toascii, iEi) +// __toascii_l // Weak +GO(tolower, iEi) +// _tolower +// __tolower_l +//GOW(tolower_l, iEip) +GO(toupper, iEi) +// _toupper +// __toupper_l +//GOW(toupper_l, iEip) +// towctrans // Weak +// __towctrans +// __towctrans_l +// towctrans_l // Weak +GO(towlower, uEu) +GO(__towlower_l, uEua) +GOW(towlower_l, uEua) +GO(towupper, uEu) +GO(__towupper_l, uEua) +GOW(towupper_l, uEua) +// tr_break +//GOW(truncate, iEpu) +GO(truncate64, iESU) +// tsearch // Weak +//GO(ttyname, pEi) +//GOW(ttyname_r, iEipu) +// __ttyname_r_chk +// ttyslot +// twalk // Weak +DATAM(tzname, 4) +//DATA(__tzname, 4) +GOWM(tzset, vEv) //%%,noE +// ualarm +GO(__uflow, iES) +// ulckpwdf // Weak +// ulimit // Weak +GOW(umask, uEu) +GOW(umount, iEp) +GOW(umount2, iEpi) +GOWM(uname, iEp) //%%,noE +//GO(__underflow, iEp) +GOW(ungetc, iEiS) +GO(ungetwc, uEuS) +GOW(unlink, iEp) +GO(unlinkat, iEipi) +GO(unlockpt, iEi) +GOW(unsetenv, iEp) +// unshare +//GOW(updwtmp, vEpp) +// updwtmpx +// uselib +GOW(uselocale, aEa) +GO(__uselocale, aEa) +// user2netname +GO(usleep, iEu) +// ustat +GO(utime, iEprll_) +GOM(utimensat, iEippi) //%noE +GOWM(utimes, iEEpp) +//GOW(utmpname, iEp) +// utmpxname +GOW(valloc, pEL) +GOM(vasprintf, iEEppp) //%% +GOM(__vasprintf_chk, iEEpipp) //%% +// vdprintf // Weak +// __vdprintf_chk +//GOM(verr, vEEpV) //%% +// verrx +//GO(versionsort, iEpp) +//GO(versionsort64, iEpp) //need to align dirent64? +GOWM(vfork, iEEv) //%% +// __vfork +GOM(vfprintf, iEESpp) //%% +GOM(__vfprintf_chk, iEESipp) //%% +//GOWM(vfscanf, iEEppp) //%% +// __vfscanf +//GOWM(vfwprintf, iEEppp) //%% +//GO2(__vfwprintf_chk, iEEpvpp, my_vfwprintf) +//GOW(vfwscanf, iEppp) +// vhangup +// vlimit +// vmsplice +GOM(vprintf, iEEpp) //%% +GOM(__vprintf_chk, iEEipp) //%% +// vscanf // Weak +GOWM(vsnprintf, iEEpLpp) //%% +GOWM(__vsnprintf, iEEpLpp) //%% +GOM(__vsnprintf_chk, iEEpLiipp) //%% +GOWM(vsprintf, iEEppp) //%% +GOM(__vsprintf_chk, iEEpiLpp) //%% +GOM(vsscanf, iEEppp) //%% +// __vsscanf // Weak +GOWM(vswprintf, iEEpLpp) //%% +GOWM(__vswprintf, iEEpLpp) //%% +GOWM(__vswprintf_chk, iEEpLiLppp) //%% +GOM(vswscanf, iEEppp) +GOM(vsyslog, vEEipp) +GOM(__vsyslog_chk, vEEiipp) +// vtimes +//GOM(vwarn, vEEppp) //%% +// vwarnx +//GOM(vwprintf, iEEpp) //%% +//GO2(__vwprintf_chk, iEEvpp, my_vwprintf) +//GO(vwscanf, iEpp) +GOW(wait, iEp) +//GOW(__wait, iEp) +//GOW(wait3, iEpip) +//GOW(wait4, iEipip) +GOWM(waitid, iEEuupi) +GOW(waitpid, iEipi) +GOW(__waitpid, lElpi) +//GO(warn, vEppppppppp) +//GO(warnx, vEppppppppp) +//GOW(wcpcpy, pEpp) +// __wcpcpy_chk +//GOW(wcpncpy, pEpp) +// __wcpncpy_chk +GOW(wcrtomb, LEpip) +// __wcrtomb_chk +GOW(wcscasecmp, iEpp) +// __wcscasecmp_l +//GOW(wcscasecmp_l, iEppp) +GOW(wcscat, pEpp) +GO(__wcscat_chk, pEppL) +GO(wcschr, pEpi) +// wcschrnul // Weak +GO(wcscmp, iEpp) +GOW(wcscoll, iEpp) +GO(__wcscoll_l, iEppa) +GOW(wcscoll_l, iEppa) +GO(wcscpy, pEpp) +GO(__wcscpy_chk, pEppL) +//GO(wcscspn, uEpp) +GO(wcsdup, pEp) +GO(wcsftime, LEpLpriiiiiiiiilt_) +GO(__wcsftime_l, LEpLppa) +GOW(wcsftime_l, LEpLppa) +GOW(wcslen, LEp) +GOW(wcsncasecmp, iEppL) +// __wcsncasecmp_l +//GOW(wcsncasecmp_l, iEppup) +GO(wcsncat, pEppL) +GO(__wcsncat_chk, pEppLL) +GO(wcsncmp, iEppL) +GOW(wcsncpy, pEppL) +GO(__wcsncpy_chk, pEppLL) +GOW(wcsnlen, LEpL) +GOW(wcsnrtombs, LEpBp_LLp) +// __wcsnrtombs_chk +GO(wcspbrk, pEpp) +GO(wcsrchr, pEpi) +//GOW(wcsrtombs, uEppup) +// __wcsrtombs_chk +//GO(wcsspn, uEpp) +GO(wcsstr, pEpp) +GO(wcstod, dEpBp_) +//GO(__wcstod_internal, dEppi) +// __wcstod_l +// wcstod_l // Weak +GO(wcstof, fEpBp_) +// __wcstof_internal +// __wcstof_l +// wcstof_l // Weak +// wcstoimax +GO(wcstok, pEppBp_) +GOM(wcstol, lEpBp_i) //%noE +//GO(wcstold, DEpp) +// __wcstold_internal +// __wcstold_l +// wcstold_l // Weak +//GO(__wcstol_internal, iEppii) +GO(wcstoll, IEpBp_i) +// __wcstol_l +// wcstol_l // Weak +// __wcstoll_internal +// __wcstoll_l +// wcstoll_l // Weak +GO(wcstombs, LEppL) +// __wcstombs_chk +// wcstoq // Weak +GOM(wcstoul, LEpBp_i) //%noE +//GO(__wcstoul_internal, LEppii) +GO(wcstoull, UEpBp_i) +// __wcstoul_l +// wcstoul_l // Weak +// __wcstoull_internal +// __wcstoull_l +// wcstoull_l // Weak +// wcstoumax +// wcstouq // Weak +// wcswcs // Weak +//GO(wcswidth, iEpu) +GO(wcsxfrm, LEppL) +//GOW(wcsxfrm_l, uEppup) +GO(__wcsxfrm_l, LEppLa) +GO(wctob, iEu) +GO(wctomb, iEpi) +//GO(__wctomb_chk, iEpuL) +// wctrans // Weak +// __wctrans_l +// wctrans_l // Weak +GOW(wctype, uEp) +GO(__wctype_l, hEpa) +GOW(wctype_l, hEpa) +GO(wcwidth, iEu) +GO(wcslcat, LFppL) +GO(wcslcpy, LFppL) +GOW(wmemchr, pEpiL) +GO(wmemcmp, iEppL) +GOW(wmemcpy, pEppL) +GO(__wmemcpy_chk, pEppLL) +GOW(wmemmove, pEppL) +// __wmemmove_chk +// wmempcpy // Weak +// __wmempcpy_chk +GO(wmemset, pEpiL) +// __wmemset_chk +//GO(wordexp, iEppi) +//GO(wordfree, vEp) +// __woverflow +GOM(wprintf, iEEpV) //%% +//GOM(__wprintf_chk, iEEipV) //%% +GOWM(write, lEEipL) +//GOW(__write, lEipL) +GOWM(writev, lEEipi) +// wscanf +// __wuflow +// __wunderflow +// xdecrypt +// xdr_accepted_reply +// xdr_array +// xdr_authdes_cred +// xdr_authdes_verf +// xdr_authunix_parms +GO(xdr_bool, iEpp) +// xdr_bytes +// xdr_callhdr +// xdr_callmsg +// xdr_char +// xdr_cryptkeyarg +// xdr_cryptkeyarg2 +// xdr_cryptkeyres +// xdr_des_block +// xdr_double +// xdr_enum +// xdr_float +// xdr_free +// xdr_getcredres +// xdr_hyper +GO(xdr_int, iEpp) +// xdr_int16_t +// xdr_int32_t +// xdr_int64_t +// xdr_int8_t +// xdr_keybuf +// xdr_key_netstarg +// xdr_key_netstres +// xdr_keystatus +// xdr_long +// xdr_longlong_t +// xdrmem_create +// xdr_netnamestr +GO(xdr_netobj, iEpbup_) +// xdr_opaque +// xdr_opaque_auth +// xdr_pmap +// xdr_pmaplist +// xdr_pointer +// xdr_quad_t +// xdrrec_create +// xdrrec_endofrecord +// xdrrec_eof +// xdrrec_skiprecord +// xdr_reference +// xdr_rejected_reply +// xdr_replymsg +// xdr_rmtcall_args +// xdr_rmtcallres +// xdr_short +// xdr_sizeof +// xdrstdio_create +// xdr_string +// xdr_u_char +// xdr_u_hyper +GO(xdr_u_int, iEpp) +// xdr_uint16_t +// xdr_uint32_t +// xdr_uint64_t +// xdr_uint8_t +// xdr_u_long +// xdr_u_longlong_t +// xdr_union +// xdr_unixcred +// xdr_u_quad_t +// xdr_u_short +// xdr_vector +GO(xdr_void, iEv) +// xdr_wrapstring +// xencrypt +GOM(__xmknod, iEEipup) +//GO(__xmknodat, iEiipip) +GO(__xpg_basename, tEp) +// __xpg_sigpause // Weak +GO(__xpg_strerror_r, tEipu) +// xprt_register +// xprt_unregister +GOM(__xstat, iEEipp) //%% +GOM(__xstat64, iEEipp) //%% + +// forcing a custom __gmon_start__ that does nothing +GOM(__gmon_start__, vEEv) //%% + +GOM(_Jv_RegisterClasses, vEv) //%%,noE dummy + +GOM(__fdelt_chk, LEL) //%%,noE + +GOM(getauxval, LEEL) //%% implemented since glibc 2.16 + +//GOM(prlimit64, lEpupp) //%%,noE +GOM(process_vm_readv, lEEipLpLL) +GOM(process_vm_writev, lEEipLpLL) +GOM(reallocarray, pEpLL) //%%,noE +//GOM(__open_nocancel, iEEpOV) //%% +//GO2(__read_nocancel, lEipL, read) +GO2(__close_nocancel, iEi, close) + +GOM(mkstemps64, iEEpi) //%% not always implemented +GO(getentropy, iEpL) + +// not found (libitm???), but it seems OK to declare dummies: + +GOWM(_ZGTtdlPv, vFp) //%noE +GOWM(_ZGTtnaX, pFL) //%noE +GOWM(_ZGTtnam, pFL) //%noE +GOWM(_ZGTtnaj, pFu) //%noE +GOWM(_ITM_RU1, uEp) //%%,noE +GOWM(_ITM_RU4, uEp) //%%,noE +GOWM(_ITM_RU8, UEp) //%%,noE +GOWM(_ITM_memcpyRtWn, vEppu) //%%,noE register(2) +GOWM(_ITM_memcpyRnWt, vEppu) //%%,noE register(2) +GOWM(_ITM_addUserCommitAction, vEEpup) +GOWM(_ITM_registerTMCloneTable, vEEpu) //%% +GOWM(_ITM_deregisterTMCloneTable, vEEp) //%% + +GOM(__umoddi3, UEUU) //%%,noE +GOM(__udivdi3, UEUU) //%%,noE +GOM(__divdi3, IEII) //%%,noE +GOM(__poll_chk, iEpuiL) //%%,noE + +GO(fallocate64, iEiiII) + +//DATAM(__libc_stack_end, 4) + +//DATAM(___brk_addr, 4) +DATA(__libc_enable_secure, 4) + +GOM(__register_frame_info, vEpp) //%%,noE faked function +GOM(__deregister_frame_info, pEp) //%%,noE + +GO(name_to_handle_at, iEipppi) // only glibc 2.14+, so may not be present... + +//GOM(modify_ldt, iEEipL) // there is suposedly no glibc wrapper for this one + +// duplicated stuffs from libresolv +GOWM(res_query, iEEpiipi) +GOWM(res_search, iEEpiipi) + +#ifdef ANDROID +//GOM(__libc_init, vEEpppp) +GO(__errno, pEv) +#else +// Those symbols don't exist in non-Android builds +//GOM(__libc_init, +//GO(__errno, +#endif + +GOM(lstat, iEpp) //%%,noE +//GO(setprogname, +//GO(getprogname, + +DATAM(__libc_single_threaded, 4) //B type diff --git a/src/wrapped32/wrappedlibcups.c b/src/wrapped32/wrappedlibcups.c new file mode 100644 index 0000000..caaa0e5 --- /dev/null +++ b/src/wrapped32/wrappedlibcups.c @@ -0,0 +1,219 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +static const char* libcupsName = "libcups.so.2"; +#define ALTNAME "libcups.so" + +#define LIBNAME libcups + +//------- 64 bits structures +typedef struct my_cups_option_s +{ + char* name; + char* value; +} my_cups_option_t; + +typedef struct my_cups_dest_s +{ + char* name; + char* instance; + int is_default; + int num_options; + my_cups_option_t* options; +} my_cups_dest_t; + +//------- 32 bits structures +typedef struct my_cups_option_32_s +{ + ptr_t name; //char* + ptr_t value; //char* +} my_cups_option_32_t; + +typedef struct my_cups_dest_32_s +{ + ptr_t name; //char* + ptr_t instance; //char* + int is_default; + int num_options; + ptr_t options; //my_cups_option_t* +} my_cups_dest_32_t; + +//------- Conversions + +void* inplace_cups_option_shrink(void* a) +{ + if(a) { + my_cups_option_t* src = a; + my_cups_option_32_t* dst = a; + dst->name = to_ptrv(src->name); + dst->value = to_ptrv(src->value); + } + return a; +} +void* inplace_cups_option_enlarge(void* a) +{ + if(a) { + my_cups_option_32_t* src = a; + my_cups_option_t* dst = a; + dst->value = from_ptrv(src->value); + dst->name = from_ptrv(src->name); + } + return a; +} + +void convert_cups_dest_to_32(void* s, void* d) +{ + if(!s || !d) return; + my_cups_dest_t* src = s; + my_cups_dest_32_t* dst = d; + dst->name = to_ptrv(src->name); + dst->instance = to_ptrv(src->instance); + dst->is_default = src->is_default; + dst->num_options = src->num_options; + dst->options = to_ptrv(inplace_cups_option_shrink(src->options)); +} +void convert_cups_dest_to_64(void* s, void* d) +{ + if(!s || !d) return; + my_cups_dest_32_t* src = s; + my_cups_dest_t*dst = d; + dst->options = inplace_cups_option_enlarge(from_ptrv(src->options)); + dst->num_options = src->num_options; + dst->is_default = src->is_default; + dst->instance = from_ptrv(src->instance); + dst->name = from_ptrv(src->name); +} +void* inplace_cups_dest_shrink(void* a) +{ + if(a) convert_cups_dest_to_32(a, a); + return a; +} +void* inplace_cups_dest_enlarge(void* a) +{ + if(a) convert_cups_dest_to_64(a, a); + return a; +} + +// Wrappers + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedlibcupstypes32.h" + +#include "wrappercallback32.h" + +#if 0 +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// cups_dest_cb_t ... +#define GO(A) \ +static uintptr_t my_cups_dest_cb_t_fct_##A = 0; \ +static int my_cups_dest_cb_t_##A(void* a, uint32_t b, void* c) \ +{ \ + return (int)RunFunctionFmt(my_cups_dest_cb_t_fct_##A, "pup", a, b, c); \ +} +SUPER() +#undef GO +static void* find_cups_dest_cb_t_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_cups_dest_cb_t_fct_##A == (uintptr_t)fct) return my_cups_dest_cb_t_##A; + SUPER() + #undef GO + #define GO(A) if(my_cups_dest_cb_t_fct_##A == 0) {my_cups_dest_cb_t_fct_##A = (uintptr_t)fct; return my_cups_dest_cb_t_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcups cups_dest_cb_t callback\n"); + return NULL; +} +// cups_password_cb2_t ... +#define GO(A) \ +static uintptr_t my_cups_password_cb2_t_fct_##A = 0; \ +static void* my_cups_password_cb2_t_##A(void* a, void* b, void* c, void* d, void* e) \ +{ \ + return (void*)RunFunctionFmt(my_cups_password_cb2_t_fct_##A, "ppppp", a, b, c, d, e); \ +} +SUPER() +#undef GO +static void* find_cups_password_cb2_t_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_cups_password_cb2_t_fct_##A == (uintptr_t)fct) return my_cups_password_cb2_t_##A; + SUPER() + #undef GO + #define GO(A) if(my_cups_password_cb2_t_fct_##A == 0) {my_cups_password_cb2_t_fct_##A = (uintptr_t)fct; return my_cups_password_cb2_t_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libcups cups_password_cb2_t callback\n"); + return NULL; +} + +#undef SUPER + +EXPORT int my_cupsEnumDests(x64emu_t* emu, uint32_t flags, int msec, int* cancel, uint32_t type, uint32_t mask, void* f, void* data) +{ + return my->cupsEnumDests(flags, msec, cancel, type, mask, find_cups_dest_cb_t_Fct(f), data); +} + +EXPORT void my_cupsSetPasswordCB2(x64emu_t* emu, void* f, void* data) +{ + my->cupsSetPasswordCB2(find_cups_password_cb2_t_Fct(f), data); +} +#endif + +EXPORT void my32_cupsFreeDests(x64emu_t* emu, int n, void* p) +{ + my_cups_dest_32_t* src = p; + my_cups_dest_t* dst= p; + for(int i=n-1; i>=0; --i) + convert_cups_dest_to_64(&dst[i], &src[i]); + my->cupsFreeDests(n, p); +} + +EXPORT int my32_cupsGetDests(x64emu_t* emu, ptr_t* p) +{ + void* p_l = from_ptrv(*p); + int ret = my->cupsGetDests(&p_l); + *p = to_ptrv(p_l); + my_cups_dest_t* src = p_l; + my_cups_dest_32_t* dst = p_l; + for(int i=0; icupsGetOption(name, num_options, options_l); +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibcups_private.h b/src/wrapped32/wrappedlibcups_private.h new file mode 100644 index 0000000..4882580 --- /dev/null +++ b/src/wrapped32/wrappedlibcups_private.h @@ -0,0 +1,568 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//GOM(cupsAddDest, iFEppibp_) +//GOM(cupsAddIntegerOption, iFEpiibp_) +//GOM(cupsAddOption, iFEppibp_) +GO(cupsAdminCreateWindowsPPD, pFpppi) +GO(cupsAdminExportSamba, iFpppppS) +//GOM(cupsAdminGetServerSettings, iFEppbp_) +GO(cupsAdminSetServerSettings, iFpibpp_) +GO(cupsArrayAdd, iFpp) +//GO(_cupsArrayAddStrings, +GO(cupsArrayClear, vFp) +GO(cupsArrayCount, iFp) +GO(cupsArrayCurrent, pFp) +GO(cupsArrayDelete, vFp) +GO(cupsArrayDup, pFp) +GO(cupsArrayFind, pFpp) +GO(cupsArrayFirst, pFp) +GO(cupsArrayGetIndex, iFp) +GO(cupsArrayGetInsert, iFp) +GO(cupsArrayIndex, pFpi) +GO(cupsArrayInsert, iFpp) +GO(cupsArrayLast, pFp) +//GOM(cupsArrayNew, pFEpp) +//GOM(cupsArrayNew2, pFEpppi) +//GOM(cupsArrayNew3, pFEpppipp) +//GO(_cupsArrayNewStrings, +GO(cupsArrayNext, pFp) +GO(cupsArrayPrev, pFp) +GO(cupsArrayRemove, iFpp) +GO(cupsArrayRestore, pFp) +GO(cupsArraySave, iFp) +GO(cupsArrayUserData, pFp) +GO(cupsBackChannelRead, lFpLd) +GO(cupsBackChannelWrite, lFpLd) +GO(cupsBackendDeviceURI, pFbp_) +GO(cupsBackendReport, vFpppppp) +//GO(_cupsBufferGet, +//GO(_cupsBufferRelease, +//GOM(cupsCancelDestJob, iFEpbppiip_i) +GO(cupsCancelJob, iFpi) +GO(cupsCancelJob2, iFppii) +//GO(_cupsCharmapFlush, +GO(cupsCharsetToUTF8, iFppii) +//GOM(cupsCheckDestSupported, iFEpbppiip_ppp) +//GOM(cupsCloseDestJob, iFEpbppiip_pi) +//GO(_cupsCondBroadcast, +//GO(_cupsCondInit, +//GO(_cupsCondWait, +//GO(_cupsConnect, +//GOM(cupsConnectDest, pFEbppiip_uippLpp) +//GO(_cupsConvertOptions, +//GOM(cupsCopyDest, iFEbppiip_ibp_) +//GOM(cupsCopyDestConflicts, iFEpbppiip_pibpp_pppbp_pbp_) +//GOM(cupsCopyDestInfo, pFEpbppiip_) +//GO(_cupsCreateDest, +//GOM(cupsCreateDestJob, iFEpbppiip_pppibpp_) +GO(cupsCreateJob, iFpppibpp_) +//DATA(_cups_debug_fd, +//DATA(_cups_debug_level, +GO(cupsDirClose, vFp) +GO(cupsDirOpen, pFp) +//GO(cupsDirRead, pFp) +GO(cupsDirRewind, vFp) +GO(cupsDoAuthentication, iFppp) +GO(cupsDoFileRequest, pFpppp) +GO(cupsDoIORequest, pFpppii) +GO(cupsDoRequest, pFppp) +GO(cupsEncodeOptions, vFpibpp_) +GO(cupsEncodeOptions2, vFpibpp_i) +//GO(_cupsEncodingName, +GO(cupsEncryption, uFv) +//GOM(cupsEnumDests, iFEuipuupp) +//GO(_cupsFileCheck, +//GO(_cupsFileCheckFilter, +GO(cupsFileClose, iFp) +GO(cupsFileCompression, iFp) +GO(cupsFileEOF, iFp) +GO(cupsFileFind, pFppipi) +GO(cupsFileFlush, iFp) +GO(cupsFileGetChar, iFp) +GO(cupsFileGetConf, pFppLbp_p) +GO(cupsFileGetLine, LFppL) +GO(cupsFileGets, pFppL) +GO(cupsFileLock, iFpi) +GO(cupsFileNumber, iFp) +GO(cupsFileOpen, pFpp) +GO(cupsFileOpenFd, pFip) +//GO(_cupsFilePeekAhead, +GO(cupsFilePeekChar, iFp) +//GOM(cupsFilePrintf, iFEppV) +GO(cupsFilePutChar, iFpi) +GO(cupsFilePutConf, lFppp) +GO(cupsFilePuts, iFpp) +GO(cupsFileRead, lFppL) +GO(cupsFileRewind, IFp) +GO(cupsFileSeek, IFpI) +GO(cupsFileStderr, pFv) +GO(cupsFileStdin, pFv) +GO(cupsFileStdout, pFv) +GO(cupsFileTell, IFp) +GO(cupsFileUnlock, iFp) +GO(cupsFileWrite, lFppL) +//GOM(cupsFindDestDefault, pFEpbppiip_pp) +//GOM(cupsFindDestReady, pFEpbppiip_pp) +//GOM(cupsFindDestSupported, pFEpbppiip_pp) +//GOM(cupsFinishDestDocument, iFEpbppiip_p) +GO(cupsFinishDocument, iFpp) +GO(cupsFreeDestInfo, vFp) +GOM(cupsFreeDests, vFEip) +//GO(cupsFreeJobs, vFibippppuiiIII_) +GO(cupsFreeOptions, vFibpp_) +//GO(_cupsGet1284Values, +//GOM(cupsGetClasses, iFEbp_) +//GOM(cupsGetConflicts, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_ppbp_) +GO(cupsGetDefault, pFv) +GO(cupsGetDefault2, pFp) +//GOM(cupsGetDest, pFEppibppiip_) +//GOM(cupsGetDestMediaByIndex, iFEpbppiip_piup) +//GOM(cupsGetDestMediaByName, iFEpbppiip_ppup) +//GOM(cupsGetDestMediaBySize, iFEpbppiip_piiup) +//GOM(cupsGetDestMediaCount, iFEpbppiip_pu) +//GOM(cupsGetDestMediaDefault, iFEpbppiip_pup) +//GO(_cupsGetDestResource, +//GO(_cupsGetDests, +GOM(cupsGetDests, iFEp) +//GOM(cupsGetDests2, iFEpbp_) +//GOM(cupsGetDestWithURI, pFEpp) +//GOM(cupsGetDevices, iFEpipppp) +GO(cupsGetFd, iFppi) +GO(cupsGetFile, iFppp) +GO(cupsGetIntegerOption, iFpibpp_) +//GOM(cupsGetJobs, iFEbp_pii) +//GOM(cupsGetJobs2, iFEpbp_pii) +//GOM(cupsGetNamedDest, pFEppp) +GOM(cupsGetOption, pFEpip) +//GO(_cupsGetPassword, +GO(cupsGetPassword, pFp) +GO(cupsGetPassword2, pFpppp) +GO(cupsGetPPD, pFp) +GO(cupsGetPPD2, pFpp) +GO(cupsGetPPD3, iFppbL_pL) +//GOM(cupsGetPrinters, iFEbp_) +GO(cupsGetResponse, pFpp) +GO(cupsGetServerPPD, pFpp) +//GO(_cupsGlobalLock, +//GO(_cupsGlobals, +//GO(_cupsGlobalUnlock, +//GO(_cupsGSSServiceName, +GO(cupsHashData, lFppLpL) +GO(cupsHashString, pFpLpL) +//GOM(cupsLangDefault, pFEv) +//GOM(cupsLangEncoding, pFEp) +GO(cupsLangFlush, vFv) +//GOM(cupsLangFree, vFEp) +//GOM(cupsLangGet, pFEp) +//GO(_cupsLangPrintError, +//GO(_cupsLangPrintf, +//GO(_cupsLangPrintFilter, +//GO(_cupsLangPuts, +//GO(_cupsLangString, +GO(cupsLastError, iFv) +GO(cupsLastErrorString, pFv) +//GOM(cupsLocalizeDestMedia, pFEpbppiip_pup) +//GOM(cupsLocalizeDestOption, pFEpbppiip_pp) +//GOM(cupsLocalizeDestValue, pFEpbppiip_ppp) +GO(cupsMakeServerCredentials, iFppibp_I) +//GOM(cupsMarkOptions, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_ibpp_) +//GO(_cupsMessageFree, +//GO(_cupsMessageLoad, +//GO(_cupsMessageLookup, +//GO(_cupsMessageNew, +//GO(_cupsMutexInit, +//GO(_cupsMutexLock, +//GO(_cupsMutexUnlock, +//GO(_cupsNextDelay, +//GOM(cupsNotifySubject, pFEpp) +//GOM(cupsNotifyText, pFEpp) +//GOM(cupsParseOptions, iFEpibp_) +GO(cupsPrintFile, iFpppibpp_) +GO(cupsPrintFile2, iFppppibpp_) +GO(cupsPrintFiles, iFpibp_pibpp_) +GO(cupsPrintFiles2, iFppibp_pibpp_) +GO(cupsPutFd, iFppi) +GO(cupsPutFile, iFppp) +GO(cupsReadResponseData, lFppL) +//GOM(cupsRemoveDest, iFEppibp_) +//GOM(cupsRemoveOption, iFEpibp_) +//GOM(cupsResolveConflicts, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_pppbp_) +//GO(_cupsRWInit, +//GO(_cupsRWLockRead, +//GO(_cupsRWLockWrite, +//GO(_cupsRWUnlock, +//GO(_cups_safe_vsnprintf, +GO(cupsSendRequest, iFpppL) +GO(cupsServer, pFv) +//GOM(cupsSetClientCertCB, vFEpp) +GO(cupsSetCredentials, iFp) +//GOM(cupsSetDefaultDest, vFEppibppiip_) +//GO(_cupsSetDefaults, +//GOM(cupsSetDests, vFEibppiip_) +//GOM(cupsSetDests2, iFEpibppiip_) +GO(cupsSetEncryption, vFu) +//GO(_cupsSetError, +//GO(_cupsSetHTTPError, +//GO(_cupsSetLocale, +//GO(_cupsSetNegotiateAuthString, +//GOM(cupsSetPasswordCB, vFEp) +//GOM(cupsSetPasswordCB2, vFEpp) +GO(cupsSetServer, vFp) +//GOM(cupsSetServerCertCB, vFEpp) +GO(cupsSetServerCredentials, iFppi) +GO(cupsSetUser, vFp) +GO(cupsSetUserAgent, vFp) +GO(cupsSideChannelDoRequest, uFuppd) +GO(cupsSideChannelRead, iFppppd) +GO(cupsSideChannelSNMPGet, uFpppd) +//GOM(cupsSideChannelSNMPWalk, uFEpdpp) +GO(cupsSideChannelWrite, iFuupid) +//GO(_cupsSNMPClose, +//GO(_cupsSNMPCopyOID, +//GO(_cupsSNMPDefaultCommunity, +//GO(_cupsSNMPIsOID, +//GO(_cupsSNMPIsOIDPrefixed, +//GO(_cupsSNMPOIDToString, +//GO(_cupsSNMPOpen, +//GO(_cupsSNMPRead, +//GO(_cupsSNMPSetDebug, +//GO(_cupsSNMPStringToOID, +//GO(_cupsSNMPWalk, +//GO(_cupsSNMPWrite, +//GOM(cupsStartDestDocument, iFEpbppiip_pippibpp_i) +GO(cupsStartDocument, iFppippi) +//GO(_cupsStrAlloc, +//GO(_cups_strcasecmp, +//GO(_cups_strcpy, +//GO(_cupsStrDate, +//GO(_cupsStrFlush, +//GO(_cupsStrFormatd, +//GO(_cupsStrFree, +//GO(_cups_strlcat, +//GO(_cups_strlcpy, +//GO(_cups_strncasecmp, +//GO(_cupsStrRetain, +//GO(_cupsStrScand, +//GO(_cupsStrStatistics, +GO(cupsTempFd, iFpi) +GO(cupsTempFile, pFpi) +GO(cupsTempFile2, pFpi) +//GO(_cupsThreadCancel, +//GO(_cupsThreadCreate, +//GO(_cupsThreadDetach, +//GO(_cupsThreadWait, +GO(cupsUser, pFv) +GO(cupsUserAgent, pFv) +//GO(_cupsUserDefault, +GO(cupsUTF32ToUTF8, iFpbL_i) +GO(cupsUTF8ToCharset, iFppii) +GO(cupsUTF8ToUTF32, iFbL_pi) +GO(cupsWriteRequestData, iFppL) + +GO(httpAcceptConnection, pFii) +GO(httpAddCredential, iFppL) +GO(httpAddrAny, iFp) +GO(httpAddrClose, iFpi) +//GOM(httpAddrConnect, pFEpp) +//GOM(httpAddrConnect2, pFEppip) +//GOM(httpAddrCopyList, pFEp) +GO(httpAddrEqual, iFpp) +GO(httpAddrFamily, iFp) +//GOM(httpAddrFreeList, vFEp) +//GOM(httpAddrGetList, pFEpip) +GO(httpAddrLength, iFp) +GO(httpAddrListen, iFpi) +GO(httpAddrLocalhost, iFp) +GO(httpAddrLookup, pFppi) +GO(httpAddrPort, iFp) +//GO(_httpAddrSetPort, +GO(httpAddrString, pFppi) +GO(httpAssembleURI, iFupipppip) +//GOM(httpAssembleURIf, iFEupipppipV) +GO(httpAssembleUUID, pFpipipL) +GO(httpBlocking, vFpi) +GO(httpCheck, iFp) +GO(httpClearCookie, vFp) +GO(httpClearFields, vFp) +GO(httpClose, vFp) +GO(httpCompareCredentials, iFpp) +GO(httpConnect, pFpi) +//GOM(httpConnect2, pFEpipiuiip) +GO(httpConnectEncrypt, pFpiu) +GO(httpCopyCredentials, iFpbp_) +//GO(_httpCreateCredentials, +GO(httpCredentialsAreValidForName, iFpp) +GO(httpCredentialsGetExpiration, IFp) +GO(httpCredentialsGetTrust, uFpp) +GO(httpCredentialsString, LFppL) +GO(httpDecode64, pFpp) +GO(httpDecode64_2, pFppp) +//GO(_httpDecodeURI, +GO(httpDelete, iFpp) +//GO(_httpDisconnect, +GO(httpEncode64, pFpp) +GO(httpEncode64_2, pFpipi) +//GO(_httpEncodeURI, +GO(httpEncryption, iFpu) +GO(httpError, iFp) +GO(httpFieldValue, iFp) +GO(httpFlush, vFp) +GO(httpFlushWrite, iFp) +//GO(_httpFreeCredentials, +GO(httpFreeCredentials, vFp) +GO(httpGet, iFpp) +GO(httpGetActivity, IFp) +GO(httpGetAddress, pFp) +GO(httpGetAuthString, pFp) +GO(httpGetBlocking, iFp) +GO(httpGetContentEncoding, pFp) +GO(httpGetCookie, pFp) +GO(httpGetDateString, pFI) +GO(httpGetDateString2, pFIpi) +GO(httpGetDateTime, IFp) +GO(httpGetEncryption, uFp) +GO(httpGetExpect, iFp) +GO(httpGetFd, iFp) +GO(httpGetField, pFpi) +//GOM(httpGetHostByName, pFEp) +GO(httpGetHostname, pFppi) +GO(httpGetKeepAlive, uFp) +GO(httpGetLength, iFp) +GO(httpGetLength2, IFp) +GO(httpGetPending, LFp) +GO(httpGetReady, LFp) +GO(httpGetRemaining, LFp) +GO(httpGets, pFpip) +GO(httpGetState, iFp) +GO(httpGetStatus, iFp) +GO(httpGetSubField, pFpipp) +GO(httpGetSubField2, pFpippi) +GO(httpGetVersion, uFp) +GO(httpHead, iFpp) +GO(httpInitialize, vFv) +GO(httpIsChunked, iFp) +GO(httpIsEncrypted, iFp) +GO(httpLoadCredentials, iFpbp_p) +GO(httpMD5, pFpppp) +GO(httpMD5Final, pFpppp) +GO(httpMD5String, pFpp) +GO(httpOptions, iFpp) +GO(httpPeek, lFppL) +GO(httpPost, iFpp) +//GOM(httpPrintf, iFEppV) +GO(httpPut, iFpp) +GO(httpRead, iFppi) +GO(httpRead2, lFppL) +GO(httpReadRequest, iFppL) +GO(httpReconnect, iFp) +GO(httpReconnect2, iFpip) +GO(httpResolveHostname, pFppL) +//GO(_httpResolveURI, +GO(httpSaveCredentials, iFppp) +GO(httpSeparate, vFpppppp) +GO(httpSeparate2, vFppipipippi) +GO(httpSeparateURI, iFuppipipippi) +GO(httpSetAuthString, vFppp) +GO(httpSetCookie, vFpp) +GO(httpSetCredentials, iFpp) +GO(httpSetDefaultField, vFpip) +//GO(_httpSetDigestAuthString, +GO(httpSetExpect, vFpi) +GO(httpSetField, vFpip) +GO(httpSetKeepAlive, vFpu) +GO(httpSetLength, vFpL) +//GOM(httpSetTimeout, vFEpdpp) +GO(httpShutdown, vFp) +GO(httpStateString, pFi) +//GO(_httpStatus, +GO(httpStatus, pFi) +//GO(_httpTLSInitialize, +//GO(_httpTLSPending, +//GO(_httpTLSRead, +//GO(_httpTLSSetCredentials, +//GO(_httpTLSSetOptions, +//GO(_httpTLSStart, +//GO(_httpTLSStop, +//GO(_httpTLSWrite, +GO(httpTrace, iFpp) +//GO(_httpUpdate, +GO(httpUpdate, iFp) +GO(httpURIStatusString, pFi) +//GO(_httpWait, +GO(httpWait, iFpi) +GO(httpWrite, iFppi) +GO(httpWrite2, lFppL) +GO(httpWriteResponse, iFpi) + +GO(ippAddBoolean, pFpipc) +GO(ippAddBooleans, pFpipip) +GO(ippAddCollection, pFpipp) +GO(ippAddCollections, pFpipibp_) +GO(ippAddDate, pFpipp) +GO(ippAddInteger, pFpiipi) +GO(ippAddIntegers, pFpiipip) +GO(ippAddOctetString, pFpippi) +GO(ippAddOutOfBand, pFpiip) +GO(ippAddRange, pFpipii) +GO(ippAddRanges, pFpipipp) +GO(ippAddResolution, pFpipuii) +GO(ippAddResolutions, pFpipiupp) +GO(ippAddSeparator, pFp) +GO(ippAddString, pFpiippp) +//GOM(ippAddStringf, pFEpiipppV) +//GOM(ippAddStringfv, pFEpiipppp) +GO(ippAddStrings, pFpiipipbp_) +GO(ippAttributeString, LFppL) +GO(ippContainsInteger, iFpi) +GO(ippContainsString, iFpp) +GO(ippCopyAttribute, pFppi) +//GOM(ippCopyAttributes, iFEppipp) +GO(ippCreateRequestedArray, pFp) +GO(ippDateToTime, IFp) +GO(ippDelete, vFp) +GO(ippDeleteAttribute, vFpp) +GO(ippDeleteValues, iFpbp_ii) +GO(ippEnumString, pFpi) +GO(ippEnumValue, iFpp) +GO(ippErrorString, pFi) +GO(ippErrorValue, iFp) +GO(ippFindAttribute, pFppi) +GO(ippFindNextAttribute, pFppi) +//GO(_ippFindOption, +GO(ippFirstAttribute, pFp) +GO(ippGetBoolean, iFpi) +GO(ippGetCollection, pFpi) +GO(ippGetCount, iFp) +GO(ippGetDate, pFpi) +GO(ippGetGroupTag, iFp) +GO(ippGetInteger, iFpi) +GO(ippGetName, pFp) +GO(ippGetOctetString, pFpip) +GO(ippGetOperation, iFp) +GO(ippGetRange, iFpip) +GO(ippGetRequestId, iFp) +GO(ippGetResolution, iFpipp) +GO(ippGetState, iFp) +GO(ippGetStatusCode, iFp) +GO(ippGetString, pFpibp_) +GO(ippGetValueTag, iFp) +GO(ippGetVersion, iFpp) +GO(ippLength, LFp) +GO(ippNew, pFv) +GO(ippNewRequest, pFi) +GO(ippNewResponse, pFp) +GO(ippNextAttribute, pFp) +GO(ippOpString, pFi) +GO(ippOpValue, iFp) +GO(ippPort, iFv) +GO(ippRead, iFpp) +GO(ippReadFile, iFip) +//GOM(ippReadIO, iFEppipp) +GO(ippSetBoolean, iFpbp_ii) +GO(ippSetCollection, iFpbp_ip) +GO(ippSetDate, iFpbp_ip) +GO(ippSetGroupTag, iFpbp_i) +GO(ippSetInteger, iFpbp_ii) +GO(ippSetName, iFpbp_p) +GO(ippSetOctetString, iFpbp_ipi) +GO(ippSetOperation, iFpi) +GO(ippSetPort, vFi) +GO(ippSetRange, iFpbp_iii) +GO(ippSetRequestId, iFpi) +GO(ippSetResolution, iFpbp_iuii) +GO(ippSetState, iFpi) +GO(ippSetStatusCode, iFpi) +GO(ippSetString, iFpbp_ip) +//GOM(ippSetStringf, iFEpbp_ipV) +//GOM(ippSetStringfv, iFEpbp_ipp) +GO(ippSetValueTag, iFpbp_i) +GO(ippSetVersion, iFpii) +GO(ippStateString, pFi) +GO(ippTagString, pFi) +GO(ippTagValue, iFp) +GO(ippTimeToDate, pFI) +GO(ippValidateAttribute, iFp) +GO(ippValidateAttributes, iFp) +GO(ippWrite, iFpp) +GO(ippWriteFile, iFip) +//GOM(ippWriteIO, iFEppipp) + +//GO(_ppdCacheCreateWithFile, +//GO(_ppdCacheCreateWithPPD, +//GO(_ppdCacheDestroy, +//GO(_ppdCacheGetBin, +//GO(_ppdCacheGetFinishingOptions, +//GO(_ppdCacheGetFinishingValues, +//GO(_ppdCacheGetInputSlot, +//GO(_ppdCacheGetMediaType, +//GO(_ppdCacheGetOutputBin, +//GO(_ppdCacheGetPageSize, +//GO(_ppdCacheGetSize, +//GO(_ppdCacheGetSource, +//GO(_ppdCacheGetType, +//GO(_ppdCacheWriteFile, +//GOM(ppdClose, vFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_) +//GOM(ppdCollect, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_ubp_) +//GOM(ppdCollect2, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_ufbp_) +//GOM(ppdConflicts, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_) +//GO(_ppdCreateFromIPP, +//GOM(ppdEmit, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_Su) +//GOM(ppdEmitAfterOrder, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_Suif) +//GOM(ppdEmitFd, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_iu) +//GOM(ppdEmitJCL, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_Sipp) +//GOM(ppdEmitJCLEnd, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_S) +//GOM(ppdEmitString, pFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_uf) +GO(ppdErrorString, pFu) +//GOM(ppdFindAttr, pFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_pp) +//GOM(ppdFindChoice, pFEpp) +//GOM(ppdFindCustomOption, pFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_p) +//GOM(ppdFindCustomParam, pFEbcccccccccccccccccccccccccccccccccccccccccpip_p) +//GOM(ppdFindMarkedChoice, pFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_p) +//GOM(ppdFindNextAttr, pFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_pp) +//GOM(ppdFindOption, pFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_p) +//GOM(ppdFirstCustomParam, pFEbcccccccccccccccccccccccccccccccccccccccccpip_) +//GOM(ppdFirstOption, pFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_) +//GO(_ppdFreeLanguages, +//GO(_ppdGetEncoding, +//GO(_ppdGetLanguages, +//GO(_ppdGlobals, +//GO(_ppdHashName, +//GOM(ppdInstallableConflict, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_pp) +//GOM(ppdIsMarked, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_pp) +GO(ppdLastError, uFp) +//GOM(ppdLocalize, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_) +//GOM(ppdLocalizeAttr, pFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_pp) +//GO(_ppdLocalizedAttr, +//GOM(ppdLocalizeIPPReason, pFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_pppL) +//GOM(ppdLocalizeMarkerName, pFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_p) +//GOM(ppdMarkDefaults, vFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_) +//GOM(ppdMarkOption, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_pp) +//GOM(ppdNextCustomParam, pFEbcccccccccccccccccccccccccccccccccccccccccpip_) +//GOM(ppdNextOption, pFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_) +//GO(_ppdNormalizeMakeAndModel, +//GO(_ppdOpen, +//GOM(ppdOpen, pFES) +//GOM(ppdOpen2, pFEp) +//GOM(ppdOpenFd, pFEi) +//GO(_ppdOpenFile, +//GOM(ppdOpenFile, pFEp) +//GOM(ppdPageLength, fFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_p) +//GOM(ppdPageSize, pFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_p) +//GOM(ppdPageSizeLimits, iFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_pp) +//GOM(ppdPageWidth, fFEbiiiiiiiiiipippppppppppppipipffffffffipipipipippiippppppp_p) +//GO(_ppdParseOptions, +GO(ppdSetConformance, vFu) + +GO(pwgFormatSizeName, iFpLppiip) +//GO(pwgInitSize, iFppp) +//GO(_pwgInputSlotForSource, +//GOM(pwgMediaForLegacy, pFEp) +//GOM(pwgMediaForPPD, pFEp) +//GOM(pwgMediaForPWG, pFEp) +//GOM(pwgMediaForSize, pFEii) +//GO(_pwgMediaNearSize, +//GO(_pwgMediaTable, +//GO(_pwgMediaTypeForType, +//GO(_pwgPageSizeForMedia, diff --git a/src/wrapped32/wrappedlibdl.c b/src/wrapped32/wrappedlibdl.c new file mode 100755 index 0000000..6556f9a --- /dev/null +++ b/src/wrapped32/wrappedlibdl.c @@ -0,0 +1,165 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "emu/x64emu_private.h" +#include "library.h" +#include "librarian.h" +#include "box32context.h" +#include "elfloader.h" +#include "elfs/elfloader_private.h" +#include "x64emu.h" + + +#define LIBNAME libdl +#ifdef ANDROID + static const char* libdlName = "libdl.so"; +#else + static const char* libdlName = "libdl.so.2"; +#endif + +void* my_dlopen(x64emu_t* emu, void *filename, int flag) EXPORT; +void* my_dlmopen(x64emu_t* emu, void* mlid, void *filename, int flag) EXPORT; +char* my_dlerror(x64emu_t* emu) EXPORT; +void* my_dlsym(x64emu_t* emu, void *handle, void *symbol) EXPORT; +int my_dlclose(x64emu_t* emu, void *handle) EXPORT; +int my32_dladdr(x64emu_t* emu, void *addr, void *info) EXPORT; +int my32_dladdr1(x64emu_t* emu, void *addr, void *info, void** extra_info, int flags) EXPORT; +void* my_dlvsym(x64emu_t* emu, void *handle, void *symbol, const char *vername) EXPORT; +int my32_dlinfo(x64emu_t* emu, void* handle, int request, void* info) EXPORT; + +#ifndef RTLD_DL_SYMENT +#define RTLD_DL_SYMENT 1 +#endif +#ifndef RTLD_DL_LINKMAP +#define RTLD_DL_LINKMAP 2 +#endif + +void dl_clear_error(); +#define CLEARERR dl_clear_error() +void dl_set_error(const char*); +char* dl_last_error(); +library_t* dl_get_library(void* handle); + +typedef struct my_dl_info_32_s +{ + ptr_t dli_fname; // const char* + ptr_t dli_fbase; // void* + ptr_t dli_sname; // const char* + ptr_t dli_saddr; // void* +} my_dl_info_32_t; + +int my32_dladdr1(x64emu_t* emu, void *addr, void *i, void** extra_info, int flags) +{ + //int dladdr(void *addr, my_dl_info_32_t *info); + CLEARERR; + my_dl_info_32_t *info = (my_dl_info_32_t*)i; + printf_log(LOG_DEBUG, "Warning: partially unimplement call to dladdr/dladdr1(%p, %p, %p, %d)\n", addr, info, extra_info, flags); + + //emu->quit = 1; + library_t* lib = NULL; + info->dli_saddr = 0; + info->dli_fname = 0; + void* start = NULL; + const char* fname = NULL; + void* base = NULL; + const char* sname = FindSymbolName(my_context->maplib, addr, &start, NULL, &fname, &base, &lib); + info->dli_saddr = to_ptrv(start); + info->dli_fname = to_ptrv((void*)fname); + info->dli_fbase = to_ptrv(base); + info->dli_sname = to_ptrv((void*)sname); + printf_log(LOG_DEBUG, " dladdr return saddr=%p, fname=\"%s\", sname=\"%s\"\n", start, sname?sname:"", fname?fname:""); + if(flags==RTLD_DL_SYMENT) { + printf_log(LOG_INFO, "Warning, unimplement call to dladdr1 with RTLD_DL_SYMENT flags\n"); + } else if (flags==RTLD_DL_LINKMAP) { + printf_log(LOG_INFO, "Warning, unimplemented call to dladdr1 with RTLD_DL_LINKMAP flags\n"); + *(ptr_t*)extra_info = to_ptrv(getLinkMapLib32(lib)); + } + return (info->dli_sname)?1:0; // success is non-null here... +} +int my32_dladdr(x64emu_t* emu, void *addr, void *i) +{ + return my32_dladdr1(emu, addr, i, NULL, 0); +} + +int my32_dlinfo(x64emu_t* emu, void* handle, int request, void* info) +{ + (void)emu; + printf_dlsym(LOG_DEBUG, "Call to dlinfo(%p, %d, %p)\n", handle, request, info); + CLEARERR; + library_t *lib = dl_get_library(handle); + if(lib==(library_t*)-1LL) { + printf_dlsym(LOG_DEBUG, "dlinfo: %s\n", dl_last_error()); + return -1; + } + //elfheader_t *h = (GetElfIndex(lib)>-1)?my_context->elfs[GetElfIndex(lib)]:NULL; + switch(request) { + case 2: // RTLD_DI_LINKMAP + { + *(linkmap32_t**)info = getLinkMapLib32(lib); + } + return 0; + default: + printf_log(LOG_NONE, "Warning, unsupported call to dlinfo(%p, %d, %p)\n", handle, request, info); + { + char tmp[129] = {0}; + snprintf(tmp, 129, "unsupported call to dlinfo request:%d\n", request); + dl_set_error(tmp); + } + } + return -1; +} + +typedef struct my_dl_find_object_s { + uint64_t dlfo_flags; + ptr_t dlfo_map_start; + ptr_t dlfo_map_end; + ptr_t dlf_link_map; //struct link_map * + ptr_t dlfo_eh_frame; + // other stuff... +} my_dl_find_object_t; + +EXPORT int my32__dl_find_object(x64emu_t* emu, void* addr, my_dl_find_object_t* result) +{ + //printf_log(LOG_INFO, "Unimplemented _dl_find_object called\n"); + uintptr_t start=0, sz=0; + elfheader_t* h = FindElfAddress(my_context, (uintptr_t)addr); + if(h) { + // find an actual elf + const char* name = FindNearestSymbolName(h, addr, &start, &sz); + result->dlfo_map_start = start; + result->dlfo_map_end = start+sz-1; + result->dlfo_eh_frame = h->ehframehdr+h->delta; + result->dlfo_flags = 0; // unused it seems + result->dlf_link_map = to_ptrv(getLinkMapElf32(h)); + return 0; + } + return -1; +} + +//#define CUSTOM_INIT\ +// if(!box32_isglibc234) setNeededLibs(lib, 1, "libc.so.6"); + + +void closeAllDLOpened(); + +#define PRE_INIT\ + if(1) \ + lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \ + else + +#define CUSTOM_FINI \ + closeAllDLOpened(); + +// define all standard library functions +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibdl_private.h b/src/wrapped32/wrappedlibdl_private.h new file mode 100755 index 0000000..168895d --- /dev/null +++ b/src/wrapped32/wrappedlibdl_private.h @@ -0,0 +1,15 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA) && defined(GOS)) +#error Meh... +#endif + +GOM(dladdr, iEEpp) +GOM(dladdr1, iEEpppi) +GO2(dlclose, iEEp, my_dlclose) +GO2(dlerror, pEEv, my_dlerror) +//DATAB(_dlfcn_hook, 4) +GOM(dlinfo, iEEpip) +GO2(dlmopen, pEEppi, my_dlmopen) +GO2(dlopen, pEEpi, my_dlopen) +GO2(dlsym, pEEpp, my_dlsym) +GO2(dlvsym, pEEppp, my_dlvsym) // Weak +GOM(_dl_find_object, iEEpp) diff --git a/src/wrapped32/wrappedlibdrm.c b/src/wrapped32/wrappedlibdrm.c new file mode 100644 index 0000000..570d6d0 --- /dev/null +++ b/src/wrapped32/wrappedlibdrm.c @@ -0,0 +1,424 @@ +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" + +static const char* libdrmName = "libdrm.so.2"; +#define LIBNAME libdrm + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedlibdrmtypes32.h" + +#include "wrappercallback32.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// vblank_handler +#define GO(A) \ +static uintptr_t my32_vblank_handler_fct_##A = 0; \ +static void my32_vblank_handler_##A(int a, uint32_t b, uint32_t c, uint32_t d, void* e) \ +{ \ + RunFunctionFmt(my32_vblank_handler_fct_##A, "iuuup", a, b, c, d, e); \ +} +SUPER() +#undef GO +static void* find_vblank_handler_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_vblank_handler_fct_##A == (uintptr_t)fct) return my32_vblank_handler_##A; + SUPER() + #undef GO + #define GO(A) if(my32_vblank_handler_fct_##A == 0) {my32_vblank_handler_fct_##A = (uintptr_t)fct; return my32_vblank_handler_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libdrm 32bits vblank_handler callback\n"); + return NULL; +} + +// page_flip_handler +#define GO(A) \ +static uintptr_t my32_page_flip_handler_fct_##A = 0; \ +static void my32_page_flip_handler_##A(int a, uint32_t b, uint32_t c, uint32_t d, void* e) \ +{ \ + RunFunctionFmt(my32_page_flip_handler_fct_##A, "iuuup", a, b, c, d, e); \ +} +SUPER() +#undef GO +static void* find_page_flip_handler_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_page_flip_handler_fct_##A == (uintptr_t)fct) return my32_page_flip_handler_##A; + SUPER() + #undef GO + #define GO(A) if(my32_page_flip_handler_fct_##A == 0) {my32_page_flip_handler_fct_##A = (uintptr_t)fct; return my32_page_flip_handler_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libdrm 32bits page_flip_handler callback\n"); + return NULL; +} + +// page_flip_handler2 +#define GO(A) \ +static uintptr_t my32_page_flip_handler2_fct_##A = 0; \ +static void my32_page_flip_handler2_##A(int a, uint32_t b, uint32_t c, uint32_t d, uint32_t e, void* f) \ +{ \ + RunFunctionFmt(my32_page_flip_handler2_fct_##A, "iuuuup", a, b, c, d, e, f); \ +} +SUPER() +#undef GO +static void* find_page_flip_handler2_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_page_flip_handler2_fct_##A == (uintptr_t)fct) return my32_page_flip_handler2_##A; + SUPER() + #undef GO + #define GO(A) if(my32_page_flip_handler2_fct_##A == 0) {my32_page_flip_handler2_fct_##A = (uintptr_t)fct; return my32_page_flip_handler2_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libdrm 32bits page_flip_handler2 callback\n"); + return NULL; +} + +// sequence_handler +#define GO(A) \ +static uintptr_t my32_sequence_handler_fct_##A = 0; \ +static void my32_sequence_handler_##A(int a, uint64_t b, uint64_t c, uint64_t d) \ +{ \ + RunFunctionFmt(my32_sequence_handler_fct_##A, "iUUU", a, b, c, d); \ +} +SUPER() +#undef GO +static void* find_sequence_handler_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_sequence_handler_fct_##A == (uintptr_t)fct) return my32_sequence_handler_##A; + SUPER() + #undef GO + #define GO(A) if(my32_sequence_handler_fct_##A == 0) {my32_sequence_handler_fct_##A = (uintptr_t)fct; return my32_sequence_handler_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libdrm 32bits sequence_handler callback\n"); + return NULL; +} +#undef SUPER + +//EXPORT void my32_drmMsg(x64emu_t* emu, void* fmt, void* b) { +// myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 1); +// PREPARE_VALIST; +// char* buf = NULL; +// int dummy = vasprintf(&buf, (const char*)fmt, VARARGS); +// (void)dummy; +// my->drmMsg(buf); +// free(buf); +//} + +typedef struct my_drmVersion_s { + int version_major; + int version_minor; + int version_patchlevel; + int name_len; + char* name; + int date_len; + char* date; + int desc_len; + char* desc; +} my_drmVersion_t; +typedef struct my_drmVersion_32_s { + int version_major; + int version_minor; + int version_patchlevel; + int name_len; + ptr_t name; //char* + int date_len; + ptr_t date; //char* + int desc_len; + ptr_t desc; //char* +} my_drmVersion_32_t; +void* inplace_drmVersion_shrink(void* a) +{ + if(a) { + my_drmVersion_t* src = a; + my_drmVersion_32_t* dst = a; + dst->version_major = src->version_major; + dst->version_minor = src->version_minor; + dst->version_patchlevel = src->version_patchlevel; + dst->name_len = src->name_len; + dst->name = to_ptrv(src->name); + dst->date_len = src->date_len; + dst->date = to_ptrv(src->date); + dst->desc_len = src->desc_len; + dst->desc = to_ptrv(src->desc); + } + return a; +} +void* inplace_drmVersion_enlarge(void* a) +{ + if(a) { + my_drmVersion_32_t* src = a; + my_drmVersion_t* dst = a; + dst->desc = from_ptrv(src->desc); + dst->desc_len = src->desc_len; + dst->date = from_ptrv(src->date); + dst->date_len = src->date_len; + dst->name = from_ptrv(src->name); + dst->name_len = src->name_len; + dst->version_patchlevel = src->version_patchlevel; + dst->version_minor = src->version_minor; + dst->version_major = src->version_major; + } + return a; +} + +typedef struct my_drmModeConnector_s { + uint32_t connector_id; + uint32_t encoder_id; + uint32_t connector_type; + uint32_t connector_type_id; + uint32_t connection; + uint32_t mmWidth, mmHeight; + uint32_t subpixel; + int count_modes; + void* modes; //drmModeModeInfoPtr doesn't need conversion + int count_props; + uint32_t *props; + uint64_t *prop_values; + int count_encoders; + uint32_t *encoders; +} my_drmModeConnector_t; +typedef struct my_drmModeConnector_32_s { + uint32_t connector_id; + uint32_t encoder_id; + uint32_t connector_type; + uint32_t connector_type_id; + uint32_t connection; + uint32_t mmWidth, mmHeight; + uint32_t subpixel; + int count_modes; + ptr_t modes; //drmModeModeInfoPtr doesn't need conversion + int count_props; + ptr_t props; //uint32_t * + ptr_t prop_values; //uint64_t * + int count_encoders; + ptr_t encoders; //uint32_t * +} my_drmModeConnector_32_t; + +void* inplace_drmModeConnector_shrink(void* a) +{ + if(a) { + my_drmModeConnector_t* src = a; + my_drmModeConnector_32_t* dst = a; + dst->connector_id = src->connector_id; + dst->encoder_id = src->encoder_id; + dst->connector_type = src->connector_type; + dst->connector_type_id = src->connector_type_id; + dst->connection = src->connection; + dst->mmWidth = src->mmWidth; + dst->mmHeight = src->mmHeight; + dst->subpixel = src->subpixel; + dst->count_modes = src->count_modes; + dst->modes = to_ptrv(src->modes); + dst->count_props = src->count_props; + dst->props = to_ptrv(src->props); + dst->prop_values = to_ptrv(src->prop_values); + dst->count_encoders = src->count_encoders; + dst->encoders = to_ptrv(src->encoders); + } + return a; +} +void* inplace_drmModeConnector_enlarge(void* a) +{ + if(a) { + my_drmModeConnector_t* dst = a; + my_drmModeConnector_32_t* src = a; + dst->encoders = from_ptrv(src->encoders); + dst->count_encoders = src->count_encoders; + dst->prop_values = from_ptrv(src->prop_values); + dst->props = from_ptrv(src->props); + dst->count_props = src->count_props; + dst->modes = from_ptrv(src->modes); + dst->count_modes = src->count_modes; + dst->subpixel = src->subpixel; + dst->mmHeight = src->mmHeight; + dst->mmWidth = src->mmWidth; + dst->connection = src->connection; + dst->connector_type_id = src->connector_type_id; + dst->connector_type = src->connector_type; + dst->encoder_id = src->encoder_id; + dst->connector_id = src->connector_id; + } + return a; +} + +typedef struct my_drmModeRes_s { + int count_fbs; + uint32_t *fbs; + int count_crtcs; + uint32_t *crtcs; + int count_connectors; + uint32_t *connectors; + int count_encoders; + uint32_t *encoders; + uint32_t min_width, max_width; + uint32_t min_height, max_height; +} my_drmModeRes_t; +typedef struct my_drmModeRes_32_s { + int count_fbs; + ptr_t fbs; //uint32_t * + int count_crtcs; + ptr_t crtcs; //uint32_t * + int count_connectors; + ptr_t connectors; //uint32_t * + int count_encoders; + ptr_t encoders; //uint32_t * + uint32_t min_width, max_width; + uint32_t min_height, max_height; +} my_drmModeRes_32_t; + +void* inplace_drmModeRes_shrink(void* a) +{ + if(a) { + my_drmModeRes_t* src = a; + my_drmModeRes_32_t* dst = a; + dst->count_fbs = src->count_fbs; + dst->fbs = to_ptrv(src->fbs); + dst->count_crtcs = src->count_crtcs; + dst->crtcs = to_ptrv(src->crtcs); + dst->count_connectors = src->count_connectors; + dst->connectors = to_ptrv(src->connectors); + dst->count_encoders = src->count_encoders; + dst->encoders = to_ptrv(src->encoders); + dst->min_width = src->min_width; + dst->max_width = src->max_width; + dst->min_height = src->min_height; + dst->max_height = src->max_height; + } + return a; +} +void* inplace_drmModeRes_enlarge(void* a) +{ + if(a) { + my_drmModeRes_t* dst = a; + my_drmModeRes_32_t* src = a; + dst->max_height = src->max_height; + dst->min_height = src->min_height; + dst->max_width = src->max_width; + dst->min_width = src->min_width; + dst->encoders = from_ptrv(src->encoders); + dst->count_encoders = src->count_encoders; + dst->connectors = from_ptrv(src->connectors); + dst->count_connectors = src->count_connectors; + dst->crtcs = from_ptrv(src->crtcs); + dst->count_crtcs = src->count_crtcs; + dst->fbs = from_ptrv(src->fbs); + dst->count_fbs = src->count_fbs; + } + return a; +} + +typedef struct my_drmEventContext_s +{ + int version; + void (*vblank_handler)(int fd, + unsigned int sequence, + unsigned int tv_sec, + unsigned int tv_usec, + void *user_data); + void (*page_flip_handler)(int fd, + unsigned int sequence, + unsigned int tv_sec, + unsigned int tv_usec, + void *user_data); + void (*page_flip_handler2)(int fd, + unsigned int sequence, + unsigned int tv_sec, + unsigned int tv_usec, + unsigned int crtc_id, + void *user_data); + void (*sequence_handler)(int fd, + uint64_t sequence, + uint64_t ns, + uint64_t user_data); +} my_drmEventContext_t; +typedef struct my_drmEventContext_32_s +{ + int version; + ptr_t vblank_handler; + ptr_t page_flip_handler; + ptr_t page_flip_handler2; + ptr_t sequence_handler; +} my_drmEventContext_32_t; + +EXPORT void* my32_drmGetVersion(x64emu_t* emu, int fd) +{ + return inplace_drmVersion_shrink(my->drmGetVersion(fd)); +} + +EXPORT void my32_drmFreeVersion(x64emu_t* emu, void* v) +{ + my->drmFreeVersion(inplace_drmVersion_enlarge(v)); +} + +EXPORT void* my32_drmModeGetConnector(x64emu_t* emu, int fd, uint32_t id) +{ + return inplace_drmModeConnector_shrink(my->drmModeGetConnector(fd, id)); +} + +EXPORT void* my32_drmModeGetConnectorCurrent(x64emu_t* emu, int fd, uint32_t id) +{ + return inplace_drmModeConnector_shrink(my->drmModeGetConnectorCurrent(fd, id)); +} + +EXPORT void my32_drmModeFreeConnector(void* v) +{ + my->drmModeFreeConnector(inplace_drmModeConnector_enlarge(v)); +} + +EXPORT void my32_drmModeFreeResources(void* v) +{ + my->drmModeFreeResources(inplace_drmModeRes_enlarge(v)); +} + +EXPORT void* my32_drmModeGetResources(int fd) +{ + return inplace_drmModeRes_shrink(my->drmModeGetResources(fd)); +} + +EXPORT int my32_drmHandleEvent(x64emu_t* emu, int fd, my_drmEventContext_32_t* event) +{ + my_drmEventContext_t ctx = {0}; + if(event) { + ctx.version = event->version; + ctx.vblank_handler = find_vblank_handler_Fct(from_ptrv(event->vblank_handler)); + ctx.page_flip_handler = find_page_flip_handler_Fct(from_ptrv(event->page_flip_handler)); + ctx.page_flip_handler2 = find_page_flip_handler2_Fct(from_ptrv(event->page_flip_handler2)); + ctx.sequence_handler = find_sequence_handler_Fct(from_ptrv(event->sequence_handler)); + } + return my->drmHandleEvent(fd, event?(&ctx):NULL); +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibdrm_private.h b/src/wrapped32/wrappedlibdrm_private.h new file mode 100644 index 0000000..17caa00 --- /dev/null +++ b/src/wrapped32/wrappedlibdrm_private.h @@ -0,0 +1,199 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(drmAddBufs, iFiiiui) +GO(drmAddContextPrivateMapping, iFiuu) +GO(drmAddContextTag, iFiup) +GO(drmAddMap, iFiuuuup) +GO(drmAgpAcquire, iFi) +//GO(drmAgpAlloc, iFiLLbL_p) +GO(drmAgpBase, LFi) +GO(drmAgpBind, iFiuL) +GO(drmAgpDeviceId, uFi) +GO(drmAgpEnable, iFiL) +GO(drmAgpFree, iFiu) +GO(drmAgpGetMode, LFi) +GO(drmAgpMemoryAvail, LFi) +GO(drmAgpMemoryUsed, LFi) +GO(drmAgpRelease, iFi) +GO(drmAgpSize, LFi) +GO(drmAgpUnbind, iFiu) +GO(drmAgpVendorId, uFi) +GO(drmAgpVersionMajor, iFi) +GO(drmAgpVersionMinor, iFi) +GO(drmAuthMagic, iFiu) +GO(drmAvailable, iFv) +GO(drmCheckModesettingSupported, iFp) +GO(drmClose, iFi) +GO(drmCloseOnce, vFi) +GO(drmCommandNone, iFiL) +GO(drmCommandRead, iFiLpL) +GO(drmCommandWrite, iFiLpL) +GO(drmCommandWriteRead, iFiLpL) +GO(drmCreateContext, iFip) +GO(drmCreateDrawable, iFip) +GO(drmCrtcGetSequence, iFiupp) +GO(drmCrtcQueueSequence, iFiuuUpU) +GO(drmCtlInstHandler, iFii) +GO(drmCtlUninstHandler, iFi) +GO(drmDelContextTag, iFiu) +GO(drmDestroyContext, iFiu) +GO(drmDestroyDrawable, iFiu) +//GO(drmDevicesEqual, +//GO(drmDMA, iFibuippuiippi_) +GO(drmDropMaster, iFi) +GO(drmError, iFip) +GO(drmFinish, iFiiu) +GO(drmFree, vFp) +GO(drmFreeBufs, iFiip) +GO(drmFreeBusid, vFp) +//GOM(drmFreeDevice, vFEbp_) +//GOM(drmFreeDevices, vFEbp_i) +GO(drmFreeReservedContextList, vFp) +GOM(drmFreeVersion, vFEp) +//GOM(drmGetBufInfo, pFEi) +GO(drmGetBusid, pFi) +GO(drmGetCap, iFiUp) +//GO(drmGetClient, iFiipppbL_bL_) +GO(drmGetContextFlags, iFiup) +GO(drmGetContextPrivateMapping, iFiup) +GO(drmGetContextTag, pFiu) +//GOM(drmGetDevice, iFEibp_) +//GOM(drmGetDevice2, iFEiubp_) +GO(drmGetDeviceNameFromFd, pFi) +GO(drmGetDeviceNameFromFd2, pFi) +//GOM(drmGetDevices, iFEbp_i) +//GOM(drmGetDevices2, iFEubp_i) +//GOM(drmGetEntry, pFEi) +GO(drmGetHashTable, pFv) +GO(drmGetInterruptFromBusID, iFiiii) +//GOM(drmGetLibVersion, pFEi) +GO(drmGetLock, iFiuu) +GO(drmGetMagic, iFip) +GO(drmGetMap, iFiipppppp) +GO(drmGetNodeTypeFromFd, iFi) +GO(drmGetPrimaryDeviceNameFromFd, pFi) +GO(drmGetRenderDeviceNameFromFd, pFi) +GO(drmGetReservedContextList, pFip) +//GO(drmGetStats, +GOM(drmGetVersion, pFEi) +GOM(drmHandleEvent, iFEip) +GO(drmHashCreate, pFv) +GO(drmHashDelete, iFpL) +GO(drmHashDestroy, iFp) +//GO(drmHashFirst, iFpbL_bp_) +GO(drmHashInsert, iFpLp) +//GO(drmHashLookup, iFpLbp_) +//GO(drmHashNext, iFpbL_bp_) +GO(drmIoctl, iFiLp) +GO(drmIsMaster, iFi) +GO(drmMalloc, pFi) +//GO(drmMap, iFiuubp_) +//GOM(drmMapBufs, pFEi) +GO(drmMarkBufs, iFidd) +GO(drmModeAddFB, iFiuuCCuup) +GO(drmModeAddFB2, iFiuuuppppu) +GO(drmModeAddFB2WithModifiers, iFiuuupppppu) +GO(drmModeAtomicAddProperty, iFpuuU) +GO(drmModeAtomicAlloc, pFv) +GO(drmModeAtomicCommit, iFipup) +GO(drmModeAtomicDuplicate, pFp) +GO(drmModeAtomicFree, vFp) +GO(drmModeAtomicGetCursor, iFp) +GO(drmModeAtomicMerge, iFpp) +GO(drmModeAtomicSetCursor, vFpi) +GO(drmModeAttachMode, iFiup) +GO(drmModeConnectorSetProperty, iFiuuU) +GO(drmModeCreateLease, iFipiip) +GO(drmModeCreatePropertyBlob, iFipLp) +GO(drmModeCrtcGetGamma, iFiuuppp) +GO(drmModeCrtcSetGamma, iFiuuppp) +GO(drmModeDestroyPropertyBlob, iFiu) +GO(drmModeDetachMode, iFiup) +GO(drmModeDirtyFB, iFiupu) +GOM(drmModeFreeConnector, vFEp) +GO(drmModeFreeCrtc, vFp) +GO(drmModeFreeEncoder, vFp) +GO(drmModeFreeFB, vFp) +GO(drmModeFreeModeInfo, vFp) +//GO(drmModeFreeObjectProperties, vFbupp_) +//GO(drmModeFreePlane, vFbupuuuuuuuuu_) +//GO(drmModeFreePlaneResources, vFbup_) +//GO(drmModeFreeProperty, vFbuuccccccccccccccccccccccccccccccccipipip_) +//GO(drmModeFreePropertyBlob, vFbuup_) +GOM(drmModeFreeResources, vFEp) +GOM(drmModeGetConnector, pFEiu) +GOM(drmModeGetConnectorCurrent, pFEiu) +GO(drmModeGetCrtc, pFiu) +GO(drmModeGetEncoder, pFiu) +GO(drmModeGetFB, pFiu) +//GO(drmModeGetLease, +//GOM(drmModeGetPlane, pFEiu) +//GOM(drmModeGetPlaneResources, pFEi) +//GOM(drmModeGetProperty, pFEiu) +//GOM(drmModeGetPropertyBlob, pFEiu) +GOM(drmModeGetResources, pFEi) +//GO(drmModeListLessees, +GO(drmModeMoveCursor, iFiuii) +//GOM(drmModeObjectGetProperties, pFEiuu) +GO(drmModeObjectSetProperty, iFiuuuU) +GO(drmModePageFlip, iFiuuup) +GO(drmModePageFlipTarget, iFiuuupu) +GO(drmModeRevokeLease, iFiu) +GO(drmModeRmFB, iFiu) +GO(drmModeSetCrtc, iFiuuuupip) +GO(drmModeSetCursor, iFiuuuu) +GO(drmModeSetCursor2, iFiuuuuii) +GO(drmModeSetPlane, iFiuuuuiiuuuuuu) +//GOM(drmMsg, vFEpV) +GO(drmOpen, iFpp) +GO(drmOpenControl, iFi) +GO(drmOpenOnce, iFppp) +GO(drmOpenOnceWithType, iFppi) +GO(drmOpenRender, iFi) +GO(drmOpenWithType, iFppi) +GO(drmPrimeFDToHandle, iFiip) +GO(drmPrimeHandleToFD, iFiuup) +GO(drmRandom, LFp) +GO(drmRandomCreate, pFL) +GO(drmRandomDestroy, iFp) +GO(drmRandomDouble, dFp) +GO(drmRmMap, iFiu) +GO(drmScatterGatherAlloc, iFiLp) +GO(drmScatterGatherFree, iFiu) +GO(drmSetBusid, iFip) +GO(drmSetClientCap, iFiUU) +GO(drmSetContextFlags, iFiuu) +GO(drmSetInterfaceVersion, iFip) +GO(drmSetMaster, iFi) +//GOM(drmSetServerInfo, vFEbppp_) +GO(drmSLCreate, pFv) +GO(drmSLDelete, iFpL) +GO(drmSLDestroy, iFp) +GO(drmSLDump, vFp) +//GO(drmSLFirst, iFpbL_bp_) +GO(drmSLInsert, iFpLp) +//GO(drmSLLookup, iFpLbp_) +//GO(drmSLLookupNeighbors, iFpLbL_bp_bL_bp_) +//GO(drmSLNext, iFpbL_bp_) +GO(drmSwitchToContext, iFiu) +GO(drmSyncobjCreate, iFiup) +GO(drmSyncobjDestroy, iFiu) +GO(drmSyncobjExportSyncFile, iFiup) +GO(drmSyncobjFDToHandle, iFiip) +GO(drmSyncobjHandleToFD, iFiup) +GO(drmSyncobjImportSyncFile, iFiui) +GO(drmSyncobjQuery, iFippu) +GO(drmSyncobjQuery2, iFippuu) +GO(drmSyncobjReset, iFipu) +GO(drmSyncobjSignal, iFipu) +GO(drmSyncobjTimelineSignal, iFippu) +GO(drmSyncobjTimelineWait, iFippuIup) +GO(drmSyncobjTransfer, iFiuUuUu) +GO(drmSyncobjWait, iFipuIup) +GO(drmUnlock, iFiu) +GO(drmUnmap, iFpu) +//GOM(drmUnmapBufs, iFEbip_) +GO(drmUpdateDrawableInfo, iFiuuup) +//GO(drmWaitVBlank, diff --git a/src/wrapped32/wrappedlibegl.c b/src/wrapped32/wrappedlibegl.c new file mode 100644 index 0000000..d06bef7 --- /dev/null +++ b/src/wrapped32/wrappedlibegl.c @@ -0,0 +1,34 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "box32context.h" +#include "librarian.h" +#include "callback.h" +#include "gltools.h" + +static const char* libeglName = "libEGL.so.1"; +#define LIBNAME libegl + +#include "generated/wrappedlibegltypes32.h" + +#include "wrappercallback32.h" + +EXPORT void* my32_eglGetProcAddress(x64emu_t* emu, void* name) +{ + khint_t k; + const char* rname = (const char*)name; + return getGLProcAddress32(emu, NULL, (glprocaddress_t)my->eglGetProcAddress, rname); +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibegl_private.h b/src/wrapped32/wrappedlibegl_private.h new file mode 100644 index 0000000..f6344c4 --- /dev/null +++ b/src/wrapped32/wrappedlibegl_private.h @@ -0,0 +1,49 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(eglBindAPI, uFu) +GO(eglBindTexImage, uFppi) +GO(eglChooseConfig, uFppbp_ip) +GO(eglClientWaitSync, iFppiU) +GO(eglCopyBuffers, uFppL) +GO(eglCreateContext, pFpppp) +GO(eglCreateImage, pFppupbl_) +GO(eglCreatePbufferFromClientBuffer, pFpuppp) +GO(eglCreatePbufferSurface, pFppp) +GO(eglCreatePixmapSurface, pFppLp) +GO(eglCreatePlatformPixmapSurface, pFpppbl_) +GO(eglCreatePlatformWindowSurface, pFpppbl_) +GO(eglCreateSync, pFpubl_) +GO(eglCreateWindowSurface, pFppLp) +GO(eglDestroyContext, uFpp) +GO(eglDestroyImage, uFpp) +GO(eglDestroySurface, uFpp) +GO(eglDestroySync, uFpp) +GO(eglGetConfigAttrib, uFppip) +GO(eglGetConfigs, uFpbp_ip) +GO(eglGetCurrentContext, pFv) +GO(eglGetCurrentDisplay, pFv) +GO(eglGetCurrentSurface, pFi) +GO(eglGetDisplay, pFX) +GO(eglGetError, iFv) +GO(eglGetPlatformDisplay, pFuXbl_) +GOM(eglGetProcAddress, pFEp) +GO(eglGetSyncAttrib, uFppibl_) +GO(eglInitialize, uFppp) +GO(eglMakeCurrent, uFpppp) +GO(eglQueryAPI, uFv) +GO(eglQueryContext, uFppip) +GO(eglQueryString, pFpi) +GO(eglQuerySurface, uFppip) +GO(eglReleaseTexImage, uFppi) +GO(eglReleaseThread, uFv) +GO(eglSurfaceAttrib, uFppii) +GO(eglSwapBuffers, uFpp) +GO(eglSwapInterval, uFpi) +GO(eglTerminate, uFp) +GO(eglWaitClient, uFv) +GO(eglWaitGL, uFv) +GO(eglWaitNative, uFi) +GO(eglWaitSync, uFppi) + diff --git a/src/wrapped32/wrappedlibgl.c b/src/wrapped32/wrappedlibgl.c new file mode 100644 index 0000000..979f16c --- /dev/null +++ b/src/wrapped32/wrappedlibgl.c @@ -0,0 +1,600 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "box32context.h" +#include "librarian.h" +#include "callback.h" +#include "gltools.h" +#include "libtools/my_x11_conv.h" + +extern const char* libglName; +#define LIBNAME libgl + +#include "generated/wrappedlibgltypes32.h" + +#include "wrappercallback32.h" + +void* getDisplay(void* d); // define in 32bits wrappedx11.c + +// FIXME: old wrapped* type of file, cannot use generated/wrappedlibgltypes.h +EXPORT void* my32_glXGetProcAddress(x64emu_t* emu, void* name) +{ + pFp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXGetProcAddress; + khint_t k; + const char* rname = (const char*)name; + return getGLProcAddress32(emu, NULL, (void*)fnc, rname); +} +EXPORT void* my32_glXGetProcAddressARB(x64emu_t* emu, void* name) __attribute__((alias("my32_glXGetProcAddress"))); + +typedef int (*iFi_t)(int); +typedef void (*vFpp_t)(void*, void*); +typedef void*(*pFpp_t)(void*, void*); +typedef void (*vFip_t)(int, void*); +typedef void (*vFppp_t)(void*, void*, void*); +typedef void (*vFppi_t)(void*, void*, int); +typedef void*(*pFpip_t)(void*, int, void*); +typedef void (*vFuip_t)(uint32_t, int, void*); +typedef void*(*pFp_t)(void*); +typedef void (*vFuipp_t)(uint32_t, int, void*, void*); +typedef void*(*pFpipp_t)(void*, int, void*, void*); +typedef void*(*pFpppi_t)(void*, void*, void*, int); +typedef void (*vFuipu_t)(uint32_t, int, void*, uint32_t); +typedef void (*vFupupi_t)(uint32_t, void*, uint32_t, void*, int); +typedef void (*vFuippp_t)(uint32_t, int, void*, void*, void*); +typedef void (*vFuuippp_t)(uint32_t, uint32_t, int, void*, void*, void*); +typedef void (*vFupupip_t)(uint32_t, void*, uint32_t, void*, int, void*); +typedef void (*vFppupui_t)(void*, void*, uint32_t, void*, uint32_t, int); +typedef void (*debugProc_t)(int32_t, int32_t, uint32_t, int32_t, int32_t, void*, void*); + +typedef struct gl_wrappers_s { + glprocaddress_t procaddress; + kh_symbolmap_t *glwrappers; // the map of wrapper for glProcs (for GLX or SDL1/2) + kh_symbolmap_t *glmymap; // link to the mysymbolmap of libGL +} gl_wrappers_t; + +KHASH_MAP_INIT_INT64(gl_wrappers, gl_wrappers_t*) + +static kh_gl_wrappers_t *gl_wrappers = NULL; + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// debug_callback ... +#define GO(A) \ +static uintptr_t my_debug_callback_fct_##A = 0; \ +static void my_debug_callback_##A(int32_t a, int32_t b, uint32_t c, int32_t d, int32_t e, const char* f, const void* g) \ +{ \ + RunFunctionFmt(my_debug_callback_fct_##A, "iiuiipp", a, b, c, d, e, f, g); \ +} +SUPER() +#undef GO +static void* find_debug_callback_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_debug_callback_fct_##A == (uintptr_t)fct) return my_debug_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_debug_callback_fct_##A == 0) {my_debug_callback_fct_##A = (uintptr_t)fct; return my_debug_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL debug_callback callback\n"); + return NULL; +} +// egl_debug_callback ... +#define GO(A) \ +static uintptr_t my_egl_debug_callback_fct_##A = 0; \ + static void my_egl_debug_callback_##A(int a, void* b, int c, void* d, void* e, const char* f) \ +{ \ + RunFunctionFmt(my_egl_debug_callback_fct_##A, "ipippp", a, b, c, d, e, f); \ +} +SUPER() +#undef GO +static void* find_egl_debug_callback_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_egl_debug_callback_fct_##A == (uintptr_t)fct) return my_egl_debug_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_egl_debug_callback_fct_##A == 0) {my_egl_debug_callback_fct_##A = (uintptr_t)fct; return my_egl_debug_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL egl_debug_callback callback\n"); + return NULL; +} +// program_callback ... +#define GO(A) \ +static uintptr_t my_program_callback_fct_##A = 0; \ +static void my_program_callback_##A(int32_t a, void* b) \ +{ \ + RunFunctionFmt(my_program_callback_fct_##A, "ip", a, b); \ +} +SUPER() +#undef GO +static void* find_program_callback_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_program_callback_fct_##A == (uintptr_t)fct) return my_program_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_program_callback_fct_##A == 0) {my_program_callback_fct_##A = (uintptr_t)fct; return my_program_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL program_callback callback\n"); + return NULL; +} +// set_blob_func ... +#define GO(A) \ +static uintptr_t my_set_blob_func_fct_##A = 0; \ +static void my_set_blob_func_##A(void* a, ssize_t b, void* c, ssize_t d) \ +{ \ + RunFunctionFmt(my_set_blob_func_fct_##A, "plpl", a, b, c, d); \ +} +SUPER() +#undef GO +static void* find_set_blob_func_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_set_blob_func_fct_##A == (uintptr_t)fct) return my_set_blob_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_set_blob_func_fct_##A == 0) {my_set_blob_func_fct_##A = (uintptr_t)fct; return my_set_blob_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL set_blob_func callback\n"); + return NULL; +} +// get_blob_func ... +#define GO(A) \ +static uintptr_t my_get_blob_func_fct_##A = 0; \ +static ssize_t my_get_blob_func_##A(void* a, ssize_t b, void* c, ssize_t d) \ +{ \ + return (ssize_t)RunFunctionFmt(my_get_blob_func_fct_##A, "plpl", a, b, c, d); \ +} +SUPER() +#undef GO +static void* find_get_blob_func_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_get_blob_func_fct_##A == (uintptr_t)fct) return my_get_blob_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_get_blob_func_fct_##A == 0) {my_get_blob_func_fct_##A = (uintptr_t)fct; return my_get_blob_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL get_blob_func callback\n"); + return NULL; +} + +#undef SUPER + +#define PRE_INIT \ + if(BOX64ENV(libgl)) { \ + lib->w.lib = dlopen(BOX64ENV(libgl), RTLD_LAZY | RTLD_GLOBAL); \ + lib->path = strdup(BOX64ENV(libgl)); \ + } else if(strstr(lib->name, "libGLX_nvidia.so.0")) { \ + lib->w.lib = dlopen("libGLX_nvidia.so.0", RTLD_LAZY | RTLD_GLOBAL); \ + if(lib->w.lib) lib->path = strdup("libGLX_nvidia.so.0"); \ + } + +// glDebugMessageCallback ... +EXPORT void my32_glDebugMessageCallback(x64emu_t* emu, void* prod, void* param) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallback; + fnc(find_debug_callback_Fct(prod), param); +} +// glDebugMessageCallbackARB ... +EXPORT void my32_glDebugMessageCallbackARB(x64emu_t* emu, void* prod, void* param) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallbackARB; + fnc(find_debug_callback_Fct(prod), param); +} +// glDebugMessageCallbackAMD ... +EXPORT void my32_glDebugMessageCallbackAMD(x64emu_t* emu, void* prod, void* param) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallbackAMD; + fnc(find_debug_callback_Fct(prod), param); +} +// glDebugMessageCallbackKHR ... +EXPORT void my32_glDebugMessageCallbackKHR(x64emu_t* emu, void* prod, void* param) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallbackKHR; + fnc(find_debug_callback_Fct(prod), param); +} +// eglDebugMessageControlKHR ... +EXPORT int my32_eglDebugMessageControlKHR(x64emu_t* emu, void* prod, void* param) +{ + iFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->eglDebugMessageControlKHR; + return fnc(find_egl_debug_callback_Fct(prod), param); +} +// eglSetBlobCacheFuncsANDROID ... +EXPORT void my32_eglSetBlobCacheFuncsANDROID(x64emu_t* emu, void* dpy, void* set, void* get) +{ + vFppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->eglSetBlobCacheFuncsANDROID; + fnc(dpy, find_set_blob_func_Fct(set), find_get_blob_func_Fct(get)); +} +// glXSwapIntervalMESA ... +EXPORT int my32_dummy_glXSwapIntervalMESA(int interval) +{ + return 5; // GLX_BAD_CONTEXT +} +EXPORT int my32_glXSwapIntervalMESA(x64emu_t* emu, int interval) +{ + iFi_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXSwapIntervalMESA; + if(!fnc) fnc=my32_dummy_glXSwapIntervalMESA; + return fnc(interval); +} +// glXSwapIntervalEXT ... +EXPORT void my32_dummy_glXSwapIntervalEXT(void* dpy, void* drawable, int interval) {} +EXPORT void my32_glXSwapIntervalEXT(x64emu_t* emu, void* dpy, void* drawable, int interval) +{ + vFppi_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXSwapIntervalEXT; + if(!fnc) fnc=my32_dummy_glXSwapIntervalEXT; + fnc(dpy, drawable, interval); +} + +// glProgramCallbackMESA ... +EXPORT void my32_glProgramCallbackMESA(x64emu_t* emu, int t, void* f, void* data) +{ + vFipp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glProgramCallbackMESA; + fnc(t, find_program_callback_Fct(f), data); +} + +void* my_GetVkProcAddr(x64emu_t* emu, void* name, void*(*getaddr)(void*)); // defined in wrappedvulkan.c +// glGetVkProcAddrNV ... +EXPORT void* my32_glGetVkProcAddrNV(x64emu_t* emu, void* name) +{ + pFp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glGetVkProcAddrNV; + return my_GetVkProcAddr(emu, name, fnc); +} +// glShaderSource ... +EXPORT void my32_glShaderSource(x64emu_t* emu, uint32_t shader, int count, ptr_t* string, int* length) +{ + vFuipp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glShaderSource; + char* str[count]; + if(string) for(int i=0; iglXChooseFBConfig; + void** res = fnc(dpy, screen, list, nelement); + if(!res) + return NULL; + ptr_t* fbconfig = (ptr_t*)res; + for(int i=0; i<*nelement; ++i) + fbconfig[i] = to_ptrv(res[i]); + return res; +} +// glXChooseFBConfigSGIX ... +EXPORT void* my32_glXChooseFBConfigSGIX(x64emu_t* emu, void* dpy, int screen, int* list, int* nelement) +{ + pFpipp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXChooseFBConfigSGIX; + void** res = fnc(dpy, screen, list, nelement); + if(!res) + return NULL; + ptr_t* fbconfig = (ptr_t*)res; + for(int i=0; i<*nelement; ++i) + fbconfig[i] = to_ptrv(res[i]); + return res; +} +// glXGetVisualFromFBConfig ... +EXPORT void* my32_glXGetVisualFromFBConfig(x64emu_t* emu, void* dpy, void* config) +{ + pFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXGetVisualFromFBConfig; + void* res = fnc(dpy, config); + if(!res) + return NULL; + my_XVisualInfo_32_t* vinfo = (my_XVisualInfo_32_t*)res; + convert_XVisualInfo_to_32(dpy, vinfo, res); + return vinfo; +} +// glXGetVisualFromFBConfigSGIX ... +EXPORT void* my32_glXGetVisualFromFBConfigSGIX(x64emu_t* emu, void* dpy, void* config) +{ + pFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXGetVisualFromFBConfigSGIX; + void* res = fnc(dpy, config); + if(!res) + return NULL; + my_XVisualInfo_32_t* vinfo = (my_XVisualInfo_32_t*)res; + convert_XVisualInfo_to_32(dpy, vinfo, res); + return vinfo; +} +// glXChooseVisual ... +EXPORT void* my32_glXChooseVisual(x64emu_t* emu, void* dpy, int screen, int* attr) +{ + pFpip_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXChooseVisual; + void* res = fnc(dpy, screen, attr); + my_XVisualInfo_32_t* vinfo = (my_XVisualInfo_32_t*)res; + convert_XVisualInfo_to_32(dpy, vinfo, res); + return vinfo; +} +// glXCreateContext ... +EXPORT void* my32_glXCreateContext(x64emu_t* emu, void* dpy, my_XVisualInfo_32_t* info, void* shared, int direct) +{ + pFpppi_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXCreateContext; + my_XVisualInfo_t info_l = {0}; + convert_XVisualInfo_to_64(dpy, &info_l, info); + return fnc(dpy, &info_l, shared, direct); +} +// glXGetFBConfigFromVisualSGIX ... +EXPORT void* my32_glXGetFBConfigFromVisualSGIX(x64emu_t* emu, void* dpy, my_XVisualInfo_32_t* info) +{ + pFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXGetFBConfigFromVisualSGIX; + my_XVisualInfo_t info_l = {0}; + convert_XVisualInfo_to_64(dpy, &info_l, info); + return fnc(dpy, &info_l); +} +// glMultiDrawElements ... +EXPORT void my32_glMultiDrawElements(x64emu_t* emu, uint32_t mode, void* count, uint32_t type, ptr_t* indices, int drawcount) +{ + vFupupi_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glMultiDrawElements; + void* indices_l[drawcount]; + for(int i=0; iglMultiModeDrawElementsIBM; + void* indices_l[primcount]; + for(uint32_t i=0; iglTransformFeedbackVaryings; + void* varyings_l[count]; + for(int i=0; iglBindBuffersRange; + long offsets_l[count]; + long sizes_l[count]; + for(int i=0; iglBindVertexBuffers; + long offsets_l[count]; + for(int i=0; iglVertexArrayVertexBuffers; + long offsets_l[count]; + for(int i=0; iglMultiDrawElementsBaseVertex; + void* indices_l[drawcount]; + for(int i=0; iglCreateShaderProgramv; + char* str[count]; + if(string) for(int i=0; iglCompileShaderIncludeARB; + char* str[count]; + if(string) for(int i=0; iglXGetFBConfigs; + void* ret = fnc(dpy, screen, n); + if(!ret) return NULL; + void** src = ret; + ptr_t* dst = ret; + for(int i=0; i<*n; ++i) + dst[i] = to_ptrv(src[i]); + return ret; +} +// glGetUniformIndices ... +EXPORT void my32_glGetUniformIndices(x64emu_t* emu, uint32_t prog, int count, ptr_t* names, void* indices) +{ + vFuipp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glGetUniformIndices; + void* names_l[count]; + fnc(prog, count, names?names_l:NULL, indices); + if(names) for(int i=0; iglVDPAUMapSurfacesNV; + long surfaces_l[count]; + if(surfaces) for(int i=0; iglVDPAUUnmapSurfacesNV; + long surfaces_l[count]; + if(surfaces) for(int i=0; iprocaddress = procaddress; + wrappers->glwrappers = kh_init(symbolmap); + // populates maps... + cnt = sizeof(libglsymbolmap)/sizeof(map_onesymbol_t); + for (int i=0; iglwrappers, libglsymbolmap[i].name, &ret); + kh_value(wrappers->glwrappers, k).w = libglsymbolmap[i].w; + kh_value(wrappers->glwrappers, k).resolved = 0; + } + // and the my_ symbols map + cnt = sizeof(MAPNAME(mysymbolmap))/sizeof(map_onesymbol_t); + for (int i=0; iglwrappers, libglmysymbolmap[i].name, &ret); + kh_value(wrappers->glwrappers, k).w = libglmysymbolmap[i].w; + kh_value(wrappers->glwrappers, k).resolved = 0; + } + // my_* map + wrappers->glmymap = kh_init(symbolmap); + cnt = sizeof(MAPNAME(mysymbolmap))/sizeof(map_onesymbol_t); + for (int i=0; iglmymap, libglmysymbolmap[i].name, &ret); + kh_value(wrappers->glmymap, k).w = libglmysymbolmap[i].w; + kh_value(wrappers->glmymap, k).resolved = 0; + } + return wrappers; +} + +void* getGLProcAddress32(x64emu_t* emu, const char* my, glprocaddress_t procaddr, const char* rname) +{ + if(!my) my = "my32_"; + khint_t k; + printf_dlsym(LOG_DEBUG, "Calling getGLProcAddress32[%p](\"%s\") => ", procaddr, rname); + gl_wrappers_t* wrappers = getGLProcWrapper32(emu->context, procaddr); + // check if glxprocaddress is filled, and search for lib and fill it if needed + // get proc adress using actual glXGetProcAddress + k = kh_get(symbolmap, wrappers->glmymap, rname); + int is_my = (k==kh_end(wrappers->glmymap))?0:1; + void* symbol = procaddr(rname); + void* fnc = NULL; + if(is_my) { + // try again, by using custom "my_" now... + char tmp[200]; + strcpy(tmp, my); + strcat(tmp, rname); + fnc = symbol; + symbol = dlsym(emu->context->box64lib, tmp); + } + if(!symbol) { + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", NULL); + return NULL; // easy + } + // check if alread bridged + uintptr_t ret = CheckBridged(emu->context->system, symbol); + if(ret) { + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", (void*)ret); + return (void*)ret; // already bridged + } + // get wrapper + k = kh_get(symbolmap, wrappers->glwrappers, rname); + if(k==kh_end(wrappers->glwrappers) && strstr(rname, "ARB")==NULL) { + // try again, adding ARB at the end if not present + char tmp[200]; + strcpy(tmp, rname); + strcat(tmp, "ARB"); + k = kh_get(symbolmap, wrappers->glwrappers, tmp); + } + if(k==kh_end(wrappers->glwrappers) && strstr(rname, "EXT")==NULL) { + // try again, adding EXT at the end if not present + char tmp[200]; + strcpy(tmp, rname); + strcat(tmp, "EXT"); + k = kh_get(symbolmap, wrappers->glwrappers, tmp); + } + if(k==kh_end(wrappers->glwrappers)) { + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", NULL); + printf_dlsym_prefix(2, LOG_INFO, "Warning, no wrapper for %s\n", rname); + return NULL; + } + symbol1_t* s = &kh_value(wrappers->glwrappers, k); + const char* constname = kh_key(wrappers->glwrappers, k); + ret = AddCheckBridge2(emu->context->system, s->w, symbol, fnc, 0, constname); + + printf_dlsym_prefix(0, LOG_DEBUG, "%p\n", (void*)ret); + return (void*)ret; +} diff --git a/src/wrapped32/wrappedlibgl_private.h b/src/wrapped32/wrappedlibgl_private.h new file mode 100644 index 0000000..9dab909 --- /dev/null +++ b/src/wrapped32/wrappedlibgl_private.h @@ -0,0 +1,4092 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif +//VERSION_1_0 +GO(glAccum, vFuf) +GO(glAlphaFunc, vFuf) +GO(glBegin, vFu) +GO(glBitmap, vFiiffffp) +GO(glBlendFunc, vFuu) +GO(glCallList, vFu) +GO(glCallLists, vFiup) +GO(glClear, vFu) +GO(glClearAccum, vFffff) +GO(glClearColor, vFffff) +GO(glClearDepth, vFd) +GO(glClearIndex, vFf) +GO(glClearStencil, vFi) +GO(glClipPlane, vFup) +GO(glColor3b, vFccc) +GO(glColor3bv, vFp) +GO(glColor3d, vFddd) +GO(glColor3dv, vFp) +GO(glColor3f, vFfff) +GO(glColor3fv, vFp) +GO(glColor3i, vFiii) +GO(glColor3iv, vFp) +GO(glColor3s, vFwww) +GO(glColor3sv, vFp) +GO(glColor3ub, vFCCC) +GO(glColor3ubv, vFp) +GO(glColor3ui, vFuuu) +GO(glColor3uiv, vFp) +GO(glColor3us, vFWWW) +GO(glColor3usv, vFp) +GO(glColor4b, vFcccc) +GO(glColor4bv, vFp) +GO(glColor4d, vFdddd) +GO(glColor4dv, vFp) +GO(glColor4f, vFffff) +GO(glColor4fv, vFp) +GO(glColor4i, vFiiii) +GO(glColor4iv, vFp) +GO(glColor4s, vFwwww) +GO(glColor4sv, vFp) +GO(glColor4ub, vFCCCC) +GO(glColor4ubv, vFp) +GO(glColor4ui, vFuuuu) +GO(glColor4uiv, vFp) +GO(glColor4us, vFWWWW) +GO(glColor4usv, vFp) +GO(glColorMask, vFCCCC) +GO(glColorMaterial, vFuu) +GO(glCopyPixels, vFiiiiu) +GO(glCullFace, vFu) +GO(glDeleteLists, vFui) +GO(glDepthFunc, vFu) +GO(glDepthMask, vFC) +GO(glDepthRange, vFdd) +GO(glDisable, vFu) +GO(glDrawBuffer, vFu) +GO(glDrawPixels, vFiiuup) +GO(glEdgeFlag, vFC) +GO(glEdgeFlagv, vFp) +GO(glEnable, vFu) +GO(glEnd, vFv) +GO(glEndList, vFv) +GO(glEvalCoord1d, vFd) +GO(glEvalCoord1dv, vFp) +GO(glEvalCoord1f, vFf) +GO(glEvalCoord1fv, vFp) +GO(glEvalCoord2d, vFdd) +GO(glEvalCoord2dv, vFp) +GO(glEvalCoord2f, vFff) +GO(glEvalCoord2fv, vFp) +GO(glEvalMesh1, vFuii) +GO(glEvalMesh2, vFuiiii) +GO(glEvalPoint1, vFi) +GO(glEvalPoint2, vFii) +GO(glFeedbackBuffer, vFiup) +GO(glFinish, vFv) +GO(glFlush, vFv) +GO(glFogf, vFuf) +GO(glFogfv, vFup) +GO(glFogi, vFui) +GO(glFogiv, vFup) +GO(glFrontFace, vFu) +GO(glFrustum, vFdddddd) +GO(glGenLists, uFi) +GO(glGetBooleanv, vFup) +GO(glGetClipPlane, vFup) +GO(glGetDoublev, vFup) +GO(glGetError, uFv) +GO(glGetFloatv, vFup) +GO(glGetIntegerv, vFup) +GO(glGetLightfv, vFuup) +GO(glGetLightiv, vFuup) +GO(glGetMapdv, vFuup) +GO(glGetMapfv, vFuup) +GO(glGetMapiv, vFuup) +GO(glGetMaterialfv, vFuup) +GO(glGetMaterialiv, vFuup) +GO(glGetPixelMapfv, vFup) +GO(glGetPixelMapuiv, vFup) +GO(glGetPixelMapusv, vFup) +GO(glGetPolygonStipple, vFp) +GO(glGetString, pFu) +GO(glGetTexEnvfv, vFuup) +GO(glGetTexEnviv, vFuup) +GO(glGetTexGendv, vFuup) +GO(glGetTexGenfv, vFuup) +GO(glGetTexGeniv, vFuup) +GO(glGetTexImage, vFuiuup) +GO(glGetTexLevelParameterfv, vFuiup) +GO(glGetTexLevelParameteriv, vFuiup) +GO(glGetLevelParameterfv, vFuiup) //some old programs have typo... +GO(glGetLevelParameteriv, vFuiup) //some old programs have typo... +GO(glGetTexParameterfv, vFuup) +GO(glGetTexParameteriv, vFuup) +GO(glHint, vFuu) +GO(glIndexMask, vFu) +GO(glIndexd, vFd) +GO(glIndexdv, vFp) +GO(glIndexf, vFf) +GO(glIndexfv, vFp) +GO(glIndexi, vFi) +GO(glIndexiv, vFp) +GO(glIndexs, vFw) +GO(glIndexsv, vFp) +GO(glInitNames, vFv) +GO(glIsEnabled, CFu) +GO(glIsList, CFu) +GO(glLightModelf, vFuf) +GO(glLightModelfv, vFup) +GO(glLightModeli, vFui) +GO(glLightModeliv, vFup) +GO(glLightf, vFuuf) +GO(glLightfv, vFuup) +GO(glLighti, vFuui) +GO(glLightiv, vFuup) +GO(glLineStipple, vFiW) +GO(glLineWidth, vFf) +GO(glListBase, vFu) +GO(glLoadIdentity, vFv) +GO(glLoadMatrixd, vFp) +GO(glLoadMatrixf, vFp) +GO(glLoadName, vFu) +GO(glLogicOp, vFu) +GO(glMap1d, vFuddiip) +GO(glMap1f, vFuffiip) +GO(glMap2d, vFuddiiddiip) +GO(glMap2f, vFuffiiffiip) +GO(glMapGrid1d, vFidd) +GO(glMapGrid1f, vFiff) +GO(glMapGrid2d, vFiddidd) +GO(glMapGrid2f, vFiffiff) +GO(glMaterialf, vFuuf) +GO(glMaterialfv, vFuup) +GO(glMateriali, vFuui) +GO(glMaterialiv, vFuup) +GO(glMatrixMode, vFu) +GO(glMultMatrixd, vFp) +GO(glMultMatrixf, vFp) +GO(glNewList, vFuu) +GO(glNormal3b, vFccc) +GO(glNormal3bv, vFp) +GO(glNormal3d, vFddd) +GO(glNormal3dv, vFp) +GO(glNormal3f, vFfff) +GO(glNormal3fv, vFp) +GO(glNormal3i, vFiii) +GO(glNormal3iv, vFp) +GO(glNormal3s, vFwww) +GO(glNormal3sv, vFp) +GO(glOrtho, vFdddddd) +GO(glPassThrough, vFf) +GO(glPixelMapfv, vFuip) +GO(glPixelMapuiv, vFuip) +GO(glPixelMapusv, vFuip) +GO(glPixelStoref, vFuf) +GO(glPixelStorei, vFui) +GO(glPixelTransferf, vFuf) +GO(glPixelTransferi, vFui) +GO(glPixelZoom, vFff) +GO(glPointSize, vFf) +GO(glPolygonMode, vFuu) +GO(glPolygonStipple, vFp) +GO(glPopAttrib, vFv) +GO(glPopMatrix, vFv) +GO(glPopName, vFv) +GO(glPushAttrib, vFu) +GO(glPushMatrix, vFv) +GO(glPushName, vFu) +GO(glRasterPos2d, vFdd) +GO(glRasterPos2dv, vFp) +GO(glRasterPos2f, vFff) +GO(glRasterPos2fv, vFp) +GO(glRasterPos2i, vFii) +GO(glRasterPos2iv, vFp) +GO(glRasterPos2s, vFww) +GO(glRasterPos2sv, vFp) +GO(glRasterPos3d, vFddd) +GO(glRasterPos3dv, vFp) +GO(glRasterPos3f, vFfff) +GO(glRasterPos3fv, vFp) +GO(glRasterPos3i, vFiii) +GO(glRasterPos3iv, vFp) +GO(glRasterPos3s, vFwww) +GO(glRasterPos3sv, vFp) +GO(glRasterPos4d, vFdddd) +GO(glRasterPos4dv, vFp) +GO(glRasterPos4f, vFffff) +GO(glRasterPos4fv, vFp) +GO(glRasterPos4i, vFiiii) +GO(glRasterPos4iv, vFp) +GO(glRasterPos4s, vFwwww) +GO(glRasterPos4sv, vFp) +GO(glReadBuffer, vFu) +GO(glReadPixels, vFiiiiuup) +GO(glRectd, vFdddd) +GO(glRectdv, vFpp) +GO(glRectf, vFffff) +GO(glRectfv, vFpp) +GO(glRecti, vFiiii) +GO(glRectiv, vFpp) +GO(glRects, vFwwww) +GO(glRectsv, vFpp) +GO(glRenderMode, iFu) +GO(glRotated, vFdddd) +GO(glRotatef, vFffff) +GO(glScaled, vFddd) +GO(glScalef, vFfff) +GO(glScissor, vFiiii) +GO(glSelectBuffer, vFip) +GO(glShadeModel, vFu) +GO(glStencilFunc, vFuiu) +GO(glStencilMask, vFu) +GO(glStencilOp, vFuuu) +GO(glTexCoord1d, vFd) +GO(glTexCoord1dv, vFp) +GO(glTexCoord1f, vFf) +GO(glTexCoord1fv, vFp) +GO(glTexCoord1i, vFi) +GO(glTexCoord1iv, vFp) +GO(glTexCoord1s, vFw) +GO(glTexCoord1sv, vFp) +GO(glTexCoord2d, vFdd) +GO(glTexCoord2dv, vFp) +GO(glTexCoord2f, vFff) +GO(glTexCoord2fv, vFp) +GO(glTexCoord2i, vFii) +GO(glTexCoord2iv, vFp) +GO(glTexCoord2s, vFww) +GO(glTexCoord2sv, vFp) +GO(glTexCoord3d, vFddd) +GO(glTexCoord3dv, vFp) +GO(glTexCoord3f, vFfff) +GO(glTexCoord3fv, vFp) +GO(glTexCoord3i, vFiii) +GO(glTexCoord3iv, vFp) +GO(glTexCoord3s, vFwww) +GO(glTexCoord3sv, vFp) +GO(glTexCoord4d, vFdddd) +GO(glTexCoord4dv, vFp) +GO(glTexCoord4f, vFffff) +GO(glTexCoord4fv, vFp) +GO(glTexCoord4i, vFiiii) +GO(glTexCoord4iv, vFp) +GO(glTexCoord4s, vFwwww) +GO(glTexCoord4sv, vFp) +GO(glTexEnvf, vFuuf) +GO(glTexEnvfv, vFuup) +GO(glTexEnvi, vFuui) +GO(glTexEnviv, vFuup) +GO(glTexGend, vFuud) +GO(glTexGendv, vFuup) +GO(glTexGenf, vFuuf) +GO(glTexGenfv, vFuup) +GO(glTexGeni, vFuui) +GO(glTexGeniv, vFuup) +GO(glTexImage1D, vFuiiiiuup) +GO(glTexImage2D, vFuiiiiiuup) +GO(glTexParameterf, vFuuf) +GO(glTexParameterfv, vFuup) +GO(glTexParameteri, vFuui) +GO(glTexParameteriv, vFuup) +GO(glTranslated, vFddd) +GO(glTranslatef, vFfff) +GO(glVertex2d, vFdd) +GO(glVertex2dv, vFp) +GO(glVertex2f, vFff) +GO(glVertex2fv, vFp) +GO(glVertex2i, vFii) +GO(glVertex2iv, vFp) +GO(glVertex2s, vFww) +GO(glVertex2sv, vFp) +GO(glVertex3d, vFddd) +GO(glVertex3dv, vFp) +GO(glVertex3f, vFfff) +GO(glVertex3fv, vFp) +GO(glVertex3i, vFiii) +GO(glVertex3iv, vFp) +GO(glVertex3s, vFwww) +GO(glVertex3sv, vFp) +GO(glVertex4d, vFdddd) +GO(glVertex4dv, vFp) +GO(glVertex4f, vFffff) +GO(glVertex4fv, vFp) +GO(glVertex4i, vFiiii) +GO(glVertex4iv, vFp) +GO(glVertex4s, vFwwww) +GO(glVertex4sv, vFp) +GO(glViewport, vFiiii) +//VERSION_1_1 +GO(glAreTexturesResident, CFipp) +GO(glArrayElement, vFi) +GO(glBindTexture, vFuu) +GO(glColorPointer, vFiuip) +GO(glCopyTexImage1D, vFuiuiiii) +GO(glCopyTexImage2D, vFuiuiiiii) +GO(glCopyTexSubImage1D, vFuiiiii) +GO(glCopyTexSubImage2D, vFuiiiiiii) +GO(glDeleteTextures, vFip) +GO(glDisableClientState, vFu) +GO(glDrawArrays, vFuii) +GO(glDrawElements, vFuiup) +GO(glEdgeFlagPointer, vFip) +GO(glEnableClientState, vFu) +GO(glGenTextures, vFip) +GO(glGetPointerv, vFuBp_) +GO(glIndexPointer, vFuip) +GO(glIndexub, vFC) +GO(glIndexubv, vFp) +GO(glInterleavedArrays, vFuip) +GO(glIsTexture, CFu) +GO(glNormalPointer, vFuip) +GO(glPolygonOffset, vFff) +GO(glPopClientAttrib, vFv) +GO(glPrioritizeTextures, vFipp) +GO(glPushClientAttrib, vFu) +GO(glTexCoordPointer, vFiuip) +GO(glTexSubImage1D, vFuiiiuup) +GO(glTexSubImage2D, vFuiiiiiuup) +GO(glVertexPointer, vFiuip) +//VERSION_1_2 +GO(glBlendColor, vFffff) +GO(glBlendEquation, vFu) +GO(glColorSubTable, vFuiiuup) +GO(glColorTable, vFuuiuup) +GO(glColorTableParameterfv, vFuup) +GO(glColorTableParameteriv, vFuup) +GO(glConvolutionFilter1D, vFuuiuup) +GO(glConvolutionFilter2D, vFuuiiuup) +GO(glConvolutionParameterf, vFuuf) +GO(glConvolutionParameterfv, vFuup) +GO(glConvolutionParameteri, vFuui) +GO(glConvolutionParameteriv, vFuup) +GO(glCopyColorSubTable, vFuiiii) +GO(glCopyColorTable, vFuuiii) +GO(glCopyConvolutionFilter1D, vFuuiii) +GO(glCopyConvolutionFilter2D, vFuuiiii) +GO(glCopyTexSubImage3D, vFuiiiiiiii) +GO(glDrawRangeElements, vFuuuiup) +GO(glGetColorTable, vFuuup) +GO(glGetColorTableParameterfv, vFuup) +GO(glGetColorTableParameteriv, vFuup) +GO(glGetConvolutionFilter, vFuuup) +GO(glGetConvolutionParameterfv, vFuup) +GO(glGetConvolutionParameteriv, vFuup) +GO(glGetHistogram, vFuCuup) +GO(glGetHistogramParameterfv, vFuup) +GO(glGetHistogramParameteriv, vFuup) +GO(glGetMinmax, vFuCuup) +GO(glGetMinmaxParameterfv, vFuup) +GO(glGetMinmaxParameteriv, vFuup) +GO(glGetSeparableFilter, vFuuuppp) +GO(glHistogram, vFuiuC) +GO(glMinmax, vFuuC) +GO(glResetHistogram, vFu) +GO(glResetMinmax, vFu) +GO(glSeparableFilter2D, vFuuiiuupp) +GO(glTexImage3D, vFuiiiiiiuup) +GO(glTexSubImage3D, vFuiiiiiiiuup) +//VERSION_1_3 +GO(glActiveTexture, vFu) +GO(glClientActiveTexture, vFu) +GO(glCompressedTexImage1D, vFuiuiiip) +GO(glCompressedTexImage2D, vFuiuiiiip) +GO(glCompressedTexImage3D, vFuiuiiiiip) +GO(glCompressedTexSubImage1D, vFuiiiuip) +GO(glCompressedTexSubImage2D, vFuiiiiiuip) +GO(glCompressedTexSubImage3D, vFuiiiiiiiuip) +GO(glGetCompressedTexImage, vFuip) +GO(glLoadTransposeMatrixd, vFp) +GO(glLoadTransposeMatrixf, vFp) +GO(glMultTransposeMatrixd, vFp) +GO(glMultTransposeMatrixf, vFp) +GO(glMultiTexCoord1d, vFud) +GO(glMultiTexCoord1dv, vFup) +GO(glMultiTexCoord1f, vFuf) +GO(glMultiTexCoord1fv, vFup) +GO(glMultiTexCoord1i, vFui) +GO(glMultiTexCoord1iv, vFup) +GO(glMultiTexCoord1s, vFuw) +GO(glMultiTexCoord1sv, vFup) +GO(glMultiTexCoord2d, vFudd) +GO(glMultiTexCoord2dv, vFup) +GO(glMultiTexCoord2f, vFuff) +GO(glMultiTexCoord2fv, vFup) +GO(glMultiTexCoord2i, vFuii) +GO(glMultiTexCoord2iv, vFup) +GO(glMultiTexCoord2s, vFuww) +GO(glMultiTexCoord2sv, vFup) +GO(glMultiTexCoord3d, vFuddd) +GO(glMultiTexCoord3dv, vFup) +GO(glMultiTexCoord3f, vFufff) +GO(glMultiTexCoord3fv, vFup) +GO(glMultiTexCoord3i, vFuiii) +GO(glMultiTexCoord3iv, vFup) +GO(glMultiTexCoord3s, vFuwww) +GO(glMultiTexCoord3sv, vFup) +GO(glMultiTexCoord4d, vFudddd) +GO(glMultiTexCoord4dv, vFup) +GO(glMultiTexCoord4f, vFuffff) +GO(glMultiTexCoord4fv, vFup) +GO(glMultiTexCoord4i, vFuiiii) +GO(glMultiTexCoord4iv, vFup) +GO(glMultiTexCoord4s, vFuwwww) +GO(glMultiTexCoord4sv, vFup) +GO(glSampleCoverage, vFfC) +//VERSION_1_4 +GO(glBlendFuncSeparate, vFuuuu) +GO(glFogCoordPointer, vFuip) +GO(glFogCoordd, vFd) +GO(glFogCoorddv, vFp) +GO(glFogCoordf, vFf) +GO(glFogCoordfv, vFp) +GO(glMultiDrawArrays, vFuppi) +GOM(glMultiDrawElements, vFEupupi) +GO(glPointParameterf, vFuf) +GO(glPointParameterfv, vFup) +GO(glPointParameteri, vFui) +GO(glPointParameteriv, vFup) +GO(glSecondaryColor3b, vFccc) +GO(glSecondaryColor3bv, vFp) +GO(glSecondaryColor3d, vFddd) +GO(glSecondaryColor3dv, vFp) +GO(glSecondaryColor3f, vFfff) +GO(glSecondaryColor3fv, vFp) +GO(glSecondaryColor3i, vFiii) +GO(glSecondaryColor3iv, vFp) +GO(glSecondaryColor3s, vFwww) +GO(glSecondaryColor3sv, vFp) +GO(glSecondaryColor3ub, vFCCC) +GO(glSecondaryColor3ubv, vFp) +GO(glSecondaryColor3ui, vFuuu) +GO(glSecondaryColor3uiv, vFp) +GO(glSecondaryColor3us, vFWWW) +GO(glSecondaryColor3usv, vFp) +GO(glSecondaryColorPointer, vFiuip) +GO(glWindowPos2d, vFdd) +GO(glWindowPos2dv, vFp) +GO(glWindowPos2f, vFff) +GO(glWindowPos2fv, vFp) +GO(glWindowPos2i, vFii) +GO(glWindowPos2iv, vFp) +GO(glWindowPos2s, vFww) +GO(glWindowPos2sv, vFp) +GO(glWindowPos3d, vFddd) +GO(glWindowPos3dv, vFp) +GO(glWindowPos3f, vFfff) +GO(glWindowPos3fv, vFp) +GO(glWindowPos3i, vFiii) +GO(glWindowPos3iv, vFp) +GO(glWindowPos3s, vFwww) +GO(glWindowPos3sv, vFp) +//VERSION_1_5 +GO(glBeginQuery, vFuu) +GO(glBindBuffer, vFuu) +GO(glBufferData, vFulpu) +GO(glBufferSubData, vFullp) +GO(glDeleteBuffers, vFip) +GO(glDeleteQueries, vFip) +GO(glEndQuery, vFu) +GO(glGenBuffers, vFip) +GO(glGenQueries, vFip) +GO(glGetBufferParameteriv, vFuup) +GO(glGetBufferPointerv, vFuuBp_) +GO(glGetBufferSubData, vFullp) +GO(glGetQueryObjectiv, vFuup) +GO(glGetQueryObjectuiv, vFuup) +GO(glGetQueryiv, vFuup) +GO(glIsBuffer, CFu) +GO(glIsQuery, CFu) +GO(glMapBuffer, pFuu) +GO(glUnmapBuffer, CFu) +//VERSION_2_0 +GO(glAttachShader, vFuu) +GO(glBindAttribLocation, vFuup) +GO(glBlendEquationSeparate, vFuu) +GO(glCompileShader, vFu) +GO(glCreateProgram, uFv) +GO(glCreateShader, uFu) +GO(glDeleteProgram, vFu) +GO(glDeleteShader, vFu) +GO(glDetachShader, vFuu) +GO(glDisableVertexAttribArray, vFu) +GO(glDrawBuffers, vFip) +GO(glEnableVertexAttribArray, vFu) +GO(glGetActiveAttrib, vFuuipppp) +GO(glGetActiveUniform, vFuuipppp) +GO(glGetAttachedShaders, vFuipp) +GO(glGetAttribLocation, iFup) +GO(glGetProgramInfoLog, vFuipp) +GO(glGetProgramiv, vFuup) +GO(glGetShaderInfoLog, vFuipp) +GO(glGetShaderSource, vFuipp) +GO(glGetShaderiv, vFuup) +GO(glGetUniformLocation, iFup) +GO(glGetUniformfv, vFuip) +GO(glGetUniformiv, vFuip) +GO(glGetVertexAttribPointerv, vFuuBp_) +GO(glGetVertexAttribdv, vFuup) +GO(glGetVertexAttribfv, vFuup) +GO(glGetVertexAttribiv, vFuup) +GO(glIsProgram, CFu) +GO(glIsShader, CFu) +GO(glLinkProgram, vFu) +GOM(glShaderSource, vFEuipp) +GO(glStencilFuncSeparate, vFuuiu) +GO(glStencilMaskSeparate, vFuu) +GO(glStencilOpSeparate, vFuuuu) +GO(glUniform1f, vFif) +GO(glUniform1fv, vFiip) +GO(glUniform1i, vFii) +GO(glUniform1iv, vFiip) +GO(glUniform2f, vFiff) +GO(glUniform2fv, vFiip) +GO(glUniform2i, vFiii) +GO(glUniform2iv, vFiip) +GO(glUniform3f, vFifff) +GO(glUniform3fv, vFiip) +GO(glUniform3i, vFiiii) +GO(glUniform3iv, vFiip) +GO(glUniform4f, vFiffff) +GO(glUniform4fv, vFiip) +GO(glUniform4i, vFiiiii) +GO(glUniform4iv, vFiip) +GO(glUniformMatrix2fv, vFiiCp) +GO(glUniformMatrix3fv, vFiiCp) +GO(glUniformMatrix4fv, vFiiCp) +GO(glUseProgram, vFu) +GO(glValidateProgram, vFu) +GO(glVertexAttrib1d, vFud) +GO(glVertexAttrib1dv, vFup) +GO(glVertexAttrib1f, vFuf) +GO(glVertexAttrib1fv, vFup) +GO(glVertexAttrib1s, vFuw) +GO(glVertexAttrib1sv, vFup) +GO(glVertexAttrib2d, vFudd) +GO(glVertexAttrib2dv, vFup) +GO(glVertexAttrib2f, vFuff) +GO(glVertexAttrib2fv, vFup) +GO(glVertexAttrib2s, vFuww) +GO(glVertexAttrib2sv, vFup) +GO(glVertexAttrib3d, vFuddd) +GO(glVertexAttrib3dv, vFup) +GO(glVertexAttrib3f, vFufff) +GO(glVertexAttrib3fv, vFup) +GO(glVertexAttrib3s, vFuwww) +GO(glVertexAttrib3sv, vFup) +GO(glVertexAttrib4Nbv, vFup) +GO(glVertexAttrib4Niv, vFup) +GO(glVertexAttrib4Nsv, vFup) +GO(glVertexAttrib4Nub, vFuCCCC) +GO(glVertexAttrib4Nubv, vFup) +GO(glVertexAttrib4Nuiv, vFup) +GO(glVertexAttrib4Nusv, vFup) +GO(glVertexAttrib4bv, vFup) +GO(glVertexAttrib4d, vFudddd) +GO(glVertexAttrib4dv, vFup) +GO(glVertexAttrib4f, vFuffff) +GO(glVertexAttrib4fv, vFup) +GO(glVertexAttrib4iv, vFup) +GO(glVertexAttrib4s, vFuwwww) +GO(glVertexAttrib4sv, vFup) +GO(glVertexAttrib4ubv, vFup) +GO(glVertexAttrib4uiv, vFup) +GO(glVertexAttrib4usv, vFup) +GO(glVertexAttribPointer, vFuiuCip) +//VERSION_2_1 +GO(glUniformMatrix2x3fv, vFiiCp) +GO(glUniformMatrix2x4fv, vFiiCp) +GO(glUniformMatrix3x2fv, vFiiCp) +GO(glUniformMatrix3x4fv, vFiiCp) +GO(glUniformMatrix4x2fv, vFiiCp) +GO(glUniformMatrix4x3fv, vFiiCp) +//VERSION_3_0 +GO(glBeginConditionalRender, vFuu) +GO(glBeginTransformFeedback, vFu) +GO(glBindBufferBase, vFuuu) +GO(glBindBufferRange, vFuuull) +GO(glBindFragDataLocation, vFuup) +GO(glClampColor, vFuu) +GO(glClearBufferfi, vFuifi) +GO(glClearBufferfv, vFuip) +GO(glClearBufferiv, vFuip) +GO(glClearBufferuiv, vFuip) +GO(glColorMaski, vFuCCCC) +GO(glDisablei, vFuu) +GO(glEnablei, vFuu) +GO(glEndConditionalRender, vFv) +GO(glEndTransformFeedback, vFv) +GO(glGetBooleani_v, vFuup) +GO(glGetFragDataLocation, iFup) +GO(glGetIntegeri_v, vFuup) +GO(glGetStringi, tFuu) +GO(glGetTexParameterIiv, vFuup) +GO(glGetTexParameterIuiv, vFuup) +GO(glGetTransformFeedbackVarying, vFuuipppp) +GO(glGetUniformuiv, vFuip) +GO(glGetVertexAttribIiv, vFuup) +GO(glGetVertexAttribIuiv, vFuup) +GO(glIsEnabledi, CFuu) +GO(glTexParameterIiv, vFuup) +GO(glTexParameterIuiv, vFuup) +GOM(glTransformFeedbackVaryings, vFEuipu) +GO(glUniform1ui, vFiu) +GO(glUniform1uiv, vFiip) +GO(glUniform2ui, vFiuu) +GO(glUniform2uiv, vFiip) +GO(glUniform3ui, vFiuuu) +GO(glUniform3uiv, vFiip) +GO(glUniform4ui, vFiuuuu) +GO(glUniform4uiv, vFiip) +GO(glVertexAttribI1i, vFui) +GO(glVertexAttribI1iv, vFup) +GO(glVertexAttribI1ui, vFuu) +GO(glVertexAttribI1uiv, vFup) +GO(glVertexAttribI2i, vFuii) +GO(glVertexAttribI2iv, vFup) +GO(glVertexAttribI2ui, vFuuu) +GO(glVertexAttribI2uiv, vFup) +GO(glVertexAttribI3i, vFuiii) +GO(glVertexAttribI3iv, vFup) +GO(glVertexAttribI3ui, vFuuuu) +GO(glVertexAttribI3uiv, vFup) +GO(glVertexAttribI4bv, vFup) +GO(glVertexAttribI4i, vFuiiii) +GO(glVertexAttribI4iv, vFup) +GO(glVertexAttribI4sv, vFup) +GO(glVertexAttribI4ubv, vFup) +GO(glVertexAttribI4ui, vFuuuuu) +GO(glVertexAttribI4uiv, vFup) +GO(glVertexAttribI4usv, vFup) +GO(glVertexAttribIPointer, vFuiuip) +//VERSION_3_1 +GO(glDrawArraysInstanced, vFuiii) +GO(glDrawElementsInstanced, vFuiupi) +GO(glPrimitiveRestartIndex, vFu) +GO(glTexBuffer, vFuuu) +//VERSION_3_2 +GO(glFramebufferTexture, vFuuui) +GO(glGetBufferParameteri64v, vFuup) +GO(glGetInteger64i_v, vFuup) +//VERSION_3_3 +GO(glVertexAttribDivisor, vFuu) +//VERSION_4_0 +GO(glBlendEquationSeparatei, vFuuu) +GO(glBlendEquationi, vFuu) +GO(glBlendFuncSeparatei, vFuuuuu) +GO(glBlendFunci, vFuuu) +GO(glMinSampleShading, vFf) +//VERSION_4_3 +GO(glInvalidateNamedFramebuffer, vFiup) +//VERSION_4_4 +GO(glBindBuffersBase, vFuuip) +GOM(glBindBuffersRange, vFEuuippp) +GO(glBindImageTextures, vFuip) +GO(glBindSamplers, vFuip) +GO(glBindTextures, vFuip) +GOM(glBindVertexBuffers, vFEuippp) +GO(glBufferStorage, vFulpu) +GO(glClearTexImage, vFuiuup) +GO(glClearTexSubImage, vFuiiiiiiiuup) +//VERSION_4_5 +GO(glClipControl, vFuu) +GO(glCreateTransformFeedbacks, vFip) +GO(glTransformFeedbackBufferBase, vFuuu) +GO(glTransformFeedbackBufferRange, vFuuull) +GO(glGetTransformFeedbackiv, vFuup) +GO(glGetTransformFeedbacki_v, vFuuup) +GO(glGetTransformFeedbacki64_v, vFuuup) +GO(glCreateBuffers, vFip) +GO(glNamedBufferStorage, vFulpu) +GO(glNamedBufferStorageEXT, vFulpu) +GO(glNamedBufferData, vFulpu) +GO(glNamedBufferSubData, vFullp) +GO(glCopyNamedBufferSubData, vFuulll) +GO(glClearNamedBufferData, vFuuuup) +GO(glClearNamedBufferSubData, vFuulluup) +GO(glMapNamedBuffer, pFuu) +GO(glMapNamedBufferRange, pFullu) +GO(glUnmapNamedBuffer, CFu) +GO(glFlushMappedNamedBufferRange, vFull) +GO(glGetNamedBufferParameteriv, vFuup) +GO(glGetNamedBufferParameteri64v, vFuup) +GO(glGetNamedBufferPointerv, vFuuBp_) +GO(glGetNamedBufferSubData, vFullp) +GO(glCreateFramebuffers, vFip) +GO(glNamedFramebufferRenderbuffer, vFuuuu) +GO(glNamedFramebufferParameteri, vFuui) +GO(glNamedFramebufferTexture, vFuuui) +GO(glNamedFramebufferTextureLayer, vFuuuii) +GO(glNamedFramebufferDrawBuffer, vFuu) +GO(glNamedFramebufferDrawBuffers, vFuip) +GO(glNamedFramebufferReadBuffer, vFuu) +GO(glInvalidateNamedFramebufferData, vFuip) +GO(glInvalidateNamedFramebufferSubData, vFuipiiii) +GO(glClearNamedFramebufferiv, vFuuip) +GO(glClearNamedFramebufferuiv, vFuuip) +GO(glClearNamedFramebufferfv, vFuuip) +GO(glClearNamedFramebufferfi, vFuuifi) +GO(glBlitNamedFramebuffer, vFuuiiiiiiiiuu) +GO(glCheckNamedFramebufferStatus, uFuu) +GO(glGetNamedFramebufferParameteriv, vFuup) +GO(glGetNamedFramebufferAttachmentParameteriv, vFuuup) +GO(glCreateRenderbuffers, vFip) +GO(glNamedRenderbufferStorage, vFuuii) +GO(glNamedRenderbufferStorageMultisample, vFuiuii) +GO(glGetNamedRenderbufferParameteriv, vFuup) +GO(glCreateTextures, vFuip) +GO(glTextureBuffer, vFuuu) +GO(glTextureBufferRange, vFuuull) +GO(glTextureStorage1D, vFuiui) +GO(glTextureStorage2D, vFuiuii) +GO(glTextureStorage3D, vFuiuiii) +GO(glTextureStorage2DMultisample, vFuiuiiC) +GO(glTextureStorage3DMultisample, vFuiuiiiC) +GO(glTextureSubImage1D, vFuiiiuup) +GO(glTextureSubImage2D, vFuiiiiiuup) +GO(glTextureSubImage3D, vFuiiiiiiiuup) +GO(glCompressedTextureSubImage1D, vFuiiiuip) +GO(glCompressedTextureSubImage2D, vFuiiiiiuip) +GO(glCompressedTextureSubImage3D, vFuiiiiiiiuip) +GO(glCopyTextureSubImage1D, vFuiiiii) +GO(glCopyTextureSubImage2D, vFuiiiiiii) +GO(glCopyTextureSubImage3D, vFuiiiiiiii) +GO(glTextureParameterf, vFuuf) +GO(glTextureParameterfv, vFuup) +GO(glTextureParameteri, vFuui) +GO(glTextureParameterIiv, vFuup) +GO(glTextureParameterIuiv, vFuup) +GO(glTextureParameteriv, vFuup) +GO(glGenerateTextureMipmap, vFu) +GO(glBindTextureUnit, vFuu) +GO(glGetTextureImage, vFuiuuip) +GO(glGetCompressedTextureImage, vFuiip) +GO(glGetTextureLevelParameterfv, vFuiup) +GO(glGetTextureLevelParameteriv, vFuiup) +GO(glGetTextureParameterfv, vFuup) +GO(glGetTextureParameterIiv, vFuup) +GO(glGetTextureParameterIuiv, vFuup) +GO(glGetTextureParameteriv, vFuup) +GO(glCreateVertexArrays, vFip) +GO(glDisableVertexArrayAttrib, vFuu) +GO(glEnableVertexArrayAttrib, vFuu) +GO(glVertexArrayElementBuffer, vFuu) +GO(glVertexArrayVertexBuffer, vFuuuli) +GOM(glVertexArrayVertexBuffers, vFEuuippp) +GO(glVertexArrayAttribBinding, vFuuu) +GO(glVertexArrayAttribFormat, vFuuiuCu) +GO(glVertexArrayAttribIFormat, vFuuiuu) +GO(glVertexArrayAttribLFormat, vFuuiuu) +GO(glVertexArrayBindingDivisor, vFuuu) +GO(glGetVertexArrayiv, vFuup) +GO(glGetVertexArrayIndexediv, vFuuup) +GO(glGetVertexArrayIndexed64iv, vFuuup) +GO(glCreateSamplers, vFip) +GO(glCreateProgramPipelines, vFip) +GO(glTextureBarrier, vFv) +GO(glTextureParameteriiv, vFuip) +GO(glTextureParameteriuiv, vFuip) +GO(glCreateQueries, vFuip) +GO(glGetQueryBufferObjecti64v, vFuuul) +GO(glGetQueryBufferObjectiv, vFuuul) +GO(glGetQueryBufferObjectui64v, vFuuul) +GO(glGetQueryBufferObjectuiv, vFuuul) +GO(glMemoryBarrierByRegion, vFu) +GO(glGetTextureSubImage, vFuiiiiiiiuuip) +GO(glGetCompressedTextureSubImage, vFuiiiiiiiip) +GO(glGetGraphicsResetStatus, uFv) +GO(glGetnUniformfv, vFuiip) +GO(glGetnUniformiv, vFuiip) +GO(glGetnUniformuiv, vFuiip) +GO(glReadnPixels, vFiiiiuuip) +//VERSION_4_6 +GO(glSpecializeShader, vFupupp) + +GO(glTexturePageCommitmentEXT, vFuiiiiiiiC) +GO(glVertexArrayVertexAttribDivisorEXT, vFuuu) + +// _fini +//3DFX_tbuffer +GO(glTbufferMask3DFX, vFu) +//AMD_debug_output +GOM(glDebugMessageCallbackAMD, vFEpp) +GO(glDebugMessageEnableAMD, vFuuipC) +GO(glDebugMessageInsertAMD, vFuuuip) +GO(glGetDebugMessageLogAMD, uFuippppp) +//AMD_draw_buffers_blend +GO(glBlendEquationIndexedAMD, vFuu) +GO(glBlendEquationSeparateIndexedAMD, vFuuu) +GO(glBlendFuncIndexedAMD, vFuuu) +GO(glBlendFuncSeparateIndexedAMD, vFuuuuu) +//AMD_multi_draw_indirect +GO(glMultiDrawArraysIndirectAMD, vFupii) +GO(glMultiDrawElementsIndirectAMD, vFuupii) +//AMD_name_gen_delete +GO(glDeleteNamesAMD, vFuup) +GO(glGenNamesAMD, vFuup) +GO(glIsNameAMD, CFuu) +//AMD_performance_monitor +GO(glBeginPerfMonitorAMD, vFu) +GO(glDeletePerfMonitorsAMD, vFip) +GO(glEndPerfMonitorAMD, vFu) +GO(glGenPerfMonitorsAMD, vFip) +GO(glGetPerfMonitorCounterDataAMD, vFuuipp) +GO(glGetPerfMonitorCounterInfoAMD, vFuuup) +GO(glGetPerfMonitorCounterStringAMD, vFuuipp) +GO(glGetPerfMonitorCountersAMD, vFuppip) +GO(glGetPerfMonitorGroupStringAMD, vFuipp) +GO(glGetPerfMonitorGroupsAMD, vFpip) +GO(glSelectPerfMonitorCountersAMD, vFuCuip) +//AMD_sample_positions +GO(glSetMultisamplefvAMD, vFuup) +//AMD_sparse_texture +GO(glTexStorageSparseAMD, vFuuiiiiu) +GO(glTextureStorageSparseAMD, vFuuuiiiiu) +//AMD_stencil_operation_extended +GO(glStencilOpValueAMD, vFuu) +//AMD_vertex_shader_tessellator +GO(glTessellationFactorAMD, vFf) +GO(glTessellationModeAMD, vFu) +//APPLE_element_array +GO(glDrawElementArrayAPPLE, vFuii) +GO(glDrawRangeElementArrayAPPLE, vFuuuii) +GO(glElementPointerAPPLE, vFup) +GO(glMultiDrawElementArrayAPPLE, vFuppi) +GO(glMultiDrawRangeElementArrayAPPLE, vFuuuppi) +//APPLE_fence +GO(glDeleteFencesAPPLE, vFip) +GO(glFinishFenceAPPLE, vFu) +GO(glFinishObjectAPPLE, vFui) +GO(glGenFencesAPPLE, vFip) +GO(glIsFenceAPPLE, CFu) +GO(glSetFenceAPPLE, vFu) +GO(glTestFenceAPPLE, CFu) +GO(glTestObjectAPPLE, CFuu) +//APPLE_flush_buffer_range +GO(glBufferParameteriAPPLE, vFuui) +GO(glFlushMappedBufferRangeAPPLE, vFull) +//APPLE_object_purgeable +GO(glGetObjectParameterivAPPLE, vFuuup) +GO(glObjectPurgeableAPPLE, uFuuu) +GO(glObjectUnpurgeableAPPLE, uFuuu) +//APPLE_texture_range +GO(glGetTexParameterPointervAPPLE, vFuuBp_) +GO(glTextureRangeAPPLE, vFuip) +//APPLE_vertex_array_object +GO(glBindVertexArrayAPPLE, vFu) +GO(glDeleteVertexArraysAPPLE, vFip) +GO(glGenVertexArraysAPPLE, vFip) +GO(glIsVertexArrayAPPLE, CFu) +//APPLE_vertex_array_range +GO(glFlushVertexArrayRangeAPPLE, vFip) +GO(glVertexArrayParameteriAPPLE, vFui) +GO(glVertexArrayRangeAPPLE, vFip) +//APPLE_vertex_program_evaluators +GO(glDisableVertexAttribAPPLE, vFuu) +GO(glEnableVertexAttribAPPLE, vFuu) +GO(glIsVertexAttribEnabledAPPLE, CFuu) +GO(glMapVertexAttrib1dAPPLE, vFuuddiip) +GO(glMapVertexAttrib1fAPPLE, vFuuffiip) +GO(glMapVertexAttrib2dAPPLE, vFuuddiiddiip) +GO(glMapVertexAttrib2fAPPLE, vFuuffiiffiip) +//ARB_ES2_compatibility +GO(glClearDepthf, vFf) +GO(glDepthRangef, vFff) +GO(glGetShaderPrecisionFormat, vFuupp) +GO(glReleaseShaderCompiler, vFv) +GO(glShaderBinary, vFipupi) +//ARB_base_instance +GO(glDrawArraysInstancedBaseInstance, vFuiiiu) +GO(glDrawElementsInstancedBaseInstance, vFuiupiu) +GO(glDrawElementsInstancedBaseVertexBaseInstance, vFuiupiiu) +//ARB_blend_func_extended +GO(glBindFragDataLocationIndexed, vFuuup) +GO(glGetFragDataIndex, iFup) +//ARB_cl_event +GO(glCreateSyncFromCLeventARB, pFppu) +//ARB_clear_buffer_object +GO(glClearBufferData, vFuuuup) +GO(glClearBufferSubData, vFuulluup) +GO(glClearNamedBufferDataEXT, vFuuuup) +GO(glClearNamedBufferSubDataEXT, vFuulluup) +//ARB_color_buffer_float +GO(glClampColorARB, vFuu) +//ARB_compute_shader +GO(glDispatchCompute, vFuuu) +GO(glDispatchComputeIndirect, vFl) +//ARB_copy_buffer +GO(glCopyBufferSubData, vFuulll) +//ARB_copy_image +GO(glCopyImageSubData, vFuuiiiiuuiiiiiii) +//ARB_debug_output +GOM(glDebugMessageCallbackARB, vFEpp) +GO(glDebugMessageControlARB, vFuuuipC) +GO(glDebugMessageInsertARB, vFuuuuip) +GO(glGetDebugMessageLogARB, uFuipppppp) +//ARB_draw_buffers +GO(glDrawBuffersARB, vFip) +//ARB_draw_buffers_blend +GO(glBlendEquationSeparateiARB, vFuuu) +GO(glBlendEquationiARB, vFuu) +GO(glBlendFuncSeparateiARB, vFuuuuu) +GO(glBlendFunciARB, vFuuu) +//ARB_draw_elements_base_vertex +GO(glDrawElementsBaseVertex, vFuiupi) +GO(glDrawElementsInstancedBaseVertex, vFuiupii) +GO(glDrawRangeElementsBaseVertex, vFuuuiupi) +GOM(glMultiDrawElementsBaseVertex, vFEupupip) +//ARB_draw_indirect +GO(glDrawArraysIndirect, vFup) +GO(glDrawElementsIndirect, vFuup) +//ARB_draw_instanced +GO(glDrawArraysInstancedARB, vFuiii) +GO(glDrawElementsInstancedARB, vFuiupi) +//ARB_framebuffer_no_attachments +GO(glFramebufferParameteri, vFuui) +GO(glGetFramebufferParameteriv, vFuup) +GO(glGetNamedFramebufferParameterivEXT, vFuup) +GO(glNamedFramebufferParameteriEXT, vFuui) +//ARB_framebuffer_object +GO(glBindFramebuffer, vFuu) +GO(glBindRenderbuffer, vFuu) +GO(glBlitFramebuffer, vFiiiiiiiiuu) +GO(glCheckFramebufferStatus, uFu) +GO(glDeleteFramebuffers, vFip) +GO(glDeleteRenderbuffers, vFip) +GO(glFramebufferRenderbuffer, vFuuuu) +GO(glFramebufferTexture1D, vFuuuui) +GO(glFramebufferTexture2D, vFuuuui) +GO(glFramebufferTexture3D, vFuuuuii) +GO(glFramebufferTextureLayer, vFuuuii) +GO(glGenFramebuffers, vFip) +GO(glGenRenderbuffers, vFip) +GO(glGenerateMipmap, vFu) +GO(glGetFramebufferAttachmentParameteriv, vFuuup) +GO(glGetRenderbufferParameteriv, vFuup) +GO(glIsFramebuffer, CFu) +GO(glIsRenderbuffer, CFu) +GO(glRenderbufferStorage, vFuuii) +GO(glRenderbufferStorageMultisample, vFuiuii) +//ARB_geometry_shader4 +GO(glFramebufferTextureARB, vFuuui) +GO(glFramebufferTextureFaceARB, vFuuuiu) +GO(glFramebufferTextureLayerARB, vFuuuii) +GO(glProgramParameteriARB, vFuui) +//ARB_get_program_binary +GO(glGetProgramBinary, vFuippp) +GO(glProgramBinary, vFuupi) +GO(glProgramParameteri, vFuui) +//ARB_gpu_shader_fp64 +GO(glGetUniformdv, vFuip) +GO(glUniform1d, vFid) +GO(glUniform1dv, vFiip) +GO(glUniform2d, vFidd) +GO(glUniform2dv, vFiip) +GO(glUniform3d, vFiddd) +GO(glUniform3dv, vFiip) +GO(glUniform4d, vFidddd) +GO(glUniform4dv, vFiip) +GO(glUniformMatrix2dv, vFiiCp) +GO(glUniformMatrix2x3dv, vFiiCp) +GO(glUniformMatrix2x4dv, vFiiCp) +GO(glUniformMatrix3dv, vFiiCp) +GO(glUniformMatrix3x2dv, vFiiCp) +GO(glUniformMatrix3x4dv, vFiiCp) +GO(glUniformMatrix4dv, vFiiCp) +GO(glUniformMatrix4x2dv, vFiiCp) +GO(glUniformMatrix4x3dv, vFiiCp) +//ARB_instanced_arrays +GO(glVertexAttribDivisorARB, vFuu) +//ARB_internalformat_query +GO(glGetInternalformativ, vFuuuip) +//ARB_internalformat_query2 +GO(glGetInternalformati64v, vFuuuip) +//ARB_invalidate_subdata +GO(glInvalidateBufferData, vFu) +GO(glInvalidateBufferSubData, vFull) +GO(glInvalidateFramebuffer, vFuip) +GO(glInvalidateSubFramebuffer, vFuipiiii) +GO(glInvalidateTexImage, vFui) +GO(glInvalidateTexSubImage, vFuiiiiiii) +//ARB_map_buffer_range +GO(glFlushMappedBufferRange, vFull) +GO(glMapBufferRange, pFullu) +//ARB_matrix_palette +GO(glCurrentPaletteMatrixARB, vFi) +GO(glMatrixIndexPointerARB, vFiuip) +GO(glMatrixIndexubvARB, vFip) +GO(glMatrixIndexuivARB, vFip) +GO(glMatrixIndexusvARB, vFip) +//ARB_multi_draw_indirect +GO(glMultiDrawArraysIndirect, vFupii) +GO(glMultiDrawElementsIndirect, vFuupii) +//ARB_multisample +GO(glSampleCoverageARB, vFfC) +//ARB_multitexture +GO(glActiveTextureARB, vFu) +GO(glClientActiveTextureARB, vFu) +GO(glMultiTexCoord1dARB, vFud) +GO(glMultiTexCoord1dvARB, vFup) +GO(glMultiTexCoord1fARB, vFuf) +GO(glMultiTexCoord1fvARB, vFup) +GO(glMultiTexCoord1iARB, vFui) +GO(glMultiTexCoord1ivARB, vFup) +GO(glMultiTexCoord1sARB, vFuw) +GO(glMultiTexCoord1svARB, vFup) +GO(glMultiTexCoord2dARB, vFudd) +GO(glMultiTexCoord2dvARB, vFup) +GO(glMultiTexCoord2fARB, vFuff) +GO(glMultiTexCoord2fvARB, vFup) +GO(glMultiTexCoord2iARB, vFuii) +GO(glMultiTexCoord2ivARB, vFup) +GO(glMultiTexCoord2sARB, vFuww) +GO(glMultiTexCoord2svARB, vFup) +GO(glMultiTexCoord3dARB, vFuddd) +GO(glMultiTexCoord3dvARB, vFup) +GO(glMultiTexCoord3fARB, vFufff) +GO(glMultiTexCoord3fvARB, vFup) +GO(glMultiTexCoord3iARB, vFuiii) +GO(glMultiTexCoord3ivARB, vFup) +GO(glMultiTexCoord3sARB, vFuwww) +GO(glMultiTexCoord3svARB, vFup) +GO(glMultiTexCoord4dARB, vFudddd) +GO(glMultiTexCoord4dvARB, vFup) +GO(glMultiTexCoord4fARB, vFuffff) +GO(glMultiTexCoord4fvARB, vFup) +GO(glMultiTexCoord4iARB, vFuiiii) +GO(glMultiTexCoord4ivARB, vFup) +GO(glMultiTexCoord4sARB, vFuwwww) +GO(glMultiTexCoord4svARB, vFup) +//ARB_occlusion_query +GO(glBeginQueryARB, vFuu) +GO(glDeleteQueriesARB, vFip) +GO(glEndQueryARB, vFu) +GO(glGenQueriesARB, vFip) +GO(glGetQueryObjectivARB, vFuup) +GO(glGetQueryObjectuivARB, vFuup) +GO(glGetQueryivARB, vFuup) +GO(glIsQueryARB, CFu) +//ARB_point_parameters +GO(glPointParameterfARB, vFuf) +GO(glPointParameterfvARB, vFup) +//ARB_program_interface_query +GO(glGetProgramInterfaceiv, vFuuup) +GO(glGetProgramResourceIndex, uFuup) +GO(glGetProgramResourceLocation, iFuup) +GO(glGetProgramResourceLocationIndex, iFuup) +GO(glGetProgramResourceName, vFuuuipp) +GO(glGetProgramResourceiv, vFuuuipipp) +//ARB_provoking_vertex +GO(glProvokingVertex, vFu) +//ARB_robustness +GO(glGetGraphicsResetStatusARB, uFv) +GO(glGetnColorTableARB, vFuuuip) +GO(glGetnCompressedTexImageARB, vFuiip) +GO(glGetnConvolutionFilterARB, vFuuuip) +GO(glGetnHistogramARB, vFuCuuip) +GO(glGetnMapdvARB, vFuuip) +GO(glGetnMapfvARB, vFuuip) +GO(glGetnMapivARB, vFuuip) +GO(glGetnMinmaxARB, vFuCuuip) +GO(glGetnPixelMapfvARB, vFuip) +GO(glGetnPixelMapuivARB, vFuip) +GO(glGetnPixelMapusvARB, vFuip) +GO(glGetnPolygonStippleARB, vFip) +GO(glGetnSeparableFilterARB, vFuuuipipp) +GO(glGetnTexImageARB, vFuiuuip) +GO(glGetnUniformdvARB, vFuiip) +GO(glGetnUniformfvARB, vFuiip) +GO(glGetnUniformivARB, vFuiip) +GO(glGetnUniformuivARB, vFuiip) +GO(glReadnPixelsARB, vFiiiiuuip) +//ARB_sample_shading +GO(glMinSampleShadingARB, vFf) +//ARB_sampler_objects +GO(glBindSampler, vFuu) +GO(glDeleteSamplers, vFip) +GO(glGenSamplers, vFip) +GO(glGetSamplerParameterIiv, vFuup) +GO(glGetSamplerParameterIuiv, vFuup) +GO(glGetSamplerParameterfv, vFuup) +GO(glGetSamplerParameteriv, vFuup) +GO(glIsSampler, CFu) +GO(glSamplerParameterIiv, vFuup) +GO(glSamplerParameterIuiv, vFuup) +GO(glSamplerParameterf, vFuuf) +GO(glSamplerParameterfv, vFuup) +GO(glSamplerParameteri, vFuui) +GO(glSamplerParameteriv, vFuup) +//ARB_separate_shader_objects +GO(glActiveShaderProgram, vFuu) +GO(glBindProgramPipeline, vFu) +GOM(glCreateShaderProgramv, uFEuip) +GO(glDeleteProgramPipelines, vFip) +GO(glGenProgramPipelines, vFip) +GO(glGetProgramPipelineInfoLog, vFuipp) +GO(glGetProgramPipelineiv, vFuup) +GO(glIsProgramPipeline, CFu) +GO(glProgramUniform1d, vFuid) +GO(glProgramUniform1dv, vFuiip) +GO(glProgramUniform1f, vFuif) +GO(glProgramUniform1fv, vFuiip) +GO(glProgramUniform1i, vFuii) +GO(glProgramUniform1iv, vFuiip) +GO(glProgramUniform1ui, vFuiu) +GO(glProgramUniform1uiv, vFuiip) +GO(glProgramUniform2d, vFuidd) +GO(glProgramUniform2dv, vFuiip) +GO(glProgramUniform2f, vFuiff) +GO(glProgramUniform2fv, vFuiip) +GO(glProgramUniform2i, vFuiii) +GO(glProgramUniform2iv, vFuiip) +GO(glProgramUniform2ui, vFuiuu) +GO(glProgramUniform2uiv, vFuiip) +GO(glProgramUniform3d, vFuiddd) +GO(glProgramUniform3dv, vFuiip) +GO(glProgramUniform3f, vFuifff) +GO(glProgramUniform3fv, vFuiip) +GO(glProgramUniform3i, vFuiiii) +GO(glProgramUniform3iv, vFuiip) +GO(glProgramUniform3ui, vFuiuuu) +GO(glProgramUniform3uiv, vFuiip) +GO(glProgramUniform4d, vFuidddd) +GO(glProgramUniform4dv, vFuiip) +GO(glProgramUniform4f, vFuiffff) +GO(glProgramUniform4fv, vFuiip) +GO(glProgramUniform4i, vFuiiiii) +GO(glProgramUniform4iv, vFuiip) +GO(glProgramUniform4ui, vFuiuuuu) +GO(glProgramUniform4uiv, vFuiip) +GO(glProgramUniformMatrix2dv, vFuiiCp) +GO(glProgramUniformMatrix2fv, vFuiiCp) +GO(glProgramUniformMatrix2x3dv, vFuiiCp) +GO(glProgramUniformMatrix2x3fv, vFuiiCp) +GO(glProgramUniformMatrix2x4dv, vFuiiCp) +GO(glProgramUniformMatrix2x4fv, vFuiiCp) +GO(glProgramUniformMatrix3dv, vFuiiCp) +GO(glProgramUniformMatrix3fv, vFuiiCp) +GO(glProgramUniformMatrix3x2dv, vFuiiCp) +GO(glProgramUniformMatrix3x2fv, vFuiiCp) +GO(glProgramUniformMatrix3x4dv, vFuiiCp) +GO(glProgramUniformMatrix3x4fv, vFuiiCp) +GO(glProgramUniformMatrix4dv, vFuiiCp) +GO(glProgramUniformMatrix4fv, vFuiiCp) +GO(glProgramUniformMatrix4x2dv, vFuiiCp) +GO(glProgramUniformMatrix4x2fv, vFuiiCp) +GO(glProgramUniformMatrix4x3dv, vFuiiCp) +GO(glProgramUniformMatrix4x3fv, vFuiiCp) +GO(glUseProgramStages, vFuuu) +GO(glValidateProgramPipeline, vFu) +//ARB_shader_atomic_counters +GO(glGetActiveAtomicCounterBufferiv, vFuuup) +//ARB_shader_image_load_store +GO(glBindImageTexture, vFuuiCiuu) +GO(glMemoryBarrier, vFu) +//ARB_shader_objects +GO(glAttachObjectARB, vFuu) +GO(glCompileShaderARB, vFu) +GO(glCreateProgramObjectARB, uFv) +GO(glCreateShaderObjectARB, uFu) +GO(glDeleteObjectARB, vFu) +GO(glDetachObjectARB, vFuu) +GO(glGetActiveUniformARB, vFuuipppp) +GO(glGetAttachedObjectsARB, vFuipp) +GO(glGetHandleARB, uFu) +GO(glGetInfoLogARB, vFuipp) +GO(glGetObjectParameterfvARB, vFuup) +GO(glGetObjectParameterivARB, vFuup) +GO(glGetShaderSourceARB, vFuipp) +GO(glGetUniformLocationARB, iFup) +GO(glGetUniformfvARB, vFuip) +GO(glGetUniformivARB, vFuip) +GO(glLinkProgramARB, vFu) +GOM(glShaderSourceARB, vFEuipp) +GO(glUniform1fARB, vFif) +GO(glUniform1fvARB, vFiip) +GO(glUniform1iARB, vFii) +GO(glUniform1ivARB, vFiip) +GO(glUniform2fARB, vFiff) +GO(glUniform2fvARB, vFiip) +GO(glUniform2iARB, vFiii) +GO(glUniform2ivARB, vFiip) +GO(glUniform3fARB, vFifff) +GO(glUniform3fvARB, vFiip) +GO(glUniform3iARB, vFiiii) +GO(glUniform3ivARB, vFiip) +GO(glUniform4fARB, vFiffff) +GO(glUniform4fvARB, vFiip) +GO(glUniform4iARB, vFiiiii) +GO(glUniform4ivARB, vFiip) +GO(glUniformMatrix2fvARB, vFiiCp) +GO(glUniformMatrix3fvARB, vFiiCp) +GO(glUniformMatrix4fvARB, vFiiCp) +GO(glUseProgramObjectARB, vFu) +GO(glValidateProgramARB, vFu) +//ARB_shader_storage_buffer_object +GO(glShaderStorageBlockBinding, vFuuu) +//ARB_shader_subroutine +GO(glGetActiveSubroutineName, vFuuuipp) +GO(glGetActiveSubroutineUniformName, vFuuuipp) +GO(glGetActiveSubroutineUniformiv, vFuuuup) +GO(glGetProgramStageiv, vFuuup) +GO(glGetSubroutineIndex, uFuup) +GO(glGetSubroutineUniformLocation, iFuup) +GO(glGetUniformSubroutineuiv, vFuip) +GO(glUniformSubroutinesuiv, vFuip) +//ARB_shading_language_include +GOM(glCompileShaderIncludeARB, vFEuipp) +GO(glDeleteNamedStringARB, vFip) +GO(glGetNamedStringARB, vFipipp) +GO(glGetNamedStringivARB, vFipup) +GO(glIsNamedStringARB, CFip) +GO(glNamedStringARB, vFuipip) +//ARB_sync +GO(glClientWaitSync, uFpuU) +GO(glDeleteSync, vFp) +GO(glFenceSync, pFuu) +GO(glGetInteger64v, vFup) +GO(glGetSynciv, vFpuipp) +GO(glIsSync, CFp) +GO(glWaitSync, vFpuU) +//ARB_tessellation_shader +GO(glPatchParameterfv, vFup) +GO(glPatchParameteri, vFui) +//ARB_texture_buffer_object +GO(glTexBufferARB, vFuuu) +//ARB_texture_buffer_range +GO(glTexBufferRange, vFuuull) +GO(glTextureBufferRangeEXT, vFuuuull) +//ARB_texture_compression +GO(glCompressedTexImage1DARB, vFuiuiiip) +GO(glCompressedTexImage2DARB, vFuiuiiiip) +GO(glCompressedTexImage3DARB, vFuiuiiiiip) +GO(glCompressedTexSubImage1DARB, vFuiiiuip) +GO(glCompressedTexSubImage2DARB, vFuiiiiiuip) +GO(glCompressedTexSubImage3DARB, vFuiiiiiiiuip) +GO(glGetCompressedTexImageARB, vFuip) +//ARB_texture_multisample +GO(glGetMultisamplefv, vFuup) +GO(glSampleMaski, vFuu) +GO(glTexImage2DMultisample, vFuiuiiC) +GO(glTexImage3DMultisample, vFuiuiiiC) +//ARB_texture_storage +GO(glTexStorage1D, vFuiui) +GO(glTexStorage2D, vFuiuii) +GO(glTexStorage3D, vFuiuiii) +GO(glTextureStorage1DEXT, vFuuiui) +GO(glTextureStorage2DEXT, vFuuiuii) +GO(glTextureStorage3DEXT, vFuuiuiii) +//ARB_texture_storage_multisample +GO(glTexStorage2DMultisample, vFuiuiiC) +GO(glTexStorage3DMultisample, vFuiuiiiC) +GO(glTextureStorage2DMultisampleEXT, vFuuiuiiC) +GO(glTextureStorage3DMultisampleEXT, vFuuiuiiiC) +//ARB_texture_view +GO(glTextureView, vFuuuuuuuu) +//ARB_timer_query +GO(glGetQueryObjecti64v, vFuup) +GO(glGetQueryObjectui64v, vFuup) +GO(glQueryCounter, vFuu) +//ARB_transform_feedback2 +GO(glBindTransformFeedback, vFuu) +GO(glDeleteTransformFeedbacks, vFip) +GO(glDrawTransformFeedback, vFuu) +GO(glGenTransformFeedbacks, vFip) +GO(glIsTransformFeedback, CFu) +GO(glPauseTransformFeedback, vFv) +GO(glResumeTransformFeedback, vFv) +//ARB_transform_feedback3 +GO(glBeginQueryIndexed, vFuuu) +GO(glDrawTransformFeedbackStream, vFuuu) +GO(glEndQueryIndexed, vFuu) +GO(glGetQueryIndexediv, vFuuup) +//ARB_transform_feedback_instanced +GO(glDrawTransformFeedbackInstanced, vFuui) +GO(glDrawTransformFeedbackStreamInstanced, vFuuui) +//ARB_transpose_matrix +GO(glLoadTransposeMatrixdARB, vFp) +GO(glLoadTransposeMatrixfARB, vFp) +GO(glMultTransposeMatrixdARB, vFp) +GO(glMultTransposeMatrixfARB, vFp) +//ARB_uniform_buffer_object +GO(glGetActiveUniformBlockName, vFuuipp) +GO(glGetActiveUniformBlockiv, vFuuup) +GO(glGetActiveUniformName, vFuuipp) +GO(glGetActiveUniformsiv, vFuipup) +GO(glGetUniformBlockIndex, uFup) +GOM(glGetUniformIndices, vFEuipp) +GO(glUniformBlockBinding, vFuuu) +//ARB_vertex_array_object +GO(glBindVertexArray, vFu) +GO(glDeleteVertexArrays, vFip) +GO(glGenVertexArrays, vFip) +GO(glIsVertexArray, CFu) +//ARB_vertex_attrib_64bit +GO(glGetVertexAttribLdv, vFuup) +GO(glVertexAttribL1d, vFud) +GO(glVertexAttribL1dv, vFup) +GO(glVertexAttribL2d, vFudd) +GO(glVertexAttribL2dv, vFup) +GO(glVertexAttribL3d, vFuddd) +GO(glVertexAttribL3dv, vFup) +GO(glVertexAttribL4d, vFudddd) +GO(glVertexAttribL4dv, vFup) +GO(glVertexAttribLPointer, vFuiuip) +//ARB_vertex_attrib_binding +GO(glBindVertexBuffer, vFuuli) +GO(glVertexArrayBindVertexBufferEXT, vFuuuli) +GO(glVertexArrayVertexAttribBindingEXT, vFuuu) +GO(glVertexArrayVertexAttribFormatEXT, vFuuiuCu) +GO(glVertexArrayVertexAttribIFormatEXT, vFuuiuu) +GO(glVertexArrayVertexAttribLFormatEXT, vFuuiuu) +GO(glVertexArrayVertexBindingDivisorEXT, vFuuu) +GO(glVertexAttribBinding, vFuu) +GO(glVertexAttribFormat, vFuiuCu) +GO(glVertexAttribIFormat, vFuiuu) +GO(glVertexAttribLFormat, vFuiuu) +GO(glVertexBindingDivisor, vFuu) +//ARB_vertex_blend +GO(glVertexBlendARB, vFi) +GO(glWeightPointerARB, vFiuip) +GO(glWeightbvARB, vFip) +GO(glWeightdvARB, vFip) +GO(glWeightfvARB, vFip) +GO(glWeightivARB, vFip) +GO(glWeightsvARB, vFip) +GO(glWeightubvARB, vFip) +GO(glWeightuivARB, vFip) +GO(glWeightusvARB, vFip) +//ARB_vertex_buffer_object +GO(glBindBufferARB, vFuu) +GO(glBufferDataARB, vFulpu) +GO(glBufferSubDataARB, vFullp) +GO(glDeleteBuffersARB, vFip) +GO(glGenBuffersARB, vFip) +GO(glGetBufferParameterivARB, vFuup) +GO(glGetBufferPointervARB, vFuubp_) +GO(glGetBufferSubDataARB, vFullp) +GO(glIsBufferARB, CFu) +GO(glMapBufferARB, pFuu) +GO(glUnmapBufferARB, CFu) +//ARB_vertex_program +GO(glBindProgramARB, vFuu) +GO(glDeleteProgramsARB, vFip) +GO(glDisableVertexAttribArrayARB, vFu) +GO(glEnableVertexAttribArrayARB, vFu) +GO(glGenProgramsARB, vFip) +GO(glGetProgramEnvParameterdvARB, vFuup) +GO(glGetProgramEnvParameterfvARB, vFuup) +GO(glGetProgramLocalParameterdvARB, vFuup) +GO(glGetProgramLocalParameterfvARB, vFuup) +GO(glGetProgramStringARB, vFuup) +GO(glGetProgramivARB, vFuup) +GO(glGetVertexAttribPointervARB, vFuuBp_) +GO(glGetVertexAttribdvARB, vFuup) +GO(glGetVertexAttribfvARB, vFuup) +GO(glGetVertexAttribivARB, vFuup) +GO(glIsProgramARB, CFu) +GO(glProgramEnvParameter4dARB, vFuudddd) +GO(glProgramEnvParameter4dvARB, vFuup) +GO(glProgramEnvParameter4fARB, vFuuffff) +GO(glProgramEnvParameter4fvARB, vFuup) +GO(glProgramLocalParameter4dARB, vFuudddd) +GO(glProgramLocalParameter4dvARB, vFuup) +GO(glProgramLocalParameter4fARB, vFuuffff) +GO(glProgramLocalParameter4fvARB, vFuup) +GO(glProgramStringARB, vFuuip) +GO(glVertexAttrib1dARB, vFud) +GO(glVertexAttrib1dvARB, vFup) +GO(glVertexAttrib1fARB, vFuf) +GO(glVertexAttrib1fvARB, vFup) +GO(glVertexAttrib1sARB, vFuw) +GO(glVertexAttrib1svARB, vFup) +GO(glVertexAttrib2dARB, vFudd) +GO(glVertexAttrib2dvARB, vFup) +GO(glVertexAttrib2fARB, vFuff) +GO(glVertexAttrib2fvARB, vFup) +GO(glVertexAttrib2sARB, vFuww) +GO(glVertexAttrib2svARB, vFup) +GO(glVertexAttrib3dARB, vFuddd) +GO(glVertexAttrib3dvARB, vFup) +GO(glVertexAttrib3fARB, vFufff) +GO(glVertexAttrib3fvARB, vFup) +GO(glVertexAttrib3sARB, vFuwww) +GO(glVertexAttrib3svARB, vFup) +GO(glVertexAttrib4NbvARB, vFup) +GO(glVertexAttrib4NivARB, vFup) +GO(glVertexAttrib4NsvARB, vFup) +GO(glVertexAttrib4NubARB, vFuCCCC) +GO(glVertexAttrib4NubvARB, vFup) +GO(glVertexAttrib4NuivARB, vFup) +GO(glVertexAttrib4NusvARB, vFup) +GO(glVertexAttrib4bvARB, vFup) +GO(glVertexAttrib4dARB, vFudddd) +GO(glVertexAttrib4dvARB, vFup) +GO(glVertexAttrib4fARB, vFuffff) +GO(glVertexAttrib4fvARB, vFup) +GO(glVertexAttrib4ivARB, vFup) +GO(glVertexAttrib4sARB, vFuwwww) +GO(glVertexAttrib4svARB, vFup) +GO(glVertexAttrib4ubvARB, vFup) +GO(glVertexAttrib4uivARB, vFup) +GO(glVertexAttrib4usvARB, vFup) +GO(glVertexAttribPointerARB, vFuiuCip) +//ARB_vertex_shader +GO(glBindAttribLocationARB, vFuup) +GO(glGetActiveAttribARB, vFuuipppp) +GO(glGetAttribLocationARB, iFup) +//ARB_vertex_type_2_10_10_10_rev +GO(glColorP3ui, vFuu) +GO(glColorP3uiv, vFup) +GO(glColorP4ui, vFuu) +GO(glColorP4uiv, vFup) +GO(glMultiTexCoordP1ui, vFuuu) +GO(glMultiTexCoordP1uiv, vFuup) +GO(glMultiTexCoordP2ui, vFuuu) +GO(glMultiTexCoordP2uiv, vFuup) +GO(glMultiTexCoordP3ui, vFuuu) +GO(glMultiTexCoordP3uiv, vFuup) +GO(glMultiTexCoordP4ui, vFuuu) +GO(glMultiTexCoordP4uiv, vFuup) +GO(glNormalP3ui, vFuu) +GO(glNormalP3uiv, vFup) +GO(glSecondaryColorP3ui, vFuu) +GO(glSecondaryColorP3uiv, vFup) +GO(glTexCoordP1ui, vFuu) +GO(glTexCoordP1uiv, vFup) +GO(glTexCoordP2ui, vFuu) +GO(glTexCoordP2uiv, vFup) +GO(glTexCoordP3ui, vFuu) +GO(glTexCoordP3uiv, vFup) +GO(glTexCoordP4ui, vFuu) +GO(glTexCoordP4uiv, vFup) +GO(glVertexAttribP1ui, vFuuCu) +GO(glVertexAttribP1uiv, vFuuCp) +GO(glVertexAttribP2ui, vFuuCu) +GO(glVertexAttribP2uiv, vFuuCp) +GO(glVertexAttribP3ui, vFuuCu) +GO(glVertexAttribP3uiv, vFuuCp) +GO(glVertexAttribP4ui, vFuuCu) +GO(glVertexAttribP4uiv, vFuuCp) +GO(glVertexP2ui, vFuu) +GO(glVertexP2uiv, vFup) +GO(glVertexP3ui, vFuu) +GO(glVertexP3uiv, vFup) +GO(glVertexP4ui, vFuu) +GO(glVertexP4uiv, vFup) +//ARB_viewport_array +GO(glDepthRangeArrayv, vFuip) +GO(glDepthRangeIndexed, vFudd) +GO(glGetDoublei_v, vFuup) +GO(glGetFloati_v, vFuup) +GO(glScissorArrayv, vFuip) +GO(glScissorIndexed, vFuiiii) +GO(glScissorIndexedv, vFup) +GO(glViewportArrayv, vFuip) +GO(glViewportIndexedf, vFuffff) +GO(glViewportIndexedfv, vFup) +//ARB_window_pos +GO(glWindowPos2dARB, vFdd) +GO(glWindowPos2dvARB, vFp) +GO(glWindowPos2fARB, vFff) +GO(glWindowPos2fvARB, vFp) +GO(glWindowPos2iARB, vFii) +GO(glWindowPos2ivARB, vFp) +GO(glWindowPos2sARB, vFww) +GO(glWindowPos2svARB, vFp) +GO(glWindowPos3dARB, vFddd) +GO(glWindowPos3dvARB, vFp) +GO(glWindowPos3fARB, vFfff) +GO(glWindowPos3fvARB, vFp) +GO(glWindowPos3iARB, vFiii) +GO(glWindowPos3ivARB, vFp) +GO(glWindowPos3sARB, vFwww) +GO(glWindowPos3svARB, vFp) +//ATI_draw_buffers +GO(glDrawBuffersATI, vFip) +//ATI_element_array +GO(glDrawElementArrayATI, vFui) +GO(glDrawRangeElementArrayATI, vFuuui) +GO(glElementPointerATI, vFup) +//ATI_envmap_bumpmap +GO(glGetTexBumpParameterfvATI, vFup) +GO(glGetTexBumpParameterivATI, vFup) +GO(glTexBumpParameterfvATI, vFup) +GO(glTexBumpParameterivATI, vFup) +//ATI_fragment_shader +GO(glAlphaFragmentOp1ATI, vFuuuuuu) +GO(glAlphaFragmentOp2ATI, vFuuuuuuuuu) +GO(glAlphaFragmentOp3ATI, vFuuuuuuuuuuuu) +GO(glBeginFragmentShaderATI, vFv) +GO(glBindFragmentShaderATI, vFu) +GO(glColorFragmentOp1ATI, vFuuuuuuu) +GO(glColorFragmentOp2ATI, vFuuuuuuuuuu) +GO(glColorFragmentOp3ATI, vFuuuuuuuuuuuuu) +GO(glDeleteFragmentShaderATI, vFu) +GO(glEndFragmentShaderATI, vFv) +GO(glGenFragmentShadersATI, uFu) +GO(glPassTexCoordATI, vFuuu) +GO(glSampleMapATI, vFuuu) +GO(glSetFragmentShaderConstantATI, vFup) +//ATI_map_object_buffer +GO(glMapObjectBufferATI, pFu) +GO(glUnmapObjectBufferATI, vFu) +//ATI_pn_triangles +GO(glPNTrianglesfATI, vFuf) +GO(glPNTrianglesiATI, vFui) +//ATI_separate_stencil +GO(glStencilFuncSeparateATI, vFuuiu) +GO(glStencilOpSeparateATI, vFuuuu) +//ATI_vertex_array_object +GO(glArrayObjectATI, vFuiuiuu) +GO(glFreeObjectBufferATI, vFu) +GO(glGetArrayObjectfvATI, vFuup) +GO(glGetArrayObjectivATI, vFuup) +GO(glGetObjectBufferfvATI, vFuup) +GO(glGetObjectBufferivATI, vFuup) +GO(glGetVariantArrayObjectfvATI, vFuup) +GO(glGetVariantArrayObjectivATI, vFuup) +GO(glIsObjectBufferATI, CFu) +GO(glNewObjectBufferATI, uFipu) +GO(glUpdateObjectBufferATI, vFuuipu) +GO(glVariantArrayObjectATI, vFuuiuu) +//ATI_vertex_attrib_array_object +GO(glGetVertexAttribArrayObjectfvATI, vFuup) +GO(glGetVertexAttribArrayObjectivATI, vFuup) +GO(glVertexAttribArrayObjectATI, vFuiuCiuu) +//ATI_vertex_streams +GO(glClientActiveVertexStreamATI, vFu) +GO(glNormalStream3bATI, vFuccc) +GO(glNormalStream3bvATI, vFup) +GO(glNormalStream3dATI, vFuddd) +GO(glNormalStream3dvATI, vFup) +GO(glNormalStream3fATI, vFufff) +GO(glNormalStream3fvATI, vFup) +GO(glNormalStream3iATI, vFuiii) +GO(glNormalStream3ivATI, vFup) +GO(glNormalStream3sATI, vFuwww) +GO(glNormalStream3svATI, vFup) +GO(glVertexBlendEnvfATI, vFuf) +GO(glVertexBlendEnviATI, vFui) +GO(glVertexStream1dATI, vFud) +GO(glVertexStream1dvATI, vFup) +GO(glVertexStream1fATI, vFuf) +GO(glVertexStream1fvATI, vFup) +GO(glVertexStream1iATI, vFui) +GO(glVertexStream1ivATI, vFup) +GO(glVertexStream1sATI, vFuw) +GO(glVertexStream1svATI, vFup) +GO(glVertexStream2dATI, vFudd) +GO(glVertexStream2dvATI, vFup) +GO(glVertexStream2fATI, vFuff) +GO(glVertexStream2fvATI, vFup) +GO(glVertexStream2iATI, vFuii) +GO(glVertexStream2ivATI, vFup) +GO(glVertexStream2sATI, vFuww) +GO(glVertexStream2svATI, vFup) +GO(glVertexStream3dATI, vFuddd) +GO(glVertexStream3dvATI, vFup) +GO(glVertexStream3fATI, vFufff) +GO(glVertexStream3fvATI, vFup) +GO(glVertexStream3iATI, vFuiii) +GO(glVertexStream3ivATI, vFup) +GO(glVertexStream3sATI, vFuwww) +GO(glVertexStream3svATI, vFup) +GO(glVertexStream4dATI, vFudddd) +GO(glVertexStream4dvATI, vFup) +GO(glVertexStream4fATI, vFuffff) +GO(glVertexStream4fvATI, vFup) +GO(glVertexStream4iATI, vFuiiii) +GO(glVertexStream4ivATI, vFup) +GO(glVertexStream4sATI, vFuwwww) +GO(glVertexStream4svATI, vFup) +//EXT_bindable_uniform +GO(glGetUniformBufferSizeEXT, iFui) +GO(glGetUniformOffsetEXT, lFui) +GO(glUniformBufferEXT, vFuiu) +//EXT_blend_color +GO(glBlendColorEXT, vFffff) +//EXT_blend_equation_separate +GO(glBlendEquationSeparateEXT, vFuu) +//EXT_blend_func_separate +GO(glBlendFuncSeparateEXT, vFuuuu) +//EXT_blend_minmax +GO(glBlendEquationEXT, vFu) +//EXT_color_subtable +GO(glColorSubTableEXT, vFuiiuup) +GO(glCopyColorSubTableEXT, vFuiiii) +//EXT_compiled_vertex_array +GO(glLockArraysEXT, vFii) +GO(glUnlockArraysEXT, vFv) +//EXT_convolution +GO(glConvolutionFilter1DEXT, vFuuiuup) +GO(glConvolutionFilter2DEXT, vFuuiiuup) +GO(glConvolutionParameterfEXT, vFuuf) +GO(glConvolutionParameterfvEXT, vFuup) +GO(glConvolutionParameteriEXT, vFuui) +GO(glConvolutionParameterivEXT, vFuup) +GO(glCopyConvolutionFilter1DEXT, vFuuiii) +GO(glCopyConvolutionFilter2DEXT, vFuuiiii) +GO(glGetConvolutionFilterEXT, vFuuup) +GO(glGetConvolutionParameterfvEXT, vFuup) +GO(glGetConvolutionParameterivEXT, vFuup) +GO(glGetSeparableFilterEXT, vFuuuppp) +GO(glSeparableFilter2DEXT, vFuuiiuupp) +//EXT_coordinate_frame +GO(glBinormal3bEXT, vFccc) +GO(glBinormal3bvEXT, vFp) +GO(glBinormal3dEXT, vFddd) +GO(glBinormal3dvEXT, vFp) +GO(glBinormal3fEXT, vFfff) +GO(glBinormal3fvEXT, vFp) +GO(glBinormal3iEXT, vFiii) +GO(glBinormal3ivEXT, vFp) +GO(glBinormal3sEXT, vFwww) +GO(glBinormal3svEXT, vFp) +GO(glBinormalPointerEXT, vFuip) +GO(glTangent3bEXT, vFccc) +GO(glTangent3bvEXT, vFp) +GO(glTangent3dEXT, vFddd) +GO(glTangent3dvEXT, vFp) +GO(glTangent3fEXT, vFfff) +GO(glTangent3fvEXT, vFp) +GO(glTangent3iEXT, vFiii) +GO(glTangent3ivEXT, vFp) +GO(glTangent3sEXT, vFwww) +GO(glTangent3svEXT, vFp) +GO(glTangentPointerEXT, vFuip) +//EXT_copy_texture +GO(glCopyTexImage1DEXT, vFuiuiiii) +GO(glCopyTexImage2DEXT, vFuiuiiiii) +GO(glCopyTexSubImage1DEXT, vFuiiiii) +GO(glCopyTexSubImage2DEXT, vFuiiiiiii) +GO(glCopyTexSubImage3DEXT, vFuiiiiiiii) +//EXT_cull_vertex +GO(glCullParameterdvEXT, vFup) +GO(glCullParameterfvEXT, vFup) +//EXT_depth_bounds_test +GO(glDepthBoundsEXT, vFdd) +//EXT_direct_state_access +GO(glBindMultiTextureEXT, vFuuu) +GO(glCheckNamedFramebufferStatusEXT, uFuu) +GO(glClientAttribDefaultEXT, vFu) +GO(glCompressedMultiTexImage1DEXT, vFuuiuiiip) +GO(glCompressedMultiTexImage2DEXT, vFuuiuiiiip) +GO(glCompressedMultiTexImage3DEXT, vFuuiuiiiiip) +GO(glCompressedMultiTexSubImage1DEXT, vFuuiiiuip) +GO(glCompressedMultiTexSubImage2DEXT, vFuuiiiiiuip) +GO(glCompressedMultiTexSubImage3DEXT, vFuuiiiiiiiuip) +GO(glCompressedTextureImage1DEXT, vFuuiuiiip) +GO(glCompressedTextureImage2DEXT, vFuuiuiiiip) +GO(glCompressedTextureImage3DEXT, vFuuiuiiiiip) +GO(glCompressedTextureSubImage1DEXT, vFuuiiiuip) +GO(glCompressedTextureSubImage2DEXT, vFuuiiiiiuip) +GO(glCompressedTextureSubImage3DEXT, vFuuiiiiiiiuip) +GO(glCopyMultiTexImage1DEXT, vFuuiuiiii) +GO(glCopyMultiTexImage2DEXT, vFuuiuiiiii) +GO(glCopyMultiTexSubImage1DEXT, vFuuiiiii) +GO(glCopyMultiTexSubImage2DEXT, vFuuiiiiiii) +GO(glCopyMultiTexSubImage3DEXT, vFuuiiiiiiii) +GO(glCopyTextureImage1DEXT, vFuuiuiiii) +GO(glCopyTextureImage2DEXT, vFuuiuiiiii) +GO(glCopyTextureSubImage1DEXT, vFuuiiiii) +GO(glCopyTextureSubImage2DEXT, vFuuiiiiiii) +GO(glCopyTextureSubImage3DEXT, vFuuiiiiiiii) +GO(glDisableClientStateIndexedEXT, vFuu) +GO(glDisableClientStateiEXT, vFuu) +GO(glDisableVertexArrayAttribEXT, vFuu) +GO(glDisableVertexArrayEXT, vFuu) +GO(glEnableClientStateIndexedEXT, vFuu) +GO(glEnableClientStateiEXT, vFuu) +GO(glEnableVertexArrayAttribEXT, vFuu) +GO(glEnableVertexArrayEXT, vFuu) +GO(glFlushMappedNamedBufferRangeEXT, vFull) +GO(glFramebufferDrawBufferEXT, vFuu) +GO(glFramebufferDrawBuffersEXT, vFuip) +GO(glFramebufferReadBufferEXT, vFuu) +GO(glGenerateMultiTexMipmapEXT, vFuu) +GO(glGenerateTextureMipmapEXT, vFuu) +GO(glGetCompressedMultiTexImageEXT, vFuuip) +GO(glGetCompressedTextureImageEXT, vFuuip) +GO(glGetDoubleIndexedvEXT, vFuup) +GO(glGetDoublei_vEXT, vFuup) +GO(glGetFloatIndexedvEXT, vFuup) +GO(glGetFloati_vEXT, vFuup) +GO(glGetFramebufferParameterivEXT, vFuup) +GO(glGetMultiTexEnvfvEXT, vFuuup) +GO(glGetMultiTexEnvivEXT, vFuuup) +GO(glGetMultiTexGendvEXT, vFuuup) +GO(glGetMultiTexGenfvEXT, vFuuup) +GO(glGetMultiTexGenivEXT, vFuuup) +GO(glGetMultiTexImageEXT, vFuuiuup) +GO(glGetMultiTexLevelParameterfvEXT, vFuuiup) +GO(glGetMultiTexLevelParameterivEXT, vFuuiup) +GO(glGetMultiTexParameterIivEXT, vFuuup) +GO(glGetMultiTexParameterIuivEXT, vFuuup) +GO(glGetMultiTexParameterfvEXT, vFuuup) +GO(glGetMultiTexParameterivEXT, vFuuup) +GO(glGetNamedBufferParameterivEXT, vFuup) +GO(glGetNamedBufferPointervEXT, vFuuBp_) +GO(glGetNamedBufferSubDataEXT, vFullp) +GO(glGetNamedFramebufferAttachmentParameterivEXT, vFuuup) +GO(glGetNamedProgramLocalParameterIivEXT, vFuuup) +GO(glGetNamedProgramLocalParameterIuivEXT, vFuuup) +GO(glGetNamedProgramLocalParameterdvEXT, vFuuup) +GO(glGetNamedProgramLocalParameterfvEXT, vFuuup) +GO(glGetNamedProgramStringEXT, vFuuup) +GO(glGetNamedProgramivEXT, vFuuup) +GO(glGetNamedRenderbufferParameterivEXT, vFuup) +GO(glGetPointerIndexedvEXT, vFuuBp_) +GO(glGetPointeri_vEXT, vFuuBp_) +GO(glGetTextureImageEXT, vFuuiuup) +GO(glGetTextureLevelParameterfvEXT, vFuuiup) +GO(glGetTextureLevelParameterivEXT, vFuuiup) +GO(glGetTextureParameterIivEXT, vFuuup) +GO(glGetTextureParameterIuivEXT, vFuuup) +GO(glGetTextureParameterfvEXT, vFuuup) +GO(glGetTextureParameterivEXT, vFuuup) +GO(glGetVertexArrayIntegeri_vEXT, vFuuup) +GO(glGetVertexArrayIntegervEXT, vFuup) +GO(glGetVertexArrayPointeri_vEXT, vFuuuBp_) +GO(glGetVertexArrayPointervEXT, vFuuBp_) +GO(glMapNamedBufferEXT, pFuu) +GO(glMapNamedBufferRangeEXT, pFullu) +GO(glMatrixFrustumEXT, vFudddddd) +GO(glMatrixLoadIdentityEXT, vFu) +GO(glMatrixLoadTransposedEXT, vFup) +GO(glMatrixLoadTransposefEXT, vFup) +GO(glMatrixLoaddEXT, vFup) +GO(glMatrixLoadfEXT, vFup) +GO(glMatrixMultTransposedEXT, vFup) +GO(glMatrixMultTransposefEXT, vFup) +GO(glMatrixMultdEXT, vFup) +GO(glMatrixMultfEXT, vFup) +GO(glMatrixOrthoEXT, vFudddddd) +GO(glMatrixPopEXT, vFu) +GO(glMatrixPushEXT, vFu) +GO(glMatrixRotatedEXT, vFudddd) +GO(glMatrixRotatefEXT, vFuffff) +GO(glMatrixScaledEXT, vFuddd) +GO(glMatrixScalefEXT, vFufff) +GO(glMatrixTranslatedEXT, vFuddd) +GO(glMatrixTranslatefEXT, vFufff) +GO(glMultiTexBufferEXT, vFuuuu) +GO(glMultiTexCoordPointerEXT, vFuiuip) +GO(glMultiTexEnvfEXT, vFuuuf) +GO(glMultiTexEnvfvEXT, vFuuup) +GO(glMultiTexEnviEXT, vFuuui) +GO(glMultiTexEnvivEXT, vFuuup) +GO(glMultiTexGendEXT, vFuuud) +GO(glMultiTexGendvEXT, vFuuup) +GO(glMultiTexGenfEXT, vFuuuf) +GO(glMultiTexGenfvEXT, vFuuup) +GO(glMultiTexGeniEXT, vFuuui) +GO(glMultiTexGenivEXT, vFuuup) +GO(glMultiTexImage1DEXT, vFuuiiiiuup) +GO(glMultiTexImage2DEXT, vFuuiiiiiuup) +GO(glMultiTexImage3DEXT, vFuuiiiiiiuup) +GO(glMultiTexParameterIivEXT, vFuuup) +GO(glMultiTexParameterIuivEXT, vFuuup) +GO(glMultiTexParameterfEXT, vFuuuf) +GO(glMultiTexParameterfvEXT, vFuuup) +GO(glMultiTexParameteriEXT, vFuuui) +GO(glMultiTexParameterivEXT, vFuuup) +GO(glMultiTexRenderbufferEXT, vFuuu) +GO(glMultiTexSubImage1DEXT, vFuuiiiuup) +GO(glMultiTexSubImage2DEXT, vFuuiiiiiuup) +GO(glMultiTexSubImage3DEXT, vFuuiiiiiiiuup) +GO(glNamedBufferDataEXT, vFulpu) +GO(glNamedBufferSubDataEXT, vFullp) +GO(glNamedCopyBufferSubDataEXT, vFuulll) +GO(glNamedFramebufferRenderbufferEXT, vFuuuu) +GO(glNamedFramebufferTexture1DEXT, vFuuuui) +GO(glNamedFramebufferTexture2DEXT, vFuuuui) +GO(glNamedFramebufferTexture3DEXT, vFuuuuii) +GO(glNamedFramebufferTextureEXT, vFuuui) +GO(glNamedFramebufferTextureFaceEXT, vFuuuiu) +GO(glNamedFramebufferTextureLayerEXT, vFuuuii) +GO(glNamedProgramLocalParameter4dEXT, vFuuudddd) +GO(glNamedProgramLocalParameter4dvEXT, vFuuup) +GO(glNamedProgramLocalParameter4fEXT, vFuuuffff) +GO(glNamedProgramLocalParameter4fvEXT, vFuuup) +GO(glNamedProgramLocalParameterI4iEXT, vFuuuiiii) +GO(glNamedProgramLocalParameterI4ivEXT, vFuuup) +GO(glNamedProgramLocalParameterI4uiEXT, vFuuuuuuu) +GO(glNamedProgramLocalParameterI4uivEXT, vFuuup) +GO(glNamedProgramLocalParameters4fvEXT, vFuuuip) +GO(glNamedProgramLocalParametersI4ivEXT, vFuuuip) +GO(glNamedProgramLocalParametersI4uivEXT, vFuuuip) +GO(glNamedProgramStringEXT, vFuuuip) +GO(glNamedRenderbufferStorageEXT, vFuuii) +GO(glNamedRenderbufferStorageMultisampleCoverageEXT, vFuiiuii) +GO(glNamedRenderbufferStorageMultisampleEXT, vFuiuii) +GO(glProgramUniform1dEXT, vFuid) +GO(glProgramUniform1dvEXT, vFuiip) +GO(glProgramUniform1fEXT, vFuif) +GO(glProgramUniform1fvEXT, vFuiip) +GO(glProgramUniform1iEXT, vFuii) +GO(glProgramUniform1ivEXT, vFuiip) +GO(glProgramUniform1uiEXT, vFuiu) +GO(glProgramUniform1uivEXT, vFuiip) +GO(glProgramUniform2dEXT, vFuidd) +GO(glProgramUniform2dvEXT, vFuiip) +GO(glProgramUniform2fEXT, vFuiff) +GO(glProgramUniform2fvEXT, vFuiip) +GO(glProgramUniform2iEXT, vFuiii) +GO(glProgramUniform2ivEXT, vFuiip) +GO(glProgramUniform2uiEXT, vFuiuu) +GO(glProgramUniform2uivEXT, vFuiip) +GO(glProgramUniform3dEXT, vFuiddd) +GO(glProgramUniform3dvEXT, vFuiip) +GO(glProgramUniform3fEXT, vFuifff) +GO(glProgramUniform3fvEXT, vFuiip) +GO(glProgramUniform3iEXT, vFuiiii) +GO(glProgramUniform3ivEXT, vFuiip) +GO(glProgramUniform3uiEXT, vFuiuuu) +GO(glProgramUniform3uivEXT, vFuiip) +GO(glProgramUniform4dEXT, vFuidddd) +GO(glProgramUniform4dvEXT, vFuiip) +GO(glProgramUniform4fEXT, vFuiffff) +GO(glProgramUniform4fvEXT, vFuiip) +GO(glProgramUniform4iEXT, vFuiiiii) +GO(glProgramUniform4ivEXT, vFuiip) +GO(glProgramUniform4uiEXT, vFuiuuuu) +GO(glProgramUniform4uivEXT, vFuiip) +GO(glProgramUniformMatrix2dvEXT, vFuiiCp) +GO(glProgramUniformMatrix2fvEXT, vFuiiCp) +GO(glProgramUniformMatrix2x3dvEXT, vFuiiCp) +GO(glProgramUniformMatrix2x3fvEXT, vFuiiCp) +GO(glProgramUniformMatrix2x4dvEXT, vFuiiCp) +GO(glProgramUniformMatrix2x4fvEXT, vFuiiCp) +GO(glProgramUniformMatrix3dvEXT, vFuiiCp) +GO(glProgramUniformMatrix3fvEXT, vFuiiCp) +GO(glProgramUniformMatrix3x2dvEXT, vFuiiCp) +GO(glProgramUniformMatrix3x2fvEXT, vFuiiCp) +GO(glProgramUniformMatrix3x4dvEXT, vFuiiCp) +GO(glProgramUniformMatrix3x4fvEXT, vFuiiCp) +GO(glProgramUniformMatrix4dvEXT, vFuiiCp) +GO(glProgramUniformMatrix4fvEXT, vFuiiCp) +GO(glProgramUniformMatrix4x2dvEXT, vFuiiCp) +GO(glProgramUniformMatrix4x2fvEXT, vFuiiCp) +GO(glProgramUniformMatrix4x3dvEXT, vFuiiCp) +GO(glProgramUniformMatrix4x3fvEXT, vFuiiCp) +GO(glPushClientAttribDefaultEXT, vFu) +GO(glTextureBufferEXT, vFuuuu) +GO(glTextureImage1DEXT, vFuuiiiiuup) +GO(glTextureImage2DEXT, vFuuiiiiiuup) +GO(glTextureImage3DEXT, vFuuiiiiiiuup) +GO(glTextureParameterIivEXT, vFuuup) +GO(glTextureParameterIuivEXT, vFuuup) +GO(glTextureParameterfEXT, vFuuuf) +GO(glTextureParameterfvEXT, vFuuup) +GO(glTextureParameteriEXT, vFuuui) +GO(glTextureParameterivEXT, vFuuup) +GO(glTextureRenderbufferEXT, vFuuu) +GO(glTextureSubImage1DEXT, vFuuiiiuup) +GO(glTextureSubImage2DEXT, vFuuiiiiiuup) +GO(glTextureSubImage3DEXT, vFuuiiiiiiiuup) +GO(glUnmapNamedBufferEXT, CFu) +GO(glVertexArrayColorOffsetEXT, vFuuiuil) +GO(glVertexArrayEdgeFlagOffsetEXT, vFuuil) +GO(glVertexArrayFogCoordOffsetEXT, vFuuuil) +GO(glVertexArrayIndexOffsetEXT, vFuuuil) +GO(glVertexArrayMultiTexCoordOffsetEXT, vFuuuiuil) +GO(glVertexArrayNormalOffsetEXT, vFuuuil) +GO(glVertexArraySecondaryColorOffsetEXT, vFuuiuil) +GO(glVertexArrayTexCoordOffsetEXT, vFuuiuil) +GO(glVertexArrayVertexAttribIOffsetEXT, vFuuuiuil) +GO(glVertexArrayVertexAttribOffsetEXT, vFuuuiuCil) +GO(glVertexArrayVertexOffsetEXT, vFuuiuil) +//EXT_draw_buffers2 +GO(glColorMaskIndexedEXT, vFuCCCC) +GO(glDisableIndexedEXT, vFuu) +GO(glEnableIndexedEXT, vFuu) +GO(glGetBooleanIndexedvEXT, vFuup) +GO(glGetIntegerIndexedvEXT, vFuup) +GO(glIsEnabledIndexedEXT, CFuu) +//EXT_draw_instanced +GO(glDrawArraysInstancedEXT, vFuiii) +GO(glDrawElementsInstancedEXT, vFuiupi) +//EXT_draw_range_elements +GO(glDrawRangeElementsEXT, vFuuuiup) +//EXT_fog_coord +GO(glFogCoordPointerEXT, vFuip) +GO(glFogCoorddEXT, vFd) +GO(glFogCoorddvEXT, vFp) +GO(glFogCoordfEXT, vFf) +GO(glFogCoordfvEXT, vFp) +//EXT_framebuffer_blit +GO(glBlitFramebufferEXT, vFiiiiiiiiuu) +//EXT_framebuffer_object +GO(glBindFramebufferEXT, vFuu) +GO(glBindRenderbufferEXT, vFuu) +GO(glCheckFramebufferStatusEXT, uFu) +GO(glDeleteFramebuffersEXT, vFip) +GO(glDeleteRenderbuffersEXT, vFip) +GO(glFramebufferRenderbufferEXT, vFuuuu) +GO(glFramebufferTexture1DEXT, vFuuuui) +GO(glFramebufferTexture2DEXT, vFuuuui) +GO(glFramebufferTexture3DEXT, vFuuuuii) +GO(glGenFramebuffersEXT, vFip) +GO(glGenRenderbuffersEXT, vFip) +GO(glGenerateMipmapEXT, vFu) +GO(glGetFramebufferAttachmentParameterivEXT, vFuuup) +GO(glGetRenderbufferParameterivEXT, vFuup) +GO(glIsFramebufferEXT, CFu) +GO(glIsRenderbufferEXT, CFu) +GO(glRenderbufferStorageEXT, vFuuii) +//EXT_geometry_shader4 +GO(glProgramParameteriEXT, vFuui) +//EXT_gpu_program_parameters +GO(glProgramEnvParameters4fvEXT, vFuuip) +GO(glProgramLocalParameters4fvEXT, vFuuip) +//EXT_gpu_shader4 +GO(glBindFragDataLocationEXT, vFuup) +GO(glGetFragDataLocationEXT, iFup) +GO(glGetUniformuivEXT, vFuip) +GO(glUniform1uiEXT, vFiu) +GO(glUniform1uivEXT, vFiip) +GO(glUniform2uiEXT, vFiuu) +GO(glUniform2uivEXT, vFiip) +GO(glUniform3uiEXT, vFiuuu) +GO(glUniform3uivEXT, vFiip) +GO(glUniform4uiEXT, vFiuuuu) +GO(glUniform4uivEXT, vFiip) +//EXT_histogram +GO(glGetHistogramEXT, vFuCuup) +GO(glGetHistogramParameterfvEXT, vFuup) +GO(glGetHistogramParameterivEXT, vFuup) +GO(glGetMinmaxEXT, vFuCuup) +GO(glGetMinmaxParameterfvEXT, vFuup) +GO(glGetMinmaxParameterivEXT, vFuup) +GO(glHistogramEXT, vFuiuC) +GO(glMinmaxEXT, vFuuC) +GO(glResetHistogramEXT, vFu) +GO(glResetMinmaxEXT, vFu) +//EXT_index_func +GO(glIndexFuncEXT, vFuf) +//EXT_index_material +GO(glIndexMaterialEXT, vFuu) +//EXT_light_texture +GO(glApplyTextureEXT, vFu) +GO(glTextureLightEXT, vFu) +GO(glTextureMaterialEXT, vFuu) +//EXT_multi_draw_arrays +GO(glMultiDrawArraysEXT, vFuppi) +GOM(glMultiDrawElementsEXT, vFEupupi) +//EXT_multisample +GO(glSampleMaskEXT, vFfC) +GO(glSamplePatternEXT, vFu) +//EXT_paletted_texture +GO(glColorTableEXT, vFuuiuup) +GO(glGetColorTableEXT, vFuuup) +GO(glGetColorTableParameterfvEXT, vFuup) +GO(glGetColorTableParameterivEXT, vFuup) +//EXT_pixel_transform +GO(glGetPixelTransformParameterfvEXT, vFuup) +GO(glGetPixelTransformParameterivEXT, vFuup) +GO(glPixelTransformParameterfEXT, vFuuf) +GO(glPixelTransformParameterfvEXT, vFuup) +GO(glPixelTransformParameteriEXT, vFuui) +GO(glPixelTransformParameterivEXT, vFuup) +//EXT_point_parameters +GO(glPointParameterfEXT, vFuf) +GO(glPointParameterfvEXT, vFup) +//EXT_polygon_offset +GO(glPolygonOffsetEXT, vFff) +//EXT_provoking_vertex +GO(glProvokingVertexEXT, vFu) +//EXT_secondary_color +GO(glSecondaryColor3bEXT, vFccc) +GO(glSecondaryColor3bvEXT, vFp) +GO(glSecondaryColor3dEXT, vFddd) +GO(glSecondaryColor3dvEXT, vFp) +GO(glSecondaryColor3fEXT, vFfff) +GO(glSecondaryColor3fvEXT, vFp) +GO(glSecondaryColor3iEXT, vFiii) +GO(glSecondaryColor3ivEXT, vFp) +GO(glSecondaryColor3sEXT, vFwww) +GO(glSecondaryColor3svEXT, vFp) +GO(glSecondaryColor3ubEXT, vFCCC) +GO(glSecondaryColor3ubvEXT, vFp) +GO(glSecondaryColor3uiEXT, vFuuu) +GO(glSecondaryColor3uivEXT, vFp) +GO(glSecondaryColor3usEXT, vFWWW) +GO(glSecondaryColor3usvEXT, vFp) +GO(glSecondaryColorPointerEXT, vFiuip) +//EXT_separate_shader_objects +GO(glActiveProgramEXT, vFu) +GO(glCreateShaderProgramEXT, uFup) +GO(glUseShaderProgramEXT, vFuu) +//EXT_shader_image_load_store +GO(glBindImageTextureEXT, vFuuiCiui) +GO(glMemoryBarrierEXT, vFu) +//EXT_stencil_clear_tag +GO(glStencilClearTagEXT, vFiu) +//EXT_stencil_two_side +GO(glActiveStencilFaceEXT, vFu) +//EXT_subtexture +GO(glTexSubImage1DEXT, vFuiiiuup) +GO(glTexSubImage2DEXT, vFuiiiiiuup) +//EXT_texture3D +GO(glTexImage3DEXT, vFuiuiiiiuup) +GO(glTexSubImage3DEXT, vFuiiiiiiiuup) +//EXT_texture_buffer_object +GO(glTexBufferEXT, vFuuu) +//EXT_texture_integer +GO(glClearColorIiEXT, vFiiii) +GO(glClearColorIuiEXT, vFuuuu) +GO(glGetTexParameterIivEXT, vFuup) +GO(glGetTexParameterIuivEXT, vFuup) +GO(glTexParameterIivEXT, vFuup) +GO(glTexParameterIuivEXT, vFuup) +//EXT_texture_object +GO(glAreTexturesResidentEXT, CFipp) +GO(glBindTextureEXT, vFuu) +GO(glDeleteTexturesEXT, vFip) +GO(glGenTexturesEXT, vFip) +GO(glIsTextureEXT, CFu) +GO(glPrioritizeTexturesEXT, vFipp) +//EXT_texture_perturb_normal +GO(glTextureNormalEXT, vFu) +//EXT_transform_feedback +GO(glBeginTransformFeedbackEXT, vFu) +GO(glBindBufferBaseEXT, vFuuu) +GO(glBindBufferOffsetEXT, vFuuul) +GO(glBindBufferRangeEXT, vFuuull) +GO(glEndTransformFeedbackEXT, vFv) +GO(glGetTransformFeedbackVaryingEXT, vFuuipppp) +GOM(glTransformFeedbackVaryingsEXT, vFEuipu) +//EXT_vertex_array +GO(glArrayElementEXT, vFi) +GO(glColorPointerEXT, vFiuiip) +GO(glDrawArraysEXT, vFuii) +GO(glEdgeFlagPointerEXT, vFiip) +GO(glGetPointervEXT, vFuBp_) +GO(glIndexPointerEXT, vFuiip) +GO(glNormalPointerEXT, vFuiip) +GO(glTexCoordPointerEXT, vFiuiip) +GO(glVertexPointerEXT, vFiuiip) +//EXT_vertex_attrib_64bit +GO(glGetVertexAttribLdvEXT, vFuup) +GO(glVertexArrayVertexAttribLOffsetEXT, vFuuuiuil) +GO(glVertexAttribL1dEXT, vFud) +GO(glVertexAttribL1dvEXT, vFup) +GO(glVertexAttribL2dEXT, vFudd) +GO(glVertexAttribL2dvEXT, vFup) +GO(glVertexAttribL3dEXT, vFuddd) +GO(glVertexAttribL3dvEXT, vFup) +GO(glVertexAttribL4dEXT, vFudddd) +GO(glVertexAttribL4dvEXT, vFup) +GO(glVertexAttribLPointerEXT, vFuiuip) +//EXT_vertex_shader +GO(glBeginVertexShaderEXT, vFv) +GO(glBindLightParameterEXT, uFuu) +GO(glBindMaterialParameterEXT, uFuu) +GO(glBindParameterEXT, uFu) +GO(glBindTexGenParameterEXT, uFuuu) +GO(glBindTextureUnitParameterEXT, uFuu) +GO(glBindVertexShaderEXT, vFu) +GO(glDeleteVertexShaderEXT, vFu) +GO(glDisableVariantClientStateEXT, vFu) +GO(glEnableVariantClientStateEXT, vFu) +GO(glEndVertexShaderEXT, vFv) +GO(glExtractComponentEXT, vFuuu) +GO(glGenSymbolsEXT, uFuuuu) +GO(glGenVertexShadersEXT, uFu) +GO(glGetInvariantBooleanvEXT, vFuup) +GO(glGetInvariantFloatvEXT, vFuup) +GO(glGetInvariantIntegervEXT, vFuup) +GO(glGetLocalConstantBooleanvEXT, vFuup) +GO(glGetLocalConstantFloatvEXT, vFuup) +GO(glGetLocalConstantIntegervEXT, vFuup) +GO(glGetVariantBooleanvEXT, vFuup) +GO(glGetVariantFloatvEXT, vFuup) +GO(glGetVariantIntegervEXT, vFuup) +GO(glGetVariantPointervEXT, vFuuBp_) +GO(glInsertComponentEXT, vFuuu) +GO(glIsVariantEnabledEXT, CFuu) +GO(glSetInvariantEXT, vFuup) +GO(glSetLocalConstantEXT, vFuup) +GO(glShaderOp1EXT, vFuuu) +GO(glShaderOp2EXT, vFuuuu) +GO(glShaderOp3EXT, vFuuuuu) +GO(glSwizzleEXT, vFuuuuuu) +GO(glVariantPointerEXT, vFuuup) +GO(glVariantbvEXT, vFup) +GO(glVariantdvEXT, vFup) +GO(glVariantfvEXT, vFup) +GO(glVariantivEXT, vFup) +GO(glVariantsvEXT, vFup) +GO(glVariantubvEXT, vFup) +GO(glVariantuivEXT, vFup) +GO(glVariantusvEXT, vFup) +GO(glWriteMaskEXT, vFuuuuuu) +//EXT_vertex_weighting +GO(glVertexWeightPointerEXT, vFiuip) +GO(glVertexWeightfEXT, vFf) +GO(glVertexWeightfvEXT, vFp) +//EXT_x11_sync_object +GO(glImportSyncEXT, pFulu) +//GREMEDY_frame_terminator +GO(glFrameTerminatorGREMEDY, vFv) +//GREMEDY_string_marker +GO(glStringMarkerGREMEDY, vFip) +//HP_image_transform +GO(glGetImageTransformParameterfvHP, vFuup) +GO(glGetImageTransformParameterivHP, vFuup) +GO(glImageTransformParameterfHP, vFuuf) +GO(glImageTransformParameterfvHP, vFuup) +GO(glImageTransformParameteriHP, vFuui) +GO(glImageTransformParameterivHP, vFuup) +//IBM_multimode_draw_arrays +GO(glMultiModeDrawArraysIBM, vFpppii) +GOM(glMultiModeDrawElementsIBM, vFEppupui) +//IBM_static_data +GO(glFlushStaticDataIBM, vFu) +//IBM_vertex_array_lists +GO(glColorPointerListIBM, vFiuibp_i) +GO(glEdgeFlagPointerListIBM, vFibp_i) +GO(glFogCoordPointerListIBM, vFuibp_i) +GO(glIndexPointerListIBM, vFuibp_i) +GO(glNormalPointerListIBM, vFuibp_i) +GO(glSecondaryColorPointerListIBM, vFiuibp_i) +GO(glTexCoordPointerListIBM, vFiuibp_i) +GO(glVertexPointerListIBM, vFiuibp_i) +//INGR_blend_func_separate +GO(glBlendFuncSeparateINGR, vFuuuu) +//INTEL_map_texture +GO(glMapTexture2DINTEL, pFuiupp) +GO(glSyncTextureINTEL, vFu) +GO(glUnmapTexture2DINTEL, vFui) +//INTEL_parallel_arrays +//GO(glColorPointervINTEL, vFiubp_) +//GO(glNormalPointervINTEL, vFubp_) +//GO(glTexCoordPointervINTEL, vFiubp_) +//GO(glVertexPointervINTEL, vFiubp_) +//KHR_debug +GOM(glDebugMessageCallback, vFEpp) // not ideal, because the my_ version will always exist, even if glDebugMessageCallback doesn't +GO(glDebugMessageControl, vFuuuipC) +GO(glDebugMessageInsert, vFuuuuip) +GO(glGetDebugMessageLog, uFuipppppp) +GO(glGetObjectLabel, vFuuipp) +GO(glGetObjectPtrLabel, vFpipp) +GO(glObjectLabel, vFuuip) +GO(glObjectPtrLabel, vFpip) +GO(glPopDebugGroup, vFv) +GO(glPushDebugGroup, vFuuip) +//MESA_resize_buffers +GO(glResizeBuffersMESA, vFv) +//MESA_window_pos +GO(glWindowPos2dMESA, vFdd) +GO(glWindowPos2dvMESA, vFp) +GO(glWindowPos2fMESA, vFff) +GO(glWindowPos2fvMESA, vFp) +GO(glWindowPos2iMESA, vFii) +GO(glWindowPos2ivMESA, vFp) +GO(glWindowPos2sMESA, vFww) +GO(glWindowPos2svMESA, vFp) +GO(glWindowPos3dMESA, vFddd) +GO(glWindowPos3dvMESA, vFp) +GO(glWindowPos3fMESA, vFfff) +GO(glWindowPos3fvMESA, vFp) +GO(glWindowPos3iMESA, vFiii) +GO(glWindowPos3ivMESA, vFp) +GO(glWindowPos3sMESA, vFwww) +GO(glWindowPos3svMESA, vFp) +GO(glWindowPos4dMESA, vFdddd) +GO(glWindowPos4dvMESA, vFp) +GO(glWindowPos4fMESA, vFffff) +GO(glWindowPos4fvMESA, vFp) +GO(glWindowPos4iMESA, vFiiii) +GO(glWindowPos4ivMESA, vFp) +GO(glWindowPos4sMESA, vFwwww) +GO(glWindowPos4svMESA, vFp) +//NVX_conditional_render +GO(glBeginConditionalRenderNVX, vFu) +GO(glEndConditionalRenderNVX, vFv) +//NV_bindless_texture +GO(glGetImageHandleNV, UFuiCiu) +GO(glGetTextureHandleNV, UFu) +GO(glGetTextureSamplerHandleNV, UFuu) +GO(glIsImageHandleResidentNV, CFU) +GO(glIsTextureHandleResidentNV, CFU) +GO(glMakeImageHandleNonResidentNV, vFU) +GO(glMakeImageHandleResidentNV, vFUu) +GO(glMakeTextureHandleNonResidentNV, vFU) +GO(glMakeTextureHandleResidentNV, vFU) +GO(glProgramUniformHandleui64NV, vFuiU) +GO(glProgramUniformHandleui64vNV, vFuiip) +GO(glUniformHandleui64NV, vFiU) +GO(glUniformHandleui64vNV, vFiip) +//NV_conditional_render +GO(glBeginConditionalRenderNV, vFuu) +GO(glEndConditionalRenderNV, vFv) +//NV_copy_image +GO(glCopyImageSubDataNV, vFuuiiiiuuiiiiiii) +//NV_depth_buffer_float +GO(glClearDepthdNV, vFd) +GO(glDepthBoundsdNV, vFdd) +GO(glDepthRangedNV, vFdd) +//NV_draw_texture +GO(glDrawTextureNV, vFuufffffffff) +//NV_evaluators +GO(glEvalMapsNV, vFuu) +GO(glGetMapAttribParameterfvNV, vFuuup) +GO(glGetMapAttribParameterivNV, vFuuup) +GO(glGetMapControlPointsNV, vFuuuiiCp) +GO(glGetMapParameterfvNV, vFuup) +GO(glGetMapParameterivNV, vFuup) +GO(glMapControlPointsNV, vFuuuiiiiCp) +GO(glMapParameterfvNV, vFuup) +GO(glMapParameterivNV, vFuup) +//NV_explicit_multisample +GO(glGetMultisamplefvNV, vFuup) +GO(glSampleMaskIndexedNV, vFuu) +GO(glTexRenderbufferNV, vFuu) +//NV_fence +GO(glDeleteFencesNV, vFip) +GO(glFinishFenceNV, vFu) +GO(glGenFencesNV, vFip) +GO(glGetFenceivNV, vFuup) +GO(glIsFenceNV, CFu) +GO(glSetFenceNV, vFuu) +GO(glTestFenceNV, CFu) +//NV_fragment_program +GO(glGetProgramNamedParameterdvNV, vFuipp) +GO(glGetProgramNamedParameterfvNV, vFuipp) +GO(glProgramNamedParameter4dNV, vFuipdddd) +GO(glProgramNamedParameter4dvNV, vFuipp) +GO(glProgramNamedParameter4fNV, vFuipffff) +GO(glProgramNamedParameter4fvNV, vFuipp) +//NV_framebuffer_multisample_coverage +GO(glRenderbufferStorageMultisampleCoverageNV, vFuiiuii) +//NV_geometry_program4 +GO(glFramebufferTextureEXT, vFuuui) +GO(glFramebufferTextureFaceEXT, vFuuuiu) +GO(glFramebufferTextureLayerEXT, vFuuuii) +GO(glProgramVertexLimitNV, vFui) +//NV_gpu_program4 +GO(glGetProgramEnvParameterIivNV, vFuup) +GO(glGetProgramEnvParameterIuivNV, vFuup) +GO(glGetProgramLocalParameterIivNV, vFuup) +GO(glGetProgramLocalParameterIuivNV, vFuup) +GO(glProgramEnvParameterI4iNV, vFuuiiii) +GO(glProgramEnvParameterI4ivNV, vFuup) +GO(glProgramEnvParameterI4uiNV, vFuuuuuu) +GO(glProgramEnvParameterI4uivNV, vFuup) +GO(glProgramEnvParametersI4ivNV, vFuuip) +GO(glProgramEnvParametersI4uivNV, vFuuip) +GO(glProgramLocalParameterI4iNV, vFuuiiii) +GO(glProgramLocalParameterI4ivNV, vFuup) +GO(glProgramLocalParameterI4uiNV, vFuuuuuu) +GO(glProgramLocalParameterI4uivNV, vFuup) +GO(glProgramLocalParametersI4ivNV, vFuuip) +GO(glProgramLocalParametersI4uivNV, vFuuip) +//NV_gpu_program5 +GO(glGetProgramSubroutineParameteruivNV, vFuup) +GO(glProgramSubroutineParametersuivNV, vFuip) +//NV_gpu_shader5 +GO(glGetUniformi64vNV, vFuip) +GO(glProgramUniform1i64NV, vFuiI) +GO(glProgramUniform1i64vNV, vFuiip) +GO(glProgramUniform1ui64NV, vFuiU) +GO(glProgramUniform1ui64vNV, vFuiip) +GO(glProgramUniform2i64NV, vFuiII) +GO(glProgramUniform2i64vNV, vFuiip) +GO(glProgramUniform2ui64NV, vFuiUU) +GO(glProgramUniform2ui64vNV, vFuiip) +GO(glProgramUniform3i64NV, vFuiIII) +GO(glProgramUniform3i64vNV, vFuiip) +GO(glProgramUniform3ui64NV, vFuiUUU) +GO(glProgramUniform3ui64vNV, vFuiip) +GO(glProgramUniform4i64NV, vFuiIIII) +GO(glProgramUniform4i64vNV, vFuiip) +GO(glProgramUniform4ui64NV, vFuiUUUU) +GO(glProgramUniform4ui64vNV, vFuiip) +GO(glUniform1i64NV, vFiI) +GO(glUniform1i64vNV, vFiip) +GO(glUniform1ui64NV, vFiU) +GO(glUniform1ui64vNV, vFiip) +GO(glUniform2i64NV, vFiII) +GO(glUniform2i64vNV, vFiip) +GO(glUniform2ui64NV, vFiUU) +GO(glUniform2ui64vNV, vFiip) +GO(glUniform3i64NV, vFiIII) +GO(glUniform3i64vNV, vFiip) +GO(glUniform3ui64NV, vFiUUU) +GO(glUniform3ui64vNV, vFiip) +GO(glUniform4i64NV, vFiIIII) +GO(glUniform4i64vNV, vFiip) +GO(glUniform4ui64NV, vFiUUUU) +GO(glUniform4ui64vNV, vFiip) +//NV_half_float +GO(glColor3hNV, vFWWW) +GO(glColor3hvNV, vFp) +GO(glColor4hNV, vFWWWW) +GO(glColor4hvNV, vFp) +GO(glFogCoordhNV, vFW) +GO(glFogCoordhvNV, vFp) +GO(glMultiTexCoord1hNV, vFuW) +GO(glMultiTexCoord1hvNV, vFup) +GO(glMultiTexCoord2hNV, vFuWW) +GO(glMultiTexCoord2hvNV, vFup) +GO(glMultiTexCoord3hNV, vFuWWW) +GO(glMultiTexCoord3hvNV, vFup) +GO(glMultiTexCoord4hNV, vFuWWWW) +GO(glMultiTexCoord4hvNV, vFup) +GO(glNormal3hNV, vFWWW) +GO(glNormal3hvNV, vFp) +GO(glSecondaryColor3hNV, vFWWW) +GO(glSecondaryColor3hvNV, vFp) +GO(glTexCoord1hNV, vFW) +GO(glTexCoord1hvNV, vFp) +GO(glTexCoord2hNV, vFWW) +GO(glTexCoord2hvNV, vFp) +GO(glTexCoord3hNV, vFWWW) +GO(glTexCoord3hvNV, vFp) +GO(glTexCoord4hNV, vFWWWW) +GO(glTexCoord4hvNV, vFp) +GO(glVertex2hNV, vFWW) +GO(glVertex2hvNV, vFp) +GO(glVertex3hNV, vFWWW) +GO(glVertex3hvNV, vFp) +GO(glVertex4hNV, vFWWWW) +GO(glVertex4hvNV, vFp) +GO(glVertexAttrib1hNV, vFuW) +GO(glVertexAttrib1hvNV, vFup) +GO(glVertexAttrib2hNV, vFuWW) +GO(glVertexAttrib2hvNV, vFup) +GO(glVertexAttrib3hNV, vFuWWW) +GO(glVertexAttrib3hvNV, vFup) +GO(glVertexAttrib4hNV, vFuWWWW) +GO(glVertexAttrib4hvNV, vFup) +GO(glVertexAttribs1hvNV, vFuip) +GO(glVertexAttribs2hvNV, vFuip) +GO(glVertexAttribs3hvNV, vFuip) +GO(glVertexAttribs4hvNV, vFuip) +GO(glVertexWeighthNV, vFW) +GO(glVertexWeighthvNV, vFp) +//NV_occlusion_query +GO(glBeginOcclusionQueryNV, vFu) +GO(glDeleteOcclusionQueriesNV, vFip) +GO(glEndOcclusionQueryNV, vFv) +GO(glGenOcclusionQueriesNV, vFip) +GO(glGetOcclusionQueryivNV, vFuup) +GO(glGetOcclusionQueryuivNV, vFuup) +GO(glIsOcclusionQueryNV, CFu) +//NV_parameter_buffer_object +GO(glProgramBufferParametersIivNV, vFuuuip) +GO(glProgramBufferParametersIuivNV, vFuuuip) +GO(glProgramBufferParametersfvNV, vFuuuip) +//NV_pixel_data_range +GO(glFlushPixelDataRangeNV, vFu) +GO(glPixelDataRangeNV, vFuip) +//NV_point_sprite +GO(glPointParameteriNV, vFui) +GO(glPointParameterivNV, vFup) +//NV_present_video +GO(glGetVideoi64vNV, vFuup) +GO(glGetVideoivNV, vFuup) +GO(glGetVideoui64vNV, vFuup) +GO(glGetVideouivNV, vFuup) +GO(glPresentFrameDualFillNV, vFuUuuuuuuuuuuu) +GO(glPresentFrameKeyedNV, vFuUuuuuuuuuu) +//NV_primitive_restart +GO(glPrimitiveRestartIndexNV, vFu) +GO(glPrimitiveRestartNV, vFv) +//NV_register_combiners +GO(glCombinerInputNV, vFuuuuuu) +GO(glCombinerOutputNV, vFuuuuuuuCCC) +GO(glCombinerParameterfNV, vFuf) +GO(glCombinerParameterfvNV, vFup) +GO(glCombinerParameteriNV, vFui) +GO(glCombinerParameterivNV, vFup) +GO(glFinalCombinerInputNV, vFuuuu) +GO(glGetCombinerInputParameterfvNV, vFuuuup) +GO(glGetCombinerInputParameterivNV, vFuuuup) +GO(glGetCombinerOutputParameterfvNV, vFuuup) +GO(glGetCombinerOutputParameterivNV, vFuuup) +GO(glGetFinalCombinerInputParameterfvNV, vFuup) +GO(glGetFinalCombinerInputParameterivNV, vFuup) +//NV_register_combiners2 +GO(glCombinerStageParameterfvNV, vFuup) +GO(glGetCombinerStageParameterfvNV, vFuup) +//NV_shader_buffer_load +GO(glGetBufferParameterui64vNV, vFuup) +GO(glGetIntegerui64vNV, vFup) +GO(glGetNamedBufferParameterui64vNV, vFuup) +GO(glGetUniformui64vNV, vFuip) +GO(glIsBufferResidentNV, CFu) +GO(glIsNamedBufferResidentNV, CFu) +GO(glMakeBufferNonResidentNV, vFu) +GO(glMakeBufferResidentNV, vFuu) +GO(glMakeNamedBufferNonResidentNV, vFu) +GO(glMakeNamedBufferResidentNV, vFuu) +GO(glProgramUniformui64NV, vFuiU) +GO(glProgramUniformui64vNV, vFuiip) +GO(glUniformui64NV, vFiU) +GO(glUniformui64vNV, vFiip) +//NV_texture_barrier +GO(glTextureBarrierNV, vFv) +//NV_texture_multisample +GO(glTexImage2DMultisampleCoverageNV, vFuiiiiiC) +GO(glTexImage3DMultisampleCoverageNV, vFuiiiiiiC) +GO(glTextureImage2DMultisampleCoverageNV, vFuuiiiiiC) +GO(glTextureImage2DMultisampleNV, vFuuiiiiC) +GO(glTextureImage3DMultisampleCoverageNV, vFuuiiiiiiC) +GO(glTextureImage3DMultisampleNV, vFuuiiiiiC) +//NV_transform_feedback +GO(glActiveVaryingNV, vFup) +GO(glBeginTransformFeedbackNV, vFu) +GO(glBindBufferBaseNV, vFuuu) +GO(glBindBufferOffsetNV, vFuuul) +GO(glBindBufferRangeNV, vFuuull) +GO(glEndTransformFeedbackNV, vFv) +GO(glGetActiveVaryingNV, vFuuipppp) +GO(glGetTransformFeedbackVaryingNV, vFuup) +GO(glGetVaryingLocationNV, iFup) +GO(glTransformFeedbackAttribsNV, vFipu) +GO(glTransformFeedbackStreamAttribsNV, vFipipu) +GO(glTransformFeedbackVaryingsNV, vFuipu) +//NV_transform_feedback2 +GO(glBindTransformFeedbackNV, vFuu) +GO(glDeleteTransformFeedbacksNV, vFip) +GO(glDrawTransformFeedbackNV, vFuu) +GO(glGenTransformFeedbacksNV, vFip) +GO(glIsTransformFeedbackNV, CFu) +GO(glPauseTransformFeedbackNV, vFv) +GO(glResumeTransformFeedbackNV, vFv) +//NV_vdpau_interop +GO(glVDPAUFiniNV, vFv) +GO(glVDPAUGetSurfaceivNV, vFluipp) +GO(glVDPAUInitNV, vFpp) +GO(glVDPAUIsSurfaceNV, CFl) +GOM(glVDPAUMapSurfacesNV, vFEip) +GO(glVDPAURegisterOutputSurfaceNV, lFpuip) +GO(glVDPAURegisterVideoSurfaceNV, lFpuip) +GO(glVDPAUSurfaceAccessNV, vFlu) +GOM(glVDPAUUnmapSurfacesNV, vFEip) +GO(glVDPAUUnregisterSurfaceNV, vFl) +//NV_vertex_array_range +GO(glFlushVertexArrayRangeNV, vFv) +GO(glVertexArrayRangeNV, vFip) +//NV_vertex_attrib_integer_64bit +GO(glGetVertexAttribLi64vNV, vFuup) +GO(glGetVertexAttribLui64vNV, vFuup) +GO(glVertexAttribL1i64NV, vFuI) +GO(glVertexAttribL1i64vNV, vFup) +GO(glVertexAttribL1ui64NV, vFuU) +GO(glVertexAttribL1ui64vNV, vFup) +GO(glVertexAttribL2i64NV, vFuII) +GO(glVertexAttribL2i64vNV, vFup) +GO(glVertexAttribL2ui64NV, vFuUU) +GO(glVertexAttribL2ui64vNV, vFup) +GO(glVertexAttribL3i64NV, vFuIII) +GO(glVertexAttribL3i64vNV, vFup) +GO(glVertexAttribL3ui64NV, vFuUUU) +GO(glVertexAttribL3ui64vNV, vFup) +GO(glVertexAttribL4i64NV, vFuIIII) +GO(glVertexAttribL4i64vNV, vFup) +GO(glVertexAttribL4ui64NV, vFuUUUU) +GO(glVertexAttribL4ui64vNV, vFup) +GO(glVertexAttribLFormatNV, vFuiui) +//NV_vertex_buffer_unified_memory +GO(glBufferAddressRangeNV, vFuuUl) +GO(glColorFormatNV, vFiui) +GO(glEdgeFlagFormatNV, vFi) +GO(glFogCoordFormatNV, vFui) +GO(glGetIntegerui64i_vNV, vFuup) +GO(glIndexFormatNV, vFui) +GO(glNormalFormatNV, vFui) +GO(glSecondaryColorFormatNV, vFiui) +GO(glTexCoordFormatNV, vFiui) +GO(glVertexAttribFormatNV, vFuiuCi) +GO(glVertexAttribIFormatNV, vFuiui) +GO(glVertexFormatNV, vFiui) +//NV_vertex_program +GO(glAreProgramsResidentNV, CFipp) +GO(glBindProgramNV, vFuu) +GO(glDeleteProgramsNV, vFip) +GO(glExecuteProgramNV, vFuup) +GO(glGenProgramsNV, vFip) +GO(glGetProgramParameterdvNV, vFuuup) +GO(glGetProgramParameterfvNV, vFuuup) +GO(glGetProgramStringNV, vFuup) +GO(glGetProgramivNV, vFuup) +GO(glGetTrackMatrixivNV, vFuuup) +GO(glGetVertexAttribPointervNV, vFuuBp_) +GO(glGetVertexAttribdvNV, vFuup) +GO(glGetVertexAttribfvNV, vFuup) +GO(glGetVertexAttribivNV, vFuup) +GO(glIsProgramNV, CFu) +GO(glLoadProgramNV, vFuuip) +GO(glProgramParameter4dNV, vFuudddd) +GO(glProgramParameter4dvNV, vFuup) +GO(glProgramParameter4fNV, vFuuffff) +GO(glProgramParameter4fvNV, vFuup) +GO(glProgramParameters4dvNV, vFuuip) +GO(glProgramParameters4fvNV, vFuuip) +GO(glRequestResidentProgramsNV, vFip) +GO(glTrackMatrixNV, vFuuuu) +GO(glVertexAttrib1dNV, vFud) +GO(glVertexAttrib1dvNV, vFup) +GO(glVertexAttrib1fNV, vFuf) +GO(glVertexAttrib1fvNV, vFup) +GO(glVertexAttrib1sNV, vFuw) +GO(glVertexAttrib1svNV, vFup) +GO(glVertexAttrib2dNV, vFudd) +GO(glVertexAttrib2dvNV, vFup) +GO(glVertexAttrib2fNV, vFuff) +GO(glVertexAttrib2fvNV, vFup) +GO(glVertexAttrib2sNV, vFuww) +GO(glVertexAttrib2svNV, vFup) +GO(glVertexAttrib3dNV, vFuddd) +GO(glVertexAttrib3dvNV, vFup) +GO(glVertexAttrib3fNV, vFufff) +GO(glVertexAttrib3fvNV, vFup) +GO(glVertexAttrib3sNV, vFuwww) +GO(glVertexAttrib3svNV, vFup) +GO(glVertexAttrib4dNV, vFudddd) +GO(glVertexAttrib4dvNV, vFup) +GO(glVertexAttrib4fNV, vFuffff) +GO(glVertexAttrib4fvNV, vFup) +GO(glVertexAttrib4sNV, vFuwwww) +GO(glVertexAttrib4svNV, vFup) +GO(glVertexAttrib4ubNV, vFuCCCC) +GO(glVertexAttrib4ubvNV, vFup) +GO(glVertexAttribPointerNV, vFuiuip) +GO(glVertexAttribs1dvNV, vFuip) +GO(glVertexAttribs1fvNV, vFuip) +GO(glVertexAttribs1svNV, vFuip) +GO(glVertexAttribs2dvNV, vFuip) +GO(glVertexAttribs2fvNV, vFuip) +GO(glVertexAttribs2svNV, vFuip) +GO(glVertexAttribs3dvNV, vFuip) +GO(glVertexAttribs3fvNV, vFuip) +GO(glVertexAttribs3svNV, vFuip) +GO(glVertexAttribs4dvNV, vFuip) +GO(glVertexAttribs4fvNV, vFuip) +GO(glVertexAttribs4svNV, vFuip) +GO(glVertexAttribs4ubvNV, vFuip) +//NV_vertex_program4 +GO(glGetVertexAttribIivEXT, vFuup) +GO(glGetVertexAttribIuivEXT, vFuup) +GO(glVertexAttribI1iEXT, vFui) +GO(glVertexAttribI1ivEXT, vFup) +GO(glVertexAttribI1uiEXT, vFuu) +GO(glVertexAttribI1uivEXT, vFup) +GO(glVertexAttribI2iEXT, vFuii) +GO(glVertexAttribI2ivEXT, vFup) +GO(glVertexAttribI2uiEXT, vFuuu) +GO(glVertexAttribI2uivEXT, vFup) +GO(glVertexAttribI3iEXT, vFuiii) +GO(glVertexAttribI3ivEXT, vFup) +GO(glVertexAttribI3uiEXT, vFuuuu) +GO(glVertexAttribI3uivEXT, vFup) +GO(glVertexAttribI4bvEXT, vFup) +GO(glVertexAttribI4iEXT, vFuiiii) +GO(glVertexAttribI4ivEXT, vFup) +GO(glVertexAttribI4svEXT, vFup) +GO(glVertexAttribI4ubvEXT, vFup) +GO(glVertexAttribI4uiEXT, vFuuuuu) +GO(glVertexAttribI4uivEXT, vFup) +GO(glVertexAttribI4usvEXT, vFup) +GO(glVertexAttribIPointerEXT, vFuiuip) +//NV_video_capture +GO(glBeginVideoCaptureNV, vFu) +GO(glBindVideoCaptureStreamBufferNV, vFuuul) +GO(glBindVideoCaptureStreamTextureNV, vFuuuuu) +GO(glEndVideoCaptureNV, vFu) +GO(glGetVideoCaptureStreamdvNV, vFuuup) +GO(glGetVideoCaptureStreamfvNV, vFuuup) +GO(glGetVideoCaptureStreamivNV, vFuuup) +GO(glGetVideoCaptureivNV, vFuup) +GO(glVideoCaptureNV, uFupp) +GO(glVideoCaptureStreamParameterdvNV, vFuuup) +GO(glVideoCaptureStreamParameterfvNV, vFuuup) +GO(glVideoCaptureStreamParameterivNV, vFuuup) +//OES_byte_coordinates +GO(glMultiTexCoord1bOES, vFuc) +GO(glMultiTexCoord1bvOES, vFup) +GO(glMultiTexCoord2bOES, vFucc) +GO(glMultiTexCoord2bvOES, vFup) +GO(glMultiTexCoord3bOES, vFuccc) +GO(glMultiTexCoord3bvOES, vFup) +GO(glMultiTexCoord4bOES, vFucccc) +GO(glMultiTexCoord4bvOES, vFup) +GO(glTexCoord1bOES, vFc) +GO(glTexCoord1bvOES, vFp) +GO(glTexCoord2bOES, vFcc) +GO(glTexCoord2bvOES, vFp) +GO(glTexCoord3bOES, vFccc) +GO(glTexCoord3bvOES, vFp) +GO(glTexCoord4bOES, vFcccc) +GO(glTexCoord4bvOES, vFp) +GO(glVertex2bOES, vFcc) +GO(glVertex2bvOES, vFp) +GO(glVertex3bOES, vFccc) +GO(glVertex3bvOES, vFp) +GO(glVertex4bOES, vFcccc) +GO(glVertex4bvOES, vFp) +//OES_fixed_point +GO(glAccumxOES, vFui) +GO(glAlphaFuncxOES, vFui) +GO(glBitmapxOES, vFiiiiiip) +GO(glBlendColorxOES, vFiiii) +GO(glClearAccumxOES, vFiiii) +GO(glClearColorxOES, vFiiii) +GO(glClearDepthxOES, vFi) +GO(glClipPlanexOES, vFup) +GO(glColor3xOES, vFiii) +GO(glColor3xvOES, vFp) +GO(glColor4xOES, vFiiii) +GO(glColor4xvOES, vFp) +GO(glConvolutionParameterxOES, vFuui) +GO(glConvolutionParameterxvOES, vFuup) +GO(glDepthRangexOES, vFii) +GO(glEvalCoord1xOES, vFi) +GO(glEvalCoord1xvOES, vFp) +GO(glEvalCoord2xOES, vFii) +GO(glEvalCoord2xvOES, vFp) +GO(glFeedbackBufferxOES, vFiup) +GO(glFogxOES, vFui) +GO(glFogxvOES, vFup) +GO(glFrustumxOES, vFiiiiii) +GO(glGetClipPlanexOES, vFup) +GO(glGetConvolutionParameterxvOES, vFuup) +GO(glGetFixedvOES, vFup) +GO(glGetHistogramParameterxvOES, vFuup) +GO(glGetLightxOES, vFuup) +GO(glGetMapxvOES, vFuup) +GO(glGetMaterialxOES, vFuui) +GO(glGetPixelMapxv, vFuip) +GO(glGetTexEnvxvOES, vFuup) +GO(glGetTexGenxvOES, vFuup) +GO(glGetTexLevelParameterxvOES, vFuiup) +GO(glGetTexParameterxvOES, vFuup) +GO(glIndexxOES, vFi) +GO(glIndexxvOES, vFp) +GO(glLightModelxOES, vFui) +GO(glLightModelxvOES, vFup) +GO(glLightxOES, vFuui) +GO(glLightxvOES, vFuup) +GO(glLineWidthxOES, vFi) +GO(glLoadMatrixxOES, vFp) +GO(glLoadTransposeMatrixxOES, vFp) +GO(glMap1xOES, vFuiiiii) +GO(glMap2xOES, vFuiiiiiiiii) +GO(glMapGrid1xOES, vFiii) +GO(glMapGrid2xOES, vFiiiii) +GO(glMaterialxOES, vFuui) +GO(glMaterialxvOES, vFuup) +GO(glMultMatrixxOES, vFp) +GO(glMultTransposeMatrixxOES, vFp) +GO(glMultiTexCoord1xOES, vFui) +GO(glMultiTexCoord1xvOES, vFup) +GO(glMultiTexCoord2xOES, vFuii) +GO(glMultiTexCoord2xvOES, vFup) +GO(glMultiTexCoord3xOES, vFuiii) +GO(glMultiTexCoord3xvOES, vFup) +GO(glMultiTexCoord4xOES, vFuiiii) +GO(glMultiTexCoord4xvOES, vFup) +GO(glNormal3xOES, vFiii) +GO(glNormal3xvOES, vFp) +GO(glOrthoxOES, vFiiiiii) +GO(glPassThroughxOES, vFi) +GO(glPixelMapx, vFuip) +GO(glPixelStorex, vFui) +GO(glPixelTransferxOES, vFui) +GO(glPixelZoomxOES, vFii) +GO(glPointParameterxvOES, vFup) +GO(glPointSizexOES, vFi) +GO(glPolygonOffsetxOES, vFii) +GO(glPrioritizeTexturesxOES, vFipp) +GO(glRasterPos2xOES, vFii) +GO(glRasterPos2xvOES, vFp) +GO(glRasterPos3xOES, vFiii) +GO(glRasterPos3xvOES, vFp) +GO(glRasterPos4xOES, vFiiii) +GO(glRasterPos4xvOES, vFp) +GO(glRectxOES, vFiiii) +GO(glRectxvOES, vFpp) +GO(glRotatexOES, vFiiii) +GO(glSampleCoverageOES, vFii) +GO(glScalexOES, vFiii) +GO(glTexCoord1xOES, vFi) +GO(glTexCoord1xvOES, vFp) +GO(glTexCoord2xOES, vFii) +GO(glTexCoord2xvOES, vFp) +GO(glTexCoord3xOES, vFiii) +GO(glTexCoord3xvOES, vFp) +GO(glTexCoord4xOES, vFiiii) +GO(glTexCoord4xvOES, vFp) +GO(glTexEnvxOES, vFuui) +GO(glTexEnvxvOES, vFuup) +GO(glTexGenxOES, vFuui) +GO(glTexGenxvOES, vFuup) +GO(glTexParameterxOES, vFuui) +GO(glTexParameterxvOES, vFuup) +GO(glTranslatexOES, vFiii) +GO(glVertex2xOES, vFi) +GO(glVertex2xvOES, vFp) +GO(glVertex3xOES, vFii) +GO(glVertex3xvOES, vFp) +GO(glVertex4xOES, vFiii) +GO(glVertex4xvOES, vFp) +//OES_query_matrix +GO(glQueryMatrixxOES, uFpp) +//OES_single_precision +GO(glClearDepthfOES, vFf) +GO(glClipPlanefOES, vFup) +GO(glDepthRangefOES, vFff) +GO(glFrustumfOES, vFffffff) +GO(glGetClipPlanefOES, vFup) +GO(glOrthofOES, vFffffff) +//PGI_misc_hints +GO(glHintPGI, vFui) +//SGIS_detail_texture +GO(glDetailTexFuncSGIS, vFuip) +GO(glGetDetailTexFuncSGIS, vFup) +//SGIS_fog_function +GO(glFogFuncSGIS, vFip) +GO(glGetFogFuncSGIS, vFp) +//SGIS_multisample +GO(glSampleMaskSGIS, vFfC) +GO(glSamplePatternSGIS, vFu) +//SGIS_pixel_texture +GO(glGetPixelTexGenParameterfvSGIS, vFup) +GO(glGetPixelTexGenParameterivSGIS, vFup) +GO(glPixelTexGenParameterfSGIS, vFuf) +GO(glPixelTexGenParameterfvSGIS, vFup) +GO(glPixelTexGenParameteriSGIS, vFui) +GO(glPixelTexGenParameterivSGIS, vFup) +//SGIS_point_parameters +GO(glPointParameterfSGIS, vFuf) +GO(glPointParameterfvSGIS, vFup) +//SGIS_sharpen_texture +GO(glGetSharpenTexFuncSGIS, vFup) +GO(glSharpenTexFuncSGIS, vFuip) +//SGIS_texture4D +GO(glTexImage4DSGIS, vFuiuiiiiiuup) +GO(glTexSubImage4DSGIS, vFuiiiiiiiiiuup) +//SGIS_texture_color_mask +GO(glTextureColorMaskSGIS, vFCCCC) +//SGIS_texture_filter4 +GO(glGetTexFilterFuncSGIS, vFuup) +GO(glTexFilterFuncSGIS, vFuuip) +//SGIX_async +GO(glAsyncMarkerSGIX, vFu) +GO(glDeleteAsyncMarkersSGIX, vFui) +GO(glFinishAsyncSGIX, iFp) +GO(glGenAsyncMarkersSGIX, uFi) +GO(glIsAsyncMarkerSGIX, CFu) +GO(glPollAsyncSGIX, iFp) +//SGIX_flush_raster +GO(glFlushRasterSGIX, vFv) +//SGIX_fragment_lighting +GO(glFragmentColorMaterialSGIX, vFuu) +GO(glFragmentLightModelfSGIX, vFuf) +GO(glFragmentLightModelfvSGIX, vFup) +GO(glFragmentLightModeliSGIX, vFui) +GO(glFragmentLightModelivSGIX, vFup) +GO(glFragmentLightfSGIX, vFuuf) +GO(glFragmentLightfvSGIX, vFuup) +GO(glFragmentLightiSGIX, vFuui) +GO(glFragmentLightivSGIX, vFuup) +GO(glFragmentMaterialfSGIX, vFuuf) +GO(glFragmentMaterialfvSGIX, vFuup) +GO(glFragmentMaterialiSGIX, vFuui) +GO(glFragmentMaterialivSGIX, vFuup) +GO(glGetFragmentLightfvSGIX, vFuup) +GO(glGetFragmentLightivSGIX, vFuup) +GO(glGetFragmentMaterialfvSGIX, vFuup) +GO(glGetFragmentMaterialivSGIX, vFuup) +GO(glLightEnviSGIX, vFui) +//SGIX_framezoom +GO(glFrameZoomSGIX, vFi) +//SGIX_igloo_interface +GO(glIglooInterfaceSGIX, vFup) +//SGIX_instruments +GO(glGetInstrumentsSGIX, iFv) +GO(glInstrumentsBufferSGIX, vFip) +GO(glPollInstrumentsSGIX, iFp) +GO(glReadInstrumentsSGIX, vFi) +GO(glStartInstrumentsSGIX, vFv) +GO(glStopInstrumentsSGIX, vFi) +//SGIX_list_priority +GO(glGetListParameterfvSGIX, vFuup) +GO(glGetListParameterivSGIX, vFuup) +GO(glListParameterfSGIX, vFuuf) +GO(glListParameterfvSGIX, vFuup) +GO(glListParameteriSGIX, vFuui) +GO(glListParameterivSGIX, vFuup) +//SGIX_pixel_texture +GO(glPixelTexGenSGIX, vFu) +//SGIX_polynomial_ffd +GO(glDeformSGIX, vFu) +GO(glDeformationMap3dSGIX, vFuddiiddiiddiip) +GO(glDeformationMap3fSGIX, vFuffiiffiiffiip) +GO(glLoadIdentityDeformationMapSGIX, vFu) +//SGIX_reference_plane +GO(glReferencePlaneSGIX, vFp) +//SGIX_sprite +GO(glSpriteParameterfSGIX, vFuf) +GO(glSpriteParameterfvSGIX, vFup) +GO(glSpriteParameteriSGIX, vFui) +GO(glSpriteParameterivSGIX, vFup) +//SGIX_tag_sample_buffer +GO(glTagSampleBufferSGIX, vFv) +//SGI_color_table +GO(glColorTableParameterfvSGI, vFuup) +GO(glColorTableParameterivSGI, vFuup) +GO(glColorTableSGI, vFuuiuup) +GO(glCopyColorTableSGI, vFuuiii) +GO(glGetColorTableParameterfvSGI, vFuup) +GO(glGetColorTableParameterivSGI, vFuup) +GO(glGetColorTableSGI, vFuuup) +//SUNX_constant_data +GO(glFinishTextureSUNX, vFv) +//SUN_global_alpha +GO(glGlobalAlphaFactorbSUN, vFc) +GO(glGlobalAlphaFactordSUN, vFd) +GO(glGlobalAlphaFactorfSUN, vFf) +GO(glGlobalAlphaFactoriSUN, vFi) +GO(glGlobalAlphaFactorsSUN, vFw) +GO(glGlobalAlphaFactorubSUN, vFC) +GO(glGlobalAlphaFactoruiSUN, vFu) +GO(glGlobalAlphaFactorusSUN, vFW) +//SUN_mesh_array +GO(glDrawMeshArraysSUN, vFuiii) +//SUN_triangle_list +GO(glReplacementCodePointerSUN, vFuibp_) +GO(glReplacementCodeubSUN, vFC) +GO(glReplacementCodeubvSUN, vFp) +GO(glReplacementCodeuiSUN, vFu) +GO(glReplacementCodeuivSUN, vFp) +GO(glReplacementCodeusSUN, vFW) +GO(glReplacementCodeusvSUN, vFp) +//SUN_vertex +GO(glColor3fVertex3fSUN, vFffffff) +GO(glColor3fVertex3fvSUN, vFpp) +GO(glColor4fNormal3fVertex3fSUN, vFffffffffff) +GO(glColor4fNormal3fVertex3fvSUN, vFppp) +GO(glColor4ubVertex2fSUN, vFCCCCff) +GO(glColor4ubVertex2fvSUN, vFpp) +GO(glColor4ubVertex3fSUN, vFCCCCfff) +GO(glColor4ubVertex3fvSUN, vFpp) +GO(glNormal3fVertex3fSUN, vFffffff) +GO(glNormal3fVertex3fvSUN, vFpp) +GO(glReplacementCodeuiColor3fVertex3fSUN, vFuffffff) +GO(glReplacementCodeuiColor3fVertex3fvSUN, vFppp) +GO(glReplacementCodeuiColor4fNormal3fVertex3fSUN, vFuffffffffff) +GO(glReplacementCodeuiColor4fNormal3fVertex3fvSUN, vFpppp) +GO(glReplacementCodeuiColor4ubVertex3fSUN, vFuCCCCfff) +GO(glReplacementCodeuiColor4ubVertex3fvSUN, vFppp) +GO(glReplacementCodeuiNormal3fVertex3fSUN, vFuffffff) +GO(glReplacementCodeuiNormal3fVertex3fvSUN, vFppp) +GO(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN, vFuffffffffffff) +GO(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN, vFppppp) +GO(glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN, vFuffffffff) +GO(glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN, vFpppp) +GO(glReplacementCodeuiTexCoord2fVertex3fSUN, vFufffff) +GO(glReplacementCodeuiTexCoord2fVertex3fvSUN, vFppp) +GO(glReplacementCodeuiVertex3fSUN, vFufff) +GO(glReplacementCodeuiVertex3fvSUN, vFpp) +GO(glTexCoord2fColor3fVertex3fSUN, vFffffffff) +GO(glTexCoord2fColor3fVertex3fvSUN, vFppp) +GO(glTexCoord2fColor4fNormal3fVertex3fSUN, vFffffffffffff) +GO(glTexCoord2fColor4fNormal3fVertex3fvSUN, vFpppp) +GO(glTexCoord2fColor4ubVertex3fSUN, vFffCCCCfff) +GO(glTexCoord2fColor4ubVertex3fvSUN, vFppp) +GO(glTexCoord2fNormal3fVertex3fSUN, vFffffffff) +GO(glTexCoord2fNormal3fVertex3fvSUN, vFppp) +GO(glTexCoord2fVertex3fSUN, vFfffff) +GO(glTexCoord2fVertex3fvSUN, vFpp) +GO(glTexCoord4fColor4fNormal3fVertex4fSUN, vFfffffffffffffff) +GO(glTexCoord4fColor4fNormal3fVertex4fvSUN, vFpppp) +GO(glTexCoord4fVertex4fSUN, vFffffffff) +GO(glTexCoord4fVertex4fvSUN, vFpp) + +//GL_ARB_polygon_offset_clamp +GO(glPolygonOffsetClamp, vFfff) + +//GL_EXT_polygon_offset_clamp +GO(glPolygonOffsetClampEXT, vFfff) + +//GL_EXT_multisampled_render_to_texture +GO(glRenderbufferStorageMultisampleEXT, vFuiuii) +GO(glFramebufferTexture2DMultisampleEXT, vFiiiuil) + +//GL_KTX_buffer_region +GO(glBufferRegionEnabled, uFv) +GO(glNewBufferRegion, uFi) +GO(glDeleteBufferRegion, vFi) +GO(glReadBufferRegion, vFuiiii) +GO(glDrawBufferRegion, vFuiiiiii) + +//GL_ARB_sparse_buffer +GO(glBufferPageCommitmentARB, vFullC) +GO(glNamedBufferPageCommitmentARB, vFullC) +GO(glNamedBufferPageCommitmentEXT, vFullC) + +//GL_ARB_sparse_texture +GO(TexPageCommitmentARB, vFiiiiiiiii) + +//glx +GO(glXBindHyperpipeSGIX, iFXi) +GO(glXBindTexImageEXT, vFXpip) +GO(glXBindSwapBarrierNV, iFXuu) +GO(glXBindSwapBarrierSGIX, vFii) +GO(glXBindVideoCaptureDeviceNV, iFXup) +GO(glXBindVideoDeviceNV, iFXuup) +GO(glXBindVideoImageNV, iFXppi) +//GO(glXChangeDrawableAttributes, vFp) +//GO(glXChangeDrawableAttributesSGIX, vFp) +GO(glXClientInfo, vFv) +GO(glXCopyContext, vFXppL) +GOM(glXChooseFBConfig, pFEXipp) +GOM(glXChooseFBConfigSGIX, pFEXipp) +GOM(glXCreateContext, pFEXppi) +GO(glXCreateContextAttribsARB, pFXppip) +GO(glXCreateContextWithConfigSGIX, pFXpipi) +GO(glXCreateGLXPbufferSGIX, pFXpuup) +//GOM(glXCreateGLXPixmap, LFEXbpLiiiLLLii_L) +GO(glXCreateGLXPixmapWithConfigSGIX, pFXpp) +//GO(glXCreateGLXVideoSourceSGIX, pFpippip) +GO(glXCreateNewContext, pFXpipi) +GO(glXCreatePbuffer, LFXpp) +GO(glXCreatePixmap, LFXpLp) +GO(glXCreateWindow, LFXpLp) +GOM(glXChooseVisual, pFEXip) +GO(glXCopyImageSubDataNV, vFXpuiiiiipuiiiiiiii) +GO(glXCopySubBufferMESA, vFXpiiii) +GO(glXDestroyContext, vFXp) +GO(glXDestroyGLXPbufferSGIX, vFXp) +GO(glXDestroyGLXPixmap, vFXL) +//GO(glXDestroyGLXVideoSourceSGIX, vFpp) +//GO(glXDestroyHyperpipeConfigSGIX, iFpi) +GO(glXDestroyPbuffer, vFXL) +GO(glXDestroyPixmap, vFXL) +GO(glXDestroyWindow, vFXL) +GO(glXEnumerateVideoCaptureDevicesNV, pFXip) +GO(glXEnumerateVideoDevicesNV, pFXip) +GO(glXFreeContextEXT, vFXp) +GO(glXGetClientString, pFXi) +//GOM(glXGetConfig, iFEXbpLiiiLLLii_ip) +GO(glXGetContextIDEXT, uFp) +GO(glXGetCurrentContext, pFv) +GO(glXGetCurrentDisplay, XFv) +GO(glXGetCurrentDrawable, LFv) +GO(glXGetCurrentReadDrawable, LFv) +//GO(glXGetDrawableAttributes, vFi) +//GO(glXGetDrawableAttributesSGIX, vFi) +GOM(glXGetFBConfigs,pFEXip) +GO(glXGetFBConfigAttrib, iFXpip) +GO(glXGetFBConfigAttribSGIX, iFXpip) +GOM(glXGetFBConfigFromVisualSGIX, pFEXp) +//GO(glXGetFBConfigsSGIX, pFpip) +GO(glXGetSelectedEvent, vFXLbL_) +GO(glXGetSelectedEventSGIX, vFXpp) +GO(glXGetVideoDeviceNV, iFXiip) +GO(glXGetVideoInfoNV, iFpippp) +GO(glXGetVideoSyncSGI, iFp) +//GO(glXGetVisualConfigs, pFpp) +GOM(glXGetVisualFromFBConfig, pFEXp) +GOM(glXGetVisualFromFBConfigSGIX, pFEXp) +//GO(glXHyperpipeAttribSGIX, iFpiiip) +//GO(glXHyperpipeConfigSGIX, iFpiipp) +GO(glXImportContextEXT, pFXu) +GO(glXIsDirect, iFXp) +GO(glXJoinSwapGroupNV, iFXpu) +//GO(glXJoinSwapGroupSGIX, vFpp) +GO(glXLockVideoCaptureDeviceNV, vFXp) +GO(glXMakeContextCurrent, iFXLLp) +GO(glXMakeCurrent, iFXLp) +GO(glXQueryContext, iFXpip) +GO(glXQueryContextInfoEXT, iFXpip) +GO(glXQueryDrawable, vFXLip) +GO(glXQueryExtension, iFXpp) +GO(glXQueryExtensionsString, pFXi) +GO(glXQueryFrameCountNV, iFXip) +GO(glXQueryGLXPbufferSGIX, vFXpip) +//GO(glXQueryHyperpipeAttribSGIX, iFpiiip) +//GO(glXQueryHyperpipeBestAttribSGIX, iFpiiipp) +//GO(glXQueryHyperpipeConfigSGIX, pFpip) +//GO(glXQueryHyperpipeNetworkSGIX, pFpp) +//GO(glXQueryMaxSwapBarriersSGIX, pFpp) +GO(glXQueryMaxSwapGroupsNV, iFXipp) +GO(glXQueryServerString, pFXii) +GO(glXQuerySwapGroupNV, iFXipp) +GO(glXQueryVersion, iFXpp) +GO(glXQueryVideoCaptureDeviceNV, iFXpip) +GO(glXReleaseTexImageEXT, vFXpi) +GO(glXReleaseVideoCaptureDeviceNV, vFXp) +GO(glXReleaseVideoDeviceNV, iFXip) +GO(glXReleaseVideoImageNV, iFXp) +GO(glXRender, vFv) +GO(glXRenderLarge, vFv) +GO(glXResetFrameCountNV, iFXi) +GO(glXSelectEvent, vFXLL) +GO(glXSelectEventSGIX, vFXpL) +GO(glXSendPbufferToVideoNV, iFXpipi) +GO(glXSwapBuffers, vFXL) +GO(glXUseXFont, vFLiii) +GO(glXVendorPrivate, vFv) +GO(glXVendorPrivateWithReply, vFv) +GO(glXWaitGL, vFv) +GO(glXWaitVideoSyncSGI, iFiip) +GO(glXWaitX, vFv) + +GOM(glXGetProcAddress, pFEp) +GOM(glXGetProcAddressARB, pFEp) + +//GLX_MESA_query_renderer +GO(glXQueryRendererIntegerMESA, iFXiiip) +GO(glXQueryCurrentRendererIntegerMESA, iFip) +GO(glXQueryRendererStringMESA, pFXiii) +GO(glXQueryCurrentRendererStringMESA, pFi) + +//GLX_OML_sync_control +GO(glXGetSyncValuesOML, iFXpppp) +GO(glXGetMscRateOML, iFXppp) +GO(glXSwapBuffersMscOML, IFXpIII) +GO(glXWaitForMscOML, iFXpIIIppp) +GO(glXWaitForSbcOML, iFXpIppp) + +//GLX_EXT_swap_control +GOM(glXSwapIntervalEXT, vFEXpi) +//GLX_EXT_swap_control_tear +//nothing + +//GLX_MESA_swap_control +GOM(glXSwapIntervalMESA, iFEi) +GO(glXGetSwapIntervalMESA, iFv) + +//GLX_SGI_swap_control +GO(glXSwapIntervalSGI, iFi) + +//GLX_NV_vertex_array_range +GO(glXAllocateMemoryNV, pFifff) +GO(glXFreeMemoryNV, vFp) + +//GLX_ARB_???? +GO(glSpecializeShaderARB, vFupupp) + +//GLX_AMD_gpu_association +GO(glXGetGPUIDsAMD, uFup) +GO(glXGetGPUInfoAMD, iFuiuup) +GO(glXGetContextGPUIDAMD, uFp) +GO(glXCreateAssociatedContextAMD, pFup) +GO(glXCreateAssociatedContextAttribsAMD, pFupp) +GO(glXDeleteAssociatedContextAMD, iFp) +GO(glXMakeAssociatedContextCurrentAMD, iFp) +GO(glXGetCurrentAssociatedContextAMD, pFv) +GO(glXBlitContextFramebufferAMD, vFpiiiiiiiiuu) + +//GL_EXT_debug_label +GO(glGetObjectLabelEXT, vFuuipp) +GO(glLabelObjectEXT, vFuuip) + +//GL_EXT_debug_marker +GO(glInsertEventMarkerEXT, vFip) +GO(glPushGroupMarkerEXT, vFip) +GO(glPopGroupMarkerEXT, vFv) + +//GL_KHR_blend_equation_advanced +GO(glBlendBarrierKHR, vFv) + +//Some various other extension +GO(glResolveMultisampleFramebufferAPPLE, vFv) +GO(glTexPageCommitmentARB, vFuiiiiiiiC) + +//GL_ARB_sample_locations +GO(glFramebufferSampleLocationsfvARB, vFuuip) +GO(glNamedFramebufferSampleLocationsfvARB, vFuuip) +GO(glEvaluateDepthValuesARB, vFv) + +//GL_ARB_parallel_shader_compile +GO(glMaxShaderCompilerThreadsARB, vFu) + +//GL_ARB_indirect_parameters +GO(glMultiDrawArraysIndirectCountARB, vFuplii) +GO(glMultiDrawElementsIndirectCountARB, vFuuplii) + +//GL_ARB_gpu_shader_int64 +GO(glUniform1i64ARB, vFiI) +GO(glUniform2i64ARB, vFiII) +GO(glUniform3i64ARB, vFiIII) +GO(glUniform4i64ARB, vFiIIII) +GO(glUniform1i64vARB, vFiip) +GO(glUniform2i64vARB, vFiip) +GO(glUniform3i64vARB, vFiip) +GO(glUniform4i64vARB, vFiip) +GO(glUniform1ui64ARB, vFiU) +GO(glUniform2ui64ARB, vFiUU) +GO(glUniform3ui64ARB, vFiUUU) +GO(glUniform4ui64ARB, vFiUUUU) +GO(glUniform1ui64vARB, vFiip) +GO(glUniform2ui64vARB, vFiip) +GO(glUniform3ui64vARB, vFiip) +GO(glUniform4ui64vARB, vFiip) +GO(glGetUniformi64vARB, vFuip) +GO(glGetUniformui64vARB, vFuip) +GO(glGetnUniformi64vARB, vFuiip) +GO(glGetnUniformui64vARB, vFuiip) +GO(glProgramUniform1i64ARB, vFuiI) +GO(glProgramUniform2i64ARB, vFuiII) +GO(glProgramUniform3i64ARB, vFuiIII) +GO(glProgramUniform4i64ARB, vFuiIIII) +GO(glProgramUniform1i64vARB, vFuiip) +GO(glProgramUniform2i64vARB, vFuiip) +GO(glProgramUniform3i64vARB, vFuiip) +GO(glProgramUniform4i64vARB, vFuiip) +GO(glProgramUniform1ui64ARB, vFuiU) +GO(glProgramUniform2ui64ARB, vFuiUU) +GO(glProgramUniform3ui64ARB, vFuiUUU) +GO(glProgramUniform4ui64ARB, vFuiUUUU) +GO(glProgramUniform1ui64vARB, vFuiip) +GO(glProgramUniform2ui64vARB, vFuiip) +GO(glProgramUniform3ui64vARB, vFuiip) +GO(glProgramUniform4ui64vARB, vFuiip) + +//GL_ARB_compute_variable_group_size +GO(glDispatchComputeGroupSizeARB, vFuuuuuu) + +//GL_ARB_ES3_2_compatibility +GO(glPrimitiveBoundingBoxARB, vFffffffff) + +//GL_ARB_bindless_texture +GO(glGetTextureHandleARB, UFu) +GO(glGetTextureSamplerHandleARB, UFuu) +GO(glMakeTextureHandleResidentARB, vFU) +GO(glMakeTextureHandleNonResidentARB, vFU) +GO(glGetImageHandleARB, UFuiCiu) +GO(glMakeImageHandleResidentARB, vFUu) +GO(glMakeImageHandleNonResidentARB, vFU) +GO(glUniformHandleui64ARB, vFiU) +GO(glUniformHandleui64vARB, vFiip) +GO(glProgramUniformHandleui64ARB, vFuiU) +GO(glProgramUniformHandleui64vARB, vFuiip) +GO(glIsTextureHandleResidentARB, CFU) +GO(glIsImageHandleResidentARB, CFU) +GO(glVertexAttribL1ui64ARB, vFuU) +GO(glVertexAttribL1ui64vARB, vFup) +GO(glGetVertexAttribLui64vARB, vFuup) + +//GL_OES_EGL_image +GO(glEGLImageTargetTexture2DOES, vFup) +GO(glEGLImageTargetRenderbufferStorageOES, vFup) + +//GL_MESA_program_debug +GOM(glProgramCallbackMESA, vFEipp) +GO(glGetProgramRegisterfvMESA, vFilpp) + +//GL_????_ATI +GO(glBlendEquationSeparateATI, vFuu) + +//GL_AMD_interleaved_elements +GO(glVertexAttribParameteriAMD, vFuui) + +//GL_AMD_occlusion_query_event +GO(glQueryObjectParameteruiAMD, vFuuuu) + +//GL_EXT_raster_multisample +GO(glRasterSamplesEXT, vFuC) + +//GL_INTEL_performance_query +GO(glBeginPerfQueryINTEL, vFu) +GO(glCreatePerfQueryINTEL, vFup) +GO(glDeletePerfQueryINTEL, vFu) +GO(glEndPerfQueryINTEL, vFu) +GO(glGetFirstPerfQueryIdINTEL, vFp) +GO(glGetNextPerfQueryIdINTEL, vFup) +GO(glGetPerfCounterInfoINTEL, vFuuupupppppp) +GO(glGetPerfQueryDataINTEL, vFuuipp) +GO(glGetPerfQueryIdByNameINTEL, vFpp) +GO(glGetPerfQueryInfoINTEL, vFuuppppp) + +//GL_NV_bindless_multi_draw_indirect +GO(glMultiDrawArraysIndirectBindlessNV, vFupiii) +GO(glMultiDrawElementsIndirectBindlessNV, vFuupiii) + +//GL_NV_bindless_multi_draw_indirect_count +GO(glMultiDrawArraysIndirectBindlessCountNV, vFupiiii) +GO(glMultiDrawElementsIndirectBindlessCountNV, vFuupiiii) + +//GL_NV_blend_equation_advanced +GO(glBlendParameteriNV, vFui) +GO(glBlendBarrierNV, vFv) + +//GL_NV_command_list +GO(glCreateStatesNV, vFip) +GO(glDeleteStatesNV, vFip) +GO(glIsStateNV, CFu) +GO(glStateCaptureNV, vFuu) +GO(glGetCommandHeaderNV, uFuu) +GO(glGetStageIndexNV, WFu) +//GO(glDrawCommandsNV, vFuubl_pu) +GO(glDrawCommandsAddressNV, vFuppu) +//GO(glDrawCommandsStatesNV, vFubl_pppu) +GO(glDrawCommandsStatesAddressNV, vFppppu) +GO(glCreateCommandListsNV, vFip) +GO(glDeleteCommandListsNV, vFip) +GO(glIsCommandListNV, CFu) +//GO(glListDrawCommandsStatesClientNV, vFuubp_pppu) +GO(glCommandListSegmentsNV, vFuu) +GO(glCompileCommandListNV, vFu) +GO(glCallCommandListNV, vFu) + +//GL_NV_conservative_raster +GO(glSubpixelPrecisionBiasNV, vFuu) + +//GL_NV_fragment_coverage_to_color +GO(glFragmentCoverageColorNV, vFu) + +//GL_NV_framebuffer_mixed_samples +GO(glCoverageModulationTableNV, vFip) +GO(glGetCoverageModulationTableNV, vFip) +GO(glCoverageModulationNV, vFu) + +//GL_NV_internalformat_sample_query +GO(glGetInternalformatSampleivNV, vFuuiuip) + +//GL_NV_path_rendering +GO(glGenPathsNV, uFi) +GO(glDeletePathsNV, vFui) +GO(glIsPathNV, CFu) +GO(glPathCommandsNV, vFuipiup) +GO(glPathCoordsNV, vFuiup) +GO(glPathSubCommandsNV, vFuiiipiup) +GO(glPathSubCoordsNV, vFuiiup) +GO(glPathStringNV, vFuuip) +GO(glPathGlyphsNV, vFuupuiupuuf) +GO(glPathGlyphRangeNV, vFuupuuiuuf) +GO(glWeightPathsNV, vFuipp) +GO(glCopyPathNV, vFuu) +GO(glInterpolatePathsNV, vFuuuf) +GO(glTransformPathNV, vFuuup) +GO(glPathParameterivNV, vFuup) +GO(glPathParameteriNV, vFuui) +GO(glPathParameterfvNV, vFuup) +GO(glPathParameterfNV, vFuuf) +GO(glPathDashArrayNV, vFuip) +GO(glPathStencilFuncNV, vFuiu) +GO(glPathStencilDepthOffsetNV, vFff) +GO(glStencilFillPathNV, vFuuu) +GO(glStencilStrokePathNV, vFuiu) +GO(glStencilFillPathInstancedNV, vFiupuuuup) +GO(glStencilStrokePathInstancedNV, vFiupuiuup) +GO(glPathCoverDepthFuncNV, vFu) +GO(glCoverFillPathNV, vFuu) +GO(glCoverStrokePathNV, vFuu) +GO(glCoverFillPathInstancedNV, vFiupuuup) +GO(glCoverStrokePathInstancedNV, vFiupuuup) +GO(glGetPathParameterivNV, vFuup) +GO(glGetPathParameterfvNV, vFuup) +GO(glGetPathCommandsNV, vFup) +GO(glGetPathCoordsNV, vFup) +GO(glGetPathDashArrayNV, vFup) +GO(glGetPathMetricsNV, vFuiupuip) +GO(glGetPathMetricRangeNV, vFuuiip) +GO(glGetPathSpacingNV, vFuiupuffup) +GO(glIsPointInFillPathNV, CFuuff) +GO(glIsPointInStrokePathNV, CFuff) +GO(glGetPathLengthNV, fFuii) +GO(glPointAlongPathNV, CFuiifpppp) +GO(glMatrixLoad3x2fNV, vFup) +GO(glMatrixLoad3x3fNV, vFup) +GO(glMatrixLoadTranspose3x3fNV, vFup) +GO(glMatrixMult3x2fNV, vFup) +GO(glMatrixMult3x3fNV, vFup) +GO(glMatrixMultTranspose3x3fNV, vFup) +GO(glStencilThenCoverFillPathNV, vFuuuu) +GO(glStencilThenCoverStrokePathNV, vFuiuu) +GO(glStencilThenCoverFillPathInstancedNV, vFiupuuuuup) +GO(glStencilThenCoverStrokePathInstancedNV, vFiupuiuuup) +GO(glPathGlyphIndexRangeNV, uFupuufp) +GO(glPathGlyphIndexArrayNV, uFuupuuiuf) +GO(glPathMemoryGlyphIndexArrayNV, uFuulpiuiuf) +GO(glProgramPathFragmentInputGenNV, vFuiuip) +GO(glGetProgramResourcefvNV, vFuuuipipp) +GO(glPathColorGenNV, vFuuup) +GO(glPathTexGenNV, vFuuip) +GO(glPathFogGenNV, vFu) +GO(glGetPathColorGenivNV, vFuup) +GO(glGetPathColorGenfvNV, vFuup) +GO(glGetPathTexGenivNV, vFuup) +GO(glGetPathTexGenfvNV, vFuup) + + +//GL_NV_sample_locations +GO(glFramebufferSampleLocationsfvNV, vFuuip) +GO(glNamedFramebufferSampleLocationsfvNV, vFuuip) +GO(glResolveDepthValuesNV, vFv) + +//GL_KHR_robustness +GO(glGetGraphicsResetStatusKHR, iFv) +GO(glReadnPixelsKHR, vFiilliilp) +GO(glGetnUniformfvKHR, vFuilp) +GO(glGetnUniformivKHR, vFuilp) +GO(glGetnUniformuivKHR, vFuilp) + +// GLES stuff +GO(glDiscardFramebuffer, vFilp) +GO(glDiscardFramebufferARB, vFilp) +GO(glDiscardFramebufferEXT, vFilp) +GO(glDiscardFramebufferOES, vFilp) +GO(glDiscardFramebufferANGLE, vFilp) +GO(glDiscardFramebufferNV, vFilp) +GO(glBlendBarrier, vFv) +GO(glBlendBarrierARB, vFv) +GO(glBlendBarrierEXT, vFv) +GO(glBlendBarrierOES, vFv) +GO(glBlendBarrierANGLE, vFv) +GO(glClearDepthfARB, vFf) +GO(glClipPlanefARB, vFup) +GO(glDepthRangefARB, vFff) +GO(glFrustumfARB, vFffffff) +GO(glGetClipPlanefARB, vFup) +GO(glOrthofARB, vFffffff) +GO(glClipPlanef, vFup) +GO(glFrustumf, vFffffff) +GO(glGetClipPlanef, vFup) +GO(glOrthof, vFffffff) +GO(glActiveShaderProgramEXT, vFuu) +GO(glBindProgramPipelineEXT, vFu) +GO(glCreateShaderProgramvEXT, uFilp) +GO(glDeleteProgramPipelinesEXT, vFilu) +GO(glGenProgramPipelinesEXT, vFlp) +GO(glGetProgramPipelineInfoLogEXT, vFulpp) +GO(glGetProgramPipelineivEXT, vFuip) +GO(glIsProgramPipelineEXT, iFu) +GO(glUseProgramStagesEXT, vFuuu) +GO(glValidateProgramPipelineEXT, vFu) +GO(glPrimitiveBoundingBox, vFffffffff) + +// GL_EXT_window_rectangles +GO(glWindowRectanglesEXT, vFuip) + +// GL_EXT_memory_object +GO(glGetUnsignedBytevEXT, vFup) +GO(glGetUnsignedBytei_vEXT, vFuup) +GO(glDeleteMemoryObjectsEXT, vFip) +GO(glIsMemoryObjectEXT, CFu) +GO(glCreateMemoryObjectsEXT, vFip) +GO(glMemoryObjectParameterivEXT, vFuup) +GO(glGetMemoryObjectParameterivEXT, vFuup) +GO(glTexStorageMem2DEXT, vFuiuiiuU) +GO(glTexStorageMem2DMultisampleEXT, vFuiuiiCuU) +GO(glTexStorageMem3DEXT, vFuiuiiiuU) +GO(glTexStorageMem3DMultisampleEXT, vFuiuiiiCuU) +GO(glBufferStorageMemEXT, vFuluU) +GO(glTextureStorageMem2DEXT, vFuiuiiuU) +GO(glTextureStorageMem2DMultisampleEXT, vFuiuiiCuU) +GO(glTextureStorageMem3DEXT, vFuiuiiiuU) +GO(glTextureStorageMem3DMultisampleEXT, vFuiuiiiCuU) +GO(glNamedBufferStorageMemEXT, vFuluU) +GO(glTexStorageMem1DEXT, vFuiuiuU) +GO(glTextureStorageMem1DEXT, vFuiuiuU) + +// GL_EXT_semaphore +GO(glGenSemaphoresEXT, vFip) +GO(glDeleteSemaphoresEXT, vFip) +GO(glIsSemaphoreEXT, CFu) +GO(glSemaphoreParameterui64vEXT, vFuup) +GO(glGetSemaphoreParameterui64vEXT, vFuup) +GO(glWaitSemaphoreEXT, vFuupupp) +GO(glSignalSemaphoreEXT, vFuupupp) + +// GL_EXT_memory_object_fd +GO(glImportMemoryFdEXT, vFuUui) + +// GL_KHR_parallel_shader_compile +GO(glMaxShaderCompilerThreadsKHR, vFu) + +// GL_AMD_framebuffer_multisample_advanced +GO(glRenderbufferStorageMultisampleAdvancedAMD, vFuiiuii) +GO(glNamedRenderbufferStorageMultisampleAdvancedAMD, vFuiiuii) + +// GL_EXT_semaphore_fd +GO(glImportSemaphoreFdEXT, vFuui) + +// GLX_SGI_make_current_read +GO(glXMakeCurrentReadSGI, iFpppp) +GO(glXGetCurrentReadDrawableSGI, pFv) + +// GL_IMG_multisampled_render_to_texture +GO(glFramebufferTexture2DMultisampleIMG, vFiiiuil) +GO(glRenderbufferStorageMultisampleIMG, vFilill) + +// GL_ANGLE_translated_shader_source +GO(glGetTranslatedShaderSourceANGLE, vFulpp) + +// GL_EXT_EGL_image_storage +GO(glEGLImageTargetTexStorageEXT, vFupp) +GO(glEGLImageTargetTextureStorageEXT, vFupp) + +// GL_EXT_external_buffer +GO(glBufferStorageExternalEXT, vFullpu) +GO(glNamedBufferStorageExternalEXT, vFullpu) + +// GL_EXT_memory_object_win32 +GO(glImportMemoryWin32HandleEXT, vFuUup) +GO(glImportMemoryWin32NameEXT, vFuUup) + +// GL_EXT_semaphore_win32 +GO(glImportSemaphoreWin32HandleEXT, vFuup) +GO(glImportSemaphoreWin32NameEXT, vFuup) + +// GL_EXT_shader_framebuffer_fetch_non_coherent +GO(glFramebufferFetchBarrierEXT, vFv) + +// GL_EXT_win32_keyed_mutex +GO(glAcquireKeyedMutexWin32EXT, CFuUu) +GO(glReleaseKeyedMutexWin32EXT, CFuU) + +// GL_INTEL_framebuffer_CMAA +GO(glApplyFramebufferAttachmentCMAAINTEL, vFv) + +// GL_NV_alpha_to_coverage_dither_control +GO(glAlphaToCoverageDitherControlNV, vFu) + +// GL_NV_clip_space_w_scaling +GO(glViewportPositionWScaleNV, vFuff) + +// GL_NV_conservative_raster_dilate +GO(glConservativeRasterParameterfNV, vFuf) + +// GL_NV_conservative_raster_pre_snap_triangles +GO(glConservativeRasterParameteriNV, vFui) + +// GL_NV_draw_vulkan_image +GO(glDrawVkImageNV, vFUufffffffff) +GOM(glGetVkProcAddrNV, pFEp) +GO(glWaitVkSemaphoreNV, vFU) +GO(glSignalVkSemaphoreNV, vFU) +GO(glSignalVkFenceNV, vFU) + +// GL_NV_gpu_multicast +GO(glRenderGpuMaskNV, vFu) +GO(glMulticastBufferSubDataNV, vFuullp) +GO(glMulticastCopyBufferSubDataNV, vFuuuulll) +GO(glMulticastCopyImageSubDataNV, vFuuuuiiiiuuiiiiiii) +GO(glMulticastBlitFramebufferNV, vFuuiiiiiiiiuu) +GO(glMulticastFramebufferSampleLocationsfvNV, vFuuuip) +GO(glMulticastBarrierNV, vFv) +GO(glMulticastWaitSyncNV, vFuu) +GO(glMulticastGetQueryObjectivNV, vFuuup) +GO(glMulticastGetQueryObjectuivNV, vFuuup) +GO(glMulticastGetQueryObjecti64vNV, vFuuup) +GO(glMulticastGetQueryObjectui64vNV, vFuuup) + +// GL_NV_memory_attachment +GO(glGetMemoryObjectDetachedResourcesuivNV, vFuuiip) +GO(glResetMemoryObjectParameterNV, vFuu) +GO(glTexAttachMemoryNV, vFuuU) +GO(glBufferAttachMemoryNV, vFuuU) +GO(glTextureAttachMemoryNV, vFuuU) +GO(glNamedBufferAttachMemoryNV, vFuuU) + +// GL_NV_mesh_shader +GO(glDrawMeshTasksNV, vFuu) +GO(glDrawMeshTasksIndirectNV, vFl) +GO(glMultiDrawMeshTasksIndirectNV, vFlii) +GO(glMultiDrawMeshTasksIndirectCountNV, vFllii) + +// GL_NV_query_resource +GO(glQueryResourceNV, iFuiup) + +// GL_NV_query_resource_tag +GO(glGenQueryResourceTagNV, vFip) +GO(glDeleteQueryResourceTagNV, vFip) +GO(glQueryResourceTagNV, vFip) + +// GL_NV_scissor_exclusive +GO(glScissorExclusiveArrayvNV, vFuip) +GO(glScissorExclusiveNV, vFiiii) + +// GL_NV_shading_rate_image +GO(glBindShadingRateImageNV, vFu) +GO(glShadingRateImagePaletteNV, vFuuip) +GO(glGetShadingRateImagePaletteNV, vFuup) +GO(glShadingRateImageBarrierNV, vFC) +GO(glShadingRateSampleOrderNV, vFu) +GO(glShadingRateSampleOrderCustomNV, vFuup) +GO(glGetShadingRateSampleLocationivNV, vFuuup) + +// GL_NV_viewport_swizzle +GO(glViewportSwizzleNV, vFuuuuu) + +// GL_OVR_multiview +GO(glFramebufferTextureMultiviewOVR, vFuuuiii) +GO(glNamedFramebufferTextureMultiviewOVR, vFuiuiil) + +// GL_AMD_framebuffer_sample_positions +GO(glFramebufferSamplePositionsfvAMD, vFuuup) +GO(glNamedFramebufferSamplePositionsfvAMD, vFuuup) +GO(glGetFramebufferParameterfvAMD, vFuuuuip) +GO(glGetNamedFramebufferParameterfvAMD, vFuuuuip) + +// GL_ANGLE_framebuffer_blit +GO(glBlitFramebufferANGLE, vFiiiiiiiiui) + +// GL_ANGLE_framebuffer_multisample +GO(glRenderbufferStorageMultisampleANGLE, vFilill) + +// GL_ANGLE_instanced_arrays +GO(glDrawArraysInstancedANGLE, vFiill) +GO(glDrawElementsInstancedANGLE, vFilipl) +GO(glVertexAttribDivisorANGLE, vFuu) + +// GL_ANGLE_timer_query +GO(glBeginQueryANGLE, vFiu) +GO(glDeleteQueriesANGLE, vFlp) +GO(glEndQueryANGLE, vFi) +GO(glGenQueriesANGLE, vFlp) +GO(glGetQueryObjecti64vANGLE, vFuip) +GO(glGetQueryObjectivANGLE, vFuip) +GO(glGetQueryObjectui64vANGLE, vFuip) +GO(glGetQueryObjectuivANGLE, vFuip) +GO(glGetQueryivANGLE, vFiip) +GO(glIsQueryANGLE, iFu) +GO(glQueryCounterANGLE, vFui) + +// GL_APPLE_copy_texture_levels +GO(glCopyTextureLevelsAPPLE, vFuuil) + +// GL_APPLE_framebuffer_multisample +GO(glRenderbufferStorageMultisampleAPPLE, vFilill) + +// GL_APPLE_sync +GO(glFenceSyncAPPLE, pFiu) +GO(glIsSyncAPPLE, iFp) +GO(glDeleteSyncAPPLE, vFp) +GO(glClientWaitSyncAPPLE, iFpuU) +GO(glWaitSyncAPPLE, vFpuU) +GO(glGetInteger64vAPPLE, vFip) +GO(glGetSyncivAPPLE, vFpilpp) + +// GL_EXT_base_instance +GO(glDrawArraysInstancedBaseInstanceEXT, vFiillu) +GO(glDrawElementsInstancedBaseInstanceEXT, vFiliplu) +GO(glDrawElementsInstancedBaseVertexBaseInstanceEXT, vFilipliu) + +// GL_EXT_blend_func_extended +GO(glBindFragDataLocationIndexedEXT, vFuuup) +GO(glGetProgramResourceLocationIndexEXT, iFuip) +GO(glGetFragDataIndexEXT, iFup) + +// GL_EXT_buffer_storage +GO(glBufferStorageEXT, vFilpu) + +// GL_EXT_clear_texture +GO(glClearTexImageEXT, vFuiiip) +GO(glClearTexSubImageEXT, vFuiiiillliip) + +// GL_EXT_copy_image +GO(glCopyImageSubDataEXT, vFuiiiiiuiiiiilll) + +// GL_EXT_draw_buffers +GO(glDrawBuffersEXT, vFlp) + +// GL_EXT_draw_buffers_indexed +GO(glEnableiEXT, vFiu) +GO(glDisableiEXT, vFiu) +GO(glBlendEquationiEXT, vFui) +GO(glBlendEquationSeparateiEXT, vFuii) +GO(glBlendFunciEXT, vFuii) +GO(glBlendFuncSeparateiEXT, vFuiiii) +GO(glColorMaskiEXT, vFuiiii) +GO(glIsEnablediEXT, iFui) + +// GL_EXT_draw_elements_base_vertex +GO(glDrawElementsBaseVertexEXT, vFilipi) +GO(glDrawRangeElementsBaseVertexEXT, vFilulipi) +GO(glDrawElementsInstancedBaseVertexEXT, vFilipli) + +// GL_OES_draw_elements_base_vertex +GO(glDrawElementsBaseVertexOES, vFilipi) +GO(glDrawRangeElementsBaseVertexOES, vFiuulipi) +GO(glDrawElementsInstancedBaseVertexOES, vFilipli) +GO(glMultiDrawElementsBaseVertexEXT, vFipiplp) + +// GL_EXT_fragment_lighting +GO(glFragmentLightModeliEXT, vFii) +GO(glFragmentLightModelfEXT, vFif) +GO(glFragmentLightModelivEXT, vFip) +GO(glFragmentLightModelfvEXT, vFip) +GO(glFragmentLightiEXT, vFiii) +GO(glFragmentLightfEXT, vFiif) +GO(glFragmentLightivEXT, vFiip) +GO(glFragmentLightfvEXT, vFiip) +GO(glGetFragmentLightivEXT, vFiip) +GO(glGetFragmentLightfvEXT, vFiip) +GO(glFragmentMaterialfEXT, vFiif) +GO(glFragmentMaterialiEXT, vFiii) +GO(glFragmentMaterialfvEXT, vFiip) +GO(glFragmentMaterialivEXT, vFiip) +GO(glFragmentColorMaterialEXT, vFii) +GO(glGetFragmentMaterialfvEXT, vFiip) +GO(glGetFragmentMaterialivEXT, vFiip) +GO(glLightEnviEXT, vFii) + +// GL_EXT_instanced_arrays +GO(glVertexAttribDivisorEXT, vFuu) + +// GL_EXT_map_buffer_range +GO(glMapBufferRangeEXT, pFillu) +GO(glFlushMappedBufferRangeEXT, vFill) + +// GL_EXT_multi_draw_indirect +GO(glMultiDrawArraysIndirectEXT, vFipll) +GO(glMultiDrawElementsIndirectEXT, vFiipll) + +// GL_EXT_multiview_draw_buffers +GO(glReadBufferIndexedEXT, vFii) +GO(glDrawBuffersIndexedEXT, vFipp) +GO(glGetIntegeri_vEXT, vFiup) + +// GL_EXT_scene_marker +GO(glBeginSceneEXT, vFv) +GO(glEndSceneEXT, vFv) + +// GL_EXT_shader_pixel_local_storage2 +GO(glFramebufferPixelLocalStorageSizeEXT, vFul) +GO(glGetFramebufferPixelLocalStorageSizeEXT, lFu) +GO(glClearPixelLocalStorageuiEXT, vFllp) + +// GL_EXT_sparse_texture +GO(glTexPageCommitmentEXT, vFiiiiillli) + +// GL_EXT_texture_storage +GO(glTexStorage1DEXT, vFuiui) +GO(glTexStorage2DEXT, vFuiuii) +GO(glTexStorage3DEXT, vFuiuiii) + +// GL_EXT_texture_view +GO(glTextureViewEXT, vFuiuiuuuu) + +// GL_EXT_vertex_array_setXXX +GO(glCreateArraySetExt, pFv) +GO(glBindArraySetEXT, vFp) +GO(glDeleteArraySetsEXT, vFlp) + +// GL_INTEL_texture_scissor +GO(glTexScissorINTEL, vFiff) +GO(glTexScissorFuncINTEL, vFiii) + +// GL_NVX_linked_gpu_multicast +GO(glLGPUNamedBufferSubDataNVX, vFuullp) +GO(glLGPUCopyImageSubDataNVX, vFuuuuiiiiuuiiiiiii) +GO(glLGPUInterlockNVX, vFv) + +// GL_NV_3dvision_settings +GO(glStereoParameteriNV, vFii) +GO(glStereoParameterfNV, vFif) + +// GL_NV_copy_buffer +GO(glCopyBufferSubDataNV, vFiilll) + +// GL_NV_draw_buffers +GO(glDrawBuffersNV, vFlp) + +// GL_NV_draw_instanced +GO(glDrawArraysInstancedNV, vFiill) +GO(glDrawElementsInstancedNV, vFilipl) + +// GL_NV_framebuffer_blit +GO(glBlitFramebufferNV, vFiiiiiiiiui) + +// GL_NV_framebuffer_multisample +GO(glRenderbufferStorageMultisampleNV, vFilill) + +// GL_NV_instanced_arrays +GO(glVertexAttribDivisorNV, vFuu) + +// GL_NV_non_square_matrices +GO(glUniformMatrix2x3fvNV, vFilip) +GO(glUniformMatrix3x2fvNV, vFilip) +GO(glUniformMatrix2x4fvNV, vFilip) +GO(glUniformMatrix4x2fvNV, vFilip) +GO(glUniformMatrix3x4fvNV, vFilip) +GO(glUniformMatrix4x3fvNV, vFilip) + +// GL_NV_polygon_mode +GO(glPolygonModeNV, vFii) + +// GL_NV_texture_array +GO(glTexImage3DNV, vFiiillliiip) +GO(glTexSubImage3DNV, vFiiiiillliip) +GO(glCopyTexSubImage3DNV, vFiiiiiiill) +GO(glCompressedTexImage3DNV, vFiiilllilp) +GO(glCompressedTexSubImage3DNV, vFiiiiilllilp) +GO(glFramebufferTextureLayerNV, vFiiuii) + +// GL_NV_viewport_array +GO(glViewportArrayvNV, vFulp) +GO(glViewportIndexedfNV, vFuffff) +GO(glViewportIndexedfvNV, vFup) +GO(glScissorArrayvNV, vFulp) +GO(glScissorIndexedNV, vFuiill) +GO(glScissorIndexedvNV, vFup) +GO(glDepthRangeArrayfvNV, vFulp) +GO(glDepthRangeIndexedfNV, vFuff) +GO(glGetFloati_vNV, vFiup) +GO(glEnableiNV, vFiu) +GO(glDisableiNV, vFiu) +GO(glIsEnablediNV, iFiu) + +// GL_OVR_multiview_multisampled_render_to_texture +GO(glFramebufferTextureMultisampleMultiviewOVR, vFiiuilil) + +// GL_QCOM_alpha_test +GO(glAlphaFuncQCOM, vFif) + +// GL_QCOM_driver_control +GO(glGetDriverControlsQCOM, vFplp) +GO(glGetDriverControlStringQCOM, vFulpp) +GO(glEnableDriverControlQCOM, vFu) +GO(glDisableDriverControlQCOM, vFu) + +// GL_QCOM_extended_get +GO(glExtGetTexturesQCOM, vFpip) +GO(glExtGetBuffersQCOM, vFpip) +GO(glExtGetRenderbuffersQCOM, vFpip) +GO(glExtGetFramebuffersQCOM, vFpip) +GO(glExtGetTexLevelParameterivQCOM, vFuiiip) +GO(glExtTexObjectStateOverrideiQCOM, vFiii) +GO(glExtGetTexSubImageQCOM, vFiiiiillliip) +GO(glExtGetBufferPointervQCOM, vFip) + +// GL_QCOM_extended_get2 +GO(glExtGetShadersQCOM, vFpip) +GO(glExtGetProgramsQCOM, vFpip) +GO(glExtIsProgramBinaryQCOM, iFu) +GO(glExtGetProgramBinarySourceQCOM, vFuipp) + +// GL_QCOM_framebuffer_foveated +GO(glFramebufferFoveationConfigQCOM, vFuuuup) +GO(glFramebufferFoveationParametersQCOM, vFuuufffff) + +// GL_QCOM_shader_framebuffer_fetch_noncoherent +GO(glFramebufferFetchBarrierQCOM, vFv) + +// GL_QCOM_tiled_rendering +GO(glStartTilingQCOM, vFuuuuu) +GO(glEndTilingQCOM, vFu) + +// GLES fixed point +GO(glAlphaFuncx, vFii) +GO(glClearColorx, vFiiii) +GO(glClearDepthx, vFi) +GO(glClipPlanex, vFip) +GO(glColor4x, vFiiii) +GO(glDepthRangex, vFii) +GO(glFogx, vFii) +GO(glFogxv, vFip) +GO(glFrustumx, vFiiiiii) +GO(glGetClipPlanex, vFip) +GO(glGetFixedv, vFip) +GO(glGetTexEnvxv, vFiip) +GO(glGetTexParameterxv, vFiip) +GO(glLightModelx, vFii) +GO(glLightModelxv, vFip) +GO(glLightx, vFiii) +GO(glLightxv, vFiip) +GO(glLineWidthx, vFi) +GO(glLoadMatrixx, vFp) +GO(glMaterialx, vFiii) +GO(glMaterialxv, vFiip) +GO(glMultMatrixx, vFp) +GO(glMultiTexCoord4x, vFiiiii) +GO(glNormal3x, vFiiii) +GO(glOrthox, vFiiiiii) +GO(glPointParameterxv, vFip) +GO(glPointSizex, vFi) +GO(glPolygonOffsetx, vFii) +GO(glRotatex, vFiiii) +GO(glScalex, vFiii) +GO(glTexEnvx, vFiii) +GO(glTexEnvxv, vFiip) +GO(glTexParameterx, vFiii) +GO(glTexParameterxv, vFiip) +GO(glTranslatex, vFiii) +GO(glAccumx, vFii) +GO(glBitmapx, vFlliiiip) +GO(glBlendColorx, vFiiii) +GO(glClearAccumx, vFiiii) +GO(glColor3x, vFiii) +GO(glColor3xv, vFp) +GO(glColor4xv, vFp) +GO(glConvolutionParameterx, vFiii) +GO(glConvolutionParameterxv, vFiip) +GO(glEvalCoord1x, vFi) +GO(glEvalCoord1xv, vFp) +GO(glEvalCoord2x, vFii) +GO(glEvalCoord2xv, vFp) +GO(glFeedbackBufferx, vFlip) +GO(glGetConvolutionParameterxv, vFiip) +GO(glGetHistogramParameterxv, vFiip) +GO(glGetLightx, vFiip) +GO(glGetMapxv, vFiip) +GO(glGetMaterialx, vFiii) +GO(glGetTexGenxv, vFiip) +GO(glGetTexLevelParameterxv, vFiiip) +GO(glIndexx, vFi) +GO(glIndexxv, vFp) +GO(glLoadTransposeMatrixx, vFp) +GO(glMap1x, vFiiiiii) +GO(glMap2x, vFiiiiiiiiii) +GO(glMapGrid1x, vFiii) +GO(glMapGrid2x, vFiiiii) +GO(glMultTransposeMatrixx, vFp) +GO(glMultiTexCoord1x, vFii) +GO(glMultiTexCoord1xv, vFip) +GO(glMultiTexCoord2x, vFiii) +GO(glMultiTexCoord2xv, vFip) +GO(glMultiTexCoord3x, vFiiii) +GO(glMultiTexCoord3xv, vFip) +GO(glMultiTexCoord4xv, vFip) +GO(glNormal3xv, vFp) +GO(glPassThroughx, vFi) +GO(glPixelM, vFiip) +GO(glPixelSto, vFii) +GO(glPixelTransferx, vFii) +GO(glPixelZoomx, vFii) +GO(glPrioritizeTexturesx, vFlpp) +GO(glRasterPos2x, vFii) +GO(glRasterPos2xv, vFp) +GO(glRasterPos3x, vFiii) +GO(glRasterPos3xv, vFp) +GO(glRasterPos4x, vFiiii) +GO(glRasterPos4xv, vFp) +GO(glRectx, vFiiii) +GO(glRectxv, vFpp) +GO(glTexCoord1x, vFi) +GO(glTexCoord1xv, vFp) +GO(glTexCoord2x, vFii) +GO(glTexCoord2xv, vFp) +GO(glTexCoord3x, vFiii) +GO(glTexCoord3xv, vFp) +GO(glTexCoord4x, vFiiii) +GO(glTexCoord4xv, vFp) +GO(glTexGenx, vFiii) +GO(glTexGenxv, vFiip) +GO(glVertex2x, vFi) +GO(glVertex2xv, vFp) +GO(glVertex3x, vFii) +GO(glVertex3xv, vFp) +GO(glVertex4x, vFiii) +GO(glVertex4xv, vFp) + +// GL_OES_point_size +GO(glPointSizePointerOES, vFilp) + +// GL_REGAL_error_string +GO(glErrorStringREGAL, pFi) + +// GL_REGAL_extension_query +GO(glGetExtensionREGAL, iFp) +GO(glIsSupportedREGAL, iFp) + +//glLogMessageCallbackREGAL +//glGetProcAddressREGAL + +// GL_SGIS_multitexture +GO(glInterleavedTextureCoordSetsSGIS, vFi) +GO(glSelectTextureCoordSetSGIS, vFi) +GO(glSelectTextureSGIS, vFi) +GO(glSelectTextureTransformSGIS, vFi) + +// GL_SGIS_shared_multisample +GO(glMultisampleSubRectPosSGIS, vFii) + +// GL_SGIX_datapipe +GO(glAddressSpace, vFiu) +GO(glDataPipe, iFi) + +// GL_SGIX_fog_layers +GO(glFogLayersSGIX, vFlp) +GO(glGetFogLayersSGIX, vFp) + +// GL_SGIX_fog_texture +GO(glTextureFogSGIX, vFu) + +// GL_ANGLE_request_extension +GO(glDisableExtensionANGLE, vFp) +GO(glRequestExtensionANGLE, vFp) + +// GL_KHR_debug +GO(glDebugMessageControlKHR, vFiiilpi) +GO(glDebugMessageInsertKHR, vFiiuilp) +GOM(glDebugMessageCallbackKHR, vFEpp) +GO(glGetDebugMessageLogKHR, uFulpppppp) +GO(glPushDebugGroupKHR, vFiulp) +GO(glPopDebugGroupKHR, vFv) +GO(glObjectLabelKHR, vFiulp) +GO(glGetObjectLabelKHR, vFiulpp) +GO(glObjectPtrLabelKHR, vFplp) +GO(glGetObjectPtrLabelKHR, vFplpp) +GO(glGetPointervKHR, vFip) + +// WGL_EXT_swap_control +GO(wglSwapIntervalEXT, iFi) +GO(wglGetSwapIntervalEXT, iFv) + +// GL_MESA_framebuffer_flip_y +GO(glFramebufferParameteriMESA, vFuui) +GO(glGetFramebufferParameterivMESA, vFuup) + +// GL_NVX_gpu_multicast2 +GO(glUploadGpuMaskNVX, vFu) +GO(glMulticastViewportArrayvNVX, vFuuip) +GO(glMulticastViewportPositionWScaleNVX, vFuuff) +GO(glMulticastScissorArrayvNVX, vFuuip) +GO(glAsyncCopyBufferSubDataNVX, uFippuuuulllipp) +GO(glAsyncCopyImageSubDataNVX, uFippuuuuiiiiuuiiiiiiiipp) + +// GL_NVX_progress_fence +GO(glCreateProgressFenceNVX, uFv) +GO(glSignalSemaphoreui64NVX, vFuipp) +GO(glWaitSemaphoreui64NVX, vFuipp) +GO(glClientWaitSemaphoreui64NVX, vFipp) + +// GL_NV_memory_object_sparse +GO(glBufferPageCommitmentMemNV, vFulluUC) +GO(glTexPageCommitmentMemNV, vFuiiiiiiiiuUC) +GO(glNamedBufferPageCommitmentMemNV, vFulluUC) +GO(glTexturePageCommitmentMemNV, vFuiiiiiiiiuUC) + +// GL_NV_vdpau_interop2 +GO(glVDPAURegisterVideoSurfaceWithPictureStructureNV, lFpuipC) + +// Base EGL +GO(eglBindAPI, iFi) +GO(eglBindTexImage, iFppi) +GO(eglChooseConfig, iFpppip) +GO(eglClientWaitSync, iFppiU) +GO(eglCopyBuffers, iFppp) +GO(eglCreateContext, pFpppp) +GO(eglCreateImage, pFppuup) +GO(eglCreatePbufferFromClientBuffer, pFpippp) +GO(eglCreatePbufferSurface, pFppp) +GO(eglCreatePixmapSurface, pFpppp) +GO(eglCreatePlatformPixmapSurface, pFpppp) +GO(eglCreatePlatformWindowSurface, pFpppp) +GO(eglCreateSync, pFpup) +GO(eglCreateWindowSurface, pFpppp) +GO(eglDestroyContext, iFpp) +GO(eglDestroyImage, iFpp) +GO(eglDestroySurface, iFpp) +GO(eglDestroySync, iFpp) +GO(eglGetConfigAttrib, iFppip) +GO(eglGetConfigs, iFppip) +GO(eglGetCurrentContext, pFv) +GO(eglGetCurrentDisplay, pFv) +GO(eglGetCurrentSurface, pFi) +GO(eglGetDisplay, pFp) +GO(eglGetError, iFv) +GO(eglGetPlatformDisplay, pFppp) +//GOM(eglGetProcAddress, pFEp) +GO(eglGetSyncAttrib, iFppip) +GO(eglInitialize, iFppp) +GO(eglMakeCurrent, iFpppp) +GO(eglQueryAPI, iFv) +GO(eglQueryContext, iFppip) +GO(eglQueryString, pFpi) +GO(eglQuerySurface, iFppip) +GO(eglReleaseTexImage, iFppi) +GO(eglReleaseThread, iFv) +GO(eglSurfaceAttrib, iFppii) +GO(eglSwapBuffers, iFpp) +GO(eglSwapInterval, iFpi) +GO(eglTerminate, iFp) +GO(eglWaitClient, iFv) +GO(eglWaitGL, iFv) +GO(eglWaitNative, iFi) +GO(eglWaitSync, iFppi) + +// EGL_KHR_debug +GOM(eglDebugMessageControlKHR, iFEpp) +GO(eglQueryDebugKHR, iFip) +GO(eglLabelObjectKHR, iFpupp) + +// EGL_MESA_image_dma_buf_export +GO(eglExportDMABUFImageQueryMESA, iFppppp) +GO(eglExportDMABUFImageMESA, iFppppp) + +// EGL_ANGLE_sync_control_rate +GO(eglGetMscRateANGLE, iFpppp) + +// EGL_CHROMIUM_sync_control +GO(eglGetSyncValuesCHROMIUM, iFppppp) + +// EGL_EXT_device_query +GO(eglQueryDeviceAttribEXT, iFpip) +GO(eglQueryDeviceStringEXT, pFpi) +GO(eglQueryDisplayAttribEXT, iFpip) + +// EGL_EXT_device_enumeration +GO(eglQueryDevicesEXT, iFipp) + +// EGL_EXT_device_persistent_id +GO(eglQueryDeviceBinaryEXT, iFpiipp) + +// EGL_EXT_image_dma_buf_import_modifiers +GO(eglQueryDmaBufFormatsEXT, iFpipp) +GO(eglQueryDmaBufModifiersEXT, iFpiippp) + +// EGL_ANDROID_blob_cache +GOM(eglSetBlobCacheFuncsANDROID, vFEppp) + +// EGL_KHR_swap_buffers_with_damage +GO(eglSwapBuffersWithDamageKHR, iFpppi) + +// EGL_KHR_wait_sync +GO(eglWaitSyncKHR, iFppi) + +// EGL_KHR_image_base +GO(eglCreateImageKHR, pFppupp) +GO(eglDestroyImageKHR, iFpp) + +// EGL_KHR_fence_sync +GO(eglCreateSyncKHR, pFpup) +GO(eglDestroySyncKHR, iFpp) +GO(eglClientWaitSyncKHR, iFppiU) +GO(eglGetSyncAttribKHR, iFppip) + +// EGL_ANDROID_native_fence_sync +GO(eglDupNativeFenceFDANDROID, iFpp) + +// EGL_NV_post_sub_buffer +GO(eglPostSubBufferNV, iFppiiii) + +// GL_EXT_clip_control +GO(glClipControlEXT, vFuu) + +// GL_EXT_disjoint_timer_query +GO(glGenQueriesEXT, vFlp) +GO(glDeleteQueriesEXT, vFlp) +GO(glIsQueryEXT, iFu) +GO(glBeginQueryEXT, vFuu) +GO(glEndQueryEXT, vFu) +GO(glQueryCounterEXT, vFuu) +GO(glGetQueryivEXT, vFuup) +GO(glGetQueryObjectivEXT, vFuup) +GO(glGetQueryObjectuivEXT, vFuup) +GO(glGetQueryObjecti64vEXT, vFuup) +GO(glGetQueryObjectui64vEXT, vFuup) +GO(glGetInteger64vEXT, vFup) + +// GL_OES_mapbuffer +GO(glGetBufferPointervOES, vFuup) +GO(glMapBufferOES, pFuu) +GO(glUnmapBufferOES, iFu) + +// GLX_NV_copy_buffer +GO(glXCopyBufferSubDataNV, vFXppuulll) +GO(glXNamedCopyBufferSubDataNV, vFXppuulll) + +// GLX_NV_delay_before_swap +GO(glXDelayBeforeSwapNV, iFXLf) + +// GL_ARB_viewport_array +GO(glDepthRangeArraydvNV, vFuip) +GO(glDepthRangeIndexeddNV, vFudd) + +GO(dummmy_vFppi, vFppi) diff --git a/src/wrapped32/wrappedlibglu.c b/src/wrapped32/wrappedlibglu.c new file mode 100644 index 0000000..67c9608 --- /dev/null +++ b/src/wrapped32/wrappedlibglu.c @@ -0,0 +1,137 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "box32.h" +#include "myalign32.h" + +static const char* libgluName = "libGLU.so.1"; +#define LIBNAME libglu + +#include "generated/wrappedlibglutypes32.h" + +#include "wrappercallback32.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) \ +GO(5) \ +GO(6) \ +GO(7) \ +GO(8) \ +GO(9) \ + +// glu_callback +#define GO(A) \ +static uintptr_t my32_glu_callback_fct_##A = 0; \ +static void my32_glu_callback_##A(void* a, void* b) \ +{ \ + RunFunctionFmt(my32_glu_callback_fct_##A, "pp", a, b); \ +} +SUPER() +#undef GO +static void* findglu_callbackFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_glu_callback_fct_##A == (uintptr_t)fct) return my32_glu_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_glu_callback_fct_##A == 0) {my32_glu_callback_fct_##A = (uintptr_t)fct; return my32_glu_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Jpeg glu_callback callback\n"); + return NULL; +} +// glu_callback4 +#define GO(A) \ +static uintptr_t my32_glu_callback4_fct_##A = 0; \ +static void my32_glu_callback4_##A(void* a, void* b, void* c, void* d) \ +{ \ + RunFunctionFmt(my32_glu_callback4_fct_##A, "pppp", a, b, c, d); \ +} +SUPER() +#undef GO +static void* findglu_callback4Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_glu_callback4_fct_##A == (uintptr_t)fct) return my32_glu_callback4_##A; + SUPER() + #undef GO + #define GO(A) if(my32_glu_callback4_fct_##A == 0) {my32_glu_callback4_fct_##A = (uintptr_t)fct; return my32_glu_callback4_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Jpeg glu_callback4 callback\n"); + return NULL; +} +// glu_callback5 +#define GO(A) \ +static uintptr_t my32_glu_callback5_fct_##A = 0; \ +static void my32_glu_callback5_##A(void* a, void* b, void* c, void* d, void* e) \ +{ \ + RunFunctionFmt(my32_glu_callback5_fct_##A, "ppppp", a, b, c, d, e); \ +} +SUPER() +#undef GO +static void* findglu_callback5Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_glu_callback5_fct_##A == (uintptr_t)fct) return my32_glu_callback5_##A; + SUPER() + #undef GO + #define GO(A) if(my32_glu_callback5_fct_##A == 0) {my32_glu_callback5_fct_##A = (uintptr_t)fct; return my32_glu_callback5_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for Jpeg glu_callback5 callback\n"); + return NULL; +} + +#undef SUPER + +// There are many callback signatures: vFv, vFi, vFp, vFip and vFpp... so a generic wrapping to vFpp works +// except for GLU_TESS_COMBINE and GLU_TESS_COMBINE_DATA +#define GLU_TESS_COMBINE 100105 +#define GLU_TESS_COMBINE_DATA 100111 +void EXPORT my32_gluQuadricCallback(x64emu_t* emu, void* a, uint32_t b, void* cb) +{ + (void)emu; + my->gluQuadricCallback(a, b, findglu_callbackFct(cb)); +} +void EXPORT my32_gluTessCallback(x64emu_t* emu, void* a, uint32_t b, void* cb) +{ + (void)emu; + if(b==GLU_TESS_COMBINE) + my->gluTessCallback(a, b, findglu_callback4Fct(cb)); + else if(b==GLU_TESS_COMBINE_DATA) + my->gluTessCallback(a, b, findglu_callback5Fct(cb)); + else + my->gluTessCallback(a, b, findglu_callbackFct(cb)); +} +void EXPORT my32_gluNurbsCallback(x64emu_t* emu, void* a, uint32_t b, void* cb) +{ + (void)emu; + my->gluNurbsCallback(a, b, findglu_callbackFct(cb)); +} + +#define NEEDED_LIBS "libGL.so.1" + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibglu_private.h b/src/wrapped32/wrappedlibglu_private.h new file mode 100644 index 0000000..d40c079 --- /dev/null +++ b/src/wrapped32/wrappedlibglu_private.h @@ -0,0 +1,64 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(gluBeginCurve,vFp) +GO(gluBeginPolygon, vFp) +GO(gluBeginSurface, vFp) +GO(gluBeginTrim, vFp) +GO(gluBuild1DMipmapLevels, iFuiiuuiiip) +GO(gluBuild1DMipmaps, iFuiiuup) +GO(gluBuild2DMipmapLevels, iFuiiiuuiiip) +GO(gluBuild2DMipmaps, iFuiiiuup) +GO(gluBuild3DMipmapLevels, iFuiiiiuuiiip) +GO(gluBuild3DMipmaps, iFuiiiiuup) +GO(gluCheckExtension, CFpp) +GO(gluCylinder, vFpdddii) +GO(gluDeleteNurbsRenderer, vFp) +GO(gluDeleteQuadric, vFp) +GO(gluDeleteTess, vFp) +GO(gluDisk, vFpddii) +GO(gluEndCurve, vFp) +GO(gluEndPolygon, vFp) +GO(gluEndSurface, vFp) +GO(gluEndTrim, vFp) +GO(gluErrorString, pFu) +GO(gluGetNurbsProperty, vFpup) +GO(gluGetString, pFu) +GO(gluGetTessProperty, vFpup) +GO(gluLoadSamplingMatrices, vFpppp) +GO(gluLookAt, vFddddddddd) +GO(gluNewNurbsRenderer, pFv) +GO(gluNewQuadric, pFv) +GO(gluNewTess, pFv) +GO(gluNextContour, vFpu) +GOM(gluNurbsCallback, vFEpup) +GO(gluNurbsCallbackData, vFpp) +GO(gluNurbsCallbackDataEXT, vFpp) +GO(gluNurbsCurve, vFpipipiu) +GO(gluNurbsProperty, vFpuf) +GO(gluNurbsSurface, vFpipipiipiiu) +GO(gluOrtho2D, vFdddd) +GO(gluPartialDisk, vFpddiidd) +GO(gluPerspective, vFdddd) +GO(gluPickMatrix, vFddddp) +GO(gluProject, iFdddpppppp) +GO(gluPwlCurve, vFpipiu) +GOM(gluQuadricCallback, vFEpup) +GO(gluQuadricDrawStyle, vFpu) +GO(gluQuadricNormals, vFpu) +GO(gluQuadricOrientation, vFpu) +GO(gluQuadricTexture, vFpC) +GO(gluScaleImage, iFuiiupiiup) +GO(gluSphere, vFpdii) +GO(gluTessBeginContour, vFp) +GO(gluTessBeginPolygon, vFpp) +GOM(gluTessCallback, vFEpup) +GO(gluTessEndContour, vFp) +GO(gluTessEndPolygon, vFp) +GO(gluTessNormal, vFpddd) +GO(gluTessProperty, vFpud) +GO(gluTessVertex, vFppp) +GO(gluUnProject, iFdddpppppp) +GO(gluUnProject4, iFddddpppddpppp) + diff --git a/src/wrapped32/wrappedlibglx.c b/src/wrapped32/wrappedlibglx.c new file mode 100644 index 0000000..7dc37e1 --- /dev/null +++ b/src/wrapped32/wrappedlibglx.c @@ -0,0 +1,97 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "gltools.h" +#include "libtools/my_x11_conv.h" + +static const char* libglxName = "libGLX.so.0"; +#define LIBNAME libglx + +#include "generated/wrappedlibglxtypes32.h" + +#include "wrappercallback32.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ + + +#undef SUPER + +EXPORT void* myx32_glXGetProcAddress(x64emu_t* emu, void* name) +{ + khint_t k; + const char* rname = (const char*)name; + return getGLProcAddress32(emu, NULL, (glprocaddress_t)my->glXGetProcAddress, rname); +} +EXPORT void* myx32_glXGetProcAddressARB(x64emu_t* emu, void* name) __attribute__((alias("myx32_glXGetProcAddress"))); + +EXPORT void* myx32_glXChooseFBConfig(x64emu_t* emu, void* dpy, int screen, int* list, int* nelement) +{ + void** res = my->glXChooseFBConfig(dpy, screen, list, nelement); + if(!res) + return NULL; + ptr_t *fbconfig = (ptr_t*)res; + for(int i=0; i<*nelement; ++i) + fbconfig[i] = to_ptrv(res[i]); + return res; +} + +EXPORT void* myx32_glXGetVisualFromFBConfig(x64emu_t* emu, void* dpy, void* config) +{ + void* res = my->glXGetVisualFromFBConfig(dpy, config); + if(!res) return NULL; + my_XVisualInfo_32_t* vinfo = (my_XVisualInfo_32_t*)res; + convert_XVisualInfo_to_32(dpy, vinfo, res); + return vinfo; +} + +EXPORT void* myx32_glXChooseVisual(x64emu_t* emu, void* dpy, int screen, int* attr) +{ + void* res = my->glXChooseVisual(dpy, screen, attr); + if(!res) return NULL; + my_XVisualInfo_32_t* vinfo = (my_XVisualInfo_32_t*)res; + convert_XVisualInfo_to_32(dpy, vinfo, res); + return vinfo; +} + +EXPORT void* myx32_glXCreateContext(x64emu_t* emu, void* dpy, my_XVisualInfo_32_t* info, void* shared, int direct) +{ + my_XVisualInfo_t info_l = {0}; + convert_XVisualInfo_to_64(dpy, &info_l, info); + return my->glXCreateContext(dpy, &info_l, shared, direct); +} + +EXPORT void* myx32_glXGetFBConfigs(x64emu_t* emu, void* dpy, int screen, int* n) +{ + void* ret = my->glXGetFBConfigs(dpy, screen, n); + if(!ret) return NULL; + ptr_t* dst = ret; + void** src = ret; + for(int i=0; i<*n; ++i) + dst[i] = to_ptrv(src[i]); + return ret; +} + + +#define ALTMY myx32_ + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibglx_private.h b/src/wrapped32/wrappedlibglx_private.h new file mode 100644 index 0000000..9e658c6 --- /dev/null +++ b/src/wrapped32/wrappedlibglx_private.h @@ -0,0 +1,48 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +// __glXGLLoadGLXFunction +GOM(glXChooseFBConfig, pFEXipp) +GOM(glXChooseVisual, pFEXip) +GO(glXCopyContext, vFXppL) +GOM(glXCreateContext, pFEXppi) +//GOM(glXCreateGLXPixmap, LFEXbpLiiiLLLii_L) +GO(glXCreateNewContext, pFXpipi) +GO(glXCreatePbuffer, LFXpp) +GO(glXCreatePixmap, LFXpLp) +GO(glXCreateWindow, LFXpLp) +GO(glXDestroyContext, vFXp) +GO(glXDestroyGLXPixmap, vFXL) +GO(glXDestroyPbuffer, vFXL) +GO(glXDestroyPixmap, vFXL) +GO(glXDestroyWindow, vFXL) +GO(glXGetClientString, pFXi) +//GOM(glXGetConfig, iFEXbpLiiiLLLii_ip) +GO(glXGetCurrentContext, pFv) +GO(glXGetCurrentDisplay, XFv) +GO(glXGetCurrentDrawable, LFv) +GO(glXGetCurrentReadDrawable, LFv) +GO(glXGetFBConfigAttrib, iFXpip) +GOM(glXGetFBConfigs, pFEXip) +GOM(glXGetProcAddress, pFEp) +GOM(glXGetProcAddressARB, pFEp) +GO(glXGetSelectedEvent, vFXLbL_) +GOM(glXGetVisualFromFBConfig, pFEXp) +GO(glXIsDirect, iFXp) +GO(glXMakeContextCurrent, iFXLLp) +GO(glXMakeCurrent, iFXLp) +GO(glXQueryContext, iFXpip) +GO(glXQueryDrawable, vFXLip) +GO(glXQueryExtension, iFXpp) +GO(glXQueryExtensionsString, pFXi) +GO(glXQueryServerString, pFXii) +GO(glXQueryVersion, iFXpp) +GO(glXSelectEvent, vFXLL) +GO(glXSwapBuffers, vFXL) +GO(glXUseXFont, vFLiii) +GO(glXWaitGL, vFv) +GO(glXWaitX, vFv) + + + diff --git a/src/wrapped32/wrappedlibglxnvidia.c b/src/wrapped32/wrappedlibglxnvidia.c new file mode 100644 index 0000000..a1834ef --- /dev/null +++ b/src/wrapped32/wrappedlibglxnvidia.c @@ -0,0 +1,504 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "box32context.h" +#include "librarian.h" +#include "callback.h" +#include "gltools.h" +#include "libtools/my_x11_conv.h" + +static const char* libglxnvidiaName = "libGLX_nvidia.so.0"; +#define LIBNAME libglxnvidia +#define ALTMY my32nv_ + +#include "generated/wrappedlibgltypes32.h" + +#include "wrappercallback32.h" + +void* getDisplay(void* d); // define in 32bits wrappedx11.c + +// FIXME: old wrapped* type of file, cannot use generated/wrappedlibgltypes.h +EXPORT void* my32nv_glXGetProcAddress(x64emu_t* emu, void* name) +{ + pFp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXGetProcAddress; + khint_t k; + const char* rname = (const char*)name; + return getGLProcAddress32(emu, "my32nv_" , (void*)fnc, rname); +} +EXPORT void* my32nv_glXGetProcAddressARB(x64emu_t* emu, void* name) __attribute__((alias("my32nv_glXGetProcAddress"))); + +typedef int (*iFi_t)(int); +typedef void (*vFpp_t)(void*, void*); +typedef void*(*pFpp_t)(void*, void*); +typedef void (*vFip_t)(int, void*); +typedef void (*vFppp_t)(void*, void*, void*); +typedef void (*vFppi_t)(void*, void*, int); +typedef void*(*pFpip_t)(void*, int, void*); +typedef void (*vFuip_t)(uint32_t, int, void*); +typedef void*(*pFp_t)(void*); +typedef void (*vFuipp_t)(uint32_t, int, void*, void*); +typedef void*(*pFpipp_t)(void*, int, void*, void*); +typedef void*(*pFpppi_t)(void*, void*, void*, int); +typedef void (*vFuipu_t)(uint32_t, int, void*, uint32_t); +typedef void (*vFupupi_t)(uint32_t, void*, uint32_t, void*, int); +typedef void (*vFuippp_t)(uint32_t, int, void*, void*, void*); +typedef void (*vFuuippp_t)(uint32_t, uint32_t, int, void*, void*, void*); +typedef void (*vFupupip_t)(uint32_t, void*, uint32_t, void*, int, void*); +typedef void (*vFppupui_t)(void*, void*, uint32_t, void*, uint32_t, int); +typedef void (*debugProc_t)(int32_t, int32_t, uint32_t, int32_t, int32_t, void*, void*); + +typedef struct gl_wrappers_s { + glprocaddress_t procaddress; + kh_symbolmap_t *glwrappers; // the map of wrapper for glProcs (for GLX or SDL1/2) + kh_symbolmap_t *glmymap; // link to the mysymbolmap of libGL +} gl_wrappers_t; + +KHASH_MAP_INIT_INT64(gl_wrappers, gl_wrappers_t*) + +static kh_gl_wrappers_t *gl_wrappers = NULL; + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// debug_callback ... +#define GO(A) \ +static uintptr_t my_debug_callback_fct_##A = 0; \ +static void my_debug_callback_##A(int32_t a, int32_t b, uint32_t c, int32_t d, int32_t e, const char* f, const void* g) \ +{ \ + RunFunctionFmt(my_debug_callback_fct_##A, "iiuiipp", a, b, c, d, e, f, g); \ +} +SUPER() +#undef GO +static void* find_debug_callback_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_debug_callback_fct_##A == (uintptr_t)fct) return my_debug_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_debug_callback_fct_##A == 0) {my_debug_callback_fct_##A = (uintptr_t)fct; return my_debug_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL debug_callback callback\n"); + return NULL; +} +// egl_debug_callback ... +#define GO(A) \ +static uintptr_t my_egl_debug_callback_fct_##A = 0; \ + static void my_egl_debug_callback_##A(int a, void* b, int c, void* d, void* e, const char* f) \ +{ \ + RunFunctionFmt(my_egl_debug_callback_fct_##A, "ipippp", a, b, c, d, e, f); \ +} +SUPER() +#undef GO +static void* find_egl_debug_callback_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_egl_debug_callback_fct_##A == (uintptr_t)fct) return my_egl_debug_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_egl_debug_callback_fct_##A == 0) {my_egl_debug_callback_fct_##A = (uintptr_t)fct; return my_egl_debug_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL egl_debug_callback callback\n"); + return NULL; +} +// program_callback ... +#define GO(A) \ +static uintptr_t my_program_callback_fct_##A = 0; \ +static void my_program_callback_##A(int32_t a, void* b) \ +{ \ + RunFunctionFmt(my_program_callback_fct_##A, "ip", a, b); \ +} +SUPER() +#undef GO +static void* find_program_callback_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_program_callback_fct_##A == (uintptr_t)fct) return my_program_callback_##A; + SUPER() + #undef GO + #define GO(A) if(my_program_callback_fct_##A == 0) {my_program_callback_fct_##A = (uintptr_t)fct; return my_program_callback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL program_callback callback\n"); + return NULL; +} +// set_blob_func ... +#define GO(A) \ +static uintptr_t my_set_blob_func_fct_##A = 0; \ +static void my_set_blob_func_##A(void* a, ssize_t b, void* c, ssize_t d) \ +{ \ + RunFunctionFmt(my_set_blob_func_fct_##A, "plpl", a, b, c, d); \ +} +SUPER() +#undef GO +static void* find_set_blob_func_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_set_blob_func_fct_##A == (uintptr_t)fct) return my_set_blob_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_set_blob_func_fct_##A == 0) {my_set_blob_func_fct_##A = (uintptr_t)fct; return my_set_blob_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL set_blob_func callback\n"); + return NULL; +} +// get_blob_func ... +#define GO(A) \ +static uintptr_t my_get_blob_func_fct_##A = 0; \ +static ssize_t my_get_blob_func_##A(void* a, ssize_t b, void* c, ssize_t d) \ +{ \ + return (ssize_t)RunFunctionFmt(my_get_blob_func_fct_##A, "plpl", a, b, c, d); \ +} +SUPER() +#undef GO +static void* find_get_blob_func_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_get_blob_func_fct_##A == (uintptr_t)fct) return my_get_blob_func_##A; + SUPER() + #undef GO + #define GO(A) if(my_get_blob_func_fct_##A == 0) {my_get_blob_func_fct_##A = (uintptr_t)fct; return my_get_blob_func_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libGL get_blob_func callback\n"); + return NULL; +} + +#undef SUPER + +#define PRE_INIT \ + if(BOX64ENV(libgl)) { \ + lib->w.lib = dlopen(BOX64ENV(libgl), RTLD_LAZY | RTLD_GLOBAL); \ + lib->path = strdup(BOX64ENV(libgl)); \ + } else if(strstr(lib->name, "libGLX_nvidia.so.0")) { \ + lib->w.lib = dlopen("libGLX_nvidia.so.0", RTLD_LAZY | RTLD_GLOBAL); \ + if(lib->w.lib) lib->path = strdup("libGLX_nvidia.so.0"); \ + } + +// glDebugMessageCallback ... +EXPORT void my32nv_glDebugMessageCallback(x64emu_t* emu, void* prod, void* param) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallback; + fnc(find_debug_callback_Fct(prod), param); +} +// glDebugMessageCallbackARB ... +EXPORT void my32nv_glDebugMessageCallbackARB(x64emu_t* emu, void* prod, void* param) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallbackARB; + fnc(find_debug_callback_Fct(prod), param); +} +// glDebugMessageCallbackAMD ... +EXPORT void my32nv_glDebugMessageCallbackAMD(x64emu_t* emu, void* prod, void* param) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallbackAMD; + fnc(find_debug_callback_Fct(prod), param); +} +// glDebugMessageCallbackKHR ... +EXPORT void my32nv_glDebugMessageCallbackKHR(x64emu_t* emu, void* prod, void* param) +{ + vFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glDebugMessageCallbackKHR; + fnc(find_debug_callback_Fct(prod), param); +} +// eglDebugMessageControlKHR ... +EXPORT int my32nv_eglDebugMessageControlKHR(x64emu_t* emu, void* prod, void* param) +{ + iFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->eglDebugMessageControlKHR; + return fnc(find_egl_debug_callback_Fct(prod), param); +} +// eglSetBlobCacheFuncsANDROID ... +EXPORT void my32nv_eglSetBlobCacheFuncsANDROID(x64emu_t* emu, void* dpy, void* set, void* get) +{ + vFppp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->eglSetBlobCacheFuncsANDROID; + fnc(dpy, find_set_blob_func_Fct(set), find_get_blob_func_Fct(get)); +} +// glXSwapIntervalMESA ... +EXPORT int my32nv_dummy_glXSwapIntervalMESA(int interval) +{ + return 5; // GLX_BAD_CONTEXT +} +EXPORT int my32nv_glXSwapIntervalMESA(x64emu_t* emu, int interval) +{ + iFi_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXSwapIntervalMESA; + if(!fnc) fnc=my32nv_dummy_glXSwapIntervalMESA; + return fnc(interval); +} +// glXSwapIntervalEXT ... +EXPORT void my32nv_dummy_glXSwapIntervalEXT(void* dpy, void* drawable, int interval) {} +EXPORT void my32nv_glXSwapIntervalEXT(x64emu_t* emu, void* dpy, void* drawable, int interval) +{ + vFppi_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXSwapIntervalEXT; + if(!fnc) fnc=my32nv_dummy_glXSwapIntervalEXT; + fnc(dpy, drawable, interval); +} + +// glProgramCallbackMESA ... +EXPORT void my32nv_glProgramCallbackMESA(x64emu_t* emu, int t, void* f, void* data) +{ + vFipp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glProgramCallbackMESA; + fnc(t, find_program_callback_Fct(f), data); +} + +void* my_GetVkProcAddr(x64emu_t* emu, void* name, void*(*getaddr)(void*)); // defined in wrappedvulkan.c +// glGetVkProcAddrNV ... +EXPORT void* my32nv_glGetVkProcAddrNV(x64emu_t* emu, void* name) +{ + pFp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glGetVkProcAddrNV; + return my_GetVkProcAddr(emu, name, fnc); +} +// glShaderSource ... +EXPORT void my32nv_glShaderSource(x64emu_t* emu, uint32_t shader, int count, ptr_t* string, int* length) +{ + vFuipp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glShaderSource; + char* str[count]; + if(string) for(int i=0; iglXChooseFBConfig; + void** res = fnc(dpy, screen, list, nelement); + if(!res) + return NULL; + ptr_t* fbconfig = (ptr_t*)res; + for(int i=0; i<*nelement; ++i) + fbconfig[i] = to_ptrv(res[i]); + return res; +} +// glXChooseFBConfigSGIX ... +EXPORT void* my32nv_glXChooseFBConfigSGIX(x64emu_t* emu, void* dpy, int screen, int* list, int* nelement) +{ + pFpipp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXChooseFBConfigSGIX; + void** res = fnc(dpy, screen, list, nelement); + if(!res) + return NULL; + ptr_t* fbconfig = (ptr_t*)res; + for(int i=0; i<*nelement; ++i) + fbconfig[i] = to_ptrv(res[i]); + return res; +} +// glXGetVisualFromFBConfig ... +EXPORT void* my32nv_glXGetVisualFromFBConfig(x64emu_t* emu, void* dpy, void* config) +{ + pFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXGetVisualFromFBConfig; + void* res = fnc(dpy, config); + if(!res) + return NULL; + my_XVisualInfo_32_t* vinfo = (my_XVisualInfo_32_t*)res; + convert_XVisualInfo_to_32(dpy, vinfo, res); + return vinfo; +} +// glXGetVisualFromFBConfigSGIX ... +EXPORT void* my32nv_glXGetVisualFromFBConfigSGIX(x64emu_t* emu, void* dpy, void* config) +{ + pFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXGetVisualFromFBConfigSGIX; + void* res = fnc(dpy, config); + if(!res) + return NULL; + my_XVisualInfo_32_t* vinfo = (my_XVisualInfo_32_t*)res; + convert_XVisualInfo_to_32(dpy, vinfo, res); + return vinfo; +} +// glXChooseVisual ... +EXPORT void* my32nv_glXChooseVisual(x64emu_t* emu, void* dpy, int screen, int* attr) +{ + pFpip_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXChooseVisual; + void* res = fnc(dpy, screen, attr); + my_XVisualInfo_32_t* vinfo = (my_XVisualInfo_32_t*)res; + convert_XVisualInfo_to_32(dpy, vinfo, res); + return vinfo; +} +// glXCreateContext ... +EXPORT void* my32nv_glXCreateContext(x64emu_t* emu, void* dpy, my_XVisualInfo_32_t* info, void* shared, int direct) +{ + pFpppi_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXCreateContext; + my_XVisualInfo_t info_l = {0}; + convert_XVisualInfo_to_64(dpy, &info_l, info); + return fnc(dpy, &info_l, shared, direct); +} +// glXGetFBConfigFromVisualSGIX ... +EXPORT void* my32nv_glXGetFBConfigFromVisualSGIX(x64emu_t* emu, void* dpy, my_XVisualInfo_32_t* info) +{ + pFpp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glXGetFBConfigFromVisualSGIX; + my_XVisualInfo_t info_l = {0}; + convert_XVisualInfo_to_64(dpy, &info_l, info); + return fnc(dpy, &info_l); +} +// glMultiDrawElements ... +EXPORT void my32nv_glMultiDrawElements(x64emu_t* emu, uint32_t mode, void* count, uint32_t type, ptr_t* indices, int drawcount) +{ + vFupupi_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glMultiDrawElements; + void* indices_l[drawcount]; + for(int i=0; iglMultiModeDrawElementsIBM; + void* indices_l[primcount]; + for(uint32_t i=0; iglTransformFeedbackVaryings; + void* varyings_l[count]; + for(int i=0; iglBindBuffersRange; + long offsets_l[count]; + long sizes_l[count]; + for(int i=0; iglBindVertexBuffers; + long offsets_l[count]; + for(int i=0; iglVertexArrayVertexBuffers; + long offsets_l[count]; + for(int i=0; iglMultiDrawElementsBaseVertex; + void* indices_l[drawcount]; + for(int i=0; iglCreateShaderProgramv; + char* str[count]; + if(string) for(int i=0; iglCompileShaderIncludeARB; + char* str[count]; + if(string) for(int i=0; iglXGetFBConfigs; + void* ret = fnc(dpy, screen, n); + if(!ret) return NULL; + void** src = ret; + ptr_t* dst = ret; + for(int i=0; i<*n; ++i) + dst[i] = to_ptrv(src[i]); + return ret; +} +// glGetUniformIndices ... +EXPORT void my32nv_glGetUniformIndices(x64emu_t* emu, uint32_t prog, int count, ptr_t* names, void* indices) +{ + vFuipp_t fnc = getBridgeFnc2((void*)R_RIP); + if(!fnc) fnc=my->glGetUniformIndices; + void* names_l[count]; + fnc(prog, count, names?names_l:NULL, indices); + if(names) for(int i=0; iglVDPAUMapSurfacesNV; + long surfaces_l[count]; + if(surfaces) for(int i=0; iglVDPAUUnmapSurfacesNV; + long surfaces_l[count]; + if(surfaces) for(int i=0; i +#include +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "debug.h" +#include "box32.h" + +static const char* libmName = +#ifdef ANDROID + "libm.so" +#else + "libm.so.6" +#endif + ; +#define LIBNAME libm + +static library_t* my_lib = NULL; + +typedef float (*fFff_t) (float, float); +typedef double (*dFdd_t) (double, double); +typedef float (*fFf_t) (float); +typedef double (*dFd_t) (double); +#if 0 +typedef union my_float_complex_s { + float complex f; + uint64_t u64; +} my_float_complex_t; + +// complex <- FUNC(complex) wrapper +#define GO_cFc(N) \ +EXPORT void* my_##N(void* p, void* c) \ +{ \ + *(double complex*)p = N(*(double complex*)c); \ + return p; \ +} \ +EXPORT uint64_t my_##N##f(void* c) \ +{ \ + my_float_complex_t ret; \ + ret.f = N##f(*(float complex*)c); \ + return ret.u64; \ +} +// complex <- FUNC(complex, complex) wrapper +#define GO_cFcc(N) \ +EXPORT void* my_##N(void* p, void* c, void* d) \ +{ \ + *(double complex*)p = N(*(double complex*)c, *(double complex*)d); \ + return p; \ +} \ +EXPORT uint64_t my_##N##f(void* c, void* d) \ +{ \ + my_float_complex_t ret; \ + ret.f = N##f(*(float complex*)c, *(float complex*)c); \ + return ret.u64; \ +} + +GO_cFc(clog) +GO_cFc(csqrt) +GO_cFc(cproj) +GO_cFc(cexp) +GO_cFc(ccos) +GO_cFc(csin) +GO_cFc(ccosh) +GO_cFc(csinh) +GO_cFc(ctan) +GO_cFc(ctanh) +GO_cFc(cacos) +GO_cFc(casin) +GO_cFc(cacosh) +GO_cFc(casinh) +GO_cFc(catan) +GO_cFc(catanh) +GO_cFcc(cpow) + +#undef GO_cFc +#undef GO_cFcc +#endif + +#define FINITE(N, T, R, P, ...) \ +EXPORT R my32___##N##_finite P \ +{ \ + static int check = 0; \ + static T f = NULL; \ + if(!check) { \ + f = (T)dlsym(my_lib->w.lib, "__" #N "_finite"); \ + ++check; \ + } \ + if(f) \ + return f(__VA_ARGS__); \ + else \ + return N(__VA_ARGS__); \ +} + +#define F1F(N) FINITE(N, fFf_t, float, (float a), a) +#define F1D(N) FINITE(N, dFd_t, double, (double a), a) +#define F2F(N) FINITE(N, fFff_t, float, (float a, float b), a, b) +#define F2D(N) FINITE(N, dFdd_t, double, (double a, double b), a, b) + +F2F(powf) +F2D(pow) +F1F(sinhf) +F1D(sinh) +F1F(sqrtf) +F1D(sqrt) +F1F(acosf) +F1D(acos) +F1F(acoshf) +F1D(acosh) +F1F(asinf) +F1D(asin) +F2F(atan2f) +F2D(atan2) +F1F(coshf) +F1D(cosh) +F1F(exp2f) +F1D(exp2) +F1F(expf) +F1D(exp) +F2F(hypotf) +F2D(hypot) +F1F(log10f) +F1D(log10) +F1F(log2f) +F1D(log2) +F1F(logf) +F1D(log) + +#undef F2D +#undef F2F +#undef F1D +#undef F1F +#undef FINITE + +#define PRE_INIT\ + if(1) \ + lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \ + else + +#define CUSTOM_INIT \ + my_lib = lib; + +#define CUSTOM_FINI \ + my_lib = NULL; + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibm_private.h b/src/wrapped32/wrappedlibm_private.h new file mode 100755 index 0000000..3b54d44 --- /dev/null +++ b/src/wrapped32/wrappedlibm_private.h @@ -0,0 +1,446 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error meh! +#endif + +// Complex numbers are passed in as an address in the stack + +GOW(acos, dEd) +GOW(acosf, fEf) +GOM(__acosf_finite, fEf) //%noE +GOM(__acos_finite, dEd) //%noE +GOW(acosh, dEd) +GOW(acoshf, fEf) +GOM(__acoshf_finite, fEf) //%noE +GOM(__acosh_finite, dEd) //%noE +#ifdef HAVE_LD80BITS +GOW(acoshl, DED) +#else +GOW2(acoshl, KEK, acosh) +#endif +#ifdef HAVE_LD80BITS +GOW(acosl, DED) +#else +GOW2(acosl, KEK, acos) +#endif +GOW(asin, dEd) +GOW(asinf, fEf) +GOM(__asinf_finite, fEf) //%noE +GOM(__asin_finite, dEd) //%noE +GOW(asinh, dEd) +GOW(asinhf, fEf) +#ifdef HAVE_LD80BITS +GOW(asinhl, DED) +#else +GOW2(asinhl, KEK, asinh) +#endif +#ifdef HAVE_LD80BITS +GOW(asinl, DED) +#else +GOW2(asinl, KEK, asin) +#endif +GO(atan, dEd) +GOW(atan2, dEdd) +GOW(atan2f, fEff) +GOM(__atan2f_finite, fEff) //%noE +GOM(__atan2_finite, dEdd) //%noE +// atan2l // Weak +GOW(atanf, fEf) +GOW(atanh, dEd) +GOW(atanhf, fEf) +// __atanhf_finite +// __atanh_finite +#ifdef HAVE_LD80BITS +GOW(atanhl, DED) +#else +GOW2(atanhl, KEK, atanh) +#endif +// atanl // Weak +GOW(cabs, dEdd) // only 1 arg, but is a double complex +GOW(cabsf, fEff) // only 1 arg, but is a float complex +// cabsl // Weak +//GOWS(cacos, pEps) //%% complex +GOWM(cacosf, UEs) //%noE +//GOWS(cacosh, pEps) //%% complex +GOWM(cacoshf, UEs) //%noE +// cacoshl // Weak +// cacosl // Weak +//GOW(carg, dEdd) // 1arg, double complex +GOW(cargf, fEff) // 1arg, float complex +// cargl // Weak +//GOWS(casin, pEps) //%% complex +GOWM(casinf, UEs) //%noE +//GOWS(casinh, pEps) //%% complex +GOWM(casinhf, UEs) //%noE +// casinhl // Weak +// casinl // Weak +//GOWS(catan, pEps) //%% complex +GOWM(catanf, UEs) //%noE +//GOWS(catanh, pEps) //%% complex +GOWM(catanhf, UEs) //%noE +// catanhl // Weak +// catanl // Weak +GOW(cbrt, dEd) +GOW(cbrtf, fEf) +#ifdef HAVE_LD80BITS +GOW(cbrtl, DED) +#else +GOW2(cbrtl, KEK, cbrt) +#endif +//GOWS(ccos, pEps) //%% return complex +GOWM(ccosf, UEs) //%noE return complex +//GOWS(ccosh, pEps) //%% return complex +GOWM(ccoshf, UEs) //%noE return complex +// ccoshl // Weak +// ccosl // Weak +GOW(ceil, dEd) +GOW(ceilf, fEf) +// ceill // Weak +//GOWS(cexp, pEps) //%% return complex +GOWM(cexpf, UEs) //%noE return complex +// cexpl // Weak +// cimag // Weak +// cimagf // Weak +// cimagl // Weak +//GOS(clog, pEps) //%% return a double complex, so ret 4 +// clog10 // Weak +// __clog10 +// clog10f // Weak +// __clog10f +// clog10l // Weak +// __clog10l +GOM(clogf, UEs) //%noE float complex doesn't trigger the ret 4, but returns an u64! +// clogl // Weak +// conj // Weak +// conjf // Weak +// conjl // Weak +GOW(copysign, dEdd) +GOW(copysignf, fEff) +// copysignl // Weak +GOW(cos, dEd) +GOW(cosf, fEf) +GOW(cosh, dEd) +GOW(coshf, fEf) +GOM(__coshf_finite, fEf) //%noE +GOM(__cosh_finite, dEd) //%noE +// coshl // Weak +// cosl // Weak +//GOWS(cpow, pEpsvvvvs) //%% return complex +GOWM(cpowf, UEsvvs) //%noE +// cpowl // Weak +//GOS(cproj, pEps) //%% double complex +GOM(cprojf, UEs) //%noE +// cprojl // Weak +// creal // Weak +// crealf // Weak +// creall // Weak +//GOWS(csin, pEps) //%% return complex +GOWM(csinf, UEs) //%noE return complex +//GOWS(csinh, pEps) //%% return complex +GOWM(csinhf, UEs) //%noE return complex +// csinhl // Weak +// csinl // Weak +//GOWS(csqrt, pEps) //%% +GOWM(csqrtf, UEs) //%noE +// csqrtl // Weak +//GOWS(ctan, pEps) //%% return complex +GOWM(ctanf, UEs) //%noE return complex +//GOWS(ctanh, pEps) //%% return complex +GOWM(ctanhf, UEs) //%noE return complex +// ctanhl // Weak +// ctanl // Weak +// __cxa_finalize // Weak +// drem // Weak +// dremf // Weak +// dreml // Weak +GOW(erf, dEd) +GOW(erfc, dEd) +GOW(erfcf, fEf) +#ifdef HAVE_LD80BITS +GOW(erfcl, DED) +#else +GOW2(erfcl, KEK, erfc) +#endif +GOW(erff, fEf) +#ifdef HAVE_LD80BITS +GOW(erfl, DED) +#else +GOW2(erfl, KEK, erf) +#endif +GOW(exp, dEd) +GOW(exp10, dEd) +GOW(exp10f, fEf) +// __exp10f_finite +// __exp10_finite +// exp10l // Weak +GOW(exp2, dEd) +GOW(exp2f, fEf) +GOM(__exp2f_finite, fEf) //%noE +GOM(__exp2_finite, dEd) //%noE +// exp2l // Weak +GOW(expf, fEf) +GOM(__expf_finite, fEf) //%noE +GOM(__exp_finite, dEd) //%noE +// expl // Weak +GOW(expm1, dEd) +GOW(expm1f, fEf) +// expm1l // Weak +GOW(fabs, dEd) +GOW(fabsf, fEf) +// fabsl // Weak +// fdim // Weak +// fdimf // Weak +// fdiml // Weak +GO(feclearexcept, iEi) +GO(fedisableexcept, iEi) +GO(feenableexcept, iEi) +GO(fegetenv, iEp) +GO(fegetexcept, iEv) +GO(fegetexceptflag, iEpi) +GO(fegetround, iEv) +GO(feholdexcept, iEp) +GO(feraiseexcept, iEi) +GO(fesetenv, iEp) +GO(fesetexceptflag, iEpi) +GO(fesetround, iEi) +GO(fetestexcept, iEi) +GO(feupdateenv, iEp) +GOW(finite, iEd) +// __finite +GOW(finitef, iEf) +GO(__finitef, iEf) +// finitel // Weak +// __finitel +GOW(floor, dEd) +GOW(floorf, fEf) +// floorl // Weak +GOW(fma, dEddd) +GOW(fmaf, fEfff) +// fmal // Weak +GOW(fmax, dEdd) +GOW(fmaxf, fEff) +// fmaxl // Weak +GOW(fmin, dEdd) +GOW(fminf, fEff) +// fminl // Weak +GOW(fmod, dEdd) +GOW(fmodf, fEff) +// __fmodf_finite +// __fmod_finite +#ifdef HAVE_LD80BITS +GOW(fmodl, DEDD) +#else +GOW2(fmodl, KEKK, fmod) +#endif +GO(__fpclassify, iEd) +GO(__fpclassifyf, iEf) +GOW(frexp, dEdp) +GOW(frexpf, fEfp) +#ifdef HAVE_LD80BITS +GOW(frexpl, DEDp) +#else +GOW2(frexpl, KEKp, frexp) +#endif +// gamma // Weak +// gammaf // Weak +// __gammaf_r_finite +// gammal // Weak +// __gamma_r_finite +// __gmon_start__ // Weak +GOW(hypot, dEdd) +GOW(hypotf, fEff) +GOM(__hypotf_finite, fEff) //%noE +GOM(__hypot_finite, dEdd) //%noE +// hypotl // Weak +GOW(ilogb, iEd) +GOW(ilogbf, iEf) +// ilogbl // Weak +// __issignaling +// __issignalingf +// _ITM_deregisterTMCloneTable // Weak +// _ITM_registerTMCloneTable // Weak +GO(j0, dEd) +GO(j0f, fEf) +// __j0f_finite +// __j0_finite +// j0l +GO(j1, dEd) +GO(j1f, fEf) +// __j1f_finite +// __j1_finite +// j1l +GO(jn, dEid) +GO(jnf, fEif) +// __jnf_finite +// __jn_finite +// jnl +GOW(ldexp, dEdi) +GOW(ldexpf, fEfi) +#ifdef HAVE_LD80BITS +GOW(ldexpl, DED) +#else +GOW2(ldexpl, KEK, ldexp) +#endif +GOW(lgamma, dEd) +GOW(lgammaf, fEf) +GOW(lgammaf_r, fEfp) +// __lgammaf_r_finite +#ifdef HAVE_LD80BITS +GOW(lgammal, DED) +#else +GOW2(lgammal, KEK, lgamma) +#endif +#ifdef HAVE_LD80BITS +GOW(lgammal_r, DEDp) +#else +GOW2(lgammal_r, KEKp, lgamma_r) +#endif +GOW(lgamma_r, dEdp) +// __lgamma_r_finite +DATAV(_LIB_VERSION, 4) +GOW(llrint, IEd) +GOW(llrintf, IEf) +// llrintl // Weak +GOW(llround, IEd) +GOW(llroundf, IEf) +// llroundl // Weak +GOW(log, dEd) +GOW(log10, dEd) +GOW(log10f, fEf) +GOM(__log10f_finite, fEf) //%noE +GOM(__log10_finite, dEd) //%noE +// log10l // Weak +GOW(log1p, dEd) +GOW(log1pf, fEf) +// log1pl // Weak +GOW(log2, dEd) +GOW(log2f, fEf) +GOM(__log2f_finite, fEf) //%noE +GOM(__log2_finite, dEd) //%noE +// log2l // Weak +GOW(logb, dEd) +GOW(logbf, fEf) +// logbl // Weak +GOW(logf, fEf) +GOM(__logf_finite, fEf) //%noE +GOM(__log_finite, dEd) //%noE +#ifdef HAVE_LD80BITS +GOW(logl, DED) +#else +GOW2(logl, KEK, log) +#endif +GOW(lrint, iEd) +GOW(lrintf, iEf) +// lrintl // Weak +GOW(lround, iEd) +GOW(lroundf, iEf) +// lroundl // Weak +// matherr // Weak +GOW(modf, dEdp) +GOW(modff, fEfp) +// modfl // Weak +// nan // Weak +// nanf // Weak +// nanl // Weak +GOW(nearbyint, dEd) +GOW(nearbyintf, fEf) +// nearbyintl // Weak +GOW(nextafter, dEdd) +GOW(nextafterf, fEff) +// nextafterl // Weak +GOW(nexttoward, dEdD) +GOW(nexttowardf, fEfD) +// nexttowardl // Weak +GOW(pow, dEdd) +GOW(pow10, dEd) +GOW(pow10f, fEf) +#ifdef HAVE_LD80BITS +GOWM(pow10l, DED) //%noE +#else +GOWM(pow10l, KEK) //%noE +#endif +GOW(powf, fEff) +GOM(__powf_finite, fEff) //%noE +GOM(__pow_finite, dEdd) //%noE +#ifdef HAVE_LD80BITS +GOW(powl, DEDD) +#else +GOW2(powl, KEKK, pow) +#endif +GOW(remainder, dEdd) +GOW(remainderf, fEff) +// __remainderf_finite +// __remainder_finite +// remainderl // Weak +GOW(remquo, dEddp) +GOW(remquof, fEffp) +// remquol // Weak +GOW(rint, dEd) +GOW(rintf, fEf) +// rintl // Weak +GOW(round, dEd) +GOW(roundf, fEf) +// roundl // Weak +// scalb // Weak +// scalbf // Weak +// __scalbf_finite +// __scalb_finite +// scalbl // Weak +GOW(scalbln, dEdi) +GOW(scalblnf, fEfi) +// scalblnl // Weak +GOW(scalbn, dEdi) +GOW(scalbnf, fEfi) +// scalbnl // Weak +// __signbit +// __signbitf +DATAB(signgam, 4) +// significand // Weak +// significandf // Weak +// significandl // Weak +GOW(sin, dEd) +GOW(sincos, vEdpp) +GOW(sincosf, vEfpp) +// sincosl // Weak +GOW(sinf, fEf) +GOW(sinh, dEd) +GOW(sinhf, fEf) +GOM(__sinhf_finite, fEf) //%noE +GOM(__sinh_finite, dEd) //%noE +// sinhl // Weak +// sinl // Weak +GOW(sqrt, dEd) +GOW(sqrtf, fEf) +GOM(__sqrtf_finite, fEf) //%noE +GOM(__sqrt_finite, dEd) //%noE +// sqrtl // Weak +GO(tan, dEd) +GOW(tanf, fEf) +GOW(tanh, dEd) +GOW(tanhf, fEf) +// tanhl // Weak +// tanl // Weak +GOW(tgamma, dEd) +GOW(tgammaf, fEf) +#ifdef HAVE_LD80BITS +GOW(tgammal, DED) +#else +GOW2(tgammal, KEK, tgamma) +#endif +GOW(trunc, dEd) +GOW(truncf, fEf) +// truncl // Weak +GO(y0, dEd) +GO(y0f, fEf) +// __y0f_finite +// __y0_finite +// y0l +GO(y1, dEd) +GO(y1f, fEf) +// __y1f_finite +// __y1_finite +// y1l +GO(yn, dEid) +GO(ynf, fEif) +// __ynf_finite +// __yn_finite +// ynl diff --git a/src/wrapped32/wrappedlibpthread.c b/src/wrapped32/wrappedlibpthread.c new file mode 100755 index 0000000..541a10c --- /dev/null +++ b/src/wrapped32/wrappedlibpthread.c @@ -0,0 +1,147 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "box32context.h" +#include "librarian.h" + +static const char* libpthreadName = "libpthread.so.0"; +#define LIBNAME libpthread + +EXPORT int my32_pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) +{ + return pthread_rwlock_wrlock(rwlock); +} +EXPORT int my32_pthread_rwlock_rdlock(pthread_rwlock_t* rwlock) +{ + return pthread_rwlock_rdlock(rwlock); +} +EXPORT int my32_pthread_rwlock_unlock(pthread_rwlock_t *rwlock) +{ + return pthread_rwlock_unlock(rwlock); +} + +EXPORT int32_t my32_pthread_atfork(x64emu_t *emu, void* prepare, void* parent, void* child) +{ + // this is partly incorrect, because the emulated functions should be executed by actual fork and not by my32_atfork... + if(my_context->atfork_sz==my_context->atfork_cap) { + my_context->atfork_cap += 4; + my_context->atforks = (atfork_fnc_t*)realloc(my_context->atforks, my_context->atfork_cap*sizeof(atfork_fnc_t)); + } + int i = my_context->atfork_sz++; + my_context->atforks[i].prepare = (uintptr_t)prepare; + my_context->atforks[i].parent = (uintptr_t)parent; + my_context->atforks[i].child = (uintptr_t)child; + my_context->atforks[i].handle = NULL; + + return 0; +} +EXPORT int32_t my32___pthread_atfork(x64emu_t *emu, void* prepare, void* parent, void* child) __attribute__((alias("my32_pthread_atfork"))); + +EXPORT void my32___pthread_initialize() +{ + // nothing, the lib initialize itself now +} + +#define SEM_SIGN 0x542554aabc123578LL // just some random stuff +typedef struct my_sem_32_s { + uint64_t sign; + sem_t *sem; +} my_sem_32_t; + +static sem_t* get_sem(void* sem) +{ + if(!(((uintptr_t)sem)&0x07)) + return sem; + // sem is unaligned, create a wrapped sem + sem_t *new_sem = box_calloc(1, sizeof(sem_t)); + memcpy(new_sem, sem, sizeof(sem_t)); + my_sem_32_t* old = sem; + old->sign = SEM_SIGN; + old->sem = new_sem; + return new_sem; +} + +#define GET_SEM(sem) sem_t* _sem = (sem->sign != SEM_SIGN)?(get_sem(sem)):(sem->sem) +EXPORT int my32_sem_close(sem_t* sem) +{ + return sem_close(sem); +} +EXPORT int my32_sem_destroy(my_sem_32_t* sem) +{ + if(sem->sign != SEM_SIGN) + return sem_destroy((sem_t*)sem); + int ret = 0; + ret = sem_destroy(sem->sem); + box_free(sem->sem); + sem->sem = NULL; + return ret; +} +EXPORT int my32_sem_getvalue(my_sem_32_t* sem, int* val) +{ + GET_SEM(sem); + return sem_getvalue(_sem, val); +} +EXPORT int my32_sem_init(my_sem_32_t* sem, int pshared, uint32_t val) +{ + int ret = 0; + sem->sign = SEM_SIGN; + sem->sem = box_calloc(1, sizeof(sem_t)); + ret = sem_init(sem->sem, pshared, val); + return ret; +} +EXPORT void* my32_sem_open(const char* name, int flags) +{ + return sem_open(name, flags); +} +EXPORT int my32_sem_post(my_sem_32_t* sem) +{ + GET_SEM(sem); + return sem_post(_sem); +} +EXPORT int my32_sem_timedwait(my_sem_32_t* sem, struct timespec * t) +{ + GET_SEM(sem); + // Not sure it's usefull + //if(!sem_trywait(_sem))) + // return 0; + // some x86 game are not computing timeout correctly (ex: Anomaly Warzone Earth linux version) + while(t->tv_nsec>=1000000000) { + t->tv_nsec-=1000000000; + t->tv_sec+=1; + } + return sem_timedwait(_sem, t); +} +EXPORT int my32_sem_trywait(my_sem_32_t* sem) +{ + GET_SEM(sem); + return sem_trywait(_sem); +} +EXPORT int my32_sem_wait(my_sem_32_t* sem) +{ + GET_SEM(sem); + return sem_wait(_sem); +} + + + +#define PRE_INIT\ + if(1) \ + lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \ + else + +#include "wrappedlib_init32.h" + diff --git a/src/wrapped32/wrappedlibpthread_private.h b/src/wrapped32/wrappedlibpthread_private.h new file mode 100755 index 0000000..222b2ab --- /dev/null +++ b/src/wrapped32/wrappedlibpthread_private.h @@ -0,0 +1,189 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error meh! +#endif +// General note: pthread_t is unsigned long int +// cpu_set_t is a struct with an array, default size is fixed for all architecture +// struct timespec is: LL + +// __errno_location +// fork +// __fork +// __h_errno_location +// _IO_flockfile +// _IO_ftrylockfile +// _IO_funlockfile +// __libc_allocate_rtsig +// __libc_current_sigrtmax +// __libc_current_sigrtmin +GOM(pthread_atfork, iEEppp) +GOM(__pthread_atfork, iEEppp) +GOM(pthread_attr_destroy, iEEp) +// pthread_attr_getaffinity_np +GOM(pthread_attr_getdetachstate, iEEpp) +GOM(pthread_attr_getguardsize, iEEpp) +GOM(pthread_attr_getinheritsched, iEEpp) +GOM(pthread_attr_getschedparam, iEEpp) +GOM(pthread_attr_getschedpolicy, iEEpp) +GOM(pthread_attr_getscope, iEEpp) +GOM(pthread_attr_getstack, iEEppp) +GOM(pthread_attr_getstackaddr, iEEpp) +GOM(pthread_attr_getstacksize, iEEpp) +GOM(pthread_attr_init, iEEp) +GOM(pthread_attr_setaffinity_np, iEEpup) +GOM(pthread_attr_setdetachstate, iEEpi) +GOM(pthread_attr_setguardsize, iEEpL) +GOM(pthread_attr_setinheritsched, iEEpi) +GOM(pthread_attr_setschedparam, iEEpp) +GOM(pthread_attr_setschedpolicy, iEEpi) +GOM(pthread_attr_setscope, iEEpi) +GOM(pthread_attr_setstack, iEEppL) +GOM(pthread_attr_setstackaddr, iEEpp) +GOM(pthread_attr_setstacksize, iEEpL) +GO(pthread_barrierattr_destroy, iEp) +GO(pthread_barrierattr_getpshared, iEpp) +GO(pthread_barrierattr_init, iEp) +GO(pthread_barrierattr_setpshared, iEpi) +GO(pthread_barrier_destroy, iEp) +GO(pthread_barrier_init, iEppu) +GO(pthread_barrier_wait, iEp) +GO(pthread_cancel, iEh) +GOM(_pthread_cleanup_pop, vEEpi) +GOM(_pthread_cleanup_pop_restore, vEEpi) +GOM(_pthread_cleanup_push, vEEppp) +GOM(_pthread_cleanup_push_defer, vEEppp) +// __pthread_cleanup_routine +GO(pthread_condattr_destroy, iEp) +GO(pthread_condattr_getclock, iEpp) +GO(pthread_condattr_getpshared, iEpp) +GO(pthread_condattr_init, iEp) +GO(pthread_condattr_setclock, iEpp) +GO(pthread_condattr_setpshared, iEpi) +GO2(pthread_cond_broadcast@GLIBC_2.0, iEEp, my32_pthread_cond_broadcast_old) +GO2(pthread_cond_destroy@GLIBC_2.0, iEEp, my32_pthread_cond_destroy_old) +GO2(pthread_cond_init@GLIBC_2.0, iEEpp, my32_pthread_cond_init_old) +GO2(pthread_cond_signal@GLIBC_2.0, iEEp, my32_pthread_cond_signal_old) +GO2(pthread_cond_timedwait@GLIBC_2.0, iEEpprLL_, my32_pthread_cond_timedwait_old) +GO2(pthread_cond_wait@GLIBC_2.0, iEEpp, my32_pthread_cond_wait_old) +GOM(pthread_cond_broadcast, iEEp) +GOM(pthread_cond_destroy, iEEp) +GOM(pthread_cond_init, iEEpp) +GOM(pthread_cond_signal, iEEp) +GOM(pthread_cond_timedwait, iEEpprLL_) +GOM(pthread_cond_wait, iEEpp) +GOM(pthread_create, iEEBh_ppp) +GOM(pthread_detach, iEEh) +GO(pthread_equal, iEhh) +GO(pthread_exit, vEp) +GOM(pthread_getaffinity_np, iEEhup) +GOM(pthread_getattr_np, iEEhp) +GO(pthread_getconcurrency, iEv) +GO(pthread_getcpuclockid, iEhp) +GO(pthread_getschedparam, iEhpp) +GO(__pthread_getspecific, pEu) +GO(pthread_getspecific, pEu) +GO(pthread_getname_np, iEhpL) +GOM(__pthread_initialize, vEv) //%noE doesn't exist anymore... +// __pthread_initialize_minimal +GO(pthread_join, iEHBp_) +GOM(__pthread_key_create, iEEpp) +GOM(pthread_key_create, iEEpp) +GO(pthread_key_delete, iEu) +GOM(pthread_kill, iEEhi) +GO2(pthread_kill@GLIBC_2.0, iEEhi, my32_pthread_kill_old) +// pthread_kill_other_threads_np +GO(__pthread_mutexattr_destroy, iEp) +GO(pthread_mutexattr_destroy, iEp) +GO(pthread_mutexattr_getprioceiling, iEpp) +GO(pthread_mutexattr_getprotocol, iEpp) +// pthread_mutexattr_getpshared +// pthread_mutexattr_getrobust_np +GO(pthread_mutexattr_gettype, iEpp) +GO2(__pthread_mutexattr_init, iEp, my32_pthread_mutexattr_init) +GOM(pthread_mutexattr_init, iEEp) +GO(pthread_mutexattr_setprioceiling, iEpi) +GO(pthread_mutexattr_setprotocol, iEpp) +GO(pthread_mutexattr_setpshared, iEpi) +// pthread_mutexattr_setrobust_np +GO(__pthread_mutexattr_settype, iEpi) +GO(pthread_mutexattr_settype, iEpi) +// pthread_mutex_consistent_np +GOM(__pthread_mutex_destroy, iEp) //%noE +GOM(pthread_mutex_destroy, iEp) //%noE +// pthread_mutex_getprioceiling +GOM(__pthread_mutex_init, iEpp) //%noE +GOM(pthread_mutex_init, iEpp) //%noE +GOM(__pthread_mutex_lock, iEp) //%noE +GOM(pthread_mutex_lock, iEp) //%noE +// pthread_mutex_setprioceiling +GOM(pthread_mutex_timedlock, iEpp) //%noE +GOM(__pthread_mutex_trylock, iEp) //%noE +GOM(pthread_mutex_trylock, iEp) //%noE +GOM(__pthread_mutex_unlock, iEp) //%noE +GOM(pthread_mutex_unlock, iEp) //%noE +GOM(pthread_once, iEEpp) +GOM(__pthread_once, iEEpp) +GOM(__pthread_register_cancel, vEEp) +// __pthread_register_cancel_defer +GO(pthread_rwlockattr_destroy, vEp) +GO(pthread_rwlockattr_getkind_np, iEpp) +// pthread_rwlockattr_getpshared +GO(pthread_rwlockattr_init, iEp) +GO(pthread_rwlockattr_setkind_np, iEpi) +// pthread_rwlockattr_setpshared +// __pthread_rwlock_destroy +GOM(pthread_rwlock_destroy, iEp) //%noE +GOM(__pthread_rwlock_init, iEpp) //%noE +GOM(pthread_rwlock_init, iEpp) //%noE +GO(__pthread_rwlock_rdlock, iEp) +GO(pthread_rwlock_rdlock, iEp) +// pthread_rwlock_timedrdlock +// pthread_rwlock_timedwrlock +// __pthread_rwlock_tryrdlock +GO(pthread_rwlock_tryrdlock, iEp) +// __pthread_rwlock_trywrlock +GO(pthread_rwlock_trywrlock, iEp) +GO(__pthread_rwlock_unlock, iEp) +GOM(pthread_rwlock_unlock, iEp) //%noE +GO(__pthread_rwlock_wrlock, iEp) +GOM(pthread_rwlock_wrlock, iEp) //%noE +GO(pthread_self, hEv) +GOM(pthread_setaffinity_np, iEEhup) +GO(pthread_setcancelstate, iEip) +GO(pthread_setcanceltype, iEip) +GO(pthread_setconcurrency, iEi) +GO(pthread_setname_np, iEhp) +GO(pthread_setschedparam, iEhip) +GO(pthread_setschedprio, iEhi) +GO(__pthread_setspecific, iEup) +GO(pthread_setspecific, iEup) +GO(pthread_sigmask, iEipp) +GO(pthread_spin_destroy, iEp) +GO(pthread_spin_init, iEpi) +GO(pthread_spin_lock, iEp) +GO(pthread_spin_trylock, iEp) +GO(pthread_spin_unlock, iEp) +GO(pthread_testcancel, vEv) +GO(pthread_timedjoin_np, iEhpp) // will leak handle +GO(pthread_tryjoin_np, iEhp) // will leak handle +GOM(__pthread_unregister_cancel, vEEp) +// __pthread_unregister_cancel_restore +// __pthread_unwind +GOM(__pthread_unwind_next, vEEp) +GOM(pthread_yield, iEEv) +// raise +// __res_state +GOM(sem_close, iEp) //%noE +GOM(sem_destroy, iEp) //%noE +GOM(sem_getvalue, iEpp) //%noE +GOM(sem_init, iEpiu) //%noE +GOM(sem_open, pEpOM) //%noE +GOM(sem_post, iEp) //%noE +GOM(sem_timedwait, iEprLL_) //%noE +GOM(sem_trywait, iEp) //%noE +GO(sem_unlink, iEp) // no need for M here? +GOM(sem_wait, iEp) //%noE +// __sigaction +// system +// __vfork + +GOM(pthread_mutexattr_setkind_np, iEEpi) // deprecated diff --git a/src/wrapped32/wrappedlibresolv.c b/src/wrapped32/wrappedlibresolv.c new file mode 100644 index 0000000..1431b6a --- /dev/null +++ b/src/wrapped32/wrappedlibresolv.c @@ -0,0 +1,30 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "box32.h" +#include "myalign32.h" + +static const char* libresolvName = "libresolv.so.2"; +#define LIBNAME libresolv + +#include "generated/wrappedlibresolvtypes32.h" + +#include "wrappercallback32.h" + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibresolv_private.h b/src/wrapped32/wrappedlibresolv_private.h new file mode 100644 index 0000000..fcf0f0c --- /dev/null +++ b/src/wrapped32/wrappedlibresolv_private.h @@ -0,0 +1,107 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//GO(__b64_ntop, iFpLpL) +//GO(__b64_pton, iFppL) +//GO(__dn_comp, iFppipp) +//GO(__dn_count_labels, iFp) +GO2(__dn_expand, iFppppi, dn_expand) +//GOW(dn_expand, iFppppi) +//GO(__dn_skipname, iFpp) +//GO(__fp_nquery, vFpiS) +//GO(__fp_query, vFpS) +//GO(__fp_resstat, vFpS) +//GO(_gethtbyaddr, +//GO(_gethtbyname, +//GO(_gethtbyname2, +//GO(_gethtent, +//GO(_getlong, +//GO(_getshort, +//GO(__hostalias, pFp) +//GO(inet_neta, pFupL) +//GO(inet_net_ntop, pFipipL) +//GO(inet_net_pton, iFippL) +//GO(__loc_aton, iFpp) +//GO(__loc_ntoa, pFpp) +//GO(ns_datetosecs, uFpp) +//GO(ns_format_ttl, iFLpL) +//GO(__ns_get16, uFp) +//GOW(ns_get16, uFp) +//GO(__ns_get32, LFp) +//GOW(ns_get32, LFp) +GOM(ns_initparse, iFEpip) +//GO(ns_makecanon, iFppL) +//GO(ns_msg_getflag, +//GO(ns_name_compress, iFppLpp) +//GO(ns_name_ntol, iFppL) +//GO(__ns_name_ntop, iFppL) +//GOW(ns_name_ntop, iFppL) +//GO(ns_name_pack, iFppipp) +//GO(ns_name_pton, iFppL) +//GO(ns_name_rollback, vFppp) +//GO(ns_name_skip, iFpp) +GO(ns_name_uncompress, iFppppL) +//GO(__ns_name_unpack, iFppppL) +//GOW(ns_name_unpack, iFppppL) +GOM(ns_parserr, iFEpuip) +//GO(ns_parse_ttl, iFpp) +//GO(ns_put16, vFup) +//GO(ns_put32, vFLp) +//GO(ns_samedomain, iFpp) +//GO(ns_samename, iFpp) +//GO(ns_skiprr, iFppui) +//GO(ns_sprintrr, iFpppppL) +//GO(ns_sprintrrf, iFpLpuuLpLpppL) +//GO(ns_subdomain, iFpp) +//GO(__p_cdname, pFppS) +//GO(__p_cdnname, pFppiS) +//GO(__p_class, pFi) +//DATA(__p_class_syms, 4) +//GO(__p_fqname, pFppS) +//GO(__p_fqnname, pFppipi) +//GO(__p_option, pFL) +//GO(__p_query, vFp) +//GO(__p_rcode, pFi) +//GO(__p_secstodate, +//GO(__p_time, pFu) +//GO(__p_type, pFi) +//DATA(__p_type_syms, 4) +//GO(__putlong, vFup) +//GO(__putshort, vFWp) +//GO(__res_close, vFv) +//GO(__res_context_hostalias, +//GO(__res_context_query, +//GO(__res_context_search, +//GO(__res_dnok, iFp) +//GO(res_gethostbyaddr, +//GO(res_gethostbyname, +//GO(res_gethostbyname2, +//GO(__res_hnok, iFp) +//GO(__res_hostalias, pFpppL) +//GO(__res_isourserver, iFp) +//GO(__res_mailok, iFp) +//GO(__res_mkquery, iFipiipippi) +//GOW(res_mkquery, iFipiipippi) +//GO(__res_nameinquery, iFpiipp) +//GO(__res_nmkquery, +GO2(__res_nquery, iFppiipi, res_nquery) +//GO(__res_nquerydomain, +GO2(__res_nsearch, iFppiipi, res_nsearch) +//GO(__res_nsend, +//DATA(_res_opcodes, 4) +//GO(__res_ownok, iFp) +//GO(__res_queriesmatch, iFpppp) +GO2(__res_query, iEEpiipi, my32_res_query) +GOWM(res_query, iEEpiipi) +//GO2(__res_querydomain, iFppiipi, res_querydomain) +//GOW(res_querydomain, iFppiipi) +GO2(__res_search, iFEpiipi, my32_res_search) +GOWM(res_search, iEEpiipi) +//GO(__res_send, iFpipi) +//GO(res_send_setqhook, +//GO(res_send_setrhook, +//GO(_sethtent, +//GO(__sym_ntop, pFpip) +//GO(__sym_ntos, pFpip) +//GO(__sym_ston, iFppp) diff --git a/src/wrapped32/wrappedlibrt.c b/src/wrapped32/wrappedlibrt.c new file mode 100755 index 0000000..3b9221f --- /dev/null +++ b/src/wrapped32/wrappedlibrt.c @@ -0,0 +1,80 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" + +#undef aio_suspend +#undef aio_return +#undef aio_write +#undef aio_read +#undef aio_error + +#undef clock_gettime + +static const char* librtName = "librt.so.1"; +#define LIBNAME librt + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) + +// sigev_notify +#define GO(A) \ +static uintptr_t my32_sigev_notify_fct_##A = 0; \ +static void my32_sigev_notify_##A(void* sigval) \ +{ \ + RunFunctionFmt(my32_sigev_notify_fct_##A, "p", sigval); \ +} +SUPER() +#undef GO +static void* findsigev_notifyFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_sigev_notify_fct_##A == (uintptr_t)fct) return my32_sigev_notify_##A; + SUPER() + #undef GO + #define GO(A) if(my32_sigev_notify_fct_##A == 0) {my32_sigev_notify_fct_##A = (uintptr_t)fct; return my32_sigev_notify_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libpng12 sigev_notify callback\n"); + return NULL; +} + +#undef SUPER + +EXPORT int my32_timer_create(x64emu_t* emu, uint32_t clockid, void* sevp, timer_t* timerid) +{ + struct sigevent sevent; + memcpy(&sevent, sevp, sizeof(sevent)); + + if(sevent.sigev_notify == SIGEV_THREAD) { + sevent.sigev_notify_function = findsigev_notifyFct(sevent.sigev_notify_function); + } + + return timer_create(clockid, &sevent, timerid); +} + +#define PRE_INIT\ + if(1) \ + lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \ + else + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibrt_private.h b/src/wrapped32/wrappedlibrt_private.h new file mode 100755 index 0000000..392f77b --- /dev/null +++ b/src/wrapped32/wrappedlibrt_private.h @@ -0,0 +1,53 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//clockid_t is uint32? +// pid_t is uint32 too? (for clock_getcpuclockid) +// time_t is long +// timespec is struct LL +// itimerspec is struct 2 timespec (so LLLL) + +// aio_cancel +// aio_cancel64 +// aio_error +GO(aio_error64, iEp) +GO(aio_fsync, iEip) +GO(aio_fsync64, iEip) +// aio_init +// aio_read +GO(aio_read64, iEp) +// aio_return +GO(aio_return64, lEp) +GO(aio_suspend, iEpip) +GO(aio_suspend64, iEpip) +// aio_write +GO(aio_write64, iEp) +GO(clock_getcpuclockid, iEup) +GO(clock_getres, iEuBLL_) +GO2(__clock_getres64, iEup, clock_getres) +GO(clock_gettime, iEuBLL_) // *timespec +GO2(__clock_gettime, iEuBLL_, clock_gettime) +GO2(__clock_gettime64, iEup, clock_gettime) +GO(clock_nanosleep, iEuirLL_BLL_) +//GO(clock_settime, iEup) +// lio_listio +// lio_listio64 +// mq_close +GO(mq_getattr, iEip) +// mq_notify +// mq_open +// __mq_open_2 +// mq_receive +// mq_send +// mq_setattr +// mq_timedreceive +// mq_timedsend +// mq_unlink +GO(shm_open, iEpOu) +GO(shm_unlink, iEp) +//GOM(timer_create, iEEupp) +GO(timer_delete, iEu) +GO(timer_getoverrun, iEu) +//GO(timer_gettime, iEup) //time_t is L, timespec is struct LL, itimerspec (the p) is 2 timespec +//GO(timer_settime, iEuipp) //same, p are itimerspec diff --git a/src/wrapped32/wrappedlibuuid.c b/src/wrapped32/wrappedlibuuid.c new file mode 100644 index 0000000..23d02fc --- /dev/null +++ b/src/wrapped32/wrappedlibuuid.c @@ -0,0 +1,18 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "box32.h" + +static const char* libuuidName = "libuuid.so.1"; +#define LIBNAME libuuid + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibuuid_private.h b/src/wrapped32/wrappedlibuuid_private.h new file mode 100644 index 0000000..e628114 --- /dev/null +++ b/src/wrapped32/wrappedlibuuid_private.h @@ -0,0 +1,21 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(uuid_clear, vFp) +GO(uuid_compare, iFpp) +GO(uuid_copy, vFpp) +GO(uuid_generate, vFp) +//GO(uuid__generate_random, vFpp) +GO(uuid_generate_random, vFp) +//GO(uuid__generate_time, vFpp) +GO(uuid_generate_time, vFp) +GO(uuid_generate_time_safe, iFp) +GO(uuid_is_null, iFp) +GO(uuid_parse, iFpp) +//GO(uuid_time, uFpp) +GO(uuid_type, iFp) +GO(uuid_unparse, vFpp) +GO(uuid_unparse_lower, vFpp) +GO(uuid_unparse_upper, vFpp) +GO(uuid_variant, iFp) diff --git a/src/wrapped32/wrappedlibvdpau.c b/src/wrapped32/wrappedlibvdpau.c new file mode 100644 index 0000000..9298930 --- /dev/null +++ b/src/wrapped32/wrappedlibvdpau.c @@ -0,0 +1,35 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" + +static const char* libvdpauName = "libvdpau.so.1"; +#define LIBNAME libvdpau + + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedlibvdpautypes32.h" + +#include "wrappercallback32.h" + +EXPORT uint32_t my32_vdp_device_create_x11(x64emu_t* emu, void* display, int screen, void* device, ptr_t* get_proc_address) +{ + return 1; // VDP_STATUS_NO_IMPLEMENTATION +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibvdpau_private.h b/src/wrapped32/wrappedlibvdpau_private.h new file mode 100644 index 0000000..9bfa63f --- /dev/null +++ b/src/wrapped32/wrappedlibvdpau_private.h @@ -0,0 +1,5 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error meh! +#endif + +GOM(vdp_device_create_x11, iFEpipp) // last is a pointer to a VdpGetProcAddress function \ No newline at end of file diff --git a/src/wrapped32/wrappedlibx11.c b/src/wrapped32/wrappedlibx11.c new file mode 100644 index 0000000..7f3c07f --- /dev/null +++ b/src/wrapped32/wrappedlibx11.c @@ -0,0 +1,2793 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "elfloader.h" +#include "converter32.h" + +#ifdef ANDROID + static const char* libx11Name = "libX11.so"; +#else + static const char* libx11Name = "libX11.so.6"; +#endif + +#define LIBNAME libx11 + +#include "libtools/my_x11_conv.h" + +typedef int (*XErrorHandler)(void *, void *); +void* my32_XSetErrorHandler(x64emu_t* t, XErrorHandler handler); +typedef int (*XIOErrorHandler)(void *); +void* my32_XSetIOErrorHandler(x64emu_t* t, XIOErrorHandler handler); +void* my32_XESetCloseDisplay(x64emu_t* emu, void* display, int32_t extension, void* handler); +typedef int (*WireToEventProc)(void*, void*, void*); +typedef int(*EventHandler) (void*,void*,void*); +int32_t my32_XIfEvent(x64emu_t* emu, void* d,void* ev, EventHandler h, void* arg); + +void delShmInfo(my_XShmSegmentInfo_t* a); // edfine in Xext, to remove a saved ShmInfo + +typedef void (*vFp_t)(void*); +typedef int (*iFp_t)(void*); +typedef uint32_t (*uFv_t)(void); +typedef int (*iFpp_t)(void*, void*); +typedef int32_t (*iFpl_t)(void*, intptr_t); +typedef int (*iFppp_t)(void*, void*, void*); +typedef uintptr_t (*LFpii_t)(void*, int32_t, int32_t); +typedef int32_t (*iFpiiL_t)(void*, int32_t, int32_t, uintptr_t); +typedef void* (*pFpiiuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t); + +#define ADDED_FUNCTIONS() \ + GO(XInitThreads, uFv_t) \ + GO(XUnlockDisplay, vFp_t) + +#include "generated/wrappedlibx11types32.h" + +#include "wrappercallback32.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) \ +GO(5) \ +GO(6) \ +GO(7) \ +GO(8) \ +GO(9) \ +GO(10) \ +GO(11) \ +GO(12) \ +GO(13) \ +GO(14) \ +GO(15) + +// wire_to_event +#define GO(A) \ +static uintptr_t my32_wire_to_event_fct_##A = 0; \ +static int my32_wire_to_event_##A(void* dpy, void* re, void* event) \ +{ \ + static my_XEvent_32_t re_s = {0}; \ + int ret = (int)RunFunctionFmt(my32_wire_to_event_fct_##A, "ppp", getDisplay(dpy), &re_s, event);\ + unconvertXEvent(re, &re_s); \ + return ret; \ +} +SUPER() +#undef GO +#define GO(A) \ +static iFppp_t my32_rev_wire_to_event_fct_##A = NULL; \ +static int my32_rev_wire_to_event_##A(void* dpy, void* re, void* event) \ +{ \ + static my_XEvent_t re_l = {0}; \ + int ret = my32_rev_wire_to_event_fct_##A (getDisplay(dpy), &re_l, event); \ + convertXEvent(re, &re_l); \ + return ret; \ +} +SUPER() +#undef GO +static void* findwire_to_eventFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_wire_to_event_fct_##A == (uintptr_t)fct) return my32_wire_to_event_##A; + SUPER() + #undef GO + #define GO(A) if(my32_wire_to_event_fct_##A == 0) {my32_wire_to_event_fct_##A = (uintptr_t)fct; return my32_wire_to_event_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 wire_to_event callback\n"); + return NULL; +} +static void* reverse_wire_to_eventFct(library_t* lib, void* fct) +{ + //Callsed from x86 world -> native world + if(!fct) return fct; + // first check if it's a wrapped function, that could be easy + #define GO(A) if(my32_wire_to_event_##A == fct) return (void*)my32_wire_to_event_fct_##A; + SUPER() + #undef GO + if(FindElfAddress(my_context, (uintptr_t)fct)) + return fct; + // it's a naitve one... so bridge it, but need transform XImage32 to XImage + void* f = NULL; + #define GO(A) if(!f && my32_rev_wire_to_event_fct_##A == fct) f = (void*)my32_rev_wire_to_event_##A; + SUPER() + #undef GO + #define GO(A) if(!f && !my32_rev_wire_to_event_fct_##A) {my32_rev_wire_to_event_fct_##A = fct; f = my32_rev_wire_to_event_##A;} + SUPER() + #undef GO + if(f) + return (void*)AddCheckBridge(lib->w.bridge, iFppp_32, f, 0, "X11_wire_to_event"); + printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 wire_to_event callback\n"); + return fct; +} + +// event_to_wire +#define GO(A) \ +static uintptr_t my32_event_to_wire_fct_##A = 0; \ +static int my32_event_to_wire_##A(void* dpy, void* re, void* event) \ +{ \ + my_XEvent_32_t re_s = {0}; \ + convertXEvent(&re_s, re); \ + return (int)RunFunctionFmt(my32_event_to_wire_fct_##A, "ppp", getDisplay(dpy), &re_s, event); \ +} +SUPER() +#undef GO +#define GO(A) \ +static iFppp_t my32_rev_event_to_wire_fct_##A = NULL; \ +static int my32_rev_event_to_wire_##A(void* dpy, void* re, void* event) \ +{ \ + static my_XEvent_t re_l = {0}; \ + unconvertXEvent(&re_l, re); \ + return my32_rev_event_to_wire_fct_##A (getDisplay(dpy), &re_l, event); \ +} +SUPER() +#undef GO +static void* findevent_to_wireFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_event_to_wire_fct_##A == (uintptr_t)fct) return my32_event_to_wire_##A; + SUPER() + #undef GO + #define GO(A) if(my32_event_to_wire_fct_##A == 0) {my32_event_to_wire_fct_##A = (uintptr_t)fct; return my32_event_to_wire_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 event_to_wire callback\n"); + return NULL; +} +static void* reverse_event_to_wireFct(library_t* lib, void* fct) +{ + //Callsed from x86 world -> native world + if(!fct) return fct; + // first check if it's a wrapped function, that could be easy + #define GO(A) if(my32_event_to_wire_##A == fct) return (void*)my32_event_to_wire_fct_##A; + SUPER() + #undef GO + if(FindElfAddress(my_context, (uintptr_t)fct)) + return fct; + // it's a naitve one... so bridge it, but need transform XImage32 to XImage + void* f = NULL; + #define GO(A) if(!f && my32_rev_event_to_wire_fct_##A == fct) f = (void*)my32_rev_event_to_wire_##A; + SUPER() + #undef GO + #define GO(A) if(!f && !my32_rev_event_to_wire_fct_##A) {my32_rev_event_to_wire_fct_##A = fct; f = my32_rev_event_to_wire_##A;} + SUPER() + #undef GO + if(f) + return (void*)AddCheckBridge(lib->w.bridge, iFppp_32, f, 0, "X11_event_to_wire"); + printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 event_to_wire callback\n"); + return fct; +} +// error_handler +#define GO(A) \ +static uintptr_t my32_error_handler_fct_##A = 0; \ +static int my32_error_handler_##A(void* dpy, void* error) \ +{ \ + static my_XErrorEvent_32_t evt = {0}; \ + convert_XErrorEvent_to_32(&evt, error); \ + printf_log(LOG_DEBUG, "Calling Xerrorhandler(%p, %p), err=%hhu/%hhu/%hhu\n", \ + dpy, error, evt.error_code, evt.request_code, evt.minor_code); \ + return (int)RunFunctionFmt(my32_error_handler_fct_##A, "pp", FindDisplay(dpy), &evt); \ +} +SUPER() +#undef GO +#define GO(A) \ +static iFpp_t my32_rev_error_handler_fct_##A = NULL; \ +static int my32_rev_error_handler_##A(void* dpy, void* error) \ +{ \ + my_XErrorEvent_t evt = {0}; \ + convert_XErrorEvent_to_64(&evt, error); \ + return my32_rev_error_handler_fct_##A (getDisplay(dpy), &evt); \ +} +SUPER() +#undef GO +static void* finderror_handlerFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_error_handler_fct_##A == (uintptr_t)fct) return my32_error_handler_##A; + SUPER() + #undef GO + #define GO(A) if(my32_error_handler_fct_##A == 0) {my32_error_handler_fct_##A = (uintptr_t)fct; return my32_error_handler_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 error_handler callback\n"); + return NULL; +} +static void* reverse_error_handler_Fct(library_t* lib, void* fct) +{ + //Callsed from x86 world -> native world + if(!fct) return fct; + // first check if it's a wrapped function, that could be easy + #define GO(A) if(my32_error_handler_##A == fct) return (void*)my32_error_handler_fct_##A; + SUPER() + #undef GO + if(FindElfAddress(my_context, (uintptr_t)fct)) + return fct; + // it's a naitve one... so bridge it, but need transform XImage32 to XImage + void* f = NULL; + #define GO(A) if(!f && my32_rev_error_handler_fct_##A == fct) f = (void*)my32_rev_error_handler_##A; + SUPER() + #undef GO + #define GO(A) if(!f && !my32_rev_error_handler_fct_##A) {my32_rev_error_handler_fct_##A = fct; f = my32_rev_error_handler_##A;} + SUPER() + #undef GO + if(f) + return (void*)AddCheckBridge(lib->w.bridge, iFpp_32, f, 0, "X11_error_handler"); + printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 error_handler callback\n"); + return fct; +} + +// ioerror_handler +#define GO(A) \ +static uintptr_t my32_ioerror_handler_fct_##A = 0; \ +static int my32_ioerror_handler_##A(void* dpy) \ +{ \ + return (int)RunFunctionFmt(my32_ioerror_handler_fct_##A, "p", FindDisplay(dpy));\ +} +SUPER() +#undef GO +#define GO(A) \ +static iFp_t my32_rev_ioerror_handler_fct_##A = NULL; \ +static int my32_rev_ioerror_handler_##A(void* dpy) \ +{ \ + return my32_rev_ioerror_handler_fct_##A (getDisplay(dpy)); \ +} +SUPER() +#undef GO +static void* findioerror_handlerFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_ioerror_handler_fct_##A == (uintptr_t)fct) return my32_ioerror_handler_##A; + SUPER() + #undef GO + #define GO(A) if(my32_ioerror_handler_fct_##A == 0) {my32_ioerror_handler_fct_##A = (uintptr_t)fct; return my32_ioerror_handler_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 ioerror_handler callback\n"); + return NULL; +} +static void* reverse_ioerror_handler_Fct(library_t* lib, void* fct) +{ + //Callsed from x86 world -> native world + if(!fct) return fct; + // first check if it's a wrapped function, that could be easy + #define GO(A) if(my32_ioerror_handler_##A == fct) return (void*)my32_ioerror_handler_fct_##A; + SUPER() + #undef GO + if(FindElfAddress(my_context, (uintptr_t)fct)) + return fct; + // it's a naitve one... so bridge it, but need transform XImage32 to XImage + void* f = NULL; + #define GO(A) if(!f && my32_rev_ioerror_handler_fct_##A == fct) f = (void*)my32_rev_ioerror_handler_##A; + SUPER() + #undef GO + #define GO(A) if(!f && !my32_rev_ioerror_handler_fct_##A) {my32_rev_ioerror_handler_fct_##A = fct; f = my32_rev_ioerror_handler_##A;} + SUPER() + #undef GO + if(f) + return (void*)AddCheckBridge(lib->w.bridge, iFp_32, f, 0, "X11_ioerror_handler"); + printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 ioerror_handler callback\n"); + return fct; +} + +#if 0 +// exterror_handler +#define GO(A) \ +static uintptr_t my32_exterror_handler_fct_##A = 0; \ +static int my32_exterror_handler_##A(void* dpy, void* err, void* codes, int* ret_code) \ +{ \ + return (int)RunFunctionFmt(my32_exterror_handler_fct_##A, "pppp", dpy, err, codes, ret_code);\ +} +SUPER() +#undef GO +static void* findexterror_handlerFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_exterror_handler_fct_##A == (uintptr_t)fct) return my32_exterror_handler_##A; + SUPER() + #undef GO + #define GO(A) if(my32_exterror_handler_fct_##A == 0) {my32_exterror_handler_fct_##A = (uintptr_t)fct; return my32_exterror_handler_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 exterror_handler callback\n"); + return NULL; +} +static void* reverse_exterror_handlerFct(library_t* lib, void* fct) +{ + if(!fct) return fct; + if(CheckBridged(lib->w.bridge, fct)) + return (void*)CheckBridged(lib->w.bridge, fct); + #define GO(A) if(my32_exterror_handler_##A == fct) return (void*)my32_exterror_handler_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(lib->w.bridge, iFpppp, fct, 0, NULL); +} +#endif +// close_display +#define GO(A) \ +static uintptr_t my32_close_display_fct_##A = 0; \ +static int my32_close_display_##A(void* dpy, void* codes) \ +{ \ + return (int)RunFunctionFmt(my32_close_display_fct_##A, "pp", getDisplay(dpy), codes); \ +} +SUPER() +#undef GO +static void* findclose_displayFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_close_display_fct_##A == (uintptr_t)fct) return my32_close_display_##A; + SUPER() + #undef GO + #define GO(A) if(my32_close_display_fct_##A == 0) {my32_close_display_fct_##A = (uintptr_t)fct; return my32_close_display_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 close_display callback\n"); + return NULL; +} +static void* reverse_close_displayFct(library_t* lib, void* fct) +{ + if(!fct) return fct; + if(CheckBridged(lib->w.bridge, fct)) + return (void*)CheckBridged(lib->w.bridge, fct); + #define GO(A) if(my32_close_display_##A == fct) return (void*)my32_close_display_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(lib->w.bridge, iFpp_32, fct, 0, NULL); +} + +// register_im +#define GO(A) \ +static uintptr_t my32_register_im_fct_##A = 0; \ +static void my32_register_im_##A(void* dpy, void* u, void* d) \ +{ \ + RunFunctionFmt(my32_register_im_fct_##A, "ppp", getDisplay(dpy), u, d); \ +} +SUPER() +#undef GO +static void* findregister_imFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_register_im_fct_##A == (uintptr_t)fct) return my32_register_im_##A; + SUPER() + #undef GO + #define GO(A) if(my32_register_im_fct_##A == 0) {my32_register_im_fct_##A = (uintptr_t)fct; return my32_register_im_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 register_im callback\n"); + return NULL; +} +static void* reverse_register_imFct(library_t* lib, void* fct) +{ + if(!fct) return fct; + if(CheckBridged(lib->w.bridge, fct)) + return (void*)CheckBridged(lib->w.bridge, fct); + #define GO(A) if(my32_register_im_##A == fct) return (void*)my32_register_im_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(lib->w.bridge, iFppp_32, fct, 0, NULL); +} +// XConnectionWatchProc +#define GO(A) \ +static uintptr_t my32_XConnectionWatchProc_fct_##A = 0; \ +static void my32_XConnectionWatchProc_##A(void* dpy, void* data, int op, void* d) \ +{ \ + RunFunctionFmt(my32_XConnectionWatchProc_fct_##A, "ppip", FindDisplay(dpy), data, op, d); \ +} +SUPER() +#undef GO +static void* findXConnectionWatchProcFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_XConnectionWatchProc_fct_##A == (uintptr_t)fct) return my32_XConnectionWatchProc_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XConnectionWatchProc_fct_##A == 0) {my32_XConnectionWatchProc_fct_##A = (uintptr_t)fct; return my32_XConnectionWatchProc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XConnectionWatchProc callback\n"); + return NULL; +} +// xifevent +#define GO(A) \ +static uintptr_t my32_xifevent_fct_##A = 0; \ +static int my32_xifevent_##A(void* dpy, my_XEvent_t* event, void* d) \ +{ \ + static my_XEvent_32_t evt[16] = {0}; \ + static int idx = 0; \ + idx=(idx+1)&15; \ + convertXEvent(evt+idx, event); \ + return RunFunctionFmt(my32_xifevent_fct_##A, "ppp", getDisplay(dpy), evt+idx, d); \ +} +SUPER() +#undef GO +static void* findxifeventFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_xifevent_fct_##A == (uintptr_t)fct) return my32_xifevent_##A; + SUPER() + #undef GO + #define GO(A) if(my32_xifevent_fct_##A == 0) {my32_xifevent_fct_##A = (uintptr_t)fct; return my32_xifevent_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 xifevent callback\n"); + return NULL; +} +// XInternalAsyncHandler +#define GO(A) \ +static uintptr_t my32_XInternalAsyncHandler_fct_##A = 0; \ +static int my32_XInternalAsyncHandler_##A(void* dpy, void* rep, void* buf, int len, void* data) \ +{ \ + return RunFunctionFmt(my32_XInternalAsyncHandler_fct_##A, "pppip", FindDisplay(dpy), rep, buf, len, data); \ +} +SUPER() +#undef GO +static void* findXInternalAsyncHandlerFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_XInternalAsyncHandler_fct_##A == (uintptr_t)fct) return my32_XInternalAsyncHandler_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XInternalAsyncHandler_fct_##A == 0) {my32_XInternalAsyncHandler_fct_##A = (uintptr_t)fct; return my32_XInternalAsyncHandler_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XInternalAsyncHandler callback\n"); + return NULL; +} +// XSynchronizeProc +#define GO(A) \ +static uintptr_t my32_XSynchronizeProc_fct_##A = 0; \ +static int my32_XSynchronizeProc_##A() \ +{ \ + return (int)RunFunctionFmt(my32_XSynchronizeProc_fct_##A, "");\ +} +SUPER() +#undef GO +static void* findXSynchronizeProcFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_XSynchronizeProc_fct_##A == (uintptr_t)fct) return my32_XSynchronizeProc_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XSynchronizeProc_fct_##A == 0) {my32_XSynchronizeProc_fct_##A = (uintptr_t)fct; return my32_XSynchronizeProc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XSynchronizeProc callback\n"); + return NULL; +} +static void* reverse_XSynchronizeProcFct(library_t* lib, void* fct) +{ + if(!fct) return fct; + if(CheckBridged(lib->w.bridge, fct)) + return (void*)CheckBridged(lib->w.bridge, fct); + #define GO(A) if(my32_XSynchronizeProc_##A == fct) return (void*)my32_XSynchronizeProc_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(lib->w.bridge, iFppp_32, fct, 0, NULL); +} +#if 0 +// XLockDisplay +#define GO(A) \ +static uintptr_t my32_XLockDisplay_fct_##A = 0; \ +static void my32_XLockDisplay_##A(void* dpy) \ +{ \ + RunFunctionFmt(my32_XLockDisplay_fct_##A, "p", dpy); \ +} +SUPER() +#undef GO +static void* findXLockDisplayFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_XLockDisplay_fct_##A == (uintptr_t)fct) return my32_XLockDisplay_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XLockDisplay_fct_##A == 0) {my32_XLockDisplay_fct_##A = (uintptr_t)fct; return my32_XLockDisplay_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XLockDisplay callback\n"); + return NULL; +} +// XUnlockDisplay +#define GO(A) \ +static uintptr_t my32_XUnlockDisplay_fct_##A = 0; \ +static void my32_XUnlockDisplay_##A(void* dpy) \ +{ \ + RunFunctionFmt(my32_XUnlockDisplay_fct_##A, "p", dpy); \ +} +SUPER() +#undef GO +static void* findXUnlockDisplayFct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_XUnlockDisplay_fct_##A == (uintptr_t)fct) return my32_XUnlockDisplay_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XUnlockDisplay_fct_##A == 0) {my32_XUnlockDisplay_fct_##A = (uintptr_t)fct; return my32_XUnlockDisplay_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XUnlockDisplay callback\n"); + return NULL; +} +#endif +// async_handler +#define GO(A) \ +static uintptr_t my32_async_handler_fct_##A = 0; \ +static int my32_async_handler_##A(void* a, void* b, void* c, int d, void* e) \ +{ \ + return (int)RunFunctionFmt(my32_async_handler_fct_##A, "pppip", FindDisplay(a), b, c, d, e); \ +} +SUPER() +#undef GO +static void* find_async_handler_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_async_handler_fct_##A == (uintptr_t)fct) return my32_async_handler_##A; + SUPER() + #undef GO + #define GO(A) if(my32_async_handler_fct_##A == 0) {my32_async_handler_fct_##A = (uintptr_t)fct; return my32_async_handler_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 async_handler callback\n"); + return NULL; +} +// XImage function wrappers +// create_image +#define GO(A) \ +static uintptr_t my32_create_image_fct_##A = 0; \ +static void* my32_create_image_##A(void* a, void* b, uint32_t c, int d, int e, void* f, uint32_t g, uint32_t h, int i, int j) \ +{ \ + void* ret = (void*)RunFunctionFmt(my32_create_image_fct_##A, "ppuiipuuii", FindDisplay(a), convert_Visual_to_32(a, b), c, d, e, f, g, h, i, j); \ + UnwrapXImage(ret, ret); \ + return ret; \ +} \ +static pFXpuiipuuii_t my32_rev_create_image_fct_##A = NULL; \ +static void* my32_rev_create_image_##A(void* a, void* b, uint32_t c, int d, int e, void* f, uint32_t g, uint32_t h, int i, int j) \ +{ \ + void* ret = my32_rev_create_image_fct_##A (getDisplay(a), convert_Visual_to_64(a, b), c, d, e, f, g, h, i, j); \ + WrapXImage(ret, ret); \ + return ret; \ +} +SUPER() +#undef GO +static void* find_create_image_Fct(void* fct) +{ + if(!fct) return fct; + void* n_fct = GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_rev_create_image_##A == n_fct) return (void*)my32_rev_create_image_fct_##A; + SUPER() + #undef GO + if(n_fct) return n_fct; + #define GO(A) if(my32_create_image_fct_##A == (uintptr_t)fct) return my32_create_image_##A; + SUPER() + #undef GO + #define GO(A) if(my32_create_image_fct_##A == 0) {my32_create_image_fct_##A = (uintptr_t)fct; return my32_create_image_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 create_image callback\n"); + return NULL; +} +static void* reverse_create_image_Fct(library_t* lib, void* fct) +{ + //Callsed from x86 world -> native world + if(!fct) return fct; + // first check if it's a wrapped function, that could be easy + #define GO(A) if(my32_create_image_##A == fct) return (void*)my32_create_image_fct_##A; + SUPER() + #undef GO + if(FindElfAddress(my_context, (uintptr_t)fct)) + return fct; + // it's a naitve one... so bridge it, but need transform XImage32 to XImage + void* f = NULL; + #define GO(A) if(!f && my32_rev_create_image_fct_##A == fct) f = (void*)my32_rev_create_image_##A; + SUPER() + #undef GO + #define GO(A) if(!f && !my32_rev_create_image_fct_##A) {my32_rev_create_image_fct_##A = fct; f = my32_rev_create_image_##A;} + SUPER() + #undef GO + if(f) + return (void*)AddCheckBridge(lib->w.bridge, pFXpuiipuuii_32, f, 0, "Ximage_create_image"); + printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 create_image callback\n"); + return fct; +} +// destroy_image +#define GO(A) \ +static uintptr_t my32_destroy_image_fct_##A = 0; \ +static int my32_destroy_image_##A(void* a) \ +{ \ + void* obdata = ((XImage*)a)->obdata; \ + inplace_XImage_shrink(a); \ + int ret = (int)RunFunctionFmt(my32_destroy_image_fct_##A, "p", a); \ + to_hash_d((uintptr_t)obdata); \ + if(obdata) delShmInfo(obdata); \ + return ret; \ +} \ +static iFp_t my32_rev_destroy_image_fct_##A = NULL; \ +static int my32_rev_destroy_image_##A(void* a) \ +{ \ + inplace_XImage_enlarge(a); \ + to_hash_d((uintptr_t)((XImage*)a)->obdata); \ + void* obdata = ((XImage*)a)->obdata; \ + int ret = my32_rev_destroy_image_fct_##A (a); \ + if(obdata) delShmInfo(obdata); \ + return ret; \ +} +SUPER() +#undef GO +static void* find_destroy_image_Fct(void* fct) +{ + if(!fct) return fct; + void* n_fct = GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_rev_destroy_image_##A == n_fct) return (void*)my32_rev_destroy_image_fct_##A; + SUPER() + #undef GO + if(n_fct) return n_fct; + #define GO(A) if(my32_destroy_image_fct_##A == (uintptr_t)fct) return my32_destroy_image_##A; + SUPER() + #undef GO + #define GO(A) if(my32_destroy_image_fct_##A == 0) {my32_destroy_image_fct_##A = (uintptr_t)fct; return my32_destroy_image_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for 32bits libX11 destroy_image callback\n"); + return NULL; +} +static void* reverse_destroy_image_Fct(library_t* lib, void* fct) +{ + //Callsed from x86 world -> native world + if(!fct) return fct; + // first check if it's a wrapped function, that could be easy + #define GO(A) if(my32_destroy_image_##A == fct) return (void*)my32_destroy_image_fct_##A; + SUPER() + #undef GO + if(FindElfAddress(my_context, (uintptr_t)fct)) + return fct; + // it's a naitve one... so bridge it, but need transform XImage32 to XImage + void* f = NULL; + #define GO(A) if(!f && my32_rev_destroy_image_fct_##A == fct) f = (void*)my32_rev_destroy_image_##A; + SUPER() + #undef GO + #define GO(A) if(!f && !my32_rev_destroy_image_fct_##A) {my32_rev_destroy_image_fct_##A = fct; f = my32_rev_destroy_image_##A;} + SUPER() + #undef GO + if(f) + return (void*)AddCheckBridge(lib->w.bridge, iFp_32, f, 0, "Ximage_destroy_image"); + printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 destroy_image callback\n"); + return fct; +} +// get_pixel +#define GO(A) \ +static uintptr_t my32_get_pixel_fct_##A = 0; \ +static unsigned long my32_get_pixel_##A(void* a, int b, int c) \ +{ \ + inplace_XImage_shrink(a); \ + uint32_t ret = RunFunctionFmt(my32_get_pixel_fct_##A, "pii", a, b, c); \ + inplace_XImage_enlarge(a); \ + return from_ulong(ret); \ +} \ +static LFpii_t my32_rev_get_pixel_fct_##A = NULL; \ +static unsigned long my32_rev_get_pixel_##A(void* a, int b, int c) \ +{ \ + inplace_XImage_enlarge(a); \ + unsigned long ret = my32_rev_get_pixel_fct_##A (a, b, c); \ + inplace_XImage_shrink(a); \ + return ret; \ +} +SUPER() +#undef GO +static void* find_get_pixel_Fct(void* fct) +{ + if(!fct) return fct; + void* n_fct = GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_rev_get_pixel_##A == n_fct) return (void*)my32_rev_get_pixel_fct_##A; + SUPER() + #undef GO + if(n_fct) return n_fct; + #define GO(A) if(my32_get_pixel_fct_##A == (uintptr_t)fct) return my32_get_pixel_##A; + SUPER() + #undef GO + #define GO(A) if(my32_get_pixel_fct_##A == 0) {my32_get_pixel_fct_##A = (uintptr_t)fct; return my32_get_pixel_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 get_pixel callback\n"); + return NULL; +} +static void* reverse_get_pixel_Fct(library_t* lib, void* fct) +{ + //Callsed from x86 world -> native world + if(!fct) return fct; + // first check if it's a wrapped function, that could be easy + #define GO(A) if(my32_get_pixel_##A == fct) return (void*)my32_get_pixel_fct_##A; + SUPER() + #undef GO + if(FindElfAddress(my_context, (uintptr_t)fct)) + return fct; + // it's a naitve one... so bridge it, but need transform XImage32 to XImage + void* f = NULL; + #define GO(A) if(!f && my32_rev_get_pixel_fct_##A == fct) f = (void*)my32_rev_get_pixel_##A; + SUPER() + #undef GO + #define GO(A) if(!f && !my32_rev_get_pixel_fct_##A) {my32_rev_get_pixel_fct_##A = fct; f = my32_rev_get_pixel_##A;} + SUPER() + #undef GO + if(f) + return (void*)AddCheckBridge(lib->w.bridge, LFpii_32, f, 0, "Ximage_get_pixel"); + printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 get_pixel callback\n"); + return fct; +} +// put_pixel +#define GO(A) \ +static uintptr_t my32_put_pixel_fct_##A = 0; \ +static int my32_put_pixel_##A(void* a, int b, int c,unsigned long d) \ +{ \ + inplace_XImage_shrink(a); \ + int ret = (int)RunFunctionFmt(my32_put_pixel_fct_##A, "piiL", a, b, c, d); \ + inplace_XImage_enlarge(a); \ + return ret; \ +} \ +static iFpiiL_t my32_rev_put_pixel_fct_##A = NULL; \ +static int my32_rev_put_pixel_##A(void* a, int b, int c, ulong_t d) \ +{ \ + inplace_XImage_enlarge(a); \ + int ret = my32_rev_put_pixel_fct_##A (a, b, c, from_ulong(d)); \ + inplace_XImage_shrink(a); \ + return ret; \ +} +SUPER() +#undef GO +static void* find_put_pixel_Fct(void* fct) +{ + if(!fct) return fct; + void* n_fct = GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_rev_put_pixel_##A == n_fct) return (void*)my32_rev_put_pixel_fct_##A; + SUPER() + #undef GO + if(n_fct) return n_fct; + #define GO(A) if(my32_put_pixel_fct_##A == (uintptr_t)fct) return my32_put_pixel_##A; + SUPER() + #undef GO + #define GO(A) if(my32_put_pixel_fct_##A == 0) {my32_put_pixel_fct_##A = (uintptr_t)fct; return my32_put_pixel_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 put_pixel callback\n"); + return NULL; +} +static void* reverse_put_pixel_Fct(library_t* lib, void* fct) +{ + //Callsed from x86 world -> native world + if(!fct) return fct; + // first check if it's a wrapped function, that could be easy + #define GO(A) if(my32_put_pixel_##A == fct) return (void*)my32_put_pixel_fct_##A; + SUPER() + #undef GO + if(FindElfAddress(my_context, (uintptr_t)fct)) + return fct; + // it's a naitve one... so bridge it, but need transform XImage32 to XImage + void* f = NULL; + #define GO(A) if(!f && my32_rev_put_pixel_fct_##A == fct) f = (void*)my32_rev_put_pixel_##A; + SUPER() + #undef GO + #define GO(A) if(!f && !my32_rev_put_pixel_fct_##A) {my32_rev_put_pixel_fct_##A = fct; f = my32_rev_put_pixel_##A;} + SUPER() + #undef GO + if(f) + return (void*)AddCheckBridge(lib->w.bridge, iFpiiL_32, f, 0, "Ximage_put_pixel"); + printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 put_pixel callback\n"); + return fct; +} +// sub_image +#define GO(A) \ +static uintptr_t my32_sub_image_fct_##A = 0; \ +static void* my32_sub_image_##A(void* a, int b, int c, uint32_t d, uint32_t e) \ +{ \ + inplace_XImage_shrink(a); \ + void* ret = (void*)RunFunctionFmt(my32_sub_image_fct_##A, "piiuu", a, b, c, d, e);\ + if(ret!=a) UnwrapXImage(ret, ret); \ + inplace_XImage_enlarge(a); \ + return ret; \ +} \ +static pFpiiuu_t my32_rev_sub_image_fct_##A = NULL; \ +static void* my32_rev_sub_image_##A(void* a, int b, int c, uint32_t d, uint32_t e) \ +{ \ + inplace_XImage_enlarge(a); \ + void* ret = my32_rev_sub_image_fct_##A (a, b, c, d, e); \ + if(ret!=a) \ + WrapXImage(ret, ret); \ + inplace_XImage_shrink(a); \ + return ret; \ +} +SUPER() +#undef GO +static void* find_sub_image_Fct(void* fct) +{ + if(!fct) return fct; + void* n_fct = GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_rev_sub_image_##A == n_fct) return (void*)my32_rev_sub_image_fct_##A; + SUPER() + #undef GO + if(n_fct) return n_fct; + #define GO(A) if(my32_sub_image_fct_##A == (uintptr_t)fct) return my32_sub_image_##A; + SUPER() + #undef GO + #define GO(A) if(my32_sub_image_fct_##A == 0) {my32_sub_image_fct_##A = (uintptr_t)fct; return my32_sub_image_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 sub_image callback\n"); + return NULL; +} +static void* reverse_sub_image_Fct(library_t* lib, void* fct) +{ + //Callsed from x86 world -> native world + if(!fct) return fct; + // first check if it's a wrapped function, that could be easy + #define GO(A) if(my32_sub_image_##A == fct) return (void*)my32_sub_image_fct_##A; + SUPER() + #undef GO + if(FindElfAddress(my_context, (uintptr_t)fct)) + return fct; + // it's a naitve one... so bridge it, but need transform XImage32 to XImage + void* f = NULL; + #define GO(A) if(!f && my32_rev_sub_image_fct_##A == fct) f = (void*)my32_rev_sub_image_##A; + SUPER() + #undef GO + #define GO(A) if(!f && !my32_rev_sub_image_fct_##A) {my32_rev_sub_image_fct_##A = fct; f = my32_rev_sub_image_##A;} + SUPER() + #undef GO + if(f) + return (void*)AddCheckBridge(lib->w.bridge, pFpiiuu_32, f, 0, "ximage_sub_image"); + printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 sub_image callback\n"); + return fct; +} +// add_pixel +#define GO(A) \ +static uintptr_t my32_add_pixel_fct_##A = 0; \ +static int my32_add_pixel_##A(void* a, long b) \ +{ \ + inplace_XImage_shrink(a); \ + int ret = (int)RunFunctionFmt(my32_add_pixel_fct_##A, "pl", a, b); \ + inplace_XImage_enlarge(a); \ + return ret; \ +} \ +static iFpl_t my32_rev_add_pixel_fct_##A = NULL; \ +static int my32_rev_add_pixel_##A(void* a, long_t b) \ +{ \ + inplace_XImage_enlarge(a); \ + int ret = my32_rev_add_pixel_fct_##A (a, from_long(b)); \ + inplace_XImage_shrink(a); \ + return ret; \ +} +SUPER() +#undef GO +static void* find_add_pixel_Fct(void* fct) +{ + if(!fct) return fct; + void* n_fct = GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_rev_add_pixel_##A == n_fct) return (void*)my32_rev_add_pixel_fct_##A; + SUPER() + #undef GO + if(n_fct) return n_fct; + #define GO(A) if(my32_add_pixel_fct_##A == (uintptr_t)fct) return my32_add_pixel_##A; + SUPER() + #undef GO + #define GO(A) if(my32_add_pixel_fct_##A == 0) {my32_add_pixel_fct_##A = (uintptr_t)fct; return my32_add_pixel_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 add_pixel callback\n"); + return NULL; +} +static void* reverse_add_pixel_Fct(library_t* lib, void* fct) +{ + //Callsed from x86 world -> native world + if(!fct) return fct; + // first check if it's a wrapped function, that could be easy + #define GO(A) if(my32_add_pixel_##A == fct) return (void*)my32_add_pixel_fct_##A; + SUPER() + #undef GO + if(FindElfAddress(my_context, (uintptr_t)fct)) + return fct; + // it's a naitve one... so bridge it, but need transform XImage32 to XImage + void* f = NULL; + #define GO(A) if(!f && my32_rev_add_pixel_fct_##A == fct) f = (void*)my32_rev_add_pixel_##A; + SUPER() + #undef GO + #define GO(A) if(!f && !my32_rev_add_pixel_fct_##A) {my32_rev_add_pixel_fct_##A = fct; f = my32_rev_add_pixel_##A;} + SUPER() + #undef GO + if(f) + return (void*)AddCheckBridge(lib->w.bridge, iFpl_32, f, 0, "ximage_add_pixel"); + printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 add_pixel callback\n"); + return fct; +} +// end of XImage functions callbacks + +#undef SUPER + +void* my32_XCreateImage(x64emu_t* emu, void* disp, void* vis, uint32_t depth, int32_t fmt, int32_t off + , void* data, uint32_t w, uint32_t h, int32_t pad, int32_t bpl); + +int32_t my32_XInitImage(x64emu_t* emu, void* img); + +void* my32_XGetImage(x64emu_t* emu, void* disp, XID drawable, int32_t x, int32_t y + , uint32_t w, uint32_t h, uint32_t plane, int32_t fmt); + +int32_t my32_XPutImage(x64emu_t* emu, void* disp, XID drawable, void* gc, void* image + , int32_t src_x, int32_t src_y, int32_t dst_x, int32_t dst_y + , uint32_t w, uint32_t h); + +void* my32_XGetSubImage(x64emu_t* emu, void* disp, XID drawable + , int32_t x, int32_t y + , uint32_t w, uint32_t h, XID plane, int32_t fmt + , void* image, int32_t dst_x, int32_t dst_y); + +void my32_XDestroyImage(x64emu_t* emu, void* image); + +typedef void (*XIMProc)(void*, void*, void*); +typedef int (*XICProc)(void*, void*, void*); +typedef struct { + void* client_data; + XIMProc callback; +} XIMCallback; + +typedef struct { + void* client_data; + XICProc callback; +} XICCallback; + +#define XNGeometryCallback "geometryCallback" +#define XNDestroyCallback "destroyCallback" +#define XNPreeditStartCallback "preeditStartCallback" +#define XNPreeditDoneCallback "preeditDoneCallback" +#define XNPreeditDrawCallback "preeditDrawCallback" +#define XNPreeditCaretCallback "preeditCaretCallback" +#define XNPreeditStateNotifyCallback "preeditStateNotifyCallback" +#define XNStatusStartCallback "statusStartCallback" +#define XNStatusDoneCallback "statusDoneCallback" +#define XNStatusDrawCallback "statusDrawCallback" +#define XNR6PreeditCallback "r6PreeditCallback" +#define XNStringConversionCallback "stringConversionCallback" + +// utility functions +#include "super100.h" + +// XNGeometryCallback +#define GO(A) \ +static uintptr_t my32_XNGeometryCallback_fct_##A = 0; \ +static void my32_XNGeometryCallback_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my32_XNGeometryCallback_fct_##A, "ppp", a, b); \ +} +SUPER() +#undef GO +static void* findXNGeometryCallbackFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_XNGeometryCallback_fct_##A == (uintptr_t)fct) return my32_XNGeometryCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XNGeometryCallback_fct_##A == 0) {my32_XNGeometryCallback_fct_##A = (uintptr_t)fct; return my32_XNGeometryCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XNGeometryCallback callback\n"); + return NULL; +} +// XNDestroyCallback +#define GO(A) \ +static uintptr_t my32_XNDestroyCallback_fct_##A = 0; \ +static void my32_XNDestroyCallback_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my32_XNDestroyCallback_fct_##A, "ppp", a, b); \ +} +SUPER() +#undef GO +static void* findXNDestroyCallbackFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_XNDestroyCallback_fct_##A == (uintptr_t)fct) return my32_XNDestroyCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XNDestroyCallback_fct_##A == 0) {my32_XNDestroyCallback_fct_##A = (uintptr_t)fct; return my32_XNDestroyCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XNDestroyCallback callback\n"); + return NULL; +} +// XNPreeditStartCallback +#define GO(A) \ +static uintptr_t my32_XNPreeditStartCallback_fct_##A = 0; \ +static void my32_XNPreeditStartCallback_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my32_XNPreeditStartCallback_fct_##A, "ppp", a, b); \ +} +SUPER() +#undef GO +static void* findXNPreeditStartCallbackFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_XNPreeditStartCallback_fct_##A == (uintptr_t)fct) return my32_XNPreeditStartCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XNPreeditStartCallback_fct_##A == 0) {my32_XNPreeditStartCallback_fct_##A = (uintptr_t)fct; return my32_XNPreeditStartCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XNPreeditStartCallback callback\n"); + return NULL; +} +// XNPreeditDoneCallback +#define GO(A) \ +static uintptr_t my32_XNPreeditDoneCallback_fct_##A = 0; \ +static void my32_XNPreeditDoneCallback_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my32_XNPreeditDoneCallback_fct_##A, "ppp", a, b); \ +} +SUPER() +#undef GO +static void* findXNPreeditDoneCallbackFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_XNPreeditDoneCallback_fct_##A == (uintptr_t)fct) return my32_XNPreeditDoneCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XNPreeditDoneCallback_fct_##A == 0) {my32_XNPreeditDoneCallback_fct_##A = (uintptr_t)fct; return my32_XNPreeditDoneCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XNPreeditDoneCallback callback\n"); + return NULL; +} +// XNPreeditDrawCallback +#define GO(A) \ +static uintptr_t my32_XNPreeditDrawCallback_fct_##A = 0; \ +static void my32_XNPreeditDrawCallback_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my32_XNPreeditDrawCallback_fct_##A, "ppp", a, b); \ +} +SUPER() +#undef GO +static void* findXNPreeditDrawCallbackFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_XNPreeditDrawCallback_fct_##A == (uintptr_t)fct) return my32_XNPreeditDrawCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XNPreeditDrawCallback_fct_##A == 0) {my32_XNPreeditDrawCallback_fct_##A = (uintptr_t)fct; return my32_XNPreeditDrawCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XNPreeditDrawCallback callback\n"); + return NULL; +} +// XNPreeditCaretCallback +#define GO(A) \ +static uintptr_t my32_XNPreeditCaretCallback_fct_##A = 0; \ +static void my32_XNPreeditCaretCallback_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my32_XNPreeditCaretCallback_fct_##A, "ppp", a, b); \ +} +SUPER() +#undef GO +static void* findXNPreeditCaretCallbackFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_XNPreeditCaretCallback_fct_##A == (uintptr_t)fct) return my32_XNPreeditCaretCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XNPreeditCaretCallback_fct_##A == 0) {my32_XNPreeditCaretCallback_fct_##A = (uintptr_t)fct; return my32_XNPreeditCaretCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XNPreeditCaretCallback callback\n"); + return NULL; +} +// XNPreeditStateNotifyCallback +#define GO(A) \ +static uintptr_t my32_XNPreeditStateNotifyCallback_fct_##A = 0; \ +static void my32_XNPreeditStateNotifyCallback_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my32_XNPreeditStateNotifyCallback_fct_##A, "ppp", a, b); \ +} +SUPER() +#undef GO +static void* findXNPreeditStateNotifyCallbackFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_XNPreeditStateNotifyCallback_fct_##A == (uintptr_t)fct) return my32_XNPreeditStateNotifyCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XNPreeditStateNotifyCallback_fct_##A == 0) {my32_XNPreeditStateNotifyCallback_fct_##A = (uintptr_t)fct; return my32_XNPreeditStateNotifyCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XNPreeditStateNotifyCallback callback\n"); + return NULL; +} +// XNStatusStartCallback +#define GO(A) \ +static uintptr_t my32_XNStatusStartCallback_fct_##A = 0; \ +static void my32_XNStatusStartCallback_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my32_XNStatusStartCallback_fct_##A, "ppp", a, b); \ +} +SUPER() +#undef GO +static void* findXNStatusStartCallbackFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_XNStatusStartCallback_fct_##A == (uintptr_t)fct) return my32_XNStatusStartCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XNStatusStartCallback_fct_##A == 0) {my32_XNStatusStartCallback_fct_##A = (uintptr_t)fct; return my32_XNStatusStartCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XNStatusStartCallback callback\n"); + return NULL; +} +// XNStatusDoneCallback +#define GO(A) \ +static uintptr_t my32_XNStatusDoneCallback_fct_##A = 0; \ +static void my32_XNStatusDoneCallback_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my32_XNStatusDoneCallback_fct_##A, "ppp", a, b); \ +} +SUPER() +#undef GO +static void* findXNStatusDoneCallbackFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_XNStatusDoneCallback_fct_##A == (uintptr_t)fct) return my32_XNStatusDoneCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XNStatusDoneCallback_fct_##A == 0) {my32_XNStatusDoneCallback_fct_##A = (uintptr_t)fct; return my32_XNStatusDoneCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XNStatusDoneCallback callback\n"); + return NULL; +} +// XNStatusDrawCallback +#define GO(A) \ +static uintptr_t my32_XNStatusDrawCallback_fct_##A = 0; \ +static void my32_XNStatusDrawCallback_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my32_XNStatusDrawCallback_fct_##A, "ppp", a, b); \ +} +SUPER() +#undef GO +static void* findXNStatusDrawCallbackFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_XNStatusDrawCallback_fct_##A == (uintptr_t)fct) return my32_XNStatusDrawCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XNStatusDrawCallback_fct_##A == 0) {my32_XNStatusDrawCallback_fct_##A = (uintptr_t)fct; return my32_XNStatusDrawCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XNStatusDrawCallback callback\n"); + return NULL; +} +// XNR6PreeditCallback +#define GO(A) \ +static uintptr_t my32_XNR6PreeditCallback_fct_##A = 0; \ +static void my32_XNR6PreeditCallback_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my32_XNR6PreeditCallback_fct_##A, "ppp", a, b); \ +} +SUPER() +#undef GO +static void* findXNR6PreeditCallbackFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_XNR6PreeditCallback_fct_##A == (uintptr_t)fct) return my32_XNR6PreeditCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XNR6PreeditCallback_fct_##A == 0) {my32_XNR6PreeditCallback_fct_##A = (uintptr_t)fct; return my32_XNR6PreeditCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XNR6PreeditCallback callback\n"); + return NULL; +} +// XNStringConversionCallback +#define GO(A) \ +static uintptr_t my32_XNStringConversionCallback_fct_##A = 0; \ +static void my32_XNStringConversionCallback_##A(void* a, void* b, void* c) \ +{ \ + RunFunctionFmt(my32_XNStringConversionCallback_fct_##A, "ppp", a, b); \ +} +SUPER() +#undef GO +static void* findXNStringConversionCallbackFct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my32_XNStringConversionCallback_fct_##A == (uintptr_t)fct) return my32_XNStringConversionCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_XNStringConversionCallback_fct_##A == 0) {my32_XNStringConversionCallback_fct_##A = (uintptr_t)fct; return my32_XNStringConversionCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 XNStringConversionCallback callback\n"); + return NULL; +} + +#undef SUPER + +#define SUPER() \ +GO(XNGeometryCallback) \ +GO(XNDestroyCallback) \ +GO(XNPreeditStartCallback) \ +GO(XNPreeditDoneCallback) \ +GO(XNPreeditDrawCallback) \ +GO(XNPreeditCaretCallback) \ +GO(XNPreeditStateNotifyCallback) \ +GO(XNStatusStartCallback) \ +GO(XNStatusDoneCallback) \ +GO(XNStatusDrawCallback) \ +GO(XNR6PreeditCallback) \ +GO(XNStringConversionCallback) + +#define VA_CALL(FUNC, FIRST_ARG, N, VAARGSZ, RESULT) \ +switch (VAARGSZ) \ +{ \ +case 2: \ + RESULT = FUNC(FIRST_ARG, from_ulong(va[0]), from_ulong(va[1]), NULL); \ + break; \ +case 4: \ + RESULT = FUNC(FIRST_ARG, from_ulong(va[0]), from_ulong(va[1]), from_ulong(va[2]), from_ulong(va[3]), NULL); \ + break; \ +case 6: \ + RESULT = FUNC(FIRST_ARG, from_ulong(va[0]), from_ulong(va[1]), from_ulong(va[2]), from_ulong(va[3]), from_ulong(va[4]), from_ulong(va[5]), NULL); \ + break; \ +case 8: \ + RESULT = FUNC(FIRST_ARG, from_ulong(va[0]), from_ulong(va[1]), from_ulong(va[2]), from_ulong(va[3]), from_ulong(va[4]), from_ulong(va[5]), from_ulong(va[6]), from_ulong(va[7]), NULL); \ + break; \ +case 10: \ + RESULT = FUNC(FIRST_ARG, from_ulong(va[0]), from_ulong(va[1]), from_ulong(va[2]), from_ulong(va[3]), from_ulong(va[4]), from_ulong(va[5]), from_ulong(va[6]), from_ulong(va[7]), from_ulong(va[8]), from_ulong(va[9]), NULL); \ + break; \ +case 12: \ + RESULT = FUNC(FIRST_ARG, from_ulong(va[0]), from_ulong(va[1]), from_ulong(va[2]), from_ulong(va[3]), from_ulong(va[4]), from_ulong(va[5]), from_ulong(va[6]), from_ulong(va[7]), from_ulong(va[8]), from_ulong(va[9]), from_ulong(va[10]), from_ulong(va[11]), NULL); \ + break; \ +case 14: \ + RESULT = FUNC(FIRST_ARG, from_ulong(va[0]), from_ulong(va[1]), from_ulong(va[2]), from_ulong(va[3]), from_ulong(va[4]), from_ulong(va[5]), from_ulong(va[6]), from_ulong(va[7]), from_ulong(va[8]), from_ulong(va[9]), from_ulong(va[10]), from_ulong(va[11]), from_ulong(va[12]), from_ulong(va[13]), NULL); \ + break; \ +case 16: \ + RESULT = FUNC(FIRST_ARG, from_ulong(va[0]), from_ulong(va[1]), from_ulong(va[2]), from_ulong(va[3]), from_ulong(va[4]), from_ulong(va[5]), from_ulong(va[6]), from_ulong(va[7]), from_ulong(va[8]), from_ulong(va[9]), from_ulong(va[10]), from_ulong(va[11]), from_ulong(va[12]), from_ulong(va[13]), from_ulong(va[14]), from_ulong(va[15]), NULL); \ + break; \ +case 18: \ + RESULT = FUNC(FIRST_ARG, from_ulong(va[0]), from_ulong(va[1]), from_ulong(va[2]), from_ulong(va[3]), from_ulong(va[4]), from_ulong(va[5]), from_ulong(va[6]), from_ulong(va[7]), from_ulong(va[8]), from_ulong(va[9]), from_ulong(va[10]), from_ulong(va[11]), from_ulong(va[12]), from_ulong(va[13]), from_ulong(va[14]), from_ulong(va[15]), from_ulong(va[16]), from_ulong(va[17]), NULL); \ + break; \ +case 20: \ + RESULT = FUNC(FIRST_ARG, from_ulong(va[0]), from_ulong(va[1]), from_ulong(va[2]), from_ulong(va[3]), from_ulong(va[4]), from_ulong(va[5]), from_ulong(va[6]), from_ulong(va[7]), from_ulong(va[8]), from_ulong(va[9]), from_ulong(va[10]), from_ulong(va[11]), from_ulong(va[12]), from_ulong(va[13]), from_ulong(va[14]), from_ulong(va[15]), from_ulong(va[16]), from_ulong(va[17]), from_ulong(va[18]), from_ulong(va[19]), NULL); \ + break; \ +default: \ + printf_log(LOG_NONE, "warning: %s's vasize (%d) is too large, need create new call case!\n", __func__, VAARGSZ); \ + break; \ +} + +#define GO(A) \ +if (va[i] && strcmp((char*)from_ptrv(va[i]), A) == 0) { \ + XICCallback* origin = (XICCallback*)from_ptrv(va[i+1]); \ + va[i+1] = to_ptrv(find##A##Fct(origin)); \ +} + +EXPORT void* my32_XCreateIC(x64emu_t* emu, void* xim, ptr_t* va) { + int n = 0; + while (va[n]) n+=2; + + for (int i = 0; i < n; i += 2) { + SUPER() + } + + void* res = NULL; + VA_CALL(my->XCreateIC, xim, 1, n, res); + return res; +} + +EXPORT void* my32_XVaCreateNestedList(x64emu_t* emu, int unused, ptr_t* va) { + int n = 0; + while (va[n]) n+=2 ; + + for (int i = 0; i < n; i += 2) { + SUPER() + } + + void* res = NULL; + VA_CALL(my->XVaCreateNestedList, unused, 1, n, res); + return res; +} + +EXPORT void* my32_XSetICValues(x64emu_t* emu, void* xic, ptr_t* va) { + int n = 0; + while (va[n]) n+=2; + + for (int i = 0; i < n; i += 2) { + SUPER() + } + + void* res = NULL; + VA_CALL(my->XSetICValues, xic, 1, n, res); + return res; +} +#undef GO + +EXPORT void* my32_XSetIMValues(x64emu_t* emu, void* xim, ptr_t* va) { + int n = 0; + while (va[n]) n+=2; + + #define GO(A) \ + if (va[i] && strcmp((char*)from_ptrv(va[i]), A) == 0) { \ + XIMCallback* origin = (XIMCallback*)from_ptrv(va[i+1]); \ + va[i+1] = to_ptrv(find##A##Fct(origin)); \ + } + for (int i = 0; i < n; i += 2) { + SUPER() + } + #undef GO + + void* res = NULL; + VA_CALL(my->XSetIMValues, xim, 1, n, res) + return res; +} + +#undef VA_CALL +#undef SUPER +EXPORT void* my32_XSetErrorHandler(x64emu_t* emu, XErrorHandler handler) +{ + void* ret = my->XSetErrorHandler(finderror_handlerFct(handler)); + return reverse_error_handler_Fct(my_lib, ret); +} + +EXPORT void* my32_XSetIOErrorHandler(x64emu_t* emu, XIOErrorHandler handler) +{ + void* ret = my->XSetIOErrorHandler(findioerror_handlerFct(handler)); + return reverse_ioerror_handler_Fct(my_lib, ret); +} + +#if 0 +EXPORT void* my32_XESetError(x64emu_t* emu, void* display, int32_t extension, void* handler) +{ + void* ret = my->XESetError(display, extension, findexterror_handlerFct(handler)); + return reverse_exterror_handlerFct(my_lib, ret); +} +#endif +EXPORT void* my32_XESetCloseDisplay(x64emu_t* emu, void* display, int32_t extension, void* handler) +{ + void* ret = my->XESetCloseDisplay(display, extension, findclose_displayFct(handler)); + return reverse_close_displayFct(my_lib, ret); +} + +EXPORT int32_t my32_XIfEvent(x64emu_t* emu, void* d,void* ev, EventHandler h, void* arg) +{ + my_XEvent_t event = {0}; + int32_t ret = my->XIfEvent(d, &event, findxifeventFct(h), arg); + if(ret) + convertXEvent(ev, &event); + return ret; +} + +EXPORT int32_t my32_XCheckIfEvent(x64emu_t* emu, void* d,void* ev, EventHandler h, void* arg) +{ + my_XEvent_t event = {0}; + int32_t ret = my->XCheckIfEvent(d, &event, findxifeventFct(h), arg); + if(ret) + convertXEvent(ev, &event); + return ret; +} +EXPORT int32_t my32_XPeekIfEvent(x64emu_t* emu, void* d,void* ev, EventHandler h, void* arg) +{ + my_XEvent_t event = {0}; + int32_t ret = my->XPeekIfEvent(d, &event, findxifeventFct(h), arg); + if(ret) + convertXEvent(ev, &event); + return ret; +} + +EXPORT int my32_XFilterEvent(x64emu_t* emu, my_XEvent_32_t* evt, XID window) +{ + my_XEvent_t event = {0}; + unconvertXEvent(&event, evt); + return my->XFilterEvent(&event, window); +} + +EXPORT int my32_XPutBackEvent(x64emu_t* emu, void* dpy, my_XEvent_32_t* evt) +{ + my_XEvent_t event = {0}; + unconvertXEvent(&event, evt); + return my->XPutBackEvent(dpy, &event); +} + +EXPORT int my32_XCheckMaskEvent(x64emu_t* emu, void* dpy, long mask, my_XEvent_32_t* evt) +{ + my_XEvent_t event = {0}; + int32_t ret = my->XCheckMaskEvent(dpy, mask, &event); + if(ret) + convertXEvent(evt, &event); + return ret; +} + +void WrapXImage(void* d, void* s) +{ + XImage *src = s; + XImage_32 *dst = d; + + // inplace "shrink" + + dst->width = src->width; + dst->height = src->height; + dst->xoffset = src->xoffset; + dst->format = src->format; + dst->data = to_ptrv(src->data); + dst->byte_order = src->byte_order; + dst->bitmap_unit = src->bitmap_unit; + dst->bitmap_bit_order = src->bitmap_bit_order; + dst->bitmap_pad = src->bitmap_pad; + dst->depth = src->depth; + dst->bytes_per_line = src->bytes_per_line; + dst->bits_per_pixel = src->bits_per_pixel; + dst->red_mask = to_ulong(src->red_mask); + dst->green_mask = to_ulong(src->green_mask); + dst->blue_mask = to_ulong(src->blue_mask); + dst->obdata = to_hash((uintptr_t)src->obdata); + + #define GO(A, W) \ + dst->f.A = to_ptrv((W##_t)reverse_##A##_Fct(my_lib, src->f.A)); + + GO(create_image, pFXpuiipuuii) + GO(destroy_image, iFp) + GO(get_pixel, LFpii) + GO(put_pixel, iFpiiL) + GO(sub_image, pFpiiuu) + GO(add_pixel, iFpl) + #undef GO +} + +void UnwrapXImage(void* d, void* s) +{ + XImage_32* src = s; + XImage *dst = d; + + // inplace "enlarge", so reverse order + + #define GO(A, W) \ + dst->f.A = (W##_t)find_##A##_Fct(from_ptrv(src->f.A)); + + GO(add_pixel, iFpl) + GO(sub_image, pFpiiuu) + GO(put_pixel, iFpiiL) + GO(get_pixel, LFpii) + GO(destroy_image, iFp) + GO(create_image, pFXpuiipuuii) + #undef GO + + dst->obdata = (void*)from_hash(src->obdata); + dst->blue_mask = from_ulong(src->blue_mask); + dst->green_mask = from_ulong(src->green_mask); + dst->red_mask = from_ulong(src->red_mask); + dst->bits_per_pixel = src->bits_per_pixel; + dst->bytes_per_line = src->bytes_per_line; + dst->depth = src->depth; + dst->bitmap_pad = src->bitmap_pad; + dst->bitmap_bit_order = src->bitmap_bit_order; + dst->bitmap_unit = src->bitmap_unit; + dst->byte_order = src->byte_order; + dst->data = from_ptrv(src->data); + dst->format = src->format; + dst->xoffset = src->xoffset; + dst->height = src->height; + dst->width = src->width; +} + +EXPORT void* my32_XCreateImage(x64emu_t* emu, void* disp, void* vis, uint32_t depth, int32_t fmt, int32_t off + , void* data, uint32_t w, uint32_t h, int32_t pad, int32_t bpl) +{ + + XImage *img = my->XCreateImage(disp, convert_Visual_to_64(disp, vis), depth, fmt, off, data, w, h, pad, bpl); + if(!img) + return img; + // bridge all access functions... + WrapXImage(img, img); + return img; +} + +EXPORT int32_t my32_XInitImage(x64emu_t* emu, void* img) +{ + XImage l_img = {0}; + UnwrapXImage(&l_img, img); + int ret = my->XInitImage(&l_img); + // bridge all access functions... + WrapXImage(img, &l_img); + return ret; +} + +EXPORT void* my32_XGetImage(x64emu_t* emu, void* disp, XID drawable, int32_t x, int32_t y + , uint32_t w, uint32_t h, uint32_t plane, int32_t fmt) +{ + + XImage *img = my->XGetImage(disp, drawable, x, y, w, h, plane, fmt); + if(!img) + return img; + // bridge all access functions... + inplace_XImage_shrink(img); + return img; +} + +EXPORT void my32__XInitImageFuncPtrs(x64emu_t* emu, XImage_32* img) +{ + XImage img_l = {0}; + img->f.add_pixel = img->f.create_image = img->f.destroy_image = img->f.get_pixel = img->f.put_pixel = img->f.sub_image = 0; + UnwrapXImage(&img_l, img); + my->_XInitImageFuncPtrs(&img_l); + WrapXImage(img, &img_l); +} + +EXPORT int32_t my32_XPutImage(x64emu_t* emu, void* disp, size_t drawable, void* gc, void* image + , int32_t src_x, int32_t src_y, int32_t dst_x, int32_t dst_y + , uint32_t w, uint32_t h) +{ + inplace_XImage_enlarge(image); // what if the image was created on x86 side and is smaller? + int32_t r = my->XPutImage(disp, drawable, gc, image, src_x, src_y, dst_x, dst_y, w, h); + // bridge all access functions... + inplace_XImage_shrink(image); + return r; +} + +EXPORT void* my32_XGetSubImage(x64emu_t* emu, void* disp, XID drawable + , int32_t x, int32_t y + , uint32_t w, uint32_t h, XID plane, int32_t fmt + , void* image, int32_t dst_x, int32_t dst_y) +{ + + inplace_XImage_enlarge(image); + XImage *img = my->XGetSubImage(disp, drawable, x, y, w, h, plane, fmt, image, dst_x, dst_y); + if(img && img!=image) + inplace_XImage_shrink(img); + + inplace_XImage_shrink(image); + return img; +} + +EXPORT void my32_XDestroyImage(x64emu_t* emu, void* image) +{ + + inplace_XImage_enlarge(image); + to_hash_d((uintptr_t)((XImage*)image)->obdata); + my->XDestroyImage(image); +} + +typedef struct xintasync_s { + struct xintasync_s *next; + int (*handler)( + void*, + void*, + void*, + int, + void* + ); + void* data; +} xintasync_t; + +EXPORT void my32__XDeqAsyncHandler(x64emu_t* emu, void* cb, void* data) +{ + my->_XDeqAsyncHandler(findXInternalAsyncHandlerFct(cb), data); +} + +EXPORT void* my32_XESetWireToEvent(x64emu_t* emu, void* display, int32_t event_number, void* proc) +{ + void* ret = NULL; + + ret = my->XESetWireToEvent(display, event_number, findwire_to_eventFct(proc)); + + return reverse_wire_to_eventFct(my_lib, ret); +} +EXPORT void* my32_XESetEventToWire(x64emu_t* emu, void* display, int32_t event_number, void* proc) +{ + void* ret = NULL; + + ret = my->XESetEventToWire(display, event_number, findevent_to_wireFct(proc)); + + return reverse_event_to_wireFct(my_lib, ret); +} + +EXPORT int my32_XRegisterIMInstantiateCallback(x64emu_t* emu, void* d, void* db, void* res_name, void* res_class, void* cb, void* data) +{ + return my->XRegisterIMInstantiateCallback(d, db, res_name, res_class, findregister_imFct(cb), data); +} + +EXPORT int my32_XUnregisterIMInstantiateCallback(x64emu_t* emu, void* d, void* db, void* res_name, void* res_class, void* cb, void* data) +{ + return my->XUnregisterIMInstantiateCallback(d, db, res_name, res_class, reverse_register_imFct(my_lib, cb), data); +} +extern int my32_xinput_opcode; +EXPORT int my32_XQueryExtension(x64emu_t* emu, void* display, char* name, int* major, int* first_event, int* first_error) +{ + int fevent; + int ret = my->XQueryExtension(display, name, major, &fevent, first_error); + if(first_event) *first_event = fevent; + if(!ret && name && !strcmp(name, "GLX") && BOX64ENV(x11glx)) { + // hack to force GLX to be accepted, even if not present + // left major and first_XXX to default... + ret = 1; + } else if(!strcmp(name, "XInputExtension") && major) { + my32_xinput_opcode = *major; + } else if(!strcmp(name, "XFIXES")) { + register_XFixes_events(fevent); + } /*else if(ret && first_event) { + printf_log(LOG_INFO, "X11 Extension \"%s\" first XEvent %d\n", name, *first_event); + }*/ + return ret; +} +EXPORT int my32_XkbQueryExtension(x64emu_t* emu, void* display, char* opcode, int* event_base, int* error, int* major, int* minor) +{ + int fallback; + int *event = event_base?event_base:&fallback; + int ret = my->XkbQueryExtension(display, opcode, event, error, major, minor); + if(!ret) return ret; + register_Xkb_events(*event); + return ret; +} +EXPORT int my32_XAddConnectionWatch(x64emu_t* emu, void* display, char* f, void* data) +{ + return my->XAddConnectionWatch(display, findXConnectionWatchProcFct(f), data); +} +#if 0 + +EXPORT void my32_XRemoveConnectionWatch(x64emu_t* emu, void* display, char* f, void* data) +{ + my->XRemoveConnectionWatch(display, findXConnectionWatchProcFct(f), data); +} + +EXPORT void* my32_XSetAfterFunction(x64emu_t* emu, void* display, void* f) +{ + + return reverse_XSynchronizeProcFct(my_lib, my->XSetAfterFunction(display, findXSynchronizeProcFct(f))); +} +#endif + +EXPORT void* my32_XSynchronize(x64emu_t* emu, void* display, int onoff) +{ + return reverse_XSynchronizeProcFct(my_lib, my->XSynchronize(display, onoff)); +} + +EXPORT void* my32_XOpenDisplay(void* name) +{ + void* ret = my->XOpenDisplay(name); + if(ret && BOX64ENV(x11sync)) {my->XSynchronize(ret, 1); printf_log(LOG_INFO, "Forcing Syncronized operation on Display %p\n", ret);} + return ret; +} + +EXPORT int my32_XCloseDisplay(x64emu_t* emu, void* dpy) +{ + int ret = my->XCloseDisplay(dpy); + if(!ret) delDisplay(dpy); + return ret; +} + + +EXPORT XID my32_XCreateWindow(x64emu_t* emu, void* d, XID Window, int x, int y, uint32_t width, uint32_t height, uint32_t border_width, int depth, uint32_t cl, void* visual, unsigned long mask, my_XSetWindowAttributes_32_t* attr) +{ + my_XSetWindowAttributes_t attrib; + if(attr) + convert_XSetWindowAttributes_to_64(&attrib, attr); + return my->XCreateWindow(d, Window, x, y, width, height, border_width, depth, cl, convert_Visual_to_64(d, visual), mask, attr?(&attrib):NULL); +} + +EXPORT int my32_XNextEvent(x64emu_t* emu, void* dpy, my_XEvent_32_t* evt) +{ + my_XEvent_t event = {0}; + int ret = my->XNextEvent(dpy, &event); + convertXEvent(evt, &event); + return ret; +} + +EXPORT int my32_XPeekEvent(x64emu_t* emu, void* dpy, my_XEvent_32_t* evt) +{ + my_XEvent_t event = {0}; + int ret = my->XPeekEvent(dpy, &event); + convertXEvent(evt, &event); + return ret; +} + +EXPORT int my32_XCheckTypedEvent(x64emu_t* emu, void* dpy, int type, my_XEvent_32_t* evt) +{ + my_XEvent_t event = {0}; + int ret = my->XCheckTypedEvent(dpy, type, &event); + if(ret) convertXEvent(evt, &event); + return ret; +} + +EXPORT int my32_XCheckTypedWindowEvent(x64emu_t* emu, void* dpy, XID window, int type, my_XEvent_32_t* evt) +{ + my_XEvent_t event = {0}; + int ret = my->XCheckTypedWindowEvent(dpy, window, type, &event); + if(ret) convertXEvent(evt, &event); + return ret; +} + +EXPORT int my32_XCheckWindowEvent(x64emu_t* emu, void* dpy, XID window, long mask, my_XEvent_32_t* evt) +{ + my_XEvent_t event = {0}; + int ret = my->XCheckWindowEvent(dpy, window, mask, &event); + if(ret) convertXEvent(evt, &event); + return ret; +} + +EXPORT int my32_XWindowEvent(x64emu_t* emu, void* dpy, XID window, long mask, my_XEvent_32_t* evt) +{ + my_XEvent_t event = {0}; + int ret = my->XWindowEvent(dpy, window, mask, &event); + convertXEvent(evt, &event); + return ret; +} + +EXPORT int my32_XMaskEvent(x64emu_t* emu, void* dpy, long mask, my_XEvent_32_t* evt) +{ + my_XEvent_t event = {0}; + int ret = my->XMaskEvent(dpy, mask, &event); + if(ret) convertXEvent(evt, &event); + return ret; +} + +EXPORT int my32_XSendEvent(x64emu_t* emu, void* dpy, XID window, int propagate, long mask, my_XEvent_32_t* evt) +{ + my_XEvent_t event = {0}; + if(evt->type==XEVT_ClientMessage && evt->xclient.send_event) { + evt->xany.display = to_ptrv(dpy); // some program don't setup this data because the server will + } + if(evt) unconvertXEvent(&event, evt); + return my->XSendEvent(dpy, window, propagate, mask, evt?(&event):NULL); +} + +EXPORT int my32_XGetEventData(x64emu_t* emu, void* dpy, my_XEvent_32_t* evt) +{ + my_XEvent_t event = {0}; + if(evt) unconvertXEvent(&event, evt); + int ret = my->XGetEventData(dpy, &event); + if(ret) { + inplace_XEventData_shring(&event); + convertXEvent(evt, &event); + } + return ret; +} + +EXPORT void my32_XFreeEventData(x64emu_t* emu, void* dpy, my_XEvent_32_t* evt) +{ + my_XEvent_t event = {0}; + if(evt) { + unconvertXEvent(&event, evt); + inplace_XEventData_enlarge(&event); + } + my->XFreeEventData(dpy, &event); + convertXEvent(evt, &event); +} + +EXPORT int my32_XRefreshKeyboardMapping(x64emu_t* emu, my_XMappingEvent_32_t* evt) +{ + my_XMappingEvent_t event = {0}; + event.type = evt->type; + event.serial = from_ulong(evt->serial); + event.send_event = evt->send_event; + event.display = getDisplay(from_ptrv(evt->display)); + event.window = from_ulong(evt->window); + event.request = evt->request; + event.first_keycode = evt->first_keycode; + event.count = evt->count; + return my->XRefreshKeyboardMapping(&event); +} + +EXPORT void* my32_XGetKeyboardMapping(x64emu_t* emu, void* dpy, uint8_t first, int count, int* ret_count) +{ + unsigned long* ret = my->XGetKeyboardMapping(dpy, first, count, ret_count); + if(ret) { + //inplace reduction of ulong... + int cnt = count * *ret_count; + ulong_t* ret_s = (ulong_t*)ret; + for(int i=0; itype; + event.serial = from_ulong(evt->serial); + event.send_event = evt->send_event; + event.display = getDisplay(from_ptrv(evt->display)); + event.time = from_ulong(evt->time); + event.xkb_type = evt->xkb_type; + event.device = evt->device; + event.changed = evt->changed; + event.flags = evt->flags; + event.first_type = evt->first_type; + event.num_types = evt->num_types; + event.min_key_code = evt->min_key_code; + event.max_key_code = evt->max_key_code; + event.first_key_sym = evt->first_key_sym; + event.first_key_act = evt->first_key_act; + event.first_key_behavior = evt->first_key_behavior; + event.first_key_explicit = evt->first_key_explicit; + event.first_modmap_key = evt->first_modmap_key; + event.first_vmodmap_key = evt->first_vmodmap_key; + event.num_key_syms = evt->num_key_syms; + event.num_key_acts = evt->num_key_acts; + event.num_key_behaviors = evt->num_key_behaviors; + event.num_key_explicit = evt->num_key_explicit; + event.num_modmap_keys = evt->num_modmap_keys; + event.num_vmodmap_keys = evt->num_vmodmap_keys; + event.vmods = evt->vmods; + return my->XkbRefreshKeyboardMapping(&event); +} + +EXPORT unsigned long my32_XLookupKeysym(x64emu_t* emu, my_XEvent_32_t* evt, int index) +{ + my_XEvent_t event = {0}; + if(evt) unconvertXEvent(&event, evt); + return my->XLookupKeysym(evt?(&event):NULL, index); +} + +EXPORT int my32_XLookupString(x64emu_t* emu, my_XEvent_32_t* evt, void* buff, int len, ulong_t* keysym, void* status) +{ + my_XEvent_t event = {0}; + XID keysym_l = 0; + if(evt) unconvertXEvent(&event, evt); + int ret = my->XLookupString(evt?(&event):NULL, buff, len, keysym?(&keysym_l):NULL, status); + if(keysym) *keysym = to_ulong(keysym_l); + return ret; +} + +EXPORT int my32_XmbLookupString(x64emu_t* emu, void* xic, my_XEvent_32_t* evt, void* buff, int len, ulong_t* keysym, void* status) +{ + my_XEvent_t event = {0}; + XID keysym_l = 0; + if(evt) unconvertXEvent(&event, evt); + int ret = my->XmbLookupString(xic, evt?(&event):NULL, buff, len, keysym?(&keysym_l):NULL, status); + if(keysym) *keysym = to_ulong(keysym_l); + return ret; +} + +EXPORT int my32_XwcLookupString(x64emu_t* emu, void* xic, my_XEvent_32_t* evt, void* buff, int len, ulong_t* keysym, void* status) +{ + my_XEvent_t event = {0}; + XID keysym_l = 0; + if(evt) unconvertXEvent(&event, evt); + int ret = my->XwcLookupString(xic, evt?(&event):NULL, buff, len, keysym?(&keysym_l):NULL, status); + if(keysym) *keysym = to_ulong(keysym_l); + return ret; +} + +EXPORT int my32_Xutf8LookupString(x64emu_t* emu, void* xic, my_XEvent_32_t* evt, void* buff, int len, ulong_t* keysym, void* status) +{ + my_XEvent_t event = {0}; + XID keysym_l = 0; + if(evt) unconvertXEvent(&event, evt); + int ret = my->Xutf8LookupString(xic, evt?(&event):NULL, buff, len, keysym?(&keysym_l):NULL, status); + if(keysym) *keysym = to_ulong(keysym_l); + return ret; +} + +EXPORT int my32_XSetWMProtocols(x64emu_t* emu, void* dpy, XID window, XID_32* protocol, int count) +{ + XID list[count]; + if(protocol) + for(int i=0; iXSetWMProtocols(dpy, window, protocol?list:NULL, count); +} + +EXPORT int my32_XSetWMHints(x64emu_t* emu, void* dpy, XID window, void* hints) +{ + inplace_enlarge_wmhints(hints); + int ret = my->XSetWMHints(dpy, window, hints); + inplace_shrink_wmhints(hints); + return ret; +} + +EXPORT void* my32_XGetWMHints(x64emu_t* emu, void* dpy, XID window) +{ + void* ret = my->XGetWMHints(dpy, window); + inplace_shrink_wmhints(ret); + return ret; +} + +EXPORT void my32_XSetWMNormalHints(x64emu_t* emu, void* dpy, XID window, void* hints) +{ + inplace_enlarge_wmsizehints(hints); + my->XSetWMNormalHints(dpy, window, hints); + inplace_shrink_wmsizehints(hints); +} + +EXPORT int my32_XGetWMNormalHints(x64emu_t* emu, void* dpy, XID window, void* hints, long_t* supplied) +{ + long supplied_l = 0; + int hints_l[17+2] = {0}; + int ret = my->XGetWMNormalHints(dpy, window, hints?hints_l:NULL, supplied?(&supplied_l):NULL); + if(supplied) *supplied = to_long(supplied_l); + if(hints) { + *(long_t*)hints = to_long(*(long*)hints_l); + memcpy(hints+4, hints_l+2, 17*4); + } + return ret; +} +EXPORT int my32_XGetWMProtocols(x64emu_t* emu, void* dpy, XID window, void* hints, long_t* supplied) +{ + long supplied_l = 0; + int hints_l[17+2] = {0}; + int ret = my->XGetWMProtocols(dpy, window, hints?hints_l:NULL, supplied?(&supplied_l):NULL); + if(supplied) *supplied = to_long(supplied_l); + if(hints) { + *(long_t*)hints = to_long(*(long*)hints_l); + memcpy(hints+4, hints_l+2, 17*4); + } + return ret; +} +EXPORT void* my32__XGetRequest(x64emu_t* emu, my_XDisplay_t* dpy, uint8_t type, size_t len) +{ + // check if asynchandler needs updated wrapping + struct my_XInternalAsync * p = dpy->async_handlers; + while(p) { + if(GetNativeFnc((uintptr_t)p->handler)!=p->handler) { + // needs wrapping and autobridge! + void* new_handler = find_async_handler_Fct(p->handler); + AddAutomaticBridge(my_lib->w.bridge, iFpppip_32, new_handler, 0, "async_handler"); + p->handler = new_handler; + } + p = p->next; + } + + return my->_XGetRequest(dpy, type, len); +} + +EXPORT int my32_XStringListToTextProperty(x64emu_t* emu, ptr_t* list, int count, void* text) +{ + char* l_list[count]; + if(list) + for(int i=0; iXStringListToTextProperty(list?(&l_list):NULL, count, &text_l); + to_struct_pLiL(to_ptrv(text), &text_l); + return ret; +} + +EXPORT int my32_Xutf8TextListToTextProperty(x64emu_t* emu, void* dpy, ptr_t* list, int count, uint32_t style, void* text) +{ + char* l_list[count]; + if(list) + for(int i=0; iXutf8TextListToTextProperty(dpy, list?(&l_list):NULL, count, style, &text_l); + to_struct_pLiL(to_ptrv(text), &text_l); + return ret; +} + +EXPORT int my32_XmbTextListToTextProperty(x64emu_t* emu, void* dpy, ptr_t* list, int count, uint32_t style, void* text) +{ + char* l_list[count]; + if(list) + for(int i=0; iXmbTextListToTextProperty(dpy, list?(&l_list):NULL, count, style, &text_l); + to_struct_pLiL(to_ptrv(text), &text_l); + return ret; +} + +EXPORT int my32_XwcTextListToTextProperty(x64emu_t* emu, void* dpy, ptr_t* list, int count, uint32_t style, void* text) +{ + char* l_list[count]; + if(list) + for(int i=0; iXwcTextListToTextProperty(dpy, list?(&l_list):NULL, count, style, &text_l); + to_struct_pLiL(to_ptrv(text), &text_l); + return ret; +} + +EXPORT int my32_XGetWindowAttributes(x64emu_t* emu, void* dpy, XID window, my_XWindowAttributes_32_t* attr) +{ + static my_Screen_32_t screen32 = {0}; + my_XWindowAttributes_t l_attr = {0}; + int ret = my->XGetWindowAttributes(dpy, window, &l_attr); + convert_XWindowAttributes_to_32(dpy, attr, &l_attr); + if(ret) { + attr->screen = to_ptrv(&screen32); + convert_Screen_to_32(&screen32, l_attr.screen); + } + return ret; +} + +EXPORT int my32_XChangeProperty(x64emu_t* emu, void* dpy, XID window, XID prop, XID type, int fmt, int mode, void* data, int n) +{ + unsigned long data_l[10]; + void* tmp = NULL; + unsigned long* pdata_l = (unsigned long*)&data_l; + if(fmt==32) { + if(n>10) { + // there can be properties too big to fit on the stack + tmp = box_malloc(n*sizeof(unsigned long)); + pdata_l = tmp; + } + for(int i=0; iXChangeProperty(dpy, window, prop, type, fmt, mode, data, n); + if(tmp) + box_free(tmp); + return ret; +} + +EXPORT void my32_XSetWMProperties(x64emu_t* emu, void* dpy, XID window, void* window_name, void* icon_name, ptr_t* argv, int argc, void* normal_hints, my_XWMHints_32_t* wm_hints, ptr_t* class_hints) +{ + struct_pLiL_t window_name_l; + struct_pLiL_t icon_name_l; + int wm_size_l[17+2] = {0}; + my_XWMHints_t wm_hints_l = {0}; + char* class_hints_l[2] = {0}; + char* argv_l[argc+1]; + + if(window_name) + from_struct_pLiL(&window_name_l, to_ptrv(window_name)); + if(icon_name) + from_struct_pLiL(&icon_name_l, to_ptrv(icon_name)); + if(normal_hints) + convert_XSizeHints_to_64(&wm_size_l, normal_hints); + if(wm_hints) + convert_XWMints_to_64(&wm_hints_l, wm_hints); + if(class_hints) { + class_hints_l[0] = from_ptrv(class_hints[0]); + class_hints_l[1] = from_ptrv(class_hints[1]); + } + if(argv) { + memset(argv_l, 0, sizeof(argv_l)); + for(int i=0; iXSetWMProperties(dpy, window, window_name?(&window_name_l):NULL, icon_name?(&icon_name_l):NULL, argv?argv_l:NULL, argc, normal_hints?(&wm_size_l):NULL, wm_hints?(&wm_hints_l):NULL, class_hints?(&class_hints_l):NULL); +} + +EXPORT void my32_XSetWMSizeHints(x64emu_t* emu, void* dpy, XID window, void* hints, XID atom) +{ + int hints_l[17+2] = {0}; + convert_XSizeHints_to_64(&hints_l, hints); + my->XSetWMSizeHints(dpy, window, &hints_l, atom); +} + +EXPORT void my32_Xutf8SetWMProperties(x64emu_t* emu, void* dpy, XID window, void* window_name, void* icon_name, ptr_t* argv, int argc, void* normal_hints, my_XWMHints_32_t* wm_hints, ptr_t* class_hints) +{ + int wm_size_l[17+2] = {0}; + my_XWMHints_t wm_hints_l = {0}; + char* class_hints_l[2] = {0}; + char* argv_l[argc+1]; + + if(normal_hints) + convert_XSizeHints_to_64(&wm_size_l, normal_hints); + if(wm_hints) + convert_XWMints_to_64(&wm_hints_l, wm_hints); + if(class_hints) { + class_hints_l[0] = from_ptrv(class_hints[0]); + class_hints_l[1] = from_ptrv(class_hints[1]); + } + if(argv) { + memset(argv_l, 0, sizeof(argv_l)); + for(int i=0; iXutf8SetWMProperties(dpy, window, window_name, icon_name, argv?argv_l:NULL, argc, normal_hints?(&wm_size_l):NULL, wm_hints?(&wm_hints_l):NULL, class_hints?(&class_hints_l):NULL); +} + +EXPORT void my32_XmbSetWMProperties(x64emu_t* emu, void* dpy, XID window, void* window_name, void* icon_name, ptr_t* argv, int argc, void* normal_hints, my_XWMHints_32_t* wm_hints, ptr_t* class_hints) +{ + int wm_size_l[17+2] = {0}; + my_XWMHints_t wm_hints_l = {0}; + char* class_hints_l[2] = {0}; + char* argv_l[argc+1]; + + if(normal_hints) + convert_XSizeHints_to_64(&wm_size_l, normal_hints); + if(wm_hints) + convert_XWMints_to_64(&wm_hints_l, wm_hints); + if(class_hints) { + class_hints_l[0] = from_ptrv(class_hints[0]); + class_hints_l[1] = from_ptrv(class_hints[1]); + } + if(argv) { + memset(argv_l, 0, sizeof(argv_l)); + for(int i=0; iXmbSetWMProperties(dpy, window, window_name, icon_name, argv?argv_l:NULL, argc, normal_hints?(&wm_size_l):NULL, wm_hints?(&wm_hints_l):NULL, class_hints?(&class_hints_l):NULL); +} + + +EXPORT void* my32_XListExtensions(x64emu_t* emu, void* dpy, int* n) +{ + char** ret = my->XListExtensions(dpy, n); + if(!ret) return NULL; + ptr_t* ret_s = (ptr_t*)ret; + // shrinking + for(int i=0; i<*n; ++i) + ret_s[i] = to_ptrv(ret[i]); + ret_s[*n] = 0; + return ret; +} + +EXPORT int my32_XFreeExtensionList(x64emu_t* emu, ptr_t* list) +{ + // need to expand back the list + int n = 0; + //first grab n + while(list[n]) ++n; + // now expand, backward order + void** list_l = (void**)list; + for(int i=n-1; i>=0; --i) + list_l[i] = from_ptrv(list[i]); + return my->XFreeExtensionList(list); +} + +EXPORT int my32_XQueryTree(x64emu_t* emu, void* dpy, XID window, XID_32* root, XID_32* parent, ptr_t* children, uint32_t* n) +{ + XID root_l = 0; + XID parent_l = 0; + XID* children_l = NULL; + int ret = my->XQueryTree(dpy, window, &root_l, &parent_l, &children_l, n); + *root = to_ulong(root_l); + *parent = to_ulong(parent_l); + *children = to_ptrv(children_l); + if(children_l) + for(uint32_t i=0; i<*n; ++i) + ((XID_32*)children_l)[i] = to_ulong(children_l[i]); + return ret; +} + +EXPORT int my32_Xutf8TextPropertyToTextList(x64emu_t* emu, void* dpy, void* prop, ptr_t* list, int* count) +{ + void** list_l = NULL; + int ret = my->Xutf8TextPropertyToTextList(dpy, prop, &list_l, count); + if(list_l && *count) { + for(int i=0; i<*count; ++i) + ((ptr_t*)list_l)[i] = to_ptrv(list_l[i]); + } + // put end marker, for expansion + if(list_l) + ((ptr_t*)list_l)[*count] = 0; + *list = to_ptrv(list_l); + return ret; +} + +EXPORT int my32_XmbTextPropertyToTextList(x64emu_t* emu, void* dpy, void* prop, ptr_t* list, int* count) +{ + void** list_l = NULL; + int ret = my->XmbTextPropertyToTextList(dpy, prop, &list_l, count); + if(list_l && *count) { + for(int i=0; i<*count; ++i) + ((ptr_t*)list_l)[i] = to_ptrv(list_l[i]); + } + // put end marker, for expansion + if(list_l) + ((ptr_t*)list_l)[*count] = 0; + *list = to_ptrv(list_l); + return ret; +} + +EXPORT int my32_XwcTextPropertyToTextList(x64emu_t* emu, void* dpy, void* prop, ptr_t* list, int* count) +{ + void** list_l = NULL; + int ret = my->XwcTextPropertyToTextList(dpy, prop, &list_l, count); + if(list_l && *count) { + for(int i=0; i<*count; ++i) + ((ptr_t*)list_l)[i] = to_ptrv(list_l[i]); + } + // put end marker, for expansion + if(list_l) + ((ptr_t*)list_l)[*count] = 0; + *list = to_ptrv(list_l); + return ret; +} + +EXPORT void my32_XFreeStringList(x64emu_t* emu, ptr_t* list) +{ + // need to find size of list + int n = 0; + while(list[n]) ++n; + // inplace string list expand + for(int i=n-1; i>=0; --i) + ((void**)list)[i] = from_ptrv(list[i]); + + my->XFreeStringList(list); +} + +EXPORT void* my32_XListFonts(x64emu_t* emu, void* dpy, void* pat, int maxnames, int* count) +{ + void** ret = my->XListFonts(dpy, pat, maxnames, count); + if(ret && *count) { + for(int i=0; i<*count; ++i) + ((ptr_t*)ret)[i] = to_ptrv(ret[i]); + } + // put end marker, for expansion + if(ret) + ((ptr_t*)ret)[*count] = 0; + return ret; +} + +EXPORT void my32_XFreeFontNames(x64emu_t* emu, ptr_t* list) +{ + // need to find size of list + int n = 0; + while(list[n]) ++n; + // inplace string list expand + for(int i=n-1; i>=0; --i) + ((void**)list)[i] = from_ptrv(list[i]); + + my->XFreeFontNames(list); +} + +EXPORT int my32_XFreeColors(x64emu_t* emu, void* dpy, XID map, ulong_t* pixels, int npixels, unsigned long planes) +{ + unsigned long pixels_l[npixels]; + for(int i=0; iXFreeColors(dpy, map, pixels_l, npixels, planes); +} + +EXPORT void* my32_XGetModifierMapping(x64emu_t* emu, void* dpy) +{ + void *ret = my->XGetModifierMapping(dpy); + inplace_XModifierKeymap_shrink(ret); + return ret; +} + +EXPORT int my32_XFreeModifiermap(x64emu_t* emu, void* map) +{ + inplace_XModifierKeymap_enlarge(map); + return my->XFreeModifiermap(map); +} + +EXPORT int my32_XInternAtoms(x64emu_t* emu, void* dpy, ptr_t* names, int count, int only, XID_32* atoms) +{ + char* names_l[count]; + XID atoms_l[count]; + for(int i=0; iXInternAtoms(dpy, names_l, count, only, atoms_l); + for(int i=0; iXGetIMValues(xim, from_ptrv(b[n]), &r, NULL, NULL); + if(ret) + return ret; + b[n+1] = to_ptrv(r); + n+=2; + } + return NULL; +} + +EXPORT void* my32_XGetVisualInfo(x64emu_t* emu, void* dpy, long mask, my_XVisualInfo_32_t* template, int* n) +{ + my_XVisualInfo_t template_l = {0}; + if(template) convert_XVisualInfo_to_64_novisual(dpy, &template_l, template); + void* ret = my->XGetVisualInfo(dpy, mask, template?(&template_l):NULL, n); + if(ret) { + my_XVisualInfo_t* src = ret; + my_XVisualInfo_32_t* dst = ret; + for(int i=0; i<*n; ++i) + convert_XVisualInfo_to_32(dpy, &dst[i], &src[i]); + } + return ret; +} + +EXPORT XID my32_XVisualIDFromVisual(x64emu_t* emu, my_Visual_32_t* v) +{ + return from_ulong(v->visualid); +} + +EXPORT XID my32_XCreateColormap(x64emu_t* emu, void* dpy, XID w, my_Visual_32_t* v, int alloc) +{ + return my->XCreateColormap(dpy, w, convert_Visual_to_64(dpy, v), alloc); +} + +EXPORT int my32_XQueryColors(x64emu_t* emu, void* dpy, XID map, my_XColor_32_t* defs, int ncolor) +{ + struct_LWWWcc_t defs_l[ncolor]; + for(int i=0; iXQueryColors(dpy, map, defs_l, ncolor); + for(int i=0; iXStoreColors(dpy, map, defs_l, ncolor); + for(int i=0; iXFreeFont(dpy, f); +} + +EXPORT void* my32_XCreateFontSet(x64emu_t* emu, void* dpy, void* name, ptr_t* missing, int* missing_count, ptr_t* string) +{ + void** missing_l = NULL; + void* string_l = NULL; + void* ret = my->XCreateFontSet(dpy, name, &missing_l, missing_count, string?(&string_l):NULL); + if(string) *string = to_ptrv(string_l); + // inplace string list shrink + *missing = to_ptrv(missing_l); + if(missing_l && *missing_count) { + for(int i=0; i<*missing_count; ++i) + ((ptr_t*)missing_l)[i] = to_ptrv(missing_l[i]); + } + // put end marker, for expansion + if(missing_l) + ((ptr_t*)missing_l)[*missing_count] = 0; + my_XFontSet_32_t* set = box32_calloc(1, sizeof(my_XFontSet_32_t)); + set->fontset = ret; + return set; +} + +EXPORT int my32_XFontsOfFontSet(x64emu_t* emu, my_XFontSet_32_t* set, ptr_t* fonts_ret, ptr_t* names_ret) +{ + void* fonts_ret_l = NULL; + void* names_ret_l = NULL; + int ret = my->XFontsOfFontSet(set->fontset, fonts_ret?(&fonts_ret_l):NULL, names_ret?(&names_ret_l):NULL); + if(ret<=0) + return ret; + if(names_ret) { + int j = set->names_size++; + set->names = box32_realloc(set->names, sizeof(ptr_t*)*set->names_size); + set->names[j] = box32_malloc(sizeof(ptr_t)*ret); + for(int i=0; inames[j][i] = to_ptrv(((void**)names_ret_l)[i]); + *names_ret = to_ptrv(set->names[j]); + } + if(fonts_ret) { + int j = set->fonts_size++; + set->fonts = box32_realloc(set->fonts, sizeof(ptr_t*)*set->fonts_size); + set->fonts[j] = box32_malloc(sizeof(ptr_t)*ret); + for(int i=0; ifonts[j][i] = to_ptrv(((void**)fonts_ret_l)[i]); + *fonts_ret = to_ptrv(set->fonts[j]); + } + return ret; +} + +EXPORT void* my32_XExtentsOfFontSet(x64emu_t* emu, my_XFontSet_32_t* set) +{ + return my->XExtentsOfFontSet(set->fontset); +} + +EXPORT void* my32_XLocaleOfFontSet(x64emu_t* emu, my_XFontSet_32_t* set) +{ + return my->XLocaleOfFontSet(set->fontset); +} + +EXPORT void* my32_XBaseFontNameListOfFontSet(x64emu_t* emu, my_XFontSet_32_t* set) +{ + return my->XBaseFontNameListOfFontSet(set->fontset); +} + +EXPORT int my32_XContextDependentDrawing(x64emu_t* emu, my_XFontSet_32_t* set) +{ + return my->XContextDependentDrawing(set->fontset); +} + +EXPORT int my32_XDirectionalDependentDrawing(x64emu_t* emu, my_XFontSet_32_t* set) +{ + return my->XDirectionalDependentDrawing(set->fontset); +} + +EXPORT int my32_XContextualDrawing(x64emu_t* emu, my_XFontSet_32_t* set) +{ + return my->XContextualDrawing(set->fontset); +} + +EXPORT int my32_XmbTextEscapement(x64emu_t* emu, my_XFontSet_32_t* set, void* text, int sz) +{ + return my->XmbTextEscapement(set->fontset, text, sz); +} + +EXPORT int my32_XwcTextEscapement(x64emu_t* emu, my_XFontSet_32_t* set, void* text, int sz) +{ + return my->XwcTextEscapement(set->fontset, text, sz); +} + +EXPORT int my32_Xutf8TextEscapement(x64emu_t* emu, my_XFontSet_32_t* set, void* text, int sz) +{ + return my->Xutf8TextEscapement(set->fontset, text, sz); +} + +EXPORT int my32_XmbTextExtents(x64emu_t* emu, my_XFontSet_32_t* set, void* text, int sz, void* ink, void* log) +{ + return my->XmbTextExtents(set->fontset, text, sz, ink, log); +} + +EXPORT int my32_XwcTextExtents(x64emu_t* emu, my_XFontSet_32_t* set, void* text, int sz, void* ink, void* log) +{ + return my->XwcTextExtents(set->fontset, text, sz, ink, log); +} + +EXPORT int my32_Xutf8TextExtents(x64emu_t* emu, my_XFontSet_32_t* set, void* text, int sz, void* ink, void* log) +{ + return my->Xutf8TextExtents(set->fontset, text, sz, ink, log); +} + +EXPORT int my32_XmbTextPerCharExtents(x64emu_t* emu, my_XFontSet_32_t* set, void* text, int sz, void* ink, void* log, int buff_sz, void* buff, void* ink_ret, void* log_ret) +{ + return my->XmbTextPerCharExtents(set->fontset, text, sz, ink, log, buff_sz, buff, ink_ret, log_ret); +} + +EXPORT int my32_XwcTextPerCharExtents(x64emu_t* emu, my_XFontSet_32_t* set, void* text, int sz, void* ink, void* log, int buff_sz, void* buff, void* ink_ret, void* log_ret) +{ + return my->XwcTextPerCharExtents(set->fontset, text, sz, ink, log, buff_sz, buff, ink_ret, log_ret); +} + +EXPORT int my32_Xutf8TextPerCharExtents(x64emu_t* emu, my_XFontSet_32_t* set, void* text, int sz, void* ink, void* log, int buff_sz, void* buff, void* ink_ret, void* log_ret) +{ + return my->Xutf8TextPerCharExtents(set->fontset, text, sz, ink, log, buff_sz, buff, ink_ret, log_ret); +} + +EXPORT void my32_XmbDrawString(x64emu_t* emu, void* dpy, XID d, my_XFontSet_32_t* set, void* gc, int x, int y, void* text, int sz) +{ + my->XmbDrawString(dpy, d, set->fontset, gc, x, y, text, sz); +} + +EXPORT void my32_XwcDrawString(x64emu_t* emu, void* dpy, XID d, my_XFontSet_32_t* set, void* gc, int x, int y, void* text, int sz) +{ + my->XwcDrawString(dpy, d, set->fontset, gc, x, y, text, sz); +} + +EXPORT void my32_Xutf8DrawString(x64emu_t* emu, void* dpy, XID d, my_XFontSet_32_t* set, void* gc, int x, int y, void* text, int sz) +{ + my->Xutf8DrawString(dpy, d, set->fontset, gc, x, y, text, sz); +} + +EXPORT void my32_XmbDrawImageString(x64emu_t* emu, void* dpy, XID d, my_XFontSet_32_t* set, void* gc, int x, int y, void* text, int sz) +{ + my->XmbDrawImageString(dpy, d, set->fontset, gc, x, y, text, sz); +} + +EXPORT void my32_XwcDrawImageString(x64emu_t* emu, void* dpy, XID d, my_XFontSet_32_t* set, void* gc, int x, int y, void* text, int sz) +{ + my->XwcDrawImageString(dpy, d, set->fontset, gc, x, y, text, sz); +} + +EXPORT void my32_Xutf8DrawImageString(x64emu_t* emu, void* dpy, XID d, my_XFontSet_32_t* set, void* gc, int x, int y, void* text, int sz) +{ + my->Xutf8DrawImageString(dpy, d, set->fontset, gc, x, y, text, sz); +} + +EXPORT void my32_XmbDrawText(x64emu_t* emu, void* dpy, XID d, void* gc, int x, int y, my_XmbTextItem_32_t* text, int sz) +{ + my_XmbTextItem_t text_l = {0}; + text_l.chars = from_ptrv(text->chars); + text_l.nchars = text->nchars; + text_l.delta = text->delta; + text_l.font_set = ((my_XFontSet_32_t*)from_ptrv(text->font_set))->fontset; + my->XmbDrawText(dpy, d, gc, x, y, &text_l, sz); +} + +EXPORT void my32_XwcDrawText(x64emu_t* emu, void* dpy, XID d, void* gc, int x, int y, my_XwcTextItem_32_t* text, int sz) +{ + my_XwcTextItem_t text_l = {0}; + text_l.chars = from_ptrv(text->chars); + text_l.nchars = text->nchars; + text_l.delta = text->delta; + text_l.font_set = ((my_XFontSet_32_t*)from_ptrv(text->font_set))->fontset; + my->XwcDrawText(dpy, d, gc, x, y, &text_l, sz); +} + +EXPORT void my32_Xutf8DrawText(x64emu_t* emu, void* dpy, XID d, void* gc, int x, int y, my_XmbTextItem_32_t* text, int sz) +{ + my_XmbTextItem_t text_l = {0}; + text_l.chars = from_ptrv(text->chars); + text_l.nchars = text->nchars; + text_l.delta = text->delta; + text_l.font_set = ((my_XFontSet_32_t*)from_ptrv(text->font_set))->fontset; + my->Xutf8DrawText(dpy, d, gc, x, y, &text_l, sz); +} + +EXPORT void my32_XFreeFontSet(x64emu_t* emu,void* dpy, my_XFontSet_32_t* set) +{ + my->XFreeFontSet(dpy, set->fontset); + for(int i=0; inames_size; ++i) + box32_free(set->names[i]); + box32_free(set->names); + for(int i=0; ifonts_size; ++i) + box32_free(set->names[i]); + box32_free(set->fonts); + box32_free(set); +} + +EXPORT int my32_XChangeWindowAttributes(x64emu_t* emu, void* dpy, XID window, unsigned long mask, my_XSetWindowAttributes_32_t* attrs) +{ + my_XSetWindowAttributes_t attrs_l[1]; + convert_XSetWindowAttributes_to_64(attrs_l, attrs); + return my->XChangeWindowAttributes(dpy, window, mask, attrs_l); +} + +EXPORT int my32_XGetWindowProperty(x64emu_t* emu, void* dpy, XID window, XID prop, long offset, long length, int delete, XID req, XID_32* type_return, int* fmt_return, ulong_t* nitems_return, ulong_t* bytes, ptr_t*prop_return) +{ + unsigned long nitems_l = 0, bytes_l = 0, type_return_l = 0; + void* prop_l = NULL; + int ret = my->XGetWindowProperty(dpy, window, prop, offset, length, delete, req, &type_return_l, fmt_return, &nitems_l, &bytes_l, &prop_l); + *nitems_return = to_ulong(nitems_l); + *bytes = to_ulong(bytes_l); + *prop_return = to_ptrv(prop_l); + *type_return = to_ulong(type_return_l); + if(!ret && *fmt_return==32) { + // inplace shrink + unsigned long *src = prop_l; + ulong_t* dst = prop_l; + for(ulong_t i=0; i<*nitems_return; ++i) + dst[i] = to_ulong_silent(src[i]); + } + return ret; +} + +EXPORT int my32_XTextExtents(x64emu_t* emu, my_XFontStruct_32_t* font_struct, void* string, int nchars, int* dir, int* ascent, int* descent, my_XCharStruct_32_t* overall) +{ + //XCharStruct doesn't need any changes + inplace_XFontStruct_enlarge(font_struct); + int ret = my->XTextExtents(font_struct, string, nchars, dir, ascent, descent, overall); + inplace_XFontStruct_shrink(font_struct); + return ret; +} + +EXPORT int my32_XTextExtents16(x64emu_t* emu, my_XFontStruct_32_t* font_struct, void* string, int nchars, int* dir, int* ascent, int* descent, my_XCharStruct_32_t* overall) +{ + //XCharStruct doesn't need any changes + inplace_XFontStruct_enlarge(font_struct); + int ret = my->XTextExtents16(font_struct, string, nchars, dir, ascent, descent, overall); + inplace_XFontStruct_shrink(font_struct); + return ret; +} + +EXPORT void* my32_XLoadQueryFont(x64emu_t* emu, void* dpy, void* name) +{ + void* ret = my->XLoadQueryFont(dpy, name); + inplace_XFontStruct_shrink(ret); + return ret; +} + +EXPORT void* my32_XQueryFont(x64emu_t* emu, void* dpy, size_t id) +{ + void* ret = my->XQueryFont(dpy, id); + inplace_XFontStruct_shrink(ret); + return ret; +} + +EXPORT int my32_XFreeFontInfo(x64emu_t* emu, ptr_t* names, void* free_info, int count) +{ + inplace_XFontStruct_enlarge(free_info); + void** names_l = (void**)names; + if(names) { + for(int i=count-1; i>=0; --i) + ((void**)names)[i] = from_ptrv(names[i]); + } + return my->XFreeFontInfo(names_l, free_info, count); +} + +EXPORT int my32_XTextWidth(x64emu_t* emu, void* font, void* string, int count) +{ + inplace_XFontStruct_enlarge(font); + int ret = my->XTextWidth(font, string, count); + inplace_XFontProp_shrink(font); + return ret; +} + +EXPORT int my32_XTextWidth16(x64emu_t* emu, void* font, void* string, int count) +{ + inplace_XFontStruct_enlarge(font); + int ret = my->XTextWidth16(font, string, count); + inplace_XFontProp_shrink(font); + return ret; +} + +EXPORT void my32_XLockDisplay(x64emu_t* emu, void* dpy) +{ + my->XLockDisplay(dpy); + // update some of the values now that the screen is locked + refreshDisplay(dpy); +} + +EXPORT int my32_XGrabServer(x64emu_t* emu, void* dpy) +{ + int ret = my->XGrabServer(dpy); + // update some of the values now that the server is grabbed + refreshDisplay(dpy); + return ret; +} + +EXPORT void* my32_XkbGetMap(x64emu_t* emu, void* dpy, uint32_t which, uint32_t dev) +{ + return inplace_XkbDescRec_shrink(my->XkbGetMap(dpy, which, dev)); +} +EXPORT int my32_XkbGetNames(x64emu_t* emu, void* dpy, uint32_t which, my_XkbDescRec_32_t* ptr) +{ + inplace_XkbDescRec_enlarge(ptr); + int ret = my->XkbGetNames(dpy, which, ptr); + inplace_XkbDescRec_shrink(ptr); + return ret; +} +EXPORT int my32_XkbGetUpdatedMap(x64emu_t* emu, void* dpy, uint32_t which, my_XkbDescRec_32_t* ptr) +{ + inplace_XkbDescRec_enlarge(ptr); + int ret = my->XkbGetUpdatedMap(dpy, which, ptr); + inplace_XkbDescRec_shrink(ptr); + return ret; +} + +EXPORT int my32_XkbGetControls(x64emu_t* emu, void* dpy, int which, my_XkbDescRec_32_t* ptr) +{ + inplace_XkbDescRec_enlarge(ptr); + int ret = my->XkbGetControls(dpy, which, ptr); + inplace_XkbDescRec_shrink(ptr); + return ret; +} + +EXPORT void my32_XkbFreeKeyboard(x64emu_t* emu, void* xkb, int which, int all) +{ + my->XkbFreeKeyboard(inplace_XkbDescRec_enlarge(xkb), which, all); +} + +EXPORT void* my32_XGetMotionEvents(x64emu_t* emu, void* dpy, XID w, unsigned long start, unsigned long stop, int* n) +{ + void* ret = my->XGetMotionEvents(dpy, w, start, stop, n); + if(ret) { + my_XTimeCoord_t *src = ret; + my_XTimeCoord_32_t* dst = ret; + for(int i=0; i<*n; ++i) { + dst[i].time = to_ulong(src[i].time); + dst[i].x = src[i].x; + dst[i].y = src[i].y; + } + } + return ret; +} + +EXPORT int my32_XGetWMColormapWindows(x64emu_t* emu, void* dpy, XID w, ptr_t* maps, int* n) +{ + void* maps_l = NULL; + int ret = my->XGetWMColormapWindows(dpy, w, &maps_l, n); + *maps = to_ptrv(maps_l); + XID* src = maps_l; + XID_32* dst = maps_l; + for(int i=0; i<*n; ++i) { + dst[i] = to_ulong(src[i]); + } + return ret; +} + +EXPORT int my32_XScreenNumberOfScreen(x64emu_t* emu, void* s) +{ + my_Screen_32_t* screen = s; + void* dpy = getDisplay(from_ptrv(screen->display)); + return my->XScreenNumberOfScreen(getScreen64(dpy, s)); +} + +EXPORT int my32__XReply(x64emu_t* emu, void* dpy, void* rep, int extra, int discard) +{ + int ret = my->_XReply(dpy, rep, extra, discard); + printf_log(LOG_DEBUG, " (reply type:%hhu, length:32+%u) ", *(uint8_t*)rep, ((uint32_t*)rep)[1]); + return ret; +} + +EXPORT void* my32_XGetICValues(x64emu_t* emu, void* ic, ptr_t* V) +{ + void* ret = NULL; + while(!ret && *V) { + char* name = from_ptrv(V[0]); + void* val = from_ptrv(V[1]); + V+=2; + if(!strcmp(name, "filterEvents")) { + unsigned long fevent; + ret = my->XGetICValues(ic, name, &fevent, NULL); + // I got a value of 0xFFFF00000003, but this seems to be a valid + // value of KeyPressMask | KeyReleaseMask, so just silently truncate + if(!ret) *(ulong_t*)val = to_ulong_silent(fevent); + } else { + printf_log_prefix(2, LOG_INFO, "Warning, unknown XGetICValues of %s\n", name); + ret = my->XGetICValues(ic, name, val, NULL); + } + } + return ret; +} + +#define CUSTOM_INIT \ + AddAutomaticBridge(lib->w.bridge, vFp_32, *(void**)dlsym(lib->w.lib, "_XLockMutex_fn"), 0, "_XLockMutex_fn"); \ + AddAutomaticBridge(lib->w.bridge, vFp_32, *(void**)dlsym(lib->w.lib, "_XUnlockMutex_fn"), 0, "_XUnlockMutex_fn"); \ + if(BOX64ENV(x11threads)) my->XInitThreads(); \ + my_context->libx11 = lib; + +#define CUSTOM_FINI \ + unregister_Xkb_events(); \ + my_context->libx11 = NULL; +#if 0 +#ifdef ANDROID +#define NEEDED_LIBS "libxcb.so" +#else +#define NEEDED_LIBS "libxcb.so.1" +#endif +#endif + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibx11_private.h b/src/wrapped32/wrappedlibx11_private.h new file mode 100644 index 0000000..d5f8801 --- /dev/null +++ b/src/wrapped32/wrappedlibx11_private.h @@ -0,0 +1,1247 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//XColor is a struct: LWWWcc +//XTextProperty is a struct: pLiL + +DATAB(_qfree, 4) // Warning: failed to confirm + +GO(XActivateScreenSaver, iFX) +GOM(XAddConnectionWatch, iFEXpp) +GO(XAddExtension, pFX) +GO(XAddHost, iFXbiip_) +GO(XAddHosts, iFXbiip_i) +GO(XAddPixel, vFpl) +//GOM(XAddToExtensionList, iFEbp_p) +GO(XAddToSaveSet, iFXL) +GO(XAllocClassHint, pFv) +GO(XAllocColor, iFXLbLWWWcc_) +GO(XAllocColorCells, iFXLibL_ubL_u) +GO(XAllocColorPlanes, iFXLibL_iiiibL_bL_bL_) +GO(XAllocIconSize, pFv) +GO(_XAllocID, LFX) +GO(_XAllocIDs, vFXbL_i) +GO(XAllocNamedColor, iFXLpbLWWWcc_bLWWWcc_) +GO(_XAllocScratch, pFXL) +GO(XAllocSizeHints, pFv)//GOS(XAllocSizeHints, bliiiiiiiiiippiii_Fv) +//GO(XAllocStandardColormap, bLLLLLLLLLL_Fv) +GO(_XAllocTemp, pFXL) +GO(XAllocWMHints, pFv)//GO(XAllocWMHints, bliiLLiiLL_Fv) +GO(XAllowEvents, iFXiL) +GO(XAllPlanes, LFv) +//GO(_XAsyncErrorHandler, iFpppip) +GO(XAutoRepeatOff, iFX) +GO(XAutoRepeatOn, iFX) +GOM(XBaseFontNameListOfFontSet, pFEp) +GO(XBell, iFXi) +GO(XBitmapBitOrder, iFX) +GO(XBitmapPad, iFX) +GO(XBitmapUnit, iFX) +GO(XBlackPixel, LFXi) +//GOM(XBlackPixelOfScreen, LFEbpXLiiiiipippLLLiiiil_) +//GOM(XCellsOfScreen, iFEbpXLiiiiipippLLLiiiil_) +GO(XChangeActivePointerGrab, iFXuLL) +GO(XChangeGC, iFXpLriLLLiiiiiiiLLiiLiiiiLic_) +GO(XChangeKeyboardControl, iFXLp) +GO(XChangeKeyboardMapping, iFXiibL_i) +GO(XChangePointerControl, iFXiiiii) +GOM(XChangeProperty, iFEXLLLiipi) +GO(XChangeSaveSet, iFXLi) +GOM(XChangeWindowAttributes, iFEXLLp) +GOM(XCheckIfEvent, iFEXppp) +GOM(XCheckMaskEvent, iFEXlp) +GOM(XCheckTypedEvent, iFEXip) +GOM(XCheckTypedWindowEvent, iFEXLip) +GOM(XCheckWindowEvent, iFEXLlp) +GO(XCirculateSubwindows, iFXLi) +GO(XCirculateSubwindowsDown, iFXL) +GO(XCirculateSubwindowsUp, iFXL) +GO(XClearArea, iFXLiiuui) +GO(XClearWindow, iFXL) +GO(XClipBox, iFpp) +GOM(XCloseDisplay, iFEX) +GO(XCloseIM, iFp) +//GO(_XCloseLC, +GO(XCloseOM, iFp) +//GO(_XcmsAddCmapRec, +//GOM(XcmsAddColorSpace, iFEbpLpbp_bp_i_) +//GOM(XcmsAddFunctionSet, iFEbbbpLpbp_bp_i__pp_) +//GO(XcmsAllocColor, iFpLpL) +//GO(XcmsAllocNamedColor, iFpLpppL) +//GO(_XcmsArcTangent, +//GOM(XcmsCCCOfColormap, pFEXL) +//GOM(XcmsCIELabClipab, iFEppuup) +//GOM(XcmsCIELabClipL, iFEppuup) +//GOM(XcmsCIELabClipLab, iFEppuup) +//DATA(XcmsCIELabColorSpace, 6*4) +//DATA(_XcmsCIELab_prefix, +//GOM(XcmsCIELabQueryMaxC, iFEpddp) +//GOM(XcmsCIELabQueryMaxL, iFEpddp) +//GOM(XcmsCIELabQueryMaxLC, iFEpdp) +//GO(_XcmsCIELabQueryMaxLCRGB, +//GOM(XcmsCIELabQueryMinL, iFEpddp) +//GOM(XcmsCIELabToCIEXYZ, iFEpppu) +//GOM(XcmsCIELabWhiteShiftColors, iFEpppLpup) +//GOM(XcmsCIELuvClipL, iFEppuup) +//GOM(XcmsCIELuvClipLuv, iFEppuup) +//GOM(XcmsCIELuvClipuv, iFEppuup) +//DATA(XcmsCIELuvColorSpace, 6*4) +//DATA(_XcmsCIELuv_prefix, +//GOM(XcmsCIELuvQueryMaxC, iFEpddp) +//GOM(XcmsCIELuvQueryMaxL, iFEpddp) +//GOM(XcmsCIELuvQueryMaxLC, iFEpdp) +//GO(_XcmsCIELuvQueryMaxLCRGB, +//GOM(XcmsCIELuvQueryMinL, iFEpddp) +//GOM(XcmsCIELuvToCIEuvY, iFEpppu) +//GOM(XcmsCIELuvWhiteShiftColors, iFEpppLpup) +//DATA(XcmsCIEuvYColorSpace, 6*4) +//DATA(_XcmsCIEuvY_prefix, +//GOM(XcmsCIEuvYToCIELuv, iFEpppu) +//GOM(XcmsCIEuvYToCIEXYZ, iFEpppu) +//GOM(XcmsCIEuvYToTekHVC, iFEpppu) +//GO(_XcmsCIEuvY_ValidSpec, +//DATA(XcmsCIExyYColorSpace, 6*4) // probably need some wrapping +//DATA(_XcmsCIExyY_prefix, +//GOM(XcmsCIExyYToCIEXYZ, iFEpppu) +//DATA(XcmsCIEXYZColorSpace, 24) +//DATA(_XcmsCIEXYZ_prefix, +//GOM(XcmsCIEXYZToCIELab, iFEpppu) +//GOM(XcmsCIEXYZToCIEuvY, iFEpppu) +//GOM(XcmsCIEXYZToCIExyY, iFEpppu) +//GOM(XcmsCIEXYZToRGBi, iFEppup) +//GO(_XcmsCIEXYZ_ValidSpec, +//GOSM(XcmsClientWhitePointOfCCC, bpLL_FEp) +//GOM(XcmsConvertColors, iFEppuLp) +//GO(_XcmsConvertColorsWithWhitePt, +//GO(_XcmsCopyCmapRecAndFree, +//GO(_XcmsCopyISOLatin1Lowered, +//GO(_XcmsCopyPointerArray, +//GO(_XcmsCosine, +//GOM(XcmsCreateCCC, pFEpipppppp) +//GO(_XcmsCubeRoot, +//DATA(_XcmsDDColorSpaces, 6*4) +//DATA(_XcmsDDColorSpacesInit, 6*4) +//GO(_XcmsDDConvertColors, +//GOM(XcmsDefaultCCC, pFEXi) +//GO(_XcmsDeleteCmapRec, +//DATA(_XcmsDIColorSpaces, 6*4) +//DATA(_XcmsDIColorSpacesInit, 6*4) +//GO(_XcmsDIConvertColors, +//GOM(XcmsDisplayOfCCC, XFEp) +//GO(_XcmsEqualWhitePts, +GO(XcmsFormatOfPrefix, LFp) +GO(XcmsFreeCCC, vFp) +//GO(_XcmsFreeIntensityMaps, +//GO(_XcmsFreePointerArray, +//GO(_XcmsGetElement, +//GO(_XcmsGetIntensityMap, +//GO(_XcmsGetProperty, +//GO(_XcmsInitDefaultCCCs, +//GO(_XcmsInitScrnInfo, +//DATA(XcmsLinearRGBFunctionSet, 3*4) // probably needs some wrapping +//GO(XcmsLookupColor, iFpLpppL) +//GO(_XcmsLRGB_InitScrnDefault, +GO(XcmsPrefixOfFormat, pFL) +//GO(_XcmsPushPointerArray, +//GOM(XcmsQueryBlack, iFEpLp) +//GOM(XcmsQueryBlue, iFEpLp) +//GO(XcmsQueryColor, iFpLpL) +//GO(XcmsQueryColors, iFpLpuL) +//GOM(XcmsQueryGreen, iFEpLp) +//GOM(XcmsQueryRed, iFEpLp) +//GOM(XcmsQueryWhite, iFEpLp) +//DATA(_XcmsRegColorSpaces, 6*4) +//GO(_XcmsRegFormatOfPrefix, +//GO(_XcmsResolveColor, +//GO(_XcmsResolveColorString, +//DATA(XcmsRGBColorSpace, 6*4) +//DATA(XcmsRGBiColorSpace, 6*4) +//DATA(_XcmsRGBi_prefix, +//GOM(XcmsRGBiToCIEXYZ, iFEppup) +//GOM(XcmsRGBiToRGB, iFEppup) +//DATA(_XcmsRGB_prefix, +//GOM(XcmsRGBToRGBi, iFEppup) +//GO(_XcmsRGB_to_XColor, +//DATA(_XcmsSCCFuncSets, 3*4) +//DATA(_XcmsSCCFuncSetsInit, 3*4) +//GOM(XcmsScreenNumberOfCCC, iFEp) +//GOSM(XcmsScreenWhitePointOfCCC, bpLL_FEp) +//GOM(XcmsSetCCCOfColormap, pFEXLp) +//GOM(XcmsSetCompressionProc, pFEppp) +//GO(_XcmsSetGetColor, +//GO(_XcmsSetGetColors, +//GOM(XcmsSetWhiteAdjustProc, pFEppp) +//GOM(XcmsSetWhitePoint, iFEpp) +//GO(_XcmsSine, +//GO(_XcmsSquareRoot, +//GO(XcmsStoreColor, iFpLp) +//GO(XcmsStoreColors, iFpLpup) +//GO(_XcmsTekHVC_CheckModify, +//GOM(XcmsTekHVCClipC, iFEppuup) +//GOM(XcmsTekHVCClipV, iFEppuup) +//GOM(XcmsTekHVCClipVC, iFEppuup) +//DATA(XcmsTekHVCColorSpace, 6*4) +//DATA(_XcmsTekHVC_prefix, +//GOM(XcmsTekHVCQueryMaxC, iFEpddp) +//GOM(XcmsTekHVCQueryMaxV, iFEpddp) +//GOM(XcmsTekHVCQueryMaxVC, iFEpdp) +//GO(_XcmsTekHVCQueryMaxVCRGB, +//GOM(XcmsTekHVCQueryMaxVSamples, iFEpdpu) +//GOM(XcmsTekHVCQueryMinV, iFEpddp) +//GOM(XcmsTekHVCToCIEuvY, iFEpppu) +//GOM(XcmsTekHVCWhiteShiftColors, iFEpppLpup) +//DATA(XcmsUNDEFINEDColorSpace, 6*4) +//GO(_XcmsUnresolveColor, +//GOM(XcmsVisualOfCCC, pFEp) +//GO(_XColor_to_XcmsRGB, +GO(XConfigureWindow, iFXLuriiiiiLi_) +GO(XConnectionNumber, iFX) +//GO(_XConnectXCB, +GOM(XContextDependentDrawing, iFEp) +GOM(XContextualDrawing, iFEp) +GO(XConvertCase, vFLbL_bL_) +GO(XConvertSelection, iFXLLLLL) +GO(XCopyArea, iFXLLpiiuuii) +GO(XCopyColormapAndFree, LFXL) +//GO(_XCopyEventCookie, iFXbiLiXiiup_biLiXiiup_) +GO(XCopyGC, iFXpLp) +GO(XCopyPlane, iFXLLpiiuuiiL) +//GO(_XCopyToArg, +GO(XCreateBitmapFromData, LFXLpuu) +GOM(XCreateColormap, LFEXLpi) +GO(XCreateFontCursor, LFXu) +GOM(XCreateFontSet, pFEXpppp) +GO(XCreateGC, pFXLLbiLLLiiiiiiiLLiiLiiiiLic_) +GO(XCreateGlyphCursor, LFXLLuubLWWWcc_bLWWWcc_) +GOM(XCreateIC, pFEpV) +GOM(XCreateImage, pFEXpuiipuuii) +GO(dummy_XCreateImage, pFXpuiipuuii) // Warning: failed to confirm +//DATAB(_XCreateMutex_fn, 4) +//GO(XCreateOC, pFppppppppppppppppppp) // is pFpV +GO(XCreatePixmap, LFXLuuu) +GO(XCreatePixmapCursor, LFXLLbLWWWcc_bLWWWcc_uu) +GO(XCreatePixmapFromBitmapData, LFXLpuuLLu) +GO(XCreateRegion, pFv) +GO(XCreateSimpleWindow, LFXLiiuuuLL) +GOM(XCreateWindow, LFEXLiiuuuiupLp) +//DATAB(_Xdebug, 4) +GO(XDefaultColormap, LFXi) +//GOM(XDefaultColormapOfScreen, LFEbpXLiiiiipippLLLiiiil_) +GO(XDefaultDepth, iFXi) +//GOM(XDefaultDepthOfScreen, iFEbpXLiiiiipippLLLiiiil_) +//GOM(_XDefaultError, iFEXbiXLLCCC_) +GO(XDefaultGC, pFXi) +//GOM(XDefaultGCOfScreen, pFEbpXLiiiiipippLLLiiiil_) +GO(_XDefaultIOError, iFX) +GO(_XDefaultIOErrorExit, vFXp) +//GO(_XDefaultOpenIM, +//GO(_XDefaultOpenOM, +GO(XDefaultRootWindow, LFX) +GO(XDefaultScreen, iFX) +//GOM(XDefaultScreenOfDisplay, bpXLiiiiipippLLLiiiil_FEX) +GO(XDefaultString, pFv) +GO(XDefaultVisual, pFXi) +//GOM(XDefaultVisualOfScreen, pFEbpXLiiiiipippLLLiiiil_) +//GO(_XDefaultWireError, iFppp) +GO(XDefineCursor, iFXLL) +GO(XDeleteContext, iFXLi) +//GO(XDeleteModifiermapEntry, bip_Fbip_Ci) +GO(XDeleteProperty, iFXLL) +//GOM(_XDeq, vFEXpp) +GOM(_XDeqAsyncHandler, vFEXp) +GO(XDestroyIC, vFp) +GOM(XDestroyImage, iFEp) //need to unbridge +GO(XDestroyOC, vFp) +GO(XDestroyRegion, iFp) +GO(XDestroySubwindows, iFXL) +GO(XDestroyWindow, iFXL) +GOM(XDirectionalDependentDrawing, iFEp) +GO(XDisableAccessControl, iFX) +GO(XDisplayCells, iFXi) +GO(XDisplayHeight, iFXi) +GO(XDisplayHeightMM, iFXi) +GO(XDisplayKeycodes, iFXpp) +GO(XDisplayMotionBufferSize, LFX) +GO(XDisplayName, tFp) +GO(XDisplayOfIM, XFp) +GO(XDisplayOfOM, XFp) +//GOM(XDisplayOfScreen, XFEbpXLiiiiipippLLLiiiil_) +GO(XDisplayPlanes, iFXi) +GO(XDisplayString, pFX) +GO(XDisplayWidth, iFXi) +GO(XDisplayWidthMM, iFXi) +//GOM(XDoesBackingStore, iFEbpXLiiiiipippLLLiiiil_) +//GOM(XDoesSaveUnders, iFEbpXLiiiiipippLLLiiiil_) +GO(XDrawArc, iFXLpiiuuii) +GO(XDrawArcs, iFXLppi) +GO(XDrawImageString, iFXLpiipi) +GO(XDrawImageString16, iFXLpiipi) +GO(XDrawLine, iFXLpiiii) +GO(XDrawLines, iFXLppii) +GO(XDrawPoint, iFXLpii) +GO(XDrawPoints, iFXLppii) +GO(XDrawRectangle, iFXLpiiuu) +GO(XDrawRectangles, iFXLppi) +GO(XDrawSegments, iFXLppi) +GO(XDrawString, iFXLpiipi) +GO(XDrawString16, iFXLpiipi) +GO(XDrawText, iFXLpiibpiiL_i) +GO(XDrawText16, iFXLpiibpiiL_i) +GO(_XEatData, vFXL) +GO(_XEatDataWords, vFXL) +//GO(XEHeadOfExtensionList, +GO(XEmptyRegion, iFp) +GO(XEnableAccessControl, iFX) +//GO(_XEnq, vFpp) +GO(XEqualRegion, iFpp) +//GO(_XError, iFpp) +//DATAM(_XErrorFunction, 4) +//GOM(XESetBeforeFlush, pFEXip) +GOM(XESetCloseDisplay, pFEXip) +//GOM(XESetCopyEventCookie, pFEXip) +//GOM(XESetCopyGC, pFEXip) +//GOM(XESetCreateFont, pFEXip) +//GOM(XESetCreateGC, pFEXip) +//GOM(XESetError, pFEXip) +//GOM(XESetErrorString, pFEXip) +GOM(XESetEventToWire, pFEXip) +//GOM(XESetFlushGC, pFEXip) +//GOM(XESetFreeFont, pFEXip) +//GOM(XESetFreeGC, pFEXip) +//GOM(XESetPrintErrorValues, pFEXip) +//GOM(XESetWireToError, pFEXip) +GOM(XESetWireToEvent, pFEXip) +//GOM(XESetWireToEventCookie, pFEXip) +//GOM(XEventMaskOfScreen, lFEbpXLiiiiipippLLLiiiil_) +GO(_XEventsQueued, iFXi) +GO(XEventsQueued, iFXi) +//DATA(_Xevent_to_mask, +//GO(_XEventToWire, iFppp) +GO(XExtendedMaxRequestSize, lFX) +GOM(XExtentsOfFontSet, pFEp) +//GO(_XF86BigfontFreeFontMetrics, +//GO(_XF86LoadQueryLocaleFont, iFpppp) +GO(XFetchBuffer, pFXpi) +GO(XFetchBytes, pFXp) +//GO(_XFetchEventCookie, iFXbiLiXiiup_) +GO(XFetchName, iFXLbp_) +GO(XFillArc, iFXLpiiuuii) +GO(XFillArcs, iFXLppi) +GO(XFillPolygon, iFXLppiii) +GO(XFillRectangle, iFXLpiiuu) +GO(XFillRectangles, iFXLppi) +GOM(XFilterEvent, iFEpL) // Warning: failed to confirm +GO(XFindContext, iFXLiBp_) +//GOM(XFindOnExtensionList, pFEbp_i) +GO(_XFlush, vFX) +GO(XFlush, iFX) +GO(XFlushGC, vFXp) +GO(_XFlushGCCache, vFXp) +GOM(XFontsOfFontSet, iFEppp) +GO(XForceScreenSaver, iFXi) +GO(XFree, iFp) +//GO(_XFreeAtomTable, +GO(XFreeColormap, iFXL) +GOM(XFreeColors, iFEXLpiL) +GO(XFreeCursor, iFXL) +//DATAB(_XFreeDisplayLock_fn, 4) +//GO(_XFreeDisplayStructure, +GO(_XFreeEventCookies, vFX) +GOM(XFreeEventData, vFEXp) +//GOM(_XFreeExtData, iFEp) +GOM(XFreeExtensionList, iFEp) +GOM(XFreeFont, iFEXp) +GOM(XFreeFontInfo, iFEppi) +GOM(XFreeFontNames, iFEp) +//GO(XFreeFontPath, iFbp_) +GOM(XFreeFontSet, vFEXp) +GO(XFreeGC, iFXp) +GOM(XFreeModifiermap, iFEp) +//DATAM(_XFreeMutex_fn, 4) +GO(XFreePixmap, iFXL) +GOM(XFreeStringList, vFEp) +GO(_XFreeTemp, vFXpL) +GO(XFreeThreads, iFv) +//GO(_XFreeX11XCBStructure, +GO(XGContextFromGC, LFp) +GO(XGeometry, iFXippuuuiipppp) +GO(_XGetAsyncData, vFXppiiii) +GO(_XGetAsyncReply, pFppppiii) +GO(XGetAtomName, pFXL) +GO(XGetAtomNames, iFXbL_ibp_) +//GO(_XGetBitsPerPixel, +GO(XGetClassHint, iFXLbpp_) +//GO(XGetCommand, iFXLbbp__p) +GO(XGetDefault, pFXpp) +GO(XGetErrorDatabaseText, iFXppppi) +GO(XGetErrorText, iFXipi) +GOM(XGetEventData, iFEXp) +//GO(XGetFontPath, bp_FXp) +//GO(XGetFontProperty, iFpLp) +GO(XGetGCValues, iFXpLbiLLLiiiiiiiLLiiLiiiiLic_) +GO(XGetGeometry, iFXLbL_pppppp) +GO(_XGetHostname, iFpi) +GO(XGetIconName, iFXLbp_) +GO(XGetIconSizes, iFXLbp_p) +GOM(XGetICValues, pFEpV) // use varargs... +GOM(XGetImage, pFEXLiiuuLi) // return an XImage with callbacks that needs wrapping +GOM(XGetIMValues, pFEpV) +GO(XGetInputFocus, iFXBL_p) +GO(XGetKeyboardControl, iFXbiiuuLip_) +GOM(XGetKeyboardMapping, pFEXCip) // return a KeySym*, so an unsigned long* +//GO(_XGetLCValues, +GOM(XGetModifierMapping, pFEX) +GOM(XGetMotionEvents, pFEXLLLp) +//GO(XGetNormalHints, iFpLp) +//GO(XGetOCValues, pFpppppppppp) // use varargs +//GOM(XGetOMValues, pFEpV) +GOM(XGetPixel, LFEXii) // need unbridging +GO(dummy_XGetPixel, LFpii) // for the wrapper +GO(XGetPointerControl, iFXppp) +GO(XGetPointerMapping, iFXpi) +GOM(_XGetRequest, pFEXCL) +//GO(XGetRGBColormaps, iFXLbbLLLLLLLLLL__pL) +//GO(_XGetScanlinePad, +GO(XGetScreenSaver, iFXpppp) +GO(XGetSelectionOwner, LFXL) +//GO(XGetSizeHints, iFpLpL) +GO(XGetStandardColormap, iFXLbLLLLLLLLLL_L) +GOM(XGetSubImage, pFEXLiiuuLipii) +GO(XGetTextProperty, iFXLbpLiL_L) +GO(XGetTransientForHint, iFXLbL_) +GOM(XGetVisualInfo, pFEXlpp) +//GOM(_XGetWindowAttributes, iFEXLbiiiiiipLiiiiLLiLiilllibpXLiiiiipippLLLiiiil__) +GOM(XGetWindowAttributes, iFEXLp) +GOM(XGetWindowProperty, iFEXLLlliLppppp) +GO(XGetWMClientMachine, iFXLbpLiL_) +GOM(XGetWMColormapWindows, iFEXLpp) +GOM(XGetWMHints, pFEXL) +GO(XGetWMIconName, iFXLbpLiL_) +GO(XGetWMName, iFXLbpLiL_) +GOM(XGetWMNormalHints, iFEXLpp) +GOM(XGetWMProtocols, iFEXLpp) +//GO(XGetWMSizeHints, iFpLppL) +//GO(XGetZoomHints, iFpLp) +DATAB(_Xglobal_lock, 4) +GO(XGrabButton, iFXuuLiuiiLL) +GO(XGrabKey, iFXiuLiii) +GO(XGrabKeyboard, iFXLiiiL) +GO(XGrabPointer, iFXLiuiiLLL) +GOM(XGrabServer, iFEX) +//DATAB(_XHeadOfDisplayList, 4) +//GOM(XHeightMMOfScreen, iFEbpXLiiiiipippLLLiiiil_) +//GOM(XHeightOfScreen, iFEbpXLiiiiipippLLLiiiil_) +//DATAB(_Xi18n_lock, 4) +GO(XIconifyWindow, iFXLi) +GOM(XIfEvent, iFEXppp) +GO(XImageByteOrder, iFX) +//GO(_XimCbDispatch, +//GO(_XimCheckCreateICValues, +//GO(_XimCheckDataSize, +//GO(_XimCheckICMode, +//GO(_XimCheckIfLocalProcessing, +//GO(_XimCheckIfThaiProcessing, +//GO(_XimCheckIMMode, +//GO(_XimCheckLocalInputStyle, +//GO(_XimCommitCallback, +//GO(_XIMCompileResourceList, +//GO(_XimConnect, +//GO(_Ximctstombs, +//GO(_Ximctstoutf8, +//GO(_Ximctstowcs, +//GO(_XimDecodeICATTRIBUTE, +//GO(_XimDecodeIMATTRIBUTE, +//GO(_XimDecodeLocalICAttr, +//GO(_XimDecodeLocalIMAttr, +//GO(_XimDestroyIMStructureList, +//GO(_XimDispatchInit, +//GO(_XimEncodeICATTRIBUTE, +//GO(_XimEncodeIMATTRIBUTE, +//GO(_XimEncodeLocalICAttr, +//GO(_XimEncodeLocalIMAttr, +//GO(_XimError, +//GO(_XimErrorCallback, +//GO(_XimExtension, +//GO(_XimFilterWaitEvent, +//GO(_XimFlush, +//GO(_XimForwardEvent, +//GO(_XimForwardEventCallback, +//GO(_XimFreeCommitInfo, +//GO(_XimFreeProtoIntrCallback, +//GO(_XimFreeTransIntrCallback, +//GO(_XimGetAttributeID, +//GO(_XimGetCharCode, +//GO(_XimGetCurrentICValues, +//GO(_XimGetCurrentIMValues, +//GO(_XimGetICValueData, +//GO(_XimGetIMValueData, +//GO(_XimGetLocaleCode, +//GO(_XimGetMyEndian, +//GO(_XimGetResourceListRec, +//GO(_XimGetResourceListRecByQuark, +//GO(_XimGetWindowEventmask, +//GO(_XimICOfXICID, +//DATA(_XimImSportRec, +//GO(_XimInitialResourceInfo, +//GO(_XimLcctstombs, +//GO(_XimLcctstoutf8, +//GO(_XimLcctstowcs, +//GO(_XimLocalCreateIC, +//GO(_XimLocalFilter, +//GO(_XimLocalGetICValues, +//GO(_XimLocalGetIMValues, +//GO(_XimLocalIMFree, +//GO(_XimLocalMbLookupString, +//GO(_XimLocalOpenIM, +//GO(_XimLocalSetICValues, +//GO(_XimLocalSetIMValues, +//GO(_XimLocalUtf8LookupString, +//GO(_XimLocalWcLookupString, +//GO(_XimLookupMBText, +//GO(_XimLookupUTF8Text, +//GO(_XimLookupWCText, +//GO(_XimMakeICAttrIDList, +//GO(_XimMakeIMAttrIDList, +GO(XIMOfIC, pFp) +//GO(_XimOpenIM, +//GO(_XimParseStringFile, +//GO(_XimProcError, +//GO(_XimProcSyncReply, +//GO(_XimProtoCreateIC, +//GO(_XimProtoEventToWire, +//GO(_XimProtoIMFree, +//GO(_XimProtoMbLookupString, +//GO(_XimProtoOpenIM, +//GO(_XimProtoUtf8LookupString, +//GO(_XimProtoWcLookupString, +//GO(_XimProtoWireToEvent, +//GO(_XimRead, +//GO(_XimRegisterDispatcher, +//GO(_XimRegisterFilter, +//GO(_XimRegisterIMInstantiateCallback, +//GO(_XimRegisterServerFilter, +//GO(_XimRegisterTriggerKeysCallback, +//GO(_XimRegProtoIntrCallback, +//GO(_XimReregisterFilter, +//GO(_XimResetIMInstantiateCallback, +//GO(_XimRespSyncReply, +//GO(_XimServerDestroy, +//GO(_XimSetCurrentICValues, +//GO(_XimSetCurrentIMValues, +//GO(_XimSetEventMaskCallback, +//GO(_XimSetHeader, +//GO(_XimSetICDefaults, +//GO(_XimSetICMode, +//GO(_XimSetICResourceList, +//GO(_XimSetICValueData, +//GO(_XimSetIMMode, +//GO(_XimSetIMResourceList, +//GO(_XimSetIMValueData, +//GO(_XimSetInnerICResourceList, +//GO(_XimSetInnerIMResourceList, +//GO(_XimSetLocalIMDefaults, +//GO(_XimShutdown, +//GO(_XimSync, +//GO(_XimSyncCallback, +//GO(_XimThaiCloseIM, +//GO(_XimThaiCreateIC, +//GO(_XimThaiFilter, +//GO(_XimThaiIMFree, +//GO(_XimThaiOpenIM, +//GO(_XimTransCallDispatcher, +//GO(_XimTransConf, +//GO(_XimTransFilterWaitEvent, +//GO(_XimTransFlush, +//GO(_XimTransInternalConnection, +//DATA(_XimTransportRec, +//GO(_XimTransRead, +//GO(_XimTransRegisterDispatcher, +//GO(_XimTransWrite, +//GO(_XimTriggerNotify, +//GO(_XimUnregisterFilter, +//GO(_XimUnRegisterIMInstantiateCallback, +//GO(_XimUnregisterServerFilter, +//GO(_XimWrite, +//GO(_XimXConf, +//GO(_XimXTransBytesReadable, +//GO(_XimXTransClose, +//GO(_XimXTransCloseForCloning, +//GO(_XimXTransConnect, +//GO(_XimXTransDisconnect, +//GO(_XimXTransFreeConnInfo, +//GO(_XimXTransGetConnectionNumber, +//GO(_XimXTransGetHostname, +//GO(_XimXTransGetPeerAddr, +//GO(_XimXTransIsLocal, +//GO(_XimXTransOpenCOTSClient, +//GO(_XimXTransRead, +//GO(_XimXTransReadv, +//GO(_XimXTransSetOption, +DATA(_XimXTransSocketINET6Funcs, 4) +DATA(_XimXTransSocketINETFuncs, 4) +DATA(_XimXTransSocketLocalFuncs, 4) +DATA(_XimXTransSocketTCPFuncs, 4) +DATA(_XimXTransSocketUNIXFuncs, 4) +//GO(_XimXTransWrite, +//GO(_XimXTransWritev, +DATAB(_XInitDisplayLock_fn, 4) +GO(XInitExtension, pFXp) +//GO(_XInitIM, +GOM(XInitImage, iFEp) +GOM(_XInitImageFuncPtrs, iFEp) +//GO(_XInitKeysymDB, +//GO(_XInitOM, +GO(XInitThreads, iFv) +//GO(XInsertModifiermapEntry, bip_Fbip_Ci) +GO(XInstallColormap, iFXL) +GO(XInternalConnectionNumbers, iFXbp_p) +GO(XInternAtom, LFXpi) +GOM(XInternAtoms, iFEXpiip) +GO(XIntersectRegion, iFppp) +GO(_XIOError, iFX) +//DATAM(_XIOErrorFunction, 4) +//GO(_XIsEventCookie, iFpp) +//GO(XkbAddDeviceLedInfo, pFpuu) +//GO(XkbAddGeomColor, pFppu) +//GO(XkbAddGeomDoodad, pFppL) +//GO(XkbAddGeomKey, pFp) +//GO(XkbAddGeomKeyAlias, pFppp) +//GO(XkbAddGeomOutline, pFpi) +//GO(XkbAddGeomOverlay, pFpLi) +//GOM(XkbAddGeomOverlayKey, pFEpbWWWp_pp) +//GOM(XkbAddGeomOverlayRow, bWWWp_FEpii) +//GO(XkbAddGeomProperty, pFppp) +//GO(XkbAddGeomRow, pFpi) +//GO(XkbAddGeomSection, pFpLiii) +//GO(XkbAddGeomShape, pFpLi) +//GO(XkbAddKeyType, pFpLiii) +//GO(XkbAllocClientMap, iFpuu) +//GO(XkbAllocCompatMap, iFpuu) +//GO(XkbAllocControls, iFpu) +//GOS(XkbAllocDeviceInfo, bpLWiWWWpWWWWbWWuuuuLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLpppppppppppppppppppppppppppppppp__Fuuu) +//GO(XkbAllocGeomColors, iFpi) +//GO(XkbAllocGeomDoodads, iFpi) +//GO(XkbAllocGeometry, iFpp) +//GO(XkbAllocGeomKeyAliases, iFpi) +//GO(XkbAllocGeomKeys, iFpi) +//GO(XkbAllocGeomOutlines, iFpi) +//GO(XkbAllocGeomOverlayKeys, iFbWWWp_i) +//GOM(XkbAllocGeomOverlayRows, iFEpi) +//GO(XkbAllocGeomOverlays, iFpi) +//GO(XkbAllocGeomPoints, iFbWWWp_i) +//GO(XkbAllocGeomProps, iFpi) +//GO(XkbAllocGeomRows, iFpi) +//GO(XkbAllocGeomSectionDoodads, iFpi) +//GO(XkbAllocGeomSections, iFpi) +//GO(XkbAllocGeomShapes, iFpi) +//GO(XkbAllocIndicatorMaps, iFp) +//GOSM(XkbAllocKeyboard, bXWWCCpbWWppppCCCCCCCCCCCCCCCCp_bCCbpCCppLbL__WWbL_pp_bLpppppppppppppppppppppppppppppppp_bLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLppbL_LCCW_bbLCCCCp_ppppWW_bLWWpbup_bup_WWWWWWWWWWWWbpp_bup_bLWWbWWWp_bWWWp_bWWWp_p_bLCwwWWwWWWWWWbwwWWipp_bppppp_pp_bppppp_p__FEv) +//GO(XkbAllocNames, iFpuii) +//GO(XkbAllocServerMap, iFpuu) +//GO(XkbApplyCompatMapToKey, iFpCp) +//GO(XkbApplyVirtualModChanges, iFpup) +GO(XkbBell, iFXLiL) +GO(XkbBellEvent, iFXLiL) +//GO(XkbChangeDeviceInfo, iFppp) +GO(XkbChangeEnabledControls, iFXuuu) +//GO(XkbChangeKeycodeRange, iFpiip) +//GO(XkbChangeMap, iFppp) +//GO(XkbChangeNames, iFppp) +//GO(XkbChangeTypesOfKey, iFpiiupp) +//GO(XkbComputeEffectiveMap, iFppp) +//GO(XkbComputeRowBounds, iFppp) +//GO(XkbComputeSectionBounds, iFpp) +//GO(XkbComputeShapeBounds, iFp) +//GO(XkbComputeShapeTop, iFpp) +//GO(_XkbCopyFromReadBuffer, +//GO(XkbCopyKeyType, iFpp) +//GO(XkbCopyKeyTypes, iFppi) +GO(XkbDeviceBell, iFXLiiiiL) +GO(XkbDeviceBellEvent, iFXLiiiiL) +//GO(XkbFindOverlayForKey, pFppp) +GO(XkbForceBell, iFXi) +GO(XkbForceDeviceBell, iFXiiii) +GO(XkbFreeClientMap, vFpui) +//GO(XkbFreeCompatMap, vFpui) +//GO(XkbFreeComponentList, vFbiiiiiibWp_bWp_bWp_bWp_bWp_bWp__) +//GO(XkbFreeControls, vFpui) +//GO(XkbFreeDeviceInfo, vFpui) +//GO(XkbFreeGeomColors, vFpiii) +//GO(XkbFreeGeomDoodads, vFpii) +//GO(XkbFreeGeometry, vFpui) +//GO(XkbFreeGeomKeyAliases, vFpiii) +//GO(XkbFreeGeomKeys, vFpiii) +//GO(XkbFreeGeomOutlines, vFpiii) +//GO(XkbFreeGeomOverlayKeys, vFbWWWp_iii) +//GOM(XkbFreeGeomOverlayRows, vFEpiii) +//GO(XkbFreeGeomOverlays, vFpiii) +//GO(XkbFreeGeomPoints, vFbWWWp_iii) +//GO(XkbFreeGeomProperties, vFpiii) +//GO(XkbFreeGeomRows, vFpiii) +//GO(XkbFreeGeomSections, vFpiii) +//GO(XkbFreeGeomShapes, vFpiii) +//GO(XkbFreeIndicatorMaps, vFp) +GOM(XkbFreeKeyboard, vFEpui) +//GO(XkbFreeNames, vFpui) +//GO(_XkbFreeReadBuffer, +//GO(XkbFreeServerMap, vFpui) +//DATA(_XkbGetAtomNameFunc, 4) +GO(XkbGetAutoRepeatRate, iFXupp) +GO(XkbGetAutoResetControls, iFXpp) +//GO(_XkbGetCharset, +//GO(XkbGetCompatMap, iFpup) +GOM(XkbGetControls, iFEXLp) +//GO(_XkbGetConverters, +GO(XkbGetDetectableAutoRepeat, iFXp) +//GO(XkbGetDeviceButtonActions, iFppiuu) +//GOS(XkbGetDeviceInfo, bpLWiWWWpWWWWbWWuuuuLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLpppppppppppppppppppppppppppppppp__FXuuuu) +//GO(XkbGetDeviceInfoChanges, iFppp) +//GO(XkbGetDeviceLedInfo, iFppuuu) +//GO(XkbGetGeometry, iFpp) +//GO(XkbGetIndicatorMap, iFpLp) +GO(XkbGetIndicatorState, iFXup) +//GO(XkbGetKeyActions, iFpuup) +//GO(XkbGetKeyBehaviors, iFpuup) +//GOSM(XkbGetKeyboard, bXWWCCpbWWppppCCCCCCCCCCCCCCCCp_bCCbpCCppLbL__WWbL_pp_bLpppppppppppppppppppppppppppppppp_bLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLppbL_LCCW_bbLCCCCp_ppppWW_bLWWpbup_bup_WWWWWWWWWWWWbpp_bup_bLWWbWWWp_bWWWp_bWWWp_p_bLCwwWWwWWWWWWbwwWWipp_bppppp_pp_bppppp_p__FEXuu) +//GOSM(XkbGetKeyboardByName, bXWWCCpbWWppppCCCCCCCCCCCCCCCCp_bCCbpCCppLbL__WWbL_pp_bLpppppppppppppppppppppppppppppppp_bLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLppbL_LCCW_bbLCCCCp_ppppWW_bLWWpbup_bup_WWWWWWWWWWWWbpp_bup_bLWWbWWWp_bWWWp_bWWWp_p_bLCwwWWwWWWWWWbwwWWipp_bppppp_pp_bppppp_p__FEXubpppppp_uui) +//GO(XkbGetKeyExplicitComponents, iFpuup) +//GO(XkbGetKeyModifierMap, iFpuup) +//GO(XkbGetKeySyms, iFpuup) +//GO(XkbGetKeyTypes, iFpuup) +//GO(XkbGetKeyVirtualModMap, iFpuup) +GOM(XkbGetMap, pFEXuu) +//GO(XkbGetMapChanges, iFppp) +GO(XkbGetNamedDeviceIndicator, iFXuuuLpppp) +//GO(XkbGetNamedGeometry, iFppL) +GO(XkbGetNamedIndicator, iFXLpppp) +GOM(XkbGetNames, iFEXup) +GO(XkbGetPerClientControls, iFXp) +//GO(_XkbGetReadBufferCountedString, +//GO(_XkbGetReadBufferPtr, +GO(XkbGetState, iFXup) +GOM(XkbGetUpdatedMap, iFEXup) +//GO(XkbGetVirtualMods, iFpup) +GO(XkbGetXlibControls, uFX) +GO(XkbIgnoreExtension, iFi) +//GO(XkbInitCanonicalKeyTypes, iFpui) +//GO(_XkbInitReadBuffer, +//DATA(_XkbInternAtomFunc, 4) +GO(XkbKeycodeToKeysym, LFXCii) +GO(XkbKeysymToModifiers, uFXL) +//GO(XkbKeyTypesForCoreSymbols, iFpipupp) +GO(XkbLatchGroup, iFXuu) +GO(XkbLatchModifiers, iFXuuu) +GO(XkbLibraryVersion, iFpp) +//GO(XkbListComponents, biiiiiibWp_bWp_bWp_bWp_bWp_bWp__FXubpppppp_p) +GO(XkbLockGroup, iFXuu) +GO(XkbLockModifiers, iFXuuu) +GO(XkbLookupKeyBinding, iFXLupip) +GO(XkbLookupKeySym, iFXCupbL_) +//GO(XkbNoteControlsChanges, vFpbiLiXLiiuuuiCccc_u) +//GO(_XkbNoteCoreMapChanges, +//GOM(XkbNoteDeviceChanges, vFEpbiLiXLiiuuuiiuuii_u) +//GO(XkbNoteMapChanges, vFpbiLiXLiiuuiiCCCCCCCCiiiiiiu_u) +//GO(XkbNoteNameChanges, vFbuCCCCCCCCWLC_biLiXLiiuiiiiiiuuuii_u) +GO(XkbOpenDisplay, XFpppppp) +//GO(_XkbPeekAtReadBuffer, +GOM(XkbQueryExtension, iFEXppppp) +//GO(_XkbReadBufferCopy32, +//GO(_XkbReadBufferCopyKeySyms, +//GO(_XkbReadCopyData32, +//GO(_XkbReadCopyKeySyms, +//GO(_XkbReadGetCompatMapReply, +//GO(_XkbReadGetGeometryReply, +//GO(_XkbReadGetIndicatorMapReply, +//GO(_XkbReadGetMapReply, +//GO(_XkbReadGetNamesReply, +GOM(XkbRefreshKeyboardMapping, iEEp) +//GO(_XkbReloadDpy, +//GO(XkbResizeDeviceButtonActions, iFpu) +//GO(XkbResizeKeyActions, pFpii) +//GO(XkbResizeKeySyms, pFpii) +//GO(XkbResizeKeyType, iFpiiii) +GO(XkbSelectEventDetails, iFXuuLL) +GO(XkbSelectEvents, iFXuuu) +//GOM(XkbSetAtomFuncs, vFEpp) +GO(XkbSetAutoRepeatRate, iFXuuu) +GO(XkbSetAutoResetControls, iFXupp) +//GO(XkbSetCompatMap, iFpupi) +//GO(XkbSetControls, iFpLp) +GO(XkbSetDebuggingFlags, iFXuupuupp) +GO(XkbSetDetectableAutoRepeat, iFXip) +//GO(XkbSetDeviceButtonActions, iFppuu) +//GO(XkbSetDeviceInfo, iFpup) +//GO(XkbSetDeviceLedInfo, iFppuuu) +//GO(XkbSetGeometry, iFpup) +GO(XkbSetIgnoreLockMods, iFXuuuuu) +//GO(XkbSetIndicatorMap, iFpLp) +//GO(XkbSetMap, iFpup) +GO(XkbSetNamedDeviceIndicator, iFXuuuLiiip) +GO(XkbSetNamedIndicator, iFXLiiip) +//GO(XkbSetNames, iFpuuup) +GO(XkbSetPerClientControls, iFXup) +GO(XkbSetServerInternalMods, iFXuuuuu) +GO(XkbSetXlibControls, uFXuu) +//GO(_XkbSkipReadBufferData, +GO(XkbToControl, cFc) +//GO(XkbTranslateKey, +//GO(XkbTranslateKeyCode, iFpCupp) +GO(XkbTranslateKeySym, iFXbL_upip) +//GO(XkbUpdateActionVirtualMods, iFppu) +//GO(XkbUpdateKeyTypeVirtualMods, vFppup) +//GO(XkbUpdateMapFromCore, iFpCiipp) +GO(XkbUseExtension, iFXpp) +//GO(XkbVirtualModsToReal, iFpup) +//GO(_XkbWriteCopyData32, +//GO(_XkbWriteCopyKeySyms, +GO(XkbXlibControlsImplemented, uFv) +//GO(_XKeycodeToKeysym, +GO(XKeycodeToKeysym, LFXCi) +//GO(_XKeyInitialize, +//GO(_XKeysymToKeycode, +GO(XKeysymToKeycode, CFXL) +//GO(_XKeysymToModifiers, +GO(XKeysymToString, pFL) +//DATA(_XkeyTable, +GO(XKillClient, iFXL) +GO(XLastKnownRequestProcessed, LFX) +//GO(_XlcAddCharSet, +//GO(_XlcAddCT, +//GO(_XlcAddGB18030LocaleConverters, +//GO(_XlcAddLoader, +//GO(_XlcAddUtf8Converters, +//GO(_XlcAddUtf8LocaleConverters, +//GO(_XlcCloseConverter, +//GO(_XlcCompareISOLatin1, +//GO(_XlcCompileResourceList, +//GO(_XlcConvert, +//GO(_XlcCopyFromArg, +//GO(_XlcCopyToArg, +//GO(_XlcCountVaList, +//GO(_XlcCreateDefaultCharSet, +//GO(_XlcCreateLC, +//GO(_XlcCreateLocaleDataBase, +//GO(_XlcCurrentLC, +//GO(_XlcDbg_printValue, +//GO(_XlcDefaultLoader, +//GO(_XlcDefaultMapModifiers, +//GO(_XlcDeInitLoader, +//GO(_XlcDestroyLC, +//GO(_XlcDestroyLocaleDataBase, +//GO(_XlcFileName, +//GO(_XlcGenericLoader, +DATA(_XlcGenericMethods, 4) +//GO(_XlcGetCharSet, +//GO(_XlcGetCharSetWithSide, +//GO(_XlcGetCSValues, +//GO(_XlcGetLocaleDataBase, +//GO(_XlcGetResource, +//GO(_XlcGetValues, +//GO(_XlcInitCTInfo, +//GO(_XlcInitLoader, +//GO(_XlcLocaleDirName, +//GO(_XlcLocaleLibDirName, +//GO(_XlcMapOSLocaleName, +//GO(_Xlcmbstoutf8, +//GO(_Xlcmbstowcs, +//GO(_Xlcmbtowc, +//GO(_XlcNCompareISOLatin1, +//GO(_XlcOpenConverter, +//GO(_XlcParseCharSet, +//GO(_XlcParse_scopemaps, +DATA(_XlcPublicMethods, 4) +//GO(_XlcRemoveLoader, +//GO(_XlcResetConverter, +//GO(_XlcResolveI18NPath, +//GO(_XlcResolveLocaleName, +//GO(_XlcSetConverter, +//GO(_XlcSetValues, +//GO(_XlcUtf8Loader, +//GO(_XlcValidModSyntax, +//GO(_XlcVaToArgList, +//GO(_Xlcwcstombs, +//GO(_Xlcwctomb, +GO(XListDepths, pFXip) +GOM(XListExtensions, pFEXp)//GOM(XListExtensions, bp_FEXp) +GOM(XListFonts, pFEXpip) +//GO(XListFontsWithInfo, pFppipp) +//GO(XListHosts, biip_FXpp) +//GO(XListInstalledColormaps, bL_FXLp) +GO(XListPixmapFormats, pFXp) +//GO(XListProperties, bL_FXLp) +GO(XLoadFont, LFXp) +GOM(XLoadQueryFont, pFEXp) +GO(xlocaledir, vFpi) +GOM(XLocaleOfFontSet, pFEp) +GO(XLocaleOfIM, pFp) +GO(XLocaleOfOM, pFp) +GOM(XLockDisplay, vFEX) +//DATAM(_XLockMutex_fn, 4) +GO(XLookupColor, iFXLpBLWWWcc_BLWWWcc_) +//GO(_XLookupKeysym, +GOM(XLookupKeysym, LFEpi) +//GO(_XLookupString, +GOM(XLookupString, iFEppipp) +GO(XLowerWindow, iFXL) +GO(XMapRaised, iFXL) +GO(XMapSubwindows, iFXL) +GO(XMapWindow, iFXL) +GOM(XMaskEvent, iFEXlp) +GO(XMatchVisualInfo, iFXiiiBpLiiiLLLii_) +//GOM(XMaxCmapsOfScreen, iFEbpXLiiiiipippLLLiiiil_) +GO(XMaxRequestSize, lFX) +//GO(_XmbDefaultDrawImageString, +//GO(_XmbDefaultDrawString, +//GO(_XmbDefaultTextEscapement, +//GO(_XmbDefaultTextExtents, +//GO(_XmbDefaultTextPerCharExtents, +GOM(XmbDrawImageString, vFEXLppiipi) +GOM(XmbDrawString, vFEXLppiipi) +GOM(XmbDrawText, vFEXLpiipi) +//GO(_XmbGenericDrawImageString, +//GO(_XmbGenericDrawString, +//GO(_XmbGenericTextEscapement, +//GO(_XmbGenericTextExtents, +//GO(_XmbGenericTextPerCharExtents, +GO(_Xmblen, iFpi) +GOM(XmbLookupString, iFEpppipp) +GO(XmbResetIC, pFp) +GOM(XmbSetWMProperties, vFEXLpppippp) +//GO(_Xmbstoutf8, +//GO(_Xmbstowcs, +GOM(XmbTextEscapement, iFEppi) +GOM(XmbTextExtents, iFEppipp) +//GO(_XmbTextListToTextProperty, +GOM(XmbTextListToTextProperty, iFEXpiup) +GOM(XmbTextPerCharExtents, iFEppippippp) +//GO(_XmbTextPropertyToTextList, +GOM(XmbTextPropertyToTextList, iFEXbpLiL_pp) +GO(_Xmbtowc, iFppi) +//GOM(XMinCmapsOfScreen, iFEbpXLiiiiipippLLLiiiil_) +GO(XMoveResizeWindow, iFXLiiuu) +GO(XMoveWindow, iFXLii) +//GO(XNewModifiermap, bip_Fi) +GOM(XNextEvent, iFEXp) // Warning: failed to confirm +GO(XNextRequest, LFX) +GO(XNoOp, iFX) +//GO(_XNoticeCreateBitmap, +//GO(_XNoticePutBitmap, +GO(XOffsetRegion, iFpii) +//GO(_XomConvert, +//GO(_XomGenericDrawString, +//GO(_XomGenericOpenOM, +//GO(_XomGenericTextExtents, +//GO(_XomGetFontDataFromFontSet, +//GO(_XomInitConverter, +GO(XOMOfOC, pFp) +GOM(XOpenDisplay, XFp) //%noE +GO(XOpenIM, pFXppp) +//GO(_XOpenLC, +GO(XOpenOM, pFXppp) +//GO(_XParseBaseFontNameList, +GO(XParseColor, iFXLpbLWWWcc_) +GO(XParseGeometry, iFppppp) +GOM(XPeekEvent, iFEXp) +GOM(XPeekIfEvent, iFEXppp) +GO(XPending, iFX) +GO(Xpermalloc, pFu) +//GOM(XPlanesOfScreen, iFEbpXLiiiiipippLLLiiiil_) +GO(XPointInRegion, iFpii) +GO(_XPollfdCacheAdd, vFXi) +GO(_XPollfdCacheDel, vFXi) +GO(_XPollfdCacheInit, iFX) +GO(XPolygonRegion, pFpii) +//GOM(_XProcessInternalConnection, vFEXp) +GO(XProcessInternalConnection, vFXi) +//GO(_XProcessWindowAttributes, vFppLp) +GO(XProtocolRevision, iFX) +GO(XProtocolVersion, iFX) +//GO(_XPutBackEvent, iFpp) +GOM(XPutBackEvent, iFEXp) +GOM(XPutImage, iFEXLppiiiiuu) +GO(XPutPixel, vFXiiL) +GO(XQLength, iFX) +GO(XQueryBestCursor, iFXLuupp) +GO(XQueryBestSize, iFXiLuupp) +GO(XQueryBestStipple, iFXLuupp) +GO(XQueryBestTile, iFXLuupp) +GO(XQueryColor, iFXLbLWWWcc_) +GOM(XQueryColors, iFEXLpi) +GOM(XQueryExtension, iFEXpppp) +GOM(XQueryFont, pFEXL) +GO(XQueryKeymap, iFXp) +GO(XQueryPointer, iFXLbL_bL_ppppp) +GO(XQueryTextExtents, iFXLpipppp) +GO(XQueryTextExtents16, iFXLpipppp) +GOM(XQueryTree, iFEXLpppp) +GO(XRaiseWindow, iFXL) +GO(_XRead, iFXpl) +GO(XReadBitmapFile, iFXLpppbL_pp) +GO(XReadBitmapFileData, iFpppbp_pp) +GO(_XReadEvents, vFX) +GO(_XReadPad, vFXpl) +GO(XRebindKeysym, iFXLbL_ipi) +GO(XRecolorCursor, iFXLbLWWWcc_bLWWWcc_) +GO(XReconfigureWMWindow, iFXLiuriiiiiLi_) +GO(XRectInRegion, iFpiiuu) +//GO(_XRefreshKeyboardMapping, +GOM(XRefreshKeyboardMapping, iFEp) +//GO(_XRegisterFilterByMask, +//GO(_XRegisterFilterByType, +GOM(XRegisterIMInstantiateCallback, iFEXppppp) +//GOM(_XRegisterInternalConnection, iFEXipp) +//GOM(XRemoveConnectionWatch, vFEXpp) +GO(XRemoveFromSaveSet, iFXL) +GO(XRemoveHost, iFXbiip_) +GO(XRemoveHosts, iFXbiip_i) +GO(XReparentWindow, iFXLLii) +GOM(_XReply, iFEXpii) +GO(XResetScreenSaver, iFX) +GO(XResizeWindow, iFXLuu) +GO(XResourceManagerString, pFX) +GO(XRestackWindows, iFXbL_i) +//GO(_XReverse_Bytes, +GO(XrmCombineDatabase, vFpbp_i) +GO(XrmCombineFileDatabase, iFpbp_i) +//GO(_XrmDefaultInitParseInfo, +GO(XrmDestroyDatabase, vFp) +//GOM(XrmEnumerateDatabase, iFEpppipp) +GO(XrmGetDatabase, pFX) +GO(XrmGetFileDatabase, pFp) +GO(XrmGetResource, iFpppbp_bup_) +GO(XrmGetStringDatabase, pFp) +GO(XrmInitialize, vFv) +//GO(_XrmInitParseInfo, +//GO(_XrmInternalStringToQuark, +GO(XrmLocaleOfDatabase, pFp) +GO(XrmMergeDatabases, vFpbp_) +GO(XrmParseCommand, vFbp_bppup_ippbp_) +GO(XrmPermStringToQuark, iFp) +GO(XrmPutFileDatabase, vFpp) +GO(XrmPutLineResource, vFbp_p) +GO(XrmPutResource, vFbp_ppbup_) +GO(XrmPutStringResource, vFbp_pp) +GO(XrmQGetResource, iFppppbup_) +//GO(XrmQGetSearchList, iFpppbbp__i) +//GO(XrmQGetSearchResource, iFbbp__iipbup_) +GO(XrmQPutResource, vFbp_ppibup_) +GO(XrmQPutStringResource, vFbp_ppp) +GO(XrmQuarkToString, pFi) +GO(XrmSetDatabase, vFXp) +GO(XrmStringToBindingQuarkList, vFppp) +GO(XrmStringToQuark, iFp) +GO(XrmStringToQuarkList, vFpp) +GO(XrmUniqueQuark, iFv) +GO(XRootWindow, LFXi) +//GOM(XRootWindowOfScreen, LFEbpXLiiiiipippLLLiiiil_) +GO(XRotateBuffers, iFXi) +GO(XRotateWindowProperties, iFXLbL_ii) +GO(XSaveContext, iFXLip) +GO(XScreenCount, iFX) +GOM(XScreenNumberOfScreen, iFEp) +//GOM(XScreenOfDisplay, bpXLiiiiipippLLLiiiil_FEXi) +//GOM(_XScreenOfWindow, bpXLiiiiipippLLLiiiil_FEXL) +//GOM(XScreenResourceString, pFEbpXLiiiiipippLLLiiiil_) +GO(XSelectInput, iFXLl) +GO(_XSend, vFXpl) +GOM(XSendEvent, iFEXLilp) +GO(XServerVendor, pFX) +GO(XSetAccessControl, iFXi) +//GOM(XSetAfterFunction, pFEXp) +GO(XSetArcMode, iFXpi) +GO(XSetAuthorization, vFpipi) +GO(XSetBackground, iFXpL) +GO(XSetClassHint, iFXLbpp_) +GO(XSetClipMask, iFXpL) +GO(XSetClipOrigin, iFXpii) +GO(_XSetClipRectangles, vFXpiipii) +GO(XSetClipRectangles, iFXpiipii) +GO(XSetCloseDownMode, iFXi) +GO(XSetCommand, iFXLbp_i) +GO(XSetDashes, iFXpipi) +GOM(XSetErrorHandler, pFEp) +GO(XSetFillRule, iFXpi) +GO(XSetFillStyle, iFXpi) +GO(XSetFont, iFXpL) +GO(XSetFontPath, iFXbp_i) +GO(XSetForeground, iFXpL) +GO(XSetFunction, iFXpi) +GO(XSetGraphicsExposures, iFXpi) +GO(XSetICFocus, vFp) +GO(XSetIconName, iFXLp) +GO(XSetIconSizes, iFXLpi) +GOM(XSetICValues, pFEpV) +//GO(_XSetImage, +GOM(XSetIMValues, pFEpV) +GO(XSetInputFocus, iFXLiL) +//GOM(XSetIOErrorExitHandler, vFEXpp) +GOM(XSetIOErrorHandler, pFEp) +GO(_XSetLastRequestRead, LFXp) +GO(XSetLineAttributes, iFXpuiii) +GO(XSetLocaleModifiers, pFp) +GO(XSetModifierMapping, iFXbip_) +//GO(XSetNormalHints, iFpLp) +//GOM(XSetOCValues, pFEpV) +//GOM(XSetOMValues, pFEpV) +GO(XSetPlaneMask, iFXpL) +GO(XSetPointerMapping, iFXpi) +GO(XSetRegion, iFXpp) +GO(XSetRGBColormaps, vFXLbLLLLLLLLLL_iL) +GO(XSetScreenSaver, iFXiiii) +GO(XSetSelectionOwner, iFXLLL) +//GO(XSetSizeHints, iFpLpL) +GO(XSetStandardColormap, vFXLbLLLLLLLLLL_L) +GO(XSetStandardProperties, iFXLppLpip) +GO(XSetState, iFXpLLiL) +GO(XSetStipple, iFXpL) +GO(XSetSubwindowMode, iFXpi) +GO(XSetTextProperty, vFXLbpLiL_L) +GO(XSetTile, iFXpL) +GO(XSetTransientForHint, iFXLL) +GO(XSetTSOrigin, iFXpii) +GO(XSetWindowBackground, iFXLL) +GO(XSetWindowBackgroundPixmap, iFXLL) +GO(XSetWindowBorder, iFXLL) +GO(XSetWindowBorderPixmap, iFXLL) +GO(XSetWindowBorderWidth, iFXLu) +GO(XSetWindowColormap, iFXLL) +GO(XSetWMClientMachine, vFXLbpLiL_) +GO(XSetWMColormapWindows, iFXLbL_i) +GOM(XSetWMHints, iFEXLp) +GO(XSetWMIconName, vFXLrpLiL_) +GO(XSetWMName, vFXLrpLiL_) +GOM(XSetWMNormalHints, vFEXLp) +GOM(XSetWMProperties, vFEXLpppippp) +GOM(XSetWMProtocols, iFEXLpi) +GOM(XSetWMSizeHints, vFEXLpL) +//GO(XSetZoomHints, iFpLp) +GO(XShrinkRegion, iFpii) +GO(XStoreBuffer, iFXpii) +GO(XStoreBytes, iFXpi) +GO(XStoreColor, iFXLbLWWWcc_) +GOM(XStoreColors, iFEXLpi) +//GO(_XStoreEventCookie, vFpp) +GO(XStoreName, iFXLp) +GO(XStoreNamedColor, iFXLpLi) +GOM(XStringListToTextProperty, iFEpip) +GO(XStringToKeysym, LFp) +GOM(XSubImage, pFEpiiuu) // need unbridging +GO(dummy_XSubImage, pFpiiuu) // for the wrapper +GO(XSubtractRegion, iFppp) +GO(XSupportsLocale, iFv) +GO(XSync, iFXi) +GOM(XSynchronize, pFEXi) +GOM(XTextExtents, iFEppipppp) +GOM(XTextExtents16, iFEppipppp) +//GO(_XTextHeight, iFppi) +//GO(_XTextHeight16, iFppi) +//GO(XTextPropertyToStringList, iFbpLiL_bbp__p) +GOM(XTextWidth, iFEppi) +GOM(XTextWidth16, iFEppi) +//DATAB(_Xthread_self_fn, 4) +GO(XTranslateCoordinates, iFXLLiippBL_) +//GO(_XTranslateKey, +//GO(_XTranslateKeySym, +//GO(_XTryShapeBitmapCursor, +GO(XUndefineCursor, iFXL) +GO(XUngrabButton, iFXuuL) +GO(XUngrabKey, iFXiuL) +GO(XUngrabKeyboard, iFXL) +GO(XUngrabPointer, iFXL) +GO(XUngrabServer, iFX) +GO(XUninstallColormap, iFXL) +GO(XUnionRectWithRegion, iFppp) +GO(XUnionRegion, iFppp) +//GO(_XUnknownCopyEventCookie, iFXbiLiXiiup_biLiXiiup_) +//GO(_XUnknownNativeEvent, iFppp) +//GO(_XUnknownWireEvent, iFppp) +//GO(_XUnknownWireEventCookie, iFppp) +GO(XUnloadFont, iFXL) +GO(XUnlockDisplay, vFX) +DATA(_XUnlockMutex_fn, 4) +GO(XUnmapSubwindows, iFXL) +GO(XUnmapWindow, iFXL) +//GO(_XUnregisterFilter, +GOM(XUnregisterIMInstantiateCallback, iFEXppppp) +GO(_XUnregisterInternalConnection, vFXi) +//GO(_XUnresolveColor, +GO(XUnsetICFocus, vFp) +//GO(_XUpdateAtomCache, +//GO(_XUpdateGCCache, +//GO(_Xutf8DefaultDrawImageString, +//GO(_Xutf8DefaultDrawString, +//GO(_Xutf8DefaultTextEscapement, +//GO(_Xutf8DefaultTextExtents, +//GO(_Xutf8DefaultTextPerCharExtents, +GOM(Xutf8DrawImageString, vFEXLppiipi) +GOM(Xutf8DrawString, vFEXLppiipi) +GOM(Xutf8DrawText, vFEXLpiipi) +//GO(_Xutf8GenericDrawImageString, +//GO(_Xutf8GenericDrawString, +//GO(_Xutf8GenericTextEscapement, +//GO(_Xutf8GenericTextExtents, +//GO(_Xutf8GenericTextPerCharExtents, +GOM(Xutf8LookupString, iFEpppipp) +GO(Xutf8ResetIC, pFp) +GOM(Xutf8SetWMProperties, vFEXLpppippp) // Warning: failed to confirm +GOM(Xutf8TextEscapement, iFEppi) +GOM(Xutf8TextExtents, iFEppipp) +//GO(_Xutf8TextListToTextProperty, +GOM(Xutf8TextListToTextProperty, iFEXpiup) +GOM(Xutf8TextPerCharExtents, iFEppippippp) +//GO(_Xutf8TextPropertyToTextList, +GOM(Xutf8TextPropertyToTextList, iFEXbpLiL_pp) +GOM(XVaCreateNestedList, pFEiV) +GO(XVendorRelease, iFX) +GO(_XVIDtoVisual, pFXL) +GOM(XVisualIDFromVisual, LFEp) +GO(XWarpPointer, iFXLLiiuuii) +//GO(_XwcDefaultDrawImageString, +//GO(_XwcDefaultDrawString, +//GO(_XwcDefaultTextEscapement, +//GO(_XwcDefaultTextExtents, +//GO(_XwcDefaultTextPerCharExtents, +GOM(XwcDrawImageString, vFEXLppiipi) +GOM(XwcDrawString, vFEXLppiipi) +GOM(XwcDrawText, vFEXLpiipi) +//GO(_XwcFreeStringList, +GO(XwcFreeStringList, vFbp_) +//GO(_XwcGenericDrawImageString, +//GO(_XwcGenericDrawString, +//GO(_XwcGenericTextEscapement, +//GO(_XwcGenericTextExtents, +//GO(_XwcGenericTextPerCharExtents, +GOM(XwcLookupString, iFEpppipp) +GO(XwcResetIC, pFp) +//GO(_Xwcscmp, +//GO(_Xwcscpy, +//GO(_Xwcslen, +//GO(_Xwcsncmp, +//GO(_Xwcsncpy, +//GO(_Xwcstombs, +GOM(XwcTextEscapement, iFEppi) +GOM(XwcTextExtents, iFEppipp) +//GO(_XwcTextListToTextProperty, +GOM(XwcTextListToTextProperty, iFEXpiup) +GOM(XwcTextPerCharExtents, iFEppippippp) +//GO(_XwcTextPropertyToTextList, +GOM(XwcTextPropertyToTextList, iFEXbpLiL_pp) +GO(_Xwctomb, iFpi) +GO(XWhitePixel, LFXi) +//GOM(XWhitePixelOfScreen, LFEbpXLiiiiipippLLLiiiil_) +//GOM(XWidthMMOfScreen, iFEbpXLiiiiipippLLLiiiil_) +//GOM(XWidthOfScreen, iFEbpXLiiiiipippLLLiiiil_) +GOM(XWindowEvent, iFEXLlp) +//GO(_XWireToEvent, iFppp) +GO(XWithdrawWindow, iFXLi) +//GO(XWMGeometry, iFpippupppppp) +GO(XWriteBitmapFile, iFXpLuuii) +GO(XXorRegion, iFppp) + +//GO(_XData32, iFppu) +//GO(_XRead32, vFppl) + +GO(dummy_putpixel, iFpiiL) +GO(dummy_addpixel, iFpl) +GO(dummy_vFp, vFp) diff --git a/src/wrapped32/wrappedlibx11xcb.c b/src/wrapped32/wrappedlibx11xcb.c new file mode 100644 index 0000000..c524716 --- /dev/null +++ b/src/wrapped32/wrappedlibx11xcb.c @@ -0,0 +1,38 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "libtools/my_x11_conv.h" + +static const char* libx11xcbName = "libX11-xcb.so.1"; +#define ALTNAME "libX11-xcb.so" +#define LIBNAME libx11xcb + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedlibx11xcbtypes32.h" + +#include "wrappercallback32.h" + +EXPORT void* my32_XGetXCBConnection(x64emu_t* emu, void* a) +{ + void* ret = add_xcb_connection32(my->XGetXCBConnection(a)); + regXCBDisplay(a, ret); + return ret; +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibx11xcb_private.h b/src/wrapped32/wrappedlibx11xcb_private.h new file mode 100644 index 0000000..f149fea --- /dev/null +++ b/src/wrapped32/wrappedlibx11xcb_private.h @@ -0,0 +1,6 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error meh! +#endif + +GOM(XGetXCBConnection, pFEX) +GO(XSetEventQueueOwner, vFXu) diff --git a/src/wrapped32/wrappedlibxcb.c b/src/wrapped32/wrappedlibxcb.c new file mode 100644 index 0000000..eab07c0 --- /dev/null +++ b/src/wrapped32/wrappedlibxcb.c @@ -0,0 +1,113 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "converter32.h" + +static const char* libxcbName = "libxcb.so.1"; +#define ALTNAME "libxcb.so" + +#define LIBNAME libxcb + +typedef struct my_xcb_XXX_iterator_s { + void* data; + int rem; + int index; +} my_xcb_XXX_iterator_t; + +typedef struct my_xcb_XXX_iterator_32_s { + ptr_t data; + int rem; + int index; +} my_xcb_XXX_iterator_32_t; + +typedef struct my_xcb_cookie_s { + uint32_t data; +} my_xcb_cookie_t; + +typedef my_xcb_cookie_t (*zFppp_t)(void*, void*, void*); +typedef my_xcb_cookie_t (*zFpCWp_t)(void*, uint8_t, uint16_t, void*); +typedef my_xcb_cookie_t (*zFpCuuuuu_t)(void*, uint8_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); +typedef my_xcb_cookie_t (*zFpCuuuCup_t)(void*, uint8_t, uint32_t, uint32_t, uint32_t, uint8_t, uint32_t, void*); +typedef my_xcb_cookie_t (*zFpCuuwwWWWWuup_t)(void*, uint8_t, uint32_t, uint32_t, int16_t, int16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint32_t, void*); +typedef my_xcb_XXX_iterator_t (*ZFp_t)(void*); + +#define ADDED_FUNCTIONS() \ +GO(xcb_change_property, zFpCuuuCup_t) \ +GO(xcb_delete_property, zFppp_t) \ +GO(xcb_get_property, zFpCuuuuu_t) \ +GO(xcb_intern_atom, zFpCWp_t) \ +GO(xcb_setup_roots_iterator, ZFp_t) \ +GO(xcb_create_window, zFpCuuwwWWWWuup_t) \ +GO(xcb_create_window_checked, zFpCuuwwWWWWuup_t)\ + +#include "generated/wrappedlibxcbtypes32.h" + +#include "wrappercallback32.h" + +EXPORT void* my32_xcb_connect(x64emu_t* emu, void* dispname, void* screen) +{ + return add_xcb_connection32(my->xcb_connect(dispname, screen)); +} + +EXPORT void my32_xcb_disconnect(x64emu_t* emu, void* conn) +{ + my->xcb_disconnect(align_xcb_connection32(conn)); + del_xcb_connection32(conn); +} + +#define SUPER(F, P, ...) \ + EXPORT void* my32_##F P \ + { \ + (void)emu; \ + *ret = my->F(__VA_ARGS__); \ + return ret; \ + } + +SUPER(xcb_change_property, (x64emu_t* emu, my_xcb_cookie_t* ret, void* c, uint8_t mode, uint32_t w, uint32_t prop, uint32_t type, uint8_t f, uint32_t len, void* data), c, mode, w, prop, type, f, len, data) +SUPER(xcb_delete_property, (x64emu_t* emu, my_xcb_cookie_t* ret, void* c, void* w, void* p), c, w, p) +SUPER(xcb_get_property, (x64emu_t* emu, my_xcb_cookie_t* ret, void* c, uint8_t _del, uint32_t w, uint32_t p, uint32_t type, uint32_t off, uint32_t len), c, _del, w, p, type, off, len) +SUPER(xcb_intern_atom, (x64emu_t* emu, my_xcb_cookie_t* ret, void* c, uint8_t only, uint16_t len, void* name), c, only, len, name) +SUPER(xcb_create_window, (x64emu_t* emu, my_xcb_cookie_t* ret, void* c, uint8_t depth, uint32_t w, uint32_t p, int16_t x, int16_t y, uint16_t width, uint16_t height, uint16_t bw, uint16_t cl, uint32_t vid, uint32_t mask, void* list), c, depth, w, p, x, y, width, height, bw, cl, vid, mask, list) +SUPER(xcb_create_window_checked, (x64emu_t* emu, my_xcb_cookie_t* ret, void* c, uint8_t depth, uint32_t w, uint32_t p, int16_t x, int16_t y, uint16_t width, uint16_t height, uint16_t bw, uint16_t cl, uint32_t vid, uint32_t mask, void* list), c, depth, w, p, x, y, width, height, bw, cl, vid, mask, list) + +#undef SUPER + +#define SUPER(F) \ + EXPORT void* my32_##F(x64emu_t* emu, my_xcb_XXX_iterator_32_t* ret, void* R)\ + { \ + (void)emu; \ + my_xcb_XXX_iterator_t ret_l = my->F(R); \ + ret->data = to_ptrv(ret_l.data); \ + ret->rem = ret_l.rem; \ + ret->index = ret_l.index; \ + return ret; \ + } + +SUPER(xcb_setup_roots_iterator) + +#undef SUPER + +#if 0 +#ifdef ANDROID +#define NEEDED_LIBS "libXau.so", "libXdmcp.so" +#else +#define NEEDED_LIBS "libXau.so.6", "libXdmcp.so.6" +#endif +#endif + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibxcb_private.h b/src/wrapped32/wrappedlibxcb_private.h new file mode 100644 index 0000000..5c7a151 --- /dev/null +++ b/src/wrapped32/wrappedlibxcb_private.h @@ -0,0 +1,681 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//%S z my_xcb_cookie_t u +//%S Z my_xcb_XXX_iterator_t pii + +//GOS(xcb_alloc_color, pFpnuWWW) +//GOS(xcb_alloc_color_cells, pFpnCuWW) +GO(xcb_alloc_color_cells_masks, pFp) +//GOS(xcb_alloc_color_cells_masks_end, pFpp) +GO(xcb_alloc_color_cells_masks_length, iFp) +GO(xcb_alloc_color_cells_pixels, pFp) +//GOS(xcb_alloc_color_cells_pixels_end, pFpp) +GO(xcb_alloc_color_cells_pixels_length, iFp) +GO(xcb_alloc_color_cells_reply, pFnubp_) +GO(xcb_alloc_color_cells_sizeof, iFp) +//GOS(xcb_alloc_color_cells_unchecked, pFpnCuWW) +//GOS(xcb_alloc_color_planes, pFpnCuWWWW) +GO(xcb_alloc_color_planes_pixels, pFp) +//GOS(xcb_alloc_color_planes_pixels_end, pFpp) +GO(xcb_alloc_color_planes_pixels_length, iFp) +GO(xcb_alloc_color_planes_reply, pFnubp_) +GO(xcb_alloc_color_planes_sizeof, iFp) +//GOS(xcb_alloc_color_planes_unchecked, pFpnCuWWWW) +GO(xcb_alloc_color_reply, pFnubp_) +//GOS(xcb_alloc_color_unchecked, pFpnuWWW) +//GOS(xcb_alloc_named_color, pFpnuWp) +GO(xcb_alloc_named_color_reply, pFnubp_) +GO(xcb_alloc_named_color_sizeof, iFp) +//GOS(xcb_alloc_named_color_unchecked, pFpnuWp) +//GOS(xcb_allow_events, pFpnCu) +//GOS(xcb_allow_events_checked, pFpnCu) +//GO(xcb_arc_end, +GO(xcb_arc_next, vFbpii_) +//GO(xcb_atom_end, +GO(xcb_atom_next, vFbpii_) +//GOS(xcb_bell, pFpnc) +//GOS(xcb_bell_checked, pFpnc) +//GO(xcb_big_requests_enable, +//GO(xcb_big_requests_enable_reply, +//GO(xcb_big_requests_enable_unchecked, +DATA(xcb_big_requests_id, 4) // Warning: failed to confirm +//GO(xcb_bool32_end, +GO(xcb_bool32_next, vFbpii_) +//GO(xcb_button_end, +GO(xcb_button_next, vFbpii_) +//GOS(xcb_change_active_pointer_grab, pFpnuuW) +//GOS(xcb_change_active_pointer_grab_checked, pFpnuuW) +//GOS(xcb_change_gc, pFpnuup) +//GOS(xcb_change_gc_aux, pFpnuup) +//GOS(xcb_change_gc_aux_checked, pFpnuup) +//GOS(xcb_change_gc_checked, pFpnuup) +GO(xcb_change_gc_sizeof, iFp) +GO(xcb_change_gc_value_list, pFp) +GO(xcb_change_gc_value_list_serialize, iFbp_up) +GO(xcb_change_gc_value_list_sizeof, iFpu) +GO(xcb_change_gc_value_list_unpack, iFpup) +//GOS(xcb_change_hosts, pFpnCCWp) +GO(xcb_change_hosts_address, pFp) +//GOS(xcb_change_hosts_address_end, pFpp) +GO(xcb_change_hosts_address_length, iFp) +//GOS(xcb_change_hosts_checked, pFpnCCWp) +GO(xcb_change_hosts_sizeof, iFp) +//GOS(xcb_change_keyboard_control, pFpnup) +//GOS(xcb_change_keyboard_control_aux, pFpnup) +//GOS(xcb_change_keyboard_control_aux_checked, pFpnup) +//GOS(xcb_change_keyboard_control_checked, pFpnup) +GO(xcb_change_keyboard_control_sizeof, iFp) +GO(xcb_change_keyboard_control_value_list, pFp) +GO(xcb_change_keyboard_control_value_list_serialize, iFbp_up) +GO(xcb_change_keyboard_control_value_list_sizeof, iFpu) +GO(xcb_change_keyboard_control_value_list_unpack, iFpup) +//GOS(xcb_change_keyboard_mapping, pFpnCCCp) +//GOS(xcb_change_keyboard_mapping_checked, pFpnCCCp) +GO(xcb_change_keyboard_mapping_keysyms, pFp) +//GOS(xcb_change_keyboard_mapping_keysyms_end, pFpp) +GO(xcb_change_keyboard_mapping_keysyms_length, iFp) +GO(xcb_change_keyboard_mapping_sizeof, iFp) +//GOS(xcb_change_pointer_control, pFpnwwwCC) +//GOS(xcb_change_pointer_control_checked, pFpnwwwCC) +GOS(xcb_change_property, zFEnCuuuCup) //%% +//GOS(xcb_change_property_checked, pFpnCuuuCup) +GO(xcb_change_property_data, pFp) +//GOS(xcb_change_property_data_end, pFpp) +GO(xcb_change_property_data_length, iFp) +GO(xcb_change_property_sizeof, iFp) +//GOS(xcb_change_save_set, pFpnCu) +//GOS(xcb_change_save_set_checked, pFpnCu) +//GOS(xcb_change_window_attributes, pFpnuup) +//GOS(xcb_change_window_attributes_aux, pFpnuup) +//GOS(xcb_change_window_attributes_aux_checked, pFpnuup) +//GOS(xcb_change_window_attributes_checked, pFpnuup) +GO(xcb_change_window_attributes_sizeof, iFp) +GO(xcb_change_window_attributes_value_list, pFp) +GO(xcb_change_window_attributes_value_list_serialize, iFbp_up) +GO(xcb_change_window_attributes_value_list_sizeof, iFpu) +GO(xcb_change_window_attributes_value_list_unpack, iFpup) +//GO(xcb_char2b_end, +GO(xcb_char2b_next, vFbpii_) +//GO(xcb_charinfo_end, +GO(xcb_charinfo_next, vFbpii_) +//GOS(xcb_circulate_window, pFpnCu) +//GOS(xcb_circulate_window_checked, pFpnCu) +//GOS(xcb_clear_area, pFpnCuwwWW) +//GOS(xcb_clear_area_checked, pFpnCuwwWW) +//GO(xcb_client_message_data_end, +GO(xcb_client_message_data_next, vFbpii_) +//GOS(xcb_close_font, pFpnu) +//GOS(xcb_close_font_checked, pFpnu) +//GO(xcb_coloritem_end, +GO(xcb_coloritem_next, vFbpii_) +//GO(xcb_colormap_end, +GO(xcb_colormap_next, vFbpii_) +//GOS(xcb_configure_window, pFpnuWp) +//GOS(xcb_configure_window_aux, pFpnuWp) +//GOS(xcb_configure_window_aux_checked, pFpnuWp) +//GOS(xcb_configure_window_checked, pFpnuWp) +GO(xcb_configure_window_sizeof, iFp) +GO(xcb_configure_window_value_list, pFp) +GO(xcb_configure_window_value_list_serialize, iFbp_Wp) +GO(xcb_configure_window_value_list_sizeof, iFpW) +GO(xcb_configure_window_value_list_unpack, iFpWp) +GOM(xcb_connect, pFEpp) +GO(xcb_connection_has_error, iFn) +//GO(xcb_connect_to_display_with_auth_info, nFpbipip_p) +//GO(xcb_connect_to_fd, nFibipip_) +//GOS(xcb_convert_selection, pFpnuuuuu) +//GOS(xcb_convert_selection_checked, pFpnuuuuu) +//GOS(xcb_copy_area, pFpnuuuwwwwWW) +//GOS(xcb_copy_area_checked, pFpnuuuwwwwWW) +//GOS(xcb_copy_colormap_and_free, pFpnuu) +//GOS(xcb_copy_colormap_and_free_checked, pFpnuu) +//GOS(xcb_copy_gc, pFpnuuu) +//GOS(xcb_copy_gc_checked, pFpnuuu) +//GOS(xcb_copy_plane, pFpnuuuwwwwWWu) +//GOS(xcb_copy_plane_checked, pFpnuuuwwwwWWu) +//GOS(xcb_create_colormap, pFpnCuuu) +//GOS(xcb_create_colormap_checked, pFpnCuuu) +//GOS(xcb_create_cursor, pFpnuuuWWWWWWWW) +//GOS(xcb_create_cursor_checked, pFpnuuuWWWWWWWW) +//GOS(xcb_create_gc, pFpnuuup) +//GOS(xcb_create_gc_aux, pFpnuuup) +//GOS(xcb_create_gc_aux_checked, pFpnuuup) +//GOS(xcb_create_gc_checked, pFpnuuup) +GO(xcb_create_gc_sizeof, iFp) +GO(xcb_create_gc_value_list, pFp) +GO(xcb_create_gc_value_list_serialize, iFbp_up) +GO(xcb_create_gc_value_list_sizeof, iFpu) +GO(xcb_create_gc_value_list_unpack, iFpup) +//GOS(xcb_create_glyph_cursor, pFpnuuuWWWWWWWW) +//GOS(xcb_create_glyph_cursor_checked, pFpnuuuWWWWWWWW) +//GOS(xcb_create_pixmap, pFpnCuuWW) +//GOS(xcb_create_pixmap_checked, pFpnCuuWW) +GOS(xcb_create_window, zFEpnCuuwwWWWWuup) //%% +//GOS(xcb_create_window_aux, pFpnCuuwwWWWWuup) +//GOS(xcb_create_window_aux_checked, pFpnCuuwwWWWWuup) +GOS(xcb_create_window_checked, zFEpnCuuwwWWWWuup) //%% +GO(xcb_create_window_sizeof, iFp) +GO(xcb_create_window_value_list, pFp) +GO(xcb_create_window_value_list_serialize, iFbp_up) +GO(xcb_create_window_value_list_sizeof, iFpu) +GO(xcb_create_window_value_list_unpack, iFpup) +//GO(xcb_cursor_end, +GO(xcb_cursor_next, vFbpii_) +GOS(xcb_delete_property, zFEnuu) //%% +//GOS(xcb_delete_property_checked, pFpnuu) +//GO(xcb_depth_end, +GO(xcb_depth_next, vFbpii_) +GO(xcb_depth_sizeof, iFp) +GO(xcb_depth_visuals, pFp) +//GOS(xcb_depth_visuals_iterator, pFpp) +GO(xcb_depth_visuals_length, iFp) +//GOS(xcb_destroy_subwindows, pFpnu) +//GOS(xcb_destroy_subwindows_checked, pFpnu) +//GOS(xcb_destroy_window, pFpnu) +//GOS(xcb_destroy_window_checked, pFpnu) +GO(xcb_discard_reply, vFnu) +GO(xcb_discard_reply64, vFnU) +GOM(xcb_disconnect, vFEp) +//GO(xcb_drawable_end, +GO(xcb_drawable_next, vFbpii_) +//GOS(xcb_fill_poly, pFpnuuCCup) +//GOS(xcb_fill_poly_checked, pFpnuuCCup) +GO(xcb_fill_poly_points, pFp) +//GOS(xcb_fill_poly_points_iterator, pFpp) +GO(xcb_fill_poly_points_length, iFp) +GO(xcb_fill_poly_sizeof, iFpu) +GO(xcb_flush, iFn) +//GO(xcb_fontable_end, +GO(xcb_fontable_next, vFbpii_) +//GO(xcb_font_end, +GO(xcb_font_next, vFbpii_) +//GO(xcb_fontprop_end, +GO(xcb_fontprop_next, vFbpii_) +//GOS(xcb_force_screen_saver, pFpnC) +//GOS(xcb_force_screen_saver_checked, pFpnC) +//GO(xcb_format_end, +GO(xcb_format_next, vFbpii_) +//GOS(xcb_free_colormap, pFpnu) +//GOS(xcb_free_colormap_checked, pFpnu) +//GOS(xcb_free_colors, pFpnuuup) +//GOS(xcb_free_colors_checked, pFpnuuup) +GO(xcb_free_colors_pixels, pFp) +//GOS(xcb_free_colors_pixels_end, pFpp) +GO(xcb_free_colors_pixels_length, iFp) +GO(xcb_free_colors_sizeof, iFpu) +//GOS(xcb_free_cursor, pFpnu) +//GOS(xcb_free_cursor_checked, pFpnu) +//GOS(xcb_free_gc, pFpnu) +//GOS(xcb_free_gc_checked, pFpnu) +//GOS(xcb_free_pixmap, pFpnu) +//GOS(xcb_free_pixmap_checked, pFpnu) +//GO(xcb_gcontext_end, +GO(xcb_gcontext_next, vFbpii_) +GO(xcb_generate_id, uFn) +//GOS(xcb_get_atom_name, pFpnu) +GO(xcb_get_atom_name_name, pFp) +//GOS(xcb_get_atom_name_name_end, pFpp) +GO(xcb_get_atom_name_name_length, iFp) +GO(xcb_get_atom_name_reply, pFnubp_) +GO(xcb_get_atom_name_sizeof, iFp) +//GOS(xcb_get_atom_name_unchecked, pFpnu) +GO(xcb_get_extension_data, pFnbpi_) +GO(xcb_get_file_descriptor, iFn) +//GOS(xcb_get_font_path, pFpn) +//GOS(xcb_get_font_path_path_iterator, pFpp) +GO(xcb_get_font_path_path_length, iFp) +GO(xcb_get_font_path_reply, pFnubp_) +GO(xcb_get_font_path_sizeof, iFp) +//GOS(xcb_get_font_path_unchecked, pFpn) +//GOS(xcb_get_geometry, pFpnu) +GO(xcb_get_geometry_reply, pFnubp_) +//GOS(xcb_get_geometry_unchecked, pFpnu) +//GOS(xcb_get_image, pFpnCuwwWWu) +GO(xcb_get_image_data, pFp) +//GOS(xcb_get_image_data_end, pFpp) +GO(xcb_get_image_data_length, iFp) +GO(xcb_get_image_reply, pFnubp_) +GO(xcb_get_image_sizeof, iFp) +//GOS(xcb_get_image_unchecked, pFpnCuwwWWu) +//GOS(xcb_get_input_focus, pFpn) +GO(xcb_get_input_focus_reply, pFnubp_) +//GOS(xcb_get_input_focus_unchecked, pFpn) +//GOS(xcb_get_keyboard_control, pFpn) +GO(xcb_get_keyboard_control_reply, pFnubp_) +//GOS(xcb_get_keyboard_control_unchecked, pFpn) +//GOS(xcb_get_keyboard_mapping, pFpnCC) +GO(xcb_get_keyboard_mapping_keysyms, pFp) +//GOS(xcb_get_keyboard_mapping_keysyms_end, pFpp) +GO(xcb_get_keyboard_mapping_keysyms_length, iFp) +GO(xcb_get_keyboard_mapping_reply, pFnubp_) +GO(xcb_get_keyboard_mapping_sizeof, iFp) +//GOS(xcb_get_keyboard_mapping_unchecked, pFpnCC) +GO(xcb_get_maximum_request_length, uFn) +//GOS(xcb_get_modifier_mapping, pFpn) +GO(xcb_get_modifier_mapping_keycodes, pFp) +//GOS(xcb_get_modifier_mapping_keycodes_end, pFpp) +GO(xcb_get_modifier_mapping_keycodes_length, iFp) +GO(xcb_get_modifier_mapping_reply, pFnubp_) +GO(xcb_get_modifier_mapping_sizeof, iFp) +//GOS(xcb_get_modifier_mapping_unchecked, pFpn) +//GOS(xcb_get_motion_events, pFpnuuu) +GO(xcb_get_motion_events_events, pFp) +//GOS(xcb_get_motion_events_events_iterator, pFpp) +GO(xcb_get_motion_events_events_length, iFp) +GO(xcb_get_motion_events_reply, pFnubp_) +GO(xcb_get_motion_events_sizeof, iFp) +//GOS(xcb_get_motion_events_unchecked, pFpnuuu) +//GOS(xcb_get_pointer_control, pFpn) +GO(xcb_get_pointer_control_reply, pFnubp_) +//GOS(xcb_get_pointer_control_unchecked, pFpn) +//GOS(xcb_get_pointer_mapping, pFpn) +GO(xcb_get_pointer_mapping_map, pFp) +//GOS(xcb_get_pointer_mapping_map_end, pFpp) +GO(xcb_get_pointer_mapping_map_length, iFp) +GO(xcb_get_pointer_mapping_reply, pFnubp_) +GO(xcb_get_pointer_mapping_sizeof, iFp) +//GOS(xcb_get_pointer_mapping_unchecked, pFpn) +GOS(xcb_get_property, zFEnCuuuuu) //%% +GO(xcb_get_property_reply, pFnubp_) +GO(xcb_get_property_sizeof, iFp) +//GOS(xcb_get_property_unchecked, pFpnCuuuuu) +GO(xcb_get_property_value, pFp) +//GOS(xcb_get_property_value_end, pFpp) +GO(xcb_get_property_value_length, iFp) +GO(xcb_get_reply_fds, pFnpL) +//GOS(xcb_get_screen_saver, pFpn) +GO(xcb_get_screen_saver_reply, pFnubp_) +//GOS(xcb_get_screen_saver_unchecked, pFpn) +//GOS(xcb_get_selection_owner, pFpnu) +GO(xcb_get_selection_owner_reply, pFnubp_) +//GOS(xcb_get_selection_owner_unchecked, pFpnu) +GO(xcb_get_setup, pFn) +//GOS(xcb_get_window_attributes, pFpnu) +GO(xcb_get_window_attributes_reply, pFnubp_) +//GOS(xcb_get_window_attributes_unchecked, pFpnu) +//GOS(xcb_grab_button, pFpnCuWCCuuCW) +//GOS(xcb_grab_button_checked, pFpnCuWCCuuCW) +//GOS(xcb_grab_key, pFpnCuWCCC) +//GOS(xcb_grab_keyboard, pFpnCuuCC) +GO(xcb_grab_keyboard_reply, pFnubp_) +//GOS(xcb_grab_keyboard_unchecked, pFpnCuuCC) +//GOS(xcb_grab_key_checked, pFpnCuWCCC) +//GOS(xcb_grab_pointer, pFpnCuWCCuuu) +GO(xcb_grab_pointer_reply, pFnubp_) +//GOS(xcb_grab_pointer_unchecked, pFpnCuWCCuuu) +//GOS(xcb_grab_server, pFpn) +//GOS(xcb_grab_server_checked, pFpn) +GO(xcb_host_address, pFp) +//GOS(xcb_host_address_end, pFpp) +GO(xcb_host_address_length, iFp) +//GO(xcb_host_end, +GO(xcb_host_next, vFbpii_) +GO(xcb_host_sizeof, iFp) +//GOS(xcb_image_text_16, pFpnCuuwwp) +//GOS(xcb_image_text_16_checked, pFpnCuuwwp) +GO(xcb_image_text_16_sizeof, iFp) +GO(xcb_image_text_16_string, pFp) +//GOS(xcb_image_text_16_string_iterator, pFpp) +GO(xcb_image_text_16_string_length, iFp) +//GOS(xcb_image_text_8, pFpnCuuwwp) +//GOS(xcb_image_text_8_checked, pFpnCuuwwp) +GO(xcb_image_text_8_sizeof, iFp) +GO(xcb_image_text_8_string, pFp) +//GOS(xcb_image_text_8_string_end, pFpp) +GO(xcb_image_text_8_string_length, iFp) +//GOS(xcb_install_colormap, pFpnu) +//GOS(xcb_install_colormap_checked, pFpnu) +GOS(xcb_intern_atom, zFEnCWp) //%% +GO(xcb_intern_atom_reply, pFnubp_) +GO(xcb_intern_atom_sizeof, iFp) +//GOS(xcb_intern_atom_unchecked, pFpnCWp) +//GO(xcb_keycode32_end, +GO(xcb_keycode32_next, vFbpii_) +//GO(xcb_keycode_end, +GO(xcb_keycode_next, vFbpii_) +//GO(xcb_keysym_end, +GO(xcb_keysym_next, vFbpii_) +//GOS(xcb_kill_client, pFpnu) +//GOS(xcb_kill_client_checked, pFpnu) +//GOS(xcb_list_extensions, pFpn) +//GOS(xcb_list_extensions_names_iterator, pFpp) +GO(xcb_list_extensions_names_length, iFp) +GO(xcb_list_extensions_reply, pFnubp_) +GO(xcb_list_extensions_sizeof, iFp) +//GOS(xcb_list_extensions_unchecked, pFpn) +//GOS(xcb_list_fonts, pFpnWWp) +//GOS(xcb_list_fonts_names_iterator, pFpp) +GO(xcb_list_fonts_names_length, iFp) +GO(xcb_list_fonts_reply, pFnubp_) +GO(xcb_list_fonts_sizeof, iFp) +//GOS(xcb_list_fonts_unchecked, pFpnWWp) +//GOS(xcb_list_fonts_with_info, pFpnWWp) +GO(xcb_list_fonts_with_info_name, pFp) +//GOS(xcb_list_fonts_with_info_name_end, pFpp) +GO(xcb_list_fonts_with_info_name_length, iFp) +GO(xcb_list_fonts_with_info_properties, pFp) +//GOS(xcb_list_fonts_with_info_properties_iterator, pFpp) +GO(xcb_list_fonts_with_info_properties_length, iFp) +GO(xcb_list_fonts_with_info_reply, pFnubp_) +GO(xcb_list_fonts_with_info_sizeof, iFp) +//GOS(xcb_list_fonts_with_info_unchecked, pFpnWWp) +//GOS(xcb_list_hosts, pFpn) +//GOS(xcb_list_hosts_hosts_iterator, pFpp) +GO(xcb_list_hosts_hosts_length, iFp) +GO(xcb_list_hosts_reply, pFnubp_) +GO(xcb_list_hosts_sizeof, iFp) +//GOS(xcb_list_hosts_unchecked, pFpn) +//GOS(xcb_list_installed_colormaps, pFpnu) +GO(xcb_list_installed_colormaps_cmaps, pFp) +//GOS(xcb_list_installed_colormaps_cmaps_end, pFpp) +GO(xcb_list_installed_colormaps_cmaps_length, iFp) +GO(xcb_list_installed_colormaps_reply, pFnubp_) +GO(xcb_list_installed_colormaps_sizeof, iFp) +//GOS(xcb_list_installed_colormaps_unchecked, pFpnu) +//GOS(xcb_list_properties, pFpnu) +GO(xcb_list_properties_atoms, pFp) +//GOS(xcb_list_properties_atoms_end, pFpp) +GO(xcb_list_properties_atoms_length, iFp) +GO(xcb_list_properties_reply, pFnubp_) +GO(xcb_list_properties_sizeof, iFp) +//GOS(xcb_list_properties_unchecked, pFpnu) +//GOS(xcb_lookup_color, pFpnuWp) +GO(xcb_lookup_color_reply, pFnubp_) +GO(xcb_lookup_color_sizeof, iFp) +//GOS(xcb_lookup_color_unchecked, pFpnuWp) +//GOS(xcb_map_subwindows, pFpnu) +//GOS(xcb_map_subwindows_checked, pFpnu) +//GOS(xcb_map_window, pFpnu) +//GOS(xcb_map_window_checked, pFpnu) +//GOS(xcb_no_operation, pFpn) +//GOS(xcb_no_operation_checked, pFpn) +//GOS(xcb_open_font, pFpnuWp) +//GOS(xcb_open_font_checked, pFpnuWp) +GO(xcb_open_font_name, pFp) +//GOS(xcb_open_font_name_end, pFpp) +GO(xcb_open_font_name_length, iFp) +GO(xcb_open_font_sizeof, iFp) +GO(xcb_parse_display, iFpbp_pp) +//GO(xcb_pixmap_end, +GO(xcb_pixmap_next, vFbpii_) +//GO(xcb_point_end, +GO(xcb_point_next, vFbpii_) +GO(xcb_poll_for_event, pFn) +GO(xcb_poll_for_queued_event, pFn) +GO(xcb_poll_for_reply, iFnubp_bp_) +GO(xcb_poll_for_reply64, iFnUbp_bp_) +GO(xcb_poll_for_special_event, pFnp) +//GOS(xcb_poly_arc, pFpnuuup) +GO(xcb_poly_arc_arcs, pFp) +//GOS(xcb_poly_arc_arcs_iterator, pFpp) +GO(xcb_poly_arc_arcs_length, iFp) +//GOS(xcb_poly_arc_checked, pFpnuuup) +GO(xcb_poly_arc_sizeof, iFpu) +//GOS(xcb_poly_fill_arc, pFpnuuup) +GO(xcb_poly_fill_arc_arcs, pFp) +//GOS(xcb_poly_fill_arc_arcs_iterator, pFpp) +GO(xcb_poly_fill_arc_arcs_length, iFp) +//GOS(xcb_poly_fill_arc_checked, pFpnuuup) +GO(xcb_poly_fill_arc_sizeof, iFpu) +//GOS(xcb_poly_fill_rectangle, pFpnuuup) +//GOS(xcb_poly_fill_rectangle_checked, pFpnuuup) +GO(xcb_poly_fill_rectangle_rectangles, pFp) +//GOS(xcb_poly_fill_rectangle_rectangles_iterator, pFpp) +GO(xcb_poly_fill_rectangle_rectangles_length, iFp) +GO(xcb_poly_fill_rectangle_sizeof, iFpu) +//GOS(xcb_poly_line, pFpnCuuup) +//GOS(xcb_poly_line_checked, pFpnCuuup) +GO(xcb_poly_line_points, pFp) +//GOS(xcb_poly_line_points_iterator, pFpp) +GO(xcb_poly_line_points_length, iFp) +GO(xcb_poly_line_sizeof, iFpu) +//GOS(xcb_poly_point, pFpnCuuup) +//GOS(xcb_poly_point_checked, pFpnCuuup) +GO(xcb_poly_point_points, pFp) +//GOS(xcb_poly_point_points_iterator, pFpp) +GO(xcb_poly_point_points_length, iFp) +GO(xcb_poly_point_sizeof, iFpu) +//GOS(xcb_poly_rectangle, pFpnuuup) +//GOS(xcb_poly_rectangle_checked, pFpnuuup) +GO(xcb_poly_rectangle_rectangles, pFp) +//GOS(xcb_poly_rectangle_rectangles_iterator, pFpp) +GO(xcb_poly_rectangle_rectangles_length, iFp) +GO(xcb_poly_rectangle_sizeof, iFpu) +//GOS(xcb_poly_segment, pFpnuuup) +//GOS(xcb_poly_segment_checked, pFpnuuup) +GO(xcb_poly_segment_segments, pFp) +//GOS(xcb_poly_segment_segments_iterator, pFpp) +GO(xcb_poly_segment_segments_length, iFp) +GO(xcb_poly_segment_sizeof, iFpu) +//GOS(xcb_poly_text_16, pFpnuuwwup) +//GOS(xcb_poly_text_16_checked, pFpnuuwwup) +GO(xcb_poly_text_16_items, pFp) +//GOS(xcb_poly_text_16_items_end, pFpp) +GO(xcb_poly_text_16_items_length, iFp) +GO(xcb_poly_text_16_sizeof, iFpu) +//GOS(xcb_poly_text_8, pFpnuuwwup) +//GOS(xcb_poly_text_8_checked, pFpnuuwwup) +GO(xcb_poly_text_8_items, pFp) +//GOS(xcb_poly_text_8_items_end, pFpp) +GO(xcb_poly_text_8_items_length, iFp) +GO(xcb_poly_text_8_sizeof, iFpu) +GO(xcb_popcount, iFu) +GO(xcb_prefetch_extension_data, vFnbpi_) +GO(xcb_prefetch_maximum_request_length, vFn) +//GOS(xcb_put_image, pFpnCuuWWwwCCup) +//GOS(xcb_put_image_checked, pFpnCuuWWwwCCup) +GO(xcb_put_image_data, pFp) +//GOS(xcb_put_image_data_end, pFpp) +GO(xcb_put_image_data_length, iFp) +GO(xcb_put_image_sizeof, iFpu) +//GOS(xcb_query_best_size, pFpnCuWW) +GO(xcb_query_best_size_reply, pFnubp_) +//GOS(xcb_query_best_size_unchecked, pFpnCuWW) +//GOS(xcb_query_colors, pFpnuup) +GO(xcb_query_colors_colors, pFp) +//GOS(xcb_query_colors_colors_iterator, pFpp) +GO(xcb_query_colors_colors_length, iFp) +GO(xcb_query_colors_reply, pFnubp_) +GO(xcb_query_colors_sizeof, iFpu) +//GOS(xcb_query_colors_unchecked, pFpnuup) +//GOS(xcb_query_extension, pFpnWp) +GO(xcb_query_extension_reply, pFnubp_) +GO(xcb_query_extension_sizeof, iFp) +//GOS(xcb_query_extension_unchecked, pFpnWp) +//GOS(xcb_query_font, pFpnu) +GO(xcb_query_font_char_infos, pFp) +//GOS(xcb_query_font_char_infos_iterator, pFpp) +GO(xcb_query_font_char_infos_length, iFp) +GO(xcb_query_font_properties, pFp) +//GOS(xcb_query_font_properties_iterator, pFpp) +GO(xcb_query_font_properties_length, iFp) +GO(xcb_query_font_reply, pFnubp_) +GO(xcb_query_font_sizeof, iFp) +//GOS(xcb_query_font_unchecked, pFpnu) +//GOS(xcb_query_keymap, pFpn) +GO(xcb_query_keymap_reply, pFnubp_) +//GOS(xcb_query_keymap_unchecked, pFpn) +//GOS(xcb_query_pointer, pFpnu) +GO(xcb_query_pointer_reply, pFnubp_) +//GOS(xcb_query_pointer_unchecked, pFpnu) +//GOS(xcb_query_text_extents, pFpnuup) +GO(xcb_query_text_extents_reply, pFnubp_) +GO(xcb_query_text_extents_sizeof, iFpu) +//GOS(xcb_query_text_extents_unchecked, pFpnuup) +//GOS(xcb_query_tree, pFpnu) +GO(xcb_query_tree_children, pFp) +//GOS(xcb_query_tree_children_end, pFpp) +GO(xcb_query_tree_children_length, iFp) +GO(xcb_query_tree_reply, pFnubp_) +GO(xcb_query_tree_sizeof, iFp) +//GOS(xcb_query_tree_unchecked, pFpnu) +//GOS(xcb_recolor_cursor, pFpnuWWWWWW) +//GOS(xcb_recolor_cursor_checked, pFpnuWWWWWW) +//GO(xcb_rectangle_end, +GO(xcb_rectangle_next, vFbpii_) +GO(xcb_register_for_special_xge, pFnbpi_up) +//GOS(xcb_reparent_window, pFpnuuww) +//GOS(xcb_reparent_window_checked, pFpnuuww) +GO(xcb_request_check, pFnu) +//GO(xcb_rgb_end, +GO(xcb_rgb_next, vFbpii_) +//GOS(xcb_rotate_properties, pFpnuWwp) +GO(xcb_rotate_properties_atoms, pFp) +//GOS(xcb_rotate_properties_atoms_end, pFpp) +GO(xcb_rotate_properties_atoms_length, iFp) +//GOS(xcb_rotate_properties_checked, pFpnuWwp) +GO(xcb_rotate_properties_sizeof, iFp) +//GOS(xcb_screen_allowed_depths_iterator, pFpp) +GO(xcb_screen_allowed_depths_length, iFp) +//GO(xcb_screen_end, +GO(xcb_screen_next, vFbpii_) +GO(xcb_screen_sizeof, iFp) +//GO(xcb_segment_end, +GO(xcb_segment_next, vFbpii_) +//GOS(xcb_send_event, pFpnCuup) +//GOS(xcb_send_event_checked, pFpnCuup) +GO(xcb_send_fd, vFni) +GO(xcb_send_request, uFnibpL_bLpCC_) +//GOM(xcb_send_request64, UFEnibpL_bLpCC_) +//GOM(xcb_send_request_with_fds, uFEnibpL_bLpCC_up) +//GOM(xcb_send_request_with_fds64, UFEnibpL_bLpCC_up) +//GOS(xcb_set_access_control, pFpnC) +//GOS(xcb_set_access_control_checked, pFpnC) +//GOS(xcb_set_clip_rectangles, pFpnCuwwup) +//GOS(xcb_set_clip_rectangles_checked, pFpnCuwwup) +GO(xcb_set_clip_rectangles_rectangles, pFp) +//GOS(xcb_set_clip_rectangles_rectangles_iterator, pFpp) +GO(xcb_set_clip_rectangles_rectangles_length, iFp) +GO(xcb_set_clip_rectangles_sizeof, iFpu) +//GOS(xcb_set_close_down_mode, pFpnC) +//GOS(xcb_set_close_down_mode_checked, pFpnC) +//GOS(xcb_set_dashes, pFpnuWWp) +//GOS(xcb_set_dashes_checked, pFpnuWWp) +GO(xcb_set_dashes_dashes, pFp) +//GOS(xcb_set_dashes_dashes_end, pFpp) +GO(xcb_set_dashes_dashes_length, iFp) +GO(xcb_set_dashes_sizeof, iFp) +//GOS(xcb_set_font_path, pFpnWp) +//GOS(xcb_set_font_path_checked, pFpnWp) +//GOS(xcb_set_font_path_font_iterator, pFpp) +GO(xcb_set_font_path_font_length, iFp) +GO(xcb_set_font_path_sizeof, iFp) +//GOS(xcb_set_input_focus, pFpnCuu) +//GOS(xcb_set_input_focus_checked, pFpnCuu) +//GOS(xcb_set_modifier_mapping, pFpnCp) +GO(xcb_set_modifier_mapping_reply, pFnubp_) +GO(xcb_set_modifier_mapping_sizeof, iFp) +//GOS(xcb_set_modifier_mapping_unchecked, pFpnCp) +//GOS(xcb_set_pointer_mapping, pFpnCp) +GO(xcb_set_pointer_mapping_reply, pFnubp_) +GO(xcb_set_pointer_mapping_sizeof, iFp) +//GOS(xcb_set_pointer_mapping_unchecked, pFpnCp) +//GOS(xcb_set_screen_saver, pFpnwwCC) +//GOS(xcb_set_screen_saver_checked, pFpnwwCC) +//GOS(xcb_set_selection_owner, pFpnuuu) +//GOS(xcb_set_selection_owner_checked, pFpnuuu) +//GO(xcb_setup_authenticate_end, +GO(xcb_setup_authenticate_next, vFbpii_) +GO(xcb_setup_authenticate_reason, pFp) +//GOS(xcb_setup_authenticate_reason_end, pFpp) +GO(xcb_setup_authenticate_reason_length, iFp) +GO(xcb_setup_authenticate_sizeof, iFp) +//GO(xcb_setup_end, +//GO(xcb_setup_failed_end, +GO(xcb_setup_failed_next, vFbpii_) +GO(xcb_setup_failed_reason, pFp) +//GOS(xcb_setup_failed_reason_end, pFpp) +GO(xcb_setup_failed_reason_length, iFp) +GO(xcb_setup_failed_sizeof, iFp) +GO(xcb_setup_next, vFbpii_) +GO(xcb_setup_pixmap_formats, pFp) +//GOS(xcb_setup_pixmap_formats_iterator, pFpp) +GO(xcb_setup_pixmap_formats_length, iFp) +GO(xcb_setup_request_authorization_protocol_data, pFp) +//GOS(xcb_setup_request_authorization_protocol_data_end, pFpp) +GO(xcb_setup_request_authorization_protocol_data_length, iFp) +GO(xcb_setup_request_authorization_protocol_name, pFp) +//GOS(xcb_setup_request_authorization_protocol_name_end, pFpp) +GO(xcb_setup_request_authorization_protocol_name_length, iFp) +//GO(xcb_setup_request_end, +GO(xcb_setup_request_next, vFbpii_) +GO(xcb_setup_request_sizeof, iFp) +GOS(xcb_setup_roots_iterator, ZFEpp) //%% +GO(xcb_setup_roots_length, iFp) +GO(xcb_setup_sizeof, iFp) +GO(xcb_setup_vendor, pFp) +//GOS(xcb_setup_vendor_end, pFpp) +GO(xcb_setup_vendor_length, iFp) +//GOS(xcb_store_colors, pFpnuup) +//GOS(xcb_store_colors_checked, pFpnuup) +GO(xcb_store_colors_items, pFp) +//GOS(xcb_store_colors_items_iterator, pFpp) +GO(xcb_store_colors_items_length, iFp) +GO(xcb_store_colors_sizeof, iFpu) +//GOS(xcb_store_named_color, pFpnCuuWp) +//GOS(xcb_store_named_color_checked, pFpnCuuWp) +GO(xcb_store_named_color_name, pFp) +//GOS(xcb_store_named_color_name_end, pFpp) +GO(xcb_store_named_color_name_length, iFp) +GO(xcb_store_named_color_sizeof, iFp) +//GO(xcb_str_end, +GO(xcb_str_name, pFp) +//GOS(xcb_str_name_end, pFpp) +GO(xcb_str_name_length, iFp) +GO(xcb_str_next, vFbpii_) +GO(xcb_str_sizeof, iFp) +GO(xcb_sumof, iFpi) +//GOM(xcb_take_socket, iFEnppip) +//GO(xcb_timecoord_end, +GO(xcb_timecoord_next, vFbpii_) +//GO(xcb_timestamp_end, +GO(xcb_timestamp_next, vFbpii_) +//GOS(xcb_translate_coordinates, pFpnuuww) +GO(xcb_translate_coordinates_reply, pFnubp_) +//GOS(xcb_translate_coordinates_unchecked, pFpnuuww) +//GOS(xcb_ungrab_button, pFpnCuW) +//GOS(xcb_ungrab_button_checked, pFpnCuW) +//GOS(xcb_ungrab_key, pFpnCuW) +//GOS(xcb_ungrab_keyboard, pFpnu) +//GOS(xcb_ungrab_keyboard_checked, pFpnu) +//GOS(xcb_ungrab_key_checked, pFpnCuW) +//GOS(xcb_ungrab_pointer, pFpnu) +//GOS(xcb_ungrab_pointer_checked, pFpnu) +//GOS(xcb_ungrab_server, pFpn) +//GOS(xcb_ungrab_server_checked, pFpn) +//GOS(xcb_uninstall_colormap, pFpnu) +//GOS(xcb_uninstall_colormap_checked, pFpnu) +//GOS(xcb_unmap_subwindows, pFpnu) +//GOS(xcb_unmap_subwindows_checked, pFpnu) +//GOS(xcb_unmap_window, pFpnu) +//GOS(xcb_unmap_window_checked, pFpnu) +GO(xcb_unregister_for_special_event, vFnp) +//GO(xcb_visualid_end, +GO(xcb_visualid_next, vFbpii_) +//GO(xcb_visualtype_end, +GO(xcb_visualtype_next, vFbpii_) +GO(xcb_wait_for_event, pFn) +GO(xcb_wait_for_reply, pFnubp_) +GO(xcb_wait_for_reply64, pFnUbp_) +GO(xcb_wait_for_special_event, pFnp) +//GOS(xcb_warp_pointer, pFpnuuwwWWww) +//GOS(xcb_warp_pointer_checked, pFpnuuwwWWww) +//GO(xcb_window_end, +GO(xcb_window_next, vFbpii_) +GO(xcb_writev, iFnbpL_iU) +//GO(xcb_xc_misc_get_version, +//GO(xcb_xc_misc_get_version_reply, +//GO(xcb_xc_misc_get_version_unchecked, +//GO(xcb_xc_misc_get_xid_list, +//GO(xcb_xc_misc_get_xid_list_ids, +//GO(xcb_xc_misc_get_xid_list_ids_end, +//GO(xcb_xc_misc_get_xid_list_ids_length, +//GO(xcb_xc_misc_get_xid_list_reply, +//GO(xcb_xc_misc_get_xid_list_sizeof, +//GO(xcb_xc_misc_get_xid_list_unchecked, +//GO(xcb_xc_misc_get_xid_range, +//GO(xcb_xc_misc_get_xid_range_reply, +//GO(xcb_xc_misc_get_xid_range_unchecked, +DATA(xcb_xc_misc_id, 4) // Warning: failed to confirm diff --git a/src/wrapped32/wrappedlibxcbres.c b/src/wrapped32/wrappedlibxcbres.c new file mode 100644 index 0000000..fda4dae --- /dev/null +++ b/src/wrapped32/wrappedlibxcbres.c @@ -0,0 +1,83 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "converter32.h" + +#ifdef ANDROID + static const char* libxcbresName = "libxcb-res.so"; +#else + static const char* libxcbresName = "libxcb-res.so.0"; +#endif + +#define LIBNAME libxcbres + +typedef struct my_xcb_XXX_iterator_s { + void* data; + int rem; + int index; +} my_xcb_XXX_iterator_t; + +typedef struct my_xcb_XXX_iterator_32_s { + ptr_t data; + int rem; + int index; +} my_xcb_XXX_iterator_32_t; + +typedef struct my_xcb_cookie_s { + uint32_t data; +} my_xcb_cookie_t; + +typedef my_xcb_cookie_t (*zFpup)(void*, uint32_t, void*); +typedef my_xcb_XXX_iterator_t (*ZFp_t)(void*); + +#define ADDED_FUNCTIONS() \ +GO(xcb_res_query_client_ids, zFpup) \ +GO(xcb_res_query_client_ids_ids_iterator, ZFp_t)\ + +#include "generated/wrappedlibxcbrestypes32.h" + +#include "wrappercallback32.h" + +#define SUPER(F, P, ...) \ + EXPORT void* my32_##F P \ + { \ + (void)emu; \ + *ret = my->F(__VA_ARGS__); \ + return ret; \ + } + +SUPER(xcb_res_query_client_ids, (x64emu_t* emu, my_xcb_cookie_t* ret, void* c, uint32_t count, void* specs), c, count, specs) + +#undef SUPER + +#define SUPER(F) \ + EXPORT void* my32_##F(x64emu_t* emu, my_xcb_XXX_iterator_32_t* ret, void* R)\ + { \ + (void)emu; \ + my_xcb_XXX_iterator_t ret_l = my->F(R); \ + ret->data = to_ptrv(ret_l.data); \ + ret->rem = ret_l.rem; \ + ret->index = ret_l.index; \ + return ret; \ + } + +SUPER(xcb_res_query_client_ids_ids_iterator) + +#undef SUPER + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibxcbres_private.h b/src/wrapped32/wrappedlibxcbres_private.h new file mode 100644 index 0000000..e4b5773 --- /dev/null +++ b/src/wrapped32/wrappedlibxcbres_private.h @@ -0,0 +1,62 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//%S z my_xcb_cookie_t u +//%S Z my_xcb_XXX_iterator_t pii + +//GO(xcb_res_client_end, +//GO(xcb_res_client_id_spec_end, +GO(xcb_res_client_id_spec_next, vFbpii_) +//GO(xcb_res_client_id_value_end, +GO(xcb_res_client_id_value_next, vFbpii_) +GO(xcb_res_client_id_value_sizeof, iFp) +GO(xcb_res_client_id_value_value, pFp) +//GOS(xcb_res_client_id_value_value_end, pFpp) +GO(xcb_res_client_id_value_value_length, iFp) +GO(xcb_res_client_next, vFbpii_) +//DATA(xcb_res_id, +GOS(xcb_res_query_client_ids, zFEnup) //%% +GOS(xcb_res_query_client_ids_ids_iterator, ZFEp) //%% +GO(xcb_res_query_client_ids_ids_length, iFp) +GO(xcb_res_query_client_ids_reply, pFnubp_) +GO(xcb_res_query_client_ids_sizeof, iFp) +//GOS(xcb_res_query_client_ids_unchecked, pFpnup) +//GOS(xcb_res_query_client_pixmap_bytes, pFpnu) +GO(xcb_res_query_client_pixmap_bytes_reply, pFnubp_) +//GOS(xcb_res_query_client_pixmap_bytes_unchecked, pFpnu) +//GOS(xcb_res_query_client_resources, pFpnu) +GO(xcb_res_query_client_resources_reply, pFnubp_) +GO(xcb_res_query_client_resources_sizeof, iFp) +GO(xcb_res_query_client_resources_types, pFp) +//GOS(xcb_res_query_client_resources_types_iterator, pFpp) +GO(xcb_res_query_client_resources_types_length, iFp) +//GOS(xcb_res_query_client_resources_unchecked, pFpnu) +//GOS(xcb_res_query_clients, pFpn) +GO(xcb_res_query_clients_clients, pFp) +//GOS(xcb_res_query_clients_clients_iterator, pFpp) +GO(xcb_res_query_clients_clients_length, iFp) +GO(xcb_res_query_clients_reply, pFnubp_) +GO(xcb_res_query_clients_sizeof, iFp) +//GOS(xcb_res_query_clients_unchecked, pFpn) +//GOS(xcb_res_query_resource_bytes, pFpnuup) +GO(xcb_res_query_resource_bytes_reply, pFnubp_) +GO(xcb_res_query_resource_bytes_sizeof, iFp) +//GOS(xcb_res_query_resource_bytes_sizes_iterator, pFpp) +GO(xcb_res_query_resource_bytes_sizes_length, iFp) +//GOS(xcb_res_query_resource_bytes_unchecked, pFpnuup) +//GOS(xcb_res_query_version, pFpnCC) +GO(xcb_res_query_version_reply, pFnubp_) +//GOS(xcb_res_query_version_unchecked, pFpnCC) +//GO(xcb_res_resource_id_spec_end, +GO(xcb_res_resource_id_spec_next, vFbpii_) +//GO(xcb_res_resource_size_spec_end, +GO(xcb_res_resource_size_spec_next, vFbpii_) +GO(xcb_res_resource_size_value_cross_references, pFp) +//GOS(xcb_res_resource_size_value_cross_references_iterator, pFpp) +GO(xcb_res_resource_size_value_cross_references_length, iFp) +//GO(xcb_res_resource_size_value_end, +GO(xcb_res_resource_size_value_next, vFbpii_) +GO(xcb_res_resource_size_value_sizeof, iFp) +//GO(xcb_res_type_end, +GO(xcb_res_type_next, vFbpii_) diff --git a/src/wrapped32/wrappedlibxcomposite.c b/src/wrapped32/wrappedlibxcomposite.c new file mode 100644 index 0000000..5cb481d --- /dev/null +++ b/src/wrapped32/wrappedlibxcomposite.c @@ -0,0 +1,25 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "debug.h" +#include "box32.h" + +#ifdef ANDROID + static const char* libxcompositeName = "libXcomposite.so"; +#else + static const char* libxcompositeName = "libXcomposite.so.1"; +#endif + +#define LIBNAME libxcomposite + +#include "wrappedlib_init32.h" + diff --git a/src/wrapped32/wrappedlibxcomposite_private.h b/src/wrapped32/wrappedlibxcomposite_private.h new file mode 100644 index 0000000..d2a983c --- /dev/null +++ b/src/wrapped32/wrappedlibxcomposite_private.h @@ -0,0 +1,16 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(XCompositeCreateRegionFromBorderClip, LFXL) +//GO(XCompositeFindDisplay, pFX) +GO(XCompositeGetOverlayWindow, LFXL) +GO(XCompositeNameWindowPixmap, LFXL) +GO(XCompositeQueryExtension, iFXpp) +GO(XCompositeQueryVersion, iFXpp) +GO(XCompositeRedirectSubwindows, vFXLi) +GO(XCompositeRedirectWindow, vFXLi) +GO(XCompositeReleaseOverlayWindow, vFXL) +GO(XCompositeUnredirectSubwindows, vFXLi) +GO(XCompositeUnredirectWindow, vFXLi) +GO(XCompositeVersion, iFv) diff --git a/src/wrapped32/wrappedlibxcursor.c b/src/wrapped32/wrappedlibxcursor.c new file mode 100644 index 0000000..e4b8ddd --- /dev/null +++ b/src/wrapped32/wrappedlibxcursor.c @@ -0,0 +1,206 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" + +#ifdef ANDROID + static const char* libxcursorName = "libXcursor.so"; +#else + static const char* libxcursorName = "libXcursor.so.1"; +#endif + +#define LIBNAME libxcursor + +#ifdef ANDROID +#define NEEDED_LIBS "libX11.so", "libXfixes.so", "libXrender.so" +#else +#define NEEDED_LIBS "libX11.so.6", "libXfixes.so.3", "libXrender.so.1" +#endif + +#include "libtools/my_x11_defs.h" +#include "libtools/my_x11_defs_32.h" + +#include "generated/wrappedlibxcursortypes32.h" + +#include "wrappercallback32.h" + +void* getDisplay(void*); +void* FindDisplay(void*); + +void inplace_XcursorCursors_shrink(void* a) +{ + if(!a) return; + my_XcursorCursors_t* src = a; + my_XcursorCursors_32_t* dst = a; + + dst->dpy = to_ptrv(getDisplay(src->dpy)); + dst->ref = src->ref; + dst->ncursor = src->ncursor; + dst->cursors = to_ptrv(src->cursors); +} +void inplace_XcursorCursors_enlarge(void* a) +{ + if(!a) return; + my_XcursorCursors_32_t* src = a; + my_XcursorCursors_t* dst = a; + + dst->cursors = from_ptrv(src->cursors); + dst->ncursor = src->ncursor; + dst->ref = src->ref; + dst->dpy = FindDisplay(from_ptrv(src->dpy)); +} + +void inplace_XcursorImage_shrink(void* a) +{ + if(!a) return; + my_XcursorImage_t* src = a; + my_XcursorImage_32_t* dst = a; + + dst->version = src->version; + dst->size = src->size; + dst->width = src->width; + dst->height = src->height; + dst->xhot = src->xhot; + dst->yhot = src->yhot; + dst->delay = src->delay; + dst->pixels = to_ptrv(src->pixels); +} +void inplace_XcursorImage_enlarge(void* a) +{ + if(!a) return; + my_XcursorImage_32_t* src = a; + my_XcursorImage_t* dst = a; + + dst->pixels = from_ptrv(src->pixels); + dst->delay = src->delay; + dst->yhot = src->yhot; + dst->xhot = src->xhot; + dst->height = src->height; + dst->width = src->width; + dst->size = src->size; + dst->version = src->version; +} + +void inplace_XcursorImages_shrink(void* a) +{ + if(!a) return; + my_XcursorImages_t* src = a; + my_XcursorImages_32_t* dst = a; + + for(int i=0; inimage; ++i) + inplace_XcursorCursors_shrink(src->images[i]); + for(int i=0; inimage; ++i) + ((ptr_t*)src->images)[i] = to_ptrv(src->images[i]); + dst->nimage = src->nimage; + dst->images = to_ptrv(src->images); + dst->name = to_ptrv(src->name); +} + +void inplace_XcursorImages_enlarge(void* a) +{ + if(!a) return; + my_XcursorImages_32_t* src = a; + my_XcursorImages_t* dst = a; + + dst->name = from_ptrv(src->name); + dst->images = from_ptrv(src->images); + dst->nimage = src->nimage; + for(int i=dst->nimage-1; i>=0; --i) + dst->images[i] = from_ptrv(((ptr_t*)dst->images)[i]); + for(int i=dst->nimage-1; i>=0; --i) + inplace_XcursorCursors_enlarge(dst->images[i]); +} + +EXPORT void* my32_XcursorCursorsCreate(x64emu_t* emu, void* dpy, int n) +{ + void* ret = my->XcursorCursorsCreate(dpy, n); + inplace_XcursorCursors_shrink(ret); + return ret; +} + +EXPORT void my32_XcursorCursorsDestroy(x64emu_t* emu, void* a) +{ + inplace_XcursorCursors_enlarge(a); + my->XcursorCursorsDestroy(a); +} + +EXPORT void* my32_XcursorImageCreate(x64emu_t* emu, int w, int h) +{ + void* ret = my->XcursorImageCreate(w, h); + inplace_XcursorImage_shrink(ret); + return ret; +} + +EXPORT void my32_XcursorImageDestroy(x64emu_t* emu, void* image) +{ + inplace_XcursorImage_enlarge(image); + my->XcursorImageDestroy(image); +} + +EXPORT unsigned long my32_XcursorImageLoadCursor(x64emu_t* emu, void* dpy, void* image) +{ + inplace_XcursorImage_enlarge(image); + unsigned long ret = my->XcursorImageLoadCursor(dpy, image); + inplace_XcursorImage_shrink(image); + return ret; +} + +EXPORT void* my32_XcursorImagesCreate(x64emu_t* emu, int n) +{ + void* ret = my->XcursorImagesCreate(n); + inplace_XcursorImages_shrink(ret); + return ret; +} + +EXPORT void my32_XcursorImagesDestroy(x64emu_t* emu, void* images) +{ + inplace_XcursorImages_enlarge(images); + my->XcursorImagesDestroy(images); +} + +EXPORT unsigned long my32_XcursorImagesLoadCursor(x64emu_t* emu, void* dpy, void* images) +{ + inplace_XcursorImages_enlarge(images); + unsigned long ret = my->XcursorImagesLoadCursor(dpy, images); + inplace_XcursorImages_shrink(images); + return ret; +} + +EXPORT void* my32_XcursorImagesLoadCursors(x64emu_t* emu, void* dpy, void* images) +{ + inplace_XcursorImages_enlarge(images); + void* ret = my->XcursorImagesLoadCursors(dpy, images); + inplace_XcursorImages_shrink(images); + inplace_XcursorCursors_shrink(ret); + return ret; +} + +EXPORT void* my32_XcursorLibraryLoadImages(x64emu_t* emu, void* name, void* theme, int size) +{ + void* ret = my->XcursorLibraryLoadImages(name, theme, size); + inplace_XcursorImages_shrink(ret); + return ret; +} + +EXPORT void* my32_XcursorShapeLoadImages(x64emu_t* emu, uint32_t shape, void* theme, int size) +{ + void* ret = my->XcursorShapeLoadImages(shape, theme, size); + inplace_XcursorImages_shrink(ret); + return ret; +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibxcursor_private.h b/src/wrapped32/wrappedlibxcursor_private.h new file mode 100644 index 0000000..e24a751 --- /dev/null +++ b/src/wrapped32/wrappedlibxcursor_private.h @@ -0,0 +1,66 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//GOM(XcursorAnimateCreate, pFEbXiip_) +//GOM(XcursorAnimateDestroy, vFEbpi_) +//GOM(XcursorAnimateNext, LFEbpi_) +//GOM(XcursorCommentCreate, pFEui) +//GO(XcursorCommentDestroy, vFbuup_) +//GOM(XcursorCommentsCreate, pFEi) +//GOM(XcursorCommentsDestroy, vFEbip_) +//GO(_XcursorCreateFontCursor, +//GO(_XcursorCreateGlyphCursor, +GOM(XcursorCursorsCreate, pFEXi) +GOM(XcursorCursorsDestroy, vFEp) +//GOM(XcursorFileLoad, iFESbp_bp_) +//GOM(XcursorFileLoadAllImages, pFES) +//GOM(XcursorFileLoadImage, pFESi) +//GOM(XcursorFileLoadImages, pFESi) +//GOM(XcursorFilenameLoad, iFEpbp_bp_) +//GOM(XcursorFilenameLoadAllImages, pFEp) +GO(XcursorFilenameLoadCursor, LFXp) +//GOM(XcursorFilenameLoadCursors, pFEXp) +//GOM(XcursorFilenameLoadImage, pFEpi) +//GOM(XcursorFilenameLoadImages, pFEpi) +//GOM(XcursorFilenameSave, iFEpbip_bipp_) +//GOM(XcursorFilenameSaveImages, iFEpbipp_) +//GOM(XcursorFileSave, iFESbip_bipp_) +//GOM(XcursorFileSaveImages, iFESbipp_) +GO(XcursorGetDefaultSize, iFX) +//GO(_XcursorGetDisplayInfo, +GO(XcursorGetTheme, pFX) +GO(XcursorGetThemeCore, iFX) +GOM(XcursorImageCreate, pFEii) +GOM(XcursorImageDestroy, vFEp) +//GOM(XcursorImageHash, vFEpp) // needs unbridge XImage (first p) +GOM(XcursorImageLoadCursor, LFEXp) +GOM(XcursorImagesCreate, pFEi) +GOM(XcursorImagesDestroy, vFEp) +GOM(XcursorImagesLoadCursor, LFEXp) +GOM(XcursorImagesLoadCursors, pFEXp) +//GOM(XcursorImagesSetName, vFEpp) +GO(XcursorLibraryLoadCursor, LFXp) +//GOM(XcursorLibraryLoadCursors, pFEXp) +//GOM(XcursorLibraryLoadImage, pFEppi) +GOM(XcursorLibraryLoadImages, pFEppi) +GO(XcursorLibraryPath, pFv) +GO(XcursorLibraryShape, iFp) +GO(XcursorNoticeCreateBitmap, vFXLuu) +//GOM(XcursorNoticePutBitmap, vFEXLp) //needs unbridge XImage (last p) +GO(XcursorSetDefaultSize, iFXi) +GO(XcursorSetTheme, iFXp) +GO(XcursorSetThemeCore, iFXi) +GO(XcursorShapeLoadCursor, LFXu) +//GOM(XcursorShapeLoadCursors, pFEXu) +//GOM(XcursorShapeLoadImage, pFEupi) +GOM(XcursorShapeLoadImages, pFEupi) +GO(XcursorSupportsAnim, iFX) +GO(XcursorSupportsARGB, iFX) +//GO(XcursorTryShapeBitmapCursor, LFXLLbLWWWcc_bLWWWcc_uu) +//GO(XcursorTryShapeCursor, LFXLLuubLWWWcc_bLWWWcc_) +//GOM(XcursorXcFileLoad, iFEpbp_bp_) +//GOM(XcursorXcFileLoadAllImages, pFEp) +//GOM(XcursorXcFileLoadImage, pFEpi) +//GOM(XcursorXcFileLoadImages, pFEpi) +//GOM(XcursorXcFileSave, iFEpbip_bipp_) diff --git a/src/wrapped32/wrappedlibxdamage.c b/src/wrapped32/wrappedlibxdamage.c new file mode 100644 index 0000000..a8ea651 --- /dev/null +++ b/src/wrapped32/wrappedlibxdamage.c @@ -0,0 +1,21 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "debug.h" + +static const char* libxdamageName = "libXdamage.so.1"; +#define ALTNAME "libXdamage.so" + +#define LIBNAME libxdamage + +#include "wrappedlib_init32.h" + diff --git a/src/wrapped32/wrappedlibxdamage_private.h b/src/wrapped32/wrappedlibxdamage_private.h new file mode 100644 index 0000000..65f6448 --- /dev/null +++ b/src/wrapped32/wrappedlibxdamage_private.h @@ -0,0 +1,12 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + + +GO(XDamageAdd, vFXLL) +GO(XDamageCreate, LFXLi) +GO(XDamageDestroy, vFXL) +GO(XDamageFindDisplay, pFX) +GO(XDamageQueryExtension, iFXpp) +GO(XDamageQueryVersion, iFXpp) +GO(XDamageSubtract, vFXLLL) diff --git a/src/wrapped32/wrappedlibxext.c b/src/wrapped32/wrappedlibxext.c new file mode 100644 index 0000000..a8dbe08 --- /dev/null +++ b/src/wrapped32/wrappedlibxext.c @@ -0,0 +1,583 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "elfloader.h" +#include "converter32.h" + +#ifdef ANDROID + static const char* libxextName = "libXext.so"; +#else + static const char* libxextName = "libXext.so.6"; +#endif + +#define LIBNAME libxext + +#include "libtools/my_x11_conv.h" + +typedef struct _XImage XImage; +void BridgeImageFunc(x64emu_t *emu, XImage *img); +void UnbridgeImageFunc(x64emu_t *emu, XImage *img); +typedef int (*XextErrorHandler)(void *, void *, void*); +typedef int (*iFpp_t)(void*, void*); +typedef int (*iFppp_t)(void*, void*, void*); + +#include "generated/wrappedlibxexttypes32.h" + +#include "wrappercallback32.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// exterrorhandle ... +#define GO(A) \ +static uintptr_t my_exterrorhandle_fct_##A = 0; \ +static int my_exterrorhandle_##A(void* display, void* ext_name, void* reason) \ +{ \ + return RunFunctionFmt(my_exterrorhandle_fct_##A, "ppp", getDisplay(display), ext_name, reason); \ +} +SUPER() +#undef GO +static void* find_exterrorhandle_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_exterrorhandle_fct_##A == (uintptr_t)fct) return my_exterrorhandle_##A; + SUPER() + #undef GO + #define GO(A) if(my_exterrorhandle_fct_##A == 0) {my_exterrorhandle_fct_##A = (uintptr_t)fct; return my_exterrorhandle_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libXext exterrorhandle callback\n"); + return NULL; +} +static void* reverse_exterrorhandleFct(void* fct) +{ + if(!fct) return fct; + if(CheckBridged(my_lib->w.bridge, fct)) + return (void*)CheckBridged(my_lib->w.bridge, fct); + #define GO(A) if(my_exterrorhandle_##A == fct) return (void*)my_exterrorhandle_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(my_lib->w.bridge, iFppp_32, fct, 0, NULL); +} +// create_gc ... +#define GO(A) \ +static uintptr_t my_create_gc_fct_##A = 0; \ +static int my_create_gc_##A(void* a, uint32_t b, void* c) \ +{ \ + return RunFunctionFmt(my_create_gc_fct_##A, "pup", FindDisplay(a), b, c); \ +} +SUPER() +#undef GO +static void* find_create_gc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_create_gc_fct_##A == (uintptr_t)fct) return my_create_gc_##A; + SUPER() + #undef GO + #define GO(A) if(my_create_gc_fct_##A == 0) {my_create_gc_fct_##A = (uintptr_t)fct; return my_create_gc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libXext create_gc callback\n"); + return NULL; +} +// copy_gc ... +#define GO(A) \ +static uintptr_t my_copy_gc_fct_##A = 0; \ +static int my_copy_gc_##A(void* a, uint32_t b, void* c) \ +{ \ + return RunFunctionFmt(my_copy_gc_fct_##A, "pup", FindDisplay(a), b, c); \ +} +SUPER() +#undef GO +static void* find_copy_gc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_copy_gc_fct_##A == (uintptr_t)fct) return my_copy_gc_##A; + SUPER() + #undef GO + #define GO(A) if(my_copy_gc_fct_##A == 0) {my_copy_gc_fct_##A = (uintptr_t)fct; return my_copy_gc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libXext copy_gc callback\n"); + return NULL; +} +// flush_gc ... +#define GO(A) \ +static uintptr_t my_flush_gc_fct_##A = 0; \ +static int my_flush_gc_##A(void* a, uint32_t b, void* c) \ +{ \ + return RunFunctionFmt(my_flush_gc_fct_##A, "pup", FindDisplay(a), b, c);\ +} +SUPER() +#undef GO +static void* find_flush_gc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_flush_gc_fct_##A == (uintptr_t)fct) return my_flush_gc_##A; + SUPER() + #undef GO + #define GO(A) if(my_flush_gc_fct_##A == 0) {my_flush_gc_fct_##A = (uintptr_t)fct; return my_flush_gc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libXext flush_gc callback\n"); + return NULL; +} +// free_gc ... +#define GO(A) \ +static uintptr_t my_free_gc_fct_##A = 0; \ +static int my_free_gc_##A(void* a, uint32_t b, void* c) \ +{ \ + return RunFunctionFmt(my_free_gc_fct_##A, "pup", FindDisplay(a), b, c); \ +} +SUPER() +#undef GO +static void* find_free_gc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_free_gc_fct_##A == (uintptr_t)fct) return my_free_gc_##A; + SUPER() + #undef GO + #define GO(A) if(my_free_gc_fct_##A == 0) {my_free_gc_fct_##A = (uintptr_t)fct; return my_free_gc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libXext free_gc callback\n"); + return NULL; +} +// create_font ... +#define GO(A) \ +static uintptr_t my_create_font_fct_##A = 0; \ +static int my_create_font_##A(void* a, void* b, void* c) \ +{ \ + inplace_XFontStruct_shrink(b); \ + int ret = RunFunctionFmt(my_create_font_fct_##A, "ppp", FindDisplay(a), b, c); \ + inplace_XFontStruct_enlarge(b); \ + return ret; \ +} +SUPER() +#undef GO +static void* find_create_font_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_create_font_fct_##A == (uintptr_t)fct) return my_create_font_##A; + SUPER() + #undef GO + #define GO(A) if(my_create_font_fct_##A == 0) {my_create_font_fct_##A = (uintptr_t)fct; return my_create_font_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libXext create_font callback\n"); + return NULL; +} +// free_font ... +#define GO(A) \ +static uintptr_t my_free_font_fct_##A = 0; \ +static int my_free_font_##A(void* a, void* b, void* c) \ +{ \ + inplace_XFontStruct_shrink(b); \ + int ret = RunFunctionFmt(my_free_font_fct_##A, "ppp", FindDisplay(a), b, c);\ + inplace_XFontStruct_enlarge(b); \ + return ret; \ +} +SUPER() +#undef GO +static void* find_free_font_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_free_font_fct_##A == (uintptr_t)fct) return my_free_font_##A; + SUPER() + #undef GO + #define GO(A) if(my_free_font_fct_##A == 0) {my_free_font_fct_##A = (uintptr_t)fct; return my_free_font_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libXext free_font callback\n"); + return NULL; +} +// close_display ... +#define GO(A) \ +static uintptr_t my_close_display_fct_##A = 0; \ +static int my_close_display_##A(void* a, void* b) \ +{ \ + return RunFunctionFmt(my_close_display_fct_##A, "pp", FindDisplay(a), b); \ +} +SUPER() +#undef GO +static void* find_close_display_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_close_display_fct_##A == (uintptr_t)fct) return my_close_display_##A; + SUPER() + #undef GO + #define GO(A) if(my_close_display_fct_##A == 0) {my_close_display_fct_##A = (uintptr_t)fct; return my_close_display_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libXext close_display callback\n"); + return NULL; +} +// wire_to_event +#define GO(A) \ +static uintptr_t my32_wire_to_event_fct_##A = 0; \ +static int my32_wire_to_event_##A(void* dpy, void* re, void* event) \ +{ \ + static my_XEvent_32_t re_s = {0}; \ + int ret = (int)RunFunctionFmt(my32_wire_to_event_fct_##A, "ppp", FindDisplay(dpy), &re_s, event);\ + unconvertXEvent(re, &re_s); \ + return ret; \ +} +SUPER() +#undef GO +#define GO(A) \ +static iFppp_t my32_rev_wire_to_event_fct_##A = NULL; \ +static int my32_rev_wire_to_event_##A(void* dpy, void* re, void* event) \ +{ \ + static my_XEvent_t re_l = {0}; \ + int ret = my32_rev_wire_to_event_fct_##A (getDisplay(dpy), &re_l, event); \ + convertXEvent(re, &re_l); \ + return ret; \ +} +SUPER() +#undef GO +static void* find_wire_to_event_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_wire_to_event_fct_##A == (uintptr_t)fct) return my32_wire_to_event_##A; + SUPER() + #undef GO + #define GO(A) if(my32_wire_to_event_fct_##A == 0) {my32_wire_to_event_fct_##A = (uintptr_t)fct; return my32_wire_to_event_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 wire_to_event callback\n"); + return NULL; +} +static void* reverse_wire_to_event_Fct(library_t* lib, void* fct) +{ + //Callsed from x86 world -> native world + if(!fct) return fct; + // first check if it's a wrapped function, that could be easy + #define GO(A) if(my32_wire_to_event_##A == fct) return (void*)my32_wire_to_event_fct_##A; + SUPER() + #undef GO + if(FindElfAddress(my_context, (uintptr_t)fct)) + return fct; + // it's a naitve one... so bridge it, but need transform XImage32 to XImage + void* f = NULL; + #define GO(A) if(!f && my32_rev_wire_to_event_fct_##A == fct) f = (void*)my32_rev_wire_to_event_##A; + SUPER() + #undef GO + #define GO(A) if(!f && !my32_rev_wire_to_event_fct_##A) {my32_rev_wire_to_event_fct_##A = fct; f = my32_rev_wire_to_event_##A;} + SUPER() + #undef GO + if(f) + return (void*)AddCheckBridge(lib->w.bridge, iFppp_32, f, 0, "X11_wire_to_event"); + printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 wire_to_event callback\n"); + return fct; +} + +// event_to_wire +#define GO(A) \ +static uintptr_t my32_event_to_wire_fct_##A = 0; \ +static int my32_event_to_wire_##A(void* dpy, void* re, void* event) \ +{ \ + my_XEvent_32_t re_s = {0}; \ + convertXEvent(&re_s, re); \ + return (int)RunFunctionFmt(my32_event_to_wire_fct_##A, "ppp", FindDisplay(dpy), &re_s, event); \ +} +SUPER() +#undef GO +#define GO(A) \ +static iFppp_t my32_rev_event_to_wire_fct_##A = NULL; \ +static int my32_rev_event_to_wire_##A(void* dpy, void* re, void* event) \ +{ \ + static my_XEvent_t re_l = {0}; \ + unconvertXEvent(&re_l, re); \ + return my32_rev_event_to_wire_fct_##A (getDisplay(dpy), &re_l, event); \ +} +SUPER() +#undef GO +static void* find_event_to_wire_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_event_to_wire_fct_##A == (uintptr_t)fct) return my32_event_to_wire_##A; + SUPER() + #undef GO + #define GO(A) if(my32_event_to_wire_fct_##A == 0) {my32_event_to_wire_fct_##A = (uintptr_t)fct; return my32_event_to_wire_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libX11 event_to_wire callback\n"); + return NULL; +} +static void* reverse_event_to_wire_Fct(library_t* lib, void* fct) +{ + //Callsed from x86 world -> native world + if(!fct) return fct; + // first check if it's a wrapped function, that could be easy + #define GO(A) if(my32_event_to_wire_##A == fct) return (void*)my32_event_to_wire_fct_##A; + SUPER() + #undef GO + if(FindElfAddress(my_context, (uintptr_t)fct)) + return fct; + // it's a naitve one... so bridge it, but need transform XImage32 to XImage + void* f = NULL; + #define GO(A) if(!f && my32_rev_event_to_wire_fct_##A == fct) f = (void*)my32_rev_event_to_wire_##A; + SUPER() + #undef GO + #define GO(A) if(!f && !my32_rev_event_to_wire_fct_##A) {my32_rev_event_to_wire_fct_##A = fct; f = my32_rev_event_to_wire_##A;} + SUPER() + #undef GO + if(f) + return (void*)AddCheckBridge(lib->w.bridge, iFppp_32, f, 0, "Xext_event_to_wire"); + printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libXext event_to_wire callback\n"); + return fct; +} +// error ... +#define GO(A) \ +static uintptr_t my_error_fct_##A = 0; \ +static int my_error_##A(void* a, void* b, void* c, int* d) \ +{ \ + return RunFunctionFmt(my_error_fct_##A, "pppp", FindDisplay(a), b, c, d); \ +} +SUPER() +#undef GO +static void* find_error_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_error_fct_##A == (uintptr_t)fct) return my_error_##A; + SUPER() + #undef GO + #define GO(A) if(my_error_fct_##A == 0) {my_error_fct_##A = (uintptr_t)fct; return my_error_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libXext error callback\n"); + return NULL; +} +// error_string ... +#define GO(A) \ +static uintptr_t my_error_string_fct_##A = 0; \ +static int my_error_string_##A(void* a, int b, void* c, void* d, int e) \ +{ \ + return RunFunctionFmt(my_error_string_fct_##A, "pippi", FindDisplay(a), b, c, d, e);\ +} +SUPER() +#undef GO +static void* find_error_string_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_error_string_fct_##A == (uintptr_t)fct) return my_error_string_##A; + SUPER() + #undef GO + #define GO(A) if(my_error_string_fct_##A == 0) {my_error_string_fct_##A = (uintptr_t)fct; return my_error_string_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libXext error_string callback\n"); + return NULL; +} + +#undef SUPER + +KHASH_MAP_INIT_INT(shminfo, my_XShmSegmentInfo_t*); +static kh_shminfo_t* shminfos = NULL; + +my_XShmSegmentInfo_t* getShmInfo(void* a) +{ + if(!a) return NULL; + ptr_t key = to_ptrv(a); + khint_t k = kh_get(shminfo, shminfos, key); + my_XShmSegmentInfo_t* ret = NULL; + if(k==kh_end(shminfos)) { + int r; + k = kh_put(shminfo, shminfos, key, &r); + ret = kh_value(shminfos, k) = calloc(1, sizeof(my_XShmSegmentInfo_t)); + } else + ret = kh_value(shminfos, k); + convert_XShmSegmentInfo_to_64(ret, a); + return ret; +} + +void delShmInfo(my_XShmSegmentInfo_t* a) +{ + if(!a) return; + my_XShmSegmentInfo_t* b; + kh_foreach_value(shminfos, b, + if(a==b) { + free(a); + kh_del(shminfo, shminfos, __i); + return; + } + ); +} + +EXPORT void* my32_XShmCreateImage(x64emu_t* emu, void* disp, void* vis, uint32_t depth, int32_t fmt + , void* data, void* shminfo, uint32_t w, uint32_t h) +{ + my_XShmSegmentInfo_t* shminfo_l = getShmInfo(shminfo); + XImage *img = my->XShmCreateImage(disp, convert_Visual_to_64(disp, vis), depth, fmt, data, shminfo_l, w, h); + convert_XShmSegmentInfo_to_32(shminfo, shminfo_l); + inplace_XImage_shrink(img); + return img; +} + +EXPORT int32_t my32_XShmPutImage(x64emu_t* emu, void* disp, size_t drawable, void* gc, void* image + , int32_t src_x, int32_t src_y, int32_t dst_x, int32_t dst_y + , uint32_t w, uint32_t h, int32_t sendevt) +{ + inplace_XImage_enlarge(image); + int32_t r = my->XShmPutImage(disp, drawable, gc, image, src_x, src_y, dst_x, dst_y, w, h, sendevt); + inplace_XImage_shrink(image); + return r; +} + +EXPORT int32_t my32_XShmGetImage(x64emu_t* emu, void* disp, size_t drawable, void* image, int32_t x, int32_t y, size_t plane) +{ + inplace_XImage_enlarge(image); + int32_t r = my->XShmGetImage(disp, drawable, image, x, y, plane); + inplace_XImage_shrink(image); + return r; +} + +EXPORT XID my32_XShmCreatePixmap(x64emu_t* emu, void* dpy, XID d, void* data, void* shminfo, uint32_t width, uint32_t height, uint32_t depth) +{ + my_XShmSegmentInfo_t* shminfo_l = getShmInfo(shminfo); + XID ret = my->XShmCreatePixmap(dpy, d, data, shminfo_l, width, height, depth); + convert_XShmSegmentInfo_to_32(shminfo, shminfo_l); // just in case + return ret; +} + +EXPORT int my32_XShmAttach(x64emu_t* emu, void* dpy, void* shminfo) +{ + my_XShmSegmentInfo_t* shminfo_l = getShmInfo(shminfo); + int ret = my->XShmAttach(dpy, shminfo_l); + convert_XShmSegmentInfo_to_32(shminfo, shminfo_l); // just in case + return ret; +} + +EXPORT int my32_XShmDetach(x64emu_t* emu, void* dpy, void* shminfo) +{ + my_XShmSegmentInfo_t* shminfo_l = getShmInfo(shminfo); + int ret = my->XShmDetach(dpy, shminfo_l); + convert_XShmSegmentInfo_to_32(shminfo, shminfo_l); // just in case + return ret; +} + +EXPORT void* my32_XSetExtensionErrorHandler(x64emu_t* emu, void* handler) +{ + (void)emu; + return reverse_exterrorhandleFct(my->XSetExtensionErrorHandler(find_exterrorhandle_Fct(handler))); +} + +EXPORT void* my32_XdbeGetVisualInfo(x64emu_t* emu, void* dpy, XID_32* draws, int* num) +{ + XID draws_l[*num]; + if(*num) + for(int i=0; i<*num; ++i) + draws_l[i] = from_ulong(draws[i]); + my_XdbeScreenVisualInfo_t* ret = my->XdbeGetVisualInfo(dpy, draws_l, num); + inplace_XdbeScreenVisualInfo_shrink(ret); + return ret; +} + +EXPORT void my32_XdbeFreeVisualInfo(x64emu_t* emu, void* infos) +{ + inplace_XdbeScreenVisualInfo_enlarge(infos); + my->XdbeFreeVisualInfo(infos); +} + +EXPORT void* my32_XextCreateExtension(x64emu_t* emu) +{ + return inplace_XExtensionInfo_shrink(my->XextCreateExtension()); +} + +EXPORT void my32_XextDestroyExtension(x64emu_t* emu, void* ext) +{ + my->XextDestroyExtension(inplace_XExtensionInfo_enlarge(ext)); +} + +EXPORT void* my32_XextAddDisplay(x64emu_t* emu, void* ext, void* dpy, void* name, my_XExtensionHooks_32_t* hooks, int nevents, void* data) +{ + my_XExtensionHooks_t hooks_l = {0}; + if(hooks) { + #define GO(A) hooks_l.A = find_##A##_Fct(from_ptrv(hooks->A)) + GO(create_gc); + GO(copy_gc); + GO(flush_gc); + GO(free_gc); + GO(create_font); + GO(free_font); + GO(close_display); + GO(wire_to_event); + GO(event_to_wire); + GO(error); + GO(error_string); + #undef GO + } + my_XExtensionInfo_t ext_l = {0}; + convert_XExtensionInfo_to_64(&ext_l, ext); + void* ret = my->XextAddDisplay(&ext_l, dpy, name, hooks?(&hooks_l):NULL, nevents, data); + convert_XExtensionInfo_to_32(ext, &ext_l); + //inplace_XExtDisplayInfo_shrink(ret); //no need, XExtensionInfo will shrink XExtDisplayInfo in the process + return ret; +} + +EXPORT void* my32_XextFindDisplay(x64emu_t* emu, void* ext, void* dpy) +{ + my_XExtensionInfo_t ext_l = {0}; + convert_XExtensionInfo_to_64(&ext_l, ext); + void* ret = my->XextFindDisplay(&ext_l, dpy); + convert_XExtensionInfo_to_32(ext, &ext_l); + //inplace_XExtDisplayInfo_shrink(ret); //no need, XExtensionInfo will shrink XExtDisplayInfo in the process + return ret; +} + +EXPORT int my32_XextRemoveDisplay(x64emu_t* emu, void* ext, void* dpy) +{ + int ret = my->XextRemoveDisplay(inplace_XExtensionInfo_enlarge(ext), dpy); + inplace_XExtensionInfo_shrink(ext); + return ret; +} + +#if 0 +#ifdef ANDROID +#define NEEDED_LIBS "libX11.so", "libxcb.so", "libXau.so", "libdl.so", "libXdmcp.so" +#else +#define NEEDED_LIBS "libX11.so.6", "libxcb.so.1", "libXau.so.6", "libdl.so.2", "libXdmcp.so.6" +#endif +#endif + +#define CUSTOM_INIT \ + shminfos = kh_init(shminfo); + +#define CUSTOM_FINI \ + my_XShmSegmentInfo_t* info; \ + kh_foreach_value(shminfos, info, free(info)); \ + kh_destroy(shminfo, shminfos); \ + shminfos = NULL; + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibxext_private.h b/src/wrapped32/wrappedlibxext_private.h new file mode 100644 index 0000000..c52bfd4 --- /dev/null +++ b/src/wrapped32/wrappedlibxext_private.h @@ -0,0 +1,139 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(DPMSCapable, iFX) +GO(DPMSDisable, iFX) +GO(DPMSEnable, iFX) +GO(DPMSForceLevel, iFXW) +GO(DPMSGetTimeouts, iFXppp) +GO(DPMSGetVersion, iFXpp) +GO(DPMSInfo, iFXpp) +GO(DPMSQueryExtension, iFXpp) +GO(DPMSSetTimeouts, iFXWWW) +GO(XagCreateAssociation, iFXbL_p) +GO(XagCreateEmbeddedApplicationGroup, iFXLLLLbL_) +GO(XagCreateNonembeddedApplicationGroup, iFXbL_) +GO(XagDestroyApplicationGroup, iFXL) +GO(XagDestroyAssociation, iFXL) +//GOM(XagGetApplicationGroupAttributes, iFEXLV) +GO(XagQueryApplicationGroup, iFXLbL_) +GO(XagQueryVersion, iFXpp) +//GO(XcupGetReservedColormapEntries, iFXibbLWWWcc__p) +GO(XcupQueryVersion, iFXpp) +GO(XcupStoreColors, iFXLbLWWWcc_i) +GO(XdbeAllocateBackBufferName, LFXLC) +GO(XdbeBeginIdiom, iFX) +GO(XdbeDeallocateBackBufferName, iFXL) +GO(XdbeEndIdiom, iFX) +GOM(XdbeFreeVisualInfo, vFEp) +GO(XdbeGetBackBufferAttributes, pFXL) // return a pointer to a struct (allocated) with only an XID, no need to wrap here +GOM(XdbeGetVisualInfo, pFEXpp) +GO(XdbeQueryExtension, iFXpp) +GO(XdbeSwapBuffers, iFXbLC_i) +//GO(XeviGetVisualInfo, iFXbL_ibbLiiuuuuubL___p) +GO(XeviQueryExtension, iFX) +GO(XeviQueryVersion, iFXpp) +GOM(XextAddDisplay, pFEpXppip) +GOM(XextCreateExtension, pFEv) +GOM(XextDestroyExtension, vFEp) +//DATAB(_XExtensionErrorFunction, 4) +GOM(XextFindDisplay, pFEpX) +GOM(XextRemoveDisplay, iFEpX) +GO(XGEQueryExtension, iFXpp) +GO(XGEQueryVersion, iFXpp) +GO(XLbxGetEventBase, iFX) +GO(XLbxQueryExtension, iFXppp) +GO(XLbxQueryVersion, iFXpp) +GO(XmbufChangeBufferAttributes, vFXLLbL_) +GO(XmbufChangeWindowAttributes, vFXLLp) +GO(XmbufClearBufferArea, vFXLiiuui) +GO(XmbufCreateBuffers, iFXLiiibL_) +//GOM(XmbufCreateStereoWindow, LFEXLiiuuuiubpLiLLLii_LbLLLLiiiLLilliLL_bL_bL_) +GO(XmbufDestroyBuffers, vFXL) +GO(XmbufDisplayBuffers, vFXibL_ii) +GO(XmbufGetBufferAttributes, iFXLbLLii_) +//GO(XmbufGetScreenInfo, iFXLpbbLii__pbbLii__) +GO(XmbufGetVersion, iFXpp) +//GO(XmbufGetWindowAttributes, iFXLbiiiiibL__) +GO(XmbufQueryExtension, iFXpp) +GO(XMissingExtension, iFXp) +GO(XMITMiscGetBugMode, iFX) +GO(XMITMiscQueryExtension, iFXpp) +GO(XMITMiscSetBugMode, iFXi) +//GO(XSecurityAllocXauth, bWWpWpWpWp_Fv) +GO(XSecurityFreeXauth, vFbWWpWpWpWp_) +//GO(XSecurityGenerateAuthorization, bWWpWpWpWp_FXbWWpWpWpWp_LbuuLl_bL_) +GO(XSecurityQueryExtension, iFXpp) +GO(XSecurityRevokeAuthorization, iFXL) +GOM(XSetExtensionErrorHandler, pFEp) +GO(XShapeCombineMask, vFXLiiiLi) +GO(XShapeCombineRectangles, vFXLiiipiii) +GO(XShapeCombineRegion, vFXLiiipi) +GO(XShapeCombineShape, vFXLiiiLii) +GO(XShapeGetRectangles, pFXLipp) +GO(XShapeInputSelected, LFXL) +GO(XShapeOffsetShape, vFXLiii) +GO(XShapeQueryExtension, iFXpp) +GO(XShapeQueryExtents, iFXLpppppppppp) +GO(XShapeQueryVersion, iFXpp) +GO(XShapeSelectInput, vFXLL) +GOM(XShmAttach, iFEXp) //!\ use shminfo +GOM(XShmCreateImage, pFEXbpLiLLLii_uippuu) //!\ use shminfo +GOM(XShmCreatePixmap, LFEXLppuuu) //!\ use shminfo +GOM(XShmDetach, iFEXp) //!\ use shminfo +GO(XShmGetEventBase, iFX) +GOM(XShmGetImage, iFEXLpiiL) +GO(XShmPixmapFormat, iFX) +GOM(XShmPutImage, iFEXLppiiiiuui) +GO(XShmQueryExtension, iFX) +GO(XShmQueryVersion, iFXppp) +//GO(XSyncAwait, iFppi) +GO(XSyncAwaitFence, iFXbL_i) +//GO(XSyncChangeAlarm, iFpLLp) +//GO(XSyncChangeCounter, iFpuU) +//GO(XSyncCreateAlarm, LFpLp) // XSyncAlarm is an XID +GO(XSyncCreateCounter, LFXU) // XSyncValue is a struct of 2 int +GO(XSyncCreateFence, LFXLi) +GO(XSyncDestroyAlarm, iFXL) +GO(XSyncDestroyCounter, iFXL) +GO(XSyncDestroyFence, iFXL) +//GO(XSyncFreeSystemCounterList, vFp) +GO(XSyncGetPriority, iFXLp) +GO(XSyncInitialize, iFXpp) +GO(XSyncIntsToValue, vFpui) +GO(XSyncIntToValue, vFpi) +//GOS(XSyncListSystemCounters, bpLp_FXp) +GO(XSyncMaxValue, vFp) +GO(XSyncMinValue, vFp) +//GO(XSyncQueryAlarm, iFpLp) +GO(XSyncQueryCounter, iFXLp) +GO(XSyncQueryExtension, iFXpp) +GO(XSyncQueryFence, iFXLp) +GO(XSyncResetFence, iFXL) +GO(XSyncSetCounter, iFXLU) // XSyncCounter is an XID +GO(XSyncSetPriority, iFXLi) +GO(XSyncTriggerFence, iFXL) +//GO(XSyncValueAdd, +//GO(XSyncValueEqual, +//GO(XSyncValueGreaterOrEqual, +//GO(XSyncValueGreaterThan, +//GO(XSyncValueHigh32, +GO(XSyncValueIsNegative, iFU) +GO(XSyncValueIsPositive, iFU) +GO(XSyncValueIsZero, iFU) +//GO(XSyncValueLessOrEqual, +//GO(XSyncValueLessThan, +//GO(XSyncValueLow32, +//GO(XSyncValueSubtract, +//DATA(XTestFakeAckType, 4) +GO(XTestFakeInput, iFXpii) +GO(XTestFlush, iFX) +GO(XTestGetInput, iFXi) +//DATAB(XTestInputActionType, 4) +GO(XTestMovePointer, iFXibL_ppu) +GO(XTestPressButton, iFXiLuu) +GO(XTestPressKey, iFXiLuu) +GO(XTestQueryInputSize, iFXbL_) +GO(XTestReset, iFX) +GO(XTestStopInput, iFX) diff --git a/src/wrapped32/wrappedlibxfixes.c b/src/wrapped32/wrappedlibxfixes.c new file mode 100644 index 0000000..5745955 --- /dev/null +++ b/src/wrapped32/wrappedlibxfixes.c @@ -0,0 +1,77 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "converter32.h" + +#ifdef ANDROID + static const char* libxfixesName = "libXfixes.so"; +#else + static const char* libxfixesName = "libXfixes.so.3"; +#endif + +#define LIBNAME libxfixes + +#include "libtools/my_x11_conv.h" + +#include "generated/wrappedlibxfixestypes32.h" + +#include "wrappercallback32.h" + +EXPORT int my32_XFixesQueryExtension(x64emu_t* emu, void* dpy, int* event_base, int* error_base) +{ + int ret = my->XFixesQueryExtension(dpy, event_base, error_base); + if(!ret) return ret; + + register_XFixes_events(*event_base); + return ret; +} + +EXPORT void* my32_XFixesGetCursorImage(x64emu_t* emu, void* dpy) +{ + void* ret = my->XFixesGetCursorImage(dpy); + if(ret) { + my_XFixesCursorImage_t* src = ret; + my_XFixesCursorImage_32_t* dst = ret; + for(size_t i=0; iwidth*src->height; ++i) + ((ulong_t*)src->pixels)[i] = to_ulong_silent(src->pixels[i]); + dst->x = src->x; + dst->y = src->y; + dst->width = src->width; + dst->height = src->height; + dst->xhot = src->xhot; + dst->cursor_serial = src->cursor_serial; + dst->pixels = to_ptrv(src->pixels); + // should check if v2 here! + dst->atom = to_ulong(src->atom); + dst->name = to_ptrv(src->name); + } + return ret; +} + +#if 0 +#ifdef ANDROID +#define NEEDED_LIBS "libX11.so", "libxcb.so", "libXau.so", "libXdmcp.so" +#else +#define NEEDED_LIBS "libX11.so.6", "libxcb.so.1", "libXau.so.6", "libXdmcp.so.6" +#endif +#endif + +#define CUSTOM_FINI \ + unregister_XFixes_events(); + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibxfixes_private.h b/src/wrapped32/wrappedlibxfixes_private.h new file mode 100644 index 0000000..54c62e7 --- /dev/null +++ b/src/wrapped32/wrappedlibxfixes_private.h @@ -0,0 +1,42 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(XFixesChangeCursor, vFXLL) +GO(XFixesChangeCursorByName, vFXLp) +GO(XFixesChangeSaveSet, vFXLiii) +GO(XFixesCopyRegion, vFXLL) +GO(XFixesCreatePointerBarrier, LFXLiiiiiip) +GO(XFixesCreateRegion, LFXpi) +GO(XFixesCreateRegionFromBitmap, LFXL) +GO(XFixesCreateRegionFromGC, LFXp) +GO(XFixesCreateRegionFromPicture, LFXL) +GO(XFixesCreateRegionFromWindow, LFXLi) +GO(XFixesDestroyPointerBarrier, vFXL) +GO(XFixesDestroyRegion, vFXL) +GO(XFixesExpandRegion, vFXLLuuuu) +//DATA(XFixesExtensionInfo, sizeof(ptr_t)) //B +//DATA(XFixesExtensionName, sizeof(ptr_t)) //D +GO(XFixesFetchRegion, pFXLp) +GO(XFixesFetchRegionAndBounds, pFXLpp) +//GO(XFixesFindDisplay, pFp) +GOM(XFixesGetCursorImage, pFEX) +GO(XFixesGetCursorName, pFXLbL_) +GO(XFixesHideCursor, vFXL) +GO(XFixesIntersectRegion, vFXLLL) +GO(XFixesInvertRegion, vFXLpL) +GOM(XFixesQueryExtension, iFEXpp) +GO(XFixesQueryVersion, iFXpp) +GO(XFixesRegionExtents, vFXLL) +GO(XFixesSelectCursorInput, vFXLL) +GO(XFixesSelectSelectionInput, vFXLLL) +GO(XFixesSetCursorName, vFXLp) +GO(XFixesSetGCClipRegion, vFXpiiL) +GO(XFixesSetPictureClipRegion, vFXLiiL) +GO(XFixesSetRegion, vFXLpi) +GO(XFixesSetWindowShapeRegion, vFXLiiiL) +GO(XFixesShowCursor, vFXL) +GO(XFixesSubtractRegion, vFXLLL) +GO(XFixesTranslateRegion, vFXLii) +GO(XFixesUnionRegion, vFXLLL) +GO(XFixesVersion, iFv) diff --git a/src/wrapped32/wrappedlibxi.c b/src/wrapped32/wrappedlibxi.c new file mode 100644 index 0000000..9f20e27 --- /dev/null +++ b/src/wrapped32/wrappedlibxi.c @@ -0,0 +1,166 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "converter32.h" + +#ifdef ANDROID + static const char* libxiName = "libXi.so"; +#else + static const char* libxiName = "libXi.so.6"; +#endif + +#define LIBNAME libxi + +#ifdef ANDROID +#define NEEDED_LIBS "libX11.so", "libXext.so" +#else +#define NEEDED_LIBS "libX11.so.6", "libXext.so.6" +#endif + +#include "libtools/my_x11_conv.h" + +#include "generated/wrappedlibxitypes32.h" + +#include "wrappercallback32.h" + +int my32_xinput_opcode = 0; // used to expand XEvenCookie data + +EXPORT void* my32_XIQueryDevice(x64emu_t* emu, void* dpy, int deviceid, int* ndevices) +{ + void* ret = my->XIQueryDevice(dpy, deviceid, ndevices); + inplace_XIDeviceInfo_shrink(ret, *ndevices); + return ret; +} + +EXPORT void my32_XIFreeDeviceInfo(x64emu_t* emu, void* d) +{ + inplace_XIDeviceInfo_enlarge(d); + my->XIFreeDeviceInfo(d); +} + +EXPORT int my32_XISelectEvents(x64emu_t* emu, void* dpy, XID window, my_XIEventMask_32_t* masks, int num) +{ + my_XIEventMask_t masks_l[num]; + for(int i=0; iXISelectEvents(dpy, window, masks_l, num); +} + +EXPORT void* my32_XIGetSelectedEvents(x64emu_t* emu, void* dpy, XID window, int* num) +{ + void* ret = my->XIGetSelectedEvents(dpy, window, num); + if(!ret) return NULL; + //inplace shrink + my_XIEventMask_t* src = ret; + my_XIEventMask_32_t* dst = ret; + for(int i=0; i<*num; ++i, ++src, ++dst) { + dst->deviceid = src->deviceid; + dst->mask_len = src->mask_len; + dst->mask = to_ptrv(src->mask); + } + return ret; +} + +EXPORT void* my32_XOpenDevice(x64emu_t* emu, void* dpy, XID id) +{ + void* ret = my->XOpenDevice(dpy, id); + register_XDevice_events(ret); + inplace_XDevice_shrink(ret); + return ret; +} + +EXPORT int my32_XCloseDevice(x64emu_t* emu, void* dpy, void* d) +{ + inplace_XDevice_enlarge(d); + unregister_XDevice_events(d); + return my->XCloseDevice(dpy, d); +} + +EXPORT int my32_XGetDeviceButtonMapping(x64emu_t* emu, void* dpy, void* d, void* map, int nmap) +{ + inplace_XDevice_enlarge(d); + return my->XGetDeviceButtonMapping(dpy, d, map, nmap); + inplace_XDevice_shrink(d); +} + +EXPORT void* my32_XQueryDeviceState(x64emu_t* emu, void* dpy, void* d) +{ + void* ret = inplace_XDeviceState_shrink(my->XQueryDeviceState(dpy, inplace_XDevice_enlarge(d))); + inplace_XDevice_shrink(d); + return ret; +} + +EXPORT void my32_XFreeDeviceState(x64emu_t* emu, void* ds) +{ + my->XFreeDeviceState(inplace_XDeviceState_enlarge(ds)); +} + +EXPORT void* my32_XListInputDevices(x64emu_t* emu, void* dpy, int* n) +{ + void* ret = my->XListInputDevices(dpy, n); + return inplace_XDeviceInfo_shrink(ret, *n); +} + +EXPORT void my32_XFreeDeviceList(x64emu_t* emu, void* l) +{ + my->XFreeDeviceList(inplace_XDeviceInfo_enlarge(l)); +} + +EXPORT void* my32_XGetDeviceMotionEvents(x64emu_t* emu, void* dpy, void* d, unsigned long start, unsigned long stop, int* n, int* mode, int* axis) +{ + void* ret = my->XGetDeviceMotionEvents(dpy, inplace_XDevice_enlarge(d), start, stop, n, mode, axis); + inplace_XDevice_shrink(d); + if(ret) { + my_XDeviceTimeCoord_t* src = ret; + my_XDeviceTimeCoord_32_t* dst = ret; + for(int i=0; i<*n; ++i) { + dst[i].time = to_ulong(src[i].time); + dst[i].data = to_ptrv(src[i].data); + } + if(*n) { + dst[*n].time = 0; dst[*n].data = 0; // mark the end + } + } + return ret; +} + +EXPORT void my32_XFreeDeviceMotionEvents(x64emu_t* emu, void* l) +{ + int n=0; + my_XDeviceTimeCoord_32_t* src = l; + my_XDeviceTimeCoord_t* dst = l; + // search length first + while(src[n].time || src[n].data) ++n; + for(int i=n; i>=0; --i) { + dst[i].data = from_ptrv(src[i].data); + dst[i].time = from_ulong(src[i].time); + } + return my->XFreeDeviceMotionEvents(l); +} + +EXPORT int my32_XGrabDevice(x64emu_t* emu, void* dpy, void* d, XID w, int owner, int count, void* evt, int this_mode, int other_modes, unsigned long time) +{ + int ret = my->XGrabDevice(dpy, inplace_XDevice_enlarge(d), w, owner, count, evt, this_mode, other_modes, time); + inplace_XDevice_shrink(d); + return ret; +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibxi_private.h b/src/wrapped32/wrappedlibxi_private.h new file mode 100644 index 0000000..95cab5c --- /dev/null +++ b/src/wrapped32/wrappedlibxi_private.h @@ -0,0 +1,90 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +// XEventClass is a 32bits value, on 32bits and 64bits version, no need to wrap + +//GO(XAllowDeviceEvents, iFXbLip_iL) +//GO(XChangeDeviceControl, iFXbLip_ibLi_) +//GO(XChangeDeviceDontPropagateList, iFXLibL_i) +//GO(XChangeDeviceKeyMapping, iFXbLip_iibL_i) +//GO(XChangeDeviceProperty, vFXbLip_LLiipi) +//GO(XChangeFeedbackControl, iFXbLip_LbLiL_) +//GO(XChangeKeyboardDevice, iFXbLip_) +//GO(XChangePointerDevice, iFXbLip_ii) +GOM(XCloseDevice, iFEXp) +//GO(XDeleteDeviceProperty, vFXbLip_L) +//GO(XDeviceBell, iFXbLip_LLi) +//GO(XFreeDeviceControl, vFbLi_) +GOM(XFreeDeviceList, vFEp) +GOM(XFreeDeviceMotionEvents, vFEp) +GOM(XFreeDeviceState, vFEp) +//GO(XFreeFeedbackList, vFbLiL_) +GOM(XGetDeviceButtonMapping, iFEXppu) +//GO(XGetDeviceControl, bLi_FXbLip_i) +//GO(XGetDeviceDontPropagateList, bL_FXLp) +//GO(XGetDeviceFocus, iFXbLip_bL_pbL_) +//GO(XGetDeviceKeyMapping, bL_FXbLip_Cip) +//GO(XGetDeviceModifierMapping, bip_FXbLip_) +GOM(XGetDeviceMotionEvents, pFEXpLLppp) +//GO(XGetDeviceProperty, iFXbLip_LlliLbL_pbL_bL_bp_) +GO(XGetExtensionVersion, pFXp) +//GO(XGetFeedbackControl, bLiL_FXbLip_p) +//GO(XGetSelectedExtensionEvents, iFXLpbbL__pbbL__) +GOM(XGrabDevice, iFEXpLiipiiL) +//GO(XGrabDeviceButton, iFXbLip_uubLip_LiubL_ii) +//GO(XGrabDeviceKey, iFXbLip_uubLip_LiubL_ii) +GO(XIAllowEvents, iFXiiL) +GO(XIAllowTouchEvents, iFXiuLi) +GO(XIBarrierReleasePointer, vFXiLu) +//GO(XIBarrierReleasePointers, vFXbiLu_i) +//GO(XIChangeHierarchy, iFppi) +GO(XIChangeProperty, vFXiLLiipi) +GO(XIDefineCursor, iFXiLL) +GO(XIDeleteProperty, vFXiL) +GOM(XIFreeDeviceInfo, vFEp) +GO(XIGetClientPointer, iFXLp) +GO(XIGetFocus, iFXibL_) +GO(XIGetProperty, iFXiLlliLBL_pBL_BL_bp_) +GOM(XIGetSelectedEvents, pFEXLp) +GO(XIGrabButton, iFXiiLLiiibiip_ip) +GO(XIGrabDevice, iFXiLLLiiibiip_) +GO(XIGrabEnter, iFXiLLiiibiip_ip) +GO(XIGrabFocusIn, iFXiLiiibiip_ip) +GO(XIGrabKeycode, iFXiiLiiibiip_ip) +GO(XIGrabTouchBegin, iFXiLibiip_ip) +//GO(XIListProperties, bL_FXip) +GOM(XIQueryDevice, pFEXip) +GO(XIQueryPointer, iFXiLbL_bL_ppppbip_pp) +GO(XIQueryVersion, iFXpp) +GOM(XISelectEvents, iFEXLpi) +GO(XISetClientPointer, iFXLi) +GO(XISetFocus, iFXiLL) +GO(XIUndefineCursor, iFXiL) +GO(XIUngrabButton, iFXiiLip) +GO(XIUngrabDevice, iFXiL) +GO(XIUngrabEnter, iFXiLip) +GO(XIUngrabFocusIn, iFXiLip) +GO(XIUngrabKeycode, iFXiiLip) +GO(XIUngrabTouchBegin, iFXiLip) +GO(XIWarpPointer, iFXiLLdduudd) +//GO(XListDeviceProperties, bL_FXbLip_p) +GOM(XListInputDevices, pFEXp) +GOM(XOpenDevice, pFEXL) +GOM(XQueryDeviceState, pFEXp) +GO(XSelectExtensionEvent, iFXLpi) +//GO(XSendExtensionEvent, iFppLiipp) +//GO(XSetDeviceButtonMapping, iFXbLip_pi) +//GO(XSetDeviceFocus, iFXbLip_LiL) +//GO(XSetDeviceMode, iFXbLip_i) +//GO(XSetDeviceModifierMapping, iFXbLip_bip_) +//GO(XSetDeviceValuators, iFXbLip_pii) +GO(XUngrabDevice, iFXbLip_L) +GO(XUngrabDeviceButton, iFXbLip_uubLip_L) +GO(XUngrabDeviceKey, iFXbLip_uubLip_L) +GO(_XiGetDevicePresenceNotifyEvent, iFX) +GO(_xibadclass, vFXp) +GO(_xibaddevice, vFXp) +GO(_xibadevent, vFXp) +GO(_xibadmode, vFXp) +GO(_xidevicebusy, vFXp) diff --git a/src/wrapped32/wrappedlibxrandr.c b/src/wrapped32/wrappedlibxrandr.c new file mode 100644 index 0000000..efc46f3 --- /dev/null +++ b/src/wrapped32/wrappedlibxrandr.c @@ -0,0 +1,203 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" + +#ifdef ANDROID + static const char* libxrandrName = "libXrandr.so"; +#else + static const char* libxrandrName = "libXrandr.so.2"; +#endif + +#define LIBNAME libxrandr + +#include "libtools/my_x11_conv.h" + +#include "generated/wrappedlibxrandrtypes32.h" + +#include "wrappercallback32.h" + +EXPORT void* my32_XRRGetScreenResources(x64emu_t* emu, void* dpy, XID window) +{ + void* ret = my->XRRGetScreenResources(dpy, window); + inplace_XRRScreenResources_shrink(ret); + return ret; +} + +EXPORT void* my32_XRRGetScreenResourcesCurrent(x64emu_t* emu, void* dpy, XID window) +{ + void* ret = my->XRRGetScreenResourcesCurrent(dpy, window); + inplace_XRRScreenResources_shrink(ret); + return ret; +} + +EXPORT int my32_XRRSetCrtcConfig(x64emu_t* emu, void* dpy, void* res, XID crtc, unsigned long timestamp, int x, int y, XID mode, uint16_t rotation, XID_32* outputs, int noutputs) +{ + XID outputs_l[noutputs]; + if(outputs) + for(int i=0; iXRRSetCrtcConfig(dpy, res, crtc, timestamp, x, y, mode, rotation, outputs?(&outputs_l):NULL, noutputs); + inplace_XRRScreenResources_shrink(res); + return ret; +} + +EXPORT void* my32_XRRGetPanning(x64emu_t* emu, void* dpy, void* res, XID crtc) +{ + inplace_XRRScreenResources_enlarge(res); + void* ret = my->XRRGetPanning(dpy, res, crtc); + inplace_XRRScreenResources_shrink(res); + if(ret) { + // shrink XRRPanning: L and 12i + *(ulong_t*)res = to_ulong(*(unsigned long*)res); + memmove(res+4, res+8, 12*4); + } + return ret; +} + +EXPORT int my32_XRRSetPanning(x64emu_t* emu, void* dpy, void* res, XID crtc, void* panning) +{ + inplace_XRRScreenResources_enlarge(res); + // enlarge panning + { + unsigned long timestamp = from_ulong(*(ulong_t*)panning); + memmove(panning+8, panning+4, 12*4); + *(unsigned long*)panning = timestamp; + } + int ret = my->XRRSetPanning(dpy, res, crtc, panning); + inplace_XRRScreenResources_shrink(res); + { + // shrink XRRPanning: L and 12i + *(ulong_t*)panning = to_ulong(*(unsigned long*)panning); + memmove(panning+4, panning+8, 12*4); + } + return ret; +} + +EXPORT void* my32_XRRGetCrtcInfo(x64emu_t* emu, void* dpy, void* res, XID crtc) +{ + inplace_XRRScreenResources_enlarge(res); + void* ret = my->XRRGetCrtcInfo(dpy, res, crtc); + inplace_XRRScreenResources_shrink(res); + inplace_XRRCrtcInfo_shrink(ret); + return ret; +} + +EXPORT void* my32_XRRGetOutputInfo(x64emu_t* emu, void* dpy, void* res, XID window) +{ + inplace_XRRScreenResources_enlarge(res); + void* ret = my->XRRGetOutputInfo(dpy, res, window); + inplace_XRRScreenResources_shrink(res); + inplace_XRROutputInfo_shrink(ret); + return ret; +} + +EXPORT void* my32_XRRGetProviderInfo(x64emu_t* emu, void* dpy, void* res, XID provider) +{ + inplace_XRRScreenResources_enlarge(res); + void* ret = my->XRRGetProviderInfo(dpy, res, provider); + inplace_XRRScreenResources_shrink(res); + inplace_XRRProviderInfo_shrink(ret); + return ret; +} + +EXPORT void my32_XRRFreeProviderInfo(x64emu_t* emu, void* r) +{ + inplace_XRRProviderInfo_enlarge(r); + my->XRRFreeProviderInfo(r); +} + +EXPORT void* my32_XRRGetProviderResources(x64emu_t* emu, void* dpy, XID window) +{ + void* ret = my->XRRGetProviderResources(dpy, window); + inplace_XRRProviderResources_shrink(ret); + return ret; +} + +EXPORT void my32_XRRFreeProviderResources(x64emu_t* emu, void* r) +{ + inplace_XRRProviderResources_enlarge(r); + my->XRRFreeProviderResources(r); +} + +EXPORT void* my32_XRRListOutputProperties(x64emu_t* emu, void* dpy, XID out, int* num) +{ + XID* ret = my->XRRListOutputProperties(dpy, out, num); + if(!ret) return NULL; + XID_32* ret_s = (XID_32*)ret; + for(int i=0; i<*num; ++i) + ret_s[i] = to_ulong(ret[i]); + return ret; +} + +EXPORT void* my32_XRRQueryOutputProperty(x64emu_t* emu, void* dpy, XID output, XID prop) +{ + void* ret = my->XRRQueryOutputProperty(dpy, output, prop); + return inplace_XRRPropertyInfo_shrink(ret); +} + +EXPORT int my32_XRRQueryExtension(x64emu_t* emu, void* dpy, int* event_base, int* error_base) +{ + int fallabck; + int *event = event_base?event_base:&fallabck; + int ret = my->XRRQueryExtension(dpy, event, error_base); + if(!ret) return ret; + register_XRandR_events(*event); + return ret; +} + +EXPORT int my32_XRRUpdateConfiguration(x64emu_t* emu, my_XEvent_32_t* evt) +{ + my_XEvent_t evt_l = {0}; + unconvertXEvent(&evt_l, evt); + return my->XRRUpdateConfiguration(&evt_l); +} + +EXPORT void* my32_XRRGetMonitors(x64emu_t* emu, void* dpy, XID window, int get_active, int* nmonitors) +{ + void* ret = my->XRRGetMonitors(dpy, window, get_active, nmonitors); + return inplace_XRRMonitorInfo_shrink(ret, *nmonitors); +} + +EXPORT void my32_XRRFreeMonitors(x64emu_t* emu, void* monitors) +{ + if(!monitors) return; + int n = 0; + while(((my_XRRMonitorInfo_32_t*)monitors)[n].name) ++n; + my->XRRFreeMonitors(inplace_XRRMonitorInfo_enlarge(monitors, n)); +} + +EXPORT int my32_XRRGetCrtcTransform(x64emu_t* emu, void* dpy, XID crtc, ptr_t* attributes) +{ + void* attributes_l = NULL; + int ret = my->XRRGetCrtcTransform(dpy, crtc, &attributes_l); + inplace_XRRCrtcTransformAttributes_shrink(attributes_l); + *attributes = to_ptrv(attributes_l); + return ret; +} + +#ifdef ANDROID +#define NEEDED_LIBS "libX11.so", "libXext.so", "libXrender.so" +#else +#define NEEDED_LIBS "libX11.so.6", "libXext.so.6", "libXrender.so.1" +#endif + +#define CUSTOM_FINI \ + unregister_XRandR_events(); + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibxrandr_private.h b/src/wrapped32/wrappedlibxrandr_private.h new file mode 100644 index 0000000..feb7081 --- /dev/null +++ b/src/wrapped32/wrappedlibxrandr_private.h @@ -0,0 +1,73 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(XRRQueryVersion, iFXpp) +GO(XRRFreeScreenConfigInfo, vFp) +GOM(XRRGetCrtcInfo, pFEXpL) +GOM(XRRListOutputProperties, pFEXLp) +GOM(XRRQueryExtension, iFEXpp) +//GO(XRRAllocModeInfo, bLuuLuuuuuuupuL_Fpi) +//GO(XRRGetProviderProperty, iFXLLlliiLbL_pbL_bL_bp_) +//GO(XRRListProviderProperties, bL_FXLp) +GO(XRRRotations, WFXip) +GO(XRRSetCrtcTransform, vFXLpppi) +GO(XRRGetCrtcGammaSize, iFXL) +GO(XRRConfigRotations, WFpp) +GOM(XRRGetProviderInfo, pFEXpL) +GO(XRRConfigureOutputProperty, vFXLLiiibl_) +GO(XRRSetOutputPrimary, vFXLL) +GO(XRRFreeOutputInfo, vFp) +GOM(XRRUpdateConfiguration, iFEp) +GOM(XRRGetScreenResources, pFEXL) +GO(XRRConfigSizes, pFpp) +//GO(XRRQueryProviderProperty, biiiibl__FXLL) +GO(XRRDeleteOutputProperty, vFXLL) +GO(XRRDeleteProviderProperty, vFXLL) +GO(XRRSetScreenConfig, iFXpLiWL) +//GO(XRRAllocGamma, bippp_Fi) +GO(XRRSetScreenSize, vFXLiiii) +GO(XRRSetScreenConfigAndRate, iFXpLiWwL) +GO(XRRFreeScreenResources, vFp) +GO(XRRGetOutputPrimary, LFXL) +//GO(XRRCreateMode, LFXLbLuuLuuuuuuupuL_) +GO(XRRConfigCurrentRate, wFp) +GO(XRRDestroyMode, vFXL) +GOM(XRRSetCrtcConfig, iFEXpLLiiLWpi) +GO(XRRConfigCurrentConfiguration, WFpp) +GO(XRRSizes, pFXip) +GO(XRRAddOutputMode, vFXLL) +GO(XRRFreePanning, vFp) +GOM(XRRFreeProviderResources, vFEp) +GO(XRRChangeProviderProperty, vFXLLLiipi) +GOM(XRRGetPanning, pFEXpL) +GO(XRRSetProviderOffloadSink, iFXLL) +GOM(XRRGetScreenResourcesCurrent, pFEXL) +GO(XRRConfigTimes, LFpbL_) +//GO(XRRSetCrtcGamma, vFXLbippp_) +GO(XRRSetProviderOutputSource, iFXLL) +GO(XRRGetScreenSizeRange, iFXLpppp) +GO(XRRRates, pFXiip) +GOM(XRRFreeProviderInfo, vFEp) +GO(XRRConfigRates, pFpip) +GOM(XRRQueryOutputProperty, pFEXLL) +GO(XRRGetOutputProperty, iFXLLlliiLBL_pBL_BL_Bp_) +//GO(XRRFreeGamma, vFbippp_) +GO(XRRRootToScreen, iFXL) +GO(XRRGetScreenInfo, pFXL) +GO(XRRFreeCrtcInfo, vFp) +GOM(XRRGetProviderResources, pFEXL) +//GO(XRRFreeModeInfo, vFbLuuLuuuuuuupuL_) +GO(XRRChangeOutputProperty, vFXLLLiipi) +//GO(XRRGetCrtcGamma, bippp_FXL) +GOM(XRRSetPanning, iFEXpLp) +GO(XRRSelectInput, vFXLi) +GOM(XRRGetCrtcTransform, iFEXLp) +//GO(XRRTimes, LFXibL_) +GO(XRRDeleteOutputMode, vFXLL) +GOM(XRRGetOutputInfo, pFEXpL) +GO(XRRConfigureProviderProperty, vFXLLiiibl_) +//GO(XRRAllocateMonitor, bLiiiiiiiiibL__FXi) +GOM(XRRGetMonitors, pFEXLip) +//GO(XRRSetMonitor, vFXLbLiiiiiiiiibL__) +GOM(XRRFreeMonitors, vFEp) diff --git a/src/wrapped32/wrappedlibxrender.c b/src/wrapped32/wrappedlibxrender.c new file mode 100644 index 0000000..fbba050 --- /dev/null +++ b/src/wrapped32/wrappedlibxrender.c @@ -0,0 +1,105 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "converter32.h" + +#ifdef ANDROID + static const char* libxrenderName = "libXrender.so"; +#else + static const char* libxrenderName = "libXrender.so.1"; +#endif + +#define LIBNAME libxrender + +#ifdef ANDROID +#define NEEDED_LIBS "libX11.so" +#else +#define NEEDED_LIBS "libX11.so.6" +#endif + +#include "libtools/my_x11_conv.h" + +#include "generated/wrappedlibxrendertypes32.h" + +#include "wrappercallback32.h" + +KHASH_MAP_INIT_INT64(picformat, void*); +static kh_picformat_t* hash_picformat; + +EXPORT void* my32_XRenderFindFormat(x64emu_t* emu, void* dpy, unsigned long mask, void* tmpl, int count) +{ + void* ret = my->XRenderFindFormat(dpy, mask, tmpl, count); + if(!ret) return NULL; + khint_t k = kh_get(picformat, hash_picformat, (uintptr_t)ret); + if(k!=kh_end(hash_picformat)) + return kh_value(hash_picformat, k); + int r; + k = kh_put(picformat, hash_picformat, (uintptr_t)ret, &r); + struct_LiiwwwwwwwwL_t* res = calloc(1, sizeof(struct_LiiwwwwwwwwL_t)); + to_struct_LiiwwwwwwwwL(to_ptrv(res), ret); + kh_value(hash_picformat, k) = res; + return res; +} + +EXPORT void* my32_XRenderFindStandardFormat(x64emu_t* emu, void* dpy, int fmt) +{ + void* ret = my->XRenderFindStandardFormat(dpy, fmt); + if(!ret) return NULL; + khint_t k = kh_get(picformat, hash_picformat, (uintptr_t)ret); + if(k!=kh_end(hash_picformat)) + return kh_value(hash_picformat, k); + int r; + k = kh_put(picformat, hash_picformat, (uintptr_t)ret, &r); + struct_LiiwwwwwwwwL_t* res = calloc(1, sizeof(struct_LiiwwwwwwwwL_t)); + to_struct_LiiwwwwwwwwL(to_ptrv(res), ret); + kh_value(hash_picformat, k) = res; + return res; +} + +EXPORT void* my32_XRenderFindVisualFormat(x64emu_t* emu, void* dpy, void* visual) +{ + void* ret = my->XRenderFindVisualFormat(dpy, convert_Visual_to_64(dpy, visual)); + if(!ret) return NULL; + khint_t k = kh_get(picformat, hash_picformat, (uintptr_t)ret); + if(k!=kh_end(hash_picformat)) + return kh_value(hash_picformat, k); + int r; + k = kh_put(picformat, hash_picformat, (uintptr_t)ret, &r); + struct_LiiwwwwwwwwL_t* res = calloc(1, sizeof(struct_LiiwwwwwwwwL_t)); + to_struct_LiiwwwwwwwwL(to_ptrv(res), ret); + kh_value(hash_picformat, k) = res; + return res; +} + +EXPORT void* my32_XRenderQueryFilters(x64emu_t* emu, void* dpy, unsigned long drawable) +{ + void* ret = my->XRenderQueryFilters(dpy, drawable); + return inplace_XFilters_shrink(ret); +} + +#define CUSTOM_INIT \ + hash_picformat = kh_init(picformat); \ + +#define CUSTOM_FINI \ + void* p; \ + kh_foreach_value(hash_picformat, p, free(p)); \ + kh_destroy(picformat, hash_picformat); \ + hash_picformat = NULL; \ + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibxrender_private.h b/src/wrapped32/wrappedlibxrender_private.h new file mode 100644 index 0000000..746386e --- /dev/null +++ b/src/wrapped32/wrappedlibxrender_private.h @@ -0,0 +1,55 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +// XRenderPictureAttributes = iLiiiiLiiiiLi +// XRenderDirectFormat = wwwwwwww +// XRenderPictFormat = LiiwwwwwwwwL + +GO(XRenderAddGlyphs, vFXLppipi) +GO(XRenderAddTraps, vFXLiipi) +GO(XRenderChangePicture, vFXLLp) +GO(XRenderComposite, vFXiLLLiiiiiiuu) +GO(XRenderCompositeDoublePoly, vFXiLLpiiiipii) +GO(XRenderCompositeString16, vFXiLLrLiiwwwwwwwwL_Liiiipi) +GO(XRenderCompositeString32, vFXiLLrLiiwwwwwwwwL_Liiiipi) +GO(XRenderCompositeString8, vFXiLLrLiiwwwwwwwwL_Liiiipi) +GO(XRenderCompositeText16, vFXiLLrLiiwwwwwwwwL_iiiipi) +GO(XRenderCompositeText32, vFXiLLrLiiwwwwwwwwL_iiiipi) +GO(XRenderCompositeText8, vFXiLLrLiiwwwwwwwwL_iiiipi) +GO(XRenderCompositeTrapezoids, vFXiLLrLiiwwwwwwwwL_iipi) +GO(XRenderCompositeTriangles, vFXiLLpiipi) +GO(XRenderCompositeTriFan, vFXiLLpiipi) +GO(XRenderCompositeTriStrip, vFXiLLpiipi) +GO(XRenderCreateAnimCursor, LFXip) +GO(XRenderCreateConicalGradient, LFXpppi) +GO(XRenderCreateCursor, LFXLuu) +GO(XRenderCreateGlyphSet, LFXrLiiwwwwwwwwL_) +GO(XRenderCreateLinearGradient, LFXpppi) +GO(XRenderCreatePicture, LFXLrLiiwwwwwwwwL_LriLiiiiLiiiiLi_) +GO(XRenderCreateRadialGradient, LFXpppi) +GO(XRenderCreateSolidFill, LFXp) +//DATAB(XRenderExtensionInfo, sizeof(ptr_t)) +//DATA(XRenderExtensionName, sizeof(ptr_t)) //D +GO(XRenderFillRectangle, vFXiLpiiuu) +GO(XRenderFillRectangles, vFXiLppi) +//GO(XRenderFindDisplay, pFp) +GOM(XRenderFindFormat, pFEXLrLiiwwwwwwwwL_i) +GOM(XRenderFindStandardFormat, pFEXi) +GOM(XRenderFindVisualFormat, pFEXp) +GO(XRenderFreeGlyphs, vFXLpi) +GO(XRenderFreeGlyphSet, vFXL) +GO(XRenderFreePicture, vFXL) +GO(XRenderParseColor, iFXpp) +GO(XRenderQueryExtension, iFXpp) +GOM(XRenderQueryFilters, pFEXL) +GO(XRenderQueryFormats, iFX) +GO(XRenderQueryPictIndexValues, pFXrLiiwwwwwwwwL_p) +GO(XRenderQuerySubpixelOrder, iFXi) +GO(XRenderQueryVersion, iFXpp) +GO(XRenderReferenceGlyphSet, LFXL) +GO(XRenderSetPictureClipRectangles, vFXLiipi) +GO(XRenderSetPictureClipRegion, vFXLp) +GO(XRenderSetPictureFilter, vFXLppi) +GO(XRenderSetPictureTransform, vFXLp) +GO(XRenderSetSubpixelOrder, iFXii) diff --git a/src/wrapped32/wrappedlibxss.c b/src/wrapped32/wrappedlibxss.c new file mode 100644 index 0000000..dc5d9b0 --- /dev/null +++ b/src/wrapped32/wrappedlibxss.c @@ -0,0 +1,29 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "box32.h" + +#ifdef ANDROID + static const char* libxssName = "libXss.so"; +#else + static const char* libxssName = "libXss.so.1"; +#endif + +#define LIBNAME libxss + +#ifdef ANDROID +#define NEEDED_LIBS "libX11.so", "libXext.so" +#else +#define NEEDED_LIBS "libX11.so.6", "libXext.so.6" +#endif + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibxss_private.h b/src/wrapped32/wrappedlibxss_private.h new file mode 100644 index 0000000..8c98282 --- /dev/null +++ b/src/wrapped32/wrappedlibxss_private.h @@ -0,0 +1,15 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(XScreenSaverAllocInfo, pFv) +GO(XScreenSaverGetRegistered, iFXipp) +GO(XScreenSaverQueryExtension, iFXpp) +GO(XScreenSaverQueryInfo, iFXLp) +GO(XScreenSaverQueryVersion, iFXpp) +GO(XScreenSaverRegister, iFXiLL) +GO(XScreenSaverSelectInput, vFXLL) +//GO(XScreenSaverSetAttributes, vFXLiiuuuiupLp) +GO(XScreenSaverSuspend, vFXi) +GO(XScreenSaverUnregister, iFXi) +GO(XScreenSaverUnsetAttributes, vFXL) diff --git a/src/wrapped32/wrappedlibxxf86vm.c b/src/wrapped32/wrappedlibxxf86vm.c new file mode 100644 index 0000000..b04e3c4 --- /dev/null +++ b/src/wrapped32/wrappedlibxxf86vm.c @@ -0,0 +1,60 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" + +#ifdef ANDROID + static const char* libxxf86vmName = "libXxf86vm.so"; +#else + static const char* libxxf86vmName = "libXxf86vm.so.1"; +#endif + +#define LIBNAME libxxf86vm + +#ifdef ANDROID +#define NEEDED_LIBS "libX11.so", "libXext.so" +#else +#define NEEDED_LIBS "libX11.so.6", "libXext.so.6" +#endif + + +#include "libtools/my_x11_defs.h" +#include "libtools/my_x11_defs_32.h" + +#include "generated/wrappedlibxxf86vmtypes32.h" + +#include "wrappercallback32.h" + +EXPORT int my32_XF86VidModeGetAllModeLines(x64emu_t* emu, void* dpy, int screen, int* num, ptr_t* infos) +{ + my_XF86VidModeModeInfo_t** infos_l; + int ret = my->XF86VidModeGetAllModeLines(dpy, screen, num, &infos_l); + if(*num>0) { + *infos = to_ptrv(infos_l); + ptr_t* small = from_ptrv(*infos); + // shrink the array, the structure is fine + for(int i=0; i<*num; ++i) + small[i] = to_ptrv(infos_l[i]); + // no need to mark the end + //small[*num] = 0; + if(*num==1) + small[1] = small[0]; // duplicate the mode if only 1 exit (for Hercules6) + } + return ret; +} + +#include "wrappedlib_init32.h" \ No newline at end of file diff --git a/src/wrapped32/wrappedlibxxf86vm_private.h b/src/wrapped32/wrappedlibxxf86vm_private.h new file mode 100644 index 0000000..2abad1e --- /dev/null +++ b/src/wrapped32/wrappedlibxxf86vm_private.h @@ -0,0 +1,26 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(XF86VidModeGetViewPort, iFXipp) +//GO(XF86VidModeValidateModeLine, iFpip) +GO(XF86VidModeGetGamma, iFXip) +GO(XF86VidModeSetGamma, iFXip) +GO(XF86VidModeSetClientVersion, iFX) +GO(XF86VidModeGetGammaRamp, iFXiippp) +//GO(XF86VidModeGetMonitor, iFpip) +GO(XF86VidModeQueryVersion, iFXpp) +GO(XF86VidModeDeleteModeLine, iFXip) +GO(XF86VidModeGetModeLine, iFXipBWWWWWWWWWuip_) +GOM(XF86VidModeGetAllModeLines, iFEXipp) +GO(XF86VidModeSetGammaRamp, iFXiippp) +//GO(XF86VidModeGetPermissions, iFpip) +//GO(XF86VidModeModModeLine, iFpip) +GO(XF86VidModeSetViewPort, iFXiii) +GO(XF86VidModeSwitchMode, iFXii) +//GO(XF86VidModeAddModeLine, iFpipp) +GO(XF86VidModeSwitchToMode, iFXip) +GO(XF86VidModeQueryExtension, iFXpp) +GO(XF86VidModeGetGammaRampSize, iFXip) +//GO(XF86VidModeGetDotClocks, iFpipppp) +GO(XF86VidModeLockModeSwitch, iFXii) diff --git a/src/wrapped32/wrappedmount.c b/src/wrapped32/wrappedmount.c new file mode 100644 index 0000000..1f8ef5f --- /dev/null +++ b/src/wrapped32/wrappedmount.c @@ -0,0 +1,151 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "converter32.h" + +static const char* mountName = "libmount.so.1"; +#define LIBNAME mount + +#include "generated/wrappedmounttypes32.h" + +#include "wrappercallback32.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// cmp ... +#define GO(A) \ +static uintptr_t my32_cmp_fct_##A = 0; \ +static int my32_cmp_##A(void* a, void* b, void* c) \ +{ \ + return (int)RunFunctionFmt(my32_cmp_fct_##A, "ppp", a, b, c); \ +} +SUPER() +#undef GO +static void* find_cmp_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_cmp_fct_##A == (uintptr_t)fct) return my32_cmp_##A; + SUPER() + #undef GO + #define GO(A) if(my32_cmp_fct_##A == 0) {my32_cmp_fct_##A = (uintptr_t)fct; return my32_cmp_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libmount cmp callback\n"); + return NULL; +} + +#undef SUPER + +typedef struct my_libmnt_optmap_s +{ + /*const*/ char *name; + int id; + int mask; +} my_libmnt_optmap_t; +typedef struct my_libmnt_optmap_32_s +{ + ptr_t name; //const char * + int id; + int mask; +} my_libmnt_optmap_32_t; + +void convert_libmnt_optmap_32(void* d, void* s) +{ + if(!s || !d) return; + my_libmnt_optmap_t* src = s; + my_libmnt_optmap_32_t* dst = d; + dst->name = to_ptrv(src->name); + dst->id = src->id; + dst->mask = src->mask; +} +void convert_libmnt_optmap_64(void* d, void* s) +{ + if(!s || !d) return; + my_libmnt_optmap_32_t* src = s; + my_libmnt_optmap_t* dst = d; + dst->mask = src->mask; + dst->id = src->id; + dst->name = from_ptrv(src->name); +} + +#define N 4 +static my_libmnt_optmap_t* optmap_64[N] = {0}; +static my_libmnt_optmap_32_t optmap_32[N] = {0}; +my_libmnt_optmap_32_t* shrink_libmnt_optmap(void* a) +{ + if(!a) return NULL; + for(int i=0; imnt_get_builtin_optmap(a)); +} + +EXPORT int my32_mnt_optstr_get_flags(x64emu_t* emu, void* optstr, void* flag, void* map) +{ + return my->mnt_optstr_get_flags(optstr, flag, enlarge_libmnt_optmap(map)); +} + +EXPORT int my32_mnt_table_uniq_fs(void* tb, int flags, void* f) +{ + return my->mnt_table_uniq_fs(tb, flags, find_cmp_Fct(f)); +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedmount_private.h b/src/wrapped32/wrappedmount_private.h new file mode 100644 index 0000000..82ef688 --- /dev/null +++ b/src/wrapped32/wrappedmount_private.h @@ -0,0 +1,334 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(mnt_cache_device_has_tag, iFpppp) +GO(mnt_cache_find_tag_value, pFppp) +GO(mnt_cache_read_tags, iFpp) +GO(mnt_cache_set_sbprobe, iFpi) +GO(mnt_cache_set_targets, iFpp) +GO(mnt_context_append_options, iFpp) +GO(mnt_context_apply_fstab, iFp) +GO(mnt_context_disable_canonicalize, iFpi) +GO(mnt_context_disable_helpers, iFpi) +GO(mnt_context_disable_mtab, iFpi) +GO(mnt_context_disable_swapmatch, iFpi) +GO(mnt_context_do_mount, iFp) +GO(mnt_context_do_umount, iFp) +GO(mnt_context_enable_fake, iFpi) +GO(mnt_context_enable_force, iFpi) +GO(mnt_context_enable_fork, iFpi) +GO(mnt_context_enable_lazy, iFpi) +GO(mnt_context_enable_loopdel, iFpi) +GO(mnt_context_enable_noautofs, iFpi) +GO(mnt_context_enable_onlyonce, iFpi) +GO(mnt_context_enable_rdonly_umount, iFpi) +GO(mnt_context_enable_rwonly_mount, iFpi) +GO(mnt_context_enable_sloppy, iFpi) +GO(mnt_context_enable_verbose, iFpi) +GO(mnt_context_finalize_mount, iFp) +GO(mnt_context_finalize_umount, iFp) +GO(mnt_context_find_umount_fs, iFppbp_) +GO(mnt_context_forced_rdonly, iFp) +GO(mnt_context_force_unrestricted, iFp) +GO(mnt_context_get_cache, pFp) +GO(mnt_context_get_excode, iFpipL) +GO(mnt_context_get_fs, pFp) +GO(mnt_context_get_fstab, iFpbp_) +GO(mnt_context_get_fstab_userdata, pFp) +GO(mnt_context_get_fstype, pFp) +GO(mnt_context_get_fs_userdata, pFp) +GO(mnt_context_get_helper_status, iFp) +GO(mnt_context_get_lock, pFp) +//GOM(mnt_context_get_mesgs, pFEp) +GO(mnt_context_get_mflags, iFpbL_) +GO(mnt_context_get_mtab, iFpbp_) +GO(mnt_context_get_mtab_userdata, pFp) +GO(mnt_context_get_nmesgs, LFpc) +GO(mnt_context_get_options, pFp) +GO(mnt_context_get_optsmode, iFp) +GO(mnt_context_get_origin_ns, pFp) +GO(mnt_context_get_source, pFp) +GO(mnt_context_get_status, iFp) +GO(mnt_context_get_syscall_errno, iFp) +GO(mnt_context_get_table, iFppbp_) +GO(mnt_context_get_target, pFp) +GO(mnt_context_get_target_ns, pFp) +GO(mnt_context_get_target_prefix, pFp) +GO(mnt_context_get_user_mflags, iFpbL_) +GO(mnt_context_helper_executed, iFp) +GO(mnt_context_helper_setopt, iFpip) +GO(mnt_context_init_helper, iFpii) +GO(mnt_context_is_child, iFp) +GO(mnt_context_is_fake, iFp) +GO(mnt_context_is_force, iFp) +GO(mnt_context_is_fork, iFp) +GO(mnt_context_is_fs_mounted, iFppp) +GO(mnt_context_is_lazy, iFp) +GO(mnt_context_is_loopdel, iFp) +GO(mnt_context_is_nocanonicalize, iFp) +GO(mnt_context_is_nohelpers, iFp) +GO(mnt_context_is_nomtab, iFp) +GO(mnt_context_is_onlyonce, iFp) +GO(mnt_context_is_parent, iFp) +GO(mnt_context_is_rdonly_umount, iFp) +GO(mnt_context_is_restricted, iFp) +GO(mnt_context_is_rwonly_mount, iFp) +GO(mnt_context_is_sloppy, iFp) +GO(mnt_context_is_swapmatch, iFp) +GO(mnt_context_is_verbose, iFp) +GO(mnt_context_mount, iFp) +GO(mnt_context_next_mount, iFppbp_pp) +GO(mnt_context_next_remount, iFppbp_pp) +GO(mnt_context_next_umount, iFppbp_pp) +GO(mnt_context_prepare_mount, iFp) +GO(mnt_context_prepare_umount, iFp) +GO(mnt_context_reset_status, iFp) +GO(mnt_context_set_cache, iFpp) +GO(mnt_context_set_fs, iFpp) +GO(mnt_context_set_fstab, iFpp) +GO(mnt_context_set_fstype, iFpp) +GO(mnt_context_set_fstype_pattern, iFpp) +GO(mnt_context_set_mflags, iFpL) +GO(mnt_context_set_mountdata, iFpp) +GO(mnt_context_set_options, iFpp) +GO(mnt_context_set_options_pattern, iFpp) +GO(mnt_context_set_optsmode, iFpi) +//GOM(mnt_context_set_passwd_cb, iFEppp) +GO(mnt_context_set_source, iFpp) +GO(mnt_context_set_syscall_status, iFpi) +//GOM(mnt_context_set_tables_errcb, iFEpp) +GO(mnt_context_set_target, iFpp) +GO(mnt_context_set_target_ns, iFpp) +GO(mnt_context_set_target_prefix, iFpp) +GO(mnt_context_set_user_mflags, iFpL) +GO(mnt_context_strerror, iFppL) +GO(mnt_context_switch_ns, pFpp) +GO(mnt_context_switch_origin_ns, pFp) +GO(mnt_context_switch_target_ns, pFp) +GO(mnt_context_syscall_called, iFp) +GO(mnt_context_tab_applied, iFp) +GO(mnt_context_umount, iFp) +GO(mnt_context_wait_for_children, iFppp) +GO(mnt_copy_fs, pFpp) +GO(mnt_diff_tables, iFppp) +GO(mnt_free_cache, vFp) +GO(mnt_free_context, vFp) +GO(mnt_free_fs, vFp) +GO(mnt_free_iter, vFp) +GO(mnt_free_lock, vFp) +//GO(mnt_free_mntent, vFbppppii_) +GO(mnt_free_tabdiff, vFp) +GO(mnt_free_table, vFp) +GO(mnt_free_update, vFp) +GO(mnt_fs_append_attributes, iFpp) +GO(mnt_fs_append_comment, iFpp) +GO(mnt_fs_append_options, iFpp) +GO(mnt_fs_fetch_statmount, iFpU) +GO(mnt_fs_get_attribute, iFppbp_bL_) +GO(mnt_fs_get_attributes, pFp) +GO(mnt_fs_get_bindsrc, pFp) +GO(mnt_fs_get_comment, pFp) +GO(mnt_fs_get_devno, UFp) +GO(mnt_fs_get_freq, iFp) +GO(mnt_fs_get_fs_options, pFp) +GO(mnt_fs_get_fstype, pFp) +GO(mnt_fs_get_id, iFp) +GO(mnt_fs_get_ns, UFp) +GO(mnt_fs_get_option, iFppbp_bL_) +GO(mnt_fs_get_optional_fields, pFp) +GO(mnt_fs_get_options, pFp) +GO(mnt_fs_get_parent_id, iFp) +GO(mnt_fs_get_parent_uniq_id, UFp) +GO(mnt_fs_get_passno, iFp) +GO(mnt_fs_get_priority, iFp) +GO(mnt_fs_get_propagation, iFpbL_) +GO(mnt_fs_get_root, pFp) +GO(mnt_fs_get_size, IFp) +GO(mnt_fs_get_source, pFp) +GO(mnt_fs_get_srcpath, pFp) +GO(mnt_fs_get_statmnt, pFp) +GO(mnt_fs_get_swaptype, pFp) +GO(mnt_fs_get_table, iFpbp_) +GO(mnt_fs_get_tag, iFpbp_bp_) +GO(mnt_fs_get_target, pFp) +GO(mnt_fs_get_tid, iFp) +GO(mnt_fs_get_uniq_id, UFp) +GO(mnt_fs_get_usedsize, IFp) +GO(mnt_fs_get_userdata, pFp) +GO(mnt_fs_get_user_options, pFp) +GO(mnt_fs_get_vfs_options, pFp) +GO(mnt_fs_get_vfs_options_all, pFp) +GO(mnt_fs_is_kernel, iFp) +GO(mnt_fs_is_netfs, iFp) +GO(mnt_fs_is_pseudofs, iFp) +GO(mnt_fs_is_regularfs, iFp) +GO(mnt_fs_is_swaparea, iFp) +GO(mnt_fs_match_fstype, iFpp) +GO(mnt_fs_match_options, iFpp) +GO(mnt_fs_match_source, iFppp) +GO(mnt_fs_match_target, iFppp) +GO(mnt_fs_prepend_attributes, iFpp) +GO(mnt_fs_prepend_options, iFpp) +GO(mnt_fs_print_debug, iFpS) +GO(mnt_fs_refer_statmnt, iFpp) +GO(mnt_fs_set_attributes, iFpp) +GO(mnt_fs_set_bindsrc, iFpp) +GO(mnt_fs_set_comment, iFpp) +GO(mnt_fs_set_freq, iFpi) +GO(mnt_fs_set_fstype, iFpp) +GO(mnt_fs_set_ns, iFpU) +GO(mnt_fs_set_options, iFpp) +GO(mnt_fs_set_passno, iFpi) +GO(mnt_fs_set_priority, iFpi) +GO(mnt_fs_set_root, iFpp) +GO(mnt_fs_set_source, iFpp) +GO(mnt_fs_set_target, iFpp) +GO(mnt_fs_set_uniq_id, iFpU) +GO(mnt_fs_set_userdata, iFpp) +GO(mnt_fs_strdup_options, pFp) +GO(mnt_fs_streq_srcpath, iFpp) +GO(mnt_fs_streq_target, iFpp) +//GOM(mnt_fs_to_mntent, iFEpbp_) +GO(mnt_fstype_is_netfs, iFp) +GO(mnt_fstype_is_pseudofs, iFp) +GOM(mnt_get_builtin_optmap, pFEi) +GO(mnt_get_fstab_path, pFv) +GO(mnt_get_fstype, pFppp) +//GOM(mnt_get_library_features, iFEbp_) +GO(mnt_get_library_version, iFbp_) +GO(mnt_get_mountpoint, pFp) +GO(mnt_get_mtab_path, pFv) +GO(mnt_get_swaps_path, pFv) +GO(mnt_guess_system_root, iFUpbp_) +GO(mnt_has_regular_mtab, iFbp_p) +GO(mnt_id_from_path, iFppp) +GO(mnt_init_debug, vFi) +GO(mnt_iter_get_direction, iFp) +GO(mnt_lock_block_signals, iFpi) +GO(mnt_lock_file, iFp) +GO(mnt_mangle, pFp) +GO(mnt_match_fstype, iFpp) +GO(mnt_match_options, iFpp) +GO(mnt_monitor_close_fd, iFp) +GO(mnt_monitor_enable_kernel, iFpi) +GO(mnt_monitor_enable_userspace, iFpip) +GO(mnt_monitor_event_cleanup, iFp) +GO(mnt_monitor_get_fd, iFp) +GO(mnt_monitor_next_change, iFpbp_p) +GO(mnt_monitor_veil_kernel, iFpi) +GO(mnt_monitor_wait, iFpi) +GO(mnt_new_cache, pFv) +GO(mnt_new_context, pFv) +GO(mnt_new_fs, pFv) +GO(mnt_new_iter, pFi) +GO(mnt_new_lock, pFpi) +GO(mnt_new_monitor, pFv) +GO(mnt_new_statmnt, pFv) +GO(mnt_new_tabdiff, pFv) +GO(mnt_new_table, pFv) +GO(mnt_new_table_from_dir, pFp) +GO(mnt_new_table_from_file, pFp) +GO(mnt_new_update, pFv) +GO(mnt_optstr_append_option, iFbp_pp) +//GO(mnt_optstr_apply_flags, iFbp_Lbpii_) +GO(mnt_optstr_deduplicate_option, iFbp_p) +GOM(mnt_optstr_get_flags, iFEpbL_p) +GO(mnt_optstr_get_option, iFppbp_bL_) +//GO(mnt_optstr_get_options, iFpbp_bpii_i) +GO(mnt_optstr_next_option, iFbp_bp_bL_bp_bL_) +GO(mnt_optstr_prepend_option, iFbp_pp) +GO(mnt_optstr_remove_option, iFbp_p) +GO(mnt_optstr_set_option, iFbp_pp) +GO(mnt_parse_version_string, iFp) +GO(mnt_pretty_path, pFpp) +GO(mnt_ref_cache, vFp) +GO(mnt_ref_fs, vFp) +GO(mnt_ref_lock, vFp) +GO(mnt_ref_monitor, vFp) +GO(mnt_ref_statmnt, vFp) +GO(mnt_ref_table, vFp) +GO(mnt_reset_context, iFp) +GO(mnt_reset_fs, vFp) +GO(mnt_reset_iter, vFpi) +GO(mnt_reset_table, iFp) +GO(mnt_resolve_path, pFpp) +GO(mnt_resolve_spec, pFpp) +GO(mnt_resolve_tag, pFppp) +GO(mnt_resolve_target, pFpp) +GO(mnt_split_optstr, iFpbp_bp_bp_ii) +GO(mnt_statmnt_disable_fetching, iFpi) +GO(mnt_statmnt_set_mask, iFpU) +GO(mnt_tabdiff_next_change, iFppbp_bp_p) +GO(mnt_table_add_fs, iFpp) +GO(mnt_table_append_intro_comment, iFpp) +GO(mnt_table_append_trailing_comment, iFpp) +GO(mnt_table_enable_comments, vFpi) +GO(mnt_table_enable_listmount, iFpi) +//GO(mnt_table_enable_noautofs, +GO(mnt_table_fetch_listmount, iFp) +GO(mnt_table_find_devno, pFpUi) +GO(mnt_table_find_fs, iFpp) +GO(mnt_table_find_id, pFpi) +GO(mnt_table_find_mountpoint, pFppi) +//GOM(mnt_table_find_next_fs, iFEppppbp_) +GO(mnt_table_find_pair, pFpppi) +GO(mnt_table_find_source, pFppi) +GO(mnt_table_find_srcpath, pFppi) +GO(mnt_table_find_tag, pFpppi) +GO(mnt_table_find_target, pFppi) +GO(mnt_table_find_target_with_option, pFppppi) +GO(mnt_table_find_uniq_id, pFpU) +GO(mnt_table_first_fs, iFpbp_) +GO(mnt_table_get_cache, pFp) +GO(mnt_table_get_intro_comment, pFp) +GO(mnt_table_get_nents, iFp) +GO(mnt_table_get_root_fs, iFpbp_) +GO(mnt_table_get_trailing_comment, pFp) +GO(mnt_table_get_userdata, pFp) +GO(mnt_table_insert_fs, iFpipp) +GO(mnt_table_is_empty, iFp) +GO(mnt_table_is_fs_mounted, iFpp) +//GO(mnt_table_is_noautofs, +GO(mnt_table_last_fs, iFpbp_) +GO(mnt_table_listmount_set_id, iFpU) +GO(mnt_table_listmount_set_ns, iFpU) +GO(mnt_table_listmount_set_stepsiz, iFpL) +GO(mnt_table_move_fs, iFppipp) +GO(mnt_table_next_child_fs, iFpppbp_) +GO(mnt_table_next_fs, iFppbp_) +GO(mnt_table_over_fs, iFppbp_) +GO(mnt_table_parse_dir, iFpp) +GO(mnt_table_parse_file, iFpp) +GO(mnt_table_parse_fstab, iFpp) +GO(mnt_table_parse_mtab, iFpp) +GO(mnt_table_parse_stream, iFpSp) +GO(mnt_table_parse_swaps, iFpp) +GO(mnt_table_refer_statmnt, iFpp) +GO(mnt_table_remove_fs, iFpp) +GO(mnt_table_replace_file, iFpp) +GO(mnt_table_set_cache, iFpp) +GO(mnt_table_set_intro_comment, iFpp) +GO(mnt_table_set_iter, iFppp) +//GOM(mnt_table_set_parser_errcb, iFEpp) +GO(mnt_table_set_trailing_comment, iFpp) +GO(mnt_table_set_userdata, iFpp) +GOM(mnt_table_uniq_fs, iFEpip) +GO(mnt_table_with_comments, iFp) +GO(mnt_table_write_file, iFpS) +GO(mnt_tag_is_valid, iFp) +GO(mnt_unlock_file, vFp) +GO(mnt_unmangle, pFp) +GO(mnt_unref_cache, vFp) +GO(mnt_unref_fs, vFp) +GO(mnt_unref_lock, vFp) +GO(mnt_unref_monitor, vFp) +GO(mnt_unref_statmnt, vFp) +GO(mnt_unref_table, vFp) +GO(mnt_update_force_rdonly, iFpi) +GO(mnt_update_get_filename, pFp) +GO(mnt_update_get_fs, pFp) +GO(mnt_update_get_mflags, LFp) +GO(mnt_update_is_ready, iFp) +GO(mnt_update_set_fs, iFpLpp) +GO(mnt_update_table, iFpp) diff --git a/src/wrapped32/wrappednsl.c b/src/wrapped32/wrappednsl.c new file mode 100644 index 0000000..0065d0c --- /dev/null +++ b/src/wrapped32/wrappednsl.c @@ -0,0 +1,22 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" + +#ifdef LA64 +static const char* nslName = "libnsl.so.2"; +#else +static const char* nslName = "libnsl.so.1"; +#endif +#define LIBNAME nsl + +#include "wrappedlib_init32.h" + diff --git a/src/wrapped32/wrappednsl_private.h b/src/wrapped32/wrappednsl_private.h new file mode 100644 index 0000000..2488ddd --- /dev/null +++ b/src/wrapped32/wrappednsl_private.h @@ -0,0 +1,132 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//GO(__create_ib_request, +//GO(__do_niscall3, +//GO(__follow_path, +//GO(__free_fdresult, +//GO(nis_add, +//GO(nis_add_entry, +//GO(nis_addmember, +//GO(__nisbind_connect, +//GO(__nisbind_create, +//GO(__nisbind_destroy, +//GO(__nisbind_next, +//GO(nis_checkpoint, +//GO(nis_clone_directory, +//GO(nis_clone_object, +//GO(nis_clone_result, +//GO(nis_creategroup, +//GO(__nis_default_access, +//GO(__nis_default_group, +//GO(__nis_default_owner, +//GO(__nis_default_ttl, +//GO(nis_destroygroup, +//GO(nis_destroy_object, +//GO(nis_dir_cmp, +//GO(nis_domain_of, +//GO(nis_domain_of_r, +//GO(__nis_finddirectory, +//GO(nis_first_entry, +//GO(nis_free_directory, +//GO(nis_freenames, +//GO(nis_free_object, +//GO(nis_free_request, +//GO(nis_freeresult, +//GO(nis_freeservlist, +//GO(nis_freetags, +//GO(nis_getnames, +//GO(nis_getservlist, +//GO(__nis_hash, +//GO(nis_ismember, +//GO(nis_leaf_of, +//GO(nis_leaf_of_r, +//GO(nis_lerror, +//GO(nis_list, +//GO(nis_local_directory, +//GO(nis_local_group, +//GO(nis_local_host, +//GO(nis_local_principal, +//GO(nis_lookup, +//GO(nis_mkdir, +//GO(nis_modify, +//GO(nis_modify_entry, +//GO(nis_name_of, +//GO(nis_name_of_r, +//GO(nis_next_entry, +//GO(nis_perror, +//GO(nis_ping, +//GO(nis_print_directory, +//GO(nis_print_entry, +//GO(nis_print_group, +//GO(nis_print_group_entry, +//GO(nis_print_link, +//GO(nis_print_object, +//GO(nis_print_result, +//GO(nis_print_rights, +//GO(nis_print_table, +//GO(nis_read_obj, +//GO(nis_remove, +//GO(nis_remove_entry, +//GO(nis_removemember, +//GO(nis_rmdir, +//GO(nis_servstate, +//GO(nis_sperrno, +//GO(nis_sperror, +//GO(nis_sperror_r, +//GO(nis_stats, +//GO(nis_verifygroup, +//GO(nis_write_obj, +//GO(_nsl_default_nss, +//GO(__prepare_niscall, +//GO(readColdStartFile, +//GO(writeColdStartFile, +//GO(xdr_cback_data, +//GO(xdr_domainname, +//GO(_xdr_ib_request, +//GO(xdr_keydat, +//GO(xdr_mapname, +//GO(_xdr_nis_result, +//GO(xdr_obj_p, +//GO(xdr_peername, +//GO(xdr_valdat, +//GO(xdr_ypall, +//GO(xdr_ypbind_binding, +//GO(xdr_ypbind_resp, +//GO(xdr_ypbind_resptype, +//GO(xdr_ypbind_setdom, +//GO(xdr_yp_buf, +//GO(xdr_ypdelete_args, +//GO(xdr_ypmaplist, +//GO(xdr_ypmap_parms, +//GO(xdr_yppushresp_xfr, +//GO(xdr_yppush_status, +//GO(xdr_ypreq_key, +//GO(xdr_ypreq_nokey, +//GO(xdr_ypreq_xfr, +//GO(xdr_ypresp_all, +//GO(xdr_ypresp_key_val, +//GO(xdr_ypresp_maplist, +//GO(xdr_ypresp_master, +//GO(xdr_ypresp_order, +//GO(xdr_ypresp_val, +//GO(xdr_ypresp_xfr, +//GO(xdr_ypstat, +//GO(xdr_ypupdate_args, +//GO(xdr_ypxfrstat, +//GOM(yp_all, iFEppbpp_) +GO(yp_bind, iFp) +GO(ypbinderr_string, pFi) +GO(__yp_check, iFbp_) +GO(yperr_string, pFi) +GO(yp_first, iFppbp_pbp_p) +GO(yp_get_default_domain, iFbp_) +//GO(yp_maplist, +GO(yp_master, iFppbp_) +GO(yp_match, iFpppibp_p) +GO(yp_next, iFpppibp_pbp_p) +GO(yp_order, iFppp) +GO(ypprot_err, iFi) +GO(yp_unbind, vFp) +GO(yp_update, iFppupipi) diff --git a/src/wrapped32/wrappedopenal.c b/src/wrapped32/wrappedopenal.c new file mode 100644 index 0000000..1d53b89 --- /dev/null +++ b/src/wrapped32/wrappedopenal.c @@ -0,0 +1,180 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "box32context.h" +#include "librarian.h" +#include "myalign32.h" + +static const char* openalName = "libopenal.so.1"; +#define LIBNAME openal + +#include "generated/wrappedopenaltypes32.h" + +#include "wrappercallback32.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// Request ... +#define GO(A) \ +static uintptr_t my32_Request_fct_##A = 0; \ +static void my32_Request_##A(int32_t a, int32_t b) \ +{ \ + RunFunctionFmt(my32_Request_fct_##A, "ii", a, b); \ +} +SUPER() +#undef GO +static void* find_Request_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_Request_fct_##A == (uintptr_t)fct) return my32_Request_##A; + SUPER() + #undef GO + #define GO(A) if(my32_Request_fct_##A == 0) {my32_Request_fct_##A = (uintptr_t)fct; return my32_Request_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for openal Request callback\n"); + return NULL; +} + +#undef SUPER + +void* my32_alGetProcAddress(x64emu_t* emu, void* name); +void* my32_alcGetProcAddress(x64emu_t* emu, void* device, void* name); +void my32_alRequestFoldbackStart(x64emu_t *emu, int32_t mode, int32_t count, int32_t length, void* mem, void* cb); +void my32_alRequestFoldbackStop(x64emu_t* emu); + +#include "wrappedlib_init32.h" + + +void fillALProcWrapper32() +{ + int cnt, ret; + khint_t k; + kh_symbolmap_t * symbolmap = kh_init(symbolmap); + // populates maps... + cnt = sizeof(openalsymbolmap)/sizeof(map_onesymbol_t); + for (int i=0; ialwrappers = symbolmap; + // fill my32_* map + symbolmap = kh_init(symbolmap); + cnt = sizeof(MAPNAME(mysymbolmap))/sizeof(map_onesymbol_t); + for (int i=0; ialmymap = symbolmap; +} + +EXPORT void* my32_alGetProcAddress(x64emu_t* emu, void* name) +{ + khint_t k; + const char* rname = (const char*)name; + printf_log(LOG_DEBUG, "Calling 32bits alGetProcAddress(%s)\n", rname); + if(!emu->context->alwrappers) // could be moved in "my" structure... + fillALProcWrapper32(emu->context); + // get proc adress using actual alGetProcAddress + k = kh_get(symbolmap, emu->context->almymap, rname); + int is_my = (k==kh_end(emu->context->almymap))?0:1; + void* symbol; + if(is_my) { + // try again, by using custom "my32_" now... + char tmp[200]; + strcpy(tmp, "my32_"); + strcat(tmp, rname); + symbol = dlsym(emu->context->box64lib, tmp); + } else + symbol = my->alGetProcAddress(name); + if(!symbol) + return NULL; // easy + // get wrapper + k = kh_get(symbolmap, emu->context->alwrappers, rname); + if(k==kh_end(emu->context->alwrappers)) { + printf_log(LOG_INFO, "Warning, no wrapper for %s\n", rname); + return NULL; + } + symbol1_t *s = &kh_value(emu->context->alwrappers, k); + if(!s->resolved) { + const char* constname = kh_key(emu->context->alwrappers, k); + s->addr = AddCheckBridge(emu->context->system, s->w, symbol, 0, constname); + s->resolved = 1; + } + return (void*)s->addr; +} + +EXPORT void* my32_alcGetProcAddress(x64emu_t* emu, void* device, void* name) +{ + khint_t k; + const char* rname = (const char*)name; + printf_log(LOG_DEBUG, "Calling 32bits alcGetProcAddress(%p, %s)\n", device, rname); + if(!emu->context->alwrappers) // could be moved in "my" structure... + fillALProcWrapper32(); + // get proc adress using actual alGetProcAddress + k = kh_get(symbolmap, emu->context->almymap, rname); + int is_my = (k==kh_end(emu->context->almymap))?0:1; + void* symbol; + if(is_my) { + // try again, by using custom "my32_" now... + char tmp[200]; + strcpy(tmp, "my32_"); + strcat(tmp, rname); + symbol = dlsym(emu->context->box64lib, tmp); + } else + symbol = my->alcGetProcAddress(device, name); + if(!symbol) + return NULL; // easy + // get wrapper + k = kh_get(symbolmap, emu->context->alwrappers, rname); + if(k==kh_end(emu->context->alwrappers)) { + printf_log(LOG_INFO, "Warning, no wrapper for %s\n", rname); + return NULL; + } + symbol1_t *s = &kh_value(emu->context->alwrappers, k); + if(!s->resolved) { + const char* constname = kh_key(emu->context->alwrappers, k); + s->addr = AddCheckBridge(emu->context->system, s->w, symbol, 0, constname); + s->resolved = 1; + } + return (void*)s->addr; +} + +EXPORT void my32_alRequestFoldbackStart(x64emu_t *emu, int32_t mode, int32_t count, int32_t length, void* mem, void* cb) +{ + (void)emu; + my->alRequestFoldbackStart(mode, count, length, mem, find_Request_Fct(cb)); +} + +EXPORT void my32_alRequestFoldbackStop(x64emu_t* emu) +{ + (void)emu; + my->alRequestFoldbackStop(); +} diff --git a/src/wrapped32/wrappedopenal_private.h b/src/wrapped32/wrappedopenal_private.h new file mode 100644 index 0000000..60aa4c0 --- /dev/null +++ b/src/wrapped32/wrappedopenal_private.h @@ -0,0 +1,167 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(alDopplerFactor, vFf) +GO(alDopplerVelocity, vFf) +GO(alSpeedOfSound, vFf) +GO(alDistanceModel, vFi) +GO(alEnable, vFi) +GO(alDisable, vFi) +GO(alIsEnabled, cFi) +GO(alGetString, pFi) +GO(alGetBooleanv, vFip) +GO(alGetIntegerv, vFip) +GO(alGetFloatv, vFip) +GO(alGetDoublev, vFip) +GO(alGetBoolean, cFi) +GO(alGetInteger, iFi) +GO(alGetFloat, fFi) +GO(alGetDouble, dFi) +GO(alGetError, iFv) +GO(alIsExtensionPresent, cFp) +GOM(alGetProcAddress, pFEp) +GO(alGetEnumValue, iFp) +GO(alListenerf, vFif) +GO(alListener3f, vFifff) +GO(alListenerfv, vFip) +GO(alListeneri, vFii) +GO(alListener3i, vFiiii) +GO(alListeneriv, vFip) +GO(alGetListenerf, vFip) +GO(alGetListener3f, vFippp) +GO(alGetListenerfv, vFip) +GO(alGetListeneri, vFip) +GO(alGetListener3i, vFippp) +GO(alGetListeneriv, vFip) +GO(alGenSources, vFip) +GO(alDeleteSources, vFip) +GO(alIsSource, cFu) +GO(alSourcef, vFuif) +GO(alSource3f, vFuifff) +GO(alSourcefv, vFuip) +GO(alSourcei, vFuii) +GO(alSource3i, vFuiiii) +GO(alSourceiv, vFuip) +GO(alGetSourcef, vFuip) +GO(alGetSource3f, vFuippp) +GO(alGetSourcefv, vFuip) +GO(alGetSourcei, vFuip) +GO(alGetSource3i, vFuippp) +GO(alGetSourceiv, vFuip) +GO(alSourcePlayv, vFip) +GO(alSourceStopv, vFip) +GO(alSourceRewindv, vFip) +GO(alSourcePausev, vFip) +GO(alSourcePlay, vFu) +GO(alSourceStop, vFu) +GO(alSourceRewind, vFu) +GO(alSourcePause, vFu) +GO(alSourceQueueBuffers, vFuip) +GO(alSourceUnqueueBuffers, vFuip) +GO(alGenBuffers, vFip) +GO(alDeleteBuffers, vFip) +GO(alIsBuffer, cFu) +GO(alBufferData, vFuipii) +GO(alBufferf, vFuif) +GO(alBuffer3f, vFuifff) +GO(alBufferfv, vFuip) +GO(alBufferi, vFuii) +GO(alBuffer3i, vFuiiii) +GO(alBufferiv, vFuip) +GO(alGetBufferf, vFuip) +GO(alGetBuffer3f, vFuippp) +GO(alGetBufferfv, vFuip) +GO(alGetBufferi, vFuip) +GO(alGetBuffer3i, vFuippp) +GO(alGetBufferiv, vFuip) + +GO(alcCreateContext, pFpp) +GO(alcMakeContextCurrent, cFp) +GO(alcProcessContext, vFp) +GO(alcSuspendContext, vFp) +GO(alcDestroyContext, vFp) +GO(alcGetCurrentContext, pFv) +GO(alcGetContextsDevice, pFp) +GO(alcOpenDevice, pFp) +GO(alcCloseDevice, cFp) +GO(alcGetError, iFp) +GO(alcIsExtensionPresent, cFpp) +GOM(alcGetProcAddress, pFEpp) +GO(alcGetEnumValue, iFpp) +GO(alcGetString, pFpi) +GO(alcGetIntegerv, vFpiip) +GO(alcCaptureOpenDevice, pFpuii) +GO(alcCaptureCloseDevice, cFp) +GO(alcCaptureStart, vFp) +GO(alcCaptureStop, vFp) +GO(alcCaptureSamples, vFppi) + +GO(alcGetThreadContext, pFv) +GO(alcSetThreadContext, cFp) +GO(alcLoopbackOpenDeviceSOFT, pFp) +GO(alcIsRenderFormatSupportedSOFT, cFpiii) +GO(alcRenderSamplesSOFT, vFppi) +GO(alcDevicePauseSOFT, vFp) +GO(alcDeviceResumeSOFT, vFp) +GO(alcGetStringiSOFT, pFpii) +GO(alcResetDeviceSOFT, cFpp) +GO(alcGetInteger64vSOFT, vFpiip) + +GO(alBufferDataStatic, vFuipii) +GO(alBufferSubDataSOFT, vFuipii) +GOM(alRequestFoldbackStart, vFEiiipp) +GOM(alRequestFoldbackStop, vFEv) +GO(alBufferSamplesSOFT, vFuuiiiip) +GO(alBufferSubSamplesSOFT, vFuiiiip) +GO(alGetBufferSamplesSOFT, vFuiiiip) +GO(alIsBufferFormatSupportedSOFT, cFi) +GO(alSourcedSOFT, vFuid) +GO(alSource3dSOFT, vFuiddd) +GO(alSourcedvSOFT, vFuip) +GO(alGetSourcedSOFT, vFuip) +GO(alGetSource3dSOFT, vFuippp) +GO(alGetSourcedvSOFT, vFuip) +GO(alSourcei64SOFT, vFuiI) +GO(alSource3i64SOFT, vFuiIII) +GO(alSourcei64vSOFT, vFuip) +GO(alGetSourcei64SOFT, vFuip) +GO(alGetSource3i64SOFT, vFuippp) +GO(alGetSourcei64vSOFT, vFuip) +GO(alDeferUpdatesSOFT, vFv) +GO(alProcessUpdatesSOFT, vFv) +GO(alGetStringiSOFT, pFii) + +GO(alGenEffects, vFip) +GO(alDeleteEffects, vFip) +GO(alIsEffect, cFu) +GO(alEffecti, vFuii) +GO(alEffectiv, vFuip) +GO(alEffectf, vFuif) +GO(alEffectfv, vFuip) +GO(alGetEffecti, vFuip) +GO(alGetEffectiv, vFuip) +GO(alGetEffectf, vFuip) +GO(alGetEffectfv, vFuip) +GO(alGenFilters, vFip) +GO(alDeleteFilters, vFip) +GO(alIsFilter, cFu) +GO(alFilteri, vFuii) +GO(alFilteriv, vFuip) +GO(alFilterf, vFuif) +GO(alFilterfv, vFuip) +GO(alGetFilteri, vFuip) +GO(alGetFilteriv, vFuip) +GO(alGetFilterf, vFuip) +GO(alGetFilterfv, vFuip) +GO(alGenAuxiliaryEffectSlots, vFip) +GO(alDeleteAuxiliaryEffectSlots, vFip) +GO(alIsAuxiliaryEffectSlot, cFu) +GO(alAuxiliaryEffectSloti, vFuii) +GO(alAuxiliaryEffectSlotiv, vFuip) +GO(alAuxiliaryEffectSlotf, vFuif) +GO(alAuxiliaryEffectSlotfv, vFuip) +GO(alGetAuxiliaryEffectSloti, vFuip) +GO(alGetAuxiliaryEffectSlotiv, vFuip) +GO(alGetAuxiliaryEffectSlotf, vFuip) +GO(alGetAuxiliaryEffectSlotfv, vFuip) diff --git a/src/wrapped32/wrappedsdl1.c b/src/wrapped32/wrappedsdl1.c new file mode 100644 index 0000000..c31157c --- /dev/null +++ b/src/wrapped32/wrappedsdl1.c @@ -0,0 +1,701 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "debug.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "callback.h" +#include "librarian.h" +#include "emu/x64emu_private.h" +#include "box32context.h" +#include "sdl1rwops.h" +#include "gltools.h" + +#include "x64trace.h" +#include "threads.h" + +#include "sdl1align32.h" + +extern const char* sdl1Name; +#define LIBNAME sdl1 + +static int sdl_Yes() {return 1;} +static int sdl_No() {return 0;} +EXPORT int my32_SDL_Has3DNow() __attribute__((alias("sdl_No"))); +EXPORT int my32_SDL_Has3DNowExt() __attribute__((alias("sdl_No"))); +EXPORT int my32_SDL_HasAltiVec() __attribute__((alias("sdl_No"))); +EXPORT int my32_SDL_HasMMX() __attribute__((alias("sdl_Yes"))); +EXPORT int my32_SDL_HasMMXExt() __attribute__((alias("sdl_Yes"))); +EXPORT int my32_SDL_HasRDTSC() __attribute__((alias("sdl_Yes"))); +EXPORT int my32_SDL_HasSSE() __attribute__((alias("sdl_Yes"))); +EXPORT int my32_SDL_HasSSE2() __attribute__((alias("sdl_Yes"))); + +typedef struct { + int32_t freq; + uint16_t format; + uint8_t channels; + uint8_t silence; + uint16_t samples; + uint32_t size; + void (*callback)(void *userdata, uint8_t *stream, int32_t len); + void *userdata; +} SDL_AudioSpec; + +typedef struct { // removed packed attribute + int32_t freq; + uint16_t format; + uint8_t channels; + uint8_t silence; + uint16_t samples; + uint32_t size; + ptr_t callback; //void (*callback)(void *userdata, uint8_t *stream, int32_t len); + ptr_t userdata; //void *userdata; +} SDL_AudioSpec32; + +EXPORT void my32_SDL_Quit(); + +#define ADDED_FUNCTIONS() \ + GO(SDL_AllocRW, sdl1_allocrw) \ + GO(SDL_FreeRW, sdl1_freerw) + +#define ADDED_FINI() \ + my32_SDL_Quit(); + +#include "generated/wrappedsdl1types32.h" + +#include "wrappercallback32.h" + +// event filter. Needs to be global, but there is only one, so that's should be fine +static x64emu_t *sdl1_evtfilter = NULL; +static void* sdl1_evtfnc = NULL; +static int sdl1_evtautofree = 0; +static int sdl1_evtinside = 0; + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// AudioCallback ... +#define GO(A) \ +static uintptr_t my32_AudioCallback_fct_##A = 0; \ +static void my32_AudioCallback_##A(void *userdata, uint8_t *stream, int32_t len) \ +{ \ + RunFunctionFmt(my32_AudioCallback_fct_##A, "ppi", userdata, stream, len); \ +} +SUPER() +#undef GO +static void* find_AudioCallback_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_AudioCallback_fct_##A == (uintptr_t)fct) return my32_AudioCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_AudioCallback_fct_##A == 0) {my32_AudioCallback_fct_##A = (uintptr_t)fct; return my32_AudioCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for SDL1 AudioCallback callback\n"); + return NULL; +} +// TimerCallback ... +#define GO(A) \ +static uintptr_t my32_TimerCallback_fct_##A = 0; \ +static uint32_t my32_TimerCallback_##A(uint32_t interval, void *userdata) \ +{ \ + return (uint32_t)RunFunctionFmt(my32_TimerCallback_fct_##A, "up", interval, userdata); \ +} +SUPER() +#undef GO +static void* find_TimerCallback_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_TimerCallback_fct_##A == (uintptr_t)fct) return my32_TimerCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my32_TimerCallback_fct_##A == 0) {my32_TimerCallback_fct_##A = (uintptr_t)fct; return my32_TimerCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for SDL1 TimerCallback callback\n"); + return NULL; +} +// EvtFilter ... +#define GO(A) \ +static uintptr_t my32_EvtFilter_fct_##A = 0; \ +static int my32_EvtFilter_##A(void* p) \ +{ \ + return RunFunctionFmt(my32_EvtFilter_fct_##A, "p", p); \ +} +SUPER() +#undef GO +static void* find_EvtFilter_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my32_EvtFilter_fct_##A == (uintptr_t)fct) return my32_EvtFilter_##A; + SUPER() + #undef GO + #define GO(A) if(my32_EvtFilter_fct_##A == 0) {my32_EvtFilter_fct_##A = (uintptr_t)fct; return my32_EvtFilter_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for SDL1 EvtFilter callback\n"); + return NULL; +} +static void* reverse_EvtFilterFct(void* fct) +{ + if(!fct) return fct; + if(CheckBridged(my_lib->w.bridge, fct)) + return (void*)CheckBridged(my_lib->w.bridge, fct); + #define GO(A) if(my32_EvtFilter_##A == fct) return (void*)my32_EvtFilter_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(my_lib->w.bridge, iFp_32, fct, 0, NULL); +} +#undef SUPER + +// TODO: track the memory for those callback +EXPORT int my32_SDL_OpenAudio(x64emu_t* emu, void* d, void* o) +{ + SDL_AudioSpec desired = {0}; + SDL_AudioSpec output = {0}; + SDL_AudioSpec32 *d_ = d; + desired.channels = d_->channels; + desired.format = d_->format; + desired.freq = d_->freq; + desired.samples = d_->samples; + desired.silence = d_->silence; + desired.size = d_->size; + desired.userdata = from_ptrv(d_->userdata); + desired.callback = find_AudioCallback_Fct(from_ptrv(d_->callback)); + int ret = my->SDL_OpenAudio(&desired, &output); + if (ret!=0) { + return ret; + } + // put back stuff in place? + if (o) { + SDL_AudioSpec32* o_ = o; + o_->channels = output.channels; + o_->format = output.format; + o_->freq = output.freq; + o_->samples = output.samples; + o_->silence = output.silence; + o_->size = output.size; + o_->userdata = o_->callback = 0; + } + + return ret; +} + +EXPORT void *my32_SDL_LoadBMP_RW(x64emu_t* emu, void* a, int b) +{ + inplace_SDL_RWops_to_64(a); + SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); + void* r = my->SDL_LoadBMP_RW(rw, b); + if(b==0) { + RWNativeEnd(rw); + inplace_SDL_RWops_to_32(a); + } + inplace_SDL_Surface_to_32(r); + return r; +} +//EXPORT int32_t my32_SDL_SaveBMP_RW(x64emu_t* emu, void* a, void* b, int c) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// int32_t r = my->SDL_SaveBMP_RW(rw, b, c); +// if(c==0) +// RWNativeEnd(rw); +// return r; +//} +//EXPORT void *my32_SDL_LoadWAV_RW(x64emu_t* emu, void* a, int b, void* c, void* d, void* e) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// void* r = my->SDL_LoadWAV_RW(rw, b, c, d, e); +// if(b==0) +// RWNativeEnd(rw); +// return r; +//} +//EXPORT uint32_t my32_SDL_ReadBE16(x64emu_t* emu, void* a) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// uint32_t r = my->SDL_ReadBE16(rw); +// RWNativeEnd(rw); +// return r; +//} +//EXPORT uint32_t my32_SDL_ReadBE32(x64emu_t* emu, void* a) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// uint32_t r = my->SDL_ReadBE32(rw); +// RWNativeEnd(rw); +// return r; +//} +//EXPORT uint64_t my32_SDL_ReadBE64(x64emu_t* emu, void* a) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// uint64_t r = my->SDL_ReadBE64(rw); +// RWNativeEnd(rw); +// return r; +//} +//EXPORT uint32_t my32_SDL_ReadLE16(x64emu_t* emu, void* a) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// uint32_t r = my->SDL_ReadLE16(rw); +// RWNativeEnd(rw); +// return r; +//} +EXPORT uint32_t my32_SDL_ReadLE32(x64emu_t* emu, void* a) +{ + inplace_SDL_RWops_to_64(a); + SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); + uint32_t r = my->SDL_ReadLE32(rw); + RWNativeEnd(rw); + inplace_SDL_RWops_to_32(a); + return r; +} +//EXPORT uint64_t my32_SDL_ReadLE64(x64emu_t* emu, void* a) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// uint64_t r = my->SDL_ReadLE64(rw); +// RWNativeEnd(rw); +// return r; +//} +//EXPORT uint32_t my32_SDL_WriteBE16(x64emu_t* emu, void* a, uint16_t v) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// uint32_t r = my->SDL_WriteBE16(rw, v); +// RWNativeEnd(rw); +// return r; +//} +//EXPORT uint32_t my32_SDL_WriteBE32(x64emu_t* emu, void* a, uint32_t v) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// uint32_t r = my->SDL_WriteBE32(rw, v); +// RWNativeEnd(rw); +// return r; +//} +//EXPORT uint32_t my32_SDL_WriteBE64(x64emu_t* emu, void* a, uint64_t v) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// uint32_t r = my->SDL_WriteBE64(rw, v); +// RWNativeEnd(rw); +// return r; +//} +//EXPORT uint32_t my32_SDL_WriteLE16(x64emu_t* emu, void* a, uint16_t v) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// uint32_t r = my->SDL_WriteLE16(rw, v); +// RWNativeEnd(rw); +// return r; +//} +//EXPORT uint32_t my32_SDL_WriteLE32(x64emu_t* emu, void* a, uint32_t v) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// uint32_t r = my->SDL_WriteLE32(rw, v); +// RWNativeEnd(rw); +// return r; +//} +//EXPORT uint32_t my32_SDL_WriteLE64(x64emu_t* emu, void* a, uint64_t v) +//{ +// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); +// uint32_t r = my->SDL_WriteLE64(rw, v); +// RWNativeEnd(rw); +// return r; +//} + +// SDL1 doesn't really used rw_ops->type, but box64 does, so set sensible value (from SDL2).... +//EXPORT void *my32_SDL_RWFromConstMem(x64emu_t* emu, void* a, int b) +//{ +// SDL1_RWops_t* r = (SDL1_RWops_t*)my->SDL_RWFromConstMem(a, b); +// RWSetType(r, 5); +// return AddNativeRW(emu, r); +//} +//EXPORT void *my32_SDL_RWFromFP(x64emu_t* emu, void* a, int b) +//{ +// SDL1_RWops_t* r = (SDL1_RWops_t*)my->SDL_RWFromFP(a, b); +// RWSetType(r, 2); +// return AddNativeRW(emu, r); +//} +EXPORT void *my32_SDL_RWFromFile(x64emu_t* emu, void* a, void* b) +{ + SDL1_RWops_t* r = (SDL1_RWops_t*)my->SDL_RWFromFile(a, b); + RWSetType(r, 2); + void* ret = AddNativeRW(emu, r); + inplace_SDL_RWops_to_32(ret); + return ret; +} +EXPORT void *my32_SDL_RWFromMem(x64emu_t* emu, void* a, int b) +{ + SDL1_RWops_t* r = (SDL1_RWops_t*)my->SDL_RWFromMem(a, b); + RWSetType(r, 4); + void* ret = AddNativeRW(emu, r); + inplace_SDL_RWops_to_32(ret); + return ret; +} + +EXPORT void my32_SDL_WM_SetIcon(void* s, void* mask) +{ + inplace_SDL_Surface_to_64(s); + my->SDL_WM_SetIcon(s, mask); + inplace_SDL_Surface_to_32(s); +} + +EXPORT void my32_SDL_GetRGB(uint32_t pixel, void* format, void* r, void* g, void* b) +{ + inplace_SDL_PixelFormat_to_64(format); + my->SDL_GetRGB(pixel, format, r, g, b); + inplace_SDL_PixelFormat_to_32(format); +} + +EXPORT void* my32_SDL_GetVideoInfo() +{ + static my_SDL_Palette_t vm_palette; + static my_SDL_PixelFormat_t vm_format; + static my_SDL_VideoInfo_32_t vm = {0}; + my_SDL_VideoInfo_t* r = my->SDL_GetVideoInfo(); + if(!r) return NULL; + vm.hw_available = r->hw_available; + vm.wm_available = r->wm_available; + vm.blit_hw = r->blit_hw; + vm.blit_hw_CC = r->blit_hw_CC; + vm.blit_hw_A = r->blit_hw_A; + vm.blit_sw = r->blit_sw; + vm.blit_sw_CC = r->blit_sw_CC; + vm.blit_sw_A = r->blit_sw_A; + vm.blit_fill = r->blit_fill; + vm.video_mem = r->video_mem; + vm.current_h = r->current_h; + vm.current_w = r->current_w; + if(r->vfmt) { + vm.vfmt = to_ptrv(&vm_format); + memcpy(&vm_format, r->vfmt, sizeof(vm_format)); + if(r->vfmt->palette) { + vm_format.palette = &vm_palette; + memcpy(&vm_palette, r->vfmt->palette, sizeof(vm_palette)); + } + inplace_SDL_PixelFormat_to_32(&vm_format); + } else vm.vfmt = 0; + return &vm; +} + +EXPORT void *my32_SDL_AddTimer(x64emu_t* emu, uint32_t a, void* cb, void* p) +{ + return my->SDL_AddTimer(a, find_TimerCallback_Fct(cb), p); +} + +EXPORT int my32_SDL_RemoveTimer(x64emu_t* emu, void *t) +{ + return my->SDL_RemoveTimer(t); +} + +EXPORT int32_t my32_SDL_SetTimer(x64emu_t* emu, uint32_t t, void* p) +{ + return my->SDL_SetTimer(t, find_TimerCallback_Fct(p)); +} +#if 0 +EXPORT int32_t my32_SDL_BuildAudioCVT(x64emu_t* emu, void* a, uint32_t b, uint32_t c, int32_t d, uint32_t e, uint32_t f, int32_t g) +{ + printf_log(LOG_NONE, "Error, using Unimplemented SDL1 SDL_BuildAudioCVT\n"); + emu->quit = 1; + return 0; +} + +EXPORT int32_t my32_SDL_ConvertAudio(x64emu_t* emu, void* a) +{ + printf_log(LOG_NONE, "Error, using Unimplemented SDL1 SDL_ConvertAudio\n"); + emu->quit = 1; + return 0; +} +#endif +//EXPORT void my32_SDL_SetEventFilter(x64emu_t* emu, void* a) +//{ +// my->SDL_SetEventFilter(find_EvtFilter_Fct(a)); +//} +//EXPORT void *my32_SDL_GetEventFilter(x64emu_t* emu) +//{ +// return reverse_EvtFilterFct(my->SDL_GetEventFilter()); +//} +void* my32_prepare_thread(x64emu_t *emu, void* f, void* arg, int ssize, void** pet); +EXPORT void *my32_SDL_CreateThread(x64emu_t* emu, void* cb, void* p) +{ + void* et = NULL; + void* fnc = my32_prepare_thread(emu, cb, p, 0, &et); + return my->SDL_CreateThread(fnc, et); +} + +EXPORT void my32_SDL_KillThread(x64emu_t* emu, void* p) +{ + my->SDL_KillThread(p); +} + +EXPORT void* my32_SDL_GL_GetProcAddress(x64emu_t* emu, void* name) +{ + khint_t k; + const char* rname = (const char*)name; + return getGLProcAddress32(emu, NULL, (glprocaddress_t)my->SDL_GL_GetProcAddress, rname); +} + +// DL functions from wrappedlibdl.c +void* my_dlopen(x64emu_t* emu, void *filename, int flag); +int my_dlclose(x64emu_t* emu, void *handle); +void* my_dlsym(x64emu_t* emu, void *handle, void *symbol); +EXPORT void* my32_SDL_LoadObject(x64emu_t* emu, void* sofile) +{ + return my_dlopen(emu, sofile, 0); // TODO: check correct flag value... +} +EXPORT void my32_SDL_UnloadObject(x64emu_t* emu, void* handle) +{ + my_dlclose(emu, handle); +} +EXPORT void* my32_SDL_LoadFunction(x64emu_t* emu, void* handle, void* name) +{ + return my_dlsym(emu, handle, name); +} + +static my_SDL_Surface_t* sdl1_videomode_org = NULL; +static my_SDL_Palette_t sdl_vm_palette; +static my_SDL_PixelFormat_t sdl_vm_pixelformal; +static my_SDL_Surface_t sdl_vm_surface; +static void* wrapSurface(void* s) +{ + if(!s) return s; + if(s==&sdl_vm_surface) { + my_SDL_Surface_32_t* src = s; + // refressh surface... + sdl1_videomode_org->h = src->h; + sdl1_videomode_org->w = src->w; + sdl1_videomode_org->pitch = src->pitch; + sdl1_videomode_org->flags = src->flags; + sdl1_videomode_org->locked = src->locked; + sdl1_videomode_org->refcount = src->refcount; + sdl1_videomode_org->offset = src->offset; + sdl1_videomode_org->unused1 = src->unused1; + sdl1_videomode_org->format_version = src->format_version; + sdl1_videomode_org->pixels = from_ptrv(src->pixels); + sdl1_videomode_org->map = from_ptrv(src->map); + sdl1_videomode_org->clip_rect.x = src->clip_rect.x; + sdl1_videomode_org->clip_rect.y = src->clip_rect.y; + sdl1_videomode_org->clip_rect.h = src->clip_rect.h; + sdl1_videomode_org->clip_rect.w = src->clip_rect.w; + return sdl1_videomode_org; + } + inplace_SDL_Surface_to_64(s); + return s; +} +static void* unwrapSurface(void* s) +{ + if(!s) return s; + if(s==&sdl_vm_surface || s==sdl1_videomode_org) { + my_SDL_Surface_32_t* dst = (my_SDL_Surface_32_t*)&sdl_vm_surface; + // refressh surface... + dst->h = sdl1_videomode_org->h; + dst->w = sdl1_videomode_org->w; + dst->pitch = sdl1_videomode_org->pitch; + dst->flags = sdl1_videomode_org->flags; + dst->locked = sdl1_videomode_org->locked; + dst->refcount = sdl1_videomode_org->refcount; + dst->offset = sdl1_videomode_org->offset; + dst->unused1 = sdl1_videomode_org->unused1; + dst->format_version = sdl1_videomode_org->format_version; + dst->pixels = to_ptrv(sdl1_videomode_org->pixels); + dst->map = to_ptrv(sdl1_videomode_org->map); + dst->clip_rect.x = sdl1_videomode_org->clip_rect.x; + dst->clip_rect.y = sdl1_videomode_org->clip_rect.y; + dst->clip_rect.h = sdl1_videomode_org->clip_rect.h; + dst->clip_rect.w = sdl1_videomode_org->clip_rect.w; + return s; + } + inplace_SDL_Surface_to_32(s); + return s; +} + +EXPORT void my32_SDL_Quit() +{ + sdl1_videomode_org = NULL; + my->SDL_Quit(); +} + +EXPORT void* my32_SDL_SetVideoMode(int width, int height, int bpp, uint32_t flags) +{ + my_SDL_Surface_t* ret = my->SDL_SetVideoMode(width, height, bpp, flags); + if (!ret) return ret; + sdl1_videomode_org = ret; + memcpy(&sdl_vm_surface, ret, sizeof(sdl_vm_surface)); + if(ret->format) { + memcpy(&sdl_vm_pixelformal, ret->format, sizeof(sdl_vm_pixelformal)); + if(ret->format->palette) { + memcpy(&sdl_vm_palette, ret->format->palette, sizeof(sdl_vm_palette)); + sdl_vm_pixelformal.palette = &sdl_vm_palette; + } + sdl_vm_surface.format = &sdl_vm_pixelformal; + } + inplace_SDL_Surface_to_32(&sdl_vm_surface); + return &sdl_vm_surface; +} + +EXPORT int my32_SDL_LockSurface(void* s) +{ + int ret = my->SDL_LockSurface(wrapSurface(s)); + unwrapSurface(s); + return ret; +} + +EXPORT void my32_SDL_UnlockSurface(void* s) +{ + my->SDL_UnlockSurface(wrapSurface(s)); + unwrapSurface(s); +} + +EXPORT int my32_SDL_Flip(void* s) +{ + int ret = my->SDL_Flip(wrapSurface(s)); + unwrapSurface(s); + return ret; +} + +EXPORT void* my32_SDL_GetVideoSurface() +{ + void* ret = my->SDL_GetVideoSurface(); + return unwrapSurface(ret); +} + +EXPORT void* my32_SDL_CreateRGBSurfaceFrom(void* pixels, int width, int height, int depth, int pitch, uint32_t rmask, uint32_t gmask, uint32_t bmask, uint32_t amask) +{ + void* p = my->SDL_CreateRGBSurfaceFrom(pixels, width, height, depth, pitch, rmask, gmask, bmask, amask); + return unwrapSurface(p); +} + + +EXPORT void my32_SDL_FreeSurface(void* s) +{ + my->SDL_FreeSurface(wrapSurface(s)); + if(s==&sdl_vm_surface) + sdl1_videomode_org = NULL; +} + +EXPORT int my32_SDL_SetColorKey(void* s, uint32_t flags, uint32_t key) +{ + int ret = my->SDL_SetColorKey(wrapSurface(s), flags, key); + unwrapSurface(s); + return ret; +} + +EXPORT int my32_SDL_PollEvent(my_SDL_Event_32_t* evt) +{ + my_SDL_Event_t event; + int ret = my->SDL_PollEvent(evt?(&event):NULL); + if(ret && evt) { + convert_SDL_Event_to_32(evt, &event); + } + return ret; +} + +EXPORT int my32_SDL_PeepEvents(my_SDL_Event_32_t* evts, int num, uint32_t action, uint32_t mask) +{ + my_SDL_Event_t events[num]; + int ret = my->SDL_PeepEvents(events, num, action, mask); + for(int i=0; iSDL_PushEvent(&event); +} + +EXPORT void* my32_SDL_ListModes(my_SDL_PixelFormat_32_t* fmt, uint32_t flags) +{ + my_SDL_PixelFormat_t format; + my_SDL_Palette_t palette; + if(fmt) { + memcpy(&format, fmt, sizeof(format)); + inplace_SDL_PixelFormat_to_64_nopalette(&format); + if(fmt->palette) { + memcpy(&palette, from_ptrv(fmt->palette), sizeof(palette)); + format.palette = &palette; + inplace_SDL_Palette_to_64(&palette); + } + } + void** ret = my->SDL_ListModes(fmt?(&format):NULL, flags); + if(!ret) + return ret; + if(ret==(void**)-1LL) + return ret; + static ptr_t available[256]; + void** p = ret; + int idx = 0; + while((*p) && (idx<255)) { + available[idx++] = to_ptrv(*p); + ++p; + } + available[idx++] = 0; + return &available; +} + +EXPORT uint32_t my32_SDL_MapRGB(my_SDL_PixelFormat_32_t* fmt, uint8_t r, uint8_t g, uint8_t b) +{ + my_SDL_PixelFormat_t format; + my_SDL_Palette_t palette; + if(fmt) { + memcpy(&format, fmt, sizeof(format)); + inplace_SDL_PixelFormat_to_64_nopalette(&format); + if(fmt->palette) { + memcpy(&palette, from_ptrv(fmt->palette), sizeof(palette)); + format.palette = &palette; + inplace_SDL_Palette_to_64(&palette); + } + } + return my->SDL_MapRGB(fmt?(&format):NULL, r, g, b); +} + +EXPORT int my32_SDL_BuildAudioCVT(my_SDL_AudioCVT_32_t* cvt, uint16_t src_fmt, uint16_t src_chn, int src_rate, uint16_t dst_fmt, uint16_t dst_ch, int dst_rate) +{ + my_SDL_AudioCVT_t l_cvt; + int ret = my->SDL_BuildAudioCVT(&l_cvt, src_fmt, src_chn, src_rate, dst_fmt, dst_ch, dst_rate); + if(ret!=-1) + convert_AudioCVT_to_32(cvt, &l_cvt); + return ret; +} + +EXPORT int my32_SDL_ConvertAudio(my_SDL_AudioCVT_32_t* cvt) +{ + my_SDL_AudioCVT_t l_cvt; + convert_AudioCVT_to_64(&l_cvt, cvt); + int ret = my->SDL_ConvertAudio(&l_cvt); + convert_AudioCVT_to_32(cvt, &l_cvt); + return ret; +} + +//EXPORT int32_t my32_SDL_GetWMInfo(x64emu_t* emu, void* p) +//{ +// // does SDL_SysWMinfo needs alignment? +// int ret = my->SDL_GetWMInfo(p); +// my32_SDL_SysWMinfo *info = (my32_SDL_SysWMinfo*)p; +// if(info->info.x11.lock_func) +// info->info.x11.lock_func = (void*)AddCheckBridge(emu->context->system, vFv_32, info->info.x11.lock_func, 0, NULL); +// if(info->info.x11.unlock_func) +// info->info.x11.unlock_func = (void*)AddCheckBridge(emu->context->system, vFv_32, info->info.x11.unlock_func, 0, NULL); +// return ret; +//} + +#define CUSTOM_INIT \ + box64->sdl1allocrw = my->SDL_AllocRW; \ + box64->sdl1freerw = my->SDL_FreeRW; + +#define NEEDED_LIBS "libm.so.6", "libdl.so.2", "librt.so.1" + +#define CUSTOM_FINI \ + my_context->sdl1allocrw = NULL; \ + my_context->sdl1freerw = NULL; + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedsdl1_private.h b/src/wrapped32/wrappedsdl1_private.h new file mode 100644 index 0000000..46853bc --- /dev/null +++ b/src/wrapped32/wrappedsdl1_private.h @@ -0,0 +1,238 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +// _fini +// _init +GOM(SDL_AddTimer, pFEupp) +GO(SDL_AllocRW, pFv) // no need to use a my_ version here +//GO(SDL_CDClose, vFp) +//GO(SDL_CDEject, iFp) +//GO(SDL_CDName, pFi) +//GO(SDL_CDNumDrives, iFv) +//GO(SDL_CDOpen, pFi) +//GO(SDL_CDPause, iFp) +//GO(SDL_CDPlay, iFpii) +//GO(SDL_CDPlayTracks, iFpiiii) +//GO(SDL_CDResume, iFp) +//GO(SDL_CDStatus, iFp) +//GO(SDL_CDStop, iFp) +//GO(SDL_ClearError, vFv) +//GO(SDL_CondBroadcast, iFp) +//GO(SDL_CondSignal, iFp) +//GO(SDL_CondWait, iFpp) +//GO(SDL_CondWaitTimeout, iFppu) +//GO(SDL_ConvertSurface, pFppu) +//GO(SDL_CreateCond, pFv) +//GO(SDL_CreateCursor, pFppiiii) +//GO(SDL_CreateMutex, pFv) +//GO(SDL_CreateRGBSurface, pFuiiiuuuu) +GOM(SDL_CreateRGBSurfaceFrom, pFpiiiiuuuu) //%noE +GO(SDL_CreateSemaphore, pFu) +GOM(SDL_CreateThread, pFEpp) +//GO(SDL_CreateYUVOverlay, pFiiup) +GO(SDL_Delay, vFu) +//GO(SDL_DestroyCond, vFp) +//GO(SDL_DestroyMutex, vFp) +//GO(SDL_DestroySemaphore, vFp) +//GO(SDL_DisplayFormat, pFp) +//GO(SDL_DisplayFormatAlpha, pFp) +//GO(SDL_DisplayYUVOverlay, iFpp) +GO(SDL_EnableKeyRepeat, iFii) +GO(SDL_EnableUNICODE, iFi) +GO(SDL_Error, vFu) +GO(SDL_EventState, CFCi) +//GO(SDL_FillRect, iFppu) +GOM(SDL_Flip, iFp) //%noE +GO(SDL_FreeCursor, vFp) +GO(SDL_FreeRW, vFp) +GOM(SDL_FreeSurface, vFp) //%noE +//GO(SDL_FreeYUVOverlay, vFp) +GO(SDL_GL_GetAttribute, iFup) +GOM(SDL_GL_GetProcAddress, pFEp) +GO(SDL_GL_LoadLibrary, iFp) +GO(SDL_GL_Lock, vFv) +GO(SDL_GL_SetAttribute, iFui) +GO(SDL_GL_SwapBuffers, vFv) +GO(SDL_GL_Unlock, vFv) +//GO(SDL_GL_UpdateRects, vFip) +GO(SDL_GetAppState, CFv) +//GO(SDL_GetClipRect, vFpp) +//GO(SDL_GetCursor, pFv) +GO(SDL_GetError, pFv) +//GOM(SDL_GetEventFilter, pFEv) +//GO(SDL_GetGammaRamp, iFppp) +GO(SDL_GetKeyName, pFu) +//GO(SDL_GetKeyRepeat, vFpp) +GO(SDL_GetKeyState, pFp) +//GO(SDL_GetModState, uFv) +GO(SDL_GetMouseState, uFpp) +GOM(SDL_GetRGB, vFupppp) //%noE +//GO(SDL_GetRGBA, vFuppppp) +//GO(SDL_GetRelativeMouseState, CFpp) +//GO(SDL_GetThreadID, uFp) +GO(SDL_GetTicks, uFv) +GOM(SDL_GetVideoInfo, pFv) //%noE +GOM(SDL_GetVideoSurface, pFv) //%noE +//GOM(SDL_GetWMInfo, iFEp) +GOM(SDL_Has3DNow, iFv) //%noE +GOM(SDL_Has3DNowExt, iFv) //%noE +GOM(SDL_HasAltiVec, iFv) //%noE +GOM(SDL_HasMMX, iFv) //%noE +GOM(SDL_HasMMXExt, iFv) //%noE +GOM(SDL_HasRDTSC, iFv) //%noE +GOM(SDL_HasSSE, iFv) //%noE +GOM(SDL_HasSSE2, iFv) //%noE +GO(SDL_Init, iFu) +//GO(SDL_InitQuickDraw, vFp) +GO(SDL_InitSubSystem, iFu) +GO(SDL_JoystickClose, vFp) +GO(SDL_JoystickEventState, iFi) +GO(SDL_JoystickGetAxis, wFpi) +GO(SDL_JoystickGetBall, iFpipp) +GO(SDL_JoystickGetButton, CFpi) +GO(SDL_JoystickGetHat, uFpi) +GO(SDL_JoystickIndex, iFp) +GO(SDL_JoystickName, pFi) +GO(SDL_JoystickNumAxes, iFp) +GO(SDL_JoystickNumBalls, iFp) +GO(SDL_JoystickNumButtons, iFp) +GO(SDL_JoystickNumHats, iFp) +GO(SDL_JoystickOpen, pFi) +GO(SDL_JoystickOpened, iFi) +GO(SDL_JoystickUpdate, vFv) +GOM(SDL_KillThread, vFEp) +GO(SDL_Linked_Version, pFv) +GOM(SDL_ListModes, pFpu) //%noE +GOM(SDL_LoadBMP_RW, pFEpi) +GOM(SDL_LoadFunction, pFEpp) +GOM(SDL_LoadObject, pFEp) +GOM(SDL_LockSurface, iFp) //%noE +//GO(SDL_LockYUVOverlay, iFp) +//GO(SDL_LowerBlit, iFpppp) +GOM(SDL_MapRGB, uFpCCC) //%noE +//GO(SDL_MapRGBA, uFpCCCC) +GO(SDL_NumJoysticks, iFv) +GOM(SDL_PeepEvents, iFpiuu) //%noE +GOM(SDL_PollEvent, iFp) //%noE +GO(SDL_PumpEvents, vFv) +GOM(SDL_PushEvent, iFp) //%noE +GOM(SDL_Quit, vFv) //%noE +GO(SDL_QuitSubSystem, vFu) +//GOM(SDL_RWFromConstMem, pFEpi) +//GOM(SDL_RWFromFP, pFEpi) +GOM(SDL_RWFromFile, pFEpp) +GOM(SDL_RWFromMem, pFEpi) +//GOM(SDL_ReadBE16, uFEp) +//GOM(SDL_ReadBE32, uFEp) +//GOM(SDL_ReadBE64, UFEp) +//GOM(SDL_ReadLE16, uFEp) +GOM(SDL_ReadLE32, uFEp) +//GOM(SDL_ReadLE64, UFEp) +//GO(SDL_RegisterApp, iFpup) +GOM(SDL_RemoveTimer, iFEp) +//GOM(SDL_SaveBMP_RW, iFEppi) +GO(SDL_SemPost, iFp) +GO(SDL_SemTryWait, iFp) +GO(SDL_SemValue, uFp) +GO(SDL_SemWait, iFp) +GO(SDL_SemWaitTimeout, iFpu) +GO(SDL_SetAlpha, iFpuC) +//GO(SDL_SetClipRect, uFpp) +GOM(SDL_SetColorKey, iFpuu) //%noE +//GO(SDL_SetColors, iFppii) +//GO(SDL_SetCursor, vFp) +GO(SDL_SetError, vFpppppp) // use ..., so putting arbitrary number of arguments... +//GOM(SDL_SetEventFilter, vFEp) +GO(SDL_SetGamma, iFfff) +GO(SDL_SetGammaRamp, iFppp) +GO(SDL_SetModState, vFu) +//GO(SDL_SetModuleHandle, vFp) +//GO(SDL_SetPalette, iFpipii) +GOM(SDL_SetTimer, iFEup) +GOM(SDL_SetVideoMode, pFiiiu) //%noE +GO(SDL_ShowCursor, iFi) +//GO(SDL_SoftStretch, iFpppp) +GO(SDL_ThreadID, uFv) +GOM(SDL_UnloadObject, vFEp) +GOM(SDL_UnlockSurface, vFp) //%noE +//GO(SDL_UnlockYUVOverlay, vFp) +GO(SDL_UnregisterApp, vFv) +//GO(SDL_UpdateRect, vFpiiuu) +//GO(SDL_UpdateRects, vFpip) +//GO(SDL_UpperBlit, iFpppp) +GO(SDL_VideoDriverName, pFpi) +//GO(SDL_VideoInit, iFpu) +GO(SDL_VideoModeOK, iFiiiu) +GO(SDL_VideoQuit, vFv) +//GO(SDL_WM_GetCaption, vFpp) +GO(SDL_WM_GrabInput, iFi) +GO(SDL_WM_IconifyWindow, iFv) +GO(SDL_WM_SetCaption, vFpp) +GOM(SDL_WM_SetIcon, vFpp) //%noE +//GO(SDL_WM_ToggleFullScreen, iFp) +//GO(SDL_WaitEvent, iFp) +//GO(SDL_WaitThread, vFpp) +GO(SDL_WarpMouse, vFWW) +GO(SDL_WasInit, uFu) +//GOM(SDL_WriteBE16, uFEpW) +//GOM(SDL_WriteBE32, uFEpu) +//GOM(SDL_WriteBE64, uFEpU) +//GOM(SDL_WriteLE16, uFEpW) +//GOM(SDL_WriteLE32, uFEpu) +//GOM(SDL_WriteLE64, uFEpU) +//GO(SDL_framerateDelay, uFp) +//GO(SDL_getFramecount, iFp) +//GO(SDL_getFramerate, iFp) +//GO(SDL_iconv, LFppppp) +//GO(SDL_iconv_close, iFp) +//GO(SDL_iconv_open, pFpp) +//GO(SDL_iconv_string, pFpppL) +//GO(SDL_initFramerate, vFp) +//GO(SDL_lltoa, pFlpi) +//GO(SDL_ltoa, pFlpi) +//GO(SDL_main, iFip) +//GO(SDL_memcmp, iFppu) +//GO(SDL_mutexP, iFp) +//GO(SDL_mutexV, iFp) +//GO(SDL_revcpy, pFppL) +//GO(SDL_setFramerate, iFpu) +//GO(SDL_snprintf, iFpupppppp) // use ... +//GO(SDL_sscanf, iFppppppp) // use ... +//GO(SDL_strcasecmp, iFpp) +//GO(SDL_strchr, pFpi) +//GO(SDL_strcmp, iFpp) +//GO(SDL_strdup, pFp) +//GO(SDL_strlcat, LFppL) +//GO(SDL_strlcpy, uFppu) +//GO(SDL_strlen, uFp) +//GO(SDL_strlwr, pFp) +//GO(SDL_strncasecmp, iFppu) +//GO(SDL_strncmp, iFppu) +//GO(SDL_strrchr, pFpi) +//GO(SDL_strrev, pFp) +//GO(SDL_strstr, pFpp) +//GO(SDL_strtod, dFpp) +//GO(SDL_strtol, iFppi) +//GO(SDL_strtoll, IFppi) +//GO(SDL_strtoul, uFppi) +//GO(SDL_strtoull, UFppi) +//GO(SDL_strupr, pFp) +//GO(SDL_ulltoa, pFLpi) +//GO(SDL_ultoa, pFLpi) +//GOM(SDL_vsnprintf, iFpupV) +GOM(SDL_OpenAudio, iFEpp) +GO(SDL_LockAudio, vFv) +GO(SDL_UnlockAudio, vFv) +GO(SDL_PauseAudio, vFi) +GO(SDL_GetAudioStatus, uFv) +//GO(SDL_LoadWAV, pFpppp) +//GO(SDL_FreeWAV, vFp) +//GOM(SDL_LoadWAV_RW, pFEpippp) +GOM(SDL_BuildAudioCVT, iFpWCiWCi) //%noE +GOM(SDL_ConvertAudio, iFp) //%noE +//GO(SDL_AudioInit, iFp) +GO(SDL_AudioQuit, vFv) +GO(SDL_MixAudio, vFppui) +GO(SDL_CloseAudio, vFv) +//GO(SDL_AudioDriverName, pFpi) diff --git a/src/wrapped32/wrappedsdl2.c b/src/wrapped32/wrappedsdl2.c new file mode 100644 index 0000000..e4a6591 --- /dev/null +++ b/src/wrapped32/wrappedsdl2.c @@ -0,0 +1,814 @@ +#include "sdl2align32.h" +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "gltools.h" +#include "sdl2rwops.h" + +#include "x64trace.h" +#include "threads.h" + +#include "sdl2align32.h" + +#include "generated/wrappedsdl2defs32.h" +#define JFEi_32 pFEpi_32 + +extern const char* sdl2Name; +#define LIBNAME sdl2 + +typedef struct { + uint8_t data[16]; +} SDL2_GUID_t; + +typedef struct { + int32_t freq; + uint16_t format; + uint8_t channels; + uint8_t silence; + uint16_t samples; + uint16_t padding; + uint32_t size; + void (*callback)(void* userdata, uint8_t* stream, int32_t len); + void* userdata; +} SDL2_AudioSpec; + +typedef struct __attribute__((packed, aligned(4))) { + int32_t freq; + uint16_t format; + uint8_t channels; + uint8_t silence; + uint16_t samples; + uint16_t padding; + uint32_t size; + ptr_t callback; // void (*callback)(void *userdata, uint8_t *stream, int32_t len); + ptr_t userdata; // void *userdata; +} SDL2_AudioSpec32; + +typedef void (*vFiupV_t)(int, uint32_t, void*, va_list); +#define ADDED_FUNCTIONS() \ + GO(SDL_LogMessageV, vFiupV_t) \ + GO(SDL_AllocRW, sdl2_allocrw) \ + GO(SDL_FreeRW, sdl2_freerw) + +#define ADDED_FINI() + +#include "generated/wrappedsdl2types32.h" +#include "wrappercallback32.h" + +#define SUPER() \ + GO(0) \ + GO(1) \ + GO(2) \ + GO(3) \ + GO(4) + + +// eventfilter +#define GO(A) \ +static uintptr_t my_eventfilter_fct_##A = 0; \ +static my_SDL2_Event_32_t event_##A = {0}; \ +static int my_eventfilter_##A(void* userdata, void* event) \ +{ \ + convert_SDL2_Event_to_32(&event_##A, event); \ + int ret = (int)RunFunctionFmt(my_eventfilter_fct_##A, "pp", userdata, &event_##A); \ + return ret; \ +} +SUPER() +#undef GO +static void* find_eventfilter_Fct(void* fct) +{ + if(!fct) return NULL; + void* p; + if((p = GetNativeFnc((uintptr_t)fct))) return p; + #define GO(A) if(my_eventfilter_fct_##A == (uintptr_t)fct) return my_eventfilter_##A; + SUPER() + #undef GO + #define GO(A) if(my_eventfilter_fct_##A == 0) {my_eventfilter_fct_##A = (uintptr_t)fct; return my_eventfilter_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for 32bits SDL2 eventfilter callback\n"); + return NULL; + +} +static void* reverse_eventfilter_Fct(void* fct) +{ + if(!fct) return fct; + if(CheckBridged(my_lib->w.bridge, fct)) + return (void*)CheckBridged(my_lib->w.bridge, fct); + #define GO(A) if(my_eventfilter_##A == fct) return (void*)my_eventfilter_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(my_lib->w.bridge, iFpp_32, fct, 0, NULL); +} +// AudioCallback +#define GO(A) \ + static uintptr_t my32_2_AudioCallback_fct_##A = 0; \ + static void my32_2_AudioCallback_##A(void* a, void* b, int c) \ + { \ + RunFunctionFmt(my32_2_AudioCallback_fct_##A, "ppi", a, b, c); \ + } +SUPER() +#undef GO +static void* find_AudioCallback_Fct(void* fct) +{ + if (!fct) return NULL; + void* p; + if ((p = GetNativeFnc((uintptr_t)fct))) return p; +#define GO(A) \ + if (my32_2_AudioCallback_fct_##A == (uintptr_t)fct) return my32_2_AudioCallback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my32_2_AudioCallback_fct_##A == 0) { \ + my32_2_AudioCallback_fct_##A = (uintptr_t)fct; \ + return my32_2_AudioCallback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for 32bit SDL2 AudioCallback callback\n"); + return NULL; +} + +EXPORT int my32_2_SDL_GetDesktopDisplayMode(int displayIndex, void* mode) +{ + my_SDL2_DisplayMode_t my_mode = { 0 }; + int ret = my->SDL_GetDesktopDisplayMode(displayIndex, &my_mode); + convert_SDL2_DisplayMode_to_32(mode, &my_mode); + return ret; +} + +EXPORT int my32_2_SDL_GetCurrentDisplayMode(int displayIndex, void* mode) +{ + my_SDL2_DisplayMode_t my_mode = { 0 }; + int ret = my->SDL_GetCurrentDisplayMode(displayIndex, &my_mode); + convert_SDL2_DisplayMode_to_32(mode, &my_mode); + return ret; +} + +EXPORT int my32_2_SDL_GetWindowDisplayMode(void* window, void* mode) +{ + my_SDL2_DisplayMode_t my_mode = { 0 }; + int ret = my->SDL_GetWindowDisplayMode(window, &my_mode); + convert_SDL2_DisplayMode_to_32(mode, &my_mode); + return ret; +} + +EXPORT int my32_2_SDL_GetDisplayMode(int dispIndex, int modeIndex, void* mode) +{ + my_SDL2_DisplayMode_t mode_l = { 0 }; + int ret = my->SDL_GetDisplayMode(dispIndex, modeIndex, &mode_l); + convert_SDL2_DisplayMode_to_32(mode, &mode_l); + return ret; +} + +EXPORT int my32_2_SDL_SetWindowDisplayMode(void* window, void* mode) +{ + my_SDL2_DisplayMode_t mode_l = { 0 }; + convert_SDL2_DisplayMode_to_64(&mode_l, mode); + return my->SDL_SetWindowDisplayMode(window, &mode_l); +} + +EXPORT void* my32_2_SDL_GetClosestDisplayMode(int index, void* mode, void* closest) +{ + my_SDL2_DisplayMode_t mode_l = { 0 }; + my_SDL2_DisplayMode_t closest_l = { 0 }; + convert_SDL2_DisplayMode_to_64(&mode_l, mode); + void* ret = my->SDL_GetClosestDisplayMode(index, &mode_l, &closest_l); + if(!ret) return NULL; + convert_SDL2_DisplayMode_to_32(closest, &closest_l); + return closest; +} + +EXPORT void* my32_2_SDL_JoystickGetDeviceGUID(void* ret, int index) +{ + *(SDL2_GUID_t*)ret = my->SDL_JoystickGetDeviceGUID(index); + return ret; +} + +EXPORT void* my32_2_SDL_JoystickGetGUIDFromString(void* ret, void* s) +{ + *(SDL2_GUID_t*)ret = my->SDL_JoystickGetGUIDFromString(s); + return ret; +} + + +EXPORT int my32_2_SDL_OpenAudio(x64emu_t* emu, void* d, void* o) +{ + SDL2_AudioSpec desired = { 0 }; + SDL2_AudioSpec output = { 0 }; + SDL2_AudioSpec32* d_ = d; + desired.channels = d_->channels; + desired.format = d_->format; + desired.freq = d_->freq; + desired.samples = d_->samples; + desired.padding = d_->padding; + desired.silence = d_->silence; + desired.size = d_->size; + desired.userdata = from_ptrv(d_->userdata); + desired.callback = find_AudioCallback_Fct(from_ptrv(d_->callback)); + int ret = my->SDL_OpenAudio(&desired, &output); + if (ret <= 0) { + return ret; + } + + if (o) { + SDL2_AudioSpec32* o_ = o; + o_->channels = output.channels; + o_->format = output.format; + o_->freq = output.freq; + o_->samples = output.samples; + o_->padding = output.padding; + o_->silence = output.silence; + o_->size = output.size; + o_->userdata = to_ptrv(output.userdata); + o_->callback = to_ptrv(output.callback); + } + return ret; +} + +EXPORT uint32_t my32_2_SDL_OpenAudioDevice(x64emu_t* emu, void* device, int iscapture, void* d, void* o, int allowed) +{ + SDL2_AudioSpec desired = { 0 }; + SDL2_AudioSpec output = { 0 }; + SDL2_AudioSpec32* d_ = d; + desired.channels = d_->channels; + desired.format = d_->format; + desired.freq = d_->freq; + desired.samples = d_->samples; + desired.padding = d_->padding; + desired.silence = d_->silence; + desired.size = d_->size; + desired.userdata = from_ptrv(d_->userdata); + desired.callback = find_AudioCallback_Fct(from_ptrv(d_->callback)); + uint32_t ret = my->SDL_OpenAudioDevice(device, iscapture, &desired, &output, allowed); + + if (o) { + SDL2_AudioSpec32* o_ = o; + o_->channels = output.channels; + o_->format = output.format; + o_->freq = output.freq; + o_->samples = output.samples; + o_->padding = output.padding; + o_->silence = output.silence; + o_->size = output.size; + o_->userdata = to_ptrv(output.userdata); + o_->callback = to_ptrv(output.callback); + } + return ret; +} + + +EXPORT int my32_2_SDL_PollEvent(my_SDL2_Event_32_t* evt) +{ + my_SDL2_Event_t event; + int ret = my->SDL_PollEvent(evt ? (&event) : NULL); + if (ret && evt) { + convert_SDL2_Event_to_32(evt, &event); + } + return ret; +} + +EXPORT int my32_2_SDL_PeepEvents(x64emu_t* emu, my_SDL2_Event_32_t* evt, int n, uint32_t action, uint32_t minType, uint32_t maxType) +{ + my_SDL2_Event_t event[n]; + int ret = my->SDL_PeepEvents(event, n, action, minType, maxType); + if (ret>0) { + for(int i=0; icontext->fullpath); + char* b = strrchr(p, '/'); + if (b) *(b + 1) = '\0'; + return p; +} + +EXPORT void my32_2_SDL_Log(x64emu_t* emu, void* fmt, void* b) +{ + myStackAlign32((const char*)fmt, (uint32_t*)b, emu->scratch); + PREPARE_VALIST_32; + my->SDL_LogMessageV(0, 3, fmt, VARARGS_32); +} + +EXPORT int my32_2_SDL_vsnprintf(x64emu_t* emu, void* buff, size_t s, void* fmt, void* b) +{ + myStackAlign32((const char*)fmt, (uint32_t*)b, emu->scratch); + PREPARE_VALIST_32; + int r = vsnprintf(buff, s, fmt, VARARGS_32); + return r; +} + +EXPORT int my32_2_SDL_snprintf(x64emu_t* emu, void* buff, size_t s, void* fmt, uint64_t* b) +{ + (void)emu; + myStackAlign32((const char*)fmt, (uint32_t*)b, emu->scratch); + PREPARE_VALIST_32; + return vsnprintf(buff, s, fmt, VARARGS_32); +} + +EXPORT void* my32_2_SDL_GL_GetProcAddress(x64emu_t* emu, void* name) +{ + khint_t k; + const char* rname = (const char*)name; + return getGLProcAddress32(emu, NULL, (glprocaddress_t)my->SDL_GL_GetProcAddress, rname); +} + +EXPORT void* my32_2_SDL_CreateRGBSurfaceWithFormatFrom(x64emu_t* emu, void* pixels, int width, int height, int depth, int pitch, uint32_t format) +{ + void* p = my->SDL_CreateRGBSurfaceWithFormatFrom(pixels, width, height, depth, pitch, format); + inplace_SDL2_Surface_to_32(p); + return p; +} + +EXPORT void* my32_2_SDL_CreateRGBSurface(x64emu_t* emu, uint32_t flags, int width, int height, int depth, uint32_t Rmask, uint32_t Gmask, uint32_t Bmask, uint32_t Amask) +{ + void* p = my->SDL_CreateRGBSurface(flags, width, height, depth, Rmask, Gmask, Bmask, Amask); + inplace_SDL2_Surface_to_32(p); + return p; +} + +EXPORT void* my32_2_SDL_CreateRGBSurfaceFrom(x64emu_t* emu, void* pixels, int width, int height, int depth, int pitch, uint32_t rmask, uint32_t gmask, uint32_t bmask, uint32_t amask) +{ + void* p = my->SDL_CreateRGBSurfaceFrom(pixels, width, height, depth, pitch, rmask, gmask, bmask, amask); + inplace_SDL2_Surface_to_32(p); + return p; +} + + +EXPORT void my32_2_SDL_SetWindowIcon(x64emu_t* emu, void* window, void* icon) +{ + inplace_SDL2_Surface_to_64(icon); + my->SDL_SetWindowIcon(window, icon); + inplace_SDL2_Surface_to_32(icon); +} + +EXPORT void* my32_2_SDL_CreateColorCursor(void* s, int x, int y) +{ + inplace_SDL2_Surface_to_64(s); + void* ret = my->SDL_CreateColorCursor(s, x, y); + inplace_SDL2_Surface_to_32(s); + return ret; +} + +EXPORT int my32_2_SDL_FillRect(x64emu_t* emu, void* s, void* rect, uint32_t color) +{ + inplace_SDL2_Surface_to_64(s); + int ret = my->SDL_FillRect(s, rect, color); + inplace_SDL2_Surface_to_32(s); + return ret; +} + +EXPORT void* my32_2_SDL_CreateTextureFromSurface(void* r, void* s) +{ + inplace_SDL2_Surface_to_64(s); + void* ret = my->SDL_CreateTextureFromSurface(r, s); + inplace_SDL2_Surface_to_32(s); + return ret; +} + +EXPORT int my32_2_SDL_SetColorKey(void* s, int flag, uint32_t color) +{ + inplace_SDL2_Surface_to_64(s); + int ret = my->SDL_SetColorKey(s, flag, color); + inplace_SDL2_Surface_to_32(s); + return ret; +} + +EXPORT void* my32_2_SDL_ConvertSurface(void* s, my_SDL2_PixelFormat_32_t* fmt, uint32_t flags) +{ + inplace_SDL2_Surface_to_64(s); + void* ret = my->SDL_ConvertSurface(s, replace_SDL2_PixelFormat_to_64_ext(fmt), flags); + inplace_SDL2_Surface_to_32(s); + if(ret!=s) inplace_SDL2_Surface_to_32(ret); + return ret; +} + +EXPORT void* my32_2_SDL_ConvertSurfaceFormat(void* s, uint32_t fmt, uint32_t flags) +{ + inplace_SDL2_Surface_to_64(s); + void* ret = my->SDL_ConvertSurfaceFormat(s, fmt, flags); + inplace_SDL2_Surface_to_32(s); + if(ret!=s) inplace_SDL2_Surface_to_32(ret); + return ret; +} + +EXPORT void my32_2_SDL_FreeSurface(x64emu_t* emu, void* surface) +{ + inplace_SDL2_Surface_to_64(surface); + my->SDL_FreeSurface(surface); +} + +void* my32_prepare_thread(x64emu_t* emu, void* f, void* arg, int ssize, void** pet); +EXPORT void* my32_2_SDL_CreateThread(x64emu_t* emu, void* f, void* n, void* p) +{ + void* et = NULL; + void* fnc = my32_prepare_thread(emu, f, p, 0, &et); + return my->SDL_CreateThread(fnc, n, et); +} + +EXPORT int my32_2_SDL_WaitEventTimeout(my_SDL2_Event_32_t* evt, int timeout) +{ + my_SDL2_Event_t event = {0}; + int ret = my->SDL_WaitEventTimeout(evt?(&event):NULL, timeout); + convert_SDL2_Event_to_32(evt, &event); + return ret; +} + +EXPORT int my32_2_SDL_PushEvent(my_SDL2_Event_32_t* evt) +{ + my_SDL2_Event_t event = {0}; + convert_SDL2_Event_to_64(&event, evt); + return my->SDL_PushEvent(&event); +} + +EXPORT void my32_2_SDL_AddEventWatch(x64emu_t* emu, void* p, void* userdata) +{ + my->SDL_AddEventWatch(find_eventfilter_Fct(p), userdata); +} +EXPORT void my32_2_SDL_DelEventWatch(x64emu_t* emu, void* p, void* userdata) +{ + my->SDL_DelEventWatch(find_eventfilter_Fct(p), userdata); +} +EXPORT void my32_2_SDL_SetEventFilter(x64emu_t* emu, void* p, void* userdata) +{ + my->SDL_SetEventFilter(find_eventfilter_Fct(p), userdata); +} + +EXPORT void* my32_2_SDL_RWFromFile(x64emu_t* emu, void* a, void* b) +{ + SDL2_RWops_t* r = (SDL2_RWops_t*)my->SDL_RWFromFile(a, b); + void* ret = AddNativeRW2(emu, r); + inplace_SDL2_RWops_to_32(ret); + return ret; +} + +EXPORT void* my32_2_SDL_RWFromMem(x64emu_t* emu, void* a, int b) +{ + SDL2_RWops_t* r = (SDL2_RWops_t*)my->SDL_RWFromMem(a, b); + void* ret = AddNativeRW2(emu, r); + inplace_SDL2_RWops_to_32(ret); + return ret; +} + +EXPORT void *my32_2_SDL_LoadBMP_RW(x64emu_t* emu, void* a, int b) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t* rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + void* r = my->SDL_LoadBMP_RW(rw, b); + if(b==0) { + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + } + inplace_SDL2_Surface_to_32(r); + return r; +} +EXPORT int my32_2_SDL_GameControllerAddMappingsFromRW(x64emu_t* emu, void* a, int b) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + int r = my->SDL_GameControllerAddMappingsFromRW(rw, b); + if(b==0) { + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + } + return r; +} + +EXPORT int64_t my32_2_SDL_RWseek(x64emu_t* emu, void* a, int64_t offset, int whence) +{ + //sdl2_my_t *my = (sdl2_my_t *)emu->context->sdl2lib->priv.w.p2; + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + int64_t ret = RWNativeSeek2(rw, offset, whence); + RWNativeEnd2(rw); + return ret; +} +EXPORT int64_t my32_2_SDL_RWtell(x64emu_t* emu, void* a) +{ + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + int64_t ret = RWNativeSeek2(rw, 0, 1); //1 == RW_SEEK_CUR + RWNativeEnd2(rw); + return ret; +} +EXPORT int64_t my32_2_SDL_RWsize(x64emu_t* emu, void* a) +{ + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + int64_t ret = RWNativeSize2(rw); //1 == RW_SEEK_CUR + RWNativeEnd2(rw); + return ret; +} +EXPORT uint64_t my32_2_SDL_RWread(x64emu_t* emu, void* a, void* ptr, uint64_t size, uint64_t maxnum) +{ + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t ret = RWNativeRead2(rw, ptr, size, maxnum); + RWNativeEnd2(rw); + return ret; +} +EXPORT uint64_t my32_2_SDL_RWwrite(x64emu_t* emu, void* a, const void* ptr, uint64_t size, uint64_t maxnum) +{ + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t ret = RWNativeWrite2(rw, ptr, size, maxnum); + RWNativeEnd2(rw); + return ret; +} +EXPORT int my32_2_SDL_RWclose(x64emu_t* emu, void* a) +{ + //sdl2_my_t *my = (sdl2_my_t *)emu->context->sdl2lib->priv.w.p2; + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + return RWNativeClose2(rw); +} + +EXPORT uint64_t my32_2_SDL_ReadU8(x64emu_t* emu, void* a) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_ReadU8(rw); + RWNativeEnd2(rw); + return r; +} +EXPORT uint64_t my32_2_SDL_ReadBE16(x64emu_t* emu, void* a) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_ReadBE16(rw); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} +EXPORT uint64_t my32_2_SDL_ReadBE32(x64emu_t* emu, void* a) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_ReadBE32(rw); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} +EXPORT uint64_t my32_2_SDL_ReadBE64(x64emu_t* emu, void* a) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_ReadBE64(rw); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} +EXPORT uint64_t my32_2_SDL_ReadLE16(x64emu_t* emu, void* a) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_ReadLE16(rw); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} +EXPORT uint64_t my32_2_SDL_ReadLE32(x64emu_t* emu, void* a) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_ReadLE32(rw); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} +EXPORT uint64_t my32_2_SDL_ReadLE64(x64emu_t* emu, void* a) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_ReadLE64(rw); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} +EXPORT uint64_t my32_2_SDL_WriteU8(x64emu_t* emu, void* a, uint8_t v) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_WriteU8(rw, v); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} +EXPORT uint64_t my32_2_SDL_WriteBE16(x64emu_t* emu, void* a, uint16_t v) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_WriteBE16(rw, v); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} +EXPORT uint64_t my32_2_SDL_WriteBE32(x64emu_t* emu, void* a, uint64_t v) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_WriteBE32(rw, v); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} +EXPORT uint64_t my32_2_SDL_WriteBE64(x64emu_t* emu, void* a, uint64_t v) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_WriteBE64(rw, v); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} +EXPORT uint64_t my32_2_SDL_WriteLE16(x64emu_t* emu, void* a, uint16_t v) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_WriteLE16(rw, v); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} +EXPORT uint64_t my32_2_SDL_WriteLE32(x64emu_t* emu, void* a, uint64_t v) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_WriteLE32(rw, v); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} +EXPORT uint64_t my32_2_SDL_WriteLE64(x64emu_t* emu, void* a, uint64_t v) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + uint64_t r = my->SDL_WriteLE64(rw, v); + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + return r; +} + +typedef struct SDL_version_s +{ + uint8_t major; + uint8_t minor; + uint8_t patch; +} SDL_version_t; + +typedef struct SDL_version_32_s //removed packed attribute +{ + uint8_t major; + uint8_t minor; + uint8_t patch; +} SDL_version_32_t; + +typedef struct SDL_SysWMinfo_s +{ + SDL_version_t version; + int subsystem; // 1=Windows, 2 =X11, 6=Wayland + union + { + struct + { + void* display; //Display + unsigned long window; //Window + } x11; + uint8_t dummy[64]; + } info; +} SDL_SysWMinfo_t; + +typedef struct SDL_SysWMinfo_32_s +{ + SDL_version_32_t version; + int subsystem; // 1=Windows, 2 =X11, 6=Wayland + union + { + struct + { + ptr_t display; //Display* + ulong_t window; //Window + } x11; + uint8_t dummy[64]; + } info; +} SDL_SysWMinfo_32_t; +void* FindDisplay(void* d); +EXPORT int my32_2_SDL_GetWindowWMInfo(void* w, SDL_SysWMinfo_32_t* i) +{ + // 32bits and 64bits have the same size... + // TODO: Check if it's true + int ret = my->SDL_GetWindowWMInfo(w, i); + if(i->subsystem==2) { + // inplace conversion + SDL_SysWMinfo_t* i_l = (SDL_SysWMinfo_t*) i; + i->info.x11.display = to_ptrv(FindDisplay(i_l->info.x11.display)); + i->info.x11.window = to_ulong(i_l->info.x11.window); + } + return ret; +} + +typedef struct my_SDL_MessageBoxButtonData_s +{ + uint32_t flags; + int buttonid; + const char* text; +} my_SDL_MessageBoxButtonData_t; + +typedef struct my_SDL_MessageBoxData_s +{ + uint32_t flags; + void* window; //SDL_Window* + const char* title; + const char* message; + int numbuttons; + my_SDL_MessageBoxButtonData_t* buttons; + void* colorScheme; //const SDL_MessageBoxColorScheme +} my_SDL_MessageBoxData_t; + +typedef struct my_SDL_MessageBoxButtonData_32_s +{ + uint32_t flags; + int buttonid; + ptr_t text; //const char* +} my_SDL_MessageBoxButtonData_32_t; + +typedef struct my_SDL_MessageBoxData_32_s +{ + uint32_t flags; + ptr_t window; //SDL_Window* + ptr_t title; //const char* + ptr_t message; //const char* + int numbuttons; + ptr_t buttons; //my_SDL_MessageBoxButtonData_t* + ptr_t colorScheme; //const SDL_MessageBoxColorScheme +} my_SDL_MessageBoxData_32_t; + +EXPORT int my32_2_SDL_ShowMessageBox(my_SDL_MessageBoxData_32_t* msgbox, int* btn) +{ + my_SDL_MessageBoxData_t msgbox_l; + my_SDL_MessageBoxButtonData_t btns_l[msgbox->numbuttons]; + msgbox_l.flags = msgbox->flags; + msgbox_l.window = from_ptrv(msgbox->window); + msgbox_l.title = from_ptrv(msgbox->title); + msgbox_l.message = from_ptrv(msgbox->message); + msgbox_l.numbuttons = msgbox->numbuttons; + msgbox_l.buttons = btns_l; + msgbox_l.colorScheme = from_ptrv(msgbox->colorScheme); + my_SDL_MessageBoxButtonData_32_t* src = from_ptrv(msgbox->buttons); + for(int i=0; iSDL_ShowMessageBox(&msgbox_l, btn); +} + +EXPORT unsigned long my32_2_SDL_GetThreadID(x64emu_t* emu, void* thread) +{ + unsigned long ret = my->SDL_GetThreadID(thread); + int max = 10; + while (!ret && max--) { + sched_yield(); + ret = my->SDL_GetThreadID(thread); + } + return ret; +} + +EXPORT int my32_2_SDL_GetCPUCount(x64emu_t* emu) +{ + int ret = my->SDL_GetCPUCount(); + if(BOX64ENV(maxcpu) && ret>BOX64ENV(maxcpu)) + ret = BOX64ENV(maxcpu); + return ret; +} + + + +#define ALTMY my32_2_ + +#define CUSTOM_INIT \ + box64->sdl2allocrw = my->SDL_AllocRW; \ + box64->sdl2freerw = my->SDL_FreeRW; + +#define NEEDED_LIBS "libdl.so.2", "libm.so.6", "librt.so.1", "libpthread.so.0" + +#define CUSTOM_FINI \ + my_context->sdl2allocrw = NULL; \ + my_context->sdl2freerw = NULL; + + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedsdl2_private.h b/src/wrapped32/wrappedsdl2_private.h new file mode 100644 index 0000000..267d350 --- /dev/null +++ b/src/wrapped32/wrappedsdl2_private.h @@ -0,0 +1,751 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh! +#endif + +//%S J SDL2_GUID_t uuuu +// SDL_GUID is struct uin8_t data[16] => UU when in args, H when is return + +// _fini +// _init +//GO(SDL_abs, iFi) +//GO(SDL_acos, dFd) +//GO(SDL_acosf, fFf) +GOM(SDL_AddEventWatch, vFEpp) +// SDL_AddHintCallback +//GOM(SDL_AddTimer, pFEupp) +//GO(SDL_AllocFormat, pFu) +//GO(SDL_AllocPalette, pFi) +//GO(SDL_AllocRW, pFv) // no need to create a "my_" probably +GO(SDL_asin, dFd) +GO(SDL_asinf, fFf) +GO(SDL_atan, dFd) +GO(SDL_atan2, dFdd) +GO(SDL_atan2f, fFff) +GO(SDL_atanf, fFf) +GO(SDL_atof, dFp) +GO(SDL_atoi, iFp) +GO(SDL_AtomicAdd, iFpi) +GO(SDL_AtomicCAS, uFpii) +//GO(SDL_AtomicCASPtr, uFppp) +GO(SDL_AtomicGet, iFp) +//GO(SDL_AtomicGetPtr, pFp) +GO(SDL_AtomicLock, vFp) +GO(SDL_AtomicSet, iFpi) +//GO(SDL_AtomicSetPtr, pFpp) +GO(SDL_AtomicTryLock, uFp) +GO(SDL_AtomicUnlock, vFp) +//GO(SDL_AudioInit, iFp) +GO(SDL_AudioQuit, vFv) +//GO(SDL_AudioStreamAvailable, iFp) +//GO(SDL_AudioStreamClear, vFp) +GO(SDL_AudioStreamFlush, iFp) +GO(SDL_AudioStreamGet, iFppi) +GO(SDL_AudioStreamPut, iFppi) +//GO(SDL_BuildAudioCVT, iFpWCiWCi) +//GO(SDL_CalculateGammaRamp, vFfp) +GO(SDL_calloc, pFLL) +GO(SDL_CaptureMouse, iFu) +GO(SDL_ceil, dFd) +GO(SDL_ceilf, fFf) +GO(SDL_ClearError, vFv) +GO(SDL_ClearHints, vFv) +GO(SDL_ClearQueuedAudio, vFu) +GO(SDL_CloseAudio, vFv) +GO(SDL_CloseAudioDevice, vFu) +//GO(SDL_ComposeCustomBlendMode, uFuuuuuu) +//GO(SDL_CondBroadcast, iFp) +//GO(SDL_CondSignal, iFp) +//GO(SDL_CondWait, iFpp) +//GO(SDL_CondWaitTimeout, iFppu) +//GO(SDL_ConvertAudio, iFp) +//GO(SDL_ConvertPixels, iFiiupiupi) +GOM(SDL_ConvertSurface, pFppu) //%noE +GOM(SDL_ConvertSurfaceFormat, pFpuu) //%noE +//GO(SDL_copysign, dFdd) +//GO(SDL_copysignf, fFff) +//GO(SDL_cos, dFd) +//GO(SDL_cosf, fFf) +GOM(SDL_CreateColorCursor, pFpii) //%noE +//GO(SDL_CreateCond, pFv) +//GO(SDL_CreateCursor, pFppiiii) +GO(SDL_CreateMutex, pFv) +GO(SDL_CreateRenderer, pFpiu) +GOM(SDL_CreateRGBSurface, pFEuiiiuuuu) +GOM(SDL_CreateRGBSurfaceFrom, pFEpiiiiuuuu) +//GO(SDL_CreateRGBSurfaceWithFormat, pFuiiiu) +GOM(SDL_CreateRGBSurfaceWithFormatFrom, pFEpiiiiu) +GO(SDL_CreateSemaphore, pFu) +//GO(SDL_CreateShapedWindow, pFpuuuuu) +//GO(SDL_CreateSoftwareRenderer, pFp) +GO(SDL_CreateSystemCursor, pFu) +GO(SDL_CreateTexture, pFpuiii) +GOM(SDL_CreateTextureFromSurface, pFpp) //%noE +GOM(SDL_CreateThread, pFEppp) +// SDL_CreateThreadWithStackSize +GO(SDL_CreateWindow, pFpiiiiu) +GO(SDL_CreateWindowAndRenderer, iFiiuBp_Bp_) +//GO(SDL_CreateWindowFrom, pFp) +GO(SDL_Delay, vFu) +GOM(SDL_DelEventWatch, vFEpp) +// SDL_DelHintCallback +//GO(SDL_DequeueAudio, uFupu) +GO(SDL_DestroyCond, vFp) +GO(SDL_DestroyMutex, vFp) +GO(SDL_DestroyRenderer, vFp) +GO(SDL_DestroySemaphore, vFp) +GO(SDL_DestroyTexture, vFp) +GO(SDL_DestroyWindow, vFp) +//GO(SDL_DestroyWindowSurface, iFp) +//GO(SDL_DetachThread, vFp) +GO(SDL_DisableScreenSaver, vFv) +//GO(SDL_DuplicateSurface, pFp) +//GOM(SDL_DYNAPI_entry, iFEupu) +GO(SDL_EnableScreenSaver, vFv) +//GO(SDL_EnclosePoints, uFpipp) +GO(SDL_Error, iFu) +GO(SDL_EventState, CFui) +GO(SDL_exp, dFd) +GO(SDL_expf, fFf) +GO(SDL_fabs, dFd) +GO(SDL_fabsf, fFf) +GOM(SDL_FillRect, iFEppu) +//GO(SDL_FillRects, iFppiu) +// SDL_FilterEvents +//GO(SDL_floor, dFd) +//GO(SDL_floorf,fFf) +//GO(SDL_FlushEvent, vFu) +//GO(SDL_FlushEvents, vFuu) +//GO(SDL_fmod, dFdd) +//GO(SDL_fmodf, fFff) +GO(SDL_free, vFp) +GO(SDL_FreeAudioStream, vFp) +GO(SDL_FreeCursor, vFp) +//GO(SDL_FreeFormat, vFp) +//GO(SDL_FreePalette, vFp) +GO(SDL_FreeRW, vFp) +GOM(SDL_FreeSurface, vFEp) +//GO(SDL_FreeWAV, vFp) +GO(SDL_GameControllerAddMapping, iFp) +GOM(SDL_GameControllerAddMappingsFromRW, iFEpi) +GO(SDL_GameControllerClose, vFp) +GO(SDL_GameControllerEventState, iFi) +GO(SDL_GameControllerFromInstanceID, pFi) +GO(SDL_GameControllerFromPlayerIndex, pFi) +GO(SDL_GameControllerGetAttached, iFp) +GO(SDL_GameControllerGetAxis, wFpi) +GO(SDL_GameControllerGetAxisFromString, iFp) +//GO(SDL_GameControllerGetBindForAxis, HFpi) +//GO(SDL_GameControllerGetBindForButton, HFpi) +GO(SDL_GameControllerGetButton, CFpi) +GO(SDL_GameControllerGetButtonFromString, iFp) +GO(SDL_GameControllerGetFirmwareVersion, WFp) +GO(SDL_GameControllerGetJoystick, pFp) +//GO(SDL_GameControllerGetNumTouchpads, iFp) +//GO(SDL_GameControllerGetNumTouchpadFingers, iFpi) +//GO(SDL_GameControllerGetPlayerIndex, iFp) +//GO(SDL_GameControllerGetProduct, WFp) +//GO(SDL_GameControllerGetProductVersion, WFp) +//GO(SDL_GameControllerGetSensorData, iFpipi) +//GO(SDL_GameControllerGetSensorDataWithTimestamp, iFpippi) +//GO(SDL_GameControllerGetSerial, pFp) +//GO(SDL_GameControllerGetStringForAxis, pFi) +//GO(SDL_GameControllerGetStringForButton, pFi) +//GO(SDL_GameControllerGetTouchpadFinger, iFpiipppp) +GO(SDL_GameControllerGetType, uFp) +GO(SDL_GameControllerGetVendor, WFp) +GO(SDL_GameControllerHasAxis, iFpu) +GO(SDL_GameControllerHasButton, uFpi) +GO(SDL_GameControllerHasLED, iFp) +GO(SDL_GameControllerHasRumble, iFp) +GO(SDL_GameControllerHasSensor, iFpi) +GO(SDL_GameControllerIsSensorEnabled, uFpi) +GO(SDL_GameControllerMapping, pFp) +GO(SDL_GameControllerMappingForDeviceIndex, pFi) +GO(SDL_GameControllerMappingForGUID, pFpp) +GO(SDL_GameControllerMappingForIndex, pFi) +GO(SDL_GameControllerName, pFp) +GO(SDL_GameControllerNameForIndex, pFi) +GO(SDL_GameControllerNumMappings, iFv) +GO(SDL_GameControllerOpen, pFi) +GO(SDL_GameControllerPath, pFp) +GO(SDL_GameControllerPathForIndex, pFi) +GO(SDL_GameControllerRumble, iFpWWu) +GO(SDL_GameControllerRumbleTriggers, iFpWWu) +GO(SDL_GameControllerSetLED, iFpCCC) +GO(SDL_GameControllerSetPlayerIndex, vFpi) +GO(SDL_GameControllerSetSensorEnabled, iFpiu) +GO(SDL_GameControllerTypeForIndex, uFi) +GO(SDL_GameControllerUpdate, vFv) +// SDL_GetAssertionHandler +//GO(SDL_GetAssertionReport, pFv) +//GO(SDL_GetAudioDeviceName, pFii) +GO(SDL_GetAudioDeviceStatus, uFu) +//GO(SDL_GetAudioDriver, pFi) +//GO(SDL_GetAudioDeviceSpec, iFiip) +GO(SDL_GetAudioStatus, uFv) +GOM(SDL_GetBasePath, pFEv) +GO(SDL_GetClipboardText, pFv) +//GO(SDL_GetClipRect, vFpp) +GOM(SDL_GetClosestDisplayMode, pFipp) //%noE +//GO(SDL_GetColorKey, iFpp) +GO(SDL_GetCPUCacheLineSize, iFv) +GOM(SDL_GetCPUCount, iFEv) +GO(SDL_GetCurrentAudioDriver, pFv) +GOM(SDL_GetCurrentDisplayMode, iFip) //%noE +GO(SDL_GetCurrentVideoDriver, pFv) +GO(SDL_GetCursor, pFv) +// SDL_GetDefaultAssertionHandler +//GO(SDL_GetDefaultAudioInfo, iFppi) +//GO(SDL_GetDefaultCursor, pFv) +GOM(SDL_GetDesktopDisplayMode, iFip) //%noE +GO(SDL_GetDisplayBounds, iFip) +GO(SDL_GetDisplayDPI, iFippp) +GOM(SDL_GetDisplayMode, iFiip) //%noE +GO(SDL_GetDisplayName, pFi) +//GO(SDL_GetDisplayOrientation, uFi) +GO(SDL_GetDisplayUsableBounds, iFip) +GO(SDL_getenv, pFp) +GO(SDL_GetError, pFv) +//GOM(SDL_GetEventFilter, iFEpp) +//GO(SDL_GetGlobalMouseState, uFpp) +//GO(SDL_GetGrabbedWindow, pFv) +//GO(SDL_GetHint, pFp) +GO(SDL_GetHintBoolean, uFpu) +//GOM(SDL_GetJoystickGUIDInfo, vFGpppp) +GO(SDL_GetKeyboardFocus, pFv) +GO(SDL_GetKeyboardState, pFp) +//GO(SDL_GetKeyFromName, iFp) +GO(SDL_GetKeyFromScancode, iFu) +GO(SDL_GetKeyName, pFi) +//GO(SDL_GetMemoryFunctions, vFpppp) +GO(SDL_GetModState, uFv) +GO(SDL_GetMouseFocus, pFv) +GO(SDL_GetMouseState, uFpp) +GO(SDL_GetNumAllocations, iFv) +GO(SDL_GetNumAudioDevices, iFi) +GO(SDL_GetNumAudioDrivers, iFv) +GO(SDL_GetNumDisplayModes, iFi) +GO(SDL_GetNumRenderDrivers, iFv) +GO(SDL_GetNumTouchDevices, iFv) +GO(SDL_GetNumTouchFingers, iFu) +GO(SDL_GetNumVideoDisplays, iFv) +GO(SDL_GetNumVideoDrivers, iFv) +//GOM(SDL_GetOriginalMemoryFunctions, +GO(SDL_GetPerformanceCounter, UFv) +GO(SDL_GetPerformanceFrequency, UFv) +GO(SDL_GetPixelFormatName, pFu) +GO(SDL_GetPlatform, pFv) +//GO(SDL_GetPointDisplayIndex, iFp) +//GO(SDL_GetPowerInfo, uFpp) +//GO(SDL_GetPreferredLocales, pFv) +GO(SDL_GetPrefPath, pFpp) +//GO(SDL_GetPrimarySelectionText, pFv) +//GO(SDL_GetQueuedAudioSize, uFu) +//GO(SDL_GetRectDisplayIndex, iFp) +GO(SDL_GetRelativeMouseMode, iFv) +GO(SDL_GetRelativeMouseState, uFpp) +//GO(SDL_GetRenderDrawBlendMode, iFpp) +//GO(SDL_GetRenderDrawColor, iFppppp) +//GO(SDL_GetRenderDriverInfo, iFip) +//GO(SDL_GetRenderer, pFp) +//GO(SDL_GetRendererInfo, iFpp) +//GO(SDL_GetRendererOutputSize, iFppp) +//GO(SDL_GetRenderTarget, pFp) +//GO(SDL_GetRevision, pFv) +//GO(SDL_GetRevisionNumber, iFv) +//GO(SDL_GetRGB, vFupppp) +//GO(SDL_GetRGBA, vFuppppp) +GO(SDL_GetScancodeFromKey, uFi) +//GO(SDL_GetScancodeFromName, uFp) +//GO(SDL_GetScancodeName, pFu) +//GO(SDL_GetShapedWindowMode, iFpp) +//GO(SDL_GetSurfaceAlphaMod, iFpp) +//GO(SDL_GetSurfaceBlendMode, iFpp) +//GO(SDL_GetSurfaceColorMod, iFpppp) +GO(SDL_GetSystemRAM, iFv) +//GO(SDL_GetTextureAlphaMod, iFpp) +//GO(SDL_GetTextureBlendMode, iFpp) +//GO(SDL_GetTextureColorMod, iFpppp) +GOM(SDL_GetThreadID, hFEp) +//GO(SDL_GetThreadName, pFp) +GO(SDL_GetTicks, uFv) +//GO(SDL_GetTicks64, UFv) +//GO(SDL_GetTouchDevice, lFi) +//GO(SDL_GetTouchDeviceType, iFl) +//GO(SDL_GetTouchFinger, pFli) +GO(SDL_GetVersion, vFp) +GO(SDL_GetVideoDriver, pFi) +//GO(SDL_GetWindowBordersSize, iFppppp) +//GO(SDL_GetWindowBrightness, fFp) +GO(SDL_GetWindowData, pFpp) +GO(SDL_GetWindowDisplayIndex, iFp) +GOM(SDL_GetWindowDisplayMode, iFpp) //%noE +GO(SDL_GetWindowFlags, uFp) +GO(SDL_GetWindowFromID, pFu) +//GO(SDL_GetWindowGammaRamp, iFpppp) +GO(SDL_GetWindowGrab, iFp) +GO(SDL_GetWindowID, uFp) +GO(SDL_GetWindowMaximumSize, vFppp) +GO(SDL_GetWindowMinimumSize, vFppp) +//GO(SDL_GetWindowOpacity, iFpp) +//GO(SDL_GetWindowPixelFormat, uFp) +GO(SDL_GetWindowPosition, vFppp) +GO(SDL_GetWindowSize, vFppp) +//GO(SDL_GetWindowSizeInPixels, vFppp) +//GO(SDL_GetWindowSurface, pFp) +GO(SDL_GetWindowTitle, pFp) +GOM(SDL_GetWindowWMInfo, iFpp) //%noE +GO(SDL_GetYUVConversionMode, uFv) +GO(SDL_GetYUVConversionModeForResolution, uFii) +//GO(SDL_GL_BindTexture, iFppp) +GO(SDL_GL_CreateContext, pFp) +GO(SDL_GL_DeleteContext, vFp) +GO(SDL_GL_ExtensionSupported, iFp) +GO(SDL_GL_GetAttribute, iFup) +GO(SDL_GL_GetCurrentContext, pFv) +GO(SDL_GL_GetCurrentWindow, pFv) +GO(SDL_GL_GetDrawableSize, vFppp) +GOM(SDL_GL_GetProcAddress, pFEp) +GO(SDL_GL_GetSwapInterval, iFv) +GO(SDL_GL_LoadLibrary, iFp) +GO(SDL_GL_MakeCurrent, iFpp) +GO(SDL_GL_ResetAttributes, vFv) +GO(SDL_GL_SetAttribute, iFui) +GO(SDL_GL_SetSwapInterval, iFi) +GO(SDL_GL_SwapWindow, vFp) +GO(SDL_GL_UnbindTexture, iFp) +GO(SDL_GL_UnloadLibrary, vFv) +//GO(SDL_GUIDToString, vFUUpi) +GO(SDL_HapticClose, vFp) +GO(SDL_HapticDestroyEffect, vFpi) +GO(SDL_HapticEffectSupported, iFpp) +GO(SDL_HapticGetEffectStatus, iFpi) +GO(SDL_HapticIndex, iFp) +GO(SDL_HapticName, pFi) +GO(SDL_HapticNewEffect, iFpp) +GO(SDL_HapticNumAxes, iFp) +GO(SDL_HapticNumEffects, iFp) +GO(SDL_HapticNumEffectsPlaying, iFp) +GO(SDL_HapticOpen, pFi) +GO(SDL_HapticOpened, iFi) +GO(SDL_HapticOpenFromJoystick, pFp) +GO(SDL_HapticOpenFromMouse, pFv) +GO(SDL_HapticPause, iFp) +GO(SDL_HapticQuery, uFp) +GO(SDL_HapticRumbleInit, iFp) +GO(SDL_HapticRumblePlay, iFpfu) +GO(SDL_HapticRumbleStop, iFp) +GO(SDL_HapticRumbleSupported, iFp) +GO(SDL_HapticRunEffect, iFpiu) +GO(SDL_HapticSetAutocenter, iFpi) +GO(SDL_HapticSetGain, iFpi) +GO(SDL_HapticStopAll, iFp) +GO(SDL_HapticStopEffect, iFpi) +GO(SDL_HapticUnpause, iFp) +GO(SDL_HapticUpdateEffect, iFpip) +//GOM(SDL_Has3DNow, iFv) +//GOM(SDL_HasAltiVec, iFv) +//GOM(SDL_HasAVX, iFv) +//GOM(SDL_HasAVX2, iFv) +//GOM(SDL_HasAVX512F, iFv) +GO(SDL_HasClipboardText, iFv) +//GO(SDL_HasColorKey, uFp) +GO(SDL_HasEvent, uFu) +GO(SDL_HasEvents, uFuu) +//GO(SDL_HasIntersection, uFpp) +//GO(SDL_HasLASX, iFv) +//GO(SDL_HasLSX, iFv) +//GOM(SDL_HasMMX, iFv) +//GOM(SDL_HasNEON, iFv) +//GOM(SDL_HasRDTSC, iFv) +//GO(SDL_HasPrimarySelectionText, iFv) +//GO(SDL_HasScreenKeyboardSupport, iFv) +//GOM(SDL_HasSSE, iFv) +//GOM(SDL_HasSSE2, iFv) +//GOM(SDL_HasSSE3, iFv) +//GOM(SDL_HasSSE41, iFv) +//GOM(SDL_HasSSE42, iFv) +GO(SDL_HideWindow, vFp) +//GO(SDL_HasWindowSurface, iFp) +//GO(SDL_iconv, LFppppp) +//GO(SDL_iconv_close, iFp) +//GO(SDL_iconv_open, pFpp) +GO(SDL_iconv_string, pFpppL) +GO(SDL_Init, iFu) +GO(SDL_InitSubSystem, iFu) +//GO(SDL_IntersectRect, uFppp) +//GO(SDL_IntersectRectAndLine, uFppppp) +//GO(SDL_isdigit, iFi) +GO(SDL_IsGameController, uFi) +//GO(SDL_IsScreenKeyboardShown, uFp) +GO(SDL_IsScreenSaverEnabled, iFv) +//GO(SDL_IsShapedWindow, uFp) +GO(SDL_isspace, iFi) +GO(SDL_IsTablet, uFv) +GO(SDL_IsTextInputActive, iFv) +//GO(SDL_itoa, pFipi) +//GO(SDL_JoystickAttachVirtualEx, iFp) +GO(SDL_JoystickClose, vFp) +//GO(SDL_JoystickCurrentPowerLevel, iFp) +GO(SDL_JoystickEventState, iFi) +//GO(SDL_JoystickFromInstanceID, pFi) +//GO(SDL_JoystickGetAttached, iFp) +GO(SDL_JoystickGetAxis, wFpi) +//GO(SDL_JoystickGetAxisInitialState, uFpip) +//GO(SDL_JoystickGetBall, iFpipp) +GO(SDL_JoystickGetButton, CFpi) +GOS(SDL_JoystickGetDeviceGUID, JFEi) // return a struct that is "uint8_t data[16]" +//GO(SDL_JoystickGetDeviceInstanceID, iFi) +//GO(SDL_JoystickGetDevicePlayerIndex, iFi) +//GO(SDL_JoystickGetDeviceProduct, WFi) +//GO(SDL_JoystickGetDeviceProductVersion, WFi) +//GO(SDL_JoystickGetDeviceType, uFi) +//GO(SDL_JoystickGetDeviceVendor, WFi) +//GO(SDL_JoystickGetFirmwareVersion, WFp) +//GO(SDL_JoystickGetGUID, HFp) +GOS(SDL_JoystickGetGUIDFromString, JFEp) +GO(SDL_JoystickGetGUIDString, vFUUpi) //uint8_t data[16] passed as 1st argument... +//GO(SDL_JoystickGetHat, CFpi) +//GO(SDL_JoystickGetPlayerIndex, iFp) +//GO(SDL_JoystickGetProduct, WFp) +//GO(SDL_JoystickGetProductVersion, WFp) +//GO(SDL_JoystickGetSerial, pFp) +//GO(SDL_JoystickGetType, uFp) +//GO(SDL_JoystickGetVendor, WFp) +GO(SDL_JoystickInstanceID, iFp) +GO(SDL_JoystickIsHaptic, iFp) +GO(SDL_JoystickName, pFp) +GO(SDL_JoystickNameForIndex, pFi) +GO(SDL_JoystickNumAxes, iFp) +GO(SDL_JoystickNumBalls, iFp) +GO(SDL_JoystickNumButtons, iFp) +GO(SDL_JoystickNumHats, iFp) +GO(SDL_JoystickOpen, pFi) +//GO(SDL_JoystickPath, pFp) +//GO(SDL_JoystickPathForIndex, pFi) +//GO(SDL_JoystickRumble, iFpWWu) +//GO(SDL_JoystickRumbleTriggers, iFpWWu) +GO(SDL_JoystickUpdate, vFv) +//GO(SDL_LinuxSetThreadPriority, iFli) +//GO(SDL_lltoa, pFlpi) +GOM(SDL_LoadBMP_RW, pFEpi) +//GO(SDL_LoadDollarTemplates, iFip) +//GO(SDL_LoadFile, pFpp) +//GOM(SDL_LoadFile_RW, pFEppi) +//GOM(SDL_LoadFunction, pFEpp) +//GOM(SDL_LoadObject, pFEp) +//GOM(SDL_LoadWAV_RW, pFEpippp) +GO(SDL_LockAudio, vFv) +GO(SDL_LockAudioDevice, vFi) +//GO(SDL_LockJoysticks, vFv) +GO(SDL_LockMutex, iFp) +//GO(SDL_LockSensors, vFv) +//GO(SDL_LockSurface, iFp) +//GO(SDL_LockTexture, iFpppp) +//GO(SDL_log, dFd) +GOM(SDL_Log, vFEpV) +//GO(SDL_log10, dFd) +//GO(SDL_log10f, fFf) +//GOM(SDL_LogCritical, vFEipV) +//GOM(SDL_LogDebug, vFEipV) +//GOM(SDL_LogError, vFEipV) +//GO(SDL_logf, fFf) +//GOM(SDL_LogGetOutputFunction, vFEpp) +//GO(SDL_LogGetPriority, uFi) +//GOM(SDL_LogInfo, vFEipV) +//GO2(SDL_LogMessage, vFiupV, SDL_LogMessageV) +GO(SDL_LogMessageV, vFiupV) +//GO(SDL_LogResetPriorities, vFv) +//GO(SDL_LogSetAllPriority, vFu) +//GOM(SDL_LogSetOutputFunction, vFEpp) +//GO(SDL_LogSetPriority, vFiu) +//GOM(SDL_LogVerbose, vFEipV) +//GOM(SDL_LogWarn, vFEipV) +//GO(SDL_LowerBlit, iFpppp) +//GO(SDL_LowerBlitScaled, iFpppp) +//GO(SDL_ltoa, pFlpi) +GO(SDL_malloc, pFL) +//GO(SDL_MapRGB, uFpCCC) +//GO(SDL_MapRGBA, uFpCCCC) +//GO(SDL_MasksToPixelFormatEnum, uFiuuuu) +GO(SDL_MaximizeWindow, vFp) +GO(SDL_memcmp, iFppL) +GO(SDL_memcpy, pFppu) +GO(SDL_memmove, pFppu) +//GO(SDL_MemoryBarrierAcquireFunction, vFv) +//GO(SDL_MemoryBarrierReleaseFunction, vFv) +GO(SDL_memset, pFpiL) +//GO(SDL_MinimizeWindow, vFp) +//GO(SDL_MixAudio, vFppui) +GO(SDL_MixAudioFormat, vFppWui) +GO(SDL_MouseIsHaptic, iFv) +GO(SDL_NewAudioStream, pFWCiWCi) +GO(SDL_NumHaptics, iFv) +GO(SDL_NumJoysticks, iFv) +GO(SDL_NumSensors, iFv) +GOM(SDL_OpenAudio, iFEpp) +GOM(SDL_OpenAudioDevice, uFEpippi) +GO(SDL_PauseAudio, vFi) +GO(SDL_PauseAudioDevice, vFui) +GOM(SDL_PeepEvents, iFEpiuuu) +//GO(SDL_PixelFormatEnumToMasks, uFuppppp) +GOM(SDL_PollEvent, iFp) //%noE +GO(SDL_pow, dFdd) +GO(SDL_powf, fFff) +GO(SDL_PumpEvents, vFv) +GOM(SDL_PushEvent, iFp) //%noE +//GO2(SDL_qsort, vFEpuup, my_qsort) +//GO(SDL_QueryTexture, iFppppp) +//GO(SDL_QueueAudio, iFupu) +GO(SDL_Quit, vFv) + GO(SDL_QuitSubSystem, vFu) +GO(SDL_RaiseWindow, vFp) +GOM(SDL_ReadBE16, uFEp) +GOM(SDL_ReadBE32, uFEp) +GOM(SDL_ReadBE64, UFEp) +GOM(SDL_ReadLE16, uFEp) +GOM(SDL_ReadLE32, uFEp) +GOM(SDL_ReadLE64, UFEp) +GOM(SDL_ReadU8, uFEp) +GO(SDL_realloc, pFpL) +//GO(SDL_RecordGesture, iFl) +//GO(SDL_RegisterEvents, uFi) +//GOM(SDL_RemoveTimer, iFEp) +GO(SDL_RenderClear, iFp) +GO(SDL_RenderCopy, iFpppp) +//GO(SDL_RenderCopyEx, iFppppdpu) +// SDL_RenderCopyExF +// SDL_RenderCopyF +//GO(SDL_RenderDrawLine, iFpiiii) +// SDL_RenderDrawLineF +//GO(SDL_RenderDrawLines, iFppi) +// SDL_RenderDrawLinesF +//GO(SDL_RenderDrawPoint, iFpii) +// SDL_RenderDrawPointF +//GO(SDL_RenderDrawPoints, iFppi) +// SDL_RenderDrawPointsF +//GO(SDL_RenderDrawRect, iFpp) +// SDL_RenderDrawRectF +//GO(SDL_RenderDrawRects, iFppi) +// SDL_RenderDrawRectsF +//GO(SDL_RenderFillRect, iFpp) +// SDL_RenderFillRectF +//GO(SDL_RenderFillRects, iFppi) +// SDL_RenderFillRectsF +// SDL_RenderFlush +//GO(SDL_RenderGetClipRect, vFpp) +//GO(SDL_RenderGetIntegerScale, iFp) +//GO(SDL_RenderGetLogicalSize, vFppp) +// SDL_RenderGetMetalCommandEncoder +// SDL_RenderGetMetalLayer +//GO(SDL_RenderGetScale, vFppp) +//GO(SDL_RenderGetViewport, vFpp) +//GO(SDL_RenderIsClipEnabled, uFp) +GO(SDL_RenderPresent, vFp) +//GO(SDL_RenderReadPixels, iFppupi) +GO(SDL_RenderSetClipRect, iFpp) +GO(SDL_RenderSetIntegerScale, iFpu) +GO(SDL_RenderSetLogicalSize, iFpii) +GO(SDL_RenderSetScale, iFpff) +GO(SDL_RenderSetViewport, iFpp) +GO(SDL_RenderTargetSupported, iFp) +GO(SDL_RenderSetVSync, iFpi) +//GO(SDL_RenderWindowToLogical, vFpiipp) +GO(SDL_ReportAssertion, uFpppi) +GO(SDL_ResetAssertionReport, vFv) +GO(SDL_ResetHints, vFv) +GO(SDL_ResetKeyboard, vFv) +GO(SDL_RestoreWindow, vFp) +//GOM(SDL_RWFromConstMem, pFEpi) +//GOM(SDL_RWFromFP, pFEpi) +GOM(SDL_RWFromFile, pFEpp) +GOM(SDL_RWFromMem, pFEpi) +//GOM(SDL_SaveAllDollarTemplates, iFEp) +//GOM(SDL_SaveBMP_RW, iFEppi) +//GOM(SDL_SaveDollarTemplate, iFEip) +GO(SDL_scalbn, dFdi) +GO(SDL_scalbnf, fFfi) +GO(SDL_SemPost, iFp) +GO(SDL_SemTryWait, iFp) +GO(SDL_SemValue, uFp) +GO(SDL_SemWait, iFp) +GO(SDL_SemWaitTimeout, iFpu) +GO(SDL_SensorClose, vFp) +GO(SDL_SensorFromInstanceID, pFi) +GO(SDL_SensorGetData, iFppi) +GO(SDL_SensorGetDataWithTimestamp, iFpppi) +GO(SDL_SensorGetDeviceInstanceID, iFi) +GO(SDL_SensorGetDeviceName, pFi) +GO(SDL_SensorGetDeviceNonPortableType, iFi) +GO(SDL_SensorGetDeviceType, iFi) +GO(SDL_SensorGetInstanceID, iFp) +GO(SDL_SensorGetName, pFp) +GO(SDL_SensorGetNonPortableType, iFp) +GO(SDL_SensorGetType, iFp) +GO(SDL_SensorOpen, pFi) +GO(SDL_SensorUpdate, vFv) +// SDL_SetAssertionHandler +GO(SDL_SetClipboardText, iFp) +//GO(SDL_SetClipRect, uFpp) +GOM(SDL_SetColorKey, iFpiu) //%noE +GO(SDL_SetCursor, vFp) +GO(SDL_setenv, iFppi) +GO(SDL_SetError, iFppppp) // it use ..., so putarbitrary 4 args +GOM(SDL_SetEventFilter, vFEpp) +GO(SDL_SetHint, uFpp) +//GO(SDL_SetHintWithPriority, uFppu) +GO(SDL_SetMainReady, vFv) +//GOM(SDL_SetMemoryFunctions, +GO(SDL_SetModState, vFu) +//GO(SDL_SetPaletteColors, iFppii) +// SDL_SetPixelFormatPalette +//GO(SDL_SetPrimarySelectionText, iFp) +GO(SDL_SetRelativeMouseMode, iFi) +//GO(SDL_SetRenderDrawBlendMode, iFpu) +GO(SDL_SetRenderDrawColor, iFpCCCC) +//GO(SDL_SetRenderTarget, iFpp) +//GO(SDL_SetSurfaceAlphaMod, iFpC) +//GO(SDL_SetSurfaceBlendMode, iFpu) +//GO(SDL_SetSurfaceColorMod, iFpCCC) +// SDL_SetSurfaceColorMod +//GO(SDL_SetSurfacePalette, iFpp) +//GO(SDL_SetSurfaceRLE, iFpi) +//GO(SDL_SetTextInputRect, vFp) +//GO(SDL_SetTextureAlphaMod, iFpC) +//GO(SDL_SetTextureBlendMode, iFpu) +//GO(SDL_SetTextureColorMod, iFpCCC) +//GO(SDL_SetTextureScaleMode, iFpu) +GO(SDL_SetThreadPriority, iFu) +GO(SDL_SetWindowBordered, vFpi) +GO(SDL_SetWindowBrightness, iFpf) +GO(SDL_SetWindowData, pFppp) +GOM(SDL_SetWindowDisplayMode, iFpp) //%noE +GO(SDL_SetWindowFullscreen, iFpu) +GO(SDL_SetWindowGammaRamp, iFpppp) +GO(SDL_SetWindowGrab, vFpi) +// SDL_SetWindowHitTest +GOM(SDL_SetWindowIcon, vFEpp) +// SDL_SetWindowInputFocus +//GO(SDL_SetWindowMaximumSize, vFpii) +GO(SDL_SetWindowMinimumSize, vFpii) +// SDL_SetWindowModalFor +// SDL_SetWindowOpacity +GO(SDL_SetWindowPosition, vFpii) +GO(SDL_SetWindowResizable, vFpi) +//GO(SDL_SetWindowShape, iFppp) +GO(SDL_SetWindowSize, vFpii) +GO(SDL_SetWindowTitle, vFpp) +// SDL_SetYUVConversionMode +GO(SDL_ShowCursor, iFi) +GOM(SDL_ShowMessageBox, iFpp) //%noE +GO(SDL_ShowSimpleMessageBox, iFuppp) +GO(SDL_ShowWindow, vFp) +//GO(SDL_SIMDAlloc, pFL) +//GO(SDL_SIMDGetAlignment, LFv) +//GO(SDL_SIMDRealloc, pFpL) +//GO(SDL_SIMDFree, vFp) +GO(SDL_sin, dFd) +GO(SDL_sinf, fFf) +GOM(SDL_snprintf, iFEpLpV) +//GO(SDL_SoftStretch, iFpppp) +GO(SDL_sqrt, dFd) +GO(SDL_sqrtf, fFf) +GO2(SDL_sscanf, iFEppV, my_sscanf) +GO(SDL_StartTextInput, vFv) +GO(SDL_StopTextInput, vFv) +GO(SDL_strcasecmp, iFpp) +GO(SDL_strchr, pFpi) +GO(SDL_strcmp, iFpp) +GO(SDL_strdup, pFp) +GO(SDL_strlcat, LFppL) +GO(SDL_strlcpy, uFppu) +GO(SDL_strlen, uFp) +GO(SDL_strlwr, pFp) +GO(SDL_strncasecmp, iFppL) +GO(SDL_strncmp, iFppu) +GO(SDL_strrchr, pFpi) +GO(SDL_strrev, pFp) +GO(SDL_strstr, pFpp) +GO(SDL_strtod, dFpp) +GO(SDL_strtol, lFppi) +GO(SDL_strtoll, lFppi) +GO(SDL_strtoul, LFppi) +GO(SDL_strtoull, LFppi) +GO(SDL_strupr, pFp) +GO(SDL_tan, dFd) +GO(SDL_tanf, fFf) +GO(SDL_ThreadID, hFv) +//GO(SDL_TLSCreate, uFv) +//GO(SDL_TLSGet, pFu) +//GOM(SDL_TLSSet, iFEupp) +GO(SDL_tolower, iFi) +GO(SDL_toupper, iFi) +//GO(SDL_TryLockMutex, iFp) +GO(SDL_uitoa, pFupi) +GO(SDL_ulltoa, pFLpi) +GO(SDL_ultoa, pFLpi) +//GO(SDL_UnionRect, vFppp) +//GOM(SDL_UnloadObject, vFEp) +GO(SDL_UnlockAudio, vFv) +GO(SDL_UnlockAudioDevice, vFi) +//GO(SDL_UnlockJoysticks, vFv) +GO(SDL_UnlockMutex, iFp) +//GO(SDL_UnlockSensors, vFv) +//GO(SDL_UnlockSurface, vFp) +//GO(SDL_UnlockTexture, vFp) +GO(SDL_UpdateTexture, iFpppi) +//GO(SDL_UpdateWindowSurface, iFp) +//GO(SDL_UpdateWindowSurfaceRects, iFppi) +//GO(SDL_UpdateYUVTexture, iFpppipipi) +//GO(SDL_UpperBlit, iFpppp) +//GO(SDL_UpperBlitScaled, iFpppp) +//GO(SDL_utf8strlcpy, uFppu) +// SDL_utf8strlen +//GO(SDL_VideoInit, iFp) +//GO(SDL_VideoQuit, vFv) +GOM(SDL_vsnprintf, iFEpLpp) +// SDL_vsscanf +//GO(SDL_Vulkan_CreateSurface, iFppp) +//GO(SDL_Vulkan_GetDrawableSize, vFppp) +//GO(SDL_Vulkan_GetInstanceExtensions, iFppp) +//GOM(SDL_Vulkan_GetVkGetInstanceProcAddr, pFEv) +//GO(SDL_Vulkan_LoadLibrary, iFp) //TODO: wrap to also call my_dlopen with path? +//GO(SDL_Vulkan_UnloadLibrary, vFv) +//GO(SDL_WaitEvent, iFp) +GOM(SDL_WaitEventTimeout, iFpi) //%noE +GO(SDL_WaitThread, vFpp) +GO(SDL_WarpMouseGlobal, iFii) +GO(SDL_WarpMouseInWindow, vFpii) +GO(SDL_WasInit, uFu) +// SDL_wcscmp +// SDL_wcsdup +// SDL_wcslcat +// SDL_wcslcpy +//GO(SDL_wcslen, LFp) +GOM(SDL_WriteBE16, uFEpW) +GOM(SDL_WriteBE32, uFEpu) +GOM(SDL_WriteBE64, uFEpU) +GOM(SDL_WriteLE16, uFEpW) +GOM(SDL_WriteLE32, uFEpu) +GOM(SDL_WriteLE64, uFEpU) +GOM(SDL_WriteU8, uFEpu) + +GOM(SDL_RWseek, IFEpIi) +GOM(SDL_RWtell, IFEp) +GOM(SDL_RWsize, IFEp) +GOM(SDL_RWread, LFEppLL) +GOM(SDL_RWwrite, LFEppLL) +GOM(SDL_RWclose, iFEp) + +//GO2(SDL_mutexP, iFp, SDL_LockMutex) +//GO2(SDL_mutexV, iFp, SDL_UnlockMutex) + +GO(SDL_doesntexist, IFpIi) +GOM(SDL_notreal, pFEpi) +//GOM(SDL_IsJoystickPS4, iFEWW) +//GOM(SDL_IsJoystickNintendoSwitchPro, iFEWW) +//GOM(SDL_IsJoystickSteamController, iFEWW) +//GOM(SDL_IsJoystickXbox360, iFEWW) +//GOM(SDL_IsJoystickXboxOne, iFEWW) +//GOM(SDL_IsJoystickXInput, iFEUU) +//GOM(SDL_IsJoystickHIDAPI, iFEUU) diff --git a/src/wrapped32/wrappedsdl2image.c b/src/wrapped32/wrappedsdl2image.c new file mode 100644 index 0000000..863618d --- /dev/null +++ b/src/wrapped32/wrappedsdl2image.c @@ -0,0 +1,134 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "box32context.h" +#include "sdl2rwops.h" +#include "sdl2align32.h" + +static const char* sdl2imageName = "libSDL2_image-2.0.so.0"; +#define LIBNAME sdl2image + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedsdl2imagetypes32.h" + +#include "wrappercallback32.h" + +#define GO(A) \ +EXPORT void *my32_2_##A(x64emu_t* emu, void* a) \ +{ \ + inplace_SDL2_RWops_to_64(a); \ + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); \ + void* r = my->A(rw); \ + RWNativeEnd2(rw); \ + inplace_SDL2_RWops_to_32(a); \ + inplace_SDL2_Surface_to_32(r); \ + return r; \ +} +GO(IMG_LoadBMP_RW) +GO(IMG_LoadCUR_RW) +GO(IMG_LoadGIF_RW) +GO(IMG_LoadICO_RW) +GO(IMG_LoadJPG_RW) +GO(IMG_LoadLBM_RW) +GO(IMG_LoadPCX_RW) +GO(IMG_LoadPNG_RW) +GO(IMG_LoadPNM_RW) +GO(IMG_LoadTGA_RW) +GO(IMG_LoadTIF_RW) +GO(IMG_LoadWEBP_RW) +GO(IMG_LoadXCF_RW) +GO(IMG_LoadXPM_RW) +GO(IMG_LoadXV_RW) +#undef GO + +EXPORT void *my32_2_IMG_Load(x64emu_t* emu, void* path) +{ + void* r = my->IMG_Load(path); + inplace_SDL2_Surface_to_32(r); + return r; +} + +EXPORT void *my32_2_IMG_LoadTyped_RW(x64emu_t* emu, void* a, int32_t b, void* c) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + void* r = my->IMG_LoadTyped_RW(rw, b, c); + if(b==0) { + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + } + inplace_SDL2_Surface_to_32(r); + return r; +} +EXPORT void *my32_2_IMG_Load_RW(x64emu_t* emu, void* a, int32_t b) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + void* r = my->IMG_Load_RW(rw, b); + if(b==0) { + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + } + inplace_SDL2_Surface_to_32(r); + return r; +} +//EXPORT int32_t my32_2_IMG_SavePNG_RW(x64emu_t* emu, void* s, void* a, int32_t b) +//{ +// // some old? fuction signature use IMG_SavePNG_RW(dst, surf, compression) instead of the IMG_SavePNG_RW(surf, dst, freedst) +// // need to try detect if s is in fact a RWops +// int32_t r; +// if(isRWops32((my_SDL2_RWops_32_t*)s) && !isRWops32((my_SDL2_RWops_32_t*)a)) { +// inplace_SDL2_RWops_to_64(s); +// SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)s); +// r = my->IMG_SavePNG_RW(a, rw, 0); +// RWNativeEnd2(rw); +// } else { +// SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); +// r = my->IMG_SavePNG_RW(s, rw, b); +// if(b==0) +// RWNativeEnd2(rw); +// } +// return r; +//} + +EXPORT void* my32_2_IMG_LoadTexture_RW(x64emu_t* emu, void* rend, void* a, int32_t b) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + void* r = my->IMG_LoadTexture_RW(rend, rw, b); + if(b==0) { + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + } + return r; +} + +EXPORT void* my32_2_IMG_LoadTextureTyped_RW(x64emu_t* emu, void* rend, void* a, int32_t b, void* type) +{ + inplace_SDL2_RWops_to_64(a); + SDL2_RWops_t *rw = RWNativeStart2(emu, (SDL2_RWops_t*)a); + void* r = my->IMG_LoadTextureTyped_RW(rend, rw, b, type); + if(b==0) { + RWNativeEnd2(rw); + inplace_SDL2_RWops_to_32(a); + } + return r; +} + +#define ALTMY my32_2_ + +#define NEEDED_LIBS "libSDL2-2.0.so.0" + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedsdl2image_private.h b/src/wrapped32/wrappedsdl2image_private.h new file mode 100644 index 0000000..e826c42 --- /dev/null +++ b/src/wrapped32/wrappedsdl2image_private.h @@ -0,0 +1,67 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh! +#endif + +// _fini +GO(IMG_Init,iFi) +GO(IMG_InvertAlpha,iFi) +GO(IMG_Linked_Version,pFv) +GOM(IMG_Load,pFEp) +GOM(IMG_LoadBMP_RW,pFEp) +GOM(IMG_LoadCUR_RW,pFEp) +GOM(IMG_LoadGIF_RW,pFEp) +GOM(IMG_LoadICO_RW,pFEp) +GOM(IMG_LoadJPG_RW,pFEp) +GOM(IMG_LoadLBM_RW,pFEp) +GOM(IMG_LoadPCX_RW,pFEp) +GOM(IMG_LoadPNG_RW,pFEp) +GOM(IMG_LoadPNM_RW,pFEp) +GOM(IMG_LoadTGA_RW,pFEp) +GOM(IMG_LoadTIF_RW,pFEp) +GOM(IMG_LoadTyped_RW,pFEpip) +GOM(IMG_LoadWEBP_RW,pFEp) +GOM(IMG_LoadXCF_RW,pFEp) +GOM(IMG_LoadXPM_RW,pFEp) +GOM(IMG_LoadXV_RW,pFEp) +GOM(IMG_Load_RW,pFEpi) +GO(IMG_Quit,vFv) +//GO(IMG_ReadXPMFromArray,pFp) +//GO(IMG_isBMP,iFp) +//GO(IMG_isCUR,iFp) +//GO(IMG_isGIF,iFp) +//GO(IMG_isICO,iFp) +//GO(IMG_isJPG,iFp) +//GO(IMG_isLBM,iFp) +//GO(IMG_isPCX,iFp) +//GO(IMG_isPNG,iFp) +//GO(IMG_isPNM,iFp) +//GO(IMG_isTIF,iFp) +//GO(IMG_isWEBP,iFp) +//GO(IMG_isXCF,iFp) +//GO(IMG_isXPM,iFp) +//GO(IMG_isXV,iFp) +// IMG_InitJPG +// IMG_InitPNG +// IMG_InitTIF +// IMG_InitWEBP +// IMG_isSVG +// IMG_LoadSVG_RW +//GO(IMG_LoadTexture, pFpp) +GOM(IMG_LoadTexture_RW, pFEppi) +GOM(IMG_LoadTextureTyped_RW, pFEppip) +// IMG_QuitJPG +// IMG_QuitPNG +// IMG_QuitTIF +// IMG_QuitWEBP +// IMG_SaveJPG +// IMG_SaveJPG_RW +//GO(IMG_SavePNG, iFpp) +//GOM(IMG_SavePNG_RW, iFEppi) +// _init +//DATA(nsvg__colors, 4) +// nsvgCreateRasterizer +// nsvgDelete +// nsvgDeleteRasterizer +// nsvgParse +// nsvg__parseXML +// nsvgRasterize diff --git a/src/wrapped32/wrappedselinux.c b/src/wrapped32/wrappedselinux.c new file mode 100644 index 0000000..cebe93a --- /dev/null +++ b/src/wrapped32/wrappedselinux.c @@ -0,0 +1,19 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "box32context.h" + +static const char* selinuxName = "libselinux.so.1"; +#define LIBNAME selinux + +#include "wrappedlib_init32.h" + diff --git a/src/wrapped32/wrappedselinux_private.h b/src/wrapped32/wrappedselinux_private.h new file mode 100644 index 0000000..116fb1b --- /dev/null +++ b/src/wrapped32/wrappedselinux_private.h @@ -0,0 +1,247 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +//GO(avc_add_callback, +//GO(avc_audit, +//GO(avc_av_stats, +//GO(avc_cache_stats, +//GO(avc_cleanup, +//GO(avc_compute_create, +//GO(avc_compute_member, +//GO(avc_context_to_sid, +//GO(avc_context_to_sid_raw, +//GO(avc_destroy, +//GO(avc_get_initial_sid, +//GO(avc_has_perm, +//GO(avc_has_perm_noaudit, +//GO(avc_init, +//GO(avc_netlink_acquire_fd, +//GO(avc_netlink_check_nb, +//GO(avc_netlink_close, +//GO(avc_netlink_loop, +//GO(avc_netlink_open, +//GO(avc_netlink_release_fd, +//GO(avc_open, +//GO(avc_reset, +//GO(avc_sid_stats, +//GO(avc_sid_to_context, +//GO(avc_sid_to_context_raw, +GO(checkPasswdAccess, iFu) +//GO(context_free, +//GO(context_new, +//GO(context_range_get, +//GO(context_range_set, +//GO(context_role_get, +//GO(context_role_set, +//GO(context_str, +//GO(context_type_get, +//GO(context_type_set, +//GO(context_user_get, +//GO(context_user_set, +//DATAB(dir_xattr_list, +GO(fgetfilecon, iFibp_) +GO(fgetfilecon_raw, iFibp_) +GO(fini_selinuxmnt, vFv) +GO(freecon, vFp) +GO(freeconary, vFbp_) +GO(fsetfilecon, iFip) +GO(fsetfilecon_raw, iFip) +GO(getcon, iFbp_) +GO(getcon_raw, iFbp_) +//GO(get_default_context, +//GO(get_default_context_with_level, +//GO(get_default_context_with_role, +//GO(get_default_context_with_rolelevel, +//GO(get_default_type, +GO(getexeccon, iFbp_) +GO(getexeccon_raw, iFbp_) +GO(getfilecon, iFpbp_) +GO(getfilecon_raw, iFpbp_) +GO(getfscreatecon, iFbp_) +GO(getfscreatecon_raw, iFbp_) +GO(getkeycreatecon, iFbp_) +GO(getkeycreatecon_raw, iFbp_) +//GO(get_ordered_context_list, +//GO(get_ordered_context_list_with_level, +GO(getpeercon, iFibp_) +GO(getpeercon_raw, iFibp_) +GO(getpidcon, iFibp_) +GO(getpidcon_raw, iFibp_) +GO(getprevcon, iFbp_) +GO(getprevcon_raw, iFbp_) +GO(getseuser, iFppbp_bp_) +GO(getseuserbyname, iFpbp_bp_) +GO(getsockcreatecon, iFbp_) +GO(getsockcreatecon_raw, iFbp_) +GO(is_context_customizable, iFp) +GO(is_selinux_enabled, iFv) +GO(is_selinux_mls_enabled, iFv) +GO(lgetfilecon, iFpbp_) +GO(lgetfilecon_raw, iFpbp_) +GO(lsetfilecon, iFpp) +GO(lsetfilecon_raw, iFpp) +//GO(manual_user_enter_context, +//GO(map_class, +//GO(map_decision, +//GO(map_perm, +GO(matchmediacon, iFpbp_) +GO(matchpathcon, iFpubp_) +GO(matchpathcon_checkmatches, vFp) +GO(matchpathcon_filespec_add, iFUip) +GO(matchpathcon_filespec_destroy, vFv) +GO(matchpathcon_filespec_eval, vFv) +GO(matchpathcon_fini, vFv) +GO(matchpathcon_index, iFpubp_) +GO(matchpathcon_init, iFp) +GO(matchpathcon_init_prefix, iFpp) +GO(mode_to_security_class, WFu) +//DATAB(myprintf_compat, +GO(print_access_vector, vFWu) +//GO(query_user_context, +GO(realpath_not_final, iFpp) +GO(rpm_execcon, iFupbp_bp_) +GO(security_av_perm_to_string, pFWu) +GO(security_av_string, iFWubp_) +GO(security_canonicalize_context, iFpbp_) +GO(security_canonicalize_context_raw, iFpbp_) +GO(security_check_context, iFp) +GO(security_check_context_raw, iFp) +GO(security_class_to_string, pFW) +GO(security_commit_booleans, iFv) +GO(security_compute_av, iFppWup) +GO(security_compute_av_flags, iFppWup) +GO(security_compute_av_flags_raw, iFppWup) +GO(security_compute_av_raw, iFppWup) +GO(security_compute_create, iFppWbp_) +GO(security_compute_create_name, iFppWpbp_) +GO(security_compute_create_name_raw, iFppWpbp_) +GO(security_compute_create_raw, iFppWbp_) +GO(security_compute_member, iFppWbp_) +GO(security_compute_member_raw, iFppWbp_) +GO(security_compute_relabel, iFppWbp_) +GO(security_compute_relabel_raw, iFppWbp_) +//GOM(security_compute_user, iFEppbp_) +//GOM(security_compute_user_raw, iFEppbp_) +GO(security_deny_unknown, iFv) +GO(security_disable, iFv) +GO(security_get_boolean_active, iFp) +//GOM(security_get_boolean_names, iFEbp_p) +GO(security_get_boolean_pending, iFp) +GO(security_get_checkreqprot, iFv) +GO(security_getenforce, iFv) +GO(security_get_initial_context, iFpbp_) +GO(security_get_initial_context_raw, iFpbp_) +GO(security_load_booleans, iFp) +GO(security_load_policy, iFpL) +GO(security_policyvers, iFv) +GO(security_reject_unknown, iFv) +GO(security_set_boolean, iFpi) +GO(security_set_boolean_list, iFLbpi_i) +GO(security_setenforce, iFi) +GO(security_validatetrans, iFppWp) +GO(security_validatetrans_raw, iFppWp) +//GO(selabel_close, +//GO(selabel_cmp, +//GO(selabel_digest, +//GO(selabel_get_digests_all_partial_matches, +//GO(selabel_hash_all_partial_matches, +//GO(selabel_lookup, +//GO(selabel_lookup_best_match, +//GO(selabel_lookup_best_match_raw, +//GO(selabel_lookup_raw, +//GO(selabel_open, +//GO(selabel_partial_match, +//GO(selabel_stats, +GO(selinux_binary_policy_path, pFv) +GO(selinux_booleans_path, pFv) +GO(selinux_booleans_subs_path, pFv) +GO(selinux_boolean_sub, pFp) +GO(selinux_check_access, iFppppp) +GO(selinux_check_passwd_access, iFu) +GO(selinux_check_securetty_context, iFp) +GO(selinux_colors_path, pFv) +GO(selinux_contexts_path, pFv) +GO(selinux_current_policy_path, pFv) +GO(selinux_customizable_types_path, pFv) +GO(selinux_default_context_path, pFv) +//GO(selinux_default_type_path, +GO(selinux_failsafe_context_path, pFv) +GO(selinux_file_context_cmp, iFpp) +GO(selinux_file_context_homedir_path, pFv) +GO(selinux_file_context_local_path, pFv) +GO(selinux_file_context_path, pFv) +GO(selinux_file_context_subs_dist_path, pFv) +GO(selinux_file_context_subs_path, pFv) +GO(selinux_file_context_verify, iFpu) +GO(selinuxfs_exists, iFv) +//GOS(selinux_get_callback, pFpi) +GO(selinux_getenforcemode, iFp) +GO(selinux_getpolicytype, iFbp_) +GO(selinux_homedir_context_path, pFv) +GO(selinux_init_load_policy, iFp) +GO(selinux_lsetfilecon_default, iFp) +GO(selinux_lxc_contexts_path, pFv) +GO(selinux_media_context_path, pFv) +GO(selinux_mkload_policy, iFi) +//DATAB(selinux_mnt, +GO(selinux_netfilter_context_path, pFv) +GO(selinux_openrc_contexts_path, pFv) +GO(selinux_openssh_contexts_path, pFv) +GO(selinux_path, pFv) +GO(selinux_policy_root, pFv) +GO(selinux_raw_context_to_color, iFpbp_) +GO(selinux_raw_to_trans_context, iFpbp_) +GO(selinux_removable_context_path, pFv) +GO(selinux_reset_config, vFv) +//GO(selinux_restorecon, +//GO(selinux_restorecon_default_handle, +//GO(selinux_restorecon_set_alt_rootpath, +//GO(selinux_restorecon_set_exclude_list, +//GO(selinux_restorecon_set_sehandle, +//GO(selinux_restorecon_xattr, +GO(selinux_securetty_types_path, pFv) +GO(selinux_sepgsql_context_path, pFv) +//GO(selinux_set_callback, +//GO(selinux_set_mapping, iFbpppppppppppppppppppppppppppppppppp_) +GO(selinux_set_policy_root, iFp) +GO(selinux_snapperd_contexts_path, pFv) +//GO(selinux_status_close, +//GO(selinux_status_deny_unknown, +//GO(selinux_status_getenforce, +//GO(selinux_status_open, +//GO(selinux_status_policyload, +//GO(selinux_status_updated, +GO(selinux_systemd_contexts_path, pFv) +GO(selinux_translations_path, pFv) +GO(selinux_trans_to_raw_context, iFpbp_) +GO(selinux_user_contexts_path, pFv) +GO(selinux_usersconf_path, pFv) +GO(selinux_users_path, pFv) +GO(selinux_virtual_domain_context_path, pFv) +GO(selinux_virtual_image_context_path, pFv) +GO(selinux_x_context_path, pFv) +GO(setcon, iFp) +GO(setcon_raw, iFp) +GO(setexeccon, iFp) +GO(setexeccon_raw, iFp) +GO(setexecfilecon, iFpp) +GO(setfilecon, iFpp) +GO(setfilecon_raw, iFpp) +GO(setfscreatecon, iFp) +GO(setfscreatecon_raw, iFp) +GO(setkeycreatecon, iFp) +GO(setkeycreatecon_raw, iFp) +//GOM(set_matchpathcon_canoncon, vFEp) +GO(set_matchpathcon_flags, vFu) +//GOM(set_matchpathcon_invalidcon, vFEp) +//GOM(set_matchpathcon_printf, vFEp) +GO(set_selinuxmnt, vFp) +GO(setsockcreatecon, iFp) +GO(setsockcreatecon_raw, iFp) +//GO(sidget, +//GO(sidput, +GO(string_to_av_perm, uFWp) +GO(string_to_security_class, WFp) +//GO(unmap_class, +//GO(unmap_perm, diff --git a/src/wrapped32/wrappedtcmallocminimal.c b/src/wrapped32/wrappedtcmallocminimal.c new file mode 100644 index 0000000..1fdbc30 --- /dev/null +++ b/src/wrapped32/wrappedtcmallocminimal.c @@ -0,0 +1,23 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" + +// Fake the lib for now, don't load it +static const char* tcmallocminimalName = "libtcmalloc_minimal.so.4"; +#define LIBNAME tcmallocminimal + +// this preinit basically open "box86" as dlopen (because libtcmalloc_minimal needs to be LD_PRELOAD for it to work) +#define PRE_INIT\ + lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \ + if(0) + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedtcmallocminimal_private.h b/src/wrapped32/wrappedtcmallocminimal_private.h new file mode 100644 index 0000000..2a75d2a --- /dev/null +++ b/src/wrapped32/wrappedtcmallocminimal_private.h @@ -0,0 +1,442 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(aligned_alloc, pFLL) +GO(calloc, pFLL) +GO(cfree, vFp) +//GO(_fini, +GO(free, vFp) +//GO(_init, +GO(__libc_calloc, pFLL) +GO(__libc_cfree, vFp) +GO(__libc_free, vFp) +GO(__libc_malloc, pFL) +GO(__libc_memalign, pFLL) +GO(__libc_pvalloc, pFL) +GO(__libc_realloc, pFpL) +GO(__libc_valloc, pFL) +GOS(mallinfo, pFEp) //%% +GO(malloc, pFL) +//GO(MallocExtension_GetAllocatedSize, +//GO(MallocExtension_GetEstimatedAllocatedSize, +//GO(MallocExtension_GetNumericProperty, +//GO(MallocExtension_GetOwnership, +//GO(MallocExtension_GetStats, +//GO(MallocExtension_GetThreadCacheSize, +//GO(MallocExtension_MallocMemoryStats, +//GO(MallocExtension_MarkThreadBusy, +//GO(MallocExtension_MarkThreadIdle, +//GO(MallocExtension_MarkThreadTemporarilyIdle, +//GO(MallocExtension_ReleaseFreeMemory, +//GO(MallocExtension_ReleaseToSystem, +//GO(MallocExtension_SetNumericProperty, +//GO(MallocExtension_VerifyAllMemory, +//GO(MallocExtension_VerifyArrayNewMemory, +//GO(MallocExtension_VerifyMallocMemory, +//GO(MallocExtension_VerifyNewMemory, +//GO(MallocHook_AddDeleteHook, +//GO(MallocHook_AddMmapHook, +//GO(MallocHook_AddMremapHook, +//GO(MallocHook_AddMunmapHook, +//GO(MallocHook_AddNewHook, +//GO(MallocHook_AddPreMmapHook, +//GO(MallocHook_AddPreSbrkHook, +//GO(MallocHook_AddSbrkHook, +//GO(MallocHook_GetCallerStackTrace, +//GO(MallocHook_RemoveDeleteHook, +//GO(MallocHook_RemoveMmapHook, +//GO(MallocHook_RemoveMmapReplacement, +//GO(MallocHook_RemoveMremapHook, +//GO(MallocHook_RemoveMunmapHook, +//GO(MallocHook_RemoveMunmapReplacement, +//GO(MallocHook_RemoveNewHook, +//GO(MallocHook_RemovePreMmapHook, +//GO(MallocHook_RemovePreSbrkHook, +//GO(MallocHook_RemoveSbrkHook, +//GO(MallocHook_SetDeleteHook, +//GO(MallocHook_SetMmapHook, +//GO(MallocHook_SetMmapReplacement, +//GO(MallocHook_SetMremapHook, +//GO(MallocHook_SetMunmapHook, +//GO(MallocHook_SetMunmapReplacement, +//GO(MallocHook_SetNewHook, +//GO(MallocHook_SetPreMmapHook, +//GO(MallocHook_SetPreSbrkHook, +//GO(MallocHook_SetSbrkHook, +GO(malloc_size, LFp) +GO(malloc_stats, vFv) +GO(malloc_usable_size, LFp) +GO(mallopt, iFii) +GO(memalign, pFLL) +GOM(mmap, pFEpLiiii) // use the my_mmap from wrappedlibc.c +GOM(mmap64, pFEpLiiiI) +GO(mremap, pFpLLip) +GOM(munmap, iFEpL) +GO(nallocx, LFLi) +GO(__posix_memalign, iFBp_LL) +GO(posix_memalign, iFBp_LL) +//GO(RunningOnValgrind, +GO(sbrk, pFl) +//GO(tc_calloc, +//GO(tc_cfree, +//GO(tc_delete, +//GO(tc_delete_aligned, +//GO(tc_delete_aligned_nothrow, +//GO(tc_deletearray, +//GO(tc_deletearray_aligned, +//GO(tc_deletearray_aligned_nothrow, +//GO(tc_deletearray_nothrow, +//GO(tc_deletearray_sized, +//GO(tc_deletearray_sized_aligned, +//GO(tc_delete_nothrow, +//GO(tc_delete_sized, +//GO(tc_delete_sized_aligned, +//GO(tc_free, +//GO(tc_free_sized, +//GO(tc_mallinfo, +//GO(tc_malloc, +//GO(TCMallocGetenvSafe, +//GO(tc_malloc_size, +//GO(tc_malloc_skip_new_handler, +//GO(tc_malloc_stats, +//GO(tc_mallopt, +//GO(tc_memalign, +//GO(tc_nallocx, +//GO(tc_new, +//GO(tc_new_aligned, +//GO(tc_new_aligned_nothrow, +//GO(tc_newarray, +//GO(tc_newarray_aligned, +//GO(tc_newarray_aligned_nothrow, +//GO(tc_newarray_nothrow, +//GO(tc_new_nothrow, +//GO(tc_posix_memalign, +//GO(tc_pvalloc, +//GO(tc_query_new_mode, +//GO(tc_realloc, +//GO(tc_set_new_mode, +//GO(tc_valloc, +//GO(tc_version, +//GO(ValgrindSlowdown, +GO(valloc, pFL) + + +//GO(_Z16GetenvBeforeMainPKc, +//GO(_Z17RawOpenForWritingPKc, +//GO(_Z18GetSystemCPUsCountv, +//GO(_Z20GetUniquePathFromEnvPKcPc, +//GO(_Z20InitSystemAllocatorsv, +//GO(_Z20SleepForMillisecondsi, +//GO(_Z20TCMalloc_SystemAllocjPjj, +//GO(_Z21TCMalloc_SystemCommitPvj, +//GO(_Z22perftools_pthread_oncePiPFvvE, +//GO(_Z22TCMalloc_SystemReleasePvj, +//GO(_Z24perftools_pthread_atforkPFvvES0_S0_, +//GO(_Z28perftools_pthread_key_createPjPFvPvE, +//GO(_Z28perftools_pthread_key_deletej, +//GO(_Z29perftools_pthread_getspecificj, +//GO(_Z29perftools_pthread_setspecificjPv, +//GO(_Z8RawClosei, +//GO(_Z8RawWriteiPKcj, +//GO(_ZdaPv, +//GO(_ZdaPvj, +//GO(_ZdaPvjSt11align_val_t, +//GO(_ZdaPvRKSt9nothrow_t, +//GO(_ZdaPvSt11align_val_t, +//GO(_ZdaPvSt11align_val_tRKSt9nothrow_t, +//GO(_ZdlPv, +//GO(_ZdlPvj, +//GO(_ZdlPvjSt11align_val_t, +//GO(_ZdlPvRKSt9nothrow_t, +//GO(_ZdlPvSt11align_val_t, +//GO(_ZdlPvSt11align_val_tRKSt9nothrow_t, +//GO(_ZN10MallocHook12UnhookedMMapEPvjiiil, +//GO(_ZN10MallocHook14UnhookedMUnmapEPvj, +//GO(_ZN10MallocHook17InvokeNewHookSlowEPKvj, +//GO(_ZN10MallocHook18InvokeMmapHookSlowEPKvS1_jiiil, +//GO(_ZN10MallocHook18InvokeSbrkHookSlowEPKvi, +//GO(_ZN10MallocHook20InvokeDeleteHookSlowEPKv, +//GO(_ZN10MallocHook20InvokeMremapHookSlowEPKvS1_jjiS1_, +//GO(_ZN10MallocHook20InvokeMunmapHookSlowEPKvj, +//GO(_ZN10MallocHook21InvokePreMmapHookSlowEPKvjiiil, +//GO(_ZN10MallocHook21InvokePreSbrkHookSlowEi, +//GO(_ZN10MallocHook25InvokeMmapReplacementSlowEPKvjiiilPPv, +//GO(_ZN10MallocHook27InvokeMunmapReplacementSlowEPKvjPi, +//GO(_ZN11SymbolTable3AddEPKv, +//GO(_ZN11SymbolTable9GetSymbolEPKv, +//GO(_ZN11SymbolTable9SymbolizeEv, +//GO(_ZN12SysAllocatorD0Ev, +//GO(_ZN12SysAllocatorD1Ev, +//GO(_ZN12SysAllocatorD2Ev, +//GO(_ZN13TCMallocGuardC1Ev, +//GO(_ZN13TCMallocGuardC2Ev, +//GO(_ZN13TCMallocGuardD1Ev, +//GO(_ZN13TCMallocGuardD2Ev, +//GO(_ZN15MallocExtension10InitializeEv, +//GO(_ZN15MallocExtension12GetOwnershipEPKv, +//GO(_ZN15MallocExtension13GetHeapSampleEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, +//GO(_ZN15MallocExtension14MarkThreadBusyEv, +//GO(_ZN15MallocExtension14MarkThreadIdleEv, +//GO(_ZN15MallocExtension15ReadStackTracesEPi, +//GO(_ZN15MallocExtension15ReleaseToSystemEj, +//GO(_ZN15MallocExtension15VerifyAllMemoryEv, +//GO(_ZN15MallocExtension15VerifyNewMemoryEPKv, +//GO(_ZN15MallocExtension16GetAllocatedSizeEPKv, +//GO(_ZN15MallocExtension16GetFreeListSizesEPSt6vectorINS_12FreeListInfoESaIS1_EE, +//GO(_ZN15MallocExtension17MallocMemoryStatsEPiPjS0_, +//GO(_ZN15MallocExtension17ReleaseFreeMemoryEv, +//GO(_ZN15MallocExtension18GetNumericPropertyEPKcPj, +//GO(_ZN15MallocExtension18GetSystemAllocatorEv, +//GO(_ZN15MallocExtension18GetThreadCacheSizeEv, +//GO(_ZN15MallocExtension18SetNumericPropertyEPKcj, +//GO(_ZN15MallocExtension18SetSystemAllocatorEP12SysAllocator, +//GO(_ZN15MallocExtension18VerifyMallocMemoryEPKv, +//GO(_ZN15MallocExtension19GetHeapGrowthStacksEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, +//GO(_ZN15MallocExtension20GetMemoryReleaseRateEv, +//GO(_ZN15MallocExtension20SetMemoryReleaseRateEd, +//GO(_ZN15MallocExtension20VerifyArrayNewMemoryEPKv, +//GO(_ZN15MallocExtension25GetEstimatedAllocatedSizeEj, +//GO(_ZN15MallocExtension25MarkThreadTemporarilyIdleEv, +//GO(_ZN15MallocExtension25ReadHeapGrowthStackTracesEv, +//GO(_ZN15MallocExtension6RangesEPvPFvS0_PKN4base11MallocRangeEE, +//GO(_ZN15MallocExtension8GetStatsEPci, +//GO(_ZN15MallocExtension8instanceEv, +//GO(_ZN15MallocExtension8RegisterEPS_, +//GO(_ZN15MallocExtensionD0Ev, +//GO(_ZN15MallocExtensionD1Ev, +//GO(_ZN15MallocExtensionD2Ev, +//GO(_ZN16MmapSysAllocator5AllocEjPjj, +//GO(_ZN16ProcMapsIterator10FormatLineEPciyyPKcyxS2_y, +//GO(_ZN16ProcMapsIterator4InitEiPNS_6BufferEb, +//GO(_ZN16ProcMapsIterator4NextEPyS0_PPcS0_PxS2_, +//GO(_ZN16ProcMapsIterator7NextExtEPyS0_PPcS0_PxS2_S0_S0_S0_S0_S0_, +//GO(_ZN16ProcMapsIteratorC1Ei, +//GO(_ZN16ProcMapsIteratorC1EiPNS_6BufferE, +//GO(_ZN16ProcMapsIteratorC1EiPNS_6BufferEb, +//GO(_ZN16ProcMapsIteratorC2Ei, +//GO(_ZN16ProcMapsIteratorC2EiPNS_6BufferE, +//GO(_ZN16ProcMapsIteratorC2EiPNS_6BufferEb, +//GO(_ZN16ProcMapsIteratorD1Ev, +//GO(_ZN16ProcMapsIteratorD2Ev, +//GO(_ZN16SbrkSysAllocator5AllocEjPjj, +//GO(_ZN16TCMalloc_Printer6printfEPKcz, +//GO(_ZN18DevMemSysAllocator5AllocEjPjj, +//GO(_ZN19DefaultSysAllocator5AllocEjPjj, +//GO(_ZN19HugetlbSysAllocator10InitializeEv, +//GO(_ZN19HugetlbSysAllocator13AllocInternalEjPjj, +//GO(_ZN19HugetlbSysAllocator5AllocEjPjj, +//GO(_ZN22TCMallocImplementation14MarkThreadBusyEv, +//GO(_ZN22TCMallocImplementation16GetAllocatedSizeEPKv, +//GO(_ZN22TCMallocImplementation25GetEstimatedAllocatedSizeEj, +//GO(_ZN4base8internal12SpinLockWakeEPVib, +//GO(_ZN4base8internal13SpinLockDelayEPViii, +//GO(_ZN8SpinLock10SlowUnlockEv, +//GO(_ZN8SpinLock8SlowLockEv, +//GO(_ZN8SpinLock8SpinLoopEv, +//GO(_ZN8tcmalloc10DeleteSpanEPNS_4SpanE, +//GO(_ZN8tcmalloc10DLL_LengthEPKNS_4SpanE, +//GO(_ZN8tcmalloc10DLL_RemoveEPNS_4SpanE, +//GO(_ZN8tcmalloc10malloc_oomEj, +//GO(_ZN8tcmalloc11DLL_PrependEPNS_4SpanES1_, +//GO(_ZN8tcmalloc11ThreadCache10BecomeIdleEv, +//GO(_ZN8tcmalloc11ThreadCache10InitModuleEv, +//GO(_ZN8tcmalloc11ThreadCache11DeleteCacheEPS0_, +//GO(_ZN8tcmalloc11ThreadCache11ListTooLongEPNS0_8FreeListEj, +//GO(_ZN8tcmalloc11ThreadCache14GetThreadStatsEPyS1_, +//GO(_ZN8tcmalloc11ThreadCache15GetSamplePeriodEv, +//GO(_ZN8tcmalloc11ThreadCache18DestroyThreadCacheEPv, +//GO(_ZN8tcmalloc11ThreadCache18IncreaseCacheLimitEv, +//GO(_ZN8tcmalloc11ThreadCache21BecomeTemporarilyIdleEv, +//GO(_ZN8tcmalloc11ThreadCache21FetchFromCentralCacheEjiPFPvjE, +//GO(_ZN8tcmalloc11ThreadCache21ReleaseToCentralCacheEPNS0_8FreeListEji, +//GO(_ZN8tcmalloc11ThreadCache22CreateCacheIfNecessaryEv, +//GO(_ZN8tcmalloc11ThreadCache24IncreaseCacheLimitLockedEv, +//GO(_ZN8tcmalloc11ThreadCache27RecomputePerThreadCacheSizeEv, +//GO(_ZN8tcmalloc11ThreadCache29set_overall_thread_cache_sizeEj, +//GO(_ZN8tcmalloc11ThreadCache4InitEm, +//GO(_ZN8tcmalloc11ThreadCache7CleanupEv, +//GO(_ZN8tcmalloc11ThreadCache7InitTSDEv, +//GO(_ZN8tcmalloc11ThreadCache7NewHeapEm, +//GO(_ZN8tcmalloc11ThreadCache8ScavengeEv, +//GO(_ZN8tcmalloc13cpp_throw_oomEj, +//GO(_ZN8tcmalloc13MetaDataAllocEj, +//GO(_ZN8tcmalloc15CentralFreeList11InsertRangeEPvS1_i, +//GO(_ZN8tcmalloc15CentralFreeList11RemoveRangeEPPvS2_i, +//GO(_ZN8tcmalloc15CentralFreeList11ShrinkCacheEib, +//GO(_ZN8tcmalloc15CentralFreeList13OverheadBytesEv, +//GO(_ZN8tcmalloc15CentralFreeList14MakeCacheSpaceEv, +//GO(_ZN8tcmalloc15CentralFreeList14ReleaseToSpansEPv, +//GO(_ZN8tcmalloc15CentralFreeList17FetchFromOneSpansEiPPvS2_, +//GO(_ZN8tcmalloc15CentralFreeList18ReleaseListToSpansEPv, +//GO(_ZN8tcmalloc15CentralFreeList20EvictRandomSizeClassEib, +//GO(_ZN8tcmalloc15CentralFreeList21FetchFromOneSpansSafeEiPPvS2_, +//GO(_ZN8tcmalloc15CentralFreeList4InitEj, +//GO(_ZN8tcmalloc15CentralFreeList8PopulateEv, +//GO(_ZN8tcmalloc15CentralFreeList9tc_lengthEv, +//GO(_ZN8tcmalloc15cpp_nothrow_oomEj, +//GO(_ZN8tcmalloc15StackTraceTable23ReadStackTracesAndClearEv, +//GO(_ZN8tcmalloc15StackTraceTable8AddTraceERKNS_10StackTraceE, +//GO(_ZN8tcmalloc15StackTraceTableC1Ev, +//GO(_ZN8tcmalloc15StackTraceTableC2Ev, +//GO(_ZN8tcmalloc15StackTraceTableD1Ev, +//GO(_ZN8tcmalloc15StackTraceTableD2Ev, +//GO(_ZN8tcmalloc16AlignmentForSizeEj, +//GO(_ZN8tcmalloc16DumpProcSelfMapsEi, +//GO(_ZN8tcmalloc16FillProcSelfMapsEPciPb, +//GO(_ZN8tcmalloc19CentralCacheLockAllEv, +//GO(_ZN8tcmalloc21CentralCacheUnlockAllEv, +//GO(_ZN8tcmalloc21metadata_system_bytesEv, +//GO(_ZN8tcmalloc24allocate_full_malloc_oomEj, +//GO(_ZN8tcmalloc27allocate_full_cpp_throw_oomEj, +//GO(_ZN8tcmalloc29allocate_full_cpp_nothrow_oomEj, +//GO(_ZN8tcmalloc3LogENS_7LogModeEPKciNS_7LogItemES3_S3_S3_, +//GO(_ZN8tcmalloc6Logger3AddERKNS_7LogItemE, +//GO(_ZN8tcmalloc6Logger6AddNumEyi, +//GO(_ZN8tcmalloc6Logger6AddStrEPKci, +//GO(_ZN8tcmalloc6Static14InitStaticVarsEv, +//GO(_ZN8tcmalloc6Static22InitLateMaybeRecursiveEv, +//GO(_ZN8tcmalloc7NewSpanEjj, +//GO(_ZN8tcmalloc7Sampler15GetSamplePeriodEv, +//GO(_ZN8tcmalloc7Sampler20RecordAllocationSlowEj, +//GO(_ZN8tcmalloc7Sampler21PickNextSamplingPointEv, +//GO(_ZN8tcmalloc7Sampler4InitEy, +//GO(_ZN8tcmalloc7SizeMap11NumMoveSizeEj, +//GO(_ZN8tcmalloc7SizeMap4InitEv, +//GO(_ZN8tcmalloc8DLL_InitEPNS_4SpanE, +//GO(_ZN8tcmalloc8PageHeap10AllocLargeEj, +//GO(_ZN8tcmalloc8PageHeap10CommitSpanEPNS_4SpanE, +//GO(_ZN8tcmalloc8PageHeap11EnsureLimitEjb, +//GO(_ZN8tcmalloc8PageHeap11ReleaseSpanEPNS_4SpanE, +//GO(_ZN8tcmalloc8PageHeap12DecommitSpanEPNS_4SpanE, +//GO(_ZN8tcmalloc8PageHeap12GetNextRangeEjPN4base11MallocRangeE, +//GO(_ZN8tcmalloc8PageHeap14CheckExpensiveEv, +//GO(_ZN8tcmalloc8PageHeap17GetLargeSpanStatsEPNS0_14LargeSpanStatsE, +//GO(_ZN8tcmalloc8PageHeap17GetSmallSpanStatsEPNS0_14SmallSpanStatsE, +//GO(_ZN8tcmalloc8PageHeap17MergeIntoFreeListEPNS_4SpanE, +//GO(_ZN8tcmalloc8PageHeap17PrependToFreeListEPNS_4SpanE, +//GO(_ZN8tcmalloc8PageHeap17RegisterSizeClassEPNS_4SpanEj, +//GO(_ZN8tcmalloc8PageHeap18RemoveFromFreeListEPNS_4SpanE, +//GO(_ZN8tcmalloc8PageHeap19IncrementalScavengeEj, +//GO(_ZN8tcmalloc8PageHeap20ReleaseAtLeastNPagesEj, +//GO(_ZN8tcmalloc8PageHeap22CheckAndHandlePreMergeEPNS_4SpanES2_, +//GO(_ZN8tcmalloc8PageHeap23SearchFreeAndLargeListsEj, +//GO(_ZN8tcmalloc8PageHeap3NewEj, +//GO(_ZN8tcmalloc8PageHeap5CarveEPNS_4SpanEj, +//GO(_ZN8tcmalloc8PageHeap5CheckEv, +//GO(_ZN8tcmalloc8PageHeap5SplitEPNS_4SpanEj, +//GO(_ZN8tcmalloc8PageHeap6DeleteEPNS_4SpanE, +//GO(_ZN8tcmalloc8PageHeap8CheckSetEPSt3setINS_17SpanPtrWithLengthENS_15SpanBestFitLessENS_20STLPageHeapAllocatorIS2_vEEEji, +//GO(_ZN8tcmalloc8PageHeap8GrowHeapEj, +//GO(_ZN8tcmalloc8PageHeap9CheckListEPNS_4SpanEjji, +//GO(_ZN8tcmalloc8PageHeapC1Ev, +//GO(_ZN8tcmalloc8PageHeapC2Ev, +//GO(_Znaj, +//GO(_ZnajRKSt9nothrow_t, +//GO(_ZnajSt11align_val_t, +//GO(_ZnajSt11align_val_tRKSt9nothrow_t, +//GO(_ZNK16ProcMapsIterator5ValidEv, +//GO(_ZNK8tcmalloc15StackTraceTable6Bucket8KeyEqualEjRKNS_10StackTraceE, +//GO(_Znwj, +//GO(_ZnwjRKSt9nothrow_t, +//GO(_ZnwjSt11align_val_t, +//GO(_ZnwjSt11align_val_tRKSt9nothrow_t, + +//DATAB(tcmalloc_sys_alloc, +//DATAB(TCMalloc_SystemTaken, +//DATAB(_ZN60FLAG__namespace_do_not_use_directly_use_DECLARE_bool_instead22FLAGS_malloc_skip_mmapE, +//DATAB(_ZN60FLAG__namespace_do_not_use_directly_use_DECLARE_bool_instead22FLAGS_malloc_skip_sbrkE, +//DATAB(_ZN60FLAG__namespace_do_not_use_directly_use_DECLARE_bool_instead24FLAGS_nomalloc_skip_mmapE, +//DATAB(_ZN60FLAG__namespace_do_not_use_directly_use_DECLARE_bool_instead24FLAGS_nomalloc_skip_sbrkE, +//DATAB(_ZN60FLAG__namespace_do_not_use_directly_use_DECLARE_bool_instead30FLAGS_memfs_malloc_map_privateE, +//DATAB(_ZN60FLAG__namespace_do_not_use_directly_use_DECLARE_bool_instead32FLAGS_memfs_malloc_abort_on_failE, +//DATAB(_ZN60FLAG__namespace_do_not_use_directly_use_DECLARE_bool_instead32FLAGS_nomemfs_malloc_map_privateE, +//DATAB(_ZN60FLAG__namespace_do_not_use_directly_use_DECLARE_bool_instead34FLAGS_nomemfs_malloc_abort_on_failE, +//DATAB(_ZN60FLAG__namespace_do_not_use_directly_use_DECLARE_bool_instead35FLAGS_malloc_disable_memory_releaseE, +//DATAB(_ZN60FLAG__namespace_do_not_use_directly_use_DECLARE_bool_instead35FLAGS_memfs_malloc_ignore_mmap_failE, +//DATAB(_ZN60FLAG__namespace_do_not_use_directly_use_DECLARE_bool_instead37FLAGS_nomalloc_disable_memory_releaseE, +//DATAB(_ZN60FLAG__namespace_do_not_use_directly_use_DECLARE_bool_instead37FLAGS_nomemfs_malloc_ignore_mmap_failE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int32_instead13FLAGS_verboseE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int32_instead15FLAGS_noverboseE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int32_instead25FLAGS_malloc_devmem_limitE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int32_instead25FLAGS_malloc_devmem_startE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int32_instead27FLAGS_nomalloc_devmem_limitE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int32_instead27FLAGS_nomalloc_devmem_startE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int64_instead27FLAGS_memfs_malloc_limit_mbE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int64_instead28FLAGS_tcmalloc_heap_limit_mbE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int64_instead29FLAGS_nomemfs_malloc_limit_mbE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int64_instead30FLAGS_notcmalloc_heap_limit_mbE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int64_instead31FLAGS_tcmalloc_sample_parameterE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int64_instead33FLAGS_notcmalloc_sample_parameterE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int64_instead43FLAGS_tcmalloc_large_alloc_report_thresholdE, +//DATAB(_ZN61FLAG__namespace_do_not_use_directly_use_DECLARE_int64_instead45FLAGS_notcmalloc_large_alloc_report_thresholdE, +//DATAB(_ZN62FLAG__namespace_do_not_use_directly_use_DECLARE_double_instead27FLAGS_tcmalloc_release_rateE, +//DATAB(_ZN62FLAG__namespace_do_not_use_directly_use_DECLARE_double_instead29FLAGS_notcmalloc_release_rateE, +//DATAB(_ZN62FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead21FLAGS_symbolize_pprofB5cxx11E, +//DATAB(_ZN62FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead23FLAGS_memfs_malloc_pathB5cxx11E, +//DATAB(_ZN62FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead23FLAGS_nosymbolize_pprofE, +//DATAB(_ZN62FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead25FLAGS_nomemfs_malloc_pathE, +//DATAB(_ZN8tcmalloc11ThreadCache13thread_heaps_E, +//DATAB(_ZN8tcmalloc11ThreadCache17threadlocal_data_E, +//DATAB(_ZN8tcmalloc11ThreadCache18next_memory_steal_E, +//DATAB(_ZN8tcmalloc11ThreadCache18thread_heap_count_E, +//DATAB(_ZN8tcmalloc11ThreadCache9heap_key_E, +//DATAB(_ZN8tcmalloc21threadcache_allocatorE, +//DATAB(_ZN8tcmalloc6Static14pageheap_lock_E, +//DATAB(_ZN8tcmalloc6Static7inited_E, + +//GOW(MallocHook_InitAtFirstAllocation_HeapLeakChecker, +//GOW(_Z24tc_get_sysalloc_overrideP12SysAllocator, +//GOW(_Z7RAW_LOGiPKcz, +//GOW(_Z8RAW_VLOGiPKcz, +//GOW(_Z9LogPrintfiPKcSt9__va_list, +//GOW(_ZN16MmapSysAllocatorD0Ev, +//GOW(_ZN16MmapSysAllocatorD1Ev, +//GOW(_ZN16MmapSysAllocatorD2Ev, +//GOW(_ZN16SbrkSysAllocatorD0Ev, +//GOW(_ZN16SbrkSysAllocatorD1Ev, +//GOW(_ZN16SbrkSysAllocatorD2Ev, +//GOW(_ZN17GoogleInitializerD1Ev, +//GOW(_ZN17GoogleInitializerD2Ev, +//GOW(_ZN18DevMemSysAllocatorD0Ev, +//GOW(_ZN18DevMemSysAllocatorD1Ev, +//GOW(_ZN18DevMemSysAllocatorD2Ev, +//GOW(_ZN19DefaultSysAllocatorD0Ev, +//GOW(_ZN19DefaultSysAllocatorD1Ev, +//GOW(_ZN19DefaultSysAllocatorD2Ev, +//GOW(_ZN19HugetlbSysAllocatorD0Ev, +//GOW(_ZN19HugetlbSysAllocatorD1Ev, +//GOW(_ZN19HugetlbSysAllocatorD2Ev, +//GOW(_ZN22TCMallocImplementation12GetOwnershipEPKv, +//GOW(_ZN22TCMallocImplementation13GetHeapSampleEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, +//GOW(_ZN22TCMallocImplementation14MarkThreadIdleEv, +//GOW(_ZN22TCMallocImplementation15ReadStackTracesEPi, +//GOW(_ZN22TCMallocImplementation15ReleaseToSystemEj, +//GOW(_ZN22TCMallocImplementation16GetFreeListSizesEPSt6vectorIN15MallocExtension12FreeListInfoESaIS2_EE, +//GOW(_ZN22TCMallocImplementation18GetNumericPropertyEPKcPj, +//GOW(_ZN22TCMallocImplementation18GetSystemAllocatorEv, +//GOW(_ZN22TCMallocImplementation18GetThreadCacheSizeEv, +//GOW(_ZN22TCMallocImplementation18SetNumericPropertyEPKcj, +//GOW(_ZN22TCMallocImplementation18SetSystemAllocatorEP12SysAllocator, +//GOW(_ZN22TCMallocImplementation20GetMemoryReleaseRateEv, +//GOW(_ZN22TCMallocImplementation20SetMemoryReleaseRateEd, +//GOW(_ZN22TCMallocImplementation25MarkThreadTemporarilyIdleEv, +//GOW(_ZN22TCMallocImplementation25ReadHeapGrowthStackTracesEv, +//GOW(_ZN22TCMallocImplementation6RangesEPvPFvS0_PKN4base11MallocRangeEE, +//GOW(_ZN22TCMallocImplementation8GetStatsEPci, +//GOW(_ZN22TCMallocImplementationD0Ev, +//GOW(_ZN22TCMallocImplementationD1Ev, +//GOW(_ZN22TCMallocImplementationD2Ev, +//GOW(_ZN4base8internal8HookListIPFvPKvjEE16ExchangeSingularES5_, +//GOW(_ZN4base8internal8HookListIPFvPKvjEE18FixupPrivEndLockedEv, +//GOW(_ZN4base8internal8HookListIPFvPKvjEE3AddES5_, +//GOW(_ZN4base8internal8HookListIPFvPKvjEE6RemoveES5_, +//GOW(_ZN8SpinLock4LockEv, +//GOW(_ZN8SpinLock6UnlockEv, +//GOW(_ZNK4base8internal8HookListIPFvPKvjEE11GetSingularEv, +//GOW(_ZNK4base8internal8HookListIPFvPKvjEE5emptyEv, +//GOW(_ZNK4base8internal8HookListIPFvPKvjEE8TraverseEPS5_i, +//GOW(_ZNSt6vectorIN15MallocExtension12FreeListInfoESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_, +//GOW(_ZNSt8_Rb_treeIN8tcmalloc17SpanPtrWithLengthES1_St9_IdentityIS1_ENS0_15SpanBestFitLessENS0_20STLPageHeapAllocatorIS1_vEEE16_M_insert_uniqueIS1_EESt4pairISt17_Rb_tree_iteratorIS1_EbEOT_, +//GOW(_ZNSt8_Rb_treeIN8tcmalloc17SpanPtrWithLengthES1_St9_IdentityIS1_ENS0_15SpanBestFitLessENS0_20STLPageHeapAllocatorIS1_vEEE8_M_eraseEPSt13_Rb_tree_nodeIS1_E, +//GOW(_ZNSt8_Rb_treeIPKvSt4pairIKS1_PKcESt10_Select1stIS6_ESt4lessIS1_ESaIS6_EE24_M_get_insert_unique_posERS3_, diff --git a/src/wrapped32/wrappedudev0.c b/src/wrapped32/wrappedudev0.c new file mode 100644 index 0000000..b9d4f6d --- /dev/null +++ b/src/wrapped32/wrappedudev0.c @@ -0,0 +1,41 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "debug.h" +#include "myalign32.h" +#include "callback.h" +#include "emu/x64emu_private.h" + +static const char* udev0Name = "libudev.so.0"; +#define LIBNAME udev0 + +#define ADDED_FUNCTIONS() \ + +//#include "generated/wrappedudev0types.h" + +//#include "wrappercallback.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +#undef SUPER + +#define ALTMY my0_ + +#define NEEDED_LIBS "libudev.so.1" + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedudev0_private.h b/src/wrapped32/wrappedudev0_private.h new file mode 100644 index 0000000..fa89c34 --- /dev/null +++ b/src/wrapped32/wrappedudev0_private.h @@ -0,0 +1,9 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh.... +#endif + +GO(udev_get_dev_path, pFp) +GO(udev_get_run_path, pFp) +GO(udev_get_sys_path, pFp) +GO(udev_monitor_new_from_socket, pFpp) +GO(udev_queue_get_failed_list_entry, pFp) diff --git a/src/wrapped32/wrappedudev1.c b/src/wrapped32/wrappedudev1.c new file mode 100644 index 0000000..00cc23e --- /dev/null +++ b/src/wrapped32/wrappedudev1.c @@ -0,0 +1,69 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "debug.h" +#include "myalign32.h" +#include "callback.h" +#include "emu/x64emu_private.h" + +static const char* udev1Name = "libudev.so.1"; +#define LIBNAME udev1 +// fallback to 0 version... Not sure if really correct (probably not) +#define ALTNAME "libudev.so.0" + +#define ADDED_FUNCTIONS() \ + +#include "generated/wrappedudev1types32.h" + +#include "wrappercallback32.h" + +#define SUPER() \ +GO(0) \ +GO(1) \ +GO(2) \ +GO(3) \ +GO(4) + +// log_fn ... +#define GO(A) \ +static uintptr_t my_log_fn_fct_##A = 0; \ +static void my_log_fn_##A(void* udev, int p, void *f, int l, void* fn, void* fmt, va_list args) \ +{ \ + static char buff[1024]; \ + vsnprintf(buff, 1023, fmt, args); \ + buff[1023]=0; \ + RunFunction(my_log_fn_fct_##A, 7, udev, p, f, l, fn, "%s", buff); \ +} +SUPER() +#undef GO +static void* find_log_fn_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_log_fn_fct_##A == (uintptr_t)fct) return my_log_fn_##A; + SUPER() + #undef GO + #define GO(A) if(my_log_fn_fct_##A == 0) {my_log_fn_fct_##A = (uintptr_t)fct; return my_log_fn_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for udev1 log_fn callback\n"); + return NULL; +} +#undef SUPER + +EXPORT void my32_udev_set_log_fn(x64emu_t* emu, void* udev, void* f) +{ + my->udev_set_log_fn(udev, find_log_fn_Fct(f)); +} + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedudev1_private.h b/src/wrapped32/wrappedudev1_private.h new file mode 100644 index 0000000..0eb88ce --- /dev/null +++ b/src/wrapped32/wrappedudev1_private.h @@ -0,0 +1,96 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(udev_device_ref, pFp) +GO(udev_device_unref, pFp) +GO(udev_device_get_udev, pFp) +GO(udev_device_new_from_syspath, pFpp) +GO(udev_device_new_from_devnum, pFpcU) +GO(udev_device_new_from_subsystem_sysname, pFppp) +GO(udev_device_new_from_environment, pFp) +GO(udev_device_get_parent, pFp) +GO(udev_device_get_parent_with_subsystem_devtype, pFppp) +GO(udev_device_get_devpath, pFp) +GO(udev_device_get_subsystem, pFp) +GO(udev_device_get_devtype, pFp) +GO(udev_device_get_syspath, pFp) +GO(udev_device_get_sysname, pFp) +GO(udev_device_get_sysnum, pFp) +GO(udev_device_get_devnode, pFp) +GO(udev_device_get_is_initialized, iFp) +GO(udev_device_get_devlinks_list_entry, pFp) +GO(udev_device_get_properties_list_entry, pFp) +GO(udev_device_get_tags_list_entry, pFp) +GO(udev_device_get_property_value, pFpp) +GO(udev_device_get_driver, pFp) +GO(udev_device_get_devnum, UFp) +GO(udev_device_get_action, pFp) +GO(udev_device_get_sysattr_value, pFpp) +GO(udev_device_get_sysattr_list_entry, pFp) +GO(udev_device_get_seqnum, UFp) +GO(udev_device_get_usec_since_initialized, UFp) +GO(udev_device_has_tag, iFpp) +GO(udev_enumerate_ref, pFp) +GO(udev_enumerate_unref, pFp) +GO(udev_enumerate_get_udev, pFp) +GO(udev_enumerate_new, pFp) +GO(udev_enumerate_add_match_subsystem, iFpp) +GO(udev_enumerate_add_nomatch_subsystem, iFpp) +GO(udev_enumerate_add_match_sysattr, iFppp) +GO(udev_enumerate_add_nomatch_sysattr, iFppp) +GO(udev_enumerate_add_match_property, iFppp) +GO(udev_enumerate_add_match_tag, iFpp) +GO(udev_enumerate_add_match_parent, iFpp) +GO(udev_enumerate_add_match_is_initialized, iFp) +GO(udev_enumerate_add_match_sysname, iFpp) +GO(udev_enumerate_add_syspath, iFpp) +GO(udev_enumerate_scan_devices, iFp) +GO(udev_enumerate_scan_subsystems, iFp) +GO(udev_enumerate_get_list_entry, pFp) +GO(udev_list_entry_get_next, pFp) +GO(udev_list_entry_get_by_name, pFpp) +GO(udev_list_entry_get_name, pFp) +GO(udev_list_entry_get_value, pFp) +GO(udev_monitor_ref, pFp) +GO(udev_monitor_unref, pFp) +GO(udev_monitor_get_udev, pFp) +GO(udev_monitor_new_from_netlink, pFpp) +GO(udev_monitor_new_from_socket, pFpp) +GO(udev_monitor_enable_receiving, iFp) +GO(udev_monitor_set_receive_buffer_size, iFpi) +GO(udev_monitor_get_fd, iFp) +GO(udev_monitor_receive_device, pFp) +GO(udev_monitor_filter_add_match_subsystem_devtype, iFppp) +GO(udev_monitor_filter_add_match_tag, iFpp) +GO(udev_monitor_filter_update, iFp) +GO(udev_monitor_filter_remove, iFp) +GO(udev_new, pFv) +GO(udev_ref, pFp) +GO(udev_unref, pFp) +GO(udev_queue_ref, pFp) +GO(udev_queue_unref, pFp) +GO(udev_queue_get_udev, pFp) +GO(udev_queue_new, pFp) +GO(udev_queue_get_kernel_seqnum, UFp) +GO(udev_queue_get_udev_seqnum, UFp) +GO(udev_queue_get_udev_is_active, iFp) +GO(udev_queue_get_queue_is_empty, iFp) +GO(udev_queue_get_seqnum_is_finished, iFpU) +GO(udev_queue_get_seqnum_sequence_is_finished, iFpUU) +GO(udev_queue_get_queued_list_entry, pFp) +GO(udev_queue_get_failed_list_entry, pFp) +GOM(udev_set_log_fn, vFEpp) +GO(udev_get_log_priority, iFp) +GO(udev_set_log_priority, vFpi) +GO(udev_get_userdata, pFp) +GO(udev_set_userdata, vFpp) +GO(udev_device_new_from_device_id, pFpp) +GO(udev_device_set_sysattr_value, iFppp) +GO(udev_queue_get_fd, iFp) +GO(udev_queue_flush, iFp) +GO(udev_hwdb_ref, pFp) +GO(udev_hwdb_unref, pFp) +GO(udev_hwdb_new, pFp) +GO(udev_hwdb_get_properties_list_entry, pFppu) +GO(udev_util_encode_string, iFppL) diff --git a/src/wrapped32/wrappedxinerama.c b/src/wrapped32/wrappedxinerama.c new file mode 100644 index 0000000..a75d9c1 --- /dev/null +++ b/src/wrapped32/wrappedxinerama.c @@ -0,0 +1,29 @@ +#include +#include +#include +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include + +#include "wrappedlibs.h" + +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "box32.h" + +#ifdef ANDROID + static const char* xineramaName = "libXinerama.so"; +#else + static const char* xineramaName = "libXinerama.so.1"; +#endif + +#define LIBNAME xinerama + +#ifdef ANDROID +#define NEEDED_LIBS "libX11.so", "libXext.so" +#else +#define NEEDED_LIBS "libX11.so.6", "libXext.so.6" +#endif + +#include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedxinerama_private.h b/src/wrapped32/wrappedxinerama_private.h new file mode 100644 index 0000000..dd33796 --- /dev/null +++ b/src/wrapped32/wrappedxinerama_private.h @@ -0,0 +1,14 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh... +#endif + +GO(XineramaIsActive, iFX) +GO(XineramaQueryExtension, iFXpp) +GO(XineramaQueryScreens, pFXp) +GO(XineramaQueryVersion, iFXpp) +//GO(XPanoramiXAllocInfo, bLiiiiiL_Fv) +//GO(XPanoramiXGetScreenCount, iFXLbLiiiiiL_) +//GO(XPanoramiXGetScreenSize, iFXLibLiiiiiL_) +//GO(XPanoramiXGetState, iFXLbLiiiiiL_) +GO(XPanoramiXQueryExtension, iFXpp) +GO(XPanoramiXQueryVersion, iFXpp) diff --git a/src/wrapped32/wrappercallback32.h b/src/wrapped32/wrappercallback32.h new file mode 100644 index 0000000..74c2670 --- /dev/null +++ b/src/wrapped32/wrappercallback32.h @@ -0,0 +1,42 @@ +#define TYPENAME3(N,M) N##M +#define TYPENAME2(N,M) TYPENAME3(N,M) +#define TYPENAME(N) TYPENAME2(LIBNAME, _my_t) + +typedef struct TYPENAME2(LIBNAME, _my_s) { + // functions + #define GO(A, B) B A; + SUPER() + #undef GO + #ifdef ADDED_STRUCT + ADDED_STRUCT() + #endif +} TYPENAME(LIBNAME); + +static library_t* my_lib = NULL; +static TYPENAME(LIBNAME) TYPENAME2(my_, LIBNAME) = {0}; +static TYPENAME(LIBNAME) * const my = &TYPENAME2(my_, LIBNAME); + +static void getMy(library_t* lib) +{ + #define GO(A, W) my->A = (W)dlsym(lib->w.lib, #A); + SUPER() + #undef GO + my_lib = lib; + #ifdef ADDED_INIT + ADDED_INIT() + #endif +} + +static void freeMy() +{ + #ifdef ADDED_FINI + ADDED_FINI() + #endif + my_lib = NULL; +} + +#define HAS_MY + +#ifndef ADDED_SUPER +#undef SUPER +#endif diff --git a/system/box32.conf.cmake b/system/box32.conf.cmake new file mode 100644 index 0000000..0e87213 --- /dev/null +++ b/system/box32.conf.cmake @@ -0,0 +1,2 @@ +# /etc/binfmt.d/box32.conf +:box32:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:${CMAKE_INSTALL_PREFIX}/bin/${BOX64}: diff --git a/system/box64.box64rc b/system/box64.box64rc index 25e9925..31e8e8f 100644 --- a/system/box64.box64rc +++ b/system/box64.box64rc @@ -2,13 +2,59 @@ # Note that process name are case insensitive! +# +# Generic names +# +[*setup*] +# using safest dynarec settings here, has some installers do crazy things +BOX64_DYNACACHE=0 +BOX64_DYNAREC_SAFEFLAGS=2 +#BOX64_DYNAREC_BIGBLOCK=0 +#BOX64_DYNAREC_CALLRET=0 + +[*install*] +# using safest dynarec settings here, as some installers do crazy things +BOX64_DYNACACHE=0 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=0 +BOX64_DYNAREC_CALLRET=0 + +# Global DXVK per-file settings +# removed callret=1 on the per libs as is it is only effective when enabled globaly +[/d3d8.dll] +BOX64_DYNAREC_STRONGMEM=0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_SAFEFLAGS=0 + +[/d3d9.dll] +BOX64_DYNAREC_STRONGMEM=0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_SAFEFLAGS=0 + +[/d3d10core.dll] +BOX64_DYNAREC_STRONGMEM=0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_SAFEFLAGS=0 + +[/d3d11.dll] +BOX64_DYNAREC_STRONGMEM=0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_SAFEFLAGS=0 + +[/dxgi.dll] +BOX64_DYNAREC_STRONGMEM=0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_SAFEFLAGS=0 + # # Linux process # [3dSen.x86_64] BOX64_DYNAREC_BLEEDING_EDGE=0 # avoid the use of STRONGMEM for much better performances BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_STRONGMEM=1 BOX64_DYNAREC_BIGBLOCK=2 +BOX64_DYNAREC_DIRTY=1 BOX64_DYNAREC_FORWARD=1024 BOX64_DYNAREC_CALLRET=1 BOX64_MAXCPU=4 # surprisingly, having too much cpu core slow down things.4 is more than enough here @@ -30,11 +76,39 @@ BOX64_DYNAREC_FORWARD=512 BOX64_DYNAREC_CALLRET=1 BOX64_DYNAREC_ALIGNED_ATOMICS=1 +[AlienIsolation] +BOX64_MAXCPU=16 #will crash if too many cores are present, (like 128) +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[amtrucks] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_STRONGMEM=1 + +[BALDI.x86_64] +BOX64_DYNAREC_STRONGMEM=1 #little to no performance impact also makes game not crash +BOX64_PREFER_EMULATED=1 + +[Baldi's Fun New School Plus Ultimate Edition.x86_64] +BOX64_DYNAREC_STRONGMEM=2 #needed paramiter or else it just dies +BOX64_PREFER_EMULATED=1 + [bash] # LOG tend to mess up script execution in bash BOX64_LOG=0 BOX64_DYNAREC_ALIGNED_ATOMICS=1 +[BeamNG.drive.x64] +BOX64_MALLOC_HACK=2 +BOX64_DYNAREC_CALLRET=1 +BOX64_NOSANDBOX=1 + +[box64-bash] +# LOG tend to mess up script execution in bash +BOX64_LOG=0 +BOX64_DYNAREC_ALIGNED_ATOMICS=1 + [beyond-all-reason] BOX64_MALLOC_HACK=2 @@ -45,16 +119,47 @@ BOX64_DYNAREC_FORWARD=1024 BOX64_DYNAREC_CALLRET=1 BOX64_MAXCPU=4 # surprisingly, having too much cpu core slow down things.4 is more than enough here +[Broforce-838.x86_64] +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_BIGBLOCK=2 +BOX64_DYNAREC_FORWARD=1024 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_CALLRET=1 +BOX64_MAXCPU=4 # surprisingly, having too much cpu core slow down things.4 is more than enough here +BOX64_DYNAREC_DIRTY=1 + +[Celeste.bin.x86_64] +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_DIRTY=1 + [chrome] BOX64_MALLOC_HACK=2 +[cursor] +BOX64_MALLOC_HACK=2 +#BOX64_DYNAREC_BIGBLOCK=3 +#BOX64_DYNAREC_CALLRET=1 +#BOX64_DYNAREC_SAFEFLAGS=0 + +[chrome_crashpad_handler] +BOX64_MALLOC_HACK=2 + +[dav1d] +BOX64_DYNAREC_BIGBLOCK=2 +BOX64_DYNAREC_FORWARD=512 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_ALIGNED_ATOMICS=1 + [deadcells] BOX64_PREFER_EMULATED=1 BOX64_DYNAREC_ALIGNED_ATOMICS=1 -[dontstarve] -# use emulated sdl2 -BOX64_EMULATED_LIBS=libSDL2-2.0.so.0 +[discord] +BOX64_ENV1=BOX64_LD_PRELOAD=libXi.so.6 +BOX64_MALLOC_HACK=2 [dontstarve_steam_x64] BOX64_EMULATED_LIBS=libSDL2-2.0.so.0 @@ -63,9 +168,19 @@ BOX64_EMULATED_LIBS=libSDL2-2.0.so.0 BOX64_CRASHHANDLER=1 BOX64_DYNAREC_STRONGMEM=1 +[DXHRDC.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_MAXCPU=16 + [EtG.x86_64] BOX64_MAXCPU=4 #it will crash with too many cpu, 4 is enough anyway +[eurotrucks2] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_STRONGMEM=1 + [factorio] BOX64_DYNAREC_SAFEFLAGS=0 BOX64_DYNAREC_BIGBLOCK=2 @@ -74,53 +189,37 @@ BOX64_DYNAREC_CALLRET=1 BOX64_DYNAREC_FASTROUND=0 BOX64_DYNAREC_ALIGNED_ATOMICS=1 -[BALDI.x86_64] -BOX64_DYNAREC_STRONGMEM=1 #little to no performance impact also makes game not crash -BOX64_PREFER_EMULATED=1 - -[Baldi's Fun New School Plus Ultimate Edition.x86_64] -BOX64_DYNAREC_STRONGMEM=2 #needed paramiter or else it just dies -BOX64_PREFER_EMULATED=1 - -[picohot] -# good game -BOX64_DYNAREC_STRONGMEM=1 #needed or else it just crashes -BOX64_CRASHHANDLER=0 -BOX64_PREFER_EMULATED=1 - -[Start Survey Linux.x86_64] -BOX64_DYNAREC_STRONGMEM=2 #Likes to crash without it -BOX64_PREFER_EMULATED=1 - -[My Dystopian Robot Girlfriend.x86_64] -BOX64_DYNAREC_STRONGMEM=3 # Fixes memory leak related crashes -BOX64_CRASHHANDLER=0 # Better crash handler and not dummy lib -BOX64_PREFER_EMULATED=1 # Load in heavy stuff first +[Formula Retro Racing - World Tour.x86] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 [geekbench6] -BOX64_ENV=BOX64_DYNAREC_STRONGMEM=3 +BOX64_ENV=BOX64_DYNAREC_STRONGMEM=1 BOX64_ENV1=BOX64_RESERVE_HIGH=1 +BOX64_ENV2=BOX64_DYNAREC_CALLRET=1 [geekbench5] BOX64_ENV=BOX64_DYNAREC_BIGBLOCK=2 BOX64_ENV1=BOX64_DYNAREC_FORWARD=1024 BOX64_ENV2=BOX64_DYNAREC_CALLRET=1 +[GigaTribe] +BOX64_EMULATED_LIBS=libpng16.so.16 + +[GoatGame] +BOX64_DYNAREC_STRONGMEM=1 + [GridAutosport] #BOX64_DYNAREC_BIGBLOCK=2 BOX64_NOSANDBOX=1 BOX64_DYNAREC_ALIGNED_ATOMICS=1 BOX64_MAXCPU=16 -[Kingdom Rush Origins] -BOX64_RESERVE_HIGH=1 -BOX64_EMULATED_LIBS=libmpg123.so.0:libvorbisfile.so.3:libvorbis.so.0:libogg.so.0:libSDL2-2.0.so.0 - [heroic] BOX64_NOSANDBOX=1 BOX64_INPROCESSGPU=1 BOX64_MALLOC_HACK=2 -BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_CALLRET=1 BOX64_DYNAREC_ALIGNED_ATOMICS=1 BOX64_DYNAREC_STRONGMEM=1 @@ -134,12 +233,33 @@ BOX64_DYNAREC_SAFEFLAGS=0 [Hue.x86_64] BOX64_MAXCPU=16 +[Kingdom Rush Origins] +BOX64_RESERVE_HIGH=1 +BOX64_EMULATED_LIBS=libmpg123.so.0:libvorbisfile.so.3:libvorbis.so.0:libogg.so.0:libSDL2-2.0.so.0 + [Kingdom.x86_64] BOX64_MAXCPU=4 +[Launcher] +#Paradox Launcher? +BOX64_MALLOC_HACK=2 + +[P5R.exe] +BOX64_DYNAREC_SAFEFLAGS=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[legendary] +BOX64_DYNAREC_STRONGMEM=1 + [LotCG.x86_64] BOX64_DYNAREC_FASTROUND=0 +[My Dystopian Robot Girlfriend.x86_64] +BOX64_DYNAREC_STRONGMEM=3 # Fixes memory leak related crashes +BOX64_CRASHHANDLER=0 # Better crash handler and not dummy lib +BOX64_PREFER_EMULATED=1 # Load in heavy stuff first + [Mini Metro] BOX64_ADDLIBS=libstdc++.so.6 @@ -153,12 +273,25 @@ BOX64_DYNAREC_SAFEFLAGS=0 #BOX64_DYNAREC_FORWARD=1024 BOX64_DYNAREC_ALIGNED_ATOMICS=1 +[OperationWolf.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_MAXCPU=8 + [OxygenNotIncluded] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 BOX64_DYNAREC_FASTROUND=0 [pressure-vessel-wrap] BOX64_NOGTK=1 +[picohot] +# good game +BOX64_DYNAREC_STRONGMEM=1 #needed or else it just crashes +BOX64_CRASHHANDLER=0 +BOX64_PREFER_EMULATED=1 + [ProjectZomboid64] # This one is still a bit unstable. This might help, but will also slowdown emulation BOX64_DYNAREC_STRONGMEM=3 @@ -168,6 +301,13 @@ BOX64_JVM=0 BOX64_SSE42=0 BOX64_MAXCPU=4 +[satinav] +BOX64_EMULATED_LIBS=libopenal.so + +[ShovelKnight] +BOX64_SDL2_JGUID=1 +BOX64_DYNAREC_ALIGNED_ATOMICS=1 + [Soma.bin.x86_64] # This is needed or the physics engine will not behave correctly BOX64_DYNAREC_FASTROUND=0 @@ -180,42 +320,94 @@ BOX64_MALLOC_HACK=2 # this is to save some memory BOX64_DYNAREC_BIGBLOCK=0 -[steam] -BOX64_CRASHHANDLER=1 -BOX64_EMULATED_LIBS=libudev.so.0 +[Start Survey Linux.x86_64] +BOX64_DYNAREC_STRONGMEM=2 #Likes to crash without it +BOX64_PREFER_EMULATED=1 [streaming_client] BOX64_EMULATED_LIBS=libSDL2-2.0.so.0:libSDL2_ttf-2.0.so.0 -#[steamwebhelper] -#BOX64_NOSANDBOX=1 -#BOX64_INPROCESSGPU=1 -#BOX64_LOG=0 -#BOX64_MALLOC_HACK=2 -#BOX64_DYNAREC_BIGBLOCK=0 -#BOX64_DYNAREC_CALLRET=1 -#BOX64_DYNAREC_STRONGMEM=2 - -[steamwebhelper.exe] -BOX64_DYNAREC_STRONGMEM=4 -BOX64_DYNAREC_BIGBLOCK=0 -BOX64_DYNAREC_SAFEFLAGS=2 +# Linux Steam configurations -[steam.exe] -BOX64_DYNAREC_BIGBLOCK=0 -BOX64_DYNAREC_STRONGMEM=1 -BOX64_CEFDISABLEGPU=1 +[steam-runtime-launcher-service] +BOX64_NOGTK=1 [steam-runtime-check-requirements] BOX64_EXIT=1 -[steam-runtime-launcher-service] -BOX64_NOGTK=1 -BOX64_EXIT=1 +[steam] +BOX64_CRASHHANDLER=0 +BOX64_EMULATED_LIBS=libudev.so.0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_STRONGMEM=2 +BOX64_AVX=0 #there are probably some memory barrier missing on avx opcode as it's more stable without avx +BOX64_MAXCPU=8 #on machine with large CPU count, steam can be really unstable and this helps a lot -[ShovelKnight] -BOX64_SDL2_JGUID=1 -BOX64_DYNAREC_ALIGNED_ATOMICS=1 +[steamwebhelper] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_FASTROUND=0 +BOX64_DYNAREC_SAFEFLAGS=0 + +[steam] +BOX64_ARCH=la64 +BOX64_AES=0 +BOX64_SHAEXT=0 +BOX64_PCLMULQDQ=0 +BOX64_CRASHHANDLER=0 +BOX64_EMULATED_LIBS=libudev.so.0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_NOARCH=1 +BOX64_DYNAREC_STRONGMEM=2 +BOX64_MAXCPU=8 +BOX64_STEAM_VULKAN=1 + +[steamwebhelper] +BOX64_ARCH=la64 +BOX64_AES=0 +BOX64_SHAEXT=0 +BOX64_PCLMULQDQ=0 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=0 #to save memory +BOX64_DYNAREC_NOARCH=1 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_FASTROUND=0 + +[steam] +BOX64_ARCH=rv64 +BOX64_AES=0 +BOX64_SHAEXT=0 +BOX64_PCLMULQDQ=0 +BOX64_CRASHHANDLER=0 +BOX64_EMULATED_LIBS=libudev.so.0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_NOARCH=1 +BOX64_DYNAREC_STRONGMEM=2 +BOX64_MAXCPU=8 +BOX64_STEAM_VULKAN=1 + +[steamwebhelper] +BOX64_ARCH=rv64 +BOX64_AES=0 +BOX64_SHAEXT=0 +BOX64_PCLMULQDQ=0 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=0 #to save memory +BOX64_DYNAREC_NOARCH=1 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_FASTROUND=0 # needed for CVTTSD2SI because on RISC-V the behavior is different than others when src is NaN + +[TIE95.exe] +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_BIGBLOCK=3 [Torchlight2.bin.x86_64] # Those are safe to use on 7z and give a bit of a boost @@ -228,6 +420,13 @@ BOX64_DYNAREC_ALIGNED_ATOMICS=1 [ToTheMoon.bin.x86_64] BOX64_PREFER_EMULATED=1 +[Trackmania.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_DIV0=1 +BOX64_NODYNAREC=0x6fffff000000-0x700000000000 #there is probbaly some time-based anti-debug that +BOX64_NODYNAREC_DELAY=1 #needs this hack. It will not work on 39bits address space machines.... + + [trine3_linux_64bit] BOX64_DYNAREC_STRONGMEM=1 @@ -250,50 +449,251 @@ BOX64_DYNAREC_CALLRET=0 # prevent segfaulting # Wine process # -[artofrally.exe] +[AC4BFSP.exe] BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_DIV0=1 +BOX64_DYNAREC_CALLRET=2 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_MAXCPU=8 -[BatmanAK.exe] +[AC4BFMP.exe] BOX64_DYNAREC_STRONGMEM=1 -BOX64_DYNAREC_ALIGNED_ATOMICS=1 - -[Battle.net.exe] -BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_SAFEFLAGS=2 -BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_DIV0=1 +BOX64_MAXCPU=8 + +[Ageless.exe] +BOX64_DYNAREC_BIGBLOCK=3 BOX64_DYNAREC_CALLRET=1 -BOX64_DYNAREC_ALIGNED_ATOMICS=0 +BOX64_DYNAREC_SAFEFLAGS=0 -[CapcomArcadeStadium.exe] -BOX64_DYNAREC_STRONGMEM=1 -BOX64_NOGTK=1 +[Anno1404.exe] +BOX64_DYNAREC_SAFEFLAGS=2 -[CapcomArcade2ndStadium.exe] -BOX64_DYNAREC_STRONGMEM=1 -BOX64_NOGTK=1 +[Anno1404Addon.exe] +BOX64_DYNAREC_SAFEFLAGS=2 -[Cat Quest.exe] -BOX64_DYNAREC_STRONGMEM=1 +[Anno1701.exe] +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_BIGBLOCK=3 -[Celeste.exe] -BOX64_DYNAREC_SAFEFLAGS=2 +[Anno1701AddOn.exe] +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_BIGBLOCK=3 -[CrysisRemastered.exe] -BOX64_DYNAREC_BIGBLOCK=2 +[APlagueTaleInnocence_x64.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 BOX64_DYNAREC_STRONGMEM=1 -[DaveTheDiver.exe] -BOX64_DYNAREC_STRONGMEM=1 +[ASC-Win64-Shipping.exe] +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_BIGBLOCK=3 -[DOOMx64.exe] -BOX64_DYNAREC_SAFEFLAGS=0 +[Asphalt9_epic_x64_rtl.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 -[DOOMx64vk.exe] -BOX64_DYNAREC_SAFEFLAGS=0 +[AtariVault.x86_64] +BOX64_MAXCPU=8 -[Doors Paradox.exe] +[BatmanAK.exe] BOX64_DYNAREC_STRONGMEM=1 - +BOX64_DYNAREC_ALIGNED_ATOMICS=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[Battle.net.exe] +BOX64_DYNAREC_BIGBLOCK=0 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_ALIGNED_ATOMICS=0 +BOX64_INSERT_ARGS=--enable-features=Vulkan # hardware accel! + +[Bezier.exe] +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_BIGBLOCK=3 + +[BioShockInfinite.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[Blacksad.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[Borderlands3.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[Brotato.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[CapcomArcadeStadium.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_BIGBLOCK=3 + +[CapcomArcade2ndStadium.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_BIGBLOCK=3 + +[Celeste.exe] +BOX64_DYNAREC_SAFEFLAGS=2 + +[Claybook-Win64-Shipping.exe] +BOX64_SHAEXT=0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_CALLRET=1 + +[CrysisRemastered.exe] +BOX64_DYNAREC_BIGBLOCK=2 +BOX64_DYNAREC_STRONGMEM=1 + +[Crysis.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_MAXCPU=8 + +[Crysis64.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_MAXCPU=8 + +[Cyberpunk2077.exe] +BOX64_DYNAREC_SAFEFLAGS=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_FASTROUND=0 +BOX64_SSE_FLUSHTO0=1 + +[DaveTheDiver.exe] +BOX64_DYNAREC_SAFEFLAGS=2 + +[Deliver At All Costs.exe] +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[DeliverUsMars-Win64-Shipping.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_CALLRET=1 + +[DetroitBecomeHuman.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[DIRT5.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_PAUSE=3 +BOX64_DYNAREC_DIRTY=1 + +[dirtrally2.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[Dishonored2.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 + +[DOOMx64.exe] +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[DOOMx64vk.exe] +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[ds.exe] +# this is Death Stranding +BOX64_AVX=2 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_RDTSC_1GHZ=1 +BOX64_DYNAREC_STRONGMEM=1 + +[DXMD.exe] +#Deus Ex: Mankind Divide +BOX64_DYNAREC_FASTROUND=0 #freeze without this +BOX64_DYNAREC_CALLRET=1 +#BOX64_DYNAREC_BIGBLOCK=3 #tend to freeze with this + +[DXSETUP.exe] +BOX64_DYNACACHE=0 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=0 + +# All the EA/Origin launcher process. Not 100% working yet +[EALocalHostSvc.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=0 +BOX64_DYNACACHE=0 #something upset this app + +[EABackgroundService.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=0 +BOX64_DYNACACHE=0 #something upset this app + +[EACefSubprocess.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=0 +BOX64_DYNAREC_PURGE=1 + +[Link2EA.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=0 +BOX64_DYNACACHE=0 #something upset this app + +[EALaunchHelper.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +#BOX64_DYNAREC_DIRTY=1 #break things + +[EADesktop.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=0 +BOX64_DYNACACHE=0 #something upset this app +#Last of the EA/Origin Launcher process + +[F1_23.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=0 +BOX64_SSE_FLUSHTO0=1 +BOX64_DYNAREC_DIRTY=1 + +[F1RaceStars.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_STRONGMEM=1 + +[FactoryGameSteam-Win64-Shipping.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_SSE_FLUSHTO0=1 + [Fallout4.exe] BOX64_DYNAREC_STRONGMEM=1 @@ -310,28 +710,106 @@ BOX64_DYNAREC_BIGBLOCK=3 BOX64_DYNAREC_CALLRET=1 BOX64_DYNAREC_BIGBLOCK=3 +[FP2.exe] +BOX64_MAXCPU=4 #4 is more than enough for this game. + [ForzaHorizon4.exe] BOX64_DYNAREC_STRONGMEM=1 #prevent random crashes it seems -BOX64_DYNAREC_BIGBLOCK=0 +BOX64_DYNAREC_BIGBLOCK=3 +#BOX64_DYNAREC_CALLRET=1 #will not be able to sign-in if enabled BOX64_DYNAREC_FASTROUND=0 #needed or interior view are borken, among other things [ForzaWebHelper.exe] -BOX64_DYNAREC_STRONGMEM=3 +BOX64_DYNAREC_STRONGMEM=1 BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_SAFEFLAGS=2 BOX64_DYNAREC_CALLRET=0 +BOX64_DYNAREC_PURGE=1 + +[GCU2.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 [GenshinImpact.exe] BOX64_DYNAREC_STRONGMEM=1 BOX64_DYNAREC_SAFEFLAGS=2 +[ggc.exe] +#this is Gun Gore and Cannoli +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_MAXCPU=4 + +[Ghostrunner-Win64-Shipping.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 + +[GRIDAutosport.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[GRIDAutosport_avx.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[Grip-Win64-Shipping.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_SHAEXT=0 #buggy openssl version in the game + +[GRIS.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[gta3.exe] +#BOX64_DYNAREC_SAFEFLAGS=2 #not needed +BOX64_DYNAREC_DIRTY=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_X87DOUBLE=2 + +[Hades.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[Hearthstone.exe] +BOX64_DYNAREC_SAFEFLAGS=2 + +[HogwartsLegacy.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_SSE_FLUSHTO0=1 + [HorizonZeroDawn.exe] BOX64_DYNAREC_STRONGMEM=1 BOX64_RDTSC_1GHZ=1 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_BIGBLOCK=3 [INSIDE.exe] BOX64_DYNAREC_STRONGMEM=1 +[JWE.exe] +BOX64_DYNAREC_SAFEFLAGS=2 + +[JustCause3.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_STRONGMEM=1 + +[LEGO2KDrive-Win64-Shipping.exe] +BOX64_DYNAREC_STRONGMEM=0 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_SSE_FLUSHTO0=1 +BOX64_DYNAREC_DIRTY=1 + +[Maneater-Win64-Shipping.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_CALLRET=1 + [MassEffect.exe] BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_SAFEFLAGS=2 @@ -339,33 +817,476 @@ BOX64_DYNAREC_STRONGMEM=1 BOX64_DYNAREC_X87DOUBLE=1 BOX64_DYNAREC_FASTROUND=0 -[MinutesTillDawn.exe] +[Mini Motorways.exe] BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_CALLRET=1 +BOX64_MAXCPU=8 +BOX64_DYNAREC_DIRTY=0 #2 is very slow! + +[mgsvtpp.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[mgsvmgo.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 [MMRX.exe] BOX64_DYNAREC_STRONGMEM=1 -[RocketLeague.exe] +[MiSideFull.exe] +BOX64_DYNAREC_BIGBLOCK=2 +BOX64_DYNAREC_CALLRET=1 + +[NASCARHeat4.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_MAXCPU=8 +BOX64_DYNAREC_DIRTY=1 + +[ActivationUI.exe] BOX64_DYNAREC_SAFEFLAGS=2 BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=0 +BOX64_DYNAREC_DIRTY=0 + +[EAappInstaller.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_STRONGMEM=1 +#BOX64_DYNAREC_DIRTY=1 +#BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNACACHE=0 #it's a 1 time app, no cache needed + +[NeedForSpeedHeat.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_DIRTY=2 # this is like 50% faster than 1 +BOX64_DYNAREC_CALLRET=2 #1 will not work and 2 is 20% faster than 0 with dirty=2 + +[NeedForSpeedPayback.exe] +BOX64_DYNAREC_STRONGMEM=0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_SAFEFLAGS=2 +#BOX64_DYNAREC_DIRTY=1 +BOX64_DYNAREC_CALLRET=1 + +[NeedForSpeedUnbound.exe] +BOX64_DYNAREC_STRONGMEM=0 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +#BOX64_DYNAREC_DIRTY=1 + +[NMS.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_PAUSE=3 + +[RockstarService.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=1 +BOX64_DYNAREC_DIRTY=1 +BOX64_DYNAREC_BIGBLOCK=0 #smaller blocks to go faster on building/invalidating blocks +BOX64_DYNAREC_CALLRET=1 + +[SocialClubHelper.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_FASTNAN=0 +BOX64_DYNAREC_FASTROUND=0 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_DIRTY=1 + +[Launcher.exe] +#this is for Rockstar Launcher, but probably other launcher too... +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_DIRTY=1 + +[LauncherPatcher.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 + +[PlayGTAIV.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 + +[GTAIV.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_DIRTY=1 + +[PlayGTAV.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_DIRTY=2 + +[GTA5.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_DIRTY=2 + +[PlayRDR2.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_FASTNAN=0 +BOX64_DYNAREC_FASTROUND=0 + +[RDR2.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_DIRTY=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[Pinball FX3.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_STRONGMEM=1 + +[PlanetAlpha-Win64-Shipping.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_SHAEXT=0 #buggy openssl version in the game + +[Racer-Win64-Shipping.exe] +#Moto Racer 4 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_DIRTY=1 +BOX64_DYNAREC_CALLRET=1 [Risk of Rain 2.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[Risk of Rain 2.exe] +BOX64_ARCH=la64 +BOX64_DYNAREC_BIGBLOCK=3 +# BOX64_DYNAREC_CALLRET=1 # but why??? + +[RoboCop-Win64-Shipping.exe] +#Might need PROTON_HIDE_NVIDIA_GPU=1 in Steam if using NVidia GPU +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_SSE_FLUSHTO0=1 +BOX64_DYNAREC_FASTNAN=0 #needed to avoid freeze +BOX64_DYNAREC_FASTROUND=0 + +[RocketLeague.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_STRONGMEM=1 + +[SandFall-Win64-Shipping.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[SC2_x64.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_STRONGMEM=0 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_DIRTY=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_FORWARD=1024 + +[sekiro.exe] +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_BIGBLOCK=3 + +[ShooterGame.exe] +#This is ARK Survival Evolved (without BattleEye) +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[ShooterGame_BE.exe] +#This is ARK Survival Evolved (with BattleEye, use at your own risk) +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=2 + +[Starfield.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[steam.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_ARGS=-cef-disable-breakpad -cef-disable-d3d11 -cef-disable-delaypageload -cef-force-occlusion -cef-disable-sandbox -cef-disable-seccomp-sandbox -no-cef-sandbox -disable-winh264 -cef-disable-gpu -vgui -oldtraymenu -cef-single-process + +[steamwebhelper.exe] BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_FASTROUND=0 +BOX64_DYNAREC_PURGE=1 + +# Steam for LA64 +[steam.exe] +BOX64_ARCH=la64 +BOX64_PCLMULQDQ=0 # helps download speed +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_ARGS=-cef-disable-breakpad -cef-disable-d3d11 -cef-disable-delaypageload -cef-force-occlusion -cef-disable-sandbox -cef-disable-seccomp-sandbox -no-cef-sandbox -disable-winh264 -cef-disable-gpu -vgui -oldtraymenu -cef-single-process + +[steamwebhelper.exe] +BOX64_ARCH=la64 +BOX64_PCLMULQDQ=0 # helps download speed +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_FASTROUND=0 + +# Steam for RV64 +[steam.exe] +BOX64_ARCH=rv64 +BOX64_PCLMULQDQ=0 # helps download speed +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_ARGS=-cef-disable-breakpad -cef-disable-d3d11 -cef-disable-delaypageload -cef-force-occlusion -cef-disable-sandbox -cef-disable-seccomp-sandbox -no-cef-sandbox -disable-winh264 -cef-disable-gpu -vgui -oldtraymenu -cef-single-process + +[steamwebhelper.exe] +BOX64_ARCH=rv64 +BOX64_PCLMULQDQ=0 # helps download speed +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_FASTROUND=0 + +[starwarsjedifallenorder.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[StarCraft.exe] +BOX64_DYNAREC_SAFEFLAGS=2 + +[Subnautica.exe] +#BOX64_DYNAREC_BIGBLOCK=3 #tend to crash/freeze +BOX64_DYNAREC_CALLRET=1 [Sunblaze.exe] BOX64_DYNAREC_STRONGMEM=1 -[witcher3.exe] +[SwGame-Win64-Shipping.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=0 + +[SyberiaTWB.exe] +BOX64_DYNAREC_BIGBLOCK=1 +BOX64_DYNAREC_CALLRET=1 +BOX64_MAXCPU=8 + +[Talos2-Win64-Shipping.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +#BOX64_DYNAREC_FASTNAN=0 # Avoid a freeze at 80%; might be solved now + +[TESV.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[TheForest.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_DIRTY=1 +BOX64_MAXCPU=8 + +[The House of the Dead Remake.exe] +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_DIRTY=1 +BOX64_MAXCPU=8 + +[Three_Kingdoms.exe] +# Note that this game has random crash issues with Wine for me, use Proton! +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_STRONGMEM=0 +BOX64_DYNAREC_DIRTY=1 +BOX64_DYNAREC_SAFEFLAGS=0 + +[TouristTrophy.exe] BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 + +[Trials of Innocence.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=2 +BOX64_DYNAREC_DIRTY=0 + +[TT2.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 + +[TT3.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 + +[UEBS.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_SAFEFLAGS=0 + +[UnleashedRecomp.exe] +BOX64_DYNAREC_BIGBLOCK=2 +BOX64_DYNAREC_CALLRET=1 +BOX64_SSE_FLUSHTO0=1 +BOX64_DYNAREC_FASTROUND=2 + +[upc.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_DIV0=1 +#There is a race condition in newer upc.exe that makes it fail by default. +#Those 2 strange parameters are a workaround +BOX64_NODYNAREC=0x7a000000-0x7c000000 +BOX64_NODYNAREC_DELAY=1 + + +[UbisoftConnectInstaller.exe] +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_DIV0=1 + +[UplayWebCore.exe] +#not sure all this is needed tbh +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_DIV0=1 +BOX64_DYNAREC_FASTNAN=0 +BOX64_DYNAREC_FASTROUND=0 +BOX64_SSE_FLUSHTO0=1 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_PURGE=1 + +[UplayService.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_DIV0=1 + +[UbisoftConnect.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_BIGBLOCK=0 [Unturned.exe] BOX64_DYNAREC_SAFEFLAGS=2 -[YandareSimulator.exe] -BOX64_DYNAREC_STRONGMEM=2 +[Valkyria4_x64.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[VampireSurvivors.exe] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[vc_redist.x64.exe] +BOX64_DYNACACHE=0 BOX64_DYNAREC_SAFEFLAGS=2 BOX64_DYNAREC_BIGBLOCK=0 -BOX64_DYNAREC_CALLRET=0 -[GoatGame] +[vc_redist.x86.exe] +BOX64_DYNACACHE=0 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=0 + +[vcredist_x64.exe] +BOX64_DYNACACHE=0 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=0 + +[vcredist_x86.exe] +BOX64_DYNACACHE=0 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=0 + +[msiexec.exe] +BOX64_DYNACACHE=0 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=0 + +[Viewfinder.exe] +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_STRONGMEM=1 +#BOX64_DYNAREC_CALLRET=1 #nope +#BOX64_DYNAREC_BIGBLOCK=3 + +[witcher3.exe] +BOX64_DYNAREC_STRONGMEM=1 + +[xdelta3.exe] +BOX64_DYNAREC_SAFEFLAGS=2 + +[Wreckfest_x64.exe] +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_BIGBLOCK=3 + +[ZenlessZoneZero.exe] BOX64_DYNAREC_STRONGMEM=1 +BOX64_DYNAREC_SAFEFLAGS=2 +BOX64_DYNAREC_BIGBLOCK=0 + +[StarRail.exe] +BOX64_DYNAREC_SAFEFLAGS=2 + +# +# 32bits Linux process +# +[BorderlandsPreSequel] +BOX64_DYNAREC_SAFEFLAGS=1 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 + +[CaveShooter] +BOX64_DYNAREC_X87DOUBLE=1 + +[DefenseGrid2] +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=1 +BOX64_DYNAREC_X87DOUBLE=1 +BOX64_MAXCPU=8 + +[DefenseGrid2] +BOX64_ARCH=rv64 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=0 +BOX64_DYNAREC_X87DOUBLE=1 +BOX64_MAXCPU=8 + +[DefenseGrid2] +BOX64_ARCH=la64 +BOX64_DYNAREC_BIGBLOCK=3 +BOX64_DYNAREC_CALLRET=0 +BOX64_DYNAREC_X87DOUBLE=1 +BOX64_MAXCPU=8 + +[dontstarve] +# use emulated sdl2 +BOX64_EMULATED_LIBS=libSDL2-2.0.so.0 + +[dontstarve_steam] +# use emulated sdl2 +BOX64_EMULATED_LIBS=libSDL2-2.0.so.0 diff --git a/tests/misc/gclosure.c b/tests/misc/gclosure.c new file mode 100644 index 0000000..bdbc330 --- /dev/null +++ b/tests/misc/gclosure.c @@ -0,0 +1,69 @@ +// gcc gclosure.c -o gclosure `pkg-config --cflags --libs gobject-2.0` +#include + +typedef void (*MyCallback)(gint arg1, const gchar* arg2, gpointer user_data); + +void my_marshal(GClosure* closure, + GValue* return_value, + guint n_param_values, + const GValue* param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + g_return_if_fail(n_param_values == 3); + + MyCallback callback; + callback = (MyCallback)g_value_get_pointer(¶m_values[0]); + + if (!callback) + return; + + gint arg1 = g_value_get_int(¶m_values[1]); + const gchar* arg2 = g_value_get_string(¶m_values[2]); + + callback(arg1, arg2, closure->data); +} + +void example_callback(gint num, gchar* str, gpointer user_data) +{ + g_print("Callback called with: %d, '%s' (user_data: %p)\n", + num, str, user_data); +} + +int main() +{ + GClosure* closure = g_closure_new_simple(sizeof(GClosure), NULL); + g_print("Initial refcount: %d\n", closure->ref_count); + + g_closure_set_marshal(closure, my_marshal); + + gpointer user_data = (gpointer)0x3a5000; + closure->data = user_data; + + GValue params[3] = { G_VALUE_INIT, G_VALUE_INIT, G_VALUE_INIT }; + + g_value_init(¶ms[0], G_TYPE_POINTER); + g_value_set_pointer(¶ms[0], example_callback); + + g_value_init(¶ms[1], G_TYPE_INT); + g_value_set_int(¶ms[1], 42); + + g_value_init(¶ms[2], G_TYPE_STRING); + g_value_set_string(¶ms[2], "Hello GClosure"); + + GValue return_value = G_VALUE_INIT; + g_closure_invoke(closure, &return_value, 3, params, NULL); + + g_closure_ref(closure); + g_print("After ref, refcount: %d\n", closure->ref_count); + + g_closure_sink(closure); + g_print("After sinking, refcount: %d\n", closure->ref_count); + + g_closure_unref(closure); + g_value_unset(¶ms[0]); + g_value_unset(¶ms[1]); + g_value_unset(¶ms[2]); + + return 0; +} diff --git a/tests/misc/gclosure.txt b/tests/misc/gclosure.txt new file mode 100644 index 0000000..eebbacb --- /dev/null +++ b/tests/misc/gclosure.txt @@ -0,0 +1,4 @@ +Initial refcount: 1 +Callback called with: 42, 'Hello GClosure' (user_data: 0x3a5000) +After ref, refcount: 2 +After sinking, refcount: 1 diff --git a/tests/misc/gvariant.c b/tests/misc/gvariant.c new file mode 100644 index 0000000..870dfc0 --- /dev/null +++ b/tests/misc/gvariant.c @@ -0,0 +1,48 @@ +// gcc `pkg-config --cflags glib-2.0` `pkg-config --libs glib-2.0` -O1 gvariant.c -o gvariant +#include + +static void print(GVariant* variant) +{ + if (variant != NULL) { + gchar* str = g_variant_print(variant, TRUE); + g_print("%s\n", str); + g_free(str); + g_variant_unref(variant); + } else { + g_print("Failed to create GVariant\n"); + } +} + +static void func(const gchar* format, ...) +{ + GVariant* variant = NULL; + va_list ap; + va_start(ap, format); + variant = g_variant_new_va(format, NULL, &ap); + va_end(ap); + + print(variant); +} + +int main(int argc, char* argv[]) +{ + func("(bynqiuxthiiiiiiiiiiiiii)", FALSE, 'A', 3, 4, 5, 6, G_GINT64_CONSTANT(7), G_GUINT64_CONSTANT(8), 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23); + func("(bynqiuxthdiiiiiiiiidiii)", TRUE, 'A', 3, 4, 5, 6, G_GINT64_CONSTANT(7), G_GUINT64_CONSTANT(8), 9, 10.1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.2, 21, 22, 23); + func("(bdididxdidididididididi)", TRUE, 2.2, 3, 4.4, 5, 6.6, G_GINT64_CONSTANT(7), 8.8, 9, 10.1, 11, 12.12, 13, 14.14, 15, 16.16, 17, 18.18, 19, 20.2, 21, 22.22, 23); + func("(bdididxdididididiiiiiii)", TRUE, 2.2, 3, 4.4, 5, 6.6, G_GINT64_CONSTANT(7), 8.8, 9, 10.1, 11, 12.12, 13, 14.14, 15, 16.16, 17, 18, 19, 20, 21, 22, 23); + func("(biidiixdiiidiiidiiidiii)", TRUE, 2, 3, 4.4, 5, 6, G_GINT64_CONSTANT(7), 8.8, 9, 10, 11, 12.12, 13, 14, 15, 16.16, 17, 18, 19, 20.2, 21, 22, 23); + func("(ddddddddddddddddddddddd)", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.1, 11.11, 12.12, 13.13, 14.14, 15.15, 16.16, 17.17, 18.18, 19.19, 20.2, 21.21, 22.22, 23.23); + GVariant* variant = g_variant_new("(bynqiuxthiiiiiiiiiiiiii)", FALSE, 'A', 3, 4, 5, 6, G_GINT64_CONSTANT(7), G_GUINT64_CONSTANT(8), 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23); + print(variant); + variant = g_variant_new("(bynqiuxthdiiiiiiiiidiii)", TRUE, 'A', 3, 4, 5, 6, G_GINT64_CONSTANT(7), G_GUINT64_CONSTANT(8), 9, 10.1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.2, 21, 22, 23); + print(variant); + variant = g_variant_new("(bdididxdidididididididi)", TRUE, 2.2, 3, 4.4, 5, 6.6, G_GINT64_CONSTANT(7), 8.8, 9, 10.1, 11, 12.12, 13, 14.14, 15, 16.16, 17, 18.18, 19, 20.2, 21, 22.22, 23); + print(variant); + variant = g_variant_new("(bdididxdididididiiiiiii)", TRUE, 2.2, 3, 4.4, 5, 6.6, G_GINT64_CONSTANT(7), 8.8, 9, 10.1, 11, 12.12, 13, 14.14, 15, 16.16, 17, 18, 19, 20, 21, 22, 23); + print(variant); + variant = g_variant_new("(biidiixdiiidiiidiiidiii)", TRUE, 2, 3, 4.4, 5, 6, G_GINT64_CONSTANT(7), 8.8, 9, 10, 11, 12.12, 13, 14, 15, 16.16, 17, 18, 19, 20.2, 21, 22, 23); + print(variant); + variant = g_variant_new("(ddddddddddddddddddddddd)", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.1, 11.11, 12.12, 13.13, 14.14, 15.15, 16.16, 17.17, 18.18, 19.19, 20.2, 21.21, 22.22, 23.23); + print(variant); + return 0; +} diff --git a/tests/misc/gvariant.txt b/tests/misc/gvariant.txt new file mode 100644 index 0000000..686a125 --- /dev/null +++ b/tests/misc/gvariant.txt @@ -0,0 +1,12 @@ +(false, byte 0x41, int16 3, uint16 4, 5, uint32 6, int64 7, uint64 8, handle 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23) +(true, byte 0x41, int16 3, uint16 4, 5, uint32 6, int64 7, uint64 8, handle 9, 10.1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.199999999999999, 21, 22, 23) +(true, 2.2000000000000002, 3, 4.4000000000000004, 5, 6.5999999999999996, int64 7, 8.8000000000000007, 9, 10.1, 11, 12.119999999999999, 13, 14.140000000000001, 15, 16.16, 17, 18.18, 19, 20.199999999999999, 21, 22.219999999999999, 23) +(true, 2.2000000000000002, 3, 4.4000000000000004, 5, 6.5999999999999996, int64 7, 8.8000000000000007, 9, 10.1, 11, 12.119999999999999, 13, 14.140000000000001, 15, 16.16, 17, 18, 19, 20, 21, 22, 23) +(true, 2, 3, 4.4000000000000004, 5, 6, int64 7, 8.8000000000000007, 9, 10, 11, 12.119999999999999, 13, 14, 15, 16.16, 17, 18, 19, 20.199999999999999, 21, 22, 23) +(1.1000000000000001, 2.2000000000000002, 3.2999999999999998, 4.4000000000000004, 5.5, 6.5999999999999996, 7.7000000000000002, 8.8000000000000007, 9.9000000000000004, 10.1, 11.109999999999999, 12.119999999999999, 13.130000000000001, 14.140000000000001, 15.15, 16.16, 17.170000000000002, 18.18, 19.190000000000001, 20.199999999999999, 21.210000000000001, 22.219999999999999, 23.23) +(false, byte 0x41, int16 3, uint16 4, 5, uint32 6, int64 7, uint64 8, handle 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23) +(true, byte 0x41, int16 3, uint16 4, 5, uint32 6, int64 7, uint64 8, handle 9, 10.1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.199999999999999, 21, 22, 23) +(true, 2.2000000000000002, 3, 4.4000000000000004, 5, 6.5999999999999996, int64 7, 8.8000000000000007, 9, 10.1, 11, 12.119999999999999, 13, 14.140000000000001, 15, 16.16, 17, 18.18, 19, 20.199999999999999, 21, 22.219999999999999, 23) +(true, 2.2000000000000002, 3, 4.4000000000000004, 5, 6.5999999999999996, int64 7, 8.8000000000000007, 9, 10.1, 11, 12.119999999999999, 13, 14.140000000000001, 15, 16.16, 17, 18, 19, 20, 21, 22, 23) +(true, 2, 3, 4.4000000000000004, 5, 6, int64 7, 8.8000000000000007, 9, 10, 11, 12.119999999999999, 13, 14, 15, 16.16, 17, 18, 19, 20.199999999999999, 21, 22, 23) +(1.1000000000000001, 2.2000000000000002, 3.2999999999999998, 4.4000000000000004, 5.5, 6.5999999999999996, 7.7000000000000002, 8.8000000000000007, 9.9000000000000004, 10.1, 11.109999999999999, 12.119999999999999, 13.130000000000001, 14.140000000000001, 15.15, 16.16, 17.170000000000002, 18.18, 19.190000000000001, 20.199999999999999, 21.210000000000001, 22.219999999999999, 23.23) diff --git a/tests/ref16.txt b/tests/ref16.txt index 7fac500..90a64d4 100644 --- a/tests/ref16.txt +++ b/tests/ref16.txt @@ -1,24 +1,130 @@ +ucomiss 1.000000, 1.000000 => 0x242 ucomiss 1.000000, 2.000000 => 0x202 -ucomiss 2.000000, 1.000000 => 0x203 +ucomiss 1.000000, 0.000000 => 0x203 +ucomiss 1.000000, -0.000000 => 0x203 +ucomiss 1.000000, -1.000000 => 0x203 ucomiss 1.000000, inf => 0x202 -ucomiss inf, 1.000000 => 0x203 ucomiss 1.000000, -inf => 0x203 -ucomiss -inf, 1.000000 => 0x202 ucomiss 1.000000, nan => 0x247 -ucomiss nan, 1.000000 => 0x247 -ucomiss 1.000000, 1.000000 => 0x242 +ucomiss 2.000000, 1.000000 => 0x203 +ucomiss 2.000000, 2.000000 => 0x242 +ucomiss 2.000000, 0.000000 => 0x203 +ucomiss 2.000000, -0.000000 => 0x203 +ucomiss 2.000000, -1.000000 => 0x203 +ucomiss 2.000000, inf => 0x202 +ucomiss 2.000000, -inf => 0x203 +ucomiss 2.000000, nan => 0x247 +ucomiss 0.000000, 1.000000 => 0x202 +ucomiss 0.000000, 2.000000 => 0x202 +ucomiss 0.000000, 0.000000 => 0x242 +ucomiss 0.000000, -0.000000 => 0x242 +ucomiss 0.000000, -1.000000 => 0x203 +ucomiss 0.000000, inf => 0x202 +ucomiss 0.000000, -inf => 0x203 +ucomiss 0.000000, nan => 0x247 +ucomiss -0.000000, 1.000000 => 0x202 +ucomiss -0.000000, 2.000000 => 0x202 +ucomiss -0.000000, 0.000000 => 0x242 +ucomiss -0.000000, -0.000000 => 0x242 +ucomiss -0.000000, -1.000000 => 0x203 +ucomiss -0.000000, inf => 0x202 +ucomiss -0.000000, -inf => 0x203 +ucomiss -0.000000, nan => 0x247 +ucomiss -1.000000, 1.000000 => 0x202 +ucomiss -1.000000, 2.000000 => 0x202 +ucomiss -1.000000, 0.000000 => 0x202 +ucomiss -1.000000, -0.000000 => 0x202 +ucomiss -1.000000, -1.000000 => 0x242 +ucomiss -1.000000, inf => 0x202 +ucomiss -1.000000, -inf => 0x203 +ucomiss -1.000000, nan => 0x247 +ucomiss inf, 1.000000 => 0x203 +ucomiss inf, 2.000000 => 0x203 +ucomiss inf, 0.000000 => 0x203 +ucomiss inf, -0.000000 => 0x203 +ucomiss inf, -1.000000 => 0x203 ucomiss inf, inf => 0x242 +ucomiss inf, -inf => 0x203 +ucomiss inf, nan => 0x247 +ucomiss -inf, 1.000000 => 0x202 +ucomiss -inf, 2.000000 => 0x202 +ucomiss -inf, 0.000000 => 0x202 +ucomiss -inf, -0.000000 => 0x202 +ucomiss -inf, -1.000000 => 0x202 +ucomiss -inf, inf => 0x202 +ucomiss -inf, -inf => 0x242 +ucomiss -inf, nan => 0x247 +ucomiss nan, 1.000000 => 0x247 +ucomiss nan, 2.000000 => 0x247 +ucomiss nan, 0.000000 => 0x247 +ucomiss nan, -0.000000 => 0x247 +ucomiss nan, -1.000000 => 0x247 +ucomiss nan, inf => 0x247 +ucomiss nan, -inf => 0x247 ucomiss nan, nan => 0x247 +ucomisd 1.000000, 1.000000 => 0x242 ucomisd 1.000000, 2.000000 => 0x202 -ucomisd 2.000000, 1.000000 => 0x203 +ucomisd 1.000000, 0.000000 => 0x203 +ucomisd 1.000000, -0.000000 => 0x203 +ucomisd 1.000000, -1.000000 => 0x203 ucomisd 1.000000, inf => 0x202 -ucomisd inf, 1.000000 => 0x203 ucomisd 1.000000, -inf => 0x203 -ucomisd -inf, 1.000000 => 0x202 ucomisd 1.000000, nan => 0x247 -ucomisd nan, 1.000000 => 0x247 -ucomisd 1.000000, 1.000000 => 0x242 +ucomisd 2.000000, 1.000000 => 0x203 +ucomisd 2.000000, 2.000000 => 0x242 +ucomisd 2.000000, 0.000000 => 0x203 +ucomisd 2.000000, -0.000000 => 0x203 +ucomisd 2.000000, -1.000000 => 0x203 +ucomisd 2.000000, inf => 0x202 +ucomisd 2.000000, -inf => 0x203 +ucomisd 2.000000, nan => 0x247 +ucomisd 0.000000, 1.000000 => 0x202 +ucomisd 0.000000, 2.000000 => 0x202 +ucomisd 0.000000, 0.000000 => 0x242 +ucomisd 0.000000, -0.000000 => 0x242 +ucomisd 0.000000, -1.000000 => 0x203 +ucomisd 0.000000, inf => 0x202 +ucomisd 0.000000, -inf => 0x203 +ucomisd 0.000000, nan => 0x247 +ucomisd -0.000000, 1.000000 => 0x202 +ucomisd -0.000000, 2.000000 => 0x202 +ucomisd -0.000000, 0.000000 => 0x242 +ucomisd -0.000000, -0.000000 => 0x242 +ucomisd -0.000000, -1.000000 => 0x203 +ucomisd -0.000000, inf => 0x202 +ucomisd -0.000000, -inf => 0x203 +ucomisd -0.000000, nan => 0x247 +ucomisd -1.000000, 1.000000 => 0x202 +ucomisd -1.000000, 2.000000 => 0x202 +ucomisd -1.000000, 0.000000 => 0x202 +ucomisd -1.000000, -0.000000 => 0x202 +ucomisd -1.000000, -1.000000 => 0x242 +ucomisd -1.000000, inf => 0x202 +ucomisd -1.000000, -inf => 0x203 +ucomisd -1.000000, nan => 0x247 +ucomisd inf, 1.000000 => 0x203 +ucomisd inf, 2.000000 => 0x203 +ucomisd inf, 0.000000 => 0x203 +ucomisd inf, -0.000000 => 0x203 +ucomisd inf, -1.000000 => 0x203 ucomisd inf, inf => 0x242 +ucomisd inf, -inf => 0x203 +ucomisd inf, nan => 0x247 +ucomisd -inf, 1.000000 => 0x202 +ucomisd -inf, 2.000000 => 0x202 +ucomisd -inf, 0.000000 => 0x202 +ucomisd -inf, -0.000000 => 0x202 +ucomisd -inf, -1.000000 => 0x202 +ucomisd -inf, inf => 0x202 +ucomisd -inf, -inf => 0x242 +ucomisd -inf, nan => 0x247 +ucomisd nan, 1.000000 => 0x247 +ucomisd nan, 2.000000 => 0x247 +ucomisd nan, 0.000000 => 0x247 +ucomisd nan, -0.000000 => 0x247 +ucomisd nan, -1.000000 => 0x247 +ucomisd nan, inf => 0x247 +ucomisd nan, -inf => 0x247 ucomisd nan, nan => 0x247 cmpsd 1.000000, 2.000000, 0 => 0x0 cmpsd 2.000000, 1.000000, 0 => 0x0 diff --git a/tests/ref17.txt b/tests/ref17.txt index 35f59cd..76bf677 100644 --- a/tests/ref17.txt +++ b/tests/ref17.txt @@ -4,14 +4,14 @@ ucomiss 1.000000, inf => 0x203 ucomiss inf, 1.000000 => 0x202 ucomiss 1.000000, -inf => 0x202 ucomiss -inf, 1.000000 => 0x203 -ucomiss 1.000000, nan => 0x203 -ucomiss nan, 1.000000 => 0x203 +ucomiss 1.000000, nan => 0x247 +ucomiss nan, 1.000000 => 0x247 ucomiss 1.000000, 1.000000 => 0x242 ucomiss 1.000000, 1.000000 => 0x242 ucomiss inf, inf => 0x242 ucomiss -inf, inf => 0x203 ucomiss inf, -inf => 0x202 -ucomiss nan, nan => 0x203 +ucomiss nan, nan => 0x247 minss 1, 2 => 1 minss 2, 1 => 1 minss -inf, 2 => -inf @@ -161,7 +161,9 @@ phsubw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff psignb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x80 0x7f 0x0 0x1 0xfe 0xfd 0x0 0xfe 0x84 0x8e 0x52 0xa5 0x0 0xc0 0x32 psignw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x1 0x8000 0x8001 0x0 0x1 0xfffe 0xfffd 0x7fff psignd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x80000000 0x7fffffff 0x0 +pmulhrsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x8000 0x7ffe 0x0 0x0 0x0 0x0 0x7ffe pmulhrsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x1 0x8001 0xffff 0x0 0x0 0xfffe 0x0 0x7ffe +pmulhrsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x7ffe 0x0 0x0 0x0 0x6200 0x0 0x7ffe pblendvps(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0xffffffff 0x80000000 0x5 0x0 ptestz(0x80000000ffffffff 0x7fffffff , 0x8000000000000001 0xfffffffe00000005 ) = 0 ptestc(0x80000000ffffffff 0x7fffffff , 0x8000000000000001 0xfffffffe00000005 ) = 0 diff --git a/tests/ref21.txt b/tests/ref21.txt index 38e983c..83d3aec 100644 --- a/tests/ref21.txt +++ b/tests/ref21.txt @@ -1,2 +1,10 @@ sig = 11 got bad_ptr +sig = 5 +si_addr: 0, si_code: 128, si_errno: 0 RIP offset: 1 TRAPERR=0 TRAPNO=3 +sig = 5 +si_addr: 0, si_code: 128, si_errno: 0 RIP offset: 2 TRAPERR=0 TRAPNO=3 +sig = 11 +si_addr: 0, si_code: 128, si_errno: 0 RIP offset: 0 TRAPERR=362 TRAPNO=13 +sig = 11 +si_addr: 0, si_code: 1, si_errno: 0 RIP=NULL TRAPERR=20 TRAPNO=14 diff --git a/tests/ref21_alt.txt b/tests/ref21_alt.txt new file mode 100644 index 0000000..14aada6 --- /dev/null +++ b/tests/ref21_alt.txt @@ -0,0 +1,50 @@ +sig = 11 +got bad_ptr +sig = 5 +si_addr: 0, si_code: 128, si_errno: 0, RIP offset: 1, TRAPERR=0x0 TRAPNO=3 +sig = 5 +si_addr: 0, si_code: 128, si_errno: 0, RIP offset: 2, TRAPERR=0x0 TRAPNO=3 +sig = 11 +si_addr: 0, si_code: 128, si_errno: 0, RIP offset: 0, TRAPERR=0x16a TRAPNO=13 +from non-existant memory +sig = 11 +si_addr: ffffffffdeadbeef, si_code: 1, si_errno: 0, TRAPERR=0x7 TRAPNO=14 +segfault, good +sig = 11 +si_addr: ffffffffdeadbeef, si_code: 1, si_errno: 0, TRAPERR=0x5 TRAPNO=14 +segfault, good +sig = 11 +si_addr: ffffffffdeadbeef, si_code: 1, si_errno: 0, TRAPERR=0x15 TRAPNO=14 +segfault, good +from NULL memory +sig = 11 +si_addr: 0, si_code: 1, si_errno: 0, TRAPERR=0x6 TRAPNO=14 +segfault, good +sig = 11 +si_addr: 0, si_code: 1, si_errno: 0, TRAPERR=0x4 TRAPNO=14 +segfault, good +sig = 11 +si_addr: 0, si_code: 1, si_errno: 0, TRAPERR=0x14 TRAPNO=14 +segfault, good +from existant memory +exec_p prot = 0 +sig = 11 +si_addr: exec_p+0, si_code: 2, si_errno: 0, TRAPERR=0x6 TRAPNO=14 +segfault, good +sig = 11 +si_addr: exec_p+0, si_code: 2, si_errno: 0, TRAPERR=0x4 TRAPNO=14 +segfault, good +exec_p prot = PROT_READ +sig = 11 +si_addr: exec_p+0, si_code: 2, si_errno: 0, TRAPERR=0x7 TRAPNO=14 +segfault, good +exec_p prot = PROT_READ|PROT_WRITE +sig = 11 +si_addr: exec_p+0, si_code: 2, si_errno: 0, RIP offset: 0, TRAPERR=0x15 TRAPNO=14 +Cannot run, good +exec_p prot = PROT_READ|PROT_WRITE|PROT_EXEC +exec_p prot = PROT_READ|PROT_WRITE +sig = 11 +si_addr: exec_p+0, si_code: 2, si_errno: 0, RIP offset: 0, TRAPERR=0x15 TRAPNO=14 +Cannot run, good! +exec_p prot = PROT_READ|PROT_WRITE|PROT_EXEC diff --git a/tests/ref22.txt b/tests/ref22.txt index 9538e7a..15300d7 100644 --- a/tests/ref22.txt +++ b/tests/ref22.txt @@ -1,1224 +1,898 @@ +FUCOMI 0x0 0x0 Z-- +FUCOMPP 0x0 0x0 Z-- FUCOMI 0x0 0x4082c00000000000 --C FUCOMPP 0x0 0x4082c00000000000 --C -Rounding 0 - FRNDINT 0x0 => 0x0 - FRNDINT 0x4082c00000000000 => 0x4082c00000000000 - FISTP 0x0 => word: 0 - FISTP 0x4082c00000000000 => word: 258 - FISTP 0x0 => long: 0 - FISTP 0x4082c00000000000 => long: 258 - FISTP 0x0 => quad: 0 - FISTP 0x4082c00000000000 => quad: 258 - FISTTP 0x0 => word: 0 - FISTTP 0x4082c00000000000 => word: 258 - FISTTP 0x0 => long: 0 - FISTTP 0x4082c00000000000 => long: 258 - FISTTP 0x0 => quad: 0 - FISTTP 0x4082c00000000000 => quad: 258 -Rounding 1 - FRNDINT 0x0 => 0x0 - FRNDINT 0x4082c00000000000 => 0x4082c00000000000 - FISTP 0x0 => word: 0 - FISTP 0x4082c00000000000 => word: 258 - FISTP 0x0 => long: 0 - FISTP 0x4082c00000000000 => long: 258 - FISTP 0x0 => quad: 0 - FISTP 0x4082c00000000000 => quad: 258 - FISTTP 0x0 => word: 0 - FISTTP 0x4082c00000000000 => word: 258 - FISTTP 0x0 => long: 0 - FISTTP 0x4082c00000000000 => long: 258 - FISTTP 0x0 => quad: 0 - FISTTP 0x4082c00000000000 => quad: 258 -Rounding 2 - FRNDINT 0x0 => 0x0 - FRNDINT 0x4082c00000000000 => 0x4082c00000000000 - FISTP 0x0 => word: 0 - FISTP 0x4082c00000000000 => word: 258 - FISTP 0x0 => long: 0 - FISTP 0x4082c00000000000 => long: 258 - FISTP 0x0 => quad: 0 - FISTP 0x4082c00000000000 => quad: 258 - FISTTP 0x0 => word: 0 - FISTTP 0x4082c00000000000 => word: 258 - FISTTP 0x0 => long: 0 - FISTTP 0x4082c00000000000 => long: 258 - FISTTP 0x0 => quad: 0 - FISTTP 0x4082c00000000000 => quad: 258 +FUCOMI 0x0 0x8000000000000000 Z-- +FUCOMPP 0x0 0x8000000000000000 Z-- +FUCOMI 0x0 0x40dfffc000000000 --C +FUCOMPP 0x0 0x40dfffc000000000 --C +FUCOMI 0x0 0x40e0002000000000 --C +FUCOMPP 0x0 0x40e0002000000000 --C +FUCOMI 0x0 0xc0e0002000000000 --- +FUCOMPP 0x0 0xc0e0002000000000 --- +FUCOMI 0x0 0xc0dfffc000000000 --- +FUCOMPP 0x0 0xc0dfffc000000000 --- +FUCOMI 0x0 0x3ff0000000000000 --C +FUCOMPP 0x0 0x3ff0000000000000 --C +FUCOMI 0x0 0x3fe89d9000000000 --C +FUCOMPP 0x0 0x3fe89d9000000000 --C +FUCOMI 0x0 0x7ff0000000000000 --C +FUCOMPP 0x0 0x7ff0000000000000 --C +FUCOMI 0x0 0xfff0000000000000 --- +FUCOMPP 0x0 0xfff0000000000000 --- +FUCOMI 0x0 0x3ff0002ca0000000 --C +FUCOMPP 0x0 0x3ff0002ca0000000 --C +FUCOMI 0x0 0xaeff000025000000 --- +FUCOMPP 0x0 0xaeff000025000000 --- +FUCOMI 0x0 0x3ff0000050000000 --C +FUCOMPP 0x0 0x3ff0000050000000 --C +FUCOMI 0x0 0xc082c00000000000 --- +FUCOMPP 0x0 0xc082c00000000000 --- +FUCOMI 0x0 0x7ff8000000000001 ZPC +FUCOMPP 0x0 0x7ff8000000000001 ZPC FUCOMI 0x4082c00000000000 0x0 --- FUCOMPP 0x4082c00000000000 0x0 --- +FUCOMI 0x4082c00000000000 0x4082c00000000000 Z-- +FUCOMPP 0x4082c00000000000 0x4082c00000000000 Z-- +FUCOMI 0x4082c00000000000 0x8000000000000000 --- +FUCOMPP 0x4082c00000000000 0x8000000000000000 --- +FUCOMI 0x4082c00000000000 0x40dfffc000000000 --C +FUCOMPP 0x4082c00000000000 0x40dfffc000000000 --C +FUCOMI 0x4082c00000000000 0x40e0002000000000 --C +FUCOMPP 0x4082c00000000000 0x40e0002000000000 --C +FUCOMI 0x4082c00000000000 0xc0e0002000000000 --- +FUCOMPP 0x4082c00000000000 0xc0e0002000000000 --- +FUCOMI 0x4082c00000000000 0xc0dfffc000000000 --- +FUCOMPP 0x4082c00000000000 0xc0dfffc000000000 --- +FUCOMI 0x4082c00000000000 0x3ff0000000000000 --- +FUCOMPP 0x4082c00000000000 0x3ff0000000000000 --- +FUCOMI 0x4082c00000000000 0x3fe89d9000000000 --- +FUCOMPP 0x4082c00000000000 0x3fe89d9000000000 --- +FUCOMI 0x4082c00000000000 0x7ff0000000000000 --C +FUCOMPP 0x4082c00000000000 0x7ff0000000000000 --C +FUCOMI 0x4082c00000000000 0xfff0000000000000 --- +FUCOMPP 0x4082c00000000000 0xfff0000000000000 --- +FUCOMI 0x4082c00000000000 0x3ff0002ca0000000 --- +FUCOMPP 0x4082c00000000000 0x3ff0002ca0000000 --- +FUCOMI 0x4082c00000000000 0xaeff000025000000 --- +FUCOMPP 0x4082c00000000000 0xaeff000025000000 --- +FUCOMI 0x4082c00000000000 0x3ff0000050000000 --- +FUCOMPP 0x4082c00000000000 0x3ff0000050000000 --- +FUCOMI 0x4082c00000000000 0xc082c00000000000 --- +FUCOMPP 0x4082c00000000000 0xc082c00000000000 --- +FUCOMI 0x4082c00000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x4082c00000000000 0x7ff8000000000001 ZPC +FUCOMI 0x8000000000000000 0x0 Z-- +FUCOMPP 0x8000000000000000 0x0 Z-- +FUCOMI 0x8000000000000000 0x4082c00000000000 --C +FUCOMPP 0x8000000000000000 0x4082c00000000000 --C +FUCOMI 0x8000000000000000 0x8000000000000000 Z-- +FUCOMPP 0x8000000000000000 0x8000000000000000 Z-- +FUCOMI 0x8000000000000000 0x40dfffc000000000 --C +FUCOMPP 0x8000000000000000 0x40dfffc000000000 --C +FUCOMI 0x8000000000000000 0x40e0002000000000 --C +FUCOMPP 0x8000000000000000 0x40e0002000000000 --C +FUCOMI 0x8000000000000000 0xc0e0002000000000 --- +FUCOMPP 0x8000000000000000 0xc0e0002000000000 --- +FUCOMI 0x8000000000000000 0xc0dfffc000000000 --- +FUCOMPP 0x8000000000000000 0xc0dfffc000000000 --- +FUCOMI 0x8000000000000000 0x3ff0000000000000 --C +FUCOMPP 0x8000000000000000 0x3ff0000000000000 --C +FUCOMI 0x8000000000000000 0x3fe89d9000000000 --C +FUCOMPP 0x8000000000000000 0x3fe89d9000000000 --C +FUCOMI 0x8000000000000000 0x7ff0000000000000 --C +FUCOMPP 0x8000000000000000 0x7ff0000000000000 --C +FUCOMI 0x8000000000000000 0xfff0000000000000 --- +FUCOMPP 0x8000000000000000 0xfff0000000000000 --- +FUCOMI 0x8000000000000000 0x3ff0002ca0000000 --C +FUCOMPP 0x8000000000000000 0x3ff0002ca0000000 --C +FUCOMI 0x8000000000000000 0xaeff000025000000 --- +FUCOMPP 0x8000000000000000 0xaeff000025000000 --- +FUCOMI 0x8000000000000000 0x3ff0000050000000 --C +FUCOMPP 0x8000000000000000 0x3ff0000050000000 --C +FUCOMI 0x8000000000000000 0xc082c00000000000 --- +FUCOMPP 0x8000000000000000 0xc082c00000000000 --- +FUCOMI 0x8000000000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x8000000000000000 0x7ff8000000000001 ZPC +FUCOMI 0x40dfffc000000000 0x0 --- +FUCOMPP 0x40dfffc000000000 0x0 --- +FUCOMI 0x40dfffc000000000 0x4082c00000000000 --- +FUCOMPP 0x40dfffc000000000 0x4082c00000000000 --- +FUCOMI 0x40dfffc000000000 0x8000000000000000 --- +FUCOMPP 0x40dfffc000000000 0x8000000000000000 --- +FUCOMI 0x40dfffc000000000 0x40dfffc000000000 Z-- +FUCOMPP 0x40dfffc000000000 0x40dfffc000000000 Z-- +FUCOMI 0x40dfffc000000000 0x40e0002000000000 --C +FUCOMPP 0x40dfffc000000000 0x40e0002000000000 --C +FUCOMI 0x40dfffc000000000 0xc0e0002000000000 --- +FUCOMPP 0x40dfffc000000000 0xc0e0002000000000 --- +FUCOMI 0x40dfffc000000000 0xc0dfffc000000000 --- +FUCOMPP 0x40dfffc000000000 0xc0dfffc000000000 --- +FUCOMI 0x40dfffc000000000 0x3ff0000000000000 --- +FUCOMPP 0x40dfffc000000000 0x3ff0000000000000 --- +FUCOMI 0x40dfffc000000000 0x3fe89d9000000000 --- +FUCOMPP 0x40dfffc000000000 0x3fe89d9000000000 --- +FUCOMI 0x40dfffc000000000 0x7ff0000000000000 --C +FUCOMPP 0x40dfffc000000000 0x7ff0000000000000 --C +FUCOMI 0x40dfffc000000000 0xfff0000000000000 --- +FUCOMPP 0x40dfffc000000000 0xfff0000000000000 --- +FUCOMI 0x40dfffc000000000 0x3ff0002ca0000000 --- +FUCOMPP 0x40dfffc000000000 0x3ff0002ca0000000 --- +FUCOMI 0x40dfffc000000000 0xaeff000025000000 --- +FUCOMPP 0x40dfffc000000000 0xaeff000025000000 --- +FUCOMI 0x40dfffc000000000 0x3ff0000050000000 --- +FUCOMPP 0x40dfffc000000000 0x3ff0000050000000 --- +FUCOMI 0x40dfffc000000000 0xc082c00000000000 --- +FUCOMPP 0x40dfffc000000000 0xc082c00000000000 --- +FUCOMI 0x40dfffc000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x40dfffc000000000 0x7ff8000000000001 ZPC +FUCOMI 0x40e0002000000000 0x0 --- +FUCOMPP 0x40e0002000000000 0x0 --- +FUCOMI 0x40e0002000000000 0x4082c00000000000 --- +FUCOMPP 0x40e0002000000000 0x4082c00000000000 --- +FUCOMI 0x40e0002000000000 0x8000000000000000 --- +FUCOMPP 0x40e0002000000000 0x8000000000000000 --- +FUCOMI 0x40e0002000000000 0x40dfffc000000000 --- +FUCOMPP 0x40e0002000000000 0x40dfffc000000000 --- +FUCOMI 0x40e0002000000000 0x40e0002000000000 Z-- +FUCOMPP 0x40e0002000000000 0x40e0002000000000 Z-- +FUCOMI 0x40e0002000000000 0xc0e0002000000000 --- +FUCOMPP 0x40e0002000000000 0xc0e0002000000000 --- +FUCOMI 0x40e0002000000000 0xc0dfffc000000000 --- +FUCOMPP 0x40e0002000000000 0xc0dfffc000000000 --- +FUCOMI 0x40e0002000000000 0x3ff0000000000000 --- +FUCOMPP 0x40e0002000000000 0x3ff0000000000000 --- +FUCOMI 0x40e0002000000000 0x3fe89d9000000000 --- +FUCOMPP 0x40e0002000000000 0x3fe89d9000000000 --- +FUCOMI 0x40e0002000000000 0x7ff0000000000000 --C +FUCOMPP 0x40e0002000000000 0x7ff0000000000000 --C +FUCOMI 0x40e0002000000000 0xfff0000000000000 --- +FUCOMPP 0x40e0002000000000 0xfff0000000000000 --- +FUCOMI 0x40e0002000000000 0x3ff0002ca0000000 --- +FUCOMPP 0x40e0002000000000 0x3ff0002ca0000000 --- +FUCOMI 0x40e0002000000000 0xaeff000025000000 --- +FUCOMPP 0x40e0002000000000 0xaeff000025000000 --- +FUCOMI 0x40e0002000000000 0x3ff0000050000000 --- +FUCOMPP 0x40e0002000000000 0x3ff0000050000000 --- +FUCOMI 0x40e0002000000000 0xc082c00000000000 --- +FUCOMPP 0x40e0002000000000 0xc082c00000000000 --- +FUCOMI 0x40e0002000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x40e0002000000000 0x7ff8000000000001 ZPC +FUCOMI 0xc0e0002000000000 0x0 --C +FUCOMPP 0xc0e0002000000000 0x0 --C +FUCOMI 0xc0e0002000000000 0x4082c00000000000 --C +FUCOMPP 0xc0e0002000000000 0x4082c00000000000 --C +FUCOMI 0xc0e0002000000000 0x8000000000000000 --C +FUCOMPP 0xc0e0002000000000 0x8000000000000000 --C +FUCOMI 0xc0e0002000000000 0x40dfffc000000000 --C +FUCOMPP 0xc0e0002000000000 0x40dfffc000000000 --C +FUCOMI 0xc0e0002000000000 0x40e0002000000000 --C +FUCOMPP 0xc0e0002000000000 0x40e0002000000000 --C +FUCOMI 0xc0e0002000000000 0xc0e0002000000000 Z-- +FUCOMPP 0xc0e0002000000000 0xc0e0002000000000 Z-- +FUCOMI 0xc0e0002000000000 0xc0dfffc000000000 --C +FUCOMPP 0xc0e0002000000000 0xc0dfffc000000000 --C +FUCOMI 0xc0e0002000000000 0x3ff0000000000000 --C +FUCOMPP 0xc0e0002000000000 0x3ff0000000000000 --C +FUCOMI 0xc0e0002000000000 0x3fe89d9000000000 --C +FUCOMPP 0xc0e0002000000000 0x3fe89d9000000000 --C +FUCOMI 0xc0e0002000000000 0x7ff0000000000000 --C +FUCOMPP 0xc0e0002000000000 0x7ff0000000000000 --C +FUCOMI 0xc0e0002000000000 0xfff0000000000000 --- +FUCOMPP 0xc0e0002000000000 0xfff0000000000000 --- +FUCOMI 0xc0e0002000000000 0x3ff0002ca0000000 --C +FUCOMPP 0xc0e0002000000000 0x3ff0002ca0000000 --C +FUCOMI 0xc0e0002000000000 0xaeff000025000000 --C +FUCOMPP 0xc0e0002000000000 0xaeff000025000000 --C +FUCOMI 0xc0e0002000000000 0x3ff0000050000000 --C +FUCOMPP 0xc0e0002000000000 0x3ff0000050000000 --C +FUCOMI 0xc0e0002000000000 0xc082c00000000000 --C +FUCOMPP 0xc0e0002000000000 0xc082c00000000000 --C +FUCOMI 0xc0e0002000000000 0x7ff8000000000001 ZPC +FUCOMPP 0xc0e0002000000000 0x7ff8000000000001 ZPC +FUCOMI 0xc0dfffc000000000 0x0 --C +FUCOMPP 0xc0dfffc000000000 0x0 --C +FUCOMI 0xc0dfffc000000000 0x4082c00000000000 --C +FUCOMPP 0xc0dfffc000000000 0x4082c00000000000 --C +FUCOMI 0xc0dfffc000000000 0x8000000000000000 --C +FUCOMPP 0xc0dfffc000000000 0x8000000000000000 --C +FUCOMI 0xc0dfffc000000000 0x40dfffc000000000 --C +FUCOMPP 0xc0dfffc000000000 0x40dfffc000000000 --C +FUCOMI 0xc0dfffc000000000 0x40e0002000000000 --C +FUCOMPP 0xc0dfffc000000000 0x40e0002000000000 --C +FUCOMI 0xc0dfffc000000000 0xc0e0002000000000 --- +FUCOMPP 0xc0dfffc000000000 0xc0e0002000000000 --- +FUCOMI 0xc0dfffc000000000 0xc0dfffc000000000 Z-- +FUCOMPP 0xc0dfffc000000000 0xc0dfffc000000000 Z-- +FUCOMI 0xc0dfffc000000000 0x3ff0000000000000 --C +FUCOMPP 0xc0dfffc000000000 0x3ff0000000000000 --C +FUCOMI 0xc0dfffc000000000 0x3fe89d9000000000 --C +FUCOMPP 0xc0dfffc000000000 0x3fe89d9000000000 --C +FUCOMI 0xc0dfffc000000000 0x7ff0000000000000 --C +FUCOMPP 0xc0dfffc000000000 0x7ff0000000000000 --C +FUCOMI 0xc0dfffc000000000 0xfff0000000000000 --- +FUCOMPP 0xc0dfffc000000000 0xfff0000000000000 --- +FUCOMI 0xc0dfffc000000000 0x3ff0002ca0000000 --C +FUCOMPP 0xc0dfffc000000000 0x3ff0002ca0000000 --C +FUCOMI 0xc0dfffc000000000 0xaeff000025000000 --C +FUCOMPP 0xc0dfffc000000000 0xaeff000025000000 --C +FUCOMI 0xc0dfffc000000000 0x3ff0000050000000 --C +FUCOMPP 0xc0dfffc000000000 0x3ff0000050000000 --C +FUCOMI 0xc0dfffc000000000 0xc082c00000000000 --C +FUCOMPP 0xc0dfffc000000000 0xc082c00000000000 --C +FUCOMI 0xc0dfffc000000000 0x7ff8000000000001 ZPC +FUCOMPP 0xc0dfffc000000000 0x7ff8000000000001 ZPC +FUCOMI 0x3ff0000000000000 0x0 --- +FUCOMPP 0x3ff0000000000000 0x0 --- +FUCOMI 0x3ff0000000000000 0x4082c00000000000 --C +FUCOMPP 0x3ff0000000000000 0x4082c00000000000 --C +FUCOMI 0x3ff0000000000000 0x8000000000000000 --- +FUCOMPP 0x3ff0000000000000 0x8000000000000000 --- +FUCOMI 0x3ff0000000000000 0x40dfffc000000000 --C +FUCOMPP 0x3ff0000000000000 0x40dfffc000000000 --C +FUCOMI 0x3ff0000000000000 0x40e0002000000000 --C +FUCOMPP 0x3ff0000000000000 0x40e0002000000000 --C +FUCOMI 0x3ff0000000000000 0xc0e0002000000000 --- +FUCOMPP 0x3ff0000000000000 0xc0e0002000000000 --- +FUCOMI 0x3ff0000000000000 0xc0dfffc000000000 --- +FUCOMPP 0x3ff0000000000000 0xc0dfffc000000000 --- +FUCOMI 0x3ff0000000000000 0x3ff0000000000000 Z-- +FUCOMPP 0x3ff0000000000000 0x3ff0000000000000 Z-- +FUCOMI 0x3ff0000000000000 0x3fe89d9000000000 --- +FUCOMPP 0x3ff0000000000000 0x3fe89d9000000000 --- +FUCOMI 0x3ff0000000000000 0x7ff0000000000000 --C +FUCOMPP 0x3ff0000000000000 0x7ff0000000000000 --C +FUCOMI 0x3ff0000000000000 0xfff0000000000000 --- +FUCOMPP 0x3ff0000000000000 0xfff0000000000000 --- +FUCOMI 0x3ff0000000000000 0x3ff0002ca0000000 --C +FUCOMPP 0x3ff0000000000000 0x3ff0002ca0000000 --C +FUCOMI 0x3ff0000000000000 0xaeff000025000000 --- +FUCOMPP 0x3ff0000000000000 0xaeff000025000000 --- +FUCOMI 0x3ff0000000000000 0x3ff0000050000000 --C +FUCOMPP 0x3ff0000000000000 0x3ff0000050000000 --C +FUCOMI 0x3ff0000000000000 0xc082c00000000000 --- +FUCOMPP 0x3ff0000000000000 0xc082c00000000000 --- +FUCOMI 0x3ff0000000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x3ff0000000000000 0x7ff8000000000001 ZPC +FUCOMI 0x3fe89d9000000000 0x0 --- +FUCOMPP 0x3fe89d9000000000 0x0 --- +FUCOMI 0x3fe89d9000000000 0x4082c00000000000 --C +FUCOMPP 0x3fe89d9000000000 0x4082c00000000000 --C +FUCOMI 0x3fe89d9000000000 0x8000000000000000 --- +FUCOMPP 0x3fe89d9000000000 0x8000000000000000 --- +FUCOMI 0x3fe89d9000000000 0x40dfffc000000000 --C +FUCOMPP 0x3fe89d9000000000 0x40dfffc000000000 --C +FUCOMI 0x3fe89d9000000000 0x40e0002000000000 --C +FUCOMPP 0x3fe89d9000000000 0x40e0002000000000 --C +FUCOMI 0x3fe89d9000000000 0xc0e0002000000000 --- +FUCOMPP 0x3fe89d9000000000 0xc0e0002000000000 --- +FUCOMI 0x3fe89d9000000000 0xc0dfffc000000000 --- +FUCOMPP 0x3fe89d9000000000 0xc0dfffc000000000 --- +FUCOMI 0x3fe89d9000000000 0x3ff0000000000000 --C +FUCOMPP 0x3fe89d9000000000 0x3ff0000000000000 --C +FUCOMI 0x3fe89d9000000000 0x3fe89d9000000000 Z-- +FUCOMPP 0x3fe89d9000000000 0x3fe89d9000000000 Z-- +FUCOMI 0x3fe89d9000000000 0x7ff0000000000000 --C +FUCOMPP 0x3fe89d9000000000 0x7ff0000000000000 --C +FUCOMI 0x3fe89d9000000000 0xfff0000000000000 --- +FUCOMPP 0x3fe89d9000000000 0xfff0000000000000 --- +FUCOMI 0x3fe89d9000000000 0x3ff0002ca0000000 --C +FUCOMPP 0x3fe89d9000000000 0x3ff0002ca0000000 --C +FUCOMI 0x3fe89d9000000000 0xaeff000025000000 --- +FUCOMPP 0x3fe89d9000000000 0xaeff000025000000 --- +FUCOMI 0x3fe89d9000000000 0x3ff0000050000000 --C +FUCOMPP 0x3fe89d9000000000 0x3ff0000050000000 --C +FUCOMI 0x3fe89d9000000000 0xc082c00000000000 --- +FUCOMPP 0x3fe89d9000000000 0xc082c00000000000 --- +FUCOMI 0x3fe89d9000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x3fe89d9000000000 0x7ff8000000000001 ZPC +FUCOMI 0x7ff0000000000000 0x0 --- +FUCOMPP 0x7ff0000000000000 0x0 --- +FUCOMI 0x7ff0000000000000 0x4082c00000000000 --- +FUCOMPP 0x7ff0000000000000 0x4082c00000000000 --- +FUCOMI 0x7ff0000000000000 0x8000000000000000 --- +FUCOMPP 0x7ff0000000000000 0x8000000000000000 --- +FUCOMI 0x7ff0000000000000 0x40dfffc000000000 --- +FUCOMPP 0x7ff0000000000000 0x40dfffc000000000 --- +FUCOMI 0x7ff0000000000000 0x40e0002000000000 --- +FUCOMPP 0x7ff0000000000000 0x40e0002000000000 --- +FUCOMI 0x7ff0000000000000 0xc0e0002000000000 --- +FUCOMPP 0x7ff0000000000000 0xc0e0002000000000 --- +FUCOMI 0x7ff0000000000000 0xc0dfffc000000000 --- +FUCOMPP 0x7ff0000000000000 0xc0dfffc000000000 --- +FUCOMI 0x7ff0000000000000 0x3ff0000000000000 --- +FUCOMPP 0x7ff0000000000000 0x3ff0000000000000 --- +FUCOMI 0x7ff0000000000000 0x3fe89d9000000000 --- +FUCOMPP 0x7ff0000000000000 0x3fe89d9000000000 --- +FUCOMI 0x7ff0000000000000 0x7ff0000000000000 Z-- +FUCOMPP 0x7ff0000000000000 0x7ff0000000000000 Z-- +FUCOMI 0x7ff0000000000000 0xfff0000000000000 --- +FUCOMPP 0x7ff0000000000000 0xfff0000000000000 --- +FUCOMI 0x7ff0000000000000 0x3ff0002ca0000000 --- +FUCOMPP 0x7ff0000000000000 0x3ff0002ca0000000 --- +FUCOMI 0x7ff0000000000000 0xaeff000025000000 --- +FUCOMPP 0x7ff0000000000000 0xaeff000025000000 --- +FUCOMI 0x7ff0000000000000 0x3ff0000050000000 --- +FUCOMPP 0x7ff0000000000000 0x3ff0000050000000 --- +FUCOMI 0x7ff0000000000000 0xc082c00000000000 --- +FUCOMPP 0x7ff0000000000000 0xc082c00000000000 --- +FUCOMI 0x7ff0000000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x7ff0000000000000 0x7ff8000000000001 ZPC +FUCOMI 0xfff0000000000000 0x0 --C +FUCOMPP 0xfff0000000000000 0x0 --C +FUCOMI 0xfff0000000000000 0x4082c00000000000 --C +FUCOMPP 0xfff0000000000000 0x4082c00000000000 --C +FUCOMI 0xfff0000000000000 0x8000000000000000 --C +FUCOMPP 0xfff0000000000000 0x8000000000000000 --C +FUCOMI 0xfff0000000000000 0x40dfffc000000000 --C +FUCOMPP 0xfff0000000000000 0x40dfffc000000000 --C +FUCOMI 0xfff0000000000000 0x40e0002000000000 --C +FUCOMPP 0xfff0000000000000 0x40e0002000000000 --C +FUCOMI 0xfff0000000000000 0xc0e0002000000000 --C +FUCOMPP 0xfff0000000000000 0xc0e0002000000000 --C +FUCOMI 0xfff0000000000000 0xc0dfffc000000000 --C +FUCOMPP 0xfff0000000000000 0xc0dfffc000000000 --C +FUCOMI 0xfff0000000000000 0x3ff0000000000000 --C +FUCOMPP 0xfff0000000000000 0x3ff0000000000000 --C +FUCOMI 0xfff0000000000000 0x3fe89d9000000000 --C +FUCOMPP 0xfff0000000000000 0x3fe89d9000000000 --C +FUCOMI 0xfff0000000000000 0x7ff0000000000000 --C +FUCOMPP 0xfff0000000000000 0x7ff0000000000000 --C +FUCOMI 0xfff0000000000000 0xfff0000000000000 Z-- +FUCOMPP 0xfff0000000000000 0xfff0000000000000 Z-- +FUCOMI 0xfff0000000000000 0x3ff0002ca0000000 --C +FUCOMPP 0xfff0000000000000 0x3ff0002ca0000000 --C +FUCOMI 0xfff0000000000000 0xaeff000025000000 --C +FUCOMPP 0xfff0000000000000 0xaeff000025000000 --C +FUCOMI 0xfff0000000000000 0x3ff0000050000000 --C +FUCOMPP 0xfff0000000000000 0x3ff0000050000000 --C +FUCOMI 0xfff0000000000000 0xc082c00000000000 --C +FUCOMPP 0xfff0000000000000 0xc082c00000000000 --C +FUCOMI 0xfff0000000000000 0x7ff8000000000001 ZPC +FUCOMPP 0xfff0000000000000 0x7ff8000000000001 ZPC +FUCOMI 0x3ff0002ca0000000 0x0 --- +FUCOMPP 0x3ff0002ca0000000 0x0 --- +FUCOMI 0x3ff0002ca0000000 0x4082c00000000000 --C +FUCOMPP 0x3ff0002ca0000000 0x4082c00000000000 --C +FUCOMI 0x3ff0002ca0000000 0x8000000000000000 --- +FUCOMPP 0x3ff0002ca0000000 0x8000000000000000 --- +FUCOMI 0x3ff0002ca0000000 0x40dfffc000000000 --C +FUCOMPP 0x3ff0002ca0000000 0x40dfffc000000000 --C +FUCOMI 0x3ff0002ca0000000 0x40e0002000000000 --C +FUCOMPP 0x3ff0002ca0000000 0x40e0002000000000 --C +FUCOMI 0x3ff0002ca0000000 0xc0e0002000000000 --- +FUCOMPP 0x3ff0002ca0000000 0xc0e0002000000000 --- +FUCOMI 0x3ff0002ca0000000 0xc0dfffc000000000 --- +FUCOMPP 0x3ff0002ca0000000 0xc0dfffc000000000 --- +FUCOMI 0x3ff0002ca0000000 0x3ff0000000000000 --- +FUCOMPP 0x3ff0002ca0000000 0x3ff0000000000000 --- +FUCOMI 0x3ff0002ca0000000 0x3fe89d9000000000 --- +FUCOMPP 0x3ff0002ca0000000 0x3fe89d9000000000 --- +FUCOMI 0x3ff0002ca0000000 0x7ff0000000000000 --C +FUCOMPP 0x3ff0002ca0000000 0x7ff0000000000000 --C +FUCOMI 0x3ff0002ca0000000 0xfff0000000000000 --- +FUCOMPP 0x3ff0002ca0000000 0xfff0000000000000 --- +FUCOMI 0x3ff0002ca0000000 0x3ff0002ca0000000 Z-- +FUCOMPP 0x3ff0002ca0000000 0x3ff0002ca0000000 Z-- +FUCOMI 0x3ff0002ca0000000 0xaeff000025000000 --- +FUCOMPP 0x3ff0002ca0000000 0xaeff000025000000 --- +FUCOMI 0x3ff0002ca0000000 0x3ff0000050000000 --- +FUCOMPP 0x3ff0002ca0000000 0x3ff0000050000000 --- +FUCOMI 0x3ff0002ca0000000 0xc082c00000000000 --- +FUCOMPP 0x3ff0002ca0000000 0xc082c00000000000 --- +FUCOMI 0x3ff0002ca0000000 0x7ff8000000000001 ZPC +FUCOMPP 0x3ff0002ca0000000 0x7ff8000000000001 ZPC +FUCOMI 0xaeff000025000000 0x0 --C +FUCOMPP 0xaeff000025000000 0x0 --C +FUCOMI 0xaeff000025000000 0x4082c00000000000 --C +FUCOMPP 0xaeff000025000000 0x4082c00000000000 --C +FUCOMI 0xaeff000025000000 0x8000000000000000 --C +FUCOMPP 0xaeff000025000000 0x8000000000000000 --C +FUCOMI 0xaeff000025000000 0x40dfffc000000000 --C +FUCOMPP 0xaeff000025000000 0x40dfffc000000000 --C +FUCOMI 0xaeff000025000000 0x40e0002000000000 --C +FUCOMPP 0xaeff000025000000 0x40e0002000000000 --C +FUCOMI 0xaeff000025000000 0xc0e0002000000000 --- +FUCOMPP 0xaeff000025000000 0xc0e0002000000000 --- +FUCOMI 0xaeff000025000000 0xc0dfffc000000000 --- +FUCOMPP 0xaeff000025000000 0xc0dfffc000000000 --- +FUCOMI 0xaeff000025000000 0x3ff0000000000000 --C +FUCOMPP 0xaeff000025000000 0x3ff0000000000000 --C +FUCOMI 0xaeff000025000000 0x3fe89d9000000000 --C +FUCOMPP 0xaeff000025000000 0x3fe89d9000000000 --C +FUCOMI 0xaeff000025000000 0x7ff0000000000000 --C +FUCOMPP 0xaeff000025000000 0x7ff0000000000000 --C +FUCOMI 0xaeff000025000000 0xfff0000000000000 --- +FUCOMPP 0xaeff000025000000 0xfff0000000000000 --- +FUCOMI 0xaeff000025000000 0x3ff0002ca0000000 --C +FUCOMPP 0xaeff000025000000 0x3ff0002ca0000000 --C +FUCOMI 0xaeff000025000000 0xaeff000025000000 Z-- +FUCOMPP 0xaeff000025000000 0xaeff000025000000 Z-- +FUCOMI 0xaeff000025000000 0x3ff0000050000000 --C +FUCOMPP 0xaeff000025000000 0x3ff0000050000000 --C +FUCOMI 0xaeff000025000000 0xc082c00000000000 --- +FUCOMPP 0xaeff000025000000 0xc082c00000000000 --- +FUCOMI 0xaeff000025000000 0x7ff8000000000001 ZPC +FUCOMPP 0xaeff000025000000 0x7ff8000000000001 ZPC +FUCOMI 0x3ff0000050000000 0x0 --- +FUCOMPP 0x3ff0000050000000 0x0 --- +FUCOMI 0x3ff0000050000000 0x4082c00000000000 --C +FUCOMPP 0x3ff0000050000000 0x4082c00000000000 --C +FUCOMI 0x3ff0000050000000 0x8000000000000000 --- +FUCOMPP 0x3ff0000050000000 0x8000000000000000 --- +FUCOMI 0x3ff0000050000000 0x40dfffc000000000 --C +FUCOMPP 0x3ff0000050000000 0x40dfffc000000000 --C +FUCOMI 0x3ff0000050000000 0x40e0002000000000 --C +FUCOMPP 0x3ff0000050000000 0x40e0002000000000 --C +FUCOMI 0x3ff0000050000000 0xc0e0002000000000 --- +FUCOMPP 0x3ff0000050000000 0xc0e0002000000000 --- +FUCOMI 0x3ff0000050000000 0xc0dfffc000000000 --- +FUCOMPP 0x3ff0000050000000 0xc0dfffc000000000 --- +FUCOMI 0x3ff0000050000000 0x3ff0000000000000 --- +FUCOMPP 0x3ff0000050000000 0x3ff0000000000000 --- +FUCOMI 0x3ff0000050000000 0x3fe89d9000000000 --- +FUCOMPP 0x3ff0000050000000 0x3fe89d9000000000 --- +FUCOMI 0x3ff0000050000000 0x7ff0000000000000 --C +FUCOMPP 0x3ff0000050000000 0x7ff0000000000000 --C +FUCOMI 0x3ff0000050000000 0xfff0000000000000 --- +FUCOMPP 0x3ff0000050000000 0xfff0000000000000 --- +FUCOMI 0x3ff0000050000000 0x3ff0002ca0000000 --C +FUCOMPP 0x3ff0000050000000 0x3ff0002ca0000000 --C +FUCOMI 0x3ff0000050000000 0xaeff000025000000 --- +FUCOMPP 0x3ff0000050000000 0xaeff000025000000 --- +FUCOMI 0x3ff0000050000000 0x3ff0000050000000 Z-- +FUCOMPP 0x3ff0000050000000 0x3ff0000050000000 Z-- +FUCOMI 0x3ff0000050000000 0xc082c00000000000 --- +FUCOMPP 0x3ff0000050000000 0xc082c00000000000 --- +FUCOMI 0x3ff0000050000000 0x7ff8000000000001 ZPC +FUCOMPP 0x3ff0000050000000 0x7ff8000000000001 ZPC +FUCOMI 0xc082c00000000000 0x0 --C +FUCOMPP 0xc082c00000000000 0x0 --C +FUCOMI 0xc082c00000000000 0x4082c00000000000 --C +FUCOMPP 0xc082c00000000000 0x4082c00000000000 --C +FUCOMI 0xc082c00000000000 0x8000000000000000 --C +FUCOMPP 0xc082c00000000000 0x8000000000000000 --C +FUCOMI 0xc082c00000000000 0x40dfffc000000000 --C +FUCOMPP 0xc082c00000000000 0x40dfffc000000000 --C +FUCOMI 0xc082c00000000000 0x40e0002000000000 --C +FUCOMPP 0xc082c00000000000 0x40e0002000000000 --C +FUCOMI 0xc082c00000000000 0xc0e0002000000000 --- +FUCOMPP 0xc082c00000000000 0xc0e0002000000000 --- +FUCOMI 0xc082c00000000000 0xc0dfffc000000000 --- +FUCOMPP 0xc082c00000000000 0xc0dfffc000000000 --- +FUCOMI 0xc082c00000000000 0x3ff0000000000000 --C +FUCOMPP 0xc082c00000000000 0x3ff0000000000000 --C +FUCOMI 0xc082c00000000000 0x3fe89d9000000000 --C +FUCOMPP 0xc082c00000000000 0x3fe89d9000000000 --C +FUCOMI 0xc082c00000000000 0x7ff0000000000000 --C +FUCOMPP 0xc082c00000000000 0x7ff0000000000000 --C +FUCOMI 0xc082c00000000000 0xfff0000000000000 --- +FUCOMPP 0xc082c00000000000 0xfff0000000000000 --- +FUCOMI 0xc082c00000000000 0x3ff0002ca0000000 --C +FUCOMPP 0xc082c00000000000 0x3ff0002ca0000000 --C +FUCOMI 0xc082c00000000000 0xaeff000025000000 --C +FUCOMPP 0xc082c00000000000 0xaeff000025000000 --C +FUCOMI 0xc082c00000000000 0x3ff0000050000000 --C +FUCOMPP 0xc082c00000000000 0x3ff0000050000000 --C +FUCOMI 0xc082c00000000000 0xc082c00000000000 Z-- +FUCOMPP 0xc082c00000000000 0xc082c00000000000 Z-- +FUCOMI 0xc082c00000000000 0x7ff8000000000001 ZPC +FUCOMPP 0xc082c00000000000 0x7ff8000000000001 ZPC +FUCOMI 0x7ff8000000000001 0x0 ZPC +FUCOMPP 0x7ff8000000000001 0x0 ZPC +FUCOMI 0x7ff8000000000001 0x4082c00000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x4082c00000000000 ZPC +FUCOMI 0x7ff8000000000001 0x8000000000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x8000000000000000 ZPC +FUCOMI 0x7ff8000000000001 0x40dfffc000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x40dfffc000000000 ZPC +FUCOMI 0x7ff8000000000001 0x40e0002000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x40e0002000000000 ZPC +FUCOMI 0x7ff8000000000001 0xc0e0002000000000 ZPC +FUCOMPP 0x7ff8000000000001 0xc0e0002000000000 ZPC +FUCOMI 0x7ff8000000000001 0xc0dfffc000000000 ZPC +FUCOMPP 0x7ff8000000000001 0xc0dfffc000000000 ZPC +FUCOMI 0x7ff8000000000001 0x3ff0000000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x3ff0000000000000 ZPC +FUCOMI 0x7ff8000000000001 0x3fe89d9000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x3fe89d9000000000 ZPC +FUCOMI 0x7ff8000000000001 0x7ff0000000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x7ff0000000000000 ZPC +FUCOMI 0x7ff8000000000001 0xfff0000000000000 ZPC +FUCOMPP 0x7ff8000000000001 0xfff0000000000000 ZPC +FUCOMI 0x7ff8000000000001 0x3ff0002ca0000000 ZPC +FUCOMPP 0x7ff8000000000001 0x3ff0002ca0000000 ZPC +FUCOMI 0x7ff8000000000001 0xaeff000025000000 ZPC +FUCOMPP 0x7ff8000000000001 0xaeff000025000000 ZPC +FUCOMI 0x7ff8000000000001 0x3ff0000050000000 ZPC +FUCOMPP 0x7ff8000000000001 0x3ff0000050000000 ZPC +FUCOMI 0x7ff8000000000001 0xc082c00000000000 ZPC +FUCOMPP 0x7ff8000000000001 0xc082c00000000000 ZPC +FUCOMI 0x7ff8000000000001 0x7ff8000000000001 ZPC +FUCOMPP 0x7ff8000000000001 0x7ff8000000000001 ZPC Rounding 0 - FRNDINT 0x4082c00000000000 => 0x4082c00000000000 FRNDINT 0x0 => 0x0 - FISTP 0x4082c00000000000 => word: 258 FISTP 0x0 => word: 0 - FISTP 0x4082c00000000000 => long: 258 FISTP 0x0 => long: 0 - FISTP 0x4082c00000000000 => quad: 258 FISTP 0x0 => quad: 0 - FISTTP 0x4082c00000000000 => word: 258 FISTTP 0x0 => word: 0 - FISTTP 0x4082c00000000000 => long: 258 FISTTP 0x0 => long: 0 - FISTTP 0x4082c00000000000 => quad: 258 FISTTP 0x0 => quad: 0 Rounding 1 - FRNDINT 0x4082c00000000000 => 0x4082c00000000000 FRNDINT 0x0 => 0x0 - FISTP 0x4082c00000000000 => word: 258 FISTP 0x0 => word: 0 - FISTP 0x4082c00000000000 => long: 258 FISTP 0x0 => long: 0 - FISTP 0x4082c00000000000 => quad: 258 FISTP 0x0 => quad: 0 - FISTTP 0x4082c00000000000 => word: 258 FISTTP 0x0 => word: 0 - FISTTP 0x4082c00000000000 => long: 258 FISTTP 0x0 => long: 0 - FISTTP 0x4082c00000000000 => quad: 258 FISTTP 0x0 => quad: 0 Rounding 2 - FRNDINT 0x4082c00000000000 => 0x4082c00000000000 FRNDINT 0x0 => 0x0 - FISTP 0x4082c00000000000 => word: 258 FISTP 0x0 => word: 0 - FISTP 0x4082c00000000000 => long: 258 FISTP 0x0 => long: 0 - FISTP 0x4082c00000000000 => quad: 258 FISTP 0x0 => quad: 0 - FISTTP 0x4082c00000000000 => word: 258 FISTTP 0x0 => word: 0 - FISTTP 0x4082c00000000000 => long: 258 FISTTP 0x0 => long: 0 - FISTTP 0x4082c00000000000 => quad: 258 FISTTP 0x0 => quad: 0 -FUCOMI 0x8000000000000000 0x4082c00000000000 --C -FUCOMPP 0x8000000000000000 0x4082c00000000000 --C -Rounding 0 - FRNDINT 0x8000000000000000 => 0x8000000000000000 - FRNDINT 0x4082c00000000000 => 0x4082c00000000000 - FISTP 0x8000000000000000 => word: 0 - FISTP 0x4082c00000000000 => word: 258 - FISTP 0x8000000000000000 => long: 0 - FISTP 0x4082c00000000000 => long: 258 - FISTP 0x8000000000000000 => quad: 0 - FISTP 0x4082c00000000000 => quad: 258 - FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x4082c00000000000 => word: 258 - FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x4082c00000000000 => long: 258 - FISTTP 0x8000000000000000 => quad: 0 - FISTTP 0x4082c00000000000 => quad: 258 -Rounding 1 - FRNDINT 0x8000000000000000 => 0x8000000000000000 - FRNDINT 0x4082c00000000000 => 0x4082c00000000000 - FISTP 0x8000000000000000 => word: 0 - FISTP 0x4082c00000000000 => word: 258 - FISTP 0x8000000000000000 => long: 0 - FISTP 0x4082c00000000000 => long: 258 - FISTP 0x8000000000000000 => quad: 0 - FISTP 0x4082c00000000000 => quad: 258 - FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x4082c00000000000 => word: 258 - FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x4082c00000000000 => long: 258 - FISTTP 0x8000000000000000 => quad: 0 - FISTTP 0x4082c00000000000 => quad: 258 -Rounding 2 - FRNDINT 0x8000000000000000 => 0x8000000000000000 - FRNDINT 0x4082c00000000000 => 0x4082c00000000000 - FISTP 0x8000000000000000 => word: 0 - FISTP 0x4082c00000000000 => word: 258 - FISTP 0x8000000000000000 => long: 0 - FISTP 0x4082c00000000000 => long: 258 - FISTP 0x8000000000000000 => quad: 0 - FISTP 0x4082c00000000000 => quad: 258 - FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x4082c00000000000 => word: 258 - FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x4082c00000000000 => long: 258 - FISTTP 0x8000000000000000 => quad: 0 - FISTTP 0x4082c00000000000 => quad: 258 -FUCOMI 0x4082c00000000000 0x8000000000000000 --- -FUCOMPP 0x4082c00000000000 0x8000000000000000 --- Rounding 0 FRNDINT 0x4082c00000000000 => 0x4082c00000000000 - FRNDINT 0x8000000000000000 => 0x8000000000000000 FISTP 0x4082c00000000000 => word: 258 - FISTP 0x8000000000000000 => word: 0 FISTP 0x4082c00000000000 => long: 258 - FISTP 0x8000000000000000 => long: 0 FISTP 0x4082c00000000000 => quad: 258 - FISTP 0x8000000000000000 => quad: 0 FISTTP 0x4082c00000000000 => word: 258 - FISTTP 0x8000000000000000 => word: 0 FISTTP 0x4082c00000000000 => long: 258 - FISTTP 0x8000000000000000 => long: 0 FISTTP 0x4082c00000000000 => quad: 258 - FISTTP 0x8000000000000000 => quad: 0 Rounding 1 FRNDINT 0x4082c00000000000 => 0x4082c00000000000 - FRNDINT 0x8000000000000000 => 0x8000000000000000 FISTP 0x4082c00000000000 => word: 258 - FISTP 0x8000000000000000 => word: 0 FISTP 0x4082c00000000000 => long: 258 - FISTP 0x8000000000000000 => long: 0 FISTP 0x4082c00000000000 => quad: 258 - FISTP 0x8000000000000000 => quad: 0 FISTTP 0x4082c00000000000 => word: 258 - FISTTP 0x8000000000000000 => word: 0 FISTTP 0x4082c00000000000 => long: 258 - FISTTP 0x8000000000000000 => long: 0 FISTTP 0x4082c00000000000 => quad: 258 - FISTTP 0x8000000000000000 => quad: 0 Rounding 2 FRNDINT 0x4082c00000000000 => 0x4082c00000000000 - FRNDINT 0x8000000000000000 => 0x8000000000000000 FISTP 0x4082c00000000000 => word: 258 - FISTP 0x8000000000000000 => word: 0 FISTP 0x4082c00000000000 => long: 258 - FISTP 0x8000000000000000 => long: 0 FISTP 0x4082c00000000000 => quad: 258 - FISTP 0x8000000000000000 => quad: 0 FISTTP 0x4082c00000000000 => word: 258 - FISTTP 0x8000000000000000 => word: 0 FISTTP 0x4082c00000000000 => long: 258 - FISTTP 0x8000000000000000 => long: 0 FISTTP 0x4082c00000000000 => quad: 258 - FISTTP 0x8000000000000000 => quad: 0 -FUCOMI 0x8000000000000000 0x0 Z-- -FUCOMPP 0x8000000000000000 0x0 Z-- -Rounding 0 - FRNDINT 0x8000000000000000 => 0x8000000000000000 - FRNDINT 0x0 => 0x0 - FISTP 0x8000000000000000 => word: 0 - FISTP 0x0 => word: 0 - FISTP 0x8000000000000000 => long: 0 - FISTP 0x0 => long: 0 - FISTP 0x8000000000000000 => quad: 0 - FISTP 0x0 => quad: 0 - FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x0 => word: 0 - FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x0 => long: 0 - FISTTP 0x8000000000000000 => quad: 0 - FISTTP 0x0 => quad: 0 -Rounding 1 - FRNDINT 0x8000000000000000 => 0x8000000000000000 - FRNDINT 0x0 => 0x0 - FISTP 0x8000000000000000 => word: 0 - FISTP 0x0 => word: 0 - FISTP 0x8000000000000000 => long: 0 - FISTP 0x0 => long: 0 - FISTP 0x8000000000000000 => quad: 0 - FISTP 0x0 => quad: 0 - FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x0 => word: 0 - FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x0 => long: 0 - FISTTP 0x8000000000000000 => quad: 0 - FISTTP 0x0 => quad: 0 -Rounding 2 - FRNDINT 0x8000000000000000 => 0x8000000000000000 - FRNDINT 0x0 => 0x0 - FISTP 0x8000000000000000 => word: 0 - FISTP 0x0 => word: 0 - FISTP 0x8000000000000000 => long: 0 - FISTP 0x0 => long: 0 - FISTP 0x8000000000000000 => quad: 0 - FISTP 0x0 => quad: 0 - FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x0 => word: 0 - FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x0 => long: 0 - FISTTP 0x8000000000000000 => quad: 0 - FISTTP 0x0 => quad: 0 -FUCOMI 0x0 0x8000000000000000 Z-- -FUCOMPP 0x0 0x8000000000000000 Z-- Rounding 0 - FRNDINT 0x0 => 0x0 FRNDINT 0x8000000000000000 => 0x8000000000000000 - FISTP 0x0 => word: 0 FISTP 0x8000000000000000 => word: 0 - FISTP 0x0 => long: 0 FISTP 0x8000000000000000 => long: 0 - FISTP 0x0 => quad: 0 FISTP 0x8000000000000000 => quad: 0 - FISTTP 0x0 => word: 0 FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x0 => long: 0 FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x0 => quad: 0 FISTTP 0x8000000000000000 => quad: 0 Rounding 1 - FRNDINT 0x0 => 0x0 FRNDINT 0x8000000000000000 => 0x8000000000000000 - FISTP 0x0 => word: 0 FISTP 0x8000000000000000 => word: 0 - FISTP 0x0 => long: 0 FISTP 0x8000000000000000 => long: 0 - FISTP 0x0 => quad: 0 FISTP 0x8000000000000000 => quad: 0 - FISTTP 0x0 => word: 0 FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x0 => long: 0 FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x0 => quad: 0 FISTTP 0x8000000000000000 => quad: 0 Rounding 2 - FRNDINT 0x0 => 0x0 FRNDINT 0x8000000000000000 => 0x8000000000000000 - FISTP 0x0 => word: 0 FISTP 0x8000000000000000 => word: 0 - FISTP 0x0 => long: 0 FISTP 0x8000000000000000 => long: 0 - FISTP 0x0 => quad: 0 FISTP 0x8000000000000000 => quad: 0 - FISTTP 0x0 => word: 0 FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x0 => long: 0 FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x0 => quad: 0 FISTTP 0x8000000000000000 => quad: 0 -FUCOMI 0x40dfffc000000000 0x40e0002000000000 --C -FUCOMPP 0x40dfffc000000000 0x40e0002000000000 --C Rounding 0 FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000 - FRNDINT 0x40e0002000000000 => 0x40e0002000000000 FISTP 0x40dfffc000000000 => word: 7fff - FISTP 0x40e0002000000000 => word: 8000 FISTP 0x40dfffc000000000 => long: 7fff - FISTP 0x40e0002000000000 => long: 8001 FISTP 0x40dfffc000000000 => quad: 7fff - FISTP 0x40e0002000000000 => quad: 8001 FISTTP 0x40dfffc000000000 => word: 7fff - FISTTP 0x40e0002000000000 => word: 8000 FISTTP 0x40dfffc000000000 => long: 7fff - FISTTP 0x40e0002000000000 => long: 8001 FISTTP 0x40dfffc000000000 => quad: 7fff - FISTTP 0x40e0002000000000 => quad: 8001 Rounding 1 FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000 - FRNDINT 0x40e0002000000000 => 0x40e0002000000000 FISTP 0x40dfffc000000000 => word: 7fff - FISTP 0x40e0002000000000 => word: 8000 FISTP 0x40dfffc000000000 => long: 7fff - FISTP 0x40e0002000000000 => long: 8001 FISTP 0x40dfffc000000000 => quad: 7fff - FISTP 0x40e0002000000000 => quad: 8001 FISTTP 0x40dfffc000000000 => word: 7fff - FISTTP 0x40e0002000000000 => word: 8000 FISTTP 0x40dfffc000000000 => long: 7fff - FISTTP 0x40e0002000000000 => long: 8001 FISTTP 0x40dfffc000000000 => quad: 7fff - FISTTP 0x40e0002000000000 => quad: 8001 Rounding 2 FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000 - FRNDINT 0x40e0002000000000 => 0x40e0002000000000 FISTP 0x40dfffc000000000 => word: 7fff - FISTP 0x40e0002000000000 => word: 8000 FISTP 0x40dfffc000000000 => long: 7fff - FISTP 0x40e0002000000000 => long: 8001 FISTP 0x40dfffc000000000 => quad: 7fff - FISTP 0x40e0002000000000 => quad: 8001 FISTTP 0x40dfffc000000000 => word: 7fff - FISTTP 0x40e0002000000000 => word: 8000 FISTTP 0x40dfffc000000000 => long: 7fff - FISTTP 0x40e0002000000000 => long: 8001 FISTTP 0x40dfffc000000000 => quad: 7fff - FISTTP 0x40e0002000000000 => quad: 8001 -FUCOMI 0x40e0002000000000 0x40dfffc000000000 --- -FUCOMPP 0x40e0002000000000 0x40dfffc000000000 --- Rounding 0 FRNDINT 0x40e0002000000000 => 0x40e0002000000000 - FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000 FISTP 0x40e0002000000000 => word: 8000 - FISTP 0x40dfffc000000000 => word: 7fff FISTP 0x40e0002000000000 => long: 8001 - FISTP 0x40dfffc000000000 => long: 7fff FISTP 0x40e0002000000000 => quad: 8001 - FISTP 0x40dfffc000000000 => quad: 7fff FISTTP 0x40e0002000000000 => word: 8000 - FISTTP 0x40dfffc000000000 => word: 7fff FISTTP 0x40e0002000000000 => long: 8001 - FISTTP 0x40dfffc000000000 => long: 7fff FISTTP 0x40e0002000000000 => quad: 8001 - FISTTP 0x40dfffc000000000 => quad: 7fff Rounding 1 FRNDINT 0x40e0002000000000 => 0x40e0002000000000 - FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000 FISTP 0x40e0002000000000 => word: 8000 - FISTP 0x40dfffc000000000 => word: 7fff FISTP 0x40e0002000000000 => long: 8001 - FISTP 0x40dfffc000000000 => long: 7fff FISTP 0x40e0002000000000 => quad: 8001 - FISTP 0x40dfffc000000000 => quad: 7fff FISTTP 0x40e0002000000000 => word: 8000 - FISTTP 0x40dfffc000000000 => word: 7fff FISTTP 0x40e0002000000000 => long: 8001 - FISTTP 0x40dfffc000000000 => long: 7fff FISTTP 0x40e0002000000000 => quad: 8001 - FISTTP 0x40dfffc000000000 => quad: 7fff Rounding 2 FRNDINT 0x40e0002000000000 => 0x40e0002000000000 - FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000 FISTP 0x40e0002000000000 => word: 8000 - FISTP 0x40dfffc000000000 => word: 7fff FISTP 0x40e0002000000000 => long: 8001 - FISTP 0x40dfffc000000000 => long: 7fff FISTP 0x40e0002000000000 => quad: 8001 - FISTP 0x40dfffc000000000 => quad: 7fff FISTTP 0x40e0002000000000 => word: 8000 - FISTTP 0x40dfffc000000000 => word: 7fff FISTTP 0x40e0002000000000 => long: 8001 - FISTTP 0x40dfffc000000000 => long: 7fff FISTTP 0x40e0002000000000 => quad: 8001 - FISTTP 0x40dfffc000000000 => quad: 7fff -FUCOMI 0xc0e0002000000000 0xc0dfffc000000000 --C -FUCOMPP 0xc0e0002000000000 0xc0dfffc000000000 --C -Rounding 0 - FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000 - FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000 - FISTP 0xc0e0002000000000 => word: 8000 - FISTP 0xc0dfffc000000000 => word: 8001 - FISTP 0xc0e0002000000000 => long: ffff7fff - FISTP 0xc0dfffc000000000 => long: ffff8001 - FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff - FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001 - FISTTP 0xc0e0002000000000 => word: 8000 - FISTTP 0xc0dfffc000000000 => word: 8001 - FISTTP 0xc0e0002000000000 => long: ffff7fff - FISTTP 0xc0dfffc000000000 => long: ffff8001 - FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff - FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001 -Rounding 1 - FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000 - FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000 - FISTP 0xc0e0002000000000 => word: 8000 - FISTP 0xc0dfffc000000000 => word: 8001 - FISTP 0xc0e0002000000000 => long: ffff7fff - FISTP 0xc0dfffc000000000 => long: ffff8001 - FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff - FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001 - FISTTP 0xc0e0002000000000 => word: 8000 - FISTTP 0xc0dfffc000000000 => word: 8001 - FISTTP 0xc0e0002000000000 => long: ffff7fff - FISTTP 0xc0dfffc000000000 => long: ffff8001 - FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff - FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001 -Rounding 2 - FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000 - FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000 - FISTP 0xc0e0002000000000 => word: 8000 - FISTP 0xc0dfffc000000000 => word: 8001 - FISTP 0xc0e0002000000000 => long: ffff7fff - FISTP 0xc0dfffc000000000 => long: ffff8001 - FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff - FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001 - FISTTP 0xc0e0002000000000 => word: 8000 - FISTTP 0xc0dfffc000000000 => word: 8001 - FISTTP 0xc0e0002000000000 => long: ffff7fff - FISTTP 0xc0dfffc000000000 => long: ffff8001 - FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff - FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001 -FUCOMI 0xc0dfffc000000000 0xc0e0002000000000 --- -FUCOMPP 0xc0dfffc000000000 0xc0e0002000000000 --- Rounding 0 - FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000 FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000 - FISTP 0xc0dfffc000000000 => word: 8001 FISTP 0xc0e0002000000000 => word: 8000 - FISTP 0xc0dfffc000000000 => long: ffff8001 FISTP 0xc0e0002000000000 => long: ffff7fff - FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001 FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff - FISTTP 0xc0dfffc000000000 => word: 8001 FISTTP 0xc0e0002000000000 => word: 8000 - FISTTP 0xc0dfffc000000000 => long: ffff8001 FISTTP 0xc0e0002000000000 => long: ffff7fff - FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001 FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff Rounding 1 - FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000 - FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000 - FISTP 0xc0dfffc000000000 => word: 8001 - FISTP 0xc0e0002000000000 => word: 8000 - FISTP 0xc0dfffc000000000 => long: ffff8001 - FISTP 0xc0e0002000000000 => long: ffff7fff - FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001 - FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff - FISTTP 0xc0dfffc000000000 => word: 8001 - FISTTP 0xc0e0002000000000 => word: 8000 - FISTTP 0xc0dfffc000000000 => long: ffff8001 - FISTTP 0xc0e0002000000000 => long: ffff7fff - FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001 - FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff -Rounding 2 - FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000 FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000 - FISTP 0xc0dfffc000000000 => word: 8001 FISTP 0xc0e0002000000000 => word: 8000 - FISTP 0xc0dfffc000000000 => long: ffff8001 FISTP 0xc0e0002000000000 => long: ffff7fff - FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001 FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff - FISTTP 0xc0dfffc000000000 => word: 8001 FISTTP 0xc0e0002000000000 => word: 8000 - FISTTP 0xc0dfffc000000000 => long: ffff8001 FISTTP 0xc0e0002000000000 => long: ffff7fff - FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001 FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff -FUCOMI 0x8000000000000000 0x3ff0000000000000 --C -FUCOMPP 0x8000000000000000 0x3ff0000000000000 --C -Rounding 0 - FRNDINT 0x8000000000000000 => 0x8000000000000000 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FISTP 0x8000000000000000 => word: 0 - FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x8000000000000000 => long: 0 - FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x8000000000000000 => quad: 0 - FISTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x8000000000000000 => quad: 0 - FISTTP 0x3ff0000000000000 => quad: 1 -Rounding 1 - FRNDINT 0x8000000000000000 => 0x8000000000000000 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FISTP 0x8000000000000000 => word: 0 - FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x8000000000000000 => long: 0 - FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x8000000000000000 => quad: 0 - FISTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x8000000000000000 => quad: 0 - FISTTP 0x3ff0000000000000 => quad: 1 Rounding 2 - FRNDINT 0x8000000000000000 => 0x8000000000000000 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FISTP 0x8000000000000000 => word: 0 - FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x8000000000000000 => long: 0 - FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x8000000000000000 => quad: 0 - FISTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x8000000000000000 => quad: 0 - FISTTP 0x3ff0000000000000 => quad: 1 -FUCOMI 0x3ff0000000000000 0x8000000000000000 --- -FUCOMPP 0x3ff0000000000000 0x8000000000000000 --- + FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000 + FISTP 0xc0e0002000000000 => word: 8000 + FISTP 0xc0e0002000000000 => long: ffff7fff + FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff + FISTTP 0xc0e0002000000000 => word: 8000 + FISTTP 0xc0e0002000000000 => long: ffff7fff + FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff Rounding 0 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FRNDINT 0x8000000000000000 => 0x8000000000000000 - FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x8000000000000000 => word: 0 - FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x8000000000000000 => long: 0 - FISTP 0x3ff0000000000000 => quad: 1 - FISTP 0x8000000000000000 => quad: 0 - FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x8000000000000000 => quad: 0 + FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000 + FISTP 0xc0dfffc000000000 => word: 8001 + FISTP 0xc0dfffc000000000 => long: ffff8001 + FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001 + FISTTP 0xc0dfffc000000000 => word: 8001 + FISTTP 0xc0dfffc000000000 => long: ffff8001 + FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001 Rounding 1 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FRNDINT 0x8000000000000000 => 0x8000000000000000 - FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x8000000000000000 => word: 0 - FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x8000000000000000 => long: 0 - FISTP 0x3ff0000000000000 => quad: 1 - FISTP 0x8000000000000000 => quad: 0 - FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x8000000000000000 => quad: 0 + FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000 + FISTP 0xc0dfffc000000000 => word: 8001 + FISTP 0xc0dfffc000000000 => long: ffff8001 + FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001 + FISTTP 0xc0dfffc000000000 => word: 8001 + FISTTP 0xc0dfffc000000000 => long: ffff8001 + FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001 Rounding 2 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FRNDINT 0x8000000000000000 => 0x8000000000000000 - FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x8000000000000000 => word: 0 - FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x8000000000000000 => long: 0 - FISTP 0x3ff0000000000000 => quad: 1 - FISTP 0x8000000000000000 => quad: 0 - FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x8000000000000000 => word: 0 - FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x8000000000000000 => long: 0 - FISTTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x8000000000000000 => quad: 0 -FUCOMI 0x3ff0000000000000 0x3fe89d9000000000 --- -FUCOMPP 0x3ff0000000000000 0x3fe89d9000000000 --- + FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000 + FISTP 0xc0dfffc000000000 => word: 8001 + FISTP 0xc0dfffc000000000 => long: ffff8001 + FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001 + FISTTP 0xc0dfffc000000000 => word: 8001 + FISTTP 0xc0dfffc000000000 => long: ffff8001 + FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001 Rounding 0 FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FRNDINT 0x3fe89d9000000000 => 0x3ff0000000000000 FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x3fe89d9000000000 => word: 1 FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x3fe89d9000000000 => long: 1 FISTP 0x3ff0000000000000 => quad: 1 - FISTP 0x3fe89d9000000000 => quad: 1 FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x3fe89d9000000000 => word: 0 FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x3fe89d9000000000 => long: 0 FISTTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x3fe89d9000000000 => quad: 0 Rounding 1 FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FRNDINT 0x3fe89d9000000000 => 0x0 FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x3fe89d9000000000 => word: 0 FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x3fe89d9000000000 => long: 0 FISTP 0x3ff0000000000000 => quad: 1 - FISTP 0x3fe89d9000000000 => quad: 0 FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x3fe89d9000000000 => word: 0 FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x3fe89d9000000000 => long: 0 FISTTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x3fe89d9000000000 => quad: 0 Rounding 2 FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FRNDINT 0x3fe89d9000000000 => 0x3ff0000000000000 FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x3fe89d9000000000 => word: 1 FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x3fe89d9000000000 => long: 1 FISTP 0x3ff0000000000000 => quad: 1 - FISTP 0x3fe89d9000000000 => quad: 1 FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x3fe89d9000000000 => word: 0 FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x3fe89d9000000000 => long: 0 FISTTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x3fe89d9000000000 => quad: 0 -FUCOMI 0x3fe89d9000000000 0x3ff0000000000000 --C -FUCOMPP 0x3fe89d9000000000 0x3ff0000000000000 --C Rounding 0 FRNDINT 0x3fe89d9000000000 => 0x3ff0000000000000 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 FISTP 0x3fe89d9000000000 => word: 1 - FISTP 0x3ff0000000000000 => word: 1 FISTP 0x3fe89d9000000000 => long: 1 - FISTP 0x3ff0000000000000 => long: 1 FISTP 0x3fe89d9000000000 => quad: 1 - FISTP 0x3ff0000000000000 => quad: 1 FISTTP 0x3fe89d9000000000 => word: 0 - FISTTP 0x3ff0000000000000 => word: 1 FISTTP 0x3fe89d9000000000 => long: 0 - FISTTP 0x3ff0000000000000 => long: 1 FISTTP 0x3fe89d9000000000 => quad: 0 - FISTTP 0x3ff0000000000000 => quad: 1 Rounding 1 FRNDINT 0x3fe89d9000000000 => 0x0 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 FISTP 0x3fe89d9000000000 => word: 0 - FISTP 0x3ff0000000000000 => word: 1 FISTP 0x3fe89d9000000000 => long: 0 - FISTP 0x3ff0000000000000 => long: 1 FISTP 0x3fe89d9000000000 => quad: 0 - FISTP 0x3ff0000000000000 => quad: 1 FISTTP 0x3fe89d9000000000 => word: 0 - FISTTP 0x3ff0000000000000 => word: 1 FISTTP 0x3fe89d9000000000 => long: 0 - FISTTP 0x3ff0000000000000 => long: 1 FISTTP 0x3fe89d9000000000 => quad: 0 - FISTTP 0x3ff0000000000000 => quad: 1 Rounding 2 FRNDINT 0x3fe89d9000000000 => 0x3ff0000000000000 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 FISTP 0x3fe89d9000000000 => word: 1 - FISTP 0x3ff0000000000000 => word: 1 FISTP 0x3fe89d9000000000 => long: 1 - FISTP 0x3ff0000000000000 => long: 1 FISTP 0x3fe89d9000000000 => quad: 1 - FISTP 0x3ff0000000000000 => quad: 1 FISTTP 0x3fe89d9000000000 => word: 0 - FISTTP 0x3ff0000000000000 => word: 1 FISTTP 0x3fe89d9000000000 => long: 0 - FISTTP 0x3ff0000000000000 => long: 1 FISTTP 0x3fe89d9000000000 => quad: 0 - FISTTP 0x3ff0000000000000 => quad: 1 -FUCOMI 0x3ff0000000000000 0x7ff0000000000000 --C -FUCOMPP 0x3ff0000000000000 0x7ff0000000000000 --C -Rounding 0 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 - FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x7ff0000000000000 => word: 8000 - FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x7ff0000000000000 => long: 80000000 - FISTP 0x3ff0000000000000 => quad: 1 - FISTP 0x7ff0000000000000 => quad: 8000000000000000 - FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x7ff0000000000000 => word: 8000 - FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x7ff0000000000000 => long: 80000000 - FISTTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x7ff0000000000000 => quad: 8000000000000000 -Rounding 1 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 - FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x7ff0000000000000 => word: 8000 - FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x7ff0000000000000 => long: 80000000 - FISTP 0x3ff0000000000000 => quad: 1 - FISTP 0x7ff0000000000000 => quad: 8000000000000000 - FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x7ff0000000000000 => word: 8000 - FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x7ff0000000000000 => long: 80000000 - FISTTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x7ff0000000000000 => quad: 8000000000000000 -Rounding 2 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 - FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x7ff0000000000000 => word: 8000 - FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x7ff0000000000000 => long: 80000000 - FISTP 0x3ff0000000000000 => quad: 1 - FISTP 0x7ff0000000000000 => quad: 8000000000000000 - FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x7ff0000000000000 => word: 8000 - FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x7ff0000000000000 => long: 80000000 - FISTTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x7ff0000000000000 => quad: 8000000000000000 -FUCOMI 0x7ff0000000000000 0x3ff0000000000000 --- -FUCOMPP 0x7ff0000000000000 0x3ff0000000000000 --- -Rounding 0 - FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FISTP 0x7ff0000000000000 => word: 8000 - FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x7ff0000000000000 => long: 80000000 - FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x7ff0000000000000 => quad: 8000000000000000 - FISTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x7ff0000000000000 => word: 8000 - FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x7ff0000000000000 => long: 80000000 - FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x7ff0000000000000 => quad: 8000000000000000 - FISTTP 0x3ff0000000000000 => quad: 1 -Rounding 1 - FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FISTP 0x7ff0000000000000 => word: 8000 - FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x7ff0000000000000 => long: 80000000 - FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x7ff0000000000000 => quad: 8000000000000000 - FISTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x7ff0000000000000 => word: 8000 - FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x7ff0000000000000 => long: 80000000 - FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x7ff0000000000000 => quad: 8000000000000000 - FISTTP 0x3ff0000000000000 => quad: 1 -Rounding 2 - FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 - FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 - FISTP 0x7ff0000000000000 => word: 8000 - FISTP 0x3ff0000000000000 => word: 1 - FISTP 0x7ff0000000000000 => long: 80000000 - FISTP 0x3ff0000000000000 => long: 1 - FISTP 0x7ff0000000000000 => quad: 8000000000000000 - FISTP 0x3ff0000000000000 => quad: 1 - FISTTP 0x7ff0000000000000 => word: 8000 - FISTTP 0x3ff0000000000000 => word: 1 - FISTTP 0x7ff0000000000000 => long: 80000000 - FISTTP 0x3ff0000000000000 => long: 1 - FISTTP 0x7ff0000000000000 => quad: 8000000000000000 - FISTTP 0x3ff0000000000000 => quad: 1 -FUCOMI 0xfff0000000000000 0x7ff0000000000000 --C -FUCOMPP 0xfff0000000000000 0x7ff0000000000000 --C Rounding 0 - FRNDINT 0xfff0000000000000 => 0xfff0000000000000 FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 - FISTP 0xfff0000000000000 => word: 8000 FISTP 0x7ff0000000000000 => word: 8000 - FISTP 0xfff0000000000000 => long: 80000000 FISTP 0x7ff0000000000000 => long: 80000000 - FISTP 0xfff0000000000000 => quad: 8000000000000000 FISTP 0x7ff0000000000000 => quad: 8000000000000000 - FISTTP 0xfff0000000000000 => word: 8000 FISTTP 0x7ff0000000000000 => word: 8000 - FISTTP 0xfff0000000000000 => long: 80000000 FISTTP 0x7ff0000000000000 => long: 80000000 - FISTTP 0xfff0000000000000 => quad: 8000000000000000 FISTTP 0x7ff0000000000000 => quad: 8000000000000000 Rounding 1 - FRNDINT 0xfff0000000000000 => 0xfff0000000000000 FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 - FISTP 0xfff0000000000000 => word: 8000 FISTP 0x7ff0000000000000 => word: 8000 - FISTP 0xfff0000000000000 => long: 80000000 FISTP 0x7ff0000000000000 => long: 80000000 - FISTP 0xfff0000000000000 => quad: 8000000000000000 FISTP 0x7ff0000000000000 => quad: 8000000000000000 - FISTTP 0xfff0000000000000 => word: 8000 FISTTP 0x7ff0000000000000 => word: 8000 - FISTTP 0xfff0000000000000 => long: 80000000 FISTTP 0x7ff0000000000000 => long: 80000000 - FISTTP 0xfff0000000000000 => quad: 8000000000000000 FISTTP 0x7ff0000000000000 => quad: 8000000000000000 Rounding 2 - FRNDINT 0xfff0000000000000 => 0xfff0000000000000 FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 - FISTP 0xfff0000000000000 => word: 8000 FISTP 0x7ff0000000000000 => word: 8000 - FISTP 0xfff0000000000000 => long: 80000000 FISTP 0x7ff0000000000000 => long: 80000000 - FISTP 0xfff0000000000000 => quad: 8000000000000000 FISTP 0x7ff0000000000000 => quad: 8000000000000000 - FISTTP 0xfff0000000000000 => word: 8000 FISTTP 0x7ff0000000000000 => word: 8000 - FISTTP 0xfff0000000000000 => long: 80000000 FISTTP 0x7ff0000000000000 => long: 80000000 - FISTTP 0xfff0000000000000 => quad: 8000000000000000 FISTTP 0x7ff0000000000000 => quad: 8000000000000000 -FUCOMI 0x7ff0000000000000 0xfff0000000000000 --- -FUCOMPP 0x7ff0000000000000 0xfff0000000000000 --- Rounding 0 - FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 FRNDINT 0xfff0000000000000 => 0xfff0000000000000 - FISTP 0x7ff0000000000000 => word: 8000 FISTP 0xfff0000000000000 => word: 8000 - FISTP 0x7ff0000000000000 => long: 80000000 FISTP 0xfff0000000000000 => long: 80000000 - FISTP 0x7ff0000000000000 => quad: 8000000000000000 FISTP 0xfff0000000000000 => quad: 8000000000000000 - FISTTP 0x7ff0000000000000 => word: 8000 FISTTP 0xfff0000000000000 => word: 8000 - FISTTP 0x7ff0000000000000 => long: 80000000 FISTTP 0xfff0000000000000 => long: 80000000 - FISTTP 0x7ff0000000000000 => quad: 8000000000000000 FISTTP 0xfff0000000000000 => quad: 8000000000000000 Rounding 1 - FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 FRNDINT 0xfff0000000000000 => 0xfff0000000000000 - FISTP 0x7ff0000000000000 => word: 8000 FISTP 0xfff0000000000000 => word: 8000 - FISTP 0x7ff0000000000000 => long: 80000000 FISTP 0xfff0000000000000 => long: 80000000 - FISTP 0x7ff0000000000000 => quad: 8000000000000000 FISTP 0xfff0000000000000 => quad: 8000000000000000 - FISTTP 0x7ff0000000000000 => word: 8000 FISTTP 0xfff0000000000000 => word: 8000 - FISTTP 0x7ff0000000000000 => long: 80000000 FISTTP 0xfff0000000000000 => long: 80000000 - FISTTP 0x7ff0000000000000 => quad: 8000000000000000 FISTTP 0xfff0000000000000 => quad: 8000000000000000 Rounding 2 - FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 FRNDINT 0xfff0000000000000 => 0xfff0000000000000 - FISTP 0x7ff0000000000000 => word: 8000 FISTP 0xfff0000000000000 => word: 8000 - FISTP 0x7ff0000000000000 => long: 80000000 FISTP 0xfff0000000000000 => long: 80000000 - FISTP 0x7ff0000000000000 => quad: 8000000000000000 FISTP 0xfff0000000000000 => quad: 8000000000000000 - FISTTP 0x7ff0000000000000 => word: 8000 FISTTP 0xfff0000000000000 => word: 8000 - FISTTP 0x7ff0000000000000 => long: 80000000 FISTTP 0xfff0000000000000 => long: 80000000 - FISTTP 0x7ff0000000000000 => quad: 8000000000000000 FISTTP 0xfff0000000000000 => quad: 8000000000000000 -FUCOMI 0x3ff0002ca0000000 0xaeff000025000000 --- -FUCOMPP 0x3ff0002ca0000000 0xaeff000025000000 --- Rounding 0 FRNDINT 0x3ff0002ca0000000 => 0x3ff0000000000000 - FRNDINT 0xaeff000025000000 => 0x8000000000000000 FISTP 0x3ff0002ca0000000 => word: 1 - FISTP 0xaeff000025000000 => word: 0 FISTP 0x3ff0002ca0000000 => long: 1 - FISTP 0xaeff000025000000 => long: 0 FISTP 0x3ff0002ca0000000 => quad: 1 - FISTP 0xaeff000025000000 => quad: 0 FISTTP 0x3ff0002ca0000000 => word: 1 - FISTTP 0xaeff000025000000 => word: 0 FISTTP 0x3ff0002ca0000000 => long: 1 - FISTTP 0xaeff000025000000 => long: 0 FISTTP 0x3ff0002ca0000000 => quad: 1 - FISTTP 0xaeff000025000000 => quad: 0 Rounding 1 FRNDINT 0x3ff0002ca0000000 => 0x3ff0000000000000 - FRNDINT 0xaeff000025000000 => 0xbff0000000000000 FISTP 0x3ff0002ca0000000 => word: 1 - FISTP 0xaeff000025000000 => word: ffff FISTP 0x3ff0002ca0000000 => long: 1 - FISTP 0xaeff000025000000 => long: ffffffff FISTP 0x3ff0002ca0000000 => quad: 1 - FISTP 0xaeff000025000000 => quad: ffffffffffffffff FISTTP 0x3ff0002ca0000000 => word: 1 - FISTTP 0xaeff000025000000 => word: 0 FISTTP 0x3ff0002ca0000000 => long: 1 - FISTTP 0xaeff000025000000 => long: 0 FISTTP 0x3ff0002ca0000000 => quad: 1 - FISTTP 0xaeff000025000000 => quad: 0 Rounding 2 FRNDINT 0x3ff0002ca0000000 => 0x4000000000000000 - FRNDINT 0xaeff000025000000 => 0x8000000000000000 FISTP 0x3ff0002ca0000000 => word: 2 - FISTP 0xaeff000025000000 => word: 0 FISTP 0x3ff0002ca0000000 => long: 2 - FISTP 0xaeff000025000000 => long: 0 FISTP 0x3ff0002ca0000000 => quad: 2 - FISTP 0xaeff000025000000 => quad: 0 FISTTP 0x3ff0002ca0000000 => word: 1 - FISTTP 0xaeff000025000000 => word: 0 FISTTP 0x3ff0002ca0000000 => long: 1 - FISTTP 0xaeff000025000000 => long: 0 FISTTP 0x3ff0002ca0000000 => quad: 1 - FISTTP 0xaeff000025000000 => quad: 0 -FUCOMI 0xaeff000025000000 0x3ff0002ca0000000 --C -FUCOMPP 0xaeff000025000000 0x3ff0002ca0000000 --C Rounding 0 FRNDINT 0xaeff000025000000 => 0x8000000000000000 - FRNDINT 0x3ff0002ca0000000 => 0x3ff0000000000000 FISTP 0xaeff000025000000 => word: 0 - FISTP 0x3ff0002ca0000000 => word: 1 FISTP 0xaeff000025000000 => long: 0 - FISTP 0x3ff0002ca0000000 => long: 1 FISTP 0xaeff000025000000 => quad: 0 - FISTP 0x3ff0002ca0000000 => quad: 1 FISTTP 0xaeff000025000000 => word: 0 - FISTTP 0x3ff0002ca0000000 => word: 1 FISTTP 0xaeff000025000000 => long: 0 - FISTTP 0x3ff0002ca0000000 => long: 1 FISTTP 0xaeff000025000000 => quad: 0 - FISTTP 0x3ff0002ca0000000 => quad: 1 Rounding 1 FRNDINT 0xaeff000025000000 => 0xbff0000000000000 - FRNDINT 0x3ff0002ca0000000 => 0x3ff0000000000000 FISTP 0xaeff000025000000 => word: ffff - FISTP 0x3ff0002ca0000000 => word: 1 FISTP 0xaeff000025000000 => long: ffffffff - FISTP 0x3ff0002ca0000000 => long: 1 FISTP 0xaeff000025000000 => quad: ffffffffffffffff - FISTP 0x3ff0002ca0000000 => quad: 1 FISTTP 0xaeff000025000000 => word: 0 - FISTTP 0x3ff0002ca0000000 => word: 1 FISTTP 0xaeff000025000000 => long: 0 - FISTTP 0x3ff0002ca0000000 => long: 1 FISTTP 0xaeff000025000000 => quad: 0 - FISTTP 0x3ff0002ca0000000 => quad: 1 Rounding 2 FRNDINT 0xaeff000025000000 => 0x8000000000000000 - FRNDINT 0x3ff0002ca0000000 => 0x4000000000000000 FISTP 0xaeff000025000000 => word: 0 - FISTP 0x3ff0002ca0000000 => word: 2 FISTP 0xaeff000025000000 => long: 0 - FISTP 0x3ff0002ca0000000 => long: 2 FISTP 0xaeff000025000000 => quad: 0 - FISTP 0x3ff0002ca0000000 => quad: 2 FISTTP 0xaeff000025000000 => word: 0 - FISTTP 0x3ff0002ca0000000 => word: 1 FISTTP 0xaeff000025000000 => long: 0 - FISTTP 0x3ff0002ca0000000 => long: 1 FISTTP 0xaeff000025000000 => quad: 0 - FISTTP 0x3ff0002ca0000000 => quad: 1 -FUCOMI 0x3ff0000050000000 0xc082c00000000000 --- -FUCOMPP 0x3ff0000050000000 0xc082c00000000000 --- Rounding 0 FRNDINT 0x3ff0000050000000 => 0x3ff0000000000000 - FRNDINT 0xc082c00000000000 => 0xc082c00000000000 FISTP 0x3ff0000050000000 => word: 1 - FISTP 0xc082c00000000000 => word: fda8 FISTP 0x3ff0000050000000 => long: 1 - FISTP 0xc082c00000000000 => long: fffffda8 FISTP 0x3ff0000050000000 => quad: 1 - FISTP 0xc082c00000000000 => quad: fffffffffffffda8 FISTTP 0x3ff0000050000000 => word: 1 - FISTTP 0xc082c00000000000 => word: fda8 FISTTP 0x3ff0000050000000 => long: 1 - FISTTP 0xc082c00000000000 => long: fffffda8 FISTTP 0x3ff0000050000000 => quad: 1 - FISTTP 0xc082c00000000000 => quad: fffffffffffffda8 Rounding 1 FRNDINT 0x3ff0000050000000 => 0x3ff0000000000000 - FRNDINT 0xc082c00000000000 => 0xc082c00000000000 FISTP 0x3ff0000050000000 => word: 1 - FISTP 0xc082c00000000000 => word: fda8 FISTP 0x3ff0000050000000 => long: 1 - FISTP 0xc082c00000000000 => long: fffffda8 FISTP 0x3ff0000050000000 => quad: 1 - FISTP 0xc082c00000000000 => quad: fffffffffffffda8 FISTTP 0x3ff0000050000000 => word: 1 - FISTTP 0xc082c00000000000 => word: fda8 FISTTP 0x3ff0000050000000 => long: 1 - FISTTP 0xc082c00000000000 => long: fffffda8 FISTTP 0x3ff0000050000000 => quad: 1 - FISTTP 0xc082c00000000000 => quad: fffffffffffffda8 Rounding 2 FRNDINT 0x3ff0000050000000 => 0x4000000000000000 - FRNDINT 0xc082c00000000000 => 0xc082c00000000000 FISTP 0x3ff0000050000000 => word: 2 - FISTP 0xc082c00000000000 => word: fda8 FISTP 0x3ff0000050000000 => long: 2 - FISTP 0xc082c00000000000 => long: fffffda8 FISTP 0x3ff0000050000000 => quad: 2 - FISTP 0xc082c00000000000 => quad: fffffffffffffda8 FISTTP 0x3ff0000050000000 => word: 1 - FISTTP 0xc082c00000000000 => word: fda8 FISTTP 0x3ff0000050000000 => long: 1 - FISTTP 0xc082c00000000000 => long: fffffda8 FISTTP 0x3ff0000050000000 => quad: 1 - FISTTP 0xc082c00000000000 => quad: fffffffffffffda8 -FUCOMI 0xc082c00000000000 0x3ff0000050000000 --C -FUCOMPP 0xc082c00000000000 0x3ff0000050000000 --C Rounding 0 FRNDINT 0xc082c00000000000 => 0xc082c00000000000 - FRNDINT 0x3ff0000050000000 => 0x3ff0000000000000 FISTP 0xc082c00000000000 => word: fda8 - FISTP 0x3ff0000050000000 => word: 1 FISTP 0xc082c00000000000 => long: fffffda8 - FISTP 0x3ff0000050000000 => long: 1 FISTP 0xc082c00000000000 => quad: fffffffffffffda8 - FISTP 0x3ff0000050000000 => quad: 1 FISTTP 0xc082c00000000000 => word: fda8 - FISTTP 0x3ff0000050000000 => word: 1 FISTTP 0xc082c00000000000 => long: fffffda8 - FISTTP 0x3ff0000050000000 => long: 1 FISTTP 0xc082c00000000000 => quad: fffffffffffffda8 - FISTTP 0x3ff0000050000000 => quad: 1 Rounding 1 FRNDINT 0xc082c00000000000 => 0xc082c00000000000 - FRNDINT 0x3ff0000050000000 => 0x3ff0000000000000 FISTP 0xc082c00000000000 => word: fda8 - FISTP 0x3ff0000050000000 => word: 1 FISTP 0xc082c00000000000 => long: fffffda8 - FISTP 0x3ff0000050000000 => long: 1 FISTP 0xc082c00000000000 => quad: fffffffffffffda8 - FISTP 0x3ff0000050000000 => quad: 1 FISTTP 0xc082c00000000000 => word: fda8 - FISTTP 0x3ff0000050000000 => word: 1 FISTTP 0xc082c00000000000 => long: fffffda8 - FISTTP 0x3ff0000050000000 => long: 1 FISTTP 0xc082c00000000000 => quad: fffffffffffffda8 - FISTTP 0x3ff0000050000000 => quad: 1 Rounding 2 FRNDINT 0xc082c00000000000 => 0xc082c00000000000 - FRNDINT 0x3ff0000050000000 => 0x4000000000000000 FISTP 0xc082c00000000000 => word: fda8 - FISTP 0x3ff0000050000000 => word: 2 FISTP 0xc082c00000000000 => long: fffffda8 - FISTP 0x3ff0000050000000 => long: 2 FISTP 0xc082c00000000000 => quad: fffffffffffffda8 - FISTP 0x3ff0000050000000 => quad: 2 FISTTP 0xc082c00000000000 => word: fda8 - FISTTP 0x3ff0000050000000 => word: 1 FISTTP 0xc082c00000000000 => long: fffffda8 - FISTTP 0x3ff0000050000000 => long: 1 FISTTP 0xc082c00000000000 => quad: fffffffffffffda8 - FISTTP 0x3ff0000050000000 => quad: 1 -FUCOMI 0x0 0x7ff8000000000001 ZPC -FUCOMPP 0x0 0x7ff8000000000001 ZPC -Rounding 0 - FRNDINT 0x0 => 0x0 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FISTP 0x0 => word: 0 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x0 => long: 0 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x0 => quad: 0 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x0 => word: 0 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x0 => long: 0 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x0 => quad: 0 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 -Rounding 1 - FRNDINT 0x0 => 0x0 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FISTP 0x0 => word: 0 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x0 => long: 0 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x0 => quad: 0 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x0 => word: 0 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x0 => long: 0 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x0 => quad: 0 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 -Rounding 2 - FRNDINT 0x0 => 0x0 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FISTP 0x0 => word: 0 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x0 => long: 0 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x0 => quad: 0 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x0 => word: 0 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x0 => long: 0 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x0 => quad: 0 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 -FUCOMI 0x7ff8000000000001 0x0 ZPC -FUCOMPP 0x7ff8000000000001 0x0 ZPC -Rounding 0 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FRNDINT 0x0 => 0x0 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x0 => word: 0 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x0 => long: 0 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTP 0x0 => quad: 0 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x0 => word: 0 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x0 => long: 0 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x0 => quad: 0 -Rounding 1 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FRNDINT 0x0 => 0x0 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x0 => word: 0 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x0 => long: 0 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTP 0x0 => quad: 0 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x0 => word: 0 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x0 => long: 0 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x0 => quad: 0 -Rounding 2 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FRNDINT 0x0 => 0x0 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x0 => word: 0 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x0 => long: 0 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTP 0x0 => quad: 0 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x0 => word: 0 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x0 => long: 0 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x0 => quad: 0 -FUCOMI 0x7ff8000000000001 0x7ff8000000000001 ZPC -FUCOMPP 0x7ff8000000000001 0x7ff8000000000001 ZPC -Rounding 0 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 -Rounding 1 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 -Rounding 2 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 -FUCOMI 0x7ff8000000000001 0x7ff8000000000001 ZPC -FUCOMPP 0x7ff8000000000001 0x7ff8000000000001 ZPC Rounding 0 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x7ff8000000000001 => long: 80000000 FISTP 0x7ff8000000000001 => long: 80000000 FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x7ff8000000000001 => word: 8000 FISTTP 0x7ff8000000000001 => word: 8000 FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 FISTTP 0x7ff8000000000001 => quad: 8000000000000000 Rounding 1 FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 - FISTP 0x7ff8000000000001 => word: 8000 FISTP 0x7ff8000000000001 => word: 8000 FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x7ff8000000000001 => long: 80000000 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 FISTP 0x7ff8000000000001 => quad: 8000000000000000 FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x7ff8000000000001 => word: 8000 - FISTTP 0x7ff8000000000001 => long: 80000000 FISTTP 0x7ff8000000000001 => long: 80000000 FISTTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 Rounding 2 - FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x7ff8000000000001 => word: 8000 - FISTP 0x7ff8000000000001 => long: 80000000 FISTP 0x7ff8000000000001 => long: 80000000 FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTP 0x7ff8000000000001 => quad: 8000000000000000 - FISTTP 0x7ff8000000000001 => word: 8000 FISTTP 0x7ff8000000000001 => word: 8000 FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x7ff8000000000001 => long: 80000000 - FISTTP 0x7ff8000000000001 => quad: 8000000000000000 FISTTP 0x7ff8000000000001 => quad: 8000000000000000 Done diff --git a/tests/ref30.txt b/tests/ref30.txt index f2689e4..7fe476b 100644 --- a/tests/ref30.txt +++ b/tests/ref30.txt @@ -161,7 +161,12 @@ phsubw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff psignb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x80 0x7f 0x0 0x1 0xfe 0xfd 0x0 0xfe 0x84 0x8e 0x52 0xa5 0x0 0xc0 0x32 psignw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x1 0x8000 0x8001 0x0 0x1 0xfffe 0xfffd 0x7fff psignd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x80000000 0x7fffffff 0x0 +pmulhrsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x8000 0x7ffe 0x0 0x0 0x0 0x0 0x7ffe pmulhrsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x1 0x8001 0xffff 0x0 0x0 0xfffe 0x0 0x7ffe +pmulhrsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xffff 0xffe0 0x7eff 0x0 0xffff 0xffff 0x0 0x7ff7 +pmulhrsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x7ffe 0x0 0x0 0x0 0x6200 0x0 0x7ffe +pmulhrsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xffff 0xffe0 0x7eff 0x0 0xffff 0xffff 0x0 0x7ff7 +pmulhrsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7ffc 0x0 0x7e02 0x0 0x8000 0x4788 0x0 0x7ff0 pblendvps(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0xffffffff 0x80000000 0x5 0x0 ptestz(0x80000000ffffffff 0x7fffffff , 0x8000000000000001 0xfffffffe00000005 ) = 0 ptestc(0x80000000ffffffff 0x7fffffff , 0x8000000000000001 0xfffffffe00000005 ) = 0 @@ -181,18 +186,114 @@ pmovzxbq(0xffffffffffffffff 0x8000000000000000 ) = 0xff 0xff pmovzxwd(0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffff 0xffff 0x0 0x8000 pmovzxwq(0xffffffffffffffff 0x8000000000000000 ) = 0xffff 0xffff pmovzxdq(0xffffffffffffffff 0x8000000000000000 ) = 0xffffffff 0xffffffff +pminsd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0x80000000 0x7fffffff 0x0 pminsd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x80000000 0x5 0xfffffffe +pminsd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0xffffffff 0x80000000 0x80000005 0x0 +pminsd(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0x80000000 0x5 0xfffffffe +pminsd(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x1 0x80000000 0x5 0xfffffffe +pminsd(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x1 0x80000000 0x80000005 0xfffffffe +pminsd(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0x80000000 0x80000005 0x0 +pminsd(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x1 0x80000000 0x80000005 0xfffffffe +pminsd(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x1 0x80000000 0x80000005 0xfffe +pmaxsd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0x80000000 0x7fffffff 0x0 pmaxsd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x1 0x80000000 0x7fffffff 0x0 +pmaxsd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0x1 0x80000000 0x7fffffff 0xfffe +pmaxsd(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x1 0x80000000 0x7fffffff 0x0 +pmaxsd(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x1 0x80000000 0x5 0xfffffffe +pmaxsd(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x1 0x80000000 0x5 0xfffe +pmaxsd(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x1 0x80000000 0x7fffffff 0xfffe +pmaxsd(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x1 0x80000000 0x5 0xfffe +pmaxsd(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x1 0x80000000 0x80000005 0xfffe +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +pblendw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 0) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pblendw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 0) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pblendw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 0) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pblendw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 0) = 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +pblendw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 0) = 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +pblendw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 0) = 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 255) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 255) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 255) = 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +pblendw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 255) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +pblendw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 255) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pblendw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 255) = 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +pblendw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 255) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +pblendw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 255) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pblendw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 255) = 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 170) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 170) = 0xffff 0x7fff 0x7fff 0xffff 0x1 0x9000 0x3 0x8001 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 170) = 0xffff 0x20 0x7fff 0x1 0x1 0xa050 0x3 0x8008 +pblendw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 170) = 0x8000 0x8000 0xffff 0x0 0x50 0x2 0xfffe 0x8001 +pblendw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 170) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pblendw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 170) = 0x8000 0x20 0xffff 0x1 0x50 0xa050 0xfffe 0x8008 +pblendw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 170) = 0x7ffe 0x8000 0x7f00 0x0 0x8000 0x2 0xfff1 0x8001 +pblendw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 170) = 0x7ffe 0x7fff 0x7f00 0xffff 0x8000 0x9000 0xfff1 0x8001 +pblendw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 170) = 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 2) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 2) = 0xffff 0x7fff 0x7fff 0x0 0x1 0x2 0x3 0x8001 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 2) = 0xffff 0x20 0x7fff 0x0 0x1 0x2 0x3 0x8001 +pblendw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 2) = 0x8000 0x8000 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pblendw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 2) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pblendw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 2) = 0x8000 0x20 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pblendw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 2) = 0x7ffe 0x8000 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +pblendw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 2) = 0x7ffe 0x7fff 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +pblendw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 2) = 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 0) = 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0) = 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 0) = 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 0) = 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0) = 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 0) = 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 0) = 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0) = 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 0) = 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 2) = 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 0xff 0x80 palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 2) = 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0xff 0x80 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 2) = 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 0xff 0x80 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 2) = 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 0x0 0x1 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 2) = 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0x0 0x1 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 2) = 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 0x0 0x1 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 2) = 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 0xfe 0x7e +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 2) = 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0xfe 0x7e +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 2) = 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 0xfe 0x7e +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 7) = 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 7) = 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 7) = 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 7) = 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 0x0 0x1 0x5 0x15 0x20 0x80 0xff +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 7) = 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0x0 0x1 0x5 0x15 0x20 0x80 0xff +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 7) = 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 0x0 0x1 0x5 0x15 0x20 0x80 0xff +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 7) = 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 7) = 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 7) = 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 15) = 0x32 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 15) = 0x1 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 15) = 0x21 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 15) = 0x32 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 15) = 0x1 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 15) = 0x21 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 15) = 0x32 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 15) = 0x1 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 15) = 0x21 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 16) = 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 16) = 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 16) = 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 16) = 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 16) = 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 16) = 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 16) = 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 16) = 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 16) = 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +palignr(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +palignr(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 movmskpd(0xffffffffffffffff 0x8000000000000000 ) = 0x3 psqrtpd(1 2 ) = 1 1.41421 psqrtpd(0 -2 ) = 0 0xfff8000000000000 @@ -204,444 +305,1665 @@ andpd(1 2 , 0x7ff8000000000000 -0 ) = 1 0 andpd(0 -2 , 0x7ff8000000000000 -0 ) = 0 -0 andpd(inf -inf , 0x7ff8000000000000 -0 ) = inf -0 andpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +andpd(1 2 , -2 0 ) = 0 0 +andpd(0 -2 , -inf inf ) = 0 2 +andpd(1 2 , -0 0x7ff8000000000000 ) = 0 2 +andpd(0 -2 , -0 0x7ff8000000000000 ) = 0 2 +andpd(inf -inf , -0 0x7ff8000000000000 ) = 0 inf +andpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = 0 0 andnpd(1 2 , 0 -2 ) = 0 -0 andnpd(0 -2 , inf -inf ) = inf 1 andnpd(1 2 , 0x7ff8000000000000 -0 ) = 3 -0 andnpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0 andnpd(inf -inf , 0x7ff8000000000000 -0 ) = 1.11254e-308 0 andnpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0 0 +andnpd(1 2 , -2 0 ) = -2 0 +andnpd(0 -2 , -inf inf ) = -inf 1 +andnpd(1 2 , -0 0x7ff8000000000000 ) = -0 1.5 +andnpd(0 -2 , -0 0x7ff8000000000000 ) = -0 1.5 +andnpd(inf -inf , -0 0x7ff8000000000000 ) = -0 1.11254e-308 +andnpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = -0 0x7ff8000000000000 orpd(1 2 , 0 -2 ) = 1 -2 orpd(0 -2 , inf -inf ) = inf -inf orpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 orpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 orpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf orpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +orpd(1 2 , -2 0 ) = -inf 2 +orpd(0 -2 , -inf inf ) = -inf -inf +orpd(1 2 , -0 0x7ff8000000000000 ) = -1 0x7ff8000000000000 +orpd(0 -2 , -0 0x7ff8000000000000 ) = -0 0xfff8000000000000 +orpd(inf -inf , -0 0x7ff8000000000000 ) = -inf 0xfff8000000000000 +orpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = 0xfff8000000000000 0xfff8000000000000 xorpd(1 2 , 0 -2 ) = 1 -0 xorpd(0 -2 , inf -inf ) = inf 1 xorpd(1 2 , 0x7ff8000000000000 -0 ) = 3 -2 xorpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 xorpd(inf -inf , 0x7ff8000000000000 -0 ) = 1.11254e-308 inf xorpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0 0 +xorpd(1 2 , -2 0 ) = -inf 2 +xorpd(0 -2 , -inf inf ) = -inf -1 +xorpd(1 2 , -0 0x7ff8000000000000 ) = -1 1.5 +xorpd(0 -2 , -0 0x7ff8000000000000 ) = -0 -1.5 +xorpd(inf -inf , -0 0x7ff8000000000000 ) = -inf -1.11254e-308 +xorpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = 0xfff8000000000000 0xfff8000000000000 addpd(1 2 , 0 -2 ) = 1 0 addpd(0 -2 , inf -inf ) = inf -inf addpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 addpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 addpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf addpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +addpd(1 2 , -2 0 ) = -1 2 +addpd(0 -2 , -inf inf ) = -inf inf +addpd(1 2 , -0 0x7ff8000000000000 ) = 1 0x7ff8000000000000 +addpd(0 -2 , -0 0x7ff8000000000000 ) = 0 0x7ff8000000000000 +addpd(inf -inf , -0 0x7ff8000000000000 ) = inf 0x7ff8000000000000 +addpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = 0x7ff8000000000000 0x7ff8000000000000 mulpd(1 2 , 0 -2 ) = 0 -4 mulpd(0 -2 , inf -inf ) = 0xfff8000000000000 inf mulpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 mulpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0 mulpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0xfff8000000000000 mulpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0 +mulpd(1 2 , -2 0 ) = -2 0 +mulpd(0 -2 , -inf inf ) = 0xfff8000000000000 -inf +mulpd(1 2 , -0 0x7ff8000000000000 ) = -0 0x7ff8000000000000 +mulpd(0 -2 , -0 0x7ff8000000000000 ) = -0 0x7ff8000000000000 +mulpd(inf -inf , -0 0x7ff8000000000000 ) = 0xfff8000000000000 0x7ff8000000000000 +mulpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = 0x7ff8000000000000 0x7ff8000000000000 subpd(1 2 , 0 -2 ) = 1 4 subpd(0 -2 , inf -inf ) = -inf inf subpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 subpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 subpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf subpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0 +subpd(1 2 , -2 0 ) = 3 2 +subpd(0 -2 , -inf inf ) = inf -inf +subpd(1 2 , -0 0x7ff8000000000000 ) = 1 0x7ff8000000000000 +subpd(0 -2 , -0 0x7ff8000000000000 ) = 0 0x7ff8000000000000 +subpd(inf -inf , -0 0x7ff8000000000000 ) = inf 0x7ff8000000000000 +subpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = 0x7ff8000000000000 0x7ff8000000000000 minpd(1 2 , 0 -2 ) = 0 -2 minpd(0 -2 , inf -inf ) = 0 -inf minpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 minpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 minpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf minpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +minpd(1 2 , -2 0 ) = -2 0 +minpd(0 -2 , -inf inf ) = -inf -2 +minpd(1 2 , -0 0x7ff8000000000000 ) = -0 0x7ff8000000000000 +minpd(0 -2 , -0 0x7ff8000000000000 ) = -0 0x7ff8000000000000 +minpd(inf -inf , -0 0x7ff8000000000000 ) = -0 0x7ff8000000000000 +minpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = -0 0x7ff8000000000000 divpd(1 2 , 0 -2 ) = inf -1 divpd(0 -2 , inf -inf ) = 0 0 divpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf divpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 inf divpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 inf divpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0xfff8000000000000 +divpd(1 2 , -2 0 ) = -0.5 inf +divpd(0 -2 , -inf inf ) = -0 -0 +divpd(1 2 , -0 0x7ff8000000000000 ) = -inf 0x7ff8000000000000 +divpd(0 -2 , -0 0x7ff8000000000000 ) = 0xfff8000000000000 0x7ff8000000000000 +divpd(inf -inf , -0 0x7ff8000000000000 ) = -inf 0x7ff8000000000000 +divpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = 0x7ff8000000000000 0x7ff8000000000000 maxpd(1 2 , 0 -2 ) = 1 2 maxpd(0 -2 , inf -inf ) = inf -2 maxpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 maxpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 maxpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 maxpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +maxpd(1 2 , -2 0 ) = 1 2 +maxpd(0 -2 , -inf inf ) = 0 inf +maxpd(1 2 , -0 0x7ff8000000000000 ) = 1 0x7ff8000000000000 +maxpd(0 -2 , -0 0x7ff8000000000000 ) = -0 0x7ff8000000000000 +maxpd(inf -inf , -0 0x7ff8000000000000 ) = inf 0x7ff8000000000000 +maxpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = -0 0x7ff8000000000000 +addsubpd(1 2 , 0 -2 ) = 1 0 +addsubpd(0 -2 , inf -inf ) = -inf -inf +addsubpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +addsubpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +addsubpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +addsubpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +addsubpd(1 2 , -2 0 ) = 3 2 +addsubpd(0 -2 , -inf inf ) = inf inf +addsubpd(1 2 , -0 0x7ff8000000000000 ) = 1 0x7ff8000000000000 +addsubpd(0 -2 , -0 0x7ff8000000000000 ) = 0 0x7ff8000000000000 +addsubpd(inf -inf , -0 0x7ff8000000000000 ) = inf 0x7ff8000000000000 +addsubpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = 0x7ff8000000000000 0x7ff8000000000000 +cmppd(1 2 , 0 -2 , 0) = 0 0 +cmppd(0 -2 , inf -inf , 0) = 0 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 0) = 0 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 0) = 0 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 0) = 0 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 0) = 0 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 1) = 0 0 +cmppd(0 -2 , inf -inf , 1) = 0xffffffffffffffff 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 1) = 0 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 1) = 0 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 1) = 0 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 1) = 0 0 +cmppd(1 2 , 0 -2 , 2) = 0 0 +cmppd(0 -2 , inf -inf , 2) = 0xffffffffffffffff 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 2) = 0 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 2) = 0 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 2) = 0 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 2) = 0 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 3) = 0 0 +cmppd(0 -2 , inf -inf , 3) = 0 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 3) = 0xffffffffffffffff 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 3) = 0xffffffffffffffff 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 3) = 0xffffffffffffffff 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 3) = 0xffffffffffffffff 0 +cmppd(1 2 , 0 -2 , 4) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 4) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 4) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 4) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 4) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 4) = 0xffffffffffffffff 0 +cmppd(1 2 , 0 -2 , 5) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 5) = 0 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 5) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 5) = 0xffffffffffffffff 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 5) = 0xffffffffffffffff 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 5) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 6) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 6) = 0 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 6) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 6) = 0xffffffffffffffff 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 6) = 0xffffffffffffffff 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 6) = 0xffffffffffffffff 0 +cmppd(1 2 , 0 -2 , 7) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 7) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 7) = 0 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 7) = 0 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 7) = 0 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 7) = 0 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 8) = 0 0 +cmppd(0 -2 , inf -inf , 8) = 0 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 8) = 0xffffffffffffffff 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 8) = 0xffffffffffffffff 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 8) = 0xffffffffffffffff 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 8) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 9) = 0 0 +cmppd(0 -2 , inf -inf , 9) = 0xffffffffffffffff 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 9) = 0xffffffffffffffff 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 9) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 9) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 9) = 0xffffffffffffffff 0 +cmppd(1 2 , 0 -2 , 10) = 0 0 +cmppd(0 -2 , inf -inf , 10) = 0xffffffffffffffff 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 10) = 0xffffffffffffffff 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 10) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 10) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 10) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 11) = 0 0 +cmppd(0 -2 , inf -inf , 11) = 0 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 11) = 0 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 11) = 0 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 11) = 0 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 11) = 0 0 +cmppd(1 2 , 0 -2 , 12) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 12) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 12) = 0 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 12) = 0 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 12) = 0 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 12) = 0 0 +cmppd(1 2 , 0 -2 , 13) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 13) = 0 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 13) = 0 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 13) = 0 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 13) = 0 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 13) = 0 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 14) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 14) = 0 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 14) = 0 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 14) = 0 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 14) = 0 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 14) = 0 0 +cmppd(1 2 , 0 -2 , 15) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 15) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 15) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 15) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 15) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 15) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 16) = 0 0 +cmppd(0 -2 , inf -inf , 16) = 0 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 16) = 0 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 16) = 0 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 16) = 0 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 16) = 0 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 17) = 0 0 +cmppd(0 -2 , inf -inf , 17) = 0xffffffffffffffff 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 17) = 0 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 17) = 0 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 17) = 0 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 17) = 0 0 +cmppd(1 2 , 0 -2 , 18) = 0 0 +cmppd(0 -2 , inf -inf , 18) = 0xffffffffffffffff 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 18) = 0 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 18) = 0 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 18) = 0 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 18) = 0 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 19) = 0 0 +cmppd(0 -2 , inf -inf , 19) = 0 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 19) = 0xffffffffffffffff 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 19) = 0xffffffffffffffff 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 19) = 0xffffffffffffffff 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 19) = 0xffffffffffffffff 0 +cmppd(1 2 , 0 -2 , 20) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 20) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 20) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 20) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 20) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 20) = 0xffffffffffffffff 0 +cmppd(1 2 , 0 -2 , 21) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 21) = 0 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 21) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 21) = 0xffffffffffffffff 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 21) = 0xffffffffffffffff 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 21) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 22) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 22) = 0 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 22) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 22) = 0xffffffffffffffff 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 22) = 0xffffffffffffffff 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 22) = 0xffffffffffffffff 0 +cmppd(1 2 , 0 -2 , 23) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 23) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 23) = 0 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 23) = 0 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 23) = 0 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 23) = 0 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 24) = 0 0 +cmppd(0 -2 , inf -inf , 24) = 0 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 24) = 0xffffffffffffffff 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 24) = 0xffffffffffffffff 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 24) = 0xffffffffffffffff 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 24) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 25) = 0 0 +cmppd(0 -2 , inf -inf , 25) = 0xffffffffffffffff 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 25) = 0xffffffffffffffff 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 25) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 25) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 25) = 0xffffffffffffffff 0 +cmppd(1 2 , 0 -2 , 26) = 0 0 +cmppd(0 -2 , inf -inf , 26) = 0xffffffffffffffff 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 26) = 0xffffffffffffffff 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 26) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 26) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 26) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 27) = 0 0 +cmppd(0 -2 , inf -inf , 27) = 0 0 +cmppd(1 2 , 0x7ff8000000000000 -0 , 27) = 0 0 +cmppd(0 -2 , 0x7ff8000000000000 -0 , 27) = 0 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 27) = 0 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 27) = 0 0 +cmppd(1 2 , 0 -2 , 28) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 28) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 28) = 0 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 28) = 0 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 28) = 0 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 28) = 0 0 +cmppd(1 2 , 0 -2 , 29) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 29) = 0 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 29) = 0 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 29) = 0 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 29) = 0 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 29) = 0 0xffffffffffffffff +cmppd(1 2 , 0 -2 , 30) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 30) = 0 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 30) = 0 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 30) = 0 0 +cmppd(inf -inf , 0x7ff8000000000000 -0 , 30) = 0 0 +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 30) = 0 0 +cmppd(1 2 , 0 -2 , 31) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , inf -inf , 31) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(1 2 , 0x7ff8000000000000 -0 , 31) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0 -2 , 0x7ff8000000000000 -0 , 31) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(inf -inf , 0x7ff8000000000000 -0 , 31) = 0xffffffffffffffff 0xffffffffffffffff +cmppd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 31) = 0xffffffffffffffff 0xffffffffffffffff +shufpd(1 2 , 0 -2 , 0) = 1 0 +shufpd(0 -2 , inf -inf , 0) = 0 inf +shufpd(1 2 , 0x7ff8000000000000 -0 , 0) = 1 0x7ff8000000000000 +shufpd(0 -2 , 0x7ff8000000000000 -0 , 0) = 0 0x7ff8000000000000 +shufpd(inf -inf , 0x7ff8000000000000 -0 , 0) = inf 0x7ff8000000000000 +shufpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 0) = 0x7ff8000000000000 0x7ff8000000000000 +shufpd(1 2 , 0 -2 , 21) = 2 0 +shufpd(0 -2 , inf -inf , 21) = -2 inf +shufpd(1 2 , 0x7ff8000000000000 -0 , 21) = 2 0x7ff8000000000000 +shufpd(0 -2 , 0x7ff8000000000000 -0 , 21) = -2 0x7ff8000000000000 +shufpd(inf -inf , 0x7ff8000000000000 -0 , 21) = -inf 0x7ff8000000000000 +shufpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 21) = -0 0x7ff8000000000000 +shufpd(1 2 , 0 -2 , 255) = 2 -2 +shufpd(0 -2 , inf -inf , 255) = -2 -inf +shufpd(1 2 , 0x7ff8000000000000 -0 , 255) = 2 -0 +shufpd(0 -2 , 0x7ff8000000000000 -0 , 255) = -2 -0 +shufpd(inf -inf , 0x7ff8000000000000 -0 , 255) = -inf -0 +shufpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 255) = -0 -0 +shufpd(1 2 , 0 -2 , 2) = 1 -2 +shufpd(0 -2 , inf -inf , 2) = 0 -inf +shufpd(1 2 , 0x7ff8000000000000 -0 , 2) = 1 -0 +shufpd(0 -2 , 0x7ff8000000000000 -0 , 2) = 0 -0 +shufpd(inf -inf , 0x7ff8000000000000 -0 , 2) = inf -0 +shufpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 , 2) = 0x7ff8000000000000 -0 +punpcklbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0xff 0x80 0x80 0x7f 0x7f 0x0 0x0 0x1 0x1 0x2 0x2 0x3 0x3 0x81 0x81 punpcklbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x0 0x80 0x1 0x7f 0x5 0x0 0x15 0x1 0x20 0x2 0x80 0x3 0xff 0x81 0x0 +punpcklbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xff 0xfe 0x80 0x7e 0x7f 0x7f 0x0 0x81 0x1 0x10 0x2 0x90 0x3 0xf 0x81 0xf0 +punpcklbw(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x0 0xff 0x1 0x80 0x5 0x7f 0x15 0x0 0x20 0x1 0x80 0x2 0xff 0x3 0x0 0x81 +punpcklbw(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0x1 0x1 0x5 0x5 0x15 0x15 0x20 0x20 0x80 0x80 0xff 0xff 0x0 0x0 +punpcklbw(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x0 0xfe 0x1 0x7e 0x5 0x7f 0x15 0x81 0x20 0x10 0x80 0x90 0xff 0xf 0x0 0xf0 +punpcklbw(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xfe 0xff 0x7e 0x80 0x7f 0x7f 0x81 0x0 0x10 0x1 0x90 0x2 0xf 0x3 0xf0 0x81 +punpcklbw(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xfe 0x0 0x7e 0x1 0x7f 0x5 0x81 0x15 0x10 0x20 0x90 0x80 0xf 0xff 0xf0 0x0 +punpcklbw(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfe 0xfe 0x7e 0x7e 0x7f 0x7f 0x81 0x81 0x10 0x10 0x90 0x90 0xf 0xf 0xf0 0xf0 +punpcklwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0xffff 0x8000 0x8000 0x7fff 0x7fff 0x0 0x0 punpcklwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0x8000 0x8000 0x7fff 0x7fff 0xffff 0x0 0xffff +punpcklwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xffff 0x7ffe 0x8000 0x20 0x7fff 0x7f00 0x0 0x1 +punpcklwd(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x8000 0xffff 0x7fff 0x8000 0xffff 0x7fff 0xffff 0x0 +punpcklwd(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x8000 0x7fff 0x7fff 0xffff 0xffff 0xffff 0xffff +punpcklwd(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x8000 0x7ffe 0x7fff 0x20 0xffff 0x7f00 0xffff 0x1 +punpcklwd(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x7ffe 0xffff 0x20 0x8000 0x7f00 0x7fff 0x1 0x0 +punpcklwd(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7ffe 0x8000 0x20 0x7fff 0x7f00 0xffff 0x1 0xffff +punpcklwd(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7ffe 0x7ffe 0x20 0x20 0x7f00 0x7f00 0x1 0x1 +punpckldq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0xffffffff 0x80000000 0x80000000 punpckldq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x1 0x80000000 0x80000000 +punpckldq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0xffffffff 0x1 0x80000000 0x80000000 +punpckldq(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x1 0xffffffff 0x80000000 0x80000000 +punpckldq(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x1 0x1 0x80000000 0x80000000 +punpckldq(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x1 0x1 0x80000000 0x80000000 +punpckldq(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x1 0xffffffff 0x80000000 0x80000000 +punpckldq(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x1 0x1 0x80000000 0x80000000 +punpckldq(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x1 0x1 0x80000000 0x80000000 +ppacksswb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x80ff 0x7f 0x201 0x8003 0x80ff 0x7f 0x201 0x8003 ppacksswb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x80ff 0x7f 0x201 0x8003 0x7f80 0xffff 0x8050 0x80fe +ppacksswb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x80ff 0x7f 0x201 0x8003 0x207f 0x17f 0x8080 0x80f1 +ppacksswb(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x7f80 0xffff 0x8050 0x80fe 0x80ff 0x7f 0x201 0x8003 +ppacksswb(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7f80 0xffff 0x8050 0x80fe 0x7f80 0xffff 0x8050 0x80fe +ppacksswb(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7f80 0xffff 0x8050 0x80fe 0x207f 0x17f 0x8080 0x80f1 +ppacksswb(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x207f 0x17f 0x8080 0x80f1 0x80ff 0x7f 0x201 0x8003 +ppacksswb(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x207f 0x17f 0x8080 0x80f1 0x7f80 0xffff 0x8050 0x80fe +ppacksswb(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x207f 0x17f 0x8080 0x80f1 0x207f 0x17f 0x8080 0x80f1 +pcmpgtb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 pcmpgtb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0xff 0x0 0x0 0xff 0xff 0x0 0x0 0x0 0xff 0xff 0x0 0x0 0x0 0xff +pcmpgtb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xff 0x0 0x0 0xff 0x0 0xff 0x0 0x0 0xff 0x0 0xff 0xff 0x0 0xff 0x0 0xff +pcmpgtb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0xff 0x0 0xff 0xff 0x0 0x0 0xff 0xff 0xff 0x0 0x0 0xff 0xff 0xff 0x0 +pcmpgtb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpgtb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xff 0x0 0x0 0xff 0xff 0x0 0x0 0xff 0xff 0x0 0x0 0xff 0xff 0xff 0x0 0x0 +pcmpgtb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x0 0xff 0x0 0x0 0xff 0x0 0xff 0xff 0x0 0xff 0x0 0x0 0xff 0x0 0xff 0x0 +pcmpgtb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0xff 0xff 0x0 0x0 0xff 0xff 0x0 0x0 0xff 0xff 0x0 0x0 0x0 0xff 0xff +pcmpgtb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpgtw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 pcmpgtw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0x0 0xffff 0xffff 0x0 0xffff 0xffff 0x0 +pcmpgtw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0xffff 0x0 0xffff 0xffff 0xffff 0x0 +pcmpgtw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0xffff 0x0 0x0 0xffff 0x0 0x0 0x0 +pcmpgtw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpgtw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0xffff 0x0 0x0 0xffff 0x0 0xffff 0x0 +pcmpgtw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0xffff 0x0 0xffff 0x0 0x0 0x0 0xffff +pcmpgtw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0x0 0xffff 0xffff 0x0 0xffff 0x0 0xffff +pcmpgtw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpgtd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0x0 0x0 0x0 pcmpgtd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0xffffffff 0xffffffff +pcmpgtd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0x0 0xffffffff 0x0 +pcmpgtd(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0x0 0x0 0x0 +pcmpgtd(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0x0 +pcmpgtd(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0x0 0xffffffff 0x0 +pcmpgtd(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0x0 0x0 0xffffffff +pcmpgtd(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0xffffffff +pcmpgtd(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0x0 0x0 0x0 +packuswb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0xff 0x201 0x3 0x0 0xff 0x201 0x3 packuswb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0xff 0x201 0x3 0xff00 0x0 0x50 0x0 +packuswb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0xff 0x201 0x3 0x20ff 0x1ff 0x0 0x0 +packuswb(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xff00 0x0 0x50 0x0 0x0 0xff 0x201 0x3 +packuswb(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xff00 0x0 0x50 0x0 0xff00 0x0 0x50 0x0 +packuswb(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xff00 0x0 0x50 0x0 0x20ff 0x1ff 0x0 0x0 +packuswb(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x20ff 0x1ff 0x0 0x0 0x0 0xff 0x201 0x3 +packuswb(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x20ff 0x1ff 0x0 0x0 0xff00 0x0 0x50 0x0 +packuswb(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x20ff 0x1ff 0x0 0x0 0x20ff 0x1ff 0x0 0x0 +punpckhbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xfe 0xfe 0x84 0x84 0x72 0x72 0x52 0x52 0xa5 0xa5 0x0 0x0 0xc0 0xc0 0x32 0x32 punpckhbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xfe 0x8 0x84 0x7 0x72 0x81 0x52 0x6 0xa5 0xa 0x0 0xf 0xc0 0x10 0x32 0x1 +punpckhbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfe 0xf8 0x84 0x77 0x72 0x87 0x52 0xf6 0xa5 0x3 0x0 0xe1 0xc0 0x50 0x32 0x21 +punpckhbw(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x8 0xfe 0x7 0x84 0x81 0x72 0x6 0x52 0xa 0xa5 0xf 0x0 0x10 0xc0 0x1 0x32 +punpckhbw(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x8 0x8 0x7 0x7 0x81 0x81 0x6 0x6 0xa 0xa 0xf 0xf 0x10 0x10 0x1 0x1 +punpckhbw(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x8 0xf8 0x7 0x77 0x81 0x87 0x6 0xf6 0xa 0x3 0xf 0xe1 0x10 0x50 0x1 0x21 +punpckhbw(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xf8 0xfe 0x77 0x84 0x87 0x72 0xf6 0x52 0x3 0xa5 0xe1 0x0 0x50 0xc0 0x21 0x32 +punpckhbw(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xf8 0x8 0x77 0x7 0x87 0x81 0xf6 0x6 0x3 0xa 0xe1 0xf 0x50 0x10 0x21 0x1 +punpckhbw(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xf8 0xf8 0x77 0x77 0x87 0x87 0xf6 0xf6 0x3 0x3 0xe1 0xe1 0x50 0x50 0x21 0x21 +punpckhwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x1 0x1 0x2 0x2 0x3 0x3 0x8001 0x8001 punpckhwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x1 0x50 0x2 0x9000 0x3 0xfffe 0x8001 0x8001 +punpckhwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x1 0x8000 0x2 0xa050 0x3 0xfff1 0x8001 0x8008 +punpckhwd(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x50 0x1 0x9000 0x2 0xfffe 0x3 0x8001 0x8001 +punpckhwd(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x50 0x50 0x9000 0x9000 0xfffe 0xfffe 0x8001 0x8001 +punpckhwd(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x50 0x8000 0x9000 0xa050 0xfffe 0xfff1 0x8001 0x8008 +punpckhwd(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x8000 0x1 0xa050 0x2 0xfff1 0x3 0x8008 0x8001 +punpckhwd(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x50 0xa050 0x9000 0xfff1 0xfffe 0x8008 0x8001 +punpckhwd(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x8000 0x8000 0xa050 0xa050 0xfff1 0xfff1 0x8008 0x8008 +punpckhdq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x7fffffff 0x7fffffff 0x0 0x0 punpckhdq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x7fffffff 0x5 0x0 0xfffffffe +punpckhdq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0x7fffffff 0x80000005 0x0 0xfffe +punpckhdq(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x5 0x7fffffff 0xfffffffe 0x0 +punpckhdq(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x5 0x5 0xfffffffe 0xfffffffe +punpckhdq(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x5 0x80000005 0xfffffffe 0xfffe +punpckhdq(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x80000005 0x7fffffff 0xfffe 0x0 +punpckhdq(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x80000005 0x5 0xfffe 0xfffffffe +punpckhdq(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x80000005 0x80000005 0xfffe 0xfffe +ppackssdw(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x8000ffff 0x7fff 0x8000ffff 0x7fff ppackssdw(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x8000ffff 0x7fff 0x80000001 0xfffe0005 +ppackssdw(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0x8000ffff 0x7fff 0x80000001 0x7fff8000 +ppackssdw(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x80000001 0xfffe0005 0x8000ffff 0x7fff +ppackssdw(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x80000001 0xfffe0005 0x80000001 0xfffe0005 +ppackssdw(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x80000001 0xfffe0005 0x80000001 0x7fff8000 +ppackssdw(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x80000001 0x7fff8000 0x8000ffff 0x7fff +ppackssdw(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x80000001 0x7fff8000 0x80000001 0xfffe0005 +ppackssdw(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x80000001 0x7fff8000 0x80000001 0x7fff8000 +punpcklqdq(0xffffffffffffffff 0x8000000000000000 , 0xffffffffffffffff 0x8000000000000000 ) = 0xffffffffffffffff 0xffffffffffffffff punpcklqdq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0xffffffffffffffff 0x1 +punpcklqdq(0xffffffffffffffff 0x8000000000000000 , 0x7fffffffffffffff 0x4 ) = 0xffffffffffffffff 0x7fffffffffffffff +punpcklqdq(0x1 0x8000000000000000 , 0xffffffffffffffff 0x8000000000000000 ) = 0x1 0xffffffffffffffff +punpcklqdq(0x1 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x1 0x1 +punpcklqdq(0x1 0x8000000000000000 , 0x7fffffffffffffff 0x4 ) = 0x1 0x7fffffffffffffff +punpcklqdq(0x7fffffffffffffff 0x4 , 0xffffffffffffffff 0x8000000000000000 ) = 0x7fffffffffffffff 0xffffffffffffffff +punpcklqdq(0x7fffffffffffffff 0x4 , 0x1 0x8000000000000000 ) = 0x7fffffffffffffff 0x1 +punpcklqdq(0x7fffffffffffffff 0x4 , 0x7fffffffffffffff 0x4 ) = 0x7fffffffffffffff 0x7fffffffffffffff +punpckhqdq(0xffffffffffffffff 0x8000000000000000 , 0xffffffffffffffff 0x8000000000000000 ) = 0x8000000000000000 0x8000000000000000 punpckhqdq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x8000000000000000 0x8000000000000000 +punpckhqdq(0xffffffffffffffff 0x8000000000000000 , 0x7fffffffffffffff 0x4 ) = 0x8000000000000000 0x4 +punpckhqdq(0x1 0x8000000000000000 , 0xffffffffffffffff 0x8000000000000000 ) = 0x8000000000000000 0x8000000000000000 +punpckhqdq(0x1 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x8000000000000000 0x8000000000000000 +punpckhqdq(0x1 0x8000000000000000 , 0x7fffffffffffffff 0x4 ) = 0x8000000000000000 0x4 +punpckhqdq(0x7fffffffffffffff 0x4 , 0xffffffffffffffff 0x8000000000000000 ) = 0x4 0x8000000000000000 +punpckhqdq(0x7fffffffffffffff 0x4 , 0x1 0x8000000000000000 ) = 0x4 0x8000000000000000 +punpckhqdq(0x7fffffffffffffff 0x4 , 0x7fffffffffffffff 0x4 ) = 0x4 0x4 pshufd(0xffffffff 0x80000000 0x7fffffff 0x0 0) = 0xffffffff 0xffffffff 0xffffffff 0xffffffff +pshufd(0x1 0x80000000 0x5 0xfffffffe 0) = 0x1 0x1 0x1 0x1 +pshufd(0x1 0x80000000 0x5 0xfffffffe 0) = 0x1 0x1 0x1 0x1 pshufd(0xffffffff 0x80000000 0x7fffffff 0x0 255) = 0x0 0x0 0x0 0x0 +pshufd(0x1 0x80000000 0x5 0xfffffffe 255) = 0xfffffffe 0xfffffffe 0xfffffffe 0xfffffffe +pshufd(0x1 0x80000000 0x5 0xfffffffe 255) = 0xfffffffe 0xfffffffe 0xfffffffe 0xfffffffe pshufd(0xffffffff 0x80000000 0x7fffffff 0x0 170) = 0x7fffffff 0x7fffffff 0x7fffffff 0x7fffffff +pshufd(0x1 0x80000000 0x5 0xfffffffe 170) = 0x5 0x5 0x5 0x5 +pshufd(0x1 0x80000000 0x5 0xfffffffe 170) = 0x5 0x5 0x5 0x5 pshufd(0xffffffff 0x80000000 0x7fffffff 0x0 2) = 0x7fffffff 0xffffffff 0xffffffff 0xffffffff +pshufd(0x1 0x80000000 0x5 0xfffffffe 2) = 0x5 0x1 0x1 0x1 +pshufd(0x1 0x80000000 0x5 0xfffffffe 2) = 0x5 0x1 0x1 0x1 psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +psrlw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 0) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +psrlw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 0) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 170) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 170) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 170) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 2) = 0x3fff 0x2000 0x1fff 0x0 0x0 0x0 0x0 0x2000 +psrlw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 2) = 0x2000 0x1fff 0x3fff 0x3fff 0x14 0x2400 0x3fff 0x2000 +psrlw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 2) = 0x2000 0x1fff 0x3fff 0x3fff 0x14 0x2400 0x3fff 0x2000 psrld(0xffffffff 0x80000000 0x7fffffff 0x0 0) = 0xffffffff 0x80000000 0x7fffffff 0x0 +psrld(0x1 0x80000000 0x5 0xfffffffe 0) = 0x1 0x80000000 0x5 0xfffffffe +psrld(0x1 0x80000000 0x5 0xfffffffe 0) = 0x1 0x80000000 0x5 0xfffffffe psrld(0xffffffff 0x80000000 0x7fffffff 0x0 255) = 0x0 0x0 0x0 0x0 +psrld(0x1 0x80000000 0x5 0xfffffffe 255) = 0x0 0x0 0x0 0x0 +psrld(0x1 0x80000000 0x5 0xfffffffe 255) = 0x0 0x0 0x0 0x0 psrld(0xffffffff 0x80000000 0x7fffffff 0x0 170) = 0x0 0x0 0x0 0x0 +psrld(0x1 0x80000000 0x5 0xfffffffe 170) = 0x0 0x0 0x0 0x0 +psrld(0x1 0x80000000 0x5 0xfffffffe 170) = 0x0 0x0 0x0 0x0 psrld(0xffffffff 0x80000000 0x7fffffff 0x0 2) = 0x3fffffff 0x20000000 0x1fffffff 0x0 +psrld(0x1 0x80000000 0x5 0xfffffffe 2) = 0x0 0x20000000 0x1 0x3fffffff +psrld(0x1 0x80000000 0x5 0xfffffffe 2) = 0x0 0x20000000 0x1 0x3fffffff psrlq(0xffffffffffffffff 0x8000000000000000 0) = 0xffffffffffffffff 0x8000000000000000 +psrlq(0x1 0x8000000000000000 0) = 0x1 0x8000000000000000 +psrlq(0x1 0x8000000000000000 0) = 0x1 0x8000000000000000 psrlq(0xffffffffffffffff 0x8000000000000000 255) = 0x0 0x0 +psrlq(0x1 0x8000000000000000 255) = 0x0 0x0 +psrlq(0x1 0x8000000000000000 255) = 0x0 0x0 psrlq(0xffffffffffffffff 0x8000000000000000 170) = 0x0 0x0 +psrlq(0x1 0x8000000000000000 170) = 0x0 0x0 +psrlq(0x1 0x8000000000000000 170) = 0x0 0x0 psrlq(0xffffffffffffffff 0x8000000000000000 2) = 0x3fffffffffffffff 0x2000000000000000 +psrlq(0x1 0x8000000000000000 2) = 0x0 0x2000000000000000 +psrlq(0x1 0x8000000000000000 2) = 0x0 0x2000000000000000 psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +psraw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 0) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +psraw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 0) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 255) = 0xffff 0xffff 0x0 0x0 0x0 0x0 0x0 0xffff +psraw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 255) = 0xffff 0x0 0xffff 0xffff 0x0 0xffff 0xffff 0xffff +psraw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 255) = 0xffff 0x0 0xffff 0xffff 0x0 0xffff 0xffff 0xffff psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 170) = 0xffff 0xffff 0x0 0x0 0x0 0x0 0x0 0xffff +psraw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 170) = 0xffff 0x0 0xffff 0xffff 0x0 0xffff 0xffff 0xffff +psraw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 170) = 0xffff 0x0 0xffff 0xffff 0x0 0xffff 0xffff 0xffff psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 2) = 0xffff 0xe000 0x1fff 0x0 0x0 0x0 0x0 0xe000 +psraw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 2) = 0xe000 0x1fff 0xffff 0xffff 0x14 0xe400 0xffff 0xe000 +psraw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 2) = 0xe000 0x1fff 0xffff 0xffff 0x14 0xe400 0xffff 0xe000 psrad(0xffffffff 0x80000000 0x7fffffff 0x0 0) = 0xffffffff 0x80000000 0x7fffffff 0x0 +psrad(0x1 0x80000000 0x5 0xfffffffe 0) = 0x1 0x80000000 0x5 0xfffffffe +psrad(0x1 0x80000000 0x5 0xfffffffe 0) = 0x1 0x80000000 0x5 0xfffffffe psrad(0xffffffff 0x80000000 0x7fffffff 0x0 255) = 0xffffffff 0xffffffff 0x0 0x0 +psrad(0x1 0x80000000 0x5 0xfffffffe 255) = 0x0 0xffffffff 0x0 0xffffffff +psrad(0x1 0x80000000 0x5 0xfffffffe 255) = 0x0 0xffffffff 0x0 0xffffffff psrad(0xffffffff 0x80000000 0x7fffffff 0x0 170) = 0xffffffff 0xffffffff 0x0 0x0 +psrad(0x1 0x80000000 0x5 0xfffffffe 170) = 0x0 0xffffffff 0x0 0xffffffff +psrad(0x1 0x80000000 0x5 0xfffffffe 170) = 0x0 0xffffffff 0x0 0xffffffff psrad(0xffffffff 0x80000000 0x7fffffff 0x0 2) = 0xffffffff 0xe0000000 0x1fffffff 0x0 +psrad(0x1 0x80000000 0x5 0xfffffffe 2) = 0x0 0xe0000000 0x1 0xffffffff +psrad(0x1 0x80000000 0x5 0xfffffffe 2) = 0x0 0xe0000000 0x1 0xffffffff psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +psllw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 0) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +psllw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 0) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 170) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 170) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 170) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 2) = 0xfffc 0x0 0xfffc 0x0 0x4 0x8 0xc 0x4 +psllw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 2) = 0x0 0xfffc 0xfffc 0xfffc 0x140 0x4000 0xfff8 0x4 +psllw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 2) = 0x0 0xfffc 0xfffc 0xfffc 0x140 0x4000 0xfff8 0x4 pslld(0xffffffff 0x80000000 0x7fffffff 0x0 0) = 0xffffffff 0x80000000 0x7fffffff 0x0 +pslld(0x1 0x80000000 0x5 0xfffffffe 0) = 0x1 0x80000000 0x5 0xfffffffe +pslld(0x1 0x80000000 0x5 0xfffffffe 0) = 0x1 0x80000000 0x5 0xfffffffe pslld(0xffffffff 0x80000000 0x7fffffff 0x0 255) = 0x0 0x0 0x0 0x0 +pslld(0x1 0x80000000 0x5 0xfffffffe 255) = 0x0 0x0 0x0 0x0 +pslld(0x1 0x80000000 0x5 0xfffffffe 255) = 0x0 0x0 0x0 0x0 pslld(0xffffffff 0x80000000 0x7fffffff 0x0 170) = 0x0 0x0 0x0 0x0 +pslld(0x1 0x80000000 0x5 0xfffffffe 170) = 0x0 0x0 0x0 0x0 +pslld(0x1 0x80000000 0x5 0xfffffffe 170) = 0x0 0x0 0x0 0x0 pslld(0xffffffff 0x80000000 0x7fffffff 0x0 2) = 0xfffffffc 0x0 0xfffffffc 0x0 +pslld(0x1 0x80000000 0x5 0xfffffffe 2) = 0x4 0x0 0x14 0xfffffff8 +pslld(0x1 0x80000000 0x5 0xfffffffe 2) = 0x4 0x0 0x14 0xfffffff8 psllq(0xffffffffffffffff 0x8000000000000000 0) = 0xffffffffffffffff 0x8000000000000000 +psllq(0x1 0x8000000000000000 0) = 0x1 0x8000000000000000 +psllq(0x1 0x8000000000000000 0) = 0x1 0x8000000000000000 psllq(0xffffffffffffffff 0x8000000000000000 255) = 0x0 0x0 +psllq(0x1 0x8000000000000000 255) = 0x0 0x0 +psllq(0x1 0x8000000000000000 255) = 0x0 0x0 psllq(0xffffffffffffffff 0x8000000000000000 170) = 0x0 0x0 +psllq(0x1 0x8000000000000000 170) = 0x0 0x0 +psllq(0x1 0x8000000000000000 170) = 0x0 0x0 psllq(0xffffffffffffffff 0x8000000000000000 2) = 0xfffffffffffffffc 0x0 +psllq(0x1 0x8000000000000000 2) = 0x4 0x0 +psllq(0x1 0x8000000000000000 2) = 0x4 0x0 +pcmpeqb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff pcmpeqb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpeqb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x0 0x0 0xff 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpeqb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpeqb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff +pcmpeqb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpeqb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x0 0x0 0xff 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpeqb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpeqb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff +pcmpeqw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff pcmpeqw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xffff +pcmpeqw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpeqw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xffff +pcmpeqw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff +pcmpeqw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpeqw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpeqw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpeqw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff +pcmpeqd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0xffffffff 0xffffffff 0xffffffff pcmpeqd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0xffffffff 0x0 0x0 +pcmpeqd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0xffffffff 0x0 0x0 +pcmpeqd(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0xffffffff 0x0 0x0 +pcmpeqd(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0xffffffff 0xffffffff 0xffffffff +pcmpeqd(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0xffffffff 0xffffffff 0x0 0x0 +pcmpeqd(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0xffffffff 0x0 0x0 +pcmpeqd(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0xffffffff 0x0 0x0 +pcmpeqd(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0xffffffff 0xffffffff 0xffffffff 0xffffffff haddpd(1 2 , 0 -2 ) = 3 -2 haddpd(0 -2 , inf -inf ) = -2 0xfff8000000000000 haddpd(1 2 , 0x7ff8000000000000 -0 ) = 3 0x7ff8000000000000 haddpd(0 -2 , 0x7ff8000000000000 -0 ) = -2 0x7ff8000000000000 haddpd(inf -inf , 0x7ff8000000000000 -0 ) = 0xfff8000000000000 0x7ff8000000000000 haddpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0x7ff8000000000000 +haddpd(1 2 , -2 0 ) = 3 -2 +haddpd(0 -2 , -inf inf ) = -2 0xfff8000000000000 +haddpd(1 2 , -0 0x7ff8000000000000 ) = 3 0x7ff8000000000000 +haddpd(0 -2 , -0 0x7ff8000000000000 ) = -2 0x7ff8000000000000 +haddpd(inf -inf , -0 0x7ff8000000000000 ) = 0xfff8000000000000 0x7ff8000000000000 +haddpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = 0x7ff8000000000000 0x7ff8000000000000 +hsubpd(1 2 , 0 -2 ) = -1 2 +hsubpd(0 -2 , inf -inf ) = 2 inf +hsubpd(1 2 , 0x7ff8000000000000 -0 ) = -1 0x7ff8000000000000 +hsubpd(0 -2 , 0x7ff8000000000000 -0 ) = 2 0x7ff8000000000000 +hsubpd(inf -inf , 0x7ff8000000000000 -0 ) = inf 0x7ff8000000000000 +hsubpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0x7ff8000000000000 +hsubpd(1 2 , -2 0 ) = -1 -2 +hsubpd(0 -2 , -inf inf ) = 2 -inf +hsubpd(1 2 , -0 0x7ff8000000000000 ) = -1 0x7ff8000000000000 +hsubpd(0 -2 , -0 0x7ff8000000000000 ) = 2 0x7ff8000000000000 +hsubpd(inf -inf , -0 0x7ff8000000000000 ) = inf 0x7ff8000000000000 +hsubpd(0x7ff8000000000000 -0 , -0 0x7ff8000000000000 ) = 0x7ff8000000000000 0x7ff8000000000000 +psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrld(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0x0 0x0 0x0 psrld(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0x0 +psrld(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0x0 0x0 0x0 +psrld(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0x0 0x0 0x0 +psrld(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0x0 +psrld(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0x0 0x0 0x0 +psrld(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0x0 0x0 0x0 +psrld(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0x0 +psrld(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0x0 0x0 0x0 +psrlq(0xffffffffffffffff 0x8000000000000000 , 0xffffffffffffffff 0x8000000000000000 ) = 0x0 0x0 psrlq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x7fffffffffffffff 0x4000000000000000 +psrlq(0xffffffffffffffff 0x8000000000000000 , 0x7fffffffffffffff 0x4 ) = 0x0 0x0 +psrlq(0x1 0x8000000000000000 , 0xffffffffffffffff 0x8000000000000000 ) = 0x0 0x0 +psrlq(0x1 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x0 0x4000000000000000 +psrlq(0x1 0x8000000000000000 , 0x7fffffffffffffff 0x4 ) = 0x0 0x0 +psrlq(0x7fffffffffffffff 0x4 , 0xffffffffffffffff 0x8000000000000000 ) = 0x0 0x0 +psrlq(0x7fffffffffffffff 0x4 , 0x1 0x8000000000000000 ) = 0x3fffffffffffffff 0x2 +psrlq(0x7fffffffffffffff 0x4 , 0x7fffffffffffffff 0x4 ) = 0x0 0x0 +paddq(0xffffffffffffffff 0x8000000000000000 , 0xffffffffffffffff 0x8000000000000000 ) = 0xfffffffffffffffe 0x0 paddq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x0 0x0 +paddq(0xffffffffffffffff 0x8000000000000000 , 0x7fffffffffffffff 0x4 ) = 0x7ffffffffffffffe 0x8000000000000004 +paddq(0x1 0x8000000000000000 , 0xffffffffffffffff 0x8000000000000000 ) = 0x0 0x0 +paddq(0x1 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x2 0x0 +paddq(0x1 0x8000000000000000 , 0x7fffffffffffffff 0x4 ) = 0x8000000000000000 0x8000000000000004 +paddq(0x7fffffffffffffff 0x4 , 0xffffffffffffffff 0x8000000000000000 ) = 0x7ffffffffffffffe 0x8000000000000004 +paddq(0x7fffffffffffffff 0x4 , 0x1 0x8000000000000000 ) = 0x8000000000000000 0x8000000000000004 +paddq(0x7fffffffffffffff 0x4 , 0x7fffffffffffffff 0x4 ) = 0xfffffffffffffffe 0x8 +pmullw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x1 0x0 0x1 0x0 0x1 0x4 0x9 0x1 pmullw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x8000 0x8001 0x0 0x50 0x2000 0xfffa 0x1 +pmullw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x8002 0x0 0x8100 0x0 0x8000 0x40a0 0xffd3 0x8008 +pmullw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x8000 0x8000 0x8001 0x0 0x50 0x2000 0xfffa 0x1 +pmullw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x1 0x1 0x1 0x1900 0x0 0x4 0x1 +pmullw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0xffe0 0x8100 0xffff 0x0 0x0 0x1e 0x8008 +pmullw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x8002 0x0 0x8100 0x0 0x8000 0x40a0 0xffd3 0x8008 +pmullw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0xffe0 0x8100 0xffff 0x0 0x0 0x1e 0x8008 +pmullw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x4 0x400 0x0 0x1 0x0 0x1900 0xe1 0x40 +psubusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psubusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x7f 0x7a 0x0 0x0 0x0 0x0 0x81 0xf6 0x7d 0x0 0x4c 0x9b 0x0 0xb0 0x31 +psubusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x1 0x2 0x0 0x0 0x0 0x0 0x0 0x0 0x6 0xd 0x0 0x0 0xa2 0x0 0x70 0x11 +psubusb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x0 0x0 0x0 0x15 0x1f 0x7e 0xfc 0x0 0x0 0x0 0xf 0x0 0x0 0xf 0x0 0x0 +psubusb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psubusb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x0 0x0 0x0 0x0 0x10 0x0 0xf0 0x0 0x0 0x0 0x0 0x0 0x7 0x0 0x0 0x0 +psubusb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x0 0x0 0x0 0x81 0xf 0x8e 0xc 0x6f 0x0 0x0 0x15 0xa4 0x0 0xe1 0x0 0x0 +psubusb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xfe 0x7d 0x7a 0x6c 0x0 0x10 0x0 0xf0 0xf0 0x70 0x6 0xf0 0x0 0xd2 0x40 0x20 +psubusb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psubusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psubusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x1 0x0 0x0 0x0 0x0 0x0 0x0 +psubusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x8001 0x7fe0 0xff 0x0 0x0 0x0 0x0 0x0 +psubusw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x8000 0xffff 0x4f 0x8ffe 0xfffb 0x0 +psubusw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psubusw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x2 0x7fdf 0x80ff 0xfffe 0x0 0x0 0xd 0x0 +psubusw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x1 0x7fff 0xa04e 0xffee 0x7 +psubusw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x7fb0 0x1050 0x0 0x7 +psubusw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pminub(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 pminub(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x1 0x5 0x0 0x1 0x2 0x3 0x0 0x8 0x7 0x72 0x6 0xa 0x0 0x10 0x1 +pminub(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfe 0x7e 0x7f 0x0 0x1 0x2 0x3 0x81 0xf8 0x77 0x72 0x52 0x3 0x0 0x50 0x21 +pminub(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x0 0x1 0x5 0x0 0x1 0x2 0x3 0x0 0x8 0x7 0x72 0x6 0xa 0x0 0x10 0x1 +pminub(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 +pminub(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x0 0x1 0x5 0x15 0x10 0x80 0xf 0x0 0x8 0x7 0x81 0x6 0x3 0xf 0x10 0x1 +pminub(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xfe 0x7e 0x7f 0x0 0x1 0x2 0x3 0x81 0xf8 0x77 0x72 0x52 0x3 0x0 0x50 0x21 +pminub(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x1 0x5 0x15 0x10 0x80 0xf 0x0 0x8 0x7 0x81 0x6 0x3 0xf 0x10 0x1 +pminub(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 +pand(0x81030201007f80ff 0x32c000a5527284fe , 0x81030201007f80ff 0x32c000a5527284fe ) = 0x81030201007f80ff 0x32c000a5527284fe pand(0x81030201007f80ff 0x32c000a5527284fe , 0xff802015050100 0x1100f0a06810708 ) = 0x3000000050000 0x2000408 +pand(0x81030201007f80ff 0x32c000a5527284fe , 0xf00f9010817f7efe 0x2150e103f68777f8 ) = 0x80030000007f00fe 0x20400001520204f8 +pand(0xff802015050100 0x1100f0a06810708 , 0x81030201007f80ff 0x32c000a5527284fe ) = 0x3000000050000 0x2000408 +pand(0xff802015050100 0x1100f0a06810708 , 0xff802015050100 0x1100f0a06810708 ) = 0xff802015050100 0x1100f0a06810708 +pand(0xff802015050100 0x1100f0a06810708 , 0xf00f9010817f7efe 0x2150e103f68777f8 ) = 0xf800001050000 0x110010206810708 +pand(0xf00f9010817f7efe 0x2150e103f68777f8 , 0x81030201007f80ff 0x32c000a5527284fe ) = 0x80030000007f00fe 0x20400001520204f8 +pand(0xf00f9010817f7efe 0x2150e103f68777f8 , 0xff802015050100 0x1100f0a06810708 ) = 0xf800001050000 0x110010206810708 +pand(0xf00f9010817f7efe 0x2150e103f68777f8 , 0xf00f9010817f7efe 0x2150e103f68777f8 ) = 0xf00f9010817f7efe 0x2150e103f68777f8 +paddusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0xff 0xfe 0x0 0x2 0x4 0x6 0xff 0xff 0xff 0xe4 0xa4 0xff 0x0 0xff 0x64 paddusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x81 0x84 0x15 0x21 0x82 0xff 0x81 0xff 0x8b 0xf3 0x58 0xaf 0xf 0xd0 0x33 +paddusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xff 0xfe 0xfe 0x81 0x11 0x92 0x12 0xff 0xff 0xfb 0xf9 0xff 0xa8 0xe1 0xff 0x53 +paddusb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0x81 0x84 0x15 0x21 0x82 0xff 0x81 0xff 0x8b 0xf3 0x58 0xaf 0xf 0xd0 0x33 +paddusb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x2 0xa 0x2a 0x40 0xff 0xff 0x0 0x10 0xe 0xff 0xc 0x14 0x1e 0x20 0x2 +paddusb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfe 0x7f 0x84 0x96 0x30 0xff 0xff 0xf0 0xff 0x7e 0xff 0xfc 0xd 0xf0 0x60 0x22 +paddusb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0xfe 0xfe 0x81 0x11 0x92 0x12 0xff 0xff 0xfb 0xf9 0xff 0xa8 0xe1 0xff 0x53 +paddusb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xfe 0x7f 0x84 0x96 0x30 0xff 0xff 0xf0 0xff 0x7e 0xff 0xfc 0xd 0xf0 0x60 0x22 +paddusb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xff 0xfc 0xfe 0xff 0x20 0xff 0x1e 0xff 0xff 0xee 0xff 0xff 0x6 0xff 0xa0 0x42 +paddusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0xffff 0xfffe 0x0 0x2 0x4 0x6 0xffff paddusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0xffff 0xffff 0xffff 0x51 0x9002 0xffff 0xffff +paddusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xffff 0x8020 0xfeff 0x1 0x8001 0xa052 0xfff4 0xffff +paddusw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0xffff 0xffff 0xffff 0x51 0x9002 0xffff 0xffff +paddusw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0xfffe 0xffff 0xffff 0xa0 0xffff 0xffff 0xffff +paddusw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xfffe 0x801f 0xffff 0xffff 0x8050 0xffff 0xffff 0xffff +paddusw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0x8020 0xfeff 0x1 0x8001 0xa052 0xfff4 0xffff +paddusw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xfffe 0x801f 0xffff 0xffff 0x8050 0xffff 0xffff 0xffff +paddusw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xfffc 0x40 0xfe00 0x2 0xffff 0xffff 0xffff 0xffff +pmaxub(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 pmaxub(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x80 0x7f 0x15 0x20 0x80 0xff 0x81 0xfe 0x84 0x81 0x52 0xa5 0xf 0xc0 0x32 +pmaxub(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xff 0x80 0x7f 0x81 0x10 0x90 0xf 0xf0 0xfe 0x84 0x87 0xf6 0xa5 0xe1 0xc0 0x32 +pmaxub(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0x80 0x7f 0x15 0x20 0x80 0xff 0x81 0xfe 0x84 0x81 0x52 0xa5 0xf 0xc0 0x32 +pmaxub(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 +pmaxub(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfe 0x7e 0x7f 0x81 0x20 0x90 0xff 0xf0 0xf8 0x77 0x87 0xf6 0xa 0xe1 0x50 0x21 +pmaxub(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0x80 0x7f 0x81 0x10 0x90 0xf 0xf0 0xfe 0x84 0x87 0xf6 0xa5 0xe1 0xc0 0x32 +pmaxub(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xfe 0x7e 0x7f 0x81 0x20 0x90 0xff 0xf0 0xf8 0x77 0x87 0xf6 0xa 0xe1 0x50 0x21 +pmaxub(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 +pandn(0x81030201007f80ff 0x32c000a5527284fe , 0x81030201007f80ff 0x32c000a5527284fe ) = 0x0 0x0 pandn(0x81030201007f80ff 0x32c000a5527284fe , 0xff802015050100 0x1100f0a06810708 ) = 0xfc802015000100 0x1100f0a04810300 +pandn(0x81030201007f80ff 0x32c000a5527284fe , 0xf00f9010817f7efe 0x2150e103f68777f8 ) = 0x700c901081007e00 0x110e102a4857300 +pandn(0xff802015050100 0x1100f0a06810708 , 0x81030201007f80ff 0x32c000a5527284fe ) = 0x81000201007a80ff 0x32c000a5507280f6 +pandn(0xff802015050100 0x1100f0a06810708 , 0xff802015050100 0x1100f0a06810708 ) = 0x0 0x0 +pandn(0xff802015050100 0x1100f0a06810708 , 0xf00f9010817f7efe 0x2150e103f68777f8 ) = 0xf0001010807a7efe 0x2040e001f00670f0 +pandn(0xf00f9010817f7efe 0x2150e103f68777f8 , 0x81030201007f80ff 0x32c000a5527284fe ) = 0x100020100008001 0x128000a400708006 +pandn(0xf00f9010817f7efe 0x2150e103f68777f8 , 0xff802015050100 0x1100f0a06810708 ) = 0xf0002014000100 0xe0800000000 +pandn(0xf00f9010817f7efe 0x2150e103f68777f8 , 0xf00f9010817f7efe 0x2150e103f68777f8 ) = 0x0 0x0 +pavgb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 pavgb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x80 0x41 0x42 0xb 0x11 0x41 0x81 0x41 0x83 0x46 0x7a 0x2c 0x58 0x8 0x68 0x1a +pavgb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xff 0x7f 0x7f 0x41 0x9 0x49 0x9 0xb9 0xfb 0x7e 0x7d 0xa4 0x54 0x71 0x88 0x2a +pavgb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x80 0x41 0x42 0xb 0x11 0x41 0x81 0x41 0x83 0x46 0x7a 0x2c 0x58 0x8 0x68 0x1a +pavgb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 +pavgb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x7f 0x40 0x42 0x4b 0x18 0x88 0x87 0x78 0x80 0x3f 0x84 0x7e 0x7 0x78 0x30 0x11 +pavgb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0x7f 0x7f 0x41 0x9 0x49 0x9 0xb9 0xfb 0x7e 0x7d 0xa4 0x54 0x71 0x88 0x2a +pavgb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x7f 0x40 0x42 0x4b 0x18 0x88 0x87 0x78 0x80 0x3f 0x84 0x7e 0x7 0x78 0x30 0x11 +pavgb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 +psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0xffff 0x0 0x0 0x0 0x0 0x0 0xffff psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0xffff 0x0 0x0 0x0 0x0 0x0 0xffff +psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xffff 0xffff 0x0 0x0 0x0 0x0 0x0 0xffff +psraw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0x0 0xffff 0xffff 0x0 0xffff 0xffff 0xffff +psraw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0x0 0xffff 0xffff 0x0 0xffff 0xffff 0xffff +psraw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xffff 0x0 0xffff 0xffff 0x0 0xffff 0xffff 0xffff +psraw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0xffff 0xffff 0xffff 0xffff +psraw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0xffff 0xffff 0xffff 0xffff +psraw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0xffff 0xffff 0xffff 0xffff +psrad(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0xffffffff 0x0 0x0 psrad(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0xffffffff 0x0 0x0 +psrad(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0xffffffff 0xffffffff 0x0 0x0 +psrad(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0xffffffff 0x0 0xffffffff +psrad(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0xffffffff 0x0 0xffffffff +psrad(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0xffffffff 0x0 0xffffffff +psrad(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0xffffffff 0xffffffff 0x0 +psrad(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0xffffffff 0xffffffff 0x0 +psrad(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0xffffffff 0xffffffff 0x0 +pavgb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 pavgb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xc000 0x8000 0xbfff 0x8000 0x29 0x4801 0x8001 0x8001 +pavgb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xbfff 0x4010 0x7f80 0x1 0x4001 0x5029 0x7ffa 0x8005 +pavgb(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xc000 0x8000 0xbfff 0x8000 0x29 0x4801 0x8001 0x8001 +pavgb(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pavgb(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7fff 0x4010 0xbf80 0x8000 0x4028 0x9828 0xfff8 0x8005 +pavgb(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xbfff 0x4010 0x7f80 0x1 0x4001 0x5029 0x7ffa 0x8005 +pavgb(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x4010 0xbf80 0x8000 0x4028 0x9828 0xfff8 0x8005 +pavgb(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +pmulhuw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xfffe 0x4000 0x3fff 0x0 0x0 0x0 0x0 0x4001 pmulhuw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x3fff 0x7ffe 0x0 0x0 0x1 0x2 0x4001 +pmulhuw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7ffd 0x10 0x3f7f 0x0 0x0 0x1 0x2 0x4004 +pmulhuw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x7fff 0x3fff 0x7ffe 0x0 0x0 0x1 0x2 0x4001 +pmulhuw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x4000 0x3fff 0xfffe 0xfffe 0x0 0x5100 0xfffc 0x4001 +pmulhuw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x3fff 0xf 0x7eff 0x0 0x28 0x5a2d 0xffef 0x4004 +pmulhuw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x7ffd 0x10 0x3f7f 0x0 0x0 0x1 0x2 0x4004 +pmulhuw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x3fff 0xf 0x7eff 0x0 0x28 0x5a2d 0xffef 0x4004 +pmulhuw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x3ffe 0x0 0x3f01 0x0 0x4000 0x6464 0xffe2 0x4008 +pmulhw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x4000 0x3fff 0x0 0x0 0x0 0x0 0x3fff pmulhw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0xc000 0xffff 0x0 0x0 0xffff 0xffff 0x3fff +pmulhw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xffff 0xfff0 0x3f7f 0x0 0xffff 0xffff 0xffff 0x3ffb +pmulhw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0xc000 0xffff 0x0 0x0 0xffff 0xffff 0x3fff +pmulhw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x4000 0x3fff 0x0 0x0 0x0 0x3100 0x0 0x3fff +pmulhw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xc001 0xf 0xffff 0xffff 0xffd8 0x29dd 0x0 0x3ffb +pmulhw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0xfff0 0x3f7f 0x0 0xffff 0xffff 0xffff 0x3ffb +pmulhw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xc001 0xf 0xffff 0xffff 0xffd8 0x29dd 0x0 0x3ffb +pmulhw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x3ffe 0x0 0x3f01 0x0 0x4000 0x23c4 0x0 0x3ff8 +psubsb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psubsb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x80 0x7a 0xeb 0xe1 0x7f 0x4 0x81 0xf6 0x80 0x7f 0x4c 0x9b 0xf1 0xb0 0x31 +psubsb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x1 0x80 0x0 0x7f 0xf1 0x72 0xf4 0x91 0x6 0x80 0x7f 0x5c 0xa2 0x1f 0x80 0x11 +psubsb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x1 0x7f 0x86 0x15 0x1f 0x80 0xfc 0x7f 0xa 0x7f 0x80 0xb4 0x65 0xf 0x50 0xcf +psubsb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psubsb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x2 0x83 0x86 0x7f 0x10 0xf0 0xf0 0x10 0x10 0x90 0xfa 0x10 0x7 0x2e 0xc0 0xe0 +psubsb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0x7f 0x0 0x81 0xf 0x8e 0xc 0x6f 0xfa 0x7f 0x80 0xa4 0x5e 0xe1 0x7f 0xef +psubsb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xfe 0x7d 0x7a 0x80 0xf0 0x10 0x10 0xf0 0xf0 0x70 0x6 0xf0 0xf9 0xd2 0x40 0x20 +psubsb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psubsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psubsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x8000 0x7fff 0x1 0xffb1 0x7002 0x5 0x0 +psubsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x8001 0x8000 0xff 0xffff 0x7fff 0x5fb2 0x12 0xfff9 +psubsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x8001 0x7fff 0x8000 0xffff 0x4f 0x8ffe 0xfffb 0x0 +psubsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psubsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x8000 0x7fdf 0x80ff 0xfffe 0x7fff 0xefb0 0xd 0xfff9 +psubsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x7fff 0x7fff 0xff01 0x1 0x8000 0xa04e 0xffee 0x7 +psubsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x8021 0x7f01 0x2 0x8000 0x1050 0xfff3 0x7 +psubsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pminsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 pminsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x8000 0xffff 0xffff 0x1 0x9000 0xfffe 0x8001 +pminsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xffff 0x8000 0x7f00 0x0 0x8000 0xa050 0xfff1 0x8001 +pminsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x8000 0x8000 0xffff 0xffff 0x1 0x9000 0xfffe 0x8001 +pminsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pminsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x8000 0x20 0xffff 0xffff 0x8000 0x9000 0xfff1 0x8001 +pminsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0x8000 0x7f00 0x0 0x8000 0xa050 0xfff1 0x8001 +pminsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x20 0xffff 0xffff 0x8000 0x9000 0xfff1 0x8001 +pminsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +por(0x81030201007f80ff 0x32c000a5527284fe , 0x81030201007f80ff 0x32c000a5527284fe ) = 0x81030201007f80ff 0x32c000a5527284fe por(0x81030201007f80ff 0x32c000a5527284fe , 0xff802015050100 0x1100f0a06810708 ) = 0x81ff8221157f81ff 0x33d00faf56f387fe +por(0x81030201007f80ff 0x32c000a5527284fe , 0xf00f9010817f7efe 0x2150e103f68777f8 ) = 0xf10f9211817ffeff 0x33d0e1a7f6f7f7fe +por(0xff802015050100 0x1100f0a06810708 , 0x81030201007f80ff 0x32c000a5527284fe ) = 0x81ff8221157f81ff 0x33d00faf56f387fe +por(0xff802015050100 0x1100f0a06810708 , 0xff802015050100 0x1100f0a06810708 ) = 0xff802015050100 0x1100f0a06810708 +por(0xff802015050100 0x1100f0a06810708 , 0xf00f9010817f7efe 0x2150e103f68777f8 ) = 0xf0ff9030957f7ffe 0x2150ef0bf68777f8 +por(0xf00f9010817f7efe 0x2150e103f68777f8 , 0x81030201007f80ff 0x32c000a5527284fe ) = 0xf10f9211817ffeff 0x33d0e1a7f6f7f7fe +por(0xf00f9010817f7efe 0x2150e103f68777f8 , 0xff802015050100 0x1100f0a06810708 ) = 0xf0ff9030957f7ffe 0x2150ef0bf68777f8 +por(0xf00f9010817f7efe 0x2150e103f68777f8 , 0xf00f9010817f7efe 0x2150e103f68777f8 ) = 0xf00f9010817f7efe 0x2150e103f68777f8 +paddusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xfe 0x80 0x7f 0x0 0x2 0x4 0x6 0x80 0xfc 0x80 0x7f 0x7f 0x80 0x0 0x80 0x64 paddusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x81 0x7f 0x15 0x21 0x82 0x2 0x81 0x6 0x8b 0xf3 0x58 0xaf 0xf 0xd0 0x33 +paddusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfd 0xfe 0x7f 0x81 0x11 0x92 0x12 0x80 0xf6 0xfb 0xf9 0x48 0xa8 0xe1 0x10 0x53 +paddusb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0x81 0x7f 0x15 0x21 0x82 0x2 0x81 0x6 0x8b 0xf3 0x58 0xaf 0xf 0xd0 0x33 +paddusb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x2 0xa 0x2a 0x40 0x80 0xfe 0x0 0x10 0xe 0x80 0xc 0x14 0x1e 0x20 0x2 +paddusb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfe 0x7f 0x7f 0x96 0x30 0x80 0xe 0xf0 0x0 0x7e 0x80 0xfc 0xd 0xf0 0x60 0x22 +paddusb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xfd 0xfe 0x7f 0x81 0x11 0x92 0x12 0x80 0xf6 0xfb 0xf9 0x48 0xa8 0xe1 0x10 0x53 +paddusb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xfe 0x7f 0x7f 0x96 0x30 0x80 0xe 0xf0 0x0 0x7e 0x80 0xfc 0xd 0xf0 0x60 0x22 +paddusb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfc 0x7f 0x7f 0x80 0x20 0x80 0x1e 0xe0 0xf0 0x7f 0x80 0xec 0x6 0xc2 0x7f 0x42 +paddusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xfffe 0x8000 0x7fff 0x0 0x2 0x4 0x6 0x8000 paddusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0xffff 0x7ffe 0xffff 0x51 0x9002 0x1 0x8000 +paddusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7ffd 0x8020 0x7fff 0x1 0x8001 0xa052 0xfff4 0x8000 +paddusw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x8000 0xffff 0x7ffe 0xffff 0x51 0x9002 0x1 0x8000 +paddusw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x7fff 0xfffe 0xfffe 0xa0 0x8000 0xfffc 0x8000 +paddusw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xfffe 0x7fff 0x7eff 0x0 0x8050 0x8000 0xffef 0x8000 +paddusw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x7ffd 0x8020 0x7fff 0x1 0x8001 0xa052 0xfff4 0x8000 +paddusw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xfffe 0x7fff 0x7eff 0x0 0x8050 0x8000 0xffef 0x8000 +paddusw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7fff 0x40 0x7fff 0x2 0x8000 0x8000 0xffe2 0x8000 +pmaxsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 pmaxsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0x7fff 0x7fff 0x0 0x50 0x2 0x3 0x8001 +pmaxsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7ffe 0x20 0x7fff 0x1 0x1 0x2 0x3 0x8008 +pmaxsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0x7fff 0x7fff 0x0 0x50 0x2 0x3 0x8001 +pmaxsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pmaxsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7ffe 0x7fff 0x7f00 0x1 0x50 0xa050 0xfffe 0x8008 +pmaxsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x7ffe 0x20 0x7fff 0x1 0x1 0x2 0x3 0x8008 +pmaxsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7ffe 0x7fff 0x7f00 0x1 0x50 0xa050 0xfffe 0x8008 +pmaxsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 +pxor(0x81030201007f80ff 0x32c000a5527284fe , 0x81030201007f80ff 0x32c000a5527284fe ) = 0x0 0x0 pxor(0x81030201007f80ff 0x32c000a5527284fe , 0xff802015050100 0x1100f0a06810708 ) = 0x81fc8221157a81ff 0x33d00faf54f383f6 +pxor(0x81030201007f80ff 0x32c000a5527284fe , 0xf00f9010817f7efe 0x2150e103f68777f8 ) = 0x710c92118100fe01 0x1390e1a6a4f5f306 +pxor(0xff802015050100 0x1100f0a06810708 , 0x81030201007f80ff 0x32c000a5527284fe ) = 0x81fc8221157a81ff 0x33d00faf54f383f6 +pxor(0xff802015050100 0x1100f0a06810708 , 0xff802015050100 0x1100f0a06810708 ) = 0x0 0x0 +pxor(0xff802015050100 0x1100f0a06810708 , 0xf00f9010817f7efe 0x2150e103f68777f8 ) = 0xf0f01030947a7ffe 0x2040ee09f00670f0 +pxor(0xf00f9010817f7efe 0x2150e103f68777f8 , 0x81030201007f80ff 0x32c000a5527284fe ) = 0x710c92118100fe01 0x1390e1a6a4f5f306 +pxor(0xf00f9010817f7efe 0x2150e103f68777f8 , 0xff802015050100 0x1100f0a06810708 ) = 0xf0f01030947a7ffe 0x2040ee09f00670f0 +pxor(0xf00f9010817f7efe 0x2150e103f68777f8 , 0xf00f9010817f7efe 0x2150e103f68777f8 ) = 0x0 0x0 +psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pslld(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0x0 0x0 0x0 pslld(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0x0 +pslld(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0x0 0x0 0x0 +pslld(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0x0 0x0 0x0 +pslld(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0x0 +pslld(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0x0 0x0 0x0 +pslld(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0x0 0x0 0x0 +pslld(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0x0 +pslld(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0x0 0x0 0x0 +psllq(0xffffffffffffffff 0x8000000000000000 , 0xffffffffffffffff 0x8000000000000000 ) = 0x0 0x0 psllq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0xfffffffffffffffe 0x0 +psllq(0xffffffffffffffff 0x8000000000000000 , 0x7fffffffffffffff 0x4 ) = 0x0 0x0 +psllq(0x1 0x8000000000000000 , 0xffffffffffffffff 0x8000000000000000 ) = 0x0 0x0 +psllq(0x1 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x2 0x0 +psllq(0x1 0x8000000000000000 , 0x7fffffffffffffff 0x4 ) = 0x0 0x0 +psllq(0x7fffffffffffffff 0x4 , 0xffffffffffffffff 0x8000000000000000 ) = 0x0 0x0 +psllq(0x7fffffffffffffff 0x4 , 0x1 0x8000000000000000 ) = 0xfffffffffffffffe 0x8 +psllq(0x7fffffffffffffff 0x4 , 0x7fffffffffffffff 0x4 ) = 0x0 0x0 +pmuludq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x1 0xfffffffe 0x1 0x3fffffff pmuludq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x0 0x7ffffffb 0x2 +pmuludq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0xffffffff 0x0 0xfffffffb 0x40000001 +pmuludq(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0x0 0x7ffffffb 0x2 +pmuludq(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x1 0x0 0x19 0x0 +pmuludq(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x1 0x0 0x80000019 0x2 +pmuludq(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0x0 0xfffffffb 0x40000001 +pmuludq(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x1 0x0 0x80000019 0x2 +pmuludq(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x1 0x0 0x19 0x40000005 +pmaddwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x1 0x4000 0x1 0x3fff 0x5 0x0 0xa 0x3fff pmaddwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0xc001 0x8001 0xffff 0x2050 0xffff 0xfffb 0x3ffe +pmaddwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x8002 0xffef 0x8100 0x3f7f 0xc0a0 0xfffe 0x7fdb 0x3ffb +pmaddwd(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0xc001 0x8001 0xffff 0x2050 0xffff 0xfffb 0x3ffe +pmaddwd(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x1 0x7fff 0x2 0x0 0x1900 0x3100 0x5 0x3fff +pmaddwd(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xffe0 0xc010 0x80ff 0xffff 0x0 0x29b5 0x8026 0x3ffb +pmaddwd(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x8002 0xffef 0x8100 0x3f7f 0xc0a0 0xfffe 0x7fdb 0x3ffb +pmaddwd(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffe0 0xc010 0x80ff 0xffff 0x0 0x29b5 0x8026 0x3ffb +pmaddwd(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x404 0x3ffe 0x1 0x3f01 0x1900 0x63c4 0x121 0x3ff8 +pmaddubsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xfe02 0xc000 0x3e02 0x0 0x1 0x4 0x9 0xc001 +pmaddubsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8080 0x3f80 0xfe82 0x0 0x50 0x0 0xfffa 0xc001 +pmaddubsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7c83 0x0 0x3f01 0x0 0x0 0xa0 0xffd3 0xc008 +pmaddubsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xff80 0xc080 0x7d82 0x0 0x50 0x0 0x2fa 0xc001 +pmaddubsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xc000 0x3e02 0xfe02 0xfe02 0x1900 0xc100 0xfd05 0xc001 +pmaddubsw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x3f80 0x1fe0 0x7e81 0xff 0x0 0xca00 0xf01f 0xc008 +pmaddubsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xfe83 0x0 0x3f01 0x0 0x0 0xa0 0x2d3 0xc008 +pmaddubsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xc080 0xffe0 0xff81 0xffff 0x0 0xba00 0xfd1f 0xc008 +pmaddubsw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x3d05 0x400 0x3f01 0x1 0xc000 0xdd00 0xf0e2 0xc040 +psadbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psadbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x27 0x4 0x0 0x0 0x0 0x0 0x0 0x0 0x59 0x3 0x0 0x0 0x0 0x0 0x0 0x0 +psadbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x9c 0x1 0x0 0x0 0x0 0x0 0x0 0x0 0xd0 0x2 0x0 0x0 0x0 0x0 0x0 0x0 +psadbw(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x27 0x4 0x0 0x0 0x0 0x0 0x0 0x0 0x59 0x3 0x0 0x0 0x0 0x0 0x0 0x0 +psadbw(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psadbw(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x61 0x4 0x0 0x0 0x0 0x0 0x0 0x0 0x8f 0x3 0x0 0x0 0x0 0x0 0x0 0x0 +psadbw(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x9c 0x1 0x0 0x0 0x0 0x0 0x0 0x0 0xd0 0x2 0x0 0x0 0x0 0x0 0x0 0x0 +psadbw(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x61 0x4 0x0 0x0 0x0 0x0 0x0 0x0 0x8f 0x3 0x0 0x0 0x0 0x0 0x0 0x0 +psadbw(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psubb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psubb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x7f 0x7a 0xeb 0xe1 0x82 0x4 0x81 0xf6 0x7d 0xf1 0x4c 0x9b 0xf1 0xb0 0x31 +psubb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x1 0x2 0x0 0x7f 0xf1 0x72 0xf4 0x91 0x6 0xd 0xeb 0x5c 0xa2 0x1f 0x70 0x11 +psubb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x1 0x81 0x86 0x15 0x1f 0x7e 0xfc 0x7f 0xa 0x83 0xf 0xb4 0x65 0xf 0x50 0xcf +psubb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psubb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x2 0x83 0x86 0x94 0x10 0xf0 0xf0 0x10 0x10 0x90 0xfa 0x10 0x7 0x2e 0xc0 0xe0 +psubb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0xfe 0x0 0x81 0xf 0x8e 0xc 0x6f 0xfa 0xf3 0x15 0xa4 0x5e 0xe1 0x90 0xef +psubb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xfe 0x7d 0x7a 0x6c 0xf0 0x10 0x10 0xf0 0xf0 0x70 0x6 0xf0 0xf9 0xd2 0x40 0x20 +psubb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psubw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 psubw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x1 0x8000 0x1 0xffb1 0x7002 0x5 0x0 +psubw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x8001 0x7fe0 0xff 0xffff 0x8001 0x5fb2 0x12 0xfff9 +psubw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x8001 0xffff 0x8000 0xffff 0x4f 0x8ffe 0xfffb 0x0 +psubw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psubw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x2 0x7fdf 0x80ff 0xfffe 0x8050 0xefb0 0xd 0xfff9 +psubw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x7fff 0x8020 0xff01 0x1 0x7fff 0xa04e 0xffee 0x7 +psubw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xfffe 0x8021 0x7f01 0x2 0x7fb0 0x1050 0xfff3 0x7 +psubw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psubd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0x0 0x0 0x0 psubd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xfffffffe 0x0 0x7ffffffa 0x2 +psubd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0xfffffffe 0x0 0xfffffffa 0xffff0002 +psubd(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x2 0x0 0x80000006 0xfffffffe +psubd(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0x0 +psubd(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0x0 0x80000000 0xffff0000 +psubd(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x2 0x0 0x6 0xfffe +psubd(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x80000000 0x10000 +psubd(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0x0 0x0 0x0 +psubq(0xffffffffffffffff 0x8000000000000000 , 0xffffffffffffffff 0x8000000000000000 ) = 0x0 0x0 psubq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0xfffffffffffffffe 0x0 +psubq(0xffffffffffffffff 0x8000000000000000 , 0x7fffffffffffffff 0x4 ) = 0x8000000000000000 0x7ffffffffffffffc +psubq(0x1 0x8000000000000000 , 0xffffffffffffffff 0x8000000000000000 ) = 0x2 0x0 +psubq(0x1 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x0 0x0 +psubq(0x1 0x8000000000000000 , 0x7fffffffffffffff 0x4 ) = 0x8000000000000002 0x7ffffffffffffffc +psubq(0x7fffffffffffffff 0x4 , 0xffffffffffffffff 0x8000000000000000 ) = 0x8000000000000000 0x8000000000000004 +psubq(0x7fffffffffffffff 0x4 , 0x1 0x8000000000000000 ) = 0x7ffffffffffffffe 0x8000000000000004 +psubq(0x7fffffffffffffff 0x4 , 0x7fffffffffffffff 0x4 ) = 0x0 0x0 +paddb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xfe 0x0 0xfe 0x0 0x2 0x4 0x6 0x2 0xfc 0x8 0xe4 0xa4 0x4a 0x0 0x80 0x64 paddb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x81 0x84 0x15 0x21 0x82 0x2 0x81 0x6 0x8b 0xf3 0x58 0xaf 0xf 0xd0 0x33 +paddb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfd 0xfe 0xfe 0x81 0x11 0x92 0x12 0x71 0xf6 0xfb 0xf9 0x48 0xa8 0xe1 0x10 0x53 +paddb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xff 0x81 0x84 0x15 0x21 0x82 0x2 0x81 0x6 0x8b 0xf3 0x58 0xaf 0xf 0xd0 0x33 +paddb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x2 0xa 0x2a 0x40 0x0 0xfe 0x0 0x10 0xe 0x2 0xc 0x14 0x1e 0x20 0x2 +paddb(0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfe 0x7f 0x84 0x96 0x30 0x10 0xe 0xf0 0x0 0x7e 0x8 0xfc 0xd 0xf0 0x60 0x22 +paddb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0xfd 0xfe 0xfe 0x81 0x11 0x92 0x12 0x71 0xf6 0xfb 0xf9 0x48 0xa8 0xe1 0x10 0x53 +paddb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xfe 0x7f 0x84 0x96 0x30 0x10 0xe 0xf0 0x0 0x7e 0x8 0xfc 0xd 0xf0 0x60 0x22 +paddb(0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 , 0xfe 0x7e 0x7f 0x81 0x10 0x90 0xf 0xf0 0xf8 0x77 0x87 0xf6 0x3 0xe1 0x50 0x21 ) = 0xfc 0xfc 0xfe 0x2 0x20 0x20 0x1e 0xe0 0xf0 0xee 0xe 0xec 0x6 0xc2 0xa0 0x42 +paddw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xfffe 0x0 0xfffe 0x0 0x2 0x4 0x6 0x2 paddw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0xffff 0x7ffe 0xffff 0x51 0x9002 0x1 0x2 +paddw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0x7ffd 0x8020 0xfeff 0x1 0x8001 0xa052 0xfff4 0x9 +paddw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x7fff 0xffff 0x7ffe 0xffff 0x51 0x9002 0x1 0x2 +paddw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0xfffe 0xfffe 0xfffe 0xa0 0x2000 0xfffc 0x2 +paddw(0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xfffe 0x801f 0x7eff 0x0 0x8050 0x3050 0xffef 0x9 +paddw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x7ffd 0x8020 0xfeff 0x1 0x8001 0xa052 0xfff4 0x9 +paddw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xfffe 0x801f 0x7eff 0x0 0x8050 0x3050 0xffef 0x9 +paddw(0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 , 0x7ffe 0x20 0x7f00 0x1 0x8000 0xa050 0xfff1 0x8008 ) = 0xfffc 0x40 0xfe00 0x2 0x0 0x40a0 0xffe2 0x10 +paddd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xfffffffe 0x0 0xfffffffe 0x0 paddd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x80000004 0xfffffffe +paddd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x80000005 0xfffe ) = 0x0 0x0 0x4 0xfffe +paddd(0x1 0x80000000 0x5 0xfffffffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0x0 0x80000004 0xfffffffe +paddd(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x2 0x0 0xa 0xfffffffc +paddd(0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x2 0x0 0x8000000a 0xfffc +paddd(0x1 0x80000000 0x80000005 0xfffe , 0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x0 0x0 0x4 0xfffe +paddd(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x5 0xfffffffe ) = 0x2 0x0 0x8000000a 0xfffc +paddd(0x1 0x80000000 0x80000005 0xfffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0x2 0x0 0xa 0x1fffc pmovhlps(1 2 3 -4 , 0 -2 -10 0.5 ) = -10 0.5 3 -4 unpcklps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 0 2 -2 unpckhps(1 2 3 -4 , 0 -2 -10 0.5 ) = 3 -10 -4 0.5 pmovhps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 2 0 -2 -psqrtps(1 2 3 -4 ) = 1 1.41421 1.73205 nan -psqrtps(0 -2 -10 0.5 ) = 0 nan nan 0.707107 -psqrtps(inf -inf -inf 1 ) = inf nan nan 1 -psqrtps(nan -0 nan inf ) = nan -0 nan inf -prcpps(nan -0 nan inf ) = nan -inf nan 0 +psqrtps(1 2 3 -4 ) = 1 1.41421 1.73205 -nan +psqrtps(0 -2 -10 0.5 ) = 0 -nan -nan 0.707107 +psqrtps(inf -inf -inf 1 ) = inf -nan -nan 1 +psqrtps(+nan -0 -nan inf ) = +nan -0 -nan inf +prcpps(+nan -0 -nan inf ) = +nan -inf -nan 0 andps(1 2 3 -4 , 0 -2 -10 0.5 ) = 0 2 2 0 andps(0 -2 -10 0.5 , inf -inf -inf 1 ) = 0 -2 -8 0.5 -andps(1 2 3 -4 , nan -0 nan inf ) = 1 0 3 4 -andps(0 -2 -10 0.5 , nan -0 nan inf ) = 0 -0 -8 0.5 -andps(inf -inf -inf 1 , nan -0 nan inf ) = inf -0 -inf 1 -andps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +andps(1 2 3 -4 , +nan -0 -nan inf ) = 1 0 3 4 +andps(0 -2 -10 0.5 , +nan -0 -nan inf ) = 0 -0 -8 0.5 +andps(inf -inf -inf 1 , +nan -0 -nan inf ) = inf -0 -inf 1 +andps(+nan -0 -nan inf , +nan -0 -nan inf ) = +nan -0 -nan inf andnps(1 2 3 -4 , 0 -2 -10 0.5 ) = 0 -0 -2.93874e-38 0.5 andnps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf 1 0.25 1.17549e-38 -andnps(1 2 3 -4 , nan -0 nan inf ) = 3 -0 -1 0.5 -andnps(0 -2 -10 0.5 , nan -0 nan inf ) = nan 0 0.375 4 -andnps(inf -inf -inf 1 , nan -0 nan inf ) = 5.87747e-39 0 5.87747e-39 2 -andnps(nan -0 nan inf , nan -0 nan inf ) = 0 0 0 0 +andnps(1 2 3 -4 , +nan -0 -nan inf ) = 3 -0 -1 0.5 +andnps(0 -2 -10 0.5 , +nan -0 -nan inf ) = +nan 0 0.375 4 +andnps(inf -inf -inf 1 , +nan -0 -nan inf ) = 5.87747e-39 0 5.87747e-39 2 +andnps(+nan -0 -nan inf , +nan -0 -nan inf ) = 0 0 0 0 orps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 -2 -14 -inf -orps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf -inf nan 1 -orps(1 2 3 -4 , nan -0 nan inf ) = nan -2 nan -inf -orps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -2 nan inf -orps(inf -inf -inf 1 , nan -0 nan inf ) = nan -inf nan inf -orps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +orps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf -inf -nan 1 +orps(1 2 3 -4 , +nan -0 -nan inf ) = +nan -2 -nan -inf +orps(0 -2 -10 0.5 , +nan -0 -nan inf ) = +nan -2 -nan inf +orps(inf -inf -inf 1 , +nan -0 -nan inf ) = +nan -inf -nan inf +orps(+nan -0 -nan inf , +nan -0 -nan inf ) = +nan -0 -nan inf xorps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 -0 -4.11423e-38 -inf xorps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf 1 0.3125 1.17549e-38 -xorps(1 2 3 -4 , nan -0 nan inf ) = 3 -2 -1 -0.5 -xorps(0 -2 -10 0.5 , nan -0 nan inf ) = nan 2 0.4375 4 -xorps(inf -inf -inf 1 , nan -0 nan inf ) = 5.87747e-39 inf 5.87747e-39 2 -xorps(nan -0 nan inf , nan -0 nan inf ) = 0 0 0 0 +xorps(1 2 3 -4 , +nan -0 -nan inf ) = 3 -2 -1 -0.5 +xorps(0 -2 -10 0.5 , +nan -0 -nan inf ) = +nan 2 0.4375 4 +xorps(inf -inf -inf 1 , +nan -0 -nan inf ) = 5.87747e-39 inf 5.87747e-39 2 +xorps(+nan -0 -nan inf , +nan -0 -nan inf ) = 0 0 0 0 addps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 0 -7 -3.5 addps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf -inf -inf 1.5 -addps(1 2 3 -4 , nan -0 nan inf ) = nan 2 nan inf -addps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -2 nan inf -addps(inf -inf -inf 1 , nan -0 nan inf ) = nan -inf nan inf -addps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +addps(1 2 3 -4 , +nan -0 -nan inf ) = +nan 2 -nan inf +addps(0 -2 -10 0.5 , +nan -0 -nan inf ) = +nan -2 -nan inf +addps(inf -inf -inf 1 , +nan -0 -nan inf ) = +nan -inf -nan inf +addps(+nan -0 -nan inf , +nan -0 -nan inf ) = +nan -0 -nan inf mulps(1 2 3 -4 , 0 -2 -10 0.5 ) = 0 -4 -30 -2 -mulps(0 -2 -10 0.5 , inf -inf -inf 1 ) = nan inf inf 0.5 -mulps(1 2 3 -4 , nan -0 nan inf ) = nan -0 nan -inf -mulps(0 -2 -10 0.5 , nan -0 nan inf ) = nan 0 nan inf -mulps(inf -inf -inf 1 , nan -0 nan inf ) = nan nan nan inf -mulps(nan -0 nan inf , nan -0 nan inf ) = nan 0 nan inf +mulps(0 -2 -10 0.5 , inf -inf -inf 1 ) = -nan inf inf 0.5 +mulps(1 2 3 -4 , +nan -0 -nan inf ) = +nan -0 -nan -inf +mulps(0 -2 -10 0.5 , +nan -0 -nan inf ) = +nan 0 -nan inf +mulps(inf -inf -inf 1 , +nan -0 -nan inf ) = +nan -nan -nan inf +mulps(+nan -0 -nan inf , +nan -0 -nan inf ) = +nan 0 -nan inf subps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 4 13 -4.5 subps(0 -2 -10 0.5 , inf -inf -inf 1 ) = -inf inf inf -0.5 -subps(1 2 3 -4 , nan -0 nan inf ) = nan 2 nan -inf -subps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -2 nan -inf -subps(inf -inf -inf 1 , nan -0 nan inf ) = nan -inf nan -inf -subps(nan -0 nan inf , nan -0 nan inf ) = nan 0 nan nan +subps(1 2 3 -4 , +nan -0 -nan inf ) = +nan 2 -nan -inf +subps(0 -2 -10 0.5 , +nan -0 -nan inf ) = +nan -2 -nan -inf +subps(inf -inf -inf 1 , +nan -0 -nan inf ) = +nan -inf -nan -inf +subps(+nan -0 -nan inf , +nan -0 -nan inf ) = +nan 0 -nan -nan minps(1 2 3 -4 , 0 -2 -10 0.5 ) = 0 -2 -10 -4 minps(0 -2 -10 0.5 , inf -inf -inf 1 ) = 0 -inf -inf 0.5 -minps(1 2 3 -4 , nan -0 nan inf ) = nan -0 nan -4 -minps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -2 nan 0.5 -minps(inf -inf -inf 1 , nan -0 nan inf ) = nan -inf nan 1 -minps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +minps(1 2 3 -4 , +nan -0 -nan inf ) = +nan -0 -nan -4 +minps(0 -2 -10 0.5 , +nan -0 -nan inf ) = +nan -2 -nan 0.5 +minps(inf -inf -inf 1 , +nan -0 -nan inf ) = +nan -inf -nan 1 +minps(+nan -0 -nan inf , +nan -0 -nan inf ) = +nan -0 -nan inf divps(1 2 3 -4 , 0 -2 -10 0.5 ) = inf -1 -0.3 -8 divps(0 -2 -10 0.5 , inf -inf -inf 1 ) = 0 0 0 0.5 -divps(1 2 3 -4 , nan -0 nan inf ) = nan -inf nan -0 -divps(0 -2 -10 0.5 , nan -0 nan inf ) = nan inf nan 0 -divps(inf -inf -inf 1 , nan -0 nan inf ) = nan inf nan 0 -divps(nan -0 nan inf , nan -0 nan inf ) = nan nan nan nan +divps(1 2 3 -4 , +nan -0 -nan inf ) = +nan -inf -nan -0 +divps(0 -2 -10 0.5 , +nan -0 -nan inf ) = +nan inf -nan 0 +divps(inf -inf -inf 1 , +nan -0 -nan inf ) = +nan inf -nan 0 +divps(+nan -0 -nan inf , +nan -0 -nan inf ) = +nan -nan -nan -nan maxps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 2 3 0.5 maxps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf -2 -10 1 -maxps(1 2 3 -4 , nan -0 nan inf ) = nan 2 nan inf -maxps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -0 nan inf -maxps(inf -inf -inf 1 , nan -0 nan inf ) = nan -0 nan inf -maxps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +maxps(1 2 3 -4 , +nan -0 -nan inf ) = +nan 2 -nan inf +maxps(0 -2 -10 0.5 , +nan -0 -nan inf ) = +nan -0 -nan inf +maxps(inf -inf -inf 1 , +nan -0 -nan inf ) = +nan -0 -nan inf +maxps(+nan -0 -nan inf , +nan -0 -nan inf ) = +nan -0 -nan inf +addsubps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 0 13 -3.5 +addsubps(0 -2 -10 0.5 , inf -inf -inf 1 ) = -inf -inf inf 1.5 +addsubps(1 2 3 -4 , +nan -0 -nan inf ) = +nan 2 -nan inf +addsubps(0 -2 -10 0.5 , +nan -0 -nan inf ) = +nan -2 -nan inf +addsubps(inf -inf -inf 1 , +nan -0 -nan inf ) = +nan -inf -nan inf +addsubps(+nan -0 -nan inf , +nan -0 -nan inf ) = +nan -0 -nan inf +haddps(1 2 3 -4 , 0 -2 -10 0.5 ) = 3 -1 -2 -9.5 +haddps(0 -2 -10 0.5 , inf -inf -inf 1 ) = -2 -9.5 -nan -inf +haddps(1 2 3 -4 , +nan -0 -nan inf ) = 3 -1 +nan -nan +haddps(0 -2 -10 0.5 , +nan -0 -nan inf ) = -2 -9.5 +nan -nan +haddps(inf -inf -inf 1 , +nan -0 -nan inf ) = -nan -inf +nan -nan +haddps(+nan -0 -nan inf , +nan -0 -nan inf ) = +nan -nan +nan -nan +hsubps(1 2 3 -4 , 0 -2 -10 0.5 ) = -1 7 2 -10.5 +hsubps(0 -2 -10 0.5 , inf -inf -inf 1 ) = 2 -10.5 inf -inf +hsubps(1 2 3 -4 , +nan -0 -nan inf ) = -1 7 +nan -nan +hsubps(0 -2 -10 0.5 , +nan -0 -nan inf ) = 2 -10.5 +nan -nan +hsubps(inf -inf -inf 1 , +nan -0 -nan inf ) = inf -inf +nan -nan +hsubps(+nan -0 -nan inf , +nan -0 -nan inf ) = +nan -nan +nan -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 0) = -nan -nan -nan -nan cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 0) = 0 0 0 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 0) = 0 0 0 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 0) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 0) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 0) = -nan -nan -nan -nan cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 0) = 0 0 0 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 0) = 0 0 0 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 0) = 0 0 0 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 0) = 0 0 0 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 0) = 0 nan 0 nan -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 1) = 0 0 0 nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 1) = nan 0 0 nan -cmpps(1 2 3 -4 , nan -0 nan inf , 1) = 0 0 0 nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 1) = 0 nan 0 nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 1) = 0 nan 0 nan -cmpps(nan -0 nan inf , nan -0 nan inf , 1) = 0 0 0 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 2) = 0 0 0 nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 2) = nan 0 0 nan -cmpps(1 2 3 -4 , nan -0 nan inf , 2) = 0 0 0 nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 2) = 0 nan 0 nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 2) = 0 nan 0 nan -cmpps(nan -0 nan inf , nan -0 nan inf , 2) = 0 nan 0 nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 0) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 0) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 0) = 0 0 0 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 0) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 0) = 0 0 0 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 0) = 0 0 0 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 0) = 0 0 0 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 0) = 0 0 0 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 0) = 0 -nan 0 -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 1) = 0 0 0 0 +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 1) = 0 0 0 -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 1) = -nan 0 0 -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 1) = 0 0 0 -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 1) = -nan -nan -nan 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 1) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 1) = -nan 0 0 -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 1) = 0 -nan 0 -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 1) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 1) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 1) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 1) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 1) = 0 -nan 0 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 1) = 0 0 0 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 1) = 0 0 0 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 1) = 0 0 0 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 2) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 2) = 0 0 0 -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 2) = -nan 0 0 -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 2) = 0 0 0 -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 2) = -nan -nan -nan 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 2) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 2) = -nan 0 0 -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 2) = 0 -nan 0 -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 2) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 2) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 2) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 2) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 2) = 0 -nan 0 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 2) = 0 0 0 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 2) = 0 0 0 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 2) = 0 -nan 0 -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 3) = 0 0 0 0 cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 3) = 0 0 0 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 3) = 0 0 0 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 3) = -nan 0 -nan 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 3) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 3) = 0 0 0 0 cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 3) = 0 0 0 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 3) = nan 0 nan 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 3) = nan 0 nan 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 3) = nan 0 nan 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 3) = nan 0 nan 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 4) = nan nan nan nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 4) = nan nan nan nan -cmpps(1 2 3 -4 , nan -0 nan inf , 4) = nan nan nan nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 4) = nan nan nan nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 4) = nan nan nan nan -cmpps(nan -0 nan inf , nan -0 nan inf , 4) = nan 0 nan 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 5) = nan nan nan 0 -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 5) = 0 nan nan 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 5) = nan nan nan 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 5) = nan 0 nan 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 5) = nan 0 nan 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 5) = nan nan nan nan -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 6) = nan nan nan 0 -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 6) = 0 nan nan 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 6) = nan nan nan 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 6) = nan 0 nan 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 6) = nan 0 nan 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 6) = nan 0 nan 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 7) = nan nan nan nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 7) = nan nan nan nan -cmpps(1 2 3 -4 , nan -0 nan inf , 7) = 0 nan 0 nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 7) = 0 nan 0 nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 7) = 0 nan 0 nan -cmpps(nan -0 nan inf , nan -0 nan inf , 7) = 0 nan 0 nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 3) = -nan 0 -nan 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 3) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 3) = 0 0 0 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 3) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 3) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 3) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 3) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 3) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 3) = -nan 0 -nan 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 4) = 0 0 0 0 +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 4) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 4) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 4) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 4) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 4) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 4) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 4) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 4) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 4) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 4) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 4) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 4) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 4) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 4) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 4) = -nan 0 -nan 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 5) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 5) = -nan -nan -nan 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 5) = 0 -nan -nan 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 5) = -nan -nan -nan 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 5) = 0 0 0 -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 5) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 5) = 0 -nan -nan 0 +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 5) = -nan 0 -nan 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 5) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 5) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 5) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 5) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 5) = -nan 0 -nan -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 5) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 5) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 5) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 6) = 0 0 0 0 +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 6) = -nan -nan -nan 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 6) = 0 -nan -nan 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 6) = -nan -nan -nan 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 6) = 0 0 0 -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 6) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 6) = 0 -nan -nan 0 +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 6) = -nan 0 -nan 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 6) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 6) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 6) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 6) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 6) = -nan 0 -nan -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 6) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 6) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 6) = -nan 0 -nan 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 7) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 7) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 7) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 7) = 0 -nan 0 -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 7) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 7) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 7) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 7) = 0 -nan 0 -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 7) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 7) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 7) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 7) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 7) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 7) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 7) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 7) = 0 -nan 0 -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 8) = -nan -nan -nan -nan cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 8) = 0 0 0 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 8) = 0 0 0 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 8) = -nan 0 -nan 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 8) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 8) = -nan -nan -nan -nan cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 8) = 0 0 0 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 8) = nan 0 nan 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 8) = nan 0 nan 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 8) = nan 0 nan 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 8) = nan nan nan nan -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 9) = 0 0 0 nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 9) = nan 0 0 nan -cmpps(1 2 3 -4 , nan -0 nan inf , 9) = nan 0 nan nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 9) = nan nan nan nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 9) = nan nan nan nan -cmpps(nan -0 nan inf , nan -0 nan inf , 9) = nan 0 nan 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 10) = 0 0 0 nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 10) = nan 0 0 nan -cmpps(1 2 3 -4 , nan -0 nan inf , 10) = nan 0 nan nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 10) = nan nan nan nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 10) = nan nan nan nan -cmpps(nan -0 nan inf , nan -0 nan inf , 10) = nan nan nan nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 8) = -nan 0 -nan 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 8) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 8) = 0 0 0 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 8) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 8) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 8) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 8) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 8) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 8) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 9) = 0 0 0 0 +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 9) = 0 0 0 -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 9) = -nan 0 0 -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 9) = -nan 0 -nan -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 9) = -nan -nan -nan 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 9) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 9) = -nan 0 0 -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 9) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 9) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 9) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 9) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 9) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 9) = -nan -nan -nan 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 9) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 9) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 9) = -nan 0 -nan 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 10) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 10) = 0 0 0 -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 10) = -nan 0 0 -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 10) = -nan 0 -nan -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 10) = -nan -nan -nan 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 10) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 10) = -nan 0 0 -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 10) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 10) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 10) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 10) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 10) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 10) = -nan -nan -nan 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 10) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 10) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 10) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 11) = 0 0 0 0 cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 11) = 0 0 0 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 11) = 0 0 0 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 11) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 11) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 11) = 0 0 0 0 cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 11) = 0 0 0 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 11) = 0 0 0 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 11) = 0 0 0 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 11) = 0 0 0 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 11) = 0 0 0 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 12) = nan nan nan nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 12) = nan nan nan nan -cmpps(1 2 3 -4 , nan -0 nan inf , 12) = 0 nan 0 nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 12) = 0 nan 0 nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 12) = 0 nan 0 nan -cmpps(nan -0 nan inf , nan -0 nan inf , 12) = 0 0 0 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 13) = nan nan nan 0 -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 13) = 0 nan nan 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 13) = 0 nan 0 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 13) = 0 0 0 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 13) = 0 0 0 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 13) = 0 nan 0 nan -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 14) = nan nan nan 0 -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 14) = 0 nan nan 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 14) = 0 nan 0 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 14) = 0 0 0 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 14) = 0 0 0 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 14) = 0 0 0 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 15) = nan nan nan nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 15) = nan nan nan nan -cmpps(1 2 3 -4 , nan -0 nan inf , 15) = nan nan nan nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 15) = nan nan nan nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 15) = nan nan nan nan -cmpps(nan -0 nan inf , nan -0 nan inf , 15) = nan nan nan nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 11) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 11) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 11) = 0 0 0 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 11) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 11) = 0 0 0 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 11) = 0 0 0 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 11) = 0 0 0 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 11) = 0 0 0 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 11) = 0 0 0 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 12) = 0 0 0 0 +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 12) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 12) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 12) = 0 -nan 0 -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 12) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 12) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 12) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 12) = 0 -nan 0 -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 12) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 12) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 12) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 12) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 12) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 12) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 12) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 12) = 0 0 0 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 13) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 13) = -nan -nan -nan 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 13) = 0 -nan -nan 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 13) = 0 -nan 0 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 13) = 0 0 0 -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 13) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 13) = 0 -nan -nan 0 +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 13) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 13) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 13) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 13) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 13) = 0 0 0 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 13) = 0 0 0 -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 13) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 13) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 13) = 0 -nan 0 -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 14) = 0 0 0 0 +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 14) = -nan -nan -nan 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 14) = 0 -nan -nan 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 14) = 0 -nan 0 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 14) = 0 0 0 -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 14) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 14) = 0 -nan -nan 0 +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 14) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 14) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 14) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 14) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 14) = 0 0 0 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 14) = 0 0 0 -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 14) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 14) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 14) = 0 0 0 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 15) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 15) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 15) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 15) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 15) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 15) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 15) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 15) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 15) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 15) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 15) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 15) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 15) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 15) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 15) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 15) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 16) = -nan -nan -nan -nan cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 16) = 0 0 0 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 16) = 0 0 0 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 16) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 16) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 16) = -nan -nan -nan -nan cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 16) = 0 0 0 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 16) = 0 0 0 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 16) = 0 0 0 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 16) = 0 0 0 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 16) = 0 nan 0 nan -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 17) = 0 0 0 nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 17) = nan 0 0 nan -cmpps(1 2 3 -4 , nan -0 nan inf , 17) = 0 0 0 nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 17) = 0 nan 0 nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 17) = 0 nan 0 nan -cmpps(nan -0 nan inf , nan -0 nan inf , 17) = 0 0 0 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 18) = 0 0 0 nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 18) = nan 0 0 nan -cmpps(1 2 3 -4 , nan -0 nan inf , 18) = 0 0 0 nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 18) = 0 nan 0 nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 18) = 0 nan 0 nan -cmpps(nan -0 nan inf , nan -0 nan inf , 18) = 0 nan 0 nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 16) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 16) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 16) = 0 0 0 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 16) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 16) = 0 0 0 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 16) = 0 0 0 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 16) = 0 0 0 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 16) = 0 0 0 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 16) = 0 -nan 0 -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 17) = 0 0 0 0 +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 17) = 0 0 0 -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 17) = -nan 0 0 -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 17) = 0 0 0 -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 17) = -nan -nan -nan 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 17) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 17) = -nan 0 0 -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 17) = 0 -nan 0 -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 17) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 17) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 17) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 17) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 17) = 0 -nan 0 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 17) = 0 0 0 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 17) = 0 0 0 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 17) = 0 0 0 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 18) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 18) = 0 0 0 -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 18) = -nan 0 0 -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 18) = 0 0 0 -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 18) = -nan -nan -nan 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 18) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 18) = -nan 0 0 -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 18) = 0 -nan 0 -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 18) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 18) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 18) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 18) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 18) = 0 -nan 0 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 18) = 0 0 0 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 18) = 0 0 0 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 18) = 0 -nan 0 -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 19) = 0 0 0 0 cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 19) = 0 0 0 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 19) = 0 0 0 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 19) = -nan 0 -nan 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 19) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 19) = 0 0 0 0 cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 19) = 0 0 0 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 19) = nan 0 nan 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 19) = nan 0 nan 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 19) = nan 0 nan 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 19) = nan 0 nan 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 20) = nan nan nan nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 20) = nan nan nan nan -cmpps(1 2 3 -4 , nan -0 nan inf , 20) = nan nan nan nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 20) = nan nan nan nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 20) = nan nan nan nan -cmpps(nan -0 nan inf , nan -0 nan inf , 20) = nan 0 nan 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 21) = nan nan nan 0 -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 21) = 0 nan nan 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 21) = nan nan nan 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 21) = nan 0 nan 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 21) = nan 0 nan 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 21) = nan nan nan nan -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 22) = nan nan nan 0 -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 22) = 0 nan nan 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 22) = nan nan nan 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 22) = nan 0 nan 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 22) = nan 0 nan 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 22) = nan 0 nan 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 23) = nan nan nan nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 23) = nan nan nan nan -cmpps(1 2 3 -4 , nan -0 nan inf , 23) = 0 nan 0 nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 23) = 0 nan 0 nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 23) = 0 nan 0 nan -cmpps(nan -0 nan inf , nan -0 nan inf , 23) = 0 nan 0 nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 19) = -nan 0 -nan 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 19) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 19) = 0 0 0 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 19) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 19) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 19) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 19) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 19) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 19) = -nan 0 -nan 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 20) = 0 0 0 0 +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 20) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 20) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 20) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 20) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 20) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 20) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 20) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 20) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 20) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 20) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 20) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 20) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 20) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 20) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 20) = -nan 0 -nan 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 21) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 21) = -nan -nan -nan 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 21) = 0 -nan -nan 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 21) = -nan -nan -nan 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 21) = 0 0 0 -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 21) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 21) = 0 -nan -nan 0 +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 21) = -nan 0 -nan 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 21) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 21) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 21) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 21) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 21) = -nan 0 -nan -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 21) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 21) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 21) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 22) = 0 0 0 0 +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 22) = -nan -nan -nan 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 22) = 0 -nan -nan 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 22) = -nan -nan -nan 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 22) = 0 0 0 -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 22) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 22) = 0 -nan -nan 0 +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 22) = -nan 0 -nan 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 22) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 22) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 22) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 22) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 22) = -nan 0 -nan -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 22) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 22) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 22) = -nan 0 -nan 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 23) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 23) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 23) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 23) = 0 -nan 0 -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 23) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 23) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 23) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 23) = 0 -nan 0 -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 23) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 23) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 23) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 23) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 23) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 23) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 23) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 23) = 0 -nan 0 -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 24) = -nan -nan -nan -nan cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 24) = 0 0 0 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 24) = 0 0 0 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 24) = -nan 0 -nan 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 24) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 24) = -nan -nan -nan -nan cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 24) = 0 0 0 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 24) = nan 0 nan 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 24) = nan 0 nan 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 24) = nan 0 nan 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 24) = nan nan nan nan -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 25) = 0 0 0 nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 25) = nan 0 0 nan -cmpps(1 2 3 -4 , nan -0 nan inf , 25) = nan 0 nan nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 25) = nan nan nan nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 25) = nan nan nan nan -cmpps(nan -0 nan inf , nan -0 nan inf , 25) = nan 0 nan 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 26) = 0 0 0 nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 26) = nan 0 0 nan -cmpps(1 2 3 -4 , nan -0 nan inf , 26) = nan 0 nan nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 26) = nan nan nan nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 26) = nan nan nan nan -cmpps(nan -0 nan inf , nan -0 nan inf , 26) = nan nan nan nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 24) = -nan 0 -nan 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 24) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 24) = 0 0 0 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 24) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 24) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 24) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 24) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 24) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 24) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 25) = 0 0 0 0 +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 25) = 0 0 0 -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 25) = -nan 0 0 -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 25) = -nan 0 -nan -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 25) = -nan -nan -nan 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 25) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 25) = -nan 0 0 -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 25) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 25) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 25) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 25) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 25) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 25) = -nan -nan -nan 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 25) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 25) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 25) = -nan 0 -nan 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 26) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 26) = 0 0 0 -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 26) = -nan 0 0 -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 26) = -nan 0 -nan -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 26) = -nan -nan -nan 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 26) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 26) = -nan 0 0 -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 26) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 26) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 26) = 0 -nan -nan 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 26) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 26) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 26) = -nan -nan -nan 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 26) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 26) = -nan 0 -nan 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 26) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 27) = 0 0 0 0 cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 27) = 0 0 0 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 27) = 0 0 0 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 27) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 27) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 27) = 0 0 0 0 cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 27) = 0 0 0 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 27) = 0 0 0 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 27) = 0 0 0 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 27) = 0 0 0 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 27) = 0 0 0 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 28) = nan nan nan nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 28) = nan nan nan nan -cmpps(1 2 3 -4 , nan -0 nan inf , 28) = 0 nan 0 nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 28) = 0 nan 0 nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 28) = 0 nan 0 nan -cmpps(nan -0 nan inf , nan -0 nan inf , 28) = 0 0 0 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 29) = nan nan nan 0 -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 29) = 0 nan nan 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 29) = 0 nan 0 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 29) = 0 0 0 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 29) = 0 0 0 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 29) = 0 nan 0 nan -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 30) = nan nan nan 0 -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 30) = 0 nan nan 0 -cmpps(1 2 3 -4 , nan -0 nan inf , 30) = 0 nan 0 0 -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 30) = 0 0 0 0 -cmpps(inf -inf -inf 1 , nan -0 nan inf , 30) = 0 0 0 0 -cmpps(nan -0 nan inf , nan -0 nan inf , 30) = 0 0 0 0 -cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 31) = nan nan nan nan -cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 31) = nan nan nan nan -cmpps(1 2 3 -4 , nan -0 nan inf , 31) = nan nan nan nan -cmpps(0 -2 -10 0.5 , nan -0 nan inf , 31) = nan nan nan nan -cmpps(inf -inf -inf 1 , nan -0 nan inf , 31) = nan nan nan nan -cmpps(nan -0 nan inf , nan -0 nan inf , 31) = nan nan nan nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 27) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 27) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 27) = 0 0 0 0 +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 27) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 27) = 0 0 0 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 27) = 0 0 0 0 +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 27) = 0 0 0 0 +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 27) = 0 0 0 0 +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 27) = 0 0 0 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 28) = 0 0 0 0 +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 28) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 28) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 28) = 0 -nan 0 -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 28) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 28) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 28) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 28) = 0 -nan 0 -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 28) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 28) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 28) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 28) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 28) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 28) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 28) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 28) = 0 0 0 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 29) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 29) = -nan -nan -nan 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 29) = 0 -nan -nan 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 29) = 0 -nan 0 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 29) = 0 0 0 -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 29) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 29) = 0 -nan -nan 0 +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 29) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 29) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 29) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 29) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 29) = 0 0 0 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 29) = 0 0 0 -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 29) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 29) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 29) = 0 -nan 0 -nan +cmpps(1 2 3 -4 , 1 2 3 -4 , 30) = 0 0 0 0 +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 30) = -nan -nan -nan 0 +cmpps(1 2 3 -4 , inf -inf -inf 1 , 30) = 0 -nan -nan 0 +cmpps(1 2 3 -4 , +nan -0 -nan inf , 30) = 0 -nan 0 0 +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 30) = 0 0 0 -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 30) = 0 0 0 0 +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 30) = 0 -nan -nan 0 +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 30) = 0 0 0 0 +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 30) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 30) = -nan 0 0 -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 30) = 0 0 0 0 +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 30) = 0 0 0 0 +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 30) = 0 0 0 -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 30) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 30) = 0 -nan 0 -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 30) = 0 0 0 0 +cmpps(1 2 3 -4 , 1 2 3 -4 , 31) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , 0 -2 -10 0.5 , 31) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , inf -inf -inf 1 , 31) = -nan -nan -nan -nan +cmpps(1 2 3 -4 , +nan -0 -nan inf , 31) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , 1 2 3 -4 , 31) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 31) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , inf -inf -inf 1 , 31) = -nan -nan -nan -nan +cmpps(0 -2 -10 0.5 , +nan -0 -nan inf , 31) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 1 2 3 -4 , 31) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , 0 -2 -10 0.5 , 31) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , inf -inf -inf 1 , 31) = -nan -nan -nan -nan +cmpps(inf -inf -inf 1 , +nan -0 -nan inf , 31) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , 1 2 3 -4 , 31) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , 0 -2 -10 0.5 , 31) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , inf -inf -inf 1 , 31) = -nan -nan -nan -nan +cmpps(+nan -0 -nan inf , +nan -0 -nan inf , 31) = -nan -nan -nan -nan +shufps(1 2 3 -4 , 1 2 3 -4 , 0) = 1 1 1 1 shufps(1 2 3 -4 , 0 -2 -10 0.5 , 0) = 1 1 0 0 +shufps(1 2 3 -4 , inf -inf -inf 1 , 0) = 1 1 inf inf +shufps(1 2 3 -4 , +nan -0 -nan inf , 0) = 1 1 +nan +nan +shufps(0 -2 -10 0.5 , 1 2 3 -4 , 0) = 0 0 1 1 +shufps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 0) = 0 0 0 0 shufps(0 -2 -10 0.5 , inf -inf -inf 1 , 0) = 0 0 inf inf -shufps(1 2 3 -4 , nan -0 nan inf , 0) = 1 1 nan nan -shufps(0 -2 -10 0.5 , nan -0 nan inf , 0) = 0 0 nan nan -shufps(inf -inf -inf 1 , nan -0 nan inf , 0) = inf inf nan nan -shufps(nan -0 nan inf , nan -0 nan inf , 0) = nan nan nan nan +shufps(0 -2 -10 0.5 , +nan -0 -nan inf , 0) = 0 0 +nan +nan +shufps(inf -inf -inf 1 , 1 2 3 -4 , 0) = inf inf 1 1 +shufps(inf -inf -inf 1 , 0 -2 -10 0.5 , 0) = inf inf 0 0 +shufps(inf -inf -inf 1 , inf -inf -inf 1 , 0) = inf inf inf inf +shufps(inf -inf -inf 1 , +nan -0 -nan inf , 0) = inf inf +nan +nan +shufps(+nan -0 -nan inf , 1 2 3 -4 , 0) = +nan +nan 1 1 +shufps(+nan -0 -nan inf , 0 -2 -10 0.5 , 0) = +nan +nan 0 0 +shufps(+nan -0 -nan inf , inf -inf -inf 1 , 0) = +nan +nan inf inf +shufps(+nan -0 -nan inf , +nan -0 -nan inf , 0) = +nan +nan +nan +nan +shufps(1 2 3 -4 , 1 2 3 -4 , 21) = 2 2 2 1 shufps(1 2 3 -4 , 0 -2 -10 0.5 , 21) = 2 2 -2 0 +shufps(1 2 3 -4 , inf -inf -inf 1 , 21) = 2 2 -inf inf +shufps(1 2 3 -4 , +nan -0 -nan inf , 21) = 2 2 -0 +nan +shufps(0 -2 -10 0.5 , 1 2 3 -4 , 21) = -2 -2 2 1 +shufps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 21) = -2 -2 -2 0 shufps(0 -2 -10 0.5 , inf -inf -inf 1 , 21) = -2 -2 -inf inf -shufps(1 2 3 -4 , nan -0 nan inf , 21) = 2 2 -0 nan -shufps(0 -2 -10 0.5 , nan -0 nan inf , 21) = -2 -2 -0 nan -shufps(inf -inf -inf 1 , nan -0 nan inf , 21) = -inf -inf -0 nan -shufps(nan -0 nan inf , nan -0 nan inf , 21) = -0 -0 -0 nan +shufps(0 -2 -10 0.5 , +nan -0 -nan inf , 21) = -2 -2 -0 +nan +shufps(inf -inf -inf 1 , 1 2 3 -4 , 21) = -inf -inf 2 1 +shufps(inf -inf -inf 1 , 0 -2 -10 0.5 , 21) = -inf -inf -2 0 +shufps(inf -inf -inf 1 , inf -inf -inf 1 , 21) = -inf -inf -inf inf +shufps(inf -inf -inf 1 , +nan -0 -nan inf , 21) = -inf -inf -0 +nan +shufps(+nan -0 -nan inf , 1 2 3 -4 , 21) = -0 -0 2 1 +shufps(+nan -0 -nan inf , 0 -2 -10 0.5 , 21) = -0 -0 -2 0 +shufps(+nan -0 -nan inf , inf -inf -inf 1 , 21) = -0 -0 -inf inf +shufps(+nan -0 -nan inf , +nan -0 -nan inf , 21) = -0 -0 -0 +nan +shufps(1 2 3 -4 , 1 2 3 -4 , 255) = -4 -4 -4 -4 shufps(1 2 3 -4 , 0 -2 -10 0.5 , 255) = -4 -4 0.5 0.5 +shufps(1 2 3 -4 , inf -inf -inf 1 , 255) = -4 -4 1 1 +shufps(1 2 3 -4 , +nan -0 -nan inf , 255) = -4 -4 inf inf +shufps(0 -2 -10 0.5 , 1 2 3 -4 , 255) = 0.5 0.5 -4 -4 +shufps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 255) = 0.5 0.5 0.5 0.5 shufps(0 -2 -10 0.5 , inf -inf -inf 1 , 255) = 0.5 0.5 1 1 -shufps(1 2 3 -4 , nan -0 nan inf , 255) = -4 -4 inf inf -shufps(0 -2 -10 0.5 , nan -0 nan inf , 255) = 0.5 0.5 inf inf -shufps(inf -inf -inf 1 , nan -0 nan inf , 255) = 1 1 inf inf -shufps(nan -0 nan inf , nan -0 nan inf , 255) = inf inf inf inf +shufps(0 -2 -10 0.5 , +nan -0 -nan inf , 255) = 0.5 0.5 inf inf +shufps(inf -inf -inf 1 , 1 2 3 -4 , 255) = 1 1 -4 -4 +shufps(inf -inf -inf 1 , 0 -2 -10 0.5 , 255) = 1 1 0.5 0.5 +shufps(inf -inf -inf 1 , inf -inf -inf 1 , 255) = 1 1 1 1 +shufps(inf -inf -inf 1 , +nan -0 -nan inf , 255) = 1 1 inf inf +shufps(+nan -0 -nan inf , 1 2 3 -4 , 255) = inf inf -4 -4 +shufps(+nan -0 -nan inf , 0 -2 -10 0.5 , 255) = inf inf 0.5 0.5 +shufps(+nan -0 -nan inf , inf -inf -inf 1 , 255) = inf inf 1 1 +shufps(+nan -0 -nan inf , +nan -0 -nan inf , 255) = inf inf inf inf +shufps(1 2 3 -4 , 1 2 3 -4 , 2) = 3 1 1 1 shufps(1 2 3 -4 , 0 -2 -10 0.5 , 2) = 3 1 0 0 +shufps(1 2 3 -4 , inf -inf -inf 1 , 2) = 3 1 inf inf +shufps(1 2 3 -4 , +nan -0 -nan inf , 2) = 3 1 +nan +nan +shufps(0 -2 -10 0.5 , 1 2 3 -4 , 2) = -10 0 1 1 +shufps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 2) = -10 0 0 0 shufps(0 -2 -10 0.5 , inf -inf -inf 1 , 2) = -10 0 inf inf -shufps(1 2 3 -4 , nan -0 nan inf , 2) = 3 1 nan nan -shufps(0 -2 -10 0.5 , nan -0 nan inf , 2) = -10 0 nan nan -shufps(inf -inf -inf 1 , nan -0 nan inf , 2) = -inf inf nan nan -shufps(nan -0 nan inf , nan -0 nan inf , 2) = nan nan nan nan +shufps(0 -2 -10 0.5 , +nan -0 -nan inf , 2) = -10 0 +nan +nan +shufps(inf -inf -inf 1 , 1 2 3 -4 , 2) = -inf inf 1 1 +shufps(inf -inf -inf 1 , 0 -2 -10 0.5 , 2) = -inf inf 0 0 +shufps(inf -inf -inf 1 , inf -inf -inf 1 , 2) = -inf inf inf inf +shufps(inf -inf -inf 1 , +nan -0 -nan inf , 2) = -inf inf +nan +nan +shufps(+nan -0 -nan inf , 1 2 3 -4 , 2) = -nan +nan 1 1 +shufps(+nan -0 -nan inf , 0 -2 -10 0.5 , 2) = -nan +nan 0 0 +shufps(+nan -0 -nan inf , inf -inf -inf 1 , 2) = -nan +nan inf inf +shufps(+nan -0 -nan inf , +nan -0 -nan inf , 2) = -nan +nan +nan +nan sqrtsd(1 2 , 1 2 ) = 1 2 sqrtsd(1 2 , 0 -2 ) = 0 2 sqrtsd(1 2 , inf -inf ) = inf 2 @@ -729,28 +2051,20 @@ maxsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 cvtps2dq(1 2 3 -4 ) = 0x1 0x2 0x3 0xfffffffc cvtps2dq(0 -2 -10 0.5 ) = 0x0 0xfffffffe 0xfffffff6 0x0 cvtps2dq(inf -inf -inf 1 ) = 0x80000000 0x80000000 0x80000000 0x1 -cvtps2dq(nan -0 nan inf ) = 0x80000000 0x0 0x80000000 0x80000000 +cvtps2dq(+nan -0 -nan inf ) = 0x80000000 0x0 0x80000000 0x80000000 +dpps(1 2 3 -4 , 1 2 3 -4 , 255) = 30 30 30 30 dpps(1 2 3 -4 , 0 -2 -10 0.5 , 255) = -36 -36 -36 -36 -dpps(0 -2 -10 0.5 , inf -inf -inf 1 , 255) = nan nan nan nan -dpps(1 2 3 -4 , nan -0 nan inf , 255) = nan nan nan nan -dpps(0 -2 -10 0.5 , nan -0 nan inf , 255) = nan nan nan nan -dpps(inf -inf -inf 1 , nan -0 nan inf , 255) = nan nan nan nan -dpps(nan -0 nan inf , nan -0 nan inf , 255) = nan nan nan nan +dpps(0 -2 -10 0.5 , 1 2 3 -4 , 255) = -36 -36 -36 -36 +dpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 255) = 104.25 104.25 104.25 104.25 +dpps(1 2 3 -4 , 1 2 3 -4 , 63) = 5 5 5 5 dpps(1 2 3 -4 , 0 -2 -10 0.5 , 63) = -4 -4 -4 -4 -dpps(0 -2 -10 0.5 , inf -inf -inf 1 , 63) = nan nan nan nan -dpps(1 2 3 -4 , nan -0 nan inf , 63) = nan nan nan nan -dpps(0 -2 -10 0.5 , nan -0 nan inf , 63) = nan nan nan nan -dpps(inf -inf -inf 1 , nan -0 nan inf , 63) = nan nan nan nan -dpps(nan -0 nan inf , nan -0 nan inf , 63) = nan nan nan nan +dpps(0 -2 -10 0.5 , 1 2 3 -4 , 63) = -4 -4 -4 -4 +dpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 63) = 4 4 4 4 +dpps(1 2 3 -4 , 1 2 3 -4 , 243) = 30 30 0 0 dpps(1 2 3 -4 , 0 -2 -10 0.5 , 243) = -36 -36 0 0 -dpps(0 -2 -10 0.5 , inf -inf -inf 1 , 243) = nan nan 0 0 -dpps(1 2 3 -4 , nan -0 nan inf , 243) = nan nan 0 0 -dpps(0 -2 -10 0.5 , nan -0 nan inf , 243) = nan nan 0 0 -dpps(inf -inf -inf 1 , nan -0 nan inf , 243) = nan nan 0 0 -dpps(nan -0 nan inf , nan -0 nan inf , 243) = nan nan 0 0 +dpps(0 -2 -10 0.5 , 1 2 3 -4 , 243) = -36 -36 0 0 +dpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 243) = 104.25 104.25 0 0 +dpps(1 2 3 -4 , 1 2 3 -4 , 83) = 10 10 0 0 dpps(1 2 3 -4 , 0 -2 -10 0.5 , 83) = -30 -30 0 0 -dpps(0 -2 -10 0.5 , inf -inf -inf 1 , 83) = nan nan 0 0 -dpps(1 2 3 -4 , nan -0 nan inf , 83) = nan nan 0 0 -dpps(0 -2 -10 0.5 , nan -0 nan inf , 83) = nan nan 0 0 -dpps(inf -inf -inf 1 , nan -0 nan inf , 83) = nan nan 0 0 -dpps(nan -0 nan inf , nan -0 nan inf , 83) = nan nan 0 0 +dpps(0 -2 -10 0.5 , 1 2 3 -4 , 83) = -30 -30 0 0 +dpps(0 -2 -10 0.5 , 0 -2 -10 0.5 , 83) = 100 100 0 0 diff --git a/tests/ref31.txt b/tests/ref31.txt new file mode 100644 index 0000000..358877e --- /dev/null +++ b/tests/ref31.txt @@ -0,0 +1,810 @@ +Testing: s = (0x1.123456789abcp2) -> (double)s +FE_TONEAREST 0x1.123456789abcp+2 +FE_DOWNWARD 0x1.123456789abcp+2 +FE_UPWARD 0x1.123456789abcp+2 +FE_TOWARDZERO 0x1.123456789abcp+2 + +Testing: s = (0x1.123456789abcp2) -> (float)s +FE_TONEAREST 0x1.123456p+2 +FE_DOWNWARD 0x1.123456p+2 +FE_UPWARD 0x1.123458p+2 +FE_TOWARDZERO 0x1.123456p+2 + +Testing: s = (-(0x1.123456789abcp2)) -> (double)s +FE_TONEAREST -0x1.123456789abcp+2 +FE_DOWNWARD -0x1.123456789abcp+2 +FE_UPWARD -0x1.123456789abcp+2 +FE_TOWARDZERO -0x1.123456789abcp+2 + +Testing: s = (-(0x1.123456789abcp2)) -> (float)s +FE_TONEAREST -0x1.123456p+2 +FE_DOWNWARD -0x1.123458p+2 +FE_UPWARD -0x1.123456p+2 +FE_TOWARDZERO -0x1.123456p+2 + +Testing: d = (0x1.123456789abcp512) -> (float)d +FE_TONEAREST inf +FE_DOWNWARD 0x1.fffffep+127 +FE_UPWARD inf +FE_TOWARDZERO 0x1.fffffep+127 + +Testing: s = (0x1.123456789abcp29) -> (double)s +FE_TONEAREST 0x1.123456789abcp+29 +FE_DOWNWARD 0x1.123456789abcp+29 +FE_UPWARD 0x1.123456789abcp+29 +FE_TOWARDZERO 0x1.123456789abcp+29 + +Testing: s = (0x1.123456789abcp29) -> (float)s +FE_TONEAREST 0x1.123456p+29 +FE_DOWNWARD 0x1.123456p+29 +FE_UPWARD 0x1.123458p+29 +FE_TOWARDZERO 0x1.123456p+29 + +Testing: s = (0x1.123456789abcp29) -> (int16_t)s +FE_TONEAREST -32768 +FE_DOWNWARD -32768 +FE_UPWARD -32768 +FE_TOWARDZERO -32768 + +Testing: s = (0x1.123456789abcp29) -> (int8_t)s +FE_TONEAREST 0 +FE_DOWNWARD 0 +FE_UPWARD 0 +FE_TOWARDZERO 0 + +Testing: s = (0x1.123456789abcp29) -> (unsigned short)s +FE_TONEAREST 35535 +FE_DOWNWARD 35535 +FE_UPWARD 35535 +FE_TOWARDZERO 35535 + +Testing: s = (0x1.123456789abcp29) -> (unsigned char)s +FE_TONEAREST 0 +FE_DOWNWARD 0 +FE_UPWARD 0 +FE_TOWARDZERO 0 + +Testing: s = (-(0x1.123456789abcp29)) -> (double)s +FE_TONEAREST -0x1.123456789abcp+29 +FE_DOWNWARD -0x1.123456789abcp+29 +FE_UPWARD -0x1.123456789abcp+29 +FE_TOWARDZERO -0x1.123456789abcp+29 + +Testing: s = (-(0x1.123456789abcp29)) -> (float)s +FE_TONEAREST -0x1.123456p+29 +FE_DOWNWARD -0x1.123458p+29 +FE_UPWARD -0x1.123456p+29 +FE_TOWARDZERO -0x1.123456p+29 + +Testing: d = (-0x1.123456789abcp30) -> (int32_t)d +FE_TONEAREST -1150096798 +FE_DOWNWARD -1150096798 +FE_UPWARD -1150096798 +FE_TOWARDZERO -1150096798 + +Testing: d = (-0x1.123456789abcp62) -> (int64_t)d +FE_TONEAREST -4939628135293321216 +FE_DOWNWARD -4939628135293321216 +FE_UPWARD -4939628135293321216 +FE_TOWARDZERO -4939628135293321216 + +Testing: s = (0x1.123456789abcp2f) -> (double)s +FE_TONEAREST 0x1.123456p+2 +FE_DOWNWARD 0x1.123456p+2 +FE_UPWARD 0x1.123458p+2 +FE_TOWARDZERO 0x1.123456p+2 + +Testing: s = (0x1.123456789abcp2f) -> (float)s +FE_TONEAREST 0x1.123456p+2 +FE_DOWNWARD 0x1.123456p+2 +FE_UPWARD 0x1.123458p+2 +FE_TOWARDZERO 0x1.123456p+2 + +Testing: s = (-(0x1.123456789abcp2f)) -> (double)s +FE_TONEAREST -0x1.123456p+2 +FE_DOWNWARD -0x1.123458p+2 +FE_UPWARD -0x1.123456p+2 +FE_TOWARDZERO -0x1.123456p+2 + +Testing: s = (-(0x1.123456789abcp2f)) -> (float)s +FE_TONEAREST -0x1.123456p+2 +FE_DOWNWARD -0x1.123458p+2 +FE_UPWARD -0x1.123456p+2 +FE_TOWARDZERO -0x1.123456p+2 + +Testing: s = (0x1.123456789abcp29f) -> (double)s +FE_TONEAREST 0x1.123456p+29 +FE_DOWNWARD 0x1.123456p+29 +FE_UPWARD 0x1.123458p+29 +FE_TOWARDZERO 0x1.123456p+29 + +Testing: s = (0x1.123456789abcp29f) -> (float)s +FE_TONEAREST 0x1.123456p+29 +FE_DOWNWARD 0x1.123456p+29 +FE_UPWARD 0x1.123458p+29 +FE_TOWARDZERO 0x1.123456p+29 + +Testing: s = (0x1.123456789abcp29f) -> (int16_t)s +FE_TONEAREST -32768 +FE_DOWNWARD -32768 +FE_UPWARD -32768 +FE_TOWARDZERO -32768 + +Testing: s = (0x1.123456789abcp29f) -> (int8_t)s +FE_TONEAREST 0 +FE_DOWNWARD 0 +FE_UPWARD 0 +FE_TOWARDZERO 0 + +Testing: s = (0x1.123456789abcp29f) -> (unsigned short)s +FE_TONEAREST 35520 +FE_DOWNWARD 35520 +FE_UPWARD 35584 +FE_TOWARDZERO 35520 + +Testing: s = (0x1.123456789abcp29f) -> (unsigned char)s +FE_TONEAREST 0 +FE_DOWNWARD 0 +FE_UPWARD 0 +FE_TOWARDZERO 0 + +Testing: s = (-(0x1.123456789abcp29f)) -> (double)s +FE_TONEAREST -0x1.123456p+29 +FE_DOWNWARD -0x1.123458p+29 +FE_UPWARD -0x1.123456p+29 +FE_TOWARDZERO -0x1.123456p+29 + +Testing: s = (-(0x1.123456789abcp29f)) -> (float)s +FE_TONEAREST -0x1.123456p+29 +FE_DOWNWARD -0x1.123458p+29 +FE_UPWARD -0x1.123456p+29 +FE_TOWARDZERO -0x1.123456p+29 + +Testing: f = -0x1.123456789abcp30f -> (int32_t)f +FE_TONEAREST -1150096768 +FE_DOWNWARD -1150096896 +FE_UPWARD -1150096768 +FE_TOWARDZERO -1150096768 + +Testing: d = -0x1.1234567p0 -> (double)((int)d) +FE_TONEAREST -0x1p+0 +FE_DOWNWARD -0x1p+0 +FE_UPWARD -0x1p+0 +FE_TOWARDZERO -0x1p+0 + +Testing: d = 0x1.9234567p0 -> (double)((int)d) +FE_TONEAREST 0x1p+0 +FE_DOWNWARD 0x1p+0 +FE_UPWARD 0x1p+0 +FE_TOWARDZERO 0x1p+0 + +Testing: d = -0x1.9234567p0 -> (double)((int)d) +FE_TONEAREST -0x1p+0 +FE_DOWNWARD -0x1p+0 +FE_UPWARD -0x1p+0 +FE_TOWARDZERO -0x1p+0 + +Testing: d = 0x1.1234567p0 -> (double)((long int)d) +FE_TONEAREST 0x1p+0 +FE_DOWNWARD 0x1p+0 +FE_UPWARD 0x1p+0 +FE_TOWARDZERO 0x1p+0 + +Testing: d = -0x1.1234567p0 -> (double)((long int)d) +FE_TONEAREST -0x1p+0 +FE_DOWNWARD -0x1p+0 +FE_UPWARD -0x1p+0 +FE_TOWARDZERO -0x1p+0 + +Testing: d = 0x1.9234567p0 -> (double)((long int)d) +FE_TONEAREST 0x1p+0 +FE_DOWNWARD 0x1p+0 +FE_UPWARD 0x1p+0 +FE_TOWARDZERO 0x1p+0 + +Testing: d = -0x1.9234567p0 -> (double)((long int)d) +FE_TONEAREST -0x1p+0 +FE_DOWNWARD -0x1p+0 +FE_UPWARD -0x1p+0 +FE_TOWARDZERO -0x1p+0 + +Testing: (d1 = (1.0), d2 = (0x1.0000000000001p0)) -> d1 + d2 +FE_TONEAREST 0x1p+1 +FE_DOWNWARD 0x1p+1 +FE_UPWARD 0x1.0000000000001p+1 +FE_TOWARDZERO 0x1p+1 + +Testing: (d1 = -(1.0), d2 = (0x1.0000000000001p0)) -> d1 + d2 +FE_TONEAREST 0x1p-52 +FE_DOWNWARD 0x1p-52 +FE_UPWARD 0x1p-52 +FE_TOWARDZERO 0x1p-52 + +Testing: (d1 = (1.0), d2 = -(0x1.0000000000001p0)) -> d1 + d2 +FE_TONEAREST -0x1p-52 +FE_DOWNWARD -0x1p-52 +FE_UPWARD -0x1p-52 +FE_TOWARDZERO -0x1p-52 + +Testing: (d1 = -(1.0), d2 = -(0x1.0000000000001p0)) -> d1 + d2 +FE_TONEAREST -0x1p+1 +FE_DOWNWARD -0x1.0000000000001p+1 +FE_UPWARD -0x1p+1 +FE_TOWARDZERO -0x1p+1 + +Testing: (d1 = (1.0), d2 = (0x1.0000000000001p0)) -> d1 - d2 +FE_TONEAREST -0x1p-52 +FE_DOWNWARD -0x1p-52 +FE_UPWARD -0x1p-52 +FE_TOWARDZERO -0x1p-52 + +Testing: (d1 = -(1.0), d2 = (0x1.0000000000001p0)) -> d1 - d2 +FE_TONEAREST -0x1p+1 +FE_DOWNWARD -0x1.0000000000001p+1 +FE_UPWARD -0x1p+1 +FE_TOWARDZERO -0x1p+1 + +Testing: (d1 = (1.0), d2 = -(0x1.0000000000001p0)) -> d1 - d2 +FE_TONEAREST 0x1p+1 +FE_DOWNWARD 0x1p+1 +FE_UPWARD 0x1.0000000000001p+1 +FE_TOWARDZERO 0x1p+1 + +Testing: (d1 = -(1.0), d2 = -(0x1.0000000000001p0)) -> d1 - d2 +FE_TONEAREST 0x1p-52 +FE_DOWNWARD 0x1p-52 +FE_UPWARD 0x1p-52 +FE_TOWARDZERO 0x1p-52 + +Testing: (d1 = (1.0), d2 = (0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST 0x1p-52 +FE_DOWNWARD 0x1p-52 +FE_UPWARD 0x1p-52 +FE_TOWARDZERO 0x1p-52 + +Testing: (d1 = -(1.0), d2 = (0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST 0x1p+1 +FE_DOWNWARD 0x1p+1 +FE_UPWARD 0x1.0000000000001p+1 +FE_TOWARDZERO 0x1p+1 + +Testing: (d1 = (1.0), d2 = -(0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST -0x1p+1 +FE_DOWNWARD -0x1.0000000000001p+1 +FE_UPWARD -0x1p+1 +FE_TOWARDZERO -0x1p+1 + +Testing: (d1 = -(1.0), d2 = -(0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST -0x1p-52 +FE_DOWNWARD -0x1p-52 +FE_UPWARD -0x1p-52 +FE_TOWARDZERO -0x1p-52 + +Testing: (d1 = (1.0), d2 = (0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST 0x1.1000000000001p+0 +FE_DOWNWARD 0x1.1p+0 +FE_UPWARD 0x1.1000000000001p+0 +FE_TOWARDZERO 0x1.1p+0 + +Testing: (d1 = -(1.0), d2 = (0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST -0x1.dfffffffffffep-1 +FE_DOWNWARD -0x1.dffffffffffffp-1 +FE_UPWARD -0x1.dfffffffffffep-1 +FE_TOWARDZERO -0x1.dfffffffffffep-1 + +Testing: (d1 = (1.0), d2 = -(0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST 0x1.dfffffffffffep-1 +FE_DOWNWARD 0x1.dfffffffffffep-1 +FE_UPWARD 0x1.dffffffffffffp-1 +FE_TOWARDZERO 0x1.dfffffffffffep-1 + +Testing: (d1 = -(1.0), d2 = -(0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST -0x1.1000000000001p+0 +FE_DOWNWARD -0x1.1000000000001p+0 +FE_UPWARD -0x1.1p+0 +FE_TOWARDZERO -0x1.1p+0 + +Testing: (d1 = (1.0), d2 = (0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST 0x1.dfffffffffffep-1 +FE_DOWNWARD 0x1.dfffffffffffep-1 +FE_UPWARD 0x1.dffffffffffffp-1 +FE_TOWARDZERO 0x1.dfffffffffffep-1 + +Testing: (d1 = -(1.0), d2 = (0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST -0x1.1000000000001p+0 +FE_DOWNWARD -0x1.1000000000001p+0 +FE_UPWARD -0x1.1p+0 +FE_TOWARDZERO -0x1.1p+0 + +Testing: (d1 = (1.0), d2 = -(0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST 0x1.1000000000001p+0 +FE_DOWNWARD 0x1.1p+0 +FE_UPWARD 0x1.1000000000001p+0 +FE_TOWARDZERO 0x1.1p+0 + +Testing: (d1 = -(1.0), d2 = -(0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST -0x1.dfffffffffffep-1 +FE_DOWNWARD -0x1.dffffffffffffp-1 +FE_UPWARD -0x1.dfffffffffffep-1 +FE_TOWARDZERO -0x1.dfffffffffffep-1 + +Testing: (d1 = (1.0), d2 = (0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST -0x1.dfffffffffffep-1 +FE_DOWNWARD -0x1.dffffffffffffp-1 +FE_UPWARD -0x1.dfffffffffffep-1 +FE_TOWARDZERO -0x1.dfffffffffffep-1 + +Testing: (d1 = -(1.0), d2 = (0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST 0x1.1000000000001p+0 +FE_DOWNWARD 0x1.1p+0 +FE_UPWARD 0x1.1000000000001p+0 +FE_TOWARDZERO 0x1.1p+0 + +Testing: (d1 = (1.0), d2 = -(0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST -0x1.1000000000001p+0 +FE_DOWNWARD -0x1.1000000000001p+0 +FE_UPWARD -0x1.1p+0 +FE_TOWARDZERO -0x1.1p+0 + +Testing: (d1 = -(1.0), d2 = -(0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST 0x1.dfffffffffffep-1 +FE_DOWNWARD 0x1.dfffffffffffep-1 +FE_UPWARD 0x1.dffffffffffffp-1 +FE_TOWARDZERO 0x1.dfffffffffffep-1 + +Testing: (d1 = (0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 + d2 +FE_TONEAREST 0x1.2bc55ef8922bp+1 +FE_DOWNWARD 0x1.2bc55ef8922bp+1 +FE_UPWARD 0x1.2bc55ef8922bp+1 +FE_TOWARDZERO 0x1.2bc55ef8922bp+1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 + d2 +FE_TONEAREST 0x1.12233445566p-4 +FE_DOWNWARD 0x1.12233445566p-4 +FE_UPWARD 0x1.12233445566p-4 +FE_TOWARDZERO 0x1.12233445566p-4 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 + d2 +FE_TONEAREST -0x1.12233445566p-4 +FE_DOWNWARD -0x1.12233445566p-4 +FE_UPWARD -0x1.12233445566p-4 +FE_TOWARDZERO -0x1.12233445566p-4 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 + d2 +FE_TONEAREST -0x1.2bc55ef8922bp+1 +FE_DOWNWARD -0x1.2bc55ef8922bp+1 +FE_UPWARD -0x1.2bc55ef8922bp+1 +FE_TOWARDZERO -0x1.2bc55ef8922bp+1 + +Testing: (d1 = (0x1.233445566778p0f), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd404804dp+0 +FE_DOWNWARD 0x1.5ebd3ddf57ep+0 +FE_UPWARD 0x1.5ebd428e6d5cp+0 +FE_TOWARDZERO 0x1.5ebd3ddf57ep+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd404804dp+0 +FE_DOWNWARD -0x1.5ebd404804dp+0 +FE_UPWARD -0x1.5ebd4025c068p+0 +FE_TOWARDZERO -0x1.5ebd3ddf57ep+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd404804dp+0 +FE_DOWNWARD -0x1.5ebd4025c068p+0 +FE_UPWARD -0x1.5ebd404804dp+0 +FE_TOWARDZERO -0x1.5ebd3ddf57ep+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd404804dp+0 +FE_DOWNWARD 0x1.5ebd428e6d5cp+0 +FE_UPWARD 0x1.5ebd3ddf57ep+0 +FE_TOWARDZERO 0x1.5ebd3ddf57ep+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd40f80919p+0 +FE_DOWNWARD 0x1.5ebd3e8f5c27dp+0 +FE_UPWARD 0x1.5ebd40f809191p+0 +FE_TOWARDZERO 0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd40f80919p+0 +FE_DOWNWARD -0x1.5ebd40f809191p+0 +FE_UPWARD -0x1.5ebd3e8f5c27dp+0 +FE_TOWARDZERO -0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd40f80919p+0 +FE_DOWNWARD -0x1.5ebd3e8f5c27ep+0 +FE_UPWARD -0x1.5ebd40f80919p+0 +FE_TOWARDZERO -0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd40f80919p+0 +FE_DOWNWARD 0x1.5ebd40f80919p+0 +FE_UPWARD 0x1.5ebd3e8f5c27ep+0 +FE_TOWARDZERO 0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = (0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd402bc44c4p+0 +FE_DOWNWARD 0x1.5ebd402bc44c4p+0 +FE_UPWARD 0x1.5ebd402bc44c5p+0 +FE_TOWARDZERO 0x1.5ebd402bc44c4p+0 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd402bc44c4p+0 +FE_DOWNWARD -0x1.5ebd402bc44c5p+0 +FE_UPWARD -0x1.5ebd402bc44c4p+0 +FE_TOWARDZERO -0x1.5ebd402bc44c4p+0 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd402bc44c4p+0 +FE_DOWNWARD -0x1.5ebd402bc44c5p+0 +FE_UPWARD -0x1.5ebd402bc44c4p+0 +FE_TOWARDZERO -0x1.5ebd402bc44c4p+0 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd402bc44c4p+0 +FE_DOWNWARD 0x1.5ebd402bc44c4p+0 +FE_UPWARD 0x1.5ebd402bc44c5p+0 +FE_TOWARDZERO 0x1.5ebd402bc44c4p+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd40f80919p+0 +FE_DOWNWARD 0x1.5ebd3e8f5c27dp+0 +FE_UPWARD 0x1.5ebd40f809191p+0 +FE_TOWARDZERO 0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd40f80919p+0 +FE_DOWNWARD -0x1.5ebd40f809191p+0 +FE_UPWARD -0x1.5ebd3e8f5c27dp+0 +FE_TOWARDZERO -0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd40f80919p+0 +FE_DOWNWARD -0x1.5ebd3e8f5c27ep+0 +FE_UPWARD -0x1.5ebd40f80919p+0 +FE_TOWARDZERO -0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd40f80919p+0 +FE_DOWNWARD 0x1.5ebd40f80919p+0 +FE_UPWARD 0x1.5ebd3e8f5c27ep+0 +FE_TOWARDZERO 0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = (0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd3f7bc003ap+0 +FE_DOWNWARD 0x1.5ebd3f7bc003ap+0 +FE_UPWARD 0x1.5ebd41c2288e5p+0 +FE_TOWARDZERO 0x1.5ebd3f7bc003ap+0 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd3f7bc003ap+0 +FE_DOWNWARD -0x1.5ebd3f7bc003bp+0 +FE_UPWARD -0x1.5ebd41c2288e4p+0 +FE_TOWARDZERO -0x1.5ebd3f7bc003ap+0 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd3f7bc003ap+0 +FE_DOWNWARD -0x1.5ebd41c2288e5p+0 +FE_UPWARD -0x1.5ebd3f7bc003ap+0 +FE_TOWARDZERO -0x1.5ebd3f7bc003ap+0 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd3f7bc003ap+0 +FE_DOWNWARD 0x1.5ebd41c2288e4p+0 +FE_UPWARD 0x1.5ebd3f7bc003bp+0 +FE_TOWARDZERO 0x1.5ebd3f7bc003ap+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd404804dp+0 +FE_DOWNWARD 0x1.5ebd3ddf57ep+0 +FE_UPWARD 0x1.5ebd428e6d5cp+0 +FE_TOWARDZERO 0x1.5ebd3ddf57ep+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd404804dp+0 +FE_DOWNWARD -0x1.5ebd404804dp+0 +FE_UPWARD -0x1.5ebd4025c068p+0 +FE_TOWARDZERO -0x1.5ebd3ddf57ep+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd404804dp+0 +FE_DOWNWARD -0x1.5ebd4025c068p+0 +FE_UPWARD -0x1.5ebd404804dp+0 +FE_TOWARDZERO -0x1.5ebd3ddf57ep+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd404804dp+0 +FE_DOWNWARD 0x1.5ebd428e6d5cp+0 +FE_UPWARD 0x1.5ebd3ddf57ep+0 +FE_TOWARDZERO 0x1.5ebd3ddf57ep+0 + +Testing: (d1 = (0x1.233445566778p0), d2 = (5)) -> d1 *d2 +FE_TONEAREST 0x1.6c0156ac0156p+2 +FE_DOWNWARD 0x1.6c0156ac0156p+2 +FE_UPWARD 0x1.6c0156ac0156p+2 +FE_TOWARDZERO 0x1.6c0156ac0156p+2 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (5)) -> d1 *d2 +FE_TONEAREST -0x1.6c0156ac0156p+2 +FE_DOWNWARD -0x1.6c0156ac0156p+2 +FE_UPWARD -0x1.6c0156ac0156p+2 +FE_TOWARDZERO -0x1.6c0156ac0156p+2 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(5)) -> d1 *d2 +FE_TONEAREST -0x1.6c0156ac0156p+2 +FE_DOWNWARD -0x1.6c0156ac0156p+2 +FE_UPWARD -0x1.6c0156ac0156p+2 +FE_TOWARDZERO -0x1.6c0156ac0156p+2 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(5)) -> d1 *d2 +FE_TONEAREST 0x1.6c0156ac0156p+2 +FE_DOWNWARD 0x1.6c0156ac0156p+2 +FE_UPWARD 0x1.6c0156ac0156p+2 +FE_TOWARDZERO 0x1.6c0156ac0156p+2 + +Testing: (d1 = (15), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.2111111111102p+4 +FE_DOWNWARD 0x1.2111111111102p+4 +FE_UPWARD 0x1.2111111111102p+4 +FE_TOWARDZERO 0x1.2111111111102p+4 + +Testing: (d1 = -(15), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.2111111111102p+4 +FE_DOWNWARD -0x1.2111111111102p+4 +FE_UPWARD -0x1.2111111111102p+4 +FE_TOWARDZERO -0x1.2111111111102p+4 + +Testing: (d1 = (15), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.2111111111102p+4 +FE_DOWNWARD -0x1.2111111111102p+4 +FE_UPWARD -0x1.2111111111102p+4 +FE_TOWARDZERO -0x1.2111111111102p+4 + +Testing: (d1 = -(15), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.2111111111102p+4 +FE_DOWNWARD 0x1.2111111111102p+4 +FE_UPWARD 0x1.2111111111102p+4 +FE_TOWARDZERO 0x1.2111111111102p+4 + +Testing: (d1 = (0x1.233445566778p0f), d2 = (15)) -> d1 *d2 +FE_TONEAREST 0x1.110101ap+4 +FE_DOWNWARD 0x1.1100ffcp+4 +FE_UPWARD 0x1.110101ap+4 +FE_TOWARDZERO 0x1.1100ffcp+4 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = (15)) -> d1 *d2 +FE_TONEAREST -0x1.110101ap+4 +FE_DOWNWARD -0x1.110101ap+4 +FE_UPWARD -0x1.1100ffcp+4 +FE_TOWARDZERO -0x1.1100ffcp+4 + +Testing: (d1 = (0x1.233445566778p0f), d2 = -(15)) -> d1 *d2 +FE_TONEAREST -0x1.110101ap+4 +FE_DOWNWARD -0x1.1100ffcp+4 +FE_UPWARD -0x1.110101ap+4 +FE_TOWARDZERO -0x1.1100ffcp+4 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = -(15)) -> d1 *d2 +FE_TONEAREST 0x1.110101ap+4 +FE_DOWNWARD 0x1.110101ap+4 +FE_UPWARD 0x1.1100ffcp+4 +FE_TOWARDZERO 0x1.1100ffcp+4 + +Testing: (d1 = (15), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.2111108p+4 +FE_DOWNWARD 0x1.2111108p+4 +FE_UPWARD 0x1.2111126p+4 +FE_TOWARDZERO 0x1.2111108p+4 + +Testing: (d1 = -(15), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.2111108p+4 +FE_DOWNWARD -0x1.2111108p+4 +FE_UPWARD -0x1.2111126p+4 +FE_TOWARDZERO -0x1.2111108p+4 + +Testing: (d1 = (15), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.2111108p+4 +FE_DOWNWARD -0x1.2111126p+4 +FE_UPWARD -0x1.2111108p+4 +FE_TOWARDZERO -0x1.2111108p+4 + +Testing: (d1 = -(15), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.2111108p+4 +FE_DOWNWARD 0x1.2111126p+4 +FE_UPWARD 0x1.2111108p+4 +FE_TOWARDZERO 0x1.2111108p+4 + +Testing: (d1 = (0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST 0x1.e38ca44203ab9p-1 +FE_DOWNWARD 0x1.e38ca44203ab8p-1 +FE_UPWARD 0x1.e38ca44203ab9p-1 +FE_TOWARDZERO 0x1.e38ca44203ab8p-1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST -0x1.e38ca44203ab9p-1 +FE_DOWNWARD -0x1.e38ca44203ab9p-1 +FE_UPWARD -0x1.e38ca44203ab8p-1 +FE_TOWARDZERO -0x1.e38ca44203ab8p-1 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST -0x1.e38ca44203ab9p-1 +FE_DOWNWARD -0x1.e38ca44203ab9p-1 +FE_UPWARD -0x1.e38ca44203ab8p-1 +FE_TOWARDZERO -0x1.e38ca44203ab8p-1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST 0x1.e38ca44203ab9p-1 +FE_DOWNWARD 0x1.e38ca44203ab8p-1 +FE_UPWARD 0x1.e38ca44203ab9p-1 +FE_TOWARDZERO 0x1.e38ca44203ab8p-1 + +Testing: (d1 = (0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST 0x1.e38ca44203ab9p-1 +FE_DOWNWARD 0x1.e38ca44203ab8p-1 +FE_UPWARD 0x1.e38ca44203ab9p-1 +FE_TOWARDZERO 0x1.e38ca44203ab8p-1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST -0x1.e38ca44203ab9p-1 +FE_DOWNWARD -0x1.e38ca44203ab9p-1 +FE_UPWARD -0x1.e38ca44203ab8p-1 +FE_TOWARDZERO -0x1.e38ca44203ab8p-1 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST -0x1.e38ca44203ab9p-1 +FE_DOWNWARD -0x1.e38ca44203ab9p-1 +FE_UPWARD -0x1.e38ca44203ab8p-1 +FE_TOWARDZERO -0x1.e38ca44203ab8p-1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST 0x1.e38ca44203ab9p-1 +FE_DOWNWARD 0x1.e38ca44203ab8p-1 +FE_UPWARD 0x1.e38ca44203ab9p-1 +FE_TOWARDZERO 0x1.e38ca44203ab8p-1 + +Testing: (d1 = (0x1.233445566778p0), d2 = (0x1.3456789abcdep0f)) -> d1 / d2 +FE_TONEAREST 0x1.e38ca534ae61p-1 +FE_DOWNWARD 0x1.e38ca534ae61p-1 +FE_UPWARD 0x1.e38ca211bd4adp-1 +FE_TOWARDZERO 0x1.e38ca534ae61p-1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (0x1.3456789abcdep0f)) -> d1 / d2 +FE_TONEAREST -0x1.e38ca534ae61p-1 +FE_DOWNWARD -0x1.e38ca534ae611p-1 +FE_UPWARD -0x1.e38ca211bd4acp-1 +FE_TOWARDZERO -0x1.e38ca534ae61p-1 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(0x1.3456789abcdep0f)) -> d1 / d2 +FE_TONEAREST -0x1.e38ca534ae61p-1 +FE_DOWNWARD -0x1.e38ca211bd4adp-1 +FE_UPWARD -0x1.e38ca534ae61p-1 +FE_TOWARDZERO -0x1.e38ca534ae61p-1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(0x1.3456789abcdep0f)) -> d1 / d2 +FE_TONEAREST 0x1.e38ca534ae61p-1 +FE_DOWNWARD 0x1.e38ca211bd4acp-1 +FE_UPWARD 0x1.e38ca534ae611p-1 +FE_TOWARDZERO 0x1.e38ca534ae61p-1 + +Testing: (d1 = (1.0), d2 = (0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST 0x1p-52 +FE_DOWNWARD 0x1p-52 +FE_UPWARD 0x1p-52 +FE_TOWARDZERO 0x1p-52 + +Testing: (d1 = -(1.0), d2 = (0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST 0x1p+1 +FE_DOWNWARD 0x1p+1 +FE_UPWARD 0x1.0000000000001p+1 +FE_TOWARDZERO 0x1p+1 + +Testing: (d1 = (1.0), d2 = -(0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST -0x1p+1 +FE_DOWNWARD -0x1.0000000000001p+1 +FE_UPWARD -0x1p+1 +FE_TOWARDZERO -0x1p+1 + +Testing: (d1 = -(1.0), d2 = -(0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST -0x1p-52 +FE_DOWNWARD -0x1p-52 +FE_UPWARD -0x1p-52 +FE_TOWARDZERO -0x1p-52 + +Testing: (d1 = (1.0), d2 = (0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST 0x1.1000000000001p+0 +FE_DOWNWARD 0x1.1p+0 +FE_UPWARD 0x1.1000000000001p+0 +FE_TOWARDZERO 0x1.1p+0 + +Testing: (d1 = -(1.0), d2 = (0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST -0x1.dfffffffffffep-1 +FE_DOWNWARD -0x1.dffffffffffffp-1 +FE_UPWARD -0x1.dfffffffffffep-1 +FE_TOWARDZERO -0x1.dfffffffffffep-1 + +Testing: (d1 = (1.0), d2 = -(0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST 0x1.dfffffffffffep-1 +FE_DOWNWARD 0x1.dfffffffffffep-1 +FE_UPWARD 0x1.dffffffffffffp-1 +FE_TOWARDZERO 0x1.dfffffffffffep-1 + +Testing: (d1 = -(1.0), d2 = -(0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST -0x1.1000000000001p+0 +FE_DOWNWARD -0x1.1000000000001p+0 +FE_UPWARD -0x1.1p+0 +FE_TOWARDZERO -0x1.1p+0 + +Testing: (d1 = (1.0), d2 = (0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST 0x1.dfffffffffffep-1 +FE_DOWNWARD 0x1.dfffffffffffep-1 +FE_UPWARD 0x1.dffffffffffffp-1 +FE_TOWARDZERO 0x1.dfffffffffffep-1 + +Testing: (d1 = -(1.0), d2 = (0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST -0x1.1000000000001p+0 +FE_DOWNWARD -0x1.1000000000001p+0 +FE_UPWARD -0x1.1p+0 +FE_TOWARDZERO -0x1.1p+0 + +Testing: (d1 = (1.0), d2 = -(0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST 0x1.1000000000001p+0 +FE_DOWNWARD 0x1.1p+0 +FE_UPWARD 0x1.1000000000001p+0 +FE_TOWARDZERO 0x1.1p+0 + +Testing: (d1 = -(1.0), d2 = -(0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST -0x1.dfffffffffffep-1 +FE_DOWNWARD -0x1.dffffffffffffp-1 +FE_UPWARD -0x1.dfffffffffffep-1 +FE_TOWARDZERO -0x1.dfffffffffffep-1 + +Testing: (d1 = (1.0), d2 = (0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST -0x1.dfffffffffffep-1 +FE_DOWNWARD -0x1.dffffffffffffp-1 +FE_UPWARD -0x1.dfffffffffffep-1 +FE_TOWARDZERO -0x1.dfffffffffffep-1 + +Testing: (d1 = -(1.0), d2 = (0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST 0x1.1000000000001p+0 +FE_DOWNWARD 0x1.1p+0 +FE_UPWARD 0x1.1000000000001p+0 +FE_TOWARDZERO 0x1.1p+0 + +Testing: (d1 = (1.0), d2 = -(0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST -0x1.1000000000001p+0 +FE_DOWNWARD -0x1.1000000000001p+0 +FE_UPWARD -0x1.1p+0 +FE_TOWARDZERO -0x1.1p+0 + +Testing: (d1 = -(1.0), d2 = -(0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST 0x1.dfffffffffffep-1 +FE_DOWNWARD 0x1.dfffffffffffep-1 +FE_UPWARD 0x1.dffffffffffffp-1 +FE_TOWARDZERO 0x1.dfffffffffffep-1 + +Testing X87 instruction: "FSQRT" (ST0 = 0x1p+2, ST1 = 0x0p+0) +FE_TONEAREST ST0 = 0x1p+1 +FE_DOWNWARD ST0 = 0x1p+1 +FE_UPWARD ST0 = 0x1p+1 +FE_TOWARDZERO ST0 = 0x1p+1 + +Testing X87 instruction: "FSQRT" (ST0 = 0x1.0000000000001p+1, ST1 = 0x0p+0) +FE_TONEAREST ST0 = 0x1.6a09e667f3bcdp+0 +FE_DOWNWARD ST0 = 0x1.6a09e667f3bcdp+0 +FE_UPWARD ST0 = 0x1.6a09e667f3bcep+0 +FE_TOWARDZERO ST0 = 0x1.6a09e667f3bcdp+0 + +Testing X87 instruction: "FSQRT" (ST0 = 0x1.123456789abcp+31, ST1 = 0x0p+0) +FE_TONEAREST ST0 = 0x1.76b0aac9e6a5p+15 +FE_DOWNWARD ST0 = 0x1.76b0aac9e6a4fp+15 +FE_UPWARD ST0 = 0x1.76b0aac9e6a5p+15 +FE_TOWARDZERO ST0 = 0x1.76b0aac9e6a4fp+15 + +Testing X87 instruction: "FSQRT" (ST0 = 0x1.123456789abdp+31, ST1 = 0x0p+0) +FE_TONEAREST ST0 = 0x1.76b0aac9e6a5bp+15 +FE_DOWNWARD ST0 = 0x1.76b0aac9e6a5ap+15 +FE_UPWARD ST0 = 0x1.76b0aac9e6a5bp+15 +FE_TOWARDZERO ST0 = 0x1.76b0aac9e6a5ap+15 + diff --git a/tests/ref32.txt b/tests/ref32.txt new file mode 100644 index 0000000..6417fb5 --- /dev/null +++ b/tests/ref32.txt @@ -0,0 +1,3 @@ +"fdivrp" : 3fd5555560000000 +"fsqrt" : 3ff6a09e60000000 +"faddp" : 3fc99999a0000000 diff --git a/tests/ref33.txt b/tests/ref33.txt new file mode 100644 index 0000000..90dbb53 --- /dev/null +++ b/tests/ref33.txt @@ -0,0 +1 @@ +All tests Passed! diff --git a/tests/roundtest.h b/tests/roundtest.h new file mode 100644 index 0000000..320e22c --- /dev/null +++ b/tests/roundtest.h @@ -0,0 +1,114 @@ +#pragma STDC FENV_ACCESS ON +#include +#include + +#ifdef USE_ASM_ROUNDING +int fesetround_(int rounding_direction) { + uint16_t old_cw; + __asm__("FNSTCW %0" : "=m"(old_cw)::); + uint16_t new_cw = (old_cw & ~0xc00) | rounding_direction; + __asm__("FLDCW %0" ::"m"(new_cw)); + return old_cw & 0xc00; +} +int fegetround_() { + uint16_t cw; + __asm__("FNSTCW %0" : "=m"(cw)::); + return cw & 0xc00; +} +#define fesetround fesetround_ +#define fegetround fegetround_ +#define FE_TONEAREST 0 +#define FE_DOWNWARD 0x400 +#define FE_UPWARD 0x800 +#define FE_TOWARDZERO 0xc00 +#else +#include +#endif + +#define FE_TONEAREST_INDEX 0 +#define FE_DOWNWARD_INDEX 1 +#define FE_UPWARD_INDEX 2 +#define FE_TOWARDZERO_INDEX 3 +int FE_MODES[] = {FE_TONEAREST, FE_DOWNWARD, FE_UPWARD, FE_TOWARDZERO}; +char *FE_MODES_STR[] = { + "FE_TONEAREST", + "FE_DOWNWARD", + "FE_UPWARD", + "FE_TOWARDZERO", +}; + +void assert_round(double *array) { + assert(array[FE_DOWNWARD_INDEX] <= array[FE_TONEAREST_INDEX]); + assert(array[FE_TONEAREST_INDEX] <= array[FE_UPWARD_INDEX]); + if (array[FE_TOWARDZERO_INDEX] < 0) + assert(array[FE_TOWARDZERO_INDEX] == array[FE_UPWARD_INDEX]); + else if (array[FE_TOWARDZERO_INDEX] > 0) + assert(array[FE_TOWARDZERO_INDEX] == array[FE_DOWNWARD_INDEX]); + else if (array[FE_TOWARDZERO_INDEX] == 0) + assert(array[FE_TOWARDZERO_INDEX] == array[FE_UPWARD_INDEX] || + array[FE_TOWARDZERO_INDEX] == array[FE_DOWNWARD_INDEX]); +} + +#define TEST_(exec, expr, format) \ + do { \ + if (sizeof(#exec) == 1) \ + printf("Testing: %s\n", #expr); \ + else \ + printf("Testing: %s -> %s\n", #exec, #expr); \ + for (int i = 0; i < sizeof(FE_MODES) / sizeof(FE_MODES[0]); i++) { \ + fesetround(FE_MODES[i]); \ + exec; \ + printf("%-15s" format "\n", FE_MODES_STR[i], expr); \ + assert(FE_MODES[i] == fegetround()); \ + } \ + printf("\n"); \ + } while (0) + +#define TEST(exec, expr) TEST_(exec, expr, "%a") + +#if defined(i386) || defined(__i386__) || defined(__i386) || \ + defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) +#define TEST_X87(instruction, st0, st1, deep_change) \ + do { \ + double _st0 = (st0), _st1 = (st1); \ + double array1[4], array2[4]; \ + double __st0, __st1; \ + printf("Testing X87 instruction: %s (ST0 = %a, ST1 = %a)\n", #instruction, \ + _st0, _st1); \ + for (int i = 0; i < sizeof(FE_MODES) / sizeof(FE_MODES[0]); i++) { \ + fesetround(FE_MODES[i]); \ + __st0 = _st0, __st1 = _st1; \ + switch (deep_change) { \ + case -1: /* the instruction pops */ \ + __asm__(instruction : "+t"(__st0) : "u"(__st1) : "st(1)"); \ + printf("%-15s ST0 = %a\n", FE_MODES_STR[i], __st0); \ + break; \ + case 0: \ + __asm__(instruction : "+t"(__st0) : "u"(__st1) :); \ + printf("%-15s ST0 = %a\n", FE_MODES_STR[i], __st0); \ + break; \ + case 1: /* the instruction pushes */ \ + __asm__(instruction : "+t"(__st0), "=u"(__st1)::); \ + printf("%-15s ST0 = %a, ST1 = %a\n", FE_MODES_STR[i], __st0, __st1); \ + array2[i] = __st1; \ + } \ + array1[i] = __st0; \ + assert(FE_MODES[i] == fegetround()); \ + } \ + if (deep_change == 1) \ + assert_round(array2); \ + assert_round(array1); \ + printf("\n"); \ + } while (0) +#else +#define TEST_X87(instruction, st0, st1, deep_change) \ + do { \ + double _st0 = (st0), _st1 = (st1); \ + printf("Cannot test X87 instruction: %s (ST0 = %a, ST1 = %a) because it " \ + "is not compiled to x86\n\n", \ + #instruction, _st0, _st1); \ + } while (0) +#endif + +#define TEST_X87_1(i, st0) TEST_X87(i, st0, 0.0, 0) +#define TEST_X87_2(i, st0, st1) TEST_X87(i, st0, st1, -1) diff --git a/tests/test16.c b/tests/test16.c index 95bad2f..edfc0a9 100644 --- a/tests/test16.c +++ b/tests/test16.c @@ -97,72 +97,32 @@ uint64_t _ucomisd_(double a, double b) void test_ucomiss() { + float values[] = {1.0f, 2.0f, 0.0f, -0.0f, -1.0f, INFINITY, -INFINITY, NAN}; float a, b; uint64_t flags; - a = 1.0f; b = 2.0f; - flags = _ucomiss_(a, b); - printf("ucomiss %f, %f => 0x%lx\n", a, b, flags); - flags = _ucomiss_(b, a); - printf("ucomiss %f, %f => 0x%lx\n", b, a, flags); - b = INFINITY; - flags = _ucomiss_(a, b); - printf("ucomiss %f, %f => 0x%lx\n", a, b, flags); - flags = _ucomiss_(b, a); - printf("ucomiss %f, %f => 0x%lx\n", b, a, flags); - b = -INFINITY; - flags = _ucomiss_(a, b); - printf("ucomiss %f, %f => 0x%lx\n", a, b, flags); - flags = _ucomiss_(b, a); - printf("ucomiss %f, %f => 0x%lx\n", b, a, flags); - b = NAN; - flags = _ucomiss_(a, b); - printf("ucomiss %f, %f => 0x%lx\n", a, b, flags); - flags = _ucomiss_(b, a); - printf("ucomiss %f, %f => 0x%lx\n", b, a, flags); - b = a; - flags = _ucomiss_(a, b); - printf("ucomiss %f, %f => 0x%lx\n", a, b, flags); - a = b = INFINITY; - flags = _ucomiss_(a, b); - printf("ucomiss %f, %f => 0x%lx\n", a, b, flags); - a = b = NAN; - flags = _ucomiss_(a, b); - printf("ucomiss %f, %f => 0x%lx\n", a, b, flags); + int n = sizeof(values)/sizeof(values[0]); + for(int i=0; i 0x%lx\n", a, b, flags); + } } void test_ucomisd() { + double values[] = {1.0, 2.0, 0.0, -0.0, -1.0, INFINITY, -INFINITY, NAN}; double a, b; uint64_t flags; - a = 1.0; b = 2.0; - flags = _ucomisd_(a, b); - printf("ucomisd %f, %f => 0x%lx\n", a, b, flags); - flags = _ucomisd_(b, a); - printf("ucomisd %f, %f => 0x%lx\n", b, a, flags); - b = INFINITY; - flags = _ucomisd_(a, b); - printf("ucomisd %f, %f => 0x%lx\n", a, b, flags); - flags = _ucomisd_(b, a); - printf("ucomisd %f, %f => 0x%lx\n", b, a, flags); - b = -INFINITY; - flags = _ucomisd_(a, b); - printf("ucomisd %f, %f => 0x%lx\n", a, b, flags); - flags = _ucomisd_(b, a); - printf("ucomisd %f, %f => 0x%lx\n", b, a, flags); - b = NAN; - flags = _ucomisd_(a, b); - printf("ucomisd %f, %f => 0x%lx\n", a, b, flags); - flags = _ucomisd_(b, a); - printf("ucomisd %f, %f => 0x%lx\n", b, a, flags); - b = a; - flags = _ucomisd_(a, b); - printf("ucomisd %f, %f => 0x%lx\n", a, b, flags); - a = b = INFINITY; - flags = _ucomisd_(a, b); - printf("ucomisd %f, %f => 0x%lx\n", a, b, flags); - a = b = NAN; - flags = _ucomisd_(a, b); - printf("ucomisd %f, %f => 0x%lx\n", a, b, flags); + int n = sizeof(values)/sizeof(values[0]); + for(int i=0; i 0x%lx\n", a, b, flags); + } } #if defined(__x86_64__) #define GO(n) \ diff --git a/tests/test17.c b/tests/test17.c index 8b0cfc4..63c51e4 100644 --- a/tests/test17.c +++ b/tests/test17.c @@ -421,7 +421,9 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r); GO2(sign, 8, psignb, a128_8, b128_8) GO2(sign, 16, psignw, a128_16, b128_16) GO2(sign, 32, psignd, a128_32, b128_32) + GO2(mulhrs, 16, pmulhrsw, a128_16, a128_16) GO2(mulhrs, 16, pmulhrsw, a128_16, b128_16) + GO2(mulhrs, 16, pmulhrsw, b128_16, b128_16) GO3PS(blendv, 32, a128_32, b128_32, c128_32) GO2i(testz, a128_32, b128_32) GO2i(testc, a128_32, b128_32) diff --git a/tests/test21.c b/tests/test21.c index 803f014..60d8779 100644 --- a/tests/test21.c +++ b/tests/test21.c @@ -1,18 +1,24 @@ +#define __USE_GNU #include #include #include +#include +#include +#include +#include +#include static jmp_buf context_buf; static void segv_handler(int sig) { printf("sig = %d\n", sig); - longjmp(context_buf, 1); + siglongjmp(context_buf, 1); } void test() { - if(!setjmp(context_buf)) { + if(!sigsetjmp(context_buf, 1)) { int *bad_ptr = (int*)0xffffffffdeadbeef; printf("*bad_ptr = %d\n", *bad_ptr); } else { @@ -20,11 +26,84 @@ void test() } } +void* exec_p = NULL; +typedef void(*vFv_t)(void); +#define X_IP 16 +#define X_TRAPNO 20 +#define X_ERR 19 +static void segv_action(int sig, siginfo_t* info, ucontext_t* ucntx) +{ + printf("sig = %d\n", sig); + printf("si_addr: %zx, si_code: %d, si_errno: %d", + info->si_addr, + info->si_code, + info->si_errno + ); + if(ucntx->uc_mcontext.gregs[X_IP]) + printf(" RIP offset: %zd", + ((intptr_t)ucntx->uc_mcontext.gregs[X_IP])-((intptr_t)exec_p) + ); + else + printf(" RIP=NULL"); + printf(" TRAPERR=%d TRAPNO=%d\n", + ucntx->uc_mcontext.gregs[X_ERR], + ucntx->uc_mcontext.gregs[X_TRAPNO] + ); + siglongjmp(context_buf, 1); +} + +static unsigned char buff_cc[] = { 0xcc, 0xc3 }; +static unsigned char buff_cd03[] = { 0xcd, 0x03, 0xc3 }; +static unsigned char buff_cd2d[] = { 0xcd, 0x2d, 0xc3 }; +void test_cc() +{ + memcpy(exec_p, buff_cc, sizeof(buff_cc)); + if(!sigsetjmp(context_buf, 1)) { + vFv_t f = (vFv_t)exec_p; + f(); + } + memcpy(exec_p, buff_cd03, sizeof(buff_cd03)); + if(!sigsetjmp(context_buf, 1)) { + vFv_t f = (vFv_t)exec_p; + f(); + } + memcpy(exec_p, buff_cd2d, sizeof(buff_cd2d)); + if(!sigsetjmp(context_buf, 1)) { + vFv_t f = (vFv_t)exec_p; + f(); + } + if(!sigsetjmp(context_buf, 1)) { + vFv_t f = (vFv_t)NULL; + f(); + } +} + int main() { - if(signal(SIGSEGV, segv_handler) == SIG_ERR) - printf("Err = %m\n"); + if(signal(SIGSEGV, segv_handler) == SIG_ERR) { + printf("signal: Err = %d\n", errno); + return -1; + } //printf("handler = %p\n", segv_handler); test(); + struct sigaction action = {0}; + action.sa_flags = SA_SIGINFO | SA_RESTART | SA_NODEFER; + action.sa_sigaction = (void*)segv_action; + if(sigaction(SIGSEGV, &action, NULL)) { + printf("sigaction: Err = %d\n", errno); + return -2; + } + action.sa_flags = SA_SIGINFO | SA_RESTART | SA_NODEFER; + action.sa_sigaction = (void*)segv_action; + if(sigaction(SIGTRAP, &action, NULL)) { + printf("sigaction 2: Err = %d\n", errno); + return -2; + } + exec_p = mmap(NULL, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); + if(exec_p==MAP_FAILED) { + printf("mmap: Err = %d\n", errno); + return -3; + } + test_cc(); return 0; } diff --git a/tests/test21_alt.c b/tests/test21_alt.c new file mode 100644 index 0000000..7486502 --- /dev/null +++ b/tests/test21_alt.c @@ -0,0 +1,263 @@ +#define __USE_GNU +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static jmp_buf context_buf; + +static void segv_handler(int sig) +{ + printf("sig = %d\n", sig); + siglongjmp(context_buf, 1); +} + +void test() +{ + if(!setjmp(context_buf)) { + int *bad_ptr = (int*)0xffffffffdeadbeef; + printf("*bad_ptr = %d\n", *bad_ptr); + } else { + printf("got bad_ptr\n"); + } +} + +void* exec_p = NULL; +typedef void(*vFv_t)(void); +#define X_IP 16 +#define X_TRAPNO 20 +#define X_ERR 19 +static void segv_action(int sig, siginfo_t* info, ucontext_t* ucntx) +{ + if(!exec_p) { + segv_handler(sig); + return; + } + printf("sig = %d\n", sig); + uintptr_t rip = (intptr_t)ucntx->uc_mcontext.gregs[X_IP]; + if(info->si_addr>=exec_p && info->si_addr<(exec_p+10)) + printf("si_addr: exec_p+%zx, ", (uintptr_t)info->si_addr-(uintptr_t)exec_p); + else + printf("si_addr: %zx, ", info->si_addr); + printf("si_code: %d, si_errno: %d, ", info->si_code, info->si_errno); + if(rip>=((intptr_t)exec_p) && rip<((intptr_t)exec_p+5)) + printf("RIP offset: %zd, ", rip-((intptr_t)exec_p)); + printf("TRAPERR=0x%x TRAPNO=%d\n", + ucntx->uc_mcontext.gregs[X_ERR], + ucntx->uc_mcontext.gregs[X_TRAPNO] + ); + siglongjmp(context_buf, 1); +} + +static unsigned char buff_cc[] = { 0xcc, 0xc3 }; +static unsigned char buff_cd03[] = { 0xcd, 0x03, 0xc3 }; +static unsigned char buff_cd2d[] = { 0xcd, 0x2d, 0xc3 }; +static uint8_t buff_simplef[] = { 0xb8, 1, 0, 0, 0, 0xc3 }; +void test_cc() +{ + memcpy(exec_p, buff_cc, sizeof(buff_cc)); + if(!setjmp(context_buf)) { + vFv_t f = (vFv_t)exec_p; + f(); + } + memcpy(exec_p, buff_cd03, sizeof(buff_cd03)); + if(!setjmp(context_buf)) { + vFv_t f = (vFv_t)exec_p; + f(); + } + memcpy(exec_p, buff_cd2d, sizeof(buff_cd2d)); + if(!setjmp(context_buf)) { + vFv_t f = (vFv_t)exec_p; + f(); + } +} + +void test_segfault() +{ + printf("from non-existant memory\n"); + // writing to existing protected memory + if(!setjmp(context_buf)) { + int *bad_ptr = (int*)0xffffffffdeadbeef; + *(uint8_t*)bad_ptr = 0xc3; + } else { + printf("segfault, good\n"); + } + // writing to existing protected memory + if(!setjmp(context_buf)) { + int *bad_ptr = (int*)0xffffffffdeadbeef; + if(*(uint8_t*)bad_ptr == 0xc3) + printf("should not be readable or writeable!\n"); + else + printf("should not be readable!\n"); + printf("aborting test\n"); + return; + } else { + printf("segfault, good\n"); + } + // writing to existing protected memory + if(!setjmp(context_buf)) { + void* bad_ptr = (int*)0xffffffffdeadbeef; + void(*f)() = bad_ptr; + f(); + printf("should not work!!! aboting test\n"); + return; + } else { + printf("segfault, good\n"); + } + printf("from NULL memory\n"); + // writing to existing protected memory + if(!setjmp(context_buf)) { + int *bad_ptr = (int*)NULL; + *(uint8_t*)bad_ptr = 0xc3; + } else { + printf("segfault, good\n"); + } + // writing to existing protected memory + if(!setjmp(context_buf)) { + int *bad_ptr = (int*)NULL; + if(*(uint8_t*)bad_ptr == 0xc3) + printf("should not be readable or writeable!\n"); + else + printf("should not be readable!\n"); + printf("aborting test\n"); + return; + } else { + printf("segfault, good\n"); + } + // writing to existing protected memory + if(!setjmp(context_buf)) { + void* bad_ptr = (int*)NULL; + void(*f)() = bad_ptr; + f(); + printf("should not work!!! aboting test\n"); + return; + } else { + printf("segfault, good\n"); + } + printf("from existant memory\n"); + printf("exec_p prot = 0\n"); + mprotect(exec_p, 65536, 0); + // writing to existing protected memory + if(!setjmp(context_buf)) { + *(uint8_t*)exec_p = 0xc3; + } else { + printf("segfault, good\n"); + } + // reading for exising protected memory + if(!setjmp(context_buf)) { + if(*(uint8_t*)exec_p == 0xc3) + printf("Error, this value should not be 0xc3\n"); + } else { + printf("segfault, good\n"); + } + printf("exec_p prot = PROT_READ\n"); + mprotect(exec_p, 65536, PROT_READ); + // writing to existing protected memory + if(!setjmp(context_buf)) { + *(uint8_t*)exec_p = 0xc3; + } else { + printf("segfault, good\n"); + } + // reading should work + if(!setjmp(context_buf)) { + if(*(uint8_t*)exec_p == 0xc3) + printf("Error, this value should not be 0xc3\n"); + } else { + printf("segfault, not good....\n"); + } + // reading should work + if(!setjmp(context_buf)) { + if(*(uint8_t*)exec_p == 0xc3) + printf("Error, this value should not be 0xc3\n"); + } else { + printf("segfault, good\n"); + } + printf("exec_p prot = PROT_READ|PROT_WRITE\n"); + mprotect(exec_p, 65536, PROT_READ|PROT_WRITE); + // writing should + if(!setjmp(context_buf)) { + *(uint8_t*)exec_p = 0xc3; + } else { + printf("segfault, not good, aborting test\n"); + return; + } + // reading should work + if(!setjmp(context_buf)) { + if(*(uint8_t*)exec_p != 0xc3) { + printf("Error, this value should be 0xc3, aborting test\n"); + return; + } + } else { + printf("segfault, not good....\n"); + } + // should not be able to run + if(!setjmp(context_buf)) { + vFv_t f = (vFv_t)exec_p; + f(); + } else { + printf("Cannot run, good\n"); + } + printf("exec_p prot = PROT_READ|PROT_WRITE|PROT_EXEC\n"); + mprotect(exec_p, 65536, PROT_READ|PROT_WRITE|PROT_EXEC); + if(!setjmp(context_buf)) { + vFv_t f = (vFv_t)exec_p; + f(); + } else { + printf("Cannot run, not good!\n"); + } + printf("exec_p prot = PROT_READ|PROT_WRITE\n"); + mprotect(exec_p, 65536, PROT_READ|PROT_WRITE); + memcpy(exec_p, buff_simplef, sizeof(buff_simplef)); + if(!setjmp(context_buf)) { + int(*f)() = exec_p; + if(f()!=1) { + printf("function return should be 1\n"); + } + } else { + printf("Cannot run, good!\n"); + } + printf("exec_p prot = PROT_READ|PROT_WRITE|PROT_EXEC\n"); + mprotect(exec_p, 65536, PROT_READ|PROT_WRITE|PROT_EXEC); + if(!setjmp(context_buf)) { + int(*f)() = exec_p; + if(f()!=1) { + printf("function return should be 1\n"); + } + ((uint8_t*)exec_p)[1] = 2; + if(f()!=2) { + printf("function return should be 2\n"); + } + } else { + printf("Cannot run, not good, aborting test!\n"); + } +} + +int main() +{ + struct sigaction action = {0}; + action.sa_flags = SA_SIGINFO | SA_RESTART | SA_NODEFER; + action.sa_sigaction = (void*)segv_action; + if(sigaction(SIGSEGV, &action, NULL)) { + printf("sigaction: Err = %d\n", errno); + return -2; + } + if(sigaction(SIGTRAP, &action, NULL)) { + printf("sigaction 2: Err = %d\n", errno); + return -2; + } + exec_p = NULL; + test(); + exec_p = mmap(NULL, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); + if(exec_p==MAP_FAILED) { + printf("mmap: Err = %d\n", errno); + return -3; + } + test_cc(); + test_segfault(); + return 0; +} diff --git a/tests/test21_android.c b/tests/test21_android.c new file mode 100644 index 0000000..7f300fd --- /dev/null +++ b/tests/test21_android.c @@ -0,0 +1,96 @@ +#define __USE_GNU +#include +#include +#include +#include +#include +#include +#include +#include + +static jmp_buf context_buf; + +static void segv_handler(int sig) +{ + printf("sig = %d\n", sig); + siglongjmp(context_buf, 1); +} + +void test() +{ + if(!setjmp(context_buf)) { + int *bad_ptr = (int*)0xffffffffdeadbeef; + printf("*bad_ptr = %d\n", *bad_ptr); + } else { + printf("got bad_ptr\n"); + } +} + +void* exec_p = NULL; +typedef void(*vFv_t)(void); +#define X_IP 16 +#define X_TRAPNO 20 +#define X_ERR 19 +static void segv_action(int sig, siginfo_t* info, ucontext_t* ucntx) +{ + if(!exec_p) { + segv_handler(sig); + return; + } + printf("sig = %d\n", sig); + printf("si_addr: %zx, si_code: %d, si_errno: %d, RIP offset: %zd, TRAPERR=%d TRAPNO=%d\n", + info->si_addr, + info->si_code, + info->si_errno, + ((intptr_t)ucntx->uc_mcontext.gregs[X_IP])-((intptr_t)exec_p), + ucntx->uc_mcontext.gregs[X_ERR], + ucntx->uc_mcontext.gregs[X_TRAPNO] + ); + siglongjmp(context_buf, 1); +} + +static unsigned char buff_cc[] = { 0xcc, 0xc3 }; +static unsigned char buff_cd03[] = { 0xcd, 0x03, 0xc3 }; +static unsigned char buff_cd2d[] = { 0xcd, 0x2d, 0xc3 }; +void test_cc() +{ + memcpy(exec_p, buff_cc, sizeof(buff_cc)); + if(!setjmp(context_buf)) { + vFv_t f = (vFv_t)exec_p; + f(); + } + memcpy(exec_p, buff_cd03, sizeof(buff_cd03)); + if(!setjmp(context_buf)) { + vFv_t f = (vFv_t)exec_p; + f(); + } + /*memcpy(exec_p, buff_cd2d, sizeof(buff_cd2d)); + if(!setjmp(context_buf)) { + vFv_t f = (vFv_t)exec_p; + f(); + }*/ +} + +int main() +{ + //printf("handler = %p\n", segv_handler); + struct sigaction action = {0}; + action.sa_flags = SA_SIGINFO | SA_RESTART | SA_NODEFER; + action.sa_sigaction = (void*)segv_action; + if(sigaction(SIGSEGV, &action, NULL)) { + printf("sigaction: Err = %d\n", errno); + return -2; + } + if(sigaction(SIGTRAP, &action, NULL)) { + printf("sigaction 2: Err = %d\n", errno); + return -2; + } + test(); + exec_p = mmap(NULL, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); + if(exec_p==MAP_FAILED) { + printf("mmap: Err = %d\n", errno); + return -3; + } + test_cc(); + return 0; +} diff --git a/tests/test22.c b/tests/test22.c index f0c1040..646ef13 100644 --- a/tests/test22.c +++ b/tests/test22.c @@ -167,55 +167,54 @@ int main(int argc, const char** argv) char pf, cf, zf; char pa, ca, za; uint64_t flags; - uint64_t tests[][2] = { - {0x0, 0x4082c00000000000LL}, - {0x8000000000000000LL, 0x4082c00000000000LL}, - {0x8000000000000000LL, 0x0}, - {0x40dfffc000000000LL, 0x40e0002000000000LL}, // 0x7fff and 0x8001 as double - {0xc0e0002000000000LL, 0xc0dfffc000000000LL}, // -0x8001 and -0x7fff as double - {0x8000000000000000LL, 0x3ff0000000000000LL}, - {0x3ff0000000000000LL, 0x3fe89d9000000000LL}, - {0x3ff0000000000000LL, 0x7ff0000000000000LL}, - {0xfff0000000000000LL, 0x7ff0000000000000LL}, - {0x3ff0002ca0000000LL, 0xaeff000025000000LL}, - {0x3ff0000050000000LL, 0xc082c00000000000LL}, - {0x0, 0x7ff8000000000001LL}, - {0x7ff8000000000001LL, 0x7ff8000000000001LL}, - }; - int n = sizeof(tests)/sizeof(tests[0]); - for(int i=0; i>0)&1?'C':'-'; - za = (flags>>(0+6))&1?'Z':'-'; - pa = (flags>>(0+2))&1?'P':'-'; - printf("%c%c%c\n", za, pa, ca); - printf("FUCOMPP 0x%llx 0x%llx ", *(uint64_t*)&a, *(uint64_t*)&b); - flags = _fucompp_(a, b); - ca = (flags>>8)&1?'C':'-'; - za = (flags>>(8+6))&1?'Z':'-'; - pa = (flags>>(8+2))&1?'P':'-'; - printf("%c%c%c\n", za, pa, ca); - for(int rd=0; rd<3; ++rd) { - printf("Rounding %d\n", rd); - printf(" FRNDINT 0x%llx => 0x%llx\n", *(uint64_t*)&a, _frndint_(a, rd<<2)); - printf(" FRNDINT 0x%llx => 0x%llx\n", *(uint64_t*)&b, _frndint_(b, rd<<2)); - printf(" FISTP 0x%llx => word: %x\n", *(uint64_t*)&a, _fistpw_(a, rd<<2)); - printf(" FISTP 0x%llx => word: %x\n", *(uint64_t*)&b, _fistpw_(b, rd<<2)); - printf(" FISTP 0x%llx => long: %x\n", *(uint64_t*)&a, _fistpl_(a, rd<<2)); - printf(" FISTP 0x%llx => long: %x\n", *(uint64_t*)&b, _fistpl_(b, rd<<2)); - printf(" FISTP 0x%llx => quad: %llx\n", *(uint64_t*)&a, _fistpq_(a, rd<<2)); - printf(" FISTP 0x%llx => quad: %llx\n", *(uint64_t*)&b, _fistpq_(b, rd<<2)); - printf(" FISTTP 0x%llx => word: %x\n", *(uint64_t*)&a, _fisttpw_(a, rd<<2)); - printf(" FISTTP 0x%llx => word: %x\n", *(uint64_t*)&b, _fisttpw_(b, rd<<2)); - printf(" FISTTP 0x%llx => long: %x\n", *(uint64_t*)&a, _fisttpl_(a, rd<<2)); - printf(" FISTTP 0x%llx => long: %x\n", *(uint64_t*)&b, _fisttpl_(b, rd<<2)); - printf(" FISTTP 0x%llx => quad: %llx\n", *(uint64_t*)&a, _fisttpq_(a, rd<<2)); - printf(" FISTTP 0x%llx => quad: %llx\n", *(uint64_t*)&b, _fisttpq_(b, rd<<2)); - } + uint64_t tests[] = { + 0x0, + 0x4082c00000000000LL, + 0x8000000000000000LL, + 0x40dfffc000000000LL, + 0x40e0002000000000LL, // 0x7fff and 0x8001 as double + 0xc0e0002000000000LL, + 0xc0dfffc000000000LL, // -0x8001 and -0x7fff as double + 0x3ff0000000000000LL, + 0x3fe89d9000000000LL, + 0x7ff0000000000000LL, + 0xfff0000000000000LL, + 0x3ff0002ca0000000LL, + 0xaeff000025000000LL, + 0x3ff0000050000000LL, + 0xc082c00000000000LL, + 0x7ff8000000000001LL, +}; +int n = sizeof(tests)/sizeof(tests[0]); +for(int i=0; i>0)&1?'C':'-'; + za = (flags>>(0+6))&1?'Z':'-'; + pa = (flags>>(0+2))&1?'P':'-'; + printf("%c%c%c\n", za, pa, ca); + printf("FUCOMPP 0x%llx 0x%llx ", *(uint64_t*)&a, *(uint64_t*)&b); + flags = _fucompp_(a, b); + ca = (flags>>8)&1?'C':'-'; + za = (flags>>(8+6))&1?'Z':'-'; + pa = (flags>>(8+2))&1?'P':'-'; + printf("%c%c%c\n", za, pa, ca); + } +for(int i=0; i 0x%llx\n", *(uint64_t*)&a, _frndint_(a, rd<<2)); + printf(" FISTP 0x%llx => word: %x\n", *(uint64_t*)&a, _fistpw_(a, rd<<2)); + printf(" FISTP 0x%llx => long: %x\n", *(uint64_t*)&a, _fistpl_(a, rd<<2)); + printf(" FISTP 0x%llx => quad: %llx\n", *(uint64_t*)&a, _fistpq_(a, rd<<2)); + printf(" FISTTP 0x%llx => word: %x\n", *(uint64_t*)&a, _fisttpw_(a, rd<<2)); + printf(" FISTTP 0x%llx => long: %x\n", *(uint64_t*)&a, _fisttpl_(a, rd<<2)); + printf(" FISTTP 0x%llx => quad: %llx\n", *(uint64_t*)&a, _fisttpq_(a, rd<<2)); + } } printf("\nDone\n"); } diff --git a/tests/test30.c b/tests/test30.c index 2628842..03b9731 100644 --- a/tests/test30.c +++ b/tests/test30.c @@ -1,4 +1,4 @@ -// build with gcc -O0 -g -msse -msse2 -mssse3 -msse4.1 -mavx test30.c -o test30 +// build with gcc -O0 -g -msse -msse2 -mssse3 -msse4.1 -mavx test30.c -o test30 -march=native #include #include #include @@ -8,6 +8,8 @@ #include #include #include +#include +#include typedef unsigned char u8x16 __attribute__ ((vector_size (16))); typedef unsigned short u16x8 __attribute__ ((vector_size (16))); @@ -15,6 +17,9 @@ typedef unsigned int u32x4 __attribute__ ((vector_size (16))); typedef unsigned long int u64x2 __attribute__ ((vector_size (16))); typedef float f32x4 __attribute__ ((vector_size (16))); typedef double d64x2 __attribute__ ((vector_size (16))); +int testVPMASKMOV(); +int testVMASKMOVP(); +static int ACCESS_TEST = 1; typedef union { __m128i mm; @@ -108,9 +113,20 @@ const v128 b128_32 = {.u32 = { const v128 b128_64 = {.u64 = { 0x0000000000000001LL, 0x8000000000000000LL }}; + +const v128 c128_8 = {.u8 = { + 0xfe, 0x7e, 0x7f, 0x81, 0x10, 0x90, 0x0f, 0xf0, + 0xf8, 0x77, 0x87, 0xf6, 0x03, 0xe1, 0x50, 0x21 +}}; +const v128 c128_16 = {.u16 = { + 0x7ffe, 0x0020, 0x7f00, 0x0001, 0x8000, 0xa050, 0xfff1, 0x8008 +}}; const v128 c128_32 = {.u32 = { 0x00000001, 0x80000000, 0x80000005, 0x0000fffe }}; +const v128 c128_64 = {.u64 = { + 0x7fffffffffffffffLL, 0x0000000000000004LL +}}; const v128 a128_pd = {.d64 = { 1.0, 2.0}}; const v128 b128_pd = {.d64 = { 0.0, -2.0}}; @@ -147,7 +163,7 @@ void print_64(v128 v) { void print_ps(v128 v) { for(int i=0; i<4; ++i) if(isnanf(v.f32[i])) - printf("nan "); + printf("%cnan ", (v.u32[i]&0x80000000)?'-':'+'); else printf("%g ", v.f32[i]); } @@ -364,7 +380,14 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r); GO2pd(A, B, a128_pd, d128_pd) \ GO2pd(A, B, b128_pd, d128_pd) \ GO2pd(A, B, c128_pd, d128_pd) \ - GO2pd(A, B, d128_pd, d128_pd) + GO2pd(A, B, d128_pd, d128_pd) \ + GO2pd(A, B, a128_pd, reverse_pd(b128_pd)) \ + GO2pd(A, B, b128_pd, reverse_pd(c128_pd)) \ + GO2pd(A, B, a128_pd, reverse_pd(d128_pd)) \ + GO2pd(A, B, b128_pd, reverse_pd(d128_pd)) \ + GO2pd(A, B, c128_pd, reverse_pd(d128_pd)) \ + GO2pd(A, B, d128_pd, reverse_pd(d128_pd)) + #define MULITGO2Cpd(A, B, I) \ GO2Cpd(A, B, a128_pd, b128_pd, I) \ @@ -389,12 +412,39 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r); GO1ps2dq(A, B, d128_ps) #define MULITGO2Cps(A, B, I) \ + GO2Cps(A, B, a128_ps, a128_ps, I) \ GO2Cps(A, B, a128_ps, b128_ps, I) \ - GO2Cps(A, B, b128_ps, c128_ps, I) \ + GO2Cps(A, B, a128_ps, c128_ps, I) \ GO2Cps(A, B, a128_ps, d128_ps, I) \ + GO2Cps(A, B, b128_ps, a128_ps, I) \ + GO2Cps(A, B, b128_ps, b128_ps, I) \ + GO2Cps(A, B, b128_ps, c128_ps, I) \ GO2Cps(A, B, b128_ps, d128_ps, I) \ + GO2Cps(A, B, c128_ps, a128_ps, I) \ + GO2Cps(A, B, c128_ps, b128_ps, I) \ + GO2Cps(A, B, c128_ps, c128_ps, I) \ GO2Cps(A, B, c128_ps, d128_ps, I) \ - GO2Cps(A, B, d128_ps, d128_ps, I) + GO2Cps(A, B, d128_ps, a128_ps, I) \ + GO2Cps(A, B, d128_ps, b128_ps, I) \ + GO2Cps(A, B, d128_ps, c128_ps, I) \ + GO2Cps(A, B, d128_ps, d128_ps, I) \ + + #define MULITGO2Cps_nan(A, B, I) \ + GO2Cps(A, B, a128_ps, a128_ps, I) \ + GO2Cps(A, B, a128_ps, b128_ps, I) \ + GO2Cps(A, B, a128_ps, c128_ps, I) \ + GO2Cps(A, B, b128_ps, a128_ps, I) \ + GO2Cps(A, B, b128_ps, b128_ps, I) \ + GO2Cps(A, B, b128_ps, c128_ps, I) \ + GO2Cps(A, B, c128_ps, a128_ps, I) \ + GO2Cps(A, B, c128_ps, b128_ps, I) \ + GO2Cps(A, B, c128_ps, c128_ps, I) + + #define MULITGO2Cps_naninf(A, B, I)\ + GO2Cps(A, B, a128_ps, a128_ps, I) \ + GO2Cps(A, B, a128_ps, b128_ps, I) \ + GO2Cps(A, B, b128_ps, a128_ps, I) \ + GO2Cps(A, B, b128_ps, b128_ps, I) \ #define MULTIGO2sd(A, B) \ GO2sd(A, B, a128_pd, a128_pd) \ @@ -410,6 +460,54 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r); GO2sd(A, B, b128_pd, reverse_pd(d128_pd)) \ GO2sd(A, B, b128_pd, reverse_pd(d128_pd)) + #define MULTIGO1Ci(A, S, B, I) \ + GO1C(A, S, B, a128_##S, I) \ + GO1C(A, S, B, b128_##S, I) \ + GO1C(A, S, B, b128_##S, I) \ + +#define MULTIGO2i(A, S, B) \ + GO2(A, S, B, a128_##S, a128_##S) \ + GO2(A, S, B, a128_##S, b128_##S) \ + GO2(A, S, B, a128_##S, c128_##S) \ + GO2(A, S, B, b128_##S, a128_##S) \ + GO2(A, S, B, b128_##S, b128_##S) \ + GO2(A, S, B, b128_##S, c128_##S) \ + GO2(A, S, B, c128_##S, a128_##S) \ + GO2(A, S, B, c128_##S, b128_##S) \ + GO2(A, S, B, c128_##S, c128_##S) \ + +#define MULTIGO2ui(A, S, B) \ + GO2u(A, S, B, a128_##S, a128_##S) \ + GO2u(A, S, B, a128_##S, b128_##S) \ + GO2u(A, S, B, a128_##S, c128_##S) \ + GO2u(A, S, B, b128_##S, a128_##S) \ + GO2u(A, S, B, b128_##S, b128_##S) \ + GO2u(A, S, B, b128_##S, c128_##S) \ + GO2u(A, S, B, c128_##S, a128_##S) \ + GO2u(A, S, B, c128_##S, b128_##S) \ + GO2u(A, S, B, c128_##S, c128_##S) \ + +#define MULTIGO2fi(A, B) \ + GO2f(A, B, a128_8, a128_8) \ + GO2f(A, B, a128_8, b128_8) \ + GO2f(A, B, a128_8, c128_8) \ + GO2f(A, B, b128_8, a128_8) \ + GO2f(A, B, b128_8, b128_8) \ + GO2f(A, B, b128_8, c128_8) \ + GO2f(A, B, c128_8, a128_8) \ + GO2f(A, B, c128_8, b128_8) \ + GO2f(A, B, c128_8, c128_8) \ + +#define MULTIGO2Ci(A, S, B, I) \ + GO2C(A, S, B, a128_##S, a128_##S, I) \ + GO2C(A, S, B, a128_##S, b128_##S, I) \ + GO2C(A, S, B, a128_##S, c128_##S, I) \ + GO2C(A, S, B, b128_##S, a128_##S, I) \ + GO2C(A, S, B, b128_##S, b128_##S, I) \ + GO2C(A, S, B, b128_##S, c128_##S, I) \ + GO2C(A, S, B, c128_##S, a128_##S, I) \ + GO2C(A, S, B, c128_##S, b128_##S, I) \ + GO2C(A, S, B, c128_##S, c128_##S, I) \ GO2(shuffle, 8, pshufb, a128_8, b128_8) GO2(hadd, 16, phaddw, a128_16, b128_16) @@ -420,7 +518,12 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r); GO2(sign, 8, psignb, a128_8, b128_8) GO2(sign, 16, psignw, a128_16, b128_16) GO2(sign, 32, psignd, a128_32, b128_32) + GO2(mulhrs, 16, pmulhrsw, a128_16, a128_16) GO2(mulhrs, 16, pmulhrsw, a128_16, b128_16) + GO2(mulhrs, 16, pmulhrsw, a128_16, c128_16) + GO2(mulhrs, 16, pmulhrsw, b128_16, b128_16) + GO2(mulhrs, 16, pmulhrsw, a128_16, c128_16) + GO2(mulhrs, 16, pmulhrsw, c128_16, c128_16) GO3PS(blendv, 32, a128_32, b128_32, c128_32) GO2i(testz, a128_32, b128_32) GO2i(testc, a128_32, b128_32) @@ -440,18 +543,18 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r); GO1(cvtepu16, 32, pmovzxwd); GO1(cvtepu16, 64, pmovzxwq); GO1(cvtepu32, 64, pmovzxdq); - GO2(min, 32, pminsd, a128_32, b128_32) - GO2(max, 32, pmaxsd, a128_32, b128_32) - GO2C(blend, 16, pblendw, a128_16, b128_16, 0) - GO2C(blend, 16, pblendw, a128_16, b128_16, 0xff) - GO2C(blend, 16, pblendw, a128_16, b128_16, 0xaa) - GO2C(blend, 16, pblendw, a128_16, b128_16, 2) - GO2C(alignr, 8, palignr, a128_8, b128_8, 0) - GO2C(alignr, 8, palignr, a128_8, b128_8, 2) - GO2C(alignr, 8, palignr, a128_8, b128_8, 7) - GO2C(alignr, 8, palignr, a128_8, b128_8, 15) - GO2C(alignr, 8, palignr, a128_8, b128_8, 16) - GO2C(alignr, 8, palignr, a128_8, b128_8, 0xff) + MULTIGO2i(min, 32, pminsd) + MULTIGO2i(max, 32, pmaxsd) + MULTIGO2Ci(blend, 16, pblendw, 0) + MULTIGO2Ci(blend, 16, pblendw, 0xff) + MULTIGO2Ci(blend, 16, pblendw, 0xaa) + MULTIGO2Ci(blend, 16, pblendw, 2) + MULTIGO2Ci(alignr, 8, palignr, 0) + MULTIGO2Ci(alignr, 8, palignr, 2) + MULTIGO2Ci(alignr, 8, palignr, 7) + MULTIGO2Ci(alignr, 8, palignr, 15) + MULTIGO2Ci(alignr, 8, palignr, 16) + MULTIGO2Ci(alignr, 8, palignr, 0xff) GO1ipd(movemask, movmskpd, a128_64) GO1pd(sqrt, psqrtpd, a128_pd) GO1pd(sqrt, psqrtpd, b128_pd) @@ -467,100 +570,139 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r); MULITGO2pd(min, minpd) MULITGO2pd(div, divpd) MULITGO2pd(max, maxpd) - GO2(unpacklo, 8, punpcklbw, a128_8, b128_8) - GO2(unpacklo, 16, punpcklwd, a128_16, b128_16) - GO2(unpacklo, 32, punpckldq, a128_32, b128_32) - GO2(packs, 16, ppacksswb, a128_16, b128_16) - GO2(cmpgt, 8, pcmpgtb, a128_8, b128_8) - GO2(cmpgt, 16, pcmpgtw, a128_16, b128_16) - GO2(cmpgt, 32, pcmpgtd, a128_32, b128_32) - GO2(packus, 16, packuswb, a128_16, b128_16) - GO2(unpackhi, 8, punpckhbw, a128_8, b128_8) - GO2(unpackhi, 16, punpckhwd, a128_16, b128_16) - GO2(unpackhi, 32, punpckhdq, a128_32, b128_32) - GO2(packs, 32, ppackssdw, a128_32, b128_32) - GO2(unpacklo, 64, punpcklqdq, a128_64, b128_64) - GO2(unpackhi, 64, punpckhqdq, a128_64, b128_64) - GO1C(shuffle, 32, pshufd, a128_32, 0) - GO1C(shuffle, 32, pshufd, a128_32, 0xff) - GO1C(shuffle, 32, pshufd, a128_32, 0xaa) - GO1C(shuffle, 32, pshufd, a128_32, 2) - GO1C(srli, 16, psrlw, a128_16, 0) - GO1C(srli, 16, psrlw, a128_16, 0xff) - GO1C(srli, 16, psrlw, a128_16, 0xaa) - GO1C(srli, 16, psrlw, a128_16, 2) - GO1C(srli, 32, psrld, a128_32, 0) - GO1C(srli, 32, psrld, a128_32, 0xff) - GO1C(srli, 32, psrld, a128_32, 0xaa) - GO1C(srli, 32, psrld, a128_32, 2) - GO1C(srli, 64, psrlq, a128_64, 0) - GO1C(srli, 64, psrlq, a128_64, 0xff) - GO1C(srli, 64, psrlq, a128_64, 0xaa) - GO1C(srli, 64, psrlq, a128_64, 2) - GO1C(srai, 16, psraw, a128_16, 0) - GO1C(srai, 16, psraw, a128_16, 0xff) - GO1C(srai, 16, psraw, a128_16, 0xaa) - GO1C(srai, 16, psraw, a128_16, 2) - GO1C(srai, 32, psrad, a128_32, 0) - GO1C(srai, 32, psrad, a128_32, 0xff) - GO1C(srai, 32, psrad, a128_32, 0xaa) - GO1C(srai, 32, psrad, a128_32, 2) - GO1C(slli, 16, psllw, a128_16, 0) - GO1C(slli, 16, psllw, a128_16, 0xff) - GO1C(slli, 16, psllw, a128_16, 0xaa) - GO1C(slli, 16, psllw, a128_16, 2) - GO1C(slli, 32, pslld, a128_32, 0) - GO1C(slli, 32, pslld, a128_32, 0xff) - GO1C(slli, 32, pslld, a128_32, 0xaa) - GO1C(slli, 32, pslld, a128_32, 2) - GO1C(slli, 64, psllq, a128_64, 0) - GO1C(slli, 64, psllq, a128_64, 0xff) - GO1C(slli, 64, psllq, a128_64, 0xaa) - GO1C(slli, 64, psllq, a128_64, 2) - GO2(cmpeq, 8, pcmpeqb, a128_8, b128_8) - GO2(cmpeq, 16, pcmpeqw, a128_16, b128_16) - GO2(cmpeq, 32, pcmpeqd, a128_32, b128_32) + MULITGO2pd(addsub, addsubpd) + MULITGO2Cpd(cmp, cmppd, 0) + MULITGO2Cpd(cmp, cmppd, 1) + MULITGO2Cpd(cmp, cmppd, 2) + MULITGO2Cpd(cmp, cmppd, 3) + MULITGO2Cpd(cmp, cmppd, 4) + MULITGO2Cpd(cmp, cmppd, 5) + MULITGO2Cpd(cmp, cmppd, 6) + MULITGO2Cpd(cmp, cmppd, 7) + MULITGO2Cpd(cmp, cmppd, 8) + MULITGO2Cpd(cmp, cmppd, 9) + MULITGO2Cpd(cmp, cmppd, 10) + MULITGO2Cpd(cmp, cmppd, 11) + MULITGO2Cpd(cmp, cmppd, 12) + MULITGO2Cpd(cmp, cmppd, 13) + MULITGO2Cpd(cmp, cmppd, 14) + MULITGO2Cpd(cmp, cmppd, 15) + MULITGO2Cpd(cmp, cmppd, 16) + MULITGO2Cpd(cmp, cmppd, 17) + MULITGO2Cpd(cmp, cmppd, 18) + MULITGO2Cpd(cmp, cmppd, 19) + MULITGO2Cpd(cmp, cmppd, 20) + MULITGO2Cpd(cmp, cmppd, 21) + MULITGO2Cpd(cmp, cmppd, 22) + MULITGO2Cpd(cmp, cmppd, 23) + MULITGO2Cpd(cmp, cmppd, 24) + MULITGO2Cpd(cmp, cmppd, 25) + MULITGO2Cpd(cmp, cmppd, 26) + MULITGO2Cpd(cmp, cmppd, 27) + MULITGO2Cpd(cmp, cmppd, 28) + MULITGO2Cpd(cmp, cmppd, 29) + MULITGO2Cpd(cmp, cmppd, 30) + MULITGO2Cpd(cmp, cmppd, 31) + MULITGO2Cpd(shuffle, shufpd, 0) + MULITGO2Cpd(shuffle, shufpd, 0x15) + MULITGO2Cpd(shuffle, shufpd, 0xff) + MULITGO2Cpd(shuffle, shufpd, 0x02) + MULTIGO2i(unpacklo, 8, punpcklbw) + MULTIGO2i(unpacklo, 16, punpcklwd) + MULTIGO2i(unpacklo, 32, punpckldq) + MULTIGO2i(packs, 16, ppacksswb) + MULTIGO2i(cmpgt, 8, pcmpgtb) + MULTIGO2i(cmpgt, 16, pcmpgtw) + MULTIGO2i(cmpgt, 32, pcmpgtd) + MULTIGO2i(packus, 16, packuswb) + MULTIGO2i(unpackhi, 8, punpckhbw) + MULTIGO2i(unpackhi, 16, punpckhwd) + MULTIGO2i(unpackhi, 32, punpckhdq) + MULTIGO2i(packs, 32, ppackssdw) + MULTIGO2i(unpacklo, 64, punpcklqdq) + MULTIGO2i(unpackhi, 64, punpckhqdq) + MULTIGO1Ci(shuffle, 32, pshufd, 0) + MULTIGO1Ci(shuffle, 32, pshufd, 0xff) + MULTIGO1Ci(shuffle, 32, pshufd, 0xaa) + MULTIGO1Ci(shuffle, 32, pshufd, 2) + MULTIGO1Ci(srli, 16, psrlw, 0) + MULTIGO1Ci(srli, 16, psrlw, 0xff) + MULTIGO1Ci(srli, 16, psrlw, 0xaa) + MULTIGO1Ci(srli, 16, psrlw, 2) + MULTIGO1Ci(srli, 32, psrld, 0) + MULTIGO1Ci(srli, 32, psrld, 0xff) + MULTIGO1Ci(srli, 32, psrld, 0xaa) + MULTIGO1Ci(srli, 32, psrld, 2) + MULTIGO1Ci(srli, 64, psrlq, 0) + MULTIGO1Ci(srli, 64, psrlq, 0xff) + MULTIGO1Ci(srli, 64, psrlq, 0xaa) + MULTIGO1Ci(srli, 64, psrlq, 2) + MULTIGO1Ci(srai, 16, psraw, 0) + MULTIGO1Ci(srai, 16, psraw, 0xff) + MULTIGO1Ci(srai, 16, psraw, 0xaa) + MULTIGO1Ci(srai, 16, psraw, 2) + MULTIGO1Ci(srai, 32, psrad, 0) + MULTIGO1Ci(srai, 32, psrad, 0xff) + MULTIGO1Ci(srai, 32, psrad, 0xaa) + MULTIGO1Ci(srai, 32, psrad, 2) + MULTIGO1Ci(slli, 16, psllw, 0) + MULTIGO1Ci(slli, 16, psllw, 0xff) + MULTIGO1Ci(slli, 16, psllw, 0xaa) + MULTIGO1Ci(slli, 16, psllw, 2) + MULTIGO1Ci(slli, 32, pslld, 0) + MULTIGO1Ci(slli, 32, pslld, 0xff) + MULTIGO1Ci(slli, 32, pslld, 0xaa) + MULTIGO1Ci(slli, 32, pslld, 2) + MULTIGO1Ci(slli, 64, psllq, 0) + MULTIGO1Ci(slli, 64, psllq, 0xff) + MULTIGO1Ci(slli, 64, psllq, 0xaa) + MULTIGO1Ci(slli, 64, psllq, 2) + MULTIGO2i(cmpeq, 8, pcmpeqb) + MULTIGO2i(cmpeq, 16, pcmpeqw) + MULTIGO2i(cmpeq, 32, pcmpeqd) MULITGO2pd(hadd, haddpd) - GO2(srl, 16, psrlw, a128_16, b128_16) - GO2(srl, 32, psrld, a128_32, b128_32) - GO2(srl, 64, psrlq, a128_64, b128_64) - GO2(add, 64, paddq, a128_64, b128_64) - GO2(mullo, 16, pmullw, a128_16, b128_16) - GO2u(subs, 8, psubusb, a128_8, b128_8) - GO2u(subs, 16, psubusw, a128_16, b128_16) - GO2u(min, 8, pminub, a128_8, b128_8) - GO2f(and, pand, a128_8, b128_8) - GO2u(adds, 8, paddusb, a128_8, b128_8) - GO2u(adds, 16, paddusw, a128_16, b128_16) - GO2u(max, 8, pmaxub, a128_8, b128_8) - GO2f(andnot, pandn, a128_8, b128_8) - GO2u(avg, 8, pavgb, a128_8, b128_8) - GO2(sra, 16, psraw, a128_16, b128_16) - GO2(sra, 32, psrad, a128_32, b128_32) - GO2u(avg, 16, pavgb, a128_16, b128_16) - GO2u(mulhi, 16, pmulhuw, a128_16, b128_16) - GO2(mulhi, 16, pmulhw, a128_16, b128_16) - GO2(subs, 8, psubsb, a128_8, b128_8) - GO2(subs, 16, psubsw, a128_16, b128_16) - GO2(min, 16, pminsw, a128_16, b128_16) - GO2f(or, por, a128_8, b128_8) - GO2(adds, 8, paddusb, a128_8, b128_8) - GO2(adds, 16, paddusw, a128_16, b128_16) - GO2(max, 16, pmaxsw, a128_16, b128_16) - GO2f(xor, pxor, a128_8, b128_8) - GO2(sll, 16, psllw, a128_16, b128_16) - GO2(sll, 32, pslld, a128_32, b128_32) - GO2(sll, 64, psllq, a128_64, b128_64) - GO2u(mul, 32, pmuludq, a128_32, b128_32) - GO2(madd, 16, pmaddwd, a128_16, b128_16) - GO2u(sad, 8, psadbw, a128_8, b128_8) - GO2(sub, 8, psubb, a128_8, b128_8) - GO2(sub, 16, psubw, a128_16, b128_16) - GO2(sub, 32, psubd, a128_32, b128_32) - GO2(sub, 64, psubq, a128_64, b128_64) - GO2(add, 8, paddb, a128_8, b128_8) - GO2(add, 16, paddw, a128_16, b128_16) - GO2(add, 32, paddd, a128_32, b128_32) + MULITGO2pd(hsub, hsubpd) + MULTIGO2i(srl, 16, psrlw) + MULTIGO2i(srl, 32, psrld) + MULTIGO2i(srl, 64, psrlq) + MULTIGO2i(add, 64, paddq) + MULTIGO2i(mullo, 16, pmullw) + MULTIGO2ui(subs, 8, psubusb) + MULTIGO2ui(subs, 16, psubusw) + MULTIGO2ui(min, 8, pminub) + MULTIGO2fi(and, pand) + MULTIGO2ui(adds, 8, paddusb) + MULTIGO2ui(adds, 16, paddusw) + MULTIGO2ui(max, 8, pmaxub) + MULTIGO2fi(andnot, pandn) + MULTIGO2ui(avg, 8, pavgb) + MULTIGO2i(sra, 16, psraw) + MULTIGO2i(sra, 32, psrad) + MULTIGO2ui(avg, 16, pavgb) + MULTIGO2ui(mulhi, 16, pmulhuw) + MULTIGO2i(mulhi, 16, pmulhw) + MULTIGO2i(subs, 8, psubsb) + MULTIGO2i(subs, 16, psubsw) + MULTIGO2i(min, 16, pminsw) + MULTIGO2fi(or, por) + MULTIGO2i(adds, 8, paddusb) + MULTIGO2i(adds, 16, paddusw) + MULTIGO2i(max, 16, pmaxsw) + MULTIGO2fi(xor, pxor) + MULTIGO2i(sll, 16, psllw) + MULTIGO2i(sll, 32, pslld) + MULTIGO2i(sll, 64, psllq) + MULTIGO2ui(mul, 32, pmuludq) + MULTIGO2i(madd, 16, pmaddwd) + MULTIGO2i(maddubs, 16, pmaddubsw) + MULTIGO2ui(sad, 8, psadbw) + MULTIGO2i(sub, 8, psubb) + MULTIGO2i(sub, 16, psubw) + MULTIGO2i(sub, 32, psubd) + MULTIGO2i(sub, 64, psubq) + MULTIGO2i(add, 8, paddb) + MULTIGO2i(add, 16, paddw) + MULTIGO2i(add, 32, paddd) GO2ps(movehl, pmovhlps, a128_ps, b128_ps) GO2ps(unpacklo, unpcklps, a128_ps, b128_ps) GO2ps(unpackhi, unpckhps, a128_ps, b128_ps) @@ -587,6 +729,9 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r); MULITGO2ps(min, minps) MULITGO2ps(div, divps) MULITGO2ps(max, maxps) + MULITGO2ps(addsub, addsubps) + MULITGO2ps(hadd, haddps) + MULITGO2ps(hsub, hsubps) MULITGO2Cps(cmp, cmpps, 0) MULITGO2Cps(cmp, cmpps, 1) MULITGO2Cps(cmp, cmpps, 2) @@ -631,11 +776,260 @@ printf(N " %g, %g => %g\n", b, a, *(float*)&r); MULTIGO2sd(div, divsd) MULTIGO2sd(max, maxsd) MULTIGO1ps2dq(cvtps, cvtps2dq) - MULITGO2Cps(dp, dpps, 0xff) - MULITGO2Cps(dp, dpps, 0x3f) - MULITGO2Cps(dp, dpps, 0xf3) - MULITGO2Cps(dp, dpps, 0x53) + // disabling NAN and INF for DPPS on purpose, it's not implemented + MULITGO2Cps_naninf(dp, dpps, 0xff) + MULITGO2Cps_naninf(dp, dpps, 0x3f) + MULITGO2Cps_naninf(dp, dpps, 0xf3) + MULITGO2Cps_naninf(dp, dpps, 0x53) +// open this test must update test30 and ref30.txt +// ACCESS_TEST = 2; +// testVPMASKMOV(); +// testVMASKMOVP(); +// ACCESS_TEST = 1; +// testVPMASKMOV(); +// testVMASKMOVP(); return 0; } +__m256i m256_setr_epi64x(long long a, long long b, long long c, long long d) +{ + union { + long long q[4]; + int r[8]; + } u; + u.q[0] = a; u.q[1] = b; u.q[2] = c; u.q[3] = d; + return _mm256_setr_epi32(u.r[0], u.r[1], u.r[2], u.r[3], u.r[4], u.r[5], u.r[6], u.r[7]); +} + +__m128i m128_setr_epi64x(long long a, long long b) +{ + union { + long long q[2]; + int r[4]; + } u; + u.q[0] = a; u.q[1] = b; + return _mm_setr_epi32(u.r[0], u.r[1], u.r[2], u.r[3]); +} + +int testVPMASKMOV() { + long pageSize = sysconf(_SC_PAGESIZE); + + void *baseAddress = mmap(NULL, pageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (baseAddress == MAP_FAILED) { + printf("mmap failed\n"); + return 1; + } + void *resultAddress = mmap(NULL, pageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (resultAddress == MAP_FAILED) { + printf("mmap failed\n"); + return 1; + } + + int *intData = (int *)((char *)baseAddress + pageSize - 4 * ACCESS_TEST * sizeof(int)); // 32 bytes for 8 integers + int *intResult = (int *)((char *)resultAddress + pageSize - 4 * ACCESS_TEST * sizeof(int)); // 32 bytes for 8 integers + + for (int i = 0; i < 4 * ACCESS_TEST; i++) { + intData[i] = i + 1; + } + + __m256i mask256_int = _mm256_setr_epi32(-1, -1, -1, -1, 1 - ACCESS_TEST, 0, 1 - ACCESS_TEST, 0); // 32-bit mask + __m128i mask128_int = _mm_setr_epi32(-1, -1, 1 - ACCESS_TEST, 0); // 32-bit mask + __m256i mask256_long = m256_setr_epi64x(-1, -1, 1 - ACCESS_TEST, 0); // 64-bit mask + __m128i mask128_long = m128_setr_epi64x(-1, 0); // 64-bit mask + // ************************************************************** _mm256_maskload_epi32 + __m256i loaded_int256 = _mm256_maskload_epi32(intData, mask256_int); + printf("VPMASKMOV "); + for (int i = 0; i < 8; i++) { + printf("%d ", ((int*)&loaded_int256)[i]); + } + printf("\n"); + + memset(resultAddress, 0, pageSize); + _mm256_maskstore_epi32(intResult, mask256_int, loaded_int256); + printf("VPMASKMOV "); + for (int i = 0; i < 4 * ACCESS_TEST; i++) { + printf("%d ", intResult[i]); + } + printf("\n"); + + // ************************************************************** _mm_maskload_epi32 + __m128i loaded_int128 = _mm_maskload_epi32(intData, mask128_int); + printf("VPMASKMOV "); + for (int i = 0; i < 4; i++) { + printf("%d ", ((int*)&loaded_int128)[i]); + } + printf("\n"); + + memset(resultAddress, 0, pageSize); + _mm_maskstore_epi32(intResult, mask128_int, loaded_int128); + printf("VPMASKMOV "); + for (int i = 0; i < 2 * ACCESS_TEST; i++) { + printf("%d ", intResult[i]); + } + printf("\n"); + + long long *longData = (long long *)((char *)baseAddress + pageSize - 2 * ACCESS_TEST * sizeof(long long)); // 32 bytes for 4 long integers + long long *longResult = (long long *)((char *)resultAddress + pageSize - 2 * ACCESS_TEST * sizeof(long long)); // 32 bytes for 8 integers + for (int i = 0; i < 2 * ACCESS_TEST; i++) { + longData[i] = i + 1; + } + + // ************************************************************** _mm256_maskload_epi64 + __m256i loaded_long256 = _mm256_maskload_epi64(longData, mask256_long); + printf("VPMASKMOV "); + for (int i = 0; i < 4; i++) { + printf("%lld ", ((long long*)&loaded_long256)[i]); + } + printf("\n"); + + memset(resultAddress, 0, pageSize); + _mm256_maskstore_epi64(longResult, mask256_long, loaded_long256); + printf("VPMASKMOV "); + for (int i = 0; i < 2 * ACCESS_TEST; i++) { + printf("%lld ", longResult[i]); + } + printf("\n"); + + // ************************************************************** _mm_maskload_epi64 + __m128i loaded_long128 = _mm_maskload_epi64(longData, mask128_long); + printf("VPMASKMOV "); + for (int i = 0; i < 2; i++) { + printf("%lld ", ((long long*)&loaded_long128)[i]); + } + printf("\n"); + + // _mm_maskstore_epi64 + memset(resultAddress, 0, pageSize); + _mm_maskstore_epi64(longResult, mask128_long, loaded_long128); + printf("VPMASKMOV "); + for (int i = 0; i < 1 * ACCESS_TEST; i++) { + printf("%lld ", longResult[i]); + } + printf("\n"); + + munmap(baseAddress, pageSize); + munmap(resultAddress, pageSize); + + return 0; +} + +int testVMASKMOVP() { + long pageSize = sysconf(_SC_PAGESIZE); + + void *baseAddress = mmap(NULL, pageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (baseAddress == MAP_FAILED) { + perror("mmap failed"); + return 1; + } + void *destAddress = mmap(NULL, pageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (destAddress == MAP_FAILED) { + perror("mmap failed"); + return 1; + } + + float *floatData = (float *)((char *)baseAddress + pageSize - 16 * ACCESS_TEST); // 16 bytes for 4 floats + float *floatDest = (float *)((char *)destAddress + pageSize - 16 * ACCESS_TEST); // 16 bytes for 4 floats + + int mask_data[8] = { -1, 0, -1, -1, 0, 1 - ACCESS_TEST, 0, 0 }; // -1 的二进制表示是 0xFFFFFFFF(最高位为 1) + __m256i mask256ps = _mm256_loadu_si256((__m256i const *)mask_data); + __m256i mask256pd = _mm256_setr_epi64x(-1, -1, 0, 1 - ACCESS_TEST); + __m128i mask128 = _mm_setr_epi32(-1, -1, 0, 1 - ACCESS_TEST); + + //================================================================================= + // _mm256_maskload_ps + for (int i = 0; i < 4 * ACCESS_TEST; i++) { + floatData[i] = (float)(i + 1); + } + + __m256 floatVec = _mm256_maskload_ps(floatData, mask256ps); + printf("VMASKMOVP "); + for (int i = 0; i < 8; i++) { + printf("%f ", ((float*)&floatVec)[i]); + } + printf("\n"); + + // _mm256_maskstore_ps + memset(destAddress, 0, pageSize); + _mm256_maskstore_ps(floatDest, mask256ps, floatVec); + printf("VMASKMOVP "); + for (int i = 0; i < 4 * ACCESS_TEST; i++) { + printf("%f ", floatDest[i]); + } + printf("\n"); + + //================================================================================= + for (int i = 0; i < 4 * ACCESS_TEST; i++) { + floatData[i] = (float)(i + 10); + } + + // _mm_maskload_ps + __m128 floatVec128 = _mm_maskload_ps(floatData, mask128); + printf("VMASKMOVP "); + for (int i = 0; i < 4; i++) { + printf("%f ", ((float*)&floatVec128)[i]); + } + printf("\n"); + + // _mm_maskstore_ps + memset(destAddress, 0, pageSize); + _mm_maskstore_ps(floatDest, mask128, floatVec128); + printf("VMASKMOVP "); + for (int i = 0; i < 2 * ACCESS_TEST; i++) { + printf("%f ", floatDest[i]); + } + printf("\n"); + + //================================================================================= + double *doubleData = (double *)((char *)baseAddress + pageSize - 16 * ACCESS_TEST); // 16 bytes for 2 doubles + double *doubleDest = (double *)((char *)destAddress + pageSize - 16 * ACCESS_TEST); // 16 bytes for 2 doubles + for (int i = 0; i < 2 * ACCESS_TEST; i++) { + doubleData[i] = (double)(i + 20); + } + + // _mm256_maskload_pd + __m256d doubleVec = _mm256_maskload_pd(doubleData, mask256pd); + printf("VMASKMOVP "); + for (int i = 0; i < 4; i++) { + printf("%lf ", ((double *)&doubleVec)[i]); + } + printf("\n"); + + // _mm256_maskstore_pd + memset(destAddress, 0, pageSize); + _mm256_maskstore_pd(doubleDest, mask256pd, doubleVec); + printf("VMASKMOVP "); + for (int i = 0; i < 2 * ACCESS_TEST; i++) { + printf("%f ", doubleDest[i]); + } + printf("\n"); + + //================================================================================= + for (int i = 0; i < 2 * ACCESS_TEST; i++) { + doubleData[i] = (double)(i + 30); + } + + // _mm_maskload_pd + __m128d doubleVec128 = _mm_maskload_pd(doubleData, mask128); + printf("VMASKMOVP "); + for (int i = 0; i < 2; i++) { + printf("%lf ", ((double *)&doubleVec128)[i]); + } + printf("\n"); + + // _mm_maskstore_pd + memset(destAddress, 0, pageSize); + _mm_maskstore_pd(doubleDest, mask128, doubleVec128); + printf("VMASKMOVP "); + for (int i = 0; i < 1 * ACCESS_TEST; i++) { + printf("%f ", doubleDest[i]); + } + printf("\n"); + + //================================================================================= + + munmap(baseAddress, pageSize); + munmap(destAddress, pageSize); + + return 0; +} \ No newline at end of file diff --git a/tests/test31.c b/tests/test31.c new file mode 100644 index 0000000..379ddec --- /dev/null +++ b/tests/test31.c @@ -0,0 +1,114 @@ +// Copy from Box86/tests/test26.c (Box64/tests32/test26.c) +// Build with `gcc -march=core2 -O0 test31.c -o test31 -std=c99 -masm=intel -mfpmath=387 -frounding-math` +#include +#include +#include +#include +#define USE_ASM_ROUNDING +#include "roundtest.h" + +#define TEST_CONVERT_(stype, s_) \ + do { \ + stype s; \ + TEST_(s = (s_), (double)s, "%a"); \ + TEST_(s = (s_), (float)s, "%a"); \ + /* converting too large float to integer, the result is undefined, on both \ + * c99 and FISTP instruction */ \ + if (INT64_MIN <= s && INT64_MAX <= s) \ + TEST_(s = (s_), (int64_t)s, "%" PRId64); \ + if (INT32_MIN <= s && INT32_MAX <= s) \ + TEST_(s = (s_), (int32_t)s, "%" PRId32); \ + if (INT16_MIN <= s && INT16_MAX <= s) \ + TEST_(s = (s_), (int16_t)s, "%" PRId16); \ + if (INT8_MIN <= s && INT8_MAX <= s) \ + TEST_(s = (s_), (int8_t)s, "%" PRId8); \ + if (0 <= s && UINT64_MAX <= s) \ + TEST_(s = (s_), (uint64_t)s, "%" PRIu64); \ + if (0 <= s && UINT32_MAX <= s) \ + TEST_(s = (s_), (unsigned int)s, "%" PRIu32); \ + if (0 <= s && UINT16_MAX <= s) \ + TEST_(s = (s_), (unsigned short)s, "%" PRIu16); \ + if (0 <= s && UINT8_MAX <= s) \ + TEST_(s = (s_), (unsigned char)s, "%" PRIu8); \ + } while (0) + +#define TEST_CONVERT(stype, s_) \ + do { \ + TEST_CONVERT_(stype, s_); \ + TEST_CONVERT_(stype, -(s_)); \ + } while (0) + +#define TEST_2NUMBER(d1type, d1_, d2type, d2_, operation) \ + do { \ + d1type d1; \ + d2type d2; \ + TEST((d1 = (d1_), d2 = (d2_)), operation); \ + TEST((d1 = -(d1_), d2 = (d2_)), operation); \ + TEST((d1 = (d1_), d2 = -(d2_)), operation); \ + TEST((d1 = -(d1_), d2 = -(d2_)), operation); \ + } while (0) + +int main() { + double d; + float f; + int64_t i64; + TEST_CONVERT(double, 0x1.123456789abcp2); // FISTTP + TEST_(d = (0x1.123456789abcp512), (float)d, "%a"); + TEST_CONVERT(double, 0x1.123456789abcp29); + TEST_(d = (-0x1.123456789abcp30), (int32_t)d, "%" PRId32); + TEST_(d = (-0x1.123456789abcp62), (int64_t)d, "%" PRId64); + + TEST_CONVERT(float, 0x1.123456789abcp2f); + TEST_CONVERT(float, 0x1.123456789abcp29f); + TEST_(f = -0x1.123456789abcp30f, (int32_t)f, "%" PRId32); + // to be fixed: + //TEST_(f = -0x1.123456789abcp62f, (int64_t)f, "%" PRId64); + // The direction of rounding when an integer is converted to a floating-point + // number that cannot exactly represent the original value + // https://gcc.gnu.org/onlinedocs/gcc/Floating-point-implementation.html + // to be fixed: + //TEST_(i64 = INT64_MAX, (double)i64, "%a"); // FILD and FSTP + TEST(d = -0x1.1234567p0, (double)((int)d)); + TEST(d = 0x1.9234567p0, (double)((int)d)); + TEST(d = -0x1.9234567p0, (double)((int)d)); + + TEST(d = 0x1.1234567p0, (double)((long int)d)); + TEST(d = -0x1.1234567p0, (double)((long int)d)); + TEST(d = 0x1.9234567p0, (double)((long int)d)); + TEST(d = -0x1.9234567p0, (double)((long int)d)); + + TEST_2NUMBER(double, 1.0, double, 0x1.0000000000001p0, d1 + d2); + TEST_2NUMBER(double, 1.0, double, 0x1.0000000000001p0, d1 - d2); + TEST_2NUMBER(double, 1.0, double, 0x1.0000000000001p0, d2 - d1); + TEST_2NUMBER(double, 1.0, double, 0x1.000000000000dp-4, d1 + d2); + TEST_2NUMBER(double, 1.0, double, 0x1.000000000000dp-4, d1 - d2); + TEST_2NUMBER(double, 1.0, double, 0x1.000000000000dp-4, d2 - d1); + + TEST_2NUMBER(double, 0x1.233445566778p0, double, 0x1.3456789abcdep0, d1 + d2); + TEST_2NUMBER(float, 0x1.233445566778p0f, float, 0x1.3456789abcdep0f, d1 *d2); + TEST_2NUMBER(float, 0x1.233445566778p0f, double, 0x1.3456789abcdep0, d1 *d2); + TEST_2NUMBER(double, 0x1.233445566778p0, double, 0x1.3456789abcdep0, d1 *d2); + TEST_2NUMBER(float, 0x1.233445566778p0f, double, 0x1.3456789abcdep0, d1 *d2); + TEST_2NUMBER(double, 0x1.233445566778p0, float, 0x1.3456789abcdep0, d1 *d2); + TEST_2NUMBER(float, 0x1.233445566778p0f, float, 0x1.3456789abcdep0f, d1 *d2); + TEST_2NUMBER(double, 0x1.233445566778p0, int, 5, d1 *d2); + TEST_2NUMBER(int, 15, double, 0x1.3456789abcdep0f, d1 *d2); + TEST_2NUMBER(float, 0x1.233445566778p0f, int, 15, d1 *d2); + TEST_2NUMBER(int, 15, float, 0x1.3456789abcdep0f, d1 *d2); + + TEST_2NUMBER(double, 0x1.233445566778p0, double, 0x1.3456789abcdep0, d1 / d2); + TEST_2NUMBER(double, 0x1.233445566778p0, double, 0x1.3456789abcdep0, d1 / d2); + TEST_2NUMBER(double, 0x1.233445566778p0, float, 0x1.3456789abcdep0f, d1 / d2); + + TEST_2NUMBER(double, 1.0, double, 0x1.0000000000001p0, d2 - d1); + TEST_2NUMBER(double, 1.0, double, 0x1.000000000000dp-4, d1 + d2); + TEST_2NUMBER(double, 1.0, double, 0x1.000000000000dp-4, d1 - d2); + TEST_2NUMBER(double, 1.0, double, 0x1.000000000000dp-4, d2 - d1); + + TEST_X87_1("FSQRT", 0x1.0000000000000p2); + TEST_X87_1("FSQRT", 0x1.0000000000001p1); + TEST_X87_1("FSQRT", 0x1.123456789abcp31); + TEST_X87_1("FSQRT", 0x1.123456789abdp31); + + return 0; +} diff --git a/tests/test32.c b/tests/test32.c new file mode 100644 index 0000000..ae123de --- /dev/null +++ b/tests/test32.c @@ -0,0 +1,37 @@ +// gcc -mfpmath=387 -o test32 test32.c -lm +#include +#include +#include + +volatile double test_values[] = { + 3.0, 2.0, 0.1 +}; + +#define TEST_X87(INSN_LOAD, INSN_OP, VAL_IDX) \ + do { \ + volatile double result; \ + volatile double* val_ptr = &test_values[VAL_IDX]; \ + __asm__ volatile( \ + "fldcw %[low]\n\t" INSN_LOAD "\n\t" INSN_OP "\n\t" \ + "fstl %[res]\n\t" \ + "fldcw %[orig]\n\t" \ + : [res] "=m"(result) \ + : [low] "m"(low_cw), \ + [orig] "m"(original_cw), \ + [val] "m"(*val_ptr) \ + : "st", "st(1)"); \ + printf("%-16s: %016lx\n", #INSN_OP, *(uint64_t*)&result); \ + } while (0) + +uint16_t original_cw, low_cw; + +int main() +{ + __asm__ volatile("fstcw %0" : "=m"(original_cw)); + low_cw = original_cw & ~((uint16_t)0x0300); + + TEST_X87("fld1; fldl %3", "fdivrp", 0); // 1.0 / 3.0 + TEST_X87("fldl %3", "fsqrt", 1); // sqrt(2.0) + TEST_X87("fldl %3; fldl %3", "faddp", 2); // 0.1 + 0.1 + return 0; +} diff --git a/tests32/benchfloat.c b/tests32/benchfloat.c new file mode 100755 index 0000000..93b8207 --- /dev/null +++ b/tests32/benchfloat.c @@ -0,0 +1,888 @@ +/* +** +** LINPACK.C Linpack benchmark, calculates FLOPS. +** (FLoating Point Operations Per Second) +** +** Translated to C by Bonnie Toy 5/88 +** +** Modified by Will Menninger, 10/93, with these features: +** (modified on 2/25/94 to fix a problem with daxpy for +** unequal increments or equal increments not equal to 1. +** Jack Dongarra) +** +** - Defaults to double precision. +** - Averages ROLLed and UNROLLed performance. +** - User selectable array sizes. +** - Automatically does enough repetitions to take at least 10 CPU seconds. +** - Prints machine precision. +** - ANSI prototyping. +** +** To compile: cc -O -o linpack linpack.c -lm +** +** +*/ + +#include +#include +#include +#include +#include +#include + +#define DP + +#ifdef SP +#define ZERO 0.0 +#define ONE 1.0 +#define PREC "Single" +#define BASE10DIG FLT_DIG + +typedef float REAL; +#endif + +#ifdef DP +#define ZERO 0.0e0 +#define ONE 1.0e0 +#define PREC "Double" +#define BASE10DIG DBL_DIG + +typedef double REAL; +#endif + +static REAL linpack (long nreps,int arsize); +static void matgen (REAL *a,int lda,int n,REAL *b,REAL *norma); +static void dgefa (REAL *a,int lda,int n,int *ipvt,int *info,int roll); +static void dgesl (REAL *a,int lda,int n,int *ipvt,REAL *b,int job,int roll); +static void daxpy_r (int n,REAL da,REAL *dx,int incx,REAL *dy,int incy); +static REAL ddot_r (int n,REAL *dx,int incx,REAL *dy,int incy); +static void dscal_r (int n,REAL da,REAL *dx,int incx); +static void daxpy_ur (int n,REAL da,REAL *dx,int incx,REAL *dy,int incy); +static REAL ddot_ur (int n,REAL *dx,int incx,REAL *dy,int incy); +static void dscal_ur (int n,REAL da,REAL *dx,int incx); +static int idamax (int n,REAL *dx,int incx); +static REAL second (void); + +static void *mempool; + + +void main(int argc, const char** argv) + + { + char buf[80]; + int arsize; + long arsize2d,memreq,nreps; + size_t malloc_arg; + + if(argc>1) + strcpy(buf, argv[1]); + + while (1) + { + /*printf("Enter array size (q to quit) [200]: "); + fgets(buf,79,stdin);*/ + + if (buf[0]=='q' || buf[0]=='Q') + break; + if (buf[0]=='\0' || buf[0]=='\n') + arsize=200; + else + arsize=atoi(buf); + arsize/=2; + arsize*=2; + if (arsize<10) + { + printf("Too small.\n"); + continue; + } + arsize2d = (long)arsize*(long)arsize; + memreq=arsize2d*sizeof(REAL)+(long)arsize*sizeof(REAL)+(long)arsize*sizeof(int); + printf("Memory required: %ldK.\n",(memreq+512L)>>10); + malloc_arg=(size_t)memreq; + if (malloc_arg!=memreq || (mempool=malloc(malloc_arg))==NULL) + { + printf("Not enough memory available for given array size.\n\n"); + continue; + } + printf("\n\nLINPACK benchmark, %s precision.\n",PREC); + printf("Machine precision: %d digits.\n",BASE10DIG); + printf("Array size %d X %d.\n",arsize,arsize); + printf("Average rolled and unrolled performance:\n\n"); + printf(" Reps Time(s) DGEFA DGESL OVERHEAD KFLOPS\n"); + printf("----------------------------------------------------\n"); + nreps=1; + while (linpack(nreps,arsize)<10.) + nreps*=2; + free(mempool); + printf("\n"); + strcpy(buf, "q"); + } + } + + +static REAL linpack(long nreps,int arsize) + + { + REAL *a,*b; + REAL norma,t1,kflops,tdgesl,tdgefa,totalt,toverhead,ops; + int *ipvt,n,info,lda; + long i,arsize2d; + + lda = arsize; + n = arsize/2; + arsize2d = (long)arsize*(long)arsize; + ops=((2.0*n*n*n)/3.0+2.0*n*n); + a=(REAL *)mempool; + b=a+arsize2d; + ipvt=(int *)&b[arsize]; + tdgesl=0; + tdgefa=0; + totalt=second(); + for (i=0;i *norma) ? a[lda*j+i] : *norma; + } + for (i = 0; i < n; i++) + b[i] = 0.0; + for (j = 0; j < n; j++) + for (i = 0; i < n; i++) + b[i] = b[i] + a[lda*j+i]; + } + + +/* +** +** DGEFA benchmark +** +** We would like to declare a[][lda], but c does not allow it. In this +** function, references to a[i][j] are written a[lda*i+j]. +** +** dgefa factors a double precision matrix by gaussian elimination. +** +** dgefa is usually called by dgeco, but it can be called +** directly with a saving in time if rcond is not needed. +** (time for dgeco) = (1 + 9/n)*(time for dgefa) . +** +** on entry +** +** a REAL precision[n][lda] +** the matrix to be factored. +** +** lda integer +** the leading dimension of the array a . +** +** n integer +** the order of the matrix a . +** +** on return +** +** a an upper triangular matrix and the multipliers +** which were used to obtain it. +** the factorization can be written a = l*u where +** l is a product of permutation and unit lower +** triangular matrices and u is upper triangular. +** +** ipvt integer[n] +** an integer vector of pivot indices. +** +** info integer +** = 0 normal value. +** = k if u[k][k] .eq. 0.0 . this is not an error +** condition for this subroutine, but it does +** indicate that dgesl or dgedi will divide by zero +** if called. use rcond in dgeco for a reliable +** indication of singularity. +** +** linpack. this version dated 08/14/78 . +** cleve moler, university of New Mexico, argonne national lab. +** +** functions +** +** blas daxpy,dscal,idamax +** +*/ +static void dgefa(REAL *a,int lda,int n,int *ipvt,int *info,int roll) + + { + REAL t; + int idamax(),j,k,kp1,l,nm1; + + /* gaussian elimination with partial pivoting */ + + if (roll) + { + *info = 0; + nm1 = n - 1; + if (nm1 >= 0) + for (k = 0; k < nm1; k++) + { + kp1 = k + 1; + + /* find l = pivot index */ + + l = idamax(n-k,&a[lda*k+k],1) + k; + ipvt[k] = l; + + /* zero pivot implies this column already + triangularized */ + + if (a[lda*k+l] != ZERO) + { + + /* interchange if necessary */ + + if (l != k) + { + t = a[lda*k+l]; + a[lda*k+l] = a[lda*k+k]; + a[lda*k+k] = t; + } + + /* compute multipliers */ + + t = -ONE/a[lda*k+k]; + dscal_r(n-(k+1),t,&a[lda*k+k+1],1); + + /* row elimination with column indexing */ + + for (j = kp1; j < n; j++) + { + t = a[lda*j+l]; + if (l != k) + { + a[lda*j+l] = a[lda*j+k]; + a[lda*j+k] = t; + } + daxpy_r(n-(k+1),t,&a[lda*k+k+1],1,&a[lda*j+k+1],1); + } + } + else + (*info) = k; + } + ipvt[n-1] = n-1; + if (a[lda*(n-1)+(n-1)] == ZERO) + (*info) = n-1; + } + else + { + *info = 0; + nm1 = n - 1; + if (nm1 >= 0) + for (k = 0; k < nm1; k++) + { + kp1 = k + 1; + + /* find l = pivot index */ + + l = idamax(n-k,&a[lda*k+k],1) + k; + ipvt[k] = l; + + /* zero pivot implies this column already + triangularized */ + + if (a[lda*k+l] != ZERO) + { + + /* interchange if necessary */ + + if (l != k) + { + t = a[lda*k+l]; + a[lda*k+l] = a[lda*k+k]; + a[lda*k+k] = t; + } + + /* compute multipliers */ + + t = -ONE/a[lda*k+k]; + dscal_ur(n-(k+1),t,&a[lda*k+k+1],1); + + /* row elimination with column indexing */ + + for (j = kp1; j < n; j++) + { + t = a[lda*j+l]; + if (l != k) + { + a[lda*j+l] = a[lda*j+k]; + a[lda*j+k] = t; + } + daxpy_ur(n-(k+1),t,&a[lda*k+k+1],1,&a[lda*j+k+1],1); + } + } + else + (*info) = k; + } + ipvt[n-1] = n-1; + if (a[lda*(n-1)+(n-1)] == ZERO) + (*info) = n-1; + } + } + + +/* +** +** DGESL benchmark +** +** We would like to declare a[][lda], but c does not allow it. In this +** function, references to a[i][j] are written a[lda*i+j]. +** +** dgesl solves the double precision system +** a * x = b or trans(a) * x = b +** using the factors computed by dgeco or dgefa. +** +** on entry +** +** a double precision[n][lda] +** the output from dgeco or dgefa. +** +** lda integer +** the leading dimension of the array a . +** +** n integer +** the order of the matrix a . +** +** ipvt integer[n] +** the pivot vector from dgeco or dgefa. +** +** b double precision[n] +** the right hand side vector. +** +** job integer +** = 0 to solve a*x = b , +** = nonzero to solve trans(a)*x = b where +** trans(a) is the transpose. +** +** on return +** +** b the solution vector x . +** +** error condition +** +** a division by zero will occur if the input factor contains a +** zero on the diagonal. technically this indicates singularity +** but it is often caused by improper arguments or improper +** setting of lda . it will not occur if the subroutines are +** called correctly and if dgeco has set rcond .gt. 0.0 +** or dgefa has set info .eq. 0 . +** +** to compute inverse(a) * c where c is a matrix +** with p columns +** dgeco(a,lda,n,ipvt,rcond,z) +** if (!rcond is too small){ +** for (j=0,j= 1) + for (k = 0; k < nm1; k++) + { + l = ipvt[k]; + t = b[l]; + if (l != k) + { + b[l] = b[k]; + b[k] = t; + } + daxpy_r(n-(k+1),t,&a[lda*k+k+1],1,&b[k+1],1); + } + + /* now solve u*x = y */ + + for (kb = 0; kb < n; kb++) + { + k = n - (kb + 1); + b[k] = b[k]/a[lda*k+k]; + t = -b[k]; + daxpy_r(k,t,&a[lda*k+0],1,&b[0],1); + } + } + else + { + + /* job = nonzero, solve trans(a) * x = b */ + /* first solve trans(u)*y = b */ + + for (k = 0; k < n; k++) + { + t = ddot_r(k,&a[lda*k+0],1,&b[0],1); + b[k] = (b[k] - t)/a[lda*k+k]; + } + + /* now solve trans(l)*x = y */ + + if (nm1 >= 1) + for (kb = 1; kb < nm1; kb++) + { + k = n - (kb+1); + b[k] = b[k] + ddot_r(n-(k+1),&a[lda*k+k+1],1,&b[k+1],1); + l = ipvt[k]; + if (l != k) + { + t = b[l]; + b[l] = b[k]; + b[k] = t; + } + } + } + } + else + { + nm1 = n - 1; + if (job == 0) + { + + /* job = 0 , solve a * x = b */ + /* first solve l*y = b */ + + if (nm1 >= 1) + for (k = 0; k < nm1; k++) + { + l = ipvt[k]; + t = b[l]; + if (l != k) + { + b[l] = b[k]; + b[k] = t; + } + daxpy_ur(n-(k+1),t,&a[lda*k+k+1],1,&b[k+1],1); + } + + /* now solve u*x = y */ + + for (kb = 0; kb < n; kb++) + { + k = n - (kb + 1); + b[k] = b[k]/a[lda*k+k]; + t = -b[k]; + daxpy_ur(k,t,&a[lda*k+0],1,&b[0],1); + } + } + else + { + + /* job = nonzero, solve trans(a) * x = b */ + /* first solve trans(u)*y = b */ + + for (k = 0; k < n; k++) + { + t = ddot_ur(k,&a[lda*k+0],1,&b[0],1); + b[k] = (b[k] - t)/a[lda*k+k]; + } + + /* now solve trans(l)*x = y */ + + if (nm1 >= 1) + for (kb = 1; kb < nm1; kb++) + { + k = n - (kb+1); + b[k] = b[k] + ddot_ur(n-(k+1),&a[lda*k+k+1],1,&b[k+1],1); + l = ipvt[k]; + if (l != k) + { + t = b[l]; + b[l] = b[k]; + b[k] = t; + } + } + } + } + } + + + +/* +** Constant times a vector plus a vector. +** Jack Dongarra, linpack, 3/11/78. +** ROLLED version +*/ +static void daxpy_r(int n,REAL da,REAL *dx,int incx,REAL *dy,int incy) + + { + int i,ix,iy; + + if (n <= 0) + return; + if (da == ZERO) + return; + + if (incx != 1 || incy != 1) + { + + /* code for unequal increments or equal increments != 1 */ + + ix = 1; + iy = 1; + if(incx < 0) ix = (-n+1)*incx + 1; + if(incy < 0)iy = (-n+1)*incy + 1; + for (i = 0;i < n; i++) + { + dy[iy] = dy[iy] + da*dx[ix]; + ix = ix + incx; + iy = iy + incy; + } + return; + } + + /* code for both increments equal to 1 */ + + for (i = 0;i < n; i++) + dy[i] = dy[i] + da*dx[i]; + } + + +/* +** Forms the dot product of two vectors. +** Jack Dongarra, linpack, 3/11/78. +** ROLLED version +*/ +static REAL ddot_r(int n,REAL *dx,int incx,REAL *dy,int incy) + + { + REAL dtemp; + int i,ix,iy; + + dtemp = ZERO; + + if (n <= 0) + return(ZERO); + + if (incx != 1 || incy != 1) + { + + /* code for unequal increments or equal increments != 1 */ + + ix = 0; + iy = 0; + if (incx < 0) ix = (-n+1)*incx; + if (incy < 0) iy = (-n+1)*incy; + for (i = 0;i < n; i++) + { + dtemp = dtemp + dx[ix]*dy[iy]; + ix = ix + incx; + iy = iy + incy; + } + return(dtemp); + } + + /* code for both increments equal to 1 */ + + for (i=0;i < n; i++) + dtemp = dtemp + dx[i]*dy[i]; + return(dtemp); + } + + +/* +** Scales a vector by a constant. +** Jack Dongarra, linpack, 3/11/78. +** ROLLED version +*/ +static void dscal_r(int n,REAL da,REAL *dx,int incx) + + { + int i,nincx; + + if (n <= 0) + return; + if (incx != 1) + { + + /* code for increment not equal to 1 */ + + nincx = n*incx; + for (i = 0; i < nincx; i = i + incx) + dx[i] = da*dx[i]; + return; + } + + /* code for increment equal to 1 */ + + for (i = 0; i < n; i++) + dx[i] = da*dx[i]; + } + + +/* +** constant times a vector plus a vector. +** Jack Dongarra, linpack, 3/11/78. +** UNROLLED version +*/ +static void daxpy_ur(int n,REAL da,REAL *dx,int incx,REAL *dy,int incy) + + { + int i,ix,iy,m; + + if (n <= 0) + return; + if (da == ZERO) + return; + + if (incx != 1 || incy != 1) + { + + /* code for unequal increments or equal increments != 1 */ + + ix = 1; + iy = 1; + if(incx < 0) ix = (-n+1)*incx + 1; + if(incy < 0)iy = (-n+1)*incy + 1; + for (i = 0;i < n; i++) + { + dy[iy] = dy[iy] + da*dx[ix]; + ix = ix + incx; + iy = iy + incy; + } + return; + } + + /* code for both increments equal to 1 */ + + m = n % 4; + if ( m != 0) + { + for (i = 0; i < m; i++) + dy[i] = dy[i] + da*dx[i]; + if (n < 4) + return; + } + for (i = m; i < n; i = i + 4) + { + dy[i] = dy[i] + da*dx[i]; + dy[i+1] = dy[i+1] + da*dx[i+1]; + dy[i+2] = dy[i+2] + da*dx[i+2]; + dy[i+3] = dy[i+3] + da*dx[i+3]; + } + } + + +/* +** Forms the dot product of two vectors. +** Jack Dongarra, linpack, 3/11/78. +** UNROLLED version +*/ +static REAL ddot_ur(int n,REAL *dx,int incx,REAL *dy,int incy) + + { + REAL dtemp; + int i,ix,iy,m; + + dtemp = ZERO; + + if (n <= 0) + return(ZERO); + + if (incx != 1 || incy != 1) + { + + /* code for unequal increments or equal increments != 1 */ + + ix = 0; + iy = 0; + if (incx < 0) ix = (-n+1)*incx; + if (incy < 0) iy = (-n+1)*incy; + for (i = 0;i < n; i++) + { + dtemp = dtemp + dx[ix]*dy[iy]; + ix = ix + incx; + iy = iy + incy; + } + return(dtemp); + } + + /* code for both increments equal to 1 */ + + m = n % 5; + if (m != 0) + { + for (i = 0; i < m; i++) + dtemp = dtemp + dx[i]*dy[i]; + if (n < 5) + return(dtemp); + } + for (i = m; i < n; i = i + 5) + { + dtemp = dtemp + dx[i]*dy[i] + + dx[i+1]*dy[i+1] + dx[i+2]*dy[i+2] + + dx[i+3]*dy[i+3] + dx[i+4]*dy[i+4]; + } + return(dtemp); + } + + +/* +** Scales a vector by a constant. +** Jack Dongarra, linpack, 3/11/78. +** UNROLLED version +*/ +static void dscal_ur(int n,REAL da,REAL *dx,int incx) + + { + int i,m,nincx; + + if (n <= 0) + return; + if (incx != 1) + { + + /* code for increment not equal to 1 */ + + nincx = n*incx; + for (i = 0; i < nincx; i = i + incx) + dx[i] = da*dx[i]; + return; + } + + /* code for increment equal to 1 */ + + m = n % 5; + if (m != 0) + { + for (i = 0; i < m; i++) + dx[i] = da*dx[i]; + if (n < 5) + return; + } + for (i = m; i < n; i = i + 5) + { + dx[i] = da*dx[i]; + dx[i+1] = da*dx[i+1]; + dx[i+2] = da*dx[i+2]; + dx[i+3] = da*dx[i+3]; + dx[i+4] = da*dx[i+4]; + } + } + + +/* +** Finds the index of element having max. absolute value. +** Jack Dongarra, linpack, 3/11/78. +*/ +static int idamax(int n,REAL *dx,int incx) + + { + REAL dmax; + int i, ix, itemp; + + if (n < 1) + return(-1); + if (n ==1 ) + return(0); + if(incx != 1) + { + + /* code for increment not equal to 1 */ + + ix = 1; + dmax = fabs((double)dx[0]); + ix = ix + incx; + for (i = 1; i < n; i++) + { + if(fabs((double)dx[ix]) > dmax) + { + itemp = i; + dmax = fabs((double)dx[ix]); + } + ix = ix + incx; + } + } + else + { + + /* code for increment equal to 1 */ + + itemp = 0; + dmax = fabs((double)dx[0]); + for (i = 1; i < n; i++) + if(fabs((double)dx[i]) > dmax) + { + itemp = i; + dmax = fabs((double)dx[i]); + } + } + return (itemp); + } + + +static REAL second(void) + + { + return ((REAL)((REAL)clock()/(REAL)CLOCKS_PER_SEC)); + } + + diff --git a/tests32/extensions/mmx.c b/tests32/extensions/mmx.c new file mode 100644 index 0000000..a43f975 --- /dev/null +++ b/tests32/extensions/mmx.c @@ -0,0 +1,674 @@ +#include +#include +#include +#include +#include +#include + + + +typedef uint8_t u8; +typedef int8_t i8; +typedef uint16_t u16; +typedef int16_t i16; +typedef uint32_t u32; +typedef int32_t i32; +typedef uint64_t u64; +typedef int64_t i64; + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +#define I8_MAX 0x7F +#define I8_MIN -0x80 +#define U8_MAX 0xFF +#define U8_MIN 0 + +#define I16_MAX 0x7FFF +#define I16_MIN -0x8000 +#define U16_MAX 0xFFFF +#define U16_MIN 0 + +#define I32_MAX 0x7FFFFFFF +#define I32_MIN -0x80000000 +#define U32_MAX 0xFFFFFFFF +#define U32_MIN 0 + +#define I64_MAX 0x7FFFFFFFFFFFFFFF +#define I64_MIN -0x8000000000000000 +#define U64_MAX 0xFFFFFFFFFFFFFFFF +#define U64_MIN 0 + +#define MMX_TEST_STRUCT(sz) \ + typedef struct mmx_##sz##_test { \ + sz a; \ + sz b; \ + sz result; \ + } mmx_##sz##_test_t + +MMX_TEST_STRUCT(u8); +MMX_TEST_STRUCT(i8); +MMX_TEST_STRUCT(u16); +MMX_TEST_STRUCT(i16); +MMX_TEST_STRUCT(u32); +MMX_TEST_STRUCT(i32); +MMX_TEST_STRUCT(u64); +MMX_TEST_STRUCT(i64); + +// Binary compare two mm registers +bool mm_raw_compare(__m64 a, __m64 b) { + __m64 a_upper_reg = _mm_srli_si64(a, 32); + __m64 b_upper_reg = _mm_srli_si64(b, 32); + + int a_lower = _m_to_int(a); + int a_upper = _m_to_int(a_upper_reg); + + int b_lower = _m_to_int(b); + int b_upper = _m_to_int(b_upper_reg); + + return (a_lower == b_lower) && (a_upper == b_upper); +} + +// Load a 64 bit value into a mm register +__m64 mm_load64(u64 val) { + __m64 lower = _m_from_int(val & 0xFFFFFFFF); + __m64 upper = _m_from_int((val >> 32) & 0xFFFFFFFF); + + __m64 shifted = _mm_slli_si64(upper, 32); + __m64 final = _m_por(shifted, lower); + + return final; +} + +#define MMX_ARITH_TEST(name, testcases, testcase_type, type, size, testfunc) \ +bool name() { \ + printf("TEST: " #name "\n"); \ + int errors = 0; \ +\ + for (size_t i = 0; i < ARRAY_SIZE(testcases); i++ ) { \ + testcase_type test_data = testcases[i]; \ +\ + __m64 a = _mm_set1_pi##size(test_data.a); \ + __m64 b = _mm_set1_pi##size(test_data.b); \ + __m64 expected = _mm_set1_pi##size(test_data.result); \ + __m64 result = testfunc(a, b); \ +\ + bool success = mm_raw_compare(expected, result); \ + errors += (int) (!success); \ + } \ +\ + _m_empty(); \ + printf("TEST: finished with: %d errors\n", errors); \ + return errors; \ +} + +#define MMX_SHIFT_TEST(name, testcases, testfunc) \ +bool name() { \ + printf("TEST: " #name "\n"); \ + int errors = 0; \ +\ + for (size_t i = 0; i < ARRAY_SIZE(testcases); i++ ) { \ + mmx_u64_test_t test_data = testcases[i]; \ +\ + __m64 a = mm_load64(test_data.a); \ + __m64 expected = mm_load64(test_data.result); \ + __m64 result = testfunc(a, test_data.b); \ +\ + bool success = mm_raw_compare(expected, result); \ + if (!success) { \ + printf( \ + "Failed; Expected: 0x%08x_%08x\tGot: 0x%08x_%08x\n", \ + _m_to_int(_mm_srli_si64(expected, 32)), \ + _m_to_int(expected), \ + _m_to_int(_mm_srli_si64(result, 32)), \ + _m_to_int(result) \ + ); \ + } \ + errors += (int) (!success); \ + } \ +\ + _m_empty(); \ + printf("TEST: finished with: %d errors\n", errors); \ + return errors; \ +} + + + +// Loads 2 64 bit immediates and compares with the third +// Test data must be of type mmx_u64_test_t +#define MMX_64_TEST(name, testcases, testfunc) \ +bool name() { \ + printf("TEST: " #name "\n"); \ + int errors = 0; \ +\ + for (size_t i = 0; i < ARRAY_SIZE(testcases); i++ ) { \ + mmx_u64_test_t test_data = testcases[i]; \ +\ + __m64 a = mm_load64(test_data.a); \ + __m64 b = mm_load64(test_data.b); \ + __m64 expected = mm_load64(test_data.result); \ + __m64 result = testfunc(a, b); \ +\ + bool success = mm_raw_compare(expected, result); \ + if (!success) { \ + printf( \ + "Failed; Expected: 0x%08x_%08x\tGot: 0x%08x_%08x\n", \ + _m_to_int(_mm_srli_si64(expected, 32)), \ + _m_to_int(expected), \ + _m_to_int(_mm_srli_si64(result, 32)), \ + _m_to_int(result) \ + ); \ + } \ + errors += (int) (!success); \ + } \ +\ + _m_empty(); \ + printf("TEST: finished with: %d errors\n", errors); \ + return errors; \ +} + + +mmx_i8_test_t mmx_i8_add_test_data[] = { + { .a = 1, .b = 2, .result = 3 }, + { .a = 0, .b = 1, .result = 1 }, + { .a = I8_MAX, .b = 1, .result = I8_MIN }, + { .a = I8_MIN, .b = -1, .result = I8_MAX }, + { .a = 0, .b = U8_MAX, .result = U8_MAX }, +}; +mmx_i8_test_t mmx_i8_add_sat_test_data[] = { + { .a = 1, .b = 2, .result = 3 }, + { .a = 0, .b = 1, .result = 1 }, + { .a = I8_MAX, .b = 1, .result = I8_MAX }, + { .a = I8_MIN, .b = -1, .result = I8_MIN }, +}; +mmx_u8_test_t mmx_u8_add_sat_test_data[] = { + { .a = 1, .b = 2, .result = 3 }, + { .a = 0, .b = 1, .result = 1 }, + { .a = U8_MAX, .b = 1, .result = U8_MAX }, + { .a = 0, .b = U8_MAX, .result = U8_MAX }, +}; + +mmx_i16_test_t mmx_i16_add_test_data[] = { + { .a = 1, .b = 2, .result = 3 }, + { .a = 0, .b = 1, .result = 1 }, + { .a = I16_MAX, .b = 1, .result = I16_MIN }, + { .a = I16_MIN, .b = -1, .result = I16_MAX }, +}; +mmx_i16_test_t mmx_i16_add_sat_test_data[] = { + { .a = 1, .b = 2, .result = 3 }, + { .a = 0, .b = 1, .result = 1 }, + { .a = I16_MAX, .b = 1, .result = I16_MAX }, + { .a = I16_MIN, .b = -1, .result = I16_MIN }, +}; +mmx_u16_test_t mmx_u16_add_sat_test_data[] = { + { .a = 1, .b = 2, .result = 3 }, + { .a = 0, .b = 1, .result = 1 }, + { .a = U16_MAX, .b = 1, .result = U16_MAX }, + { .a = 0, .b = U16_MAX, .result = U16_MAX }, +}; + +mmx_i32_test_t mmx_i32_add_test_data[] = { + { .a = 1, .b = 2, .result = 3 }, + { .a = 0, .b = 1, .result = 1 }, + { .a = I32_MAX, .b = 1, .result = I32_MIN }, + { .a = I32_MIN, .b = -1, .result = I32_MAX }, +}; + +MMX_ARITH_TEST(test_mmx_paddb, mmx_i8_add_test_data, mmx_i8_test_t, i8, 8, _m_paddb); +MMX_ARITH_TEST(test_mmx_paddsb, mmx_i8_add_sat_test_data, mmx_i8_test_t, i8, 8, _m_paddsb); +MMX_ARITH_TEST(test_mmx_paddusb, mmx_u8_add_sat_test_data, mmx_u8_test_t, u8, 8, _m_paddusb); + +MMX_ARITH_TEST(test_mmx_paddw, mmx_i16_add_test_data, mmx_i16_test_t, i16, 16, _m_paddw); +MMX_ARITH_TEST(test_mmx_paddsw, mmx_i16_add_sat_test_data, mmx_i16_test_t, i16, 16, _m_paddsw); +MMX_ARITH_TEST(test_mmx_paddusw, mmx_u16_add_sat_test_data, mmx_u16_test_t, u16, 16, _m_paddusw); + +MMX_ARITH_TEST(test_mmx_paddd, mmx_i32_add_test_data, mmx_i32_test_t, i32, 32, _m_paddd); + + + +mmx_i8_test_t mmx_i8_sub_test_data[] = { + { .a = 3, .b = 2, .result = 1 }, + { .a = 1, .b = 1, .result = 0 }, + { .a = I8_MIN, .b = 1, .result = I8_MAX }, + { .a = I8_MAX, .b = -1, .result = I8_MIN }, + { .a = U8_MAX, .b = U8_MAX, .result = 0 }, +}; +mmx_i8_test_t mmx_i8_sub_sat_test_data[] = { + { .a = 3, .b = 2, .result = 1 }, + { .a = 1, .b = 1, .result = 0 }, + { .a = I8_MIN, .b = 1, .result = I8_MIN }, + { .a = I8_MAX, .b = -1, .result = I8_MAX }, +}; +mmx_u8_test_t mmx_u8_sub_sat_test_data[] = { + { .a = 3, .b = 2, .result = 1 }, + { .a = 1, .b = 1, .result = 0 }, + { .a = U8_MIN, .b = 1, .result = U8_MIN }, + { .a = U8_MAX, .b = U8_MAX, .result = 0 }, +}; + +mmx_i16_test_t mmx_i16_sub_test_data[] = { + { .a = 3, .b = 2, .result = 1 }, + { .a = 1, .b = 1, .result = 0 }, + { .a = I16_MIN, .b = 1, .result = I16_MAX }, + { .a = I16_MAX, .b = -1, .result = I16_MIN }, +}; +mmx_i16_test_t mmx_i16_sub_sat_test_data[] = { + { .a = 3, .b = 2, .result = 1 }, + { .a = 1, .b = 1, .result = 0 }, + { .a = I16_MIN, .b = 1, .result = I16_MIN }, + { .a = I16_MAX, .b = -1, .result = I16_MAX }, +}; +mmx_u16_test_t mmx_u16_sub_sat_test_data[] = { + { .a = 3, .b = 2, .result = 1 }, + { .a = 1, .b = 1, .result = 0 }, + { .a = U16_MIN, .b = 1, .result = U16_MIN }, + { .a = U16_MIN, .b = U16_MIN, .result = 0 }, +}; + +mmx_i32_test_t mmx_i32_sub_test_data[] = { + { .a = 3, .b = 2, .result = 1 }, + { .a = 1, .b = 1, .result = 0 }, + { .a = I32_MIN, .b = 1, .result = I32_MAX }, + { .a = I32_MAX, .b = -1, .result = I32_MIN }, +}; + +MMX_ARITH_TEST(test_mmx_psubb, mmx_i8_sub_test_data, mmx_i8_test_t, i8, 8, _m_psubb); +MMX_ARITH_TEST(test_mmx_psubsb, mmx_i8_sub_sat_test_data, mmx_i8_test_t, i8, 8, _m_psubsb); +MMX_ARITH_TEST(test_mmx_psubusb, mmx_u8_sub_sat_test_data, mmx_u8_test_t, u8, 8, _m_psubusb); + +MMX_ARITH_TEST(test_mmx_psubw, mmx_i16_sub_test_data, mmx_i16_test_t, i16, 16, _m_psubw); +MMX_ARITH_TEST(test_mmx_psubuw, mmx_i16_sub_sat_test_data, mmx_i16_test_t, i16, 16, _m_psubsw); +MMX_ARITH_TEST(test_mmx_psubusw, mmx_u16_sub_sat_test_data, mmx_u16_test_t, u16, 16, _m_psubusw); + +MMX_ARITH_TEST(test_mmx_psubd, mmx_i32_sub_test_data, mmx_i32_test_t, i32, 32, _m_psubd); + + + + +mmx_u64_test_t mmx_por_test_data[] = { + { .a = 0xAAAAAAAAAAAAAAAA, + .b = 0x5555555555555555, + .result = 0xFFFFFFFFFFFFFFFF }, + { .a = 0x0000000000000000, + .b = 0x1111111111111111, + .result = 0x1111111111111111 }, +}; + +mmx_u64_test_t mmx_pand_test_data[] = { + { .a = 0xAAAAAAAAAAAAAAAA, + .b = 0x5555555555555555, + .result = 0x0000000000000000 }, + { .a = 0xFFFFFFFFFFFFFFFF, + .b = 0xFFFFFFFFFFFFFFFF, + .result = 0xFFFFFFFFFFFFFFFF }, +}; + +mmx_u64_test_t mmx_pandn_test_data[] = { + { .a = 0x0000000000000000, + .b = 0xFFFFFFFFFFFFFFFF, + .result = 0xFFFFFFFFFFFFFFFF }, + { .a = 0xFFFFFFFFFFFFFFFF, + .b = 0x0000000000000000, + .result = 0x0000000000000000 }, +}; + + +mmx_u64_test_t mmx_pxor_test_data[] = { + { .a = 0xAAAAAAAAAAAAAAAA, + .b = 0x5555555555555555, + .result = 0xFFFFFFFFFFFFFFFF }, + { .a = 0xFFFFFFFFFFFFFFFF, + .b = 0xFFFFFFFFFFFFFFFF, + .result = 0x0000000000000000 }, +}; + + +MMX_64_TEST(test_mmx_por, mmx_por_test_data, _m_por); +MMX_64_TEST(test_mmx_pand, mmx_pand_test_data, _m_pand); +MMX_64_TEST(test_mmx_pandn, mmx_pandn_test_data, _m_pandn); +MMX_64_TEST(test_mmx_pxor, mmx_pxor_test_data, _m_pxor); + + + + + +mmx_i16_test_t mmx_pmullw_test_data[] = { + { .a = 10, .b = 10, .result = 100 }, + { .a = 32000, .b = 10, .result = 0xE200 }, + { .a = 20000, .b = 20000, .result = 0x8400 }, +}; +mmx_i16_test_t mmx_pmulhw_test_data[] = { + { .a = 10, .b = 10, .result = 0 }, + { .a = 32000, .b = 10, .result = 4 }, + { .a = 20000, .b = 20000, .result = 0x17D7 }, +}; +mmx_u64_test_t mmx_pmaddwd_test_data[] = { + { .a = 0x0000000100000001, + .b = 0x0000000100000001, + .result = 0x0000000100000001 }, + { .a = 0x0000000200000004, + .b = 0x0000000200000004, + .result = 0x0000000400000010 }, + + { .a = 0x000000007FFFFFFF, + .b = 0x000000007FFFFFFF, + .result = 0x000000003FFF0002 }, + + // -1 * -1 = 2 + { .a = 0x00000000FFFFFFFF, + .b = 0x00000000FFFFFFFF, + .result = 0x0000000000000002 }, +}; + + +MMX_ARITH_TEST(test_mmx_pmullw, mmx_pmullw_test_data, mmx_i16_test_t, i16, 16, _m_pmullw); +MMX_ARITH_TEST(test_mmx_pmulhw, mmx_pmulhw_test_data, mmx_i16_test_t, i16, 16, _m_pmulhw); +MMX_64_TEST(test_mmx_pmaddwd, mmx_pmaddwd_test_data, _m_pmaddwd); + + + + + +mmx_u64_test_t mmx_packssdw_test_data[] = { + { .a = 0x0000000200000001, + .b = 0x0000000400000003, + .result = 0x0004000300020001 }, + { .a = 0x7FFFFFFF7FFFFFFF, + .b = 0x7FFFFFFF7FFFFFFF, + .result = 0x7FFF7FFF7FFF7FFF }, + { .a = 0x8000000080000000, + .b = 0x8000000080000000, + .result = 0x8000800080008000 }, +}; +mmx_u64_test_t mmx_packsswb_test_data[] = { + { .a = 0x0004000300020001, + .b = 0x0008000700060005, + .result = 0x0807060504030201 }, + { .a = 0x7FFF7FFF7FFF7FFF, + .b = 0x7FFF7FFF7FFF7FFF, + .result = 0x7F7F7F7F7F7F7F7F }, + { .a = 0x8000800080008000, + .b = 0x8000800080008000, + .result = 0x8080808080808080 }, +}; +mmx_u64_test_t mmx_packuswb_test_data[] = { + { .a = 0x0004000300020001, + .b = 0x0008000700060005, + .result = 0x0807060504030201 }, + { .a = 0x7FFF7FFF7FFF7FFF, + .b = 0x7FFF7FFF7FFF7FFF, + .result = 0xFFFFFFFFFFFFFFFF }, + { .a = 0x8000800080008000, + .b = 0x8000800080008000, + .result = 0x0000000000000000 }, +}; + + +MMX_64_TEST(test_mmx_packssdw, mmx_packssdw_test_data, _m_packssdw); +MMX_64_TEST(test_mmx_packsswb, mmx_packsswb_test_data, _m_packsswb); +MMX_64_TEST(test_mmx_packuswb, mmx_packuswb_test_data, _m_packuswb); + + + +mmx_u64_test_t mmx_punpckhbw_test_data[] = { + { .a = 0x4433221100000000, + .b = 0x8877665500000000, + .result = 0x8844773366225511 }, +}; +mmx_u64_test_t mmx_punpckhdq_test_data[] = { + { .a = 0xAAAAAAAA00000000, + .b = 0xBBBBBBBB00000000, + .result = 0xBBBBBBBBAAAAAAAA }, +}; +mmx_u64_test_t mmx_punpckhwd_test_data[] = { + { .a = 0xBBBBAAAA00000000, + .b = 0xDDDDCCCC00000000, + .result = 0xDDDDBBBBCCCCAAAA }, +}; +mmx_u64_test_t mmx_punpcklbw_test_data[] = { + { .a = 0x0000000044332211, + .b = 0x0000000088776655, + .result = 0x8844773366225511 }, +}; +mmx_u64_test_t mmx_punpckldq_test_data[] = { + { .a = 0x00000000AAAAAAAA, + .b = 0x00000000BBBBBBBB, + .result = 0xBBBBBBBBAAAAAAAA }, +}; +mmx_u64_test_t mmx_punpcklwd_test_data[] = { + { .a = 0x00000000BBBBAAAA, + .b = 0x00000000DDDDCCCC, + .result = 0xDDDDBBBBCCCCAAAA }, +}; + + +MMX_64_TEST(test_mmx_punpckhbw, mmx_punpckhbw_test_data, _m_punpckhbw); +MMX_64_TEST(test_mmx_punpckhdq, mmx_punpckhdq_test_data, _m_punpckhdq); +MMX_64_TEST(test_mmx_punpckhwd, mmx_punpckhwd_test_data, _m_punpckhwd); +MMX_64_TEST(test_mmx_punpcklbw, mmx_punpcklbw_test_data, _m_punpcklbw); +MMX_64_TEST(test_mmx_punpckldq, mmx_punpckldq_test_data, _m_punpckldq); +MMX_64_TEST(test_mmx_punpcklwd, mmx_punpcklwd_test_data, _m_punpcklwd); + + + + + + +mmx_u64_test_t mmx_pcmpeqb_test_data[] = { + { .a = 0x8877665544332211, + .b = 0x0077005500330011, + .result = 0x00FF00FF00FF00FF }, +}; +mmx_u64_test_t mmx_pcmpeqw_test_data[] = { + { .a = 0x4444333322221111, + .b = 0x0000333300001111, + .result = 0x0000FFFF0000FFFF }, +}; +mmx_u64_test_t mmx_pcmpeqd_test_data[] = { + { .a = 0x2222222211111111, + .b = 0x2222222200000000, + .result = 0xFFFFFFFF00000000 }, +}; + +mmx_u64_test_t mmx_pcmpgtb_test_data[] = { + { .a = 0x0000000000002201, + .b = 0x0000000000002300, + .result = 0x00000000000000FF }, +}; +mmx_u64_test_t mmx_pcmpgtw_test_data[] = { + { .a = 0x4444333322221111, + .b = 0x0000333300001112, + .result = 0xFFFF0000FFFF0000 }, +}; +mmx_u64_test_t mmx_pcmpgtd_test_data[] = { + { .a = 0x2222222111111111, + .b = 0x2222222200000000, + .result = 0x00000000FFFFFFFF }, +}; + + +MMX_64_TEST(test_mmx_pcmpeqb, mmx_pcmpeqb_test_data, _m_pcmpeqb); +MMX_64_TEST(test_mmx_pcmpeqw, mmx_pcmpeqw_test_data, _m_pcmpeqw); +MMX_64_TEST(test_mmx_pcmpeqd, mmx_pcmpeqd_test_data, _m_pcmpeqd); +MMX_64_TEST(test_mmx_pcmpgtb, mmx_pcmpgtb_test_data, _m_pcmpgtb); +MMX_64_TEST(test_mmx_pcmpgtw, mmx_pcmpgtw_test_data, _m_pcmpgtw); +MMX_64_TEST(test_mmx_pcmpgtd, mmx_pcmpgtd_test_data, _m_pcmpgtd); + + + + +mmx_u64_test_t mmx_pslld_test_data[] = { + { .a = 1, .b = 1, .result = 2 }, + { .a = 16, .b = 1, .result = 32 }, + { .a = 16, .b = 32, .result = 0 }, + { .a = 16, .b = 0, .result = 16 }, +}; +mmx_u64_test_t mmx_psllq_test_data[] = { + { .a = 1, .b = 1, .result = 2 }, + { .a = 16, .b = 1, .result = 32 }, + { .a = 16, .b = 64, .result = 0 }, + { .a = 16, .b = 0, .result = 16 }, +}; +mmx_u64_test_t mmx_psllw_test_data[] = { + { .a = 1, .b = 1, .result = 2 }, + { .a = 16, .b = 1, .result = 32 }, + { .a = 16, .b = 16, .result = 0 }, + { .a = 16, .b = 0, .result = 16 }, +}; +mmx_u64_test_t mmx_psrad_test_data[] = { + { .a = 1, .b = 1, .result = 0 }, + { .a = 16, .b = 1, .result = 8 }, + { .a = 16, .b = 0, .result = 16 }, + { .a = 0x7FFFFFFF, .b = 1, .result = 0x3FFFFFFF }, + + { .a = I32_MAX, .b = 32, .result = 0 }, + { .a = I32_MIN, .b = 32, .result = U32_MAX }, +}; +mmx_u64_test_t mmx_psraw_test_data[] = { + { .a = 1, .b = 1, .result = 0 }, + { .a = 16, .b = 1, .result = 8 }, + { .a = 16, .b = 0, .result = 16 }, + { .a = 0x7FFF, .b = 1, .result = 0x3FFF }, + + { .a = I16_MAX, .b = 16, .result = 0 }, + { .a = U16_MAX, .b = 16, .result = U16_MAX }, +}; +mmx_u64_test_t mmx_psrld_test_data[] = { + { .a = 1, .b = 1, .result = 0 }, + { .a = 16, .b = 1, .result = 8 }, + { .a = 16, .b = 0, .result = 16 }, + { .a = 0x7FFFFFFF, .b = 1, .result = 0x3FFFFFFF }, + + { .a = I32_MAX, .b = 32, .result = 0 }, + { .a = I32_MIN, .b = 32, .result = 0 }, +}; +mmx_u64_test_t mmx_psrlq_test_data[] = { + { .a = 1, .b = 1, .result = 0 }, + { .a = 16, .b = 1, .result = 8 }, + { .a = 16, .b = 0, .result = 16 }, + + { .a = I64_MAX, .b = 64, .result = 0 }, + { .a = I64_MIN, .b = 64, .result = 0 }, +}; +mmx_u64_test_t mmx_psrlw_test_data[] = { + { .a = 1, .b = 1, .result = 0 }, + { .a = 16, .b = 1, .result = 8 }, + { .a = 16, .b = 0, .result = 16 }, + + { .a = I16_MAX, .b = 16, .result = 0 }, + + // TODO: Works on my machine + // { .a = I16_MIN, .b = 16, .result = 0 }, +}; + + + +MMX_64_TEST(test_mmx_pslld, mmx_pslld_test_data, _m_pslld); +MMX_64_TEST(test_mmx_psllq, mmx_psllq_test_data, _m_psllq); +MMX_64_TEST(test_mmx_psllw, mmx_psllw_test_data, _m_psllw); +MMX_64_TEST(test_mmx_psrad, mmx_psrad_test_data, _m_psrad); +MMX_64_TEST(test_mmx_psraw, mmx_psraw_test_data, _m_psraw); +MMX_64_TEST(test_mmx_psrld, mmx_psrld_test_data, _m_psrld); +MMX_64_TEST(test_mmx_psrlq, mmx_psrlq_test_data, _m_psrlq); +MMX_64_TEST(test_mmx_psrlw, mmx_psrlw_test_data, _m_psrlw); + +MMX_SHIFT_TEST(test_mmx_pslldi, mmx_pslld_test_data, _m_pslldi); +MMX_SHIFT_TEST(test_mmx_psllqi, mmx_psllq_test_data, _m_psllqi); +MMX_SHIFT_TEST(test_mmx_psllwi, mmx_psllw_test_data, _m_psllwi); +MMX_SHIFT_TEST(test_mmx_psradi, mmx_psrad_test_data, _m_psradi); +MMX_SHIFT_TEST(test_mmx_psrawi, mmx_psraw_test_data, _m_psrawi); +MMX_SHIFT_TEST(test_mmx_psrldi, mmx_psrld_test_data, _m_psrldi); +MMX_SHIFT_TEST(test_mmx_psrlqi, mmx_psrlq_test_data, _m_psrlqi); +MMX_SHIFT_TEST(test_mmx_psrlwi, mmx_psrlw_test_data, _m_psrlwi); + + + + +bool test_mmx_cpuid() { + printf("TEST: test_mmx_cpuid\n"); + + unsigned int eax, ebx, ecx, edx; + asm volatile( + "cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (1), "c" (0) + ); + + int has_mmx = !!(edx & (1 << 23)); + if (has_mmx) { + return 0; + } + return 1; + +} + +int main() { + int errors = 0; + + errors += (int) test_mmx_cpuid(); + + + errors += (int) test_mmx_paddb(); + errors += (int) test_mmx_paddsb(); + errors += (int) test_mmx_paddusb(); + errors += (int) test_mmx_paddw(); + errors += (int) test_mmx_paddsw(); + errors += (int) test_mmx_paddusw(); + errors += (int) test_mmx_paddd(); + + errors += (int) test_mmx_psubb(); + errors += (int) test_mmx_psubsb(); + errors += (int) test_mmx_psubusb(); + errors += (int) test_mmx_psubw(); + errors += (int) test_mmx_psubuw(); + errors += (int) test_mmx_psubusw(); + errors += (int) test_mmx_psubd(); + + errors += (int) test_mmx_por(); + errors += (int) test_mmx_pand(); + errors += (int) test_mmx_pandn(); + errors += (int) test_mmx_pxor(); + + errors += (int) test_mmx_pmullw(); + errors += (int) test_mmx_pmulhw(); + errors += (int) test_mmx_pmaddwd(); + + errors += (int) test_mmx_packssdw(); + errors += (int) test_mmx_packsswb(); + errors += (int) test_mmx_packuswb(); + + errors += (int) test_mmx_punpckhbw(); + errors += (int) test_mmx_punpckhdq(); + errors += (int) test_mmx_punpckhwd(); + errors += (int) test_mmx_punpcklbw(); + errors += (int) test_mmx_punpckldq(); + errors += (int) test_mmx_punpcklwd(); + + errors += (int) test_mmx_pcmpeqb(); + errors += (int) test_mmx_pcmpeqw(); + errors += (int) test_mmx_pcmpeqd(); + errors += (int) test_mmx_pcmpgtb(); + errors += (int) test_mmx_pcmpgtw(); + errors += (int) test_mmx_pcmpgtd(); + + errors += (int) test_mmx_psllw(); + errors += (int) test_mmx_psllwi(); + errors += (int) test_mmx_pslld(); + errors += (int) test_mmx_pslldi(); + errors += (int) test_mmx_psllq(); + errors += (int) test_mmx_psllqi(); + errors += (int) test_mmx_psraw(); + errors += (int) test_mmx_psrawi(); + errors += (int) test_mmx_psrad(); + errors += (int) test_mmx_psradi(); + errors += (int) test_mmx_psrld(); + errors += (int) test_mmx_psrldi(); + errors += (int) test_mmx_psrlq(); + errors += (int) test_mmx_psrlqi(); + errors += (int) test_mmx_psrlw(); + errors += (int) test_mmx_psrlwi(); + + + printf("Errors: %d\n", errors); + return errors; +} + diff --git a/tests32/extensions/mmx.txt b/tests32/extensions/mmx.txt new file mode 100644 index 0000000..673647b --- /dev/null +++ b/tests32/extensions/mmx.txt @@ -0,0 +1,106 @@ +TEST: test_mmx_cpuid +TEST: test_mmx_paddb +TEST: finished with: 0 errors +TEST: test_mmx_paddsb +TEST: finished with: 0 errors +TEST: test_mmx_paddusb +TEST: finished with: 0 errors +TEST: test_mmx_paddw +TEST: finished with: 0 errors +TEST: test_mmx_paddsw +TEST: finished with: 0 errors +TEST: test_mmx_paddusw +TEST: finished with: 0 errors +TEST: test_mmx_paddd +TEST: finished with: 0 errors +TEST: test_mmx_psubb +TEST: finished with: 0 errors +TEST: test_mmx_psubsb +TEST: finished with: 0 errors +TEST: test_mmx_psubusb +TEST: finished with: 0 errors +TEST: test_mmx_psubw +TEST: finished with: 0 errors +TEST: test_mmx_psubuw +TEST: finished with: 0 errors +TEST: test_mmx_psubusw +TEST: finished with: 0 errors +TEST: test_mmx_psubd +TEST: finished with: 0 errors +TEST: test_mmx_por +TEST: finished with: 0 errors +TEST: test_mmx_pand +TEST: finished with: 0 errors +TEST: test_mmx_pandn +TEST: finished with: 0 errors +TEST: test_mmx_pxor +TEST: finished with: 0 errors +TEST: test_mmx_pmullw +TEST: finished with: 0 errors +TEST: test_mmx_pmulhw +TEST: finished with: 0 errors +TEST: test_mmx_pmaddwd +TEST: finished with: 0 errors +TEST: test_mmx_packssdw +TEST: finished with: 0 errors +TEST: test_mmx_packsswb +TEST: finished with: 0 errors +TEST: test_mmx_packuswb +TEST: finished with: 0 errors +TEST: test_mmx_punpckhbw +TEST: finished with: 0 errors +TEST: test_mmx_punpckhdq +TEST: finished with: 0 errors +TEST: test_mmx_punpckhwd +TEST: finished with: 0 errors +TEST: test_mmx_punpcklbw +TEST: finished with: 0 errors +TEST: test_mmx_punpckldq +TEST: finished with: 0 errors +TEST: test_mmx_punpcklwd +TEST: finished with: 0 errors +TEST: test_mmx_pcmpeqb +TEST: finished with: 0 errors +TEST: test_mmx_pcmpeqw +TEST: finished with: 0 errors +TEST: test_mmx_pcmpeqd +TEST: finished with: 0 errors +TEST: test_mmx_pcmpgtb +TEST: finished with: 0 errors +TEST: test_mmx_pcmpgtw +TEST: finished with: 0 errors +TEST: test_mmx_pcmpgtd +TEST: finished with: 0 errors +TEST: test_mmx_psllw +TEST: finished with: 0 errors +TEST: test_mmx_psllwi +TEST: finished with: 0 errors +TEST: test_mmx_pslld +TEST: finished with: 0 errors +TEST: test_mmx_pslldi +TEST: finished with: 0 errors +TEST: test_mmx_psllq +TEST: finished with: 0 errors +TEST: test_mmx_psllqi +TEST: finished with: 0 errors +TEST: test_mmx_psraw +TEST: finished with: 0 errors +TEST: test_mmx_psrawi +TEST: finished with: 0 errors +TEST: test_mmx_psrad +TEST: finished with: 0 errors +TEST: test_mmx_psradi +TEST: finished with: 0 errors +TEST: test_mmx_psrld +TEST: finished with: 0 errors +TEST: test_mmx_psrldi +TEST: finished with: 0 errors +TEST: test_mmx_psrlq +TEST: finished with: 0 errors +TEST: test_mmx_psrlqi +TEST: finished with: 0 errors +TEST: test_mmx_psrlw +TEST: finished with: 0 errors +TEST: test_mmx_psrlwi +TEST: finished with: 0 errors +Errors: 0 diff --git a/tests32/ref01.txt b/tests32/ref01.txt new file mode 100644 index 0000000..980a0d5 --- /dev/null +++ b/tests32/ref01.txt @@ -0,0 +1 @@ +Hello World! diff --git a/tests32/ref02.txt b/tests32/ref02.txt new file mode 100644 index 0000000..980a0d5 --- /dev/null +++ b/tests32/ref02.txt @@ -0,0 +1 @@ +Hello World! diff --git a/tests32/ref03.txt b/tests32/ref03.txt new file mode 100644 index 0000000..980a0d5 --- /dev/null +++ b/tests32/ref03.txt @@ -0,0 +1 @@ +Hello World! diff --git a/tests32/ref04.txt b/tests32/ref04.txt new file mode 100644 index 0000000..49e7fa3 --- /dev/null +++ b/tests32/ref04.txt @@ -0,0 +1 @@ +Hello, argc=2 argv[1]=yeah diff --git a/tests32/ref05.txt b/tests32/ref05.txt new file mode 100644 index 0000000..5152dcb --- /dev/null +++ b/tests32/ref05.txt @@ -0,0 +1,6 @@ +fact(7)=5040 +Prime list 0..5040: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997 1999 2003 2011 2017 2027 2029 2039 2053 2063 2069 2081 2083 2087 2089 2099 2111 2113 2129 2131 2137 2141 2143 2153 2161 2179 2203 2207 2213 2221 2237 2239 2243 2251 2267 2269 2273 2281 2287 2293 2297 2309 2311 2333 2339 2341 2347 2351 2357 2371 2377 2381 2383 2389 2393 2399 2411 2417 2423 2437 2441 2447 2459 2467 2473 2477 2503 2521 2531 2539 2543 2549 2551 2557 2579 2591 2593 2609 2617 2621 2633 2647 2657 2659 2663 2671 2677 2683 2687 2689 2693 2699 2707 2711 2713 2719 2729 2731 2741 2749 2753 2767 2777 2789 2791 2797 2801 2803 2819 2833 2837 2843 2851 2857 2861 2879 2887 2897 2903 2909 2917 2927 2939 2953 2957 2963 2969 2971 2999 3001 3011 3019 3023 3037 3041 3049 3061 3067 3079 3083 3089 3109 3119 3121 3137 3163 3167 3169 3181 3187 3191 3203 3209 3217 3221 3229 3251 3253 3257 3259 3271 3299 3301 3307 3313 3319 3323 3329 3331 3343 3347 3359 3361 3371 3373 3389 3391 3407 3413 3433 3449 3457 3461 3463 3467 3469 3491 3499 3511 3517 3527 3529 3533 3539 3541 3547 3557 3559 3571 3581 3583 3593 3607 3613 3617 3623 3631 3637 3643 3659 3671 3673 3677 3691 3697 3701 3709 3719 3727 3733 3739 3761 3767 3769 3779 3793 3797 3803 3821 3823 3833 3847 3851 3853 3863 3877 3881 3889 3907 3911 3917 3919 3923 3929 3931 3943 3947 3967 3989 4001 4003 4007 4013 4019 4021 4027 4049 4051 4057 4073 4079 4091 4093 4099 4111 4127 4129 4133 4139 4153 4157 4159 4177 4201 4211 4217 4219 4229 4231 4241 4243 4253 4259 4261 4271 4273 4283 4289 4297 4327 4337 4339 4349 4357 4363 4373 4391 4397 4409 4421 4423 4441 4447 4451 4457 4463 4481 4483 4493 4507 4513 4517 4519 4523 4547 4549 4561 4567 4583 4591 4597 4603 4621 4637 4639 4643 4649 4651 4657 4663 4673 4679 4691 4703 4721 4723 4729 4733 4751 4759 4783 4787 4789 4793 4799 4801 4813 4817 4831 4861 4871 4877 4889 4903 4909 4919 4931 4933 4937 4943 4951 4957 4967 4969 4973 4987 4993 4999 5003 5009 5011 5021 5023 5039 +(un)signed char = -5/83 (un)signed int = -53/65500 total=65525 +65500/5=13100, 65500%5=0 +65525/5=13105, 65525%5=0 +65525/-53=-1236 + 17 \ No newline at end of file diff --git a/tests32/ref06.txt b/tests32/ref06.txt new file mode 100644 index 0000000..8fca60f --- /dev/null +++ b/tests32/ref06.txt @@ -0,0 +1,4 @@ +[02] Second thread executing +[02] Thread done. + +[00] Done. diff --git a/tests32/ref07.txt b/tests32/ref07.txt new file mode 100644 index 0000000..76649ab --- /dev/null +++ b/tests32/ref07.txt @@ -0,0 +1 @@ +0 is 0.000000, sin(pi/2) is 1.000000 and 3*1.5 is 4.500000. diff --git a/tests32/ref08.txt b/tests32/ref08.txt new file mode 100644 index 0000000..87d2ba5 --- /dev/null +++ b/tests32/ref08.txt @@ -0,0 +1 @@ +31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185 \ No newline at end of file diff --git a/tests32/ref09.txt b/tests32/ref09.txt new file mode 100644 index 0000000..adcb7a7 --- /dev/null +++ b/tests32/ref09.txt @@ -0,0 +1,2 @@ +Child has x = 2 +Parent has x = 0 diff --git a/tests32/ref10.txt b/tests32/ref10.txt new file mode 100644 index 0000000..4af4852 --- /dev/null +++ b/tests32/ref10.txt @@ -0,0 +1,10 @@ +thread #0 +thread #1 +thread #2 +thread #3 +thread #4 +thread #5 +thread #6 +thread #7 +thread #8 +thread #9 diff --git a/tests32/ref11.txt b/tests32/ref11.txt new file mode 100644 index 0000000..3b4654e --- /dev/null +++ b/tests32/ref11.txt @@ -0,0 +1,8 @@ +Create/start 2 threads +Thread 1: Entered (10/20) +Thread 1: foo(), TLS data=0 2 "-1-" +Thread 2: Entered (10/20) +Thread 2: foo(), TLS data=1 4 "-2-" +Thread 2: bar(), TLS data=1 4 "-2-" +Thread 1: bar(), TLS data=0 2 "-1-" +Main completed diff --git a/tests32/ref12.txt b/tests32/ref12.txt new file mode 100644 index 0000000..3e7d105 --- /dev/null +++ b/tests32/ref12.txt @@ -0,0 +1,4 @@ +1000000000000 => 1000000000000.000000 +-1000000000000 => -1000000000000.000000 +(angle_t)268435456.000000 = 268435456 == 0x10000000 +go PI trucated=3, -PI rounded=-3 diff --git a/tests32/ref13.txt b/tests32/ref13.txt new file mode 100644 index 0000000..33118c0 --- /dev/null +++ b/tests32/ref13.txt @@ -0,0 +1,8 @@ +main: swapcontext(&uctx_main, &uctx_func2) +func2: started (1, 2) +func2: swapcontext(&uctx_func2, &uctx_func1) +func1: started +func1: swapcontext(&uctx_func1, &uctx_func2) +func2: returning +func1: returning +main: exiting diff --git a/tests32/ref14.txt b/tests32/ref14.txt new file mode 100644 index 0000000..82ec7b6 --- /dev/null +++ b/tests32/ref14.txt @@ -0,0 +1,5 @@ +Thread: thread_state = 1. +Main thread: thread_state == 1. +Thread: thread_state = 2. +Main thread: thread_state == 2. +Finished with no errors. diff --git a/tests32/ref15.txt b/tests32/ref15.txt new file mode 100644 index 0000000..52326af --- /dev/null +++ b/tests32/ref15.txt @@ -0,0 +1 @@ +2, 2/2 diff --git a/tests32/ref16.txt b/tests32/ref16.txt new file mode 100644 index 0000000..52326af --- /dev/null +++ b/tests32/ref16.txt @@ -0,0 +1 @@ +2, 2/2 diff --git a/tests32/ref17.txt b/tests32/ref17.txt new file mode 100644 index 0000000..a86190e --- /dev/null +++ b/tests32/ref17.txt @@ -0,0 +1,1510 @@ +ucomiss 1.000000, 1.000000 => 0x242 +ucomiss 1.000000, 2.000000 => 0x203 +ucomiss 1.000000, 0.000000 => 0x202 +ucomiss 1.000000, -0.000000 => 0x202 +ucomiss 1.000000, -1.000000 => 0x202 +ucomiss 1.000000, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss 1.000000, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss 1.000000, inf => 0x203 +ucomiss 1.000000, -inf => 0x202 +ucomiss 1.000000, nan => 0x247 +ucomiss 2.000000, 1.000000 => 0x202 +ucomiss 2.000000, 2.000000 => 0x242 +ucomiss 2.000000, 0.000000 => 0x202 +ucomiss 2.000000, -0.000000 => 0x202 +ucomiss 2.000000, -1.000000 => 0x202 +ucomiss 2.000000, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss 2.000000, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss 2.000000, inf => 0x203 +ucomiss 2.000000, -inf => 0x202 +ucomiss 2.000000, nan => 0x247 +ucomiss 0.000000, 1.000000 => 0x203 +ucomiss 0.000000, 2.000000 => 0x203 +ucomiss 0.000000, 0.000000 => 0x242 +ucomiss 0.000000, -0.000000 => 0x242 +ucomiss 0.000000, -1.000000 => 0x202 +ucomiss 0.000000, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss 0.000000, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss 0.000000, inf => 0x203 +ucomiss 0.000000, -inf => 0x202 +ucomiss 0.000000, nan => 0x247 +ucomiss -0.000000, 1.000000 => 0x203 +ucomiss -0.000000, 2.000000 => 0x203 +ucomiss -0.000000, 0.000000 => 0x242 +ucomiss -0.000000, -0.000000 => 0x242 +ucomiss -0.000000, -1.000000 => 0x202 +ucomiss -0.000000, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss -0.000000, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss -0.000000, inf => 0x203 +ucomiss -0.000000, -inf => 0x202 +ucomiss -0.000000, nan => 0x247 +ucomiss -1.000000, 1.000000 => 0x203 +ucomiss -1.000000, 2.000000 => 0x203 +ucomiss -1.000000, 0.000000 => 0x203 +ucomiss -1.000000, -0.000000 => 0x203 +ucomiss -1.000000, -1.000000 => 0x242 +ucomiss -1.000000, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss -1.000000, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss -1.000000, inf => 0x203 +ucomiss -1.000000, -inf => 0x202 +ucomiss -1.000000, nan => 0x247 +ucomiss 340282346638528859811704183484516925440.000000, 1.000000 => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, 2.000000 => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, 0.000000 => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, -0.000000 => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, -1.000000 => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x242 +ucomiss 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, inf => 0x203 +ucomiss 340282346638528859811704183484516925440.000000, -inf => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, nan => 0x247 +ucomiss -340282346638528859811704183484516925440.000000, 1.000000 => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, 2.000000 => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, 0.000000 => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, -0.000000 => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, -1.000000 => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x242 +ucomiss -340282346638528859811704183484516925440.000000, inf => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, -inf => 0x202 +ucomiss -340282346638528859811704183484516925440.000000, nan => 0x247 +ucomiss inf, 1.000000 => 0x202 +ucomiss inf, 2.000000 => 0x202 +ucomiss inf, 0.000000 => 0x202 +ucomiss inf, -0.000000 => 0x202 +ucomiss inf, -1.000000 => 0x202 +ucomiss inf, 340282346638528859811704183484516925440.000000 => 0x202 +ucomiss inf, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss inf, inf => 0x242 +ucomiss inf, -inf => 0x202 +ucomiss inf, nan => 0x247 +ucomiss -inf, 1.000000 => 0x203 +ucomiss -inf, 2.000000 => 0x203 +ucomiss -inf, 0.000000 => 0x203 +ucomiss -inf, -0.000000 => 0x203 +ucomiss -inf, -1.000000 => 0x203 +ucomiss -inf, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss -inf, -340282346638528859811704183484516925440.000000 => 0x203 +ucomiss -inf, inf => 0x203 +ucomiss -inf, -inf => 0x242 +ucomiss -inf, nan => 0x247 +ucomiss nan, 1.000000 => 0x247 +ucomiss nan, 2.000000 => 0x247 +ucomiss nan, 0.000000 => 0x247 +ucomiss nan, -0.000000 => 0x247 +ucomiss nan, -1.000000 => 0x247 +ucomiss nan, 340282346638528859811704183484516925440.000000 => 0x247 +ucomiss nan, -340282346638528859811704183484516925440.000000 => 0x247 +ucomiss nan, inf => 0x247 +ucomiss nan, -inf => 0x247 +ucomiss nan, nan => 0x247 +minss 1, 1 => 1 +minss 1, 2 => 1 +minss 1, 0 => 0 +minss 1, -0 => -0 +minss 1, -1 => -1 +minss 1, 3.40282e+38 => 1 +minss 1, -3.40282e+38 => -3.40282e+38 +minss 1, inf => 1 +minss 1, -inf => -inf +minss 1, nan => nan +minss 2, 1 => 1 +minss 2, 2 => 2 +minss 2, 0 => 0 +minss 2, -0 => -0 +minss 2, -1 => -1 +minss 2, 3.40282e+38 => 2 +minss 2, -3.40282e+38 => -3.40282e+38 +minss 2, inf => 2 +minss 2, -inf => -inf +minss 2, nan => nan +minss 0, 1 => 0 +minss 0, 2 => 0 +minss 0, 0 => 0 +minss 0, -0 => -0 +minss 0, -1 => -1 +minss 0, 3.40282e+38 => 0 +minss 0, -3.40282e+38 => -3.40282e+38 +minss 0, inf => 0 +minss 0, -inf => -inf +minss 0, nan => nan +minss -0, 1 => -0 +minss -0, 2 => -0 +minss -0, 0 => 0 +minss -0, -0 => -0 +minss -0, -1 => -1 +minss -0, 3.40282e+38 => -0 +minss -0, -3.40282e+38 => -3.40282e+38 +minss -0, inf => -0 +minss -0, -inf => -inf +minss -0, nan => nan +minss -1, 1 => -1 +minss -1, 2 => -1 +minss -1, 0 => -1 +minss -1, -0 => -1 +minss -1, -1 => -1 +minss -1, 3.40282e+38 => -1 +minss -1, -3.40282e+38 => -3.40282e+38 +minss -1, inf => -1 +minss -1, -inf => -inf +minss -1, nan => nan +minss 3.40282e+38, 1 => 1 +minss 3.40282e+38, 2 => 2 +minss 3.40282e+38, 0 => 0 +minss 3.40282e+38, -0 => -0 +minss 3.40282e+38, -1 => -1 +minss 3.40282e+38, 3.40282e+38 => 3.40282e+38 +minss 3.40282e+38, -3.40282e+38 => -3.40282e+38 +minss 3.40282e+38, inf => 3.40282e+38 +minss 3.40282e+38, -inf => -inf +minss 3.40282e+38, nan => nan +minss -3.40282e+38, 1 => -3.40282e+38 +minss -3.40282e+38, 2 => -3.40282e+38 +minss -3.40282e+38, 0 => -3.40282e+38 +minss -3.40282e+38, -0 => -3.40282e+38 +minss -3.40282e+38, -1 => -3.40282e+38 +minss -3.40282e+38, 3.40282e+38 => -3.40282e+38 +minss -3.40282e+38, -3.40282e+38 => -3.40282e+38 +minss -3.40282e+38, inf => -3.40282e+38 +minss -3.40282e+38, -inf => -inf +minss -3.40282e+38, nan => nan +minss inf, 1 => 1 +minss inf, 2 => 2 +minss inf, 0 => 0 +minss inf, -0 => -0 +minss inf, -1 => -1 +minss inf, 3.40282e+38 => 3.40282e+38 +minss inf, -3.40282e+38 => -3.40282e+38 +minss inf, inf => inf +minss inf, -inf => -inf +minss inf, nan => nan +minss -inf, 1 => -inf +minss -inf, 2 => -inf +minss -inf, 0 => -inf +minss -inf, -0 => -inf +minss -inf, -1 => -inf +minss -inf, 3.40282e+38 => -inf +minss -inf, -3.40282e+38 => -inf +minss -inf, inf => -inf +minss -inf, -inf => -inf +minss -inf, nan => nan +minss nan, 1 => 1 +minss nan, 2 => 2 +minss nan, 0 => 0 +minss nan, -0 => -0 +minss nan, -1 => -1 +minss nan, 3.40282e+38 => 3.40282e+38 +minss nan, -3.40282e+38 => -3.40282e+38 +minss nan, inf => inf +minss nan, -inf => -inf +minss nan, nan => nan +maxss 1, 1 => 1 +maxss 1, 2 => 2 +maxss 1, 0 => 1 +maxss 1, -0 => 1 +maxss 1, -1 => 1 +maxss 1, 3.40282e+38 => 3.40282e+38 +maxss 1, -3.40282e+38 => 1 +maxss 1, inf => inf +maxss 1, -inf => 1 +maxss 1, nan => nan +maxss 2, 1 => 2 +maxss 2, 2 => 2 +maxss 2, 0 => 2 +maxss 2, -0 => 2 +maxss 2, -1 => 2 +maxss 2, 3.40282e+38 => 3.40282e+38 +maxss 2, -3.40282e+38 => 2 +maxss 2, inf => inf +maxss 2, -inf => 2 +maxss 2, nan => nan +maxss 0, 1 => 1 +maxss 0, 2 => 2 +maxss 0, 0 => 0 +maxss 0, -0 => -0 +maxss 0, -1 => 0 +maxss 0, 3.40282e+38 => 3.40282e+38 +maxss 0, -3.40282e+38 => 0 +maxss 0, inf => inf +maxss 0, -inf => 0 +maxss 0, nan => nan +maxss -0, 1 => 1 +maxss -0, 2 => 2 +maxss -0, 0 => 0 +maxss -0, -0 => -0 +maxss -0, -1 => -0 +maxss -0, 3.40282e+38 => 3.40282e+38 +maxss -0, -3.40282e+38 => -0 +maxss -0, inf => inf +maxss -0, -inf => -0 +maxss -0, nan => nan +maxss -1, 1 => 1 +maxss -1, 2 => 2 +maxss -1, 0 => 0 +maxss -1, -0 => -0 +maxss -1, -1 => -1 +maxss -1, 3.40282e+38 => 3.40282e+38 +maxss -1, -3.40282e+38 => -1 +maxss -1, inf => inf +maxss -1, -inf => -1 +maxss -1, nan => nan +maxss 3.40282e+38, 1 => 3.40282e+38 +maxss 3.40282e+38, 2 => 3.40282e+38 +maxss 3.40282e+38, 0 => 3.40282e+38 +maxss 3.40282e+38, -0 => 3.40282e+38 +maxss 3.40282e+38, -1 => 3.40282e+38 +maxss 3.40282e+38, 3.40282e+38 => 3.40282e+38 +maxss 3.40282e+38, -3.40282e+38 => 3.40282e+38 +maxss 3.40282e+38, inf => inf +maxss 3.40282e+38, -inf => 3.40282e+38 +maxss 3.40282e+38, nan => nan +maxss -3.40282e+38, 1 => 1 +maxss -3.40282e+38, 2 => 2 +maxss -3.40282e+38, 0 => 0 +maxss -3.40282e+38, -0 => -0 +maxss -3.40282e+38, -1 => -1 +maxss -3.40282e+38, 3.40282e+38 => 3.40282e+38 +maxss -3.40282e+38, -3.40282e+38 => -3.40282e+38 +maxss -3.40282e+38, inf => inf +maxss -3.40282e+38, -inf => -3.40282e+38 +maxss -3.40282e+38, nan => nan +maxss inf, 1 => inf +maxss inf, 2 => inf +maxss inf, 0 => inf +maxss inf, -0 => inf +maxss inf, -1 => inf +maxss inf, 3.40282e+38 => inf +maxss inf, -3.40282e+38 => inf +maxss inf, inf => inf +maxss inf, -inf => inf +maxss inf, nan => nan +maxss -inf, 1 => 1 +maxss -inf, 2 => 2 +maxss -inf, 0 => 0 +maxss -inf, -0 => -0 +maxss -inf, -1 => -1 +maxss -inf, 3.40282e+38 => 3.40282e+38 +maxss -inf, -3.40282e+38 => -3.40282e+38 +maxss -inf, inf => inf +maxss -inf, -inf => -inf +maxss -inf, nan => nan +maxss nan, 1 => 1 +maxss nan, 2 => 2 +maxss nan, 0 => 0 +maxss nan, -0 => -0 +maxss nan, -1 => -1 +maxss nan, 3.40282e+38 => 3.40282e+38 +maxss nan, -3.40282e+38 => -3.40282e+38 +maxss nan, inf => inf +maxss nan, -inf => -inf +maxss nan, nan => nan +cmpss 0 1.000000, 1.000000 => 0xffffffff +cmpss 0 1.000000, 2.000000 => 0x0 +cmpss 0 1.000000, 0.000000 => 0x0 +cmpss 0 1.000000, -0.000000 => 0x0 +cmpss 0 1.000000, -1.000000 => 0x0 +cmpss 0 1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 1.000000, inf => 0x0 +cmpss 0 1.000000, -inf => 0x0 +cmpss 0 1.000000, nan => 0x0 +cmpss 0 2.000000, 1.000000 => 0x0 +cmpss 0 2.000000, 2.000000 => 0xffffffff +cmpss 0 2.000000, 0.000000 => 0x0 +cmpss 0 2.000000, -0.000000 => 0x0 +cmpss 0 2.000000, -1.000000 => 0x0 +cmpss 0 2.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 2.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 2.000000, inf => 0x0 +cmpss 0 2.000000, -inf => 0x0 +cmpss 0 2.000000, nan => 0x0 +cmpss 0 0.000000, 1.000000 => 0x0 +cmpss 0 0.000000, 2.000000 => 0x0 +cmpss 0 0.000000, 0.000000 => 0xffffffff +cmpss 0 0.000000, -0.000000 => 0xffffffff +cmpss 0 0.000000, -1.000000 => 0x0 +cmpss 0 0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 0.000000, inf => 0x0 +cmpss 0 0.000000, -inf => 0x0 +cmpss 0 0.000000, nan => 0x0 +cmpss 0 -0.000000, 1.000000 => 0x0 +cmpss 0 -0.000000, 2.000000 => 0x0 +cmpss 0 -0.000000, 0.000000 => 0xffffffff +cmpss 0 -0.000000, -0.000000 => 0xffffffff +cmpss 0 -0.000000, -1.000000 => 0x0 +cmpss 0 -0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -0.000000, inf => 0x0 +cmpss 0 -0.000000, -inf => 0x0 +cmpss 0 -0.000000, nan => 0x0 +cmpss 0 -1.000000, 1.000000 => 0x0 +cmpss 0 -1.000000, 2.000000 => 0x0 +cmpss 0 -1.000000, 0.000000 => 0x0 +cmpss 0 -1.000000, -0.000000 => 0x0 +cmpss 0 -1.000000, -1.000000 => 0xffffffff +cmpss 0 -1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -1.000000, inf => 0x0 +cmpss 0 -1.000000, -inf => 0x0 +cmpss 0 -1.000000, nan => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 0 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 0 -340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 0 inf, 1.000000 => 0x0 +cmpss 0 inf, 2.000000 => 0x0 +cmpss 0 inf, 0.000000 => 0x0 +cmpss 0 inf, -0.000000 => 0x0 +cmpss 0 inf, -1.000000 => 0x0 +cmpss 0 inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 inf, inf => 0xffffffff +cmpss 0 inf, -inf => 0x0 +cmpss 0 inf, nan => 0x0 +cmpss 0 -inf, 1.000000 => 0x0 +cmpss 0 -inf, 2.000000 => 0x0 +cmpss 0 -inf, 0.000000 => 0x0 +cmpss 0 -inf, -0.000000 => 0x0 +cmpss 0 -inf, -1.000000 => 0x0 +cmpss 0 -inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -inf, inf => 0x0 +cmpss 0 -inf, -inf => 0xffffffff +cmpss 0 -inf, nan => 0x0 +cmpss 0 nan, 1.000000 => 0x0 +cmpss 0 nan, 2.000000 => 0x0 +cmpss 0 nan, 0.000000 => 0x0 +cmpss 0 nan, -0.000000 => 0x0 +cmpss 0 nan, -1.000000 => 0x0 +cmpss 0 nan, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 nan, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 nan, inf => 0x0 +cmpss 0 nan, -inf => 0x0 +cmpss 0 nan, nan => 0x0 +cmpss 1 1.000000, 1.000000 => 0x0 +cmpss 1 1.000000, 2.000000 => 0xffffffff +cmpss 1 1.000000, 0.000000 => 0x0 +cmpss 1 1.000000, -0.000000 => 0x0 +cmpss 1 1.000000, -1.000000 => 0x0 +cmpss 1 1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 1.000000, inf => 0xffffffff +cmpss 1 1.000000, -inf => 0x0 +cmpss 1 1.000000, nan => 0x0 +cmpss 1 2.000000, 1.000000 => 0x0 +cmpss 1 2.000000, 2.000000 => 0x0 +cmpss 1 2.000000, 0.000000 => 0x0 +cmpss 1 2.000000, -0.000000 => 0x0 +cmpss 1 2.000000, -1.000000 => 0x0 +cmpss 1 2.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 2.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 2.000000, inf => 0xffffffff +cmpss 1 2.000000, -inf => 0x0 +cmpss 1 2.000000, nan => 0x0 +cmpss 1 0.000000, 1.000000 => 0xffffffff +cmpss 1 0.000000, 2.000000 => 0xffffffff +cmpss 1 0.000000, 0.000000 => 0x0 +cmpss 1 0.000000, -0.000000 => 0x0 +cmpss 1 0.000000, -1.000000 => 0x0 +cmpss 1 0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 0.000000, inf => 0xffffffff +cmpss 1 0.000000, -inf => 0x0 +cmpss 1 0.000000, nan => 0x0 +cmpss 1 -0.000000, 1.000000 => 0xffffffff +cmpss 1 -0.000000, 2.000000 => 0xffffffff +cmpss 1 -0.000000, 0.000000 => 0x0 +cmpss 1 -0.000000, -0.000000 => 0x0 +cmpss 1 -0.000000, -1.000000 => 0x0 +cmpss 1 -0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 -0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 -0.000000, inf => 0xffffffff +cmpss 1 -0.000000, -inf => 0x0 +cmpss 1 -0.000000, nan => 0x0 +cmpss 1 -1.000000, 1.000000 => 0xffffffff +cmpss 1 -1.000000, 2.000000 => 0xffffffff +cmpss 1 -1.000000, 0.000000 => 0xffffffff +cmpss 1 -1.000000, -0.000000 => 0xffffffff +cmpss 1 -1.000000, -1.000000 => 0x0 +cmpss 1 -1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 -1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 -1.000000, inf => 0xffffffff +cmpss 1 -1.000000, -inf => 0x0 +cmpss 1 -1.000000, nan => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 1 340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 1 -340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 -340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 1 -340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 1 inf, 1.000000 => 0x0 +cmpss 1 inf, 2.000000 => 0x0 +cmpss 1 inf, 0.000000 => 0x0 +cmpss 1 inf, -0.000000 => 0x0 +cmpss 1 inf, -1.000000 => 0x0 +cmpss 1 inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 inf, inf => 0x0 +cmpss 1 inf, -inf => 0x0 +cmpss 1 inf, nan => 0x0 +cmpss 1 -inf, 1.000000 => 0xffffffff +cmpss 1 -inf, 2.000000 => 0xffffffff +cmpss 1 -inf, 0.000000 => 0xffffffff +cmpss 1 -inf, -0.000000 => 0xffffffff +cmpss 1 -inf, -1.000000 => 0xffffffff +cmpss 1 -inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 -inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 -inf, inf => 0xffffffff +cmpss 1 -inf, -inf => 0x0 +cmpss 1 -inf, nan => 0x0 +cmpss 1 nan, 1.000000 => 0x0 +cmpss 1 nan, 2.000000 => 0x0 +cmpss 1 nan, 0.000000 => 0x0 +cmpss 1 nan, -0.000000 => 0x0 +cmpss 1 nan, -1.000000 => 0x0 +cmpss 1 nan, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 nan, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 nan, inf => 0x0 +cmpss 1 nan, -inf => 0x0 +cmpss 1 nan, nan => 0x0 +cmpss 2 1.000000, 1.000000 => 0xffffffff +cmpss 2 1.000000, 2.000000 => 0xffffffff +cmpss 2 1.000000, 0.000000 => 0x0 +cmpss 2 1.000000, -0.000000 => 0x0 +cmpss 2 1.000000, -1.000000 => 0x0 +cmpss 2 1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 1.000000, inf => 0xffffffff +cmpss 2 1.000000, -inf => 0x0 +cmpss 2 1.000000, nan => 0x0 +cmpss 2 2.000000, 1.000000 => 0x0 +cmpss 2 2.000000, 2.000000 => 0xffffffff +cmpss 2 2.000000, 0.000000 => 0x0 +cmpss 2 2.000000, -0.000000 => 0x0 +cmpss 2 2.000000, -1.000000 => 0x0 +cmpss 2 2.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 2.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 2.000000, inf => 0xffffffff +cmpss 2 2.000000, -inf => 0x0 +cmpss 2 2.000000, nan => 0x0 +cmpss 2 0.000000, 1.000000 => 0xffffffff +cmpss 2 0.000000, 2.000000 => 0xffffffff +cmpss 2 0.000000, 0.000000 => 0xffffffff +cmpss 2 0.000000, -0.000000 => 0xffffffff +cmpss 2 0.000000, -1.000000 => 0x0 +cmpss 2 0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 0.000000, inf => 0xffffffff +cmpss 2 0.000000, -inf => 0x0 +cmpss 2 0.000000, nan => 0x0 +cmpss 2 -0.000000, 1.000000 => 0xffffffff +cmpss 2 -0.000000, 2.000000 => 0xffffffff +cmpss 2 -0.000000, 0.000000 => 0xffffffff +cmpss 2 -0.000000, -0.000000 => 0xffffffff +cmpss 2 -0.000000, -1.000000 => 0x0 +cmpss 2 -0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 -0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 -0.000000, inf => 0xffffffff +cmpss 2 -0.000000, -inf => 0x0 +cmpss 2 -0.000000, nan => 0x0 +cmpss 2 -1.000000, 1.000000 => 0xffffffff +cmpss 2 -1.000000, 2.000000 => 0xffffffff +cmpss 2 -1.000000, 0.000000 => 0xffffffff +cmpss 2 -1.000000, -0.000000 => 0xffffffff +cmpss 2 -1.000000, -1.000000 => 0xffffffff +cmpss 2 -1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 -1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 -1.000000, inf => 0xffffffff +cmpss 2 -1.000000, -inf => 0x0 +cmpss 2 -1.000000, nan => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 2 340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 2 -340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 2 -340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 2 inf, 1.000000 => 0x0 +cmpss 2 inf, 2.000000 => 0x0 +cmpss 2 inf, 0.000000 => 0x0 +cmpss 2 inf, -0.000000 => 0x0 +cmpss 2 inf, -1.000000 => 0x0 +cmpss 2 inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 inf, inf => 0xffffffff +cmpss 2 inf, -inf => 0x0 +cmpss 2 inf, nan => 0x0 +cmpss 2 -inf, 1.000000 => 0xffffffff +cmpss 2 -inf, 2.000000 => 0xffffffff +cmpss 2 -inf, 0.000000 => 0xffffffff +cmpss 2 -inf, -0.000000 => 0xffffffff +cmpss 2 -inf, -1.000000 => 0xffffffff +cmpss 2 -inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 -inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 -inf, inf => 0xffffffff +cmpss 2 -inf, -inf => 0xffffffff +cmpss 2 -inf, nan => 0x0 +cmpss 2 nan, 1.000000 => 0x0 +cmpss 2 nan, 2.000000 => 0x0 +cmpss 2 nan, 0.000000 => 0x0 +cmpss 2 nan, -0.000000 => 0x0 +cmpss 2 nan, -1.000000 => 0x0 +cmpss 2 nan, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 nan, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 nan, inf => 0x0 +cmpss 2 nan, -inf => 0x0 +cmpss 2 nan, nan => 0x0 +cmpss 3 1.000000, 1.000000 => 0x0 +cmpss 3 1.000000, 2.000000 => 0x0 +cmpss 3 1.000000, 0.000000 => 0x0 +cmpss 3 1.000000, -0.000000 => 0x0 +cmpss 3 1.000000, -1.000000 => 0x0 +cmpss 3 1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 1.000000, inf => 0x0 +cmpss 3 1.000000, -inf => 0x0 +cmpss 3 1.000000, nan => 0xffffffff +cmpss 3 2.000000, 1.000000 => 0x0 +cmpss 3 2.000000, 2.000000 => 0x0 +cmpss 3 2.000000, 0.000000 => 0x0 +cmpss 3 2.000000, -0.000000 => 0x0 +cmpss 3 2.000000, -1.000000 => 0x0 +cmpss 3 2.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 2.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 2.000000, inf => 0x0 +cmpss 3 2.000000, -inf => 0x0 +cmpss 3 2.000000, nan => 0xffffffff +cmpss 3 0.000000, 1.000000 => 0x0 +cmpss 3 0.000000, 2.000000 => 0x0 +cmpss 3 0.000000, 0.000000 => 0x0 +cmpss 3 0.000000, -0.000000 => 0x0 +cmpss 3 0.000000, -1.000000 => 0x0 +cmpss 3 0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 0.000000, inf => 0x0 +cmpss 3 0.000000, -inf => 0x0 +cmpss 3 0.000000, nan => 0xffffffff +cmpss 3 -0.000000, 1.000000 => 0x0 +cmpss 3 -0.000000, 2.000000 => 0x0 +cmpss 3 -0.000000, 0.000000 => 0x0 +cmpss 3 -0.000000, -0.000000 => 0x0 +cmpss 3 -0.000000, -1.000000 => 0x0 +cmpss 3 -0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -0.000000, inf => 0x0 +cmpss 3 -0.000000, -inf => 0x0 +cmpss 3 -0.000000, nan => 0xffffffff +cmpss 3 -1.000000, 1.000000 => 0x0 +cmpss 3 -1.000000, 2.000000 => 0x0 +cmpss 3 -1.000000, 0.000000 => 0x0 +cmpss 3 -1.000000, -0.000000 => 0x0 +cmpss 3 -1.000000, -1.000000 => 0x0 +cmpss 3 -1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -1.000000, inf => 0x0 +cmpss 3 -1.000000, -inf => 0x0 +cmpss 3 -1.000000, nan => 0xffffffff +cmpss 3 340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 3 -340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 3 inf, 1.000000 => 0x0 +cmpss 3 inf, 2.000000 => 0x0 +cmpss 3 inf, 0.000000 => 0x0 +cmpss 3 inf, -0.000000 => 0x0 +cmpss 3 inf, -1.000000 => 0x0 +cmpss 3 inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 inf, inf => 0x0 +cmpss 3 inf, -inf => 0x0 +cmpss 3 inf, nan => 0xffffffff +cmpss 3 -inf, 1.000000 => 0x0 +cmpss 3 -inf, 2.000000 => 0x0 +cmpss 3 -inf, 0.000000 => 0x0 +cmpss 3 -inf, -0.000000 => 0x0 +cmpss 3 -inf, -1.000000 => 0x0 +cmpss 3 -inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -inf, inf => 0x0 +cmpss 3 -inf, -inf => 0x0 +cmpss 3 -inf, nan => 0xffffffff +cmpss 3 nan, 1.000000 => 0xffffffff +cmpss 3 nan, 2.000000 => 0xffffffff +cmpss 3 nan, 0.000000 => 0xffffffff +cmpss 3 nan, -0.000000 => 0xffffffff +cmpss 3 nan, -1.000000 => 0xffffffff +cmpss 3 nan, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 3 nan, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 3 nan, inf => 0xffffffff +cmpss 3 nan, -inf => 0xffffffff +cmpss 3 nan, nan => 0xffffffff +cmpss 4 1.000000, 1.000000 => 0x0 +cmpss 4 1.000000, 2.000000 => 0xffffffff +cmpss 4 1.000000, 0.000000 => 0xffffffff +cmpss 4 1.000000, -0.000000 => 0xffffffff +cmpss 4 1.000000, -1.000000 => 0xffffffff +cmpss 4 1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 1.000000, inf => 0xffffffff +cmpss 4 1.000000, -inf => 0xffffffff +cmpss 4 1.000000, nan => 0xffffffff +cmpss 4 2.000000, 1.000000 => 0xffffffff +cmpss 4 2.000000, 2.000000 => 0x0 +cmpss 4 2.000000, 0.000000 => 0xffffffff +cmpss 4 2.000000, -0.000000 => 0xffffffff +cmpss 4 2.000000, -1.000000 => 0xffffffff +cmpss 4 2.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 2.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 2.000000, inf => 0xffffffff +cmpss 4 2.000000, -inf => 0xffffffff +cmpss 4 2.000000, nan => 0xffffffff +cmpss 4 0.000000, 1.000000 => 0xffffffff +cmpss 4 0.000000, 2.000000 => 0xffffffff +cmpss 4 0.000000, 0.000000 => 0x0 +cmpss 4 0.000000, -0.000000 => 0x0 +cmpss 4 0.000000, -1.000000 => 0xffffffff +cmpss 4 0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 0.000000, inf => 0xffffffff +cmpss 4 0.000000, -inf => 0xffffffff +cmpss 4 0.000000, nan => 0xffffffff +cmpss 4 -0.000000, 1.000000 => 0xffffffff +cmpss 4 -0.000000, 2.000000 => 0xffffffff +cmpss 4 -0.000000, 0.000000 => 0x0 +cmpss 4 -0.000000, -0.000000 => 0x0 +cmpss 4 -0.000000, -1.000000 => 0xffffffff +cmpss 4 -0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -0.000000, inf => 0xffffffff +cmpss 4 -0.000000, -inf => 0xffffffff +cmpss 4 -0.000000, nan => 0xffffffff +cmpss 4 -1.000000, 1.000000 => 0xffffffff +cmpss 4 -1.000000, 2.000000 => 0xffffffff +cmpss 4 -1.000000, 0.000000 => 0xffffffff +cmpss 4 -1.000000, -0.000000 => 0xffffffff +cmpss 4 -1.000000, -1.000000 => 0x0 +cmpss 4 -1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -1.000000, inf => 0xffffffff +cmpss 4 -1.000000, -inf => 0xffffffff +cmpss 4 -1.000000, nan => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 4 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 4 -340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 4 inf, 1.000000 => 0xffffffff +cmpss 4 inf, 2.000000 => 0xffffffff +cmpss 4 inf, 0.000000 => 0xffffffff +cmpss 4 inf, -0.000000 => 0xffffffff +cmpss 4 inf, -1.000000 => 0xffffffff +cmpss 4 inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 inf, inf => 0x0 +cmpss 4 inf, -inf => 0xffffffff +cmpss 4 inf, nan => 0xffffffff +cmpss 4 -inf, 1.000000 => 0xffffffff +cmpss 4 -inf, 2.000000 => 0xffffffff +cmpss 4 -inf, 0.000000 => 0xffffffff +cmpss 4 -inf, -0.000000 => 0xffffffff +cmpss 4 -inf, -1.000000 => 0xffffffff +cmpss 4 -inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -inf, inf => 0xffffffff +cmpss 4 -inf, -inf => 0x0 +cmpss 4 -inf, nan => 0xffffffff +cmpss 4 nan, 1.000000 => 0xffffffff +cmpss 4 nan, 2.000000 => 0xffffffff +cmpss 4 nan, 0.000000 => 0xffffffff +cmpss 4 nan, -0.000000 => 0xffffffff +cmpss 4 nan, -1.000000 => 0xffffffff +cmpss 4 nan, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 nan, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 nan, inf => 0xffffffff +cmpss 4 nan, -inf => 0xffffffff +cmpss 4 nan, nan => 0xffffffff +cmpss 5 1.000000, 1.000000 => 0xffffffff +cmpss 5 1.000000, 2.000000 => 0x0 +cmpss 5 1.000000, 0.000000 => 0xffffffff +cmpss 5 1.000000, -0.000000 => 0xffffffff +cmpss 5 1.000000, -1.000000 => 0xffffffff +cmpss 5 1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 1.000000, inf => 0x0 +cmpss 5 1.000000, -inf => 0xffffffff +cmpss 5 1.000000, nan => 0xffffffff +cmpss 5 2.000000, 1.000000 => 0xffffffff +cmpss 5 2.000000, 2.000000 => 0xffffffff +cmpss 5 2.000000, 0.000000 => 0xffffffff +cmpss 5 2.000000, -0.000000 => 0xffffffff +cmpss 5 2.000000, -1.000000 => 0xffffffff +cmpss 5 2.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 2.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 2.000000, inf => 0x0 +cmpss 5 2.000000, -inf => 0xffffffff +cmpss 5 2.000000, nan => 0xffffffff +cmpss 5 0.000000, 1.000000 => 0x0 +cmpss 5 0.000000, 2.000000 => 0x0 +cmpss 5 0.000000, 0.000000 => 0xffffffff +cmpss 5 0.000000, -0.000000 => 0xffffffff +cmpss 5 0.000000, -1.000000 => 0xffffffff +cmpss 5 0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 0.000000, inf => 0x0 +cmpss 5 0.000000, -inf => 0xffffffff +cmpss 5 0.000000, nan => 0xffffffff +cmpss 5 -0.000000, 1.000000 => 0x0 +cmpss 5 -0.000000, 2.000000 => 0x0 +cmpss 5 -0.000000, 0.000000 => 0xffffffff +cmpss 5 -0.000000, -0.000000 => 0xffffffff +cmpss 5 -0.000000, -1.000000 => 0xffffffff +cmpss 5 -0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 -0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 -0.000000, inf => 0x0 +cmpss 5 -0.000000, -inf => 0xffffffff +cmpss 5 -0.000000, nan => 0xffffffff +cmpss 5 -1.000000, 1.000000 => 0x0 +cmpss 5 -1.000000, 2.000000 => 0x0 +cmpss 5 -1.000000, 0.000000 => 0x0 +cmpss 5 -1.000000, -0.000000 => 0x0 +cmpss 5 -1.000000, -1.000000 => 0xffffffff +cmpss 5 -1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 -1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 -1.000000, inf => 0x0 +cmpss 5 -1.000000, -inf => 0xffffffff +cmpss 5 -1.000000, nan => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 5 340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 5 -340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 -340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 5 -340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 5 inf, 1.000000 => 0xffffffff +cmpss 5 inf, 2.000000 => 0xffffffff +cmpss 5 inf, 0.000000 => 0xffffffff +cmpss 5 inf, -0.000000 => 0xffffffff +cmpss 5 inf, -1.000000 => 0xffffffff +cmpss 5 inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 inf, inf => 0xffffffff +cmpss 5 inf, -inf => 0xffffffff +cmpss 5 inf, nan => 0xffffffff +cmpss 5 -inf, 1.000000 => 0x0 +cmpss 5 -inf, 2.000000 => 0x0 +cmpss 5 -inf, 0.000000 => 0x0 +cmpss 5 -inf, -0.000000 => 0x0 +cmpss 5 -inf, -1.000000 => 0x0 +cmpss 5 -inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 -inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 -inf, inf => 0x0 +cmpss 5 -inf, -inf => 0xffffffff +cmpss 5 -inf, nan => 0xffffffff +cmpss 5 nan, 1.000000 => 0xffffffff +cmpss 5 nan, 2.000000 => 0xffffffff +cmpss 5 nan, 0.000000 => 0xffffffff +cmpss 5 nan, -0.000000 => 0xffffffff +cmpss 5 nan, -1.000000 => 0xffffffff +cmpss 5 nan, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 nan, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 nan, inf => 0xffffffff +cmpss 5 nan, -inf => 0xffffffff +cmpss 5 nan, nan => 0xffffffff +cmpss 6 1.000000, 1.000000 => 0x0 +cmpss 6 1.000000, 2.000000 => 0x0 +cmpss 6 1.000000, 0.000000 => 0xffffffff +cmpss 6 1.000000, -0.000000 => 0xffffffff +cmpss 6 1.000000, -1.000000 => 0xffffffff +cmpss 6 1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 1.000000, inf => 0x0 +cmpss 6 1.000000, -inf => 0xffffffff +cmpss 6 1.000000, nan => 0xffffffff +cmpss 6 2.000000, 1.000000 => 0xffffffff +cmpss 6 2.000000, 2.000000 => 0x0 +cmpss 6 2.000000, 0.000000 => 0xffffffff +cmpss 6 2.000000, -0.000000 => 0xffffffff +cmpss 6 2.000000, -1.000000 => 0xffffffff +cmpss 6 2.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 2.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 2.000000, inf => 0x0 +cmpss 6 2.000000, -inf => 0xffffffff +cmpss 6 2.000000, nan => 0xffffffff +cmpss 6 0.000000, 1.000000 => 0x0 +cmpss 6 0.000000, 2.000000 => 0x0 +cmpss 6 0.000000, 0.000000 => 0x0 +cmpss 6 0.000000, -0.000000 => 0x0 +cmpss 6 0.000000, -1.000000 => 0xffffffff +cmpss 6 0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 0.000000, inf => 0x0 +cmpss 6 0.000000, -inf => 0xffffffff +cmpss 6 0.000000, nan => 0xffffffff +cmpss 6 -0.000000, 1.000000 => 0x0 +cmpss 6 -0.000000, 2.000000 => 0x0 +cmpss 6 -0.000000, 0.000000 => 0x0 +cmpss 6 -0.000000, -0.000000 => 0x0 +cmpss 6 -0.000000, -1.000000 => 0xffffffff +cmpss 6 -0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 -0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 -0.000000, inf => 0x0 +cmpss 6 -0.000000, -inf => 0xffffffff +cmpss 6 -0.000000, nan => 0xffffffff +cmpss 6 -1.000000, 1.000000 => 0x0 +cmpss 6 -1.000000, 2.000000 => 0x0 +cmpss 6 -1.000000, 0.000000 => 0x0 +cmpss 6 -1.000000, -0.000000 => 0x0 +cmpss 6 -1.000000, -1.000000 => 0x0 +cmpss 6 -1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 -1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 -1.000000, inf => 0x0 +cmpss 6 -1.000000, -inf => 0xffffffff +cmpss 6 -1.000000, nan => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 6 340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 6 -340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 6 -340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 6 inf, 1.000000 => 0xffffffff +cmpss 6 inf, 2.000000 => 0xffffffff +cmpss 6 inf, 0.000000 => 0xffffffff +cmpss 6 inf, -0.000000 => 0xffffffff +cmpss 6 inf, -1.000000 => 0xffffffff +cmpss 6 inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 inf, inf => 0x0 +cmpss 6 inf, -inf => 0xffffffff +cmpss 6 inf, nan => 0xffffffff +cmpss 6 -inf, 1.000000 => 0x0 +cmpss 6 -inf, 2.000000 => 0x0 +cmpss 6 -inf, 0.000000 => 0x0 +cmpss 6 -inf, -0.000000 => 0x0 +cmpss 6 -inf, -1.000000 => 0x0 +cmpss 6 -inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 -inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 -inf, inf => 0x0 +cmpss 6 -inf, -inf => 0x0 +cmpss 6 -inf, nan => 0xffffffff +cmpss 6 nan, 1.000000 => 0xffffffff +cmpss 6 nan, 2.000000 => 0xffffffff +cmpss 6 nan, 0.000000 => 0xffffffff +cmpss 6 nan, -0.000000 => 0xffffffff +cmpss 6 nan, -1.000000 => 0xffffffff +cmpss 6 nan, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 nan, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 nan, inf => 0xffffffff +cmpss 6 nan, -inf => 0xffffffff +cmpss 6 nan, nan => 0xffffffff +cmpss 7 1.000000, 1.000000 => 0xffffffff +cmpss 7 1.000000, 2.000000 => 0xffffffff +cmpss 7 1.000000, 0.000000 => 0xffffffff +cmpss 7 1.000000, -0.000000 => 0xffffffff +cmpss 7 1.000000, -1.000000 => 0xffffffff +cmpss 7 1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 1.000000, inf => 0xffffffff +cmpss 7 1.000000, -inf => 0xffffffff +cmpss 7 1.000000, nan => 0x0 +cmpss 7 2.000000, 1.000000 => 0xffffffff +cmpss 7 2.000000, 2.000000 => 0xffffffff +cmpss 7 2.000000, 0.000000 => 0xffffffff +cmpss 7 2.000000, -0.000000 => 0xffffffff +cmpss 7 2.000000, -1.000000 => 0xffffffff +cmpss 7 2.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 2.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 2.000000, inf => 0xffffffff +cmpss 7 2.000000, -inf => 0xffffffff +cmpss 7 2.000000, nan => 0x0 +cmpss 7 0.000000, 1.000000 => 0xffffffff +cmpss 7 0.000000, 2.000000 => 0xffffffff +cmpss 7 0.000000, 0.000000 => 0xffffffff +cmpss 7 0.000000, -0.000000 => 0xffffffff +cmpss 7 0.000000, -1.000000 => 0xffffffff +cmpss 7 0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 0.000000, inf => 0xffffffff +cmpss 7 0.000000, -inf => 0xffffffff +cmpss 7 0.000000, nan => 0x0 +cmpss 7 -0.000000, 1.000000 => 0xffffffff +cmpss 7 -0.000000, 2.000000 => 0xffffffff +cmpss 7 -0.000000, 0.000000 => 0xffffffff +cmpss 7 -0.000000, -0.000000 => 0xffffffff +cmpss 7 -0.000000, -1.000000 => 0xffffffff +cmpss 7 -0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -0.000000, inf => 0xffffffff +cmpss 7 -0.000000, -inf => 0xffffffff +cmpss 7 -0.000000, nan => 0x0 +cmpss 7 -1.000000, 1.000000 => 0xffffffff +cmpss 7 -1.000000, 2.000000 => 0xffffffff +cmpss 7 -1.000000, 0.000000 => 0xffffffff +cmpss 7 -1.000000, -0.000000 => 0xffffffff +cmpss 7 -1.000000, -1.000000 => 0xffffffff +cmpss 7 -1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -1.000000, inf => 0xffffffff +cmpss 7 -1.000000, -inf => 0xffffffff +cmpss 7 -1.000000, nan => 0x0 +cmpss 7 340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 7 -340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 7 inf, 1.000000 => 0xffffffff +cmpss 7 inf, 2.000000 => 0xffffffff +cmpss 7 inf, 0.000000 => 0xffffffff +cmpss 7 inf, -0.000000 => 0xffffffff +cmpss 7 inf, -1.000000 => 0xffffffff +cmpss 7 inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 inf, inf => 0xffffffff +cmpss 7 inf, -inf => 0xffffffff +cmpss 7 inf, nan => 0x0 +cmpss 7 -inf, 1.000000 => 0xffffffff +cmpss 7 -inf, 2.000000 => 0xffffffff +cmpss 7 -inf, 0.000000 => 0xffffffff +cmpss 7 -inf, -0.000000 => 0xffffffff +cmpss 7 -inf, -1.000000 => 0xffffffff +cmpss 7 -inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -inf, inf => 0xffffffff +cmpss 7 -inf, -inf => 0xffffffff +cmpss 7 -inf, nan => 0x0 +cmpss 7 nan, 1.000000 => 0x0 +cmpss 7 nan, 2.000000 => 0x0 +cmpss 7 nan, 0.000000 => 0x0 +cmpss 7 nan, -0.000000 => 0x0 +cmpss 7 nan, -1.000000 => 0x0 +cmpss 7 nan, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 7 nan, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 7 nan, inf => 0x0 +cmpss 7 nan, -inf => 0x0 +cmpss 7 nan, nan => 0x0 +pshufb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x80 0x2 0x2 0xff 0x0 0x0 0xff 0xfe 0x81 0x0 0x3 0x72 0x32 0xff 0x80 +phaddw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x7fff 0x3 0x8004 0xffff 0xfffe 0x9050 0x7fff +phaddd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x7fffffff 0x7fffffff 0x80000001 0x3 +phaddsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x7fff 0x3 0x8004 0xffff 0xfffe 0x9050 0x8000 +pmaddubsw(0x80ff 0x7f 0x201 0x8103 0x84fe 0x5272 0xa5 0x32c0 , 0x100 0x1505 0x8020 0xff 0x708 0x681 0xf0a 0x110 ) = 0x80 0x27b 0xff20 0xfffd 0xb8c 0xc95e 0x672 0xc32 +phsubw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x7fff 0xffff 0x8002 0x1 0x0 0x7050 0x7ffd +psignb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x80 0x7f 0x0 0x1 0xfe 0xfd 0x0 0xfe 0x84 0x8e 0x52 0xa5 0x0 0xc0 0x32 +psignw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x1 0x8000 0x8001 0x0 0x1 0xfffe 0xfffd 0x7fff +psignd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x80000000 0x7fffffff 0x0 +pmulhrsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x1 0x8001 0xffff 0x0 0x0 0xfffe 0x0 0x7ffe +pblendvps(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0xffffffff 0x80000000 0x5 0x0 +ptestz(0x80000000ffffffff 0x7fffffff , 0x8000000000000001 0xfffffffe00000005 ) = 0 +ptestc(0x80000000ffffffff 0x7fffffff , 0x8000000000000001 0xfffffffe00000005 ) = 0 +ptestnzc(0x80000000ffffffff 0x7fffffff , 0x8000000000000001 0xfffffffe00000005 ) = 1 +pabsb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x1 0x80 0x7f 0x0 0x1 0x2 0x3 0x7f 0x2 0x7c 0x72 0x52 0x5b 0x0 0x40 0x32 +pabsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x1 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x7fff +pabsd(0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x1 0x80000000 0x7fffffff 0x0 +pmovsxbw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0xffff 0x0 0xff80 0xffff 0x7f 0x0 0x0 +pmovsxbd(0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0xffffffff 0xffffffff 0xffffffff +pmovsxbq(0xffffffffffffffff 0x8000000000000000 ) = 0xffffffffffffffff 0xffffffffffffffff +pmovsxwd(0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0xffffffff 0x0 0xffff8000 +pmovsxwq(0xffffffffffffffff 0x8000000000000000 ) = 0xffffffffffffffff 0xffffffffffffffff +pmovsxdq(0xffffffffffffffff 0x8000000000000000 ) = 0xffffffffffffffff 0xffffffffffffffff +pmovzxbw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xff 0xff 0x0 0x80 0xff 0x7f 0x0 0x0 +pmovzxbd(0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xff 0xff 0xff 0xff +pmovzxbq(0xffffffffffffffff 0x8000000000000000 ) = 0xff 0xff +pmovzxwd(0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffff 0xffff 0x0 0x8000 +pmovzxwq(0xffffffffffffffff 0x8000000000000000 ) = 0xffff 0xffff +pmovzxdq(0xffffffffffffffff 0x8000000000000000 ) = 0xffffffff 0xffffffff +pminsd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x80000000 0x5 0xfffffffe +pmaxsd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x1 0x80000000 0x7fffffff 0x0 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 255) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 170) = 0xffff 0x7fff 0x7fff 0xffff 0x1 0x9000 0x3 0x8001 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 2) = 0xffff 0x7fff 0x7fff 0x0 0x1 0x2 0x3 0x8001 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0) = 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 2) = 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0xff 0x80 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 7) = 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 15) = 0x1 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 16) = 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +movmskpd(0xffffffffffffffff 0x8000000000000000 ) = 0x3 +psqrtpd(1 2 ) = 1 1.41421 +psqrtpd(0 -2 ) = 0 0xfff8000000000000 +psqrtpd(inf -inf ) = inf 0xfff8000000000000 +psqrtpd(0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +andpd(1 2 , 0 -2 ) = 0 2 +andpd(0 -2 , inf -inf ) = 0 -2 +andpd(1 2 , 0x7ff8000000000000 -0 ) = 1 0 +andpd(0 -2 , 0x7ff8000000000000 -0 ) = 0 -0 +andpd(inf -inf , 0x7ff8000000000000 -0 ) = inf -0 +andpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +andnpd(1 2 , 0 -2 ) = 0 -0 +andnpd(0 -2 , inf -inf ) = inf 1 +andnpd(1 2 , 0x7ff8000000000000 -0 ) = 3 -0 +andnpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0 +andnpd(inf -inf , 0x7ff8000000000000 -0 ) = 1.11254e-308 0 +andnpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0 0 +orpd(1 2 , 0 -2 ) = 1 -2 +orpd(0 -2 , inf -inf ) = inf -inf +orpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +orpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +orpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +orpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +xorpd(1 2 , 0 -2 ) = 1 -0 +xorpd(0 -2 , inf -inf ) = inf 1 +xorpd(1 2 , 0x7ff8000000000000 -0 ) = 3 -2 +xorpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +xorpd(inf -inf , 0x7ff8000000000000 -0 ) = 1.11254e-308 inf +xorpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0 0 +addpd(1 2 , 0 -2 ) = 1 0 +addpd(0 -2 , inf -inf ) = inf -inf +addpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +addpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +addpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +addpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +mulpd(1 2 , 0 -2 ) = 0 -4 +mulpd(0 -2 , inf -inf ) = 0xfff8000000000000 inf +mulpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +mulpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0 +mulpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0xfff8000000000000 +mulpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0 +subpd(1 2 , 0 -2 ) = 1 4 +subpd(0 -2 , inf -inf ) = -inf inf +subpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +subpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +subpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +subpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0 +minpd(1 2 , 0 -2 ) = 0 -2 +minpd(0 -2 , inf -inf ) = 0 -inf +minpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +minpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +minpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +minpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +divpd(1 2 , 0 -2 ) = inf -1 +divpd(0 -2 , inf -inf ) = 0 0 +divpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +divpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 inf +divpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 inf +divpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0xfff8000000000000 +maxpd(1 2 , 0 -2 ) = 1 2 +maxpd(0 -2 , inf -inf ) = inf -2 +maxpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +maxpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +maxpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +maxpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +punpcklbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x0 0x80 0x1 0x7f 0x5 0x0 0x15 0x1 0x20 0x2 0x80 0x3 0xff 0x81 0x0 +punpcklwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0x8000 0x8000 0x7fff 0x7fff 0xffff 0x0 0xffff +punpckldq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x1 0x80000000 0x80000000 +ppacksswb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x80ff 0x7f 0x201 0x8003 0x7f80 0xffff 0x8050 0x80fe +pcmpgtb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0xff 0x0 0x0 0xff 0xff 0x0 0x0 0x0 0xff 0xff 0x0 0x0 0x0 0xff +pcmpgtw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0x0 0xffff 0xffff 0x0 0xffff 0xffff 0x0 +pcmpgtd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0xffffffff 0xffffffff +packuswb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0xff 0x201 0x3 0xff00 0x0 0x50 0x0 +punpckhbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xfe 0x8 0x84 0x7 0x72 0x81 0x52 0x6 0xa5 0xa 0x0 0xf 0xc0 0x10 0x32 0x1 +punpckhwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x1 0x50 0x2 0x9000 0x3 0xfffe 0x8001 0x8001 +punpckhdq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x7fffffff 0x5 0x0 0xfffffffe +ppackssdw(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x8000ffff 0x7fff 0x80000001 0xfffe0005 +punpcklqdq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0xffffffffffffffff 0x1 +punpckhqdq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x8000000000000000 0x8000000000000000 +pshufd(0xffffffff 0x80000000 0x7fffffff 0x0 0) = 0xffffffff 0xffffffff 0xffffffff 0xffffffff +pshufd(0xffffffff 0x80000000 0x7fffffff 0x0 255) = 0x0 0x0 0x0 0x0 +pshufd(0xffffffff 0x80000000 0x7fffffff 0x0 170) = 0x7fffffff 0x7fffffff 0x7fffffff 0x7fffffff +pshufd(0xffffffff 0x80000000 0x7fffffff 0x0 2) = 0x7fffffff 0xffffffff 0xffffffff 0xffffffff +psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 170) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 2) = 0x3fff 0x2000 0x1fff 0x0 0x0 0x0 0x0 0x2000 +psrld(0xffffffff 0x80000000 0x7fffffff 0x0 0) = 0xffffffff 0x80000000 0x7fffffff 0x0 +psrld(0xffffffff 0x80000000 0x7fffffff 0x0 255) = 0x0 0x0 0x0 0x0 +psrld(0xffffffff 0x80000000 0x7fffffff 0x0 170) = 0x0 0x0 0x0 0x0 +psrld(0xffffffff 0x80000000 0x7fffffff 0x0 2) = 0x3fffffff 0x20000000 0x1fffffff 0x0 +psrlq(0xffffffffffffffff 0x8000000000000000 0) = 0xffffffffffffffff 0x8000000000000000 +psrlq(0xffffffffffffffff 0x8000000000000000 255) = 0x0 0x0 +psrlq(0xffffffffffffffff 0x8000000000000000 170) = 0x0 0x0 +psrlq(0xffffffffffffffff 0x8000000000000000 2) = 0x3fffffffffffffff 0x2000000000000000 +psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 255) = 0xffff 0xffff 0x0 0x0 0x0 0x0 0x0 0xffff +psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 170) = 0xffff 0xffff 0x0 0x0 0x0 0x0 0x0 0xffff +psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 2) = 0xffff 0xe000 0x1fff 0x0 0x0 0x0 0x0 0xe000 +psrad(0xffffffff 0x80000000 0x7fffffff 0x0 0) = 0xffffffff 0x80000000 0x7fffffff 0x0 +psrad(0xffffffff 0x80000000 0x7fffffff 0x0 255) = 0xffffffff 0xffffffff 0x0 0x0 +psrad(0xffffffff 0x80000000 0x7fffffff 0x0 170) = 0xffffffff 0xffffffff 0x0 0x0 +psrad(0xffffffff 0x80000000 0x7fffffff 0x0 2) = 0xffffffff 0xe0000000 0x1fffffff 0x0 +psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 170) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 2) = 0xfffc 0x0 0xfffc 0x0 0x4 0x8 0xc 0x4 +pslld(0xffffffff 0x80000000 0x7fffffff 0x0 0) = 0xffffffff 0x80000000 0x7fffffff 0x0 +pslld(0xffffffff 0x80000000 0x7fffffff 0x0 255) = 0x0 0x0 0x0 0x0 +pslld(0xffffffff 0x80000000 0x7fffffff 0x0 170) = 0x0 0x0 0x0 0x0 +pslld(0xffffffff 0x80000000 0x7fffffff 0x0 2) = 0xfffffffc 0x0 0xfffffffc 0x0 +psllq(0xffffffffffffffff 0x8000000000000000 0) = 0xffffffffffffffff 0x8000000000000000 +psllq(0xffffffffffffffff 0x8000000000000000 255) = 0x0 0x0 +psllq(0xffffffffffffffff 0x8000000000000000 170) = 0x0 0x0 +psllq(0xffffffffffffffff 0x8000000000000000 2) = 0xfffffffffffffffc 0x0 +pcmpeqb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpeqw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xffff +pcmpeqd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0xffffffff 0x0 0x0 +haddpd(1 2 , 0 -2 ) = 3 -2 +haddpd(0 -2 , inf -inf ) = -2 0xfff8000000000000 +haddpd(1 2 , 0x7ff8000000000000 -0 ) = 3 0x7ff8000000000000 +haddpd(0 -2 , 0x7ff8000000000000 -0 ) = -2 0x7ff8000000000000 +haddpd(inf -inf , 0x7ff8000000000000 -0 ) = 0xfff8000000000000 0x7ff8000000000000 +haddpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0x7ff8000000000000 +psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrld(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0x0 +psrlq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x7fffffffffffffff 0x4000000000000000 +paddq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x0 0x0 +pmullw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x8000 0x8001 0x0 0x50 0x2000 0xfffa 0x1 +psubusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x7f 0x7a 0x0 0x0 0x0 0x0 0x81 0xf6 0x7d 0x0 0x4c 0x9b 0x0 0xb0 0x31 +psubusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x1 0x0 0x0 0x0 0x0 0x0 0x0 +pminub(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x1 0x5 0x0 0x1 0x2 0x3 0x0 0x8 0x7 0x72 0x6 0xa 0x0 0x10 0x1 +pand(0x81030201007f80ff 0x32c000a5527284fe , 0xff802015050100 0x1100f0a06810708 ) = 0x3000000050000 0x2000408 +paddusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x81 0x84 0x15 0x21 0x82 0xff 0x81 0xff 0x8b 0xf3 0x58 0xaf 0xf 0xd0 0x33 +paddusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0xffff 0xffff 0xffff 0x51 0x9002 0xffff 0xffff +pmaxub(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x80 0x7f 0x15 0x20 0x80 0xff 0x81 0xfe 0x84 0x81 0x52 0xa5 0xf 0xc0 0x32 +pandn(0x81030201007f80ff 0x32c000a5527284fe , 0xff802015050100 0x1100f0a06810708 ) = 0xfc802015000100 0x1100f0a04810300 +pavgb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x80 0x41 0x42 0xb 0x11 0x41 0x81 0x41 0x83 0x46 0x7a 0x2c 0x58 0x8 0x68 0x1a +psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0xffff 0x0 0x0 0x0 0x0 0x0 0xffff +psrad(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0xffffffff 0x0 0x0 +pavgb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xc000 0x8000 0xbfff 0x8000 0x29 0x4801 0x8001 0x8001 +pmulhuw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x3fff 0x7ffe 0x0 0x0 0x1 0x2 0x4001 +pmulhw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0xc000 0xffff 0x0 0x0 0xffff 0xffff 0x3fff +psubsb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x80 0x7a 0xeb 0xe1 0x7f 0x4 0x81 0xf6 0x80 0x7f 0x4c 0x9b 0xf1 0xb0 0x31 +psubsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x8000 0x7fff 0x1 0xffb1 0x7002 0x5 0x0 +pminsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x8000 0xffff 0xffff 0x1 0x9000 0xfffe 0x8001 +por(0x81030201007f80ff 0x32c000a5527284fe , 0xff802015050100 0x1100f0a06810708 ) = 0x81ff8221157f81ff 0x33d00faf56f387fe +paddusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x81 0x7f 0x15 0x21 0x82 0x2 0x81 0x6 0x8b 0xf3 0x58 0xaf 0xf 0xd0 0x33 +paddusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0xffff 0x7ffe 0xffff 0x51 0x9002 0x1 0x8000 +pmaxsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0x7fff 0x7fff 0x0 0x50 0x2 0x3 0x8001 +pxor(0x81030201007f80ff 0x32c000a5527284fe , 0xff802015050100 0x1100f0a06810708 ) = 0x81fc8221157a81ff 0x33d00faf54f383f6 +psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pslld(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0x0 +psllq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0xfffffffffffffffe 0x0 +pmuludq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x0 0x7ffffffb 0x2 +pmaddwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0xc001 0x8001 0xffff 0x2050 0xffff 0xfffb 0x3ffe +psadbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x27 0x4 0x0 0x0 0x0 0x0 0x0 0x0 0x59 0x3 0x0 0x0 0x0 0x0 0x0 0x0 +psubb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x7f 0x7a 0xeb 0xe1 0x82 0x4 0x81 0xf6 0x7d 0xf1 0x4c 0x9b 0xf1 0xb0 0x31 +psubw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x1 0x8000 0x1 0xffb1 0x7002 0x5 0x0 +psubd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xfffffffe 0x0 0x7ffffffa 0x2 +psubq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0xfffffffffffffffe 0x0 +paddb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x81 0x84 0x15 0x21 0x82 0x2 0x81 0x6 0x8b 0xf3 0x58 0xaf 0xf 0xd0 0x33 +paddw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0xffff 0x7ffe 0xffff 0x51 0x9002 0x1 0x2 +paddd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x80000004 0xfffffffe +pmovhlps(1 2 3 -4 , 0 -2 -10 0.5 ) = -10 0.5 3 -4 +unpcklps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 0 2 -2 +unpckhps(1 2 3 -4 , 0 -2 -10 0.5 ) = 3 -10 -4 0.5 +pmovhps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 2 0 -2 +psqrtps(1 2 3 -4 ) = 1 1.41421 1.73205 nan +psqrtps(0 -2 -10 0.5 ) = 0 nan nan 0.707107 +psqrtps(inf -inf -inf 1 ) = inf nan nan 1 +psqrtps(nan -0 nan inf ) = nan -0 nan inf +prcpps(nan -0 nan inf ) = nan -inf nan 0 +andps(1 2 3 -4 , 0 -2 -10 0.5 ) = 0 2 2 0 +andps(0 -2 -10 0.5 , inf -inf -inf 1 ) = 0 -2 -8 0.5 +andps(1 2 3 -4 , nan -0 nan inf ) = 1 0 3 4 +andps(0 -2 -10 0.5 , nan -0 nan inf ) = 0 -0 -8 0.5 +andps(inf -inf -inf 1 , nan -0 nan inf ) = inf -0 -inf 1 +andps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +andnps(1 2 3 -4 , 0 -2 -10 0.5 ) = 0 -0 -2.93874e-38 0.5 +andnps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf 1 0.25 1.17549e-38 +andnps(1 2 3 -4 , nan -0 nan inf ) = 3 -0 -1 0.5 +andnps(0 -2 -10 0.5 , nan -0 nan inf ) = nan 0 0.375 4 +andnps(inf -inf -inf 1 , nan -0 nan inf ) = 5.87747e-39 0 5.87747e-39 2 +andnps(nan -0 nan inf , nan -0 nan inf ) = 0 0 0 0 +orps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 -2 -14 -inf +orps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf -inf nan 1 +orps(1 2 3 -4 , nan -0 nan inf ) = nan -2 nan -inf +orps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -2 nan inf +orps(inf -inf -inf 1 , nan -0 nan inf ) = nan -inf nan inf +orps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +xorps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 -0 -4.11423e-38 -inf +xorps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf 1 0.3125 1.17549e-38 +xorps(1 2 3 -4 , nan -0 nan inf ) = 3 -2 -1 -0.5 +xorps(0 -2 -10 0.5 , nan -0 nan inf ) = nan 2 0.4375 4 +xorps(inf -inf -inf 1 , nan -0 nan inf ) = 5.87747e-39 inf 5.87747e-39 2 +xorps(nan -0 nan inf , nan -0 nan inf ) = 0 0 0 0 +addps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 0 -7 -3.5 +addps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf -inf -inf 1.5 +addps(1 2 3 -4 , nan -0 nan inf ) = nan 2 nan inf +addps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -2 nan inf +addps(inf -inf -inf 1 , nan -0 nan inf ) = nan -inf nan inf +addps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +mulps(1 2 3 -4 , 0 -2 -10 0.5 ) = 0 -4 -30 -2 +mulps(0 -2 -10 0.5 , inf -inf -inf 1 ) = nan inf inf 0.5 +mulps(1 2 3 -4 , nan -0 nan inf ) = nan -0 nan -inf +mulps(0 -2 -10 0.5 , nan -0 nan inf ) = nan 0 nan inf +mulps(inf -inf -inf 1 , nan -0 nan inf ) = nan nan nan inf +mulps(nan -0 nan inf , nan -0 nan inf ) = nan 0 nan inf +subps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 4 13 -4.5 +subps(0 -2 -10 0.5 , inf -inf -inf 1 ) = -inf inf inf -0.5 +subps(1 2 3 -4 , nan -0 nan inf ) = nan 2 nan -inf +subps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -2 nan -inf +subps(inf -inf -inf 1 , nan -0 nan inf ) = nan -inf nan -inf +subps(nan -0 nan inf , nan -0 nan inf ) = nan 0 nan nan +minps(1 2 3 -4 , 0 -2 -10 0.5 ) = 0 -2 -10 -4 +minps(0 -2 -10 0.5 , inf -inf -inf 1 ) = 0 -inf -inf 0.5 +minps(1 2 3 -4 , nan -0 nan inf ) = nan -0 nan -4 +minps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -2 nan 0.5 +minps(inf -inf -inf 1 , nan -0 nan inf ) = nan -inf nan 1 +minps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +divps(1 2 3 -4 , 0 -2 -10 0.5 ) = inf -1 -0.3 -8 +divps(0 -2 -10 0.5 , inf -inf -inf 1 ) = 0 0 0 0.5 +divps(1 2 3 -4 , nan -0 nan inf ) = nan -inf nan -0 +divps(0 -2 -10 0.5 , nan -0 nan inf ) = nan inf nan 0 +divps(inf -inf -inf 1 , nan -0 nan inf ) = nan inf nan 0 +divps(nan -0 nan inf , nan -0 nan inf ) = nan nan nan nan +maxps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 2 3 0.5 +maxps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf -2 -10 1 +maxps(1 2 3 -4 , nan -0 nan inf ) = nan 2 nan inf +maxps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -0 nan inf +maxps(inf -inf -inf 1 , nan -0 nan inf ) = nan -0 nan inf +maxps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +shufps(1 2 3 -4 , 0 -2 -10 0.5 , 0) = 1 1 0 0 +shufps(0 -2 -10 0.5 , inf -inf -inf 1 , 0) = 0 0 inf inf +shufps(1 2 3 -4 , nan -0 nan inf , 0) = 1 1 nan nan +shufps(0 -2 -10 0.5 , nan -0 nan inf , 0) = 0 0 nan nan +shufps(inf -inf -inf 1 , nan -0 nan inf , 0) = inf inf nan nan +shufps(nan -0 nan inf , nan -0 nan inf , 0) = nan nan nan nan +shufps(1 2 3 -4 , 0 -2 -10 0.5 , 21) = 2 2 -2 0 +shufps(0 -2 -10 0.5 , inf -inf -inf 1 , 21) = -2 -2 -inf inf +shufps(1 2 3 -4 , nan -0 nan inf , 21) = 2 2 -0 nan +shufps(0 -2 -10 0.5 , nan -0 nan inf , 21) = -2 -2 -0 nan +shufps(inf -inf -inf 1 , nan -0 nan inf , 21) = -inf -inf -0 nan +shufps(nan -0 nan inf , nan -0 nan inf , 21) = -0 -0 -0 nan +shufps(1 2 3 -4 , 0 -2 -10 0.5 , 255) = -4 -4 0.5 0.5 +shufps(0 -2 -10 0.5 , inf -inf -inf 1 , 255) = 0.5 0.5 1 1 +shufps(1 2 3 -4 , nan -0 nan inf , 255) = -4 -4 inf inf +shufps(0 -2 -10 0.5 , nan -0 nan inf , 255) = 0.5 0.5 inf inf +shufps(inf -inf -inf 1 , nan -0 nan inf , 255) = 1 1 inf inf +shufps(nan -0 nan inf , nan -0 nan inf , 255) = inf inf inf inf +shufps(1 2 3 -4 , 0 -2 -10 0.5 , 2) = 3 1 0 0 +shufps(0 -2 -10 0.5 , inf -inf -inf 1 , 2) = -10 0 inf inf +shufps(1 2 3 -4 , nan -0 nan inf , 2) = 3 1 nan nan +shufps(0 -2 -10 0.5 , nan -0 nan inf , 2) = -10 0 nan nan +shufps(inf -inf -inf 1 , nan -0 nan inf , 2) = -inf inf nan nan +shufps(nan -0 nan inf , nan -0 nan inf , 2) = nan nan nan nan +sqrtsd(1 2 , 1 2 ) = 1 2 +sqrtsd(1 2 , 0 -2 ) = 0 2 +sqrtsd(1 2 , inf -inf ) = inf 2 +sqrtsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +sqrtsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +sqrtsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +sqrtsd(1 2 , 2 1 ) = 1.41421 2 +sqrtsd(1 2 , -2 0 ) = 0xfff8000000000000 2 +sqrtsd(1 2 , -inf inf ) = 0xfff8000000000000 2 +sqrtsd(1 2 , -0 0x7ff8000000000000 ) = -0 2 +sqrtsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +sqrtsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +addsd(1 2 , 1 2 ) = 2 2 +addsd(1 2 , 0 -2 ) = 1 2 +addsd(1 2 , inf -inf ) = inf 2 +addsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +addsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +addsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +addsd(1 2 , 2 1 ) = 3 2 +addsd(1 2 , -2 0 ) = -1 2 +addsd(1 2 , -inf inf ) = -inf 2 +addsd(1 2 , -0 0x7ff8000000000000 ) = 1 2 +addsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2 +addsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2 +mulsd(1 2 , 1 2 ) = 1 2 +mulsd(1 2 , 0 -2 ) = 0 2 +mulsd(1 2 , inf -inf ) = inf 2 +mulsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +mulsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +mulsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +mulsd(1 2 , 2 1 ) = 2 2 +mulsd(1 2 , -2 0 ) = -2 2 +mulsd(1 2 , -inf inf ) = -inf 2 +mulsd(1 2 , -0 0x7ff8000000000000 ) = -0 2 +mulsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +mulsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +subsd(1 2 , 1 2 ) = 0 2 +subsd(1 2 , 0 -2 ) = 1 2 +subsd(1 2 , inf -inf ) = -inf 2 +subsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +subsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +subsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +subsd(1 2 , 2 1 ) = -1 2 +subsd(1 2 , -2 0 ) = 3 2 +subsd(1 2 , -inf inf ) = inf 2 +subsd(1 2 , -0 0x7ff8000000000000 ) = 1 2 +subsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2 +subsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2 +minsd(1 2 , 1 2 ) = 1 2 +minsd(1 2 , 0 -2 ) = 0 2 +minsd(1 2 , inf -inf ) = 1 2 +minsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +minsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +minsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +minsd(1 2 , 2 1 ) = 1 2 +minsd(1 2 , -2 0 ) = -2 2 +minsd(1 2 , -inf inf ) = -inf 2 +minsd(1 2 , -0 0x7ff8000000000000 ) = -0 2 +minsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +minsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +divsd(1 2 , 1 2 ) = 1 2 +divsd(1 2 , 0 -2 ) = inf 2 +divsd(1 2 , inf -inf ) = 0 2 +divsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +divsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +divsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +divsd(1 2 , 2 1 ) = 0.5 2 +divsd(1 2 , -2 0 ) = -0.5 2 +divsd(1 2 , -inf inf ) = -0 2 +divsd(1 2 , -0 0x7ff8000000000000 ) = -inf 2 +divsd(0 -2 , -0 0x7ff8000000000000 ) = 0xfff8000000000000 -2 +divsd(0 -2 , -0 0x7ff8000000000000 ) = 0xfff8000000000000 -2 +maxsd(1 2 , 1 2 ) = 1 2 +maxsd(1 2 , 0 -2 ) = 1 2 +maxsd(1 2 , inf -inf ) = inf 2 +maxsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +maxsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +maxsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +maxsd(1 2 , 2 1 ) = 2 2 +maxsd(1 2 , -2 0 ) = 1 2 +maxsd(1 2 , -inf inf ) = 1 2 +maxsd(1 2 , -0 0x7ff8000000000000 ) = 1 2 +maxsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +maxsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +cvtps2dq(1 2 3 -4 ) = 0x1 0x2 0x3 0xfffffffc +cvtps2dq(0 -2 -10 0.5 ) = 0x0 0xfffffffe 0xfffffff6 0x0 +cvtps2dq(inf -inf -inf 1 ) = 0x80000000 0x80000000 0x80000000 0x1 +cvtps2dq(nan -0 nan inf ) = 0x80000000 0x0 0x80000000 0x80000000 +dpps(1 2 3 -4 , 0 -2 -10 0.5 , 255) = -36 -36 -36 -36 +dpps(0 -2 -10 0.5 , inf -inf -inf 1 , 255) = nan nan nan nan +dpps(1 2 3 -4 , nan -0 nan inf , 255) = nan nan nan nan +dpps(0 -2 -10 0.5 , nan -0 nan inf , 255) = nan nan nan nan +dpps(inf -inf -inf 1 , nan -0 nan inf , 255) = nan nan nan nan +dpps(nan -0 nan inf , nan -0 nan inf , 255) = nan nan nan nan +dpps(1 2 3 -4 , 0 -2 -10 0.5 , 63) = -4 -4 -4 -4 +dpps(0 -2 -10 0.5 , inf -inf -inf 1 , 63) = nan nan nan nan +dpps(1 2 3 -4 , nan -0 nan inf , 63) = nan nan nan nan +dpps(0 -2 -10 0.5 , nan -0 nan inf , 63) = nan nan nan nan +dpps(inf -inf -inf 1 , nan -0 nan inf , 63) = nan nan nan nan +dpps(nan -0 nan inf , nan -0 nan inf , 63) = nan nan nan nan +dpps(1 2 3 -4 , 0 -2 -10 0.5 , 243) = -36 -36 0 0 +dpps(0 -2 -10 0.5 , inf -inf -inf 1 , 243) = nan nan 0 0 +dpps(1 2 3 -4 , nan -0 nan inf , 243) = nan nan 0 0 +dpps(0 -2 -10 0.5 , nan -0 nan inf , 243) = nan nan 0 0 +dpps(inf -inf -inf 1 , nan -0 nan inf , 243) = nan nan 0 0 +dpps(nan -0 nan inf , nan -0 nan inf , 243) = nan nan 0 0 +dpps(1 2 3 -4 , 0 -2 -10 0.5 , 83) = -30 -30 0 0 +dpps(0 -2 -10 0.5 , inf -inf -inf 1 , 83) = nan nan 0 0 +dpps(1 2 3 -4 , nan -0 nan inf , 83) = nan nan 0 0 +dpps(0 -2 -10 0.5 , nan -0 nan inf , 83) = nan nan 0 0 +dpps(inf -inf -inf 1 , nan -0 nan inf , 83) = nan nan 0 0 +dpps(nan -0 nan inf , nan -0 nan inf , 83) = nan nan 0 0 diff --git a/tests32/ref17_o2.txt b/tests32/ref17_o2.txt new file mode 100644 index 0000000..ae5c89a --- /dev/null +++ b/tests32/ref17_o2.txt @@ -0,0 +1,1510 @@ +ucomiss 1.000000, 1.000000 => 0x242 +ucomiss 1.000000, 2.000000 => 0x203 +ucomiss 1.000000, 0.000000 => 0x202 +ucomiss 1.000000, -0.000000 => 0x202 +ucomiss 1.000000, -1.000000 => 0x202 +ucomiss 1.000000, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss 1.000000, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss 1.000000, inf => 0x203 +ucomiss 1.000000, -inf => 0x202 +ucomiss 1.000000, nan => 0x247 +ucomiss 2.000000, 1.000000 => 0x202 +ucomiss 2.000000, 2.000000 => 0x242 +ucomiss 2.000000, 0.000000 => 0x202 +ucomiss 2.000000, -0.000000 => 0x202 +ucomiss 2.000000, -1.000000 => 0x202 +ucomiss 2.000000, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss 2.000000, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss 2.000000, inf => 0x203 +ucomiss 2.000000, -inf => 0x202 +ucomiss 2.000000, nan => 0x247 +ucomiss 0.000000, 1.000000 => 0x203 +ucomiss 0.000000, 2.000000 => 0x203 +ucomiss 0.000000, 0.000000 => 0x242 +ucomiss 0.000000, -0.000000 => 0x242 +ucomiss 0.000000, -1.000000 => 0x202 +ucomiss 0.000000, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss 0.000000, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss 0.000000, inf => 0x203 +ucomiss 0.000000, -inf => 0x202 +ucomiss 0.000000, nan => 0x247 +ucomiss -0.000000, 1.000000 => 0x203 +ucomiss -0.000000, 2.000000 => 0x203 +ucomiss -0.000000, 0.000000 => 0x242 +ucomiss -0.000000, -0.000000 => 0x242 +ucomiss -0.000000, -1.000000 => 0x202 +ucomiss -0.000000, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss -0.000000, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss -0.000000, inf => 0x203 +ucomiss -0.000000, -inf => 0x202 +ucomiss -0.000000, nan => 0x247 +ucomiss -1.000000, 1.000000 => 0x203 +ucomiss -1.000000, 2.000000 => 0x203 +ucomiss -1.000000, 0.000000 => 0x203 +ucomiss -1.000000, -0.000000 => 0x203 +ucomiss -1.000000, -1.000000 => 0x242 +ucomiss -1.000000, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss -1.000000, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss -1.000000, inf => 0x203 +ucomiss -1.000000, -inf => 0x202 +ucomiss -1.000000, nan => 0x247 +ucomiss 340282346638528859811704183484516925440.000000, 1.000000 => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, 2.000000 => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, 0.000000 => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, -0.000000 => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, -1.000000 => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x242 +ucomiss 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, inf => 0x203 +ucomiss 340282346638528859811704183484516925440.000000, -inf => 0x202 +ucomiss 340282346638528859811704183484516925440.000000, nan => 0x247 +ucomiss -340282346638528859811704183484516925440.000000, 1.000000 => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, 2.000000 => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, 0.000000 => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, -0.000000 => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, -1.000000 => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x242 +ucomiss -340282346638528859811704183484516925440.000000, inf => 0x203 +ucomiss -340282346638528859811704183484516925440.000000, -inf => 0x202 +ucomiss -340282346638528859811704183484516925440.000000, nan => 0x247 +ucomiss inf, 1.000000 => 0x202 +ucomiss inf, 2.000000 => 0x202 +ucomiss inf, 0.000000 => 0x202 +ucomiss inf, -0.000000 => 0x202 +ucomiss inf, -1.000000 => 0x202 +ucomiss inf, 340282346638528859811704183484516925440.000000 => 0x202 +ucomiss inf, -340282346638528859811704183484516925440.000000 => 0x202 +ucomiss inf, inf => 0x242 +ucomiss inf, -inf => 0x202 +ucomiss inf, nan => 0x247 +ucomiss -inf, 1.000000 => 0x203 +ucomiss -inf, 2.000000 => 0x203 +ucomiss -inf, 0.000000 => 0x203 +ucomiss -inf, -0.000000 => 0x203 +ucomiss -inf, -1.000000 => 0x203 +ucomiss -inf, 340282346638528859811704183484516925440.000000 => 0x203 +ucomiss -inf, -340282346638528859811704183484516925440.000000 => 0x203 +ucomiss -inf, inf => 0x203 +ucomiss -inf, -inf => 0x242 +ucomiss -inf, nan => 0x247 +ucomiss nan, 1.000000 => 0x247 +ucomiss nan, 2.000000 => 0x247 +ucomiss nan, 0.000000 => 0x247 +ucomiss nan, -0.000000 => 0x247 +ucomiss nan, -1.000000 => 0x247 +ucomiss nan, 340282346638528859811704183484516925440.000000 => 0x247 +ucomiss nan, -340282346638528859811704183484516925440.000000 => 0x247 +ucomiss nan, inf => 0x247 +ucomiss nan, -inf => 0x247 +ucomiss nan, nan => 0x247 +minss 1, 1 => 1 +minss 1, 2 => 1 +minss 1, 0 => 0 +minss 1, -0 => -0 +minss 1, -1 => -1 +minss 1, 3.40282e+38 => 1 +minss 1, -3.40282e+38 => -3.40282e+38 +minss 1, inf => 1 +minss 1, -inf => -inf +minss 1, nan => nan +minss 2, 1 => 1 +minss 2, 2 => 2 +minss 2, 0 => 0 +minss 2, -0 => -0 +minss 2, -1 => -1 +minss 2, 3.40282e+38 => 2 +minss 2, -3.40282e+38 => -3.40282e+38 +minss 2, inf => 2 +minss 2, -inf => -inf +minss 2, nan => nan +minss 0, 1 => 0 +minss 0, 2 => 0 +minss 0, 0 => 0 +minss 0, -0 => -0 +minss 0, -1 => -1 +minss 0, 3.40282e+38 => 0 +minss 0, -3.40282e+38 => -3.40282e+38 +minss 0, inf => 0 +minss 0, -inf => -inf +minss 0, nan => nan +minss -0, 1 => -0 +minss -0, 2 => -0 +minss -0, 0 => 0 +minss -0, -0 => -0 +minss -0, -1 => -1 +minss -0, 3.40282e+38 => -0 +minss -0, -3.40282e+38 => -3.40282e+38 +minss -0, inf => -0 +minss -0, -inf => -inf +minss -0, nan => nan +minss -1, 1 => -1 +minss -1, 2 => -1 +minss -1, 0 => -1 +minss -1, -0 => -1 +minss -1, -1 => -1 +minss -1, 3.40282e+38 => -1 +minss -1, -3.40282e+38 => -3.40282e+38 +minss -1, inf => -1 +minss -1, -inf => -inf +minss -1, nan => nan +minss 3.40282e+38, 1 => 1 +minss 3.40282e+38, 2 => 2 +minss 3.40282e+38, 0 => 0 +minss 3.40282e+38, -0 => -0 +minss 3.40282e+38, -1 => -1 +minss 3.40282e+38, 3.40282e+38 => 3.40282e+38 +minss 3.40282e+38, -3.40282e+38 => -3.40282e+38 +minss 3.40282e+38, inf => 3.40282e+38 +minss 3.40282e+38, -inf => -inf +minss 3.40282e+38, nan => nan +minss -3.40282e+38, 1 => -3.40282e+38 +minss -3.40282e+38, 2 => -3.40282e+38 +minss -3.40282e+38, 0 => -3.40282e+38 +minss -3.40282e+38, -0 => -3.40282e+38 +minss -3.40282e+38, -1 => -3.40282e+38 +minss -3.40282e+38, 3.40282e+38 => -3.40282e+38 +minss -3.40282e+38, -3.40282e+38 => -3.40282e+38 +minss -3.40282e+38, inf => -3.40282e+38 +minss -3.40282e+38, -inf => -inf +minss -3.40282e+38, nan => nan +minss inf, 1 => 1 +minss inf, 2 => 2 +minss inf, 0 => 0 +minss inf, -0 => -0 +minss inf, -1 => -1 +minss inf, 3.40282e+38 => 3.40282e+38 +minss inf, -3.40282e+38 => -3.40282e+38 +minss inf, inf => inf +minss inf, -inf => -inf +minss inf, nan => nan +minss -inf, 1 => -inf +minss -inf, 2 => -inf +minss -inf, 0 => -inf +minss -inf, -0 => -inf +minss -inf, -1 => -inf +minss -inf, 3.40282e+38 => -inf +minss -inf, -3.40282e+38 => -inf +minss -inf, inf => -inf +minss -inf, -inf => -inf +minss -inf, nan => nan +minss nan, 1 => 1 +minss nan, 2 => 2 +minss nan, 0 => 0 +minss nan, -0 => -0 +minss nan, -1 => -1 +minss nan, 3.40282e+38 => 3.40282e+38 +minss nan, -3.40282e+38 => -3.40282e+38 +minss nan, inf => inf +minss nan, -inf => -inf +minss nan, nan => nan +maxss 1, 1 => 1 +maxss 1, 2 => 2 +maxss 1, 0 => 1 +maxss 1, -0 => 1 +maxss 1, -1 => 1 +maxss 1, 3.40282e+38 => 3.40282e+38 +maxss 1, -3.40282e+38 => 1 +maxss 1, inf => inf +maxss 1, -inf => 1 +maxss 1, nan => nan +maxss 2, 1 => 2 +maxss 2, 2 => 2 +maxss 2, 0 => 2 +maxss 2, -0 => 2 +maxss 2, -1 => 2 +maxss 2, 3.40282e+38 => 3.40282e+38 +maxss 2, -3.40282e+38 => 2 +maxss 2, inf => inf +maxss 2, -inf => 2 +maxss 2, nan => nan +maxss 0, 1 => 1 +maxss 0, 2 => 2 +maxss 0, 0 => 0 +maxss 0, -0 => -0 +maxss 0, -1 => 0 +maxss 0, 3.40282e+38 => 3.40282e+38 +maxss 0, -3.40282e+38 => 0 +maxss 0, inf => inf +maxss 0, -inf => 0 +maxss 0, nan => nan +maxss -0, 1 => 1 +maxss -0, 2 => 2 +maxss -0, 0 => 0 +maxss -0, -0 => -0 +maxss -0, -1 => -0 +maxss -0, 3.40282e+38 => 3.40282e+38 +maxss -0, -3.40282e+38 => -0 +maxss -0, inf => inf +maxss -0, -inf => -0 +maxss -0, nan => nan +maxss -1, 1 => 1 +maxss -1, 2 => 2 +maxss -1, 0 => 0 +maxss -1, -0 => -0 +maxss -1, -1 => -1 +maxss -1, 3.40282e+38 => 3.40282e+38 +maxss -1, -3.40282e+38 => -1 +maxss -1, inf => inf +maxss -1, -inf => -1 +maxss -1, nan => nan +maxss 3.40282e+38, 1 => 3.40282e+38 +maxss 3.40282e+38, 2 => 3.40282e+38 +maxss 3.40282e+38, 0 => 3.40282e+38 +maxss 3.40282e+38, -0 => 3.40282e+38 +maxss 3.40282e+38, -1 => 3.40282e+38 +maxss 3.40282e+38, 3.40282e+38 => 3.40282e+38 +maxss 3.40282e+38, -3.40282e+38 => 3.40282e+38 +maxss 3.40282e+38, inf => inf +maxss 3.40282e+38, -inf => 3.40282e+38 +maxss 3.40282e+38, nan => nan +maxss -3.40282e+38, 1 => 1 +maxss -3.40282e+38, 2 => 2 +maxss -3.40282e+38, 0 => 0 +maxss -3.40282e+38, -0 => -0 +maxss -3.40282e+38, -1 => -1 +maxss -3.40282e+38, 3.40282e+38 => 3.40282e+38 +maxss -3.40282e+38, -3.40282e+38 => -3.40282e+38 +maxss -3.40282e+38, inf => inf +maxss -3.40282e+38, -inf => -3.40282e+38 +maxss -3.40282e+38, nan => nan +maxss inf, 1 => inf +maxss inf, 2 => inf +maxss inf, 0 => inf +maxss inf, -0 => inf +maxss inf, -1 => inf +maxss inf, 3.40282e+38 => inf +maxss inf, -3.40282e+38 => inf +maxss inf, inf => inf +maxss inf, -inf => inf +maxss inf, nan => nan +maxss -inf, 1 => 1 +maxss -inf, 2 => 2 +maxss -inf, 0 => 0 +maxss -inf, -0 => -0 +maxss -inf, -1 => -1 +maxss -inf, 3.40282e+38 => 3.40282e+38 +maxss -inf, -3.40282e+38 => -3.40282e+38 +maxss -inf, inf => inf +maxss -inf, -inf => -inf +maxss -inf, nan => nan +maxss nan, 1 => 1 +maxss nan, 2 => 2 +maxss nan, 0 => 0 +maxss nan, -0 => -0 +maxss nan, -1 => -1 +maxss nan, 3.40282e+38 => 3.40282e+38 +maxss nan, -3.40282e+38 => -3.40282e+38 +maxss nan, inf => inf +maxss nan, -inf => -inf +maxss nan, nan => nan +cmpss 0 1.000000, 1.000000 => 0xffffffff +cmpss 0 1.000000, 2.000000 => 0x0 +cmpss 0 1.000000, 0.000000 => 0x0 +cmpss 0 1.000000, -0.000000 => 0x0 +cmpss 0 1.000000, -1.000000 => 0x0 +cmpss 0 1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 1.000000, inf => 0x0 +cmpss 0 1.000000, -inf => 0x0 +cmpss 0 1.000000, nan => 0x0 +cmpss 0 2.000000, 1.000000 => 0x0 +cmpss 0 2.000000, 2.000000 => 0xffffffff +cmpss 0 2.000000, 0.000000 => 0x0 +cmpss 0 2.000000, -0.000000 => 0x0 +cmpss 0 2.000000, -1.000000 => 0x0 +cmpss 0 2.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 2.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 2.000000, inf => 0x0 +cmpss 0 2.000000, -inf => 0x0 +cmpss 0 2.000000, nan => 0x0 +cmpss 0 0.000000, 1.000000 => 0x0 +cmpss 0 0.000000, 2.000000 => 0x0 +cmpss 0 0.000000, 0.000000 => 0xffffffff +cmpss 0 0.000000, -0.000000 => 0xffffffff +cmpss 0 0.000000, -1.000000 => 0x0 +cmpss 0 0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 0.000000, inf => 0x0 +cmpss 0 0.000000, -inf => 0x0 +cmpss 0 0.000000, nan => 0x0 +cmpss 0 -0.000000, 1.000000 => 0x0 +cmpss 0 -0.000000, 2.000000 => 0x0 +cmpss 0 -0.000000, 0.000000 => 0xffffffff +cmpss 0 -0.000000, -0.000000 => 0xffffffff +cmpss 0 -0.000000, -1.000000 => 0x0 +cmpss 0 -0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -0.000000, inf => 0x0 +cmpss 0 -0.000000, -inf => 0x0 +cmpss 0 -0.000000, nan => 0x0 +cmpss 0 -1.000000, 1.000000 => 0x0 +cmpss 0 -1.000000, 2.000000 => 0x0 +cmpss 0 -1.000000, 0.000000 => 0x0 +cmpss 0 -1.000000, -0.000000 => 0x0 +cmpss 0 -1.000000, -1.000000 => 0xffffffff +cmpss 0 -1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -1.000000, inf => 0x0 +cmpss 0 -1.000000, -inf => 0x0 +cmpss 0 -1.000000, nan => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 0 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 0 340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 0 -340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 0 -340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 0 inf, 1.000000 => 0x0 +cmpss 0 inf, 2.000000 => 0x0 +cmpss 0 inf, 0.000000 => 0x0 +cmpss 0 inf, -0.000000 => 0x0 +cmpss 0 inf, -1.000000 => 0x0 +cmpss 0 inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 inf, inf => 0xffffffff +cmpss 0 inf, -inf => 0x0 +cmpss 0 inf, nan => 0x0 +cmpss 0 -inf, 1.000000 => 0x0 +cmpss 0 -inf, 2.000000 => 0x0 +cmpss 0 -inf, 0.000000 => 0x0 +cmpss 0 -inf, -0.000000 => 0x0 +cmpss 0 -inf, -1.000000 => 0x0 +cmpss 0 -inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 -inf, inf => 0x0 +cmpss 0 -inf, -inf => 0xffffffff +cmpss 0 -inf, nan => 0x0 +cmpss 0 nan, 1.000000 => 0x0 +cmpss 0 nan, 2.000000 => 0x0 +cmpss 0 nan, 0.000000 => 0x0 +cmpss 0 nan, -0.000000 => 0x0 +cmpss 0 nan, -1.000000 => 0x0 +cmpss 0 nan, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 nan, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 0 nan, inf => 0x0 +cmpss 0 nan, -inf => 0x0 +cmpss 0 nan, nan => 0x0 +cmpss 1 1.000000, 1.000000 => 0x0 +cmpss 1 1.000000, 2.000000 => 0xffffffff +cmpss 1 1.000000, 0.000000 => 0x0 +cmpss 1 1.000000, -0.000000 => 0x0 +cmpss 1 1.000000, -1.000000 => 0x0 +cmpss 1 1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 1.000000, inf => 0xffffffff +cmpss 1 1.000000, -inf => 0x0 +cmpss 1 1.000000, nan => 0x0 +cmpss 1 2.000000, 1.000000 => 0x0 +cmpss 1 2.000000, 2.000000 => 0x0 +cmpss 1 2.000000, 0.000000 => 0x0 +cmpss 1 2.000000, -0.000000 => 0x0 +cmpss 1 2.000000, -1.000000 => 0x0 +cmpss 1 2.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 2.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 2.000000, inf => 0xffffffff +cmpss 1 2.000000, -inf => 0x0 +cmpss 1 2.000000, nan => 0x0 +cmpss 1 0.000000, 1.000000 => 0xffffffff +cmpss 1 0.000000, 2.000000 => 0xffffffff +cmpss 1 0.000000, 0.000000 => 0x0 +cmpss 1 0.000000, -0.000000 => 0x0 +cmpss 1 0.000000, -1.000000 => 0x0 +cmpss 1 0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 0.000000, inf => 0xffffffff +cmpss 1 0.000000, -inf => 0x0 +cmpss 1 0.000000, nan => 0x0 +cmpss 1 -0.000000, 1.000000 => 0xffffffff +cmpss 1 -0.000000, 2.000000 => 0xffffffff +cmpss 1 -0.000000, 0.000000 => 0x0 +cmpss 1 -0.000000, -0.000000 => 0x0 +cmpss 1 -0.000000, -1.000000 => 0x0 +cmpss 1 -0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 -0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 -0.000000, inf => 0xffffffff +cmpss 1 -0.000000, -inf => 0x0 +cmpss 1 -0.000000, nan => 0x0 +cmpss 1 -1.000000, 1.000000 => 0xffffffff +cmpss 1 -1.000000, 2.000000 => 0xffffffff +cmpss 1 -1.000000, 0.000000 => 0xffffffff +cmpss 1 -1.000000, -0.000000 => 0xffffffff +cmpss 1 -1.000000, -1.000000 => 0x0 +cmpss 1 -1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 -1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 -1.000000, inf => 0xffffffff +cmpss 1 -1.000000, -inf => 0x0 +cmpss 1 -1.000000, nan => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 1 340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 1 340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 1 -340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 -340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 1 -340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 1 -340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 1 inf, 1.000000 => 0x0 +cmpss 1 inf, 2.000000 => 0x0 +cmpss 1 inf, 0.000000 => 0x0 +cmpss 1 inf, -0.000000 => 0x0 +cmpss 1 inf, -1.000000 => 0x0 +cmpss 1 inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 inf, inf => 0x0 +cmpss 1 inf, -inf => 0x0 +cmpss 1 inf, nan => 0x0 +cmpss 1 -inf, 1.000000 => 0xffffffff +cmpss 1 -inf, 2.000000 => 0xffffffff +cmpss 1 -inf, 0.000000 => 0xffffffff +cmpss 1 -inf, -0.000000 => 0xffffffff +cmpss 1 -inf, -1.000000 => 0xffffffff +cmpss 1 -inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 -inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 1 -inf, inf => 0xffffffff +cmpss 1 -inf, -inf => 0x0 +cmpss 1 -inf, nan => 0x0 +cmpss 1 nan, 1.000000 => 0x0 +cmpss 1 nan, 2.000000 => 0x0 +cmpss 1 nan, 0.000000 => 0x0 +cmpss 1 nan, -0.000000 => 0x0 +cmpss 1 nan, -1.000000 => 0x0 +cmpss 1 nan, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 nan, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 1 nan, inf => 0x0 +cmpss 1 nan, -inf => 0x0 +cmpss 1 nan, nan => 0x0 +cmpss 2 1.000000, 1.000000 => 0xffffffff +cmpss 2 1.000000, 2.000000 => 0xffffffff +cmpss 2 1.000000, 0.000000 => 0x0 +cmpss 2 1.000000, -0.000000 => 0x0 +cmpss 2 1.000000, -1.000000 => 0x0 +cmpss 2 1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 1.000000, inf => 0xffffffff +cmpss 2 1.000000, -inf => 0x0 +cmpss 2 1.000000, nan => 0x0 +cmpss 2 2.000000, 1.000000 => 0x0 +cmpss 2 2.000000, 2.000000 => 0xffffffff +cmpss 2 2.000000, 0.000000 => 0x0 +cmpss 2 2.000000, -0.000000 => 0x0 +cmpss 2 2.000000, -1.000000 => 0x0 +cmpss 2 2.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 2.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 2.000000, inf => 0xffffffff +cmpss 2 2.000000, -inf => 0x0 +cmpss 2 2.000000, nan => 0x0 +cmpss 2 0.000000, 1.000000 => 0xffffffff +cmpss 2 0.000000, 2.000000 => 0xffffffff +cmpss 2 0.000000, 0.000000 => 0xffffffff +cmpss 2 0.000000, -0.000000 => 0xffffffff +cmpss 2 0.000000, -1.000000 => 0x0 +cmpss 2 0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 0.000000, inf => 0xffffffff +cmpss 2 0.000000, -inf => 0x0 +cmpss 2 0.000000, nan => 0x0 +cmpss 2 -0.000000, 1.000000 => 0xffffffff +cmpss 2 -0.000000, 2.000000 => 0xffffffff +cmpss 2 -0.000000, 0.000000 => 0xffffffff +cmpss 2 -0.000000, -0.000000 => 0xffffffff +cmpss 2 -0.000000, -1.000000 => 0x0 +cmpss 2 -0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 -0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 -0.000000, inf => 0xffffffff +cmpss 2 -0.000000, -inf => 0x0 +cmpss 2 -0.000000, nan => 0x0 +cmpss 2 -1.000000, 1.000000 => 0xffffffff +cmpss 2 -1.000000, 2.000000 => 0xffffffff +cmpss 2 -1.000000, 0.000000 => 0xffffffff +cmpss 2 -1.000000, -0.000000 => 0xffffffff +cmpss 2 -1.000000, -1.000000 => 0xffffffff +cmpss 2 -1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 -1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 -1.000000, inf => 0xffffffff +cmpss 2 -1.000000, -inf => 0x0 +cmpss 2 -1.000000, nan => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 2 340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 2 340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 2 -340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 2 -340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 2 -340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 2 inf, 1.000000 => 0x0 +cmpss 2 inf, 2.000000 => 0x0 +cmpss 2 inf, 0.000000 => 0x0 +cmpss 2 inf, -0.000000 => 0x0 +cmpss 2 inf, -1.000000 => 0x0 +cmpss 2 inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 inf, inf => 0xffffffff +cmpss 2 inf, -inf => 0x0 +cmpss 2 inf, nan => 0x0 +cmpss 2 -inf, 1.000000 => 0xffffffff +cmpss 2 -inf, 2.000000 => 0xffffffff +cmpss 2 -inf, 0.000000 => 0xffffffff +cmpss 2 -inf, -0.000000 => 0xffffffff +cmpss 2 -inf, -1.000000 => 0xffffffff +cmpss 2 -inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 -inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 2 -inf, inf => 0xffffffff +cmpss 2 -inf, -inf => 0xffffffff +cmpss 2 -inf, nan => 0x0 +cmpss 2 nan, 1.000000 => 0x0 +cmpss 2 nan, 2.000000 => 0x0 +cmpss 2 nan, 0.000000 => 0x0 +cmpss 2 nan, -0.000000 => 0x0 +cmpss 2 nan, -1.000000 => 0x0 +cmpss 2 nan, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 nan, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 2 nan, inf => 0x0 +cmpss 2 nan, -inf => 0x0 +cmpss 2 nan, nan => 0x0 +cmpss 3 1.000000, 1.000000 => 0x0 +cmpss 3 1.000000, 2.000000 => 0x0 +cmpss 3 1.000000, 0.000000 => 0x0 +cmpss 3 1.000000, -0.000000 => 0x0 +cmpss 3 1.000000, -1.000000 => 0x0 +cmpss 3 1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 1.000000, inf => 0x0 +cmpss 3 1.000000, -inf => 0x0 +cmpss 3 1.000000, nan => 0xffffffff +cmpss 3 2.000000, 1.000000 => 0x0 +cmpss 3 2.000000, 2.000000 => 0x0 +cmpss 3 2.000000, 0.000000 => 0x0 +cmpss 3 2.000000, -0.000000 => 0x0 +cmpss 3 2.000000, -1.000000 => 0x0 +cmpss 3 2.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 2.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 2.000000, inf => 0x0 +cmpss 3 2.000000, -inf => 0x0 +cmpss 3 2.000000, nan => 0xffffffff +cmpss 3 0.000000, 1.000000 => 0x0 +cmpss 3 0.000000, 2.000000 => 0x0 +cmpss 3 0.000000, 0.000000 => 0x0 +cmpss 3 0.000000, -0.000000 => 0x0 +cmpss 3 0.000000, -1.000000 => 0x0 +cmpss 3 0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 0.000000, inf => 0x0 +cmpss 3 0.000000, -inf => 0x0 +cmpss 3 0.000000, nan => 0xffffffff +cmpss 3 -0.000000, 1.000000 => 0x0 +cmpss 3 -0.000000, 2.000000 => 0x0 +cmpss 3 -0.000000, 0.000000 => 0x0 +cmpss 3 -0.000000, -0.000000 => 0x0 +cmpss 3 -0.000000, -1.000000 => 0x0 +cmpss 3 -0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -0.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -0.000000, inf => 0x0 +cmpss 3 -0.000000, -inf => 0x0 +cmpss 3 -0.000000, nan => 0xffffffff +cmpss 3 -1.000000, 1.000000 => 0x0 +cmpss 3 -1.000000, 2.000000 => 0x0 +cmpss 3 -1.000000, 0.000000 => 0x0 +cmpss 3 -1.000000, -0.000000 => 0x0 +cmpss 3 -1.000000, -1.000000 => 0x0 +cmpss 3 -1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -1.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -1.000000, inf => 0x0 +cmpss 3 -1.000000, -inf => 0x0 +cmpss 3 -1.000000, nan => 0xffffffff +cmpss 3 340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 3 340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 3 -340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, -inf => 0x0 +cmpss 3 -340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 3 inf, 1.000000 => 0x0 +cmpss 3 inf, 2.000000 => 0x0 +cmpss 3 inf, 0.000000 => 0x0 +cmpss 3 inf, -0.000000 => 0x0 +cmpss 3 inf, -1.000000 => 0x0 +cmpss 3 inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 inf, inf => 0x0 +cmpss 3 inf, -inf => 0x0 +cmpss 3 inf, nan => 0xffffffff +cmpss 3 -inf, 1.000000 => 0x0 +cmpss 3 -inf, 2.000000 => 0x0 +cmpss 3 -inf, 0.000000 => 0x0 +cmpss 3 -inf, -0.000000 => 0x0 +cmpss 3 -inf, -1.000000 => 0x0 +cmpss 3 -inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 3 -inf, inf => 0x0 +cmpss 3 -inf, -inf => 0x0 +cmpss 3 -inf, nan => 0xffffffff +cmpss 3 nan, 1.000000 => 0xffffffff +cmpss 3 nan, 2.000000 => 0xffffffff +cmpss 3 nan, 0.000000 => 0xffffffff +cmpss 3 nan, -0.000000 => 0xffffffff +cmpss 3 nan, -1.000000 => 0xffffffff +cmpss 3 nan, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 3 nan, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 3 nan, inf => 0xffffffff +cmpss 3 nan, -inf => 0xffffffff +cmpss 3 nan, nan => 0xffffffff +cmpss 4 1.000000, 1.000000 => 0x0 +cmpss 4 1.000000, 2.000000 => 0xffffffff +cmpss 4 1.000000, 0.000000 => 0xffffffff +cmpss 4 1.000000, -0.000000 => 0xffffffff +cmpss 4 1.000000, -1.000000 => 0xffffffff +cmpss 4 1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 1.000000, inf => 0xffffffff +cmpss 4 1.000000, -inf => 0xffffffff +cmpss 4 1.000000, nan => 0xffffffff +cmpss 4 2.000000, 1.000000 => 0xffffffff +cmpss 4 2.000000, 2.000000 => 0x0 +cmpss 4 2.000000, 0.000000 => 0xffffffff +cmpss 4 2.000000, -0.000000 => 0xffffffff +cmpss 4 2.000000, -1.000000 => 0xffffffff +cmpss 4 2.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 2.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 2.000000, inf => 0xffffffff +cmpss 4 2.000000, -inf => 0xffffffff +cmpss 4 2.000000, nan => 0xffffffff +cmpss 4 0.000000, 1.000000 => 0xffffffff +cmpss 4 0.000000, 2.000000 => 0xffffffff +cmpss 4 0.000000, 0.000000 => 0x0 +cmpss 4 0.000000, -0.000000 => 0x0 +cmpss 4 0.000000, -1.000000 => 0xffffffff +cmpss 4 0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 0.000000, inf => 0xffffffff +cmpss 4 0.000000, -inf => 0xffffffff +cmpss 4 0.000000, nan => 0xffffffff +cmpss 4 -0.000000, 1.000000 => 0xffffffff +cmpss 4 -0.000000, 2.000000 => 0xffffffff +cmpss 4 -0.000000, 0.000000 => 0x0 +cmpss 4 -0.000000, -0.000000 => 0x0 +cmpss 4 -0.000000, -1.000000 => 0xffffffff +cmpss 4 -0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -0.000000, inf => 0xffffffff +cmpss 4 -0.000000, -inf => 0xffffffff +cmpss 4 -0.000000, nan => 0xffffffff +cmpss 4 -1.000000, 1.000000 => 0xffffffff +cmpss 4 -1.000000, 2.000000 => 0xffffffff +cmpss 4 -1.000000, 0.000000 => 0xffffffff +cmpss 4 -1.000000, -0.000000 => 0xffffffff +cmpss 4 -1.000000, -1.000000 => 0x0 +cmpss 4 -1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -1.000000, inf => 0xffffffff +cmpss 4 -1.000000, -inf => 0xffffffff +cmpss 4 -1.000000, nan => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 4 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 4 340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 4 -340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 4 -340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 4 inf, 1.000000 => 0xffffffff +cmpss 4 inf, 2.000000 => 0xffffffff +cmpss 4 inf, 0.000000 => 0xffffffff +cmpss 4 inf, -0.000000 => 0xffffffff +cmpss 4 inf, -1.000000 => 0xffffffff +cmpss 4 inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 inf, inf => 0x0 +cmpss 4 inf, -inf => 0xffffffff +cmpss 4 inf, nan => 0xffffffff +cmpss 4 -inf, 1.000000 => 0xffffffff +cmpss 4 -inf, 2.000000 => 0xffffffff +cmpss 4 -inf, 0.000000 => 0xffffffff +cmpss 4 -inf, -0.000000 => 0xffffffff +cmpss 4 -inf, -1.000000 => 0xffffffff +cmpss 4 -inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 -inf, inf => 0xffffffff +cmpss 4 -inf, -inf => 0x0 +cmpss 4 -inf, nan => 0xffffffff +cmpss 4 nan, 1.000000 => 0xffffffff +cmpss 4 nan, 2.000000 => 0xffffffff +cmpss 4 nan, 0.000000 => 0xffffffff +cmpss 4 nan, -0.000000 => 0xffffffff +cmpss 4 nan, -1.000000 => 0xffffffff +cmpss 4 nan, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 nan, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 4 nan, inf => 0xffffffff +cmpss 4 nan, -inf => 0xffffffff +cmpss 4 nan, nan => 0xffffffff +cmpss 5 1.000000, 1.000000 => 0xffffffff +cmpss 5 1.000000, 2.000000 => 0x0 +cmpss 5 1.000000, 0.000000 => 0xffffffff +cmpss 5 1.000000, -0.000000 => 0xffffffff +cmpss 5 1.000000, -1.000000 => 0xffffffff +cmpss 5 1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 1.000000, inf => 0x0 +cmpss 5 1.000000, -inf => 0xffffffff +cmpss 5 1.000000, nan => 0xffffffff +cmpss 5 2.000000, 1.000000 => 0xffffffff +cmpss 5 2.000000, 2.000000 => 0xffffffff +cmpss 5 2.000000, 0.000000 => 0xffffffff +cmpss 5 2.000000, -0.000000 => 0xffffffff +cmpss 5 2.000000, -1.000000 => 0xffffffff +cmpss 5 2.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 2.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 2.000000, inf => 0x0 +cmpss 5 2.000000, -inf => 0xffffffff +cmpss 5 2.000000, nan => 0xffffffff +cmpss 5 0.000000, 1.000000 => 0x0 +cmpss 5 0.000000, 2.000000 => 0x0 +cmpss 5 0.000000, 0.000000 => 0xffffffff +cmpss 5 0.000000, -0.000000 => 0xffffffff +cmpss 5 0.000000, -1.000000 => 0xffffffff +cmpss 5 0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 0.000000, inf => 0x0 +cmpss 5 0.000000, -inf => 0xffffffff +cmpss 5 0.000000, nan => 0xffffffff +cmpss 5 -0.000000, 1.000000 => 0x0 +cmpss 5 -0.000000, 2.000000 => 0x0 +cmpss 5 -0.000000, 0.000000 => 0xffffffff +cmpss 5 -0.000000, -0.000000 => 0xffffffff +cmpss 5 -0.000000, -1.000000 => 0xffffffff +cmpss 5 -0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 -0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 -0.000000, inf => 0x0 +cmpss 5 -0.000000, -inf => 0xffffffff +cmpss 5 -0.000000, nan => 0xffffffff +cmpss 5 -1.000000, 1.000000 => 0x0 +cmpss 5 -1.000000, 2.000000 => 0x0 +cmpss 5 -1.000000, 0.000000 => 0x0 +cmpss 5 -1.000000, -0.000000 => 0x0 +cmpss 5 -1.000000, -1.000000 => 0xffffffff +cmpss 5 -1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 -1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 -1.000000, inf => 0x0 +cmpss 5 -1.000000, -inf => 0xffffffff +cmpss 5 -1.000000, nan => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 5 340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 5 340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 5 -340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 -340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 5 -340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 5 -340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 5 inf, 1.000000 => 0xffffffff +cmpss 5 inf, 2.000000 => 0xffffffff +cmpss 5 inf, 0.000000 => 0xffffffff +cmpss 5 inf, -0.000000 => 0xffffffff +cmpss 5 inf, -1.000000 => 0xffffffff +cmpss 5 inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 inf, inf => 0xffffffff +cmpss 5 inf, -inf => 0xffffffff +cmpss 5 inf, nan => 0xffffffff +cmpss 5 -inf, 1.000000 => 0x0 +cmpss 5 -inf, 2.000000 => 0x0 +cmpss 5 -inf, 0.000000 => 0x0 +cmpss 5 -inf, -0.000000 => 0x0 +cmpss 5 -inf, -1.000000 => 0x0 +cmpss 5 -inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 -inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 5 -inf, inf => 0x0 +cmpss 5 -inf, -inf => 0xffffffff +cmpss 5 -inf, nan => 0xffffffff +cmpss 5 nan, 1.000000 => 0xffffffff +cmpss 5 nan, 2.000000 => 0xffffffff +cmpss 5 nan, 0.000000 => 0xffffffff +cmpss 5 nan, -0.000000 => 0xffffffff +cmpss 5 nan, -1.000000 => 0xffffffff +cmpss 5 nan, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 nan, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 5 nan, inf => 0xffffffff +cmpss 5 nan, -inf => 0xffffffff +cmpss 5 nan, nan => 0xffffffff +cmpss 6 1.000000, 1.000000 => 0x0 +cmpss 6 1.000000, 2.000000 => 0x0 +cmpss 6 1.000000, 0.000000 => 0xffffffff +cmpss 6 1.000000, -0.000000 => 0xffffffff +cmpss 6 1.000000, -1.000000 => 0xffffffff +cmpss 6 1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 1.000000, inf => 0x0 +cmpss 6 1.000000, -inf => 0xffffffff +cmpss 6 1.000000, nan => 0xffffffff +cmpss 6 2.000000, 1.000000 => 0xffffffff +cmpss 6 2.000000, 2.000000 => 0x0 +cmpss 6 2.000000, 0.000000 => 0xffffffff +cmpss 6 2.000000, -0.000000 => 0xffffffff +cmpss 6 2.000000, -1.000000 => 0xffffffff +cmpss 6 2.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 2.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 2.000000, inf => 0x0 +cmpss 6 2.000000, -inf => 0xffffffff +cmpss 6 2.000000, nan => 0xffffffff +cmpss 6 0.000000, 1.000000 => 0x0 +cmpss 6 0.000000, 2.000000 => 0x0 +cmpss 6 0.000000, 0.000000 => 0x0 +cmpss 6 0.000000, -0.000000 => 0x0 +cmpss 6 0.000000, -1.000000 => 0xffffffff +cmpss 6 0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 0.000000, inf => 0x0 +cmpss 6 0.000000, -inf => 0xffffffff +cmpss 6 0.000000, nan => 0xffffffff +cmpss 6 -0.000000, 1.000000 => 0x0 +cmpss 6 -0.000000, 2.000000 => 0x0 +cmpss 6 -0.000000, 0.000000 => 0x0 +cmpss 6 -0.000000, -0.000000 => 0x0 +cmpss 6 -0.000000, -1.000000 => 0xffffffff +cmpss 6 -0.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 -0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 -0.000000, inf => 0x0 +cmpss 6 -0.000000, -inf => 0xffffffff +cmpss 6 -0.000000, nan => 0xffffffff +cmpss 6 -1.000000, 1.000000 => 0x0 +cmpss 6 -1.000000, 2.000000 => 0x0 +cmpss 6 -1.000000, 0.000000 => 0x0 +cmpss 6 -1.000000, -0.000000 => 0x0 +cmpss 6 -1.000000, -1.000000 => 0x0 +cmpss 6 -1.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 -1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 -1.000000, inf => 0x0 +cmpss 6 -1.000000, -inf => 0xffffffff +cmpss 6 -1.000000, nan => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 6 340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 6 340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 6 -340282346638528859811704183484516925440.000000, 1.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, 2.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, 0.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, -0.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, -1.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, inf => 0x0 +cmpss 6 -340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 6 -340282346638528859811704183484516925440.000000, nan => 0xffffffff +cmpss 6 inf, 1.000000 => 0xffffffff +cmpss 6 inf, 2.000000 => 0xffffffff +cmpss 6 inf, 0.000000 => 0xffffffff +cmpss 6 inf, -0.000000 => 0xffffffff +cmpss 6 inf, -1.000000 => 0xffffffff +cmpss 6 inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 inf, inf => 0x0 +cmpss 6 inf, -inf => 0xffffffff +cmpss 6 inf, nan => 0xffffffff +cmpss 6 -inf, 1.000000 => 0x0 +cmpss 6 -inf, 2.000000 => 0x0 +cmpss 6 -inf, 0.000000 => 0x0 +cmpss 6 -inf, -0.000000 => 0x0 +cmpss 6 -inf, -1.000000 => 0x0 +cmpss 6 -inf, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 -inf, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 6 -inf, inf => 0x0 +cmpss 6 -inf, -inf => 0x0 +cmpss 6 -inf, nan => 0xffffffff +cmpss 6 nan, 1.000000 => 0xffffffff +cmpss 6 nan, 2.000000 => 0xffffffff +cmpss 6 nan, 0.000000 => 0xffffffff +cmpss 6 nan, -0.000000 => 0xffffffff +cmpss 6 nan, -1.000000 => 0xffffffff +cmpss 6 nan, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 nan, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 6 nan, inf => 0xffffffff +cmpss 6 nan, -inf => 0xffffffff +cmpss 6 nan, nan => 0xffffffff +cmpss 7 1.000000, 1.000000 => 0xffffffff +cmpss 7 1.000000, 2.000000 => 0xffffffff +cmpss 7 1.000000, 0.000000 => 0xffffffff +cmpss 7 1.000000, -0.000000 => 0xffffffff +cmpss 7 1.000000, -1.000000 => 0xffffffff +cmpss 7 1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 1.000000, inf => 0xffffffff +cmpss 7 1.000000, -inf => 0xffffffff +cmpss 7 1.000000, nan => 0x0 +cmpss 7 2.000000, 1.000000 => 0xffffffff +cmpss 7 2.000000, 2.000000 => 0xffffffff +cmpss 7 2.000000, 0.000000 => 0xffffffff +cmpss 7 2.000000, -0.000000 => 0xffffffff +cmpss 7 2.000000, -1.000000 => 0xffffffff +cmpss 7 2.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 2.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 2.000000, inf => 0xffffffff +cmpss 7 2.000000, -inf => 0xffffffff +cmpss 7 2.000000, nan => 0x0 +cmpss 7 0.000000, 1.000000 => 0xffffffff +cmpss 7 0.000000, 2.000000 => 0xffffffff +cmpss 7 0.000000, 0.000000 => 0xffffffff +cmpss 7 0.000000, -0.000000 => 0xffffffff +cmpss 7 0.000000, -1.000000 => 0xffffffff +cmpss 7 0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 0.000000, inf => 0xffffffff +cmpss 7 0.000000, -inf => 0xffffffff +cmpss 7 0.000000, nan => 0x0 +cmpss 7 -0.000000, 1.000000 => 0xffffffff +cmpss 7 -0.000000, 2.000000 => 0xffffffff +cmpss 7 -0.000000, 0.000000 => 0xffffffff +cmpss 7 -0.000000, -0.000000 => 0xffffffff +cmpss 7 -0.000000, -1.000000 => 0xffffffff +cmpss 7 -0.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -0.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -0.000000, inf => 0xffffffff +cmpss 7 -0.000000, -inf => 0xffffffff +cmpss 7 -0.000000, nan => 0x0 +cmpss 7 -1.000000, 1.000000 => 0xffffffff +cmpss 7 -1.000000, 2.000000 => 0xffffffff +cmpss 7 -1.000000, 0.000000 => 0xffffffff +cmpss 7 -1.000000, -0.000000 => 0xffffffff +cmpss 7 -1.000000, -1.000000 => 0xffffffff +cmpss 7 -1.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -1.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -1.000000, inf => 0xffffffff +cmpss 7 -1.000000, -inf => 0xffffffff +cmpss 7 -1.000000, nan => 0x0 +cmpss 7 340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 7 340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 7 -340282346638528859811704183484516925440.000000, 1.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, 2.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, 0.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, -0.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, -1.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, inf => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, -inf => 0xffffffff +cmpss 7 -340282346638528859811704183484516925440.000000, nan => 0x0 +cmpss 7 inf, 1.000000 => 0xffffffff +cmpss 7 inf, 2.000000 => 0xffffffff +cmpss 7 inf, 0.000000 => 0xffffffff +cmpss 7 inf, -0.000000 => 0xffffffff +cmpss 7 inf, -1.000000 => 0xffffffff +cmpss 7 inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 inf, inf => 0xffffffff +cmpss 7 inf, -inf => 0xffffffff +cmpss 7 inf, nan => 0x0 +cmpss 7 -inf, 1.000000 => 0xffffffff +cmpss 7 -inf, 2.000000 => 0xffffffff +cmpss 7 -inf, 0.000000 => 0xffffffff +cmpss 7 -inf, -0.000000 => 0xffffffff +cmpss 7 -inf, -1.000000 => 0xffffffff +cmpss 7 -inf, 340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -inf, -340282346638528859811704183484516925440.000000 => 0xffffffff +cmpss 7 -inf, inf => 0xffffffff +cmpss 7 -inf, -inf => 0xffffffff +cmpss 7 -inf, nan => 0x0 +cmpss 7 nan, 1.000000 => 0x0 +cmpss 7 nan, 2.000000 => 0x0 +cmpss 7 nan, 0.000000 => 0x0 +cmpss 7 nan, -0.000000 => 0x0 +cmpss 7 nan, -1.000000 => 0x0 +cmpss 7 nan, 340282346638528859811704183484516925440.000000 => 0x0 +cmpss 7 nan, -340282346638528859811704183484516925440.000000 => 0x0 +cmpss 7 nan, inf => 0x0 +cmpss 7 nan, -inf => 0x0 +cmpss 7 nan, nan => 0x0 +pshufb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x80 0x2 0x2 0xff 0x0 0x0 0xff 0xfe 0x81 0x0 0x3 0x72 0x32 0xff 0x80 +phaddw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x7fff 0x3 0x8004 0xffff 0xfffe 0x9050 0x7fff +phaddd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x7fffffff 0x7fffffff 0x80000001 0x3 +phaddsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x7fff 0x3 0x8004 0xffff 0xfffe 0x9050 0x8000 +pmaddubsw(0x80ff 0x7f 0x201 0x8103 0x84fe 0x5272 0xa5 0x32c0 , 0x100 0x1505 0x8020 0xff 0x708 0x681 0xf0a 0x110 ) = 0x80 0x27b 0xff20 0xfffd 0xb8c 0xc95e 0x672 0xc32 +phsubw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x7fff 0xffff 0x8002 0x1 0x0 0x7050 0x7ffd +psignb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x80 0x7f 0x0 0x1 0xfe 0xfd 0x0 0xfe 0x84 0x8e 0x52 0xa5 0x0 0xc0 0x32 +psignw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x1 0x8000 0x8001 0x0 0x1 0xfffe 0xfffd 0x7fff +psignd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x80000000 0x7fffffff 0x0 +pmulhrsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x1 0x8001 0xffff 0x0 0x0 0xfffe 0x0 0x7ffe +pblendvps(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe , 0x1 0x80000000 0x80000005 0xfffe ) = 0xffffffff 0x80000000 0x5 0x0 +ptestz(0x80000000ffffffff 0x7fffffff , 0x8000000000000001 0xfffffffe00000005 ) = 0 +ptestc(0x80000000ffffffff 0x7fffffff , 0x8000000000000001 0xfffffffe00000005 ) = 0 +ptestnzc(0x80000000ffffffff 0x7fffffff , 0x8000000000000001 0xfffffffe00000005 ) = 1 +pabsb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 ) = 0x1 0x80 0x7f 0x0 0x1 0x2 0x3 0x7f 0x2 0x7c 0x72 0x52 0x5b 0x0 0x40 0x32 +pabsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0x1 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x7fff +pabsd(0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0x1 0x80000000 0x7fffffff 0x0 +pmovsxbw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xffff 0xffff 0x0 0xff80 0xffff 0x7f 0x0 0x0 +pmovsxbd(0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0xffffffff 0xffffffff 0xffffffff +pmovsxbq(0xffffffffffffffff 0x8000000000000000 ) = 0xffffffffffffffff 0xffffffffffffffff +pmovsxwd(0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffffffff 0xffffffff 0x0 0xffff8000 +pmovsxwq(0xffffffffffffffff 0x8000000000000000 ) = 0xffffffffffffffff 0xffffffffffffffff +pmovsxdq(0xffffffffffffffff 0x8000000000000000 ) = 0xffffffffffffffff 0xffffffffffffffff +pmovzxbw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 ) = 0xff 0xff 0x0 0x80 0xff 0x7f 0x0 0x0 +pmovzxbd(0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xff 0xff 0xff 0xff +pmovzxbq(0xffffffffffffffff 0x8000000000000000 ) = 0xff 0xff +pmovzxwd(0xffffffff 0x80000000 0x7fffffff 0x0 ) = 0xffff 0xffff 0x0 0x8000 +pmovzxwq(0xffffffffffffffff 0x8000000000000000 ) = 0xffff 0xffff +pmovzxdq(0xffffffffffffffff 0x8000000000000000 ) = 0xffffffff 0xffffffff +pminsd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x80000000 0x5 0xfffffffe +pmaxsd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x1 0x80000000 0x7fffffff 0x0 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 255) = 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 170) = 0xffff 0x7fff 0x7fff 0xffff 0x1 0x9000 0x3 0x8001 +pblendw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 2) = 0xffff 0x7fff 0x7fff 0x0 0x1 0x2 0x3 0x8001 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0) = 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 2) = 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0xff 0x80 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 7) = 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 15) = 0x1 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 16) = 0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 +palignr(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +movmskpd(0xffffffffffffffff 0x8000000000000000 ) = 0x3 +psqrtpd(1 2 ) = 1 1.41421 +psqrtpd(0 -2 ) = 0 0xfff8000000000000 +psqrtpd(inf -inf ) = inf 0xfff8000000000000 +psqrtpd(0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +andpd(1 2 , 0 -2 ) = 0 2 +andpd(0 -2 , inf -inf ) = 0 -2 +andpd(1 2 , 0x7ff8000000000000 -0 ) = 1 0 +andpd(0 -2 , 0x7ff8000000000000 -0 ) = 0 -0 +andpd(inf -inf , 0x7ff8000000000000 -0 ) = inf -0 +andpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +andnpd(1 2 , 0 -2 ) = 0 -0 +andnpd(0 -2 , inf -inf ) = inf 1 +andnpd(1 2 , 0x7ff8000000000000 -0 ) = 3 -0 +andnpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0 +andnpd(inf -inf , 0x7ff8000000000000 -0 ) = 1.11254e-308 0 +andnpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0 0 +orpd(1 2 , 0 -2 ) = 1 -2 +orpd(0 -2 , inf -inf ) = inf -inf +orpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +orpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +orpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +orpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +xorpd(1 2 , 0 -2 ) = 1 -0 +xorpd(0 -2 , inf -inf ) = inf 1 +xorpd(1 2 , 0x7ff8000000000000 -0 ) = 3 -2 +xorpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +xorpd(inf -inf , 0x7ff8000000000000 -0 ) = 1.11254e-308 inf +xorpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0 0 +addpd(1 2 , 0 -2 ) = 1 0 +addpd(0 -2 , inf -inf ) = inf -inf +addpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +addpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +addpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +addpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +mulpd(1 2 , 0 -2 ) = 0 -4 +mulpd(0 -2 , inf -inf ) = 0xfff8000000000000 inf +mulpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +mulpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0 +mulpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0xfff8000000000000 +mulpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0 +subpd(1 2 , 0 -2 ) = 1 4 +subpd(0 -2 , inf -inf ) = -inf inf +subpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +subpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +subpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +subpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0 +minpd(1 2 , 0 -2 ) = 0 -2 +minpd(0 -2 , inf -inf ) = 0 -inf +minpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +minpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +minpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +minpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +divpd(1 2 , 0 -2 ) = inf -1 +divpd(0 -2 , inf -inf ) = 0 0 +divpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +divpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 inf +divpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 inf +divpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0xfff8000000000000 +maxpd(1 2 , 0 -2 ) = 1 2 +maxpd(0 -2 , inf -inf ) = inf -2 +maxpd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +maxpd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +maxpd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +maxpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -0 +punpcklbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x0 0x80 0x1 0x7f 0x5 0x0 0x15 0x1 0x20 0x2 0x80 0x3 0xff 0x81 0x0 +punpcklwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0x8000 0x8000 0x7fff 0x7fff 0xffff 0x0 0xffff +punpckldq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x1 0x80000000 0x80000000 +ppacksswb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x80ff 0x7f 0x201 0x8003 0x7f80 0xffff 0x8050 0x80fe +pcmpgtb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0xff 0x0 0x0 0xff 0xff 0x0 0x0 0x0 0xff 0xff 0x0 0x0 0x0 0xff +pcmpgtw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0x0 0xffff 0xffff 0x0 0xffff 0xffff 0x0 +pcmpgtd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0xffffffff 0xffffffff +packuswb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0xff 0x201 0x3 0xff00 0x0 0x50 0x0 +punpckhbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xfe 0x8 0x84 0x7 0x72 0x81 0x52 0x6 0xa5 0xa 0x0 0xf 0xc0 0x10 0x32 0x1 +punpckhwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x1 0x50 0x2 0x9000 0x3 0xfffe 0x8001 0x8001 +punpckhdq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x7fffffff 0x5 0x0 0xfffffffe +ppackssdw(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x8000ffff 0x7fff 0x80000001 0xfffe0005 +punpcklqdq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0xffffffffffffffff 0x1 +punpckhqdq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x8000000000000000 0x8000000000000000 +pshufd(0xffffffff 0x80000000 0x7fffffff 0x0 0) = 0xffffffff 0xffffffff 0xffffffff 0xffffffff +pshufd(0xffffffff 0x80000000 0x7fffffff 0x0 255) = 0x0 0x0 0x0 0x0 +pshufd(0xffffffff 0x80000000 0x7fffffff 0x0 170) = 0x7fffffff 0x7fffffff 0x7fffffff 0x7fffffff +pshufd(0xffffffff 0x80000000 0x7fffffff 0x0 2) = 0x7fffffff 0xffffffff 0xffffffff 0xffffffff +psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 170) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 2) = 0x3fff 0x2000 0x1fff 0x0 0x0 0x0 0x0 0x2000 +psrld(0xffffffff 0x80000000 0x7fffffff 0x0 0) = 0xffffffff 0x80000000 0x7fffffff 0x0 +psrld(0xffffffff 0x80000000 0x7fffffff 0x0 255) = 0x0 0x0 0x0 0x0 +psrld(0xffffffff 0x80000000 0x7fffffff 0x0 170) = 0x0 0x0 0x0 0x0 +psrld(0xffffffff 0x80000000 0x7fffffff 0x0 2) = 0x3fffffff 0x20000000 0x1fffffff 0x0 +psrlq(0xffffffffffffffff 0x8000000000000000 0) = 0xffffffffffffffff 0x8000000000000000 +psrlq(0xffffffffffffffff 0x8000000000000000 255) = 0x0 0x0 +psrlq(0xffffffffffffffff 0x8000000000000000 170) = 0x0 0x0 +psrlq(0xffffffffffffffff 0x8000000000000000 2) = 0x3fffffffffffffff 0x2000000000000000 +psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 255) = 0xffff 0xffff 0x0 0x0 0x0 0x0 0x0 0xffff +psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 170) = 0xffff 0xffff 0x0 0x0 0x0 0x0 0x0 0xffff +psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 2) = 0xffff 0xe000 0x1fff 0x0 0x0 0x0 0x0 0xe000 +psrad(0xffffffff 0x80000000 0x7fffffff 0x0 0) = 0xffffffff 0x80000000 0x7fffffff 0x0 +psrad(0xffffffff 0x80000000 0x7fffffff 0x0 255) = 0xffffffff 0xffffffff 0x0 0x0 +psrad(0xffffffff 0x80000000 0x7fffffff 0x0 170) = 0xffffffff 0xffffffff 0x0 0x0 +psrad(0xffffffff 0x80000000 0x7fffffff 0x0 2) = 0xffffffff 0xe0000000 0x1fffffff 0x0 +psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 0) = 0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 +psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 255) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 170) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 2) = 0xfffc 0x0 0xfffc 0x0 0x4 0x8 0xc 0x4 +pslld(0xffffffff 0x80000000 0x7fffffff 0x0 0) = 0xffffffff 0x80000000 0x7fffffff 0x0 +pslld(0xffffffff 0x80000000 0x7fffffff 0x0 255) = 0x0 0x0 0x0 0x0 +pslld(0xffffffff 0x80000000 0x7fffffff 0x0 170) = 0x0 0x0 0x0 0x0 +pslld(0xffffffff 0x80000000 0x7fffffff 0x0 2) = 0xfffffffc 0x0 0xfffffffc 0x0 +psllq(0xffffffffffffffff 0x8000000000000000 0) = 0xffffffffffffffff 0x8000000000000000 +psllq(0xffffffffffffffff 0x8000000000000000 255) = 0x0 0x0 +psllq(0xffffffffffffffff 0x8000000000000000 170) = 0x0 0x0 +psllq(0xffffffffffffffff 0x8000000000000000 2) = 0xfffffffffffffffc 0x0 +pcmpeqb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pcmpeqw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xffff +pcmpeqd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0xffffffff 0x0 0x0 +haddpd(1 2 , 0 -2 ) = 3 -2 +haddpd(0 -2 , inf -inf ) = -2 0xfff8000000000000 +haddpd(1 2 , 0x7ff8000000000000 -0 ) = 3 0x7ff8000000000000 +haddpd(0 -2 , 0x7ff8000000000000 -0 ) = -2 0x7ff8000000000000 +haddpd(inf -inf , 0x7ff8000000000000 -0 ) = 0xfff8000000000000 0x7ff8000000000000 +haddpd(0x7ff8000000000000 -0 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 0x7ff8000000000000 +psrlw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +psrld(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0x0 +psrlq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x7fffffffffffffff 0x4000000000000000 +paddq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0x0 0x0 +pmullw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x8000 0x8001 0x0 0x50 0x2000 0xfffa 0x1 +psubusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x7f 0x7a 0x0 0x0 0x0 0x0 0x81 0xf6 0x7d 0x0 0x4c 0x9b 0x0 0xb0 0x31 +psubusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x1 0x0 0x0 0x0 0x0 0x0 0x0 +pminub(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x0 0x1 0x5 0x0 0x1 0x2 0x3 0x0 0x8 0x7 0x72 0x6 0xa 0x0 0x10 0x1 +pand(0x81030201007f80ff 0x32c000a5527284fe , 0xff802015050100 0x1100f0a06810708 ) = 0x3000000050000 0x2000408 +paddusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x81 0x84 0x15 0x21 0x82 0xff 0x81 0xff 0x8b 0xf3 0x58 0xaf 0xf 0xd0 0x33 +paddusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0xffff 0xffff 0xffff 0x51 0x9002 0xffff 0xffff +pmaxub(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x80 0x7f 0x15 0x20 0x80 0xff 0x81 0xfe 0x84 0x81 0x52 0xa5 0xf 0xc0 0x32 +pandn(0x81030201007f80ff 0x32c000a5527284fe , 0xff802015050100 0x1100f0a06810708 ) = 0xfc802015000100 0x1100f0a04810300 +pavgb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x80 0x41 0x42 0xb 0x11 0x41 0x81 0x41 0x83 0x46 0x7a 0x2c 0x58 0x8 0x68 0x1a +psraw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0xffff 0x0 0x0 0x0 0x0 0x0 0xffff +psrad(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0xffffffff 0x0 0x0 +pavgb(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xc000 0x8000 0xbfff 0x8000 0x29 0x4801 0x8001 0x8001 +pmulhuw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x3fff 0x7ffe 0x0 0x0 0x1 0x2 0x4001 +pmulhw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0xc000 0xffff 0x0 0x0 0xffff 0xffff 0x3fff +psubsb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x80 0x7a 0xeb 0xe1 0x7f 0x4 0x81 0xf6 0x80 0x7f 0x4c 0x9b 0xf1 0xb0 0x31 +psubsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x8000 0x7fff 0x1 0xffb1 0x7002 0x5 0x0 +pminsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0x8000 0xffff 0xffff 0x1 0x9000 0xfffe 0x8001 +por(0x81030201007f80ff 0x32c000a5527284fe , 0xff802015050100 0x1100f0a06810708 ) = 0x81ff8221157f81ff 0x33d00faf56f387fe +paddusb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x81 0x7f 0x15 0x21 0x82 0x2 0x81 0x6 0x8b 0xf3 0x58 0xaf 0xf 0xd0 0x33 +paddusw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x8000 0xffff 0x7ffe 0xffff 0x51 0x9002 0x1 0x8000 +pmaxsw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0xffff 0x7fff 0x7fff 0x0 0x50 0x2 0x3 0x8001 +pxor(0x81030201007f80ff 0x32c000a5527284fe , 0xff802015050100 0x1100f0a06810708 ) = 0x81fc8221157a81ff 0x33d00faf54f383f6 +psllw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 +pslld(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x0 0x0 +psllq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0xfffffffffffffffe 0x0 +pmuludq(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xffffffff 0x0 0x7ffffffb 0x2 +pmaddwd(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x0 0xc001 0x8001 0xffff 0x2050 0xffff 0xfffb 0x3ffe +psadbw(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0x27 0x4 0x0 0x0 0x0 0x0 0x0 0x0 0x59 0x3 0x0 0x0 0x0 0x0 0x0 0x0 +psubb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x7f 0x7a 0xeb 0xe1 0x82 0x4 0x81 0xf6 0x7d 0xf1 0x4c 0x9b 0xf1 0xb0 0x31 +psubw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0x1 0x8000 0x1 0xffb1 0x7002 0x5 0x0 +psubd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0xfffffffe 0x0 0x7ffffffa 0x2 +psubq(0xffffffffffffffff 0x8000000000000000 , 0x1 0x8000000000000000 ) = 0xfffffffffffffffe 0x0 +paddb(0xff 0x80 0x7f 0x0 0x1 0x2 0x3 0x81 0xfe 0x84 0x72 0x52 0xa5 0x0 0xc0 0x32 , 0x0 0x1 0x5 0x15 0x20 0x80 0xff 0x0 0x8 0x7 0x81 0x6 0xa 0xf 0x10 0x1 ) = 0xff 0x81 0x84 0x15 0x21 0x82 0x2 0x81 0x6 0x8b 0xf3 0x58 0xaf 0xf 0xd0 0x33 +paddw(0xffff 0x8000 0x7fff 0x0 0x1 0x2 0x3 0x8001 , 0x8000 0x7fff 0xffff 0xffff 0x50 0x9000 0xfffe 0x8001 ) = 0x7fff 0xffff 0x7ffe 0xffff 0x51 0x9002 0x1 0x2 +paddd(0xffffffff 0x80000000 0x7fffffff 0x0 , 0x1 0x80000000 0x5 0xfffffffe ) = 0x0 0x0 0x80000004 0xfffffffe +pmovhlps(1 2 3 -4 , 0 -2 -10 0.5 ) = -10 0.5 3 -4 +unpcklps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 0 2 -2 +unpckhps(1 2 3 -4 , 0 -2 -10 0.5 ) = 3 -10 -4 0.5 +pmovhps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 2 0 -2 +psqrtps(1 2 3 -4 ) = 1 1.41421 1.73205 nan +psqrtps(0 -2 -10 0.5 ) = 0 nan nan 0.707107 +psqrtps(inf -inf -inf 1 ) = inf nan nan 1 +psqrtps(nan -0 nan inf ) = nan -0 nan inf +prcpps(nan -0 nan inf ) = nan -inf nan 0 +andps(1 2 3 -4 , 0 -2 -10 0.5 ) = 0 2 2 0 +andps(0 -2 -10 0.5 , inf -inf -inf 1 ) = 0 -2 -8 0.5 +andps(1 2 3 -4 , nan -0 nan inf ) = 1 0 3 4 +andps(0 -2 -10 0.5 , nan -0 nan inf ) = 0 -0 -8 0.5 +andps(inf -inf -inf 1 , nan -0 nan inf ) = inf -0 -inf 1 +andps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +andnps(1 2 3 -4 , 0 -2 -10 0.5 ) = 0 -0 -2.93874e-38 0.5 +andnps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf 1 0.25 1.17549e-38 +andnps(1 2 3 -4 , nan -0 nan inf ) = 3 -0 -1 0.5 +andnps(0 -2 -10 0.5 , nan -0 nan inf ) = nan 0 0.375 4 +andnps(inf -inf -inf 1 , nan -0 nan inf ) = 5.87747e-39 0 5.87747e-39 2 +andnps(nan -0 nan inf , nan -0 nan inf ) = 0 0 0 0 +orps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 -2 -14 -inf +orps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf -inf nan 1 +orps(1 2 3 -4 , nan -0 nan inf ) = nan -2 nan -inf +orps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -2 nan inf +orps(inf -inf -inf 1 , nan -0 nan inf ) = nan -inf nan inf +orps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +xorps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 -0 -4.11423e-38 -inf +xorps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf 1 0.3125 1.17549e-38 +xorps(1 2 3 -4 , nan -0 nan inf ) = 3 -2 -1 -0.5 +xorps(0 -2 -10 0.5 , nan -0 nan inf ) = nan 2 0.4375 4 +xorps(inf -inf -inf 1 , nan -0 nan inf ) = 5.87747e-39 inf 5.87747e-39 2 +xorps(nan -0 nan inf , nan -0 nan inf ) = 0 0 0 0 +addps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 0 -7 -3.5 +addps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf -inf -inf 1.5 +addps(1 2 3 -4 , nan -0 nan inf ) = nan 2 nan inf +addps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -2 nan inf +addps(inf -inf -inf 1 , nan -0 nan inf ) = nan -inf nan inf +addps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +mulps(1 2 3 -4 , 0 -2 -10 0.5 ) = 0 -4 -30 -2 +mulps(0 -2 -10 0.5 , inf -inf -inf 1 ) = nan inf inf 0.5 +mulps(1 2 3 -4 , nan -0 nan inf ) = nan -0 nan -inf +mulps(0 -2 -10 0.5 , nan -0 nan inf ) = nan 0 nan inf +mulps(inf -inf -inf 1 , nan -0 nan inf ) = nan nan nan inf +mulps(nan -0 nan inf , nan -0 nan inf ) = nan 0 nan inf +subps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 4 13 -4.5 +subps(0 -2 -10 0.5 , inf -inf -inf 1 ) = -inf inf inf -0.5 +subps(1 2 3 -4 , nan -0 nan inf ) = nan 2 nan -inf +subps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -2 nan -inf +subps(inf -inf -inf 1 , nan -0 nan inf ) = nan -inf nan -inf +subps(nan -0 nan inf , nan -0 nan inf ) = nan 0 nan nan +minps(1 2 3 -4 , 0 -2 -10 0.5 ) = 0 -2 -10 -4 +minps(0 -2 -10 0.5 , inf -inf -inf 1 ) = 0 -inf -inf 0.5 +minps(1 2 3 -4 , nan -0 nan inf ) = nan -0 nan -4 +minps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -2 nan 0.5 +minps(inf -inf -inf 1 , nan -0 nan inf ) = nan -inf nan 1 +minps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +divps(1 2 3 -4 , 0 -2 -10 0.5 ) = inf -1 -0.3 -8 +divps(0 -2 -10 0.5 , inf -inf -inf 1 ) = 0 0 0 0.5 +divps(1 2 3 -4 , nan -0 nan inf ) = nan -inf nan -0 +divps(0 -2 -10 0.5 , nan -0 nan inf ) = nan inf nan 0 +divps(inf -inf -inf 1 , nan -0 nan inf ) = nan inf nan 0 +divps(nan -0 nan inf , nan -0 nan inf ) = nan nan nan nan +maxps(1 2 3 -4 , 0 -2 -10 0.5 ) = 1 2 3 0.5 +maxps(0 -2 -10 0.5 , inf -inf -inf 1 ) = inf -2 -10 1 +maxps(1 2 3 -4 , nan -0 nan inf ) = nan 2 nan inf +maxps(0 -2 -10 0.5 , nan -0 nan inf ) = nan -0 nan inf +maxps(inf -inf -inf 1 , nan -0 nan inf ) = nan -0 nan inf +maxps(nan -0 nan inf , nan -0 nan inf ) = nan -0 nan inf +shufps(1 2 3 -4 , 0 -2 -10 0.5 , 0) = 1 1 0 0 +shufps(0 -2 -10 0.5 , inf -inf -inf 1 , 0) = 0 0 inf inf +shufps(1 2 3 -4 , nan -0 nan inf , 0) = 1 1 nan nan +shufps(0 -2 -10 0.5 , nan -0 nan inf , 0) = 0 0 nan nan +shufps(inf -inf -inf 1 , nan -0 nan inf , 0) = inf inf nan nan +shufps(nan -0 nan inf , nan -0 nan inf , 0) = nan nan nan nan +shufps(1 2 3 -4 , 0 -2 -10 0.5 , 21) = 2 2 -2 0 +shufps(0 -2 -10 0.5 , inf -inf -inf 1 , 21) = -2 -2 -inf inf +shufps(1 2 3 -4 , nan -0 nan inf , 21) = 2 2 -0 nan +shufps(0 -2 -10 0.5 , nan -0 nan inf , 21) = -2 -2 -0 nan +shufps(inf -inf -inf 1 , nan -0 nan inf , 21) = -inf -inf -0 nan +shufps(nan -0 nan inf , nan -0 nan inf , 21) = -0 -0 -0 nan +shufps(1 2 3 -4 , 0 -2 -10 0.5 , 255) = -4 -4 0.5 0.5 +shufps(0 -2 -10 0.5 , inf -inf -inf 1 , 255) = 0.5 0.5 1 1 +shufps(1 2 3 -4 , nan -0 nan inf , 255) = -4 -4 inf inf +shufps(0 -2 -10 0.5 , nan -0 nan inf , 255) = 0.5 0.5 inf inf +shufps(inf -inf -inf 1 , nan -0 nan inf , 255) = 1 1 inf inf +shufps(nan -0 nan inf , nan -0 nan inf , 255) = inf inf inf inf +shufps(1 2 3 -4 , 0 -2 -10 0.5 , 2) = 3 1 0 0 +shufps(0 -2 -10 0.5 , inf -inf -inf 1 , 2) = -10 0 inf inf +shufps(1 2 3 -4 , nan -0 nan inf , 2) = 3 1 nan nan +shufps(0 -2 -10 0.5 , nan -0 nan inf , 2) = -10 0 nan nan +shufps(inf -inf -inf 1 , nan -0 nan inf , 2) = -inf inf nan nan +shufps(nan -0 nan inf , nan -0 nan inf , 2) = nan nan nan nan +sqrtsd(1 2 , 1 2 ) = 1 2 +sqrtsd(1 2 , 0 -2 ) = 0 2 +sqrtsd(1 2 , inf -inf ) = inf 2 +sqrtsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +sqrtsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +sqrtsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +sqrtsd(1 2 , 2 1 ) = 1.41421 2 +sqrtsd(1 2 , -2 0 ) = 0xfff8000000000000 2 +sqrtsd(1 2 , -inf inf ) = 0xfff8000000000000 2 +sqrtsd(1 2 , -0 0x7ff8000000000000 ) = -0 2 +sqrtsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +sqrtsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +addsd(1 2 , 1 2 ) = 2 2 +addsd(1 2 , 0 -2 ) = 1 2 +addsd(1 2 , inf -inf ) = inf 2 +addsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +addsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +addsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +addsd(1 2 , 2 1 ) = 3 2 +addsd(1 2 , -2 0 ) = -1 2 +addsd(1 2 , -inf inf ) = -inf 2 +addsd(1 2 , -0 0x7ff8000000000000 ) = 1 2 +addsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2 +addsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2 +mulsd(1 2 , 1 2 ) = 1 2 +mulsd(1 2 , 0 -2 ) = 0 2 +mulsd(1 2 , inf -inf ) = inf 2 +mulsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +mulsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +mulsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +mulsd(1 2 , 2 1 ) = 2 2 +mulsd(1 2 , -2 0 ) = -2 2 +mulsd(1 2 , -inf inf ) = -inf 2 +mulsd(1 2 , -0 0x7ff8000000000000 ) = -0 2 +mulsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +mulsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +subsd(1 2 , 1 2 ) = 0 2 +subsd(1 2 , 0 -2 ) = 1 2 +subsd(1 2 , inf -inf ) = -inf 2 +subsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +subsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +subsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +subsd(1 2 , 2 1 ) = -1 2 +subsd(1 2 , -2 0 ) = 3 2 +subsd(1 2 , -inf inf ) = inf 2 +subsd(1 2 , -0 0x7ff8000000000000 ) = 1 2 +subsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2 +subsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2 +minsd(1 2 , 1 2 ) = 1 2 +minsd(1 2 , 0 -2 ) = 0 2 +minsd(1 2 , inf -inf ) = 1 2 +minsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +minsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +minsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +minsd(1 2 , 2 1 ) = 1 2 +minsd(1 2 , -2 0 ) = -2 2 +minsd(1 2 , -inf inf ) = -inf 2 +minsd(1 2 , -0 0x7ff8000000000000 ) = -0 2 +minsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +minsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +divsd(1 2 , 1 2 ) = 1 2 +divsd(1 2 , 0 -2 ) = inf 2 +divsd(1 2 , inf -inf ) = 0 2 +divsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +divsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +divsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +divsd(1 2 , 2 1 ) = 0.5 2 +divsd(1 2 , -2 0 ) = -0.5 2 +divsd(1 2 , -inf inf ) = -0 2 +divsd(1 2 , -0 0x7ff8000000000000 ) = -inf 2 +divsd(0 -2 , -0 0x7ff8000000000000 ) = 0xfff8000000000000 -2 +divsd(0 -2 , -0 0x7ff8000000000000 ) = 0xfff8000000000000 -2 +maxsd(1 2 , 1 2 ) = 1 2 +maxsd(1 2 , 0 -2 ) = 1 2 +maxsd(1 2 , inf -inf ) = inf 2 +maxsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +maxsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 +maxsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf +maxsd(1 2 , 2 1 ) = 2 2 +maxsd(1 2 , -2 0 ) = 1 2 +maxsd(1 2 , -inf inf ) = 1 2 +maxsd(1 2 , -0 0x7ff8000000000000 ) = 1 2 +maxsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2 +maxsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2 +cvtps2dq(1 2 3 -4 ) = 0x1 0x2 0x3 0xfffffffc +cvtps2dq(0 -2 -10 0.5 ) = 0x0 0xfffffffe 0xfffffff6 0x0 +cvtps2dq(inf -inf -inf 1 ) = 0x80000000 0x80000000 0x80000000 0x1 +cvtps2dq(nan -0 nan inf ) = 0x80000000 0x0 0x80000000 0x80000000 +dpps(1 2 3 -4 , 0 -2 -10 0.5 , 255) = -36 -36 -36 -36 +dpps(0 -2 -10 0.5 , inf -inf -inf 1 , 255) = nan nan nan nan +dpps(1 2 3 -4 , nan -0 nan inf , 255) = nan nan nan nan +dpps(0 -2 -10 0.5 , nan -0 nan inf , 255) = nan nan nan nan +dpps(inf -inf -inf 1 , nan -0 nan inf , 255) = nan nan nan nan +dpps(nan -0 nan inf , nan -0 nan inf , 255) = nan nan nan nan +dpps(1 2 3 -4 , 0 -2 -10 0.5 , 63) = -4 -4 -4 -4 +dpps(0 -2 -10 0.5 , inf -inf -inf 1 , 63) = nan nan nan nan +dpps(1 2 3 -4 , nan -0 nan inf , 63) = nan nan nan nan +dpps(0 -2 -10 0.5 , nan -0 nan inf , 63) = nan nan nan nan +dpps(inf -inf -inf 1 , nan -0 nan inf , 63) = nan nan nan nan +dpps(nan -0 nan inf , nan -0 nan inf , 63) = nan nan nan nan +dpps(1 2 3 -4 , 0 -2 -10 0.5 , 243) = -36 -36 0 0 +dpps(0 -2 -10 0.5 , inf -inf -inf 1 , 243) = nan nan 0 0 +dpps(1 2 3 -4 , nan -0 nan inf , 243) = nan nan 0 0 +dpps(0 -2 -10 0.5 , nan -0 nan inf , 243) = nan nan 0 0 +dpps(inf -inf -inf 1 , nan -0 nan inf , 243) = nan nan 0 0 +dpps(nan -0 nan inf , nan -0 nan inf , 243) = nan nan 0 0 +dpps(1 2 3 -4 , 0 -2 -10 0.5 , 83) = -30 -30 0 0 +dpps(0 -2 -10 0.5 , inf -inf -inf 1 , 83) = nan nan 0 0 +dpps(1 2 3 -4 , nan -0 nan inf , 83) = nan nan 0 0 +dpps(0 -2 -10 0.5 , nan -0 nan inf , 83) = nan nan 0 0 +dpps(inf -inf -inf 1 , nan -0 nan inf , 83) = nan nan 0 0 +dpps(nan -0 nan inf , nan -0 nan inf , 83) = nan nan 0 0 diff --git a/tests32/ref18.txt b/tests32/ref18.txt new file mode 100644 index 0000000..38e983c --- /dev/null +++ b/tests32/ref18.txt @@ -0,0 +1,2 @@ +sig = 11 +got bad_ptr diff --git a/tests32/ref19.txt b/tests32/ref19.txt new file mode 100644 index 0000000..15300d7 --- /dev/null +++ b/tests32/ref19.txt @@ -0,0 +1,898 @@ +FUCOMI 0x0 0x0 Z-- +FUCOMPP 0x0 0x0 Z-- +FUCOMI 0x0 0x4082c00000000000 --C +FUCOMPP 0x0 0x4082c00000000000 --C +FUCOMI 0x0 0x8000000000000000 Z-- +FUCOMPP 0x0 0x8000000000000000 Z-- +FUCOMI 0x0 0x40dfffc000000000 --C +FUCOMPP 0x0 0x40dfffc000000000 --C +FUCOMI 0x0 0x40e0002000000000 --C +FUCOMPP 0x0 0x40e0002000000000 --C +FUCOMI 0x0 0xc0e0002000000000 --- +FUCOMPP 0x0 0xc0e0002000000000 --- +FUCOMI 0x0 0xc0dfffc000000000 --- +FUCOMPP 0x0 0xc0dfffc000000000 --- +FUCOMI 0x0 0x3ff0000000000000 --C +FUCOMPP 0x0 0x3ff0000000000000 --C +FUCOMI 0x0 0x3fe89d9000000000 --C +FUCOMPP 0x0 0x3fe89d9000000000 --C +FUCOMI 0x0 0x7ff0000000000000 --C +FUCOMPP 0x0 0x7ff0000000000000 --C +FUCOMI 0x0 0xfff0000000000000 --- +FUCOMPP 0x0 0xfff0000000000000 --- +FUCOMI 0x0 0x3ff0002ca0000000 --C +FUCOMPP 0x0 0x3ff0002ca0000000 --C +FUCOMI 0x0 0xaeff000025000000 --- +FUCOMPP 0x0 0xaeff000025000000 --- +FUCOMI 0x0 0x3ff0000050000000 --C +FUCOMPP 0x0 0x3ff0000050000000 --C +FUCOMI 0x0 0xc082c00000000000 --- +FUCOMPP 0x0 0xc082c00000000000 --- +FUCOMI 0x0 0x7ff8000000000001 ZPC +FUCOMPP 0x0 0x7ff8000000000001 ZPC +FUCOMI 0x4082c00000000000 0x0 --- +FUCOMPP 0x4082c00000000000 0x0 --- +FUCOMI 0x4082c00000000000 0x4082c00000000000 Z-- +FUCOMPP 0x4082c00000000000 0x4082c00000000000 Z-- +FUCOMI 0x4082c00000000000 0x8000000000000000 --- +FUCOMPP 0x4082c00000000000 0x8000000000000000 --- +FUCOMI 0x4082c00000000000 0x40dfffc000000000 --C +FUCOMPP 0x4082c00000000000 0x40dfffc000000000 --C +FUCOMI 0x4082c00000000000 0x40e0002000000000 --C +FUCOMPP 0x4082c00000000000 0x40e0002000000000 --C +FUCOMI 0x4082c00000000000 0xc0e0002000000000 --- +FUCOMPP 0x4082c00000000000 0xc0e0002000000000 --- +FUCOMI 0x4082c00000000000 0xc0dfffc000000000 --- +FUCOMPP 0x4082c00000000000 0xc0dfffc000000000 --- +FUCOMI 0x4082c00000000000 0x3ff0000000000000 --- +FUCOMPP 0x4082c00000000000 0x3ff0000000000000 --- +FUCOMI 0x4082c00000000000 0x3fe89d9000000000 --- +FUCOMPP 0x4082c00000000000 0x3fe89d9000000000 --- +FUCOMI 0x4082c00000000000 0x7ff0000000000000 --C +FUCOMPP 0x4082c00000000000 0x7ff0000000000000 --C +FUCOMI 0x4082c00000000000 0xfff0000000000000 --- +FUCOMPP 0x4082c00000000000 0xfff0000000000000 --- +FUCOMI 0x4082c00000000000 0x3ff0002ca0000000 --- +FUCOMPP 0x4082c00000000000 0x3ff0002ca0000000 --- +FUCOMI 0x4082c00000000000 0xaeff000025000000 --- +FUCOMPP 0x4082c00000000000 0xaeff000025000000 --- +FUCOMI 0x4082c00000000000 0x3ff0000050000000 --- +FUCOMPP 0x4082c00000000000 0x3ff0000050000000 --- +FUCOMI 0x4082c00000000000 0xc082c00000000000 --- +FUCOMPP 0x4082c00000000000 0xc082c00000000000 --- +FUCOMI 0x4082c00000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x4082c00000000000 0x7ff8000000000001 ZPC +FUCOMI 0x8000000000000000 0x0 Z-- +FUCOMPP 0x8000000000000000 0x0 Z-- +FUCOMI 0x8000000000000000 0x4082c00000000000 --C +FUCOMPP 0x8000000000000000 0x4082c00000000000 --C +FUCOMI 0x8000000000000000 0x8000000000000000 Z-- +FUCOMPP 0x8000000000000000 0x8000000000000000 Z-- +FUCOMI 0x8000000000000000 0x40dfffc000000000 --C +FUCOMPP 0x8000000000000000 0x40dfffc000000000 --C +FUCOMI 0x8000000000000000 0x40e0002000000000 --C +FUCOMPP 0x8000000000000000 0x40e0002000000000 --C +FUCOMI 0x8000000000000000 0xc0e0002000000000 --- +FUCOMPP 0x8000000000000000 0xc0e0002000000000 --- +FUCOMI 0x8000000000000000 0xc0dfffc000000000 --- +FUCOMPP 0x8000000000000000 0xc0dfffc000000000 --- +FUCOMI 0x8000000000000000 0x3ff0000000000000 --C +FUCOMPP 0x8000000000000000 0x3ff0000000000000 --C +FUCOMI 0x8000000000000000 0x3fe89d9000000000 --C +FUCOMPP 0x8000000000000000 0x3fe89d9000000000 --C +FUCOMI 0x8000000000000000 0x7ff0000000000000 --C +FUCOMPP 0x8000000000000000 0x7ff0000000000000 --C +FUCOMI 0x8000000000000000 0xfff0000000000000 --- +FUCOMPP 0x8000000000000000 0xfff0000000000000 --- +FUCOMI 0x8000000000000000 0x3ff0002ca0000000 --C +FUCOMPP 0x8000000000000000 0x3ff0002ca0000000 --C +FUCOMI 0x8000000000000000 0xaeff000025000000 --- +FUCOMPP 0x8000000000000000 0xaeff000025000000 --- +FUCOMI 0x8000000000000000 0x3ff0000050000000 --C +FUCOMPP 0x8000000000000000 0x3ff0000050000000 --C +FUCOMI 0x8000000000000000 0xc082c00000000000 --- +FUCOMPP 0x8000000000000000 0xc082c00000000000 --- +FUCOMI 0x8000000000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x8000000000000000 0x7ff8000000000001 ZPC +FUCOMI 0x40dfffc000000000 0x0 --- +FUCOMPP 0x40dfffc000000000 0x0 --- +FUCOMI 0x40dfffc000000000 0x4082c00000000000 --- +FUCOMPP 0x40dfffc000000000 0x4082c00000000000 --- +FUCOMI 0x40dfffc000000000 0x8000000000000000 --- +FUCOMPP 0x40dfffc000000000 0x8000000000000000 --- +FUCOMI 0x40dfffc000000000 0x40dfffc000000000 Z-- +FUCOMPP 0x40dfffc000000000 0x40dfffc000000000 Z-- +FUCOMI 0x40dfffc000000000 0x40e0002000000000 --C +FUCOMPP 0x40dfffc000000000 0x40e0002000000000 --C +FUCOMI 0x40dfffc000000000 0xc0e0002000000000 --- +FUCOMPP 0x40dfffc000000000 0xc0e0002000000000 --- +FUCOMI 0x40dfffc000000000 0xc0dfffc000000000 --- +FUCOMPP 0x40dfffc000000000 0xc0dfffc000000000 --- +FUCOMI 0x40dfffc000000000 0x3ff0000000000000 --- +FUCOMPP 0x40dfffc000000000 0x3ff0000000000000 --- +FUCOMI 0x40dfffc000000000 0x3fe89d9000000000 --- +FUCOMPP 0x40dfffc000000000 0x3fe89d9000000000 --- +FUCOMI 0x40dfffc000000000 0x7ff0000000000000 --C +FUCOMPP 0x40dfffc000000000 0x7ff0000000000000 --C +FUCOMI 0x40dfffc000000000 0xfff0000000000000 --- +FUCOMPP 0x40dfffc000000000 0xfff0000000000000 --- +FUCOMI 0x40dfffc000000000 0x3ff0002ca0000000 --- +FUCOMPP 0x40dfffc000000000 0x3ff0002ca0000000 --- +FUCOMI 0x40dfffc000000000 0xaeff000025000000 --- +FUCOMPP 0x40dfffc000000000 0xaeff000025000000 --- +FUCOMI 0x40dfffc000000000 0x3ff0000050000000 --- +FUCOMPP 0x40dfffc000000000 0x3ff0000050000000 --- +FUCOMI 0x40dfffc000000000 0xc082c00000000000 --- +FUCOMPP 0x40dfffc000000000 0xc082c00000000000 --- +FUCOMI 0x40dfffc000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x40dfffc000000000 0x7ff8000000000001 ZPC +FUCOMI 0x40e0002000000000 0x0 --- +FUCOMPP 0x40e0002000000000 0x0 --- +FUCOMI 0x40e0002000000000 0x4082c00000000000 --- +FUCOMPP 0x40e0002000000000 0x4082c00000000000 --- +FUCOMI 0x40e0002000000000 0x8000000000000000 --- +FUCOMPP 0x40e0002000000000 0x8000000000000000 --- +FUCOMI 0x40e0002000000000 0x40dfffc000000000 --- +FUCOMPP 0x40e0002000000000 0x40dfffc000000000 --- +FUCOMI 0x40e0002000000000 0x40e0002000000000 Z-- +FUCOMPP 0x40e0002000000000 0x40e0002000000000 Z-- +FUCOMI 0x40e0002000000000 0xc0e0002000000000 --- +FUCOMPP 0x40e0002000000000 0xc0e0002000000000 --- +FUCOMI 0x40e0002000000000 0xc0dfffc000000000 --- +FUCOMPP 0x40e0002000000000 0xc0dfffc000000000 --- +FUCOMI 0x40e0002000000000 0x3ff0000000000000 --- +FUCOMPP 0x40e0002000000000 0x3ff0000000000000 --- +FUCOMI 0x40e0002000000000 0x3fe89d9000000000 --- +FUCOMPP 0x40e0002000000000 0x3fe89d9000000000 --- +FUCOMI 0x40e0002000000000 0x7ff0000000000000 --C +FUCOMPP 0x40e0002000000000 0x7ff0000000000000 --C +FUCOMI 0x40e0002000000000 0xfff0000000000000 --- +FUCOMPP 0x40e0002000000000 0xfff0000000000000 --- +FUCOMI 0x40e0002000000000 0x3ff0002ca0000000 --- +FUCOMPP 0x40e0002000000000 0x3ff0002ca0000000 --- +FUCOMI 0x40e0002000000000 0xaeff000025000000 --- +FUCOMPP 0x40e0002000000000 0xaeff000025000000 --- +FUCOMI 0x40e0002000000000 0x3ff0000050000000 --- +FUCOMPP 0x40e0002000000000 0x3ff0000050000000 --- +FUCOMI 0x40e0002000000000 0xc082c00000000000 --- +FUCOMPP 0x40e0002000000000 0xc082c00000000000 --- +FUCOMI 0x40e0002000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x40e0002000000000 0x7ff8000000000001 ZPC +FUCOMI 0xc0e0002000000000 0x0 --C +FUCOMPP 0xc0e0002000000000 0x0 --C +FUCOMI 0xc0e0002000000000 0x4082c00000000000 --C +FUCOMPP 0xc0e0002000000000 0x4082c00000000000 --C +FUCOMI 0xc0e0002000000000 0x8000000000000000 --C +FUCOMPP 0xc0e0002000000000 0x8000000000000000 --C +FUCOMI 0xc0e0002000000000 0x40dfffc000000000 --C +FUCOMPP 0xc0e0002000000000 0x40dfffc000000000 --C +FUCOMI 0xc0e0002000000000 0x40e0002000000000 --C +FUCOMPP 0xc0e0002000000000 0x40e0002000000000 --C +FUCOMI 0xc0e0002000000000 0xc0e0002000000000 Z-- +FUCOMPP 0xc0e0002000000000 0xc0e0002000000000 Z-- +FUCOMI 0xc0e0002000000000 0xc0dfffc000000000 --C +FUCOMPP 0xc0e0002000000000 0xc0dfffc000000000 --C +FUCOMI 0xc0e0002000000000 0x3ff0000000000000 --C +FUCOMPP 0xc0e0002000000000 0x3ff0000000000000 --C +FUCOMI 0xc0e0002000000000 0x3fe89d9000000000 --C +FUCOMPP 0xc0e0002000000000 0x3fe89d9000000000 --C +FUCOMI 0xc0e0002000000000 0x7ff0000000000000 --C +FUCOMPP 0xc0e0002000000000 0x7ff0000000000000 --C +FUCOMI 0xc0e0002000000000 0xfff0000000000000 --- +FUCOMPP 0xc0e0002000000000 0xfff0000000000000 --- +FUCOMI 0xc0e0002000000000 0x3ff0002ca0000000 --C +FUCOMPP 0xc0e0002000000000 0x3ff0002ca0000000 --C +FUCOMI 0xc0e0002000000000 0xaeff000025000000 --C +FUCOMPP 0xc0e0002000000000 0xaeff000025000000 --C +FUCOMI 0xc0e0002000000000 0x3ff0000050000000 --C +FUCOMPP 0xc0e0002000000000 0x3ff0000050000000 --C +FUCOMI 0xc0e0002000000000 0xc082c00000000000 --C +FUCOMPP 0xc0e0002000000000 0xc082c00000000000 --C +FUCOMI 0xc0e0002000000000 0x7ff8000000000001 ZPC +FUCOMPP 0xc0e0002000000000 0x7ff8000000000001 ZPC +FUCOMI 0xc0dfffc000000000 0x0 --C +FUCOMPP 0xc0dfffc000000000 0x0 --C +FUCOMI 0xc0dfffc000000000 0x4082c00000000000 --C +FUCOMPP 0xc0dfffc000000000 0x4082c00000000000 --C +FUCOMI 0xc0dfffc000000000 0x8000000000000000 --C +FUCOMPP 0xc0dfffc000000000 0x8000000000000000 --C +FUCOMI 0xc0dfffc000000000 0x40dfffc000000000 --C +FUCOMPP 0xc0dfffc000000000 0x40dfffc000000000 --C +FUCOMI 0xc0dfffc000000000 0x40e0002000000000 --C +FUCOMPP 0xc0dfffc000000000 0x40e0002000000000 --C +FUCOMI 0xc0dfffc000000000 0xc0e0002000000000 --- +FUCOMPP 0xc0dfffc000000000 0xc0e0002000000000 --- +FUCOMI 0xc0dfffc000000000 0xc0dfffc000000000 Z-- +FUCOMPP 0xc0dfffc000000000 0xc0dfffc000000000 Z-- +FUCOMI 0xc0dfffc000000000 0x3ff0000000000000 --C +FUCOMPP 0xc0dfffc000000000 0x3ff0000000000000 --C +FUCOMI 0xc0dfffc000000000 0x3fe89d9000000000 --C +FUCOMPP 0xc0dfffc000000000 0x3fe89d9000000000 --C +FUCOMI 0xc0dfffc000000000 0x7ff0000000000000 --C +FUCOMPP 0xc0dfffc000000000 0x7ff0000000000000 --C +FUCOMI 0xc0dfffc000000000 0xfff0000000000000 --- +FUCOMPP 0xc0dfffc000000000 0xfff0000000000000 --- +FUCOMI 0xc0dfffc000000000 0x3ff0002ca0000000 --C +FUCOMPP 0xc0dfffc000000000 0x3ff0002ca0000000 --C +FUCOMI 0xc0dfffc000000000 0xaeff000025000000 --C +FUCOMPP 0xc0dfffc000000000 0xaeff000025000000 --C +FUCOMI 0xc0dfffc000000000 0x3ff0000050000000 --C +FUCOMPP 0xc0dfffc000000000 0x3ff0000050000000 --C +FUCOMI 0xc0dfffc000000000 0xc082c00000000000 --C +FUCOMPP 0xc0dfffc000000000 0xc082c00000000000 --C +FUCOMI 0xc0dfffc000000000 0x7ff8000000000001 ZPC +FUCOMPP 0xc0dfffc000000000 0x7ff8000000000001 ZPC +FUCOMI 0x3ff0000000000000 0x0 --- +FUCOMPP 0x3ff0000000000000 0x0 --- +FUCOMI 0x3ff0000000000000 0x4082c00000000000 --C +FUCOMPP 0x3ff0000000000000 0x4082c00000000000 --C +FUCOMI 0x3ff0000000000000 0x8000000000000000 --- +FUCOMPP 0x3ff0000000000000 0x8000000000000000 --- +FUCOMI 0x3ff0000000000000 0x40dfffc000000000 --C +FUCOMPP 0x3ff0000000000000 0x40dfffc000000000 --C +FUCOMI 0x3ff0000000000000 0x40e0002000000000 --C +FUCOMPP 0x3ff0000000000000 0x40e0002000000000 --C +FUCOMI 0x3ff0000000000000 0xc0e0002000000000 --- +FUCOMPP 0x3ff0000000000000 0xc0e0002000000000 --- +FUCOMI 0x3ff0000000000000 0xc0dfffc000000000 --- +FUCOMPP 0x3ff0000000000000 0xc0dfffc000000000 --- +FUCOMI 0x3ff0000000000000 0x3ff0000000000000 Z-- +FUCOMPP 0x3ff0000000000000 0x3ff0000000000000 Z-- +FUCOMI 0x3ff0000000000000 0x3fe89d9000000000 --- +FUCOMPP 0x3ff0000000000000 0x3fe89d9000000000 --- +FUCOMI 0x3ff0000000000000 0x7ff0000000000000 --C +FUCOMPP 0x3ff0000000000000 0x7ff0000000000000 --C +FUCOMI 0x3ff0000000000000 0xfff0000000000000 --- +FUCOMPP 0x3ff0000000000000 0xfff0000000000000 --- +FUCOMI 0x3ff0000000000000 0x3ff0002ca0000000 --C +FUCOMPP 0x3ff0000000000000 0x3ff0002ca0000000 --C +FUCOMI 0x3ff0000000000000 0xaeff000025000000 --- +FUCOMPP 0x3ff0000000000000 0xaeff000025000000 --- +FUCOMI 0x3ff0000000000000 0x3ff0000050000000 --C +FUCOMPP 0x3ff0000000000000 0x3ff0000050000000 --C +FUCOMI 0x3ff0000000000000 0xc082c00000000000 --- +FUCOMPP 0x3ff0000000000000 0xc082c00000000000 --- +FUCOMI 0x3ff0000000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x3ff0000000000000 0x7ff8000000000001 ZPC +FUCOMI 0x3fe89d9000000000 0x0 --- +FUCOMPP 0x3fe89d9000000000 0x0 --- +FUCOMI 0x3fe89d9000000000 0x4082c00000000000 --C +FUCOMPP 0x3fe89d9000000000 0x4082c00000000000 --C +FUCOMI 0x3fe89d9000000000 0x8000000000000000 --- +FUCOMPP 0x3fe89d9000000000 0x8000000000000000 --- +FUCOMI 0x3fe89d9000000000 0x40dfffc000000000 --C +FUCOMPP 0x3fe89d9000000000 0x40dfffc000000000 --C +FUCOMI 0x3fe89d9000000000 0x40e0002000000000 --C +FUCOMPP 0x3fe89d9000000000 0x40e0002000000000 --C +FUCOMI 0x3fe89d9000000000 0xc0e0002000000000 --- +FUCOMPP 0x3fe89d9000000000 0xc0e0002000000000 --- +FUCOMI 0x3fe89d9000000000 0xc0dfffc000000000 --- +FUCOMPP 0x3fe89d9000000000 0xc0dfffc000000000 --- +FUCOMI 0x3fe89d9000000000 0x3ff0000000000000 --C +FUCOMPP 0x3fe89d9000000000 0x3ff0000000000000 --C +FUCOMI 0x3fe89d9000000000 0x3fe89d9000000000 Z-- +FUCOMPP 0x3fe89d9000000000 0x3fe89d9000000000 Z-- +FUCOMI 0x3fe89d9000000000 0x7ff0000000000000 --C +FUCOMPP 0x3fe89d9000000000 0x7ff0000000000000 --C +FUCOMI 0x3fe89d9000000000 0xfff0000000000000 --- +FUCOMPP 0x3fe89d9000000000 0xfff0000000000000 --- +FUCOMI 0x3fe89d9000000000 0x3ff0002ca0000000 --C +FUCOMPP 0x3fe89d9000000000 0x3ff0002ca0000000 --C +FUCOMI 0x3fe89d9000000000 0xaeff000025000000 --- +FUCOMPP 0x3fe89d9000000000 0xaeff000025000000 --- +FUCOMI 0x3fe89d9000000000 0x3ff0000050000000 --C +FUCOMPP 0x3fe89d9000000000 0x3ff0000050000000 --C +FUCOMI 0x3fe89d9000000000 0xc082c00000000000 --- +FUCOMPP 0x3fe89d9000000000 0xc082c00000000000 --- +FUCOMI 0x3fe89d9000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x3fe89d9000000000 0x7ff8000000000001 ZPC +FUCOMI 0x7ff0000000000000 0x0 --- +FUCOMPP 0x7ff0000000000000 0x0 --- +FUCOMI 0x7ff0000000000000 0x4082c00000000000 --- +FUCOMPP 0x7ff0000000000000 0x4082c00000000000 --- +FUCOMI 0x7ff0000000000000 0x8000000000000000 --- +FUCOMPP 0x7ff0000000000000 0x8000000000000000 --- +FUCOMI 0x7ff0000000000000 0x40dfffc000000000 --- +FUCOMPP 0x7ff0000000000000 0x40dfffc000000000 --- +FUCOMI 0x7ff0000000000000 0x40e0002000000000 --- +FUCOMPP 0x7ff0000000000000 0x40e0002000000000 --- +FUCOMI 0x7ff0000000000000 0xc0e0002000000000 --- +FUCOMPP 0x7ff0000000000000 0xc0e0002000000000 --- +FUCOMI 0x7ff0000000000000 0xc0dfffc000000000 --- +FUCOMPP 0x7ff0000000000000 0xc0dfffc000000000 --- +FUCOMI 0x7ff0000000000000 0x3ff0000000000000 --- +FUCOMPP 0x7ff0000000000000 0x3ff0000000000000 --- +FUCOMI 0x7ff0000000000000 0x3fe89d9000000000 --- +FUCOMPP 0x7ff0000000000000 0x3fe89d9000000000 --- +FUCOMI 0x7ff0000000000000 0x7ff0000000000000 Z-- +FUCOMPP 0x7ff0000000000000 0x7ff0000000000000 Z-- +FUCOMI 0x7ff0000000000000 0xfff0000000000000 --- +FUCOMPP 0x7ff0000000000000 0xfff0000000000000 --- +FUCOMI 0x7ff0000000000000 0x3ff0002ca0000000 --- +FUCOMPP 0x7ff0000000000000 0x3ff0002ca0000000 --- +FUCOMI 0x7ff0000000000000 0xaeff000025000000 --- +FUCOMPP 0x7ff0000000000000 0xaeff000025000000 --- +FUCOMI 0x7ff0000000000000 0x3ff0000050000000 --- +FUCOMPP 0x7ff0000000000000 0x3ff0000050000000 --- +FUCOMI 0x7ff0000000000000 0xc082c00000000000 --- +FUCOMPP 0x7ff0000000000000 0xc082c00000000000 --- +FUCOMI 0x7ff0000000000000 0x7ff8000000000001 ZPC +FUCOMPP 0x7ff0000000000000 0x7ff8000000000001 ZPC +FUCOMI 0xfff0000000000000 0x0 --C +FUCOMPP 0xfff0000000000000 0x0 --C +FUCOMI 0xfff0000000000000 0x4082c00000000000 --C +FUCOMPP 0xfff0000000000000 0x4082c00000000000 --C +FUCOMI 0xfff0000000000000 0x8000000000000000 --C +FUCOMPP 0xfff0000000000000 0x8000000000000000 --C +FUCOMI 0xfff0000000000000 0x40dfffc000000000 --C +FUCOMPP 0xfff0000000000000 0x40dfffc000000000 --C +FUCOMI 0xfff0000000000000 0x40e0002000000000 --C +FUCOMPP 0xfff0000000000000 0x40e0002000000000 --C +FUCOMI 0xfff0000000000000 0xc0e0002000000000 --C +FUCOMPP 0xfff0000000000000 0xc0e0002000000000 --C +FUCOMI 0xfff0000000000000 0xc0dfffc000000000 --C +FUCOMPP 0xfff0000000000000 0xc0dfffc000000000 --C +FUCOMI 0xfff0000000000000 0x3ff0000000000000 --C +FUCOMPP 0xfff0000000000000 0x3ff0000000000000 --C +FUCOMI 0xfff0000000000000 0x3fe89d9000000000 --C +FUCOMPP 0xfff0000000000000 0x3fe89d9000000000 --C +FUCOMI 0xfff0000000000000 0x7ff0000000000000 --C +FUCOMPP 0xfff0000000000000 0x7ff0000000000000 --C +FUCOMI 0xfff0000000000000 0xfff0000000000000 Z-- +FUCOMPP 0xfff0000000000000 0xfff0000000000000 Z-- +FUCOMI 0xfff0000000000000 0x3ff0002ca0000000 --C +FUCOMPP 0xfff0000000000000 0x3ff0002ca0000000 --C +FUCOMI 0xfff0000000000000 0xaeff000025000000 --C +FUCOMPP 0xfff0000000000000 0xaeff000025000000 --C +FUCOMI 0xfff0000000000000 0x3ff0000050000000 --C +FUCOMPP 0xfff0000000000000 0x3ff0000050000000 --C +FUCOMI 0xfff0000000000000 0xc082c00000000000 --C +FUCOMPP 0xfff0000000000000 0xc082c00000000000 --C +FUCOMI 0xfff0000000000000 0x7ff8000000000001 ZPC +FUCOMPP 0xfff0000000000000 0x7ff8000000000001 ZPC +FUCOMI 0x3ff0002ca0000000 0x0 --- +FUCOMPP 0x3ff0002ca0000000 0x0 --- +FUCOMI 0x3ff0002ca0000000 0x4082c00000000000 --C +FUCOMPP 0x3ff0002ca0000000 0x4082c00000000000 --C +FUCOMI 0x3ff0002ca0000000 0x8000000000000000 --- +FUCOMPP 0x3ff0002ca0000000 0x8000000000000000 --- +FUCOMI 0x3ff0002ca0000000 0x40dfffc000000000 --C +FUCOMPP 0x3ff0002ca0000000 0x40dfffc000000000 --C +FUCOMI 0x3ff0002ca0000000 0x40e0002000000000 --C +FUCOMPP 0x3ff0002ca0000000 0x40e0002000000000 --C +FUCOMI 0x3ff0002ca0000000 0xc0e0002000000000 --- +FUCOMPP 0x3ff0002ca0000000 0xc0e0002000000000 --- +FUCOMI 0x3ff0002ca0000000 0xc0dfffc000000000 --- +FUCOMPP 0x3ff0002ca0000000 0xc0dfffc000000000 --- +FUCOMI 0x3ff0002ca0000000 0x3ff0000000000000 --- +FUCOMPP 0x3ff0002ca0000000 0x3ff0000000000000 --- +FUCOMI 0x3ff0002ca0000000 0x3fe89d9000000000 --- +FUCOMPP 0x3ff0002ca0000000 0x3fe89d9000000000 --- +FUCOMI 0x3ff0002ca0000000 0x7ff0000000000000 --C +FUCOMPP 0x3ff0002ca0000000 0x7ff0000000000000 --C +FUCOMI 0x3ff0002ca0000000 0xfff0000000000000 --- +FUCOMPP 0x3ff0002ca0000000 0xfff0000000000000 --- +FUCOMI 0x3ff0002ca0000000 0x3ff0002ca0000000 Z-- +FUCOMPP 0x3ff0002ca0000000 0x3ff0002ca0000000 Z-- +FUCOMI 0x3ff0002ca0000000 0xaeff000025000000 --- +FUCOMPP 0x3ff0002ca0000000 0xaeff000025000000 --- +FUCOMI 0x3ff0002ca0000000 0x3ff0000050000000 --- +FUCOMPP 0x3ff0002ca0000000 0x3ff0000050000000 --- +FUCOMI 0x3ff0002ca0000000 0xc082c00000000000 --- +FUCOMPP 0x3ff0002ca0000000 0xc082c00000000000 --- +FUCOMI 0x3ff0002ca0000000 0x7ff8000000000001 ZPC +FUCOMPP 0x3ff0002ca0000000 0x7ff8000000000001 ZPC +FUCOMI 0xaeff000025000000 0x0 --C +FUCOMPP 0xaeff000025000000 0x0 --C +FUCOMI 0xaeff000025000000 0x4082c00000000000 --C +FUCOMPP 0xaeff000025000000 0x4082c00000000000 --C +FUCOMI 0xaeff000025000000 0x8000000000000000 --C +FUCOMPP 0xaeff000025000000 0x8000000000000000 --C +FUCOMI 0xaeff000025000000 0x40dfffc000000000 --C +FUCOMPP 0xaeff000025000000 0x40dfffc000000000 --C +FUCOMI 0xaeff000025000000 0x40e0002000000000 --C +FUCOMPP 0xaeff000025000000 0x40e0002000000000 --C +FUCOMI 0xaeff000025000000 0xc0e0002000000000 --- +FUCOMPP 0xaeff000025000000 0xc0e0002000000000 --- +FUCOMI 0xaeff000025000000 0xc0dfffc000000000 --- +FUCOMPP 0xaeff000025000000 0xc0dfffc000000000 --- +FUCOMI 0xaeff000025000000 0x3ff0000000000000 --C +FUCOMPP 0xaeff000025000000 0x3ff0000000000000 --C +FUCOMI 0xaeff000025000000 0x3fe89d9000000000 --C +FUCOMPP 0xaeff000025000000 0x3fe89d9000000000 --C +FUCOMI 0xaeff000025000000 0x7ff0000000000000 --C +FUCOMPP 0xaeff000025000000 0x7ff0000000000000 --C +FUCOMI 0xaeff000025000000 0xfff0000000000000 --- +FUCOMPP 0xaeff000025000000 0xfff0000000000000 --- +FUCOMI 0xaeff000025000000 0x3ff0002ca0000000 --C +FUCOMPP 0xaeff000025000000 0x3ff0002ca0000000 --C +FUCOMI 0xaeff000025000000 0xaeff000025000000 Z-- +FUCOMPP 0xaeff000025000000 0xaeff000025000000 Z-- +FUCOMI 0xaeff000025000000 0x3ff0000050000000 --C +FUCOMPP 0xaeff000025000000 0x3ff0000050000000 --C +FUCOMI 0xaeff000025000000 0xc082c00000000000 --- +FUCOMPP 0xaeff000025000000 0xc082c00000000000 --- +FUCOMI 0xaeff000025000000 0x7ff8000000000001 ZPC +FUCOMPP 0xaeff000025000000 0x7ff8000000000001 ZPC +FUCOMI 0x3ff0000050000000 0x0 --- +FUCOMPP 0x3ff0000050000000 0x0 --- +FUCOMI 0x3ff0000050000000 0x4082c00000000000 --C +FUCOMPP 0x3ff0000050000000 0x4082c00000000000 --C +FUCOMI 0x3ff0000050000000 0x8000000000000000 --- +FUCOMPP 0x3ff0000050000000 0x8000000000000000 --- +FUCOMI 0x3ff0000050000000 0x40dfffc000000000 --C +FUCOMPP 0x3ff0000050000000 0x40dfffc000000000 --C +FUCOMI 0x3ff0000050000000 0x40e0002000000000 --C +FUCOMPP 0x3ff0000050000000 0x40e0002000000000 --C +FUCOMI 0x3ff0000050000000 0xc0e0002000000000 --- +FUCOMPP 0x3ff0000050000000 0xc0e0002000000000 --- +FUCOMI 0x3ff0000050000000 0xc0dfffc000000000 --- +FUCOMPP 0x3ff0000050000000 0xc0dfffc000000000 --- +FUCOMI 0x3ff0000050000000 0x3ff0000000000000 --- +FUCOMPP 0x3ff0000050000000 0x3ff0000000000000 --- +FUCOMI 0x3ff0000050000000 0x3fe89d9000000000 --- +FUCOMPP 0x3ff0000050000000 0x3fe89d9000000000 --- +FUCOMI 0x3ff0000050000000 0x7ff0000000000000 --C +FUCOMPP 0x3ff0000050000000 0x7ff0000000000000 --C +FUCOMI 0x3ff0000050000000 0xfff0000000000000 --- +FUCOMPP 0x3ff0000050000000 0xfff0000000000000 --- +FUCOMI 0x3ff0000050000000 0x3ff0002ca0000000 --C +FUCOMPP 0x3ff0000050000000 0x3ff0002ca0000000 --C +FUCOMI 0x3ff0000050000000 0xaeff000025000000 --- +FUCOMPP 0x3ff0000050000000 0xaeff000025000000 --- +FUCOMI 0x3ff0000050000000 0x3ff0000050000000 Z-- +FUCOMPP 0x3ff0000050000000 0x3ff0000050000000 Z-- +FUCOMI 0x3ff0000050000000 0xc082c00000000000 --- +FUCOMPP 0x3ff0000050000000 0xc082c00000000000 --- +FUCOMI 0x3ff0000050000000 0x7ff8000000000001 ZPC +FUCOMPP 0x3ff0000050000000 0x7ff8000000000001 ZPC +FUCOMI 0xc082c00000000000 0x0 --C +FUCOMPP 0xc082c00000000000 0x0 --C +FUCOMI 0xc082c00000000000 0x4082c00000000000 --C +FUCOMPP 0xc082c00000000000 0x4082c00000000000 --C +FUCOMI 0xc082c00000000000 0x8000000000000000 --C +FUCOMPP 0xc082c00000000000 0x8000000000000000 --C +FUCOMI 0xc082c00000000000 0x40dfffc000000000 --C +FUCOMPP 0xc082c00000000000 0x40dfffc000000000 --C +FUCOMI 0xc082c00000000000 0x40e0002000000000 --C +FUCOMPP 0xc082c00000000000 0x40e0002000000000 --C +FUCOMI 0xc082c00000000000 0xc0e0002000000000 --- +FUCOMPP 0xc082c00000000000 0xc0e0002000000000 --- +FUCOMI 0xc082c00000000000 0xc0dfffc000000000 --- +FUCOMPP 0xc082c00000000000 0xc0dfffc000000000 --- +FUCOMI 0xc082c00000000000 0x3ff0000000000000 --C +FUCOMPP 0xc082c00000000000 0x3ff0000000000000 --C +FUCOMI 0xc082c00000000000 0x3fe89d9000000000 --C +FUCOMPP 0xc082c00000000000 0x3fe89d9000000000 --C +FUCOMI 0xc082c00000000000 0x7ff0000000000000 --C +FUCOMPP 0xc082c00000000000 0x7ff0000000000000 --C +FUCOMI 0xc082c00000000000 0xfff0000000000000 --- +FUCOMPP 0xc082c00000000000 0xfff0000000000000 --- +FUCOMI 0xc082c00000000000 0x3ff0002ca0000000 --C +FUCOMPP 0xc082c00000000000 0x3ff0002ca0000000 --C +FUCOMI 0xc082c00000000000 0xaeff000025000000 --C +FUCOMPP 0xc082c00000000000 0xaeff000025000000 --C +FUCOMI 0xc082c00000000000 0x3ff0000050000000 --C +FUCOMPP 0xc082c00000000000 0x3ff0000050000000 --C +FUCOMI 0xc082c00000000000 0xc082c00000000000 Z-- +FUCOMPP 0xc082c00000000000 0xc082c00000000000 Z-- +FUCOMI 0xc082c00000000000 0x7ff8000000000001 ZPC +FUCOMPP 0xc082c00000000000 0x7ff8000000000001 ZPC +FUCOMI 0x7ff8000000000001 0x0 ZPC +FUCOMPP 0x7ff8000000000001 0x0 ZPC +FUCOMI 0x7ff8000000000001 0x4082c00000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x4082c00000000000 ZPC +FUCOMI 0x7ff8000000000001 0x8000000000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x8000000000000000 ZPC +FUCOMI 0x7ff8000000000001 0x40dfffc000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x40dfffc000000000 ZPC +FUCOMI 0x7ff8000000000001 0x40e0002000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x40e0002000000000 ZPC +FUCOMI 0x7ff8000000000001 0xc0e0002000000000 ZPC +FUCOMPP 0x7ff8000000000001 0xc0e0002000000000 ZPC +FUCOMI 0x7ff8000000000001 0xc0dfffc000000000 ZPC +FUCOMPP 0x7ff8000000000001 0xc0dfffc000000000 ZPC +FUCOMI 0x7ff8000000000001 0x3ff0000000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x3ff0000000000000 ZPC +FUCOMI 0x7ff8000000000001 0x3fe89d9000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x3fe89d9000000000 ZPC +FUCOMI 0x7ff8000000000001 0x7ff0000000000000 ZPC +FUCOMPP 0x7ff8000000000001 0x7ff0000000000000 ZPC +FUCOMI 0x7ff8000000000001 0xfff0000000000000 ZPC +FUCOMPP 0x7ff8000000000001 0xfff0000000000000 ZPC +FUCOMI 0x7ff8000000000001 0x3ff0002ca0000000 ZPC +FUCOMPP 0x7ff8000000000001 0x3ff0002ca0000000 ZPC +FUCOMI 0x7ff8000000000001 0xaeff000025000000 ZPC +FUCOMPP 0x7ff8000000000001 0xaeff000025000000 ZPC +FUCOMI 0x7ff8000000000001 0x3ff0000050000000 ZPC +FUCOMPP 0x7ff8000000000001 0x3ff0000050000000 ZPC +FUCOMI 0x7ff8000000000001 0xc082c00000000000 ZPC +FUCOMPP 0x7ff8000000000001 0xc082c00000000000 ZPC +FUCOMI 0x7ff8000000000001 0x7ff8000000000001 ZPC +FUCOMPP 0x7ff8000000000001 0x7ff8000000000001 ZPC +Rounding 0 + FRNDINT 0x0 => 0x0 + FISTP 0x0 => word: 0 + FISTP 0x0 => long: 0 + FISTP 0x0 => quad: 0 + FISTTP 0x0 => word: 0 + FISTTP 0x0 => long: 0 + FISTTP 0x0 => quad: 0 +Rounding 1 + FRNDINT 0x0 => 0x0 + FISTP 0x0 => word: 0 + FISTP 0x0 => long: 0 + FISTP 0x0 => quad: 0 + FISTTP 0x0 => word: 0 + FISTTP 0x0 => long: 0 + FISTTP 0x0 => quad: 0 +Rounding 2 + FRNDINT 0x0 => 0x0 + FISTP 0x0 => word: 0 + FISTP 0x0 => long: 0 + FISTP 0x0 => quad: 0 + FISTTP 0x0 => word: 0 + FISTTP 0x0 => long: 0 + FISTTP 0x0 => quad: 0 +Rounding 0 + FRNDINT 0x4082c00000000000 => 0x4082c00000000000 + FISTP 0x4082c00000000000 => word: 258 + FISTP 0x4082c00000000000 => long: 258 + FISTP 0x4082c00000000000 => quad: 258 + FISTTP 0x4082c00000000000 => word: 258 + FISTTP 0x4082c00000000000 => long: 258 + FISTTP 0x4082c00000000000 => quad: 258 +Rounding 1 + FRNDINT 0x4082c00000000000 => 0x4082c00000000000 + FISTP 0x4082c00000000000 => word: 258 + FISTP 0x4082c00000000000 => long: 258 + FISTP 0x4082c00000000000 => quad: 258 + FISTTP 0x4082c00000000000 => word: 258 + FISTTP 0x4082c00000000000 => long: 258 + FISTTP 0x4082c00000000000 => quad: 258 +Rounding 2 + FRNDINT 0x4082c00000000000 => 0x4082c00000000000 + FISTP 0x4082c00000000000 => word: 258 + FISTP 0x4082c00000000000 => long: 258 + FISTP 0x4082c00000000000 => quad: 258 + FISTTP 0x4082c00000000000 => word: 258 + FISTTP 0x4082c00000000000 => long: 258 + FISTTP 0x4082c00000000000 => quad: 258 +Rounding 0 + FRNDINT 0x8000000000000000 => 0x8000000000000000 + FISTP 0x8000000000000000 => word: 0 + FISTP 0x8000000000000000 => long: 0 + FISTP 0x8000000000000000 => quad: 0 + FISTTP 0x8000000000000000 => word: 0 + FISTTP 0x8000000000000000 => long: 0 + FISTTP 0x8000000000000000 => quad: 0 +Rounding 1 + FRNDINT 0x8000000000000000 => 0x8000000000000000 + FISTP 0x8000000000000000 => word: 0 + FISTP 0x8000000000000000 => long: 0 + FISTP 0x8000000000000000 => quad: 0 + FISTTP 0x8000000000000000 => word: 0 + FISTTP 0x8000000000000000 => long: 0 + FISTTP 0x8000000000000000 => quad: 0 +Rounding 2 + FRNDINT 0x8000000000000000 => 0x8000000000000000 + FISTP 0x8000000000000000 => word: 0 + FISTP 0x8000000000000000 => long: 0 + FISTP 0x8000000000000000 => quad: 0 + FISTTP 0x8000000000000000 => word: 0 + FISTTP 0x8000000000000000 => long: 0 + FISTTP 0x8000000000000000 => quad: 0 +Rounding 0 + FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000 + FISTP 0x40dfffc000000000 => word: 7fff + FISTP 0x40dfffc000000000 => long: 7fff + FISTP 0x40dfffc000000000 => quad: 7fff + FISTTP 0x40dfffc000000000 => word: 7fff + FISTTP 0x40dfffc000000000 => long: 7fff + FISTTP 0x40dfffc000000000 => quad: 7fff +Rounding 1 + FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000 + FISTP 0x40dfffc000000000 => word: 7fff + FISTP 0x40dfffc000000000 => long: 7fff + FISTP 0x40dfffc000000000 => quad: 7fff + FISTTP 0x40dfffc000000000 => word: 7fff + FISTTP 0x40dfffc000000000 => long: 7fff + FISTTP 0x40dfffc000000000 => quad: 7fff +Rounding 2 + FRNDINT 0x40dfffc000000000 => 0x40dfffc000000000 + FISTP 0x40dfffc000000000 => word: 7fff + FISTP 0x40dfffc000000000 => long: 7fff + FISTP 0x40dfffc000000000 => quad: 7fff + FISTTP 0x40dfffc000000000 => word: 7fff + FISTTP 0x40dfffc000000000 => long: 7fff + FISTTP 0x40dfffc000000000 => quad: 7fff +Rounding 0 + FRNDINT 0x40e0002000000000 => 0x40e0002000000000 + FISTP 0x40e0002000000000 => word: 8000 + FISTP 0x40e0002000000000 => long: 8001 + FISTP 0x40e0002000000000 => quad: 8001 + FISTTP 0x40e0002000000000 => word: 8000 + FISTTP 0x40e0002000000000 => long: 8001 + FISTTP 0x40e0002000000000 => quad: 8001 +Rounding 1 + FRNDINT 0x40e0002000000000 => 0x40e0002000000000 + FISTP 0x40e0002000000000 => word: 8000 + FISTP 0x40e0002000000000 => long: 8001 + FISTP 0x40e0002000000000 => quad: 8001 + FISTTP 0x40e0002000000000 => word: 8000 + FISTTP 0x40e0002000000000 => long: 8001 + FISTTP 0x40e0002000000000 => quad: 8001 +Rounding 2 + FRNDINT 0x40e0002000000000 => 0x40e0002000000000 + FISTP 0x40e0002000000000 => word: 8000 + FISTP 0x40e0002000000000 => long: 8001 + FISTP 0x40e0002000000000 => quad: 8001 + FISTTP 0x40e0002000000000 => word: 8000 + FISTTP 0x40e0002000000000 => long: 8001 + FISTTP 0x40e0002000000000 => quad: 8001 +Rounding 0 + FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000 + FISTP 0xc0e0002000000000 => word: 8000 + FISTP 0xc0e0002000000000 => long: ffff7fff + FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff + FISTTP 0xc0e0002000000000 => word: 8000 + FISTTP 0xc0e0002000000000 => long: ffff7fff + FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff +Rounding 1 + FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000 + FISTP 0xc0e0002000000000 => word: 8000 + FISTP 0xc0e0002000000000 => long: ffff7fff + FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff + FISTTP 0xc0e0002000000000 => word: 8000 + FISTTP 0xc0e0002000000000 => long: ffff7fff + FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff +Rounding 2 + FRNDINT 0xc0e0002000000000 => 0xc0e0002000000000 + FISTP 0xc0e0002000000000 => word: 8000 + FISTP 0xc0e0002000000000 => long: ffff7fff + FISTP 0xc0e0002000000000 => quad: ffffffffffff7fff + FISTTP 0xc0e0002000000000 => word: 8000 + FISTTP 0xc0e0002000000000 => long: ffff7fff + FISTTP 0xc0e0002000000000 => quad: ffffffffffff7fff +Rounding 0 + FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000 + FISTP 0xc0dfffc000000000 => word: 8001 + FISTP 0xc0dfffc000000000 => long: ffff8001 + FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001 + FISTTP 0xc0dfffc000000000 => word: 8001 + FISTTP 0xc0dfffc000000000 => long: ffff8001 + FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001 +Rounding 1 + FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000 + FISTP 0xc0dfffc000000000 => word: 8001 + FISTP 0xc0dfffc000000000 => long: ffff8001 + FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001 + FISTTP 0xc0dfffc000000000 => word: 8001 + FISTTP 0xc0dfffc000000000 => long: ffff8001 + FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001 +Rounding 2 + FRNDINT 0xc0dfffc000000000 => 0xc0dfffc000000000 + FISTP 0xc0dfffc000000000 => word: 8001 + FISTP 0xc0dfffc000000000 => long: ffff8001 + FISTP 0xc0dfffc000000000 => quad: ffffffffffff8001 + FISTTP 0xc0dfffc000000000 => word: 8001 + FISTTP 0xc0dfffc000000000 => long: ffff8001 + FISTTP 0xc0dfffc000000000 => quad: ffffffffffff8001 +Rounding 0 + FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 + FISTP 0x3ff0000000000000 => word: 1 + FISTP 0x3ff0000000000000 => long: 1 + FISTP 0x3ff0000000000000 => quad: 1 + FISTTP 0x3ff0000000000000 => word: 1 + FISTTP 0x3ff0000000000000 => long: 1 + FISTTP 0x3ff0000000000000 => quad: 1 +Rounding 1 + FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 + FISTP 0x3ff0000000000000 => word: 1 + FISTP 0x3ff0000000000000 => long: 1 + FISTP 0x3ff0000000000000 => quad: 1 + FISTTP 0x3ff0000000000000 => word: 1 + FISTTP 0x3ff0000000000000 => long: 1 + FISTTP 0x3ff0000000000000 => quad: 1 +Rounding 2 + FRNDINT 0x3ff0000000000000 => 0x3ff0000000000000 + FISTP 0x3ff0000000000000 => word: 1 + FISTP 0x3ff0000000000000 => long: 1 + FISTP 0x3ff0000000000000 => quad: 1 + FISTTP 0x3ff0000000000000 => word: 1 + FISTTP 0x3ff0000000000000 => long: 1 + FISTTP 0x3ff0000000000000 => quad: 1 +Rounding 0 + FRNDINT 0x3fe89d9000000000 => 0x3ff0000000000000 + FISTP 0x3fe89d9000000000 => word: 1 + FISTP 0x3fe89d9000000000 => long: 1 + FISTP 0x3fe89d9000000000 => quad: 1 + FISTTP 0x3fe89d9000000000 => word: 0 + FISTTP 0x3fe89d9000000000 => long: 0 + FISTTP 0x3fe89d9000000000 => quad: 0 +Rounding 1 + FRNDINT 0x3fe89d9000000000 => 0x0 + FISTP 0x3fe89d9000000000 => word: 0 + FISTP 0x3fe89d9000000000 => long: 0 + FISTP 0x3fe89d9000000000 => quad: 0 + FISTTP 0x3fe89d9000000000 => word: 0 + FISTTP 0x3fe89d9000000000 => long: 0 + FISTTP 0x3fe89d9000000000 => quad: 0 +Rounding 2 + FRNDINT 0x3fe89d9000000000 => 0x3ff0000000000000 + FISTP 0x3fe89d9000000000 => word: 1 + FISTP 0x3fe89d9000000000 => long: 1 + FISTP 0x3fe89d9000000000 => quad: 1 + FISTTP 0x3fe89d9000000000 => word: 0 + FISTTP 0x3fe89d9000000000 => long: 0 + FISTTP 0x3fe89d9000000000 => quad: 0 +Rounding 0 + FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 + FISTP 0x7ff0000000000000 => word: 8000 + FISTP 0x7ff0000000000000 => long: 80000000 + FISTP 0x7ff0000000000000 => quad: 8000000000000000 + FISTTP 0x7ff0000000000000 => word: 8000 + FISTTP 0x7ff0000000000000 => long: 80000000 + FISTTP 0x7ff0000000000000 => quad: 8000000000000000 +Rounding 1 + FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 + FISTP 0x7ff0000000000000 => word: 8000 + FISTP 0x7ff0000000000000 => long: 80000000 + FISTP 0x7ff0000000000000 => quad: 8000000000000000 + FISTTP 0x7ff0000000000000 => word: 8000 + FISTTP 0x7ff0000000000000 => long: 80000000 + FISTTP 0x7ff0000000000000 => quad: 8000000000000000 +Rounding 2 + FRNDINT 0x7ff0000000000000 => 0x7ff0000000000000 + FISTP 0x7ff0000000000000 => word: 8000 + FISTP 0x7ff0000000000000 => long: 80000000 + FISTP 0x7ff0000000000000 => quad: 8000000000000000 + FISTTP 0x7ff0000000000000 => word: 8000 + FISTTP 0x7ff0000000000000 => long: 80000000 + FISTTP 0x7ff0000000000000 => quad: 8000000000000000 +Rounding 0 + FRNDINT 0xfff0000000000000 => 0xfff0000000000000 + FISTP 0xfff0000000000000 => word: 8000 + FISTP 0xfff0000000000000 => long: 80000000 + FISTP 0xfff0000000000000 => quad: 8000000000000000 + FISTTP 0xfff0000000000000 => word: 8000 + FISTTP 0xfff0000000000000 => long: 80000000 + FISTTP 0xfff0000000000000 => quad: 8000000000000000 +Rounding 1 + FRNDINT 0xfff0000000000000 => 0xfff0000000000000 + FISTP 0xfff0000000000000 => word: 8000 + FISTP 0xfff0000000000000 => long: 80000000 + FISTP 0xfff0000000000000 => quad: 8000000000000000 + FISTTP 0xfff0000000000000 => word: 8000 + FISTTP 0xfff0000000000000 => long: 80000000 + FISTTP 0xfff0000000000000 => quad: 8000000000000000 +Rounding 2 + FRNDINT 0xfff0000000000000 => 0xfff0000000000000 + FISTP 0xfff0000000000000 => word: 8000 + FISTP 0xfff0000000000000 => long: 80000000 + FISTP 0xfff0000000000000 => quad: 8000000000000000 + FISTTP 0xfff0000000000000 => word: 8000 + FISTTP 0xfff0000000000000 => long: 80000000 + FISTTP 0xfff0000000000000 => quad: 8000000000000000 +Rounding 0 + FRNDINT 0x3ff0002ca0000000 => 0x3ff0000000000000 + FISTP 0x3ff0002ca0000000 => word: 1 + FISTP 0x3ff0002ca0000000 => long: 1 + FISTP 0x3ff0002ca0000000 => quad: 1 + FISTTP 0x3ff0002ca0000000 => word: 1 + FISTTP 0x3ff0002ca0000000 => long: 1 + FISTTP 0x3ff0002ca0000000 => quad: 1 +Rounding 1 + FRNDINT 0x3ff0002ca0000000 => 0x3ff0000000000000 + FISTP 0x3ff0002ca0000000 => word: 1 + FISTP 0x3ff0002ca0000000 => long: 1 + FISTP 0x3ff0002ca0000000 => quad: 1 + FISTTP 0x3ff0002ca0000000 => word: 1 + FISTTP 0x3ff0002ca0000000 => long: 1 + FISTTP 0x3ff0002ca0000000 => quad: 1 +Rounding 2 + FRNDINT 0x3ff0002ca0000000 => 0x4000000000000000 + FISTP 0x3ff0002ca0000000 => word: 2 + FISTP 0x3ff0002ca0000000 => long: 2 + FISTP 0x3ff0002ca0000000 => quad: 2 + FISTTP 0x3ff0002ca0000000 => word: 1 + FISTTP 0x3ff0002ca0000000 => long: 1 + FISTTP 0x3ff0002ca0000000 => quad: 1 +Rounding 0 + FRNDINT 0xaeff000025000000 => 0x8000000000000000 + FISTP 0xaeff000025000000 => word: 0 + FISTP 0xaeff000025000000 => long: 0 + FISTP 0xaeff000025000000 => quad: 0 + FISTTP 0xaeff000025000000 => word: 0 + FISTTP 0xaeff000025000000 => long: 0 + FISTTP 0xaeff000025000000 => quad: 0 +Rounding 1 + FRNDINT 0xaeff000025000000 => 0xbff0000000000000 + FISTP 0xaeff000025000000 => word: ffff + FISTP 0xaeff000025000000 => long: ffffffff + FISTP 0xaeff000025000000 => quad: ffffffffffffffff + FISTTP 0xaeff000025000000 => word: 0 + FISTTP 0xaeff000025000000 => long: 0 + FISTTP 0xaeff000025000000 => quad: 0 +Rounding 2 + FRNDINT 0xaeff000025000000 => 0x8000000000000000 + FISTP 0xaeff000025000000 => word: 0 + FISTP 0xaeff000025000000 => long: 0 + FISTP 0xaeff000025000000 => quad: 0 + FISTTP 0xaeff000025000000 => word: 0 + FISTTP 0xaeff000025000000 => long: 0 + FISTTP 0xaeff000025000000 => quad: 0 +Rounding 0 + FRNDINT 0x3ff0000050000000 => 0x3ff0000000000000 + FISTP 0x3ff0000050000000 => word: 1 + FISTP 0x3ff0000050000000 => long: 1 + FISTP 0x3ff0000050000000 => quad: 1 + FISTTP 0x3ff0000050000000 => word: 1 + FISTTP 0x3ff0000050000000 => long: 1 + FISTTP 0x3ff0000050000000 => quad: 1 +Rounding 1 + FRNDINT 0x3ff0000050000000 => 0x3ff0000000000000 + FISTP 0x3ff0000050000000 => word: 1 + FISTP 0x3ff0000050000000 => long: 1 + FISTP 0x3ff0000050000000 => quad: 1 + FISTTP 0x3ff0000050000000 => word: 1 + FISTTP 0x3ff0000050000000 => long: 1 + FISTTP 0x3ff0000050000000 => quad: 1 +Rounding 2 + FRNDINT 0x3ff0000050000000 => 0x4000000000000000 + FISTP 0x3ff0000050000000 => word: 2 + FISTP 0x3ff0000050000000 => long: 2 + FISTP 0x3ff0000050000000 => quad: 2 + FISTTP 0x3ff0000050000000 => word: 1 + FISTTP 0x3ff0000050000000 => long: 1 + FISTTP 0x3ff0000050000000 => quad: 1 +Rounding 0 + FRNDINT 0xc082c00000000000 => 0xc082c00000000000 + FISTP 0xc082c00000000000 => word: fda8 + FISTP 0xc082c00000000000 => long: fffffda8 + FISTP 0xc082c00000000000 => quad: fffffffffffffda8 + FISTTP 0xc082c00000000000 => word: fda8 + FISTTP 0xc082c00000000000 => long: fffffda8 + FISTTP 0xc082c00000000000 => quad: fffffffffffffda8 +Rounding 1 + FRNDINT 0xc082c00000000000 => 0xc082c00000000000 + FISTP 0xc082c00000000000 => word: fda8 + FISTP 0xc082c00000000000 => long: fffffda8 + FISTP 0xc082c00000000000 => quad: fffffffffffffda8 + FISTTP 0xc082c00000000000 => word: fda8 + FISTTP 0xc082c00000000000 => long: fffffda8 + FISTTP 0xc082c00000000000 => quad: fffffffffffffda8 +Rounding 2 + FRNDINT 0xc082c00000000000 => 0xc082c00000000000 + FISTP 0xc082c00000000000 => word: fda8 + FISTP 0xc082c00000000000 => long: fffffda8 + FISTP 0xc082c00000000000 => quad: fffffffffffffda8 + FISTTP 0xc082c00000000000 => word: fda8 + FISTTP 0xc082c00000000000 => long: fffffda8 + FISTTP 0xc082c00000000000 => quad: fffffffffffffda8 +Rounding 0 + FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 + FISTP 0x7ff8000000000001 => word: 8000 + FISTP 0x7ff8000000000001 => long: 80000000 + FISTP 0x7ff8000000000001 => quad: 8000000000000000 + FISTTP 0x7ff8000000000001 => word: 8000 + FISTTP 0x7ff8000000000001 => long: 80000000 + FISTTP 0x7ff8000000000001 => quad: 8000000000000000 +Rounding 1 + FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 + FISTP 0x7ff8000000000001 => word: 8000 + FISTP 0x7ff8000000000001 => long: 80000000 + FISTP 0x7ff8000000000001 => quad: 8000000000000000 + FISTTP 0x7ff8000000000001 => word: 8000 + FISTTP 0x7ff8000000000001 => long: 80000000 + FISTTP 0x7ff8000000000001 => quad: 8000000000000000 +Rounding 2 + FRNDINT 0x7ff8000000000001 => 0x7ff8000000000001 + FISTP 0x7ff8000000000001 => word: 8000 + FISTP 0x7ff8000000000001 => long: 80000000 + FISTP 0x7ff8000000000001 => quad: 8000000000000000 + FISTTP 0x7ff8000000000001 => word: 8000 + FISTTP 0x7ff8000000000001 => long: 80000000 + FISTTP 0x7ff8000000000001 => quad: 8000000000000000 + +Done diff --git a/tests32/ref20.txt b/tests32/ref20.txt new file mode 100644 index 0000000..2646fa3 --- /dev/null +++ b/tests32/ref20.txt @@ -0,0 +1,11 @@ +SDHLD/SAR/IDIV 0x2d0 0x500 => 0x0 / 0x9000 (47185920/1280 => 36864 + 0) +SDHLD/SAR/IDIV 0xfffffa5d 0x186a0 => 0xfffef4a0 / 0xfffffc4f (281474882142208/100000 => -945 + -68448) +SDHLD/SAR/IDIV 0x1701 0x186a0 => 0xa220 / 0xf13 (385941504/100000 => 3859 + 41504) +SDHLD/SAR/IDIV 0xffff9a19 0x186a0 => 0xffff6d00 / 0xffffbd38 (281473267073024/100000 => -17096 + -37632) +SDHLD/SAR/IDIV 0xffffe7f3 0x186a0 => 0xffffebe0 / 0xfffff03d (281474573205504/100000 => -4035 + -5152) +SDHLD/SAR/IDIV 0x15840 0x186a0 => 0xdd20 / 0xe19b (5775556608/100000 => 57755 + 56608) +SDHLD/SAR/IDIV 0xff451330 0x186a0 => 0xfffee8a0 / 0xff857f2f (280672139739136/100000 => -8028369 + -71520) +SDHLD/SAR/IDIV 0xffff626a 0x186a0 => 0xffff2fc0 / 0xffff98ba (281472332857344/100000 => -26438 + -53312) +SDHLD/SAR/IDIV 0x9120 0x186a0 => 0x16d20 / 0x5f1b (2434793472/100000 => 24347 + 93472) + +Done diff --git a/tests32/ref21.txt b/tests32/ref21.txt new file mode 100644 index 0000000..7b20e61 --- /dev/null +++ b/tests32/ref21.txt @@ -0,0 +1 @@ +2/1 diff --git a/tests32/ref22.txt b/tests32/ref22.txt new file mode 100644 index 0000000..8949329 --- /dev/null +++ b/tests32/ref22.txt @@ -0,0 +1,1248 @@ +enc (0x00000000000000000000000000000000, 0x00000000000000000000000000000000) = 0x63636363636363636363636363636363 +enclast(0x00000000000000000000000000000000, 0x00000000000000000000000000000000) = 0x63636363636363636363636363636363 +dec (0x00000000000000000000000000000000, 0x00000000000000000000000000000000) = 0x52525252525252525252525252525252 +declast(0x00000000000000000000000000000000, 0x00000000000000000000000000000000) = 0x52525252525252525252525252525252 +enc (0x00000000000000000000000000000000, 0x10000000000000001111000000001111) = 0x73636363636363637272636363637272 +enclast(0x00000000000000000000000000000000, 0x10000000000000001111000000001111) = 0x73636363636363637272636363637272 +dec (0x00000000000000000000000000000000, 0x10000000000000001111000000001111) = 0x42525252525252524343525252524343 +declast(0x00000000000000000000000000000000, 0x10000000000000001111000000001111) = 0x42525252525252524343525252524343 +enc (0x00000000000000000000000000000000, 0x20000000000000002222000000002222) = 0x43636363636363634141636363634141 +enclast(0x00000000000000000000000000000000, 0x20000000000000002222000000002222) = 0x43636363636363634141636363634141 +dec (0x00000000000000000000000000000000, 0x20000000000000002222000000002222) = 0x72525252525252527070525252527070 +declast(0x00000000000000000000000000000000, 0x20000000000000002222000000002222) = 0x72525252525252527070525252527070 +enc (0x00000000000000000000000000000000, 0x30000000000000003333000000003333) = 0x53636363636363635050636363635050 +enclast(0x00000000000000000000000000000000, 0x30000000000000003333000000003333) = 0x53636363636363635050636363635050 +dec (0x00000000000000000000000000000000, 0x30000000000000003333000000003333) = 0x62525252525252526161525252526161 +declast(0x00000000000000000000000000000000, 0x30000000000000003333000000003333) = 0x62525252525252526161525252526161 +enc (0x00000000000000000000000000000000, 0x40000000000000004444000000004444) = 0x23636363636363632727636363632727 +enclast(0x00000000000000000000000000000000, 0x40000000000000004444000000004444) = 0x23636363636363632727636363632727 +dec (0x00000000000000000000000000000000, 0x40000000000000004444000000004444) = 0x12525252525252521616525252521616 +declast(0x00000000000000000000000000000000, 0x40000000000000004444000000004444) = 0x12525252525252521616525252521616 +enc (0x00000000000000000000000000000000, 0x50000000000000005555000000005555) = 0x33636363636363633636636363633636 +enclast(0x00000000000000000000000000000000, 0x50000000000000005555000000005555) = 0x33636363636363633636636363633636 +dec (0x00000000000000000000000000000000, 0x50000000000000005555000000005555) = 0x02525252525252520707525252520707 +declast(0x00000000000000000000000000000000, 0x50000000000000005555000000005555) = 0x02525252525252520707525252520707 +enc (0x00000000000000000000000000000000, 0x60000000000000006666000000006666) = 0x03636363636363630505636363630505 +enclast(0x00000000000000000000000000000000, 0x60000000000000006666000000006666) = 0x03636363636363630505636363630505 +dec (0x00000000000000000000000000000000, 0x60000000000000006666000000006666) = 0x32525252525252523434525252523434 +declast(0x00000000000000000000000000000000, 0x60000000000000006666000000006666) = 0x32525252525252523434525252523434 +enc (0x00000000000000000000000000000000, 0x70000000000000007777000000007777) = 0x13636363636363631414636363631414 +enclast(0x00000000000000000000000000000000, 0x70000000000000007777000000007777) = 0x13636363636363631414636363631414 +dec (0x00000000000000000000000000000000, 0x70000000000000007777000000007777) = 0x22525252525252522525525252522525 +declast(0x00000000000000000000000000000000, 0x70000000000000007777000000007777) = 0x22525252525252522525525252522525 +enc (0x00000000000000000000000000000000, 0x80000000000000008888000000008888) = 0xE363636363636363EBEB63636363EBEB +enclast(0x00000000000000000000000000000000, 0x80000000000000008888000000008888) = 0xE363636363636363EBEB63636363EBEB +dec (0x00000000000000000000000000000000, 0x80000000000000008888000000008888) = 0xD252525252525252DADA52525252DADA +declast(0x00000000000000000000000000000000, 0x80000000000000008888000000008888) = 0xD252525252525252DADA52525252DADA +enc (0x00000000000000000000000000000000, 0x90000000000000009999000000009999) = 0xF363636363636363FAFA63636363FAFA +enclast(0x00000000000000000000000000000000, 0x90000000000000009999000000009999) = 0xF363636363636363FAFA63636363FAFA +dec (0x00000000000000000000000000000000, 0x90000000000000009999000000009999) = 0xC252525252525252CBCB52525252CBCB +declast(0x00000000000000000000000000000000, 0x90000000000000009999000000009999) = 0xC252525252525252CBCB52525252CBCB +enc (0x00000000000000000000000000000000, 0xA000000000000000AAAA00000000AAAA) = 0xC363636363636363C9C963636363C9C9 +enclast(0x00000000000000000000000000000000, 0xA000000000000000AAAA00000000AAAA) = 0xC363636363636363C9C963636363C9C9 +dec (0x00000000000000000000000000000000, 0xA000000000000000AAAA00000000AAAA) = 0xF252525252525252F8F852525252F8F8 +declast(0x00000000000000000000000000000000, 0xA000000000000000AAAA00000000AAAA) = 0xF252525252525252F8F852525252F8F8 +enc (0x00000000000000000000000000000000, 0xB000000000000000BBBB00000000BBBB) = 0xD363636363636363D8D863636363D8D8 +enclast(0x00000000000000000000000000000000, 0xB000000000000000BBBB00000000BBBB) = 0xD363636363636363D8D863636363D8D8 +dec (0x00000000000000000000000000000000, 0xB000000000000000BBBB00000000BBBB) = 0xE252525252525252E9E952525252E9E9 +declast(0x00000000000000000000000000000000, 0xB000000000000000BBBB00000000BBBB) = 0xE252525252525252E9E952525252E9E9 +enc (0x00000000000000000000000000000000, 0xC000000000000000CCCC00000000CCCC) = 0xA363636363636363AFAF63636363AFAF +enclast(0x00000000000000000000000000000000, 0xC000000000000000CCCC00000000CCCC) = 0xA363636363636363AFAF63636363AFAF +dec (0x00000000000000000000000000000000, 0xC000000000000000CCCC00000000CCCC) = 0x92525252525252529E9E525252529E9E +declast(0x00000000000000000000000000000000, 0xC000000000000000CCCC00000000CCCC) = 0x92525252525252529E9E525252529E9E +enc (0x00000000000000000000000000000000, 0xD000000000000000DDDD00000000DDDD) = 0xB363636363636363BEBE63636363BEBE +enclast(0x00000000000000000000000000000000, 0xD000000000000000DDDD00000000DDDD) = 0xB363636363636363BEBE63636363BEBE +dec (0x00000000000000000000000000000000, 0xD000000000000000DDDD00000000DDDD) = 0x82525252525252528F8F525252528F8F +declast(0x00000000000000000000000000000000, 0xD000000000000000DDDD00000000DDDD) = 0x82525252525252528F8F525252528F8F +enc (0x00000000000000000000000000000000, 0xE000000000000000EEEE00000000EEEE) = 0x83636363636363638D8D636363638D8D +enclast(0x00000000000000000000000000000000, 0xE000000000000000EEEE00000000EEEE) = 0x83636363636363638D8D636363638D8D +dec (0x00000000000000000000000000000000, 0xE000000000000000EEEE00000000EEEE) = 0xB252525252525252BCBC52525252BCBC +declast(0x00000000000000000000000000000000, 0xE000000000000000EEEE00000000EEEE) = 0xB252525252525252BCBC52525252BCBC +enc (0x00000000000000000000000000000000, 0xF000000000000000FFFF00000000FFFF) = 0x93636363636363639C9C636363639C9C +enclast(0x00000000000000000000000000000000, 0xF000000000000000FFFF00000000FFFF) = 0x93636363636363639C9C636363639C9C +dec (0x00000000000000000000000000000000, 0xF000000000000000FFFF00000000FFFF) = 0xA252525252525252ADAD52525252ADAD +declast(0x00000000000000000000000000000000, 0xF000000000000000FFFF00000000FFFF) = 0xA252525252525252ADAD52525252ADAD +keygenassist(0x00000000000000000000000000000000, 0x00) = 0x63636363636363636363636363636363 +keygenassist(0x00000000000000000000000000000000, 0x01) = 0x63636362636363636363636263636363 +keygenassist(0x00000000000000000000000000000000, 0x02) = 0x63636361636363636363636163636363 +keygenassist(0x00000000000000000000000000000000, 0x04) = 0x63636367636363636363636763636363 +keygenassist(0x00000000000000000000000000000000, 0x08) = 0x6363636B636363636363636B63636363 +keygenassist(0x00000000000000000000000000000000, 0x10) = 0x63636373636363636363637363636363 +keygenassist(0x00000000000000000000000000000000, 0x38) = 0x6363635B636363636363635B63636363 +keygenassist(0x00000000000000000000000000000000, 0x4F) = 0x6363632C636363636363632C63636363 +keygenassist(0x00000000000000000000000000000000, 0xFF) = 0x6363639C636363636363639C63636363 +imc (0x00000000000000000000000000000000) = 0x00000000000000000000000000000000 +pclmul(0x00000000000000000000000000000000, 0x00) = 0x00000000000000000000000000000000 +pclmul(0x00000000000000000000000000000000, 0x01) = 0x00000000000000000000000000000000 +pclmul(0x00000000000000000000000000000000, 0x10) = 0x00000000000000000000000000000000 +pclmul(0x00000000000000000000000000000000, 0xFF) = 0x00000000000000000000000000000000 +enc (0x10000000000000001111000000001111, 0x00000000000000000000000000000000) = 0x635B82BABA5B82826363636312622B13 +enclast(0x10000000000000001111000000001111, 0x00000000000000000000000000000000) = 0x638282638263636363636363CA636382 +dec (0x10000000000000001111000000001111, 0x00000000000000000000000000000000) = 0x1C2665EEDD4BAF17EE1C266511D9A068 +declast(0x10000000000000001111000000001111, 0x00000000000000000000000000000000) = 0x52E352527C5252525252E352E35252E3 +enc (0x10000000000000001111000000001111, 0x10000000000000001111000000001111) = 0x735B82BABA5B82827272636312623A02 +enclast(0x10000000000000001111000000001111, 0x10000000000000001111000000001111) = 0x738282638263636372726363CA637293 +dec (0x10000000000000001111000000001111, 0x10000000000000001111000000001111) = 0x0C2665EEDD4BAF17FF0D266511D9B179 +declast(0x10000000000000001111000000001111, 0x10000000000000001111000000001111) = 0x42E352527C5252524343E352E35243F2 +enc (0x10000000000000001111000000001111, 0x20000000000000002222000000002222) = 0x435B82BABA5B82824141636312620931 +enclast(0x10000000000000001111000000001111, 0x20000000000000002222000000002222) = 0x438282638263636341416363CA6341A0 +dec (0x10000000000000001111000000001111, 0x20000000000000002222000000002222) = 0x3C2665EEDD4BAF17CC3E266511D9824A +declast(0x10000000000000001111000000001111, 0x20000000000000002222000000002222) = 0x72E352527C5252527070E352E35270C1 +enc (0x10000000000000001111000000001111, 0x30000000000000003333000000003333) = 0x535B82BABA5B82825050636312621820 +enclast(0x10000000000000001111000000001111, 0x30000000000000003333000000003333) = 0x538282638263636350506363CA6350B1 +dec (0x10000000000000001111000000001111, 0x30000000000000003333000000003333) = 0x2C2665EEDD4BAF17DD2F266511D9935B +declast(0x10000000000000001111000000001111, 0x30000000000000003333000000003333) = 0x62E352527C5252526161E352E35261D0 +enc (0x10000000000000001111000000001111, 0x40000000000000004444000000004444) = 0x235B82BABA5B82822727636312626F57 +enclast(0x10000000000000001111000000001111, 0x40000000000000004444000000004444) = 0x238282638263636327276363CA6327C6 +dec (0x10000000000000001111000000001111, 0x40000000000000004444000000004444) = 0x5C2665EEDD4BAF17AA58266511D9E42C +declast(0x10000000000000001111000000001111, 0x40000000000000004444000000004444) = 0x12E352527C5252521616E352E35216A7 +enc (0x10000000000000001111000000001111, 0x50000000000000005555000000005555) = 0x335B82BABA5B82823636636312627E46 +enclast(0x10000000000000001111000000001111, 0x50000000000000005555000000005555) = 0x338282638263636336366363CA6336D7 +dec (0x10000000000000001111000000001111, 0x50000000000000005555000000005555) = 0x4C2665EEDD4BAF17BB49266511D9F53D +declast(0x10000000000000001111000000001111, 0x50000000000000005555000000005555) = 0x02E352527C5252520707E352E35207B6 +enc (0x10000000000000001111000000001111, 0x60000000000000006666000000006666) = 0x035B82BABA5B82820505636312624D75 +enclast(0x10000000000000001111000000001111, 0x60000000000000006666000000006666) = 0x038282638263636305056363CA6305E4 +dec (0x10000000000000001111000000001111, 0x60000000000000006666000000006666) = 0x7C2665EEDD4BAF17887A266511D9C60E +declast(0x10000000000000001111000000001111, 0x60000000000000006666000000006666) = 0x32E352527C5252523434E352E3523485 +enc (0x10000000000000001111000000001111, 0x70000000000000007777000000007777) = 0x135B82BABA5B82821414636312625C64 +enclast(0x10000000000000001111000000001111, 0x70000000000000007777000000007777) = 0x138282638263636314146363CA6314F5 +dec (0x10000000000000001111000000001111, 0x70000000000000007777000000007777) = 0x6C2665EEDD4BAF17996B266511D9D71F +declast(0x10000000000000001111000000001111, 0x70000000000000007777000000007777) = 0x22E352527C5252522525E352E3522594 +enc (0x10000000000000001111000000001111, 0x80000000000000008888000000008888) = 0xE35B82BABA5B8282EBEB63631262A39B +enclast(0x10000000000000001111000000001111, 0x80000000000000008888000000008888) = 0xE382826382636363EBEB6363CA63EB0A +dec (0x10000000000000001111000000001111, 0x80000000000000008888000000008888) = 0x9C2665EEDD4BAF176694266511D928E0 +declast(0x10000000000000001111000000001111, 0x80000000000000008888000000008888) = 0xD2E352527C525252DADAE352E352DA6B +enc (0x10000000000000001111000000001111, 0x90000000000000009999000000009999) = 0xF35B82BABA5B8282FAFA63631262B28A +enclast(0x10000000000000001111000000001111, 0x90000000000000009999000000009999) = 0xF382826382636363FAFA6363CA63FA1B +dec (0x10000000000000001111000000001111, 0x90000000000000009999000000009999) = 0x8C2665EEDD4BAF177785266511D939F1 +declast(0x10000000000000001111000000001111, 0x90000000000000009999000000009999) = 0xC2E352527C525252CBCBE352E352CB7A +enc (0x10000000000000001111000000001111, 0xA000000000000000AAAA00000000AAAA) = 0xC35B82BABA5B8282C9C96363126281B9 +enclast(0x10000000000000001111000000001111, 0xA000000000000000AAAA00000000AAAA) = 0xC382826382636363C9C96363CA63C928 +dec (0x10000000000000001111000000001111, 0xA000000000000000AAAA00000000AAAA) = 0xBC2665EEDD4BAF1744B6266511D90AC2 +declast(0x10000000000000001111000000001111, 0xA000000000000000AAAA00000000AAAA) = 0xF2E352527C525252F8F8E352E352F849 +enc (0x10000000000000001111000000001111, 0xB000000000000000BBBB00000000BBBB) = 0xD35B82BABA5B8282D8D86363126290A8 +enclast(0x10000000000000001111000000001111, 0xB000000000000000BBBB00000000BBBB) = 0xD382826382636363D8D86363CA63D839 +dec (0x10000000000000001111000000001111, 0xB000000000000000BBBB00000000BBBB) = 0xAC2665EEDD4BAF1755A7266511D91BD3 +declast(0x10000000000000001111000000001111, 0xB000000000000000BBBB00000000BBBB) = 0xE2E352527C525252E9E9E352E352E958 +enc (0x10000000000000001111000000001111, 0xC000000000000000CCCC00000000CCCC) = 0xA35B82BABA5B8282AFAF63631262E7DF +enclast(0x10000000000000001111000000001111, 0xC000000000000000CCCC00000000CCCC) = 0xA382826382636363AFAF6363CA63AF4E +dec (0x10000000000000001111000000001111, 0xC000000000000000CCCC00000000CCCC) = 0xDC2665EEDD4BAF1722D0266511D96CA4 +declast(0x10000000000000001111000000001111, 0xC000000000000000CCCC00000000CCCC) = 0x92E352527C5252529E9EE352E3529E2F +enc (0x10000000000000001111000000001111, 0xD000000000000000DDDD00000000DDDD) = 0xB35B82BABA5B8282BEBE63631262F6CE +enclast(0x10000000000000001111000000001111, 0xD000000000000000DDDD00000000DDDD) = 0xB382826382636363BEBE6363CA63BE5F +dec (0x10000000000000001111000000001111, 0xD000000000000000DDDD00000000DDDD) = 0xCC2665EEDD4BAF1733C1266511D97DB5 +declast(0x10000000000000001111000000001111, 0xD000000000000000DDDD00000000DDDD) = 0x82E352527C5252528F8FE352E3528F3E +enc (0x10000000000000001111000000001111, 0xE000000000000000EEEE00000000EEEE) = 0x835B82BABA5B82828D8D63631262C5FD +enclast(0x10000000000000001111000000001111, 0xE000000000000000EEEE00000000EEEE) = 0x83828263826363638D8D6363CA638D6C +dec (0x10000000000000001111000000001111, 0xE000000000000000EEEE00000000EEEE) = 0xFC2665EEDD4BAF1700F2266511D94E86 +declast(0x10000000000000001111000000001111, 0xE000000000000000EEEE00000000EEEE) = 0xB2E352527C525252BCBCE352E352BC0D +enc (0x10000000000000001111000000001111, 0xF000000000000000FFFF00000000FFFF) = 0x935B82BABA5B82829C9C63631262D4EC +enclast(0x10000000000000001111000000001111, 0xF000000000000000FFFF00000000FFFF) = 0x93828263826363639C9C6363CA639C7D +dec (0x10000000000000001111000000001111, 0xF000000000000000FFFF00000000FFFF) = 0xEC2665EEDD4BAF1711E3266511D95F97 +declast(0x10000000000000001111000000001111, 0xF000000000000000FFFF00000000FFFF) = 0xA2E352527C525252ADADE352E352AD1C +keygenassist(0x10000000000000001111000000001111, 0x00) = 0x63CA6363CA6363636382826382826363 +keygenassist(0x10000000000000001111000000001111, 0x01) = 0x63CA6362CA6363636382826282826363 +keygenassist(0x10000000000000001111000000001111, 0x02) = 0x63CA6361CA6363636382826182826363 +keygenassist(0x10000000000000001111000000001111, 0x04) = 0x63CA6367CA6363636382826782826363 +keygenassist(0x10000000000000001111000000001111, 0x08) = 0x63CA636BCA6363636382826B82826363 +keygenassist(0x10000000000000001111000000001111, 0x10) = 0x63CA6373CA6363636382827382826363 +keygenassist(0x10000000000000001111000000001111, 0x38) = 0x63CA635BCA6363636382825B82826363 +keygenassist(0x10000000000000001111000000001111, 0x4F) = 0x63CA632CCA6363636382822C82826363 +keygenassist(0x10000000000000001111000000001111, 0xFF) = 0x63CA639CCA6363636382829C82826363 +imc (0x10000000000000001111000000001111) = 0xE0B0D090000000007755664466447755 +pclmul(0x10000000000000001111000000001111, 0x00) = 0x065DF10EFFF108ACF75DFFF10EF10653 +pclmul(0x10000000000000001111000000001111, 0x01) = 0x065933390A333F59356A0A3339000653 +pclmul(0x10000000000000001111000000001111, 0x10) = 0x06382826382826363000000000000000 +pclmul(0x10000000000000001111000000001111, 0xFF) = 0x063CA6363CA636363000000000000000 +enc (0x20000000000000002222000000002222, 0x00000000000000000000000000000000) = 0x636893989868939363636363DBF4474C +enclast(0x20000000000000002222000000002222, 0x00000000000000000000000000000000) = 0x639393639363636363636363B7636393 +dec (0x20000000000000002222000000002222, 0x00000000000000000000000000000000) = 0xFE9A69CB76687C64CBFE9A69A1F06736 +declast(0x20000000000000002222000000002222, 0x00000000000000000000000000000000) = 0x52945252545252525252945294525294 +enc (0x20000000000000002222000000002222, 0x10000000000000001111000000001111) = 0x736893989868939372726363DBF4565D +enclast(0x20000000000000002222000000002222, 0x10000000000000001111000000001111) = 0x739393639363636372726363B7637282 +dec (0x20000000000000002222000000002222, 0x10000000000000001111000000001111) = 0xEE9A69CB76687C64DAEF9A69A1F07627 +declast(0x20000000000000002222000000002222, 0x10000000000000001111000000001111) = 0x42945252545252524343945294524385 +enc (0x20000000000000002222000000002222, 0x20000000000000002222000000002222) = 0x436893989868939341416363DBF4656E +enclast(0x20000000000000002222000000002222, 0x20000000000000002222000000002222) = 0x439393639363636341416363B76341B1 +dec (0x20000000000000002222000000002222, 0x20000000000000002222000000002222) = 0xDE9A69CB76687C64E9DC9A69A1F04514 +declast(0x20000000000000002222000000002222, 0x20000000000000002222000000002222) = 0x729452525452525270709452945270B6 +enc (0x20000000000000002222000000002222, 0x30000000000000003333000000003333) = 0x536893989868939350506363DBF4747F +enclast(0x20000000000000002222000000002222, 0x30000000000000003333000000003333) = 0x539393639363636350506363B76350A0 +dec (0x20000000000000002222000000002222, 0x30000000000000003333000000003333) = 0xCE9A69CB76687C64F8CD9A69A1F05405 +declast(0x20000000000000002222000000002222, 0x30000000000000003333000000003333) = 0x629452525452525261619452945261A7 +enc (0x20000000000000002222000000002222, 0x40000000000000004444000000004444) = 0x236893989868939327276363DBF40308 +enclast(0x20000000000000002222000000002222, 0x40000000000000004444000000004444) = 0x239393639363636327276363B76327D7 +dec (0x20000000000000002222000000002222, 0x40000000000000004444000000004444) = 0xBE9A69CB76687C648FBA9A69A1F02372 +declast(0x20000000000000002222000000002222, 0x40000000000000004444000000004444) = 0x129452525452525216169452945216D0 +enc (0x20000000000000002222000000002222, 0x50000000000000005555000000005555) = 0x336893989868939336366363DBF41219 +enclast(0x20000000000000002222000000002222, 0x50000000000000005555000000005555) = 0x339393639363636336366363B76336C6 +dec (0x20000000000000002222000000002222, 0x50000000000000005555000000005555) = 0xAE9A69CB76687C649EAB9A69A1F03263 +declast(0x20000000000000002222000000002222, 0x50000000000000005555000000005555) = 0x029452525452525207079452945207C1 +enc (0x20000000000000002222000000002222, 0x60000000000000006666000000006666) = 0x036893989868939305056363DBF4212A +enclast(0x20000000000000002222000000002222, 0x60000000000000006666000000006666) = 0x039393639363636305056363B76305F5 +dec (0x20000000000000002222000000002222, 0x60000000000000006666000000006666) = 0x9E9A69CB76687C64AD989A69A1F00150 +declast(0x20000000000000002222000000002222, 0x60000000000000006666000000006666) = 0x329452525452525234349452945234F2 +enc (0x20000000000000002222000000002222, 0x70000000000000007777000000007777) = 0x136893989868939314146363DBF4303B +enclast(0x20000000000000002222000000002222, 0x70000000000000007777000000007777) = 0x139393639363636314146363B76314E4 +dec (0x20000000000000002222000000002222, 0x70000000000000007777000000007777) = 0x8E9A69CB76687C64BC899A69A1F01041 +declast(0x20000000000000002222000000002222, 0x70000000000000007777000000007777) = 0x229452525452525225259452945225E3 +enc (0x20000000000000002222000000002222, 0x80000000000000008888000000008888) = 0xE368939898689393EBEB6363DBF4CFC4 +enclast(0x20000000000000002222000000002222, 0x80000000000000008888000000008888) = 0xE393936393636363EBEB6363B763EB1B +dec (0x20000000000000002222000000002222, 0x80000000000000008888000000008888) = 0x7E9A69CB76687C6443769A69A1F0EFBE +declast(0x20000000000000002222000000002222, 0x80000000000000008888000000008888) = 0xD294525254525252DADA94529452DA1C +enc (0x20000000000000002222000000002222, 0x90000000000000009999000000009999) = 0xF368939898689393FAFA6363DBF4DED5 +enclast(0x20000000000000002222000000002222, 0x90000000000000009999000000009999) = 0xF393936393636363FAFA6363B763FA0A +dec (0x20000000000000002222000000002222, 0x90000000000000009999000000009999) = 0x6E9A69CB76687C6452679A69A1F0FEAF +declast(0x20000000000000002222000000002222, 0x90000000000000009999000000009999) = 0xC294525254525252CBCB94529452CB0D +enc (0x20000000000000002222000000002222, 0xA000000000000000AAAA00000000AAAA) = 0xC368939898689393C9C96363DBF4EDE6 +enclast(0x20000000000000002222000000002222, 0xA000000000000000AAAA00000000AAAA) = 0xC393936393636363C9C96363B763C939 +dec (0x20000000000000002222000000002222, 0xA000000000000000AAAA00000000AAAA) = 0x5E9A69CB76687C6461549A69A1F0CD9C +declast(0x20000000000000002222000000002222, 0xA000000000000000AAAA00000000AAAA) = 0xF294525254525252F8F894529452F83E +enc (0x20000000000000002222000000002222, 0xB000000000000000BBBB00000000BBBB) = 0xD368939898689393D8D86363DBF4FCF7 +enclast(0x20000000000000002222000000002222, 0xB000000000000000BBBB00000000BBBB) = 0xD393936393636363D8D86363B763D828 +dec (0x20000000000000002222000000002222, 0xB000000000000000BBBB00000000BBBB) = 0x4E9A69CB76687C6470459A69A1F0DC8D +declast(0x20000000000000002222000000002222, 0xB000000000000000BBBB00000000BBBB) = 0xE294525254525252E9E994529452E92F +enc (0x20000000000000002222000000002222, 0xC000000000000000CCCC00000000CCCC) = 0xA368939898689393AFAF6363DBF48B80 +enclast(0x20000000000000002222000000002222, 0xC000000000000000CCCC00000000CCCC) = 0xA393936393636363AFAF6363B763AF5F +dec (0x20000000000000002222000000002222, 0xC000000000000000CCCC00000000CCCC) = 0x3E9A69CB76687C6407329A69A1F0ABFA +declast(0x20000000000000002222000000002222, 0xC000000000000000CCCC00000000CCCC) = 0x92945252545252529E9E945294529E58 +enc (0x20000000000000002222000000002222, 0xD000000000000000DDDD00000000DDDD) = 0xB368939898689393BEBE6363DBF49A91 +enclast(0x20000000000000002222000000002222, 0xD000000000000000DDDD00000000DDDD) = 0xB393936393636363BEBE6363B763BE4E +dec (0x20000000000000002222000000002222, 0xD000000000000000DDDD00000000DDDD) = 0x2E9A69CB76687C6416239A69A1F0BAEB +declast(0x20000000000000002222000000002222, 0xD000000000000000DDDD00000000DDDD) = 0x82945252545252528F8F945294528F49 +enc (0x20000000000000002222000000002222, 0xE000000000000000EEEE00000000EEEE) = 0x83689398986893938D8D6363DBF4A9A2 +enclast(0x20000000000000002222000000002222, 0xE000000000000000EEEE00000000EEEE) = 0x83939363936363638D8D6363B7638D7D +dec (0x20000000000000002222000000002222, 0xE000000000000000EEEE00000000EEEE) = 0x1E9A69CB76687C6425109A69A1F089D8 +declast(0x20000000000000002222000000002222, 0xE000000000000000EEEE00000000EEEE) = 0xB294525254525252BCBC94529452BC7A +enc (0x20000000000000002222000000002222, 0xF000000000000000FFFF00000000FFFF) = 0x93689398986893939C9C6363DBF4B8B3 +enclast(0x20000000000000002222000000002222, 0xF000000000000000FFFF00000000FFFF) = 0x93939363936363639C9C6363B7639C6C +dec (0x20000000000000002222000000002222, 0xF000000000000000FFFF00000000FFFF) = 0x0E9A69CB76687C6434019A69A1F098C9 +declast(0x20000000000000002222000000002222, 0xF000000000000000FFFF00000000FFFF) = 0xA294525254525252ADAD94529452AD6B +keygenassist(0x20000000000000002222000000002222, 0x00) = 0x63B76363B76363636393936393936363 +keygenassist(0x20000000000000002222000000002222, 0x01) = 0x63B76362B76363636393936293936363 +keygenassist(0x20000000000000002222000000002222, 0x02) = 0x63B76361B76363636393936193936363 +keygenassist(0x20000000000000002222000000002222, 0x04) = 0x63B76367B76363636393936793936363 +keygenassist(0x20000000000000002222000000002222, 0x08) = 0x63B7636BB76363636393936B93936363 +keygenassist(0x20000000000000002222000000002222, 0x10) = 0x63B76373B76363636393937393936363 +keygenassist(0x20000000000000002222000000002222, 0x38) = 0x63B7635BB76363636393935B93936363 +keygenassist(0x20000000000000002222000000002222, 0x4F) = 0x63B7632CB76363636393932C93936363 +keygenassist(0x20000000000000002222000000002222, 0xFF) = 0x63B7639CB76363636393939C93936363 +imc (0x20000000000000002222000000002222) = 0xDB7BBB3B00000000EEAACC88CC88EEAA +pclmul(0x20000000000000002222000000002222, 0x00) = 0x0CB9E01FFFE01359ECB9FFE01FE00CA6 +pclmul(0x20000000000000002222000000002222, 0x01) = 0x0CBD33281B3324BD3F8E1B3328000CA6 +pclmul(0x20000000000000002222000000002222, 0x10) = 0x0C72726C72726C6C6000000000000000 +pclmul(0x20000000000000002222000000002222, 0xFF) = 0x0C76EC6C76EC6C6C6000000000000000 +enc (0x30000000000000003333000000003333, 0x00000000000000000000000000000000) = 0x6398C3383898C3C363636363566AA45F +enclast(0x30000000000000003333000000003333, 0x00000000000000000000000000000000) = 0x63C3C363C363636363636363046363C3 +dec (0x30000000000000003333000000003333, 0x00000000000000000000000000000000) = 0xDD51B50D735A9DEE0DDD51B5B6EA82DE +declast(0x30000000000000003333000000003333, 0x00000000000000000000000000000000) = 0x52665252085252525252665266525266 +enc (0x30000000000000003333000000003333, 0x10000000000000001111000000001111) = 0x7398C3383898C3C372726363566AB54E +enclast(0x30000000000000003333000000003333, 0x10000000000000001111000000001111) = 0x73C3C363C363636372726363046372D2 +dec (0x30000000000000003333000000003333, 0x10000000000000001111000000001111) = 0xCD51B50D735A9DEE1CCC51B5B6EA93CF +declast(0x30000000000000003333000000003333, 0x10000000000000001111000000001111) = 0x42665252085252524343665266524377 +enc (0x30000000000000003333000000003333, 0x20000000000000002222000000002222) = 0x4398C3383898C3C341416363566A867D +enclast(0x30000000000000003333000000003333, 0x20000000000000002222000000002222) = 0x43C3C363C363636341416363046341E1 +dec (0x30000000000000003333000000003333, 0x20000000000000002222000000002222) = 0xFD51B50D735A9DEE2FFF51B5B6EAA0FC +declast(0x30000000000000003333000000003333, 0x20000000000000002222000000002222) = 0x72665252085252527070665266527044 +enc (0x30000000000000003333000000003333, 0x30000000000000003333000000003333) = 0x5398C3383898C3C350506363566A976C +enclast(0x30000000000000003333000000003333, 0x30000000000000003333000000003333) = 0x53C3C363C363636350506363046350F0 +dec (0x30000000000000003333000000003333, 0x30000000000000003333000000003333) = 0xED51B50D735A9DEE3EEE51B5B6EAB1ED +declast(0x30000000000000003333000000003333, 0x30000000000000003333000000003333) = 0x62665252085252526161665266526155 +enc (0x30000000000000003333000000003333, 0x40000000000000004444000000004444) = 0x2398C3383898C3C327276363566AE01B +enclast(0x30000000000000003333000000003333, 0x40000000000000004444000000004444) = 0x23C3C363C36363632727636304632787 +dec (0x30000000000000003333000000003333, 0x40000000000000004444000000004444) = 0x9D51B50D735A9DEE499951B5B6EAC69A +declast(0x30000000000000003333000000003333, 0x40000000000000004444000000004444) = 0x12665252085252521616665266521622 +enc (0x30000000000000003333000000003333, 0x50000000000000005555000000005555) = 0x3398C3383898C3C336366363566AF10A +enclast(0x30000000000000003333000000003333, 0x50000000000000005555000000005555) = 0x33C3C363C36363633636636304633696 +dec (0x30000000000000003333000000003333, 0x50000000000000005555000000005555) = 0x8D51B50D735A9DEE588851B5B6EAD78B +declast(0x30000000000000003333000000003333, 0x50000000000000005555000000005555) = 0x02665252085252520707665266520733 +enc (0x30000000000000003333000000003333, 0x60000000000000006666000000006666) = 0x0398C3383898C3C305056363566AC239 +enclast(0x30000000000000003333000000003333, 0x60000000000000006666000000006666) = 0x03C3C363C363636305056363046305A5 +dec (0x30000000000000003333000000003333, 0x60000000000000006666000000006666) = 0xBD51B50D735A9DEE6BBB51B5B6EAE4B8 +declast(0x30000000000000003333000000003333, 0x60000000000000006666000000006666) = 0x32665252085252523434665266523400 +enc (0x30000000000000003333000000003333, 0x70000000000000007777000000007777) = 0x1398C3383898C3C314146363566AD328 +enclast(0x30000000000000003333000000003333, 0x70000000000000007777000000007777) = 0x13C3C363C363636314146363046314B4 +dec (0x30000000000000003333000000003333, 0x70000000000000007777000000007777) = 0xAD51B50D735A9DEE7AAA51B5B6EAF5A9 +declast(0x30000000000000003333000000003333, 0x70000000000000007777000000007777) = 0x22665252085252522525665266522511 +enc (0x30000000000000003333000000003333, 0x80000000000000008888000000008888) = 0xE398C3383898C3C3EBEB6363566A2CD7 +enclast(0x30000000000000003333000000003333, 0x80000000000000008888000000008888) = 0xE3C3C363C3636363EBEB63630463EB4B +dec (0x30000000000000003333000000003333, 0x80000000000000008888000000008888) = 0x5D51B50D735A9DEE855551B5B6EA0A56 +declast(0x30000000000000003333000000003333, 0x80000000000000008888000000008888) = 0xD266525208525252DADA66526652DAEE +enc (0x30000000000000003333000000003333, 0x90000000000000009999000000009999) = 0xF398C3383898C3C3FAFA6363566A3DC6 +enclast(0x30000000000000003333000000003333, 0x90000000000000009999000000009999) = 0xF3C3C363C3636363FAFA63630463FA5A +dec (0x30000000000000003333000000003333, 0x90000000000000009999000000009999) = 0x4D51B50D735A9DEE944451B5B6EA1B47 +declast(0x30000000000000003333000000003333, 0x90000000000000009999000000009999) = 0xC266525208525252CBCB66526652CBFF +enc (0x30000000000000003333000000003333, 0xA000000000000000AAAA00000000AAAA) = 0xC398C3383898C3C3C9C96363566A0EF5 +enclast(0x30000000000000003333000000003333, 0xA000000000000000AAAA00000000AAAA) = 0xC3C3C363C3636363C9C963630463C969 +dec (0x30000000000000003333000000003333, 0xA000000000000000AAAA00000000AAAA) = 0x7D51B50D735A9DEEA77751B5B6EA2874 +declast(0x30000000000000003333000000003333, 0xA000000000000000AAAA00000000AAAA) = 0xF266525208525252F8F866526652F8CC +enc (0x30000000000000003333000000003333, 0xB000000000000000BBBB00000000BBBB) = 0xD398C3383898C3C3D8D86363566A1FE4 +enclast(0x30000000000000003333000000003333, 0xB000000000000000BBBB00000000BBBB) = 0xD3C3C363C3636363D8D863630463D878 +dec (0x30000000000000003333000000003333, 0xB000000000000000BBBB00000000BBBB) = 0x6D51B50D735A9DEEB66651B5B6EA3965 +declast(0x30000000000000003333000000003333, 0xB000000000000000BBBB00000000BBBB) = 0xE266525208525252E9E966526652E9DD +enc (0x30000000000000003333000000003333, 0xC000000000000000CCCC00000000CCCC) = 0xA398C3383898C3C3AFAF6363566A6893 +enclast(0x30000000000000003333000000003333, 0xC000000000000000CCCC00000000CCCC) = 0xA3C3C363C3636363AFAF63630463AF0F +dec (0x30000000000000003333000000003333, 0xC000000000000000CCCC00000000CCCC) = 0x1D51B50D735A9DEEC11151B5B6EA4E12 +declast(0x30000000000000003333000000003333, 0xC000000000000000CCCC00000000CCCC) = 0x92665252085252529E9E665266529EAA +enc (0x30000000000000003333000000003333, 0xD000000000000000DDDD00000000DDDD) = 0xB398C3383898C3C3BEBE6363566A7982 +enclast(0x30000000000000003333000000003333, 0xD000000000000000DDDD00000000DDDD) = 0xB3C3C363C3636363BEBE63630463BE1E +dec (0x30000000000000003333000000003333, 0xD000000000000000DDDD00000000DDDD) = 0x0D51B50D735A9DEED00051B5B6EA5F03 +declast(0x30000000000000003333000000003333, 0xD000000000000000DDDD00000000DDDD) = 0x82665252085252528F8F665266528FBB +enc (0x30000000000000003333000000003333, 0xE000000000000000EEEE00000000EEEE) = 0x8398C3383898C3C38D8D6363566A4AB1 +enclast(0x30000000000000003333000000003333, 0xE000000000000000EEEE00000000EEEE) = 0x83C3C363C36363638D8D636304638D2D +dec (0x30000000000000003333000000003333, 0xE000000000000000EEEE00000000EEEE) = 0x3D51B50D735A9DEEE33351B5B6EA6C30 +declast(0x30000000000000003333000000003333, 0xE000000000000000EEEE00000000EEEE) = 0xB266525208525252BCBC66526652BC88 +enc (0x30000000000000003333000000003333, 0xF000000000000000FFFF00000000FFFF) = 0x9398C3383898C3C39C9C6363566A5BA0 +enclast(0x30000000000000003333000000003333, 0xF000000000000000FFFF00000000FFFF) = 0x93C3C363C36363639C9C636304639C3C +dec (0x30000000000000003333000000003333, 0xF000000000000000FFFF00000000FFFF) = 0x2D51B50D735A9DEEF22251B5B6EA7D21 +declast(0x30000000000000003333000000003333, 0xF000000000000000FFFF00000000FFFF) = 0xA266525208525252ADAD66526652AD99 +keygenassist(0x30000000000000003333000000003333, 0x00) = 0x630463630463636363C3C363C3C36363 +keygenassist(0x30000000000000003333000000003333, 0x01) = 0x630463620463636363C3C362C3C36363 +keygenassist(0x30000000000000003333000000003333, 0x02) = 0x630463610463636363C3C361C3C36363 +keygenassist(0x30000000000000003333000000003333, 0x04) = 0x630463670463636363C3C367C3C36363 +keygenassist(0x30000000000000003333000000003333, 0x08) = 0x6304636B0463636363C3C36BC3C36363 +keygenassist(0x30000000000000003333000000003333, 0x10) = 0x630463730463636363C3C373C3C36363 +keygenassist(0x30000000000000003333000000003333, 0x38) = 0x6304635B0463636363C3C35BC3C36363 +keygenassist(0x30000000000000003333000000003333, 0x4F) = 0x6304632C0463636363C3C32CC3C36363 +keygenassist(0x30000000000000003333000000003333, 0xFF) = 0x6304639C0463636363C3C39CC3C36363 +imc (0x30000000000000003333000000003333) = 0x3BCB6BAB0000000099FFAACCAACC99FF +pclmul(0x30000000000000003333000000003333, 0x00) = 0x0AEAE01FFFE0150AEAEAFFE01FE00AF5 +pclmul(0x30000000000000003333000000003333, 0x01) = 0x0AFF33390A3333FF39CC0A3339000AF5 +pclmul(0x30000000000000003333000000003333, 0x10) = 0x0A44445A44445A5A5000000000000000 +pclmul(0x30000000000000003333000000003333, 0xFF) = 0x0A50CA5A50CA5A5A5000000000000000 +enc (0x40000000000000004444000000004444, 0x00000000000000000000000000000000) = 0x63EB1B9393EB1B1B636363633FA571F9 +enclast(0x40000000000000004444000000004444, 0x00000000000000000000000000000000) = 0x631B1B631B636363636363630963631B +dec (0x40000000000000004444000000004444, 0x00000000000000000000000000000000) = 0x7C66CF018929E969017C66CFFB9C2F48 +declast(0x40000000000000004444000000004444, 0x00000000000000000000000000000000) = 0x52865252725252525252865286525286 +enc (0x40000000000000004444000000004444, 0x10000000000000001111000000001111) = 0x73EB1B9393EB1B1B727263633FA560E8 +enclast(0x40000000000000004444000000004444, 0x10000000000000001111000000001111) = 0x731B1B631B636363727263630963720A +dec (0x40000000000000004444000000004444, 0x10000000000000001111000000001111) = 0x6C66CF018929E969106D66CFFB9C3E59 +declast(0x40000000000000004444000000004444, 0x10000000000000001111000000001111) = 0x42865252725252524343865286524397 +enc (0x40000000000000004444000000004444, 0x20000000000000002222000000002222) = 0x43EB1B9393EB1B1B414163633FA553DB +enclast(0x40000000000000004444000000004444, 0x20000000000000002222000000002222) = 0x431B1B631B6363634141636309634139 +dec (0x40000000000000004444000000004444, 0x20000000000000002222000000002222) = 0x5C66CF018929E969235E66CFFB9C0D6A +declast(0x40000000000000004444000000004444, 0x20000000000000002222000000002222) = 0x728652527252525270708652865270A4 +enc (0x40000000000000004444000000004444, 0x30000000000000003333000000003333) = 0x53EB1B9393EB1B1B505063633FA542CA +enclast(0x40000000000000004444000000004444, 0x30000000000000003333000000003333) = 0x531B1B631B6363635050636309635028 +dec (0x40000000000000004444000000004444, 0x30000000000000003333000000003333) = 0x4C66CF018929E969324F66CFFB9C1C7B +declast(0x40000000000000004444000000004444, 0x30000000000000003333000000003333) = 0x628652527252525261618652865261B5 +enc (0x40000000000000004444000000004444, 0x40000000000000004444000000004444) = 0x23EB1B9393EB1B1B272763633FA535BD +enclast(0x40000000000000004444000000004444, 0x40000000000000004444000000004444) = 0x231B1B631B636363272763630963275F +dec (0x40000000000000004444000000004444, 0x40000000000000004444000000004444) = 0x3C66CF018929E969453866CFFB9C6B0C +declast(0x40000000000000004444000000004444, 0x40000000000000004444000000004444) = 0x128652527252525216168652865216C2 +enc (0x40000000000000004444000000004444, 0x50000000000000005555000000005555) = 0x33EB1B9393EB1B1B363663633FA524AC +enclast(0x40000000000000004444000000004444, 0x50000000000000005555000000005555) = 0x331B1B631B636363363663630963364E +dec (0x40000000000000004444000000004444, 0x50000000000000005555000000005555) = 0x2C66CF018929E969542966CFFB9C7A1D +declast(0x40000000000000004444000000004444, 0x50000000000000005555000000005555) = 0x028652527252525207078652865207D3 +enc (0x40000000000000004444000000004444, 0x60000000000000006666000000006666) = 0x03EB1B9393EB1B1B050563633FA5179F +enclast(0x40000000000000004444000000004444, 0x60000000000000006666000000006666) = 0x031B1B631B636363050563630963057D +dec (0x40000000000000004444000000004444, 0x60000000000000006666000000006666) = 0x1C66CF018929E969671A66CFFB9C492E +declast(0x40000000000000004444000000004444, 0x60000000000000006666000000006666) = 0x328652527252525234348652865234E0 +enc (0x40000000000000004444000000004444, 0x70000000000000007777000000007777) = 0x13EB1B9393EB1B1B141463633FA5068E +enclast(0x40000000000000004444000000004444, 0x70000000000000007777000000007777) = 0x131B1B631B636363141463630963146C +dec (0x40000000000000004444000000004444, 0x70000000000000007777000000007777) = 0x0C66CF018929E969760B66CFFB9C583F +declast(0x40000000000000004444000000004444, 0x70000000000000007777000000007777) = 0x228652527252525225258652865225F1 +enc (0x40000000000000004444000000004444, 0x80000000000000008888000000008888) = 0xE3EB1B9393EB1B1BEBEB63633FA5F971 +enclast(0x40000000000000004444000000004444, 0x80000000000000008888000000008888) = 0xE31B1B631B636363EBEB63630963EB93 +dec (0x40000000000000004444000000004444, 0x80000000000000008888000000008888) = 0xFC66CF018929E96989F466CFFB9CA7C0 +declast(0x40000000000000004444000000004444, 0x80000000000000008888000000008888) = 0xD286525272525252DADA86528652DA0E +enc (0x40000000000000004444000000004444, 0x90000000000000009999000000009999) = 0xF3EB1B9393EB1B1BFAFA63633FA5E860 +enclast(0x40000000000000004444000000004444, 0x90000000000000009999000000009999) = 0xF31B1B631B636363FAFA63630963FA82 +dec (0x40000000000000004444000000004444, 0x90000000000000009999000000009999) = 0xEC66CF018929E96998E566CFFB9CB6D1 +declast(0x40000000000000004444000000004444, 0x90000000000000009999000000009999) = 0xC286525272525252CBCB86528652CB1F +enc (0x40000000000000004444000000004444, 0xA000000000000000AAAA00000000AAAA) = 0xC3EB1B9393EB1B1BC9C963633FA5DB53 +enclast(0x40000000000000004444000000004444, 0xA000000000000000AAAA00000000AAAA) = 0xC31B1B631B636363C9C963630963C9B1 +dec (0x40000000000000004444000000004444, 0xA000000000000000AAAA00000000AAAA) = 0xDC66CF018929E969ABD666CFFB9C85E2 +declast(0x40000000000000004444000000004444, 0xA000000000000000AAAA00000000AAAA) = 0xF286525272525252F8F886528652F82C +enc (0x40000000000000004444000000004444, 0xB000000000000000BBBB00000000BBBB) = 0xD3EB1B9393EB1B1BD8D863633FA5CA42 +enclast(0x40000000000000004444000000004444, 0xB000000000000000BBBB00000000BBBB) = 0xD31B1B631B636363D8D863630963D8A0 +dec (0x40000000000000004444000000004444, 0xB000000000000000BBBB00000000BBBB) = 0xCC66CF018929E969BAC766CFFB9C94F3 +declast(0x40000000000000004444000000004444, 0xB000000000000000BBBB00000000BBBB) = 0xE286525272525252E9E986528652E93D +enc (0x40000000000000004444000000004444, 0xC000000000000000CCCC00000000CCCC) = 0xA3EB1B9393EB1B1BAFAF63633FA5BD35 +enclast(0x40000000000000004444000000004444, 0xC000000000000000CCCC00000000CCCC) = 0xA31B1B631B636363AFAF63630963AFD7 +dec (0x40000000000000004444000000004444, 0xC000000000000000CCCC00000000CCCC) = 0xBC66CF018929E969CDB066CFFB9CE384 +declast(0x40000000000000004444000000004444, 0xC000000000000000CCCC00000000CCCC) = 0x92865252725252529E9E865286529E4A +enc (0x40000000000000004444000000004444, 0xD000000000000000DDDD00000000DDDD) = 0xB3EB1B9393EB1B1BBEBE63633FA5AC24 +enclast(0x40000000000000004444000000004444, 0xD000000000000000DDDD00000000DDDD) = 0xB31B1B631B636363BEBE63630963BEC6 +dec (0x40000000000000004444000000004444, 0xD000000000000000DDDD00000000DDDD) = 0xAC66CF018929E969DCA166CFFB9CF295 +declast(0x40000000000000004444000000004444, 0xD000000000000000DDDD00000000DDDD) = 0x82865252725252528F8F865286528F5B +enc (0x40000000000000004444000000004444, 0xE000000000000000EEEE00000000EEEE) = 0x83EB1B9393EB1B1B8D8D63633FA59F17 +enclast(0x40000000000000004444000000004444, 0xE000000000000000EEEE00000000EEEE) = 0x831B1B631B6363638D8D636309638DF5 +dec (0x40000000000000004444000000004444, 0xE000000000000000EEEE00000000EEEE) = 0x9C66CF018929E969EF9266CFFB9CC1A6 +declast(0x40000000000000004444000000004444, 0xE000000000000000EEEE00000000EEEE) = 0xB286525272525252BCBC86528652BC68 +enc (0x40000000000000004444000000004444, 0xF000000000000000FFFF00000000FFFF) = 0x93EB1B9393EB1B1B9C9C63633FA58E06 +enclast(0x40000000000000004444000000004444, 0xF000000000000000FFFF00000000FFFF) = 0x931B1B631B6363639C9C636309639CE4 +dec (0x40000000000000004444000000004444, 0xF000000000000000FFFF00000000FFFF) = 0x8C66CF018929E969FE8366CFFB9CD0B7 +declast(0x40000000000000004444000000004444, 0xF000000000000000FFFF00000000FFFF) = 0xA286525272525252ADAD86528652AD79 +keygenassist(0x40000000000000004444000000004444, 0x00) = 0x6309636309636363631B1B631B1B6363 +keygenassist(0x40000000000000004444000000004444, 0x01) = 0x6309636209636363631B1B621B1B6363 +keygenassist(0x40000000000000004444000000004444, 0x02) = 0x6309636109636363631B1B611B1B6363 +keygenassist(0x40000000000000004444000000004444, 0x04) = 0x6309636709636363631B1B671B1B6363 +keygenassist(0x40000000000000004444000000004444, 0x08) = 0x6309636B09636363631B1B6B1B1B6363 +keygenassist(0x40000000000000004444000000004444, 0x10) = 0x6309637309636363631B1B731B1B6363 +keygenassist(0x40000000000000004444000000004444, 0x38) = 0x6309635B09636363631B1B5B1B1B6363 +keygenassist(0x40000000000000004444000000004444, 0x4F) = 0x6309632C09636363631B1B2C1B1B6363 +keygenassist(0x40000000000000004444000000004444, 0xFF) = 0x6309639C09636363631B1B9C1B1B6363 +imc (0x40000000000000004444000000004444) = 0xADF66D7600000000C74F830B830BC74F +pclmul(0x40000000000000004444000000004444, 0x00) = 0x1953E01FFFE006B3F953FFE01FE0194C +pclmul(0x40000000000000004444000000004444, 0x01) = 0x195733281B3331572A641B332800194C +pclmul(0x40000000000000004444000000004444, 0x10) = 0x18C6C6D8C6C6D8D8C000000000000000 +pclmul(0x40000000000000004444000000004444, 0xFF) = 0x18C258D8C258D8D8C000000000000000 +enc (0x50000000000000005555000000005555, 0x00000000000000000000000000000000) = 0x63D9FC4646D9FCFC63636363B9ACCC76 +enclast(0x50000000000000005555000000005555, 0x00000000000000000000000000000000) = 0x63FCFC63FC63636363636363536363FC +dec (0x50000000000000005555000000005555, 0x00000000000000000000000000000000) = 0x627207A83DFB7F87A862720727FD9842 +declast(0x50000000000000005555000000005555, 0x00000000000000000000000000000000) = 0x52ED52526C5252525252ED52ED5252ED +enc (0x50000000000000005555000000005555, 0x10000000000000001111000000001111) = 0x73D9FC4646D9FCFC72726363B9ACDD67 +enclast(0x50000000000000005555000000005555, 0x10000000000000001111000000001111) = 0x73FCFC63FC63636372726363536372ED +dec (0x50000000000000005555000000005555, 0x10000000000000001111000000001111) = 0x727207A83DFB7F87B973720727FD8953 +declast(0x50000000000000005555000000005555, 0x10000000000000001111000000001111) = 0x42ED52526C5252524343ED52ED5243FC +enc (0x50000000000000005555000000005555, 0x20000000000000002222000000002222) = 0x43D9FC4646D9FCFC41416363B9ACEE54 +enclast(0x50000000000000005555000000005555, 0x20000000000000002222000000002222) = 0x43FCFC63FC63636341416363536341DE +dec (0x50000000000000005555000000005555, 0x20000000000000002222000000002222) = 0x427207A83DFB7F878A40720727FDBA60 +declast(0x50000000000000005555000000005555, 0x20000000000000002222000000002222) = 0x72ED52526C5252527070ED52ED5270CF +enc (0x50000000000000005555000000005555, 0x30000000000000003333000000003333) = 0x53D9FC4646D9FCFC50506363B9ACFF45 +enclast(0x50000000000000005555000000005555, 0x30000000000000003333000000003333) = 0x53FCFC63FC63636350506363536350CF +dec (0x50000000000000005555000000005555, 0x30000000000000003333000000003333) = 0x527207A83DFB7F879B51720727FDAB71 +declast(0x50000000000000005555000000005555, 0x30000000000000003333000000003333) = 0x62ED52526C5252526161ED52ED5261DE +enc (0x50000000000000005555000000005555, 0x40000000000000004444000000004444) = 0x23D9FC4646D9FCFC27276363B9AC8832 +enclast(0x50000000000000005555000000005555, 0x40000000000000004444000000004444) = 0x23FCFC63FC63636327276363536327B8 +dec (0x50000000000000005555000000005555, 0x40000000000000004444000000004444) = 0x227207A83DFB7F87EC26720727FDDC06 +declast(0x50000000000000005555000000005555, 0x40000000000000004444000000004444) = 0x12ED52526C5252521616ED52ED5216A9 +enc (0x50000000000000005555000000005555, 0x50000000000000005555000000005555) = 0x33D9FC4646D9FCFC36366363B9AC9923 +enclast(0x50000000000000005555000000005555, 0x50000000000000005555000000005555) = 0x33FCFC63FC63636336366363536336A9 +dec (0x50000000000000005555000000005555, 0x50000000000000005555000000005555) = 0x327207A83DFB7F87FD37720727FDCD17 +declast(0x50000000000000005555000000005555, 0x50000000000000005555000000005555) = 0x02ED52526C5252520707ED52ED5207B8 +enc (0x50000000000000005555000000005555, 0x60000000000000006666000000006666) = 0x03D9FC4646D9FCFC05056363B9ACAA10 +enclast(0x50000000000000005555000000005555, 0x60000000000000006666000000006666) = 0x03FCFC63FC636363050563635363059A +dec (0x50000000000000005555000000005555, 0x60000000000000006666000000006666) = 0x027207A83DFB7F87CE04720727FDFE24 +declast(0x50000000000000005555000000005555, 0x60000000000000006666000000006666) = 0x32ED52526C5252523434ED52ED52348B +enc (0x50000000000000005555000000005555, 0x70000000000000007777000000007777) = 0x13D9FC4646D9FCFC14146363B9ACBB01 +enclast(0x50000000000000005555000000005555, 0x70000000000000007777000000007777) = 0x13FCFC63FC636363141463635363148B +dec (0x50000000000000005555000000005555, 0x70000000000000007777000000007777) = 0x127207A83DFB7F87DF15720727FDEF35 +declast(0x50000000000000005555000000005555, 0x70000000000000007777000000007777) = 0x22ED52526C5252522525ED52ED52259A +enc (0x50000000000000005555000000005555, 0x80000000000000008888000000008888) = 0xE3D9FC4646D9FCFCEBEB6363B9AC44FE +enclast(0x50000000000000005555000000005555, 0x80000000000000008888000000008888) = 0xE3FCFC63FC636363EBEB63635363EB74 +dec (0x50000000000000005555000000005555, 0x80000000000000008888000000008888) = 0xE27207A83DFB7F8720EA720727FD10CA +declast(0x50000000000000005555000000005555, 0x80000000000000008888000000008888) = 0xD2ED52526C525252DADAED52ED52DA65 +enc (0x50000000000000005555000000005555, 0x90000000000000009999000000009999) = 0xF3D9FC4646D9FCFCFAFA6363B9AC55EF +enclast(0x50000000000000005555000000005555, 0x90000000000000009999000000009999) = 0xF3FCFC63FC636363FAFA63635363FA65 +dec (0x50000000000000005555000000005555, 0x90000000000000009999000000009999) = 0xF27207A83DFB7F8731FB720727FD01DB +declast(0x50000000000000005555000000005555, 0x90000000000000009999000000009999) = 0xC2ED52526C525252CBCBED52ED52CB74 +enc (0x50000000000000005555000000005555, 0xA000000000000000AAAA00000000AAAA) = 0xC3D9FC4646D9FCFCC9C96363B9AC66DC +enclast(0x50000000000000005555000000005555, 0xA000000000000000AAAA00000000AAAA) = 0xC3FCFC63FC636363C9C963635363C956 +dec (0x50000000000000005555000000005555, 0xA000000000000000AAAA00000000AAAA) = 0xC27207A83DFB7F8702C8720727FD32E8 +declast(0x50000000000000005555000000005555, 0xA000000000000000AAAA00000000AAAA) = 0xF2ED52526C525252F8F8ED52ED52F847 +enc (0x50000000000000005555000000005555, 0xB000000000000000BBBB00000000BBBB) = 0xD3D9FC4646D9FCFCD8D86363B9AC77CD +enclast(0x50000000000000005555000000005555, 0xB000000000000000BBBB00000000BBBB) = 0xD3FCFC63FC636363D8D863635363D847 +dec (0x50000000000000005555000000005555, 0xB000000000000000BBBB00000000BBBB) = 0xD27207A83DFB7F8713D9720727FD23F9 +declast(0x50000000000000005555000000005555, 0xB000000000000000BBBB00000000BBBB) = 0xE2ED52526C525252E9E9ED52ED52E956 +enc (0x50000000000000005555000000005555, 0xC000000000000000CCCC00000000CCCC) = 0xA3D9FC4646D9FCFCAFAF6363B9AC00BA +enclast(0x50000000000000005555000000005555, 0xC000000000000000CCCC00000000CCCC) = 0xA3FCFC63FC636363AFAF63635363AF30 +dec (0x50000000000000005555000000005555, 0xC000000000000000CCCC00000000CCCC) = 0xA27207A83DFB7F8764AE720727FD548E +declast(0x50000000000000005555000000005555, 0xC000000000000000CCCC00000000CCCC) = 0x92ED52526C5252529E9EED52ED529E21 +enc (0x50000000000000005555000000005555, 0xD000000000000000DDDD00000000DDDD) = 0xB3D9FC4646D9FCFCBEBE6363B9AC11AB +enclast(0x50000000000000005555000000005555, 0xD000000000000000DDDD00000000DDDD) = 0xB3FCFC63FC636363BEBE63635363BE21 +dec (0x50000000000000005555000000005555, 0xD000000000000000DDDD00000000DDDD) = 0xB27207A83DFB7F8775BF720727FD459F +declast(0x50000000000000005555000000005555, 0xD000000000000000DDDD00000000DDDD) = 0x82ED52526C5252528F8FED52ED528F30 +enc (0x50000000000000005555000000005555, 0xE000000000000000EEEE00000000EEEE) = 0x83D9FC4646D9FCFC8D8D6363B9AC2298 +enclast(0x50000000000000005555000000005555, 0xE000000000000000EEEE00000000EEEE) = 0x83FCFC63FC6363638D8D636353638D12 +dec (0x50000000000000005555000000005555, 0xE000000000000000EEEE00000000EEEE) = 0x827207A83DFB7F87468C720727FD76AC +declast(0x50000000000000005555000000005555, 0xE000000000000000EEEE00000000EEEE) = 0xB2ED52526C525252BCBCED52ED52BC03 +enc (0x50000000000000005555000000005555, 0xF000000000000000FFFF00000000FFFF) = 0x93D9FC4646D9FCFC9C9C6363B9AC3389 +enclast(0x50000000000000005555000000005555, 0xF000000000000000FFFF00000000FFFF) = 0x93FCFC63FC6363639C9C636353639C03 +dec (0x50000000000000005555000000005555, 0xF000000000000000FFFF00000000FFFF) = 0x927207A83DFB7F87579D720727FD67BD +declast(0x50000000000000005555000000005555, 0xF000000000000000FFFF00000000FFFF) = 0xA2ED52526C525252ADADED52ED52AD12 +keygenassist(0x50000000000000005555000000005555, 0x00) = 0x635363635363636363FCFC63FCFC6363 +keygenassist(0x50000000000000005555000000005555, 0x01) = 0x635363625363636363FCFC62FCFC6363 +keygenassist(0x50000000000000005555000000005555, 0x02) = 0x635363615363636363FCFC61FCFC6363 +keygenassist(0x50000000000000005555000000005555, 0x04) = 0x635363675363636363FCFC67FCFC6363 +keygenassist(0x50000000000000005555000000005555, 0x08) = 0x6353636B5363636363FCFC6BFCFC6363 +keygenassist(0x50000000000000005555000000005555, 0x10) = 0x635363735363636363FCFC73FCFC6363 +keygenassist(0x50000000000000005555000000005555, 0x38) = 0x6353635B5363636363FCFC5BFCFC6363 +keygenassist(0x50000000000000005555000000005555, 0x4F) = 0x6353632C5363636363FCFC2CFCFC6363 +keygenassist(0x50000000000000005555000000005555, 0xFF) = 0x6353639C5363636363FCFC9CFCFC6363 +imc (0x50000000000000005555000000005555) = 0x4D46BDE600000000B01AE54FE54FB01A +pclmul(0x50000000000000005555000000005555, 0x00) = 0x1F33D32CFFD333E0CC33FFD32CD31F1F +pclmul(0x50000000000000005555000000005555, 0x01) = 0x1F10FFF00FFFEF10E0EF0FFFF0001F1F +pclmul(0x50000000000000005555000000005555, 0x10) = 0x1EC0F0DEC0F0DEEEF000000000000000 +pclmul(0x50000000000000005555000000005555, 0xFF) = 0x1EE1EEEEE1EEEEEEF000000000000000 +enc (0x60000000000000006666000000006666, 0x00000000000000000000000000000000) = 0x639333C3C393333363636363EEFD8070 +enclast(0x60000000000000006666000000006666, 0x00000000000000000000000000000000) = 0x633333633363636363636363D0636333 +dec (0x60000000000000006666000000006666, 0x00000000000000000000000000000000) = 0xB71DAE85A245FFDA85B71DAEE17960F8 +declast(0x60000000000000006666000000006666, 0x00000000000000000000000000000000) = 0x52D35252905252525252D352D35252D3 +enc (0x60000000000000006666000000006666, 0x10000000000000001111000000001111) = 0x739333C3C393333372726363EEFD9161 +enclast(0x60000000000000006666000000006666, 0x10000000000000001111000000001111) = 0x733333633363636372726363D0637222 +dec (0x60000000000000006666000000006666, 0x10000000000000001111000000001111) = 0xA71DAE85A245FFDA94A61DAEE17971E9 +declast(0x60000000000000006666000000006666, 0x10000000000000001111000000001111) = 0x42D35252905252524343D352D35243C2 +enc (0x60000000000000006666000000006666, 0x20000000000000002222000000002222) = 0x439333C3C393333341416363EEFDA252 +enclast(0x60000000000000006666000000006666, 0x20000000000000002222000000002222) = 0x433333633363636341416363D0634111 +dec (0x60000000000000006666000000006666, 0x20000000000000002222000000002222) = 0x971DAE85A245FFDAA7951DAEE17942DA +declast(0x60000000000000006666000000006666, 0x20000000000000002222000000002222) = 0x72D35252905252527070D352D35270F1 +enc (0x60000000000000006666000000006666, 0x30000000000000003333000000003333) = 0x539333C3C393333350506363EEFDB343 +enclast(0x60000000000000006666000000006666, 0x30000000000000003333000000003333) = 0x533333633363636350506363D0635000 +dec (0x60000000000000006666000000006666, 0x30000000000000003333000000003333) = 0x871DAE85A245FFDAB6841DAEE17953CB +declast(0x60000000000000006666000000006666, 0x30000000000000003333000000003333) = 0x62D35252905252526161D352D35261E0 +enc (0x60000000000000006666000000006666, 0x40000000000000004444000000004444) = 0x239333C3C393333327276363EEFDC434 +enclast(0x60000000000000006666000000006666, 0x40000000000000004444000000004444) = 0x233333633363636327276363D0632777 +dec (0x60000000000000006666000000006666, 0x40000000000000004444000000004444) = 0xF71DAE85A245FFDAC1F31DAEE17924BC +declast(0x60000000000000006666000000006666, 0x40000000000000004444000000004444) = 0x12D35252905252521616D352D3521697 +enc (0x60000000000000006666000000006666, 0x50000000000000005555000000005555) = 0x339333C3C393333336366363EEFDD525 +enclast(0x60000000000000006666000000006666, 0x50000000000000005555000000005555) = 0x333333633363636336366363D0633666 +dec (0x60000000000000006666000000006666, 0x50000000000000005555000000005555) = 0xE71DAE85A245FFDAD0E21DAEE17935AD +declast(0x60000000000000006666000000006666, 0x50000000000000005555000000005555) = 0x02D35252905252520707D352D3520786 +enc (0x60000000000000006666000000006666, 0x60000000000000006666000000006666) = 0x039333C3C393333305056363EEFDE616 +enclast(0x60000000000000006666000000006666, 0x60000000000000006666000000006666) = 0x033333633363636305056363D0630555 +dec (0x60000000000000006666000000006666, 0x60000000000000006666000000006666) = 0xD71DAE85A245FFDAE3D11DAEE179069E +declast(0x60000000000000006666000000006666, 0x60000000000000006666000000006666) = 0x32D35252905252523434D352D35234B5 +enc (0x60000000000000006666000000006666, 0x70000000000000007777000000007777) = 0x139333C3C393333314146363EEFDF707 +enclast(0x60000000000000006666000000006666, 0x70000000000000007777000000007777) = 0x133333633363636314146363D0631444 +dec (0x60000000000000006666000000006666, 0x70000000000000007777000000007777) = 0xC71DAE85A245FFDAF2C01DAEE179178F +declast(0x60000000000000006666000000006666, 0x70000000000000007777000000007777) = 0x22D35252905252522525D352D35225A4 +enc (0x60000000000000006666000000006666, 0x80000000000000008888000000008888) = 0xE39333C3C3933333EBEB6363EEFD08F8 +enclast(0x60000000000000006666000000006666, 0x80000000000000008888000000008888) = 0xE333336333636363EBEB6363D063EBBB +dec (0x60000000000000006666000000006666, 0x80000000000000008888000000008888) = 0x371DAE85A245FFDA0D3F1DAEE179E870 +declast(0x60000000000000006666000000006666, 0x80000000000000008888000000008888) = 0xD2D3525290525252DADAD352D352DA5B +enc (0x60000000000000006666000000006666, 0x90000000000000009999000000009999) = 0xF39333C3C3933333FAFA6363EEFD19E9 +enclast(0x60000000000000006666000000006666, 0x90000000000000009999000000009999) = 0xF333336333636363FAFA6363D063FAAA +dec (0x60000000000000006666000000006666, 0x90000000000000009999000000009999) = 0x271DAE85A245FFDA1C2E1DAEE179F961 +declast(0x60000000000000006666000000006666, 0x90000000000000009999000000009999) = 0xC2D3525290525252CBCBD352D352CB4A +enc (0x60000000000000006666000000006666, 0xA000000000000000AAAA00000000AAAA) = 0xC39333C3C3933333C9C96363EEFD2ADA +enclast(0x60000000000000006666000000006666, 0xA000000000000000AAAA00000000AAAA) = 0xC333336333636363C9C96363D063C999 +dec (0x60000000000000006666000000006666, 0xA000000000000000AAAA00000000AAAA) = 0x171DAE85A245FFDA2F1D1DAEE179CA52 +declast(0x60000000000000006666000000006666, 0xA000000000000000AAAA00000000AAAA) = 0xF2D3525290525252F8F8D352D352F879 +enc (0x60000000000000006666000000006666, 0xB000000000000000BBBB00000000BBBB) = 0xD39333C3C3933333D8D86363EEFD3BCB +enclast(0x60000000000000006666000000006666, 0xB000000000000000BBBB00000000BBBB) = 0xD333336333636363D8D86363D063D888 +dec (0x60000000000000006666000000006666, 0xB000000000000000BBBB00000000BBBB) = 0x071DAE85A245FFDA3E0C1DAEE179DB43 +declast(0x60000000000000006666000000006666, 0xB000000000000000BBBB00000000BBBB) = 0xE2D3525290525252E9E9D352D352E968 +enc (0x60000000000000006666000000006666, 0xC000000000000000CCCC00000000CCCC) = 0xA39333C3C3933333AFAF6363EEFD4CBC +enclast(0x60000000000000006666000000006666, 0xC000000000000000CCCC00000000CCCC) = 0xA333336333636363AFAF6363D063AFFF +dec (0x60000000000000006666000000006666, 0xC000000000000000CCCC00000000CCCC) = 0x771DAE85A245FFDA497B1DAEE179AC34 +declast(0x60000000000000006666000000006666, 0xC000000000000000CCCC00000000CCCC) = 0x92D35252905252529E9ED352D3529E1F +enc (0x60000000000000006666000000006666, 0xD000000000000000DDDD00000000DDDD) = 0xB39333C3C3933333BEBE6363EEFD5DAD +enclast(0x60000000000000006666000000006666, 0xD000000000000000DDDD00000000DDDD) = 0xB333336333636363BEBE6363D063BEEE +dec (0x60000000000000006666000000006666, 0xD000000000000000DDDD00000000DDDD) = 0x671DAE85A245FFDA586A1DAEE179BD25 +declast(0x60000000000000006666000000006666, 0xD000000000000000DDDD00000000DDDD) = 0x82D35252905252528F8FD352D3528F0E +enc (0x60000000000000006666000000006666, 0xE000000000000000EEEE00000000EEEE) = 0x839333C3C39333338D8D6363EEFD6E9E +enclast(0x60000000000000006666000000006666, 0xE000000000000000EEEE00000000EEEE) = 0x83333363336363638D8D6363D0638DDD +dec (0x60000000000000006666000000006666, 0xE000000000000000EEEE00000000EEEE) = 0x571DAE85A245FFDA6B591DAEE1798E16 +declast(0x60000000000000006666000000006666, 0xE000000000000000EEEE00000000EEEE) = 0xB2D3525290525252BCBCD352D352BC3D +enc (0x60000000000000006666000000006666, 0xF000000000000000FFFF00000000FFFF) = 0x939333C3C39333339C9C6363EEFD7F8F +enclast(0x60000000000000006666000000006666, 0xF000000000000000FFFF00000000FFFF) = 0x93333363336363639C9C6363D0639CCC +dec (0x60000000000000006666000000006666, 0xF000000000000000FFFF00000000FFFF) = 0x471DAE85A245FFDA7A481DAEE1799F07 +declast(0x60000000000000006666000000006666, 0xF000000000000000FFFF00000000FFFF) = 0xA2D3525290525252ADADD352D352AD2C +keygenassist(0x60000000000000006666000000006666, 0x00) = 0x63D06363D06363636333336333336363 +keygenassist(0x60000000000000006666000000006666, 0x01) = 0x63D06362D06363636333336233336363 +keygenassist(0x60000000000000006666000000006666, 0x02) = 0x63D06361D06363636333336133336363 +keygenassist(0x60000000000000006666000000006666, 0x04) = 0x63D06367D06363636333336733336363 +keygenassist(0x60000000000000006666000000006666, 0x08) = 0x63D0636BD06363636333336B33336363 +keygenassist(0x60000000000000006666000000006666, 0x10) = 0x63D06373D06363636333337333336363 +keygenassist(0x60000000000000006666000000006666, 0x38) = 0x63D0635BD06363636333335B33336363 +keygenassist(0x60000000000000006666000000006666, 0x4F) = 0x63D0632CD06363636333332C33336363 +keygenassist(0x60000000000000006666000000006666, 0xFF) = 0x63D0639CD06363636333339C33336363 +imc (0x60000000000000006666000000006666) = 0x768DD64D0000000029E54F834F8329E5 +pclmul(0x60000000000000006666000000006666, 0x00) = 0x15F5E01FFFE00A15F5F5FFE01FE015EA +pclmul(0x60000000000000006666000000006666, 0x01) = 0x15D3330A39331FD326E039330A0015EA +pclmul(0x60000000000000006666000000006666, 0x10) = 0x14AAAAB4AAAAB4B4A000000000000000 +pclmul(0x60000000000000006666000000006666, 0xFF) = 0x148E14B48E14B4B4A000000000000000 +enc (0x70000000000000007777000000007777, 0x00000000000000000000000000000000) = 0x63C2F55454C2F5F563636363A6A3C766 +enclast(0x70000000000000007777000000007777, 0x00000000000000000000000000000000) = 0x63F5F563F563636363636363516363F5 +dec (0x70000000000000007777000000007777, 0x00000000000000000000000000000000) = 0xB41F14EF0FB392ACEFB41F1459A909F9 +declast(0x70000000000000007777000000007777, 0x00000000000000000000000000000000) = 0x52025252D05252525252025202525202 +enc (0x70000000000000007777000000007777, 0x10000000000000001111000000001111) = 0x73C2F55454C2F5F572726363A6A3D677 +enclast(0x70000000000000007777000000007777, 0x10000000000000001111000000001111) = 0x73F5F563F563636372726363516372E4 +dec (0x70000000000000007777000000007777, 0x10000000000000001111000000001111) = 0xA41F14EF0FB392ACFEA51F1459A918E8 +declast(0x70000000000000007777000000007777, 0x10000000000000001111000000001111) = 0x42025252D05252524343025202524313 +enc (0x70000000000000007777000000007777, 0x20000000000000002222000000002222) = 0x43C2F55454C2F5F541416363A6A3E544 +enclast(0x70000000000000007777000000007777, 0x20000000000000002222000000002222) = 0x43F5F563F563636341416363516341D7 +dec (0x70000000000000007777000000007777, 0x20000000000000002222000000002222) = 0x941F14EF0FB392ACCD961F1459A92BDB +declast(0x70000000000000007777000000007777, 0x20000000000000002222000000002222) = 0x72025252D05252527070025202527020 +enc (0x70000000000000007777000000007777, 0x30000000000000003333000000003333) = 0x53C2F55454C2F5F550506363A6A3F455 +enclast(0x70000000000000007777000000007777, 0x30000000000000003333000000003333) = 0x53F5F563F563636350506363516350C6 +dec (0x70000000000000007777000000007777, 0x30000000000000003333000000003333) = 0x841F14EF0FB392ACDC871F1459A93ACA +declast(0x70000000000000007777000000007777, 0x30000000000000003333000000003333) = 0x62025252D05252526161025202526131 +enc (0x70000000000000007777000000007777, 0x40000000000000004444000000004444) = 0x23C2F55454C2F5F527276363A6A38322 +enclast(0x70000000000000007777000000007777, 0x40000000000000004444000000004444) = 0x23F5F563F563636327276363516327B1 +dec (0x70000000000000007777000000007777, 0x40000000000000004444000000004444) = 0xF41F14EF0FB392ACABF01F1459A94DBD +declast(0x70000000000000007777000000007777, 0x40000000000000004444000000004444) = 0x12025252D05252521616025202521646 +enc (0x70000000000000007777000000007777, 0x50000000000000005555000000005555) = 0x33C2F55454C2F5F536366363A6A39233 +enclast(0x70000000000000007777000000007777, 0x50000000000000005555000000005555) = 0x33F5F563F563636336366363516336A0 +dec (0x70000000000000007777000000007777, 0x50000000000000005555000000005555) = 0xE41F14EF0FB392ACBAE11F1459A95CAC +declast(0x70000000000000007777000000007777, 0x50000000000000005555000000005555) = 0x02025252D05252520707025202520757 +enc (0x70000000000000007777000000007777, 0x60000000000000006666000000006666) = 0x03C2F55454C2F5F505056363A6A3A100 +enclast(0x70000000000000007777000000007777, 0x60000000000000006666000000006666) = 0x03F5F563F56363630505636351630593 +dec (0x70000000000000007777000000007777, 0x60000000000000006666000000006666) = 0xD41F14EF0FB392AC89D21F1459A96F9F +declast(0x70000000000000007777000000007777, 0x60000000000000006666000000006666) = 0x32025252D05252523434025202523464 +enc (0x70000000000000007777000000007777, 0x70000000000000007777000000007777) = 0x13C2F55454C2F5F514146363A6A3B011 +enclast(0x70000000000000007777000000007777, 0x70000000000000007777000000007777) = 0x13F5F563F56363631414636351631482 +dec (0x70000000000000007777000000007777, 0x70000000000000007777000000007777) = 0xC41F14EF0FB392AC98C31F1459A97E8E +declast(0x70000000000000007777000000007777, 0x70000000000000007777000000007777) = 0x22025252D05252522525025202522575 +enc (0x70000000000000007777000000007777, 0x80000000000000008888000000008888) = 0xE3C2F55454C2F5F5EBEB6363A6A34FEE +enclast(0x70000000000000007777000000007777, 0x80000000000000008888000000008888) = 0xE3F5F563F5636363EBEB63635163EB7D +dec (0x70000000000000007777000000007777, 0x80000000000000008888000000008888) = 0x341F14EF0FB392AC673C1F1459A98171 +declast(0x70000000000000007777000000007777, 0x80000000000000008888000000008888) = 0xD2025252D0525252DADA02520252DA8A +enc (0x70000000000000007777000000007777, 0x90000000000000009999000000009999) = 0xF3C2F55454C2F5F5FAFA6363A6A35EFF +enclast(0x70000000000000007777000000007777, 0x90000000000000009999000000009999) = 0xF3F5F563F5636363FAFA63635163FA6C +dec (0x70000000000000007777000000007777, 0x90000000000000009999000000009999) = 0x241F14EF0FB392AC762D1F1459A99060 +declast(0x70000000000000007777000000007777, 0x90000000000000009999000000009999) = 0xC2025252D0525252CBCB02520252CB9B +enc (0x70000000000000007777000000007777, 0xA000000000000000AAAA00000000AAAA) = 0xC3C2F55454C2F5F5C9C96363A6A36DCC +enclast(0x70000000000000007777000000007777, 0xA000000000000000AAAA00000000AAAA) = 0xC3F5F563F5636363C9C963635163C95F +dec (0x70000000000000007777000000007777, 0xA000000000000000AAAA00000000AAAA) = 0x141F14EF0FB392AC451E1F1459A9A353 +declast(0x70000000000000007777000000007777, 0xA000000000000000AAAA00000000AAAA) = 0xF2025252D0525252F8F802520252F8A8 +enc (0x70000000000000007777000000007777, 0xB000000000000000BBBB00000000BBBB) = 0xD3C2F55454C2F5F5D8D86363A6A37CDD +enclast(0x70000000000000007777000000007777, 0xB000000000000000BBBB00000000BBBB) = 0xD3F5F563F5636363D8D863635163D84E +dec (0x70000000000000007777000000007777, 0xB000000000000000BBBB00000000BBBB) = 0x041F14EF0FB392AC540F1F1459A9B242 +declast(0x70000000000000007777000000007777, 0xB000000000000000BBBB00000000BBBB) = 0xE2025252D0525252E9E902520252E9B9 +enc (0x70000000000000007777000000007777, 0xC000000000000000CCCC00000000CCCC) = 0xA3C2F55454C2F5F5AFAF6363A6A30BAA +enclast(0x70000000000000007777000000007777, 0xC000000000000000CCCC00000000CCCC) = 0xA3F5F563F5636363AFAF63635163AF39 +dec (0x70000000000000007777000000007777, 0xC000000000000000CCCC00000000CCCC) = 0x741F14EF0FB392AC23781F1459A9C535 +declast(0x70000000000000007777000000007777, 0xC000000000000000CCCC00000000CCCC) = 0x92025252D05252529E9E025202529ECE +enc (0x70000000000000007777000000007777, 0xD000000000000000DDDD00000000DDDD) = 0xB3C2F55454C2F5F5BEBE6363A6A31ABB +enclast(0x70000000000000007777000000007777, 0xD000000000000000DDDD00000000DDDD) = 0xB3F5F563F5636363BEBE63635163BE28 +dec (0x70000000000000007777000000007777, 0xD000000000000000DDDD00000000DDDD) = 0x641F14EF0FB392AC32691F1459A9D424 +declast(0x70000000000000007777000000007777, 0xD000000000000000DDDD00000000DDDD) = 0x82025252D05252528F8F025202528FDF +enc (0x70000000000000007777000000007777, 0xE000000000000000EEEE00000000EEEE) = 0x83C2F55454C2F5F58D8D6363A6A32988 +enclast(0x70000000000000007777000000007777, 0xE000000000000000EEEE00000000EEEE) = 0x83F5F563F56363638D8D636351638D1B +dec (0x70000000000000007777000000007777, 0xE000000000000000EEEE00000000EEEE) = 0x541F14EF0FB392AC015A1F1459A9E717 +declast(0x70000000000000007777000000007777, 0xE000000000000000EEEE00000000EEEE) = 0xB2025252D0525252BCBC02520252BCEC +enc (0x70000000000000007777000000007777, 0xF000000000000000FFFF00000000FFFF) = 0x93C2F55454C2F5F59C9C6363A6A33899 +enclast(0x70000000000000007777000000007777, 0xF000000000000000FFFF00000000FFFF) = 0x93F5F563F56363639C9C636351639C0A +dec (0x70000000000000007777000000007777, 0xF000000000000000FFFF00000000FFFF) = 0x441F14EF0FB392AC104B1F1459A9F606 +declast(0x70000000000000007777000000007777, 0xF000000000000000FFFF00000000FFFF) = 0xA2025252D0525252ADAD02520252ADFD +keygenassist(0x70000000000000007777000000007777, 0x00) = 0x635163635163636363F5F563F5F56363 +keygenassist(0x70000000000000007777000000007777, 0x01) = 0x635163625163636363F5F562F5F56363 +keygenassist(0x70000000000000007777000000007777, 0x02) = 0x635163615163636363F5F561F5F56363 +keygenassist(0x70000000000000007777000000007777, 0x04) = 0x635163675163636363F5F567F5F56363 +keygenassist(0x70000000000000007777000000007777, 0x08) = 0x6351636B5163636363F5F56BF5F56363 +keygenassist(0x70000000000000007777000000007777, 0x10) = 0x635163735163636363F5F573F5F56363 +keygenassist(0x70000000000000007777000000007777, 0x38) = 0x6351635B5163636363F5F55BF5F56363 +keygenassist(0x70000000000000007777000000007777, 0x4F) = 0x6351632C5163636363F5F52CF5F56363 +keygenassist(0x70000000000000007777000000007777, 0xFF) = 0x6351639C5163636363F5F59CF5F56363 +imc (0x70000000000000007777000000007777) = 0x963D06DD000000005EB029C729C75EB0 +pclmul(0x70000000000000007777000000007777, 0x00) = 0x1384C23DFFC22E46D184FFC23DC213B9 +pclmul(0x70000000000000007777000000007777, 0x01) = 0x13B0777E09776DB064C709777E0013B9 +pclmul(0x70000000000000007777000000007777, 0x10) = 0x12BC9CA2BC9CA2829000000000000000 +pclmul(0x70000000000000007777000000007777, 0xFF) = 0x128B62828B6282829000000000000000 +enc (0x80000000000000008888000000008888, 0x00000000000000000000000000000000) = 0x6391C4363691C4C463636363D62D6A98 +enclast(0x80000000000000008888000000008888, 0x00000000000000000000000000000000) = 0x63C4C463C463636363636363CD6363C4 +dec (0x80000000000000008888000000008888, 0x00000000000000000000000000000000) = 0xE58874DC5487EC57DCE58874AEFA6B3F +declast(0x80000000000000008888000000008888, 0x00000000000000000000000000000000) = 0x529752523A5252525252975297525297 +enc (0x80000000000000008888000000008888, 0x10000000000000001111000000001111) = 0x7391C4363691C4C472726363D62D7B89 +enclast(0x80000000000000008888000000008888, 0x10000000000000001111000000001111) = 0x73C4C463C463636372726363CD6372D5 +dec (0x80000000000000008888000000008888, 0x10000000000000001111000000001111) = 0xF58874DC5487EC57CDF48874AEFA7A2E +declast(0x80000000000000008888000000008888, 0x10000000000000001111000000001111) = 0x429752523A5252524343975297524386 +enc (0x80000000000000008888000000008888, 0x20000000000000002222000000002222) = 0x4391C4363691C4C441416363D62D48BA +enclast(0x80000000000000008888000000008888, 0x20000000000000002222000000002222) = 0x43C4C463C463636341416363CD6341E6 +dec (0x80000000000000008888000000008888, 0x20000000000000002222000000002222) = 0xC58874DC5487EC57FEC78874AEFA491D +declast(0x80000000000000008888000000008888, 0x20000000000000002222000000002222) = 0x729752523A52525270709752975270B5 +enc (0x80000000000000008888000000008888, 0x30000000000000003333000000003333) = 0x5391C4363691C4C450506363D62D59AB +enclast(0x80000000000000008888000000008888, 0x30000000000000003333000000003333) = 0x53C4C463C463636350506363CD6350F7 +dec (0x80000000000000008888000000008888, 0x30000000000000003333000000003333) = 0xD58874DC5487EC57EFD68874AEFA580C +declast(0x80000000000000008888000000008888, 0x30000000000000003333000000003333) = 0x629752523A52525261619752975261A4 +enc (0x80000000000000008888000000008888, 0x40000000000000004444000000004444) = 0x2391C4363691C4C427276363D62D2EDC +enclast(0x80000000000000008888000000008888, 0x40000000000000004444000000004444) = 0x23C4C463C463636327276363CD632780 +dec (0x80000000000000008888000000008888, 0x40000000000000004444000000004444) = 0xA58874DC5487EC5798A18874AEFA2F7B +declast(0x80000000000000008888000000008888, 0x40000000000000004444000000004444) = 0x129752523A52525216169752975216D3 +enc (0x80000000000000008888000000008888, 0x50000000000000005555000000005555) = 0x3391C4363691C4C436366363D62D3FCD +enclast(0x80000000000000008888000000008888, 0x50000000000000005555000000005555) = 0x33C4C463C463636336366363CD633691 +dec (0x80000000000000008888000000008888, 0x50000000000000005555000000005555) = 0xB58874DC5487EC5789B08874AEFA3E6A +declast(0x80000000000000008888000000008888, 0x50000000000000005555000000005555) = 0x029752523A52525207079752975207C2 +enc (0x80000000000000008888000000008888, 0x60000000000000006666000000006666) = 0x0391C4363691C4C405056363D62D0CFE +enclast(0x80000000000000008888000000008888, 0x60000000000000006666000000006666) = 0x03C4C463C463636305056363CD6305A2 +dec (0x80000000000000008888000000008888, 0x60000000000000006666000000006666) = 0x858874DC5487EC57BA838874AEFA0D59 +declast(0x80000000000000008888000000008888, 0x60000000000000006666000000006666) = 0x329752523A52525234349752975234F1 +enc (0x80000000000000008888000000008888, 0x70000000000000007777000000007777) = 0x1391C4363691C4C414146363D62D1DEF +enclast(0x80000000000000008888000000008888, 0x70000000000000007777000000007777) = 0x13C4C463C463636314146363CD6314B3 +dec (0x80000000000000008888000000008888, 0x70000000000000007777000000007777) = 0x958874DC5487EC57AB928874AEFA1C48 +declast(0x80000000000000008888000000008888, 0x70000000000000007777000000007777) = 0x229752523A52525225259752975225E0 +enc (0x80000000000000008888000000008888, 0x80000000000000008888000000008888) = 0xE391C4363691C4C4EBEB6363D62DE210 +enclast(0x80000000000000008888000000008888, 0x80000000000000008888000000008888) = 0xE3C4C463C4636363EBEB6363CD63EB4C +dec (0x80000000000000008888000000008888, 0x80000000000000008888000000008888) = 0x658874DC5487EC57546D8874AEFAE3B7 +declast(0x80000000000000008888000000008888, 0x80000000000000008888000000008888) = 0xD29752523A525252DADA97529752DA1F +enc (0x80000000000000008888000000008888, 0x90000000000000009999000000009999) = 0xF391C4363691C4C4FAFA6363D62DF301 +enclast(0x80000000000000008888000000008888, 0x90000000000000009999000000009999) = 0xF3C4C463C4636363FAFA6363CD63FA5D +dec (0x80000000000000008888000000008888, 0x90000000000000009999000000009999) = 0x758874DC5487EC57457C8874AEFAF2A6 +declast(0x80000000000000008888000000008888, 0x90000000000000009999000000009999) = 0xC29752523A525252CBCB97529752CB0E +enc (0x80000000000000008888000000008888, 0xA000000000000000AAAA00000000AAAA) = 0xC391C4363691C4C4C9C96363D62DC032 +enclast(0x80000000000000008888000000008888, 0xA000000000000000AAAA00000000AAAA) = 0xC3C4C463C4636363C9C96363CD63C96E +dec (0x80000000000000008888000000008888, 0xA000000000000000AAAA00000000AAAA) = 0x458874DC5487EC57764F8874AEFAC195 +declast(0x80000000000000008888000000008888, 0xA000000000000000AAAA00000000AAAA) = 0xF29752523A525252F8F897529752F83D +enc (0x80000000000000008888000000008888, 0xB000000000000000BBBB00000000BBBB) = 0xD391C4363691C4C4D8D86363D62DD123 +enclast(0x80000000000000008888000000008888, 0xB000000000000000BBBB00000000BBBB) = 0xD3C4C463C4636363D8D86363CD63D87F +dec (0x80000000000000008888000000008888, 0xB000000000000000BBBB00000000BBBB) = 0x558874DC5487EC57675E8874AEFAD084 +declast(0x80000000000000008888000000008888, 0xB000000000000000BBBB00000000BBBB) = 0xE29752523A525252E9E997529752E92C +enc (0x80000000000000008888000000008888, 0xC000000000000000CCCC00000000CCCC) = 0xA391C4363691C4C4AFAF6363D62DA654 +enclast(0x80000000000000008888000000008888, 0xC000000000000000CCCC00000000CCCC) = 0xA3C4C463C4636363AFAF6363CD63AF08 +dec (0x80000000000000008888000000008888, 0xC000000000000000CCCC00000000CCCC) = 0x258874DC5487EC5710298874AEFAA7F3 +declast(0x80000000000000008888000000008888, 0xC000000000000000CCCC00000000CCCC) = 0x929752523A5252529E9E975297529E5B +enc (0x80000000000000008888000000008888, 0xD000000000000000DDDD00000000DDDD) = 0xB391C4363691C4C4BEBE6363D62DB745 +enclast(0x80000000000000008888000000008888, 0xD000000000000000DDDD00000000DDDD) = 0xB3C4C463C4636363BEBE6363CD63BE19 +dec (0x80000000000000008888000000008888, 0xD000000000000000DDDD00000000DDDD) = 0x358874DC5487EC5701388874AEFAB6E2 +declast(0x80000000000000008888000000008888, 0xD000000000000000DDDD00000000DDDD) = 0x829752523A5252528F8F975297528F4A +enc (0x80000000000000008888000000008888, 0xE000000000000000EEEE00000000EEEE) = 0x8391C4363691C4C48D8D6363D62D8476 +enclast(0x80000000000000008888000000008888, 0xE000000000000000EEEE00000000EEEE) = 0x83C4C463C46363638D8D6363CD638D2A +dec (0x80000000000000008888000000008888, 0xE000000000000000EEEE00000000EEEE) = 0x058874DC5487EC57320B8874AEFA85D1 +declast(0x80000000000000008888000000008888, 0xE000000000000000EEEE00000000EEEE) = 0xB29752523A525252BCBC97529752BC79 +enc (0x80000000000000008888000000008888, 0xF000000000000000FFFF00000000FFFF) = 0x9391C4363691C4C49C9C6363D62D9567 +enclast(0x80000000000000008888000000008888, 0xF000000000000000FFFF00000000FFFF) = 0x93C4C463C46363639C9C6363CD639C3B +dec (0x80000000000000008888000000008888, 0xF000000000000000FFFF00000000FFFF) = 0x158874DC5487EC57231A8874AEFA94C0 +declast(0x80000000000000008888000000008888, 0xF000000000000000FFFF00000000FFFF) = 0xA29752523A525252ADAD97529752AD68 +keygenassist(0x80000000000000008888000000008888, 0x00) = 0x63CD6363CD63636363C4C463C4C46363 +keygenassist(0x80000000000000008888000000008888, 0x01) = 0x63CD6362CD63636363C4C462C4C46363 +keygenassist(0x80000000000000008888000000008888, 0x02) = 0x63CD6361CD63636363C4C461C4C46363 +keygenassist(0x80000000000000008888000000008888, 0x04) = 0x63CD6367CD63636363C4C467C4C46363 +keygenassist(0x80000000000000008888000000008888, 0x08) = 0x63CD636BCD63636363C4C46BC4C46363 +keygenassist(0x80000000000000008888000000008888, 0x10) = 0x63CD6373CD63636363C4C473C4C46363 +keygenassist(0x80000000000000008888000000008888, 0x38) = 0x63CD635BCD63636363C4C45BC4C46363 +keygenassist(0x80000000000000008888000000008888, 0x4F) = 0x63CD632CCD63636363C4C42CC4C46363 +keygenassist(0x80000000000000008888000000008888, 0xFF) = 0x63CD639CCD63636363C4C49CC4C46363 +imc (0x80000000000000008888000000008888) = 0x41F7DAEC00000000959E1D161D16959E +pclmul(0x80000000000000008888000000008888, 0x00) = 0x32CEB856EEB864768ACEEEB856B83298 +pclmul(0x80000000000000008888000000008888, 0x01) = 0x32CA2270522242CA10E8522270003298 +pclmul(0x80000000000000008888000000008888, 0x10) = 0x31E26231E26231B18000000000000000 +pclmul(0x80000000000000008888000000008888, 0xFF) = 0x31E6B1B1E6B1B1B18000000000000000 +enc (0x90000000000000009999000000009999, 0x00000000000000000000000000000000) = 0x63EFEE6262EFEEEE63636363E9EBED61 +enclast(0x90000000000000009999000000009999, 0x00000000000000000000000000000000) = 0x63EEEE63EE63636363636363606363EE +dec (0x90000000000000009999000000009999, 0x00000000000000000000000000000000) = 0xD6AA9B4C867FD1EC4CD6AA9B6385C82E +declast(0x90000000000000009999000000009999, 0x00000000000000000000000000000000) = 0x52F95252965252525252F952F95252F9 +enc (0x90000000000000009999000000009999, 0x10000000000000001111000000001111) = 0x73EFEE6262EFEEEE72726363E9EBFC70 +enclast(0x90000000000000009999000000009999, 0x10000000000000001111000000001111) = 0x73EEEE63EE63636372726363606372FF +dec (0x90000000000000009999000000009999, 0x10000000000000001111000000001111) = 0xC6AA9B4C867FD1EC5DC7AA9B6385D93F +declast(0x90000000000000009999000000009999, 0x10000000000000001111000000001111) = 0x42F95252965252524343F952F95243E8 +enc (0x90000000000000009999000000009999, 0x20000000000000002222000000002222) = 0x43EFEE6262EFEEEE41416363E9EBCF43 +enclast(0x90000000000000009999000000009999, 0x20000000000000002222000000002222) = 0x43EEEE63EE63636341416363606341CC +dec (0x90000000000000009999000000009999, 0x20000000000000002222000000002222) = 0xF6AA9B4C867FD1EC6EF4AA9B6385EA0C +declast(0x90000000000000009999000000009999, 0x20000000000000002222000000002222) = 0x72F95252965252527070F952F95270DB +enc (0x90000000000000009999000000009999, 0x30000000000000003333000000003333) = 0x53EFEE6262EFEEEE50506363E9EBDE52 +enclast(0x90000000000000009999000000009999, 0x30000000000000003333000000003333) = 0x53EEEE63EE63636350506363606350DD +dec (0x90000000000000009999000000009999, 0x30000000000000003333000000003333) = 0xE6AA9B4C867FD1EC7FE5AA9B6385FB1D +declast(0x90000000000000009999000000009999, 0x30000000000000003333000000003333) = 0x62F95252965252526161F952F95261CA +enc (0x90000000000000009999000000009999, 0x40000000000000004444000000004444) = 0x23EFEE6262EFEEEE27276363E9EBA925 +enclast(0x90000000000000009999000000009999, 0x40000000000000004444000000004444) = 0x23EEEE63EE63636327276363606327AA +dec (0x90000000000000009999000000009999, 0x40000000000000004444000000004444) = 0x96AA9B4C867FD1EC0892AA9B63858C6A +declast(0x90000000000000009999000000009999, 0x40000000000000004444000000004444) = 0x12F95252965252521616F952F95216BD +enc (0x90000000000000009999000000009999, 0x50000000000000005555000000005555) = 0x33EFEE6262EFEEEE36366363E9EBB834 +enclast(0x90000000000000009999000000009999, 0x50000000000000005555000000005555) = 0x33EEEE63EE63636336366363606336BB +dec (0x90000000000000009999000000009999, 0x50000000000000005555000000005555) = 0x86AA9B4C867FD1EC1983AA9B63859D7B +declast(0x90000000000000009999000000009999, 0x50000000000000005555000000005555) = 0x02F95252965252520707F952F95207AC +enc (0x90000000000000009999000000009999, 0x60000000000000006666000000006666) = 0x03EFEE6262EFEEEE05056363E9EB8B07 +enclast(0x90000000000000009999000000009999, 0x60000000000000006666000000006666) = 0x03EEEE63EE6363630505636360630588 +dec (0x90000000000000009999000000009999, 0x60000000000000006666000000006666) = 0xB6AA9B4C867FD1EC2AB0AA9B6385AE48 +declast(0x90000000000000009999000000009999, 0x60000000000000006666000000006666) = 0x32F95252965252523434F952F952349F +enc (0x90000000000000009999000000009999, 0x70000000000000007777000000007777) = 0x13EFEE6262EFEEEE14146363E9EB9A16 +enclast(0x90000000000000009999000000009999, 0x70000000000000007777000000007777) = 0x13EEEE63EE6363631414636360631499 +dec (0x90000000000000009999000000009999, 0x70000000000000007777000000007777) = 0xA6AA9B4C867FD1EC3BA1AA9B6385BF59 +declast(0x90000000000000009999000000009999, 0x70000000000000007777000000007777) = 0x22F95252965252522525F952F952258E +enc (0x90000000000000009999000000009999, 0x80000000000000008888000000008888) = 0xE3EFEE6262EFEEEEEBEB6363E9EB65E9 +enclast(0x90000000000000009999000000009999, 0x80000000000000008888000000008888) = 0xE3EEEE63EE636363EBEB63636063EB66 +dec (0x90000000000000009999000000009999, 0x80000000000000008888000000008888) = 0x56AA9B4C867FD1ECC45EAA9B638540A6 +declast(0x90000000000000009999000000009999, 0x80000000000000008888000000008888) = 0xD2F9525296525252DADAF952F952DA71 +enc (0x90000000000000009999000000009999, 0x90000000000000009999000000009999) = 0xF3EFEE6262EFEEEEFAFA6363E9EB74F8 +enclast(0x90000000000000009999000000009999, 0x90000000000000009999000000009999) = 0xF3EEEE63EE636363FAFA63636063FA77 +dec (0x90000000000000009999000000009999, 0x90000000000000009999000000009999) = 0x46AA9B4C867FD1ECD54FAA9B638551B7 +declast(0x90000000000000009999000000009999, 0x90000000000000009999000000009999) = 0xC2F9525296525252CBCBF952F952CB60 +enc (0x90000000000000009999000000009999, 0xA000000000000000AAAA00000000AAAA) = 0xC3EFEE6262EFEEEEC9C96363E9EB47CB +enclast(0x90000000000000009999000000009999, 0xA000000000000000AAAA00000000AAAA) = 0xC3EEEE63EE636363C9C963636063C944 +dec (0x90000000000000009999000000009999, 0xA000000000000000AAAA00000000AAAA) = 0x76AA9B4C867FD1ECE67CAA9B63856284 +declast(0x90000000000000009999000000009999, 0xA000000000000000AAAA00000000AAAA) = 0xF2F9525296525252F8F8F952F952F853 +enc (0x90000000000000009999000000009999, 0xB000000000000000BBBB00000000BBBB) = 0xD3EFEE6262EFEEEED8D86363E9EB56DA +enclast(0x90000000000000009999000000009999, 0xB000000000000000BBBB00000000BBBB) = 0xD3EEEE63EE636363D8D863636063D855 +dec (0x90000000000000009999000000009999, 0xB000000000000000BBBB00000000BBBB) = 0x66AA9B4C867FD1ECF76DAA9B63857395 +declast(0x90000000000000009999000000009999, 0xB000000000000000BBBB00000000BBBB) = 0xE2F9525296525252E9E9F952F952E942 +enc (0x90000000000000009999000000009999, 0xC000000000000000CCCC00000000CCCC) = 0xA3EFEE6262EFEEEEAFAF6363E9EB21AD +enclast(0x90000000000000009999000000009999, 0xC000000000000000CCCC00000000CCCC) = 0xA3EEEE63EE636363AFAF63636063AF22 +dec (0x90000000000000009999000000009999, 0xC000000000000000CCCC00000000CCCC) = 0x16AA9B4C867FD1EC801AAA9B638504E2 +declast(0x90000000000000009999000000009999, 0xC000000000000000CCCC00000000CCCC) = 0x92F95252965252529E9EF952F9529E35 +enc (0x90000000000000009999000000009999, 0xD000000000000000DDDD00000000DDDD) = 0xB3EFEE6262EFEEEEBEBE6363E9EB30BC +enclast(0x90000000000000009999000000009999, 0xD000000000000000DDDD00000000DDDD) = 0xB3EEEE63EE636363BEBE63636063BE33 +dec (0x90000000000000009999000000009999, 0xD000000000000000DDDD00000000DDDD) = 0x06AA9B4C867FD1EC910BAA9B638515F3 +declast(0x90000000000000009999000000009999, 0xD000000000000000DDDD00000000DDDD) = 0x82F95252965252528F8FF952F9528F24 +enc (0x90000000000000009999000000009999, 0xE000000000000000EEEE00000000EEEE) = 0x83EFEE6262EFEEEE8D8D6363E9EB038F +enclast(0x90000000000000009999000000009999, 0xE000000000000000EEEE00000000EEEE) = 0x83EEEE63EE6363638D8D636360638D00 +dec (0x90000000000000009999000000009999, 0xE000000000000000EEEE00000000EEEE) = 0x36AA9B4C867FD1ECA238AA9B638526C0 +declast(0x90000000000000009999000000009999, 0xE000000000000000EEEE00000000EEEE) = 0xB2F9525296525252BCBCF952F952BC17 +enc (0x90000000000000009999000000009999, 0xF000000000000000FFFF00000000FFFF) = 0x93EFEE6262EFEEEE9C9C6363E9EB129E +enclast(0x90000000000000009999000000009999, 0xF000000000000000FFFF00000000FFFF) = 0x93EEEE63EE6363639C9C636360639C11 +dec (0x90000000000000009999000000009999, 0xF000000000000000FFFF00000000FFFF) = 0x26AA9B4C867FD1ECB329AA9B638537D1 +declast(0x90000000000000009999000000009999, 0xF000000000000000FFFF00000000FFFF) = 0xA2F9525296525252ADADF952F952AD06 +keygenassist(0x90000000000000009999000000009999, 0x00) = 0x636063636063636363EEEE63EEEE6363 +keygenassist(0x90000000000000009999000000009999, 0x01) = 0x636063626063636363EEEE62EEEE6363 +keygenassist(0x90000000000000009999000000009999, 0x02) = 0x636063616063636363EEEE61EEEE6363 +keygenassist(0x90000000000000009999000000009999, 0x04) = 0x636063676063636363EEEE67EEEE6363 +keygenassist(0x90000000000000009999000000009999, 0x08) = 0x6360636B6063636363EEEE6BEEEE6363 +keygenassist(0x90000000000000009999000000009999, 0x10) = 0x636063736063636363EEEE73EEEE6363 +keygenassist(0x90000000000000009999000000009999, 0x38) = 0x6360635B6063636363EEEE5BEEEE6363 +keygenassist(0x90000000000000009999000000009999, 0x4F) = 0x6360632C6063636363EEEE2CEEEE6363 +keygenassist(0x90000000000000009999000000009999, 0xFF) = 0x6360639C6063636363EEEE9CEEEE6363 +imc (0x90000000000000009999000000009999) = 0xA1470A7C00000000E2CB7B527B52E2CB +pclmul(0x90000000000000009999000000009999, 0x00) = 0x3481B54AFFB57E348181FFB54AB534CB +pclmul(0x90000000000000009999000000009999, 0x01) = 0x34CAAAAB01AA9FCA9E6001AAAB0034CB +pclmul(0x90000000000000009999000000009999, 0x10) = 0x37C999D7C999D787B000000000000000 +pclmul(0x90000000000000009999000000009999, 0xFF) = 0x3786378786378787B000000000000000 +enc (0xA000000000000000AAAA00000000AAAA, 0x00000000000000000000000000000000) = 0x6329ACE6E629ACAC6363636334322F65 +enclast(0xA000000000000000AAAA00000000AAAA, 0x00000000000000000000000000000000) = 0x63ACAC63AC63636363636363E06363AC +dec (0xA000000000000000AAAA00000000AAAA, 0x00000000000000000000000000000000) = 0xF969993984C5BBEF39F96999A2F292C2 +declast(0xA000000000000000AAAA00000000AAAA, 0x00000000000000000000000000000000) = 0x52625252475252525252625262525262 +enc (0xA000000000000000AAAA00000000AAAA, 0x10000000000000001111000000001111) = 0x7329ACE6E629ACAC7272636334323E74 +enclast(0xA000000000000000AAAA00000000AAAA, 0x10000000000000001111000000001111) = 0x73ACAC63AC63636372726363E06372BD +dec (0xA000000000000000AAAA00000000AAAA, 0x10000000000000001111000000001111) = 0xE969993984C5BBEF28E86999A2F283D3 +declast(0xA000000000000000AAAA00000000AAAA, 0x10000000000000001111000000001111) = 0x42625252475252524343625262524373 +enc (0xA000000000000000AAAA00000000AAAA, 0x20000000000000002222000000002222) = 0x4329ACE6E629ACAC4141636334320D47 +enclast(0xA000000000000000AAAA00000000AAAA, 0x20000000000000002222000000002222) = 0x43ACAC63AC63636341416363E063418E +dec (0xA000000000000000AAAA00000000AAAA, 0x20000000000000002222000000002222) = 0xD969993984C5BBEF1BDB6999A2F2B0E0 +declast(0xA000000000000000AAAA00000000AAAA, 0x20000000000000002222000000002222) = 0x72625252475252527070625262527040 +enc (0xA000000000000000AAAA00000000AAAA, 0x30000000000000003333000000003333) = 0x5329ACE6E629ACAC5050636334321C56 +enclast(0xA000000000000000AAAA00000000AAAA, 0x30000000000000003333000000003333) = 0x53ACAC63AC63636350506363E063509F +dec (0xA000000000000000AAAA00000000AAAA, 0x30000000000000003333000000003333) = 0xC969993984C5BBEF0ACA6999A2F2A1F1 +declast(0xA000000000000000AAAA00000000AAAA, 0x30000000000000003333000000003333) = 0x62625252475252526161625262526151 +enc (0xA000000000000000AAAA00000000AAAA, 0x40000000000000004444000000004444) = 0x2329ACE6E629ACAC2727636334326B21 +enclast(0xA000000000000000AAAA00000000AAAA, 0x40000000000000004444000000004444) = 0x23ACAC63AC63636327276363E06327E8 +dec (0xA000000000000000AAAA00000000AAAA, 0x40000000000000004444000000004444) = 0xB969993984C5BBEF7DBD6999A2F2D686 +declast(0xA000000000000000AAAA00000000AAAA, 0x40000000000000004444000000004444) = 0x12625252475252521616625262521626 +enc (0xA000000000000000AAAA00000000AAAA, 0x50000000000000005555000000005555) = 0x3329ACE6E629ACAC3636636334327A30 +enclast(0xA000000000000000AAAA00000000AAAA, 0x50000000000000005555000000005555) = 0x33ACAC63AC63636336366363E06336F9 +dec (0xA000000000000000AAAA00000000AAAA, 0x50000000000000005555000000005555) = 0xA969993984C5BBEF6CAC6999A2F2C797 +declast(0xA000000000000000AAAA00000000AAAA, 0x50000000000000005555000000005555) = 0x02625252475252520707625262520737 +enc (0xA000000000000000AAAA00000000AAAA, 0x60000000000000006666000000006666) = 0x0329ACE6E629ACAC0505636334324903 +enclast(0xA000000000000000AAAA00000000AAAA, 0x60000000000000006666000000006666) = 0x03ACAC63AC63636305056363E06305CA +dec (0xA000000000000000AAAA00000000AAAA, 0x60000000000000006666000000006666) = 0x9969993984C5BBEF5F9F6999A2F2F4A4 +declast(0xA000000000000000AAAA00000000AAAA, 0x60000000000000006666000000006666) = 0x32625252475252523434625262523404 +enc (0xA000000000000000AAAA00000000AAAA, 0x70000000000000007777000000007777) = 0x1329ACE6E629ACAC1414636334325812 +enclast(0xA000000000000000AAAA00000000AAAA, 0x70000000000000007777000000007777) = 0x13ACAC63AC63636314146363E06314DB +dec (0xA000000000000000AAAA00000000AAAA, 0x70000000000000007777000000007777) = 0x8969993984C5BBEF4E8E6999A2F2E5B5 +declast(0xA000000000000000AAAA00000000AAAA, 0x70000000000000007777000000007777) = 0x22625252475252522525625262522515 +enc (0xA000000000000000AAAA00000000AAAA, 0x80000000000000008888000000008888) = 0xE329ACE6E629ACACEBEB63633432A7ED +enclast(0xA000000000000000AAAA00000000AAAA, 0x80000000000000008888000000008888) = 0xE3ACAC63AC636363EBEB6363E063EB24 +dec (0xA000000000000000AAAA00000000AAAA, 0x80000000000000008888000000008888) = 0x7969993984C5BBEFB1716999A2F21A4A +declast(0xA000000000000000AAAA00000000AAAA, 0x80000000000000008888000000008888) = 0xD262525247525252DADA62526252DAEA +enc (0xA000000000000000AAAA00000000AAAA, 0x90000000000000009999000000009999) = 0xF329ACE6E629ACACFAFA63633432B6FC +enclast(0xA000000000000000AAAA00000000AAAA, 0x90000000000000009999000000009999) = 0xF3ACAC63AC636363FAFA6363E063FA35 +dec (0xA000000000000000AAAA00000000AAAA, 0x90000000000000009999000000009999) = 0x6969993984C5BBEFA0606999A2F20B5B +declast(0xA000000000000000AAAA00000000AAAA, 0x90000000000000009999000000009999) = 0xC262525247525252CBCB62526252CBFB +enc (0xA000000000000000AAAA00000000AAAA, 0xA000000000000000AAAA00000000AAAA) = 0xC329ACE6E629ACACC9C96363343285CF +enclast(0xA000000000000000AAAA00000000AAAA, 0xA000000000000000AAAA00000000AAAA) = 0xC3ACAC63AC636363C9C96363E063C906 +dec (0xA000000000000000AAAA00000000AAAA, 0xA000000000000000AAAA00000000AAAA) = 0x5969993984C5BBEF93536999A2F23868 +declast(0xA000000000000000AAAA00000000AAAA, 0xA000000000000000AAAA00000000AAAA) = 0xF262525247525252F8F862526252F8C8 +enc (0xA000000000000000AAAA00000000AAAA, 0xB000000000000000BBBB00000000BBBB) = 0xD329ACE6E629ACACD8D86363343294DE +enclast(0xA000000000000000AAAA00000000AAAA, 0xB000000000000000BBBB00000000BBBB) = 0xD3ACAC63AC636363D8D86363E063D817 +dec (0xA000000000000000AAAA00000000AAAA, 0xB000000000000000BBBB00000000BBBB) = 0x4969993984C5BBEF82426999A2F22979 +declast(0xA000000000000000AAAA00000000AAAA, 0xB000000000000000BBBB00000000BBBB) = 0xE262525247525252E9E962526252E9D9 +enc (0xA000000000000000AAAA00000000AAAA, 0xC000000000000000CCCC00000000CCCC) = 0xA329ACE6E629ACACAFAF63633432E3A9 +enclast(0xA000000000000000AAAA00000000AAAA, 0xC000000000000000CCCC00000000CCCC) = 0xA3ACAC63AC636363AFAF6363E063AF60 +dec (0xA000000000000000AAAA00000000AAAA, 0xC000000000000000CCCC00000000CCCC) = 0x3969993984C5BBEFF5356999A2F25E0E +declast(0xA000000000000000AAAA00000000AAAA, 0xC000000000000000CCCC00000000CCCC) = 0x92625252475252529E9E625262529EAE +enc (0xA000000000000000AAAA00000000AAAA, 0xD000000000000000DDDD00000000DDDD) = 0xB329ACE6E629ACACBEBE63633432F2B8 +enclast(0xA000000000000000AAAA00000000AAAA, 0xD000000000000000DDDD00000000DDDD) = 0xB3ACAC63AC636363BEBE6363E063BE71 +dec (0xA000000000000000AAAA00000000AAAA, 0xD000000000000000DDDD00000000DDDD) = 0x2969993984C5BBEFE4246999A2F24F1F +declast(0xA000000000000000AAAA00000000AAAA, 0xD000000000000000DDDD00000000DDDD) = 0x82625252475252528F8F625262528FBF +enc (0xA000000000000000AAAA00000000AAAA, 0xE000000000000000EEEE00000000EEEE) = 0x8329ACE6E629ACAC8D8D63633432C18B +enclast(0xA000000000000000AAAA00000000AAAA, 0xE000000000000000EEEE00000000EEEE) = 0x83ACAC63AC6363638D8D6363E0638D42 +dec (0xA000000000000000AAAA00000000AAAA, 0xE000000000000000EEEE00000000EEEE) = 0x1969993984C5BBEFD7176999A2F27C2C +declast(0xA000000000000000AAAA00000000AAAA, 0xE000000000000000EEEE00000000EEEE) = 0xB262525247525252BCBC62526252BC8C +enc (0xA000000000000000AAAA00000000AAAA, 0xF000000000000000FFFF00000000FFFF) = 0x9329ACE6E629ACAC9C9C63633432D09A +enclast(0xA000000000000000AAAA00000000AAAA, 0xF000000000000000FFFF00000000FFFF) = 0x93ACAC63AC6363639C9C6363E0639C53 +dec (0xA000000000000000AAAA00000000AAAA, 0xF000000000000000FFFF00000000FFFF) = 0x0969993984C5BBEFC6066999A2F26D3D +declast(0xA000000000000000AAAA00000000AAAA, 0xF000000000000000FFFF00000000FFFF) = 0xA262525247525252ADAD62526252AD9D +keygenassist(0xA000000000000000AAAA00000000AAAA, 0x00) = 0x63E06363E063636363ACAC63ACAC6363 +keygenassist(0xA000000000000000AAAA00000000AAAA, 0x01) = 0x63E06362E063636363ACAC62ACAC6363 +keygenassist(0xA000000000000000AAAA00000000AAAA, 0x02) = 0x63E06361E063636363ACAC61ACAC6363 +keygenassist(0xA000000000000000AAAA00000000AAAA, 0x04) = 0x63E06367E063636363ACAC67ACAC6363 +keygenassist(0xA000000000000000AAAA00000000AAAA, 0x08) = 0x63E0636BE063636363ACAC6BACAC6363 +keygenassist(0xA000000000000000AAAA00000000AAAA, 0x10) = 0x63E06373E063636363ACAC73ACAC6363 +keygenassist(0xA000000000000000AAAA00000000AAAA, 0x38) = 0x63E0635BE063636363ACAC5BACAC6363 +keygenassist(0xA000000000000000AAAA00000000AAAA, 0x4F) = 0x63E0632CE063636363ACAC2CACAC6363 +keygenassist(0xA000000000000000AAAA00000000AAAA, 0xFF) = 0x63E0639CE063636363ACAC9CACAC6363 +imc (0xA000000000000000AAAA00000000AAAA) = 0x9A8C61D7000000007B34D19ED19E7B34 +pclmul(0xA000000000000000AAAA00000000AAAA, 0x00) = 0x3E478679FF8647C1B847FF8679863E3E +pclmul(0xA000000000000000AAAA00000000AAAA, 0x01) = 0x3E6AAAFE54AAC06A94C054AAFE003E3E +pclmul(0xA000000000000000AAAA00000000AAAA, 0x10) = 0x3DA3C3BDA3C3BDDDE000000000000000 +pclmul(0xA000000000000000AAAA00000000AAAA, 0xFF) = 0x3D8C3DDD8C3DDDDDE000000000000000 +enc (0xB000000000000000BBBB00000000BBBB, 0x00000000000000000000000000000000) = 0x63E3EA6A6AE3EAEA63636363F07D6EEE +enclast(0xB000000000000000BBBB00000000BBBB, 0x00000000000000000000000000000000) = 0x63EAEA63EA63636363636363E76363EA +dec (0xB000000000000000BBBB00000000BBBB, 0x00000000000000000000000000000000) = 0xE980AA6F9CBC75FB6FE980AA7897D43B +declast(0xB000000000000000BBBB00000000BBBB, 0x00000000000000000000000000000000) = 0x52FE5252FC5252525252FE52FE5252FE +enc (0xB000000000000000BBBB00000000BBBB, 0x10000000000000001111000000001111) = 0x73E3EA6A6AE3EAEA72726363F07D7FFF +enclast(0xB000000000000000BBBB00000000BBBB, 0x10000000000000001111000000001111) = 0x73EAEA63EA63636372726363E76372FB +dec (0xB000000000000000BBBB00000000BBBB, 0x10000000000000001111000000001111) = 0xF980AA6F9CBC75FB7EF880AA7897C52A +declast(0xB000000000000000BBBB00000000BBBB, 0x10000000000000001111000000001111) = 0x42FE5252FC5252524343FE52FE5243EF +enc (0xB000000000000000BBBB00000000BBBB, 0x20000000000000002222000000002222) = 0x43E3EA6A6AE3EAEA41416363F07D4CCC +enclast(0xB000000000000000BBBB00000000BBBB, 0x20000000000000002222000000002222) = 0x43EAEA63EA63636341416363E76341C8 +dec (0xB000000000000000BBBB00000000BBBB, 0x20000000000000002222000000002222) = 0xC980AA6F9CBC75FB4DCB80AA7897F619 +declast(0xB000000000000000BBBB00000000BBBB, 0x20000000000000002222000000002222) = 0x72FE5252FC5252527070FE52FE5270DC +enc (0xB000000000000000BBBB00000000BBBB, 0x30000000000000003333000000003333) = 0x53E3EA6A6AE3EAEA50506363F07D5DDD +enclast(0xB000000000000000BBBB00000000BBBB, 0x30000000000000003333000000003333) = 0x53EAEA63EA63636350506363E76350D9 +dec (0xB000000000000000BBBB00000000BBBB, 0x30000000000000003333000000003333) = 0xD980AA6F9CBC75FB5CDA80AA7897E708 +declast(0xB000000000000000BBBB00000000BBBB, 0x30000000000000003333000000003333) = 0x62FE5252FC5252526161FE52FE5261CD +enc (0xB000000000000000BBBB00000000BBBB, 0x40000000000000004444000000004444) = 0x23E3EA6A6AE3EAEA27276363F07D2AAA +enclast(0xB000000000000000BBBB00000000BBBB, 0x40000000000000004444000000004444) = 0x23EAEA63EA63636327276363E76327AE +dec (0xB000000000000000BBBB00000000BBBB, 0x40000000000000004444000000004444) = 0xA980AA6F9CBC75FB2BAD80AA7897907F +declast(0xB000000000000000BBBB00000000BBBB, 0x40000000000000004444000000004444) = 0x12FE5252FC5252521616FE52FE5216BA +enc (0xB000000000000000BBBB00000000BBBB, 0x50000000000000005555000000005555) = 0x33E3EA6A6AE3EAEA36366363F07D3BBB +enclast(0xB000000000000000BBBB00000000BBBB, 0x50000000000000005555000000005555) = 0x33EAEA63EA63636336366363E76336BF +dec (0xB000000000000000BBBB00000000BBBB, 0x50000000000000005555000000005555) = 0xB980AA6F9CBC75FB3ABC80AA7897816E +declast(0xB000000000000000BBBB00000000BBBB, 0x50000000000000005555000000005555) = 0x02FE5252FC5252520707FE52FE5207AB +enc (0xB000000000000000BBBB00000000BBBB, 0x60000000000000006666000000006666) = 0x03E3EA6A6AE3EAEA05056363F07D0888 +enclast(0xB000000000000000BBBB00000000BBBB, 0x60000000000000006666000000006666) = 0x03EAEA63EA63636305056363E763058C +dec (0xB000000000000000BBBB00000000BBBB, 0x60000000000000006666000000006666) = 0x8980AA6F9CBC75FB098F80AA7897B25D +declast(0xB000000000000000BBBB00000000BBBB, 0x60000000000000006666000000006666) = 0x32FE5252FC5252523434FE52FE523498 +enc (0xB000000000000000BBBB00000000BBBB, 0x70000000000000007777000000007777) = 0x13E3EA6A6AE3EAEA14146363F07D1999 +enclast(0xB000000000000000BBBB00000000BBBB, 0x70000000000000007777000000007777) = 0x13EAEA63EA63636314146363E763149D +dec (0xB000000000000000BBBB00000000BBBB, 0x70000000000000007777000000007777) = 0x9980AA6F9CBC75FB189E80AA7897A34C +declast(0xB000000000000000BBBB00000000BBBB, 0x70000000000000007777000000007777) = 0x22FE5252FC5252522525FE52FE522589 +enc (0xB000000000000000BBBB00000000BBBB, 0x80000000000000008888000000008888) = 0xE3E3EA6A6AE3EAEAEBEB6363F07DE666 +enclast(0xB000000000000000BBBB00000000BBBB, 0x80000000000000008888000000008888) = 0xE3EAEA63EA636363EBEB6363E763EB62 +dec (0xB000000000000000BBBB00000000BBBB, 0x80000000000000008888000000008888) = 0x6980AA6F9CBC75FBE76180AA78975CB3 +declast(0xB000000000000000BBBB00000000BBBB, 0x80000000000000008888000000008888) = 0xD2FE5252FC525252DADAFE52FE52DA76 +enc (0xB000000000000000BBBB00000000BBBB, 0x90000000000000009999000000009999) = 0xF3E3EA6A6AE3EAEAFAFA6363F07DF777 +enclast(0xB000000000000000BBBB00000000BBBB, 0x90000000000000009999000000009999) = 0xF3EAEA63EA636363FAFA6363E763FA73 +dec (0xB000000000000000BBBB00000000BBBB, 0x90000000000000009999000000009999) = 0x7980AA6F9CBC75FBF67080AA78974DA2 +declast(0xB000000000000000BBBB00000000BBBB, 0x90000000000000009999000000009999) = 0xC2FE5252FC525252CBCBFE52FE52CB67 +enc (0xB000000000000000BBBB00000000BBBB, 0xA000000000000000AAAA00000000AAAA) = 0xC3E3EA6A6AE3EAEAC9C96363F07DC444 +enclast(0xB000000000000000BBBB00000000BBBB, 0xA000000000000000AAAA00000000AAAA) = 0xC3EAEA63EA636363C9C96363E763C940 +dec (0xB000000000000000BBBB00000000BBBB, 0xA000000000000000AAAA00000000AAAA) = 0x4980AA6F9CBC75FBC54380AA78977E91 +declast(0xB000000000000000BBBB00000000BBBB, 0xA000000000000000AAAA00000000AAAA) = 0xF2FE5252FC525252F8F8FE52FE52F854 +enc (0xB000000000000000BBBB00000000BBBB, 0xB000000000000000BBBB00000000BBBB) = 0xD3E3EA6A6AE3EAEAD8D86363F07DD555 +enclast(0xB000000000000000BBBB00000000BBBB, 0xB000000000000000BBBB00000000BBBB) = 0xD3EAEA63EA636363D8D86363E763D851 +dec (0xB000000000000000BBBB00000000BBBB, 0xB000000000000000BBBB00000000BBBB) = 0x5980AA6F9CBC75FBD45280AA78976F80 +declast(0xB000000000000000BBBB00000000BBBB, 0xB000000000000000BBBB00000000BBBB) = 0xE2FE5252FC525252E9E9FE52FE52E945 +enc (0xB000000000000000BBBB00000000BBBB, 0xC000000000000000CCCC00000000CCCC) = 0xA3E3EA6A6AE3EAEAAFAF6363F07DA222 +enclast(0xB000000000000000BBBB00000000BBBB, 0xC000000000000000CCCC00000000CCCC) = 0xA3EAEA63EA636363AFAF6363E763AF26 +dec (0xB000000000000000BBBB00000000BBBB, 0xC000000000000000CCCC00000000CCCC) = 0x2980AA6F9CBC75FBA32580AA789718F7 +declast(0xB000000000000000BBBB00000000BBBB, 0xC000000000000000CCCC00000000CCCC) = 0x92FE5252FC5252529E9EFE52FE529E32 +enc (0xB000000000000000BBBB00000000BBBB, 0xD000000000000000DDDD00000000DDDD) = 0xB3E3EA6A6AE3EAEABEBE6363F07DB333 +enclast(0xB000000000000000BBBB00000000BBBB, 0xD000000000000000DDDD00000000DDDD) = 0xB3EAEA63EA636363BEBE6363E763BE37 +dec (0xB000000000000000BBBB00000000BBBB, 0xD000000000000000DDDD00000000DDDD) = 0x3980AA6F9CBC75FBB23480AA789709E6 +declast(0xB000000000000000BBBB00000000BBBB, 0xD000000000000000DDDD00000000DDDD) = 0x82FE5252FC5252528F8FFE52FE528F23 +enc (0xB000000000000000BBBB00000000BBBB, 0xE000000000000000EEEE00000000EEEE) = 0x83E3EA6A6AE3EAEA8D8D6363F07D8000 +enclast(0xB000000000000000BBBB00000000BBBB, 0xE000000000000000EEEE00000000EEEE) = 0x83EAEA63EA6363638D8D6363E7638D04 +dec (0xB000000000000000BBBB00000000BBBB, 0xE000000000000000EEEE00000000EEEE) = 0x0980AA6F9CBC75FB810780AA78973AD5 +declast(0xB000000000000000BBBB00000000BBBB, 0xE000000000000000EEEE00000000EEEE) = 0xB2FE5252FC525252BCBCFE52FE52BC10 +enc (0xB000000000000000BBBB00000000BBBB, 0xF000000000000000FFFF00000000FFFF) = 0x93E3EA6A6AE3EAEA9C9C6363F07D9111 +enclast(0xB000000000000000BBBB00000000BBBB, 0xF000000000000000FFFF00000000FFFF) = 0x93EAEA63EA6363639C9C6363E7639C15 +dec (0xB000000000000000BBBB00000000BBBB, 0xF000000000000000FFFF00000000FFFF) = 0x1980AA6F9CBC75FB901680AA78972BC4 +declast(0xB000000000000000BBBB00000000BBBB, 0xF000000000000000FFFF00000000FFFF) = 0xA2FE5252FC525252ADADFE52FE52AD01 +keygenassist(0xB000000000000000BBBB00000000BBBB, 0x00) = 0x63E76363E763636363EAEA63EAEA6363 +keygenassist(0xB000000000000000BBBB00000000BBBB, 0x01) = 0x63E76362E763636363EAEA62EAEA6363 +keygenassist(0xB000000000000000BBBB00000000BBBB, 0x02) = 0x63E76361E763636363EAEA61EAEA6363 +keygenassist(0xB000000000000000BBBB00000000BBBB, 0x04) = 0x63E76367E763636363EAEA67EAEA6363 +keygenassist(0xB000000000000000BBBB00000000BBBB, 0x08) = 0x63E7636BE763636363EAEA6BEAEA6363 +keygenassist(0xB000000000000000BBBB00000000BBBB, 0x10) = 0x63E76373E763636363EAEA73EAEA6363 +keygenassist(0xB000000000000000BBBB00000000BBBB, 0x38) = 0x63E7635BE763636363EAEA5BEAEA6363 +keygenassist(0xB000000000000000BBBB00000000BBBB, 0x4F) = 0x63E7632CE763636363EAEA2CEAEA6363 +keygenassist(0xB000000000000000BBBB00000000BBBB, 0xFF) = 0x63E7639CE763636363EAEA9CEAEA6363 +imc (0xB000000000000000BBBB00000000BBBB) = 0x7A3CB147000000000C61B7DAB7DA0C61 +pclmul(0xB000000000000000BBBB00000000BBBB, 0x00) = 0x3835E358BBE360D6DB35BBE358E3386D +pclmul(0xB000000000000000BBBB00000000BBBB, 0x01) = 0x3832336C5F3354320B015F336C00386D +pclmul(0xB000000000000000BBBB00000000BBBB, 0x10) = 0x3BB686DBB686DBEBD000000000000000 +pclmul(0xB000000000000000BBBB00000000BBBB, 0xFF) = 0x3BB12BEBB12BEBEBD000000000000000 +enc (0xC000000000000000CCCC00000000CCCC, 0x00000000000000000000000000000000) = 0x631B4B33331B4B4B63636363B23B92EA +enclast(0xC000000000000000CCCC00000000CCCC, 0x00000000000000000000000000000000) = 0x634B4B634B63636363636363BA63634B +dec (0xC000000000000000CCCC00000000CCCC, 0x00000000000000000000000000000000) = 0xA2F2486DB9DB6E416DA2F248E8779D02 +declast(0xC000000000000000CCCC00000000CCCC, 0x00000000000000000000000000000000) = 0x522752521F5252525252275227525227 +enc (0xC000000000000000CCCC00000000CCCC, 0x10000000000000001111000000001111) = 0x731B4B33331B4B4B72726363B23B83FB +enclast(0xC000000000000000CCCC00000000CCCC, 0x10000000000000001111000000001111) = 0x734B4B634B63636372726363BA63725A +dec (0xC000000000000000CCCC00000000CCCC, 0x10000000000000001111000000001111) = 0xB2F2486DB9DB6E417CB3F248E8778C13 +declast(0xC000000000000000CCCC00000000CCCC, 0x10000000000000001111000000001111) = 0x422752521F5252524343275227524336 +enc (0xC000000000000000CCCC00000000CCCC, 0x20000000000000002222000000002222) = 0x431B4B33331B4B4B41416363B23BB0C8 +enclast(0xC000000000000000CCCC00000000CCCC, 0x20000000000000002222000000002222) = 0x434B4B634B63636341416363BA634169 +dec (0xC000000000000000CCCC00000000CCCC, 0x20000000000000002222000000002222) = 0x82F2486DB9DB6E414F80F248E877BF20 +declast(0xC000000000000000CCCC00000000CCCC, 0x20000000000000002222000000002222) = 0x722752521F5252527070275227527005 +enc (0xC000000000000000CCCC00000000CCCC, 0x30000000000000003333000000003333) = 0x531B4B33331B4B4B50506363B23BA1D9 +enclast(0xC000000000000000CCCC00000000CCCC, 0x30000000000000003333000000003333) = 0x534B4B634B63636350506363BA635078 +dec (0xC000000000000000CCCC00000000CCCC, 0x30000000000000003333000000003333) = 0x92F2486DB9DB6E415E91F248E877AE31 +declast(0xC000000000000000CCCC00000000CCCC, 0x30000000000000003333000000003333) = 0x622752521F5252526161275227526114 +enc (0xC000000000000000CCCC00000000CCCC, 0x40000000000000004444000000004444) = 0x231B4B33331B4B4B27276363B23BD6AE +enclast(0xC000000000000000CCCC00000000CCCC, 0x40000000000000004444000000004444) = 0x234B4B634B63636327276363BA63270F +dec (0xC000000000000000CCCC00000000CCCC, 0x40000000000000004444000000004444) = 0xE2F2486DB9DB6E4129E6F248E877D946 +declast(0xC000000000000000CCCC00000000CCCC, 0x40000000000000004444000000004444) = 0x122752521F5252521616275227521663 +enc (0xC000000000000000CCCC00000000CCCC, 0x50000000000000005555000000005555) = 0x331B4B33331B4B4B36366363B23BC7BF +enclast(0xC000000000000000CCCC00000000CCCC, 0x50000000000000005555000000005555) = 0x334B4B634B63636336366363BA63361E +dec (0xC000000000000000CCCC00000000CCCC, 0x50000000000000005555000000005555) = 0xF2F2486DB9DB6E4138F7F248E877C857 +declast(0xC000000000000000CCCC00000000CCCC, 0x50000000000000005555000000005555) = 0x022752521F5252520707275227520772 +enc (0xC000000000000000CCCC00000000CCCC, 0x60000000000000006666000000006666) = 0x031B4B33331B4B4B05056363B23BF48C +enclast(0xC000000000000000CCCC00000000CCCC, 0x60000000000000006666000000006666) = 0x034B4B634B63636305056363BA63052D +dec (0xC000000000000000CCCC00000000CCCC, 0x60000000000000006666000000006666) = 0xC2F2486DB9DB6E410BC4F248E877FB64 +declast(0xC000000000000000CCCC00000000CCCC, 0x60000000000000006666000000006666) = 0x322752521F5252523434275227523441 +enc (0xC000000000000000CCCC00000000CCCC, 0x70000000000000007777000000007777) = 0x131B4B33331B4B4B14146363B23BE59D +enclast(0xC000000000000000CCCC00000000CCCC, 0x70000000000000007777000000007777) = 0x134B4B634B63636314146363BA63143C +dec (0xC000000000000000CCCC00000000CCCC, 0x70000000000000007777000000007777) = 0xD2F2486DB9DB6E411AD5F248E877EA75 +declast(0xC000000000000000CCCC00000000CCCC, 0x70000000000000007777000000007777) = 0x222752521F5252522525275227522550 +enc (0xC000000000000000CCCC00000000CCCC, 0x80000000000000008888000000008888) = 0xE31B4B33331B4B4BEBEB6363B23B1A62 +enclast(0xC000000000000000CCCC00000000CCCC, 0x80000000000000008888000000008888) = 0xE34B4B634B636363EBEB6363BA63EBC3 +dec (0xC000000000000000CCCC00000000CCCC, 0x80000000000000008888000000008888) = 0x22F2486DB9DB6E41E52AF248E877158A +declast(0xC000000000000000CCCC00000000CCCC, 0x80000000000000008888000000008888) = 0xD22752521F525252DADA27522752DAAF +enc (0xC000000000000000CCCC00000000CCCC, 0x90000000000000009999000000009999) = 0xF31B4B33331B4B4BFAFA6363B23B0B73 +enclast(0xC000000000000000CCCC00000000CCCC, 0x90000000000000009999000000009999) = 0xF34B4B634B636363FAFA6363BA63FAD2 +dec (0xC000000000000000CCCC00000000CCCC, 0x90000000000000009999000000009999) = 0x32F2486DB9DB6E41F43BF248E877049B +declast(0xC000000000000000CCCC00000000CCCC, 0x90000000000000009999000000009999) = 0xC22752521F525252CBCB27522752CBBE +enc (0xC000000000000000CCCC00000000CCCC, 0xA000000000000000AAAA00000000AAAA) = 0xC31B4B33331B4B4BC9C96363B23B3840 +enclast(0xC000000000000000CCCC00000000CCCC, 0xA000000000000000AAAA00000000AAAA) = 0xC34B4B634B636363C9C96363BA63C9E1 +dec (0xC000000000000000CCCC00000000CCCC, 0xA000000000000000AAAA00000000AAAA) = 0x02F2486DB9DB6E41C708F248E87737A8 +declast(0xC000000000000000CCCC00000000CCCC, 0xA000000000000000AAAA00000000AAAA) = 0xF22752521F525252F8F827522752F88D +enc (0xC000000000000000CCCC00000000CCCC, 0xB000000000000000BBBB00000000BBBB) = 0xD31B4B33331B4B4BD8D86363B23B2951 +enclast(0xC000000000000000CCCC00000000CCCC, 0xB000000000000000BBBB00000000BBBB) = 0xD34B4B634B636363D8D86363BA63D8F0 +dec (0xC000000000000000CCCC00000000CCCC, 0xB000000000000000BBBB00000000BBBB) = 0x12F2486DB9DB6E41D619F248E87726B9 +declast(0xC000000000000000CCCC00000000CCCC, 0xB000000000000000BBBB00000000BBBB) = 0xE22752521F525252E9E927522752E99C +enc (0xC000000000000000CCCC00000000CCCC, 0xC000000000000000CCCC00000000CCCC) = 0xA31B4B33331B4B4BAFAF6363B23B5E26 +enclast(0xC000000000000000CCCC00000000CCCC, 0xC000000000000000CCCC00000000CCCC) = 0xA34B4B634B636363AFAF6363BA63AF87 +dec (0xC000000000000000CCCC00000000CCCC, 0xC000000000000000CCCC00000000CCCC) = 0x62F2486DB9DB6E41A16EF248E87751CE +declast(0xC000000000000000CCCC00000000CCCC, 0xC000000000000000CCCC00000000CCCC) = 0x922752521F5252529E9E275227529EEB +enc (0xC000000000000000CCCC00000000CCCC, 0xD000000000000000DDDD00000000DDDD) = 0xB31B4B33331B4B4BBEBE6363B23B4F37 +enclast(0xC000000000000000CCCC00000000CCCC, 0xD000000000000000DDDD00000000DDDD) = 0xB34B4B634B636363BEBE6363BA63BE96 +dec (0xC000000000000000CCCC00000000CCCC, 0xD000000000000000DDDD00000000DDDD) = 0x72F2486DB9DB6E41B07FF248E87740DF +declast(0xC000000000000000CCCC00000000CCCC, 0xD000000000000000DDDD00000000DDDD) = 0x822752521F5252528F8F275227528FFA +enc (0xC000000000000000CCCC00000000CCCC, 0xE000000000000000EEEE00000000EEEE) = 0x831B4B33331B4B4B8D8D6363B23B7C04 +enclast(0xC000000000000000CCCC00000000CCCC, 0xE000000000000000EEEE00000000EEEE) = 0x834B4B634B6363638D8D6363BA638DA5 +dec (0xC000000000000000CCCC00000000CCCC, 0xE000000000000000EEEE00000000EEEE) = 0x42F2486DB9DB6E41834CF248E87773EC +declast(0xC000000000000000CCCC00000000CCCC, 0xE000000000000000EEEE00000000EEEE) = 0xB22752521F525252BCBC27522752BCC9 +enc (0xC000000000000000CCCC00000000CCCC, 0xF000000000000000FFFF00000000FFFF) = 0x931B4B33331B4B4B9C9C6363B23B6D15 +enclast(0xC000000000000000CCCC00000000CCCC, 0xF000000000000000FFFF00000000FFFF) = 0x934B4B634B6363639C9C6363BA639CB4 +dec (0xC000000000000000CCCC00000000CCCC, 0xF000000000000000FFFF00000000FFFF) = 0x52F2486DB9DB6E41925DF248E87762FD +declast(0xC000000000000000CCCC00000000CCCC, 0xF000000000000000FFFF00000000FFFF) = 0xA22752521F525252ADAD27522752ADD8 +keygenassist(0xC000000000000000CCCC00000000CCCC, 0x00) = 0x63BA6363BA636363634B4B634B4B6363 +keygenassist(0xC000000000000000CCCC00000000CCCC, 0x01) = 0x63BA6362BA636363634B4B624B4B6363 +keygenassist(0xC000000000000000CCCC00000000CCCC, 0x02) = 0x63BA6361BA636363634B4B614B4B6363 +keygenassist(0xC000000000000000CCCC00000000CCCC, 0x04) = 0x63BA6367BA636363634B4B674B4B6363 +keygenassist(0xC000000000000000CCCC00000000CCCC, 0x08) = 0x63BA636BBA636363634B4B6B4B4B6363 +keygenassist(0xC000000000000000CCCC00000000CCCC, 0x10) = 0x63BA6373BA636363634B4B734B4B6363 +keygenassist(0xC000000000000000CCCC00000000CCCC, 0x38) = 0x63BA635BBA636363634B4B5B4B4B6363 +keygenassist(0xC000000000000000CCCC00000000CCCC, 0x4F) = 0x63BA632CBA636363634B4B2C4B4B6363 +keygenassist(0xC000000000000000CCCC00000000CCCC, 0xFF) = 0x63BA639CBA636363634B4B9C4B4B6363 +imc (0xC000000000000000CCCC00000000CCCC) = 0xEC01B79A0000000052D19E1D9E1D52D1 +pclmul(0xC000000000000000CCCC00000000CCCC, 0x00) = 0x2BCBE01FFFE0342BCBCBFFE01FE02BD4 +pclmul(0xC000000000000000CCCC00000000CCCC, 0x01) = 0x2B8B336C5F33478B18B85F336C002BD4 +pclmul(0xC000000000000000CCCC00000000CCCC, 0x10) = 0x29777769777769694000000000000000 +pclmul(0xC000000000000000CCCC00000000CCCC, 0xFF) = 0x2933A96933A969694000000000000000 +enc (0xD000000000000000DDDD00000000DDDD, 0x00000000000000000000000000000000) = 0x639EC13C3C9EC1C163636363B8F4D22F +enclast(0xD000000000000000DDDD00000000DDDD, 0x00000000000000000000000000000000) = 0x63C1C163C163636363636363706363C1 +dec (0xD000000000000000DDDD00000000DDDD, 0x00000000000000000000000000000000) = 0x7D915027758F23EB277D9150932508BE +declast(0xD000000000000000DDDD00000000DDDD, 0x00000000000000000000000000000000) = 0x52C95252605252525252C952C95252C9 +enc (0xD000000000000000DDDD00000000DDDD, 0x10000000000000001111000000001111) = 0x739EC13C3C9EC1C172726363B8F4C33E +enclast(0xD000000000000000DDDD00000000DDDD, 0x10000000000000001111000000001111) = 0x73C1C163C163636372726363706372D0 +dec (0xD000000000000000DDDD00000000DDDD, 0x10000000000000001111000000001111) = 0x6D915027758F23EB366C9150932519AF +declast(0xD000000000000000DDDD00000000DDDD, 0x10000000000000001111000000001111) = 0x42C95252605252524343C952C95243D8 +enc (0xD000000000000000DDDD00000000DDDD, 0x20000000000000002222000000002222) = 0x439EC13C3C9EC1C141416363B8F4F00D +enclast(0xD000000000000000DDDD00000000DDDD, 0x20000000000000002222000000002222) = 0x43C1C163C163636341416363706341E3 +dec (0xD000000000000000DDDD00000000DDDD, 0x20000000000000002222000000002222) = 0x5D915027758F23EB055F915093252A9C +declast(0xD000000000000000DDDD00000000DDDD, 0x20000000000000002222000000002222) = 0x72C95252605252527070C952C95270EB +enc (0xD000000000000000DDDD00000000DDDD, 0x30000000000000003333000000003333) = 0x539EC13C3C9EC1C150506363B8F4E11C +enclast(0xD000000000000000DDDD00000000DDDD, 0x30000000000000003333000000003333) = 0x53C1C163C163636350506363706350F2 +dec (0xD000000000000000DDDD00000000DDDD, 0x30000000000000003333000000003333) = 0x4D915027758F23EB144E915093253B8D +declast(0xD000000000000000DDDD00000000DDDD, 0x30000000000000003333000000003333) = 0x62C95252605252526161C952C95261FA +enc (0xD000000000000000DDDD00000000DDDD, 0x40000000000000004444000000004444) = 0x239EC13C3C9EC1C127276363B8F4966B +enclast(0xD000000000000000DDDD00000000DDDD, 0x40000000000000004444000000004444) = 0x23C1C163C16363632727636370632785 +dec (0xD000000000000000DDDD00000000DDDD, 0x40000000000000004444000000004444) = 0x3D915027758F23EB6339915093254CFA +declast(0xD000000000000000DDDD00000000DDDD, 0x40000000000000004444000000004444) = 0x12C95252605252521616C952C952168D +enc (0xD000000000000000DDDD00000000DDDD, 0x50000000000000005555000000005555) = 0x339EC13C3C9EC1C136366363B8F4877A +enclast(0xD000000000000000DDDD00000000DDDD, 0x50000000000000005555000000005555) = 0x33C1C163C16363633636636370633694 +dec (0xD000000000000000DDDD00000000DDDD, 0x50000000000000005555000000005555) = 0x2D915027758F23EB7228915093255DEB +declast(0xD000000000000000DDDD00000000DDDD, 0x50000000000000005555000000005555) = 0x02C95252605252520707C952C952079C +enc (0xD000000000000000DDDD00000000DDDD, 0x60000000000000006666000000006666) = 0x039EC13C3C9EC1C105056363B8F4B449 +enclast(0xD000000000000000DDDD00000000DDDD, 0x60000000000000006666000000006666) = 0x03C1C163C163636305056363706305A7 +dec (0xD000000000000000DDDD00000000DDDD, 0x60000000000000006666000000006666) = 0x1D915027758F23EB411B915093256ED8 +declast(0xD000000000000000DDDD00000000DDDD, 0x60000000000000006666000000006666) = 0x32C95252605252523434C952C95234AF +enc (0xD000000000000000DDDD00000000DDDD, 0x70000000000000007777000000007777) = 0x139EC13C3C9EC1C114146363B8F4A558 +enclast(0xD000000000000000DDDD00000000DDDD, 0x70000000000000007777000000007777) = 0x13C1C163C163636314146363706314B6 +dec (0xD000000000000000DDDD00000000DDDD, 0x70000000000000007777000000007777) = 0x0D915027758F23EB500A915093257FC9 +declast(0xD000000000000000DDDD00000000DDDD, 0x70000000000000007777000000007777) = 0x22C95252605252522525C952C95225BE +enc (0xD000000000000000DDDD00000000DDDD, 0x80000000000000008888000000008888) = 0xE39EC13C3C9EC1C1EBEB6363B8F45AA7 +enclast(0xD000000000000000DDDD00000000DDDD, 0x80000000000000008888000000008888) = 0xE3C1C163C1636363EBEB63637063EB49 +dec (0xD000000000000000DDDD00000000DDDD, 0x80000000000000008888000000008888) = 0xFD915027758F23EBAFF5915093258036 +declast(0xD000000000000000DDDD00000000DDDD, 0x80000000000000008888000000008888) = 0xD2C9525260525252DADAC952C952DA41 +enc (0xD000000000000000DDDD00000000DDDD, 0x90000000000000009999000000009999) = 0xF39EC13C3C9EC1C1FAFA6363B8F44BB6 +enclast(0xD000000000000000DDDD00000000DDDD, 0x90000000000000009999000000009999) = 0xF3C1C163C1636363FAFA63637063FA58 +dec (0xD000000000000000DDDD00000000DDDD, 0x90000000000000009999000000009999) = 0xED915027758F23EBBEE4915093259127 +declast(0xD000000000000000DDDD00000000DDDD, 0x90000000000000009999000000009999) = 0xC2C9525260525252CBCBC952C952CB50 +enc (0xD000000000000000DDDD00000000DDDD, 0xA000000000000000AAAA00000000AAAA) = 0xC39EC13C3C9EC1C1C9C96363B8F47885 +enclast(0xD000000000000000DDDD00000000DDDD, 0xA000000000000000AAAA00000000AAAA) = 0xC3C1C163C1636363C9C963637063C96B +dec (0xD000000000000000DDDD00000000DDDD, 0xA000000000000000AAAA00000000AAAA) = 0xDD915027758F23EB8DD791509325A214 +declast(0xD000000000000000DDDD00000000DDDD, 0xA000000000000000AAAA00000000AAAA) = 0xF2C9525260525252F8F8C952C952F863 +enc (0xD000000000000000DDDD00000000DDDD, 0xB000000000000000BBBB00000000BBBB) = 0xD39EC13C3C9EC1C1D8D86363B8F46994 +enclast(0xD000000000000000DDDD00000000DDDD, 0xB000000000000000BBBB00000000BBBB) = 0xD3C1C163C1636363D8D863637063D87A +dec (0xD000000000000000DDDD00000000DDDD, 0xB000000000000000BBBB00000000BBBB) = 0xCD915027758F23EB9CC691509325B305 +declast(0xD000000000000000DDDD00000000DDDD, 0xB000000000000000BBBB00000000BBBB) = 0xE2C9525260525252E9E9C952C952E972 +enc (0xD000000000000000DDDD00000000DDDD, 0xC000000000000000CCCC00000000CCCC) = 0xA39EC13C3C9EC1C1AFAF6363B8F41EE3 +enclast(0xD000000000000000DDDD00000000DDDD, 0xC000000000000000CCCC00000000CCCC) = 0xA3C1C163C1636363AFAF63637063AF0D +dec (0xD000000000000000DDDD00000000DDDD, 0xC000000000000000CCCC00000000CCCC) = 0xBD915027758F23EBEBB191509325C472 +declast(0xD000000000000000DDDD00000000DDDD, 0xC000000000000000CCCC00000000CCCC) = 0x92C95252605252529E9EC952C9529E05 +enc (0xD000000000000000DDDD00000000DDDD, 0xD000000000000000DDDD00000000DDDD) = 0xB39EC13C3C9EC1C1BEBE6363B8F40FF2 +enclast(0xD000000000000000DDDD00000000DDDD, 0xD000000000000000DDDD00000000DDDD) = 0xB3C1C163C1636363BEBE63637063BE1C +dec (0xD000000000000000DDDD00000000DDDD, 0xD000000000000000DDDD00000000DDDD) = 0xAD915027758F23EBFAA091509325D563 +declast(0xD000000000000000DDDD00000000DDDD, 0xD000000000000000DDDD00000000DDDD) = 0x82C95252605252528F8FC952C9528F14 +enc (0xD000000000000000DDDD00000000DDDD, 0xE000000000000000EEEE00000000EEEE) = 0x839EC13C3C9EC1C18D8D6363B8F43CC1 +enclast(0xD000000000000000DDDD00000000DDDD, 0xE000000000000000EEEE00000000EEEE) = 0x83C1C163C16363638D8D636370638D2F +dec (0xD000000000000000DDDD00000000DDDD, 0xE000000000000000EEEE00000000EEEE) = 0x9D915027758F23EBC99391509325E650 +declast(0xD000000000000000DDDD00000000DDDD, 0xE000000000000000EEEE00000000EEEE) = 0xB2C9525260525252BCBCC952C952BC27 +enc (0xD000000000000000DDDD00000000DDDD, 0xF000000000000000FFFF00000000FFFF) = 0x939EC13C3C9EC1C19C9C6363B8F42DD0 +enclast(0xD000000000000000DDDD00000000DDDD, 0xF000000000000000FFFF00000000FFFF) = 0x93C1C163C16363639C9C636370639C3E +dec (0xD000000000000000DDDD00000000DDDD, 0xF000000000000000FFFF00000000FFFF) = 0x8D915027758F23EBD88291509325F741 +declast(0xD000000000000000DDDD00000000DDDD, 0xF000000000000000FFFF00000000FFFF) = 0xA2C9525260525252ADADC952C952AD36 +keygenassist(0xD000000000000000DDDD00000000DDDD, 0x00) = 0x637063637063636363C1C163C1C16363 +keygenassist(0xD000000000000000DDDD00000000DDDD, 0x01) = 0x637063627063636363C1C162C1C16363 +keygenassist(0xD000000000000000DDDD00000000DDDD, 0x02) = 0x637063617063636363C1C161C1C16363 +keygenassist(0xD000000000000000DDDD00000000DDDD, 0x04) = 0x637063677063636363C1C167C1C16363 +keygenassist(0xD000000000000000DDDD00000000DDDD, 0x08) = 0x6370636B7063636363C1C16BC1C16363 +keygenassist(0xD000000000000000DDDD00000000DDDD, 0x10) = 0x637063737063636363C1C173C1C16363 +keygenassist(0xD000000000000000DDDD00000000DDDD, 0x38) = 0x6370635B7063636363C1C15BC1C16363 +keygenassist(0xD000000000000000DDDD00000000DDDD, 0x4F) = 0x6370632C7063636363C1C12CC1C16363 +keygenassist(0xD000000000000000DDDD00000000DDDD, 0xFF) = 0x6370639C7063636363C1C19CC1C16363 +imc (0xD000000000000000DDDD00000000DDDD) = 0x0CB1670A000000002584F859F8592584 +pclmul(0xD000000000000000DDDD00000000DDDD, 0x00) = 0x2DF39A74EE9A5969B7F3EE9A749A2D87 +pclmul(0xD000000000000000DDDD00000000DDDD, 0x01) = 0x2D8BBBB70CBB9A8B96300CBBB7002D87 +pclmul(0xD000000000000000DDDD00000000DDDD, 0x10) = 0x2F2C8CFF2C8CFF5F7000000000000000 +pclmul(0xD000000000000000DDDD00000000DDDD, 0xFF) = 0x2F532F5F532F5F5F7000000000000000 +enc (0xE000000000000000EEEE00000000EEEE, 0x00000000000000000000000000000000) = 0x63BE28F5F5BE282863636363A1B5AA77 +enclast(0xE000000000000000EEEE00000000EEEE, 0x00000000000000000000000000000000) = 0x632828632863636363636363E1636328 +dec (0xE000000000000000EEEE00000000EEEE, 0x00000000000000000000000000000000) = 0x9BDC169A998E94719A9BDC1698DE5315 +declast(0xE000000000000000EEEE00000000EEEE, 0x00000000000000000000000000000000) = 0x52995252A05252525252995299525299 +enc (0xE000000000000000EEEE00000000EEEE, 0x10000000000000001111000000001111) = 0x73BE28F5F5BE282872726363A1B5BB66 +enclast(0xE000000000000000EEEE00000000EEEE, 0x10000000000000001111000000001111) = 0x732828632863636372726363E1637239 +dec (0xE000000000000000EEEE00000000EEEE, 0x10000000000000001111000000001111) = 0x8BDC169A998E94718B8ADC1698DE4204 +declast(0xE000000000000000EEEE00000000EEEE, 0x10000000000000001111000000001111) = 0x42995252A05252524343995299524388 +enc (0xE000000000000000EEEE00000000EEEE, 0x20000000000000002222000000002222) = 0x43BE28F5F5BE282841416363A1B58855 +enclast(0xE000000000000000EEEE00000000EEEE, 0x20000000000000002222000000002222) = 0x432828632863636341416363E163410A +dec (0xE000000000000000EEEE00000000EEEE, 0x20000000000000002222000000002222) = 0xBBDC169A998E9471B8B9DC1698DE7137 +declast(0xE000000000000000EEEE00000000EEEE, 0x20000000000000002222000000002222) = 0x72995252A052525270709952995270BB +enc (0xE000000000000000EEEE00000000EEEE, 0x30000000000000003333000000003333) = 0x53BE28F5F5BE282850506363A1B59944 +enclast(0xE000000000000000EEEE00000000EEEE, 0x30000000000000003333000000003333) = 0x532828632863636350506363E163501B +dec (0xE000000000000000EEEE00000000EEEE, 0x30000000000000003333000000003333) = 0xABDC169A998E9471A9A8DC1698DE6026 +declast(0xE000000000000000EEEE00000000EEEE, 0x30000000000000003333000000003333) = 0x62995252A052525261619952995261AA +enc (0xE000000000000000EEEE00000000EEEE, 0x40000000000000004444000000004444) = 0x23BE28F5F5BE282827276363A1B5EE33 +enclast(0xE000000000000000EEEE00000000EEEE, 0x40000000000000004444000000004444) = 0x232828632863636327276363E163276C +dec (0xE000000000000000EEEE00000000EEEE, 0x40000000000000004444000000004444) = 0xDBDC169A998E9471DEDFDC1698DE1751 +declast(0xE000000000000000EEEE00000000EEEE, 0x40000000000000004444000000004444) = 0x12995252A052525216169952995216DD +enc (0xE000000000000000EEEE00000000EEEE, 0x50000000000000005555000000005555) = 0x33BE28F5F5BE282836366363A1B5FF22 +enclast(0xE000000000000000EEEE00000000EEEE, 0x50000000000000005555000000005555) = 0x332828632863636336366363E163367D +dec (0xE000000000000000EEEE00000000EEEE, 0x50000000000000005555000000005555) = 0xCBDC169A998E9471CFCEDC1698DE0640 +declast(0xE000000000000000EEEE00000000EEEE, 0x50000000000000005555000000005555) = 0x02995252A052525207079952995207CC +enc (0xE000000000000000EEEE00000000EEEE, 0x60000000000000006666000000006666) = 0x03BE28F5F5BE282805056363A1B5CC11 +enclast(0xE000000000000000EEEE00000000EEEE, 0x60000000000000006666000000006666) = 0x032828632863636305056363E163054E +dec (0xE000000000000000EEEE00000000EEEE, 0x60000000000000006666000000006666) = 0xFBDC169A998E9471FCFDDC1698DE3573 +declast(0xE000000000000000EEEE00000000EEEE, 0x60000000000000006666000000006666) = 0x32995252A052525234349952995234FF +enc (0xE000000000000000EEEE00000000EEEE, 0x70000000000000007777000000007777) = 0x13BE28F5F5BE282814146363A1B5DD00 +enclast(0xE000000000000000EEEE00000000EEEE, 0x70000000000000007777000000007777) = 0x132828632863636314146363E163145F +dec (0xE000000000000000EEEE00000000EEEE, 0x70000000000000007777000000007777) = 0xEBDC169A998E9471EDECDC1698DE2462 +declast(0xE000000000000000EEEE00000000EEEE, 0x70000000000000007777000000007777) = 0x22995252A052525225259952995225EE +enc (0xE000000000000000EEEE00000000EEEE, 0x80000000000000008888000000008888) = 0xE3BE28F5F5BE2828EBEB6363A1B522FF +enclast(0xE000000000000000EEEE00000000EEEE, 0x80000000000000008888000000008888) = 0xE328286328636363EBEB6363E163EBA0 +dec (0xE000000000000000EEEE00000000EEEE, 0x80000000000000008888000000008888) = 0x1BDC169A998E94711213DC1698DEDB9D +declast(0xE000000000000000EEEE00000000EEEE, 0x80000000000000008888000000008888) = 0xD2995252A0525252DADA99529952DA11 +enc (0xE000000000000000EEEE00000000EEEE, 0x90000000000000009999000000009999) = 0xF3BE28F5F5BE2828FAFA6363A1B533EE +enclast(0xE000000000000000EEEE00000000EEEE, 0x90000000000000009999000000009999) = 0xF328286328636363FAFA6363E163FAB1 +dec (0xE000000000000000EEEE00000000EEEE, 0x90000000000000009999000000009999) = 0x0BDC169A998E94710302DC1698DECA8C +declast(0xE000000000000000EEEE00000000EEEE, 0x90000000000000009999000000009999) = 0xC2995252A0525252CBCB99529952CB00 +enc (0xE000000000000000EEEE00000000EEEE, 0xA000000000000000AAAA00000000AAAA) = 0xC3BE28F5F5BE2828C9C96363A1B500DD +enclast(0xE000000000000000EEEE00000000EEEE, 0xA000000000000000AAAA00000000AAAA) = 0xC328286328636363C9C96363E163C982 +dec (0xE000000000000000EEEE00000000EEEE, 0xA000000000000000AAAA00000000AAAA) = 0x3BDC169A998E94713031DC1698DEF9BF +declast(0xE000000000000000EEEE00000000EEEE, 0xA000000000000000AAAA00000000AAAA) = 0xF2995252A0525252F8F899529952F833 +enc (0xE000000000000000EEEE00000000EEEE, 0xB000000000000000BBBB00000000BBBB) = 0xD3BE28F5F5BE2828D8D86363A1B511CC +enclast(0xE000000000000000EEEE00000000EEEE, 0xB000000000000000BBBB00000000BBBB) = 0xD328286328636363D8D86363E163D893 +dec (0xE000000000000000EEEE00000000EEEE, 0xB000000000000000BBBB00000000BBBB) = 0x2BDC169A998E94712120DC1698DEE8AE +declast(0xE000000000000000EEEE00000000EEEE, 0xB000000000000000BBBB00000000BBBB) = 0xE2995252A0525252E9E999529952E922 +enc (0xE000000000000000EEEE00000000EEEE, 0xC000000000000000CCCC00000000CCCC) = 0xA3BE28F5F5BE2828AFAF6363A1B566BB +enclast(0xE000000000000000EEEE00000000EEEE, 0xC000000000000000CCCC00000000CCCC) = 0xA328286328636363AFAF6363E163AFE4 +dec (0xE000000000000000EEEE00000000EEEE, 0xC000000000000000CCCC00000000CCCC) = 0x5BDC169A998E94715657DC1698DE9FD9 +declast(0xE000000000000000EEEE00000000EEEE, 0xC000000000000000CCCC00000000CCCC) = 0x92995252A05252529E9E995299529E55 +enc (0xE000000000000000EEEE00000000EEEE, 0xD000000000000000DDDD00000000DDDD) = 0xB3BE28F5F5BE2828BEBE6363A1B577AA +enclast(0xE000000000000000EEEE00000000EEEE, 0xD000000000000000DDDD00000000DDDD) = 0xB328286328636363BEBE6363E163BEF5 +dec (0xE000000000000000EEEE00000000EEEE, 0xD000000000000000DDDD00000000DDDD) = 0x4BDC169A998E94714746DC1698DE8EC8 +declast(0xE000000000000000EEEE00000000EEEE, 0xD000000000000000DDDD00000000DDDD) = 0x82995252A05252528F8F995299528F44 +enc (0xE000000000000000EEEE00000000EEEE, 0xE000000000000000EEEE00000000EEEE) = 0x83BE28F5F5BE28288D8D6363A1B54499 +enclast(0xE000000000000000EEEE00000000EEEE, 0xE000000000000000EEEE00000000EEEE) = 0x83282863286363638D8D6363E1638DC6 +dec (0xE000000000000000EEEE00000000EEEE, 0xE000000000000000EEEE00000000EEEE) = 0x7BDC169A998E94717475DC1698DEBDFB +declast(0xE000000000000000EEEE00000000EEEE, 0xE000000000000000EEEE00000000EEEE) = 0xB2995252A0525252BCBC99529952BC77 +enc (0xE000000000000000EEEE00000000EEEE, 0xF000000000000000FFFF00000000FFFF) = 0x93BE28F5F5BE28289C9C6363A1B55588 +enclast(0xE000000000000000EEEE00000000EEEE, 0xF000000000000000FFFF00000000FFFF) = 0x93282863286363639C9C6363E1639CD7 +dec (0xE000000000000000EEEE00000000EEEE, 0xF000000000000000FFFF00000000FFFF) = 0x6BDC169A998E94716564DC1698DEACEA +declast(0xE000000000000000EEEE00000000EEEE, 0xF000000000000000FFFF00000000FFFF) = 0xA2995252A0525252ADAD99529952AD66 +keygenassist(0xE000000000000000EEEE00000000EEEE, 0x00) = 0x63E16363E16363636328286328286363 +keygenassist(0xE000000000000000EEEE00000000EEEE, 0x01) = 0x63E16362E16363636328286228286363 +keygenassist(0xE000000000000000EEEE00000000EEEE, 0x02) = 0x63E16361E16363636328286128286363 +keygenassist(0xE000000000000000EEEE00000000EEEE, 0x04) = 0x63E16367E16363636328286728286363 +keygenassist(0xE000000000000000EEEE00000000EEEE, 0x08) = 0x63E1636BE16363636328286B28286363 +keygenassist(0xE000000000000000EEEE00000000EEEE, 0x10) = 0x63E16373E16363636328287328286363 +keygenassist(0xE000000000000000EEEE00000000EEEE, 0x38) = 0x63E1635BE16363636328285B28286363 +keygenassist(0xE000000000000000EEEE00000000EEEE, 0x4F) = 0x63E1632CE16363636328282C28286363 +keygenassist(0xE000000000000000EEEE00000000EEEE, 0xFF) = 0x63E1639CE16363636328289C28286363 +imc (0xE000000000000000EEEE00000000EEEE) = 0x377A0CA100000000BC7B52955295BC7B +pclmul(0xE000000000000000EEEE00000000EEEE, 0x00) = 0x274FC23DFFC21A8DE54FFFC23DC22772 +pclmul(0xE000000000000000EEEE00000000EEEE, 0x01) = 0x2704AADC76AAFB048DAE76AADC002772 +pclmul(0xE000000000000000EEEE00000000EEEE, 0x10) = 0x253B1B253B1B25052000000000000000 +pclmul(0xE000000000000000EEEE00000000EEEE, 0xFF) = 0x2574C50574C505052000000000000000 +enc (0xF000000000000000FFFF00000000FFFF, 0x00000000000000000000000000000000) = 0x63FC168989FC161663636363393CF966 +enclast(0xF000000000000000FFFF00000000FFFF, 0x00000000000000000000000000000000) = 0x6316166316636363636363638C636316 +dec (0xF000000000000000FFFF00000000FFFF, 0x00000000000000000000000000000000) = 0x1ED340A2C9830609A21ED340C1B0EE9F +declast(0xF000000000000000FFFF00000000FFFF, 0x00000000000000000000000000000000) = 0x527D52521752525252527D527D52527D +enc (0xF000000000000000FFFF00000000FFFF, 0x10000000000000001111000000001111) = 0x73FC168989FC161672726363393CE877 +enclast(0xF000000000000000FFFF00000000FFFF, 0x10000000000000001111000000001111) = 0x7316166316636363727263638C637207 +dec (0xF000000000000000FFFF00000000FFFF, 0x10000000000000001111000000001111) = 0x0ED340A2C9830609B30FD340C1B0FF8E +declast(0xF000000000000000FFFF00000000FFFF, 0x10000000000000001111000000001111) = 0x427D52521752525243437D527D52436C +enc (0xF000000000000000FFFF00000000FFFF, 0x20000000000000002222000000002222) = 0x43FC168989FC161641416363393CDB44 +enclast(0xF000000000000000FFFF00000000FFFF, 0x20000000000000002222000000002222) = 0x4316166316636363414163638C634134 +dec (0xF000000000000000FFFF00000000FFFF, 0x20000000000000002222000000002222) = 0x3ED340A2C9830609803CD340C1B0CCBD +declast(0xF000000000000000FFFF00000000FFFF, 0x20000000000000002222000000002222) = 0x727D52521752525270707D527D52705F +enc (0xF000000000000000FFFF00000000FFFF, 0x30000000000000003333000000003333) = 0x53FC168989FC161650506363393CCA55 +enclast(0xF000000000000000FFFF00000000FFFF, 0x30000000000000003333000000003333) = 0x5316166316636363505063638C635025 +dec (0xF000000000000000FFFF00000000FFFF, 0x30000000000000003333000000003333) = 0x2ED340A2C9830609912DD340C1B0DDAC +declast(0xF000000000000000FFFF00000000FFFF, 0x30000000000000003333000000003333) = 0x627D52521752525261617D527D52614E +enc (0xF000000000000000FFFF00000000FFFF, 0x40000000000000004444000000004444) = 0x23FC168989FC161627276363393CBD22 +enclast(0xF000000000000000FFFF00000000FFFF, 0x40000000000000004444000000004444) = 0x2316166316636363272763638C632752 +dec (0xF000000000000000FFFF00000000FFFF, 0x40000000000000004444000000004444) = 0x5ED340A2C9830609E65AD340C1B0AADB +declast(0xF000000000000000FFFF00000000FFFF, 0x40000000000000004444000000004444) = 0x127D52521752525216167D527D521639 +enc (0xF000000000000000FFFF00000000FFFF, 0x50000000000000005555000000005555) = 0x33FC168989FC161636366363393CAC33 +enclast(0xF000000000000000FFFF00000000FFFF, 0x50000000000000005555000000005555) = 0x3316166316636363363663638C633643 +dec (0xF000000000000000FFFF00000000FFFF, 0x50000000000000005555000000005555) = 0x4ED340A2C9830609F74BD340C1B0BBCA +declast(0xF000000000000000FFFF00000000FFFF, 0x50000000000000005555000000005555) = 0x027D52521752525207077D527D520728 +enc (0xF000000000000000FFFF00000000FFFF, 0x60000000000000006666000000006666) = 0x03FC168989FC161605056363393C9F00 +enclast(0xF000000000000000FFFF00000000FFFF, 0x60000000000000006666000000006666) = 0x0316166316636363050563638C630570 +dec (0xF000000000000000FFFF00000000FFFF, 0x60000000000000006666000000006666) = 0x7ED340A2C9830609C478D340C1B088F9 +declast(0xF000000000000000FFFF00000000FFFF, 0x60000000000000006666000000006666) = 0x327D52521752525234347D527D52341B +enc (0xF000000000000000FFFF00000000FFFF, 0x70000000000000007777000000007777) = 0x13FC168989FC161614146363393C8E11 +enclast(0xF000000000000000FFFF00000000FFFF, 0x70000000000000007777000000007777) = 0x1316166316636363141463638C631461 +dec (0xF000000000000000FFFF00000000FFFF, 0x70000000000000007777000000007777) = 0x6ED340A2C9830609D569D340C1B099E8 +declast(0xF000000000000000FFFF00000000FFFF, 0x70000000000000007777000000007777) = 0x227D52521752525225257D527D52250A +enc (0xF000000000000000FFFF00000000FFFF, 0x80000000000000008888000000008888) = 0xE3FC168989FC1616EBEB6363393C71EE +enclast(0xF000000000000000FFFF00000000FFFF, 0x80000000000000008888000000008888) = 0xE316166316636363EBEB63638C63EB9E +dec (0xF000000000000000FFFF00000000FFFF, 0x80000000000000008888000000008888) = 0x9ED340A2C98306092A96D340C1B06617 +declast(0xF000000000000000FFFF00000000FFFF, 0x80000000000000008888000000008888) = 0xD27D525217525252DADA7D527D52DAF5 +enc (0xF000000000000000FFFF00000000FFFF, 0x90000000000000009999000000009999) = 0xF3FC168989FC1616FAFA6363393C60FF +enclast(0xF000000000000000FFFF00000000FFFF, 0x90000000000000009999000000009999) = 0xF316166316636363FAFA63638C63FA8F +dec (0xF000000000000000FFFF00000000FFFF, 0x90000000000000009999000000009999) = 0x8ED340A2C98306093B87D340C1B07706 +declast(0xF000000000000000FFFF00000000FFFF, 0x90000000000000009999000000009999) = 0xC27D525217525252CBCB7D527D52CBE4 +enc (0xF000000000000000FFFF00000000FFFF, 0xA000000000000000AAAA00000000AAAA) = 0xC3FC168989FC1616C9C96363393C53CC +enclast(0xF000000000000000FFFF00000000FFFF, 0xA000000000000000AAAA00000000AAAA) = 0xC316166316636363C9C963638C63C9BC +dec (0xF000000000000000FFFF00000000FFFF, 0xA000000000000000AAAA00000000AAAA) = 0xBED340A2C983060908B4D340C1B04435 +declast(0xF000000000000000FFFF00000000FFFF, 0xA000000000000000AAAA00000000AAAA) = 0xF27D525217525252F8F87D527D52F8D7 +enc (0xF000000000000000FFFF00000000FFFF, 0xB000000000000000BBBB00000000BBBB) = 0xD3FC168989FC1616D8D86363393C42DD +enclast(0xF000000000000000FFFF00000000FFFF, 0xB000000000000000BBBB00000000BBBB) = 0xD316166316636363D8D863638C63D8AD +dec (0xF000000000000000FFFF00000000FFFF, 0xB000000000000000BBBB00000000BBBB) = 0xAED340A2C983060919A5D340C1B05524 +declast(0xF000000000000000FFFF00000000FFFF, 0xB000000000000000BBBB00000000BBBB) = 0xE27D525217525252E9E97D527D52E9C6 +enc (0xF000000000000000FFFF00000000FFFF, 0xC000000000000000CCCC00000000CCCC) = 0xA3FC168989FC1616AFAF6363393C35AA +enclast(0xF000000000000000FFFF00000000FFFF, 0xC000000000000000CCCC00000000CCCC) = 0xA316166316636363AFAF63638C63AFDA +dec (0xF000000000000000FFFF00000000FFFF, 0xC000000000000000CCCC00000000CCCC) = 0xDED340A2C98306096ED2D340C1B02253 +declast(0xF000000000000000FFFF00000000FFFF, 0xC000000000000000CCCC00000000CCCC) = 0x927D5252175252529E9E7D527D529EB1 +enc (0xF000000000000000FFFF00000000FFFF, 0xD000000000000000DDDD00000000DDDD) = 0xB3FC168989FC1616BEBE6363393C24BB +enclast(0xF000000000000000FFFF00000000FFFF, 0xD000000000000000DDDD00000000DDDD) = 0xB316166316636363BEBE63638C63BECB +dec (0xF000000000000000FFFF00000000FFFF, 0xD000000000000000DDDD00000000DDDD) = 0xCED340A2C98306097FC3D340C1B03342 +declast(0xF000000000000000FFFF00000000FFFF, 0xD000000000000000DDDD00000000DDDD) = 0x827D5252175252528F8F7D527D528FA0 +enc (0xF000000000000000FFFF00000000FFFF, 0xE000000000000000EEEE00000000EEEE) = 0x83FC168989FC16168D8D6363393C1788 +enclast(0xF000000000000000FFFF00000000FFFF, 0xE000000000000000EEEE00000000EEEE) = 0x83161663166363638D8D63638C638DF8 +dec (0xF000000000000000FFFF00000000FFFF, 0xE000000000000000EEEE00000000EEEE) = 0xFED340A2C98306094CF0D340C1B00071 +declast(0xF000000000000000FFFF00000000FFFF, 0xE000000000000000EEEE00000000EEEE) = 0xB27D525217525252BCBC7D527D52BC93 +enc (0xF000000000000000FFFF00000000FFFF, 0xF000000000000000FFFF00000000FFFF) = 0x93FC168989FC16169C9C6363393C0699 +enclast(0xF000000000000000FFFF00000000FFFF, 0xF000000000000000FFFF00000000FFFF) = 0x93161663166363639C9C63638C639CE9 +dec (0xF000000000000000FFFF00000000FFFF, 0xF000000000000000FFFF00000000FFFF) = 0xEED340A2C98306095DE1D340C1B01160 +declast(0xF000000000000000FFFF00000000FFFF, 0xF000000000000000FFFF00000000FFFF) = 0xA27D525217525252ADAD7D527D52AD82 +keygenassist(0xF000000000000000FFFF00000000FFFF, 0x00) = 0x638C63638C6363636316166316166363 +keygenassist(0xF000000000000000FFFF00000000FFFF, 0x01) = 0x638C63628C6363636316166216166363 +keygenassist(0xF000000000000000FFFF00000000FFFF, 0x02) = 0x638C63618C6363636316166116166363 +keygenassist(0xF000000000000000FFFF00000000FFFF, 0x04) = 0x638C63678C6363636316166716166363 +keygenassist(0xF000000000000000FFFF00000000FFFF, 0x08) = 0x638C636B8C6363636316166B16166363 +keygenassist(0xF000000000000000FFFF00000000FFFF, 0x10) = 0x638C63738C6363636316167316166363 +keygenassist(0xF000000000000000FFFF00000000FFFF, 0x38) = 0x638C635B8C6363636316165B16166363 +keygenassist(0xF000000000000000FFFF00000000FFFF, 0x4F) = 0x638C632C8C6363636316162C16166363 +keygenassist(0xF000000000000000FFFF00000000FFFF, 0xFF) = 0x638C639C8C6363636316169C16166363 +imc (0xF000000000000000FFFF00000000FFFF) = 0xD7CADC3100000000CB2E34D134D1CB2E +pclmul(0xF000000000000000FFFF00000000FFFF, 0x00) = 0x210DD32CFFD30DDEF20DFFD32CD32121 +pclmul(0xF000000000000000FFFF00000000FFFF, 0x01) = 0x217BFFA55AFF847BDE845AFFA5002121 +pclmul(0xF000000000000000FFFF00000000FFFF, 0x10) = 0x231D2D031D2D03331000000000000000 +pclmul(0xF000000000000000FFFF00000000FFFF, 0xFF) = 0x236C63336C6333331000000000000000 diff --git a/tests32/ref23.txt b/tests32/ref23.txt new file mode 100644 index 0000000..630c823 --- /dev/null +++ b/tests32/ref23.txt @@ -0,0 +1,5 @@ +ret = 0x78563412 +ret = 0x3412 +ret = 0x78563412 +ret = 0x3412 +ret = 0x12345678 diff --git a/tests32/ref24.txt b/tests32/ref24.txt new file mode 100644 index 0000000..df60c72 --- /dev/null +++ b/tests32/ref24.txt @@ -0,0 +1,640 @@ +Testing rint(1.000000) +FE_UPWARD: 1.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing rint(1.300000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing rint(1.500000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing rint(1.800000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing rint(2.000000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing rint(2.300000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing rint(2.500000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing rint(2.800000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 3.0 +Current rounding mode: 0x0 + +Testing rintf(1.000000) +FE_UPWARD: 1.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing rintf(1.300000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing rintf(1.500000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing rintf(1.800000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing rintf(2.000000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing rintf(2.300000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing rintf(2.500000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing rintf(2.800000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 3.0 +Current rounding mode: 0x0 + +Testing nearbyint(1.000000) +FE_UPWARD: 1.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing nearbyint(1.300000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing nearbyint(1.500000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing nearbyint(1.800000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing nearbyint(2.000000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing nearbyint(2.300000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing nearbyint(2.500000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing nearbyint(2.800000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 3.0 +Current rounding mode: 0x0 + +Testing nearbyintf(1.000000) +FE_UPWARD: 1.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing nearbyintf(1.300000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing nearbyintf(1.500000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing nearbyintf(1.800000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing nearbyintf(2.000000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing nearbyintf(2.300000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing nearbyintf(2.500000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing nearbyintf(2.800000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 3.0 +Current rounding mode: 0x0 + +Testing llrintf(1.000000) +FE_UPWARD: 1.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing llrintf(1.300000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing llrintf(1.500000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing llrintf(1.800000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing llrintf(2.000000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing llrintf(2.300000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing llrintf(2.500000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing llrintf(2.800000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 3.0 +Current rounding mode: 0x0 + +Testing llrint(1.000000) +FE_UPWARD: 1.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing llrint(1.300000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing llrint(1.500000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing llrint(1.800000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing llrint(2.000000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing llrint(2.300000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing llrint(2.500000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing llrint(2.800000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 3.0 +Current rounding mode: 0x0 + +Testing lrintf(1.000000) +FE_UPWARD: 1.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing lrintf(1.300000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing lrintf(1.500000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing lrintf(1.800000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing lrintf(2.000000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing lrintf(2.300000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing lrintf(2.500000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing lrintf(2.800000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 3.0 +Current rounding mode: 0x0 + +Testing lrint(1.000000) +FE_UPWARD: 1.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing lrint(1.300000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 1.0 +Current rounding mode: 0x0 + +Testing lrint(1.500000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing lrint(1.800000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 1.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 1.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing lrint(2.000000) +FE_UPWARD: 2.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing lrint(2.300000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing lrint(2.500000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 2.0 +Current rounding mode: 0x0 + +Testing lrint(2.800000) +FE_UPWARD: 3.0 +Current rounding mode: 0x800 +FE_DOWNWARD: 2.0 +Current rounding mode: 0x400 +FE_TOWARDZERO: 2.0 +Current rounding mode: 0xc00 +FE_TONEAREST: 3.0 +Current rounding mode: 0x0 + diff --git a/tests32/ref25.txt b/tests32/ref25.txt new file mode 100644 index 0000000..6a84602 --- /dev/null +++ b/tests32/ref25.txt @@ -0,0 +1,1062 @@ +test SSE 4.2 +_mm_cmpestri("This is a string", 16, "This", 4, 0x0) => 0 +_mm_cmpestri("This is a string", 16, "This", 4, 0x0) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", 16, "This", 4, 0x0) = 0000000000000000-000000000000000f +_mm_cmpistri("This is a string", "This", 0x0) => 0 +_mm_cmpestri("This is a string", "This", 0x0) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", "This", 0x0) = 0000000000000000-000000000000000f +_mm_cmpestri("This is a string", 16, "This", 4, 0x1) => 0 +_mm_cmpestri("This is a string", 16, "This", 4, 0x1) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", 16, "This", 4, 0x1) = 0000000000000000-000000000000000f +_mm_cmpistri("This is a string", "This", 0x1) => 0 +_mm_cmpestri("This is a string", "This", 0x1) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", "This", 0x1) = 0000000000000000-000000000000000f +_mm_cmpestri("This", 4, "This is a string", 16, 0x0) => 0 +_mm_cmpestri("This", 4, "This is a string", 16, 0x0) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", 4, "This is a string", 16, 0x0) = 0000000000000000-000000000000246f +_mm_cmpistri("This", "This is a string", 0x0) => 0 +_mm_cmpestri("This", "This is a string", 0x0) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", "This is a string", 0x0) = 0000000000000000-000000000000246f +_mm_cmpestri("This", 4, "This is a string", 16, 0x1) => 0 +_mm_cmpestri("This", 4, "This is a string", 16, 0x1) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", 4, "This is a string", 16, 0x1) = 0000000000000000-000000000000006f +_mm_cmpistri("This", "This is a string", 0x1) => 0 +_mm_cmpestri("This", "This is a string", 0x1) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", "This is a string", 0x1) = 0000000000000000-000000000000006f +_mm_cmpestri("This is a string", 16, "is", 2, 0x0) => 0 +_mm_cmpestri("This is a string", 16, "is", 2, 0x0) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", 16, "is", 2, 0x0) = 0000000000000000-0000000000000003 +_mm_cmpistri("This is a string", "is", 0x0) => 0 +_mm_cmpestri("This is a string", "is", 0x0) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", "is", 0x0) = 0000000000000000-0000000000000003 +_mm_cmpestri("This is a string", 16, "is", 2, 0x1) => 0 +_mm_cmpestri("This is a string", 16, "is", 2, 0x1) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", 16, "is", 2, 0x1) = 0000000000000000-0000000000000003 +_mm_cmpistri("This is a string", "is", 0x1) => 0 +_mm_cmpestri("This is a string", "is", 0x1) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", "is", 0x1) = 0000000000000000-0000000000000003 +_mm_cmpestri("is", 2, "This is a string", 16, 0x0) => 2 +_mm_cmpestri("is", 2, "This is a string", 16, 0x0) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", 2, "This is a string", 16, 0x0) = 0000000000000000-000000000000246c +_mm_cmpistri("is", "This is a string", 0x0) => 2 +_mm_cmpestri("is", "This is a string", 0x0) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", "This is a string", 0x0) = 0000000000000000-000000000000246c +_mm_cmpestri("is", 2, "This is a string", 16, 0x1) => 2 +_mm_cmpestri("is", 2, "This is a string", 16, 0x1) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", 2, "This is a string", 16, 0x1) = 0000000000000000-000000000000006c +_mm_cmpistri("is", "This is a string", 0x1) => 2 +_mm_cmpestri("is", "This is a string", 0x1) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", "This is a string", 0x1) = 0000000000000000-000000000000006c +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x0) => 1 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x0) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x0) = 0000000000000000-000000000000c03a +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x0) => 1 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x0) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x0) = 0000000000000000-000000000000c03a +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x1) => 3 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x1) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x1) = 0000000000000000-0000000000000008 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x1) => 3 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x1) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x1) = 0000000000000000-0000000000000008 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x0) => 3 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x0) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x0) = 0000000000000000-0000000000001d48 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x0) => 3 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x0) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x0) = 0000000000000000-0000000000001d48 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x1) => 3 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x1) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x1) = 0000000000000000-0000000000000048 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x1) => 3 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x1) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x1) = 0000000000000000-0000000000000048 +_mm_cmpestri("This is a string", 16, "", 0, 0x0) => 16 +_mm_cmpestri("This is a string", 16, "", 0, 0x0) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x0) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x0) => 16 +_mm_cmpestri("This is a string", "", 0x0) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x0) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0x1) => 8 +_mm_cmpestri("This is a string", 16, "", 0, 0x1) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x1) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x1) => 8 +_mm_cmpestri("This is a string", "", 0x1) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x1) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0x0) => 16 +_mm_cmpestri("", 0, "This is a string", 16, 0x0) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("", 0, "This is a string", 16, 0x0) = 0000000000000000-0000000000000000 +_mm_cmpistri("", "This is a string", 0x0) => 16 +_mm_cmpestri("", "This is a string", 0x0) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("", "This is a string", 0x0) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0x1) => 8 +_mm_cmpestri("", 0, "This is a string", 16, 0x1) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("", 0, "This is a string", 16, 0x1) = 0000000000000000-0000000000000000 +_mm_cmpistri("", "This is a string", 0x1) => 8 +_mm_cmpestri("", "This is a string", 0x1) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("", "This is a string", 0x1) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "This", 4, 0x4) => 0 +_mm_cmpestri("This is a string", 16, "This", 4, 0x4) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", 16, "This", 4, 0x4) = 0000000000000000-000000000000000f +_mm_cmpistri("This is a string", "This", 0x4) => 0 +_mm_cmpestri("This is a string", "This", 0x4) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", "This", 0x4) = 0000000000000000-000000000000000f +_mm_cmpestri("This is a string", 16, "This", 4, 0x5) => 0 +_mm_cmpestri("This is a string", 16, "This", 4, 0x5) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", 16, "This", 4, 0x5) = 0000000000000000-000000000000000f +_mm_cmpistri("This is a string", "This", 0x5) => 0 +_mm_cmpestri("This is a string", "This", 0x5) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", "This", 0x5) = 0000000000000000-000000000000000f +_mm_cmpestri("This", 4, "This is a string", 16, 0x4) => 0 +_mm_cmpestri("This", 4, "This is a string", 16, 0x4) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", 4, "This is a string", 16, 0x4) = 0000000000000000-000000000000f56f +_mm_cmpistri("This", "This is a string", 0x4) => 0 +_mm_cmpestri("This", "This is a string", 0x4) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", "This is a string", 0x4) = 0000000000000000-000000000000f56f +_mm_cmpestri("This", 4, "This is a string", 16, 0x5) => 0 +_mm_cmpestri("This", 4, "This is a string", 16, 0x5) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", 4, "This is a string", 16, 0x5) = 0000000000000000-000000000000006f +_mm_cmpistri("This", "This is a string", 0x5) => 0 +_mm_cmpestri("This", "This is a string", 0x5) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", "This is a string", 0x5) = 0000000000000000-000000000000006f +_mm_cmpestri("This is a string", 16, "is", 2, 0x4) => 0 +_mm_cmpestri("This is a string", 16, "is", 2, 0x4) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", 16, "is", 2, 0x4) = 0000000000000000-0000000000000003 +_mm_cmpistri("This is a string", "is", 0x4) => 0 +_mm_cmpestri("This is a string", "is", 0x4) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", "is", 0x4) = 0000000000000000-0000000000000003 +_mm_cmpestri("This is a string", 16, "is", 2, 0x5) => 0 +_mm_cmpestri("This is a string", 16, "is", 2, 0x5) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", 16, "is", 2, 0x5) = 0000000000000000-0000000000000003 +_mm_cmpistri("This is a string", "is", 0x5) => 0 +_mm_cmpestri("This is a string", "is", 0x5) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", "is", 0x5) = 0000000000000000-0000000000000003 +_mm_cmpestri("is", 2, "This is a string", 16, 0x4) => 2 +_mm_cmpestri("is", 2, "This is a string", 16, 0x4) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", 2, "This is a string", 16, 0x4) = 0000000000000000-000000000000746c +_mm_cmpistri("is", "This is a string", 0x4) => 2 +_mm_cmpestri("is", "This is a string", 0x4) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", "This is a string", 0x4) = 0000000000000000-000000000000746c +_mm_cmpestri("is", 2, "This is a string", 16, 0x5) => 2 +_mm_cmpestri("is", 2, "This is a string", 16, 0x5) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", 2, "This is a string", 16, 0x5) = 0000000000000000-000000000000006c +_mm_cmpistri("is", "This is a string", 0x5) => 2 +_mm_cmpestri("is", "This is a string", 0x5) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", "This is a string", 0x5) = 0000000000000000-000000000000006c +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x4) => 0 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x4) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x4) = 0000000000000000-000000000000ffbf +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x4) => 0 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x4) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x4) = 0000000000000000-000000000000ffbf +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x5) => 0 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x5) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x5) = 0000000000000000-00000000000000af +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x5) => 0 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x5) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x5) = 0000000000000000-00000000000000af +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x4) => 0 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x4) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x4) = 0000000000000000-000000000000f56f +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x4) => 0 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x4) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x4) = 0000000000000000-000000000000f56f +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x5) => 1 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x5) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x5) = 0000000000000000-000000000000006e +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x5) => 1 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x5) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x5) = 0000000000000000-000000000000006e +_mm_cmpestri("This is a string", 16, "", 0, 0x4) => 16 +_mm_cmpestri("This is a string", 16, "", 0, 0x4) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x4) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x4) => 16 +_mm_cmpestri("This is a string", "", 0x4) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x4) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0x5) => 8 +_mm_cmpestri("This is a string", 16, "", 0, 0x5) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x5) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x5) => 8 +_mm_cmpestri("This is a string", "", 0x5) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x5) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0x4) => 16 +_mm_cmpestri("", 0, "This is a string", 16, 0x4) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("", 0, "This is a string", 16, 0x4) = 0000000000000000-0000000000000000 +_mm_cmpistri("", "This is a string", 0x4) => 16 +_mm_cmpestri("", "This is a string", 0x4) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("", "This is a string", 0x4) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0x5) => 8 +_mm_cmpestri("", 0, "This is a string", 16, 0x5) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("", 0, "This is a string", 16, 0x5) = 0000000000000000-0000000000000000 +_mm_cmpistri("", "This is a string", 0x5) => 8 +_mm_cmpestri("", "This is a string", 0x5) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("", "This is a string", 0x5) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "This", 4, 0x8) => 0 +_mm_cmpestri("This is a string", 16, "This", 4, 0x8) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", 16, "This", 4, 0x8) = 0000000000000000-000000000000000f +_mm_cmpistri("This is a string", "This", 0x8) => 0 +_mm_cmpestri("This is a string", "This", 0x8) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", "This", 0x8) = 0000000000000000-000000000000000f +_mm_cmpestri("This is a string", 16, "This", 4, 0x9) => 0 +_mm_cmpestri("This is a string", 16, "This", 4, 0x9) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", 16, "This", 4, 0x9) = 0000000000000000-000000000000000f +_mm_cmpistri("This is a string", "This", 0x9) => 0 +_mm_cmpestri("This is a string", "This", 0x9) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", "This", 0x9) = 0000000000000000-000000000000000f +_mm_cmpestri("This", 4, "This is a string", 16, 0x8) => 0 +_mm_cmpestri("This", 4, "This is a string", 16, 0x8) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", 4, "This is a string", 16, 0x8) = 0000000000000000-000000000000000f +_mm_cmpistri("This", "This is a string", 0x8) => 0 +_mm_cmpestri("This", "This is a string", 0x8) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", "This is a string", 0x8) = 0000000000000000-000000000000000f +_mm_cmpestri("This", 4, "This is a string", 16, 0x9) => 0 +_mm_cmpestri("This", 4, "This is a string", 16, 0x9) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", 4, "This is a string", 16, 0x9) = 0000000000000000-000000000000000f +_mm_cmpistri("This", "This is a string", 0x9) => 0 +_mm_cmpestri("This", "This is a string", 0x9) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", "This is a string", 0x9) = 0000000000000000-000000000000000f +_mm_cmpestri("This is a string", 16, "is", 2, 0x8) => 16 +_mm_cmpestri("This is a string", 16, "is", 2, 0x8) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x8) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x8) => 16 +_mm_cmpestri("This is a string", "is", 0x8) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x8) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "is", 2, 0x9) => 8 +_mm_cmpestri("This is a string", 16, "is", 2, 0x9) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x9) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x9) => 8 +_mm_cmpestri("This is a string", "is", 0x9) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x9) = 0000000000000000-0000000000000000 +_mm_cmpestri("is", 2, "This is a string", 16, 0x8) => 16 +_mm_cmpestri("is", 2, "This is a string", 16, 0x8) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("is", 2, "This is a string", 16, 0x8) = 0000000000000000-0000000000000000 +_mm_cmpistri("is", "This is a string", 0x8) => 16 +_mm_cmpestri("is", "This is a string", 0x8) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("is", "This is a string", 0x8) = 0000000000000000-0000000000000000 +_mm_cmpestri("is", 2, "This is a string", 16, 0x9) => 8 +_mm_cmpestri("is", 2, "This is a string", 16, 0x9) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("is", 2, "This is a string", 16, 0x9) = 0000000000000000-0000000000000000 +_mm_cmpistri("is", "This is a string", 0x9) => 8 +_mm_cmpestri("is", "This is a string", 0x9) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("is", "This is a string", 0x9) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x8) => 3 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x8) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x8) = 0000000000000000-0000000000000008 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x8) => 3 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x8) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x8) = 0000000000000000-0000000000000008 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x9) => 3 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x9) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x9) = 0000000000000000-0000000000000008 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x9) => 3 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x9) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x9) = 0000000000000000-0000000000000008 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x8) => 3 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x8) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x8) = 0000000000000000-0000000000000008 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x8) => 3 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x8) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x8) = 0000000000000000-0000000000000008 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x9) => 3 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x9) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x9) = 0000000000000000-0000000000000008 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x9) => 3 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x9) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x9) = 0000000000000000-0000000000000008 +_mm_cmpestri("This is a string", 16, "", 0, 0x8) => 16 +_mm_cmpestri("This is a string", 16, "", 0, 0x8) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x8) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x8) => 16 +_mm_cmpestri("This is a string", "", 0x8) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x8) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0x9) => 8 +_mm_cmpestri("This is a string", 16, "", 0, 0x9) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x9) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x9) => 8 +_mm_cmpestri("This is a string", "", 0x9) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x9) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0x8) => 16 +_mm_cmpestri("", 0, "This is a string", 16, 0x8) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("", 0, "This is a string", 16, 0x8) = 0000000000000000-0000000000000000 +_mm_cmpistri("", "This is a string", 0x8) => 16 +_mm_cmpestri("", "This is a string", 0x8) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("", "This is a string", 0x8) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0x9) => 8 +_mm_cmpestri("", 0, "This is a string", 16, 0x9) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("", 0, "This is a string", 16, 0x9) = 0000000000000000-0000000000000000 +_mm_cmpistri("", "This is a string", 0x9) => 8 +_mm_cmpestri("", "This is a string", 0x9) flags: a:1 s:1 z:0 c:0 o:0 +mm_cmpestrm("", "This is a string", 0x9) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "This", 4, 0xc) => 16 +_mm_cmpestri("This is a string", 16, "This", 4, 0xc) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0xc) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0xc) => 16 +_mm_cmpestri("This is a string", "This", 0xc) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0xc) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "This", 4, 0xd) => 8 +_mm_cmpestri("This is a string", 16, "This", 4, 0xd) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0xd) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0xd) => 8 +_mm_cmpestri("This is a string", "This", 0xd) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0xd) = 0000000000000000-0000000000000000 +_mm_cmpestri("This", 4, "This is a string", 16, 0xc) => 0 +_mm_cmpestri("This", 4, "This is a string", 16, 0xc) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", 4, "This is a string", 16, 0xc) = 0000000000000000-0000000000000001 +_mm_cmpistri("This", "This is a string", 0xc) => 0 +_mm_cmpestri("This", "This is a string", 0xc) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", "This is a string", 0xc) = 0000000000000000-0000000000000001 +_mm_cmpestri("This", 4, "This is a string", 16, 0xd) => 0 +_mm_cmpestri("This", 4, "This is a string", 16, 0xd) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", 4, "This is a string", 16, 0xd) = 0000000000000000-0000000000000001 +_mm_cmpistri("This", "This is a string", 0xd) => 0 +_mm_cmpestri("This", "This is a string", 0xd) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", "This is a string", 0xd) = 0000000000000000-0000000000000001 +_mm_cmpestri("This is a string", 16, "is", 2, 0xc) => 16 +_mm_cmpestri("This is a string", 16, "is", 2, 0xc) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0xc) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0xc) => 16 +_mm_cmpestri("This is a string", "is", 0xc) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0xc) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "is", 2, 0xd) => 8 +_mm_cmpestri("This is a string", 16, "is", 2, 0xd) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0xd) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0xd) => 8 +_mm_cmpestri("This is a string", "is", 0xd) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0xd) = 0000000000000000-0000000000000000 +_mm_cmpestri("is", 2, "This is a string", 16, 0xc) => 2 +_mm_cmpestri("is", 2, "This is a string", 16, 0xc) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", 2, "This is a string", 16, 0xc) = 0000000000000000-0000000000000024 +_mm_cmpistri("is", "This is a string", 0xc) => 2 +_mm_cmpestri("is", "This is a string", 0xc) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", "This is a string", 0xc) = 0000000000000000-0000000000000024 +_mm_cmpestri("is", 2, "This is a string", 16, 0xd) => 2 +_mm_cmpestri("is", 2, "This is a string", 16, 0xd) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", 2, "This is a string", 16, 0xd) = 0000000000000000-0000000000000024 +_mm_cmpistri("is", "This is a string", 0xd) => 2 +_mm_cmpestri("is", "This is a string", 0xd) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", "This is a string", 0xd) = 0000000000000000-0000000000000024 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0xc) => 16 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0xc) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0xc) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0xc) => 16 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0xc) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0xc) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0xd) => 8 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0xd) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0xd) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0xd) => 8 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0xd) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0xd) = 0000000000000000-0000000000000000 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0xc) => 16 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0xc) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0xc) = 0000000000000000-0000000000000000 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0xc) => 16 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0xc) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0xc) = 0000000000000000-0000000000000000 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0xd) => 8 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0xd) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0xd) = 0000000000000000-0000000000000000 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0xd) => 8 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0xd) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0xd) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0xc) => 16 +_mm_cmpestri("This is a string", 16, "", 0, 0xc) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0xc) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0xc) => 16 +_mm_cmpestri("This is a string", "", 0xc) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0xc) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0xd) => 8 +_mm_cmpestri("This is a string", 16, "", 0, 0xd) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0xd) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0xd) => 8 +_mm_cmpestri("This is a string", "", 0xd) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0xd) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0xc) => 0 +_mm_cmpestri("", 0, "This is a string", 16, 0xc) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0xc) = 0000000000000000-000000000000ffff +_mm_cmpistri("", "This is a string", 0xc) => 0 +_mm_cmpestri("", "This is a string", 0xc) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0xc) = 0000000000000000-000000000000ffff +_mm_cmpestri("", 0, "This is a string", 16, 0xd) => 0 +_mm_cmpestri("", 0, "This is a string", 16, 0xd) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0xd) = 0000000000000000-00000000000000ff +_mm_cmpistri("", "This is a string", 0xd) => 0 +_mm_cmpestri("", "This is a string", 0xd) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0xd) = 0000000000000000-00000000000000ff +_mm_cmpestri("This is a string", 16, "This", 4, 0x10) => 4 +_mm_cmpestri("This is a string", 16, "This", 4, 0x10) flags: a:0 s:0 z:1 c:1 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x10) = 0000000000000000-000000000000fff0 +_mm_cmpistri("This is a string", "This", 0x10) => 4 +_mm_cmpestri("This is a string", "This", 0x10) flags: a:0 s:0 z:1 c:1 o:0 +mm_cmpestrm("This is a string", "This", 0x10) = 0000000000000000-000000000000fff0 +_mm_cmpestri("This is a string", 16, "This", 4, 0x11) => 4 +_mm_cmpestri("This is a string", 16, "This", 4, 0x11) flags: a:0 s:0 z:1 c:1 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x11) = 0000000000000000-00000000000000f0 +_mm_cmpistri("This is a string", "This", 0x11) => 4 +_mm_cmpestri("This is a string", "This", 0x11) flags: a:0 s:0 z:1 c:1 o:0 +mm_cmpestrm("This is a string", "This", 0x11) = 0000000000000000-00000000000000f0 +_mm_cmpestri("This", 4, "This is a string", 16, 0x10) => 4 +_mm_cmpestri("This", 4, "This is a string", 16, 0x10) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", 4, "This is a string", 16, 0x10) = 0000000000000000-000000000000db90 +_mm_cmpistri("This", "This is a string", 0x10) => 4 +_mm_cmpestri("This", "This is a string", 0x10) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", "This is a string", 0x10) = 0000000000000000-000000000000db90 +_mm_cmpestri("This", 4, "This is a string", 16, 0x11) => 4 +_mm_cmpestri("This", 4, "This is a string", 16, 0x11) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", 4, "This is a string", 16, 0x11) = 0000000000000000-0000000000000090 +_mm_cmpistri("This", "This is a string", 0x11) => 4 +_mm_cmpestri("This", "This is a string", 0x11) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", "This is a string", 0x11) = 0000000000000000-0000000000000090 +_mm_cmpestri("This is a string", 16, "is", 2, 0x10) => 2 +_mm_cmpestri("This is a string", 16, "is", 2, 0x10) flags: a:0 s:0 z:1 c:1 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x10) = 0000000000000000-000000000000fffc +_mm_cmpistri("This is a string", "is", 0x10) => 2 +_mm_cmpestri("This is a string", "is", 0x10) flags: a:0 s:0 z:1 c:1 o:0 +mm_cmpestrm("This is a string", "is", 0x10) = 0000000000000000-000000000000fffc +_mm_cmpestri("This is a string", 16, "is", 2, 0x11) => 2 +_mm_cmpestri("This is a string", 16, "is", 2, 0x11) flags: a:0 s:0 z:1 c:1 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x11) = 0000000000000000-00000000000000fc +_mm_cmpistri("This is a string", "is", 0x11) => 2 +_mm_cmpestri("This is a string", "is", 0x11) flags: a:0 s:0 z:1 c:1 o:0 +mm_cmpestrm("This is a string", "is", 0x11) = 0000000000000000-00000000000000fc +_mm_cmpestri("is", 2, "This is a string", 16, 0x10) => 0 +_mm_cmpestri("is", 2, "This is a string", 16, 0x10) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", 2, "This is a string", 16, 0x10) = 0000000000000000-000000000000db93 +_mm_cmpistri("is", "This is a string", 0x10) => 0 +_mm_cmpestri("is", "This is a string", 0x10) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", "This is a string", 0x10) = 0000000000000000-000000000000db93 +_mm_cmpestri("is", 2, "This is a string", 16, 0x11) => 0 +_mm_cmpestri("is", 2, "This is a string", 16, 0x11) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", 2, "This is a string", 16, 0x11) = 0000000000000000-0000000000000093 +_mm_cmpistri("is", "This is a string", 0x11) => 0 +_mm_cmpestri("is", "This is a string", 0x11) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", "This is a string", 0x11) = 0000000000000000-0000000000000093 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x10) => 0 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x10) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x10) = 0000000000000000-0000000000003fc5 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x10) => 0 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x10) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x10) = 0000000000000000-0000000000003fc5 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x11) => 0 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x11) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x11) = 0000000000000000-00000000000000f7 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x11) => 0 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x11) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x11) = 0000000000000000-00000000000000f7 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x10) => 0 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x10) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x10) = 0000000000000000-000000000000e2b7 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x10) => 0 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x10) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x10) = 0000000000000000-000000000000e2b7 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x11) => 0 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x11) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x11) = 0000000000000000-00000000000000b7 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x11) => 0 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x11) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x11) = 0000000000000000-00000000000000b7 +_mm_cmpestri("This is a string", 16, "", 0, 0x10) => 0 +_mm_cmpestri("This is a string", 16, "", 0, 0x10) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", 16, "", 0, 0x10) = 0000000000000000-000000000000ffff +_mm_cmpistri("This is a string", "", 0x10) => 0 +_mm_cmpestri("This is a string", "", 0x10) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", "", 0x10) = 0000000000000000-000000000000ffff +_mm_cmpestri("This is a string", 16, "", 0, 0x11) => 0 +_mm_cmpestri("This is a string", 16, "", 0, 0x11) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", 16, "", 0, 0x11) = 0000000000000000-00000000000000ff +_mm_cmpistri("This is a string", "", 0x11) => 0 +_mm_cmpestri("This is a string", "", 0x11) flags: a:0 s:0 z:1 c:1 o:1 +mm_cmpestrm("This is a string", "", 0x11) = 0000000000000000-00000000000000ff +_mm_cmpestri("", 0, "This is a string", 16, 0x10) => 0 +_mm_cmpestri("", 0, "This is a string", 16, 0x10) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x10) = 0000000000000000-000000000000ffff +_mm_cmpistri("", "This is a string", 0x10) => 0 +_mm_cmpestri("", "This is a string", 0x10) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x10) = 0000000000000000-000000000000ffff +_mm_cmpestri("", 0, "This is a string", 16, 0x11) => 0 +_mm_cmpestri("", 0, "This is a string", 16, 0x11) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x11) = 0000000000000000-00000000000000ff +_mm_cmpistri("", "This is a string", 0x11) => 0 +_mm_cmpestri("", "This is a string", 0x11) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x11) = 0000000000000000-00000000000000ff +_mm_cmpestri("This is a string", 16, "This", 4, 0x30) => 16 +_mm_cmpestri("This is a string", 16, "This", 4, 0x30) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x30) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0x30) => 16 +_mm_cmpestri("This is a string", "This", 0x30) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0x30) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "This", 4, 0x31) => 8 +_mm_cmpestri("This is a string", 16, "This", 4, 0x31) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x31) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0x31) => 8 +_mm_cmpestri("This is a string", "This", 0x31) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0x31) = 0000000000000000-0000000000000000 +_mm_cmpestri("This", 4, "This is a string", 16, 0x30) => 4 +_mm_cmpestri("This", 4, "This is a string", 16, 0x30) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", 4, "This is a string", 16, 0x30) = 0000000000000000-000000000000db90 +_mm_cmpistri("This", "This is a string", 0x30) => 4 +_mm_cmpestri("This", "This is a string", 0x30) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", "This is a string", 0x30) = 0000000000000000-000000000000db90 +_mm_cmpestri("This", 4, "This is a string", 16, 0x31) => 4 +_mm_cmpestri("This", 4, "This is a string", 16, 0x31) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", 4, "This is a string", 16, 0x31) = 0000000000000000-0000000000000090 +_mm_cmpistri("This", "This is a string", 0x31) => 4 +_mm_cmpestri("This", "This is a string", 0x31) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", "This is a string", 0x31) = 0000000000000000-0000000000000090 +_mm_cmpestri("This is a string", 16, "is", 2, 0x30) => 16 +_mm_cmpestri("This is a string", 16, "is", 2, 0x30) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x30) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x30) => 16 +_mm_cmpestri("This is a string", "is", 0x30) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x30) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "is", 2, 0x31) => 8 +_mm_cmpestri("This is a string", 16, "is", 2, 0x31) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x31) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x31) => 8 +_mm_cmpestri("This is a string", "is", 0x31) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x31) = 0000000000000000-0000000000000000 +_mm_cmpestri("is", 2, "This is a string", 16, 0x30) => 0 +_mm_cmpestri("is", 2, "This is a string", 16, 0x30) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", 2, "This is a string", 16, 0x30) = 0000000000000000-000000000000db93 +_mm_cmpistri("is", "This is a string", 0x30) => 0 +_mm_cmpestri("is", "This is a string", 0x30) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", "This is a string", 0x30) = 0000000000000000-000000000000db93 +_mm_cmpestri("is", 2, "This is a string", 16, 0x31) => 0 +_mm_cmpestri("is", 2, "This is a string", 16, 0x31) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", 2, "This is a string", 16, 0x31) = 0000000000000000-0000000000000093 +_mm_cmpistri("is", "This is a string", 0x31) => 0 +_mm_cmpestri("is", "This is a string", 0x31) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", "This is a string", 0x31) = 0000000000000000-0000000000000093 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x30) => 0 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x30) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x30) = 0000000000000000-0000000000003fc5 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x30) => 0 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x30) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x30) = 0000000000000000-0000000000003fc5 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x31) => 0 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x31) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x31) = 0000000000000000-00000000000000f7 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x31) => 0 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x31) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x31) = 0000000000000000-00000000000000f7 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x30) => 0 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x30) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x30) = 0000000000000000-000000000000e2b7 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x30) => 0 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x30) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x30) = 0000000000000000-000000000000e2b7 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x31) => 0 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x31) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x31) = 0000000000000000-00000000000000b7 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x31) => 0 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x31) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x31) = 0000000000000000-00000000000000b7 +_mm_cmpestri("This is a string", 16, "", 0, 0x30) => 16 +_mm_cmpestri("This is a string", 16, "", 0, 0x30) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x30) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x30) => 16 +_mm_cmpestri("This is a string", "", 0x30) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x30) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0x31) => 8 +_mm_cmpestri("This is a string", 16, "", 0, 0x31) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x31) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x31) => 8 +_mm_cmpestri("This is a string", "", 0x31) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x31) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0x30) => 0 +_mm_cmpestri("", 0, "This is a string", 16, 0x30) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x30) = 0000000000000000-000000000000ffff +_mm_cmpistri("", "This is a string", 0x30) => 0 +_mm_cmpestri("", "This is a string", 0x30) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x30) = 0000000000000000-000000000000ffff +_mm_cmpestri("", 0, "This is a string", 16, 0x31) => 0 +_mm_cmpestri("", 0, "This is a string", 16, 0x31) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x31) = 0000000000000000-00000000000000ff +_mm_cmpistri("", "This is a string", 0x31) => 0 +_mm_cmpestri("", "This is a string", 0x31) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x31) = 0000000000000000-00000000000000ff +_mm_cmpestri("This is a string", 16, "This", 4, 0x4c) => 16 +_mm_cmpestri("This is a string", 16, "This", 4, 0x4c) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x4c) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0x4c) => 16 +_mm_cmpestri("This is a string", "This", 0x4c) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0x4c) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "This", 4, 0x4d) => 8 +_mm_cmpestri("This is a string", 16, "This", 4, 0x4d) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x4d) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0x4d) => 8 +_mm_cmpestri("This is a string", "This", 0x4d) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0x4d) = 0000000000000000-0000000000000000 +_mm_cmpestri("This", 4, "This is a string", 16, 0x4c) => 0 +_mm_cmpestri("This", 4, "This is a string", 16, 0x4c) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", 4, "This is a string", 16, 0x4c) = 0000000000000000-00000000000000ff +_mm_cmpistri("This", "This is a string", 0x4c) => 0 +_mm_cmpestri("This", "This is a string", 0x4c) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", "This is a string", 0x4c) = 0000000000000000-00000000000000ff +_mm_cmpestri("This", 4, "This is a string", 16, 0x4d) => 0 +_mm_cmpestri("This", 4, "This is a string", 16, 0x4d) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", 4, "This is a string", 16, 0x4d) = 0000000000000000-000000000000ffff +_mm_cmpistri("This", "This is a string", 0x4d) => 0 +_mm_cmpestri("This", "This is a string", 0x4d) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", "This is a string", 0x4d) = 0000000000000000-000000000000ffff +_mm_cmpestri("This is a string", 16, "is", 2, 0x4c) => 16 +_mm_cmpestri("This is a string", 16, "is", 2, 0x4c) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x4c) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x4c) => 16 +_mm_cmpestri("This is a string", "is", 0x4c) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x4c) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "is", 2, 0x4d) => 8 +_mm_cmpestri("This is a string", 16, "is", 2, 0x4d) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x4d) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x4d) => 8 +_mm_cmpestri("This is a string", "is", 0x4d) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x4d) = 0000000000000000-0000000000000000 +_mm_cmpestri("is", 2, "This is a string", 16, 0x4c) => 5 +_mm_cmpestri("is", 2, "This is a string", 16, 0x4c) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", 2, "This is a string", 16, 0x4c) = 000000000000ff00-0000000000ff0000 +_mm_cmpistri("is", "This is a string", 0x4c) => 5 +_mm_cmpestri("is", "This is a string", 0x4c) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", "This is a string", 0x4c) = 000000000000ff00-0000000000ff0000 +_mm_cmpestri("is", 2, "This is a string", 16, 0x4d) => 5 +_mm_cmpestri("is", 2, "This is a string", 16, 0x4d) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", 2, "This is a string", 16, 0x4d) = 000000000000ffff-0000000000000000 +_mm_cmpistri("is", "This is a string", 0x4d) => 5 +_mm_cmpestri("is", "This is a string", 0x4d) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", "This is a string", 0x4d) = 000000000000ffff-0000000000000000 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x4c) => 16 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x4c) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x4c) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x4c) => 16 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x4c) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x4c) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x4d) => 8 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x4d) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x4d) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x4d) => 8 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x4d) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x4d) = 0000000000000000-0000000000000000 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x4c) => 16 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x4c) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x4c) = 0000000000000000-0000000000000000 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x4c) => 16 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x4c) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x4c) = 0000000000000000-0000000000000000 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x4d) => 8 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x4d) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x4d) = 0000000000000000-0000000000000000 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x4d) => 8 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x4d) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x4d) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0x4c) => 16 +_mm_cmpestri("This is a string", 16, "", 0, 0x4c) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x4c) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x4c) => 16 +_mm_cmpestri("This is a string", "", 0x4c) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x4c) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0x4d) => 8 +_mm_cmpestri("This is a string", 16, "", 0, 0x4d) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x4d) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x4d) => 8 +_mm_cmpestri("This is a string", "", 0x4d) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x4d) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0x4c) => 15 +_mm_cmpestri("", 0, "This is a string", 16, 0x4c) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x4c) = 00000000ffffffff-00000000ffffffff +_mm_cmpistri("", "This is a string", 0x4c) => 15 +_mm_cmpestri("", "This is a string", 0x4c) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x4c) = 00000000ffffffff-00000000ffffffff +_mm_cmpestri("", 0, "This is a string", 16, 0x4d) => 7 +_mm_cmpestri("", 0, "This is a string", 16, 0x4d) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x4d) = 00000000ffffffff-00000000ffffffff +_mm_cmpistri("", "This is a string", 0x4d) => 7 +_mm_cmpestri("", "This is a string", 0x4d) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x4d) = 00000000ffffffff-00000000ffffffff +_mm_cmpestri("This is a string", 16, "This", 4, 0x2c) => 16 +_mm_cmpestri("This is a string", 16, "This", 4, 0x2c) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x2c) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0x2c) => 16 +_mm_cmpestri("This is a string", "This", 0x2c) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0x2c) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "This", 4, 0x2d) => 8 +_mm_cmpestri("This is a string", 16, "This", 4, 0x2d) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x2d) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0x2d) => 8 +_mm_cmpestri("This is a string", "This", 0x2d) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0x2d) = 0000000000000000-0000000000000000 +_mm_cmpestri("This", 4, "This is a string", 16, 0x2c) => 0 +_mm_cmpestri("This", 4, "This is a string", 16, 0x2c) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", 4, "This is a string", 16, 0x2c) = 0000000000000000-0000000000000001 +_mm_cmpistri("This", "This is a string", 0x2c) => 0 +_mm_cmpestri("This", "This is a string", 0x2c) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", "This is a string", 0x2c) = 0000000000000000-0000000000000001 +_mm_cmpestri("This", 4, "This is a string", 16, 0x2d) => 0 +_mm_cmpestri("This", 4, "This is a string", 16, 0x2d) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", 4, "This is a string", 16, 0x2d) = 0000000000000000-0000000000000001 +_mm_cmpistri("This", "This is a string", 0x2d) => 0 +_mm_cmpestri("This", "This is a string", 0x2d) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("This", "This is a string", 0x2d) = 0000000000000000-0000000000000001 +_mm_cmpestri("This is a string", 16, "is", 2, 0x2c) => 16 +_mm_cmpestri("This is a string", 16, "is", 2, 0x2c) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x2c) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x2c) => 16 +_mm_cmpestri("This is a string", "is", 0x2c) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x2c) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "is", 2, 0x2d) => 8 +_mm_cmpestri("This is a string", 16, "is", 2, 0x2d) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x2d) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x2d) => 8 +_mm_cmpestri("This is a string", "is", 0x2d) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x2d) = 0000000000000000-0000000000000000 +_mm_cmpestri("is", 2, "This is a string", 16, 0x2c) => 2 +_mm_cmpestri("is", 2, "This is a string", 16, 0x2c) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", 2, "This is a string", 16, 0x2c) = 0000000000000000-0000000000000024 +_mm_cmpistri("is", "This is a string", 0x2c) => 2 +_mm_cmpestri("is", "This is a string", 0x2c) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", "This is a string", 0x2c) = 0000000000000000-0000000000000024 +_mm_cmpestri("is", 2, "This is a string", 16, 0x2d) => 2 +_mm_cmpestri("is", 2, "This is a string", 16, 0x2d) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", 2, "This is a string", 16, 0x2d) = 0000000000000000-0000000000000024 +_mm_cmpistri("is", "This is a string", 0x2d) => 2 +_mm_cmpestri("is", "This is a string", 0x2d) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("is", "This is a string", 0x2d) = 0000000000000000-0000000000000024 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x2c) => 16 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x2c) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x2c) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x2c) => 16 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x2c) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x2c) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x2d) => 8 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x2d) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x2d) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x2d) => 8 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x2d) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x2d) = 0000000000000000-0000000000000000 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x2c) => 16 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x2c) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x2c) = 0000000000000000-0000000000000000 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x2c) => 16 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x2c) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x2c) = 0000000000000000-0000000000000000 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x2d) => 8 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x2d) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x2d) = 0000000000000000-0000000000000000 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x2d) => 8 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x2d) flags: a:1 s:0 z:0 c:0 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x2d) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0x2c) => 16 +_mm_cmpestri("This is a string", 16, "", 0, 0x2c) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x2c) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x2c) => 16 +_mm_cmpestri("This is a string", "", 0x2c) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x2c) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0x2d) => 8 +_mm_cmpestri("This is a string", 16, "", 0, 0x2d) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x2d) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x2d) => 8 +_mm_cmpestri("This is a string", "", 0x2d) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x2d) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0x2c) => 0 +_mm_cmpestri("", 0, "This is a string", 16, 0x2c) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x2c) = 0000000000000000-000000000000ffff +_mm_cmpistri("", "This is a string", 0x2c) => 0 +_mm_cmpestri("", "This is a string", 0x2c) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x2c) = 0000000000000000-000000000000ffff +_mm_cmpestri("", 0, "This is a string", 16, 0x2d) => 0 +_mm_cmpestri("", 0, "This is a string", 16, 0x2d) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x2d) = 0000000000000000-00000000000000ff +_mm_cmpistri("", "This is a string", 0x2d) => 0 +_mm_cmpestri("", "This is a string", 0x2d) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x2d) = 0000000000000000-00000000000000ff +_mm_cmpestri("This is a string", 16, "This", 4, 0x34) => 16 +_mm_cmpestri("This is a string", 16, "This", 4, 0x34) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x34) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0x34) => 16 +_mm_cmpestri("This is a string", "This", 0x34) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0x34) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "This", 4, 0x35) => 8 +_mm_cmpestri("This is a string", 16, "This", 4, 0x35) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x35) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0x35) => 8 +_mm_cmpestri("This is a string", "This", 0x35) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0x35) = 0000000000000000-0000000000000000 +_mm_cmpestri("This", 4, "This is a string", 16, 0x34) => 4 +_mm_cmpestri("This", 4, "This is a string", 16, 0x34) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", 4, "This is a string", 16, 0x34) = 0000000000000000-0000000000000a90 +_mm_cmpistri("This", "This is a string", 0x34) => 4 +_mm_cmpestri("This", "This is a string", 0x34) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", "This is a string", 0x34) = 0000000000000000-0000000000000a90 +_mm_cmpestri("This", 4, "This is a string", 16, 0x35) => 4 +_mm_cmpestri("This", 4, "This is a string", 16, 0x35) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", 4, "This is a string", 16, 0x35) = 0000000000000000-0000000000000090 +_mm_cmpistri("This", "This is a string", 0x35) => 4 +_mm_cmpestri("This", "This is a string", 0x35) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", "This is a string", 0x35) = 0000000000000000-0000000000000090 +_mm_cmpestri("This is a string", 16, "is", 2, 0x34) => 16 +_mm_cmpestri("This is a string", 16, "is", 2, 0x34) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x34) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x34) => 16 +_mm_cmpestri("This is a string", "is", 0x34) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x34) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "is", 2, 0x35) => 8 +_mm_cmpestri("This is a string", 16, "is", 2, 0x35) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x35) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x35) => 8 +_mm_cmpestri("This is a string", "is", 0x35) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x35) = 0000000000000000-0000000000000000 +_mm_cmpestri("is", 2, "This is a string", 16, 0x34) => 0 +_mm_cmpestri("is", 2, "This is a string", 16, 0x34) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", 2, "This is a string", 16, 0x34) = 0000000000000000-0000000000008b93 +_mm_cmpistri("is", "This is a string", 0x34) => 0 +_mm_cmpestri("is", "This is a string", 0x34) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", "This is a string", 0x34) = 0000000000000000-0000000000008b93 +_mm_cmpestri("is", 2, "This is a string", 16, 0x35) => 0 +_mm_cmpestri("is", 2, "This is a string", 16, 0x35) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", 2, "This is a string", 16, 0x35) = 0000000000000000-0000000000000093 +_mm_cmpistri("is", "This is a string", 0x35) => 0 +_mm_cmpestri("is", "This is a string", 0x35) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", "This is a string", 0x35) = 0000000000000000-0000000000000093 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x34) => 6 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x34) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x34) = 0000000000000000-0000000000000040 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x34) => 6 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x34) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x34) = 0000000000000000-0000000000000040 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x35) => 4 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x35) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x35) = 0000000000000000-0000000000000050 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x35) => 4 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x35) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x35) = 0000000000000000-0000000000000050 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x34) => 4 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x34) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x34) = 0000000000000000-0000000000000a90 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x34) => 4 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x34) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x34) = 0000000000000000-0000000000000a90 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x35) => 0 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x35) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x35) = 0000000000000000-0000000000000091 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x35) => 0 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x35) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x35) = 0000000000000000-0000000000000091 +_mm_cmpestri("This is a string", 16, "", 0, 0x34) => 16 +_mm_cmpestri("This is a string", 16, "", 0, 0x34) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x34) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x34) => 16 +_mm_cmpestri("This is a string", "", 0x34) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x34) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0x35) => 8 +_mm_cmpestri("This is a string", 16, "", 0, 0x35) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x35) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x35) => 8 +_mm_cmpestri("This is a string", "", 0x35) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x35) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0x34) => 0 +_mm_cmpestri("", 0, "This is a string", 16, 0x34) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x34) = 0000000000000000-000000000000ffff +_mm_cmpistri("", "This is a string", 0x34) => 0 +_mm_cmpestri("", "This is a string", 0x34) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x34) = 0000000000000000-000000000000ffff +_mm_cmpestri("", 0, "This is a string", 16, 0x35) => 0 +_mm_cmpestri("", 0, "This is a string", 16, 0x35) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x35) = 0000000000000000-00000000000000ff +_mm_cmpistri("", "This is a string", 0x35) => 0 +_mm_cmpestri("", "This is a string", 0x35) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x35) = 0000000000000000-00000000000000ff +_mm_cmpestri("This is a string", 16, "This", 4, 0x36) => 16 +_mm_cmpestri("This is a string", 16, "This", 4, 0x36) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x36) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0x36) => 16 +_mm_cmpestri("This is a string", "This", 0x36) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0x36) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "This", 4, 0x37) => 8 +_mm_cmpestri("This is a string", 16, "This", 4, 0x37) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x37) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0x37) => 8 +_mm_cmpestri("This is a string", "This", 0x37) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0x37) = 0000000000000000-0000000000000000 +_mm_cmpestri("This", 4, "This is a string", 16, 0x36) => 4 +_mm_cmpestri("This", 4, "This is a string", 16, 0x36) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", 4, "This is a string", 16, 0x36) = 0000000000000000-0000000000000a90 +_mm_cmpistri("This", "This is a string", 0x36) => 4 +_mm_cmpestri("This", "This is a string", 0x36) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", "This is a string", 0x36) = 0000000000000000-0000000000000a90 +_mm_cmpestri("This", 4, "This is a string", 16, 0x37) => 4 +_mm_cmpestri("This", 4, "This is a string", 16, 0x37) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", 4, "This is a string", 16, 0x37) = 0000000000000000-0000000000000090 +_mm_cmpistri("This", "This is a string", 0x37) => 4 +_mm_cmpestri("This", "This is a string", 0x37) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", "This is a string", 0x37) = 0000000000000000-0000000000000090 +_mm_cmpestri("This is a string", 16, "is", 2, 0x36) => 16 +_mm_cmpestri("This is a string", 16, "is", 2, 0x36) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x36) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x36) => 16 +_mm_cmpestri("This is a string", "is", 0x36) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x36) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "is", 2, 0x37) => 8 +_mm_cmpestri("This is a string", 16, "is", 2, 0x37) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x37) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x37) => 8 +_mm_cmpestri("This is a string", "is", 0x37) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x37) = 0000000000000000-0000000000000000 +_mm_cmpestri("is", 2, "This is a string", 16, 0x36) => 0 +_mm_cmpestri("is", 2, "This is a string", 16, 0x36) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", 2, "This is a string", 16, 0x36) = 0000000000000000-0000000000008b93 +_mm_cmpistri("is", "This is a string", 0x36) => 0 +_mm_cmpestri("is", "This is a string", 0x36) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", "This is a string", 0x36) = 0000000000000000-0000000000008b93 +_mm_cmpestri("is", 2, "This is a string", 16, 0x37) => 0 +_mm_cmpestri("is", 2, "This is a string", 16, 0x37) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", 2, "This is a string", 16, 0x37) = 0000000000000000-0000000000000093 +_mm_cmpistri("is", "This is a string", 0x37) => 0 +_mm_cmpestri("is", "This is a string", 0x37) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", "This is a string", 0x37) = 0000000000000000-0000000000000093 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x36) => 6 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x36) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x36) = 0000000000000000-0000000000000040 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x36) => 6 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x36) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x36) = 0000000000000000-0000000000000040 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x37) => 4 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x37) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x37) = 0000000000000000-0000000000000050 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x37) => 4 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x37) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x37) = 0000000000000000-0000000000000050 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x36) => 4 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x36) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x36) = 0000000000000000-0000000000000a90 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x36) => 4 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x36) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x36) = 0000000000000000-0000000000000a90 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x37) => 0 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x37) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x37) = 0000000000000000-0000000000000091 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x37) => 0 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x37) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x37) = 0000000000000000-0000000000000091 +_mm_cmpestri("This is a string", 16, "", 0, 0x36) => 16 +_mm_cmpestri("This is a string", 16, "", 0, 0x36) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x36) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x36) => 16 +_mm_cmpestri("This is a string", "", 0x36) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x36) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0x37) => 8 +_mm_cmpestri("This is a string", 16, "", 0, 0x37) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x37) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x37) => 8 +_mm_cmpestri("This is a string", "", 0x37) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x37) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0x36) => 0 +_mm_cmpestri("", 0, "This is a string", 16, 0x36) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x36) = 0000000000000000-000000000000ffff +_mm_cmpistri("", "This is a string", 0x36) => 0 +_mm_cmpestri("", "This is a string", 0x36) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x36) = 0000000000000000-000000000000ffff +_mm_cmpestri("", 0, "This is a string", 16, 0x37) => 0 +_mm_cmpestri("", 0, "This is a string", 16, 0x37) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x37) = 0000000000000000-00000000000000ff +_mm_cmpistri("", "This is a string", 0x37) => 0 +_mm_cmpestri("", "This is a string", 0x37) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x37) = 0000000000000000-00000000000000ff +_mm_cmpestri("This is a string", 16, "This", 4, 0x74) => 16 +_mm_cmpestri("This is a string", 16, "This", 4, 0x74) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x74) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0x74) => 16 +_mm_cmpestri("This is a string", "This", 0x74) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0x74) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "This", 4, 0x75) => 8 +_mm_cmpestri("This is a string", 16, "This", 4, 0x75) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "This", 4, 0x75) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "This", 0x75) => 8 +_mm_cmpestri("This is a string", "This", 0x75) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "This", 0x75) = 0000000000000000-0000000000000000 +_mm_cmpestri("This", 4, "This is a string", 16, 0x74) => 11 +_mm_cmpestri("This", 4, "This is a string", 16, 0x74) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", 4, "This is a string", 16, 0x74) = 00000000ff0000ff-0000000000000000 +_mm_cmpistri("This", "This is a string", 0x74) => 11 +_mm_cmpestri("This", "This is a string", 0x74) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", "This is a string", 0x74) = 00000000ff0000ff-0000000000000000 +_mm_cmpestri("This", 4, "This is a string", 16, 0x75) => 7 +_mm_cmpestri("This", 4, "This is a string", 16, 0x75) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", 4, "This is a string", 16, 0x75) = 0000000000000000-0000000000000000 +_mm_cmpistri("This", "This is a string", 0x75) => 7 +_mm_cmpestri("This", "This is a string", 0x75) flags: a:0 s:1 z:0 c:1 o:0 +mm_cmpestrm("This", "This is a string", 0x75) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "is", 2, 0x74) => 16 +_mm_cmpestri("This is a string", 16, "is", 2, 0x74) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x74) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x74) => 16 +_mm_cmpestri("This is a string", "is", 0x74) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x74) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "is", 2, 0x75) => 8 +_mm_cmpestri("This is a string", 16, "is", 2, 0x75) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "is", 2, 0x75) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "is", 0x75) => 8 +_mm_cmpestri("This is a string", "is", 0x75) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "is", 0x75) = 0000000000000000-0000000000000000 +_mm_cmpestri("is", 2, "This is a string", 16, 0x74) => 15 +_mm_cmpestri("is", 2, "This is a string", 16, 0x74) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", 2, "This is a string", 16, 0x74) = 00000000ff0000ff-000000000000ffff +_mm_cmpistri("is", "This is a string", 0x74) => 15 +_mm_cmpestri("is", "This is a string", 0x74) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", "This is a string", 0x74) = 00000000ff0000ff-000000000000ffff +_mm_cmpestri("is", 2, "This is a string", 16, 0x75) => 7 +_mm_cmpestri("is", 2, "This is a string", 16, 0x75) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", 2, "This is a string", 16, 0x75) = 0000000000000000-00000000ffffffff +_mm_cmpistri("is", "This is a string", 0x75) => 7 +_mm_cmpestri("is", "This is a string", 0x75) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("is", "This is a string", 0x75) = 0000000000000000-00000000ffffffff +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x74) => 6 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x74) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x74) = 0000000000ff0000-0000000000000000 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x74) => 6 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x74) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x74) = 0000000000ff0000-0000000000000000 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x75) => 6 +_mm_cmpestri("This is a string", 16, "maestrum-foo-bar", 16, 0x75) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", 16, "maestrum-foo-bar", 16, 0x75) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "maestrum-foo-bar", 0x75) => 6 +_mm_cmpestri("This is a string", "maestrum-foo-bar", 0x75) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("This is a string", "maestrum-foo-bar", 0x75) = 0000000000000000-0000000000000000 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x74) => 11 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x74) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x74) = 00000000ff0000ff-0000000000000000 +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x74) => 11 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x74) flags: a:0 s:0 z:0 c:1 o:0 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x74) = 00000000ff0000ff-0000000000000000 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x75) => 7 +_mm_cmpestri("maestrum-foo-bar", 16, "This is a string", 16, 0x75) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", 16, "This is a string", 16, 0x75) = 0000000000000000-000000000000ffff +_mm_cmpistri("maestrum-foo-bar", "This is a string", 0x75) => 7 +_mm_cmpestri("maestrum-foo-bar", "This is a string", 0x75) flags: a:0 s:0 z:0 c:1 o:1 +mm_cmpestrm("maestrum-foo-bar", "This is a string", 0x75) = 0000000000000000-000000000000ffff +_mm_cmpestri("This is a string", 16, "", 0, 0x74) => 16 +_mm_cmpestri("This is a string", 16, "", 0, 0x74) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x74) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x74) => 16 +_mm_cmpestri("This is a string", "", 0x74) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x74) = 0000000000000000-0000000000000000 +_mm_cmpestri("This is a string", 16, "", 0, 0x75) => 8 +_mm_cmpestri("This is a string", 16, "", 0, 0x75) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", 16, "", 0, 0x75) = 0000000000000000-0000000000000000 +_mm_cmpistri("This is a string", "", 0x75) => 8 +_mm_cmpestri("This is a string", "", 0x75) flags: a:0 s:0 z:1 c:0 o:0 +mm_cmpestrm("This is a string", "", 0x75) = 0000000000000000-0000000000000000 +_mm_cmpestri("", 0, "This is a string", 16, 0x74) => 15 +_mm_cmpestri("", 0, "This is a string", 16, 0x74) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x74) = 00000000ffffffff-00000000ffffffff +_mm_cmpistri("", "This is a string", 0x74) => 15 +_mm_cmpestri("", "This is a string", 0x74) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x74) = 00000000ffffffff-00000000ffffffff +_mm_cmpestri("", 0, "This is a string", 16, 0x75) => 7 +_mm_cmpestri("", 0, "This is a string", 16, 0x75) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", 0, "This is a string", 16, 0x75) = 00000000ffffffff-00000000ffffffff +_mm_cmpistri("", "This is a string", 0x75) => 7 +_mm_cmpestri("", "This is a string", 0x75) flags: a:0 s:1 z:0 c:1 o:1 +mm_cmpestrm("", "This is a string", 0x75) = 00000000ffffffff-00000000ffffffff +crc32(0x0, byte:0x0) => 0x0 +crc32(0x0, byte:0xa) => 0x6be22838 +crc32(0x6be22838, dword:0x0) => 0xb545d4c9 +crc32(0xb545d4c9, dword:0x123456) => 0xc4dd37b5 +crc32(0xc4dd37b5, word:0x8765) => 0x89047b68 diff --git a/tests32/ref26.txt b/tests32/ref26.txt new file mode 100644 index 0000000..358877e --- /dev/null +++ b/tests32/ref26.txt @@ -0,0 +1,810 @@ +Testing: s = (0x1.123456789abcp2) -> (double)s +FE_TONEAREST 0x1.123456789abcp+2 +FE_DOWNWARD 0x1.123456789abcp+2 +FE_UPWARD 0x1.123456789abcp+2 +FE_TOWARDZERO 0x1.123456789abcp+2 + +Testing: s = (0x1.123456789abcp2) -> (float)s +FE_TONEAREST 0x1.123456p+2 +FE_DOWNWARD 0x1.123456p+2 +FE_UPWARD 0x1.123458p+2 +FE_TOWARDZERO 0x1.123456p+2 + +Testing: s = (-(0x1.123456789abcp2)) -> (double)s +FE_TONEAREST -0x1.123456789abcp+2 +FE_DOWNWARD -0x1.123456789abcp+2 +FE_UPWARD -0x1.123456789abcp+2 +FE_TOWARDZERO -0x1.123456789abcp+2 + +Testing: s = (-(0x1.123456789abcp2)) -> (float)s +FE_TONEAREST -0x1.123456p+2 +FE_DOWNWARD -0x1.123458p+2 +FE_UPWARD -0x1.123456p+2 +FE_TOWARDZERO -0x1.123456p+2 + +Testing: d = (0x1.123456789abcp512) -> (float)d +FE_TONEAREST inf +FE_DOWNWARD 0x1.fffffep+127 +FE_UPWARD inf +FE_TOWARDZERO 0x1.fffffep+127 + +Testing: s = (0x1.123456789abcp29) -> (double)s +FE_TONEAREST 0x1.123456789abcp+29 +FE_DOWNWARD 0x1.123456789abcp+29 +FE_UPWARD 0x1.123456789abcp+29 +FE_TOWARDZERO 0x1.123456789abcp+29 + +Testing: s = (0x1.123456789abcp29) -> (float)s +FE_TONEAREST 0x1.123456p+29 +FE_DOWNWARD 0x1.123456p+29 +FE_UPWARD 0x1.123458p+29 +FE_TOWARDZERO 0x1.123456p+29 + +Testing: s = (0x1.123456789abcp29) -> (int16_t)s +FE_TONEAREST -32768 +FE_DOWNWARD -32768 +FE_UPWARD -32768 +FE_TOWARDZERO -32768 + +Testing: s = (0x1.123456789abcp29) -> (int8_t)s +FE_TONEAREST 0 +FE_DOWNWARD 0 +FE_UPWARD 0 +FE_TOWARDZERO 0 + +Testing: s = (0x1.123456789abcp29) -> (unsigned short)s +FE_TONEAREST 35535 +FE_DOWNWARD 35535 +FE_UPWARD 35535 +FE_TOWARDZERO 35535 + +Testing: s = (0x1.123456789abcp29) -> (unsigned char)s +FE_TONEAREST 0 +FE_DOWNWARD 0 +FE_UPWARD 0 +FE_TOWARDZERO 0 + +Testing: s = (-(0x1.123456789abcp29)) -> (double)s +FE_TONEAREST -0x1.123456789abcp+29 +FE_DOWNWARD -0x1.123456789abcp+29 +FE_UPWARD -0x1.123456789abcp+29 +FE_TOWARDZERO -0x1.123456789abcp+29 + +Testing: s = (-(0x1.123456789abcp29)) -> (float)s +FE_TONEAREST -0x1.123456p+29 +FE_DOWNWARD -0x1.123458p+29 +FE_UPWARD -0x1.123456p+29 +FE_TOWARDZERO -0x1.123456p+29 + +Testing: d = (-0x1.123456789abcp30) -> (int32_t)d +FE_TONEAREST -1150096798 +FE_DOWNWARD -1150096798 +FE_UPWARD -1150096798 +FE_TOWARDZERO -1150096798 + +Testing: d = (-0x1.123456789abcp62) -> (int64_t)d +FE_TONEAREST -4939628135293321216 +FE_DOWNWARD -4939628135293321216 +FE_UPWARD -4939628135293321216 +FE_TOWARDZERO -4939628135293321216 + +Testing: s = (0x1.123456789abcp2f) -> (double)s +FE_TONEAREST 0x1.123456p+2 +FE_DOWNWARD 0x1.123456p+2 +FE_UPWARD 0x1.123458p+2 +FE_TOWARDZERO 0x1.123456p+2 + +Testing: s = (0x1.123456789abcp2f) -> (float)s +FE_TONEAREST 0x1.123456p+2 +FE_DOWNWARD 0x1.123456p+2 +FE_UPWARD 0x1.123458p+2 +FE_TOWARDZERO 0x1.123456p+2 + +Testing: s = (-(0x1.123456789abcp2f)) -> (double)s +FE_TONEAREST -0x1.123456p+2 +FE_DOWNWARD -0x1.123458p+2 +FE_UPWARD -0x1.123456p+2 +FE_TOWARDZERO -0x1.123456p+2 + +Testing: s = (-(0x1.123456789abcp2f)) -> (float)s +FE_TONEAREST -0x1.123456p+2 +FE_DOWNWARD -0x1.123458p+2 +FE_UPWARD -0x1.123456p+2 +FE_TOWARDZERO -0x1.123456p+2 + +Testing: s = (0x1.123456789abcp29f) -> (double)s +FE_TONEAREST 0x1.123456p+29 +FE_DOWNWARD 0x1.123456p+29 +FE_UPWARD 0x1.123458p+29 +FE_TOWARDZERO 0x1.123456p+29 + +Testing: s = (0x1.123456789abcp29f) -> (float)s +FE_TONEAREST 0x1.123456p+29 +FE_DOWNWARD 0x1.123456p+29 +FE_UPWARD 0x1.123458p+29 +FE_TOWARDZERO 0x1.123456p+29 + +Testing: s = (0x1.123456789abcp29f) -> (int16_t)s +FE_TONEAREST -32768 +FE_DOWNWARD -32768 +FE_UPWARD -32768 +FE_TOWARDZERO -32768 + +Testing: s = (0x1.123456789abcp29f) -> (int8_t)s +FE_TONEAREST 0 +FE_DOWNWARD 0 +FE_UPWARD 0 +FE_TOWARDZERO 0 + +Testing: s = (0x1.123456789abcp29f) -> (unsigned short)s +FE_TONEAREST 35520 +FE_DOWNWARD 35520 +FE_UPWARD 35584 +FE_TOWARDZERO 35520 + +Testing: s = (0x1.123456789abcp29f) -> (unsigned char)s +FE_TONEAREST 0 +FE_DOWNWARD 0 +FE_UPWARD 0 +FE_TOWARDZERO 0 + +Testing: s = (-(0x1.123456789abcp29f)) -> (double)s +FE_TONEAREST -0x1.123456p+29 +FE_DOWNWARD -0x1.123458p+29 +FE_UPWARD -0x1.123456p+29 +FE_TOWARDZERO -0x1.123456p+29 + +Testing: s = (-(0x1.123456789abcp29f)) -> (float)s +FE_TONEAREST -0x1.123456p+29 +FE_DOWNWARD -0x1.123458p+29 +FE_UPWARD -0x1.123456p+29 +FE_TOWARDZERO -0x1.123456p+29 + +Testing: f = -0x1.123456789abcp30f -> (int32_t)f +FE_TONEAREST -1150096768 +FE_DOWNWARD -1150096896 +FE_UPWARD -1150096768 +FE_TOWARDZERO -1150096768 + +Testing: d = -0x1.1234567p0 -> (double)((int)d) +FE_TONEAREST -0x1p+0 +FE_DOWNWARD -0x1p+0 +FE_UPWARD -0x1p+0 +FE_TOWARDZERO -0x1p+0 + +Testing: d = 0x1.9234567p0 -> (double)((int)d) +FE_TONEAREST 0x1p+0 +FE_DOWNWARD 0x1p+0 +FE_UPWARD 0x1p+0 +FE_TOWARDZERO 0x1p+0 + +Testing: d = -0x1.9234567p0 -> (double)((int)d) +FE_TONEAREST -0x1p+0 +FE_DOWNWARD -0x1p+0 +FE_UPWARD -0x1p+0 +FE_TOWARDZERO -0x1p+0 + +Testing: d = 0x1.1234567p0 -> (double)((long int)d) +FE_TONEAREST 0x1p+0 +FE_DOWNWARD 0x1p+0 +FE_UPWARD 0x1p+0 +FE_TOWARDZERO 0x1p+0 + +Testing: d = -0x1.1234567p0 -> (double)((long int)d) +FE_TONEAREST -0x1p+0 +FE_DOWNWARD -0x1p+0 +FE_UPWARD -0x1p+0 +FE_TOWARDZERO -0x1p+0 + +Testing: d = 0x1.9234567p0 -> (double)((long int)d) +FE_TONEAREST 0x1p+0 +FE_DOWNWARD 0x1p+0 +FE_UPWARD 0x1p+0 +FE_TOWARDZERO 0x1p+0 + +Testing: d = -0x1.9234567p0 -> (double)((long int)d) +FE_TONEAREST -0x1p+0 +FE_DOWNWARD -0x1p+0 +FE_UPWARD -0x1p+0 +FE_TOWARDZERO -0x1p+0 + +Testing: (d1 = (1.0), d2 = (0x1.0000000000001p0)) -> d1 + d2 +FE_TONEAREST 0x1p+1 +FE_DOWNWARD 0x1p+1 +FE_UPWARD 0x1.0000000000001p+1 +FE_TOWARDZERO 0x1p+1 + +Testing: (d1 = -(1.0), d2 = (0x1.0000000000001p0)) -> d1 + d2 +FE_TONEAREST 0x1p-52 +FE_DOWNWARD 0x1p-52 +FE_UPWARD 0x1p-52 +FE_TOWARDZERO 0x1p-52 + +Testing: (d1 = (1.0), d2 = -(0x1.0000000000001p0)) -> d1 + d2 +FE_TONEAREST -0x1p-52 +FE_DOWNWARD -0x1p-52 +FE_UPWARD -0x1p-52 +FE_TOWARDZERO -0x1p-52 + +Testing: (d1 = -(1.0), d2 = -(0x1.0000000000001p0)) -> d1 + d2 +FE_TONEAREST -0x1p+1 +FE_DOWNWARD -0x1.0000000000001p+1 +FE_UPWARD -0x1p+1 +FE_TOWARDZERO -0x1p+1 + +Testing: (d1 = (1.0), d2 = (0x1.0000000000001p0)) -> d1 - d2 +FE_TONEAREST -0x1p-52 +FE_DOWNWARD -0x1p-52 +FE_UPWARD -0x1p-52 +FE_TOWARDZERO -0x1p-52 + +Testing: (d1 = -(1.0), d2 = (0x1.0000000000001p0)) -> d1 - d2 +FE_TONEAREST -0x1p+1 +FE_DOWNWARD -0x1.0000000000001p+1 +FE_UPWARD -0x1p+1 +FE_TOWARDZERO -0x1p+1 + +Testing: (d1 = (1.0), d2 = -(0x1.0000000000001p0)) -> d1 - d2 +FE_TONEAREST 0x1p+1 +FE_DOWNWARD 0x1p+1 +FE_UPWARD 0x1.0000000000001p+1 +FE_TOWARDZERO 0x1p+1 + +Testing: (d1 = -(1.0), d2 = -(0x1.0000000000001p0)) -> d1 - d2 +FE_TONEAREST 0x1p-52 +FE_DOWNWARD 0x1p-52 +FE_UPWARD 0x1p-52 +FE_TOWARDZERO 0x1p-52 + +Testing: (d1 = (1.0), d2 = (0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST 0x1p-52 +FE_DOWNWARD 0x1p-52 +FE_UPWARD 0x1p-52 +FE_TOWARDZERO 0x1p-52 + +Testing: (d1 = -(1.0), d2 = (0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST 0x1p+1 +FE_DOWNWARD 0x1p+1 +FE_UPWARD 0x1.0000000000001p+1 +FE_TOWARDZERO 0x1p+1 + +Testing: (d1 = (1.0), d2 = -(0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST -0x1p+1 +FE_DOWNWARD -0x1.0000000000001p+1 +FE_UPWARD -0x1p+1 +FE_TOWARDZERO -0x1p+1 + +Testing: (d1 = -(1.0), d2 = -(0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST -0x1p-52 +FE_DOWNWARD -0x1p-52 +FE_UPWARD -0x1p-52 +FE_TOWARDZERO -0x1p-52 + +Testing: (d1 = (1.0), d2 = (0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST 0x1.1000000000001p+0 +FE_DOWNWARD 0x1.1p+0 +FE_UPWARD 0x1.1000000000001p+0 +FE_TOWARDZERO 0x1.1p+0 + +Testing: (d1 = -(1.0), d2 = (0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST -0x1.dfffffffffffep-1 +FE_DOWNWARD -0x1.dffffffffffffp-1 +FE_UPWARD -0x1.dfffffffffffep-1 +FE_TOWARDZERO -0x1.dfffffffffffep-1 + +Testing: (d1 = (1.0), d2 = -(0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST 0x1.dfffffffffffep-1 +FE_DOWNWARD 0x1.dfffffffffffep-1 +FE_UPWARD 0x1.dffffffffffffp-1 +FE_TOWARDZERO 0x1.dfffffffffffep-1 + +Testing: (d1 = -(1.0), d2 = -(0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST -0x1.1000000000001p+0 +FE_DOWNWARD -0x1.1000000000001p+0 +FE_UPWARD -0x1.1p+0 +FE_TOWARDZERO -0x1.1p+0 + +Testing: (d1 = (1.0), d2 = (0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST 0x1.dfffffffffffep-1 +FE_DOWNWARD 0x1.dfffffffffffep-1 +FE_UPWARD 0x1.dffffffffffffp-1 +FE_TOWARDZERO 0x1.dfffffffffffep-1 + +Testing: (d1 = -(1.0), d2 = (0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST -0x1.1000000000001p+0 +FE_DOWNWARD -0x1.1000000000001p+0 +FE_UPWARD -0x1.1p+0 +FE_TOWARDZERO -0x1.1p+0 + +Testing: (d1 = (1.0), d2 = -(0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST 0x1.1000000000001p+0 +FE_DOWNWARD 0x1.1p+0 +FE_UPWARD 0x1.1000000000001p+0 +FE_TOWARDZERO 0x1.1p+0 + +Testing: (d1 = -(1.0), d2 = -(0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST -0x1.dfffffffffffep-1 +FE_DOWNWARD -0x1.dffffffffffffp-1 +FE_UPWARD -0x1.dfffffffffffep-1 +FE_TOWARDZERO -0x1.dfffffffffffep-1 + +Testing: (d1 = (1.0), d2 = (0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST -0x1.dfffffffffffep-1 +FE_DOWNWARD -0x1.dffffffffffffp-1 +FE_UPWARD -0x1.dfffffffffffep-1 +FE_TOWARDZERO -0x1.dfffffffffffep-1 + +Testing: (d1 = -(1.0), d2 = (0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST 0x1.1000000000001p+0 +FE_DOWNWARD 0x1.1p+0 +FE_UPWARD 0x1.1000000000001p+0 +FE_TOWARDZERO 0x1.1p+0 + +Testing: (d1 = (1.0), d2 = -(0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST -0x1.1000000000001p+0 +FE_DOWNWARD -0x1.1000000000001p+0 +FE_UPWARD -0x1.1p+0 +FE_TOWARDZERO -0x1.1p+0 + +Testing: (d1 = -(1.0), d2 = -(0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST 0x1.dfffffffffffep-1 +FE_DOWNWARD 0x1.dfffffffffffep-1 +FE_UPWARD 0x1.dffffffffffffp-1 +FE_TOWARDZERO 0x1.dfffffffffffep-1 + +Testing: (d1 = (0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 + d2 +FE_TONEAREST 0x1.2bc55ef8922bp+1 +FE_DOWNWARD 0x1.2bc55ef8922bp+1 +FE_UPWARD 0x1.2bc55ef8922bp+1 +FE_TOWARDZERO 0x1.2bc55ef8922bp+1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 + d2 +FE_TONEAREST 0x1.12233445566p-4 +FE_DOWNWARD 0x1.12233445566p-4 +FE_UPWARD 0x1.12233445566p-4 +FE_TOWARDZERO 0x1.12233445566p-4 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 + d2 +FE_TONEAREST -0x1.12233445566p-4 +FE_DOWNWARD -0x1.12233445566p-4 +FE_UPWARD -0x1.12233445566p-4 +FE_TOWARDZERO -0x1.12233445566p-4 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 + d2 +FE_TONEAREST -0x1.2bc55ef8922bp+1 +FE_DOWNWARD -0x1.2bc55ef8922bp+1 +FE_UPWARD -0x1.2bc55ef8922bp+1 +FE_TOWARDZERO -0x1.2bc55ef8922bp+1 + +Testing: (d1 = (0x1.233445566778p0f), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd404804dp+0 +FE_DOWNWARD 0x1.5ebd3ddf57ep+0 +FE_UPWARD 0x1.5ebd428e6d5cp+0 +FE_TOWARDZERO 0x1.5ebd3ddf57ep+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd404804dp+0 +FE_DOWNWARD -0x1.5ebd404804dp+0 +FE_UPWARD -0x1.5ebd4025c068p+0 +FE_TOWARDZERO -0x1.5ebd3ddf57ep+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd404804dp+0 +FE_DOWNWARD -0x1.5ebd4025c068p+0 +FE_UPWARD -0x1.5ebd404804dp+0 +FE_TOWARDZERO -0x1.5ebd3ddf57ep+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd404804dp+0 +FE_DOWNWARD 0x1.5ebd428e6d5cp+0 +FE_UPWARD 0x1.5ebd3ddf57ep+0 +FE_TOWARDZERO 0x1.5ebd3ddf57ep+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd40f80919p+0 +FE_DOWNWARD 0x1.5ebd3e8f5c27dp+0 +FE_UPWARD 0x1.5ebd40f809191p+0 +FE_TOWARDZERO 0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd40f80919p+0 +FE_DOWNWARD -0x1.5ebd40f809191p+0 +FE_UPWARD -0x1.5ebd3e8f5c27dp+0 +FE_TOWARDZERO -0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd40f80919p+0 +FE_DOWNWARD -0x1.5ebd3e8f5c27ep+0 +FE_UPWARD -0x1.5ebd40f80919p+0 +FE_TOWARDZERO -0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd40f80919p+0 +FE_DOWNWARD 0x1.5ebd40f80919p+0 +FE_UPWARD 0x1.5ebd3e8f5c27ep+0 +FE_TOWARDZERO 0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = (0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd402bc44c4p+0 +FE_DOWNWARD 0x1.5ebd402bc44c4p+0 +FE_UPWARD 0x1.5ebd402bc44c5p+0 +FE_TOWARDZERO 0x1.5ebd402bc44c4p+0 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd402bc44c4p+0 +FE_DOWNWARD -0x1.5ebd402bc44c5p+0 +FE_UPWARD -0x1.5ebd402bc44c4p+0 +FE_TOWARDZERO -0x1.5ebd402bc44c4p+0 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd402bc44c4p+0 +FE_DOWNWARD -0x1.5ebd402bc44c5p+0 +FE_UPWARD -0x1.5ebd402bc44c4p+0 +FE_TOWARDZERO -0x1.5ebd402bc44c4p+0 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd402bc44c4p+0 +FE_DOWNWARD 0x1.5ebd402bc44c4p+0 +FE_UPWARD 0x1.5ebd402bc44c5p+0 +FE_TOWARDZERO 0x1.5ebd402bc44c4p+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd40f80919p+0 +FE_DOWNWARD 0x1.5ebd3e8f5c27dp+0 +FE_UPWARD 0x1.5ebd40f809191p+0 +FE_TOWARDZERO 0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd40f80919p+0 +FE_DOWNWARD -0x1.5ebd40f809191p+0 +FE_UPWARD -0x1.5ebd3e8f5c27dp+0 +FE_TOWARDZERO -0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd40f80919p+0 +FE_DOWNWARD -0x1.5ebd3e8f5c27ep+0 +FE_UPWARD -0x1.5ebd40f80919p+0 +FE_TOWARDZERO -0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd40f80919p+0 +FE_DOWNWARD 0x1.5ebd40f80919p+0 +FE_UPWARD 0x1.5ebd3e8f5c27ep+0 +FE_TOWARDZERO 0x1.5ebd3e8f5c27dp+0 + +Testing: (d1 = (0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd3f7bc003ap+0 +FE_DOWNWARD 0x1.5ebd3f7bc003ap+0 +FE_UPWARD 0x1.5ebd41c2288e5p+0 +FE_TOWARDZERO 0x1.5ebd3f7bc003ap+0 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd3f7bc003ap+0 +FE_DOWNWARD -0x1.5ebd3f7bc003bp+0 +FE_UPWARD -0x1.5ebd41c2288e4p+0 +FE_TOWARDZERO -0x1.5ebd3f7bc003ap+0 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd3f7bc003ap+0 +FE_DOWNWARD -0x1.5ebd41c2288e5p+0 +FE_UPWARD -0x1.5ebd3f7bc003ap+0 +FE_TOWARDZERO -0x1.5ebd3f7bc003ap+0 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd3f7bc003ap+0 +FE_DOWNWARD 0x1.5ebd41c2288e4p+0 +FE_UPWARD 0x1.5ebd3f7bc003bp+0 +FE_TOWARDZERO 0x1.5ebd3f7bc003ap+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd404804dp+0 +FE_DOWNWARD 0x1.5ebd3ddf57ep+0 +FE_UPWARD 0x1.5ebd428e6d5cp+0 +FE_TOWARDZERO 0x1.5ebd3ddf57ep+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd404804dp+0 +FE_DOWNWARD -0x1.5ebd404804dp+0 +FE_UPWARD -0x1.5ebd4025c068p+0 +FE_TOWARDZERO -0x1.5ebd3ddf57ep+0 + +Testing: (d1 = (0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.5ebd404804dp+0 +FE_DOWNWARD -0x1.5ebd4025c068p+0 +FE_UPWARD -0x1.5ebd404804dp+0 +FE_TOWARDZERO -0x1.5ebd3ddf57ep+0 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.5ebd404804dp+0 +FE_DOWNWARD 0x1.5ebd428e6d5cp+0 +FE_UPWARD 0x1.5ebd3ddf57ep+0 +FE_TOWARDZERO 0x1.5ebd3ddf57ep+0 + +Testing: (d1 = (0x1.233445566778p0), d2 = (5)) -> d1 *d2 +FE_TONEAREST 0x1.6c0156ac0156p+2 +FE_DOWNWARD 0x1.6c0156ac0156p+2 +FE_UPWARD 0x1.6c0156ac0156p+2 +FE_TOWARDZERO 0x1.6c0156ac0156p+2 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (5)) -> d1 *d2 +FE_TONEAREST -0x1.6c0156ac0156p+2 +FE_DOWNWARD -0x1.6c0156ac0156p+2 +FE_UPWARD -0x1.6c0156ac0156p+2 +FE_TOWARDZERO -0x1.6c0156ac0156p+2 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(5)) -> d1 *d2 +FE_TONEAREST -0x1.6c0156ac0156p+2 +FE_DOWNWARD -0x1.6c0156ac0156p+2 +FE_UPWARD -0x1.6c0156ac0156p+2 +FE_TOWARDZERO -0x1.6c0156ac0156p+2 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(5)) -> d1 *d2 +FE_TONEAREST 0x1.6c0156ac0156p+2 +FE_DOWNWARD 0x1.6c0156ac0156p+2 +FE_UPWARD 0x1.6c0156ac0156p+2 +FE_TOWARDZERO 0x1.6c0156ac0156p+2 + +Testing: (d1 = (15), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.2111111111102p+4 +FE_DOWNWARD 0x1.2111111111102p+4 +FE_UPWARD 0x1.2111111111102p+4 +FE_TOWARDZERO 0x1.2111111111102p+4 + +Testing: (d1 = -(15), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.2111111111102p+4 +FE_DOWNWARD -0x1.2111111111102p+4 +FE_UPWARD -0x1.2111111111102p+4 +FE_TOWARDZERO -0x1.2111111111102p+4 + +Testing: (d1 = (15), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.2111111111102p+4 +FE_DOWNWARD -0x1.2111111111102p+4 +FE_UPWARD -0x1.2111111111102p+4 +FE_TOWARDZERO -0x1.2111111111102p+4 + +Testing: (d1 = -(15), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.2111111111102p+4 +FE_DOWNWARD 0x1.2111111111102p+4 +FE_UPWARD 0x1.2111111111102p+4 +FE_TOWARDZERO 0x1.2111111111102p+4 + +Testing: (d1 = (0x1.233445566778p0f), d2 = (15)) -> d1 *d2 +FE_TONEAREST 0x1.110101ap+4 +FE_DOWNWARD 0x1.1100ffcp+4 +FE_UPWARD 0x1.110101ap+4 +FE_TOWARDZERO 0x1.1100ffcp+4 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = (15)) -> d1 *d2 +FE_TONEAREST -0x1.110101ap+4 +FE_DOWNWARD -0x1.110101ap+4 +FE_UPWARD -0x1.1100ffcp+4 +FE_TOWARDZERO -0x1.1100ffcp+4 + +Testing: (d1 = (0x1.233445566778p0f), d2 = -(15)) -> d1 *d2 +FE_TONEAREST -0x1.110101ap+4 +FE_DOWNWARD -0x1.1100ffcp+4 +FE_UPWARD -0x1.110101ap+4 +FE_TOWARDZERO -0x1.1100ffcp+4 + +Testing: (d1 = -(0x1.233445566778p0f), d2 = -(15)) -> d1 *d2 +FE_TONEAREST 0x1.110101ap+4 +FE_DOWNWARD 0x1.110101ap+4 +FE_UPWARD 0x1.1100ffcp+4 +FE_TOWARDZERO 0x1.1100ffcp+4 + +Testing: (d1 = (15), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.2111108p+4 +FE_DOWNWARD 0x1.2111108p+4 +FE_UPWARD 0x1.2111126p+4 +FE_TOWARDZERO 0x1.2111108p+4 + +Testing: (d1 = -(15), d2 = (0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.2111108p+4 +FE_DOWNWARD -0x1.2111108p+4 +FE_UPWARD -0x1.2111126p+4 +FE_TOWARDZERO -0x1.2111108p+4 + +Testing: (d1 = (15), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST -0x1.2111108p+4 +FE_DOWNWARD -0x1.2111126p+4 +FE_UPWARD -0x1.2111108p+4 +FE_TOWARDZERO -0x1.2111108p+4 + +Testing: (d1 = -(15), d2 = -(0x1.3456789abcdep0f)) -> d1 *d2 +FE_TONEAREST 0x1.2111108p+4 +FE_DOWNWARD 0x1.2111126p+4 +FE_UPWARD 0x1.2111108p+4 +FE_TOWARDZERO 0x1.2111108p+4 + +Testing: (d1 = (0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST 0x1.e38ca44203ab9p-1 +FE_DOWNWARD 0x1.e38ca44203ab8p-1 +FE_UPWARD 0x1.e38ca44203ab9p-1 +FE_TOWARDZERO 0x1.e38ca44203ab8p-1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST -0x1.e38ca44203ab9p-1 +FE_DOWNWARD -0x1.e38ca44203ab9p-1 +FE_UPWARD -0x1.e38ca44203ab8p-1 +FE_TOWARDZERO -0x1.e38ca44203ab8p-1 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST -0x1.e38ca44203ab9p-1 +FE_DOWNWARD -0x1.e38ca44203ab9p-1 +FE_UPWARD -0x1.e38ca44203ab8p-1 +FE_TOWARDZERO -0x1.e38ca44203ab8p-1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST 0x1.e38ca44203ab9p-1 +FE_DOWNWARD 0x1.e38ca44203ab8p-1 +FE_UPWARD 0x1.e38ca44203ab9p-1 +FE_TOWARDZERO 0x1.e38ca44203ab8p-1 + +Testing: (d1 = (0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST 0x1.e38ca44203ab9p-1 +FE_DOWNWARD 0x1.e38ca44203ab8p-1 +FE_UPWARD 0x1.e38ca44203ab9p-1 +FE_TOWARDZERO 0x1.e38ca44203ab8p-1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST -0x1.e38ca44203ab9p-1 +FE_DOWNWARD -0x1.e38ca44203ab9p-1 +FE_UPWARD -0x1.e38ca44203ab8p-1 +FE_TOWARDZERO -0x1.e38ca44203ab8p-1 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST -0x1.e38ca44203ab9p-1 +FE_DOWNWARD -0x1.e38ca44203ab9p-1 +FE_UPWARD -0x1.e38ca44203ab8p-1 +FE_TOWARDZERO -0x1.e38ca44203ab8p-1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(0x1.3456789abcdep0)) -> d1 / d2 +FE_TONEAREST 0x1.e38ca44203ab9p-1 +FE_DOWNWARD 0x1.e38ca44203ab8p-1 +FE_UPWARD 0x1.e38ca44203ab9p-1 +FE_TOWARDZERO 0x1.e38ca44203ab8p-1 + +Testing: (d1 = (0x1.233445566778p0), d2 = (0x1.3456789abcdep0f)) -> d1 / d2 +FE_TONEAREST 0x1.e38ca534ae61p-1 +FE_DOWNWARD 0x1.e38ca534ae61p-1 +FE_UPWARD 0x1.e38ca211bd4adp-1 +FE_TOWARDZERO 0x1.e38ca534ae61p-1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = (0x1.3456789abcdep0f)) -> d1 / d2 +FE_TONEAREST -0x1.e38ca534ae61p-1 +FE_DOWNWARD -0x1.e38ca534ae611p-1 +FE_UPWARD -0x1.e38ca211bd4acp-1 +FE_TOWARDZERO -0x1.e38ca534ae61p-1 + +Testing: (d1 = (0x1.233445566778p0), d2 = -(0x1.3456789abcdep0f)) -> d1 / d2 +FE_TONEAREST -0x1.e38ca534ae61p-1 +FE_DOWNWARD -0x1.e38ca211bd4adp-1 +FE_UPWARD -0x1.e38ca534ae61p-1 +FE_TOWARDZERO -0x1.e38ca534ae61p-1 + +Testing: (d1 = -(0x1.233445566778p0), d2 = -(0x1.3456789abcdep0f)) -> d1 / d2 +FE_TONEAREST 0x1.e38ca534ae61p-1 +FE_DOWNWARD 0x1.e38ca211bd4acp-1 +FE_UPWARD 0x1.e38ca534ae611p-1 +FE_TOWARDZERO 0x1.e38ca534ae61p-1 + +Testing: (d1 = (1.0), d2 = (0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST 0x1p-52 +FE_DOWNWARD 0x1p-52 +FE_UPWARD 0x1p-52 +FE_TOWARDZERO 0x1p-52 + +Testing: (d1 = -(1.0), d2 = (0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST 0x1p+1 +FE_DOWNWARD 0x1p+1 +FE_UPWARD 0x1.0000000000001p+1 +FE_TOWARDZERO 0x1p+1 + +Testing: (d1 = (1.0), d2 = -(0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST -0x1p+1 +FE_DOWNWARD -0x1.0000000000001p+1 +FE_UPWARD -0x1p+1 +FE_TOWARDZERO -0x1p+1 + +Testing: (d1 = -(1.0), d2 = -(0x1.0000000000001p0)) -> d2 - d1 +FE_TONEAREST -0x1p-52 +FE_DOWNWARD -0x1p-52 +FE_UPWARD -0x1p-52 +FE_TOWARDZERO -0x1p-52 + +Testing: (d1 = (1.0), d2 = (0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST 0x1.1000000000001p+0 +FE_DOWNWARD 0x1.1p+0 +FE_UPWARD 0x1.1000000000001p+0 +FE_TOWARDZERO 0x1.1p+0 + +Testing: (d1 = -(1.0), d2 = (0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST -0x1.dfffffffffffep-1 +FE_DOWNWARD -0x1.dffffffffffffp-1 +FE_UPWARD -0x1.dfffffffffffep-1 +FE_TOWARDZERO -0x1.dfffffffffffep-1 + +Testing: (d1 = (1.0), d2 = -(0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST 0x1.dfffffffffffep-1 +FE_DOWNWARD 0x1.dfffffffffffep-1 +FE_UPWARD 0x1.dffffffffffffp-1 +FE_TOWARDZERO 0x1.dfffffffffffep-1 + +Testing: (d1 = -(1.0), d2 = -(0x1.000000000000dp-4)) -> d1 + d2 +FE_TONEAREST -0x1.1000000000001p+0 +FE_DOWNWARD -0x1.1000000000001p+0 +FE_UPWARD -0x1.1p+0 +FE_TOWARDZERO -0x1.1p+0 + +Testing: (d1 = (1.0), d2 = (0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST 0x1.dfffffffffffep-1 +FE_DOWNWARD 0x1.dfffffffffffep-1 +FE_UPWARD 0x1.dffffffffffffp-1 +FE_TOWARDZERO 0x1.dfffffffffffep-1 + +Testing: (d1 = -(1.0), d2 = (0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST -0x1.1000000000001p+0 +FE_DOWNWARD -0x1.1000000000001p+0 +FE_UPWARD -0x1.1p+0 +FE_TOWARDZERO -0x1.1p+0 + +Testing: (d1 = (1.0), d2 = -(0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST 0x1.1000000000001p+0 +FE_DOWNWARD 0x1.1p+0 +FE_UPWARD 0x1.1000000000001p+0 +FE_TOWARDZERO 0x1.1p+0 + +Testing: (d1 = -(1.0), d2 = -(0x1.000000000000dp-4)) -> d1 - d2 +FE_TONEAREST -0x1.dfffffffffffep-1 +FE_DOWNWARD -0x1.dffffffffffffp-1 +FE_UPWARD -0x1.dfffffffffffep-1 +FE_TOWARDZERO -0x1.dfffffffffffep-1 + +Testing: (d1 = (1.0), d2 = (0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST -0x1.dfffffffffffep-1 +FE_DOWNWARD -0x1.dffffffffffffp-1 +FE_UPWARD -0x1.dfffffffffffep-1 +FE_TOWARDZERO -0x1.dfffffffffffep-1 + +Testing: (d1 = -(1.0), d2 = (0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST 0x1.1000000000001p+0 +FE_DOWNWARD 0x1.1p+0 +FE_UPWARD 0x1.1000000000001p+0 +FE_TOWARDZERO 0x1.1p+0 + +Testing: (d1 = (1.0), d2 = -(0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST -0x1.1000000000001p+0 +FE_DOWNWARD -0x1.1000000000001p+0 +FE_UPWARD -0x1.1p+0 +FE_TOWARDZERO -0x1.1p+0 + +Testing: (d1 = -(1.0), d2 = -(0x1.000000000000dp-4)) -> d2 - d1 +FE_TONEAREST 0x1.dfffffffffffep-1 +FE_DOWNWARD 0x1.dfffffffffffep-1 +FE_UPWARD 0x1.dffffffffffffp-1 +FE_TOWARDZERO 0x1.dfffffffffffep-1 + +Testing X87 instruction: "FSQRT" (ST0 = 0x1p+2, ST1 = 0x0p+0) +FE_TONEAREST ST0 = 0x1p+1 +FE_DOWNWARD ST0 = 0x1p+1 +FE_UPWARD ST0 = 0x1p+1 +FE_TOWARDZERO ST0 = 0x1p+1 + +Testing X87 instruction: "FSQRT" (ST0 = 0x1.0000000000001p+1, ST1 = 0x0p+0) +FE_TONEAREST ST0 = 0x1.6a09e667f3bcdp+0 +FE_DOWNWARD ST0 = 0x1.6a09e667f3bcdp+0 +FE_UPWARD ST0 = 0x1.6a09e667f3bcep+0 +FE_TOWARDZERO ST0 = 0x1.6a09e667f3bcdp+0 + +Testing X87 instruction: "FSQRT" (ST0 = 0x1.123456789abcp+31, ST1 = 0x0p+0) +FE_TONEAREST ST0 = 0x1.76b0aac9e6a5p+15 +FE_DOWNWARD ST0 = 0x1.76b0aac9e6a4fp+15 +FE_UPWARD ST0 = 0x1.76b0aac9e6a5p+15 +FE_TOWARDZERO ST0 = 0x1.76b0aac9e6a4fp+15 + +Testing X87 instruction: "FSQRT" (ST0 = 0x1.123456789abdp+31, ST1 = 0x0p+0) +FE_TONEAREST ST0 = 0x1.76b0aac9e6a5bp+15 +FE_DOWNWARD ST0 = 0x1.76b0aac9e6a5ap+15 +FE_UPWARD ST0 = 0x1.76b0aac9e6a5bp+15 +FE_TOWARDZERO ST0 = 0x1.76b0aac9e6a5ap+15 + diff --git a/tests32/roundtest.h b/tests32/roundtest.h new file mode 100644 index 0000000..320e22c --- /dev/null +++ b/tests32/roundtest.h @@ -0,0 +1,114 @@ +#pragma STDC FENV_ACCESS ON +#include +#include + +#ifdef USE_ASM_ROUNDING +int fesetround_(int rounding_direction) { + uint16_t old_cw; + __asm__("FNSTCW %0" : "=m"(old_cw)::); + uint16_t new_cw = (old_cw & ~0xc00) | rounding_direction; + __asm__("FLDCW %0" ::"m"(new_cw)); + return old_cw & 0xc00; +} +int fegetround_() { + uint16_t cw; + __asm__("FNSTCW %0" : "=m"(cw)::); + return cw & 0xc00; +} +#define fesetround fesetround_ +#define fegetround fegetround_ +#define FE_TONEAREST 0 +#define FE_DOWNWARD 0x400 +#define FE_UPWARD 0x800 +#define FE_TOWARDZERO 0xc00 +#else +#include +#endif + +#define FE_TONEAREST_INDEX 0 +#define FE_DOWNWARD_INDEX 1 +#define FE_UPWARD_INDEX 2 +#define FE_TOWARDZERO_INDEX 3 +int FE_MODES[] = {FE_TONEAREST, FE_DOWNWARD, FE_UPWARD, FE_TOWARDZERO}; +char *FE_MODES_STR[] = { + "FE_TONEAREST", + "FE_DOWNWARD", + "FE_UPWARD", + "FE_TOWARDZERO", +}; + +void assert_round(double *array) { + assert(array[FE_DOWNWARD_INDEX] <= array[FE_TONEAREST_INDEX]); + assert(array[FE_TONEAREST_INDEX] <= array[FE_UPWARD_INDEX]); + if (array[FE_TOWARDZERO_INDEX] < 0) + assert(array[FE_TOWARDZERO_INDEX] == array[FE_UPWARD_INDEX]); + else if (array[FE_TOWARDZERO_INDEX] > 0) + assert(array[FE_TOWARDZERO_INDEX] == array[FE_DOWNWARD_INDEX]); + else if (array[FE_TOWARDZERO_INDEX] == 0) + assert(array[FE_TOWARDZERO_INDEX] == array[FE_UPWARD_INDEX] || + array[FE_TOWARDZERO_INDEX] == array[FE_DOWNWARD_INDEX]); +} + +#define TEST_(exec, expr, format) \ + do { \ + if (sizeof(#exec) == 1) \ + printf("Testing: %s\n", #expr); \ + else \ + printf("Testing: %s -> %s\n", #exec, #expr); \ + for (int i = 0; i < sizeof(FE_MODES) / sizeof(FE_MODES[0]); i++) { \ + fesetround(FE_MODES[i]); \ + exec; \ + printf("%-15s" format "\n", FE_MODES_STR[i], expr); \ + assert(FE_MODES[i] == fegetround()); \ + } \ + printf("\n"); \ + } while (0) + +#define TEST(exec, expr) TEST_(exec, expr, "%a") + +#if defined(i386) || defined(__i386__) || defined(__i386) || \ + defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) +#define TEST_X87(instruction, st0, st1, deep_change) \ + do { \ + double _st0 = (st0), _st1 = (st1); \ + double array1[4], array2[4]; \ + double __st0, __st1; \ + printf("Testing X87 instruction: %s (ST0 = %a, ST1 = %a)\n", #instruction, \ + _st0, _st1); \ + for (int i = 0; i < sizeof(FE_MODES) / sizeof(FE_MODES[0]); i++) { \ + fesetround(FE_MODES[i]); \ + __st0 = _st0, __st1 = _st1; \ + switch (deep_change) { \ + case -1: /* the instruction pops */ \ + __asm__(instruction : "+t"(__st0) : "u"(__st1) : "st(1)"); \ + printf("%-15s ST0 = %a\n", FE_MODES_STR[i], __st0); \ + break; \ + case 0: \ + __asm__(instruction : "+t"(__st0) : "u"(__st1) :); \ + printf("%-15s ST0 = %a\n", FE_MODES_STR[i], __st0); \ + break; \ + case 1: /* the instruction pushes */ \ + __asm__(instruction : "+t"(__st0), "=u"(__st1)::); \ + printf("%-15s ST0 = %a, ST1 = %a\n", FE_MODES_STR[i], __st0, __st1); \ + array2[i] = __st1; \ + } \ + array1[i] = __st0; \ + assert(FE_MODES[i] == fegetround()); \ + } \ + if (deep_change == 1) \ + assert_round(array2); \ + assert_round(array1); \ + printf("\n"); \ + } while (0) +#else +#define TEST_X87(instruction, st0, st1, deep_change) \ + do { \ + double _st0 = (st0), _st1 = (st1); \ + printf("Cannot test X87 instruction: %s (ST0 = %a, ST1 = %a) because it " \ + "is not compiled to x86\n\n", \ + #instruction, _st0, _st1); \ + } while (0) +#endif + +#define TEST_X87_1(i, st0) TEST_X87(i, st0, 0.0, 0) +#define TEST_X87_2(i, st0, st1) TEST_X87(i, st0, st1, -1) diff --git a/tests32/test01.c b/tests32/test01.c new file mode 100644 index 0000000..3cf91ce --- /dev/null +++ b/tests32/test01.c @@ -0,0 +1,19 @@ +#include +#include + +int main(int argc, char **argv) +{ + const char msg[] = "Hello World!\n"; + //syscall(4, STDOUT_FILENO, msg, sizeof(msg)-1); + asm ( + "movl $4, %%eax \n" + "movl $1, %%ebx \n" + "movl %0, %%ecx \n" + "movl $13, %%edx \n" + "int $0x80 \n" + : + :"r" (msg) + :"%eax","%ebx","%ecx","%edx" + ); + return 0; +} diff --git a/tests32/test02.c b/tests32/test02.c new file mode 100644 index 0000000..2ef0ed4 --- /dev/null +++ b/tests32/test02.c @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char **argv) +{ + const char msg[] = "Hello World!\n"; + syscall(4, STDOUT_FILENO, msg, sizeof(msg)-1); + return 0; +} diff --git a/tests32/test03.c b/tests32/test03.c new file mode 100644 index 0000000..fb5dcd8 --- /dev/null +++ b/tests32/test03.c @@ -0,0 +1,7 @@ +#include + +int main(int argc, char **argv) +{ + printf("Hello World!\n"); + return 0; +} diff --git a/tests32/test04.c b/tests32/test04.c new file mode 100644 index 0000000..520360e --- /dev/null +++ b/tests32/test04.c @@ -0,0 +1,7 @@ +#include + +int main(int argc, char **argv) +{ + printf("Hello, argc=%d argv[%d]=%s\n", argc, argc-1, argv[argc-1]); + return 0; +} diff --git a/tests32/test05.c b/tests32/test05.c new file mode 100755 index 0000000..c6a4e67 --- /dev/null +++ b/tests32/test05.c @@ -0,0 +1,62 @@ +#include +#include +#include +#include + +int fact(int i) { + if (i<2) return i; + return i*fact(i-1); +} + +#define SET(M) dels[M/8] |= (1<<(M%8)) +#define GET(M) ((dels[M/8]>>(M%8))&1) + +int main(int argc, const char** argv) +{ + int j = 5; + if(argc>1) + j = atoi(argv[1]); + if(j==0) + j=5; + if(j>15) j=15; + + int k = fact(j); + printf("fact(%d)=%d\n", j, k); + + uint8_t* dels = (char*)calloc((k+7)/8, 1); + SET(0); + SET(1); + + for (int i=2; i +#include +#include +#include + +const int thread_count = 2; +pthread_t tid[2]; +const char *thread_messages[2] = { + "First thread executing", + "Second thread executing" +}; + +void *doSomething(void *arg) +{ + pthread_t id = pthread_self(); + int num = -1; + + for (int i = 0 ; i < thread_count ; ++i) + { + if (pthread_equal(id, tid[i])) + { + num = i + 1; + if (num == 2) printf("[%02d] %s\n", num, thread_messages[i]); + break; + } + } + + for (unsigned int i = 0 ; i < 0x10000 ; ++i); + if (num == 2) printf("[%02d] Thread done.\n", num); + + return NULL; +} + +int main(int argc, char const *argv[]) +{ + int err; + + for (int i = 0 ; i < thread_count ; ++i) + { + //printf("[00] Thread %d starting\n", i + 1); + err = pthread_create(&tid[i], NULL, doSomething, NULL); + if (err) + { + printf("[00] Couldn't create thread %d: %s\n", i + 1, strerror(err)); + } + for (unsigned int i = 0 ; i < 0x1000 ; ++i); + } + + //printf("[00] Waiting for all threads to end...\n"); + for (int i = 0 ; i < thread_count ; ++i) + pthread_join(tid[i], NULL); + printf("\n[00] Done.\n"); + + return 0; +} diff --git a/tests32/test07.c b/tests32/test07.c new file mode 100644 index 0000000..a20936f --- /dev/null +++ b/tests32/test07.c @@ -0,0 +1,20 @@ +#include +#include + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +int main(int argc, char **argv) +{ + long double zero = 0.0; + + double si = sin(M_PI / 2.0); + + int a = 3; + float b = 1.5; + float mul = a * b; + + printf("0 is %Lf, sin(pi/2) is %f and 3*1.5 is %f.\n", zero, si, mul); + return 0; +} diff --git a/tests32/test08.c b/tests32/test08.c new file mode 100755 index 0000000..f5f5bce --- /dev/null +++ b/tests32/test08.c @@ -0,0 +1,36 @@ +#include +#include + +//from https://crypto.stanford.edu/pbc/notes/pi/code.html +// 800 first decimals of PI + +int main() { + int r[2800 + 1]; + int i, k; + int b, d; + int c = 0; + + for (i = 0; i < 2800; i++) { + r[i] = 2000; + } + + for (k = 2800; k > 0; k -= 14) { + d = 0; + + i = k; + for (;;) { + d += r[i] * 10000; + b = 2 * i - 1; + + r[i] = d % b; + d /= b; + i--; + if (i == 0) break; + d *= i; + } + printf("%.4d", c + d / 10000); + c = d % 10000; + } + + return 0; +} \ No newline at end of file diff --git a/tests32/test09.c b/tests32/test09.c new file mode 100755 index 0000000..e4a5605 --- /dev/null +++ b/tests32/test09.c @@ -0,0 +1,20 @@ +#include +#include +#include + +void forkexample() +{ + int x = 1; + + if (fork() == 0) + printf("Child has x = %d\n", ++x); + else { + usleep(20000); + printf("Parent has x = %d\n", --x); + } +} +int main() +{ + forkexample(); + return 0; +} \ No newline at end of file diff --git a/tests32/test10.cpp b/tests32/test10.cpp new file mode 100644 index 0000000..f3c6131 --- /dev/null +++ b/tests32/test10.cpp @@ -0,0 +1,27 @@ +// using atomic as a lock +#include // std::cout +#include // std::atomic +#include // std::thread +#include // std::vector +#include // std::stringstream + +std::atomic lock_stream[10]; +std::stringstream stream; + +void append_number(int x) { + while (lock_stream[x].load()) {} + stream << "thread #" << x << '\n'; + if (x != 9) lock_stream[x + 1].store(false); +} + +int main () +{ + std::vector threads; + for (int i = 0; i < 10; ++i) lock_stream[i].store(true); + for (int i=0; i<10; ++i) threads.push_back(std::thread(append_number,i)); + lock_stream[0].store(false); + for (auto& th : threads) th.join(); + + std::cout << stream.str(); + return 0; +} diff --git a/tests32/test11.c b/tests32/test11.c new file mode 100644 index 0000000..c40edeb --- /dev/null +++ b/tests32/test11.c @@ -0,0 +1,131 @@ +#define _MULTI_THREADED +#include +#include +#include +#include +#include + +void foo(void); /* Functions that use the TLS data */ +void bar(void); + +#define checkResults(string, val) { \ + if (val) { \ + printf("Failed with %d at %s", val, string); \ + exit(1); \ + } \ +} + +/* + Use the keyword provided by pthread.h to delcare the following variable + is thread specific, i.e. it is only visible to a specific thread, + not shared/common to all thread. + These variables are stored in thread local storage (TLS) area. + */ +__thread int TLS_data1 = 10; +__thread int TLS_data2 = 20; +__thread char TLS_data3[10]; + +// Sync, because it's needed apparently... +static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t* mutex_ptr = &mutex; +static pthread_cond_t thread_state_cond = PTHREAD_COND_INITIALIZER; +static pthread_cond_t* thread_state_cond_ptr = &thread_state_cond; +static int status = 0; + +#define NUMTHREADS 2 +pthread_t thread[NUMTHREADS]; + +typedef struct { + int data1; + int data2; +} threadparm_t; + +void *thread_run(void *parm) +{ + int rc; + threadparm_t *gData; + + pthread_mutex_lock(mutex_ptr); + if (pthread_self()==thread[0]) { + printf("Thread 1: Entered (%d/%d)\n", TLS_data1, TLS_data2); + fflush(stdout); + } else { + while (!status) pthread_cond_wait(thread_state_cond_ptr, mutex_ptr); + printf("Thread 2: Entered (%d/%d)\n", TLS_data1, TLS_data2); + fflush(stdout); + status = 0; + pthread_mutex_unlock(mutex_ptr); + pthread_cond_broadcast(thread_state_cond_ptr); + } + + gData = (threadparm_t *)parm; + + /* Assign the value from global variable to thread specific variable*/ + TLS_data1 = gData->data1; + TLS_data2 = gData->data2; + strcpy(TLS_data3, "---"); + TLS_data3[1] = (pthread_self()==thread[0])?'1':'2'; + + foo(); + return NULL; +} + +void foo() { + if (pthread_self()==thread[0]) { + printf("Thread 1: foo(), TLS data=%d %d \"%s\"\n", TLS_data1, TLS_data2, TLS_data3); + fflush(stdout); + status = 1; + pthread_cond_broadcast(thread_state_cond_ptr); + while (status) pthread_cond_wait(thread_state_cond_ptr, mutex_ptr); + pthread_mutex_unlock(mutex_ptr); + } else { + printf("Thread 2: foo(), TLS data=%d %d \"%s\"\n", TLS_data1, TLS_data2, TLS_data3); + fflush(stdout); + } + while(!thread[1]) + usleep(300); + if(pthread_self()==thread[0]) + pthread_join(thread[1], NULL); + bar(); +} + +void bar() { + printf("Thread %d: bar(), TLS data=%d %d \"%s\"\n", + (pthread_self()==thread[0])?1:2, TLS_data1, TLS_data2, TLS_data3); + fflush(stdout); + return; +} + +int main(int argc, char **argv) +{ + int rc=0; + int i; + threadparm_t gData[NUMTHREADS]; + + printf("Create/start %d threads\n", NUMTHREADS); + fflush(stdout); + for (i=0; i < NUMTHREADS; i++) { + /* Create per-thread TLS data and pass it to the thread */ + gData[i].data1 = i; + gData[i].data2 = (i+1)*2; + rc = pthread_create(&thread[i], NULL, thread_run, &gData[i]); + checkResults("pthread_create()\n", rc); + } + + //printf("Wait for all threads to complete, and release their resources\n"); + for (i=0; i < NUMTHREADS; i++) { + rc = pthread_join(thread[i], NULL); + //checkResults("pthread_join()\n", rc); + } + + thread_state_cond_ptr = NULL; + i = pthread_cond_destroy(&thread_state_cond); + checkResults("destroying cond\n", i); + mutex_ptr = NULL; + i = pthread_mutex_destroy(&mutex); + checkResults("destroying mutex\n", i); + + printf("Main completed\n"); + fflush(stdout); + return 0; +} diff --git a/tests32/test12.c b/tests32/test12.c new file mode 100755 index 0000000..4892a10 --- /dev/null +++ b/tests32/test12.c @@ -0,0 +1,35 @@ +#include +#include +#include + +typedef uint32_t uint32; +typedef uint32 angle_t; + +int main(int argc, char **argv) +{ + int64_t i64 = 1000000000000; + double d = i64; + printf("%lli => %f\n", i64, d); + i64 = -i64; + d = i64; + printf("%lli => %f\n", i64, d); + + d = M_PI/4.0; + d = d*(1<<30)/M_PI; + angle_t u32 = (angle_t)d; + printf("(angle_t)%f = %u == 0x%08X\n", d, u32, u32); + + int16_t a=0, b=0; + asm volatile ( + "fldpi \n" + "fisttp %0 \n" + : "=m" (a)); + asm volatile ( + "fldpi \n" + "fchs \n" + "fistp %0 \n" + : "=m" (b)); + printf("go PI trucated=%d, -PI rounded=%d\n", a, b); + + return 0; +} diff --git a/tests32/test13.c b/tests32/test13.c new file mode 100644 index 0000000..38dd891 --- /dev/null +++ b/tests32/test13.c @@ -0,0 +1,54 @@ +#include +#include +#include + +static ucontext_t uctx_main, uctx_func1, uctx_func2; + +#define handle_error(msg) \ + do { perror(msg); exit(EXIT_FAILURE); } while (0) + +static void func1(void) +{ + printf("func1: started\n"); + printf("func1: swapcontext(&uctx_func1, &uctx_func2)\n"); + if (swapcontext(&uctx_func1, &uctx_func2) == -1) + handle_error("swapcontext"); + printf("func1: returning\n"); +} + +static void func2(int a, int b) +{ + printf("func2: started (%d, %d)\n", a, b); + printf("func2: swapcontext(&uctx_func2, &uctx_func1)\n"); + if (swapcontext(&uctx_func2, &uctx_func1) == -1) + handle_error("swapcontext"); + printf("func2: returning\n"); +} + +int main(int argc, char *argv[]) +{ + char func1_stack[16384]; + char func2_stack[16384]; + + if (getcontext(&uctx_func1) == -1) + handle_error("getcontext"); + uctx_func1.uc_stack.ss_sp = func1_stack; + uctx_func1.uc_stack.ss_size = sizeof(func1_stack); + uctx_func1.uc_link = &uctx_main; + makecontext(&uctx_func1, func1, 0); + + if (getcontext(&uctx_func2) == -1) + handle_error("getcontext"); + uctx_func2.uc_stack.ss_sp = func2_stack; + uctx_func2.uc_stack.ss_size = sizeof(func2_stack); + /* Successor context is f1(), unless argc > 1 */ + uctx_func2.uc_link = (argc > 1) ? NULL : &uctx_func1; + makecontext(&uctx_func2, func2, 2, 1, 2); + + printf("main: swapcontext(&uctx_main, &uctx_func2)\n"); + if (swapcontext(&uctx_main, &uctx_func2) == -1) + handle_error("swapcontext"); + + printf("main: exiting\n"); + exit(EXIT_SUCCESS); +} \ No newline at end of file diff --git a/tests32/test14.c b/tests32/test14.c new file mode 100755 index 0000000..65702be --- /dev/null +++ b/tests32/test14.c @@ -0,0 +1,111 @@ +// Code from https://martin.uy/blog/pthread_cancel-glibc-stack-unwinding/ +#include +#include +#include +#include + +static pthread_mutex_t mutex; +static pthread_mutex_t* mutex_ptr = NULL; +static pthread_cond_t thread_state_cond; +static pthread_cond_t* thread_state_cond_ptr = NULL; +static int thread_state = 0; // Sync + +void thread_cleanup(void* args) { + pthread_mutex_lock(mutex_ptr); + printf("Thread: thread_state = 2.\n"); + thread_state = 2; + pthread_cond_broadcast(thread_state_cond_ptr); + pthread_mutex_unlock(mutex_ptr); +} + +static void thread_f(void) { + int ret = -1; + pthread_mutex_lock(mutex_ptr); + printf("Thread: thread_state = 1.\n"); + thread_state = 1; + pthread_cond_broadcast(thread_state_cond_ptr); + pthread_mutex_unlock(mutex_ptr); + while (1) { + sleep(1000); + } +} + +static void* thread_main(void* args) { + pthread_cleanup_push(&thread_cleanup, NULL); + thread_f(); + // This should never be executed + pthread_cleanup_pop(0); + return NULL; +} + +int main(void) { + int ret = 0; + pthread_t thread; + pthread_attr_t thread_attributes; + pthread_attr_t* thread_attributes_ptr = NULL; + + if (pthread_mutex_init(&mutex, NULL) != 0) + goto error; + mutex_ptr = &mutex; + + if (pthread_cond_init(&thread_state_cond, NULL) != 0) + goto error; + thread_state_cond_ptr = &thread_state_cond; + + if (pthread_attr_init(&thread_attributes) != 0) + goto error; + + thread_attributes_ptr = &thread_attributes; + + if (pthread_create(&thread, thread_attributes_ptr, &thread_main, NULL) != 0) + goto error; + + thread_attributes_ptr = NULL; + if (pthread_attr_destroy(&thread_attributes) != 0) + goto error; + + // Wait for thread to go deep into the call stack + pthread_mutex_lock(mutex_ptr); + while (thread_state != 1) + pthread_cond_wait(thread_state_cond_ptr, mutex_ptr); + printf("Main thread: thread_state == 1.\n"); + pthread_mutex_unlock(mutex_ptr); + + if (pthread_cancel(thread) != 0) + goto error; + + // Wait for thread to execute the cleanup function + pthread_mutex_lock(mutex_ptr); + while (thread_state != 2) + pthread_cond_wait(thread_state_cond_ptr, mutex_ptr); + printf("Main thread: thread_state == 2.\n"); + pthread_mutex_unlock(mutex_ptr); + + thread_state_cond_ptr = NULL; + if (pthread_cond_destroy(&thread_state_cond) != 0) + goto error; + + mutex_ptr = NULL; + if (pthread_mutex_destroy(&mutex) != 0) + goto error; + + goto cleanup; + +error: + ret = -1; + +cleanup: + if (thread_attributes_ptr != NULL) + pthread_attr_destroy(thread_attributes_ptr); + if (thread_state_cond_ptr != NULL) + pthread_cond_destroy(thread_state_cond_ptr); + if (mutex_ptr != NULL) + pthread_mutex_destroy(mutex_ptr); + + if (ret == -1) + printf("Finished with errors.\n"); + else + printf("Finished with no errors.\n"); + + return ret; +} diff --git a/tests32/test15.c b/tests32/test15.c new file mode 100644 index 0000000..34f9140 --- /dev/null +++ b/tests32/test15.c @@ -0,0 +1,32 @@ +/* + * Compile with (on x86_64 archs): + * gcc -m32 -DV1 -shared -o test15_v1.so test15.c + * gcc -m32 -DV2 -shared -o test15_v2.so test15.c -Wl,--version-script=test15_version.map + * gcc -m32 -shared -o test15_dv1.so test15.c -L. -Wl,-z,origin,-rpath='$ORIGIN' -l:test15_v1.so + * gcc -m32 -DMAIN -o test15 test15.c -L. -Wl,-z,origin,-rpath='$ORIGIN' -l:test15_dv1.so -l:test15_v2.so + */ + +#if defined(MAIN) +int returnVersion(); +int acquireVersion1(); +int acquireVersion2(); +#include + +int main(int argc, char **argv) { printf("%d, %d/%d\n", returnVersion(), acquireVersion1(), acquireVersion2()); return 0; } + +#elif defined(V2) +int __attribute__((noinline)) getVersion() { asm(""); return 2; } +int returnVersion() { return getVersion(); } + +#elif defined(V1) +int __attribute__((noinline)) getVersion() { asm(""); return 1; } +int acquireVersion() { return getVersion(); } + +#else +int getVersion(); +int acquireVersion(); + +int acquireVersion1() { return getVersion(); } +int acquireVersion2() { return acquireVersion(); } + +#endif diff --git a/tests32/test16.c b/tests32/test16.c new file mode 100644 index 0000000..6dc4023 --- /dev/null +++ b/tests32/test16.c @@ -0,0 +1,32 @@ +/* + * Compile with (on x86_64 archs): + * gcc -m32 -DV1 -shared -o test16_v1.so test16.c -Wl,--version-script=test16_version.map + * gcc -m32 -DV2 -shared -o test16_v2.so test16.c + * gcc -m32 -shared -o test16_dv1.so test16.c -L. -Wl,-z,origin,-rpath='$ORIGIN' -l:test16_v1.so + * gcc -m32 -DMAIN -o test16 test16.c -L. -Wl,-z,origin,-rpath='$ORIGIN' -l:test16_dv1.so -l:test16_v2.so + */ + +#if defined(MAIN) +int returnVersion(); +int acquireVersion1(); +int acquireVersion2(); +#include + +int main(int argc, char **argv) { printf("%d, %d/%d\n", returnVersion(), acquireVersion1(), acquireVersion2()); return 0; } + +#elif defined(V1) +int __attribute__((noinline)) getVersion() { asm(""); return 1; } +int acquireVersion() { return getVersion(); } + +#elif defined(V2) +int __attribute__((noinline)) getVersion() { asm(""); return 2; } +int returnVersion() { return getVersion(); } + +#else +int getVersion(); +int returnVersion(); + +int acquireVersion1() { return getVersion(); } +int acquireVersion2() { return returnVersion(); } + +#endif diff --git a/tests32/test17.c b/tests32/test17.c new file mode 100644 index 0000000..afb7905 --- /dev/null +++ b/tests32/test17.c @@ -0,0 +1,556 @@ +// build with gcc -O0 -g -msse -msse2 -mssse3 -msse4.1 test17.c -o test17 +// and -m32 for 32bits version +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef unsigned char u8x16 __attribute__ ((vector_size (16))); +typedef unsigned short u16x8 __attribute__ ((vector_size (16))); +typedef unsigned int u32x4 __attribute__ ((vector_size (16))); +typedef unsigned long long int u64x2 __attribute__ ((vector_size (16))); +typedef float f32x4 __attribute__ ((vector_size (16))); +typedef double d64x2 __attribute__ ((vector_size (16))); + +typedef union { + __m128i mm; + __m128 mf; + __m128d md; + u8x16 u8; + u16x8 u16; + u32x4 u32; + u64x2 u64; + f32x4 f32; + d64x2 d64; +} v128; + +uint64_t _ucomiss_(float a, float b) +{ + uint64_t ret = 0x202; + v128 va, vb; + va.f32[0] = a; + vb.f32[0] = b; + if(_mm_ucomigt_ss(va.mf, vb.mf)) + ret |= 0x000; + else if(_mm_ucomilt_ss(va.mf, vb.mf)) + ret |= 0x001; + else if(_mm_ucomieq_ss(va.mf, vb.mf)) + ret |= 0x040; + else + ret |= 0x045; + return ret; +} + +uint64_t _minss_(float a, float b) +{ + v128 va, vb, ret; + va.f32[0] = a; + vb.f32[0] = b; + ret.mf = _mm_min_ss(va.mf, vb.mf); + return ret.u64[0]; +} +uint64_t _maxss_(float a, float b) +{ + v128 va, vb, ret; + va.f32[0] = a; + vb.f32[0] = b; + ret.mf = _mm_max_ss(va.mf, vb.mf); + return ret.u64[0]; +} + +#define CMPSS(A, B) \ +uint64_t _cmpss_##A(float a, float b) \ +{ \ + v128 va, vb, ret; \ + va.f32[0] = a; \ + vb.f32[0] = b; \ + ret.mf = _mm_cmp##B##_ss(va.mf, vb.mf); \ + return ret.u64[0]; \ +} +CMPSS(0, eq) +CMPSS(1, lt) +CMPSS(2, le) +CMPSS(3, unord) +CMPSS(4, neq) +CMPSS(5, nlt) +CMPSS(6, nle) +CMPSS(7, ord) +#undef CMPSS + +const v128 a128_8 = {.u8 = { + 0xff, 0x80, 0x7f, 0x00, 0x01, 0x02, 0x03, 0x81, + 0xfe, 0x84, 0x72, 0x52, 0xa5, 0x00, 0xc0, 0x32 +}}; +const v128 a128_16 = {.u16 = { + 0xffff, 0x8000, 0x7fff, 0x0000, 0x0001, 0x0002, 0x0003, 0x8001 +}}; +const v128 a128_32 = {.u32 = { + 0xffffffff, 0x80000000, 0x7fffffff, 0x00000000 +}}; +const v128 a128_64 = {.u64 = { + 0xffffffffffffffffLL, 0x8000000000000000LL +}}; + +const v128 b128_8 = {.u8 = { + 0x00, 0x01, 0x05, 0x15, 0x20, 0x80, 0xff, 0x00, + 0x08, 0x07, 0x81, 0x06, 0x0a, 0x0f, 0x10, 0x01 +}}; +const v128 b128_16 = {.u16 = { + 0x8000, 0x7fff, 0xffff, 0xffff, 0x0050, 0x9000, 0xfffe, 0x8001 +}}; +const v128 b128_32 = {.u32 = { + 0x00000001, 0x80000000, 0x00000005, 0xfffffffe +}}; +const v128 b128_64 = {.u64 = { + 0x0000000000000001LL, 0x8000000000000000LL +}}; +const v128 c128_32 = {.u32 = { + 0x00000001, 0x80000000, 0x80000005, 0x0000fffe +}}; + +const v128 a128_pd = {.d64 = { 1.0, 2.0}}; +const v128 b128_pd = {.d64 = { 0.0, -2.0}}; +const v128 c128_pd = {.d64 = { INFINITY, -INFINITY}}; +const v128 d128_pd = {.d64 = { NAN, -0.0}}; +const v128 a128_ps = {.f32 = { 1.0, 2.0, 3.0, -4.0}}; +const v128 b128_ps = {.f32 = { 0.0, -2.0, -10.0, 0.5}}; +const v128 c128_ps = {.f32 = { INFINITY, -INFINITY, -INFINITY, 1.0}}; +const v128 d128_ps = {.f32 = { NAN, -0.0, -NAN, INFINITY}}; + +v128 reverse_pd(v128 a) { + v128 ret; + ret.md = _mm_shuffle_pd(a.md, a.md, 1); + return ret; +} + +void print_8(v128 v) { + for(int i=0; i<16; ++i) + printf("0x%x ", v.u8[i]); +} +void print_16(v128 v) { + for(int i=0; i<8; ++i) + printf("0x%x ", v.u16[i]); +} +void print_32(v128 v) { + for(int i=0; i<4; ++i) + printf("0x%x ", v.u32[i]); +} +void print_64(v128 v) { + for(int i=0; i<2; ++i) + printf("0x%"PRIx64" ", v.u64[i]); +} +#define print_128 print_64 +void print_ps(v128 v) { + for(int i=0; i<4; ++i) + if(isnanf(v.f32[i])) + printf("nan "); + else + printf("%g ", v.f32[i]); +} +void print_pd(v128 v) { + for(int i=0; i<2; ++i) + if(isnan(v.d64[i])) + printf("0x%"PRIx64" ", v.u64[i]); + else + printf("%g ", v.d64[i]); +} +#define print_sd print_pd + +int main(int argc, const char** argv) +{ + float a, b; + uint32_t flags; + uint32_t maxf = 0x7f7fffff; + uint32_t minf = 0xff7fffff; + uint32_t r; + float values[] = {1.0f, 2.0f, 0.0f, -0.0f, -1.0f, *(float*)&maxf, *(float*)&minf, INFINITY, -INFINITY, NAN}; + int n_f = sizeof(values)/sizeof(values[0]); + +#define GO1(A, N) \ +for(int i=0; i 0x%"PRIx32"\n", a, b, flags); \ + } + +#define GO2(A, N) \ +for(int i=0; i %g\n", a, b, *(float*)&r); \ + } + + GO1(_ucomiss_, "ucomiss") + GO2(_minss_, "minss") + GO2(_maxss_, "maxss") + GO1(_cmpss_0, "cmpss 0") + GO1(_cmpss_1, "cmpss 1") + GO1(_cmpss_2, "cmpss 2") + GO1(_cmpss_3, "cmpss 3") + GO1(_cmpss_4, "cmpss 4") + GO1(_cmpss_5, "cmpss 5") + GO1(_cmpss_6, "cmpss 6") + GO1(_cmpss_7, "cmpss 7") + + #undef GO1 + #undef GO2 + v128 a128; + int i; + + #define GO1(A, N, C) \ + a128.mm = _mm_##A##_epi##N(a128_##N.mm); \ + printf("%s(", #C); print_##N(a128_##N); \ + printf(") = "); print_##N(a128); printf("\n"); + #define GO1C(A, N, C, A1, I) \ + a128.mm = _mm_##A##_epi##N(A1.mm, I); \ + printf("%s(", #C); print_##N(A1); \ + printf("%d) = ", I); print_##N(a128); printf("\n"); + #define GO2(A, N, C, A1, A2) \ + a128.mm = _mm_##A##_epi##N(A1.mm, A2.mm); \ + printf("%s(", #C); print_##N(A1); \ + printf(", "); print_##N(A2); \ + printf(") = "); print_##N(a128); printf("\n"); + #define GO2u(A, N, C, A1, A2) \ + a128.mm = _mm_##A##_epu##N(A1.mm, A2.mm); \ + printf("%s(", #C); print_##N(A1); \ + printf(", "); print_##N(A2); \ + printf(") = "); print_##N(a128); printf("\n"); + #define GO2f(A, C, A1, A2) \ + a128.mm = _mm_##A##_si128(A1.mm, A2.mm); \ + printf("%s(", #C); print_128(A1); \ + printf(", "); print_128(A2); \ + printf(") = "); print_128(a128); printf("\n"); + #define GO2C(A, N, C, A1, A2, I) \ + a128.mm = _mm_##A##_epi##N(A1.mm, A2.mm, I); \ + printf("%s(", #C); print_##N(A1); \ + printf(", "); print_##N(A2); \ + printf("%d) = ", I); print_##N(a128); printf("\n"); + #define GO2i(A, A1, A2) \ + i = _mm_##A##_si128(A1.mm, A2.mm); \ + printf("p%s(", #A); print_64(A1); \ + printf(", "); print_64(A2); \ + printf(") = %d\n", i); + #define GO3PS(A, N, A1, A2, A3) \ + a128.mf = _mm_##A##_ps(A1.mf, A2.mf, A3.mf); \ + printf("p%s%s(", #A, "ps"); print_##N(A1); \ + printf(", "); print_##N(A2); \ + printf(", "); print_##N(A3); \ + printf(") = "); print_##N(a128); printf("\n"); + #define GO1ipd(A, C, A1) \ + i = _mm_##A##_pd(A1.md); \ + printf("%s(", #C); print_64(A1); \ + printf(") = 0x%x\n", i); + #define GO1pd(A, C, A1) \ + a128.md = _mm_##A##_pd(A1.md); \ + printf("%s(", #C); print_pd(A1); \ + printf(") = "); print_pd(a128); printf("\n"); + #define GO2pd(A, C, A1, A2) \ + a128.md = _mm_##A##_pd(A1.md, A2.md); \ + printf("%s(", #C); print_pd(A1); \ + printf(", "); print_pd(A2); \ + printf(") = "); print_pd(a128); printf("\n"); + #define GO2Cpd(A, C, A1, A2, I) \ + a128.md = _mm_##A##_pd(A1.md, A2.md, I); \ + printf("%s(", #C); print_pd(A1); \ + printf(", "); print_pd(A2); \ + printf(", %d) = ", I); print_pd(a128); printf("\n"); + #define GO1isd(A, C, A1) \ + i = _mm_##A##_sd(A1.md); \ + printf("%s(", #C); print_64(A1); \ + printf(") = 0x%x\n", i); + #define GO1sd(A, C, A1) \ + a128.md = _mm_##A##_sd(A1.md); \ + printf("%s(", #C); print_sd(A1); \ + printf(") = "); print_sd(a128); printf("\n"); + #define GO2sd(A, C, A1, A2) \ + a128.md = _mm_##A##_sd(A1.md, A2.md); \ + printf("%s(", #C); print_sd(A1); \ + printf(", "); print_sd(A2); \ + printf(") = "); print_sd(a128); printf("\n"); + #define GO2Csd(A, C, A1, A2, I) \ + a128.md = _mm_##A##_sd(A1.md, A2.md, I); \ + printf("%s(", #C); print_sd(A1); \ + printf(", "); print_sd(A2); \ + printf(", %d) = ", I); print_sd(a128); printf("\n"); + #define GO1ips(A, C, A1) \ + i = _mm_##A##_ps(A1.mf); \ + printf("%s(", #C); print_32(A1); \ + printf(") = 0x%x\n", i); + #define GO1ps(A, C, A1) \ + a128.mf = _mm_##A##_ps(A1.mf); \ + printf("%s(", #C); print_ps(A1); \ + printf(") = "); print_ps(a128); printf("\n"); + #define GO2ps(A, C, A1, A2) \ + a128.mf = _mm_##A##_ps(A1.mf, A2.mf); \ + printf("%s(", #C); print_ps(A1); \ + printf(", "); print_ps(A2); \ + printf(") = "); print_ps(a128); printf("\n"); + #define GO2Cps(A, C, A1, A2, I) \ + a128.mf = _mm_##A##_ps(A1.mf, A2.mf, I); \ + printf("%s(", #C); print_ps(A1); \ + printf(", "); print_ps(A2); \ + printf(", %d) = ", I); print_ps(a128); printf("\n"); + #define GO1ps2dq(A, C, A1) \ + a128.mm = _mm_##A##_epi32(A1.mf); \ + printf("%s(", #C); print_ps(A1); \ + printf(") = "); print_32(a128); printf("\n"); + + #define MULITGO2pd(A, B) \ + GO2pd(A, B, a128_pd, b128_pd) \ + GO2pd(A, B, b128_pd, c128_pd) \ + GO2pd(A, B, a128_pd, d128_pd) \ + GO2pd(A, B, b128_pd, d128_pd) \ + GO2pd(A, B, c128_pd, d128_pd) \ + GO2pd(A, B, d128_pd, d128_pd) + + #define MULITGO2Cpd(A, B, I) \ + GO2Cpd(A, B, a128_pd, b128_pd, I) \ + GO2Cpd(A, B, b128_pd, c128_pd, I) \ + GO2Cpd(A, B, a128_pd, d128_pd, I) \ + GO2Cpd(A, B, b128_pd, d128_pd, I) \ + GO2Cpd(A, B, c128_pd, d128_pd, I) \ + GO2Cpd(A, B, d128_pd, d128_pd, I) + + #define MULITGO2ps(A, B) \ + GO2ps(A, B, a128_ps, b128_ps) \ + GO2ps(A, B, b128_ps, c128_ps) \ + GO2ps(A, B, a128_ps, d128_ps) \ + GO2ps(A, B, b128_ps, d128_ps) \ + GO2ps(A, B, c128_ps, d128_ps) \ + GO2ps(A, B, d128_ps, d128_ps) + + #define MULTIGO1ps2dq(A, B) \ + GO1ps2dq(A, B, a128_ps) \ + GO1ps2dq(A, B, b128_ps) \ + GO1ps2dq(A, B, c128_ps) \ + GO1ps2dq(A, B, d128_ps) + + #define MULITGO2Cps(A, B, I) \ + GO2Cps(A, B, a128_ps, b128_ps, I) \ + GO2Cps(A, B, b128_ps, c128_ps, I) \ + GO2Cps(A, B, a128_ps, d128_ps, I) \ + GO2Cps(A, B, b128_ps, d128_ps, I) \ + GO2Cps(A, B, c128_ps, d128_ps, I) \ + GO2Cps(A, B, d128_ps, d128_ps, I) + + #define MULTIGO2sd(A, B) \ + GO2sd(A, B, a128_pd, a128_pd) \ + GO2sd(A, B, a128_pd, b128_pd) \ + GO2sd(A, B, a128_pd, c128_pd) \ + GO2sd(A, B, a128_pd, d128_pd) \ + GO2sd(A, B, b128_pd, d128_pd) \ + GO2sd(A, B, c128_pd, d128_pd) \ + GO2sd(A, B, a128_pd, reverse_pd(a128_pd)) \ + GO2sd(A, B, a128_pd, reverse_pd(b128_pd)) \ + GO2sd(A, B, a128_pd, reverse_pd(c128_pd)) \ + GO2sd(A, B, a128_pd, reverse_pd(d128_pd)) \ + GO2sd(A, B, b128_pd, reverse_pd(d128_pd)) \ + GO2sd(A, B, b128_pd, reverse_pd(d128_pd)) + + + GO2(shuffle, 8, pshufb, a128_8, b128_8) + GO2(hadd, 16, phaddw, a128_16, b128_16) + GO2(hadd, 32, phaddd, a128_32, b128_32) + GO2(hadds, 16, phaddsw, a128_16, b128_16) + GO2(maddubs, 16, pmaddubsw, a128_8, b128_8) + GO2(hsub, 16, phsubw, a128_16, b128_16) + GO2(sign, 8, psignb, a128_8, b128_8) + GO2(sign, 16, psignw, a128_16, b128_16) + GO2(sign, 32, psignd, a128_32, b128_32) + GO2(mulhrs, 16, pmulhrsw, a128_16, b128_16) + GO3PS(blendv, 32, a128_32, b128_32, c128_32) + GO2i(testz, a128_32, b128_32) + GO2i(testc, a128_32, b128_32) + GO2i(testnzc, a128_32, b128_32) + GO1(abs, 8, pabsb) + GO1(abs, 16, pabsw) + GO1(abs, 32, pabsd) + GO1(cvtepi8, 16, pmovsxbw); + GO1(cvtepi8, 32, pmovsxbd); + GO1(cvtepi8, 64, pmovsxbq); + GO1(cvtepi16, 32, pmovsxwd); + GO1(cvtepi16, 64, pmovsxwq); + GO1(cvtepi32, 64, pmovsxdq); + GO1(cvtepu8, 16, pmovzxbw); + GO1(cvtepu8, 32, pmovzxbd); + GO1(cvtepu8, 64, pmovzxbq); + GO1(cvtepu16, 32, pmovzxwd); + GO1(cvtepu16, 64, pmovzxwq); + GO1(cvtepu32, 64, pmovzxdq); + GO2(min, 32, pminsd, a128_32, b128_32) + GO2(max, 32, pmaxsd, a128_32, b128_32) + GO2C(blend, 16, pblendw, a128_16, b128_16, 0) + GO2C(blend, 16, pblendw, a128_16, b128_16, 0xff) + GO2C(blend, 16, pblendw, a128_16, b128_16, 0xaa) + GO2C(blend, 16, pblendw, a128_16, b128_16, 2) + GO2C(alignr, 8, palignr, a128_8, b128_8, 0) + GO2C(alignr, 8, palignr, a128_8, b128_8, 2) + GO2C(alignr, 8, palignr, a128_8, b128_8, 7) + GO2C(alignr, 8, palignr, a128_8, b128_8, 15) + GO2C(alignr, 8, palignr, a128_8, b128_8, 16) + GO2C(alignr, 8, palignr, a128_8, b128_8, 0xff) + GO1ipd(movemask, movmskpd, a128_64) + GO1pd(sqrt, psqrtpd, a128_pd) + GO1pd(sqrt, psqrtpd, b128_pd) + GO1pd(sqrt, psqrtpd, c128_pd) + GO1pd(sqrt, psqrtpd, d128_pd) + MULITGO2pd(and, andpd) + MULITGO2pd(andnot, andnpd) + MULITGO2pd(or, orpd) + MULITGO2pd(xor, xorpd) + MULITGO2pd(add, addpd) + MULITGO2pd(mul, mulpd) + MULITGO2pd(sub, subpd) + MULITGO2pd(min, minpd) + MULITGO2pd(div, divpd) + MULITGO2pd(max, maxpd) + GO2(unpacklo, 8, punpcklbw, a128_8, b128_8) + GO2(unpacklo, 16, punpcklwd, a128_16, b128_16) + GO2(unpacklo, 32, punpckldq, a128_32, b128_32) + GO2(packs, 16, ppacksswb, a128_16, b128_16) + GO2(cmpgt, 8, pcmpgtb, a128_8, b128_8) + GO2(cmpgt, 16, pcmpgtw, a128_16, b128_16) + GO2(cmpgt, 32, pcmpgtd, a128_32, b128_32) + GO2(packus, 16, packuswb, a128_16, b128_16) + GO2(unpackhi, 8, punpckhbw, a128_8, b128_8) + GO2(unpackhi, 16, punpckhwd, a128_16, b128_16) + GO2(unpackhi, 32, punpckhdq, a128_32, b128_32) + GO2(packs, 32, ppackssdw, a128_32, b128_32) + GO2(unpacklo, 64, punpcklqdq, a128_64, b128_64) + GO2(unpackhi, 64, punpckhqdq, a128_64, b128_64) + GO1C(shuffle, 32, pshufd, a128_32, 0) + GO1C(shuffle, 32, pshufd, a128_32, 0xff) + GO1C(shuffle, 32, pshufd, a128_32, 0xaa) + GO1C(shuffle, 32, pshufd, a128_32, 2) + GO1C(srli, 16, psrlw, a128_16, 0) + GO1C(srli, 16, psrlw, a128_16, 0xff) + GO1C(srli, 16, psrlw, a128_16, 0xaa) + GO1C(srli, 16, psrlw, a128_16, 2) + GO1C(srli, 32, psrld, a128_32, 0) + GO1C(srli, 32, psrld, a128_32, 0xff) + GO1C(srli, 32, psrld, a128_32, 0xaa) + GO1C(srli, 32, psrld, a128_32, 2) + GO1C(srli, 64, psrlq, a128_64, 0) + GO1C(srli, 64, psrlq, a128_64, 0xff) + GO1C(srli, 64, psrlq, a128_64, 0xaa) + GO1C(srli, 64, psrlq, a128_64, 2) + GO1C(srai, 16, psraw, a128_16, 0) + GO1C(srai, 16, psraw, a128_16, 0xff) + GO1C(srai, 16, psraw, a128_16, 0xaa) + GO1C(srai, 16, psraw, a128_16, 2) + GO1C(srai, 32, psrad, a128_32, 0) + GO1C(srai, 32, psrad, a128_32, 0xff) + GO1C(srai, 32, psrad, a128_32, 0xaa) + GO1C(srai, 32, psrad, a128_32, 2) + GO1C(slli, 16, psllw, a128_16, 0) + GO1C(slli, 16, psllw, a128_16, 0xff) + GO1C(slli, 16, psllw, a128_16, 0xaa) + GO1C(slli, 16, psllw, a128_16, 2) + GO1C(slli, 32, pslld, a128_32, 0) + GO1C(slli, 32, pslld, a128_32, 0xff) + GO1C(slli, 32, pslld, a128_32, 0xaa) + GO1C(slli, 32, pslld, a128_32, 2) + GO1C(slli, 64, psllq, a128_64, 0) + GO1C(slli, 64, psllq, a128_64, 0xff) + GO1C(slli, 64, psllq, a128_64, 0xaa) + GO1C(slli, 64, psllq, a128_64, 2) + GO2(cmpeq, 8, pcmpeqb, a128_8, b128_8) + GO2(cmpeq, 16, pcmpeqw, a128_16, b128_16) + GO2(cmpeq, 32, pcmpeqd, a128_32, b128_32) + MULITGO2pd(hadd, haddpd) + GO2(srl, 16, psrlw, a128_16, b128_16) + GO2(srl, 32, psrld, a128_32, b128_32) + GO2(srl, 64, psrlq, a128_64, b128_64) + GO2(add, 64, paddq, a128_64, b128_64) + GO2(mullo, 16, pmullw, a128_16, b128_16) + GO2u(subs, 8, psubusb, a128_8, b128_8) + GO2u(subs, 16, psubusw, a128_16, b128_16) + GO2u(min, 8, pminub, a128_8, b128_8) + GO2f(and, pand, a128_8, b128_8) + GO2u(adds, 8, paddusb, a128_8, b128_8) + GO2u(adds, 16, paddusw, a128_16, b128_16) + GO2u(max, 8, pmaxub, a128_8, b128_8) + GO2f(andnot, pandn, a128_8, b128_8) + GO2u(avg, 8, pavgb, a128_8, b128_8) + GO2(sra, 16, psraw, a128_16, b128_16) + GO2(sra, 32, psrad, a128_32, b128_32) + GO2u(avg, 16, pavgb, a128_16, b128_16) + GO2u(mulhi, 16, pmulhuw, a128_16, b128_16) + GO2(mulhi, 16, pmulhw, a128_16, b128_16) + GO2(subs, 8, psubsb, a128_8, b128_8) + GO2(subs, 16, psubsw, a128_16, b128_16) + GO2(min, 16, pminsw, a128_16, b128_16) + GO2f(or, por, a128_8, b128_8) + GO2(adds, 8, paddusb, a128_8, b128_8) + GO2(adds, 16, paddusw, a128_16, b128_16) + GO2(max, 16, pmaxsw, a128_16, b128_16) + GO2f(xor, pxor, a128_8, b128_8) + GO2(sll, 16, psllw, a128_16, b128_16) + GO2(sll, 32, pslld, a128_32, b128_32) + GO2(sll, 64, psllq, a128_64, b128_64) + GO2u(mul, 32, pmuludq, a128_32, b128_32) + GO2(madd, 16, pmaddwd, a128_16, b128_16) + GO2u(sad, 8, psadbw, a128_8, b128_8) + GO2(sub, 8, psubb, a128_8, b128_8) + GO2(sub, 16, psubw, a128_16, b128_16) + GO2(sub, 32, psubd, a128_32, b128_32) + GO2(sub, 64, psubq, a128_64, b128_64) + GO2(add, 8, paddb, a128_8, b128_8) + GO2(add, 16, paddw, a128_16, b128_16) + GO2(add, 32, paddd, a128_32, b128_32) + GO2ps(movehl, pmovhlps, a128_ps, b128_ps) + GO2ps(unpacklo, unpcklps, a128_ps, b128_ps) + GO2ps(unpackhi, unpckhps, a128_ps, b128_ps) + GO2ps(movelh, pmovhps, a128_ps, b128_ps) + GO1ps(sqrt, psqrtps, a128_ps) + GO1ps(sqrt, psqrtps, b128_ps) + GO1ps(sqrt, psqrtps, c128_ps) + GO1ps(sqrt, psqrtps, d128_ps) + //GO1ps(rsqrt, prsqrtps, a128_ps) // difference in precision + //GO1ps(rsqrt, prsqrtps, b128_ps) // same + //GO1ps(rsqrt, prsqrtps, c128_ps) // same + //GO1ps(rsqrt, prsqrtps, d128_ps) // difference in the handling of NAN, (-)0, and INF in Dynarec + //GO1ps(rcp, prcpps, a128_ps) // deference in precision + //GO1ps(rcp, prcpps, b128_ps) // deference in precision + //GO1ps(rcp, prcpps, c128_ps) // deference in precision + GO1ps(rcp, prcpps, d128_ps) + MULITGO2ps(and, andps) + MULITGO2ps(andnot, andnps) + MULITGO2ps(or, orps) + MULITGO2ps(xor, xorps) + MULITGO2ps(add, addps) + MULITGO2ps(mul, mulps) + MULITGO2ps(sub, subps) + MULITGO2ps(min, minps) + MULITGO2ps(div, divps) + MULITGO2ps(max, maxps) + //MULITGO2Cps(cmp, cmpps, 0) // use avx for some reason + MULITGO2Cps(shuffle, shufps, 0) + MULITGO2Cps(shuffle, shufps, 0x15) + MULITGO2Cps(shuffle, shufps, 0xff) + MULITGO2Cps(shuffle, shufps, 0x02) + MULTIGO2sd(sqrt, sqrtsd) + MULTIGO2sd(add, addsd) + MULTIGO2sd(mul, mulsd) + MULTIGO2sd(sub, subsd) + MULTIGO2sd(min, minsd) + MULTIGO2sd(div, divsd) + MULTIGO2sd(max, maxsd) + MULTIGO1ps2dq(cvtps, cvtps2dq) + MULITGO2Cps(dp, dpps, 0xff) + MULITGO2Cps(dp, dpps, 0x3f) + MULITGO2Cps(dp, dpps, 0xf3) + MULITGO2Cps(dp, dpps, 0x53) + + return 0; +} + diff --git a/tests32/test18.c b/tests32/test18.c new file mode 100644 index 0000000..f609b75 --- /dev/null +++ b/tests32/test18.c @@ -0,0 +1,30 @@ +#include +#include +#include + +static jmp_buf context_buf; + +static void segv_handler(int sig) +{ + printf("sig = %d\n", sig); + longjmp(context_buf, 1); +} + +void test() +{ + if(!setjmp(context_buf)) { + int *bad_ptr = (int*)0xdeadbeef; + printf("*bad_ptr = %d\n", *bad_ptr); + } else { + printf("got bad_ptr\n"); + } +} + +int main() +{ + if(signal(SIGSEGV, segv_handler) == SIG_ERR) + printf("Err = %m\n"); + //printf("handler = %p\n", segv_handler); + test(); + return 0; +} diff --git a/tests32/test19.c b/tests32/test19.c new file mode 100644 index 0000000..5d4c412 --- /dev/null +++ b/tests32/test19.c @@ -0,0 +1,206 @@ +#include +#include +#include +#include +#include +#include + +#if defined(__x86_64__) +#error Nope! +#else +uint64_t _fucomip_(double a, double b) +{ + uint32_t ret; + asm volatile ( + "fldl %2\n" + "fldl %1\n" + "fucomip %%st(1)\n" + "fstp %%st(0)\n" + "pushfl\n" + "popl %%eax\n" + :"=a" (ret):"m"(a), "m"(b):"cc"); + return ret; +} +uint64_t _fucompp_(double a, double b) +{ + uint32_t ret; + asm volatile ( + "fldl %2\n" + "fldl %1\n" + "fucompp\n" + "fstsw %%ax\n" + :"=a" (ret):"m"(a), "m"(b):"cc"); + return ret; +} +uint64_t _fistpw_(double a, uint8_t rd) +{ + uint16_t ret; + uint16_t t1, t2; + asm volatile ( + "fldl %1\n" + "fstcw %2\n" + "mov %2, %%ax\n" + "mov %4, %%ah\n" + "mov %%ax, %3\n" + "fldcw %3\n" + "fistp %0\n" + "fldcw %2\n" + :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc"); + return ret; +} +uint64_t _fisttpw_(double a, uint8_t rd) +{ + uint16_t ret; + uint16_t t1, t2; + asm volatile ( + "fldl %1\n" + "fstcw %2\n" + "mov %2, %%ax\n" + "mov %4, %%ah\n" + "mov %%ax, %3\n" + "fldcw %3\n" + "fisttp %0\n" + "fldcw %2\n" + :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc"); + return ret; +} +uint64_t _fistpl_(double a, uint8_t rd) +{ + uint32_t ret; + uint16_t t1, t2; + asm volatile ( + "fldl %1\n" + "fstcw %2\n" + "mov %2, %%ax\n" + "mov %4, %%ah\n" + "mov %%ax, %3\n" + "fldcw %3\n" + "fistpl %0\n" + "fldcw %2\n" + :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc"); + return ret; +} +uint64_t _fisttpl_(double a, uint8_t rd) +{ + uint32_t ret; + uint16_t t1, t2; + asm volatile ( + "fldl %1\n" + "fstcw %2\n" + "mov %2, %%ax\n" + "mov %4, %%ah\n" + "mov %%ax, %3\n" + "fldcw %3\n" + "fisttpl %0\n" + "fldcw %2\n" + :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc"); + return ret; +} +uint64_t _fistpq_(double a, uint8_t rd) +{ + uint64_t ret; + uint16_t t1, t2; + asm volatile ( + "fldl %1\n" + "fstcw %2\n" + "mov %2, %%ax\n" + "mov %4, %%ah\n" + "mov %%ax, %3\n" + "fldcw %3\n" + "fistpq %0\n" + "fldcw %2\n" + :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc"); + return ret; +} +uint64_t _fisttpq_(double a, uint8_t rd) +{ + uint64_t ret; + uint16_t t1, t2; + asm volatile ( + "fldl %1\n" + "fstcw %2\n" + "mov %2, %%ax\n" + "mov %4, %%ah\n" + "mov %%ax, %3\n" + "fldcw %3\n" + "fisttpq %0\n" + "fldcw %2\n" + :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc"); + return ret; +} +uint64_t _frndint_(double a, uint8_t rd) +{ + uint64_t ret; + uint16_t t1, t2; + asm volatile ( + "fldl %1\n" + "fstcw %2\n" + "mov %2, %%ax\n" + "mov %4, %%ah\n" + "mov %%ax, %3\n" + "fldcw %3\n" + "frndint\n" + "fstpl %0\n" + "fldcw %2\n" + :"=m" (ret):"m"(a), "m"(t1), "m"(t2), "m"(rd):"cc"); + return ret; +} +#endif + +int main(int argc, const char** argv) +{ + double a, b; + char pf, cf, zf; + char pa, ca, za; + uint64_t flags; + uint64_t tests[] = { + 0x0, + 0x4082c00000000000LL, + 0x8000000000000000LL, + 0x40dfffc000000000LL, + 0x40e0002000000000LL, // 0x7fff and 0x8001 as double + 0xc0e0002000000000LL, + 0xc0dfffc000000000LL, // -0x8001 and -0x7fff as double + 0x3ff0000000000000LL, + 0x3fe89d9000000000LL, + 0x7ff0000000000000LL, + 0xfff0000000000000LL, + 0x3ff0002ca0000000LL, + 0xaeff000025000000LL, + 0x3ff0000050000000LL, + 0xc082c00000000000LL, + 0x7ff8000000000001LL, +}; +int n = sizeof(tests)/sizeof(tests[0]); +for(int i=0; i>0)&1?'C':'-'; + za = (flags>>(0+6))&1?'Z':'-'; + pa = (flags>>(0+2))&1?'P':'-'; + printf("%c%c%c\n", za, pa, ca); + printf("FUCOMPP 0x%llx 0x%llx ", *(uint64_t*)&a, *(uint64_t*)&b); + flags = _fucompp_(a, b); + ca = (flags>>8)&1?'C':'-'; + za = (flags>>(8+6))&1?'Z':'-'; + pa = (flags>>(8+2))&1?'P':'-'; + printf("%c%c%c\n", za, pa, ca); + } +for(int i=0; i 0x%llx\n", *(uint64_t*)&a, _frndint_(a, rd<<2)); + printf(" FISTP 0x%llx => word: %x\n", *(uint64_t*)&a, _fistpw_(a, rd<<2)); + printf(" FISTP 0x%llx => long: %x\n", *(uint64_t*)&a, _fistpl_(a, rd<<2)); + printf(" FISTP 0x%llx => quad: %llx\n", *(uint64_t*)&a, _fistpq_(a, rd<<2)); + printf(" FISTTP 0x%llx => word: %x\n", *(uint64_t*)&a, _fisttpw_(a, rd<<2)); + printf(" FISTTP 0x%llx => long: %x\n", *(uint64_t*)&a, _fisttpl_(a, rd<<2)); + printf(" FISTTP 0x%llx => quad: %llx\n", *(uint64_t*)&a, _fisttpq_(a, rd<<2)); + } + } + printf("\nDone\n"); +} diff --git a/tests32/test20.c b/tests32/test20.c new file mode 100644 index 0000000..017e925 --- /dev/null +++ b/tests32/test20.c @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include +#include + +#if defined(__x86_64__) +#error Nope! +#else +__attribute__((naked)) uint64_t _idiv_(uint32_t a, uint32_t b) +{ + asm volatile ( + "xor %%eax, %%eax\n" + "mov 4(%%esp), %%edx\n" + "mov 8(%%esp), %%ecx\n" + "shrd $0x10, %%edx, %%eax\n" + "sar $0x10, %%edx\n" + "idiv %%ecx\n" + "ret" + :::); +} +#endif + +int main(int argc, const char** argv) +{ + uint32_t tests[][2] = { + {0x000002d0, 0x00000500}, + {0xfffffa5d, 0x000186a0}, + {0x00001701, 0x000186a0}, + {0xffff9a19, 0x000186a0}, + {0xffffe7f3, 0x000186a0}, + {0x00015840, 0x000186a0}, + {0xff451330, 0x000186a0}, + {0xffff626a, 0x000186a0}, + {0x00009120, 0x000186a0}, + }; + int n = sizeof(tests)/sizeof(tests[0]); + uint64_t res; + for(int i=0; i> 32; + printf("=> 0x%x / 0x%x (%lld/%d => %d + %d)\n", modo, divi, ((int64_t)tests[i][0])<<16, tests[i][1], divi, modo); + } + printf("\nDone\n"); +} diff --git a/tests32/test21.c b/tests32/test21.c new file mode 100644 index 0000000..332ed3a --- /dev/null +++ b/tests32/test21.c @@ -0,0 +1,41 @@ +/* + * Compile with (on x86_64 archs): + * gcc -m32 -DV1 -shared -o test21_v1.so test21.c + * gcc -m32 -DV2 -shared -o test21_v2.so test21.c + * gcc -m32 -o test21 test21.c -ldl -Wl,-z,origin,-rpath='$ORIGIN' + */ + +#if defined(V1) +int __attribute__((noinline)) getVersion() { asm(""); return 1; } +int acquireVersion() { return getVersion(); } + +#elif defined(V2) +int __attribute__((noinline)) getVersion() { asm(""); return 2; } +int returnVersion() { return getVersion(); } + +#else +#include +#include +#include + +typedef int(*iFv_t)(void); + +int main(int argc, char **argv) { + void* v1 = dlopen("test21_v1.so", RTLD_NOW); + void* v2 = dlopen("test21_v2.so", RTLD_NOW); + if(!v1 || !v2) { + printf("Error openning libs: v1=%p, v2=%p\n", v1, v2); // typo: opening + exit(-1); + } + iFv_t returnVersion = (iFv_t)dlsym(v2, "returnVersion"); + iFv_t acquireVersion = (iFv_t)dlsym(v1, "acquireVersion"); + if(!returnVersion || !acquireVersion) { + printf("Error getting symbol return=%p/acquire=%p\n", returnVersion, acquireVersion); + exit(-2); + } + printf("%d/%d\n", returnVersion(), acquireVersion()); return 0; + dlclose(v2); + dlclose(v1); +} + +#endif diff --git a/tests32/test22.c b/tests32/test22.c new file mode 100644 index 0000000..120f39e --- /dev/null +++ b/tests32/test22.c @@ -0,0 +1,70 @@ +// build with gcc -march=corei7 -O2 -g -maes -mpclmul -m32 test22.c -o test22 +#include +#include +#include + +// Hard coding types and alignment +typedef long long v2di __attribute__((vector_size(16))); +typedef union { + unsigned long long v[2]; + v2di m; +} mm128i; + +int need_stop(mm128i *var) { + if (var->v[0] >= 0xEEEEFFFFFFFFEEEFULL) { + if (var->v[1] == 0xFFFFFFFFFFFFFFFFULL) return 1; + else { + var->v[0] += 0x1111000000001111ULL; + ++var->v[1]; + } + } else var->v[0] += 0x1111000000001111ULL; + if (var->v[1] >= 0xF000000000000000ULL) return 1; + else var->v[1] += 0x1000000000000000ULL; + return 0; +} + +int main() { + mm128i x = { .v = {0, 0} }; + do { + mm128i y = { .v = {0, 0} }; + do { + mm128i enc = { .m = _mm_aesenc_si128(x.m, y.m) }; + mm128i enclast = { .m = _mm_aesenclast_si128(x.m, y.m) }; + mm128i dec = { .m = _mm_aesdec_si128(x.m, y.m) }; + mm128i declast = { .m = _mm_aesdeclast_si128(x.m, y.m) }; + printf("enc (0x%016llX%016llX, 0x%016llX%016llX) = 0x%016llX%016llX\n", x.v[1], x.v[0], y.v[1], y.v[0], enc.v[1], enc.v[0]); + printf("enclast(0x%016llX%016llX, 0x%016llX%016llX) = 0x%016llX%016llX\n", x.v[1], x.v[0], y.v[1], y.v[0], enclast.v[1], enclast.v[0]); + printf("dec (0x%016llX%016llX, 0x%016llX%016llX) = 0x%016llX%016llX\n", x.v[1], x.v[0], y.v[1], y.v[0], dec.v[1], dec.v[0]); + printf("declast(0x%016llX%016llX, 0x%016llX%016llX) = 0x%016llX%016llX\n", x.v[1], x.v[0], y.v[1], y.v[0], declast.v[1], declast.v[0]); + } while (!need_stop(&y)); + mm128i keygenassist00 = { .m = _mm_aeskeygenassist_si128(x.m, 0) }; + printf("keygenassist(0x%016llX%016llX, 0x00) = 0x%016llX%016llX\n", x.v[1], x.v[0], keygenassist00.v[1], keygenassist00.v[0]); + mm128i keygenassist01 = { .m = _mm_aeskeygenassist_si128(x.m, 0x01) }; + printf("keygenassist(0x%016llX%016llX, 0x01) = 0x%016llX%016llX\n", x.v[1], x.v[0], keygenassist01.v[1], keygenassist01.v[0]); + mm128i keygenassist02 = { .m = _mm_aeskeygenassist_si128(x.m, 0x02) }; + printf("keygenassist(0x%016llX%016llX, 0x02) = 0x%016llX%016llX\n", x.v[1], x.v[0], keygenassist02.v[1], keygenassist02.v[0]); + mm128i keygenassist04 = { .m = _mm_aeskeygenassist_si128(x.m, 0x04) }; + printf("keygenassist(0x%016llX%016llX, 0x04) = 0x%016llX%016llX\n", x.v[1], x.v[0], keygenassist04.v[1], keygenassist04.v[0]); + mm128i keygenassist08 = { .m = _mm_aeskeygenassist_si128(x.m, 0x08) }; + printf("keygenassist(0x%016llX%016llX, 0x08) = 0x%016llX%016llX\n", x.v[1], x.v[0], keygenassist08.v[1], keygenassist08.v[0]); + mm128i keygenassist10 = { .m = _mm_aeskeygenassist_si128(x.m, 0x10) }; + printf("keygenassist(0x%016llX%016llX, 0x10) = 0x%016llX%016llX\n", x.v[1], x.v[0], keygenassist10.v[1], keygenassist10.v[0]); + mm128i keygenassist38 = { .m = _mm_aeskeygenassist_si128(x.m, 0x38) }; + printf("keygenassist(0x%016llX%016llX, 0x38) = 0x%016llX%016llX\n", x.v[1], x.v[0], keygenassist38.v[1], keygenassist38.v[0]); + mm128i keygenassist4F = { .m = _mm_aeskeygenassist_si128(x.m, 0x4F) }; + printf("keygenassist(0x%016llX%016llX, 0x4F) = 0x%016llX%016llX\n", x.v[1], x.v[0], keygenassist4F.v[1], keygenassist4F.v[0]); + mm128i keygenassistFF = { .m = _mm_aeskeygenassist_si128(x.m, 0xFF) }; + printf("keygenassist(0x%016llX%016llX, 0xFF) = 0x%016llX%016llX\n", x.v[1], x.v[0], keygenassistFF.v[1], keygenassistFF.v[0]); + mm128i imc = { .m = _mm_aesimc_si128(x.m) }; + printf("imc (0x%016llX%016llX) = 0x%016llX%016llX\n", x.v[1], x.v[0], imc.v[1], imc.v[0]); + + mm128i pclmul00 = { .m = _mm_clmulepi64_si128(keygenassist00.m, x.m, 0) }; + printf("pclmul(0x%016llX%016llX, 0x00) = 0x%016llX%016llX\n", x.v[1], x.v[0], pclmul00.v[1], pclmul00.v[0]); + mm128i pclmul01 = { .m = _mm_clmulepi64_si128(keygenassist00.m, x.m, 0x01) }; + printf("pclmul(0x%016llX%016llX, 0x01) = 0x%016llX%016llX\n", x.v[1], x.v[0], pclmul01.v[1], pclmul01.v[0]); + mm128i pclmul10 = { .m = _mm_clmulepi64_si128(keygenassist00.m, x.m, 0x10) }; + printf("pclmul(0x%016llX%016llX, 0x10) = 0x%016llX%016llX\n", x.v[1], x.v[0], pclmul10.v[1], pclmul10.v[0]); + mm128i pclmul11 = { .m = _mm_clmulepi64_si128(keygenassist00.m, x.m, 0x11) }; + printf("pclmul(0x%016llX%016llX, 0xFF) = 0x%016llX%016llX\n", x.v[1], x.v[0], pclmul11.v[1], pclmul11.v[0]); + } while (!need_stop(&x)); +} diff --git a/tests32/test23.c b/tests32/test23.c new file mode 100644 index 0000000..35016d6 --- /dev/null +++ b/tests32/test23.c @@ -0,0 +1,52 @@ +#include +#include +#include +#include +// Build with `gcc -march=core2 -O2 -m32 test23.c -o test23` + + +uint64_t a = 0x12345678abcdefed; +uint32_t b = 0x12345678; +uint16_t c = 0x1234; + +int main() +{ + uint32_t ret2; + uint16_t ret3; + + asm volatile( + "movbe %1, %0\n" + : "=r"(ret2) + : "m"(b) + : "memory"); + printf("ret = 0x%x\n", ret2); + + asm volatile( + "movbe %1, %0\n" + : "=r"(ret3) + : "m"(c) + : "memory"); + printf("ret = 0x%x\n", ret3); + + asm volatile( + "movbe %1, %0\n" + : "=m"(ret2) + : "r"(b) + : "memory"); + printf("ret = 0x%x\n", ret2); + + asm volatile( + "movbe %1, %0\n" + : "=m"(ret3) + : "r"(c) + : "memory"); + printf("ret = 0x%x\n", ret3); + + asm volatile( + "bswap %0\n" + : "+r"(ret2) + : + :); + printf("ret = 0x%x\n", ret2); + return 0; +} diff --git a/tests32/test24.c b/tests32/test24.c new file mode 100644 index 0000000..47f08e2 --- /dev/null +++ b/tests32/test24.c @@ -0,0 +1,104 @@ +#include +#include +#include +// Build with `gcc -march=core2 -O0 -m32 test24.c -o test24 -lm` + +#define TEST(fn, val) \ + printf("Testing %s(%f)\n", #fn, val); \ + fesetround(FE_UPWARD); \ + printf("FE_UPWARD: %.1f\n", (double)fn(val)); \ + printf("Current rounding mode: 0x%x\n", fegetround()); \ + fesetround(FE_DOWNWARD); \ + printf("FE_DOWNWARD: %.1f\n", (double)fn(val)); \ + printf("Current rounding mode: 0x%x\n", fegetround()); \ + fesetround(FE_TOWARDZERO); \ + printf("FE_TOWARDZERO: %.1f\n", (double)fn(val)); \ + printf("Current rounding mode: 0x%x\n", fegetround()); \ + fesetround(FE_TONEAREST); \ + printf("FE_TONEAREST: %.1f\n", (double)fn(val)); \ + printf("Current rounding mode: 0x%x\n\n", fegetround()); + +int main() +{ + TEST(rint, 1.0f); + TEST(rint, 1.3f); + TEST(rint, 1.5f); + TEST(rint, 1.8f); + + TEST(rint, 2.0f); + TEST(rint, 2.3f); + TEST(rint, 2.5f); + TEST(rint, 2.8f); + + TEST(rintf, 1.0f); + TEST(rintf, 1.3f); + TEST(rintf, 1.5f); + TEST(rintf, 1.8f); + + TEST(rintf, 2.0f); + TEST(rintf, 2.3f); + TEST(rintf, 2.5f); + TEST(rintf, 2.8f); + + TEST(nearbyint, 1.0f); + TEST(nearbyint, 1.3f); + TEST(nearbyint, 1.5f); + TEST(nearbyint, 1.8f); + + TEST(nearbyint, 2.0f); + TEST(nearbyint, 2.3f); + TEST(nearbyint, 2.5f); + TEST(nearbyint, 2.8f); + + TEST(nearbyintf, 1.0f); + TEST(nearbyintf, 1.3f); + TEST(nearbyintf, 1.5f); + TEST(nearbyintf, 1.8f); + + TEST(nearbyintf, 2.0f); + TEST(nearbyintf, 2.3f); + TEST(nearbyintf, 2.5f); + TEST(nearbyintf, 2.8f); + + TEST(llrintf, 1.0f); + TEST(llrintf, 1.3f); + TEST(llrintf, 1.5f); + TEST(llrintf, 1.8f); + + TEST(llrintf, 2.0f); + TEST(llrintf, 2.3f); + TEST(llrintf, 2.5f); + TEST(llrintf, 2.8f); + + TEST(llrint, 1.0f); + TEST(llrint, 1.3f); + TEST(llrint, 1.5f); + TEST(llrint, 1.8f); + + TEST(llrint, 2.0f); + TEST(llrint, 2.3f); + TEST(llrint, 2.5f); + TEST(llrint, 2.8f); + + TEST(lrintf, 1.0f); + TEST(lrintf, 1.3f); + TEST(lrintf, 1.5f); + TEST(lrintf, 1.8f); + + TEST(lrintf, 2.0f); + TEST(lrintf, 2.3f); + TEST(lrintf, 2.5f); + TEST(lrintf, 2.8f); + + TEST(lrint, 1.0f); + TEST(lrint, 1.3f); + TEST(lrint, 1.5f); + TEST(lrint, 1.8f); + + TEST(lrint, 2.0f); + TEST(lrint, 2.3f); + TEST(lrint, 2.5f); + TEST(lrint, 2.8f); + + return 0; +} diff --git a/tests32/test25.c b/tests32/test25.c new file mode 100644 index 0000000..b220430 --- /dev/null +++ b/tests32/test25.c @@ -0,0 +1,130 @@ +// build with gcc -O0 -g -msse -msse2 -mssse3 -msse4.1 -msse4.2 -m32 test25.c -o test25 +// and -m32 for 32bits version +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef unsigned char u8x16 __attribute__ ((vector_size (16))); +typedef unsigned short u16x8 __attribute__ ((vector_size (16))); +typedef unsigned int u32x4 __attribute__ ((vector_size (16))); +typedef unsigned long int u64x2 __attribute__ ((vector_size (16))); +typedef float f32x4 __attribute__ ((vector_size (16))); +typedef double d64x2 __attribute__ ((vector_size (16))); + +const char* string1 = "This is a string"; +const char* string2 = "This\0 string "; +const char* string3 = "is\0 "; +const char* string4 = "maestrum-foo-bar"; +const char* string5 = "\0 "; + +typedef union { + __m128i mm; + __m128 mf; + __m128d md; + u8x16 u8; + u16x8 u16; + u32x4 u32; + u64x2 u64; + f32x4 f32; + d64x2 d64; +} v128; + +v128 load_string(const char* s) +{ + v128 ret; + for(int i=0; i<16; ++i) + ret.u8[i] = s[i]; + return ret; +} +v128 load_stringw(const char* s) +{ + v128 ret; + for(int i=0; i<8; ++i) + ret.u16[i] = s[i]; + return ret; +} + +int main(int argc, const char** argv) +{ + printf("test SSE 4.2\n"); + + v128 a, b, c; + int ret; + int fa, fc, fo, fs, fz; + #define GO1(A, B, C) \ + ret = _mm_cmpestri(a.mm, strlen(A), b.mm, strlen(B), C); \ + printf("_mm_cmpestri(\"%s\", %d, \"%s\", %d, 0x%x) => %d\n", A, strlen(A), B, strlen(B), C, ret); \ + fa = _mm_cmpestra(a.mm, strlen(A), b.mm, strlen(B), C); \ + fc = _mm_cmpestrc(a.mm, strlen(A), b.mm, strlen(B), C); \ + fo = _mm_cmpestro(a.mm, strlen(A), b.mm, strlen(B), C); \ + fs = _mm_cmpestrs(a.mm, strlen(A), b.mm, strlen(B), C); \ + fz = _mm_cmpestrz(a.mm, strlen(A), b.mm, strlen(B), C); \ + printf("_mm_cmpestri(\"%s\", %d, \"%s\", %d, 0x%x) flags: a:%d s:%d z:%d c:%d o:%d\n", A, strlen(A), B, strlen(B), C, fa, fs, fz, fc, fo); \ + c.mm = _mm_cmpestrm(a.mm, strlen(A), b.mm, strlen(B), C); \ + printf("mm_cmpestrm(\"%s\", %d, \"%s\", %d, 0x%x) = %016x-%016x\n", A, strlen(A), B, strlen(B), C, c.u64[1], c.u64[0]); \ + ret = _mm_cmpistri(a.mm, b.mm, C); \ + printf("_mm_cmpistri(\"%s\", \"%s\", 0x%x) => %d\n", A, B, C, ret); \ + fa = _mm_cmpistra(a.mm, b.mm, C); \ + fc = _mm_cmpistrc(a.mm, b.mm, C); \ + fo = _mm_cmpistro(a.mm, b.mm, C); \ + fs = _mm_cmpistrs(a.mm, b.mm, C); \ + fz = _mm_cmpistrz(a.mm, b.mm, C); \ + printf("_mm_cmpestri(\"%s\", \"%s\", 0x%x) flags: a:%d s:%d z:%d c:%d o:%d\n", A, B, C, fa, fs, fz, fc, fo); \ + c.mm = _mm_cmpistrm(a.mm, b.mm, C); \ + printf("mm_cmpestrm(\"%s\", \"%s\", 0x%x) = %016x-%016x\n", A, B, C, c.u64[1], c.u64[0]) + + #define GO(A, B, C) \ + a = load_string(A); \ + b = load_string(B); \ + GO1(A, B, C); \ + a = load_stringw(A);\ + b = load_stringw(B);\ + GO1(A, B, C+1) \ + + #define GO2(C) \ + GO(string1, string2, C); \ + GO(string2, string1, C); \ + GO(string1, string3, C); \ + GO(string3, string1, C); \ + GO(string1, string4, C); \ + GO(string4, string1, C); \ + GO(string1, string5, C); \ + GO(string5, string1, C); + + GO2(0x00) + GO2(0x04) + GO2(0x08) + GO2(0x0c) + GO2(0x10) + GO2(0x30) + GO2(0b1001100) + GO2(0b0101100) + GO2(0b0110100) + GO2(0b0110110) + GO2(0b1110100) + + unsigned int crc = 0; + printf("crc32(0x%x, byte:0x%x) => ", crc, 0); + crc = _mm_crc32_u8(crc, 0); + printf("0x%x\n", crc); + printf("crc32(0x%x, byte:0x%x) => ", crc, 10); + crc = _mm_crc32_u8(crc, 10); + printf("0x%x\n", crc); + printf("crc32(0x%x, dword:0x%x) => ", crc, 0); + crc = _mm_crc32_u32(crc, 0); + printf("0x%x\n", crc); + printf("crc32(0x%x, dword:0x%x) => ", crc, 0x123456); + crc = _mm_crc32_u32(crc, 0x123456); + printf("0x%x\n", crc); + printf("crc32(0x%x, word:0x%x) => ", crc, 0x8765); + crc = _mm_crc32_u16(crc, 0x8765); + printf("0x%x\n", crc); + + return 0; +} diff --git a/tests32/test26.c b/tests32/test26.c new file mode 100644 index 0000000..f2097a1 --- /dev/null +++ b/tests32/test26.c @@ -0,0 +1,116 @@ +#include +#include +#include +#include +#define USE_ASM_ROUNDING +#include "roundtest.h" + +// Build with +// `gcc -march=core2 -O0 -m32 test26.c -o test26 -std=c99 -masm=intel +// -mfpmath=387 -frounding-math` + +#define TEST_CONVERT_(stype, s_) \ + do { \ + stype s; \ + TEST_(s = (s_), (double)s, "%a"); \ + TEST_(s = (s_), (float)s, "%a"); \ + /* converting too large float to integer, the result is undefined, on both \ + * c99 and FISTP instruction */ \ + if (INT64_MIN <= s && INT64_MAX <= s) \ + TEST_(s = (s_), (int64_t)s, "%" PRId64); \ + if (INT32_MIN <= s && INT32_MAX <= s) \ + TEST_(s = (s_), (int32_t)s, "%" PRId32); \ + if (INT16_MIN <= s && INT16_MAX <= s) \ + TEST_(s = (s_), (int16_t)s, "%" PRId16); \ + if (INT8_MIN <= s && INT8_MAX <= s) \ + TEST_(s = (s_), (int8_t)s, "%" PRId8); \ + if (0 <= s && UINT64_MAX <= s) \ + TEST_(s = (s_), (uint64_t)s, "%" PRIu64); \ + if (0 <= s && UINT32_MAX <= s) \ + TEST_(s = (s_), (unsigned int)s, "%" PRIu32); \ + if (0 <= s && UINT16_MAX <= s) \ + TEST_(s = (s_), (unsigned short)s, "%" PRIu16); \ + if (0 <= s && UINT8_MAX <= s) \ + TEST_(s = (s_), (unsigned char)s, "%" PRIu8); \ + } while (0) + +#define TEST_CONVERT(stype, s_) \ + do { \ + TEST_CONVERT_(stype, s_); \ + TEST_CONVERT_(stype, -(s_)); \ + } while (0) + +#define TEST_2NUMBER(d1type, d1_, d2type, d2_, operation) \ + do { \ + d1type d1; \ + d2type d2; \ + TEST((d1 = (d1_), d2 = (d2_)), operation); \ + TEST((d1 = -(d1_), d2 = (d2_)), operation); \ + TEST((d1 = (d1_), d2 = -(d2_)), operation); \ + TEST((d1 = -(d1_), d2 = -(d2_)), operation); \ + } while (0) + +int main() { + double d; + float f; + int64_t i64; + TEST_CONVERT(double, 0x1.123456789abcp2); // FISTTP + TEST_(d = (0x1.123456789abcp512), (float)d, "%a"); + TEST_CONVERT(double, 0x1.123456789abcp29); + TEST_(d = (-0x1.123456789abcp30), (int32_t)d, "%" PRId32); + TEST_(d = (-0x1.123456789abcp62), (int64_t)d, "%" PRId64); + + TEST_CONVERT(float, 0x1.123456789abcp2f); + TEST_CONVERT(float, 0x1.123456789abcp29f); + TEST_(f = -0x1.123456789abcp30f, (int32_t)f, "%" PRId32); + // to be fixed: + //TEST_(f = -0x1.123456789abcp62f, (int64_t)f, "%" PRId64); + // The direction of rounding when an integer is converted to a floating-point + // number that cannot exactly represent the original value + // https://gcc.gnu.org/onlinedocs/gcc/Floating-point-implementation.html + // to be fixed: + //TEST_(i64 = INT64_MAX, (double)i64, "%a"); // FILD and FSTP + TEST(d = -0x1.1234567p0, (double)((int)d)); + TEST(d = 0x1.9234567p0, (double)((int)d)); + TEST(d = -0x1.9234567p0, (double)((int)d)); + + TEST(d = 0x1.1234567p0, (double)((long int)d)); + TEST(d = -0x1.1234567p0, (double)((long int)d)); + TEST(d = 0x1.9234567p0, (double)((long int)d)); + TEST(d = -0x1.9234567p0, (double)((long int)d)); + + TEST_2NUMBER(double, 1.0, double, 0x1.0000000000001p0, d1 + d2); + TEST_2NUMBER(double, 1.0, double, 0x1.0000000000001p0, d1 - d2); + TEST_2NUMBER(double, 1.0, double, 0x1.0000000000001p0, d2 - d1); + TEST_2NUMBER(double, 1.0, double, 0x1.000000000000dp-4, d1 + d2); + TEST_2NUMBER(double, 1.0, double, 0x1.000000000000dp-4, d1 - d2); + TEST_2NUMBER(double, 1.0, double, 0x1.000000000000dp-4, d2 - d1); + + TEST_2NUMBER(double, 0x1.233445566778p0, double, 0x1.3456789abcdep0, d1 + d2); + TEST_2NUMBER(float, 0x1.233445566778p0f, float, 0x1.3456789abcdep0f, d1 *d2); + TEST_2NUMBER(float, 0x1.233445566778p0f, double, 0x1.3456789abcdep0, d1 *d2); + TEST_2NUMBER(double, 0x1.233445566778p0, double, 0x1.3456789abcdep0, d1 *d2); + TEST_2NUMBER(float, 0x1.233445566778p0f, double, 0x1.3456789abcdep0, d1 *d2); + TEST_2NUMBER(double, 0x1.233445566778p0, float, 0x1.3456789abcdep0, d1 *d2); + TEST_2NUMBER(float, 0x1.233445566778p0f, float, 0x1.3456789abcdep0f, d1 *d2); + TEST_2NUMBER(double, 0x1.233445566778p0, int, 5, d1 *d2); + TEST_2NUMBER(int, 15, double, 0x1.3456789abcdep0f, d1 *d2); + TEST_2NUMBER(float, 0x1.233445566778p0f, int, 15, d1 *d2); + TEST_2NUMBER(int, 15, float, 0x1.3456789abcdep0f, d1 *d2); + + TEST_2NUMBER(double, 0x1.233445566778p0, double, 0x1.3456789abcdep0, d1 / d2); + TEST_2NUMBER(double, 0x1.233445566778p0, double, 0x1.3456789abcdep0, d1 / d2); + TEST_2NUMBER(double, 0x1.233445566778p0, float, 0x1.3456789abcdep0f, d1 / d2); + + TEST_2NUMBER(double, 1.0, double, 0x1.0000000000001p0, d2 - d1); + TEST_2NUMBER(double, 1.0, double, 0x1.000000000000dp-4, d1 + d2); + TEST_2NUMBER(double, 1.0, double, 0x1.000000000000dp-4, d1 - d2); + TEST_2NUMBER(double, 1.0, double, 0x1.000000000000dp-4, d2 - d1); + + TEST_X87_1("FSQRT", 0x1.0000000000000p2); + TEST_X87_1("FSQRT", 0x1.0000000000001p1); + TEST_X87_1("FSQRT", 0x1.123456789abcp31); + TEST_X87_1("FSQRT", 0x1.123456789abdp31); + + return 0; +} diff --git a/wine/common/crt.c b/wine/common/crt.c new file mode 100644 index 0000000..a9b691d --- /dev/null +++ b/wine/common/crt.c @@ -0,0 +1,210 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "os.h" + +int __mingw_sprintf(char* buffer, const char* format, ...) +{ + va_list args; + int ret; + + va_start(args, format); + ret = vsprintf(buffer, format, args); + va_end(args); + + return ret; +} + +int __isnanf(float x) +{ + union { float x; unsigned int i; } u = { x }; + return (u.i & 0x7fffffff) > 0x7f800000; +} + +int __isnan(double x) +{ + union { double x; unsigned __int64 i; } u = { x }; + return (u.i & ~0ull >> 1) > 0x7ffull << 52; +} + +double math_error(int type, const char *name, double arg1, double arg2, double retval) +{ + return retval; +} + +int __fpclassify(double x) +{ + union {double f; uint64_t i;} u = {x}; + int e = u.i>>52 & 0x7ff; + if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO; + if (e==0x7ff) return u.i<<12 ? FP_NAN : FP_INFINITE; + return FP_NORMAL; +} + +int __fpclassifyf(float x) +{ + union {float f; uint32_t i;} u = {x}; + int e = u.i>>23 & 0xff; + if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO; + if (e==0xff) return u.i<<9 ? FP_NAN : FP_INFINITE; + return FP_NORMAL; +} + +int fegetround (void) +{ + return 0; +} + +int fesetround (int __rounding_direction) +{ + return 0; +} + +div_t __cdecl div(int num, int denom) +{ + div_t ret; + + ret.quot = num / denom; + ret.rem = num % denom; + return ret; +} + +ldiv_t __cdecl ldiv(long num, long denom) +{ + ldiv_t ret; + + ret.quot = num / denom; + ret.rem = num % denom; + return ret; +} + +void _assert (const char *_Message, const char *_File, unsigned _Line) +{ + // NYI +} + +char* strerror(int e) +{ + return "error"; +} + +int snprintf(char* restrict s, size_t n, const char* restrict fmt, ...) +{ + va_list args; + va_start(args, fmt); + int result = _vsnprintf(s, n, fmt, args); + va_end(args); + return result; +} + +char* strdup(const char* s) +{ + char* buf = (char*)RtlAllocateHeap(GetProcessHeap(), 0, strlen(s) + 1); + if (buf) strcpy(buf, s); + return buf; +} + +long long atoll(const char* str) +{ + ULONG tmp; + RtlCharToInteger(str, 10, &tmp); + return (LONGLONG)tmp; +} + +long long strtoll(const char* restrict str, char** restrict str_end, int base) +{ + // FIXME: it kinda work, but not identical to the C version. + ULONG tmp; + if (base == 0) { + NTSTATUS status = RtlCharToInteger(str, 10, &tmp); + if (status != STATUS_SUCCESS) RtlCharToInteger(str, 16, &tmp); + } else { + RtlCharToInteger(str, base, &tmp); + } + return (LONGLONG)tmp; +} + +BOXFILE* box_fopen(const char* filename, const char* mode) +{ + DWORD dwDesiredAccess = 0; + DWORD dwCreationDisposition = 0; + + if (strcmp(mode, "r") == 0) { + dwDesiredAccess = GENERIC_READ; + dwCreationDisposition = OPEN_EXISTING; + } else if (strcmp(mode, "w") == 0) { + dwDesiredAccess = GENERIC_WRITE; + dwCreationDisposition = CREATE_ALWAYS; + } else if (strcmp(mode, "a") == 0) { + dwDesiredAccess = FILE_APPEND_DATA; + dwCreationDisposition = OPEN_ALWAYS; + } else { + return NULL; + } + + HANDLE hFile = CreateFileA( + filename, + dwDesiredAccess, + FILE_SHARE_READ, + NULL, + dwCreationDisposition, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, + NULL); + + if (hFile == INVALID_HANDLE_VALUE) return NULL; + + BOXFILE* file = (BOXFILE*)WinMalloc(sizeof(BOXFILE)); + if (!file) { + CloseHandle(hFile); + return NULL; + } + + file->hFile = hFile; + file->buf_pos = 0; + file->buf_size = 0; + file->eof = 0; + + return file; +} + +char* box_fgets(char* str, int num, BOXFILE* stream) +{ + if (stream == NULL || str == NULL || num <= 0 || stream->eof) return NULL; + + int i = 0; + while (i < num - 1) { + if (stream->buf_pos >= stream->buf_size) { + DWORD bytesRead; + if (!ReadFile(stream->hFile, stream->buffer, BOXFILE_BUFSIZE, &bytesRead, NULL) || bytesRead == 0) { + stream->eof = 1; + break; + } + stream->buf_size = bytesRead; + stream->buf_pos = 0; + } + + char c = stream->buffer[stream->buf_pos++]; + str[i++] = c; + + if (c == '\n') + break; + } + + if (i == 0) return NULL; + + str[i] = '\0'; + return str; +} + +int box_fclose(BOXFILE* stream) +{ + if (stream == NULL) return EOF; + BOOL closed = CloseHandle(stream->hFile); + WinFree(stream); + return closed ? 0 : EOF; +} \ No newline at end of file diff --git a/wine/common/wrt.c b/wine/common/wrt.c new file mode 100644 index 0000000..188b1da --- /dev/null +++ b/wine/common/wrt.c @@ -0,0 +1,312 @@ +#include +#include +#include +#include + +#include "debug.h" +#include "wine/compiler.h" +#include "wine/debug.h" + + +#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7 + +static UINT get_nt_file_options(DWORD attributes) +{ + UINT options = 0; + + if (attributes & FILE_FLAG_BACKUP_SEMANTICS) + options |= FILE_OPEN_FOR_BACKUP_INTENT; + else + options |= FILE_NON_DIRECTORY_FILE; + if (attributes & FILE_FLAG_DELETE_ON_CLOSE) + options |= FILE_DELETE_ON_CLOSE; + if (attributes & FILE_FLAG_NO_BUFFERING) + options |= FILE_NO_INTERMEDIATE_BUFFERING; + if (!(attributes & FILE_FLAG_OVERLAPPED)) + options |= FILE_SYNCHRONOUS_IO_NONALERT; + if (attributes & FILE_FLAG_RANDOM_ACCESS) + options |= FILE_RANDOM_ACCESS; + if (attributes & FILE_FLAG_SEQUENTIAL_SCAN) + options |= FILE_SEQUENTIAL_ONLY; + if (attributes & FILE_FLAG_WRITE_THROUGH) + options |= FILE_WRITE_THROUGH; + return options; +} + +HANDLE WINAPI CreateFileW(LPCWSTR filename, DWORD access, DWORD sharing, LPSECURITY_ATTRIBUTES sa, DWORD creation, DWORD attributes, HANDLE template) +{ + UNICODE_STRING filenameU; + OBJECT_ATTRIBUTES attr; + IO_STATUS_BLOCK io; + HANDLE ret; + + static const UINT nt_disposition[5] = { FILE_CREATE, FILE_OVERWRITE_IF, FILE_OPEN, FILE_OPEN_IF, FILE_OVERWRITE }; + if (!RtlDosPathNameToNtPathName_U(filename, &filenameU, NULL, NULL)) { + return INVALID_HANDLE_VALUE; + } + if (attributes & FILE_FLAG_DELETE_ON_CLOSE) access |= DELETE; + InitializeObjectAttributes(&attr, &filenameU, OBJ_CASE_INSENSITIVE, 0, NULL); + NTSTATUS status = NtCreateFile(&ret, access | GENERIC_READ | SYNCHRONIZE, &attr, &io, NULL, attributes & FILE_ATTRIBUTE_VALID_FLAGS, sharing, + nt_disposition[creation - CREATE_NEW], get_nt_file_options(attributes), NULL, 0); + RtlFreeUnicodeString(&filenameU); + return status ? INVALID_HANDLE_VALUE : ret; +} + +HANDLE WINAPI CreateFileA(LPCSTR name, DWORD access, DWORD sharing, LPSECURITY_ATTRIBUTES sa, DWORD creation, DWORD attributes, HANDLE template) +{ + UNICODE_STRING nameU; + RtlCreateUnicodeStringFromAsciiz(&nameU, name); + HANDLE handle = CreateFileW(nameU.Buffer, access, sharing, sa, creation, attributes, template); + RtlFreeUnicodeString(&nameU); + return handle; +} + + +BOOL WINAPI CloseHandle(HANDLE handle) +{ + return !NtClose(handle); +} + +DWORD WINAPI GetEnvironmentVariableA(LPCSTR name, LPSTR value, DWORD size) +{ + UNICODE_STRING nameU, valueU; + PWSTR valueW; + NTSTATUS status; + DWORD len, ret; + + if (!(valueW = RtlAllocateHeap(GetProcessHeap(), 0, size * sizeof(WCHAR)))) return 0; + + RtlCreateUnicodeStringFromAsciiz(&nameU, name); + valueU.Length = 0; + valueU.MaximumLength = (size ? size - 1 : 0) * sizeof(WCHAR); + valueU.Buffer = valueW; + + status = RtlQueryEnvironmentVariable_U(NULL, &nameU, &valueU); + len = valueU.Length / sizeof(WCHAR); + if (status == STATUS_BUFFER_TOO_SMALL) + ret = len + 1; + else if (status) + ret = 0; + else if (!size) + ret = len + 1; + else { + if (len) RtlUnicodeToMultiByteN(value, size, &ret, valueW, len * sizeof(WCHAR)); + } + + RtlFreeUnicodeString(&nameU); + RtlFreeHeap(GetProcessHeap(), 0, valueW); + return ret; +} + +DWORD WINAPI GetFileAttributesW(LPCWSTR name) +{ + FILE_BASIC_INFORMATION info; + UNICODE_STRING nameU; + OBJECT_ATTRIBUTES attr; + NTSTATUS status; + + if (!RtlDosPathNameToNtPathName_U(name, &nameU, NULL, NULL)) { + return INVALID_FILE_ATTRIBUTES; + } + + InitializeObjectAttributes(&attr, &nameU, OBJ_CASE_INSENSITIVE, 0, NULL); + status = NtQueryAttributesFile(&attr, &info); + RtlFreeUnicodeString(&nameU); + + if (status == STATUS_SUCCESS) return info.FileAttributes; + if (RtlIsDosDeviceName_U(name)) return FILE_ATTRIBUTE_ARCHIVE; + return INVALID_FILE_ATTRIBUTES; +} + +DWORD WINAPI GetFileAttributesA(LPCSTR name) +{ + UNICODE_STRING nameU; + RtlCreateUnicodeStringFromAsciiz(&nameU, name); + DWORD ret = GetFileAttributesW(nameU.Buffer); + RtlFreeUnicodeString(&nameU); + return ret; +} + +HANDLE WINAPI GetProcessHeap(void) +{ + return ((HANDLE**)NtCurrentTeb())[12][6]; +} + + +DWORD WINAPI GetModuleFileNameW(HMODULE module, LPWSTR filename, DWORD size) +{ + ULONG len = 0; + UNICODE_STRING filenameU; + NTSTATUS status; + + filenameU.Buffer = filename; + filenameU.MaximumLength = min(size, UNICODE_STRING_MAX_CHARS) * sizeof(WCHAR); + status = LdrGetDllFullName(module, &filenameU); + if (!status || status == STATUS_BUFFER_TOO_SMALL) len = filenameU.Length / sizeof(WCHAR); + return len; +} + + +DWORD WINAPI GetModuleFileNameA(HMODULE module, LPSTR filename, DWORD size) +{ + LPWSTR filenameW = RtlAllocateHeap(GetProcessHeap(), 0, size * sizeof(WCHAR)); + DWORD len, ret = 0; + + if (!filenameW) return 0; + + if ((len = GetModuleFileNameW(module, filenameW, size))) { + RtlUnicodeToMultiByteN(filename, size, &ret, filenameW, len * sizeof(WCHAR)); + if (ret < size) filename[ret] = 0; + } + RtlFreeHeap(GetProcessHeap(), 0, filenameW); + return ret; +} + +BOOL WINAPI ReadFile(HANDLE file, LPVOID buffer, DWORD count, LPDWORD result, LPOVERLAPPED overlapped) +{ + LARGE_INTEGER offset; + PLARGE_INTEGER poffset = NULL; + IO_STATUS_BLOCK iosb; + PIO_STATUS_BLOCK io_status = &iosb; + HANDLE event = 0; + NTSTATUS status; + LPVOID cvalue = NULL; + + if (result) *result = 0; + + if (overlapped) { + printf_log(LOG_NONE, "unimplemented overlapped in ReadFile\n"); + return FALSE; + } else + io_status->Information = 0; + io_status->Status = STATUS_PENDING; + + status = NtReadFile(file, event, NULL, cvalue, io_status, buffer, count, poffset, NULL); + + if (status == STATUS_PENDING && !overlapped) { + printf_log(LOG_NONE, "unimplemented pending in ReadFile\n"); + } + + if (result) *result = overlapped && status ? 0 : io_status->Information; + + if (status == STATUS_END_OF_FILE) { + if (overlapped != NULL) { + return FALSE; + } + } else if (status && status != STATUS_TIMEOUT) { + return FALSE; + } + return TRUE; +} + + +static void fillSystemInfo(SYSTEM_INFO* si, const SYSTEM_BASIC_INFORMATION__* basic_info, const SYSTEM_CPU_INFORMATION* cpu_info) +{ + si->wProcessorArchitecture = cpu_info->ProcessorArchitecture; + si->wReserved = 0; + si->dwPageSize = basic_info->PageSize; + si->lpMinimumApplicationAddress = basic_info->LowestUserAddress; + si->lpMaximumApplicationAddress = basic_info->HighestUserAddress; + si->dwActiveProcessorMask = basic_info->ActiveProcessorsAffinityMask; + si->dwNumberOfProcessors = basic_info->NumberOfProcessors; + si->dwAllocationGranularity = basic_info->AllocationGranularity; + si->wProcessorLevel = cpu_info->ProcessorLevel; + si->wProcessorRevision = cpu_info->ProcessorRevision; + + switch (cpu_info->ProcessorArchitecture) { + case PROCESSOR_ARCHITECTURE_ARM64: + si->dwProcessorType = 0; + break; + default: + printf_log(LOG_NONE, "Unknown processor architecture %x\n", cpu_info->ProcessorArchitecture); + si->dwProcessorType = 0; + break; + } +} + +void WINAPI GetSystemInfo(SYSTEM_INFO* si) +{ + SYSTEM_BASIC_INFORMATION__ basic_info; + SYSTEM_CPU_INFORMATION cpu_info; + + if (NtQuerySystemInformation(0 /* SystemBasicInformation */, &basic_info, sizeof(basic_info), NULL) + || NtQuerySystemInformation(1 /* SystemCpuInformation */, &cpu_info, sizeof(cpu_info), NULL)) + return; + + fillSystemInfo(si, &basic_info, &cpu_info); +} + +BOOL WINAPI IsProcessorFeaturePresent(DWORD feature) +{ + return RtlIsProcessorFeaturePresent(feature); +} + +LSTATUS WINAPI RegOpenKeyExA(HKEY hkey, LPCSTR name, DWORD options, REGSAM access, PHKEY retkey) +{ + if (hkey != HKEY_LOCAL_MACHINE) { + printf_log(LOG_NONE, "Unsupported registry key %p\n", hkey); + return ERROR_INVALID_HANDLE; + } + + UNICODE_STRING rootkeyU; + UNICODE_STRING nameU; + OBJECT_ATTRIBUTES attr; + NTSTATUS status; + HANDLE handle; + RtlInitUnicodeString(&rootkeyU, L"\\Registry\\Machine"); + InitializeObjectAttributes(&attr, &rootkeyU, OBJ_CASE_INSENSITIVE, 0, NULL); + if (NtOpenKey(&handle, access, &attr)) return RtlNtStatusToDosError(status); + + RtlCreateUnicodeStringFromAsciiz(&nameU, name); + InitializeObjectAttributes(&attr, &nameU, OBJ_CASE_INSENSITIVE, handle, NULL); + status = NtOpenKey((HANDLE*)retkey, access, &attr); + RtlFreeUnicodeString(&nameU); + NtClose(handle); + return RtlNtStatusToDosError(status); +} + +LSTATUS WINAPI RegQueryValueExA(HKEY hkey, LPCSTR name, LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count) +{ + NTSTATUS status; + ANSI_STRING nameA; + UNICODE_STRING nameW; + DWORD total_size, datalen = 0; + char buffer[256]; + KEY_VALUE_PARTIAL_INFORMATION* info = (KEY_VALUE_PARTIAL_INFORMATION*)buffer; + static const int info_size = offsetof(KEY_VALUE_PARTIAL_INFORMATION, Data); + + if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER; + + if (count) datalen = *count; + if (!data && count) *count = 0; + + RtlInitAnsiString(&nameA, name); + if ((status = RtlAnsiStringToUnicodeString(&nameW, &nameA, TRUE))) + return RtlNtStatusToDosError(status); + + status = NtQueryValueKey(hkey, &nameW, KeyValuePartialInformation, buffer, sizeof(buffer), &total_size); + if (status) { + RtlFreeUnicodeString(&nameW); + return RtlNtStatusToDosError(status); + } + + if (data) { + if (total_size - info_size > datalen) + status = STATUS_BUFFER_OVERFLOW; + else + memcpy(data, buffer + info_size, total_size - info_size); + } else + status = STATUS_SUCCESS; + + if (type) *type = info->Type; + if (count) *count = total_size - info_size; + + RtlFreeUnicodeString(&nameW); + return RtlNtStatusToDosError(status); +} + +LSTATUS WINAPI RegCloseKey(HKEY hkey) +{ + if (!hkey) return ERROR_INVALID_HANDLE; + return RtlNtStatusToDosError(NtClose(hkey)); +} diff --git a/wine/include/wine/compiler.h b/wine/include/wine/compiler.h new file mode 100644 index 0000000..b585d15 --- /dev/null +++ b/wine/include/wine/compiler.h @@ -0,0 +1,122 @@ +#ifndef __COMPILER_H_ +#define __COMPILER_H_ + +#include + +/* Things missing from mingw64 right now */ +#define ThreadWow64Context (29) +#define WOW64_TLS_CPURESERVED (1) +#define WOW64_TLS_MAX_NUMBER (19) +#define WOW64_CPURESERVED_FLAG_RESET_STATE (1) + +typedef enum _MEMORY_INFORMATION_CLASS { + MemoryBasicInformation, + MemoryWorkingSetInformation, + MemoryMappedFilenameInformation, + MemoryRegionInformation, + MemoryWorkingSetExInformation, + MemorySharedCommitInformation, + MemoryImageInformation, + MemoryRegionInformationEx, + MemoryPrivilegedBasicInformation, + MemoryEnclaveImageInformation, + MemoryBasicInformationCapped, + MemoryPhysicalContiguityInformation, + MemoryBadInformation, + MemoryBadInformationAllProcesses, +} MEMORY_INFORMATION_CLASS; + +typedef struct _WOW64_CPURESERVED { + USHORT Flags; + USHORT Machine; +} WOW64_CPURESERVED; + +typedef struct _XMM_SAVE_AREA32 { + WORD ControlWord; + WORD StatusWord; + BYTE TagWord; + BYTE Reserved1; + WORD ErrorOpcode; + DWORD ErrorOffset; + WORD ErrorSelector; + WORD Reserved2; + DWORD DataOffset; + WORD DataSelector; + WORD Reserved3; + DWORD MxCsr; + DWORD MxCsr_Mask; + M128A FloatRegisters[8]; + M128A XmmRegisters[16]; + BYTE Reserved4[96]; +} XMM_SAVE_AREA32; + +typedef struct _SYSTEM_CPU_INFORMATION { + USHORT ProcessorArchitecture; + USHORT ProcessorLevel; + USHORT ProcessorRevision; + USHORT MaximumProcessors; + ULONG ProcessorFeatureBits; +} SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION; + +typedef struct _SYSTEM_BASIC_INFORMATION__ { + DWORD unknown; + ULONG KeMaximumIncrement; + ULONG PageSize; + ULONG MmNumberOfPhysicalPages; + ULONG MmLowestPhysicalPage; + ULONG MmHighestPhysicalPage; + ULONG_PTR AllocationGranularity; + PVOID LowestUserAddress; + PVOID HighestUserAddress; + ULONG_PTR ActiveProcessorsAffinityMask; + BYTE NumberOfProcessors; +} SYSTEM_BASIC_INFORMATION__, *PSYSTEM_BASIC_INFORMATION__; + +typedef struct _KEY_VALUE_PARTIAL_INFORMATION { + ULONG TitleIndex; + ULONG Type; + ULONG DataLength; + UCHAR Data[1]; +} KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION; + +typedef enum _KEY_VALUE_INFORMATION_CLASS { + KeyValueBasicInformation, + KeyValueFullInformation, + KeyValuePartialInformation, + KeyValueFullInformationAlign64, + KeyValuePartialInformationAlign64, + KeyValueLayerInformation, +} KEY_VALUE_INFORMATION_CLASS; + +#define NtCurrentProcess() ((HANDLE)(LONG_PTR) - 1) + +NTSTATUS WINAPI RtlWow64GetCurrentCpuArea(USHORT*, void**, void**); +NTSTATUS WINAPI Wow64SystemServiceEx(UINT, UINT*); +NTSYSAPI NTSTATUS WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*, HMODULE*); +NTSYSAPI NTSTATUS WINAPI LdrGetDllFullName(HMODULE, UNICODE_STRING*); +NTSYSAPI NTSTATUS WINAPI NtContinue(PCONTEXT, BOOLEAN); +NTSYSAPI NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE, LPCVOID, MEMORY_INFORMATION_CLASS, PVOID, SIZE_T, SIZE_T*); +NTSYSAPI NTSTATUS WINAPI NtReadFile(HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER, PULONG); +NTSYSAPI void* WINAPI RtlFindExportedRoutineByName(HMODULE, const char*); +NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlRaiseStatus(NTSTATUS); +NTSYSAPI void WINAPI RtlRaiseException(EXCEPTION_RECORD*); +NTSYSAPI NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR, PUNICODE_STRING, PUNICODE_STRING); +NTSYSAPI NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*, FILE_BASIC_INFORMATION*); +NTSYSAPI ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR); +NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR, DWORD, LPDWORD, LPCWSTR, DWORD); +NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE, PVOID*, SIZE_T*, ULONG, ULONG*); +NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE, PVOID*, ULONG_PTR, SIZE_T*, ULONG, ULONG); +PVOID WINAPI RtlReAllocateHeap(HANDLE, ULONG, PVOID, SIZE_T); +NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE, PVOID*, SIZE_T*, ULONG); +BOOLEAN WINAPI RtlIsProcessorFeaturePresent(UINT feature); +NTSTATUS WINAPI NtOpenKey(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*); +NTSYSAPI NTSTATUS WINAPI NtQueryValueKey(HANDLE, const UNICODE_STRING*, KEY_VALUE_INFORMATION_CLASS, void*, DWORD, DWORD*); + +static inline uintptr_t calculate_fs(void) +{ + /* until mingw64 has WowTebOffset in the TEB struct */ + uint8_t* teb = (uint8_t*)NtCurrentTeb(); + return (uintptr_t)(teb + *(int32_t*)(teb + 0x180c)); +} + +#endif //__COMPILER_H_ diff --git a/wine/include/wine/debug.h b/wine/include/wine/debug.h new file mode 100644 index 0000000..e903d60 --- /dev/null +++ b/wine/include/wine/debug.h @@ -0,0 +1,8 @@ +#ifndef __WINE_DEBUG_H__ +#define __WINE_DEBUG_H__ + +#include + +int __cdecl __wine_dbg_output( const char *str ); + +#endif // __WINE_DEBUG_H__ \ No newline at end of file diff --git a/wine/ntdll.def b/wine/ntdll.def new file mode 100644 index 0000000..ef76c99 --- /dev/null +++ b/wine/ntdll.def @@ -0,0 +1,1378 @@ +; File generated automatically from wine/dlls/ntdll/ntdll.spec; do not edit! +; To generate: winebuild --def -E wine/dlls/ntdll/ntdll.spec > ntdll.def + +LIBRARY ntdll.dll + +EXPORTS + A_SHAFinal @1 + A_SHAInit @2 + A_SHAUpdate @3 + ApiSetQueryApiSetPresence @4 + ApiSetQueryApiSetPresenceEx @5 + CsrAllocateCaptureBuffer @6 PRIVATE + CsrAllocateCapturePointer @7 PRIVATE + CsrAllocateMessagePointer @8 PRIVATE + CsrCaptureMessageBuffer @9 PRIVATE + CsrCaptureMessageString @10 PRIVATE + CsrCaptureTimeout @11 PRIVATE + CsrClientCallServer @12 PRIVATE + CsrClientConnectToServer @13 PRIVATE + CsrClientMaxMessage @14 PRIVATE + CsrClientSendMessage @15 PRIVATE + CsrClientThreadConnect @16 PRIVATE + CsrFreeCaptureBuffer @17 PRIVATE + CsrIdentifyAlertableThread @18 PRIVATE + CsrNewThread @19 PRIVATE + CsrProbeForRead @20 PRIVATE + CsrProbeForWrite @21 PRIVATE + CsrSetPriorityClass @22 PRIVATE + CsrpProcessCallbackRequest @23 PRIVATE + DbgBreakPoint @24 + DbgPrint @25 + DbgPrintEx @26 + DbgPrompt @27 PRIVATE + DbgUiConnectToDbg @28 + DbgUiContinue @29 + DbgUiConvertStateChangeStructure @30 + DbgUiDebugActiveProcess @31 + DbgUiGetThreadDebugObject @32 + DbgUiIssueRemoteBreakin @33 + DbgUiRemoteBreakin @34 + DbgUiSetThreadDebugObject @35 + DbgUiStopDebugging @36 + DbgUiWaitStateChange @37 + DbgUserBreakPoint @38 + EtwEventActivityIdControl @39 + EtwEventEnabled @40 + EtwEventProviderEnabled @41 + EtwEventRegister @42 + EtwEventSetInformation @43 + EtwEventUnregister @44 + EtwEventWrite @45 + EtwEventWriteString @46 + EtwEventWriteTransfer @47 + EtwGetTraceEnableFlags @48 + EtwGetTraceEnableLevel @49 + EtwGetTraceLoggerHandle @50 + EtwLogTraceEvent @51 + EtwRegisterTraceGuidsA @52 + EtwRegisterTraceGuidsW @53 + EtwTraceMessage @54 + EtwTraceMessageVa @55 + EtwUnregisterTraceGuids @56 + KiRaiseUserExceptionDispatcher @57 + KiUserApcDispatcher @58 + KiUserCallbackDispatcher @59 + KiUserExceptionDispatcher @60 + LdrAccessResource @61 + LdrAddDllDirectory @62 + LdrAddRefDll @63 + LdrDisableThreadCalloutsForDll @64 + LdrEnumResources @65 PRIVATE + LdrEnumerateLoadedModules @66 + LdrFindEntryForAddress @67 + LdrFindResourceDirectory_U @68 + LdrFindResource_U @69 + LdrFlushAlternateResourceModules @70 PRIVATE + LdrGetDllDirectory @71 + LdrGetDllFullName @72 + LdrGetDllHandle @73 + LdrGetDllHandleEx @74 + LdrGetDllPath @75 + LdrGetProcedureAddress @76 + LdrInitShimEngineDynamic @77 PRIVATE + LdrInitializeThunk @78 + LdrLoadAlternateResourceModule @79 PRIVATE + LdrLoadDll @80 + LdrLockLoaderLock @81 + LdrProcessRelocationBlock @82 + LdrQueryImageFileExecutionOptions @83 + LdrQueryProcessModuleInformation @84 + LdrRegisterDllNotification @85 + LdrRemoveDllDirectory @86 + LdrResolveDelayLoadedAPI @87 + LdrSetAppCompatDllRedirectionCallback @88 PRIVATE + LdrSetDefaultDllDirectories @89 + LdrSetDllDirectory @90 + LdrSetDllManifestProber @91 PRIVATE + LdrShutdownProcess @92 + LdrShutdownThread @93 + LdrSystemDllInitBlock @94 DATA + LdrUnloadAlternateResourceModule @95 PRIVATE + LdrUnloadDll @96 + LdrUnlockLoaderLock @97 + LdrUnregisterDllNotification @98 + LdrVerifyImageMatchesChecksum @99 PRIVATE + MD4Final @100 + MD4Init @101 + MD4Update @102 + MD5Final @103 + MD5Init @104 + MD5Update @105 + NlsAnsiCodePage @106 DATA + NlsMbCodePageTag @107 DATA + NlsMbOemCodePageTag @108 DATA + NtAcceptConnectPort @109 + NtAccessCheck @110 + NtAccessCheckAndAuditAlarm @111 + NtAddAtom @112 + NtAdjustGroupsToken @113 + NtAdjustPrivilegesToken @114 + NtAlertResumeThread @115 + NtAlertThread @116 + NtAlertThreadByThreadId @117 + NtAllocateLocallyUniqueId @118 + NtAllocateUuids @119 + NtAllocateVirtualMemory @120 + NtAllocateVirtualMemoryEx @121 + NtAreMappedFilesTheSame @122 + NtAssignProcessToJobObject @123 + NtCallbackReturn @124 + NtCancelIoFile @125 + NtCancelIoFileEx @126 + NtCancelSynchronousIoFile @127 + NtCancelTimer @128 + NtClearEvent @129 + NtClose @130 + NtCommitTransaction @131 + NtCompareObjects @132 + NtCompleteConnectPort @133 + NtConnectPort @134 + NtContinue @135 + NtCreateDebugObject @136 + NtCreateDirectoryObject @137 + NtCreateEvent @138 + NtCreateFile @139 + NtCreateIoCompletion @140 + NtCreateJobObject @141 + NtCreateKey @142 + NtCreateKeyTransacted @143 + NtCreateKeyedEvent @144 + NtCreateLowBoxToken @145 + NtCreateMailslotFile @146 + NtCreateMutant @147 + NtCreateNamedPipeFile @148 + NtCreatePagingFile @149 + NtCreatePort @150 + NtCreateSection @151 + NtCreateSemaphore @152 + NtCreateSymbolicLinkObject @153 + NtCreateThread @154 + NtCreateThreadEx @155 + NtCreateTimer @156 + NtCreateTransaction @157 + NtCreateUserProcess @158 + NtDebugActiveProcess @159 + NtDebugContinue @160 + NtDelayExecution @161 + NtDeleteAtom @162 + NtDeleteFile @163 + NtDeleteKey @164 + NtDeleteValueKey @165 + NtDeviceIoControlFile @166 + NtDisplayString @167 + NtDuplicateObject @168 + NtDuplicateToken @169 + NtEnumerateKey @170 + NtEnumerateValueKey @171 + NtFilterToken @172 + NtFindAtom @173 + NtFlushBuffersFile @174 + NtFlushInstructionCache @175 + NtFlushKey @176 + NtFlushProcessWriteBuffers @177 + NtFlushVirtualMemory @178 + NtFreeVirtualMemory @179 + NtFsControlFile @180 + NtGetContextThread @181 + NtGetCurrentProcessorNumber @182 + NtGetNextThread @183 + NtGetNlsSectionPtr @184 + NtGetTickCount @185 + NtGetWriteWatch @186 + NtImpersonateAnonymousToken @187 + NtInitializeNlsFiles @188 + NtInitiatePowerAction @189 + NtIsProcessInJob @190 + NtListenPort @191 + NtLoadDriver @192 + NtLoadKey2 @193 + NtLoadKey @194 + NtLoadKeyEx @195 + NtLockFile @196 + NtLockVirtualMemory @197 + NtMakeTemporaryObject @198 + NtMapViewOfSection @199 + NtMapViewOfSectionEx @200 + NtNotifyChangeDirectoryFile @201 + NtNotifyChangeKey @202 + NtNotifyChangeMultipleKeys @203 + NtOpenDirectoryObject @204 + NtOpenEvent @205 + NtOpenFile @206 + NtOpenIoCompletion @207 + NtOpenJobObject @208 + NtOpenKey @209 + NtOpenKeyEx @210 + NtOpenKeyTransacted @211 + NtOpenKeyTransactedEx @212 + NtOpenKeyedEvent @213 + NtOpenMutant @214 + NtOpenProcess @215 + NtOpenProcessToken @216 + NtOpenProcessTokenEx @217 + NtOpenSection @218 + NtOpenSemaphore @219 + NtOpenSymbolicLinkObject @220 + NtOpenThread @221 + NtOpenThreadToken @222 + NtOpenThreadTokenEx @223 + NtOpenTimer @224 + NtPowerInformation @225 + NtPrivilegeCheck @226 + NtProtectVirtualMemory @227 + NtPulseEvent @228 + NtQueryAttributesFile @229 + NtQueryDefaultLocale @230 + NtQueryDefaultUILanguage @231 + NtQueryDirectoryFile @232 + NtQueryDirectoryObject @233 + NtQueryEaFile @234 + NtQueryEvent @235 + NtQueryFullAttributesFile @236 + NtQueryInformationAtom @237 + NtQueryInformationFile @238 + NtQueryInformationJobObject @239 + NtQueryInformationProcess @240 + NtQueryInformationThread @241 + NtQueryInformationToken @242 + NtQueryInstallUILanguage @243 + NtQueryIoCompletion @244 + NtQueryKey @245 + NtQueryLicenseValue @246 + NtQueryMultipleValueKey @247 + NtQueryMutant @248 + NtQueryObject @249 + NtQueryPerformanceCounter @250 + NtQuerySection @251 + NtQuerySecurityObject @252 + NtQuerySemaphore @253 + NtQuerySymbolicLinkObject @254 + NtQuerySystemEnvironmentValue @255 + NtQuerySystemEnvironmentValueEx @256 + NtQuerySystemInformation @257 + NtQuerySystemInformationEx @258 + NtQuerySystemTime @259 + NtQueryTimer @260 + NtQueryTimerResolution @261 + NtQueryValueKey @262 + NtQueryVirtualMemory @263 + NtQueryVolumeInformationFile @264 + NtQueueApcThread @265 + NtRaiseException @266 + NtRaiseHardError @267 + NtReadFile @268 + NtReadFileScatter @269 + NtReadVirtualMemory @270 + NtRegisterThreadTerminatePort @271 + NtReleaseKeyedEvent @272 + NtReleaseMutant @273 + NtReleaseSemaphore @274 + NtRemoveIoCompletion @275 + NtRemoveIoCompletionEx @276 + NtRemoveProcessDebug @277 + NtRenameKey @278 + NtReplaceKey @279 + NtReplyWaitReceivePort @280 + NtRequestWaitReplyPort @281 + NtResetEvent @282 + NtResetWriteWatch @283 + NtRestoreKey @284 + NtResumeProcess @285 + NtResumeThread @286 + NtRollbackTransaction @287 + NtSaveKey @288 + NtSecureConnectPort @289 + NtSetContextThread @290 + NtSetDebugFilterState @291 + NtSetDefaultLocale @292 + NtSetDefaultUILanguage @293 + NtSetEaFile @294 + NtSetEvent @295 + NtSetInformationDebugObject @296 + NtSetInformationFile @297 + NtSetInformationJobObject @298 + NtSetInformationKey @299 + NtSetInformationObject @300 + NtSetInformationProcess @301 + NtSetInformationThread @302 + NtSetInformationToken @303 + NtSetInformationVirtualMemory @304 + NtSetIntervalProfile @305 + NtSetIoCompletion @306 + NtSetLdtEntries @307 + NtSetSecurityObject @308 + NtSetSystemInformation @309 + NtSetSystemTime @310 + NtSetThreadExecutionState @311 + NtSetTimer @312 + NtSetTimerResolution @313 + NtSetValueKey @314 + NtSetVolumeInformationFile @315 + NtShutdownSystem @316 + NtSignalAndWaitForSingleObject @317 + NtSuspendProcess @318 + NtSuspendThread @319 + NtSystemDebugControl @320 + NtTerminateJobObject @321 + NtTerminateProcess @322 + NtTerminateThread @323 + NtTestAlert @324 + NtTraceControl @325 + NtUnloadDriver @326 + NtUnloadKey @327 + NtUnlockFile @328 + NtUnlockVirtualMemory @329 + NtUnmapViewOfSection @330 + NtUnmapViewOfSectionEx @331 + NtWaitForAlertByThreadId @332 + NtWaitForDebugEvent @333 + NtWaitForKeyedEvent @334 + NtWaitForMultipleObjects @335 + NtWaitForSingleObject @336 + NtWriteFile @337 + NtWriteFileGather @338 + NtWriteVirtualMemory @339 + NtYieldExecution @340 + PfxFindPrefix @341 PRIVATE + PfxInitialize @342 PRIVATE + PfxInsertPrefix @343 PRIVATE + PfxRemovePrefix @344 PRIVATE + RtlAbortRXact @345 PRIVATE + RtlAbsoluteToSelfRelativeSD @346 + RtlAcquirePebLock @347 + RtlAcquireResourceExclusive @348 + RtlAcquireResourceShared @349 + RtlAcquireSRWLockExclusive @350 + RtlAcquireSRWLockShared @351 + RtlActivateActivationContext @352 + RtlActivateActivationContextEx @353 + RtlActivateActivationContextUnsafeFast @354 PRIVATE + RtlAddAccessAllowedAce @355 + RtlAddAccessAllowedAceEx @356 + RtlAddAccessAllowedObjectAce @357 + RtlAddAccessDeniedAce @358 + RtlAddAccessDeniedAceEx @359 + RtlAddAccessDeniedObjectAce @360 + RtlAddAce @361 + RtlAddActionToRXact @362 PRIVATE + RtlAddAtomToAtomTable @363 + RtlAddAttributeActionToRXact @364 PRIVATE + RtlAddAuditAccessAce @365 + RtlAddAuditAccessAceEx @366 + RtlAddAuditAccessObjectAce @367 + RtlAddFunctionTable @368 + RtlAddGrowableFunctionTable @369 + RtlAddMandatoryAce @370 + RtlAddProcessTrustLabelAce @371 + RtlAddRefActivationContext @372 + RtlAddVectoredContinueHandler @373 + RtlAddVectoredExceptionHandler @374 + RtlAddressInSectionTable @375 + RtlAdjustPrivilege @376 + RtlAllocateAndInitializeSid @377 + RtlAllocateHandle @378 + RtlAllocateHeap @379 + RtlAnsiCharToUnicodeChar @380 + RtlAnsiStringToUnicodeSize @381 + RtlAnsiStringToUnicodeString @382 + RtlAppendAsciizToString @383 + RtlAppendStringToString @384 + RtlAppendUnicodeStringToString @385 + RtlAppendUnicodeToString @386 + RtlApplyRXact @387 PRIVATE + RtlApplyRXactNoFlush @388 PRIVATE + RtlAreAllAccessesGranted @389 + RtlAreAnyAccessesGranted @390 + RtlAreBitsClear @391 + RtlAreBitsSet @392 + RtlAssert @393 + RtlCaptureContext @394 + RtlCaptureStackBackTrace @395 + RtlCharToInteger @396 + RtlCheckRegistryKey @397 + RtlClearAllBits @398 + RtlClearBits @399 + RtlClosePropertySet @400 PRIVATE + RtlCompactHeap @401 + RtlCompareMemory @402 + RtlCompareMemoryUlong @403 + RtlCompareString @404 + RtlCompareUnicodeString @405 + RtlCompareUnicodeStrings @406 + RtlCompressBuffer @407 + RtlComputeCrc32 @408 + RtlConsoleMultiByteToUnicodeN @409 PRIVATE + RtlConvertExclusiveToShared @410 PRIVATE + RtlConvertSharedToExclusive @411 PRIVATE + RtlConvertSidToUnicodeString @412 + RtlConvertToAutoInheritSecurityObject @413 + RtlConvertUiListToApiList @414 PRIVATE + RtlCopyContext @415 + RtlCopyExtendedContext @416 + RtlCopyLuid @417 + RtlCopyLuidAndAttributesArray @418 + RtlCopyMemory @419 + RtlCopyMemoryNonTemporal=RtlCopyMemory @420 + RtlCopySecurityDescriptor @421 + RtlCopySid @422 + RtlCopySidAndAttributesArray @423 PRIVATE + RtlCopyString @424 + RtlCopyUnicodeString @425 + RtlCreateAcl @426 + RtlCreateActivationContext @427 + RtlCreateAndSetSD @428 PRIVATE + RtlCreateAtomTable @429 + RtlCreateEnvironment @430 + RtlCreateHeap @431 + RtlCreateProcessParameters @432 + RtlCreateProcessParametersEx @433 + RtlCreatePropertySet @434 PRIVATE + RtlCreateQueryDebugBuffer @435 + RtlCreateRegistryKey @436 + RtlCreateSecurityDescriptor @437 + RtlCreateTagHeap @438 PRIVATE + RtlCreateTimer @439 + RtlCreateTimerQueue @440 + RtlCreateUnicodeString @441 + RtlCreateUnicodeStringFromAsciiz @442 + RtlCreateUserProcess @443 + RtlCreateUserSecurityObject @444 PRIVATE + RtlCreateUserStack @445 + RtlCreateUserThread @446 + RtlCustomCPToUnicodeN @447 + RtlCutoverTimeToSystemTime @448 PRIVATE + RtlDeNormalizeProcessParams @449 + RtlDeactivateActivationContext @450 + RtlDeactivateActivationContextUnsafeFast @451 PRIVATE + RtlDebugPrintTimes @452 PRIVATE + RtlDecodePointer @453 + RtlDecodeSystemPointer=RtlDecodePointer @454 + RtlDecompressBuffer @455 + RtlDecompressFragment @456 + RtlDefaultNpAcl @457 + RtlDelete @458 PRIVATE + RtlDeleteAce @459 + RtlDeleteAtomFromAtomTable @460 + RtlDeleteCriticalSection @461 + RtlDeleteGrowableFunctionTable @462 + RtlDeleteElementGenericTable @463 PRIVATE + RtlDeleteElementGenericTableAvl @464 PRIVATE + RtlDeleteFunctionTable @465 + RtlDeleteNoSplay @466 PRIVATE + RtlDeleteOwnersRanges @467 PRIVATE + RtlDeleteRange @468 PRIVATE + RtlDeleteRegistryValue @469 + RtlDeleteResource @470 + RtlDeleteSecurityObject @471 + RtlDeleteTimer @472 + RtlDeleteTimerQueueEx @473 + RtlDeregisterWait @474 + RtlDeregisterWaitEx @475 + RtlDestroyAtomTable @476 + RtlDestroyEnvironment @477 + RtlDestroyHandleTable @478 + RtlDestroyHeap @479 + RtlDestroyProcessParameters @480 + RtlDestroyQueryDebugBuffer @481 + RtlDetermineDosPathNameType_U @482 + RtlDllShutdownInProgress @483 + RtlDoesFileExists_U @484 + RtlDosPathNameToNtPathName_U @485 + RtlDosPathNameToNtPathName_U_WithStatus @486 + RtlDosPathNameToRelativeNtPathName_U @487 + RtlDosPathNameToRelativeNtPathName_U_WithStatus @488 + RtlDosSearchPath_U @489 + RtlDowncaseUnicodeChar @490 + RtlDowncaseUnicodeString @491 + RtlDumpResource @492 + RtlDuplicateUnicodeString @493 + RtlEmptyAtomTable @494 + RtlEncodePointer @495 + RtlEncodeSystemPointer=RtlEncodePointer @496 + RtlEnterCriticalSection @497 + RtlEnumProcessHeaps @498 PRIVATE + RtlEnumerateGenericTable @499 PRIVATE + RtlEnumerateGenericTableWithoutSplaying @500 + RtlEnumerateProperties @501 PRIVATE + RtlEqualComputerName @502 + RtlEqualDomainName @503 + RtlEqualLuid @504 + RtlEqualPrefixSid @505 + RtlEqualSid @506 + RtlEqualString @507 + RtlEqualUnicodeString @508 + RtlEraseUnicodeString @509 + RtlExitUserProcess @510 + RtlExitUserThread @511 + RtlExpandEnvironmentStrings @512 + RtlExpandEnvironmentStrings_U @513 + RtlExtendHeap @514 PRIVATE + RtlFillMemory @515 + RtlFillMemoryUlong @516 + RtlFinalReleaseOutOfProcessMemoryStream @517 PRIVATE + RtlFindActivationContextSectionGuid @518 + RtlFindActivationContextSectionString @519 + RtlFindCharInUnicodeString @520 + RtlFindClearBits @521 + RtlFindClearBitsAndSet @522 + RtlFindClearRuns @523 + RtlFindExportedRoutineByName @524 + RtlFindLastBackwardRunClear @525 + RtlFindLastBackwardRunSet @526 + RtlFindLeastSignificantBit @527 + RtlFindLongestRunClear @528 + RtlFindLongestRunSet @529 + RtlFindMessage @530 + RtlFindMostSignificantBit @531 + RtlFindNextForwardRunClear @532 + RtlFindNextForwardRunSet @533 + RtlFindRange @534 PRIVATE + RtlFindSetBits @535 + RtlFindSetBitsAndClear @536 + RtlFindSetRuns @537 + RtlFirstEntrySList @538 + RtlFirstFreeAce @539 + RtlFlsAlloc @540 + RtlFlsFree @541 + RtlFlsGetValue @542 + RtlFlsSetValue @543 + RtlFlushPropertySet @544 PRIVATE + RtlFormatCurrentUserKeyPath @545 + RtlFormatMessage @546 + RtlFormatMessageEx @547 + RtlFreeActivationContextStack @548 + RtlFreeAnsiString @549 + RtlFreeHandle @550 + RtlFreeHeap @551 + RtlFreeOemString @552 + RtlFreeSid @553 + RtlFreeThreadActivationContextStack @554 + RtlFreeUnicodeString @555 + RtlFreeUserStack @556 + RtlGUIDFromString @557 + RtlGenerate8dot3Name @558 PRIVATE + RtlGetAce @559 + RtlGetActiveActivationContext @560 + RtlGetCallersAddress @561 PRIVATE + RtlGetCompressionWorkSpaceSize @562 + RtlGetControlSecurityDescriptor @563 + RtlGetCurrentDirectory_U @564 + RtlGetCurrentPeb @565 + RtlGetCurrentProcessorNumberEx @566 + RtlGetCurrentTransaction @567 + RtlGetDaclSecurityDescriptor @568 + RtlGetElementGenericTable @569 + RtlGetEnabledExtendedFeatures @570 + RtlGetExePath @571 + RtlGetExtendedContextLength @572 + RtlGetExtendedContextLength2 @573 + RtlGetExtendedFeaturesMask @574 + RtlGetFrame @575 + RtlGetFullPathName_U @576 + RtlGetGroupSecurityDescriptor @577 + RtlGetLastNtStatus @578 + RtlGetLastWin32Error @579 + RtlGetLocaleFileMappingAddress @580 + RtlGetLongestNtPathLength @581 + RtlGetNativeSystemInformation=NtQuerySystemInformation @582 + RtlGetNtGlobalFlags @583 + RtlGetNtProductType @584 + RtlGetNtVersionNumbers @585 + RtlGetOwnerSecurityDescriptor @586 + RtlGetProductInfo @587 + RtlGetProcessHeaps @588 + RtlGetProcessPreferredUILanguages @589 + RtlGetSaclSecurityDescriptor @590 + RtlGetSearchPath @591 + RtlGetSystemPreferredUILanguages @592 + RtlGetSystemTimePrecise @593 + RtlGetThreadErrorMode @594 + RtlGetThreadPreferredUILanguages @595 + RtlGetUnloadEventTrace @596 + RtlGetUnloadEventTraceEx @597 + RtlGetUserInfoHeap @598 + RtlGetUserPreferredUILanguages @599 + RtlGetVersion @600 + RtlGrowFunctionTable @601 + RtlGuidToPropertySetName @602 PRIVATE + RtlHashUnicodeString @603 + RtlIdentifierAuthoritySid @604 + RtlIdnToAscii @605 + RtlIdnToNameprepUnicode @606 + RtlIdnToUnicode @607 + RtlImageDirectoryEntryToData @608 + RtlImageNtHeader @609 + RtlImageRvaToSection @610 + RtlImageRvaToVa @611 + RtlImpersonateSelf @612 + RtlInitAnsiString @613 + RtlInitAnsiStringEx @614 + RtlInitCodePageTable @615 + RtlInitNlsTables @616 + RtlInitString @617 + RtlInitUnicodeString @618 + RtlInitUnicodeStringEx @619 + RtlInitializeBitMap @620 + RtlInitializeConditionVariable @621 + RtlInitializeContext @622 PRIVATE + RtlInitializeCriticalSection @623 + RtlInitializeCriticalSectionAndSpinCount @624 + RtlInitializeCriticalSectionEx @625 + RtlInitializeExtendedContext @626 + RtlInitializeExtendedContext2 @627 + RtlInitializeGenericTable @628 + RtlInitializeGenericTableAvl @629 + RtlInitializeHandleTable @630 + RtlInitializeRXact @631 PRIVATE + RtlInitializeResource @632 + RtlInitializeSListHead @633 + RtlInitializeSRWLock @634 + RtlInitializeSid @635 + RtlInsertElementGenericTable @636 PRIVATE + RtlInsertElementGenericTableAvl @637 + RtlInstallFunctionTableCallback @638 + RtlInt64ToUnicodeString @639 + RtlIntegerToChar @640 + RtlIntegerToUnicodeString @641 + RtlInterlockedFlushSList @642 + RtlInterlockedPopEntrySList @643 + RtlInterlockedPushEntrySList @644 + RtlInterlockedPushListSList @645 + RtlInterlockedPushListSListEx @646 + RtlIpv4AddressToStringA @647 + RtlIpv4AddressToStringExA @648 + RtlIpv4AddressToStringExW @649 + RtlIpv4AddressToStringW @650 + RtlIpv4StringToAddressA @651 + RtlIpv4StringToAddressExA @652 + RtlIpv4StringToAddressExW @653 + RtlIpv4StringToAddressW @654 + RtlIpv6AddressToStringA @655 + RtlIpv6AddressToStringExA @656 + RtlIpv6AddressToStringExW @657 + RtlIpv6AddressToStringW @658 + RtlIpv6StringToAddressA @659 + RtlIpv6StringToAddressExA @660 + RtlIpv6StringToAddressExW @661 + RtlIpv6StringToAddressW @662 + RtlIsActivationContextActive @663 + RtlIsCriticalSectionLocked @664 + RtlIsCriticalSectionLockedByThread @665 + RtlIsCurrentProcess @666 + RtlIsCurrentThread @667 + RtlIsDosDeviceName_U @668 + RtlIsEcCode @669 + RtlIsGenericTableEmpty @670 PRIVATE + RtlIsNameLegalDOS8Dot3 @671 + RtlIsNormalizedString @672 + RtlIsProcessorFeaturePresent @673 + RtlIsTextUnicode @674 + RtlIsValidHandle @675 + RtlIsValidIndexHandle @676 + RtlIsValidLocaleName @677 + RtlLargeIntegerToChar @678 + RtlLcidToLocaleName @679 + RtlLeaveCriticalSection @680 + RtlLengthRequiredSid @681 + RtlLengthSecurityDescriptor @682 + RtlLengthSid @683 + RtlLocalTimeToSystemTime @684 + RtlLocaleNameToLcid @685 + RtlLocateExtendedFeature @686 + RtlLocateExtendedFeature2 @687 + RtlLocateLegacyContext @688 + RtlLockHeap @689 + RtlLookupAtomInAtomTable @690 + RtlLookupElementGenericTable @691 + RtlLookupFunctionEntry @692 + RtlMakeSelfRelativeSD @693 + RtlMapGenericMask @694 + RtlMoveMemory @695 + RtlMultiByteToUnicodeN @696 + RtlMultiByteToUnicodeSize @697 + RtlNewInstanceSecurityObject @698 PRIVATE + RtlNewSecurityGrantedAccess @699 PRIVATE + RtlNewSecurityObject @700 + RtlNewSecurityObjectEx @701 + RtlNewSecurityObjectWithMultipleInheritance @702 + RtlNormalizeProcessParams @703 + RtlNormalizeString @704 + RtlNtStatusToDosError @705 + RtlNtStatusToDosErrorNoTeb @706 + RtlNumberGenericTableElements @707 + RtlNumberOfClearBits @708 + RtlNumberOfSetBits @709 + RtlOemStringToUnicodeSize @710 + RtlOemStringToUnicodeString @711 + RtlOemToUnicodeN @712 + RtlOpenCurrentUser @713 + RtlPcToFileHeader @714 + RtlPinAtomInAtomTable @715 + RtlPopFrame @716 + RtlPrefixString @717 + RtlPrefixUnicodeString @718 + RtlProcessFlsData @719 + RtlPropertySetNameToGuid @720 PRIVATE + RtlProtectHeap @721 PRIVATE + RtlPushFrame @722 + RtlQueryActivationContextApplicationSettings @723 + RtlQueryAtomInAtomTable @724 + RtlQueryDepthSList @725 + RtlQueryDynamicTimeZoneInformation @726 + RtlQueryEnvironmentVariable_U @727 + RtlQueryEnvironmentVariable @728 + RtlQueryHeapInformation @729 + RtlQueryInformationAcl @730 + RtlQueryInformationActivationContext @731 + RtlQueryInformationActiveActivationContext @732 PRIVATE + RtlQueryInterfaceMemoryStream @733 PRIVATE + RtlQueryPackageIdentity @734 + RtlQueryPerformanceCounter @735 + RtlQueryPerformanceFrequency @736 + RtlQueryProcessBackTraceInformation @737 PRIVATE + RtlQueryProcessDebugInformation @738 + RtlQueryProcessHeapInformation @739 PRIVATE + RtlQueryProcessLockInformation @740 PRIVATE + RtlQueryProcessPlaceholderCompatibilityMode @741 + RtlQueryProperties @742 PRIVATE + RtlQueryPropertyNames @743 PRIVATE + RtlQueryPropertySet @744 PRIVATE + RtlQueryRegistryValues @745 + RtlQueryRegistryValuesEx=RtlQueryRegistryValues @746 + RtlQuerySecurityObject @747 PRIVATE + RtlQueryTagHeap @748 PRIVATE + RtlQueryTimeZoneInformation @749 + RtlQueryUnbiasedInterruptTime @750 + RtlQueueApcWow64Thread @751 PRIVATE + RtlQueueWorkItem @752 + RtlRaiseException @753 + RtlRaiseStatus @754 + RtlRandom @755 + RtlRandomEx @756 + RtlReAllocateHeap @757 + RtlReadMemoryStream @758 PRIVATE + RtlReadOutOfProcessMemoryStream @759 PRIVATE + RtlRealPredecessor @760 PRIVATE + RtlRealSuccessor @761 PRIVATE + RtlRegisterSecureMemoryCacheCallback @762 PRIVATE + RtlRegisterWait @763 + RtlReleaseActivationContext @764 + RtlReleaseMemoryStream @765 PRIVATE + RtlReleasePath @766 + RtlReleasePebLock @767 + RtlReleaseRelativeName @768 + RtlReleaseResource @769 + RtlReleaseSRWLockExclusive @770 + RtlReleaseSRWLockShared @771 + RtlRemoteCall @772 PRIVATE + RtlRemoveVectoredContinueHandler @773 + RtlRemoveVectoredExceptionHandler @774 + RtlResetRtlTranslations @775 + RtlRestoreContext @776 + RtlRestoreLastWin32Error=RtlSetLastWin32Error @777 + RtlRevertMemoryStream @778 PRIVATE + RtlRunDecodeUnicodeString @779 PRIVATE + RtlRunEncodeUnicodeString @780 PRIVATE + RtlRunOnceBeginInitialize @781 + RtlRunOnceComplete @782 + RtlRunOnceExecuteOnce @783 + RtlRunOnceInitialize @784 + RtlSecondsSince1970ToTime @785 + RtlSecondsSince1980ToTime @786 + RtlSelfRelativeToAbsoluteSD @787 + RtlSetAllBits @788 + RtlSetBits @789 + RtlSetControlSecurityDescriptor @790 + RtlSetCriticalSectionSpinCount @791 + RtlSetCurrentDirectory_U @792 + RtlSetCurrentEnvironment @793 + RtlSetCurrentTransaction @794 + RtlSetDaclSecurityDescriptor @795 + RtlSetEnvironmentVariable @796 + RtlSetExtendedFeaturesMask @797 + RtlSetGroupSecurityDescriptor @798 + RtlSetHeapInformation @799 + RtlSetInformationAcl @800 PRIVATE + RtlSetIoCompletionCallback @801 + RtlSetLastWin32Error @802 + RtlSetLastWin32ErrorAndNtStatusFromNtStatus @803 + RtlSetOwnerSecurityDescriptor @804 + RtlSetProcessPreferredUILanguages @805 + RtlSetProperties @806 PRIVATE + RtlSetPropertyClassId @807 PRIVATE + RtlSetPropertyNames @808 PRIVATE + RtlSetPropertySetClassId @809 PRIVATE + RtlSetSaclSecurityDescriptor @810 + RtlSetSearchPathMode @811 + RtlSetSecurityObject @812 PRIVATE + RtlSetThreadErrorMode @813 + RtlSetThreadPreferredUILanguages @814 + RtlSetTimeZoneInformation @815 + RtlSetUnhandledExceptionFilter @816 + RtlSetUnicodeCallouts @817 PRIVATE + RtlSetUserFlagsHeap @818 + RtlSetUserValueHeap @819 + RtlSizeHeap @820 + RtlSleepConditionVariableCS @821 + RtlSleepConditionVariableSRW @822 + RtlSplay @823 PRIVATE + RtlStartRXact @824 PRIVATE + RtlStringFromGUID @825 + RtlSubAuthorityCountSid @826 + RtlSubAuthoritySid @827 + RtlSubtreePredecessor @828 PRIVATE + RtlSubtreeSuccessor @829 PRIVATE + RtlSystemTimeToLocalTime @830 + RtlTimeFieldsToTime @831 + RtlTimeToElapsedTimeFields @832 + RtlTimeToSecondsSince1970 @833 + RtlTimeToSecondsSince1980 @834 + RtlTimeToTimeFields @835 + RtlTryAcquireSRWLockExclusive @836 + RtlTryAcquireSRWLockShared @837 + RtlTryEnterCriticalSection @838 + RtlUTF8ToUnicodeN @839 + RtlUnicodeStringToAnsiSize @840 + RtlUnicodeStringToAnsiString @841 + RtlUnicodeStringToCountedOemString @842 PRIVATE + RtlUnicodeStringToInteger @843 + RtlUnicodeStringToOemSize @844 + RtlUnicodeStringToOemString @845 + RtlUnicodeToCustomCPN @846 + RtlUnicodeToMultiByteN @847 + RtlUnicodeToMultiByteSize @848 + RtlUnicodeToOemN @849 + RtlUnicodeToUTF8N @850 + RtlUniform @851 + RtlUnlockHeap @852 + RtlUnwind @853 + RtlUnwindEx @854 + RtlUpcaseUnicodeChar @855 + RtlUpcaseUnicodeString @856 + RtlUpcaseUnicodeStringToAnsiString @857 + RtlUpcaseUnicodeStringToCountedOemString @858 + RtlUpcaseUnicodeStringToOemString @859 + RtlUpcaseUnicodeToCustomCPN @860 + RtlUpcaseUnicodeToMultiByteN @861 + RtlUpcaseUnicodeToOemN @862 + RtlUpdateTimer @863 + RtlUpperChar @864 + RtlUpperString @865 + RtlUsageHeap @866 PRIVATE + RtlUserThreadStart @867 + RtlValidAcl @868 + RtlValidRelativeSecurityDescriptor @869 + RtlValidSecurityDescriptor @870 + RtlValidSid @871 + RtlValidateHeap @872 + RtlValidateProcessHeaps @873 PRIVATE + RtlVerifyVersionInfo @874 + RtlVirtualUnwind @875 + RtlWaitOnAddress @876 + RtlWakeAddressAll @877 + RtlWakeAddressSingle @878 + RtlWakeAllConditionVariable @879 + RtlWakeConditionVariable @880 + RtlWalkFrameChain @881 PRIVATE + RtlWalkHeap @882 + RtlWow64EnableFsRedirection @883 + RtlWow64EnableFsRedirectionEx @884 + RtlWow64GetCpuAreaInfo @885 + RtlWow64GetCurrentCpuArea @886 + RtlWow64GetCurrentMachine @887 + RtlWow64GetProcessMachines @888 + RtlWow64GetSharedInfoProcess @889 + RtlWow64GetThreadContext @890 + RtlWow64GetThreadSelectorEntry @891 + RtlWow64IsWowGuestMachineSupported @892 + RtlWow64SetThreadContext @893 + RtlWow64SuspendThread @894 + RtlWriteMemoryStream @895 PRIVATE + RtlWriteRegistryValue @896 + RtlZeroHeap @897 PRIVATE + RtlZeroMemory @898 + RtlZombifyActivationContext @899 + RtlpNtCreateKey @900 + RtlpNtEnumerateSubKey @901 + RtlpNtMakeTemporaryKey @902 + RtlpNtOpenKey @903 + RtlpNtQueryValueKey @904 + RtlpNtSetValueKey @905 + RtlpUnWaitCriticalSection @906 + RtlpWaitForCriticalSection @907 + RtlxAnsiStringToUnicodeSize=RtlAnsiStringToUnicodeSize @908 + RtlxOemStringToUnicodeSize=RtlOemStringToUnicodeSize @909 + RtlxUnicodeStringToAnsiSize=RtlUnicodeStringToAnsiSize @910 + RtlxUnicodeStringToOemSize=RtlUnicodeStringToOemSize @911 + TpAllocCleanupGroup @912 + TpAllocIoCompletion @913 + TpAllocPool @914 + TpAllocTimer @915 + TpAllocWait @916 + TpAllocWork @917 + TpCallbackLeaveCriticalSectionOnCompletion @918 + TpCallbackMayRunLong @919 + TpCallbackReleaseMutexOnCompletion @920 + TpCallbackReleaseSemaphoreOnCompletion @921 + TpCallbackSetEventOnCompletion @922 + TpCallbackUnloadDllOnCompletion @923 + TpCancelAsyncIoOperation @924 + TpDisassociateCallback @925 + TpIsTimerSet @926 + TpPostWork @927 + TpQueryPoolStackInformation @928 + TpReleaseCleanupGroup @929 + TpReleaseCleanupGroupMembers @930 + TpReleaseIoCompletion @931 + TpReleasePool @932 + TpReleaseTimer @933 + TpReleaseWait @934 + TpReleaseWork @935 + TpSetPoolMaxThreads @936 + TpSetPoolMinThreads @937 + TpSetPoolStackInformation @938 + TpSetTimer @939 + TpSetWait @940 + TpSimpleTryPost @941 + TpStartAsyncIoOperation @942 + TpWaitForIoCompletion @943 + TpWaitForTimer @944 + TpWaitForWait @945 + TpWaitForWork @946 + VerSetConditionMask @947 + WinSqmEndSession @948 + WinSqmIncrementDWORD @949 + WinSqmIsOptedIn @950 + WinSqmSetDWORD @951 + WinSqmStartSession @952 + ZwAcceptConnectPort=NtAcceptConnectPort @953 PRIVATE + ZwAccessCheck=NtAccessCheck @954 PRIVATE + ZwAccessCheckAndAuditAlarm=NtAccessCheckAndAuditAlarm @955 PRIVATE + ZwAddAtom=NtAddAtom @956 PRIVATE + ZwAdjustGroupsToken=NtAdjustGroupsToken @957 PRIVATE + ZwAdjustPrivilegesToken=NtAdjustPrivilegesToken @958 PRIVATE + ZwAlertResumeThread=NtAlertResumeThread @959 PRIVATE + ZwAlertThread=NtAlertThread @960 PRIVATE + ZwAlertThreadByThreadId=NtAlertThreadByThreadId @961 PRIVATE + ZwAllocateLocallyUniqueId=NtAllocateLocallyUniqueId @962 PRIVATE + ZwAllocateUuids=NtAllocateUuids @963 PRIVATE + ZwAllocateVirtualMemory=NtAllocateVirtualMemory @964 PRIVATE + ZwAllocateVirtualMemoryEx=NtAllocateVirtualMemoryEx @965 PRIVATE + ZwAreMappedFilesTheSame=NtAreMappedFilesTheSame @966 PRIVATE + ZwAssignProcessToJobObject=NtAssignProcessToJobObject @967 PRIVATE + ZwCancelIoFile=NtCancelIoFile @968 PRIVATE + ZwCancelIoFileEx=NtCancelIoFileEx @969 PRIVATE + ZwCancelSynchronousIoFile=NtCancelSynchronousIoFile @970 PRIVATE + ZwCancelTimer=NtCancelTimer @971 PRIVATE + ZwClearEvent=NtClearEvent @972 PRIVATE + ZwClose=NtClose @973 PRIVATE + ZwCompareObjects=NtCompareObjects @974 PRIVATE + ZwCompleteConnectPort=NtCompleteConnectPort @975 PRIVATE + ZwConnectPort=NtConnectPort @976 PRIVATE + ZwContinue=NtContinue @977 PRIVATE + ZwCreateDirectoryObject=NtCreateDirectoryObject @978 PRIVATE + ZwCreateEvent=NtCreateEvent @979 PRIVATE + ZwCreateFile=NtCreateFile @980 PRIVATE + ZwCreateIoCompletion=NtCreateIoCompletion @981 PRIVATE + ZwCreateJobObject=NtCreateJobObject @982 PRIVATE + ZwCreateKey=NtCreateKey @983 PRIVATE + ZwCreateKeyTransacted=NtCreateKeyTransacted @984 PRIVATE + ZwCreateKeyedEvent=NtCreateKeyedEvent @985 PRIVATE + ZwCreateLowBoxToken=NtCreateLowBoxToken @986 PRIVATE + ZwCreateMailslotFile=NtCreateMailslotFile @987 PRIVATE + ZwCreateMutant=NtCreateMutant @988 PRIVATE + ZwCreateNamedPipeFile=NtCreateNamedPipeFile @989 PRIVATE + ZwCreatePagingFile=NtCreatePagingFile @990 PRIVATE + ZwCreatePort=NtCreatePort @991 PRIVATE + ZwCreateSection=NtCreateSection @992 PRIVATE + ZwCreateSemaphore=NtCreateSemaphore @993 PRIVATE + ZwCreateSymbolicLinkObject=NtCreateSymbolicLinkObject @994 PRIVATE + ZwCreateThread=NtCreateThread @995 PRIVATE + ZwCreateThreadEx=NtCreateThreadEx @996 PRIVATE + ZwCreateTimer=NtCreateTimer @997 PRIVATE + ZwCreateUserProcess=NtCreateUserProcess @998 PRIVATE + ZwDebugActiveProcess=NtDebugActiveProcess @999 PRIVATE + ZwDebugContinue=NtDebugContinue @1000 PRIVATE + ZwDelayExecution=NtDelayExecution @1001 PRIVATE + ZwDeleteAtom=NtDeleteAtom @1002 PRIVATE + ZwDeleteFile=NtDeleteFile @1003 PRIVATE + ZwDeleteKey=NtDeleteKey @1004 PRIVATE + ZwDeleteValueKey=NtDeleteValueKey @1005 PRIVATE + ZwDeviceIoControlFile=NtDeviceIoControlFile @1006 PRIVATE + ZwDisplayString=NtDisplayString @1007 PRIVATE + ZwDuplicateObject=NtDuplicateObject @1008 PRIVATE + ZwDuplicateToken=NtDuplicateToken @1009 PRIVATE + ZwEnumerateKey=NtEnumerateKey @1010 PRIVATE + ZwEnumerateValueKey=NtEnumerateValueKey @1011 PRIVATE + ZwFilterToken=NtFilterToken @1012 PRIVATE + ZwFindAtom=NtFindAtom @1013 PRIVATE + ZwFlushBuffersFile=NtFlushBuffersFile @1014 PRIVATE + ZwFlushInstructionCache=NtFlushInstructionCache @1015 PRIVATE + ZwFlushKey=NtFlushKey @1016 PRIVATE + ZwFlushProcessWriteBuffers=NtFlushProcessWriteBuffers @1017 PRIVATE + ZwFlushVirtualMemory=NtFlushVirtualMemory @1018 PRIVATE + ZwFreeVirtualMemory=NtFreeVirtualMemory @1019 PRIVATE + ZwFsControlFile=NtFsControlFile @1020 PRIVATE + ZwGetContextThread=NtGetContextThread @1021 PRIVATE + ZwGetCurrentProcessorNumber=NtGetCurrentProcessorNumber @1022 PRIVATE + ZwGetNlsSectionPtr=NtGetNlsSectionPtr @1023 PRIVATE + ZwGetTickCount=NtGetTickCount @1024 PRIVATE + ZwGetWriteWatch=NtGetWriteWatch @1025 PRIVATE + ZwImpersonateAnonymousToken=NtImpersonateAnonymousToken @1026 PRIVATE + ZwInitializeNlsFiles=NtInitializeNlsFiles @1027 PRIVATE + ZwInitiatePowerAction=NtInitiatePowerAction @1028 PRIVATE + ZwIsProcessInJob=NtIsProcessInJob @1029 PRIVATE + ZwListenPort=NtListenPort @1030 PRIVATE + ZwLoadDriver=NtLoadDriver @1031 PRIVATE + ZwLoadKey2=NtLoadKey2 @1032 PRIVATE + ZwLoadKey=NtLoadKey @1033 PRIVATE + ZwLockFile=NtLockFile @1034 PRIVATE + ZwLockVirtualMemory=NtLockVirtualMemory @1035 PRIVATE + ZwMakeTemporaryObject=NtMakeTemporaryObject @1036 PRIVATE + ZwMapViewOfSection=NtMapViewOfSection @1037 PRIVATE + ZwMapViewOfSectionEx=NtMapViewOfSectionEx @1038 PRIVATE + ZwNotifyChangeDirectoryFile=NtNotifyChangeDirectoryFile @1039 PRIVATE + ZwNotifyChangeKey=NtNotifyChangeKey @1040 PRIVATE + ZwNotifyChangeMultipleKeys=NtNotifyChangeMultipleKeys @1041 PRIVATE + ZwOpenDirectoryObject=NtOpenDirectoryObject @1042 PRIVATE + ZwOpenEvent=NtOpenEvent @1043 PRIVATE + ZwOpenFile=NtOpenFile @1044 PRIVATE + ZwOpenIoCompletion=NtOpenIoCompletion @1045 PRIVATE + ZwOpenJobObject=NtOpenJobObject @1046 PRIVATE + ZwOpenKey=NtOpenKey @1047 PRIVATE + ZwOpenKeyEx=NtOpenKeyEx @1048 PRIVATE + ZwOpenKeyTransacted=NtOpenKeyTransacted @1049 PRIVATE + ZwOpenKeyTransactedEx=NtOpenKeyTransactedEx @1050 PRIVATE + ZwOpenKeyedEvent=NtOpenKeyedEvent @1051 PRIVATE + ZwOpenMutant=NtOpenMutant @1052 PRIVATE + ZwOpenProcess=NtOpenProcess @1053 PRIVATE + ZwOpenProcessToken=NtOpenProcessToken @1054 PRIVATE + ZwOpenProcessTokenEx=NtOpenProcessTokenEx @1055 PRIVATE + ZwOpenSection=NtOpenSection @1056 PRIVATE + ZwOpenSemaphore=NtOpenSemaphore @1057 PRIVATE + ZwOpenSymbolicLinkObject=NtOpenSymbolicLinkObject @1058 PRIVATE + ZwOpenThread=NtOpenThread @1059 PRIVATE + ZwOpenThreadToken=NtOpenThreadToken @1060 PRIVATE + ZwOpenThreadTokenEx=NtOpenThreadTokenEx @1061 PRIVATE + ZwOpenTimer=NtOpenTimer @1062 PRIVATE + ZwPowerInformation=NtPowerInformation @1063 PRIVATE + ZwPrivilegeCheck=NtPrivilegeCheck @1064 PRIVATE + ZwProtectVirtualMemory=NtProtectVirtualMemory @1065 PRIVATE + ZwPulseEvent=NtPulseEvent @1066 PRIVATE + ZwQueryAttributesFile=NtQueryAttributesFile @1067 PRIVATE + ZwQueryDefaultLocale=NtQueryDefaultLocale @1068 PRIVATE + ZwQueryDefaultUILanguage=NtQueryDefaultUILanguage @1069 PRIVATE + ZwQueryDirectoryFile=NtQueryDirectoryFile @1070 PRIVATE + ZwQueryDirectoryObject=NtQueryDirectoryObject @1071 PRIVATE + ZwQueryEaFile=NtQueryEaFile @1072 PRIVATE + ZwQueryEvent=NtQueryEvent @1073 PRIVATE + ZwQueryFullAttributesFile=NtQueryFullAttributesFile @1074 PRIVATE + ZwQueryInformationAtom=NtQueryInformationAtom @1075 PRIVATE + ZwQueryInformationFile=NtQueryInformationFile @1076 PRIVATE + ZwQueryInformationJobObject=NtQueryInformationJobObject @1077 PRIVATE + ZwQueryInformationProcess=NtQueryInformationProcess @1078 PRIVATE + ZwQueryInformationThread=NtQueryInformationThread @1079 PRIVATE + ZwQueryInformationToken=NtQueryInformationToken @1080 PRIVATE + ZwQueryInstallUILanguage=NtQueryInstallUILanguage @1081 PRIVATE + ZwQueryIoCompletion=NtQueryIoCompletion @1082 PRIVATE + ZwQueryKey=NtQueryKey @1083 PRIVATE + ZwQueryLicenseValue=NtQueryLicenseValue @1084 PRIVATE + ZwQueryMultipleValueKey=NtQueryMultipleValueKey @1085 PRIVATE + ZwQueryMutant=NtQueryMutant @1086 PRIVATE + ZwQueryObject=NtQueryObject @1087 PRIVATE + ZwQueryPerformanceCounter=NtQueryPerformanceCounter @1088 PRIVATE + ZwQuerySection=NtQuerySection @1089 PRIVATE + ZwQuerySecurityObject=NtQuerySecurityObject @1090 PRIVATE + ZwQuerySemaphore=NtQuerySemaphore @1091 PRIVATE + ZwQuerySymbolicLinkObject=NtQuerySymbolicLinkObject @1092 PRIVATE + ZwQuerySystemEnvironmentValue=NtQuerySystemEnvironmentValue @1093 PRIVATE + ZwQuerySystemEnvironmentValueEx=NtQuerySystemEnvironmentValueEx @1094 PRIVATE + ZwQuerySystemInformation=NtQuerySystemInformation @1095 PRIVATE + ZwQuerySystemInformationEx=NtQuerySystemInformationEx @1096 PRIVATE + ZwQuerySystemTime=NtQuerySystemTime @1097 PRIVATE + ZwQueryTimer=NtQueryTimer @1098 PRIVATE + ZwQueryTimerResolution=NtQueryTimerResolution @1099 PRIVATE + ZwQueryValueKey=NtQueryValueKey @1100 PRIVATE + ZwQueryVirtualMemory=NtQueryVirtualMemory @1101 PRIVATE + ZwQueryVolumeInformationFile=NtQueryVolumeInformationFile @1102 PRIVATE + ZwQueueApcThread=NtQueueApcThread @1103 PRIVATE + ZwRaiseException=NtRaiseException @1104 PRIVATE + ZwRaiseHardError=NtRaiseHardError @1105 PRIVATE + ZwReadFile=NtReadFile @1106 PRIVATE + ZwReadFileScatter=NtReadFileScatter @1107 PRIVATE + ZwReadVirtualMemory=NtReadVirtualMemory @1108 PRIVATE + ZwRegisterThreadTerminatePort=NtRegisterThreadTerminatePort @1109 PRIVATE + ZwReleaseKeyedEvent=NtReleaseKeyedEvent @1110 PRIVATE + ZwReleaseMutant=NtReleaseMutant @1111 PRIVATE + ZwReleaseSemaphore=NtReleaseSemaphore @1112 PRIVATE + ZwRemoveIoCompletion=NtRemoveIoCompletion @1113 PRIVATE + ZwRemoveIoCompletionEx=NtRemoveIoCompletionEx @1114 PRIVATE + ZwRemoveProcessDebug=NtRemoveProcessDebug @1115 PRIVATE + ZwRenameKey=NtRenameKey @1116 PRIVATE + ZwReplaceKey=NtReplaceKey @1117 PRIVATE + ZwReplyWaitReceivePort=NtReplyWaitReceivePort @1118 PRIVATE + ZwRequestWaitReplyPort=NtRequestWaitReplyPort @1119 PRIVATE + ZwResetEvent=NtResetEvent @1120 PRIVATE + ZwResetWriteWatch=NtResetWriteWatch @1121 PRIVATE + ZwRestoreKey=NtRestoreKey @1122 PRIVATE + ZwResumeProcess=NtResumeProcess @1123 PRIVATE + ZwResumeThread=NtResumeThread @1124 PRIVATE + ZwSaveKey=NtSaveKey @1125 PRIVATE + ZwSecureConnectPort=NtSecureConnectPort @1126 PRIVATE + ZwSetContextThread=NtSetContextThread @1127 PRIVATE + ZwSetDebugFilterState=NtSetDebugFilterState @1128 PRIVATE + ZwSetDefaultLocale=NtSetDefaultLocale @1129 PRIVATE + ZwSetDefaultUILanguage=NtSetDefaultUILanguage @1130 PRIVATE + ZwSetEaFile=NtSetEaFile @1131 PRIVATE + ZwSetEvent=NtSetEvent @1132 PRIVATE + ZwSetInformationDebugObject=NtSetInformationDebugObject @1133 PRIVATE + ZwSetInformationFile=NtSetInformationFile @1134 PRIVATE + ZwSetInformationJobObject=NtSetInformationJobObject @1135 PRIVATE + ZwSetInformationKey=NtSetInformationKey @1136 PRIVATE + ZwSetInformationObject=NtSetInformationObject @1137 PRIVATE + ZwSetInformationProcess=NtSetInformationProcess @1138 PRIVATE + ZwSetInformationThread=NtSetInformationThread @1139 PRIVATE + ZwSetInformationToken=NtSetInformationToken @1140 PRIVATE + ZwSetInformationVirtualMemory=NtSetInformationVirtualMemory @1141 PRIVATE + ZwSetIntervalProfile=NtSetIntervalProfile @1142 PRIVATE + ZwSetIoCompletion=NtSetIoCompletion @1143 PRIVATE + ZwSetLdtEntries=NtSetLdtEntries @1144 PRIVATE + ZwSetSecurityObject=NtSetSecurityObject @1145 PRIVATE + ZwSetSystemInformation=NtSetSystemInformation @1146 PRIVATE + ZwSetSystemTime=NtSetSystemTime @1147 PRIVATE + ZwSetThreadExecutionState=NtSetThreadExecutionState @1148 PRIVATE + ZwSetTimer=NtSetTimer @1149 PRIVATE + ZwSetTimerResolution=NtSetTimerResolution @1150 PRIVATE + ZwSetValueKey=NtSetValueKey @1151 PRIVATE + ZwSetVolumeInformationFile=NtSetVolumeInformationFile @1152 PRIVATE + ZwShutdownSystem=NtShutdownSystem @1153 PRIVATE + ZwSignalAndWaitForSingleObject=NtSignalAndWaitForSingleObject @1154 PRIVATE + ZwSuspendProcess=NtSuspendProcess @1155 PRIVATE + ZwSuspendThread=NtSuspendThread @1156 PRIVATE + ZwSystemDebugControl=NtSystemDebugControl @1157 PRIVATE + ZwTerminateJobObject=NtTerminateJobObject @1158 PRIVATE + ZwTerminateProcess=NtTerminateProcess @1159 PRIVATE + ZwTerminateThread=NtTerminateThread @1160 PRIVATE + ZwTestAlert=NtTestAlert @1161 PRIVATE + ZwTraceControl=NtTraceControl @1162 PRIVATE + ZwUnloadDriver=NtUnloadDriver @1163 PRIVATE + ZwUnloadKey=NtUnloadKey @1164 PRIVATE + ZwUnlockFile=NtUnlockFile @1165 PRIVATE + ZwUnlockVirtualMemory=NtUnlockVirtualMemory @1166 PRIVATE + ZwUnmapViewOfSection=NtUnmapViewOfSection @1167 PRIVATE + ZwUnmapViewOfSectionEx=NtUnmapViewOfSectionEx @1168 PRIVATE + ZwWaitForAlertByThreadId=NtWaitForAlertByThreadId @1169 PRIVATE + ZwWaitForDebugEvent=NtWaitForDebugEvent @1170 PRIVATE + ZwWaitForKeyedEvent=NtWaitForKeyedEvent @1171 PRIVATE + ZwWaitForMultipleObjects=NtWaitForMultipleObjects @1172 PRIVATE + ZwWaitForSingleObject=NtWaitForSingleObject @1173 PRIVATE + ZwWriteFile=NtWriteFile @1174 PRIVATE + ZwWriteFileGather=NtWriteFileGather @1175 PRIVATE + ZwWriteVirtualMemory=NtWriteVirtualMemory @1176 PRIVATE + ZwYieldExecution=NtYieldExecution @1177 PRIVATE + __C_specific_handler @1178 + __chkstk @1179 + __isascii @1180 + __iscsym @1181 + __iscsymf @1182 + __toascii @1183 + _atoi64 @1184 + _errno @1185 + _fltused @1186 PRIVATE + _i64toa @1187 + _i64toa_s @1188 + _i64tow @1189 + _i64tow_s @1190 + _itoa @1191 + _itoa_s @1192 + _itow @1193 + _itow_s @1194 + _lfind @1195 + _local_unwind @1196 + _ltoa @1197 + _ltoa_s @1198 + _ltow @1199 + _ltow_s @1200 + _makepath_s @1201 + _memccpy @1202 + _memicmp @1203 + _snprintf=NTDLL__snprintf @1204 + _snprintf_s @1205 + _snwprintf @1206 + _snwprintf_s @1207 + _splitpath @1208 + _splitpath_s @1209 + _strcmpi=_stricmp @1210 + _stricmp @1211 + _strlwr @1212 + _strlwr_s @1213 + _strnicmp @1214 + _strupr @1215 + _strupr_s @1216 + _swprintf=NTDLL_swprintf @1217 + _tolower @1218 + _toupper @1219 + _ui64toa @1220 + _ui64toa_s @1221 + _ui64tow @1222 + _ui64tow_s @1223 + _ultoa @1224 + _ultoa_s @1225 + _ultow @1226 + _ultow_s @1227 + _vscprintf @1228 + _vscwprintf @1229 + _vsnprintf @1230 + _vsnprintf_s @1231 + _vsnwprintf @1232 + _vsnwprintf_s @1233 + _vswprintf @1234 + _wcsicmp @1235 + _wcslwr @1236 + _wcslwr_s @1237 + _wcsnicmp @1238 + _wcstoi64 @1239 + _wcstoui64 @1240 + _wcsupr @1241 + _wcsupr_s @1242 + _wmakepath_s @1243 + _wsplitpath_s @1244 + _wtoi @1245 + _wtoi64 @1246 + _wtol @1247 + abs @1248 + atan @1249 + atan2 @1250 + atoi @1251 + atol @1252 + bsearch @1253 + bsearch_s @1254 + ceil @1255 + cos @1256 + fabs @1257 + floor @1258 + isalnum @1259 + isalpha @1260 + iscntrl @1261 + isdigit @1262 + isgraph @1263 + islower @1264 + isprint @1265 + ispunct @1266 + isspace @1267 + isupper @1268 + iswalnum @1269 + iswalpha @1270 + iswascii @1271 + iswctype @1272 + iswdigit @1273 + iswgraph @1274 + iswlower @1275 + iswprint @1276 + iswspace @1277 + iswxdigit @1278 + isxdigit @1279 + labs=abs @1280 + log @1281 + mbstowcs @1282 + memchr @1283 + memcmp @1284 + memcpy @1285 + memcpy_s @1286 + memmove @1287 + memmove_s @1288 + memset @1289 + pow @1290 + qsort @1291 + qsort_s @1292 + sin @1293 + sprintf=NTDLL_sprintf @1294 + sprintf_s @1295 + sqrt @1296 + sscanf @1297 + strcat @1298 + strcat_s @1299 + strchr @1300 + strcmp @1301 + strcpy @1302 + strcpy_s @1303 + strcspn @1304 + strlen @1305 + strncat @1306 + strncat_s @1307 + strncmp @1308 + strncpy @1309 + strncpy_s @1310 + strnlen @1311 + strpbrk @1312 + strrchr @1313 + strspn @1314 + strstr @1315 + strtok_s @1316 + strtol @1317 + strtoul @1318 + swprintf=NTDLL_swprintf @1319 + swprintf_s @1320 + tan @1321 + tolower @1322 + toupper @1323 + towlower @1324 + towupper @1325 + vDbgPrintEx @1326 + vDbgPrintExWithPrefix @1327 + vsprintf @1328 + vsprintf_s @1329 + vswprintf_s @1330 + wcscat @1331 + wcscat_s @1332 + wcschr @1333 + wcscmp @1334 + wcscpy @1335 + wcscpy_s @1336 + wcscspn @1337 + wcslen @1338 + wcsncat @1339 + wcsncat_s @1340 + wcsncmp @1341 + wcsncpy @1342 + wcsncpy_s @1343 + wcsnlen @1344 + wcspbrk @1345 + wcsrchr @1346 + wcsspn @1347 + wcsstr @1348 + wcstok @1349 + wcstok_s @1350 + wcstol @1351 + wcstombs @1352 + wcstoul @1353 + wine_server_call @1354 + wine_server_fd_to_handle @1355 + wine_server_handle_to_fd @1356 + __wine_unix_call @1357 + __wine_unix_spawnvp @1358 + __wine_ctrl_routine @1359 + __wine_syscall_dispatcher @1360 DATA PRIVATE + __wine_unix_call_dispatcher @1361 DATA PRIVATE + __wine_unixlib_handle @1362 DATA PRIVATE + __wine_dbg_write @1363 + __wine_dbg_get_channel_flags @1364 + __wine_dbg_header @1365 + __wine_dbg_output @1366 + __wine_dbg_strdup @1367 + wine_get_version @1368 + wine_get_build_id @1369 + wine_get_host_version @1370 + wine_nt_to_unix_file_name @1371 + wine_unix_to_nt_file_name @1372 \ No newline at end of file diff --git a/wine/override_wine_builtin.py b/wine/override_wine_builtin.py new file mode 100755 index 0000000..ee95e95 --- /dev/null +++ b/wine/override_wine_builtin.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import subprocess +import sys + +data = 'Wine builtin DLL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + +def main(output_file): + + with open(output_file, 'r+b') as f: + f.seek(64) # Move cursor to DOS stub + f.write(data.encode('utf-8')) + +main(sys.argv[1]) \ No newline at end of file diff --git a/wine/toolchain_mingw.cmake b/wine/toolchain_mingw.cmake new file mode 100644 index 0000000..46bfd07 --- /dev/null +++ b/wine/toolchain_mingw.cmake @@ -0,0 +1,7 @@ +set(CMAKE_SYSTEM_NAME Windows) +set(CMAKE_SYSTEM_PROCESSOR aarch64) + +set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE) + +set(CMAKE_C_COMPILER aarch64-w64-mingw32-clang) +set(CMAKE_ASM_COMPILER aarch64-w64-mingw32-as) \ No newline at end of file diff --git a/wine/wow64.def b/wine/wow64.def new file mode 100644 index 0000000..31088e7 --- /dev/null +++ b/wine/wow64.def @@ -0,0 +1,30 @@ +LIBRARY wow64.dll + +EXPORTS + Wow64AllocThreadHeap @1 PRIVATE + Wow64AllocateHeap @2 PRIVATE + Wow64AllocateTemp @3 + Wow64ApcRoutine @4 + Wow64CheckIfNXEnabled @5 PRIVATE + Wow64EmulateAtlThunk @6 PRIVATE + Wow64FreeHeap @7 PRIVATE + Wow64FreeThreadHeap @8 PRIVATE + Wow64GetWow64ImageOption @9 PRIVATE + Wow64IsControlFlowGuardEnforced @10 PRIVATE + Wow64IsStackExtentsCheckEnforced @11 PRIVATE + Wow64KiUserCallbackDispatcher @12 + Wow64LdrpInitialize @13 + Wow64LogPrint @14 PRIVATE + Wow64NotifyUnsimulateComplete @15 PRIVATE + Wow64PassExceptionToGuest @16 + Wow64PrepareForDebuggerAttach @17 PRIVATE + Wow64PrepareForException @18 + Wow64RaiseException @19 + Wow64ShallowThunkAllocObjectAttributes32TO64_FNC @20 PRIVATE + Wow64ShallowThunkAllocSecurityQualityOfService32TO64_FNC @21 PRIVATE + Wow64ShallowThunkSIZE_T32TO64 @22 PRIVATE + Wow64ShallowThunkSIZE_T64TO32 @23 PRIVATE + Wow64SuspendLocalThread @24 + Wow64SystemServiceEx @25 + Wow64ValidateUserCallTarget @26 PRIVATE + Wow64ValidateUserCallTargetFilter @27 PRIVATE \ No newline at end of file diff --git a/wine/wow64/CMakeLists.txt b/wine/wow64/CMakeLists.txt new file mode 100644 index 0000000..cb80f6c --- /dev/null +++ b/wine/wow64/CMakeLists.txt @@ -0,0 +1,164 @@ +cmake_minimum_required(VERSION 3.13) +project(wowbox64 C ASM) + +if(${CMAKE_VERSION} VERSION_LESS "3.12.2") + find_package(PythonInterp 3) + if(NOT PYTHONINTERP_FOUND) + message( FATAL_ERROR "You need a Python interpreter, CMake will exit." ) + endif() + if(${PYTHON_VERSION_MAJOR} LESS 3) + message( FATAL_ERROR "You need a Python 3 interpreter, CMake will exit." ) + endif() +else() + find_package(Python3) + if(NOT Python3_Interpreter_FOUND) + message( FATAL_ERROR "You need a Python interpreter, CMake will exit." ) + endif() + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE INTERNAL "The Python3 executable" FORCE) +endif() + +set(BOX64_ROOT "${CMAKE_SOURCE_DIR}/../..") + +string(REPLACE "," ";" DYNAREC_ASM "${DYNAREC_ASM_STR}") +string(REPLACE "," ";" DYNAREC_PASS "${DYNAREC_PASS_STR}") +string(REPLACE "," ";" INTERPRETER "${INTERPRETER_STR}") + +set(WOW64_MAIN_SRC + "${BOX64_ROOT}/wine/common/crt.c" + "${BOX64_ROOT}/wine/common/wrt.c" + "${BOX64_ROOT}/wine/wow64/wowbox64.c" +) + +set(MUSL_SRC + "${BOX64_ROOT}/external/musl/__cos.c" + "${BOX64_ROOT}/external/musl/__math_divzero.c" + "${BOX64_ROOT}/external/musl/__math_invalid.c" + "${BOX64_ROOT}/external/musl/__rem_pio2_large.c" + "${BOX64_ROOT}/external/musl/__rem_pio2.c" + "${BOX64_ROOT}/external/musl/__sin.c" + "${BOX64_ROOT}/external/musl/cos.c" + "${BOX64_ROOT}/external/musl/exp_data.c" + "${BOX64_ROOT}/external/musl/exp2.c" + "${BOX64_ROOT}/external/musl/expm1.c" + "${BOX64_ROOT}/external/musl/frexp.c" + "${BOX64_ROOT}/external/musl/ldexp.c" + "${BOX64_ROOT}/external/musl/log1p.c" + "${BOX64_ROOT}/external/musl/log2_data.c" + "${BOX64_ROOT}/external/musl/log2.c" + "${BOX64_ROOT}/external/musl/scalbn.c" + "${BOX64_ROOT}/external/musl/sin.c" + "${BOX64_ROOT}/external/musl/sincos.c" + "${BOX64_ROOT}/external/musl/sqrt_data.c" + "${BOX64_ROOT}/external/musl/sqrt.c" + "${BOX64_ROOT}/external/musl/sqrtf.c" +) + +set_source_files_properties(${DYNAREC_ASM} PROPERTIES COMPILE_OPTIONS "-mcpu=cortex-a76") + +foreach(STEP_VALUE RANGE 3) + add_library(wow64_dynarec_pass${STEP_VALUE} OBJECT ${DYNAREC_PASS}) + target_compile_definitions(wow64_dynarec_pass${STEP_VALUE} PRIVATE STEP=${STEP_VALUE}) +endforeach() + +add_library(wow64_test_interpreter OBJECT ${INTERPRETER}) +set_target_properties(wow64_test_interpreter PROPERTIES COMPILE_DEFINITIONS "TEST_INTERPRETER") + +set(WOW64_BOX64CPU_SRC + "${BOX64_ROOT}/src/build_info.c" + "${BOX64_ROOT}/src/custommem.c" + "${BOX64_ROOT}/src/dynarec/arm64/arm64_immenc.c" + "${BOX64_ROOT}/src/dynarec/arm64/arm64_printer.c" + "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_arch.c" + "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_functions.c" + "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_jmpnext.c" + "${BOX64_ROOT}/src/dynarec/arm64/dynarec_arm64_consts.c" + "${BOX64_ROOT}/src/dynarec/arm64/updateflags_arm64.c" + "${BOX64_ROOT}/src/dynarec/dynablock.c" + "${BOX64_ROOT}/src/dynarec/dynarec_native_functions.c" + "${BOX64_ROOT}/src/dynarec/dynarec_native.c" + "${BOX64_ROOT}/src/dynarec/dynarec.c" + "${BOX64_ROOT}/src/dynarec/dynacache_reloc.c" + "${BOX64_ROOT}/src/emu/x64compstrings.c" + "${BOX64_ROOT}/src/emu/x64emu.c" + "${BOX64_ROOT}/src/emu/x64primop.c" + "${BOX64_ROOT}/src/emu/x64shaext.c" + "${BOX64_ROOT}/src/emu/x64test.c" + "${BOX64_ROOT}/src/emu/x64trace.c" + "${BOX64_ROOT}/src/emu/x64run_private.c" + "${BOX64_ROOT}/src/emu/x87emu_private.c" + "${BOX64_ROOT}/src/os/backtrace.c" + "${BOX64_ROOT}/src/os/os_wine.c" + "${BOX64_ROOT}/src/os/hostext_common.c" + "${BOX64_ROOT}/src/os/hostext_wine.c" + "${BOX64_ROOT}/src/os/freq_wine.c" + "${BOX64_ROOT}/src/os/symbolfuncs_wine.c" + "${BOX64_ROOT}/src/os/emit_signal_wine.c" + "${BOX64_ROOT}/src/os/perfmap.c" + "${BOX64_ROOT}/src/os/random_wine.c" + "${BOX64_ROOT}/src/os/my_cpuid.c" + "${BOX64_ROOT}/src/os/sysinfo.c" + "${BOX64_ROOT}/src/tools/alternate.c" + "${BOX64_ROOT}/src/tools/bitutils.c" + "${BOX64_ROOT}/src/tools/env.c" + "${BOX64_ROOT}/src/tools/rbtree.c" +) + +add_library(wowbox64 SHARED ${WOW64_MAIN_SRC} ${MUSL_SRC} ${WOW64_BOX64CPU_SRC} ${INTERPRETER} ${DYNAREC_ASM} + $ + $ + $ + $ + $ + "${BOX64_ROOT}/wine/wow64/wowbox64.def") + +include_directories( + "${BOX64_ROOT}/src/include" + "${BOX64_ROOT}/src" + "${BOX64_ROOT}/wine/include" + "${BOX64_ROOT}/external/musl" + "${BOX64_ROOT}/external/musl/internal" +) + +set(DLLTOOL aarch64-w64-mingw32-dlltool) + +function(import_dll name) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}.a + COMMAND ${DLLTOOL} + -D ${name}.dll + -d ${BOX64_ROOT}/wine/${name}.def + -l ${CMAKE_CURRENT_BINARY_DIR}/${name}.a + -k + DEPENDS ${BOX64_ROOT}/wine/${name}.def + COMMENT "Generating import library ${name}.a from ${name}.def" + ) + add_custom_target(generate_${name}_import_lib DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${name}.a) + add_dependencies(wowbox64 generate_${name}_import_lib) + target_link_libraries(wowbox64 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${name}.a) +endfunction() + + +import_dll(ntdll) +import_dll(wow64) + +# always enable DynaRec, only supports ARM64 for now. +add_compile_definitions(DYNAREC ARM64) + +target_compile_options(wowbox64 PRIVATE -Wno-inconsistent-dllimport) +target_link_options(wowbox64 PRIVATE -nostdlib -nodefaultlibs + -lclang_rt.builtins-aarch64 + -Wl,--image-base,0x004c0000 + -Wl,/ignore:4217 # LNK4217: locally defined symbol imported +) +set_target_properties(wowbox64 PROPERTIES + PREFIX "" + SUFFIX ".dll" + OUTPUT_NAME "wowbox64" +) + +add_custom_command( + TARGET wowbox64 POST_BUILD + COMMAND "${PYTHON_EXECUTABLE}" ${CMAKE_SOURCE_DIR}/../override_wine_builtin.py $ +) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) diff --git a/wine/wow64/wowbox64.c b/wine/wow64/wowbox64.c new file mode 100644 index 0000000..041f952 --- /dev/null +++ b/wine/wow64/wowbox64.c @@ -0,0 +1,488 @@ +/* + * Copyright 2022-2025 André Zwing + * Copyright 2023 Alexandre Julliard + */ +#include +#include +#include +#include +#include +#include + +#include "debug.h" +#include "os.h" +#include "custommem.h" +#include "dynablock.h" +#include "env.h" +#include "emu/x64emu_private.h" +#include "emu/x87emu_private.h" +#include "x64trace.h" +#include "box64context.h" +#include "box64cpu.h" +#include "box64cpu_util.h" +#include "build_info.h" +#include "rbtree.h" +#include "wine/compiler.h" +#include "wine/debug.h" +#include "hostext.h" +#include "sysinfo.h" + +uintptr_t box64_pagesize = 4096; + +uint32_t default_gs = 0x2b; +uint32_t default_fs = 0; + +int box64_rdtsc = 0; +uint8_t box64_rdtsc_shift = 0; +int box64_is32bits = 0; +int box64_unittest_mode = 0; +int box64_wine = 0; // this is for the emulated x86 Wine. +sysinfo_t box64_sysinfo = {0}; + +static uint32_t x86emu_parity_tab[8] = { + 0x96696996, + 0x69969669, + 0x69969669, + 0x96696996, + 0x69969669, + 0x96696996, + 0x96696996, + 0x69969669, +}; + +static UINT16 DECLSPEC_ALIGN(4096) bopcode[4096 / sizeof(UINT16)]; +static UINT16 DECLSPEC_ALIGN(4096) unxcode[4096 / sizeof(UINT16)]; + +typedef UINT64 unixlib_handle_t; +NTSTATUS(WINAPI* __wine_unix_call_dispatcher)(unixlib_handle_t, unsigned int, void*); + +#define ROUND_ADDR(addr, mask) ((void*)((UINT_PTR)(addr) & ~(UINT_PTR)(mask))) +#define ROUND_SIZE(addr, size) (((SIZE_T)(size) + ((UINT_PTR)(addr) & page_mask) + page_mask) & ~page_mask) +static const UINT_PTR page_mask = 0xfff; + +/* reserved TEB64 TLS slots for Wow64 +#define WOW64_TLS_CPURESERVED 1 +#define WOW64_TLS_TEMPLIST 3 +#define WOW64_TLS_USERCALLBACKDATA 5 +#define WOW64_TLS_APCLIST 7 +#define WOW64_TLS_FILESYSREDIR 8 +#define WOW64_TLS_WOW64INFO 10 +#define WOW64_TLS_MAX_NUMBER 19 +*/ +#define WOW64_TLS_ENTRY_CONTEXT (WOW64_TLS_MAX_NUMBER - 1) +#define WOW64_TLS_EMU (WOW64_TLS_MAX_NUMBER - 2) + +int is_addr_unaligned(uintptr_t addr) +{ + // FIXME + return 0; +} + +int is_addr_autosmc(uintptr_t addr) +{ + // FIXME + return 0; +} + +#ifdef DYNAREC +int nUnalignedRange(uintptr_t start, size_t size) +{ + // FIXME + return 0; +} +void getUnalignedRange(uintptr_t start, size_t size, uintptr_t addrs[]) +{ + //FIXME +} +#endif + +typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc); +int isSimpleWrapper(wrapper_t fun) +{ + return 0; +} + +int isRetX87Wrapper(wrapper_t fun) +{ + return 0; +} + +cpu_ext_t cpuext = {0}; + +static box64context_t box64_context; +box64context_t* my_context = &box64_context; + + +void fpu_to_box(WOW64_CONTEXT* ctx, x64emu_t* emu) +{ + XMM_SAVE_AREA32* fpu = (XMM_SAVE_AREA32*)ctx->ExtendedRegisters; + + emu->mxcsr.x32 = fpu->MxCsr; + emu->cw.x16 = fpu->ControlWord; + emu->sw.x16 = fpu->StatusWord; + + LD2D(&ctx->FloatSave.RegisterArea[0], &emu->x87[0]); + LD2D(&ctx->FloatSave.RegisterArea[10], &emu->x87[1]); + LD2D(&ctx->FloatSave.RegisterArea[20], &emu->x87[2]); + LD2D(&ctx->FloatSave.RegisterArea[30], &emu->x87[3]); + LD2D(&ctx->FloatSave.RegisterArea[40], &emu->x87[4]); + LD2D(&ctx->FloatSave.RegisterArea[50], &emu->x87[5]); + LD2D(&ctx->FloatSave.RegisterArea[60], &emu->x87[6]); + LD2D(&ctx->FloatSave.RegisterArea[70], &emu->x87[7]); + memcpy(emu->xmm, fpu->XmmRegisters, sizeof(emu->xmm)); +} + +void box_to_fpu(WOW64_CONTEXT* ctx, x64emu_t* emu) +{ + XMM_SAVE_AREA32* fpu = (XMM_SAVE_AREA32*)ctx->ExtendedRegisters; + + fpu->MxCsr = emu->mxcsr.x32; + fpu->ControlWord = emu->cw.x16; + fpu->StatusWord = emu->sw.x16; + + D2LD(&emu->x87[0], &ctx->FloatSave.RegisterArea[0]); + D2LD(&emu->x87[1], &ctx->FloatSave.RegisterArea[10]); + D2LD(&emu->x87[2], &ctx->FloatSave.RegisterArea[20]); + D2LD(&emu->x87[3], &ctx->FloatSave.RegisterArea[30]); + D2LD(&emu->x87[4], &ctx->FloatSave.RegisterArea[40]); + D2LD(&emu->x87[5], &ctx->FloatSave.RegisterArea[50]); + D2LD(&emu->x87[6], &ctx->FloatSave.RegisterArea[60]); + D2LD(&emu->x87[7], &ctx->FloatSave.RegisterArea[70]); + memcpy(fpu->XmmRegisters, emu->xmm, sizeof(emu->xmm)); +} + +static NTSTATUS invalidate_mapped_section(PVOID addr) +{ + MEMORY_BASIC_INFORMATION mem_info; + SIZE_T size; + void* base; + + NTSTATUS ret = NtQueryVirtualMemory(NtCurrentProcess(), addr, MemoryBasicInformation, &mem_info, sizeof(mem_info), NULL); + + if (!NT_SUCCESS(ret)) + return ret; + + base = mem_info.AllocationBase; + size = (char*)mem_info.BaseAddress + mem_info.RegionSize - (char*)base; + + while (!NtQueryVirtualMemory(NtCurrentProcess(), (char*)base + size, MemoryBasicInformation, &mem_info, sizeof(mem_info), NULL) && mem_info.AllocationBase == base) { + size += mem_info.RegionSize; + } + + unprotectDB((uintptr_t)base, (DWORD64)size, 1); + return STATUS_SUCCESS; +} + +void WINAPI BTCpuFlushInstructionCache2(LPCVOID addr, SIZE_T size) +{ + printf_log(LOG_DEBUG, "BTCpuFlushInstructionCache2(%p, %zu)\n", addr, size); + unprotectDB((uintptr_t)addr, (size_t)size, 1); +} + +void WINAPI BTCpuFlushInstructionCacheHeavy(LPCVOID addr, SIZE_T size) +{ + printf_log(LOG_DEBUG, "BTCpuFlushInstructionCacheHeavy(%p, %zu)\n", addr, size); + unprotectDB((uintptr_t)addr, (size_t)size, 1); +} + +void* WINAPI BTCpuGetBopCode(void) +{ + printf_log(LOG_DEBUG, "BTCpuGetBopCode()\n"); + return (UINT32*)&bopcode; +} + +void* WINAPI __wine_get_unix_opcode(void) +{ + printf_log(LOG_DEBUG, "__wine_get_unix_opcode()\n"); + return (UINT32*)&unxcode; +} + +NTSTATUS WINAPI BTCpuGetContext(HANDLE thread, HANDLE process, void* unknown, WOW64_CONTEXT* ctx) +{ + printf_log(LOG_DEBUG, "BTCpuGetContext(%p, %p, %p, %p)\n", thread, process, unknown, ctx); + return NtQueryInformationThread(thread, ThreadWow64Context, ctx, sizeof(*ctx), NULL); +} + +void WINAPI BTCpuNotifyMemoryDirty(PVOID addr, SIZE_T size) +{ + printf_log(LOG_DEBUG, "BTCpuNotifyMemoryDirty(%p, %zu)\n", addr, size); + unprotectDB((uintptr_t)addr, (size_t)size, 1); +} + +void WINAPI BTCpuNotifyMemoryFree(PVOID addr, SIZE_T size, ULONG free_type) +{ + printf_log(LOG_DEBUG, "BTCpuNotifyMemoryFree(%p, %zu, %u)\n", addr, size, free_type); + if (!size) + invalidate_mapped_section(addr); + else if (free_type & MEM_DECOMMIT) + unprotectDB((uintptr_t)ROUND_ADDR(addr, page_mask), (DWORD64)ROUND_SIZE(addr, size), 1); +} + +void WINAPI BTCpuNotifyMemoryProtect(PVOID addr, SIZE_T size, DWORD new_protect) +{ + printf_log(LOG_DEBUG, "BTCpuNotifyMemoryProtect(%p, %zu, %08x)\n", addr, size, new_protect); + if (!(new_protect & (PAGE_EXECUTE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE))) + return; + unprotectDB((uintptr_t)addr, size, 1); +} + +void WINAPI BTCpuNotifyUnmapViewOfSection(PVOID addr, ULONG flags) +{ + printf_log(LOG_DEBUG, "BTCpuNotifyUnmapViewOfSection(%p, %u)\n", addr, flags); + invalidate_mapped_section(addr); +} + +NTSTATUS WINAPI BTCpuProcessInit(void) +{ + printf_log(LOG_DEBUG, "BTCpuProcessInit()\n"); + HMODULE module; + UNICODE_STRING str; + void** p__wine_unix_call_dispatcher; + +#define STATIC_ASSERT(COND, MSG) typedef char static_assertion_##MSG[(!!(COND)) * 2 - 1] + /* otherwise adjust arm64_epilog.S and arm64_next.S */ + STATIC_ASSERT(offsetof(x64emu_t, win64_teb) == 3104, offset_of_b_must_be_4); +#undef STATIC_ASSERT + + LoadEnvVariables(); + InitializeEnvFiles(); + InitializeSystemInfo(); + + if (!BOX64ENV(nobanner)) PrintBox64Version(1); + if (DetectHostCpuFeatures()) + PrintHostCpuFeatures(); + else { + printf_log(LOG_INFO, "Minimum CPU requirements not met, disabling DynaRec\n"); + SET_BOX64ENV(dynarec, 0); + } + + TCHAR filename[MAX_PATH]; + if (GetModuleFileNameA(NULL, filename, MAX_PATH)) { + char* shortname = strrchr(filename, '\\'); + if (shortname) { + shortname++; + ApplyEnvFileEntry(shortname); + } + } + + PrintEnvVariables(&box64env, LOG_INFO); + + memset(bopcode, 0xc3, sizeof(bopcode)); + memset(unxcode, 0xc3, sizeof(unxcode)); + bopcode[0] = 0x2ecd; + unxcode[0] = 0x2ecd; + + init_custommem_helper(&box64_context); + box64_context.db_sizes = rbtree_init("db_sizes"); + + if ((ULONG_PTR)bopcode >> 32 || (ULONG_PTR)unxcode >> 32) { + printf_log(LOG_NONE, "box64cpu loaded above 4G, disabling\n"); + return STATUS_INVALID_ADDRESS; + } + + RtlInitUnicodeString(&str, L"ntdll.dll"); + LdrGetDllHandle(NULL, 0, &str, &module); + p__wine_unix_call_dispatcher = RtlFindExportedRoutineByName(module, "__wine_unix_call_dispatcher"); + __wine_unix_call_dispatcher = *p__wine_unix_call_dispatcher; + + RtlInitializeCriticalSection(&box64_context.mutex_dyndump); + RtlInitializeCriticalSection(&box64_context.mutex_trace); + RtlInitializeCriticalSection(&box64_context.mutex_tls); + RtlInitializeCriticalSection(&box64_context.mutex_thread); + RtlInitializeCriticalSection(&box64_context.mutex_bridge); + RtlInitializeCriticalSection(&box64_context.mutex_lock); + + InitX64Trace(&box64_context); + + return STATUS_SUCCESS; +} + +static uint8_t box64_is_addr_in_jit(void* addr) +{ + if (!addr) + return FALSE; + return !!FindDynablockFromNativeAddress(addr); +} + +NTSTATUS WINAPI BTCpuResetToConsistentState(EXCEPTION_POINTERS* ptrs) +{ + printf_log(LOG_DEBUG, "BTCpuResetToConsistentState(%p)\n", ptrs); + x64emu_t* emu = NtCurrentTeb()->TlsSlots[WOW64_TLS_EMU]; + EXCEPTION_RECORD* rec = ptrs->ExceptionRecord; + CONTEXT* ctx = ptrs->ContextRecord; + + if (rec->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) { + dynablock_t* db = NULL; + void* addr = NULL; + uint32_t prot; + + if (rec->NumberParameters == 2 && rec->ExceptionInformation[0] == 1) + addr = ULongToPtr(rec->ExceptionInformation[1]); + + if (addr) { + unprotectDB((uintptr_t)addr, 1, 1); // unprotect 1 byte... But then, the whole page will be unprotected + NtContinue(ctx, FALSE); + } + } + + if (!box64_is_addr_in_jit(ULongToPtr(ctx->Pc))) + return STATUS_SUCCESS; + + /* Replace the host context with one captured before JIT entry so host code can unwind */ + memcpy(ctx, NtCurrentTeb()->TlsSlots[WOW64_TLS_ENTRY_CONTEXT], sizeof(*ctx)); + return STATUS_SUCCESS; +} + +NTSTATUS WINAPI BTCpuSetContext(HANDLE thread, HANDLE process, void* unknown, WOW64_CONTEXT* ctx) +{ + printf_log(LOG_DEBUG, "BTCpuSetContext(%p, %p, %p, %p)\n", thread, process, unknown, ctx); + return NtSetInformationThread(thread, ThreadWow64Context, ctx, sizeof(*ctx)); +} + +void WINAPI BTCpuSimulate(void) +{ + printf_log(LOG_DEBUG, "BTCpuSimulate()\n"); + WOW64_CPURESERVED* cpu = NtCurrentTeb()->TlsSlots[WOW64_TLS_CPURESERVED]; + x64emu_t* emu = NtCurrentTeb()->TlsSlots[WOW64_TLS_EMU]; + WOW64_CONTEXT* ctx = (WOW64_CONTEXT*)(cpu + 1); + CONTEXT entry_context; + + RtlCaptureContext(&entry_context); + NtCurrentTeb()->TlsSlots[WOW64_TLS_ENTRY_CONTEXT] = &entry_context; + + R_EAX = ctx->Eax; + R_EBX = ctx->Ebx; + R_ECX = ctx->Ecx; + R_EDX = ctx->Edx; + R_ESI = ctx->Esi; + R_EDI = ctx->Edi; + R_EBP = ctx->Ebp; + R_RIP = ctx->Eip; + R_ESP = ctx->Esp; + R_CS = ctx->SegCs & 0xffff; + R_DS = ctx->SegDs & 0xffff; + R_ES = ctx->SegEs & 0xffff; + R_FS = ctx->SegFs & 0xffff; + R_GS = ctx->SegGs & 0xffff; + R_SS = ctx->SegSs & 0xffff; + emu->eflags.x64 = ctx->EFlags; + emu->segs_offs[_FS] = calculate_fs(); + emu->win64_teb = (uint64_t)NtCurrentTeb(); + + fpu_to_box(ctx, emu); + + if (box64env.dynarec) + DynaRun(emu); + else + Run(emu, 0); +} + +NTSTATUS WINAPI BTCpuThreadInit(void) +{ + printf_log(LOG_DEBUG, "BTCpuThreadInit()\n"); + WOW64_CONTEXT* ctx; + x64emu_t* emu = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*emu)); + + RtlWow64GetCurrentCpuArea(NULL, (void**)&ctx, NULL); + emu->context = &box64_context; + + // setup cpu helpers + for (int i = 0; i < 16; ++i) + emu->sbiidx[i] = &emu->regs[i]; + emu->sbiidx[4] = &emu->zero; + emu->x64emu_parity_tab = x86emu_parity_tab; + + reset_fpu(emu); + + NtCurrentTeb()->TlsSlots[WOW64_TLS_EMU] = emu; + return STATUS_SUCCESS; +} + +void EmitInterruptionImpl(x64emu_t* emu, int code) +{ + if (code == 0x2e /* NT syscall */) { + WOW64_CPURESERVED* cpu = NtCurrentTeb()->TlsSlots[WOW64_TLS_CPURESERVED]; + WOW64_CONTEXT* ctx = (WOW64_CONTEXT*)(cpu + 1); + int id = R_EAX; + BOOL is_unix_call = FALSE; + + if (ULongToPtr(R_RIP) == &unxcode) + is_unix_call = TRUE; + else if (ULongToPtr(R_RIP) != &bopcode) + return; + + R_RIP = Pop32(emu); + ctx->Eip = R_RIP; + ctx->Esp = R_ESP; + ctx->Ebx = R_EBX; + ctx->Esi = R_ESI; + ctx->Edi = R_EDI; + ctx->Ebp = R_EBP; + ctx->EFlags = emu->eflags.x64; + cpu->Flags = 0; + + box_to_fpu(ctx, emu); + + if (is_unix_call) { + uintptr_t handle_low = Pop32(emu); + uintptr_t handle_high = Pop32(emu); + unsigned int code = Pop32(emu); + uintptr_t args = Pop32(emu); + + ctx->Esp = R_ESP; + R_EAX = __wine_unix_call_dispatcher(handle_low | (handle_high << 32), code, (void*)args); + } else { + R_EAX = Wow64SystemServiceEx(id, ULongToPtr(ctx->Esp + 4)); + } + + fpu_to_box(ctx, emu); + + R_EBX = ctx->Ebx; + R_ESI = ctx->Esi; + R_EDI = ctx->Edi; + R_EBP = ctx->Ebp; + R_ESP = ctx->Esp; + R_RIP = ctx->Eip; + if (cpu->Flags & WOW64_CPURESERVED_FLAG_RESET_STATE) { + cpu->Flags &= ~WOW64_CPURESERVED_FLAG_RESET_STATE; + R_EAX = ctx->Eax; + R_ECX = ctx->Ecx; + R_EDX = ctx->Edx; + R_FS = ctx->SegFs & 0xffff; + emu->segs_offs[_FS] = calculate_fs(); + emu->eflags.x64 = ctx->EFlags; + } + } else { + RtlRaiseStatus(STATUS_ACCESS_VIOLATION); + } +} + +/* Calls a 2-argument function `Func` setting the parent unwind frame information to the given SP and PC */ +static void __attribute__((naked)) SEHFrameTrampoline2Args(void* Arg0, int Arg1, void* Func, uint64_t Sp, uint64_t Pc) +{ + asm(".seh_proc SEHFrameTrampoline2Args\n\t" + "stp x3, x4, [sp, #-0x10]!\n\t" + ".seh_pushframe\n\t" + "stp x29, x30, [sp, #-0x10]!\n\t" + ".seh_save_fplr_x 16\n\t" + ".seh_endprologue\n\t" + "blr x2\n\t" + "ldp x29, x30, [sp], 0x20\n\t" + "ret\n\t" + ".seh_endproc"); +} + +void EmitInterruption(x64emu_t* emu, int num, void* addr) +{ + CONTEXT* entry_context = NtCurrentTeb()->TlsSlots[WOW64_TLS_ENTRY_CONTEXT]; + SEHFrameTrampoline2Args(emu, num, (void*)EmitInterruptionImpl, entry_context->Sp, entry_context->Pc); + NtCurrentTeb()->TlsSlots[WOW64_TLS_ENTRY_CONTEXT] = entry_context; +} + +NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE); + +BOOL WINAPI DllMainCRTStartup(HINSTANCE inst, DWORD reason, void* reserved) +{ + if (reason == DLL_PROCESS_ATTACH) LdrDisableThreadCalloutsForDll(inst); + return TRUE; +} diff --git a/wine/wow64/wowbox64.def b/wine/wow64/wowbox64.def new file mode 100644 index 0000000..dd1d0dc --- /dev/null +++ b/wine/wow64/wowbox64.def @@ -0,0 +1,17 @@ +LIBRARY wowbox64.dll + +EXPORTS + BTCpuFlushInstructionCache2 + BTCpuFlushInstructionCacheHeavy + BTCpuGetBopCode + BTCpuGetContext + BTCpuNotifyMemoryDirty + BTCpuNotifyMemoryFree + BTCpuNotifyMemoryProtect + BTCpuNotifyUnmapViewOfSection + BTCpuProcessInit + BTCpuResetToConsistentState + BTCpuSetContext + BTCpuSimulate + BTCpuThreadInit + __wine_get_unix_opcode diff --git a/wrapperhelper/CMakeLists.txt b/wrapperhelper/CMakeLists.txt deleted file mode 100644 index 3ab9cf1..0000000 --- a/wrapperhelper/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project("helper") -find_package(Clang REQUIRED CONFIG) - -add_executable(helper main.cpp gen.cpp) -target_include_directories(helper SYSTEM PUBLIC ${CLANG_INCLUDE_DIRS}) -target_link_libraries(helper PUBLIC clang-cpp LLVM) diff --git a/wrapperhelper/Makefile b/wrapperhelper/Makefile new file mode 100755 index 0000000..a4d9bc8 --- /dev/null +++ b/wrapperhelper/Makefile @@ -0,0 +1,308 @@ +all: +.PHONY: all + +OPTIM?=2 +DEBUG?=1 +# FORCE_COLOR: set to non-empty, non 0 to force colorized output +# ECHO: set to non-empty, non 0 to echo commands out + +help: + @echo 'Targets:' + @echo ' help (current target)' + @echo ' all (default target)' + @echo ' [EXE] - wrapperhelper' + @printf ' $(foreach obj,$(OBJLIST_wrapperhelper), [OBJ] - $(obj)\n)' + @printf ' $(foreach test,$(TESTS), [TST] - $(test)\n)' + @echo ' clean' + @echo ' distclean' + @echo '' + @echo 'Options:' + @echo ' OPTIM: GCC optimization level (-O is prepended) [default: 2]' + @echo ' DEBUG: set to 0 for release build, set to non-0 for debug build [default: 1]' + @echo ' FORCE_COLOR: set to non-0 to force colorized output' + @echo ' ECHO: set to non-0 to echo out commands executed' + @echo '' + @echo 'Current flags:' + @echo ' CPPFLAGS = $(CPPFLAGS)' + @echo ' CFLAGS = $(CFLAGS)' +# @echo ' CXXFLAGS = $(CXXFLAGS)' unused + @echo ' LDFLAGS = $(LDFLAGS)' + @echo ' LDLIBS = $(LDLIBS)' + @echo '' + @echo 'Sanitizers:' + @echo " address ------------ `[ $(ASAN_ON) -eq 1 ] && printf '\033[92mON\033[m' || printf '\033[91mOFF\033[m'`" + @echo " leak --------------- `[ $(LSAN_ON) -eq 1 ] && printf '\033[92mON\033[m' || printf '\033[91mOFF\033[m'`" + @echo " undefined behavior - `[ $(USAN_ON) -eq 1 ] && printf '\033[92mON\033[m' || printf '\033[91mOFF\033[m'`" +.PHONY: help + +ifeq ($(ECHO:0=),) +SILENCER:=@ +else +SILENCER:= +endif + +ifneq ($(strip $(DEBUG)),0) +CPPFLAGS+= -DDEBUG -D_NRELEASE +CFLAGS+= -g +CXXFLAGS+= -g +LDFLAGS+= -g +OBJDIR?=debug +else +CPPFLAGS+= -DRELEASE -D_NDEBUG +OBJDIR?=release +endif + +COMMON_WARNINGS:=-Wfatal-errors -fanalyzer -Wall -Wextra +COMMON_WARNINGS+= -Walloc-zero -Wcast-align=strict -Wcast-qual -Wconversion -Wdate-time +COMMON_WARNINGS+= -Wdisabled-optimization -Wduplicated-branches -Wfloat-equal -Wformat-truncation=2 +COMMON_WARNINGS+= -Wimplicit-fallthrough=3 -Wlogical-op -Wmissing-format-attribute -Wmissing-include-dirs +COMMON_WARNINGS+= -Wmissing-noreturn -Wnull-dereference -Wredundant-decls -Wundef -Wunreachable-code -Wshift-overflow=2 +COMMON_WARNINGS+= -Wstringop-overflow=4 +#COMMON_WARNINGS+= -Wstringop-overflow=4 -Wsuggest-attribute=cold -Wsuggest-attribute=const -Wsuggest-attribute=format +#COMMON_WARNINGS+= -Wsuggest-attribute=malloc -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure +COMMON_WARNINGS+= -Wunknown-pragmas -Wunused-macros -Wwrite-strings +COMMON_WARNINGS+= -Werror=attribute-alias=2 -Werror=duplicated-cond -Werror=format=2 -Werror=format-overflow=2 +COMMON_WARNINGS+= -Werror=format-signedness -Werror=pointer-arith +COMMON_WARNINGS+= -Werror=return-type -Werror=shadow -Werror=strict-overflow -Werror=switch-enum +CFLAGS_WARNINGS:=-Werror=implicit-function-declaration -Werror=jump-misses-init -Werror=strict-prototypes +CXXFLAGS_WARNINGS:=-Werror=overloaded-virtual -fdiagnostics-show-template-tree -Wno-analyzer-use-of-uninitialized-value + +CPPFLAGS+= +CFLAGS:=$(COMMON_WARNINGS) $(CFLAGS_WARNINGS) $(CFLAGS) -std=gnu18 -O$(OPTIM) +CXXFLAGS:=$(COMMON_WARNINGS) $(CXXFLAGS_WARNINGS) $(CXXFLAGS) -std=c++20 -O$(OPTIM) +LDFLAGS+= -O$(OPTIM) + +#CPPFLAGS+= -I/usr/include/SDL2 -D_REENTRANT -pthread +#CFLAGS+= -pthread +#CXXFLAGS+= -pthread +#LDLIBS+= -pthread -lSDL2 + +ifeq (,$(wildcard $(CURDIR)/sanaddress)) +ASAN_ON:=0 +else +ASAN_ON:=1 +CFLAGS+= -fsanitize=address +CXXFLAGS+= -fsanitize=address +LDFLAGS+= -fsanitize=address +endif +ifeq (,$(wildcard $(CURDIR)/sanleak)) +LSAN_ON:=0 +else +LSAN_ON:=1 +CFLAGS+= -fsanitize=leak +CXXFLAGS+= -fsanitize=leak +LDFLAGS+= -fsanitize=leak +endif +ifeq (,$(wildcard $(CURDIR)/sanundefined)) +USAN_ON:=0 +else +USAN_ON:=1 +CFLAGS+= -fsanitize=undefined +CXXFLAGS+= -fsanitize=undefined +LDFLAGS+= -fsanitize=undefined +endif + +# Default +# .SUFFIXES: .out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .yl .s .S .mod +# .sym .def .h .info .dvi .tex .texinfo .texi .txinfo .w .ch .web .sh .elc .el +SUFFIXES = +.SUFFIXES: +.SECONDEXPANSION: + +ifneq ($(MAKECMDGOALS:distclean=clean),clean) +.: ; +bin obj: ; $(SILENCER)test -d $@ || mkdir $@ +# $(eval $(call reproduce_tree,)) +define reproduce_tree = +$(1): | $$$$(@D) ; $(SILENCER)test -d $$@ || mkdir $$@ +endef +$(eval $(call reproduce_tree,obj/$(OBJDIR))) +$(eval $(call reproduce_tree,obj/$(OBJDIR)/tests)) +$(eval $(call reproduce_tree,makedir)) +$(eval $(call reproduce_tree,makedir/tests)) +$(eval $(call reproduce_tree,tests)) +endif + +# Colors: +# ------- +# +--------+-----+ +# | 3 | 9 | +# +-+--------+-----+ +# |0| | | Black +# |1| | RM | Red +# |2| |[MSG]| Green +# |3|Creating| | Yellow +# |4| | CP | Blue +# |5| | LD | Purple +# |6| C++ | | Cyan +# |7| | | Gray/white +# +-+--------+-----+ + +# $(call colorize,,,,) +ifdef $(if $(FORCE_COLOR:0=),FORCE_COLOR,MAKE_TERMOUT) +CFLAGS:=$(CFLAGS) -fdiagnostics-color +CXXFLAGS:=$(CFLAGS) -fdiagnostics-color +colorize=@printf "\033[$(1)m[$(2)]\033[m \033[$(3)m$(4)\033[m\n" +else +ifeq ($(SILENCER),) +colorize= +else +colorize=@echo "[$(2)] $(4)" +endif +endif + +define newline := + + +endef + +# $(call remove,) +define remove = +$(call colorize,1;91,RM ,91,Removing $(1)) +$(SILENCER)$(RM) -r $(1) +endef + +# $(eval $(call add_deptree,,,)) +ifeq ($(MAKECMDGOALS),distclean) +add_deptree= +else +define add_deptree = +makedir/$(2).mk: | $$$$(@D) + $(call colorize,95,DEP,33,Creating $(3) dependancies) + $(SILENCER)set -e; $(1) -MM src/$(3) \ + | sed 's,\($$(notdir $$(basename $(3)))\)\.o[ :]*,$$(dir obj/$(OBJDIR)/$(3))\1.o: $$@'"\n"'$$(dir obj/$(OBJDIR)/$(3))\1.o $$@: ,g' >$$@ +include makedir/$(2).mk +endef +endif + +OBJLIST=$(OBJLIST_wrapperhelper) $(foreach test,$(TESTS),$(call test_o,$(test))) +OBJLIST_wrapperhelper:= +TESTS:= + +# $(call wrapperhelper_o,,,) +wrapperhelper_o=obj/$(OBJDIR)/$(1)$(3).o +# $(eval $(call compile_wrapperhelper_c,,,)) +define compile_wrapperhelper_c = +$$(eval $$(call add_deptree,$$(CC) $$(CPPFLAGS) $$(CFLAGS),$(1)$(3),$(1)$(2).c)) +OBJLIST_wrapperhelper+= $(call wrapperhelper_o,$(1),$(2),$(3)) +$(call wrapperhelper_o,$(1),$(2),$(3)): src/$(1)$(2).c | $$$$(@D) + $(call colorize,36, C ,92,Compiling $$@) + $(SILENCER)$$(CC) $$(CPPFLAGS) $$(CFLAGS) -c src/$(1)$(2).c -o $$@ +endef +# $(eval $(call compile_wrapperhelper_cxx,,,)) +define compile_wrapperhelper_cxx = +$$(eval $$(call add_deptree,$$(CXX) $$(CPPFLAGS) $$(CXXFLAGS),$(1)$(3),$(1)$(2).cpp)) +OBJLIST_wrapperhelper+= $(call wrapperhelper_o,$(1),$(2),$(3)) +$(call wrapperhelper_o,$(1),$(2),$(3)): src/$(1)$(2).cpp | $$$$(@D) + $(call colorize,36,C++,92,Compiling $$@) + $(SILENCER)$$(CXX) $$(CPPFLAGS) $$(CXXFLAGS) -c src/$(1)$(2).cpp -o $$@ +endef + +# $(eval $(call compile_test_c,)) +define compile_test_c = +$$(eval $$(call add_deptree,$$(CC) $$(CPPFLAGS) -Isrc/tests -Isrc $$(CFLAGS),tests/$(1),tests/$(1).c)) +TESTS+= $(1) +tests/$(1): obj/$(OBJDIR)/tests/$(1).o | $$$$(@D) + $(call colorize,95,LD ,92,Linking $$@) + $(SILENCER)$$(CC) $$(LDFLAGS) -o $$@ obj/$(OBJDIR)/tests/$(1).o $$(LDLIBS) + +obj/$(OBJDIR)/tests/$(1).o: src/tests/$(1).c | $$$$(@D) + $(call colorize,36,C++,92,Compiling $$@) + $(SILENCER)$$(CC) $$(CPPFLAGS) -Isrc/tests -Isrc $$(CFLAGS) -c src/tests/$(1).c -o $$@ +endef +# $(eval $(call compile_test_cxx,)) +define compile_test_cxx = +$$(eval $$(call add_deptree,$$(CXX) $$(CPPFLAGS) -Isrc/tests -Isrc $$(CXXFLAGS),tests/$(1),tests/$(1).cpp)) +TESTS+= $(1) +tests/$(1): obj/$(OBJDIR)/tests/$(1).o | $$$$(@D) + $(call colorize,95,LD ,92,Linking $$@) + $(SILENCER)$$(CXX) $$(LDFLAGS) -o $$@ obj/$(OBJDIR)/tests/$(1).o $$(LDLIBS) + +obj/$(OBJDIR)/tests/$(1).o: src/tests/$(1).cpp | $$$$(@D) + $(call colorize,36,C++,92,Compiling $$@) + $(SILENCER)$$(CXX) $$(CPPFLAGS) -Isrc/tests -Isrc $$(CXXFLAGS) -c src/tests/$(1).cpp -o $$@ +endef + +$(eval $(call compile_wrapperhelper_c,,cstring,cstring)) +$(eval $(call compile_wrapperhelper_c,,generator,generator)) +$(eval $(call compile_wrapperhelper_c,,lang,lang)) +$(eval $(call compile_wrapperhelper_c,,log,log)) +$(eval $(call compile_wrapperhelper_c,,machine,machine)) +$(eval $(call compile_wrapperhelper_c,,main,main)) +$(eval $(call compile_wrapperhelper_c,,parse,parse)) +$(eval $(call compile_wrapperhelper_c,,prepare,prepare)) +$(eval $(call compile_wrapperhelper_c,,preproc,preproc)) +$(eval $(call compile_wrapperhelper_c,,vector,vector)) +$(call wrapperhelper_o,,machine,machine): src/machine.gen +$(call wrapperhelper_o,,generator,generator): CFLAGS+= -fno-analyzer # Too slow +$(call wrapperhelper_o,,preproc,preproc): CFLAGS+= -fno-analyzer +$(call wrapperhelper_o,,parse,parse): CFLAGS+= -fno-analyzer + +src/machine.gen: + $(call colorize,96,GEN,33,Generating $@) + $(SILENCER)echo | LC_ALL=C LANG=C $(CC) $(CPPFLAGS) -E -v - 2>&1 | sed ':l; $$ ! { N; b l }; s/.*#include <...> search starts here:\n//; s/End of search list.*//; s/^ /DO_PATH("/; s/\n /")\nDO_PATH("/g; s/\n$$/")/' >src/machine.gen + +#$(eval $(call compile_test_cxx,core/number)) + +bin/wrapperhelper: $$(OBJLIST_wrapperhelper) | $$(@D) + $(call colorize,95,LD ,92,Linking $@) + $(SILENCER)$(CXX) $(LDFLAGS) -o $@ $(OBJLIST_wrapperhelper) $(LDLIBS) + +wrapperhelper: bin/wrapperhelper +alltests: $(TESTS:%=tests/%) +.PHONY: wrapperhelper alltests + +all: wrapperhelper alltests + +clean: + $(call remove,$(OBJLIST)) + $(call remove,bin/wrapperhelper) + $(call remove,$(TESTS:%=obj/$(OBJDIR)/tests/%.o)) + $(call remove,$(TESTS:%=tests/%)) + $(call remove,src/machine.gen) +.PHONY: clean +distclean: + $(call remove,makedir) + $(call remove,obj) + $(call remove,bin tests) +.PHONY: distclean + +sanitize/help: + @echo "Sanitizers:" + @echo "- address (removes leak)" + @echo "- leak (removes address)" + @echo "- undefined behavior" + @echo "" + @echo "Currently active options:" + @[ $(ASAN_ON) -eq 0 ] || echo "- address" + @[ $(LSAN_ON) -eq 0 ] || echo "- leak" + @[ $(USAN_ON) -eq 0 ] || echo "- undefined behavior" +sanitize/address: + @[ $(ASAN_ON) -eq 0 ] && echo "Not sanitizing address" || echo "Sanitizing address" +sanitize/leak: + @[ $(LSAN_ON) -eq 0 ] && echo "Not sanitizing leak" || echo "Sanitizing leak" +sanitize/undefined: + @[ $(USAN_ON) -eq 0 ] && echo "Not sanitizing undefined behavior" || echo "Sanitizing undefined behavior" +sanitize/address/on: + $(SILENCER)touch sanaddress + $(SILENCER)$(RM) sanleak +sanitize/leak/on: + $(SILENCER)touch sanleak + $(SILENCER)$(RM) sanaddress +sanitize/undefined/on: + $(SILENCER)touch sanundefined +sanitize/address/off: + $(SILENCER)$(RM) sanaddress +sanitize/leak/off: + $(SILENCER)$(RM) sanleak +sanitize/undefined/off: + $(SILENCER)$(RM) sanundefined +.PHONY: sanitize/address sanitize/leak sanitize/undefined +.PHONY: sanitize/address/on sanitize/leak/on sanitize/undefined/on +.PHONY: sanitize/address/off sanitize/leak/off sanitize/undefined/off + +tree: + @tree src +.PHONY: tree + +.DELETE_ON_ERROR: diff --git a/wrapperhelper/README.md b/wrapperhelper/README.md index 1edd4db..282fdf6 100644 --- a/wrapperhelper/README.md +++ b/wrapperhelper/README.md @@ -1,99 +1,126 @@ # Wrapper helper -**WARNING: There are still many problems with this tool. Please do NOT submit code generated directly by the tool, you should only use it as a preliminary reference.** +This folder is semi-independent from the parent project (`box64`). This sub-project aims to (partially) automating the generation of the private headers in `src/wrapped`. This is, however, still a work-in-progress and in alpha. +As such, **this sub-project is mainly aimed at people who know how to read code and are familiar with the wrapped libraries part of `box64`**. -This tool is based on libclangtooling. +## Licensing -It parses the AST of the library header files, generating the required structures of the wrapping library, including: -- structure definitions, -- export function signatures, -- callback function wrapping, -etc. Of course, this cannot completely automate everything, it can only be used as a reference. +This program is under the MIT license. However, some system header files under the LGPL license (copied from a GNU libc Arch Linux installation) have been adapted into the `include-fixed` folder; these files are not copied into the output and simply serve as data. As such, I believe this falls under fair use, and does not lead to the output of this program (used in the parent `box64` project) being under the (L)GPL license. -At the same time, this tool is also quite rough, and may even have errors. +## Compiling -## Build +You need a C compiler and GNU Make. No library is required. -``` -sudo apt install libclang-14-dev -cd wrapperhelper -mkdir build; cd build; cmake .. -make -``` +Go to this folder, then run the `make` command. This will produce a binary called `bin/wrapperhelper`. -## Usage: +This project has been compiled and tested with `GCC 14.2.1 20240805` on an `x86_64` machine, with no warning emitted. - helper [guest_triple] [host_triple] -- - : set the header file to be parsed - : set libname required for wrapping func - [guest_triple]: set guest triple: can be arm32/arm64/x86/x64, default is x64 - [host_triple] : set host triple: can be arm32/arm64/x86/x64, default is arm64 - -- : mandatory - : extra compiler flags +You may also use the `make clean` and `make distclean` commands to remove output files (`clean`) and directories (`distclean`). -### Usage example: +## Usage -`./helper /usr/include/jpeglib.h libjpeg x64 arm64 -- -I /usr/lib/gcc/x86_*/12.2.0/include --include /usr/lib/gcc/x86_*/12.2.0/include/stddef.h --include /usr/include/stdio.h` +To use the wrapper helper, run the following command in the folder containing this `README.md`: +```sh +bin/wrapperhelper -I/path/to/system/include "path_to_support_file" "path_to_private.h" "path_to_private.h" +``` -You would see an output similar to the files `src/wrapped/wrappedlibjpeg.c` and `src/wrapped/wrappedlibjpeg_private.h`, should they exist. +You may add as many `-I` options as needed. The folders `include-override/` and `include-override/common` are always prioritized, as if they appeared first in the command line. -If there are multiple header files to process, write them into a custom header file as input. +You may also use the `-32` and `-64` switches to generate `box32` or `box64` files respectively. Alterately, you can use the `--emu arch` and `--target arch` options to select more precisely the emlated and executing platforms, though only `x86`, `x86_64` and `aarch64` are supported for now. By default, everything is as if `-64` was supplied. -### Output sample +The first file is a `C` file containing every declaration required. The second file is the "requests" input. The third file is the output file, which may be a different file. -Using the command above, we get the following (trimmed) files: +The support file may contain pragma declarations of the form +```c +#pragma wrappers type_letters c TYPE +#pragma wrappers type_letters_strict c TYPE +``` +where `TYPE` is a `type-name`. The second form marks the *exact* type `TYPE` as being a complex type though with a conversion as `c` (which may be multiple characters), while the first marks the type `TYPE`, regardless of type qualifers (`_Atomic`, `const`, `restrict`, `volatile`). Meaning: +- if a parameter has type `TYPE`, the character output will be `c`; +- if a parameter has a pointer to `TYPE`, or a structure containing `TYPE`, the output will be a `GOM` function. -In `wrappedlibjpeg_private.h`: +Declarations of the form ```c -... -GO(jpeg_quality_scaling, iFi) -... -GOM(jpeg_destroy, vFEp) -... +#pragma wrappers mark_simple TAG ``` +will mark the structure or union with tag `TAG`, or the structure or union aliased to `TAG` by a `typedef` if no such structure exist, as simple. This means that a pointer to such a structure will have a character output of `p`. +This is not the same as making the pointer to the structure a complex type with conversion as `p` as e.g. pointers to pointers will behave differently. + +System headers included (directly or indirectly) by the support file are overriden by the files in `include-fixed`. + +The first three lines of the input are ignored. -In `wrappedlibjpeg.c`: +A "request" is a structure containing an object name and, eventually, a default value (`GO`, `GO2` with type `vFiV` to function `xxx`, `DATA`...) and/or a "solved" value (which is similar, but deduced from the support file). + +Valid requests (in the reference file) are: ```c -... -typedef struct jpeg_source_mgr { - void *next_input_byte; - unsigned long bytes_in_buffer; - vFp_t init_source; - iFp_t fill_input_buffer; - vFpI_t skip_input_data; - iFpi_t resync_to_restart; - vFp_t term_source; -} jpeg_source_mgr, *jpeg_source_mgr_ptr; -... -#define GO(A) \ -static uintptr_t my_term_source_fct_##A = 0; \ -void my_term_source_##A(struct jpeg_decompress_struct * a0) { \ - return RunFunction(my_context, my_term_source_fct_##A, 1, a0); \ -} -SUPER() -#undef GO -static void* findterm_sourceFct(void* fct) { - if(!fct) return fct; - if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); - #define GO(A) if(my_term_source_fct_##A == (uintptr_t)fct) return my_term_source_##A;} - SUPER() - #undef GO - #define GO(A) if(my_term_source_fct_##A == 0) {my_term_source_fct_##A = (uintptr_t)fct;return my_term_source_##A;} - SUPER() - #undef GO - return NULL; -} -... -EXPORT int my_jpeg_quality_scaling(void *emu, int quality) { - libjpeg_my_t *my = (libjpeg_my_t*)my_lib->priv.w.p2; - my->jpeg_quality_scaling(quality); -} -... -EXPORT void my_jpeg_destroy(void *emu, struct jpeg_common_struct * cinfo) { - // WARN: This function's arg has a structure ptr which is special, may need to wrap it for the host - libjpeg_my_t *my = (libjpeg_my_t*)my_lib->priv.w.p2; - my->jpeg_destroy(cinfo); -} -... +{GO/GOM/GOW/GOWM} ( name , type ) +{GOD/GO2/GOWD/GOW2} ( name , type , name ) +// {GO/GOM/GOW/GOWM} ( name , +// {GO/GOM/GOW/GOWM} ( name , type ) +// {GOD/GO2/GOWD/GOW2} ( name , +// {GOD/GO2/GOWD/GOW2} ( name , type , name ) +DATA[V/B/M] ( name , int ) +// DATA[V/B/M] ( name , +// DATA[V/B/M] ( name , int ) +``` +(where `{A/B}` means `A` or `B` and `[A/B]` means `A`, `B` or nothing). All other comments are ignored. + +If you want to explore the output of the different stages of the helper, you can use the following forms: +```sh +bin/wrapperhelper --prepare "path_to_support_file" # (1) +bin/wrapperhelper --preproc "path_to_support_file" # (2) +bin/wrapperhelper --proc "path_to_support_file" # (3) +bin/wrapperhelper "path_to_support_file" # (3) as well +``` +1. This form outputs the list of preprocessor tokens (the "post-prepare" phase). +2. This form outputs the list of processor tokens (the "post-preprocessor" phase). +3. This form outputs the list of constants, type definitions, structure definitions, and declarations (the "post-processor" phase). + +### Example + +To remake the `wrappedlibc_private.h` file, use the following command: +```sh +bin/wrapperhelper example-libc.h ../src/wrapped/wrappedlibc_private.h ../src/wrapped/wrappedlibc_private.h ``` +This will emit a few marnings and (non-fatal) errors, then write the result directly in `wrappedlibc_private.h`. + +## Maintaining + +All of the source code is included in the `src` folder. + +The `main` function is in `main.c`. + +The first phase of compilation (steps 1-3 and a part of step 5 of the translation phases) is implemented in `prepare.c`. + +The second phase of compilation (steps 4 and 6) is implemented in `preproc.c`. + +The third phase of compilation (step 7) is implemented in `parse.c`, though no actual parsing of function definitions takes place. + +The reading and writing of the `_private.h` files is implemented in `generator.c`. + +## Known issues + +Only native structures are read. This means that the current version of `wrapperhelper` does not detect an issue when a structure has different members or alignments in two different architectures. + +No checking of signatures under `#ifdef`s is made. + +Phase 5 is partially implemented, but could be greatly improved. + +The following features are missing from the generator: +- Structures with at least two elements as a parameter +- Large structure as a return type (more than 16 bytes on 64bits, or 8 bytes on 32bits) +- Atomic types + +The following features are missing from the preprocessor: +- General token concatenation (though the concatenation of two `PTOK_IDENT` works without issue) +- Stringify +- Skipped unexpected token warnings + +The following features are missing from the parser: +- `_Alignas(type-name)` and `_Alignas(constant-expression)` +- `(type-name){initializer-list}` +- Old style function declarations +- Function definitions are ignored, not parsed +- Attributes are ignored everywhere (with a `#define __attribute__(_)`) diff --git a/wrapperhelper/ast.h b/wrapperhelper/ast.h deleted file mode 100644 index 2746d98..0000000 --- a/wrapperhelper/ast.h +++ /dev/null @@ -1,189 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gen.h" -#include "utils.h" - -static void ParseParameter(clang::ASTContext* AST, WrapperGenerator* Gen, clang::QualType ParmType, FuncInfo* Func) { - using namespace clang; - (void)AST; (void)Func; - if (ParmType->isFunctionPointerType()) { - auto ProtoType = ParmType->getPointeeType()->getAs(); - for (unsigned i = 0; i < ProtoType->getNumParams(); i++) { - ParseParameter(AST, Gen, ProtoType->getParamType(i), Func); - } - } else if (ParmType->isPointerType()) { - auto PointeeType = ParmType->getPointeeType(); - if (PointeeType->isRecordType()) { - if (Gen->records.find(StripTypedef(PointeeType)) == Gen->records.end()) { - auto Record = &Gen->records[StripTypedef(PointeeType)]; - if (PointeeType->isUnionType()) { - Record->is_union = true; - } - Record->type = StripTypedef(PointeeType); - Record->decl = PointeeType->getAs()->getDecl(); - Record->type_name = Record->decl->getIdentifier() ? Record->decl->getIdentifier()->getName().str() : ""; - } - } else if (PointeeType->isPointerType()) { - PointeeType = PointeeType->getPointeeType(); - if (PointeeType->isRecordType()) { - if (Gen->records.find(StripTypedef(PointeeType)) == Gen->records.end()) { - auto Record = &Gen->records[StripTypedef(PointeeType)]; - if (PointeeType->isUnionType()) { - Record->is_union = true; - } - - Record->type = StripTypedef(PointeeType); - Record->decl = PointeeType->getAs()->getDecl(); - Record->type_name = Record->decl->getIdentifier() ? Record->decl->getIdentifier()->getName().str() : ""; - } - } - } - } else if (ParmType->isRecordType()) { - if (Gen->records.find(StripTypedef(ParmType)) == Gen->records.end()) { - auto Record = &Gen->records[StripTypedef(ParmType)]; - if (ParmType->isUnionType()) { - Record->is_union = true; - } - Record->type = StripTypedef(ParmType); - Record->decl = ParmType->getAs()->getDecl(); - Record->type_name = Record->decl->getIdentifier() ? Record->decl->getIdentifier()->getName().str() : ""; - } - } -} - -static void ParseFunction(clang::ASTContext* AST, WrapperGenerator* Gen, clang::FunctionDecl* Decl) { - using namespace clang; - auto Type = Decl->getType().getTypePtr(); - auto FuncInfo = &Gen->funcs[Type]; - FuncInfo->type = Type; - FuncInfo->func_name = Decl->getNameAsString(); - FuncInfo->decl = Decl; - FuncInfo->callback_args.resize(Decl->getNumParams()); - if (Decl->getAttr()) { - FuncInfo->is_weak = true; - } - if (Decl->isVariadic()) { - FuncInfo->is_variadaic = true; - } - for (unsigned i = 0; i < Decl->getNumParams(); i++) { - auto ParmDecl = Decl->getParamDecl(i); - if (ParmDecl->getType()->isFunctionPointerType()) { - FuncInfo->callback_args[i] = ParmDecl->getType().getTypePtr(); - FuncInfo->has_callback_arg = true; - } else { - FuncInfo->callback_args[i] = nullptr; - } - ParseParameter(AST, Gen, ParmDecl->getType(), FuncInfo); - } -} - -class MyASTVisitor : public clang::RecursiveASTVisitor { -public: - MyASTVisitor(clang::ASTContext* ctx) : Ctx(ctx) {} - MyASTVisitor(clang::ASTContext* ctx, WrapperGenerator* gen) : Ctx(ctx), Gen(gen) {} - - bool VisitFunctionDecl(clang::FunctionDecl* Decl) { - ParseFunction(Ctx, Gen, Decl); - return true; - } -private: - clang::ASTContext* Ctx; - WrapperGenerator* Gen; -}; - -class MyASTConsumer : public clang::ASTConsumer { -public: - MyASTConsumer(clang::ASTContext* Context, const std::string& libname, const std::string& host_triple, const std::string& guest_triple) - : Visitor(Context, &Generator) { - Generator.Init(libname, host_triple, guest_triple); - } - void HandleTranslationUnit(clang::ASTContext &Ctx) override { - Visitor.TraverseDecl(Ctx.getTranslationUnitDecl()); - std::cout << "--------------- Libclangtooling parse complete -----------------\n"; - Generator.Prepare(&Ctx); - std::cout << "--------------- Generator prepare complete -----------------\n"; - std::ofstream FuncDeclFile("wrapped" + Generator.libname + "_private.h", std::ios::out); - FuncDeclFile << Generator.GenFuncDeclare(&Ctx); - FuncDeclFile.close(); - std::ofstream FuncDefineFile("wrapped" + Generator.libname + ".c", std::ios::out); - FuncDefineFile << "#include \n" - "#include \n" - "#include \n" - "#define _GNU_SOURCE /* See feature_test_macros(7) */\n" - "#include \n" - "\n" - "#include \"wrappedlibs.h\"\n" - "\n" - "#include \"debug.h\"\n" - "#include \"wrapper.h\"\n" - "#include \"bridge.h\"\n" - "#include \"x64emu.h\"\n" - "#include \"box64context.h\"\n" - "\n" - "const char* " + Generator.libname + "Name = \"" + Generator.libname + "\";\n" - "#define LIBNAME " + Generator.libname + "\n" - "\n" - "#define ADDED_FUNCTIONS() \\\n" - "\n" - "#include \"generated/wrapped" + Generator.libname + "types.h\"\n"; - FuncDefineFile << Generator.GenRecordDeclare(&Ctx); - FuncDefineFile << Generator.GenRecordConvert(&Ctx); - FuncDefineFile << Generator.GenCallbackWrap(&Ctx); - FuncDefineFile << Generator.GenFuncDefine(&Ctx); - FuncDefineFile.close(); - std::cout << "--------------- Generator gen complete -----------------\n"; - } -private: - MyASTVisitor Visitor; - WrapperGenerator Generator; -}; - -class MyGenAction : public clang::ASTFrontendAction { -public: - MyGenAction(const std::string& libname, const std::string& host_triple, const std::string& guest_triple) : - libname(libname), host_triple(host_triple), guest_triple(guest_triple) {} - std::unique_ptr CreateASTConsumer(clang::CompilerInstance& Compiler, clang::StringRef file) override { - (void)file; - return std::make_unique(&Compiler.getASTContext(), libname, host_triple, guest_triple); - } -private: - std::string libname; - std::string host_triple; - std::string guest_triple; -}; - -class MyFrontendActionFactory : public clang::tooling::FrontendActionFactory { -public: - MyFrontendActionFactory(const std::string& libname, const std::string& host_triple, const std::string& guest_triple) : - libname(libname), host_triple(host_triple), guest_triple(guest_triple) {} -private: - std::unique_ptr create() override { - return std::make_unique(libname, host_triple, guest_triple); - } -private: - std::string libname; - std::string host_triple; - std::string guest_triple; -}; diff --git a/wrapperhelper/example-libc.h b/wrapperhelper/example-libc.h new file mode 100644 index 0000000..b1ac07b --- /dev/null +++ b/wrapperhelper/example-libc.h @@ -0,0 +1,130 @@ +#define _GNU_SOURCE 1 +#define __USE_MISC 1 +#define PORTMAP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/wrapperhelper/gen.cpp b/wrapperhelper/gen.cpp deleted file mode 100644 index 743474c..0000000 --- a/wrapperhelper/gen.cpp +++ /dev/null @@ -1,1059 +0,0 @@ -#include "gen.h" -#include "utils.h" -#include -#include -#include -#include - -using namespace clang; -using namespace clang::tooling; - -static std::vector GetRecordFieldOff(const std::string& Code, const std::string& Triple) { - std::vector FieldOff; - std::vector Args = {"-target", Triple}; - std::unique_ptr AST = clang::tooling::buildASTFromCodeWithArgs(Code, Args); - auto& Ctx = AST->getASTContext(); - auto TranslateDecl = Ctx.getTranslationUnitDecl(); - for (const auto& Decl : TranslateDecl->decls()) { - if (const auto RecordDecl = clang::dyn_cast(Decl)) { - auto& RecordLayout = Ctx.getASTRecordLayout(RecordDecl); - for (unsigned i = 0; i < RecordLayout.getFieldCount(); i++) { - FieldOff.push_back(RecordLayout.getFieldOffset(i) / 8); - } - break; - } - } - return FieldOff; -} - -static uint64_t GetRecordSize(const std::string& Code, const std::string& Triple) { - std::vector Args = {"-target", Triple}; - std::unique_ptr AST = buildASTFromCodeWithArgs(Code, Args); - auto& Ctx = AST->getASTContext(); - auto TranslateDecl = Ctx.getTranslationUnitDecl(); - for (const auto& Decl : TranslateDecl->decls()) { - if (const auto recordDecl = dyn_cast(Decl)) { - return Ctx.getTypeSize(recordDecl->getTypeForDecl()) / 8; - } - } - return 0; -} - -static CharUnits::QuantityType GetRecordAlign(const std::string& Code, const std::string& Triple) { - std::vector Args = {"-target", Triple}; - std::unique_ptr AST = buildASTFromCodeWithArgs(Code, Args); - auto& Ctx = AST->getASTContext(); - auto TranslateDecl = Ctx.getTranslationUnitDecl(); - for (const auto& Decl : TranslateDecl->decls()) { - if (const auto recordDecl = dyn_cast(Decl)) { - auto& RecordLayout = Ctx.getASTRecordLayout(recordDecl); - for (unsigned i = 0; i < RecordLayout.getFieldCount(); i++) { - return RecordLayout.getAlignment().getQuantity() / 8; - } - break; - } - } - return 0; -} - -static uint64_t GetTypeSize(const Type* Type, const std::string& Triple) { - std::string Code = Type->getCanonicalTypeInternal().getAsString() + " dummy;"; - std::vector Args = {"-target", Triple}; - std::unique_ptr AST = buildASTFromCodeWithArgs(Code, Args); - auto& Ctx = AST->getASTContext(); - auto TranslateDecl = Ctx.getTranslationUnitDecl(); - for (const auto& Decl : TranslateDecl->decls()) { - if (const auto varDecl = dyn_cast(Decl)) { - return Ctx.getTypeSize(varDecl->getType()) / 8; - } - } - return 0; -} - -static std::string TypeToSig(ASTContext* Ctx, const Type* Type) { - if (Type->isBuiltinType()) { - switch (Type->getAs()->getKind()) { - case clang::BuiltinType::Kind::Void: - return "v"; - case clang::BuiltinType::Kind::Bool: - return "i"; - case clang::BuiltinType::Kind::Char_U: - return "C"; - case clang::BuiltinType::Kind::Char_S: - return "c"; - case clang::BuiltinType::Kind::Char8: - return "c"; - case clang::BuiltinType::Kind::UChar: - return "C"; - case clang::BuiltinType::Kind::SChar: - return "c"; - case clang::BuiltinType::Kind::WChar_U: - return "W"; - case clang::BuiltinType::Kind::UShort: - return "W"; - case clang::BuiltinType::Kind::WChar_S: - return "w"; - case clang::BuiltinType::Kind::Char16: - return "w"; - case clang::BuiltinType::Kind::Short: - return "w"; - case clang::BuiltinType::Kind::UInt: - return "u"; - case clang::BuiltinType::Kind::Char32: - return "i"; - case clang::BuiltinType::Kind::Int: - return "i"; - case clang::BuiltinType::Kind::ULong: - return "L"; - case clang::BuiltinType::Kind::Long: - return "l"; - case clang::BuiltinType::Kind::ULongLong: - return "U"; - case clang::BuiltinType::Kind::LongLong: - return "I"; - case clang::BuiltinType::Kind::UInt128: - return "H"; - case clang::BuiltinType::Kind::Int128: - return "H"; - case clang::BuiltinType::Kind::Float: - return "f"; - case clang::BuiltinType::Kind::Double: - return "d"; - case clang::BuiltinType::Kind::LongDouble: - return "D"; - case clang::BuiltinType::Kind::NullPtr: - return "p"; // nullptr_t - default: - std::cout << "Unsupported BuiltinType: " << Type->getCanonicalTypeInternal().getAsString() << std::endl; - } - } else { - if (Type->isPointerType()) { - return "p"; - } else if (Type->isVoidType()) { - return "v"; - } else if (Type->isUnsignedIntegerOrEnumerationType()) { - switch(Ctx->getTypeSizeInChars(Type).getQuantity()) { - case 1: - return "C"; - case 2: - return "W"; - case 4: - return "u"; - case 8: - return "U"; - default: - std::cout << "Unsupported UnsignedInteger Type: " << Type->getCanonicalTypeInternal().getAsString() << std::endl; - } - } else if (Type->isSignedIntegerOrEnumerationType()) { - switch(Ctx->getTypeSizeInChars(Type).getQuantity()) { - case 1: - return "c"; - case 2: - return "w"; - case 4: - return "i"; - case 8: - return "I"; - default: - std::cout << "Unsupported SignedInteger Type: " << Type->getCanonicalTypeInternal().getAsString() << std::endl; - } - } else if (Type->isCharType()) { - return "c"; - } else if (Type->isFloatingType()) { - switch(Ctx->getTypeSizeInChars(Type).getQuantity()) { - case 4: - return "f"; - case 8: - return "d"; - case 16: - return "D"; - default: - std::cout << "Unsupported Floating Type: " << Type->getCanonicalTypeInternal().getAsString() - << " (quantity = " << Ctx->getTypeSizeInChars(Type).getQuantity() << ")" << std::endl; - } - } else { - std::cout << "Unsupported Type: " << Type->getCanonicalTypeInternal().getAsString() << std::endl; - } - } - return "?"; -} - -// Prepare for generation, collect the structures and functions that need to be prcessed -void WrapperGenerator::Prepare(ASTContext *Ctx) { - for (const auto &func_pair : funcs) { - for (auto Type : func_pair.second.callback_args) { - if (Type && Type->isTypedefNameType()) { - callbacks[StripTypedef(Type->getPointeeType())] = - Type->getAs()->getDecl()->getNameAsString(); - } else if (Type) { - callbacks[StripTypedef(Type->getPointeeType())] = - GetFuncSig(Ctx, Type->getPointeeType().getTypePtr()) + "_t"; - } - } - } - std::vector Types; - for (const auto &record_pair : records) { - Types.push_back(record_pair.first); - } - for (auto type : Types) { - std::set Visited{type}; - bool Special = false; - ParseRecordRecursive(Ctx, type, Special, Visited); - } - for (auto it = records.begin(); it != records.end();) { - if (!it->second.is_special) { - it = records.erase(it); - } else { - for (auto field : it->second.callback_fields) { - if (field->isTypedefNameType()) { - callbacks[StripTypedef(field->getPointeeType())] = - field->getAs()->getDecl()->getNameAsString(); - } else { - callbacks[StripTypedef(field->getPointeeType())] = - GetFuncSig(Ctx, field->getPointeeType().getTypePtr()) + "_t"; - } - } - ++it; - } - } - for (auto &func_pair : funcs) { - for (unsigned i = 0; i < func_pair.second.decl->getNumParams(); i++) { - auto ParamDecl = func_pair.second.decl->getParamDecl(i); - auto ParamType = ParamDecl->getType(); - if (ParamType->isPointerType() && - ParamType->getPointeeType()->isRecordType()) { - if (records.find(StripTypedef(ParamType->getPointeeType())) != - records.end()) { - func_pair.second.has_special_arg = true; - break; - } - } else if (ParamType->isRecordType()) { - if (records.find(StripTypedef(ParamType)) != records.end()) { - func_pair.second.has_special_arg = true; - break; - } - } - } - auto RetType = func_pair.second.decl->getReturnType(); - if (RetType->isPointerType() && RetType->getPointeeType()->isRecordType()) { - if (records.find(StripTypedef(RetType->getPointeeType())) != - records.end()) { - func_pair.second.has_special_ret = true; - } - } else if (RetType->isRecordType()) { - if (records.find(StripTypedef(RetType)) != records.end()) { - func_pair.second.has_special_ret = true; - } - } - } -} - -// Gen callback typedef -std::string WrapperGenerator::GenCallbackTypeDefs(ASTContext *Ctx) { - (void)Ctx; - std::string res; - for (auto callback : callbacks) { - auto Type = callback.first; - auto Definition = GetFuncDefinition(Type); - res += "typedef " + Definition.ret_str + "(*" + callback.second + ")("; - for (int i = 0; i < Definition.arg_size - 1; i++) { - res += Definition.arg_types_str[i] + Definition.arg_names[i] + ", "; - } - if (Definition.arg_size) { - res += Definition.arg_types_str[Definition.arg_size - 1] + Definition.arg_names[Definition.arg_size - 1]; - } - res += ");\n"; - } - return res; -} - -// Gen function declare -std::string WrapperGenerator::GenDeclare(ASTContext *Ctx, - const FuncInfo &Func) { - std::string res; - std::string sig = GetFuncSig(Ctx, Func); - res += "GO"; - if (Func.is_weak) { - res += "W"; - } - if (sig.find('E') != std::string::npos) { - res += "M"; - } - res += "(" + Func.func_name + ", " + sig + ")\n"; - ; - return res; -} - -// Gen structure declare -std::string WrapperGenerator::GenDeclare(ASTContext *Ctx, - const RecordInfo &Record) { - (void)Ctx; - std::string RecordStr; - std::string PreDecl; - RecordStr += "\ntypedef "; - RecordStr += - (Record.is_union ? "union " : "struct ") + Record.type_name + " {\n"; - for (const auto &Field : Record.decl->fields()) { - auto Type = Field->getType(); - std::string Name = Field->getNameAsString(); - RecordStr += " "; - if (Type->isFunctionPointerType()) { - auto FuncType = StripTypedef(Type->getPointeeType()); - if (callbacks.count(FuncType)) { - std::string FieldStr = callbacks[FuncType]; - FieldStr += " "; - FieldStr += Name; - RecordStr += FieldStr; - } else { - std::cout << "Err: FuncPtr(" << Record.type_name << "." << Name << ") is not supported\n"; - } - } else if (Type->isPointerType()) { - auto PointeeType = Type->getPointeeType(); - if (PointeeType->isRecordType()) { - if (records.count(PointeeType.getTypePtr())) { - std::string FieldStr = records[PointeeType.getTypePtr()].type_name; - FieldStr += "_ptr "; - FieldStr += Name; - RecordStr += FieldStr; - } else { - RecordStr += "void *" + Name; - } - } else { - RecordStr += "void *" + Name; - } - } else if (Type->isRecordType()) { - if (records.count(Type.getTypePtr())) { - std::string FieldStr = records[Type.getTypePtr()].type_name; - FieldStr += " "; - FieldStr += Name; - RecordStr += FieldStr; - } else { - RecordStr += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl); - } - } else { - RecordStr += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl); - } - RecordStr += ";\n"; - } - RecordStr += "} "; - RecordStr += Record.type_name + ", *" + Record.type_name + "_ptr;\n"; - return RecordStr; -} - -std::string WrapperGenerator::GenCallbackWrap(ASTContext *Ctx, - const FuncInfo &Func) { - (void)Ctx; - std::string res; - - for (unsigned i = 0; i < Func.decl->getNumParams(); i++) { - auto ParamType = Func.decl->getParamDecl(i)->getType(); - if (ParamType->isFunctionPointerType()) { - - auto PointeeType = ParamType->getPointeeType(); - auto Definition = GetFuncDefinition(PointeeType.getTypePtr()); - std::string my_funcname = - std::string("my_") + Func.decl->getParamDecl(i)->getNameAsString(); - std::string funcname = Func.decl->getParamDecl(i)->getNameAsString(); - res += "\n#define GO(A) \\\n" - "static uintptr_t " + my_funcname + "_fct_##A = 0; \\\n" + - Definition.ret_str + " " + my_funcname + "("; - int arg_size = Definition.arg_names.size(); - if (arg_size) { - for (int i = 0; i < arg_size - 1; i++) { - res += Definition.arg_types_str[i] + " " + Definition.arg_names[i] + ", "; - } - res += Definition.arg_types_str[arg_size - 1] + " " + Definition.arg_names[arg_size - 1]; - } - res += ") { \\\n" - " return RunFunction(my_context, " + my_funcname + "_fct_##A" + ", " + std::to_string(arg_size); - for (int i = 0; i < arg_size; i++) { - res += ", " + Definition.arg_names[i]; - } - res += "); \\\n" - "}\n" - "SUPER()\n" - "#undef GO\n" - "static void* find" + funcname + "Fct(void* fct) {\n" - " if (!fct) return fct;\n" - " if (GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);\n" - " #define GO(A) if (" + my_funcname + "_fct_##A == (uintptr_t)fct) return " + my_funcname + "_##A;\n" - " SUPER()\n" - " #undef GO\n" - " #define GO(A) if (" + my_funcname + "_fct_##A == 0) { " + my_funcname + "_fct_##A = (uintptr_t)fct; return " + my_funcname + "_##A; }\n" - " SUPER()\n" - " #undef GO\n" - " return NULL;\n" - "}\n"; - } - } - return res; -} - -std::string WrapperGenerator::GenCallbackWrap(ASTContext *Ctx, - const RecordInfo &Struct) { - (void)Ctx; - std::string res; - for (const auto &field : Struct.decl->fields()) { - auto FieldType = field->getType(); - if (FieldType->isFunctionPointerType()) { - auto PointeeType = FieldType->getPointeeType(); - auto Definition = GetFuncDefinition(PointeeType.getTypePtr()); - std::string my_funcname = std::string("my_") + field->getNameAsString(); - std::string funcname = field->getNameAsString(); - res += "\n#define GO(A) \\\n" - "static uintptr_t " + my_funcname + "_fct_##A = 0; \\\n" + - Definition.ret_str + " " + my_funcname + "_##A("; - int arg_size = Definition.arg_names.size(); - if (arg_size) { - for (int i = 0; i < arg_size - 1; i++) { - res += Definition.arg_types_str[i] + " " + Definition.arg_names[i] + ", "; - } - res += Definition.arg_types_str[arg_size - 1] + " " + Definition.arg_names[arg_size - 1]; - } - res += ") { \\\n" - " return RunFunction(my_context, " + my_funcname + "_fct_##A" + ", " + std::to_string(arg_size); - for (int i = 0; i < arg_size; i++) { - res += ", " + Definition.arg_names[i]; - } - res += "); \\\n" - "}\n" - "SUPER()\n" - "#undef GO\n" - "static void* find" + funcname + "Fct(void* fct) {\n" - " if(!fct) return fct;\n" - " if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);\n" - " #define GO(A) if(" + my_funcname + "_fct_##A == (uintptr_t)fct) return " + my_funcname + "_##A;}\n" - " SUPER()\n" - " #undef GO\n" - " #define GO(A) if(" + my_funcname + "_fct_##A == 0) {" + my_funcname + "_fct_##A = (uintptr_t)fct;" + "return " + my_funcname + "_##A;}\n" - " SUPER()\n" - " #undef GO\n" - " return NULL;\n" - "}\n"; - } - } - return res; -} - -std::string WrapperGenerator::GenDefine(ASTContext *Ctx, - const FuncInfo &Func) { - std::string res; - auto Definition = GetFuncDefinition(Func.decl); - std::string Sig = GetFuncSig(Ctx, Func.type); - res += "\nEXPORT " + Definition.ret_str + "my_" + Func.func_name + "("; - if (Sig.find('E')) { - res += "void *emu, "; - } - int arg_size = Definition.arg_names.size(); - if (arg_size) { - for (int i = 0; i < arg_size - 1; i++) { - if (Definition.arg_types[i]->isPointerType()) { - auto PointeeType = Definition.arg_types[i]->getPointeeType(); - if (records.count(PointeeType.getTypePtr())) { - res += - Definition.arg_types[i]->getCanonicalTypeInternal().getAsString(); - } else { - res += Definition.arg_types_str[i]; - } - } else { - res += Definition.arg_types_str[i]; - } - res += " " + Definition.arg_names[i] + ", "; - } - if (Definition.arg_types[arg_size - 1]->isPointerType()) { - auto PointeeType = Definition.arg_types[arg_size - 1]->getPointeeType(); - if (records.count(PointeeType.getTypePtr())) { - res += Definition.arg_types[arg_size - 1] - ->getCanonicalTypeInternal() - .getAsString(); - } else { - res += Definition.arg_types_str[arg_size - 1]; - } - } else { - res += Definition.arg_types_str[arg_size - 1]; - } - res += " "; - res += Definition.arg_names[arg_size - 1]; - } - res += ") {\n"; - if (Func.has_special_arg) { - res += " // WARN: This function's arg has a structure ptr which is " - "special, may need to wrap it for the host\n"; - - } else if (Func.has_special_ret) { - res += " // WARN: This function's ret is a structure ptr which is " - "special, may need to wrap it for the guest\n"; - } - if (Func.has_callback_arg) { - res += " " + my_lib_type + " *my = " + "(" + my_lib_type + "*)" + - my_lib + "->priv.w.p2;\n" - " my->" + Func.func_name + "("; - if (arg_size) { - for (int i = 0; i < arg_size - 1; i++) { - if (Func.callback_args[i]) { - if (!Func.callback_args[i]->isTypedefNameType()) { - res += - "find" + Func.func_name + "_arg" + std::to_string(i) + "Fct"; - } else { - res += "find" + - Func.callback_args[i] - ->getAs() - ->getDecl() - ->getNameAsString() + - "Fct"; - } - res += "(" + Definition.arg_names[i] + ")"; - } else { - res += Definition.arg_names[i]; - } - res += ", "; - } - if (Func.callback_args[arg_size - 1]) { - if (!Func.callback_args[arg_size - 1]->isTypedefNameType()) { - res += "find" + Func.func_name + "_arg" + - std::to_string(arg_size - 1) + "Fct"; - } else { - res += "find" + - Func.callback_args[arg_size - 1] - ->getAs() - ->getDecl() - ->getNameAsString() + - "Fct"; - } - res += "(" + Definition.arg_names[arg_size - 1] + ")"; - } else { - res += Definition.arg_names[arg_size - 1]; - } - res += ")\n"; - } - } else { - res += " " + my_lib_type + " *my = (" + my_lib_type + "*)" + my_lib + "->priv.w.p2;\n" - " my->" + Func.func_name + "("; - if (arg_size) { - for (int i = 0; i < arg_size - 1; i++) { - res += Definition.arg_names[i] + ", "; - } - res += Definition.arg_names[arg_size - 1]; - } - res += ");\n"; - } - - res += "}\n"; - return res; -} - -std::string WrapperGenerator::GenDeclareDiffTriple( - ASTContext *Ctx, const RecordInfo &Record, - const std::string &GuestTriple, const std::string &HostTriple) { - (void)Ctx; - std::string GuestRecord; - std::string HostRecord; - std::string PreDecl; - std::vector GuestFieldOff; - std::vector HostFieldOff; - GuestRecord += "typedef "; - HostRecord += "typedef "; - GuestRecord += - (Record.is_union ? "union " : "struct ") + Record.type_name + " {\n"; - HostRecord += (Record.is_union ? "union " : "struct ") + - std::string("host_") + Record.type_name + " {\n"; - auto OffDiff = GetRecordFieldOffDiff(Record.type, GuestTriple, HostTriple, - GuestFieldOff, HostFieldOff); - uint64_t GuestRecordSize = GetRecordSize(Record.type, GuestTriple); - uint64_t HostRecordSize = GetRecordSize(Record.type, HostTriple); - uint64_t SizeDiff = GuestRecordSize - HostRecordSize; - int FieldIndex = 0; - std::set AlignDiffFields; - for (const auto &Field : Record.decl->fields()) { - if (OffDiff[FieldIndex] == 0) { - FieldIndex++; - continue; - } - std::string Name = Field->getNameAsString(); - if (OffDiff[FieldIndex] != SizeDiff) { - auto Diff = OffDiff[FieldIndex]; - AlignDiffFields.insert(Field); - for (size_t i = FieldIndex; i < OffDiff.size(); i++) { - if (OffDiff[i] == Diff) { - OffDiff[i] = 0; - } else { - break; - } - } - } else { - AlignDiffFields.insert(Field); - break; - } - FieldIndex++; - } - for (const auto &Field : Record.decl->fields()) { - auto Type = Field->getType(); - std::string Name = Field->getNameAsString(); - GuestRecord += " "; - HostRecord += " "; - if (AlignDiffFields.find(Field) != AlignDiffFields.end()) { - auto typeSize = GetTypeSize(StripTypedef(Field->getType()), guest_triple); - switch (typeSize) { - // FIXME: should test more case in different triple - case 4: GuestRecord += "int " + Name ; break; - case 8: GuestRecord += "int " + Name + "[2]"; break; - default: - std::cout << "Err: unknown type size " << typeSize << std::endl; - break; - } - HostRecord += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl); - } else if (Type->isFunctionPointerType()) { - auto FuncType = StripTypedef(Type->getPointeeType()); - if (callbacks.count(FuncType)) { - std::string FieldStr = callbacks[FuncType]; - FieldStr += " "; - FieldStr += Name; - GuestRecord += FieldStr; - HostRecord += FieldStr; - } else { - std::cout << "Err: FuncPtr(" << Record.type_name << "." << Name << ") is not supported" << std::endl; - } - } else if (Type->isPointerType()) { - auto PointeeType = Type->getPointeeType(); - if (PointeeType->isRecordType()) { - if (records.count(PointeeType.getTypePtr())) { - std::string FieldStr = records[PointeeType.getTypePtr()].type_name; - FieldStr += "_ptr " + Name; - GuestRecord += FieldStr; - HostRecord += "host_" + FieldStr; - } else { - GuestRecord += "void *" + Name; - HostRecord += "void *" + Name; - } - } else { - GuestRecord += "void *" + Name; - HostRecord += "void *" + Name; - } - } else if (Type->isRecordType()) { - if (records.count(Type.getTypePtr())) { - std::string FieldStr = records[Type.getTypePtr()].type_name; - FieldStr += " " + Name; - GuestRecord += FieldStr; - HostRecord += "host_" + FieldStr; - } else { - GuestRecord += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl); - HostRecord += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl); - } - } else { - HostRecord += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl); - GuestRecord += TypeStringify(StripTypedef(Type), Field, nullptr, PreDecl); - } - GuestRecord += ";\n"; - HostRecord += ";\n"; - } - GuestRecord += "} " + Record.type_name + ", *" + Record.type_name + "_ptr;\n"; - HostRecord += "} host_" + Record.type_name + ", *host_" + Record.type_name + "_ptr;\n"; - return GuestRecord + HostRecord; -} - -// Gen record convert function between host and guest -std::string WrapperGenerator::GenRecordConvert(const RecordInfo &Record) { - std::string res; - if (Record.guest_size != Record.host_size) { - auto RecordDecl = Record.decl; - std::vector GuestFieldOff; - std::vector HostFieldOff; - auto OffDiff = GetRecordFieldOffDiff(Record.type, guest_triple, host_triple, - GuestFieldOff, HostFieldOff); - int FieldIndex = 0; - std::vector AlignDiffFields; - uint64_t SizeDiff = Record.guest_size - Record.host_size; - for (const auto &Field : RecordDecl->fields()) { - if (OffDiff[FieldIndex] == 0) { - FieldIndex++; - continue; - } - if (OffDiff[FieldIndex] != SizeDiff) { - auto Diff = OffDiff[FieldIndex]; - AlignDiffFields.push_back(Field); - for (size_t i = FieldIndex; i < OffDiff.size(); i++) { - if (OffDiff[i] == Diff) { - OffDiff[i] = 0; - } else { - break; - } - } - } else { - AlignDiffFields.push_back(Field); - break; - } - FieldIndex++; - } - if (!AlignDiffFields.size()) { - return res; - } - res += "void g2h_" + Record.type_name + "(" + "struct host_" + Record.type_name + " *d, struct " + Record.type_name + " *s) {\n"; - std::string body = " memcpy(d, s, offsetof(struct " + Record.type_name + - ", " + AlignDiffFields[0]->getNameAsString() + "));\n"; - std::string offstr = "offsetof(struct " + Record.type_name + ", " + - AlignDiffFields[0]->getNameAsString() + ")"; - for (size_t i = 0; i < AlignDiffFields.size() - 1; i++) { - body += " memcpy(d->" + AlignDiffFields[i]->getNameAsString() + ", " + - "s->" + AlignDiffFields[i]->getNameAsString() + ", " + - "offsetof(struct " + Record.type_name + ", " + - AlignDiffFields[i + 1]->getNameAsString() + ") - " + offstr + - ");\n"; - offstr = "offsetof(struct " + Record.type_name + ", " + - AlignDiffFields[i + 1]->getNameAsString() + ")"; - } - body += " memcpy(d->" + - AlignDiffFields[AlignDiffFields.size() - 1]->getNameAsString() + - ", " + "s->" + - AlignDiffFields[AlignDiffFields.size() - 1]->getNameAsString() + - ", " + std::to_string(GetRecordSize(Record.type, guest_triple)) + - " - " + offstr + ");\n"; - res += body + "}\n"; - - res += "void h2g_" + Record.type_name + "(struct " + Record.type_name + " *d, " + "struct host_" + Record.type_name + " *s) {\n"; - res += body; - res += "}\n"; - } - return res; -} - -void WrapperGenerator::ParseRecordRecursive( - ASTContext *Ctx, const Type *type, bool &Special, - std::set &Visited) { - auto recordType = type->getAs(); - auto RecordDecl = recordType->getDecl(); - for (const auto &field : RecordDecl->fields()) { - auto FieldType = field->getType(); - if (FieldType->isFunctionPointerType()) { - auto Record = &records[type]; - Record->callback_fields.push_back(field->getType().getTypePtr()); - // Record->type_name = - Special = true; - } else if (FieldType->isPointerType() && - FieldType->getPointeeType()->isRecordType()) { - auto FieldRecordType = StripTypedef(FieldType->getPointeeType()); - if (Visited.find(FieldRecordType) != Visited.end()) - continue; - Visited.insert(FieldRecordType); - bool _Special = false; - ParseRecordRecursive(Ctx, FieldRecordType, _Special, Visited); - if (_Special) - Special = true; - } else if (FieldType->isRecordType()) { - auto FieldRecordType = StripTypedef(FieldType); - if (Visited.find(FieldRecordType) != Visited.end()) - continue; - Visited.insert(FieldRecordType); - bool _Special = false; - ParseRecordRecursive(Ctx, FieldRecordType, _Special, Visited); - if (_Special) - Special = true; - } - } - uint64_t GuestSize = GetRecordSize(type, guest_triple); - uint64_t HostSize = GetRecordSize(type, host_triple); - - auto Record = &records[type]; - if (GuestSize != HostSize) { - Special = 1; - } - if (type->isUnionType()) { - Record->is_union = true; - } - if (!Record->decl) { - Record->type = type; - Record->decl = RecordDecl; - if (RecordDecl->getIdentifier()) - Record->type_name = RecordDecl->getIdentifier()->getName().str(); - } - Record->guest_size = GuestSize; - Record->host_size = HostSize; - if (Record->type_name.empty()) { - Record->is_special = false; - } else - Record->is_special = Special; -} - -// Type to String -std::string WrapperGenerator::TypeStringify(const Type *Type, - FieldDecl *FieldDecl, - ParmVarDecl *ParmDecl, - std::string& PreDecl, - std::string indent, - std::string Name) { - std::string res; - std::string name = FieldDecl - ? FieldDecl->getNameAsString() - : (ParmDecl ? ParmDecl->getNameAsString() : Name); - if (Type->isPointerType()) { - auto PointeeType = Type->getPointeeType(); - if (PointeeType->isBuiltinType()) { - res += - StripTypedef(PointeeType)->getCanonicalTypeInternal().getAsString(); - } else if (PointeeType->isRecordType()) { - if (records.find(StripTypedef(PointeeType)) != records.end() && - records[StripTypedef(PointeeType)].is_special) { - res += (PointeeType->isUnionType() ? "union " : "struct ") + records[StripTypedef(PointeeType)].type_name; - } else { - res += "void"; - } - } else { - res += "void"; - } - res += " *" + name; - } else if (Type->isEnumeralType()) { - res += "int " + name; - } else if (Type->isRecordType()) { - if (records.find(StripTypedef(Type->getCanonicalTypeInternal())) != - records.end() && - records[StripTypedef(Type->getCanonicalTypeInternal())].is_special) { - res += Type->isUnionType() ? "union " : "struct "; - res += records[StripTypedef(Type->getCanonicalTypeInternal())].type_name; - res += " "; - } else { - res += AnonRecordDecl(Type->getAs(), PreDecl, indent + " "); - } - res += name; - } else if (Type->isConstantArrayType()) { - auto ArrayType = - dyn_cast(Type->getAsArrayTypeUnsafe()); - int EleSize = ArrayType->getSize().getZExtValue(); - if (ArrayType->getElementType()->isPointerType()) { - res += "void *"; - } else if (ArrayType->getElementType()->isEnumeralType()) { - res += "int "; - } else if (ArrayType->getElementType()->isRecordType()) { - auto RecordType = ArrayType->getElementType()->getAs(); - auto RecordDecl = RecordType->getDecl(); - if (RecordDecl->isCompleteDefinition()) { - auto& Ctx = RecordDecl->getDeclContext()->getParentASTContext(); - PreDecl += "#include \""; - PreDecl += GetDeclHeaderFile(Ctx, RecordDecl); - PreDecl += "\""; - PreDecl += "\n"; - } - res += StripTypedef(ArrayType->getElementType()) - ->getCanonicalTypeInternal() - .getAsString(); - } else { - res += StripTypedef(ArrayType->getElementType()) - ->getCanonicalTypeInternal() - .getAsString(); - } - res += " "; - res += name; - res += "["; - res += std::to_string(EleSize); - res += "]"; - } else { - res += StripTypedef(Type->getCanonicalTypeInternal()) - ->getCanonicalTypeInternal() - .getAsString(); - res += " "; - res += name; - } - return indent + res; -} - -// Type to String, less detail -std::string WrapperGenerator::SimpleTypeStringify(const Type *Type, - FieldDecl *FieldDecl, - ParmVarDecl *ParmDecl, - std::string indent, - std::string Name) { - std::string res; - std::string name = FieldDecl - ? FieldDecl->getNameAsString() - : (ParmDecl ? ParmDecl->getNameAsString() : Name); - if (Type->isPointerType()) { - res += "void *" + name; - } else if (Type->isEnumeralType()) { - res += "int "; - res += name; - } else if (Type->isRecordType()) { - if (records.find(StripTypedef(Type->getCanonicalTypeInternal())) != - records.end()) { - res += Type->isUnionType() ? "union " : "struct "; - res += records[StripTypedef(Type->getCanonicalTypeInternal())].type_name; - res += " "; - } else { - res += SimpleAnonRecordDecl(Type->getAs(), indent); - } - res += name; - } else if (Type->isConstantArrayType()) { - auto ArrayType = - dyn_cast(Type->getAsArrayTypeUnsafe()); - int EleSize = ArrayType->getSize().getZExtValue(); - if (ArrayType->getElementType()->isPointerType()) { - res += "void *"; - } else { - res += StripTypedef(ArrayType->getElementType()) - ->getCanonicalTypeInternal() - .getAsString(); - } - res += " "; - res += name; - res += "["; - res += std::to_string(EleSize); - res += "]"; - } else { - res += StripTypedef(Type->getCanonicalTypeInternal()) - ->getCanonicalTypeInternal() - .getAsString(); - res += " "; - res += name; - } - return indent + res; -} - -std::string WrapperGenerator::AnonRecordDecl(const RecordType *Type, std::string& PreDecl, std::string indent) { - auto RecordDecl = Type->getDecl(); - std::string res; - res += Type->isUnionType() ? "union {\n" : "struct {\n"; - for (const auto &field : RecordDecl->fields()) { - auto FieldType = field->getType(); - res += TypeStringify(StripTypedef(FieldType), field, nullptr, PreDecl, indent + " "); - res += ";\n"; - } - res += indent + "} "; - return res; -} - -std::string -WrapperGenerator::SimpleAnonRecordDecl(const RecordType *Type, std::string indent) { - auto RecordDecl = Type->getDecl(); - std::string res; - res += Type->isUnionType() ? "union {\n" : "struct {\n"; - for (const auto &field : RecordDecl->fields()) { - auto FieldType = field->getType(); - res += SimpleTypeStringify(StripTypedef(FieldType), field, nullptr, indent + " "); - res += ";\n"; - } - res += indent + "} "; - return res; -} - -// Get func info from FunctionType -FuncDefinition WrapperGenerator::GetFuncDefinition(const Type *Type) { - FuncDefinition res; - std::string PreDecl; - auto ProtoType = Type->getAs(); - res.ret = StripTypedef(ProtoType->getReturnType()); - res.ret_str = - TypeStringify(StripTypedef(ProtoType->getReturnType()), nullptr, nullptr, PreDecl); - for (unsigned i = 0; i < ProtoType->getNumParams(); i++) { - auto ParamType = ProtoType->getParamType(i); - res.arg_types.push_back(StripTypedef(ParamType)); - res.arg_types_str.push_back( - TypeStringify(StripTypedef(ParamType), nullptr, nullptr, PreDecl)); - res.arg_names.push_back(std::string("a") + std::to_string(i)); - } - if (ProtoType->isVariadic()) { - res.is_variadaic = true; - } - res.arg_size = ProtoType->getNumParams(); - return res; -} - -// Get funcdecl info from FunctionDecl -FuncDefinition WrapperGenerator::GetFuncDefinition(FunctionDecl *Decl) { - FuncDefinition res; - std::string PreDecl; - auto RetType = Decl->getReturnType(); - res.ret = RetType.getTypePtr(); - res.ret_str = TypeStringify(StripTypedef(RetType), nullptr, nullptr, PreDecl); - for (unsigned i = 0; i < Decl->getNumParams(); i++) { - auto ParamDecl = Decl->getParamDecl(i); - auto ParamType = ParamDecl->getType(); - res.arg_types.push_back(ParamType.getTypePtr()); - res.arg_types_str.push_back( - TypeStringify(StripTypedef(ParamType), nullptr, nullptr, PreDecl)); - res.arg_names.push_back(ParamDecl->getNameAsString()); - } - if (Decl->isVariadic()) { - res.is_variadaic = true; - } - return res; -} - -// Get the offset diff between two different triple -std::vector WrapperGenerator::GetRecordFieldOffDiff( - const Type *Type, const std::string &GuestTriple, - const std::string &HostTriple, std::vector &GuestFieldOff, - std::vector &HostFieldOff) { - std::string PreDecl; - std::string Code = TypeStringify(Type, nullptr, nullptr, PreDecl, "", "dummy;"); - std::vector OffsetDiff; - GuestFieldOff = GetRecordFieldOff(Code, GuestTriple); - HostFieldOff = GetRecordFieldOff(Code, HostTriple); - if (GuestFieldOff.size() != HostFieldOff.size()) { - // Should not happen - std::cout << "Greater field offsets in guest than in host" << std::endl; - return OffsetDiff; - } - for (size_t i = 0; i < GuestFieldOff.size(); i++) { - OffsetDiff.push_back(GuestFieldOff[i] - HostFieldOff[i]); - } - return OffsetDiff; -} - -// Get the size under a specific triple -uint64_t WrapperGenerator::GetRecordSize(const Type *Type, - const std::string &Triple) { - std::string PreDecl; - std::string Code = TypeStringify(Type, nullptr, nullptr, PreDecl, "", "dummy;"); - auto Size = ::GetRecordSize(PreDecl + Code, Triple); - return Size; -} - -// Get the align under a specific triple -CharUnits::QuantityType WrapperGenerator::GetRecordAlign(const Type *Type, - const std::string &Triple) { - std::string PreDecl{}; - std::string Code = TypeStringify(Type, nullptr, nullptr, PreDecl, "", "dummy;"); - return ::GetRecordAlign(PreDecl + Code, Triple); -} - -// Generate the func sig by type, used for export func -std::string WrapperGenerator::GetFuncSig(ASTContext *CTX, - const FuncInfo &Func) { - std::string sig; - auto Decl = Func.decl; - auto Type = Decl->getType().getTypePtr(); - auto ProtoType = Type->getAs(); - auto RetType = ProtoType->getReturnType(); - - sig += TypeToSig(CTX, RetType.getTypePtr()); - sig += "F"; - if (Func.has_special_arg || Func.has_special_ret || Func.has_callback_arg) { - sig += "E"; - } - if (ProtoType->getNumParams()) { - for (unsigned i = 0; i < ProtoType->getNumParams(); i++) { - sig += TypeToSig(CTX, ProtoType->getParamType(i).getTypePtr()); - } - } else { - sig += "v"; - } - if (Decl->isVariadic()) { - sig += "VV"; - } - return sig; -} - -// Generate the func sig by type, used for callbacks -std::string WrapperGenerator::GetFuncSig(ASTContext *CTX, - const Type *Type) { - std::string sig; - auto ProtoType = Type->getAs(); - auto RetType = ProtoType->getReturnType(); - sig += TypeToSig(CTX, RetType.getTypePtr()); - sig += "F"; - if (ProtoType->getNumParams()) { - for (unsigned i = 0; i < ProtoType->getNumParams(); i++) { - sig += TypeToSig(CTX, ProtoType->getParamType(i).getTypePtr()); - } - } else { - sig += "v"; - } - return sig; -} diff --git a/wrapperhelper/gen.h b/wrapperhelper/gen.h deleted file mode 100644 index 55ecd20..0000000 --- a/wrapperhelper/gen.h +++ /dev/null @@ -1,144 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include - -struct FuncDefinition { - std::vector arg_types; - std::vector arg_types_str; - std::vector arg_names; - const clang::Type* ret; - std::string ret_str; - int arg_size; - bool is_variadaic; -}; - -struct FuncInfo { - const clang::Type* type; - clang::FunctionDecl* decl; - std::string func_name; - bool is_weak; - bool is_variadaic; - bool has_special_arg; - bool has_special_ret; - bool has_callback_arg; - std::vector callback_args; -}; - -struct RecordInfo { - const clang::Type* type; - clang::RecordDecl* decl; - std::string type_name; - bool is_union; - bool is_special; - - uint64_t guest_size; - uint64_t host_size; - std::vector callback_fields; -}; - -struct ObjectInfo { - const clang::Type* type; - std::string object_name; -}; - -struct WrapperGenerator { - - void Init(const std::string& libname, const std::string& host_triple, const std::string& guest_triple) { - this->host_triple = host_triple; - this->guest_triple = guest_triple; - this->libname = libname; - this->my_lib_type = libname + "_my_t"; - this->my_lib = "my_lib"; - } - - void Prepare(clang::ASTContext* Ctx); - - std::string GenCallbackTypeDefs(clang::ASTContext* Ctx); - - std::string GenFuncDeclare(clang::ASTContext* Ctx) { - std::string res{}; - for (const auto& func : funcs) { - res += GenDeclare(Ctx, func.second); - } - return res; - } - std::string GenRecordDeclare(clang::ASTContext* Ctx) { - std::string res{}; - for (const auto& st : records) { - if (st.second.host_size == st.second.guest_size) - res += GenDeclare(Ctx, st.second); - else { - res += GenDeclareDiffTriple(Ctx, st.second, guest_triple, host_triple); - } - } - return res; - } - - std::string GenFuncDefine(clang::ASTContext* Ctx) { - std::string res{}; - for (const auto& func : funcs) { - res += GenDefine(Ctx, func.second); - } - return res; - } - - std::string GenCallbackWrap(clang::ASTContext* Ctx) { - std::string res{}; - for (const auto& func : funcs) { - res += GenCallbackWrap(Ctx, func.second); - } - for (const auto& st : records) { - res += GenCallbackWrap(Ctx, st.second); - } - return res; - } - - std::string GenRecordConvert(clang::ASTContext* Ctx) { - (void)Ctx; - std::string res; - for (const auto& record : records) { - if (record.second.host_size != record.second.guest_size) { - res += GenRecordConvert(record.second); - } - } - return res; - } - - std::map funcs; - std::map records; - std::map objects; - - std::map callbacks; - - std::string host_triple; - std::string guest_triple; - std::string libname; - std::string my_lib_type; - std::string my_lib; -private: - std::string GenRecordConvert(const RecordInfo& Record); - std::string GenDeclare(clang::ASTContext* Ctx, const FuncInfo& Func); - std::string GenDefine(clang::ASTContext* Ctx, const FuncInfo& Func); - std::string GenCallbackWrap(clang::ASTContext* Ctx, const FuncInfo& Func); - std::string GenDeclareDiffTriple(clang::ASTContext* Ctx, const RecordInfo& Record, const std::string& GuestTriple, const std::string& HostTriple); - std::string GenDeclare(clang::ASTContext* Ctx, const RecordInfo& Struct); - std::string GenCallbackWrap(clang::ASTContext* Ctx, const RecordInfo& Struct); - - void ParseRecordRecursive(clang::ASTContext* Ctx, const clang::Type* Type, bool& Special, std::set& Visited); - std::string TypeStringify(const clang::Type* Type, clang::FieldDecl* FieldDecl, clang::ParmVarDecl* ParmDecl, std::string& PreDecl, std::string indent = "", std::string Name = ""); - std::string SimpleTypeStringify(const clang::Type* Type, clang::FieldDecl* FieldDecl, clang::ParmVarDecl* ParmDecl, std::string indent = "", std::string Name = ""); - std::string AnonRecordDecl(const clang::RecordType* Type, std::string& PreDecl, std::string indent); - std::string SimpleAnonRecordDecl(const clang::RecordType* Type, std::string indent); - FuncDefinition GetFuncDefinition(const clang::Type* Type); - FuncDefinition GetFuncDefinition(clang::FunctionDecl* Decl); - uint64_t GetRecordSize(const clang::Type* Type, const std::string& Triple); - std::vector GetRecordFieldOffDiff(const clang::Type* Type, const std::string& GuestTriple, const std::string& HostTriple, std::vector& GuestFieldOff, std::vector& HostFieldOff); - clang::CharUnits::QuantityType GetRecordAlign(const clang::Type* Type, const std::string& Triple); - - std::string GetFuncSig(clang::ASTContext* CTX, const FuncInfo& Decl); - std::string GetFuncSig(clang::ASTContext* CTX, const clang::Type* Type); -}; diff --git a/wrapperhelper/include-override/aarch64/bits/pthreadtypes-arch.h b/wrapperhelper/include-override/aarch64/bits/pthreadtypes-arch.h new file mode 100644 index 0000000..5fe9577 --- /dev/null +++ b/wrapperhelper/include-override/aarch64/bits/pthreadtypes-arch.h @@ -0,0 +1,47 @@ +/* Copyright (C) 2002-2024 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_PTHREADTYPES_ARCH_H +#define _BITS_PTHREADTYPES_ARCH_H 1 + +#include + +#ifdef __ILP32__ +# define __SIZEOF_PTHREAD_ATTR_T 32 +# define __SIZEOF_PTHREAD_MUTEX_T 32 +# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +# define __SIZEOF_PTHREAD_CONDATTR_T 4 +# define __SIZEOF_PTHREAD_RWLOCK_T 48 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 +#else +# define __SIZEOF_PTHREAD_ATTR_T 64 +# define __SIZEOF_PTHREAD_MUTEX_T 48 +# define __SIZEOF_PTHREAD_MUTEXATTR_T 8 +# define __SIZEOF_PTHREAD_CONDATTR_T 8 +# define __SIZEOF_PTHREAD_RWLOCK_T 56 +# define __SIZEOF_PTHREAD_BARRIER_T 32 +# define __SIZEOF_PTHREAD_BARRIERATTR_T 8 +#endif +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 + +#define __LOCK_ALIGNMENT +#define __ONCE_ALIGNMENT + +#endif /* bits/pthreadtypes.h */ diff --git a/wrapperhelper/include-override/aarch64/stdc-predef.h b/wrapperhelper/include-override/aarch64/stdc-predef.h new file mode 100644 index 0000000..df1d78b --- /dev/null +++ b/wrapperhelper/include-override/aarch64/stdc-predef.h @@ -0,0 +1,425 @@ +// C standard +#define __STDC__ 1 +#define __STDC_HOSTED__ 1 +#define __STDC_UTF_16__ 1 +#define __STDC_UTF_32__ 1 +#define __STDC_VERSION__ 201710L +// Generic aarch64 infos +#define __ELF__ 1 +#define __NO_INLINE__ 1 +#define __ORDER_BIG_ENDIAN__ 4321 +#define __ORDER_LITTLE_ENDIAN__ 1234 +#define __ORDER_PDP_ENDIAN__ 3412 +#define __PIC__ 2 +#define __pic__ 2 +#define __PIE__ 2 +#define __pie__ 2 +#define __USER_LABEL_PREFIX__ +#define __gnu_linux__ 1 +#define __linux__ 1 +#define __linux 1 +#define linux 1 +#define __unix__ 1 +#define __unix 1 +#define unix 1 +// GCC +//#define __GCC_ASM_FLAG_OUTPUTS__ 1 +//#define __GCC_ATOMIC_BOOL_LOCK_FREE 2 +//#define __GCC_ATOMIC_CHAR_LOCK_FREE 2 +//#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2 +//#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2 +//#define __GCC_ATOMIC_INT_LOCK_FREE 2 +//#define __GCC_ATOMIC_LLONG_LOCK_FREE 2 +//#define __GCC_ATOMIC_LONG_LOCK_FREE 2 +//#define __GCC_ATOMIC_POINTER_LOCK_FREE 2 +//#define __GCC_ATOMIC_SHORT_LOCK_FREE 2 +//#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1 +//#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2 +//#define __GCC_CONSTRUCTIVE_SIZE 64 +//#define __GCC_DESTRUCTIVE_SIZE 256 +//#define __GCC_HAVE_DWARF2_CFI_ASM 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1 +//#define __GCC_IEC_559 2 +//#define __GCC_IEC_559_COMPLEX 2 +//#define __GNUC__ 14 +//#define __GNUC_EXECUTION_CHARSET_NAME "UTF-8" +//#define __GNUC_MINOR__ 2 +//#define __GNUC_PATCHLEVEL__ 0 +//#define __GNUC_STDC_INLINE__ 1 +//#define __GNUC_WIDE_EXECUTION_CHARSET_NAME "UTF-32LE" +//#define __GXX_ABI_VERSION 1019 +//#define __PRAGMA_REDEFINE_EXTNAME 1 +//#define __VERSION__ "14.2.0" +// Specific aarch64 architecture +#define __FINITE_MATH_ONLY__ 0 +#define __HAVE_SPECULATION_SAFE_VALUE 1 +#define __LP64__ 1 +#define _LP64 1 +#define __REGISTER_PREFIX__ +#define __AARCH64_CMODEL_SMALL__ 1 +#define __AARCH64EL__ 1 +#define __ARM_64BIT_STATE 1 +#define __ARM_ALIGN_MAX_PWR 28 +#define __ARM_ALIGN_MAX_STACK_PWR 16 +#define __ARM_ARCH 8 +#define __ARM_ARCH_8A 1 +#define __ARM_ARCH_ISA_A64 1 +#define __ARM_ARCH_PROFILE 65 +#define __ARM_FEATURE_CLZ 1 +#define __ARM_FEATURE_FMA 1 +#define __ARM_FEATURE_IDIV 1 +#define __ARM_FEATURE_NUMERIC_MAXMIN 1 +#define __ARM_FEATURE_UNALIGNED 1 +#define __ARM_FP 14 +#define __ARM_FP16_ARGS 1 +#define __ARM_FP16_FORMAT_IEEE 1 +#define __ARM_NEON 1 +#define __ARM_NEON_SVE_BRIDGE 1 +#define __ARM_PCS_AAPCS64 1 +#define __ARM_SIZEOF_MINIMAL_ENUM 4 +#define __ARM_SIZEOF_WCHAR_T 4 +#define __ARM_STATE_ZA 1 +#define __ARM_STATE_ZT0 1 +#define __arm_in(...) [[__extension__ arm::in(__VA_ARGS__)]] +#define __arm_inout(...) [[__extension__ arm::inout(__VA_ARGS__)]] +#define __arm_locally_streaming [[__extension__ arm::locally_streaming]] +#define __arm_new(...) [[__extension__ arm::new(__VA_ARGS__)]] +#define __arm_out(...) [[__extension__ arm::out(__VA_ARGS__)]] +#define __arm_preserves(...) [[__extension__ arm::preserves(__VA_ARGS__)]] +#define __arm_streaming_compatible [[__extension__ arm::streaming_compatible]] +#define __arm_streaming [[__extension__ arm::streaming]] +#define __aarch64__ 1 +// Atomic +#define __ATOMIC_RELAXED 0 +#define __ATOMIC_CONSUME 1 +#define __ATOMIC_ACQUIRE 2 +#define __ATOMIC_RELEASE 3 +#define __ATOMIC_ACQ_REL 4 +#define __ATOMIC_SEQ_CST 5 +// Metainfo on types +#define __BIGGEST_ALIGNMENT__ 16 +#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ +#define __CHAR_BIT__ 8 +#define __CHAR_UNSIGNED__ 1 +#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__ +#define __SIZEOF_SHORT__ 2 +#define __SIZEOF_WCHAR_T__ 4 +#define __SIZEOF_INT__ 4 +#define __SIZEOF_WINT_T__ 4 +#define __SIZEOF_LONG__ 8 +#define __SIZEOF_LONG_LONG__ 8 +#define __SIZEOF_POINTER__ 8 +#define __SIZEOF_PTRDIFF_T__ 8 +#define __SIZEOF_SIZE_T__ 8 +#define __SIZEOF_INT128__ 16 +#define __SIZEOF_FLOAT__ 4 +#define __SIZEOF_DOUBLE__ 8 +#define __SIZEOF_LONG_DOUBLE__ 16 +// Integers +//#define __BITINT_MAXWIDTH__ 65535 +//#define __CHAR16_TYPE__ short unsigned int +//#define __CHAR32_TYPE__ unsigned int +//#define __INT8_C(c) c +#define __INT8_MAX__ 0x7f +//#define __INT8_TYPE__ signed char +//#define __INT16_C(c) c +#define __INT16_MAX__ 0x7fff +//#define __INT16_TYPE__ short int +//#define __INT32_C(c) c +#define __INT32_MAX__ 0x7fffffff +//#define __INT32_TYPE__ int +//#define __INT64_C(c) c ## L +#define __INT64_MAX__ 0x7fffffffffffffffL +//#define __INT64_TYPE__ long int +#define __INT_FAST8_MAX__ 0x7f +//#define __INT_FAST8_TYPE__ signed char +#define __INT_FAST8_WIDTH__ 8 +#define __INT_FAST16_MAX__ 0x7fffffffffffffffL +//#define __INT_FAST16_TYPE__ long int +#define __INT_FAST16_WIDTH__ 64 +#define __INT_FAST32_MAX__ 0x7fffffffffffffffL +//#define __INT_FAST32_TYPE__ long int +#define __INT_FAST32_WIDTH__ 64 +#define __INT_FAST64_MAX__ 0x7fffffffffffffffL +//#define __INT_FAST64_TYPE__ long int +#define __INT_FAST64_WIDTH__ 64 +#define __INT_LEAST8_MAX__ 0x7f +//#define __INT_LEAST8_TYPE__ signed char +#define __INT_LEAST8_WIDTH__ 8 +#define __INT_LEAST16_MAX__ 0x7fff +//#define __INT_LEAST16_TYPE__ short int +#define __INT_LEAST16_WIDTH__ 16 +#define __INT_LEAST32_MAX__ 0x7fffffff +//#define __INT_LEAST32_TYPE__ int +#define __INT_LEAST32_WIDTH__ 32 +#define __INT_LEAST64_MAX__ 0x7fffffffffffffffL +//#define __INT_LEAST64_TYPE__ long int +#define __INT_LEAST64_WIDTH__ 64 +#define __INT_MAX__ 0x7fffffff +#define __INT_WIDTH__ 32 +#define __INTMAX_C(c) c ## L +#define __INTMAX_MAX__ 0x7fffffffffffffffL +//#define __INTMAX_TYPE__ long int +#define __INTMAX_WIDTH__ 64 +#define __INTPTR_MAX__ 0x7fffffffffffffffL +//#define __INTPTR_TYPE__ long int +#define __INTPTR_WIDTH__ 64 +#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL +#define __LONG_LONG_WIDTH__ 64 +#define __LONG_MAX__ 0x7fffffffffffffffL +#define __LONG_WIDTH__ 64 +#define __PTRDIFF_MAX__ 0x7fffffffffffffffL +//#define __PTRDIFF_TYPE__ long int +#define __PTRDIFF_WIDTH__ 64 +#define __SCHAR_MAX__ 0x7f +#define __SCHAR_WIDTH__ 8 +#define __SHRT_MAX__ 0x7fff +#define __SHRT_WIDTH__ 16 +#define __SIG_ATOMIC_MAX__ 0x7fffffff +#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1) +//#define __SIG_ATOMIC_TYPE__ int +#define __SIG_ATOMIC_WIDTH__ 32 +#define __SIZE_MAX__ 0xffffffffffffffffUL +//#define __SIZE_TYPE__ long unsigned int +#define __SIZE_WIDTH__ 64 +#define __UINT8_C(c) c +#define __UINT8_MAX__ 0xff +//#define __UINT8_TYPE__ unsigned char +#define __UINT16_C(c) c +#define __UINT16_MAX__ 0xffff +//#define __UINT16_TYPE__ short unsigned int +#define __UINT32_C(c) c ## U +#define __UINT32_MAX__ 0xffffffffU +//#define __UINT32_TYPE__ unsigned int +#define __UINT64_C(c) c ## UL +#define __UINT64_MAX__ 0xffffffffffffffffUL +//#define __UINT64_TYPE__ long unsigned int +#define __UINT_FAST8_MAX__ 0xff +//#define __UINT_FAST8_TYPE__ unsigned char +#define __UINT_FAST16_MAX__ 0xffffffffffffffffUL +//#define __UINT_FAST16_TYPE__ long unsigned int +#define __UINT_FAST32_MAX__ 0xffffffffffffffffUL +//#define __UINT_FAST32_TYPE__ long unsigned int +#define __UINT_FAST64_MAX__ 0xffffffffffffffffUL +//#define __UINT_FAST64_TYPE__ long unsigned int +#define __UINT_LEAST8_MAX__ 0xff +//#define __UINT_LEAST8_TYPE__ unsigned char +#define __UINT_LEAST16_MAX__ 0xffff +//#define __UINT_LEAST16_TYPE__ short unsigned int +#define __UINT_LEAST32_MAX__ 0xffffffffU +//#define __UINT_LEAST32_TYPE__ unsigned int +#define __UINT_LEAST64_MAX__ 0xffffffffffffffffUL +//#define __UINT_LEAST64_TYPE__ long unsigned int +#define __UINTMAX_C(c) c ## UL +#define __UINTMAX_MAX__ 0xffffffffffffffffUL +//#define __UINTMAX_TYPE__ long unsigned int +#define __UINTPTR_MAX__ 0xffffffffffffffffUL +//#define __UINTPTR_TYPE__ long unsigned int +#define __WCHAR_MAX__ 0xffffffffU +#define __WCHAR_MIN__ 0U +//#define __WCHAR_TYPE__ unsigned int +#define __WCHAR_WIDTH__ 32 +#define __WINT_MAX__ 0xffffffffU +#define __WINT_MIN__ 0U +//#define __WINT_TYPE__ unsigned int +#define __WINT_WIDTH__ 32 +// Floats +//#define __BFLT16_DECIMAL_DIG__ 4 +//#define __BFLT16_DENORM_MIN__ 9.18354961579912115600575419704879436e-41BF16 +//#define __BFLT16_DIG__ 2 +//#define __BFLT16_EPSILON__ 7.81250000000000000000000000000000000e-3BF16 +//#define __BFLT16_HAS_DENORM__ 1 +//#define __BFLT16_HAS_INFINITY__ 1 +//#define __BFLT16_HAS_QUIET_NAN__ 1 +//#define __BFLT16_IS_IEC_60559__ 0 +//#define __BFLT16_MANT_DIG__ 8 +//#define __BFLT16_MAX_10_EXP__ 38 +//#define __BFLT16_MAX__ 3.38953138925153547590470800371487867e+38BF16 +//#define __BFLT16_MAX_EXP__ 128 +//#define __BFLT16_MIN_10_EXP__ (-37) +//#define __BFLT16_MIN__ 1.17549435082228750796873653722224568e-38BF16 +//#define __BFLT16_MIN_EXP__ (-125) +//#define __BFLT16_NORM_MAX__ 3.38953138925153547590470800371487867e+38BF16 +#define __DBL_DECIMAL_DIG__ 17 +#define __DBL_DENORM_MIN__ ((double)4.94065645841246544176568792868221372e-324L) +#define __DBL_DIG__ 15 +#define __DBL_EPSILON__ ((double)2.22044604925031308084726333618164062e-16L) +#define __DBL_HAS_DENORM__ 1 +#define __DBL_HAS_INFINITY__ 1 +#define __DBL_HAS_QUIET_NAN__ 1 +#define __DBL_IS_IEC_60559__ 1 +#define __DBL_MANT_DIG__ 53 +#define __DBL_MAX_10_EXP__ 308 +#define __DBL_MAX__ ((double)1.79769313486231570814527423731704357e+308L) +#define __DBL_MAX_EXP__ 1024 +#define __DBL_MIN_10_EXP__ (-307) +#define __DBL_MIN__ ((double)2.22507385850720138309023271733240406e-308L) +#define __DBL_MIN_EXP__ (-1021) +#define __DBL_NORM_MAX__ ((double)1.79769313486231570814527423731704357e+308L) +//#define __DEC32_EPSILON__ 1E-6DF +//#define __DEC32_MANT_DIG__ 7 +//#define __DEC32_MAX__ 9.999999E96DF +//#define __DEC32_MAX_EXP__ 97 +//#define __DEC32_MIN__ 1E-95DF +//#define __DEC32_MIN_EXP__ (-94) +//#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF +//#define __DEC64_EPSILON__ 1E-15DD +//#define __DEC64_MANT_DIG__ 16 +//#define __DEC64_MAX__ 9.999999999999999E384DD +//#define __DEC64_MAX_EXP__ 385 +//#define __DEC64_MIN__ 1E-383DD +//#define __DEC64_MIN_EXP__ (-382) +//#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD +//#define __DEC128_EPSILON__ 1E-33DL +//#define __DEC128_MANT_DIG__ 34 +//#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL +//#define __DEC128_MAX_EXP__ 6145 +//#define __DEC128_MIN__ 1E-6143DL +//#define __DEC128_MIN_EXP__ (-6142) +//#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL +//#define __DEC_EVAL_METHOD__ 2 +//#define __DECIMAL_BID_FORMAT__ 1 +//#define __DECIMAL_DIG__ 36 +//#define __FLT16_DECIMAL_DIG__ 5 +//#define __FLT16_DENORM_MIN__ 5.96046447753906250000000000000000000e-8F16 +//#define __FLT16_DIG__ 3 +//#define __FLT16_EPSILON__ 9.76562500000000000000000000000000000e-4F16 +//#define __FLT16_HAS_DENORM__ 1 +//#define __FLT16_HAS_INFINITY__ 1 +//#define __FLT16_HAS_QUIET_NAN__ 1 +//#define __FLT16_IS_IEC_60559__ 1 +//#define __FLT16_MANT_DIG__ 11 +//#define __FLT16_MAX_10_EXP__ 4 +//#define __FLT16_MAX__ 6.55040000000000000000000000000000000e+4F16 +//#define __FLT16_MAX_EXP__ 16 +//#define __FLT16_MIN_10_EXP__ (-4) +//#define __FLT16_MIN__ 6.10351562500000000000000000000000000e-5F16 +//#define __FLT16_MIN_EXP__ (-13) +//#define __FLT16_NORM_MAX__ 6.55040000000000000000000000000000000e+4F16 +//#define __FLT32_DECIMAL_DIG__ 9 +//#define __FLT32_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F32 +//#define __FLT32_DIG__ 6 +//#define __FLT32_EPSILON__ 1.19209289550781250000000000000000000e-7F32 +//#define __FLT32_HAS_DENORM__ 1 +//#define __FLT32_HAS_INFINITY__ 1 +//#define __FLT32_HAS_QUIET_NAN__ 1 +//#define __FLT32_IS_IEC_60559__ 1 +//#define __FLT32_MANT_DIG__ 24 +//#define __FLT32_MAX_10_EXP__ 38 +//#define __FLT32_MAX__ 3.40282346638528859811704183484516925e+38F32 +//#define __FLT32_MAX_EXP__ 128 +//#define __FLT32_MIN_10_EXP__ (-37) +//#define __FLT32_MIN__ 1.17549435082228750796873653722224568e-38F32 +//#define __FLT32_MIN_EXP__ (-125) +//#define __FLT32_NORM_MAX__ 3.40282346638528859811704183484516925e+38F32 +//#define __FLT32X_DECIMAL_DIG__ 17 +//#define __FLT32X_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F32x +//#define __FLT32X_DIG__ 15 +//#define __FLT32X_EPSILON__ 2.22044604925031308084726333618164062e-16F32x +//#define __FLT32X_HAS_DENORM__ 1 +//#define __FLT32X_HAS_INFINITY__ 1 +//#define __FLT32X_HAS_QUIET_NAN__ 1 +//#define __FLT32X_IS_IEC_60559__ 1 +//#define __FLT32X_MANT_DIG__ 53 +//#define __FLT32X_MAX_10_EXP__ 308 +//#define __FLT32X_MAX__ 1.79769313486231570814527423731704357e+308F32x +//#define __FLT32X_MAX_EXP__ 1024 +//#define __FLT32X_MIN_10_EXP__ (-307) +//#define __FLT32X_MIN__ 2.22507385850720138309023271733240406e-308F32x +//#define __FLT32X_MIN_EXP__ (-1021) +//#define __FLT32X_NORM_MAX__ 1.79769313486231570814527423731704357e+308F32x +//#define __FLT64_DECIMAL_DIG__ 17 +//#define __FLT64_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F64 +//#define __FLT64_DIG__ 15 +//#define __FLT64_EPSILON__ 2.22044604925031308084726333618164062e-16F64 +//#define __FLT64_HAS_DENORM__ 1 +//#define __FLT64_HAS_INFINITY__ 1 +//#define __FLT64_HAS_QUIET_NAN__ 1 +//#define __FLT64_IS_IEC_60559__ 1 +//#define __FLT64_MANT_DIG__ 53 +//#define __FLT64_MAX_10_EXP__ 308 +//#define __FLT64_MAX__ 1.79769313486231570814527423731704357e+308F64 +//#define __FLT64_MAX_EXP__ 1024 +//#define __FLT64_MIN_10_EXP__ (-307) +//#define __FLT64_MIN__ 2.22507385850720138309023271733240406e-308F64 +//#define __FLT64_MIN_EXP__ (-1021) +//#define __FLT64_NORM_MAX__ 1.79769313486231570814527423731704357e+308F64 +//#define __FLT64X_DECIMAL_DIG__ 36 +//#define __FLT64X_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966F64x +//#define __FLT64X_DIG__ 33 +//#define __FLT64X_EPSILON__ 1.92592994438723585305597794258492732e-34F64x +//#define __FLT64X_HAS_DENORM__ 1 +//#define __FLT64X_HAS_INFINITY__ 1 +//#define __FLT64X_HAS_QUIET_NAN__ 1 +//#define __FLT64X_IS_IEC_60559__ 1 +//#define __FLT64X_MANT_DIG__ 113 +//#define __FLT64X_MAX_10_EXP__ 4932 +//#define __FLT64X_MAX__ 1.18973149535723176508575932662800702e+4932F64x +//#define __FLT64X_MAX_EXP__ 16384 +//#define __FLT64X_MIN_10_EXP__ (-4931) +//#define __FLT64X_MIN__ 3.36210314311209350626267781732175260e-4932F64x +//#define __FLT64X_MIN_EXP__ (-16381) +//#define __FLT64X_NORM_MAX__ 1.18973149535723176508575932662800702e+4932F64x +//#define __FLT128_DECIMAL_DIG__ 36 +//#define __FLT128_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966F128 +//#define __FLT128_DIG__ 33 +//#define __FLT128_EPSILON__ 1.92592994438723585305597794258492732e-34F128 +//#define __FLT128_HAS_DENORM__ 1 +//#define __FLT128_HAS_INFINITY__ 1 +//#define __FLT128_HAS_QUIET_NAN__ 1 +//#define __FLT128_IS_IEC_60559__ 1 +//#define __FLT128_MANT_DIG__ 113 +//#define __FLT128_MAX_10_EXP__ 4932 +//#define __FLT128_MAX__ 1.18973149535723176508575932662800702e+4932F128 +//#define __FLT128_MAX_EXP__ 16384 +//#define __FLT128_MIN_10_EXP__ (-4931) +//#define __FLT128_MIN__ 3.36210314311209350626267781732175260e-4932F128 +//#define __FLT128_MIN_EXP__ (-16381) +//#define __FLT128_NORM_MAX__ 1.18973149535723176508575932662800702e+4932F128 +#define __FLT_DECIMAL_DIG__ 9 +#define __FLT_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F +#define __FLT_DIG__ 6 +#define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F +#define __FLT_EVAL_METHOD__ 0 +#define __FLT_EVAL_METHOD_C99__ 0 +#define __FLT_EVAL_METHOD_TS_18661_3__ 0 +#define __FLT_HAS_DENORM__ 1 +#define __FLT_HAS_INFINITY__ 1 +#define __FLT_HAS_QUIET_NAN__ 1 +#define __FLT_IS_IEC_60559__ 1 +#define __FLT_MANT_DIG__ 24 +#define __FLT_MAX_10_EXP__ 38 +#define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F +#define __FLT_MAX_EXP__ 128 +#define __FLT_MIN_10_EXP__ (-37) +#define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F +#define __FLT_MIN_EXP__ (-125) +#define __FLT_NORM_MAX__ 3.40282346638528859811704183484516925e+38F +#define __FLT_RADIX__ 2 +#define __FP_FAST_FMA 1 +#define __FP_FAST_FMAF 1 +#define __FP_FAST_FMAF32 1 +#define __FP_FAST_FMAF32x 1 +#define __FP_FAST_FMAF64 1 +#define __LDBL_DECIMAL_DIG__ 36 +#define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L +#define __LDBL_DIG__ 33 +#define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L +#define __LDBL_HAS_DENORM__ 1 +#define __LDBL_HAS_INFINITY__ 1 +#define __LDBL_HAS_QUIET_NAN__ 1 +#define __LDBL_IS_IEC_60559__ 1 +#define __LDBL_MANT_DIG__ 113 +#define __LDBL_MAX_10_EXP__ 4932 +#define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L +#define __LDBL_MAX_EXP__ 16384 +#define __LDBL_MIN_10_EXP__ (-4931) +#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L +#define __LDBL_MIN_EXP__ (-16381) +#define __LDBL_NORM_MAX__ 1.18973149535723176508575932662800702e+4932L + +#include_next "stdc-predef.h" diff --git a/wrapperhelper/include-override/common/bits/floatn.h b/wrapperhelper/include-override/common/bits/floatn.h new file mode 100644 index 0000000..ebd359f --- /dev/null +++ b/wrapperhelper/include-override/common/bits/floatn.h @@ -0,0 +1,118 @@ +/* Macros to control TS 18661-3 glibc features on x86. + Copyright (C) 2017-2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . + +This file has been adapted to work with the 'wrapperhelper' project on the 09/10/2024. +*/ + +#ifndef _BITS_FLOATN_H +#define _BITS_FLOATN_H + +#include + +/* Defined to 1 if the current compiler invocation provides a + floating-point type with the IEEE 754 binary128 format, and this + glibc includes corresponding *f128 interfaces for it. The required + libgcc support was added some time after the basic compiler + support, for x86_64 and x86. */ +# define __HAVE_FLOAT128 1 + +/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct + from the default float, double and long double types in this glibc. */ +#if __HAVE_FLOAT128 +# define __HAVE_DISTINCT_FLOAT128 1 +#else +# define __HAVE_DISTINCT_FLOAT128 0 +#endif + +/* Defined to 1 if the current compiler invocation provides a + floating-point type with the right format for _Float64x, and this + glibc includes corresponding *f64x interfaces for it. */ +#define __HAVE_FLOAT64X 1 + +/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format + of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has + the format of _Float128, which must be different from that of long + double. */ +#define __HAVE_FLOAT64X_LONG_DOUBLE 1 + +#ifndef __ASSEMBLER__ + +/* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. */ +# if __HAVE_FLOAT128 +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +/* The literal suffix f128 exists only since GCC 7.0. */ +# define __f128(x) x##q +# else +# define __f128(x) x##f128 +# endif +# endif + +/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ +# if __HAVE_FLOAT128 +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +/* Add a typedef for older GCC compilers which don't natively support + _Complex _Float128. */ +typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); +# define __CFLOAT128 __cfloat128 +# else +# define __CFLOAT128 _Complex _Float128 +# endif +# endif + +/* The remaining of this file provides support for older compilers. */ +# if __HAVE_FLOAT128 + +/* The type _Float128 exists only since GCC 7.0. */ +# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +typedef __float128 _Float128; +# endif + +/* __builtin_huge_valf128 doesn't exist before GCC 7.0. */ +# if !__GNUC_PREREQ (7, 0) +# define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ()) +# endif + +/* Older GCC has only a subset of built-in functions for _Float128 on + x86, and __builtin_infq is not usable in static initializers. + Converting a narrower sNaN to _Float128 produces a quiet NaN, so + attempts to use _Float128 sNaNs will not work properly with older + compilers. */ +# if !__GNUC_PREREQ (7, 0) +# define __builtin_copysignf128 __builtin_copysignq +# define __builtin_fabsf128 __builtin_fabsq +# define __builtin_inff128() ((_Float128) __builtin_inf ()) +# define __builtin_nanf128(x) ((_Float128) __builtin_nan (x)) +# define __builtin_nansf128(x) ((_Float128) __builtin_nans (x)) +# endif + +/* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*, + e.g.: __builtin_signbitf128, before GCC 6. However, there has never + been a __builtin_signbitf128 in GCC and the type-generic builtin is + only available since GCC 6. */ +# if !__GNUC_PREREQ (6, 0) +# define __builtin_signbitf128 __signbitf128 +# endif + +# endif + +#endif /* !__ASSEMBLER__. */ + +#include + +#endif /* _BITS_FLOATN_H */ diff --git a/wrapperhelper/include-override/common/bits/stdint-intn.h b/wrapperhelper/include-override/common/bits/stdint-intn.h new file mode 100644 index 0000000..14abdb4 --- /dev/null +++ b/wrapperhelper/include-override/common/bits/stdint-intn.h @@ -0,0 +1,32 @@ +/* Define intN_t types. + Copyright (C) 2017-2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . + +This file has been adapted to work with the 'wrapperhelper' project on the 09/06/2024. +*/ + +#ifndef _BITS_STDINT_INTN_H +#define _BITS_STDINT_INTN_H 1 + +#include + +typedef __int8_t int8_t; +typedef __int16_t int16_t; +typedef __int32_t int32_t; +typedef __int64_t int64_t; + +#endif /* bits/stdint-intn.h */ diff --git a/wrapperhelper/include-override/common/bits/stdint-least.h b/wrapperhelper/include-override/common/bits/stdint-least.h new file mode 100644 index 0000000..d9753d7 --- /dev/null +++ b/wrapperhelper/include-override/common/bits/stdint-least.h @@ -0,0 +1,39 @@ +/* Define int_leastN_t and uint_leastN types. + Copyright (C) 2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . + +This file has been adapted to work with the 'wrapperhelper' project on the 09/06/2024. +*/ + +#ifndef _BITS_STDINT_LEAST_H +#define _BITS_STDINT_LEAST_H 1 + +#include + +/* Signed. */ +typedef __int_least8_t int_least8_t; +typedef __int_least16_t int_least16_t; +typedef __int_least32_t int_least32_t; +typedef __int_least64_t int_least64_t; + +/* Unsigned. */ +typedef __uint_least8_t uint_least8_t; +typedef __uint_least16_t uint_least16_t; +typedef __uint_least32_t uint_least32_t; +typedef __uint_least64_t uint_least64_t; + +#endif /* bits/stdint-least.h */ diff --git a/wrapperhelper/include-override/common/bits/stdint-uintn.h b/wrapperhelper/include-override/common/bits/stdint-uintn.h new file mode 100644 index 0000000..cf2e8b4 --- /dev/null +++ b/wrapperhelper/include-override/common/bits/stdint-uintn.h @@ -0,0 +1,32 @@ +/* Define uintN_t types. + Copyright (C) 2017-2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . + +This file has been adapted to work with the 'wrapperhelper' project on the 09/06/2024. +*/ + +#ifndef _BITS_STDINT_UINTN_H +#define _BITS_STDINT_UINTN_H 1 + +#include + +typedef __uint8_t uint8_t; +typedef __uint16_t uint16_t; +typedef __uint32_t uint32_t; +typedef __uint64_t uint64_t; + +#endif /* bits/stdint-uintn.h */ diff --git a/wrapperhelper/include-override/common/bits/types.h b/wrapperhelper/include-override/common/bits/types.h new file mode 100644 index 0000000..7d1eddd --- /dev/null +++ b/wrapperhelper/include-override/common/bits/types.h @@ -0,0 +1,192 @@ +/* bits/types.h -- definitions of __*_t types underlying *_t types. + Copyright (C) 2002-2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . + +This file has been adapted to work with the 'wrapperhelper' project on the 09/06/2024. +*/ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_TYPES_H +#define _BITS_TYPES_H 1 + +#include +#include +#include + +/* Convenience types. */ +typedef unsigned char __u_char; +typedef unsigned short int __u_short; +typedef unsigned int __u_int; +typedef unsigned long int __u_long; + +/* Fixed-size types, underlying types depend on word size and compiler. */ +#pragma wrappers allow_ints_ext + +/* Smallest types with at least a given width. */ +typedef __int8_t __int_least8_t; +typedef __uint8_t __uint_least8_t; +typedef __int16_t __int_least16_t; +typedef __uint16_t __uint_least16_t; +typedef __int32_t __int_least32_t; +typedef __uint32_t __uint_least32_t; +typedef __int64_t __int_least64_t; +typedef __uint64_t __uint_least64_t; + +/* quad_t is also 64 bits. */ +typedef __int64_t __quad_t; +typedef __uint64_t __u_quad_t; + +/* Largest integral types. */ +typedef __int64_t __intmax_t; +typedef __uint64_t __uintmax_t; + + +/* The machine-dependent file defines __*_T_TYPE + macros for each of the OS types we define below. The definitions + of those macros must use the following macros for underlying types. + We define __S_TYPE and __U_TYPE for the signed and unsigned + variants of each of the following integer types on this machine. + + 16 -- "natural" 16-bit type (always short) + 32 -- "natural" 32-bit type (always int) + 64 -- "natural" 64-bit type (long or long long) + LONG32 -- 32-bit type, traditionally long + QUAD -- 64-bit type, traditionally long long + WORD -- natural type of __WORDSIZE bits (int or long) + LONGWORD -- type of __WORDSIZE bits, traditionally long + + We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the + conventional uses of `long' or `long long' type modifiers match the + types we define, even when a less-adorned type would be the same size. + This matters for (somewhat) portably writing printf/scanf formats for + these types, where using the appropriate l or ll format modifiers can + make the typedefs and the formats match up across all GNU platforms. If + we used `long' when it's 64 bits where `long long' is expected, then the + compiler would warn about the formats not matching the argument types, + and the programmer changing them to shut up the compiler would break the + program's portability. + + Here we assume what is presently the case in all the GCC configurations + we support: long long is always 64 bits, long is always word/address size, + and int is always 32 bits. */ + +#define __S16_TYPE __int16_t +#define __U16_TYPE __uint16_t +#define __S32_TYPE __int32_t +#define __U32_TYPE __uint32_t +#define __SLONGWORD_TYPE long int +#define __ULONGWORD_TYPE unsigned long int +# define __SQUAD_TYPE __int64_t +# define __UQUAD_TYPE __uint64_t +# define __SWORD_TYPE long int +# define __UWORD_TYPE unsigned long int +# define __SLONG32_TYPE __int32_t +# define __ULONG32_TYPE __uint32_t +# define __S64_TYPE __int64_t +# define __U64_TYPE __uint64_t +# define __STD_TYPE typedef +#include /* Defines __*_T_TYPE macros. */ +#include /* Defines __TIME*_T_TYPE macros. */ + + +__STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */ +__STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */ +__STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */ +__STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */ +__STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/ +__STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */ +__STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */ +__STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */ +__STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */ +__STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */ +__STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */ +__STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */ +__STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */ +__STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */ +__STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */ +__STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ +__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ +__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ +__STD_TYPE __SUSECONDS64_T_TYPE __suseconds64_t; + +__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ +__STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ + +/* Clock ID used in clock and timer functions. */ +__STD_TYPE __CLOCKID_T_TYPE __clockid_t; + +/* Timer ID returned by `timer_create'. */ +__STD_TYPE __TIMER_T_TYPE __timer_t; + +/* Type to represent block size. */ +__STD_TYPE __BLKSIZE_T_TYPE __blksize_t; + +/* Types from the Large File Support interface. */ + +/* Type to count number of disk blocks. */ +__STD_TYPE __BLKCNT_T_TYPE __blkcnt_t; +__STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t; + +/* Type to count file system blocks. */ +__STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t; +__STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t; + +/* Type to count file system nodes. */ +__STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t; +__STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t; + +/* Type of miscellaneous file system fields. */ +__STD_TYPE __FSWORD_T_TYPE __fsword_t; + +__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */ + +/* Signed long type used in system calls. */ +__STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t; +/* Unsigned long type used in system calls. */ +__STD_TYPE __SYSCALL_ULONG_TYPE __syscall_ulong_t; + +/* These few don't really vary by system, they always correspond + to one of the other defined types. */ +typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */ +typedef char *__caddr_t; + +/* Duplicates info from stdint.h but this is used in unistd.h. */ +__STD_TYPE __SWORD_TYPE __intptr_t; + +/* Duplicate info from sys/socket.h. */ +__STD_TYPE __U32_TYPE __socklen_t; + +/* C99: An integer type that can be accessed as an atomic entity, + even in the presence of asynchronous interrupts. + It is not currently necessary for this to be machine-specific. */ +typedef int __sig_atomic_t; + +/* Seconds since the Epoch, visible to user code when time_t is too + narrow only for consistency with the old way of widening too-narrow + types. User code should never use __time64_t. */ +#if __TIMESIZE == 64 && defined __LIBC +# define __time64_t __time_t +#elif __TIMESIZE != 64 +__STD_TYPE __TIME64_T_TYPE __time64_t; +#endif + +#undef __STD_TYPE + +#endif /* bits/types.h */ diff --git a/wrapperhelper/include-override/common/stdc-predef.h b/wrapperhelper/include-override/common/stdc-predef.h new file mode 100644 index 0000000..52c07ac --- /dev/null +++ b/wrapperhelper/include-override/common/stdc-predef.h @@ -0,0 +1,3 @@ +// Ignore all attributes +#define __attribute__(_) +#define __attribute(_) diff --git a/wrapperhelper/include-override/common/stdint.h b/wrapperhelper/include-override/common/stdint.h new file mode 100644 index 0000000..0389d24 --- /dev/null +++ b/wrapperhelper/include-override/common/stdint.h @@ -0,0 +1,237 @@ +/* Copyright (C) 1997-2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . + +This file has been adapted to work with the 'wrapperhelper' project on the 09/06/2024. +*/ + +/* + * ISO C99: 7.18 Integer types + */ + +#ifndef _STDINT_H +#define _STDINT_H 1 + +#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION +#include +#include +#include +#include + +#pragma wrappers allow_ints_ext + +/* Exact integral types. */ + +/* Signed. */ +#include + +/* Unsigned. */ +#include + + +/* Small types. */ +#include + + +/* Fast types. */ + +/* Signed. */ +typedef int8_t int_fast8_t; +typedef long int_fast16_t; +typedef long int_fast32_t; +typedef int64_t int_fast64_t; + +/* Unsigned. */ +typedef uint8_t uint_fast8_t; +typedef unsigned long uint_fast16_t; +typedef unsigned long uint_fast32_t; +typedef uint64_t uint_fast64_t; + + +/* Types for `void *' pointers. */ +# ifndef __intptr_t_defined +typedef signed long intptr_t; +# define __intptr_t_defined +# endif +typedef unsigned long uintptr_t; + + +/* Largest integral types. */ +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; + + +# if __WORDSIZE == 64 +# define __INT64_C(c) c ## L +# define __UINT64_C(c) c ## UL +# else +# define __INT64_C(c) c ## LL +# define __UINT64_C(c) c ## ULL +# endif + +/* Limits of integral types. */ + +/* Minimum of signed integral types. */ +# define INT8_MIN (-128) +# define INT16_MIN (-32767-1) +# define INT32_MIN (-2147483647-1) +# define INT64_MIN (-__INT64_C(9223372036854775807)-1) +/* Maximum of signed integral types. */ +# define INT8_MAX (127) +# define INT16_MAX (32767) +# define INT32_MAX (2147483647) +# define INT64_MAX (__INT64_C(9223372036854775807)) + +/* Maximum of unsigned integral types. */ +# define UINT8_MAX (255) +# define UINT16_MAX (65535) +# define UINT32_MAX (4294967295U) +# define UINT64_MAX (__UINT64_C(18446744073709551615)) + + +/* Minimum of signed integral types having a minimum size. */ +# define INT_LEAST8_MIN (-__INT_LEAST8_MAX__-1) +# define INT_LEAST16_MIN (-__INT_LEAST16_MAX__-1) +# define INT_LEAST32_MIN (-__INT_LEAST32_MAX__-1) +# define INT_LEAST64_MIN (-__INT_LEAST64_MAX__-1) +/* Maximum of signed integral types having a minimum size. */ +# define INT_LEAST8_MAX __INT_LEAST8_MAX__ +# define INT_LEAST16_MAX __INT_LEAST16_MAX__ +# define INT_LEAST32_MAX __INT_LEAST32_MAX__ +# define INT_LEAST64_MAX __INT_LEAST64_MAX__ + +/* Maximum of unsigned integral types having a minimum size. */ +# define UINT_LEAST8_MAX __UINT_LEAST8_MAX__ +# define UINT_LEAST16_MAX __UINT_LEAST16_MAX__ +# define UINT_LEAST32_MAX __UINT_LEAST32_MAX__ +# define UINT_LEAST64_MAX __UINT_LEAST64_MAX__ + + +/* Minimum of fast signed integral types having a minimum size. */ +# define INT_FAST8_MIN (-__INT_FAST8_MAX__-1) +# define INT_FAST16_MIN (-__INT_FAST16_MAX__-1) +# define INT_FAST32_MIN (-__INT_FAST32_MAX__-1) +# define INT_FAST64_MIN (-__INT_FAST64_MAX__-1) +/* Maximum of fast signed integral types having a minimum size. */ +# define INT_FAST8_MAX __INT_FAST8_MAX__ +# define INT_FAST16_MAX __INT_FAST16_MAX__ +# define INT_FAST32_MAX __INT_FAST32_MAX__ +# define INT_FAST64_MAX __INT_FAST64_MAX__ + +/* Maximum of fast unsigned integral types having a minimum size. */ +# define UINT_FAST8_MAX __UINT_FAST8_MAX__ +# define UINT_FAST16_MAX __UINT_FAST16_MAX__ +# define UINT_FAST32_MAX __UINT_FAST32_MAX__ +# define UINT_FAST64_MAX __UINT_FAST64_MAX__ + + +/* Values to test for integral types holding `void *' pointer. */ +# define INTPTR_MIN (-__INTPTR_MAX__-1) +# define INTPTR_MAX __INTPTR_MAX__ +# define UINTPTR_MAX __UINTPTR_MAX__ + +/* Minimum for largest signed integral type. */ +# define INTMAX_MIN (-__INTMAX_MAX__-1) +/* Maximum for largest signed integral type. */ +# define INTMAX_MAX __INTMAX_MAX__ + +/* Maximum for largest unsigned integral type. */ +# define UINTMAX_MAX __UINTMAX_MAX__ + +/* Limits of other integer types. */ + +/* Limits of `ptrdiff_t' type. */ +# define PTRDIFF_MIN (-__PTRDIFF_MAX__-1) +# define PTRDIFF_MAX __PTRDIFF_MAX__ + +/* Limits of `sig_atomic_t'. */ +# define SIG_ATOMIC_MIN (-__SIG_ATOMIC_MAX__-1) +# define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX__ + +/* Limit of `size_t' type. */ +# define SIZE_MAX __SIZE_MAX__ + +/* Limits of `wchar_t'. */ +# ifndef WCHAR_MIN +/* These constants might also be defined in . */ +# define WCHAR_MIN __WCHAR_MIN__ +# define WCHAR_MAX __WCHAR_MAX__ +# endif + +/* Limits of `wint_t'. */ +# define WINT_MIN __WINT_MIN__ +# define WINT_MAX __WINT_MAX__ + +/* Signed. */ +# define INT8_C(c) __INT8_C(c) +# define INT16_C(c) __INT16_C(c) +# define INT32_C(c) __INT32_C(c) +# define INT64_C(c) __INT64_C(c) + +/* Unsigned. */ +# define UINT8_C(c) __UINT8_C(c) +# define UINT16_C(c) __UINT16_C(c) +# define UINT32_C(c) __UINT32_C(c) +# define UINT64_C(c) __UINT64_C(c) + +/* Maximal type. */ +# define INTMAX_C(c) __INTMAX_C(c) +# define UINTMAX_C(c) __UINTMAX_C(c) + +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) + +# define INT8_WIDTH 8 +# define UINT8_WIDTH 8 +# define INT16_WIDTH 16 +# define UINT16_WIDTH 16 +# define INT32_WIDTH 32 +# define UINT32_WIDTH 32 +# define INT64_WIDTH 64 +# define UINT64_WIDTH 64 + +# define INT_LEAST8_WIDTH 8 +# define UINT_LEAST8_WIDTH 8 +# define INT_LEAST16_WIDTH 16 +# define UINT_LEAST16_WIDTH 16 +# define INT_LEAST32_WIDTH 32 +# define UINT_LEAST32_WIDTH 32 +# define INT_LEAST64_WIDTH 64 +# define UINT_LEAST64_WIDTH 64 + +# define INT_FAST8_WIDTH 8 +# define UINT_FAST8_WIDTH 8 +# define INT_FAST16_WIDTH __WORDSIZE +# define UINT_FAST16_WIDTH __WORDSIZE +# define INT_FAST32_WIDTH __WORDSIZE +# define UINT_FAST32_WIDTH __WORDSIZE +# define INT_FAST64_WIDTH 64 +# define UINT_FAST64_WIDTH 64 + +# define INTPTR_WIDTH __WORDSIZE +# define UINTPTR_WIDTH __WORDSIZE + +# define INTMAX_WIDTH 64 +# define UINTMAX_WIDTH 64 + +# define PTRDIFF_WIDTH __WORDSIZE +# define SIG_ATOMIC_WIDTH 32 +# define SIZE_WIDTH __WORDSIZE +# define WCHAR_WIDTH 32 +# define WINT_WIDTH 32 + +#endif + +#endif /* stdint.h */ diff --git a/wrapperhelper/include-override/x86/bits/pthreadtypes-arch.h b/wrapperhelper/include-override/x86/bits/pthreadtypes-arch.h new file mode 100644 index 0000000..b23ff3b --- /dev/null +++ b/wrapperhelper/include-override/x86/bits/pthreadtypes-arch.h @@ -0,0 +1,55 @@ +/* Copyright (C) 2002-2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_PTHREADTYPES_ARCH_H +#define _BITS_PTHREADTYPES_ARCH_H 1 + +#include + +#ifdef __x86_64__ +# if __WORDSIZE == 64 +# define __SIZEOF_PTHREAD_MUTEX_T 40 +# define __SIZEOF_PTHREAD_ATTR_T 56 +# define __SIZEOF_PTHREAD_RWLOCK_T 56 +# define __SIZEOF_PTHREAD_BARRIER_T 32 +# else +# define __SIZEOF_PTHREAD_MUTEX_T 32 +# define __SIZEOF_PTHREAD_ATTR_T 32 +# define __SIZEOF_PTHREAD_RWLOCK_T 44 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +# endif +#else +# define __SIZEOF_PTHREAD_MUTEX_T 24 +# define __SIZEOF_PTHREAD_ATTR_T 36 +# define __SIZEOF_PTHREAD_RWLOCK_T 32 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +#endif +#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 + +#define __LOCK_ALIGNMENT +#define __ONCE_ALIGNMENT + +#ifndef __x86_64__ +/* Extra attributes for the cleanup functions. */ +# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1))) +#endif + +#endif /* bits/pthreadtypes.h */ diff --git a/wrapperhelper/include-override/x86/stdc-predef.h b/wrapperhelper/include-override/x86/stdc-predef.h new file mode 100644 index 0000000..4f59430 --- /dev/null +++ b/wrapperhelper/include-override/x86/stdc-predef.h @@ -0,0 +1,401 @@ +// C standard +#define __STDC__ 1 +#define __STDC_HOSTED__ 1 +#define __STDC_UTF_16__ 1 +#define __STDC_UTF_32__ 1 +#define __STDC_VERSION__ 201710L +// Generic x86_64 infos +#define __ELF__ 1 +#define __NO_INLINE__ 1 +#define __ORDER_BIG_ENDIAN__ 4321 +#define __ORDER_LITTLE_ENDIAN__ 1234 +#define __ORDER_PDP_ENDIAN__ 3412 +#define __PIC__ 2 +#define __pic__ 2 +#define __PIE__ 2 +#define __pie__ 2 +#define __USER_LABEL_PREFIX__ +#define __gnu_linux__ 1 +#define __linux__ 1 +#define __linux 1 +#define linux 1 +#define __unix__ 1 +#define __unix 1 +#define unix 1 +// GCC +//#define __GCC_ASM_FLAG_OUTPUTS__ 1 +//#define __GCC_ATOMIC_BOOL_LOCK_FREE 2 +//#define __GCC_ATOMIC_CHAR_LOCK_FREE 2 +//#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2 +//#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2 +//#define __GCC_ATOMIC_INT_LOCK_FREE 2 +//#define __GCC_ATOMIC_LLONG_LOCK_FREE 2 +//#define __GCC_ATOMIC_LONG_LOCK_FREE 2 +//#define __GCC_ATOMIC_POINTER_LOCK_FREE 2 +//#define __GCC_ATOMIC_SHORT_LOCK_FREE 2 +//#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1 +//#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2 +//#define __GCC_CONSTRUCTIVE_SIZE 64 +//#define __GCC_DESTRUCTIVE_SIZE 64 +//#define __GCC_HAVE_DWARF2_CFI_ASM 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 +//#define __GCC_IEC_559 2 +//#define __GCC_IEC_559_COMPLEX 2 +//#define __GNUC__ 14 +//#define __GNUC_EXECUTION_CHARSET_NAME "UTF-8" +//#define __GNUC_MINOR__ 2 +//#define __GNUC_PATCHLEVEL__ 1 +//#define __GNUC_STDC_INLINE__ 1 +//#define __GNUC_WIDE_EXECUTION_CHARSET_NAME "UTF-32LE" +//#define __GXX_ABI_VERSION 1019 +//#define __PRAGMA_REDEFINE_EXTNAME 1 +//#define __VERSION__ "14.2.1 20240805" +// Specific x86_64 architecture +#define __FINITE_MATH_ONLY__ 0 +#define __HAVE_SPECULATION_SAFE_VALUE 1 +#define __ILP32__ 1 +#define _ILP32 1 +#define __REGISTER_PREFIX__ +#define __FXSR__ 1 +#define __LAHF_SAHF__ 1 +#define __MMX__ 1 +#define __SEG_FS 1 +#define __SEG_GS 1 +#define __SSE__ 1 +#define __SSE2__ 1 +#define __SSP_STRONG__ 3 +#define __code_model_32__ 1 +#define __i386__ 1 +#define __i386 1 +#define i386 1 +#define __k8__ 1 +#define __k8 1 +// Atomic +#define __ATOMIC_RELAXED 0 +#define __ATOMIC_CONSUME 1 +#define __ATOMIC_ACQUIRE 2 +#define __ATOMIC_RELEASE 3 +#define __ATOMIC_ACQ_REL 4 +#define __ATOMIC_SEQ_CST 5 +#define __ATOMIC_HLE_ACQUIRE 65536 +#define __ATOMIC_HLE_RELEASE 131072 +// Metainfo on types +#define __BIGGEST_ALIGNMENT__ 16 +#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ +#define __CHAR_BIT__ 8 +#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__ +#define __SIZEOF_SHORT__ 2 +#define __SIZEOF_WCHAR_T__ 4 +#define __SIZEOF_INT__ 4 +#define __SIZEOF_WINT_T__ 4 +#define __SIZEOF_LONG__ 4 +#define __SIZEOF_LONG_LONG__ 8 +#define __SIZEOF_POINTER__ 4 +#define __SIZEOF_PTRDIFF_T__ 4 +#define __SIZEOF_SIZE_T__ 4 +#define __SIZEOF_FLOAT__ 4 +#define __SIZEOF_DOUBLE__ 8 +#define __SIZEOF_LONG_DOUBLE__ 12 +#define __SIZEOF_FLOAT80__ 12 +#define __SIZEOF_FLOAT128__ 16 +// Integers +//#define __BITINT_MAXWIDTH__ 65535 +//#define __CHAR16_TYPE__ short unsigned int +//#define __CHAR32_TYPE__ unsigned int +//#define __INT8_C(c) c +#define __INT8_MAX__ 0x7f +//#define __INT8_TYPE__ signed char +//#define __INT16_C(c) c +#define __INT16_MAX__ 0x7fff +//#define __INT16_TYPE__ short int +//#define __INT32_C(c) c +#define __INT32_MAX__ 0x7fffffff +//#define __INT32_TYPE__ int +//#define __INT64_C(c) c ## LL +#define __INT64_MAX__ 0x7fffffffffffffffLL +//#define __INT64_TYPE__ long long int +#define __INT_FAST8_MAX__ 0x7f +//#define __INT_FAST8_TYPE__ signed char +#define __INT_FAST8_WIDTH__ 8 +#define __INT_FAST16_MAX__ 0x7fffffff +//#define __INT_FAST16_TYPE__ int +#define __INT_FAST16_WIDTH__ 32 +#define __INT_FAST32_MAX__ 0x7fffffff +//#define __INT_FAST32_TYPE__ int +#define __INT_FAST32_WIDTH__ 32 +#define __INT_FAST64_MAX__ 0x7fffffffffffffffLL +//#define __INT_FAST64_TYPE__ long long int +#define __INT_FAST64_WIDTH__ 64 +#define __INT_LEAST8_MAX__ 0x7f +//#define __INT_LEAST8_TYPE__ signed char +#define __INT_LEAST8_WIDTH__ 8 +#define __INT_LEAST16_MAX__ 0x7fff +//#define __INT_LEAST16_TYPE__ short int +#define __INT_LEAST16_WIDTH__ 16 +#define __INT_LEAST32_MAX__ 0x7fffffff +//#define __INT_LEAST32_TYPE__ int +#define __INT_LEAST32_WIDTH__ 32 +#define __INT_LEAST64_MAX__ 0x7fffffffffffffffLL +//#define __INT_LEAST64_TYPE__ long long int +#define __INT_LEAST64_WIDTH__ 64 +#define __INT_MAX__ 0x7fffffff +#define __INT_WIDTH__ 32 +#define __INTMAX_C(c) c ## LL +#define __INTMAX_MAX__ 0x7fffffffffffffffLL +//#define __INTMAX_TYPE__ long long int +#define __INTMAX_WIDTH__ 64 +#define __INTPTR_MAX__ 0x7fffffff +//#define __INTPTR_TYPE__ int +#define __INTPTR_WIDTH__ 32 +#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL +#define __LONG_LONG_WIDTH__ 64 +#define __LONG_MAX__ 0x7fffffffL +#define __LONG_WIDTH__ 32 +#define __PTRDIFF_MAX__ 0x7fffffff +//#define __PTRDIFF_TYPE__ int +#define __PTRDIFF_WIDTH__ 32 +#define __SCHAR_MAX__ 0x7f +#define __SCHAR_WIDTH__ 8 +#define __SHRT_MAX__ 0x7fff +#define __SHRT_WIDTH__ 16 +#define __SIG_ATOMIC_MAX__ 0x7fffffff +#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1) +//#define __SIG_ATOMIC_TYPE__ int +#define __SIG_ATOMIC_WIDTH__ 32 +#define __SIZE_MAX__ 0xffffffffU +//#define __SIZE_TYPE__ unsigned int +#define __SIZE_WIDTH__ 32 +#define __UINT8_C(c) c +#define __UINT8_MAX__ 0xff +//#define __UINT8_TYPE__ unsigned char +#define __UINT16_C(c) c +#define __UINT16_MAX__ 0xffff +//#define __UINT16_TYPE__ short unsigned int +#define __UINT32_C(c) c ## U +#define __UINT32_MAX__ 0xffffffffU +//#define __UINT32_TYPE__ unsigned int +#define __UINT64_C(c) c ## ULL +#define __UINT64_MAX__ 0xffffffffffffffffULL +//#define __UINT64_TYPE__ long long unsigned int +#define __UINT_FAST8_MAX__ 0xff +//#define __UINT_FAST8_TYPE__ unsigned char +#define __UINT_FAST16_MAX__ 0xffffffffU +//#define __UINT_FAST16_TYPE__ unsigned int +#define __UINT_FAST32_MAX__ 0xffffffffU +//#define __UINT_FAST32_TYPE__ unsigned int +#define __UINT_FAST64_MAX__ 0xffffffffffffffffULL +//#define __UINT_FAST64_TYPE__ long long unsigned int +#define __UINT_LEAST8_MAX__ 0xff +//#define __UINT_LEAST8_TYPE__ unsigned char +#define __UINT_LEAST16_MAX__ 0xffff +//#define __UINT_LEAST16_TYPE__ short unsigned int +#define __UINT_LEAST32_MAX__ 0xffffffffU +//#define __UINT_LEAST32_TYPE__ unsigned int +#define __UINT_LEAST64_MAX__ 0xffffffffffffffffULL +//#define __UINT_LEAST64_TYPE__ long long unsigned int +#define __UINTMAX_C(c) c ## ULL +#define __UINTMAX_MAX__ 0xffffffffffffffffULL +//#define __UINTMAX_TYPE__ long long unsigned int +#define __UINTPTR_MAX__ 0xffffffffU +//#define __UINTPTR_TYPE__ unsigned int +#define __WCHAR_MAX__ 0x7fffffffL +#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1) +//#define __WCHAR_TYPE__ long int +#define __WCHAR_WIDTH__ 32 +#define __WINT_MAX__ 0xffffffffU +#define __WINT_MIN__ 0U +//#define __WINT_TYPE__ unsigned int +#define __WINT_WIDTH__ 32 +// Floats +//#define __BFLT16_DECIMAL_DIG__ 4 +//#define __BFLT16_DENORM_MIN__ 9.18354961579912115600575419704879436e-41BF16 +//#define __BFLT16_DIG__ 2 +//#define __BFLT16_EPSILON__ 7.81250000000000000000000000000000000e-3BF16 +//#define __BFLT16_HAS_DENORM__ 1 +//#define __BFLT16_HAS_INFINITY__ 1 +//#define __BFLT16_HAS_QUIET_NAN__ 1 +//#define __BFLT16_IS_IEC_60559__ 0 +//#define __BFLT16_MANT_DIG__ 8 +//#define __BFLT16_MAX_10_EXP__ 38 +//#define __BFLT16_MAX__ 3.38953138925153547590470800371487867e+38BF16 +//#define __BFLT16_MAX_EXP__ 128 +//#define __BFLT16_MIN_10_EXP__ (-37) +//#define __BFLT16_MIN__ 1.17549435082228750796873653722224568e-38BF16 +//#define __BFLT16_MIN_EXP__ (-125) +//#define __BFLT16_NORM_MAX__ 3.38953138925153547590470800371487867e+38BF16 +#define __DBL_DECIMAL_DIG__ 17 +#define __DBL_DENORM_MIN__ ((double)4.94065645841246544176568792868221372e-324L) +#define __DBL_DIG__ 15 +#define __DBL_EPSILON__ ((double)2.22044604925031308084726333618164062e-16L) +#define __DBL_HAS_DENORM__ 1 +#define __DBL_HAS_INFINITY__ 1 +#define __DBL_HAS_QUIET_NAN__ 1 +#define __DBL_IS_IEC_60559__ 1 +#define __DBL_MANT_DIG__ 53 +#define __DBL_MAX_10_EXP__ 308 +#define __DBL_MAX__ ((double)1.79769313486231570814527423731704357e+308L) +#define __DBL_MAX_EXP__ 1024 +#define __DBL_MIN_10_EXP__ (-307) +#define __DBL_MIN__ ((double)2.22507385850720138309023271733240406e-308L) +#define __DBL_MIN_EXP__ (-1021) +#define __DBL_NORM_MAX__ ((double)1.79769313486231570814527423731704357e+308L) +//#define __DEC32_EPSILON__ 1E-6DF +//#define __DEC32_MANT_DIG__ 7 +//#define __DEC32_MAX__ 9.999999E96DF +//#define __DEC32_MAX_EXP__ 97 +//#define __DEC32_MIN__ 1E-95DF +//#define __DEC32_MIN_EXP__ (-94) +//#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF +//#define __DEC64_EPSILON__ 1E-15DD +//#define __DEC64_MANT_DIG__ 16 +//#define __DEC64_MAX__ 9.999999999999999E384DD +//#define __DEC64_MAX_EXP__ 385 +//#define __DEC64_MIN__ 1E-383DD +//#define __DEC64_MIN_EXP__ (-382) +//#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD +//#define __DEC128_EPSILON__ 1E-33DL +//#define __DEC128_MANT_DIG__ 34 +//#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL +//#define __DEC128_MAX_EXP__ 6145 +//#define __DEC128_MIN__ 1E-6143DL +//#define __DEC128_MIN_EXP__ (-6142) +//#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL +//#define __DEC_EVAL_METHOD__ 2 +//#define __DECIMAL_BID_FORMAT__ 1 +//#define __DECIMAL_DIG__ 21 +//#define __FLT16_DECIMAL_DIG__ 5 +//#define __FLT16_DENORM_MIN__ 5.96046447753906250000000000000000000e-8F16 +//#define __FLT16_DIG__ 3 +//#define __FLT16_EPSILON__ 9.76562500000000000000000000000000000e-4F16 +//#define __FLT16_HAS_DENORM__ 1 +//#define __FLT16_HAS_INFINITY__ 1 +//#define __FLT16_HAS_QUIET_NAN__ 1 +//#define __FLT16_IS_IEC_60559__ 1 +//#define __FLT16_MANT_DIG__ 11 +//#define __FLT16_MAX_10_EXP__ 4 +//#define __FLT16_MAX__ 6.55040000000000000000000000000000000e+4F16 +//#define __FLT16_MAX_EXP__ 16 +//#define __FLT16_MIN_10_EXP__ (-4) +//#define __FLT16_MIN__ 6.10351562500000000000000000000000000e-5F16 +//#define __FLT16_MIN_EXP__ (-13) +//#define __FLT16_NORM_MAX__ 6.55040000000000000000000000000000000e+4F16 +//#define __FLT32_DECIMAL_DIG__ 9 +//#define __FLT32_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F32 +//#define __FLT32_DIG__ 6 +//#define __FLT32_EPSILON__ 1.19209289550781250000000000000000000e-7F32 +//#define __FLT32_HAS_DENORM__ 1 +//#define __FLT32_HAS_INFINITY__ 1 +//#define __FLT32_HAS_QUIET_NAN__ 1 +//#define __FLT32_IS_IEC_60559__ 1 +//#define __FLT32_MANT_DIG__ 24 +//#define __FLT32_MAX_10_EXP__ 38 +//#define __FLT32_MAX__ 3.40282346638528859811704183484516925e+38F32 +//#define __FLT32_MAX_EXP__ 128 +//#define __FLT32_MIN_10_EXP__ (-37) +//#define __FLT32_MIN__ 1.17549435082228750796873653722224568e-38F32 +//#define __FLT32_MIN_EXP__ (-125) +//#define __FLT32_NORM_MAX__ 3.40282346638528859811704183484516925e+38F32 +//#define __FLT32X_DECIMAL_DIG__ 17 +//#define __FLT32X_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F32x +//#define __FLT32X_DIG__ 15 +//#define __FLT32X_EPSILON__ 2.22044604925031308084726333618164062e-16F32x +//#define __FLT32X_HAS_DENORM__ 1 +//#define __FLT32X_HAS_INFINITY__ 1 +//#define __FLT32X_HAS_QUIET_NAN__ 1 +//#define __FLT32X_IS_IEC_60559__ 1 +//#define __FLT32X_MANT_DIG__ 53 +//#define __FLT32X_MAX_10_EXP__ 308 +//#define __FLT32X_MAX__ 1.79769313486231570814527423731704357e+308F32x +//#define __FLT32X_MAX_EXP__ 1024 +//#define __FLT32X_MIN_10_EXP__ (-307) +//#define __FLT32X_MIN__ 2.22507385850720138309023271733240406e-308F32x +//#define __FLT32X_MIN_EXP__ (-1021) +//#define __FLT32X_NORM_MAX__ 1.79769313486231570814527423731704357e+308F32x +//#define __FLT64_DECIMAL_DIG__ 17 +//#define __FLT64_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F64 +//#define __FLT64_DIG__ 15 +//#define __FLT64_EPSILON__ 2.22044604925031308084726333618164062e-16F64 +//#define __FLT64_HAS_DENORM__ 1 +//#define __FLT64_HAS_INFINITY__ 1 +//#define __FLT64_HAS_QUIET_NAN__ 1 +//#define __FLT64_IS_IEC_60559__ 1 +//#define __FLT64_MANT_DIG__ 53 +//#define __FLT64_MAX_10_EXP__ 308 +//#define __FLT64_MAX__ 1.79769313486231570814527423731704357e+308F64 +//#define __FLT64_MAX_EXP__ 1024 +//#define __FLT64_MIN_10_EXP__ (-307) +//#define __FLT64_MIN__ 2.22507385850720138309023271733240406e-308F64 +//#define __FLT64_MIN_EXP__ (-1021) +//#define __FLT64_NORM_MAX__ 1.79769313486231570814527423731704357e+308F64 +//#define __FLT64X_DECIMAL_DIG__ 21 +//#define __FLT64X_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951F64x +//#define __FLT64X_DIG__ 18 +//#define __FLT64X_EPSILON__ 1.08420217248550443400745280086994171e-19F64x +//#define __FLT64X_HAS_DENORM__ 1 +//#define __FLT64X_HAS_INFINITY__ 1 +//#define __FLT64X_HAS_QUIET_NAN__ 1 +//#define __FLT64X_IS_IEC_60559__ 1 +//#define __FLT64X_MANT_DIG__ 64 +//#define __FLT64X_MAX_10_EXP__ 4932 +//#define __FLT64X_MAX__ 1.18973149535723176502126385303097021e+4932F64x +//#define __FLT64X_MAX_EXP__ 16384 +//#define __FLT64X_MIN_10_EXP__ (-4931) +//#define __FLT64X_MIN__ 3.36210314311209350626267781732175260e-4932F64x +//#define __FLT64X_MIN_EXP__ (-16381) +//#define __FLT64X_NORM_MAX__ 1.18973149535723176502126385303097021e+4932F64x +//#define __FLT128_DECIMAL_DIG__ 36 +//#define __FLT128_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966F128 +//#define __FLT128_DIG__ 33 +//#define __FLT128_EPSILON__ 1.92592994438723585305597794258492732e-34F128 +//#define __FLT128_HAS_DENORM__ 1 +//#define __FLT128_HAS_INFINITY__ 1 +//#define __FLT128_HAS_QUIET_NAN__ 1 +//#define __FLT128_IS_IEC_60559__ 1 +//#define __FLT128_MANT_DIG__ 113 +//#define __FLT128_MAX_10_EXP__ 4932 +//#define __FLT128_MAX__ 1.18973149535723176508575932662800702e+4932F128 +//#define __FLT128_MAX_EXP__ 16384 +//#define __FLT128_MIN_10_EXP__ (-4931) +//#define __FLT128_MIN__ 3.36210314311209350626267781732175260e-4932F128 +//#define __FLT128_MIN_EXP__ (-16381) +//#define __FLT128_NORM_MAX__ 1.18973149535723176508575932662800702e+4932F128 +#define __FLT_DECIMAL_DIG__ 9 +#define __FLT_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F +#define __FLT_DIG__ 6 +#define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F +#define __FLT_EVAL_METHOD__ 2 +#define __FLT_EVAL_METHOD_TS_18661_3__ 2 +#define __FLT_HAS_DENORM__ 1 +#define __FLT_HAS_INFINITY__ 1 +#define __FLT_HAS_QUIET_NAN__ 1 +#define __FLT_IS_IEC_60559__ 1 +#define __FLT_MANT_DIG__ 24 +#define __FLT_MAX_10_EXP__ 38 +#define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F +#define __FLT_MAX_EXP__ 128 +#define __FLT_MIN_10_EXP__ (-37) +#define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F +#define __FLT_MIN_EXP__ (-125) +#define __FLT_NORM_MAX__ 3.40282346638528859811704183484516925e+38F +#define __FLT_RADIX__ 2 +#define __LDBL_DECIMAL_DIG__ 21 +#define __LDBL_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951L +#define __LDBL_DIG__ 18 +#define __LDBL_EPSILON__ 1.08420217248550443400745280086994171e-19L +#define __LDBL_HAS_DENORM__ 1 +#define __LDBL_HAS_INFINITY__ 1 +#define __LDBL_HAS_QUIET_NAN__ 1 +#define __LDBL_IS_IEC_60559__ 1 +#define __LDBL_MANT_DIG__ 64 +#define __LDBL_MAX_10_EXP__ 4932 +#define __LDBL_MAX__ 1.18973149535723176502126385303097021e+4932L +#define __LDBL_MAX_EXP__ 16384 +#define __LDBL_MIN_10_EXP__ (-4931) +#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L +#define __LDBL_MIN_EXP__ (-16381) +#define __LDBL_NORM_MAX__ 1.18973149535723176502126385303097021e+4932L + +#include_next "stdc-predef.h" diff --git a/wrapperhelper/include-override/x86_64/bits/pthreadtypes-arch.h b/wrapperhelper/include-override/x86_64/bits/pthreadtypes-arch.h new file mode 100644 index 0000000..b23ff3b --- /dev/null +++ b/wrapperhelper/include-override/x86_64/bits/pthreadtypes-arch.h @@ -0,0 +1,55 @@ +/* Copyright (C) 2002-2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_PTHREADTYPES_ARCH_H +#define _BITS_PTHREADTYPES_ARCH_H 1 + +#include + +#ifdef __x86_64__ +# if __WORDSIZE == 64 +# define __SIZEOF_PTHREAD_MUTEX_T 40 +# define __SIZEOF_PTHREAD_ATTR_T 56 +# define __SIZEOF_PTHREAD_RWLOCK_T 56 +# define __SIZEOF_PTHREAD_BARRIER_T 32 +# else +# define __SIZEOF_PTHREAD_MUTEX_T 32 +# define __SIZEOF_PTHREAD_ATTR_T 32 +# define __SIZEOF_PTHREAD_RWLOCK_T 44 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +# endif +#else +# define __SIZEOF_PTHREAD_MUTEX_T 24 +# define __SIZEOF_PTHREAD_ATTR_T 36 +# define __SIZEOF_PTHREAD_RWLOCK_T 32 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +#endif +#define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +#define __SIZEOF_PTHREAD_COND_T 48 +#define __SIZEOF_PTHREAD_CONDATTR_T 4 +#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 4 + +#define __LOCK_ALIGNMENT +#define __ONCE_ALIGNMENT + +#ifndef __x86_64__ +/* Extra attributes for the cleanup functions. */ +# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1))) +#endif + +#endif /* bits/pthreadtypes.h */ diff --git a/wrapperhelper/include-override/x86_64/stdc-predef.h b/wrapperhelper/include-override/x86_64/stdc-predef.h new file mode 100644 index 0000000..5c1e4fe --- /dev/null +++ b/wrapperhelper/include-override/x86_64/stdc-predef.h @@ -0,0 +1,405 @@ +// C standard +#define __STDC__ 1 +#define __STDC_HOSTED__ 1 +#define __STDC_UTF_16__ 1 +#define __STDC_UTF_32__ 1 +#define __STDC_VERSION__ 201710L +// Generic x86_64 infos +#define __ELF__ 1 +#define __NO_INLINE__ 1 +#define __ORDER_BIG_ENDIAN__ 4321 +#define __ORDER_LITTLE_ENDIAN__ 1234 +#define __ORDER_PDP_ENDIAN__ 3412 +#define __PIC__ 2 +#define __pic__ 2 +#define __PIE__ 2 +#define __pie__ 2 +#define __USER_LABEL_PREFIX__ +#define __gnu_linux__ 1 +#define __linux__ 1 +#define __linux 1 +#define linux 1 +#define __unix__ 1 +#define __unix 1 +#define unix 1 +// GCC +//#define __GCC_ASM_FLAG_OUTPUTS__ 1 +//#define __GCC_ATOMIC_BOOL_LOCK_FREE 2 +//#define __GCC_ATOMIC_CHAR_LOCK_FREE 2 +//#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2 +//#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2 +//#define __GCC_ATOMIC_INT_LOCK_FREE 2 +//#define __GCC_ATOMIC_LLONG_LOCK_FREE 2 +//#define __GCC_ATOMIC_LONG_LOCK_FREE 2 +//#define __GCC_ATOMIC_POINTER_LOCK_FREE 2 +//#define __GCC_ATOMIC_SHORT_LOCK_FREE 2 +//#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1 +//#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2 +//#define __GCC_CONSTRUCTIVE_SIZE 64 +//#define __GCC_DESTRUCTIVE_SIZE 64 +//#define __GCC_HAVE_DWARF2_CFI_ASM 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 +//#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 +//#define __GCC_IEC_559 2 +//#define __GCC_IEC_559_COMPLEX 2 +//#define __GNUC__ 14 +//#define __GNUC_EXECUTION_CHARSET_NAME "UTF-8" +//#define __GNUC_MINOR__ 2 +//#define __GNUC_PATCHLEVEL__ 1 +//#define __GNUC_STDC_INLINE__ 1 +//#define __GNUC_WIDE_EXECUTION_CHARSET_NAME "UTF-32LE" +//#define __GXX_ABI_VERSION 1019 +//#define __PRAGMA_REDEFINE_EXTNAME 1 +//#define __VERSION__ "14.2.1 20240805" +// Specific x86_64 architecture +#define __FINITE_MATH_ONLY__ 0 +#define __HAVE_SPECULATION_SAFE_VALUE 1 +#define __LP64__ 1 +#define _LP64 1 +#define __REGISTER_PREFIX__ +#define __FXSR__ 1 +#define __MMX__ 1 +#define __MMX_WITH_SSE__ 1 +#define __SEG_FS 1 +#define __SEG_GS 1 +#define __SSE__ 1 +#define __SSE_MATH__ 1 +#define __SSE2__ 1 +#define __SSE2_MATH__ 1 +#define __SSP_STRONG__ 3 +#define __amd64__ 1 +#define __amd64 1 +#define __code_model_small__ 1 +#define __k8__ 1 +#define __k8 1 +#define __x86_64__ 1 +#define __x86_64 1 +// Atomic +#define __ATOMIC_RELAXED 0 +#define __ATOMIC_CONSUME 1 +#define __ATOMIC_ACQUIRE 2 +#define __ATOMIC_RELEASE 3 +#define __ATOMIC_ACQ_REL 4 +#define __ATOMIC_SEQ_CST 5 +#define __ATOMIC_HLE_ACQUIRE 65536 +#define __ATOMIC_HLE_RELEASE 131072 +// Metainfo on types +#define __BIGGEST_ALIGNMENT__ 16 +#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ +#define __CHAR_BIT__ 8 +#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__ +#define __SIZEOF_SHORT__ 2 +#define __SIZEOF_WCHAR_T__ 4 +#define __SIZEOF_INT__ 4 +#define __SIZEOF_WINT_T__ 4 +#define __SIZEOF_LONG__ 8 +#define __SIZEOF_LONG_LONG__ 8 +#define __SIZEOF_POINTER__ 8 +#define __SIZEOF_PTRDIFF_T__ 8 +#define __SIZEOF_SIZE_T__ 8 +#define __SIZEOF_INT128__ 16 +#define __SIZEOF_FLOAT__ 4 +#define __SIZEOF_DOUBLE__ 8 +#define __SIZEOF_LONG_DOUBLE__ 16 +#define __SIZEOF_FLOAT80__ 16 +#define __SIZEOF_FLOAT128__ 16 +// Integers +//#define __BITINT_MAXWIDTH__ 65535 +//#define __CHAR16_TYPE__ short unsigned int +//#define __CHAR32_TYPE__ unsigned int +//#define __INT8_C(c) c +#define __INT8_MAX__ 0x7f +//#define __INT8_TYPE__ signed char +//#define __INT16_C(c) c +#define __INT16_MAX__ 0x7fff +//#define __INT16_TYPE__ short int +//#define __INT32_C(c) c +#define __INT32_MAX__ 0x7fffffff +//#define __INT32_TYPE__ int +//#define __INT64_C(c) c ## L +#define __INT64_MAX__ 0x7fffffffffffffffL +//#define __INT64_TYPE__ long int +#define __INT_FAST8_MAX__ 0x7f +//#define __INT_FAST8_TYPE__ signed char +#define __INT_FAST8_WIDTH__ 8 +#define __INT_FAST16_MAX__ 0x7fffffffffffffffL +//#define __INT_FAST16_TYPE__ long int +#define __INT_FAST16_WIDTH__ 64 +#define __INT_FAST32_MAX__ 0x7fffffffffffffffL +//#define __INT_FAST32_TYPE__ long int +#define __INT_FAST32_WIDTH__ 64 +#define __INT_FAST64_MAX__ 0x7fffffffffffffffL +//#define __INT_FAST64_TYPE__ long int +#define __INT_FAST64_WIDTH__ 64 +#define __INT_LEAST8_MAX__ 0x7f +//#define __INT_LEAST8_TYPE__ signed char +#define __INT_LEAST8_WIDTH__ 8 +#define __INT_LEAST16_MAX__ 0x7fff +//#define __INT_LEAST16_TYPE__ short int +#define __INT_LEAST16_WIDTH__ 16 +#define __INT_LEAST32_MAX__ 0x7fffffff +//#define __INT_LEAST32_TYPE__ int +#define __INT_LEAST32_WIDTH__ 32 +#define __INT_LEAST64_MAX__ 0x7fffffffffffffffL +//#define __INT_LEAST64_TYPE__ long int +#define __INT_LEAST64_WIDTH__ 64 +#define __INT_MAX__ 0x7fffffff +#define __INT_WIDTH__ 32 +#define __INTMAX_C(c) c ## L +#define __INTMAX_MAX__ 0x7fffffffffffffffL +//#define __INTMAX_TYPE__ long int +#define __INTMAX_WIDTH__ 64 +#define __INTPTR_MAX__ 0x7fffffffffffffffL +//#define __INTPTR_TYPE__ long int +#define __INTPTR_WIDTH__ 64 +#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL +#define __LONG_LONG_WIDTH__ 64 +#define __LONG_MAX__ 0x7fffffffffffffffL +#define __LONG_WIDTH__ 64 +#define __PTRDIFF_MAX__ 0x7fffffffffffffffL +//#define __PTRDIFF_TYPE__ long int +#define __PTRDIFF_WIDTH__ 64 +#define __SCHAR_MAX__ 0x7f +#define __SCHAR_WIDTH__ 8 +#define __SHRT_MAX__ 0x7fff +#define __SHRT_WIDTH__ 16 +#define __SIG_ATOMIC_MAX__ 0x7fffffff +#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1) +//#define __SIG_ATOMIC_TYPE__ int +#define __SIG_ATOMIC_WIDTH__ 32 +#define __SIZE_MAX__ 0xffffffffffffffffUL +//#define __SIZE_TYPE__ long unsigned int +#define __SIZE_WIDTH__ 64 +#define __UINT8_C(c) c +#define __UINT8_MAX__ 0xff +//#define __UINT8_TYPE__ unsigned char +#define __UINT16_C(c) c +#define __UINT16_MAX__ 0xffff +//#define __UINT16_TYPE__ short unsigned int +#define __UINT32_C(c) c ## U +#define __UINT32_MAX__ 0xffffffffU +//#define __UINT32_TYPE__ unsigned int +#define __UINT64_C(c) c ## UL +#define __UINT64_MAX__ 0xffffffffffffffffUL +//#define __UINT64_TYPE__ long unsigned int +#define __UINT_FAST8_MAX__ 0xff +//#define __UINT_FAST8_TYPE__ unsigned char +#define __UINT_FAST16_MAX__ 0xffffffffffffffffUL +//#define __UINT_FAST16_TYPE__ long unsigned int +#define __UINT_FAST32_MAX__ 0xffffffffffffffffUL +//#define __UINT_FAST32_TYPE__ long unsigned int +#define __UINT_FAST64_MAX__ 0xffffffffffffffffUL +//#define __UINT_FAST64_TYPE__ long unsigned int +#define __UINT_LEAST8_MAX__ 0xff +//#define __UINT_LEAST8_TYPE__ unsigned char +#define __UINT_LEAST16_MAX__ 0xffff +//#define __UINT_LEAST16_TYPE__ short unsigned int +#define __UINT_LEAST32_MAX__ 0xffffffffU +//#define __UINT_LEAST32_TYPE__ unsigned int +#define __UINT_LEAST64_MAX__ 0xffffffffffffffffUL +//#define __UINT_LEAST64_TYPE__ long unsigned int +#define __UINTMAX_C(c) c ## UL +#define __UINTMAX_MAX__ 0xffffffffffffffffUL +//#define __UINTMAX_TYPE__ long unsigned int +#define __UINTPTR_MAX__ 0xffffffffffffffffUL +//#define __UINTPTR_TYPE__ long unsigned int +#define __WCHAR_MAX__ 0x7fffffff +#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1) +//#define __WCHAR_TYPE__ int +#define __WCHAR_WIDTH__ 32 +#define __WINT_MAX__ 0xffffffffU +#define __WINT_MIN__ 0U +//#define __WINT_TYPE__ unsigned int +#define __WINT_WIDTH__ 32 +// Floats +//#define __BFLT16_DECIMAL_DIG__ 4 +//#define __BFLT16_DENORM_MIN__ 9.18354961579912115600575419704879436e-41BF16 +//#define __BFLT16_DIG__ 2 +//#define __BFLT16_EPSILON__ 7.81250000000000000000000000000000000e-3BF16 +//#define __BFLT16_HAS_DENORM__ 1 +//#define __BFLT16_HAS_INFINITY__ 1 +//#define __BFLT16_HAS_QUIET_NAN__ 1 +//#define __BFLT16_IS_IEC_60559__ 0 +//#define __BFLT16_MANT_DIG__ 8 +//#define __BFLT16_MAX_10_EXP__ 38 +//#define __BFLT16_MAX__ 3.38953138925153547590470800371487867e+38BF16 +//#define __BFLT16_MAX_EXP__ 128 +//#define __BFLT16_MIN_10_EXP__ (-37) +//#define __BFLT16_MIN__ 1.17549435082228750796873653722224568e-38BF16 +//#define __BFLT16_MIN_EXP__ (-125) +//#define __BFLT16_NORM_MAX__ 3.38953138925153547590470800371487867e+38BF16 +#define __DBL_DECIMAL_DIG__ 17 +#define __DBL_DENORM_MIN__ ((double)4.94065645841246544176568792868221372e-324L) +#define __DBL_DIG__ 15 +#define __DBL_EPSILON__ ((double)2.22044604925031308084726333618164062e-16L) +#define __DBL_HAS_DENORM__ 1 +#define __DBL_HAS_INFINITY__ 1 +#define __DBL_HAS_QUIET_NAN__ 1 +#define __DBL_IS_IEC_60559__ 1 +#define __DBL_MANT_DIG__ 53 +#define __DBL_MAX_10_EXP__ 308 +#define __DBL_MAX__ ((double)1.79769313486231570814527423731704357e+308L) +#define __DBL_MAX_EXP__ 1024 +#define __DBL_MIN_10_EXP__ (-307) +#define __DBL_MIN__ ((double)2.22507385850720138309023271733240406e-308L) +#define __DBL_MIN_EXP__ (-1021) +#define __DBL_NORM_MAX__ ((double)1.79769313486231570814527423731704357e+308L) +//#define __DEC32_EPSILON__ 1E-6DF +//#define __DEC32_MANT_DIG__ 7 +//#define __DEC32_MAX__ 9.999999E96DF +//#define __DEC32_MAX_EXP__ 97 +//#define __DEC32_MIN__ 1E-95DF +//#define __DEC32_MIN_EXP__ (-94) +//#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF +//#define __DEC64_EPSILON__ 1E-15DD +//#define __DEC64_MANT_DIG__ 16 +//#define __DEC64_MAX__ 9.999999999999999E384DD +//#define __DEC64_MAX_EXP__ 385 +//#define __DEC64_MIN__ 1E-383DD +//#define __DEC64_MIN_EXP__ (-382) +//#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD +//#define __DEC128_EPSILON__ 1E-33DL +//#define __DEC128_MANT_DIG__ 34 +//#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL +//#define __DEC128_MAX_EXP__ 6145 +//#define __DEC128_MIN__ 1E-6143DL +//#define __DEC128_MIN_EXP__ (-6142) +//#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL +//#define __DEC_EVAL_METHOD__ 2 +//#define __DECIMAL_BID_FORMAT__ 1 +//#define __DECIMAL_DIG__ 21 +//#define __FLT16_DECIMAL_DIG__ 5 +//#define __FLT16_DENORM_MIN__ 5.96046447753906250000000000000000000e-8F16 +//#define __FLT16_DIG__ 3 +//#define __FLT16_EPSILON__ 9.76562500000000000000000000000000000e-4F16 +//#define __FLT16_HAS_DENORM__ 1 +//#define __FLT16_HAS_INFINITY__ 1 +//#define __FLT16_HAS_QUIET_NAN__ 1 +//#define __FLT16_IS_IEC_60559__ 1 +//#define __FLT16_MANT_DIG__ 11 +//#define __FLT16_MAX_10_EXP__ 4 +//#define __FLT16_MAX__ 6.55040000000000000000000000000000000e+4F16 +//#define __FLT16_MAX_EXP__ 16 +//#define __FLT16_MIN_10_EXP__ (-4) +//#define __FLT16_MIN__ 6.10351562500000000000000000000000000e-5F16 +//#define __FLT16_MIN_EXP__ (-13) +//#define __FLT16_NORM_MAX__ 6.55040000000000000000000000000000000e+4F16 +//#define __FLT32_DECIMAL_DIG__ 9 +//#define __FLT32_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F32 +//#define __FLT32_DIG__ 6 +//#define __FLT32_EPSILON__ 1.19209289550781250000000000000000000e-7F32 +//#define __FLT32_HAS_DENORM__ 1 +//#define __FLT32_HAS_INFINITY__ 1 +//#define __FLT32_HAS_QUIET_NAN__ 1 +//#define __FLT32_IS_IEC_60559__ 1 +//#define __FLT32_MANT_DIG__ 24 +//#define __FLT32_MAX_10_EXP__ 38 +//#define __FLT32_MAX__ 3.40282346638528859811704183484516925e+38F32 +//#define __FLT32_MAX_EXP__ 128 +//#define __FLT32_MIN_10_EXP__ (-37) +//#define __FLT32_MIN__ 1.17549435082228750796873653722224568e-38F32 +//#define __FLT32_MIN_EXP__ (-125) +//#define __FLT32_NORM_MAX__ 3.40282346638528859811704183484516925e+38F32 +//#define __FLT32X_DECIMAL_DIG__ 17 +//#define __FLT32X_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F32x +//#define __FLT32X_DIG__ 15 +//#define __FLT32X_EPSILON__ 2.22044604925031308084726333618164062e-16F32x +//#define __FLT32X_HAS_DENORM__ 1 +//#define __FLT32X_HAS_INFINITY__ 1 +//#define __FLT32X_HAS_QUIET_NAN__ 1 +//#define __FLT32X_IS_IEC_60559__ 1 +//#define __FLT32X_MANT_DIG__ 53 +//#define __FLT32X_MAX_10_EXP__ 308 +//#define __FLT32X_MAX__ 1.79769313486231570814527423731704357e+308F32x +//#define __FLT32X_MAX_EXP__ 1024 +//#define __FLT32X_MIN_10_EXP__ (-307) +//#define __FLT32X_MIN__ 2.22507385850720138309023271733240406e-308F32x +//#define __FLT32X_MIN_EXP__ (-1021) +//#define __FLT32X_NORM_MAX__ 1.79769313486231570814527423731704357e+308F32x +//#define __FLT64_DECIMAL_DIG__ 17 +//#define __FLT64_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F64 +//#define __FLT64_DIG__ 15 +//#define __FLT64_EPSILON__ 2.22044604925031308084726333618164062e-16F64 +//#define __FLT64_HAS_DENORM__ 1 +//#define __FLT64_HAS_INFINITY__ 1 +//#define __FLT64_HAS_QUIET_NAN__ 1 +//#define __FLT64_IS_IEC_60559__ 1 +//#define __FLT64_MANT_DIG__ 53 +//#define __FLT64_MAX_10_EXP__ 308 +//#define __FLT64_MAX__ 1.79769313486231570814527423731704357e+308F64 +//#define __FLT64_MAX_EXP__ 1024 +//#define __FLT64_MIN_10_EXP__ (-307) +//#define __FLT64_MIN__ 2.22507385850720138309023271733240406e-308F64 +//#define __FLT64_MIN_EXP__ (-1021) +//#define __FLT64_NORM_MAX__ 1.79769313486231570814527423731704357e+308F64 +//#define __FLT64X_DECIMAL_DIG__ 21 +//#define __FLT64X_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951F64x +//#define __FLT64X_DIG__ 18 +//#define __FLT64X_EPSILON__ 1.08420217248550443400745280086994171e-19F64x +//#define __FLT64X_HAS_DENORM__ 1 +//#define __FLT64X_HAS_INFINITY__ 1 +//#define __FLT64X_HAS_QUIET_NAN__ 1 +//#define __FLT64X_IS_IEC_60559__ 1 +//#define __FLT64X_MANT_DIG__ 64 +//#define __FLT64X_MAX_10_EXP__ 4932 +//#define __FLT64X_MAX__ 1.18973149535723176502126385303097021e+4932F64x +//#define __FLT64X_MAX_EXP__ 16384 +//#define __FLT64X_MIN_10_EXP__ (-4931) +//#define __FLT64X_MIN__ 3.36210314311209350626267781732175260e-4932F64x +//#define __FLT64X_MIN_EXP__ (-16381) +//#define __FLT64X_NORM_MAX__ 1.18973149535723176502126385303097021e+4932F64x +//#define __FLT128_DECIMAL_DIG__ 36 +//#define __FLT128_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966F128 +//#define __FLT128_DIG__ 33 +//#define __FLT128_EPSILON__ 1.92592994438723585305597794258492732e-34F128 +//#define __FLT128_HAS_DENORM__ 1 +//#define __FLT128_HAS_INFINITY__ 1 +//#define __FLT128_HAS_QUIET_NAN__ 1 +//#define __FLT128_IS_IEC_60559__ 1 +//#define __FLT128_MANT_DIG__ 113 +//#define __FLT128_MAX_10_EXP__ 4932 +//#define __FLT128_MAX__ 1.18973149535723176508575932662800702e+4932F128 +//#define __FLT128_MAX_EXP__ 16384 +//#define __FLT128_MIN_10_EXP__ (-4931) +//#define __FLT128_MIN__ 3.36210314311209350626267781732175260e-4932F128 +//#define __FLT128_MIN_EXP__ (-16381) +//#define __FLT128_NORM_MAX__ 1.18973149535723176508575932662800702e+4932F128 +#define __FLT_DECIMAL_DIG__ 9 +#define __FLT_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F +#define __FLT_DIG__ 6 +#define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F +#define __FLT_EVAL_METHOD__ 0 +#define __FLT_EVAL_METHOD_TS_18661_3__ 0 +#define __FLT_HAS_DENORM__ 1 +#define __FLT_HAS_INFINITY__ 1 +#define __FLT_HAS_QUIET_NAN__ 1 +#define __FLT_IS_IEC_60559__ 1 +#define __FLT_MANT_DIG__ 24 +#define __FLT_MAX_10_EXP__ 38 +#define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F +#define __FLT_MAX_EXP__ 128 +#define __FLT_MIN_10_EXP__ (-37) +#define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F +#define __FLT_MIN_EXP__ (-125) +#define __FLT_NORM_MAX__ 3.40282346638528859811704183484516925e+38F +#define __FLT_RADIX__ 2 +#define __LDBL_DECIMAL_DIG__ 21 +#define __LDBL_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951L +#define __LDBL_DIG__ 18 +#define __LDBL_EPSILON__ 1.08420217248550443400745280086994171e-19L +#define __LDBL_HAS_DENORM__ 1 +#define __LDBL_HAS_INFINITY__ 1 +#define __LDBL_HAS_QUIET_NAN__ 1 +#define __LDBL_IS_IEC_60559__ 1 +#define __LDBL_MANT_DIG__ 64 +#define __LDBL_MAX_10_EXP__ 4932 +#define __LDBL_MAX__ 1.18973149535723176502126385303097021e+4932L +#define __LDBL_MAX_EXP__ 16384 +#define __LDBL_MIN_10_EXP__ (-4931) +#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L +#define __LDBL_MIN_EXP__ (-16381) +#define __LDBL_NORM_MAX__ 1.18973149535723176502126385303097021e+4932L + +#include_next "stdc-predef.h" diff --git a/wrapperhelper/main.cpp b/wrapperhelper/main.cpp deleted file mode 100644 index b5a18a1..0000000 --- a/wrapperhelper/main.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "ast.h" -#include "utils.h" - -static void dump_usage() { - std::string Usage = R"usage( - usage: command [guest_triple] [host_triple] -- - : set the header file to be parsed - : set libname required for wrapping func - [guest_triple]: set guest triple: can be arm32/arm64/x86/x64, default is x64 - [host_triple] : set host triple: can be arm32/arm64/x86/x64, default is arm64 - -- : mandatory - : extra compiler flags - )usage"; - std::cerr << Usage << std::endl; -} - -std::string parse_triple(const char* arg) { - if (strcmp(arg, "x86") == 0) { - return "i386-pc-linux-gnu"; - } else if (strcmp(arg, "x64") == 0) { - return "x86_64-pc-linux-gnu"; - } else if (strcmp(arg, "arm32") == 0) { - return "armv7-unknown-linux-gnueabihf"; - } else if (strcmp(arg, "arm64") == 0) { - return "aarch64-unknown-linux-gnu"; - } else { - std::cerr << "Invalid triple: '" << arg << "'\n"; - dump_usage(); - return ""; - } -} - -int main(int argc, const char* argv[]) { - if (argc < 4) { - dump_usage(); - return 0; - } - std::string libname = argv[2]; - std::string guest_triple = parse_triple("x64"); - std::string host_triple = parse_triple("arm64"); - if (argc >= 5) { - guest_triple = parse_triple(argv[3]); - } - if (argc >= 6) { - host_triple = parse_triple(argv[4]); - } - bool has_necessary_tag = false; - for (int i = 0; i < argc; i++) { - if (strcmp(argv[i], "--") == 0) { - has_necessary_tag = true; - break; - } - } - if (!has_necessary_tag) { - std::cerr << "Please add '--' after the triples" << std::endl; - dump_usage(); - return 0; - } - std::string err; - auto compile_db = clang::tooling::FixedCompilationDatabase::loadFromCommandLine(argc, argv, err); - clang::tooling::ClangTool Tool(*compile_db, {argv[1]}); - Tool.appendArgumentsAdjuster([&guest_triple](const clang::tooling::CommandLineArguments &args, clang::StringRef) { - clang::tooling::CommandLineArguments adjusted_args = args; - adjusted_args.push_back(std::string{"-target"}); - adjusted_args.push_back(guest_triple); - return adjusted_args; - }); - return Tool.run(std::make_unique(libname, host_triple, guest_triple).get()); -} diff --git a/wrapperhelper/src/cstring.c b/wrapperhelper/src/cstring.c new file mode 100644 index 0000000..8dc18b8 --- /dev/null +++ b/wrapperhelper/src/cstring.c @@ -0,0 +1,165 @@ +#include "cstring.h" + +#include + +#define STRING_MIN_CAP 8 + +string_t *string_new(void) { + string_t *ret = malloc(sizeof(*ret)); + if (!ret) return NULL; + char *buf = malloc(sizeof(char)); + if (!buf) { + free(ret); + return NULL; + } + buf[0] = '\0'; + ret->ssize = ret->scap = 0; ret->buf = buf; + return ret; +} + +string_t *string_new_cap(size_t cap) { + string_t *ret = malloc(sizeof(*ret)); + if (!ret) return NULL; + cap = (cap < STRING_MIN_CAP) ? STRING_MIN_CAP : cap; + ret->buf = malloc((cap + 1) * sizeof(char)); + if (!ret->buf) { + free(ret); + return NULL; + } + ret->buf[0] = '\0'; + ret->scap = cap; + ret->ssize = 0; + return ret; +} + +string_t *string_new_cstr(const char *s) { + string_t *ret = malloc(sizeof(*ret)); + if (!ret) return NULL; + size_t len = strlen(s); + size_t cap = (len < STRING_MIN_CAP) ? STRING_MIN_CAP : len; + ret->buf = malloc((cap + 1) * sizeof(char)); + if (!ret->buf) { + free(ret); + return NULL; + } + strcpy(ret->buf, s); + ret->scap = cap; + ret->ssize = len; + return ret; +} + +int string_reserve(string_t *s, size_t cap) { + size_t new_cap = (cap < STRING_MIN_CAP) ? STRING_MIN_CAP : cap; + if (new_cap <= s->scap) return 1; + + void *new_buf = realloc(s->buf, sizeof(char) * (new_cap + 1)); + if (!new_buf) return 0; + s->buf = new_buf; + s->scap = new_cap; + return 1; +} +int string_reserve_grow(string_t *s, size_t cap) { + cap = (cap < STRING_MIN_CAP) ? STRING_MIN_CAP : cap; + if (cap <= s->scap) return 1; + size_t new_cap = (s->scap < STRING_MIN_CAP) ? STRING_MIN_CAP : s->scap * 2; + while (new_cap < cap) new_cap *= 2; + + void *new_buf = realloc(s->buf, sizeof(char) * (new_cap + 1)); + if (!new_buf) return 0; + s->buf = new_buf; + s->scap = new_cap; + return 1; +} + +int string_trim(string_t *s) { + if (s->ssize == s->scap) return 1; + void *new_buf = realloc(s->buf, sizeof(char) * (s->ssize + 1)); + if (!new_buf) return 0; + s->buf = new_buf; + s->scap = s->ssize; + return 1; +} + +void string_del(string_t *s) { + if (s->buf) free(s->buf); + free(s); +} + +char *string_steal(string_t *s) { + char *ret = s->buf; + free(s); + return ret; +} + +int string_add_char(string_t *s, char elem) { + if (!string_reserve_grow(s, s->ssize + 1)) return 0; + s->buf[s->ssize++] = elem; + s->buf[s->ssize] = '\0'; + return 1; +} + +int string_add_char_at(string_t *s, char elem, size_t idx) { + if (idx == s->ssize) return string_add_char(s, elem); + if (idx > s->ssize) return 0; + if (!string_reserve_grow(s, s->ssize + 1)) return 0; + memmove(s->buf + idx + 1, s->buf + idx, s->ssize + 1 - idx); + ++s->ssize; + s->buf[idx] = elem; + return 1; +} + +int string_add_string(string_t *s1, string_t *s2) { + if (!string_reserve_grow(s1, s1->ssize + s2->ssize)) return 0; + memcpy(s1->buf + s1->ssize, s2->buf, s2->ssize); + s1->ssize += s2->ssize; + s1->buf[s1->ssize] = '\0'; + return 1; +} + +int string_add_cstr(string_t *s1, const char *s2) { + size_t len = strlen(s2); + if (!string_reserve_grow(s1, s1->ssize + len)) return 0; + strcpy(s1->buf + s1->ssize, s2); + s1->ssize += len; + return 1; +} + +void string_pop(string_t *s) { + if (!s->ssize) return; + s->buf[--s->ssize] = '\0'; + if (s->ssize < s->scap / 4) { + size_t new_cap = (s->scap / 2 < STRING_MIN_CAP) ? STRING_MIN_CAP : s->scap / 2; + if (new_cap == s->scap) return; + void *new_buf = realloc(s->buf, sizeof(char) * (new_cap + 1)); + if (!new_buf) return; // We don't really care if the realloc fails, we just need to not update anything + s->buf = new_buf; + s->scap = new_cap; + } +} + +void string_clear(string_t *s) { + if (!s->ssize) return; + if (!s->scap) return; + s->buf[s->ssize = 0] = '\0'; + void *new_buf = realloc(s->buf, sizeof(char)); + if (!new_buf) return; // We don't really care if the realloc fails, we just need to not update anything + s->buf = new_buf; + s->scap = 0; +} + +string_t *string_dup(string_t const *s) { + string_t *ret = string_new_cap(s->ssize); + if (!ret) return NULL; + memcpy(ret->buf, s->buf, s->ssize + 1); + ret->ssize = s->ssize; + return ret; +} + +string_t *string_concat(string_t const *l, string_t const *r) { + string_t *ret = string_new_cap(l->ssize + r->ssize); + if (!ret) return NULL; + memcpy(ret->buf, l->buf, l->ssize); + memcpy(ret->buf + l->ssize, r->buf, r->ssize); + ret->buf[ret->ssize] = '\0'; + return ret; +} diff --git a/wrapperhelper/src/cstring.h b/wrapperhelper/src/cstring.h new file mode 100644 index 0000000..fdb0a71 --- /dev/null +++ b/wrapperhelper/src/cstring.h @@ -0,0 +1,88 @@ +#pragma once + +#ifndef STRING_H +#define STRING_H + +#include +#include +#include + +/** Thread-unsafe string implementation, with support for raw NULL bytes + * USAGE: + * ====== + * string_t ------------ The string type. + * string_new ---------- Creates a new string. + * string_new_cap ------ Creates a new string with a given capacity. Takes the capacity. + * string_new_cstr ----- Creates a new string from a given C string. Takes the string. + * string_reserve ------ Ensures a string has at least a given capacity. Takes the string and the capacity. + * string_trim --------- Ensures a string has a capacity equal to its length. Takes the string. May reduce the string capacity. + * string_del ---------- Frees a string. Takes the string. + * string_steal -------- Frees a string, keeping the content alive. Takes the string. The content (also returned) needs to be freed separately. + * string_add_char ----- Add a character at the end. Takes the string and the new character. May increase the string capacity. + * string_add_char_at -- Add a character at a given index. Takes the string, the new character and the index. May increase the string capacity. + * string_add_string --- Add a string at the end in-place. Takes both strings. May increase the string capacity. + * string_add_cstr ----- Add a C string at the end in-place. Takes both strings. May increase the string capacity. + * string_pop ---------- Pops the last character. Takes the string. May reduce the string capacity. + * string_clear -------- Clears the string. Takes the string. May reduce the string capacity. + * string_dup ---------- Duplicate a string. Takes the string. Does not free the old string. + * string_concat ------- Concatenate two strings. Takes both strings. Does not free any string. + * string_len ---------- String length. Takes the string. + * string_cap ---------- String capacity. Takes the string. + * string_content ------ Pointer to the string content. Valid C string. Takes the string. + * string_begin -------- Start of the string. Takes the string. + * string_end ---------- End of the string. Points to unmanaged memory. Takes the string. + * string_last --------- Last element of the string. Points to invalid memory if size is zero. Takes the string. + * string_for ---------- Iterate over the characters of a string. This is a for loop. Takes the iterator name and the string. + * + * EXAMPLE: + * ======== + * Source main.c: + * ------------------- +// ... +int main() { + string_t *str = string_new_cap(2); + if (!str) { + printf("Error: failed to allocate new string\n"); + return 2; + } + string_add_char(str, 'H'); // Cannot fail + string_add_char(str, 'i'); // Cannot fail + if (!string_add_char(str, '!')) { + printf("Error: failed to add char to string\n"); + return 2; + } + printf("String length: %zu: \"%s\"\n", string_len(str), string_content(str)); // 3, "Hi!" + string_del(str); +} + */ + +typedef struct string_s { + size_t ssize, scap; + char *buf; +} string_t; + +string_t *string_new(void); +string_t *string_new_cap(size_t cap); +string_t *string_new_cstr(const char *s); +int string_reserve(string_t *s, size_t cap); +int string_trim(string_t *s); +void string_del(string_t *s); +char *string_steal(string_t *s); +int string_add_char(string_t *s, char elem); +int string_add_char_at(string_t *s, char elem, size_t idx); +int string_add_string(string_t *s1, string_t *s2); +int string_add_cstr(string_t *s1, const char *s2); +void string_pop(string_t *s); +void string_clear(string_t *s); +string_t *string_dup(string_t const *s); +string_t *string_concat(string_t const *l, string_t const *r); +#define string_len(s) ((s)->ssize) +#define string_cap(s) ((s)->scap) +#define string_content(s) ((s)->buf) +#define string_begin(s) ((s)->buf) +#define string_end(s) ((s)->buf + (s)->ssize) +#define string_last(s) ((s)->buf[(s)->ssize - 1]) +#define string_for(itname, s) \ + for (char *itname = string_begin((s)); itname != string_end((s)); ++itname) + +#endif // STRING_H diff --git a/wrapperhelper/src/generator.c b/wrapperhelper/src/generator.c new file mode 100644 index 0000000..42eeb90 --- /dev/null +++ b/wrapperhelper/src/generator.c @@ -0,0 +1,1859 @@ +#include "generator.h" + +#include "lang.h" +#include "log.h" +#include "prepare.h" + +static const char *rft2str[8] = { + [RQT_FUN] = "", + [RQT_FUN_2] = "", + [RQT_FUN_MY] = " (my)", + [RQT_FUN_D] = " (D)", + [RQT_DATA] = "", + [RQT_DATAB] = " (B)", + [RQT_DATAM] = " (my)", +}; +#define IS_RQT_FUN2(rty) (((rty) == RQT_FUN_2) || ((rty) == RQT_FUN_D)) +#define IS_RQT_FUNCTION(rty) ((rty) < RQT_DATA) + +void request_print(const request_t *req) { + printf("%s%s: %sdefault", string_content(req->obj_name), req->weak ? " (weak)" : "", req->default_comment ? "commented " : ""); + switch (req->def.rty) { + case RQT_FUN: + case RQT_FUN_2: + case RQT_FUN_MY: + case RQT_FUN_D: + if (req->def.fun.typ) { + printf(" function%s%s %s%s%s", + rft2str[req->def.rty], + req->def.fun.needs_S ? " (with S)" : "", + string_content(req->def.fun.typ), + req->def.fun.fun2 ? " -> " : "", + req->def.fun.fun2 ? string_content(req->def.fun.fun2) : ""); + } else { + printf(" untyped function%s%s", rft2str[req->def.rty], req->def.fun.needs_S ? " (with S)" : ""); + } + break; + case RQT_DATA: + case RQT_DATAB: + case RQT_DATAM: + if (req->def.dat.has_size) { + printf(" data%s %zu", rft2str[req->def.rty], req->def.dat.sz); + } else { + printf(" unsized data%s", rft2str[req->def.rty]); + } + break; + } + if (req->has_val) { + printf(" => solved"); + switch (req->val.rty) { + case RQT_FUN: + case RQT_FUN_2: + case RQT_FUN_MY: + case RQT_FUN_D: + if (req->val.fun.typ) { + printf(" function%s%s %s%s%s", + rft2str[req->val.rty], + req->val.fun.needs_S ? " (with S)" : "", + string_content(req->val.fun.typ), + req->val.fun.fun2 ? " -> " : "", + req->val.fun.fun2 ? string_content(req->val.fun.fun2) : ""); + } else { + printf(" untyped function%s%s", rft2str[req->val.rty], req->val.fun.needs_S ? " (with S)" : ""); + } + break; + case RQT_DATA: + case RQT_DATAB: + case RQT_DATAM: + if (req->val.dat.has_size) { + printf(" data%s %zu", rft2str[req->val.rty], req->val.dat.sz); + } else { + printf(" unsized data%s", rft2str[req->val.rty]); + } + break; + } + } + printf("\n"); +} +void request_print_check(const request_t *req) { + if (req->ignored) { + return; + } + if (!req->has_val) { + // printf("%s: no value\n", string_content(req->obj_name)); + return; + } + if ((IS_RQT_FUNCTION(req->def.rty) != IS_RQT_FUNCTION(req->val.rty))) { + printf("%s: conflict: %s data, %s function\n", + string_content(req->obj_name), + IS_RQT_FUNCTION(req->def.rty) ? "is" : "was", + IS_RQT_FUNCTION(req->def.rty) ? "was" : "is"); + return; + } + if (IS_RQT_FUNCTION(req->def.rty) && !req->def.fun.typ) return; // No default (function) + if (!IS_RQT_FUNCTION(req->def.rty) && !req->def.dat.has_size) return; // No default (data) + // We have a default and a value, both are functions or data + int similar; + switch (req->def.rty) { + case RQT_FUN: + case RQT_FUN_2: + case RQT_FUN_MY: + case RQT_FUN_D: + similar = !req->default_comment || (req->val.rty != RQT_FUN); // From comment to no comment is dissimilar + if (similar && (req->def.rty != req->val.rty)) similar = 0; + if (similar && strcmp(string_content(req->def.fun.typ), string_content(req->val.fun.typ))) { + // "//GOM(_, .F...)" == "//GOM(_, .FE...)" + similar = req->default_comment + && (req->def.rty == RQT_FUN_MY) + && !strncmp(string_content(req->def.fun.typ), string_content(req->val.fun.typ), 2) + && (string_content(req->val.fun.typ)[2] == 'E') + && !strcmp(string_content(req->def.fun.typ) + 2, string_content(req->val.fun.typ) + 3); + } + if (!similar) { + printf("%s%s: function with %s%sdefault%s%s%s%s%s%s and dissimilar %ssolved%s%s%s%s%s%s\n", + string_content(req->obj_name), + req->weak ? " (weak)" : "", + req->default_comment ? "commented " : "", + req->def.fun.typ ? "" : "untyped ", + rft2str[req->def.rty], + req->def.fun.needs_S ? " (with S)" : "", + req->def.fun.typ ? " " : "", + string_content(req->def.fun.typ), + req->def.fun.fun2 ? " -> " : "", + req->def.fun.fun2 ? string_content(req->def.fun.fun2) : "", + req->val.fun.typ ? "" : "untyped ", + rft2str[req->val.rty], + req->val.fun.needs_S ? " (with S)" : "", + req->val.fun.typ ? " " : "", + string_content(req->val.fun.typ), + req->val.fun.fun2 ? " -> " : "", + req->val.fun.fun2 ? string_content(req->val.fun.fun2) : ""); + } + break; + case RQT_DATA: + case RQT_DATAB: + case RQT_DATAM: + similar = 1; + if (similar && (req->def.rty != req->val.rty)) similar = 0; + if (similar && (!!req->def.dat.has_size != !!req->val.dat.has_size)) similar = 0; + if (similar && req->def.dat.has_size && (req->def.dat.sz != req->val.dat.sz)) similar = 0; + if (!similar) { + printf("%s%s: data with %s%sdefault%s", + string_content(req->obj_name), + req->weak ? " (weak)" : "", + req->default_comment ? "commented " : "", + req->def.fun.typ ? "" : "untyped ", + rft2str[req->def.rty]); + if (req->def.dat.has_size) { + printf(" %zu", req->def.dat.sz); + } else { + printf(" unsized"); + } + printf(" and dissimilar %ssolved%s", + req->val.fun.typ ? "" : "untyped ", + rft2str[req->val.rty]); + if (req->val.dat.has_size) { + printf(" %zu", req->val.dat.sz); + } else { + printf(" unsized"); + } + printf("\n"); + } + break; + } +} +void references_print_check(const VECTOR(references) *refs) { + vector_for(references, ref, refs) { + if (ref->typ == REF_REQ) request_print_check(&ref->req); + } +} + +static void request_del(request_t *req) { + string_del(req->obj_name); + switch (req->def.rty) { + case RQT_FUN: if (req->def.fun.typ) string_del(req->def.fun.typ); break; + case RQT_FUN_2: if (req->def.fun.typ) string_del(req->def.fun.typ); if (req->def.fun.fun2) string_del(req->def.fun.fun2); break; + case RQT_FUN_MY: if (req->def.fun.typ) string_del(req->def.fun.typ); break; + case RQT_FUN_D: if (req->def.fun.typ) string_del(req->def.fun.typ); if (req->def.fun.fun2) string_del(req->def.fun.fun2); break; + case RQT_DATA: break; + case RQT_DATAB: break; + case RQT_DATAM: break; + } + if (req->has_val) { + switch (req->val.rty) { + case RQT_FUN: string_del(req->val.fun.typ); break; + case RQT_FUN_2: string_del(req->val.fun.typ); string_del(req->val.fun.fun2); break; + case RQT_FUN_MY: string_del(req->val.fun.typ); break; + case RQT_FUN_D: string_del(req->val.fun.typ); string_del(req->val.fun.fun2); break; + case RQT_DATA: break; + case RQT_DATAB: break; + case RQT_DATAM: break; + } + } +} +static void reference_del(reference_t *ref) { + switch (ref->typ) { + case REF_REQ: + request_del(&ref->req); + break; + case REF_LINE: + case REF_IFDEF: + case REF_IFNDEF: + string_del(ref->line); + break; + case REF_ELSE: + case REF_ENDIF: + break; + } +} + +static int valid_reqtype(string_t *t) { + const char *s = string_content(t); + if (!((s[0] >= 'A') && (s[0] <= 'Z')) && !((s[0] >= 'a') && (s[0] <= 'z'))) return 0; + if (s[1] != 'F') return 0; + for (size_t i = 2; i < string_len(t); ++i) { + if (!((s[i] >= 'A') && (s[i] <= 'Z')) && !((s[i] >= 'a') && (s[i] <= 'z'))) return 0; + } + return 1; +} +static const char *rqt_suffix[8] = { + [RQT_FUN] = "", + [RQT_FUN_2] = "2", + [RQT_FUN_MY] = "M", + [RQT_FUN_D] = "D", + [RQT_DATA] = "", + [RQT_DATAB] = "B", + [RQT_DATAM] = "M", +}; + +static void request_output(FILE *f, const request_t *req) { + if (!req->has_val) { + if (IS_RQT_FUNCTION(req->def.rty)) { + if (!req->def.fun.typ) { + fprintf(f, "//GO%s%s%s(%s, \n", + req->weak ? "W" : "", + req->def.fun.needs_S ? "S" : "", + rqt_suffix[req->def.rty], + string_content(req->obj_name)); + } else { + fprintf(f, "%sGO%s%s%s(%s, %s%s%s%s%s)%s\n", + req->default_comment ? "//" : "", + req->weak ? "W" : "", + req->def.fun.needs_S ? "S" : "", + rqt_suffix[req->def.rty], + string_content(req->obj_name), + valid_reqtype(req->def.fun.typ) ? "" : "\"", + string_content(req->def.fun.typ), + valid_reqtype(req->def.fun.typ) ? "" : "\"", + IS_RQT_FUN2(req->def.rty) ? ", " : "", + IS_RQT_FUN2(req->def.rty) ? string_content(req->def.fun.fun2) : "", + (req->ignored || req->default_comment) ? "" : " // Warning: failed to confirm"); + } + } else { + if (req->def.dat.has_size) { + fprintf(f, "%sDATA%s%s(%s, %zu)%s\n", + req->default_comment ? "//" : "", + req->weak ? "V" : "", + rqt_suffix[req->def.rty], + string_content(req->obj_name), + req->def.dat.sz, + (req->ignored || req->default_comment) ? "" : " // Warning: failed to confirm"); + } else { + fprintf(f, "//DATA%s%s(%s, \n", + req->weak ? "V" : "", + rqt_suffix[req->def.rty], + string_content(req->obj_name)); + } + } + } else { + if (IS_RQT_FUNCTION(req->val.rty)) { + int is_comment = + (IS_RQT_FUNCTION(req->def.rty) && req->def.fun.typ && !req->default_comment) + ? (req->val.rty != req->def.rty) : (req->val.rty != RQT_FUN); + fprintf(f, "%sGO%s%s%s(%s, %s%s%s)\n", + is_comment ? "//" : "", + req->weak ? "W" : "", + req->val.fun.needs_S ? "S" : "", + rqt_suffix[req->val.rty], + string_content(req->obj_name), + string_content(req->val.fun.typ), + IS_RQT_FUN2(req->val.rty) ? ", " : "", + IS_RQT_FUN2(req->val.rty) ? req->val.fun.fun2 ? string_content(req->val.fun.fun2) : "" : ""); + } else { + if (req->val.dat.has_size) { + int is_comment = IS_RQT_FUNCTION(req->def.rty) || !req->def.dat.has_size || req->default_comment || (req->def.rty != req->val.rty); + fprintf(f, "%sDATA%s%s(%s, %zu)\n", + is_comment ? "//" : "", + req->weak ? "V" : "", + rqt_suffix[req->val.rty], + string_content(req->obj_name), + req->val.dat.sz); + } else { + fprintf(f, "//DATA%s%s(%s, \n", + req->weak ? "V" : "", + rqt_suffix[req->val.rty], + string_content(req->obj_name)); + } + } + } +} +static void reference_output(FILE *f, const reference_t *ref) { + switch (ref->typ) { + case REF_REQ: + request_output(f, &ref->req); + break; + case REF_LINE: + fputs(string_content(ref->line), f); + fputc('\n', f); + break; + case REF_IFDEF: + fprintf(f, "#ifdef %s\n", string_content(ref->line)); + break; + case REF_IFNDEF: + fprintf(f, "#ifndef %s\n", string_content(ref->line)); + break; + case REF_ELSE: + fputs("#else\n", f); + break; + case REF_ENDIF: + fputs("#endif\n", f); + break; + } +} +void output_from_references(FILE *f, const VECTOR(references) *refs) { + fprintf(f, "#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))\n#error Meh...\n#endif\n"); + vector_for(references, ref, refs) { + reference_output(f, ref); + } +} + +VECTOR_IMPL(references, reference_del) + +VECTOR(references) *references_from_file(const char *filename, FILE *f) { + prepare_t *prep = prepare_new_file(f, filename); + if (!prep) { + log_memory("failed to create the prepare structure for the reference file\n"); + return NULL; + } + + VECTOR(references) *ret = vector_new(references); + if (!ret) { + log_memory("failed to create a new reference vector\n"); + prepare_del(prep); + return NULL; + } + + int lineno = 1; + + // Ignore the first 3 lines + preproc_token_t tok; + do { + tok = pre_next_token(prep, 0); + if (tok.tokt == PPTOK_NEWLINE) ++lineno; + else preproc_token_del(&tok); // NEWLINE has no destructor + } while (!preproc_token_isend(&tok) && (lineno < 4)); + + // TODO: better conditionals handling + // Also, for now assume we have no definition + int if_depth = 0, entered_depth = 0; + string_t *line = string_new(); + if (!line) { + log_memory("failed to allocate new string for new reference line\n"); + } + +#define ADD_CHAR(c, has_destr, what) \ + if (!string_add_char(line, c)) { \ + log_memory("failed to add " what "\n"); \ + if (has_destr) preproc_token_del(&tok); \ + goto failed; \ + } +#define ADD_CSTR(cstr, has_destr, what) \ + if (!string_add_cstr(line, cstr)) { \ + log_memory("failed to add " what "\n"); \ + if (has_destr) preproc_token_del(&tok); \ + goto failed; \ + } +#define ADD_STR(str, has_destr, what) \ + if (!string_add_string(line, str)) { \ + log_memory("failed to add " what "\n"); \ + if (has_destr) preproc_token_del(&tok); \ + goto failed; \ + } +#define PUSH_LINE(has_destr) \ + string_trim(line); \ + if (!vector_push(references, ret, ((reference_t){.typ = REF_LINE, .line = line}))) { \ + log_memory("failed to memorize reference line %d\n", lineno); \ + if (has_destr) preproc_token_del(&tok); \ + goto failed; \ + } \ + line = string_new(); \ + if (!line) { \ + log_memory("failed to allocate new string for new reference line\n"); \ + } + + while (1) { + int is_comment = 0; + tok = pre_next_token(prep, 1); + if (tok.tokt == PPTOK_START_LINE_COMMENT) { + ADD_CSTR("//", 0, "start of comment") + is_comment = 1; + // Empty destructor + tok = pre_next_token(prep, 0); // tok is IDENT, NEWLINE, INVALID or BLANK + while ((tok.tokt == PPTOK_BLANK) && ((tok.tokv.c == ' ') || (tok.tokv.c == '\t'))) { + ADD_CHAR(tok.tokv.c, 0, "start of comment") + // Empty destructor + tok = pre_next_token(prep, 0); // tok is IDENT, NEWLINE, INVALID or BLANK + } + } + if ((tok.tokt == PPTOK_SYM) && (tok.tokv.sym == SYM_HASH)) { + string_clear(line); + tok = pre_next_token(prep, 0); + if (tok.tokt != PPTOK_IDENT) { + log_error(&tok.loginfo, "invalid reference file: invalid preprocessor line\n"); + preproc_token_del(&tok); + goto failed; + } + if (!strcmp(string_content(tok.tokv.str), "ifdef")) { + string_del(tok.tokv.str); + tok = pre_next_token(prep, 0); + if (tok.tokt != PPTOK_IDENT) { + log_error(&tok.loginfo, "invalid reference file: invalid '#ifdef' line\n"); + preproc_token_del(&tok); + goto failed; + } + ++if_depth; + if (!vector_push(references, ret, ((reference_t){.typ = REF_IFDEF, .line = tok.tokv.str}))) { + log_error(&tok.loginfo, "failed to memorize reference line %d\n", lineno); + string_del(tok.tokv.str); + goto failed; + } + tok = pre_next_token(prep, 0); + } else if (!strcmp(string_content(tok.tokv.str), "ifndef")) { + string_del(tok.tokv.str); + tok = pre_next_token(prep, 0); + if (tok.tokt != PPTOK_IDENT) { + log_error(&tok.loginfo, "invalid reference file: invalid '#ifndef' line\n"); + preproc_token_del(&tok); + goto failed; + } + if (if_depth == entered_depth) ++entered_depth; + ++if_depth; + if (!vector_push(references, ret, ((reference_t){.typ = REF_IFNDEF, .line = tok.tokv.str}))) { + log_error(&tok.loginfo, "failed to memorize reference line %d\n", lineno); + string_del(tok.tokv.str); + goto failed; + } + tok = pre_next_token(prep, 0); + } else if (!strcmp(string_content(tok.tokv.str), "else")) { + string_del(tok.tokv.str); + tok = pre_next_token(prep, 0); + if (if_depth == entered_depth + 1) ++entered_depth; + else if (if_depth == entered_depth) --entered_depth; + if (!vector_push(references, ret, ((reference_t){.typ = REF_ELSE}))) { + log_error(&tok.loginfo, "failed to memorize reference line %d\n", lineno); + goto failed; + } + } else if (!strcmp(string_content(tok.tokv.str), "endif")) { + string_del(tok.tokv.str); + tok = pre_next_token(prep, 0); + if (if_depth == entered_depth) --entered_depth; + --if_depth; + if (!vector_push(references, ret, ((reference_t){.typ = REF_ENDIF}))) { + log_error(&tok.loginfo, "failed to memorize reference line %d\n", lineno); + goto failed; + } + } else { + log_error(&tok.loginfo, "invalid reference file: invalid preprocessor command '%s'\n", string_content(tok.tokv.str)); + string_del(tok.tokv.str); + goto failed; + } + while (!preproc_token_isend(&tok) && (tok.tokt != PPTOK_NEWLINE)) { + preproc_token_del(&tok); + tok = pre_next_token(prep, 0); + } + ++lineno; + if (preproc_token_isend(&tok)) { + if (tok.tokt == PPTOK_EOF) goto success; + else { + preproc_token_del(&tok); + goto failed; + } + } + } else if (tok.tokt == PPTOK_NEWLINE) { + PUSH_LINE(0) + ++lineno; + } else if (tok.tokt == PPTOK_EOF) { + goto success; + } else if ((tok.tokt == PPTOK_IDENT) + && (!strcmp(string_content(tok.tokv.str), "GO") + || !strcmp(string_content(tok.tokv.str), "GO2") + || !strcmp(string_content(tok.tokv.str), "GOD") + || !strcmp(string_content(tok.tokv.str), "GOM") + || !strcmp(string_content(tok.tokv.str), "GOS") + || !strcmp(string_content(tok.tokv.str), "GOW") + || !strcmp(string_content(tok.tokv.str), "GOW2") + || !strcmp(string_content(tok.tokv.str), "GOWD") + || !strcmp(string_content(tok.tokv.str), "GOWM") + || !strcmp(string_content(tok.tokv.str), "GOWS"))) { + string_clear(line); + if (is_comment) prepare_mark_nocomment(prep); + int isweak = (string_content(tok.tokv.str)[2] == 'W'); + request_t req = { + .default_comment = is_comment, + .has_val = 0, + .ignored = 0, + .obj_name = NULL, + .weak = isweak, + .def = { + .rty = + (string_content(tok.tokv.str)[isweak ? 3 : 2] == '2') ? RQT_FUN_2 : + (string_content(tok.tokv.str)[isweak ? 3 : 2] == 'D') ? RQT_FUN_D : + (string_content(tok.tokv.str)[isweak ? 3 : 2] == 'M') ? RQT_FUN_MY : RQT_FUN, + .fun.needs_S = (string_content(tok.tokv.str)[isweak ? 3 : 2] == 'S'), + .fun.typ = NULL, + .fun.fun2 = NULL, + }, + .val = {0}, + }; + string_del(tok.tokv.str); + tok = pre_next_token(prep, 0); + if ((tok.tokt != PPTOK_SYM) || (tok.tokv.sym != SYM_LPAREN)) { + log_error(&tok.loginfo, "invalid reference file: invalid GO line %d (lparen)\n", lineno); + preproc_token_del(&tok); + goto failed; + } + // Empty destructor + tok = pre_next_token(prep, 0); + if (tok.tokt != PPTOK_IDENT) { + log_error(&tok.loginfo, "invalid reference file: invalid GO line %d (obj_name)\n", lineno); + preproc_token_del(&tok); + goto failed; + } + req.obj_name = tok.tokv.str; + // Token moved + tok = pre_next_token(prep, 0); + if ((tok.tokt != PPTOK_SYM) || (tok.tokv.sym != SYM_COMMA)) { + log_error(&tok.loginfo, "invalid reference file: invalid GO line %d (comma)\n", lineno); + string_del(req.obj_name); + preproc_token_del(&tok); + goto failed; + } + // Empty destructor + tok = pre_next_token(prep, 0); + if ((tok.tokt == PPTOK_IDENT) || (tok.tokt == PPTOK_STRING)) { + req.def.fun.typ = (tok.tokt == PPTOK_STRING) ? tok.tokv.sstr : tok.tokv.str; + // Token moved + tok = pre_next_token(prep, 0); + if ((req.def.rty == RQT_FUN_2) || (req.def.rty == RQT_FUN_D)) { + if ((tok.tokt != PPTOK_SYM) || (tok.tokv.sym != SYM_COMMA)) { + log_error(&tok.loginfo, "invalid reference file: invalid GO line %d (comma 2)\n", lineno); + string_del(req.obj_name); + string_del(req.def.fun.typ); + preproc_token_del(&tok); + goto failed; + } + // Empty destructor + tok = pre_next_token(prep, 0); + if (tok.tokt != PPTOK_IDENT) { + log_error(&tok.loginfo, "invalid reference file: invalid GO line %d (redirect)\n", lineno); + string_del(req.obj_name); + string_del(req.def.fun.typ); + preproc_token_del(&tok); + goto failed; + } + req.def.fun.fun2 = tok.tokv.str; + // Token moved + tok = pre_next_token(prep, 0); + } + if ((tok.tokt != PPTOK_SYM) || (tok.tokv.sym != SYM_RPAREN)) { + log_error(&tok.loginfo, "invalid reference file: invalid GO line %d (rparen)\n", lineno); + string_del(req.obj_name); + string_del(req.def.fun.typ); + if (req.def.fun.fun2) string_del(req.def.fun.fun2); + preproc_token_del(&tok); + goto failed; + } + // Empty destructor + tok = pre_next_token(prep, 0); + } + if (tok.tokt != PPTOK_NEWLINE) { + log_error(&tok.loginfo, "invalid reference file: invalid GO line %d (newline)\n", lineno); + string_del(req.obj_name); + if (req.def.fun.typ) string_del(req.def.fun.typ); + if (req.def.fun.fun2) string_del(req.def.fun.fun2); + preproc_token_del(&tok); + goto failed; + } + if (!vector_push(references, ret, ((reference_t){.typ = REF_REQ, .req = req}))) { + log_memory("failed to add reference for %s\n", string_content(req.obj_name)); + string_del(req.obj_name); + if (req.def.fun.typ) string_del(req.def.fun.typ); + if (req.def.fun.fun2) string_del(req.def.fun.fun2); + // Empty destructor + goto failed; + } + ++lineno; + } else if ((tok.tokt == PPTOK_IDENT) + && (!strcmp(string_content(tok.tokv.str), "DATA") + || !strcmp(string_content(tok.tokv.str), "DATAV") + || !strcmp(string_content(tok.tokv.str), "DATAB") + || !strcmp(string_content(tok.tokv.str), "DATAM"))) { + string_clear(line); + if (is_comment) prepare_mark_nocomment(prep); + int isweak = (string_content(tok.tokv.str)[4] == 'V'); + request_t req = { + .default_comment = is_comment, + .has_val = 0, + .ignored = 0, + .obj_name = NULL, + .weak = isweak, + .def = { + .rty = + (string_content(tok.tokv.str)[isweak ? 5 : 4] == 'B') ? RQT_DATAB : + (string_content(tok.tokv.str)[isweak ? 5 : 4] == 'M') ? RQT_DATAM : RQT_DATA, + .dat.has_size = 0, + .dat.sz = 0, + }, + .val = {0}, + }; + string_del(tok.tokv.str); + tok = pre_next_token(prep, 0); + if ((tok.tokt != PPTOK_SYM) || (tok.tokv.sym != SYM_LPAREN)) { + log_error(&tok.loginfo, "invalid reference file: invalid DATA line %d (lparen)\n", lineno); + preproc_token_del(&tok); + goto failed; + } + // Empty destructor + tok = pre_next_token(prep, 0); + if (tok.tokt != PPTOK_IDENT) { + log_error(&tok.loginfo, "invalid reference file: invalid DATA line %d (obj_name)\n", lineno); + preproc_token_del(&tok); + goto failed; + } + req.obj_name = tok.tokv.str; + // Token moved + tok = pre_next_token(prep, 0); + if ((tok.tokt != PPTOK_SYM) || (tok.tokv.sym != SYM_COMMA)) { + log_error(&tok.loginfo, "invalid reference file: invalid DATA line %d (comma)\n", lineno); + string_del(req.obj_name); + preproc_token_del(&tok); + goto failed; + } + // Empty destructor + tok = pre_next_token(prep, 0); + if (tok.tokt == PPTOK_NUM) { + num_constant_t cst; + // Assume target is 64 bits (box64) + if (!num_constant_convert(&tok.loginfo, tok.tokv.str, &cst, 0)) { + log_error(&tok.loginfo, "invalid reference file: invalid DATA line %d (num conversion)\n", lineno); + string_del(req.obj_name); + preproc_token_del(&tok); + goto failed; + } + switch (cst.typ) { + case NCT_FLOAT: + case NCT_DOUBLE: + case NCT_LDOUBLE: + log_error(&tok.loginfo, "invalid reference file: invalid DATA line %d (num conversion)\n", lineno); + string_del(req.obj_name); + string_del(tok.tokv.str); + goto failed; + case NCT_INT32: req.def.dat.sz = (size_t)cst.val.i32; break; + case NCT_UINT32: req.def.dat.sz = (size_t)cst.val.u32; break; + case NCT_INT64: req.def.dat.sz = (size_t)cst.val.i64; break; + case NCT_UINT64: req.def.dat.sz = (size_t)cst.val.u64; break; + } + req.def.dat.has_size = 1; + string_del(tok.tokv.str); // Delete token + tok = pre_next_token(prep, 0); + if ((tok.tokt != PPTOK_SYM) || (tok.tokv.sym != SYM_RPAREN)) { + log_error(&tok.loginfo, "invalid reference file: invalid DATA line %d (rparen)\n", lineno); + string_del(req.obj_name); + preproc_token_del(&tok); + goto failed; + } + // Empty destructor + tok = pre_next_token(prep, 0); + } + if (tok.tokt != PPTOK_NEWLINE) { + log_error(&tok.loginfo, "invalid reference file: invalid DATA line %d (newline)\n", lineno); + string_del(req.obj_name); + preproc_token_del(&tok); + goto failed; + } + if (!vector_push(references, ret, ((reference_t){.typ = REF_REQ, .req = req}))) { + log_memory("failed to add reference for %s\n", string_content(req.obj_name)); + request_del(&req); + // Empty destructor + goto failed; + } + ++lineno; + } else if (is_comment) { + if (tok.tokt == PPTOK_IDENT) { + ADD_STR(tok.tokv.str, 1, "comment content") + string_del(tok.tokv.str); + } else if (tok.tokt == PPTOK_BLANK) { + ADD_CHAR(tok.tokv.c, 0, "comment content") + } else { + log_error(&tok.loginfo, "unknown token type in comment %u\n", tok.tokt); + preproc_token_del(&tok); + goto failed; + } + if (!pre_next_newline_token(prep, line)) { + log_memory("failed to add comment content\n"); + goto failed; + } + PUSH_LINE(0) + ++lineno; + } else { + log_error(&tok.loginfo, "invalid reference file: invalid token:\n"); + preproc_token_print(&tok); + preproc_token_del(&tok); + goto failed; + } + } + +failed: + string_del(line); + prepare_del(prep); + vector_del(references, ret); + return NULL; + +success: + string_del(line); + prepare_del(prep); + return ret; +} + +// Simple versions (in practice, only use x86_64 and aarch64 as emu/target pair) +static int is_simple_type_ptr_to_simple(type_t *typ, int *needs_D, int *needs_my, khash_t(conv_map) *conv_map) { + if (typ->converted) { + // printf("Warning: %s uses a converted type but is not the converted type\n", string_content(obj_name)); + *needs_my = 1; + } else if (kh_get(conv_map, conv_map, typ) != kh_end(conv_map)) { + // printf("Warning: %s uses a converted type but is not the converted type\n", string_content(obj_name)); + *needs_my = 1; + } + switch (typ->typ) { + case TYPE_BUILTIN: + return 1; // Assume pointers to builtin are simple + case TYPE_ARRAY: + if (typ->val.array.array_sz == (size_t)-1) return 0; // VLA are not simple + return is_simple_type_ptr_to_simple(typ->val.array.typ, needs_D, needs_my, conv_map); + case TYPE_STRUCT_UNION: + if (typ->_internal_use) return 1; // Recursive structures are OK as long as every other members are OK + if (!typ->val.st->is_defined) return 1; // Undefined structures are OK since they are opaque + if (typ->val.st->is_simple) return 1; + typ->_internal_use = 1; + for (size_t i = 0; i < typ->val.st->nmembers; ++i) { + st_member_t *mem = &typ->val.st->members[i]; + if (!is_simple_type_ptr_to_simple(mem->typ, needs_D, needs_my, conv_map)) { + typ->_internal_use = 0; + return 0; + } + } + typ->_internal_use = 0; + return 1; + case TYPE_ENUM: + return is_simple_type_ptr_to_simple(typ->val.typ, needs_D, needs_my, conv_map); + case TYPE_PTR: + return is_simple_type_ptr_to_simple(typ->val.typ, needs_D, needs_my, conv_map); + case TYPE_FUNCTION: + *needs_my = 1; + return 1; + default: + printf("Error: is_simple_type_ptr_to_simple on unknown type %u\n", typ->typ); + return 0; + } +} +static int is_simple_type_simple(type_t *typ, int *needs_D, int *needs_my, khash_t(conv_map) *conv_map) { + if (typ->converted) { + // printf("Warning: %s uses a converted type but is not the converted type\n", string_content(obj_name)); + *needs_my = 1; + } else if (kh_get(conv_map, conv_map, typ) != kh_end(conv_map)) { + // printf("Warning: %s uses a converted type but is not the converted type\n", string_content(obj_name)); + *needs_my = 1; + } + switch (typ->typ) { + case TYPE_BUILTIN: + return (typ->val.builtin != BTT_FLOAT128) + && (typ->val.builtin != BTT_CFLOAT128) + && (typ->val.builtin != BTT_IFLOAT128); // Assume builtin are simple except for __float128 + case TYPE_ARRAY: + if (typ->val.array.array_sz == (size_t)-1) return 0; // VLA are not simple + return is_simple_type_ptr_to_simple(typ->val.array.typ, needs_D, needs_my, conv_map); + case TYPE_STRUCT_UNION: + if (typ->_internal_use) return 1; // Recursive structures are OK as long as every other members are OK + // if (!typ->val.st->is_defined) return 1; // Undefined structures are OK since they are opaque + // To be safe, don't allow opaque structures + if (!typ->val.st->is_defined) return 0; + typ->_internal_use = 1; + for (size_t i = 0; i < typ->val.st->nmembers; ++i) { + st_member_t *mem = &typ->val.st->members[i]; + if (!is_simple_type_simple(mem->typ, needs_D, needs_my, conv_map)) { + typ->_internal_use = 0; + return 0; + } + } + typ->_internal_use = 0; + return 1; + case TYPE_ENUM: + return is_simple_type_simple(typ->val.typ, needs_D, needs_my, conv_map); + case TYPE_PTR: + return is_simple_type_ptr_to_simple(typ->val.typ, needs_D, needs_my, conv_map); + case TYPE_FUNCTION: + // Functions should be handled differently (GO instead of DATA) + return 0; + default: + printf("Error: is_simple_type_simple on unknown type %u\n", typ->typ); + return 0; + } +} + +static int convert_type_simple(string_t *dest, type_t *emu_typ, type_t *target_typ, + int is_ret, int *needs_D, int *needs_my, khash_t(conv_map) *conv_map, string_t *obj_name) { + if (emu_typ->converted) { + if (!string_add_string(dest, emu_typ->converted)) { + printf("Error: failed to add explicit type conversion\n"); + return 0; + } + return 1; + } + khiter_t it = kh_get(conv_map, conv_map, emu_typ); + if (it != kh_end(conv_map)) { + if (!string_add_string(dest, kh_val(conv_map, it))) { + printf("Error: failed to add explicit type conversion\n"); + return 0; + } + return 1; + } + if ((emu_typ->is_atomic) || (target_typ->is_atomic)) { + printf("Error: TODO: convert_type_simple for atomic types\n"); + return 0; + } + if (emu_typ->typ != target_typ->typ) { + printf("Error: %s: %s type is different between emulated and target\n", string_content(obj_name), is_ret ? "return" : "argument"); + *needs_my = 1; + } + switch (emu_typ->typ) { + case TYPE_BUILTIN: { + int has_char = 0; + char c; + switch (emu_typ->val.builtin) { + case BTT_VOID: has_char = 1; c = 'v'; break; + case BTT_BOOL: has_char = 1; c = 'i'; break; + case BTT_CHAR: has_char = 1; c = 'c'; break; + case BTT_SCHAR: has_char = 1; c = 'c'; break; + case BTT_UCHAR: has_char = 1; c = 'C'; break; + case BTT_SHORT: has_char = 1; c = 'w'; break; + case BTT_SSHORT: has_char = 1; c = 'w'; break; + case BTT_USHORT: has_char = 1; c = 'W'; break; + case BTT_INT: has_char = 1; c = 'i'; break; + case BTT_SINT: has_char = 1; c = 'i'; break; + case BTT_UINT: has_char = 1; c = 'u'; break; + case BTT_LONG: has_char = 1; c = 'l'; break; + case BTT_SLONG: has_char = 1; c = 'l'; break; + case BTT_ULONG: has_char = 1; c = 'L'; break; + case BTT_LONGLONG: has_char = 1; c = 'I'; break; + case BTT_SLONGLONG: has_char = 1; c = 'I'; break; + case BTT_ULONGLONG: has_char = 1; c = 'U'; break; + case BTT_INT128: has_char = 1; c = 'H'; break; // TODO: Is 'H' for signed and unsigned? + case BTT_SINT128: has_char = 1; c = 'H'; break; // Is 'H' for signed and unsigned? + case BTT_UINT128: has_char = 1; c = 'H'; break; // Is 'H' for signed and unsigned? + case BTT_S8: has_char = 1; c = 'c'; break; + case BTT_U8: has_char = 1; c = 'C'; break; + case BTT_S16: has_char = 1; c = 'w'; break; + case BTT_U16: has_char = 1; c = 'W'; break; + case BTT_S32: has_char = 1; c = 'i'; break; + case BTT_U32: has_char = 1; c = 'u'; break; + case BTT_S64: has_char = 1; c = 'I'; break; + case BTT_U64: has_char = 1; c = 'U'; break; + case BTT_FLOAT: has_char = 1; c = 'f'; break; + case BTT_CFLOAT: has_char = 1; c = 'x'; break; + case BTT_IFLOAT: has_char = 1; c = 'f'; break; + case BTT_DOUBLE: has_char = 1; c = 'd'; break; + case BTT_CDOUBLE: has_char = 1; c = 'X'; break; + case BTT_IDOUBLE: has_char = 1; c = 'd'; break; + case BTT_LONGDOUBLE: *needs_D = 1; has_char = 1; c = 'D'; break; + case BTT_CLONGDOUBLE: *needs_D = 1; has_char = 1; c = 'Y'; break; + case BTT_ILONGDOUBLE: *needs_D = 1; has_char = 1; c = 'D'; break; + case BTT_FLOAT128: printf("Error: TODO: %s\n", builtin2str[emu_typ->val.builtin]); return 0; + case BTT_CFLOAT128: printf("Error: TODO: %s\n", builtin2str[emu_typ->val.builtin]); return 0; + case BTT_IFLOAT128: printf("Error: TODO: %s\n", builtin2str[emu_typ->val.builtin]); return 0; + case BTT_VA_LIST: *needs_my = 1; has_char = 1; c = 'A'; break; + default: + printf("Error: convert_type_simple on unknown builtin %u\n", emu_typ->val.builtin); + return 0; + } + if (has_char) { + if (!string_add_char(dest, c)) { + printf("Error: failed to add type char for %s\n", builtin2str[emu_typ->val.builtin]); + return 0; + } + return 1; + } else { + printf("Internal error: unknown state builtin=%u\n", emu_typ->val.builtin); + return 0; + } } + case TYPE_ARRAY: + printf("Error: convert_type_simple on raw array\n"); + return 0; + case TYPE_STRUCT_UNION: + if (!emu_typ->is_validated || emu_typ->is_incomplete) { + printf("Error: incomplete structure for %s\n", string_content(obj_name)); + return 0; + } + if (is_ret) { + if (emu_typ->szinfo.size <= 8) { + if (!string_add_char(dest, 'U')) { + printf("Error: failed to add type char for structure return\n"); + return 0; + } + return 1; + } else if (emu_typ->szinfo.size <= 16) { + if (!string_add_char(dest, 'H')) { + printf("Error: failed to add type char for large structure return\n"); + return 0; + } + return 1; + } else { + if (!string_add_char(dest, 'p')) { + printf("Error: failed to add type char for very large structure return\n"); + return 0; + } + return 1; + } + } else { + if ((emu_typ->val.st->nmembers == 1) && (target_typ->typ == TYPE_STRUCT_UNION) && (target_typ->val.st->nmembers == 1)) { + return convert_type_simple(dest, emu_typ->val.st->members[0].typ, target_typ->val.st->members[0].typ, is_ret, needs_D, needs_my, conv_map, obj_name); + } + printf("Error: TODO: convert_type_simple on structure as argument (%s)\n", string_content(obj_name)); + return 0; + } + case TYPE_ENUM: + if (target_typ->typ == TYPE_ENUM) { + return convert_type_simple(dest, emu_typ->val.typ, target_typ->val.typ, is_ret, needs_D, needs_my, conv_map, obj_name); + } else { + printf("Fatal: convert_type_simple(enum, non-enum)\n"); + return 0; + } + case TYPE_PTR: + if (is_simple_type_ptr_to_simple(emu_typ->val.typ, needs_D, needs_my, conv_map)) { + if (!string_add_char(dest, 'p')) { + printf("Error: failed to add type char for simple pointer\n"); + return 0; + } + return 1; + } else { + *needs_my = 1; + if (!string_add_char(dest, 'p')) { + printf("Error: failed to add type char for complex pointer\n"); + return 0; + } + return 1; + } + case TYPE_FUNCTION: + printf("Error: convert_type_simple on raw function\n"); + return 0; + default: + printf("Error: convert_type_simple on unknown type %u\n", emu_typ->typ); + return 0; + } +} +static int convert_type_post_simple(string_t *dest, type_t *emu_typ, type_t *target_typ, string_t *obj_name) { + if (emu_typ->converted) return 1; + if (emu_typ->is_atomic) { + printf("Error: TODO: convert_type_post_simple for atomic types\n"); + return 0; + } + (void)target_typ; + switch (emu_typ->typ) { + case TYPE_BUILTIN: return 1; + case TYPE_ARRAY: return 1; + case TYPE_STRUCT_UNION: + if (!emu_typ->is_validated || emu_typ->is_incomplete) { + printf("Error: incomplete structure for %s\n", string_content(obj_name)); + return 0; + } + if (emu_typ->szinfo.size <= 16) { + return 1; + } else { + if (!string_add_char(dest, 'p')) { + printf("Error: failed to add type char for very large structure return as parameter\n"); + return 0; + } + return 2; + } + case TYPE_ENUM: return 1; + case TYPE_PTR: return 1; + case TYPE_FUNCTION: return 1; + } + printf("Error: convert_type_post_simple on unknown type %u\n", emu_typ->typ); + return 0; +} + +int solve_request_simple(request_t *req, type_t *emu_typ, type_t *target_typ, khash_t(conv_map) *conv_map) { + if (emu_typ->typ != target_typ->typ) { + printf("Error: %s: emulated and target types are different (emulated is %u, target is %u)\n", + string_content(req->obj_name), emu_typ->typ, target_typ->typ); + return 0; + } + if (emu_typ->typ == TYPE_FUNCTION) { + int needs_D = 0, needs_my = req->def.fun.typ && (req->def.rty == RQT_FUN_MY), needs_2 = 0; + int convert_post; + size_t idx_conv; + req->val.fun.typ = string_new(); + if (!req->val.fun.typ) { + printf("Error: failed to create function type string\n"); + return 0; + } + if (!convert_type_simple(req->val.fun.typ, emu_typ->val.fun.ret, target_typ->val.fun.ret, 1, &needs_D, &needs_my, conv_map, req->obj_name)) + goto fun_fail; + idx_conv = string_len(req->val.fun.typ); + if (!string_add_char(req->val.fun.typ, 'F')) { + printf("Error: failed to add convention char\n"); + goto fun_fail; + } + convert_post = convert_type_post_simple(req->val.fun.typ, emu_typ->val.fun.ret, target_typ->val.fun.ret, req->obj_name); + if (!convert_post) goto fun_fail; + if (emu_typ->val.fun.nargs == (size_t)-1) { + printf("Warning: %s: assuming empty specification is void specification\n", string_content(req->obj_name)); + if (convert_post == 1) { + if (!string_add_char(req->val.fun.typ, 'v')) { + printf("Error: failed to add void specification char\n"); + goto fun_fail; + } + } + } else if (!emu_typ->val.fun.nargs && !emu_typ->val.fun.has_varargs) { + if (convert_post == 1) { + if (!string_add_char(req->val.fun.typ, 'v')) { + printf("Error: failed to add void specification char\n"); + goto fun_fail; + } + } + } else { + for (size_t i = 0; i < emu_typ->val.fun.nargs; ++i) { + if (!convert_type_simple(req->val.fun.typ, emu_typ->val.fun.args[i], target_typ->val.fun.args[i], 0, &needs_D, &needs_my, conv_map, req->obj_name)) + goto fun_fail; + } + if (emu_typ->val.fun.has_varargs) { + if (req->def.fun.typ + && (string_len(req->def.fun.typ) == string_len(req->val.fun.typ) + 1) + && !strncmp(string_content(req->def.fun.typ), string_content(req->val.fun.typ), string_len(req->val.fun.typ)) + && ((string_content(req->def.fun.typ)[string_len(req->val.fun.typ)] == 'M') + || (string_content(req->def.fun.typ)[string_len(req->val.fun.typ)] == 'N'))) { + if (!string_add_char(req->val.fun.typ, string_content(req->def.fun.typ)[string_len(req->val.fun.typ)])) { + printf("Error: failed to add type char '%c' for %s\n", + string_content(req->def.fun.typ)[string_len(req->val.fun.typ)], + builtin2str[emu_typ->val.builtin]); + goto fun_fail; + } + } else { + needs_my = 1; + if (!string_add_char(req->val.fun.typ, 'V')) { + printf("Error: failed to add type char 'V' for %s\n", builtin2str[emu_typ->val.builtin]); + goto fun_fail; + } + } + } + } + + // fun_succ: + // Add 'E' by default, unless we have the same function as before + if (needs_my && (req->default_comment + || (req->def.rty != RQT_FUN_MY) + || strcmp(string_content(req->def.fun.typ), string_content(req->val.fun.typ)))) { + if (!string_add_char_at(req->val.fun.typ, 'E', idx_conv + 1)) { + printf("Error: failed to add emu char\n"); + goto fun_fail; + } + } + if (req->def.fun.typ && (req->def.rty == RQT_FUN_2) && !needs_my) { + needs_2 = 1; + req->val.fun.fun2 = string_dup(req->def.fun.fun2); + if (!req->val.fun.fun2) { + printf("Error: failed to duplicate string (request for function %s with default redirection)\n", string_content(req->obj_name)); + return 0; + } + } else if (req->def.fun.typ && (req->def.rty == RQT_FUN_D) && !needs_my) { + needs_2 = 0; + req->val.fun.fun2 = string_dup(req->def.fun.fun2); + if (!req->val.fun.fun2) { + printf("Error: failed to duplicate string (request for function %s with long double types)\n", string_content(req->obj_name)); + return 0; + } + } else if (!needs_my && needs_D) { + req->val.fun.fun2 = string_new(); + if (!req->val.fun.fun2) { + printf("Error: failed to create empty string (request for function %s with long double types)\n", string_content(req->obj_name)); + return 0; + } + } + req->val.rty = + needs_my ? RQT_FUN_MY : + needs_2 ? RQT_FUN_2 : + needs_D ? RQT_FUN_D : RQT_FUN; + req->has_val = 1; + return 1; + + fun_fail: + string_del(req->val.fun.typ); + return 0; + } else { + int needs_D = 0, needs_my = req->def.dat.has_size && (req->def.rty == RQT_DATAM); + if (is_simple_type_simple(emu_typ, &needs_D, &needs_my, conv_map)) { + // TODO: Hmm... + req->val.rty = needs_my ? RQT_DATAM : (IS_RQT_FUNCTION(req->def.rty) ? RQT_DATA : req->def.rty); + req->val.dat.has_size = 1; + req->val.dat.sz = emu_typ->szinfo.size; + req->has_val = 1; + return 1; + } else { + log_TODO_nopos("solve_request_simple for data %s with non-simple type ", string_content(req->obj_name)); + type_print(emu_typ); + printf("\n"); + return 0; + } + } +} +int solve_request_map_simple(request_t *req, khash_t(decl_map) *emu_decl_map, khash_t(decl_map) *target_decl_map, khash_t(conv_map) *conv_map) { + int hasemu = 0, hastarget = 0; + khiter_t emuit, targetit; + emuit = kh_get(decl_map, emu_decl_map, string_content(req->obj_name)); + if (emuit == kh_end(emu_decl_map)) { + goto failed; + } + if ((kh_val(emu_decl_map, emuit)->storage == STORAGE_STATIC) || (kh_val(emu_decl_map, emuit)->storage == STORAGE_TLS_STATIC)) { + goto failed; + } + targetit = kh_get(decl_map, target_decl_map, string_content(req->obj_name)); + if (targetit == kh_end(target_decl_map)) { + goto failed; + } + if ((kh_val(target_decl_map, targetit)->storage == STORAGE_STATIC) || (kh_val(target_decl_map, targetit)->storage == STORAGE_TLS_STATIC)) { + goto failed; + } + return solve_request_simple(req, kh_val(emu_decl_map, emuit)->typ, kh_val(target_decl_map, targetit)->typ, conv_map); + +failed: + if (string_content(req->obj_name)[0] != '_') { + if (!hasemu && !hastarget) { + printf("Error: %s was not declared in the emulated and target architectures\n", string_content(req->obj_name)); + } else if (!hasemu) { + printf("Error: %s was not declared only in the emulated architecture\n", string_content(req->obj_name)); + } else if (!hastarget) { + printf("Error: %s was not declared only in the target architecture\n", string_content(req->obj_name)); + } else { + printf("Error: internal error: failed but found for %s\n", string_content(req->obj_name)); + } + } + return 0; +} +int solve_references_simple(VECTOR(references) *refs, khash_t(decl_map) *emu_decl_map, khash_t(decl_map) *target_decl_map, khash_t(conv_map) *conv_map) { + int ret = 1; + int cond_depth = 0, ok_depth = 0; + vector_for(references, ref, refs) { + switch (ref->typ) { + case REF_REQ: + if (ok_depth == cond_depth) { + if (!solve_request_map_simple(&ref->req, emu_decl_map, target_decl_map, conv_map)) ret = 0; + } else { + ref->req.ignored = 1; + } + break; + case REF_LINE: + break; + case REF_IFDEF: + ++cond_depth; + break; + case REF_IFNDEF: + if (cond_depth == ok_depth) ++ok_depth; + ++cond_depth; + break; + case REF_ELSE: + if (cond_depth == ok_depth) --ok_depth; + else if (cond_depth == ok_depth + 1) ++ok_depth; + break; + case REF_ENDIF: + if (cond_depth == ok_depth) --ok_depth; + --cond_depth; + break; + } + } + return ret; +} + +// Complex versions +enum safeness_e { + SAFE_ABORT, // Failure + SAFE_OK, // Simple, can output 'p' + SAFE_EXPAND, // Complex but automatable, needs to output 'b..._' +}; +static enum safeness_e get_safeness_ptr(type_t *emu_typ, type_t *target_typ, int *needs_D, int *needs_my, khash_t(conv_map) *conv_map, string_t *obj_name) { + if (emu_typ->typ != target_typ->typ) { + printf("Error: %s: pointer with different types between emu and target\n", string_content(obj_name)); + return SAFE_ABORT; + } + if (emu_typ->converted) { + printf("Warning: %s uses a converted type but is not the converted type\n", string_content(obj_name)); + *needs_my = 1; + return SAFE_OK; + } else if (kh_get(conv_map, conv_map, emu_typ) != kh_end(conv_map)) { + printf("Warning: %s uses a converted type but is not the converted type\n", string_content(obj_name)); + *needs_my = 1; + return SAFE_OK; + } + switch (emu_typ->typ) { + case TYPE_BUILTIN: + if (emu_typ->val.builtin != target_typ->val.builtin) { + // printf("Warning: %s: emu and target have pointers to different size type\n", string_content(obj_name)); + return SAFE_ABORT; + } + if (emu_typ->szinfo.size != target_typ->szinfo.size) { + // printf("Warning: %s: emu and target have pointers to different size type\n", string_content(obj_name)); + return SAFE_EXPAND; + } + /* if (emu_typ->szinfo.align != target_typ->szinfo.align) { + // printf("Warning: %s: emu and target have pointers to different alignment type\n", string_content(obj_name)); + return SAFE_EXPAND; + } */ + // Assume pointers to builtins of the same size and alignment are simple + return SAFE_OK; + case TYPE_ARRAY: + if (emu_typ->szinfo.size != target_typ->szinfo.size) { + // printf("Warning: %s: emu and target have pointers to arrays with different size type\n", string_content(obj_name)); + return SAFE_EXPAND; + } + if (emu_typ->szinfo.align != target_typ->szinfo.align) { + // printf("Warning: %s: emu and target have pointers to arrays with different alignment type\n", string_content(obj_name)); + return SAFE_EXPAND; + } + if (emu_typ->val.array.array_sz != target_typ->val.array.array_sz) { + printf("Error: %s: emu and target have arrays of different size\n", string_content(obj_name)); + return SAFE_ABORT; // Shouldn't happen + } + // Elements also have the same size + if ((emu_typ->val.array.array_sz == (size_t)-1) || (target_typ->val.array.array_sz == (size_t)-1)) { + printf("Error: %s: has variable length arrays\n", string_content(obj_name)); + return SAFE_ABORT; // VLA require manual intervention + } + return get_safeness_ptr(emu_typ->val.array.typ, target_typ->val.array.typ, needs_D, needs_my, conv_map, obj_name); + case TYPE_STRUCT_UNION: + if (emu_typ->val.st->is_struct != target_typ->val.st->is_struct) { + printf("Error: %s: incoherent struct/union type between emulated and target architectures for %s\n", + string_content(obj_name), emu_typ->val.st->tag ? string_content(emu_typ->val.st->tag) : ""); + return SAFE_ABORT; + } + if (emu_typ->is_incomplete != target_typ->is_incomplete) { + printf("Error: %s: incoherent struct/union completion type between emulated and target architectures for %s\n", + string_content(obj_name), emu_typ->val.st->tag ? string_content(emu_typ->val.st->tag) : ""); + return SAFE_ABORT; + } + if (emu_typ->is_incomplete) { + return SAFE_OK; // Undefined structures are OK since they are opaque + } + if (emu_typ->val.st->nmembers != target_typ->val.st->nmembers) { + printf("Error: %s: struct/union %s has different number of members between emulated and target architectures\n", + string_content(obj_name), emu_typ->val.st->tag ? string_content(emu_typ->val.st->tag) : ""); + return SAFE_ABORT; + } + if (emu_typ->val.st->has_self_recursion) { + // Self-reference implies manual intervention + *needs_my = 1; + return SAFE_OK; + } + if (emu_typ->val.st->nmembers == 1) { + // Assume structs and unions of one element has the same ABI as that element directly + return get_safeness_ptr(emu_typ->val.st->members[0].typ, target_typ->val.st->members[0].typ, needs_D, needs_my, conv_map, obj_name); + } + if (emu_typ->val.st->is_struct) { + // Structures are OK if all named members are OK and at the same memory offset + for (size_t i = 0; i < emu_typ->val.st->nmembers; ++i) { + st_member_t *emu_mem = &emu_typ->val.st->members[i]; + st_member_t *target_mem = &target_typ->val.st->members[i]; + if (emu_mem->name) { + if ((emu_mem->byte_offset != target_mem->byte_offset) || (emu_mem->bit_offset != target_mem->bit_offset)) { + return SAFE_EXPAND; + } + enum safeness_e saf = get_safeness_ptr(emu_mem->typ, target_mem->typ, needs_D, needs_my, conv_map, obj_name); + if (saf != SAFE_OK) return saf; + } + } + return SAFE_OK; + } else { + // Unions are OK if all named members are OK (memory offset is always 0) + for (size_t i = 0; i < emu_typ->val.st->nmembers; ++i) { + st_member_t *emu_mem = &emu_typ->val.st->members[i]; + st_member_t *target_mem = &target_typ->val.st->members[i]; + if (emu_mem->name) { + enum safeness_e saf = get_safeness_ptr(emu_mem->typ, target_mem->typ, needs_D, needs_my, conv_map, obj_name); + if (saf != SAFE_OK) return saf; + } + } + return SAFE_OK; + } + case TYPE_ENUM: + return get_safeness_ptr(emu_typ->val.typ, target_typ->val.typ, needs_D, needs_my, conv_map, obj_name); + case TYPE_PTR: + return SAFE_EXPAND; + case TYPE_FUNCTION: + *needs_my = 1; + return SAFE_OK; + default: + printf("Error: get_safeness_ptr on unknown type %u\n", emu_typ->typ); + return SAFE_ABORT; + } +} +static enum safeness_e get_safeness(type_t *emu_typ, type_t *target_typ, int *needs_D, int *needs_my, khash_t(conv_map) *conv_map, string_t *obj_name) { + if (emu_typ->typ != target_typ->typ) { + printf("Error: %s: data with different types between emu and target\n", string_content(obj_name)); + return SAFE_ABORT; // Invalid type + } + if (emu_typ->converted) { + // printf("Warning: %s uses a converted type but is not the converted type\n", string_content(obj_name)); + *needs_my = 1; + return SAFE_OK; + } else if (kh_get(conv_map, conv_map, emu_typ) != kh_end(conv_map)) { + // printf("Warning: %s uses a converted type but is not the converted type\n", string_content(obj_name)); + *needs_my = 1; + return SAFE_OK; + } + switch (emu_typ->typ) { + case TYPE_BUILTIN: + if ((emu_typ->val.builtin != target_typ->val.builtin) + || (emu_typ->szinfo.size != target_typ->szinfo.size) + || (emu_typ->szinfo.align != target_typ->szinfo.align) + || (emu_typ->val.builtin == BTT_FLOAT128) + || (emu_typ->val.builtin == BTT_CFLOAT128) + || (emu_typ->val.builtin == BTT_IFLOAT128)) { + // Assume all builtins are simple except for __float128 and those with different size or alignment + *needs_my = 1; + } + return SAFE_OK; + case TYPE_ARRAY: + if (emu_typ->szinfo.size != target_typ->szinfo.size) { + // printf("Warning: %s: emu and target have pointers to different size type\n", string_content(obj_name)); + return SAFE_EXPAND; + } + if (emu_typ->szinfo.align != target_typ->szinfo.align) { + // printf("Warning: %s: emu and target have pointers to different alignment type\n", string_content(obj_name)); + return SAFE_EXPAND; + } + if (emu_typ->val.array.array_sz != target_typ->val.array.array_sz) { + printf("Error: %s: emu and target have arrays of different size\n", string_content(obj_name)); + return SAFE_ABORT; // Shouldn't happen + } + // Elements also have the same size + if ((emu_typ->val.array.array_sz == (size_t)-1) || (target_typ->val.array.array_sz == (size_t)-1)) { + printf("Error: %s: has variable length arrays\n", string_content(obj_name)); + return SAFE_ABORT; // VLA require manual intervention + } + return get_safeness_ptr(emu_typ->val.array.typ, target_typ->val.array.typ, needs_D, needs_my, conv_map, obj_name); + case TYPE_STRUCT_UNION: + if (emu_typ->val.st->is_struct != target_typ->val.st->is_struct) { + printf("Error: %s: incoherent struct/union type between emulated and target architectures for %s\n", + string_content(obj_name), emu_typ->val.st->tag ? string_content(emu_typ->val.st->tag) : ""); + return SAFE_ABORT; + } + if (emu_typ->is_incomplete != target_typ->is_incomplete) { + printf("Error: %s: incoherent struct/union completion type between emulated and target architectures for %s\n", + string_content(obj_name), emu_typ->val.st->tag ? string_content(emu_typ->val.st->tag) : ""); + return SAFE_ABORT; + } + if (emu_typ->is_incomplete) { + printf("Warning: %s: undefined struct/union %s considered as simple\n", + string_content(obj_name), emu_typ->val.st->tag ? string_content(emu_typ->val.st->tag) : ""); + return SAFE_OK; // Assume undefined structures are OK since they are opaque + } + if (emu_typ->val.st->nmembers != target_typ->val.st->nmembers) { + printf("Error: %s: struct/union %s has different number of members between emulated and target architectures\n", + string_content(obj_name), emu_typ->val.st->tag ? string_content(emu_typ->val.st->tag) : ""); + return SAFE_ABORT; + } + if (emu_typ->val.st->has_self_recursion) { + // Self-reference implies manual intervention + *needs_my = 1; + return SAFE_OK; + } + for (size_t i = 0; i < emu_typ->val.st->nmembers; ++i) { + switch (get_safeness(emu_typ->val.st->members[i].typ, target_typ->val.st->members[i].typ, needs_D, needs_my, conv_map, obj_name)) { + case SAFE_OK: break; + case SAFE_ABORT: + case SAFE_EXPAND: + default: return SAFE_ABORT; + } + } + return SAFE_OK; + case TYPE_ENUM: + return get_safeness(emu_typ->val.typ, target_typ->val.typ, needs_D, needs_my, conv_map, obj_name); + case TYPE_PTR: + // Pointers have different sizes here + return SAFE_EXPAND; + case TYPE_FUNCTION: + // Functions should be handled differently (GO instead of DATA) + return SAFE_ABORT; + default: + printf("Error: get_safeness on unknown type %u\n", emu_typ->typ); + return SAFE_ABORT; + } +} + +// needs_S != NULL iff type is return +static int convert_type(string_t *dest, type_t *emu_typ, type_t *target_typ, int allow_nesting, + _Bool *needs_S, int *needs_D, int *needs_my, khash_t(conv_map) *conv_map, string_t *obj_name) { + if (emu_typ->converted) { + if (!string_add_string(dest, emu_typ->converted)) { + printf("Error: failed to add explicit type conversion\n"); + return 0; + } + return 1; + } + khiter_t it = kh_get(conv_map, conv_map, emu_typ); + if (it != kh_end(conv_map)) { + if (!string_add_string(dest, kh_val(conv_map, it))) { + printf("Error: failed to add explicit type conversion\n"); + return 0; + } + return 1; + } + if ((emu_typ->is_atomic) || (target_typ->is_atomic)) { + printf("Error: TODO: convert_type for atomic types\n"); + return 0; + } + if (emu_typ->typ != target_typ->typ) { + printf("Error: %s: %s type is different between emulated and target\n", string_content(obj_name), needs_S ? "return" : "argument"); + return 0; + } + switch (emu_typ->typ) { + case TYPE_BUILTIN: { + int has_char = 0; + char c; + switch (emu_typ->val.builtin) { + case BTT_VOID: has_char = 1; c = 'v'; break; + case BTT_BOOL: has_char = 1; c = 'i'; break; + case BTT_CHAR: has_char = 1; c = 'c'; break; + case BTT_SCHAR: has_char = 1; c = 'c'; break; + case BTT_UCHAR: has_char = 1; c = 'C'; break; + case BTT_SHORT: has_char = 1; c = 'w'; break; + case BTT_SSHORT: has_char = 1; c = 'w'; break; + case BTT_USHORT: has_char = 1; c = 'W'; break; + case BTT_INT: has_char = 1; c = 'i'; break; + case BTT_SINT: has_char = 1; c = 'i'; break; + case BTT_UINT: has_char = 1; c = 'u'; break; + case BTT_LONG: has_char = 1; c = 'l'; break; + case BTT_SLONG: has_char = 1; c = 'l'; break; + case BTT_ULONG: has_char = 1; c = 'L'; break; + case BTT_LONGLONG: has_char = 1; c = 'I'; break; + case BTT_SLONGLONG: has_char = 1; c = 'I'; break; + case BTT_ULONGLONG: has_char = 1; c = 'U'; break; + case BTT_INT128: has_char = 1; c = 'H'; break; + case BTT_SINT128: has_char = 1; c = 'H'; break; + case BTT_UINT128: has_char = 1; c = 'H'; break; + case BTT_S8: has_char = 1; c = 'c'; break; + case BTT_U8: has_char = 1; c = 'C'; break; + case BTT_S16: has_char = 1; c = 'w'; break; + case BTT_U16: has_char = 1; c = 'W'; break; + case BTT_S32: has_char = 1; c = 'i'; break; + case BTT_U32: has_char = 1; c = 'u'; break; + case BTT_S64: has_char = 1; c = 'I'; break; + case BTT_U64: has_char = 1; c = 'U'; break; + case BTT_FLOAT: has_char = 1; c = 'f'; break; + case BTT_CFLOAT: has_char = 1; c = 'x'; break; + case BTT_IFLOAT: has_char = 1; c = 'f'; break; + case BTT_DOUBLE: has_char = 1; c = 'd'; break; + case BTT_CDOUBLE: has_char = 1; c = 'X'; break; + case BTT_IDOUBLE: has_char = 1; c = 'd'; break; + case BTT_LONGDOUBLE: *needs_D = 1; has_char = 1; c = 'D'; break; + case BTT_CLONGDOUBLE: *needs_D = 1; has_char = 1; c = 'Y'; break; + case BTT_ILONGDOUBLE: *needs_D = 1; has_char = 1; c = 'D'; break; + case BTT_FLOAT128: printf("Error: TODO: %s\n", builtin2str[emu_typ->val.builtin]); return 0; + case BTT_CFLOAT128: printf("Error: TODO: %s\n", builtin2str[emu_typ->val.builtin]); return 0; + case BTT_IFLOAT128: printf("Error: TODO: %s\n", builtin2str[emu_typ->val.builtin]); return 0; + case BTT_VA_LIST: *needs_my = 1; has_char = 1; c = 'p'; break; + default: + printf("Error: convert_type on unknown builtin %u\n", emu_typ->val.builtin); + return 0; + } + if (has_char) { + if (!string_add_char(dest, c)) { + printf("Error: failed to add type char for complex pointer\n"); + return 0; + } + return 1; + } else { + printf("Internal error: unknown state builtin=%u\n", emu_typ->val.builtin); + return 0; + } } + case TYPE_ARRAY: { + // May come from the content of a pointer or structure + if ((emu_typ->val.array.array_sz == (size_t)-1) || (target_typ->val.array.array_sz == (size_t)-1)) { + printf("Error: %s: has variable length arrays\n", string_content(obj_name)); + return 0; // VLA require manual intervention + } + if (emu_typ->val.array.array_sz != target_typ->val.array.array_sz) { + printf("Error: %s: emu and target have arrays of different size\n", string_content(obj_name)); + return 0; // Shouldn't happen + } + if (!emu_typ->val.array.array_sz) { + // printf("Warning: %s: has zero-length array\n", string_content(obj_name)); + return 1; + } + size_t idx = string_len(dest); + if (!convert_type(dest, emu_typ->val.array.typ, target_typ->val.array.typ, allow_nesting, needs_S, needs_D, needs_my, conv_map, obj_name)) + return 0; + size_t end = string_len(dest); + if (idx == end) return 1; + if (!string_reserve(dest, idx + (end - idx) * emu_typ->val.array.array_sz)) { + printf("Error: failed to reserve string capacity (for array of type conversing length %zu and size %zu)\n", + end - idx, emu_typ->val.array.array_sz); + return 0; + } + for (size_t i = 1; i < emu_typ->val.array.array_sz; ++i) { + memcpy(string_content(dest) + idx + (end - idx) * i, string_content(dest) + idx, end - idx); + // HACKHACKHACK === + string_len(dest) += end - idx; + // === HACKHACKHACK + } + return 1; } + case TYPE_STRUCT_UNION: + if (!emu_typ->is_validated || emu_typ->is_incomplete) { + printf("Error: incomplete structure for %s\n", string_content(obj_name)); + return 0; + } + if (needs_S) { + *needs_S = 1; + // TODO: remove this and add support in the python wrappers for structure returns + if (!string_add_char(dest, 'p')) { + printf("Error: failed to add type char for very large structure return\n"); + return 0; + } + return 1; + } else { + if ((emu_typ->val.st->nmembers == 1) && (target_typ->typ == TYPE_STRUCT_UNION) && (target_typ->val.st->nmembers == 1)) { + return convert_type(dest, emu_typ->val.st->members[0].typ, target_typ->val.st->members[0].typ, allow_nesting, needs_S, needs_D, needs_my, conv_map, obj_name); + } + printf("Error: TODO: convert_type on structure as argument (%s)\n", string_content(obj_name)); + return 0; + } + case TYPE_ENUM: + return convert_type(dest, emu_typ->val.typ, target_typ->val.typ, allow_nesting, needs_S, needs_D, needs_my, conv_map, obj_name); + case TYPE_PTR: + switch (get_safeness_ptr(emu_typ->val.typ, target_typ->val.typ, needs_D, needs_my, conv_map, obj_name)) { + default: + printf("Internal error: %s: pointer to unknown type\n", string_content(obj_name)); + return 0; + + case SAFE_ABORT: + return 0; + + case SAFE_OK: + if (!string_add_char(dest, 'p')) { + printf("Error: failed to add type char for simple pointer\n"); + return 0; + } + return 1; + + case SAFE_EXPAND: + if (!allow_nesting) { + // TODO remove this with a better rebuild_wrappers.py + *needs_my = 1; + if (!string_add_char(dest, 'p')) { + printf("Error: failed to add type char for simple pointer\n"); + return 0; + } + return 1; + } + if (!string_add_char(dest, emu_typ->is_const ? 'r' : 'b')) { + printf("Error: failed to add start type char for wrapping pointer\n"); + return 0; + } + // Find the underlying type to convert + emu_typ = emu_typ->val.typ; + target_typ = target_typ->val.typ; + do_expanded: + switch (emu_typ->typ) { + case TYPE_BUILTIN: + if (!convert_type(dest, emu_typ, target_typ, 0, needs_S, needs_D, needs_my, conv_map, obj_name)) { + return 0; + } + break; + case TYPE_ARRAY: + if (!convert_type(dest, emu_typ, target_typ, 0, needs_S, needs_D, needs_my, conv_map, obj_name)) { + return 0; + } + break; + case TYPE_STRUCT_UNION: + if (!emu_typ->val.st->is_defined) { + printf("Internal error: EXPAND with undefined struct/union ptr\n"); + return 0; + } + if (emu_typ->val.st->nmembers == 1) { // Single-member struct/union + emu_typ = emu_typ->val.st->members[0].typ; + target_typ = target_typ->val.st->members[0].typ; + goto do_expanded; + } + for (size_t i = 0; i < emu_typ->val.st->nmembers; ++i) { + if (!convert_type(dest, emu_typ->val.st->members[i].typ, target_typ->val.st->members[i].typ, 0, needs_S, needs_D, needs_my, conv_map, obj_name)) { + return 0; + } + } + break; + case TYPE_ENUM: + emu_typ = emu_typ->val.typ; + target_typ = target_typ->val.typ; + if (!convert_type(dest, emu_typ, target_typ, 0, needs_S, needs_D, needs_my, conv_map, obj_name)) { + return 0; + } + break; + case TYPE_PTR: + if (!convert_type(dest, emu_typ, target_typ, 0, needs_S, needs_D, needs_my, conv_map, obj_name)) { + return 0; + } + break; + case TYPE_FUNCTION: + if (!convert_type(dest, emu_typ, target_typ, 0, needs_S, needs_D, needs_my, conv_map, obj_name)) { + return 0; + } + break; + } + if (!string_add_char(dest, '_')) { + printf("Error: failed to add end type char for wrapping pointer\n"); + return 0; + } + return 1; + } + case TYPE_FUNCTION: + printf("Internal error: convert_type on raw function\n"); + return 1; + default: + printf("Error: convert_type on unknown type %u\n", emu_typ->typ); + return 0; + } +} +// TODO: move this function to the python script (implement correct structure returns) +static int convert_type_post(string_t *dest, type_t *emu_typ, type_t *target_typ, string_t *obj_name) { + if (emu_typ->converted) return 1; + if (emu_typ->is_atomic) { + printf("Error: TODO: convert_type_post for atomic types\n"); + return 0; + } + (void)target_typ; + switch (emu_typ->typ) { + case TYPE_BUILTIN: return 1; + case TYPE_ARRAY: return 1; + case TYPE_STRUCT_UNION: + if (!emu_typ->is_validated || emu_typ->is_incomplete) { + printf("Error: incomplete structure for %s\n", string_content(obj_name)); + return 0; + } + // Hard coded + if (!string_add_char(dest, 'p')) { + printf("Error: failed to add type char for very large structure return as parameter\n"); + return 0; + } + return 2; + case TYPE_ENUM: return 1; + case TYPE_PTR: return 1; + case TYPE_FUNCTION: return 1; + } + printf("Error: convert_type_post on unknown type %u\n", emu_typ->typ); + return 0; +} + +int solve_request(request_t *req, type_t *emu_typ, type_t *target_typ, khash_t(conv_map) *conv_map) { + if (emu_typ->typ != target_typ->typ) { + printf("Error: %s: emulated and target types are different (emulated is %u, target is %u)\n", + string_content(req->obj_name), emu_typ->typ, target_typ->typ); + return 0; + } + if (emu_typ->typ == TYPE_FUNCTION) { + int needs_D = 0, needs_my = req->def.fun.typ && (req->def.rty == RQT_FUN_MY), needs_2 = 0; + int convert_post; + size_t idx_conv; + req->val.fun.typ = string_new(); + if (!req->val.fun.typ) { + printf("Error: failed to create function type string\n"); + return 0; + } + if (!convert_type(req->val.fun.typ, emu_typ->val.fun.ret, target_typ->val.fun.ret, 0, &req->val.fun.needs_S, &needs_D, &needs_my, conv_map, req->obj_name)) + goto fun_fail; + idx_conv = string_len(req->val.fun.typ); + if (!string_add_char(req->val.fun.typ, 'F')) { + printf("Error: failed to add convention char\n"); + goto fun_fail; + } + convert_post = convert_type_post(req->val.fun.typ, emu_typ->val.fun.ret, target_typ->val.fun.ret, req->obj_name); + if (!convert_post) goto fun_fail; + if (emu_typ->val.fun.nargs == (size_t)-1) { + printf("Warning: %s: assuming empty specification is void specification\n", string_content(req->obj_name)); + if (convert_post == 1) { + if (!string_add_char(req->val.fun.typ, 'v')) { + printf("Error: failed to add void specification char\n"); + goto fun_fail; + } + } + } else if (!emu_typ->val.fun.nargs && !emu_typ->val.fun.has_varargs) { + if (convert_post == 1) { + if (!string_add_char(req->val.fun.typ, 'v')) { + printf("Error: failed to add void specification char\n"); + goto fun_fail; + } + } + } else { + for (size_t i = 0; i < emu_typ->val.fun.nargs; ++i) { + if (!convert_type(req->val.fun.typ, emu_typ->val.fun.args[i], target_typ->val.fun.args[i], 1, NULL, &needs_D, &needs_my, conv_map, req->obj_name)) + goto fun_fail; + } + if (emu_typ->val.fun.has_varargs) { + if (req->def.fun.typ + && (string_len(req->def.fun.typ) == string_len(req->val.fun.typ) + 1) + && !strncmp(string_content(req->def.fun.typ), string_content(req->val.fun.typ), string_len(req->val.fun.typ)) + && ((string_content(req->def.fun.typ)[string_len(req->val.fun.typ)] == 'M') + || (string_content(req->def.fun.typ)[string_len(req->val.fun.typ)] == 'N'))) { + if (!string_add_char(req->val.fun.typ, string_content(req->def.fun.typ)[string_len(req->val.fun.typ)])) { + printf("Error: failed to add type char '%c' for %s\n", + string_content(req->def.fun.typ)[string_len(req->val.fun.typ)], + builtin2str[emu_typ->val.builtin]); + goto fun_fail; + } + } else { + needs_my = 1; + if (!string_add_char(req->val.fun.typ, 'V')) { + printf("Error: failed to add type char 'V' for %s\n", builtin2str[emu_typ->val.builtin]); + goto fun_fail; + } + } + } + } + + // fun_succ: + // Add 'E' by default, unless we have the same function as before + if (needs_my && (req->default_comment + || (req->def.rty != RQT_FUN_MY) + || strcmp(string_content(req->def.fun.typ), string_content(req->val.fun.typ)))) { + if (!string_add_char_at(req->val.fun.typ, 'E', idx_conv + 1)) { + printf("Error: failed to add emu char\n"); + goto fun_fail; + } + } + if (req->def.fun.typ && (req->def.rty == RQT_FUN_2) && !needs_my) { + needs_2 = 1; + req->val.fun.fun2 = string_dup(req->def.fun.fun2); + if (!req->val.fun.fun2) { + printf("Error: failed to duplicate string (request for function %s with default redirection)\n", string_content(req->obj_name)); + return 0; + } + } else if (req->def.fun.typ && (req->def.rty == RQT_FUN_D) && !needs_my) { + needs_2 = 0; + req->val.fun.fun2 = string_dup(req->def.fun.fun2); + if (!req->val.fun.fun2) { + printf("Error: failed to duplicate string (request for function %s with long double types)\n", string_content(req->obj_name)); + return 0; + } + } else if (!needs_my && needs_D) { + req->val.fun.fun2 = string_new(); + if (!req->val.fun.fun2) { + printf("Error: failed to create empty string (request for function %s with long double types)\n", string_content(req->obj_name)); + return 0; + } + } + req->val.rty = + needs_my ? RQT_FUN_MY : + needs_2 ? RQT_FUN_2 : + needs_D ? RQT_FUN_D : RQT_FUN; + req->has_val = 1; + return 1; + + fun_fail: + string_del(req->val.fun.typ); + return 0; + } else { + int needs_D = 0, needs_my = req->def.dat.has_size && (req->def.rty == RQT_DATAM); + switch (get_safeness(emu_typ, target_typ, &needs_D, &needs_my, conv_map, req->obj_name)) { + case SAFE_EXPAND: + needs_my = 1; + /* FALLTHROUGH */ + case SAFE_OK: + req->val.rty = needs_my ? RQT_DATAM : (IS_RQT_FUNCTION(req->def.rty) ? RQT_DATA : req->def.rty); + req->val.dat.has_size = 1; + req->val.dat.sz = emu_typ->szinfo.size; + req->has_val = 1; + return 1; + + case SAFE_ABORT: + default: + log_TODO_nopos("solve_request for data %s with non-simple type ", string_content(req->obj_name)); + type_print(emu_typ); + printf("\n"); + return 0; + } + } +} +int solve_request_map(request_t *req, khash_t(decl_map) *emu_decl_map, khash_t(decl_map) *target_decl_map, khash_t(conv_map) *conv_map) { + int hasemu = 0, hastarget = 0; + khiter_t emuit, targetit; + emuit = kh_get(decl_map, emu_decl_map, string_content(req->obj_name)); + if (emuit == kh_end(emu_decl_map)) { + goto failed; + } + if ((kh_val(emu_decl_map, emuit)->storage == STORAGE_STATIC) || (kh_val(emu_decl_map, emuit)->storage == STORAGE_TLS_STATIC)) { + goto failed; + } + hasemu = 1; + targetit = kh_get(decl_map, target_decl_map, string_content(req->obj_name)); + if (targetit == kh_end(target_decl_map)) { + goto failed; + } + if ((kh_val(target_decl_map, targetit)->storage == STORAGE_STATIC) || (kh_val(target_decl_map, targetit)->storage == STORAGE_TLS_STATIC)) { + goto failed; + } + hastarget = 1; + return solve_request(req, kh_val(emu_decl_map, emuit)->typ, kh_val(target_decl_map, targetit)->typ, conv_map); + +failed: + if (string_content(req->obj_name)[0] != '_') { + if (!hasemu && !hastarget) { + printf("Error: %s was not declared in the emulated and target architectures\n", string_content(req->obj_name)); + } else if (!hasemu) { + printf("Error: %s was not declared only in the emulated architecture\n", string_content(req->obj_name)); + } else if (!hastarget) { + printf("Error: %s was not declared only in the target architecture\n", string_content(req->obj_name)); + } else { + printf("Error: internal error: failed but found for %s\n", string_content(req->obj_name)); + } + } + return 0; +} +int solve_references(VECTOR(references) *refs, khash_t(decl_map) *emu_decl_map, khash_t(decl_map) *target_decl_map, khash_t(conv_map) *conv_map) { + int ret = 1; + int cond_depth = 0, ok_depth = 0; + vector_for(references, ref, refs) { + switch (ref->typ) { + case REF_REQ: + if (ok_depth == cond_depth) { + if (!solve_request_map(&ref->req, emu_decl_map, target_decl_map, conv_map)) ret = 0; + } else { + ref->req.ignored = 1; + } + break; + case REF_LINE: + break; + case REF_IFDEF: + ++cond_depth; + break; + case REF_IFNDEF: + if (cond_depth == ok_depth) ++ok_depth; + ++cond_depth; + break; + case REF_ELSE: + if (cond_depth == ok_depth) --ok_depth; + else if (cond_depth == ok_depth + 1) ++ok_depth; + break; + case REF_ENDIF: + if (cond_depth == ok_depth) --ok_depth; + --cond_depth; + break; + } + } + return ret; +} diff --git a/wrapperhelper/src/generator.h b/wrapperhelper/src/generator.h new file mode 100644 index 0000000..89044af --- /dev/null +++ b/wrapperhelper/src/generator.h @@ -0,0 +1,72 @@ +#pragma once + +#ifndef GENERATOR_H +#define GENERATOR_H + +#include + +#include "cstring.h" +#include "lang.h" + +typedef struct request_s { + string_t *obj_name; + _Bool default_comment; + _Bool has_val, ignored; + _Bool weak; + struct { + enum request_type_e { + RQT_FUN, + RQT_FUN_2, + RQT_FUN_MY, + RQT_FUN_D, + + RQT_DATA, + RQT_DATAB, + RQT_DATAM, + } rty; + union { + struct { + string_t *typ; + string_t *fun2; + _Bool needs_S; + } fun; + struct { + int has_size; + size_t sz; + } dat; + }; + } def, val; +} request_t; +typedef struct reference_s { + enum { + REF_REQ, + REF_LINE, + REF_IFDEF, + REF_IFNDEF, + REF_ELSE, + REF_ENDIF, + } typ; + union { + request_t req; + string_t *line; + }; +} reference_t; +VECTOR_DECLARE(references, reference_t) +void request_print(const request_t *req); +void request_print_check(const request_t *req); +void references_print_check(const VECTOR(references) *refs); +void output_from_references(FILE *f, const VECTOR(references) *reqs); + +VECTOR(references) *references_from_file(const char *filename, FILE *f); // Takes ownership of f + +// Simple solvers (emu and target have the same pointer size) +int solve_request_simple(request_t *req, type_t *emu_typ, type_t *target_typ, khash_t(conv_map) *conv_map); +int solve_request_map_simple(request_t *req, khash_t(decl_map) *emu_decl_map, khash_t(decl_map) *target_decl_map, khash_t(conv_map) *conv_map); +int solve_references_simple(VECTOR(references) *reqs, khash_t(decl_map) *emu_decl_map, khash_t(decl_map) *target_decl_map, khash_t(conv_map) *conv_map); + +// Complex solvers (emu and target have different pointer size) +int solve_request(request_t *req, type_t *emu_typ, type_t *target_typ, khash_t(conv_map) *conv_map); +int solve_request_map(request_t *req, khash_t(decl_map) *emu_decl_map, khash_t(decl_map) *target_decl_map, khash_t(conv_map) *conv_map); +int solve_references(VECTOR(references) *reqs, khash_t(decl_map) *emu_decl_map, khash_t(decl_map) *target_decl_map, khash_t(conv_map) *conv_map); + +#endif // GENERATOR_H diff --git a/wrapperhelper/src/khash.h b/wrapperhelper/src/khash.h new file mode 100644 index 0000000..57a98bb --- /dev/null +++ b/wrapperhelper/src/khash.h @@ -0,0 +1,699 @@ +/* The MIT License + + Copyright (c) 2008, 2009, 2011 by Attractive Chaos + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + +/* + An example: + +#include "khash.h" +KHASH_MAP_INIT_INT(32, char) +int main() { + int ret, is_missing; + khiter_t k; + khash_t(32) *h = kh_init(32); + k = kh_put(32, h, 5, &ret); + kh_value(h, k) = 10; + k = kh_get(32, h, 10); + is_missing = (k == kh_end(h)); + k = kh_get(32, h, 5); + kh_del(32, h, k); + for (k = kh_begin(h); k != kh_end(h); ++k) + if (kh_exist(h, k)) kh_value(h, k) = 1; + kh_destroy(32, h); + return 0; +} +*/ + +/* + 2013-05-02 (0.2.8): + + * Use quadratic probing. When the capacity is power of 2, stepping function + i*(i+1)/2 guarantees to traverse each bucket. It is better than double + hashing on cache performance and is more robust than linear probing. + + In theory, double hashing should be more robust than quadratic probing. + However, my implementation is probably not for large hash tables, because + the second hash function is closely tied to the first hash function, + which reduce the effectiveness of double hashing. + + Reference: http://research.cs.vt.edu/AVresearch/hashing/quadratic.php + + 2011-12-29 (0.2.7): + + * Minor code clean up; no actual effect. + + 2011-09-16 (0.2.6): + + * The capacity is a power of 2. This seems to dramatically improve the + speed for simple keys. Thank Zilong Tan for the suggestion. Reference: + + - http://code.google.com/p/ulib/ + - http://nothings.org/computer/judy/ + + * Allow to optionally use linear probing which usually has better + performance for random input. Double hashing is still the default as it + is more robust to certain non-random input. + + * Added Wang's integer hash function (not used by default). This hash + function is more robust to certain non-random input. + + 2011-02-14 (0.2.5): + + * Allow to declare global functions. + + 2009-09-26 (0.2.4): + + * Improve portability + + 2008-09-19 (0.2.3): + + * Corrected the example + * Improved interfaces + + 2008-09-11 (0.2.2): + + * Improved speed a little in kh_put() + + 2008-09-10 (0.2.1): + + * Added kh_clear() + * Fixed a compiling error + + 2008-09-02 (0.2.0): + + * Changed to token concatenation which increases flexibility. + + 2008-08-31 (0.1.2): + + * Fixed a bug in kh_get(), which has not been tested previously. + + 2008-08-31 (0.1.1): + + * Added destructor +*/ + + +#ifndef __AC_KHASH_H +#define __AC_KHASH_H + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" + +/*! + @header + + Generic hash table library. + */ + +#define AC_VERSION_KHASH_H "0.2.8" + +#include +#include +#include + +/* compiler specific configuration */ + +#if UINT_MAX == 0xffffffffu +typedef unsigned int khint32_t; +#elif ULONG_MAX == 0xffffffffu +typedef unsigned long khint32_t; +#endif + +#if ULONG_MAX == ULLONG_MAX +typedef unsigned long khint64_t; +#else +typedef unsigned long long khint64_t; +#endif + +#ifdef _MSC_VER +#define kh_inline __inline +#else +#define kh_inline inline +#endif + +typedef khint32_t khint_t; +typedef khint_t khiter_t; + +#define __ac_isempty(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&2) +#define __ac_isdel(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&1) +#define __ac_iseither(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&3) +#define __ac_set_isdel_false(flag, i) (flag[i>>4]&=~(1u<<((i&0xfU)<<1))) +#define __ac_set_isempty_false(flag, i) (flag[i>>4]&=~(2u<<((i&0xfU)<<1))) +#define __ac_set_isboth_false(flag, i) (flag[i>>4]&=~(3u<<((i&0xfU)<<1))) +#define __ac_set_isdel_true(flag, i) (flag[i>>4]|=1u<<((i&0xfU)<<1)) + +#define __ac_fsize(m) ((m) < 16? 1 : (m)>>4) + +#ifndef kroundup32 +#define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) +#endif + +#ifndef kcalloc +#define kcalloc(N,Z) calloc(N,Z) +#endif +#ifndef kmalloc +#define kmalloc(Z) malloc(Z) +#endif +#ifndef krealloc +#define krealloc(P,Z) realloc(P,Z) +#endif +#ifndef kfree +#define kfree(P) free(P) +#endif + +static const double __ac_HASH_UPPER = 0.77; + +#define __KHASH_TYPE(name, khkey_t, khval_t) \ + typedef struct kh_##name##_s{ \ + khint_t n_buckets, size, n_occupied, upper_bound; \ + khint32_t *flags; \ + khkey_t *keys; \ + khval_t *vals; \ + } kh_##name##_t; + +#define __KHASH_PROTOTYPES(name, khkey_t, khval_t) \ + extern kh_##name##_t *kh_init_##name(void); \ + extern void kh_destroy_##name(kh_##name##_t *h); \ + extern void kh_clear_##name(kh_##name##_t *h); \ + extern khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key); \ + extern int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets); \ + extern khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret); \ + extern void kh_del_##name(kh_##name##_t *h, khint_t x); + +#define __KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ + SCOPE kh_##name##_t *kh_init_##name(void) { \ + return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t)); \ + } \ + SCOPE void kh_destroy_##name(kh_##name##_t *h) \ + { \ + if (h) { \ + kfree((void *)h->keys); kfree(h->flags); \ + kfree((void *)h->vals); \ + kfree(h); \ + } \ + } \ + SCOPE void kh_clear_##name(kh_##name##_t *h) \ + { \ + if (h && h->flags) { \ + memset(h->flags, 0xaa, __ac_fsize(h->n_buckets) * sizeof(khint32_t)); \ + h->size = h->n_occupied = 0; \ + } \ + } \ + __attribute__((pure)) SCOPE khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key) \ + { \ + if (h->n_buckets) { \ + khint_t k, i, last, mask, step = 0; \ + mask = h->n_buckets - 1; \ + k = __hash_func(key); i = k & mask; \ + last = i; \ + while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \ + i = (i + (++step)) & mask; \ + if (i == last) return h->n_buckets; \ + } \ + return __ac_iseither(h->flags, i)? h->n_buckets : i; \ + } else return 0; \ + } \ + SCOPE int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets) \ + { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \ + khint32_t *new_flags = 0; \ + khint_t j = 1; \ + { \ + kroundup32(new_n_buckets); \ + if (new_n_buckets < 4) new_n_buckets = 4; \ + if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 0; /* requested size is too small */ \ + else { /* hash table size to be changed (shrink or expand); rehash */ \ + new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t)); \ + if (!new_flags) return -1; \ + memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \ + if (h->n_buckets < new_n_buckets) { /* expand */ \ + khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \ + if (!new_keys) { kfree(new_flags); return -1; } \ + h->keys = new_keys; \ + if (kh_is_map) { \ + khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \ + if (!new_vals) { kfree(new_flags); return -1; } \ + h->vals = new_vals; \ + } \ + } /* otherwise shrink */ \ + } \ + } \ + if (j) { /* rehashing is needed */ \ + for (j = 0; j != h->n_buckets; ++j) { \ + if (__ac_iseither(h->flags, j) == 0) { \ + khkey_t key = h->keys[j]; \ + khval_t val; \ + khint_t new_mask; \ + new_mask = new_n_buckets - 1; \ + if (kh_is_map) val = h->vals[j]; \ + __ac_set_isdel_true(h->flags, j); \ + while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \ + khint_t k, i, step = 0; \ + k = __hash_func(key); \ + i = k & new_mask; \ + while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask; \ + __ac_set_isempty_false(new_flags, i); \ + if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { /* kick out the existing element */ \ + { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \ + if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \ + __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \ + } else { /* write the element and jump out of the loop */ \ + h->keys[i] = key; \ + if (kh_is_map) h->vals[i] = val; \ + break; \ + } \ + } \ + } \ + } \ + if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \ + h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \ + if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \ + } \ + kfree(h->flags); /* free the working space */ \ + h->flags = new_flags; \ + h->n_buckets = new_n_buckets; \ + h->n_occupied = h->size; \ + h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \ + } \ + return 0; \ + } \ + SCOPE khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret) \ + { \ + khint_t x; \ + if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \ + if (h->n_buckets > (h->size<<1)) { \ + if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \ + *ret = -1; return h->n_buckets; \ + } \ + } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \ + *ret = -1; return h->n_buckets; \ + } \ + } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \ + { \ + khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \ + x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \ + if (__ac_isempty(h->flags, i)) x = i; /* for speed up */ \ + else { \ + last = i; \ + while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \ + if (__ac_isdel(h->flags, i)) site = i; \ + i = (i + (++step)) & mask; \ + if (i == last) { x = site; break; } \ + } \ + if (x == h->n_buckets) { \ + if (__ac_isempty(h->flags, i) && site != h->n_buckets) x = site; \ + else x = i; \ + } \ + } \ + } \ + if (__ac_isempty(h->flags, x)) { /* not present at all */ \ + h->keys[x] = key; \ + __ac_set_isboth_false(h->flags, x); \ + ++h->size; ++h->n_occupied; \ + *ret = 1; \ + } else if (__ac_isdel(h->flags, x)) { /* deleted */ \ + h->keys[x] = key; \ + __ac_set_isboth_false(h->flags, x); \ + ++h->size; \ + *ret = 2; \ + } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \ + return x; \ + } \ + SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \ + { \ + if (x != h->n_buckets && !__ac_iseither(h->flags, x)) { \ + __ac_set_isdel_true(h->flags, x); \ + --h->size; \ + } \ + } + +#define KHASH_DECLARE(name, khkey_t, khval_t) \ + __KHASH_TYPE(name, khkey_t, khval_t) \ + __KHASH_PROTOTYPES(name, khkey_t, khval_t) + +#define KHASH_INIT2(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ + __KHASH_TYPE(name, khkey_t, khval_t) \ + __KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) + +#define KHASH_INIT(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ + KHASH_INIT2(name, static kh_inline, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) + +/* --- BEGIN OF HASH FUNCTIONS --- */ + +/*! @function + @abstract Integer hash function + @param key The integer [khint32_t] + @return The hash value [khint_t] + */ +#define kh_int_hash_func(key) (khint32_t)(key) +/*! @function + @abstract Integer comparison function + */ +#define kh_int_hash_equal(a, b) ((a) == (b)) +/*! @function + @abstract 64-bit integer hash function + @param key The integer [khint64_t] + @return The hash value [khint_t] + */ +#define kh_int64_hash_func(key) (khint32_t)((key)>>33^(key)^(key)<<11) +/*! @function + @abstract 64-bit integer comparison function + */ +#define kh_int64_hash_equal(a, b) ((a) == (b)) +/*! @function + @abstract const char* hash function + @param s Pointer to a null terminated string + @return The hash value + */ +__attribute__((pure)) static kh_inline khint_t __ac_X31_hash_string(const char *s) +{ + khint_t h = (khint_t)*s; + if (h) for (++s ; *s; ++s) h = (h << 5) - h + (khint_t)*s; + return h; +} +/*! @function + @abstract Another interface to const char* hash function + @param key Pointer to a null terminated string [const char*] + @return The hash value [khint_t] + */ +#define kh_str_hash_func(key) __ac_X31_hash_string(key) +/*! @function + @abstract Const char* comparison function + */ +#define kh_str_hash_equal(a, b) ((!a && !b) || (a && b && strcmp(a, b) == 0)) + +static kh_inline khint_t __ac_Wang_hash(khint_t key) +{ + key += ~(key << 15); + key ^= (key >> 10); + key += (key << 3); + key ^= (key >> 6); + key += ~(key << 11); + key ^= (key >> 16); + return key; +} +#define kh_int_hash_func2(k) __ac_Wang_hash((khint_t)key) + +/* --- END OF HASH FUNCTIONS --- */ + +/* Other convenient macros... */ + +/*! + @abstract Type of the hash table. + @param name Name of the hash table [symbol] + */ +#define khash_t(name) kh_##name##_t + +/*! @function + @abstract Initiate a hash table. + @param name Name of the hash table [symbol] + @return Pointer to the hash table [khash_t(name)*] + */ +#define kh_init(name) kh_init_##name() + +/*! @function + @abstract Destroy a hash table. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + */ +#define kh_destroy(name, h) kh_destroy_##name(h) + +/*! @function + @abstract Reset a hash table without deallocating memory. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + */ +#define kh_clear(name, h) kh_clear_##name(h) + +/*! @function + @abstract Resize a hash table. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + @param s New size [khint_t] + */ +#define kh_resize(name, h, s) kh_resize_##name(h, s) + +/*! @function + @abstract Insert a key to the hash table. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + @param k Key [type of keys] + @param r Extra return code: 0 if the key is present in the hash table; + 1 if the bucket is empty (never used); 2 if the element in + the bucket has been deleted [int*] + @return Iterator to the inserted element [khint_t] + */ +#define kh_put(name, h, k, r) kh_put_##name(h, k, r) + +/*! @function + @abstract Retrieve a key from the hash table. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + @param k Key [type of keys] + @return Iterator to the found element, or kh_end(h) if the element is absent [khint_t] + */ +#define kh_get(name, h, k) kh_get_##name(h, k) + +/*! @function + @abstract Remove a key from the hash table. + @param name Name of the hash table [symbol] + @param h Pointer to the hash table [khash_t(name)*] + @param k Iterator to the element to be deleted [khint_t] + */ +#define kh_del(name, h, k) kh_del_##name(h, k) + +/*! @function + @abstract Test whether a bucket contains data. + @param h Pointer to the hash table [khash_t(name)*] + @param x Iterator to the bucket [khint_t] + @return 1 if containing data; 0 otherwise [int] + */ +#define kh_exist(h, x) (!__ac_iseither((h)->flags, (x))) + +/*! @function + @abstract Get key given an iterator + @param h Pointer to the hash table [khash_t(name)*] + @param x Iterator to the bucket [khint_t] + @return Key [type of keys] + */ +#define kh_key(h, x) ((h)->keys[x]) + +/*! @function + @abstract Get value given an iterator + @param h Pointer to the hash table [khash_t(name)*] + @param x Iterator to the bucket [khint_t] + @return Value [type of values] + @discussion For hash sets, calling this results in segfault. + */ +#define kh_val(h, x) ((h)->vals[x]) + +/*! @function + @abstract Alias of kh_val() + */ +#define kh_value(h, x) ((h)->vals[x]) + +/*! @function + @abstract Get the start iterator + @param h Pointer to the hash table [khash_t(name)*] + @return The start iterator [khint_t] + */ +#define kh_begin(h) (khint_t)(0) + +/*! @function + @abstract Get the end iterator + @param h Pointer to the hash table [khash_t(name)*] + @return The end iterator [khint_t] + */ +#define kh_end(h) ((h)->n_buckets) + +/*! @function + @abstract Get the number of elements in the hash table + @param h Pointer to the hash table [khash_t(name)*] + @return Number of elements in the hash table [khint_t] + */ +#define kh_size(h) ((h)->size) + +/*! @function + @abstract Get the number of buckets in the hash table + @param h Pointer to the hash table [khash_t(name)*] + @return Number of buckets in the hash table [khint_t] + */ +#define kh_n_buckets(h) ((h)->n_buckets) + +/*! @function + @abstract Iterate over the entries in the hash table + @param h Pointer to the hash table [khash_t(name)*] + @param kvar Variable to which key will be assigned + @param vvar Variable to which value will be assigned + @param code Block of code to execute + */ +#define kh_foreach(h, kvar, vvar, code) { khint_t __i; \ + for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \ + if (!kh_exist(h,__i)) continue; \ + (kvar) = kh_key(h,__i); \ + (vvar) = kh_val(h,__i); \ + code; \ + } } + +/*! @function + @abstract Iterate over the entries in the hash table + @param h Pointer to the hash table [khash_t(name)*] + @param kvar Variable to which key will be assigned + @param code Block of code to execute + */ +#define kh_foreach_key(h, kvar, code) { khint_t __i; \ + for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \ + if (!kh_exist(h,__i)) continue; \ + (kvar) = kh_key(h,__i); \ + code; \ + } } + +/*! @function + @abstract Iterate over the values in the hash table + @param h Pointer to the hash table [khash_t(name)*] + @param vvar Variable to which value will be assigned + @param code Block of code to execute + */ +#define kh_foreach_value(h, vvar, code) { khint_t __i; \ + for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \ + if (!kh_exist(h,__i)) continue; \ + (vvar) = kh_val(h,__i); \ + code; \ + } } + +/*! @function + @abstract Iterate over the entries in the hash table + @param h Pointer to the hash table [khash_t(name)*] + @param kvar Variable to which key will be assigned + @param rvar Variable to which value will be assigned + @param code Block of code to execute + */ +#define kh_foreach_key_value_ref(h, kvar, rvar, code) { khint_t __i; \ + for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \ + if (!kh_exist(h,__i)) continue; \ + (kvar) = kh_key(h,__i); \ + (rvar) = &kh_val(h,__i); \ + code; \ + } } + +/*! @function + @abstract Iterate over the values in the hash table + @param h Pointer to the hash table [khash_t(name)*] + @param rvar Variable to which value will be assigned + @param code Block of code to execute + */ +#define kh_foreach_value_ref(h, rvar, code) { khint_t __i; \ + for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \ + if (!kh_exist(h,__i)) continue; \ + (rvar) = &kh_val(h,__i); \ + code; \ + } } + +/* More conenient interfaces */ + +/*! @function + @abstract Instantiate a hash set containing integer keys + @param name Name of the hash table [symbol] + */ +#define KHASH_SET_INIT_INT(name) \ + KHASH_INIT(name, khint32_t, char, 0, kh_int_hash_func, kh_int_hash_equal) + +#define KHASH_SET_DECLARE_INT(name) \ + KHASH_DECLARE(name, khint32_t, char) + +#define KHASH_SET_IMPL_INT(name) \ + __KHASH_IMPL(name, , khint32_t, char, 0, kh_int_hash_func, kh_int_hash_equal) + +/*! @function + @abstract Instantiate a hash map containing integer keys + @param name Name of the hash table [symbol] + @param khval_t Type of values [type] + */ +#define KHASH_MAP_INIT_INT(name, khval_t) \ + KHASH_INIT(name, khint32_t, khval_t, 1, kh_int_hash_func, kh_int_hash_equal) + +#define KHASH_MAP_DECLARE_INT(name, khval_t) \ + KHASH_DECLARE(name, khint32_t, khval_t) + +#define KHASH_MAP_IMPL_INT(name, khval_t) \ + __KHASH_IMPL(name, , khint32_t, khval_t, 1, kh_int_hash_func, kh_int_hash_equal) + +/*! @function + @abstract Instantiate a hash map containing 64-bit integer keys + @param name Name of the hash table [symbol] + */ +#define KHASH_SET_INIT_INT64(name) \ + KHASH_INIT(name, khint64_t, char, 0, kh_int64_hash_func, kh_int64_hash_equal) + +#define KHASH_SET_DECLARE_INT64(name) \ + KHASH_DECLARE(name, khint64_t, char) + +#define KHASH_SET_IMPL_INT64(name) \ + __KHASH_IMPL(name, , khint64_t, char, 0, kh_int64_hash_func, kh_int64_hash_equal) + +/*! @function + @abstract Instantiate a hash map containing 64-bit integer keys + @param name Name of the hash table [symbol] + @param khval_t Type of values [type] + */ +#define KHASH_MAP_INIT_INT64(name, khval_t) \ + KHASH_INIT(name, khint64_t, khval_t, 1, kh_int64_hash_func, kh_int64_hash_equal) + +#define KHASH_MAP_DECLARE_INT64(name, khval_t) \ + KHASH_DECLARE(name, khint64_t, khval_t) + +#define KHASH_MAP_IMPL_INT64(name, khval_t) \ + __KHASH_IMPL(name, , khint64_t, khval_t, 1, kh_int64_hash_func, kh_int64_hash_equal) + +typedef const char *kh_cstr_t; +/*! @function + @abstract Instantiate a hash map containing const char* keys + @param name Name of the hash table [symbol] + */ +#define KHASH_SET_INIT_STR(name) \ + KHASH_INIT(name, kh_cstr_t, char, 0, kh_str_hash_func, kh_str_hash_equal) + +#define KHASH_SET_DECLARE_STR(name) \ + KHASH_DECLARE(name, kh_cstr_t, char) + +#define KHASH_SET_IMPL_STR(name) \ + __KHASH_IMPL(name, , kh_cstr_t, char, 0, kh_str_hash_func, kh_str_hash_equal) + +/*! @function + @abstract Instantiate a hash map containing const char* keys + @param name Name of the hash table [symbol] + @param khval_t Type of values [type] + */ +#define KHASH_MAP_INIT_STR(name, khval_t) \ + KHASH_INIT(name, kh_cstr_t, khval_t, 1, kh_str_hash_func, kh_str_hash_equal) + +#define KHASH_MAP_DECLARE_STR(name, khval_t) \ + KHASH_DECLARE(name, kh_cstr_t, khval_t) + +#define KHASH_MAP_IMPL_STR(name, khval_t) \ + __KHASH_IMPL(name, , kh_cstr_t, khval_t, 1, kh_str_hash_func, kh_str_hash_equal) + +#pragma GCC diagnostic pop + +#endif /* __AC_KHASH_H */ diff --git a/wrapperhelper/src/lang.c b/wrapperhelper/src/lang.c new file mode 100644 index 0000000..07b6d2c --- /dev/null +++ b/wrapperhelper/src/lang.c @@ -0,0 +1,1367 @@ +#include "lang.h" + +#include +#include +#include +#include +#include +#include + +#if 1 +#define DISP_ADDR_FMT "" +#define DISP_ADDR_ARG(v) +#else +#define DISP_ADDR_FMT "%p " +#define DISP_ADDR_ARG(v) v, +#endif + +preproc_token_t preproc_token_dup(preproc_token_t tok) { + preproc_token_t ret; + ret.tokt = tok.tokt; + switch (tok.tokt) { + case PPTOK_IDENT: + case PPTOK_IDENT_UNEXP: + case PPTOK_NUM: + ret.tokv.str = string_dup(tok.tokv.str); + if (!ret.tokv.str) { + ret.tokt = PPTOK_INVALID; + ret.tokv.c = '\0'; + } + break; + case PPTOK_STRING: + case PPTOK_INCL: + ret.tokv.sisstr = tok.tokv.sisstr; + ret.tokv.sstr = string_dup(tok.tokv.sstr); + if (!ret.tokv.sstr) { + ret.tokt = PPTOK_INVALID; + ret.tokv.c = '\0'; + } + string_del(tok.tokv.sstr); + break; + case PPTOK_INVALID: + case PPTOK_SYM: + case PPTOK_NEWLINE: + case PPTOK_BLANK: + case PPTOK_START_LINE_COMMENT: + case PPTOK_EOF: + ret.tokv.c = tok.tokv.c; + break; + } + return ret; +} + +void preproc_token_del(preproc_token_t *tok) { + switch (tok->tokt) { + case PPTOK_IDENT: + case PPTOK_IDENT_UNEXP: + case PPTOK_NUM: + string_del(tok->tokv.str); + break; + case PPTOK_STRING: + case PPTOK_INCL: + string_del(tok->tokv.sstr); + break; + case PPTOK_INVALID: + case PPTOK_SYM: + case PPTOK_NEWLINE: + case PPTOK_BLANK: + case PPTOK_START_LINE_COMMENT: + case PPTOK_EOF: + break; + } +} + +VECTOR_IMPL(preproc, preproc_token_del) + +void proc_token_del(proc_token_t *tok) { + switch (tok->tokt) { + case PTOK_IDENT: + case PTOK_NUM: + string_del(tok->tokv.str); + break; + case PTOK_STRING: + string_del(tok->tokv.sstr); + break; + case PTOK_PRAGMA: + switch (tok->tokv.pragma.typ) { + case PRAGMA_SIMPLE_SU: + case PRAGMA_EXPLICIT_CONV: + case PRAGMA_EXPLICIT_CONV_STRICT: + string_del(tok->tokv.pragma.val); + break; + case PRAGMA_ALLOW_INTS: + break; + } + break; + case PTOK_INVALID: + case PTOK_KEYWORD: + case PTOK_SYM: + case PTOK_EOF: + break; + } +} + +VECTOR_IMPL(proc, proc_token_del) + +const char *sym2str[LAST_SYM + 1] = { + [SYM_LBRACKET] = "{", + [SYM_RBRACKET] = "}", + [SYM_LSQBRACKET] = "[", + [SYM_RSQBRACKET] = "]", + [SYM_LPAREN] = "(", + [SYM_RPAREN] = ")", + [SYM_HASH] = "#", + [SYM_HASHHASH] = "##", + [SYM_SEMICOLON] = ";", + [SYM_COLON] = ":", + [SYM_COLONCOLON] = "::", + [SYM_VARIADIC] = "...", + [SYM_QUESTION] = "?", + [SYM_DOT] = ".", + [SYM_DASHGT] = "->", + [SYM_TILDE] = "~", + [SYM_EXCL] = "!", + [SYM_PLUS] = "+", + [SYM_DASH] = "-", + [SYM_STAR] = "*", + [SYM_SLASH] = "/", + [SYM_PERCENT] = "%", + [SYM_HAT] = "^", + [SYM_AMP] = "&", + [SYM_PIPE] = "|", + [SYM_EQ] = "=", + [SYM_PLUSEQ] = "+=", + [SYM_DASHEQ] = "-=", + [SYM_STAREQ] = "*=", + [SYM_SLASHEQ] = "/=", + [SYM_PERCENTEQ] = "%=", + [SYM_HATEQ] = "^=", + [SYM_AMPEQ] = "&=", + [SYM_PIPEEQ] = "|=", + [SYM_EQEQ] = "==", + [SYM_EXCLEQ] = "!=", + [SYM_LT] = "<", + [SYM_GT] = ">", + [SYM_LTEQ] = "<=", + [SYM_GTEQ] = ">=", + [SYM_AMPAMP] = "&&", + [SYM_PIPEPIPE] = "||", + [SYM_LTLT] = "<<", + [SYM_GTGT] = ">>", + [SYM_LTLTEQ] = "<<=", + [SYM_GTGTEQ] = ">>=", + [SYM_PLUSPLUS] = "++", + [SYM_DASHDASH] = "--", + [SYM_COMMA] = ",", +}; + +void preproc_token_print(const preproc_token_t *tok) { + printf("Token: "); + loginfo_print(&tok->loginfo, 50); + switch (tok->tokt) { + case PPTOK_INVALID: + printf("%7s %hhd (%c)\n", "#INVAL#", tok->tokv.c, (tok->tokv.c >= 0x20) && (tok->tokv.c < 0x7F) ? tok->tokv.c : '?'); + break; + case PPTOK_IDENT: + printf("%7s '%s'\n", "IDENT", string_content(tok->tokv.str)); + break; + case PPTOK_IDENT_UNEXP: + printf("%7s '%s'\n", "IDENT'", string_content(tok->tokv.str)); + break; + case PPTOK_NUM: + printf("%7s '%s'\n", "NUM", string_content(tok->tokv.str)); + break; + case PPTOK_STRING: + printf("%7s %c%s%c\n", "STRING", + tok->tokv.sisstr ? '"' : '\'', string_content(tok->tokv.sstr), tok->tokv.sisstr ? '"' : '\''); + break; + case PPTOK_INCL: + printf("%7s %c%s%c\n", "INCL", + tok->tokv.sisstr ? '"' : '<', string_content(tok->tokv.sstr), tok->tokv.sisstr ? '"' : '>'); + break; + case PPTOK_SYM: + printf("%7s %-3s (%u)\n", "SYM", sym2str[tok->tokv.sym], tok->tokv.sym); + break; + case PPTOK_NEWLINE: + printf("%7s\n", "NEWLINE"); + break; + case PPTOK_BLANK: + printf("%7s\n", "\e[2;31m(blank)\e[m"); + break; + case PPTOK_START_LINE_COMMENT: + printf("%7s\n", "\e[2;31m( // ) \e[m"); + break; + case PPTOK_EOF: + printf("%7s\n", "EOF"); + break; + default: + printf("??? %u\n", tok->tokt); + } +} + +int preproc_token_isend(const preproc_token_t *tok) { + switch (tok->tokt) { + case PPTOK_IDENT: + case PPTOK_IDENT_UNEXP: + case PPTOK_NUM: + case PPTOK_STRING: + case PPTOK_INCL: + case PPTOK_SYM: + case PPTOK_NEWLINE: + case PPTOK_BLANK: + case PPTOK_START_LINE_COMMENT: + return 0; + case PPTOK_INVALID: + case PPTOK_EOF: + default: + return 1; + } +} + +const char *kw2str[LAST_KEYWORD + 1] = { + [KW_ALIGNAS] = "_Alignas", + [KW_ALIGNOF] = "_Alignof", + [KW_ATOMIC] = "_Atomic", + [KW_AUTO] = "auto", + [KW_BOOL] = "_Bool", + [KW_BREAK] = "break", + [KW_CASE] = "case", + [KW_CHAR] = "char", + [KW_COMPLEX] = "_Complex", + [KW_CONST] = "const", + [KW_CONTINUE] = "continue", + [KW_DEFAULT] = "default", + [KW_DO] = "do", + [KW_DOUBLE] = "double", + [KW_ELSE] = "else", + [KW_ENUM] = "enum", + [KW_EXTERN] = "extern", + [KW_FLOAT] = "float", + [KW_FLOAT128] = "__float128", + [KW_FOR] = "for", + [KW_GENERIC] = "_Generic", + [KW_GOTO] = "goto", + [KW_IF] = "if", + [KW_IMAGINARY] = "_Imaginary", + [KW_INLINE] = "inline", + [KW_INT] = "int", + [KW_INT128] = "__int128", + [KW_LONG] = "long", + [KW_NORETURN] = "_Noreturn", + [KW_REGISTER] = "register", + [KW_RESTRICT] = "restrict", + [KW_RETURN] = "return", + [KW_SHORT] = "short", + [KW_SIGNED] = "signed", + [KW_SIZEOF] = "sizeof", + [KW_STATIC] = "static", + [KW_STATIC_ASSERT] = "_Static_assert", + [KW_STRUCT] = "struct", + [KW_SWITCH] = "switch", + [KW_THREAD_LOCAL] = "_Thread_local", + [KW_TYPEDEF] = "typedef", + [KW_UNION] = "union", + [KW_UNSIGNED] = "unsigned", + [KW_VOID] = "void", + [KW_VOLATILE] = "volatile", + [KW_WHILE] = "while", +}; + +void proc_token_print(const proc_token_t *tok) { + printf("Token: "); + loginfo_print(&tok->loginfo, 50); + switch (tok->tokt) { + case PTOK_INVALID: + printf("%7s %hhd (%c)\n", "#INVAL#", tok->tokv.c, (tok->tokv.c >= 0x20) && (tok->tokv.c < 0x7F) ? tok->tokv.c : '?'); + break; + case PTOK_IDENT: + printf("%7s '%s'\n", "IDENT", string_content(tok->tokv.str)); + break; + case PTOK_KEYWORD: + printf("%7s '%s' (%u)\n", "KEYWORD", kw2str[tok->tokv.kw], tok->tokv.kw); + break; + case PTOK_NUM: + printf("%7s '%s'\n", "NUM", string_content(tok->tokv.str)); + break; + case PTOK_STRING: + printf("%7s %c%s%c\n", "STRING", + tok->tokv.sisstr ? '"' : '\'', string_content(tok->tokv.sstr), tok->tokv.sisstr ? '"' : '\''); + break; + case PTOK_SYM: + printf("%7s %-3s (%u)\n", "SYM", sym2str[tok->tokv.sym], tok->tokv.sym); + break; + case PTOK_PRAGMA: + switch (tok->tokv.pragma.typ) { + case PRAGMA_ALLOW_INTS: + printf("%7s Allow ints\n", "PRAGMA"); + break; + case PRAGMA_SIMPLE_SU: + printf("%7s Mark simple: struct or union %s is simple\n", "PRAGMA", string_content(tok->tokv.pragma.val)); + break; + case PRAGMA_EXPLICIT_CONV: + printf("%7s Relaxed explicit conversion: destination is %s\n", "PRAGMA", string_content(tok->tokv.pragma.val)); + break; + case PRAGMA_EXPLICIT_CONV_STRICT: + printf("%7s Strict explicit conversion: destination is %s\n", "PRAGMA", string_content(tok->tokv.pragma.val)); + break; + default: + printf("%7s ??? %u\n", "PRAGMA", tok->tokv.pragma.typ); + } + break; + case PTOK_EOF: + printf("%7s\n", "EOF"); + break; + default: + printf("??? %u\n", tok->tokt); + } +} + +int proc_token_iserror(const proc_token_t *tok) { + switch (tok->tokt) { + case PTOK_IDENT: + case PTOK_KEYWORD: + case PTOK_NUM: + case PTOK_STRING: + case PTOK_SYM: + case PTOK_PRAGMA: + case PTOK_EOF: + return 0; + case PTOK_INVALID: + default: + return 1; + } +} + +int proc_token_isend(const proc_token_t *tok) { + switch (tok->tokt) { + case PTOK_IDENT: + case PTOK_KEYWORD: + case PTOK_NUM: + case PTOK_STRING: + case PTOK_SYM: + case PTOK_PRAGMA: + return 0; + case PTOK_INVALID: + case PTOK_EOF: + default: + return 1; + } +} + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wanalyzer-null-dereference" +KHASH_MAP_IMPL_STR(str2kw, enum token_keyword_type_e) +KHASH_MAP_IMPL_STR(type_map, type_t*) +KHASH_MAP_IMPL_STR(decl_map, declaration_t*) +KHASH_MAP_IMPL_STR(struct_map, struct_t*) +KHASH_MAP_IMPL_STR(const_map, num_constant_t) +#pragma GCC diagnostic pop +khash_t(str2kw) *str2kw; + +int init_str2kw(void) { + if (!(str2kw = kh_init(str2kw))) { + log_memory("failed to create the string to keyword map (init)\n"); + return 0; + } + int iret; khiter_t it; + for (enum token_keyword_type_e kw = 0; kw <= LAST_KEYWORD; ++kw) { + it = kh_put(str2kw, str2kw, kw2str[kw], &iret); + if (iret < 0) { + log_memory("failed to create the string to keyword map (keyword %u)\n", kw); + kh_destroy(str2kw, str2kw); + return 0; + } + kh_val(str2kw, it) = kw; + } +#define ADD_ALIAS(alias, k) \ + it = kh_put(str2kw, str2kw, #alias, &iret); \ + if (iret < 0) { \ + log_memory("failed to create the string to keyword map (keyword alias " #alias ")\n"); \ + kh_destroy(str2kw, str2kw); \ + return 0; \ + } \ + kh_val(str2kw, it) = KW_ ## k; + ADD_ALIAS(__alignof__, ALIGNOF) + // ADD_ALIAS(__asm, asm) + // ADD_ALIAS(__asm__, asm) + ADD_ALIAS(__complex, COMPLEX) + ADD_ALIAS(__complex__, COMPLEX) + ADD_ALIAS(__const, CONST) + ADD_ALIAS(__const__, CONST) + // ADD_ALIAS(__decltype, decltype) + // ADD_ALIAS(__imag__, __imag) + ADD_ALIAS(__inline, INLINE) + ADD_ALIAS(__inline__, INLINE) + // ADD_ALIAS(__nullptr, nullptr) + // ADD_ALIAS(__real__, __real) + ADD_ALIAS(__restrict, RESTRICT) + ADD_ALIAS(__restrict__, RESTRICT) + ADD_ALIAS(__signed, SIGNED) + ADD_ALIAS(__signed__, SIGNED) + // ADD_ALIAS(__typeof, typeof) + // ADD_ALIAS(__typeof__, typeof) + ADD_ALIAS(__volatile, VOLATILE) + ADD_ALIAS(__volatile__, VOLATILE) + return 1; +} +void del_str2kw(void) { + kh_destroy(str2kw, str2kw); +} + +// ptr_is_32bits is actually long_is_32bits +int num_constant_convert(loginfo_t *li, string_t *str, num_constant_t *cst, int ptr_is_32bits) { + if (string_len(str) == 0) return 0; // Should never happen +#define contains(c) strchr(string_content(str), c) + if (contains('.') + || (!(contains('X') || contains('x')) && (contains('E') || contains('e'))) + || ((contains('X') || contains('x')) && (contains('P') || contains('p')))) { +#undef contains + int ok; + if ((string_end(str)[-1] == 'l') || (string_end(str)[-1] == 'L')) { + cst->typ = NCT_LDOUBLE; + char *endc; + cst->val.l = strtold(string_content(str), &endc); + ok = (endc == string_end(str) - 1); + } else if ((string_end(str)[-1] == 'f') || (string_end(str)[-1] == 'F')) { + cst->typ = NCT_FLOAT; + char *endc; + cst->val.f = strtof(string_content(str), &endc); + ok = (endc == string_end(str) - 1); + } else { + cst->typ = NCT_DOUBLE; + char *endc; + cst->val.d = strtod(string_content(str), &endc); + ok = (endc == string_end(str)); + } + if (!ok) { + log_error(li, "'%s' is not a valid number\n", string_content(str)); + return 0; + } else if (errno == ERANGE) { + log_warning(li, "floating point constant is too large\n"); + return 1; + } + return 1; + } else { + uint64_t ret = 0; + unsigned base = (string_content(str)[0] == '0') ? (string_content(str)[1] == 'x') ? 16 : 8 : 10; + size_t startidx = (base == 16) ? 2 : 0; + size_t endidx = string_len(str); + int suffix_type = 0; +#define SUFFIX_U 1 +#define SUFFIX_L 2 +#define SUFFIX_LL 4 +#define SUFFIX_SGN SUFFIX_U +#define SUFFIX_SZ (SUFFIX_L | SUFFIX_LL) + remove_suffix: + if ((string_content(str)[endidx - 1] == 'l') || (string_content(str)[endidx - 1] == 'L')) { + if (suffix_type & SUFFIX_SZ) { + log_error(li, "'%s' is not a valid number (invalid suffix)\n", string_content(str)); + return 0; + } + if (endidx == 1) return 0; // Should never happen + if ((string_content(str)[endidx - 2] == 'l') || (string_content(str)[endidx - 2] == 'L')) { + if (endidx == 2) return 0; // Should never happen + if (string_content(str)[endidx - 2] != string_content(str)[endidx - 1]) { + log_error(li, "'%s' is not a valid number (invalid suffix)\n", string_content(str)); + return 0; + } + endidx -= 2; + suffix_type |= SUFFIX_LL; + } else { + endidx -= 1; + suffix_type |= SUFFIX_L; + } + goto remove_suffix; + } + if ((string_content(str)[endidx - 1] == 'u') || (string_content(str)[endidx - 1] == 'U')) { + if (suffix_type & SUFFIX_SGN) { + log_error(li, "'%s' is not a valid number (invalid suffix)\n", string_content(str)); + return 0; + } + endidx -= 1; + suffix_type |= SUFFIX_U; + goto remove_suffix; + } + // 0u has startidx=0 endidx=1 + if (endidx <= startidx) { + log_error(li, "'%s' is not a valid number\n", string_content(str)); + } + for (size_t i = startidx; i < endidx; ++i) { + if ((string_content(str)[i] >= '0') && (string_content(str)[i] <= ((base == 8) ? '7' : '9'))) { + ret = base * ret + (unsigned)(string_content(str)[i] - '0'); + } else if ((base == 16) && (string_content(str)[i] >= 'A') && (string_content(str)[i] <= 'F')) { + ret = base * ret + 10 + (unsigned)(string_content(str)[i] - 'A'); + } else if ((base == 16) && (string_content(str)[i] >= 'a') && (string_content(str)[i] <= 'f')) { + ret = base * ret + 10 + (unsigned)(string_content(str)[i] - 'a'); + } else { + log_error(li, "'%s' is not a valid number\n", string_content(str)); + return 0; + } + } + // If base == 10, keep the signness; in any case, try 32 bits if available else use 64 bits + cst->typ = + ((suffix_type & SUFFIX_SGN) == SUFFIX_U) ? + ((suffix_type & SUFFIX_SZ) == SUFFIX_L) ? ptr_is_32bits ? NCT_UINT32 : NCT_UINT64 : + ((suffix_type & SUFFIX_SZ) == SUFFIX_LL) ? NCT_UINT64 : + NCT_UINT32 : + ((suffix_type & SUFFIX_SZ) == SUFFIX_L) ? ptr_is_32bits ? NCT_INT32 : NCT_INT64 : + ((suffix_type & SUFFIX_SZ) == SUFFIX_LL) ? NCT_INT64 : + NCT_INT32; + if (cst->typ == NCT_INT32) { + if (ret < 1ULL << 31) { + cst->val.i32 = (int32_t)ret; + return 1; + } + // Not in signed 32-bits = int => try long/long long for decimal, unsigned for hexadecimal/octal + if (base != 10) cst->typ = NCT_UINT32; + else cst->typ = NCT_INT64; + } + if (cst->typ == NCT_UINT32) { + if (ret < 1ULL << 32) { + cst->val.u32 = (uint32_t)ret; + return 1; + } + // Not in unsigned 32-bits = unsigned => try unsigned long/long long for decimal and unsigned, long/long long for signed hexadecimal/octal + if ((base != 10) && ((suffix_type & SUFFIX_SGN) != SUFFIX_U)) cst->typ = NCT_INT64; + else cst->typ = NCT_UINT64; + } + if (cst->typ == NCT_INT64) { + if (ret < 1ULL << 63) { + cst->val.i64 = (int64_t)ret; + return 1; + } + // Not in signed 64-bits = long/long long => fail for decimal, try unsigned long/long long for hexadecimal/octal + if (base != 10) cst->typ = NCT_UINT64; + } + if (cst->typ == NCT_UINT64) { + cst->val.u64 = ret; + return 1; + } + // The constant cannot be typed... (Or internal error) + return 0; + } +} + +void expr_del(expr_t *e) { + switch (e->typ) { + case ETY_VAR: + string_del(e->val.var); + break; + + case ETY_CONST: + break; + + // case ETY_GENERIC: + // TODO + + case ETY_CALL: + expr_del(e->val.call.fun); + for (size_t i = 0; i < e->val.call.nargs; ++i) { + expr_del(e->val.call.args[i]); + } + if (e->val.call.args) free(e->val.call.args); + break; + + case ETY_ACCESS: + case ETY_PTRACCESS: + expr_del(e->val.access.val); + string_del(e->val.access.member); + break; + + case ETY_UNARY: + expr_del(e->val.unary.e); + break; + + case ETY_BINARY: + expr_del(e->val.binary.e1); + expr_del(e->val.binary.e2); + break; + + case ETY_TERNARY: + expr_del(e->val.ternary.e1); + expr_del(e->val.ternary.e2); + expr_del(e->val.ternary.e3); + break; + + // case ETY_INIT_LIST: + // TODO + + case ETY_CAST: + type_del(e->val.cast.typ); + expr_del(e->val.cast.e); + break; + } + free(e); +} + +static void expr_print_aux(expr_t *e, int parent_level) { + switch (e->typ) { + case ETY_VAR: + // Level 0, no parenthesis + printf("%s", string_content(e->val.var)); + break; + + case ETY_CONST: + // Level 0, no parenthesis + switch (e->val.cst.typ) { + case NCT_FLOAT: printf("%ff", e->val.cst.val.f); break; + case NCT_DOUBLE: printf("%f", e->val.cst.val.d); break; + case NCT_LDOUBLE: printf("%Lfl", e->val.cst.val.l); break; + case NCT_INT32: printf("%d", e->val.cst.val.i32); break; + case NCT_UINT32: printf("%uu", e->val.cst.val.u32); break; + case NCT_INT64: printf("%ldll", e->val.cst.val.i64); break; + case NCT_UINT64: printf("%lullu", e->val.cst.val.u64); break; + } + break; + + case ETY_CALL: + // Level 1, no parenthesis + expr_print_aux(e->val.call.fun, 1); + printf("("); + for (size_t i = 0; i < e->val.call.nargs; ++i) { + expr_print_aux(e->val.call.fun, 15); + } + printf(")"); + break; + + case ETY_ACCESS: + // Level 1, no parenthesis + expr_print_aux(e->val.access.val, 1); + printf(".%s", string_content(e->val.access.member)); + break; + + case ETY_PTRACCESS: + // Level 1, no parenthesis + expr_print_aux(e->val.access.val, 1); + printf(".%s", string_content(e->val.access.member)); + break; + + case ETY_UNARY: { + const char *preop = NULL; + switch (e->val.unary.typ) { + case UOT_POSTINCR: + // Level 1, no parenthesis + expr_print_aux(e->val.unary.e, 1); + printf("++"); + break; + case UOT_POSTDECR: + // Level 1, no parenthesis + expr_print_aux(e->val.unary.e, 1); + printf("--"); + break; + case UOT_PREINCR: preop = "++"; break; + case UOT_PREDECR: preop = "--"; break; + case UOT_REF: preop = "&"; break; + case UOT_POS: preop = "+"; break; + case UOT_NEG: preop = "-"; break; + case UOT_DEREF: preop = "*"; break; + case UOT_ANOT: preop = "~"; break; + case UOT_BNOT: preop = "!"; break; + } + if (preop) { + if (parent_level < 2) printf("("); + printf("%s", preop); + expr_print_aux(e->val.unary.e, 2); + if (parent_level < 2) printf(")"); + } + break; } + + case ETY_BINARY: { + const char *midop, *postop = NULL; + int mlevel, llevel, rlevel; + switch (e->val.binary.typ) { + case BOT_ADD: mlevel = 5; llevel = 5; rlevel = 4; midop = " + "; break; + case BOT_SUB: mlevel = 5; llevel = 5; rlevel = 4; midop = " - "; break; + case BOT_MUL: mlevel = 4; llevel = 4; rlevel = 3; midop = " * "; break; + case BOT_DIV: mlevel = 4; llevel = 4; rlevel = 3; midop = " / "; break; + case BOT_MOD: mlevel = 4; llevel = 4; rlevel = 3; midop = " % "; break; + case BOT_LSH: mlevel = 6; llevel = 6; rlevel = 5; midop = " << "; break; + case BOT_RSH: mlevel = 6; llevel = 6; rlevel = 5; midop = " >> "; break; + case BOT_LT: mlevel = 7; llevel = 7; rlevel = 6; midop = " < "; break; + case BOT_GT: mlevel = 7; llevel = 7; rlevel = 6; midop = " > "; break; + case BOT_LE: mlevel = 7; llevel = 7; rlevel = 6; midop = " <= "; break; + case BOT_GE: mlevel = 7; llevel = 7; rlevel = 6; midop = " >= "; break; + case BOT_EQ: mlevel = 8; llevel = 8; rlevel = 7; midop = " == "; break; + case BOT_NE: mlevel = 8; llevel = 8; rlevel = 7; midop = " != "; break; + case BOT_AAND: mlevel = 9; llevel = 9; rlevel = 8; midop = " & "; break; + case BOT_AXOR: mlevel = 10; llevel = 10; rlevel = 9; midop = " ^ "; break; + case BOT_AOR: mlevel = 11; llevel = 11; rlevel = 10; midop = " | "; break; + case BOT_BAND: mlevel = 12; llevel = 12; rlevel = 11; midop = " && "; break; + case BOT_BOR: mlevel = 13; llevel = 13; rlevel = 12; midop = " || "; break; + case BOT_ASSGN_EQ: mlevel = 15; llevel = 2; rlevel = 15; midop = " = "; break; + case BOT_ASSGN_ADD: mlevel = 15; llevel = 2; rlevel = 15; midop = " += "; break; + case BOT_ASSGN_SUB: mlevel = 15; llevel = 2; rlevel = 15; midop = " -= "; break; + case BOT_ASSGN_MUL: mlevel = 15; llevel = 2; rlevel = 15; midop = " *= "; break; + case BOT_ASSGN_DIV: mlevel = 15; llevel = 2; rlevel = 15; midop = " /= "; break; + case BOT_ASSGN_MOD: mlevel = 15; llevel = 2; rlevel = 15; midop = " %= "; break; + case BOT_ASSGN_LSH: mlevel = 15; llevel = 2; rlevel = 15; midop = " <<= "; break; + case BOT_ASSGN_RSH: mlevel = 15; llevel = 2; rlevel = 15; midop = " >>= "; break; + case BOT_ASSGN_AAND: mlevel = 15; llevel = 2; rlevel = 15; midop = " &= "; break; + case BOT_ASSGN_AXOR: mlevel = 15; llevel = 2; rlevel = 15; midop = " ^= "; break; + case BOT_ASSGN_AOR: mlevel = 15; llevel = 2; rlevel = 15; midop = " |= "; break; + case BOT_COMMA: mlevel = 16; llevel = 16; rlevel = 15; midop = ", "; break; + case BOT_ARRAY: mlevel = 1; llevel = 1; rlevel = 16; midop = "["; postop = "]"; break; + default: mlevel = 17; llevel = rlevel = -1; midop = " ? "; break; + } + if (parent_level < mlevel) printf("("); + expr_print_aux(e->val.binary.e1, llevel); + printf("%s", midop); + expr_print_aux(e->val.binary.e2, rlevel); + if (postop) printf("%s", midop); + if (parent_level < mlevel) printf(")"); + break; } + + case ETY_TERNARY: + switch (e->val.ternary.typ) { + case TOT_COND: + if (parent_level < 15) printf("("); + expr_print_aux(e->val.ternary.e1, 14); + printf(" ? "); + expr_print_aux(e->val.ternary.e2, 16); + expr_print_aux(e->val.ternary.e2, 15); + printf(" : "); + if (parent_level < 15) printf(")"); + break; + } + break; + + case ETY_CAST: + if (parent_level < 3) printf("("); + printf("("); + type_print(e->val.cast.typ); + printf(")"); + expr_print(e->val.cast.e); + if (parent_level < 3) printf(")"); + break; + } +} +void expr_print(expr_t *e) { + return expr_print_aux(e, 16); +} + +void struct_del_weak(struct_t *st) { + if (--st->nrefs) return; + if (!st->tag) struct_del(st); +} +void type_del(type_t *typ) { + if (--typ->nrefs) return; + if (typ->converted) string_del(typ->converted); + switch (typ->typ) { + case TYPE_BUILTIN: + break; + case TYPE_ARRAY: + type_del(typ->val.array.typ); + break; + case TYPE_STRUCT_UNION: + struct_del_weak(typ->val.st); + break; + case TYPE_ENUM: + case TYPE_PTR: + type_del(typ->val.typ); + break; + case TYPE_FUNCTION: + type_del(typ->val.fun.ret); + if (typ->val.fun.nargs != (size_t)-1) { + for (size_t i = 0; i < typ->val.fun.nargs; ++i) { + type_del(typ->val.fun.args[i]); + } + } + if (typ->val.fun.args) free(typ->val.fun.args); + break; + } + free(typ); +} +void type_map_del(khash_t(type_map) *map) { + kh_cstr_t str; + type_t **it; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" + kh_foreach_key_value_ref(map, str, it, free((void*)str); type_del(*it)) +#pragma GCC diagnostic pop + kh_destroy(type_map, map); +} +void conv_map_del(khash_t(conv_map) *map) { + type_t *typ; + string_t **conv; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" + kh_foreach_key_value_ref(map, typ, conv, type_del(typ); string_del(*conv)) +#pragma GCC diagnostic pop + kh_destroy(conv_map, map); +} +void type_set_del(khash_t(type_set) *set) { + type_t *it; + kh_foreach_key(set, it, type_del(it)) + kh_destroy(type_set, set); +} + +void const_map_del(khash_t(const_map) *map) { + kh_cstr_t str; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" + kh_foreach_key(map, str, free((void*)str)) +#pragma GCC diagnostic pop + kh_destroy(const_map, map); +} + +void decl_del(declaration_t *decl) { + type_del(decl->typ); + free(decl); +} +void decl_map_del(khash_t(decl_map) *map) { + kh_cstr_t str; + declaration_t **it; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" + kh_foreach_key_value_ref(map, str, it, free((void*)str); decl_del(*it)) +#pragma GCC diagnostic pop + kh_destroy(decl_map, map); +} + +void st_member_del(st_member_t *member) { + if (member->name) string_del(member->name); + type_del(member->typ); +} + +void struct_del(struct_t *st) { + if (st->tag) { + string_del(st->tag); + st->tag = NULL; + } + if (st->is_defined) { + for (size_t i = 0; i < st->nmembers; ++i) { + st_member_del(&st->members[i]); + } + free(st->members); + st->is_defined = 0; + } + if (!st->nrefs) free(st); +} +void struct_map_del(khash_t(struct_map) *map) { + // The keys are the tag in the struct_t + struct_t **it; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" + kh_foreach_value_ref(map, it, struct_del(*it)) +#pragma GCC diagnostic pop + kh_destroy(struct_map, map); +} + +type_t *type_new(void) { + type_t *ret = malloc(sizeof *ret); + if (!ret) { + log_memory("failed to create a new type\n"); + return NULL; + } + ret->szinfo.align = ret->szinfo.size = 0; + ret->is_atomic = ret->is_const = ret->is_restrict = ret->is_volatile = ret->is_incomplete = ret->is_validated = ret->_internal_use = 0; + ret->converted = NULL; + ret->nrefs = 1; + ret->typ = TYPE_BUILTIN; + ret->val.builtin = BTT_INT; + return ret; +} +type_t *type_new_ptr(type_t *target) { + type_t *ret = malloc(sizeof *ret); + if (!ret) { + log_memory("failed to create a new pointer type\n"); + return NULL; + } + ret->szinfo.align = ret->szinfo.size = 0; + ret->is_atomic = ret->is_const = ret->is_restrict = ret->is_volatile = ret->is_incomplete = ret->is_validated = ret->_internal_use = 0; + ret->converted = NULL; + ret->nrefs = 1; + ret->typ = TYPE_PTR; + ret->val.typ = target; + return ret; +} +int type_copy_into(type_t *dest, const type_t *ref) { + size_t nrefs = dest->nrefs; + _Bool is_atomic = dest->is_atomic; + _Bool is_const = dest->is_const; + _Bool is_restrict = dest->is_restrict; + _Bool is_volatile = dest->is_volatile; + memcpy(dest, ref, sizeof *dest); + switch (ref->typ) { + case TYPE_BUILTIN: + break; + case TYPE_ARRAY: + ++ref->val.array.typ->nrefs; + break; + case TYPE_STRUCT_UNION: + ++dest->val.st->nrefs; + break; + case TYPE_ENUM: + case TYPE_PTR: + ++ref->val.typ->nrefs; + break; + case TYPE_FUNCTION: + ++ref->val.fun.ret->nrefs; + if (ref->val.fun.nargs != (size_t)-1) { + if (!ref->val.fun.args) { + break; + } + type_t **args = malloc(sizeof *args * ref->val.fun.nargs); + if (!args) { + log_memory("failed to allocate new argument array\n"); + return 0; + } + for (size_t i = 0; i < ref->val.fun.nargs; ++i) { + ++ref->val.fun.args[i]->nrefs; + args[i] = ref->val.fun.args[i]; + } + dest->val.fun.args = args; + } + break; + } + dest->is_atomic |= is_atomic; + dest->is_const |= is_const; + dest->is_restrict |= is_restrict; + dest->is_volatile |= is_volatile; + dest->nrefs = nrefs; + return 1; +} + +struct_t *struct_new(int is_struct, string_t *tag) { + struct_t *ret = malloc(sizeof *ret); + if (!ret) { + log_memory("Error: failed to create a new struct\n"); + return NULL; + } + ret->is_struct = is_struct; + ret->tag = tag; + ret->is_defined = 0; + ret->is_simple = 0; + ret->nrefs = 1; + ret->has_self_recursion = 0; // Undefined structures cannot have self recursion + return ret; +} + +khint_t type_t_hash(type_t *typ) { + switch (typ->typ) { + case TYPE_BUILTIN: return kh_int_hash_func(typ->val.builtin); + case TYPE_ARRAY: return kh_int_hash_func((typ->val.array.array_sz << 12) + type_t_hash(typ->val.array.typ)); + case TYPE_STRUCT_UNION: + if (typ->val.st->tag) { + return kh_str_hash_func(string_content(typ->val.st->tag)); + } else { + khint64_t acc = (typ->val.st->nmembers << 5) + 1; + for (size_t i = 0; i < typ->val.st->nmembers; ++i) { + acc += (khint64_t)type_t_hash(typ->val.st->members[i].typ) << ((1ull << (i % 64)) % 61); + } + return kh_int64_hash_func(acc); + } + case TYPE_ENUM: + case TYPE_PTR: + return kh_int_hash_func(type_t_hash(typ->val.typ)); + case TYPE_FUNCTION: { + khint64_t acc = type_t_hash(typ->val.fun.ret) + typ->val.fun.nargs * 73 + (size_t)typ->val.fun.has_varargs * 77; + if (typ->val.fun.nargs != (size_t)-1) { + for (size_t i = 0; i < typ->val.fun.nargs; ++i) { + acc += (khint64_t)type_t_hash(typ->val.fun.args[i]) << ((3ull << (i % 64)) % 53); + } + } + return kh_int64_hash_func(acc); } + default: return 0; + } +} +int type_t_equal_aux(type_t *typ1, type_t *typ2, int is_strict) { + if (is_strict && ( + (typ1->is_atomic != typ2->is_atomic) || (typ1->is_const != typ2->is_const) + || (typ1->is_restrict != typ2->is_restrict) || (typ1->is_volatile != typ2->is_volatile))) { + return 0; + } + if (typ1->typ != typ2->typ) return 0; + switch (typ1->typ) { + case TYPE_BUILTIN: return typ1->val.builtin == typ2->val.builtin; + case TYPE_ARRAY: return (typ1->val.array.array_sz == typ2->val.array.array_sz) && type_t_equal_aux(typ1->val.array.typ, typ2->val.array.typ, is_strict); + case TYPE_STRUCT_UNION: + // This will not do an infinite recursion since only unnamed struct/unions will compare their members + if (!typ1->val.st->tag != !typ2->val.st->tag) return 0; + if (typ1->val.st->tag) return !strcmp(string_content(typ1->val.st->tag), string_content(typ2->val.st->tag)); + if (!typ1->val.st->is_defined || !typ2->val.st->is_defined) { + log_warning_nopos("comparing against incomplete anonymous structure/union\n"); + return 0; + } + if (typ1->val.st->nmembers != typ2->val.st->nmembers) return 0; + for (size_t i = 0; i < typ1->val.st->nmembers; ++i) { + if (!!typ1->val.st->members[i].name != !!typ2->val.st->members[i].name) return 0; + if (typ1->val.st->members[i].name + && strcmp(string_content(typ1->val.st->members[i].name), string_content(typ2->val.st->members[i].name))) + return 0; + if (!type_t_equal_aux(typ1->val.st->members[i].typ, typ2->val.st->members[i].typ, is_strict)) return 0; + } + return 1; + case TYPE_ENUM: + case TYPE_PTR: + return type_t_equal_aux(typ1->val.typ, typ2->val.typ, is_strict); + case TYPE_FUNCTION: + if (typ1->val.fun.nargs != typ2->val.fun.nargs) return 0; + if (typ1->val.fun.has_varargs != typ2->val.fun.has_varargs) return 0; + if (!type_t_equal_aux(typ1->val.fun.ret, typ2->val.fun.ret, is_strict)) return 0; + if (typ1->val.fun.nargs != (size_t)-1) { + for (size_t i = 0; i < typ1->val.fun.nargs; ++i) { + if (!type_t_equal_aux(typ1->val.fun.args[i], typ2->val.fun.args[i], is_strict)) return 0; + } + } + return 1; + default: return 0; + } +} +int type_t_equal_lax(type_t *typ1, type_t *typ2) { + return type_t_equal_aux(typ1, typ2, 0); +} +int type_t_equal(type_t *typ1, type_t *typ2) { + return type_t_equal_aux(typ1, typ2, 1); +} +__KHASH_IMPL(type_set, , type_t*, char, 0, type_t_hash, type_t_equal) +__KHASH_IMPL(conv_map, , type_t*, string_t*, 1, type_t_hash, type_t_equal_lax) + +type_t *type_try_merge(type_t *typ, khash_t(type_set) *set) { + int iret; + khiter_t it = kh_put(type_set, set, typ, &iret); + if (iret < 0) { + log_memory("Error: failed to add type to type_set\n"); + return NULL; + } else if (iret == 0) { + if (typ == kh_key(set, it)) return typ; + kh_key(set, it)->is_incomplete &= typ->is_incomplete; // In case we have a recursive structure + type_del(typ); + ++kh_key(set, it)->nrefs; + return kh_key(set, it); + } else { + ++typ->nrefs; + } + type_t *typ2; + switch (typ->typ) { + case TYPE_BUILTIN: + return typ; + case TYPE_ARRAY: + typ2 = type_try_merge(typ->val.array.typ, set); + if (typ2) typ->val.array.typ = typ2; + else return NULL; + return typ; + case TYPE_STRUCT_UNION: + if (typ->val.st->is_defined) { + for (size_t i = 0; i < typ->val.st->nmembers; ++i) { + typ2 = type_try_merge(typ->val.st->members[i].typ, set); + if (typ2) typ->val.st->members[i].typ = typ2; + else return NULL; + } + } + return typ; + case TYPE_ENUM: + case TYPE_PTR: + typ2 = type_try_merge(typ->val.typ, set); + if (typ2) typ->val.typ = typ2; + else return NULL; + return typ; + case TYPE_FUNCTION: + typ2 = type_try_merge(typ->val.fun.ret, set); + if (typ2) typ->val.fun.ret = typ2; + else return NULL; + + if (typ->val.fun.nargs != (size_t)-1) { + for (size_t i = 0; i < typ->val.fun.nargs; ++i) { + typ2 = type_try_merge(typ->val.fun.args[i], set); + if (typ2) typ->val.fun.args[i] = typ2; + else return NULL; + } + } + return typ; + + default: return NULL; + } +} + +const char *builtin2str[LAST_BUILTIN + 1] = { + [BTT_VOID] = "void", + [BTT_BOOL] = "_Bool", + [BTT_CHAR] = "char", + [BTT_SCHAR] = "signed char", + [BTT_UCHAR] = "unsigned char", + [BTT_SHORT] = "short", + [BTT_SSHORT] = "signed short", + [BTT_USHORT] = "unsigned short", + [BTT_INT] = "int", + [BTT_SINT] = "signed", + [BTT_UINT] = "unsigned", + [BTT_LONG] = "long", + [BTT_SLONG] = "signed long", + [BTT_ULONG] = "unsigned long", + [BTT_LONGLONG] = "long long", + [BTT_SLONGLONG] = "signed long long", + [BTT_ULONGLONG] = "unsigned long long", + [BTT_INT128] = "__int128", + [BTT_SINT128] = "signed __int128", + [BTT_UINT128] = "unsigned __int128", + [BTT_S8] = "int8_t", + [BTT_U8] = "uint8_t", + [BTT_S16] = "int16_t", + [BTT_U16] = "uint16_t", + [BTT_S32] = "int32_t", + [BTT_U32] = "uint32_t", + [BTT_S64] = "int64_t", + [BTT_U64] = "uint64_t", + [BTT_FLOAT] = "float", + [BTT_CFLOAT] = "float _Complex", + [BTT_IFLOAT] = "float _Imaginary", + [BTT_DOUBLE] = "double", + [BTT_CDOUBLE] = "double _Complex", + [BTT_IDOUBLE] = "double _Imaginary", + [BTT_LONGDOUBLE] = "long double", + [BTT_CLONGDOUBLE] = "long double _Complex", + [BTT_ILONGDOUBLE] = "long double _Imaginary", + [BTT_FLOAT128] = "__float128", + [BTT_CFLOAT128] = "__float128 _Complex", + [BTT_IFLOAT128] = "__float128 _Imaginary", + [BTT_VA_LIST] = "__builtin_va_list", +}; +void type_print(type_t *typ) { + if (typ->_internal_use) { + printf("...%p", typ); + return; + } + typ->_internal_use = 1; + printf("<" DISP_ADDR_FMT "n_uses=%zu> ", DISP_ADDR_ARG(typ) typ->nrefs); + if (!typ->is_validated) printf("! "); + if (typ->is_incomplete) printf(" "); + if (typ->is_validated && !typ->is_incomplete) printf(" ", typ->szinfo.size, typ->szinfo.align); + if (typ->converted) printf(" ", string_content(typ->converted)); + if (typ->is_const) printf("const "); + if (typ->is_restrict) printf("restrict "); + if (typ->is_volatile) printf("volatile "); + if (typ->is_atomic) printf("_Atomic "); + switch (typ->typ) { + case TYPE_BUILTIN: + printf("", builtin2str[typ->val.builtin], typ->val.builtin); + break; + case TYPE_ARRAY: + if (typ->val.array.array_sz == (size_t)-1) + printf("[] "); + else printf("[%zu] ", typ->val.array.array_sz); + type_print(typ->val.array.typ); + break; + case TYPE_STRUCT_UNION: + struct_print(typ->val.st); + break; + case TYPE_ENUM: + printf(" "); + type_print(typ->val.typ); + break; + case TYPE_PTR: + printf("*"); + type_print(typ->val.typ); + break; + case TYPE_FUNCTION: + printf(""); + } else { + printf(", args=("); + for (size_t i = 0; i < typ->val.fun.nargs; ++i) { + if (i) printf("), ("); + type_print(typ->val.fun.args[i]); + } + if (typ->val.fun.has_varargs && typ->val.fun.nargs) printf(", ...)>"); + else if (typ->val.fun.has_varargs && !typ->val.fun.nargs) printf("...)>"); + else printf(")>"); + } + break; + } + typ->_internal_use = 0; +} +void struct_print(const struct_t *st) { + printf("<" DISP_ADDR_FMT "n_uses=%zu> ", DISP_ADDR_ARG(st) st->nrefs); + if (st->is_simple) { + printf(" %s %s ", st->is_struct ? "struct" : "union", st->tag ? string_content(st->tag) : ""); + return; + } + if (st->is_defined) { + printf( + "%s %s { ", + st->is_struct ? "struct" : "union", + st->tag ? string_content(st->tag) : "", + st->nmembers, + st->has_incomplete ? ", with incomplete" : "", + st->has_self_recursion ? ", with self-recursion" : ""); + for (size_t i = 0; i < st->nmembers; ++i) { + if (i) printf(", "); + type_print(st->members[i].typ); + printf(" %s", st->members[i].name ? string_content(st->members[i].name) : ""); + if (st->members[i].is_bitfield) { + printf(" : %zu", st->members[i].bitfield_width); + } + } + printf(" }"); + } else { + printf("%s %s ", st->is_struct ? "struct" : "union", st->tag ? string_content(st->tag) : ""); + } +} + +file_t *file_new(machine_t *target) { + file_t *ret = malloc(sizeof *ret); + if (!ret) { + log_memory("failed to create a new translation unit structure (init)\n"); + return NULL; + } + if (!(ret->struct_map = kh_init(struct_map))) { + log_memory("failed to create a new translation unit structure (structure map)\n"); + free(ret); + return NULL; + } + if (!(ret->type_map = kh_init(type_map))) { + log_memory("failed to create a new translation unit structure (type map)\n"); + kh_destroy(struct_map, ret->struct_map); + free(ret); + return NULL; + } + if (!(ret->enum_map = kh_init(type_map))) { + log_memory("failed to create a new translation unit structure (enumeration map)\n"); + kh_destroy(struct_map, ret->struct_map); + kh_destroy(type_map, ret->type_map); + free(ret); + return NULL; + } + if (!(ret->decl_map = kh_init(decl_map))) { + log_memory("failed to create a new translation unit structure (declaration map)\n"); + kh_destroy(struct_map, ret->struct_map); + kh_destroy(type_map, ret->type_map); + kh_destroy(type_map, ret->enum_map); + free(ret); + return NULL; + } + if (!(ret->type_set = kh_init(type_set))) { + log_memory("failed to create a new translation unit structure (type set)\n"); + kh_destroy(struct_map, ret->struct_map); + kh_destroy(type_map, ret->type_map); + kh_destroy(type_map, ret->enum_map); + kh_destroy(decl_map, ret->decl_map); + free(ret); + return NULL; + } + if (!(ret->const_map = kh_init(const_map))) { + log_memory("failed to create a new translation unit structure (const map)\n"); + kh_destroy(struct_map, ret->struct_map); + kh_destroy(type_map, ret->type_map); + kh_destroy(type_map, ret->enum_map); + kh_destroy(decl_map, ret->decl_map); + kh_destroy(type_set, ret->type_set); + free(ret); + return NULL; + } + if (!(ret->relaxed_type_conversion = kh_init(conv_map))) { + log_memory("failed to create a new translation unit structure (relaxed type conversion map)\n"); + kh_destroy(struct_map, ret->struct_map); + kh_destroy(type_map, ret->type_map); + kh_destroy(type_map, ret->enum_map); + kh_destroy(decl_map, ret->decl_map); + kh_destroy(type_set, ret->type_set); + kh_destroy(const_map, ret->const_map); + free(ret); + return NULL; + } + + // Now fill in the builtin types + int iret; khiter_t it; + for (enum type_builtin_e i = 0; i < LAST_BUILTIN + 1; ++i) { + type_t *t = type_new(); + if (!t) { + log_memory("failed to create a new translation unit structure (builtin type)\n"); + for (; i--;) { + free(ret->builtins[i]); + } + kh_destroy(struct_map, ret->struct_map); + kh_destroy(type_map, ret->type_map); + kh_destroy(conv_map, ret->relaxed_type_conversion); + kh_destroy(type_map, ret->enum_map); + kh_destroy(decl_map, ret->decl_map); + kh_destroy(type_set, ret->type_set); + kh_destroy(const_map, ret->const_map); + free(ret); + return NULL; + } + t->is_incomplete = (i == BTT_VOID); + t->nrefs = 2; + t->typ = TYPE_BUILTIN; + t->val.builtin = i; + if (!target->has_int128 && ((i == BTT_INT128) || (i == BTT_SINT128) || (i == BTT_UINT128))) { + t->converted = string_new_cstr(""); + } + validate_type(&(loginfo_t){0}, target, t); + ret->builtins[i] = t; + kh_put(type_set, ret->type_set, t, &iret); + if (iret < 0) { + log_memory("failed to create a new translation unit structure (failed to add intrinsic type to type_set)\n"); + kh_destroy(struct_map, ret->struct_map); + kh_destroy(type_map, ret->type_map); + kh_destroy(conv_map, ret->relaxed_type_conversion); + kh_destroy(type_map, ret->enum_map); + kh_destroy(decl_map, ret->decl_map); + kh_destroy(type_set, ret->type_set); + kh_destroy(const_map, ret->const_map); + free(ret); + return NULL; + } else if (iret == 0) { + log_memory("failed to create a new translation unit structure (duplicate intrinsic type in type_set)\n"); + for (++i; i--;) { + free(ret->builtins[i]); + } + kh_destroy(struct_map, ret->struct_map); + kh_destroy(type_map, ret->type_map); + kh_destroy(conv_map, ret->relaxed_type_conversion); + kh_destroy(type_map, ret->enum_map); + kh_destroy(decl_map, ret->decl_map); + kh_destroy(type_set, ret->type_set); + kh_destroy(const_map, ret->const_map); + free(ret); + return NULL; + } + } + // ret is valid and can now be deleted by file_del + + // Add __builtin_va_list, __int128_t, __uint128_t as builtin typedef + char *sdup; +#define ADD_TYPEDEF(name, btt) \ + sdup = strdup(#name); \ + if (!sdup) { \ + log_memory("failed to create a new translation unit structure (" #name " name)\n"); \ + file_del(ret); \ + return NULL; \ + } \ + it = kh_put(type_map, ret->type_map, sdup, &iret); \ + if (iret < 0) { \ + log_memory("failed to create a new translation unit structure (add " #name " typedef)\n"); \ + free(sdup); \ + file_del(ret); \ + return NULL; \ + } else if (iret == 0) { \ + log_memory("failed to create a new translation unit structure (" #name " is already a typedef)\n"); \ + free(sdup); \ + file_del(ret); \ + return NULL; \ + } \ + kh_val(ret->type_map, it) = ret->builtins[BTT_ ## btt]; \ + ++ret->builtins[BTT_ ## btt]->nrefs; + ADD_TYPEDEF(__builtin_va_list, VA_LIST) + if (target->has_int128) { + ADD_TYPEDEF(__int128_t, INT128) + ADD_TYPEDEF(__uint128_t, UINT128) + } + + return ret; +} +void file_del(file_t *f) { + struct_map_del(f->struct_map); + type_map_del(f->type_map); + conv_map_del(f->relaxed_type_conversion); + type_map_del(f->enum_map); + decl_map_del(f->decl_map); + type_set_del(f->type_set); + const_map_del(f->const_map); + for (enum type_builtin_e i = 0; i < LAST_BUILTIN + 1; ++i) { + type_del(f->builtins[i]); + } + free(f); +} diff --git a/wrapperhelper/src/lang.h b/wrapperhelper/src/lang.h new file mode 100644 index 0000000..e921013 --- /dev/null +++ b/wrapperhelper/src/lang.h @@ -0,0 +1,468 @@ +#pragma once + +#ifndef LANG_H +#define LANG_H + +#include "cstring.h" +#include "khash.h" +#include "log.h" +#include "machine.h" +#include "vector.h" + +enum token_sym_type_e { + SYM_LBRACKET, + SYM_RBRACKET, + SYM_LSQBRACKET, + SYM_RSQBRACKET, + SYM_LPAREN, + SYM_RPAREN, + SYM_HASH, + SYM_HASHHASH, + SYM_SEMICOLON, + SYM_COLON, + SYM_COLONCOLON, + SYM_VARIADIC, + SYM_QUESTION, + SYM_DOT, + SYM_DASHGT, + SYM_TILDE, + SYM_EXCL, + SYM_PLUS, + SYM_DASH, + SYM_STAR, + SYM_SLASH, + SYM_PERCENT, + SYM_HAT, + SYM_AMP, + SYM_PIPE, + SYM_EQ, + SYM_PLUSEQ, + SYM_DASHEQ, + SYM_STAREQ, + SYM_SLASHEQ, + SYM_PERCENTEQ, + SYM_HATEQ, + SYM_AMPEQ, + SYM_PIPEEQ, + SYM_EQEQ, + SYM_EXCLEQ, + SYM_LT, + SYM_GT, + SYM_LTEQ, + SYM_GTEQ, + SYM_AMPAMP, + SYM_PIPEPIPE, + SYM_LTLT, + SYM_GTGT, + SYM_LTLTEQ, + SYM_GTGTEQ, + SYM_PLUSPLUS, + SYM_DASHDASH, + SYM_COMMA, +}; +#define LAST_SYM SYM_COMMA + +typedef struct preproc_token_s { + enum preproc_token_e { + PPTOK_INVALID = 0, + PPTOK_IDENT, // Expandable ident + PPTOK_IDENT_UNEXP, // Unexpandable ident + PPTOK_NUM, + PPTOK_STRING, + PPTOK_INCL, + PPTOK_SYM, + PPTOK_NEWLINE, + PPTOK_BLANK, + PPTOK_START_LINE_COMMENT, + PPTOK_EOF + } tokt; + loginfo_t loginfo; + union { + string_t *str; + struct { + string_t *sstr; // The string literal content + int sisstr; // 0 for '' or <>, 1 for "" + }; + char c; + enum token_sym_type_e sym; + } tokv; +} preproc_token_t; +VECTOR_DECLARE(preproc, preproc_token_t) +preproc_token_t preproc_token_dup(preproc_token_t tok); +void preproc_token_del(preproc_token_t *tok); + +enum token_keyword_type_e { + KW_ALIGNAS = 0, + KW_ALIGNOF, + KW_ATOMIC, + KW_AUTO, + KW_BOOL, + KW_BREAK, + KW_CASE, + KW_CHAR, + KW_COMPLEX, + KW_CONST, + KW_CONTINUE, + KW_DEFAULT, + KW_DO, + KW_DOUBLE, + KW_ELSE, + KW_ENUM, + KW_EXTERN, + KW_FLOAT, + KW_FLOAT128, + KW_FOR, + KW_GENERIC, + KW_GOTO, + KW_IF, + KW_IMAGINARY, + KW_INLINE, + KW_INT, + KW_INT128, + KW_LONG, + KW_NORETURN, + KW_REGISTER, + KW_RESTRICT, + KW_RETURN, + KW_SHORT, + KW_SIGNED, + KW_SIZEOF, + KW_STATIC, + KW_STATIC_ASSERT, + KW_STRUCT, + KW_SWITCH, + KW_THREAD_LOCAL, + KW_TYPEDEF, + KW_UNION, + KW_UNSIGNED, + KW_VOID, + KW_VOLATILE, + KW_WHILE, +}; +#define LAST_KEYWORD KW_WHILE + +typedef struct proc_token_s { + enum proc_token_e { + PTOK_INVALID = 0, + PTOK_IDENT, + PTOK_KEYWORD, + PTOK_NUM, + PTOK_STRING, + PTOK_SYM, + PTOK_PRAGMA, + PTOK_EOF + } tokt; + loginfo_t loginfo; + union proc_token_val_u { + string_t *str; + struct { + string_t *sstr; // The string literal content + int sisstr; // 0 for '' or <>, 1 for "" + }; + char c; + enum token_sym_type_e sym; + enum token_keyword_type_e kw; + struct { + enum proc_pragma_e { + PRAGMA_ALLOW_INTS, + PRAGMA_SIMPLE_SU, + PRAGMA_EXPLICIT_CONV, + PRAGMA_EXPLICIT_CONV_STRICT, + } typ; + string_t *val; + } pragma; + } tokv; +} proc_token_t; +VECTOR_DECLARE(proc, proc_token_t) +void proc_token_del(proc_token_t *tok); + +typedef struct num_constant_s { + enum num_constant_e { + NCT_FLOAT, + NCT_DOUBLE, + NCT_LDOUBLE, + NCT_INT32, + NCT_UINT32, + NCT_INT64, + NCT_UINT64, + } typ; + union { + float f; + double d; + long double l; + int32_t i32; + uint32_t u32; + int64_t i64; + uint64_t u64; + } val; +} num_constant_t; +int num_constant_convert(loginfo_t *li, string_t *str, num_constant_t *cst, int ptr_is_32bits); +KHASH_MAP_DECLARE_STR(const_map, num_constant_t) + +typedef struct expr_s { + enum expr_type_e { + ETY_VAR, + ETY_CONST, + // ETY_GENERIC, + ETY_CALL, + ETY_ACCESS, + ETY_PTRACCESS, // Convertible to DEREF + ACCESS + ETY_UNARY, + ETY_BINARY, + ETY_TERNARY, + // ETY_INIT_LIST, + ETY_CAST, + } typ; + union { + string_t *var; + num_constant_t cst; + // TODO: _Generic + struct { + struct expr_s *fun, **args; + size_t nargs; + } call; + struct { + struct expr_s *val; + string_t *member; + } access; + struct { + enum unary_op_e { + UOT_POSTINCR, + UOT_POSTDECR, + UOT_PREINCR, + UOT_PREDECR, + UOT_REF, + UOT_POS, + UOT_NEG, + UOT_DEREF, + UOT_ANOT, // Arithmetic not, ie '~' + UOT_BNOT, // Boolean not, ie '!' + } typ; + struct expr_s *e; + } unary; + struct { + enum binary_op_e { + BOT_ADD, + BOT_SUB, + BOT_MUL, + BOT_DIV, + BOT_MOD, + BOT_LSH, + BOT_RSH, + BOT_LT, + BOT_GT, + BOT_LE, + BOT_GE, + BOT_EQ, + BOT_NE, + BOT_AAND, + BOT_AXOR, + BOT_AOR, + BOT_BAND, + BOT_BOR, + BOT_ASSGN_EQ, + BOT_ASSGN_ADD, + BOT_ASSGN_SUB, + BOT_ASSGN_MUL, + BOT_ASSGN_DIV, + BOT_ASSGN_MOD, + BOT_ASSGN_LSH, + BOT_ASSGN_RSH, + BOT_ASSGN_AAND, + BOT_ASSGN_AXOR, + BOT_ASSGN_AOR, + BOT_COMMA, + + BOT_ARRAY, // Convertible to DEREF + ADD + } typ; + struct expr_s *e1, *e2; + } binary; + struct { + enum ternary_op_e { + TOT_COND, + } typ; + struct expr_s *e1, *e2, *e3; + } ternary; + // TODO: (type){init} + struct { + struct type_s *typ; + struct expr_s *e; + } cast; + } val; +} expr_t; +void expr_del(expr_t *e); +void expr_print(expr_t *e); + +typedef struct size_info_s { + size_t size, align; +} size_info_t; + +typedef struct type_s { + struct { + unsigned is_atomic : 1; + unsigned is_const : 1; + unsigned is_restrict : 1; + unsigned is_volatile : 1; + unsigned is_incomplete : 1; // \ The type needs to be complete and + unsigned is_validated : 1; // / validated for the size_info to be populated + unsigned _internal_use : 1; + }; + size_t nrefs; + enum type_type_e { + TYPE_BUILTIN, // builtin + TYPE_ARRAY, // array + TYPE_STRUCT_UNION, // st + TYPE_ENUM, // typ which points to TYPE_BUILTIN + TYPE_PTR, // typ + TYPE_FUNCTION, // fun + } typ; + union { + enum type_builtin_e { + BTT_VOID, + BTT_BOOL, + BTT_CHAR, + BTT_SCHAR, + BTT_UCHAR, + BTT_SHORT, + BTT_SSHORT, + BTT_USHORT, + BTT_INT, + BTT_SINT, + BTT_UINT, + BTT_LONG, + BTT_SLONG, + BTT_ULONG, + BTT_LONGLONG, + BTT_SLONGLONG, + BTT_ULONGLONG, + BTT_INT128, + BTT_SINT128, + BTT_UINT128, + BTT_S8, + BTT_U8, + BTT_S16, + BTT_U16, + BTT_S32, + BTT_U32, + BTT_S64, + BTT_U64, +#define BTT_START_INT_EXT BTT_S8 +#define BTT_INT_EXTS "__int8_t", "__uint8_t", "__int16_t", "__uint16_t", "__int32_t", "__uint32_t", "__int64_t", "__uint64_t" + BTT_FLOAT, + BTT_CFLOAT, + BTT_IFLOAT, + BTT_DOUBLE, + BTT_CDOUBLE, + BTT_IDOUBLE, + BTT_LONGDOUBLE, + BTT_CLONGDOUBLE, + BTT_ILONGDOUBLE, + BTT_FLOAT128, + BTT_CFLOAT128, + BTT_IFLOAT128, + BTT_VA_LIST, + } builtin; +#define LAST_BUILTIN BTT_VA_LIST + struct type_s *typ; + struct { + struct type_s *typ; + size_t array_sz; // -1 for VLA + } array; + struct struct_s *st; + struct { + struct type_s *ret; + size_t nargs; // -1 for no specification + struct type_s **args; + int has_varargs; + } fun; + } val; + size_info_t szinfo; + string_t *converted; // NULL for default behavior +} type_t; +void type_del(type_t *typ); +KHASH_MAP_DECLARE_STR(type_map, type_t*) +KHASH_DECLARE(conv_map, type_t*, string_t*) +void type_map_del(khash_t(type_map) *map); + +int type_t_equal(type_t*, type_t*); + +typedef struct st_member_s { + string_t *name; // May be NULL + type_t *typ; + _Bool is_bitfield; + size_t bitfield_width; + // Filled by validate_type + size_t byte_offset; unsigned char bit_offset; +} st_member_t; +typedef struct struct_s { + string_t *tag; + int is_defined; + size_t nrefs; + int is_struct; // 0 = union, 1 = struct + int is_simple; // Pointers to the structure (in 64 bits) are simple pointers + int has_incomplete; // 1 if the last element of the structure is a VLA or if an element of the union recursively contains a VLA + int has_self_recursion; // 1 if the structure contains a reference to itself + size_t nmembers; + st_member_t *members; +} struct_t; +void st_member_del(st_member_t *member); +void struct_del(struct_t *st); +KHASH_MAP_DECLARE_STR(struct_map, struct_t*) + +type_t *type_new(void); // Create a new (complete) builtin type +type_t *type_new_ptr(type_t *target); // Create a new pointer type; doesn't increment the use counter of the target +int type_copy_into(type_t *dest, const type_t *ref); // Copy ref into dest, keeping additional qualifiers and without changing any use counter + +struct_t *struct_new(int is_struct, string_t *tag); // Create a new struct + +// Try to merge some types with other types; this may delete ptr and increase a use counter in a type referenced by the table +KHASH_DECLARE(type_set, type_t*, char) +type_t *type_try_merge(type_t *ptr, khash_t(type_set) *set); + +extern const char *builtin2str[LAST_BUILTIN + 1]; +void type_print(type_t *typ); +void struct_print(const struct_t *st); + +typedef struct declaration_s { + enum decl_storage_e { + STORAGE_NONE, + STORAGE_EXTERN, + STORAGE_STATIC, + STORAGE_TLS, + STORAGE_TLS_EXTERN, + STORAGE_TLS_STATIC, + STORAGE_AUTO, + STORAGE_REG, + } storage; + int defined; + type_t *typ; +} declaration_t; +KHASH_MAP_DECLARE_STR(decl_map, declaration_t*) + +typedef struct file_s { + khash_t(struct_map) *struct_map; + khash_t(type_map) *type_map; + khash_t(conv_map) *relaxed_type_conversion; + khash_t(type_map) *enum_map; + khash_t(decl_map) *decl_map; + type_t *builtins[LAST_BUILTIN + 1]; + khash_t(const_map) *const_map; + khash_t(type_set) *type_set; +} file_t; +file_t *file_new(machine_t *target); +void file_del(file_t *f); + +extern const char *sym2str[LAST_SYM + 1]; +extern const char *kw2str[LAST_KEYWORD + 1]; +void preproc_token_print(const preproc_token_t *tok); +int preproc_token_isend(const preproc_token_t *tok); +void proc_token_print(const proc_token_t *tok); +int proc_token_iserror(const proc_token_t *tok); +int proc_token_isend(const proc_token_t *tok); + +KHASH_MAP_DECLARE_STR(str2kw, enum token_keyword_type_e) +extern khash_t(str2kw) *str2kw; +int init_str2kw(void); +void del_str2kw(void); + +#endif // LANG_H diff --git a/wrapperhelper/src/log.c b/wrapperhelper/src/log.c new file mode 100644 index 0000000..a50b52a --- /dev/null +++ b/wrapperhelper/src/log.c @@ -0,0 +1,80 @@ +#include "log.h" + +#include +#include + +void loginfo_print(const loginfo_t *info, int print_sz) { + if (!info) { + if (print_sz > 0) printf("%*s", print_sz, ""); + return; + } + if (!info->filename) { + if (print_sz > 0) printf("%*s", print_sz, ""); + return; + } + print_sz -= printf("%s:", info->filename); + if (!info->lineno) { + print_sz -= printf(" "); + if (print_sz > 0) printf("%*s", print_sz, ""); + return; + } + print_sz -= printf("%zu:", info->lineno); + if (!info->colno) { + print_sz -= printf(" "); + if (print_sz > 0) printf("%*s", print_sz, ""); + return; + } + print_sz -= printf("%zu", info->colno); + if (!info->lineno_end || ((info->lineno_end == info->lineno) && (info->colno_end == info->colno))) { + print_sz -= printf(": "); + if (print_sz > 0) printf("%*s", print_sz, ""); + return; + } + print_sz -= printf("-"); + if (info->lineno_end != info->lineno) { + print_sz -= printf("%zu:", info->lineno_end); + } + print_sz -= printf("%zu: ", info->colno_end + 1); + if (print_sz > 0) printf("%*s", print_sz, ""); +} + +void log_error(const loginfo_t *info, const char *format, ...) { + printf("Error: "); + loginfo_print(info, 0); + va_list args; + va_start(args, format); + vprintf(format, args); + va_end(args); +} +void log_internal(const loginfo_t *info, const char *format, ...) { + printf("Internal error: "); + loginfo_print(info, 0); + va_list args; + va_start(args, format); + vprintf(format, args); + va_end(args); +} +void log_memory(const char *format, ...) { + printf("Fatal error: memory error: "); + va_list args; + va_start(args, format); + vprintf(format, args); + va_end(args); +} +void log_TODO(const loginfo_t *info, const char *format, ...) { + printf("Error: "); + loginfo_print(info, 0); + printf("TODO: "); + va_list args; + va_start(args, format); + vprintf(format, args); + va_end(args); +} +void log_warning(const loginfo_t *info, const char *format, ...) { + printf("Warning: "); + loginfo_print(info, 0); + va_list args; + va_start(args, format); + vprintf(format, args); + va_end(args); +} diff --git a/wrapperhelper/src/log.h b/wrapperhelper/src/log.h new file mode 100644 index 0000000..e1f210b --- /dev/null +++ b/wrapperhelper/src/log.h @@ -0,0 +1,27 @@ +#ifndef __LOG_H__ +#define __LOG_H__ + +#include + +typedef struct loginfo_s { + const char *filename; // NULL = no log info + size_t lineno; // 0 = no (start) line/column number + size_t colno; + size_t lineno_end; // 0 = no end line/column number + size_t colno_end; +} loginfo_t; + +#define ATTRIBUTE_FORMAT(i, j) __attribute__((format(printf, i, j))) + +void loginfo_print(const loginfo_t *info, int print_sz); // print_sz = min characters output +void log_error(const loginfo_t *info, const char *format, ...) ATTRIBUTE_FORMAT(2, 3); +void log_internal(const loginfo_t *info, const char *format, ...) ATTRIBUTE_FORMAT(2, 3); +void log_memory(const char *format, ...) ATTRIBUTE_FORMAT(1, 2); +void log_TODO(const loginfo_t *info, const char *format, ...) ATTRIBUTE_FORMAT(2, 3); +void log_warning(const loginfo_t *info, const char *format, ...) ATTRIBUTE_FORMAT(2, 3); +#define log_error_nopos(...) log_error(&(loginfo_t){0}, __VA_ARGS__) +#define log_internal_nopos(...) log_internal(&(loginfo_t){0}, __VA_ARGS__) +#define log_TODO_nopos(...) log_TODO(&(loginfo_t){0}, __VA_ARGS__) +#define log_warning_nopos(...) log_warning(&(loginfo_t){0}, __VA_ARGS__) + +#endif // __LOG_H__ diff --git a/wrapperhelper/src/machine.c b/wrapperhelper/src/machine.c new file mode 100644 index 0000000..499bcb2 --- /dev/null +++ b/wrapperhelper/src/machine.c @@ -0,0 +1,434 @@ +#include "machine.h" + +#include + +#include "lang.h" + +machine_t machine_x86_64; +machine_t machine_x86; +machine_t machine_aarch64; + +#define PASTE2(a, b) a ## b +#define PASTE(a, b) PASTE2(a, b) +#define STRINGIFY2(a) #a +#define STRINGIFY(a) STRINGIFY2(a) +#define MACHINE_STR STRINGIFY(CUR_MACHINE) +#define MACHINE_VAL PASTE(machine_, CUR_MACHINE) + +#define PATHS_OFFSET_PRE 2 // There are two paths that are always included before any other +#define ADD_PATH(path) \ + if (!(MACHINE_VAL.include_path[failure_id] = strdup(path))) { \ + log_memory("failed to add include path to " MACHINE_STR " platform\n"); \ + goto PASTE(failed_, PASTE(CUR_MACHINE, _paths)); \ + } \ + ++failure_id; +#define INIT_PATHS \ + MACHINE_VAL.npaths = PATHS_OFFSET_PRE + npaths + paths_offset_post; \ + if (!(MACHINE_VAL.include_path = \ + malloc(MACHINE_VAL.npaths * sizeof *MACHINE_VAL.include_path))) { \ + log_memory("failed to add include path to " MACHINE_STR " platform\n"); \ + goto PASTE(failed_, PASTE(CUR_MACHINE, _nopath)); \ + } \ + failure_id = 0; \ + ADD_PATH("include-override/" MACHINE_STR) \ + ADD_PATH("include-override/common") \ + while (failure_id < PATHS_OFFSET_PRE + npaths) { \ + ADD_PATH(extra_include_path[failure_id - PATHS_OFFSET_PRE]) \ + } + +int init_machines(size_t npaths, const char *const *extra_include_path) { + size_t failure_id; + + size_t paths_offset_post = 0; +#define DO_PATH(_path) ++paths_offset_post; +#include "machine.gen" +#undef DO_PATH + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" +#define CUR_MACHINE x86_64 + machine_x86_64.size_long = 8; + machine_x86_64.align_longdouble = 16; + machine_x86_64.size_longdouble = 16; + machine_x86_64.align_valist = 8; + machine_x86_64.size_valist = 24; + machine_x86_64.max_align = 8; + machine_x86_64.has_int128 = 1; + machine_x86_64.unsigned_char = 0; + machine_x86_64.unnamed_bitfield_aligns = 0; + INIT_PATHS +#define DO_PATH ADD_PATH +#include "machine.gen" +#undef DO_PATH +#undef CUR_MACHINE + +#define CUR_MACHINE x86 + machine_x86.size_long = 4; + machine_x86.align_longdouble = 4; + machine_x86.size_longdouble = 12; + machine_x86.align_valist = 4; + machine_x86.size_valist = 4; + machine_x86.max_align = 4; + machine_x86.has_int128 = 0; + machine_x86.unsigned_char = 0; + machine_x86.unnamed_bitfield_aligns = 0; + INIT_PATHS +#define DO_PATH ADD_PATH +#include "machine.gen" +#undef DO_PATH +#undef CUR_MACHINE + +#define CUR_MACHINE aarch64 + machine_aarch64.size_long = 8; + machine_aarch64.align_longdouble = 16; + machine_aarch64.size_longdouble = 16; + machine_aarch64.align_valist = 8; + machine_aarch64.size_valist = 32; + machine_aarch64.max_align = 8; + machine_aarch64.has_int128 = 1; + machine_aarch64.unsigned_char = 1; + machine_aarch64.unnamed_bitfield_aligns = 1; + INIT_PATHS +#define DO_PATH ADD_PATH +#include "machine.gen" +#undef DO_PATH +#undef CUR_MACHINE +#pragma GCC diagnostic pop + + return 1; + +failed_aarch64_paths: + while (failure_id--) { + free(machine_aarch64.include_path[failure_id]); + } + free(machine_aarch64.include_path); +failed_aarch64_nopath: + failure_id = machine_x86.npaths; +failed_x86_paths: + while (failure_id--) { + free(machine_x86.include_path[failure_id]); + } + free(machine_x86.include_path); +failed_x86_nopath: + failure_id = machine_x86_64.npaths; +failed_x86_64_paths: + while (failure_id--) { + free(machine_x86_64.include_path[failure_id]); + } + free(machine_x86_64.include_path); +failed_x86_64_nopath: + return 0; +} + +static void machine_del(machine_t *m) { + for (size_t path_no = m->npaths; path_no--;) { + free(m->include_path[path_no]); + } + free(m->include_path); +} +void del_machines(void) { + machine_del(&machine_x86_64); + machine_del(&machine_x86); + machine_del(&machine_aarch64); +} + +machine_t *convert_machine_name(const char *archname) { + if (!strcmp(archname, "x86_64")) + return &machine_x86_64; + if (!strcmp(archname, "x86")) + return &machine_x86; + if (!strcmp(archname, "aarch64")) + return &machine_aarch64; + return NULL; +} + +void fill_self_recursion(type_t *typ, struct_t *st) { + if (typ->_internal_use) return; // Recursion, but not self recursion + typ->_internal_use = 1; + switch (typ->typ) { + case TYPE_BUILTIN: break; + case TYPE_ARRAY: + fill_self_recursion(typ->val.array.typ, st); + break; + case TYPE_PTR: + fill_self_recursion(typ->val.typ, st); + break; + case TYPE_FUNCTION: + if (typ->val.fun.nargs != (size_t)-1) { + for (size_t i = 0; (i < typ->val.fun.nargs) && !st->has_self_recursion; ++i) { + fill_self_recursion(typ->val.fun.args[i], st); + } + } + if (!st->has_self_recursion) fill_self_recursion(typ->val.fun.ret, st); + break; + case TYPE_STRUCT_UNION: + if (typ->val.st == st) { + st->has_self_recursion = 1; + break; + } + if (!typ->val.st->is_defined) break; + for (size_t i = 0; (i < typ->val.st->nmembers) && !st->has_self_recursion; ++i) { + fill_self_recursion(typ->val.st->members[i].typ, st); + } + break; + case TYPE_ENUM: + fill_self_recursion(typ->val.typ, st); + break; + } + typ->_internal_use = 0; +} + +int validate_type(loginfo_t *loginfo, machine_t *target, type_t *typ) { + if (typ->is_validated) return 1; + typ->is_validated = 1; + if (typ->is_restrict) { + if (typ->typ != TYPE_PTR) { + log_error(loginfo, "only pointers to object types may be restrict-qualified\n"); + return 0; + } + if (typ->val.typ->typ == TYPE_FUNCTION) { + log_error(loginfo, "only pointers to object types may be restrict-qualified\n"); + return 0; + } + } + if (typ->is_atomic) { + if ((typ->typ == TYPE_ARRAY) || (typ->typ == TYPE_FUNCTION)) { + log_error(loginfo, "array types and function types may not be atomic-qualified\n"); + return 0; + } + } + switch (typ->typ) { + case TYPE_BUILTIN: + switch (typ->val.builtin) { + case BTT_VOID: typ->szinfo.align = typ->szinfo.size = 0; return 1; + case BTT_BOOL: + case BTT_CHAR: + case BTT_SCHAR: + case BTT_UCHAR: + case BTT_S8: + case BTT_U8: typ->szinfo.align = typ->szinfo.size = 1; return 1; + case BTT_SHORT: + case BTT_SSHORT: + case BTT_USHORT: + case BTT_S16: + case BTT_U16: typ->szinfo.align = typ->szinfo.size = 2; return 1; + case BTT_INT: + case BTT_SINT: + case BTT_UINT: + case BTT_S32: + case BTT_U32: typ->szinfo.align = typ->szinfo.size = 4; return 1; + case BTT_LONGLONG: + case BTT_SLONGLONG: + case BTT_ULONGLONG: + case BTT_S64: + case BTT_U64: typ->szinfo.align = target->max_align; typ->szinfo.size = 8; return 1; + case BTT_LONG: + case BTT_SLONG: + case BTT_ULONG: typ->szinfo.align = typ->szinfo.size = target->size_long; return 1; + case BTT_FLOAT: + case BTT_IFLOAT: typ->szinfo.align = typ->szinfo.size = 4; return 1; + case BTT_CFLOAT: + case BTT_DOUBLE: + case BTT_IDOUBLE: typ->szinfo.align = target->max_align; typ->szinfo.size = 8; return 1; + case BTT_CDOUBLE: typ->szinfo.align = target->max_align; typ->szinfo.size = 16; return 1; + case BTT_LONGDOUBLE: + case BTT_ILONGDOUBLE: typ->szinfo.align = target->align_longdouble; typ->szinfo.size = target->size_longdouble; return 1; + case BTT_CLONGDOUBLE: typ->szinfo.align = target->align_longdouble; typ->szinfo.size = 2*target->size_longdouble; return 1; + case BTT_INT128: + case BTT_SINT128: + case BTT_UINT128: + if (!target->has_int128) { + if (loginfo->filename) log_error(loginfo, "target does not have type __int128\n"); + typ->szinfo.align = typ->szinfo.size = 0; return 0; + } + /* FALLTHROUGH */ + case BTT_FLOAT128: + case BTT_IFLOAT128: typ->szinfo.align = typ->szinfo.size = 16; return 1; + case BTT_CFLOAT128: typ->szinfo.align = 16; typ->szinfo.size = 32; return 1; + case BTT_VA_LIST: typ->szinfo.align = target->align_valist; typ->szinfo.size = target->size_valist; return 1; + default: + log_error(loginfo, "unknown builtin %u, cannot fill size info\n", typ->val.builtin); + return 0; + } + case TYPE_ARRAY: + if (typ->val.array.typ->is_incomplete || (typ->val.array.typ->typ == TYPE_FUNCTION)) { + log_error(loginfo, "array types must point to complete object types\n"); + return 0; + } + if ((typ->val.array.typ->typ == TYPE_STRUCT_UNION) && typ->val.array.typ->val.st->has_incomplete) { + log_error(loginfo, "array types may not (inductively) point to structures which last element is incomplete\n"); + return 0; + } + if ((typ->is_atomic) || (typ->is_const) || (typ->is_restrict) || (typ->is_volatile)) { + // qualifier-type-list in array declaration is only allowed in function argument declaration under certain circumstances + log_error(loginfo, "array types may not be qualified\n"); + return 0; + } + if (!validate_type(loginfo, target, typ->val.array.typ)) return 0; + if (typ->val.array.array_sz == (size_t)-1) { + typ->szinfo.size = 0; + typ->szinfo.align = (typ->val.array.typ->szinfo.align < 16) ? 16 : typ->val.array.typ->szinfo.align; + } else { + typ->szinfo.size = typ->val.array.array_sz * typ->val.array.typ->szinfo.size; + typ->szinfo.align = + ((typ->szinfo.size >= 16) && (typ->val.array.typ->szinfo.align < 16)) ? + 16 : + typ->val.array.typ->szinfo.align; + } + return 1; + case TYPE_PTR: + typ->szinfo.size = target->size_long; + typ->szinfo.align = target->size_long; + return validate_type(loginfo, target, typ->val.typ); + case TYPE_FUNCTION: + if ((typ->val.fun.ret->typ == TYPE_FUNCTION) || (typ->val.fun.ret->typ == TYPE_ARRAY)) { + log_error(loginfo, "function types may not return function or array types\n"); + return 0; + } + if (typ->val.fun.nargs != (size_t)-1) { + for (size_t i = 0; i < typ->val.fun.nargs; ++i) { + // Adjust the argument if necessary + // Assume arrays are already converted + if (typ->val.fun.args[i]->typ == TYPE_ARRAY) { + log_error(loginfo, "function argument %zu is an array\n", i + 1); + return 0; + } + if (typ->val.fun.args[i]->typ == TYPE_FUNCTION) { + // Adjustment to pointer + type_t *t2 = type_new_ptr(typ->val.fun.args[i]); + if (!t2) { + log_error(loginfo, "failed to adjust type of argument from function to pointer\n"); + return 0; + } + typ->val.fun.args[i] = t2; + } + if (!validate_type(loginfo, target, typ->val.fun.args[i])) return 0; + } + } + typ->szinfo.size = 0; + typ->szinfo.align = 0; + return validate_type(loginfo, target, typ->val.fun.ret); + case TYPE_STRUCT_UNION: { + if (!typ->val.st->is_defined) return typ->is_incomplete; + size_t max_align = 1, cur_sz = 0; unsigned char cur_bit = 0; + for (size_t i = 0; i < typ->val.st->nmembers; ++i) { + // Adjust the argument if necessary + st_member_t *mem = &typ->val.st->members[i]; + if (mem->typ->typ == TYPE_FUNCTION) { + log_error(loginfo, "structures may not contain function members\n"); + return 0; + } + if (mem->typ->is_incomplete) { + if ((i != typ->val.st->nmembers - 1) || !typ->val.st->is_struct || (mem->typ->typ != TYPE_ARRAY)) { + // The last element of a structure may be a VLA + log_error(loginfo, "structures may not contain incomplete members\n"); + return 0; + } + typ->val.st->has_incomplete = 1; + } + if (!validate_type(loginfo, target, mem->typ)) return 0; + if (!typ->val.st->has_self_recursion) fill_self_recursion(mem->typ, typ->val.st); + if (!typ->val.st->is_struct && (mem->typ->typ == TYPE_STRUCT_UNION)) { + typ->val.st->has_incomplete |= mem->typ->val.st->has_incomplete; + } else if ((mem->typ->typ == TYPE_STRUCT_UNION) && mem->typ->val.st->has_incomplete) { + log_error(loginfo, "structures may not (inductively) contain structures which last element is incomplete\n"); + return 0; + } else if (typ->val.st->is_struct) { + if (mem->typ->is_incomplete) { + if (i && (i == typ->val.st->nmembers - 1) && (mem->typ->typ == TYPE_ARRAY)) { + typ->val.st->has_incomplete |= mem->typ->val.st->has_incomplete; + } else { + log_error(loginfo, "structures may not have any incomplete element, except that the last, but not first, element may be an incomplete array\n"); + return 0; + } + } + } + mem->byte_offset = cur_sz; + mem->bit_offset = cur_bit; + if (mem->is_bitfield) { + if (!typ->val.st->is_struct) { + log_error(loginfo, "TODO: bitfield in union\n"); + return 0; + } + if (mem->typ->is_atomic) { + log_error(loginfo, "atomic bitfields are not supported\n"); + return 0; + } + if (mem->typ->typ != TYPE_BUILTIN) { + log_error(loginfo, "bitfields can only have a specific subset of types\n"); + return 0; + } + if ((mem->typ->val.builtin != BTT_BOOL) && (mem->typ->val.builtin != BTT_CHAR) + && (mem->typ->val.builtin != BTT_SHORT) && (mem->typ->val.builtin != BTT_INT) + && (mem->typ->val.builtin != BTT_LONG) && (mem->typ->val.builtin != BTT_LONGLONG) + && (mem->typ->val.builtin != BTT_SCHAR) && (mem->typ->val.builtin != BTT_UCHAR) + && (mem->typ->val.builtin != BTT_SSHORT) && (mem->typ->val.builtin != BTT_USHORT) + && (mem->typ->val.builtin != BTT_SINT) && (mem->typ->val.builtin != BTT_UINT) + && (mem->typ->val.builtin != BTT_SLONG) && (mem->typ->val.builtin != BTT_ULONG) + && (mem->typ->val.builtin != BTT_S8) && (mem->typ->val.builtin != BTT_U8) + && (mem->typ->val.builtin != BTT_S16) && (mem->typ->val.builtin != BTT_U16) + && (mem->typ->val.builtin != BTT_S32) && (mem->typ->val.builtin != BTT_U32) + && (mem->typ->val.builtin != BTT_S64) && (mem->typ->val.builtin != BTT_U64)) { + // C standard: allow _Bool, (s/u)int + // Implementation: also allow (u/s)char, (u/s)short, (u/s)long, (u/s)long long, [u]intx_t + log_error(loginfo, "bitfields can only have a specific subset of types\n"); + return 0; + } + if (mem->typ->szinfo.size < mem->bitfield_width / 8) { + log_error(loginfo, "bitfield member %c%s%c has width (%zu) greater than its container size (%zu * 8)\n", + mem->name ? '\'' : '<', + mem->name ? string_content(mem->name) : "unnamed", + mem->name ? '\'' : '>', + mem->bitfield_width, + mem->typ->szinfo.size); + return 0; + } + if (mem->bitfield_width) { + if ((target->unnamed_bitfield_aligns || mem->name) && (max_align < mem->typ->szinfo.align)) max_align = mem->typ->szinfo.align; + size_t cur_block = cur_sz / mem->typ->szinfo.align; + size_t end_block = (cur_sz + (cur_bit + mem->bitfield_width - 1) / 8) / mem->typ->szinfo.align; + if (cur_block == end_block) { + cur_sz += mem->bitfield_width / 8; + cur_bit += mem->bitfield_width % 8; + cur_sz += cur_bit / 8; + cur_bit %= 8; + } else { + cur_sz = ((cur_sz + mem->typ->szinfo.align - 1) & ~(mem->typ->szinfo.align - 1)) + (mem->bitfield_width / 8); + cur_bit = mem->bitfield_width % 8; + } + } else { + if (max_align < mem->typ->szinfo.align) max_align = mem->typ->szinfo.align; + cur_sz = ((cur_sz + mem->typ->szinfo.align - 1) & ~(mem->typ->szinfo.align - 1)) + mem->typ->szinfo.size; + log_error(loginfo, "TODO: unnamed zero-width bitfield member\n"); + return 0; + } + } else { + if (max_align < mem->typ->szinfo.align) max_align = mem->typ->szinfo.align; + if (typ->val.st->is_struct) { + if (cur_bit) { + cur_bit = 0; + ++cur_sz; + } + cur_sz = ((cur_sz + mem->typ->szinfo.align - 1) & ~(mem->typ->szinfo.align - 1)) + mem->typ->szinfo.size; + } else { + if (cur_sz < mem->typ->szinfo.size) cur_sz = mem->typ->szinfo.size; + } + } + } + if (cur_bit) { + cur_bit = 0; + ++cur_sz; + } + typ->szinfo.align = max_align; + typ->szinfo.size = (cur_sz + max_align - 1) & ~(max_align - 1); + return 1; } + case TYPE_ENUM: + if (typ->val.typ->typ != TYPE_BUILTIN) { + log_error(loginfo, "the underlying type of an enum is not a builtin type\n"); + return 0; + } + typ->szinfo = typ->val.typ->szinfo; + return 1; + } + return 0; +} diff --git a/wrapperhelper/src/machine.h b/wrapperhelper/src/machine.h new file mode 100644 index 0000000..67867c7 --- /dev/null +++ b/wrapperhelper/src/machine.h @@ -0,0 +1,34 @@ +#pragma once + +#ifndef MACHINE_H +#define MACHINE_H + +#include "cstring.h" +#include "khash.h" +#include "log.h" +#include "vector.h" + +struct type_s; // lang.h + +typedef struct machine_s { + // Preprocessor + size_t npaths; + char **include_path; + + // Parsing + size_t size_long; + size_t align_longdouble, size_longdouble; + size_t align_valist, size_valist; + size_t max_align; _Bool has_int128; + _Bool unsigned_char; + // Structure parsing + _Bool unnamed_bitfield_aligns; +} machine_t; + +int init_machines(size_t npaths, const char *const *extra_include_path); +void del_machines(void); +machine_t *convert_machine_name(const char *archname); + +int validate_type(loginfo_t *loginfo, machine_t *target, struct type_s *typ); + +#endif // MACHINE_H diff --git a/wrapperhelper/src/main.c b/wrapperhelper/src/main.c new file mode 100644 index 0000000..ae00ed7 --- /dev/null +++ b/wrapperhelper/src/main.c @@ -0,0 +1,419 @@ +#include +#include +#include +#include +#include + +#include "generator.h" +#include "lang.h" +#include "machine.h" +#include "parse.h" +#include "prepare.h" +#include "khash.h" + +static void help(char *arg0) { + printf("Usage: %s --help\n" + " %s {-I/path/to/include}* [--gst] [--prepare|--preproc|--proc] [--arch |-32|-64|--32|--64] \n" + " %s {-I/path/to/include}* [--gst] [[--emu ] [--target ]|-32|-64|--32|--64] \n" + "\n" + " --prepare Dump all preprocessor tokens (prepare phase)\n" + " --preproc Dump all processor tokens (preprocessor phase)\n" + " --proc Dump all typedefs, declarations and constants (processor phase, default)\n" + " -I Add a path to the list of system includes\n" + "\n" + "Filenames may be preceded by '-f' or '--filename'.\n" + " Parsing file\n" + " Reference file (example: wrappedlibc_private.h)\n" + " Output file\n" + "\n" + "You can also specify the target architecture:" + " --arch Use the architecture \n" + " --emu Use the architecture as emulated architecture\n" + " --target Use the architecture as target/running architecture\n" + " -32 --32 Use the x86 architecture as arch/emulated, aarch64 as target\n" + " -64 --64 Use the x86_64 architecture as arch/emulated, aarch64 as target\n" + "\n" + " is one of 'x86', 'x86_64', 'aarch64'\n" + "\n" + " --gst Mark all structures with a tag starting with '_G' and ending with 'Class' as simple\n", + arg0, arg0, arg0); +} + +enum main_state { + MAIN_RUN, + MAIN_PREPARE, + MAIN_PREPROC, + MAIN_PROC, +}; + +enum bits_state { + BITS_NONE, + BITS_32, + BITS_64, +}; + +int is_gst = 0; + +int main(int argc, char **argv) { + setbuf(stdout, NULL); + if (!setlocale(LC_NUMERIC, "C")) { + log_error_nopos("failed to set LC_NUMERIC to C\n"); + return 2; + } + + enum main_state ms = MAIN_RUN; + enum bits_state bs = BITS_NONE; + const char *in_file = NULL, *ref_file = NULL, *out_file = NULL; + VECTOR(charp) *paths = vector_new(charp); + const char *archname = NULL, *emuname = NULL, *targetname = NULL; + + for (int i = 1; i < argc; ++i) { + int isfile = 0; + + if (!strcmp(argv[i], "--help")) { + help(argv[0]); + return 0; + } else if (!strcmp(argv[i], "--prepare")) { + ms = MAIN_PREPARE; + } else if (!strcmp(argv[i], "--preproc")) { + ms = MAIN_PREPROC; + } else if (!strcmp(argv[i], "--proc")) { + ms = MAIN_PROC; + } else if (!strcmp(argv[i], "--gst")) { + is_gst = 1; + } else if (!strcmp(argv[i], "-pthread")) { + // Ignore + } else if (!strcmp(argv[i], "-I") && (i + 1 < argc)) { + if (!vector_push(charp, paths, argv[i + 1])) { + log_memory("failed to add path to buffer\n"); + return 2; + } + ++i; + } else if ((argv[i][0] == '-') && (argv[i][1] == 'I') && (argv[i][2] != '\0')) { + if (!vector_push(charp, paths, argv[i] + 2)) { + log_memory("failed to add path to buffer\n"); + return 2; + } + } else if (!strcmp(argv[i], "--arch")) { + ++i; + if (i < argc) { + archname = argv[i]; + } else { + log_error_nopos("invalid '--arch' option in last position\n"); + help(argv[0]); + return 0; + } + } else if (!strcmp(argv[i], "--emu")) { + ++i; + if (i < argc) { + emuname = argv[i]; + } else { + log_error_nopos("invalid '--emu' option in last position\n"); + help(argv[0]); + return 0; + } + } else if (!strcmp(argv[i], "--target")) { + ++i; + if (i < argc) { + targetname = argv[i]; + } else { + log_error_nopos("invalid '--target' option in last position\n"); + help(argv[0]); + return 0; + } + } else if (!strcmp(argv[i], "-32") || !strcmp(argv[i], "--32")) { + bs = BITS_32; + } else if (!strcmp(argv[i], "-64") || !strcmp(argv[i], "--64")) { + bs = BITS_64; + } else if (!strcmp(argv[i], "-f") || !strcmp(argv[i], "--filename")) { + ++i; + if (i < argc) { + isfile = 1; + } else { + log_error_nopos("invalid '--filename' option in last position\n"); + help(argv[0]); + return 0; + } + } else { + isfile = 1; + } + if (isfile) { + if (!in_file) { + in_file = argv[i]; + } else if (!ref_file) { + ref_file = argv[i]; + } else if (!out_file) { + out_file = argv[i]; + } else { + log_error_nopos("too many unknown options considered as file\n"); + help(argv[0]); + return 2; + } + } + } + switch (ms) { + case MAIN_PREPARE: + case MAIN_PREPROC: + case MAIN_PROC: + check_proc: + if (!in_file || ref_file || out_file) { + log_error_nopos("too many unknown options/not enough arguments\n"); + help(argv[0]); + return 2; + } + if (emuname || targetname) { + log_error_nopos("invalid option '--emu' or '--target' in prepare/preprocessor/processor mode\n"); + help(argv[0]); + return 2; + } + if (bs != BITS_NONE) { + if (archname) { + log_error_nopos("invalid option '--arch' with '--32' or '--64' in prepare/preprocessor/processor mode\n"); + help(argv[0]); + return 2; + } + archname = (bs == BITS_32) ? "x86" : "x86_64"; + } + if (!archname) archname = "x86_64"; + break; + case MAIN_RUN: + if (in_file && !ref_file && !out_file) { + ms = MAIN_PROC; + goto check_proc; + } + if (!in_file || !ref_file || !out_file) { + log_error_nopos("too many unknown options/not enough arguments\n"); + help(argv[0]); + return 2; + } + if (archname) { + log_error_nopos("invalid option '--arch' in run mode\n"); + help(argv[0]); + return 2; + } + if (bs != BITS_NONE) { + if (emuname || targetname) { + log_error_nopos("invalid option '--emu' or '--target' with '--32' or '--64' in run mode\n"); + help(argv[0]); + return 2; + } + emuname = (bs == BITS_32) ? "x86" : "x86_64"; + targetname = "aarch64"; + } + if (!emuname) emuname = "x86_64"; + if (!targetname) targetname = "aarch64"; + break; + } + + if (!init_str2kw()) { + return 2; + } + if (!init_machines(vector_size(charp, paths), (const char*const*)vector_content(charp, paths))) { + vector_del(charp, paths); + del_str2kw(); + return 2; + } + vector_del(charp, paths); + + FILE *f = fopen(in_file, "r"); + if (!f) { + err(2, "Error: failed to open %s", in_file); + del_machines(); + del_str2kw(); + return 2; + } + switch (ms) { + case MAIN_RUN: { + machine_t *emu = convert_machine_name(emuname); + if (!emu) { + log_error_nopos("invalid emulation architecture '%s'\n", emuname); + del_machines(); + del_str2kw(); + return 0; + } + machine_t *target = convert_machine_name(targetname); + if (!target) { + log_error_nopos("invalid target architecture '%s'\n", targetname); + del_machines(); + del_str2kw(); + return 0; + } + + file_t *emu_content = parse_file(emu, in_file, f); // Takes ownership of f + if (!emu_content) { + log_error_nopos("failed to parse the file\n"); + del_machines(); + del_str2kw(); + prepare_cleanup(); + return 0; + } + + f = fopen(in_file, "r"); + if (!f) { + err(2, "Error: failed to re-open %s", in_file); + file_del(emu_content); + del_machines(); + del_str2kw(); + prepare_cleanup(); + return 2; + } + file_t *target_content = parse_file(target, in_file, f); // Takes ownership of f + if (!target_content) { + log_error_nopos("failed to parse the file\n"); + file_del(emu_content); + del_machines(); + del_str2kw(); + prepare_cleanup(); + return 0; + } + + FILE *ref = fopen(ref_file, "r"); + if (!ref) { + err(2, "Error: failed to open %s", ref_file); + file_del(emu_content); + file_del(target_content); + del_machines(); + del_str2kw(); + prepare_cleanup(); + return 2; + } + VECTOR(references) *refs = references_from_file(ref_file, ref); + if (!refs) { + file_del(emu_content); + file_del(target_content); + del_machines(); + del_str2kw(); + prepare_cleanup(); + return 2; + } + // vector_for(references, req, refs) request_print(req); + if (target->size_long != emu->size_long) { + if (!solve_references(refs, emu_content->decl_map, target_content->decl_map, emu_content->relaxed_type_conversion)) { + log_warning_nopos("failed to solve all default requests\n"); + } + } else { + if (!solve_references_simple(refs, emu_content->decl_map, target_content->decl_map, emu_content->relaxed_type_conversion)) { + log_warning_nopos("failed to solve all default requests\n"); + } + } + // vector_for(references, req, refs) request_print(req); + references_print_check(refs); + FILE *out = fopen(out_file, "w"); + if (!out) { + err(2, "Error: failed to open %s", ref_file); + file_del(emu_content); + file_del(target_content); + vector_del(references, refs); + del_machines(); + del_str2kw(); + prepare_cleanup(); + return 2; + } + output_from_references(out, refs); + fclose(out); + vector_del(references, refs); + file_del(emu_content); + file_del(target_content); + del_machines(); + del_str2kw(); + prepare_cleanup(); + return 0; } + + case MAIN_PROC: { + machine_t *arch = convert_machine_name(archname); + if (!arch) { + log_error_nopos("invalid architecture '%s'\n", archname); + } + file_t *content = parse_file(arch, in_file, f); // Takes ownership of f + if (!content) { + log_error_nopos("failed to parse the file\n"); + del_machines(); + del_str2kw(); + prepare_cleanup(); + return 0; + } + // print content + const char *name; + struct_t *st; + string_t *str; + type_t *typ; + declaration_t *decl; + num_constant_t cst; + /* for (enum type_builtin_e i = 0; i < LAST_BUILTIN; ++i) { + printf("Builtin %u: %p, ", i, content->builtins[i]); + type_print(content->builtins[i]); + printf("\n"); + } */ + kh_foreach(content->struct_map, name, st, + printf("Struct: %s -> %p = ", name, st); + struct_print(st); + printf("\n") + ) + kh_foreach_key(content->type_set, typ, + printf("Type: %p = ", typ); + type_print(typ); + printf("\n") + ) + kh_foreach(content->relaxed_type_conversion, typ, str, + printf("Type conversion: %p -> %s\n", typ, string_content(str)); + ) + kh_foreach(content->type_map, name, typ, + printf("Typedef: %s -> %p = ", name, typ); + type_print(typ); + printf("\n") + ) + kh_foreach(content->enum_map, name, typ, + printf("Enum: %s -> %p = ", name, typ); + type_print(typ); + printf("\n") + ) + kh_foreach(content->const_map, name, cst, + printf("Constant: %s -> ", name); + switch (cst.typ) { + case NCT_FLOAT: printf("%ff", cst.val.f); break; + case NCT_DOUBLE: printf("%f", cst.val.d); break; + case NCT_LDOUBLE: printf("%Lfl", cst.val.l); break; + case NCT_INT32: printf("%d", cst.val.i32); break; + case NCT_UINT32: printf("%uu", cst.val.u32); break; + case NCT_INT64: printf("%ldll", cst.val.i64); break; + case NCT_UINT64: printf("%lullu", cst.val.u64); break; + } + printf("\n") + ) + kh_foreach(content->decl_map, name, decl, + printf("Declaration: %s -> %p = %u/%p: ", name, decl, decl->storage, decl->typ); + type_print(decl->typ); + printf("\n") + ) + file_del(content); + del_machines(); + del_str2kw(); + prepare_cleanup(); + return 0; } + + case MAIN_PREPARE: + // Ignored --arch, since this phase does not depend on the architecture + dump_prepare(in_file, f); // Takes ownership of f + del_machines(); + del_str2kw(); + prepare_cleanup(); + return 0; + + case MAIN_PREPROC: { + machine_t *arch = convert_machine_name(archname); + if (!arch) { + log_error_nopos("invalid architecture '%s'\n", archname); + } + dump_preproc(arch, in_file, f); // Takes ownership of f + del_machines(); + del_str2kw(); + prepare_cleanup(); + return 0; } + } + + log_internal_nopos("failed to run mode %u\n", ms); + del_machines(); + del_str2kw(); + prepare_cleanup(); + return 2; +} diff --git a/wrapperhelper/src/parse.c b/wrapperhelper/src/parse.c new file mode 100644 index 0000000..7d55eaf --- /dev/null +++ b/wrapperhelper/src/parse.c @@ -0,0 +1,3581 @@ +#include "parse.h" + +#include +#include + +#include "cstring.h" +#include "khash.h" +#include "machine.h" +#include "prepare.h" +#include "preproc.h" + +void dump_prepare(const char *filename, FILE *file) { + prepare_t *prep = prepare_new_file(file, filename); + if (!prep) { + log_memory("failed to create the prepare structure\n"); + return; + } + while (1) { + preproc_token_t tok = pre_next_token(prep, 0); + preproc_token_print(&tok); + if (preproc_token_isend(&tok)) { + preproc_token_del(&tok); + prepare_del(prep); + return; + } + preproc_token_del(&tok); + } +} +void dump_preproc(machine_t *target, const char *filename, FILE *file) { + char *dirname = strchr(filename, '/') ? strndup(filename, (size_t)(strrchr(filename, '/') - filename)) : NULL; + preproc_t *prep = preproc_new_file(target, file, dirname, filename); + if (!prep) { + log_memory("failed to create the preproc structure\n"); + if (dirname) free(dirname); + return; + } + while (1) { + proc_token_t tok = proc_next_token(prep); + proc_token_print(&tok); + if (proc_token_isend(&tok)) { + proc_token_del(&tok); + preproc_del(prep); + return; + } + proc_token_del(&tok); + } +} + +enum decl_storage { + TMPSTO_NONE, + TMPSTO_TYPEDEF, + TMPSTO_EXTERN, + TMPSTO_STATIC, + TMPSTO_TLS, + TMPSTO_TLS_EXTERN, + TMPSTO_TLS_STATIC, + TMPSTO_AUTO, + TMPSTO_REG, +}; +const enum decl_storage_e tmpsto2sto[] = { + [TMPSTO_NONE] = STORAGE_NONE, + [TMPSTO_TYPEDEF] = STORAGE_NONE, + [TMPSTO_EXTERN] = STORAGE_EXTERN, + [TMPSTO_STATIC] = STORAGE_STATIC, + [TMPSTO_TLS] = STORAGE_TLS, + [TMPSTO_TLS_EXTERN] = STORAGE_TLS_EXTERN, + [TMPSTO_TLS_STATIC] = STORAGE_TLS_STATIC, + [TMPSTO_AUTO] = STORAGE_AUTO, + [TMPSTO_REG] = STORAGE_REG, +}; +enum decl_spec { + SPEC_NONE, + SPEC_BUILTIN, + SPEC_COMPLEX, + SPEC_IMAGINARY, + SPEC_LONGCOMPLEX, + SPEC_LONGIMAGINARY, + SPEC_BUILTIN_NOINT, + SPEC_TYPE, +}; +enum fun_spec { + FSPEC_NONE = 0b00, + FSPEC_INLINE = 0b01, + FSPEC_NORETURN = 0b10, + FSPEC_INLINE_NORETURN = 0b11, +}; +VECTOR_DECLARE_STATIC(size_t, size_t) +VECTOR_IMPL_STATIC(size_t, (void)) + +#define VALIDATION_DECL 1 +#define VALIDATION_LAST_DECL 2 +#define VALIDATION_FUN 3 +static int validate_storage_type(loginfo_t *loginfo, machine_t *target, enum decl_storage storage, + type_t *typ, enum token_sym_type_e sym) { + // We may still do adjustments here + if (!validate_type(loginfo, target, typ)) return 0; + if (typ->typ == TYPE_FUNCTION) { + if ((storage == TMPSTO_TLS) || (storage == TMPSTO_TLS_EXTERN) || (storage == TMPSTO_TLS_STATIC)) { + log_error(loginfo, "functions cannot be thread local\n"); + return 0; + } + if ((sym == SYM_COMMA) || (sym == SYM_RPAREN) || (sym == SYM_SEMICOLON)) { + return (sym == SYM_SEMICOLON) ? VALIDATION_LAST_DECL : VALIDATION_DECL; + } else if (sym == SYM_LBRACKET) { + return VALIDATION_FUN; + } else { + log_error(loginfo, "unexpected symbol %s (%u) after function declaration\n", sym2str[sym], sym); + return 0; + } + } else { + if ((sym == SYM_COMMA) || (sym == SYM_RPAREN) || (sym == SYM_SEMICOLON) || ((storage != TMPSTO_TYPEDEF) && (sym == SYM_EQ))) { + return (sym == SYM_SEMICOLON) ? VALIDATION_LAST_DECL : VALIDATION_DECL; + } else { + log_error(loginfo, "unexpected symbol %s (%u) after %s declaration\n", sym2str[sym], sym, (storage == TMPSTO_TYPEDEF) ? "type" : "variable"); + return 0; + } + } +} + +static void promote_csts(num_constant_t *v1, num_constant_t *v2) { + switch (v1->typ) { + case NCT_FLOAT: + switch (v2->typ) { + case NCT_FLOAT: break; + case NCT_DOUBLE: v1->typ = NCT_DOUBLE; v1->val.d = v1->val.f; break; + case NCT_LDOUBLE: v1->typ = NCT_LDOUBLE; v1->val.l = v1->val.f; break; + case NCT_INT32: v2->typ = NCT_FLOAT; v2->val.f = (float)v2->val.i32; break; + case NCT_UINT32: v2->typ = NCT_FLOAT; v2->val.f = (float)v2->val.u32; break; + case NCT_INT64: v2->typ = NCT_FLOAT; v2->val.f = (float)v2->val.i64; break; + case NCT_UINT64: v2->typ = NCT_FLOAT; v2->val.f = (float)v2->val.u64; break; + } + break; + case NCT_DOUBLE: + switch (v2->typ) { + case NCT_FLOAT: v2->typ = NCT_DOUBLE; v2->val.d = v2->val.f; break; + case NCT_DOUBLE: break; + case NCT_LDOUBLE: v1->typ = NCT_LDOUBLE; v1->val.l = v1->val.d; break; + case NCT_INT32: v2->typ = NCT_DOUBLE; v2->val.d = (double)v2->val.i32; break; + case NCT_UINT32: v2->typ = NCT_DOUBLE; v2->val.d = (double)v2->val.u32; break; + case NCT_INT64: v2->typ = NCT_DOUBLE; v2->val.d = (double)v2->val.i64; break; + case NCT_UINT64: v2->typ = NCT_DOUBLE; v2->val.d = (double)v2->val.u64; break; + } + break; + case NCT_LDOUBLE: + switch (v2->typ) { + case NCT_FLOAT: v2->typ = NCT_LDOUBLE; v2->val.l = v2->val.f; break; + case NCT_DOUBLE: v2->typ = NCT_LDOUBLE; v2->val.l = v2->val.d; break; + case NCT_LDOUBLE: break; + case NCT_INT32: v2->typ = NCT_LDOUBLE; v2->val.l = (long double)v2->val.i32; break; + case NCT_UINT32: v2->typ = NCT_LDOUBLE; v2->val.l = (long double)v2->val.u32; break; + case NCT_INT64: v2->typ = NCT_LDOUBLE; v2->val.l = (long double)v2->val.i64; break; + case NCT_UINT64: v2->typ = NCT_LDOUBLE; v2->val.l = (long double)v2->val.u64; break; + } + break; + case NCT_INT32: + switch (v2->typ) { + case NCT_FLOAT: v1->typ = NCT_FLOAT; v1->val.f = (float)v1->val.i32; break; + case NCT_DOUBLE: v1->typ = NCT_DOUBLE; v1->val.d = (double)v1->val.i32; break; + case NCT_LDOUBLE: v1->typ = NCT_LDOUBLE; v1->val.l = (long double)v1->val.i32; break; + case NCT_INT32: break; + case NCT_UINT32: v1->typ = NCT_UINT32; v1->val.u32 = (uint32_t)v1->val.i32; break; + case NCT_INT64: v1->typ = NCT_INT64; v1->val.i64 = v1->val.i32; break; + case NCT_UINT64: v1->typ = NCT_UINT64; v1->val.u64 = (uint64_t)v1->val.i32; break; + } + break; + case NCT_UINT32: + switch (v2->typ) { + case NCT_FLOAT: v1->typ = NCT_FLOAT; v1->val.f = (float)v1->val.u32; break; + case NCT_DOUBLE: v1->typ = NCT_DOUBLE; v1->val.d = (double)v1->val.u32; break; + case NCT_LDOUBLE: v1->typ = NCT_LDOUBLE; v1->val.l = (long double)v1->val.u32; break; + case NCT_INT32: v2->typ = NCT_UINT32; v2->val.u32 = (uint32_t)v2->val.i32; break; + case NCT_UINT32: break; + case NCT_INT64: v1->typ = NCT_INT64; v1->val.i64 = v1->val.u32; break; + case NCT_UINT64: v1->typ = NCT_UINT64; v1->val.u64 = v1->val.u32; break; + } + break; + case NCT_INT64: + switch (v2->typ) { + case NCT_FLOAT: v1->typ = NCT_FLOAT; v1->val.f = (float)v1->val.i64; break; + case NCT_DOUBLE: v1->typ = NCT_DOUBLE; v1->val.d = (double)v1->val.i64; break; + case NCT_LDOUBLE: v1->typ = NCT_LDOUBLE; v1->val.l = (long double)v1->val.i64; break; + case NCT_INT32: v2->typ = NCT_INT64; v2->val.i64 = v2->val.i32; break; + case NCT_UINT32: v2->typ = NCT_INT64; v2->val.i64 = v2->val.u32; break; + case NCT_INT64: break; + case NCT_UINT64: v1->typ = NCT_UINT64; v1->val.u64 = (uint64_t)v1->val.i64; break; + } + break; + case NCT_UINT64: + switch (v2->typ) { + case NCT_FLOAT: v1->typ = NCT_FLOAT; v1->val.f = (float)v1->val.u64; break; + case NCT_DOUBLE: v1->typ = NCT_DOUBLE; v1->val.d = (double)v1->val.u64; break; + case NCT_LDOUBLE: v1->typ = NCT_LDOUBLE; v1->val.l = (long double)v1->val.u64; break; + case NCT_INT32: v2->typ = NCT_UINT64; v2->val.u64 = (uint64_t)v2->val.i32; break; + case NCT_UINT32: v2->typ = NCT_UINT64; v2->val.u64 = v2->val.u32; break; + case NCT_INT64: v2->typ = NCT_UINT64; v2->val.u64 = (uint64_t)v2->val.i64; break; + case NCT_UINT64: break; + } + break; + } +} + +#define TOKEN_MATCH_ATTR(attr) (!strcmp(string_content(tok->tokv.str), #attr) || !strcmp(string_content(tok->tokv.str), "__" #attr "__")) + +VECTOR_DECLARE_STATIC(exprs, expr_t*) +#define expr_del_ptr(p) expr_del(*(p)) +VECTOR_IMPL_STATIC(exprs, expr_del_ptr) +#undef expr_del_ptr +struct expr_partial_op { + enum expr_partial_op_e { + EPO_LPAREN, + EPO_SIZEOF, + EPO_CAST, + EPO_FUNCALL, + EPO_UNARY, + EPO_BINARY_ARG, + EPO_BINARY_ARG_SYM, + EPO_TERNARY_ARG1, + EPO_TERNARY_ARG2, + } typ; + int once_done_want_level; + int once_done_is_level; + union { + char c; // Empty destructor + type_t *typ; + struct { + expr_t *f; + VECTOR(exprs) *exprs; + } funcall; + enum unary_op_e unop; + struct { + enum binary_op_e op; + expr_t *e1; + enum token_sym_type_e last_sym; + } binop; + struct { + enum ternary_op_e op; + expr_t *e1; + expr_t *e2; + int once_done2_want_level; + enum token_sym_type_e arg23_sep; + } ternop; + } val; +}; +void expr_partial_op_del(struct expr_partial_op *epo) { + switch (epo->typ) { + case EPO_LPAREN: + case EPO_SIZEOF: + return; + case EPO_CAST: + type_del(epo->val.typ); + return; + case EPO_FUNCALL: + expr_del(epo->val.funcall.f); + vector_del(exprs, epo->val.funcall.exprs); + return; + case EPO_UNARY: + return; + case EPO_BINARY_ARG: + case EPO_BINARY_ARG_SYM: + expr_del(epo->val.binop.e1); + return; + case EPO_TERNARY_ARG1: + expr_del(epo->val.ternop.e1); + return; + case EPO_TERNARY_ARG2: + expr_del(epo->val.ternop.e1); + expr_del(epo->val.ternop.e2); + return; + } +} +VECTOR_DECLARE_STATIC(expr_pops, struct expr_partial_op) +VECTOR_IMPL_STATIC(expr_pops, expr_partial_op_del) + +VECTOR_DECLARE_STATIC(types, type_t*) +#define type_ptr_del(t) type_del(*(t)) +VECTOR_IMPL_STATIC(types, type_ptr_del) +#undef type_ptr_del +VECTOR_DECLARE_STATIC(st_members, st_member_t) +VECTOR_IMPL_STATIC(st_members, st_member_del) + +struct parse_declarator_dest_s { + file_t *f; // is_init, is_list + struct { + khash_t(struct_map) *struct_map; + khash_t(type_map) *type_map; + khash_t(type_map) *enum_map; + khash_t(type_set) *type_set; + type_t *(*builtins)[LAST_BUILTIN + 1]; + khash_t(const_map) *const_map; + type_t *dest; + } argt; // !is_init, !is_list + struct { + khash_t(struct_map) *struct_map; + khash_t(type_map) *type_map; + khash_t(type_map) *enum_map; + khash_t(type_set) *type_set; + type_t *(*builtins)[LAST_BUILTIN + 1]; + khash_t(const_map) *const_map; + VECTOR(st_members) *dest; + } structms; // !is_init, is_list +}; +#define PDECL_STRUCT_MAP ((is_init && is_list) ? dest->f->struct_map : (!is_init && is_list) ? dest->structms.struct_map : dest->argt.struct_map) +#define PDECL_TYPE_MAP ((is_init && is_list) ? dest->f->type_map : (!is_init && is_list) ? dest->structms.type_map : dest->argt.type_map) +#define PDECL_ENUM_MAP ((is_init && is_list) ? dest->f->enum_map : (!is_init && is_list) ? dest->structms.enum_map : dest->argt.enum_map) +#define PDECL_TYPE_SET ((is_init && is_list) ? dest->f->type_set : (!is_init && is_list) ? dest->structms.type_set : dest->argt.type_set) +#define PDECL_BUILTINS ((is_init && is_list) ? &dest->f->builtins : (!is_init && is_list) ? dest->structms.builtins : dest->argt.builtins) +#define PDECL_CONST_MAP ((is_init && is_list) ? dest->f->const_map : (!is_init && is_list) ? dest->structms.const_map : dest->argt.const_map) +static int parse_declarator(machine_t *target, struct parse_declarator_dest_s *dest, preproc_t *prep, proc_token_t *tok, enum decl_storage storage, + enum fun_spec fspec, type_t *base_type, int is_init, int is_list, int allow_decl, int allow_abstract); + +// declaration-specifier with storage != NULL +// specifier-qualifier-list + static_assert-declaration with storage == NULL +static int parse_declaration_specifier(machine_t *target, khash_t(struct_map) *struct_map, khash_t(type_map) *type_map, khash_t(type_map) *enum_map, + type_t *(*builtins)[LAST_BUILTIN + 1], khash_t(const_map) *const_map, + khash_t(type_set) *type_set, preproc_t *prep, proc_token_t *tok, enum decl_storage *storage, enum fun_spec *fspec, enum decl_spec *spec, type_t *typ); + +static int is_type_spec_qual_kw(enum token_keyword_type_e kw) { + return + (kw == KW_ATOMIC) || + (kw == KW_BOOL) || + (kw == KW_CHAR) || + (kw == KW_COMPLEX) || + (kw == KW_CONST) || + (kw == KW_DOUBLE) || + (kw == KW_ENUM) || + (kw == KW_FLOAT) || + (kw == KW_FLOAT128) || + (kw == KW_IMAGINARY) || + (kw == KW_INT) || + (kw == KW_INT128) || + (kw == KW_LONG) || + (kw == KW_RESTRICT) || + (kw == KW_SHORT) || + (kw == KW_SIGNED) || + (kw == KW_STRUCT) || + (kw == KW_UNION) || + (kw == KW_UNSIGNED) || + (kw == KW_VOID) || + (kw == KW_VOLATILE) || + 0; +} +#define IS_BEGIN_TYPE_NAME \ + (((tok->tokt == PTOK_KEYWORD) && is_type_spec_qual_kw(tok->tokv.kw)) || \ + ((tok->tokt == PTOK_IDENT) && ((it = kh_get(type_map, type_map, string_content(tok->tokv.str))) != kh_end(type_map)))) +static int parse_type_name(machine_t *target, khash_t(struct_map) *struct_map, khash_t(type_map) *type_map, khash_t(type_map) *enum_map, + type_t *(*builtins)[LAST_BUILTIN + 1], khash_t(const_map) *const_map, + khash_t(type_set) *type_set, preproc_t *prep, proc_token_t *tok, enum token_sym_type_e end_sym, type_t **typ) { + enum decl_spec spec = SPEC_NONE; + if (!parse_declaration_specifier(target, struct_map, type_map, enum_map, builtins, const_map, type_set, prep, tok, NULL, NULL, &spec, *typ)) { + type_del(*typ); + goto failed; + } + *typ = type_try_merge(*typ, type_set); + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == end_sym)) { + return validate_type(&tok->loginfo, target, *typ); + } + struct parse_declarator_dest_s dest2; + dest2.argt.dest = NULL; + dest2.argt.struct_map = struct_map; + dest2.argt.type_map = type_map; + dest2.argt.enum_map = enum_map; + dest2.argt.type_set = type_set; + dest2.argt.builtins = builtins; + dest2.argt.const_map = const_map; + if (!parse_declarator(target, &dest2, prep, tok, TMPSTO_NONE, FSPEC_NONE, *typ, 0, 0, 0, 1)) { + // Token is deleted + type_del(*typ); + goto failed; + } + type_del(*typ); + if (!dest2.argt.dest) { + log_internal(&tok->loginfo, "parse_type_name: argument type is NULL\n"); + // Empty destructor + goto failed; + } + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != end_sym)) { + log_error(&tok->loginfo, "invalid token %s %u after type name\n", + (tok->tokt == PTOK_SYM) ? "symbol" : "type", (tok->tokt == PTOK_SYM) ? tok->tokv.sym : tok->tokt); + type_del(dest2.argt.dest); + proc_token_del(tok); + goto failed; + } + *typ = dest2.argt.dest; + *typ = type_try_merge(*typ, type_set); + return validate_type(&tok->loginfo, target, *typ); + +failed: + return 0; +} + +static expr_t *parse_expression(machine_t *target, khash_t(struct_map) *struct_map, khash_t(type_map) *type_map, khash_t(type_map) *enum_map, + type_t *(*builtins)[LAST_BUILTIN + 1], khash_t(const_map) *const_map, + khash_t(type_set) *type_set, preproc_t *prep, proc_token_t *tok, int expr_level) { + // Note that expr_level >= 1; expr_level = 0 doesn't appear in the grammar + if ((expr_level < 1) || (expr_level > 16)) { + log_internal(&tok->loginfo, "Internal error: invalid expression level %d\n", expr_level); + return NULL; + } + + VECTOR(expr_pops) *op_stack = vector_new(expr_pops); + if (!op_stack) { + log_memory("failed to create operation stack"); + proc_token_del(tok); + return NULL; + } + + int has_level; + expr_t *e; +pushed_expr: + has_level = -1; + e = NULL; + +expr_new_token: + if (tok->tokt == PTOK_IDENT) { + if (has_level != -1) { + log_error(&tok->loginfo, "invalid expression: unexpected identifier '%s'\n", string_content(tok->tokv.str)); + string_del(tok->tokv.str); + goto failed; + } + has_level = 0; + e = malloc(sizeof *e); + if (!e) { + log_memory("failed to create new expression atom\n"); + string_del(tok->tokv.str); + goto failed; + } + e->typ = ETY_VAR; + e->val.var = tok->tokv.str; + *tok = proc_next_token(prep); + goto expr_new_token; + } else if (tok->tokt == PTOK_NUM) { + if (has_level != -1) { + log_error(&tok->loginfo, "invalid expression: unexpected number '%s'\n", string_content(tok->tokv.str)); + string_del(tok->tokv.str); + goto failed; + } + has_level = 0; + e = malloc(sizeof *e); + if (!e) { + log_memory("failed to create new expression atom\n"); + string_del(tok->tokv.str); + goto failed; + } + e->typ = ETY_CONST; + if (!num_constant_convert(&tok->loginfo, tok->tokv.str, &e->val.cst, target->size_long == 4)) { + string_del(tok->tokv.str); + goto failed; + } + string_del(tok->tokv.str); + *tok = proc_next_token(prep); + goto expr_new_token; + } else if ((tok->tokt == PTOK_STRING) && !tok->tokv.sisstr) { + if (has_level != -1) { + log_error(&tok->loginfo, "invalid expression: unexpected character constant '%s'\n", string_content(tok->tokv.sstr)); + string_del(tok->tokv.sstr); + goto failed; + } + if (string_len(tok->tokv.sstr) != 1) { + log_TODO(&tok->loginfo, "invalid expression: multibyte character constant '%s'\n", string_content(tok->tokv.sstr)); + string_del(tok->tokv.sstr); + goto failed; + } + has_level = 0; + e = malloc(sizeof *e); + if (!e) { + log_memory("failed to create new expression atom\n"); + string_del(tok->tokv.sstr); + goto failed; + } + e->typ = ETY_CONST; + e->val.cst.typ = NCT_INT32; + e->val.cst.val.i32 = (int32_t)string_content(tok->tokv.sstr)[0]; + string_del(tok->tokv.sstr); + *tok = proc_next_token(prep); + goto expr_new_token; + } + +#define UNOP(toksym, opt, main_lv, right_lv) \ + if ((expr_level >= main_lv) && (tok->tokt == PTOK_SYM) && (tok->tokv.sym == toksym)) { \ + if (has_level == -1) { \ + struct expr_partial_op pop = { \ + .once_done_want_level = expr_level, \ + .once_done_is_level = main_lv, \ + .typ = EPO_UNARY, \ + .val.unop = opt \ + }; \ + if (!vector_push(expr_pops, op_stack, pop)) { \ + log_memory("failed to add partial operation to operation stack\n"); \ + /* Empty destructor */ \ + goto failed; \ + } \ + expr_level = right_lv; \ + *tok = proc_next_token(prep); \ + goto pushed_expr; \ + } \ + } +#define BINOP(toksym, opt, main_lv, left_lv, right_lv) \ + if ((expr_level >= main_lv) && (tok->tokt == PTOK_SYM) && (tok->tokv.sym == toksym)) { \ + if ((has_level != -1) && (has_level <= left_lv)) { \ + struct expr_partial_op pop = { \ + .once_done_want_level = expr_level, \ + .once_done_is_level = main_lv, \ + .typ = EPO_BINARY_ARG, \ + .val.binop = {.op = opt, .e1 = e} \ + }; \ + if (!vector_push(expr_pops, op_stack, pop)) { \ + log_memory("failed to add partial operation to operation stack\n"); \ + /* Empty destructor */ \ + goto failed; \ + } \ + expr_level = right_lv; \ + *tok = proc_next_token(prep); \ + goto pushed_expr; \ + } \ + } + + if ((expr_level >= 1) && (tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_PLUSPLUS)) { + if ((has_level != -1) && (has_level <= 1)) { + has_level = 1; + expr_t *new_e = malloc(sizeof *new_e); + if (!new_e) { + log_memory("failed to create new expression atom\n"); + string_del(tok->tokv.str); + goto failed; + } + new_e->typ = ETY_UNARY; + new_e->val.unary.typ = UOT_POSTINCR; + new_e->val.unary.e = e; + e = new_e; + *tok = proc_next_token(prep); + goto expr_new_token; + } + } + if ((expr_level >= 1) && (tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_DASHDASH)) { + if ((has_level != -1) && (has_level <= 1)) { + has_level = 1; + expr_t *new_e = malloc(sizeof *new_e); + if (!new_e) { + log_memory("failed to create new expression atom\n"); + string_del(tok->tokv.str); + goto failed; + } + new_e->typ = ETY_UNARY; + new_e->val.unary.typ = UOT_POSTDECR; + new_e->val.unary.e = e; + e = new_e; + *tok = proc_next_token(prep); + goto expr_new_token; + } + } + if ((expr_level >= 1) && (tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_LSQBRACKET)) { + if ((has_level != -1) && (has_level <= 1)) { + struct expr_partial_op pop = { + .once_done_want_level = expr_level, + .once_done_is_level = 1, + .typ = EPO_BINARY_ARG_SYM, + .val.binop = {.last_sym = SYM_RSQBRACKET, .op = BOT_ARRAY, .e1 = e} + }; + if (!vector_push(expr_pops, op_stack, pop)) { + log_memory("failed to add partial operation to operation stack\n"); + /* Empty destructor */ + goto failed; + } + expr_level = 16; + *tok = proc_next_token(prep); + goto pushed_expr; + } + } + if ((expr_level >= 1) && (tok->tokt == PTOK_SYM) && ((tok->tokv.sym == SYM_DOT) || (tok->tokv.sym == SYM_DASHGT))) { + if ((has_level != -1) && (has_level <= 1)) { + has_level = 1; + int is_ptr = tok->tokv.sym == SYM_DASHGT; + + *tok = proc_next_token(prep); + if (tok->tokt != PTOK_IDENT) { + log_error(&tok->loginfo, "invalid expression: unexpected token after access symbol\n"); + proc_token_del(tok); + goto failed; + } + expr_t *new_e = malloc(sizeof *new_e); + if (!new_e) { + log_memory("failed to create new expression atom\n"); + string_del(tok->tokv.str); + goto failed; + } + new_e->typ = is_ptr ? ETY_PTRACCESS : ETY_ACCESS; + new_e->val.access.val = e; + new_e->val.access.member = tok->tokv.str; + e = new_e; + *tok = proc_next_token(prep); + goto expr_new_token; + } + } + UNOP(SYM_PLUSPLUS, UOT_PREINCR, 2, 2) + UNOP(SYM_DASHDASH, UOT_PREDECR, 2, 2) + UNOP(SYM_AMP, UOT_REF, 2, 3) + UNOP(SYM_PLUS, UOT_POS, 2, 3) + UNOP(SYM_DASH, UOT_NEG, 2, 3) + UNOP(SYM_STAR, UOT_DEREF, 2, 3) + UNOP(SYM_TILDE, UOT_ANOT, 2, 3) + UNOP(SYM_EXCL, UOT_BNOT, 2, 3) + BINOP(SYM_STAR, BOT_MUL, 4, 4, 3) + BINOP(SYM_SLASH, BOT_DIV, 4, 4, 3) + BINOP(SYM_PERCENT, BOT_MOD, 4, 4, 3) + BINOP(SYM_PLUS, BOT_ADD, 5, 5, 4) + BINOP(SYM_DASH, BOT_SUB, 5, 5, 4) + BINOP(SYM_LTLT, BOT_LSH, 6, 6, 5) + BINOP(SYM_GTGT, BOT_RSH, 6, 6, 5) + BINOP(SYM_LT, BOT_LT, 7, 7, 6) + BINOP(SYM_GT, BOT_GT, 7, 7, 6) + BINOP(SYM_LTEQ, BOT_LE, 7, 7, 6) + BINOP(SYM_GTEQ, BOT_GE, 7, 7, 6) + BINOP(SYM_EQEQ, BOT_EQ, 8, 8, 7) + BINOP(SYM_EXCLEQ, BOT_NE, 8, 8, 7) + BINOP(SYM_AMP, BOT_AAND, 9, 9, 8) + BINOP(SYM_HAT, BOT_AXOR, 10, 10, 9) + BINOP(SYM_PIPE, BOT_AOR, 11, 11, 10) + BINOP(SYM_AMPAMP, BOT_BAND, 12, 12, 11) + BINOP(SYM_PIPEPIPE, BOT_BOR, 13, 13, 12) + if ((expr_level >= 14) && (tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_QUESTION)) { + if ((has_level != -1) && (has_level <= 13)) { + struct expr_partial_op pop = { + .once_done_want_level = expr_level, + .once_done_is_level = 14, + .typ = EPO_TERNARY_ARG1, + .val.ternop = {.arg23_sep = SYM_COLON, .once_done2_want_level = 14, .op = TOT_COND, .e1 = e} + }; + if (!vector_push(expr_pops, op_stack, pop)) { + log_memory("failed to add partial operation to operation stack\n"); + // Empty destructor + goto failed; + } + expr_level = 16; + *tok = proc_next_token(prep); + goto pushed_expr; + } + } + BINOP(SYM_EQ, BOT_ASSGN_EQ, 15, 2, 15) + BINOP(SYM_STAREQ, BOT_ASSGN_MUL, 15, 2, 15) + BINOP(SYM_SLASHEQ, BOT_ASSGN_DIV, 15, 2, 15) + BINOP(SYM_PERCENTEQ, BOT_ASSGN_MOD, 15, 2, 15) + BINOP(SYM_PLUSEQ, BOT_ASSGN_ADD, 15, 2, 15) + BINOP(SYM_DASHEQ, BOT_ASSGN_SUB, 15, 2, 15) + BINOP(SYM_LTLTEQ, BOT_ASSGN_LSH, 15, 2, 15) + BINOP(SYM_GTGTEQ, BOT_ASSGN_RSH, 15, 2, 15) + BINOP(SYM_AMPEQ, BOT_ASSGN_AAND, 15, 2, 15) + BINOP(SYM_HATEQ, BOT_ASSGN_AXOR, 15, 2, 15) + BINOP(SYM_PIPEEQ, BOT_ASSGN_AOR, 15, 2, 15) + BINOP(SYM_COMMA, BOT_COMMA, 16, 16, 15) + + // expr2 ::= sizeof expr2 + // which includes expr2 ::= sizeof ( expr16 ) + // expr2 ::= sizeof ( type-name ) + if ((has_level == -1) && (expr_level >= 2) && (tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_SIZEOF)) { + *tok = proc_next_token(prep); + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_LPAREN)) { + struct expr_partial_op pop = { + .once_done_want_level = expr_level, + .once_done_is_level = 2, + .typ = EPO_SIZEOF, + .val.c = '\0' + }; + if (!vector_push(expr_pops, op_stack, pop)) { + log_memory("failed to add partial operation to operation stack\n"); + proc_token_del(tok); + goto failed; + } + expr_level = 2; + goto pushed_expr; + } + // Empty destructor + *tok = proc_next_token(prep); + khiter_t it; + if (IS_BEGIN_TYPE_NAME) { + type_t *typ = type_new(); + if (!typ) { + log_memory("failed to create new type info structure\n"); + proc_token_del(tok); + goto failed; + } + if (!parse_type_name(target, struct_map, type_map, enum_map, builtins, const_map, type_set, prep, tok, SYM_RPAREN, &typ)) { + goto failed; + } + if (!typ->is_validated || typ->is_incomplete || (typ->typ == TYPE_FUNCTION)) { + log_error(&tok->loginfo, "cannot get the size of a function or incomplete type\n"); + type_del(typ); + proc_token_del(tok); + goto failed; + } + e = malloc(sizeof *e); + if (!e) { + log_memory("failed to create new expression atom\n"); + type_del(typ); + proc_token_del(tok); + goto failed; + } + e->typ = ETY_CONST; + e->val.cst.typ = NCT_UINT64; + e->val.cst.val.u64 = typ->szinfo.size; + has_level = 2; + type_del(typ); + if (!e->val.cst.val.u64) { + log_internal(&tok->loginfo, "size of type is 0\n"); + proc_token_del(tok); + goto failed; + } + // Empty destructor + *tok = proc_next_token(prep); + goto expr_new_token; + } else { + struct expr_partial_op pop = { + .once_done_want_level = expr_level, + .once_done_is_level = 2, + .typ = EPO_SIZEOF, + .val.c = 0 + }; + if (!vector_push(expr_pops, op_stack, pop)) { + log_memory("failed to add partial operation to operation stack\n"); + proc_token_del(tok); + goto failed; + } + pop = (struct expr_partial_op){ + .once_done_want_level = 2, + .once_done_is_level = 0, + .typ = EPO_LPAREN, + .val.c = 0 + }; + if (!vector_push(expr_pops, op_stack, pop)) { + log_memory("failed to add partial operation to operation stack\n"); + proc_token_del(tok); + goto failed; + } + expr_level = 16; + goto pushed_expr; + } + } + // expr2 ::= _Alignof ( type-name ) + if ((has_level == -1) && (expr_level >= 2) && (tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_ALIGNOF)) { + *tok = proc_next_token(prep); + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_LPAREN)) { + log_error(&tok->loginfo, "unexpected token, expected symbol '('\n"); + proc_token_del(tok); + goto failed; + } + // Empty destructor + *tok = proc_next_token(prep); + type_t *typ = type_new(); + if (!typ) { + log_memory("failed to create new type info structure\n"); + proc_token_del(tok); + goto failed; + } + if (!parse_type_name(target, struct_map, type_map, enum_map, builtins, const_map, type_set, prep, tok, SYM_RPAREN, &typ)) { + goto failed; + } + if (!typ->is_validated || typ->is_incomplete || (typ->typ == TYPE_FUNCTION)) { + log_error(&tok->loginfo, "cannot get the alignment of a function or incomplete type\n"); + type_del(typ); + proc_token_del(tok); + goto failed; + } + e = malloc(sizeof *e); + if (!e) { + log_memory("failed to create new expression atom\n"); + type_del(typ); + proc_token_del(tok); + goto failed; + } + e->typ = ETY_CONST; + e->val.cst.typ = NCT_UINT64; + e->val.cst.val.u64 = typ->szinfo.align; + has_level = 2; + type_del(typ); + if (!e->val.cst.val.u64) { + log_internal(&tok->loginfo, "alignment of type is 0\n"); + proc_token_del(tok); + goto failed; + } + // Empty destructor + *tok = proc_next_token(prep); + goto expr_new_token; + } + + // expr0 ::= ( expr16 ) + // expr1 ::= expr1 ( ) + // expr1 ::= expr1 ( expr15 {, expr15}* ) + // expr1 ::= ( type-name ) { initializer-list ,? } + // expr3 ::= ( type-name ) expr3 + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_LPAREN)) { + if ((has_level != -1) && (expr_level >= 1) && (has_level <= 1)) { + // Empty destructor + *tok = proc_next_token(prep); + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_RPAREN)) { + expr_t *new_e = malloc(sizeof *new_e); + new_e = malloc(sizeof *new_e); + if (!new_e) { + log_memory("failed to create new expression atom\n"); + // Empty destructor + goto failed; + } + new_e->typ = ETY_CALL; + new_e->val.call.fun = e; + new_e->val.call.nargs = 0; + new_e->val.call.args = NULL; + e = new_e; + *tok = proc_next_token(prep); + goto expr_new_token; + } + // We want a function call with at least one argument + VECTOR(exprs) *exprs = vector_new_cap(exprs, 1); + if (!exprs) { + log_memory("failed to add partial operation to operation stack\n"); + proc_token_del(tok); + goto failed; + } + struct expr_partial_op pop = { + .once_done_want_level = expr_level, + .once_done_is_level = 1, + .typ = EPO_FUNCALL, + .val.funcall = {.f = e, .exprs = exprs} + }; + if (!vector_push(expr_pops, op_stack, pop)) { + log_memory("failed to add partial operation to operation stack\n"); + vector_del(exprs, exprs); + proc_token_del(tok); + goto failed; + } + expr_level = 15; + goto pushed_expr; + } + if (has_level == -1) { + *tok = proc_next_token(prep); + khiter_t it; + if ((expr_level >= 1) && IS_BEGIN_TYPE_NAME) { + type_t *typ = type_new(); + if (!typ) { + log_memory("failed to create new type info structure\n"); + proc_token_del(tok); + goto failed; + } + if (!parse_type_name(target, struct_map, type_map, enum_map, builtins, const_map, type_set, prep, tok, SYM_RPAREN, &typ)) { + type_del(typ); + proc_token_del(tok); + goto failed; + } + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_LBRACKET)) { + log_TODO(&tok->loginfo, "initializer-list\n"); + type_del(typ); + proc_token_del(tok); + goto failed; + } else if (expr_level < 3) { + log_error(&tok->loginfo, "cast expression (level 3) but the required expression level is 1 or 2 (expected symbol '{')\n"); + type_del(typ); + proc_token_del(tok); + goto failed; + } else { + struct expr_partial_op pop = { + .once_done_want_level = expr_level, + .once_done_is_level = 3, + .typ = EPO_CAST, + .val.typ = typ + }; + if (!vector_push(expr_pops, op_stack, pop)) { + log_memory("failed to add partial operation to operation stack\n"); + /* Empty destructor */ + goto failed; + } + expr_level = 3; + *tok = proc_next_token(prep); + goto pushed_expr; + } + } else { + struct expr_partial_op pop = { + .once_done_want_level = expr_level, + .once_done_is_level = 0, + .typ = EPO_LPAREN, + .val.c = 0 + }; + if (!vector_push(expr_pops, op_stack, pop)) { + log_memory("failed to add partial operation to operation stack\n"); + proc_token_del(tok); + goto failed; + } + expr_level = 16; + goto pushed_expr; + } + } + } + + if (vector_size(expr_pops, op_stack)) { + if (has_level != -1) { + struct expr_partial_op *pop = &vector_last(expr_pops, op_stack); + expr_t *new_e; + switch (pop->typ) { + case EPO_LPAREN: + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_RPAREN)) { + has_level = pop->once_done_is_level; + expr_level = pop->once_done_want_level; + vector_pop_nodel(expr_pops, op_stack); + // Empty destructor + *tok = proc_next_token(prep); + goto expr_new_token; + } + break; + case EPO_SIZEOF: + log_TODO(&tok->loginfo, "find type of expression\n"); + proc_token_del(tok); + goto failed; + case EPO_CAST: + new_e = malloc(sizeof *new_e); + if (!new_e) { + log_memory("failed to create new expression atom\n"); + proc_token_del(tok); + goto failed; + } + has_level = pop->once_done_is_level; + expr_level = pop->once_done_want_level; + new_e->typ = ETY_CAST; + new_e->val.cast.typ = pop->val.typ; + new_e->val.cast.e = e; + e = new_e; + vector_pop_nodel(expr_pops, op_stack); + // Keep the same token + goto expr_new_token; + case EPO_FUNCALL: + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_RPAREN)) { + has_level = pop->once_done_is_level; + expr_level = pop->once_done_want_level; + if (!vector_push(exprs, pop->val.funcall.exprs, e)) { + log_memory("failed to add argument to argument stack\n"); + // Empty destructor + goto failed; + } + e = malloc(sizeof *e); + if (!e) { + log_memory("failed to create new expression atom\n"); + // Empty destructor + goto failed; + } + e->typ = ETY_CALL; + e->val.call.fun = pop->val.funcall.f; + e->val.call.nargs = vector_size(exprs, pop->val.funcall.exprs); + e->val.call.args = vector_steal(exprs, pop->val.funcall.exprs); + vector_pop_nodel(expr_pops, op_stack); + // Empty destructor + *tok = proc_next_token(prep); + goto expr_new_token; + } else if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_COMMA)) { + if (!vector_push(exprs, pop->val.funcall.exprs, e)) { + log_memory("failed to add argument to argument stack\n"); + // Empty destructor + goto failed; + } + // expr_level is already 15 + // Empty destructor + *tok = proc_next_token(prep); + goto pushed_expr; + } + break; + case EPO_UNARY: + new_e = malloc(sizeof *new_e); + if (!new_e) { + log_memory("failed to create new expression atom\n"); + proc_token_del(tok); + goto failed; + } + has_level = pop->once_done_is_level; + expr_level = pop->once_done_want_level; + new_e->typ = ETY_UNARY; + new_e->val.unary.typ = pop->val.unop; + new_e->val.unary.e = e; + e = new_e; + vector_pop_nodel(expr_pops, op_stack); + // Keep the same token + goto expr_new_token; + case EPO_BINARY_ARG_SYM: + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != pop->val.binop.last_sym)) break; + // Empty destructor + *tok = proc_next_token(prep); + /* FALLTHROUGH */ + case EPO_BINARY_ARG: + new_e = malloc(sizeof *new_e); + if (!new_e) { + log_memory("failed to create new expression atom\n"); + proc_token_del(tok); + goto failed; + } + has_level = pop->once_done_is_level; + expr_level = pop->once_done_want_level; + new_e->typ = ETY_BINARY; + new_e->val.binary.typ = pop->val.binop.op; + new_e->val.binary.e1 = pop->val.binop.e1; + new_e->val.binary.e2 = e; + e = new_e; + vector_pop_nodel(expr_pops, op_stack); + // Keep the same token + goto expr_new_token; + case EPO_TERNARY_ARG1: + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == pop->val.ternop.arg23_sep)) { + pop->typ = EPO_TERNARY_ARG2; + pop->val.ternop.e2 = e; + expr_level = pop->val.ternop.once_done2_want_level; + // Empty destructor + *tok = proc_next_token(prep); + goto pushed_expr; + } + break; + case EPO_TERNARY_ARG2: + new_e = malloc(sizeof *new_e); + if (!new_e) { + log_memory("failed to create new expression atom\n"); + proc_token_del(tok); + goto failed; + } + has_level = pop->once_done_is_level; + expr_level = pop->once_done_want_level; + new_e->typ = ETY_TERNARY; + new_e->val.ternary.typ = pop->val.ternop.op; + new_e->val.ternary.e1 = pop->val.ternop.e1; + new_e->val.ternary.e2 = pop->val.ternop.e2; + new_e->val.ternary.e3 = e; + e = new_e; + vector_pop_nodel(expr_pops, op_stack); + // Keep the same token + goto expr_new_token; + } + } + } + + if ((vector_size(expr_pops, op_stack) == 0) && (has_level != -1)) { + vector_del(expr_pops, op_stack); + return e; + } + log_error(&tok->loginfo, "invalid expression: unexpected token\n"); + proc_token_del(tok); +failed: + vector_del(expr_pops, op_stack); + if (e) expr_del(e); + return NULL; +} +static int eval_expression(loginfo_t *li, machine_t *target, expr_t *e, khash_t(const_map) *const_map, num_constant_t *dest, int fatal) { + // Evaluate the expression (we suppose it is constant) + switch (e->typ) { + case ETY_VAR: { + khiter_t it = kh_get(const_map, const_map, string_content(e->val.var)); + if (it != kh_end(const_map)) { + *dest = kh_val(const_map, it); + return 1; + } + if (fatal) log_error(li, "failed to evaluate expression: expression is not constant (variable)\n"); + return 0; } + + case ETY_CONST: + *dest = e->val.cst; + return 1; + + // case ETY_GENERIC: + + case ETY_CALL: + if (fatal) log_error(li, "failed to evaluate expression: expression is not constant (function call)\n"); + return 0; + + case ETY_ACCESS: + case ETY_PTRACCESS: + if (fatal) log_error(li, "failed to evaluate expression: expression is not constant (member access)\n"); + return 0; + + case ETY_UNARY: + if (!eval_expression(li, target, e->val.unary.e, const_map, dest, fatal)) return 0; + + switch (e->val.unary.typ) { + case UOT_POSTINCR: + case UOT_POSTDECR: + case UOT_PREINCR: + case UOT_PREDECR: + case UOT_REF: + case UOT_DEREF: + if (fatal) log_error(li, "failed to evaluate expression: expression is not constant (assignment or memory accesses)\n"); + return 0; + case UOT_POS: + return 1; // Nothing to do + case UOT_NEG: + switch (dest->typ) { + case NCT_FLOAT: dest->val.f = -dest->val.f; return 1; + case NCT_DOUBLE: dest->val.d = -dest->val.d; return 1; + case NCT_LDOUBLE: dest->val.l = -dest->val.l; return 1; + case NCT_INT32: dest->val.i32 = -dest->val.i32; return 1; + case NCT_UINT32: dest->val.u32 = -dest->val.u32; return 1; + case NCT_INT64: dest->val.i64 = -dest->val.i64; return 1; + case NCT_UINT64: dest->val.u64 = -dest->val.u64; return 1; + default: return 0; + } + case UOT_ANOT: + switch (dest->typ) { + case NCT_FLOAT: + case NCT_DOUBLE: + case NCT_LDOUBLE: + if (fatal) log_error(li, "failed to evaluate expression: cannot bitwise-negate a floating point number\n"); + return 0; + case NCT_INT32: dest->val.i32 = ~dest->val.i32; return 1; + case NCT_UINT32: dest->val.u32 = ~dest->val.u32; return 1; + case NCT_INT64: dest->val.i64 = ~dest->val.i64; return 1; + case NCT_UINT64: dest->val.u64 = ~dest->val.u64; return 1; + default: return 0; + } + case UOT_BNOT: + switch (dest->typ) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" + case NCT_FLOAT: dest->typ = NCT_INT32; dest->val.i32 = !dest->val.f; return 1; + case NCT_DOUBLE: dest->typ = NCT_INT32; dest->val.i32 = !dest->val.d; return 1; + case NCT_LDOUBLE: dest->typ = NCT_INT32; dest->val.i32 = !dest->val.l; return 1; +#pragma GCC diagnostic pop + case NCT_INT32: dest->typ = NCT_INT32; dest->val.i32 = !dest->val.i32; return 1; + case NCT_UINT32: dest->typ = NCT_INT32; dest->val.i32 = !dest->val.u32; return 1; + case NCT_INT64: dest->typ = NCT_INT32; dest->val.i32 = !dest->val.i64; return 1; + case NCT_UINT64: dest->typ = NCT_INT32; dest->val.i32 = !dest->val.u64; return 1; + default: return 0; + } + default: return 0; + } + + case ETY_BINARY: { + num_constant_t dest1, dest2; + if (!eval_expression(li, target, e->val.binary.e1, const_map, &dest1, fatal)) return 0; + if (!eval_expression(li, target, e->val.binary.e2, const_map, &dest2, fatal)) return 0; + + switch (e->val.binary.typ) { + case BOT_ASSGN_EQ: + case BOT_ASSGN_ADD: + case BOT_ASSGN_SUB: + case BOT_ASSGN_MUL: + case BOT_ASSGN_DIV: + case BOT_ASSGN_MOD: + case BOT_ASSGN_LSH: + case BOT_ASSGN_RSH: + case BOT_ASSGN_AAND: + case BOT_ASSGN_AXOR: + case BOT_ASSGN_AOR: + case BOT_ARRAY: // Is this possible? + if (fatal) log_error(li, "failed to evaluate expression: expression is not constant (assignments)\n"); + return 0; +#define DOIT(op) \ + promote_csts(&dest1, &dest2); \ + switch ((dest->typ = dest1.typ)) { \ + case NCT_FLOAT: dest->val.f = dest1.val.f op dest2.val.f ; return 1; \ + case NCT_DOUBLE: dest->val.d = dest1.val.d op dest2.val.d ; return 1; \ + case NCT_LDOUBLE: dest->val.l = dest1.val.l op dest2.val.l ; return 1; \ + case NCT_INT32: dest->val.i32 = dest1.val.i32 op dest2.val.i32; return 1; \ + case NCT_UINT32: dest->val.u32 = dest1.val.u32 op dest2.val.u32; return 1; \ + case NCT_INT64: dest->val.i64 = dest1.val.i64 op dest2.val.i64; return 1; \ + case NCT_UINT64: dest->val.u64 = dest1.val.u64 op dest2.val.u64; return 1; \ + default: return 0; \ + } +#define DOIT_INT(op) \ + promote_csts(&dest1, &dest2); \ + switch ((dest->typ = dest1.typ)) { \ + case NCT_FLOAT: \ + case NCT_DOUBLE: \ + case NCT_LDOUBLE: \ + if (fatal) log_error(li, "failed to evaluate expression: binary operation %u incompatible with floating point numbers\n", e->val.binary.typ); \ + return 0; \ + case NCT_INT32: dest->val.i32 = dest1.val.i32 op dest2.val.i32; return 1; \ + case NCT_UINT32: dest->val.u32 = dest1.val.u32 op dest2.val.u32; return 1; \ + case NCT_INT64: dest->val.i64 = dest1.val.i64 op dest2.val.i64; return 1; \ + case NCT_UINT64: dest->val.u64 = dest1.val.u64 op dest2.val.u64; return 1; \ + default: return 0; \ + } +#define DOIT_BOOL(op) \ + promote_csts(&dest1, &dest2); \ + switch (dest1.typ) { \ + case NCT_FLOAT: dest->typ = NCT_UINT32; dest->val.u32 = dest1.val.f op dest2.val.f ; return 1; \ + case NCT_DOUBLE: dest->typ = NCT_UINT32; dest->val.u32 = dest1.val.d op dest2.val.d ; return 1; \ + case NCT_LDOUBLE: dest->typ = NCT_UINT32; dest->val.u32 = dest1.val.l op dest2.val.l ; return 1; \ + case NCT_INT32: dest->typ = NCT_UINT32; dest->val.u32 = dest1.val.i32 op dest2.val.i32; return 1; \ + case NCT_UINT32: dest->typ = NCT_UINT32; dest->val.u32 = dest1.val.u32 op dest2.val.u32; return 1; \ + case NCT_INT64: dest->typ = NCT_UINT32; dest->val.u32 = dest1.val.i64 op dest2.val.i64; return 1; \ + case NCT_UINT64: dest->typ = NCT_UINT32; dest->val.u32 = dest1.val.u64 op dest2.val.u64; return 1; \ + default: return 0; \ + } + case BOT_ADD: DOIT(+) + case BOT_SUB: DOIT(-) + case BOT_MUL: DOIT(*) + case BOT_DIV: DOIT(/) + case BOT_MOD: DOIT_INT(%) + case BOT_LSH: DOIT_INT(<<) + case BOT_RSH: DOIT_INT(>>) + case BOT_LT: DOIT_BOOL(<) + case BOT_GT: DOIT_BOOL(>) + case BOT_LE: DOIT_BOOL(<=) + case BOT_GE: DOIT_BOOL(>=) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" + case BOT_EQ: DOIT_BOOL(==) + case BOT_NE: DOIT_BOOL(!=) +#pragma GCC diagnostic pop + case BOT_AAND: DOIT_INT(&) + case BOT_AXOR: DOIT_INT(^) + case BOT_AOR: DOIT_INT(|) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" + case BOT_BAND: DOIT_BOOL(&&) + case BOT_BOR: DOIT_BOOL(||) +#pragma GCC diagnostic pop + case BOT_COMMA: *dest = dest2; return 1; +#undef DOIT_BOOL +#undef DOIT_INT +#undef DOIT + default: return 0; + } } + + case ETY_TERNARY: { + num_constant_t dest1, dest2, dest3; + if (!eval_expression(li, target, e->val.ternary.e1, const_map, &dest1, fatal)) return 0; + if (!eval_expression(li, target, e->val.ternary.e2, const_map, &dest2, fatal)) return 0; + if (!eval_expression(li, target, e->val.ternary.e3, const_map, &dest3, fatal)) return 0; + + switch (e->val.ternary.typ) { + case TOT_COND: + promote_csts(&dest2, &dest3); + switch (dest1.typ) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" + case NCT_FLOAT: *dest = dest1.val.f ? dest2 : dest3; return 1; + case NCT_DOUBLE: *dest = dest1.val.d ? dest2 : dest3; return 1; + case NCT_LDOUBLE: *dest = dest1.val.l ? dest2 : dest3; return 1; +#pragma GCC diagnostic pop + case NCT_INT32: *dest = dest1.val.i32 ? dest2 : dest3; return 1; + case NCT_UINT32: *dest = dest1.val.u32 ? dest2 : dest3; return 1; + case NCT_INT64: *dest = dest1.val.i64 ? dest2 : dest3; return 1; + case NCT_UINT64: *dest = dest1.val.u64 ? dest2 : dest3; return 1; + default: return 0; + } + default: return 0; + } } + + // case ETY_INIT_LIST: + + case ETY_CAST: + if (!eval_expression(li, target, e->val.cast.e, const_map, dest, fatal)) return 0; + + if ((e->val.cast.typ->typ == TYPE_BUILTIN) || (e->val.cast.typ->typ == TYPE_ENUM)) { + type_t *cast = e->val.cast.typ; + if (cast->typ == TYPE_ENUM) { + cast = cast->val.typ; + if (cast->typ != TYPE_BUILTIN) { + log_internal(li, "invalid cast to enum with non-builtin base type\n"); + return 0; + } + } + switch (cast->val.builtin) { + case BTT_VOID: + if (fatal) log_error(li, "invalid cast to void\n"); + return 0; + case BTT_BOOL: + switch (dest->typ) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" + case NCT_FLOAT: dest->val.u32 = (_Bool)dest->val.f; break; + case NCT_DOUBLE: dest->val.u32 = (_Bool)dest->val.d; break; + case NCT_LDOUBLE: dest->val.u32 = (_Bool)dest->val.l; break; +#pragma GCC diagnostic pop + case NCT_INT32: dest->val.u32 = (_Bool)dest->val.i32; break; + case NCT_UINT32: dest->val.u32 = (_Bool)dest->val.u32; break; + case NCT_INT64: dest->val.u32 = (_Bool)dest->val.i64; break; + case NCT_UINT64: dest->val.u32 = (_Bool)dest->val.u64; break; + } + dest->typ = NCT_UINT32; + return 1; + case BTT_SCHAR: + case BTT_S8: + cast_s8: + switch (dest->typ) { + case NCT_FLOAT: dest->val.i32 = (int8_t)dest->val.f; break; + case NCT_DOUBLE: dest->val.i32 = (int8_t)dest->val.d; break; + case NCT_LDOUBLE: dest->val.i32 = (int8_t)dest->val.l; break; + case NCT_INT32: dest->val.i32 = (int8_t)dest->val.i32; break; + case NCT_UINT32: dest->val.i32 = (int8_t)dest->val.u32; break; + case NCT_INT64: dest->val.i32 = (int8_t)dest->val.i64; break; + case NCT_UINT64: dest->val.i32 = (int8_t)dest->val.u64; break; + } + dest->typ = NCT_INT32; + return 1; + case BTT_UCHAR: + case BTT_U8: + cast_u8: + switch (dest->typ) { + case NCT_FLOAT: dest->val.u32 = (uint8_t)dest->val.f; break; + case NCT_DOUBLE: dest->val.u32 = (uint8_t)dest->val.d; break; + case NCT_LDOUBLE: dest->val.u32 = (uint8_t)dest->val.l; break; + case NCT_INT32: dest->val.u32 = (uint8_t)dest->val.i32; break; + case NCT_UINT32: dest->val.u32 = (uint8_t)dest->val.u32; break; + case NCT_INT64: dest->val.u32 = (uint8_t)dest->val.i64; break; + case NCT_UINT64: dest->val.u32 = (uint8_t)dest->val.u64; break; + } + dest->typ = NCT_UINT32; + return 1; + case BTT_SHORT: + case BTT_SSHORT: + case BTT_S16: + switch (dest->typ) { + case NCT_FLOAT: dest->val.i32 = (int16_t)dest->val.f; break; + case NCT_DOUBLE: dest->val.i32 = (int16_t)dest->val.d; break; + case NCT_LDOUBLE: dest->val.i32 = (int16_t)dest->val.l; break; + case NCT_INT32: dest->val.i32 = (int16_t)dest->val.i32; break; + case NCT_UINT32: dest->val.i32 = (int16_t)dest->val.u32; break; + case NCT_INT64: dest->val.i32 = (int16_t)dest->val.i64; break; + case NCT_UINT64: dest->val.i32 = (int16_t)dest->val.u64; break; + } + dest->typ = NCT_INT32; + return 1; + case BTT_USHORT: + case BTT_U16: + switch (dest->typ) { + case NCT_FLOAT: dest->val.u32 = (uint16_t)dest->val.f; break; + case NCT_DOUBLE: dest->val.u32 = (uint16_t)dest->val.d; break; + case NCT_LDOUBLE: dest->val.u32 = (uint16_t)dest->val.l; break; + case NCT_INT32: dest->val.u32 = (uint16_t)dest->val.i32; break; + case NCT_UINT32: dest->val.u32 = (uint16_t)dest->val.u32; break; + case NCT_INT64: dest->val.u32 = (uint16_t)dest->val.i64; break; + case NCT_UINT64: dest->val.u32 = (uint16_t)dest->val.u64; break; + } + dest->typ = NCT_UINT32; + return 1; + case BTT_INT: + case BTT_SINT: + case BTT_S32: + cast_s32: + switch (dest->typ) { + case NCT_FLOAT: dest->val.i32 = (int32_t)dest->val.f; break; + case NCT_DOUBLE: dest->val.i32 = (int32_t)dest->val.d; break; + case NCT_LDOUBLE: dest->val.i32 = (int32_t)dest->val.l; break; + case NCT_INT32: break; + case NCT_UINT32: dest->val.i32 = (int32_t)dest->val.u32; break; + case NCT_INT64: dest->val.i32 = (int32_t)dest->val.i64; break; + case NCT_UINT64: dest->val.i32 = (int32_t)dest->val.u64; break; + } + dest->typ = NCT_INT32; + return 1; + case BTT_UINT: + case BTT_U32: + cast_u32: + switch (dest->typ) { + case NCT_FLOAT: dest->val.u32 = (uint32_t)dest->val.f; break; + case NCT_DOUBLE: dest->val.u32 = (uint32_t)dest->val.d; break; + case NCT_LDOUBLE: dest->val.u32 = (uint32_t)dest->val.l; break; + case NCT_INT32: dest->val.u32 = (uint32_t)dest->val.i32; break; + case NCT_UINT32: break; + case NCT_INT64: dest->val.u32 = (uint32_t)dest->val.i64; break; + case NCT_UINT64: dest->val.u32 = (uint32_t)dest->val.u64; break; + } + dest->typ = NCT_UINT32; + return 1; + case BTT_LONGLONG: + case BTT_SLONGLONG: + case BTT_S64: + cast_s64: + switch (dest->typ) { + case NCT_FLOAT: dest->val.i64 = (int64_t)dest->val.f; break; + case NCT_DOUBLE: dest->val.i64 = (int64_t)dest->val.d; break; + case NCT_LDOUBLE: dest->val.i64 = (int64_t)dest->val.l; break; + case NCT_INT32: dest->val.i64 = (int64_t)dest->val.i32; break; + case NCT_UINT32: dest->val.i64 = (int64_t)dest->val.u32; break; + case NCT_INT64: break; + case NCT_UINT64: dest->val.i64 = (int64_t)dest->val.u64; break; + } + dest->typ = NCT_INT64; + return 1; + case BTT_ULONGLONG: + case BTT_U64: + cast_u64: + switch (dest->typ) { + case NCT_FLOAT: dest->val.u64 = (uint64_t)dest->val.f; break; + case NCT_DOUBLE: dest->val.u64 = (uint64_t)dest->val.d; break; + case NCT_LDOUBLE: dest->val.u64 = (uint64_t)dest->val.l; break; + case NCT_INT32: dest->val.u64 = (uint64_t)dest->val.i32; break; + case NCT_UINT32: dest->val.u64 = (uint64_t)dest->val.u32; break; + case NCT_INT64: dest->val.u64 = (uint64_t)dest->val.i64; break; + case NCT_UINT64: break; + } + dest->typ = NCT_UINT64; + return 1; + case BTT_CHAR: + if (target->unsigned_char) goto cast_u8; + else goto cast_s8; + case BTT_LONG: + case BTT_SLONG: + if (target->size_long == 4) { + goto cast_s32; + } else if (target->size_long == 8) { + goto cast_s64; + } else { + log_internal(li, "unsupported cast to long with target sizeof(long) == %zu\n", target->size_long); + return 0; + } + case BTT_ULONG: + if (target->size_long == 4) { + goto cast_u32; + } else if (target->size_long == 8) { + goto cast_u64; + } else { + log_internal(li, "unsupported cast to unsigned long with target sizeof(long) == %zu\n", target->size_long); + return 0; + } + case BTT_INT128: + case BTT_SINT128: + case BTT_UINT128: + case BTT_FLOAT: + case BTT_CFLOAT: + case BTT_IFLOAT: + case BTT_DOUBLE: + case BTT_CDOUBLE: + case BTT_IDOUBLE: + case BTT_LONGDOUBLE: + case BTT_CLONGDOUBLE: + case BTT_ILONGDOUBLE: + case BTT_FLOAT128: + case BTT_CFLOAT128: + case BTT_IFLOAT128: + case BTT_VA_LIST: + default: + if (fatal) log_TODO(li, "unsupported cast to builtin %s in constant expression\n", builtin2str[cast->val.builtin]); + return 0; + } + } else { + if (fatal) log_TODO(li, "unsupported cast in constant expression\n"); + return 0; + } + + default: return 0; + } +} + +extern int is_gst; // If 1, mark structures _G*Class as simple + +// declaration-specifier with storage != NULL +// specifier-qualifier-list + static_assert-declaration with storage == NULL +static int parse_declaration_specifier(machine_t *target, khash_t(struct_map) *struct_map, khash_t(type_map) *type_map, khash_t(type_map) *enum_map, + type_t *(*builtins)[LAST_BUILTIN + 1], khash_t(const_map) *const_map, + khash_t(type_set) *type_set, preproc_t *prep, proc_token_t *tok, enum decl_storage *storage, + enum fun_spec *fspec, enum decl_spec *spec, type_t *typ) { + if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_STATIC_ASSERT)) { + // _Static_assert ( constant-expression , string-literal ) ; + // Empty destructor + *tok = proc_next_token(prep); + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_LPAREN)) { + log_error(&tok->loginfo, "unexpected token in static assertion declaration\n"); + proc_token_del(tok); + goto failed; + } + // Empty destructor + *tok = proc_next_token(prep); + expr_t *e = parse_expression(target, struct_map, type_map, enum_map, builtins, const_map, type_set, prep, tok, 14); + if (!e) { + goto failed; + } + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_COMMA)) { + log_error(&tok->loginfo, "unexpected token in static assertion expression\n"); + expr_del(e); + proc_token_del(tok); + goto failed; + } + num_constant_t eval; + if (!eval_expression(&tok->loginfo, target, e, const_map, &eval, 1)) { + expr_del(e); + // Empty destructor + goto failed; + } + expr_del(e); + *tok = proc_next_token(prep); + if ((tok->tokt != PTOK_STRING) || !tok->tokv.sisstr) { + log_error(&tok->loginfo, "unexpected token in static assertion message\n"); + proc_token_del(tok); + goto failed; + } + string_t *errmsg = tok->tokv.str; + *tok = proc_next_token(prep); + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_RPAREN)) { + log_error(&tok->loginfo, "unexpected token in static assertion message\n"); + proc_token_del(tok); + goto failed; + } + *tok = proc_next_token(prep); + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_SEMICOLON)) { + log_error(&tok->loginfo, "unexpected token after static assertion\n"); + proc_token_del(tok); + goto failed; + } + + int iserror; + switch (eval.typ) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" + case NCT_FLOAT: iserror = !eval.val.f; break; + case NCT_DOUBLE: iserror = !eval.val.d; break; + case NCT_LDOUBLE: iserror = !eval.val.l; break; +#pragma GCC diagnostic pop + case NCT_INT32: iserror = !eval.val.i32; break; + case NCT_UINT32: iserror = !eval.val.u32; break; + case NCT_INT64: iserror = !eval.val.i64; break; + case NCT_UINT64: iserror = !eval.val.u64; break; + default: iserror = 1; + } + if (iserror) { + log_error(&tok->loginfo, "static assertion failed: %s\n", string_content(errmsg)); + string_del(errmsg); + // Empty destructor + goto failed; + } + string_del(errmsg); + // Empty destructor + return 1; + } + +parse_cur_token_decl: + if (tok->tokt == PTOK_EOF) { + log_error(&tok->loginfo, "unexpected end of file in declaration\n"); + goto failed; + } + // Storage + if (storage && (tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_AUTO)) { + if (*storage == TMPSTO_NONE) *storage = TMPSTO_AUTO; + else { + log_error(&tok->loginfo, "unexpected storage class specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if (storage && (tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_EXTERN)) { + if (*storage == TMPSTO_NONE) *storage = TMPSTO_EXTERN; + else if (*storage == TMPSTO_TLS) *storage = TMPSTO_TLS_EXTERN; + else { + log_error(&tok->loginfo, "unexpected storage class specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if (storage && (tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_REGISTER)) { + if (*storage == TMPSTO_NONE) *storage = TMPSTO_REG; + else { + log_error(&tok->loginfo, "unexpected storage class specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if (storage && (tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_STATIC)) { + if (*storage == TMPSTO_NONE) *storage = TMPSTO_STATIC; + else if (*storage == TMPSTO_TLS) *storage = TMPSTO_TLS_STATIC; + else { + log_error(&tok->loginfo, "unexpected storage class specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if (storage && (tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_THREAD_LOCAL)) { + if (*storage == TMPSTO_NONE) *storage = TMPSTO_TLS; + else if (*storage == TMPSTO_EXTERN) *storage = TMPSTO_TLS_EXTERN; + else if (*storage == TMPSTO_STATIC) *storage = TMPSTO_TLS_STATIC; + else { + log_error(&tok->loginfo, "unexpected storage class specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if (storage && (tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_TYPEDEF)) { + if (*storage == TMPSTO_NONE) *storage = TMPSTO_TYPEDEF; + else { + log_error(&tok->loginfo, "unexpected storage class specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } + + // Function specifier + if (fspec && (tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_INLINE)) { + *fspec |= FSPEC_INLINE; + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if (fspec && (tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_NORETURN)) { + *fspec |= FSPEC_NORETURN; + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } + + // Qualifier + if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_ATOMIC)) { + // Empty destructor + *tok = proc_next_token(prep); + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_LPAREN)) { + if (*spec != SPEC_NONE) { + log_error(&tok->loginfo, "unexpected symbol '('\n"); + // Empty destructor + goto failed; + } + *spec = SPEC_TYPE; + if (!parse_type_name(target, struct_map, type_map, enum_map, builtins, const_map, type_set, prep, tok, SYM_RPAREN, &typ)) { + goto failed; + } + if (!typ->is_validated) { + log_internal(&tok->loginfo, "_Atomic() type is not validated\n"); + type_del(typ); + // Empty destructor + goto failed; + } + if ((typ->typ == TYPE_ARRAY) || (typ->typ == TYPE_FUNCTION) || typ->is_atomic || typ->is_const || typ->is_restrict || typ->is_volatile) { + log_error(&tok->loginfo, "the type name in an _Atomic() may not be an array, a function, atomic, or qualified\n"); + type_del(typ); + // Empty destructor + goto failed; + } + // Empty destructor + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else { + typ->is_atomic = 1; + goto parse_cur_token_decl; + } + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_CONST)) { + typ->is_const = 1; + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_RESTRICT)) { + typ->is_restrict = 1; + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_VOLATILE)) { + typ->is_volatile = 1; + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } + + // Specifier +#define SPEC(bt,post) \ + if (*spec == SPEC_NONE) { \ + *spec = SPEC_BUILTIN; \ + typ->typ = TYPE_BUILTIN; \ + typ->val.builtin = BTT_ ## bt; \ + post \ + } else { \ + log_error(&tok->loginfo, "unexpected type specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); \ + goto failed; \ + } \ + *tok = proc_next_token(prep); \ + goto parse_cur_token_decl; +#define SPEC_SIGNED(bt, allow_int) \ + if ((*spec == SPEC_NONE) || (allow_int && (*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_INT))) { \ + *spec = (allow_int && (*spec == SPEC_NONE)) ? SPEC_BUILTIN_NOINT : SPEC_BUILTIN; \ + typ->typ = TYPE_BUILTIN; \ + typ->val.builtin = BTT_ ## bt; \ + } else if (((*spec == SPEC_BUILTIN_NOINT) || (allow_int && (*spec == SPEC_BUILTIN))) && (typ->val.builtin == BTT_SINT)) { \ + *spec = allow_int ? *spec : SPEC_BUILTIN; \ + typ->val.builtin = BTT_S ## bt; \ + } else if (((*spec == SPEC_BUILTIN_NOINT) || (allow_int && (*spec == SPEC_BUILTIN))) && (typ->val.builtin == BTT_UINT)) { \ + *spec = allow_int ? *spec : SPEC_BUILTIN; \ + typ->val.builtin = BTT_U ## bt; \ + } else { \ + log_error(&tok->loginfo, "unexpected type specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); \ + goto failed; \ + } \ + *tok = proc_next_token(prep); \ + goto parse_cur_token_decl; + if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_BOOL)) { + SPEC(BOOL,) + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_COMPLEX)) { + if (*spec == SPEC_NONE) { + *spec = SPEC_COMPLEX; + } else if ((*spec == SPEC_BUILTIN_NOINT) && (typ->val.builtin == BTT_LONG)) { + *spec = SPEC_LONGCOMPLEX; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_FLOAT)) { + typ->val.builtin = BTT_CFLOAT; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_FLOAT128)) { + typ->val.builtin = BTT_CFLOAT128; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_DOUBLE)) { + typ->val.builtin = BTT_CDOUBLE; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_LONGDOUBLE)) { + typ->val.builtin = BTT_CLONGDOUBLE; + } else { + log_error(&tok->loginfo, "unexpected type specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_IMAGINARY)) { + if (*spec == SPEC_NONE) { + *spec = SPEC_IMAGINARY; + } else if ((*spec == SPEC_BUILTIN_NOINT) && (typ->val.builtin == BTT_LONG)) { + *spec = SPEC_LONGIMAGINARY; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_FLOAT)) { + typ->val.builtin = BTT_IFLOAT; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_FLOAT128)) { + typ->val.builtin = BTT_IFLOAT128; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_DOUBLE)) { + typ->val.builtin = BTT_IDOUBLE; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_LONGDOUBLE)) { + typ->val.builtin = BTT_ILONGDOUBLE; + } else { + log_error(&tok->loginfo, "unexpected type specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_DOUBLE)) { + if (*spec == SPEC_NONE) { + *spec = SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_DOUBLE; + } else if (*spec == SPEC_COMPLEX) { + *spec = SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_CDOUBLE; + } else if (*spec == SPEC_IMAGINARY) { + *spec = SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_IDOUBLE; + } else if (*spec == SPEC_LONGCOMPLEX) { + *spec = SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_CLONGDOUBLE; + } else if (*spec == SPEC_LONGIMAGINARY) { + *spec = SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_ILONGDOUBLE; + } else if ((*spec == SPEC_BUILTIN_NOINT) && (typ->val.builtin == BTT_LONG)) { + *spec = SPEC_BUILTIN; + typ->val.builtin = BTT_LONGDOUBLE; + } else { + log_error(&tok->loginfo, "unexpected type specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_FLOAT)) { + if (*spec == SPEC_NONE) { + *spec = SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_FLOAT; + } else if (*spec == SPEC_COMPLEX) { + *spec = SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_CFLOAT; + } else if (*spec == SPEC_IMAGINARY) { + *spec = SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_IFLOAT; + } else { + log_error(&tok->loginfo, "unexpected type specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_FLOAT128)) { + if (*spec == SPEC_NONE) { + *spec = SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_FLOAT128; + } else if (*spec == SPEC_COMPLEX) { + *spec = SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_CFLOAT128; + } else if (*spec == SPEC_IMAGINARY) { + *spec = SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_IFLOAT128; + } else { + log_error(&tok->loginfo, "unexpected type specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_CHAR)) { + SPEC_SIGNED(CHAR, 0) + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_INT)) { + if (*spec == SPEC_NONE) { + *spec = SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_INT; + } else if (*spec == SPEC_BUILTIN_NOINT) { + *spec = SPEC_BUILTIN; + } else { + log_error(&tok->loginfo, "unexpected type specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_INT128)) { + SPEC_SIGNED(INT128, 0) + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_LONG)) { + if ((*spec == SPEC_NONE) || ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_INT))) { + *spec = (*spec == SPEC_NONE) ? SPEC_BUILTIN_NOINT : SPEC_BUILTIN; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_LONG; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_SINT)) { + typ->val.builtin = BTT_SLONG; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_UINT)) { + typ->val.builtin = BTT_ULONG; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_LONG)) { + typ->val.builtin = BTT_LONGLONG; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_ULONG)) { + typ->val.builtin = BTT_ULONGLONG; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_SLONG)) { + typ->val.builtin = BTT_SLONGLONG; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_DOUBLE)) { + typ->val.builtin = BTT_LONGDOUBLE; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_CDOUBLE)) { + typ->val.builtin = BTT_CLONGDOUBLE; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_IDOUBLE)) { + typ->val.builtin = BTT_ILONGDOUBLE; + } else if (*spec == SPEC_COMPLEX) { + *spec = SPEC_LONGCOMPLEX; + } else if (*spec == SPEC_IMAGINARY) { + *spec = SPEC_LONGIMAGINARY; + } else { + log_error(&tok->loginfo, "unexpected type specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_SHORT)) { + SPEC_SIGNED(SHORT, 1) + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_SIGNED)) { + if (*spec == SPEC_NONE) { + *spec = SPEC_BUILTIN_NOINT; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_SINT; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_CHAR)) { + typ->val.builtin = BTT_SCHAR; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_INT)) { + typ->val.builtin = BTT_SINT; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_LONG)) { + typ->val.builtin = BTT_SLONG; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_LONGLONG)) { + typ->val.builtin = BTT_SLONGLONG; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_SHORT)) { + typ->val.builtin = BTT_SSHORT; + } else { + log_error(&tok->loginfo, "unexpected type specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_UNSIGNED)) { + if (*spec == SPEC_NONE) { + *spec = SPEC_BUILTIN_NOINT; + typ->typ = TYPE_BUILTIN; + typ->val.builtin = BTT_UINT; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_CHAR)) { + typ->val.builtin = BTT_UCHAR; + } else if ((*spec == SPEC_BUILTIN) && (typ->val.builtin == BTT_INT)) { + typ->val.builtin = BTT_UINT; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_LONG)) { + typ->val.builtin = BTT_ULONG; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_LONGLONG)) { + typ->val.builtin = BTT_ULONGLONG; + } else if (((*spec == SPEC_BUILTIN_NOINT) || (*spec == SPEC_BUILTIN)) && (typ->val.builtin == BTT_SHORT)) { + typ->val.builtin = BTT_USHORT; + } else { + log_error(&tok->loginfo, "unexpected type specifier '%s' in declaration\n", kw2str[tok->tokv.kw]); + goto failed; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_VOID)) { + SPEC(VOID, typ->is_incomplete = 1;) + } +#undef SPEC +#undef SPEC_SIGNED + if ((tok->tokt == PTOK_IDENT) && (*spec == SPEC_NONE)) { + // The ident is the type-specifier + khiter_t it = kh_get(type_map, type_map, string_content(tok->tokv.str)); + if (it == kh_end(type_map)) { + log_error(&tok->loginfo, "invalid type '%s' (ident is not a typedef)\n", string_content(tok->tokv.str)); + string_del(tok->tokv.str); + goto failed; + } else { + *spec = SPEC_TYPE; + if (!type_copy_into(typ, kh_val(type_map, it))) { + log_memory("failed to duplicate type infos\n"); + string_del(tok->tokv.str); + goto failed; + } + string_del(tok->tokv.str); + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } + } + if ((tok->tokt == PTOK_KEYWORD) && (*spec == SPEC_NONE) && ((tok->tokv.kw == KW_STRUCT) || (tok->tokv.kw == KW_UNION))) { + int is_struct = tok->tokv.kw == KW_STRUCT; + *spec = SPEC_TYPE; + + // Empty destructor + *tok = proc_next_token(prep); + string_t *tag; + if (tok->tokt == PTOK_IDENT) { + tag = tok->tokv.str; + // Token moved + *tok = proc_next_token(prep); + + khiter_t it; // Iterator into the struct_map + int iret; + it = kh_put(struct_map, struct_map, string_content(tag), &iret); + if (iret < 0) { + log_memory("failed to add structure to struct map\n"); + proc_token_del(tok); + goto failed; + } else if (iret == 0) { + // Structure already declared or defined + if (kh_val(struct_map, it)->is_struct != is_struct) { + log_error(&tok->loginfo, "incoherent struct/union tagging of %s\n", string_content(tag)); + string_del(tag); + proc_token_del(tok); + goto failed; + } + ++kh_val(struct_map, it)->nrefs; + string_del(tag); + tag = kh_val(struct_map, it)->tag; + } else { + kh_val(struct_map, it) = struct_new(is_struct, tag); + if (!kh_val(struct_map, it)) { + log_memory("failed to create new structure metadata structure\n"); + string_del(tag); + proc_token_del(tok); + goto failed; + } + } + typ->typ = TYPE_STRUCT_UNION; + typ->val.st = kh_val(struct_map, it); + typ->is_incomplete = !typ->val.st->is_defined; + } else { + tag = NULL; + typ->typ = TYPE_STRUCT_UNION; + typ->val.st = struct_new(is_struct, NULL); + if (!typ->val.st) { + log_memory("failed to create new structure metadata structure\n"); + proc_token_del(tok); + goto failed; + } + typ->is_incomplete = 1; + } + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_LBRACKET)) { + if (typ->val.st->is_defined) { + log_TODO(&tok->loginfo, "struct redefinition (tag is %s)\n", typ->val.st->tag ? string_content(typ->val.st->tag) : ""); + goto failed; + } + + VECTOR(st_members) *members = vector_new(st_members); + if (!members) { + log_memory("failed to create a members vector\n"); + goto failed; + } + type_t *typ2 = type_new(); + if (!typ2) { + log_memory("failed to create a type info structure\n"); + vector_del(st_members, members); + goto failed; + } + *tok = proc_next_token(prep); + while (!proc_token_isend(tok) && ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_RBRACKET))) { + enum decl_spec spec2 = SPEC_NONE; + if (!parse_declaration_specifier(target, struct_map, type_map, enum_map, builtins, + const_map, type_set, prep, tok, NULL, NULL, &spec2, typ2)) { + vector_del(st_members, members); + type_del(typ2); + goto failed; + } + if (spec2 == SPEC_NONE) { + // Empty destructor + *tok = proc_next_token(prep); + continue; // Declaration was an assert, typ2 is unchanged + } + typ2 = type_try_merge(typ2, type_set); + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_SEMICOLON)) { + // A struct-declaration that does not declare an anonymous structure or anonymous union + // shall contain a struct-declarator-list. + if ((typ2->typ != TYPE_STRUCT_UNION) || typ2->val.st->tag) { + log_error(&tok->loginfo, "missing struct-declarator-list\n"); + vector_del(st_members, members); + type_del(typ2); + goto failed; + } + if (!vector_push(st_members, members, ((st_member_t){.name = NULL, .typ = typ2, .is_bitfield = 0}))) { + log_memory("failed to add anonymous structure member\n"); + vector_del(st_members, members); + type_del(typ2); + // Empty destructor + goto failed; + } + typ2 = type_new(); + if (!typ2) { + log_memory("failed to create a type info structure\n"); + vector_del(st_members, members); + // Empty destructor + goto failed; + } + // Empty destructor + *tok = proc_next_token(prep); + continue; + } + + struct parse_declarator_dest_s dest2; + dest2.structms.struct_map = struct_map; + dest2.structms.type_map = type_map; + dest2.structms.enum_map = enum_map; + dest2.structms.type_set = type_set; + dest2.structms.builtins = builtins; + dest2.structms.const_map = const_map; + dest2.structms.dest = members; + if (!parse_declarator(target, &dest2, prep, tok, TMPSTO_NONE, FSPEC_NONE, typ2, 0, 1, 1, 1)) { + log_error(&tok->loginfo, "error parsing struct-declarator-list\n"); + vector_del(st_members, members); + type_del(typ2); + // Token is deleted + goto failed; + } + type_del(typ2); + if ((tok->tokt != PTOK_SYM) && (tok->tokv.sym != SYM_SEMICOLON)) { + log_error(&tok->loginfo, "error parsing struct-declarator-list (invalid next token)\n"); + vector_del(st_members, members); + proc_token_del(tok); + goto failed; + } + typ2 = type_new(); + if (!typ2) { + log_memory("failed to create a type info structure\n"); + vector_del(st_members, members); + // Empty destructor + goto failed; + } + *tok = proc_next_token(prep); + } + type_del(typ2); + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_RBRACKET)) { + log_error(&tok->loginfo, "error parsing struct-declarator-list (invalid next token)\n"); + vector_del(st_members, members); + proc_token_del(tok); + goto failed; + } + + typ->is_incomplete = 0; + typ->is_validated = 0; + if (tag) { + khiter_t it = kh_get(type_set, type_set, typ); + if (it != kh_end(type_set)) { + kh_key(type_set, it)->is_incomplete = 0; + kh_key(type_set, it)->is_validated = 0; + } + } + typ->val.st->has_incomplete = 0; // Filled by the validate_type step + typ->val.st->nmembers = vector_size(st_members, members); + typ->val.st->members = vector_steal(st_members, members); + typ->val.st->is_defined = 1; + if (is_gst + && typ->val.st->tag + && (string_len(typ->val.st->tag) >= 7) + && !strncmp(string_content(typ->val.st->tag), "_G", 2) + && !strcmp(string_content(typ->val.st->tag) + string_len(typ->val.st->tag) - 5, "Class")) { + typ->val.st->is_simple = 1; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } else { + if (!tag) { + log_error(&tok->loginfo, "invalid structure declaration: missing tag and/or definition\n"); + proc_token_del(tok); + goto failed; + } + goto parse_cur_token_decl; + } + } + if ((tok->tokt == PTOK_KEYWORD) && (*spec == SPEC_NONE) && (tok->tokv.kw == KW_ENUM)) { + *spec = SPEC_TYPE; + + // Empty destructor + *tok = proc_next_token(prep); + string_t *tag = NULL; + if (tok->tokt == PTOK_IDENT) { + tag = tok->tokv.str; + *tok = proc_next_token(prep); + } + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_LBRACKET)) { + if (!tag) { + log_error(&tok->loginfo, "unexpected token after keyword 'enum'\n"); + proc_token_del(tok); + goto failed; + } + khiter_t it = kh_get(type_map, enum_map, string_content(tag)); + if (it == kh_end(enum_map)) { + log_error(&tok->loginfo, "enumeration %s has not been defined yet\n", string_content(tag)); // TODO? + string_del(tag); + proc_token_del(tok); + goto failed; + } + if (!type_copy_into(typ, kh_val(enum_map, it))) { + log_memory("failed to duplicate enum type infos\n"); + string_del(tag); + proc_token_del(tok); + goto failed; + } + string_del(tag); + goto parse_cur_token_decl; + } + // We are defining the enum + // Try in order: + // If all values are 0 <= . <= UINT32_MAX, BTT_U32 + // If any value is negative and all values are <= INT32_MAX, BTT_S32 + // If any value is negative and all values are <= INT64_MAX, BTT_S64 + // If all values are 0 <= . <= UINT64_MAX, BTT_U64 + // Otherwise, error + // By default, BTT_U32* and the constant is an NCT_INT32 + // *The AMD ABI says this should rather be BTT_INT (or BTT_S32) + // Note that BTT_S32 only when has_neg is true + int has_neg = 0, not_in_i32 = 0; + enum type_builtin_e btt = BTT_U32; + num_constant_t cst = { .typ = NCT_INT32, .val.i32 = -1 }; + // Empty destructor + *tok = proc_next_token(prep); + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_RBRACKET)) { + log_error(&tok->loginfo, "expected enum constant name before '}'\n"); + proc_token_del(tok); + goto failed; + } + int iret; + while ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_RBRACKET)) { + if (tok->tokt != PTOK_IDENT) { + log_error(&tok->loginfo, "unexpected token in enumeration definition\n"); + if (tag) string_del(tag); + proc_token_del(tok); + goto failed; + } + char *ident = string_steal(tok->tokv.str); + *tok = proc_next_token(prep); + while ((tok->tokt == PTOK_IDENT) && (!strcmp(string_content(tok->tokv.str), "__attribute__") || !strcmp(string_content(tok->tokv.str), "__attribute"))) { + // Attribute + string_del(tok->tokv.str); + *tok = proc_next_token(prep); + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_LPAREN)) { + log_error(&tok->loginfo, "unexpected token, expected '('\n"); + free(ident); + if (tag) string_del(tag); + proc_token_del(tok); + goto failed; + } + // Empty destructor + *tok = proc_next_token(prep); + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_LPAREN)) { + log_error(&tok->loginfo, "unexpected token, expected '('\n"); + free(ident); + if (tag) string_del(tag); + // Empty destructor + goto failed; + } + // Empty destructor + *tok = proc_next_token(prep); + enum_attribute_list: + if ((tok->tokt == PTOK_IDENT) && TOKEN_MATCH_ATTR(deprecated)) { + log_warning(&tok->loginfo, "ignoring enum constant attribute 'deprecated'\n"); + string_del(tok->tokv.str); + *tok = proc_next_token(prep); + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_COMMA)) { + // Empty destructor + *tok = proc_next_token(prep); + goto enum_attribute_list; + } else goto enum_attribute_list_end; + } + if ((tok->tokt == PTOK_IDENT) && TOKEN_MATCH_ATTR(unavailable)) { + log_warning(&tok->loginfo, "ignoring enum constant attribute 'unavailable'\n"); + string_del(tok->tokv.str); + *tok = proc_next_token(prep); + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_COMMA)) { + // Empty destructor + *tok = proc_next_token(prep); + goto enum_attribute_list; + } else goto enum_attribute_list_end; + } + enum_attribute_list_end: + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_RPAREN)) { + log_error(&tok->loginfo, "unexpected token, expected ident or ')'\n"); + free(ident); + if (tag) string_del(tag); + // Empty destructor + goto failed; + } + // Empty destructor + *tok = proc_next_token(prep); + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_RPAREN)) { + log_error(&tok->loginfo, "unexpected token, expected ')'\n"); + free(ident); + if (tag) string_del(tag); + // Empty destructor + goto failed; + } + // Empty destructor + *tok = proc_next_token(prep); + } + khiter_t it = kh_put(const_map, const_map, ident, &iret); + if (iret < 0) { + log_memory("failed to add constant %s to the constants map\n", ident); + free(ident); + if (tag) string_del(tag); + proc_token_del(tok); + goto failed; + } else if (iret == 0) { + log_error(&tok->loginfo, "constant %s is already defined\n", ident); + free(ident); + if (tag) string_del(tag); + proc_token_del(tok); + goto failed; + } + if ((tok->tokt == PTOK_SYM) && ((tok->tokv.sym == SYM_COMMA) || tok->tokv.sym == SYM_RBRACKET)) { + switch (cst.typ) { + case NCT_INT32: + if (cst.val.i32 == INT32_MAX) { + cst.typ = NCT_UINT32; + cst.val.u32 = (uint32_t)INT32_MAX + 1; + } else ++cst.val.i32; + break; + case NCT_UINT32: + if (cst.val.u32 == UINT32_MAX) { + cst.typ = NCT_INT64; + cst.val.i64 = (int64_t)UINT32_MAX + 1; + } else ++cst.val.u32; + break; + case NCT_INT64: + if (cst.val.i64 == INT64_MAX) { + cst.typ = NCT_UINT64; + cst.val.u64 = (uint64_t)INT64_MAX + 1; + } else ++cst.val.i64; + break; + case NCT_UINT64: + if (cst.val.u64 == UINT64_MAX) { + log_error(&tok->loginfo, "enum constant is too big\n"); + if (tag) string_del(tag); + proc_token_del(tok); + goto failed; + } else ++cst.val.u64; + break; + case NCT_FLOAT: + case NCT_DOUBLE: + case NCT_LDOUBLE: + default: + log_internal(&tok->loginfo, "enum constant is a float/double/ldouble\n"); + if (tag) string_del(tag); + proc_token_del(tok); + goto failed; + } + } else if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_EQ)) { + // Empty destructor + *tok = proc_next_token(prep); + expr_t *e = parse_expression(target, struct_map, type_map, enum_map, builtins, const_map, type_set, prep, tok, 14); + if (!e) { + goto failed; + } + if ((tok->tokt != PTOK_SYM) || ((tok->tokv.sym != SYM_COMMA) && (tok->tokv.sym != SYM_RBRACKET))) { + log_error(&tok->loginfo, "unexpected token during enumeration declaration\n"); + expr_del(e); + if (tag) string_del(tag); + proc_token_del(tok); + goto failed; + } + if (!eval_expression(&tok->loginfo, target, e, const_map, &cst, 1)) { + expr_del(e); + if (tag) string_del(tag); + // Empty destructor + goto failed; + } + expr_del(e); + } + switch (cst.typ) { + case NCT_INT32: + if (cst.val.i32 < 0) { + has_neg = 1; + if (btt == BTT_U64) { + log_error(&tok->loginfo, "enum constant is too big\n"); + if (tag) string_del(tag); + // Empty destructor + goto failed; + } + btt = not_in_i32 ? BTT_S64 : BTT_S32; + } + break; + case NCT_UINT32: + if (cst.val.u32 > (uint32_t)INT32_MAX) { + not_in_i32 = 1; + btt = has_neg ? BTT_S64 : BTT_U32; + } + break; + case NCT_INT64: + if (cst.val.i64 < 0) { + has_neg = 1; + if (cst.val.i64 < (int64_t)INT32_MIN) { + not_in_i32 = 1; + } + if (btt == BTT_U64) { + log_error(&tok->loginfo, "enum constant is too big\n"); + if (tag) string_del(tag); + // Empty destructor + goto failed; + } + btt = + not_in_i32 ? BTT_S64 : + BTT_S32; + } + if ((cst.val.i64 > (int64_t)INT32_MAX)) { + not_in_i32 = 1; + if (has_neg) btt = BTT_S64; + else if (((btt == BTT_S32) || (btt == BTT_U32)) && (cst.val.i64 <= (int64_t)UINT32_MAX)) + btt = BTT_U32; + else if (btt != BTT_U64) btt = BTT_S64; + } + break; + case NCT_UINT64: + if (cst.val.u64 > (uint32_t)INT32_MAX) { + not_in_i32 = 1; + if (has_neg && (cst.val.u64 > (uint64_t)INT64_MAX)) { + log_error(&tok->loginfo, "enum constant is too big\n"); + if (tag) string_del(tag); + // Empty destructor + goto failed; + } + btt = (cst.val.u64 > (uint64_t)INT64_MAX) ? BTT_U64 : (has_neg || (cst.val.u64 > (uint64_t)UINT32_MAX)) ? BTT_S64 : BTT_U32; + } + break; + case NCT_FLOAT: + case NCT_DOUBLE: + case NCT_LDOUBLE: + default: + log_error(&tok->loginfo, "invalid floating-point enumeration constant\n"); + if (tag) string_del(tag); + // Empty destructor + goto failed; + } + kh_val(const_map, it) = cst; + if (tok->tokv.sym == SYM_COMMA) { + *tok = proc_next_token(prep); + } + } + if (tag) { + char *ctag = string_steal(tag); + khiter_t it = kh_put(type_map, enum_map, ctag, &iret); + if (iret < 0) { + log_memory("failed to add enumeration %s to the type map\n", ctag); + free(ctag); + // Empty destructor + goto failed; + } else if (iret == 0) { + log_error(&tok->loginfo, "enumeration %s already exists\n", ctag); + free(ctag); + // Empty destructor + goto failed; + } + type_t *new_typ = type_new(); + if (!new_typ) { + log_memory("failed to create type info for enumeration %s\n", ctag); + free(ctag); + kh_del(type_map, enum_map, it); + // Empty destructor + goto failed; + } + typ->typ = new_typ->typ = TYPE_ENUM; + typ->is_incomplete = new_typ->is_incomplete = 0; + typ->val.typ = new_typ->val.typ = (*builtins)[btt]; + typ->val.typ->nrefs += 2; + new_typ = type_try_merge(new_typ, type_set); + validate_type(&tok->loginfo, target, new_typ); // Assume it returns 1 + kh_val(enum_map, it) = new_typ; + } else { + typ->typ = TYPE_ENUM; + typ->is_incomplete = 0; + typ->val.typ = (*builtins)[btt]; + ++typ->val.typ->nrefs; + } + *tok = proc_next_token(prep); + goto parse_cur_token_decl; + } + + if ((*spec != SPEC_BUILTIN) && (*spec != SPEC_BUILTIN_NOINT) && (*spec != SPEC_TYPE)) goto invalid_token; + if ((tok->tokt != PTOK_IDENT) && ((tok->tokt != PTOK_SYM) || ((tok->tokv.sym != SYM_COMMA) && (tok->tokv.sym != SYM_SEMICOLON) + && (tok->tokv.sym != SYM_STAR) && (tok->tokv.sym != SYM_LSQBRACKET) + && (tok->tokv.sym != SYM_LPAREN) && (tok->tokv.sym != SYM_RPAREN) + && (tok->tokv.sym != SYM_COLON)))) + goto invalid_token; + + return 1; + +invalid_token: + log_error(&tok->loginfo, "unexpected token (parse_declaration_specifier)\n"); + proc_token_del(tok); + +failed: + return 0; +} + +static int parse_declarator(machine_t *target, struct parse_declarator_dest_s *dest, preproc_t *prep, proc_token_t *tok, enum decl_storage storage, + enum fun_spec fspec, type_t *base_type, int is_init, int is_list, int allow_decl, int allow_abstract) { + int has_list = 0, has_ident = 0; + // TODO: allow_abstract and 'direct-abstract-declarator(opt) ( parameter-type-list(opt) )' + + _Bool array_atomic = 0, array_const = 0, array_restrict = 0, array_static = 0, array_volatile = 0; + string_t *cur_ident = NULL; + type_t *typ = base_type; ++typ->nrefs; + type_t *cur_bottom = NULL; + VECTOR(size_t) *nptr_stack = vector_new_cap(size_t, 1); + if (!nptr_stack) { + log_memory("failed to allocate nptr stack\n"); + proc_token_del(tok); + goto failed0; + } + vector_push(size_t, nptr_stack, 0); // Always succeed (size < cap) + while (1) { + switch (tok->tokt) { + case PTOK_IDENT: + if (!has_ident && allow_decl) { + cur_ident = tok->tokv.str; + has_ident = 1; + *tok = proc_next_token(prep); + break; + } else { + log_error(&tok->loginfo, "unexpected identifier\n"); + proc_token_del(tok); + goto failed; + } + case PTOK_SYM: + if (tok->tokv.sym == SYM_LPAREN) { + if (has_ident) { + type_t *new_typ; + + VECTOR(types) *args = vector_new(types); + if (!args) { + log_memory("failed to create new type (function argument)\n"); + // Empty destructor + goto failed; + } + int has_varargs = 0; + *tok = proc_next_token(prep); + if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_VOID)) { + // Empty destructor + *tok = proc_next_token(prep); + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_RPAREN)) { + vector_del(types, args); + new_typ = type_new(); + if (!new_typ) { + log_memory("failed to create new function type\n"); + // Empty destructor + goto failed; + } + new_typ->typ = TYPE_FUNCTION; + new_typ->val.fun.has_varargs = 0; + new_typ->val.fun.nargs = 0; + new_typ->val.fun.args = NULL; + // ret will be set later + goto end_fun; + } + if (!proc_unget_token(prep, tok)) { + log_memory("failed to unget processor token\n"); + // Empty destructor + vector_del(types, args); + goto failed; + } + tok->tokt = PTOK_KEYWORD; + tok->tokv.kw = KW_VOID; + } else if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_RPAREN)) { + goto no_arg; + } + while (1) { + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_VARIADIC)) { + has_varargs = 1; + // Empty destructor + *tok = proc_next_token(prep); + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_RPAREN)) { + log_error(&tok->loginfo, "invalid token after function variadic argument\n"); + proc_token_del(tok); + vector_del(types, args); + goto failed; + } + break; + } else { + type_t *typ2 = type_new(); + if (!typ2) { + log_memory("failed to create new type (function argument)\n"); + // Empty destructor + vector_del(types, args); + goto failed; + } + enum decl_storage storage2 = TMPSTO_NONE; + enum decl_spec spec2 = SPEC_NONE; + if (!parse_declaration_specifier(target, PDECL_STRUCT_MAP, PDECL_TYPE_MAP, PDECL_ENUM_MAP, PDECL_BUILTINS, + PDECL_CONST_MAP, PDECL_TYPE_SET, prep, tok, &storage2, NULL, &spec2, typ2)) { + // Token is deleted + vector_del(types, args); + type_del(typ2); + goto failed; + } + if (spec2 == SPEC_NONE) { + // _Static_assert declaration; empty destructor + log_error(&tok->loginfo, "unexpected _Static_assert declaration\n"); + vector_del(types, args); + type_del(typ2); + goto failed; + } + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_RPAREN)) { + // Unnamed argument + if (typ2->typ == TYPE_ARRAY) { + // Need to convert type to a pointer + type_t *typ3 = type_new(); + if (!typ3) { + log_memory("failed to allocate new type\n"); + type_del(typ2); + // Empty destructor + goto failed; + } + if (!type_copy_into(typ3, typ2)) { + log_memory("failed to duplicate array type to temporary type\n"); + type_del(typ3); + type_del(typ2); + // Empty destructor + goto failed; + } + type_del(typ2); + typ3->typ = TYPE_PTR; + typ3->val.typ = typ3->val.array.typ; + typ2 = type_try_merge(typ3, PDECL_TYPE_SET); + } + if (!vector_push(types, args, typ2)) { + log_memory("failed to add argument to argument vector\n"); + vector_del(types, args); + type_del(typ2); + // Empty destructor + goto failed; + } + break; + } else if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_COMMA)) { + // Unnamed argument + if (typ2->typ == TYPE_ARRAY) { + // Need to convert type to a pointer + type_t *typ3 = type_new(); + if (!typ3) { + log_memory("failed to allocate new type\n"); + type_del(typ2); + // Empty destructor + goto failed; + } + if (!type_copy_into(typ3, typ2)) { + log_memory("failed to duplicate array type to temporary type\n"); + type_del(typ3); + type_del(typ2); + // Empty destructor + goto failed; + } + type_del(typ2); + typ3->typ = TYPE_PTR; + typ3->val.typ = typ3->val.array.typ; + typ2 = type_try_merge(typ3, PDECL_TYPE_SET); + } + if (!vector_push(types, args, typ2)) { + log_memory("failed to add argument to argument vector\n"); + vector_del(types, args); + type_del(typ2); + // Empty destructor + goto failed; + } + // Empty destructor + *tok = proc_next_token(prep); + continue; + } + // FIXME: Storage specifiers are ignored most of the time? + struct parse_declarator_dest_s dest2; + dest2.argt.dest = NULL; + dest2.argt.struct_map = PDECL_STRUCT_MAP; + dest2.argt.type_map = PDECL_TYPE_MAP; + dest2.argt.enum_map = PDECL_ENUM_MAP; + dest2.argt.type_set = PDECL_TYPE_SET; + dest2.argt.builtins = PDECL_BUILTINS; + dest2.argt.const_map = PDECL_CONST_MAP; + if (!parse_declarator(target, &dest2, prep, tok, TMPSTO_NONE, FSPEC_NONE, typ2, 0, 0, 1, 1)) { + // Token is deleted + vector_del(types, args); + type_del(typ2); + goto failed; + } + type_del(typ2); + if (!dest2.argt.dest) { + log_internal(&tok->loginfo, "argument type is NULL\n"); + vector_del(types, args); + // Empty destructor + goto failed; + } + if (!vector_push(types, args, dest2.argt.dest)) { + log_memory("failed to add argument to argument vector\n"); + vector_del(types, args); + type_del(dest2.argt.dest); + // Empty destructor + goto failed; + } + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_RPAREN)) { + break; + } else if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_COMMA)) { + // Empty destructor + *tok = proc_next_token(prep); + continue; + } + log_error(&tok->loginfo, "invalid token after function argument\n"); + vector_del(types, args); + proc_token_del(tok); + goto failed; + } + } + no_arg: + new_typ = type_new(); + if (!new_typ) { + log_memory("failed to create new function type\n"); + // Empty destructor + goto failed; + } + new_typ->typ = TYPE_FUNCTION; + new_typ->val.fun.has_varargs = has_varargs; + new_typ->val.fun.nargs = vector_size(types, args) ? vector_size(types, args) : (size_t)-1; + new_typ->val.fun.args = vector_steal(types, args); + + end_fun: // (void) + if (cur_bottom) { + // cur_bottom is a pointer, an array or a function + // We have cur_bottom(old) --> below, we want cur_bottom(old) --> array=cur_bottom(new) --> below + new_typ->val.fun.ret = + (cur_bottom->typ == TYPE_PTR) ? cur_bottom->val.typ : + (cur_bottom->typ == TYPE_ARRAY) ? cur_bottom->val.array.typ : + cur_bottom->val.fun.ret; + *((cur_bottom->typ == TYPE_PTR) ? &cur_bottom->val.typ : + (cur_bottom->typ == TYPE_ARRAY) ? &cur_bottom->val.array.typ : &cur_bottom->val.fun.ret) = new_typ; + cur_bottom = new_typ; + } else { + // We have top(old), we want array=top(new)=cur_bottom(new) --> top(old) + new_typ->val.fun.ret = typ; + cur_bottom = typ = new_typ; + } + *tok = proc_next_token(prep); + break; + } else { + if (!vector_push(size_t, nptr_stack, 0)) { + log_memory("Failed to push 0 to the nptr stack for opening a parenthesis\n"); + // Empty destructor + goto failed; + } + *tok = proc_next_token(prep); + break; + } + } else if (tok->tokv.sym == SYM_STAR) { + if (has_ident) { + log_error(&tok->loginfo, "invalid token '*' after identifier in declaration\n"); + // Empty destructor + goto failed; + } else { + type_t *new_typ = type_new_ptr(typ); + if (!new_typ) { + log_memory("failed to create a new pointer type info structure\n"); + // Empty destructor + goto failed; + } + typ = new_typ; + ++vector_last(size_t, nptr_stack); + *tok = proc_next_token(prep); + break; + } + } else if (tok->tokv.sym == SYM_LSQBRACKET) { + if (!has_ident) { + if (!allow_abstract) { + log_error(&tok->loginfo, "invalid token '[' before identifier in declaration\n"); + // Empty destructor + goto failed; + } + has_ident = 1; + } + if (array_atomic || array_const || array_restrict || array_static || array_volatile) { + log_error(&tok->loginfo, "invalid array after array with type qualifier(s) and/or 'static'\n"); + // Empty destructor + goto failed; + } + // Empty destructor + *tok = proc_next_token(prep); + // From the standard: + // direct-declarator [ type-qualifier-list(opt) assignment-expression(opt) ] + // direct-declarator [ static type-qualifier-list(opt) assignment-expression ] + // direct-declarator [ type-qualifier-list static assignment-expression ] + // direct-declarator [ type-qualifier-list(opt) * ] + // The optional type qualifiers and the keyword static shall appear only in a + // declaration of a function parameter with an array type, and then only in the outermost + // array type derivation. + size_t nelems; _Bool is_incomplete; + while (1) { +#define DO_CHECKS \ + if (is_init || is_list || !allow_decl || (cur_bottom && (typ->typ != TYPE_ARRAY))) { \ + log_error(&tok->loginfo, "type qualifiers and 'static' may only appear in function argument array declarations\n"); \ + /* Empty destructor */ \ + goto failed; \ + } + if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_ATOMIC)) { + DO_CHECKS + array_atomic = 1; + *tok = proc_next_token(prep); + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_CONST)) { + DO_CHECKS + array_const = 1; + *tok = proc_next_token(prep); + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_RESTRICT)) { + DO_CHECKS + array_restrict = 1; + *tok = proc_next_token(prep); + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_STATIC)) { + DO_CHECKS + array_static = 1; + *tok = proc_next_token(prep); + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_VOLATILE)) { + DO_CHECKS + array_volatile = 1; + *tok = proc_next_token(prep); + } else break; +#undef DO_CHECKS + } + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_RSQBRACKET)) { + if (array_static) { + // Missing expression + log_error(&tok->loginfo, "unexpected token ']' in static length array declaration\n"); + // Empty destructor + goto failed; + } + // Incomplete VLA + nelems = (size_t)-1; + is_incomplete = 1; + } else if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_STAR)) { + if (array_static) { + // Missing expression + log_error(&tok->loginfo, "unexpected token '*' in static length array declaration\n"); + // Empty destructor + goto failed; + } + // Complete VLA, expecting a ']' + nelems = (size_t)-1; + is_incomplete = 0; + // Empty destructor + *tok = proc_next_token(prep); + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_RSQBRACKET)) { + // TODO: ...[*expr] + log_error(&tok->loginfo, "unexpected token during variable length array declaration\n"); + proc_token_del(tok); + goto failed; + } + } else { + // Constant expression, followed by ']' + is_incomplete = 0; + expr_t *e = parse_expression(target, PDECL_STRUCT_MAP, PDECL_TYPE_MAP, PDECL_ENUM_MAP, PDECL_BUILTINS, + PDECL_CONST_MAP, PDECL_TYPE_SET, prep, tok, 15); + if (!e) { + goto failed; + } + if ((tok->tokt != PTOK_SYM) || (tok->tokv.sym != SYM_RSQBRACKET)) { + log_error(&tok->loginfo, "unexpected token during array declaration\n"); + expr_del(e); + proc_token_del(tok); + goto failed; + } + num_constant_t cst; + if (eval_expression(&tok->loginfo, target, e, PDECL_CONST_MAP, &cst, is_init || is_list || !allow_decl)) { + expr_del(e); + int is_neg; + switch (cst.typ) { + case NCT_FLOAT: is_neg = cst.val.f < 0; nelems = (size_t)cst.val.f; break; + case NCT_DOUBLE: is_neg = cst.val.d < 0; nelems = (size_t)cst.val.d; break; + case NCT_LDOUBLE: is_neg = cst.val.l < 0; nelems = (size_t)cst.val.l; break; + case NCT_INT32: is_neg = cst.val.i32 < 0; nelems = (size_t)cst.val.i32; break; + case NCT_UINT32: is_neg = 0; nelems = (size_t)cst.val.u32; break; + case NCT_INT64: is_neg = cst.val.i64 < 0; nelems = (size_t)cst.val.i64; break; + case NCT_UINT64: is_neg = 0; nelems = (size_t)cst.val.u64; break; + default: is_neg = 1; + } + if (is_neg) { + log_error(&tok->loginfo, "the size of an array must be nonnegative"); + // Empty destructor + goto failed; + } + } else { + expr_del(e); + // Treated as '*' as function argument (TODO: as anything else) + if (is_init || is_list || !allow_decl) { + // Empty destructor + goto failed; + } + nelems = (size_t)-1; + } + } + // Token is ']' + + if (cur_bottom) { + type_t *tmp = type_new(); + if (!tmp) { + log_memory("failed to create new array type info\n"); + // Empty destructor + goto failed; + } + tmp->typ = TYPE_ARRAY; + tmp->val.array.array_sz = nelems; + tmp->is_incomplete = is_incomplete; + // cur_bottom is a pointer, an array or a function + // We have cur_bottom(old) --> below, we want cur_bottom(old) --> array=cur_bottom(new) --> below + tmp->val.array.typ = + (cur_bottom->typ == TYPE_PTR) ? cur_bottom->val.typ : + (cur_bottom->typ == TYPE_ARRAY) ? cur_bottom->val.array.typ : + cur_bottom->val.fun.ret; + *((cur_bottom->typ == TYPE_PTR) ? &cur_bottom->val.typ : + (cur_bottom->typ == TYPE_ARRAY) ? &cur_bottom->val.array.typ : &cur_bottom->val.fun.ret) = tmp; + cur_bottom = tmp; + } else { + type_t *new_typ = type_new(); + if (!new_typ) { + log_memory("failed to create new array type info\n"); + // Empty destructor + goto failed; + } + new_typ->typ = TYPE_ARRAY; + new_typ->val.array.array_sz = nelems; + new_typ->is_incomplete = is_incomplete; + // We have top(old), we want array=top(new)=cur_bottom(new) --> top(old) + new_typ->val.array.typ = typ; + cur_bottom = typ = new_typ; + } + *tok = proc_next_token(prep); + break; + } else if (tok->tokv.sym == SYM_RPAREN) { + if (!has_ident) { + if (!allow_abstract) { + log_error(&tok->loginfo, "invalid token ')' before identifier in declaration\n"); + // Empty destructor + goto failed; + } + has_ident = 1; + } + if (vector_size(size_t, nptr_stack) == 1) { + if (!is_init && !is_list) goto rparen_ok_ret; + log_error(&tok->loginfo, "closing unopened parenthesis in declaration\n"); + // Empty destructor + goto failed; + } + size_t ndecr; + if (cur_bottom) { + ndecr = vector_last(size_t, nptr_stack); + } else { + if (vector_last(size_t, nptr_stack)) { + cur_bottom = typ; + ndecr = vector_last(size_t, nptr_stack) - 1; + } else ndecr = 0; + } + for (size_t i = 0; i < ndecr; ++i) { + cur_bottom = + (cur_bottom->typ == TYPE_PTR) ? cur_bottom->val.typ : + (cur_bottom->typ == TYPE_ARRAY) ? cur_bottom->val.array.typ : + cur_bottom->val.fun.ret; + } + vector_pop(size_t, nptr_stack); + *tok = proc_next_token(prep); + break; + } else if ((is_init && (tok->tokv.sym == SYM_EQ)) + || (tok->tokv.sym == SYM_COMMA) + || (tok->tokv.sym == SYM_SEMICOLON) + || (is_init && (tok->tokv.sym == SYM_LBRACKET))) { + rparen_ok_ret: // Last function argument + if (!allow_abstract && !has_ident) { + log_error(&tok->loginfo, "invalid symbol '%s' before identifier\n", sym2str[tok->tokv.sym]); + // Empty destructor + goto failed; + } + if (vector_size(size_t, nptr_stack) != 1) { + log_error(&tok->loginfo, "invalid symbol '%s' (missing parenthesis?)\n", sym2str[tok->tokv.sym]); + // Empty destructor + goto failed; + } + + // Try to free some redundant types + typ = type_try_merge(typ, PDECL_TYPE_SET); + + int validation = validate_storage_type(&tok->loginfo, target, storage, typ, tok->tokv.sym); + if (!validation) { + // Empty destructor + goto failed; + } + + if (validation == VALIDATION_FUN) { + // Function definition; tok is '{' + if (!is_init || !is_list || has_list) { + // We are not at the top-level or we have an initialization list + log_error(&tok->loginfo, "invalid function definition\n"); + // Empty destructor + goto failed; + } + // Note that here, dest is a file_t + // No argument in function definition means that the function takes no argument, + // whereas no argument in function declaration means the function takes an unspecified number of arguments + if (typ->val.fun.nargs == (size_t)-1) typ->val.fun.nargs = 0; + + declaration_t *decl = malloc(sizeof *decl); + if (!decl) { + log_memory("failed to create new declaration\n"); + // Empty destructor + goto failed; + } + decl->storage = tmpsto2sto[storage]; + decl->defined = 1; + decl->typ = typ; + + int iret; + char *cident = string_steal(cur_ident); cur_ident = NULL; + khiter_t it = kh_put(decl_map, dest->f->decl_map, cident, &iret); + if (iret < 0) { + log_memory("failed to add function '%s' to the declaration map\n", cident); + free(cident); + free(decl); + // Empty destructor + goto failed; + } else if (iret == 0) { + free(decl); + if (kh_val(dest->f->decl_map, it)->defined) { + log_error(&tok->loginfo, "function '%s' is already in the declaration map\n", cident); + free(cident); + // Empty destructor + goto failed; + } else { + free(cident); + decl = kh_val(dest->f->decl_map, it); + } + } + + kh_val(dest->f->decl_map, it) = decl; + + // Skip the function body + int nlbraces = 0; + do { + proc_token_del(tok); + *tok = proc_next_token(prep); + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_LBRACKET)) ++nlbraces; + else if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_RBRACKET)) { + if (nlbraces) --nlbraces; + else goto success; + } + } while (!proc_token_isend(tok)); + log_error(&tok->loginfo, "unexpected token in function body\n"); + goto failed; + } + if ((fspec != FSPEC_NONE) && (typ->typ != TYPE_FUNCTION)) { + log_error(&tok->loginfo, "unexpected function specifier\n"); + // Empty destructor + goto failed; + } + + declaration_t *decl = NULL; + if (storage == TMPSTO_TYPEDEF) { + if (!is_init || !is_list) { + // We are not at the top-level (note that storage is set to NONE in function arguments) + log_error(&tok->loginfo, "invalid function definition\n"); + // Empty destructor + goto failed; + } + // Note that here, dest is a file_t + int iret; + char *cident = string_steal(cur_ident); cur_ident = NULL; + khiter_t it = kh_put(type_map, dest->f->type_map, cident, &iret); + if (iret < 0) { + log_memory("failed to add '%s' to the type map\n", cident); + free(cident); + // Empty destructor + goto failed; + } else if (iret == 0) { + if (!type_t_equal(typ, kh_val(dest->f->type_map, it))) { + log_error(&tok->loginfo, "'%s' is already in the type map with a different type\n", cident); + free(cident); + // Empty destructor + goto failed; + } + // We can safely ignore this since we have typedef-ed the same type + free(cident); + type_del(typ); + } else { + kh_val(dest->f->type_map, it) = typ; + } + } else { + if (is_init && is_list) { + decl = malloc(sizeof *decl); + if (!decl) { + log_memory("failed to create new declaration\n"); + // Empty destructor + goto failed; + } + if ((typ->typ == TYPE_FUNCTION) && (storage == TMPSTO_NONE)) + storage = TMPSTO_EXTERN; + decl->storage = tmpsto2sto[storage]; + decl->defined = 0; + decl->typ = typ; + + int iret; + char *cident = string_steal(cur_ident); cur_ident = NULL; + khiter_t it = kh_put(decl_map, dest->f->decl_map, cident, &iret); + if (iret < 0) { + log_memory("failed to add '%s' to the declaration map\n", cident); + free(cident); + free(decl); + // Empty destructor + goto failed; + } else if (iret == 0) { + if (!type_t_equal(typ, kh_val(dest->f->decl_map, it)->typ) + || ((storage == TMPSTO_NONE) && (kh_val(dest->f->decl_map, it)->storage == STORAGE_NONE))) { + log_error(&tok->loginfo, "'%s' is already in the declaration map\n", cident); + free(cident); + free(decl); + // Empty destructor + goto failed; + } else { + // OK, this is allowed + free(cident); + free(decl); + type_del(typ); + } + } else { + kh_val(dest->f->decl_map, it) = decl; + } + } else if (!is_init && !is_list) { + if (allow_decl) { + // Function argument + if (typ->typ == TYPE_ARRAY) { + // Convert to pointer + if (typ == base_type) { + typ = type_new(); + if (!typ) { + log_memory("failed to allocate new type\n"); + type_del(base_type); + // Empty destructor + goto failed; + } + if (!type_copy_into(typ, base_type)) { + log_memory("failed to allocate new type\n"); + // Empty destructor + goto failed; + } + } + typ->typ = TYPE_PTR; + typ->val.typ = typ->val.array.typ; + if (array_atomic) typ->is_atomic = 1; + if (array_const) typ->is_const = 1; + if (array_restrict) typ->is_restrict = 1; + if (array_volatile) typ->is_volatile = 1; + typ = type_try_merge(typ, PDECL_TYPE_SET); + } + } + dest->argt.dest = typ; + if (cur_ident) string_del(cur_ident); + goto success; + } else if (!is_init && is_list) { + if (!vector_push(st_members, dest->structms.dest, ((st_member_t){.name = cur_ident, .typ = typ, .is_bitfield = 0}))) { + log_memory("failed to add structure member %s\n", string_content(cur_ident)); + string_del(cur_ident); + // Empty destructor + goto failed; + } + } else { + log_internal(&tok->loginfo, "unknown is_init/is_list combination %d%d\n", is_init, is_list); + // Empty destructor + goto failed; + } + } + typ = base_type; ++typ->nrefs; + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_EQ)) { + // Initialization + if (!is_init) { + log_error(&tok->loginfo, "unexpected initializer\n"); + goto failed; + } + if (decl) { + if (decl->defined) { + log_error(&tok->loginfo, "invalid declaration initializer: variable was already declared\n"); + goto failed; + } + decl->defined = 1; + } + *tok = proc_next_token(prep); + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_LBRACKET)) { + // { ... } + int nlbraces = 0; + do { + proc_token_del(tok); + *tok = proc_next_token(prep); + if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_LBRACKET)) ++nlbraces; + else if ((tok->tokt == PTOK_SYM) && (tok->tokv.sym == SYM_RBRACKET)) { + if (nlbraces) --nlbraces; + else break; + } + } while (!proc_token_isend(tok)); + if (proc_token_isend(tok)) { + log_error(&tok->loginfo, "unexpected token in declaration initializer\n"); + proc_token_del(tok); + goto failed; + } + *tok = proc_next_token(prep); + } else { + expr_t *e = parse_expression(target, PDECL_STRUCT_MAP, PDECL_TYPE_MAP, PDECL_ENUM_MAP, PDECL_BUILTINS, + PDECL_CONST_MAP, PDECL_TYPE_SET, prep, tok, 15); + if (!e) { + log_error(&tok->loginfo, "invalid declaration initializer\n"); + goto failed; + } + expr_del(e); + } + if ((tok->tokt != PTOK_SYM) || ((tok->tokv.sym != SYM_COMMA) && (tok->tokv.sym != SYM_SEMICOLON))) { + log_error(&tok->loginfo, "unexpected token in declaration initializer\n"); + proc_token_del(tok); + goto failed; + } + validation = (tok->tokv.sym == SYM_SEMICOLON) ? VALIDATION_LAST_DECL : VALIDATION_DECL; + } + if (validation == VALIDATION_LAST_DECL) { + --typ->nrefs; + goto success; + } else { + cur_ident = NULL; has_ident = 0; + cur_bottom = NULL; + vector_last(size_t, nptr_stack) = 0; + *tok = proc_next_token(prep); + break; + } + } else if (!is_init && is_list && (tok->tokv.sym == SYM_COLON)) { + if (vector_size(size_t, nptr_stack) != 1) { + log_error(&tok->loginfo, "invalid symbol '%s' (missing parenthesis?)\n", sym2str[tok->tokv.sym]); + // Empty destructor + goto failed; + } + // Try to free some redundant types + typ = type_try_merge(typ, PDECL_TYPE_SET); + + // storage == TMPSTO_NONE + *tok = proc_next_token(prep); + expr_t *e = parse_expression(target, dest->structms.struct_map, dest->structms.type_map, dest->structms.enum_map, + dest->structms.builtins, dest->structms.const_map, dest->structms.type_set, + prep, tok, 14); + if (!e) { + goto failed; + } + if ((tok->tokt != PTOK_SYM) || ((tok->tokv.sym != SYM_COMMA) && (tok->tokv.sym != SYM_SEMICOLON))) { + log_error(&tok->loginfo, "unexpected token in bitfield width\n"); + expr_del(e); + proc_token_del(tok); + goto failed; + } + num_constant_t eval; + if (!eval_expression(&tok->loginfo, target, e, dest->structms.const_map, &eval, 1)) { + expr_del(e); + // Empty destructor + goto failed; + } + expr_del(e); + + int validation = validate_storage_type(&tok->loginfo, target, storage, typ, tok->tokv.sym); + if (!validation) { + // Empty destructor + goto failed; + } + + if (validation == VALIDATION_FUN) { + // We are not at the top-level or we have an initialization list + // Should never happen + log_error(&tok->loginfo, "invalid function definition in structure definition\n"); + // Empty destructor + goto failed; + } + if ((fspec != FSPEC_NONE) && (typ->typ != TYPE_FUNCTION)) { + log_error(&tok->loginfo, "unexpected function specifier\n"); + // Empty destructor + goto failed; + } + + size_t width; + switch (eval.typ) { + case NCT_INT32: + if (eval.val.i32 < 0) { + log_error(&tok->loginfo, "invalid negative bitfield width\n"); + goto failed; + } + width = (size_t)eval.val.i32; + break; + case NCT_UINT32: + width = (size_t)eval.val.u32; + break; + case NCT_INT64: + if (eval.val.i64 < 0) { + log_error(&tok->loginfo, "invalid negative bitfield width\n"); + goto failed; + } + width = (size_t)eval.val.i64; + break; + case NCT_UINT64: + width = (size_t)eval.val.u64; + break; + case NCT_FLOAT: + case NCT_DOUBLE: + case NCT_LDOUBLE: + default: + log_error(&tok->loginfo, "invalid non-integer bitfield width\n"); + goto failed; + } + + if (!vector_push(st_members, dest->structms.dest, + ((st_member_t){.name = cur_ident, .typ = typ, .is_bitfield = 1, .bitfield_width = width}))) { + log_memory("failed to add structure member %s\n", string_content(cur_ident)); + string_del(cur_ident); + // Empty destructor + goto failed; + } + if (validation == VALIDATION_LAST_DECL) goto success; + else { + cur_ident = NULL; has_ident = 0; + typ = base_type; ++typ->nrefs; + cur_bottom = NULL; + vector_last(size_t, nptr_stack) = 0; + *tok = proc_next_token(prep); + break; + } + } + /* FALLTHROUGH */ + case PTOK_KEYWORD: + if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_ATOMIC)) { + if (has_ident) { + log_error(&tok->loginfo, "invalid keyword '_Atomic' after identifier\n"); + proc_token_print(tok); + // Empty destructor + goto failed; + } else if (!vector_last(size_t, nptr_stack)) { + log_error(&tok->loginfo, "invalid keyword '_Atomic' before symbol '*'\n"); + proc_token_print(tok); + // Empty destructor + goto failed; + } else { + typ->is_atomic = 1; + *tok = proc_next_token(prep); + break; + } + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_CONST)) { + if (has_ident) { + log_error(&tok->loginfo, "invalid keyword 'const' after identifier\n"); + proc_token_print(tok); + // Empty destructor + goto failed; + } else if (!vector_last(size_t, nptr_stack)) { + log_error(&tok->loginfo, "invalid keyword 'const' before symbol '*'\n"); + proc_token_print(tok); + // Empty destructor + goto failed; + } else { + typ->is_const = 1; + *tok = proc_next_token(prep); + break; + } + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_RESTRICT)) { + if (has_ident) { + log_error(&tok->loginfo, "invalid keyword 'restrict' after identifier\n"); + proc_token_print(tok); + // Empty destructor + goto failed; + } else if (!vector_last(size_t, nptr_stack)) { + log_error(&tok->loginfo, "invalid keyword 'restrict' before symbol '*'\n"); + proc_token_print(tok); + // Empty destructor + goto failed; + } else { + typ->is_restrict = 1; + *tok = proc_next_token(prep); + break; + } + } else if ((tok->tokt == PTOK_KEYWORD) && (tok->tokv.kw == KW_VOLATILE)) { + if (has_ident) { + log_error(&tok->loginfo, "invalid keyword 'volatile' after identifier\n"); + proc_token_print(tok); + // Empty destructor + goto failed; + } else if (!vector_last(size_t, nptr_stack)) { + log_error(&tok->loginfo, "invalid keyword 'volatile' before symbol '*'\n"); + proc_token_print(tok); + // Empty destructor + goto failed; + } else { + typ->is_volatile = 1; + *tok = proc_next_token(prep); + break; + } + } + /* FALLTHROUGH */ + case PTOK_INVALID: + case PTOK_NUM: + case PTOK_STRING: + case PTOK_PRAGMA: + case PTOK_EOF: + log_error(&tok->loginfo, "unexpected token (in parse_declarator %d%d%d%d)\n", is_init, is_list, allow_decl, allow_abstract); + proc_token_del(tok); + goto failed; + } + } + +success: + vector_del(size_t, nptr_stack); + // typ has moved, we must not destroy it + return 1; +failed: + vector_del(size_t, nptr_stack); +failed0: + if (cur_ident) string_del(cur_ident); + type_del(typ); + return 0; +} + +static int finalize_file(machine_t *target, file_t *file) { +#define MARK_SIMPLE(sname) \ + it = kh_get(struct_map, file->struct_map, #sname); \ + if (it != kh_end(file->struct_map)) { \ + kh_val(file->struct_map, it)->is_simple = 1; \ + } else { \ + it = kh_get(type_map, file->type_map, #sname); \ + if (it != kh_end(file->type_map)) { \ + type_t *typ2 = kh_val(file->type_map, it); \ + if (typ2->typ != TYPE_STRUCT_UNION) { \ + log_error_nopos("invalid typedef " #sname ": not a structure\n"); \ + return 0; \ + } \ + typ2->val.st->is_simple = 1; \ + } \ + } +#define SET_WEAK(converted) \ + validate_type(&(loginfo_t){0}, target, typ); \ + typ = type_try_merge(typ, file->type_set); \ + it = kh_put(conv_map, file->relaxed_type_conversion, typ, &iret); \ + if (iret < 0) { \ + log_memory("failed to add relaxed conversion to type map\n"); \ + type_del(typ); \ + return 0; \ + } else if (iret == 0) { \ + log_error_nopos("type already has a relaxed conversion\n"); \ + type_del(typ); \ + return 0; \ + } \ + kh_val(file->relaxed_type_conversion, it) = string_new_cstr(#converted); +#define SET_WEAK_PTR_TO(to_typ, converted) \ + it = kh_get(type_map, file->type_map, #to_typ); \ + if (it != kh_end(file->type_map)) { \ + typ = type_new_ptr(kh_val(file->type_map, it)); \ + if (!typ) { \ + log_memory("failed to create type " #to_typ "*\n"); \ + return 0; \ + } \ + ++kh_val(file->type_map, it)->nrefs; \ + SET_WEAK(converted) \ + } + + type_t *typ; + int iret; + khiter_t it; + // #pragma type_letters S FILE* + SET_WEAK_PTR_TO(FILE, S) + // #pragma type_letters b xcb_connection_t* + if (target->size_long == 4) { + SET_WEAK_PTR_TO(xcb_connection_t, n) + } else { + SET_WEAK_PTR_TO(xcb_connection_t, b) + } + if (target->size_long == 4) { + // Only on x86, not on x86_64 + it = kh_get(type_map, file->type_map, "locale_t"); + if (it != kh_end(file->type_map)) { + typ = kh_val(file->type_map, it); + SET_WEAK(a) + } + } + // #pragma mark_simple ... + if (target->size_long == 8) { + // Only on x86_64, not on x86 + MARK_SIMPLE(FTS) + MARK_SIMPLE(FTS64) + MARK_SIMPLE(glob_t) + MARK_SIMPLE(glob64_t) + } +#undef MARK_SIMPLE +#undef SET_WEAK +#undef SET_WEAK_PTR_TO + return 1; +} + +file_t *parse_file(machine_t *target, const char *filename, FILE *file) { + char *dirname = strchr(filename, '/') ? strndup(filename, (size_t)(strrchr(filename, '/') - filename)) : NULL; + preproc_t *prep = preproc_new_file(target, file, dirname, filename); + if (!prep) { + log_memory("failed to create the preproc structure\n"); + if (dirname) free(dirname); + return NULL; + } + file_t *ret = file_new(target); + if (!ret) { + log_memory("failed to create the file structure\n"); + preproc_del(prep); + return NULL; + } + + type_t *typ = type_new(); + if (!typ) { + log_memory("failed to create a type info structure\n"); + goto failed; + } + while (1) { + proc_token_t tok = proc_next_token(prep); + if (tok.tokt == PTOK_EOF) { + goto success; + } else if ((tok.tokt == PTOK_SYM) && (tok.tokv.sym == SYM_SEMICOLON)) { + // Empty destructor + } else if (tok.tokt == PTOK_PRAGMA) { + switch (tok.tokv.pragma.typ) { + case PRAGMA_ALLOW_INTS: { + const char *typenames[] = {BTT_INT_EXTS}; + for (size_t i = 0; i < sizeof typenames / sizeof *typenames; ++i) { + int iret; + char *dup = strdup(typenames[i]); + if (!dup) { + log_memory("failed to create a type info structure\n"); + goto failed; + } + type_t *t = ret->builtins[BTT_START_INT_EXT + i]; + khiter_t it = kh_put(type_map, ret->type_map, dup, &iret); + if (iret < 0) { + log_memory("failed to add an intrinsic to the type map\n"); + goto failed; + } else if (iret == 0) { + if (!type_t_equal(t, kh_val(ret->type_map, it))) { + log_error(&tok.loginfo, "%s is already defined\n", dup); + free(dup); + goto failed; + } + free(dup); + } else { + ++t->nrefs; + kh_val(ret->type_map, it) = t; + } + } + break; } + case PRAGMA_SIMPLE_SU: { + string_t *sutag = tok.tokv.pragma.val; + struct_t *su; + khiter_t it = kh_get(struct_map, ret->struct_map, string_content(sutag)); + if (it != kh_end(ret->struct_map)) { + su = kh_val(ret->struct_map, it); + } else { + it = kh_get(type_map, ret->type_map, string_content(sutag)); + if (it != kh_end(ret->struct_map)) { + type_t *typ2 = kh_val(ret->type_map, it); + if (typ2->typ != TYPE_STRUCT_UNION) { + log_error(&tok.loginfo, "failed to find struct/union named %s\n", string_content(sutag)); + string_del(sutag); + goto failed; + } + su = typ2->val.st; + } else { + log_error(&tok.loginfo, "failed to find struct/union named %s\n", string_content(sutag)); + string_del(sutag); + goto failed; + } + } + string_del(sutag); + su->is_simple = 1; + // Empty destructor + break; } + case PRAGMA_EXPLICIT_CONV: { + string_t *converted = tok.tokv.pragma.val; + type_t *typ2 = type_new(); + if (!typ2) { + log_memory("failed to create new type info structure\n"); + string_del(converted); + type_del(typ2); + goto failed; + } + tok = proc_next_token(prep); + if (!parse_type_name(target, ret->struct_map, ret->type_map, ret->enum_map, &ret->builtins, ret->const_map, ret->type_set, + prep, &tok, SYM_SEMICOLON, &typ2)) { + string_del(converted); + goto failed; + } + int iret; + khiter_t it = kh_put(conv_map, ret->relaxed_type_conversion, typ2, &iret); + if (iret < 0) { + log_memory("failed to add relaxed conversion to type map\n"); + string_del(converted); + type_del(typ2); + // Empty destructor + goto failed; + } else if (iret == 0) { + log_error(&tok.loginfo, "type already has a relaxed conversion\n"); + string_del(converted); + type_del(typ2); + // Empty destructor + goto failed; + } + string_trim(converted); + kh_val(ret->relaxed_type_conversion, it) = converted; + // Empty destructor + break; } + case PRAGMA_EXPLICIT_CONV_STRICT: { + string_t *converted = tok.tokv.pragma.val; + type_t *typ2 = type_new(); + if (!typ2) { + log_memory("failed to create new type info structure\n"); + string_del(converted); + type_del(typ2); + goto failed; + } + tok = proc_next_token(prep); + if (!parse_type_name(target, ret->struct_map, ret->type_map, ret->enum_map, &ret->builtins, ret->const_map, ret->type_set, + prep, &tok, SYM_SEMICOLON, &typ2)) { + string_del(converted); + goto failed; + } + type_del(typ2); // typ2 is in the type set, so it is already used + if (typ2->converted) { + log_error(&tok.loginfo, "type already has a strict conversion\n"); + string_del(converted); + // Empty destructor + goto failed; + } + string_trim(converted); + typ2->converted = converted; + // Empty destructor + break; } + } + } else if (proc_token_iserror(&tok)) { + log_error(&tok.loginfo, "unexpected error token\n"); + proc_token_del(&tok); + goto failed; + } else { + enum decl_storage storage = TMPSTO_NONE; + enum fun_spec fspec = FSPEC_NONE; + enum decl_spec spec = SPEC_NONE; + if (!parse_declaration_specifier(target, ret->struct_map, ret->type_map, ret->enum_map, &ret->builtins, ret->const_map, + ret->type_set, prep, &tok, &storage, &fspec, &spec, typ)) { + goto failed; + } + if (spec == SPEC_NONE) continue; // Declaration was an assert, typ is unchanged + typ = type_try_merge(typ, ret->type_set); + if ((tok.tokt != PTOK_SYM) || (tok.tokv.sym != SYM_SEMICOLON)) { + if (!parse_declarator(target, &(struct parse_declarator_dest_s){.f = ret}, prep, &tok, storage, fspec, typ, 1, 1, 1, 0)) { + goto failed; + } + } else { + if (validate_storage_type(&tok.loginfo, target, storage, typ, tok.tokv.sym) != VALIDATION_LAST_DECL) { + goto failed; + } + if (fspec != FSPEC_NONE) { + log_error(&tok.loginfo, "unexpected function specifier\n"); + // Empty destructor + goto failed; + } + } + // Current token is ';' (or '}' for functions), ie. end of declaration + type_del(typ); + typ = type_new(); + if (!typ) { + log_memory("failed to create a type info structure\n"); + goto failed; + } + } + } + +success: + preproc_del(prep); + type_del(typ); + if (!finalize_file(target, ret)) { + log_memory("failed to add builtin aliases\n"); + file_del(ret); + return NULL; + } + return ret; +failed: + preproc_del(prep); + if (typ) type_del(typ); + file_del(ret); + return NULL; +} diff --git a/wrapperhelper/src/parse.h b/wrapperhelper/src/parse.h new file mode 100644 index 0000000..e80f32d --- /dev/null +++ b/wrapperhelper/src/parse.h @@ -0,0 +1,15 @@ +#pragma once + +#ifndef PARSE_H +#define PARSE_H + +#include + +#include "lang.h" +#include "machine.h" + +void dump_prepare(const char *filename, FILE *file); +void dump_preproc(machine_t *target, const char *filename, FILE *file); +file_t *parse_file(machine_t *target, const char *filename, FILE *file); + +#endif // PARSE_H diff --git a/wrapperhelper/src/prepare.c b/wrapperhelper/src/prepare.c new file mode 100644 index 0000000..464b793 --- /dev/null +++ b/wrapperhelper/src/prepare.c @@ -0,0 +1,583 @@ +#include "prepare.h" + +#include + +#include "log.h" + +static struct li_filename_s { + char *name; + struct li_filename_s *next; +} *li_filenames = NULL; + +typedef struct char_s { + int c; + loginfo_t li; +} char_t; + +struct prepare_s { + FILE *f; + char_t buf[5]; + int buf_len; // <= 5 (though 4 *should* be enough) + char *srcn; + loginfo_t li; + enum prepare_state { + PREPST_NONE = 0, + PREPST_NL, + PREPST_HASH, + PREPST_INCL, + PREPST_DEF, + PREPST_DEFID, + PREPST_COMMENT, + } st; +}; + +prepare_t *prepare_new_file(FILE *f, const char *filename) { + prepare_t *ret = malloc(sizeof *ret); + if (!ret) { + log_memory("failed to allocate new preparator structure\n"); + fclose(f); + return NULL; + } + + char *srcn = strdup(filename ? filename : ""); + if (!srcn) { + log_memory("failed to duplicate filename\n"); + free(ret); + return NULL; + } + struct li_filename_s *new_lifn = malloc(sizeof *new_lifn); + if (!new_lifn) { + log_memory("failed to remember new filename\n"); + free(srcn); + free(ret); + return NULL; + } + *new_lifn = (struct li_filename_s){ .name = srcn, .next = li_filenames }; + li_filenames = new_lifn; + + *ret = (prepare_t){ + .f = f, + .buf = {{0}, {0}, {0}, {0}}, + .buf_len = 0, + .srcn = srcn, + .li = { .filename = srcn, .lineno = 1, .colno = 1, .lineno_end = 0, .colno_end = 0 }, + .st = PREPST_NL, + }; + return ret; +} + +void prepare_del(prepare_t *prep) { + if (prep->f) fclose(prep->f); + free(prep); +} + +// Do not call this more than twice in a row if the last character retrieved is '\\' +static void unget_char(prepare_t *src, char_t c) { + src->buf[src->buf_len++] = c; +} +// Transforms \n, \r\n and \r into \n +static char_t get_char(prepare_t *src) { + if (src->buf_len) { + return src->buf[--src->buf_len]; + } +start_get_char: + int c = getc(src->f); + if (c == '\\') { + c = getc(src->f); + if (c == '\n') { + ++src->li.lineno; + src->li.colno = 1; + goto start_get_char; + } else if (c == '\r') { + ++src->li.lineno; + src->li.colno = 1; + c = getc(src->f); + if (c == '\n') { + goto start_get_char; + } else { + unget_char(src, (char_t){.c = c, .li = src->li}); + goto start_get_char; + } + } + src->li.colno += 2; + src->buf[src->buf_len++] = (char_t){ + .c = c, + .li = { .filename = src->li.filename, .lineno = src->li.lineno, .colno = src->li.colno - 1, .lineno_end = 0, .colno_end = 0 } + }; + return (char_t){ + .c = '\\', + .li = { .filename = src->li.filename, .lineno = src->li.lineno, .colno = src->li.colno - 2, .lineno_end = 0, .colno_end = 0 } + }; + } + char_t ret = { + .c = c, + .li = { .filename = src->li.filename, .lineno = src->li.lineno, .colno = src->li.colno, .lineno_end = 0, .colno_end = 0 } + }; + if (c == '\n') { + ++src->li.lineno; + src->li.colno = 1; + } else if (c == '\r') { + ++src->li.lineno; + src->li.colno = 1; + ret.c = '\n'; + c = getc(src->f); + if (c != '\n') { + unget_char(src, (char_t){.c = c, .li = src->li}); + } + } else { + ++src->li.colno; + } + return ret; +} + +static void fill_ident(prepare_t *src, string_t *buf, size_t *lineno_end, size_t *colno_end) { + while (1) { + char_t c = get_char(src); + if ((c.c == '_') || ((c.c >= '0') && (c.c <= '9')) || ((c.c >= 'A') && (c.c <= 'Z')) || ((c.c >= 'a') && (c.c <= 'z'))) { + string_add_char(buf, (char)c.c); + *lineno_end = c.li.lineno; + *colno_end = c.li.colno; + } else { + unget_char(src, c); + return; + } + } +} + +static void fill_num(prepare_t *src, string_t *buf, size_t *lineno_end, size_t *colno_end) { + int started_exp = 0; + while (1) { + char_t c = get_char(src); + if ((c.c == '_') || (c.c == '.') || ((c.c >= '0') && (c.c <= '9')) || ((c.c >= 'A') && (c.c <= 'Z')) || ((c.c >= 'a') && (c.c <= 'z')) + || (started_exp && ((c.c == '+') || (c.c == '-')))) { + started_exp = (c.c == 'e') || (c.c == 'E') || (c.c == 'p') || (c.c == 'P'); + string_add_char(buf, (char)c.c); + *lineno_end = c.li.lineno; + *colno_end = c.li.colno; + } else { + unget_char(src, c); + return; + } + } +} + +static void fill_str(prepare_t *src, string_t *buf, char end_c, int can_esc, size_t *lineno_end, size_t *colno_end) { + int has_esc = 0; + while (1) { + char_t c = get_char(src); + if (has_esc && (c.c >= 0) && (c.c <= 0x7F) && (c.c != '\n')) { + // Not technically standard compliant (should support \ooo, \x..., \u..., \U...) + // Since we don't really care about parsing the content, only the delimiters, this is good enough + string_add_char(buf, '\\'); + string_add_char(buf, (char)c.c); + has_esc = 0; + *lineno_end = c.li.lineno; + *colno_end = c.li.colno; + } else if (c.c == '\\') { + *lineno_end = c.li.lineno; + *colno_end = c.li.colno; + if (can_esc) { + has_esc = 1; + } else { + string_add_char(buf, '\\'); + } + } else if ((c.c >= 0) && (c.c <= 0x7F) && (c.c != '\n') && (c.c != end_c)) { + has_esc = 0; + string_add_char(buf, (char)c.c); + *lineno_end = c.li.lineno; + *colno_end = c.li.colno; + } else { + // c.c is invalid (> 0x80) or a '\n', or can_esc = 0 and c.c = end_c + if (has_esc) { + string_add_char(buf, '\\'); + } + if (c.c != end_c) { + unget_char(src, c); + } else { + *lineno_end = c.li.lineno; + *colno_end = c.li.colno; + } + return; + } + } +} + +#define BASE_NSYMS 25 +static const struct symbs_s { + char c; + enum token_sym_type_e sym; + int nnext; + const struct symbs_s *next; +} *symbs = (struct symbs_s[BASE_NSYMS]){ +#define TERM(ch, t) { .c = ch, .sym = t, .nnext = 0, .next = NULL } +#define NONTERM(ch, t, n, ...) { .c = ch, .sym = t, .nnext = n, .next = (struct symbs_s[n]){__VA_ARGS__} } + // Only '..' must have a sym > LAST_SYM; change next_token if this is not the case + NONTERM('.', SYM_DOT, 1, NONTERM('.', LAST_SYM + 1, 1, TERM('.', SYM_VARIADIC))), + TERM('{', SYM_LBRACKET), + TERM('}', SYM_RBRACKET), + TERM('[', SYM_LSQBRACKET), + TERM(']', SYM_RSQBRACKET), + TERM('(', SYM_LPAREN), + TERM(')', SYM_RPAREN), + NONTERM('#', SYM_HASH, 1, TERM('#', SYM_HASHHASH)), + TERM(';', SYM_SEMICOLON), + NONTERM(':', SYM_COLON, 1, TERM(':', SYM_COLONCOLON)), + TERM('?', SYM_QUESTION), + TERM('~', SYM_TILDE), + NONTERM('!', SYM_EXCL, 1, TERM('=', SYM_EXCLEQ)), + NONTERM('+', SYM_PLUS, 2, TERM('=', SYM_PLUSEQ), TERM('+', SYM_PLUSPLUS)), + NONTERM('-', SYM_DASH, 3, TERM('=', SYM_DASHEQ), TERM('-', SYM_DASHDASH), TERM('>', SYM_DASHGT)), + NONTERM('*', SYM_STAR, 1, TERM('=', SYM_STAREQ)), + NONTERM('/', SYM_SLASH, 1, TERM('=', SYM_SLASHEQ)), + NONTERM('%', SYM_PERCENT, 1, TERM('=', SYM_PERCENTEQ)), + NONTERM('^', SYM_HAT, 1, TERM('=', SYM_HATEQ)), + NONTERM('&', SYM_AMP, 2, TERM('=', SYM_AMPEQ), TERM('&', SYM_AMPAMP)), + NONTERM('|', SYM_PIPE, 2, TERM('=', SYM_PIPEEQ), TERM('|', SYM_PIPEPIPE)), + NONTERM('=', SYM_EQ, 1, TERM('=', SYM_EQEQ)), + NONTERM('<', SYM_LT, 2, TERM('=', SYM_LTEQ), NONTERM('<', SYM_LTLT, 1, TERM('=', SYM_LTLTEQ))), + NONTERM('>', SYM_GT, 2, TERM('=', SYM_GTEQ), NONTERM('>', SYM_GTGT, 1, TERM('=', SYM_GTGTEQ))), + TERM(',', SYM_COMMA), +#undef NONTERM +#undef TERM +}; + +preproc_token_t pre_next_token(prepare_t *src, int allow_comments) { + if (src->st == PREPST_COMMENT) { + // In comments, keep everything as 'BLANK' except for idents, newlines and EOF + char_t c = get_char(src); + if (c.c == EOF) { + // Force newline at EOF + unget_char(src, c); + src->st = PREPST_NL; + return (preproc_token_t){ + .tokt = PPTOK_NEWLINE, + .loginfo = c.li, + .tokv.c = (char)c.c + }; + } else if ((c.c == '_') || ((c.c >= 'a') && (c.c <= 'z')) || ((c.c >= 'A') && (c.c <= 'Z'))) { + preproc_token_t ret; + ret.tokt = PPTOK_IDENT; + ret.loginfo = c.li; + ret.tokv.str = string_new_cap(1); + string_add_char(ret.tokv.str, (char)c.c); + fill_ident(src, ret.tokv.str, &ret.loginfo.lineno_end, &ret.loginfo.colno_end); + return ret; + } else if ((c.c >= 0) && (c.c <= 0x7F)) { + return (preproc_token_t){ + .tokt = PPTOK_BLANK, + .loginfo = c.li, + .tokv.c = (char)c.c + }; + } else { + return (preproc_token_t){ + .tokt = PPTOK_INVALID, + .loginfo = c.li, + .tokv.c = (char)c.c + }; + } + } + +start_next_token: + char_t c = get_char(src); + if (c.c == EOF) { + if (src->st == PREPST_NL) { + return (preproc_token_t){ + .tokt = PPTOK_EOF, + .loginfo = c.li, + .tokv.c = (char)c.c + }; + } else { + // Force newline at EOF + unget_char(src, c); + src->st = PREPST_NL; + return (preproc_token_t){ + .tokt = PPTOK_NEWLINE, + .loginfo = c.li, + .tokv.c = (char)c.c + }; + } + } + + if (src->st == PREPST_INCL && (c.c == '<')) { + src->st = PREPST_NONE; + preproc_token_t ret; + ret.tokt = PPTOK_INCL; + ret.loginfo = c.li; + ret.tokv.sisstr = 0; + ret.tokv.sstr = string_new(); + fill_str(src, ret.tokv.sstr, '>', 0, &ret.loginfo.lineno_end, &ret.loginfo.colno_end); + return ret; + } + if (c.c == '\'') { + src->st = PREPST_NONE; + preproc_token_t ret; + ret.tokt = PPTOK_STRING; + ret.loginfo = c.li; + ret.tokv.sisstr = 0; + ret.tokv.sstr = string_new_cap(1); // Usually only one character is inside a char literal + fill_str(src, ret.tokv.sstr, '\'', 1, &ret.loginfo.lineno_end, &ret.loginfo.colno_end); + return ret; + } + if (c.c == '"') { + preproc_token_t ret; + ret.tokt = (src->st == PREPST_INCL) ? PPTOK_INCL : PPTOK_STRING; + src->st = PREPST_NONE; + ret.loginfo = c.li; + ret.tokv.sisstr = 1; + ret.tokv.sstr = string_new(); + fill_str(src, ret.tokv.sstr, '"', ret.tokt == PPTOK_STRING, &ret.loginfo.lineno_end, &ret.loginfo.colno_end); + return ret; + } + if ((c.c == ' ') || (c.c == '\f') || (c.c == '\t') || (c.c == '\v')) { + if (src->st == PREPST_DEFID) { + src->st = PREPST_NONE; + return (preproc_token_t){ + .tokt = PPTOK_BLANK, + .loginfo = c.li, + .tokv.c = (char)c.c + }; + } else goto start_next_token; + } + if (c.c == '\n') { + src->st = PREPST_NL; + return (preproc_token_t){ + .tokt = PPTOK_NEWLINE, + .loginfo = c.li, + .tokv.c = (char)c.c + }; + } + if ((c.c == '_') || ((c.c >= 'a') && (c.c <= 'z')) || ((c.c >= 'A') && (c.c <= 'Z'))) { + preproc_token_t ret; + ret.tokt = PPTOK_IDENT; + ret.loginfo = c.li; + ret.tokv.str = string_new_cap(1); + string_add_char(ret.tokv.str, (char)c.c); + fill_ident(src, ret.tokv.str, &ret.loginfo.lineno_end, &ret.loginfo.colno_end); + src->st = + ((src->st == PREPST_HASH) && (!strcmp(string_content(ret.tokv.str), "include"))) ? PREPST_INCL : + ((src->st == PREPST_HASH) && (!strcmp(string_content(ret.tokv.str), "include_next"))) ? PREPST_INCL : + ((src->st == PREPST_HASH) && (!strcmp(string_content(ret.tokv.str), "define"))) ? PREPST_DEF : + (src->st == PREPST_DEF) ? PREPST_DEFID : + PREPST_NONE; + return ret; + } + if ((c.c >= '0') && (c.c <= '9')) { + src->st = PREPST_NONE; + preproc_token_t ret; + ret.tokt = PPTOK_NUM; + ret.loginfo = c.li; + ret.tokv.str = string_new_cap(1); + string_add_char(ret.tokv.str, (char)c.c); + fill_num(src, ret.tokv.str, &ret.loginfo.lineno_end, &ret.loginfo.colno_end); + return ret; + } + if (c.c == '.') { + loginfo_t oldli = c.li; + c = get_char(src); + if ((c.c >= '0') && (c.c <= '9')) { + src->st = PREPST_NONE; + preproc_token_t ret; + ret.tokt = PPTOK_NUM; + ret.loginfo = oldli; + ret.loginfo.lineno_end = c.li.lineno; + ret.loginfo.colno_end = c.li.colno; + ret.tokv.str = string_new_cap(2); + string_add_char(ret.tokv.str, '.'); + string_add_char(ret.tokv.str, (char)c.c); + fill_num(src, ret.tokv.str, &ret.loginfo.lineno_end, &ret.loginfo.colno_end); + return ret; + } else { + unget_char(src, c); + c.c = '.'; + c.li = oldli; + } + } + if (c.c == '/') { + char_t c2 = get_char(src); + if (c2.c == '/') { + if (allow_comments) { + src->st = PREPST_COMMENT; + return (preproc_token_t){ + .tokt = PPTOK_START_LINE_COMMENT, + .loginfo = { + .filename = c2.li.filename, + .lineno = c.li.lineno, .colno = c.li.colno, + .lineno_end = c2.li.lineno, .colno_end = c2.li.colno, + }, + .tokv.c = '/', + }; + } + + do { + c2 = get_char(src); + } while ((c2.c != EOF) && (c2.c != '\n')); + if (c2.c != EOF) { + if (src->st == PREPST_NL) + goto start_next_token; + else { + src->st = PREPST_NL; + return (preproc_token_t){ + .tokt = PPTOK_NEWLINE, + .loginfo = c2.li, + .tokv.c = (char)c2.c + }; + } + } + + // Force newline at EOF + unget_char(src, c2); + src->st = PREPST_NL; + return (preproc_token_t){ + .tokt = PPTOK_NEWLINE, + .loginfo = c2.li, + .tokv.c = (char)c2.c + }; + } else if (c2.c == '*') { + if (allow_comments) { + c.li.lineno_end = c2.li.lineno; + c.li.colno_end = c2.li.colno; + log_error(&c.li, "unsupported multiline comment with allow_comment\n"); + return (preproc_token_t){ + .tokt = PPTOK_INVALID, + .loginfo = c.li, + .tokv.c = (char)c.c + }; + } + + c2 = get_char(src); + int last_star = 0; + while ((c2.c != EOF) && (!last_star || (c2.c != '/'))) { + last_star = c2.c == '*'; + c2 = get_char(src); + } + if (c2.c != EOF) goto start_next_token; + + c.li.lineno_end = c2.li.lineno; + c.li.colno_end = c2.li.colno; + log_error(&c.li, "unfinished multiline comment\n"); + src->st = PREPST_NONE; + return (preproc_token_t){ + .tokt = PPTOK_INVALID, + .loginfo = c2.li, + .tokv.c = (char)c2.c + }; + } else { + unget_char(src, c2); + } + } + + struct symbs_s const *sym = NULL; + for (int i = 0; i < BASE_NSYMS; ++i) { + if (c.c == symbs[i].c) { + sym = &symbs[i]; + break; + } + } + if (sym) { + loginfo_t lisym = c.li; + loginfo_t liend = c.li; + while (sym->nnext) { + c = get_char(src); + int found = 0; + for (int i = 0; i < sym->nnext; ++i) { + if (c.c == sym->next[i].c) { + found = 1; + sym = &sym->next[i]; + liend = c.li; + lisym.lineno_end = c.li.lineno; + lisym.colno_end = c.li.colno; + break; + } + } + if (!found) { + unget_char(src, c); + break; + } + } + if (sym->sym == LAST_SYM + 1) { + // This is where no check is made (see comment in the definition of symbs) + unget_char(src, (char_t){.c = sym->c, .li = liend}); + sym = &symbs[0]; + lisym.lineno_end = lisym.colno_end = 0; + } + src->st = ((src->st == PREPST_NL) && (sym->sym == SYM_HASH)) ? PREPST_HASH : PREPST_NONE; + return (preproc_token_t){ + .tokt = PPTOK_SYM, + .loginfo = lisym, + .tokv.sym = sym->sym + }; + } + + src->st = PREPST_NONE; + log_error(&c.li, "invalid character 0x%02X (%c)\n", (unsigned)c.c, (c.c >= 0x20) && (c.c < 0x7F) ? c.c : '?'); + return (preproc_token_t){ + .tokt = PPTOK_INVALID, + .loginfo = c.li, + .tokv.c = (char)c.c, + }; +} + +void prepare_set_line(prepare_t *src, char *filename, size_t lineno) { + if (filename) { + char *srcn = strdup(filename ? filename : ""); + if (!srcn) { + log_memory("failed to duplicate filename from #line command\n"); + return; + } + struct li_filename_s *new_lifn = malloc(sizeof *new_lifn); + if (!new_lifn) { + log_memory("failed to remember new filename from #line command\n"); + free(srcn); + return; + } + *new_lifn = (struct li_filename_s){ .name = srcn, .next = li_filenames }; + li_filenames = new_lifn; + src->srcn = srcn; + src->li.filename = srcn; + } + size_t colno = 1; + for (int i = src->buf_len; i--; ) { + src->buf[i].li.lineno = lineno; + src->buf[i].li.colno = colno; + if (src->buf[i].c == '\n') { + ++lineno; + colno = 1; + } else { + ++colno; + } + } + src->li.lineno = lineno; + src->li.colno = colno; +} + +// Warning: unsafe method +void prepare_mark_nocomment(prepare_t *src) { + src->st = PREPST_NONE; +} +int pre_next_newline_token(prepare_t *src, string_t *buf) { + while (1) { + char_t c = get_char(src); + if (c.c == EOF) { + // Force newline at EOF + unget_char(src, c); + src->st = PREPST_NL; + return 1; + } else if (c.c == '\n') { + src->st = PREPST_NL; + return 1; + } else if ((c.c >= 0) && (c.c <= 0x7F)) { + if (!string_add_char(buf, (char)c.c)) return 0; + } else { + return 0; + } + } +} + +void prepare_cleanup(void) { + while (li_filenames) { + struct li_filename_s *lifn = li_filenames->next; + free(li_filenames->name); + free(li_filenames); + li_filenames = lifn; + } +} diff --git a/wrapperhelper/src/prepare.h b/wrapperhelper/src/prepare.h new file mode 100644 index 0000000..bcf4e78 --- /dev/null +++ b/wrapperhelper/src/prepare.h @@ -0,0 +1,24 @@ +#pragma once + +#ifndef PREPARE_H +#define PREPARE_H + +#include + +#include "cstring.h" +#include "lang.h" + +typedef struct prepare_s prepare_t; + +prepare_t *prepare_new_file(FILE *f, const char *filename); // Takes ownership of f +void prepare_del(prepare_t *src); +preproc_token_t pre_next_token(prepare_t *src, int allow_comments); + +void prepare_set_line(prepare_t *src, char *filename, size_t lineno); // Takes ownership of filename if != NULL + +void prepare_mark_nocomment(prepare_t *src); // Change the state (usually from COMMENT) to NONE +int pre_next_newline_token(prepare_t *src, string_t *buf); // In a comment append everything until the EOL or EOF to the buffer + +void prepare_cleanup(void); // Frees loginfo filenames + +#endif // PREPARE_H diff --git a/wrapperhelper/src/preproc.c b/wrapperhelper/src/preproc.c new file mode 100644 index 0000000..272e048 --- /dev/null +++ b/wrapperhelper/src/preproc.c @@ -0,0 +1,3315 @@ +// I think this file is too big for GCC to handle properly, there are curious false-positive analyzer warnings +// that didn't appear before adding preproc_eval +#include "preproc.h" + +#include +#include + +#include "cstring.h" +#include "khash.h" +#include "machine.h" +#include "prepare.h" + +//#define LOG_OPEN +//#define LOG_INCLUDE +//#define LOG_CLOSE + +typedef struct mtoken_s { + enum mtoken_e { + MTOK_TOKEN, + MTOK_ARG, + MTOK_STRINGIFY, + MTOK_CONCAT, + } typ; + union { + preproc_token_t tok; + unsigned argid; + struct { struct mtoken_s *l, *r; } concat; + } val; +} mtoken_t; +static void mtoken_del(mtoken_t *tok) { + switch (tok->typ) { + case MTOK_TOKEN: + preproc_token_del(&tok->val.tok); + free(tok); + return; + + case MTOK_CONCAT: + mtoken_del(tok->val.concat.l); + mtoken_del(tok->val.concat.r); + free(tok); + return; + + case MTOK_ARG: + case MTOK_STRINGIFY: + free(tok); + return; + } +} + +KHASH_MAP_INIT_STR(argid_map, unsigned) +static void argid_map_del(khash_t(argid_map) *args) { + kh_cstr_t str; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" + kh_foreach_key(args, str, free((void*)str)) +#pragma GCC diagnostic pop + kh_destroy(argid_map, args); +} +static mtoken_t *mtoken_new_token(preproc_token_t tok) { + mtoken_t *ret = malloc(sizeof *ret); + if (!ret) return NULL; + ret->typ = MTOK_TOKEN; + ret->val.tok = tok; + return ret; +} +static mtoken_t *mtoken_new_arg(unsigned argid, int as_string) { + mtoken_t *ret = malloc(sizeof *ret); + if (!ret) return NULL; + ret->typ = as_string ? MTOK_STRINGIFY : MTOK_ARG; + ret->val.argid = argid; + return ret; +} +static mtoken_t *mtoken_new_concat(mtoken_t *l, mtoken_t *r) { // Takes ownership of l and r + mtoken_t *ret = malloc(sizeof *ret); + if (!ret) { + mtoken_del(l); + mtoken_del(r); + return NULL; + } + ret->typ = MTOK_CONCAT; + ret->val.concat.l = l; + ret->val.concat.r = r; + return ret; +} + +static inline void macro_tok_print(mtoken_t *m) { + switch (m->typ) { + case MTOK_TOKEN: + printf("token type %u", m->val.tok.tokt); + if (m->val.tok.tokt == PPTOK_IDENT) printf(" IDENT '%s'", string_content(m->val.tok.tokv.str)); + if (m->val.tok.tokt == PPTOK_NUM ) printf(" NUM %s", string_content(m->val.tok.tokv.str)); + if (m->val.tok.tokt == PPTOK_SYM) printf(" SYM %s", sym2str[m->val.tok.tokv.sym]); + return; + + case MTOK_ARG: + printf("argument %u", m->val.argid); + return; + + case MTOK_CONCAT: + printf("concat {"); + macro_tok_print(m->val.concat.l); + printf("} {"); + macro_tok_print(m->val.concat.r); + printf("}"); + return; + + case MTOK_STRINGIFY: + printf("string argument %u", m->val.argid); + return; + } +} + +VECTOR_DECLARE_STATIC(mtoken, mtoken_t*) +#define mtoken_ptr_del(m) mtoken_del(*(m)) +VECTOR_IMPL_STATIC(mtoken, mtoken_ptr_del) +#undef mtoken_ptr_del + +typedef struct macro_s { + int is_funlike; + int has_varargs; + unsigned nargs; + VECTOR(mtoken) *toks; +} macro_t; + +KHASH_MAP_INIT_STR(macros_map, macro_t) +KHASH_SET_INIT_STR(string_set) +static void macro_del(macro_t *m) { + vector_del(mtoken, m->toks); +} +static void macros_map_del(khash_t(macros_map) *args) { + kh_cstr_t str; + macro_t *it; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" + kh_foreach_key_value_ref(args, str, it, free((void*)str); macro_del(it)) +#pragma GCC diagnostic pop + kh_destroy(macros_map, args); +} +static void macros_set_del(khash_t(string_set) *strset) { + kh_cstr_t str; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" + kh_foreach_key(strset, str, free((void*)str)) +#pragma GCC diagnostic pop + kh_destroy(string_set, strset); +} + +typedef struct ppsource_s { + enum ppsrc_e { + PPSRC_PREPARE = 0, + PPSRC_PPTOKEN, + PPSRC_PPTOKENS, // Currently, only pushed after macro expansion when the expansion is not empty + PPSRC_PTOKEN, + } srct; + union { + struct { + prepare_t *st; + char *old_dirname; + char *old_filename; + _Bool was_sys; + size_t old_pathno; + // Note: char is used for the depths, which gives a max depth of 256 #ifs before the program silently bugs + unsigned char entered_next_ok_cond; + unsigned char ok_depth, cond_depth; + } prep; + preproc_token_t pptok; + struct { + VECTOR(preproc) *toks; // Cannot contain a #if, #else, ... statement, they *must* come from a prepare_t + size_t idx; + } pptoks; + proc_token_t ptok; // Added by proc_unget_token + } srcv; +} ppsource_t; +static void ppsource_del(ppsource_t *src) { + switch (src->srct) { + case PPSRC_PREPARE: + // st may be NULL if we failed to create the prepare_t* in preproc_new_file() + if (src->srcv.prep.st) prepare_del(src->srcv.prep.st); + if (src->srcv.prep.old_dirname) free(src->srcv.prep.old_dirname); + if (src->srcv.prep.old_filename) free(src->srcv.prep.old_filename); + return; + + case PPSRC_PPTOKEN: + preproc_token_del(&src->srcv.pptok); + return; + + case PPSRC_PPTOKENS: + // Do not delete the tokens that escaped, only the remaining tokens and the vector + vector_del_free_from(preproc, src->srcv.pptoks.toks, src->srcv.pptoks.idx); + return; + + case PPSRC_PTOKEN: + proc_token_del(&src->srcv.ptok); + return; + } +} +#define PREPARE_NEW_FILE(f, fn, old_fn, old_dn, was_sys_, old_no) (ppsource_t){ .srct = PPSRC_PREPARE, \ + .srcv.prep = { .st = prepare_new_file((f), (fn)), .old_dirname = (old_dn), .old_filename = (old_fn), .was_sys = was_sys_, \ + .old_pathno = old_no, .entered_next_ok_cond = 0, .ok_depth = 0, .cond_depth = 0 } } +VECTOR_DECLARE_STATIC(ppsource, ppsource_t) +VECTOR_IMPL_STATIC(ppsource, ppsource_del) + +struct preproc_s { + machine_t *target; + VECTOR(ppsource) *prep; + VECTOR(ccharp) *pragma_once; + enum preproc_state_e { + PPST_NONE, + PPST_NL, + PPST_PRAGMA_EXPLICIT, + } st; + khash_t(macros_map) *macros_map; + khash_t(string_set) *macros_defined, *macros_used; + char *dirname; + char *cur_file; + _Bool is_sys; + size_t cur_pathno; +}; + +void preproc_del(preproc_t *src) { + vector_del(ppsource, src->prep); + macros_set_del(src->macros_used); + macros_set_del(src->macros_defined); + macros_map_del(src->macros_map); + if (src->dirname) free(src->dirname); + if (src->cur_file) free(src->cur_file); + vector_del(ccharp, src->pragma_once); + free(src); +} + +static preproc_token_t ppsrc_next_token(preproc_t *src) { + switch (vector_last(ppsource, src->prep).srct) { + case PPSRC_PREPARE: + return pre_next_token(vector_last(ppsource, src->prep).srcv.prep.st, 0); + + case PPSRC_PPTOKEN: { + preproc_token_t ret = vector_last(ppsource, src->prep).srcv.pptok; + vector_pop_nodel(ppsource, src->prep); + return ret; } + + case PPSRC_PPTOKENS: { + ppsource_t *tmp = &vector_last(ppsource, src->prep); + preproc_token_t ret = vector_content(preproc, tmp->srcv.pptoks.toks)[tmp->srcv.pptoks.idx++]; + if (tmp->srcv.pptoks.idx >= vector_size(preproc, tmp->srcv.pptoks.toks)) { + vector_del_freed(preproc, tmp->srcv.pptoks.toks); + vector_pop_nodel(ppsource, src->prep); + } + return ret; } + + case PPSRC_PTOKEN: + default: + return (preproc_token_t){ .tokt = PPTOK_INVALID, .tokv.c = 0 }; + } +} + +static int try_open_dir(preproc_t *src, string_t *filename) { + size_t fnlen = string_len(filename); + size_t incl_len = src->dirname ? strlen(src->dirname) : 1; + char *fn = malloc(incl_len + fnlen + 2); + if (!fn) return 0; + if (src->dirname) { + memcpy(fn, src->dirname, incl_len); + fn[incl_len] = '/'; + } else { + fn[0] = '.'; + fn[1] = '/'; + } + strcpy(fn + incl_len + 1, string_content(filename)); + int has_once = 0; + vector_for(ccharp, fname, src->pragma_once) { + if (!strcmp(*fname, fn)) { + has_once = 1; + break; + } + } + if (has_once) { +#ifdef LOG_INCLUDE + printf("Skipping opening %s as cur header: '%s' in pragma_once\n", string_content(filename), fn); +#endif + free(fn); + return 1; + } else { + FILE *f = fopen(fn, "r"); +#ifdef LOG_OPEN + printf("Trying %s: %p\n", fn, f); +#endif + if (f) { + char *new_dirname = strchr(fn, '/') ? strndup(fn, (size_t)(strrchr(fn, '/') - fn)) : NULL; + int ret = vector_push(ppsource, src->prep, PREPARE_NEW_FILE(f, fn, src->cur_file, src->dirname, src->is_sys, src->cur_pathno)); + if (ret) { + src->is_sys = 0; + src->cur_file = fn; + src->dirname = new_dirname; + src->cur_pathno = 0; + } + return ret; + } else { + free(fn); + return 0; + } + } +} +static int try_open_sys(preproc_t *src, string_t *filename, size_t array_off) { + size_t fnlen = string_len(filename); + for (; array_off < src->target->npaths; ++array_off) { + size_t incl_len = strlen(src->target->include_path[array_off]); + char *fn = malloc(incl_len + fnlen + 2); + if (!fn) return 0; + memcpy(fn, src->target->include_path[array_off], incl_len); + fn[incl_len] = '/'; + strcpy(fn + incl_len + 1, string_content(filename)); + int has_once = 0; + vector_for(ccharp, fname, src->pragma_once) { + if (!strcmp(*fname, fn)) { + has_once = 1; + break; + } + } + if (has_once) { +#ifdef LOG_INCLUDE + printf("Skipping opening %s as system header: '%s' in pragma_once\n", string_content(filename), fn); +#endif + free(fn); + return 1; + } else { + FILE *f = fopen(fn, "r"); +#ifdef LOG_OPEN + printf("Trying %s: %p\n", fn, f); +#endif + if (f) { + char *new_dirname = strchr(fn, '/') ? strndup(fn, (size_t)(strrchr(fn, '/') - fn)) : NULL; + int ret = vector_push(ppsource, src->prep, PREPARE_NEW_FILE(f, fn, src->cur_file, src->dirname, src->is_sys, src->cur_pathno)); + if (ret) { + src->is_sys = 1; + src->cur_file = fn; + src->dirname = new_dirname; + src->cur_pathno = array_off + 1; + } + return ret; + } + free(fn); + } + } + return 0; +} + +preproc_t *preproc_new_file(machine_t *target, FILE *f, char *dirname, const char *filename) { + preproc_t *ret = malloc(sizeof *ret); + if (!ret) { + fclose(f); + return NULL; + } + ret->target = target; + ret->macros_map = kh_init(macros_map); + if (!ret->macros_map) { + fclose(f); + free(ret); + return NULL; + } + ret->macros_defined = kh_init(string_set); + if (!ret->macros_defined) { + kh_destroy(macros_map, ret->macros_map); + fclose(f); + free(ret); + return NULL; + } + ret->macros_used = kh_init(string_set); + if (!ret->macros_used) { + kh_destroy(macros_map, ret->macros_map); + kh_destroy(string_set, ret->macros_defined); + fclose(f); + free(ret); + return NULL; + } + ret->prep = vector_new_cap(ppsource, 1); + if (!ret->prep) { + kh_destroy(macros_map, ret->macros_map); + kh_destroy(string_set, ret->macros_defined); + kh_destroy(string_set, ret->macros_used); + fclose(f); + free(ret); + return NULL; + } + ret->pragma_once = vector_new(ccharp); + if (!ret->pragma_once) { + vector_del(ppsource, ret->prep); + kh_destroy(macros_map, ret->macros_map); + kh_destroy(string_set, ret->macros_defined); + kh_destroy(string_set, ret->macros_used); + fclose(f); + free(ret); + return NULL; + } + ret->dirname = NULL; + ret->cur_file = NULL; + // ret can now be deleted by preproc_del + + // Include the first file + if (!vector_push(ppsource, ret->prep, PREPARE_NEW_FILE(f, filename, NULL, NULL, 0, 0))) { + preproc_del(ret); + return NULL; + } + if (!vector_last(ppsource, ret->prep).srcv.prep.st) { + preproc_del(ret); + return NULL; + } + // Next finish setting up ret + ret->st = PPST_NL; + ret->is_sys = 0; + ret->dirname = dirname; + ret->cur_file = strdup(filename); + ret->cur_pathno = 0; + + // Also include 'stdc-predef.h' (it will be parsed before the requested file) + string_t *stdc_predef = string_new_cstr("stdc-predef.h"); + if (!stdc_predef) { + log_memory("failed to create new string 'stdc-predef.h'\n"); + preproc_del(ret); + return NULL; + } + if (!try_open_sys(ret, stdc_predef, 0)) { + log_error_nopos("failed to open file 'stdc-predef.h'\n"); + string_del(stdc_predef); + preproc_del(ret); + return NULL; + } + string_del(stdc_predef); + + return ret; +} + +static void preprocs_del(VECTOR(preproc) **p) { + if (!*p) return; + vector_del(preproc, *p); +} +VECTOR_DECLARE_STATIC(preprocs, VECTOR(preproc)*) +VECTOR_IMPL_STATIC(preprocs, preprocs_del) + +static VECTOR(preproc) *preproc_do_expand(loginfo_t *li, const khash_t(macros_map) *macros, const VECTOR(preproc) *toks, + khash_t(string_set) *solved_macros, khash_t(string_set) *opt_used_macros); + // Does not take any ownership, returns a vector with independent ownerships + // opt_used_macros is NULL in regular expansion, non-NULL in #if-expansions +static VECTOR(preproc) *preproc_solve_macro(loginfo_t *li, + const khash_t(macros_map) *macros, char *mname, const macro_t *m, VECTOR(preprocs) *margs, + khash_t(string_set) *solved_macros, khash_t(string_set) *opt_used_macros); + // Moves mname to solved_macros or frees mname, returns a vector with independent ownerships + // margs may be NULL if m->is_funlike is false + // May change margs if m->has_varargs, but takes no ownership + // opt_used_macros is NULL in regular expansion, non-NULL in #if-expansions + +static VECTOR(preproc) *preproc_solve_macro(loginfo_t *li, + const khash_t(macros_map) *macros, char *mname, const macro_t *m, VECTOR(preprocs) *margs, + khash_t(string_set) *solved_macros, khash_t(string_set) *opt_used_macros) { +#define LOG_MEMORY(fmt, ...) log_memory(fmt " while expanding %s\n" __VA_ARGS__, mname) + if (m->is_funlike && !margs) { + log_internal(li, "m->is_funlike && !margs in preproc_solve_macro(... %s ...)\n", mname); + free(mname); + return NULL; + } + if (m->is_funlike + && (m->nargs != vector_size(preprocs, margs)) // General case + && (!m->has_varargs || (m->nargs > vector_size(preprocs, margs))) // Variadics + && (m->nargs || ((vector_size(preprocs, margs) == 1) && (vector_size(preproc, vector_last(preprocs, margs)) == 0)))) { // Zero argument + log_error(li, "invalid argument count for macro %s\n", mname); + free(mname); + return NULL; + } + if (m->has_varargs) { + // Change margs to have the correct __VA_ARGS__ (argument m->nargs) + if (m->nargs == vector_size(preprocs, margs)) { + // No varargs, so add an empty one + VECTOR(preproc) *marg = vector_new(preproc); + if (!marg) { + LOG_MEMORY("failed to create __VA_ARGS__"); + free(mname); + return NULL; + } + if (!vector_push(preprocs, margs, marg)) { + LOG_MEMORY("failed to add __VA_ARGS__"); + vector_del(preproc, marg); + free(mname); + return NULL; + } + } else if (m->nargs < vector_size(preprocs, margs) - 1) { + // Too many arguments, merge them with commas + VECTOR(preproc) *mvarg = vector_content(preprocs, margs)[m->nargs]; + size_t size0 = vector_size(preproc, mvarg); + vector_for_from(preprocs, it, margs, m->nargs + 1) { + if (!vector_push(preproc, mvarg, ((preproc_token_t){.tokt = PPTOK_SYM, .tokv.sym = SYM_COMMA}))) { + LOG_MEMORY("failed to add comma to __VA_ARGS__"); + vector_pop_nodel_slice(preproc, mvarg, vector_size(preproc, mvarg) - size0); + free(mname); + return NULL; + } + if (!vector_push_vec(preproc, mvarg, *it)) { + LOG_MEMORY("failed to add extra argument to __VA_ARGS__"); + vector_pop_nodel_slice(preproc, mvarg, vector_size(preproc, mvarg) - size0); + free(mname); + return NULL; + } + } + vector_pop_nodel_slice(preprocs, margs, vector_size(preprocs, margs) - m->nargs - 1); + } + } + // Avoid 0-allocations + VECTOR(preproc) **margs2 = calloc(margs ? (vector_size(preprocs, margs) ? vector_size(preprocs, margs) : 1) : 1, sizeof *margs2); + if (!margs2) { + LOG_MEMORY("failed to allocate expanded arguments array"); + free(mname); + return NULL; + } + VECTOR(preproc) *ret = vector_new(preproc); + if (!ret) { + LOG_MEMORY("failed to allocate return vector"); + free(margs2); + free(mname); + return NULL; + } + + VECTOR(mtoken) *st = vector_new_cap(mtoken, vector_size(mtoken, m->toks)); + if (!st) { + LOG_MEMORY("failed to allocate auxiliary vector"); + vector_del(preproc, ret); + free(margs2); + free(mname); + return NULL; + } + vector_for_rev(mtoken, mtok, m->toks) { + vector_push(mtoken, st, *mtok); + } + int need_concat = 0, concat_cur = 0; + while (vector_size(mtoken, st)) { + mtoken_t *mtok = vector_last(mtoken, st); + switch (mtok->typ) { + case MTOK_CONCAT: { + vector_last(mtoken, st) = mtok->val.concat.r; + if (!vector_push(mtoken, st, mtok->val.concat.l)) { + LOG_MEMORY("failed to add concatenation left m-token"); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + ++need_concat; + break; } + + case MTOK_TOKEN: { + int do_add = 1; + if (concat_cur == 2) { + preproc_token_t *tok1 = &vector_last(preproc, ret); // Guaranteed to exist + preproc_token_t *tok2 = &mtok->val.tok; +#define ISIDENT(tt) (((tt) == PPTOK_IDENT) || ((tt) == PPTOK_IDENT_UNEXP)) +#define FIND(s, c) strchr(string_content((s)), (c)) +#define ONLYDIGS(s) (!FIND((s), '.') && !FIND((s), '+') && !FIND((s), '-')) + if (ISIDENT(tok1->tokt) && (ISIDENT(tok2->tokt) || ((tok2->tokt == PPTOK_NUM) && ONLYDIGS(tok2->tokv.str)))) { + do_add = 0; + tok1->tokt = PPTOK_IDENT; + if (!string_add_string(tok1->tokv.str, tok2->tokv.str)) { + LOG_MEMORY("failed to concatenate identifiers"); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + } else if ((tok1->tokt == PPTOK_NUM) && (ISIDENT(tok2->tokt) || (tok2->tokt == PPTOK_NUM))) { + do_add = 0; + if (!string_add_string(tok1->tokv.str, tok2->tokv.str)) { + LOG_MEMORY("failed to concatenate identifiers"); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + } else { + log_warning(li, "unsupported concatenation between token type %u and %u while expanding %s\n", tok1->tokt, tok2->tokt, mname); + } +#undef ISIDENT +#undef FIND +#undef ONLYDIGS + } + if (do_add) { + preproc_token_t *tok1 = &mtok->val.tok; + if (tok1->tokt != PPTOK_NEWLINE) { + preproc_token_t tok2; + switch (tok1->tokt) { + case PPTOK_INVALID: + case PPTOK_NEWLINE: + case PPTOK_BLANK: + case PPTOK_START_LINE_COMMENT: + case PPTOK_EOF: tok2 = (preproc_token_t){.tokt = tok1->tokt, .loginfo = *li, .tokv.c = tok1->tokv.c}; break; + case PPTOK_SYM: tok2 = (preproc_token_t){.tokt = tok1->tokt, .loginfo = *li, .tokv.sym = tok1->tokv.sym}; break; + case PPTOK_IDENT: + case PPTOK_IDENT_UNEXP: + case PPTOK_NUM: { + string_t *dup = string_dup(tok1->tokv.str); + if (!dup) { + LOG_MEMORY("failed to duplicate string"); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + tok2 = (preproc_token_t){.tokt = tok1->tokt, .loginfo = *li, .tokv.str = dup}; + break; } + case PPTOK_INCL: + case PPTOK_STRING: { + string_t *dup = string_dup(tok1->tokv.sstr); + if (!dup) { + LOG_MEMORY("failed to duplicate string"); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + tok2 = (preproc_token_t){.tokt = tok1->tokt, .loginfo = *li, .tokv.sstr = dup, .tokv.sisstr = tok1->tokv.sisstr}; + break; } + } + if (!vector_push(preproc, ret, tok2)) { + LOG_MEMORY("failed to add token to output vector"); + preproc_token_del(&tok2); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + } + } + vector_pop_nodel(mtoken, st); + if (need_concat) { + concat_cur = 2; + --need_concat; + } else concat_cur = 0; + break; } + + case MTOK_ARG: { + VECTOR(preproc) *toks_to_add; + if (!need_concat && !concat_cur) { + if (!margs2[mtok->val.argid]) { + margs2[mtok->val.argid] = preproc_do_expand(li, macros, vector_content(preprocs, margs)[mtok->val.argid], solved_macros, opt_used_macros); + if (!margs2[mtok->val.argid]) { + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + } + toks_to_add = margs2[mtok->val.argid]; + } else { + toks_to_add = vector_content(preprocs, margs)[mtok->val.argid]; + } + size_t tta_start = 0, len = vector_size(preproc, toks_to_add); + if (len && (concat_cur == 2)) { + preproc_token_t *tok1 = &vector_last(preproc, ret); // Guaranteed to exist + preproc_token_t *tok2 = vector_begin(preproc, toks_to_add); +#define ISIDENT(tt) (((tt) == PPTOK_IDENT) || ((tt) == PPTOK_IDENT_UNEXP)) +#define FIND(s, c) strchr(string_content((s)), (c)) +#define ONLYDIGS(s) (!FIND((s), '.') && !FIND((s), '+') && !FIND((s), '-')) + if (ISIDENT(tok1->tokt) && (ISIDENT(tok2->tokt) || ((tok2->tokt == PPTOK_NUM) && ONLYDIGS(tok2->tokv.str)))) { + tta_start = 1; --len; + tok1->tokt = PPTOK_IDENT; + if (!string_add_string(tok1->tokv.str, tok2->tokv.str)) { + LOG_MEMORY("failed to concatenate identifiers"); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + } else if ((tok1->tokt == PPTOK_NUM) && (ISIDENT(tok2->tokt) || (tok2->tokt == PPTOK_NUM))) { + tta_start = 1; --len; + if (!string_add_string(tok1->tokv.str, tok2->tokv.str)) { + LOG_MEMORY("failed to concatenate identifiers"); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + } else { + log_warning(li, "unsupported concatenation between token type %u and %u while expanding %s\n", tok1->tokt, tok2->tokt, mname); + } +#undef ISIDENT +#undef FIND +#undef ONLYDIGS + } + if (len) { + preproc_token_t tok2; + for (preproc_token_t *tok1 = vector_begin(preproc, toks_to_add) + tta_start; tok1 != vector_end(preproc, toks_to_add); ++tok1) { + if (tok1->tokt == PPTOK_NEWLINE) continue; + switch (tok1->tokt) { + case PPTOK_INVALID: + case PPTOK_NEWLINE: + case PPTOK_BLANK: + case PPTOK_START_LINE_COMMENT: + case PPTOK_EOF: tok2 = (preproc_token_t){.tokt = tok1->tokt, .loginfo = *li, .tokv.c = tok1->tokv.c}; break; + case PPTOK_SYM: tok2 = (preproc_token_t){.tokt = tok1->tokt, .loginfo = *li, .tokv.sym = tok1->tokv.sym}; break; + case PPTOK_IDENT: + case PPTOK_IDENT_UNEXP: + case PPTOK_NUM: { + string_t *dup = string_dup(tok1->tokv.str); + if (!dup) { + LOG_MEMORY("failed to duplicate string"); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + tok2 = (preproc_token_t){.tokt = tok1->tokt, .loginfo = *li, .tokv.str = dup}; + break; } + case PPTOK_INCL: + case PPTOK_STRING: { + string_t *dup = string_dup(tok1->tokv.sstr); + if (!dup) { + LOG_MEMORY("failed to duplicate string"); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + tok2 = (preproc_token_t){.tokt = tok1->tokt, .loginfo = *li, .tokv.sstr = dup, .tokv.sisstr = tok1->tokv.sisstr}; + break; } + } + if (!vector_push(preproc, ret, tok2)) { + LOG_MEMORY("failed to add token to output vector"); + preproc_token_del(&tok2); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + } + } + vector_pop_nodel(mtoken, st); + if (need_concat) { + concat_cur = (vector_size(preproc, toks_to_add) || (concat_cur == 2)) ? 2 : 1; + --need_concat; + } else concat_cur = 0; + break; } + + case MTOK_STRINGIFY: + if (concat_cur == 2) { + log_warning(li, "invalid concatenation with string while expanding %s\n", mname); + } + // TODO: better stringifier + preproc_token_t tok2; + { + string_t *dup = string_new_cap(15); + if (!dup) { + LOG_MEMORY("failed to allocate stringify string"); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + string_add_char(dup, '<'); + string_add_char(dup, 'S'); + string_add_char(dup, 't'); + string_add_char(dup, 'r'); + string_add_char(dup, 'i'); + string_add_char(dup, 'n'); + string_add_char(dup, 'g'); + string_add_char(dup, 'i'); + string_add_char(dup, 'f'); + string_add_char(dup, 'y'); + string_add_char(dup, ' '); + string_add_char(dup, 'a'); + string_add_char(dup, 'r'); + string_add_char(dup, 'g'); + string_add_char(dup, '>'); + tok2 = (preproc_token_t){.tokt = PPTOK_STRING, .loginfo = *li, .tokv.sstr = dup, .tokv.sisstr = 1}; + } + if (!vector_push(preproc, ret, tok2)) { + LOG_MEMORY("failed to add token to output vector"); + preproc_token_del(&tok2); + vector_del(preproc, ret); + ret = NULL; + goto solve_done; + } + vector_pop_nodel(mtoken, st); + if (need_concat) { + concat_cur = 2; + --need_concat; + } else concat_cur = 0; + break; + } + } + +solve_done: + // Don't call the destructors + vector_del_freed(mtoken, st); + if (margs) { + for (size_t i = 0; i < vector_size(preprocs, margs); ++i) { + if (margs2[i]) vector_del(preproc, margs2[i]); + } + } + free(margs2); + + if (ret) { + // Success, now expand the result + // First add mname to the set of expanded macros + int iret; + kh_put(string_set, solved_macros, mname, &iret); + if (iret < 0) { + LOG_MEMORY("failed to add current macro to the set of expanded macros"); + vector_del(preproc, ret); + free(mname); + return NULL; + } + + // Next expand every remaining macros + vector_trim(preproc, ret); + VECTOR(preproc) *ret2 = preproc_do_expand(li, macros, ret, solved_macros, opt_used_macros); + vector_del(preproc, ret); + ret = ret2; + if (!ret) return NULL; // There was an error, abort + + // Finally pop mname (in case we are expanding an argument) + khiter_t it = kh_get(string_set, solved_macros, mname); + if (it == kh_end(solved_macros)) { + log_internal(li, "failed to find current macro in the set of expanded macros while expanding %s\n" , mname); + vector_del(preproc, ret); + return NULL; + } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" + free((void*)kh_key(solved_macros, it)); +#pragma GCC diagnostic pop + kh_del(string_set, solved_macros, it); + } +#undef LOG_MEMORY + + return ret; +} +static VECTOR(preproc) *preproc_do_expand(loginfo_t *li, const khash_t(macros_map) *macros, const VECTOR(preproc) *toks, + khash_t(string_set) *solved_macros, khash_t(string_set) *opt_used_macros) { + VECTOR(preproc) *toks2 = vector_new_cap(preproc, vector_size(preproc, toks)); + if (!toks2) { + log_memory("failed to allocate full macro expansion auxiliary vector\n"); + return NULL; + } + vector_for(preproc, tok, toks) { + if (tok->tokt == PPTOK_NEWLINE) continue; + preproc_token_t tok2; + switch (tok->tokt) { + case PPTOK_INVALID: + case PPTOK_NEWLINE: + case PPTOK_BLANK: + case PPTOK_START_LINE_COMMENT: + case PPTOK_EOF: tok2 = (preproc_token_t){.tokt = tok->tokt, .loginfo = tok->loginfo, .tokv.c = tok->tokv.c}; break; + case PPTOK_SYM: tok2 = (preproc_token_t){.tokt = tok->tokt, .loginfo = tok->loginfo, .tokv.sym = tok->tokv.sym}; break; + case PPTOK_IDENT: + case PPTOK_IDENT_UNEXP: + case PPTOK_NUM: { + string_t *dup = string_dup(tok->tokv.str); + if (!dup) { + log_memory("failed to duplicate string during full macro expansion\n"); + vector_del(preproc, toks2); + return NULL; + } + tok2 = (preproc_token_t){.tokt = tok->tokt, .loginfo = tok->loginfo, .tokv.str = dup}; + break; } + case PPTOK_INCL: + case PPTOK_STRING: { + string_t *dup = string_dup(tok->tokv.sstr); + if (!dup) { + log_memory("failed to duplicate string during full macro expansion\n"); + vector_del(preproc, toks2); + return NULL; + } + tok2 = (preproc_token_t){.tokt = tok->tokt, .loginfo = tok->loginfo, .tokv.sstr = dup, .tokv.sisstr = tok->tokv.sisstr}; + break; } + } + vector_push(preproc, toks2, tok2); // cap > size, thus this always succeed + } + + VECTOR(preproc) *ret = vector_new_cap(preproc, vector_size(preproc, toks)); + if (!ret) { + log_memory("failed to allocate full macro expansion result vector\n"); + return NULL; + } + vector_for(preproc, tok, toks2) { + switch (tok->tokt) { + case PPTOK_IDENT: { + if (opt_used_macros && !strcmp(string_content(tok->tokv.str), "defined") && (vector_end(preproc, toks2) - tok >= 2)) { + // We need to support "defined ident" and "defined(ident)" + string_t *mname = NULL; + preproc_token_t *tok2; + // tok2 is the last used token, mname is the ident string + if ((tok[1].tokt == PPTOK_SYM) && (tok[1].tokv.sym == SYM_LPAREN)) { + if ((vector_end(preproc, toks2) - tok >= 4) && (tok[3].tokt == PPTOK_SYM) && (tok[3].tokv.sym == SYM_RPAREN)) { + if ((tok[2].tokt == PPTOK_IDENT) || (tok[2].tokt == PPTOK_IDENT_UNEXP)) { + tok2 = tok + 3; + mname = tok[2].tokv.str; + } + } + } else if ((tok[1].tokt == PPTOK_IDENT) || (tok[1].tokt == PPTOK_IDENT_UNEXP)) { + tok2 = tok + 1; + mname = tok[1].tokv.str; + } + if (mname) { + // Add the ident to the used_macros + int iret; + char *mname2 = strdup(string_content(mname)); + if (!mname2) { + // Abort + log_memory("failed to add %s to the list of used macros (strdup returned NULL)\n", string_content(mname)); + goto expand_done; + } + kh_put(string_set, opt_used_macros, mname2, &iret); + if (iret < 0) { + // Abort + free(mname2); + log_memory("failed to add %s to the list of used macros (kh_put ireturned %d)\n", string_content(mname), iret); + goto expand_done; + } else if (iret == 0) { + // Just free mname2, it was already present + free(mname2); + } + + // Value is either 0 or 1 as a PPTOK_NUM, so we need a string with capacity 1 + string_t *num_str = string_new_cap(1); + if (!num_str) { + // Abort + log_memory("failed to create defined() output\n"); + goto expand_done; + } + khiter_t it = kh_get(macros_map, macros, string_content(mname)); + string_add_char(num_str, (it == kh_end(macros)) ? '0' : '1'); + if (!vector_push(preproc, ret, ((preproc_token_t){.tokt = PPTOK_NUM, .loginfo = *li, .tokv.str = num_str}))) { + log_memory("failed to add defined() result to the output\n"); + string_del(num_str); + goto expand_done; + } + + // Done + string_del(tok->tokv.str); + string_del(mname); + tok = tok2; + break; + } + // If mname == NULL, we simply ignore it and check if there is a macro called 'defined' + } + khiter_t it = kh_get(string_set, solved_macros, string_content(tok->tokv.str)); + if (it != kh_end(solved_macros)) { + tok->tokt = PPTOK_IDENT_UNEXP; + } else { + it = kh_get(macros_map, macros, string_content(tok->tokv.str)); + if (it != kh_end(macros)) { + macro_t *m = &kh_val(macros, it); + if (m->is_funlike) { + preproc_token_t *tok2 = tok + 1; + if ((tok2 < vector_end(preproc, toks2)) && (tok2->tokt == PPTOK_SYM) && (tok2->tokv.sym == SYM_LPAREN)) { + unsigned depth = 1; + VECTOR(preprocs) *margs = vector_new(preprocs); + if (!margs) { + log_memory("failed to allocate macro arguments for macro %s during full macro expansion\n", string_content(tok->tokv.str)); + if (margs) vector_del(preprocs, margs); + goto expand_done; + } + VECTOR(preproc) *marg = vector_new(preproc); + if (!marg) goto gather_args_err_mem; + + while (depth && (tok2 < vector_end(preproc, toks2) - 1) && (tok2->tokt != PPTOK_EOF) && (tok2->tokt != PPTOK_INVALID)) { + ++tok2; + if ((depth == 1) && (tok2->tokt == PPTOK_SYM) && (tok2->tokv.sym == SYM_COMMA)) { + // Possible optimization: emplace NULL if vector_size(marg) == 0 + // This would avoid allocating a new vector, but needs support in preproc_solve_macro + vector_trim(preproc, marg); + if (!vector_push(preprocs, margs, marg)) goto gather_args_err_mem; + marg = vector_new(preproc); + if (!marg) goto gather_args_err_mem; + } else { + if (!vector_push(preproc, marg, *tok2)) goto gather_args_err_mem; + } + if ((tok2->tokt == PPTOK_SYM) && (tok2->tokv.sym == SYM_LPAREN)) ++depth; + else if ((tok2->tokt == PPTOK_SYM) && (tok2->tokv.sym == SYM_RPAREN)) --depth; + } + if (depth) { + // This may be OK ("Unfinished fun-like macro %s\n", string_content(tok->tokv.str)); + vector_del(preprocs, margs); + vector_del(preproc, marg); + goto abort_macro; + } + // margs finishes with a SYM_RPAREN token + vector_pop(preproc, marg); + vector_trim(preproc, marg); + if (!vector_push(preprocs, margs, marg)) goto gather_args_err_mem; + marg = NULL; + + if (0) { + gather_args_err_mem: + log_memory("failed to gather macro arguments for macro %s during full macro expansion\n", string_content(tok->tokv.str)); + if (marg) vector_del(preproc, marg); + vector_del(preprocs, margs); + goto expand_done; + } + + // OK, now expand the macro + char *mname = string_steal(tok->tokv.str); + tok = tok2; + + VECTOR(preproc) *expanded = preproc_solve_macro(li, macros, mname, m, margs, solved_macros, opt_used_macros); + vector_del(preprocs, margs); + if (!expanded) { + // Error expanding the macro + goto expand_done; + } + if (!vector_push_vec(preproc, ret, expanded)) { + log_memory("pushing expanded macro to full macro expansion\n"); + vector_del(preproc, expanded); + goto expand_done; + } + vector_del_freed(preproc, expanded); + // Done + break; + } + } else { + VECTOR(preproc) *expanded = preproc_solve_macro(li, macros, string_steal(tok->tokv.str), m, NULL, solved_macros, opt_used_macros); + if (!expanded) { + ++tok; // Current token is already freed (string stolen) + goto expand_done; + } + if (!vector_push_vec(preproc, ret, expanded)) { + log_memory("failed to add macro expansion in output vector of full macro expansion\n"); + ++tok; // Current token is already freed (string stolen) + goto expand_done; + } + vector_del_freed(preproc, expanded); + break; + } + } + } + } + /* FALLTHROUGH */ + abort_macro: + case PPTOK_IDENT_UNEXP: + case PPTOK_INVALID: + case PPTOK_NUM: + case PPTOK_STRING: + case PPTOK_INCL: + case PPTOK_SYM: + case PPTOK_NEWLINE: + case PPTOK_BLANK: + case PPTOK_START_LINE_COMMENT: + case PPTOK_EOF: + if (!vector_push(preproc, ret, *tok)) { + log_memory("failed to add token to output vector during full macro expansion\n"); + goto expand_done; + } + break; + } + + if (0) { + expand_done: + vector_del_free_from(preproc, toks2, (size_t)(tok - vector_begin(preproc, toks2))); + vector_del(preproc, ret); + return NULL; + } + } + vector_del_freed(preproc, toks2); + + return ret; +} + +#define OPLVL_MUL 2 +#define OPLVL_DIV 2 +#define OPLVL_MOD 2 +#define OPLVL_ADD 3 +#define OPLVL_SUB 3 +#define OPLVL_LSL 4 +#define OPLVL_LSR 4 +#define OPLVL_LET 5 +#define OPLVL_LEE 5 +#define OPLVL_GRT 5 +#define OPLVL_GRE 5 +#define OPLVL_EQU 6 +#define OPLVL_NEQ 6 +#define OPLVL_AAN 7 // Bitwise (Arithmetic) +#define OPLVL_XOR 8 +#define OPLVL_AOR 9 // Bitwise (Arithmetic) +#define OPLVL_BAN 10 // Boolean +#define OPLVL_BOR 11 // Boolean +#define OPLVL_ALL 12 // Evaluate the entire stack +#define OPLVL_ALS 13 // Evaluate the entire stack, (don't update the states (ignored)) +#define OPTYP_MUL 1 +#define OPTYP_DIV 2 +#define OPTYP_MOD 3 +#define OPTYP_ADD 1 +#define OPTYP_SUB 2 +#define OPTYP_LSL 1 +#define OPTYP_LSR 2 +#define OPTYP_LET 1 +#define OPTYP_LEE 2 +#define OPTYP_GRT 3 +#define OPTYP_GRE 4 +#define OPTYP_EQU 1 +#define OPTYP_NEQ 2 +#define OPTYP_AAN 1 +#define OPTYP_XOR 1 +#define OPTYP_AOR 1 +#define OPTYP_BAN 1 +#define OPTYP_BOR 1 +typedef struct preproc_eval_aux_s { + struct { + unsigned st0 : 1; + unsigned st2 : 2; + unsigned st3 : 2; + unsigned st4 : 2; + unsigned st5 : 3; + unsigned st6 : 2; + unsigned st7 : 1; + unsigned st8 : 1; + unsigned st9 : 1; + unsigned st_bool : 1; + }; + int64_t v0; + unsigned st1; + const preproc_token_t *v1; + int64_t v2; loginfo_t li2; + int64_t v3; loginfo_t li3; + int64_t v4; loginfo_t li4; + int64_t v5; loginfo_t li5; + int64_t v6; loginfo_t li6; + int64_t v7; loginfo_t li7; + int64_t v8; loginfo_t li8; + int64_t v9; loginfo_t li9; + loginfo_t libool; + unsigned n_colons; // Number of ':' expected (needs to skip to the end), ie number of ternary where the truth-y branch is taken +} preproc_eval_aux_t; +VECTOR_DECLARE_STATIC(ppeaux, preproc_eval_aux_t) +VECTOR_IMPL_STATIC(ppeaux, (void)) +static int64_t eval_stack(preproc_eval_aux_t *st, loginfo_t li, int max_lv, int optype, _Bool is_unsigned, int *success) { + if (!li.lineno_end) { + li.lineno_end = li.lineno; + li.colno_end = li.colno; + } + + int64_t acc = st->v0; + st->st0 = 0; + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wduplicated-cond" // For the else if (st->stX) + if (st->st2 == OPTYP_MUL) { + acc = st->v2 * acc; + st->st2 = 0; + li.lineno = st->li2.lineno; + li.colno = st->li2.colno; + } else if (st->st2 == OPTYP_DIV) { + if (!acc) { + log_error(&li, "division by zero during #if evaluation\n"); + *success = 0; + return 0; + } + acc = st->v2 / acc; + st->st2 = 0; + li.lineno = st->li2.lineno; + li.colno = st->li2.colno; + } else if (st->st2 == OPTYP_MOD) { + if (!acc) { + log_error(&li, "division by zero during #if evaluation\n"); + *success = 0; + return 0; + } + acc = st->v2 % acc; + st->st2 = 0; + li.lineno = st->li2.lineno; + li.colno = st->li2.colno; + } else if (st->st2) { + log_internal(&st->li2, "unknown st2 %d during #if evaluation\n", st->st2); + *success = 0; + return 0; + } + if (max_lv == 2) { + st->st2 = optype; + st->v2 = acc; + st->li2 = li; + return acc; + } + if (st->st3 == OPTYP_ADD) { + acc = st->v3 + acc; + st->st3 = 0; + li.lineno = st->li3.lineno; + li.colno = st->li3.colno; + } else if (st->st3 == OPTYP_SUB) { + acc = st->v3 - acc; + st->st3 = 0; + li.lineno = st->li3.lineno; + li.colno = st->li3.colno; + } else if (st->st3) { + log_internal(&st->li3, "unknown st3 %d during #if evaluation\n", st->st3); + *success = 0; + return 0; + } + if (max_lv == 3) { + st->st3 = optype; + st->v3 = acc; + st->li3 = li; + return acc; + } + if (st->st4 == OPTYP_LSL) { + acc = st->v4 << acc; + st->st4 = 0; + li.lineno = st->li4.lineno; + li.colno = st->li4.colno; + } else if (st->st4 == OPTYP_LSR) { + acc = is_unsigned ? (int64_t)((uint64_t)st->v4 >> (uint64_t)acc) : (st->v4 >> acc); + st->st4 = 0; + li.lineno = st->li4.lineno; + li.colno = st->li4.colno; + } else if (st->st4) { + log_internal(&st->li4, "unknown st4 %d during #if evaluation\n", st->st4); + *success = 0; + return 0; + } + if (max_lv == 4) { + st->st4 = optype; + st->v4 = acc; + st->li4 = li; + return acc; + } + if (st->st5 == OPTYP_LET) { + acc = is_unsigned ? ((uint64_t)st->v5 < (uint64_t)acc) : (st->v5 < acc); + is_unsigned = 0; + st->st5 = 0; + li.lineno = st->li5.lineno; + li.colno = st->li5.colno; + } else if (st->st5 == OPTYP_LEE) { + acc = is_unsigned ? ((uint64_t)st->v5 <= (uint64_t)acc) : (st->v5 <= acc); + is_unsigned = 0; + st->st5 = 0; + li.lineno = st->li5.lineno; + li.colno = st->li5.colno; + } else if (st->st5 == OPTYP_GRT) { + acc = is_unsigned ? ((uint64_t)st->v5 > (uint64_t)acc) : (st->v5 > acc); + is_unsigned = 0; + st->st5 = 0; + li.lineno = st->li5.lineno; + li.colno = st->li5.colno; + } else if (st->st5 == OPTYP_GRE) { + acc = is_unsigned ? ((uint64_t)st->v5 >= (uint64_t)acc) : (st->v5 >= acc); + is_unsigned = 0; + st->st5 = 0; + li.lineno = st->li5.lineno; + li.colno = st->li5.colno; + } else if (st->st5) { + log_internal(&st->li5, "unknown st5 %d during #if evaluation\n", st->st5); + *success = 0; + return 0; + } + if (max_lv == 5) { + st->st5 = optype; + st->v5 = acc; + st->li5 = li; + return acc; + } + if (st->st6 == OPTYP_EQU) { + acc = st->v6 == acc; + st->st6 = 0; + li.lineno = st->li6.lineno; + li.colno = st->li6.colno; + } else if (st->st6 == OPTYP_NEQ) { + acc = st->v6 != acc; + st->st6 = 0; + li.lineno = st->li6.lineno; + li.colno = st->li6.colno; + } else if (st->st6) { + log_internal(&st->li6, "unknown st6 %d during #if evaluation\n", st->st6); + *success = 0; + return 0; + } + if (max_lv == 6) { + st->st6 = optype; + st->v6 = acc; + st->li6 = li; + return acc; + } + if (st->st7 == OPTYP_AAN) { + acc = st->v7 & acc; + st->st7 = 0; + li.lineno = st->li7.lineno; + li.colno = st->li7.colno; + } else if (st->st7) { + log_internal(&st->li7, "unknown st7 %d during #if evaluation\n", st->st7); + *success = 0; + return 0; + } + if (max_lv == 7) { + st->st7 = optype; + st->v7 = acc; + st->li7 = li; + return acc; + } + if (st->st8 == OPTYP_XOR) { + acc = st->v8 ^ acc; + st->st8 = 0; + li.lineno = st->li8.lineno; + li.colno = st->li8.colno; + } else if (st->st8) { + log_internal(&st->li8, "unknown st8 %d during #if evaluation\n", st->st8); + *success = 0; + return 0; + } + if (max_lv == 8) { + st->st8 = optype; + st->v8 = acc; + st->li8 = li; + return acc; + } + if (st->st9 == OPTYP_AOR) { + acc = st->v9 | acc; + st->st9 = 0; + li.lineno = st->li9.lineno; + li.colno = st->li9.colno; + } else if (st->st9) { + log_internal(&st->li9, "unknown st9 %d during #if evaluation\n", st->st9); + *success = 0; + return 0; + } + if (max_lv == 9) { + st->st9 = optype; + st->v9 = acc; + st->li9 = li; + return acc; + } + if (max_lv == 10) { // OPLVL == OPLVL_BAN, OPTYP == OPTYP_BAN + li.lineno = st->libool.lineno; + li.colno = st->libool.colno; + st->libool = li; + return acc; + } + if (max_lv == 11) { // OPLVL == OPLVL_BOR, OPTYP == OPTYP_BOR + li.lineno = st->libool.lineno; + li.colno = st->libool.colno; + st->libool = li; + return acc; + } + if (st->st_bool) { + acc = !!acc; + st->st_bool = 0; + } + if ((max_lv == OPLVL_ALL) || (max_lv == OPLVL_ALS)) { + return acc; + } +#pragma GCC diagnostic pop + log_internal(&li, "invalid max level %d in preprocessor partial expression evaluation\n", max_lv); + *success = 0; + return acc; +} +static int64_t preproc_eval(const VECTOR(preproc) *cond, int *aux_ret, int ptr_is_32bits) { + int success; + VECTOR(ppeaux) *stack = vector_new_cap(ppeaux, 1); + if (!stack) { + log_memory("failed to allocate #if evaluation stack vector\n"); + *aux_ret = 0; + return 0; + } + if (0) { + eval_fail: + vector_del(ppeaux, stack); + *aux_ret = 0; + return 0; + } + vector_push(ppeaux, stack, (preproc_eval_aux_t){0}); // vector_cap >= 1 + int64_t acc; loginfo_t li0; _Bool is_unsigned = 0; + vector_for(preproc, tok, cond) { + if (tok->tokt == PPTOK_NUM) { + // Evaluate token as an integer if st0 == 0, error otherwise + if (vector_last(ppeaux, stack).st0 == 0) { + num_constant_t cst; + if (!num_constant_convert(&tok->loginfo, tok->tokv.str, &cst, ptr_is_32bits)) { + goto eval_fail; + } + switch (cst.typ) { + case NCT_INT32: acc = cst.val.i32; break; + case NCT_UINT32: is_unsigned = 1; acc = cst.val.u32; break; + case NCT_INT64: acc = cst.val.i64; break; + case NCT_UINT64: is_unsigned = 1; acc = (int64_t)cst.val.u64; break; + case NCT_FLOAT: + case NCT_DOUBLE: + case NCT_LDOUBLE: + default: + log_error(&tok->loginfo, "number '%s' is not a valid integer (during #if evaluation)\n", string_content(tok->tokv.str)); + goto eval_fail; + } + li0 = tok->loginfo; + goto push_acc_to_st0; + } else { + log_error(&tok->loginfo, "unexpected number during #if evaluation\n"); + goto eval_fail; + } + } else if ((tok->tokt == PPTOK_IDENT) || (tok->tokt == PPTOK_IDENT_UNEXP)) { + // Evaluate token as 0 if st0 == 0, error otherwise + if (vector_last(ppeaux, stack).st0 == 0) { + acc = 0; + li0 = tok->loginfo; + goto push_acc_to_st0; + } else { + log_error(&tok->loginfo, "unexpected ident '%s' during #if evaluation\n", string_content(tok->tokv.str)); + goto eval_fail; + } + } else if (tok->tokt == PPTOK_SYM) { + int op_lvl; + int op_typ; + switch (tok->tokv.sym) { + case SYM_TILDE: + // Unary (st0 == 0) + if (vector_last(ppeaux, stack).st0 != 0) { + log_error(&tok->loginfo, "unexpected unary '~' in #if expression\n"); + goto eval_fail; + } + if (!(vector_last(ppeaux, stack).st1++)) { + // Also update v1, since this is the first level 1 operator + vector_last(ppeaux, stack).v1 = tok; + } + goto done_partial_eval; + case SYM_EXCL: + // Unary (st0 == 0) + if (vector_last(ppeaux, stack).st0 != 0) { + log_error(&tok->loginfo, "unexpected unary '!' in #if expression\n"); + goto eval_fail; + } + if (!(vector_last(ppeaux, stack).st1++)) { + // Also update v1, since this is the first level 1 operator + vector_last(ppeaux, stack).v1 = tok; + } + goto done_partial_eval; + case SYM_PLUS: + // May be unary (st0 == 0) or binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) { + // Unary, prepare lv1 then continue to the next token + if (!(vector_last(ppeaux, stack).st1++)) { + // Also update v1, since this is the first level 1 operator + vector_last(ppeaux, stack).v1 = tok; + } + goto done_partial_eval; + } else { + op_lvl = OPLVL_ADD; + op_typ = OPTYP_ADD; + goto add_binop; + } + case SYM_DASH: + // May be unary (st0 == 0) or binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) { + // Unary, prepare lv1 then continue to the next token + if (!(vector_last(ppeaux, stack).st1++)) { + // Also update v1, since this is the first level 1 operator + vector_last(ppeaux, stack).v1 = tok; + } + goto done_partial_eval; + } else { + op_lvl = OPLVL_SUB; + op_typ = OPTYP_SUB; + goto add_binop; + } + case SYM_STAR: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_MUL; + op_typ = OPTYP_MUL; + goto add_binop; + case SYM_SLASH: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_DIV; + op_typ = OPTYP_DIV; + goto add_binop; + case SYM_PERCENT: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_MOD; + op_typ = OPTYP_MOD; + goto add_binop; + case SYM_HAT: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_XOR; + op_typ = OPTYP_XOR; + goto add_binop; + case SYM_AMP: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_AAN; + op_typ = OPTYP_AAN; + goto add_binop; + case SYM_PIPE: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_AOR; + op_typ = OPTYP_AOR; + goto add_binop; + case SYM_EQEQ: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_EQU; + op_typ = OPTYP_EQU; + goto add_binop; + case SYM_EXCLEQ: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_NEQ; + op_typ = OPTYP_NEQ; + goto add_binop; + case SYM_LT: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_LET; + op_typ = OPTYP_LET; + goto add_binop; + case SYM_GT: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_GRT; + op_typ = OPTYP_GRT; + goto add_binop; + case SYM_LTEQ: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_LEE; + op_typ = OPTYP_LEE; + goto add_binop; + case SYM_GTEQ: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_GRE; + op_typ = OPTYP_GRE; + goto add_binop; + case SYM_AMPAMP: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_BAN; + op_typ = OPTYP_BAN; + goto add_binop; + case SYM_PIPEPIPE: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_BOR; + op_typ = OPTYP_BOR; + goto add_binop; + case SYM_LTLT: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_LSL; + op_typ = OPTYP_LSL; + goto add_binop; + case SYM_GTGT: + // Binary (st0 != 0) + if (vector_last(ppeaux, stack).st0 == 0) goto invalid_binop; + op_lvl = OPLVL_LSR; + op_typ = OPTYP_LSR; + goto add_binop; + + case SYM_LPAREN: + // May be placed anywhere a constant is expected (st0 == 0) and simply pushes a new stack + if (vector_last(ppeaux, stack).st0 != 0) { + log_error(&tok->loginfo, "unexpected opening parenthesis in #if expression\n"); + goto eval_fail; + } + if (!vector_push(ppeaux, stack, (preproc_eval_aux_t){0})) { + log_memory("failed to push a new stack during #if evaluation\n"); + goto eval_fail; + } + goto done_partial_eval; + case SYM_RPAREN: + // May be placed anywhere after a constant (st0 != 0) + if (vector_size(ppeaux, stack) == 1) { + log_error(&tok->loginfo, "unexpected symbol ')' (parenthesis not opened) during #if evaluation\n"); + goto eval_fail; + } + if (vector_last(ppeaux, stack).n_colons) { + log_error(&tok->loginfo, "unexpected symbol ')', expected symbol ':' during #if evaluation\n"); + goto eval_fail; + } + if (!vector_last(ppeaux, stack).st0) { + log_error(&tok->loginfo, "unexpected symbol ')' during #if evaluation\n"); + goto eval_fail; + } + + eval_rparen: + // Evaluate the top of the stack, then pop + success = 1; + acc = eval_stack(&vector_last(ppeaux, stack), li0, OPLVL_ALS, 0, is_unsigned, &success); + if (!success) { + goto eval_fail; + } + + eval_rparen_acc: + vector_pop(ppeaux, stack); + goto push_acc_to_st0; + + case SYM_QUESTION: { + // May be placed anywhere and may skip some tokens depending on acc + if (!vector_last(ppeaux, stack).st0) { + log_error(&tok->loginfo, "unexpected ternary operator during #if evaluation\n"); + goto eval_fail; + } + + // Evaluate the top of the stack, then increase n_colons or skip tokens + success = 1; + acc = eval_stack(&vector_last(ppeaux, stack), li0, OPLVL_ALL, 0, is_unsigned, &success); + if (!success) { + goto eval_fail; + } + + eval_question_acc: + is_unsigned = 0; + if (acc) { + // Increase n_colons + ++vector_last(ppeaux, stack).n_colons; + goto done_partial_eval; + } else { + // Skip to the corresponding colon + unsigned nquestions = 0, nparens = 0; + // Note that we don't really care about the content of the ignored part; it may be syntaxically incorrect + for (++tok; tok < vector_end(preproc, cond); ++tok) { + if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_LPAREN)) { + ++nparens; + } else if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_RPAREN)) { + if (nparens) --nparens; + else { + log_error(&tok->loginfo, "unexpected symbol ')', expected ':' during #if evaluation\n"); + goto eval_fail; + } + } else if (!nparens && (tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_QUESTION)) { + ++nquestions; + } else if (!nparens && (tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_COLON)) { + if (nquestions) --nquestions; + else break; + } + } + if (tok == vector_end(preproc, cond)) { + log_error(&tok->loginfo, "ternary operator never finished during #if evaluation\n"); + goto eval_fail; + } + goto done_partial_eval; + } + } + case SYM_COLON: { + if (!vector_last(ppeaux, stack).n_colons) { + log_error(&tok->loginfo, "unexpected symbol ':' during #if evaluation\n"); + goto eval_fail; + } + if (!vector_last(ppeaux, stack).st0) { + log_error(&tok->loginfo, "unexpected symbol ':' during #if evaluation\n"); + goto eval_fail; + } + eval_colon_acc: + // Skip to the end of expression or to the corresponding rparen + if (vector_size(ppeaux, stack) == 1) { + goto done_complete_stack; // No parenthesis opened, skip to the end of the vector + } + // Skip to the next rparen; also, we skip correctly counting of ':' since we don't care about those anymore + unsigned nparens = 0; + // Note that we don't really care about the content of the ignored part; it may be syntaxically incorrect + for (++tok; tok < vector_end(preproc, cond); ++tok) { + if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_LPAREN)) { + ++nparens; + } else if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_RPAREN)) { + if (nparens) --nparens; + else break; + } + } + // We need to exit at a RPAREN + if (tok == vector_end(preproc, cond)) { + log_error(&vector_last(preproc, cond).loginfo, "missing closing parenthesis in #if expression\n"); + goto eval_fail; + } + vector_last(ppeaux, stack).n_colons = 0; + goto eval_rparen; } + + case SYM_LBRACKET: + case SYM_RBRACKET: + case SYM_LSQBRACKET: + case SYM_RSQBRACKET: + case SYM_HASH: + case SYM_HASHHASH: + case SYM_SEMICOLON: + case SYM_COLONCOLON: + case SYM_VARIADIC: + case SYM_DOT: + case SYM_DASHGT: + case SYM_EQ: + case SYM_PLUSEQ: + case SYM_DASHEQ: + case SYM_STAREQ: + case SYM_SLASHEQ: + case SYM_PERCENTEQ: + case SYM_HATEQ: + case SYM_AMPEQ: + case SYM_PIPEEQ: + case SYM_LTLTEQ: + case SYM_GTGTEQ: + case SYM_PLUSPLUS: + case SYM_DASHDASH: + case SYM_COMMA: + default: + log_error(&tok->loginfo, "invalid symbol ID %u (%s) during #if evaluation\n", + tok->tokv.sym, (tok->tokv.sym <= LAST_SYM) ? sym2str[tok->tokv.sym] : "invalid"); + goto eval_fail; + } + + // invalid_binop: unexpected binary operation + // add_binop: add a binary operation + if (0) { + invalid_binop: + log_error(&tok->loginfo, "unexpected binary operator '%s' in #if expression\n", sym2str[tok->tokv.sym]); + goto eval_fail; + add_binop: + if (op_lvl < 2) { + log_internal(&tok->loginfo, "invalid op_lvl %d < 2 during #if evaluation\n", op_lvl); + goto eval_fail; + } + if (op_lvl >= OPLVL_ALL) { + log_internal(&tok->loginfo, "invalid op_lvl %d > OPLVL_ALL during #if evaluation\n", op_lvl); + goto eval_fail; + } + + success = 1; + acc = eval_stack(&vector_last(ppeaux, stack), li0, op_lvl, op_typ, is_unsigned, &success); + if (!success) { + goto eval_fail; + } + + if (op_lvl < OPLVL_BAN) { + // No post-processing required + goto done_partial_eval; + } + if (op_lvl == OPLVL_BAN) { + // op_typ == OPLVL_BAN + vector_last(ppeaux, stack).st_bool = 1; + if (acc) goto done_partial_eval; + // We have five possibilities: + // [0] && x ~> 0 + // [0] && x) ~> 0) + // [0] && x ? y : z ~> z + // [0] && x : y ~> 0 : y ~> 0 + // [0] && x || y ~> y + // We are at the '&&'; note that we know the top of the stack has no pending operation + unsigned nparens = 0; + for (++tok; tok < vector_end(preproc, cond); ++tok) { + if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_LPAREN)) { + ++nparens; + } else if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_RPAREN)) { + if (nparens) --nparens; + else { + if (vector_size(ppeaux, stack) == 1) { + log_error(&tok->loginfo, "unexpected symbol ')' (parenthesis not opened) during #if evaluation\n"); + goto eval_fail; + } + if (vector_last(ppeaux, stack).n_colons) { + log_error(&tok->loginfo, "unexpected symbol ')', expected symbol ':' during #if evaluation\n"); + goto eval_fail; + } + + goto eval_rparen_acc; + } + } else if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_QUESTION)) { + if (!nparens) { + goto eval_question_acc; + } + } else if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_COLON)) { + if (!nparens) { + if (!vector_last(ppeaux, stack).n_colons) { + log_error(&tok->loginfo, "unexpected symbol ':' during #if evaluation\n"); + goto eval_fail; + } + goto eval_colon_acc; + } + } else if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_PIPEPIPE)) { + if (!nparens) { + goto done_partial_eval; + } + } + } + if (nparens) { + log_error(&vector_last(preproc, cond).loginfo, "expected symbol ')' during #if evaluation\n"); + goto eval_fail; + } + if (vector_last(ppeaux, stack).n_colons) { + log_error(&vector_last(preproc, cond).loginfo, "expected symbol ':' during #if evaluation\n"); + goto eval_fail; + } + if (vector_size(ppeaux, stack) != 1) { + log_error(&vector_last(preproc, cond).loginfo, "expected symbol ')' during #if evaluation\n"); + goto eval_fail; + } + goto done_complete_acc; + } + if (op_lvl == OPLVL_BOR) { + // op_typ == OPLVL_BOR + vector_last(ppeaux, stack).st_bool = 1; + if (!acc) goto done_partial_eval; + // We have four possibilities: + // [!0] || x ~> 1 + // [!0] || x) ~> 1) + // [!0] || x ? y : z ~> z + // [!0] || x : y ~> 1 : y ~> 1 + // We are at the '||'; note that we know the top of the stack has no pending operation + unsigned nparens = 0; + for (++tok; tok < vector_end(preproc, cond); ++tok) { + if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_LPAREN)) { + ++nparens; + } else if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_RPAREN)) { + if (nparens) --nparens; + else { + if (vector_size(ppeaux, stack) == 1) { + log_error(&tok->loginfo, "unexpected symbol ')' (parenthesis not opened) during #if evaluation\n"); + goto eval_fail; + } + if (vector_last(ppeaux, stack).n_colons) { + log_error(&tok->loginfo, "unexpected symbol ')', expected symbol ':' during #if evaluation\n"); + goto eval_fail; + } + + acc = 1; + goto eval_rparen_acc; + } + } else if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_QUESTION)) { + if (!nparens) { + acc = 1; + goto eval_question_acc; + } + } else if ((tok->tokt == PPTOK_SYM) && (tok->tokv.sym == SYM_COLON)) { + if (!nparens) { + if (!vector_last(ppeaux, stack).n_colons) { + log_error(&tok->loginfo, "unexpected symbol ':' during #if evaluation\n"); + goto eval_fail; + } + acc = 1; + goto eval_colon_acc; + } + } + } + if (nparens) { + log_error(&vector_last(preproc, cond).loginfo, "expected symbol ')' during #if evaluation\n"); + goto eval_fail; + } + if (vector_last(ppeaux, stack).n_colons) { + log_error(&vector_last(preproc, cond).loginfo, "expected symbol ':' during #if evaluation\n"); + goto eval_fail; + } + if (vector_size(ppeaux, stack) != 1) { + log_error(&vector_last(preproc, cond).loginfo, "expected symbol ')' during #if evaluation\n"); + goto eval_fail; + } + acc = 1; + goto done_complete_acc; + } + log_internal(&li0, "invalid op_lvl %d during #if evaluation\n", op_lvl); + goto eval_fail; + } + + done_partial_eval: + } else { + log_error(&tok->loginfo, "invalid token type %u during #if evaluation\n", tok->tokt); + goto eval_fail; + } + + // push_acc_to_st0: evaluate all held st1 operations on acc, then set st0 to 1 and v0 to acc + if (0) { + push_acc_to_st0: + while (vector_last(ppeaux, stack).st1) { + // Only symbols, so this should be safe + enum token_sym_type_e sym = vector_last(ppeaux, stack).v1[--vector_last(ppeaux, stack).st1].tokv.sym; + if (sym == SYM_PLUS) {} + else if (sym == SYM_DASH) acc = -acc; + else if (sym == SYM_EXCL) acc = !acc; + else if (sym == SYM_TILDE) acc = ~acc; + else { + log_internal(&vector_last(ppeaux, stack).v1[vector_last(ppeaux, stack).st1].loginfo, + "unknown level 1 unary operator sym ID %u\n", sym); + } + } + vector_last(ppeaux, stack).v0 = acc; + vector_last(ppeaux, stack).st0 = 1; + } + } + + if (vector_size(ppeaux, stack) != 1) { + log_error(&vector_last(preproc, cond).loginfo, "expected symbol ')' during #if evaluation\n"); + goto eval_fail; + } + +done_complete_stack: + success = 1; + acc = eval_stack(&vector_last(ppeaux, stack), li0, OPLVL_ALS, 0, is_unsigned, &success); + if (!success) { + goto eval_fail; + } + +done_complete_acc: + vector_del(ppeaux, stack); + *aux_ret = 1; + return acc; +} + +int proc_unget_token(preproc_t *src, proc_token_t *tok) { + return vector_push(ppsource, src->prep, ((ppsource_t){ .srct = PPSRC_PTOKEN, .srcv.ptok = *tok })); +} +static proc_token_t proc_next_token_aux(preproc_t *src) { + if (!vector_size(ppsource, src->prep)) { + return (proc_token_t){ .tokt = PTOK_EOF, .loginfo = { 0 }, .tokv = {.c = (char)EOF} }; + } + if (vector_last(ppsource, src->prep).srct == PPSRC_PTOKEN) { + proc_token_t ret = vector_last(ppsource, src->prep).srcv.ptok; + vector_pop_nodel(ppsource, src->prep); + return ret; + } +check_if_depth: + { + if (!vector_size(ppsource, src->prep)) { + return (proc_token_t){ .tokt = PTOK_EOF, .loginfo = { 0 }, .tokv = {.c = (char)EOF} }; + } + ppsource_t *ppsrc = &vector_last(ppsource, src->prep); + if ((ppsrc->srct == PPSRC_PREPARE) && (ppsrc->srcv.prep.ok_depth != ppsrc->srcv.prep.cond_depth)) { + // Ignore all tokens from ppsrc until: + // INVALID -------------- abort (return PTOK_INVALID) + // EOF ------------------ print an error, then pop and goto check_if_depth + // # if/elif/endif/... -- parse, execute, goto check_if_depth + // Also, track newlines to keep src->st up-to-date + + while (1) { + preproc_token_t tok = ppsrc_next_token(src); + skip_cur_token: + if (tok.tokt == PPTOK_INVALID) { + src->st = PPST_NONE; + proc_token_t ret; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = tok.tokv.c; + return ret; + } else if (tok.tokt == PPTOK_NEWLINE) { + src->st = PPST_NL; + } else if (tok.tokt == PPTOK_EOF) { + log_warning(&tok.loginfo, "file ended before closing all conditionals (ignoring)\n"); + vector_pop(ppsource, src->prep); + goto check_if_depth; + } else if ((tok.tokt == PPTOK_SYM) && (src->st == PPST_NL) && (tok.tokv.sym == SYM_HASH)) { + src->st = PPST_NONE; + tok = ppsrc_next_token(src); + if ((tok.tokt == PPTOK_NEWLINE) || (tok.tokt == PPTOK_EOF)) { + // Empty preprocessor command + src->st = PPST_NL; + continue; + } + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) goto preproc_ignore_remaining; + if (!strcmp(string_content(tok.tokv.str), "include")) goto preproc_ignore_remaining; + else if (!strcmp(string_content(tok.tokv.str), "include_next")) goto preproc_ignore_remaining; + else if (!strcmp(string_content(tok.tokv.str), "define")) goto preproc_ignore_remaining; + else if (!strcmp(string_content(tok.tokv.str), "undef")) goto preproc_ignore_remaining; + else if (!strcmp(string_content(tok.tokv.str), "error")) goto preproc_ignore_remaining; + else if (!strcmp(string_content(tok.tokv.str), "warning")) goto preproc_ignore_remaining; // C23/extension + else if (!strcmp(string_content(tok.tokv.str), "pragma")) goto preproc_ignore_remaining; + else if (!strcmp(string_content(tok.tokv.str), "line")) goto preproc_ignore_remaining; + else if (!strcmp(string_content(tok.tokv.str), "if")) { + // Increase cond_depth (we already know we are ignoring the content) + ++ppsrc->srcv.prep.cond_depth; + goto preproc_ignore_remaining; + } else if (!strcmp(string_content(tok.tokv.str), "ifdef")) { + // Increase cond_depth (we already know we are ignoring the content) + ++ppsrc->srcv.prep.cond_depth; + goto preproc_ignore_remaining; + } else if (!strcmp(string_content(tok.tokv.str), "ifndef")) { + // Increase cond_depth (we already know we are ignoring the content) + ++ppsrc->srcv.prep.cond_depth; + goto preproc_ignore_remaining; + } else if (!strcmp(string_content(tok.tokv.str), "elif")) { + if ((ppsrc->srcv.prep.ok_depth == ppsrc->srcv.prep.cond_depth - 1) && !ppsrc->srcv.prep.entered_next_ok_cond) { + string_del(tok.tokv.str); + VECTOR(preproc) *cond = vector_new(preproc); + if (!cond) { + log_memory("failed to allocate #elif condition vector\n"); + src->st = PPST_NONE; + return (proc_token_t){ .tokt = PTOK_INVALID, .loginfo = tok.loginfo, .tokv = {.c = '\0'} }; + } + tok = ppsrc_next_token(src); + loginfo_t li = tok.loginfo; + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + li.lineno_end = tok.loginfo.lineno_end ? tok.loginfo.lineno_end : tok.loginfo.lineno; + li.colno_end = tok.loginfo.colno_end ? tok.loginfo.colno_end : tok.loginfo.colno; + if (!vector_push(preproc, cond, tok)) { + log_memory("failed to add token to #elif condition vector\n"); + vector_del(preproc, cond); + src->st = PPST_NONE; + return (proc_token_t){ .tokt = PTOK_INVALID, .loginfo = tok.loginfo, .tokv = {.c = '\0'} }; + } + tok = ppsrc_next_token(src); + } + vector_trim(preproc, cond); + khash_t(string_set) *solved_macros = kh_init(string_set); + if (!solved_macros) { + log_memory("failed to allocate #elif solved_macros set\n"); + vector_del(preproc, cond); + src->st = PPST_NONE; + return (proc_token_t){ .tokt = PTOK_INVALID, .loginfo = tok.loginfo, .tokv = {.c = '\0'} }; + } + + VECTOR(preproc) *expanded = preproc_do_expand(&li, src->macros_map, cond, solved_macros, src->macros_used); + vector_del(preproc, cond); + macros_set_del(solved_macros); + if (!expanded) { + // Not required as preproc_do_expand already prints an error, but this can be useful + log_error(&li, "failed to expand #elif condition\n"); + src->st = PPST_NONE; + return (proc_token_t){ .tokt = PTOK_INVALID, .loginfo = tok.loginfo, .tokv = {.c = '\0'} }; + } + + // Now we need to compute what is pointed by expanded, and increase cond_depth and ok_depth as needed + int st; + int64_t res = preproc_eval(expanded, &st, src->target->size_long == 4); + vector_del(preproc, expanded); + if (!st) { + // Not required as preproc_eval already prints an error, but this can be useful + log_error(&li, "failed to evaluate #elif condition\n"); + src->st = PPST_NONE; + return (proc_token_t){ .tokt = PTOK_INVALID, .tokv = {.c = '\0'} }; + } + if (res) { + ++vector_last(ppsource, src->prep).srcv.prep.ok_depth; + if (tok.tokt == PPTOK_NEWLINE) { + src->st = PPST_NL; + goto check_next_token; + } + } else { + if (tok.tokt == PPTOK_NEWLINE) { + src->st = PPST_NL; + continue; + } + } + if (tok.tokt == PPTOK_EOF) { + log_warning(&tok.loginfo, "file ended before closing all conditionals (ignoring)\n"); + vector_pop(ppsource, src->prep); + src->st = PPST_NL; // Should be redundant since TOK_NEWLINE is added before TOK_EOF if required + // EOF has an empty destructor + // Note that since we have opened the file, the previous file had ok_depth == cond_depth + goto check_next_token; + } else /* if (tok.tokt == PPTOK_INVALID) */ { + src->st = PPST_NONE; + return (proc_token_t){ .tokt = PTOK_INVALID, .tokv.c = tok.tokv.c }; + } + } else goto preproc_ignore_remaining; + } else if (!strcmp(string_content(tok.tokv.str), "elifdef")) { + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) { + log_error(&tok.loginfo, "invalid token type %u after '#elifdef' preprocessor command\n", tok.tokt); + goto preproc_ignore_remaining; + } + if ((ppsrc->srcv.prep.ok_depth == ppsrc->srcv.prep.cond_depth - 1) && !ppsrc->srcv.prep.entered_next_ok_cond) { + // We may enter the following block, check it + khiter_t it = kh_get(macros_map, src->macros_map, string_content(tok.tokv.str)); + if (it != kh_end(src->macros_map)) { + ++ppsrc->srcv.prep.ok_depth; + goto preproc_ignore_remaining_goto; + } + goto preproc_ignore_remaining; + } + } else if (!strcmp(string_content(tok.tokv.str), "elifndef")) { + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) { + log_error(&tok.loginfo, "invalid token type %u after '#elifdef' preprocessor command\n", tok.tokt); + goto preproc_ignore_remaining; + } + if ((ppsrc->srcv.prep.ok_depth == ppsrc->srcv.prep.cond_depth - 1) && !ppsrc->srcv.prep.entered_next_ok_cond) { + // We may enter the following block, check it + khiter_t it = kh_get(macros_map, src->macros_map, string_content(tok.tokv.str)); + if (it == kh_end(src->macros_map)) { + ++ppsrc->srcv.prep.ok_depth; + goto preproc_ignore_remaining_goto; + } + goto preproc_ignore_remaining; + } + } else if (!strcmp(string_content(tok.tokv.str), "else")) { + // Maybe increase ok_depth if ok_depth = cond_depth - 1; also goto check_if_depth + // Also, we only need to goto check_if_depth if we actually update ok_depth + // Note that this (very naive) approach allows code such as: + /* #ifdef M + * ... // Not preprocessed *** Preprocessed + * #else + * ... // Preprocessed *** Not preprocessed + * #else + * ... // Not preprocessed due to unrelated code *** Not preprocessed + * #else + * ... // Preprocessed *** Not preprocessed + * #endif + */ + // Forbidding this code would require a 256-bits bitfield, which is big, thus not implemented. + if ((ppsrc->srcv.prep.ok_depth == ppsrc->srcv.prep.cond_depth - 1) && !ppsrc->srcv.prep.entered_next_ok_cond) { + ++ppsrc->srcv.prep.ok_depth; + goto preproc_ignore_remaining_goto; + } else goto preproc_ignore_remaining; + } else if (!strcmp(string_content(tok.tokv.str), "endif")) { + // Decrease cond_depth; also goto check_if_depth + // Note that 0 <= ppsrc->srcv.prep.ok_depth < ppsrc->srcv.prep.cond_depth, so this code is OK + --ppsrc->srcv.prep.cond_depth; + goto preproc_ignore_remaining_goto; + } + + log_warning(&tok.loginfo, "Unknown ignored pp command %s, skipping until EOL\n", string_content(tok.tokv.str)); + preproc_ignore_remaining: + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + preproc_token_del(&tok); + tok = ppsrc_next_token(src); + } + if (tok.tokt == PPTOK_NEWLINE) { + src->st = PPST_NL; + } + goto skip_cur_token; + + preproc_ignore_remaining_goto: + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + preproc_token_del(&tok); + tok = ppsrc_next_token(src); + } + if (tok.tokt == PPTOK_NEWLINE) { + src->st = PPST_NL; + } + goto check_if_depth; + } else { + src->st = PPST_NONE; + preproc_token_del(&tok); + } + } + } + } + proc_token_t ret; +check_next_token: + if (!vector_size(ppsource, src->prep)) { + ret.tokt = PTOK_EOF; + ret.loginfo = (loginfo_t){0}; + ret.tokv.c = (char)EOF; + return ret; + } +start_next_token: + preproc_token_t tok = ppsrc_next_token(src); +start_cur_token: + switch (tok.tokt) { + case PPTOK_INVALID: + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = tok.tokv.c; + return ret; + case PPTOK_IDENT: + src->st = (src->st == PPST_PRAGMA_EXPLICIT) ? PPST_PRAGMA_EXPLICIT : PPST_NONE; + { + khiter_t it = kh_get(macros_map, src->macros_map, string_content(tok.tokv.str)); + if (it != kh_end(src->macros_map)) { + macro_t *m = &kh_val(src->macros_map, it); + int need_solve = !m->is_funlike; + VECTOR(preprocs) *margs = NULL; + loginfo_t li = tok.loginfo; + if (m->is_funlike) { + preproc_token_t tok2 = ppsrc_next_token(src); + size_t nnls = 0; + while (tok2.tokt == PPTOK_NEWLINE) { + ++nnls; + tok2 = ppsrc_next_token(src); + } + if ((tok2.tokt == PPTOK_SYM) && (tok2.tokv.sym == SYM_LPAREN)) { + need_solve = 1; + margs = vector_new(preprocs); + if (!margs) goto solve_err_mem; + VECTOR(preproc) *marg = vector_new(preproc); + if (!marg) goto solve_err_mem; + while (need_solve && (tok2.tokt != PPTOK_EOF) && (tok2.tokt != PPTOK_INVALID)) { + tok2 = ppsrc_next_token(src); + if ((need_solve == 1) && (tok2.tokt == PPTOK_SYM) && (tok2.tokv.sym == SYM_COMMA)) { + // Possible optimization: emplace NULL if vector_size(marg) == 0 + // This would avoid allocating a new vector + vector_trim(preproc, marg); + if (!vector_push(preprocs, margs, marg)) { + vector_del(preproc, marg); + goto solve_err_mem; + } + marg = vector_new(preproc); + if (!marg) goto solve_err_mem; + } else if (tok2.tokt != PPTOK_NEWLINE) { + if (!vector_push(preproc, marg, tok2)) { + vector_del(preproc, marg); + goto solve_err_mem; + } + } + if ((tok2.tokt == PPTOK_SYM) && (tok2.tokv.sym == SYM_LPAREN)) ++need_solve; + else if ((tok2.tokt == PPTOK_SYM) && (tok2.tokv.sym == SYM_RPAREN)) --need_solve; + } + li.lineno_end = tok2.loginfo.lineno_end ? tok2.loginfo.lineno_end : tok2.loginfo.lineno; + li.colno_end = tok2.loginfo.colno_end ? tok2.loginfo.colno_end : tok2.loginfo.colno; + if (need_solve) { + log_error(&li, "unfinished function-like macro %s\n", string_content(tok.tokv.str)); + vector_del(preprocs, margs); + vector_del(preproc, marg); + string_del(tok.tokv.str); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok2.loginfo; + ret.tokv.c = tok.tokv.c; + return ret; + } + // margs finishes with a SYM_RPAREN token + vector_pop(preproc, marg); + vector_trim(preproc, marg); + if (!vector_push(preprocs, margs, marg)) { + vector_del(preproc, marg); + goto solve_err_mem; + } + need_solve = 1; + } else { + if (!vector_reserve(ppsource, src->prep, vector_size(ppsource, src->prep) + nnls + 1)) { + log_memory("undoing lookahead for macro use %s\n", string_content(tok.tokv.str)); + string_del(tok.tokv.str); + preproc_token_del(&tok2); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = li; + ret.tokv.c = '\0'; + return ret; + } + vector_push(ppsource, src->prep, ((ppsource_t){.srct = PPSRC_PPTOKEN, .srcv.pptok = tok2})); + while (nnls--) { + vector_push( + ppsource, + src->prep, + ((ppsource_t){.srct = PPSRC_PPTOKEN, .srcv.pptok = {.tokt = PPTOK_NEWLINE, .tokv.c = '\n'}})); + } + } + } + if (need_solve) { + khash_t(string_set) *solved_macros = kh_init(string_set); + if (!solved_macros) goto solve_err_mem; + + char *mname = string_steal(tok.tokv.str); + + VECTOR(preproc) *solved = preproc_solve_macro(&li, src->macros_map, mname, m, margs, solved_macros, NULL); + if (margs) vector_del(preprocs, margs); + macros_set_del(solved_macros); + if (!solved) { + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = li; + ret.tokv.c = '\0'; + return ret; + } + // If the expansion is empty, don't push it + if (vector_size(preproc, solved)) { + if (!vector_push(ppsource, src->prep, ((ppsource_t){.srct = PPSRC_PPTOKENS, .srcv.pptoks = {.idx = 0, .toks = solved}}))) { + log_memory("pushing expanded macro\n"); + vector_del(preproc, solved); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = li; + ret.tokv.c = '\0'; + return ret; + } + } else { + vector_del(preproc, solved); + } + // src->prep is not empty (either through the push or by not popping the top) + goto start_next_token; + } else { + if (margs) vector_del(preprocs, margs); + } + + if (0) { + solve_err_mem: + log_memory("parsing macro use %s\n", string_content(tok.tokv.str)); + if (margs) vector_del(preprocs, margs); + string_del(tok.tokv.str); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = li; + ret.tokv.c = '\0'; + return ret; + } + } + } + /* FALLTHROUGH */ + case PPTOK_IDENT_UNEXP: { + khiter_t it = kh_get(str2kw, str2kw, string_content(tok.tokv.str)); + if (it == kh_end(str2kw)) { + ret.tokt = PTOK_IDENT; + ret.tokv.str = tok.tokv.str; + } else { + string_del(tok.tokv.str); + ret.tokt = PTOK_KEYWORD; + ret.tokv.kw = kh_val(str2kw, it); + } + ret.loginfo = tok.loginfo; + return ret; } + case PPTOK_NUM: + src->st = (src->st == PPST_PRAGMA_EXPLICIT) ? PPST_PRAGMA_EXPLICIT : PPST_NONE; + ret.tokt = PTOK_NUM; + ret.loginfo = tok.loginfo; + ret.tokv.str = tok.tokv.str; + return ret; + case PPTOK_STRING: + src->st = (src->st == PPST_PRAGMA_EXPLICIT) ? PPST_PRAGMA_EXPLICIT : PPST_NONE; + ret.tokt = PTOK_STRING; + ret.loginfo = tok.loginfo; + ret.tokv = (union proc_token_val_u){.sstr = tok.tokv.sstr, .sisstr = tok.tokv.sisstr}; + return ret; + case PPTOK_INCL: + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = tok.tokv.sisstr ? '<' : '"'; + string_del(tok.tokv.sstr); + return ret; + case PPTOK_SYM: + if ((src->st == PPST_NL) && (tok.tokv.sym == SYM_HASH)) { + tok = ppsrc_next_token(src); + if ((tok.tokt == PPTOK_NEWLINE) || (tok.tokt == PPTOK_EOF)) { + // Empty preprocessor command + goto start_cur_token; + } + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) goto preproc_hash_err; + if (!strcmp(string_content(tok.tokv.str), "include") || !strcmp(string_content(tok.tokv.str), "include_next")) { + int is_next = string_content(tok.tokv.str)[7] == '_'; + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + loginfo_t li = tok.loginfo; + string_t *incl_file; + int is_sys; + if (tok.tokt == PPTOK_INCL) { + incl_file = tok.tokv.sstr; + // Assume we only have one #include "..." path, so include_next is always a system include + is_sys = is_next || !tok.tokv.sisstr; + tok = ppsrc_next_token(src); // Token was moved + loginfo_t ignored_infos = tok.loginfo; int has_ignored = 0; + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + has_ignored = 1; + ignored_infos.lineno_end = tok.loginfo.lineno_end ? tok.loginfo.lineno_end : tok.loginfo.lineno; + ignored_infos.colno_end = tok.loginfo.colno_end ? tok.loginfo.colno_end : tok.loginfo.colno; + preproc_token_del(&tok); + tok = ppsrc_next_token(src); + } + if (has_ignored) { + log_warning(&ignored_infos, "ignored tokens after #include%s directive\n", is_next ? "_next" : ""); + } + } else { + // Expand macro, then try again + VECTOR(preproc) *incl = vector_new(preproc); + if (!incl) { + log_memory("failed to allocate #include tokens vector\n"); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + if (!vector_push(preproc, incl, tok)) { + log_memory("failed to add token to #include tokens vector\n"); + vector_del(preproc, incl); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + li.lineno_end = tok.loginfo.lineno_end ? tok.loginfo.lineno_end : tok.loginfo.lineno; + li.colno_end = tok.loginfo.colno_end ? tok.loginfo.colno_end : tok.loginfo.colno; + tok = ppsrc_next_token(src); + } + vector_trim(preproc, incl); + khash_t(string_set) *solved_macros = kh_init(string_set); + if (!solved_macros) { + log_memory("failed to allocate #include solved_macros set\n"); + vector_del(preproc, incl); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + + VECTOR(preproc) *expanded = preproc_do_expand(&li, src->macros_map, incl, solved_macros, src->macros_used); + vector_del(preproc, incl); + macros_set_del(solved_macros); + if (!expanded) { + log_error(&li, "failed to expand #include tokens\n"); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.tokv.c = '\0'; + return ret; + } + + // Now we need to check what is pointed by expanded + if (!vector_size(preproc, expanded)) { + log_error(&li, "missing #include name\n"); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + if (vector_content(preproc, expanded)[0].tokt == PPTOK_STRING) { + is_sys = is_next || src->is_sys; + preproc_token_t *exp = vector_content(preproc, expanded); + log_error(&li, "TODO: #include \n", string_content(exp->tokv.sstr), exp->tokv.sisstr); + vector_del(preproc, expanded); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } else if ((vector_content(preproc, expanded)[0].tokt == PPTOK_SYM) && (vector_content(preproc, expanded)[0].tokv.sym == SYM_LT) + && (vector_last(preproc, expanded).tokt == PPTOK_SYM) && (vector_last(preproc, expanded).tokv.sym == SYM_GT) + && (vector_size(preproc, expanded) >= 3)) { + log_warning(&li, "#include command with macro expansion, assuming no space is present in the file name\n"); + is_sys = 0; + incl_file = string_new(); + for (vector_preproc_elem *tok2 = expanded->content + 1; tok2 < expanded->content + expanded->vsize - 1; ++tok2) { + switch (tok2->tokt) { + case PPTOK_IDENT: + case PPTOK_IDENT_UNEXP: + if (!string_add_string(incl_file, tok2->tokv.str)) { + log_memory("failed to add ident to include string\n"); + vector_del(preproc, expanded); + string_del(incl_file); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + break; + case PPTOK_SYM: + if (!string_add_cstr(incl_file, sym2str[tok2->tokv.sym])) { + log_memory("failed to add symbol to include string\n"); + vector_del(preproc, expanded); + string_del(incl_file); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + break; + + case PPTOK_INVALID: + case PPTOK_NUM: + case PPTOK_STRING: + case PPTOK_INCL: + case PPTOK_NEWLINE: + case PPTOK_BLANK: + case PPTOK_START_LINE_COMMENT: + case PPTOK_EOF: + default: + log_error(&li, "TODO: add token type %u to include string\n", tok2->tokt); + vector_del(preproc, expanded); + string_del(incl_file); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + } + vector_del(preproc, expanded); + } else { + log_error(&li, "invalid #include command (macro expansion does not result in string or <...>)\n"); + vector_del(preproc, expanded); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + } + // cur_pathno == 0 if cur_file was from an #include "...", otherwise idx + 1 +#ifdef LOG_INCLUDE + printf("Opening %s as %s from system path %zu\n", string_content(incl_file), + is_sys ? "system header" : "cur header", is_next ? src->cur_pathno : 0); +#endif + if ((is_sys || !try_open_dir(src, incl_file)) && !try_open_sys(src, incl_file, is_next ? src->cur_pathno : 0)) { + log_error(&li, "failed to open %s\n", string_content(incl_file)); + string_del(incl_file); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = li; + ret.tokv.c = is_sys ? '<' : '"'; + return ret; + } + string_del(incl_file); + if (tok.tokt == PPTOK_NEWLINE) goto check_next_token; + else goto start_cur_token; + } else if (!strcmp(string_content(tok.tokv.str), "define")) { + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) { + log_error(&tok.loginfo, "invalid token type %u after '#define' preprocessor command\n", tok.tokt); + goto preproc_hash_err; + } + string_t *defname = tok.tokv.str; + macro_t m = (macro_t){ .is_funlike = 0, .has_varargs = 0, .nargs = 0, .toks = vector_new(mtoken) }; + if (!m.toks) { + log_memory("failed to allocate token vector for macro %s\n", string_content(defname)); + string_del(defname); // Token is now freed + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + khash_t(argid_map) *args = NULL; + tok = ppsrc_next_token(src); + if ((tok.tokt == PPTOK_SYM) && (tok.tokv.sym == SYM_LPAREN)) { + m.is_funlike = 1; + args = kh_init(argid_map); + if (!args) { + log_memory("failed to allocate args map for macro %s\n", string_content(defname)); + string_del(defname); // Token is now freed + vector_del(mtoken, m.toks); + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + m.nargs = 0; + tok = ppsrc_next_token(src); + int ok; + if ((tok.tokt == PPTOK_SYM) && (tok.tokv.sym == SYM_RPAREN)) { + ok = 1; + } else { + ok = 0; + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + if ((tok.tokt == PPTOK_SYM) && (tok.tokv.sym == SYM_VARIADIC)) { + m.has_varargs = 1; + int kh_ret; + char *tok_str = strdup("__VA_ARGS__"); + khiter_t kh_k = kh_put(argid_map, args, tok_str, &kh_ret); // Moves the string content + if (kh_ret < 0) { // Failed to move, needs to free here + log_memory("failed to push arg %s for macro %s\n", tok_str, string_content(defname)); + string_del(defname); + free(tok_str); + vector_del(mtoken, m.toks); + argid_map_del(args); + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + if (kh_ret == 0) { + log_error(&tok.loginfo, "duplicate argument name %s defining macro %s\n", tok_str, string_content(defname)); + string_del(defname); + vector_del(mtoken, m.toks); + argid_map_del(args); + goto preproc_hash_err; + } + kh_val(args, kh_k) = m.nargs; + // Empty token destructor + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_SYM) || (tok.tokv.sym != SYM_RPAREN)) { + log_error(&tok.loginfo, "invalid token type %u after variadic macro arguments definition\n", tok.tokt); + string_del(defname); + vector_del(mtoken, m.toks); + argid_map_del(args); + goto preproc_hash_err; + } + ok = 1; + break; + } else if ((tok.tokt == PPTOK_IDENT) || (tok.tokt == PPTOK_IDENT_UNEXP)) { + int kh_ret; + char *tok_str = string_steal(tok.tokv.str); + khiter_t kh_k = kh_put(argid_map, args, tok_str, &kh_ret); // Moves the string content + if (kh_ret < 0) { // Failed to move, needs to free here + log_memory("failed to push arg %s for macro %s\n", tok_str, string_content(defname)); + string_del(defname); + free(tok_str); + vector_del(mtoken, m.toks); + argid_map_del(args); + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + if (kh_ret == 0) { + log_error(&tok.loginfo, "duplicate argument name %s defining macro %s\n", tok_str, string_content(defname)); + string_del(defname); + vector_del(mtoken, m.toks); + argid_map_del(args); + // Token was already deleted, create a fake token + tok.tokt = PPTOK_SYM; + tok.tokv.sym = LAST_SYM; + goto preproc_hash_err; + } + kh_val(args, kh_k) = m.nargs++; + // Token content is the string, which is moved to the vector + tok = ppsrc_next_token(src); + if ((tok.tokt == PPTOK_SYM) && (tok.tokv.sym == SYM_COMMA)) { + // Empty destructor + tok = ppsrc_next_token(src); + } else if ((tok.tokt == PPTOK_SYM) && (tok.tokv.sym == SYM_RPAREN)) { + // Empty destructor + ok = 1; + break; + } else if ((tok.tokt == PPTOK_SYM) && (tok.tokv.sym == SYM_VARIADIC)) { + m.has_varargs = 1; + --m.nargs; + // Empty token destructor + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_SYM) || (tok.tokv.sym != SYM_RPAREN)) { + log_error(&tok.loginfo, "invalid token type %u after variadic macro arguments definition\n", tok.tokt); + string_del(defname); + vector_del(mtoken, m.toks); + argid_map_del(args); + goto preproc_hash_err; + } + ok = 1; + break; + } else { + log_error(&tok.loginfo, "invalid %s type %u in macro arguments definition\n", + (tok.tokt == PPTOK_SYM) ? "symbol" : "token", + (tok.tokt == PPTOK_SYM) ? tok.tokv.sym : tok.tokt); + string_del(defname); + vector_del(mtoken, m.toks); + argid_map_del(args); + goto preproc_hash_err; + } + } else { + log_error(&tok.loginfo, "invalid %s type %u as macro arguments definition name\n", + (tok.tokt == PPTOK_SYM) ? "symbol" : "token", (tok.tokt == PPTOK_SYM) ? tok.tokv.sym : tok.tokt); + string_del(defname); + vector_del(mtoken, m.toks); + argid_map_del(args); + goto preproc_hash_err; + } + } + } + if (!ok) { + log_error(&tok.loginfo, "invalid macro definition for %s\n", string_content(defname)); + string_del(defname); + vector_del(mtoken, m.toks); + argid_map_del(args); + goto preproc_hash_err; + } + // tok is ')', empty destructor + tok = ppsrc_next_token(src); + } + if (tok.tokt == PPTOK_BLANK) { + // BLANK has no destructor + tok = ppsrc_next_token(src); + } + // All tokens until INVALID/NL/EOF are macro content + int state = 0; +#define ST_CONCAT 1 +#define ST_STR 2 + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + if ((tok.tokt == PPTOK_SYM) && (tok.tokv.sym == SYM_HASH)) { + if (state & ST_STR) { + log_warning(&tok.loginfo, "duplicated stringify in macro definition (defining %s)\n", string_content(defname)); + } else { + state |= ST_STR; + } + // Empty destructor + tok = ppsrc_next_token(src); + continue; + } + if ((tok.tokt == PPTOK_SYM) && (tok.tokv.sym == SYM_HASHHASH)) { + if (state & ST_CONCAT) { + log_warning(&tok.loginfo, "duplicated concatenation in macro definition (defining %s)\n", string_content(defname)); + } else if (!vector_size(mtoken, m.toks)) { + log_warning(&tok.loginfo, "invalid concatenation at start of macro definition (defining %s)\n", string_content(defname)); + } else { + state |= ST_CONCAT; + } + // Empty destructor + tok = ppsrc_next_token(src); + continue; + } + mtoken_t *mtok; + unsigned argid = -1u; + if (m.is_funlike && ((tok.tokt == PPTOK_IDENT) || (tok.tokt == PPTOK_IDENT_UNEXP))) { + khiter_t kh_k = kh_get(argid_map, args, string_content(tok.tokv.str)); + if (kh_k != kh_end(args)) { + string_del(tok.tokv.str); // Token freed + argid = kh_val(args, kh_k); + } + } + if (argid != -1u) { + mtok = mtoken_new_arg(argid, state & ST_STR); + if (!mtok) { + log_memory("failed to allocate new m-token (defining %s)\n", string_content(defname)); + string_del(defname); + macro_del(&m); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = tok.tokv.c; + return ret; + } + state &= ~ST_STR; + } else { + mtok = mtoken_new_token(tok); // Token moved + if (!mtok) { + log_memory("failed to allocate new m-token (defining %s)\n", string_content(defname)); + string_del(defname); + macro_del(&m); + if (tok.tokt == PPTOK_NEWLINE) goto check_next_token; + else goto start_cur_token; + } + if (state & ST_STR) { + log_warning(&tok.loginfo, "invalid stringify before token (defining %s)\n", string_content(defname)); + state &= ~ST_STR; + } + } + if (state & ST_CONCAT) { + mtoken_t *mtok2 = vector_last(mtoken, m.toks); // Guaranteed to exist before setting ST_CONCAT + mtok = mtoken_new_concat(mtok2, mtok); + if (!mtok) { + log_memory("failed to allocate new m-token concatenation (defining %s)\n", string_content(defname)); + string_del(defname); + macro_del(&m); + vector_pop_nodel(mtoken, m.toks); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = tok.tokv.c; + return ret; + } + vector_last(mtoken, m.toks) = mtok; + state &= ~ST_CONCAT; + } else { + if (!vector_push(mtoken, m.toks, mtok)) { + log_memory("failed to add m-token (defining %s)\n", string_content(defname)); + string_del(defname); + macro_del(&m); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = tok.tokv.c; + return ret; + } + } + // mtok moved to the vector + tok = ppsrc_next_token(src); + } +#undef ST_CONCAT +#undef ST_STR + if (args) argid_map_del(args); + if (tok.tokt == PPTOK_INVALID) { + // Abort + log_error(&tok.loginfo, "unexpected invalid input token\n"); + string_del(defname); + macro_del(&m); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = tok.tokv.c; + return ret; + } else { + // NL and EOF have empty destructors + khiter_t kh_k; + int iret; + char *mname_dup = string_steal(defname); + kh_k = kh_put(string_set, src->macros_defined, mname_dup, &iret); + if (iret < 0) { + // Abort + log_memory("failed to remember macro %s as defined, aborting\n", mname_dup); + free(mname_dup); + macro_del(&m); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = tok.tokv.c; + return ret; + } else if (iret > 0) { + mname_dup = strdup(mname_dup); + } + kh_k = kh_put(macros_map, src->macros_map, mname_dup, &iret); + if (iret < 0) { + // Abort + log_memory("failed to remember macro %s, aborting\n", mname_dup); + free(mname_dup); + macro_del(&m); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = tok.tokv.c; + return ret; + } else if (iret == 0) { + // Ignore + // Too noisy log_warning(&tok.loginfo, "Duplicated macro %s\n", mname_dup); + free(mname_dup); + macro_del(&m); + } else { + kh_val(src->macros_map, kh_k) = m; + } + if (tok.tokt == PPTOK_NEWLINE) goto check_next_token; + else goto start_cur_token; + } + } else if (!strcmp(string_content(tok.tokv.str), "undef")) { + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) { + log_error(&tok.loginfo, "invalid token type %u after '#undef' preprocessor command\n", tok.tokt); + goto preproc_hash_err; + } + string_t *mname = tok.tokv.str; + tok = ppsrc_next_token(src); // Token was moved + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + // TODO: Print warning 'ignored token(s)' + preproc_token_del(&tok); + tok = ppsrc_next_token(src); + } + khiter_t it = kh_get(macros_map, src->macros_map, string_content(mname)); + if (it != kh_end(src->macros_map)) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" + free((void*)kh_key(src->macros_map, it)); +#pragma GCC diagnostic pop + macro_del(&kh_val(src->macros_map, it)); + kh_del(macros_map, src->macros_map, it); + } + string_del(mname); + if (tok.tokt == PPTOK_NEWLINE) goto check_next_token; + else goto start_cur_token; + } else if (!strcmp(string_content(tok.tokv.str), "error")) { + log_error(&tok.loginfo, "#error command:"); + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + switch (tok.tokt) { + case PPTOK_IDENT: + case PPTOK_IDENT_UNEXP: + printf(" %s", string_content(tok.tokv.str)); + break; + case PPTOK_SYM: + printf("%s%s", (tok.tokv.sym == SYM_COMMA) ? "" : " ", sym2str[tok.tokv.sym]); + break; + case PPTOK_STRING: + printf(" %c%s%c", tok.tokv.sisstr ? '"' : '\'', string_content(tok.tokv.sstr), tok.tokv.sisstr ? '"' : '\''); + break; + + case PPTOK_INVALID: + case PPTOK_NUM: + case PPTOK_INCL: + case PPTOK_NEWLINE: + case PPTOK_BLANK: + case PPTOK_START_LINE_COMMENT: + case PPTOK_EOF: + default: + printf(" ", tok.tokt); + } + preproc_token_del(&tok); + tok = ppsrc_next_token(src); + } + printf("\n"); + vector_clear(ppsource, src->prep); + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = (char)EOF; + return ret; + } else if (!strcmp(string_content(tok.tokv.str), "warning")) { + log_warning(&tok.loginfo, "#warning command:"); + tok = ppsrc_next_token(src); + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + switch (tok.tokt) { + case PPTOK_IDENT: + case PPTOK_IDENT_UNEXP: + printf(" %s", string_content(tok.tokv.str)); + break; + case PPTOK_SYM: + printf("%s%s", (tok.tokv.sym == SYM_COMMA) ? "" : " ", sym2str[tok.tokv.sym]); + break; + case PPTOK_STRING: + printf(" %c%s%c", tok.tokv.sisstr ? '"' : '\'', string_content(tok.tokv.sstr), tok.tokv.sisstr ? '"' : '\''); + break; + + case PPTOK_INVALID: + case PPTOK_NUM: + case PPTOK_INCL: + case PPTOK_NEWLINE: + case PPTOK_BLANK: + case PPTOK_START_LINE_COMMENT: + case PPTOK_EOF: + default: + printf(" ", tok.tokt); + } + preproc_token_del(&tok); + tok = ppsrc_next_token(src); + } + printf("\n"); + goto preproc_hash_err; + } else if (!strcmp(string_content(tok.tokv.str), "pragma")) { + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) { + log_error(&tok.loginfo, "unknown pragma directive, skipping until EOL\n"); + goto preproc_hash_err; + } else if (!strcmp(string_content(tok.tokv.str), "once")) { + const char *fname = tok.loginfo.filename; + if (!vector_push(ccharp, src->pragma_once, fname)) { + log_memory("failed to add filename to #pragma once list\n"); + vector_clear(ppsource, src->prep); + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = (char)EOF; + return ret; + } + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + goto preproc_hash_err; + } else if (!strcmp(string_content(tok.tokv.str), "wrappers")) { + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) { + log_error(&tok.loginfo, "unknown pragma wrappers directive, skipping until EOL\n"); + goto preproc_hash_err; + } else if (!strcmp(string_content(tok.tokv.str), "allow_ints_ext")) { + ret.loginfo = tok.loginfo; + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + preproc_token_del(&tok); + tok = ppsrc_next_token(src); + } + if (tok.tokt == PPTOK_INVALID) goto start_cur_token; + else { + ret.tokt = PTOK_PRAGMA; + ret.tokv.pragma.typ = PRAGMA_ALLOW_INTS; + return ret; + } + } else if (!strcmp(string_content(tok.tokv.str), "mark_simple")) { + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) { + log_error(&tok.loginfo, "invalid pragma wrappers explicit_simple directive, skipping until EOL\n"); + goto preproc_hash_err; + } + src->st = PPST_NL; + ret.tokt = PTOK_PRAGMA; + ret.loginfo = tok.loginfo; + ret.tokv.pragma.typ = PRAGMA_SIMPLE_SU; + ret.tokv.pragma.val = tok.tokv.str; + tok = ppsrc_next_token(src); + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + preproc_token_del(&tok); + tok = ppsrc_next_token(src); + } + if (tok.tokt == PPTOK_INVALID) { + string_del(ret.tokv.pragma.val); + goto start_cur_token; + } else { + return ret; + } + } else if (!strcmp(string_content(tok.tokv.str), "type_letters")) { + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) { + log_error(&tok.loginfo, "invalid pragma wrappers explicit_simple directive, skipping until EOL\n"); + goto preproc_hash_err; + } + src->st = PPST_PRAGMA_EXPLICIT; + ret.tokt = PTOK_PRAGMA; + ret.loginfo = tok.loginfo; + ret.tokv.pragma.typ = PRAGMA_EXPLICIT_CONV; + ret.tokv.pragma.val = tok.tokv.str; + return ret; + } else if (!strcmp(string_content(tok.tokv.str), "type_letters_exact")) { + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) { + log_error(&tok.loginfo, "invalid pragma wrappers explicit_simple directive, skipping until EOL\n"); + goto preproc_hash_err; + } + src->st = PPST_PRAGMA_EXPLICIT; + ret.tokt = PTOK_PRAGMA; + ret.loginfo = tok.loginfo; + ret.tokv.pragma.typ = PRAGMA_EXPLICIT_CONV_STRICT; + ret.tokv.pragma.val = tok.tokv.str; + return ret; + } else { + log_error(&tok.loginfo, "unknown pragma wrappers directive '%s', skipping until EOL\n", string_content(tok.tokv.str)); + goto preproc_hash_err; + } + } else { + log_error(&tok.loginfo, "unknown pragma directive '%s', skipping until EOL\n", string_content(tok.tokv.str)); + goto preproc_hash_err; + } + } else if (!strcmp(string_content(tok.tokv.str), "if")) { + if (vector_last(ppsource, src->prep).srct != PPSRC_PREPARE) { + log_error(&tok.loginfo, "invalid #if source type %u\n", vector_last(ppsource, src->prep).srct); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + string_del(tok.tokv.str); + VECTOR(preproc) *cond = vector_new(preproc); + if (!cond) { + log_memory("failed to allocate #if condition vector\n"); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + tok = ppsrc_next_token(src); + loginfo_t li = tok.loginfo; + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + if (!vector_push(preproc, cond, tok)) { + log_memory("failed to add token to #if condition vector\n"); + vector_del(preproc, cond); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + li.lineno_end = tok.loginfo.lineno_end ? tok.loginfo.lineno_end : tok.loginfo.lineno; + li.colno_end = tok.loginfo.colno_end ? tok.loginfo.colno_end : tok.loginfo.colno; + tok = ppsrc_next_token(src); + } + vector_trim(preproc, cond); + khash_t(string_set) *solved_macros = kh_init(string_set); + if (!solved_macros) { + log_memory("failed to allocate #if solved_macros set\n"); + vector_del(preproc, cond); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + + VECTOR(preproc) *expanded = preproc_do_expand(&li, src->macros_map, cond, solved_macros, src->macros_used); + vector_del(preproc, cond); + macros_set_del(solved_macros); + if (!expanded) { + log_error(&li, "Error: failed to expand #if condition\n"); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + + // Now we need to compute what is pointed by expanded, and increase cond_depth and ok_depth as needed + int st; + int64_t res = preproc_eval(expanded, &st, src->target->size_long == 4); + vector_del(preproc, expanded); + if (!st) { + log_error(&li, "Error: failed to evaluate #if condition\n"); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } + ++vector_last(ppsource, src->prep).srcv.prep.cond_depth; + if (res) { + ++vector_last(ppsource, src->prep).srcv.prep.ok_depth; + if (tok.tokt == PPTOK_NEWLINE) goto check_next_token; + else goto start_cur_token; + } else { + vector_last(ppsource, src->prep).srcv.prep.entered_next_ok_cond = 0; + if (tok.tokt == PPTOK_NEWLINE) goto check_if_depth; + else goto start_cur_token; // Returns immediately + } + } else if (!strcmp(string_content(tok.tokv.str), "ifdef")) { + if (vector_last(ppsource, src->prep).srct != PPSRC_PREPARE) { + log_error(&tok.loginfo, "invalid #ifdef source type %u\n", vector_last(ppsource, src->prep).srct); + goto preproc_hash_err; + } + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) { + log_error(&tok.loginfo, "invalid token type %u after '#ifdef' preprocessor command\n", tok.tokt); + goto preproc_hash_err; + } + khiter_t it = kh_get(macros_map, src->macros_map, string_content(tok.tokv.str)); + int iret; + char *mname = string_steal(tok.tokv.str); + kh_put(string_set, src->macros_used, mname, &iret); + if (iret <= 0) { + free(mname); + } + tok.tokt = PPTOK_SYM; + tok.tokv.sym = LAST_SYM; + // We don't care about iret(?) + // TODO: check iret, error if needed + ++vector_last(ppsource, src->prep).srcv.prep.cond_depth; + if (it != kh_end(src->macros_map)) { + ++vector_last(ppsource, src->prep).srcv.prep.ok_depth; + goto preproc_hash_err; + } else { + vector_last(ppsource, src->prep).srcv.prep.entered_next_ok_cond = 0; + goto preproc_hash_err_goto; + } + } else if (!strcmp(string_content(tok.tokv.str), "ifndef")) { + if (vector_last(ppsource, src->prep).srct != PPSRC_PREPARE) { + log_error(&tok.loginfo, "invalid #ifndef source type %u\n", vector_last(ppsource, src->prep).srct); + goto preproc_hash_err; + } + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + if ((tok.tokt != PPTOK_IDENT) && (tok.tokt != PPTOK_IDENT_UNEXP)) { + log_error(&tok.loginfo, "invalid token type %u after '#ifndef' preprocessor command\n", tok.tokt); + goto preproc_hash_err; + } + khiter_t it = kh_get(macros_map, src->macros_map, string_content(tok.tokv.str)); + int iret; + char *mname = string_steal(tok.tokv.str); + kh_put(string_set, src->macros_used, mname, &iret); + if (iret <= 0) { + free(mname); + } + tok.tokt = PPTOK_SYM; + tok.tokv.sym = LAST_SYM; + // We don't care about iret(?) + // TODO: check iret, error if needed + ++vector_last(ppsource, src->prep).srcv.prep.cond_depth; + if (it == kh_end(src->macros_map)) { + ++vector_last(ppsource, src->prep).srcv.prep.ok_depth; + goto preproc_hash_err; + } else { + vector_last(ppsource, src->prep).srcv.prep.entered_next_ok_cond = 0; + goto preproc_hash_err_goto; + } + } else if (!strcmp(string_content(tok.tokv.str), "elif")) { + // We are already in an #if or #elif (or #else) with a match, so we need to leave it and go to the very top + if (vector_last(ppsource, src->prep).srct != PPSRC_PREPARE) { + log_error(&tok.loginfo, "invalid #elif source type %u\n", vector_last(ppsource, src->prep).srct); + goto preproc_hash_err; + } + if (vector_last(ppsource, src->prep).srcv.prep.ok_depth) { + vector_last(ppsource, src->prep).srcv.prep.entered_next_ok_cond = 1; + --vector_last(ppsource, src->prep).srcv.prep.ok_depth; + goto preproc_hash_err_goto; + } else { + log_warning(&tok.loginfo, "unexpected #elif preprocessor command\n"); + goto preproc_hash_err; + } + } else if (!strcmp(string_content(tok.tokv.str), "elifdef")) { + // We are already in an #if or #elif (or #else) with a match, so we need to leave it and go to the very top + if (vector_last(ppsource, src->prep).srct != PPSRC_PREPARE) { + log_error(&tok.loginfo, "invalid #elifdef source type %u\n", vector_last(ppsource, src->prep).srct); + goto preproc_hash_err; + } + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + int iret; + char *mname = string_steal(tok.tokv.str); + kh_put(string_set, src->macros_used, mname, &iret); + if (iret <= 0) { + free(mname); + } + tok.tokt = PPTOK_SYM; + tok.tokv.sym = LAST_SYM; + // We don't care about iret(?) + // TODO: check iret, error if needed + if (vector_last(ppsource, src->prep).srcv.prep.ok_depth) { + vector_last(ppsource, src->prep).srcv.prep.entered_next_ok_cond = 1; + --vector_last(ppsource, src->prep).srcv.prep.ok_depth; + goto preproc_hash_err_goto; + } else { + log_warning(&tok.loginfo, "unexpected #elifdef preprocessor command\n"); + goto preproc_hash_err; + } + } else if (!strcmp(string_content(tok.tokv.str), "elifndef")) { + // We are already in an #if or #elif (or #else) with a match, so we need to leave it and go to the very top + if (vector_last(ppsource, src->prep).srct != PPSRC_PREPARE) { + log_error(&tok.loginfo, "invalid #elifndef source type %u\n", vector_last(ppsource, src->prep).srct); + goto preproc_hash_err; + } + string_del(tok.tokv.str); + tok = ppsrc_next_token(src); + int iret; + char *mname = string_steal(tok.tokv.str); + kh_put(string_set, src->macros_used, mname, &iret); + if (iret <= 0) { + free(mname); + } + tok.tokt = PPTOK_SYM; + tok.tokv.sym = LAST_SYM; + // We don't care about iret(?) + // TODO: check iret, error if needed + if (vector_last(ppsource, src->prep).srcv.prep.ok_depth) { + vector_last(ppsource, src->prep).srcv.prep.entered_next_ok_cond = 1; + --vector_last(ppsource, src->prep).srcv.prep.ok_depth; + goto preproc_hash_err_goto; + } else { + log_warning(&tok.loginfo, "unexpected #elifndef preprocessor command\n"); + goto preproc_hash_err; + } + } else if (!strcmp(string_content(tok.tokv.str), "else")) { + // We are already in an #if or #elif (or #else) with a match, so we need to leave it and go to the very top + if (vector_last(ppsource, src->prep).srct != PPSRC_PREPARE) { + log_error(&tok.loginfo, "invalid #else source type %u\n", vector_last(ppsource, src->prep).srct); + goto preproc_hash_err; + } + if (vector_last(ppsource, src->prep).srcv.prep.ok_depth) { + // We can safely ignore setting entered_next_ok since two #else is illegal (though this parser doesn't actually detect this) + --vector_last(ppsource, src->prep).srcv.prep.ok_depth; + goto preproc_hash_err_goto; + } else { + log_warning(&tok.loginfo, "unexpected #else preprocessor command\n"); + goto preproc_hash_err; + } + } else if (!strcmp(string_content(tok.tokv.str), "endif")) { + if (vector_last(ppsource, src->prep).srct != PPSRC_PREPARE) { + log_error(&tok.loginfo, "invalid #endif source type %u\n", vector_last(ppsource, src->prep).srct); + goto preproc_hash_err; + } + if (vector_last(ppsource, src->prep).srcv.prep.ok_depth) { + --vector_last(ppsource, src->prep).srcv.prep.ok_depth; + --vector_last(ppsource, src->prep).srcv.prep.cond_depth; + } else { + log_warning(&tok.loginfo, "unexpected #endif preprocessor command\n"); + } + goto preproc_hash_err; + } + + log_warning(&tok.loginfo, "Unknown preprocessor command %s, skipping until EOL\n", string_content(tok.tokv.str)); + preproc_hash_err: + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + preproc_token_del(&tok); + tok = ppsrc_next_token(src); + } + if (tok.tokt == PPTOK_NEWLINE) goto check_next_token; + else goto start_cur_token; + + preproc_hash_err_goto: + while ((tok.tokt != PPTOK_NEWLINE) && (tok.tokt != PPTOK_EOF) && (tok.tokt != PPTOK_INVALID)) { + preproc_token_del(&tok); + tok = ppsrc_next_token(src); + } + if (tok.tokt == PPTOK_NEWLINE) goto check_if_depth; + else goto start_cur_token; // Returns immediately + } + src->st = (src->st == PPST_PRAGMA_EXPLICIT) ? PPST_PRAGMA_EXPLICIT : PPST_NONE; + ret.tokt = PTOK_SYM; + ret.loginfo = tok.loginfo; + ret.tokv.sym = tok.tokv.sym; + return ret; + case PPTOK_NEWLINE: + if (src->st == PPST_PRAGMA_EXPLICIT) { + src->st = PPST_NL; + ret.tokt = PTOK_SYM; + ret.loginfo = tok.loginfo; + ret.tokv.sym = SYM_SEMICOLON; + return ret; + } + src->st = PPST_NL; + goto check_next_token; + case PPTOK_BLANK: + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = tok.tokv.c; + return ret; + case PPTOK_START_LINE_COMMENT: + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = tok.tokv.c; + return ret; + case PPTOK_EOF: + if ((vector_last(ppsource, src->prep).srct == PPSRC_PREPARE) && vector_last(ppsource, src->prep).srcv.prep.cond_depth) { + log_warning(&tok.loginfo, "file ended before closing all conditionals (ignoring)\n"); + } +#ifdef LOG_CLOSE + printf("Closing %s\n", src->cur_file); +#endif + if (vector_last(ppsource, src->prep).srct == PPSRC_PREPARE) { + if (src->dirname) free(src->dirname); + if (src->cur_file) free(src->cur_file); + src->dirname = vector_last(ppsource, src->prep).srcv.prep.old_dirname; + src->cur_file = vector_last(ppsource, src->prep).srcv.prep.old_filename; + src->is_sys = vector_last(ppsource, src->prep).srcv.prep.was_sys; + src->cur_pathno = vector_last(ppsource, src->prep).srcv.prep.old_pathno; + vector_last(ppsource, src->prep).srcv.prep.old_dirname = NULL; + vector_last(ppsource, src->prep).srcv.prep.old_filename = NULL; + } + vector_pop(ppsource, src->prep); + if (src->st == PPST_PRAGMA_EXPLICIT) { + src->st = PPST_NL; + ret.tokt = PTOK_SYM; + ret.loginfo = (loginfo_t){0}; // The token's loginfo may have been deleted by the vector_pop above + ret.tokv.sym = SYM_SEMICOLON; + // Empty destructor + return ret; + } + src->st = PPST_NL; // Should be redundant since TOK_NEWLINE is added before TOK_EOF if required + // EOF has an empty destructor + // Note that since we have opened the file, the previous file also had ok_depth == cond_depth + goto check_next_token; + + default: + log_error(&tok.loginfo, "unknown preprocessor token type %u, sending INVALID\n", tok.tokt); + ret.tokt = PTOK_INVALID; + ret.loginfo = tok.loginfo; + ret.tokv.c = '\0'; + return ret; + } +} +proc_token_t proc_next_token(preproc_t *src) { + proc_token_t ret = proc_next_token_aux(src); + if ((ret.tokt == PTOK_STRING) && ret.tokv.sisstr) { + while (1) { + proc_token_t ret2 = proc_next_token_aux(src); + if ((ret2.tokt == PTOK_STRING) && ret2.tokv.sisstr) { + if (!string_add_string(ret.tokv.sstr, ret2.tokv.sstr)) { + log_memory("failed to concatenate adjacent strings\n"); + string_del(ret.tokv.sstr); + string_del(ret2.tokv.sstr); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.tokv.c = '\0'; + return ret; + } + string_del(ret2.tokv.sstr); + ret.loginfo.lineno_end = ret2.loginfo.lineno_end ? ret2.loginfo.lineno_end : ret2.loginfo.lineno; + ret.loginfo.colno_end = ret2.loginfo.colno_end ? ret2.loginfo.colno_end : ret2.loginfo.colno; + } else { + if (!proc_unget_token(src, &ret2)) { + log_memory("failed to unget token next to string token\n"); + string_del(ret.tokv.sstr); + proc_token_del(&ret2); + src->st = PPST_NONE; + ret.tokt = PTOK_INVALID; + ret.tokv.c = '\0'; + return ret; + } + return ret; + } + } + } else return ret; +} diff --git a/wrapperhelper/src/preproc.h b/wrapperhelper/src/preproc.h new file mode 100644 index 0000000..e76f450 --- /dev/null +++ b/wrapperhelper/src/preproc.h @@ -0,0 +1,18 @@ +#pragma once + +#ifndef PREPROC_H +#define PREPROC_H + +#include + +#include "lang.h" +#include "machine.h" + +typedef struct preproc_s preproc_t; + +preproc_t *preproc_new_file(machine_t *target, FILE *f, char *dirname, const char *filename); // Takes ownership of f and dirname +proc_token_t proc_next_token(preproc_t *src); +int proc_unget_token(preproc_t *src, proc_token_t *tok); +void preproc_del(preproc_t *src); + +#endif // PREPROC_H diff --git a/wrapperhelper/src/vector.c b/wrapperhelper/src/vector.c new file mode 100644 index 0000000..d1604e6 --- /dev/null +++ b/wrapperhelper/src/vector.c @@ -0,0 +1,108 @@ +#include "vector.h" + +VECTOR_IMPL(voidp, (void)) +VECTOR_IMPL(char, (void)) +VECTOR_IMPL(charp, (void)) +VECTOR_IMPL(ccharp, (void)) +static void stringp_del(string_t **s) { return string_del(*s); } +VECTOR_IMPL(string, stringp_del) + +VECTOR(voidp) *vector_new_impl(void) { + VECTOR(voidp) *ret = malloc(sizeof(*ret)); + if (!ret) return NULL; + ret->vsize = ret->vcap = 0; ret->content_v = NULL; + return ret; +} + +VECTOR(voidp) *vector_new_cap_impl(size_t elem_size, size_t cap) { + if (!cap) return vector_new_impl(); + VECTOR(voidp) *ret = malloc(sizeof(*ret)); + if (!ret) return NULL; + cap = (cap < VECTOR_MIN_CAP) ? VECTOR_MIN_CAP : cap * 2; + ret->content_v = malloc(cap * elem_size); + if (!ret->content_v) { + free(ret); + return NULL; + } + ret->vcap = cap; + ret->vsize = 0; + return ret; +} + +int vector_reserve_impl(VECTOR(voidp) *v, size_t elem_size, size_t cap) { + size_t new_cap = (cap < VECTOR_MIN_CAP) ? VECTOR_MIN_CAP : cap; + if (new_cap <= v->vcap) return 1; + + void *new_content_v = realloc(v->content_v, elem_size * new_cap); + if (!new_content_v) return 0; + v->content_v = new_content_v; + v->vcap = new_cap; + return 1; +} + +int vector_trim_impl(VECTOR(voidp) *v, size_t elem_size) { + if (v->vsize == v->vcap) return 1; + if (v->vsize) { + void *new_content_v = realloc(v->content_v, elem_size * v->vsize); + if (!new_content_v) return 0; + v->content_v = new_content_v; + v->vcap = v->vsize; + return 1; + } else { + free(v->content_v); + v->content_v = NULL; + v->vcap = 0; + return 1; + } +} + +void vector_common_pop_impl(VECTOR(voidp) *v, size_t elem_size) { + if (--v->vsize < v->vcap / 4) { + size_t new_cap = (v->vcap / 2 < VECTOR_MIN_CAP) ? VECTOR_MIN_CAP : v->vcap / 2; + if (new_cap == v->vcap) return; + void *new_content_v = realloc(v->content_v, elem_size * new_cap); + if (!new_content_v) return; // We don't really care if the realloc fails, we just need to not update anything + v->content_v = new_content_v; + v->vcap = new_cap; + } +} + +void vector_common_popn_impl(VECTOR(voidp) *v, size_t n, size_t elem_size) { + if (n > v->vsize) n = v->vsize; + v->vsize -= n; + if (v->vsize < v->vcap / 4) { + size_t new_cap = v->vcap / 2; + while (v->vsize < new_cap / 4) new_cap /= 2; + new_cap = (new_cap < VECTOR_MIN_CAP) ? VECTOR_MIN_CAP : new_cap; + if (new_cap == v->vcap) return; + void *new_content_v = realloc(v->content_v, elem_size * new_cap); + if (!new_content_v) return; // We don't really care if the realloc fails, we just need to not update anything + v->content_v = new_content_v; + v->vcap = new_cap; + } +} + +void vector_common_clear_impl(VECTOR(voidp) *v) { + if (!v->content_v) return; + free(v->content_v); + v->vsize = v->vcap = 0; v->content_v = NULL; +} + +int vector_push_vec_impl(VECTOR(voidp) *v1, VECTOR(voidp) *v2, size_t start, size_t len, size_t elem_size) { + if (start >= v2->vsize) return 1; + if (start + len > v2->vsize) len = v2->vsize - start; + if (!len) return 1; + if (v1->vsize + len > v1->vcap) { + size_t new_cap = (v1->vcap < VECTOR_MIN_CAP) ? VECTOR_MIN_CAP : v1->vcap * 2; + while (v1->vsize + len > new_cap) { + new_cap = new_cap * 2; + } + void *new_content_v = realloc(v1->content_v, elem_size * new_cap); + if (!new_content_v) return 0; + v1->content_v = new_content_v; + v1->vcap = new_cap; + } + memcpy((char*)v1->content_v + elem_size * v1->vsize, (char*)v2->content_v + elem_size * start, elem_size * len); + v1->vsize += len; + return 1; +} diff --git a/wrapperhelper/src/vector.h b/wrapperhelper/src/vector.h new file mode 100644 index 0000000..5573b9a --- /dev/null +++ b/wrapperhelper/src/vector.h @@ -0,0 +1,214 @@ +#pragma once + +#ifndef VECTOR_H +#define VECTOR_H + +#include +#include +#include +#include + +#include "cstring.h" + +// Note: do not use with empty types; simply use ints in this case. + +/** Thread-unsafe vector implementation + * USAGE: + * ====== + * VECTOR_DECLARE ----------- Declare a new vector type. Takes the name and the element type. + * VECTOR_IMPL -------------- Implements required functions for a vector type. Takes the name and the destructor of a pointer to the element. + * VECTOR_DECLARE_STATIC ---- Declare a new vector type with static implementation. Takes the name and the element type. + * VECTOR_IMPL_STATIC ------- Implements required functions for a vector type. Takes the name and the destructor of a pointer to the element. + * Functions are declared static. + * VECTOR_DEL --------------- Macro that takes the vector name and gives a function taking a vector and deletes it. + * VECTOR ------------------- The vector type. Takes the name. + * VECTOR_ELEM -------------- The element type. Takes the name. + * vector_new --------------- Creates a new vector. Takes the name. + * vector_new_cap ----------- Creates a new vector with a given capacity. Takes the name and the capacity. + * vector_reserve ----------- Ensures a vector has at least a given capacity. Takes the name, the vector and the capacity. May not reduce the vector capacity. + * vector_trim -------------- Ensures a vector has a capacity equal to its size. Takes the name and the vector. May reduce the vector capacity. + * vector_del --------------- Frees a vector. Takes the name and the vector. Destructs the content of the vector. + * vector_steal ------------- Frees a vector and returns the content. Takes the name and the vector. May reduce the vector capacity. + * vector_del_freed --------- Frees a vector without freeing the content. Takes the name and the vector. Does not interact with the content of the vector. + * vector_del_free_from ----- Frees a vector without freeing all of the content. Takes the name, the vector and the first element to free. + * Destroys part of the content of the vector. + * vector_push -------------- Push a new element. Takes the name, the vector and the new element. Does not fail if enough capacity remains. + * vector_push_vec ---------- Push a vector of new elements. Takes the name, the vector and the new element vector. Does not fail if enough capacity remains. + * vector_push_vec_slice ---- Push a slice of a vector of elements. Takes the name, the vector the new element vector, start and size. + * Does not fail if enough capacity remains. + * vector_pop --------------- Pops the last element. Takes the name and the vector. May reduce the vector capacity. + * vector_pop_nodel --------- Pops the last element without freeing it. Takes the name and the vector. May reduce the vector capacity. + * vector_pop_slice --------- Pops the last N element. Takes the name, the vector and the number of elements to remove. + * vector_pop_nodel_slice --- Pops the last N element without freeing them. Takes the name, the vector and the number of elements to remove. + * May reduce the vector capacity. + * vector_clear ------------- Remove every element. Takes the name and the vector. + * vector_clear_nodel ------- Remove every element without freeing them. Takes the name and the vector. + * vector_remove ------------ Removes an element. Takes the name, the vector and the element number. May reduce the vector capacity. + * vector_size -------------- Vector size (number of elements). Takes the name and the vector. + * vector_cap --------------- Vector capacity (number of elements). Takes the name and the vector. + * vector_content ----------- Pointer to the vector content. Takes the name and the vector. + * vector_begin ------------- Start of the vector content. Takes the name and the vector. + * vector_end --------------- End of the vector content. Points to unmanaged memory. Takes the name and the vector. + * vector_last -------------- Last element of the vector. Points to invalid memory if size is zero. Takes the name and the vector. + * vector_for --------------- Iterate over the elements of a vector. This is a for loop. Takes the name, the iterator name and the vector. + * + * VECTOR_DEL(name)(v) is equivalent to vector_del(name, v). + * Predefined vectors: string (string_t*), char (char), charp (char*), voidp (void*) + * + * EXAMPLE: + * ======== + * Header myvec.h: + * --------------- +// ... +VECTOR_DECLARE(myvec, my_elem_t*) +// ... + + * Source myvec.c: + * --------------- +// ... +VECTOR_IMPL(myvec) +// ... + + * Source main.c: + * ------------------- +// ... +extern my_elem_t elems[2]; +int main() { + VECTOR(myvec) *vec = vector_new_cap(myvec, 2); + vector_push(myvec, vec, &elems[0]); + vector_push(myvec, vec, &elems[1]); + vector_for (myvec, it, vec) { + printf("We have an element: %s\n", it->elem_name); + } + vector_del(myvec, vec); +} + */ + +#define VECTOR(name) vector_##name##_t +#define VECTOR_ELEM(name) vector_##name##_elem + +#define VECTOR_MIN_CAP 8 + +#define VECTOR_DECLARE_(name, t, pre) \ + typedef struct vector_##name##_s { \ + size_t vsize; \ + size_t vcap; \ + union { \ + t *content; \ + void *content_v; \ + }; \ + } VECTOR(name); \ + typedef t VECTOR_ELEM(name); \ + pre VECTOR_ELEM(name) *vector_steal_##name(VECTOR(name) *v); \ + pre void vector_pop_del_##name(VECTOR(name) *v); \ + pre void vector_popn_del_##name(VECTOR(name) *v, size_t idx); \ + pre void vector_clear_del_##name(VECTOR(name) *v); \ + pre void vector_del_from_##name(VECTOR(name) *v, size_t idx); \ + pre int vector_push_elem_##name(VECTOR(name) *v, VECTOR_ELEM(name) elem); +#define VECTOR_DECLARE(name, t) VECTOR_DECLARE_(name, t,) +#define VECTOR_DECLARE_STATIC(name, t) VECTOR_DECLARE_(name, t, static) + +VECTOR_DECLARE(voidp, void*) + +VECTOR(voidp) *vector_new_impl(void); +VECTOR(voidp) *vector_new_cap_impl(size_t elem_size, size_t cap); +int vector_reserve_impl(VECTOR(voidp) *v, size_t elem_size, size_t cap); +int vector_trim_impl(VECTOR(voidp) *v, size_t elem_size); +void vector_common_pop_impl(VECTOR(voidp) *v, size_t elem_size); +void vector_common_popn_impl(VECTOR(voidp) *v, size_t n, size_t elem_size); +void vector_common_clear_impl(VECTOR(voidp) *v); +int vector_push_vec_impl(VECTOR(voidp) *v1, VECTOR(voidp) *v2, size_t start, size_t len, size_t elem_size); + +#define vector_new(name) (VECTOR(name)*)vector_new_impl() +#define vector_new_cap(name, cap) (VECTOR(name)*)vector_new_cap_impl(sizeof(VECTOR_ELEM(name)), (cap)) +#define vector_del(name, v) vector_del_from_##name((v), 0) +#define vector_del_freed(name, v) vector_del_from_##name((v), vector_size(name, (v))) +#define vector_del_free_from(name, v, i) vector_del_from_##name((v), (i)) +#define VECTOR_DEL(name) vector_del_##name +#define vector_steal(name, v) vector_steal_##name((v)) +#define vector_reserve(name, v, cap) vector_reserve_impl((VECTOR(voidp)*)(v), sizeof(VECTOR_ELEM(name)), (cap)) +#define vector_trim(name, v) vector_trim_impl((VECTOR(voidp)*)(v), sizeof(VECTOR_ELEM(name))) +#define vector_push(name, v, e) vector_push_elem_##name((v), (e)) +#define vector_push_vec(name, v1, v2) vector_push_vec_impl((VECTOR(voidp)*)(v1), (VECTOR(voidp)*)(v2), 0, vector_size(name, (v2)), sizeof(VECTOR_ELEM(name))) +#define vector_push_vec_slice(name, v1, v2, s, l) vector_push_vec_impl((VECTOR(voidp)*)(v1), (VECTOR(voidp)*)(v2), (s), (l), sizeof(VECTOR_ELEM(name))) +#define vector_pop(name, v) vector_pop_del_##name((v)) +#define vector_pop_slice(name, v, n) vector_popn_del_##name((VECTOR(voidp)*)(v), (n)) +#define vector_pop_nodel(name, v) vector_common_pop_impl((VECTOR(voidp)*)(v), sizeof(VECTOR_ELEM(name))) +#define vector_pop_nodel_slice(name, v, n) vector_common_popn_impl((VECTOR(voidp)*)(v), (n), sizeof(VECTOR_ELEM(name))) +#define vector_clear(name, v) vector_clear_del_##name((v)) +#define vector_clear_nodel(name, v) vector_common_clear_impl((VECTOR(voidp)*)(v)) +#define vector_remove(name, v, i) vector_remove_##name((v), (i)) + +#define vector_size(name, v) ((v)->vsize) +#define vector_cap(name, v) ((v)->vcap) +#define vector_content(name, v) ((v)->content) +#define vector_begin(name, v) ((v)->content) +#define vector_end(name, v) ((v)->content + (v)->vsize) +#define vector_last(name, v) ((v)->content[(v)->vsize - 1]) +#define vector_for(name, itname, v) \ + for (VECTOR_ELEM(name) *itname = vector_begin(name, (v)); itname < vector_end(name, (v)); ++itname) +#define vector_for_from(name, itname, v, i) \ + for (VECTOR_ELEM(name) *itname = vector_begin(name, (v)) + (i); itname < vector_end(name, (v)); ++itname) +#define vector_for_rev(name, itname, v) \ + for (VECTOR_ELEM(name) *itname = (v)->content ? vector_end(name, (v)) - 1 : NULL; (v)->content && (itname >= vector_begin(name, (v))); --itname) + +#define VECTOR_IMPL_(name, dtor, pre) \ + pre VECTOR_ELEM(name) *vector_steal_##name(VECTOR(name) *v) { \ + vector_trim(name, v); \ + VECTOR_ELEM(name) *ret = v->content; \ + free(v); \ + return ret; \ + } \ + \ + pre void vector_pop_del_##name(VECTOR(name) *v) { \ + if (v->vsize) { \ + dtor(&vector_last(name, v)); \ + vector_common_pop_impl((VECTOR(voidp)*)v, sizeof(VECTOR_ELEM(name))); \ + } \ + } \ + pre void vector_popn_del_##name(VECTOR(name) *v, size_t n) { \ + if (v->vsize > n) n = v->vsize; \ + vector_for_from(name, it, v, v->vsize - n) { dtor(it); } \ + vector_common_popn_impl((VECTOR(voidp)*)v, n, sizeof(VECTOR_ELEM(name))); \ + } \ + \ + pre void vector_remove_##name(VECTOR(name) *v, size_t i) { \ + dtor(v->content + i); \ + memmove(v->content + i, v->content + i + 1, (v->vsize - i - 1) * sizeof(VECTOR_ELEM(name))); \ + vector_common_pop_impl((VECTOR(voidp)*)v, sizeof(VECTOR_ELEM(name))); \ + } \ + \ + pre void vector_clear_del_##name(VECTOR(name) *v) { \ + if (!v->content) return; \ + vector_for(name, it, v) { dtor(it); } \ + free(v->content); \ + v->content = NULL; \ + v->vcap = v->vsize = 0; \ + } \ + \ + pre void vector_del_from_##name(VECTOR(name) *v, size_t idx) { \ + vector_for_from(name, it, v, idx) { dtor(it); } \ + if (v->content) free(v->content); \ + free(v); \ + } \ + \ + pre int vector_push_elem_##name(VECTOR(name) *v, VECTOR_ELEM(name) elem) { \ + if (v->vsize >= v->vcap) { \ + size_t new_cap = (v->vcap < VECTOR_MIN_CAP) ? VECTOR_MIN_CAP : v->vcap * 2; \ + VECTOR_ELEM(name) *new_content = realloc(v->content, sizeof(VECTOR_ELEM(name)) * new_cap); \ + if (!new_content) return 0; \ + v->content = new_content; \ + v->vcap = new_cap; \ + } \ + v->content[v->vsize++] = elem; \ + return 1; \ + } +#define VECTOR_IMPL(name, dtor) VECTOR_IMPL_(name, dtor,) +#define VECTOR_IMPL_STATIC(name, dtor) VECTOR_IMPL_(name, dtor, static inline) + +VECTOR_DECLARE(char, char) +VECTOR_DECLARE(charp, char*) +VECTOR_DECLARE(ccharp, const char*) +VECTOR_DECLARE(string, string_t*) + +#endif // VECTOR_H diff --git a/wrapperhelper/utils.h b/wrapperhelper/utils.h deleted file mode 100644 index 06acbb7..0000000 --- a/wrapperhelper/utils.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -static const clang::Type* StripTypedef(clang::QualType type) { - if (type->isTypedefNameType()) { - return StripTypedef(type->getAs()->getDecl()->getUnderlyingType()); - } else { - return type.getTypePtr(); - } -} - -// FIXME: Need to support other triple except default target triple -static std::string GetDeclHeaderFile(clang::ASTContext& Ctx, clang::Decl* Decl) { - const auto& SourceManager = Ctx.getSourceManager(); - const clang::FileID FileID = SourceManager.getFileID(Decl->getBeginLoc()); - const clang::FileEntry *FileEntry = SourceManager.getFileEntryForID(FileID); - if (FileEntry) { - return FileEntry->getName().str(); - } - return ""; -} \ No newline at end of file